diff --git a/official/x.35/ExpressBars 6/EULA.txt b/official/x.35/ExpressBars 6/EULA.txt new file mode 100644 index 00000000..e6c4abe7 --- /dev/null +++ b/official/x.35/ExpressBars 6/EULA.txt @@ -0,0 +1,123 @@ +DEVELOPER EXPRESS INC +ExpressBars(tm) ExpressSideBar(tm) and ExpressDocking Library(tm) SOFTWARE COMPONENT PRODUCT(S) COMPONENT SUITE +Copyright (C) 1998-2008 Developer Express Inc. + +END-USER LICENSE AGREEMENT +FOR ALL SOFTWARE COMPONENT PRODUCT(S) + +IMPORTANT- READ CAREFULLY: This DEVELOPER EXPRESS INC ("DEVEXPRESS") End-User License Agreement ("EULA") is a legal agreement between you, a developer of software applications, ("Developer End User") and DEVEXPRESS for all DEVEXPRESS products, controls, source code, demos, intermediate files, media, printed materials, and "online" or electronic documentation ("SOFTWARE COMPONENT PRODUCT(S)") contained in this installation file. + +DEVEXPRESS grants to you as an individual, a personal, nonexclusive license to install and use the SOFTWARE COMPONENT PRODUCT(S) for the sole purposes of designing, developing, testing, and deploying application programs which you create. By installing, copying, or otherwise using the SOFTWARE COMPONENT PRODUCT(S), you agree to be bound by the terms of this EULA. If you do not agree to any part of the terms of this EULA, DO NOT INSTALL, USE, EVALUATE, OR REPLICATE IN ANY MANNER, ANY PART, FILE OR PORTION OF THE SOFTWARE COMPONENT PRODUCT(S). + +All SOFTWARE COMPONENT PRODUCT(S) is licensed, not sold. If you are an individual, you must acquire an individual license for the SOFTWARE COMPONENT PRODUCT(S) from DEVEXPRESS or its authorized resellers. If you are an entity, you must acquire and assign an individual license for each Developer End User within your organization using and or developing with the SOFTWARE COMPONENT PRODUCT(S) from DEVEXPRESS or its authorized resellers. + +If the SOFTWARE COMPONENT PRODUCT(S) you have obtained is marked as a "TRIAL" or "EVALUATION," you may install one copy of the SOFTWARE COMPONENT PRODUCT(S) for testing purposes for a period of 30 calendar days from the date of installation ("Evaluation Period"). Upon expiration of the Evaluation Period, the SOFTWARE COMPONENT PRODUCT(S) must be uninstalled and all copies destroyed. + +RIGOROUS ENFORCEMENT OF INTELLECTUAL PROPERTY RIGHTS. If the licensed right of use for this SOFTWARE COMPONENT PRODUCT(S) is purchased by you with any intent to reverse engineer, decompile, create derivative works, and the exploitation or unauthorized transfer of, any DEVEXPRESS intellectual property and trade secrets, to include any exposed methods or source code where provided, no licensed right of use shall exist, and any PRODUCT(s) created as a result shall be judged illegal by definition of all applicable law. Any sale or resale of intellectual property or created derivatives so obtained will be prosecuted to the fullest extent of all local, federal and international law. + +1. GRANT OF LICENSE. + +This EULA, if legally executed as defined herein, licenses and so grants the single individual Developer End User the following rights: + +SOFTWARE COMPONENT PRODUCT(S) - Developer End User may install and use the SOFTWARE COMPONENT PRODUCT(S) on a single computer. Developer End User may also install and use the SOFTWARE COMPONENT PRODUCT(S) on a portable computer. + +2. LIMITATIONS ON REVERSE ENGINEERING, DECOMPILATION, AND DISASSEMBLY. + +You may not reverse engineer, decompile, create derivative works, translate, or disassemble the SOFTWARE COMPONENT PRODUCT(S), and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation. You agree to take all reasonable, legal and appropriate measures to prohibit the illegal dissemination of the SOFTWARE COMPONENT PRODUCT(S) or any of its constituent parts and redistributables to the fullest extent of all applicable local, US Codes and International Laws and Treaties regarding anti-circumvention, including but not limited to, the Geneva and Berne World Intellectual Property Organization (WIPO) Diplomatic Conferences. + +3. SEPARATION OF COMPONENTS. + +The SOFTWARE COMPONENT PRODUCT(S) is licensed as a single PRODUCT(s). The SOFTWARE COMPONENT PRODUCT(S) and its constituent parts and any provided redistributables may not be reverse engineered, decompiled, disassembled or separated for use on more than one computer, nor placed for distribution, sale, or resale as individual creations by Developer End User. The provision of source code, if included with the SOFTWARE COMPONENT PRODUCT(S), does not constitute transfer of any legal rights to such code, and resale or distribution of all or any portion of all source code and intellectual property will be prosecuted to the fullest extent of all applicable local, federal and international laws. All DEVEXPRESS libraries, source code, redistributables and other files remain DEVEXPRESS's exclusive property. You may not distribute any files, except those that DEVEXPRESS has expressly designated as Redistributable. + +4. RENTAL. + +You may not rent, lease, or lend the SOFTWARE COMPONENT PRODUCT(S). + +5. TRANSFER. + +You may NOT permanently or temporarily transfer ANY of your rights under this EULA to any individual or entity without prior written approval from DEVEXPRESS. Regardless of any modifications which you make and regardless of how you might compile, link, and/or package your programs, under no circumstances may the libraries, Redistributables, and/or other files of the SOFTWARE COMPONENT PRODUCT(S) (including any portions thereof) be used for developing programs by anyone other than you. Only you as the licensed Developer End User have the right to use the libraries, redistributables, or other files of the SOFTWARE COMPONENT PRODUCT(S) (or any portions thereof) for developing programs created with the SOFTWARE COMPONENT PRODUCT(S). In particular, you may not share copies of the Redistributables with other co-developers. You may not reproduce or distribute any DEVEXPRESS documentation without DEVEXPRESS's explicit permission. + +If you are an entity (Company), you must acquire and assign a license to each Developer End User within your organization using and or developing with the SOFTWARE COMPONENT PRODUCT(S). With written notification to DEVEXPRESS, Company may transfer the license obtained for a Developer End User to another Developer End User employed or otherwise engaged by Company if the initial Developer End User is no longer employed or engaged by Company or is reassigned to another function within Company and no longer develops software applications using the SOFTWARE COMPONENT PRODUCT(S). In addition, with written notification to DEVEXPRESS, Company may transfer its license of the SOFTWARE COMPONENT PRODUCT(S) to a successor Company. + +6. ROYALTY FREE REDISTRIBUTION. + +DEVEXPRESS PRODUCT(s) may include certain files ("Redistributable(s)") intended for distribution by you to the users of software applications which you create. Redistributables include, for example, those files identified in printed or on-line documentation as redistributable files, or those files preselected for deployment by an install utility provided with the SOFTWARE COMPONENT PRODUCT(S) (if any). In all circumstances, the Redistributables for the SOFTWARE COMPONENT PRODUCT(S) are only those files specifically designated as such by DEVEXPRESS. + +Subject to all of the terms and conditions in this EULA, you may reproduce and distribute copies of the Redistributables, provided that such copies are made from the original copy of the Redistributables included with the SOFTWARE COMPONENT PRODUCT(S) or modified versions of the Redistributables which are provided to you by DEVEXPRESS or those which you create. Copies of Redistributables may only be distributed with and for the sole purpose of executing application programs permitted under this EULA that you have created using the SOFTWARE COMPONENT PRODUCT(S). + +REDISTRIBUTABLES. To obtain a list of redistributables that apply under this EULA, contact support@devexpress.com + +AT NO TIME MAY DEVELOPER END USER CREATE ANY TOOL, REDISTRIBUTABLE, OR SOFTWARE COMPONENT PRODUCT(S) THAT DIRECTLY OR INDIRECTLY COMPETES WITH DEVEXPRESS SOFTWARE COMPONENT PRODUCT(S) WHICH UTILIZES ALL OR ANY PORTION OF THE SOFTWARE COMPONENT PRODUCT(S) contained within this installation. + +Distribution by the Developer End User of any design-time tools (EXE's OCX's or DLL's), executables, and source code distributed to Developer End User by DEVEXPRESS as part of this SOFTWARE COMPONENT PRODUCT(S) and not explicitly identified as a redistributable file is strictly prohibited. The Developer End User shall not develop software applications that provide an application programming interface to the SOFTWARE COMPONENT PRODUCT(S) or the SOFTWARE COMPONENT PRODUCT(S) as modified. + +The Developer End User may NOT distribute the SOFTWARE COMPONENT PRODUCT(S), in any format, to other users for development or application compilation purposes. Specifically, if Developer End User creates a control using the SOFTWARE COMPONENT PRODUCT(S) as a constituent control, Developer End User may NOT distribute the control created with the SOFTWARE COMPONENT PRODUCT(S) (in any format) to users to be used used at design time and or for ANY development purposes. + +Developer End User MAY NOT REDISTRIBUTE any SOFTWARE COMPONENT PRODUCT(s) files if using an evaluation, trial, Not for Resale, or demo version of the SOFTWARE COMPONENT PRODUCT(s). + +7. UPGRADES. + + +If the SOFTWARE COMPONENT PRODUCT(S) is labeled as an upgrade, you must be properly licensed to use the SOFTWARE COMPONENT PRODUCT(S) identified by DEVEXPRESS as being eligible for the upgrade in order to use the SOFTWARE COMPONENT PRODUCT(S). A SOFTWARE COMPONENT PRODUCT(S) labeled as an upgrade replaces and/or supplements the SOFTWARE COMPONENT PRODUCT(S) that formed the basis for your eligibility for the upgrade, and together constitutes a single PRODUCT(S). You may use the resulting upgraded PRODUCT(S) only in accordance with all the terms of this EULA. + +8. COPYRIGHT. + +All title and copyrights in and to the SOFTWARE COMPONENT PRODUCT(S) (including but not limited to any copywritten images, demos, source code, intermediate files, packages, photographs, redistributables, animations, video, audio, music, text, and "applets" incorporated into the SOFTWARE COMPONENT PRODUCT(S) the accompanying printed materials, and any copies of the SOFTWARE COMPONENT PRODUCT(S)) are owned by DEVEXPRESS or its subsidiaries. The SOFTWARE COMPONENT PRODUCT(S) is protected by copyright laws and international treaty provisions and therefore, you must treat the SOFTWARE COMPONENT PRODUCT(S) like any other copyrighted material except that you may install the SOFTWARE COMPONENT PRODUCT(S) as described in this EULA. + +9. DUAL-MEDIA SOFTWARE COMPONENT PRODUCT(S). + +You may receive the SOFTWARE COMPONENT PRODUCT(S) in more than one medium. Regardless of the medium, you may use only one medium that is appropriate for your single computer. You may not loan, sell, rent, lease, or otherwise transfer in any manner the other medium to another user or entity. + +10. U.S. GOVERNMENT RESTRICTED RIGHTS. + +The Licensed Software is Commercial Computer Software provided with RESTRICTED RIGHTS under Federal Acquisition Regulations and agency supplements to them. Use, duplication or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFAR 255.227-7013 et. seq. or 252.211-7015, or subparagraphs (a) through (d) of the Commercial Computer Software Restricted Rights at FAR 52.227-19, as applicable, or similar clauses in the NASA FAR Supplement. Contractor-manufacturer is Developer Express Inc. / 6375 S. Pecos Rd Suite 118, Las Vegas NV 89120. + +11. EXPORT RESTRICTIONS. + +DEVEXPRESS expressly complies with all export restrictions imposed by the government of the United States of America. You, as Developer End User, must agree not to export or re-export the SOFTWARE COMPONENT PRODUCT(S) within any created application to any country, person, entity or end user subject to U.S.A. export restrictions. Restricted countries currently include, but are not necessarily limited to Cuba, Iran, Iraq, Libya, North Korea, Sudan, and Syria. You warrant and represent that neither the U.S.A. Bureau of Export Administration nor any other federal agency has suspended, revoked or denied your export privileges. + +12. NOTE ON JAVA SUPPORT. + +Certain SOFTWARE COMPONENT PRODUCT(S) may contain support for programs written in Java. Java technology is not fault tolerant and is not designed, manufactured, or intended for use or resale as on-line control equipment in hazardous environments requiring fail-safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines, or weapons systems, in which the failure of Java technology could lead directly to death, personal injury, or severe physical or environmental damage. + +13. DISCLAIMER OF WARRANTY. + +DEVEXPRESS expressly disclaims any warranty for the SOFTWARE COMPONENT PRODUCT(S). THE SOFTWARE COMPONENT PRODUCT(S) AND ANY RELATED DOCUMENTATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. DEVEXPRESS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY REPRESENTATIONS REGARDING THE USE, OR THE RESULTS OF THE USE, OF THE SOFTWARE COMPONENT PRODUCT(S) IN TERMS OF CORRECTNESS, ACCURACY, RELIABILITY, OR OTHERWISE. THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE COMPONENT PRODUCT(S) REMAINS WITH YOU. No oral or written information or advice given by DEVEXPRESS or its employees shall create a warranty or in any way increase the scope of this warranty. + +14. LIMITATIONS ON LIABILITY. + +To the maximum extent permitted by applicable law, in no event shall DEVEXPRESS be liable for any special, incidental, indirect, or consequential damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use the SOFTWARE COMPONENT PRODUCT(S) or the provision of or failure to provide Support Services, even if DEVEXPRESS has been advised of the possibility of such damages. + +Developer End User understands that the SOFTWARE COMPONENT PRODUCT(S) may produce inaccurate results because of a failure or fault within the SOFTWARE COMPONENT PRODUCT(S) or failure by Developer End User to properly use and or deploy the SOFTWARE COMPONENT PRODUCT(S). Developer End User assumes full and sole responsibility for any use of the SOFTWARE COMPONENT PRODUCT(S), and bears the entire risk for failures or faults within the SOFTWARE COMPONENT PRODUCT(S). You agree that regardless of the cause of failure or fault or the form of any claim, YOUR SOLE REMEDY AND DEVEXPRESS'S SOLE OBLIGATION SHALL BE GOVERNED BY THIS AGREEMENT AND IN NO EVENT SHALL DEVEXPRESS'S LIABILITY EXCEED THE PRICE PAID TO DEVEXPRESS FOR THE SOFTWARE COMPONENT PRODUCT(S). This Limited Warranty is void if failure of the SOFTWARE COMPONENT PRODUCT(S) has resulted from accident, abuse, alteration, unauthorized use or misapplication of the SOFTWARE COMPONENT PRODUCT(S). + +15. INDEMNIFICATION. + +You hereby agree to indemnify DEVEXPRESS and its officers, directors, employees, agents, and representatives from each and every demand, claim, loss, liability, or damage of any kind, including actual attorneys fees, whether in tort or contract, that it or any of them may incur by reason of, or arising out of, any claim which is made by any third party with respect to any breach or violation of this Agreement by you or any claims based on the Applications and the SOFTWARE COMPONENT PRODUCT(S) included herein. + +16. FOR SOFTWARE COMPONENT PRODUCTS THAT EMULATE THE LOOK & FEEL AND CAPABILITIES OF THE MICROSOFT(R) OFFICE(R) 2007 UI. + +No rights are provided to Developer End User to the Microsoft(r) Office(r) 2007 UI under this DEVEXPRESS License Agreement. To learn more about licensing requirements for the Microsoft(r) Office(r) 2007 UI, you must contact Microsoft Corporation directly. Information related to Microsoft's licensing requirements for the Office(r) 2007 UI can be found at: http://msdn.microsoft.com/officeui. + +17. SUPPORT SERVICES. + +DEVEXPRESS may provide you with support services related to the SOFTWARE COMPONENT PRODUCT(S) ("Support Services"). Use of Support Services is governed by DEVEXPRESS policies and programs described in the user manual, in "on line" documentation and/or other DEVEXPRESS provided materials. Any supplemental SOFTWARE COMPONENT PRODUCT(S) provided to you as part of the Support Services shall be considered part of the SOFTWARE COMPONENT PRODUCT(S) and subject to the terms and conditions of this EULA. With respect to technical information you provide to DEVEXPRESS as part of the Support Services, DEVEXPRESS may use such information for its business purposes, including for SOFTWARE COMPONENT PRODUCT(s) support and development. DEVEXPRESS will not utilize such technical information in a form that personally identifies you. + +18. TERMINATION. + +Without prejudice to any other rights or remedies, DEVEXPRESS will terminate this EULA upon your failure to comply with all the terms and conditions of this EULA. In such events, you must destroy all copies of the SOFTWARE COMPONENT PRODUCT(S) and all of its component parts including any related documentation, and must remove ANY and ALL use of such technology immediately from any applications using technology contained in the SOFTWARE COMPONENT PRODUCT(S) developed by you, whether in native, altered or compiled state. + +19. TAX. + +DEVEXPRESS delivers its software electronically and does not collect sales or use tax for residents of US states in which it operates. You should confirm that your local, state, or federal government does not impose any sales or use tax on electronically delivered software. You are entirely liable for any such sales or use tax. + +20. MISCELLANEOUS. + +This EULA shall be construed, interpreted and governed by the laws of the State of Nevada, U.S.A. This EULA gives you specific legal rights; you may have others that vary from state to state and from country to country. + +This EULA may only be modified in writing signed by you and an authorized officer of DEVELOPER EXPRESS INC. If any provision of this EULA is found void or unenforceable, the remainder will remain valid and enforceable according to its terms. If any remedy provided is determined to have failed for its essential purpose, all limitations of liability and exclusions of damages set forth in the Limited Warranty shall remain in effect. + +DEVEXPRESS reserves all rights not specifically granted in this EULA. + +ACKNOWLEDGEMENTS. Developer End User acknowledges that he or she has read this Agreement, understands it, and agrees to be bound by its terms and conditions. + +Should you have any questions concerning this EULA, or if you desire to contact DEVEXPRESS for any reason, please contact us directly at us in the United States of America at 702-262-0609, or write: Developer Express Inc. Legal department / 6330 McLeod Dr Suite 1, Las Vegas NV 89120. \ No newline at end of file diff --git a/official/x.35/ExpressBars 6/Help/ExpressBars6.cnt b/official/x.35/ExpressBars 6/Help/ExpressBars6.cnt new file mode 100644 index 00000000..58809aa4 --- /dev/null +++ b/official/x.35/ExpressBars 6/Help/ExpressBars6.cnt @@ -0,0 +1,380 @@ +:Base ExpressBars6.hlp +:Title ExpressBars Suite 6 +:Index ExpressBars Suite 6=ExpressBars6.hlp +1 ExpressBars Suite 6 +2 Overview=Overview +2 What's New in v6=CD_Whats_New_in_v6 +2 Known Issues and Important Changes List=CD_Known_Issues_and_Important_Changes_List +2 Ribbon +3 Fundamentals +4 Ribbon User Interface=CD_Ribbon_User_Interface +4 Ribbon Form=CD_Ribbon_Form +4 Ribbon Control=CD_Ribbon_Control +4 Ribbon Application Button=CD_Ribbon_Application_Button +4 Ribbon Application Menu=CD_Ribbon_Application_Menu +4 Ribbon Quick Access Toolbar=CD_Ribbon_Quick_Access_Toolbar +4 Ribbon Status Bar=CD_Ribbon_Status_Bar +4 Ribbon Tab=CD_Ribbon_Tab +4 Ribbon Tab Group=CD_Ribbon_Tab_Group +4 Ribbon KeyTips=IDH_CD_Fundamentals_KeyTips +4 Ribbon Galleries +5 Overview=CD_Ribbon_Galleries +5 In-Ribbon Gallery=CD_In_Ribbon_Gallery +5 Dropdown Gallery=CD_Dropdown_Gallery +5 Gallery Items=CD_Gallery_Items +5 Gallery Filters=CD_Gallery_Filters +5 Gallery Groups=CD_Gallery_Item_Groups +3 Concepts +4 Best Practices=CD_Best_Practices +4 Converting Bars to Ribbon=CD_Converting_Bars_to_Ribbon +3 How To... +4 Add a Dialog Launcher to the Ribbon Tab Group at Design-Time=CD_How_to_Add_a_Dialog_Launcher_to_the_Ribbon_Tab_Group_at_Design_Time +4 Add a Dialog Launcher to the Ribbon Tab Group in Code=CD_How_to_Add_a_Dialog_Launcher_to_the_Ribbon_Tab_Group_in_Code +4 Create a Ribbon Control at Design Time=CD_How_to_Create_a_Ribbon_Control_at_Design_Time +4 Create a Ribbon Control in Code=CD_How_to_Create_a_Ribbon_Control_in_Code +4 Create an in-Ribbon Gallery at Design Time=CD_How_to_Create_an_in_Ribbon_Gallery_at_Design_Time +4 Make an Item Occupy Several Rows within a Ribbon Toolbar=CD_How_to_Make_an_Item_Occupy_Several_Rows_within_a_Ribbon_Toolbar +3 Reference +4 Components +5 TdxBarApplicationMenu=IDH_Class_TdxBarApplicationMenu +5 TdxBarScreenTipRepository=IDH_Class_TdxBarScreenTipRepository +5 TdxRibbon=IDH_Class_TdxRibbon +5 TdxRibbonDropDownGallery=IDH_Class_TdxRibbonDropDownGallery +5 TdxRibbonPopupMenu=IDH_Class_TdxRibbonPopupMenu +5 TdxRibbonStatusBar=IDH_Class_TdxRibbonStatusBar +4 Units +5 dxRibbon Unit Overview=IDH_Unit_dxRibbon +5 dxRibbonGallery Unit Overview=IDH_Unit_dxRibbonGallery +5 dxRibbonStatusBar Unit Overview=IDH_Unit_dxRibbonStatusBar +4 Status Bar Panel Styles +5 TdxStatusBarToolbarPanelStyle=IDH_Class_TdxStatusBarToolbarPanelStyle +4 Miscellaneous Classes And Types +5 TdxBarApplicationMenuButton=IDH_Class_TdxBarApplicationMenuButton +5 TdxBarApplicationMenuButtons=IDH_Class_TdxBarApplicationMenuButtons +5 TdxBarCaptionButton=IDH_Class_TdxBarCaptionButton +5 TdxBarCaptionButtons=IDH_Class_TdxBarCaptionButtons +5 TdxBarCustomScreenTipBand=IDH_Class_TdxBarCustomScreenTipBand +5 TdxBarExtraPaneItem=IDH_Class_TdxBarExtraPaneItem +5 TdxBarExtraPaneItems=IDH_Class_TdxBarExtraPaneItems +5 TdxBarPainter=IDH_Class_TdxBarPainter +5 TdxBarScreenTip=IDH_Class_TdxBarScreenTip +5 TdxBarScreenTipBand=IDH_Class_TdxBarScreenTipBand +5 TdxBarScreenTipBandTextAlign=IDH_Type_TdxBarScreenTipBandTextAlign +5 TdxBarScreenTipCollection=IDH_Class_TdxBarScreenTipCollection +5 TdxBarScreenTipFooterBand=IDH_Class_TdxBarScreenTipFooterBand +5 TdxCustomRibbon=IDH_Class_TdxCustomRibbon +5 TdxQuickAccessToolbarPosition=IDH_Type_TdxQuickAccessToolbarPosition +5 TdxRibbonApplicationButton=IDH_Class_TdxRibbonApplicationButton +5 TdxRibbonAssignedFonts=IDH_Type_TdxRibbonAssignedFonts +5 TdxRibbonFonts=IDH_Class_TdxRibbonFonts +5 TdxRibbonGalleryCustomOptions=IDH_Class_TdxRibbonGalleryCustomOptions +5 TdxRibbonGalleryFilter=IDH_Class_TdxRibbonGalleryFilter +5 TdxRibbonGalleryFilterCategories=IDH_Class_TdxRibbonGalleryFilterCategories +5 TdxRibbonGalleryFilterCategory=IDH_Class_TdxRibbonGalleryFilterCategory +5 TdxRibbonGalleryFilterCategoryGroups=IDH_Class_TdxRibbonGalleryFilterCategoryGroups +5 TdxRibbonGalleryGroup=IDH_Class_TdxRibbonGalleryGroup +5 TdxRibbonGalleryGroupHeader=IDH_Class_TdxRibbonGalleryGroupHeader +5 TdxRibbonGalleryGroupItem=IDH_Class_TdxRibbonGalleryGroupItem +5 TdxRibbonGalleryGroupItems=IDH_Class_TdxRibbonGalleryGroupItems +5 TdxRibbonGalleryGroupItemTextKind=IDH_Type_TdxRibbonGalleryGroupItemTextKind +5 TdxRibbonGalleryGroupOptions=IDH_Class_TdxRibbonGalleryGroupOptions +5 TdxRibbonGalleryGroups=IDH_Class_TdxRibbonGalleryGroups +5 TdxRibbonGalleryImagePosition=IDH_Type_TdxRibbonGalleryImagePosition +5 TdxRibbonGalleryItemPullHighlighting=IDH_Class_TdxRibbonGalleryItemPullHighlighting +5 TdxRibbonGalleryItemPullHighlightingDirection=IDH_TdxRibbonGalleryItemPullHighlighting_Direction +5 TdxRibbonGalleryItemSelectionMode=IDH_Type_TdxRibbonGalleryItemSelectionMode +5 TdxRibbonGalleryOptions=IDH_Class_TdxRibbonGalleryOptions +5 TdxRibbonGallerySubMenuResizing=IDH_Type_TdxRibbonGallerySubMenuResizing +5 TdxRibbonPopupMenuItems=IDH_Type_TdxRibbonPopupMenuItems +5 TdxRibbonQuickAccessToolbar=IDH_Class_TdxRibbonQuickAccessToolbar +5 TdxRibbonTab=IDH_Class_TdxRibbonTab +5 TdxRibbonTabCollection=IDH_Class_TdxRibbonTabCollection +5 TdxRibbonTabGroup=IDH_Class_TdxRibbonTabGroup +5 TdxRibbonTabGroups=IDH_Class_TdxRibbonTabGroups +5 TdxScreenTipRepositoryFonts=IDH_Type_TdxScreenTipRepositoryFonts +2 Fundamentals +3 Basics=Basics +3 Bar Manager=IDH_CD_Bar_Manager +3 Toolbars=IDH_CD_Toolbars +3 Bar Items and Links=IDH_CD_Bar_Items_and_Links +3 Category=IDH_CD_Fundamentals_Category +3 Item Group=IDH_CD_Fundamentals_Item_Group +3 Ribbon +4 Ribbon User Interface=CD_Ribbon_User_Interface +4 Ribbon Form=CD_Ribbon_Form +4 Ribbon Control=CD_Ribbon_Control +4 Ribbon Application Button=CD_Ribbon_Application_Button +4 Ribbon Application Menu=CD_Ribbon_Application_Menu +4 Ribbon Quick Access Toolbar=CD_Ribbon_Quick_Access_Toolbar +4 Ribbon Status Bar=CD_Ribbon_Status_Bar +4 Ribbon Tab=CD_Ribbon_Tab +4 Ribbon Tab Group=CD_Ribbon_Tab_Group +4 Ribbon KeyTips=IDH_CD_Fundamentals_KeyTips +4 Ribbon Galleries +5 Overview=CD_Ribbon_Galleries +5 In-Ribbon Gallery=CD_In_Ribbon_Gallery +5 Dropdown Gallery=CD_Dropdown_Gallery +5 Gallery Items=CD_Gallery_Items +5 Gallery Filters=CD_Gallery_Filters +5 Gallery Groups=CD_Gallery_Item_Groups +2 Concepts +3 Accessing Ribbon UI and Bar Elements=IDH_CD_Accessing_Ribbon_UI_and_Bar_Elements +3 Alpha Blending and Background Images=CD_Alpha_Blending_and_Background_Images +3 Bar Dock Controls=CD_Bar_Dock_Controls +3 Bar Editor Inheritance Diagram=CD_Bar_Editor_Inheritance_Diagram +3 Bar Item Options=CD_Bar_Item_Options +3 Bar Manager Options=CD_Bar_Manager_Options +3 Creating Toolbar Items and Item Controls=Creating_Toolbar_Items_and_Item_Controls +3 Customizing Toolbar Items and Item Controls=Customizing_Toolbar_Items_and_Item_Controls +3 In-place Editors=IDH_CD_Inplace_Editors +3 List of Bar Item Types=IDH_CD_List_of_Bar_Item_Types +3 Merging Bars and Menus in MDI Applications=CD_Merging_Bars_and_Menus +3 Recently Used Items=IDH_CD_Recently_Used_Items +3 Toolbar Options=CD_Toolbar_Options +3 Ribbon +4 Best Practices=CD_Best_Practices +4 Converting Bars to Ribbon=CD_Converting_Bars_to_Ribbon +3 Localization +4 Resource Strings=IDH_CD_list_of_resource_strings +4 ExpressBars: Resource Strings=IDH_CD_ExpressBars_Resource_Strings +3 Saving and Restoring Bar Layout +4 Overview=IDH_CD_Saving_and_Restoring_Bar_Layout +4 Saving and Restoring Bar Layout Automatically=IDH_CD_Saving_and_Restoring_Bar_Layout_Automatically +4 Saving and Restoring Bar Layout Manually=IDH_CD_Saving_and_Restoring_Bar_Layout_Manually +2 Customization Capabilities +3 Appearance Customization=CD_Appearance_Customization +3 Customization Form=IDH_CustomizingForm +3 Customizing Popup Menu=CustomizingPopupMenu +2 End-User Capabilities +3 Using Context Menus=Using_Context_Menus +3 Using Drag and Drop=Using_Drag_and_Drop +3 Using Enter Value Dialog=Using_Enter_Value_Dialog +3 Using the Customization Form=Using_the_Customization_Form +3 Using the Keyboard=Using_the_Keyboard +2 How To... +3 Add a Standalone Editor to a Toolbar=How_To_Add_an_External_Editor_To_a_Toolbar +3 Add an Editor from the Editor Repository=How_To_Add_an_Editor_from_the_Editor_Repository +3 Add Custom Items to a Toolbar's Popup Menu=IDH_HowToAddCustomItemsToToolbarsPopupMenu +3 Add Buttons to a Toolbar=IDH_HowToAddButtonsOnToolbar +3 Arrange Toolbars=IDH_HowToArrangeToolbars +3 Associate a TdxBarPopupMenu with Controls=IDH_HowToAssociateTdxBarPopupMenuwithControls +3 Convert Standard Menus to ExpressBar Menus=IDH_HowToConvertStandardMenus +3 Create a List of MDI Child Windows=IDH_HowToCreateMDIChildList +3 Create a Popup Menu at Runtime=IDH_HowToCreatePopupMenuatRuntime +3 Create a Toolbar and Position it on Screen=IDH_HowToCreateToolbar +3 Create Custom Hint Windows=IDH_CustomHintWindowExample +3 Create Custom Item=ExampleItem +3 Create Items at Runtime and Place Them on a Toolbar or a Sub Menu=IDH_HowToCreateItemsatRuntime +3 Create Several Item Controls for the Same Underlying Item=IDH_HowToCreateSeveralItemControls +3 Disable Moving, Docking and Customizing of Toolbars=IDH_HowToDisableToolbarMDC +3 Dock a Floating Toolbar to Its Previous Position upon Closing=IDH_HowToDockFloatingToolbarItsPreviousPosition +3 Emulate Coolbar Behavior=IDH_HowToEmulateTheCoolbarBehaviour +3 Export a Toolbar from a Child Form to a Main Form=IDH_HowToExportToolbar +3 Implement Help for the Customizing Form=IDH_HowToImplementHelp +3 Prevent Control Rotation when Docking a Toolbar=IDH_HowToPreventControlsRotating +3 Prohibit Deletion or Modification of any Item=IDH_HowToProhibitDeletingModifying +3 Show/Hide All Items within a Category=IDH_HowToShowHideCategory +3 Ribbon +4 Add a Dialog Launcher to the Ribbon Tab Group at Design-Time=CD_How_to_Add_a_Dialog_Launcher_to_the_Ribbon_Tab_Group_at_Design_Time +4 Add a Dialog Launcher to the Ribbon Tab Group in Code=CD_How_to_Add_a_Dialog_Launcher_to_the_Ribbon_Tab_Group_in_Code +4 Create a Ribbon Control at Design Time=CD_How_to_Create_a_Ribbon_Control_at_Design_Time +4 Create a Ribbon Control in Code=CD_How_to_Create_a_Ribbon_Control_in_Code +4 Create an in-Ribbon Gallery at Design Time=CD_How_to_Create_an_in_Ribbon_Gallery_at_Design_Time +4 Make an Item Occupy Several Rows within a Ribbon Toolbar=CD_How_to_Make_an_Item_Occupy_Several_Rows_within_a_Ribbon_Toolbar +2 Reference +3 Components +4 TdxBarConverter=TdxBarConverter +4 TdxBarDBNavigator=TdxBarDBNavigator +4 TdxBarManager=TdxBarManager +4 TdxBarPopupMenu=TdxBarPopupMenu +4 TdxStatusBar=IDH_Class_TdxStatusBar +4 Ribbon +5 TdxBarApplicationMenu=IDH_Class_TdxBarApplicationMenu +5 TdxBarScreenTipRepository=IDH_Class_TdxBarScreenTipRepository +5 TdxRibbon=IDH_Class_TdxRibbon +5 TdxRibbonDropDownGallery=IDH_Class_TdxRibbonDropDownGallery +5 TdxRibbonPopupMenu=IDH_Class_TdxRibbonPopupMenu +5 TdxRibbonStatusBar=IDH_Class_TdxRibbonStatusBar +3 Bar Items +4 TCustomdxBarCombo=TCustomdxBarCombo +4 TCustomdxBarContainerItem=TCustomdxBarContainerItem +4 TCustomdxBarSubItem=TCustomdxBarSubItem +4 TcxBarEditItem=IDH_Class_TcxBarEditItem +4 TdxBarButton=TdxBarButton +4 TdxBarColorCombo=TdxBarColorCombo +4 TdxBarCombo=TdxBarCombo +4 TdxBarContainerItem=TdxBarContainerItem +4 TdxBarControlContainerItem=IDH_Class_TdxBarControlContainerItem +4 TdxBarCustomCombo=TdxBarCustomCombo +4 TdxBarDateCombo=TdxBarDateCombo +4 TdxBarEdit=TdxBarEdit +4 TdxBarFontNameCombo=TdxBarFontNameCombo +4 TdxBarImageCombo=TdxBarImageCombo +4 TdxBarInPlaceSubItem=IDH_Class_TdxBarInPlaceSubItem +4 TdxBarItem=TdxBarItem +4 TdxBarLargeButton=TdxBarLargeButton +4 TdxBarListItem=TdxBarListItem +4 TdxBarLookupCombo=TdxBarLookupCombo +4 TdxBarMRUListItem=IDH_Class_TdxBarMRUListItem +4 TdxBarProgressItem=IDH_Class_TdxBarProgressItem +4 TdxBarSeparator=IDH_Class_TdxBarSeparator +4 TdxBarSpinEdit=TdxBarSpinEdit +4 TdxBarStatic=TdxBarStatic +4 TdxBarSubItem=TdxBarSubItem +4 TdxBarToolbarsListItem=TdxBarToolbarsListItem +4 TdxBarTreeViewCombo=TdxBarTreeViewCombo +4 TdxBarWindowItem=TdxBarWindowItem +4 Ribbon +5 TdxRibbonGalleryItem=IDH_Class_TdxRibbonGalleryItem +3 Bar Item Controls +4 TCustomdxBarComboControl=TCustomdxBarComboControl +4 TdxBarButtonControl=TdxBarButtonControl +4 TdxBarColorComboControl=IDH_Class_TdxBarColorComboControl +4 TdxBarComboControl=TdxBarComboControl +4 TdxBarContainerItemControl=TdxBarContainerItemControl +4 TdxBarControlContainerControl=IDH_Class_TdxBarControlContainerControl +4 TdxBarDateComboControl=IDH_Class_TdxBarDateComboControl +4 TdxBarEditControl=TdxBarEditControl +4 TdxBarImageComboControl=TdxBarImageComboControl +4 TdxBarInPlaceSubItemControl=IDH_Class_TdxBarInPlaceSubItemControl +4 TdxBarItemControl=TdxBarItemControl +4 TdxBarLargeButtonControl=TdxBarLargeButtonControl +4 TdxBarLookupComboControl=TdxBarLookupComboControl +4 TdxBarProgressControl=IDH_Class_TdxBarProgressControl +4 TdxBarSpinEditControl=TdxBarSpinEditControl +4 TdxBarStaticControl=TdxBarStaticControl +4 TdxBarSubItemControl=TdxBarSubItemControl +4 TdxBarToolbarsListItemControl=TdxBarToolbarsListItemControl +4 TdxBarTreeViewComboControl=TdxBarTreeViewComboControl +4 TdxBarWinControl=TdxBarWinControl +4 Ribbon +5 TdxRibbonGalleryControl=IDH_Class_TdxRibbonGalleryControl +3 Status Bar Panel Styles +4 TdxStatusBarContainerPanelStyle=IDH_Class_TdxStatusBarContainerPanelStyle +4 TdxStatusBarKeyboardStatePanelStyle=IDH_Class_TdxStatusBarKeyboardStatePanelStyle +4 TdxStatusBarPanelStyle=IDH_Class_TdxStatusBarPanelStyle +4 TdxStatusBarStateIndicatorPanelStyle=IDH_Class_TdxStatusBarStateIndicatorPanelStyle +4 TdxStatusBarTextPanelStyle=IDH_Class_TdxStatusBarTextPanelStyle +4 Ribbon +5 TdxStatusBarToolbarPanelStyle=IDH_Class_TdxStatusBarToolbarPanelStyle +3 Units +4 dxBarDBNav Unit Overview=Unit_dxBarDBNav +4 cxBarEditItem Unit Overview=IDH_Unit_cxBarEditItem +4 dxBar Unit Overview=Unit_dxBar +4 dxBarConverter Unit Overview=Unit_dxBarConverter +4 dxBarExtDBItems Unit Overview=Unit_dxBarExtDBItems +4 dxBarExtItems Unit Overview=Unit_dxBarExtItems +4 dxStatusBar Unit Overview=IDH_Unit_dxStatusBar +4 Ribbon +5 dxRibbon Unit Overview=IDH_Unit_dxRibbon +5 dxRibbonGallery Unit Overview=IDH_Unit_dxRibbonGallery +5 dxRibbonStatusBar Unit Overview=IDH_Unit_dxRibbonStatusBar +3 Miscellaneous Classes And Types +4 TCustomdxBarControl=TCustomdxBarControl +4 TdxBar=TdxBar +4 TdxBarBackgrounds=IDH_Class_TdxBarBackgrounds +4 TdxBarComponent=IDH_Class_TdxBarComponent +4 TdxBarControl=TdxBarControl +4 TdxBarCustomPopupMenu=IDH_Class_TdxBarCustomPopupMenu +4 TdxBarDateNavigator=TdxBarDateNavigator +4 TdxBarDBCheckLink=TdxBarDBCheckLink +4 TdxBarDBCheckLinks=TdxBarDBCheckLinks +4 TdxBarDBEnableType=TdxBarDBEnableType +4 TdxBarDBNavButton=TdxBarDBNavButton +4 TdxBarDBNavButtonType=TdxBarDBNavButtonType +4 TdxBarDockControl=IDH_Class_TdxBarDockControl +4 TdxBarGroup=IDH_Class_TdxBarGroup +4 TdxBarHintWindow=TdxBarHintWindow +4 TdxBarImageOptions=IDH_Class_TdxBarImageOptions +4 TdxBarItemActionLink=TdxBarItemActionLink +4 TdxBarItemClass=dxBarRegisterItem +4 TdxBarItemControlClass=dxBarRegisterItem +4 TdxBarItemLink=TdxBarItemLink +4 TdxBarItemLinks=TdxBarItemLinks +4 TdxBarItemMergeKind=IDH_Type_TdxBarItemMergeKind +4 TdxBarItemOptions=IDH_Class_TdxBarItemOptions +4 TdxBarItemPosition=IDH_Type_TdxBarItemPosition +4 TdxBarItemOptionValues=IDH_TdxBarItemOptions_AssignedValues +4 TdxBarItemViewLevels=IDH_Type_TdxBarItemViewLevels +4 TdxBarLabel=IDH_Class_TdxBarLabel +4 TdxBarLookupLink=TdxBarLookupLink +4 TdxBarManagerList=TdxBarManagerList +4 TdxBarMenuItemSize=IDH_TdxBarItemOptions_Size +4 TdxBarPersistent=IDH_Class_TdxBarPersistent +4 TdxBarPopupLookupControl=TdxBarPopupLookupControl +4 TdxBarPopupMenuLink=TdxBarPopupMenuLink +4 TdxBarPopupMenuLinks=TdxBarPopupMenuLinks +4 TdxBars=TdxBars +4 TdxBarSubMenuControl=TdxBarSubMenuControl +4 TdxBarTreeView=TdxBarTreeView +4 TdxCustomBarEdit=IDH_Class_TdxCustomBarEdit +4 TdxCustomBarEditControl=IDH_Class_TdxCustomBarEditControl +4 TdxCustomStatusBar=IDH_Class_TdxCustomStatusBar +4 TdxDockCol=TdxDockCol +4 TdxDockControl=TdxDockControl +4 TdxDockRow=TdxDockRow +4 TdxStatusBarPanel=IDH_Class_TdxStatusBarPanel +4 TdxStatusBarPanels=IDH_Class_TdxStatusBarPanels +4 TdxStatusBarKeyboardState=IDH_Type_TdxStatusBarKeyboardState +4 TdxStatusBarKeyboardStates=IDH_Type_TdxStatusBarKeyboardStates +4 TdxStatusBarKeyStateAppearance=IDH_Class_TdxStatusBarKeyStateAppearance +4 TdxStatusBarStateIndicatorItem=IDH_Class_TdxStatusBarStateIndicatorItem +4 TdxStatusBarStateIndicators=IDH_Class_TdxStatusBarStateIndicators +4 Ribbon +5 TdxBarApplicationMenuButton=IDH_Class_TdxBarApplicationMenuButton +5 TdxBarApplicationMenuButtons=IDH_Class_TdxBarApplicationMenuButtons +5 TdxBarCaptionButton=IDH_Class_TdxBarCaptionButton +5 TdxBarCaptionButtons=IDH_Class_TdxBarCaptionButtons +5 TdxBarCustomScreenTipBand=IDH_Class_TdxBarCustomScreenTipBand +5 TdxBarExtraPaneItem=IDH_Class_TdxBarExtraPaneItem +5 TdxBarExtraPaneItems=IDH_Class_TdxBarExtraPaneItems +5 TdxBarPainter=IDH_Class_TdxBarPainter +5 TdxBarScreenTip=IDH_Class_TdxBarScreenTip +5 TdxBarScreenTipBand=IDH_Class_TdxBarScreenTipBand +5 TdxBarScreenTipBandTextAlign=IDH_Type_TdxBarScreenTipBandTextAlign +5 TdxBarScreenTipCollection=IDH_Class_TdxBarScreenTipCollection +5 TdxBarScreenTipFooterBand=IDH_Class_TdxBarScreenTipFooterBand +5 TdxCustomRibbon=IDH_Class_TdxCustomRibbon +5 TdxQuickAccessToolbarPosition=IDH_Type_TdxQuickAccessToolbarPosition +5 TdxRibbonApplicationButton=IDH_Class_TdxRibbonApplicationButton +5 TdxRibbonAssignedFonts=IDH_Type_TdxRibbonAssignedFonts +5 TdxRibbonFonts=IDH_Class_TdxRibbonFonts +5 TdxRibbonGalleryCustomOptions=IDH_Class_TdxRibbonGalleryCustomOptions +5 TdxRibbonGalleryFilter=IDH_Class_TdxRibbonGalleryFilter +5 TdxRibbonGalleryFilterCategories=IDH_Class_TdxRibbonGalleryFilterCategories +5 TdxRibbonGalleryFilterCategory=IDH_Class_TdxRibbonGalleryFilterCategory +5 TdxRibbonGalleryFilterCategoryGroups=IDH_Class_TdxRibbonGalleryFilterCategoryGroups +5 TdxRibbonGalleryGroup=IDH_Class_TdxRibbonGalleryGroup +5 TdxRibbonGalleryGroupHeader=IDH_Class_TdxRibbonGalleryGroupHeader +5 TdxRibbonGalleryGroupItem=IDH_Class_TdxRibbonGalleryGroupItem +5 TdxRibbonGalleryGroupItems=IDH_Class_TdxRibbonGalleryGroupItems +5 TdxRibbonGalleryGroupItemTextKind=IDH_Type_TdxRibbonGalleryGroupItemTextKind +5 TdxRibbonGalleryGroupOptions=IDH_Class_TdxRibbonGalleryGroupOptions +5 TdxRibbonGalleryGroups=IDH_Class_TdxRibbonGalleryGroups +5 TdxRibbonGalleryImagePosition=IDH_Type_TdxRibbonGalleryImagePosition +5 TdxRibbonGalleryItemPullHighlighting=IDH_Class_TdxRibbonGalleryItemPullHighlighting +5 TdxRibbonGalleryItemPullHighlightingDirection=IDH_TdxRibbonGalleryItemPullHighlighting_Direction +5 TdxRibbonGalleryItemSelectionMode=IDH_Type_TdxRibbonGalleryItemSelectionMode +5 TdxRibbonGalleryOptions=IDH_Class_TdxRibbonGalleryOptions +5 TdxRibbonGallerySubMenuResizing=IDH_Type_TdxRibbonGallerySubMenuResizing +5 TdxRibbonPopupMenuItems=IDH_Type_TdxRibbonPopupMenuItems +5 TdxRibbonQuickAccessToolbar=IDH_Class_TdxRibbonQuickAccessToolbar +5 TdxRibbonTab=IDH_Class_TdxRibbonTab +5 TdxRibbonTabCollection=IDH_Class_TdxRibbonTabCollection +5 TdxRibbonTabGroup=IDH_Class_TdxRibbonTabGroup +5 TdxRibbonTabGroups=IDH_Class_TdxRibbonTabGroups +5 TdxScreenTipRepositoryFonts=IDH_Type_TdxScreenTipRepositoryFonts +3 Routines +4 ActiveBarControl=ActiveBarControl +4 dxBarColorDialog=dxBarColorDialog +4 dxBarFontDialog=dxBarFontDialog +4 dxBarRegisterItem=dxBarRegisterItem +4 dxBarUnregisterItem=dxBarUnregisterItem +4 GetBarManagerByForm=GetBarManagerByForm +4 GetRegisteredStatusBarPanelStyles=IDH_dxStatusBar_GetRegisteredStatusBarPanelStyles +3 Variables +4 dxBarCustomizingForm=dxBarCustomizingForm +4 dxBarHintWindowClass=dxBarHintWindowClass +4 dxBarMakeInactiveImagesDingy=IDH_dxBarMakeInactiveImagesDingy +4 dxBarManagerList=dxBarManagerList +4 dxBarPlaySound=IDH_dxBarPlaySound diff --git a/official/x.35/ExpressBars 6/Help/ExpressBars6.hlp b/official/x.35/ExpressBars 6/Help/ExpressBars6.hlp new file mode 100644 index 00000000..1b8c3905 Binary files /dev/null and b/official/x.35/ExpressBars 6/Help/ExpressBars6.hlp differ diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemC10.bpk b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC10.bpk new file mode 100644 index 00000000..ac8a97b7 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC10.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = cxBarEditItemC10.bpl +OBJFILES = cxBarEditItemC10.obj cxBarEditItemValueEditor.obj cxBarEditItem.obj +MAINSOURCE = cxBarEditItemC10.cpp +RESFILES = cxBarEditItemC10.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dxcomnC10.bpi dxThemeC10.bpi cxLibraryC10.bpi dxBarC10.bpi \ + cxDataC10.bpi cxEditorsC10.bpi cxExtEditorsC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars cxEditor item by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemC10.cpp b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC10.cpp new file mode 100644 index 00000000..5056d514 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC10.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("cxBarEditItemC10.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxcomnC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("dxBarC10.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEPACKAGE("cxExtEditorsC10.bpi"); +USEUNIT("cxBarEditItemValueEditor.pas"); +USEUNIT("cxBarEditItem.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemC10.res b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC10.res new file mode 100644 index 00000000..be13bd0d Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemC11.bpk b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC11.bpk new file mode 100644 index 00000000..47673314 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC11.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = cxBarEditItemC11.bpl +OBJFILES = cxBarEditItemC11.obj cxBarEditItemValueEditor.obj cxBarEditItem.obj +MAINSOURCE = cxBarEditItemC11.cpp +RESFILES = cxBarEditItemC11.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dxcomnC11.bpi dxThemeC11.bpi cxLibraryC11.bpi dxBarC11.bpi \ + cxDataC11.bpi cxEditorsC11.bpi cxExtEditorsC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars cxEditor item by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemC11.cpp b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC11.cpp new file mode 100644 index 00000000..990fcf3a --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC11.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("cxBarEditItemC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxcomnC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxBarC11.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("cxExtEditorsC11.bpi"); +USEUNIT("cxBarEditItemValueEditor.pas"); +USEUNIT("cxBarEditItem.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemC11.res b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC11.res new file mode 100644 index 00000000..60b4b2ec Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemC5.bpk b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC5.bpk new file mode 100644 index 00000000..1709c98a --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC5.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = cxBarEditItemC5.bpl +OBJFILES = cxBarEditItemC5.obj cxBarEditItemValueEditor.obj cxBarEditItem.obj +RESFILES = cxBarEditItemC5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib +PACKAGES = VCL50.bpi dxcomnc5.bpi dxThemeC5.bpi cxLibraryVCLC5.bpi dxBarC5.bpi \ + cxDataC5.bpi cxEditorsC5.bpi cxExtEditorsC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars cxEditor item by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemC5.cpp b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC5.cpp new file mode 100644 index 00000000..7093f7c2 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC5.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("cxBarEditItem.res"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("dxcomnC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("dxBarC5.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("cxExtEditorsC5.bpi"); +USEUNIT("cxBarEditItemValueEditor.pas"); +USEUNIT("cxBarEditItem.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemC5.res b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC5.res new file mode 100644 index 00000000..275b14c1 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemC6.bpk b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC6.bpk new file mode 100644 index 00000000..411c0e4c --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC6.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = cxBarEditItemC6.bpl +OBJFILES = cxBarEditItemC6.obj cxBarEditItemValueEditor.obj cxBarEditItem.obj +RESFILES = cxBarEditItemC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dxcomnC6.bpi dxThemeC6.bpi cxLibraryVCLC6.bpi dxBarC6.bpi \ + cxDataC6.bpi cxEditorsVCLC6.bpi cxExtEditorsVCLC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars cxEditor item by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemC6.cpp b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC6.cpp new file mode 100644 index 00000000..070d8ab8 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC6.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("cxBarEditItemC6.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxcomnC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("dxBarC6.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("cxExtEditorsVCLC6.bpi"); +USEUNIT("cxBarEditItemValueEditor.pas"); +USEUNIT("cxBarEditItem.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemC6.res b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC6.res new file mode 100644 index 00000000..185a4d5c Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/cxBarEditItemC6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemD10.dpk b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD10.dpk new file mode 100644 index 00000000..53109861 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD10.dpk @@ -0,0 +1,38 @@ +package cxBarEditItemD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars cxEditor item by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxBarD10, + cxEditorsD10, + cxExtEditorsD10; + +contains + cxBarEditItemValueEditor, + cxBarEditItem; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemD10.res b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD10.res new file mode 100644 index 00000000..613910bd Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemD11.dpk b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD11.dpk new file mode 100644 index 00000000..3cf6cb7e --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD11.dpk @@ -0,0 +1,38 @@ +package cxBarEditItemD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars cxEditor item by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxBarD11, + cxEditorsD11, + cxExtEditorsD11; + +contains + cxBarEditItemValueEditor, + cxBarEditItem; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemD11.res b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD11.res new file mode 100644 index 00000000..959254e7 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemD5.dpk b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD5.dpk new file mode 100644 index 00000000..890aa3b2 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD5.dpk @@ -0,0 +1,38 @@ +package cxBarEditItemD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars cxEditor item by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxBarD5, + cxEditorsD5, + cxExtEditorsD5; + +contains + cxBarEditItemValueEditor, + cxBarEditItem; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemD5.res b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD5.res new file mode 100644 index 00000000..3de72557 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemD6.dpk b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD6.dpk new file mode 100644 index 00000000..810822d7 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD6.dpk @@ -0,0 +1,38 @@ +package cxBarEditItemD6; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars cxEditor item by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxBarD6, + cxEditorsVCLD6, + cxExtEditorsVCLD6; + +contains + cxBarEditItemValueEditor, + cxBarEditItem; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemD6.res b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD6.res new file mode 100644 index 00000000..2cd7f9a1 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemD7.dpk b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD7.dpk new file mode 100644 index 00000000..8cf8df95 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD7.dpk @@ -0,0 +1,38 @@ +package cxBarEditItemD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars cxEditor item by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxBarD7, + cxEditorsVCLD7, + cxExtEditorsVCLD7; + +contains + cxBarEditItemValueEditor, + cxBarEditItem; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemD7.res b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD7.res new file mode 100644 index 00000000..85273b32 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD7.res differ diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemD9.dpk b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD9.dpk new file mode 100644 index 00000000..db2d9328 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD9.dpk @@ -0,0 +1,38 @@ +package cxBarEditItemD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars cxEditor item by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxBarD9, + cxEditorsD9, + cxExtEditorsD9; + +contains + cxBarEditItemValueEditor, + cxBarEditItem; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/cxBarEditItemD9.res b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD9.res new file mode 100644 index 00000000..1dc495ba Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/cxBarEditItemD9.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC10.bpk b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC10.bpk new file mode 100644 index 00000000..af66e2e1 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC10.bpk @@ -0,0 +1,140 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxBarEditItemC10.bpl +OBJFILES = dclcxBarEditItemC10.obj cxBarEditItemReg.obj +MAINSOURCE = dclcxBarEditItemC10.cpp +RESFILES = dclcxBarEditItemC10.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi vclx.bpi designide.bpi dxcomnC10.bpi \ + cxLibraryC10.bpi cxEditorsC10.bpi dxBarC10.bpi cxBarEditItemC10.bpi \ + dclcxLibraryC10.bpi dclcxEditorsC10.bpi dclcxExtEditorsC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars cxEditor item by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC10.cpp b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC10.cpp new file mode 100644 index 00000000..9a9649cf --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC10.cpp @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dclcxBarEditItemC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("VCLX.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("dxcomnC10.bpi"); +USEPACKAGE("dxBarC10.bpi"); +USEPACKAGE("cxBarEditItemC10.bpi"); +USEPACKAGE("dclcxLibraryC10.bpi"); +USEPACKAGE("dclcxEditorsC10.bpi"); +USEPACKAGE("dclcxExtEditorsC10.bpi"); +USEUNIT("cxBarEditItemReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC10.res b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC10.res new file mode 100644 index 00000000..fdd889c7 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC11.bpk b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC11.bpk new file mode 100644 index 00000000..812d23f7 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC11.bpk @@ -0,0 +1,140 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxBarEditItemC11.bpl +OBJFILES = dclcxBarEditItemC11.obj cxBarEditItemReg.obj +MAINSOURCE = dclcxBarEditItemC11.cpp +RESFILES = dclcxBarEditItemC11.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi vclx.bpi designide.bpi dxcomnC11.bpi \ + cxLibraryC11.bpi cxEditorsC11.bpi dxBarC11.bpi cxBarEditItemC11.bpi \ + dclcxLibraryC11.bpi dclcxEditorsC11.bpi dclcxExtEditorsC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars cxEditor item by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC11.cpp b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC11.cpp new file mode 100644 index 00000000..0ac44e36 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC11.cpp @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dclcxBarEditItemC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("VCLX.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxcomnC11.bpi"); +USEPACKAGE("dxBarC11.bpi"); +USEPACKAGE("cxBarEditItemC11.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEPACKAGE("dclcxEditorsC11.bpi"); +USEPACKAGE("dclcxExtEditorsC11.bpi"); +USEUNIT("cxBarEditItemReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC11.res b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC11.res new file mode 100644 index 00000000..311152c6 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC5.bpk b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC5.bpk new file mode 100644 index 00000000..70b54d52 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC5.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dclcxBarEditItemC5.bpl +OBJFILES = dclcxBarEditItemC5.obj cxBarEditItemReg.obj +RESFILES = dclcxBarEditItemC5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib +PACKAGES = VCL50.bpi vclx50.bpi dsnide50.bpi dxcomnC5.bpi cxLibraryVCLC5.bpi \ + cxEditorsC5.bpi dxBarC5.bpi cxBarEditItemC5.bpi dclcxLibraryVCLC5.bpi \ + dclcxEditorsC5.bpi dclcxExtEditorsC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars cxEditor item by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC5.cpp b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC5.cpp new file mode 100644 index 00000000..b7c69b4c --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC5.cpp @@ -0,0 +1,25 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dclcxBarEditItemC5.res"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("VCLX50.bpi"); +USEPACKAGE("dsnide50.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("dxcomnC5.bpi"); +USEPACKAGE("dxBarC5.bpi"); +USEPACKAGE("cxBarEditItemC5.bpi"); +USEPACKAGE("dclcxLibraryVCLC5.bpi"); +USEPACKAGE("dclcxEditorsC5.bpi"); +USEPACKAGE("dclcxExtEditorsC5.bpi"); +USEUNIT("cxBarEditItemReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC5.res b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC5.res new file mode 100644 index 00000000..aa060bbf Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC6.bpk b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC6.bpk new file mode 100644 index 00000000..0623593b --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC6.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxBarEditItemC6.bpl +OBJFILES = dclcxBarEditItemC6.obj cxBarEditItemReg.obj +RESFILES = dclcxBarEditItemC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi vclx.bpi designide.bpi dxcomnC6.bpi \ + cxLibraryVCLC6.bpi cxEditorsVCLC6.bpi dxBarC6.bpi cxBarEditItemC6.bpi \ + dclcxLibraryVCLC6.bpi dclcxEditorsVCLC6.bpi dclcxExtEditorsVCLC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars cxEditor item by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC6.cpp b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC6.cpp new file mode 100644 index 00000000..e5d40ec8 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC6.cpp @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dclcxBarEditItemC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("VCLX.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("dxcomnC6.bpi"); +USEPACKAGE("dxBarC6.bpi"); +USEPACKAGE("cxBarEditItemC6.bpi"); +USEPACKAGE("dclcxLibraryVCLC6.bpi"); +USEPACKAGE("dclcxEditorsVCLC6.bpi"); +USEPACKAGE("dclcxExtEditorsVCLC6.bpi"); +USEUNIT("cxBarEditItemReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC6.res b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC6.res new file mode 100644 index 00000000..00d44983 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemC6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD10.dpk b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD10.dpk new file mode 100644 index 00000000..f57f31bc --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD10.dpk @@ -0,0 +1,40 @@ +package dclcxBarEditItemD10; + +{$R *.res} +{$R dxBarConverter.dcr} +{$R dxBarReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars cxEditor item by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + dxBarD10, + cxBarEditItemD10, + dclcxEditorsD10, + dclcxExtEditorsD10; + +contains + cxBarEditItemReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD10.res b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD10.res new file mode 100644 index 00000000..ec7341b3 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD11.dpk b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD11.dpk new file mode 100644 index 00000000..09e1456f --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD11.dpk @@ -0,0 +1,40 @@ +package dclcxBarEditItemD11; + +{$R *.res} +{$R dxBarConverter.dcr} +{$R dxBarReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars cxEditor item by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + dxBarD11, + cxBarEditItemD11, + dclcxEditorsD11, + dclcxExtEditorsD11; + +contains + cxBarEditItemReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD11.res b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD11.res new file mode 100644 index 00000000..2045a3a6 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD5.dpk b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD5.dpk new file mode 100644 index 00000000..3c1f1483 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD5.dpk @@ -0,0 +1,40 @@ +package dclcxBarEditItemD5; + +{$R *.RES} +{$R dxBarConverter.dcr} +{$R dxBarReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars cxEditor item by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + dxBarD5, + cxBarEditItemD5, + dclcxEditorsD5, + dclcxExtEditorsD5; + +contains + cxBarEditItemReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD5.res b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD5.res new file mode 100644 index 00000000..f9937111 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD6.dpk b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD6.dpk new file mode 100644 index 00000000..82187a9e --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD6.dpk @@ -0,0 +1,40 @@ +package dclcxBarEditItemD6; + +{$R *.RES} +{$R dxBarConverter.dcr} +{$R dxBarReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars cxEditor item by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + dxBarD6, + cxBarEditItemD6, + dclcxEditorsVCLD6, + dclcxExtEditorsVCLD6; + +contains + cxBarEditItemReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD6.res b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD6.res new file mode 100644 index 00000000..45821149 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD7.dpk b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD7.dpk new file mode 100644 index 00000000..241016dc --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD7.dpk @@ -0,0 +1,40 @@ +package dclcxBarEditItemD7; + +{$R *.res} +{$R dxBarConverter.dcr} +{$R dxBarReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars cxEditor item by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + dxBarD7, + cxBarEditItemD7, + dclcxEditorsVCLD7, + dclcxExtEditorsVCLD7; + +contains + cxBarEditItemReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD7.res b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD7.res new file mode 100644 index 00000000..3e79f2c8 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD7.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD9.dpk b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD9.dpk new file mode 100644 index 00000000..b493d8a1 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD9.dpk @@ -0,0 +1,40 @@ +package dclcxBarEditItemD9; + +{$R *.res} +{$R dxBarConverter.dcr} +{$R dxBarReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars cxEditor item by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + dxBarD9, + cxBarEditItemD9, + dclcxEditorsD9, + dclcxExtEditorsD9; + +contains + cxBarEditItemReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD9.res b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD9.res new file mode 100644 index 00000000..683b72ff Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dclcxBarEditItemD9.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarC10.bpk b/official/x.35/ExpressBars 6/Packages/dcldxBarC10.bpk new file mode 100644 index 00000000..5150eb87 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarC10.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxBarC10.bpl +OBJFILES = dxBarReg.obj dxBarConverter.obj dxStatusBarReg.obj \ + dxStatusIndicatorEditor.obj dcldxBarC10.obj +MAINSOURCE = dcldxBarC10.cpp +RESFILES = dcldxBarC10.res dxBarReg.dcr dxBarConverter.dcr +DEFFILE = +RESDEPEN = $(RESFILES) dxStatusIndicatorEditor.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi vclx.bpi designide.bpi dxcomnC10.bpi dxBarC10.bpi cxLibraryC10.bpi dclcxLibraryC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarC10.cpp b/official/x.35/ExpressBars 6/Packages/dcldxBarC10.cpp new file mode 100644 index 00000000..f98d056b --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarC10.cpp @@ -0,0 +1,28 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxBarC10.res"); +USERES("dxBarReg.dcr"); +USERES("dxBarConverter.dcr"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("VCLX.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("dxcomnC10.bpi"); +USEPACKAGE("dxBarC10.bpi"); +USEPACKAGE("dclcxLibraryC10.bpi"); +USEUNIT("dxBarReg.pas"); +USEUNIT("dxBarConverter.pas"); +USEUNIT("dxStatusBarReg.pas"); +USEUNIT("dxStatusIndicatorEditor.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarC10.res b/official/x.35/ExpressBars 6/Packages/dcldxBarC10.res new file mode 100644 index 00000000..abf03c4f Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarC10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarC11.bpk b/official/x.35/ExpressBars 6/Packages/dcldxBarC11.bpk new file mode 100644 index 00000000..2fbe6570 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarC11.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxBarC11.bpl +OBJFILES = dxBarReg.obj dxBarConverter.obj dxStatusBarReg.obj \ + dxStatusIndicatorEditor.obj dcldxBarC11.obj +MAINSOURCE = dcldxBarC11.cpp +RESFILES = dcldxBarC11.res dxBarReg.dcr dxBarConverter.dcr +DEFFILE = +RESDEPEN = $(RESFILES) dxStatusIndicatorEditor.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi vclx.bpi designide.bpi dxcomnC11.bpi dxBarC11.bpi cxLibraryC11.bpi dclcxLibraryC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarC11.cpp b/official/x.35/ExpressBars 6/Packages/dcldxBarC11.cpp new file mode 100644 index 00000000..873af803 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarC11.cpp @@ -0,0 +1,28 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxBarC11.res"); +USERES("dxBarReg.dcr"); +USERES("dxBarConverter.dcr"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("VCLX.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxcomnC11.bpi"); +USEPACKAGE("dxBarC11.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEUNIT("dxBarReg.pas"); +USEUNIT("dxBarConverter.pas"); +USEUNIT("dxStatusBarReg.pas"); +USEUNIT("dxStatusIndicatorEditor.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarC11.res b/official/x.35/ExpressBars 6/Packages/dcldxBarC11.res new file mode 100644 index 00000000..cf792558 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarC11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarC5.bpk b/official/x.35/ExpressBars 6/Packages/dcldxBarC5.bpk new file mode 100644 index 00000000..e40e0140 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarC5.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dcldxBarC5.bpl +OBJFILES = dxBarReg.obj dxBarConverter.obj dxStatusBarReg.obj \ + dxStatusIndicatorEditor.obj dcldxBarC5.obj +RESFILES = dcldxBarC5.res dxBarReg.dcr dxBarConverter.dcr +DEFFILE = +RESDEPEN = $(RESFILES) dxStatusIndicatorEditor.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib +PACKAGES = VCL50.bpi vclx50.bpi dsnide50.bpi dxcomnC5.bpi dxBarC5.bpi cxLibraryVCLC5.bpi dclcxLibraryVCLC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarC5.cpp b/official/x.35/ExpressBars 6/Packages/dcldxBarC5.cpp new file mode 100644 index 00000000..45462a79 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarC5.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxBarC5.res"); +USERES("dxBarReg.dcr"); +USERES("dxBarConverter.dcr"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("VCLX50.bpi"); +USEPACKAGE("dsnide50.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("dxcomnC5.bpi"); +USEPACKAGE("dxBarC5.bpi"); +USEPACKAGE("dclcxLibraryVCLC5.bpi"); +USEUNIT("dxBarReg.pas"); +USEUNIT("dxBarConverter.pas"); +USEUNIT("dxStatusBarReg.pas"); +USEUNIT("dxStatusIndicatorEditor.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarC5.res b/official/x.35/ExpressBars 6/Packages/dcldxBarC5.res new file mode 100644 index 00000000..c3a7a628 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarC5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarC6.bpk b/official/x.35/ExpressBars 6/Packages/dcldxBarC6.bpk new file mode 100644 index 00000000..b87fd93a --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarC6.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxBarC6.bpl +OBJFILES = dxBarReg.obj dxBarConverter.obj dxStatusBarReg.obj \ + dxStatusIndicatorEditor.obj dcldxBarC6.obj +RESFILES = dcldxBarC6.res dxBarReg.dcr dxBarConverter.dcr +DEFFILE = +RESDEPEN = $(RESFILES) dxStatusIndicatorEditor.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi vclx.bpi designide.bpi dxcomnC6.bpi dxBarC6.bpi cxLibraryVCLC6.bpi dclcxLibraryVCLC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarC6.cpp b/official/x.35/ExpressBars 6/Packages/dcldxBarC6.cpp new file mode 100644 index 00000000..5b69d975 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarC6.cpp @@ -0,0 +1,28 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxBarC6.res"); +USERES("dxBarReg.dcr"); +USERES("dxBarConverter.dcr"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("VCLX.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("dxcomnC6.bpi"); +USEPACKAGE("dxBarC6.bpi"); +USEPACKAGE("dclcxLibraryVCLC6.bpi"); +USEUNIT("dxBarReg.pas"); +USEUNIT("dxBarConverter.pas"); +USEUNIT("dxStatusBarReg.pas"); +USEUNIT("dxStatusIndicatorEditor.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarC6.res b/official/x.35/ExpressBars 6/Packages/dcldxBarC6.res new file mode 100644 index 00000000..083c7bc6 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarC6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarD10.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarD10.dpk new file mode 100644 index 00000000..d2b9c95d --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarD10.dpk @@ -0,0 +1,42 @@ +package dcldxBarD10; + +{$R *.res} +{$R dxBarConverter.dcr} +{$R dxBarReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vclx, + dxBarD10, + dclcxLibraryD10; + +contains + dxBarConverter, + dxBarReg, + dxStatusIndicatorEditor, + dxStatusBarReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarD10.res b/official/x.35/ExpressBars 6/Packages/dcldxBarD10.res new file mode 100644 index 00000000..f7354756 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarD10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarD11.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarD11.dpk new file mode 100644 index 00000000..8c7da571 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarD11.dpk @@ -0,0 +1,42 @@ +package dcldxBarD11; + +{$R *.res} +{$R dxBarConverter.dcr} +{$R dxBarReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vclx, + dxBarD11, + dclcxLibraryD11; + +contains + dxBarConverter, + dxBarReg, + dxStatusIndicatorEditor, + dxStatusBarReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarD11.res b/official/x.35/ExpressBars 6/Packages/dcldxBarD11.res new file mode 100644 index 00000000..91b4ad1a Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarD11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarD5.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarD5.dpk new file mode 100644 index 00000000..07123544 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarD5.dpk @@ -0,0 +1,42 @@ +package dcldxBarD5; + +{$R *.RES} +{$R dxBarConverter.dcr} +{$R dxBarReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vclx50, + dxBarD5, + dclcxLibraryVCLD5; + +contains + dxBarConverter, + dxBarReg, + dxStatusIndicatorEditor, + dxStatusBarReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarD5.res b/official/x.35/ExpressBars 6/Packages/dcldxBarD5.res new file mode 100644 index 00000000..8a1d249d Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarD5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarD6.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarD6.dpk new file mode 100644 index 00000000..8251eb05 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarD6.dpk @@ -0,0 +1,42 @@ +package dcldxBarD6; + +{$R *.RES} +{$R dxBarConverter.dcr} +{$R dxBarReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vclx, + dxBarD6, + dclcxLibraryVCLD6; + +contains + dxBarConverter, + dxBarReg, + dxStatusIndicatorEditor, + dxStatusBarReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarD6.res b/official/x.35/ExpressBars 6/Packages/dcldxBarD6.res new file mode 100644 index 00000000..41ca1b6c Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarD6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarD7.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarD7.dpk new file mode 100644 index 00000000..0f95bb98 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarD7.dpk @@ -0,0 +1,42 @@ +package dcldxBarD7; + +{$R *.res} +{$R dxBarConverter.dcr} +{$R dxBarReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vclx, + dxBarD7, + dclcxLibraryVCLD7; + +contains + dxBarConverter, + dxBarReg, + dxStatusIndicatorEditor, + dxStatusBarReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarD7.res b/official/x.35/ExpressBars 6/Packages/dcldxBarD7.res new file mode 100644 index 00000000..a7b2018d Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarD7.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarD9.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarD9.dpk new file mode 100644 index 00000000..d2b8e288 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarD9.dpk @@ -0,0 +1,42 @@ +package dcldxBarD9; + +{$R *.res} +{$R dxBarConverter.dcr} +{$R dxBarReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vclx, + dxBarD9, + dclcxLibraryD9; + +contains + dxBarConverter, + dxBarReg, + dxStatusIndicatorEditor, + dxStatusBarReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarD9.res b/official/x.35/ExpressBars 6/Packages/dcldxBarD9.res new file mode 100644 index 00000000..01c620a5 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarD9.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC10.bpk b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC10.bpk new file mode 100644 index 00000000..ab4166ba --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC10.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxBarDBNavC10.bpl +OBJFILES = dxBarDBNavReg.obj dxBarDBCheckLinksEd.obj dcldxBarDBNavC10.obj +MAINSOURCE = dcldxBarDBNavC10.cpp +RESFILES = dcldxBarDBNavC10.res dxBarDBNavReg.dcr +DEFFILE = +RESDEPEN = $(RESFILES) dxBarDBCheckLinksEd.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dbrtl.bpi vcldb.bpi dxBarC10.bpi dxBarDBNavC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars DBNavigator by Developer Expess Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC10.cpp b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC10.cpp new file mode 100644 index 00000000..93bafbb6 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC10.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxBarDBNavC10.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxBarC10.bpi"); +USEPACKAGE("dxBarDBNavC10.bpi"); +USEUNIT("dxBarDBNavReg.pas"); +USERES("dxBarDBNavReg.dcr"); +USEFORMNS("dxBarDBCheckLinksEd.pas", Dxbardbchecklinksed, dxBarDBCheckLinksEditor); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC10.res b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC10.res new file mode 100644 index 00000000..d5ce7792 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC11.bpk b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC11.bpk new file mode 100644 index 00000000..e8ec68f2 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC11.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxBarDBNavC11.bpl +OBJFILES = dxBarDBNavReg.obj dxBarDBCheckLinksEd.obj dcldxBarDBNavC11.obj +MAINSOURCE = dcldxBarDBNavC11.cpp +RESFILES = dcldxBarDBNavC11.res dxBarDBNavReg.dcr +DEFFILE = +RESDEPEN = $(RESFILES) dxBarDBCheckLinksEd.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dbrtl.bpi vcldb.bpi dxBarC11.bpi dxBarDBNavC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars DBNavigator by Developer Expess Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC11.cpp b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC11.cpp new file mode 100644 index 00000000..6a29fc9e --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC11.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxBarDBNavC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxBarC11.bpi"); +USEPACKAGE("dxBarDBNavC11.bpi"); +USEUNIT("dxBarDBNavReg.pas"); +USERES("dxBarDBNavReg.dcr"); +USEFORMNS("dxBarDBCheckLinksEd.pas", Dxbardbchecklinksed, dxBarDBCheckLinksEditor); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC11.res b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC11.res new file mode 100644 index 00000000..1ed56414 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC5.bpk b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC5.bpk new file mode 100644 index 00000000..e05a91a3 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC5.bpk @@ -0,0 +1,136 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dcldxBarDBNavC5.bpl +OBJFILES = dxBarDBNavReg.obj dxBarDBCheckLinksEd.obj dcldxBarDBNavC5.obj +RESFILES = dcldxBarDBNavC5.res dxBarDBNavReg.dcr +DEFFILE = +RESDEPEN = $(RESFILES) dxBarDBCheckLinksEd.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib +PACKAGES = VCL50.bpi vcldb50.bpi dxBarC5.bpi dxBarDBNavC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars DBNavigator by Developer Expess Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC5.cpp b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC5.cpp new file mode 100644 index 00000000..742e085d --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC5.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxBarDBNavC5.res"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("dxBarC5.bpi"); +USEPACKAGE("dxBarDBNavC5.bpi"); +USEUNIT("dxBarDBNavReg.pas"); +USERES("dxBarDBNavReg.dcr"); +USEFORMNS("dxBarDBCheckLinksEd.pas", Dxbardbchecklinksed, dxBarDBCheckLinksEditor); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC5.res b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC5.res new file mode 100644 index 00000000..92a8bade Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC6.bpk b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC6.bpk new file mode 100644 index 00000000..cd92b0f5 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC6.bpk @@ -0,0 +1,136 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxBarDBNavC6.bpl +OBJFILES = dxBarDBNavReg.obj dxBarDBCheckLinksEd.obj dcldxBarDBNavC6.obj +RESFILES = dcldxBarDBNavC6.res dxBarDBNavReg.dcr +DEFFILE = +RESDEPEN = $(RESFILES) dxBarDBCheckLinksEd.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dbrtl.bpi vcldb.bpi dxBarC6.bpi dxBarDBNavC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars DBNavigator by Developer Expess Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC6.cpp b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC6.cpp new file mode 100644 index 00000000..f8a54e24 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC6.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxBarDBNavC6.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxBarC6.bpi"); +USEPACKAGE("dxBarDBNavC6.bpi"); +USEUNIT("dxBarDBNavReg.pas"); +USERES("dxBarDBNavReg.dcr"); +USEFORMNS("dxBarDBCheckLinksEd.pas", Dxbardbchecklinksed, dxBarDBCheckLinksEditor); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC6.res b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC6.res new file mode 100644 index 00000000..224e914a Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavC6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD10.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD10.dpk new file mode 100644 index 00000000..550a0ac3 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD10.dpk @@ -0,0 +1,41 @@ +package dcldxBarDBNavD10; + +{$R *.res} +{$R dxBarDBNavReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars DBNavigator by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + designide, + dxBarD10, + dxBarDBNavD10; + +contains + dxBarDBCheckLinksEd, + dxBarDBNavReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD10.res b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD10.res new file mode 100644 index 00000000..27594e0d Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD11.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD11.dpk new file mode 100644 index 00000000..ea874e91 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD11.dpk @@ -0,0 +1,41 @@ +package dcldxBarDBNavD11; + +{$R *.res} +{$R dxBarDBNavReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars DBNavigator by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + designide, + dxBarD11, + dxBarDBNavD11; + +contains + dxBarDBCheckLinksEd, + dxBarDBNavReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD11.res b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD11.res new file mode 100644 index 00000000..b919f44e Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD5.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD5.dpk new file mode 100644 index 00000000..af94487e --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD5.dpk @@ -0,0 +1,40 @@ +package dcldxBarDBNavD5; + +{$R *.RES} +{$R dxBarDBNavReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars DBNavigator by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcldb50, + dxBarD5, + dxBarDBNavD5; + +contains + dxBarDBNavReg, + dxBarDBCheckLinksEd; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD5.res b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD5.res new file mode 100644 index 00000000..22648c35 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD6.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD6.dpk new file mode 100644 index 00000000..e72790e3 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD6.dpk @@ -0,0 +1,41 @@ +package dcldxBarDBNavD6; + +{$R *.RES} +{$R dxBarDBNavReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars DBNavigator by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + designide, + dxBarD6, + dxBarDBNavD6; + +contains + dxBarDBNavReg, + dxBarDBCheckLinksEd; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD6.res b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD6.res new file mode 100644 index 00000000..a13e733b Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD7.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD7.dpk new file mode 100644 index 00000000..6df1a767 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD7.dpk @@ -0,0 +1,41 @@ +package dcldxBarDBNavD7; + +{$R *.res} +{$R dxBarDBNavReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars DBNavigator by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + designide, + dxBarD7, + dxBarDBNavD7; + +contains + dxBarDBCheckLinksEd, + dxBarDBNavReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD7.res b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD7.res new file mode 100644 index 00000000..5647fe37 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD7.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD9.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD9.dpk new file mode 100644 index 00000000..40914674 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD9.dpk @@ -0,0 +1,41 @@ +package dcldxBarDBNavD9; + +{$R *.res} +{$R dxBarDBNavReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars DBNavigator by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + designide, + dxBarD9, + dxBarDBNavD9; + +contains + dxBarDBCheckLinksEd, + dxBarDBNavReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD9.res b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD9.res new file mode 100644 index 00000000..87b41066 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarDBNavD9.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC10.bpk b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC10.bpk new file mode 100644 index 00000000..1bc289ff --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC10.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxBarExtDBItemsC10.bpl +OBJFILES = dxBarExtDBItemsReg.obj dcldxBarExtDBItemsC10.obj +MAINSOURCE = dcldxBarExtDBItemsC10.cpp +RESFILES = dcldxBarExtDBItemsC10.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dbrtl.bpi vcldb.bpi dxBarExtDBItemsC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Extended DB Items by Developer Express Inc." -aa -Tpp -x -Gn -Gl \ + -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC10.cpp b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC10.cpp new file mode 100644 index 00000000..1671e986 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC10.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxBarExtDBItemsC10.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxBarExtDBItemsC10.bpi"); +USEUNIT("dxBarExtDBItemsReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC10.res b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC10.res new file mode 100644 index 00000000..3e730054 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC11.bpk b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC11.bpk new file mode 100644 index 00000000..fd3e039b --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC11.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxBarExtDBItemsC11.bpl +OBJFILES = dxBarExtDBItemsReg.obj dcldxBarExtDBItemsC11.obj +MAINSOURCE = dcldxBarExtDBItemsC11.cpp +RESFILES = dcldxBarExtDBItemsC11.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dbrtl.bpi vcldb.bpi dxBarExtDBItemsC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Extended DB Items by Developer Express Inc." -aa -Tpp -x -Gn -Gl \ + -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC11.cpp b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC11.cpp new file mode 100644 index 00000000..cf59506e --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC11.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxBarExtDBItemsC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxBarExtDBItemsC11.bpi"); +USEUNIT("dxBarExtDBItemsReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC11.res b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC11.res new file mode 100644 index 00000000..bca46100 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC5.bpk b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC5.bpk new file mode 100644 index 00000000..d3b2eb0d --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC5.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dcldxBarExtDBItemsC5.bpl +OBJFILES = dxBarExtDBItemsReg.obj dcldxBarExtDBItemsC5.obj +RESFILES = dcldxBarExtDBItemsC5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib +PACKAGES = VCL50.bpi vcldb50.bpi dxBarExtDBItemsC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Extended DB Items by Developer Express Inc." -aa -Tpp -x -Gn -Gl \ + -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC5.cpp b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC5.cpp new file mode 100644 index 00000000..0dbff04d --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC5.cpp @@ -0,0 +1,18 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxBarExtDBItemsC5.res"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("dxBarExtDBItemsC5.bpi"); +USEUNIT("dxBarExtDBItemsReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC5.res b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC5.res new file mode 100644 index 00000000..92f6df76 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC6.bpk b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC6.bpk new file mode 100644 index 00000000..fe9ce528 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC6.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxBarExtDBItemsC6.bpl +OBJFILES = dxBarExtDBItemsReg.obj dcldxBarExtDBItemsC6.obj +RESFILES = dcldxBarExtDBItemsC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dbrtl.bpi vcldb.bpi dxBarExtDBItemsC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Extended DB Items by Developer Express Inc." -aa -Tpp -x -Gn -Gl \ + -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC6.cpp b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC6.cpp new file mode 100644 index 00000000..d650d4ee --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC6.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxBarExtDBItemsC6.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxBarExtDBItemsC6.bpi"); +USEUNIT("dxBarExtDBItemsReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC6.res b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC6.res new file mode 100644 index 00000000..4b6e2267 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsC6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD10.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD10.dpk new file mode 100644 index 00000000..30e9c1bf --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD10.dpk @@ -0,0 +1,38 @@ +package dcldxBarExtDBItemsD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars extended DB items by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + designide, + dxBarExtDBItemsD10; + +contains + dxBarExtDBItemsReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD10.res b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD10.res new file mode 100644 index 00000000..92ac0a64 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD11.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD11.dpk new file mode 100644 index 00000000..b27dc001 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD11.dpk @@ -0,0 +1,38 @@ +package dcldxBarExtDBItemsD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars extended DB items by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + designide, + dxBarExtDBItemsD11; + +contains + dxBarExtDBItemsReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD11.res b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD11.res new file mode 100644 index 00000000..93131f19 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD5.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD5.dpk new file mode 100644 index 00000000..6af0efd3 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD5.dpk @@ -0,0 +1,37 @@ +package dcldxBarExtDBItemsD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars extended DB items by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcldb50, + dxBarExtDBItemsD5; + +contains + dxBarExtDBItemsReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD5.res b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD5.res new file mode 100644 index 00000000..74da80dd Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD6.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD6.dpk new file mode 100644 index 00000000..845abc8d --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD6.dpk @@ -0,0 +1,38 @@ +package dcldxBarExtDBItemsD6; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars extended DB items by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + designide, + dxBarExtDBItemsD6; + +contains + dxBarExtDBItemsReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD6.res b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD6.res new file mode 100644 index 00000000..a9f51b63 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD7.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD7.dpk new file mode 100644 index 00000000..e2884169 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD7.dpk @@ -0,0 +1,38 @@ +package dcldxBarExtDBItemsD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars extended DB items by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + designide, + dxBarExtDBItemsD7; + +contains + dxBarExtDBItemsReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD7.res b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD7.res new file mode 100644 index 00000000..0675de84 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD7.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD9.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD9.dpk new file mode 100644 index 00000000..e1c7a7a3 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD9.dpk @@ -0,0 +1,38 @@ +package dcldxBarExtDBItemsD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars extended DB items by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + designide, + dxBarExtDBItemsD9; + +contains + dxBarExtDBItemsReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD9.res b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD9.res new file mode 100644 index 00000000..01e7e7f4 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarExtDBItemsD9.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC10.bpk b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC10.bpk new file mode 100644 index 00000000..6ed97eb3 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC10.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxBarExtItemsC10.bpl +OBJFILES = dxBarExtItemsReg.obj dxBarImageComboEditor.obj dcldxBarExtItemsC10.obj +MAINSOURCE = dcldxBarExtItemsC10.cpp +RESFILES = dcldxBarExtItemsC10.res +DEFFILE = +RESDEPEN = $(RESFILES) dxBarImageComboEditor.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = vclx.bpi rtl.bpi vcl.bpi designide.bpi dxComnC10.bpi dxBarExtItemsC10.bpi \ + dxThemeC10.bpi cxLibraryC10.bpi dclcxLibraryC10.bpi dcldxBarC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Extended Items by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC10.cpp b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC10.cpp new file mode 100644 index 00000000..45e76ee4 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC10.cpp @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxBarExtItemsC10.res"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dcldxBarC10.bpi"); +USEPACKAGE("dxComnC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("dclcxLibraryC10.bpi"); +USEPACKAGE("dxBarExtItemsC10.bpi"); +USEUNIT("dxBarExtItemsReg.pas"); +USEFORMNS("dxBarImageComboEditor.pas", Dxbarimagecomboeditor, dxBarImageComboEditorForm); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC10.res b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC10.res new file mode 100644 index 00000000..598a6317 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC11.bpk b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC11.bpk new file mode 100644 index 00000000..8cf49d12 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC11.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxBarExtItemsC11.bpl +OBJFILES = dxBarExtItemsReg.obj dxBarImageComboEditor.obj dcldxBarExtItemsC11.obj +MAINSOURCE = dcldxBarExtItemsC11.cpp +RESFILES = dcldxBarExtItemsC11.res +DEFFILE = +RESDEPEN = $(RESFILES) dxBarImageComboEditor.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = vclx.bpi rtl.bpi vcl.bpi designide.bpi dxComnC11.bpi dxBarExtItemsC11.bpi \ + dxThemeC11.bpi cxLibraryC11.bpi dclcxLibraryC11.bpi dcldxBarC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Extended Items by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC11.cpp b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC11.cpp new file mode 100644 index 00000000..e8e27cd0 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC11.cpp @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxBarExtItemsC11.res"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dcldxBarC11.bpi"); +USEPACKAGE("dxComnC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEPACKAGE("dxBarExtItemsC11.bpi"); +USEUNIT("dxBarExtItemsReg.pas"); +USEFORMNS("dxBarImageComboEditor.pas", Dxbarimagecomboeditor, dxBarImageComboEditorForm); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC11.res b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC11.res new file mode 100644 index 00000000..d2ea4bcf Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC5.bpk b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC5.bpk new file mode 100644 index 00000000..8a3c31cf --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC5.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dcldxBarExtItemsC5.bpl +OBJFILES = dxBarExtItemsReg.obj dxBarImageComboEditor.obj dcldxBarExtItemsC5.obj +RESFILES = dcldxBarExtItemsC5.res +DEFFILE = +RESDEPEN = $(RESFILES) dxBarImageComboEditor.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib +PACKAGES = vclx50.bpi VCL50.bpi dxComnC5.bpi dxBarExtItemsC5.bpi dcldxBarC5.bpi \ + dxThemeC5.bpi cxLibraryVCLC5.bpi dclcxLibraryVCLC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Extended Items by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC5.cpp b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC5.cpp new file mode 100644 index 00000000..25f1bd8b --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC5.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxBarExtItemsC5.res"); +USEPACKAGE("vclx50.bpi"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("dcldxBarC5.bpi"); +USEPACKAGE("dxComnC5.bpi"); +USEPACKAGE("dxBarExtItemsC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("dclcxLibraryVCLC5.bpi"); +USEUNIT("dxBarExtItemsReg.pas"); +USEFORMNS("dxBarImageComboEditor.pas", Dxbarimagecomboeditor, dxBarImageComboEditorForm); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC5.res b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC5.res new file mode 100644 index 00000000..5cdd7cd3 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC6.bpk b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC6.bpk new file mode 100644 index 00000000..eded2ea0 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC6.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxBarExtItemsC6.bpl +OBJFILES = dxBarExtItemsReg.obj dxBarImageComboEditor.obj dcldxBarExtItemsC6.obj +RESFILES = dcldxBarExtItemsC6.res +DEFFILE = +RESDEPEN = $(RESFILES) dxBarImageComboEditor.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = vclx.bpi rtl.bpi vcl.bpi designide.bpi dxComnC6.bpi dxBarExtItemsC6.bpi \ + dxThemeC6.bpi cxLibraryVCLC6.bpi dclcxLibraryVCLC6.bpi dcldxBarC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Extended Items by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC6.cpp b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC6.cpp new file mode 100644 index 00000000..53ef1c86 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC6.cpp @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxBarExtItemsC6.res"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dcldxBarC6.bpi"); +USEPACKAGE("dxComnC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("dclcxLibraryVCLC6.bpi"); +USEPACKAGE("dxBarExtItemsC6.bpi"); +USEUNIT("dxBarExtItemsReg.pas"); +USEFORMNS("dxBarImageComboEditor.pas", Dxbarimagecomboeditor, dxBarImageComboEditorForm); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC6.res b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC6.res new file mode 100644 index 00000000..12fe5555 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsC6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD10.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD10.dpk new file mode 100644 index 00000000..e9f4b31e --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD10.dpk @@ -0,0 +1,38 @@ +package dcldxBarExtItemsD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars extended items by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dcldxBarD10, + dxBarExtItemsD10; + +contains + dxBarImageComboEditor, + dxBarExtItemsReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD10.res b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD10.res new file mode 100644 index 00000000..d39b32fe Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD11.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD11.dpk new file mode 100644 index 00000000..e87a5c33 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD11.dpk @@ -0,0 +1,38 @@ +package dcldxBarExtItemsD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars extended items by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dcldxBarD11, + dxBarExtItemsD11; + +contains + dxBarImageComboEditor, + dxBarExtItemsReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD11.res b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD11.res new file mode 100644 index 00000000..01173e74 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD5.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD5.dpk new file mode 100644 index 00000000..5dded409 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD5.dpk @@ -0,0 +1,38 @@ +package dcldxBarExtItemsD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars extended items by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dcldxBarD5, + dxBarExtItemsD5; + +contains + dxBarImageComboEditor, + dxBarExtItemsReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD5.res b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD5.res new file mode 100644 index 00000000..73398cc2 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD6.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD6.dpk new file mode 100644 index 00000000..47aea967 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD6.dpk @@ -0,0 +1,38 @@ +package dcldxBarExtItemsD6; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars extended items by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dcldxBarD6, + dxBarExtItemsD6; + +contains + dxBarImageComboEditor, + dxBarExtItemsReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD6.res b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD6.res new file mode 100644 index 00000000..f73ff30b Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD7.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD7.dpk new file mode 100644 index 00000000..e3f22656 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD7.dpk @@ -0,0 +1,38 @@ +package dcldxBarExtItemsD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars extended items by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dcldxBarD7, + dxBarExtItemsD7; + +contains + dxBarImageComboEditor, + dxBarExtItemsReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD7.res b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD7.res new file mode 100644 index 00000000..a03f1157 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD7.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD9.dpk b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD9.dpk new file mode 100644 index 00000000..f3831861 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD9.dpk @@ -0,0 +1,38 @@ +package dcldxBarExtItemsD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars extended items by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dcldxBarD9, + dxBarExtItemsD9; + +contains + dxBarImageComboEditor, + dxBarExtItemsReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD9.res b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD9.res new file mode 100644 index 00000000..bc60dd82 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxBarExtItemsD9.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonC10.bpk b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC10.bpk new file mode 100644 index 00000000..56a7c672 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC10.bpk @@ -0,0 +1,140 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxRibbonC10.bpl +OBJFILES = dcldxRibbonC10.obj dxRibbonGalleryFilterEd.obj dxRibbonGalleryReg.obj \ + dxRibbonReg.obj +MAINSOURCE = dcldxRibbonC10.cpp +RESFILES = dcldxRibbonC10.res dxRibbonReg.dcr +DEFFILE = +RESDEPEN = $(RESFILES) dxRibbonGalleryFilterEd.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi vclx.bpi designide.bpi dxcomnC10.bpi cxLibraryC10.bpi \ + dxBarC10.bpi dxRibbonC10.bpi dclcxLibraryC10.bpi dcldxBarC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Ribbon controls by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonC10.cpp b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC10.cpp new file mode 100644 index 00000000..1776b502 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC10.cpp @@ -0,0 +1,28 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxRibbonC10.res"); +USERES("dxRibbonReg.dcr"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("VCLX.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("dxcomnC10.bpi"); +USEPACKAGE("dxBarC10.bpi"); +USEPACKAGE("dxRibbonC10.bpi"); +USEPACKAGE("dclcxLibraryC10.bpi"); +USEPACKAGE("dcldxBarC10.bpi"); +USEUNIT("dxRibbonGalleryFilterEd.pas"); +USEUNIT("dxRibbonGalleryReg.pas"); +USEUNIT("dxRibbonReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonC10.res b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC10.res new file mode 100644 index 00000000..e1af5ccf Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonC11.bpk b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC11.bpk new file mode 100644 index 00000000..fa483f21 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC11.bpk @@ -0,0 +1,140 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxRibbonC11.bpl +OBJFILES = dcldxRibbonC11.obj dxRibbonGalleryFilterEd.obj dxRibbonGalleryReg.obj \ + dxRibbonReg.obj +MAINSOURCE = dcldxRibbonC11.cpp +RESFILES = dcldxRibbonC11.res dxRibbonReg.dcr +DEFFILE = +RESDEPEN = $(RESFILES) dxRibbonGalleryFilterEd.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi vclx.bpi designide.bpi dxcomnC11.bpi cxLibraryC11.bpi \ + dxBarC11.bpi dxRibbonC11.bpi dclcxLibraryC11.bpi dcldxBarC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Ribbon controls by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonC11.cpp b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC11.cpp new file mode 100644 index 00000000..ec6e75da --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC11.cpp @@ -0,0 +1,28 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxRibbonC11.res"); +USERES("dxRibbonReg.dcr"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("VCLX.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxcomnC11.bpi"); +USEPACKAGE("dxBarC11.bpi"); +USEPACKAGE("dxRibbonC11.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEPACKAGE("dcldxBarC11.bpi"); +USEUNIT("dxRibbonGalleryFilterEd.pas"); +USEUNIT("dxRibbonGalleryReg.pas"); +USEUNIT("dxRibbonReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonC11.res b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC11.res new file mode 100644 index 00000000..445dde91 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonC5.bpk b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC5.bpk new file mode 100644 index 00000000..3f46ae2b --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC5.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dcldxRibbonC5.bpl +OBJFILES = dcldxRibbonC5.obj dxRibbonGalleryFilterEd.obj dxRibbonGalleryReg.obj \ + dxRibbonReg.obj +RESFILES = dcldxRibbonC5.res dxRibbonReg.dcr +DEFFILE = +RESDEPEN = $(RESFILES) dxRibbonGalleryFilterEd.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib +PACKAGES = VCL50.bpi vclx50.bpi dsnide50.bpi dxcomnC5.bpi cxLibraryVCLC5.bpi \ + dxBarC5.bpi dxRibbonC5.bpi dclcxLibraryVCLC5.bpi dcldxBarC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Ribbon controls by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonC5.cpp b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC5.cpp new file mode 100644 index 00000000..433c9f83 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC5.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxRibbonC5.res"); +USERES("dxRibbonReg.dcr"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("VCLX50.bpi"); +USEPACKAGE("dsnide50.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("dxcomnC5.bpi"); +USEPACKAGE("dxBarC5.bpi"); +USEPACKAGE("dxRibbonC5.bpi"); +USEPACKAGE("dclcxLibraryVCLC5.bpi"); +USEPACKAGE("dcldxBarC5.bpi"); +USEUNIT("dxRibbonGalleryFilterEd.pas"); +USEUNIT("dxRibbonGalleryReg.pas"); +USEUNIT("dxRibbonReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonC5.res b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC5.res new file mode 100644 index 00000000..3d0ec029 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonC6.bpk b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC6.bpk new file mode 100644 index 00000000..becf461a --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC6.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxRibbonC6.bpl +OBJFILES = dcldxRibbonC6.obj dxRibbonGalleryFilterEd.obj dxRibbonGalleryReg.obj \ + dxRibbonReg.obj +RESFILES = dcldxRibbonC6.res dxRibbonReg.dcr +DEFFILE = +RESDEPEN = $(RESFILES) dxRibbonGalleryFilterEd.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib +PACKAGES = rtl.bpi vcl.bpi vclx.bpi designide.bpi dxcomnC6.bpi cxLibraryVCLC6.bpi \ + dxBarC6.bpi dxRibbonC6.bpi dclcxLibraryVCLC6.bpi dcldxBarC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Ribbon controls by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonC6.cpp b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC6.cpp new file mode 100644 index 00000000..323d8a37 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC6.cpp @@ -0,0 +1,28 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxRibbonC6.res"); +USERES("dxRibbonReg.dcr"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("VCLX.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("dxcomnC6.bpi"); +USEPACKAGE("dxBarC6.bpi"); +USEPACKAGE("dxRibbonC6.bpi"); +USEPACKAGE("dclcxLibraryVCLC6.bpi"); +USEPACKAGE("dcldxBarC6.bpi"); +USEUNIT("dxRibbonGalleryFilterEd.pas"); +USEUNIT("dxRibbonGalleryReg.pas"); +USEUNIT("dxRibbonReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- \ No newline at end of file diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonC6.res b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC6.res new file mode 100644 index 00000000..d1684725 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxRibbonC6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonD10.dpk b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD10.dpk new file mode 100644 index 00000000..5bbbb2a7 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD10.dpk @@ -0,0 +1,39 @@ +package dcldxRibbonD10; + +{$R *.res} +{$R dxRibbonReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars Ribbon controls by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + dxRibbonD10, + dcldxBarD10; + +contains + dxRibbonGalleryFilterEd, + dxRibbonGalleryReg, + dxRibbonReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonD10.res b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD10.res new file mode 100644 index 00000000..b227360b Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonD11.dpk b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD11.dpk new file mode 100644 index 00000000..43556ee7 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD11.dpk @@ -0,0 +1,39 @@ +package dcldxRibbonD11; + +{$R *.res} +{$R dxRibbonReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars Ribbon controls by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + dxRibbonD11, + dcldxBarD11; + +contains + dxRibbonGalleryFilterEd, + dxRibbonGalleryReg, + dxRibbonReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonD11.res b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD11.res new file mode 100644 index 00000000..fa0e7db7 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonD5.dpk b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD5.dpk new file mode 100644 index 00000000..edb23645 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD5.dpk @@ -0,0 +1,39 @@ +package dcldxRibbonD5; + +{$R *.RES} +{$R dxRibbonReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars Ribbon controls by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + dxRibbonD5, + dcldxBarD5; + +contains + dxRibbonGalleryFilterEd, + dxRibbonGalleryReg, + dxRibbonReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonD5.res b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD5.res new file mode 100644 index 00000000..88ab4a9a Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonD6.dpk b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD6.dpk new file mode 100644 index 00000000..00d47497 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD6.dpk @@ -0,0 +1,39 @@ +package dcldxRibbonD6; + +{$R *.RES} +{$R dxRibbonReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars Ribbon controls by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + dxRibbonD6, + dcldxBarD6; + +contains + dxRibbonGalleryFilterEd, + dxRibbonGalleryReg, + dxRibbonReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonD6.res b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD6.res new file mode 100644 index 00000000..5863a46b Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonD7.dpk b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD7.dpk new file mode 100644 index 00000000..03b457b5 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD7.dpk @@ -0,0 +1,39 @@ +package dcldxRibbonD7; + +{$R *.res} +{$R dxRibbonReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars Ribbon controls by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + dxRibbonD7, + dcldxBarD7; + +contains + dxRibbonGalleryFilterEd, + dxRibbonGalleryReg, + dxRibbonReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonD7.res b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD7.res new file mode 100644 index 00000000..22e0250d Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD7.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonD9.dpk b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD9.dpk new file mode 100644 index 00000000..5f9c322a --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD9.dpk @@ -0,0 +1,39 @@ +package dcldxRibbonD9; + +{$R *.res} +{$R dxRibbonReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars Ribbon controls by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + dxRibbonD9, + dcldxBarD9; + +contains + dxRibbonGalleryFilterEd, + dxRibbonGalleryReg, + dxRibbonReg; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dcldxRibbonD9.res b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD9.res new file mode 100644 index 00000000..c9c930db Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dcldxRibbonD9.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarC10.bpk b/official/x.35/ExpressBars 6/Packages/dxBarC10.bpk new file mode 100644 index 00000000..83c6f36a --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarC10.bpk @@ -0,0 +1,142 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxBarC10.bpl +OBJFILES = dxBar.obj dxBarCommon.obj dxBarCustForm.obj dxBarItemEd.obj \ + dxBarNameEd.obj dxBarPopupMenuEd.obj DxBarAddGroupItemsEd.obj dxBarStrs.obj \ + dxStatusBar.obj dxBarSkin.obj dxFading.obj dxBarAccessibility.obj dxBarC10.obj \ + dxBarSkinConsts.obj +MAINSOURCE = dxBarC10.cpp +RESFILES = dxBarC10.res +DEFFILE = +RESDEPEN = $(RESFILES) dxBarCustForm.dfm dxBarItemEd.dfm dxBarNameEd.dfm \ + dxBarPopupMenuEd.dfm DxBarAddGroupItemsEd.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dxcomnC10.bpi dxThemeC10.bpi dxGDIPlusC10.bpi cxLibraryC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarC10.cpp b/official/x.35/ExpressBars 6/Packages/dxBarC10.cpp new file mode 100644 index 00000000..c446530c --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarC10.cpp @@ -0,0 +1,33 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxBarC10.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxcomnC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEPACKAGE("dxGDIPlusC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEFORMNS("dxBarCustForm.pas", Dxbarcustform, dxBarCustomizingForm); +USEFORMNS("dxBarItemEd.pas", Dxbaritemed, dxBarItemAddEditor); +USEFORMNS("dxBarNameEd.pas", Dxbarnameed, dxBarNameEd); +USEFORMNS("dxBarPopupMenuEd.pas", Dxbarpopupmenued, dxBarSubMenuEditor); +USEFORMNS("dxBarAddGroupItemsEd.pas", DxBarAddGroupItemsEd, frmAddGroupItems); +USEUNIT("dxBarCommon.pas"); +USEUNIT("dxBar.pas"); +USEUNIT("dxBarStrs.pas"); +USEUNIT("dxStatusBar.pas"); +USEUNIT("dxBarSkinConsts.pas"); +USEUNIT("dxBarAccessibility.pas"); +USEUNIT("dxBarSkin.pas"); +USEUNIT("dxFading.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarC10.res b/official/x.35/ExpressBars 6/Packages/dxBarC10.res new file mode 100644 index 00000000..ea6a43e3 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarC10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarC11.bpk b/official/x.35/ExpressBars 6/Packages/dxBarC11.bpk new file mode 100644 index 00000000..282b3af9 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarC11.bpk @@ -0,0 +1,142 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxBarC11.bpl +OBJFILES = dxBar.obj dxBarCommon.obj dxBarCustForm.obj dxBarItemEd.obj \ + dxBarNameEd.obj dxBarPopupMenuEd.obj DxBarAddGroupItemsEd.obj dxBarStrs.obj \ + dxStatusBar.obj dxBarSkin.obj dxFading.obj dxBarAccessibility.obj dxBarC11.obj \ + dxBarSkinConsts.obj +MAINSOURCE = dxBarC11.cpp +RESFILES = dxBarC11.res +DEFFILE = +RESDEPEN = $(RESFILES) dxBarCustForm.dfm dxBarItemEd.dfm dxBarNameEd.dfm \ + dxBarPopupMenuEd.dfm DxBarAddGroupItemsEd.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dxcomnC11.bpi dxThemeC11.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarC11.cpp b/official/x.35/ExpressBars 6/Packages/dxBarC11.cpp new file mode 100644 index 00000000..b080b9c6 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarC11.cpp @@ -0,0 +1,33 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxBarC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxcomnC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEFORMNS("dxBarCustForm.pas", Dxbarcustform, dxBarCustomizingForm); +USEFORMNS("dxBarItemEd.pas", Dxbaritemed, dxBarItemAddEditor); +USEFORMNS("dxBarNameEd.pas", Dxbarnameed, dxBarNameEd); +USEFORMNS("dxBarPopupMenuEd.pas", Dxbarpopupmenued, dxBarSubMenuEditor); +USEFORMNS("dxBarAddGroupItemsEd.pas", DxBarAddGroupItemsEd, frmAddGroupItems); +USEUNIT("dxBarCommon.pas"); +USEUNIT("dxBar.pas"); +USEUNIT("dxBarStrs.pas"); +USEUNIT("dxStatusBar.pas"); +USEUNIT("dxBarSkinConsts.pas"); +USEUNIT("dxBarAccessibility.pas"); +USEUNIT("dxBarSkin.pas"); +USEUNIT("dxFading.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarC11.res b/official/x.35/ExpressBars 6/Packages/dxBarC11.res new file mode 100644 index 00000000..84001925 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarC11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarC5.bpk b/official/x.35/ExpressBars 6/Packages/dxBarC5.bpk new file mode 100644 index 00000000..d226149b --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarC5.bpk @@ -0,0 +1,141 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxBarC5.bpl +OBJFILES = dxBarC5.obj dxBar.obj dxBarCommon.obj dxBarCustForm.obj \ + dxBarItemEd.obj dxBarNameEd.obj dxBarPopupMenuEd.obj \ + DxBarAddGroupItemsEd.obj dxBarStrs.obj dxStatusBar.obj dxBarSkin.obj \ + dxFading.obj dxBarAccessibility.obj dxBarSkinConsts.obj +RESFILES = dxBarC5.res +DEFFILE = +RESDEPEN = $(RESFILES) dxBarCustForm.dfm dxBarItemEd.dfm dxBarNameEd.dfm \ + dxBarPopupMenuEd.dfm DxBarAddGroupItemsEd.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib +PACKAGES = VCL50.bpi dxcomnc5.bpi dxThemeC5.bpi dxGDIPlusC5.bpi cxLibraryVCLC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarC5.cpp b/official/x.35/ExpressBars 6/Packages/dxBarC5.cpp new file mode 100644 index 00000000..f2ce518f --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarC5.cpp @@ -0,0 +1,32 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxBarC5.res"); +USEPACKAGE("VCL50.bpi"); +USEUNIT("dxBarCommon.pas"); +USEUNIT("dxBar.pas"); +USEFORMNS("dxBarCustForm.pas", Dxbarcustform, dxBarCustomizingForm); +USEFORMNS("dxBarItemEd.pas", Dxbaritemed, dxBarItemAddEditor); +USEFORMNS("dxBarNameEd.pas", Dxbarnameed, dxBarNameEd); +USEFORMNS("dxBarPopupMenuEd.pas", Dxbarpopupmenued, dxBarSubMenuEditor); +USEFORMNS("dxBarAddGroupItemsEd.pas", DxBarAddGroupItemsEd, frmAddGroupItems); +USEUNIT("dxBarStrs.pas"); +USEUNIT("dxStatusBar.pas"); +USEPACKAGE("dxcomnC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEPACKAGE("dxGDIPlusC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEUNIT("dxBarSkinConsts.pas"); +USEUNIT("dxBarAccessibility.pas"); +USEUNIT("dxBarSkin.pas"); +USEUNIT("dxFading.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarC5.res b/official/x.35/ExpressBars 6/Packages/dxBarC5.res new file mode 100644 index 00000000..d5e05409 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarC5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarC6.bpk b/official/x.35/ExpressBars 6/Packages/dxBarC6.bpk new file mode 100644 index 00000000..2df8e66e --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarC6.bpk @@ -0,0 +1,141 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxBarC6.bpl +OBJFILES = dxBar.obj dxBarCommon.obj dxBarCustForm.obj dxBarItemEd.obj \ + dxBarNameEd.obj dxBarPopupMenuEd.obj DxBarAddGroupItemsEd.obj dxBarStrs.obj \ + dxStatusBar.obj dxBarSkin.obj dxFading.obj dxBarAccessibility.obj dxBarC6.obj \ + dxBarSkinConsts.obj +RESFILES = dxBarC6.res +DEFFILE = +RESDEPEN = $(RESFILES) dxBarCustForm.dfm dxBarItemEd.dfm dxBarNameEd.dfm \ + dxBarPopupMenuEd.dfm DxBarAddGroupItemsEd.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dxcomnC6.bpi dxThemeC6.bpi dxGDIPlusC6.bpi cxLibraryVCLC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarC6.cpp b/official/x.35/ExpressBars 6/Packages/dxBarC6.cpp new file mode 100644 index 00000000..4a300281 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarC6.cpp @@ -0,0 +1,33 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxBarC6.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxcomnC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEPACKAGE("dxGDIPlusC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEFORMNS("dxBarCustForm.pas", Dxbarcustform, dxBarCustomizingForm); +USEFORMNS("dxBarItemEd.pas", Dxbaritemed, dxBarItemAddEditor); +USEFORMNS("dxBarNameEd.pas", Dxbarnameed, dxBarNameEd); +USEFORMNS("dxBarPopupMenuEd.pas", Dxbarpopupmenued, dxBarSubMenuEditor); +USEFORMNS("dxBarAddGroupItemsEd.pas", DxBarAddGroupItemsEd, frmAddGroupItems); +USEUNIT("dxBarCommon.pas"); +USEUNIT("dxBar.pas"); +USEUNIT("dxBarStrs.pas"); +USEUNIT("dxStatusBar.pas"); +USEUNIT("dxBarSkinConsts.pas"); +USEUNIT("dxBarAccessibility.pas"); +USEUNIT("dxBarSkin.pas"); +USEUNIT("dxFading.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarC6.res b/official/x.35/ExpressBars 6/Packages/dxBarC6.res new file mode 100644 index 00000000..a47be635 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarC6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarD10.dpk b/official/x.35/ExpressBars 6/Packages/dxBarD10.dpk new file mode 100644 index 00000000..38d179bb --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarD10.dpk @@ -0,0 +1,48 @@ +package dxBarD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxComnD10, + cxLibraryD10; + +contains + dxBarStrs, + dxBarAddGroupItemsEd, + dxBarCommon, + dxBarCustForm, + dxBarItemEd, + dxBarNameEd, + dxBarPopupMenuEd, + dxStatusBar, + dxBar, + dxBarSkinConsts, + dxBarSkin, + dxFading, + dxBarAccessibility; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarD10.res b/official/x.35/ExpressBars 6/Packages/dxBarD10.res new file mode 100644 index 00000000..a4ce2128 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarD10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarD11.dpk b/official/x.35/ExpressBars 6/Packages/dxBarD11.dpk new file mode 100644 index 00000000..0773bd45 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarD11.dpk @@ -0,0 +1,48 @@ +package dxBarD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxComnD11, + cxLibraryD11; + +contains + dxBarStrs, + dxBarAddGroupItemsEd, + dxBarCommon, + dxBarCustForm, + dxBarItemEd, + dxBarNameEd, + dxBarPopupMenuEd, + dxStatusBar, + dxBar, + dxBarSkinConsts, + dxBarSkin, + dxFading, + dxBarAccessibility; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarD11.res b/official/x.35/ExpressBars 6/Packages/dxBarD11.res new file mode 100644 index 00000000..6064092f Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarD11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarD5.dpk b/official/x.35/ExpressBars 6/Packages/dxBarD5.dpk new file mode 100644 index 00000000..20e723b7 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarD5.dpk @@ -0,0 +1,49 @@ +package dxBarD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxComnD5, + cxLibraryVCLD5; + + +contains + dxBarCommon, + dxBar, + dxBarCustForm, + dxBarItemEd, + dxBarNameEd, + dxBarPopupMenuEd, + dxBarAddGroupItemsEd, + dxStatusBar, + dxBarStrs, + dxBarSkinConsts, + dxBarSkin, + dxFading, + dxBarAccessibility; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarD5.res b/official/x.35/ExpressBars 6/Packages/dxBarD5.res new file mode 100644 index 00000000..998e68e3 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarD5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarD6.dpk b/official/x.35/ExpressBars 6/Packages/dxBarD6.dpk new file mode 100644 index 00000000..305ddf71 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarD6.dpk @@ -0,0 +1,48 @@ +package dxBarD6; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxComnD6, + cxLibraryVCLD6; + +contains + dxBarCommon, + dxBar, + dxBarCustForm, + dxBarItemEd, + dxBarNameEd, + dxBarPopupMenuEd, + dxBarAddGroupItemsEd, + dxStatusBar, + dxBarStrs, + dxBarSkinConsts, + dxBarSkin, + dxFading, + dxBarAccessibility; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarD6.res b/official/x.35/ExpressBars 6/Packages/dxBarD6.res new file mode 100644 index 00000000..878b9e69 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarD6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarD7.dpk b/official/x.35/ExpressBars 6/Packages/dxBarD7.dpk new file mode 100644 index 00000000..0a5f89a5 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarD7.dpk @@ -0,0 +1,48 @@ +package dxBarD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxComnD7, + cxLibraryVCLD7; + +contains + dxBarStrs, + dxBarAddGroupItemsEd, + dxBarCommon, + dxBarCustForm, + dxBarItemEd, + dxBarNameEd, + dxBarPopupMenuEd, + dxStatusBar, + dxBar, + dxBarSkinConsts, + dxBarSkin, + dxFading, + dxBarAccessibility; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarD7.res b/official/x.35/ExpressBars 6/Packages/dxBarD7.res new file mode 100644 index 00000000..2204e655 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarD7.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarD9.dpk b/official/x.35/ExpressBars 6/Packages/dxBarD9.dpk new file mode 100644 index 00000000..c0df556d --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarD9.dpk @@ -0,0 +1,48 @@ +package dxBarD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxComnD9, + cxLibraryD9; + +contains + dxBarStrs, + dxBarAddGroupItemsEd, + dxBarCommon, + dxBarCustForm, + dxBarItemEd, + dxBarNameEd, + dxBarPopupMenuEd, + dxStatusBar, + dxBar, + dxBarSkinConsts, + dxBarSkin, + dxFading, + dxBarAccessibility; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarD9.res b/official/x.35/ExpressBars 6/Packages/dxBarD9.res new file mode 100644 index 00000000..8de4b3d9 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarD9.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavC10.bpk b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC10.bpk new file mode 100644 index 00000000..148eb04b --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC10.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxBarDBNavC10.bpl +OBJFILES = dxBarDBNavStrs.obj dxBarDBNav.obj dxBarDBNavC10.obj +MAINSOURCE = dxBarDBNavC10.cpp +RESFILES = dxBarDBNavC10.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi dxBarC10.bpi cxLibraryC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars DBNavigator by Developer Expess Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavC10.cpp b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC10.cpp new file mode 100644 index 00000000..61df6c2d --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC10.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxBarDBNavC10.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxBarC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEUNIT("dxBarDBNavStrs.pas"); +USEUNIT("dxBarDBNav.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavC10.res b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC10.res new file mode 100644 index 00000000..93aecb5c Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavC11.bpk b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC11.bpk new file mode 100644 index 00000000..77466ad8 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC11.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxBarDBNavC11.bpl +OBJFILES = dxBarDBNavStrs.obj dxBarDBNav.obj dxBarDBNavC11.obj +MAINSOURCE = dxBarDBNavC11.cpp +RESFILES = dxBarDBNavC11.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi dxBarC11.bpi cxLibraryC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars DBNavigator by Developer Expess Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavC11.cpp b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC11.cpp new file mode 100644 index 00000000..5f1399c7 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC11.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxBarDBNavC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxBarC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEUNIT("dxBarDBNavStrs.pas"); +USEUNIT("dxBarDBNav.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavC11.res b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC11.res new file mode 100644 index 00000000..4374f920 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavC5.bpk b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC5.bpk new file mode 100644 index 00000000..1cd74123 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC5.bpk @@ -0,0 +1,136 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxBarDBNavC5.bpl +OBJFILES = dxBarDBNavStrs.obj dxBarDBNav.obj dxBarDBNavC5.obj +RESFILES = dxBarDBNavC5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib +PACKAGES = VCL50.bpi vcldb50.bpi dxBarC5.bpi cxLibraryVCLC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars DBNavigator by Developer Expess Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavC5.cpp b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC5.cpp new file mode 100644 index 00000000..ebd813ef --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC5.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxBarDBNavC5.res"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("dxBarC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEUNIT("dxBarDBNavStrs.pas"); +USEUNIT("dxBarDBNav.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavC5.res b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC5.res new file mode 100644 index 00000000..5d8fe4ae Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavC6.bpk b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC6.bpk new file mode 100644 index 00000000..42c220d8 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC6.bpk @@ -0,0 +1,136 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxBarDBNavC6.bpl +OBJFILES = dxBarDBNavStrs.obj dxBarDBNav.obj dxBarDBNavC6.obj +RESFILES = dxBarDBNavC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi dxBarC6.bpi cxLibraryVCLC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars DBNavigator by Developer Expess Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavC6.cpp b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC6.cpp new file mode 100644 index 00000000..ac7cdfa4 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC6.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxBarDBNavC6.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxBarC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEUNIT("dxBarDBNavStrs.pas"); +USEUNIT("dxBarDBNav.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavC6.res b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC6.res new file mode 100644 index 00000000..24bdbdbd Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarDBNavC6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavD10.dpk b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD10.dpk new file mode 100644 index 00000000..895be82f --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD10.dpk @@ -0,0 +1,38 @@ +package dxBarDBNavD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars DBNavigator by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + dxBarD10; + +contains + dxBarDBNavStrs, + dxBarDBNav; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavD10.res b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD10.res new file mode 100644 index 00000000..68403fb2 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavD11.dpk b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD11.dpk new file mode 100644 index 00000000..5ea36d9f --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD11.dpk @@ -0,0 +1,38 @@ +package dxBarDBNavD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars DBNavigator by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + dxBarD11; + +contains + dxBarDBNavStrs, + dxBarDBNav; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavD11.res b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD11.res new file mode 100644 index 00000000..146387fe Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavD5.dpk b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD5.dpk new file mode 100644 index 00000000..e0f0d123 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD5.dpk @@ -0,0 +1,38 @@ +package dxBarDBNavD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars DBNavigator by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcldb50, + dxBarD5; + +contains + dxBarDBNav, + dxBarDBNavStrs; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavD5.res b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD5.res new file mode 100644 index 00000000..fb8e204a Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavD6.dpk b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD6.dpk new file mode 100644 index 00000000..e3c8fa2b --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD6.dpk @@ -0,0 +1,38 @@ +package dxBarDBNavD6; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars DBNavigator by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + dxBarD6; + +contains + dxBarDBNav, + dxBarDBNavStrs; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavD6.res b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD6.res new file mode 100644 index 00000000..5a0a24cf Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavD7.dpk b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD7.dpk new file mode 100644 index 00000000..f3a0e122 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD7.dpk @@ -0,0 +1,38 @@ +package dxBarDBNavD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars DBNavigator by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + dxBarD7; + +contains + dxBarDBNavStrs, + dxBarDBNav; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavD7.res b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD7.res new file mode 100644 index 00000000..e83f6517 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD7.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavD9.dpk b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD9.dpk new file mode 100644 index 00000000..06938e84 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD9.dpk @@ -0,0 +1,38 @@ +package dxBarDBNavD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars DBNavigator by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + dxBarD9; + +contains + dxBarDBNavStrs, + dxBarDBNav; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarDBNavD9.res b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD9.res new file mode 100644 index 00000000..c607f7e1 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarDBNavD9.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC10.bpk b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC10.bpk new file mode 100644 index 00000000..db0e68f1 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC10.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxBarExtDBItemsC10.bpl +OBJFILES = dxBarExtDBItems.obj dxBarExtDBItemsC10.obj +MAINSOURCE = dxBarExtDBItemsC10.cpp +RESFILES = dxBarExtDBItemsC10.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi dxBarC10.bpi dxcomnC10.bpi cxLibraryC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Extended DB Items by Developer Express Inc." -aa -Tpp -x -Gn -Gl \ + -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC10.cpp b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC10.cpp new file mode 100644 index 00000000..bda95999 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC10.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxBarExtDBItemsC10.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxBarC10.bpi"); +USEPACKAGE("dxcomnC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEUNIT("dxBarExtDBItems.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC10.res b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC10.res new file mode 100644 index 00000000..c80118f9 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC11.bpk b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC11.bpk new file mode 100644 index 00000000..6489ce17 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC11.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxBarExtDBItemsC11.bpl +OBJFILES = dxBarExtDBItems.obj dxBarExtDBItemsC11.obj +MAINSOURCE = dxBarExtDBItemsC11.cpp +RESFILES = dxBarExtDBItemsC11.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi dxBarC11.bpi dxcomnC11.bpi cxLibraryC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Extended DB Items by Developer Express Inc." -aa -Tpp -x -Gn -Gl \ + -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC11.cpp b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC11.cpp new file mode 100644 index 00000000..2bbe3b03 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC11.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxBarExtDBItemsC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxBarC11.bpi"); +USEPACKAGE("dxcomnC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEUNIT("dxBarExtDBItems.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC11.res b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC11.res new file mode 100644 index 00000000..5a54d417 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC5.bpk b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC5.bpk new file mode 100644 index 00000000..5a34317b --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC5.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxBarExtDBItemsC5.bpl +OBJFILES = dxBarExtDBItems.obj dxBarExtDBItemsC5.obj +RESFILES = dxBarExtDBItemsC5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib +PACKAGES = VCL50.bpi vcldb50.bpi dxBarC5.bpi dxcomnc5.bpi cxLibraryVCLC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Extended DB Items by Developer Express Inc." -aa -Tpp -x -Gn -Gl \ + -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC5.cpp b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC5.cpp new file mode 100644 index 00000000..1fd338a6 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC5.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxBarExtDBItemsC5.res"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("dxBarC5.bpi"); +USEPACKAGE("dxcomnC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEUNIT("dxBarExtDBItems.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC5.res b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC5.res new file mode 100644 index 00000000..21925d1f Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC6.bpk b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC6.bpk new file mode 100644 index 00000000..c47fed63 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC6.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxBarExtDBItemsC6.bpl +OBJFILES = dxBarExtDBItems.obj dxBarExtDBItemsC6.obj +RESFILES = dxBarExtDBItemsC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi dxBarC6.bpi dxcomnC6.bpi cxLibraryVCLC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Extended DB Items by Developer Express Inc." -aa -Tpp -x -Gn -Gl \ + -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC6.cpp b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC6.cpp new file mode 100644 index 00000000..4c09d59d --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC6.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxBarExtDBItemsC6.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxBarC6.bpi"); +USEPACKAGE("dxcomnC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEUNIT("dxBarExtDBItems.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC6.res b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC6.res new file mode 100644 index 00000000..8ed7184b Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsC6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD10.dpk b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD10.dpk new file mode 100644 index 00000000..63d0a266 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD10.dpk @@ -0,0 +1,38 @@ +package dxBarExtDBItemsD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars extended DB items by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + dxBarD10, + dxComnD10; + +contains + dxBarExtDBItems; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD10.res b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD10.res new file mode 100644 index 00000000..9f11cf07 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD11.dpk b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD11.dpk new file mode 100644 index 00000000..668e1573 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD11.dpk @@ -0,0 +1,38 @@ +package dxBarExtDBItemsD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars extended DB items by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + dxBarD11, + dxComnD11; + +contains + dxBarExtDBItems; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD11.res b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD11.res new file mode 100644 index 00000000..83697b41 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD5.dpk b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD5.dpk new file mode 100644 index 00000000..dd0f94d7 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD5.dpk @@ -0,0 +1,38 @@ +package dxBarExtDBItemsD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars extended DB items by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcldb50, + dxBarD5, + dxComnD5; + +contains + dxBarExtDBItems; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD5.res b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD5.res new file mode 100644 index 00000000..b6906596 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD6.dpk b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD6.dpk new file mode 100644 index 00000000..647e8297 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD6.dpk @@ -0,0 +1,38 @@ +package dxBarExtDBItemsD6; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars extended DB items by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + dxBarD6, + dxComnD6; + +contains + dxBarExtDBItems; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD6.res b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD6.res new file mode 100644 index 00000000..12a0f234 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD7.dpk b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD7.dpk new file mode 100644 index 00000000..d2cfc94d --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD7.dpk @@ -0,0 +1,38 @@ +package dxBarExtDBItemsD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars extended DB items by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + dxBarD7, + dxComnD7; + +contains + dxBarExtDBItems; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD7.res b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD7.res new file mode 100644 index 00000000..2f26e40b Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD7.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD9.dpk b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD9.dpk new file mode 100644 index 00000000..f5a52501 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD9.dpk @@ -0,0 +1,38 @@ +package dxBarExtDBItemsD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars extended DB items by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + dxBarD9, + dxComnD9; + +contains + dxBarExtDBItems; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD9.res b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD9.res new file mode 100644 index 00000000..4c107df4 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarExtDBItemsD9.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC10.bpk b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC10.bpk new file mode 100644 index 00000000..5425c878 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC10.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxBarExtItemsC10.bpl +OBJFILES = dxBarExtItems.obj dxBarExtItemsC10.obj +MAINSOURCE = dxBarExtItemsC10.cpp +RESFILES = dxBarExtItemsC10.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = vclx.bpi rtl.bpi vcl.bpi dxBarC10.bpi dxcomnC10.bpi cxLibraryC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Extended Items by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC10.cpp b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC10.cpp new file mode 100644 index 00000000..b43094ca --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC10.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxBarExtItemsC10.res"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxBarC10.bpi"); +USEPACKAGE("dxcomnC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEUNIT("dxBarExtItems.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC10.res b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC10.res new file mode 100644 index 00000000..305d64f5 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC11.bpk b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC11.bpk new file mode 100644 index 00000000..b7c4a800 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC11.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxBarExtItemsC11.bpl +OBJFILES = dxBarExtItems.obj dxBarExtItemsC11.obj +MAINSOURCE = dxBarExtItemsC11.cpp +RESFILES = dxBarExtItemsC11.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = vclx.bpi rtl.bpi vcl.bpi dxBarC11.bpi dxcomnC11.bpi cxLibraryC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Extended Items by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC11.cpp b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC11.cpp new file mode 100644 index 00000000..3b3d8988 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC11.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxBarExtItemsC11.res"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxBarC11.bpi"); +USEPACKAGE("dxcomnC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEUNIT("dxBarExtItems.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC11.res b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC11.res new file mode 100644 index 00000000..6f00d2bc Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC5.bpk b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC5.bpk new file mode 100644 index 00000000..a45f5c4c --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC5.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxBarExtItemsC5.bpl +OBJFILES = dxBarExtItems.obj dxBarExtItemsC5.obj +RESFILES = dxBarExtItemsC5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib +PACKAGES = vclx50.bpi VCL50.bpi dxBarC5.bpi dxcomnc5.bpi cxLibraryVCLC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Extended Items by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC5.cpp b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC5.cpp new file mode 100644 index 00000000..f321d957 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC5.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxBarExtItemsC5.res"); +USEPACKAGE("vclx50.bpi"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("dxBarC5.bpi"); +USEPACKAGE("dxcomnC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEUNIT("dxBarExtItems.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC5.res b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC5.res new file mode 100644 index 00000000..8e1b42e9 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC6.bpk b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC6.bpk new file mode 100644 index 00000000..a7a7de4d --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC6.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxBarExtItemsC6.bpl +OBJFILES = dxBarExtItems.obj dxBarExtItemsC6.obj +RESFILES = dxBarExtItemsC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = vclx.bpi rtl.bpi vcl.bpi dxBarC6.bpi dxcomnC6.bpi cxLibraryVCLC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Extended Items by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC6.cpp b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC6.cpp new file mode 100644 index 00000000..2e15debe --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC6.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxBarExtItemsC6.res"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxBarC6.bpi"); +USEPACKAGE("dxcomnC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEUNIT("dxBarExtItems.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC6.res b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC6.res new file mode 100644 index 00000000..1679b5d4 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsC6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD10.dpk b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD10.dpk new file mode 100644 index 00000000..e2cb0c3f --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD10.dpk @@ -0,0 +1,37 @@ +package dxBarExtItemsD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars extended items by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxBarD10, + dxComnD10; + +contains + dxBarExtItems; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD10.res b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD10.res new file mode 100644 index 00000000..fa4dcc58 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD11.dpk b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD11.dpk new file mode 100644 index 00000000..44be90a4 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD11.dpk @@ -0,0 +1,37 @@ +package dxBarExtItemsD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars extended items by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxBarD11, + dxComnD11; + +contains + dxBarExtItems; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD11.res b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD11.res new file mode 100644 index 00000000..cec1de4d Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD5.dpk b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD5.dpk new file mode 100644 index 00000000..045b3400 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD5.dpk @@ -0,0 +1,37 @@ +package dxBarExtItemsD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars extended items by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxBarD5, + dxComnD5; + +contains + dxBarExtItems; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD5.res b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD5.res new file mode 100644 index 00000000..5323c812 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD6.dpk b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD6.dpk new file mode 100644 index 00000000..7945d5ec --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD6.dpk @@ -0,0 +1,37 @@ +package dxBarExtItemsD6; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars extended items by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxBarD6, + dxComnD6; + +contains + dxBarExtItems; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD6.res b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD6.res new file mode 100644 index 00000000..7be3f31a Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD7.dpk b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD7.dpk new file mode 100644 index 00000000..f6860afb --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD7.dpk @@ -0,0 +1,37 @@ +package dxBarExtItemsD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars extended items by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxBarD7, + dxComnD7; + +contains + dxBarExtItems; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD7.res b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD7.res new file mode 100644 index 00000000..d57ce40c Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD7.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD9.dpk b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD9.dpk new file mode 100644 index 00000000..550bd272 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD9.dpk @@ -0,0 +1,37 @@ +package dxBarExtItemsD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars extended items by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxBarD9, + dxComnD9; + +contains + dxBarExtItems; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD9.res b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD9.res new file mode 100644 index 00000000..455fa88d Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxBarExtItemsD9.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonC10.bpk b/official/x.35/ExpressBars 6/Packages/dxRibbonC10.bpk new file mode 100644 index 00000000..e89457b8 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxRibbonC10.bpk @@ -0,0 +1,140 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxRibbonC10.bpl +OBJFILES = dxRibbonC10.obj dxRibbon.obj dxRibbonForm.obj dxRibbonFormCaptionHelper.obj \ + dxRibbonGallery.obj dxRibbonGroupLayoutCalculator.obj dxRibbonSkins.obj dxRibbonStatusBar.obj +MAINSOURCE = dxRibbonC10.cpp +RESFILES = dxRibbonC10.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dxcomnC10.bpi dxThemeC10.bpi cxLibraryC10.bpi dxGDIPlusC10.bpi \ + dxBarC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Ribbon controls by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonC10.cpp b/official/x.35/ExpressBars 6/Packages/dxRibbonC10.cpp new file mode 100644 index 00000000..d18a869f --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxRibbonC10.cpp @@ -0,0 +1,28 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxRibbonC10.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxcomnC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEPACKAGE("dxGDIPlusC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("cxBarC10.bpi"); +USEUNIT("dxRibbon.pas"); +USEUNIT("dxRibbonForm.pas"); +USEUNIT("dxRibbonFormCaptionHelper.pas"); +USEUNIT("dxRibbonGallery.pas"); +USEUNIT("dxRibbonGroupLayoutCalculator.pas"); +USEUNIT("dxRibbonSkins.pas"); +USEUNIT("dxRibbonStatusBar.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- \ No newline at end of file diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonC10.res b/official/x.35/ExpressBars 6/Packages/dxRibbonC10.res new file mode 100644 index 00000000..b04d1bad Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxRibbonC10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonC11.bpk b/official/x.35/ExpressBars 6/Packages/dxRibbonC11.bpk new file mode 100644 index 00000000..71143796 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxRibbonC11.bpk @@ -0,0 +1,140 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxRibbonC11.bpl +OBJFILES = dxRibbonC11.obj dxRibbon.obj dxRibbonForm.obj dxRibbonFormCaptionHelper.obj \ + dxRibbonGallery.obj dxRibbonGroupLayoutCalculator.obj dxRibbonSkins.obj dxRibbonStatusBar.obj +MAINSOURCE = dxRibbonC11.cpp +RESFILES = dxRibbonC11.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dxcomnC11.bpi dxThemeC11.bpi cxLibraryC11.bpi dxGDIPlusC11.bpi \ + dxBarC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Ribbon controls by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonC11.cpp b/official/x.35/ExpressBars 6/Packages/dxRibbonC11.cpp new file mode 100644 index 00000000..7de03191 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxRibbonC11.cpp @@ -0,0 +1,28 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxRibbonC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxcomnC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("cxBarC11.bpi"); +USEUNIT("dxRibbon.pas"); +USEUNIT("dxRibbonForm.pas"); +USEUNIT("dxRibbonFormCaptionHelper.pas"); +USEUNIT("dxRibbonGallery.pas"); +USEUNIT("dxRibbonGroupLayoutCalculator.pas"); +USEUNIT("dxRibbonSkins.pas"); +USEUNIT("dxRibbonStatusBar.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonC11.res b/official/x.35/ExpressBars 6/Packages/dxRibbonC11.res new file mode 100644 index 00000000..be5d91e1 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxRibbonC11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonC5.bpk b/official/x.35/ExpressBars 6/Packages/dxRibbonC5.bpk new file mode 100644 index 00000000..298a6c6b --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxRibbonC5.bpk @@ -0,0 +1,141 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxRibbonC5.bpl +OBJFILES = dxRibbonC5.obj dxRibbon.obj dxRibbonForm.obj dxRibbonFormCaptionHelper.obj \ + dxRibbonGallery.obj dxRibbonGroupLayoutCalculator.obj dxRibbonSkins.obj dxRibbonStatusBar.obj +RESFILES = dxRibbonC5.res" +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib +PACKAGES = VCL50.bpi dxcomnc5.bpi dxThemeC5.bpi cxLibraryVCLC5.bpi dxGDIPlusC5.bpi \ + dxBarC5.bpi + + +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Ribbon controls by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonC5.cpp b/official/x.35/ExpressBars 6/Packages/dxRibbonC5.cpp new file mode 100644 index 00000000..295c5047 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxRibbonC5.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxRibbonC5.res"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("dxcomnC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEPACKAGE("dxGDIPlusC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("dxBarC5.bpi"); +USEUNIT("dxRibbon.pas"); +USEUNIT("dxRibbonForm.pas"); +USEUNIT("dxRibbonFormCaptionHelper.pas"); +USEUNIT("dxRibbonGallery.pas"); +USEUNIT("dxRibbonGroupLayoutCalculator.pas"); +USEUNIT("dxRibbonSkins.pas"); +USEUNIT("dxRibbonStatusBar.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonC5.res b/official/x.35/ExpressBars 6/Packages/dxRibbonC5.res new file mode 100644 index 00000000..929995dc Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxRibbonC5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonC6.bpk b/official/x.35/ExpressBars 6/Packages/dxRibbonC6.bpk new file mode 100644 index 00000000..a38f374a --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxRibbonC6.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxRibbonC6.bpl +OBJFILES = dxRibbonC6.obj dxRibbon.obj dxRibbonForm.obj dxRibbonFormCaptionHelper.obj \ + dxRibbonGallery.obj dxRibbonGroupLayoutCalculator.obj dxRibbonSkins.obj dxRibbonStatusBar.obj +RESFILES = dxRibbonC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib +PACKAGES = rtl.bpi vcl.bpi dxcomnC6.bpi dxThemeC6.bpi cxLibraryVCLC6.bpi dxGDIPlusC6.bpi \ + dxBarC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressBars Ribbon controls by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonC6.cpp b/official/x.35/ExpressBars 6/Packages/dxRibbonC6.cpp new file mode 100644 index 00000000..45b8194e --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxRibbonC6.cpp @@ -0,0 +1,29 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxRibbonC6.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxcomnC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEPACKAGE("dxGDIPlusC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("dxBarC6.bpi"); +USEUNIT("dxRibbon.pas"); +USEUNIT("dxRibbonForm.pas"); +USEUNIT("dxRibbonFormCaptionHelper.pas"); +USEUNIT("dxRibbonGallery.pas"); +USEUNIT("dxRibbonGroupLayoutCalculator.pas"); +USEUNIT("dxRibbonSkins.pas"); +USEUNIT("dxRibbonStatusBar.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- + diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonC6.res b/official/x.35/ExpressBars 6/Packages/dxRibbonC6.res new file mode 100644 index 00000000..f337b321 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxRibbonC6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonD10.dpk b/official/x.35/ExpressBars 6/Packages/dxRibbonD10.dpk new file mode 100644 index 00000000..04ae9061 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxRibbonD10.dpk @@ -0,0 +1,46 @@ +package dxRibbonD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars Ribbon controls by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxThemeD10, + cxLibraryD10, + dxGDIPlusD10, + dxBarD10; + +{%RC 'skins.rc'} + +contains + dxRibbon, + dxRibbonForm, + dxRibbonFormCaptionHelper, + dxRibbonGallery, + dxRibbonGroupLayoutCalculator, + dxRibbonSkins, + dxRibbonStatusBar; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonD10.res b/official/x.35/ExpressBars 6/Packages/dxRibbonD10.res new file mode 100644 index 00000000..b2ec4620 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxRibbonD10.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonD11.dpk b/official/x.35/ExpressBars 6/Packages/dxRibbonD11.dpk new file mode 100644 index 00000000..b7d18b3d --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxRibbonD11.dpk @@ -0,0 +1,46 @@ +package dxRibbonD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars Ribbon controls by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxThemeD11, + cxLibraryD11, + dxGDIPlusD11, + dxBarD11; + +{%RC 'skins.rc'} + +contains + dxRibbon, + dxRibbonForm, + dxRibbonFormCaptionHelper, + dxRibbonGallery, + dxRibbonGroupLayoutCalculator, + dxRibbonSkins, + dxRibbonStatusBar; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonD11.res b/official/x.35/ExpressBars 6/Packages/dxRibbonD11.res new file mode 100644 index 00000000..8eb92d6b Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxRibbonD11.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonD5.dpk b/official/x.35/ExpressBars 6/Packages/dxRibbonD5.dpk new file mode 100644 index 00000000..70142eda --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxRibbonD5.dpk @@ -0,0 +1,46 @@ +package dxRibbonD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars Ribbon controls by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxThemeD5, + cxLibraryVCLD5, + dxGDIPlusD5, + dxBarD5; + +{%RC 'skins.rc'} + +contains + dxRibbon, + dxRibbonForm, + dxRibbonFormCaptionHelper, + dxRibbonGallery, + dxRibbonGroupLayoutCalculator, + dxRibbonSkins, + dxRibbonStatusBar; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonD5.res b/official/x.35/ExpressBars 6/Packages/dxRibbonD5.res new file mode 100644 index 00000000..ea1a8c72 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxRibbonD5.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonD6.dpk b/official/x.35/ExpressBars 6/Packages/dxRibbonD6.dpk new file mode 100644 index 00000000..69804f44 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxRibbonD6.dpk @@ -0,0 +1,46 @@ +package dxRibbonD6; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressBars Ribbon controls by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxThemeD6, + cxLibraryVCLD6, + dxGDIPlusD6, + dxBarD6; + +{%RC 'skins.rc'} + +contains + dxRibbon, + dxRibbonForm, + dxRibbonFormCaptionHelper, + dxRibbonGallery, + dxRibbonGroupLayoutCalculator, + dxRibbonSkins, + dxRibbonStatusBar; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonD6.res b/official/x.35/ExpressBars 6/Packages/dxRibbonD6.res new file mode 100644 index 00000000..b60dd6a4 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxRibbonD6.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonD7.dpk b/official/x.35/ExpressBars 6/Packages/dxRibbonD7.dpk new file mode 100644 index 00000000..cd3e2d24 --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxRibbonD7.dpk @@ -0,0 +1,46 @@ +package dxRibbonD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars Ribbon controls by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxThemeD7, + cxLibraryVCLD7, + dxGDIPlusD7, + dxBarD7; + +{%RC 'skins.rc'} + +contains + dxRibbon, + dxRibbonForm, + dxRibbonFormCaptionHelper, + dxRibbonGallery, + dxRibbonGroupLayoutCalculator, + dxRibbonSkins, + dxRibbonStatusBar; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonD7.res b/official/x.35/ExpressBars 6/Packages/dxRibbonD7.res new file mode 100644 index 00000000..5c34e1c2 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxRibbonD7.res differ diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonD9.dpk b/official/x.35/ExpressBars 6/Packages/dxRibbonD9.dpk new file mode 100644 index 00000000..0edee4cb --- /dev/null +++ b/official/x.35/ExpressBars 6/Packages/dxRibbonD9.dpk @@ -0,0 +1,46 @@ +package dxRibbonD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressBars Ribbon controls by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxThemeD9, + cxLibraryD9, + dxGDIPlusD9, + dxBarD9; + +{%RC 'skins.rc'} + +contains + dxRibbon, + dxRibbonForm, + dxRibbonFormCaptionHelper, + dxRibbonGallery, + dxRibbonGroupLayoutCalculator, + dxRibbonSkins, + dxRibbonStatusBar; + +end. diff --git a/official/x.35/ExpressBars 6/Packages/dxRibbonD9.res b/official/x.35/ExpressBars 6/Packages/dxRibbonD9.res new file mode 100644 index 00000000..cacec193 Binary files /dev/null and b/official/x.35/ExpressBars 6/Packages/dxRibbonD9.res differ diff --git a/official/x.35/ExpressBars 6/Sources/cxBarEditItem.pas b/official/x.35/ExpressBars 6/Sources/cxBarEditItem.pas new file mode 100644 index 00000000..40d1c56d --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/cxBarEditItem.pas @@ -0,0 +1,1932 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars components } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit cxBarEditItem; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Windows, Classes, Controls, Graphics, Messages, cxContainer, cxControls, + cxDropDownEdit, cxEdit, cxEditConsts, cxGraphics, cxLookAndFeels, dxBar, cxGeometry; + +type + { TcxItemsEditorEx } + + TcxItemsEditorEx = class(TdxItemsEditorEx) + protected + class procedure InitSubItem(AItemLinks: TdxBarItemLinks); override; + class function GetAddedItemClass(const AAddedItemName: string): TdxBarItemClass; override; + class function GetPopupItemCaption: string; override; + class procedure InitializeAddedItem(AItemLink: TdxBarItemLink; AAddedItemName: string); override; + end; + + { TcxCustomBarEditItem } + + TcxCustomBarEditItem = class(TdxCustomBarEdit, IcxEditRepositoryItemListener) + private + FEditData: TcxCustomEditData; + FEditValue: TcxEditValue; + FHeight: Integer; + FPrevIsBlobEditValue: Boolean; + FPrevOnEditValueChanged: TNotifyEvent; + FProperties: TcxCustomEditProperties; + FPropertiesEvents: TNotifyEvent; + FPropertiesValue: TcxCustomEditProperties; + FRepositoryItem: TcxEditRepositoryItem; + FRepositoryItemValue: TcxEditRepositoryItem; + FBarStyleDropDownButton: Boolean; + + // IcxEditRepositoryItemListener + procedure IcxEditRepositoryItemListener.ItemRemoved = RepositoryItemItemRemoved; + procedure IcxEditRepositoryItemListener.PropertiesChanged = RepositoryItemPropertiesChanged; + procedure RepositoryItemItemRemoved(Sender: TcxEditRepositoryItem); + procedure RepositoryItemPropertiesChanged(Sender: TcxEditRepositoryItem); + + procedure CustomizingDoDrawEditButtonBackground(Sender: TcxCustomEditViewInfo; + ACanvas: TcxCanvas; const ARect: TRect; AButtonVisibleIndex: Integer; + var AHandled: Boolean); + procedure CustomizingDoGetEditDefaultButtonWidth(Sender: TcxCustomEditViewData; + AIndex: Integer; var ADefaultWidth: Integer); + + procedure CheckIsBlobEditValue; + procedure CreateProperties(APropertiesClass: TcxCustomEditPropertiesClass); + procedure DestroyProperties; + function GetCurEditValue: TcxEditValue; + function GetPropertiesClass: TcxCustomEditPropertiesClass; + function GetPropertiesClassName: string; + function GetPropertiesValue: TcxCustomEditProperties; + function GetRepositoryItemValue: TcxEditRepositoryItem; + function IsBarCompatibleEdit(AEditProperties: TcxCustomEditProperties = nil): Boolean; + function IsBlobEditValue: Boolean; + function IsEditValueStored(AFiler: TFiler): Boolean; + procedure PropertiesChangedHandler(Sender: TObject); + procedure PropertiesValueChanged; + procedure ReadEditValue(AReader: TReader); overload; + {$HINTS OFF} + procedure ReadEditValue(AStream: TStream); overload; + {$HINTS ON} + procedure SetEditValue(const Value: TcxEditValue); + procedure SetHeight(Value: Integer); + procedure SetProperties(Value: TcxCustomEditProperties); + procedure SetPropertiesClass(Value: TcxCustomEditPropertiesClass); + procedure SetPropertiesClassName(const Value: string); + procedure SetRepositoryItem(Value: TcxEditRepositoryItem); + procedure SetRepositoryItemValue(Value: TcxEditRepositoryItem); + procedure SetBarStyleDropDownButton(Value: Boolean); + procedure UpdateRepositoryItemValue; + function UseBarPaintingStyle: Boolean; + procedure WriteEditValue(AWriter: TWriter); overload; + {$HINTS OFF} + procedure WriteEditValue(AStream: TStream); overload; + {$HINTS ON} + protected + procedure DefineProperties(Filer: TFiler); override; + procedure DrawCustomizingImage(ACanvas: TCanvas; const ARect: TRect; + AState: TOwnerDrawState); override; + procedure DrawCustomizingImageContent(ACanvas: TCanvas; + const ARect: TRect; ASelected: Boolean); override; + function GetControlClass(AIsVertical: Boolean): TdxBarItemControlClass; override; + function HasAccel(AItemLink: TdxBarItemLink): Boolean; override; + function CanEdit: Boolean; + function CaptionIsEditValue: Boolean; + procedure DoEditValueChanged(Sender: TObject); + procedure PropertiesChanged; virtual; + procedure UpdatePropertiesValue; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure DoClick; override; + function GetProperties: TcxCustomEditProperties; + property CurEditValue: TcxEditValue read GetCurEditValue; + property EditValue: TcxEditValue read FEditValue write SetEditValue + stored False; + property Height: Integer read FHeight write SetHeight default 0; + property Properties: TcxCustomEditProperties read FProperties + write SetProperties; + property PropertiesClass: TcxCustomEditPropertiesClass + read GetPropertiesClass write SetPropertiesClass; + property RepositoryItem: TcxEditRepositoryItem read FRepositoryItem + write SetRepositoryItem; + published + property PropertiesClassName: string read GetPropertiesClassName + write SetPropertiesClassName; + property PropertiesEvents: TNotifyEvent read FPropertiesEvents + write FPropertiesEvents; + property BarStyleDropDownButton: Boolean read FBarStyleDropDownButton write SetBarStyleDropDownButton default True; + end; + + { TcxBarEditItem } + + TcxBarEditItem = class(TcxCustomBarEditItem) + published + property CanSelect; + property EditValue; + property Height; + property Properties; + property RepositoryItem; + property StyleEdit; + end; + + TcxBarEditItemControlEditEvents = record + OnAfterKeyDown: TKeyEvent; + OnChange: TNotifyEvent; + OnClosePopup: TcxEditClosePopupEvent; + OnFocusChanged: TNotifyEvent; + OnInitPopup: TNotifyEvent; + OnKeyDown: TKeyEvent; + OnKeyPress: TKeyPressEvent; + OnKeyUp: TKeyEvent; + OnMouseMove: TMouseMoveEvent; + OnPostEditValue: TNotifyEvent; + OnValidate: TcxEditValidateEvent; + end; + + { TcxBarEditItemControl } + + TcxBarEditItemControl = class(TdxBarCustomEditControl) + private + FEdit: TcxCustomEdit; + FEditViewInfo: TcxCustomEditViewInfo; + FSavedEditEvents: TcxBarEditItemControlEditEvents; + + procedure ClearEditEvents; + procedure InternalShowEdit; + procedure SaveEditEvents; + + procedure DoAfterKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure DoCustomDrawPopupBorder(AViewInfo: TcxContainerViewInfo; ACanvas: TcxCanvas; const R: TRect; var AHandled: Boolean; + out ABorderWidth: Integer); + procedure DoDrawEditBackground(Sender: TcxCustomEditViewInfo; + ACanvas: TcxCanvas; var AHandled: Boolean); + procedure DoDrawEditButton(Sender: TcxCustomEditViewInfo; + ACanvas: TcxCanvas; AButtonVisibleIndex: Integer; var AHandled: Boolean); + procedure DoDrawEditButtonBackground(Sender: TcxCustomEditViewInfo; + ACanvas: TcxCanvas; const ARect: TRect; AButtonVisibleIndex: Integer; + var AHandled: Boolean); + procedure DoDrawEditButtonBorder(Sender: TcxCustomEditViewInfo; ACanvas: TcxCanvas; AButtonVisibleIndex: Integer; + out ABackgroundRect, AContentRect: TRect; var AHandled: Boolean); + procedure DoEditPaint(Sender: TcxCustomEditViewInfo; ACanvas: TcxCanvas); + procedure DoEditClosePopup(Sender: TcxControl; AReason: TcxEditCloseUpReason); + procedure DoEditPropertiesChange(Sender: TObject); + procedure DoGetEditButtonState(Sender: TcxCustomEditViewInfo; + AButtonVisibleIndex: Integer; var AState: TcxEditButtonState); + procedure DoGetEditDefaultButtonWidth(Sender: TcxCustomEditViewData; + AIndex: Integer; var ADefaultWidth: Integer); + procedure DoFocusChanged(Sender: TObject); + procedure DoInitPopup(Sender: TObject); + procedure DoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure DoKeyPress(Sender: TObject; var Key: Char); + procedure DoKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure DoPostEditValue(Sender: TObject); + procedure DoValidate(Sender: TObject; var DisplayValue: TcxEditValue; + var ErrorText: TCaption; var Error: Boolean); + function GetEditButtonState(AButtonViewInfo: TcxEditButtonViewInfo): Integer; + + procedure AssignViewInfoEvents(AViewInfo: TcxCustomEditViewInfo); + procedure ClearViewInfoEvents(AViewInfo: TcxCustomEditViewInfo); + procedure DrawEditBackground(ACanvas: TcxCanvas; ARect: TRect; AColor: TColor); + function GetBoundsRect: TRect; + function GetCurEditValue: TcxEditValue; + function GetDefaultEditButtonWidth(AIndex: Integer): Integer; + function GetDropDownEdit: TcxCustomDropDownEdit; + function GetEditSize: TSize; + function GetEditStyle: TcxEditStyle; + function GetEditViewInfo: TcxCustomEditViewInfo; + function GetItem: TcxCustomBarEditItem; + function GetProperties: TcxCustomEditProperties; + procedure InitEditContentParams(var AParams: TcxEditContentParams); + function IsDropDownEdit: Boolean; + function IsPopupSideward: Boolean; + function NeedEditShowCaption: Boolean; + + property DropDownEdit: TcxCustomDropDownEdit read GetDropDownEdit; + protected + procedure ActivateEdit(AByMouse: Boolean; AKey: Char = #0); override; + procedure CalcDrawParams(AFull: Boolean = True); override; + procedure CalcParts; override; + function CanHide: Boolean; override; + function CanSelect: Boolean; override; + procedure CheckHotTrack(APoint: TPoint); override; + procedure ControlInactivate(Immediately: Boolean); override; + procedure DoPaint(ARect: TRect; PaintType: TdxBarPaintType); override; + procedure DoMouseMove(Sender: TObject; Shift: TShiftState; + X, Y: Integer); + procedure DrawTextField; override; + function GetControl: TControl; override; + function GetHandle: HWND; override; + function GetDefaultHeight: Integer; override; + function GetMinEditorWidth: Integer; override; + function GetPartCount: Integer; override; + function GetShowCaption: Boolean; override; + function GetCaptionAreaWidth: Integer; override; + function GetControlAreaWidth: Integer; override; + function GetPossibleViewLevels: TdxBarItemViewLevels; override; + procedure Hide(AStoreDisplayValue: Boolean); override; + procedure InitEdit; override; + function IsChildWindow(AWnd: HWND): Boolean; override; + function IsEditTransparent: Boolean; override; + function IsTransparentOnGlass: Boolean; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure ParentVisibleChange(AIsShowing: Boolean); override; + procedure RestoreDisplayValue; override; + procedure Show; override; + procedure StoreDisplayValue; override; + function WantsKey(Key: Word): Boolean; override; + procedure CalculateEditViewInfo(const ABounds: TRect; P: TPoint; + AIsMouseEvent: Boolean; AEditViewInfo: TcxCustomEditViewInfo = nil; AFull: Boolean = True); + function CreateEditViewData(AFull: Boolean = True): TcxCustomEditViewData; + function CreateEditViewInfo: TcxCustomEditViewInfo; + property EditStyle: TcxEditStyle read GetEditStyle; + property EditViewInfo: TcxCustomEditViewInfo read GetEditViewInfo; + property Item: TcxCustomBarEditItem read GetItem; + property Properties: TcxCustomEditProperties read GetProperties; + public + destructor Destroy; override; + function IsDroppedDown: Boolean; override; + property CurEditValue: TcxEditValue read GetCurEditValue; + property Edit: TcxCustomEdit read FEdit; + end; + +implementation + +uses +{$IFDEF DELPHI6} + Variants, +{$ELSE} + Consts, TypInfo, +{$ENDIF} + Forms, SysUtils, cxBarEditItemValueEditor, cxClasses, cxEditPaintUtils, + cxEditRepositoryItems, cxEditUtils, cxLookAndFeelPainters, cxTextEdit, + cxVariants, dxBarCustForm, dxOffice11, dxBarStrs, dxBarSkinConsts;//, cxDWMApi; + +const + MinContentWidth = 9; + +type + TControlAccess = class(TControl); +{$IFNDEF DELPHI6} + TReaderAccess = class(TReader); + TWriterAccess = class(TWriter); +{$ENDIF} + TdxBarManagerAccess = class(TdxBarManager); + TdxBarSubMenuControlAccess = class(TdxBarSubMenuControl); + + { TFakeWinControl } + + TFakeWinControl = class(TWinControl) + protected + procedure CreateWnd; override; + procedure DestroyWindowHandle; override; + procedure DestroyWnd; override; + end; + + { TEditorParentForm } + + TEditorParentForm = class(TCustomForm) + public + destructor Destroy; override; + procedure GetTabOrderList(List: TList); override; + function SetFocusedControl(Control: TWinControl): Boolean; override; + end; + + { TcxBarEditItemVerticalButtonControl } + + TcxBarEditItemVerticalButtonControl = class(TdxBarButtonControl) + private + function CanEdit: Boolean; + protected + function CanClicked: Boolean; override; + function CanSelect: Boolean; override; + function GetPaintStyle: TdxBarPaintStyle; override; + end; + +var + FDefaultRepositoryItem: TcxEditRepositoryItem; + FEditList: TcxInplaceEditList; + FEditorParentForm: TEditorParentForm; + FEditStyle: TcxEditStyle; + FFakeWinControl: TFakeWinControl; + +function DefaultRepositoryItem: TcxEditRepositoryItem; + + procedure CreateDefaultRepositoryItem; + begin + FDefaultRepositoryItem := TcxEditRepositoryTextItem.Create(nil); + end; + +begin + if FDefaultRepositoryItem = nil then + CreateDefaultRepositoryItem; + Result := FDefaultRepositoryItem; +end; + +function EditList: TcxInplaceEditList; +begin + if FEditList = nil then + FEditList := TcxInplaceEditList.Create; + Result := FEditList; +end; + +function EditorParentForm: TEditorParentForm; +begin + if FEditorParentForm = nil then + begin + FEditorParentForm := TEditorParentForm.CreateNew(nil); + FEditorParentForm.Position := poDesigned; + FEditorParentForm.Name := 'EditorParentForm'; + FEditorParentForm.BorderStyle := bsNone; + end; + Result := FEditorParentForm; +end; + +function InternalGetEditStyle(AEditProperties: TcxCustomEditProperties; ABarManager: TdxBarManager; + APainter: TdxBarPainter; AFont: TFont; AColor, ATextColor: TColor; ADrawSelected: Boolean): TcxEditStyle; + + procedure InitEditStyle; + + procedure SetStyleColors; + begin + FEditStyle.Font := AFont; + FEditStyle.Color := AColor; + FEditStyle.TextColor := ATextColor; + end; + + procedure SetLookAndFeel; + begin + if APainter <> nil then + APainter.EditGetRealLookAndFeel(ABarManager, FEditStyle.LookAndFeel) + else + TdxBarManagerAccess(ABarManager).GetRealLookAndFeel(FEditStyle.LookAndFeel); + if (FEditStyle.LookAndFeel.ActiveStyle = lfsFlat) and + ((AEditProperties.Buttons.VisibleCount <> 0) and not ADrawSelected) then + FEditStyle.LookAndFeel.SetStyle(lfsUltraFlat); + end; + + begin + SetStyleColors; + SetLookAndFeel; + FEditStyle.GradientButtons := True; + FEditStyle.ButtonTransparency := ebtNone; + end; + +begin + if FEditStyle = nil then + FEditStyle := TcxEditStyle.Create(nil, True); + InitEditStyle; + Result := FEditStyle; +end; + +{$IFNDEF DELPHI6} +procedure WriteVariantProperty(AWriter: TWriter; AInstance: TObject; + const APropName: string); + + procedure WriteValue(AValue: TValueType); + begin + AWriter.Write(AValue, SizeOf(AValue)); + end; + + function IsAncestorValid: Boolean; + begin + Result := (AWriter.Ancestor <> nil) and ((AInstance.ClassType = AWriter.Ancestor.ClassType) or + (AInstance = AWriter.Root)); + end; + + function IsDefaultValue(const AValue: Variant): Boolean; + begin + if IsAncestorValid then + Result := AValue = GetVariantProp(AWriter.Ancestor, GetPropInfo(AInstance, APropName)) + else + Result := VarIsEmpty(AValue); + end; + +var + AValue: Variant; +begin + AValue := GetVariantProp(AInstance, GetPropInfo(AInstance, APropName)); + if IsDefaultValue(AValue) then + Exit; + if VarIsArray(AValue) then + raise EWriteError.CreateRes(@SWriteError); + case VarType(AValue) and varTypeMask of + varEmpty: + WriteValue(vaNil); + varNull: + WriteValue(vaNull); + varOleStr: + AWriter.WriteWideString(AValue); + varString: + AWriter.WriteString(AValue); + varByte, varSmallInt, varInteger: + AWriter.WriteInteger(AValue); + varSingle: + AWriter.WriteSingle(AValue); + varDouble: + AWriter.WriteFloat(AValue); + varCurrency: + AWriter.WriteCurrency(AValue); + varDate: + AWriter.WriteDate(AValue); + varBoolean: + if AValue then + WriteValue(vaTrue) + else + WriteValue(vaFalse); + else + try + AWriter.WriteString(AValue); + except + raise EWriteError.CreateRes(@SWriteError); + end; + end; +end; +{$ENDIF} + +{ TFakeWinControl } + +procedure TFakeWinControl.CreateWnd; +begin +// do nothing +end; + +procedure TFakeWinControl.DestroyWindowHandle; +begin + if WindowHandle <> 0 then + raise Exception.Create(''); // TODO: Check +end; + +procedure TFakeWinControl.DestroyWnd; +begin + WindowHandle := 0; // because WindowHandle := Edit.Handle +end; + +{ TEditorParentForm } + +destructor TEditorParentForm.Destroy; +begin +{$IFDEF DELPHI9} + PopupChildren.Clear; // for test framework +{$ENDIF} + inherited; +end; + +procedure TEditorParentForm.GetTabOrderList(List: TList); +begin +//do nothing +end; + +function TEditorParentForm.SetFocusedControl(Control: TWinControl): Boolean; +var + ALink: TcxObjectLink; + APopupWindow: TcxCustomPopupWindow; +begin + ALink := nil; + APopupWindow := GetParentPopupWindow(Self, True); + if APopupWindow <> nil then + begin + APopupWindow.LockDeactivate(True); + ALink := cxAddObjectLink(APopupWindow); + end; + try + Result := inherited SetFocusedControl(Control); + finally + if APopupWindow <> nil then + begin + if ALink.Ref <> nil then + APopupWindow.LockDeactivate(False); + cxRemoveObjectLink(ALink); + end; + end; +end; + +{ TcxBarEditItemVerticalButtonControl } + +function TcxBarEditItemVerticalButtonControl.CanClicked: Boolean; +begin + Result := CanEdit and inherited CanClicked; +end; + +function TcxBarEditItemVerticalButtonControl.CanSelect: Boolean; +begin + Result := CanEdit and inherited CanSelect; +end; + +function TcxBarEditItemVerticalButtonControl.GetPaintStyle: TdxBarPaintStyle; +begin + if CanEdit then + Result := inherited GetPaintStyle + else + if TcxCustomBarEditItem(Item).Glyph.Empty then + Result := psCaption + else + Result := psCaptionGlyph; +end; + +function TcxBarEditItemVerticalButtonControl.CanEdit: Boolean; +begin + Result := TcxCustomBarEditItem(Item).CanEdit; +end; + +{ TcxItemsEditorEx } + +class procedure TcxItemsEditorEx.InitSubItem(AItemLinks: TdxBarItemLinks); +var + I: Integer; +begin + for I := 0 to GetRegisteredEditProperties.Count - 1 do + BarDesignController.AddInternalItem(AItemLinks, TdxBarButton, GetRegisteredEditProperties.Descriptions[I], OnButtonClick); +end; + +class function TcxItemsEditorEx.GetAddedItemClass(const AAddedItemName: string): TdxBarItemClass; +begin + Result := TcxBarEditItem; +end; + +class function TcxItemsEditorEx.GetPopupItemCaption: string; +begin + Result := dxSBAR_CP_ADDCXITEM; +end; + +class procedure TcxItemsEditorEx.InitializeAddedItem(AItemLink: TdxBarItemLink; AAddedItemName: string); +var + APropertiesClass: TcxCustomEditPropertiesClass; +begin + APropertiesClass := TcxCustomEditPropertiesClass(GetRegisteredEditProperties.FindByDescription(AAddedItemName)); + TcxBarEditItem(AItemLink.Item).PropertiesClass := APropertiesClass; +end; + +{ TcxCustomBarEditItem } + +constructor TcxCustomBarEditItem.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FEditValue := Null; + UpdatePropertiesValue; + FPrevIsBlobEditValue := IsBlobEditValue; + FBarStyleDropDownButton := True; +end; + +destructor TcxCustomBarEditItem.Destroy; +begin + RepositoryItem := nil; + PropertiesClass := nil; + SetRepositoryItemValue(nil); + FreeAndNil(FEditData); + inherited Destroy; +end; + +procedure TcxCustomBarEditItem.DoClick; +begin + inherited DoClick; + if not (Assigned(OnClick) or GetProperties.ReadOnly) then + ShowValueEditor(ClickItemLink); +end; + +function TcxCustomBarEditItem.GetProperties: TcxCustomEditProperties; +begin + Result := FPropertiesValue; +end; + +procedure TcxCustomBarEditItem.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + if esfBlobEditValue in GetProperties.GetSpecialFeatures then + Filer.DefineBinaryProperty('InternalEditValue', ReadEditValue, + WriteEditValue, IsEditValueStored(Filer)) + else + Filer.DefineProperty('InternalEditValue', ReadEditValue, WriteEditValue, + IsEditValueStored(Filer)); +end; + +procedure TcxCustomBarEditItem.DrawCustomizingImage(ACanvas: TCanvas; + const ARect: TRect; AState: TOwnerDrawState); +begin + if CaptionIsEditValue then + dxBarCustomizingForm.PainterClass.DrawButtonOrSubItem(ACanvas, ARect, Self, + GetTextOf(Caption), odSelected in AState) + else + dxBarCustomizingForm.PainterClass.DrawEdit(ACanvas, ARect, Self, + odSelected in AState, UseBarPaintingStyle); +end; + +procedure TcxCustomBarEditItem.DrawCustomizingImageContent(ACanvas: TCanvas; + const ARect: TRect; ASelected: Boolean); +var + AEditProperties: TcxCustomEditProperties; + AEditStyle: TcxEditStyle; + AEditViewData: TcxCustomEditViewData; + AEditViewInfo: TcxCustomEditViewInfo; + ATempCanvas: TcxCanvas; +begin + AEditProperties := nil; + AEditViewData := nil; + AEditViewInfo := nil; + ATempCanvas := nil; + try + AEditProperties := GetProperties.CreatePreviewProperties; + AEditStyle := InternalGetEditStyle(AEditProperties, BarManager, nil, + ACanvas.Font, clWindow, ACanvas.Font.Color, ASelected); + if UseBarPaintingStyle then + AEditStyle.ButtonTransparency := ebtHideInactive; + AEditViewData := AEditProperties.CreateViewData(AEditStyle, True, True); + AEditViewData.OnGetDefaultButtonWidth := CustomizingDoGetEditDefaultButtonWidth; + AEditViewData.EditContentParams.ExternalBorderBounds := ARect; + AEditViewInfo := TcxCustomEditViewInfo(AEditProperties.GetViewInfoClass.Create); + AEditViewInfo.Data := Integer(ASelected); + AEditViewInfo.OnDrawButtonBackground := CustomizingDoDrawEditButtonBackground; + ATempCanvas := TcxCanvas.Create(ACanvas); + AEditViewData.EditValueToDrawValue(ATempCanvas, Null, AEditViewInfo); + AEditViewData.Calculate(ATempCanvas, ARect, Point(-1, -1), cxmbNone, [], AEditViewInfo, False); + AEditViewInfo.Paint(ATempCanvas); + finally + FreeAndNil(AEditProperties); + FreeAndNil(AEditViewData); + FreeAndNil(AEditViewInfo); + FreeAndNil(ATempCanvas); + end; +end; + +function TcxCustomBarEditItem.GetControlClass(AIsVertical: Boolean): TdxBarItemControlClass; +begin + if AIsVertical then + Result := TcxBarEditItemVerticalButtonControl + else + Result := TcxBarEditItemControl; +end; + +function TcxCustomBarEditItem.HasAccel(AItemLink: TdxBarItemLink): Boolean; +begin + Result := inherited HasAccel(AItemLink) and CanEdit; +end; + +function TcxCustomBarEditItem.CanEdit: Boolean; +begin + Result := esoEditing in GetProperties.GetSupportedOperations; +end; + +function TcxCustomBarEditItem.CaptionIsEditValue: Boolean; +begin + Result := not CanEdit and + (esoShowingCaption in GetProperties.GetSupportedOperations); +end; + +procedure TcxCustomBarEditItem.DoEditValueChanged(Sender: TObject); +begin + EditValue := TcxCustomEdit(Sender).EditValue; + if Assigned(FPrevOnEditValueChanged) then + FPrevOnEditValueChanged(Sender); +end; + +procedure TcxCustomBarEditItem.PropertiesChanged; +begin + if FEditData <> nil then + FEditData.Clear; + CheckIsBlobEditValue; + UpdateEx; +end; + +procedure TcxCustomBarEditItem.UpdatePropertiesValue; +begin + FPropertiesValue := GetPropertiesValue; +end; + +procedure TcxCustomBarEditItem.RepositoryItemItemRemoved( + Sender: TcxEditRepositoryItem); +begin + RepositoryItem := nil; +end; + +procedure TcxCustomBarEditItem.RepositoryItemPropertiesChanged( + Sender: TcxEditRepositoryItem); +begin + PropertiesChanged; +end; + +procedure TcxCustomBarEditItem.CustomizingDoDrawEditButtonBackground( + Sender: TcxCustomEditViewInfo; ACanvas: TcxCanvas; const ARect: TRect; + AButtonVisibleIndex: Integer; var AHandled: Boolean); +begin + AHandled := not Sender.NativeStyle; + if (ACanvas <> nil) and AHandled then + FillRectByColor(ACanvas.Handle, ARect, + dxBarCustomizingForm.PainterClass.GetButtonColor(Self, False)); +end; + +procedure TcxCustomBarEditItem.CustomizingDoGetEditDefaultButtonWidth( + Sender: TcxCustomEditViewData; AIndex: Integer; var ADefaultWidth: Integer); +begin + if IsBarCompatibleEdit(Sender.Properties) then + ADefaultWidth := dxBarCustomizingForm.PainterClass.GetComboBoxButtonWidth; +end; + +procedure TcxCustomBarEditItem.CheckIsBlobEditValue; +begin + if FPrevIsBlobEditValue <> IsBlobEditValue then + begin + FPrevIsBlobEditValue := IsBlobEditValue; + EditValue := Null; + end; +end; + +procedure TcxCustomBarEditItem.CreateProperties( + APropertiesClass: TcxCustomEditPropertiesClass); +begin + if APropertiesClass <> nil then + FProperties := APropertiesClass.Create(Self); +end; + +procedure TcxCustomBarEditItem.DestroyProperties; +begin + FreeAndNil(FProperties); +end; + +function TcxCustomBarEditItem.GetCurEditValue: TcxEditValue; +begin + if (CurItemLink = nil) or (CurItemLink.Control = nil) then + Result := EditValue + else + Result := TcxBarEditItemControl(CurItemLink.Control).CurEditValue; +end; + +function TcxCustomBarEditItem.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + if FProperties = nil then + Result := nil + else + Result := TcxCustomEditPropertiesClass(FProperties.ClassType); +end; + +function TcxCustomBarEditItem.GetPropertiesClassName: string; +begin + if FProperties = nil then + Result := '' + else + Result := FProperties.ClassName; +end; + +function TcxCustomBarEditItem.GetPropertiesValue: TcxCustomEditProperties; +begin + UpdateRepositoryItemValue; + if FRepositoryItemValue <> nil then + begin + Result := FRepositoryItemValue.Properties; + if FProperties <> nil then + FProperties.OnPropertiesChanged := nil; + end + else + begin + Result := FProperties; + FProperties.OnPropertiesChanged := PropertiesChangedHandler; + end; +end; + +function TcxCustomBarEditItem.GetRepositoryItemValue: TcxEditRepositoryItem; +begin + if FRepositoryItem <> nil then + Result := FRepositoryItem + else + if FProperties = nil then + Result := DefaultRepositoryItem + else + Result := nil; +end; + +function TcxCustomBarEditItem.IsBarCompatibleEdit( + AEditProperties: TcxCustomEditProperties = nil): Boolean; +var + AButton: TcxEditButton; + AProperties: TcxCustomEditProperties; + I: Integer; +begin + Result := False; + AProperties := AEditProperties; + if AProperties = nil then + AProperties := GetProperties; + if AProperties.Buttons.VisibleCount = 1 then + for I := 0 to AProperties.Buttons.Count - 1 do + begin + AButton := AProperties.Buttons[I]; + if AButton.Visible then + begin + Result := AButton.Kind = bkDown; + Break; + end; + end; +end; + +function TcxCustomBarEditItem.IsBlobEditValue: Boolean; +begin + Result := esfBlobEditValue in GetProperties.GetSpecialFeatures; +end; + +function TcxCustomBarEditItem.IsEditValueStored(AFiler: TFiler): Boolean; + + function Equals(const V1, V2: TcxEditValue): Boolean; + begin + Result := (VarType(V1) = VarType(V2)) and VarEqualsExact(V1, V2); + end; + +begin + if AFiler.Ancestor <> nil then + Result := not (AFiler.Ancestor is TcxCustomBarEditItem) or + not Equals(EditValue, TcxCustomBarEditItem(AFiler.Ancestor).EditValue) + else + Result := not VarIsNull(EditValue); +end; + +procedure TcxCustomBarEditItem.PropertiesChangedHandler(Sender: TObject); +begin + PropertiesChanged; +end; + +procedure TcxCustomBarEditItem.PropertiesValueChanged; +begin + UpdatePropertiesValue; + if not (csDestroying in ComponentState) then + begin + CheckIsBlobEditValue; + UpdateEx; + Changed; + dxBarDesignerModified(BarManager); + end; +end; + +procedure TcxCustomBarEditItem.ReadEditValue(AReader: TReader); +begin +{$IFDEF DELPHI6} + EditValue := AReader.ReadVariant; +{$ELSE} + TReaderAccess(AReader).ReadPropValue(Self, GetPropInfo(Self, 'EditValue')); +{$ENDIF} +end; + +procedure TcxCustomBarEditItem.ReadEditValue(AStream: TStream); +var + ASize: DWORD; + S: string; +begin + AStream.ReadBuffer(ASize, SizeOf(ASize)); + SetLength(S, ASize); + AStream.ReadBuffer(S[1], ASize); + EditValue := S; +end; + +procedure TcxCustomBarEditItem.SetEditValue(const Value: TcxEditValue); +begin + if not (GetProperties.CanCompareEditValue and (VarType(Value) = VarType(FEditValue)) and + VarEqualsExact(Value, FEditValue)) then + begin + FEditValue := Value; + Change; + Update; + end; +end; + +procedure TcxCustomBarEditItem.SetHeight(Value: Integer); +begin + if Value <> FHeight then + begin + FHeight := Value; + if not IsLoading then // TODO + UpdateEx; // TODO + end; +end; + +procedure TcxCustomBarEditItem.SetProperties(Value: TcxCustomEditProperties); +begin + if Value <> nil then + FProperties.Assign(Value); +end; + +procedure TcxCustomBarEditItem.SetPropertiesClass( + Value: TcxCustomEditPropertiesClass); +begin + if Value <> PropertiesClass then + begin + if FProperties <> nil then + Properties.LockUpdate(True); + DestroyProperties; + CreateProperties(Value); + if FProperties <> nil then + Properties.LockUpdate(False); + PropertiesValueChanged; + end; +end; + +procedure TcxCustomBarEditItem.SetPropertiesClassName(const Value: string); +begin + PropertiesClass := TcxCustomEditPropertiesClass( + GetRegisteredEditProperties.FindByClassName(Value)); +end; + +procedure TcxCustomBarEditItem.SetRepositoryItem(Value: TcxEditRepositoryItem); +begin + if FRepositoryItem <> Value then + begin + FRepositoryItem := Value; + PropertiesValueChanged; + end; +end; + +procedure TcxCustomBarEditItem.SetRepositoryItemValue(Value: TcxEditRepositoryItem); +begin + if Value <> FRepositoryItemValue then + begin + if FRepositoryItemValue <> nil then + FRepositoryItemValue.RemoveListener(Self); + FRepositoryItemValue := Value; + if FRepositoryItemValue <> nil then + FRepositoryItemValue.AddListener(Self); + end; +end; + +procedure TcxCustomBarEditItem.SetBarStyleDropDownButton(Value: Boolean); +begin + if FBarStyleDropDownButton <> Value then + begin + FBarStyleDropDownButton := Value; + UpdateEx; + end; +end; + +procedure TcxCustomBarEditItem.UpdateRepositoryItemValue; +begin + SetRepositoryItemValue(GetRepositoryItemValue); +end; + +function TcxCustomBarEditItem.UseBarPaintingStyle: Boolean; +begin + Result := BarStyleDropDownButton and IsBarCompatibleEdit; +end; + +procedure TcxCustomBarEditItem.WriteEditValue(AWriter: TWriter); +begin +{$IFDEF DELPHI6} + AWriter.WriteVariant(EditValue); +{$ELSE} + WriteVariantProperty(AWriter, Self, 'EditValue'); +{$ENDIF} +end; + +procedure TcxCustomBarEditItem.WriteEditValue(AStream: TStream); +var + ASize: DWORD; + S: string; +begin + S := EditValue; + ASize := Length(S); + AStream.WriteBuffer(ASize, SizeOf(ASize)); + AStream.WriteBuffer(S[1], ASize); +end; + +{ TcxBarEditItemControl } + +destructor TcxBarEditItemControl.Destroy; +begin + Focused := False; + FreeAndNil(FEditViewInfo); + inherited Destroy; +end; + +function TcxBarEditItemControl.IsDroppedDown: Boolean; +begin + Result := (Edit <> nil) and Edit.HasPopupWindow; +end; + +procedure TcxBarEditItemControl.ActivateEdit(AByMouse: Boolean; AKey: Char = #0); +var + P: TPoint; + AActiveWinControl: TWinControl; +begin + AActiveWinControl := FindControl(GetActiveWindow); + if AActiveWinControl is TCustomForm then + begin + FFakeWinControl.Parent := AActiveWinControl; + FFakeWinControl.WindowHandle := Edit.Handle; + TCustomForm(AActiveWinControl).SetFocusedControl(FFakeWinControl); + end; + Edit.OnGlass := Parent.IsOnGlass; + if not AByMouse then + if AKey = #0 then + Edit.Activate(Item.FEditData) + else + Edit.ActivateByKey(AKey, Item.FEditData) + else + begin + P := Edit.Parent.ScreenToClient(GetMouseCursorPos); + Edit.ActivateByMouse(InternalGetShiftState, P.X, P.Y, Item.FEditData); + end; + Edit.InplaceParams.MultiRowParent := False; +end; + +procedure TcxBarEditItemControl.CalcDrawParams(AFull: Boolean = True); +begin + inherited; + if AFull then + FDrawParams.DroppedDown := Focused and Edit.HasPopupWindow; +end; + +procedure TcxBarEditItemControl.CalcParts; +begin + inherited; + if Item.UseBarPaintingStyle then + Painter.CalculateComboParts(DrawParams, FParts, ItemBounds); +end; + +function TcxBarEditItemControl.CanHide: Boolean; +begin + Result := inherited CanHide and (not IsDropDownEdit or DropDownEdit.CanHide); +end; + +function TcxBarEditItemControl.CanSelect: Boolean; +begin + Result := inherited CanSelect and (Item.CanEdit or Parent.IsCustomizing); +end; + +procedure TcxBarEditItemControl.CheckHotTrack(APoint: TPoint); +var + ATempViewInfo: TcxCustomEditViewInfo; +begin + inherited; + ATempViewInfo := CreateEditViewInfo; + try + ATempViewInfo.Assign(EditViewInfo); + CalculateEditViewInfo(GetBoundsRect, APoint, True); + EditViewInfo.Repaint(Parent, ATempViewInfo); + finally + ATempViewInfo.Free; + end; +end; + +// TODO +procedure TcxBarEditItemControl.ControlInactivate(Immediately: Boolean); +begin +// Focused := False; + DisableAppWindows(not IsApplicationActive); + try + inherited ControlInactivate(Immediately); //#DG + finally + EnableAppWindows; + end; +end; + +procedure TcxBarEditItemControl.DoPaint(ARect: TRect; PaintType: TdxBarPaintType); +begin + if Edit <> nil then + Edit.InvalidateWithChildren; + inherited; +end; + +procedure TcxBarEditItemControl.DoMouseMove(Sender: TObject; Shift: TShiftState; + X, Y: Integer); +var + P: TPoint; +begin + if Assigned(FSavedEditEvents.OnMouseMove) then + FSavedEditEvents.OnMouseMove(Sender, Shift, X, Y); + P := ClientToParent(Point(X, Y)); + MouseMove(Shift, P.X, P.Y); +end; + +procedure TcxBarEditItemControl.DrawTextField; + + function HasEditButtonCompositeFrame: Boolean; + begin + Result := Painter.EditButtonAllowCompositeFrame and Item.UseBarPaintingStyle; + end; + +begin + if not Focused or HasEditButtonCompositeFrame then + begin + CalculateEditViewInfo(GetBoundsRect, Parent.ScreenToClient(GetMouseCursorPos), False); + EditViewInfo.Data := Integer(FDrawParams.PaintType); +// BarCanvas.BeginPaint(Canvas); + Canvas.SaveState; + try + EditViewInfo.Paint(Canvas); +// EditViewInfo.Paint(BarCanvas); + finally + Canvas.RestoreState; +// BarCanvas.EndPaint; + end; + end; +end; + +function TcxBarEditItemControl.GetControl: TControl; +begin + Result := Edit; +end; + +function TcxBarEditItemControl.GetHandle: HWND; +begin + if (Edit <> nil) and Edit.HandleAllocated then + Result := Edit.Handle + else + Result := 0; +end; + +function TcxBarEditItemControl.GetDefaultHeight: Integer; +var + AEditHeight: Integer; +begin + Result := inherited GetDefaultHeight; + AEditHeight := GetEditSize.cy; + if Result < AEditHeight then + Result := AEditHeight; + if Result < Item.Height then + Result := Item.Height; +end; + +function TcxBarEditItemControl.GetMinEditorWidth: Integer; +begin + Result := GetEditSize.cx; +end; + +function TcxBarEditItemControl.GetPartCount: Integer; +begin + Result := inherited GetPartCount; + if Item.UseBarPaintingStyle then + Inc(Result); +end; + +function TcxBarEditItemControl.GetShowCaption: Boolean; +begin + if Item.CaptionIsEditValue then + Result := False + else + Result := inherited GetShowCaption; +end; + +function TcxBarEditItemControl.GetCaptionAreaWidth: Integer; +begin + if NeedEditShowCaption then + if (GetPaintType = ptMenu) and Painter.SubMenuControlHasBand and not (cpIcon in GetViewStructure) then + Result := TdxBarSubMenuControlAccess(SubMenuParent).BandSize + else + Result := 0 + else + Result := inherited GetCaptionAreaWidth; +end; + +function TcxBarEditItemControl.GetControlAreaWidth: Integer; +begin + if NeedEditShowCaption then + Result := GetMinEditorWidth + else + Result := inherited GetControlAreaWidth; +end; + +function TcxBarEditItemControl.GetPossibleViewLevels: TdxBarItemViewLevels; +begin + Result := inherited GetPossibleViewLevels; + if Item.CaptionIsEditValue then + Result := Result - [ivlSmallIconWithText]; +end; + +procedure TcxBarEditItemControl.Hide(AStoreDisplayValue: Boolean); +begin + if Edit <> nil then + begin + if not IsWindowEnabled then + begin + Item.FPrevOnEditValueChanged := Edit.InternalProperties.OnEditValueChanged; + Edit.InternalProperties.OnEditValueChanged := Item.DoEditValueChanged; + end; + FFakeWinControl.Parent := nil; + EditorParentForm.SetBounds(0, 0, 0, 0); + DisableAppWindows(not IsApplicationActive); + try + EditorParentForm.FocusControl(nil); // must be before Parent:=nil because DoEnter in WinControl Activate + Edit.Parent := nil; // must be before DefocusControl + if IsDropDownEdit then + DropDownEdit.PopupWindow.ActiveControl := nil; + finally + EnableAppWindows; + end; + EditorParentForm.DefocusControl(Edit, True); // must be before ClearEditEvents; + ClearEditEvents; + ClearViewInfoEvents(Edit.ViewInfo); + EditorParentForm.Visible := False; + EditorParentForm.ParentWindow := 0; + Item.DoExit; + if AStoreDisplayValue then + StoreDisplayValue; + FEdit := nil; + end; +end; + +procedure TcxBarEditItemControl.InitEdit; + + procedure SetEditButtonsWidth; + var + AButton: TcxEditButton; + I: Integer; + begin + Edit.InternalProperties.BeginUpdate; + try + for I := 0 to Edit.InternalProperties.Buttons.Count - 1 do + begin + AButton := Edit.InternalProperties.Buttons[I]; + if AButton.Visible and (AButton.Width = 0) then + AButton.Width := GetDefaultEditButtonWidth(I); + end; + finally + Edit.InternalProperties.EndUpdate; + end; + end; + + procedure InitEditProperties; + begin + Edit.LockChangeEvents(True); + try + Edit.InternalProperties.Assign(Properties); + finally + Edit.LockChangeEvents(False, False); + end; + SetEditButtonsWidth; + end; + + procedure AssignEditEvents; + begin + SaveEditEvents; + Edit.InternalProperties.OnChange := DoEditPropertiesChange; + Edit.InternalProperties.OnClosePopup := DoEditClosePopup; + Edit.InternalProperties.OnValidate := DoValidate; + Edit.OnFocusChanged := DoFocusChanged; + Edit.OnKeyDown := DoKeyDown; + Edit.OnKeyPress := DoKeyPress; + Edit.OnKeyUp := DoKeyUp; + Edit.OnMouseMove := DoMouseMove; + Edit.OnPostEditValue := DoPostEditValue; + + if IsDropDownEdit then + begin + DropDownEdit.OnAfterKeyDown := DoAfterKeyDown; + DropDownEdit.Properties.OnInitPopup := DoInitPopup; + DropDownEdit.PopupWindow.ViewInfo.OnCustomDrawBorder := DoCustomDrawPopupBorder; + end; + end; + +begin + FEdit := EditList.GetEdit(TcxCustomEditPropertiesClass(Properties.ClassType)); + +//#DG (RichEdit want handle) RestoreDisplayValue; + + InitEditProperties; + Edit.Style := EditStyle; + InitEditContentParams(Edit.ContentParams); + AssignViewInfoEvents(Edit.ViewInfo); + AssignEditEvents; +end; + +function TcxBarEditItemControl.IsChildWindow(AWnd: HWND): Boolean; +begin + Result := inherited IsChildWindow(AWnd) or (Edit <> nil) and (Edit.IsChildWindow(AWnd)); +end; + +function TcxBarEditItemControl.IsEditTransparent: Boolean; +begin + Result := esoTransparency in Properties.GetSupportedOperations; +end; + +function TcxBarEditItemControl.IsTransparentOnGlass: Boolean; +begin + Result := IsEditTransparent; +end; + +procedure TcxBarEditItemControl.KeyDown(var Key: Word; Shift: TShiftState); +begin + if not Focused then + begin + Click(False, Char(Key)); + Key := 0; + end + else + inherited KeyDown(Key, Shift); +end; + +procedure TcxBarEditItemControl.ParentVisibleChange(AIsShowing: Boolean); +const + AShowParams: array[Boolean] of Integer = (SW_HIDE, SW_SHOWNOACTIVATE); +begin + if IsDropDownEdit and DropDownEdit.HasPopupWindow then + ShowWindow(DropDownEdit.PopupWindow.Handle, AShowParams[AIsShowing]); +end; + +procedure TcxBarEditItemControl.RestoreDisplayValue; +begin + Edit.LockChangeEvents(True); + try + if CanSelect then + begin + Edit.EditValue := Item.EditValue; + if esoShowingCaption in Properties.GetSupportedOperations then + if NeedEditShowCaption then + TControlAccess(Edit).Caption := Caption + else + TControlAccess(Edit).Caption := ''; + end; + finally + Edit.LockChangeEvents(False, False); + end; +end; + +procedure TcxBarEditItemControl.Show; +begin + inherited Show; + InternalShowEdit; + RestoreDisplayValue; + Item.DoEnter; +end; + +procedure TcxBarEditItemControl.StoreDisplayValue; +begin + Edit.Deactivate; + Item.GetProperties.BeginUpdate; + try + Edit.ActiveProperties.Update(Item.GetProperties); + finally + Item.GetProperties.EndUpdate(False); + end; + Item.EditValue := Edit.EditValue; +end; + +function TcxBarEditItemControl.WantsKey(Key: Word): Boolean; +begin + Result := inherited WantsKey(Key) or Properties.IsActivationKey(Char(Key)); +end; + +procedure TcxBarEditItemControl.CalculateEditViewInfo(const ABounds: TRect; + P: TPoint; AIsMouseEvent: Boolean; AEditViewInfo: TcxCustomEditViewInfo; AFull: Boolean); + + function CanHotTrack: Boolean; + begin + Result := not (Item.IsDesigning or Parent.IsCustomizing) and IsWindowEnabled and Painter.EditButtonAllowHotTrack(FDrawParams); + end; + +var + AViewData: TcxCustomEditViewData; + AViewInfo: TcxCustomEditViewInfo; +begin + if AEditViewInfo <> nil then + AViewInfo := AEditViewInfo + else + AViewInfo := EditViewInfo; + AViewData := CreateEditViewData(AFull); + try + if not CanHotTrack then + P := Point(-1, -1); + AssignViewInfoEvents(AViewInfo); + if Item.CaptionIsEditValue then + AViewData.EditValueToDrawValue(Canvas, Caption, AViewInfo) + else + AViewData.EditValueToDrawValue(Canvas, Item.EditValue, AViewInfo); + if not Item.CaptionIsEditValue and NeedEditShowCaption then + TcxCustomTextEditViewInfo(AViewInfo).Text := Caption; + BarCanvas.BeginPaint(Canvas.Canvas); + try + AViewData.Calculate(BarCanvas, ABounds, P, cxmbNone, [], AViewInfo, AIsMouseEvent); + finally + BarCanvas.EndPaint; + end; + if AFull then + CalcParts; + finally + AViewData.Free; + end; +end; + +function TcxBarEditItemControl.CreateEditViewData(AFull: Boolean = True): TcxCustomEditViewData; +begin + Result := Properties.CreateViewData(EditStyle, True); + Result.Enabled := Enabled; + if AFull then + InitEditContentParams(Result.EditContentParams); + Result.OnGetDefaultButtonWidth := DoGetEditDefaultButtonWidth; +end; + +function TcxBarEditItemControl.CreateEditViewInfo: TcxCustomEditViewInfo; +begin + Result := TcxCustomEditViewInfo(Properties.GetViewInfoClass.Create); +end; + +procedure TcxBarEditItemControl.ClearEditEvents; +begin + Edit.InternalProperties.OnChange := nil; + Edit.InternalProperties.OnClosePopup := nil; + Edit.InternalProperties.OnValidate := nil; + Edit.OnFocusChanged := nil; + Edit.OnKeyDown := nil; + Edit.OnKeyPress := nil; + Edit.OnKeyUp := nil; + Edit.OnMouseMove := nil; + Edit.OnPostEditValue := nil; + + if IsDropDownEdit then + begin + DropDownEdit.OnAfterKeyDown := nil; + DropDownEdit.Properties.OnInitPopup := nil; + DropDownEdit.PopupWindow.ViewInfo.OnCustomDrawBorder := nil; + end; +end; + +procedure TcxBarEditItemControl.InternalShowEdit; +begin + EditorParentForm.ParentWindow := Parent.Handle; + EditorParentForm.BoundsRect := GetBoundsRect; + Edit.Align := alClient; + Edit.Parent := EditorParentForm; + + Edit.Visible := True; {#DG TODO: MUST BE CHECKED BY SERG} + + TControl(EditorParentForm).Visible := True; +end; + +procedure TcxBarEditItemControl.SaveEditEvents; +begin + FSavedEditEvents.OnChange := Edit.InternalProperties.OnChange; + FSavedEditEvents.OnClosePopup := Edit.InternalProperties.OnClosePopup; + FSavedEditEvents.OnValidate := Edit.InternalProperties.OnValidate; + FSavedEditEvents.OnFocusChanged := Edit.OnFocusChanged; + FSavedEditEvents.OnKeyDown := Edit.OnKeyDown; + FSavedEditEvents.OnKeyPress := Edit.OnKeyPress; + FSavedEditEvents.OnKeyUp := Edit.OnKeyUp; + FSavedEditEvents.OnMouseMove := Edit.OnMouseMove; + FSavedEditEvents.OnPostEditValue := Edit.OnPostEditValue; + + if IsDropDownEdit then + begin + FSavedEditEvents.OnAfterKeyDown := DropDownEdit.OnAfterKeyDown; + FSavedEditEvents.OnInitPopup := DropDownEdit.Properties.OnInitPopup; + end; +end; + +procedure TcxBarEditItemControl.DoAfterKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); +begin + if Assigned(FSavedEditEvents.OnAfterKeyDown) then + FSavedEditEvents.OnAfterKeyDown(Sender, Key, Shift); + if Key = VK_TAB then + KeyDown(Key, Shift); +end; + +procedure TcxBarEditItemControl.DoCustomDrawPopupBorder(AViewInfo: TcxContainerViewInfo; ACanvas: TcxCanvas; const R: TRect; var AHandled: Boolean; + out ABorderWidth: Integer); +begin + AHandled := True; + ABorderWidth := Painter.GetPopupWindowBorderWidth; + if (ACanvas <> nil) then + Painter.DropDownListBoxDrawBorder(ACanvas.Handle, AViewInfo.BackgroundColor, R); +end; + +procedure TcxBarEditItemControl.DoDrawEditBackground( + Sender: TcxCustomEditViewInfo; ACanvas: TcxCanvas; var AHandled: Boolean); +var + APrevWindowOrg: TPoint; + ABounds: TRect; +begin + AHandled := IsEditTransparent; + if AHandled and (ACanvas <> nil) then + begin + ABounds := Sender.Bounds; + BeforeDrawBackground(Sender.Edit, Edit, ACanvas.Handle, ABounds, APrevWindowOrg); + try + DrawEditBackground(ACanvas, ABounds, Sender.BackgroundColor); + finally + AfterDrawBackground(ACanvas.Handle, APrevWindowOrg); + end; + end; +end; + +procedure TcxBarEditItemControl.DoDrawEditButton(Sender: TcxCustomEditViewInfo; + ACanvas: TcxCanvas; AButtonVisibleIndex: Integer; var AHandled: Boolean); +var + APrevWindowOrg: TPoint; + AOriginalCanvas: TcxCanvas; + ARect: TRect; + AUseParentCanvas: Boolean; +begin + AHandled := Item.UseBarPaintingStyle; + if AHandled then + begin + AUseParentCanvas := ACanvas.Handle = Canvas.Handle; + ARect := FParts[ccpDropButton]; + if (Edit <> nil) and Edit.HandleAllocated and not AUseParentCanvas then + MapWindowRect(Parent.Handle, Edit.Handle, ARect); + BeforeDrawBackground(Edit, Parent, ACanvas.Handle, ARect, APrevWindowOrg); + try + AOriginalCanvas := FDrawParams.Canvas; + try + FDrawParams.Canvas := ACanvas; + Painter.ComboControlDrawArrowButton(DrawParams, ARect, True); + finally + FDrawParams.Canvas := AOriginalCanvas + end; + finally + AfterDrawBackground(ACanvas.Handle, APrevWindowOrg); + end; + if Painter.EditButtonAllowCompositeFrame and not AUseParentCanvas then + Painter.ComboControlDrawArrowButton(DrawParams, FParts[ccpDropButton], False); + end; +end; + +procedure TcxBarEditItemControl.DoDrawEditButtonBackground( + Sender: TcxCustomEditViewInfo; ACanvas: TcxCanvas; const ARect: TRect; + AButtonVisibleIndex: Integer; var AHandled: Boolean); +var + APrevWindowOrg: TPoint; + AOriginalCanvas: TcxCanvas; + AButtonState: Integer; + ABackgroundRect: TRect; +begin + AButtonState := GetEditButtonState(Sender.ButtonsInfo[AButtonVisibleIndex]); + AHandled := Painter.EditButtonIsCustomBackground(AButtonState); + + if AHandled and (ACanvas <> nil) then + begin + ABackgroundRect := ARect; + BeforeDrawBackground(Edit, Parent, ACanvas.Handle, ABackgroundRect, APrevWindowOrg); + try + AOriginalCanvas := FDrawParams.Canvas; + try + FDrawParams.Canvas := ACanvas; + Painter.EditButtonDrawBackground(DrawParams, AButtonState, + ABackgroundRect, GetSolidBrush(Sender.BackgroundColor)); + finally + FDrawParams.Canvas := AOriginalCanvas + end; + finally + AfterDrawBackground(ACanvas.Handle, APrevWindowOrg); + end; + end; +end; + +procedure TcxBarEditItemControl.DoDrawEditButtonBorder(Sender: TcxCustomEditViewInfo; ACanvas: TcxCanvas; AButtonVisibleIndex: Integer; + out ABackgroundRect, AContentRect: TRect; var AHandled: Boolean); +var + APrevWindowOrg: TPoint; + AOriginalCanvas: TcxCanvas; + AOffset: TPoint; +begin + AHandled := Painter.EditButtonIsCustomBorder; + if (ACanvas <> nil) and AHandled then + begin + ABackgroundRect := Sender.ButtonsInfo[AButtonVisibleIndex].Bounds; + AOffset := BeforeDrawBackground(Edit, Parent, ACanvas.Handle, ABackgroundRect, APrevWindowOrg); + try + AOriginalCanvas := FDrawParams.Canvas; + try + FDrawParams.Canvas := ACanvas; + Painter.EditButtonDrawBorder(FDrawParams, GetEditButtonState(Sender.ButtonsInfo[AButtonVisibleIndex]), ABackgroundRect, AContentRect); + finally + FDrawParams.Canvas := AOriginalCanvas + end; + finally + AfterDrawBackground(ACanvas.Handle, APrevWindowOrg); + end; + ABackgroundRect := cxRectOffset(ABackgroundRect, cxPointInvert(AOffset)); + AContentRect := cxRectOffset(AContentRect, cxPointInvert(AOffset)); + end; +end; + +procedure TcxBarEditItemControl.DoEditPaint(Sender: TcxCustomEditViewInfo; ACanvas: TcxCanvas); +begin + CalcDrawParams; +end; + +procedure TcxBarEditItemControl.DoEditClosePopup(Sender: TcxControl; + AReason: TcxEditCloseUpReason); +begin + if Assigned(FSavedEditEvents.OnClosePopup) then + FSavedEditEvents.OnClosePopup(Sender, AReason); + + case AReason of + crCancel: DoEscape; + crEnter: DoEnter; + crTab: DoNavigation; + end; +end; + +procedure TcxBarEditItemControl.DoEditPropertiesChange(Sender: TObject); +begin + if Assigned(FSavedEditEvents.OnChange) then + FSavedEditEvents.OnChange(Sender); + Item.CurChange; +end; + +procedure TcxBarEditItemControl.DoGetEditButtonState(Sender: TcxCustomEditViewInfo; + AButtonVisibleIndex: Integer; var AState: TcxEditButtonState); +begin + if Item.UseBarPaintingStyle and (Focused or DrawSelected) and (AState = ebsNormal) then + AState := ebsSelected; +end; + +procedure TcxBarEditItemControl.DoGetEditDefaultButtonWidth( + Sender: TcxCustomEditViewData; AIndex: Integer; var ADefaultWidth: Integer); +begin + ADefaultWidth := GetDefaultEditButtonWidth(AIndex); +end; + +procedure TcxBarEditItemControl.DoFocusChanged(Sender: TObject); +begin + if Assigned(FSavedEditEvents.OnFocusChanged) then + FSavedEditEvents.OnFocusChanged(Sender); + + if Focused and not Edit.Focused then + Parent.HideAll; +end; + +procedure TcxBarEditItemControl.DoInitPopup(Sender: TObject); +begin + if Assigned(FSavedEditEvents.OnInitPopup) then + FSavedEditEvents.OnInitPopup(Sender); + if IsPopupSideward then + begin + DropDownEdit.Properties.PopupDirection := pdHorizontal; + DropDownEdit.Properties.PopupVertAlignment := pavTop; + DropDownEdit.Properties.PopupHorzAlignment := pahRight; + end; +end; + +procedure TcxBarEditItemControl.DoKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if Assigned(FSavedEditEvents.OnKeyDown) then + FSavedEditEvents.OnKeyDown(Sender, Key, Shift); + KeyDown(Key, Shift); +end; + +procedure TcxBarEditItemControl.DoKeyPress(Sender: TObject; var Key: Char); +begin + if Assigned(FSavedEditEvents.OnKeyPress) then + FSavedEditEvents.OnKeyPress(Sender, Key); + KeyPress(Key); +end; + +procedure TcxBarEditItemControl.DoKeyUp(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if Assigned(FSavedEditEvents.OnKeyUp) then + FSavedEditEvents.OnKeyUp(Sender, Key, Shift); + KeyUp(Key, Shift); +end; + +procedure TcxBarEditItemControl.DoPostEditValue(Sender: TObject); +begin + Item.EditValue := Edit.EditValue; +end; + +procedure TcxBarEditItemControl.DoValidate(Sender: TObject; var DisplayValue: TcxEditValue; + var ErrorText: TCaption; var Error: Boolean); +begin + ErrorText := cxGetResourceString(@scxMaskEditInvalidEditValue); + if Assigned(FSavedEditEvents.OnValidate) then + FSavedEditEvents.OnValidate(Sender, DisplayValue, ErrorText, Error); +end; + +function TcxBarEditItemControl.GetEditButtonState(AButtonViewInfo: TcxEditButtonViewInfo): Integer; +begin + case AButtonViewInfo.Data.State of + ebsDisabled: Result := DXBAR_DISABLED; + ebsPressed: Result := DXBAR_DROPPEDDOWN; + ebsSelected: Result := DXBAR_HOT + else + if FHotPartIndex = ecpEdit then + Result := DXBAR_ACTIVE + else + Result := DXBAR_NORMAL + end; +end; + +procedure TcxBarEditItemControl.AssignViewInfoEvents( + AViewInfo: TcxCustomEditViewInfo); +begin + AViewInfo.OnDrawBackground := DoDrawEditBackground; + AViewInfo.OnDrawButton := DoDrawEditButton; + AViewInfo.OnDrawButtonBackground := DoDrawEditButtonBackground; + AViewInfo.OnDrawButtonBorder := DoDrawEditButtonBorder; + AViewInfo.OnGetButtonState := DoGetEditButtonState; + AViewInfo.OnPaint := DoEditPaint; +end; + +procedure TcxBarEditItemControl.ClearViewInfoEvents( + AViewInfo: TcxCustomEditViewInfo); +begin + AViewInfo.OnDrawBackground := nil; + AViewInfo.OnDrawButton := nil; + AViewInfo.OnDrawButtonBackground := nil; + AViewInfo.OnDrawButtonBorder := nil; + AViewInfo.OnGetButtonState := nil; + AViewInfo.OnPaint := nil; +end; + +procedure TcxBarEditItemControl.DrawEditBackground(ACanvas: TcxCanvas; + ARect: TRect; AColor: TColor); +var + APrevWindowOrg: TPoint; +begin + BeforeDrawBackground(Edit, Parent, ACanvas.Handle, ARect, APrevWindowOrg); + try + Painter.DrawItemBackground(Self, ACanvas, ARect, GetSolidBrush(AColor)); + finally + AfterDrawBackground(ACanvas.Handle, APrevWindowOrg); + end; +end; + +function TcxBarEditItemControl.GetBoundsRect: TRect; +begin + Result := Painter.EditControlGetContentRect(GetPaintType, GetEditRect); +end; + +function TcxBarEditItemControl.GetCurEditValue: TcxEditValue; +begin + if Edit <> nil then + Result := Edit.EditingValue + else + Result := Item.EditValue; +end; + +function TcxBarEditItemControl.GetDefaultEditButtonWidth(AIndex: Integer): Integer; +begin + if Item.UseBarPaintingStyle then + begin + Result := Parent.ComboBoxArrowWidth; + Painter.EditButtonCorrectDefaultWidth(Result); + end + else + Result := 0; +end; + +function TcxBarEditItemControl.GetDropDownEdit: TcxCustomDropDownEdit; +begin + Result := TcxCustomDropDownEdit(Edit); +end; + +function TcxBarEditItemControl.GetEditSize: TSize; +var + ABorderOffsets: TRect; + AConstantPartSize, AMinContentSize: TSize; + AEditViewInfo: TcxCustomEditViewInfo; + AViewData: TcxCustomEditViewData; +begin + AEditViewInfo := nil; + AViewData := nil; + try + AEditViewInfo := CreateEditViewInfo; + AViewData := CreateEditViewData(False); + CalculateEditViewInfo(Rect(0, 0, MaxInt, MaxInt), Point(-1, -1), False, AEditViewInfo, False); + BarCanvas.BeginPaint(Canvas.Canvas); + try + AConstantPartSize := AViewData.GetEditConstantPartSize(BarCanvas, + DefaultcxEditSizeProperties, AMinContentSize, AEditViewInfo); + ABorderOffsets := Painter.EditControlBorderOffsets(GetPaintType); + Inc(AConstantPartSize.cx, ABorderOffsets.Left + ABorderOffsets.Right); + Inc(AConstantPartSize.cy, ABorderOffsets.Top + ABorderOffsets.Bottom); + if Item.CaptionIsEditValue then + Result := AViewData.GetEditContentSize(BarCanvas, Caption, DefaultcxEditSizeProperties) + else + Result := Size(0, 0); + finally + BarCanvas.EndPaint; + end; + + CheckSize(Result, AMinContentSize); + if not (esfNoContentPart in Properties.GetSpecialFeatures) and (Result.cx < MinContentWidth) then + Result.cx := MinContentWidth; + Inc(Result.cx, AConstantPartSize.cx); + Inc(Result.cy, AConstantPartSize.cy); + finally + FreeAndNil(AEditViewInfo); + FreeAndNil(AViewData); + end; +end; + +function TcxBarEditItemControl.GetEditStyle: TcxEditStyle; +var + ABackgroundColor, ATextColor: COLORREF; +begin + CalcDrawParams; + Painter.EditGetColors(Self, ATextColor, ABackgroundColor); + if IsEditTransparent then + ABackgroundColor := cxGetBrushData(Parent.BkBrush).lbColor; + Result := InternalGetEditStyle(Properties, BarManager, Painter, + EditFont, ABackgroundColor, ATextColor, DrawSelected); +end; + +function TcxBarEditItemControl.GetEditViewInfo: TcxCustomEditViewInfo; +begin + if (FEditViewInfo <> nil) and (FEditViewInfo.ClassType <> Properties.GetViewInfoClass) then + FreeAndNil(FEditViewInfo); + if FEditViewInfo = nil then + FEditViewInfo := CreateEditViewInfo; + Result := FEditViewInfo; +end; + +function TcxBarEditItemControl.GetItem: TcxCustomBarEditItem; +begin + Result := TcxCustomBarEditItem(ItemLink.Item); +end; + +function TcxBarEditItemControl.GetProperties: TcxCustomEditProperties; +begin + Result := Item.GetProperties; +end; + +procedure TcxBarEditItemControl.InitEditContentParams( + var AParams: TcxEditContentParams); +var + ABorderOffsets: TRect; +begin + AParams.ExternalBorderBounds := GetEditRect; + OffsetRect(AParams.ExternalBorderBounds, -AParams.ExternalBorderBounds.Left, + -AParams.ExternalBorderBounds.Top); + if IsPopupSideward then + Dec(AParams.ExternalBorderBounds.Left, GetEditOffset); + ABorderOffsets := Painter.EditControlBorderOffsets(GetPaintType); + OffsetRect(AParams.ExternalBorderBounds, -ABorderOffsets.Left, + -ABorderOffsets.Top); + + if NeedEditShowCaption then + begin + AParams.Offsets := Painter.GetCaptionOffsets; + AParams.SizeCorrection.cy := 0; + end + else + Painter.GetEditTextParams(AParams.Offsets, AParams.SizeCorrection.cy); + AParams.SizeCorrection.cx := 0; + + AParams.Options := []; + if Painter.EditButtonAllowOffsetContent then + Include(AParams.Options, ecoOffsetButtonContent); +// if Focused then +// AParams.Options := [ecoShowFocusRectWhenInplace]; +end; + +function TcxBarEditItemControl.IsDropDownEdit: Boolean; +begin + Result := Edit is TcxCustomDropDownEdit; +end; + +function TcxBarEditItemControl.IsPopupSideward: Boolean; +begin + Result := (Parent.Kind = bkSubMenu) or Parent.IsRealVertical +end; + +function TcxBarEditItemControl.NeedEditShowCaption: Boolean; +begin + Result := Item.CaptionIsEditValue or inherited GetShowCaption and not GetShowCaption; +end; + +initialization + dxBarRegisterItem(TcxBarEditItem, TcxBarEditItemControl, True); + BarDesignController.RegisterBarControlEditor(TcxItemsEditorEx); + + FFakeWinControl := TFakeWinControl.Create(nil); //#!!! + FFakeWinControl.Name := 'FakeWinControl'; + +finalization + FreeAndNil(FFakeWinControl); //#!!! + + BarDesignController.UnregisterBarControlEditor(TcxItemsEditorEx); + dxBarUnregisterItem(TcxBarEditItem); + + FreeAndNil(FDefaultRepositoryItem); + FreeAndNil(FEditList); + FreeAndNil(FEditorParentForm); + FreeAndNil(FEditStyle); + +end. diff --git a/official/x.35/ExpressBars 6/Sources/cxBarEditItemReg.pas b/official/x.35/ExpressBars 6/Sources/cxBarEditItemReg.pas new file mode 100644 index 00000000..dd6ba9e6 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/cxBarEditItemReg.pas @@ -0,0 +1,298 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars components } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit cxBarEditItemReg; + +{$I cxVer.inc} + +interface + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI6} + DesignConst, DesignEditors, DesignIntf, Variants, +{$ELSE} + DsgnIntf, OCXReg, +{$ENDIF} + Classes, TypInfo, cxBarEditItem, cxBarEditItemValueEditor, cxEdit, + cxPropEditors, dxBarStrs; + +type + TcxCustomBarEditItemAccess = class(TcxCustomBarEditItem); + + { TcxBarEditItemPropertiesProperty } + + TcxBarEditItemPropertiesProperty = class(TClassProperty) + private + function HasSubProperties: Boolean; + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + { TcxBarEditItemPropertiesEventsProperty } + + TcxBarEditItemPropertiesEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + +{$IFDEF DELPHI6} + { TcxBarEditItemSelectionEditor } + + TcxBarEditItemSelectionEditor = class(TSelectionEditor) + private + FProc: TGetStrProc; + procedure GetBarEditItem(const S: string); + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; +{$ENDIF} + + { TcxBarEditItemEditValueProperty } + + TcxBarEditItemEditValueProperty = class({$IFDEF DELPHI6}TVariantProperty{$ELSE}TOleObjectProperty{$ENDIF}) + private + function CanShowDialog: Boolean; + function IsBlobEditValue: Boolean; + public + function AllEqual: Boolean; override; + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure SetValue(const Value: string); override; + end; + +{ TcxBarEditItemPropertiesProperty } + +function TcxBarEditItemPropertiesProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes; + if not HasSubProperties then + Exclude(Result, paSubProperties); + Result := Result - [paReadOnly] + + [paValueList, paSortList, paRevertable{$IFDEF DELPHI6}, paVolatileSubProperties{$ENDIF}]; +end; + +function TcxBarEditItemPropertiesProperty.GetValue: string; +begin + if HasSubProperties then + Result := GetRegisteredEditProperties.GetDescriptionByClass( + TcxCustomBarEditItem(GetComponent(0)).PropertiesClass) + else + Result := ''; +end; + +procedure TcxBarEditItemPropertiesProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to GetRegisteredEditProperties.Count - 1 do + Proc(GetRegisteredEditProperties.Descriptions[I]); +end; + +procedure TcxBarEditItemPropertiesProperty.SetValue(const Value: string); +var + APropertiesClass: TcxCustomEditPropertiesClass; + I: Integer; +begin + APropertiesClass := TcxCustomEditPropertiesClass(GetRegisteredEditProperties.FindByClassName(Value)); + if APropertiesClass = nil then + APropertiesClass := TcxCustomEditPropertiesClass(GetRegisteredEditProperties.FindByDescription(Value)); +{$IFNDEF DELPHI7} + if GetValue <> Value then + ObjectInspectorCollapseProperty; +{$ENDIF} + for I := 0 to PropCount - 1 do + TcxCustomBarEditItem(GetComponent(I)).PropertiesClass := APropertiesClass; + Modified; +end; + +function TcxBarEditItemPropertiesProperty.HasSubProperties: Boolean; +var + I: Integer; +begin + Result := True; + for I := 0 to PropCount - 1 do + if TcxCustomBarEditItem(GetComponent(I)).Properties = nil then + begin + Result := False; + Break; + end; +end; + +{ TcxBarEditItemPropertiesEventsProperty } + +function TcxBarEditItemPropertiesEventsProperty.GetInstance: TPersistent; +begin + Result := TcxCustomBarEditItem(GetComponent(0)).Properties; +end; + +{$IFDEF DELPHI6} +{ TcxBarEditItemSelectionEditor } + +procedure TcxBarEditItemSelectionEditor.RequiresUnits( + Proc: TGetStrProc); +begin + FProc := Proc; + Designer.GetComponentNames(GetTypeData(TcxCustomBarEditItem.ClassInfo), GetBarEditItem); +end; + +procedure TcxBarEditItemSelectionEditor.GetBarEditItem(const S: string); +var + AItem: TcxCustomBarEditItem; +begin + AItem := TcxCustomBarEditItem(Designer.GetComponent(S)); + if AItem.Properties <> nil then + FProc(GetTypeData(AItem.Properties.ClassType.ClassInfo).UnitName); +end; +{$ENDIF} + +{ TcxBarEditItemEditValueProperty } + +function TcxBarEditItemEditValueProperty.AllEqual: Boolean; +var + I: Integer; +begin + if IsBlobEditValue then + begin + Result := PropCount = 1; + if not Result then + for I := 0 to PropCount - 1 do + begin + Result := VarIsNull(TcxCustomBarEditItem(GetComponent(I)).EditValue); + if not Result then + Break; + end; + end + else + Result := inherited AllEqual; +end; + +procedure TcxBarEditItemEditValueProperty.Edit; +var + AItem: TcxCustomBarEditItem; + I: Integer; +begin + if CanShowDialog then + begin + AItem := TcxCustomBarEditItem(GetComponent(0)); + if ShowValueEditor(AItem) then + begin + for I := 1 to PropCount - 1 do + TcxCustomBarEditItem(GetComponent(I)).EditValue := AItem.EditValue; + Modified; + end; + end; +end; + +function TcxBarEditItemEditValueProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes; + if CanShowDialog then + Include(Result, paDialog); +end; + +function TcxBarEditItemEditValueProperty.GetValue: string; +begin + if IsBlobEditValue then + if VarIsNull(TcxCustomBarEditItem(GetComponent(0)).EditValue) then + Result := SNull + else + Result := SBlob + else + Result := inherited GetValue; +end; + +procedure TcxBarEditItemEditValueProperty.SetValue(const Value: string); +begin + if not IsBlobEditValue then + inherited SetValue(Value); +end; + +function TcxBarEditItemEditValueProperty.CanShowDialog: Boolean; +var + ABlobEditValue: Boolean; + AProperties, ATempProperties: TcxCustomEditProperties; + I: Integer; +begin + Result := not TcxCustomBarEditItemAccess(GetComponent(0)).CaptionIsEditValue; + if not Result then + Exit; + AProperties := TcxCustomBarEditItem(GetComponent(0)).GetProperties; + ABlobEditValue := esfBlobEditValue in AProperties.GetSpecialFeatures; + for I := 1 to PropCount - 1 do + begin + ATempProperties := TcxCustomBarEditItem(GetComponent(I)).GetProperties; + if (ATempProperties.ClassType <> AProperties.ClassType) or + (esfBlobEditValue in ATempProperties.GetSpecialFeatures <> ABlobEditValue) then + begin + Result := False; + Break; + end; + end; +end; + +function TcxBarEditItemEditValueProperty.IsBlobEditValue: Boolean; +begin + Result := CanShowDialog and + (esfBlobEditValue in TcxCustomBarEditItem(GetComponent(0)).GetProperties.GetSpecialFeatures); +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterNoIcon([TcxBarEditItem]); + RegisterPropertyEditor(TypeInfo(TcxEditValue), TcxCustomBarEditItem, + 'EditValue', TcxBarEditItemEditValueProperty); + RegisterPropertyEditor(TypeInfo(TcxCustomEditProperties), TcxCustomBarEditItem, + 'Properties', TcxBarEditItemPropertiesProperty); + RegisterPropertyEditor(TypeInfo(string), TcxCustomBarEditItem, 'PropertiesClassName', nil); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomBarEditItem, 'PropertiesEvents', + TcxBarEditItemPropertiesEventsProperty); + RegisterPropertyEditor(TypeInfo(string), TcxCustomBarEditItem, 'Text', nil); +{$IFDEF DELPHI6} + RegisterSelectionEditor(TcxCustomBarEditItem, TcxBarEditItemSelectionEditor); +{$ENDIF} +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/cxBarEditItemValueEditor.pas b/official/x.35/ExpressBars 6/Sources/cxBarEditItemValueEditor.pas new file mode 100644 index 00000000..8def5410 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/cxBarEditItemValueEditor.pas @@ -0,0 +1,235 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars components } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit cxBarEditItemValueEditor; + +{$I cxVer.inc} + +interface + +uses + dxBar, cxBarEditItem; + +function ShowValueEditor(AItem: TcxCustomBarEditItem): Boolean; overload; +function ShowValueEditor(AItemLink: TdxBarItemLink): Boolean; overload; + +implementation + +uses + Windows, Classes, Controls, ExtCtrls, Forms, Math, StdCtrls, SysUtils, TypInfo, + cxButtons, cxClasses, cxEdit, cxFilterControlUtils, cxLookAndFeelPainters, + dxBarStrs; + +type + TControlAccess = class(TControl); + TcxCustomEditAccess = class(TcxCustomEdit); + TdxBarManagerAccess = class(TdxBarManager); + +procedure ClearPublishedEvents(AInstance: TObject); +var + ACount, I: Integer; + AMethod: TMethod; + APPropList: PPropList; +begin + ACount := GetPropList(PTypeInfo(AInstance.ClassInfo), [tkMethod], nil); + if ACount = 0 then + Exit; + GetMem(APPropList, ACount * SizeOf(Pointer)); + try + GetPropList(PTypeInfo(AInstance.ClassInfo), [tkMethod], APPropList); + for I := 0 to ACount - 1 do + begin + AMethod := GetMethodProp(AInstance, APPropList[I]); + if AMethod.Code <> nil then + begin + AMethod.Code := nil; + AMethod.Data := nil; + SetMethodProp(AInstance, APPropList[I], AMethod); + end; + end; + finally + FreeMem(APPropList); + end; +end; + +function InternalShowValueEditor(AItem: TcxCustomBarEditItem; + AItemLink: TdxBarItemLink = nil): Boolean; +var + ABevel: TBevel; + AButtonOK, AButtonCancel: TcxButton; + AEdit: TcxCustomEdit; + AForm: TForm; + + function UseFilterHelper: Boolean; + begin + Result := not (esoEditing in AItem.GetProperties.GetSupportedOperations); + end; + + procedure CreateEdit; + var + AFilterEditHelper: TcxCustomFilterEditHelperClass; + AProperties: TcxCustomEditProperties; + begin + AProperties := AItem.GetProperties; + if UseFilterHelper then + begin + AFilterEditHelper := FilterEditsController.FindHelper(AProperties.ClassType); + if AFilterEditHelper = nil then + raise Exception.Create(''); + AEdit := AFilterEditHelper.GetFilterEdit(AProperties); + AEdit.Parent := AForm; + AFilterEditHelper.SetFilterValue(AEdit, AProperties, AItem.EditValue); + end + else + begin + AEdit := TcxCustomEditClass(AProperties.GetContainerClass).Create(nil); + AEdit.LockChangeEvents(True); + try + AEdit.InternalProperties.Assign(AProperties); + finally + AEdit.LockChangeEvents(False, False); + end; + ClearPublishedEvents(AEdit.InternalProperties); + AEdit.Parent := AForm; + AEdit.EditValue := AItem.EditValue; + if esoShowingCaption in AProperties.GetSupportedOperations then + if AItemLink <> nil then + TControlAccess(AEdit).Caption := AItemLink.Caption + else + TControlAccess(AEdit).Caption := AItem.Caption; + end; + AEdit.Style.HotTrack := False; + TdxBarManagerAccess(AItem.BarManager).GetRealLookAndFeel(AEdit.Style.LookAndFeel); + end; + + function GetEditSize(AEdit: TcxCustomEdit): TSize; + begin + if AItemLink <> nil then + Result.cx := AItemLink.Width + else + Result.cx := 121; + + if esfMinSize in AEdit.ActiveProperties.GetSpecialFeatures then + TcxCustomEditAccess(AEdit).AutoSize := True; + AEdit.HandleNeeded; + Result.cy := AEdit.Height; + end; + + function CreateButton(AParent: TForm; const ACaption: string; + AModalResult: TModalResult): TcxButton; + begin + Result := TcxButton.Create(AParent); + Result.Caption := ACaption; + Result.ModalResult := AModalResult; + Result.Parent := AParent; + TdxBarManagerAccess(AItem.BarManager).GetRealLookAndFeel(Result.LookAndFeel); + end; + + procedure CreateSubControls; + begin + ABevel := TBevel.Create(AForm); + ABevel.Parent := AForm; + + AButtonOK := CreateButton(AForm, cxGetResourceString(@dxSBAR_DIALOGOK), mrOk); + AButtonOK.Default := True; + + AButtonCancel := CreateButton(AForm, cxGetResourceString(@dxSBAR_DIALOGCANCEL), mrCancel); + AButtonCancel.Cancel := True; + end; + +const + ABevelHeight = 2; +var + AEditSize: TSize; + AProperties: TcxCustomEditProperties; + D, H, W: Integer; + S: TCaption; + V: Variant; +begin + AForm := TForm.Create(nil); + try + AForm.BorderStyle := bsDialog; + AForm.Caption := cxGetResourceString(@dxSBAR_CXEDITVALUEDIALOGCAPTION); + if AItemLink <> nil then + AForm.Font := AItemLink.BarControl.Font + else + AForm.Font := AItem.BarManager.Font; + + CreateEdit; + CreateSubControls; + + AEditSize := GetEditSize(AEdit); + AForm.Canvas.Font := AForm.Font; + W := 12 * AForm.Canvas.TextWidth('0'); + H := MulDiv(AForm.Canvas.TextHeight('0'), 5, 3); + D := H div 4; + + AForm.ClientWidth := D + Max(AEditSize.cx, W + D * 2 + W) + D; + AForm.ClientHeight := D + AEditSize.cy + D + ABevelHeight + D + H + D; + AForm.Position := poScreenCenter; + + AEdit.SetBounds(D, D, AForm.ClientWidth - D * 2, AEditSize.cy); + ABevel.SetBounds(D, D + AEditSize.cy + D, AForm.ClientWidth - D * 2, 2); + AButtonOK.SetBounds((AForm.ClientWidth - (W + D * 2 + W)) div 2, + D + AEditSize.cy + D + ABevelHeight + D, W, H); + AButtonCancel.SetBounds(AButtonOK.BoundsRect.Right + D * 2, AButtonOK.Top, W, H); + + Result := AForm.ShowModal = mrOk; + if Result then + begin + AProperties := AItem.GetProperties; + if UseFilterHelper then + begin + FilterEditsController.FindHelper(AProperties.ClassType).GetFilterValue(AEdit, AProperties, V, S); + AItem.EditValue := V; + end + else + AItem.EditValue := AEdit.EditValue; + end; + finally + FreeAndNil(AForm); + end; +end; + +function ShowValueEditor(AItem: TcxCustomBarEditItem): Boolean; +begin + Result := InternalShowValueEditor(AItem); +end; + +function ShowValueEditor(AItemLink: TdxBarItemLink): Boolean; +begin + Result := InternalShowValueEditor(TcxCustomBarEditItem(AItemLink.Item), AItemLink); +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/cxVer.inc b/official/x.35/ExpressBars 6/Sources/cxVer.inc new file mode 100644 index 00000000..a26364cc --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/cxVer.inc @@ -0,0 +1,172 @@ +{$B-} { Complete Boolean Evaluation } +{$R-} { Range-Checking } +{$T-} { Typed @ operator } +{$X+} { Extended syntax } +{$P+} { Open string params } +{$J+} { Writeable structured consts } +{$H+} { Use long strings by default } +{$Q-} { Overflow checking } + +{$DEFINE DXVER500} + +{$IFNDEF CLR} + {$DEFINE OLEDRAGANDDROP} + {$IFNDEF DONTUSEJPEGIMAGE} + {$DEFINE USEJPEGIMAGE} + {$ENDIF} +{$ENDIF} + +{$DEFINE EXPRESSBARS5} + +{$DEFINE VCL} + +{$IFNDEF VER80} + {$IFNDEF VER90} + {$IFNDEF VER93} + {$DEFINE DELPHI3} { Borland Delphi 3.0 } + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER110} { Borland C++Builder 3.0 } + {$DEFINE CBUILDER3} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE DELPHI4} +{$ENDIF} + +{$IFDEF VER125} { Borland C++Builder 4.0 } + {$DEFINE CBUILDER3} + {$DEFINE DELPHI4} + {$DEFINE CBUILDER4} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$IFDEF BCB} { Borland C++Builder 5.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$IFDEF BCB} { Borland C++Builder 6.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} +{$ENDIF} + +{$IFNDEF DELPHI6} + {$DEFINE MSWINDOWS} +{$ENDIF} +{$IFDEF LINUX} + {$UNDEF MSWINDOWS} +{$ENDIF} + +{$IFDEF LINUX} + {$DEFINE KYLIX1} { Borland Kylix 1 } + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF CompilerVersion >= 14} + {$DEFINE KYLIX2} { Borland Kylix 2 } + {$IFEND} + {$IF CompilerVersion >= 14.50} + {$DEFINE KYLIX3} { Borland Kylix 3 } + {$IFEND} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} { Borland Delphi.Net } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} +{$ENDIF} + +{$IFDEF VER170} { Borland Delphi 9.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} +{$ENDIF} + +{$IFDEF VER180} { Borland Delphi 10 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$IFDEF BCB} { Borland C++Builder 10 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Borland Delphi 11 //CodeGear} + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$DEFINE DELPHI11} + {$IFDEF BCB} { Borland C++Builder 11 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$DEFINE CBUILDER11} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFNDEF CLR} + {$IFNDEF BCB} + {$IFDEF DELPHI6} + {$DEFINE REGISTERSHELLCTRLS} + {$ENDIF} + {$ENDIF} + {$IFDEF DELPHI7} + {$WARN UNSAFE_CAST OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_TYPE OFF} + {$ENDIF} +{$ENDIF} + +{$IFDEF REGISTERSHELLCTRLS} + {$DEFINE REGISTERCXSHELLCTRLS} +{$ENDIF} + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} diff --git a/official/x.35/ExpressBars 6/Sources/dxBar.pas b/official/x.35/ExpressBars 6/Sources/dxBar.pas new file mode 100644 index 00000000..0687c880 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBar.pas @@ -0,0 +1,53368 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars components } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBar; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + SysUtils, TypInfo, Windows, Messages, Graphics, Controls, Forms, Classes, + ImgList, ActnList, Menus, StdCtrls, dxCommon, + dxThemeManager, cxLookAndFeels, cxLookAndFeelPainters, cxControls, cxContainer, + IniFiles, cxClasses, cxGraphics, Contnrs, cxStyles, dxFading, + cxAccessibility, cxLibraryConsts; + +(*$HPPEMIT '#define EMPTYSET System::Set () << 0'*) + +type + TdxBarItemPosition = (ipBeginsNewRow, ipBeginsNewColumn, ipContinuesRow); + TdxByteSet = set of Byte; + + TdxBarItemViewLevel = (ivlLargeIconWithText, ivlSmallIconWithText, + ivlSmallIcon, ivlControlOnly, ivlDefault{D10 bug}); + TdxBarItemRealViewLevel = ivlLargeIconWithText..ivlControlOnly; + TdxBarItemViewLevels = set of TdxBarItemRealViewLevel; + + TdxBarButtonGroupPosition = (bgpNone, bgpStart, bgpMember); + TdxBarButtonGroupRealPosition = (bgrpNone, bgrpStart, bgrpMember, bgrpFinish, + bgrpSingle); + + TdxBarItemAlign = (iaLeft, iaCenter, iaRight, iaClient); + TdxBarGlyphLayout = (glLeft, glRight, glTop, glBottom); + + TdxBarMenuItemSize = (misNormal, misLarge); + + TdxBarBehaviorOption = (bboAllowDetach, + bboAllowSelectWindowItemsWithoutFocusing, bboAllowShowHints, + bboClickItemsBySpaceKey, bboExtendItemWhenAlignedToClient, + bboNeedsFocusWhenActive, bboMouseCantUnselectNavigationItem, bboUnmoved, + bboItemCustomizePopup, bboSubMenuCaptureMouse); + TdxBarBehaviorOptions = set of TdxBarBehaviorOption; + + TdxBarItemCachedWidthInfo = record + Calculated: Boolean; + Width: Integer; + end; + + TdxBarItemStyleData = record + AssignedValues: TcxStyleValues; + Color: TColor; + FontData: TFontData; + TextColor: TColor; + + Style: TcxStyle; + end; + + TdxBarMouseWheelEventReceiver = (mwrNone, mwrActiveBarControl, + mwrFocusedItemControl, mwrWindow); + + TdxBarMDIButton = (mdibMinimize, mdibRestore, mdibClose); + TdxBarMDIButtons = set of TdxBarMDIButton; + + TdxBarKind = (bkBarControl, bkBarQuickControl, bkSubMenu); + TdxBarKinds = set of TdxBarKind; + +const + WM_REPAINTBAR = WM_DX + 1; + WM_SYNCHRONIZETHREADS = WM_DX + 2; + + dxBarDefaultButtonArrowWidth = 11; + dxBarDefaultLargeButtonArrowWidth = 13;//4; + dxBarTransparentShadowSize = 4; + dxBarOpaqueShadowSize = 2; + + dxBarItemAllViewLevels = [Low(TdxBarItemRealViewLevel)..High(TdxBarItemRealViewLevel)]; + dxBarItemDefaultPosition = ipBeginsNewRow; + MDIButtonCommands: array[TdxBarMDIButton] of Integer = + (SC_MINIMIZE, SC_RESTORE, SC_CLOSE); + dxBarKindAny = [Low(TdxBarKind)..High(TdxBarKind)]; + +type + TCustomdxBarControl = class; + TCustomdxBarControlClass = class of TCustomdxBarControl; + TCustomdxBarControlDesignHelper = class; + TCustomdxBarControlDesignHelperClass = class of TCustomdxBarControlDesignHelper; + TCustomdxBarControlViewInfo = class; + TCustomdxBarControlViewInfoClass = class of TCustomdxBarControlViewInfo; + TCustomdxBarSubItem = class; + TdxBar = class; + TdxBarAccessibilityHelper = class; + TdxBarCustomApplicationMenu = class; + TdxBarButton = class; + TdxBarApplicationMenuButtonItem = class; + TdxBarButtonLikeControl = class; + TdxBarCaptionButtons = class; + TdxBarComponentList = class; + TdxBarControl = class; + TdxBarControlClass = class of TdxBarControl; + TdxBarCustomizingPopup = class; + TdxBarCustomEditControl = class; + TdxBarCustomStaticControl = class; + TdxBarDockControl = class; + TdxBarDockControlClass = class of TdxBarDockControl; + TdxBarEditControl = class; + TdxBarItem = class; + TdxBarItemClass = class of TdxBarItem; + TdxBarItemControl = class; + TdxBarItemControlClass = class of TdxBarItemControl; + TdxBarItemControlViewInfo = class; + TdxBarItemLink = class; + TdxBarItemLinks = class; + TdxBarItemLinksClass = class of TdxBarItemLinks; + TdxBarManager = class; + TdxBarPainter = class; + TdxBarPainterClass = class of TdxBarPainter; + TdxBarPopupMenu = class; + TdxBarPopupMenuLink = class; + TdxBarQuickControl = class; + TdxBarExtraPaneListItem = class; + TdxBars = class; + TdxBarShadow = class; + TdxBarSubItem = class; + TdxBarSubMenuControl = class; + TdxDockControl = class; + TdxDockRow = class; + TdxObjectList = class; + TdxBarScreenTip = class; + TdxBarCustomHintViewInfo = class; + TdxBarCustomHintViewInfoClass = class of TdxBarCustomHintViewInfo; + TdxBarScreenTipViewInfo = class; + TdxBarScreenTipCollection = class; + TdxBarScreenTipBand = class; + TdxBarScreenTipBandViewInfo = class; + TdxBarHintWindow = class; + TdxBarHintWindowClass = class of TdxBarHintWindow; + TdxBarScreenTipRepository = class; + + TdxBarItemSeparatorKind = (skHorizontal, skVertical); + + TdxBarItemSeparatorData = record + AssociatedItemControl: TObject; + Bounds: TRect; + Kind: TdxBarItemSeparatorKind; + end; + + {-------------------------- + Nonvisual components + --------------------------} + TdxBarSelectionStatus = (ssUnselected, ssActiveSelected, ssInactiveSelected); + TdxBarSelectionOperation = (soAdd, soExclude, soExclusive); + TdxBarCustomizationAction = (caReset, caDelete, caDeleteItem, caDeleteLink, + caChangeCaption, caChangeButtonPaintStyle, caChangePosition, caChangeViewLevels, + caChangeButtonGroup, caChangeBeginGroup, caChangeVisible, caChangeRecentList); + TdxBarCustomizationActions = set of TdxBarCustomizationAction; + + IdxBarSelectableItem = interface + ['{6DCCAA42-48D0-4D7D-BEDF-1EADC2197131}'] + function CanDelete(ADestruction: Boolean = False): Boolean; + procedure DeleteSelection(var AReference: IdxBarSelectableItem; ADestruction: Boolean); + procedure ExecuteCustomizationAction(ABasicAction: TdxBarCustomizationAction); + function GetBarManager: TdxBarManager; + function GetInstance: TPersistent; + procedure GetMasterObjects(AList: TdxObjectList); + function GetNextSelectableItem: IdxBarSelectableItem; + function GetSelectableParent: TPersistent; + function GetSelectionStatus: TdxBarSelectionStatus; + function GetSupportedActions: TdxBarCustomizationActions; + procedure Invalidate; + function IsComplex: Boolean; + function IsComponentSelected: Boolean; + procedure SelectComponent(ASelectionOperation: TdxBarSelectionOperation = soExclusive); + function SelectParentComponent: Boolean; + procedure SelectionChanged; + end; + + IdxBarDesigner = interface + ['{B364658F-B4CE-46C3-83D5-D537F34B9482}'] + function CanDeleteComponent(AComponent: TComponent): Boolean; + procedure GetSelection(AList: TList); + function GetSelectionStatus(AComponent: TPersistent): TdxBarSelectionStatus; + function IsComponentSelected(AComponent: TPersistent): Boolean; + procedure SelectComponent(AComponent: TPersistent; ASelectionOperation: TdxBarSelectionOperation = soExclusive); + procedure SetSelection(AList: TList); + procedure ShowDefaultEventHandler(AItem: TdxBarItem); + function UniqueName(const BaseName: string): string; + end; + + IdxBarLinksOwner = interface + ['{1CB4E538-769E-45F4-9BE3-20814F440106}'] + function CanContainItem(AItem: TdxBarItem; out AErrorText: string): Boolean; + function CreateBarControl: TCustomdxBarControl; + function GetInstance: TComponent; + function GetItemLinks: TdxBarItemLinks; + end; + + IdxBarSubMenuOwner = interface + ['{218A3250-D279-44EA-9E87-3D5443B3C0ED}'] + function GetBarSize: Integer; + procedure DoPaintBar(ACanvas: TCanvas; const R: TRect); + end; + + IdxBarMultiColumnItemControlViewInfo = interface + ['{B92D58D1-3251-4816-A43F-D4D4AF2F02EE}'] + function CanCollapse: Boolean; + function GetCollapsed: Boolean; + function GetColumnCount: Integer; + function GetMaxColumnCount: Integer; + function GetMinColumnCount: Integer; + function GetWidthForColumnCount(AColumnCount: Integer): Integer; + procedure SetCollapsed(Value: Boolean); + procedure SetColumnCount(Value: Integer); + end; + + IdxBarItemControlViewInfo = interface + ['{99C4A703-E6D2-43AF-987E-F5DA81718295}'] + procedure CalculateFinalize; + function GetAlign: TdxBarItemAlign; + function GetAllowedViewLevels: TdxBarItemViewLevels; + function GetBounds: TRect; + function GetColumnRowCount: Integer; + function GetPosition: TdxBarItemPosition; + function GetPositionInButtonGroup: TdxBarButtonGroupPosition; + function GetRealPositionInButtonGroup: TdxBarButtonGroupRealPosition; + function GetRow: Integer; + function GetViewLevel: TdxBarItemViewLevel; + function GetViewLevelForButtonGroup: TdxBarItemRealViewLevel; + function GetWidth(AViewLevel: TdxBarItemRealViewLevel): Integer; + function HasSeparator: Boolean; + function IsMultiColumnItemControl(ACheckCollapsed: Boolean; + out AIMultiColumnItemControlViewInfo: IdxBarMultiColumnItemControlViewInfo): Boolean; + procedure SetBounds(const Value: TRect); + procedure SetColumnRowCount(Value: Integer); + procedure SetRealPositionInButtonGroup(Value: TdxBarButtonGroupRealPosition); + procedure SetRow(Value: Integer); + procedure SetViewLevel(Value: TdxBarItemViewLevel); + end; + + IdxBarHintKeeper = interface + ['{587A00C4-A7E0-4032-98E5-4DB8F3918ADF}'] + function DoHint(var ANeedDeactivate: Boolean; out AHintText: string; out AShortCut: string): Boolean; + function CreateHintViewInfo(const AHintText, AShortCut: string): TdxBarCustomHintViewInfo; + function GetEnabled: Boolean; + function GetHintPosition(const ACursorPos: TPoint; AHeight: Integer): TPoint; + end; + + IdxBarKeyTipWindowsManager = interface + ['{ABA47F3E-5F8B-4A4B-863F-B70AC02F3C1D}'] + procedure Add(const ACaption: string; const ABasePoint: TPoint; + AHorzAlign: TAlignment; AVertAlign: TcxAlignmentVert; AEnabled: Boolean; + out AWindow: TObject); + procedure Delete(AWindow: TObject); + procedure Show; + end; + + { TdxBarKeyTipInfo } + + TdxBarKeyTipInfo = record + KeyTip: string; + BasePoint: TPoint; + HorzAlign: TAlignment; + VertAlign: TcxAlignmentVert; + Visible: Boolean; + Enabled: Boolean; + OnExecute: TNotifyEvent; + end; + + { TdxBarKeyTipData } + + TdxBarKeyTipData = class + private + FKeyTipInfo: TdxBarKeyTipInfo; + FKeyTipWindow: TObject; + function GetNormalizedKeyTip: string; + public + constructor Create(const AKeyTipInfo: TdxBarKeyTipInfo); + procedure HideKeyTipWindow(AKeyTipWindowsManager: IdxBarKeyTipWindowsManager); + procedure ShowKeyTipWindow(AKeyTipWindowsManager: IdxBarKeyTipWindowsManager); + + property BasePoint: TPoint read FKeyTipInfo.BasePoint; + property Enabled: Boolean read FKeyTipInfo.Enabled; + property HorzAlign: TAlignment read FKeyTipInfo.HorzAlign; + property KeyTip: string read FKeyTipInfo.KeyTip write FKeyTipInfo.KeyTip; + property NormalizedKeyTip: string read GetNormalizedKeyTip; + property VertAlign: TcxAlignmentVert read FKeyTipInfo.VertAlign; + property Visible: Boolean read FKeyTipInfo.Visible write FKeyTipInfo.Visible; + property OnExecute: TNotifyEvent read FKeyTipInfo.OnExecute; + end; + + IdxBarAccessibilityHelper = interface(IcxAccessibilityHelper) + ['{5AE17753-A04D-4496-B5A3-08B2CEDE40F7}'] + function AreKeyTipsSupported( + out AKeyTipWindowsManager: IdxBarKeyTipWindowsManager): Boolean; + function CanNavigateToChildren(AKey: Word): Boolean; + function GetBarHelper: TdxBarAccessibilityHelper; + function GetBarManager: TdxBarManager; + function GetDefaultAccessibleObject: IdxBarAccessibilityHelper; + function GetNextAccessibleObject( + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; + function GetRootAccessibleObject: IdxBarAccessibilityHelper; + function HandleNavigationKey(var AKey: Word): Boolean; + function IsNavigationKey(AKey: Word): Boolean; + function IsSelected: Boolean; + function LogicalNavigationGetNextAccessibleObject(AGoForward: Boolean): IdxBarAccessibilityHelper; + procedure Select(ASetFocus: Boolean); + procedure Unselect(ANextSelectedObject: IdxBarAccessibilityHelper); + end; + + IdxBarAccessibleObject = interface + ['{6411B5B8-FFF8-42BD-BFD4-0B53151C97DC}'] + function GetAccessibilityHelper: IdxBarAccessibilityHelper; + end; + + IdxSkin = interface + ['{ABCD2B3A-5F77-45A1-ADE2-3C028D4DB64C}'] + procedure DrawBackground(DC: HDC; const ARect: TRect; APart: Integer; AState: Integer = 0); + procedure DrawCaption(DC: HDC; const ACaption: string; const ARect: TRect; + APart: Integer; AState: Integer = 0); + function GetCaptionRect(const ARect: TRect; APart: Integer): TRect; + function GetContentOffsets(APart: Integer): TRect; + function GetName: string; + function GetPartColor(APart: Integer; AState: Integer = 0): TColor; + function GetPartOffset(APart: Integer): Integer; + end; + + { TdxBarPersistent } + + TdxBarPersistent = class(TPersistent) + private + FBarManager: TdxBarManager; + protected + function GetOwner: TPersistent; override; + public + constructor Create(ABarManager: TdxBarManager); virtual; + property BarManager: TdxBarManager read FBarManager; + end; + +{$IFNDEF DELPHI6} + TComponentList = class(Contnrs.TComponentList) + public + destructor Destroy; override; + end; +{$ENDIF} + + { TdxBarControlEditors } + + TdxBarControlEditor = class + protected + class function GetAddedItemClass(const AAddedItemName: string): TdxBarItemClass; virtual; + class function GetPopupItemCaption: string; virtual; + class procedure InitializePopupItem(AItemLink: TdxBarItemLink); virtual; + class function PopupItemClass: TdxBarItemClass; virtual; + + class procedure AddItem(AClickedButton: TdxBarButton); + class procedure InitializeAddedItem(AItemLink: TdxBarItemLink; AAddedItemName: string); virtual; + class procedure OnButtonClick(Sender: TObject); + public + class procedure InitCustomizationPopup(AItemLinks: TdxBarItemLinks); virtual; + end; + TdxBarControlEditorClass = class of TdxBarControlEditor; + + TdxAddSubItemEditor = class(TdxBarControlEditor) + protected + class function GetAddedItemClass(const AAddedItemName: string): TdxBarItemClass; override; + class function GetPopupItemCaption: string; override; + class procedure InitializePopupItem(AItemLink: TdxBarItemLink); override; + class function PopupItemClass: TdxBarItemClass; override; + end; + + TdxAddButtonEditor = class(TdxAddSubItemEditor) + protected + class function GetAddedItemClass(const AAddedItemName: string): TdxBarItemClass; override; + class function GetPopupItemCaption: string; override; + end; + + TdxAddSeparatorEditor = class(TdxAddSubItemEditor) + protected + class function GetAddedItemClass(const AAddedItemName: string): TdxBarItemClass; override; + class function GetPopupItemCaption: string; override; + end; + + TdxItemsEditorEx = class(TdxBarControlEditor) + protected + class procedure InitSubItem(AItemLinks: TdxBarItemLinks); virtual; + class function GetAddedItemClass(const AAddedItemName: string): TdxBarItemClass; override; + class function GetPopupItemCaption: string; override; + class procedure InitializePopupItem(AItemLink: TdxBarItemLink); override; + class function PopupItemClass: TdxBarItemClass; override; + end; + + { TdxBarCustomizingPopup } + + TdxChangeViewLevelAction = (vlaChangeLargeIconWithText, vlaChangeSmallIconWithText, + vlaChangeSmallIcon, vlaChangeControl, vlaSetAll, vlaSetLargeIconWithTextOnly, + vlaSetSmallIconWithTextOnly, vlaSetSmallIconOnly, vlaControlOnly); + + TdxChangeButtonGroupAction = (bgaNone, bgaStart, bgaMember, bgaGroup, bgaUngroup); + + { TdxBarDesignController } + + TdxDesignState = (dsKeyAlreadyProcessed); + TdxDesignStates = set of TdxDesignState; + TInitPopupProc = procedure (AItemLinks: TdxBarItemLinks) of object; + + TdxBarDesignController = class(TcxDesignController) + private + FCustomizingBarControl: TCustomdxBarControl; + FCustomizingBarManager: TdxBarManager; + FCustomizingItemLink: TdxBarItemLink; + FCustomizingItemLinks: TdxBarItemLinks; + FInternalItems: TComponentList; + FRegisteredBarControlDesignHelpers: TcxRegisteredClassList; + FRegisteredBarControlEditors: TList; + + FLastSelectedItem: IdxBarSelectableItem; + + FCustomizationPopup: TdxBarCustomizingPopup; + FQuickControl: TdxBarControl; + + FNotifyComponent: TcxFreeNotificator; + + function CanDeleteSelectedObjects: Boolean; + procedure GetSelection(ASelection: TdxObjectList); + function IsObjectUnbound(AObject: TObject; AMasterObjects: TdxObjectList): Boolean; + procedure RemoveIrrelevantObjectsForDelete(ASelection: TdxObjectList; ADestruction: Boolean = False); + + procedure ClearOwnedItems(AItemLinks: TdxBarItemLinks); + + procedure CustomizeItemClick(Sender: TObject); + + // CustomizationPopup + procedure TextItemChange(Sender: TObject); + procedure CustomizationPopupCloseUp(Sender: TObject); + procedure CustomizationPopupDestroy(Sender: TObject); + procedure CustomizationPopupItemClick(Sender: TObject); + procedure InitCustomizationPopup(AItemLinks: TdxBarItemLinks); + procedure SynchronizeAction(ABasicAction: TdxBarCustomizationAction); + procedure UpdateViewLevelsSubItemButtonStates(AItemLinks: TdxBarItemLinks); + + // ToolbarsPopup + procedure ToolbarsPopupClick(Sender: TObject); + + // QuickControl + procedure QuickControlDestroy(Sender: TObject); + + function CanCustomize(ABarManager: TdxBarManager; AIsKeyboardAction: Boolean): Boolean; + procedure FindCustomizingBarManager; + procedure SetLastSelectedItem(Value: IdxBarSelectableItem); + + procedure FreeNotification(AComponent: TComponent); + protected + FDesignStates: TdxDesignStates; + public + constructor Create; + destructor Destroy; override; + + procedure AddCustomizeItem(AItemLinks: TdxBarItemLinks; + AItemClass: TdxBarItemClass; ABeginGroup: Boolean = True); + function AddInternalItem(AItemLinks: TdxBarItemLinks; + AItemClass: TdxBarItemClass; ACaption: string; AOnClick: TNotifyEvent = nil; + ATag: Integer = 0; ABeginGroup: Boolean = False): TdxBarItemLink; overload; + procedure AddInternalItem(AItem: TdxBarItem; AList: TList = nil); overload; + procedure ClearInternalItems; + procedure RemoveItemFromBarManagerList(AItem: TdxBarItem); + + function AddItem(ABarItemClass: TdxBarItemClass): TdxBarItemLink; + procedure SelectItemLink(AItemLink: TdxBarItemLink); + + procedure DesignerModified; overload; + + function IsCustomizedByPopup: Boolean; + procedure RegisterBarControlDesignHelper(ABarControlClass: TCustomdxBarControlClass; + AHelperClass: TCustomdxBarControlDesignHelperClass); + procedure RegisterBarControlEditor(AEditor: TdxBarControlEditorClass); + procedure UnregisterBarControlDesignHelper(ABarControlClass: TCustomdxBarControlClass; + AHelperClass: TCustomdxBarControlDesignHelperClass); + procedure UnregisterBarControlEditor(AEditor: TdxBarControlEditorClass); + + procedure DropSelection(ASelectableItem: IdxBarSelectableItem); + function IsItemCustomized(ASelectableItem: IdxBarSelectableItem): Boolean; + function IsItemLastSelected(ASelectableItem: IdxBarSelectableItem): Boolean; + function IsItemLinkCustomized: Boolean; + function IsItemSingleSelected(ASelectableItem: IdxBarSelectableItem): Boolean; + function IsSelectionComplex(ABarManager: TdxBarManager): Boolean; + function IsSelectionSingle(ABarManager: TdxBarManager): Boolean; + function NeedDefaultSelection(ASelectableItem: IdxBarSelectableItem): Boolean; + procedure SelectItem(ASelectableItem: IdxBarSelectableItem; + ASelectionOperation: TdxBarSelectionOperation = soExclusive); + procedure SelectObject(AObject: TPersistent; + ASelectionOperation: TdxBarSelectionOperation = soExclusive); + procedure SynchronizeLastSelectedItem; + + function DeleteSelectedObjects(ADestruction, AIsKeyboardAction: Boolean): Boolean; + procedure DeleteCustomizingItem; + procedure DeleteCustomizingItemLink; + function SelectParentComponent: Boolean; + + // CustomCustomizePopup + procedure ShowCustomCustomizePopup(ABarManager: TdxBarManager; + AInitPopupProc: TInitPopupProc; APainter: TdxBarPainter; + ACustomizingBarControl: TCustomdxBarControl = nil; ACustomizingItemLink: TdxBarItemLink = nil); + // CustomizePopup + procedure ShowCustomizePopup(ABarControl: TCustomdxBarControl; + ACustomizingItemLink: TdxBarItemLink); + procedure SetCustomizePopupTopMosts(AShow: Boolean); + + // ToolbarsPopup + procedure InitToolBarPopup(AItemLinks: TdxBarItemLinks); + procedure ShowToolbarsPopup(ABarManager: TdxBarManager; APainter: TdxBarPainter); + + // QuickControl + procedure ShowQuickControl(ABarControl: TdxBarControl; AOwnerRect: TRect); + + property CustomizingBarControl: TCustomdxBarControl read FCustomizingBarControl; + property CustomizingItemLink: TdxBarItemLink read FCustomizingItemLink; + property CustomizingBarManager: TdxBarManager read FCustomizingBarManager; + property LastSelectedItem: IdxBarSelectableItem read FLastSelectedItem write SetLastSelectedItem; + property QuickControl: TdxBarControl read FQuickControl; + end; + + { TdxBarCanvas } + + TdxBarCanvasState = record + PrevCanvas: TCanvas; + PrevDC: THandle; + NewDC: THandle; + NewDCIndex: Integer; + end; + TdxBarCanvasStates = array of TdxBarCanvasState; + + TdxBarCanvas = class(TcxCanvas) + private + FCounter: Integer; + FSavedDCs: TdxBarCanvasStates; + function HandleValid: Boolean; + public + constructor Create; reintroduce; + destructor Destroy; override; + procedure BeginPaint(ADC: THandle); overload; + procedure BeginPaint(ACanvas: TCanvas); overload; + procedure EndPaint; + end; + + TdxBarSystemController = class(TcxMessageWindow) +{$IFDEF DELPHI6} + private + FPrevWakeMainThread: TNotifyEvent; + procedure WakeMainThread(Sender: TObject); + procedure HookSynchronizeWakeup; + procedure UnhookSynchronizeWakeup; + protected + procedure WndProc(var Message: TMessage); override; + public + constructor Create; override; + destructor Destroy; override; +{$ENDIF} + end; + + { TdxBarComponent } + + TdxBarItemVisible = (ivNever, ivInCustomizing, ivAlways); + + TdxBarComponent = class(TComponent, {$IFNDEF DELPHI6}IUnknown,{$ENDIF} IdxBarSelectableItem) + protected + FBarManager: TdxBarManager; + FChangeNotifies: TObjectList; + FEnabled: Boolean; + FVisible: TdxBarItemVisible; + + procedure AddChangeNotify(AComponentList: TdxBarComponentList); + procedure RemoveChangeNotify(AComponentList: TdxBarComponentList); + procedure Changed(AllItems: Boolean = False); virtual; + function GetEnabled: Boolean; virtual; abstract; + procedure SetEnabled(Value: Boolean); virtual; abstract; + procedure SetVisible(Value: TdxBarItemVisible); virtual; abstract; + + // IdxBarSelectableItem + function CanDelete(ADestruction: Boolean = False): Boolean; virtual; + procedure DeleteSelection(var AReference: IdxBarSelectableItem; ADestruction: Boolean); virtual; + procedure ExecuteCustomizationAction(ABasicAction: TdxBarCustomizationAction); virtual; + function GetBarManager: TdxBarManager; virtual; + function IdxBarSelectableItem.GetInstance = GetPersistentInstance; + procedure GetMasterObjects(AList: TdxObjectList); virtual; + function GetNextSelectableItem: IdxBarSelectableItem; virtual; + function GetSelectableParent: TPersistent; virtual; + function GetSelectionStatus: TdxBarSelectionStatus; virtual; + function GetSupportedActions: TdxBarCustomizationActions; virtual; + procedure Invalidate; virtual; + function IsComplex: Boolean; virtual; + function IsComponentSelected: Boolean; virtual; + procedure SelectComponent(ASelectionOperation: TdxBarSelectionOperation = soExclusive); virtual; + function SelectParentComponent: Boolean; virtual; + procedure SelectionChanged; virtual; + + function GetPersistentInstance: TPersistent; virtual; + function GetComponentInstance: TComponent; virtual; + + property Enabled: Boolean read GetEnabled write SetEnabled; + property Visible: TdxBarItemVisible read FVisible write SetVisible; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property BarManager: TdxBarManager read GetBarManager; + end; + + { TdxList } + + TdxObjectList = class(TObjectList) + private + procedure AddFromList(ASource, AExcludedList: TList); + protected + procedure CopyList(ASource, ADestination: TList); + function GetItem(AIndex: Integer): TObject; + public + constructor Create; overload; + procedure Add(AObject: TObject); + procedure AddList(AObjects: TList); + procedure CopyFrom(ASource: TList); + procedure CopyTo(ADestination: TList); + procedure XorList(ASourceA, ASourceB: TList); + function First: TObject; + function Last: TObject; + end; + + { TdxComponentList } + + TdxBarListNotifyEvent = procedure (Sender: TObject; AComponent: TComponent; AAction: TListNotification) of object; + TdxBarListChangeEvent = procedure (Sender: TObject; AComponent: TComponent; AAction: TcxComponentCollectionNotification) of object; + + TdxComponentList = class(TComponentList) + private + FUpdateCount: Integer; + FOnComponentListChanged: TdxBarListChangeEvent; + FOnNotify: TdxBarListNotifyEvent; + protected + procedure DoNotify(AItem: TComponent; AAction: TListNotification); virtual; + function GetItemClass: TClass; virtual; + procedure Notify(Ptr: Pointer; Action: TListNotification); override; + procedure Update(AItem: TComponent = nil; AAction: TcxComponentCollectionNotification = ccnChanged); + public + constructor Create; overload; + destructor Destroy; override; + procedure BeginUpdate; + procedure EndUpdate(AForceUpdate: Boolean = True); + property OnComponentListChanged: TdxBarListChangeEvent read FOnComponentListChanged write FOnComponentListChanged; + property OnNotify: TdxBarListNotifyEvent read FOnNotify write FOnNotify; + end; + + { TdxBarComponentList } + + TdxBarComponentList = class(TdxComponentList) + protected + procedure DoNotify(AItem: TComponent; AAction: TListNotification); override; + function GetItemClass: TClass; override; + end; + + { TdxBarGroup } + + TdxBarGroup = class(TdxBarComponent) + private + FItems: TdxBarComponentList; + FItemsNames: TStringList; + function GetCount: Integer; + function GetIndex: Integer; + function GetItem(Index: Integer): TComponent; + + function InternalGetCount: Integer; + function InternalGetItemName(Index: Integer): string; + + procedure SetIndex(Value: Integer); + procedure ReadItems(Reader: TReader); + procedure WriteItems(Writer: TWriter); + protected + procedure DefineProperties(Filer: TFiler); override; + function GetEnabled: Boolean; override; + procedure Loaded; override; + procedure SetName(const NewName: TComponentName); override; + procedure SetEnabled(Value: Boolean); override; + procedure SetVisible(Value: TdxBarItemVisible); override; + property ItemList: TdxBarComponentList read FItems; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function GetParentComponent: TComponent; override; + function HasParent: Boolean; override; + procedure SetParentComponent(AParent: TComponent); override; + + procedure Add(AItem: TdxBarComponent); + procedure Delete(Index: Integer); + function IndexOf(AItem: TdxBarComponent): Integer; + procedure Move(FromIndex, ToIndex: Integer); + procedure Remove(AItem: TdxBarComponent); + + property Count: Integer read GetCount; + property Index: Integer read GetIndex write SetIndex; + property Items[Index: Integer]: TComponent read GetItem; default; + published + property Enabled default True; + property Visible default ivAlways; + end; + + TdxBarPopupMenuLinkActionEvent = procedure(Sender: TdxBarPopupMenuLink; var X, Y: Integer; + ClickedByMouse: Boolean; var AllowPopup: Boolean) of object; + + TdxBarPopupMenuLink = class(TCollectionItem) + private + FControl: TControl; + FPopupMenu: TdxBarPopupMenu; + FPrevWndProc: TWndMethod; + FProcessChildren: Boolean; + FOnAction: TdxBarPopupMenuLinkActionEvent; + + FPrevOnContextPopup: TContextPopupEvent; + + function GetBarManager: TdxBarManager; + function GetWinControl: TWinControl; + procedure SetControl(Value: TControl); + procedure SetPopupMenu(Value: TdxBarPopupMenu); + procedure ContextPopup(Sender: TObject; MousePos: TPoint; var Handled: Boolean); + property WinControl: TWinControl read GetWinControl; + protected + function DoAction(AClientPopupPoint: TPoint): Boolean; overload; + function IsShortCut(AShortCut: TShortCut): Boolean; + procedure NewWndProc(var Message: TMessage); + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function DoAction(Wnd: HWND; const P: TPoint): Boolean; overload; + property BarManager: TdxBarManager read GetBarManager; + published + property Control: TControl read FControl write SetControl; + property PopupMenu: TdxBarPopupMenu read FPopupMenu write SetPopupMenu; + property ProcessChildren: Boolean read FProcessChildren write FProcessChildren default True; + property OnAction: TdxBarPopupMenuLinkActionEvent read FOnAction write FOnAction; + end; + + TdxBarPopupMenuLinks = class(TCollection) + private + FBarManager: TdxBarManager; + function GetItem(Index: Integer): TdxBarPopupMenuLink; + procedure SetItem(Index: Integer; Value: TdxBarPopupMenuLink); + protected + function GetOwner: TPersistent; override; + function IsShortCut(AControl: TWinControl; AShortCut: TShortCut): Boolean; + public + constructor Create(ABarManager: TdxBarManager); + function Add: TdxBarPopupMenuLink; + function DoAction(AControl: TWinControl; Wnd: HWND; const P: TPoint): Boolean; + property BarManager: TdxBarManager read FBarManager; + property Items[Index: Integer]: TdxBarPopupMenuLink read GetItem write SetItem; default; + end; + + TdxBarBackgrounds = class(TdxBarPersistent) + private + FBarBackgroundBitmap: TBitmap; + FSubMenuBackgroundBitmap: TBitmap; + procedure BitmapChanged(Sender: TObject); + procedure SetBarBackgroundBitmap(Value: TBitmap); + procedure SetSubMenuBackgroundBitmap(Value: TBitmap); + protected + procedure Changed; + public + constructor Create(ABarManager: TdxBarManager); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + published + property Bar: TBitmap read FBarBackgroundBitmap write SetBarBackgroundBitmap; + property SubMenu: TBitmap read FSubMenuBackgroundBitmap write SetSubMenuBackgroundBitmap; + end; + + TdxBarDockingStyle = (dsNone, dsLeft, dsTop, dsRight, dsBottom); + TdxBarDockingStyles = set of TdxBarDockingStyle; + TdxBarDockedDockingStyle = dsLeft..dsBottom; + TdxBarManagerStyle = (bmsStandard, bmsEnhanced, bmsFlat, bmsXP, bmsOffice11, + bmsUseLookAndFeel); + TdxBarRealPaintStyle = (rpsStandard, rpsEnhanced, rpsFlat, rpsXP, rpsOffice11, rpsSkin); + TdxBarMenuAnimations = (maNone, maRandom, maUnfold, maSlide, maFade); + TdxBarEvent = procedure(Sender: TdxBarManager; ABar: TdxBar) of object; + TdxBarItemLinkEvent = procedure(Sender: TdxBarManager; AItemLink: TdxBarItemLink) of object; + TdxBarVisibleChangeEvent = procedure(Sender: TdxBarManager; ABar: TdxBar) of object; + TdxBarCanDockingEvent = procedure(Sender: TdxBar; Style: TdxBarDockingStyle; + DockControl: TdxDockControl; var CanDocking: Boolean) of object; + TdxBarShowPopupEvent = procedure(Sender: TdxBarManager; PopupItemLinks: TdxBarItemLinks) of object; + TdxBarClickItemEvent = procedure(Sender: TdxBarManager; ClickedItem: TdxBarItem) of object; + TdxBarIniFileEvent = procedure(Sender: TObject; AIniFile: TCustomIniFile; + const ADelimiter: string; const ASection: string) of object; + + TdxBarItemMergeKind = (mkAdd, mkMergeByCaption, mkNone); + TdxBarStoringKind = (skIni, skReg); + TdxBarMergeEvent = procedure(Sender, ChildBarManager: TdxBarManager; + AddItems: Boolean) of object; + TdxBarMenuMergeEvent = TdxBarMergeEvent; + TdxBarMergeItemLinkEvent = procedure(Sender: TdxBarManager; + ADstItemLinks, ASrcItemLinks: TdxBarItemLinks; ASrcItemLink: TdxBarItemLink; + var AMergeKind: TdxBarItemMergeKind; var AMergeIndex: Integer) of object; + + TdxBarInternalState = (bisAfterLoading, bisBarsLoading, bisCreating, bisHandleCreating, + bisModalActivating, bisFormActivating, bisToolbarsVisibleChanging, bisWasActive, bisStateSaving); + TdxBarInternalStates = set of TdxBarInternalState; + + TdxBarMDIStateChange = (scChildActivated, scChildDeactivated, scMaximizedChanged); + + TdxBarDraggingState = (dsNoDrag, dsNoDrop, dsBeginGroup, dsCategory, dsCopy, dsDrag); + + TdxBarItemSeparatorInfo = record + Bounds: TRect; + Kind: TdxBarItemSeparatorKind; + end; + + TdxBarIniFileEventData = record + IniFile: TCustomIniFile; + StoringKind: TdxBarStoringKind; + BaseSection: string; + Delimiter: string; + end; + + TdxBarMDIStateChangeEventData = record + Change: TdxBarMDIStateChange; + Wnd: HWND; + end; + + TCustomdxBarControlViewInfo = class + private + FItemControlViewInfos: TList; + FSeparatorsData: array of TdxBarItemSeparatorData; + function GetItemControlCount: Integer; + function GetItemControlViewInfo(AIndex: Integer): TdxBarItemControlViewInfo; + function GetSeparatorCount: Integer; + function GetSeparatorInfo(AIndex: Integer): TdxBarItemSeparatorInfo; + procedure SetSeparatorInfo(AIndex: Integer; const Value: TdxBarItemSeparatorInfo); + protected + FBarControl: TCustomdxBarControl; + procedure AddItemControlViewInfo(AViewInfo: TdxBarItemControlViewInfo); + procedure AddSeparatorInfo(const ARect: TRect; AKind: TdxBarItemSeparatorKind; + AAssociatedItemControl: TdxBarItemControl); + procedure Clear; virtual; + procedure RemoveItemControlViewInfo(AViewInfo: TdxBarItemControlViewInfo); + procedure RemoveSeparatorInfos; + public + constructor Create(ABarControl: TCustomdxBarControl); virtual; + destructor Destroy; override; + procedure Calculate; virtual; + function GetItemControlIndex(AItemControl: TdxBarItemControl): Integer; + function IsAssociatedWithSeparator(AItemControl: TdxBarItemControl; + out ASeparatorIndex: Integer): Boolean; + function IsItemControlVisible(AItemControl: TdxBarItemControl): Boolean; + property BarControl: TCustomdxBarControl read FBarControl; + property ItemControlCount: Integer read GetItemControlCount; + property ItemControlViewInfos[AIndex: Integer]: TdxBarItemControlViewInfo read GetItemControlViewInfo; + property SeparatorCount: Integer read GetSeparatorCount; + property SeparatorInfos[AIndex: Integer]: TdxBarItemSeparatorInfo + read GetSeparatorInfo write SetSeparatorInfo; + end; + + TdxBarDragInfo = class + private + FBarManager: TdxBarManager; + FLockCount: Integer; + FModified: Boolean; + + FCaptureWnd: HWND; + + FDefaultCursor: TCursor; + FDragDownPoint: TPoint; + + FDragLineVisible: Boolean; + FDragLineBarControlLink: TcxObjectLink; + FDragLineFirstPart: Boolean; + FDragLineRect: TRect; + FDragLineVerticalDirection: Boolean; + + FDraggingItem: TdxBarItem; + FDraggingItemLink: TdxBarItemLink; + FDraggingItemLinkParentHandle: HWND; + FDraggingState: TdxBarDraggingState; + + FDragOverFirstPart: Boolean; + FDragOverBeginGroup: Boolean; + FDragOverVerticalDirection: Boolean; + FDragOverBarControlLink: TcxObjectLink; + FDragOverItemLink: TdxBarItemLink; + + procedure CalcDragOverItemParameters(var ACursorPos: TPoint); + function CategoriesList: TListBox; + procedure DragInfoChanged; + procedure DrawDraggingLine(AVisible: Boolean); + function HasTarget: Boolean; + function IsDragCopy: Boolean; + function NoNeedDragLine: Boolean; + + procedure ChangeBeginGroup; + procedure CreateNewItemLink; + procedure DeleteDraggingItemLink; + procedure InternalDrawDraggingLine; + procedure MoveItemToAnotherCategory; + + function GetDraggingControl: TdxBarItemControl; + function GetDragLineBarControl: TCustomdxBarControl; + function GetDragOverBarControl: TCustomdxBarControl; + function GetDragOverBarItemLinks: TdxBarItemLinks; + function GetDragOverItemControl: TdxBarItemControl; + procedure SetDraggingState(Value: TdxBarDraggingState); + procedure SetDragLineBarControl(Value: TCustomdxBarControl); + procedure SetDragOverBarControl(Value: TCustomdxBarControl); + procedure SetDragOverBeginGroup(Value: Boolean); + procedure SetDragOverFirstPart(Value: Boolean); + procedure SetDragOverVerticalDirection(Value: Boolean); + procedure SetDragOverItemLink(Value: TdxBarItemLink); + + property DragLineBarControl: TCustomdxBarControl read GetDragLineBarControl write SetDragLineBarControl; + public + constructor Create(ABarManager: TdxBarmanager); + destructor Destroy; override; + procedure BeginDrag(AItem: TdxBarItem; AItemLink: TdxBarItemLink); + procedure DragDrop; + procedure EndDrag; + procedure HandleDragging; + + procedure BeginUpdate; + procedure EndUpdate; + + property DraggingControl: TdxBarItemControl read GetDraggingControl; + property DraggingItem: TdxBarItem read FDraggingItem write FDraggingItem; + property DraggingItemLink: TdxBarItemLink read FDraggingItemLink write FDraggingItemLink; + property DraggingState: TdxBarDraggingState read FDraggingState write SetDraggingState; + + property DragOverBeginGroup: Boolean read FDragOverBeginGroup write SetDragOverBeginGroup; + property DragOverFirstPart: Boolean read FDragOverFirstPart write SetDragOverFirstPart; + property DragOverVerticalDirection: Boolean read FDragOverVerticalDirection write SetDragOverVerticalDirection; + + property DragOverBarControl: TCustomdxBarControl read GetDragOverBarControl write SetDragOverBarControl; + property DragOverBarItemLinks: TdxBarItemLinks read GetDragOverBarItemLinks; + property DragOverItemControl: TdxBarItemControl read GetDragOverItemControl; + property DragOverItemLink: TdxBarItemLink read FDragOverItemLink write SetDragOverItemLink; + property DraggingItemLinkParentHandle: HWND read FDraggingItemLinkParentHandle write FDraggingItemLinkParentHandle; + end; + + TdxBarImageOptions = class(TdxBarPersistent) + private + FDisabledImages: TCustomImageList; + FDisabledLargeImages: TCustomImageList; + FHotImages: TCustomImageList; + FImages: TCustomImageList; + FLargeImages: TCustomImageList; + + FImagesChangeLink: TChangeLink; + FLargeImagesChangeLink: TChangeLink; + FHotImagesChangeLink: TChangeLink; + FDisabledImagesChangeLink: TChangeLink; + FDisabledLargeImagesChangeLink: TChangeLink; + + FCacheGlyphs: Boolean; + FGlyphSize: Integer; + FImageListBkColor: TColor; + FLargeIcons: Boolean; + FMakeDisabledImagesFaded: Boolean; + FSmoothGlyphs: Boolean; + FStretchGlyphs: Boolean; + FUseLargeImagesForLargeIcons: Boolean; + FUseLeftBottomPixelAsTransparent: Boolean; + + FOnImageOptionsChange: TNotifyEvent; + FOnLargeIconsChange: TNotifyEvent; + + FNotifyComponent: TcxFreeNotificator; + + function GetIsLoading: Boolean; + procedure SetImageList(var ANewValue, AOldValue: TCustomImageList; const AChangeLink: TChangeLink); + procedure SetHotImages(Value: TCustomImageList); + procedure SetImageListBkColor(Value: TColor); + procedure SetImages(Value: TCustomImageList); + procedure SetDisabledImages(Value: TCustomImageList); + procedure SetDisabledLargeImages(Value: TCustomImageList); + procedure SetLargeIcons(Value: Boolean); + procedure SetLargeImages(Value: TCustomImageList); + procedure SetMakeDisabledImagesFaded(Value: Boolean); + procedure SetUseLargeImagesForLargeIcons(Value: Boolean); + procedure SetUseLeftBottomPixelAsTransparent(Value: Boolean); + + procedure CalcGlyphSize; + function IsLargeImagesForLargeIcons: Boolean; + procedure FreeNotification(AComponent: TComponent); + protected + property IsLoading: Boolean read GetIsLoading; + public + constructor Create(ABarManager: TdxBarManager); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + property GlyphSize: Integer read FGlyphSize; + published + property CacheGlyphs: Boolean read FCacheGlyphs write FCacheGlyphs default True; + property DisabledImages: TCustomImageList read FDisabledImages write SetDisabledImages; + property DisabledLargeImages: TCustomImageList read FDisabledLargeImages write SetDisabledLargeImages; + property HotImages: TCustomImageList read FHotImages write SetHotImages; + property ImageListBkColor: TColor read FImageListBkColor write SetImageListBkColor default clFuchsia; + property Images: TCustomImageList read FImages write SetImages; + property LargeImages: TCustomImageList read FLargeImages write SetLargeImages; + property LargeIcons: Boolean read FLargeIcons write SetLargeIcons default False; + property MakeDisabledImagesFaded: Boolean read FMakeDisabledImagesFaded write SetMakeDisabledImagesFaded default False; + property SmoothGlyphs: Boolean read FSmoothGlyphs write FSmoothGlyphs default False; + property StretchGlyphs: Boolean read FStretchGlyphs write FStretchGlyphs default True; + property UseLargeImagesForLargeIcons: Boolean read FUseLargeImagesForLargeIcons write SetUseLargeImagesForLargeIcons default False; + property UseLeftBottomPixelAsTransparent: Boolean read FUseLeftBottomPixelAsTransparent write SetUseLeftBottomPixelAsTransparent default True; + end; + + TdxBarItemChangeProc = procedure (AItem: TdxBarItem) of object; + + TdxBarManager = class(TComponent, {$IFNDEF DELPHI6}IUnknown,{$ENDIF} IdxBarDesigner, IdxSkinSupport) + private + FAllowCallFromAnotherForm: Boolean; + FAllowReset: Boolean; + FAlwaysMerge: Boolean; + FAlwaysSaveText: Boolean; + FAutoAlignBars: Boolean; + FAutoDockColor: Boolean; + FAutoHideEmptyBars: Boolean; + FBackgrounds: TdxBarBackgrounds; + FBarCaptionFont: TFont; + FBarRestoringList: TList; + FBars: TdxBars; + FButtonArrowWidth: Integer; + FCanCustomize: Boolean; + FChangedSubMenuControl: TdxBarSubMenuControl; + FChangingStyle: Boolean; + FCategories: TStrings; + FDefaultPainter: TdxBarPainter; + FDesignerModifiedInvoked: Boolean; + +// FSelectedLink: TdxBarItemLink; // #DG new + + FDisabledToolBarsList: TList; + FDockColor: TColor; + FDockControls: TList; + + FDragInfo: TdxBarDragInfo; + FImageOptions: TdxBarImageOptions; + + FEditFont: TFont; + FFlatCloseButton: Boolean; + FFlatToolbarsBorderBrush: HBRUSH; + FFlatToolbarsBrush: HBRUSH; + FFlatToolbarsDownedBrush: HBRUSH; + FFlatToolbarsDownedSelBrush: HBRUSH; + FFlatToolbarsSelBrush: HBRUSH; + FFocusedBarControl: TCustomdxBarControl; + FFont: TFont; + + FGroups: TdxBarComponentList; //#DG list + + FHelpButtonGlyph: TBitmap; + FHelpContext: THelpContext; + FHideFloatingBarsWhenInactive: Boolean; + FHintObject: TObject; + FIniFileName: string; + FInternalFontChange: Boolean; + FInternalState: TdxBarInternalStates; + FIsCustomizing: Boolean; + + FInternalItems: TComponentList; + FItems: TdxBarComponentList; //#DG list + + FLargeButtonArrowWidth: Integer; + FLockDesignerModifiedCount: Integer; + FLockUpdate: Boolean; + FLockUpdateCount: Integer; + FLookAndFeel: TcxLookAndFeel; + FMainFormActive: Boolean; + FMainMenuBar: TdxBar; + FMenuAnimations: TdxBarMenuAnimations; + FMenusShowRecentItemsFirst: Boolean; + FModified: Boolean; + FMostRecentItemsPercents: Byte; + FMostRecentlyUsedUseCount: Integer; + FMouseTrackingBarControl: TCustomdxBarControl; + FNewItems: TStringList; + FNotDocking: TdxBarDockingStyles; + FPopupMenuLinks: TdxBarPopupMenuLinks; + FPopupMenus: TComponentList; + FPrevActiveMDIChild: HWND; + FReadStateCount: Integer; + FRegistryPath: string; + + FScaled: Boolean; + + FSelectedItem: TdxBarItemControl; // obsolete + + FShowCloseButton: Boolean; + FShowFullMenusAfterDelay: Boolean; + FShowHelpButton: Boolean; + FShowHint: Boolean; + FShowHintForDisabledItems: Boolean; + FShowShortCutInHint: Boolean; + FStoreInIniFile: Boolean; + FStoreInRegistry: Boolean; + FIniFileStream: TStream; + FStyle: TdxBarManagerStyle; + FSunkenBorder: Boolean; + FThemeAvailable: Boolean; + FThemeChangedNotificator: TdxThemeChangedNotificator; + FThemeToolbarsBrush: HBRUSH; +// FThemeToolbarsDownedBrush: HBRUSH; +// FThemeToolbarsDownedSelBrush: HBRUSH; +// FThemeToolbarsSelBrush: HBRUSH; + FUseF10ForMenu: Boolean; + FUseFullReset: Boolean; + FUseSystemFont: Boolean; + FWaitForDockingTime: Integer; + FIsMDIMaximized: Boolean; + + FSavedState: TMemIniFile; + + FOnBarAdd: TdxBarEvent; + FOnBarAfterReset: TdxBarEvent; + FOnBarBeforeReset: TdxBarEvent; + FOnBarClose: TdxBarEvent; + FOnBarDelete: TdxBarEvent; + FOnBarDockingStyleChange: TdxBarEvent; + FOnBarVisibleChange: TdxBarVisibleChangeEvent; + + FOnItemLinkAdd: TdxBarItemLinkEvent; + FOnItemLinkChange: TdxBarItemLinkEvent; + FOnItemLinkDelete: TdxBarItemLinkEvent; + + FOnCloseButtonClick: TNotifyEvent; + FOnDocking: TdxBarCanDockingEvent; + FOnHelpButtonClick: TNotifyEvent; + FOnHideCustomizingForm: TNotifyEvent; + FOnMenuMerge: TdxBarMenuMergeEvent; + FOnMerge: TdxBarMergeEvent; + FOnMergeItemLink: TdxBarMergeItemLinkEvent; + FOnShowCustomizingForm: TNotifyEvent; + FOnShowCustomizingPopup: TdxBarShowPopupEvent; + FOnShowToolbarsPopup: TdxBarShowPopupEvent; + + FOnClickItem: TdxBarClickItemEvent; + + FReadIniFileHandlers: TcxEventHandlerCollection; + FWriteIniFileHandlers: TcxEventHandlerCollection; + FSystemFontChangedHandlers: TcxEventHandlerCollection; + FMDIStateChangedHandlers: TcxEventHandlerCollection; + + procedure InternalSetSelectedItem(Value: TdxBarItemControl); + + function GetBarControlFocused: Boolean; + function GetBarsLoading: Boolean; + function GetCanModifyDesigner: Boolean; + function GetCategoryItemsVisible(AIndex: Integer): TdxBarItemVisible; + function GetCategoryVisible(AIndex: Integer): Boolean; + function GetDesigning: Boolean; + function GetDockColor: TColor; + function GetDockControl(Index: Integer): TdxDockControl; + function GetDockControlCount: Integer; + function GetDragging: Boolean; + function GetDraggingItem: TdxBarItem; + function GetDraggingItemLink: TdxBarItemLink; + function GetFlat: Boolean; + function GetFlatToolbarsBorderColor: COLORREF; + function GetFlatToolbarsColor: COLORREF; + function GetFlatToolbarsDownedColor: COLORREF; + function GetFlatToolbarsDownedSelColor: COLORREF; + function GetFlatToolbarsSelColor: COLORREF; + function GetGroup(Index: Integer): TdxBarGroup; + function GetGroupCount: Integer; + function GetInternalDockControl(ADockingStyle: TdxBarDockedDockingStyle): TdxDockControl; + function GetIsCustomizing: Boolean; + function GetIsDestroying: Boolean; + function GetIsHandleCreating: Boolean; + function GetIsInitializing: Boolean; + function GetIsLoading: Boolean; + function GetIsRecreating: Boolean; + function GetIsStateSaving: Boolean; + function GetItemCount: Integer; + function GetItem(Index: Integer): TdxBarItem; + function GetLastSelectedLinkAtDesign: TdxBarItemLink; + function GetMainForm: TCustomForm; + function GetMainMenuControl: TdxBarControl; + function GetMasterForm: TCustomForm; + function GetNotDocking: TdxBarDockingStyles; + function GetParentBarManager: TdxBarManager; + function GetParentedOwner: TWinControl; + function GetParentForm: TCustomForm; + function GetRestoringListBar(Index: Integer): TdxBar; + function GetRestoringListBarCount: Integer; + function GetTabOrder: Integer; + procedure IniFileCollectionCallMethods(ACollection: TcxEventHandlerCollection; + AIniFile: TCustomIniFile; AStoringKind: TdxBarStoringKind; ASection: string); + function InternalGetPainterClass: TdxBarPainterClass; + procedure SetAutoAlignBars(Value: Boolean); + procedure SetAutoDockColor(Value: Boolean); + procedure SetAutoHideEmptyBars(Value: Boolean); + procedure SetBackgrounds(Value: TdxBarBackgrounds); + procedure SetButtonArrowWidth(Value: Integer); + procedure SetCategories(Value: TStrings); + procedure SetCategoryItemsVisible(AIndex: Integer; Value: TdxBarItemVisible); + procedure SetCategoryVisible(AIndex: Integer; Value: Boolean); + procedure SetDockColor(Value: TColor); + procedure SetFlatCloseButton(Value: Boolean); + procedure SetFont(Value: TFont); + procedure SetHelpButtonGlyph(Value: TBitmap); + procedure SetHideFloatingBarsWhenInactive(Value: Boolean); + procedure SetDraggingItem(Value: TdxBarItem); + procedure SetDraggingItemLink(Value: TdxBarItemLink); + procedure SetLargeButtonArrowWidth(Value: Integer); + procedure SetLockUpdate(Value: Boolean); + procedure SetLookAndFeel(Value: TcxLookAndFeel); + procedure SetMenuAnimations(Value: TdxBarMenuAnimations); + procedure SetMenusShowRecentItemsFirst(Value: Boolean); + procedure SetMostRecentItemsPercents(Value: Byte); + procedure SetNotDocking(Value: TdxBarDockingStyles); + procedure SetPopupMenuLinks(Value: TdxBarPopupMenuLinks); + procedure SetRegistryPath(Value: string); + procedure SetScaled(Value: Boolean); + procedure SetSelectedItem(Value: TdxBarItemControl); + procedure SetShowCloseButton(Value: Boolean); + procedure SetShowFullMenusAfterDelay(Value: Boolean); + procedure SetShowHelpButton(Value: Boolean); + procedure SetShowHint(Value: Boolean); + procedure SetShowShortCutInHint(Value: Boolean); + procedure SetStyle(Value: TdxBarManagerStyle); + procedure SetSunkenBorder(Value: Boolean); + procedure SetTabOrder(Value: Integer); + procedure SetUseSystemFont(Value: Boolean); + procedure SetWaitForDockingTime(Value: Integer); + + // ImageOptions begin + function GetDisabledImages: TCustomImageList; + function GetDisabledLargeImages: TCustomImageList; + function GetGlyphSize: Integer; + function GetHotImages: TCustomImageList; + function GetImageListBkColor: TColor; + function GetImages: TCustomImageList; + function GetLargeImages: TCustomImageList; + function GetLargeIcons: Boolean; + function GetMainMenuBar: TdxBar; + function GetMakeDisabledImagesFaded: Boolean; + function GetStretchGlyphs: Boolean; + function GetUseLargeImagesForLargeIcons: Boolean; + procedure SetDisabledImages(Value: TCustomImageList); + procedure SetDisabledLargeImages(Value: TCustomImageList); + procedure SetGlyphSize(Value: Integer); + procedure SetHotImages(Value: TCustomImageList); + procedure SetImageListBkColor(Value: TColor); + procedure SetImages(Value: TCustomImageList); + procedure SetLargeIcons(Value: Boolean); + procedure SetLargeImages(Value: TCustomImageList); + procedure SetMakeDisabledImagesFaded(Value: Boolean); + procedure SetStretchGlyphs(Value: Boolean); + procedure SetUseLargeImagesForLargeIcons(Value: Boolean); + + procedure DisabledImageListChange(Sender: TObject); + procedure DisabledLargeImageListChange(Sender: TObject); + procedure HotImageListChange(Sender: TObject); + procedure ImageListChange(Sender: TObject); + procedure ImageOptionsChange(Sender: TObject); + procedure LargeIconsChange(Sender: TObject); + procedure LargeImageListChange(Sender: TObject); + // ImageOptions end + + function BarByNewName(const AName: string): TdxBar; + procedure FontChanged(Sender: TObject); + procedure CreateMDIChildSystemMenu(AWnd: HWND); + procedure DestroyMDIChildSystemMenu; + function IsMDIChildSystemMenuExist: Boolean; + procedure MDIStateChanged(AChange: TdxBarMDIStateChange; AWnd: HWND); +// function LoadMainFormFromBin: TForm; + procedure CheckToolbarsVisibility; + + class function IsFormBroadcastMessage(AMsg: UINT): Boolean; + procedure MainFormClientWndProc(Msg: UINT; wParam: WPARAM; lParam: LPARAM); + procedure OwnerWndProc(AWnd: HWND; AMsg: UINT; wParam: WPARAM; lParam: LPARAM); + class procedure SendFormBroadcastMessage(AOwnerHandle: HWND; AMsg: UINT; + wParam: WPARAM; lParam: LPARAM); + + procedure DisplayHint; + procedure DoActivateHint(AShow: Boolean; const CustomHint: string; AHintObject: TObject = nil); + + procedure DestroyItems; + procedure HelpButtonGlyphChanged(Sender: TObject); + procedure CalcMostRecentlyUsedUseCount; + function ShowRecentItemsFirst: Boolean; + + procedure AddDockControl(ADockControl: TdxDockControl); + procedure RemoveDockControl(ADockControl: TdxDockControl); + + procedure AddGroup(AGroup: TdxBarGroup); +//#DG procedure RemoveGroup(AGroup: TdxBarGroup); + + function CorrectRegistryPath(var APath: string): Boolean; + function GetSavedBarIndex(const ABarCaption: string): Integer; + function IsDockColorStored: Boolean; + procedure LoadLinkItemNames; + procedure ReadBars(AReader: TReader); + procedure ReadDockControlHeights(Reader: TReader); + procedure SaveState; + procedure WriteDockControlHeights(Writer: TWriter); + + procedure CreateFlatToolbarsBrushes; + procedure DestroyFlatToolbarsBrushes; + + procedure CreateThemeToolbarsBrushes; + procedure DestroyThemeToolbarsBrushes; + procedure DestroyToolbarsBrushes; + + procedure CreateToolbarsBrushes; + procedure RecreateToolbarsBrushes; + procedure RefreshFloatingBarsShadows; + procedure ResetBackgrounds; + procedure InitPainter; + procedure InternalStyleChanged; + procedure ThemeChanged; + procedure LFChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); + + procedure DoActivate(AState, AMinimized: WORD; AHandle, AWndPrevious: HWND); + procedure DoActivateApp(AActivate: Boolean; AThreadID: DWORD); + procedure DoCreate; + procedure DoModalActivate; + + procedure DoLockUpdate(ALock: Boolean; ACheckBarsChanges: Boolean); + + function GetItemLinkWithAccel(AKey: Word; AShift: TShiftState): TdxBarItemLink; + function HandleShortCut(AShortCut: TShortCut): Boolean; + protected + FdxBarDesignHelper: IdxBarDesigner; + + // IdxBarDesigner + function CanDeleteComponent(AComponent: TComponent): Boolean; + procedure GetSelection(AList: TList); + function GetSelectionStatus(AComponent: TPersistent): TdxBarSelectionStatus; + function IsComponentSelected(AComponent: TPersistent): Boolean; + procedure SelectComponent(AComponent: TPersistent; ASelectionOperation: TdxBarSelectionOperation = soExclusive); + procedure SetSelection(AList: TList); + procedure ShowDefaultEventHandler(AItem: TdxBarItem); + function UniqueName(const BaseName: string): string; + + procedure CreateBarRestoringList; + procedure DestroyBarRestoringList; + function BarRestoringListExists: Boolean; + procedure AddBarToRestoringList(ABar: TdxBar); + procedure RemoveBarFromRestoringList(ABar: TdxBar); + procedure ShowBarsFromRestoringList(ADockControl: TdxBarDockControl); + function GetBarIndexInRestoringList(ABar: TdxBar): Integer; + property RestoringListBarCount: Integer read GetRestoringListBarCount; + property RestoringListBars[Index: Integer]: TdxBar read GetRestoringListBar; + + procedure AssignFont; + function CanReset: Boolean; + procedure DefineProperties(Filer: TFiler); override; + procedure DesignerModified; + procedure DoBarAfterReset(ABar: TdxBar); dynamic; + procedure DoBarBeforeReset(ABar: TdxBar); dynamic; + procedure DoBarClose(ABar: TdxBar); dynamic; + procedure DoBarDockingStyleChanged(ABar: TdxBar); dynamic; + procedure DoClickItem(AItem: TdxBarItem); virtual; + procedure DoCloseButtonClick; dynamic; + function DoDocking(ABar: TdxBar; AStyle: TdxBarDockingStyle; + ADockControl: TdxDockControl): Boolean; virtual; + procedure DoItemLinkChange(AItemLink: TdxBarItemLink); + procedure DoHelpButtonClick; dynamic; + procedure DoMergeItemLink(ADstItemLinks, ASrcItemLinks: TdxBarItemLinks; + ASrcItemLink: TdxBarItemLink; var AMergeKind: TdxBarItemMergeKind; + var AMergeIndex: Integer); + procedure DoShowCustomizingPopup(PopupItemLinks: TdxBarItemLinks); dynamic; + procedure DoShowToolbarsPopup(PopupItemLinks: TdxBarItemLinks); dynamic; + procedure DragAndDrop(AItem: TdxBarItem; AItemLink: TdxBarItemLink); + function FindDockControl(APath: string): TdxBarDockControl; + function GetCategoryRealIndex(AIndex: Integer): Integer; + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + function GetChildOwner: TComponent; override; + function GetPainterClass: TdxBarPainterClass; virtual; + procedure GetRealLookAndFeel(ALookAndFeel: TcxLookAndFeel); + function GetRealPaintStyle: TdxBarRealPaintStyle; + function GetWindowForMouseCapturing: HWND; + procedure SetChildOrder(Child: TComponent; Order: Integer); override; + +// function IsLinkSelected(AItemLink: TdxBarItemLink): Boolean; +// procedure SelectLink(AItemLink: TdxBarItemLink; +// ASelectionOperation: TdxBarSelectionOperation = soExclusive); +// procedure SynchronizeSelectedLink; + + // ImageOptions + procedure CustomImagesChanged(AChangeProc: TdxBarItemChangeProc); + procedure DisabledImagesChanged(AItem: TdxBarItem); + procedure DisabledLargeImagesChanged(AItem: TdxBarItem); + procedure HotImagesChanged(AItem: TdxBarItem); + procedure ImagesChanged(AItem: TdxBarItem); + function IsLargeImagesForLargeIcons: Boolean; + procedure LargeImagesChanged(AItem: TdxBarItem); + property GlyphSize: Integer read GetGlyphSize write SetGlyphSize; + + procedure DisableFloatToolBars; + procedure EnableFloatToolBars; + + procedure ActivateFloatToolbars(AActivate, AForceHiding: Boolean; AActiveWindow: HWND); + function IsInternalDockControl(ADockControl: TdxDockControl): Boolean; + function IsUpdateLocked: Boolean; + procedure Loaded; override; + procedure LockDesignerModified(ALock: Boolean; + AInvokeDesignerModifiedOnUnlock: Boolean = True); + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure ReadState(Reader: TReader); override; + procedure SetName(const NewName: TComponentName); override; + procedure ShowToolbars(Show, ForceHiding: Boolean; ActiveWindow: HWND); + + function GetBarManagerSection(const ABaseSection: string; + AStoringKind: TdxBarStoringKind): string; + function GetBaseIniSection: string; + procedure LoadBarManager(ASource: TCustomIniFile; const ASection: string; AStoringKind: TdxBarStoringKind); + procedure SaveBarManager(ADestination: TCustomIniFile; const ASection: string; AStoringKind: TdxBarStoringKind); + + function CreateBarAsByMerging: TdxBar; + procedure InternalUnmerge(ABarManager: TdxBarManager; AForCustomization: Boolean); + procedure RestoreMergeState; + + procedure GetActiveSelection(AList: TList); + + procedure BeginMouseTracking(ABarControl: TCustomdxBarControl); + procedure EndMouseTracking(ABarControl: TCustomdxBarControl); + function IsMouseTracking(ABarControl: TCustomdxBarControl): Boolean; + + property BarControlFocused: Boolean read GetBarControlFocused; + property LastSelectedLinkAtDesign: TdxBarItemLink read GetLastSelectedLinkAtDesign; + property GroupList: TdxBarComponentList read FGroups; //#DG + property ItemList: TdxBarComponentList read FItems; //#DG + property InternalState: TdxBarInternalStates read FInternalState; + + property DraggingItem: TdxBarItem read GetDraggingItem write SetDraggingItem; + property DraggingItemLink: TdxBarItemLink read GetDraggingItemLink write SetDraggingItemLink; + property Dragging: Boolean read GetDragging; + property DragInfo: TdxBarDragInfo read FDragInfo; + + function IsOwnerVisible: Boolean; + function IsUncustomizable: Boolean; + property FocusedBarControl: TCustomdxBarControl read FFocusedBarControl; + property IsDestroying: Boolean read GetIsDestroying; + property IsHandleCreating: Boolean read GetIsHandleCreating; + property IsInitializing: Boolean read GetIsInitializing; + property IsLoading: Boolean read GetIsLoading; + property IsRecreating: Boolean read GetIsRecreating; + property IsStateSaving: Boolean read GetIsStateSaving; + property MainFormActive: Boolean read FMainFormActive; + property SavedState: TMemIniFile read FSavedState; + property TabOrder: Integer read GetTabOrder write SetTabOrder; // TODO make published, default 0 + + function CanAddComponents: Boolean; + function GetLightColor(ABtnFaceColorPart, AHighlightColorPart, AWindowColorPart: Integer): COLORREF; + property BarCaptionFont: TFont read FBarCaptionFont; + property CanModifyDesigner: Boolean read GetCanModifyDesigner; + property Flat: Boolean read GetFlat; + property FlatToolbarsBorderBrush: HBRUSH read FFlatToolbarsBorderBrush; + property FlatToolbarsBrush: HBRUSH read FFlatToolbarsBrush; + property FlatToolbarsDownedBrush: HBRUSH read FFlatToolbarsDownedBrush; + property FlatToolbarsDownedSelBrush: HBRUSH read FFlatToolbarsDownedSelBrush; + property FlatToolbarsSelBrush: HBRUSH read FFlatToolbarsSelBrush; + property FlatToolbarsBorderColor: COLORREF read GetFlatToolbarsBorderColor; + property FlatToolbarsColor: COLORREF read GetFlatToolbarsColor; + property FlatToolbarsDownedColor: COLORREF read GetFlatToolbarsDownedColor; + property FlatToolbarsDownedSelColor: COLORREF read GetFlatToolbarsDownedSelColor; + property FlatToolbarsSelColor: COLORREF read GetFlatToolbarsSelColor; + property ThemeToolbarsBrush: HBRUSH read FThemeToolbarsBrush; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + procedure ActivateHint(AShow: Boolean; const CustomHint: string; AHintObject: TObject = nil); + procedure HideHint; + function ActiveMDIChild: HWND; + + procedure BeginUpdate; + procedure EndUpdate(ACheckBarsChanges: Boolean = True); + + function BarByCaption(const ACaption: string): TdxBar; + function BarByComponentName(const AName: string): TdxBar; + function BarByOldName(const AName: string): TdxBar; +// function CheckBarName(const AName: string): string; + function GetUniqueToolbarCaption(const ABaseName: string): string; + function GetUniqueToolbarName(const ABaseName: string): string; + + function GetAllItemsByCategory(ACategory: Integer; List: TList): Integer; + function GetCountByCategory(ACategory: Integer): Integer; + function GetItemByCategory(ACategory, AIndex: Integer): TdxBarItem; + function GetItemByName(const AName: string): TdxBarItem; + function GetItemsByCategory(ACategory: Integer; List: TList): Integer; + function GetUniqueItemName(ABarItemClass: TdxBarItemClass): string; + + function AddButton: TdxBarButton; + function AddItem(AClass: TdxBarItemClass): TdxBarItem; + function AddSubItem: TdxBarSubItem; + function AddToolBar(AIsMainMenu: Boolean = False; + ANeedEditCaption: Boolean = False): TdxBar; + procedure DeleteToolBar(ABar: TdxBar; AConfirmation: Boolean); + procedure ExchangeItems(Index1, Index2: Integer); +// procedure FocusItem(AItem: TdxBarItem); + procedure MoveItem(CurIndex, NewIndex: Integer); + procedure RenameToolBar(ABar: TdxBar); + procedure ResetToolBar(ABar: TdxBar); + + procedure Merge(ABarManager: TdxBarManager; ACanCreateNewBar: Boolean = True); + procedure Unmerge(ABarManager: TdxBarManager = nil); + + procedure Customizing(Show: Boolean); + procedure HideAll; + procedure ResetUsageData; + procedure ResetUsageDataWithConfirmation; + //procedure WhatIsThis; + + procedure LoadFromRegistry(ARegistryPath: string); + procedure SaveToRegistry(ARegistryPath: string); + procedure LoadFromIniFile(const AFileName: string); + procedure SaveToIniFile(const AFileName: string); + procedure LoadFromStream(AStream: TStream); + procedure SaveToStream(AStream: TStream); + + function CreateGroup: TdxBarGroup; + + function CanShowRecentItems: Boolean; + function GetPaintStyle: TdxBarManagerStyle; + + property Bars: TdxBars read FBars; + property BarsLoading: Boolean read GetBarsLoading; + property CategoryItemsVisible[AIndex: Integer]: TdxBarItemVisible + read GetCategoryItemsVisible write SetCategoryItemsVisible; + property CategoryVisible[AIndex: Integer]: Boolean read GetCategoryVisible + write SetCategoryVisible; + property DefaultPainter: TdxBarPainter read FDefaultPainter; + property Designing: Boolean read GetDesigning; + property DockControlCount: Integer read GetDockControlCount; + property DockControls[Index: Integer]: TdxDockControl read GetDockControl; + property GroupCount: Integer read GetGroupCount; + property Groups[Index: Integer]: TdxBarGroup read GetGroup; + property InternalDockControls[ADockingStyle: TdxBarDockedDockingStyle]: TdxDockControl + read GetInternalDockControl; + property IsCustomizing: Boolean read GetIsCustomizing; + property ItemCount: Integer read GetItemCount; + property Items[Index: Integer]: TdxBarItem read GetItem; + property IsMDIMaximized: Boolean read FIsMDIMaximized; + property LockUpdate: Boolean read FLockUpdate write SetLockUpdate; + property MainForm: TCustomForm read GetParentForm; { obsolete } + property MasterForm: TCustomForm read GetMasterForm; + property MainMenuControl: TdxBarControl read GetMainMenuControl; + property MainMenuBar: TdxBar read GetMainMenuBar; + property Modified: Boolean read FModified write FModified; // only for Standard style + property Owner: TWinControl read GetParentedOwner; + property PainterClass: TdxBarPainterClass read InternalGetPainterClass; + property ParentBarManager: TdxBarManager read GetParentBarManager; + property ParentForm: TCustomForm read GetParentForm; + property SelectedItem: TdxBarItemControl read FSelectedItem write SetSelectedItem; + + property ReadIniFileHandlers: TcxEventHandlerCollection read FReadIniFileHandlers; + property WriteIniFileHandlers: TcxEventHandlerCollection read FWriteIniFileHandlers; + property MDIStateChangedHandlers: TcxEventHandlerCollection read FMDIStateChangedHandlers; + property SystemFontChangedHandlers: TcxEventHandlerCollection read FSystemFontChangedHandlers; + published + property AllowCallFromAnotherForm: Boolean read FAllowCallFromAnotherForm + write FAllowCallFromAnotherForm default False; + property AllowReset: Boolean read FAllowReset write FAllowReset default True; + property AlwaysMerge: Boolean read FAlwaysMerge write FAlwaysMerge default False; + property AlwaysSaveText: Boolean read FAlwaysSaveText write FAlwaysSaveText default False; + property AutoAlignBars: Boolean read FAutoAlignBars write SetAutoAlignBars default False; + property AutoDockColor: Boolean read FAutoDockColor write SetAutoDockColor default True; + property AutoHideEmptyBars: Boolean read FAutoHideEmptyBars write SetAutoHideEmptyBars default False; + property Scaled: Boolean read FScaled write SetScaled default True; // must be before Font + property Font: TFont read FFont write SetFont; // must be before Bars + property Backgrounds: TdxBarBackgrounds read FBackgrounds write SetBackgrounds; + property ButtonArrowWidth: Integer read FButtonArrowWidth write SetButtonArrowWidth + default dxBarDefaultButtonArrowWidth; + property CanCustomize: Boolean read FCanCustomize write FCanCustomize default True; + property Categories: TStrings read FCategories write SetCategories; + property DockColor: TColor read GetDockColor write SetDockColor stored IsDockColorStored; + property FlatCloseButton: Boolean read FFlatCloseButton write SetFlatCloseButton default False; + property HelpButtonGlyph: TBitmap read FHelpButtonGlyph write SetHelpButtonGlyph; + property HelpContext: THelpContext read FHelpContext write FHelpContext default 0; + property HideFloatingBarsWhenInactive: Boolean read FHideFloatingBarsWhenInactive + write SetHideFloatingBarsWhenInactive default True; + + // ImageOptions + property ImageOptions: TdxBarImageOptions read FImageOptions write FImageOptions; + // obsolete + property DisabledImages: TCustomImageList read GetDisabledImages write SetDisabledImages stored False; + property DisabledLargeImages: TCustomImageList read GetDisabledLargeImages write SetDisabledLargeImages stored False; + property HotImages: TCustomImageList read GetHotImages write SetHotImages stored False; + property ImageListBkColor: TColor read GetImageListBkColor write SetImageListBkColor stored False; + property Images: TCustomImageList read GetImages write SetImages stored False; + property LargeImages: TCustomImageList read GetLargeImages write SetLargeImages stored False; + property LargeIcons: Boolean read GetLargeIcons write SetLargeIcons stored False; + property MakeDisabledImagesFaded: Boolean read GetMakeDisabledImagesFaded write SetMakeDisabledImagesFaded stored False; + property StretchGlyphs: Boolean read GetStretchGlyphs write SetStretchGlyphs stored False; + property UseLargeImagesForLargeIcons: Boolean read GetUseLargeImagesForLargeIcons write SetUseLargeImagesForLargeIcons stored False; + + property IniFileName: string read FIniFileName write FIniFileName; + property LargeButtonArrowWidth: Integer read FLargeButtonArrowWidth write + SetLargeButtonArrowWidth default dxBarDefaultLargeButtonArrowWidth; + property LookAndFeel: TcxLookAndFeel read FLookAndFeel write SetLookAndFeel; + property MenuAnimations: TdxBarMenuAnimations read FMenuAnimations + write SetMenuAnimations default maNone; + property MenusShowRecentItemsFirst: Boolean read FMenusShowRecentItemsFirst + write SetMenusShowRecentItemsFirst default True; + property MostRecentItemsPercents: Byte read FMostRecentItemsPercents + write SetMostRecentItemsPercents default 95; + property NotDocking: TdxBarDockingStyles read GetNotDocking write SetNotDocking default []; + property PopupMenuLinks: TdxBarPopupMenuLinks read FPopupMenuLinks write SetPopupMenuLinks; + property RegistryPath: string read FRegistryPath write SetRegistryPath; + property ShowCloseButton: Boolean read FShowCloseButton write SetShowCloseButton default False; + property ShowFullMenusAfterDelay: Boolean read FShowFullMenusAfterDelay + write SetShowFullMenusAfterDelay default True; + property ShowHelpButton: Boolean read FShowHelpButton write SetShowHelpButton default False; + property ShowHint: Boolean read FShowHint write SetShowHint default True; + property ShowHintForDisabledItems: Boolean read FShowHintForDisabledItems + write FShowHintForDisabledItems default True; + property ShowShortCutInHint: Boolean read FShowShortCutInHint + write SetShowShortCutInHint default False; + property StoreInIniFile: Boolean read FStoreInIniFile write FStoreInIniFile default False; + property StoreInRegistry: Boolean read FStoreInRegistry write FStoreInRegistry default False; + property Style: TdxBarManagerStyle read FStyle write SetStyle default bmsEnhanced; + property SunkenBorder: Boolean read FSunkenBorder write SetSunkenBorder default False; + property UseF10ForMenu: Boolean read FUseF10ForMenu write FUseF10ForMenu default True; + property UseFullReset: Boolean read FUseFullReset write FUseFullReset default False; + property UseSystemFont: Boolean read FUseSystemFont write SetUseSystemFont; + property WaitForDockingTime: Integer read FWaitForDockingTime write SetWaitForDockingTime default 21; + + property OnBarAdd: TdxBarEvent read FOnBarAdd write FOnBarAdd; + property OnBarAfterReset: TdxBarEvent read FOnBarAfterReset write FOnBarAfterReset; + property OnBarBeforeReset: TdxBarEvent read FOnBarBeforeReset write FOnBarBeforeReset; + property OnBarClose: TdxBarEvent read FOnBarClose write FOnBarClose; + property OnBarDelete: TdxBarEvent read FOnBarDelete write FOnBarDelete; + property OnBarDockingStyleChange: TdxBarEvent read FOnBarDockingStyleChange + write FOnBarDockingStyleChange; + property OnBarVisibleChange: TdxBarVisibleChangeEvent read FOnBarVisibleChange + write FOnBarVisibleChange; + + property OnItemLinkAdd: TdxBarItemLinkEvent read FOnItemLinkAdd + write FOnItemLinkAdd; + property OnItemLinkChange: TdxBarItemLinkEvent read FOnItemLinkChange + write FOnItemLinkChange; + property OnItemLinkDelete: TdxBarItemLinkEvent read FOnItemLinkDelete + write FOnItemLinkDelete; + property OnMergeItemLink: TdxBarMergeItemLinkEvent read FOnMergeItemLink + write FOnMergeItemLink; + + property OnCloseButtonClick: TNotifyEvent read FOnCloseButtonClick + write FOnCloseButtonClick; + property OnDocking: TdxBarCanDockingEvent read FOnDocking write FOnDocking; + property OnHelpButtonClick: TNotifyEvent read FOnHelpButtonClick write FOnHelpButtonClick; + property OnHideCustomizingForm: TNotifyEvent read FOnHideCustomizingForm + write FOnHideCustomizingForm; + property OnMenuMerge: TdxBarMenuMergeEvent read FOnMenuMerge write FOnMenuMerge; + property OnMerge: TdxBarMergeEvent read FOnMerge write FOnMerge; + property OnShowCustomizingForm: TNotifyEvent read FOnShowCustomizingForm + write FOnShowCustomizingForm; + property OnShowCustomizingPopup: TdxBarShowPopupEvent read FOnShowCustomizingPopup + write FOnShowCustomizingPopup; + property OnShowToolbarsPopup: TdxBarShowPopupEvent read FOnShowToolbarsPopup + write FOnShowToolbarsPopup; + + property OnClickItem: TdxBarClickItemEvent read FOnClickItem write FOnClickItem; + end; + + TdxBarManagerList = class(TdxObjectList) + private + function GetBarManager(Index: Integer): TdxBarManager; + function GetCustomizingBarManager: TdxBarManager; + public + destructor Destroy; override; + function NextActive(ABarManager: TdxBarManager; + AGoForward: Boolean): TdxBarManager; + property BarManagers[Index: Integer]: TdxBarManager read GetBarManager; default; + property CustomizingBarManager: TdxBarManager read GetCustomizingBarManager; + end; + + TdxBarBorderStyle = (bbsNone, bbsSingle); + TdxBarStaticBorderStyle = (sbsNone, sbsLowered, sbsRaised, sbsEtched, sbsBump); + TdxBarSpinEditButton = (sbNone, sbUp, sbDown); + TdxBarSpinEditButtons = set of TdxBarSpinEditButton; + + TdxBarMergeData = class + private + FFreeNotificator: TcxFreeNotificator; + FMergedBarList: TList; + FSavedMergedBarList: TList; + procedure FreeNotification(Sender: TComponent); + function GetSavedMergedBar(AIndex: Integer): TdxBar; + function GetSavedMergedBarListCount: Integer; + procedure SetFreeNotifications; + protected + property FreeNotificator: TcxFreeNotificator read FFreeNotificator; + public + CreatedByMerging: Boolean; + CreatedByMergingBarVisibleBeforeCustomization: Boolean; + MergedWith: TdxBar; + VisibleBeforeMerging: Boolean; + constructor Create; + destructor Destroy; override; + procedure ClearSavedMergedBarList; + procedure SaveMergedBarList(AList: TList = nil); + property MergedBarList: TList read FMergedBarList; + property SavedMergedBarCount: Integer read GetSavedMergedBarListCount; + property SavedMergedBars[AIndex: Integer]: TdxBar read GetSavedMergedBar; + end; + + TdxCollectionNotifyEvent = procedure (Sender: TObject; AItem: TCollectionItem) of Object; + + { TdxBarAccessibilityHelper } + + TdxBarAccessibilityHelper = class(TcxAccessibilityHelper, IdxBarAccessibilityHelper) + private + function InternalGetChild(AIndex: Integer): TdxBarAccessibilityHelper; + function InternalGetParent: TdxBarAccessibilityHelper; + protected + // IcxAccessibilityHelper + procedure OwnerObjectDestroyed; override; + + // IdxBarAccessibilityHelper + function AreKeyTipsSupported( + out AKeyTipWindowsManager: IdxBarKeyTipWindowsManager): Boolean; virtual; + function CanNavigateToChildren(AKey: Word): Boolean; virtual; + function GetBarHelper: TdxBarAccessibilityHelper; + function GetBarManager: TdxBarManager; virtual; + function GetDefaultAccessibleObject: IdxBarAccessibilityHelper; virtual; + function GetNextAccessibleObject( + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; overload; virtual; + function GetRootAccessibleObject: IdxBarAccessibilityHelper; + function HandleNavigationKey(var AKey: Word): Boolean; virtual; + function IsNavigationKey(AKey: Word): Boolean; virtual; + function IsSelected: Boolean; + function LogicalNavigationGetNextAccessibleObject( + AGoForward: Boolean): IdxBarAccessibilityHelper; virtual; + procedure Select(ASetFocus: Boolean); virtual; + procedure Unselect(ANextSelectedObject: IdxBarAccessibilityHelper); virtual; + + procedure GetChildrenForNavigation( + ASelectedObject, AParentObject: TdxBarAccessibilityHelper; + const ASelectedObjectScreenBounds: TRect; + ADirection: TcxAccessibilityNavigationDirection; + AAreOnlyNearObjectsAccepted: Boolean; AObjects: TList); + + procedure GetChilds(AChilds: TList; AOnlyVisible: Boolean = True); + + function GetAssignedKeyTip: string; virtual; abstract; + function GetDefaultKeyTip: string; virtual; abstract; + function GetKeyTip: string; virtual; + + function CreateKeyTipData: TdxBarKeyTipData; virtual; + procedure GetKeyTipInfo(out AKeyTipInfo: TdxBarKeyTipInfo); virtual; + procedure GetKeyTipData(AKeyTipsData: TList); virtual; + procedure DoGetKeyTipsData(AKeyTipsData: TList); virtual; + procedure GetKeyTipsData(AKeyTipsData: TList); + procedure GenerateUniqueKeyTips(AKeyTipsData: TList); + + function GetParentForKeyTip: TdxBarAccessibilityHelper; virtual; + function IsKeyTipContainer: Boolean; virtual; + procedure KeyTipHandler(Sender: TObject); virtual; + procedure KeyTipsEscapeHandler; virtual; + function LogicalNavigationGetChild(AIndex: Integer): TdxBarAccessibilityHelper; virtual; + function LogicalNavigationGetChildCount: Integer; virtual; + function LogicalNavigationGetChildIndex( + AChild: TdxBarAccessibilityHelper): Integer; virtual; + function LogicalNavigationGetNextChild(AChildIndex: Integer; + AGoForward: Boolean): TdxBarAccessibilityHelper; + + property ParentForKeyTip: TdxBarAccessibilityHelper read GetParentForKeyTip; + public + function GetFirstSelectableObject: TdxBarAccessibilityHelper; + property BarManager: TdxBarManager read GetBarManager; + property Childs[AIndex: Integer]: TdxBarAccessibilityHelper read InternalGetChild; + property Parent: TdxBarAccessibilityHelper read InternalGetParent; + end; + + TdxBarAccessibilityHelperClass = class of TdxBarAccessibilityHelper; + + TdxBarCaptionButton = class(TCollectionItem, {$IFNDEF DELPHI6}IUnknown, {$ENDIF}IdxBarHintKeeper) + private + FEnabled: Boolean; + FGlyph: TBitmap; + FHint: string; + FIAccessibilityHelper: IdxBarAccessibilityHelper; + FKeyTip: string; + FNotifyComponent: TcxFreeNotificator; + FRect: TRect; + FScreenTip: TdxBarScreenTip; + FState: Integer; + FOnClick: TNotifyEvent; + function GetCollection: TdxBarCaptionButtons; + function GetIAccessibilityHelper: IdxBarAccessibilityHelper; + function GetParent: TdxBarControl; + procedure GlyphChanged(Sender: TObject); + procedure SetEnabled(Value: Boolean); + procedure SetGlyph(Value: TBitmap); + procedure SetScreenTip(Value: TdxBarScreenTip); + procedure SetState(Value: Integer); + procedure SetOnClick(Value: TNotifyEvent); + + procedure FreeNotification(AComponent: TComponent); + + property Parent: TdxBarControl read GetParent; + protected + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; virtual; + // IUnknown + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + // IdxBarHintKeeper + function DoHint(var ANeedDeactivate: Boolean; out AHintText: string; out AShortCut: string): Boolean; + function CreateHintViewInfo(const AHintText, AShortCut: string): TdxBarCustomHintViewInfo; + function GetEnabled: Boolean; + function GetHintPosition(const ACursorPos: TPoint; AHeight: Integer): TPoint; + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure Click; + property Collection: TdxBarCaptionButtons read GetCollection; + property Glyph: TBitmap read FGlyph write SetGlyph; + property IAccessibilityHelper: IdxBarAccessibilityHelper read GetIAccessibilityHelper; + property Rect: TRect read FRect write FRect; + property State: Integer read FState write SetState; + published + property Enabled: Boolean read FEnabled write SetEnabled default True; + property Hint: string read FHint write FHint; + property KeyTip: string read FKeyTip write FKeyTip; + property ScreenTip: TdxBarScreenTip read FScreenTip write SetScreenTip; + property OnClick: TNotifyEvent read FOnClick write SetOnClick; + end; + + TdxBarCaptionButtons = class(TCollection) + private + FBar: TdxBar; + FIAccessibilityHelper: IdxBarAccessibilityHelper; + FOnNotify: TdxCollectionNotifyEvent; + function GetIAccessibilityHelper: IdxBarAccessibilityHelper; + function GetItem(Index: Integer): TdxBarCaptionButton; + function GetRect: TRect; + procedure SetItem(Index: Integer; Value: TdxBarCaptionButton); + protected + function GetOwner: TPersistent; override; + procedure Update(Item: TCollectionItem); override; + + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; virtual; + function GetButtonIndex(const APoint: TPoint): Integer; + public + constructor Create(ABar: TdxBar); + destructor Destroy; override; + function Add: TdxBarCaptionButton; + procedure UpdateButtonStates(const AMousePos: TPoint; AMousePressed: Boolean = False); + property Bar: TdxBar read FBar; + property IAccessibilityHelper: IdxBarAccessibilityHelper read GetIAccessibilityHelper; + property Items[Index: Integer]: TdxBarCaptionButton read GetItem write SetItem; default; + property Rect: TRect read GetRect; + property OnNotify: TdxCollectionNotifyEvent read FOnNotify write FOnNotify; + end; + + TdxBar = class(TcxComponentCollectionItem, {$IFNDEF DELPHI6}IUnknown,{$ENDIF} IdxBarSelectableItem, IdxBarLinksOwner) + private + FAllowClose: Boolean; + FAllowCustomizing: Boolean; + FAllowQuickCustomizing: Boolean; + FAllowReset: Boolean; + FAlphaBlendValue: Byte; + FBackgroundBitmap: TBitmap; + FBorderStyle: TdxBarBorderStyle; + FCaption: string; + FCaptionButtons: TdxBarCaptionButtons; + FChanged: Boolean; + FColor: TColor; + FChangingDockingStyle: Boolean; + FDockControl: TdxBarDockControl; + FDockedDockControl: TdxBarDockControl; + FDockedDockingStyle: TdxBarDockingStyle; + FDockedLeft: Integer; + FDockedTop: Integer; + FDockingStyle: TdxBarDockingStyle; + FDockRow: TdxDockRow; + FEditFont: TFont; + FFloatLeft: Integer; + FFloatTop: Integer; + FFloatClientWidth: Integer; + FFloatClientHeight: Integer; + FFont: TFont; + FFreeNotificationItems: TList; + FGlyph: TBitmap; + FHidden: Boolean; // if True, then doesn't show in customizing form in run-time + FInternalFontChange: Boolean; + FInternallyHidden: Boolean; + FIsMainMenu: Boolean; + FIsNameLocked: Boolean; + FIsPredefined: Boolean; + FItemLinks: TdxBarItemLinks; + FKeyTip: string; + FLoadedDockControl: TdxBarDockControl; + FLoadedDockingStyle: TdxBarDockingStyle; + FLoadedVisible: Boolean; + FLockUpdate: Boolean; + FMergeData: TdxBarMergeData; + FNeedUpdateControlPosition: Boolean; +// FName: TComponentName; + FNotDocking: TdxBarDockingStyles; + FMultiLine: Boolean; + FOneOnRow: Boolean; + FOldName: string; + FRotateWhenVertical: Boolean; + FRow: Integer; + FShouldNotBeDestroyedIfEmptyAfterUnmerge: Boolean; + FShowMark: Boolean; + FSizeGrip: Boolean; + FUseOwnFont: Boolean; + FUseRestSpace: Boolean; + FVisible: Boolean; // is it currently visible or not? + FWholeRow: Boolean; + FOnDestroy: TNotifyEvent; + + procedure BitmapChanged(Sender: TObject); + procedure DoDestroy; + function GetBars: TdxBars; + function GetControl: TdxBarControl; + function GetDockControl: TdxBarDockControl; + function GetDockedDockingStyle: TdxBarDockingStyle; + function GetDockingStyle: TdxBarDockingStyle; + function GetNext: TdxBar; + function GetNotDocking: TdxBarDockingStyles; + function GetPainter: TdxBarPainter; + function GetRealDockControl: TdxDockControl; + function GetRow: Integer; + function GetUseRecentItems: Boolean; + function GetVisible: Boolean; + procedure GlyphChanged(Sender: TObject); + procedure SetAllowClose(Value: Boolean); + procedure SetAllowQuickCustomizing(Value: Boolean); + procedure SetAlphaBlendValue(Value: Byte); + procedure SetBackgroundBitmap(Value: TBitmap); + procedure SetBorderStyle(Value: TdxBarBorderStyle); + procedure SetCaption(Value: string); + procedure SetCaptionButtons(Value: TdxBarCaptionButtons); + procedure SetColor(Value: TColor); + procedure SetDockControl(Value: TdxBarDockControl); + procedure SetDockedDockControl(Value: TdxBarDockControl); + procedure SetDockedValue(Index: Integer; Value: Integer); + procedure SetDockingStyle(Value: TdxBarDockingStyle); + procedure SetDockRow(Value: TdxDockRow); + procedure SetFloatValue(Index: Integer; Value: Integer); + procedure SetFont(Value: TFont); + procedure SetGlyph(Value: TBitmap); + procedure SetHidden(Value: Boolean); + procedure SetIsMainMenu(Value: Boolean); + procedure SetItemLinks(Value: TdxBarItemLinks); + procedure SetLockUpdate(Value: Boolean); + procedure SetMultiLine(Value: Boolean); + procedure SetNotDocking(Value: TdxBarDockingStyles); + procedure SetOneOnRow(Value: Boolean); + procedure SetRotateWhenVertical(Value: Boolean); + procedure SetRow(Value: Integer); + procedure SetShowMark(Value: Boolean); + procedure SetSizeGrip(Value: Boolean); + procedure SetUseOwnFont(Value: Boolean); + procedure SetUseRecentItems(Value: Boolean); + procedure SetUseRestSpace(Value: Boolean); + procedure SetVisible(Value: Boolean); + procedure SetWholeRow(Value: Boolean); + + procedure FontChanged(Sender: TObject); + + procedure UpdateControlPosition; + + function IsDockedDockingStyleStored: Boolean; + function IsDockingStyleStored: Boolean; + protected + procedure AddFreeNotification(AItem: TdxBarItem); + procedure RemoveFreeNotification(AItem: TdxBarItem); + procedure MakeFreeNotification; + procedure RemoveFromDockRow(ADestroyEmptyDockRow: Boolean); + procedure SetName(const NewName: TComponentName); override; + procedure Updated; override; + procedure Updating; override; + + function CreateControl: TdxBarControl; + function GetControlClass: TdxBarControlClass; virtual; + procedure ShowControl; + + class function GetIniSection(const ABaseSection: string; ABarIndex: Integer): string; + procedure LoadFromIni(ASource: TCustomIniFile; const ABaseSection: string; + ABarIndex: Integer; AStoringKind: TdxBarStoringKind; AFullLoad: Boolean = True); + procedure LoadUsageData(ASource: TCustomIniFile; const ABaseSection: string; ABarIndex: Integer); + procedure SaveToIni(ADestination: TCustomIniFile; const ABaseSection: string; + ABarIndex: Integer; AStoringKind: TdxBarStoringKind); + + procedure InternalMerge(ABar: TdxBar; ASaveMergingBarVisibility: Boolean); + procedure InternalUnmergeFromBar(ABar: TdxBar; + ARestoreMergedBarsVisibility: Boolean); + procedure InternalUnmergeFromBarManager(ABarManager: TdxBarManager; + ARestoreMergedBarsVisibility: Boolean); + procedure RestoreMergeState; + procedure SaveMergeState; + procedure SetVisibility(Value: Boolean); + + procedure CaptionButtonsNotification(Sender: TObject; AItem: TCollectionItem); virtual; + procedure DoChanged; + + function BarNCSizeX(AStyle: TdxBarDockingStyle): Integer; + function BarNCSizeY(AStyle: TdxBarDockingStyle): Integer; + function CanClose: Boolean; + function CanMoving: Boolean; + function CanReset: Boolean; + function GetDockedPosition: Integer; + function HasSizeGrip: Boolean; + function IsFloat: Boolean; + function IsShortCut(AShortCut: TShortCut): Boolean; + function IsStatusBar: Boolean; + + // IdxBarSelectableItem + function CanDelete(ADestruction: Boolean = False): Boolean; + procedure DeleteSelection(var AReference: IdxBarSelectableItem; ADestruction: Boolean); + procedure ExecuteCustomizationAction(ABasicAction: TdxBarCustomizationAction); + function GetBarManager: TdxBarManager; + function IdxBarSelectableItem.GetInstance = GetPersistentInstance; + procedure GetMasterObjects(AList: TdxObjectList); + function GetNextSelectableItem: IdxBarSelectableItem; + function GetSelectableParent: TPersistent; + function GetSelectionStatus: TdxBarSelectionStatus; + function GetSupportedActions: TdxBarCustomizationActions; + procedure Invalidate; + function IsComplex: Boolean; + function IsComponentSelected: Boolean; + procedure SelectComponent(ASelectionOperation: TdxBarSelectionOperation = soExclusive); + function SelectParentComponent: Boolean; + procedure SelectionChanged; + + // IdxBarLinksOwner + function CanContainItem(AItem: TdxBarItem; out AErrorText: string): Boolean; + function CreateBarControl: TCustomdxBarControl; + function IdxBarLinksOwner.GetInstance = GetComponentInstance; + function GetItemLinks: TdxBarItemLinks; + + function GetComponentInstance: TComponent; + function GetPersistentInstance: TPersistent; + + property MergeData: TdxBarMergeData read FMergeData; + property Painter: TdxBarPainter read GetPainter; + property ShouldNotBeDestroyedIfEmptyAfterUnmerge: Boolean read FShouldNotBeDestroyedIfEmptyAfterUnmerge + write FShouldNotBeDestroyedIfEmptyAfterUnmerge; + property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure ChangeDockingStyle(AStyle: TdxBarDockingStyle; + ADockControl: TdxDockControl); + function GetCollectionFromParent(AParent: TComponent): TcxComponentCollection; override; + function IsVertical: Boolean; + procedure Move(X, Y: Integer); overload; + procedure Move(ADockControl: TdxDockControl; ARow, APosition: Integer); overload; + procedure Move(ADockingStyle: TdxBarDockedDockingStyle; ARow, APosition: Integer); overload; + procedure Move(ABar: TdxBar; AInsertAfter: Boolean = True); overload; + procedure Reset; + procedure ResetWithConfirmation; + procedure SetParentComponent(AParent: TComponent); override; + + procedure Merge(ABar: TdxBar); + procedure Unmerge(ABar: TdxBar = nil); + + property BarManager: TdxBarManager read GetBarManager; + property Bars: TdxBars read GetBars; + property Control: TdxBarControl read GetControl; + property DockRow: TdxDockRow read FDockRow write SetDockRow; + property IsPredefined: Boolean read FIsPredefined; + property LockUpdate: Boolean read FLockUpdate write SetLockUpdate; + property RealDockControl: TdxDockControl read GetRealDockControl; + published + property AllowClose: Boolean read FAllowClose write SetAllowClose default True; + property AllowCustomizing: Boolean read FAllowCustomizing write FAllowCustomizing + default True; + property AllowQuickCustomizing: Boolean read FAllowQuickCustomizing + write SetAllowQuickCustomizing default True; + property AllowReset: Boolean read FAllowReset write FAllowReset default True; + property BorderStyle: TdxBarBorderStyle read FBorderStyle write SetBorderStyle + default bbsSingle; + property Caption: string read FCaption write SetCaption; + property CaptionButtons: TdxBarCaptionButtons read FCaptionButtons write SetCaptionButtons; + property Color: TColor read FColor write SetColor default clDefault; + property DockControl: TdxBarDockControl read GetDockControl write SetDockControl; + property DockedDockControl: TdxBarDockControl read FDockedDockControl + write SetDockedDockControl; + property DockedDockingStyle: TdxBarDockingStyle read GetDockedDockingStyle + write FDockedDockingStyle stored IsDockedDockingStyleStored; + property DockedLeft: Integer index 1 read FDockedLeft write SetDockedValue; + property DockedTop: Integer index 2 read FDockedTop write SetDockedValue; + property DockingStyle: TdxBarDockingStyle read GetDockingStyle write SetDockingStyle + stored IsDockingStyleStored; + property FloatLeft: Integer index 1 read FFloatLeft write SetFloatValue; + property FloatTop: Integer index 2 read FFloatTop write SetFloatValue; + property FloatClientWidth: Integer index 3 read FFloatClientWidth write SetFloatValue; + property FloatClientHeight: Integer index 4 read FFloatClientHeight write SetFloatValue; + property Font: TFont read FFont write SetFont stored FUseOwnFont; + property Glyph: TBitmap read FGlyph write SetGlyph; + property Hidden: Boolean read FHidden write SetHidden default False; + property IsMainMenu: Boolean read FIsMainMenu write SetIsMainMenu default False; + property ItemLinks: TdxBarItemLinks read GetItemLinks write SetItemLinks; + property KeyTip: string read FKeyTip write FKeyTip; + property MultiLine: Boolean read FMultiLine write SetMultiLine default False; +// property Name: TComponentName read FName write SetName; + property NotDocking: TdxBarDockingStyles read GetNotDocking write SetNotDocking default []; + property OldName: string read FOldName write FOldName; + property OneOnRow: Boolean read FOneOnRow write SetOneOnRow; + property RotateWhenVertical: Boolean read FRotateWhenVertical write SetRotateWhenVertical + default True; + property Row: Integer read GetRow write SetRow; + property ShowMark: Boolean read FShowMark write SetShowMark default True; + property SizeGrip: Boolean read FSizeGrip write SetSizeGrip default True; + property UseOwnFont: Boolean read FUseOwnFont write SetUseOwnFont; + property UseRecentItems: Boolean read GetUseRecentItems write SetUseRecentItems default True; + property UseRestSpace: Boolean read FUseRestSpace write SetUseRestSpace default False; + property Visible: Boolean read GetVisible write SetVisible; + property WholeRow: Boolean read FWholeRow write SetWholeRow; + property BackgroundBitmap: TBitmap read FBackgroundBitmap write SetBackgroundBitmap; + property AlphaBlendValue: Byte read FAlphaBlendValue write SetAlphaBlendValue default 255; + end; + + TdxDockControls = array[dsLeft..dsBottom] of TdxDockControl; + + TdxBars = class(TcxComponentCollection) + private + FDockControls: TdxDockControls; + FDocking: Boolean; + FDockingZoneSize: Integer; + FBarManager: TdxBarManager; + FMoving: Boolean; + FMovingBarControl: TdxBarControl; + FMovingBarOriginalDockingStyle: TdxBarDockingStyle; + FMovingOffset: TPoint; + FMovingStaticOffset: TPoint; + + function GetDockControl(Index: TdxBarDockingStyle): TdxDockControl; + function GetItem(Index: Integer): TdxBar; + procedure SetItem(Index: Integer; Value: TdxBar); + protected +// function GetOwner: TPersistent; override; + + procedure RegInDock(AStyle: TdxBarDockingStyle; ADockControl: TdxDockControl; + ABarControl: TdxBarControl; APos: TPoint); + procedure UnregFromDock(AStyle: TdxBarDockingStyle; + ADockControl: TdxDockControl; ABarControl: TdxBarControl); + + procedure ChangeBarControlPos(ABarControl: TdxBarControl; APos: TPoint); + function GetDockingStyleAtPos(Bar: TdxBar; Pos: TPoint; + var DockControl: TdxDockControl): TdxBarDockingStyle; + procedure Moving(AMovingBarControl: TdxBarControl); + procedure Repaint; + procedure SetItemName(AItem: TcxComponentCollectionItem); override; + procedure Update(AItem: TcxComponentCollectionItem; AAction: TcxComponentCollectionNotification); override; + + property DockingZoneSize: Integer read FDockingZoneSize write FDockingZoneSize; + public + constructor Create(ABarManager: TdxBarManager); reintroduce; + destructor Destroy; override; + function Add: TdxBar; + function GetUniqueToolbarName(const ABaseName: string): string; + function Insert(Index: Integer): TdxBar; + + property BarManager: TdxBarManager read FBarManager; + property DockControls[Index: TdxBarDockingStyle]: TdxDockControl read GetDockControl; + property IsMoving: Boolean read FMoving; + property Items[Index: Integer]: TdxBar read GetItem write SetItem; default; + end; + + TdxBarUserDefine = (udCaption, udGlyph, udPaintStyle, udWidth); + TdxBarUserDefines = set of TdxBarUserDefine; + + TdxBarPaintStyle = (psStandard, psCaption, psCaptionInMenu, psCaptionGlyph); + + TdxBarItemControlPart = (cpIcon, cpText); + TdxBarItemControlViewStructure = set of TdxBarItemControlPart; + TdxBarItemControlViewSize = (cvsSmall, cvsMedium, cvsLarge); + + TdxBarItemOptionValue = (ioShowDescriptions, ioShowShortCuts, ioSize); + TdxBarItemOptionValues = set of TdxBarItemOptionValue; + + TdxBarItemOptions = class(TPersistent) + private + FItemLinks: TdxBarItemLinks; + + FAssignedValues: TdxBarItemOptionValues; + FShowDescriptions: Boolean; + FShowShortCuts: Boolean; + FSize: TdxBarMenuItemSize; + + function GetAssignedValues: TdxBarItemOptionValues; + function GetDefaultValue(AOption: TdxBarItemOptionValue): Variant; + function GetValue(AOption: TdxBarItemOptionValue): Variant; + function GetShowDescriptions: Boolean; + function GetShowShortCuts: Boolean; + function GetSize: TdxBarMenuItemSize; + procedure SetAssignedValues(AValue: TdxBarItemOptionValues); + procedure SetShowDescriptions(AValue: Boolean); + procedure SetShowShortCuts(AValue: Boolean); + procedure SetSize(AValue: TdxBarMenuItemSize); + + function IsValueStored(AOption: TdxBarItemOptionValue): Boolean; + function IsShowDescriptionsStored: Boolean; + function IsShowShortCutsStored: Boolean; + function IsSizeStored: Boolean; + public + constructor Create(AItemLinks: TdxBarItemLinks); + procedure Assign(Source: TPersistent); override; + published + property AssignedValues: TdxBarItemOptionValues read GetAssignedValues write SetAssignedValues stored False; + property ShowDescriptions: Boolean read GetShowDescriptions write SetShowDescriptions stored IsShowDescriptionsStored; + property ShowShortCuts: Boolean read GetShowShortCuts write SetShowShortCuts stored IsShowShortCutsStored; + property Size: TdxBarMenuItemSize read GetSize write SetSize stored IsSizeStored; + end; + + TdxBarItemLink = class(TCollectionItem,{$IFNDEF DELPHI6} IUnknown,{$ENDIF} + IdxBarSelectableItem) + private + FBeginGroup: Boolean; + FButtonGroup: TdxBarButtonGroupPosition; + FControl: TdxBarItemControl; + FCreatedFromMergingWith: TdxBar; + FData: Integer; + FIsMarkedForDeletion: Boolean; + FItem: TdxBarItem; + FItemRect: TRect; + FLoadedItemName: string; + FLoadedRecentIndex: Integer; + FLoadedUseCount: Integer; + FLoadedVisible: Boolean; + FMostRecentlyUsed: Boolean; + FOriginalItemLink: TdxBarItemLink; + FPosition: TdxBarItemPosition; + FPrevItemName: string; + FPrevRecentIndex: Integer; + FRefCount: Integer; + FRowHeight: Integer; + FUseCount: Integer; + FUserCaption: string; + FUserDefine: TdxBarUserDefines; + FUserGlyph: TBitmap; + FUserPaintStyle: TdxBarPaintStyle; + FUserWidth: Integer; + FViewLevels: TdxBarItemViewLevels; + FVisible: Boolean; + + function GetAllowedViewLevels: TdxBarItemViewLevels; + function GetAvailableIndex: Integer; + function GetBarControl: TCustomdxBarControl; + function GetBeginGroup: Boolean; + function GetCanVisibleIndex: Integer; + function GetCaption: string; + function GetCollection: TdxBarItemLinks; + function GetGlyph: TBitmap; + function GetItem: TdxBarItem; + function GetNext: TdxBarItemLink; + function GetOwnerValue: TdxBarItemLinks; + function GetPaintStyle: TdxBarPaintStyle; + function GetUserDefine: TdxBarUserDefines; + function GetVisibleIndex: Integer; + function GetWidth: Integer; + procedure ReadItemName(AReader: TReader); + procedure SetBeginGroup(Value: Boolean); + procedure SetButtonGroup(Value: TdxBarButtonGroupPosition); + procedure SetCollection(Value: TdxBarItemLinks); reintroduce; virtual; + procedure SetItem(Value: TdxBarItem); + procedure SetItemRect(Value: TRect); + procedure SetMostRecentlyUsed(Value: Boolean); + procedure SetPosition(Value: TdxBarItemPosition); + + procedure ForceSetUserDefine(AValue: TdxBarUserDefine); + procedure SetUserDefine(Value: TdxBarUserDefines); + procedure SetUserCaption(const Value: string); + procedure SetUserGlyph(Value: TBitmap); + procedure SetUserPaintStyle(Value: TdxBarPaintStyle); + procedure SetUserWidth(Value: Integer); + + procedure SetViewLevels(Value: TdxBarItemViewLevels); + procedure SetVisible(Value: Boolean); + procedure WriteItemName(AWriter: TWriter); + + procedure AddToRecentList; + procedure RemoveFromRecentList; + procedure RestoreRecentIndex; + procedure SaveRecentIndex; + procedure InternalBringToTopInRecentList(IncCount: Boolean); + procedure Synchronize(AItemLink: TdxBarItemLink); + procedure CheckMostRecentlyUsed; + function GetRecentIndex: Integer; + procedure SetRecentIndex(Value: Integer); + property RecentIndex: Integer read GetRecentIndex write SetRecentIndex; + + function CanVisible: Boolean; + function GetRealItemLink: TdxBarItemLink; + procedure OnUserGlyphChanged(Sender: TObject); + protected + procedure DefineProperties(Filer: TFiler); override; + procedure LoadItemName; + + class function GetIniSection(const ABaseSection: string; ALinkIndex: Integer; + AStoringKind: TdxBarStoringKind): string; + procedure LoadFromIni(ASource: TCustomIniFile; const ABaseSection: string; + ALinkIndex: Integer; AStoringKind: TdxBarStoringKind); + procedure LoadUsageData(ASource: TCustomIniFile; ABaseSection: string; + ALinkIndex: Integer); + procedure SaveToIni(ADestination: TCustomIniFile; const ABaseSection: string; + ALinkIndex: Integer; AStoringKind: TdxBarStoringKind); + + procedure InitiateAction; + + function CanChangePaintStyle: Boolean; + function HasItem(AItem: TdxBarItem): Boolean; + function IsReferencedBy(ALinksOwner: IdxBarLinksOwner): Boolean; + function IsAccel(Key: Word; Shift: TShiftState): Boolean; + procedure MoveBeginGroupItemIfNeeded; + function ScreenToClient(const AScreenPos: TPoint): TPoint; + procedure UserGlyphChanged; virtual; + + // IUnknown + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + + // IdxBarSelectableItem + function CanDelete(ADestruction: Boolean = False): Boolean; + procedure DeleteSelection(var AReference: IdxBarSelectableItem; ADestruction: Boolean); + procedure ExecuteCustomizationAction(ABasicAction: TdxBarCustomizationAction); + function GetBarManager: TdxBarManager; + function GetInstance: TPersistent; + procedure GetMasterObjects(AList: TdxObjectList); + function GetNextSelectableItem: IdxBarSelectableItem; + function GetSelectableParent: TPersistent; + function GetSelectionStatus: TdxBarSelectionStatus; + function GetSupportedActions: TdxBarCustomizationActions; + procedure Invalidate; + function IsComplex: Boolean; + function IsComponentSelected: Boolean; + procedure SelectComponent(ASelectionOperation: TdxBarSelectionOperation = soExclusive); + function SelectParentComponent: Boolean; + procedure SelectionChanged; + + property IsMarkedForDeletion: Boolean read FIsMarkedForDeletion; + property RowHeight: Integer read FRowHeight write FRowHeight; + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure BringToTopInRecentList(IncCount: Boolean); + procedure CreateControl; + procedure DestroyControl; + procedure RecreateControl; + procedure SendToBottomInRecentList; + + property AvailableIndex: Integer read GetAvailableIndex; + property BarControl: TCustomdxBarControl read GetBarControl; + property BarManager: TdxBarManager read GetBarManager; + property CanVisibleIndex: Integer read GetCanVisibleIndex; + property Caption: string read GetCaption; + property Collection: TdxBarItemLinks read GetCollection write SetCollection; + property Control: TdxBarItemControl read FControl; + property Data: Integer read FData write FData default 0; + property Glyph: TBitmap read GetGlyph; + property ItemRect: TRect read FItemRect write SetItemRect; + property OriginalItemLink: TdxBarItemLink read FOriginalItemLink; + property Owner: TdxBarItemLinks read GetOwnerValue; + property PaintStyle: TdxBarPaintStyle read GetPaintStyle; + property RealItemLink: TdxBarItemLink read GetRealItemLink; + property VisibleIndex: Integer read GetVisibleIndex; + property Width: Integer read GetWidth; + published + property BeginGroup: Boolean read GetBeginGroup write SetBeginGroup default False; + property ButtonGroup: TdxBarButtonGroupPosition read FButtonGroup + write SetButtonGroup default bgpNone; + property Item: TdxBarItem read GetItem write SetItem stored False; + property MostRecentlyUsed: Boolean read FMostRecentlyUsed + write SetMostRecentlyUsed default True; + property Position: TdxBarItemPosition read FPosition write SetPosition default dxBarItemDefaultPosition; + property UserCaption: string read FUserCaption write SetUserCaption; + property UserDefine: TdxBarUserDefines read GetUserDefine write SetUserDefine default []; + property UserGlyph: TBitmap read FUserGlyph write SetUserGlyph; + property UserPaintStyle: TdxBarPaintStyle read FUserPaintStyle + write SetUserPaintStyle default psStandard; + property UserWidth: Integer read FUserWidth write SetUserWidth default 0; + property ViewLevels: TdxBarItemViewLevels read FViewLevels + write SetViewLevels default dxBarItemAllViewLevels; + property Visible: Boolean read FVisible write SetVisible; + end; + + TdxBarIterationProc = procedure(Index: Integer; ItemLink: TdxBarItemLink; + var Stop: Boolean; var Data: Pointer) of object; + + TdxBarItemLinks = class(TCollection) + private + FAssigning: Boolean; + FAvailableItems, FCanVisibleItems, FVisibleItems: TList; + FBarControl: TCustomdxBarControl; + FBarManager: TdxBarManager; + FInternal: Boolean; + FItemOptions: TdxBarItemOptions; + FLinksOwner: IdxBarLinksOwner; + FPrevRecentItemCount: Integer; + FRecentItems: TList; + FRecentItemCount: Integer; + FUseRecentItems: Boolean; + FOnChange: TNotifyEvent; + + procedure DesignerModified; + + function GetAvailableItem(Index: Integer): TdxBarItemLink; + function GetAvailableItemCount: Integer; + function GetCanVisibleItem(Index: Integer): TdxBarItemLink; + function GetCanVisibleItemCount: Integer; + function GetIndexByItemName(const AItemName: string): Integer; + function GetItem(Index: Integer): TdxBarItemLink; + function GetMostRecentItemCount: Integer; + function GetParentLinks: TdxBarItemLinks; + function GetRealVisibleItemCount: Integer; + function GetItemShowDescriptions: Boolean; + function GetItemShowShortCuts: Boolean; + function GetItemSize: TdxBarMenuItemSize; + function GetVisibleItem(Index: Integer): TdxBarItemLink; + function GetVisibleItemCount: Integer; + procedure SetItem(Index: Integer; Value: TdxBarItemLink); + procedure SetItemOptions(AValue: TdxBarItemOptions); + procedure SetRecentItemCount(Value: Integer); + + function IsUpdateLocked: Boolean; + procedure RefreshVisibilityLists; + property MostRecentItemCount: Integer read GetMostRecentItemCount; + procedure RestoreRecentItemCount; + property RecentItemCount: Integer read FRecentItemCount write SetRecentItemCount; + + procedure Loaded(CheckVisible: Boolean); + procedure CheckVisibleIntegrity; + + property ParentLinks: TdxBarItemLinks read GetParentLinks; + protected + procedure EmptyItemRects; + + function CanUseRecentItems: Boolean; + procedure InitiateActions; + function IsShortCut(AShortCut: TShortCut): Boolean; + function IsScrollable: Boolean; virtual; + + function DoFindItemWithAccel(AKey: Word; AShift: TShiftState; ACurrentLink: TdxBarItemLink): TdxBarItemLink; virtual; abstract; + function FindItemWithAccel(AKey: Word; AShift: TShiftState; ACurrentLink: TdxBarItemLink): TdxBarItemLink; + function First: TdxBarItemLink; + function Last: TdxBarItemLink; + function Next(Current: TdxBarItemLink; AAnyone: Boolean = False): TdxBarItemLink; + function Prev(Current: TdxBarItemLink; AAnyone: Boolean = False): TdxBarItemLink; + + procedure CheckLinks(ASource: TCustomIniFile; const ABaseSection: string); + procedure LoadFromIni(ASource: TCustomIniFile; const ASection: string; AStoringKind: TdxBarStoringKind); + procedure LoadUsageData(ASource: TCustomIniFile; ASection: string); + procedure SaveToIni(ADestination: TCustomIniFile; const ASection: string; AStoringKind: TdxBarStoringKind); + + procedure Merge(AItemLinks: TdxBarItemLinks); + procedure Unmerge(ABar: TdxBar); + + function AddItem(AItemClass: TdxBarItemClass; AOwner: TComponent): TdxBarItemLink; overload; + + function GetOwner: TPersistent; override; + function GetOwnerComponent: TComponent; + procedure LoadItemNames; + procedure Update(Item: TCollectionItem); override; + + property Internal: Boolean read FInternal write FInternal; + property RealVisibleItemCount: Integer read GetRealVisibleItemCount; + + function GetDefaultValue(AOption: TdxBarItemOptionValue): Variant; virtual; + function GetOptionsValue(AOption: TdxBarItemOptionValue; AItemLinks: TdxBarItemLinks): Variant; virtual; + property ItemShowDescriptions: Boolean read GetItemShowDescriptions; + property ItemShowShortCuts: Boolean read GetItemShowShortCuts; + property ItemSize: TdxBarMenuItemSize read GetItemSize; + property LinksOwner: IdxBarLinksOwner read FLinksOwner; + public + constructor Create(ABarManager: TdxBarManager; ALinksOwner: IdxBarLinksOwner); + destructor Destroy; override; + function Add: TdxBarItemLink; overload; + function Add(AItem: TdxBarItem): TdxBarItemLink; overload; + function AddItem(AItemClass: TdxBarItemClass): TdxBarItemLink; overload; + function AddButton: TdxBarItemLink; + function AddSubItem: TdxBarItemLink; + procedure Assign(Source: TPersistent); override; + function AvailableIndexOf(Value: TdxBarItemLink): Integer; + function CanContainItem(AItem: TdxBarItem; out AErrorText: string): Boolean; virtual; + function CanVisibleIndexOf(Value: TdxBarItemLink): Integer; + procedure CreateBarControl; + procedure DestroyBarControl; + procedure FreeForeignItems(ForeignBarManager: TdxBarManager); + function HasItem(AItem: TdxBarItem): Boolean; + function IsControlExists(AItem: TdxBarItemControl): Boolean; + function IsReferencedBy(ALinksOwner: IdxBarLinksOwner): Boolean; + function IndexOf(Value: TdxBarItemLink): Integer; + function Insert(AIndex: Integer): TdxBarItemLink; + function VisibleIndexOf(Value: TdxBarItemLink): Integer; + procedure Move(ACurIndex, ANewIndex: Integer); + + property AvailableItems[Index: Integer]: TdxBarItemLink read GetAvailableItem; + property AvailableItemCount: Integer read GetAvailableItemCount; + property BarControl: TCustomdxBarControl read FBarControl write FBarControl; + property BarManager: TdxBarManager read FBarManager; + property CanVisibleItems[Index: Integer]: TdxBarItemLink read GetCanVisibleItem; + property CanVisibleItemCount: Integer read GetCanVisibleItemCount; + property Items[Index: Integer]: TdxBarItemLink read GetItem write SetItem; default; + property ItemOptions: TdxBarItemOptions read FItemOptions write SetItemOptions; + property VisibleItems[Index: Integer]: TdxBarItemLink read GetVisibleItem; + property VisibleItemCount: Integer read GetVisibleItemCount; + + {$WARNINGS OFF} + property Owner: TComponent read GetOwnerComponent; // TdxBar, TdxBarCustomPopupMenu, TCustomdxBarSubItem, nil + {$WARNINGS ON} + + property OnChange: TNotifyEvent read FOnChange write FOnChange; + end; + + TdxBarControlItemLinks = class(TdxBarItemLinks) + protected + function DoFindItemWithAccel(AKey: Word; AShift: TShiftState; ACurrentLink: TdxBarItemLink): TdxBarItemLink; override; + end; + + TdxBarSubMenuControlItemLinks = class(TdxBarItemLinks) + protected + function DoFindItemWithAccel(AKey: Word; AShift: TShiftState; ACurrentLink: TdxBarItemLink): TdxBarItemLink; override; + function IsScrollable: Boolean; override; + end; + + TdxBarPaintSubMenuBarEvent = procedure(Sender: TObject; + Canvas: TCanvas; const R: TRect) of object; + + TdxBarCustomPopupMenu = class(TdxBarComponent, IcxPopupMenu, IdxBarLinksOwner, IdxBarSubMenuOwner) + private + FBackgroundBitmap: TBitmap; + FBarSize: Integer; + FEditFont: TFont; + FFont: TFont; + FInternalFontChange: Boolean; + FItemLinks: TdxBarItemLinks; + FOwnerBounds: PRect; + FOwnerItemControl: TdxBarItemControl; + FOwnerControl: TWinControl; + FOwnerWidth, FOwnerHeight: Integer; + FPopupMenuVisible: Boolean; + FShowAnimation: Boolean; + FUseOwnFont: Boolean; + FUseOwnMessageLoop: Boolean; + FOnCloseUp: TNotifyEvent; + FOnPaintBar: TdxBarPaintSubMenuBarEvent; + FOnPopup: TNotifyEvent; + + function GetItemOptions: TdxBarItemOptions; + function GetSubMenuControl: TdxBarSubMenuControl; + function GetUseRecentItems: Boolean; + procedure SetBackgroundBitmap(Value: TBitmap); + procedure SetBarManager(Value: TdxBarManager); + procedure SetBarSize(Value: Integer); + procedure SetFont(Value: TFont); + procedure SetItemLinks(Value: TdxBarItemLinks); + procedure SetItemOptions(Value: TdxBarItemOptions); + procedure SetUseOwnFont(Value: Boolean); + procedure SetUseRecentItems(Value: Boolean); + + procedure FontChanged(Sender: TObject); + procedure SubMenuCloseUp(Sender: TObject); + procedure SubMenuPopup(Sender: TObject); + procedure OwnerDesignerModified; + protected + function GetEnabled: Boolean; override; + procedure SetEnabled(Value: Boolean); override; + procedure SetVisible(Value: TdxBarItemVisible); override; + + procedure DoCloseUp; + procedure DoPopup; + function GetControlClass: TCustomdxBarControlClass; virtual; + function GetItemLinksClass: TdxBarItemLinksClass; virtual; + function IsShortCut(AShortCut: TShortCut): Boolean; virtual; + function IsShortCutKey(var Message: TWMKey): Boolean; + procedure Loaded; override; + + // IdxBarLinksOwner + function CanContainItem(AItem: TdxBarItem; out AErrorText: string): Boolean; + function CreateBarControl: TCustomdxBarControl; virtual; + function IdxBarLinksOwner.GetInstance = GetComponentInstance; + function GetItemLinks: TdxBarItemLinks; + + // IdxBarSubMenuOwner + function GetBarSize: Integer; + procedure DoPaintBar(Canvas: TCanvas; const R: TRect); virtual; + + property ItemOptions: TdxBarItemOptions read GetItemOptions write SetItemOptions; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Popup(X, Y: Integer); + procedure PopupEx(X, Y, AOwnerWidth, AOwnerHeight: Integer; + AShowAnimation: Boolean; AOwnerBounds: PRect; AUseOwnMessageLoop: Boolean = True; + AOwnerControl: TWinControl = nil); + procedure PopupFromCursorPos; + + property BackgroundBitmap: TBitmap read FBackgroundBitmap write SetBackgroundBitmap; + property BarManager: TdxBarManager read GetBarManager write SetBarManager; + property BarSize: Integer read GetBarSize write SetBarSize default 0; + property Font: TFont read FFont write SetFont stored FUseOwnFont; + property ItemLinks: TdxBarItemLinks read GetItemLinks write SetItemLinks; + property SubMenuControl: TdxBarSubMenuControl read GetSubMenuControl; + property UseOwnFont: Boolean read FUseOwnFont write SetUseOwnFont; + property UseRecentItems: Boolean read GetUseRecentItems write SetUseRecentItems default False; + property Visible: Boolean read FPopupMenuVisible; + + property OnCloseUp: TNotifyEvent read FOnCloseUp write FOnCloseUp; + property OnPaintBar: TdxBarPaintSubMenuBarEvent read FOnPaintBar write FOnPaintBar; + property OnPopup: TNotifyEvent read FOnPopup write FOnPopup; + end; + + TdxBarPopupMenu = class(TdxBarCustomPopupMenu) + published + property BackgroundBitmap; + property BarManager; + property BarSize; + property Font; + property ItemLinks; + property ItemOptions; + property UseOwnFont; + property UseRecentItems; + + property OnCloseUp; + property OnPaintBar; + property OnPopup; + end; + + { TdxBarCustomApplicationMenu } + + TdxBarExtraPaneNotifyEvent = procedure(Sender: TObject; AIndex: Integer) of object; + TdxBarExtraPaneGetDisplayTextEvent = procedure(Sender: TObject; AIndex: Integer; var ADisplayText: string) of object; + + TdxBarExtraPaneItem = class(TCollectionItem) + private + FData: Integer; + FDisplayText: string; + FImageIndex: Integer; + FText: string; + procedure SetDisplayText(const Value: string); + procedure SetText(const Value: string); + public + constructor Create(Collection: TCollection); override; + procedure Assign(Source: TPersistent); override; + + property Data: Integer read FData write FData; + published + property ImageIndex: Integer read FImageIndex write FImageIndex default -1; + property DisplayText: string read FDisplayText write SetDisplayText; + property Text: string read FText write SetText; + end; + + TdxBarExtraPaneItems = class(TCollection) + private + FApplicationMenu: TdxBarCustomApplicationMenu; + + function GetItem(Index: Integer): TdxBarExtraPaneItem; + procedure SetItem(Index: Integer; Value: TdxBarExtraPaneItem); + protected + function GetOwner: TPersistent; override; + public + constructor Create(AApplicationMenu: TdxBarCustomApplicationMenu); + function Add: TdxBarExtraPaneItem; + function IndexOf(const AItemText: string): Integer; + function Insert(AIndex: Integer): TdxBarExtraPaneItem; + + property Items[Index: Integer]: TdxBarExtraPaneItem read GetItem write SetItem; default; + end; + + TdxBarApplicationMenuExtraPane = class(TPersistent) + private + FApplicationMenu: TdxBarCustomApplicationMenu; + FSize: Integer; + FWidthRatio: Double; + FItems: TdxBarExtraPaneItems; + FListItem: TdxBarExtraPaneListItem; + FOnItemClick: TdxBarExtraPaneNotifyEvent; + FOnGetItemDisplayText: TdxBarExtraPaneGetDisplayTextEvent; + + function IsHeaderStored: Boolean; + function IsWidthRatioStored: Boolean; + function GetHeader: string; + function GetListItem: TdxBarExtraPaneListItem; + procedure SetItems(AValue: TdxBarExtraPaneItems); + procedure SetHeader(AValue: string); + + procedure ItemClick(Sender: TObject); + procedure GetItemDisplayText(Sender: TObject; AIndex: Integer; var ADisplayText: string); + + property ListItem: TdxBarExtraPaneListItem read GetListItem; + protected + function GetOwner: TPersistent; override; + public + constructor Create(AnApplicationMenu: TdxBarCustomApplicationMenu); + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + published + property WidthRatio: Double read FWidthRatio write FWidthRatio stored IsWidthRatioStored; + property Size: Integer read FSize write FSize default 0; + property Items: TdxBarExtraPaneItems read FItems write SetItems; + property Header: string read GetHeader write SetHeader stored IsHeaderStored; + + property OnItemClick: TdxBarExtraPaneNotifyEvent read FOnItemClick write FOnItemClick; + property OnGetItemDisplayText: TdxBarExtraPaneGetDisplayTextEvent read FOnGetItemDisplayText write FOnGetItemDisplayText; + end; + + TdxBarApplicationMenuButtons = class; + + TdxBarApplicationMenuButton = class(TCollectionItem) + private + FInternalItem: TdxBarApplicationMenuButtonItem; + FExternalItem: TdxBarButton; + FNotifyList: TdxBarComponentList; + + function GetCollection: TdxBarApplicationMenuButtons; + function GetWidth: Integer; + procedure SetItem(Value: TdxBarButton); + procedure SetWidth(Value: Integer); + procedure ButtonClick(Sender: TObject); + + procedure ExternalItemChanged(Sender: TObject; AComponent: TComponent; AAction: TcxComponentCollectionNotification); + procedure UpdateInternalItem; + protected + property InternalItem: TdxBarApplicationMenuButtonItem read FInternalItem; + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + property Collection: TdxBarApplicationMenuButtons read GetCollection; + published + property Item: TdxBarButton read FExternalItem write SetItem; + property Width: Integer read GetWidth write SetWidth default 0; + end; + + TdxBarApplicationMenuButtons = class(TCollection) + private + FApplicationMenu: TdxBarCustomApplicationMenu; + + function GetItem(Index: Integer): TdxBarApplicationMenuButton; + procedure SetItem(Index: Integer; Value: TdxBarApplicationMenuButton); + procedure PopulateItemLinks(AItemLinks: TdxBarItemLinks); + protected + function GetOwner: TPersistent; override; + public + constructor Create(AApplicationMenu: TdxBarCustomApplicationMenu); + function Add: TdxBarApplicationMenuButton; + function Insert(AIndex: Integer): TdxBarApplicationMenuButton; + + property Items[Index: Integer]: TdxBarApplicationMenuButton read GetItem write SetItem; default; + end; + + TdxBarApplicationMenuButtonItemLinks = class(TdxBarSubMenuControlItemLinks) + protected + procedure CalcItemsRects(ARect: TRect); + function IsScrollable: Boolean; override; + end; + + TdxBarCustomApplicationMenu = class(TdxBarCustomPopupMenu) + private + FButtons: TdxBarApplicationMenuButtons; + FExtraPane: TdxBarApplicationMenuExtraPane; + FExtraPaneEvents: TNotifyEvent; + + // ExtraPane + function GetExtraPaneWidthRatio: Double; + function GetExtraPaneSize: Integer; + function GetExtraPaneItems: TdxBarExtraPaneItems; + function GetExtraPaneHeader: string; + function GetOnExtraPaneItemClick: TdxBarExtraPaneNotifyEvent; + procedure SetExtraPaneWidthRatio(AValue: Double); + procedure SetExtraPaneSize(AValue: Integer); + procedure SetExtraPaneItems(AValue: TdxBarExtraPaneItems); + procedure SetExtraPaneHeader(AValue: string); + procedure SetOnExtraPaneItemClick(AValue: TdxBarExtraPaneNotifyEvent); + + procedure SetButtons(AValue: TdxBarApplicationMenuButtons); + procedure SetExtraPane(AValue: TdxBarApplicationMenuExtraPane); + protected + function GetControlClass: TCustomdxBarControlClass; override; + function GetItemLinksClass: TdxBarItemLinksClass; override; + function IsShortCut(AShortCut: TShortCut): Boolean; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + property Buttons: TdxBarApplicationMenuButtons read FButtons write SetButtons; + property ExtraPane: TdxBarApplicationMenuExtraPane read FExtraPane write SetExtraPane; + property ExtraPaneEvents: TNotifyEvent read FExtraPaneEvents write FExtraPaneEvents; + + // obsolete + property ExtraPaneWidthRatio: Double read GetExtraPaneWidthRatio write SetExtraPaneWidthRatio; + property ExtraPaneSize: Integer read GetExtraPaneSize write SetExtraPaneSize; + property ExtraPaneItems: TdxBarExtraPaneItems read GetExtraPaneItems write SetExtraPaneItems; + property ExtraPaneHeader: string read GetExtraPaneHeader write SetExtraPaneHeader; + property OnExtraPaneItemClick: TdxBarExtraPaneNotifyEvent read GetOnExtraPaneItemClick write SetOnExtraPaneItemClick; + end; + + {----------------------- + Visual components + -----------------------} + + { dock controls } + + TdxDockControl = class(TCustomControl) + private + FAllowDocking: Boolean; + FBackgroundBitmap: TBitmap; + FBackgroundTempBitmap: TBitmap; + FBarManager: TdxBarManager; + FDockingStyle: TdxBarDockingStyle; + FIAccessibilityHelper: IdxBarAccessibilityHelper; + FIsBarHandleDestroying: Boolean; + FRowList: TList; + FRowMarginSize: Integer; + + procedure BitmapChanged(Sender: TObject); + function GetBars: TdxBars; + function GetDockingStyle: TdxBarDockingStyle; + function GetHorizontal: Boolean; + function GetIAccessibilityHelper: IdxBarAccessibilityHelper; + function GetIsDesigning: Boolean; + function GetIsLoading: Boolean; + function GetMain: Boolean; + function GetRow(Index: Integer): TdxDockRow; + function GetRowCount: Integer; + function GetTopLeft: Boolean; + function GetVertical: Boolean; + procedure SetBarManager(Value: TdxBarManager); + procedure SetBackgroundBitmap(Value: TBitmap); + procedure WMDestroy(var Message: TMessage); message WM_DESTROY; + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND; + procedure WMGetObject(var Message: TMessage); message WM_GETOBJECT; + procedure WMLButtonDblClk(var Message: TWMLButtonDblClk); message WM_LBUTTONDBLCLK; + procedure WMMouseActivate(var Message: TWMMouseActivate); message WM_MOUSEACTIVATE; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure WMRButtonDown(var Message: TWMRButtonDown); message WM_RBUTTONDOWN; + procedure WMSize(var Message: TWMSize); message WM_SIZE; + procedure WMWindowPosChanged(var Message: TWMWindowPosChanged); message WM_WINDOWPOSCHANGED; + procedure CMSysColorChange(var Message: TMessage); message CM_SYSCOLORCHANGE; + protected + procedure AlignControls(AControl: TControl; var Rect: TRect); override; + procedure CreateParams(var Params: TCreateParams); override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure RequestAlign; override; + + procedure AddBarControl(ABarControl: TdxBarControl; APos: TPoint; Update: Boolean); + procedure DeleteBarControl(ABarControl: TdxBarControl; ADockCol: TObject; Update: Boolean); + procedure MoveBarControl(ABarControl: TdxBarControl; APos: TPoint); + + procedure AssignPositions; + procedure BarManagerChanged; virtual; + procedure CalcLayout; virtual; + procedure CalcRowToolbarPositions(ARowIndex: Integer; AClientSize: Integer); virtual; + function CanDocking(Bar: TdxBar): Boolean; virtual; + procedure ColorChanged; virtual; + function GetDockZoneBounds: TRect; + procedure GetDockZoneMargins(Row, ZoneNumber: Integer; var M1, M2: Integer); + function GetRectForRow(ARow: Integer): TRect; + function GetClientSize: Integer; virtual; + function GetSize: Integer; + function GetRowAtPos(APos: TPoint; var Insert: Boolean): Integer; + function GetColAtPos(ARow: Integer; APos: TPoint): Integer; + procedure GetPosForRow(Row: Integer; OneOnRow: Boolean; var P: TPoint); + function GetSunkenBorder: Boolean; virtual; + function GetMainForm: TCustomForm; + function GetMasterForm: TCustomForm; + function GetParentForm: TCustomForm; + function IsMultiRow: Boolean; virtual; + procedure NCChanged; + procedure PaintBarControls; + procedure SetSize; virtual; + procedure ShowCustomizePopup; virtual; + procedure UpdateDock; + + function GetDockedBarControlClass: TdxBarControlClass; virtual; + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; virtual; + function GetPainter: TdxBarPainter; virtual; + + procedure FillBackground(DC: HDC; const ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); virtual; + function IsBackgroundBitmap: Boolean; virtual; + function IsDrawDesignBorder: Boolean; virtual; + function IsTransparent: Boolean; virtual; + procedure RepaintBarControls; virtual; + procedure ResetBackground; virtual; + procedure UpdateDoubleBuffered; virtual; + property BackgroundTempBitmap: TBitmap read FBackgroundTempBitmap; + + property AllowDocking: Boolean read FAllowDocking write FAllowDocking default True; + property BackgroundBitmap: TBitmap read FBackgroundBitmap write SetBackgroundBitmap; + property Horizontal: Boolean read GetHorizontal; + property IsBarHandleDestroying: Boolean read FIsBarHandleDestroying write FIsBarHandleDestroying; + property IsDesigning: Boolean read GetIsDesigning; + property IsLoading: Boolean read GetIsLoading; + property Main: Boolean read GetMain; + property MainForm: TCustomForm read GetMainForm; + property MasterForm: TCustomForm read GetMasterForm; + property Painter: TdxBarPainter read GetPainter; + property ParentForm: TCustomForm read GetParentForm; + property RowMarginSize: Integer read FRowMarginSize write FRowMarginSize; + property SunkenBorder: Boolean read GetSunkenBorder; + property TopLeft: Boolean read GetTopLeft; + property Vertical: Boolean read GetVertical; + public + constructor Create(AOwner: TComponent); override; + constructor CreateEx(AOwner: TComponent; ABarManager: TdxBarManager; + ADockStyle: TdxBarDockingStyle); + destructor Destroy; override; + + procedure InitiateAction; override; + + property BarManager: TdxBarManager read FBarManager write SetBarManager; + property Bars: TdxBars read GetBars; + property DockingStyle: TdxBarDockingStyle read GetDockingStyle; + property IAccessibilityHelper: IdxBarAccessibilityHelper read GetIAccessibilityHelper; + property RowCount: Integer read GetRowCount; + property RowList: TList read FRowList; + property Rows[Index: Integer]: TdxDockRow read GetRow; + end; + + TdxBarDockAlign = (dalNone, dalTop, dalBottom, dalLeft, dalRight); + + TdxBarDockControl = class(TdxDockControl) + private + FAllowZeroSizeInDesignTime: Boolean; + FSunkenBorder: Boolean; + FUseOwnColor: Boolean; + FUseOwnSunkenBorder: Boolean; + function GetAlign: TdxBarDockAlign; + function GetColor: TColor; + function GetIsLoading: Boolean; + function GetParentColor: Boolean; + procedure SetAlign(Value: TdxBarDockAlign); + procedure SetAllowZeroSizeInDesignTime(Value: Boolean); + procedure SetColor(Value: TColor); + procedure SetParentColor(Value: Boolean); + procedure SetSunkenBorder(Value: Boolean); + procedure SetUseOwnColor(Value: Boolean); + procedure SetUseOwnSunkenBorder(Value: Boolean); + function IsColorStored: Boolean; + procedure WMCreate(var Message: TWMCreate); message WM_CREATE; + procedure WMSize(var Message: TWMSize); message WM_SIZE; + protected + function AllowUndockWhenLoadFromIni: Boolean; virtual; + procedure CreateParams(var Params: TCreateParams); override; + procedure Paint; override; + procedure BarManagerChanged; override; + function CanDocking(Bar: TdxBar): Boolean; override; + procedure ColorChanged; override; + function GetClientSize: Integer; override; + function GetMinSize: Integer; + function GetSunkenBorder: Boolean; override; + property IsLoading: Boolean read GetIsLoading; + public + constructor Create(AOwner: TComponent); override; + published + property Align: TdxBarDockAlign read GetAlign write SetAlign; + property AllowDocking; + property AllowZeroSizeInDesignTime: Boolean read FAllowZeroSizeInDesignTime + write SetAllowZeroSizeInDesignTime default False; + property Anchors; + property BarManager; + property Color read GetColor write SetColor stored IsColorStored; + property ParentColor: Boolean read GetParentColor write SetParentColor + stored IsColorStored; + property SunkenBorder: Boolean read GetSunkenBorder write SetSunkenBorder + stored FUseOwnSunkenBorder; + property UseOwnColor: Boolean read FUseOwnColor write SetUseOwnColor default False; + property UseOwnSunkenBorder: Boolean read FUseOwnSunkenBorder + write SetUseOwnSunkenBorder default False; + property Visible; + property BackgroundBitmap; + + property OnClick; + property OnDblClick; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnResize; + end; + + { TdxBarExtraPaneDockControl } + + TdxBarExtraPaneDockControl = class(TdxBarDockControl) + protected + procedure CalcRowToolbarPositions(ARowIndex: Integer; AClientSize: Integer); override; + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; override; + function GetDockedBarControlClass: TdxBarControlClass; override; + public + constructor Create(AOwner: TComponent); override; + end; + + { shadow support } + + TdxBarShadowCorner = (scLeft, scRight, scTop); + TdxBarShadowCorners = set of TdxBarShadowCorner; + + TdxBarShadowPartKind = (spHorizontal, spVertical); + + TdxBarShadowPart = class(TCustomControl) + private + FCorners: TdxBarShadowCorners; + FImage: TBitmap; + FKind: TdxBarShadowPartKind; + FOwner: TdxBarShadow; + function GetControl: TWinControl; + function GetShadowSize: Integer; + function GetTransparent: Boolean; + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + protected + function CanShow: Boolean; + procedure CreateParams(var Params: TCreateParams); override; + procedure Paint; override; + procedure UpdateImage; + property Control: TWinControl read GetControl; + property Image: TBitmap read FImage; + property Owner: TdxBarShadow read FOwner; + property ShadowSize: Integer read GetShadowSize; + property Transparent: Boolean read GetTransparent; + public + constructor CreateEx(AOwner: TdxBarShadow; + AKind: TdxBarShadowPartKind; ACorners: TdxBarShadowCorners); + destructor Destroy; override; + procedure Hide; + procedure Show; + procedure UpdateBounds(const ABounds: TRect); + property Corners: TdxBarShadowCorners read FCorners; + property Kind: TdxBarShadowPartKind read FKind; + end; + + TdxBarShadow = class + private + FHorizontal: Boolean; + FOwner: TWinControl; + FParts: array[0..4] of TdxBarShadowPart; + FVisible: Boolean; + function GetShadowSize: Integer; + function GetTransparent: Boolean; + procedure SetVisible(Value: Boolean); + protected + R1, R2: TRect; + procedure CreateParts; + procedure DestroyParts; + procedure Hide; + procedure Show; + property Transparent: Boolean read GetTransparent; + public + constructor Create(AOwner: TWinControl); + destructor Destroy; override; + procedure Refresh; + procedure SetOwnerBounds(AR1, AR2: TRect); + property Horizontal: Boolean read FHorizontal; + property Owner: TWinControl read FOwner; + property ShadowSize: Integer read GetShadowSize; + property Visible: Boolean read FVisible write SetVisible; + end; + + { TCustomdxBarControl } + + TdxBarMarkState = (msNone, msSelected, msPressed); + + TdxBarItemControlParentKind = (pkBar, pkSubItemOrPopupMenu); + TdxBarPaintType = (ptHorz, ptMenu, ptVert); + TdxBarState = (bsCreatingControls, bsDestroyingControls, bsDestroyingWindow, bsHideAll, bsPaintItem, bsRepaintBar, bsUpdatingCanvasFont); + TdxBarStates = set of TdxBarState; + TdxBarViewState = (bvsNormal, bvsHot); + + TCustomdxBarControl = class(TCustomControl, IcxMouseTrackingCaller, IcxMouseTrackingCaller2) + private + FActiveCanvas: TcxCanvas; + FBackgroundTempBitmap: TBitmap; + FBkBrush: HBRUSH; + FCanvas: TcxCanvas; + FChildBar: TCustomdxBarControl; + FClickedControl: TdxBarItemControl; + FClosedByEscape: Boolean; + FCurrentMessage: TMessage; + FDockControl: TdxDockControl; + FDockingStyle: TdxBarDockingStyle; + FDragDown: Boolean; + FDragPoint: TPoint; + FExpandedItemLinks: TList; + FIAccessibilityHelper: IdxBarAccessibilityHelper; + FIgnoreMouseClick: Boolean; + FIsActive: Boolean; + FIsDowned: Boolean; + FItemLinks: TdxBarItemLinks; + FMovingChanging: Boolean; + FOwnerBounds: TRect; + FOwnerControl: TWinControl; + FParentBar: TCustomdxBarControl; + FPrevActiveBarControl: TCustomdxBarControl; + + FPrevTrackedLink: TdxBarItemLink; //#DG !! + +//#DG FSelectedItem: TdxBarItemControl; // obsolete + FSelectedLink: TdxBarItemLink; // to replace obsolete SelectedItem + FShadow: TdxBarShadow; + + FTextSize, FEditTextSize: Integer; + FMarkSize: Integer; + FMenuArrowHeight, FMenuArrowWidth: Integer; + FComboBoxArrowWidth: Integer; + FIconAreaSize: Integer; + FRatio: Double; + + FOnDestroy: TNotifyEvent; + + procedure MouseDownNotifyControls(ALinkAtPos: TdxBarItemLink; const AMousePos: TPoint; Button: TMouseButton; Shift: TShiftState); + procedure MouseNotifyControls(ALinkAtPos: TdxBarItemLink; const AMousePos: TPoint; Shift: TShiftState); + procedure MouseUpNotifyControls(ALinkAtPos: TdxBarItemLink; const AMousePos: TPoint; Button: TMouseButton; Shift: TShiftState); + + function GetActiveCanvas: TcxCanvas; + function GetBarControlOwnerBrush: HBRUSH; + function GetBarManager: TdxBarManager; + function GetCanvas: TcxCanvas; + function GetFlat: Boolean; + function GetIAccessibilityHelper: IdxBarAccessibilityHelper; + function GetIsDestroying: Boolean; + function GetOwnerLinkBounds(AOwnerPart: Boolean): TRect; + function GetPainterClass: TdxBarPainterClass; + function GetSelectedControlAtDesign: TdxBarItemControl; + function GetSelectedControl: TdxBarItemControl; + function ItemAtMousePos: TdxBarItemControl; + procedure SetChildBar(Value: TCustomdxBarControl); + procedure SetDockControl(Value: TdxDockControl); + procedure SetIsActive(Value: Boolean); + procedure SetParentBar(Value: TCustomdxBarControl); + procedure SetViewState(Value: TdxBarViewState); + + procedure WMCaptureChanged(var Message: TMessage); message WM_CAPTURECHANGED; + procedure WMDestroy(var Message: TMessage); message WM_DESTROY; + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND; + procedure WMKeyDown(var Message: TWMKeyDown); message WM_KEYDOWN; + procedure WMLButtonDblClk(var Message: TWMLButtonDblClk); message WM_LBUTTONDBLCLK; + procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; + procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; + procedure WMMouseActivate(var Message: TWMMouseActivate); message WM_MOUSEACTIVATE; + procedure WMMouseMove(var Message: TWMMouseMove); message WM_MOUSEMOVE; + procedure WMNCPaint(var Message: TMessage); message WM_NCPAINT; + procedure WMPaint(var Message: TWMPaint); message WM_PAINT; + procedure WMRepaintBar(var Message: TMessage); message WM_REPAINTBAR; + procedure WMSetCursor(var Message: TWMSetCursor); message WM_SETCURSOR; + procedure WMSize(var Message: TWMSize); message WM_SIZE; + procedure WMWindowPosChanged(var Message: TWMWindowPosChanged); message WM_WINDOWPOSCHANGED; + protected + FItemsRect: TRect; + FLastMousePos: TPoint; + FMarkState: TdxBarMarkState; + FPainter: TdxBarPainter; + FState: TdxBarStates; + FViewInfo: TCustomdxBarControlViewInfo; + FViewState: TdxBarViewState; + FVisibleItemsRect: TRect; + + procedure AdjustSize; override; + procedure AdjustHintWindowPosition(var APos: TPoint; const ABoundsRect: TRect; AHeight: Integer); virtual; + procedure AfterControlEscape(AControl: TdxBarItemControl); virtual; + procedure AfterMouseMove(Shift: TShiftState; X, Y: Integer); virtual; + procedure CreateWindowHandle(const Params: TCreateParams); override; + procedure CreateWnd; override; + procedure DestroyWindowHandle; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseLeave; dynamic; { IcxMouseTrackingCaller } + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + function NeedsMouseWheel: Boolean; virtual; + procedure ProcessMouseDownMessageForMeaningParent(AWnd: HWND; AMsg: UINT; + const AMousePos: TPoint); virtual; + function PtInCaller(const P: TPoint): Boolean; { IcxMouseTrackingCaller2 } + procedure Resize; override; + procedure WindowPosChanged(var Message: TWMWindowPosChanged); virtual; + procedure WndProc(var Message: TMessage); override; + + function CalcChildBarBounds(out ARect: TRect): Boolean; virtual; + procedure CalcControlsPositions; virtual; + procedure CalcDragOverParameters(const ACursorPos: TPoint; + var ADragOverItemLink: TdxBarItemLink; + var AIsBeginGroup, AIsFirstPart, AIsVerticalDirection: Boolean); virtual; + procedure CalcDrawingConsts; virtual; + procedure CalcItemsRect; virtual; + procedure CalcColumnItemRects(ATopIndex: Integer; + out ALastItemBottom: Integer); virtual; + procedure CalcRowItemRects; virtual; + procedure CalcItemRects(APaintStyle: TdxBarPaintType; ATopIndex: Integer = 0); virtual; + procedure CalcLayout; virtual; + + procedure BeforeDestroyHandle; + procedure CreateControls; virtual; + procedure DestroyControls; virtual; + procedure ExpandContainerItems; + procedure CollapseContainerItems; + procedure LayoutChanged; virtual; + procedure RecreateControls; + procedure UpdateControlByMouse; + + function CanActiveChange: Boolean; virtual; + function CanAlignControl(AControl: TdxBarItemControl): Boolean; virtual; + function CanCallInheritedNCCalcSize: Boolean; virtual; // obsolete + function CanControlPaint(AControl: TdxBarItemControl): Boolean; virtual; + //function CanCallInheritedNCPaint: Boolean; virtual; + function CanCustomizing: Boolean; virtual; + function CanDeactivate(ABarManager: TdxBarManager; AActiveWindow: HWND): Boolean; virtual; + function CanDrawClippedItem(AItemRect: TRect): Boolean; virtual; + function CanHide: Boolean; + function CanProcessMouseMessage: Boolean; virtual; + function CanShowPopupMenuOnMouseClick(AMousePressed: Boolean): Boolean; virtual; + function CanShowHint: Boolean; virtual; + function CheckLockUpdate: Boolean; virtual; + function ChildrenHaveShadows: Boolean; virtual; + procedure CorrectVisibleItemsRectTop; virtual; + procedure CorrectVisibleItemsRectBottom; virtual; + procedure CustomizePrepare(APoint: TPoint; ASecondClick: Boolean); virtual; + procedure DblClickOnItem(AItemControl: TdxBarItemControl); dynamic; + procedure DoBarGetFocus(ASelectedItem: TdxBarItemControl); virtual; + procedure DoBarLostFocus; virtual; + procedure DoBarMouseEnter(Shift: TShiftState; const APoint: TPoint; AItemControl: TdxBarItemControl); virtual; + procedure DoBarMouseDown(Button: TMouseButton; Shift: TShiftState; + const APoint: TPoint; AItemControl: TdxBarItemControl; APointInClientRect: Boolean); virtual; + procedure DoBarMouseLeave; virtual; + procedure DoBarMouseMove(Shift: TShiftState; const APoint: TPoint; AItemControl: TdxBarItemControl); virtual; + procedure DoBarMouseUp(Button: TMouseButton; Shift: TShiftState; + const APoint: TPoint; AItemControl: TdxBarItemControl; APointInClientRect: Boolean); virtual; + procedure DoCreateControls; virtual; + procedure DoDestroy; virtual; + procedure DoDestroyControls; virtual; + procedure DoHideAll; virtual; + procedure DoPaintItem(AControl: TdxBarItemControl; ACanvas: TcxCanvas; const AItemRect: TRect); virtual; + procedure DoRepaintBar(ARecreateControls: Boolean); virtual; + procedure DoSetIsActive(AValue: Boolean); virtual; + procedure DrawItems; virtual; + procedure DrawSelectedItem(ADC: HDC; AControl: TdxBarItemControl; const AItemRect: TRect); + procedure DragOver(X, Y: Integer; var Accept: Boolean); reintroduce; virtual; + function DoFindLinkWithAccel(AKey: Word; AShift: TShiftState; ACurrentLink: TdxBarItemLink): TdxBarItemLink; virtual; + function FindLinkWithAccel(AKey: Word; AShift: TShiftState; ACurrentLink: TdxBarItemLink; out ADuplicate: Boolean): TdxBarItemLink; virtual; + procedure FocusItemControl(AItemControl: TdxBarItemControl); virtual; + procedure FocusNextBarControl(AForward: Boolean); + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; virtual; abstract; + function GetBackgroundBitmap: TBitmap; virtual; abstract; + function GetBeginGroupSize: Integer; virtual; abstract; + function GetBehaviorOptions: TdxBarBehaviorOptions; virtual; + function GetClientOffset: TPoint; + function GetDefaultItemHeight(AItem: TdxBarItemControl): Integer; virtual; + function GetDefaultItemGlyph: TBitmap; virtual; + function GetEditFont: TFont; virtual; + function GetEditFontHandle: HFONT; + function GetEquivalentParentBar: TCustomdxBarControl; + function GetFader: TdxFader; virtual; + function GetFullItemRect(Item: TdxBarItemControl): TRect; virtual; + function GetIsCustomizing: Boolean; virtual; + function GetIsFocused: Boolean; + function GetIsMainMenu: Boolean; virtual; abstract; + function GetIsShadowVisible: Boolean; virtual; + function GetIsStatusBar: Boolean; virtual; abstract; + function GetItemControlDefaultViewLevel(AItemControl: TdxBarItemControl): TdxBarItemViewLevel; virtual; + function GetItemControlOffset(AItemLink: TdxBarItemLink): Integer; virtual; + function GetItemRectEx(Item: TdxBarItemControl; IsBeginGroup: Boolean): TRect; virtual; + function GetItemRegion(Item: TdxBarItemControl): HRGN; virtual; + function GetItemScreenRect(Item: TdxBarItemControl): TRect; + function GetMarkDrawState: TdxBarMarkState; virtual; + function GetMarkSize: Integer; virtual; + function GetNormalItemHeight: Integer; virtual; + function GetOwnerControl: TWinControl; virtual; + function GetPainter: TdxBarPainter; virtual; + function GetPaintType: TdxBarPaintType; virtual; + function GetSelectableObject: TPersistent; virtual; + function GetSelectionOperation(AButton: TMouseButton; AShift: TShiftState; + ASelectableItem: IdxBarSelectableItem): TdxBarSelectionOperation; + function GetToolbarBrush: HBRUSH; virtual; + function GetToolbarDownedBrush: HBRUSH; virtual; + function GetToolbarDownedSelBrush: HBRUSH; virtual; + function GetToolbarSelBrush: HBRUSH; virtual; + function GetViewInfoClass: TCustomdxBarControlViewInfoClass; virtual; abstract; + procedure RepaintBarEx(ARecreateControls: Boolean); + procedure SetControlVisible(AControl: TdxBarItemControl); virtual; + procedure SetItemLinks(Value: TdxBarItemLinks); virtual; + + function GetNCDrawingDC(AUpdatedRgn: HRGN): HDC; virtual; + procedure ReleaseNCDrawingDC(ADC: HDC); virtual; + + function GetBorderSize: Integer; virtual; + function GetIconAreaSize: Integer; virtual; + function GetTextSize: Integer; virtual; + + function GetClientBounds: TRect; + function GetMouseTrackingBounds: TRect; virtual; + function GetNCRect: TRect; + function GetWindowRect: TRect; + function GetWindowPoint(const AClientPoint: TPoint): TPoint; + + function HasShadow: Boolean; virtual; + procedure HideAllByEscape; virtual; + function HideOnClick: Boolean; virtual; + function IsChildBar(Value: TCustomdxBarControl): Boolean; virtual; + function IsChildWindow(AWnd: HWND): Boolean; + function IsControlExists(ABarItemControl: TdxBarItemControl): Boolean; virtual; + function IsLinkedToOwner: Boolean; virtual; + function IsMeaningParent(AWnd: HWND): Boolean; virtual; + function IsPopup: Boolean; virtual; + function IsVerticalDirection: Boolean; virtual; + function IsWindowEnabled: Boolean; virtual; + procedure MakeItemControlFullyVisible(AItemControl: TdxBarItemControl); virtual; + + function MarkExists: Boolean; virtual; + function MarkRect: TRect; virtual; + function MouseOnMark(const AMousePos: TPoint): Boolean; overload; + function MouseOnMark: Boolean; overload; + procedure SetMarkState(Value: TdxBarMarkState); virtual; abstract; + + procedure ActivateHint(AShow: Boolean; const ACustomHint: string; AHintObject: TObject = nil); + function CreateHintViewInfo(const AHintText, AShortCut: string; AScreenTip: TdxBarScreenTip): TdxBarCustomHintViewInfo; + function GetHintPosition(const AItemBounds: TRect; const ACursorPos: TPoint; AHeight: Integer): TPoint; + + function NeedShowGlyphAndCheckForItem: Boolean; virtual; + function NotHandleMouseMove(ACheckLastMousePos: Boolean = True): Boolean; virtual; + procedure PaintItem(ACanvas: TcxCanvas; AControl: TdxBarItemControl); virtual; + procedure ResizeShadow; + procedure SetCursorForMoving(AMoving: Boolean); + procedure SetDockingStyle(Value: TdxBarDockingStyle); virtual; + procedure SetFont; virtual; abstract; + procedure SetLayeredAttributes; virtual; + + function SelectedItemWantsKey(Key: Word): Boolean; + procedure SelectItemControl(AItemControl: TdxBarItemControl; AButton: TMouseButton; AShift: TShiftState); virtual; + procedure SetAccelSelectedItem(AItemControl: TdxBarItemControl; ADuplicate: Boolean); virtual; + procedure SetKeySelectedItem(Value: TdxBarItemControl); virtual; + procedure SetMouseSelectedItem(Value: TdxBarItemControl); virtual; + procedure SetSelectedControl(Value: TdxBarItemControl); virtual; + + procedure Show; + procedure UpdateCanvasFont; + procedure UpdateControlStyle; + procedure UpdateItem(AControl: TdxBarItemControl); virtual; abstract; + procedure ViewStateChanged(APrevValue: TdxBarViewState); virtual; + function WantMouse: Boolean; + + procedure DoShowPopup(ASelectedControl: TdxBarItemControl); + procedure InitCustomizationPopup(AItemLinks: TdxBarItemLinks); virtual; + procedure ShowPopup(AItem: TdxBarItemControl); virtual; + + function AllowNCPaint: Boolean; virtual; + procedure FillBackground(DC: HDC; const ARect: TRect; ABrush: HBRUSH; AColor: TColor; + AIsClientArea: Boolean); virtual; abstract; + procedure FillBackgroundRgn(DC: HDC; ARgn: HRGN; ABrush: HBRUSH; AIsClientArea: Boolean); virtual; + procedure FullInvalidate; + procedure FullRepaint; + procedure InvalidateNCRect(ARect: TRect); + function IsInternal: Boolean; virtual; + function IsBackgroundBitmap: Boolean; virtual; + function IsNeedBufferedOnGlass(AControl: TdxBarItemControl): Boolean; + function IsTransparent: Boolean; virtual; + function NCOffset: TPoint; virtual; + procedure NCPaint(ADC: HDC); virtual; + function PointBarToDock(const APoint: TPoint): TPoint; + procedure ResetBackground; virtual; + procedure UpdateDoubleBuffered; virtual; + + property BackgroundTempBitmap: TBitmap read FBackgroundTempBitmap; + + property ChildBar: TCustomdxBarControl read FChildBar write SetChildBar; + property ClosedByEscape: Boolean read FClosedByEscape write FClosedByEscape; + property DockControl: TdxDockControl read FDockControl write SetDockControl; + property DockingStyle: TdxBarDockingStyle read FDockingStyle write SetDockingStyle; + property Flat: Boolean read GetFlat; // TODO: obsolete + property IgnoreMouseClick: Boolean read FIgnoreMouseClick write FIgnoreMouseClick; + property IsDestroying: Boolean read GetIsDestroying; + property IsDowned: Boolean read FIsDowned write FIsDowned; + property IsMainMenu: Boolean read GetIsMainMenu; + property IsStatusBar: Boolean read GetIsStatusBar; + property IsShadowVisible: Boolean read GetIsShadowVisible; + property MarkSize: Integer read FMarkSize; + property MarkState: TdxBarMarkState read FMarkState write SetMarkState; + property MarkDrawState: TdxBarMarkState read GetMarkDrawState; + property SelectedControlAtDesign: TdxBarItemControl read GetSelectedControlAtDesign; + property SelectedControl: TdxBarItemControl read GetSelectedControl write SetSelectedControl; + property SelectedLink: TdxBarItemLink read FSelectedLink write FSelectedLink; + property Shadow: TdxBarShadow read FShadow; + property ViewState: TdxBarViewState read FViewState write SetViewState; + + property IconAreaSize: Integer read FIconAreaSize; + property BeginGroupSize: Integer read GetBeginGroupSize; + property OwnerBounds: TRect read FOwnerBounds write FOwnerBounds; + property OwnerControl: TWinControl read GetOwnerControl write FOwnerControl; + property OwnerLinkBounds[AOwnerPart: Boolean]: TRect read GetOwnerLinkBounds; + property RealOwnerControl: TWinControl read FOwnerControl; + + property BarControlOwnerBrush: HBRUSH read GetBarControlOwnerBrush; + property EditFont: TFont read GetEditFont; + property Painter: TdxBarPainter read GetPainter; + property PainterClass: TdxBarPainterClass read GetPainterClass; + property ToolbarBrush: HBRUSH read GetToolbarBrush; + property ToolbarDownedBrush: HBRUSH read GetToolbarDownedBrush; + property ToolbarDownedSelBrush: HBRUSH read GetToolbarDownedSelBrush; + property ToolbarSelBrush: HBRUSH read GetToolbarSelBrush; + + property ItemsRect: TRect read FItemsRect; + property NCRect: TRect read GetNCRect; + property VisibleItemsRect: TRect read FVisibleItemsRect; + property WindowRect: TRect read GetWindowRect; + + property ActiveCanvas: TcxCanvas read GetActiveCanvas; + property Ratio: Double read FRatio; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure BarGetFocus(ASelectedItem: TdxBarItemControl); + procedure BarLostFocus; + procedure BeforeDestruction; override; + function GetItemRect(Item: TdxBarItemControl): TRect; + procedure Hide; virtual; abstract; + procedure HideAll; virtual; + function IsOnGlass: Boolean; virtual; + function IsRealVertical: Boolean; virtual; + function IsVertical: Boolean; virtual; + function ItemAtPos(const APos: TPoint): TdxBarItemControl; + function Kind: TdxBarKind; virtual; abstract; + procedure RepaintBar; virtual; + + property BarManager: TdxBarManager read GetBarManager; + property BkBrush: HBRUSH read FBkBrush; + property BehaviorOptions: TdxBarBehaviorOptions read GetBehaviorOptions; + property Canvas: TcxCanvas read GetCanvas; + property ClientBounds: TRect read GetClientBounds; + property ComboBoxArrowWidth: Integer read FComboBoxArrowWidth; + property EditFontHandle: HFONT read GetEditFontHandle; + property EditTextSize: Integer read FEditTextSize; + property Font; + property IAccessibilityHelper: IdxBarAccessibilityHelper read GetIAccessibilityHelper; + property IsActive: Boolean read FIsActive write SetIsActive; + property IsCustomizing: Boolean read GetIsCustomizing; + property IsFocused: Boolean read GetIsFocused; + property ItemLinks: TdxBarItemLinks read FItemLinks write SetItemLinks; + property MenuArrowHeight: Integer read FMenuArrowHeight; + property MenuArrowWidth: Integer read FMenuArrowWidth; + property ParentBar: TCustomdxBarControl read FParentBar write SetParentBar; + property TextSize: Integer read FTextSize; + property ViewInfo: TCustomdxBarControlViewInfo read FViewInfo; + + property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy; + end; + + { TCustomdxBarControlDesignHelper } + + TCustomdxBarControlDesignHelper = class + public + class procedure FilterItemActions(var ASupportedActions: TdxBarCustomizationActions); virtual; + class procedure GetEditors(AEditors: TList); virtual; + class function GetForbiddenActions: TdxBarCustomizationActions; virtual; + end; + + TdxBarControlDesignHelper = class(TCustomdxBarControlDesignHelper) + public + class function GetForbiddenActions: TdxBarCustomizationActions; override; + end; + + TdxBarSubMenuControlDesignHelper = class(TCustomdxBarControlDesignHelper) + public + class procedure GetEditors(AEditors: TList); override; + class function GetForbiddenActions: TdxBarCustomizationActions; override; + end; + + TdxDockCol = class + private + FBarControl: TdxBarControl; + FDockRow: TdxDockRow; + FPos: TPoint; + public + constructor Create(ADockRow: TdxDockRow; ABarControl: TdxBarControl); + procedure AssignPosition; + property BarControl: TdxBarControl read FBarControl; + property DockRow: TdxDockRow read FDockRow; + property Pos: TPoint read FPos write FPos; + end; + + TdxDockRow = class + protected + FBars: TList; + FColList: TList; + FDockControl: TdxDockControl; + procedure AddBar(ABar: TdxBar); + procedure DeleteBar(ABar: TdxBar; ADestroyEmptyDockRow: Boolean); + function GetCol(Index: Integer): TdxDockCol; + function GetColCount: Integer; + function GetVisible: Boolean; + procedure UpdateOneOnRows; + public + constructor Create(ADockControl: TdxDockControl); + destructor Destroy; override; + function AddCol(ABarControl: TdxBarControl): TdxDockCol; + procedure DeleteCol(ABarControl: TdxBarControl); overload; + procedure DeleteCol(AIndex: Integer); overload; + property ColCount: Integer read GetColCount; + property ColList: TList read FColList; + property Cols[Index: Integer]: TdxDockCol read GetCol; + property DockControl: TdxDockControl read FDockControl; + property Visible: Boolean read GetVisible; + end; + + TXDirection = (xdLeft, xdRight); + TYDirection = (ydTop, ydBottom); + + { TdxBarControl } + + TdxBarControl = class(TCustomdxBarControl) + private + FBar: TdxBar; + FBeforeBarGetFocusFocusedWnd: HWND; + FCloseButtonState: TdxBarMarkState; + FDockedHandle, FFloatingHandle: HWND; + FDrawBitmap: TBitmap; + FIsResizing: Boolean; + FHasSizeGrip: Boolean; + FHitTest: Longint; + FInternalLockCount: Integer; + FMarkIAccessibilityHelper: IdxBarAccessibilityHelper; + FMDIButtonWidth, FMDIButtonHeight: Integer; + FMinSize, FMaxSize: Integer; + FMoreButtonsHintTimer: UINT; + FMoving: Boolean; + FPopupBar: TdxBar; + FPosSaving: Boolean; + FPrevClipRgn: TcxRegion; + FPrevFocusedBarControlLink: TcxObjectLink; + FTruncated: Boolean; + FQuickPopup: TdxBarControl; + NewLeft, NewTop, NewWidth, NewHeight: Integer; + RX, RY: TPoint; + + function GetCaptionBkColor: COLORREF; + function GetCaptionButtons: TdxBarCaptionButtons; + function GetCaptionColor: COLORREF; + function GetHorizontal: Boolean; + function GetInternallyLocked: Boolean; + function GetMarkIAccessibilityHelper: IdxBarAccessibilityHelper; + function GetVertical: Boolean; + procedure SetCloseButtonState(Value: TdxBarMarkState); + procedure SetNewBounds; + procedure SetMoving(Value: Boolean); + + procedure ChangeStyleWinTo(AStyle: TdxBarDockingStyle; + ADockControl: TdxDockControl); + function GetDragPointOffset(Style: TdxBarDockingStyle): TPoint; + function GetCaptionNCRect: TRect; + + procedure DrawCloseButton(DC: HDC); + procedure DrawMark(DC: HDC); + + procedure DrawMDIButton(AButton: TdxBarMDIButton; ASelected, APressed: Boolean); + function GetMDIWidth: Integer; + function GetMDIHeight: Integer; + function RectMDI(Button: TdxBarMDIButton): TRect; + function MDIButtonsOnBar: Boolean; + function MDIButtonEnabled(AButton: TdxBarMDIButton; State: Integer): Boolean; + + procedure StartMoreButtonsHintTimer; + procedure FinishMoreButtonsHintTimer; + + function CanResizeSelectedLink(APoint: TPoint): Boolean; + + procedure WMCaptureChanged(var Message: TMessage); message WM_CAPTURECHANGED; + procedure WMDestroy(var Message: TMessage); message WM_DESTROY; + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + procedure WMGetMinMaxInfo(var Message: TWMGetMinmaxInfo); message WM_GETMINMAXINFO; + procedure WMGetObject(var Message: TMessage); message WM_GETOBJECT; + procedure WMKeyDown(var Message: TWMKeyDown); message WM_KEYDOWN; + procedure WMLButtonDblClk(var Message: TWMLButtonDblClk); message WM_LBUTTONDBLCLK; + procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; + procedure WMMouseActivate(var Message: TWMMouseActivate); message WM_MOUSEACTIVATE; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + procedure WMNCLButtonDown(var Message: TWMNCLButtonDown); message WM_NCLBUTTONDOWN; + procedure WMSetCursor(var Message: TWMSetCursor); message WM_SETCURSOR; + procedure WMSize(var Message: TWMSize); message WM_SIZE; + procedure WMSizing(var Message: TMessage); message WM_SIZING; + procedure WMWindowPosChanging(var Message: TWMWindowPosChanging); message WM_WINDOWPOSCHANGING; + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + procedure Paint; override; + procedure Resize; override; + procedure WindowPosChanged(var Message: TWMWindowPosChanged); override; + procedure WndProc(var Message: TMessage); override; + + procedure BeginInternal; + procedure EndInternal; + property InternallyLocked: Boolean read GetInternallyLocked; + + procedure LayoutChanged; override; + + procedure CalcControlsPositions; override; + procedure CalcRowItemRects; override; + procedure CalcDrawingConsts; override; + procedure CalcDragOverParameters(const ACursorPos: TPoint; + var ADragOverItemLink: TdxBarItemLink; + var AIsBeginGroup, AIsFirstPart, AIsVerticalDirection: Boolean); override; + function CanAlignControl(AControl: TdxBarItemControl): Boolean; override; + function CanCallInheritedNCCalcSize: Boolean; override; // obsolete + function CanCustomizing: Boolean; override; + function CanHideAllItemsInSingleLine: Boolean; virtual; + function CanMoving: Boolean; virtual; + function CanProcessShortCut: Boolean; virtual; + procedure CaptionButtonClick(AIndex: Integer); virtual; + function GetCaptionRect: TRect; + procedure CheckMarkState(const P: TPoint); + function CloseButtonRect: TRect; + function CloseButtonRectNC: TRect; + function CheckLockUpdate: Boolean; override; + procedure CustomizePrepare(APoint: TPoint; ASecondClick: Boolean); override; + procedure DoBarGetFocus(ASelectedItem: TdxBarItemControl); override; + procedure DoBarLostFocus; override; + procedure DoBarMouseDown(Button: TMouseButton; Shift: TShiftState; + const APoint: TPoint; AItemControl: TdxBarItemControl; APointInClientRect: Boolean); override; + procedure DoBarMouseLeave; override; + procedure DoBarMouseMove(Shift: TShiftState; const APoint: TPoint; AItemControl: TdxBarItemControl); override; + procedure DoHideAll; override; + procedure DoRepaintBar(ARecreateControls: Boolean); override; + procedure DoSetIsActive(AValue: Boolean); override; + procedure FocusItemControl(AItemControl: TdxBarItemControl); override; + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; override; + function GetAlphaBlendValue: Byte; + function GetBackgroundBitmap: TBitmap; override; + function GetBeginGroupSize: Integer; override; + function GetCol: Integer; + function GetDockCol: TdxDockCol; + function GetIsMainMenu: Boolean; override; + function GetIsStatusBar: Boolean; override; + function GetMarkAccessibilityHelperClass: TdxBarAccessibilityHelperClass; virtual; + function GetMarkDrawState: TdxBarMarkState; override; + function GetMoreButtonsHint: string; virtual; + function GetMultiLine: Boolean; virtual; + function GetQuickControlClass: TdxBarControlClass; virtual; + function GetRow: Integer; + function GetViewInfoClass: TCustomdxBarControlViewInfoClass; override; + + function GetNCDrawingDC(AUpdatedRgn: HRGN): HDC; override; + procedure ReleaseNCDrawingDC(ADC: HDC); override; + + function GetMasterForm: TCustomForm; + function GetParentForm: TCustomForm; virtual; + function GetSelectableObject: TPersistent; override; + + function AllowQuickCustomizing: Boolean; virtual; + procedure HandleQuickAccessSubItemPopup(Sender: TObject); + procedure InitQuickControl(AQuickControlItemLinks: TdxBarItemLinks); virtual; + procedure InitQuickCustomizeItemLinks(AQuickControlItemLinks: TdxBarItemLinks); virtual; + procedure InitAddRemoveSubItemPopup(AItemLinks: TdxBarItemLinks); virtual; + procedure ResetToolbarClick(Sender: TObject); + + function GetMinWidth(AStyle: TdxBarDockingStyle): Integer; virtual; + function GetMinHeight(AStyle: TdxBarDockingStyle): Integer; virtual; + function GetMaxWidth(AStyle: TdxBarDockingStyle): Integer; + function GetMaxHeight(AStyle: TdxBarDockingStyle): Integer; + procedure GetMultiLineBarSize(AStyle: TdxBarDockingStyle; + ASize: Integer; var Result: TPoint); + function GetSizeAllCursorBounds: TRect; virtual; + function GetSizeForWidth(AStyle: TdxBarDockingStyle; AWidth: Integer): TPoint; virtual; + function GetSizeForHeight(AStyle: TdxBarDockingStyle; AHeight: Integer): TPoint; + function GetSizeForPopup: TSize; virtual; + function GetTrackSize(AStyle: TdxBarDockingStyle): TPoint; + function HasCaption: Boolean; virtual; + function HasCloseButton: Boolean; virtual; + function HideOnClick: Boolean; override; + function IgnoreClickAreaWhenHidePopup: TRect; virtual; + procedure InvalidateMark; + function IsMarkAccessible: Boolean; + function IsInternal: Boolean; override; + + function GetMouseTrackingBounds: TRect; override; + + function MarkExists: Boolean; override; + function MarkNCRect: TRect; + function MarkRect: TRect; override; + function MarkScreenRect: TRect; + procedure SetMarkState(Value: TdxBarMarkState); override; + + function RealMDIButtonsOnBar: Boolean; virtual; + + procedure SelectItemControl(AItemControl: TdxBarItemControl; AButton: TMouseButton; AShift: TShiftState); override; + procedure ShowPopup(AItem: TdxBarItemControl); override; + function SizeGripRect: TRect; + procedure UpdateCaptionButtons(ACaptionButton: TdxBarCaptionButton); virtual; + procedure UpdateItem(AControl: TdxBarItemControl); override; + + function AllowNCPaint: Boolean; override; + procedure BarManagerStyleChanged; + procedure CaptionChanged; virtual; + procedure DoDrawBeginGroup(const ASeparatorRect: TRect; AHorz: Boolean); virtual; + procedure DoNCPaint(DC: HDC); virtual; + procedure DoPaint; virtual; + procedure DrawBeginGroups; + procedure DrawContentBackground; virtual; + procedure DrawMarks; + procedure DrawMDIButtons(AButtons: TdxBarMDIButtons; AExcludeClipRect: Boolean = False); + procedure DrawSelection(ADC: HDC); + procedure FillBackground(ADC: HDC; const ARect: TRect; ABrush: HBRUSH; AColor: TColor; + AIsClientArea: Boolean); override; + procedure FrameChanged; + function GetCaption: TCaption; virtual; + function GetEditFont: TFont; override; + function GetFont: TFont; virtual; + function GetFullItemRect(Item: TdxBarItemControl): TRect; override; + function GetItemRegion(Item: TdxBarItemControl): HRGN; override; + function GetToolbarBrush: HBRUSH; override; + procedure GlyphChanged; virtual; + function IsBackgroundBitmap: Boolean; override; + function IsTransparent: Boolean; override; + function LockHotTrackWhenPopup: Boolean; virtual; + function NCOffset: TPoint; override; + procedure NCPaint(ADC: HDC); override; + function NeedHideOnNCMouseClick: Boolean; virtual; + function NotHandleMouseMove(ACheckLastMousePos: Boolean = True): Boolean; override; + procedure RebuildBar; + procedure RefreshShadow; + procedure RepaintMDIButtons; + procedure SavePos; + procedure SetFont; override; + procedure SetDockingStyle(Value: TdxBarDockingStyle); override; + procedure SetKeySelectedItem(Value: TdxBarItemControl); override; + procedure SetLayeredAttributes; override; + property CaptionBkColor: COLORREF read GetCaptionBkColor; + property CaptionButtons: TdxBarCaptionButtons read GetCaptionButtons; + property CaptionColor: COLORREF read GetCaptionColor; + property CloseButtonState: TdxBarMarkState read FCloseButtonState + write SetCloseButtonState; + + property HitTest: Longint read FHitTest write FHitTest; + property Horizontal: Boolean read GetHorizontal; + property Moving: Boolean read FMoving write SetMoving; + property MultiLine: Boolean read GetMultiLine; + property Truncated: Boolean read FTruncated write FTruncated; + property Vertical: Boolean read GetVertical; + + property MDIButtonWidth: Integer read FMDIButtonWidth; + property MDIButtonHeight: Integer read FMDIButtonHeight; + + property MasterForm: TCustomForm read GetMasterForm; + property ParentForm: TCustomForm read GetParentForm; + property PopupBar: TdxBar read FPopupBar; + public + constructor CreateEx(AOwner: TComponent; ABar: TdxBar); virtual; + constructor CreateForPopup(AParentBarControl: TdxBarControl; + ABar: TdxBar); virtual; + destructor Destroy; override; + function ClientToScreen(const APoint: TPoint): TPoint; + procedure CloseUp; virtual; + procedure Hide; override; + function IsRealVertical: Boolean; override; + function IsVertical: Boolean; override; + function Kind: TdxBarKind; override; + procedure Popup(const AOwnerRect: TRect); virtual; + procedure PopupEx(const AOwnerRect: TRect; APopupDirection: TXDirection); + procedure Repaint; override; + procedure UpdateFont; + property Bar: TdxBar read FBar write FBar; + property DockControl; + property MarkIAccessibilityHelper: IdxBarAccessibilityHelper + read GetMarkIAccessibilityHelper; + end; + + TdxBarControlViewInfo = class(TCustomdxBarControlViewInfo) + private + function GetBarControl: TdxBarControl; + protected + procedure CalcSeparatorInfo(AItemLink: TdxBarItemLink); virtual; + function CanShowButtonGroups: Boolean; virtual; + function CanShowSeparators: Boolean; virtual; + procedure DoCalcSeparatorInfo(AItemLink: TdxBarItemLink; const AItemRect: TRect); virtual; + function IsLastVisibleItemControl(AItemControl: TdxBarItemControl): Boolean; virtual; + public + procedure Calculate; override; + property BarControl: TdxBarControl read GetBarControl; + end; + + { TdxBarSubMenuControl } + + TdxBarButtonControl = class; + TdxBarSubItemControl = class; + + TdxBarSubMenuControl = class(TCustomdxBarControl) + private + FAnimationThread: TThread; + FDetachCaptionSelected: Boolean; + FExpandingMenu: Boolean; + FExpandMenuTimer: UINT; + FLightBrush: HBRUSH; + FLightPalette: HPALETTE; + FLockChangeSizeByChildItemControl: Boolean; + FMenuAnimations: TdxBarMenuAnimations; + FNonRecent: Boolean; + FOnShowLeft, FOnShowTop: Integer; + FOwnerWidth, FOwnerHeight: Integer; + FScrollTimerID: UINT; + FShowAnimation: Boolean; + FTopIndex: Integer; + FXDirection: TXDirection; + FYDirection: TYDirection; + + FDropDownButton: TdxBarButtonControl; + FSubItem: TdxBarSubItemControl; + + FOnCloseUp: TNotifyEvent; + FOnPopup: TNotifyEvent; + + function GetBandSize: Integer; + function GetBarSize: Integer; + function GetBarRect: TRect; + function GetBottomVisibleItemIndex: Integer; + function GetContentRect: TRect; + function GetDetachCaptionSize: Integer; + function GetMaxVisibleCount: Integer; + function GetParentItemControl: TdxBarItemControl; + function GetSubMenuOwner: IdxBarSubMenuOwner; + function GetToolbarItemsBrush: HBRUSH; + function GetTopVisibleItemIndex: Integer; + procedure SetDetachCaptionSelected(AValue: Boolean); + procedure SetTopIndex(AValue: Integer); + + procedure CalcBounds(out ASize: TSize); + procedure CalcSize(out ASize: TSize); + + procedure CreateLightBrush; + procedure DestroyLightBrush; + procedure PreparePalette(DC: HDC); + procedure UnpreparePalette(DC: HDC); + procedure ExpandMenu; + function ExtendedView: Boolean; + procedure InvalidateItemsRect; + procedure InvalidateDetachCaption; + function MouseOnArrow(AArrowDirection: TcxArrowDirection): Boolean; + function MouseOnUpArrow: Boolean; + function MouseOnDownArrow: Boolean; + procedure SetExpandMenuTimer(Time: UINT; ExpandAfterDelay: Boolean); + procedure KillExpandMenuTimer; + procedure KillScrollTimer; + + function IsAnimationRunning: Boolean; + procedure OnTerminateAnimation(Sender: TObject); + + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + procedure WMKeyDown(var Message: TWMKeyDown); message WM_KEYDOWN; + procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + procedure WMPrint(var Message: TMessage); message WM_PRINT; + procedure WMPrintClient(var Message: TMessage); message WM_PRINTCLIENT; + procedure WMRButtonDown(var Message: TWMRButtonDown); message WM_RBUTTONDOWN; + procedure WMRButtonUp(var Message: TWMRButtonUp); message WM_RBUTTONUP; + procedure WMTimer(var Message: TWMTimer); message WM_TIMER; + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; + protected + ParentWnd: HWND; + + procedure AdjustHintWindowPosition(var APos: TPoint; const ABoundsRect: TRect; AHeight: Integer); override; + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + procedure DestroyWindowHandle; override; + procedure DestroyWnd; override; + procedure DoCloseUp; dynamic; + procedure DoPopup; dynamic; + procedure Paint; override; + procedure NCPaint(ADC: HDC); override; + + procedure CalcControlsPositions; override; + procedure CalcDrawingConsts; override; + procedure CalcDragOverParameters(const ACursorPos: TPoint; + var ADragOverItemLink: TdxBarItemLink; + var AIsBeginGroup, AIsFirstPart, AIsVerticalDirection: Boolean); override; + procedure CalcItemsRect; override; + function CanActiveChange: Boolean; override; + function CanCustomizing: Boolean; override; + function CanDrawClippedItem(AItemRect: TRect): Boolean; override; + function CanShowHint: Boolean; override; + function CheckLockUpdate: Boolean; override; + function ChildrenHaveShadows: Boolean; override; + procedure CorrectVisibleItemsRectBottom; override; + procedure CorrectVisibleItemsRectTop; override; + procedure DoCreateControls; override; + procedure DoDestroyControls; override; + procedure DoBarMouseLeave; override; + procedure DoBarMouseMove(Shift: TShiftState; const APoint: TPoint; AItemControl: TdxBarItemControl); override; + procedure DoNCPaint(DC: HDC; const ARect: TRect); virtual; + procedure DoHideAll; override; + procedure DoPaintItem(AControl: TdxBarItemControl; ACanvas: TcxCanvas; const AItemRect: TRect); override; + procedure DoRepaintBar(ARecreateControls: Boolean); override; + procedure DoSetIsActive(AValue: Boolean); override; + procedure DragOver(X, Y: Integer; var Accept: Boolean); override; + + function ChangeSizeByChildItemControl(out ASize: TSize): Boolean; virtual; + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; override; + function GetBeginGroupSize: Integer; override; + function GetBehaviorOptions: TdxBarBehaviorOptions; override; + function GetBottomItemControl: TdxBarItemControl; + function GetDefaultItemHeight(AItem: TdxBarItemControl): Integer; override; + function GetEditFont: TFont; override; + function GetIsContextMenu: Boolean; virtual; + function GetIsCustomizing: Boolean; override; + function GetIsMainMenu: Boolean; override; + function GetIsStatusBar: Boolean; override; + function GetIsShadowVisible: Boolean; override; + function GetItemControlOffset(AItemLink: TdxBarItemLink): Integer; override; + function GetItemRectEx(Item: TdxBarItemControl; IsBeginGroup: Boolean): TRect; override; + function GetItemsPaneSize: TSize; virtual; + function GetPaintType: TdxBarPaintType; override; + function GetSelectableObject: TPersistent; override; + function GetTextSize: Integer; override; + function GetTopItemControl: TdxBarItemControl; + function GetViewInfoClass: TCustomdxBarControlViewInfoClass; override; + procedure HideByEscape; + function HideOnClick: Boolean; override; + function IsInternal: Boolean; override; + function IsMeaningParent(AWnd: HWND): Boolean; override; + function IsPopup: Boolean; override; + function IsVerticalDirection: Boolean; override; + function MustFitInWorkAreaWidth: Boolean; virtual; + function NeedBufferedRepaint: Boolean; + function NeedsSelectFirstItemOnDropDownByKey: Boolean; virtual; + procedure SetFont; override; + procedure SetRecentItemCount; + procedure SetAccelSelectedItem(AItemControl: TdxBarItemControl; ADuplicate: Boolean); override; + procedure SetControlVisible(AControl: TdxBarItemControl); override; + procedure SetSelectedControl(Value: TdxBarItemControl); override; + procedure SetSizeAndCheckBounds(const APredefinedSize: TSize; out AChangeXDirection, AChangeYDirection: Boolean); + procedure TerminateAnimation; + procedure UpdateItem(AControl: TdxBarItemControl); override; + + procedure InitCustomizationPopup(AItemLinks: TdxBarItemLinks); override; + procedure ShowPopup(AItem: TdxBarItemControl); override; + + function CanDetach: Boolean; + function Detachable: Boolean; + function DetachCaptionAreaSize: Integer; + function DetachCaptionRect: TRect; + function MouseOnDetachCaption: Boolean; + procedure DoDetachMenu; + + function MarkArrowSize: Integer; + function MarkExists: Boolean; override; + function MarkRect: TRect; override; + procedure SetMarkState(Value: TdxBarMarkState); override; + + function DownArrowExists: Boolean; + function GetScrollTime: Integer; virtual; + function UpArrowExists: Boolean; + function UseScrollButtons: Boolean; + + procedure DoCalcSize(out ASize: TSize); virtual; + procedure DoCorrectSize(var ASize: TSize); + procedure DoShow; virtual; + + procedure DrawBar; + procedure DrawContent; virtual; + procedure DrawItems; override; + procedure DrawScrollArea; + procedure FillBackground(DC: HDC; const ARect: TRect; ABrush: HBRUSH; AColor: TColor; + AIsClientArea: Boolean); override; + procedure DoFillBackgroundEx(ACanvas: TcxCanvas; const ARect: TRect; ABrush: HBRUSH; AColor: TColor; + AIsClientArea: Boolean); virtual; + procedure FillBackgroundEx(ACanvas: TcxCanvas; const ARect: TRect; ABrush: HBRUSH; AColor: TColor; + AIsClientArea: Boolean); + + function GetBackgroundBitmap: TBitmap; override; + function GetBorderSize: Integer; override; + function GetClientOffset( + AIncludeDetachCaption: Boolean = True): TRect; virtual; + function GetIndent1: Integer; + function GetIndent2: Integer; + function GetItemsRectOffset: TRect; virtual; + function IsTransparent: Boolean; override; + + function GetMouseTrackingBounds: TRect; override; + + property BandSize: Integer read GetBandSize; + property BarSize: Integer read GetBarSize; + property BorderSize: Integer read GetBorderSize; + property DetachCaptionSelected: Boolean read FDetachCaptionSelected + write SetDetachCaptionSelected; + property DetachCaptionSize: Integer read GetDetachCaptionSize; + + property BarRect: TRect read GetBarRect; + property ContentRect: TRect read GetContentRect; + + property ToolbarItemsBrush: HBRUSH read GetToolbarItemsBrush; + + property BottomItemControl: TdxBarItemControl read GetBottomItemControl; + property BottomVisibleItemIndex: Integer read GetBottomVisibleItemIndex; + property IsContextMenu: Boolean read GetIsContextMenu; + property TopIndex: Integer read FTopIndex write SetTopIndex; + property TopItemControl: TdxBarItemControl read GetTopItemControl; + property TopVisibleItemIndex: Integer read GetTopVisibleItemIndex; + property MaxVisibleCount: Integer read GetMaxVisibleCount; + property NonRecent: Boolean read FNonRecent; + property OnShowLeft: Integer read FOnShowLeft; + property OnShowTop: Integer read FOnShowTop; + + property OnCloseUp: TNotifyEvent read FOnCloseUp write FOnCloseUp; + property OnPopup: TNotifyEvent read FOnPopup write FOnPopup; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Hide; override; + function Kind: TdxBarKind; override; + procedure Show; + + property OwnerWidth: Integer read FOwnerWidth write FOwnerWidth; + property OwnerHeight: Integer read FOwnerHeight write FOwnerHeight; + property ParentItemControl: TdxBarItemControl read GetParentItemControl; + end; + + TdxBarSubMenuControlViewInfo = class(TCustomdxBarControlViewInfo) + private + function GetBarControl: TdxBarSubMenuControl; + public + procedure Calculate; override; + property BarControl: TdxBarSubMenuControl read GetBarControl; + end; + + { TdxBarInternalSubMenuControl } + + TdxBarInternalSubMenuControl = class(TdxBarSubMenuControl, IdxBarLinksOwner) + protected + function GetIsCustomizing: Boolean; override; + function IsInternal: Boolean; override; + + // IdxBarLinksOwner + function CanContainItem(AItem: TdxBarItem; out AErrorText: string): Boolean; + function CreateBarControl: TCustomdxBarControl; + function GetInstance: TComponent; + function GetItemLinks: TdxBarItemLinks; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + end; + + { TdxBarCustomizingPopup } + + TdxBarCustomizingPopup = class(TdxBarInternalSubMenuControl) + public + constructor Create(AOwner: TComponent); override; + procedure DoShowCustomizingPopup; + end; + + { TdxBarApplicationMenuControl } + + TdxBarApplicationMenuControl = class(TdxBarSubMenuControl) + private + FBar: TdxBar; + FDockControl: TdxBarDockControl; + FTotalItemLinks: TdxBarItemLinks; + + FButtonLinks: TdxBarApplicationMenuButtonItemLinks; + FButtonsRect: TRect; + FExtraPaneRect: TRect; + FExtraPaneSize: Integer; + + function GetApplicationMenu: TdxBarCustomApplicationMenu; + function GetExtraPaneItemLinks: TdxBarItemLinks; + function GetTotalItemLinks: TdxBarItemLinks; + function NeedExtraPane: Boolean; + + property TotalItemLinks: TdxBarItemLinks read GetTotalItemLinks; + protected + function CalcChildBarBounds(out ARect: TRect): Boolean; override; + procedure CalcItemRects(APaintStyle: TdxBarPaintType; ATopIndex: Integer); override; + procedure CalcItemsRect; override; + procedure DoCalcSize(out ASize: TSize); override; + + function GetViewInfoClass: TCustomdxBarControlViewInfoClass; override; + function GetExtraPaneDockControlClass: TdxBarDockControlClass; virtual; + + procedure DoNCPaint(DC: HDC; const ARect: TRect); override; + procedure DoShow; override; + + procedure DrawContent; override; + procedure DrawContentArea(ACanvas: TcxCanvas); + procedure DoFillBackgroundEx(ACanvas: TcxCanvas; const ARect: TRect; ABrush: HBRUSH; AColor: TColor; + AIsClientArea: Boolean); override; + + function DoFindLinkWithAccel(AKey: Word; AShift: TShiftState; ACurrentLink: TdxBarItemLink): TdxBarItemLink; override; + function FindLinkWithAccel(AKey: Word; AShift: TShiftState; ACurrentLink: TdxBarItemLink; out ADuplicate: Boolean): TdxBarItemLink; override; + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; override; + function GetBehaviorOptions: TdxBarBehaviorOptions; override; + function GetItemsRectOffset: TRect; override; + function IsControlExists(ABarItemControl: TdxBarItemControl): Boolean; override; + procedure SetAccelSelectedItem(AItemControl: TdxBarItemControl; ADuplicate: Boolean); override; + procedure SetControlVisible(AControl: TdxBarItemControl); override; + procedure SetItemLinks(Value: TdxBarItemLinks); override; + procedure InitializeExtraPaneControl; + procedure ShowExtraPaneControl; + + property ApplicationMenu: TdxBarCustomApplicationMenu read GetApplicationMenu; + property ButtonLinks: TdxBarApplicationMenuButtonItemLinks read FButtonLinks; + property ExtraPaneControlDockControl: TdxBarDockControl read FDockControl; + property ExtraPaneItemLinks: TdxBarItemLinks read GetExtraPaneItemLinks; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + end; + + TdxBarApplicationMenuControlViewInfo = class(TdxBarSubMenuControlViewInfo) + private + function GetBarControl: TdxBarApplicationMenuControl; + public + procedure Calculate; override; + property BarControl: TdxBarApplicationMenuControl read GetBarControl; + end; + + { TdxBarExtraPaneControl } + + TdxBarExtraPaneControl = class(TdxBarControl) + private + FIsControlsCreated: Boolean; + procedure DrawBackground(ACanvas: TcxCanvas; const ARect: TRect; ABrush: HBRUSH; AColor: TColor); + function GetBasicControl: TCustomdxBarControl; + + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + protected + procedure CalcControlsPositions; override; + procedure CalcItemsRect; override; + function CanMoving: Boolean; override; + function CanProcessMouseMessage: Boolean; override; + procedure DoCreateControls; override; + procedure DoDestroyControls; override; + procedure DoDrawBeginGroup(const ASeparatorRect: TRect; AHorz: Boolean); override; + procedure DoNCPaint(DC: HDC); override; + procedure DoHideAll; override; + procedure DrawContentBackground; override; + procedure FillBackground(ADC: HDC; const ARect: TRect; ABrush: HBRUSH; AColor: TColor; + AIsClientArea: Boolean); override; + function FindLinkWithAccel(AKey: Word; AShift: TShiftState; ACurrentLink: TdxBarItemLink; out ADuplicate: Boolean): TdxBarItemLink; override; + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; override; + function GetBehaviorOptions: TdxBarBehaviorOptions; override; + function GetPainter: TdxBarPainter; override; + function GetViewInfoClass: TCustomdxBarControlViewInfoClass; override; + procedure HideAllByEscape; override; + procedure LayoutChanged; override; + procedure SetAccelSelectedItem(AItemControl: TdxBarItemControl; ADuplicate: Boolean); override; + + function CanShowPopupMenuOnMouseClick(AMousePressed: Boolean): Boolean; override; + procedure InitCustomizationPopup(AItemLinks: TdxBarItemLinks); override; + procedure ShowPopup(AItem: TdxBarItemControl); override; + + property BasicControl: TCustomdxBarControl read GetBasicControl; + public + destructor Destroy; override; + end; + + TdxBarExtraPaneControlViewInfo = class(TdxBarControlViewInfo) + protected + procedure DoCalcSeparatorInfo(AItemLink: TdxBarItemLink; const AItemRect: TRect); override; + end; + + {-------------------------------------- + Items + --------------------------------------} + + TdxBarItemActionLink = class(TActionLink) + protected + FClient: TdxBarItem; + procedure AssignClient(AClient: TObject); override; + function IsCaptionLinked: Boolean; override; + function IsCheckedLinked: Boolean; override; + function IsEnabledLinked: Boolean; override; + function IsHelpContextLinked: Boolean; override; + function IsHintLinked: Boolean; override; + function IsImageIndexLinked: Boolean; override; + function IsShortCutLinked: Boolean; override; + function IsVisibleLinked: Boolean; override; + function IsOnExecuteLinked: Boolean; override; + procedure SetCaption(const Value: string); override; + procedure SetChecked(Value: Boolean); override; + procedure SetEnabled(Value: Boolean); override; + procedure SetHelpContext(Value: THelpContext); override; + procedure SetHint(const Value: string); override; + procedure SetImageIndex(Value: Integer); override; + procedure SetShortCut(Value: TShortCut); override; + procedure SetVisible(Value: Boolean); override; + procedure SetOnExecute(Value: TNotifyEvent); override; + end; + + TdxBarItemActionLinkClass = class of TdxBarItemActionLink; + + { TdxBarItemStylesData } + + TdxBarItemStyleChangeKind = (sckDrawing, sckStructure, sckNone); + TdxBarItemStylesDataChangeEvent = procedure(AChangeKind: TdxBarItemStyleChangeKind) of object; + + TdxBarItemStylesData = class(TcxInterfacedPersistent, IcxStyleChangeListener) + private + FChangeEventLockCount: Integer; + FChangeKind: TdxBarItemStyleChangeKind; + FIsDestroying: Boolean; + FOnChange: TdxBarItemStylesDataChangeEvent; + FStyleCount: Integer; + FStylesData: array of TdxBarItemStyleData; + + // IcxStyleChangeListener + procedure StyleChanged(AStyle: TcxCustomStyle); + procedure StyleRemoved(AStyle: TcxCustomStyle); + + procedure DoChange(AChangeKind: TdxBarItemStyleChangeKind); + function GetStyle(AIndex: Integer): TcxStyle; + function GetStyleReferenceCount(AStyle: TcxStyle): Integer; + procedure InternalSetStyle(AIndex: Integer; Value: TcxStyle); + procedure InternalStyleChanged(AIndex: Integer); overload; + procedure InternalStyleChanged(AStyle: TcxStyle); overload; + procedure InternalStyleRemoved(AStyle: TcxStyle); + function IsChangeEventLocked: Boolean; + procedure LockChangeEvent(ALock: Boolean); + procedure SetStyle(AIndex: Integer; Value: TcxStyle); + protected + property IsDestroying: Boolean read FIsDestroying; + property StyleCount: Integer read FStyleCount; + public + constructor Create(AStyleCount: Integer); reintroduce; + destructor Destroy; override; + property Styles[AIndex: Integer]: TcxStyle read GetStyle write SetStyle; + property OnChange: TdxBarItemStylesDataChangeEvent read FOnChange + write FOnChange; + end; + + TdxBarScreenTipBandTextAlign = (stbtaLeft, stbtaRight); + TdxBarScreenTipBandType = (stbHeader, stbDescription, stbFooter); + + { TdxBarCustomScreenTipBand } + + TdxBarCustomScreenTipBand = class(TPersistent) + private + FBandType: TdxBarScreenTipBandType; + FGlyph: TBitmap; + FText: string; + FTextAlign: TdxBarScreenTipBandTextAlign; + FOnChange: TNotifyEvent; + procedure SetGlyph(Value: TBitmap); + procedure SetText(const Value: string); + procedure SetTextAlign(Value: TdxBarScreenTipBandTextAlign); + protected + procedure Changed; virtual; + function GetFont: TFont; virtual; abstract; + function IsVisible(const AHintText: string): Boolean; + + property BandType: TdxBarScreenTipBandType read FBandType write FBandType; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + public + constructor Create(ABandType: TdxBarScreenTipBandType); + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + property Font: TFont read GetFont; + published + property Glyph: TBitmap read FGlyph write SetGlyph; + property Text: string read FText write SetText; + property TextAlign: TdxBarScreenTipBandTextAlign read FTextAlign write SetTextAlign default stbtaRight; + end; + + { TdxBarScreenTipBand } + + TdxBarScreenTipBand = class(TdxBarCustomScreenTipBand) + private + FScreenTip: TdxBarScreenTip; + protected + function GetFont: TFont; override; + public + constructor Create(AScreenTip: TdxBarScreenTip; ABandType: TdxBarScreenTipBandType); virtual; + + property ScreenTip: TdxBarScreenTip read FScreenTip; + end; + + { TdxBarScreenTipFooterBand } + + TdxBarScreenTipFooterBand = class(TdxBarCustomScreenTipBand) + private + FRepository: TdxBarScreenTipRepository; + protected + function GetFont: TFont; override; + public + constructor Create(ARepository: TdxBarScreenTipRepository); + + property Repository: TdxBarScreenTipRepository read FRepository; + end; + + { TdxBarScreenTip } + + TdxBarScreenTip = class(TcxComponentCollectionItem) + private + FBands: array[TdxBarScreenTipBandType] of TdxBarScreenTipBand; + FUseHintAsHeader: Boolean; + FUseStandardFooter: Boolean; + FWidth: Integer; + function GetBand(Index: Integer): TdxBarScreenTipBand; + procedure SetBand(Index: Integer; Value: TdxBarScreenTipBand); + protected + function GetBandForCalculation(Index: TdxBarScreenTipBandType): TdxBarCustomScreenTipBand; + function GetCollection: TdxBarScreenTipCollection; virtual; + function GetCollectionFromParent(AParent: TComponent): TcxComponentCollection; override; + function GetDisplayName: string; override; + function GetWidth: Integer; virtual; + procedure SetName(const Value: TComponentName); override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + property Collection: TdxBarScreenTipCollection read GetCollection; + published + property Header: TdxBarScreenTipBand index stbHeader read GetBand write SetBand; + property Description: TdxBarScreenTipBand index stbDescription read GetBand write SetBand; + property Footer: TdxBarScreenTipBand index stbFooter read GetBand write SetBand; + property UseHintAsHeader: Boolean read FUseHintAsHeader write FUseHintAsHeader default False; + property UseStandardFooter: Boolean read FUseStandardFooter write FUseStandardFooter default False; + property Width: Integer read FWidth write FWidth default 0; + end; + + { TdxBarScreenTipCollection } + + TdxBarScreenTipCollection = class(TcxComponentCollection) + private + FRepository: TdxBarScreenTipRepository; + function GetItem(Index: Integer): TdxBarScreenTip; + procedure SetItem(Index: Integer; Value: TdxBarScreenTip); + protected + procedure SetItemName(AItem: TcxComponentCollectionItem); override; + procedure UpdateFonts; + public + constructor Create(AParentComponent: TComponent; AItemClass: TcxComponentCollectionItemClass); override; + function Add: TdxBarScreenTip; + + property Repository: TdxBarScreenTipRepository read FRepository; + property Items[Index: Integer]: TdxBarScreenTip read GetItem write SetItem; default; + end; + + { TdxBarScreenTipRepository } + + TdxScreenTipRepositoryFonts = set of TdxBarScreenTipBandType; + + TdxBarScreenTipRepository = class(TComponent) + private + FAssignedFonts: TdxScreenTipRepositoryFonts; + FFonts: array[TdxBarScreenTipBandType] of TFont; + FItems: TdxBarScreenTipCollection; + FShowDescription: Boolean; + FStandardFooter: TdxBarScreenTipFooterBand; + FSystemFont: TFont; + procedure CreateFonts; + procedure FontChanged(Sender: TObject); + function GetFont(Index: Integer): TFont; + function IsFontStored(Index: Integer): Boolean; + procedure SetFont(Index: Integer; Value: TFont); + procedure SetItems(AValue: TdxBarScreenTipCollection); + procedure SetStandardFooter(Value: TdxBarScreenTipFooterBand); + protected + function CreateScreenTips: TdxBarScreenTipCollection; virtual; + function GetBandFont(ABandType: TdxBarScreenTipBandType): TFont; virtual; + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + function GetSystemFont(ABandType: TdxBarScreenTipBandType): TFont; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + published + property AssignedFonts: TdxScreenTipRepositoryFonts + read FAssignedFonts write FAssignedFonts default []; + property Items: TdxBarScreenTipCollection read FItems write SetItems; + property DescriptionFont: TFont index stbDescription read GetFont write SetFont stored IsFontStored; + property FooterFont: TFont index stbFooter read GetFont write SetFont stored IsFontStored; + property HeaderFont: TFont index stbHeader read GetFont write SetFont stored IsFontStored; + property StandardFooter: TdxBarScreenTipFooterBand + read FStandardFooter write SetStandardFooter; + property ShowDescription: Boolean read FShowDescription write FShowDescription default True; + end; + + { TdxBarCustomHintViewInfo } + + TdxBarCustomHintViewInfo = class + private + FBarManager: TdxBarManager; + FBoundsRect: TRect; + protected + procedure Calculate(ACanvas: TCanvas); virtual; abstract; + function IsScreenTip: Boolean; virtual; + procedure Paint(ACanvas: TCanvas); virtual; abstract; + procedure SetWindowDrawParams(AWindow: TdxBarHintWindow); virtual; + + public + constructor Create(ABarManager: TdxBarManager); + + property BarManager: TdxBarManager read FBarManager; + property BoundsRect: TRect read FBoundsRect write FBoundsRect; + end; + + { TdxBarHintViewInfo } + + TdxBarHintViewInfo = class(TdxBarCustomHintViewInfo) + private + FText: string; + FPos: TPoint; + function CalculateMinSize(ACanvas: TCanvas): TSize; + protected + procedure CorrectMinSize(var ASize: TSize); virtual; + function GetTextRect: TRect; virtual; + procedure DrawText(ACanvas: TCanvas); virtual; + procedure SetWindowDrawParams(AWindow: TdxBarHintWindow); override; + procedure SetWindowFont(AWindow: TdxBarHintWindow); virtual; + + property Text: string read FText write FText; + property Pos: TPoint read FPos write FPos; + public + constructor Create(ABarManager: TdxBarManager; const AHint, AShortCut: string; const ACursorPos: TPoint); + procedure Calculate(ACanvas: TCanvas); override; + procedure Paint(ACanvas: TCanvas); override; + end; + + { TdxBarLikeHintScreenTipViewInfo } + + TdxBarLikeHintScreenTipViewInfo = class(TdxBarHintViewInfo) + private + FPainter: TdxBarPainter; + protected + procedure CorrectMinSize(var ASize: TSize); override; + function GetTextRect: TRect; override; + function IsScreenTip: Boolean; override; + public + constructor Create(ABarManager: TdxBarManager; APainter: TdxBarPainter; const AHint, AShortCut: string; const ACursorPos: TPoint); + procedure Paint(ACanvas: TCanvas); override; + end; + + { TdxBarScreenTipBandViewInfo } + + TdxBarScreenTipBandViewInfo = class + private + FBand: TdxBarCustomScreenTipBand; + FBandBounds: TRect; + FGlyphBounds: TRect; + FGlyphSize: TSize; + FHintText: string; + FShortCut: string; + FTextBounds: TRect; + FTextSize: TSize; + FTop: Integer; + FWidth: Integer; + protected + function GetAvailGlyphWidth: Integer; + function GetHorzIndent: Integer; + function GetVertIndent(APainter: TdxBarPainter): Integer; + function GetText: string; + function HasGlyph: Boolean; + function HasText: Boolean; + function HeightToCurrentDpi(AValue: Integer): Integer; + function WidthToCurrentDpi(AValue: Integer): Integer; + function HorzPixelsPerInch: Integer; + function VertPixelsPerInch: Integer; + procedure Paint(ACanvas: TcxCanvas; APainter: TdxBarPainter); + + property BandBounds: TRect read FBandBounds; + property GlyphBounds: TRect read FGlyphBounds; + property TextBounds: TRect read FTextBounds; + property Top: Integer read FTop; + property Width: Integer read FWidth; + public + constructor Create(ABand: TdxBarCustomScreenTipBand; const AHintText, AShortCut: string); + procedure Calculate(AWidth: Integer; var ATop: Integer; AHeight: Integer; APainter: TdxBarPainter); + function GetHeight(ACanvas: TCanvas; const AWidth: Integer; APainter: TdxBarPainter): Integer; + function IsVisible: Boolean; + + property Band: TdxBarCustomScreenTipBand read FBand; + end; + + { TdxBarScreenTipViewInfo } + + TdxBarScreenTipViewInfo = class(TdxBarCustomHintViewInfo) + private + FPainter: TdxBarPainter; + FScreenTip: TdxBarScreenTip; + FHintText: string; + FShortCut: string; + FBandViewInfos: array of TdxBarScreenTipBandViewInfo; + FWidth: Integer; + procedure DestroyBandViewInfos; + function GetBandViewInfos(Index: Integer): TdxBarScreenTipBandViewInfo; + function GetBandViewInfosCount: Integer; + protected + function CreateBandViewInfo(ABand: TdxBarCustomScreenTipBand): TdxBarScreenTipBandViewInfo; virtual; + function IsScreenTip: Boolean; override; + public + constructor Create(AScreenTip: TdxBarScreenTip; APainter: TdxBarPainter; + const AHintText: string; AShortCut: string = ''); + destructor Destroy; override; + procedure Calculate(ACanvas: TCanvas); override; + procedure Paint(ACanvas: TCanvas); override; + + property ScreenTip: TdxBarScreenTip read FScreenTip; + property BandViewInfosCount: Integer read GetBandViewInfosCount; + property BandViewInfos[Index: Integer]: TdxBarScreenTipBandViewInfo read GetBandViewInfos; + end; + + { TdxBarHintWindow } + + TdxBarHintWindow = class(TcxBaseHintWindow) + private + FIsScreenTipWindow: Boolean; + FViewInfo: TdxBarCustomHintViewInfo; + procedure SetIsScreenTipWindow(Value: Boolean); + procedure WMShowWindow(var Message: TWMShowWindow); message WM_SHOWWINDOW; + procedure WMSize(var Message: TWMSize); message WM_SIZE; + protected + function GetHideHintTime: Integer; virtual; + function GetShowHintTime: Integer; virtual; + procedure Paint; override; + procedure RecreateWindow; virtual; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function ActivateHint(ABarManager: TdxBarManager; const AHintText, AShortCut: string): Boolean; reintroduce; virtual; + + property ShowHintTime: Integer read GetShowHintTime; + property HideHintTime: Integer read GetHideHintTime; + property IsScreenTipWindow: Boolean read FIsScreenTipWindow write SetIsScreenTipWindow; + end; + + { TdxBarItem } + + TdxBarItem = class(TdxBarComponent) + private + FActionLink: TdxBarItemActionLink; + FAlign: TdxBarItemAlign; + FCanSelect: Boolean; + FCaption: string; + FCategory: Integer; + FCheckDefaults: Boolean; + FClickItemLink: TdxBarItemLink; + FData: TObject; + FDescription: string; + FGlyph: TBitmap; + FHelpContext: THelpContext; + FHint: string; + FImageIndex: Integer; + FKeyTip: string; + FLargeGlyph: TBitmap; + FLargeImageIndex: Integer; + FLinks: TList; // the list of the itemlinks + FLoadedVisible: TdxBarItemVisible; + FMergeKind: TdxBarItemMergeKind; + FMergeOrder: Integer; + FPaintStyle: TdxBarPaintStyle; + FShortCut: TShortCut; + FStylesData: TdxBarItemStylesData; + FScreenTip: TdxBarScreenTip; + FUnclickAfterDoing: Boolean; + FWidth: Integer; + + FOnClick: TNotifyEvent; + FOnCreate: TNotifyEvent; + FOnDestroy: TNotifyEvent; + function GetAction: TBasicAction; + function GetActiveLink: TdxBarItemLink; + function GetActuallyVisible: Boolean; + function GetCurItemLink: TdxBarItemLink; + function GetFlat: Boolean; + function GetIndex: Integer; + function GetIsDesigning: Boolean; + function GetIsDestroying: Boolean; + function GetIsLoading: Boolean; + function GetLinkCount: Integer; + function GetLinks(Index: Integer): TdxBarItemLink; + function GetPainterClass: TdxBarPainterClass; + function GetVisibleForUser: Boolean; + procedure SetAction(Value: TBasicAction); + procedure SetAlign(Value: TdxBarItemAlign); + procedure SetCategory(Value: Integer); + procedure SetDescription(Value: string); + procedure SetGlyph(Value: TBitmap); + procedure SetGlyphLayout(Value: TdxBarGlyphLayout); + procedure SetIndex(Value: Integer); + procedure SetLargeGlyph(Value: TBitmap); + procedure SetMergeOrder(Value: Integer); + procedure SetPaintStyle(Value: TdxBarPaintStyle); + procedure SetScreenTip(Value: TdxBarScreenTip); + procedure SetShowCaption(Value: Boolean); + procedure SetShortCut(Value: TShortCut); + + procedure DestroyLinks; + procedure DoActionChange(Sender: TObject); + function IsEnabledStored: Boolean; + function IsHelpContextStored: Boolean; + function IsHintStored: Boolean; + function IsImageIndexStored: Boolean; + function IsShortCutStored: Boolean; + function IsVisibleStored: Boolean; + function IsOnClickStored: Boolean; + function GetHintFromCaption: string; + procedure OnGlyphChanged(Sender: TObject); + procedure OnLargeGlyphChanged(Sender: TObject); + protected + FGlyphLayout: TdxBarGlyphLayout; + FShowCaption: Boolean; + + procedure AssignTo(Dest: TPersistent); override; + function GetEnabled: Boolean; override; + function GetWidth: Integer; virtual; + procedure Loaded; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure ReadState(Reader: TReader); override; + procedure SelectionChanged; override; + procedure SetName(const NewName: TComponentName); override; + procedure SetEnabled(Value: Boolean); override; + procedure SetVisible(Value: TdxBarItemVisible); override; + procedure SetWidth(Value: Integer); virtual; + + // IdxBarSelectableItem + function CanDelete(ADestruction: Boolean = False): Boolean; override; + procedure ExecuteCustomizationAction(ABasicAction: TdxBarCustomizationAction); override; + procedure GetMasterObjects(AList: TdxObjectList); override; + function GetNextSelectableItem: IdxBarSelectableItem; override; + function GetSelectableParent: TPersistent; override; + function GetSupportedActions: TdxBarCustomizationActions; override; + procedure DeleteSelection(var AReference: IdxBarSelectableItem; ADestruction: Boolean); override; + procedure Invalidate; override; + function IsComplex: Boolean; override; + function SelectParentComponent: Boolean; override; + + procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); dynamic; + procedure BarManagerChanged; virtual; + function CanBePlacedOn(AParentKind: TdxBarItemControlParentKind; + AToolbar: TdxBar; out AErrorText: string): Boolean; virtual; + function CanChangePaintStyle: Boolean; virtual; + function CanClicked: Boolean; virtual; + function CanMergeWith(AItem: TdxBarItem): Boolean; + property CanSelect: Boolean read FCanSelect write FCanSelect default True; + function CurImageIndexLinked: Boolean; + procedure DrawCustomizingImage(ACanvas: TCanvas; const ARect: TRect; + AState: TOwnerDrawState); virtual; + procedure DrawCustomizingImageContent(ACanvas: TCanvas; const ARect: TRect; + ASelected: Boolean); virtual; + function GetActionLinkClass: TdxBarItemActionLinkClass; dynamic; + function GetActionImageIndex: Integer; virtual; + procedure SetActionImageIndex(Value: Integer); virtual; + function GetControlClass(AIsVertical: Boolean): TdxBarItemControlClass; virtual; + function GetHidden: Boolean; virtual; + function GetItemLinks: TdxBarItemLinks; virtual; + class function GetStyleCount: Integer; virtual; + function GetStyleValue(AIndex: Integer): TcxStyle; + function HasAccel(AItemLink: TdxBarItemLink): Boolean; virtual; + function HasControls: Boolean; + procedure HideControl(AControl: TdxBarItemControl); virtual; + function InternalActuallyVisible: Boolean; virtual; + function InternalCanMergeWith(AItem: TdxBarItem): Boolean; virtual; + function IsHintFromCaption: Boolean; + function IsImageIndexLinked(AImageList: TCustomImageList; AImageIndex: Integer): Boolean; + function IsShortCut(AShortCut: TShortCut): Boolean; virtual; + function IsStyleColorSupported: Boolean; virtual; + function NeedToBeHidden: Boolean; virtual; + procedure ObjectNotification(AOperation: TOperation; AObject: TObject); virtual; + procedure Recalculate; virtual; + procedure SetImageIndex(Value: Integer); virtual; + procedure SetLargeImageIndex(Value: Integer); virtual; + procedure SetStyleValue(AIndex: Integer; Value: TcxStyle); + procedure ShowDefaultEventHandler; + procedure Update; virtual; + procedure UpdateEx(AParentKinds: TdxBarKinds = dxBarKindAny); virtual; + function UseHotImages: Boolean; virtual; + function UseLargeImages: Boolean; virtual; + + // Change Group + procedure CaptionChanged; virtual; + procedure EnabledChanged; virtual; + procedure GlyphChanged; virtual; + procedure HotGlyphChanged; virtual; + procedure InternalStyleChanged(AChangeKind: TdxBarItemStyleChangeKind); + procedure LargeGlyphChanged; virtual; + procedure PaintStyleChanged; virtual; + procedure ShortCutChanged; virtual; + procedure VisibleChanged; virtual; + procedure WidthChanged; virtual; + + function GetCaption: string; virtual; + function IsCaptionStored: Boolean; virtual; + procedure SetCaption(const Value: string); virtual; + + procedure CheckLinks(ASource: TCustomIniFile; const ABaseSection: string); virtual; + procedure LoadFromIni(ASource: TCustomIniFile; const ABaseSection: string; AStoringKind: TdxBarStoringKind); virtual; + procedure LoadUsageData(ASource: TCustomIniFile; const ABaseSection: string); virtual; + procedure SaveToIni(ADestination: TCustomIniFile; const ABaseSection: string; AStoringKind: TdxBarStoringKind); virtual; + + procedure GetTextViewParams(out AViewParams: TcxViewParams); + procedure GetViewParams(AStyle: TcxStyle; out AViewParams: TcxViewParams); + + class function GetNewCaption: string; virtual; + + property ActionLink: TdxBarItemActionLink read FActionLink write FActionLink; + property ActionImageIndex: Integer read GetActionImageIndex write SetActionImageIndex; + property Flat: Boolean read GetFlat; + property GlyphLayout: TdxBarGlyphLayout read FGlyphLayout write SetGlyphLayout; + property Hidden: Boolean read GetHidden; + property IsDesigning: Boolean read GetIsDesigning; + property IsDestroying: Boolean read GetIsDestroying; + property IsLoading: Boolean read GetIsLoading; + property PainterClass: TdxBarPainterClass read GetPainterClass; + property PaintStyle: TdxBarPaintStyle read FPaintStyle write SetPaintStyle default psStandard; + property ShowCaption: Boolean read FShowCaption write SetShowCaption; + property StylesData: TdxBarItemStylesData read FStylesData; + property Width: Integer read GetWidth write SetWidth; + property OnCreate: TNotifyEvent read FOnCreate write FOnCreate; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure BeforeDestruction; override; + procedure Click; dynamic; + procedure DirectClick; dynamic; + procedure DoClick; dynamic; + function GetAddMessageName: string; virtual; + function GetCurImages: TCustomImageList; virtual; + function GetParentComponent: TComponent; override; + function HasParent: Boolean; override; + procedure SetParentComponent(AParent: TComponent); override; + + property ActuallyVisible: Boolean read GetActuallyVisible; + property ClickItemLink: TdxBarItemLink read FClickItemLink; + property CurItemLink: TdxBarItemLink read GetCurItemLink; + property Data: TObject read FData write FData; + property Glyph: TBitmap read FGlyph write SetGlyph; + property ImageIndex: Integer read FImageIndex write SetImageIndex + stored IsImageIndexStored default -1; + property Index: Integer read GetIndex write SetIndex; + property LargeGlyph: TBitmap read FLargeGlyph write SetLargeGlyph; + property LargeImageIndex: Integer read FLargeImageIndex write SetLargeImageIndex default -1; + property LinkCount: Integer read GetLinkCount; + property Links[Index: Integer]: TdxBarItemLink read GetLinks; + property ShortCut: TShortCut read FShortCut write SetShortCut + stored IsShortCutStored default 0; + property UnclickAfterDoing: Boolean read FUnclickAfterDoing write FUnclickAfterDoing + default False; + property VisibleForUser: Boolean read GetVisibleForUser; + + property OnClick: TNotifyEvent read FOnClick write FOnClick stored IsOnClickStored; + published + property Action: TBasicAction read GetAction write SetAction; + property Align: TdxBarItemAlign read FAlign write SetAlign default iaLeft; + property Caption: string read GetCaption write SetCaption stored IsCaptionStored; + property Category: Integer read FCategory write SetCategory; + property Description: string read FDescription write SetDescription; + property Enabled stored IsEnabledStored default True; + property HelpContext: THelpContext read FHelpContext write FHelpContext + stored IsHelpContextStored default 0; + property Hint: string read FHint write FHint stored IsHintStored; + property KeyTip: string read FKeyTip write FKeyTip; + property MergeKind: TdxBarItemMergeKind read FMergeKind write FMergeKind + default mkAdd; + property MergeOrder: Integer read FMergeOrder write SetMergeOrder default 0; + property Style: TcxStyle index 0 read GetStyleValue write SetStyleValue; + property ScreenTip: TdxBarScreenTip read FScreenTip write SetScreenTip; + property Visible stored IsVisibleStored; + + property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy; + end; + + TdxBarLabel = class(TdxBarItem) + public + constructor Create(AOwner: TComponent); override; + end; + + TdxBarSeparator = class(TdxBarLabel) + protected + function CanBePlacedOn(AParentKind: TdxBarItemControlParentKind; + AToolbar: TdxBar; out AErrorText: string): Boolean; override; + class function GetNewCaption: string; override; + function GetSupportedActions: TdxBarCustomizationActions; override; + published + property ShowCaption default True; + end; + + TdxBarWindowItem = class(TdxBarItem) + private + FEmptyWindow: Boolean; + FText: string; + + FOnChange: TNotifyEvent; + FOnCurChange: TNotifyEvent; + FOnEnter: TNotifyEvent; + FOnExit: TNotifyEvent; + FOnKeyDown: TKeyEvent; + FOnKeyPress: TKeyPressEvent; + FOnKeyUp: TKeyEvent; + + function GetCurText: string; + function GetFocusedItemLink: TdxBarItemLink; + procedure SetCurText(Value: string); + protected + function CanClicked: Boolean; override; + procedure Change; dynamic; + procedure CurChange; dynamic; + procedure DoEnter; dynamic; + procedure DoExit; dynamic; + function GetControlClass(AIsVertical: Boolean): TdxBarItemControlClass; override; + function GetText: string; virtual; + procedure KeyDown(var Key: Word; Shift: TShiftState); dynamic; + procedure KeyPress(var Key: Char); dynamic; + procedure KeyUp(var Key: Word; Shift: TShiftState); dynamic; + procedure SetText(Value: string); virtual; + property CurText: string read GetCurText write SetCurText; + property EmptyWindow: Boolean read FEmptyWindow write FEmptyWindow; + property Text: string read GetText write SetText; + public + procedure SetFocus(ACheckBarControlVisibility: Boolean = False); virtual; + property FocusedItemLink: TdxBarItemLink read GetFocusedItemLink; + published + property OnChange: TNotifyEvent read FOnChange write FOnChange; + property OnCurChange: TNotifyEvent read FOnCurChange write FOnCurChange; + property OnEnter: TNotifyEvent read FOnEnter write FOnEnter; + property OnExit: TNotifyEvent read FOnExit write FOnExit; + property OnKeyDown: TKeyEvent read FOnKeyDown write FOnKeyDown; + property OnKeyPress: TKeyPressEvent read FOnKeyPress write FOnKeyPress; + property OnKeyUp: TKeyEvent read FOnKeyUp write FOnKeyUp; + end; + + TdxBarButtonState = (bstChecked, bstDropDown); + TdxBarButtonStates = set of TdxBarButtonState; + TdxBarButtonStyle = (bsDefault, bsChecked, bsDropDown, bsCheckedDropDown); + + TdxBarButton = class(TdxBarItem, IdxBarLinksOwner) + private + FAllowAllUp: Boolean; + FCloseSubMenuOnClick: Boolean; + FDown: Boolean; + FDropDownEnabled: Boolean; + FDropDownMenu: TdxBarPopupMenu; + FGroupIndex: Integer; + FInternalStates: TdxBarButtonStates; + FLowered: Boolean; + + function GetButtonStyle: TdxBarButtonStyle; + procedure SetAllowAllUp(Value: Boolean); + procedure SetButtonStyle(Value: TdxBarButtonStyle); + procedure SetDown(Value: Boolean); + procedure SetDropDownEnabled(Value: Boolean); + procedure SetDropDownMenu(Value: TdxBarPopupMenu); + procedure SetGroupIndex(Value: Integer); + procedure SetLowered(Value: Boolean); + + function IsDownStored: Boolean; + protected + function CanChangePaintStyle: Boolean; override; + procedure DoDropDown(AControl: TdxBarButtonControl; X, Y: Integer; + ByMouse: Boolean); dynamic; + function HasAccel(AItemLink: TdxBarItemLink): Boolean; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure PaintStyleChanged; override; + + // IdxBarLinksOwner + function CanContainItem(AItem: TdxBarItem; out AErrorText: string): Boolean; + function CreateBarControl: TCustomdxBarControl; + function IdxBarLinksOwner.GetInstance = GetComponentInstance; + function GetItemLinks: TdxBarItemLinks; override; + + // IdxBarSelectableItem + function GetSupportedActions: TdxBarCustomizationActions; override; + + class function GetNewCaption: string; override; + public + constructor Create(AOwner: TComponent); override; + procedure Click; override; + published + property AllowAllUp: Boolean read FAllowAllUp write SetAllowAllUp default False; + property ButtonStyle: TdxBarButtonStyle read GetButtonStyle write SetButtonStyle + default bsDefault; + property CloseSubMenuOnClick: Boolean read FCloseSubMenuOnClick write FCloseSubMenuOnClick + default True; + property DropDownEnabled: Boolean read FDropDownEnabled write SetDropDownEnabled default True; + property GroupIndex: Integer read FGroupIndex write SetGroupIndex default 0; // must be here + property Down: Boolean read FDown write SetDown + stored IsDownStored default False; + property DropDownMenu: TdxBarPopupMenu read FDropDownMenu write SetDropDownMenu; + property Glyph; + property ImageIndex; + property LargeGlyph; + property LargeImageIndex; + property Lowered: Boolean read FLowered write SetLowered default False; + property PaintStyle; + property ShortCut; + property UnclickAfterDoing default True; + + property OnClick; + end; + + TdxBarApplicationMenuButtonItem = class(TdxBarItem); + + TdxCustomBarEdit = class(TdxBarWindowItem) + private + FGlyphLoaded: Boolean; + + protected + procedure ReadState(Reader: TReader); override; + + procedure DrawCustomizingImage(ACanvas: TCanvas; const ARect: TRect; + AState: TOwnerDrawState); override; + procedure GetEditViewParams(out AViewParams: TcxViewParams); + class function GetStyleCount: Integer; override; + function HasAccel(AItemLink: TdxBarItemLink): Boolean; override; + procedure SetWidth(Value: Integer); override; + property StyleEdit: TcxStyle index 1 read GetStyleValue write SetStyleValue; + public + constructor Create(AOwner: TComponent); override; + published + property Glyph; + property ImageIndex; + property ShowCaption default False; + property Width; + property OnClick; + end; + + TdxBarEdit = class(TdxCustomBarEdit) + private + FMaxLength: Integer; + FReadOnly: Boolean; + + procedure SetMaxLength(Value: Integer); + protected + procedure DrawInterior(ABarEditControl: TdxBarEditControl; ACanvas: TCanvas; + R: TRect; ItemLink: TdxBarItemLink); virtual; + public + property CurText; + published + property MaxLength: Integer read FMaxLength write SetMaxLength default 0; + property ReadOnly: Boolean read FReadOnly write FReadOnly default False; + property StyleEdit; + property Text; + end; + + TCustomdxBarCombo = class; + + TdxBarCheckKeyForDropDownWindowEvent = procedure (Sender: TCustomdxBarCombo; + Key: Word; Shift: TShiftState; var AcceptKey: Boolean) of object; + TdxBarGetDropDownWindowEvent = procedure (Sender: TCustomdxBarCombo; + var Window: HWND) of object; + + TCustomdxBarCombo = class(TdxBarEdit) + private + FOnCheckKeyForDropDownWindow: TdxBarCheckKeyForDropDownWindowEvent; + FOnCloseUp: TNotifyEvent; + FOnDropDown: TNotifyEvent; + FOnGetDropDownWindow: TdxBarGetDropDownWindowEvent; + function GetDroppedDown: Boolean; + function GetShowEditor: Boolean; + procedure SetDroppedDown(Value: Boolean); + procedure SetShowEditor(Value: Boolean); + protected + procedure AfterDropDown; dynamic; + procedure CheckDropDownPoint(var X, Y: Integer); + function CheckKeyForDropDownWindow(Key: Word; Shift: TShiftState): Boolean; virtual; + procedure CloseUp; dynamic; + procedure DrawCustomizingImage(ACanvas: TCanvas; const ARect: TRect; + AState: TOwnerDrawState); override; + procedure DropDown(X, Y: Integer); dynamic; + function GetDropDownWindow: HWND; virtual; + procedure InitDropDownWindow; virtual; + procedure InternalInitDropDownWindow(ADropDownWindow: TWinControl); + public + property DropDownWindow: HWND read GetDropDownWindow; + property DroppedDown: Boolean read GetDroppedDown write SetDroppedDown; + published + property ShowEditor: Boolean read GetShowEditor write SetShowEditor default True; + + property OnCheckKeyForDropDownWindow: TdxBarCheckKeyForDropDownWindowEvent + read FOnCheckKeyForDropDownWindow write FOnCheckKeyForDropDownWindow; + property OnCloseUp: TNotifyEvent read FOnCloseUp write FOnCloseUp; + property OnDropDown: TNotifyEvent read FOnDropDown write FOnDropDown; + property OnGetDropDownWindow: TdxBarGetDropDownWindowEvent + read FOnGetDropDownWindow write FOnGetDropDownWindow; + end; + + TdxBarCustomCombo = class; + + TdxBarDrawItemEvent = procedure(Sender: TdxBarCustomCombo; AIndex: Integer; + ARect: TRect; AState: TOwnerDrawState) of object; + + TdxBarMeasureItemEvent = procedure(Sender: TdxBarCustomCombo; AIndex: Integer; + var AHeight: Integer) of object; + + TdxBarCustomCombo = class(TCustomdxBarCombo) + private + FDropDownCount: Integer; + FDropDownWidth: Integer; + FInteriorIsDrawing: Boolean; + FItemHeight: Integer; + FItemIndex: Integer; + FItems: TStrings; + FListBox: TCustomListBox; + FSorted: Boolean; + FOnDrawItem: TdxBarDrawItemEvent; + FOnMeasureItem: TdxBarMeasureItemEvent; + + function GetCurItemIndex: Integer; + function GetItemsHeight(Index: Integer): Integer; + procedure SetCurItemIndex(Value: Integer); + procedure SetItemIndex(Value: Integer); + procedure SetItems(Value: TStrings); + procedure SetSorted(Value: Boolean); + + procedure CheckLocalPos; + procedure ItemsChanged(Sender: TObject); + procedure ListBoxDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; + State: TOwnerDrawState); + procedure ListBoxMeasureItem(Control: TWinControl; Index: Integer; var Height: Integer); + protected + FCanvas: TCanvas; + procedure AfterDropDown; override; + function CheckKeyForDropDownWindow(Key: Word; Shift: TShiftState): Boolean; override; + procedure CloseUp; override; + procedure CurChange; override; + procedure DrawInterior(ABarEditControl: TdxBarEditControl; ACanvas: TCanvas; + R: TRect; ItemLink: TdxBarItemLink); override; + procedure DrawItem(APainter: TdxBarPainter; AIndex: Integer; ARect: TRect; + AState: TOwnerDrawState); virtual; + procedure DropDown(X, Y: Integer); override; + function GetCanvas: TCanvas; virtual; + function GetDropDownWidth: Integer; virtual; + function GetDropDownWindow: HWND; override; + function GetNearestItemIndex(AText: string): Integer; + procedure InitDropDownWindow; override; + procedure MeasureItem(AIndex: Integer; var AHeight: Integer); virtual; + procedure MeasureItemWidth(AIndex: Integer; var AWidth: Integer); virtual; + procedure SetText(Value: string); override; + property ListBox: TCustomListBox read FListBox; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + property Canvas: TCanvas read GetCanvas; + property CurItemIndex: Integer read GetCurItemIndex write SetCurItemIndex; + property ItemHeight: Integer read FItemHeight write FItemHeight default 0; + property Items: TStrings read FItems write SetItems; + property ItemsHeight[Index: Integer]: Integer read GetItemsHeight; + property Sorted: Boolean read FSorted write SetSorted default False; + property ItemIndex: Integer read FItemIndex write SetItemIndex; // loading after all + published + property DropDownCount: Integer read FDropDownCount write FDropDownCount default 8; + property DropDownWidth: Integer read FDropDownWidth write FDropDownWidth default 0; + + property OnDrawItem: TdxBarDrawItemEvent read FOnDrawItem write FOnDrawItem; + property OnMeasureItem: TdxBarMeasureItemEvent read FOnMeasureItem write FOnMeasureItem; + end; + + TdxBarCombo = class(TdxBarCustomCombo) + published + property ItemHeight; + property Items; + property Sorted; + property ItemIndex; // loading after all + end; + + TCustomdxBarSubItem = class(TdxBarItem, IdxBarLinksOwner, IdxBarSubMenuOwner) + private + FBarSize: Integer; + FDetachable: Boolean; + FDetachingBar: TdxBar; + FIsInternal: Boolean; + FItemLinks: TdxBarItemLinks; + FOnCloseUp: TNotifyEvent; + FOnDetaching: TNotifyEvent; + FOnPaintBar: TdxBarPaintSubMenuBarEvent; + FOnPopup: TNotifyEvent; + function GetDetachingBarIndex: Integer; + function GetItemOptions: TdxBarItemOptions; + procedure SetBarSize(Value: Integer); + procedure SetDetachingBar(Value: Integer); + procedure SetIsInternal(Value: Boolean); + procedure SetItemLinks(Value: TdxBarItemLinks); + procedure SetItemOptions(Value: TdxBarItemOptions); + protected + procedure BarManagerChanged; override; + function CanClicked: Boolean; override; + procedure DoCloseUp; dynamic; + procedure DoDetaching; dynamic; + procedure DoPopup; dynamic; + procedure InternalDropDown(AItemControl: TdxBarSubItemControl; AByMouse: Boolean); + procedure ObjectNotification(AOperation: TOperation; AObject: TObject); override; + + procedure CheckLinks(ASource: TCustomIniFile; const ABaseSection: string); override; + function GetIniSection(const ABaseSection: string): string; + procedure LoadFromIni(ASource: TCustomIniFile; const ABaseSection: string; AStoringKind: TdxBarStoringKind); override; + procedure LoadUsageData(ASource: TCustomIniFile; const ABaseSection: string); override; + procedure SaveToIni(ADestination: TCustomIniFile; const ABaseSection: string; AStoringKind: TdxBarStoringKind); override; + + // IdxBarLinksOwner + function CanContainItem(AItem: TdxBarItem; out AErrorText: string): Boolean; + function CreateBarControl: TCustomdxBarControl; virtual; + function IdxBarLinksOwner.GetInstance = GetComponentInstance; + function GetItemLinks: TdxBarItemLinks; override; + + // IdxBarSelectableItem + function GetSupportedActions: TdxBarCustomizationActions; override; + + // IdxBarSubMenuOwner + function GetBarSize: Integer; + procedure DoPaintBar(Canvas: TCanvas; const R: TRect); virtual; + + property IsInternal: Boolean read FIsInternal write SetIsInternal; + property ItemOptions: TdxBarItemOptions read GetItemOptions write SetItemOptions; + property OnCloseUp: TNotifyEvent read FOnCloseUp write FOnCloseUp; + property OnPopup: TNotifyEvent read FOnPopup write FOnPopup; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function GetDetachingBar: TdxBar; + procedure DropDown(AByMouse: Boolean = False); + + property ItemLinks: TdxBarItemLinks read GetItemLinks write SetItemLinks; + published + property BarSize: Integer read GetBarSize write SetBarSize default 0; + property Detachable: Boolean read FDetachable write FDetachable default False; + property DetachingBar: Integer read GetDetachingBarIndex write SetDetachingBar + default -1; + property Glyph; + property ImageIndex; + property LargeGlyph; + property LargeImageIndex; + property ShowCaption default True; + property OnClick; + property OnDetaching: TNotifyEvent read FOnDetaching write FOnDetaching; + property OnPaintBar: TdxBarPaintSubMenuBarEvent read FOnPaintBar write FOnPaintBar; + end; + + TdxBarSubItem = class(TCustomdxBarSubItem) + private + FAllowCustomizing: Boolean; + protected + class function GetNewCaption: string; override; + function InternalCanMergeWith(AItem: TdxBarItem): Boolean; override; + public + constructor Create(AOwner: TComponent); override; + published + property AllowCustomizing: Boolean read FAllowCustomizing write FAllowCustomizing + default True; + property ItemLinks; + property ItemOptions; + property OnCloseUp; + property OnPopup; + end; + + TCustomdxBarContainerItem = class(TCustomdxBarSubItem) + private + FInOnGetData: Boolean; + FNeedClearItemList: Boolean; + FOnGetData: TNotifyEvent; + protected + procedure AddListedItemLinks(AItemLinks: TdxBarItemLinks; AIndex: Integer; + FirstCall: Boolean; CallingItemLink: TdxBarItemLink); virtual; + procedure DeleteListedItemLinks(AItemLinks: TdxBarItemLinks; AIndex: Integer); virtual; + procedure ClearItemList; virtual; + function HideWhenRun: Boolean; virtual; + function InternalActuallyVisible: Boolean; override; + procedure ItemsChanged(AItemLinks: TObject); virtual; + procedure NeedClearItemList; + public + destructor Destroy; override; + published + property OnGetData: TNotifyEvent read FOnGetData write FOnGetData; + end; + + TdxBarListItem = class(TCustomdxBarContainerItem) + private + FItemIndex: Integer; + FItemList: TList; + FItems: TStrings; + FShowCheck: Boolean; + FShowNumbers: Boolean; + function GetDataIndex: Integer; + procedure SetDataIndex(Value: Integer); + procedure SetItems(Value: TStrings); + procedure ClickItem(Sender: TObject); + protected + procedure AddListedItemLinks(AItemLinks: TdxBarItemLinks; AIndex: Integer; + FirstCall: Boolean; CallingItemLink: TdxBarItemLink); override; + procedure ClearItemList; override; + procedure DeleteListedItemLinks(AItemLinks: TdxBarItemLinks; AIndex: Integer); override; + function GetDisplayHint(const AText: string): string; virtual; + function GetDisplayText(const AText: string): string; overload; virtual; + function GetDisplayText(AItemIndex: Integer): string; overload; virtual; + function InternalActuallyVisible: Boolean; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure DirectClick; override; + property ItemList: TList read FItemList; + published + property DataIndex: Integer read GetDataIndex write SetDataIndex stored False; + property ItemIndex: Integer read FItemIndex write FItemIndex default -1; + property Items: TStrings read FItems write SetItems; + property LargeGlyph; + property LargeImageIndex; + property ShowCheck: Boolean read FShowCheck write FShowCheck default False; + property ShowNumbers: Boolean read FShowNumbers write FShowNumbers default True; + end; + + TdxBarContainerItem = class(TCustomdxBarContainerItem) + protected + procedure AddListedItemLinks(AItemLinks: TdxBarItemLinks; AIndex: Integer; + FirstCall: Boolean; CallingItemLink: TdxBarItemLink); override; + procedure DeleteListedItemLinks(AItemLinks: TdxBarItemLinks; AIndex: Integer); override; + function InternalActuallyVisible: Boolean; override; + function InternalCanMergeWith(AItem: TdxBarItem): Boolean; override; + function IsItemsExist: Boolean; virtual; + public + constructor Create(AOwner: TComponent); override; + published + property ItemLinks; + end; + + TdxBarExtraPaneListItem = class(TdxBarListItem) + private + FOnGetDisplayText: TdxBarExtraPaneGetDisplayTextEvent; + + function GetExtraPaneItem(AIndex: Integer): TdxBarExtraPaneItem; + property ExtraPaneItem[AIndex: Integer]: TdxBarExtraPaneItem read GetExtraPaneItem; + protected + procedure AddListedItemLinks(AItemLinks: TdxBarItemLinks; AIndex: Integer; + FirstCall: Boolean; CallingItemLink: TdxBarItemLink); override; + function GetDisplayHint(const AText: string): string; override; + function GetDisplayText(AItemIndex: Integer): string; override; + function InternalActuallyVisible: Boolean; override; + + property OnGetDisplayText: TdxBarExtraPaneGetDisplayTextEvent read FOnGetDisplayText write FOnGetDisplayText; + end; + + {-------------------------------------- + Item's controls + --------------------------------------} + + TdxBarSavedFont = record + LogFont: TLogFont; + Saved: Boolean; + end; + + TdxBarItemControlDrawParams = class + private + FViewSize: TdxBarItemControlViewSize; + FBarItemControl: TdxBarItemControl; + + procedure SetViewSize(Value: TdxBarItemControlViewSize); + public + Canvas: TcxCanvas; + Caption: string; + Description: string; + ShortCut: string; + PaintType: TdxBarPaintType; + ViewStructure: TdxBarItemControlViewStructure; + Enabled: Boolean; + CanSelect: Boolean; + DrawSelected: Boolean; + DroppedDown: Boolean; + IsDropDown: Boolean; + HotPartIndex: Integer; + IsCustomizing: Boolean; + IsPressed: Boolean; + SelectedByKey: Boolean; + DefaultButtonSize: TSize; + + constructor Create(ABarItemControl: TdxBarItemControl); + + property BarItemControl: TdxBarItemControl read FBarItemControl; + property ViewSize: TdxBarItemControlViewSize read FViewSize write SetViewSize; + end; + TdxBarItemControlDrawParamsClass = class of TdxBarItemControlDrawParams; + + TdxBarButtonLikeControlDrawParams = class(TdxBarItemControlDrawParams) + public + Downed: Boolean; + DrawDowned: Boolean; + DroppedDownFlat: Boolean; + SplitDropDown: Boolean; + DropDownEnabled: Boolean; + IsTextSelected: Boolean; + IsFlatText: Boolean; + GrayScale: Boolean; + IsLowered: Boolean; + IsMenuItem: Boolean; + ArrowSize: TSize; + ButtonGroup: TdxBarButtonGroupRealPosition; + end; + + TdxBarApplicationMenuButtonControlDrawParams = class(TdxBarButtonLikeControlDrawParams) + public + ContentWidth: Integer; + end; + + TdxBarEditLikeControlDrawParams = class(TdxBarItemControlDrawParams) + private + function GetBarEditControl: TdxBarEditControl; + public + Focused: Boolean; + IsTransparent: Boolean; + property BarEditControl: TdxBarEditControl read GetBarEditControl; + end; + + TdxBarStaticLikeControlDrawParams = class(TdxBarItemControlDrawParams) + private + function GetBarStaticControl: TdxBarCustomStaticControl; + public + Alignment: TAlignment; + AllowCenter: Boolean; + BorderOffsets: TRect; + BorderStyle: TdxBarStaticBorderStyle; + property BarStaticControl: TdxBarCustomStaticControl read GetBarStaticControl; + end; + + TdxBarSeparatorControlDrawParams = class(TdxBarStaticLikeControlDrawParams) + public + IsTop: Boolean; + end; + + TdxBarColorComboControlDrawParams = class(TdxBarEditLikeControlDrawParams) + public + IsShowCustomColorButton: Boolean; + end; + + TdxBarSpinEditDrawParams = class(TdxBarEditLikeControlDrawParams) + public + ArrowSize: TSize; + ActiveButtonIndex: Integer; + end; + + TdxBarProgressControlDrawParams = class(TdxBarStaticLikeControlDrawParams) + public + Smooth: Boolean; + Position: Integer; + Min: Integer; + Max: Integer; + end; + + TdxBarInPlaceSubItemControlDrawParams = class(TdxBarButtonLikeControlDrawParams) + public + IsExpanded: Boolean; + end; + + TdxBarItemControlViewInfo = class(TcxInterfacedPersistent, IdxBarItemControlViewInfo) + private + FAllowedViewLevels: TdxBarItemViewLevels; + FBounds: TRect; + FColumnRowCount: Integer; + FImageBounds: TRect; + FMinPossibleViewLevel: TdxBarItemRealViewLevel; + FRealPositionInButtonGroup: TdxBarButtonGroupRealPosition; + FRow: Integer; + FViewLevel: TdxBarItemViewLevel; + FViewLevelForButtonGroup: TdxBarItemRealViewLevel; + FViewLevelInfos: array [TdxBarItemRealViewLevel] of TdxBarItemCachedWidthInfo; + protected + FControl: TdxBarItemControl; + + // IdxBarItemControlViewInfo + procedure CalculateFinalize; + function GetAlign: TdxBarItemAlign; + function GetAllowedViewLevels: TdxBarItemViewLevels; + function GetBounds: TRect; + function GetColumnRowCount: Integer; + function GetPosition: TdxBarItemPosition; + function GetPositionInButtonGroup: TdxBarButtonGroupPosition; + function GetRealPositionInButtonGroup: TdxBarButtonGroupRealPosition; + function GetRow: Integer; + function GetViewLevel: TdxBarItemViewLevel; + function GetViewLevelForButtonGroup: TdxBarItemRealViewLevel; + function GetWidth(AViewLevel: TdxBarItemRealViewLevel): Integer; + function HasSeparator: Boolean; + function IsMultiColumnItemControl(ACheckCollapsed: Boolean; + out AIMultiColumnItemControlViewInfo: IdxBarMultiColumnItemControlViewInfo): Boolean; + procedure SetBounds(const Value: TRect); + procedure SetColumnRowCount(Value: Integer); + procedure SetRealPositionInButtonGroup(Value: TdxBarButtonGroupRealPosition); + procedure SetRow(Value: Integer); + procedure SetViewLevel(Value: TdxBarItemViewLevel); + + procedure BoundsCalculated; virtual; + public + constructor Create(AControl: TdxBarItemControl); reintroduce; virtual; + destructor Destroy; override; + procedure ResetCachedValues; virtual; + property Bounds: TRect read GetBounds; + property Control: TdxBarItemControl read FControl; + property ImageBounds: TRect read FImageBounds write FImageBounds; + property MinPossibleViewLevel: TdxBarItemRealViewLevel read FMinPossibleViewLevel; + property RealPositionInButtonGroup: TdxBarButtonGroupRealPosition + read FRealPositionInButtonGroup; + property ViewLevel: TdxBarItemViewLevel read GetViewLevel; + end; + + TdxBarItemControlViewInfoClass = class of TdxBarItemControlViewInfo; + + TdxCachedImageOptions = class + private + FCached: Boolean; + FGlyph: TcxBitmap; + + FCachedDrawMode: TcxImageDrawMode; + FCachedImages: TCustomImageList; + FCachedGlyph: TBitmap; + public + constructor Create; + destructor Destroy; override; + + procedure Cache(const ARect: TRect; AGlyph: TBitmap; + AImages: TCustomImageList; AImageIndex: Integer; ADrawMode: TcxImageDrawMode; + ATransparentColor: TColor; ASmoothImage, AUseLeftBottomPixelAsTransparent: Boolean); + function IsCached(ADrawMode: TcxImageDrawMode; AGlyph: TBitmap; AImages: TCustomImageList): Boolean; + + property Cached: Boolean read FCached write FCached; + property Glyph: TcxBitmap read FGlyph; + end; + + TdxBarItemControl = class(TcxIUnknownObject, IdxFadingObject, IdxBarHintKeeper) + private + FActiveCanvas: TcxCanvas; + FBkBrush: HBRUSH; + FBreakingRow: Boolean; + FCachedImageOptions: TdxCachedImageOptions; + FChangeRecentGroup: Boolean; + FIAccessibilityHelper: IdxBarAccessibilityHelper; + FIsActive: Boolean; + FItemLink: TdxBarItemLink; + FLastInRow: Boolean; + FNonRecent: Boolean; + FParent: TCustomdxBarControl; + FPressed: Boolean; + FSelectedByMouse: Boolean; + FTextSize: Integer; + + procedure DoCalculateParts; + function FindPartAtPos(APoint: TPoint): Integer; + function GetAlign: TdxBarItemAlign; + function GetBarManager: TdxBarManager; + function GetBkBrush: HBRUSH; + function GetCanvas: TcxCanvas; + function GetFlat: Boolean; + function GetIAccessibilityHelper: IdxBarAccessibilityHelper; + function GetIsSelected: Boolean; + function GetItem: TdxBarItem; + function GetItemBounds: TRect; + function GetPainterClass: TdxBarPainterClass; + function GetRealHeight: Integer; + function GetRealWidth: Integer; + function GetShowDescription: Boolean; + function GetSubMenuParent: TdxBarSubMenuControl; + function GetUnclickAfterDoing: Boolean; + function InternalGetPossibleViewLevels: TdxBarItemViewLevels; + procedure SetPressed(Value: Boolean); + protected + FDrawParams: TdxBarItemControlDrawParams; + FHotPartIndex: Integer; + FParts: array of TRect; + FViewInfo: TdxBarItemControlViewInfo; + // IdxFadingObject + function CanFade: Boolean; + procedure DrawBitmap(ABitmap: TBitmap); + procedure GetFadingParams(out AFadeOutImage, AFadeInImage: TBitmap; + var AFadeInStageCount, AFadeInStageInterval, + AFadeOutStageCount, AFadeOutStageInterval: Integer); + function GetFader: TdxFader; virtual; + // IdxBarHintKeeper + function DoHint(var ANeedDeactivate: Boolean; out AHintText: string; out AShortCut: string): Boolean; virtual; + function CreateHintViewInfo(const AHintText, AShortCut: string): TdxBarCustomHintViewInfo; virtual; + function GetEnabled: Boolean; virtual; + function GetHintPosition(const ACursorPos: TPoint; AHeight: Integer): TPoint; virtual; + + // Change Group + procedure BeginGroupChanged; virtual; + procedure CaptionChanged; virtual; + procedure EnabledChanged; virtual; + procedure GlyphChanged; virtual; + procedure HotGlyphChanged; virtual; + procedure LargeGlyphChanged; virtual; + procedure PartsChanged; virtual; + procedure PaintStyleChanged; virtual; + procedure ParentVisibleChange(AIsShowing: Boolean); virtual; + procedure PressedChanged; virtual; + procedure RealVisibleChanging(AVisible: Boolean); virtual; + procedure VisibleChanged; virtual; + procedure WidthChanged; virtual; + procedure ResetCachedValues(AFull: Boolean); + + function UseLargeGlyph(AViewSize: TdxBarItemControlViewSize): Boolean; + function UseLargeIcons: Boolean; + function UseLargeImageSource(AViewSize: TdxBarItemControlViewSize): Boolean; + function UseLargeImageList(AViewSize: TdxBarItemControlViewSize): Boolean; + procedure BeforeDestroyParentHandle; virtual; + function CanBePartOfButtonGroup: Boolean; virtual; + function CanClicked: Boolean; virtual; + function CanCustomize: Boolean; virtual; + function CanDeselect(ABarManager: TdxBarManager): Boolean; virtual; + function CanHide: Boolean; virtual; + function CanMouseSelect: Boolean; virtual; + function CanSelect: Boolean; virtual; + function CanShowShortCut: Boolean; + function CanVisuallyPressed: Boolean; + procedure CheckHotTrack(APoint: TPoint); virtual; + procedure Click(AByMouse: Boolean; AKey: Char = #0); virtual; + procedure ControlActivate(Immediately: Boolean); virtual; + procedure ControlInactivate(Immediately: Boolean); virtual; + procedure ControlClick(AByMouse: Boolean; AKey: Char = #0); virtual; + procedure ControlUnclick(ByMouse: Boolean); virtual; + procedure ControlGetFocus(AIsSelected: Boolean; var AProcessed: Boolean); virtual; + procedure DblClick; dynamic; + function DrawSelected: Boolean; virtual; + function GetSelectableObject: TPersistent; + function WantsDblClick: Boolean; dynamic; + + // User Events Group + procedure KeyDown(var Key: Word; Shift: TShiftState); dynamic; + procedure KeyUp(var Key: Word; Shift: TShiftState); dynamic; + procedure KeyPress(var Key: Char); dynamic; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); dynamic; + procedure MouseEnter(Shift: TShiftState; X, Y: Integer); dynamic; + procedure MouseLeave; dynamic; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); dynamic; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); dynamic; + function WantsKey(Key: Word): Boolean; virtual; + + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; virtual; + function GetPossibleViewLevels: TdxBarItemViewLevels; virtual; + function GetViewLevels: TdxBarItemViewLevels; + function GetViewStructure: TdxBarItemControlViewStructure; virtual; + function GetDefaultViewStructure: TdxBarItemControlViewStructure; virtual; + function GetViewSize: TdxBarItemControlViewSize; + function GetDefaultViewSize: TdxBarItemControlViewSize; virtual; + function GetPaintType: TdxBarPaintType; virtual; + function GetPartCount: Integer; virtual; + function GetViewInfoClass: TdxBarItemControlViewInfoClass; virtual; + function GrayScale: Boolean; virtual; + function HasIcon(AViewSize: TdxBarItemControlViewSize; AViewStructure: TdxBarItemControlViewStructure): Boolean; + function IconAssigned(AViewSize: TdxBarItemControlViewSize): Boolean; + + procedure FrameAndFillRect(DC: HDC; var R: TRect; Enabled, Selected, Pressed: Boolean); + + function GetCaption: string; virtual; + function GetControl: TControl; virtual; + function GetDrawParamsClass: TdxBarItemControlDrawParamsClass; virtual; + function GetGlyph: TBitmap; virtual; + function GetImageEnabled(APaintType: TdxBarPaintType): Boolean; virtual; + function GetImageIndex: Integer; virtual; + function GetImageList(AViewSize: TdxBarItemControlViewSize): TCustomImageList; virtual; + function GetImages: TCustomImageList; virtual; + function GetHint: string; virtual; + function GetHotImages: TCustomImageList; virtual; + function GetLargeGlyph: TBitmap; virtual; + function GetLargeImageIndex: Integer; virtual; + function GetLargeImages: TCustomImageList; virtual; + function GetMenuItemSize: TdxBarMenuItemSize; virtual; + function GetPainter: TdxBarPainter; virtual; + function GetShortCut: TShortCut; virtual; + function GetTextAreaOffset: Integer; virtual; + + // Draw Group + procedure CalcDrawParams(AFull: Boolean = True); virtual; + procedure CalcParts; virtual; + procedure CalcDrawingConsts; virtual; + procedure DoCalcDrawingConsts; virtual; + procedure DoPaint(ARect: TRect; PaintType: TdxBarPaintType); virtual; + function IsTransparentOnGlass: Boolean; virtual; + procedure PrepareCanvasFont(ABaseFont: HFONT; AStyle: TcxStyle; + out ASavedFont: TdxBarSavedFont); virtual; + procedure RestoreCanvasFont(const ASavedFont: TdxBarSavedFont); virtual; + + function GetOwnedBarControl: TCustomdxBarControl; virtual; + + function GetNonBufferedRect: TRect; virtual; + function GetCaptionWidth: Integer; virtual; + function GetCurrentImage(AViewSize: TdxBarItemControlViewSize; ASelected: Boolean; + out ACurrentGlyph: TBitmap; out ACurrentImages: TCustomImageList; out ACurrentImageIndex: Integer): Boolean; virtual; + function GetCurrentImageIndex(AViewSize: TdxBarItemControlViewSize): Integer; virtual; + function GetGlyphSize(AViewSize: TdxBarItemControlViewSize; ASelected: Boolean = False): TSize; virtual; + function GetIndents(ADrawAreaType: TdxBarItemControlPart): TRect; virtual; + function GetRotationDependentHeight(ASourceSize: TSize): Integer; + function GetRotationDependentWidth(ASourceSize: TSize): Integer; + function GetTextExtent(const AText: string): TSize; + function GetTextHeight: Integer; + function GetTextSize: Integer; // TODO property + function GetTextWidth(const AText: string): Integer; + + function GetCaptionAreaWidth: Integer; virtual; + function GetControlAreaWidth: Integer; virtual; + function GetGlyphAreaWidth: Integer; virtual; + + function GetControlCaptionOffset: Integer; virtual; + function GetDefaultHeight: Integer; virtual; + function GetDefaultWidth: Integer; virtual; + function GetDefaultWidthHorzLayout: Integer; virtual; + function GetDefaultWidthVertLayout: Integer; virtual; + + function GetDefaultHeightInSubMenu: Integer; virtual; + function GetDefaultWidthInSubMenu: Integer; virtual; + function GetMinHeight: Integer; virtual; + function GetMinWidth: Integer; virtual; + function GetHeight: Integer; + function GetWidth: Integer; + function GetWidthByViewLevel(AViewLevel: TdxBarItemRealViewLevel): Integer; + function GetLargeHeight: Integer; virtual; + function GetSmallHeight: Integer; virtual; + function InternalGetDefaultHeight: Integer; virtual; + function InternalGetDefaultWidth: Integer; virtual; + + // Ask Group + function HasHint: Boolean; virtual; + function HasShadow: Boolean; virtual; + function HotPartWantMouse: Boolean; virtual; + function IsBkColorAssigned: Boolean; + function IsChildWindow(AWnd: HWND): Boolean; virtual; + function IsDestroyOnClick: Boolean; virtual; + function IsDropDown: Boolean; virtual; + function IsEditTransparent: Boolean; virtual; + function IsExpandable: Boolean; virtual; + function IsHiddenForCustomization: Boolean; virtual; + function IsHitTestTransparent: Boolean; virtual; + function IsInvertTextColor: Boolean; virtual; + function IsMenuItem: Boolean; virtual; + function IsRotated: Boolean; virtual; + function IsSelectionForbidden: Boolean; + function MousePressed: Boolean; + function NeedCaptureMouse: Boolean; virtual; + function WantMouse: Boolean; + + procedure CheckNonRecent; + procedure UncheckNonRecent; + + // Resize Group + procedure BeginResize(APoint: TPoint); virtual; + function CanResize(APoint: TPoint): Boolean; virtual; + procedure EndResize(AAllowResize: Boolean); virtual; + procedure Resizing(APoint: TPoint); virtual; + + property Align: TdxBarItemAlign read GetAlign; + property BkBrush: HBRUSH read GetBkBrush; + property Canvas: TcxCanvas read GetCanvas; + property Caption: string read GetCaption; + property Control: TControl read GetControl; + property DrawParams: TdxBarItemControlDrawParams read FDrawParams; + property Flat: Boolean read GetFlat; + property Glyph: TBitmap read GetGlyph; + property Height: Integer read GetRealHeight; + property Hint: string read GetHint; + property HotImages: TCustomImageList read GetHotImages; + property ImageIndex: Integer read GetImageIndex; + property Images: TCustomImageList read GetImages; + property LargeGlyph: TBitmap read GetLargeGlyph; + property LargeImageIndex: Integer read GetLargeImageIndex; + property LargeImages: TCustomImageList read GetLargeImages; + property LastInRow: Boolean read FLastInRow write FLastInRow; + property MenuItemSize: TdxBarMenuItemSize read GetMenuItemSize; + property MinHeight: Integer read GetMinHeight; + property MinWidth: Integer read GetMinWidth; + property NonRecent: Boolean read FNonRecent; + property OwnedBarControl: TCustomdxBarControl read GetOwnedBarControl; + property PossibleViewLevels: TdxBarItemViewLevels read InternalGetPossibleViewLevels; + property Pressed: Boolean read FPressed write SetPressed; + property SubMenuParent: TdxBarSubMenuControl read GetSubMenuParent; + property ShortCut: TShortCut read GetShortCut; + property ShowDescription: Boolean read GetShowDescription; + property TextAreaOffset: Integer read GetTextAreaOffset; + property UnclickAfterDoing: Boolean read GetUnclickAfterDoing; + property ViewLevels: TdxBarItemViewLevels read GetViewLevels; + property Width: Integer read GetRealWidth; + public + constructor Create(AItemLink: TdxBarItemLink); virtual; + destructor Destroy; override; + + class function HasWindow: Boolean; virtual; + function IsDroppedDown: Boolean; virtual; + procedure Paint(ACanvas: TcxCanvas; ARect: TRect; PaintType: TdxBarPaintType); + procedure Repaint; virtual; + + property BarManager: TdxBarManager read GetBarManager; + property Enabled: Boolean read GetEnabled; + property IAccessibilityHelper: IdxBarAccessibilityHelper read GetIAccessibilityHelper; + property IsActive: Boolean read FIsActive; + property IsSelected: Boolean read GetIsSelected; + property Item: TdxBarItem read GetItem; + property ItemBounds: TRect read GetItemBounds; + property ItemLink: TdxBarItemLink read FItemLink; + property Painter: TdxBarPainter read GetPainter; + property PainterClass: TdxBarPainterClass read GetPainterClass; + property Parent: TCustomdxBarControl read FParent; + property ViewInfo: TdxBarItemControlViewInfo read FViewInfo; + end; + + TdxBarCustomStaticControl = class(TdxBarItemControl) + private + function GetDrawParams: TdxBarStaticLikeControlDrawParams; + protected + function CanClicked: Boolean; override; + function CanSelect: Boolean; override; + procedure DoPaint(ARect: TRect; PaintType: TdxBarPaintType); override; + procedure DrawInterior(ARect: TRect); virtual; abstract; + function GetDefaultViewStructure: TdxBarItemControlViewStructure; override; + function GetDrawParamsClass: TdxBarItemControlDrawParamsClass; override; + property DrawParams: TdxBarStaticLikeControlDrawParams read GetDrawParams; + end; + + TdxBarSeparatorControl = class(TdxBarCustomStaticControl) + private + function GetDrawParams: TdxBarSeparatorControlDrawParams; + protected + procedure CalcDrawParams(AFull: Boolean = True); override; + procedure DoPaint(ARect: TRect; PaintType: TdxBarPaintType); override; + function GetIndents(ADrawAreaType: TdxBarItemControlPart): TRect; override; + + function GetMenuItemSize: TdxBarMenuItemSize; override; + function GetGlyphAreaWidth: Integer; override; + + function GetDefaultHeightInSubMenu: Integer; override; + function GetDefaultWidthInSubMenu: Integer; override; + function GetMinWidth: Integer; override; + function InternalGetDefaultHeight: Integer; override; + function InternalGetDefaultWidth: Integer; override; + + procedure PrepareCanvasFont(ABaseFont: HFONT; AStyle: TcxStyle; + out ASavedFont: TdxBarSavedFont); override; + procedure RestoreCanvasFont(const ASavedFont: TdxBarSavedFont); override; + + function GetDefaultViewStructure: TdxBarItemControlViewStructure; override; + function GetDrawParamsClass: TdxBarItemControlDrawParamsClass; override; + property DrawParams: TdxBarSeparatorControlDrawParams read GetDrawParams; + end; + + TdxBarWinControl = class(TdxBarItemControl) + private + FInnerControlBufferedPaint: Boolean; + FDefWndProc: Pointer; + FFocused: Boolean; + FFocusing: Boolean; + FKeyPressedInside: Integer; + FOnGlass: Boolean; + FPrevDefWndProc: Pointer; + FPrevFocusedControl: HWND; + FWindowRect: TRect; + function DoCallKeyboardHook(wParam: WParam; lParam: LParam): Boolean; + function GetItem: TdxBarWindowItem; + function GetWindowRect: TRect; + procedure SetWindowRect(const Value: TRect); + protected + function CanClicked: Boolean; override; + function CanDeselect(ABarManager: TdxBarManager): Boolean; override; + function CanSelect: Boolean; override; + procedure ControlInactivate(Immediately: Boolean); override; + procedure ControlClick(AByMouse: Boolean; AKey: Char = #0); override; + procedure ControlGetFocus(AIsSelected: Boolean; var AProcessed: Boolean); override; + procedure EnabledChanged; override; + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; override; + function IsChildWindow(AWnd: HWND): Boolean; override; + function IsDestroyOnClick: Boolean; override; + function IsWindowEnabled: Boolean; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + + function ClientToParent(const APoint: TPoint): TPoint; + function ParentToClient(const APoint: TPoint): TPoint; + + procedure CreateInnerEdit; virtual; + procedure DestroyInnerEdit(AFullDestroy: Boolean = True); virtual; + + procedure DoEnter; + procedure DoEscape; + procedure DoNavigation; + + function DoKeyDown(var Message: TWMKey): Boolean; + function DoKeyPress(var Message: TWMKey): Boolean; + function DoKeyUp(var Message: TWMKey): Boolean; + procedure DoKillFocus(var Message: TMessage); + procedure DoMouseDown(var Message: TWMMouse; AButton: TMouseButton; + AShift: TShiftState); + procedure DoMouseMove(var Message: TWMMouse); + + procedure ActivateEdit(AByMouse: Boolean; AKey: Char = #0); virtual; + function GetHandle: HWND; virtual; abstract; + function GetText: string; virtual; + procedure Hide(AStoreDisplayValue: Boolean); virtual; abstract; + procedure KillFocus(AHandle: THandle); dynamic; + procedure PrepareEditWnd; virtual; + procedure RestoreDisplayValue; virtual; + procedure SetFocused(Value: Boolean); virtual; + procedure SetText(Value: string); virtual; + procedure Show; virtual; + procedure StoreDisplayValue; virtual; + procedure SysKeyDown(var Key: Word; Shift: TShiftState); virtual; + procedure SysKeyUp(var Key: Word; Shift: TShiftState); virtual; + procedure TransferMessage(AFromWindow: HWND; const Message: TMessage); + procedure WndProc(var Message: TMessage); virtual; + + property InnerControlBufferedPaint: Boolean read FInnerControlBufferedPaint write FInnerControlBufferedPaint; + public + procedure DefaultHandler(var Message); override; + class function HasWindow: Boolean; override; + function HandleAllocated: Boolean; + property Focused: Boolean read FFocused write SetFocused; + property Handle: HWND read GetHandle; + property Item: TdxBarWindowItem read GetItem; + property OnGlass: Boolean read FOnGlass; + property Text: string read GetText write SetText; + property WindowRect: TRect read GetWindowRect write SetWindowRect; + end; + + TdxBarButtonLikeControl = class(TdxBarItemControl) + private + FShowAnimation: Boolean; + function GetDrawParams: TdxBarButtonLikeControlDrawParams; + protected + function ArrowWidth: Integer; virtual; + procedure CalcDrawParams(AFull: Boolean = True); override; + function CanBePartOfButtonGroup: Boolean; override; + function CanActivate: Boolean; virtual; + procedure ControlActivate(Immediately: Boolean); override; + procedure ControlInactivate(Immediately: Boolean); override; + procedure ControlGetFocus(AIsSelected: Boolean; var AProcessed: Boolean); override; + procedure DoPaint(ARect: TRect; PaintType: TdxBarPaintType); override; + procedure DropDown(AByMouse: Boolean); virtual; + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; override; + function GetDrawParamsClass: TdxBarItemControlDrawParamsClass; override; + function GetSubMenuControl: TdxBarSubMenuControl; virtual; + function IsFlatText: Boolean; virtual; + function IsTextSelected: Boolean; virtual; + + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + function WantsKey(Key: Word): Boolean; override; + + procedure FinishSubMenuTracking; + procedure StartSubMenuTracking(AActivation: Boolean); + + procedure DoCloseUp(AHadSubMenuControl: Boolean); dynamic; + procedure DoDropDown(AByMouse: Boolean); dynamic; abstract; + + property DrawParams: TdxBarButtonLikeControlDrawParams read GetDrawParams; + public + destructor Destroy; override; + property SubMenuControl: TdxBarSubMenuControl read GetSubMenuControl; + end; + + TdxBarButtonControl = class(TdxBarButtonLikeControl) + private + FDroppedDown: Boolean; + function GetButtonItem: TdxBarButton; + function GetDown: Boolean; + function GetDropDownEnabled: Boolean; + function GetDroppedDownFlat: Boolean; + function GetGroupIndex: Integer; + function GetInternalStates: TdxBarButtonStates; + function GetLowered: Boolean; + function MouseOverArrow: Boolean; + protected + function ArrowPressed: Boolean; + procedure CalcDrawParams(AFull: Boolean = True); override; + procedure CalcParts; override; + procedure ControlClick(AByMouse: Boolean; AKey: Char = #0); override; + procedure ControlUnclick(ByMouse: Boolean); override; + procedure ControlGetFocus(AIsSelected: Boolean; var AProcessed: Boolean); override; + procedure DoCloseUp(AHadSubMenuControl: Boolean); override; + procedure DoDropDown(AByMouse: Boolean); override; + function DrawSelected: Boolean; override; + procedure DropDown(AByMouse: Boolean); override; + function GetSubMenuControl: TdxBarSubMenuControl; override; + function IsFlatText: Boolean; override; + function IsTextSelected: Boolean; override; + + function GetDefaultHeight: Integer; override; + function GetDefaultWidth: Integer; override; + function GetSmallHeight: Integer; override; + + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; override; + function GetDefaultViewStructure: TdxBarItemControlViewStructure; override; + function GetOwnedBarControl: TCustomdxBarControl; override; + function GetPaintStyle: TdxBarPaintStyle; virtual; + function GetPartCount: Integer; override; + function GetViewStructure: TdxBarItemControlViewStructure; override; + function IsDestroyOnClick: Boolean; override; + function IsDropDown: Boolean; override; + function IsPressed: Boolean; + function NeedCaptureMouse: Boolean; override; + procedure PaintStyleChanged; override; + procedure PreparePaintStyleOnBar(var APaintStyle: TdxBarPaintStyle); virtual; + + property Down: Boolean read GetDown; + property DropDownEnabled: Boolean read GetDropDownEnabled; + property DroppedDown: Boolean read FDroppedDown; + property DroppedDownFlat: Boolean read GetDroppedDownFlat; // TODO: obsolete + property GroupIndex: Integer read GetGroupIndex; + property InternalStates: TdxBarButtonStates read GetInternalStates; + property Lowered: Boolean read GetLowered; + property PaintStyle: TdxBarPaintStyle read GetPaintStyle; + public + function IsDroppedDown: Boolean; override; + property ButtonItem: TdxBarButton read GetButtonItem; + end; + + TdxBarApplicationMenuButtonControl = class(TdxBarButtonLikeControl) + private + function GetDrawParams: TdxBarApplicationMenuButtonControlDrawParams; + protected + procedure CalcDrawParams(AFull: Boolean = False); override; + procedure DoPaint(ARect: TRect; PaintType: TdxBarPaintType); override; + function GetDefaultViewStructure: TdxBarItemControlViewStructure; override; + function GetDrawParamsClass: TdxBarItemControlDrawParamsClass; override; + function GetPaintType: TdxBarPaintType; override; + function InternalGetDefaultWidth: Integer; override; + + procedure CaptionChanged; override; + procedure GlyphChanged; override; + procedure VisibleChanged; override; + procedure WidthChanged; override; + + property DrawParams: TdxBarApplicationMenuButtonControlDrawParams read GetDrawParams; + end; + + TdxBarCustomEditControl = class(TdxBarWinControl) + private + FBkBrush: TBrush; + FEditTextSize: Integer; + FSizingEditWidth: Integer; + FRightBorderSizing: Boolean; + function GetCaptionBkBrush: HBRUSH; + function GetDrawParams: TdxBarEditLikeControlDrawParams; + function GetEditBkBrush: HBRUSH; + function GetEditFont: TFont; + function GetItem: TdxCustomBarEdit; + function LeftSizingRect: TRect; + function RightSizingRect: TRect; + protected + procedure CalcParts; override; + procedure CalcDrawParams(AFull: Boolean = True); override; + procedure CorrectFrameRect(var ARect: TRect); virtual; + procedure DoCalcDrawingConsts; override; + procedure DoPaint(ARect: TRect; PaintType: TdxBarPaintType); override; + procedure DrawFrame; virtual; + procedure DrawTextField; virtual; abstract; + procedure DrawEditSizingFrame(AWidth: Integer); + function DrawSelected: Boolean; override; + function GetDefaultViewStructure: TdxBarItemControlViewStructure; override; + function GetDrawParamsClass: TdxBarItemControlDrawParamsClass; override; + function GetPartCount: Integer; override; + function GetPossibleViewLevels: TdxBarItemViewLevels; override; + + function GetCaptionAreaWidth: Integer; override; + function GetControlAreaWidth: Integer; override; + function GetGlyphAreaWidth: Integer; override; + + function GetDefaultHeight: Integer; override; + function GetDefaultWidth: Integer; override; + function GetEditOffset: Integer; + function GetEditRect: TRect; virtual; + function GetEditTextSize: Integer; // TODO property + function GetIndents(ADrawAreaType: TdxBarItemControlPart): TRect; override; + function GetMinEditorWidth: Integer; virtual; abstract; + function GetMinWidth: Integer; override; + function GetShowCaption: Boolean; virtual; + procedure InitEdit; virtual; abstract; + procedure Show; override; + + procedure BeginResize(APoint: TPoint); override; + function CanResize(APoint: TPoint): Boolean; override; + procedure EndResize(AAllowResize: Boolean); override; + procedure Resizing(APoint: TPoint); override; + + function HotPartWantMouse: Boolean; override; + procedure RefreshBkBrush(var AHandle: HBRUSH); virtual; + + property CaptionBkBrush: HBRUSH read GetCaptionBkBrush; + property DrawParams: TdxBarEditLikeControlDrawParams read GetDrawParams; + property EditBkBrush: HBRUSH read GetEditBkBrush; + property EditFont: TFont read GetEditFont; + property ShowCaption: Boolean read GetShowCaption; + public + destructor Destroy; override; + property Item: TdxCustomBarEdit read GetItem; + end; + + TdxBarEditControl = class(TdxBarCustomEditControl) + private + FHandle: HWND; + procedure CreateWindowHandle; + procedure DestroyWindowHandle(ADestroyWindow: Boolean = True); + function GetItem: TdxBarEdit; + function GetMaxLength: Integer; + function GetReadOnly: Boolean; + protected + function CanDrawEditor: Boolean; virtual; + procedure ControlClick(AByMouse: Boolean; AKey: Char = #0); override; + + procedure CreateInnerEdit; override; + procedure DestroyInnerEdit(AFullDestroy: Boolean = True); override; + procedure DrawTextField; override; + function GetHandle: HWND; override; + function GetMinEditorWidth: Integer; override; + function GetNonBufferedRect: TRect; override; + procedure Hide(AStoreDisplayValue: Boolean); override; + procedure InitEdit; override; + function IsTransparentOnGlass: Boolean; override; + procedure PrepareEditWnd; override; + procedure SetFocused(Value: Boolean); override; + procedure SetText(Value: string); override; + procedure Show; override; + + procedure WndProc(var Message: TMessage); override; + + property MaxLength: Integer read GetMaxLength; + property ReadOnly: Boolean read GetReadOnly; + public + constructor Create(AItemLink: TdxBarItemLink); override; + destructor Destroy; override; + + property Item: TdxBarEdit read GetItem; + end; + + TCustomdxBarComboControl = class(TdxBarEditControl) + private + FOnPressDroppedDown: Boolean; + FDroppedDown: Boolean; + + function GetDropDownWindow: HWND; + function GetItem: TCustomdxBarCombo; + protected + procedure CalcDrawParams(AFull: Boolean = True); override; + procedure CalcParts; override; + function CanDrawEditor: Boolean; override; + procedure ControlInactivate(Immediately: Boolean); override; + procedure CorrectFrameRect(var ARect: TRect); override; + procedure DrawTextField; override; + procedure EnabledChanged; override; + function GetPartCount: Integer; override; + function IsChildWindow(AWnd: HWND): Boolean; override; + procedure SetDroppedDown(Value: Boolean); virtual; + procedure SysKeyDown(var Key: Word; Shift: TShiftState); override; + procedure SysKeyUp(var Key: Word; Shift: TShiftState); override; + procedure WndProc(var Message: TMessage); override; + + property DropDownWindow: HWND read GetDropDownWindow; + public + destructor Destroy; override; + function IsDroppedDown: Boolean; override; + property DroppedDown: Boolean read FDroppedDown write SetDroppedDown; + property Item: TCustomdxBarCombo read GetItem; + end; + + TdxBarComboControl = class(TCustomdxBarComboControl) + private + FLocalItemIndex: Integer; + function GetItem: TdxBarCustomCombo; + function GetItemIndex: Integer; + function GetItems: TStrings; + function GetSorted: Boolean; + procedure SetLocalItemIndex(Value: Integer); + protected + procedure RestoreDisplayValue; override; + procedure SetFocused(Value: Boolean); override; + procedure WndProc(var Message: TMessage); override; + + property ItemIndex: Integer read GetItemIndex; + property Items: TStrings read GetItems; + property Sorted: Boolean read GetSorted; + public + property Item: TdxBarCustomCombo read GetItem; + property LocalItemIndex: Integer read FLocalItemIndex write SetLocalItemIndex; + end; + + TdxBarSubItemControl = class(TdxBarButtonLikeControl) + private + function GetCaptionOffset: Integer; + function GetItem: TCustomdxBarSubItem; + protected + function GetSubMenuControl: TdxBarSubMenuControl; override; + procedure CalcDrawParams(AFull: Boolean = True); override; + function CanActivate: Boolean; override; + function CanClicked: Boolean; override; + procedure ControlActivate(Immediately: Boolean); override; + procedure ControlInactivate(Immediately: Boolean); override; + procedure ControlClick(AByMouse: Boolean; AKey: Char = #0); override; + procedure CreateSubMenuControl; virtual; + procedure DoCreateSubMenuControl; + procedure DoCloseUp(AHadSubMenuControl: Boolean); override; + procedure DoDropDown(AByMouse: Boolean); override; + procedure DropDown(AByMouse: Boolean); override; + procedure GetSubMenuControlPositionParams(out P: TPoint; + out AOwnerWidth, AOwnerHeight: Integer); virtual; + function IsFlatText: Boolean; override; + function IsTextSelected: Boolean; override; + procedure ShowSubMenuControl; + + function GetCaptionAreaWidth: Integer; override; + function GetControlCaptionOffset: Integer; override; + + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; override; + function GetOwnedBarControl: TCustomdxBarControl; override; + function HasSubMenu: Boolean; virtual; + function IsDestroyOnClick: Boolean; override; + function IsDropDown: Boolean; override; + function IsExpandable: Boolean; override; + function IsMenuItem: Boolean; override; + function IsPressed: Boolean; + + function WantsDblClick: Boolean; override; + function WantsKey(Key: Word): Boolean; override; + + function GetPossibleViewLevels: TdxBarItemViewLevels; override; + function GetDefaultViewStructure: TdxBarItemControlViewStructure; override; + + property CaptionOffset: Integer read GetCaptionOffset; + public + destructor Destroy; override; + function IsDroppedDown: Boolean; override; + property Item: TCustomdxBarSubItem read GetItem; + end; + + TdxBarContainerItemControl = class(TdxBarSubItemControl) + private + function GetItem: TCustomdxBarContainerItem; + protected + procedure CreateSubMenuControl; override; + procedure DoPaint(ARect: TRect; PaintType: TdxBarPaintType); override; + function DrawSelected: Boolean; override; + function GetCaption: string; override; + function IsExpandable: Boolean; override; + function ShowRealCaption: Boolean; + public + property Item: TCustomdxBarContainerItem read GetItem; + end; + + {-------------------------------------- + Item's painters + --------------------------------------} + TdxBarPainter = class + private + procedure InternalCalculateComboParts(const ADrawParams: TdxBarEditLikeControlDrawParams; var AParts: array of TRect); + protected + // New + procedure DrawToolbarContentPart(ABarControl: TdxBarControl; ACanvas: TcxCanvas); virtual; + procedure DrawToolbarNonContentPart(ABarControl: TdxBarControl; DC: HDC); virtual; + function GetToolbarCaptionRect(const ARect: TRect): TRect; virtual; + class function IsCompoundPainting: Boolean; virtual; + // Common + function AllowLargeIcons: Boolean; virtual; + procedure CorrectCaptionParams(const ADrawParams: TdxBarButtonLikeControlDrawParams; + var ATextBounds: TRect; const AImageBounds: TRect; out ATextAlignment: DWORD); virtual; + procedure DrawGlyphBorder(ABarItemControl: TdxBarItemControl; DC: HDC; ABrush: HBRUSH; + NeedBorder: Boolean; R: TRect; PaintType: TdxBarPaintType; IsGlyphEmpty, + Selected, Down, DrawDowned, ADroppedDown, IsSplit: Boolean); virtual; + procedure DrawGlyphCheckMark(ABarItemControl: TdxBarItemControl; DC: HDC; + X, Y, DoubleSize: Integer); virtual; + procedure DrawGlyphEmptyImage(ABarItemControl: TdxBarItemControl; DC: HDC; R: TRect; + APaintType: TdxBarPaintType; ADown: Boolean); virtual; + class procedure DrawItemArrow(DC: HDC; R: TRect; ArrowType: TcxArrowDirection; + Enabled, Selected, Flat: Boolean; AColor: TColor = clDefault); virtual; + procedure DrawLargeItemArrow(DC: HDC; R: TRect; ArrowType: TcxArrowDirection; + Size: Integer; Selected, Enabled, Flat: Boolean; AColor: TColor = clDefault); virtual; + class procedure FrameFlatSelRect(DC: HDC; const R: TRect); virtual; + + function GetDefaultEnabledTextColor(ABarItemControl: TdxBarItemControl; + ASelected, AFlat: Boolean): TColor; virtual; + procedure GetDisabledTextColors(ABarItemControl: TdxBarItemControl; + ASelected, AFlat: Boolean; var AColor1, AColor2: TColor); virtual; + function GetEnabledTextColor(ABarItemControl: TdxBarItemControl; + ASelected, AFlat: Boolean): TColor; virtual; + function GetItemArrowColor(const ADrawParams: TdxBarButtonLikeControlDrawParams): TColor; virtual; + + class function GetFaded(ABarControl: TCustomdxBarControl): Boolean; virtual; + class function IgnoreGlyphOpaque: Boolean; virtual; + class function IgnoreNonRecentColor: Boolean; virtual; + class function IsMenuItem(ABarItemControl: TdxBarItemControl): Boolean; virtual; + class function UseTextColorForItemArrow: Boolean; virtual; + + // Hints + class function GetBarItemContolHintPosition(ABarControl: TCustomdxBarControl; + const AItemBounds: TRect; const ACursorPos: TPoint; AHeight: Integer): TPoint; virtual; + function CreateHintViewInfo(ABarManager: TdxBarManager; AHintText: string; const AShortCut: string; + AScreenTip: TdxBarScreenTip): TdxBarCustomHintViewInfo; virtual; + // Bar + class function BarIsBarSmall(ABarControl: TdxBarControl; const R: TRect): Boolean; virtual; + class function BarCaptionBkColor(ABarControl: TdxBarControl; AMainFormActive: Boolean): COLORREF; virtual; + function BarCaptionColor(ABarControl: TdxBarControl): COLORREF; virtual; + class function BarMarkArrowColor(ABarControl: TdxBarControl; AState: TdxBarMarkState): COLORREF; virtual; + procedure BarDrawGrip(ABarControl: TdxBarControl; DC: HDC; R: TRect; + AToolbarBrush: HBRUSH); virtual; + + // Mark + procedure BarDrawMarkArrow(ABarControl: TdxBarControl; DC: HDC; MarkR: TRect); virtual; + class procedure BarDrawMarkAtPos(ABarControl: TdxBarControl; DC: HDC; + const ItemRect: TRect; Offset: Integer); virtual; + procedure BarDrawMarkBackground(ABarControl: TdxBarControl; DC: HDC; + ItemRect: TRect; AToolbarBrush: HBRUSH); virtual; + procedure BarDrawMarkElements(ABarControl: TdxBarControl; DC: HDC; + ItemRect: TRect); virtual; + + class procedure BarOffsetFloatingBarCaption(ABarControl: TdxBarControl; + var X: Integer; var R: TRect); virtual; + class function GetDrawMarkElementColor(ABarControl: TdxBarControl): Integer; virtual; + // ButtonLikeControl + procedure ButtonLikeControlDoDrawCaption(const ADrawParams: TdxBarButtonLikeControlDrawParams; + const ATextBounds: TRect; ATextAlignment: DWORD; AFormat: DWORD = 0); virtual; + class function GetControlTextIndents: TRect; virtual; + class function GetControlCaptionRect(const ADrawParams: TdxBarItemControlDrawParams): TRect; virtual; + procedure InflateSizeForArrow(const ADrawParams: TdxBarButtonLikeControlDrawParams; var ASize: Integer); virtual; + // ColorCombo + // Sizes + function GetDotSpaceAfter(ADotWidth: Integer): Integer; virtual; + function GetCustomColorButtonBounds(const ADrawParams: TdxBarColorComboControlDrawParams; ARect: TRect): TRect; virtual; + function GetCustomColorButtonWidth(APaintType: TdxBarPaintType; const ARect: TRect): Integer; virtual; + // Draw + procedure DrawDot(const ADrawParams: TdxBarEditLikeControlDrawParams; ARect: TRect); virtual; + procedure DrawDots(const ADrawParams: TdxBarEditLikeControlDrawParams; ARect: TRect); virtual; + + // ComboControl + class procedure ComboControlDrawArrow(const ADrawParams: TdxBarEditLikeControlDrawParams; const ARect: TRect; ASize: Integer; AColor: TColor); virtual; + + // SubMenuControl + procedure SubMenuControlFillScrollArrow(ACanvas: TcxCanvas; ARect: TRect; AColor: TColor); virtual; + procedure SubMenuControlDrawScrollArrow(ABarSubMenuControl: TdxBarSubMenuControl; ACanvas: TcxCanvas; const AArrowRect: TRect; + AColor: COLORREF; AArrowDirection: TcxArrowDirection); virtual; + procedure SubMenuControlDrawScrollBand(ABarSubMenuControl: TdxBarSubMenuControl; ACanvas: TcxCanvas; AArrowDirection: TcxArrowDirection); virtual; + procedure SubMenuControlDrawScrollBandBackground(ABarSubMenuControl: TdxBarSubMenuControl; ACanvas: TcxCanvas; AArrowDirection: TcxArrowDirection); virtual; + procedure SubMenuControlDrawNonRecentGroupSeparator(ABarSubMenuControl: TdxBarSubMenuControl; ACanvas: TcxCanvas; AArrowDirection: TcxArrowDirection); virtual; + function SubMenuControlGetScrollBandBounds(ABarSubMenuControl: TdxBarSubMenuControl; AArrowDirection: TcxArrowDirection): TRect; virtual; + function SubMenuControlGetScrollBandSize(ABarSubMenuControl: TdxBarSubMenuControl): Integer; virtual; + class function SubMenuControlGetScrollArrowSize(ATextSize: Integer): Integer; virtual; + procedure SubMenuControlDrawMarkContent(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect; ASelected: Boolean); virtual; + procedure SubMenuControlDrawMarkBand(ABarSubMenuControl: TdxBarSubMenuControl; const AMarkRect: TRect; ASelected: Boolean); virtual; + procedure SubMenuControlDrawMarkSelection(ABarSubMenuControl: TdxBarSubMenuControl; ADC: HDC; const AMarkRect: TRect); virtual; + class function SubMenuControlUseScrollButtons: Boolean; virtual; + // Edit + class procedure EditOffsetInteriorRect(ABarEditControl: TdxBarCustomEditControl; var R: TRect); virtual; + // SpinEditControl + procedure DrawSpinEditArrow(const ADrawParams: TdxBarSpinEditDrawParams; AArrowPos: TPoint; AButtonIndex: Integer); virtual; + class procedure SpinEditControlDrawArrowByPoints(const ADrawParams: TdxBarSpinEditDrawParams; + AStartPoint: TPoint; AColorIndex: Integer; AButtonIndex: Integer); + // DateNavigator + class procedure DateNavigatorDrawButtonCaption(DC: HDC; const R: TRect; AOffset: Integer; + const ACaption: string; AOpaque: Boolean); virtual; + public + constructor Create(AData: Integer); virtual; + + // New + procedure CalculateButtonParts(const ADrawParams: TdxBarButtonLikeControlDrawParams; + var AParts: array of TRect; const AItemRect: TRect); virtual; + procedure CalculateColorComboParts(const ADrawParams: TdxBarColorComboControlDrawParams; + var AParts: array of TRect; const AItemRect: TRect); virtual; + procedure CalculateComboParts(const ADrawParams: TdxBarEditLikeControlDrawParams; + var AParts: array of TRect; const AItemRect: TRect); virtual; + procedure CalculateEditParts(const ADrawParams: TdxBarEditLikeControlDrawParams; + var AParts: array of TRect; const AItemRect: TRect); virtual; + procedure CalculateSpinEditParts(const ADrawParams: TdxBarSpinEditDrawParams; + var AParts: array of TRect; const AItemRect: TRect); virtual; + + // Common + class procedure CalculateArrowPoints(const ARect: TRect; AArrowSize: Integer; AArrowDirection: TcxArrowDirection; out P: TcxArrowPoints); + class function GetArrowRectByPoints(const P: TcxArrowPoints; AArrowDirection: TcxArrowDirection): TRect; + procedure GetTextColors(ABarItemControl: TdxBarItemControl; AEnabled, + ASelected, AFlat: Boolean; var AColor1, AColor2: TColor); virtual; + class procedure SetArrowRegion(ACanvas: TcxCanvas; AArrowDirection: TcxArrowDirection; + P: TcxArrowPoints; AOperation: TcxRegionOperation); + + // Sizes + function GetToolbarContentOffsets(ABar: TdxBar; + ADockingStyle: TdxBarDockingStyle; AHasSizeGrip: Boolean): TRect; virtual; + function GetToolbarsOffsetForAutoAlign: Integer; virtual; + function GetBorderSize: Integer; virtual; + function GetIconAreaSize(ABarControl: TCustomdxBarControl): Integer; virtual; + class function GetControlCaptionOffset(ABarItemControl: TdxBarItemControl): Integer; virtual; + class function GetDefaultTextSize(ACanvas: TcxCanvas): Integer; virtual; + class function GetPopupWindowBorderWidth: Integer; virtual; + + procedure GetImageParams(AItemControl: TdxBarItemControl; + const ADrawRect: TRect; APaintType: TdxBarPaintType; + AViewStructure: TdxBarItemControlViewStructure; + AViewSize: TdxBarItemControlViewSize; ACenter, ASelected, ADowned, ADrawDowned: Boolean; + var AGlyphEmpty: Boolean; out ACurrentGlyph: TBitmap; out ACurrentImages: TCustomImageList; + out ACurrentImageIndex: Integer; out AImageBounds: TRect); + function GetLargeImageBounds(AItemControl: TdxBarItemControl; + const AImageSize: TSize; const ADrawRect: TRect; APaintType: TdxBarPaintType; + AViewStructure: TdxBarItemControlViewStructure; AGlyphLayout: TdxBarGlyphLayout): TRect; virtual; + class function GetSmallImageBounds(AItemControl: TdxBarItemControl; + const AImageSize: TSize; const ADrawRect: TRect; APaintType: TdxBarPaintType; + AViewStructure: TdxBarItemControlViewStructure; + ACenter, AGlyphEmpty, AStretchGlyph, ADowned, ADrawDowned: Boolean): TRect; + + class procedure DrawBackground(ABarItemControl: TdxBarItemControl; DC: HDC; + const R: TRect; ABrush: HBRUSH; AOpaque: Boolean); virtual; + class procedure DrawBackgroundFrameRect(ABarItemControl: TdxBarItemControl; + DC: HDC; R: TRect; ABrush: HBRUSH; AOpaque: Boolean); virtual; + class procedure DrawDisabledShadowRect(ABarItemControl: TdxBarItemControl; DC: HDC; + R: TRect); virtual; + procedure DrawItemBackground(ABarItemControl: TdxBarItemControl; + ACanvas: TcxCanvas; const ASourceRect: TRect; ABrush: HBRUSH); virtual; + procedure DrawGlyph(ABarItemControl: TdxBarItemControl; ADC: HDC; + ADrawRect: TRect; const AFullBounds: TRect; APaintType: TdxBarPaintType; + AGlyphEmpty, ASelected, ADowned, ADrawDowned, ADroppedDown, ACenter, AForceUseBkBrush, AIsSplit: Boolean); overload; + procedure DrawGlyph(ABarItemControl: TdxBarItemControl; ADC: HDC; + ADrawRect: TRect; const AFullBounds: TRect; out AImageBounds: TRect; + APaintType: TdxBarPaintType; AViewStructure: TdxBarItemControlViewStructure; + AViewSize: TdxBarItemControlViewSize; AGlyphEmpty, ASelected, ADowned, + ADrawDowned, ADroppedDown, ACenter, AForceUseBkBrush, AGrayScale, AIsSplit: Boolean); overload; virtual; + procedure DrawGlyphAndBkgnd(ABarItemControl: TdxBarItemControl; ADC: HDC; + const R, AGlyphRect: TRect; APaintType: TdxBarPaintType; AGlyph: TBitmap; + AImages: TCustomImageList; AImageIndex: Integer; AGlyphEmpty, ASelected, ADowned, + ADrawDowned, ADroppedDown, AForceUseBkBrush, AGrayScale, AIsSplit: Boolean); virtual; + procedure DrawGlyphAndTextInSubMenu(const ADrawParams: TdxBarButtonLikeControlDrawParams; const R: TRect); + procedure DrawItemBackgroundInSubMenu(const ADrawParams: TdxBarButtonLikeControlDrawParams; R: TRect); virtual; + procedure DrawItemMultilineText(const ADrawParams: TdxBarItemControlDrawParams; + const AText: string; const ATextRect: TRect; AAlignment: UINT; AMaxLineCount: Integer); + procedure DrawItemText(ABarItemControl: TdxBarItemControl; ADC: HDC; + S: string; APaintRect: TRect; AAlignment: UINT; AEnabled, ASelected, ARotated, + AClipped, AFlatText: Boolean; AFormat: UINT = DT_SINGLELINE); virtual; + procedure DrawItemTextInSubMenu(const ADrawParams: TdxBarButtonLikeControlDrawParams; R: TRect); + class procedure DrawLowered(DC: HDC; var R: TRect); virtual; + class procedure FrameAndFillRect(ABarItemControl: TdxBarItemControl; DC: HDC; + var R: TRect; Enabled, Selected, Pressed: Boolean); virtual; + class function GetCaptionOffsets: TRect; virtual; + class function GlyphBkgndBrush(ABarItemControl: TdxBarItemControl; + APaintType: TdxBarPaintType; AGlyphEmpty, ASelected, ADowned, ADrawDowned, ADroppedDown, + AForceUseBkBrush, AGrayScale: Boolean): HBRUSH; virtual; + class function GlyphDownShift(ABarItemControl: TdxBarItemControl): Integer; virtual; + class function GlyphDrawDownedShift(ABarItemControl: TdxBarItemControl; ADown: Boolean): Integer; virtual; + class function IsFlatGlyphImage: Boolean; virtual; + class function IsFlatItemText: Boolean; virtual; + class function IsFlatItemTextForMenu: Boolean; virtual; + function IsCustomSelectedTextColorExists(ABarItemControl: TdxBarItemControl): Boolean; virtual; + class function IsGlyphImageBackgroundOpaque(ABarItemControl: TdxBarItemControl; + ADown, ADrawDowned, ASelected, AGlyphEmpty: Boolean): Boolean; virtual; + class function IsGlyphImageHasShadow: Boolean; virtual; + class function IsGlyphImageTransparent(ABarItemControl: TdxBarItemControl): Boolean; virtual; + class function IsItemTextSelectedInverted: Boolean; virtual; + class function LoweredBorderSize(ABarItemControl: TdxBarItemControl): Integer; virtual; + class function TextAreaOffset(ABarItemControl: TdxBarItemControl): Integer; virtual; + // BarManager + function BarFingersSize(ABar: TdxBar): Integer; + function BeforeFingersSize: Integer; virtual; + class function BorderSizeX: Integer; virtual; + class function BorderSizeY: Integer; virtual; + class function EmptyFingersSize: Integer; virtual; + function FingersSize(ABarControl: TdxBarControl): Integer; virtual; + function GripperSize(ABarControl: TdxBarControl): Integer; virtual; + class function RealButtonArrowWidth(ABarManager: TdxBarManager): Integer; virtual; + class function RealLargeButtonArrowWidth(ABarManager: TdxBarManager): Integer; virtual; + class function SubMenuBeginGroupIndent: Integer; virtual; + // DockControl + procedure DockControlFillBackground(ADockControl: TdxDockControl; + DC: HDC; ADestR, ASourceR, AWholeR: TRect; ABrush: HBRUSH; AColor: TColor); virtual; + class function IsNativeBackground: Boolean; virtual; + // CustomBar + class function BarChildrenHaveShadows(ABarControl: TCustomdxBarControl): Boolean; virtual; + function BarHasShadow(ABarControl: TCustomdxBarControl): Boolean; virtual; + function BarLinkedOwnerHasShadow(ABarControl: TCustomdxBarControl): Boolean; virtual; + class function BarControlOwnerBrush(ABarManager: TdxBarManager): HBRUSH; virtual; + class function BarDockedGetRowIndent: Integer; virtual; + procedure BarDrawDockedBackground(ABarControl: TdxBarControl; DC: HDC; + ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); virtual; + procedure BarDrawFloatingBackground(ABarControl: TCustomdxBarControl; DC: HDC; + ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); virtual; + class procedure BarDrawOwnerLink(ABarControl: TCustomdxBarControl; DC: HDC); virtual; + procedure BarFillParentBackground(ABarControl: TCustomdxBarControl; DC: HDC; + const ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); + class function BarToolbarBrush(ABarControl: TCustomdxBarControl): HBRUSH; virtual; + class function BarToolbarBrushEx(ABarControl: TdxBarControl): HBRUSH; virtual; + class function BarToolbarDownedBrush(ABarControl: TCustomdxBarControl): HBRUSH; virtual; + class function BarToolbarDownedSelBrush(ABarControl: TCustomdxBarControl): HBRUSH; virtual; + class function BarToolbarSelBrush(ABarControl: TCustomdxBarControl): HBRUSH; virtual; + function ComboBoxArrowWidth(ABarControl: TCustomdxBarControl; cX: Integer): Integer; virtual; + class function EditTextSize(ABarControl: TCustomdxBarControl; cY: Integer): Integer; virtual; + class procedure GetEditTextParams(out AOffsets: TRect; out AHeightCorrection: Integer); + class procedure GetEditTextVerticalOffsets(out ATop, ABottom: Integer); virtual; + class procedure SetWindowRgn(AHandle: THandle; const AWindowRect: TRect; ARedraw: Boolean = False); virtual; + // Bar + class function BarAllowHotTrack: Boolean; virtual; + class function BarAllowQuickCustomizing: Boolean; virtual; + function BarBeginGroupSideSize: Integer; virtual; + function BarBeginGroupSize: Integer; virtual; + procedure BarBorderPaintSizes(ABarControl: TdxBarControl; var R: TRect); virtual; + class function BarBorderSize: Integer; virtual; + procedure BarBorderSizes(ABar: TdxBar; AStyle: TdxBarDockingStyle; var R: TRect); virtual; + class function BarCaptionAreaSize: Integer; virtual; + procedure BarCaptionFillBackground(ABarControl: TdxBarControl; DC: HDC; + R: TRect; AToolbarBrush: HBRUSH); virtual; + class function BarCaptionSize: Integer; virtual; + class function BarCaptionTransparent: Boolean; virtual; + class function BarCloseButtonSize: TSize; virtual; + procedure BarDrawBackground(ABarControl: TdxBarControl; ADC: HDC; + const ADestRect, ASourceRect: TRect; ABrush: HBRUSH; AColor: TColor); virtual; + procedure BarDrawBeginGroup(ABarControl: TCustomdxBarControl; DC: HDC; + ABeginGroupRect: TRect; AToolbarBrush: HBRUSH; AHorz: Boolean); virtual; + class procedure BarDrawCaptionElement(ABarControl: TdxBarControl; DC: HDC; + R: TRect; AState: TdxBarMarkState); virtual; + procedure BarDrawCloseButton(ABarControl: TdxBarControl; DC: HDC; R: TRect); virtual; + procedure BarDrawDockedBarBorder(ABarControl: TdxBarControl; DC: HDC; R: TRect; + AToolbarBrush: HBRUSH); virtual; + procedure BarDrawFloatingBarBorder(ABarControl: TdxBarControl; DC: HDC; + R, CR: TRect; AToolbarBrush: HBRUSH); virtual; + procedure BarDrawFloatingBarCaption(ABarControl: TdxBarControl; DC: HDC; + R, CR: TRect; AToolbarBrush: HBRUSH); virtual; + procedure BarDrawMark(ABarControl: TdxBarControl; DC: HDC; MarkR: TRect); virtual; + procedure BarDrawMarks(ABarControl: TdxBarControl; ACanvas: TcxCanvas; + const AItemRect: TRect; AToolbarBrush: HBRUSH); virtual; + procedure BarDrawMDIButton(ABarControl: TdxBarControl; AButton: TdxBarMDIButton; + AState: Integer; DC: HDC; R: TRect); virtual; + procedure BarDrawStatusBarGrip(ABarControl: TdxBarControl; DC: HDC; + const R: TRect; AToolbarBrush: HBRUSH); virtual; + procedure BarDrawStatusBarBorder(ABarControl: TdxBarControl; DC: HDC; + R: TRect; AToolbarBrush: HBRUSH); virtual; + class function BarHorSize: Integer; virtual; + function BarMarkRect(ABarControl: TdxBarControl): TRect; virtual; + function BarMarkItemRect(ABarControl: TdxBarControl): TRect; virtual; + procedure BarMarkRectInvalidate(ABarControl: TdxBarControl); virtual; + class function BarTopSize: Integer; virtual; + class function BarBottomSize: Integer; virtual; + class function BarUseSystemClose: Boolean; virtual; + class function BarUseSystemNCBorder: Boolean; virtual; + function MarkSizeX(ABarControl: TdxBarControl): Integer; virtual; + procedure StatusBarFillBackground(ABarControl: TdxBarControl; DC: HDC; + ADestR, ASourceR, AWholeR: TRect; ABrush: HBRUSH; AColor: TColor); virtual; + function StatusBarBorderOffsets: TRect; virtual; + class function StatusBarTopBorderSize: Integer; virtual; + function StatusBarGripSize(ABarManager: TdxBarManager): TSize; virtual; + // QuickCustItem + class function BarToolbarBrushEx2(ABarControl: TdxBarControl): HBRUSH; virtual; + class procedure DrawQuickCustItemFrame(ABarItemControl: TdxBarItemControl; + DC: HDC; var R, ARect: TRect; Selected: Boolean); virtual; + class procedure DrawQuickCustItemFrameSelected(ABarItemControl: TdxBarItemControl; + DC: HDC; WholeR, R: TRect; Selected: Boolean); virtual; + class function IsQuickControlPopupOnRight: Boolean; virtual; + + // BarItemControl + // Sizes + class function GetTailAreaSize(const ADrawParams: TdxBarItemControlDrawParams): Integer; virtual; + class function ItemControlGetIndents(const ADrawParams: TdxBarItemControlDrawParams; + ADrawAreaType: TdxBarItemControlPart): TRect; virtual; + + // ButtonControl + // Attributes + function ButtonControlArrowBrush(const ADrawParams: TdxBarItemControlDrawParams): HBRUSH; virtual; + // Conditions + function IsButtonControlArrowBackgroundOpaque(const ADrawParams: TdxBarButtonLikeControlDrawParams): Boolean; virtual; + function IsButtonControlArrowDrawSelected(const ADrawParams: TdxBarButtonLikeControlDrawParams): Boolean; virtual; + function IsButtonControlArrowFlat: Boolean; virtual; + function IsDropDownRepaintNeeded: Boolean; virtual; + // Sizes + function GetButtonBorderHeight: Integer; virtual; + function GetButtonBorderWidth: Integer; virtual; + function GetButtonHeight(AIconSize, ATextSize: Integer): Integer; virtual; + function GetButtonWidth(AIconSize, ATextSize: Integer): Integer; virtual; + function GetButtonSize(AIconSize, ATextSize: Integer): TSize; virtual; + class function GetDefaultArrowSignSize: TSize; virtual; + class procedure CorrectButtonControlDefaultHeight(var DefaultHeight: Integer); virtual; + class procedure CorrectButtonControlDefaultWidth(var DefaultWidth: Integer); virtual; + procedure OffsetCaptionBounds(ADowned, ADrawDowned: Boolean; var R: TRect); virtual; + class procedure OffsetEllipsisBounds(APressed: Boolean; var R: TRect); virtual; + // Draw + procedure DrawButtonLikeControl(const ADrawParams: TdxBarButtonLikeControlDrawParams; ARect: TRect); virtual; + procedure DrawButtonLikeControlCaption(const ADrawParams: TdxBarButtonLikeControlDrawParams; const ARect, AImageBounds: TRect); virtual; + procedure DrawButtonControlArrow(const ADrawParams: TdxBarButtonLikeControlDrawParams; + R1: TRect); virtual; + procedure DrawButtonControlArrowBackground(const ADrawParams: TdxBarButtonLikeControlDrawParams; + var R1: TRect; ABrush: HBRUSH); virtual; + procedure DrawSplitControlArrow(const ADrawParams: TdxBarButtonLikeControlDrawParams; ARect: TRect); virtual; + procedure DrawAssociateControlArrow(const ADrawParams: TdxBarButtonLikeControlDrawParams; ARect: TRect); virtual; + + // ComboControl + // Attributes + function ComboControlArrowColor(ADrawParams: TdxBarItemControlDrawParams): TColor; virtual; + function ComboControlButtonBrush(const ADrawParams: TdxBarItemControlDrawParams): HBRUSH; virtual; + // Sizes + class function ComboControlArrowOffset: Integer; virtual; + class function ComboControlButtonOffsets(APaintType: TdxBarPaintType): TRect; virtual; + // Draw + procedure ComboControlDrawArrowButton(const ADrawParams: TdxBarEditLikeControlDrawParams; ARect: TRect; AInClientArea: Boolean); virtual; + class procedure ComboControlDrawSimpleButton(const ADrawParams: TdxBarEditLikeControlDrawParams; var ARect: TRect; ABrush: HBRUSH); virtual; + + // DropDownListBox + class function DropDownListBoxBorderSize: Integer; virtual; + procedure DropDownListBoxDrawBorder(DC: HDC; AColor: TColor; ARect: TRect); virtual; + // SubMenuControl + // Conditions + class function SubMenuControlHasBand: Boolean; virtual; + class function SubMenuControlIsOffsetRecentGroupNeeded: Boolean; virtual; + // Sizes + class function SubMenuControlArrowsOffset: Integer; virtual; + class function SubMenuControlArrowWidth(ATextSize: Integer): Integer; virtual; + function SubMenuControlBeginGroupSize: Integer; virtual; + class function SubMenuControlBorderSize: Integer; virtual; + class function SubMenuControlNCBorderSize: Integer; virtual; + class function SubMenuControlClientBorderSize: Integer; virtual; + procedure SubMenuControlCalcDrawingConsts(ACanvas: TcxCanvas; + ATextSize: Integer; out AMenuArrowWidth, AMarkSize: Integer); virtual; + class function SubMenuControlContentRectOffset(ABarSubMenuControl: TdxBarSubMenuControl): TRect; virtual; + class function SubMenuControlDetachCaptionAreaSize(ABarSubMenuControl: TdxBarSubMenuControl): Integer; virtual; + class function SubMenuControlGetBandSize(ABarSubMenuControl: TdxBarSubMenuControl): Integer; virtual; + class function SubMenuControlGetControlContentIndent(ABarSubMenuControl: TdxBarSubMenuControl): Integer; virtual; + class function SubMenuControlInternalBorderSize: Integer; virtual; + class function SubMenuControlInternalBorderOffset: Integer; virtual; + class function SubMenuControlMarkArrowSize(AMarkSize: Integer): Integer; virtual; + class function SubMenuControlNormalItemHeight: Integer; virtual; + // Positions + class function SubMenuControlGetItemIconRect(const AItemRect: TRect; AIconAreaSize: Integer): TRect; virtual; + class function SubMenuControlGetItemTextRect(const ADrawParams: TdxBarButtonLikeControlDrawParams; const AItemRect: TRect): TRect; virtual; + class function SubMenuControlGetItemTextIndent(const ADrawParams: TdxBarItemControlDrawParams): Integer; virtual; + function SubMenuControlBeginGroupRect( + ABarSubMenuControl: TdxBarSubMenuControl; AControl: TdxBarItemControl; + const AItemRect: TRect): TRect; virtual; + class procedure SubMenuControlOffsetDetachCaptionRect(ABarSubMenuControl: TdxBarSubMenuControl; + var R: TRect); virtual; + // Draw + procedure SubMenuControlDrawScrollButton(ABarSubMenuControl: TdxBarSubMenuControl; ACanvas: TcxCanvas; AArrowDirection: TcxArrowDirection); virtual; + procedure SubMenuControlDrawBackground(ABarSubMenuControl: TdxBarSubMenuControl; + ACanvas: TcxCanvas; ARect: TRect; ABrush: HBRUSH; AColor: TColor); virtual; + procedure SubMenuControlDrawBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); virtual; + procedure SubMenuControlDrawClientBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; const R: TRect; ABrush: HBRUSH); virtual; + procedure SubMenuControlDrawDetachCaption(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); virtual; + procedure SubMenuControlDrawBeginGroup(ABarSubMenuControl: TdxBarSubMenuControl; + AControl: TdxBarItemControl; ACanvas: TcxCanvas; const ABeginGroupRect: TRect); virtual; + class procedure SubMenuControlDrawItemFrame(ABarSubMenuControl: TdxBarSubMenuControl; + AControl: TdxBarItemControl; DC: HDC; AItemRect: TRect; AIndex: Integer); virtual; + procedure SubMenuControlDrawSeparator(ACanvas: TcxCanvas; const ARect: TRect); virtual; + class procedure SubMenuControlPrepareBkBrush(ABarSubMenuControl: TdxBarSubMenuControl; + var ABkBrush: HBRUSH); virtual; + class function SubMenuControlTextSize(ACanvas: TcxCanvas): Integer; virtual; + class function SubMenuControlToolbarItemsBrush(ABarSubMenuControl: TdxBarSubMenuControl): HBRUSH; virtual; + // ApplicationMenu + procedure ApplicationMenuDrawBorder(ABarSubMenuControl: TdxBarSubMenuControl; DC: HDC; const ARect: TRect); virtual; + procedure ApplicationMenuDrawButton(const ADrawParams: TdxBarApplicationMenuButtonControlDrawParams; var R: TRect); virtual; + procedure ApplicationMenuDrawContentArea(ABarSubMenuControl: TdxBarSubMenuControl; + ACanvas: TcxCanvas; const AContentRect, AItemsArea: TRect); virtual; + function ApplicationMenuGetFrameSizes: TRect; virtual; + // SubMenuExtraControl + procedure ExtraMenuControlDrawBackground(AExtraMenuControl: TCustomdxBarControl; + ACanvas: TcxCanvas; ARect: TRect; ABrush: HBRUSH; AColor: TColor); virtual; + procedure ExtraMenuControlDrawBeginGroup(AExtraMenuControl: TCustomdxBarControl; + ACanvas: TcxCanvas; ABeginGroupRect: TRect; AToolbarBrush: HBRUSH; AHorz: Boolean); virtual; + + // Edit + class procedure EditDrawInterior(ABarEditControl: TdxBarEditControl; + ABarEdit: TdxBarEdit; ACanvas: TCanvas; R: TRect; ItemLink: TdxBarItemLink); virtual; + procedure EditGetRealLookAndFeel(ABarManager: TdxBarManager; ALookAndFeel: TcxLookAndFeel); virtual; + function EditGetEnabledBkColor(ABarItemControl: TdxBarCustomEditControl): COLORREF; virtual; + function EditGetDisabledBkColor(ABarItemControl: TdxBarCustomEditControl): COLORREF; virtual; + function EditGetBkColor(const ADrawParams: TdxBarEditLikeControlDrawParams): COLORREF; virtual; + function EditGetEnabledTextColor: COLORREF; virtual; + function EditGetDisabledTextColor: COLORREF; virtual; + function EditGetTextColor(ABarItemControl: TdxBarCustomEditControl): COLORREF; virtual; + procedure EditGetColors(ABarItemControl: TdxBarCustomEditControl; + var ATextColor, ABkColor: COLORREF); virtual; + + // EditButton + // Conditions + function EditButtonAllowOffsetContent: Boolean; virtual; + function EditButtonAllowCompositeFrame: Boolean; virtual; + class function EditButtonAllowHotTrack(const ADrawParams: TdxBarItemControlDrawParams): Boolean; virtual; + function EditButtonIsCustomBorder: Boolean; virtual; + function EditButtonIsCustomBackground(AState: Integer): Boolean; virtual; + // Sizes + procedure EditButtonCorrectDefaultWidth(var ADefaultWidth: Integer); virtual; + // Draw + procedure EditButtonDrawBackground(const ADrawParams: TdxBarEditLikeControlDrawParams; AState: Integer; + ARect: TRect; ABrush: HBrush); virtual; + procedure EditButtonDrawBorder(const ADrawParams: TdxBarItemControlDrawParams; + AState: Integer; var ADrawRect: TRect; out AContentRect: TRect); virtual; + + // CustomCombo + class procedure CustomComboDrawItem(ABarCustomCombo: TdxBarCustomCombo; + ACanvas: TCanvas; AIndex: Integer; ARect: TRect; AState: TOwnerDrawState; + AInteriorIsDrawing: Boolean); virtual; + // EditControl + procedure DrawEditLikeControl(const ADrawParams: TdxBarEditLikeControlDrawParams; ARect: TRect); virtual; + class function EditControlBorderOffsets(APaintType: TdxBarPaintType): TRect; virtual; + procedure EditControlDrawBackground(const ADrawParams: TdxBarEditLikeControlDrawParams); virtual; + procedure EditControlDrawBorder(const ADrawParams: TdxBarEditLikeControlDrawParams; var ARect: TRect); virtual; + procedure EditControlDrawCaption(const ADrawParams: TdxBarEditLikeControlDrawParams; const ARect: TRect); virtual; + procedure EditControlDrawSelectionFrame(const ADrawParams: TdxBarEditLikeControlDrawParams; const ARect: TRect); virtual; + procedure EditControlDrawGlyph(const ADrawParams: TdxBarEditLikeControlDrawParams; ARect: TRect); virtual; + class function EditControlCaptionBackgroundIsOpaque(const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; virtual; + class function EditControlCaptionRightIndentIsOpaque(const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; virtual; + procedure EditControlDrawTextField(ABarEditControl: TdxBarEditControl; + ACanvas: TcxCanvas; const ARect: TRect); virtual; + class function EditControlES_Style: Integer; virtual; + function EditControlGetContentRect(APaintType: TdxBarPaintType; const ARect: TRect): TRect; + class function EditControlShowIconDefault(const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; virtual; + // Select EditControl indents + class function EditControlIndents(const ADrawParams: TdxBarEditLikeControlDrawParams; + ADrawAreaType: TdxBarItemControlPart): TRect; virtual; + class function EditControlCaptionLeftIndent(const ADrawParams: TdxBarEditLikeControlDrawParams): Integer; virtual; + class function EditControlCaptionRelativeLeftIndent(const ADrawParams: TdxBarEditLikeControlDrawParams): Integer; virtual; + class function EditControlCaptionAbsoluteLeftIndent(const ADrawParams: TdxBarEditLikeControlDrawParams): Integer; virtual; + class function EditControlCaptionRightIndent: Integer; virtual; + class function EditControlSubMenuGlyphIndents(const ADrawParams: TdxBarEditLikeControlDrawParams): TRect; virtual; + + class function EditControlGetRightCaptionIndentBrush(ABarEditControl: TdxBarCustomEditControl): HBRUSH; virtual; + class function EditControlGlyphIsDrawSelected(ABarEditControl: TdxBarCustomEditControl): Boolean; virtual; + class procedure EditControlPrepareEditWnd(ABarEditControl: TdxBarEditControl; + AHandle: HWND); virtual; + class procedure EditControlUpdateWndText(ABarEditControl: TdxBarEditControl; + AHandle: HWND; ANotEqual: Boolean); virtual; + class function HasEditControlExternalFrame(APaintType: TdxBarPaintType; + ASelected: Boolean): Boolean; virtual; + + // ColorCombo + // Conditions + function ColorComboHasCompleteFrame: Boolean; virtual; + function IsCustomColorButtonVisible(const ADrawParams: TdxBarColorComboControlDrawParams): Boolean; virtual; + // Sizes + procedure ColorComboCorrectFrameRect(const ADrawParams: TdxBarColorComboControlDrawParams; var ARect: TRect); virtual; + function GetCustomColorButtonIndents(APaintType: TdxBarPaintType): TRect; virtual; + // Draw + procedure ColorComboDrawCustomButton(const ADrawParams: TdxBarColorComboControlDrawParams; ARect: TRect); virtual; + procedure ColorComboDrawCustomButtonAdjacentZone(const ADrawParams: TdxBarColorComboControlDrawParams; ARect: TRect); virtual; + + // SysPanel + class procedure SysPanelCalcSize(AHandle: HWND; var ARect: TRect; var Corner: TdxCorner; + Combo: TdxBarItem; AllowResizing: Boolean); virtual; + class procedure SysPanelDraw(AHandle: HWND; AllowResizing, MouseAboveCloseButton, + CloseButtonIsTracking: Boolean; var CloseButtonRect, GripRect: TRect; Corner: TdxCorner); virtual; + class function SysPanelSize: Integer; virtual; + // DateNavigator + class function IsDateNavigatorFlat: Boolean; virtual; + procedure DateNavigatorDrawButton(ABarItem: TdxBarItem; + DC: HDC; R: TRect; const ACaption: string; APressed: Boolean); virtual; + function DateNavigatorHeaderColor: TColor; virtual; + + // SpinEditControl + function GetSpinEditArrowPos(const ADrawParams: TdxBarSpinEditDrawParams; ARect: TRect; AButtonIndex: Integer): TPoint; virtual; + procedure SpinEditCorrectFrameRect(const ADrawParams: TdxBarItemControlDrawParams; var ARect: TRect); virtual; + function GetSpinEditArrowSize(AHeight: Integer): TSize; virtual; + function GetSpinEditButtonBounds(const ADrawParams: TdxBarSpinEditDrawParams; const ARect: TRect; AButton: TdxBarSpinEditButton): TRect; virtual; + function GetSpinEditButtonIndents(APaintType: TdxBarPaintType): TRect; virtual; + function GetSpinEditButtonWidth(APaintType: TdxBarPaintType; const ARect: TRect): Integer; virtual; + function GetSpinEditButtonState(const ADrawParams: TdxBarSpinEditDrawParams; AButtonIndex: Integer): TcxButtonState; virtual; + // Draw + procedure SpinEditControlDrawButton(const ADrawParams: TdxBarSpinEditDrawParams; ARect: TRect; AButtonIndex: Integer); virtual; + procedure SpinEditControlDrawButtonsAdjacentZone(const ADrawParams: TdxBarSpinEditDrawParams; const ARect: TRect); virtual; + // ProgressControl + class function ProgressControlBarBrushColor: TColorRef; virtual; + function ProgressControlBarHeight(ABarItemControl: TdxBarItemControl): Integer; virtual; + procedure ProgressControlDrawBar(const ADrawParams: TdxbarProgressControlDrawParams; BarR: TRect; ABarBrushColor: TColorRef); virtual; + procedure ProgressControlDrawBackground(const ADrawParams: TdxBarItemControlDrawParams; var BarR: TRect); virtual; + procedure ProgressControlFillContent(const ADrawParams: TdxBarItemControlDrawParams; const R: TRect; ABarBrush: HBRUSH); virtual; + procedure ProgressControlFillDiscreteContent(const ADrawParams: TdxBarItemControlDrawParams; const R: TRect; ABarBrush: HBRUSH); virtual; + class function ProgressControlIndent(const ADrawParams: TdxBarItemControlDrawParams): Integer; virtual; + // ContainerControl + class function ContainerControlSubMenuOffset: Integer; virtual; + // InPlaceSubItemControl + // Sizes + class function InPlaceSubItemControlBrush: HBRUSH; virtual; + class function InPlaceSubItemGetArrowWidth(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams): Integer; virtual; + class function InPlaceSubItemGetTextIndent: Integer; virtual; + // Conditions + function InPlaceSubItemControlIsFlatItemText(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams): Boolean; virtual; + function InPlaceSubItemControlIsArrowSelected(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams): Boolean; virtual; + // Draw + procedure InPlaceSubItemControlDrawArrow(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams; + ADirection: TcxArrowDirection; ARect: TRect); virtual; + procedure InPlaceSubItemControlDrawBackground(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams; ARect: TRect); virtual; + procedure InPlaceSubItemControlDrawInMenu(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams; ARect: TRect); virtual; + // StaticControl + procedure DrawStaticBackground(const ADrawParams: TdxBarStaticLikeControlDrawParams; ARect: TRect); virtual; + procedure DrawStaticBorder(const ADrawParams: TdxBarStaticLikeControlDrawParams; var ARect: TRect); virtual; + procedure DrawStaticGlyphAndCaption(const ADrawParams: TdxBarStaticLikeControlDrawParams; const ARect: TRect); virtual; + procedure DrawStaticLikeControl(const ADrawParams: TdxBarStaticLikeControlDrawParams; var ARect: TRect; const AIndentsRect: TRect); virtual; + class function StaticBackgroundIsOpaque(const ADrawParams: TdxBarItemControlDrawParams): Boolean; virtual; + function StaticControlGetBorderOffsets(AParent: TCustomdxBarControl; ABorderStyle: TdxBarStaticBorderStyle): TRect; virtual; + // Separator + class function SeparatorControlGetIndents(const ADrawParams: TdxBarSeparatorControlDrawParams; + ADrawAreaType: TdxBarItemControlPart): TRect; virtual; + function SubMenuGetSeparatorSize: Integer; virtual; + procedure DrawSeparatorGlyphAndCaption(const ADrawParams: TdxBarSeparatorControlDrawParams; const ARect: TRect); virtual; + procedure DrawSeparatorControl(const ADrawParams: TdxBarSeparatorControlDrawParams; const ARect: TRect); virtual; + + // ScreenTip + // Attributes + function ScreenTipGetDescriptionTextColor: TColor; virtual; + function ScreenTipGetTitleTextColor: TColor; virtual; + // Size + function ScreenTipGetFooterLineSize: Integer; virtual; + // Draw + procedure ScreenTipDrawBackground(ACanvas: TcxCanvas; ARect: TRect); virtual; + procedure ScreenTipDrawFooterLine(ACanvas: TcxCanvas; const ARect: TRect); virtual; + end; + + TdxBarStandardPainter = class(TdxBarPainter) + protected + procedure DrawGlyphBorder(ABarItemControl: TdxBarItemControl; DC: HDC; ABrush: HBRUSH; + NeedBorder: Boolean; R: TRect; PaintType: TdxBarPaintType; IsGlyphEmpty, + Selected, Down, DrawDowned, ADroppedDown, IsSplit: Boolean); override; + procedure DrawGlyphCheckMark(ABarItemControl: TdxBarItemControl; DC: HDC; + X, Y, DoubleSize: Integer); override; + class function IgnoreGlyphOpaque: Boolean; override; + // Bar + class function BarIsBarSmall(ABarControl: TdxBarControl; const R: TRect): Boolean; override; + class procedure BarDrawMarkAtPos(ABarControl: TdxBarControl; DC: HDC; + const ItemRect: TRect; Offset: Integer); override; + procedure BarDrawMarkBackground(ABarControl: TdxBarControl; DC: HDC; + ItemRect: TRect; AToolbarBrush: HBRUSH); override; + public + // Common + // Sizes + function GetBorderSize: Integer; override; + class function GetCaptionOffsets: TRect; override; + class function GlyphDownShift(ABarItemControl: TdxBarItemControl): Integer; override; + class function GlyphDrawDownedShift(ABarItemControl: TdxBarItemControl; ADown: Boolean): Integer; override; + class function LoweredBorderSize(ABarItemControl: TdxBarItemControl): Integer; override; + // Draw + class procedure DrawDisabledShadowRect(ABarItemControl: TdxBarItemControl; DC: HDC; + R: TRect); override; + procedure DrawItemBackgroundInSubMenu(const ADrawParams: TdxBarButtonLikeControlDrawParams; R: TRect); override; + class procedure FrameAndFillRect(ABarItemControl: TdxBarItemControl; DC: HDC; + var R: TRect; Enabled, Selected, Pressed: Boolean); override; + class function GlyphBkgndBrush(ABarItemControl: TdxBarItemControl; + APaintType: TdxBarPaintType; AGlyphEmpty, ASelected, ADowned, ADrawDowned, ADroppedDown, + AForceUseBkBrush, AGrayScale: Boolean): HBRUSH; override; + // BarManager + function BeforeFingersSize: Integer; override; + function FingersSize(ABarControl: TdxBarControl): Integer; override; + class function SubMenuBeginGroupIndent: Integer; override; + // Custom Bar + class procedure GetEditTextVerticalOffsets(out ATop, ABottom: Integer); override; + // Bar + class function BarAllowHotTrack: Boolean; override; + class function BarAllowQuickCustomizing: Boolean; override; + procedure BarDrawCloseButton(ABarControl: TdxBarControl; DC: HDC; R: TRect); override; + procedure BarDrawDockedBarBorder(ABarControl: TdxBarControl; DC: HDC; R: TRect; + AToolbarBrush: HBRUSH); override; + procedure BarDrawFloatingBarBorder(ABarControl: TdxBarControl; DC: HDC; + R, CR: TRect; AToolbarBrush: HBRUSH); override; + procedure BarDrawMDIButton(ABarControl: TdxBarControl; AButton: TdxBarMDIButton; + AState: Integer; DC: HDC; R: TRect); override; + class function BarHorSize: Integer; override; + function BarMarkItemRect(ABarControl: TdxBarControl): TRect; override; + class function BarTopSize: Integer; override; + class function BarBottomSize: Integer; override; + class function BarUseSystemClose: Boolean; override; + class function BarUseSystemNCBorder: Boolean; override; + // ButtonControl + procedure DrawButtonControlArrowBackground(const ADrawParams: TdxBarButtonLikeControlDrawParams; + var R1: TRect; ABrush: HBRUSH); override; + + // ComboControl + class procedure ComboControlDrawSimpleButton(const ADrawParams: TdxBarEditLikeControlDrawParams; var ARect: TRect; ABrush: HBRUSH); override; + + // DropDownListBox + procedure DropDownListBoxDrawBorder(DC: HDC; AColor: TColor; ARect: TRect); override; + // SubMenuControl + class procedure SubMenuControlDrawItemFrame(ABarSubMenuControl: TdxBarSubMenuControl; + AControl: TdxBarItemControl; DC: HDC; AItemRect: TRect; AIndex: Integer); override; + class function SubMenuControlIsOffsetRecentGroupNeeded: Boolean; override; + class function SubMenuControlContentRectOffset(ABarSubMenuControl: TdxBarSubMenuControl): TRect; override; + class function SubMenuControlClientBorderSize: Integer; override; + end; + + TdxBarEnhancedPainter = class(TdxBarStandardPainter) + protected + // Bar + class procedure BarDrawMarkAtPos(ABarControl: TdxBarControl; DC: HDC; + const ItemRect: TRect; Offset: Integer); override; + procedure BarDrawMarkBackground(ABarControl: TdxBarControl; DC: HDC; + ItemRect: TRect; AToolbarBrush: HBRUSH); override; + public + // BarManager + function BeforeFingersSize: Integer; override; + function FingersSize(ABarControl: TdxBarControl): Integer; override; + class function SubMenuBeginGroupIndent: Integer; override; + // Bar + class function BarAllowQuickCustomizing: Boolean; override; + procedure BarDrawDockedBarBorder(ABarControl: TdxBarControl; DC: HDC; R: TRect; + AToolbarBrush: HBRUSH); override; + end; + + TdxBarFlatPainter = class(TdxBarPainter) + protected + // Common + procedure DrawGlyphBorder(ABarItemControl: TdxBarItemControl; ADC: HDC; ABrush: HBRUSH; + ANeedBorder: Boolean; R: TRect; APaintType: TdxBarPaintType; AGlyphEmpty, + ASelected, ADowned, ADrawDowned, ADroppedDown, AIsSplit: Boolean); override; + procedure DrawGlyphCheckMark(ABarItemControl: TdxBarItemControl; DC: HDC; + X, Y, DoubleSize: Integer); override; + class procedure DrawFrameRect(ABarItemControl: TdxBarItemControl; ADC: HDC; + const ARect: TRect; ABrush: HBRUSH; APaintType: TdxBarPaintType; ASelected, ADowned: Boolean); virtual; + class procedure FrameFlatSelRect(DC: HDC; const R: TRect); override; + class function GetToolbarBrush(ABarItemControl: TdxBarItemControl): HBRUSH; virtual; + // Bar + class function BarCaptionBkColor(ABarControl: TdxBarControl; AMainFormActive: Boolean): COLORREF; override; + class function BarMarkArrowColor(ABarControl: TdxBarControl; AState: TdxBarMarkState): COLORREF; override; + procedure BarDrawMarkBackground(ABarControl: TdxBarControl; DC: HDC; + ItemRect: TRect; AToolbarBrush: HBRUSH); override; + class procedure BarOffsetFloatingBarCaption(ABarControl: TdxBarControl; + var X: Integer; var R: TRect); override; + class function GetDrawMarkElementColor(ABarControl: TdxBarControl): Integer; override; + // SubMenuControl + procedure SubMenuControlDrawNonRecentGroupSeparator(ABarSubMenuControl: TdxBarSubMenuControl; ACanvas: TcxCanvas; AArrowDirection: TcxArrowDirection); override; + procedure SubMenuControlDrawMarkSelection(ABarSubMenuControl: TdxBarSubMenuControl; ADC: HDC; const AMarkRect: TRect); override; + // SpinEditControl + procedure DrawSpinEditArrow(const ADrawParams: TdxBarSpinEditDrawParams; AArrowPos: TPoint; AButtonIndex: Integer); override; + public + // New + procedure CalculateSpinEditParts(const ADrawParams: TdxBarSpinEditDrawParams; + var AParts: array of TRect; const AItemRect: TRect); override; + + // Common + // Sizes + function GetBorderSize: Integer; override; + class function GetControlCaptionOffset(ABarItemControl: TdxBarItemControl): Integer; override; + // Draw + procedure DrawItemBackgroundInSubMenu(const ADrawParams: TdxBarButtonLikeControlDrawParams; R: TRect); override; + class procedure DrawLowered(DC: HDC; var R: TRect); override; + procedure DrawStaticBorder(const ADrawParams: TdxBarStaticLikeControlDrawParams; var ARect: TRect); override; + class procedure FrameAndFillRect(ABarItemControl: TdxBarItemControl; DC: HDC; + var R: TRect; Enabled, Selected, Pressed: Boolean); override; + class function GlyphBkgndBrush(ABarItemControl: TdxBarItemControl; + APaintType: TdxBarPaintType; AGlyphEmpty, ASelected, ADowned, ADrawDowned, ADroppedDown, + AForceUseBkBrush, AGrayScale: Boolean): HBRUSH; override; + class function IsFlatGlyphImage: Boolean; override; + class function IsFlatItemText: Boolean; override; + class function IsGlyphImageBackgroundOpaque(ABarItemControl: TdxBarItemControl; + ADown, ADrawDowned, ASelected, AGlyphEmpty: Boolean): Boolean; override; + class function IsGlyphImageHasShadow: Boolean; override; + class function LoweredBorderSize(ABarItemControl: TdxBarItemControl): Integer; override; + class function StaticBorderBrush(ABarItemControl: TdxBarItemControl; ABorderStyle: TdxBarStaticBorderStyle): HBRUSH; virtual; + class function TextAreaOffset(ABarItemControl: TdxBarItemControl): Integer; override; + // BarManager + function BeforeFingersSize: Integer; override; + function FingersSize(ABarControl: TdxBarControl): Integer; override; + class function RealButtonArrowWidth(ABarManager: TdxBarManager): Integer; override; + class function RealLargeButtonArrowWidth(ABarManager: TdxBarManager): Integer; override; + class function SubMenuBeginGroupIndent: Integer; override; + // CustomBar + class function BarChildrenHaveShadows(ABarControl: TCustomdxBarControl): Boolean; override; + class procedure BarDrawBarControlOwner(ACustomBarControl: TCustomdxBarControl; DC: HDC; + R: TRect; ABarControl: TCustomdxBarControl); virtual; + class procedure BarDrawBarControlOwnerBorder(ACustomBarControl: TCustomdxBarControl; + DC: HDC; R: TRect; ABarItemControl: TdxBarItemControl; ABarControl: TCustomdxBarControl); virtual; + class procedure BarDrawBarControlOwnerFrame(ACustomBarControl: TCustomdxBarControl; + DC: HDC; R: TRect); virtual; + class procedure BarDrawBarControlOwnerLink(ACustomBarControl: TCustomdxBarControl; + DC: HDC; R, ALinkR: TRect; ABarItemControl: TdxBarItemControl); virtual; + class function BarToolbarBrush(ABarControl: TCustomdxBarControl): HBRUSH; override; + class function BarToolbarBrushEx(ABarControl: TdxBarControl): HBRUSH; override; + class function BarToolbarDownedBrush(ABarControl: TCustomdxBarControl): HBRUSH; override; + class function BarToolbarDownedSelBrush(ABarControl: TCustomdxBarControl): HBRUSH; override; + class function BarToolbarSelBrush(ABarControl: TCustomdxBarControl): HBRUSH; override; + // Bar + function BarBeginGroupSideSize: Integer; override; + function BarBeginGroupSize: Integer; override; + procedure BarDrawBeginGroup(ABarControl: TCustomdxBarControl; DC: HDC; + ABeginGroupRect: TRect; AToolbarBrush: HBRUSH; AHorz: Boolean); override; + procedure BarDrawCloseButton(ABarControl: TdxBarControl; DC: HDC; R: TRect); override; + procedure BarDrawDockedBarBorder(ABarControl: TdxBarControl; DC: HDC; R: TRect; + AToolbarBrush: HBRUSH); override; + procedure BarDrawFloatingBarBorder(ABarControl: TdxBarControl; DC: HDC; + R, CR: TRect; AToolbarBrush: HBRUSH); override; + procedure BarDrawMark(ABarControl: TdxBarControl; DC: HDC; MarkR: TRect); override; + procedure BarDrawMDIButton(ABarControl: TdxBarControl; AButton: TdxBarMDIButton; + AState: Integer; DC: HDC; R: TRect); override; + // QuickCustItem + class function BarToolbarBrushEx2(ABarControl: TdxBarControl): HBRUSH; override; + class procedure DrawQuickCustItemFrame(ABarItemControl: TdxBarItemControl; + DC: HDC; var R, ARect: TRect; Selected: Boolean); override; + class procedure DrawQuickCustItemFrameSelected(ABarItemControl: TdxBarItemControl; + DC: HDC; WholeR, R: TRect; Selected: Boolean); override; + class function IsQuickControlPopupOnRight: Boolean; override; + // ButtonControl + // Attributes + function ButtonControlArrowBrush(const ADrawParams: TdxBarItemControlDrawParams): HBRUSH; override; + // Sizes + class procedure CorrectButtonControlDefaultHeight(var DefaultHeight: Integer); override; + class procedure CorrectButtonControlDefaultWidth(var DefaultWidth: Integer); override; + // Draw + procedure DrawButtonControlArrowBackground(const ADrawParams: TdxBarButtonLikeControlDrawParams; + var R1: TRect; ABrush: HBRUSH); override; + + // ComboControl + // Attributes + function ComboControlArrowColor(ADrawParams: TdxBarItemControlDrawParams): TColor; override; + function ComboControlButtonBrush(const ADrawParams: TdxBarItemControlDrawParams): HBRUSH; override; + // Draw + class procedure ComboControlDrawSimpleButton(const ADrawParams: TdxBarEditLikeControlDrawParams; var ARect: TRect; ABrush: HBRUSH); override; + + // SubMenuControl + // Sizes + class function SubMenuControlArrowsOffset: Integer; override; + function SubMenuControlBeginGroupRect( + ABarSubMenuControl: TdxBarSubMenuControl; AControl: TdxBarItemControl; + const AItemRect: TRect): TRect; override; + function SubMenuControlBeginGroupSize: Integer; override; + procedure SubMenuControlCalcDrawingConsts(ACanvas: TcxCanvas; + ATextSize: Integer; out AMenuArrowWidth, AMarkSize: Integer); override; + class function SubMenuControlDetachCaptionAreaSize(ABarSubMenuControl: TdxBarSubMenuControl): Integer; override; + // Positions + class function SubMenuControlGetItemIconRect(const AItemRect: TRect; AIconAreaSize: Integer): TRect; override; + class function SubMenuControlGetItemTextRect(const ADrawParams: TdxBarButtonLikeControlDrawParams; const AItemRect: TRect): TRect; override; + class function SubMenuControlGetItemTextIndent(const ADrawParams: TdxBarItemControlDrawParams): Integer; override; + // Draw + procedure SubMenuControlDrawBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); override; + procedure SubMenuControlDrawClientBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; const R: TRect; ABrush: HBRUSH); override; + procedure SubMenuControlDrawDetachCaption(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); override; + procedure SubMenuControlDrawBeginGroup(ABarSubMenuControl: TdxBarSubMenuControl; + AControl: TdxBarItemControl; ACanvas: TcxCanvas; const ABeginGroupRect: TRect); override; + procedure SubMenuControlDrawSeparator(ACanvas: TcxCanvas; const ARect: TRect); override; + class function SubMenuControlGetSeparatorColor: TColor; virtual; + class function SubMenuControlMarkArrowSize(AMarkSize: Integer): Integer; override; + class function SubMenuControlNormalItemHeight: Integer; override; + class procedure SubMenuControlOffsetDetachCaptionRect(ABarSubMenuControl: TdxBarSubMenuControl; + var R: TRect); override; + class function SubMenuControlTextSize(ACanvas: TcxCanvas): Integer; override; + class function SubMenuControlToolbarItemsBrush(ABarSubMenuControl: TdxBarSubMenuControl): HBRUSH; override; + // CustomCombo + class procedure CustomComboDrawItem(ABarCustomCombo: TdxBarCustomCombo; + ACanvas: TCanvas; AIndex: Integer; ARect: TRect; AState: TOwnerDrawState; + AInteriorIsDrawing: Boolean); override; + // EditControl + class function EditControlBorderOffsets(APaintType: TdxBarPaintType): TRect; override; + procedure EditControlDrawBorder(const ADrawParams: TdxBarEditLikeControlDrawParams; var ARect: TRect); override; + procedure EditControlDrawSelectionFrame(const ADrawParams: TdxBarEditLikeControlDrawParams; const ARect: TRect); override; + class function EditControlCaptionRightIndentIsOpaque(const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; override; + // Select EditControl indents + class function EditControlCaptionRelativeLeftIndent(const ADrawParams: TdxBarEditLikeControlDrawParams): Integer; override; + class function EditControlCaptionAbsoluteLeftIndent(const ADrawParams: TdxBarEditLikeControlDrawParams): Integer; override; + class function EditControlCaptionRightIndent: Integer; override; + class function EditControlSubMenuGlyphIndents(const ADrawParams: TdxBarEditLikeControlDrawParams): TRect; override; + + class function EditControlGetRightCaptionIndentBrush(ABarEditControl: TdxBarCustomEditControl): HBRUSH; override; + class function EditControlGlyphIsDrawSelected(ABarEditControl: TdxBarCustomEditControl): Boolean; override; + class function HasEditControlExternalFrame(APaintType: TdxBarPaintType; + ASelected: Boolean): Boolean; override; + // SysPanel + class procedure SysPanelDraw(AHandle: HWND; AllowResizing, MouseAboveCloseButton, + CloseButtonIsTracking: Boolean; var CloseButtonRect, GripRect: TRect; Corner: TdxCorner); override; + // DateNavigator + class function IsDateNavigatorFlat: Boolean; override; + procedure DateNavigatorDrawButton(ABarItem: TdxBarItem; + DC: HDC; R: TRect; const ACaption: string; APressed: Boolean); override; + // SpinEditControl + procedure SpinEditControlDrawButton(const ADrawParams: TdxBarSpinEditDrawParams; ARect: TRect; AButtonIndex: Integer); override; + // ContainerControl + class function ContainerControlSubMenuOffset: Integer; override; + // InPlaceSubItemControl + function InPlaceSubItemControlIsFlatItemText(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams): Boolean; override; + function InPlaceSubItemControlIsArrowSelected(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams): Boolean; override; + end; + + TdxBarOffice11Painter = class(TdxBarFlatPainter) + protected + // Common + procedure DrawGlyphBorder(ABarItemControl: TdxBarItemControl; DC: HDC; ABrush: HBRUSH; + NeedBorder: Boolean; R: TRect; PaintType: TdxBarPaintType; IsGlyphEmpty, + Selected, Down, DrawDowned, ADroppedDown, IsSplit: Boolean); override; + class procedure DrawItemArrow(DC: HDC; R: TRect; ArrowType: TcxArrowDirection; + Enabled, Selected, Flat: Boolean; AColor: TColor = clDefault); override; + procedure DrawLargeItemArrow(DC: HDC; R: TRect; ArrowType: TcxArrowDirection; + Size: Integer; Selected, Enabled, Flat: Boolean; AColor: TColor = clDefault); override; + class procedure DrawFrameRect(ABarItemControl: TdxBarItemControl; ADC: HDC; + const ARect: TRect; ABrush: HBRUSH; APaintType: TdxBarPaintType; ASelected, ADowned: Boolean); override; + class procedure FrameFlatSelRect(DC: HDC; const R: TRect); override; + class function GetBarGradientRect(ABarControl: TCustomdxBarControl): TRect; + class procedure GetDockColors(ADockControl: TdxDockControl; var AColor1, AColor2: TColor); + class procedure GetMarkColors(ABarControl: TdxBarControl; var AMarkColor1, AMarkColor2, AColor6, AColor9: TColor); + class procedure GetSelectedColors(ABarItemControl: TdxBarItemControl; + ADown, ASelected: Boolean; var AColor1, AColor2: TColor); + class function GetToolbarBrush(ABarItemControl: TdxBarItemControl): HBRUSH; override; + + function GetDefaultEnabledTextColor(ABarItemControl: TdxBarItemControl; + ASelected, AFlat: Boolean): TColor; override; + procedure GetDisabledTextColors(ABarItemControl: TdxBarItemControl; + ASelected, AFlat: Boolean; var AColor1, AColor2: TColor); override; + + class function GetFaded(ABarControl: TCustomdxBarControl): Boolean; override; + class function IgnoreNonRecentColor: Boolean; override; + class function IsMenuGradient(ABarItemControl: TdxBarItemControl): Boolean; + class function IsSimpleMark(ABarControl: TdxBarControl): Boolean; + // Bar + class function BarCaptionBkColor(ABarControl: TdxBarControl; AMainFormActive: Boolean): COLORREF; override; + function BarCaptionColor(ABarControl: TdxBarControl): COLORREF; override; + class function BarMarkArrowColor(ABarControl: TdxBarControl; AState: TdxBarMarkState): COLORREF; override; + class procedure BarDrawFingerElements(ABarControl: TCustomdxBarControl; DC: HDC; + ARect: TRect; AHorizontal: Boolean); virtual; + procedure BarDrawMarkBackground(ABarControl: TdxBarControl; DC: HDC; + ItemRect: TRect; AToolbarBrush: HBRUSH); override; + procedure BarDrawMarkElements(ABarControl: TdxBarControl; DC: HDC; + ItemRect: TRect); override; + // SubMenuControl + // Sizes + function SubMenuControlMarkBorderSize: Integer; + function SubMenuControlMarkContentRect(const ADrawRect: TRect): TRect; + // Draw + procedure SubMenuControlDrawMarkContent(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect; ASelected: Boolean); override; + public + // Common + procedure DrawItemBackgroundInSubMenu(const ADrawParams: TdxBarButtonLikeControlDrawParams; R: TRect); override; + class procedure FrameAndFillRect(ABarItemControl: TdxBarItemControl; DC: HDC; + var R: TRect; Enabled, Selected, Pressed: Boolean); override; + class function IsFlatGlyphImage: Boolean; override; + class function IsGlyphImageHasShadow: Boolean; override; + class function IsItemTextSelectedInverted: Boolean; override; + class function StaticBorderBrush(ABarItemControl: TdxBarItemControl; + ABorderStyle: TdxBarStaticBorderStyle): HBRUSH; override; + // BarManager + function BeforeFingersSize: Integer; override; + class function BorderSizeX: Integer; override; + class function BorderSizeY: Integer; override; + class function EmptyFingersSize: Integer; override; + // DockControl + procedure DockControlFillBackground(ADockControl: TdxDockControl; + DC: HDC; ADestR, ASourceR, AWholeR: TRect; ABrush: HBRUSH; AColor: TColor); override; + class function IsNativeBackground: Boolean; override; + // CustomBar + class function BarControlOwnerBrush(ABarManager: TdxBarManager): HBRUSH; override; + class procedure BarDrawBarControlOwnerFrame(ACustomBarControl: TCustomdxBarControl; + DC: HDC; R: TRect); override; + class procedure BarDrawBarControlOwnerLink(ACustomBarControl: TCustomdxBarControl; + DC: HDC; R, ALinkR: TRect; ABarItemControl: TdxBarItemControl); override; + procedure BarDrawDockedBackground(ABarControl: TdxBarControl; DC: HDC; + ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); override; + procedure BarDrawFloatingBackground(ABarControl: TCustomdxBarControl; DC: HDC; + ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); override; + class procedure BarDrawOwnerLink(ABarControl: TCustomdxBarControl; DC: HDC); override; + function BarHasShadow(ABarControl: TCustomdxBarControl): Boolean; override; + class function BarToolbarBrush(ABarControl: TCustomdxBarControl): HBRUSH; override; + class function BarToolbarBrushEx(ABarControl: TdxBarControl): HBRUSH; override; + class function BarToolbarDownedBrush(ABarControl: TCustomdxBarControl): HBRUSH; override; + class function BarToolbarDownedSelBrush(ABarControl: TCustomdxBarControl): HBRUSH; override; + class function BarToolbarSelBrush(ABarControl: TCustomdxBarControl): HBRUSH; override; + function ComboBoxArrowWidth(ABarControl: TCustomdxBarControl; cX: Integer): Integer; override; + // Bar + class function BarBeforeFingersIndent: Integer; virtual; + procedure BarBorderPaintSizes(ABarControl: TdxBarControl; var R: TRect); override; + procedure BarBorderSizes(ABar: TdxBar; AStyle: TdxBarDockingStyle; var R: TRect); override; + procedure BarDrawBeginGroup(ABarControl: TCustomdxBarControl; DC: HDC; + ABeginGroupRect: TRect; AToolbarBrush: HBRUSH; AHorz: Boolean); override; + class procedure BarDrawCaptionElement(ABarControl: TdxBarControl; DC: HDC; + R: TRect; AState: TdxBarMarkState); override; + procedure BarDrawDockedBarBorder(ABarControl: TdxBarControl; DC: HDC; R: TRect; + AToolbarBrush: HBRUSH); override; + procedure BarDrawFloatingBarBorder(ABarControl: TdxBarControl; DC: HDC; + R, CR: TRect; AToolbarBrush: HBRUSH); override; + procedure BarDrawFloatingBarCaption(ABarControl: TdxBarControl; DC: HDC; + R, CR: TRect; AToolbarBrush: HBRUSH); override; + function BarMarkRect(ABarControl: TdxBarControl): TRect; override; + procedure BarMarkRectInvalidate(ABarControl: TdxBarControl); override; + + // SubMenuControl + // Attributes + class function SubMenuControlGetSeparatorColor: TColor; override; + class function SubMenuControlToolbarItemsBrush(ABarSubMenuControl: TdxBarSubMenuControl): HBRUSH; override; + // Conditions + class function SubMenuControlHasBand: Boolean; override; + class function SubMenuControlIsSingleMenuBorder(ABarSubMenuControl: TdxBarSubMenuControl): Boolean; + // Positions + class procedure SubMenuControlOffsetDetachCaptionRect(ABarSubMenuControl: TdxBarSubMenuControl; + var R: TRect); override; + // Sizes + procedure SubMenuControlCalcDrawingConsts(ACanvas: TcxCanvas; + ATextSize: Integer; out AMenuArrowWidth, AMarkSize: Integer); override; + class function SubMenuControlDetachCaptionAreaSize(ABarSubMenuControl: TdxBarSubMenuControl): Integer; override; + // Draw + procedure SubMenuControlDrawBackground(ABarSubMenuControl: TdxBarSubMenuControl; + ACanvas: TcxCanvas; ARect: TRect; ABrush: HBRUSH; AColor: TColor); override; + procedure SubMenuControlDrawBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); override; + procedure SubMenuControlDrawClientBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; const R: TRect; ABrush: HBRUSH); override; + procedure SubMenuControlDrawDetachCaption(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); override; + + // DropDownListBox + procedure DropDownListBoxDrawBorder(DC: HDC; AColor: TColor; ARect: TRect); override; + // QuickCustItem + class function BarToolbarBrushEx2(ABarControl: TdxBarControl): HBRUSH; override; + class procedure DrawQuickCustItemFrameSelected(ABarItemControl: TdxBarItemControl; + DC: HDC; WholeR, R: TRect; Selected: Boolean); override; + + // Button Control + function ButtonControlArrowBrush(const ADrawParams: TdxBarItemControlDrawParams): HBRUSH; override; + + // EditButton + // Conditions + function EditButtonIsCustomBackground(AState: Integer): Boolean; override; + // Draw + procedure EditButtonDrawBackground(const ADrawParams: TdxBarEditLikeControlDrawParams; AState: Integer; + ARect: TRect; ABrush: HBrush); override; + + // EditControl + class function EditControlBorderOffsets(APaintType: TdxBarPaintType): TRect; override; + procedure EditControlDrawBorder(const ADrawParams: TdxBarEditLikeControlDrawParams; var ARect: TRect); override; + class function EditControlCaptionBackgroundIsOpaque(const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; override; + // Select EditControl indents + class function EditControlCaptionAbsoluteLeftIndent(const ADrawParams: TdxBarEditLikeControlDrawParams): Integer; override; + class function EditControlSubMenuGlyphIndents(const ADrawParams: TdxBarEditLikeControlDrawParams): TRect; override; + class function EditControlCaptionRightIndentIsOpaque(const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; override; + class function EditControlShowIconDefault(const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; override; + + // ComboControl + // Attributes + function ComboControlArrowColor(ADrawParams: TdxBarItemControlDrawParams): TColor; override; + function ComboControlButtonBrush(const ADrawParams: TdxBarItemControlDrawParams): HBRUSH; override; + // Draw + class procedure ComboControlDrawSimpleButton(const ADrawParams: TdxBarEditLikeControlDrawParams; var ARect: TRect; ABrush: HBRUSH); override; + + // ProgressControl + class function ProgressControlIndent(const ADrawParams: TdxBarItemControlDrawParams): Integer; override; + // DateNavigator + procedure DateNavigatorDrawButton(ABarItem: TdxBarItem; + DC: HDC; R: TRect; const ACaption: string; APressed: Boolean); override; + function DateNavigatorHeaderColor: TColor; override; + // InPlaceSubItemControl + class function InPlaceSubItemControlBrush: HBRUSH; override; + // Edit + function EditGetDisabledBkColor(ABarItemControl: TdxBarCustomEditControl): COLORREF; override; + function EditGetDisabledTextColor: COLORREF; override; + // Separator + procedure DrawSeparatorGlyphAndCaption(const ADrawParams: TdxBarSeparatorControlDrawParams; const ARect: TRect); override; + end; + + TdxBarXPPainter = class(TdxBarPainter) + private + procedure BarBeginGroupSizeInit; + procedure BarCloseButtonSizeInit; + procedure ButtonBorderHeightInit; + procedure ComboBoxArrowWidthInit; + procedure EditControlBorderOffsetsInit; + procedure GripperSizeInit; + procedure InitParams; + procedure ProgressControlBarHeightInit; + procedure StatusBarGripSizeInit; + procedure SubMenuControlBeginGroupSizeInit; + + class function IsArrowButtonDowned(APaintStyle: TdxBarPaintType; AIsPressed: Boolean): Boolean; + protected + // Common + procedure DrawGlyphBorder(ABarItemControl: TdxBarItemControl; DC: HDC; ABrush: HBRUSH; + NeedBorder: Boolean; R: TRect; PaintType: TdxBarPaintType; IsGlyphEmpty, + Selected, Down, DrawDowned, ADroppedDown, IsSplit: Boolean); override; + procedure DrawGlyphCheckMark(ABarItemControl: TdxBarItemControl; DC: HDC; + X, Y, DoubleSize: Integer); override; + class function GetFaded(ABarControl: TCustomdxBarControl): Boolean; override; + class function IsMenuItem(ABarItemControl: TdxBarItemControl): Boolean; override; + // Bar + class procedure BarDrawNativeGrip(ABarControl: TdxBarControl; DC: HDC; R: TRect; + AToolbarBrush: HBRUSH); + procedure BarDrawMarkBackground(ABarControl: TdxBarControl; DC: HDC; + ItemRect: TRect; AToolbarBrush: HBRUSH); override; + class procedure BarOffsetFloatingBarCaption(ABarControl: TdxBarControl; + var X: Integer; var R: TRect); override; + + // ColorCombo + // Sizes + function GetDotSpaceAfter(ADotWidth: Integer): Integer; override; + // Draw + procedure DrawDot(const ADrawParams: TdxBarEditLikeControlDrawParams; ARect: TRect); override; + public + constructor Create(AData: Integer); override; + // Common + procedure DrawItemBackgroundInSubMenu(const ADrawParams: TdxBarButtonLikeControlDrawParams; R: TRect); override; + class function GlyphBkgndBrush(ABarItemControl: TdxBarItemControl; + APaintType: TdxBarPaintType; AGlyphEmpty, ASelected, ADowned, ADrawDowned, ADroppedDown, + AForceUseBkBrush, AGrayScale: Boolean): HBRUSH; override; + class function GlyphDownShift(ABarItemControl: TdxBarItemControl): Integer; override; + class function GlyphDrawDownedShift(ABarItemControl: TdxBarItemControl; ADown: Boolean): Integer; override; + class function IsFlatGlyphImage: Boolean; override; + // BarManager + function BeforeFingersSize: Integer; override; + function FingersSize(ABarControl: TdxBarControl): Integer; override; + function GripperSize(ABarControl: TdxBarControl): Integer; override; + class function RealButtonArrowWidth(ABarManager: TdxBarManager): Integer; override; + class function RealLargeButtonArrowWidth(ABarManager: TdxBarManager): Integer; override; + // DockControl + procedure DockControlFillBackground(ADockControl: TdxDockControl; + DC: HDC; ADestR, ASourceR, AWholeR: TRect; ABrush: HBRUSH; AColor: TColor); override; + class function IsNativeBackground: Boolean; override; + // CustomBar +// class function BarChildrenHaveShadows(ABarControl: TCustomdxBarControl): Boolean; override; + class function BarToolbarBrush(ABarControl: TCustomdxBarControl): HBRUSH; override; + class function BarToolbarBrushEx(ABarControl: TdxBarControl): HBRUSH; override; + class function BarToolbarDownedBrush(ABarControl: TCustomdxBarControl): HBRUSH; override; + class function BarToolbarDownedSelBrush(ABarControl: TCustomdxBarControl): HBRUSH; override; + class function BarToolbarSelBrush(ABarControl: TCustomdxBarControl): HBRUSH; override; + function ComboBoxArrowWidth(ABarControl: TCustomdxBarControl; cX: Integer): Integer; override; + // Bar + function BarBeginGroupSideSize: Integer; override; + function BarBeginGroupSize: Integer; override; + class function BarBorderSize: Integer; override; + procedure BarCaptionFillBackground(ABarControl: TdxBarControl; DC: HDC; + R: TRect; AToolbarBrush: HBRUSH); override; +// class function BarCaptionSize: Integer; override; + class function BarCaptionTransparent: Boolean; override; + class function BarCloseButtonSize: TSize; override; + procedure BarDrawBeginGroup(ABarControl: TCustomdxBarControl; DC: HDC; + ABeginGroupRect: TRect; AToolbarBrush: HBRUSH; AHorz: Boolean); override; + procedure BarDrawCloseButton(ABarControl: TdxBarControl; DC: HDC; R: TRect); override; + procedure BarDrawDockedBarBorder(ABarControl: TdxBarControl; DC: HDC; R: TRect; + AToolbarBrush: HBRUSH); override; + procedure BarDrawFloatingBarBorder(ABarControl: TdxBarControl; DC: HDC; + R, CR: TRect; AToolbarBrush: HBRUSH); override; + procedure BarDrawMDIButton(ABarControl: TdxBarControl; AButton: TdxBarMDIButton; + AState: Integer; DC: HDC; R: TRect); override; + class procedure StatusBarFillNativeBackground(ABarControl: TdxBarControl; DC: HDC; + ADestR, ASourceR, AWholeR: TRect; ABrush: HBRUSH; AColor: TColor); + class function StatusBarNativeGripSize(ABarManager: TdxBarManager): TSize; + + // QuickCustItem + class function IsQuickControlPopupOnRight: Boolean; override; + + // ButtonControl + // Conditions + function IsButtonControlArrowFlat: Boolean; override; + // Sizes + function GetButtonBorderHeight: Integer; override; + function GetButtonBorderWidth: Integer; override; + class procedure CorrectButtonControlDefaultHeight(var DefaultHeight: Integer); override; + // Draw + procedure DrawButtonControlArrow(const ADrawParams: TdxBarButtonLikeControlDrawParams; + R1: TRect); override; + procedure DrawButtonControlArrowBackground(const ADrawParams: TdxBarButtonLikeControlDrawParams; + var R1: TRect; ABrush: HBRUSH); override; + + // EditControl + class function EditControlBorderOffsets(APaintType: TdxBarPaintType): TRect; override; + procedure EditControlDrawBorder(const ADrawParams: TdxBarEditLikeControlDrawParams; var ARect: TRect); override; + class function EditControlCaptionRightIndentIsOpaque(const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; override; + // Select EditControl indents + class function EditControlCaptionAbsoluteLeftIndent(const ADrawParams: TdxBarEditLikeControlDrawParams): Integer; override; + class function EditControlCaptionRightIndent: Integer; override; + class function EditControlSubMenuGlyphIndents(const ADrawParams: TdxBarEditLikeControlDrawParams): TRect; override; + + class function EditControlGetRightCaptionIndentBrush(ABarEditControl: TdxBarCustomEditControl): HBRUSH; override; + // CustomCombo + class procedure CustomComboDrawItem(ABarCustomCombo: TdxBarCustomCombo; + ACanvas: TCanvas; AIndex: Integer; ARect: TRect; AState: TOwnerDrawState; + AInteriorIsDrawing: Boolean); override; + + // ComboControl + // Sizes + class function ComboControlArrowOffset: Integer; override; + // Draw + procedure ComboControlDrawArrowButton(const ADrawParams: TdxBarEditLikeControlDrawParams; + ARect: TRect; AInClientArea: Boolean); override; + + // SubMenuControl + // Sizes + class function SubMenuControlArrowsOffset: Integer; override; + function SubMenuControlBeginGroupRect( + ABarSubMenuControl: TdxBarSubMenuControl; AControl: TdxBarItemControl; + const AItemRect: TRect): TRect; override; + function SubMenuControlBeginGroupSize: Integer; override; + class function SubMenuControlDetachCaptionAreaSize(ABarSubMenuControl: TdxBarSubMenuControl): Integer; override; + // Draw + procedure SubMenuControlDrawBeginGroup(ABarSubMenuControl: TdxBarSubMenuControl; + AControl: TdxBarItemControl; ACanvas: TcxCanvas; const ABeginGroupRect: TRect); override; + procedure SubMenuControlDrawSeparator(ACanvas: TcxCanvas; const ARect: TRect); override; + procedure SubMenuControlDrawBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); override; + procedure SubMenuControlDrawClientBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; const R: TRect; ABrush: HBRUSH); override; + class procedure SubMenuControlOffsetDetachCaptionRect(ABarSubMenuControl: TdxBarSubMenuControl; + var R: TRect); override; + class function SubMenuControlToolbarItemsBrush(ABarSubMenuControl: TdxBarSubMenuControl): HBRUSH; override; + + // ColorCombo + // Sizes + function GetCustomColorButtonIndents(APaintType: TdxBarPaintType): TRect; override; + // Draw + procedure ColorComboDrawCustomButton(const ADrawParams: TdxBarColorComboControlDrawParams; ARect: TRect); override; + procedure ColorComboDrawCustomButtonAdjacentZone(const ADrawParams: TdxBarColorComboControlDrawParams; ARect: TRect); override; + + // DateNavigator + class function IsDateNavigatorFlat: Boolean; override; + class procedure DateNavigatorDrawNativeButton(ABarItem: TdxBarItem; + DC: HDC; R: TRect; const ACaption: string; APressed: Boolean); + procedure DateNavigatorDrawButton(ABarItem: TdxBarItem; + DC: HDC; R: TRect; const ACaption: string; APressed: Boolean); override; + // SysPanel + class procedure SysPanelDraw(AHandle: HWND; AllowResizing, MouseAboveCloseButton, + CloseButtonIsTracking: Boolean; var CloseButtonRect, GripRect: TRect; Corner: TdxCorner); override; + class function SysPanelSize: Integer; override; + // SpinEditControl + procedure SpinEditControlDrawButton(const ADrawParams: TdxBarSpinEditDrawParams; ARect: TRect; AButtonIndex: Integer); override; + function GetSpinEditButtonIndents(APaintType: TdxBarPaintType): TRect; override; + // ProgressControl + class function ProgressControlBarBrushColor: TColorRef; override; + function ProgressControlBarHeight(ABarItemControl: TdxBarItemControl): Integer; override; + procedure ProgressControlDrawBar(const ADrawParams: TdxbarProgressControlDrawParams; BarR: TRect; ABarBrushColor: TColorRef); override; + // Edit + function EditGetEnabledBkColor(ABarItemControl: TdxBarCustomEditControl): COLORREF; override; + function EditGetDisabledBkColor(ABarItemControl: TdxBarCustomEditControl): COLORREF; override; + function EditGetEnabledTextColor: COLORREF; override; + function EditGetDisabledTextColor: COLORREF; override; + // Separator + function SubMenuGetSeparatorSize: Integer; override; + end; + + TdxBarSkinnedPainter = class(TdxBarOffice11Painter) + private + FSkinnedObject: TObject; + + function GetSkin: IdxSkin; + + procedure DrawButtonBackground(const ADrawParams: TdxBarButtonLikeControlDrawParams); + function GetArrowRect(const ADrawParams: TdxBarButtonLikeControlDrawParams; const ARect: TRect): TRect; + class function GetTextInsteadArrow(const ADrawParams: TdxBarItemControlDrawParams): string; + + class function GetMaxLineCount: Integer; + procedure InternalDrawBeginGroup(DC: HDC; const ABeginGroupRect: TRect; AHorz: Boolean; AColor1, AColor2: TColor); + procedure InternalDrawEditButton(const ADrawParams: TdxBarEditLikeControlDrawParams; APartIndex: Integer; ARect: TRect); + protected + procedure CorrectCaptionParams(const ADrawParams: TdxBarButtonLikeControlDrawParams; + var ATextBounds: TRect; const AImageBounds: TRect; out ATextAlignment: DWORD); override; + + // Common + function AllowLargeIcons: Boolean; override; + procedure BarDrawMarkElements(ABarControl: TdxBarControl; DC: HDC; + ItemRect: TRect); override; + procedure DrawToolbarContentPart(ABarControl: TdxBarControl; ACanvas: TcxCanvas); override; + procedure DrawToolbarNonContentPart(ABarControl: TdxBarControl; DC: HDC); override; + class function GetControlTextIndents: TRect; override; + class function GetControlCaptionRect(const ADrawParams: TdxBarItemControlDrawParams): TRect; override; + + function GetDefaultEnabledTextColor(ABarItemControl: TdxBarItemControl; + ASelected, AFlat: Boolean): TColor; override; + function GetEnabledTextColor(ABarItemControl: TdxBarItemControl; + ASelected, AFlat: Boolean): TColor; override; + procedure GetDisabledTextColors(ABarItemControl: TdxBarItemControl; + ASelected, AFlat: Boolean; var AColor1, AColor2: TColor); override; + + function GetToolbarCaptionRect(const ARect: TRect): TRect; override; + procedure InflateSizeForArrow(const ADrawParams: TdxBarButtonLikeControlDrawParams; var ASize: Integer); override; + class function IsCompoundPainting: Boolean; override; + + class function GetButtonPartState(const ADrawParams: TdxBarButtonLikeControlDrawParams; AControlPart: Integer): Integer; + class function GetEditPartState(const ADrawParams: TdxBarEditLikeControlDrawParams; AControlPart: Integer): Integer; + class function GetSpinEditPartState(const ADrawParams: TdxBarSpinEditDrawParams; + AControlPart: Integer): Integer; + class function GetPartState(const ADrawParams: TdxBarItemControlDrawParams; + AControlPart: Integer; AForbiddenParts: TdxByteSet = []): Integer; + + function GetBarControlState(ABarControl: TdxBarControl): Integer; + //Hints + class function GetBarItemContolHintPosition(ABarControl: TCustomdxBarControl; + const AItemBounds: TRect; const ACursorPos: TPoint; AHeight: Integer): TPoint; override; + function CreateHintViewInfo(ABarManager: TdxBarManager; AHintText: string; const AShortCut: string; + AScreenTip: TdxBarScreenTip): TdxBarCustomHintViewInfo; override; + // ButtonLikeControl + procedure ButtonLikeControlDoDrawCaption(const ADrawParams: TdxBarButtonLikeControlDrawParams; + const ATextBounds: TRect; ATextAlignment: DWORD; AFormat: DWORD = 0); override; + procedure ButtonLikeControlDrawMenuArrow(const ADrawParams: TdxBarButtonLikeControlDrawParams; + ADirection: TcxArrowDirection; ARect: TRect); + // SpinEditControl + procedure DrawSpinEditArrow(const ADrawParams: TdxBarSpinEditDrawParams; + AArrowPos: TPoint; AButtonIndex: Integer); override; + // SubMenuControl + procedure SubMenuControlDrawMarkContent(ABarSubMenuControl: TdxBarSubMenuControl; DC: HDC; R: TRect; ASelected: Boolean); override; + procedure SubMenuControlDrawMarkSelection(ABarSubMenuControl: TdxBarSubMenuControl; ADC: HDC; const AMarkRect: TRect); override; + procedure SubMenuControlFillScrollArrow(ACanvas: TcxCanvas; ARect: TRect; AColor: TColor); override; + function SubMenuControlGetScrollBandSize(ABarSubMenuControl: TdxBarSubMenuControl): Integer; override; + class function SubMenuControlGetScrollArrowSize(ATextSize: Integer): Integer; override; + class function SubMenuControlUseScrollButtons: Boolean; override; + public + constructor Create(AData: Integer); override; + + procedure CalculateButtonParts(const ADrawParams: TdxBarButtonLikeControlDrawParams; + var AParts: array of TRect; const AItemRect: TRect); override; + procedure CalculateSpinEditParts(const ADrawParams: TdxBarSpinEditDrawParams; + var AParts: array of TRect; const AItemRect: TRect); override; + procedure DrawArrow(ADC: HDC; ARect: TRect; AArrowState: Integer); + + // Common + // Sizes + function GetBorderSize: Integer; override; + function GetIconAreaSize(ABarControl: TCustomdxBarControl): Integer; override; + class function GetDefaultTextSize(ACanvas: TcxCanvas): Integer; override; + function GetLargeImageBounds(AItemControl: TdxBarItemControl; + const AImageSize: TSize; const ADrawRect: TRect; APaintType: TdxBarPaintType; + AViewStructure: TdxBarItemControlViewStructure; AGlyphLayout: TdxBarGlyphLayout): TRect; override; + function GetSmallIconSize: Integer; + // Draw + procedure DrawItemBackgroundInSubMenu(const ADrawParams: TdxBarButtonLikeControlDrawParams; R: TRect); override; + procedure DrawGlyphAndBkgnd(ABarItemControl: TdxBarItemControl; ADC: HDC; + const R, AGlyphRect: TRect; APaintType: TdxBarPaintType; AGlyph: TBitmap; + AImages: TCustomImageList; AImageIndex: Integer; AGlyphEmpty, ASelected, ADowned, + ADrawDowned, ADroppedDown, AForceUseBkBrush, AGrayScale, AIsSplit: Boolean); override; + function GetToolbarContentOffsets(ABar: TdxBar; + ADockingStyle: TdxBarDockingStyle; AHasSizeGrip: Boolean): TRect; override; + function GetToolbarsOffsetForAutoAlign: Integer; override; + class function RealButtonArrowWidth(ABarManager: TdxBarManager): Integer; override; + class function LoweredBorderSize(ABarItemControl: TdxBarItemControl): Integer; override; + + // CustomBar + function BarLinkedOwnerHasShadow(ABarControl: TCustomdxBarControl): Boolean; override; + procedure BarDrawBackground(ABarControl: TdxBarControl; ADC: HDC; + const ADestRect, ASourceRect: TRect; ABrush: HBRUSH; AColor: TColor); override; + procedure BarDrawDockedBackground(ABarControl: TdxBarControl; DC: HDC; + ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); override; + function ComboBoxArrowWidth(ABarControl: TCustomdxBarControl; cX: Integer): Integer; override; + class procedure SetWindowRgn(AHandle: THandle; const AWindowRect: TRect; ARedraw: Boolean = False); override; + // Bar + procedure BarDrawBeginGroup(ABarControl: TCustomdxBarControl; DC: HDC; + ABeginGroupRect: TRect; AToolbarBrush: HBRUSH; AHorz: Boolean); override; + // BarItemControl + // Sizes + class function GetTailAreaSize(const ADrawParams: TdxBarItemControlDrawParams): Integer; override; + + // ButtonControl + // Sizes + class function GetDefaultArrowSignSize: TSize; override; + function GetButtonBorderHeight: Integer; override; + function GetButtonBorderWidth: Integer; override; + function GetButtonHeight(AIconSize, ATextSize: Integer): Integer; override; + function GetButtonWidth(AIconSize, ATextSize: Integer): Integer; override; + class procedure CorrectButtonControlDefaultHeight(var DefaultHeight: Integer); override; + // Draw + procedure DrawButtonLikeControl(const ADrawParams: TdxBarButtonLikeControlDrawParams; ARect: TRect); override; + procedure DrawButtonControlArrow(const ADrawParams: TdxBarButtonLikeControlDrawParams; + R1: TRect); override; + procedure DrawSplitControlArrow(const ADrawParams: TdxBarButtonLikeControlDrawParams; ARect: TRect); override; + procedure DrawAssociateControlArrow(const ADrawParams: TdxBarButtonLikeControlDrawParams; ARect: TRect); override; + + // DropDownListBox + procedure DropDownListBoxDrawBorder(DC: HDC; AColor: TColor; ARect: TRect); override; + + // SubMenuControl + // Conditions + class function SubMenuControlHasBand: Boolean; override; + // Sizes + class function SubMenuControlArrowWidth(ATextSize: Integer): Integer; override; + function SubMenuControlBeginGroupSize: Integer; override; + class function SubMenuControlNCBorderSize: Integer; override; + class function SubMenuControlClientBorderSize: Integer; override; + class function SubMenuControlDetachCaptionAreaSize(ABarSubMenuControl: TdxBarSubMenuControl): Integer; override; + class function SubMenuControlGetBandSize(ABarSubMenuControl: TdxBarSubMenuControl): Integer; override; + class function SubMenuControlNormalItemHeight: Integer; override; + class function SubMenuControlTextIndent: Integer; + class function SubMenuControlInternalBorderSize: Integer; override; + class function SubMenuControlInternalBorderOffset: Integer; override; + class function SubMenuControlTextSize(ACanvas: TcxCanvas): Integer; override; + // Positions + class function SubMenuControlGetItemIconRect(const AItemRect: TRect; AIconAreaSize: Integer): TRect; override; + class function SubMenuControlGetItemTextIndent(const ADrawParams: TdxBarItemControlDrawParams): Integer; override; + // Draw + procedure SubMenuControlDrawScrollBandBackground(ABarSubMenuControl: TdxBarSubMenuControl; ACanvas: TcxCanvas; AArrowDirection: TcxArrowDirection); override; + procedure SubMenuControlDrawScrollButton(ABarSubMenuControl: TdxBarSubMenuControl; ACanvas: TcxCanvas; AArrowDirection: TcxArrowDirection); override; + procedure SubMenuControlDrawBackground(ABarSubMenuControl: TdxBarSubMenuControl; + ACanvas: TcxCanvas; ARect: TRect; ABrush: HBRUSH; AColor: TColor); override; + procedure SubMenuControlDrawBeginGroup(ABarSubMenuControl: TdxBarSubMenuControl; + AControl: TdxBarItemControl; ACanvas: TcxCanvas; const ABeginGroupRect: TRect); override; + procedure SubMenuControlDrawSeparator(ACanvas: TcxCanvas; const ARect: TRect); override; + procedure SubMenuControlDrawBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); override; + procedure SubMenuControlDrawClientBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; const R: TRect; ABrush: HBRUSH); override; + procedure SubMenuControlDrawDetachCaption(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); override; + procedure SubMenuControlDrawItemBackground(ABarSubMenuControl: TdxBarSubMenuControl; + ACanvas: TcxCanvas; AItemRect: TRect); + + // ApplicationMenu + // Sizes + function ApplicationMenuGetFrameSizes: TRect; override; + // Draw + procedure ApplicationMenuDrawBorder(ABarSubMenuControl: TdxBarSubMenuControl; DC: HDC; const ARect: TRect); override; + procedure ApplicationMenuDrawButton(const ADrawParams: TdxBarApplicationMenuButtonControlDrawParams; var R: TRect); override; + procedure ApplicationMenuDrawContentArea(ABarSubMenuControl: TdxBarSubMenuControl; + ACanvas: TcxCanvas; const AContentRect, AItemsArea: TRect); override; + + // ExtraMenuControl + procedure ExtraMenuControlDrawBackground(AExtraMenuControl: TCustomdxBarControl; + ACanvas: TcxCanvas; ARect: TRect; ABrush: HBRUSH; AColor: TColor); override; + procedure ExtraMenuControlDrawBeginGroup(AExtraMenuControl: TCustomdxBarControl; + ACanvas: TcxCanvas; ABeginGroupRect: TRect; AToolbarBrush: HBRUSH; AHorz: Boolean); override; + procedure ExtraMenuControlDrawItemBackground(AExtraMenuControl: TCustomdxBarControl; + ACanvas: TcxCanvas; AItemRect: TRect); + // EditButton + // Conditions + function EditButtonAllowOffsetContent: Boolean; override; + function EditButtonAllowCompositeFrame: Boolean; override; + class function EditButtonAllowHotTrack(const ADrawParams: TdxBarItemControlDrawParams): Boolean; override; + function EditButtonIsCustomBorder: Boolean; override; + function EditButtonIsCustomBackground(AState: Integer): Boolean; override; + // Sizes + procedure EditButtonCorrectDefaultWidth(var ADefaultWidth: Integer); override; + // Draw + procedure EditButtonDrawBackground(const ADrawParams: TdxBarEditLikeControlDrawParams; AState: Integer; + ARect: TRect; ABrush: HBrush); override; + procedure EditButtonDrawBorder(const ADrawParams: TdxBarItemControlDrawParams; + AState: Integer; var ADrawRect: TRect; out AContentRect: TRect); override; + + // EditControl + class function EditControlCaptionBackgroundIsOpaque(const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; override; + class function EditControlCaptionRightIndentIsOpaque(const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; override; + procedure EditControlDrawBorder(const ADrawParams: TdxBarEditLikeControlDrawParams; var ARect: TRect); override; + procedure EditControlDrawSelectionFrame(const ADrawParams: TdxBarEditLikeControlDrawParams; const ARect: TRect); override; + procedure EditControlDrawBackground(const ADrawParams: TdxBarEditLikeControlDrawParams); override; + procedure EditGetRealLookAndFeel(ABarManager: TdxBarManager; ALookAndFeel: TcxLookAndFeel); override; + function EditGetBkColor(const ADrawParams: TdxBarEditLikeControlDrawParams): COLORREF; override; + class function EditControlShowIconDefault(const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; override; + + // ComboControl + // Sizes + class function ComboControlArrowOffset: Integer; override; + class function ComboControlButtonOffsets(APaintType: TdxBarPaintType): TRect; override; + // Draw + procedure ComboControlDrawArrowButton(const ADrawParams: TdxBarEditLikeControlDrawParams; + ARect: TRect; AInClientArea: Boolean); override; + + // ColorCombo + // Conditions + function ColorComboHasCompleteFrame: Boolean; override; + // Sizes + function GetCustomColorButtonWidth(APaintType: TdxBarPaintType; const ARect: TRect): Integer; override; + function GetCustomColorButtonIndents(APaintType: TdxBarPaintType): TRect; override; + // Draw + procedure ColorComboDrawCustomButton(const ADrawParams: TdxBarColorComboControlDrawParams; ARect: TRect); override; + procedure ColorComboDrawCustomButtonAdjacentZone(const ADrawParams: TdxBarColorComboControlDrawParams; ARect: TRect); override; + + // DateNavigator + function DateNavigatorHeaderColor: TColor; override; + // InPlaceSubItemControl + //Sizes + class function InPlaceSubItemGetArrowWidth(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams): Integer; override; + //Draw + procedure InPlaceSubItemControlDrawArrow(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams; + ADirection: TcxArrowDirection; ARect: TRect); override; + procedure InPlaceSubItemControlDrawBackground(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams; ARect: TRect); override; + // ProgressControl + procedure ProgressControlDrawBackground(const ADrawParams: TdxBarItemControlDrawParams; var R: TRect); override; + procedure ProgressControlFillContent(const ADrawParams: TdxBarItemControlDrawParams; const R: TRect; ABarBrush: HBRUSH); override; + procedure ProgressControlFillDiscreteContent(const ADrawParams: TdxBarItemControlDrawParams; const R: TRect; ABarBrush: HBRUSH); override; + // SpinEditControl + function GetSpinEditArrowPos(const ADrawParams: TdxBarSpinEditDrawParams; ARect: TRect; AButtonIndex: Integer): TPoint; override; + procedure SpinEditCorrectFrameRect(const ADrawParams: TdxBarItemControlDrawParams; var ARect: TRect); override; + function GetSpinEditArrowSize(AHeight: Integer): TSize; override; + function GetSpinEditButtonBounds(const ADrawParams: TdxBarSpinEditDrawParams; const ARect: TRect; AButton: TdxBarSpinEditButton): TRect; override; + procedure SpinEditControlDrawButton(const ADrawParams: TdxBarSpinEditDrawParams; ARect: TRect; AButtonIndex: Integer); override; + procedure SpinEditControlDrawButtonsAdjacentZone(const ADrawParams: TdxBarSpinEditDrawParams; const ARect: TRect); override; + procedure SpinEditControlDrawButtonsExternalFrame(const ADrawParams: TdxBarSpinEditDrawParams; ARect: TRect); + function GetSpinEditButtonIndents(APaintType: TdxBarPaintType): TRect; override; + function GetSpinEditButtonWidth(APaintType: TdxBarPaintType; const ARect: TRect): Integer; override; + // Static + procedure DrawStaticBorder(const ADrawParams: TdxBarStaticLikeControlDrawParams; var ARect: TRect); override; + class function StaticBackgroundIsOpaque(const ADrawParams: TdxBarItemControlDrawParams): Boolean; override; + // Separator + procedure DrawSeparatorGlyphAndCaption(const ADrawParams: TdxBarSeparatorControlDrawParams; const ARect: TRect); override; + + // ScreenTip + // Draw + procedure ScreenTipDrawBackground(ACanvas: TcxCanvas; ARect: TRect); override; + procedure ScreenTipDrawFooterLine(ACanvas: TcxCanvas; const ARect: TRect); override; + + property Skin: IdxSkin read GetSkin; + property SkinnedObject: TObject read FSkinnedObject; + end; + + TRegItemRecord = class + public + FItemClass: TdxBarItemClass; + FItemControlClass: TdxBarItemControlClass; + FVisible: Boolean; + constructor Create(AItemClass: TdxBarItemClass; AItemControlClass: TdxBarItemControlClass; + AVisible: Boolean); + end; + + TdxBarItemList = class(TList) + private + function GetItem(Index: Integer): TRegItemRecord; + function GetItemClass(Index: Integer): TdxBarItemClass; + function GetVisibleItemCount: Integer; + function GetVisibleItemClass(Index: Integer): TdxBarItemClass; + protected + procedure Register(AItemClass: TdxBarItemClass; + AItemControlClass: TdxBarItemControlClass; AVisible: Boolean); + procedure Unregister(AItemClass: TdxBarItemClass); overload; + procedure Unregister(Index: Integer); overload; + public + destructor Destroy; override; + + property Items[Index: Integer]: TRegItemRecord read GetItem; default; + property ItemClass[Index: Integer]: TdxBarItemClass read GetItemClass; + property VisibleItemCount: Integer read GetVisibleItemCount; + property VisibleItemClass[Index: Integer]: TdxBarItemClass read GetVisibleItemClass; + end; + + TdxBarManagerFormKind = (fkMain, fkMainOrMDIChild, fkAny); + + { TdxCustomQuickCustItemControl } + + TdxCustomQuickCustItemControl = class(TdxBarButtonControl) + protected + procedure DoPaint(ARect: TRect; PaintType: TdxBarPaintType); override; + function GetDefaultWidth: Integer; override; + function IsDowned: Boolean; virtual; abstract; + end; + + { TdxBarQuickCustItem and TdxBarQuickCustItemControl } + + TdxBarQuickCustItem = class(TdxBarButton) + public + procedure DoClick; override; + end; + + TdxBarQuickCustItemControl = class(TdxCustomQuickCustItemControl) + private + function GetLinkedItemLink: TdxBarItemLink; + protected + procedure ControlUnclick(ByMouse: Boolean); override; + function GetCaption: string; override; + function GetGlyph: TBitmap; override; + function GetImageIndex: Integer; override; + function GetImageList(AViewSize: TdxBarItemControlViewSize): TCustomImageList; override; + function GetLargeGlyph: TBitmap; override; + function GetLargeImageIndex: Integer; override; + function IsDowned: Boolean; override; + function GetHint: string; override; + function GetShortCut: TShortCut; override; + function IsDestroyOnClick: Boolean; override; + property LinkedItemLink: TdxBarItemLink read GetLinkedItemLink; + end; + + { TdxBarQuickControl } + + TdxBarQuickControl = class(TdxBarControl) + private + FHidingTimer: TcxTimer; + function GetParentBar: TdxBarControl; + procedure QuickControlTimer(Sender: TObject); + procedure SetParentBar(Value: TdxBarControl); + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + procedure WMNCPaint(var Message: TMessage); message WM_NCPAINT; + procedure WMRButtonDown(var Message: TWMRButtonDown); message WM_RBUTTONDOWN; + protected + function GetParentForm: TCustomForm; override; + function GetSizeForPopup: TSize; override; + function GetToolbarBrush: HBRUSH; override; + function HasCaption: Boolean; override; + function IsLinkedToOwner: Boolean; override; + function IsPopup: Boolean; override; + function LockHotTrackWhenPopup: Boolean; override; + function NeedShowGlyphAndCheckForItem: Boolean; override; + function GetOwnerControl: TWinControl; override; + property ParentBar: TdxBarControl read GetParentBar write SetParentBar; + public + constructor CreateForPopup(AParentBarControl: TdxBarControl; + ABar: TdxBar); override; + destructor Destroy; override; + function Kind: TdxBarKind; override; + procedure Popup(const AOwnerRect: TRect); override; + procedure StartHidingTimer; + end; + + TdxBarKeyTipsShowingState = record + ActiveContainer: IdxBarAccessibilityHelper; + KeyTipsData: TdxObjectList; + TypingString: string; + end; + + { TdxBarNavigationController } + + TdxBarNavigationController = class + private + FHandleKey: Boolean; + FKeyTipsShowingState: TdxBarKeyTipsShowingState; + FKeyTipsWaitingRootObject: IdxBarAccessibilityHelper; + FKeyTipsWaitingTimer: TcxTimer; + FNavigationMode: Boolean; + FSelectedObject: IdxBarAccessibilityHelper; + FSelectedObjectParent: IdxBarAccessibilityHelper; + procedure DestroyKeyTipsWaitingTimer; + function GetActiveBarControl: TCustomdxBarControl; + function GetKeyTipsHandlingMode: Boolean; + function GetSelectedObject: IdxBarAccessibilityHelper; + function GetSelectedObjectParent: IdxBarAccessibilityHelper; + procedure HandleKeyTipKey(AKey: Word); + function IsKeyTipsKey(AKey: Word; out AIsKeyAcceptable: Boolean; + out AKeyTipData: TdxBarKeyTipData): Boolean; overload; + function IsNavigationControllerKey(AKey: Word): Boolean; + procedure KeyTipsEscapeHandler; + procedure KeyTipsWaitingTimerHandler(Sender: TObject); + procedure StopKeyTipsHandlingMode; + protected + procedure ResetNavigationMode; + public + destructor Destroy; override; + procedure BeginKeyTipsWaiting(ARootObject: IdxBarAccessibilityHelper); + procedure ChangeSelectedObject(ASetFocus: Boolean; + ANewSelectedObject: IdxBarAccessibilityHelper; + APrevSelectedObject: IdxBarAccessibilityHelper = nil); + procedure EndKeyTipsWaiting(AShowKeyTipWindows: Boolean); + procedure HandleKey(AKey: Word; + ASelectedObjectParent: IdxBarAccessibilityHelper = nil; + ASelectedObject: IdxBarAccessibilityHelper = nil); + function IsKeyTipsKey(AKey: Word): Boolean; overload; + function IsKeyTipsWaiting: Boolean; + function IsNavigationBarControl(ABarControl: TCustomdxBarControl): Boolean; + function IsNavigationKey(AKey: Word): Boolean; + function NeedsKey(AKey: Word): Boolean; + procedure SelectDefaultObject(ARootObject: IdxBarAccessibilityHelper); + procedure SetKeyTipsShowingState( + AActiveKeyTipContainer: IdxBarAccessibilityHelper; + const AKeyTipsTypingString: string); + procedure StopKeyboardHandling; + procedure UnassignObject(AObject: IdxBarAccessibilityHelper); + procedure UnselectAssignedSelectedObject; + property ActiveKeyTipContainer: IdxBarAccessibilityHelper + read FKeyTipsShowingState.ActiveContainer; // TODO Remove this property + property AssignedSelectedObject: IdxBarAccessibilityHelper read FSelectedObject; + property AssignedSelectedObjectParent: IdxBarAccessibilityHelper + read FSelectedObjectParent; + property KeyTipsHandlingMode: Boolean read GetKeyTipsHandlingMode; + property NavigationMode: Boolean read FNavigationMode; + property SelectedObject: IdxBarAccessibilityHelper read GetSelectedObject + write FSelectedObject; + property SelectedObjectParent: IdxBarAccessibilityHelper + read GetSelectedObjectParent write FSelectedObjectParent; + end; + +procedure BarAccessibilityHelperOwnerObjectDestroyed( + var AIHelper: IdxBarAccessibilityHelper); +function GetAccessibilityHelper(AObject: TObject): IdxBarAccessibilityHelper; +function GetKeyTipContainerParent( + AContainer: IdxBarAccessibilityHelper): IdxBarAccessibilityHelper; +function GetNextAccessibleObject(ASelectedObject: TdxBarAccessibilityHelper; + AObjects: TList; ADirection: TcxAccessibilityNavigationDirection; + ACycleHorizontally: Boolean): TdxBarAccessibilityHelper; +function GetRootAccessibleObject(AParentWnd: HWND): IdxBarAccessibilityHelper; + +function BarDesignController: TdxBarDesignController; +function BarCanvas: TdxBarCanvas; +function BarNavigationController: TdxBarNavigationController; +function BarSystemController: TdxBarSystemController; +function RegdxItemList: TdxBarItemList; +procedure dxBarRegisterItem(AItemClass: TdxBarItemClass; + AItemControlClass: TdxBarItemControlClass; AVisible: Boolean); +procedure dxBarUnregisterItem(AItemClass: TdxBarItemClass); +procedure dxBarDesignerModified(ABarManager: TdxBarManager); +function dxBarCreateScreenTipViewInfo(ABarManager: TdxBarManager; AHintText: string; const AShortCut: string; AScreenTip: TdxBarScreenTip; + APainter: TdxBarPainter): TdxBarCustomHintViewInfo; +function dxBarFlatPainter: TdxBarFlatPainter; + +function ActiveBarControl: TCustomdxBarControl; +function BarGetMouseWheelReceiver: TdxBarMouseWheelEventReceiver; +function VisibleTodxBarVisible(Value: Boolean): TdxBarItemVisible; +function GetBarControlClass(AToolbar: TdxBar): TdxBarControlClass; +function GetBarManagerByComponent(AComponent: TComponent): TdxBarManager; +function GetBarManagerByForm(AForm: TCustomForm): TdxBarManager; +function GetBarManagerForComponent(AComponent: TComponent): TdxBarManager; +function GetParentBarForBar(Value: TCustomdxBarControl): TCustomdxBarControl; + +function GetAccelPos(var AText: string; AModifyString: Boolean = False): Integer; +function GetWorkArea(const P: TPoint): TRect; +function GetTextOf(const S: string): string; +procedure DrawItemArrow(DC: HDC; R: TRect; ArrowType: TcxArrowDirection; + Enabled, Selected, Flat: Boolean; AColor: TColor = clDefault); overload; +procedure DrawItemArrow(ADC: HDC; R: TRect; ADownArrow, AEnabled, ASelected, AFlat: Boolean; AColor: TColor = clDefault); overload; +procedure DrawLargeItemArrow(DC: HDC; R: TRect; ArrowType: TcxArrowDirection; + Size: Integer; Selected, Enabled, Flat: Boolean; AColor: TColor = clDefault); overload; +procedure DrawLargeItemArrow(ADC: HDC; R: TRect; ADownArrow: Boolean; + ASize: Integer; ASelected, AEnabled, AFlat: Boolean; AColor: TColor = clDefault); overload; +procedure FrameFlatSelRect(DC: HDC; const R: TRect); +procedure DrawVerticalGradient(Canvas: TCanvas; const ARect: TRect; + FromR, ToR, FromG, ToG, FromB, ToB: Byte); +procedure TransparentDraw(DrawDC: HDC; const R: TRect; AGlyph: TBitmap; AEnabled: Boolean = True); overload; +procedure TransparentDraw(DrawDC: HDC; Brush: HBRUSH; const FullRect, R: TRect; AGlyph: TBitmap; + AImages: TCustomImageList; AImageIndex: Integer; AImageListBkColor: TColor; + AEnabled, AGrayScale, AFlat, ASelected, ADown, APressed, AShadow, AFaded: Boolean; + ASmoothImage: Boolean = False; AUseLeftBottomPixelAsTransparent: Boolean = True); overload; +procedure TransparentDraw(ABarItemControl: TdxBarItemControl; + DrawDC: HDC; Brush: HBRUSH; const FullRect, R: TRect; AGlyph: TBitmap; + AImages: TCustomImageList; AImageIndex: Integer; AImageListBkColor: TColor; + AEnabled, AGrayScale, AFlat, ASelected, ADown, APressed, AShadow, AFaded: Boolean; + ASmoothImage: Boolean = False; AUseLeftBottomPixelAsTransparent: Boolean = True); overload; + +function CloneFont(Source: HFONT): HFONT; +procedure FillRectByBitmap(DC: HDC; ADestR, ASourceR: TRect; ABitmap: TBitmap); +procedure RestoreClipRgn(DC: HDC; var AClipRgn: HRGN; var AClipRgnExists: Boolean); +procedure SaveClipRgn(DC: HDC; var AClipRgn: HRGN; var AClipRgnExists: Boolean); + +procedure AfterDrawBackground(ADC: HDC; APrevWindowOrg: TPoint); +function BeforeDrawBackground(ASourceControl, ADestinationControl: TWinControl; + ADC: HDC; var ARect: TRect; out APrevWindowOrg: TPoint): TPoint; + +procedure ProcessMouseMessages; +procedure ProcessPaintMessages; + +function LeftButtonPressed: Boolean; +function RightButtonPressed: Boolean; + +function IsAncestorComponentDifferencesDetection(AComponent: TComponent): Boolean; +function IsApplicationActive: Boolean; +function IsFormActive(AForm: TCustomForm): Boolean; +function GetParentPopupWindow(AControl: TWinControl; ACheckParentBars: Boolean): TcxCustomPopupWindow; +procedure dxFreeAndNil(var AObject); +function dxKillTimer(AWindowHandle: HWND; var ATimerID: DWORD): Boolean; +function dxBarMessageBox(AText: string; AFlags: Integer): Integer; +procedure dxBarFrameRect(ADC: HDC; ARect: TRect; AColor: Integer); +procedure dxBarFocusRect(ADC: HDC; ARect: TRect); +procedure dxSetZOrder(AHandle: THandle; AWndAfter: DWORD = HWND_TOPMOST; AActivate: Boolean = False; AFlags: DWORD = 0); +function HasAsParent(Wnd: HWND; ParentWnd: HWND): Boolean; +function HasPopupWindowAbove(ABarControl: TCustomdxBarControl; + AIgnoreSelectedControl: Boolean): Boolean; + +function IsSelectableItem(AObject: TObject): Boolean; overload; +function IsSelectableItem(AObject: TObject; + out ASelectableItem: IdxBarSelectableItem): Boolean; overload; +function GetSelectableItem(AObject: TObject): IdxBarSelectableItem; +procedure CleanSelectableItems(AItems: TdxObjectList); + +function GetMaxViewLevel(AViewLevels: TdxBarItemViewLevels): TdxBarItemRealViewLevel; +function GetMinViewLevel(AViewLevels: TdxBarItemViewLevels): TdxBarItemRealViewLevel; +function GetNextViewLevel(AViewLevels: TdxBarItemViewLevels; + AViewLevel: TdxBarItemRealViewLevel): TdxBarItemRealViewLevel; +function WidthToCurrentDpi(AValue: Integer; ANormalDpi: Integer = 96): Integer; +procedure BarDrawSizeGrip(DC: HDC; R: TRect); +procedure SetLayeredWndAttributes(AHandle: HWND; AAlphaBlendValue: Integer); + +type + TdxBarGetRootAccessibleObjectFunc = function(AParentWnd: HWND): IdxBarAccessibilityHelper; + +var + FOnRegisterBarManager: TcxNotifyProcedure; + FOnUnregisterBarManager: TcxNotifyProcedure; + dxBarHintKeeper: IdxBarHintKeeper; + dxBarHintWindowClass: TdxBarHintWindowClass = TdxBarHintWindow; + dxBarManagerList: TdxBarManagerList; + PatternBrush: HBRUSH; + dxBarMakeInactiveImagesDingy: Boolean = True; + dxBarPlaySound: Boolean = True; + FHintWindow: TdxBarHintWindow; + dxBarGetRootAccessibleObject: TdxBarGetRootAccessibleObjectFunc; + dxBarSkinPainterClass: TdxBarPainterClass = TdxBarStandardPainter; + +const + dxBarManagerTempCategoryIndex = -1000; + dxBarCustomizingPopupPaintStyleGroupIndex = -1000; + + dxBarNonrecentlyUsedItemsColorDelta: Integer = 20; + dxBarFlatToolbarsColorDelta: Integer = 20; + + dxBarWaitForSubMenuTime: Integer = 400; + + // TdxBarItemControl + icpNone = -1; + icpNonClient = 100; + icpControl = 0; + // TdxBarEditControlPart + ecpEdit = 0; + ecpIcon = 1; + ecpText = 2; + ecpHeaderParts = [ecpIcon, ecpText, icpNonClient]; + // TdxBarComboControlPart + ccpDropButton = 3; + // TdxBarColorComboControl + clcpCustomColorButton = 4; + // TdxBarButtonControlPart + bcpButton = 0; + bcpDropButton = 1; + //TdxBarSpinEditControl + secButtonUp = 3; + secButtonDown = 4; + //ScreenTips + dxBarScreenTipFontColor: TColor = $4C4C4C; + +implementation + +{$R dxBar.res} + +uses + CommCtrl, MMSystem, Registry, Math, + dxBarCustForm, dxBarPopupMenuEd, + dxBarStrs, dxBarCommon, dxUxTheme, dxThemeConsts, dxOffice11, dxBarNameEd, + cxGeometry, dxBarSkinConsts, dxBarAccessibility, cxDWMApi; + +const +{$IFNDEF DELPHI6} + WS_EX_LAYERED = $00080000; + AC_SRC_ALPHA = $01; + LWA_ALPHA = $00000002; +{$ENDIF} + + MAPVK_VK_TO_VSC = 0; + MAPVK_VSC_TO_VK = 1; + MAPVK_VK_TO_CHAR = 2; + MAPVK_VSC_TO_VK_EX = 3; + + dxBarButtonBorderWidth = 7; + dxBarButtonBorderHeight = 6; + + dxBarEmptySubMenuControlContentWidth = 100; + + dxBarFingerSize = 3; + dxBarHorSize = 4; + dxBarTopSize = 2; + dxBarBottomSize = 1; + dxBarFlatBorderSize = 3; + + dxBarFloatToolbarMinWidth = 51; + + DefautGlyphSize = 16; + InsertZone = 10; + MarkSizeArrowY = 4; + MarkSizeArrowX = 2 * MarkSizeArrowY - 1; + MakeBeginGroupDragSize = 4; + MinToolbarSize = 2 + 19 + 2; + FloatToolbarMarkIndent = 1; + MenuSeparatorSize = 2; + + HintOffset = 20; + + MinEditWidth = 20; + EditSizingZoneSize = 7; + + MinDockSize = 3; + DetachAreaDelta = 15; + + dxBarWaitForShowHintTime = 1000; + dxBarWaitForHideHintTime = 10000; + dxBarHiddedHintLifeTime = 400; + dxBarScrollMenuTime = 80; + dxBarSmoothScrollMenuTime = dxBarScrollMenuTime + 120; + dxBarSlowExpandMenuTime = 4000; + dxBarWaitForKeyTipsTime = 500; + + dxBarExtraPaneHeader = 'Recent Documents'; + dxBarExtraPaneWidthRatio = 2.5; + + MDIButtonStyles: array[TdxBarMDIButton] of Integer = + (DFCS_CAPTIONMIN, DFCS_CAPTIONRESTORE, DFCS_CAPTIONCLOSE); + + ListItemSeparator = '-'; + + DefaultViewParams: TcxViewParams = ( + Bitmap: nil; + Color: clDefault; + Font: nil; + TextColor: clDefault + ); + +type + PBoolean = ^Boolean; + TStringArray = array of string; + + TControlAccess = class(TControl); + TCustomFormAccess = class(TCustomForm); + TReaderAccess = class(TReader); + TdxBarXPPainterParams = record + BarBeginGroupSize: Integer; + BarCloseButtonSize: TSize; + ButtonBorderHeight: Integer; + ComboBoxArrowWidth: Integer; + EditControlBorderOffsets: TRect; + GripperSize: Integer; + ProgressControlBarHeight: Integer; + SubMenuControlBeginGroupSize: Integer; + StatusBarGripSize: TSize; + end; + +var + FdxBarIsFinalized: Boolean; + IsWin95, IsWin95Or98, IsWin98Or2000: Boolean; + FApplicationActive: Boolean = True; + FApplicationDeactivation: Boolean; + FMergingWith: TdxBar; + FUser32DLL: HMODULE; + FdxBarXPPainterParams: TdxBarXPPainterParams; + + UpdateLayeredWindow: function(Handle: THandle; hdcDest: HDC; + pptDst: PPoint; _psize: PSize; hdcSrc: HDC; pptSrc: PPoint; crKey: COLORREF; + pblend: PBLENDFUNCTION; dwFlags: DWORD): Boolean; stdcall; + + FBarCanvas: TdxBarCanvas; + FBarControls: TList; + FBarDesignController: TdxBarDesignController; + FBarFlatPainter: TdxBarFlatPainter; + FBarNavigationController: TdxBarNavigationController; + FBarSystemController: TdxBarSystemController; + FRegdxItemList: TdxBarItemList; + + FActiveBarControl: TCustomdxBarControl; + + FIsMDIButtonPressed, FIsMouseOverMDIButton: Boolean; + FPressedMDIButton, FSelectedMDIButton: TdxBarMDIButton; + + ResettingToolbar: Boolean; + + ShowFullMenus: Boolean; + + BitsPerPixel: Integer; + +{ blending } + +type + TAnimateWindowProc = function(hWnd: HWND; dwTime: DWORD; dwFlags: DWORD): BOOL; stdcall; + TSetLayeredWindowAttributes = function (Hwnd: THandle; crKey: COLORREF; bAlpha: Byte; dwFlags: DWORD): Boolean; stdcall; + +var + AnimateWindowProc: TAnimateWindowProc = nil; + SetLayeredWindowAttributes: TSetLayeredWindowAttributes = nil; + +function GetBarManagerByHandle(AWnd: HWND): TdxBarManager; forward; + +procedure BarAccessibilityHelperOwnerObjectDestroyed( + var AIHelper: IdxBarAccessibilityHelper); +begin + if AIHelper <> nil then + AIHelper.OwnerObjectDestroyed; + AIHelper := nil; +end; + +function GetAccessibilityHelper(AObject: TObject): IdxBarAccessibilityHelper; +begin + Supports(AObject, IdxBarAccessibilityHelper, Result); +end; + +function GetKeyTipContainerParent( + AContainer: IdxBarAccessibilityHelper): IdxBarAccessibilityHelper; +var + AParentObject: TdxBarAccessibilityHelper; +begin + Result := nil; + AParentObject := AContainer.GetBarHelper; + if AParentObject.ParentForKeyTip = nil then + Exit; + repeat + AParentObject := AParentObject.ParentForKeyTip; + until AParentObject.IsKeyTipContainer or (AParentObject.ParentForKeyTip = nil); + Result := AParentObject; +end; + +function GetNextAccessibleObject(ASelectedObject: TdxBarAccessibilityHelper; + AObjects: TList; ADirection: TcxAccessibilityNavigationDirection; + ACycleHorizontally: Boolean): TdxBarAccessibilityHelper; + + procedure CalcRectCenter(const R: TRect; out X, Y: Extended); + begin + X := R.Left + (R.Right - R.Left) / 2; + Y := R.Top + (R.Bottom - R.Top) / 2; + end; + + procedure CalcDistance(const R1, R2: TRect; out AAngle, ADistance: Extended); + var + AAngle1, AAngle2, X1, X2, Y1, Y2: Extended; + begin + CalcRectCenter(R1, X1, Y1); + CalcRectCenter(R2, X2, Y2); + + AAngle1 := RadToDeg(ArcTan2(Y2 - Y1, X2 - X1)); + if AAngle1 < 0 then + AAngle1 := AAngle1 + 360; + case ADirection of + andLeft: + AAngle1 := AAngle1 - 180; + andUp: + AAngle1 := AAngle1 - 270; + andDown: + AAngle1 := AAngle1 - 90; + end; + if AAngle1 < 0 then + AAngle2 := AAngle1 + 360 + else + AAngle2 := AAngle1 - 360; + if AAngle1 < 0 then + AAngle1 := -AAngle1; + if AAngle2 < 0 then + AAngle2 := -AAngle2; + AAngle := Min(AAngle1, AAngle2); + + case ADirection of + andLeft: + ADistance := R1.Left - R2.Right; + andUp: + ADistance := R1.Top - R2.Bottom; + andRight: + ADistance := R2.Left - R1.Right; + andDown: + ADistance := R2.Top - R1.Bottom; + end; + end; + +var + AAngle, ADistance, AMinAngle, AMinDistance: Extended; + ANearestObject: TdxBarAccessibilityHelper; + I: Integer; + R, R1, R2: TRect; +begin + if ADirection in [andPrev, andNext] then + begin + Result := nil; // TODO + Exit; + end; + + AMinAngle := 0; + AMinDistance := 0; + ANearestObject := nil; + R1 := ASelectedObject.GetScreenBounds(cxAccessibleObjectSelfID); + + for I := 0 to AObjects.Count - 1 do + begin + R := TdxBarAccessibilityHelper(AObjects[I]).GetScreenBounds(cxAccessibleObjectSelfID); + CalcDistance(R1, R, AAngle, ADistance); + if (ADistance >= 0) and ((ANearestObject = nil) or (ADistance < AMinDistance) or (ADistance = AMinDistance) and (AAngle < AMinAngle)) then + begin + ANearestObject := TdxBarAccessibilityHelper(AObjects[I]); + AMinAngle := AAngle; + AMinDistance := ADistance; + end; + end; + + if (ANearestObject = nil) and (ADirection in [andLeft, andRight]) and ACycleHorizontally then + begin + R2 := R1; + case ADirection of + andLeft: + begin + OffsetRect(R2, -R2.Right, 0); + OffsetRect(R2, MaxInt div 2, 0); + end; + andRight: + begin + OffsetRect(R2, -R2.Left, 0); + OffsetRect(R2, -MaxInt div 2, 0); + end; + end; + for I := 0 to AObjects.Count - 1 do + begin + R := TdxBarAccessibilityHelper(AObjects[I]).GetScreenBounds(cxAccessibleObjectSelfID); + CalcDistance(R2, R, AAngle, ADistance); + if (ADistance >= 0) and ((ANearestObject = nil) or (ADistance < AMinDistance) or (ADistance = AMinDistance) and (AAngle < AMinAngle)) then + begin + ANearestObject := TdxBarAccessibilityHelper(AObjects[I]); + AMinAngle := AAngle; + AMinDistance := ADistance; + end; + end; + end; + + if ANearestObject <> nil then + Result := ANearestObject + else + Result := nil; +end; + +function GetRootAccessibleObject(AParentWnd: HWND): IdxBarAccessibilityHelper; +var + ABarManager: TdxBarManager; +begin + Result := nil; + if Assigned(dxBarGetRootAccessibleObject) then + Result := dxBarGetRootAccessibleObject(AParentWnd); + if Result = nil then + begin + ABarManager := GetBarManagerByHandle(AParentWnd); + if (ABarManager <> nil) and (ABarManager.MainMenuControl <> nil) then + Result := ABarManager.MainMenuControl.IAccessibilityHelper; + end; +end; + +procedure HandleKeyTipsEscape(AActiveKeyTipContainer: IdxBarAccessibilityHelper); +begin + AActiveKeyTipContainer.GetBarHelper.KeyTipsEscapeHandler; +end; + +function GetLinksOwner(AObject: TObject): IdxBarLinksOwner; +begin + Supports(AObject, IdxBarLinksOwner, Result); +end; + +procedure dxSetZOrder(AHandle: THandle; AWndAfter: DWORD; AActivate: Boolean; AFlags: DWORD); +const + AActivateMap: array[Boolean] of Byte = (SWP_NOACTIVATE, 0); +begin + SetWindowPos(AHandle, AWndAfter, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or AActivateMap[AActivate] or AFlags); +end; + +function FormStyle(AForm: TCustomForm): TFormStyle; +begin + Result := TCustomFormAccess(AForm).FormStyle; +end; + +function GetChildWindowVCLParent(AWnd: HWND): TWinControl; +begin + Result := nil; + while (Result = nil) and (AWnd <> 0) and IsChildClassWindow(AWnd) do + begin + AWnd := GetParent(AWnd); + Result := FindControl(AWnd); + end; +end; + +function IsMDIChild(AForm: TCustomForm): Boolean; +begin + Result := (AForm <> nil) and not (csDesigning in AForm.ComponentState) and + (FormStyle(AForm) = fsMDIChild); +end; + +function IsMDIForm(AForm: TCustomForm): Boolean; +begin + Result := (AForm <> nil) and not (csDesigning in AForm.ComponentState) and + (FormStyle(AForm) = fsMDIForm); +end; + +function IsFormActive(AForm: TCustomForm): Boolean; + + function IsWindowActive(AWindowHandle: HWND): Boolean; + begin + Result := AWindowHandle = GetActiveWindow; + end; + + function IsMDIChildActive(AForm: TCustomForm): Boolean; + begin + Result := IsMDIChild(AForm) and IsWindowActive(Application.MainForm.Handle) and (Application.MainForm.ActiveMDIChild = AForm); + end; + + function IsParentActive(AForm: TCustomForm): Boolean; + begin + Result := not IsMDIChild(AForm) and IsWindowActive(FindFirstNonChildParentWindow(AForm.Handle)); + end; + +begin + Result := (AForm <> nil) and AForm.HandleAllocated and + (IsWindowActive(AForm.Handle) or IsMDIChildActive(AForm) or IsParentActive(AForm)); +end; + +function IsAncestorComponentDifferencesDetection(AComponent: TComponent): Boolean; +begin + Result := (AComponent.ComponentState * [csLoading, csReading, csAncestor] = + [csLoading, csAncestor]); +end; + +function IsTextCharForKeyTip(AKey: Word): Boolean; +var + ARes: UINT; +begin + ARes := MapVirtualKey(AKey, MAPVK_VK_TO_CHAR); + Result := ((ARes and $FFFF0000) = 0) and (Char(ARes) <> ' ') and + IsTextChar(Char(ARes)); +end; + +function IsParentFocused(AParent: THandle): Boolean; +begin + Result := (AParent <> 0) and ((AParent = GetFocus) or IsChildClassWindow(AParent) and IsParentFocused(GetParent(AParent))); +end; + +function IsWindowEnabled(AWindowHandle: HWND): Boolean; +begin + Result := Windows.IsWindowEnabled(AWindowHandle); + if IsChildClassWindow(AWindowHandle) then + Result := Result and dxBar.IsWindowEnabled(GetParent(AWindowHandle)) +end; + +function IsControlVisible(AControl: TWinControl): Boolean; +begin + Result := (AControl <> nil) and AControl.HandleAllocated and IsWindowVisible(AControl.Handle); +end; + +function BarNavigationController: TdxBarNavigationController; +begin + Result := FBarNavigationController; +end; + +function BarSystemController: TdxBarSystemController; +begin + Result := FBarSystemController; +end; + +procedure SendCancelMode; +var + AActiveControl: TWinControl; +begin + AActiveControl := FindControl(GetActiveWindow); + if AActiveControl is TCustomForm then + TCustomForm(AActiveControl).SendCancelMode(nil); +end; + +procedure SetActiveWindow(AWindowHandle: HWND); +begin + Windows.SetActiveWindow(FindFirstNonChildParentWindow(AWindowHandle)); +end; + +// null reference routines +procedure RepaintItemControl(AItemControl: TdxBarItemControl); overload; +begin + if AItemControl <> nil then + AItemControl.Repaint; +end; + +procedure RepaintItemControl(AItemLink: TdxBarItemLink); overload; +begin + if AItemLink <> nil then + RepaintItemControl(AItemLink.Control); +end; + +function GetControlByLink(AItemLink: TdxBarItemLink): TdxBarItemControl; +begin + if AItemLink <> nil then + Result := AItemLink.Control + else + Result := nil; +end; + +function GetLinkByControl(AItemControl: TdxBarItemControl): TdxBarItemLink; +begin + if AItemControl <> nil then + Result := AItemControl.ItemLink + else + Result := nil; +end; + +function GetItemByControl(AItemControl: TdxBarItemControl): TdxBarItem; +begin + if AItemControl <> nil then + Result := AItemControl.Item + else + Result := nil; +end; + +function GetItemByLink(AItemLink: TdxBarItemLink): TdxBarItem; +begin + if AItemLink <> nil then + Result := AItemLink.Item + else + Result := nil; +end; + +function GetObjectByObjectLink(AObjectLink: TcxObjectLink): TObject; +begin + if AObjectLink <> nil then + Result := AObjectLink.Ref + else + Result := nil; +end; + +function GetOwnedLinks(AObject: TObject): TdxBarItemLinks; +begin + if GetLinksOwner(AObject) <> nil then + Result := GetLinksOwner(AObject).GetItemLinks + else + Result := nil; +end; + +function GetActiveForm: TCustomForm; +var + AControl: TWinControl; +begin + Result := nil; + AControl := FindControl(GetActiveWindow); + if (AControl is TCustomForm) and IsWindowEnabled(AControl.Handle) then + begin + Result := TCustomForm(AControl); + if IsMDIForm(Result) and (TCustomFormAccess(Result).ActiveMDIChild <> nil) then + Result := TCustomFormAccess(Result).ActiveMDIChild; + end; +end; + +function GetInstance(ASelectedItem: IdxBarSelectableItem): TPersistent; +begin + if ASelectedItem <> nil then + Result := ASelectedItem.GetInstance + else + Result := nil; +end; + +function GetSubItemButtonByButtonCaption(ASubItem: TdxBarSubItem; + const ACaption: string): TdxBarButton; +var + I: Integer; +begin + Result := nil; + for I := 0 to ASubItem.ItemLinks.Count - 1 do + if TdxBarButton(ASubItem.ItemLinks[I].Item).Caption = ACaption then + Result := TdxBarButton(ASubItem.ItemLinks[I].Item); +end; + +function IsMouseDownMessage(AMsg: Cardinal): Boolean; +begin + Result := + (AMsg = WM_LBUTTONDOWN) or (AMsg = WM_LBUTTONDBLCLK) or + (AMsg = WM_RBUTTONDOWN) or (AMsg = WM_RBUTTONDBLCLK) or + (AMsg = WM_MBUTTONDOWN) or (AMsg = WM_MBUTTONDBLCLK) or + (AMsg = WM_NCLBUTTONDOWN) or (AMsg = WM_NCLBUTTONDBLCLK) or + (AMsg = WM_NCRBUTTONDOWN) or (AMsg = WM_NCRBUTTONDBLCLK) or + (AMsg = WM_NCMBUTTONDOWN) or (AMsg = WM_NCMBUTTONDBLCLK); +end; + +procedure KillBeep(AWnd: HWND); +begin + KillMessages(AWnd, WM_CHAR, WM_CHAR); +end; + +function GetBarControlClass(AToolbar: TdxBar): TdxBarControlClass; +begin + if AToolbar.Control <> nil then + Result := TdxBarControlClass(AToolbar.Control.ClassType) + else + Result := AToolbar.GetControlClass; +end; + +function GetBarManagerByComponent(AComponent: TComponent): TdxBarManager; +var + I: Integer; +begin + Result := nil; + + if AComponent is TdxBarManager then + Result := TdxBarManager(AComponent) + else + begin + if (AComponent is TCustomForm) and (TCustomForm(AComponent).Parent = nil) then + begin + if Assigned(cxControls.cxGetParentFormForDocking) then + AComponent := cxControls.cxGetParentFormForDocking(TCustomForm(AComponent)); + end; + + if (AComponent <> nil) and (dxBarManagerList <> nil) then + for I := 0 to dxBarManagerList.Count - 1 do + if dxBarManagerList[I].Owner = AComponent then + begin + Result := dxBarManagerList[I]; + Break; + end; + end; +end; + +function GetBarManagerByForm(AForm: TCustomForm): TdxBarManager; +begin + Result := GetBarManagerByComponent(AForm); +end; + +function GetWinControlOwner(AComponent: TComponent): TWinControl; +begin + while (AComponent <> nil) and not (AComponent is TWinControl) do + AComponent := AComponent.Owner; + Result := TWinControl(AComponent) +end; + +function GetBarManagerForComponent(AComponent: TComponent): TdxBarManager; +var + AControl: TWinControl; +begin + Result := nil; + AControl := GetWinControlOwner(AComponent); + if (AControl <> nil) and AControl.HandleAllocated then + repeat + Result := GetBarManagerByComponent(AControl); + AControl := GetChildWindowVCLParent(AControl.Handle); + until (Result <> nil) or (AControl = nil); +end; + +function GetControlForm(AControl: TWinControl; + AFormKind: TdxBarManagerFormKind): TCustomForm; + + function CheckForm(AForm: TCustomForm): Boolean; + begin + Result := (AForm <> nil) and ((AFormKind = fkAny) or + (AFormKind = fkMainOrMDIChild) and IsMDIChild(AForm)); + end; + +var + AWnd: HWND; + ACurrentForm: TCustomForm; +begin + Result := nil; + if not CanAllocateHandle(AControl) then + Exit; + AWnd := AControl.Handle; + while AWnd <> 0 do + begin + if FindControl(AWnd) is TCustomForm then + begin + ACurrentForm := TCustomForm(FindControl(AWnd)); + Result := ACurrentForm; + end + else + ACurrentForm := nil; + if not IsChildClassWindow(AWnd) or CheckForm(ACurrentForm) then + Break; + AWnd := GetParent(AWnd); + end; +end; + +function GetComponentForm(AComponent: TComponent): TCustomForm; +var + AControl: TWinControl; +begin + AControl := GetWinControlOwner(AComponent); + if AControl <> nil then + Result := GetControlForm(AControl, fkAny) + else + Result := nil; +end; + +function GetBarManagerForm(ABarManager: TdxBarManager; + AFormKind: TdxBarManagerFormKind): TCustomForm; +begin + Result := GetControlForm(ABarManager.Owner, AFormKind); +end; + +function IsBarManagerOwner(ABarManager: TdxBarManager; + AOwnerHandle: HWND): Boolean; +var + AWnd: HWND; +begin + Result := False; + if ABarManager.Owner.HandleAllocated then + begin + AWnd := ABarManager.Owner.Handle; + while (AWnd <> AOwnerHandle) and IsChildClassWindow(AWnd) do + AWnd := GetParent(AWnd); + Result := AWnd = AOwnerHandle; + end; +end; + +function GetWinControl(AControl: TControl): TWinControl; +begin + if AControl is TWinControl then + Result := TWinControl(AControl) + else + Result := AControl.Parent; +end; + +function IsChildControl(AParentControl: TWinControl; AChildWnd: THandle): Boolean; overload; +begin + Result := AParentControl.HandleAllocated and IsChildEx(AParentControl.Handle, AChildWnd); +end; + +function IsChildControl(AParentControl: TWinControl; AChildControl: TControl): Boolean; overload; +var + AParent: TWinControl; + AChildWinControl: TWinControl; +begin + AChildWinControl := GetWinControl(AChildControl); + if AParentControl.HandleAllocated and AChildWinControl.HandleAllocated then + Result := IsChildEx(AParentControl.Handle, AChildWinControl.Handle) + else + begin + AParent := AChildWinControl; + while (AParent <> nil) and (AParent <> AParentControl) do + AParent := AParent.Parent; + Result := AParent = AParentControl; + end; +end; + +function IsControlUnderBarManager(ABarManager: TdxBarManager; + AControl: TControl): Boolean; +begin + Result := IsChildControl(ABarManager.Owner, AControl); +end; + +function GetParentPopupWindow(AControl: TWinControl; ACheckParentBars: Boolean): TcxCustomPopupWindow; + + function InternalGetParent(AWnd: HWND): HWND; + var + AControl: TWinControl; + begin + Result := 0; + if IsChildClassWindow(AWnd) then + Result := GetParent(AWnd) + else + if ACheckParentBars then + begin + AControl := FindControl(AWnd); + if (AControl is TCustomdxBarControl) and (TCustomdxBarControl(AControl).ParentBar <> nil) then + Result := TCustomdxBarControl(AControl).ParentBar.Handle; + end; + end; + +var + AParentWnd, AWnd: HWND; +begin + Result := nil; + if not AControl.HandleAllocated or (csDestroying in AControl.ComponentState) then + Exit; + + AWnd := AControl.Handle; + repeat + AParentWnd := InternalGetParent(AWnd); + if AParentWnd = 0 then + Break; + AWnd := AParentWnd; + until False; + if (AWnd <> AControl.Handle) and (FindControl(AWnd) is TcxCustomPopupWindow) then + Result := TcxCustomPopupWindow(FindControl(AWnd)); +end; +// Temp methods + +function EnumToStringArray(ATypeInfo: PTypeInfo): TStringArray; +var + ATypeData: PTypeData; + AList: TStringList; + I: Integer; +begin + ATypeData := GetTypeData(ATypeInfo); + AList := TStringList.Create; + try + for I := ATypeData.MinValue to ATypeData.MaxValue do + AList.Add(GetEnumName(ATypeInfo, I)); +// AList.Sort; + SetLength(Result, AList.Count); + for I := 0 to High(Result) do + Result[I] := AList[I]; + finally + AList.Free; + end; +end; + +function SetToStringArray(ATypeInfo: PTypeInfo): TStringArray; +begin + Result := EnumToStringArray(GetTypeData(ATypeInfo).CompType^); +end; + +procedure SetLayeredWndAttributes(AHandle: HWND; AAlphaBlendValue: Integer); +var + AStyle: Integer; +begin + if Assigned(SetLayeredWindowAttributes) then + begin + AStyle := GetWindowLong(AHandle, GWL_EXSTYLE); + if AAlphaBlendValue < 255 then + begin + if (AStyle and WS_EX_LAYERED) = 0 then + SetWindowLong(AHandle, GWL_EXSTYLE, AStyle or WS_EX_LAYERED); + SetLayeredWindowAttributes(AHandle, 0, AAlphaBlendValue, LWA_ALPHA); + end + else + if (AStyle and WS_EX_LAYERED) <> 0 then + begin + SetWindowLong(AHandle, GWL_EXSTYLE, AStyle and not WS_EX_LAYERED); + RedrawWindow(AHandle, nil, 0, RDW_ERASE or RDW_INVALIDATE or RDW_FRAME or RDW_ALLCHILDREN); + end; + end; +end; + +procedure DeleteGDIObject(var AGDIObject); +begin + if HGDIOBJ(AGDIObject) <> 0 then + begin + DeleteObject(HGDIOBJ(AGDIObject)); + HGDIOBJ(AGDIObject) := 0; + end; +end; + +procedure ReverseGDIObject(ADC: HDC; APrevGDIObject: HGDIOBJ); +begin + DeleteObject(SelectObject(ADC, APrevGDIObject)); +end; + +procedure PolygonByColor(ADC: HDC; var APoints: array of TPoint; APenColor, ABrushColor: COLORREF); +var + APrevBrush, APrevPen: HGDIOBJ; +begin + APrevPen := SelectObject(ADC, CreatePen(PS_SOLID, 1, APenColor)); + APrevBrush := SelectObject(ADC, CreateSolidBrush(ABrushColor)); + Polygon(ADC, APoints, Length(APoints)); + ReverseGDIObject(ADC, APrevBrush); + ReverseGDIObject(ADC, APrevPen); +end; + +procedure RoundRectByColor(ADC: HDC; const R: TRect; AWidth, AHeight: Integer; APenColor, ABrushColor: TColor); +var + APrevBrush, APrevPen: HGDIOBJ; + ALogBrush: LOGBRUSH; +begin + ZeroMemory(@ALogBrush, SizeOf(ALogBrush)); + if ABrushColor = clNone then + ALogBrush.lbStyle := BS_NULL + else + ALogBrush.lbColor := ColorToRGB(ABrushColor); + + APrevBrush := SelectObject(ADC, CreateBrushIndirect(ALogBrush)); + APrevPen := SelectObject(ADC, CreatePen(PS_SOLID, 1, ColorToRGB(APenColor))); + RoundRect(ADC, R.Left, R.Top, R.Right, R.Bottom, AWidth, AHeight); + ReverseGDIObject(ADC, APrevBrush); + ReverseGDIObject(ADC, APrevPen); +end; + +procedure ExcludeFrameRegion(ACanvas: TcxCanvas; AFrameRect, AContentRect: TRect); +var + ARegion: TcxRegion; +begin + ARegion := TcxRegion.Create(AFrameRect); + ARegion.Combine(TcxRegion.Create(AContentRect), roSubtract); + ACanvas.SetClipRegion(ARegion, roSubtract); +end; + +procedure DestroyWindowHandle(var AWindowHandle: HWND; ADestroyWindow: Boolean = True); +begin + if AWindowHandle <> 0 then + begin + if ADestroyWindow then + Windows.DestroyWindow(AWindowHandle); + AWindowHandle := 0; + end; +end; + +function dxKillTimer(AWindowHandle: HWND; var ATimerID: DWORD): Boolean; +begin + Result := (ATimerID <> 0) and KillTimer(AWindowHandle, ATimerID); + if Result then + ATimerID := 0; +end; + +function IsAnotherApplicatonWindow(AWnd: HWND): Boolean; +var + AProcessId: Cardinal; +begin + GetWindowThreadProcessId(AWnd, @AProcessId); + Result := (AWnd = 0) or (AProcessId <> GetCurrentProcessId); +end; + +function IsPopupMenuShowed: Boolean; +var + I, J: Integer; +begin + Result := False; + for I := 0 to dxBarManagerList.Count - 1 do + if not dxBarManagerList[I].IsDestroying then + for J := 0 to dxBarManagerList[I].FPopupMenus.Count - 1 do + if TdxBarPopupMenu(dxBarManagerList[I].FPopupMenus[J]).FPopupMenuVisible then + begin + Result := True; + Break; + end; +end; + +function GetSectionDelimiter(AStoringKind: TdxBarStoringKind): string; +begin + case AStoringKind of + skIni: Result := '.'; + else + Result := '\'; + end; +end; + +function GetShortCutFromMessageData(WParam: Integer; LParam: Integer): TShortCut; +const + AltMask = $20000000; +begin + Result := Byte(WParam); + if Result <> 0 then + begin + if GetKeyState(VK_SHIFT) < 0 then Inc(Result, scShift); + if GetKeyState(VK_CONTROL) < 0 then Inc(Result, scCtrl); + if LParam and AltMask <> 0 then Inc(Result, scAlt); + end; +end; + +{ global methods } + +function BarDesignController: TdxBarDesignController; +begin + if (FBarDesignController = nil) and not FdxBarIsFinalized then + FBarDesignController := TdxBarDesignController.Create; + Result := FBarDesignController; +end; + +function BarCanvas: TdxBarCanvas; +begin + if (FBarCanvas = nil) and not FdxBarIsFinalized then + FBarCanvas := TdxBarCanvas.Create; + Result := FBarCanvas; +end; + +function RegdxItemList: TdxBarItemList; +begin + if (FRegdxItemList = nil) and not FdxBarIsFinalized then + FRegdxItemList := TdxBarItemList.Create; + Result := FRegdxItemList; +end; + +procedure dxBarRegisterItem(AItemClass: TdxBarItemClass; + AItemControlClass: TdxBarItemControlClass; AVisible: Boolean); +begin + RegdxItemList.Register(AItemClass, AItemControlClass, AVisible); +end; + +procedure dxBarUnregisterItem(AItemClass: TdxBarItemClass); +begin + RegdxItemList.Unregister(AItemClass); +end; + +procedure AddBarControl(ABarControl: TCustomdxBarControl); +begin + FBarControls.Add(ABarControl); +end; + +procedure RemoveBarControl(ABarControl: TCustomdxBarControl); +begin + FBarControls.Remove(ABarControl); +end; + +function BarControlExists(ABarControl: TCustomdxBarControl): Boolean; +begin + Result := (ABarControl <> nil) and (FBarControls.IndexOf(ABarControl) <> -1); +end; + +procedure dxBarDesignerModified(ABarManager: TdxBarManager); +begin + if ABarManager <> nil then ABarManager.DesignerModified; +end; + +function dxBarCreateScreenTipViewInfo(ABarManager: TdxBarManager; AHintText: string; const AShortCut: string; AScreenTip: TdxBarScreenTip; + APainter: TdxBarPainter): TdxBarCustomHintViewInfo; +begin + if (AScreenTip <> nil) and AScreenTip.Collection.Repository.ShowDescription then + Result := TdxBarScreenTipViewInfo.Create(AScreenTip, APainter, AHintText, AShortCut) + else + begin + if (AScreenTip <> nil) and not AScreenTip.UseHintAsHeader and (AScreenTip.Header.Text <> '') then + AHintText := AScreenTip.Header.Text; + Result := TdxBarLikeHintScreenTipViewInfo.Create(ABarManager, APainter, AHintText, AShortCut, GetMouseCursorPos); + end; +end; + +function dxBarFlatPainter: TdxBarFlatPainter; +begin + if FBarFlatPainter = nil then + FBarFlatPainter := TdxBarFlatPainter.Create(0); + Result := FBarFlatPainter; +end; + +function dxBarCreateBitmap(AOnChangeProc: TNotifyEvent): TBitmap; +begin + Result := TBitmap.Create; + Result.OnChange := AOnChangeProc; +end; + +function ActiveBarControl: TCustomdxBarControl; +begin + Result := FActiveBarControl; +end; + +function ActiveBarManager: TdxBarManager; +begin + if ActiveBarControl <> nil then + Result := ActiveBarControl.BarManager + else + Result := nil; +end; + +function IsActiveBarControlAccessible: Boolean; +begin + Result := (ActiveBarControl <> nil) and ActiveBarControl.HandleAllocated and IsWindowEnabled(ActiveBarControl.Handle); +end; + +function VisibleTodxBarVisible(Value: Boolean): TdxBarItemVisible; +begin + if Value then + Result := ivAlways + else + Result := ivNever; +end; + +function GetBarManagerByHandle(AWnd: HWND): TdxBarManager; +begin + Result := GetBarManagerByComponent(FindControl(AWnd)) +end; + +function GetParentBarOrSubMenuForBar(Value: TCustomdxBarControl): TCustomdxBarControl; +begin + Result := Value; + while (Result <> nil) and not Result.IsDestroying do + if (Result.ParentBar = nil) or Result.IsInternal and not Result.ParentBar.IsInternal then + Break + else + Result := Result.ParentBar; +end; + +function GetParentBarForBar(Value: TCustomdxBarControl): TCustomdxBarControl; +begin + Result := GetParentBarOrSubMenuForBar(Value); + if Result is TdxBarSubMenuControl then Result := nil; +end; + +function GetAccelPos(var AText: string; AModifyString: Boolean = False): Integer; +var + I: Integer; +begin + Result := 0; + I := 1; + while I < Length(AText) do + begin + if AText[I] = '&' then + begin + if AModifyString then + Delete(AText, I, 1) + else + Inc(I); + if AText[I] <> '&' then + Result := I; + end; + Inc(I); + end; +end; + +function GetParentBarOrSubMenuForControl(Value: TdxBarItemControl): TCustomdxBarControl; +begin + if Value = nil then + Result := nil + else + Result := GetParentBarOrSubMenuForBar(Value.Parent); +end; + +function GetParentBarForControl(Value: TdxBarItemControl): TCustomdxBarControl; +begin + Result := GetParentBarOrSubMenuForControl(Value); + if Result is TdxBarSubMenuControl then Result := nil; +end; + +function FindVCLControl(Wnd: HWND): TWinControl; +begin + repeat + Result := FindControl(Wnd); + Wnd := GetParent(Wnd); + until (Result <> nil) or (Wnd = 0); +end; + +function HasAsParent(Wnd: HWND; ParentWnd: HWND): Boolean; +begin + Result := IsOwner(ParentWnd, Wnd); +end; + +function HasPopupWindowAbove(ABarControl: TCustomdxBarControl; + AIgnoreSelectedControl: Boolean): Boolean; + + function GetItemControlScreenBounds(AItemControl: TdxBarItemControl): TRect; + begin + Result := AItemControl.ViewInfo.Bounds; + Result.TopLeft := AItemControl.Parent.ClientToScreen(Result.TopLeft); + Result.BottomRight := AItemControl.Parent.ClientToScreen(Result.BottomRight); + end; + +var + AActiveBarControl: TCustomdxBarControl; +begin + AActiveBarControl := ActiveBarControl; + if (AActiveBarControl = nil) and (BarDesignController.QuickControl <> nil) then + AActiveBarControl := BarDesignController.QuickControl; + Result := False; + if AActiveBarControl = nil then + Exit; + Result := (AActiveBarControl.SelectedControl <> nil) and AActiveBarControl.SelectedControl.IsDroppedDown and + (not AIgnoreSelectedControl or not PtInRect(GetItemControlScreenBounds(AActiveBarControl.SelectedControl), GetMouseCursorPos)) or + (AActiveBarControl <> ABarControl) and (AActiveBarControl.ParentBar <> nil); +end; + +function WindowFromPointEx(P: TPoint): HWND; + + function FindOne(Wnd: HWND; P: TPoint): HWND; + begin + Result := ChildWindowFromPointEx(Wnd, P, CWP_SKIPINVISIBLE); + if Result = 0 then + Result := Wnd + else + if Result <> Wnd then + begin + MapWindowPoints(Wnd, Result, P, 1); + Result := FindOne(Result, P); + end; + end; + +begin + Result := WindowFromPoint(P); + if Result <> 0 then + begin + ScreenToClient(Result, P); + Result := FindOne(Result, P); + end; +end; + +function GetShortCutToHint(AShortCut: TShortCut): string; +begin + Result := ShortCutToText(AShortCut); + if Result <> '' then Result := ' (' + Result + ')'; +end; + +function GetTextOf(const S: string): string; +begin + Result := RemoveAccelChars(S, False); +end; + +procedure DrawItemArrow(DC: HDC; R: TRect; ArrowType: TcxArrowDirection; + Enabled, Selected, Flat: Boolean; AColor: TColor = clDefault); +begin + DrawItemArrow(DC, R, ArrowType = adDown, Enabled, Selected, Flat, AColor); +end; + +procedure DrawItemArrow(ADC: HDC; R: TRect; ADownArrow, AEnabled, ASelected, AFlat: Boolean; AColor: TColor = clDefault); +var + ASize: Integer; +begin + if not ADownArrow then + ASize := R.Bottom - R.Top - 6 + else // adDown + ASize := R.Right - R.Left - 8; + ASize := Max((ASize - 1) div 2 + Byte(ASize mod 2 <> 0), 3); + DrawLargeItemArrow(ADC, R, ADownArrow, ASize, ASelected, AEnabled, AFlat, AColor); +end; + +procedure DrawLargeItemArrow(DC: HDC; R: TRect; ArrowType: TcxArrowDirection; + Size: Integer; Selected, Enabled, Flat: Boolean; AColor: TColor = clDefault); +begin + DrawLargeItemArrow(DC, R, ArrowType = adDown, Size, Selected, Enabled, Flat, AColor); +end; + +procedure DrawLargeItemArrow(ADC: HDC; R: TRect; ADownArrow: Boolean; + ASize: Integer; ASelected, AEnabled, AFlat: Boolean; AColor: TColor = clDefault); + +var + X, Y: Integer; + + procedure DrawEnabled(AColor: COLORREF); + var + P: array[1..3] of TPoint; + begin + with R do + if ADownArrow then + begin + X := (Left + Right - (2 * ASize - 1)) div 2; + Y := (Top + Bottom - ASize) div 2; + P[1] := Point(X, Y); + P[2] := Point(X + 2 * ASize - 2, Y); + end + else + begin + X := (Left + Right - ASize) div 2; + Y := (Top + Bottom - (2 * ASize - 1)) div 2; + P[1] := Point(X, Y); + P[2] := Point(X, Y + 2 * ASize - 2); + end; + P[3] := Point(X + ASize - 1, Y + ASize - 1); + PolygonByColor(ADC, P, AColor, AColor); + end; + + procedure DrawDisabled; + var + Pen: HPEN; + begin + Pen := SelectObject(ADC, CreatePen(PS_SOLID, 1, GetSysColor(COLOR_BTNHIGHLIGHT))); + if ADownArrow then + begin + MoveToEx(ADC, X + ASize, Y + ASize - 1, nil); + LineTo(ADC, X + 2 * ASize - 1, Y); + MoveToEx(ADC, X + ASize, Y + ASize, nil); + LineTo(ADC, X + 2 * ASize, Y); + end + else + begin + MoveToEx(ADC, X + ASize - 1, Y + ASize, nil); + LineTo(ADC, X, Y + 2 * ASize - 1); + MoveToEx(ADC, X + ASize, Y + ASize, nil); + LineTo(ADC, X, Y + 2 * ASize); + end; + ReverseGDIObject(ADC, Pen); + end; + +begin + if AColor = clDefault then + if AEnabled then + if ASelected then + begin + if IsHighContrastWhite then + AColor := clBtnFace // White + else + AColor := clHighLightText; + end + else + AColor := clBtnText + else + AColor := clBtnShadow; + DrawEnabled(ColorToRGB(AColor)); + if not AEnabled and not AFlat then DrawDisabled; +end; + +procedure FrameFlatSelRect(DC: HDC; const R: TRect); +begin + FrameRect(DC, R, GetSysColorBrush(COLOR_HIGHLIGHT)); +end; + +{ items global functions } + +function GetWorkArea(const P: TPoint): TRect; +begin + Result := GetDesktopWorkArea(P); +end; + +procedure CheckEditWidth(var AWidth: Integer; AMinWidth: Integer); +begin + if AWidth < AMinWidth then + AWidth := AMinWidth; +end; + +procedure RefreshDeviceConsts; +var + DC: Integer; +begin + DC := GetDC(0); + try + BitsPerPixel := GetDeviceCaps(DC, BITSPIXEL); + finally + ReleaseDC(0, DC); + end; +end; + +procedure CreatePatternBrush; +var + Pattern: TBitmap; + X, Y: Integer; +begin + if FdxBarIsFinalized then + Exit; + Pattern := TBitmap.Create; + with Pattern, Canvas do + begin + Width := 8; + Height := 8; + Brush.Color := GetSysColor(COLOR_BTNHIGHLIGHT); + FillRect(Rect(0, 0, Width, Height)); + for Y := 0 to 7 do + for X := 0 to 7 do + if (Y mod 2) = (X mod 2) then + Pixels[X, Y] := GetSysColor(COLOR_BTNFACE); + end; + DeleteGDIObject(PatternBrush); + PatternBrush := Windows.CreatePatternBrush(Pattern.Handle); + Pattern.Free; +end; + +procedure DrawVerticalGradient(Canvas: TCanvas; const ARect: TRect; + FromR, ToR, FromG, ToG, FromB, ToB: Byte); +begin + FillGradientRect(Canvas.Handle, ARect, RGB(FromR, FromG, FromB), RGB(ToR, ToG, ToB), False); +end; + +procedure DrawDisablingHatch(ADC: HDC; const ARect: TRect); +begin + cxDrawHatch(ADC, ARect, clBlack, clBtnFace, 2, 20, 170); +end; + +procedure TransparentDraw(DrawDC: HDC; const R: TRect; AGlyph: TBitmap; AEnabled: Boolean = True); +const + DrawModes: array [Boolean] of TcxImageDrawMode = (idmDisabled, idmNormal); +begin + cxDrawImage(DrawDC, R, R, AGlyph, nil, -1, DrawModes[AEnabled]); +end; + +procedure TransparentDraw(DrawDC: HDC; Brush: HBRUSH; const FullRect, R: TRect; AGlyph: TBitmap; + AImages: TCustomImageList; AImageIndex: Integer; AImageListBkColor: TColor; + AEnabled, AGrayScale, AFlat, ASelected, ADown, APressed, AShadow, AFaded: Boolean; + ASmoothImage: Boolean = False; AUseLeftBottomPixelAsTransparent: Boolean = True); +begin + TransparentDraw(nil, DrawDC, Brush, FullRect, R, AGlyph, + AImages, AImageIndex, AImageListBkColor, + AEnabled, AGrayScale, AFlat, ASelected, ADown, APressed, AShadow, AFaded, + ASmoothImage, AUseLeftBottomPixelAsTransparent); +end; + +procedure TransparentDraw(ABarItemControl: TdxBarItemControl; + DrawDC: HDC; Brush: HBRUSH; const FullRect, R: TRect; AGlyph: TBitmap; + AImages: TCustomImageList; AImageIndex: Integer; AImageListBkColor: TColor; + AEnabled, AGrayScale, AFlat, ASelected, ADown, APressed, AShadow, AFaded: Boolean; + ASmoothImage: Boolean = False; AUseLeftBottomPixelAsTransparent: Boolean = True); + + function GetDrawMode: TcxImageDrawMode; + begin + Result := idmNormal; + if AEnabled or AFaded then + begin + if not AEnabled then + Result := idmFaded + else + if AGrayScale then + Result := idmGrayScale + else + if AFlat then + begin + if not ASelected and not ADown and dxBarMakeInactiveImagesDingy and (BitsPerPixel > 8) then + Result := idmDingy + else + if AShadow and ASelected and not APressed {and not ADown} then + Result := idmShadowed; + end; + end + else + Result := idmDisabled; + end; + +var + ADrawMode: TcxImageDrawMode; + APrevCustomDrawImageProc: TcxDrawImageProc; +begin + if IsGlyphAssigned(AGlyph) then + AImageListBkColor := clNone; + + APrevCustomDrawImageProc := CustomDrawImageProc; + try + ADrawMode := GetDrawMode; + if (ABarItemControl <> nil) and ABarItemControl.BarManager.ImageOptions.CacheGlyphs and (ADrawMode <> idmShadowed) then + begin + if not ABarItemControl.FCachedImageOptions.IsCached(ADrawMode, AGlyph, AImages) then + ABarItemControl.FCachedImageOptions.Cache(R, AGlyph, AImages, AImageIndex, + ADrawMode, AImageListBkColor, ASmoothImage, AUseLeftBottomPixelAsTransparent); + + AGlyph := ABarItemControl.FCachedImageOptions.Glyph; + ADrawMode := idmNormal; + CustomDrawImageProc := nil; + end; + + cxDrawImage(DrawDC, R, FullRect, AGlyph, AImages, AImageIndex, ADrawMode, ASmoothImage, + Brush, AImageListBkColor, AUseLeftBottomPixelAsTransparent); + finally + CustomDrawImageProc := APrevCustomDrawImageProc; + end; +end; + +procedure ProcessMouseMessages; +var + Msg: TMsg; +begin + while PeekMessage(Msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_NOREMOVE) do + begin + case Integer(GetMessage(Msg, 0, WM_MOUSEFIRST, WM_MOUSELAST)) of + -1: Break; + 0: begin + PostQuitMessage(Msg.wParam); + Break; + end; + end; + DispatchMessage(Msg); + end; +end; + +procedure ProcessPaintMessages; +var + Msg: TMsg; +begin + while PeekMessage(Msg, 0, WM_PAINT, WM_PAINT, PM_NOREMOVE) do + begin + case Integer(GetMessage(Msg, 0, WM_PAINT, WM_PAINT)) of + -1: Break; + 0: begin + PostQuitMessage(Msg.wParam); + Break; + end; + end; + DispatchMessage(Msg); + end; +end; + +type + TPlaySoundType = (psMenuPopup, psMenuCommand, psStopPlay); + +procedure PlaySound(APlaySoundType: TPlaySoundType); +const + PlaySounds: array[TPlaySoundType] of PChar = ('MenuPopup', 'MenuCommand', nil); +begin + if dxBarPlaySound then + MMSystem.PlaySound(PlaySounds[APlaySoundType], 0, + SND_ALIAS or SND_ASYNC or SND_NODEFAULT {or SND_NOSTOP }or SND_NOWAIT); +end; + +procedure InitMMSystem; +begin + PlaySound(psStopPlay); +end; + +function CreateToolbarCaptionFontHandle(AFont: TFont; AUseSystemFont: Boolean): HFont; +var + ANonClientMetrics: TNonClientMetrics; +begin + ANonClientMetrics.cbSize := SizeOf(ANonClientMetrics); + SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, @ANonClientMetrics, 0); + if not AUseSystemFont then + with ANonClientMetrics.lfSmCaptionFont, AFont do + begin + if lfHeight > -11 then lfHeight := -11; + Move(Name[1], lfFaceName, Length(Name)); + lfFaceName[Length(Name)] := #0; + end; + Result := CreateFontIndirect(ANonClientMetrics.lfSmCaptionFont); +end; + +procedure CreateEditFontHandle(AFont: TFont; var AEditFont: TFont; AScaled: Boolean); +var + ASystemLogFont, ALogFont: TLogFont; +begin + if AScaled then + begin + SystemParametersInfo(SPI_GETICONTITLELOGFONT, SizeOf(ASystemLogFont), @ASystemLogFont, 0); + cxGetFontData(AFont.Handle, ALogFont); + ALogFont.lfHeight := ASystemLogFont.lfHeight; + with ALogFont do + if lfHeight > -11 then lfHeight := -11; + AEditFont.Handle := CreateFontIndirect(ALogFont); + end + else + AEditFont.Handle := CloneFont(AFont.Handle); +end; + +function CloneFont(Source: HFONT): HFONT; +var + LogFont: TLogFont; +begin + cxGetFontData(Source, LogFont); + Result := CreateFontIndirect(LogFont); +end; + +procedure RestoreClipRgn(DC: HDC; var AClipRgn: HRGN; var AClipRgnExists: Boolean); +begin + if AClipRgnExists then + SelectClipRgn(DC, AClipRgn) + else + SelectClipRgn(DC, 0); + DeleteObject(AClipRgn); +end; + +procedure SaveClipRgn(DC: HDC; var AClipRgn: HRGN; var AClipRgnExists: Boolean); +begin + AClipRgn := CreateRectRgn(0, 0, 0, 0); + AClipRgnExists := GetClipRgn(DC, AClipRgn) = 1; +end; + +procedure AddClipRect(DC: HDC; const R: TRect); +var + ARgn: HRGN; +begin + with R do + ARgn := CreateRectRgn(Left, Top, Right, Bottom); + ExtSelectClipRgn(DC, ARgn, RGN_OR); + DeleteObject(ARgn); +end; + +procedure ExcludeRect(var MainRgn: HRGN; const R: TRect); +var + TempRgn: HRGN; +begin + TempRgn := CreateRectRgnIndirect(R); + CombineRgn(MainRgn, MainRgn, TempRgn, RGN_DIFF); + DeleteObject(TempRgn); +end; + +function GetRealColor(AColor: COLORREF): COLORREF; +var + DC: HDC; +begin + DC := GetDC(0); + Result := GetNearestColor(DC, AColor); + ReleaseDC(0, DC); +end; + +procedure FillBackgroundRect(DC: HDC; ADestR, ASourceR: TRect; ABrush: HBRUSH; + AColor: TColor; ABitmap: TBitmap); +var + ABrushExist: Boolean; +begin + if (ABitmap <> nil) and not ABitmap.Empty then + FillRectByBitmap(DC, ADestR, ASourceR, ABitmap) + else + begin + ABrushExist := ABrush <> 0; + if not ABrushExist then + ABrush := CreateSolidBrush(ColorToRGB(AColor)); + FillRect(DC, ADestR, ABrush); + if not ABrushExist then + DeleteObject(ABrush); + end; +end; + +procedure FillRectByBitmap(DC: HDC; ADestR, ASourceR: TRect; ABitmap: TBitmap); +var + W, H, RW, RH: Integer; + I, J, XStart, XEnd, YStart, YEnd, X, Y: Integer; + AClipRgn: HRGN; + AClipRgnExists: Boolean; +begin + W := ABitmap.Width; + H := ABitmap.Height; + RW := ASourceR.Right - ASourceR.Left; + RH := ASourceR.Bottom - ASourceR.Top; + if (W = 0) or (H = 0) or (RW = 0) or (RH = 0) then Exit; + XStart := ASourceR.Left div W; + XEnd := (ASourceR.Right - 1) div W; + YStart := ASourceR.Top div H; + YEnd := (ASourceR.Bottom - 1) div H; + SaveClipRgn(DC, AClipRgn, AClipRgnExists); + with ADestR do + IntersectClipRect(DC, Left, Top, Right, Bottom); + for J := YStart to YEnd do + for I := XStart to XEnd do + begin + Y := J * H - (ASourceR.Top - ADestR.Top); + X := I * W - (ASourceR.Left - ADestR.Left); + BitBlt(DC, X, Y, W, H, ABitmap.Canvas.Handle, 0, 0, SRCCOPY); + end; + RestoreClipRgn(DC, AClipRgn, AClipRgnExists); +end; + +procedure AfterDrawBackground(ADC: HDC; APrevWindowOrg: TPoint); +begin + SetWindowOrgEx(ADC, APrevWindowOrg.X, APrevWindowOrg.Y, nil); +end; + +function BeforeDrawBackground(ASourceControl, ADestinationControl: TWinControl; + ADC: HDC; var ARect: TRect; out APrevWindowOrg: TPoint): TPoint; +begin + Result := cxNullPoint; + if (ASourceControl <> nil) and ASourceControl.HandleAllocated and + (ADestinationControl <> nil) and ADestinationControl.HandleAllocated then + MapWindowPoints(ASourceControl.Handle, ADestinationControl.Handle, Result, 1); + OffsetWindowOrgEx(ADC, Result.X, Result.Y, APrevWindowOrg); + ARect := cxRectOffset(ARect, Result); +end; + +{ test of mouse keys pressing } + +function IsMouseButtonPressed(AButton, ASwapButton: Integer): Boolean; +begin + if GetSystemMetrics(SM_SWAPBUTTON) = 0 then + Result := GetAsyncKeyState(AButton) < 0 + else + Result := GetAsyncKeyState(ASwapButton) < 0; +end; + +function LeftButtonPressed: Boolean; +begin + Result := IsMouseButtonPressed(VK_LBUTTON, VK_RBUTTON); +end; + +function RightButtonPressed: Boolean; +begin + Result := IsMouseButtonPressed(VK_RBUTTON, VK_LBUTTON); +end; + +function IsApplicationActive: Boolean; +begin + Result := FApplicationActive and not FApplicationDeactivation and (GetActiveWindow <> 0); +end; + +procedure dxFreeAndNil(var AObject); +begin + TObject(AObject).Free; + Pointer(AObject) := nil; +end; + +procedure dxFreeAndNilObjectLink(var ALink: TcxObjectLink); +var + ATempLink: TcxObjectLink; +begin + if ALink <> nil then + begin + ATempLink := ALink; + ALink := nil; + cxRemoveObjectLink(ATempLink); + end; +end; + +function dxBarMessageBox(AText: string; AFlags: Integer): Integer; +begin + Result := Application.MessageBox(PChar(AText), PChar(Application.Title), AFlags); +end; + +procedure dxBarFrameRect(ADC: HDC; ARect: TRect; AColor: Integer); +begin + FrameRect(ADC, ARect, GetSysColorBrush(AColor)); + InflateRect(ARect, -1, -1); + FrameRect(ADC, ARect, GetSysColorBrush(AColor)); +end; + +procedure dxBarFocusRect(ADC: HDC; ARect: TRect); + + procedure InternalSetPixel(X, Y: Integer); + begin + if (X + Y) mod 2 = 0 then + SetPixel(ADC, X, Y, ColorToRGB(clBtnText)); + end; + + procedure InternalDrawFocusRect; + var + I: Integer; + begin + for I := ARect.Left to ARect.Right - 1 do + begin + InternalSetPixel(I, ARect.Top); + InternalSetPixel(I, ARect.Bottom - 1); + end; + for I := ARect.Top to ARect.Bottom - 1 do + begin + InternalSetPixel(ARect.Left, I); + InternalSetPixel(ARect.Right - 1, I); + end; + end; + +begin + InternalDrawFocusRect; + InflateRect(ARect, -1, -1); + InternalDrawFocusRect; +end; + +function IsSelectableItem(AObject: TObject): Boolean; +var + ASelectableItem: IdxBarSelectableItem; +begin + Result := IsSelectableItem(AObject, ASelectableItem); +end; + +function IsSelectableItem(AObject: TObject; + out ASelectableItem: IdxBarSelectableItem): Boolean; +var + ATempSelectableItem: IdxBarSelectableItem; +begin + Result := Supports(AObject, IdxBarSelectableItem, ATempSelectableItem); + if Result then + ASelectableItem := ATempSelectableItem; +end; + +function GetSelectableItem(AObject: TObject): IdxBarSelectableItem; +begin + if not IsSelectableItem(AObject, Result) then + Result := nil; +end; + +procedure CleanSelectableItems(AItems: TdxObjectList); +var + I: Integer; +begin + for I := AItems.Count - 1 downto 0 do + if not IsSelectableItem(AItems[I]) then + AItems.Delete(I); +end; + +function GetMaxViewLevel(AViewLevels: TdxBarItemViewLevels): TdxBarItemRealViewLevel; +begin + for Result := Low(TdxBarItemRealViewLevel) to High(TdxBarItemRealViewLevel) do + if Result in AViewLevels then + Break; +end; + +function GetMinViewLevel(AViewLevels: TdxBarItemViewLevels): TdxBarItemRealViewLevel; +begin + for Result := High(TdxBarItemRealViewLevel) downto Low(TdxBarItemRealViewLevel) do + if Result in AViewLevels then + Break; +end; + +function GetNextViewLevel(AViewLevels: TdxBarItemViewLevels; + AViewLevel: TdxBarItemRealViewLevel): TdxBarItemRealViewLevel; +begin + for Result := Succ(AViewLevel) to High(TdxBarItemRealViewLevel) do + if Result in AViewLevels then + Break; +end; + +function WidthToCurrentDpi(AValue: Integer; ANormalDpi: Integer = 96): Integer; +begin + Result := Round(AValue * Screen.PixelsPerInch / ANormalDpi); +end; + +procedure BarDrawSizeGrip(DC: HDC; R: TRect); +const + ROP_DSPDxax = $00E20746; +var + APrevBitmap, ATempBitmap, AMaskBitmap: HBITMAP; + TempDC, MDC, MaskDC: HDC; + W, H: Integer; + APrevBkColor: COLORREF; +begin + W := R.Right - R.Left; + H := R.Bottom - R.Top; + TempDC := CreateCompatibleDC(DC); + ATempBitmap := SelectObject(TempDC, CreateCompatibleBitmap(DC, W, H)); + try + BitBlt(TempDC, 0, 0, W, H, DC, R.Left, R.Top, SRCCOPY); // 1 + MDC := CreateCompatibleDC(DC); + APrevBitmap := SelectObject(MDC, CreateCompatibleBitmap(DC, W, H)); + DrawFrameControl(MDC, Rect(0, 0, W, H), DFC_SCROLL, DFCS_SCROLLSIZEGRIP); // 2 + + MaskDC := CreateCompatibleDC(DC); + AMaskBitmap := SelectObject(MaskDC, CreateBitmap(W, H, 1, 1, nil)); + try + APrevBkColor := SetBkColor(MDC, ColorToRGB(clBtnFace)); //! + BitBlt(MaskDC, 0, 0, W, H, MDC, 0, 0, SRCCOPY); + SetBkColor(MDC, APrevBkColor); + + BitBlt(TempDC, 0, 0, W, H, MaskDC, 0, 0, MERGEPAINT); + BitBlt(MDC, 0, 0, W, H, MaskDC, 0, 0, SRCPAINT); + BitBlt(TempDC, 0, 0, W, H, MDC, 0, 0, SRCAND); + finally + DeleteObject(SelectObject(MaskDC, AMaskBitmap)); + DeleteDC(MaskDC); + end; + + DeleteObject(SelectObject(MDC, APrevBitmap)); + DeleteDC(MDC); + + BitBlt(DC, R.Left, R.Top, W, H, TempDC, 0, 0, SRCCOPY); + finally + DeleteObject(SelectObject(TempDC, ATempBitmap)); + DeleteDC(TempDC); + end; +end; + +{ XP routines } + +function ThemeEditState(ABarEditControl: TdxBarWinControl(*TdxBarEditControl*)): Integer; // TODO ReadOnly +begin + if not ABarEditControl.Enabled then + Result := ETS_DISABLED + else +// if ABarEditControl.ReadOnly then +// Result := ETS_READONLY +// else + Result := ETS_NORMAL; +end; + +function ThemeEditColor(ATheme: TdxTheme; AEditState: Integer): COLORREF; +begin + Result := GetSysColor(COLOR_WINDOW); + if AEditState = ETS_DISABLED then + begin + if FAILED(GetThemeColor(ATheme, EP_EDITTEXT, AEditState, TMT_FILLCOLOR, Result)) then + Result := GetSysColor(COLOR_WINDOW); + end; +end; + +function ThemeEditTextColor(ATheme: TdxTheme; AEditState: Integer): COLORREF; +begin + if FAILED(GetThemeColor(ATheme, EP_EDITTEXT, AEditState, TMT_TEXTCOLOR, Result)) then + begin + if AEditState = ETS_DISABLED then + Result := GetSysColor(COLOR_GRAYTEXT) + else + Result := GetSysColor(COLOR_WINDOWTEXT); + end; +end; + +function ThemeToolbarColor: COLORREF; +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totToolbar); + if FAILED(GetThemeColor(ATheme, 0, 0, TMT_FILLCOLOR, Result)) then + Result := COLOR_BTNFACE; +end; + +function ThemeCloseButtonSize: TSize; +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totWindow); + GetThemePartSize(ATheme, 0, WP_SMALLCLOSEBUTTON, CBS_NORMAL, TS_TRUE, Result); +end; + +procedure ThemeDrawCloseButton(DC: HDC; var R: TRect; ASelected, APressed: Boolean; + ACorner: TdxCorner); +const + ButtonStates: array [TdxBarMarkState] of Integer = (CBS_NORMAL, CBS_HOT, CBS_PUSHED); +var + ATheme: TdxTheme; + AState, X: Integer; + ASize: TSize; +begin + ATheme := OpenTheme(totWindow); + if APressed then + AState := CBS_PUSHED + else + if ASelected then + AState := CBS_HOT + else + AState := CBS_NORMAL; + ASize := ThemeCloseButtonSize; + if (R.Bottom - R.Top) > ASize.cy then + X := ((R.Bottom - R.Top) - ASize.cy) div 2 + else + X := 0; + with R do + begin + if ACorner in [coTopRight, coBottomRight] then + begin + Inc(Left, X); + Right := Left + ASize.cx; + end + else + begin + Dec(Right, X); + Left := Right - ASize.cx; + end; + Inc(Top, X); + Bottom := Top + ASize.cy; + end; + FillRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + DrawThemeBackground(ATheme, DC, WP_SMALLCLOSEBUTTON, AState, R); +end; + +function ThemeSizeGripSize: TSize; +const + Offset = 2; // ! +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totScrollBar); + GetThemePartSize(ATheme, 0, SBP_SIZEBOX, SZB_RIGHTALIGN, TS_TRUE, Result); + Result.cx := Result.cx + Offset; + Result.cy := Result.cy + Offset; +end; + +procedure ThemeDrawSizeGrip(DC: HDC; var R: TRect; ACorner: TdxCorner); +const + Offset = 2; // ! + Delta = 1; +var + ATheme: TdxTheme; + AMirrorX, AMirrorY: Boolean; + R1: TRect; + AScrollBarSize: TSize; + APrevBitmap: HBITMAP; + MDC: HDC; + X, Y: Integer; +begin + ATheme := OpenTheme(totScrollBar); + AScrollBarSize := ThemeSizeGripSize; + + with R do + begin + if ACorner in [coTopRight, coBottomRight] then + Left := Right - AScrollBarSize.cx - Delta + else + Right := Left + AScrollBarSize.cx + Delta; + if ACorner in [coBottomLeft, coBottomRight] then + Top := Bottom - AScrollBarSize.cy + else + Bottom := Top + AScrollBarSize.cy; + AMirrorX := ACorner in [coTopLeft, coBottomLeft]; + AMirrorY := ACorner in [coTopLeft, coTopRight]; + end; + + FillRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + + R1 := R; + with R1 do + begin + if AMirrorX then + Dec(Right, Offset) + else + Inc(Left, Offset); + if AMirrorY then + Dec(Bottom, Offset) + else + Inc(Top, Offset); + end; + + X := R1.Left; + Y := R1.Top; + OffsetRect(R1, -R1.Left, -R1.Top); + MDC := CreateCompatibleDC(DC); + APrevBitmap := SelectObject(MDC, CreateCompatibleBitmap(DC, R1.Right, R1.Bottom)); + FillRect(MDC, R1, COLOR_BTNFACE + 1); + DrawThemeBackground(ATheme, MDC, SBP_SIZEBOX, SZB_RIGHTALIGN, R1); + with R1 do + StretchBlt(DC, X, Y, Right, Bottom, + MDC, Byte(AMirrorX) * (Right - 1), Byte(AMirrorY) * (Bottom - 1), + (2 * Byte(not AMirrorX) - 1) * Right, + (2 * Byte(not AMirrorY) - 1) * Bottom, SRCCOPY); + DeleteObject(SelectObject(MDC, APrevBitmap)); + DeleteDC(MDC); +end; + +{ TdxBarToolbarsPopup } + +type + TdxBarToolbarsPopup = class(TdxBarInternalSubMenuControl); + +{ TdxBarDropDownListBox } + +type + TdxBarDropDownListBox = class(TCustomListBox) + private + FCombo: TdxBarCustomCombo; + WaitForCapture: Boolean; + function GetPainter: TdxBarPainter; + procedure WMCaptureChanged(var Message: TMessage); message WM_CAPTURECHANGED; + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND; + procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + protected + procedure Click; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + property Painter: TdxBarPainter read GetPainter; + public + constructor Create(AOwner: TComponent); override; + property OnDrawItem; + property OnMeasureItem; + end; + +constructor TdxBarDropDownListBox.Create(AOwner: TComponent); +begin + inherited; + BorderStyle := bsNone; + Style := lbOwnerDrawVariable; + Visible := False; +end; + +function TdxBarDropDownListBox.GetPainter: TdxBarPainter; +begin + Result := TCustomdxBarControl(Parent).Painter; +end; + +procedure TdxBarDropDownListBox.WMCaptureChanged(var Message: TMessage); +begin + inherited; + WaitForCapture := False; +end; + +procedure TdxBarDropDownListBox.WMEraseBkgnd(var Message: TWMEraseBkgnd); +begin + Message.Result := 1; +end; + +procedure TdxBarDropDownListBox.WMLButtonUp(var Message: TWMLButtonUp); +var + ACombo: TdxBarCustomCombo; + AItemIndex: Integer; + AItemLink, RealItemLink: TdxBarItemLink; +begin + inherited; + if WaitForCapture then + begin + ReleaseCapture; + Exit; + end; + ACombo := FCombo; + AItemIndex := ItemIndex; + AItemLink := ACombo.CurItemLink; + RealItemLink := AItemLink.RealItemLink; + if RealItemLink <> nil then + begin + RealItemLink.BringToTopInRecentList(True); + RealItemLink.BarManager.HideAll; + end + else + AItemLink.BarManager.HideAll; + if AItemIndex > -1 then ACombo.ItemIndex := AItemIndex; +end; + +procedure TdxBarDropDownListBox.WMNCCalcSize(var Message: TWMNCCalcSize); +var + ABorderSize: Integer; +begin + inherited; + ABorderSize := Painter.DropDownListBoxBorderSize; + InflateRect(Message.CalcSize_Params.rgrc[0], -ABorderSize, -ABorderSize); +end; + +procedure TdxBarDropDownListBox.WMNCPaint(var Message: TWMNCPaint); +var + ARect: TRect; + ADC: HDC; +begin + inherited; + GetWindowRect(Handle, ARect); + OffsetRect(ARect, -ARect.Left, -ARect.Top); + ADC := GetWindowDC(Handle); + BarCanvas.BeginPaint(ADC); + try + BarCanvas.ExcludeClipRect(cxRectInflate(ARect, + -Painter.DropDownListBoxBorderSize, -Painter.DropDownListBoxBorderSize)); + Painter.DropDownListBoxDrawBorder(ADC, Color, ARect); + finally + BarCanvas.EndPaint; + end; + ReleaseDC(Handle, ADC); +end; + +procedure TdxBarDropDownListBox.Click; +begin + if ItemIndex > -1 then + TdxBarComboControl(FCombo.CurItemLink.Control).LocalItemIndex := ItemIndex; +end; + +procedure TdxBarDropDownListBox.CreateParams(var Params: TCreateParams); +begin + inherited; + with Params do + begin + ExStyle := WS_EX_TOOLWINDOW or WS_EX_TOPMOST; + WindowClass.Style := WindowClass.Style or CS_SAVEBITS; + end; +end; + +procedure TdxBarDropDownListBox.CreateWnd; +begin + inherited CreateWnd; + Windows.SetParent(Handle, 0); + CallWindowProc(DefWndProc, Handle, WM_SETFOCUS, 0, 0); +end; + +procedure TdxBarDropDownListBox.KeyDown(var Key: Word; Shift: TShiftState); +begin + if (ItemIndex = -1) and (Items.Count > 0) then ItemIndex := TopIndex; + inherited; +end; + +procedure TdxBarDropDownListBox.MouseMove(Shift: TShiftState; X, Y: Integer); +var + I: Integer; +begin + if (GetCapture = Handle) and WaitForCapture and PtInRect(ClientRect, Point(X, Y)) then + begin + WaitForCapture := False; + CallWindowProc(DefWndProc, Handle, WM_LBUTTONDOWN, 0, MAKELPARAM(X, Y)); + end; + inherited; + I := ItemAtPos(Point(X, Y), True); + if (0 <= I) and (I <= Items.Count - 1) then + ItemIndex := I; +end; + +procedure TdxCustomQuickCustItemControl.DoPaint(ARect: TRect; PaintType: TdxBarPaintType); +var + AFullRect, R: TRect; + ADC: HDC; + ASelected: Boolean; +begin + AFullRect := ARect; + R := ARect; + ASelected := IsSelected; + ADC := Canvas.Handle; + Painter.DrawQuickCustItemFrame(Self, ADC, R, ARect, ASelected); + inherited; + Painter.DrawGlyph(Self, ADC, R, cxEmptyRect, ptMenu, True, ASelected, IsDowned, False, False, + True, False, False); + Painter.DrawQuickCustItemFrameSelected(Self, ADC, AFullRect, R, ASelected); +end; + +function TdxCustomQuickCustItemControl.GetDefaultWidth: Integer; +begin + Result := inherited GetDefaultWidth; + Inc(Result, GetDefaultHeight); +end; + +procedure TdxBarQuickCustItem.DoClick; +var + ItemLink: TdxBarItemLink; +begin + inherited; + ItemLink := TdxBarItemLink(ClickItemLink.Data); + with ItemLink do + Visible := not Visible; +end; + +function TdxBarQuickCustItemControl.GetLinkedItemLink: TdxBarItemLink; +begin + Result := TdxBarItemLink(FItemLink.Data); +end; + +procedure TdxBarQuickCustItemControl.ControlUnclick(ByMouse: Boolean); +begin + inherited; + Repaint; +end; + +function TdxBarQuickCustItemControl.GetCaption: string; +begin + Result := LinkedItemLink.Caption; +end; + +function TdxBarQuickCustItemControl.GetGlyph: TBitmap; +begin + Result := LinkedItemLink.Glyph; +end; + +function TdxBarQuickCustItemControl.GetImageIndex: Integer; +begin + Result := LinkedItemLink.Item.ImageIndex; +end; + +function TdxBarQuickCustItemControl.GetImageList(AViewSize: TdxBarItemControlViewSize): TCustomImageList; +begin + Result := LinkedItemLink.Item.GetCurImages; +end; + +function TdxBarQuickCustItemControl.GetLargeGlyph: TBitmap; +begin + Result := LinkedItemLink.Item.LargeGlyph; +end; + +function TdxBarQuickCustItemControl.GetLargeImageIndex: Integer; +begin + Result := LinkedItemLink.Item.LargeImageIndex; +end; + +function TdxBarQuickCustItemControl.IsDowned: Boolean; +begin + Result := LinkedItemLink.Visible; +end; + +function TdxBarQuickCustItemControl.GetHint: string; +begin + Result := LinkedItemLink.Item.Hint; +end; + +function TdxBarQuickCustItemControl.GetShortCut: TShortCut; +begin + Result := LinkedItemLink.Item.ShortCut; +end; + +function TdxBarQuickCustItemControl.IsDestroyOnClick: Boolean; +begin + Result := False; +end; + +{ TdxBarQuickCustExtButton and TdxBarQuickCustExtButtonControl } + +type + TdxBarQuickCustExtButton = class(TdxBarButton); + + TdxBarQuickCustExtButtonControl = class(TdxCustomQuickCustItemControl) + protected + function GetTextAreaOffset: Integer; override; + function IsDowned: Boolean; override; + end; + +function TdxBarQuickCustExtButtonControl.GetTextAreaOffset: Integer; +begin + Result := inherited GetTextAreaOffset + GetDefaultHeight; +end; + +function TdxBarQuickCustExtButtonControl.IsDowned: Boolean; +begin + Result := False; +end; + +{ TdxBarQuickAccessItem and TdxBarQuickAccessSubControl } + +type + TdxBarQuickAccessItem = class(TdxBarSubItem) + protected + function CreateBarControl: TCustomdxBarControl; override; + public + constructor Create(AOwner: TComponent); override; + end; + + TdxBarQuickAccessSubControl = class(TdxBarSubMenuControl) + protected + function NeedShowGlyphAndCheckForItem: Boolean; override; + end; + +constructor TdxBarQuickAccessItem.Create(AOwner: TComponent); +begin + inherited; + ItemLinks.Internal := True; +end; + +function TdxBarQuickAccessItem.CreateBarControl: TCustomdxBarControl; +begin + Result := TdxBarQuickAccessSubControl.Create(BarManager) +end; + +function TdxBarQuickAccessSubControl.NeedShowGlyphAndCheckForItem: Boolean; +begin + Result := True; +end; + +constructor TdxBarQuickControl.CreateForPopup(AParentBarControl: TdxBarControl; + ABar: TdxBar); +begin + BarDesignController.ClearInternalItems; + inherited CreateForPopup(AParentBarControl, ABar); + OwnerBounds := ParentBar.MarkScreenRect; + FHidingTimer := TcxTimer.Create(nil); + FHidingTimer.Enabled := False; + FHidingTimer.Interval := 200; + FHidingTimer.OnTimer := QuickControlTimer; +end; + +destructor TdxBarQuickControl.Destroy; +begin + FreeAndNil(FHidingTimer); + inherited Destroy; +end; + +function TdxBarQuickControl.GetParentBar: TdxBarControl; +begin + Result := TdxBarControl(inherited ParentBar); +end; + +procedure TdxBarQuickControl.QuickControlTimer(Sender: TObject); +begin + FHidingTimer.Enabled := False; + +//#DG + if (BarManager.SelectedItem <> nil) and + (GetParentBarForControl(BarManager.SelectedItem) <> Self) then + try + CloseUp; + except + end; +end; + +procedure TdxBarQuickControl.SetParentBar(Value: TdxBarControl); +begin + inherited ParentBar := Value; +end; + +procedure TdxBarQuickControl.WMNCHitTest(var Message: TWMNCHitTest); +begin + inherited; + with Message do + if Result <> HTCLIENT then Result := HTBORDER; + FHitTest := HTCLIENT; +end; + +procedure TdxBarQuickControl.WMNCPaint(var Message: TMessage); +var + DC: HDC; +begin + inherited; + DC := GetWindowDC(Handle); + Painter.BarDrawOwnerLink(Self, DC); + ReleaseDC(Handle, DC); +end; + +procedure TdxBarQuickControl.WMRButtonDown(var Message: TWMRButtonDown); +begin + with TMessage(Message) do + Result := DefWindowProc(Handle, Msg, wParam, lParam); +end; + +function TdxBarQuickControl.GetParentForm: TCustomForm; +begin + if ParentBar <> nil then + Result := ParentBar.GetParentForm + else + Result := inherited GetParentForm; +end; + +function TdxBarQuickControl.GetSizeForPopup: TSize; +begin + with GetSizeForWidth(dsNone, 0) do + Result := Size(X, Y); + with Painter.GetToolbarContentOffsets(Bar, DockingStyle, False) do + begin + Inc(Result.cx, Left + Right); + Inc(Result.cy, Top + Bottom); + end; +end; + +function TdxBarQuickControl.GetToolbarBrush: HBRUSH; +begin + Result := Painter.BarToolbarBrushEx2(Self); +end; + +function TdxBarQuickControl.HasCaption: Boolean; +begin + Result := False; +end; + +function TdxBarQuickControl.IsLinkedToOwner: Boolean; +begin + Result := inherited IsLinkedToOwner(* or + ((ParentBar <> nil) and (ParentBar.FQuickPopup = Self))*); +end; + +function TdxBarQuickControl.IsPopup: Boolean; +begin + Result := True; +end; + +function TdxBarQuickControl.LockHotTrackWhenPopup: Boolean; +begin + Result := False; +end; + +function TdxBarQuickControl.NeedShowGlyphAndCheckForItem: Boolean; +begin + Result := True; +end; + +function TdxBarQuickControl.GetOwnerControl: TWinControl; +begin + Result := ParentBar; +end; + +function TdxBarQuickControl.Kind: TdxBarKind; +begin + Result := bkBarQuickControl; +end; + +procedure TdxBarQuickControl.Popup(const AOwnerRect: TRect); + + function GetDirection: TXDirection; + begin + if (ParentBar.DockingStyle = dsNone) and Painter.IsQuickControlPopupOnRight then + Result := xdRight + else + Result := xdLeft; + end; + +begin + PopupEx(AOwnerRect, GetDirection); +end; + +procedure TdxBarQuickControl.StartHidingTimer; +begin + FHidingTimer.Enabled := True; +end; + +{ TdxBarManagerCategories } + +type + TdxBarCategoryData = class + public + ItemsVisible, LoadedItemsVisible: TdxBarItemVisible; + Visible: Boolean; + end; + + TdxBarManagerCategories = class(TStringList) + private + FMoving: Boolean; + Owner: TdxBarManager; + procedure ListChanged(Sender: TObject); + procedure ChangeCategory(OldCategory, NewCategory: Integer); + procedure ReadItemsVisibles(Reader: TReader); + procedure ReadVisibles(Reader: TReader); + procedure WriteItemsVisibles(Writer: TWriter); + procedure WriteVisibles(Writer: TWriter); + + function IsIndexValid(AIndex: Integer): Boolean; + protected + procedure ClearObject(AIndex: Integer); + procedure ClearObjects; + procedure DefineProperties(Filer: TFiler); override; + public + constructor Create(AOwner: TdxBarManager); + destructor Destroy; override; + procedure Clear; override; + procedure Delete(Index: Integer); override; + procedure Insert(Index: Integer; const S: string); override; + procedure Exchange(Index1, Index2: Integer); override; + procedure Move(CurIndex, NewIndex: Integer); override; + end; + +constructor TdxBarManagerCategories.Create(AOwner: TdxBarManager); +begin + inherited Create; + Owner := AOwner; + if not Owner.IsLoading then + Add(cxGetResourceString(@dxSBAR_DEFAULTCATEGORYNAME)); + OnChange := ListChanged; +end; + +destructor TdxBarManagerCategories.Destroy; +begin + ClearObjects; + inherited; +end; + +procedure TdxBarManagerCategories.Clear; +begin + ClearObjects; + inherited; +end; + +procedure TdxBarManagerCategories.ListChanged(Sender: TObject); +begin + Owner.DesignerModified; +end; + +procedure TdxBarManagerCategories.ChangeCategory(OldCategory, NewCategory: Integer); +var + AList: TList; + I: Integer; +begin + if IsIndexValid(OldCategory) and (NewCategory > -1) then + begin + AList := TList.Create; + try + Owner.GetAllItemsByCategory(OldCategory, AList); + for I := 0 to AList.Count - 1 do + TdxBarItem(AList[I]).FCategory := NewCategory; + finally + AList.Free; + end; + end; +end; + +procedure TdxBarManagerCategories.ReadItemsVisibles(Reader: TReader); +var + I: Integer; +begin + Reader.ReadListBegin; + try + BeginUpdate; + try + for I := 0 to Count - 1 do + begin + if Reader.EndOfList then Break; + Owner.CategoryItemsVisible[I] := TdxBarItemVisible(Reader.ReadInteger); + end; + finally + EndUpdate; + end; + finally + Reader.ReadListEnd; + end; +end; + +procedure TdxBarManagerCategories.ReadVisibles(Reader: TReader); +var + I: Integer; +begin + Reader.ReadListBegin; + try + BeginUpdate; + try + for I := 0 to Count - 1 do + begin + if Reader.EndOfList then Break; + Owner.CategoryVisible[I] := Reader.ReadBoolean; + end; + finally + EndUpdate; + end; + finally + Reader.ReadListEnd; + end; +end; + +procedure TdxBarManagerCategories.WriteItemsVisibles(Writer: TWriter); +var + I: Integer; +begin + Writer.WriteListBegin; + try + for I := 0 to Count - 1 do + Writer.WriteInteger(Longint(Owner.CategoryItemsVisible[I])); + finally + Writer.WriteListEnd; + end; +end; + +procedure TdxBarManagerCategories.WriteVisibles(Writer: TWriter); +var + I: Integer; +begin + Writer.WriteListBegin; + try + for I := 0 to Count - 1 do + Writer.WriteBoolean(Owner.CategoryVisible[I]); + finally + Writer.WriteListEnd; + end; +end; + +function TdxBarManagerCategories.IsIndexValid(AIndex: Integer): Boolean; +begin + Result := (0 <= AIndex) and (AIndex < Count); +end; + +procedure TdxBarManagerCategories.ClearObject(AIndex: Integer); +begin + if Objects[AIndex] <> nil then + begin + Objects[AIndex].Free; + Objects[AIndex] := nil; + end; +end; + +procedure TdxBarManagerCategories.ClearObjects; +var + I: Integer; +begin + for I := 0 to Count - 1 do + ClearObject(I); +end; + +procedure TdxBarManagerCategories.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('ItemsVisibles', ReadItemsVisibles, WriteItemsVisibles, True); + Filer.DefineProperty('Visibles', ReadVisibles, WriteVisibles, True); +end; + +procedure TdxBarManagerCategories.Delete(Index: Integer); + + procedure DeleteCategoryItems; + var + AList: TObjectList; + begin + AList := TObjectList.Create; + try + Owner.GetAllItemsByCategory(Index, AList); + finally + AList.Free; + end; + end; + +var + I: Integer; +begin + if FMoving then inherited + else + begin + if IsIndexValid(Index) then + begin + DeleteCategoryItems; + for I := Index + 1 to Count - 1 do + ChangeCategory(I, I - 1); + ClearObject(Index); + inherited; + end; + if Count = 0 then + Add(cxGetResourceString(@dxSBAR_DEFAULTCATEGORYNAME)); + end; +end; + +procedure TdxBarManagerCategories.Insert(Index: Integer; const S: string); +var + I: Integer; +begin + if not FMoving and IsIndexValid(Index) then + for I := Count - 1 downto Index do + ChangeCategory(I, I + 1); + inherited Insert(Index, S); +end; + +procedure TdxBarManagerCategories.Exchange(Index1, Index2: Integer); +var + I: Integer; + List1: TList; + List2: TList; +begin + if IsIndexValid(Index1) and IsIndexValid(Index2) then + begin + List1 := TList.Create; + List2 := TList.Create; + try + Owner.GetAllItemsByCategory(Index1, List1); + Owner.GetAllItemsByCategory(Index2, List2); + for I := 0 to List1.Count - 1 do + TdxBarItem(List1[I]).Category := Index2; + for I := 0 to List2.Count - 1 do + TdxBarItem(List2[I]).Category := Index1; + finally + List2.Free; + List1.Free; + end; + inherited Exchange(Index1, Index2); + end; +end; + +procedure TdxBarManagerCategories.Move(CurIndex, NewIndex: Integer); +var + List: TList; + I: Integer; +begin + if IsIndexValid(CurIndex) and IsIndexValid(NewIndex) and (CurIndex <> NewIndex) then + begin + List := TList.Create; + try + Owner.GetAllItemsByCategory(CurIndex, List); + for I := 0 to List.Count - 1 do + TdxBarItem(List[I]).FCategory := dxBarManagerTempCategoryIndex; + if CurIndex < NewIndex then + for I := CurIndex + 1 to NewIndex do + ChangeCategory(I, I - 1) + else + for I := CurIndex - 1 downto NewIndex do + ChangeCategory(I, I + 1); + for I := 0 to List.Count - 1 do + TdxBarItem(List[I]).FCategory := NewIndex; + finally + List.Free; + end; + FMoving := True; + inherited Move(CurIndex, NewIndex); + FMoving := False; + end; +end; + +{ TdxBarKeyTipData } + +constructor TdxBarKeyTipData.Create(const AKeyTipInfo: TdxBarKeyTipInfo); +begin + inherited Create; + FKeyTipInfo := AKeyTipInfo; +end; + +procedure TdxBarKeyTipData.HideKeyTipWindow( + AKeyTipWindowsManager: IdxBarKeyTipWindowsManager); +begin + if FKeyTipWindow <> nil then + begin + AKeyTipWindowsManager.Delete(FKeyTipWindow); + FKeyTipWindow := nil; + end; +end; + +procedure TdxBarKeyTipData.ShowKeyTipWindow( + AKeyTipWindowsManager: IdxBarKeyTipWindowsManager); +begin + if FKeyTipWindow = nil then + AKeyTipWindowsManager.Add(NormalizedKeyTip, BasePoint, HorzAlign, VertAlign, + Enabled, FKeyTipWindow); +end; + +function TdxBarKeyTipData.GetNormalizedKeyTip: string; +begin + Result := AnsiUpperCase(KeyTip); +end; + +{ TdxBarPersistent } + +constructor TdxBarPersistent.Create(ABarManager: TdxBarManager); +begin + inherited Create; + FBarManager := ABarManager; +end; + +function TdxBarPersistent.GetOwner: TPersistent; +begin + Result := FBarManager; +end; + +{$IFNDEF DELPHI6} +destructor TComponentList.Destroy; +begin + Clear; + inherited; +end; +{$ENDIF} + +{ TdxBarControlEditor } + +class procedure TdxBarControlEditor.InitCustomizationPopup(AItemLinks: TdxBarItemLinks); +var + AItemLink: TdxBarItemLink; +begin + AItemLink := BarDesignController.AddInternalItem(AItemLinks, PopupItemClass, GetPopupItemCaption); + InitializePopupItem(AItemLink); +end; + +class function TdxBarControlEditor.GetAddedItemClass(const AAddedItemName: string): TdxBarItemClass; +begin + Result := nil; +end; + +class function TdxBarControlEditor.GetPopupItemCaption: string; +begin + Result := ''; +end; + +class procedure TdxBarControlEditor.InitializePopupItem(AItemLink: TdxBarItemLink); +begin +// do nothing +end; + +class function TdxBarControlEditor.PopupItemClass: TdxBarItemClass; +begin + Result := nil; +end; + +class procedure TdxBarControlEditor.AddItem(AClickedButton: TdxBarButton); +var + AItemLink: TdxBarItemLink; +begin + AItemLink := BarDesignController.AddItem(GetAddedItemClass(AClickedButton.Caption)); + InitializeAddedItem(AItemLink, AClickedButton.Caption); +// BarDesignController.SelectItem(AItemLink); +// AItemLink.BarControl.SetKeySelectedItem(AItemLink.Control); + AItemLink.BarControl.SelectItemControl(AItemLink.Control, mbRight, []); +end; + +class procedure TdxBarControlEditor.InitializeAddedItem(AItemLink: TdxBarItemLink; AAddedItemName: string); +begin +// do nothing +end; + +class procedure TdxBarControlEditor.OnButtonClick(Sender: TObject); +begin + AddItem(TdxBarButton(Sender)); +end; + +{ TdxAddSubItemEditor } + +class function TdxAddSubItemEditor.GetAddedItemClass(const AAddedItemName: string): TdxBarItemClass; +begin + Result := TdxBarSubItem; +end; + +class function TdxAddSubItemEditor.GetPopupItemCaption: string; +begin + Result := dxSBAR_CP_ADDSUBITEM; +end; + +class procedure TdxAddSubItemEditor.InitializePopupItem(AItemLink: TdxBarItemLink); +begin + TdxBarButton(AItemLink.Item).OnClick := OnButtonClick; + AItemLink.Item.Enabled := BarDesignController.CustomizingBarManager.CanAddComponents; +end; + +class function TdxAddSubItemEditor.PopupItemClass: TdxBarItemClass; +begin + Result := TdxBarButton; +end; + +{ TdxAddButtonEditor } + +class function TdxAddButtonEditor.GetAddedItemClass(const AAddedItemName: string): TdxBarItemClass; +begin + Result := TdxBarButton; +end; + +class function TdxAddButtonEditor.GetPopupItemCaption: string; +begin + Result := dxSBAR_CP_ADDBUTTON; +end; + +{ TdxAddSeparatorEditor } + +class function TdxAddSeparatorEditor.GetAddedItemClass(const AAddedItemName: string): TdxBarItemClass; +begin + Result := TdxBarSeparator; +end; + +class function TdxAddSeparatorEditor.GetPopupItemCaption: string; +begin + Result := dxSBAR_CP_ADDSEPARATOR; +end; + +{ TdxItemsEditorEx } + +class procedure TdxItemsEditorEx.InitSubItem(AItemLinks: TdxBarItemLinks); +var + I: Integer; +begin + for I := 0 to RegdxItemList.VisibleItemCount - 1 do + BarDesignController.AddInternalItem(AItemLinks, TdxBarButton, + RegdxItemList.VisibleItemClass[I].ClassName, OnButtonClick); +end; + +class function TdxItemsEditorEx.GetAddedItemClass(const AAddedItemName: string): TdxBarItemClass; +begin + Result := TdxBarItemClass(FindClass(AAddedItemName)); +end; + +class function TdxItemsEditorEx.GetPopupItemCaption: string; +begin + Result := dxSBAR_CP_ADDDXITEM; +end; + +class procedure TdxItemsEditorEx.InitializePopupItem(AItemLink: TdxBarItemLink); +var + ASubItem: TdxBarSubItem; +begin + ASubItem := TdxBarSubItem(AItemLink.Item); + ASubItem.Enabled := BarDesignController.CustomizingBarManager.CanAddComponents; + ASubItem.IsInternal := True; + if ASubItem.Enabled then + begin + ASubItem.ItemLinks.BeginUpdate; + try + InitSubItem(ASubItem.ItemLinks); + finally + ASubItem.ItemLinks.EndUpdate; + end; + end; +end; + +class function TdxItemsEditorEx.PopupItemClass: TdxBarItemClass; +begin + Result := TdxBarSubItem; +end; + +{ TCustomdxBarControlDesignHelper } + +class procedure TCustomdxBarControlDesignHelper.FilterItemActions(var ASupportedActions: TdxBarCustomizationActions); +begin + ASupportedActions := ASupportedActions - GetForbiddenActions; +end; + +class procedure TCustomdxBarControlDesignHelper.GetEditors(AEditors: TList); +var + I: Integer; +begin + for I := 0 to BarDesignController.FRegisteredBarControlEditors.Count - 1 do + AEditors.Add(BarDesignController.FRegisteredBarControlEditors[I]) +end; + +class function TCustomdxBarControlDesignHelper.GetForbiddenActions: TdxBarCustomizationActions; +begin + Result := [caChangeButtonPaintStyle, caChangePosition, caChangeViewLevels, caChangeButtonGroup, caChangeRecentList] +end; + +{ TdxBarControlDesignHelper } + +class function TdxBarControlDesignHelper.GetForbiddenActions: TdxBarCustomizationActions; +begin + Result := inherited GetForbiddenActions - [caChangeButtonPaintStyle]; +end; + +{ TdxBarSubMenuControlDesignHelper } + +class procedure TdxBarSubMenuControlDesignHelper.GetEditors(AEditors: TList); +begin + inherited GetEditors(AEditors); + AEditors.Add(TdxAddSeparatorEditor); +end; + +class function TdxBarSubMenuControlDesignHelper.GetForbiddenActions: TdxBarCustomizationActions; +begin + Result := inherited GetForbiddenActions - [caChangeRecentList]; +end; + +{ TdxBarDesignController } + +constructor TdxBarDesignController.Create; +begin + inherited Create; + FRegisteredBarControlDesignHelpers := TcxRegisteredClassList.Create; + FRegisteredBarControlEditors := TList.Create; + FNotifyComponent := TcxFreeNotificator.Create(nil); + FNotifyComponent.OnFreeNotification := FreeNotification; + FInternalItems := TComponentList.Create; +end; + +destructor TdxBarDesignController.Destroy; +begin + FreeAndNil(FInternalItems); + FreeAndNil(FNotifyComponent); + FreeAndNil(FRegisteredBarControlEditors); + FreeAndNil(FRegisteredBarControlDesignHelpers); + inherited; +end; + +procedure TdxBarDesignController.AddCustomizeItem(AItemLinks: TdxBarItemLinks; + AItemClass: TdxBarItemClass; ABeginGroup: Boolean = True); +var + AItemLink: TdxBarItemlink; +begin + if AItemLinks.BarManager.CanCustomize then + begin + AItemLink := AddInternalItem(AItemLinks, AItemClass, + cxGetResourceString(@dxSBAR_CUSTOMIZE), CustomizeItemClick); + AItemLink.BeginGroup := ABeginGroup; + AItemLink.Item.Enabled := dxBarCustomizingForm = nil; + end; +end; + +function TdxBarDesignController.AddInternalItem(AItemLinks: TdxBarItemLinks; + AItemClass: TdxBarItemClass; ACaption: string; AOnClick: TNotifyEvent = nil; + ATag: Integer = 0; ABeginGroup: Boolean = False): TdxBarItemLink; +var + AItem: TdxBarItem; +begin + Result := AItemLinks.AddItem(AItemClass, nil); + AItem := Result.Item; + AddInternalItem(AItem); + + AItem.Caption := ACaption; + AItem.OnClick := AOnClick; + AItem.Tag := ATag; + Result.BeginGroup := ABeginGroup; +end; + +procedure TdxBarDesignController.AddInternalItem(AItem: TdxBarItem; AList: TList = nil); +begin + if AList = nil then + AList := FInternalItems; + + AList.Add(AItem); + RemoveItemFromBarManagerList(AItem); +end; + +procedure TdxBarDesignController.ClearInternalItems; +begin + FInternalItems.Clear; +end; + +procedure TdxBarDesignController.RemoveItemFromBarManagerList(AItem: TdxBarItem); +begin + AItem.BarManager.ItemList.Remove(AItem); +end; + +function TdxBarDesignController.AddItem(ABarItemClass: TdxBarItemClass): TdxBarItemLink; +var + ACategoryIndex, AItemIndex: Integer; + AItem: TdxBarItem; +begin + CustomizingBarManager.ItemList.BeginUpdate; + try + FCustomizingItemLinks.BeginUpdate; + try + Result := FCustomizingItemLinks.AddItem(ABarItemClass, {GetBarManagerForm(FCustomizingBarManager, fkAny).Designer.GetRoot} FCustomizingBarManager.Owner); + + AItem := Result.Item; + ACategoryIndex := FCustomizingBarManager.Categories.IndexOf(dxSBAR_DEFAULTCATEGORYNAME); + if ACategoryIndex = -1 then + ACategoryIndex := 0; + AItem.Category := ACategoryIndex; + AItem.Name := FCustomizingBarManager.GetUniqueItemName(ABarItemClass); + AItem.Caption := ABarItemClass.GetNewCaption; + AItemIndex := FCustomizingItemLinks.IndexOf(CustomizingItemLink); //#DG ! FCustomizingItemLinks.Index + if AItemIndex <> -1 then + Result.Index := AItemIndex + 1; + finally + FCustomizingItemLinks.EndUpdate; + end; + finally + CustomizingBarManager.ItemList.EndUpdate; + end; +end; + +procedure TdxBarDesignController.SelectItemLink(AItemLink: TdxBarItemLink); +begin + if (CustomizingBarControl <> nil) and + not IsRectEmpty(CustomizingBarControl.GetItemRect(AItemLink.Control)) then + begin + CustomizingBarControl.BarGetFocus(AItemLink.Control); + SelectItem(AItemLink); //#DG new + end; +end; + +procedure TdxBarDesignController.DesignerModified; +begin + FCustomizingBarManager.DesignerModified; +end; + +function TdxBarDesignController.IsCustomizedByPopup: Boolean; +begin + Result := FCustomizationPopup <> nil; +end; + +procedure TdxBarDesignController.RegisterBarControlDesignHelper( + ABarControlClass: TCustomdxBarControlClass; + AHelperClass: TCustomdxBarControlDesignHelperClass); +begin + FRegisteredBarControlDesignHelpers.Register(ABarControlClass, AHelperClass); +end; + +procedure TdxBarDesignController.RegisterBarControlEditor(AEditor: TdxBarControlEditorClass); +begin + FRegisteredBarControlEditors.Add(AEditor); +end; + +procedure TdxBarDesignController.UnregisterBarControlDesignHelper( + ABarControlClass: TCustomdxBarControlClass; + AHelperClass: TCustomdxBarControlDesignHelperClass); +begin + FRegisteredBarControlDesignHelpers.Unregister(ABarControlClass, AHelperClass); +end; + +procedure TdxBarDesignController.UnregisterBarControlEditor( + AEditor: TdxBarControlEditorClass); +begin + FRegisteredBarControlEditors.Remove(AEditor); +end; + +procedure TdxBarDesignController.DropSelection(ASelectableItem: IdxBarSelectableItem); +begin + if IsItemLastSelected(ASelectableItem) then + FLastSelectedItem := nil; +end; + +function TdxBarDesignController.IsItemCustomized(ASelectableItem: IdxBarSelectableItem): Boolean; +begin + Result := IsCustomizedByPopup and (ASelectableItem.GetInstance = FCustomizingItemLink); +end; + +function TdxBarDesignController.IsItemLastSelected(ASelectableItem: IdxBarSelectableItem): Boolean; +begin + Result := (ASelectableItem <> nil) and (ASelectableItem = LastSelectedItem); +end; + +function TdxBarDesignController.IsItemLinkCustomized: Boolean; +begin + Result := IsCustomizedByPopup and (FCustomizingItemLink <> nil); +end; + +function TdxBarDesignController.IsItemSingleSelected(ASelectableItem: IdxBarSelectableItem): Boolean; +begin + Result := (ASelectableItem <> nil) and IsSelectionSingle(ASelectableItem.GetBarManager); +end; + +function TdxBarDesignController.IsSelectionComplex(ABarManager: TdxBarManager): Boolean; +var + ASelection: TdxObjectList; + I: Integer; +begin + Result := False; + ASelection := TdxObjectList.Create; + try + ABarManager.GetSelection(ASelection); + CleanSelectableItems(ASelection); + for I := 0 to ASelection.Count - 1 do + Result := Result or GetSelectableItem(ASelection[I]).IsComplex; + finally + ASelection.Free; + end; +end; + +function TdxBarDesignController.IsSelectionSingle(ABarManager: TdxBarManager): Boolean; +var + ASelection: TdxObjectList; +begin + ASelection := TdxObjectList.Create; + try + ABarManager.GetSelection(ASelection); + CleanSelectableItems(ASelection); + Result := ASelection.Count = 1; + finally + ASelection.Free; + end; +end; + +function TdxBarDesignController.NeedDefaultSelection(ASelectableItem: IdxBarSelectableItem): Boolean; +begin +// Result := IsItemCustomized(ASelectableItem) or IsItemSingleSelected(ASelectableItem) and not IsSelectionComplex(ASelectableItem.GetBarManager); + Result := not ASelectableItem.GetBarManager.Designing and IsItemLastSelected(ASelectableItem) or + IsSelectionSingle(ASelectableItem.GetBarManager) and + (not IsSelectionComplex(ASelectableItem.GetBarManager) or IsItemCustomized(ASelectableItem)); +end; + +procedure TdxBarDesignController.SelectItem(ASelectableItem: IdxBarSelectableItem; + ASelectionOperation: TdxBarSelectionOperation = soExclusive); +begin + if ASelectableItem <> nil then + ASelectableItem.SelectComponent(ASelectionOperation); + case ASelectionOperation of + soAdd, soExclusive: LastSelectedItem := ASelectableItem; + soExclude: SynchronizeLastSelectedItem; + end; +end; + +procedure TdxBarDesignController.SelectObject(AObject: TPersistent; + ASelectionOperation: TdxBarSelectionOperation); +begin + if GetSelectableItem(AObject) <> nil then + SelectItem(GetSelectableItem(AObject), ASelectionOperation) + else + CustomizingBarManager.SelectComponent(AObject, ASelectionOperation); +end; + +procedure TdxBarDesignController.SynchronizeLastSelectedItem; +begin + if (LastSelectedItem <> nil) and + (not LastSelectedItem.IsComponentSelected or not IsApplicationActive)then + LastSelectedItem := nil; +end; + +function TdxBarDesignController.DeleteSelectedObjects(ADestruction, AIsKeyboardAction: Boolean): Boolean; + + function IsComplexItemSelected(ASelection: TdxObjectList): Boolean; + var + I: Integer; + begin + Result := False; + for I := 0 to ASelection.Count - 1 do + Result := Result or (ASelection[I] is TdxBarItem) and (TdxBarItem(ASelection[I]).LinkCount > 1); + end; + + function GetNextSelectedObject(ASelection: TdxObjectList): TPersistent; + + function CanSelect(AObject: TObject): Boolean; + begin + Result := (ASelection.IndexOf(AObject) = -1) and IsObjectUnbound(AObject, ASelection); + end; + + var + ASelectableItem, ANextSelectableItem: IdxBarSelectableItem; + begin + Result := nil; + ASelectableItem := GetSelectableItem(ASelection.Last); + ANextSelectableItem := ASelectableItem.GetNextSelectableItem; + while (Result = nil) and (ANextSelectableItem <> nil) and (ANextSelectableItem.GetInstance <> ASelectableItem.GetInstance) do + begin + if CanSelect(ANextSelectableItem.GetInstance) then + Result := ANextSelectableItem.GetInstance; + ANextSelectableItem := ANextSelectableItem.GetNextSelectableItem; + end; + if (Result = nil) and CanSelect(ASelectableItem.GetSelectableParent) then + Result := ASelectableItem.GetSelectableParent; + end; + +var + ASelection: TdxObjectList; + ASelectableItem: IdxBarSelectableItem; + ANextSelectedObject: TPersistent; + I: Integer; +begin + Result := False; + + FindCustomizingBarManager; + if CanCustomize(CustomizingBarManager, AIsKeyboardAction) then + begin + if CustomizingBarManager.Designing then + begin + ASelection := TdxObjectList.Create; + try + GetSelection(ASelection); + RemoveIrrelevantObjectsForDelete(ASelection, ADestruction); + if ASelection.Count > 0 then + begin + Result := True; + if ADestruction or not IsComplexItemSelected(ASelection) or + (dxBarMessageBox(dxSBAR_WANTTODELETECOMPLEXITEM, MB_YESNO) = IDYES) then + begin + CustomizingBarManager.BeginUpdate; + try + ANextSelectedObject := GetNextSelectedObject(ASelection); + for I := ASelection.Count - 1 downto 0 do + begin + ASelectableItem := GetSelectableItem(ASelection[I]); + ASelectableItem.DeleteSelection(ASelectableItem, ADestruction); + end; + if ANextSelectedObject <> nil then + SelectObject(ANextSelectedObject); + finally + CustomizingBarManager.EndUpdate; + end; + DesignerModified; + end; + end; + finally + ASelection.Free; + end; + end + else + CustomizingBarManager.LastSelectedLinkAtDesign.Free; + end; +end; + +procedure TdxBarDesignController.DeleteCustomizingItem; +begin + if FCustomizingItemLink = nil then Exit; + FCustomizingItemLink.Item.Free; + FCustomizingItemLink := nil; +end; + +procedure TdxBarDesignController.DeleteCustomizingItemLink; +begin + FreeAndNil(FCustomizingItemLink); +end; + +function TdxBarDesignController.SelectParentComponent: Boolean; +var + ASelectedObjects: TdxObjectList; + ASelectableItem: IdxBarSelectableItem; +begin + FindCustomizingBarManager; + if CanCustomize(CustomizingBarManager, True) then + begin + ASelectedObjects := TdxObjectList.Create; + try + CustomizingBarManager.GetActiveSelection(ASelectedObjects); + Result := IsSelectableItem(ASelectedObjects.Last, ASelectableItem) and + ASelectableItem.SelectParentComponent; + finally + ASelectedObjects.Free; + end; + end + else + Result := False; +end; + +procedure TdxBarDesignController.ShowCustomCustomizePopup(ABarManager: TdxBarManager; + AInitPopupProc: TInitPopupProc; APainter: TdxBarPainter; + ACustomizingBarControl: TCustomdxBarControl = nil; ACustomizingItemLink: TdxBarItemLink = nil); + + procedure DeactivateCustomizingItem; + begin +// if (FCustomizingBarControl <> nil) and FCustomizingBarControl.IsFocused then +// FCustomizingBarControl.SetMouseSelectedItem(GetControlByLink(FCustomizingItemLink)); + if (FCustomizingBarControl <> nil) and (FCustomizingBarControl.SelectedControl <> nil) then + FCustomizingBarControl.SelectedControl.ControlInactivate(False); + end; + +begin + ClearInternalItems; + + FCustomizingBarControl := ACustomizingBarControl; + FCustomizingItemLink := ACustomizingItemLink; + FCustomizingBarManager := ABarmanager; + + FCustomizationPopup := TdxBarCustomizingPopup.Create(FCustomizingBarManager); + if ACustomizingBarControl <> nil then + FCustomizationPopup.ParentWnd := ACustomizingBarControl.Handle; + FCustomizationPopup.FPainter := APainter; + FCustomizationPopup.OnCloseUp := CustomizationPopupCloseUp; + FCustomizationPopup.OnDestroy := CustomizationPopupDestroy; + AInitPopupProc(FCustomizationPopup.ItemLinks); + if FCustomizationPopup.ItemLinks.Count > 0 then + begin + DeactivateCustomizingItem; + FCustomizationPopup.DoShowCustomizingPopup; + + FCustomizationPopup.Left := GetMouseCursorPos.X; + FCustomizationPopup.Top := GetMouseCursorPos.Y; + FCustomizationPopup.Show; + end + else + begin + FCustomizingBarControl := nil; + FreeAndNil(FCustomizationPopup); + end; +end; + +procedure TdxBarDesignController.ShowCustomizePopup(ABarControl: TCustomdxBarControl; + ACustomizingItemLink: TdxBarItemLink); +begin + FCustomizingItemLinks := ABarControl.ItemLinks; + ShowCustomCustomizePopup(ABarControl.Barmanager, InitCustomizationPopup, ABarControl.Painter, ABarControl, ACustomizingItemLink); +end; + +procedure TdxBarDesignController.SetCustomizePopupTopMosts(AShow: Boolean); +var + APrevBarControl, ABarControl: TCustomdxBarControl; +begin + if AShow then + begin + dxSetZOrder(FCustomizationPopup.Handle); + APrevBarControl := FCustomizationPopup; + if CustomizingItemLink.Control <> nil then + begin + ABarControl := CustomizingBarControl; + repeat + dxSetZOrder(ABarControl.Handle, APrevBarControl.Handle); + APrevBarControl := ABarControl; + ABarControl := ABarControl.ParentBar; + until ABarControl = nil; + end; + end + else + begin + if CustomizingItemLink.Control <> nil then + begin + ABarControl := CustomizingBarControl; + while ABarControl.ParentBar <> nil do + ABarControl := ABarControl.ParentBar; + repeat + dxSetZOrder(ABarControl.Handle, HWND_NOTOPMOST); + ABarControl := ABarControl.ChildBar; + until ABarControl = nil; + end; + dxSetZOrder(FCustomizationPopup.Handle, HWND_NOTOPMOST); + end; +end; + +procedure TdxBarDesignController.InitToolBarPopup(AItemLinks: TdxBarItemLinks); +var + I: Integer; + ABars: TdxBars; + ABar: TdxBar; + AItem: TdxBarButton; + AItemLink: TdxBarItemLink; +begin + ClearOwnedItems(AItemLinks); + ABars := AItemLinks.BarManager.Bars; + for I := 0 to ABars.Count - 1 do + begin + ABar := ABars[I]; + if ABar.CanClose and not ABar.Hidden and (ABar.MergeData.MergedWith = nil) then + begin + AItemLink := AddInternalItem(AItemLinks, TdxBarButton, ABar.Caption, ToolbarsPopupClick); + AItem := TdxBarButton(AItemLink.Item); + AItem.Tag := Integer(ABar); + AItem.ButtonStyle := bsChecked; + AItem.Down := ABars[I].Visible; + end; + end; + AddCustomizeItem(AItemLinks, TdxBarButton); +end; + +procedure TdxBarDesignController.ShowToolbarsPopup(ABarManager: TdxBarManager; APainter: TdxBarPainter); +var + AToolbarsPopup: TdxBarToolbarsPopup; +begin + ClearInternalItems; + + FCustomizingBarManager := ABarManager; + AToolbarsPopup := TdxBarToolbarsPopup.Create(ABarManager); + AToolbarsPopup.FPainter := APainter; + InitToolBarPopup(AToolbarsPopup.ItemLinks); + ABarManager.DoShowToolbarsPopup(AToolbarsPopup.ItemLinks); + if AToolbarsPopup.FItemLinks.Count = 0 then + AToolbarsPopup.Free + else + begin + ABarManager.HideAll; + AToolbarsPopup.Left := GetMouseCursorPos.X; + AToolbarsPopup.Top := GetMouseCursorPos.Y; + AToolbarsPopup.FShowAnimation := True; + AToolbarsPopup.Show; + end; +end; + +procedure TdxBarDesignController.ShowQuickControl(ABarControl: TdxBarControl; AOwnerRect: TRect); +begin + FCustomizingBarManager := ABarControl.Barmanager; + + FQuickControl := ABarControl.GetQuickControlClass.CreateForPopup(ABarControl, ABarControl.Bar); + FQuickControl.FPainter := ABarControl.Painter; + FQuickControl.OnDestroy := QuickControlDestroy; + ABarControl.InitQuickControl(FQuickControl.ItemLinks); + FQuickControl.Popup(AOwnerRect); + PlaySound(psMenuPopup); +end; + +function TdxBarDesignController.CanDeleteSelectedObjects: Boolean; +var + ASelection: TdxObjectList; +begin + ASelection := TdxObjectList.Create; + try + GetSelection(ASelection); + RemoveIrrelevantObjectsForDelete(ASelection); + Result := ASelection.Count > 0; + finally + ASelection.Free; + end; +end; + +procedure TdxBarDesignController.GetSelection(ASelection: TdxObjectList); +begin + CustomizingBarManager.GetSelection(ASelection); + CleanSelectableItems(ASelection); +end; + +function TdxBarDesignController.IsObjectUnbound(AObject: TObject; AMasterObjects: TdxObjectList): Boolean; +var + I: Integer; + AInternalMasterObjects: TdxObjectList; + ASelectableItem: IdxBarSelectableItem; +begin + Result := True; + if IsSelectableItem(AObject, ASelectableItem) then + begin + AInternalMasterObjects := TdxObjectList.Create; + try + ASelectableItem.GetMasterObjects(AInternalMasterObjects); + for I := 0 to AInternalMasterObjects.Count - 1 do + Result := (AMasterObjects.IndexOf(AInternalMasterObjects[I]) = -1) and IsObjectUnbound(AInternalMasterObjects[I], AMasterObjects); + finally + AInternalMasterObjects.Free; + end; + end; +end; + +procedure TdxBarDesignController.RemoveIrrelevantObjectsForDelete(ASelection: TdxObjectList; ADestruction: Boolean = False); +var + I: Integer; +begin + for I := ASelection.Count - 1 downto 0 do + if not GetSelectableItem(ASelection[I]).CanDelete(ADestruction) or + ADestruction and not IsObjectUnbound(ASelection[I], ASelection) then + ASelection.Delete(I); +end; + +procedure TdxBarDesignController.ClearOwnedItems(AItemLinks: TdxBarItemLinks); +begin + while AItemLinks.Count > 0 do + AItemLinks.Items[0].Item.Free; +end; + +procedure TdxBarDesignController.CustomizeItemClick(Sender: TObject); +begin + TdxBarItem(Sender).BarManager.Customizing(True); +end; + +procedure TdxBarDesignController.TextItemChange(Sender: TObject); +begin + if TdxBarEdit(Sender).Text = '' then + begin + if FCustomizationPopup <> nil then + FCustomizationPopup.Hide; + dxBarMessageBox(cxGetResourceString(@dxSBAR_COMMANDNAMECANNOTBEBLANK), MB_ICONSTOP); + end + else + if FCustomizingBarManager.Designing then + begin + CustomizingItemLink.Item.Caption := TdxBarEdit(Sender).Text; + SynchronizeAction(caChangeCaption); + DesignerModified; + end + else + CustomizingItemLink.UserCaption := TdxBarEdit(Sender).Text; +end; + +procedure TdxBarDesignController.CustomizationPopupCloseUp(Sender: TObject); +begin +{ #DG problems when customize empty subcontrol + if (FCustomizingItemLink <> nil) and + not FCustomizingBarManager.FIsCustomizing and + (FCustomizingBarControl <> nil) and + (FCustomizingBarControl.SelectedItem = FCustomizingItemLink.Control) then + begin + FCustomizingBarManager.FSelectedItem := nil; + FCustomizingBarControl.SelectedItem := nil; + end; +} + FCustomizingBarControl := nil; +end; + +procedure TdxBarDesignController.CustomizationPopupDestroy(Sender: TObject); +begin + FCustomizationPopup := nil; +end; + +procedure TdxBarDesignController.CustomizationPopupItemClick(Sender: TObject); + + procedure ChangeButtonGroup(AButtonGroupAction: TdxChangeButtonGroupAction); + + const + AGroupPosition: array[TdxChangeButtonGroupAction] of TdxBarButtonGroupPosition = (bgpNone, bgpStart, bgpMember, bgpMember, bgpNone); + + procedure MakeButtonGroup; + var + I: Integer; + ALink: TdxBarItemLink; + begin + FCustomizingItemLinks.BeginUpdate; + try + ALink := CustomizingItemLink; + for I := FCustomizingItemLinks.Count - 1 downto 0 do + if FCustomizingItemLinks[I].IsComponentSelected then + begin + ALink := FCustomizingItemLinks[I]; + ALink.ButtonGroup := AGroupPosition[AButtonGroupAction]; + end; + if AButtonGroupAction = bgaGroup then + ALink.ButtonGroup := bgpStart; + finally + FCustomizingItemLinks.EndUpdate; + end; + end; + + begin + if AButtonGroupAction in [bgaNone..bgaMember] then + begin + CustomizingItemLink.ButtonGroup := AGroupPosition[AButtonGroupAction]; + SynchronizeAction(caChangeButtonGroup); + end + else + MakeButtonGroup; + end; + + procedure ChangeViewLevel(AViewLevelAction: TdxChangeViewLevelAction); + var + AViewLevel: TdxBarItemRealViewLevel; + begin + case AViewLevelAction of + vlaChangeLargeIconWithText..vlaChangeControl: + begin + AViewLevel := TdxBarItemViewLevel(AViewLevelAction); + if AViewLevel in CustomizingItemLink.ViewLevels then + CustomizingItemLink.ViewLevels := CustomizingItemLink.ViewLevels - [AViewLevel] + else + CustomizingItemLink.ViewLevels := CustomizingItemLink.ViewLevels + [AViewLevel]; + end; + vlaSetAll: + CustomizingItemLink.ViewLevels := [ivlLargeIconWithText..ivlControlOnly]; + vlaSetLargeIconWithTextOnly: + CustomizingItemLink.ViewLevels := [ivlLargeIconWithText]; + vlaSetSmallIconWithTextOnly: + CustomizingItemLink.ViewLevels := [ivlSmallIconWithText]; + vlaSetSmallIconOnly: + CustomizingItemLink.ViewLevels := [ivlSmallIcon]; + vlaControlOnly: + CustomizingItemLink.ViewLevels := [ivlControlOnly]; + end; + end; + +var + ADetailAction: WORD; + ABasicAction: TdxBarCustomizationAction; + ABarButton: TdxBarButton; +begin + ABarButton := TdxBarButton(Sender); + ABasicAction := TdxBarCustomizationAction(HiWord(ABarButton.Tag)); + ADetailAction := LoWord(ABarButton.Tag); + case ABasicAction of + caDelete: + DeleteSelectedObjects(False, False); + caDeleteItem: + DeleteSelectedObjects(True, False); + caDeleteLink: + DeleteCustomizingItemLink; + + // multiple operations + caReset: + CustomizingItemLink.UserDefine := []; + caChangeButtonPaintStyle: + CustomizingItemLink.UserPaintStyle := TdxBarPaintStyle(ADetailAction); + caChangePosition: + CustomizingItemLink.Position := TdxBarItemPosition(ADetailAction); + caChangeViewLevels: + begin + ChangeViewLevel(TdxChangeViewLevelAction(ADetailAction)); + UpdateViewLevelsSubItemButtonStates(ABarButton.Links[0].Owner); + end; + caChangeButtonGroup: + ChangeButtonGroup(TdxChangeButtonGroupAction(ADetailAction)); + caChangeBeginGroup: + CustomizingItemLink.BeginGroup := not CustomizingItemLink.BeginGroup; + caChangeVisible: + CustomizingItemLink.Visible := not CustomizingItemLink.Visible; + caChangeRecentList: + CustomizingItemLink.MostRecentlyUsed := not CustomizingItemLink.MostRecentlyUsed; + end; + if not (ABasicAction in [caDelete, caDeleteItem, caDeleteLink, caChangeButtonGroup]) then + SynchronizeAction(ABasicAction); +end; + +procedure TdxBarDesignController.InitCustomizationPopup(AItemLinks: TdxBarItemLinks); + + function AddCustomizationButton(AItemLinks: TdxBarItemLinks; + const ACaption: string; ABasicAction: TdxBarCustomizationAction; + ABeginGroup: Boolean = False; + AButtonStyle: TdxBarButtonStyle = bsDefault; + AIsDown: Boolean = False; + AEnabled: Boolean = True; + AGroupIndex: Integer = 0; ADetailAction: Word = 0): TdxBarButton; + var + AItemLink: TdxBarItemLink; + AItem: TdxBarButton; + begin + AItemLink := AddInternalItem(AItemLinks, TdxBarButton, ACaption, CustomizationPopupItemClick); + AItemLink.BeginGroup := ABeginGroup; + AItem := TdxBarButton(AItemLink.Item); + AItem.Tag := MakeLong(ADetailAction, Word(ABasicAction)); + AItem.ButtonStyle := AButtonStyle; + AItem.Down := AIsDown; + AItem.Enabled := AEnabled; + AItem.GroupIndex := AGroupIndex; + Result := AItem; + end; + + procedure AddCustomizationEdit(AItemLinks: TdxBarItemLinks; const ACaption: string); + var + AItemLink: TdxBarItemLink; + begin + AItemLink := AddInternalItem(AItemLinks, TdxBarEdit, ACaption); + AItemLink.BeginGroup := True; + TdxBarEdit(AItemLink.Item).Text := CustomizingItemLink.Caption; + TdxBarEdit(AItemLink.Item).FOnChange := TextItemChange; + end; + + function AddCustomizationSubItem(AItemLinks: TdxBarItemLinks; + const ACaption: string; AActionType: TdxBarCustomizationAction; + ABeginGroup: Boolean = False; AEnabled: Boolean = True): TdxBarSubItem; + var + AItemLink: TdxBarItemLink; + begin + AItemLink := AddInternalItem(AItemLinks, TdxBarSubItem, ACaption); + Result := TdxBarSubItem(AItemLink.Item); + AItemLink.BeginGroup := ABeginGroup; + Result.Enabled := AEnabled; + Result.IsInternal := True; + end; + + function GetBarControlDesignHelperClass: TCustomdxBarControlDesignHelperClass; + begin + Result := TCustomdxBarControlDesignHelperClass( + FRegisteredBarControlDesignHelpers.FindClass(CustomizingBarControl.ClassType)); + end; + + function GetSupportedActions: TdxBarCustomizationActions; + var + ASelection: TdxObjectList; + I: Integer; + ASelectableItem: IdxBarSelectableItem; + begin + Result := FLastSelectedItem.GetSupportedActions; + if CustomizingBarManager.Designing then + begin + ASelection := TdxObjectList.Create; + try + GetSelection(ASelection); + for I := 0 to ASelection.Count - 1 do + begin + ASelectableItem := GetSelectableItem(ASelection[I]); + Result := Result * ASelectableItem.GetSupportedActions; + end; + finally + ASelection.Free; + end; + end; + end; + + procedure AddViewLevelMenu; + + function GetButtonStyle(AViewLevelAction: TdxChangeViewLevelAction): TdxBarButtonStyle; + begin + if AViewLevelAction in [vlaChangeLargeIconWithText..vlaChangeControl] then + Result := bsChecked + else + Result := bsDefault; + end; + + function GetButtonCaption(AViewLevelAction: TdxChangeViewLevelAction; AViewLevelNames: TStringArray): string; + begin + case AViewLevelAction of + vlaChangeLargeIconWithText..vlaChangeControl: Result := AViewLevelNames[Ord(AViewLevelAction)]; + vlaSetAll: Result := cxGetResourceString(@dxSBAR_CP_ALLVIEWLEVELS); + else + Result := AViewLevelNames[Ord(AViewLevelAction) - Ord(vlaSetLargeIconWithTextOnly)] + cxGetResourceString(@dxSBAR_CP_SINGLEVIEWLEVELITEMSUFFIX); + end; + end; + + var + AViewLevelAction: TdxChangeViewLevelAction; + AViewLevelNames: TStringArray; + AOwnerLinks: TdxBarItemLinks; + begin + AViewLevelNames := SetToStringArray(TypeInfo(TdxBarItemViewLevels)); + AOwnerLinks := AddCustomizationSubItem(AItemLinks, cxGetResourceString(@dxSBAR_CP_VIEWLEVELSMENU), caChangeViewLevels).ItemLinks; + for AViewLevelAction := Low(TdxChangeViewLevelAction) to High(TdxChangeViewLevelAction) do + AddCustomizationButton(AOwnerLinks, GetButtonCaption(AViewLevelAction, AViewLevelNames), + caChangeViewLevels, AViewLevelAction in [vlaSetAll, vlaSetLargeIconWithTextOnly], GetButtonStyle(AViewLevelAction), + False, True, 0, Word(AViewLevelAction)).CloseSubMenuOnClick := False; + + UpdateViewLevelsSubItemButtonStates(AOwnerLinks); + end; + + procedure AddButtonPaintStyleMenu; + const + APaintStyleCaptions: array [TdxBarPaintStyle] of TcxResourceStringID = + (@dxSBAR_CP_DEFAULTSTYLE, @dxSBAR_CP_TEXTONLYALWAYS, @dxSBAR_CP_TEXTONLYINMENUS, @dxSBAR_CP_IMAGEANDTEXT); + var + APaintStyle: TdxBarPaintStyle; + AOwnerLinks: TdxBarItemLinks; + begin + { unusually + if CustomizingBarManager.Designing then + AOwnerLinks := AddCustomizationSubItem(AItemLinks, cxGetResourceString(@dxSBAR_CP_BUTTONPAINTSTYLEMENU), + caChangeButtonPaintStyle, True).ItemLinks + else + } + AOwnerLinks := AItemLinks; + for APaintStyle := Low(TdxBarPaintStyle) to High(TdxBarPaintStyle) do + AddCustomizationButton(AOwnerLinks, cxGetResourceString(APaintStyleCaptions[APaintStyle]), + caChangeButtonPaintStyle, APaintStyle = Low(TdxBarPaintStyle), bsChecked, + CustomizingItemLink.PaintStyle = APaintStyle, + CustomizingItemLink.CanChangePaintStyle, dxBarCustomizingPopupPaintStyleGroupIndex, Word(APaintStyle)); + end; + + procedure AddPositionMenu; + var + APosition: TdxBarItemPosition; + APositionNames: TStringArray; + AOwnerLinks: TdxBarItemLinks; + begin + APositionNames := EnumToStringArray(TypeInfo(TdxBarItemPosition)); + AOwnerLinks := AddCustomizationSubItem(AItemLinks, cxGetResourceString(@dxSBAR_CP_POSITIONMENU), caChangePosition, True).ItemLinks; + for APosition := Low(TdxBarItemPosition) to High(TdxBarItemPosition) do + AddCustomizationButton(AOwnerLinks, APositionNames[Ord(APosition)], + caChangePosition, False, bsChecked, + CustomizingItemLink.Position = APosition, True, 0, Word(APosition)); + end; + + procedure AddButtonGroupMenu; + + function IsDowned(AButtonGroupAction: TdxChangeButtonGroupAction): Boolean; + begin + Result := (AButtonGroupAction in [bgaNone..bgaMember]) and (CustomizingItemLink.ButtonGroup = TdxBarButtonGroupPosition(AButtonGroupAction)); + end; + + function GetByttonStyle(AButtonGroupAction: TdxChangeButtonGroupAction): TdxBarButtonStyle; + begin + if AButtonGroupAction in [bgaNone..bgaMember] then + Result := bsChecked + else + Result := bsDefault; + end; + + function GetButtonCaption(AButtonGroupAction: TdxChangeButtonGroupAction; AButtonGroupNames: TStringArray): string; + begin + case AButtonGroupAction of + bgaGroup: Result := cxGetResourceString(@dxSBAR_CP_BUTTONGROUP); + bgaUngroup: Result := cxGetResourceString(@dxSBAR_CP_BUTTONUNGROUP); + else + Result := AButtonGroupNames[Ord(AButtonGroupAction)]; + end; + end; + + var + AButtonGroupAction: TdxChangeButtonGroupAction; + AButtonGroupNames: TStringArray; + AOwnerLinks: TdxBarItemLinks; + begin + AButtonGroupNames := EnumToStringArray(TypeInfo(TdxBarButtonGroupPosition)); + AOwnerLinks := AddCustomizationSubItem(AItemLinks, cxGetResourceString(@dxSBAR_CP_BUTTONGROUPMENU), caChangeButtonGroup).ItemLinks; + for AButtonGroupAction := Low(TdxChangeButtonGroupAction) to High(TdxChangeButtonGroupAction) do + AddCustomizationButton(AOwnerLinks, GetButtonCaption(AButtonGroupAction, AButtonGroupNames), + caChangeButtonGroup, AButtonGroupAction = bgaGroup, GetByttonStyle(AButtonGroupAction), + IsDowned(AButtonGroupAction), True, 0, Word(AButtonGroupAction)); + end; + +const + AChangeCaptionName: array [Boolean] of TcxResourceStringID = (@dxSBAR_CP_NAME, @dxSBAR_CP_CAPTION); + ADeleteLinkName: array [Boolean] of TcxResourceStringID = (@dxSBAR_CP_DELETE, @dxSBAR_CP_DELETELINK); +var + ABarControlEditors: TList; + I: Integer; + AAction: TdxBarCustomizationAction; + ASupportedActions: TdxBarCustomizationActions; +begin + AItemLinks.BeginUpdate; + try + FCustomizingBarManager.ItemList.BeginUpdate; + try + if FCustomizingBarManager.Designing and IsSelectionSingle(FCustomizingBarManager) then + begin + ABarControlEditors := TList.Create; + try + GetBarControlDesignHelperClass.GetEditors(ABarControlEditors); + for I := 0 to ABarControlEditors.Count - 1 do + TdxBarControlEditorClass(ABarControlEditors[I]).InitCustomizationPopup(AItemLinks); + finally + FreeAndNil(ABarControlEditors); + end; + end; + + ASupportedActions := GetSupportedActions; + GetBarControlDesignHelperClass.FilterItemActions(ASupportedActions); + for AAction := Low(TdxBarCustomizationAction) to High(TdxBarCustomizationAction) do + if AAction in ASupportedActions then + case AAction of + caReset: + AddCustomizationButton(AItemLinks, cxGetResourceString(@dxSBAR_CP_RESET), AAction, True); + caDelete: + AddCustomizationButton(AItemLinks, cxGetResourceString(@dxSBAR_CP_DELETE), AAction, True, + bsDefault, False, CanDeleteSelectedObjects).ShortCut := VK_DELETE; + caDeleteItem: + AddCustomizationButton(AItemLinks, cxGetResourceString(@dxSBAR_CP_DELETEITEM), AAction, False, + bsDefault, False, CustomizingItemLink.Item.CanDelete(True)).ShortCut := ShortCut(VK_DELETE, [ssCtrl]); + caDeleteLink: + AddCustomizationButton(AItemLinks, cxGetResourceString(ADeleteLinkName[FCustomizingBarManager.Designing]), AAction, False, bsDefault, False); + caChangeCaption: + AddCustomizationEdit(AItemLinks, cxGetResourceString(AChangeCaptionName[FCustomizingBarManager.Designing])); + caChangeButtonPaintStyle: + AddButtonPaintStyleMenu; + caChangePosition: + AddPositionMenu; + caChangeViewLevels: + AddViewLevelMenu; + caChangeButtonGroup: + AddButtonGroupMenu; + caChangeBeginGroup: + AddCustomizationButton(AItemLinks, cxGetResourceString(@dxSBAR_CP_BEGINAGROUP), AAction, True, + bsChecked, CustomizingItemLink.BeginGroup, CustomizingItemLink.Index > 0); + caChangeVisible: + AddCustomizationButton(AItemLinks, cxGetResourceString(@dxSBAR_CP_VISIBLE), AAction, not (caChangeBeginGroup in ASupportedActions), + bsChecked, CustomizingItemLink.Visible); + caChangeRecentList: + AddCustomizationButton(AItemLinks, cxGetResourceString(@dxSBAR_CP_MOSTRECENTLYUSED), AAction, False, + bsChecked, CustomizingItemLink.MostRecentlyUsed); + end; + finally + FCustomizingBarManager.ItemList.EndUpdate(False); + end; + finally + AItemLinks.EndUpdate; + end; +end; + +procedure TdxBarDesignController.SynchronizeAction(ABasicAction: TdxBarCustomizationAction); +var + I: Integer; + ASelection: TdxObjectList; +begin + ASelection := TdxObjectList.Create; + try + GetSelection(ASelection); + for I := 0 to ASelection.Count - 1 do + GetSelectableItem(ASelection[I]).ExecuteCustomizationAction(ABasicAction); + finally + ASelection.Free; + end; +end; + +procedure TdxBarDesignController.UpdateViewLevelsSubItemButtonStates(AItemLinks: TdxBarItemLinks); +var + I: Integer; + AButton: TdxBarButton; +begin + for I := 0 to AItemLinks.Count - 1 do + begin + AButton := TdxBarButton(AItemLinks[I].Item); + if TdxChangeViewLevelAction(LoWord(AButton.Tag)) in [vlaChangeLargeIconWithText..vlaChangeControl] then + AButton.Down := TdxBarItemViewLevel(LoWord(AButton.Tag)) in CustomizingItemLink.ViewLevels; + end; +end; + +procedure TdxBarDesignController.ToolbarsPopupClick(Sender: TObject); +var + ABar: TdxBar; +begin + ABar := TdxBar(TComponent(Sender).Tag); + ABar.Visible := not ABar.Visible; +end; + +procedure TdxBarDesignController.QuickControlDestroy(Sender: TObject); +begin + FQuickControl := nil; +end; + +procedure TdxBarDesignController.FindCustomizingBarManager; +var + I: Integer; + ASelection: TdxObjectList; +begin + if LastSelectedItem <> nil then + FCustomizingBarManager := LastSelectedItem.GetBarManager + else + begin + ASelection := TdxObjectList.Create; + try + FCustomizingBarManager := nil; + for I := 0 to dxBarManagerList.Count - 1 do + begin + dxBarManagerList[I].GetActiveSelection(ASelection); + CleanSelectableItems(ASelection); + if ASelection.Count > 0 then + begin + FCustomizingBarManager := dxBarManagerList[I]; + Break; + end; + end; + finally + ASelection.Free; + end; + end; +end; + +function TdxBarDesignController.CanCustomize(ABarManager: TdxBarManager; AIsKeyboardAction: Boolean): Boolean; +begin + Result := (ABarManager <> nil) and + (not AIsKeyboardAction or + (ABarManager.Owner.HandleAllocated) and (IsParentFocused(ABarManager.Owner.Handle))); +end; + +procedure TdxBarDesignController.SetLastSelectedItem(Value: IdxBarSelectableItem); + + procedure UpdateItem(ASelectedItem: IdxBarSelectableItem; AOperation: TOperation); + var + AInstance: TPersistent; + begin + if ASelectedItem <> nil then + begin + ASelectedItem.Invalidate; //#DG for RunTime only + AInstance := ASelectedItem.GetInstance; + if AInstance is TComponent then + case AOperation of + opInsert: FNotifyComponent.FreeNotification(TComponent(AInstance)); + opRemove: FNotifyComponent.RemoveFreeNotification(TComponent(AInstance)); + end; + end; + end; + +var + APrevSelectedItem: IdxBarSelectableItem; +begin + if FLastSelectedItem <> Value then + begin + APrevSelectedItem := FLastSelectedItem; + FLastSelectedItem := Value; + UpdateItem(APrevSelectedItem, opRemove); + UpdateItem(FLastSelectedItem, opInsert); + end; +end; + +procedure TdxBarDesignController.FreeNotification(AComponent: TComponent); +begin + DropSelection(GetSelectableItem(AComponent)); +end; + +{ TdxBarCanvas } + +constructor TdxBarCanvas.Create; +begin + inherited Create(TCanvas.Create); +end; + +destructor TdxBarCanvas.Destroy; +begin + Canvas.Free; + inherited; +end; + +procedure TdxBarCanvas.BeginPaint(ADC: THandle); +begin + SetLength(FSavedDCs, FCounter + 1); + + if HandleValid then + begin + SaveState; + FSavedDCs[FCounter].PrevDC := Handle; + end + else + FSavedDCs[FCounter].PrevDC := 0; + + FSavedDCs[FCounter].PrevCanvas := nil; + FSavedDCs[FCounter].NewDC := ADC; + FSavedDCs[FCounter].NewDCIndex := Windows.SaveDC(ADC); + SynchronizeObjects(ADC); + Canvas.Handle := ADC; + Inc(FCounter); +end; + +procedure TdxBarCanvas.BeginPaint(ACanvas: TCanvas); +begin + SetLength(FSavedDCs, FCounter + 1); + FSavedDCs[FCounter].PrevCanvas := Canvas; + Canvas := ACanvas; + SaveClipRegion; + SaveState; + Inc(FCounter); +end; + +procedure TdxBarCanvas.EndPaint; +begin + if FCounter > 0 then + begin + Dec(FCounter); + if FSavedDCs[FCounter].PrevCanvas <> nil then + begin + RestoreState; + RestoreClipRegion; + Canvas := FSavedDCs[FCounter].PrevCanvas; + end + else + begin + Canvas.Handle := FSavedDCs[FCounter].PrevDC; + Windows.RestoreDC(FSavedDCs[FCounter].NewDC, FSavedDCs[FCounter].NewDCIndex); + if HandleValid then + RestoreState; + end; + SetLength(FSavedDCs, FCounter); + end; +end; + +function TdxBarCanvas.HandleValid; +begin + Result := {$IFDEF DELPHI6}Canvas.HandleAllocated{$ELSE}FCounter > 0{$ENDIF}; +end; + +{ TdxBarSystemController } + +{$IFDEF DELPHI6} +constructor TdxBarSystemController.Create; +begin + inherited; + if IsLibrary then + HookSynchronizeWakeup; +end; + +destructor TdxBarSystemController.Destroy; +begin + if IsLibrary then + UnhookSynchronizeWakeup; + inherited; +end; + +procedure TdxBarSystemController.WndProc(var Message: TMessage); +begin + case Message.Msg of + WM_SYNCHRONIZETHREADS: CheckSynchronize; + else + inherited; + end; +end; + +procedure TdxBarSystemController.WakeMainThread(Sender: TObject); +begin + PostMessage(Handle, WM_SYNCHRONIZETHREADS, 0, 0); +end; + +procedure TdxBarSystemController.HookSynchronizeWakeup; +begin + FPrevWakeMainThread := Classes.WakeMainThread; + Classes.WakeMainThread := WakeMainThread; +end; + +procedure TdxBarSystemController.UnhookSynchronizeWakeup; +begin + Classes.WakeMainThread := FPrevWakeMainThread; +end; +{$ENDIF} + +{ TdxBarComponent } + +constructor TdxBarComponent.Create(AOwner: TComponent); +begin + inherited; + FChangeNotifies := TObjectList.Create(False); +end; + +destructor TdxBarComponent.Destroy; +begin + FreeAndNil(FChangeNotifies); + inherited; +end; + +procedure TdxBarComponent.AddChangeNotify(AComponentList: TdxBarComponentList); +begin + FChangeNotifies.Add(AComponentList); +end; + +procedure TdxBarComponent.RemoveChangeNotify(AComponentList: TdxBarComponentList); +begin + FChangeNotifies.Remove(AComponentList); +end; + +procedure TdxBarComponent.Changed(AllItems: Boolean = False); +var + I: Integer; +begin + if not (csDestroying in ComponentState) then + for I := 0 to FChangeNotifies.Count - 1 do + if AllItems then + TdxBarComponentList(FChangeNotifies[I]).Update(nil) + else + TdxBarComponentList(FChangeNotifies[I]).Update(Self); +end; + +procedure TdxBarComponent.GetMasterObjects(AList: TdxObjectList); +begin + AList.Add(Owner); +end; + +function TdxBarComponent.GetNextSelectableItem: IdxBarSelectableItem; +begin + Result := nil; +end; + +function TdxBarComponent.GetSelectableParent: TPersistent; +begin + Result := Owner; +end; + +function TdxBarComponent.CanDelete(ADestruction: Boolean = False): Boolean; +begin + Result := BarManager.CanDeleteComponent(Self); +end; + +procedure TdxBarComponent.DeleteSelection(var AReference: IdxBarSelectableItem; ADestruction: Boolean); +begin + if CanDelete(ADestruction) then + begin + AReference := nil; + Free; + end; +end; + +procedure TdxBarComponent.ExecuteCustomizationAction(ABasicAction: TdxBarCustomizationAction); +begin +// do nothing +end; + +function TdxBarComponent.GetBarManager: TdxBarManager; +begin + Result := FBarManager; +end; + +function TdxBarComponent.GetSelectionStatus: TdxBarSelectionStatus; +begin + Result := BarManager.GetSelectionStatus(Self); +end; + +function TdxBarComponent.GetSupportedActions: TdxBarCustomizationActions; +begin + Result := [caDelete]; +end; + +procedure TdxBarComponent.Invalidate; +begin +// do nothing +end; + +function TdxBarComponent.IsComplex: Boolean; +begin + Result := False; +end; + +function TdxBarComponent.IsComponentSelected: Boolean; +begin + Result := BarManager.IsComponentSelected(Self); +end; + +procedure TdxBarComponent.SelectComponent(ASelectionOperation: TdxBarSelectionOperation = soExclusive); +begin + BarManager.SelectComponent(Self, ASelectionOperation); +end; + +function TdxBarComponent.SelectParentComponent: Boolean; +begin + Result := False; +end; + +procedure TdxBarComponent.SelectionChanged; +begin +// do nothing +end; + +function TdxBarComponent.GetPersistentInstance: TPersistent; +begin + Result := Self; +end; + +function TdxBarComponent.GetComponentInstance: TComponent; +begin + Result := Self; +end; + +{ TdxObjectList } + +constructor TdxObjectList.Create; +begin + inherited Create(False); +end; + +procedure TdxObjectList.Add(AObject: TObject); +begin + if (AObject <> nil) and (IndexOf(AObject) = -1) then + inherited Add(AObject); +end; + +procedure TdxObjectList.AddList(AObjects: TList); +begin + AddFromList(AObjects, Self); +end; + +procedure TdxObjectList.CopyFrom(ASource: TList); +begin + CopyList(ASource, Self); +end; + +procedure TdxObjectList.CopyTo(ADestination: TList); +begin + CopyList(Self, ADestination); +end; + +procedure TdxObjectList.XorList(ASourceA, ASourceB: TList); +begin + Clear; + AddFromList(ASourceA, ASourceB); + AddFromList(ASourceB, ASourceA); +end; + +function TdxObjectList.First: TObject; +begin + Result := GetItem(0); +end; + +function TdxObjectList.Last: TObject; +begin + Result := GetItem(Count - 1); +end; + +procedure TdxObjectList.CopyList(ASource, ADestination: TList); +var + I: Integer; +begin + ADestination.Clear; + ADestination.Capacity := ASource.Capacity; + for I := 0 to ASource.Count - 1 do + if ADestination is TdxObjectList then + TdxObjectList(ADestination).Add(ASource[I]) + else + ADestination.Add(ASource[I]); +end; + +function TdxObjectList.GetItem(AIndex: Integer): TObject; +begin + if (AIndex >= 0) and (AIndex < Count) then + Result := inherited GetItem(AIndex) + else + Result := nil; +end; + +procedure TdxObjectList.AddFromList(ASource, AExcludedList: TList); +var + I: Integer; +begin + for I := 0 to ASource.Count - 1 do + if AExcludedList.IndexOf(ASource[I]) = -1 then + Add(ASource[I]); +end; + +{ TdxComponentList } + +constructor TdxComponentList.Create; +begin + inherited Create(False); +end; + +destructor TdxComponentList.Destroy; +begin + FUpdateCount := 1; + inherited Destroy; +end; + +procedure TdxComponentList.BeginUpdate; +begin + Inc(FUpdateCount); +end; + +procedure TdxComponentList.EndUpdate(AForceUpdate: Boolean = True); +begin + Dec(FUpdateCount); + if AForceUpdate then + Update; +end; + +procedure TdxComponentList.DoNotify(AItem: TComponent; AAction: TListNotification); + + function ConvertNotificaton(ANotification: TListNotification): TcxComponentCollectionNotification; + begin + case ANotification of + lnAdded: Result := ccnAdded; + lnExtracted: Result := ccnExtracted; + else {lnDeleted} + Result := ccnDeleting; + end; + end; + +begin + inherited Notify(AItem, AAction); + if Assigned(OnNotify) then + OnNotify(Self, AItem, AAction); + Update(AItem, ConvertNotificaton(AAction)); +end; + +function TdxComponentList.GetItemClass: TClass; +begin + Result := TComponent; +end; + +procedure TdxComponentList.Notify(Ptr: Pointer; Action: TListNotification); +begin + if TObject(Ptr) is GetItemClass then + DoNotify(Ptr, Action) + else + if Action = lnAdded then + Extract(Ptr); +end; + +procedure TdxComponentList.Update(AItem: TComponent = nil; + AAction: TcxComponentCollectionNotification = ccnChanged); +begin + if (FUpdateCount = 0) and Assigned(OnComponentListChanged) then + OnComponentListChanged(Self, AItem, AAction); +end; + +{ TdxBarComponentList } + +procedure TdxBarComponentList.DoNotify(AItem: TComponent; AAction: TListNotification); +begin + case AAction of + lnExtracted, lnDeleted: + if not (csDestroying in TdxBarComponent(AItem).ComponentState) then + TdxBarComponent(AItem).RemoveChangeNotify(Self); + lnAdded: + TdxBarComponent(AItem).AddChangeNotify(Self); + end; + inherited; +end; + +function TdxBarComponentList.GetItemClass: TClass; +begin + Result := TdxBarComponent; +end; + +{ TdxBarGroup } + +constructor TdxBarGroup.Create(AOwner: TComponent); +begin + inherited; + FEnabled := True; + FItems := TdxBarComponentList.Create; + FVisible := ivAlways; +end; + +destructor TdxBarGroup.Destroy; +begin + FreeAndNil(FItems); + inherited; +end; + +function TdxBarGroup.GetCount: Integer; +begin +// Result := FItems.Count; + Result := InternalGetCount; +end; + +function TdxBarGroup.GetIndex: Integer; +begin + Result := FBarManager.FGroups.IndexOf(Self); +end; + +function TdxBarGroup.GetItem(Index: Integer): TComponent; +begin + Result := TComponent(FItems[Index]); +end; + +function TdxBarGroup.InternalGetCount: Integer; +begin + if IsAncestorComponentDifferencesDetection(Self) then + Result := FItemsNames.Count + else + Result := FItems.Count; +end; + +function TdxBarGroup.InternalGetItemName(Index: Integer): string; +begin + if IsAncestorComponentDifferencesDetection(Self) then + Result := FItemsNames[Index] + else + Result := Items[Index].Name; +end; + +procedure TdxBarGroup.SetIndex(Value: Integer); +begin + if Index <> Value then + FBarManager.GroupList.Move(Index, Value); +end; + +procedure TdxBarGroup.ReadItems(Reader: TReader); +var + AItem: TComponent; +begin + if csLoading in ComponentState then + begin + if FItemsNames = nil then + FItemsNames := TStringList.Create + else + FItemsNames.Clear; + Reader.ReadListBegin; + try + while not Reader.EndOfList do + FItemsNames.Add(Reader.ReadString); + finally + Reader.ReadListEnd; + end; + end + else + begin + ItemList.Clear; + Reader.ReadListBegin; + try + while not Reader.EndOfList do + begin + AItem := BarManager.Owner.FindComponent(Reader.ReadString); + if AItem <> nil then + Add(TdxBarComponent(AItem)); + end; + finally + Reader.ReadListEnd; + end; + end; +end; + +procedure TdxBarGroup.WriteItems(Writer: TWriter); +var + I: Integer; +begin + Writer.WriteListBegin; + try + for I := 0 to InternalGetCount - 1 do + Writer.WriteString(InternalGetItemName(I)); + finally + Writer.WriteListEnd; + end; +end; + +procedure TdxBarGroup.DefineProperties(Filer: TFiler); + + function NeedWriteItems: Boolean; + + function IsGroupsEqual(AGroup1, AGroup2: TdxBarGroup): Boolean; + var + I: Integer; + begin + Result := AGroup1.InternalGetCount = AGroup2.InternalGetCount; + if Result then + for I := 0 to AGroup1.InternalGetCount - 1 do + Result := Result and (AGroup1.InternalGetItemName(I) = AGroup2.InternalGetItemName(I)) + end; + + begin + Result := (Filer.Ancestor = nil) or not IsGroupsEqual(Self, TdxBarGroup(Filer.Ancestor)); + end; + +begin + inherited; + Filer.DefineProperty('Items', ReadItems, WriteItems, NeedWriteItems); +end; + +function TdxBarGroup.GetEnabled: Boolean; +begin + Result := FEnabled; +end; + +procedure TdxBarGroup.Loaded; +var + I: Integer; + AItem: TComponent; +begin + inherited; + if FItemsNames = nil then Exit; + try + for I := 0 to FItemsNames.Count - 1 do + begin + AItem := FBarManager.Owner.FindComponent(FItemsNames[I]);//#DG + if AItem <> nil then Add(TdxBarComponent(AItem)); + end; + finally + FreeAndNil(FItemsNames); + end; +end; + +procedure TdxBarGroup.SetName(const NewName: TComponentName); +begin + inherited; + Changed; +end; + +procedure TdxBarGroup.SetEnabled(Value: Boolean); +var + ALock: Boolean; + I: Integer; +begin + //if FEnabled <> Value then + begin + FEnabled := Value; + ALock := (BarDesignController.QuickControl = nil) and ([csLoading, csDestroying] * ComponentState = []); + if ALock then + FBarManager.BeginUpdate; + try + for I := 0 to Count - 1 do + TdxBarComponent(Items[I]).Enabled := Value; + finally + if ALock then + FBarManager.EndUpdate; + end; + end; +end; + +procedure TdxBarGroup.SetVisible(Value: TdxBarItemVisible); +var + I: Integer; +begin + //if FVisible <> Value then + begin + FVisible := Value; + if [csLoading, csDestroying] * ComponentState = [] then + FBarManager.BeginUpdate; + try + for I := 0 to Count - 1 do + TdxBarComponent(Items[I]).Visible := Value; + finally + if [csLoading, csDestroying] * ComponentState = [] then + FBarManager.EndUpdate; + end; + end; +end; + +function TdxBarGroup.GetParentComponent: TComponent; +begin + Result := FBarManager; +end; + +function TdxBarGroup.HasParent: Boolean; +begin + Result := FBarManager <> nil; +end; + +procedure TdxBarGroup.SetParentComponent(AParent: TComponent); +begin + inherited; + if AParent is TdxBarManager then + TdxBarManager(AParent).AddGroup(Self); +end; + +procedure TdxBarGroup.Add(AItem: TdxBarComponent); + + function IsRecursive(AItem: TComponent): Boolean; + var + I: Integer; + begin + Result := False; + if AItem is TdxBarGroup then + begin + Result := AItem = Self; + if not Result then + with TdxBarGroup(AItem) do + for I := 0 to Count - 1 do + begin + Result := IsRecursive(Items[I]); + if Result then Break; + end; + end; + end; + +begin + if not (AItem is TdxBarComponent) or (IndexOf(AItem) <> -1) then Exit; + if IsRecursive(AItem) then + raise Exception.Create(cxGetResourceString(@dxSBAR_RECURSIVEGROUPS)); + FItems.Add(AItem); +end; + +procedure TdxBarGroup.Delete(Index: Integer); +begin + FItems.Delete(Index); +end; + +function TdxBarGroup.IndexOf(AItem: TdxBarComponent): Integer; +begin + Result := FItems.IndexOf(AItem); +end; + +procedure TdxBarGroup.Move(FromIndex, ToIndex: Integer); +begin + FItems.Move(FromIndex, ToIndex); +end; + +procedure TdxBarGroup.Remove(AItem: TdxBarComponent); +begin + FItems.Remove(AItem); +end; + +{ TdxBarPopupMenuLink } + +function TdxBarPopupMenuLink.GetBarManager: TdxBarManager; +begin + Result := TdxBarPopupMenuLinks(Collection).BarManager; +end; + +function TdxBarPopupMenuLink.GetWinControl: TWinControl; +begin + if Control is TWinControl then + Result := TWinControl(Control) + else + Result := nil; +end; + +procedure TdxBarPopupMenuLink.SetControl(Value: TControl); +begin + if (Value <> nil) and not IsControlUnderBarManager(BarManager, Value) then + Value := nil; + if FControl <> Value then + begin + if FControl <> nil then + FControl.WindowProc := FPrevWndProc; + FControl := Value; + if FControl <> nil then + begin + FControl.FreeNotification(BarManager); + FPrevWndProc := FControl.WindowProc; + FControl.WindowProc := NewWndProc; + end; + end; +end; + +procedure TdxBarPopupMenuLink.SetPopupMenu(Value: TdxBarPopupMenu); +begin + if FPopupMenu <> Value then + begin + FPopupMenu := Value; + if Value <> nil then Value.FreeNotification(BarManager); + end; +end; + +procedure TdxBarPopupMenuLink.ContextPopup(Sender: TObject; MousePos: TPoint; var Handled: Boolean); +var + AControlAtPos: TControl; +begin + if Assigned(FPrevOnContextPopup) then + FPrevOnContextPopup(Sender, MousePos, Handled); + if Control is TWinControl then + AControlAtPos := TWinControl(Control).ControlAtPos(MousePos, True, True) + else + AControlAtPos := nil; + if not Handled and (ProcessChildren or (AControlAtPos = nil)) then + Handled := DoAction(MousePos); +end; + +function TdxBarPopupMenuLink.DoAction(AClientPopupPoint: TPoint): Boolean; +var + AClickedByMouse: Boolean; +begin + AClickedByMouse := not cxPointIsEqual(cxInvalidPoint, AClientPopupPoint); + Result := FPopupMenu <> nil; + if Assigned(FOnAction) then + FOnAction(Self, AClientPopupPoint.X, AClientPopupPoint.Y, AClickedByMouse, Result); + if Result and (FPopupMenu <> nil) then + begin + with Control.ClientToScreen(AClientPopupPoint) do + FPopupMenu.Popup(X, Y); + end; +end; + +function TdxBarPopupMenuLink.IsShortCut(AShortCut: TShortCut): Boolean; +var + X, Y: Integer; +begin + Result := FPopupMenu <> nil; + if Assigned(FOnAction) then + begin + X := -1; + Y := -1; + FOnAction(Self, X, Y, False, Result); + end; + if Result then + Result := (FPopupMenu <> nil) and FPopupMenu.ItemLinks.IsShortCut(AShortCut); +end; + +procedure TdxBarPopupMenuLink.NewWndProc(var Message: TMessage); + + function IsContextMenuProcessed: Boolean; + var + AOnContextPopup: TContextPopupEvent; + begin + AOnContextPopup := ContextPopup; + Result := EqualMethods(TMethod(TControlAccess(Control).OnContextPopup), TMethod(AOnContextPopup)); + end; + +begin + if (Message.Msg = WM_CONTEXTMENU) and not(csDesigning in Control.ComponentState) then + begin + if not IsContextMenuProcessed then + begin + FPrevOnContextPopup := TControlAccess(Control).OnContextPopup; + TControlAccess(Control).OnContextPopup := ContextPopup; + try + FPrevWndProc(Message); + finally + TControlAccess(Control).OnContextPopup := FPrevOnContextPopup; + end; + end; + end + else + FPrevWndProc(Message); +end; + +constructor TdxBarPopupMenuLink.Create(Collection: TCollection); +begin + inherited; + FProcessChildren := True; +end; + +destructor TdxBarPopupMenuLink.Destroy; +begin + Control := nil; + inherited; +end; + +procedure TdxBarPopupMenuLink.Assign(Source: TPersistent); + + function FindLinkComponent(AComponent: TComponent): TComponent; + begin + if AComponent <> nil then + Result := BarManager.Owner.FindComponent(AComponent.Name) + else + Result := nil; + end; + +begin + if Source is TdxBarPopupMenuLink then + begin + Control := FindLinkComponent(TdxBarPopupMenuLink(Source).Control) as TWinControl; + PopupMenu := FindLinkComponent(TdxBarPopupMenuLink(Source).PopupMenu) as TdxBarPopupMenu; + ProcessChildren := TdxBarPopupMenuLink(Source).ProcessChildren; + end + else inherited Assign(Source); +end; + +function TdxBarPopupMenuLink.DoAction(Wnd: HWND; const P: TPoint): Boolean; +begin + Result := DoAction(Control.ScreenToClient(P)); +end; + +{ TdxBarPopupMenuLinks } + +constructor TdxBarPopupMenuLinks.Create(ABarManager: TdxBarManager); +begin + inherited Create(TdxBarPopupMenuLink); + FBarManager := ABarManager; +end; + +function TdxBarPopupMenuLinks.GetItem(Index: Integer): TdxBarPopupMenuLink; +begin + Result := TdxBarPopupMenuLink(inherited GetItem(Index)); +end; + +procedure TdxBarPopupMenuLinks.SetItem(Index: Integer; Value: TdxBarPopupMenuLink); +begin + inherited SetItem(Index, Value); +end; + +function TdxBarPopupMenuLinks.GetOwner: TPersistent; +begin + Result := FBarManager; +end; + +function TdxBarPopupMenuLinks.IsShortCut(AControl: TWinControl; + AShortCut: TShortCut): Boolean; +var + AItem: TdxBarPopupMenuLink; + AParentBarManager: TdxBarManager; + I: Integer; +begin + Result := False; + + for I := 0 to Count - 1 do + begin + if Items[I].Control = AControl then + Result := Items[I].IsShortCut(AShortCut); + if Result then + Break; + end; + + if not Result then + for I := 0 to Count - 1 do + begin + AItem := Items[I]; + if AItem.ProcessChildren and (AItem.WinControl <> nil) and + IsChildControl(AItem.WinControl, AControl) then + Result := AItem.IsShortCut(AShortCut); + if Result then + Break; + end; + + if not Result then + begin + AParentBarManager := BarManager.ParentBarManager; + if AParentBarManager <> nil then + Result := AParentBarManager.PopupMenuLinks.IsShortCut(AControl, AShortCut); + end; +end; + +function TdxBarPopupMenuLinks.Add: TdxBarPopupMenuLink; +begin + Result := TdxBarPopupMenuLink(inherited Add); +end; + +function TdxBarPopupMenuLinks.DoAction(AControl: TWinControl; Wnd: HWND; + const P: TPoint): Boolean; +var + AItem: TdxBarPopupMenuLink; + AParentBarManager: TdxBarManager; + I: Integer; +begin + Result := False; + if BarManager.Designing then + Exit; + + for I := 0 to Count - 1 do + begin + if Items[I].Control = AControl then + Result := Items[I].DoAction(Wnd, P); + if Result then + Break; + end; + + if not Result then + for I := 0 to Count - 1 do + begin + AItem := Items[I]; + if AItem.ProcessChildren and (AItem.WinControl <> nil) and + IsChildControl(AItem.WinControl, Wnd) then + Result := Items[I].DoAction(Wnd, P); + if Result then + Break; + end; + + if not Result then + begin + AParentBarManager := BarManager.ParentBarManager; + if AParentBarManager <> nil then + Result := AParentBarManager.PopupMenuLinks.DoAction(AControl, Wnd, P); + end; +end; + +{ TdxBarBackgrounds } + +constructor TdxBarBackgrounds.Create(ABarManager: TdxBarManager); +begin + inherited; + FBarBackgroundBitmap := dxBarCreateBitmap(BitmapChanged); + FSubMenuBackgroundBitmap := TBitmap.Create; +end; + +destructor TdxBarBackgrounds.Destroy; +begin + FreeAndNil(FSubMenuBackgroundBitmap); + FreeAndNil(FBarBackgroundBitmap); + inherited Destroy; +end; + +procedure TdxBarBackgrounds.Assign(Source: TPersistent); +begin + if Source is TdxBarBackgrounds then + begin + Bar := TdxBarBackgrounds(Source).Bar; + SubMenu := TdxBarBackgrounds(Source).SubMenu; + end + else + inherited Assign(Source); +end; + +procedure TdxBarBackgrounds.Changed; +begin + BarManager.InternalStyleChanged; // TODO: ??? +end; + +procedure TdxBarBackgrounds.BitmapChanged(Sender: TObject); +begin + Changed; +end; + +procedure TdxBarBackgrounds.SetBarBackgroundBitmap(Value: TBitmap); +var + AChanged: Boolean; +begin + AChanged := not ((Value = nil) and FBarBackgroundBitmap.Empty); + FBarBackgroundBitmap.Assign(Value); + if AChanged then + Changed; +end; + +procedure TdxBarBackgrounds.SetSubMenuBackgroundBitmap(Value: TBitmap); +begin + FSubMenuBackgroundBitmap.Assign(Value); +end; + +{ TdxBarManager } + +var + KeyboardHookHandle: HHOOK; + MouseHookHandle: HHOOK; + WndProcHookHandle: HHOOK; + EatKey, WaitForMenu, DontCallNextKeybHook: Boolean; + EatingKey: WPARAM; + InMouseHook: Boolean; + AClassName: PChar; + + FDockTimerID: UINT; + FDockBarManager: TdxBarManager; + + FHintWindowShowing: Boolean; + FHintTimerID, FHiddenHintTimerID: UINT; + FCustomHint: string; + FLiveHiddenHint: Boolean; + +procedure KillHintTimer; +begin + dxKillTimer(0, FHintTimerID); +end; + +procedure KillHiddenHintTimer; +begin + if dxKillTimer(0, FHiddenHintTimerID) then + FLiveHiddenHint := False; +end; + +function dxBarKeyboardHook(Code: Integer; wParam: WParam; lParam: LParam): LRESULT; stdcall; + + function AnyKeyPressed: Boolean; + var + KS: TKeyboardState; + I: Integer; + begin + GetKeyboardState(KS); + for I := Low(KS) to High(KS) do + begin + Result := KS[I] and 128 <> 0; + if Result then Break; + end; + end; + + function ShiftState: TShiftState; + begin + Result := []; + if GetKeyState(VK_SHIFT) < 0 then Result := Result + [ssShift]; + if GetKeyState(VK_CONTROL) < 0 then Result := Result + [ssCtrl]; + if GetKeyState(VK_MENU) < 0 then Result := Result + [ssAlt]; + end; + + function KeyPressed: Boolean; + begin + Result := (lParam shr 31) and 1 = 0; + end; + + procedure HandleKey(ABarManager: TdxBarManager; var AHookResult: LRESULT); + var + AIsUniqueItem: Boolean; + AItemLink: TdxBarItemLink; + AShift: TShiftState; + begin + if ABarManager.HandleShortCut(GetShortCutFromMessageData(wParam, lParam)) then + AHookResult := 1 + else + if GetKeyState(VK_MENU) < 0 then + begin + AShift := ShiftState - [ssAlt]; + AItemLink := ABarManager.GetItemLinkWithAccel(wParam, AShift); + if (AItemLink <> nil) and AItemLink.Item.Enabled then + with AItemLink do + begin + AIsUniqueItem := Owner.FindItemWithAccel(wParam, AShift, AItemLink) = AItemLink; + if not Control.IsDestroyOnClick or not AIsUniqueItem then + TdxBarControl(BarControl).BarGetFocus(Control); + if AIsUniqueItem then + begin + if Control is TdxBarSubItemControl then + BarControl.IsDowned := True; + Control.Click(False); + end; + AHookResult := 1; + end; + end; + end; + + function ActiveBarFocused(ABarManager: TdxBarManager): boolean; + var + ACurIndex: Integer; + begin + ACurIndex := dxBarManagerList.IndexOf(ABarManager); + repeat + Result := ABarManager.BarControlFocused; + ABarManager := dxBarManagerList.NextActive(ABarManager, True); + until Result or (dxBarManagerList.IndexOf(ABarManager) = ACurIndex); + end; + + function GetBarManager(AFindRootAccessibleObject: Boolean; + out AIRootAccessibilityHelper: IdxBarAccessibilityHelper): TdxBarManager; + + function FindBarManagerAmongParents(AWnd: HWND): TdxBarManager; + begin + Result := nil; + repeat + if AFindRootAccessibleObject then + begin + AIRootAccessibilityHelper := GetRootAccessibleObject(AWnd); + if AIRootAccessibilityHelper <> nil then + Result := AIRootAccessibilityHelper.GetBarManager; + end + else + Result := GetBarManagerByHandle(AWnd); + if not IsChildClassWindow(AWnd) then + Break; + AWnd := GetParent(AWnd); + until Result <> nil; + end; + + var + AControl: TWinControl; + I: Integer; + begin + Result := nil; + if GetFocus <> 0 then + Result := FindBarManagerAmongParents(GetFocus); + + if (Result = nil) and (GetActiveForm <> nil) then + begin + Result := FindBarManagerAmongParents(GetActiveForm.Handle); + if (Result = nil) and (Application.MainForm <> nil) and + IsWindowEnabled(Application.MainForm.Handle) then + begin + Result := FindBarManagerAmongParents(Application.MainForm.Handle); + if (Result <> nil) and not Result.AllowCallFromAnotherForm then + Result := nil; + end; + end; + + if (Result = nil) and not AFindRootAccessibleObject then + begin + AControl := FindControl(GetActiveWindow); + if (AControl <> nil) and not IsWindowEnabled(AControl.Handle) then + AControl := nil; + if (AControl is TCustomForm) and (TCustomForm(AControl).Parent = nil) then + begin + if Assigned(cxControls.cxGetParentFormForDocking) then + AControl := cxControls.cxGetParentFormForDocking(TCustomForm(AControl)); + end; + if AControl is TCustomForm then + for I := 0 to dxBarManagerList.Count - 1 do + if dxBarManagerList[I].GetMainForm = AControl then + begin + Result := dxBarManagerList[I]; + Break; + end; + end; + + if (Result <> nil) and (Result.IsCustomizing or ActiveBarFocused(Result)) then + Result := nil; + end; + + function MenuActivateIfNeeded(var AHookResult: LRESULT): Boolean; + var + AKeyTipWindowsManager: IdxBarKeyTipWindowsManager; + AIRootAccessibilityHelper: IdxBarAccessibilityHelper; + ABarManager: TdxBarManager; + begin + Result := False; + ABarManager := GetBarManager((wParam = VK_F10) or (wParam = VK_MENU), + AIRootAccessibilityHelper); + if ABarManager <> nil then + begin + if not KeyPressed then // release key + begin + if (wParam = VK_MENU) and WaitForMenu or + ABarManager.UseF10ForMenu and (wParam = VK_F10) and (ShiftState = []) then + begin + WaitForMenu := False; + BarNavigationController.SelectDefaultObject(AIRootAccessibilityHelper); + AHookResult := 1; + Result := True; + if AIRootAccessibilityHelper.AreKeyTipsSupported(AKeyTipWindowsManager) then + BarNavigationController.EndKeyTipsWaiting(True); + end + else + BarNavigationController.EndKeyTipsWaiting(False); + end + else // press key + if (((wParam = VK_MENU) and not (ssCtrl in ShiftState)) or + (ABarManager.UseF10ForMenu and (wParam = VK_F10) and (ShiftState = []))) and + not (EatKey and (wParam = EatingKey)) then + begin + ABarManager.HideHint; + WaitForMenu := True; + if AIRootAccessibilityHelper.AreKeyTipsSupported(AKeyTipWindowsManager) then + BarNavigationController.BeginKeyTipsWaiting(AIRootAccessibilityHelper); + end + else + begin + BarNavigationController.EndKeyTipsWaiting(False); + HandleKey(ABarManager, AHookResult); + Result := True; + end; + end; + end; + + function HandleByActiveBarControlIfNeeded(var AHookResult: LRESULT): Boolean; + const + KeyMessages: array[Boolean] of Integer = (WM_KEYUP, WM_KEYDOWN); + begin + Result := False; + if EatKey and (wParam = EatingKey) and not KeyPressed then // release eating key + begin + EatKey := False; + AHookResult := 1; + Result := True; + Exit; + end; + if dsKeyAlreadyProcessed in BarDesignController.FDesignStates then + Exit; + if BarNavigationController.NeedsKey(wParam) then + begin + if KeyPressed then + begin + EatKey := True; + EatingKey := wParam; + BarNavigationController.HandleKey(Word(wParam)); + end; + if (BarNavigationController.SelectedObjectParent <> nil) or (GetKeyState(wParam) >= 0) then + EatKey := False; + AHookResult := 1; + Result := True; + end + else + if IsActiveBarControlAccessible and not ActiveBarControl.IsCustomizing then + begin + if not (ActiveBarControl.SelectedControl is TdxBarWinControl and + TdxBarWinControl(ActiveBarControl.SelectedControl).Focused) then + begin + if KeyPressed then + begin + EatKey := True; + EatingKey := wParam; + end; + SendMessage(ActiveBarControl.Handle, KeyMessages[KeyPressed], wParam, lParam); + if (ActiveBarControl <> nil) or (GetKeyState(wParam) >= 0) then + EatKey := False; + AHookResult := 1; + Result := True; + end + end + else + case wParam of + VK_DELETE: + if KeyPressed and BarDesignController.DeleteSelectedObjects(ssCtrl in ShiftState, True) then + begin + AHookResult := 1; + Result := True; + end; + //#DG + { + if ActiveBarControl.BarManager.SelectedItem <> nil then + begin + if not (ssCtrl in ShiftState) then + ActiveBarControl.BarManager.SelectedItem.ItemLink.Free + else + if ActiveBarControl.BarManager.Designing and + ActiveBarControl.BarManager.CanDeleteComponent(ActiveBarControl.BarManager.SelectedItem.Item) then + ActiveBarControl.BarManager.SelectedItem.Item.Free; + AHookResult := 1; + Result := True; + end; + } + + VK_ESCAPE: + if (ActiveBarControl <> nil) and (GetCapture = ActiveBarControl.Handle) then + begin + ReleaseCapture; + AHookResult := 1; + Result := True; + Exit; + end + else + if KeyPressed and BarDesignController.SelectParentComponent then + begin + AHookResult := 1; + Result := True; + end; + end; + end; + +var + Res: LRESULT; +begin + Result := 0; + try + if Code = HC_NOREMOVE then Exit; + if FIsMDIButtonPressed then + begin + Result := 1; + Exit; + end; + + if wParam = VK_PROCESSKEY then Exit; // for Korean windows + if Code < 0 then Exit; + if HandleByActiveBarControlIfNeeded(Result) then + Exit; + if GetCapture = 0 then + begin + if MenuActivateIfNeeded(Result) then + Exit; + end; + finally + if DontCallNextKeybHook then Result := 0 + else + begin + Res := CallNextHookEx(KeyboardHookHandle, Code, wParam, lParam); + if Result = 0 then Result := Res; + end; + end; +end; + +function BarGetMouseWheelReceiver: TdxBarMouseWheelEventReceiver; +begin + if ActiveBarControl <> nil then + if ActiveBarControl.SelectedControl is TdxBarWinControl and + TdxBarWinControl(ActiveBarControl.SelectedControl).Focused then + Result := mwrFocusedItemControl + else + if ActiveBarControl.NeedsMouseWheel then + Result := mwrActiveBarControl + else + Result := mwrNone + else + Result := mwrWindow; +end; + +function dxBarMouseHook(Code: Integer; wParam: WParam; lParam: LParam): LRESULT; stdcall; + +var + AMHS: PMouseHookStruct; + + function ActiveControl: TdxBarItemControl; + begin + Result := nil; + if FindControl(AMHS.hwnd) is TCustomdxBarControl then + Result := TCustomdxBarControl(FindControl(AMHS.hwnd)).SelectedControl; + + if (Result = nil) and (GetCapture > 0) and (ActiveBarControl <> nil) then + if WindowFromPointEx(AMHS.pt) = ActiveBarControl.Handle then + Result := ActiveBarControl.SelectedControl + else + begin + Result := ActiveBarControl.SelectedControl; + if (Result <> nil) and + (not (Result.ItemLink.Item is TCustomdxBarCombo) or + not TCustomdxBarCombo(Result.ItemLink.Item).DroppedDown) then + Result := nil; + end; + end; + + function NeedProccessThisEvent(AWnd: HWND): Boolean; + var + I: Integer; + begin + Result := FindControl(AWnd) <> nil; + if IsWin95 and not Result then + for I := 0 to Screen.FormCount - 1 do + if Screen.Forms[I].Handle = AWnd then + begin + Result := True; + Break; + end; + end; + + procedure CheckHookParams; + + function IsMouseOverCustomizingControl(AParentHandle, AControlHandle: HWND; const AMousePos: TPoint): Boolean; + var + AChildHandle: HWND; + AClientPos: TPoint; + begin + AClientPos := AMousePos; + ScreenToClient(AParentHandle, AClientPos); + AChildHandle := ChildWindowFromPointEx(AParentHandle, AClientPos, CWP_SKIPINVISIBLE); + Result := AChildHandle = AControlHandle; + if not Result and (AChildHandle <> 0) and (AChildHandle <> AParentHandle) then + Result := IsMouseOverCustomizingControl(AChildHandle, AControlHandle, AMousePos); + end; + + var + ACustomizingControl: TWinControl; + begin + //## Check whole procedure + if dxBarCustomizingForm <> nil then + begin + ACustomizingControl := dxBarCustomizingForm.BarManager.Owner; + if (ACustomizingControl <> nil) and IsChildClassWindow(ACustomizingControl.Handle) then + begin + if IsMouseOverCustomizingControl(AMHS.hwnd, ACustomizingControl.Handle, AMHS.pt) then + begin + if (WM_MOUSEMOVE <= wParam) and (wParam <= WM_MBUTTONDBLCLK) then + wParam := wParam - WM_MOUSEMOVE + WM_NCMOUSEMOVE; + AMHS.hwnd := ACustomizingControl.Handle; + AMHS.wHitTestCode := UINT(HTERROR); + end; + end; + end; + end; + + function BarsWantMouse: Boolean; + + function AllowCustomize(ABarManager: TdxBarManager): Boolean; + begin + Result := (dxBarCustomizingForm <> nil) and + {#DG when adding new toolbar - BarControl must ignore mouse} + (dxBarCustomizingForm.Active or IsChildEx(GetActiveWindow, ABarManager.Owner.Handle)); + end; + + var + ABarManager: TdxBarManager; + I: Integer; + begin + Result := False; + if NeedProccessThisEvent(AMHS.hwnd) and (SmallInt(AMHS.wHitTestCode) = HTERROR) then + begin + ABarManager := dxBarManagerList.CustomizingBarManager; + if (ABarManager <> nil) and AllowCustomize(ABarManager) then + for I := 0 to ABarManager.Bars.Count - 1 do + if (ABarManager.Bars[I].Control <> nil) and ABarManager.Bars[I].Control.WantMouse then + begin + Result := True; + AMHS.hwnd := ABarManager.Bars[I].Control.Handle; + AMHS.wHitTestCode := SendMessage(AMHS.hwnd, WM_NCHITTEST, 0, MakeLParam(AMHS.pt.X, AMHS.pt.Y)); + SendMessage(AMHS.hwnd, WM_SETCURSOR, AMHS.hwnd, MakeLParam(AMHS.wHitTestCode, wParam)); + Break; + end; + end; + end; + + function ProcessMouseMessage(out AIsMessageForMeaningParent: Boolean): Boolean; + var + AControl: TCustomdxBarControl; + begin + Result := not ActiveBarControl.IsWindowEnabled and not ActiveBarManager.IsCustomizing; +// Result := not IsWindowEnabled(AMHS.hwnd) and not ActiveBarControl.BarManager.IsCustomizing and not ActiveBarControl.IsWindowEnabled; + AControl := ActiveBarControl; + while (AControl <> nil) and not Result do + begin + Result := AControl.IsChildWindow(AMHS.hwnd); + if not Result then + begin + Result := AControl.IsMeaningParent(AMHS.hwnd); + AIsMessageForMeaningParent := Result; + end + else + AIsMessageForMeaningParent := False; + AControl := AControl.GetEquivalentParentBar; + end; + end; + + function HideAllIfNeeded(var AHookResult: LRESULT): Boolean; + var + AIsMessageForMeaningParent: Boolean; + begin + Result := False; + if not InMouseHook and (Code >= 0) and (ActiveBarControl <> nil) then + begin + InMouseHook := True; + if ((wParam = WM_RBUTTONUP) or (wParam = WM_NCRBUTTONUP) or + (wParam = WM_MBUTTONUP) or (wParam = WM_NCMBUTTONUP)) and + (ActiveControl = nil) and not ProcessMouseMessage(AIsMessageForMeaningParent) then + begin + InMouseHook := False; + AHookResult := 1; + Result := True; + Exit; + end; + if not ActiveBarManager.Dragging then + repeat + if ({((wParam = WM_LBUTTONUP) or (wParam = WM_NCLBUTTONUP)) and (ActiveControl = nil) and + (AnimatingSubMenu = nil) and not ActiveBarControl.IsCustomizing and + ((ActiveBarControl is TdxBarControl) or (ActiveBarControl.ParentBar <> nil)) or} + IsMouseDownMessage(wParam)) then + begin + if not ProcessMouseMessage(AIsMessageForMeaningParent) then + begin + ActiveBarControl.HideAll; + if not IsWindowVisible(AMHS.hwnd) then + begin + AHookResult := 1; + Result := True; + end; + end + else + begin + if AIsMessageForMeaningParent then + ActiveBarControl.ProcessMouseDownMessageForMeaningParent( + AMHS.hwnd, wParam, AMHS.pt); + Break; + end + end + else + Break; + until ActiveBarControl = nil; + InMouseHook := False; +{ if not IsWindowVisible(AMHS.hwnd) and + (ActiveBarControl <> nil) and ActiveBarControl.IsWindowEnabled then + begin + AHookResult := 1; + Result := True; + end; } + end; + end; + + procedure CheckNavigationController; + begin + if ((BarNavigationController.AssignedSelectedObject <> nil) or + BarNavigationController.IsKeyTipsWaiting or + BarNavigationController.KeyTipsHandlingMode) and + IsMouseDownMessage(wParam) then + BarNavigationController.StopKeyboardHandling; + end; + + procedure CheckBarMarkState; + + function IsChildWindowEx(AParentWnd, AWnd: HWND): Boolean; + begin + repeat + Result := AWnd = AParentWnd; + if Result or not IsChildClassWindow(AWnd) then + Break; + AWnd := GetParent(AWnd); + until AWnd = 0; + end; + + var +// P: TPoint; +// ABarControl: TCustomdxBarControl; + AQuickControl: TdxBarControl; + begin + if (BarDesignController.QuickControl <> nil) and + not BarDesignController.QuickControl.IsActive and + (BarDesignController.QuickControl <> BarDesignController.CustomizingBarControl) and +// ((WM_MOUSEFIRST < wParam) and (wParam <= WM_MOUSELAST) or +// (WM_NCMOUSEMOVE < wParam) and (wParam <= WM_NCMBUTTONDBLCLK)) then + IsMouseDownMessage(wParam) then + begin + AQuickControl := BarDesignController.QuickControl; + if not IsChildWindowEx(AQuickControl.Handle, AMHS.hwnd) and + (not AQuickControl.ParentBar.MouseOnMark or (wParam = WM_RBUTTONDOWN)) then + AQuickControl.CloseUp; +{ + if FindControl(AMHS.hwnd) is TCustomdxBarControl then + begin + ABarControl := TCustomdxBarControl(FindControl(AMHS.hwnd)); + P := AMHS.pt; + ScreenToClient(AMHS.hwnd, P) + end + else + ABarControl := nil; + + if (ABarControl = nil) or (ABarControl <> QuickCustBar) and + ((ABarControl <> QuickCustBar.ParentBar) or + not PtInRect(TdxBarControl(ABarControl).MarkRect, P) or + (wParam = WM_RBUTTONDOWN)) then + QuickCustBar.ParentBar.MarkState := msNone; +} + end; + end; + + procedure ProcessManually(var AHookResult: LRESULT); + var + P: TPoint; + AKeys: Longint; + begin + P := AMHS.pt; + if (WM_NCMOUSEMOVE <= wParam) and (wParam <= WM_NCMBUTTONDBLCLK) then + begin + wParam := wParam - WM_NCMOUSEMOVE + WM_MOUSEMOVE; + ScreenToClient(AMHS.hwnd, P); + end; + if wParam <> WM_MOUSEMOVE then + SetForegroundWindow(dxBarCustomizingForm.Handle); + AKeys := + Byte(GetAsyncKeyState(VK_CONTROL) < 0) * MK_CONTROL + + Byte(LeftButtonPressed) * MK_LBUTTON + + Byte(GetAsyncKeyState(VK_MBUTTON) < 0) * MK_MBUTTON + + Byte(RightButtonPressed) * MK_RBUTTON + + Byte(GetAsyncKeyState(VK_SHIFT) < 0) * MK_SHIFT; + SendMessage(AMHS.hwnd, wParam, AKeys, MakeLParam(P.X, P.Y)); + AHookResult := 1; + end; + +var + AManualProcessing: Boolean; + Res: HRESULT; +begin + Result := 0; + try + if (Code = HC_ACTION) and IsMouseDownMessage(wParam) then + BarNavigationController.ResetNavigationMode; + + if (Code >= 0) and (wParam = WM_MOUSEWHEEL) and (BarGetMouseWheelReceiver = mwrNone) then + begin + Result := 1; + Exit; + end; + + AMHS := PMouseHookStruct(lParam); + if (AMHS.hwnd = GetCapture) and (wParam <> WM_RBUTTONUP) then // TTreeView has capture while WM_RBUTTONUP + Exit; + + CheckHookParams; + AManualProcessing := BarsWantMouse; + if HideAllIfNeeded(Result) then + Exit; + CheckBarMarkState; + CheckNavigationController; + + if AManualProcessing then + ProcessManually(Result); + finally + Res := CallNextHookEx(MouseHookHandle, Code, wParam, lParam); + if Result = 0 then Result := Res; + end; +end; + +// win95 bug fix +var + FIsGetingBarManagerdxBarWndProcHook: Boolean; + +function dxBarWndProcHook(Code: Integer; wParam: WParam; lParam: LParam): LRESULT; stdcall; + + function GetWindowParentForm(AWnd: HWND): TCustomForm; + begin + while not (FindControl(AWnd) is TCustomForm) and (GetParent(AWnd) <> 0) do + AWnd := GetParent(AWnd); + if FindControl(AWnd) is TCustomForm then + Result := TCustomForm(FindControl(AWnd)) + else + Result := nil; + end; + + function GetBarManager(AWnd: HWND): TdxBarManager; + begin + FIsGetingBarManagerdxBarWndProcHook := True; + try + Result := GetBarManagerByHandle(AWnd); + finally + FIsGetingBarManagerdxBarWndProcHook := False; + end; + end; + + procedure ActivateMDIChildFormToolbars(AActivate: Boolean; AActiveWindow: HWND); + var + ABarManagerMainForm: TCustomForm; + AControl: TWinControl; + I: Integer; + begin + AControl := FindControl(AActiveWindow); + if AControl is TCustomdxBarControl then + begin + ABarManagerMainForm := GetBarManagerForm(TCustomdxBarControl(AControl).BarManager, fkMainOrMDIChild); + if IsMDIChild(ABarManagerMainForm) then + Exit; + end; + ABarManagerMainForm := Application.MainForm.ActiveMDIChild; + if ABarManagerMainForm <> nil then + for I := 0 to dxBarManagerList.Count - 1 do + if GetBarManagerForm(dxBarManagerList[I], fkMainOrMDIChild) = ABarManagerMainForm then + dxBarManagerList[I].ShowToolbars(AActivate, False, AActiveWindow); + end; + + procedure CallOwnerWndProc(Msg: Cardinal; wParam, lParam: Integer; AHandle: HWND); + var + ABarManager: TdxBarManager; +//#DG AControl: TWinControl; + AParentForm: TCustomForm; + AWnd: HWND; + begin + if (Msg = WM_ACTIVATE) and ((AHandle = GetParent(lParam)) or (HWND(lParam) = GetParent(AHandle))) and + not IsAnotherApplicatonWindow(AHandle) and not IsAnotherApplicatonWindow(lParam) then + Exit; + AWnd := AHandle; + if (Msg = WM_HELP) and (ActiveBarControl <> nil) then + begin + AParentForm := GetWindowParentForm(AWnd); + if (AParentForm = nil) or not IsBarManagerOwner(ActiveBarManager, AParentForm.Handle) then + AWnd := GetBarManagerForm(ActiveBarManager, fkAny).Handle; + end; + ABarManager := GetBarManager(AWnd); //## + if (ABarManager = nil) and (Msg = WM_ACTIVATE) then + begin +//#DG AControl := FindControl(AHandle); +//#DG if not (AControl is TCustomdxBarControl) and IsWindowVisible(GetParent(AHandle)) then + if IsWindowVisible(GetParent(AHandle)) then //#DG + ABarManager := GetBarManager(GetParent(AHandle)); //## + end; + if ABarManager <> nil then + ABarManager.OwnerWndProc(AWnd, Msg, wParam, lParam); + TdxBarManager.SendFormBroadcastMessage(AWnd, Msg, wParam, lParam); + end; + + procedure CallMainFormClientWndProc(AWnd: HWND; Msg: Cardinal; wParam, lParam: Integer); + var + ABarManager: TdxBarManager; + begin + if (AWnd <> 0) and (Application.MainForm <> nil) and Application.MainForm.HandleAllocated then + begin + GetClassName(AWnd, AClassName, 256); + if AnsiStrIComp(AClassName, 'MDICLIENT') = 0 then + begin + ABarManager := GetBarManager(Application.MainForm.Handle); + if ABarManager <> nil then + ABarManager.MainFormClientWndProc(Msg, wParam, lParam); + end; + end; + end; + +var + AMsg: PCWPStruct; +begin + AMsg := PCWPStruct(lParam); + + case AMsg.message of + WM_ACTIVATE: + if (LOWORD(AMsg.wParam) = WA_INACTIVE) and IsAnotherApplicatonWindow(AMsg.lParam) then + FApplicationDeactivation := True; + WM_ACTIVATEAPP: + begin + FApplicationDeactivation := False; + FApplicationActive := Bool(AMsg.wParam); + BarDesignController.SynchronizeLastSelectedItem; //#DG new + end; + end; + + if not FIsGetingBarManagerdxBarWndProcHook then + begin + CallOwnerWndProc(AMsg.message, AMsg.wParam, AMsg.lParam, AMsg.hwnd); + if (Application.MainForm <> nil) and (Application.MainForm.FormStyle = fsMDIForm) and + Application.MainForm.HandleAllocated and (AMsg.hwnd = Application.MainForm.Handle) and + not IsPopupMenuShowed then + case AMsg.message of + WM_ACTIVATE: + ActivateMDIChildFormToolbars(LOWORD(AMsg.wParam) <> WA_INACTIVE, AMsg.lParam); + WM_WINDOWPOSCHANGED: + if dxBarCustomizingForm <> nil then + dxBarCustomizingForm.UpdateVisibility(PWindowPos(AMsg.lParam)^); + end; + end; + + Result := CallNextHookEx(WndProcHookHandle, Code, wParam, lParam); + + case AMsg.message of + WM_CHILDACTIVATE, WM_DESTROY, WM_MDIACTIVATE: + CallMainFormClientWndProc(GetParent(AMsg.hwnd), AMsg.message, AMsg.wParam, AMsg.lParam); + end; +end; + +var + FPrevInitProc: TProcedure; + +procedure dxBarInitProc; +begin + if Assigned(FPrevInitProc) then + FPrevInitProc; + InitMMSystem; +end; + +procedure RegisterdxBarManager(ABarManager: TdxBarManager); + + procedure SetHook(var AHook: HHook; AHookId: Integer; AHookProc: TFNHookProc); + begin +// if AHook = 0 then + AHook := SetWindowsHookEx(AHookId, AHookProc, 0, GetCurrentThreadId); + end; + +begin + if dxBarManagerList.IndexOf(ABarManager) < 0 then + begin + if dxBarManagerList.Count = 0 then + begin + SetHook(KeyboardHookHandle, WH_KEYBOARD, dxBarKeyboardHook); + SetHook(MouseHookHandle, WH_MOUSE, dxBarMouseHook); + SetHook(WndProcHookHandle, WH_CALLWNDPROC, dxBarWndProcHook); + end; + dxBarManagerList.Add(ABarManager); + if Assigned(FOnRegisterBarManager) then + FOnRegisterBarManager(ABarManager); + end; + if not ABarManager.Designing and (FHintWindow = nil) then + FHintWindow := dxBarHintWindowClass.Create(nil); +end; + +procedure FinalizationBars; + + procedure ReleaseHook(var AHook: HHOOK); + begin + if AHook <> 0 then + begin + UnhookWindowsHookEx(AHook); + AHook := 0; + end; + end; + +begin + ReleaseHook(WndProcHookHandle); + ReleaseHook(MouseHookHandle); + ReleaseHook(KeyboardHookHandle); + FreeAndNil(FHintWindow); +end; + +procedure UnregisterdxBarManager(ABarManager: TdxBarManager); +begin + if dxBarManagerList <> nil then + begin + dxBarManagerList.Extract(ABarManager); + if dxBarManagerList.Count = 0 then + FinalizationBars; + end; + + if Assigned(FOnUnregisterBarManager) then + FOnUnregisterBarManager(ABarManager); +end; + +{ TCustomdxBarControlViewInfo } + +constructor TCustomdxBarControlViewInfo.Create(ABarControl: TCustomdxBarControl); +begin + inherited Create; + FBarControl := ABarControl; + FItemControlViewInfos := TList.Create +end; + +destructor TCustomdxBarControlViewInfo.Destroy; +begin + FreeAndNil(FItemControlViewInfos); + inherited Destroy; +end; + +procedure TCustomdxBarControlViewInfo.Calculate; +begin + Clear; +end; + +function TCustomdxBarControlViewInfo.GetItemControlIndex( + AItemControl: TdxBarItemControl): Integer; +begin + Result := FItemControlViewInfos.IndexOf(AItemControl.ViewInfo); +end; + +function TCustomdxBarControlViewInfo.IsAssociatedWithSeparator( + AItemControl: TdxBarItemControl; out ASeparatorIndex: Integer): Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to High(FSeparatorsData) do + if FSeparatorsData[I].AssociatedItemControl = AItemControl then + begin + Result := True; + ASeparatorIndex := I; + Break; + end; +end; + +function TCustomdxBarControlViewInfo.IsItemControlVisible( + AItemControl: TdxBarItemControl): Boolean; +begin + Result := FItemControlViewInfos.IndexOf(AItemControl.ViewInfo) <> -1; +end; + +procedure TCustomdxBarControlViewInfo.AddItemControlViewInfo( + AViewInfo: TdxBarItemControlViewInfo); +begin + FItemControlViewInfos.Add(AViewInfo); +end; + +procedure TCustomdxBarControlViewInfo.AddSeparatorInfo(const ARect: TRect; + AKind: TdxBarItemSeparatorKind; AAssociatedItemControl: TdxBarItemControl); +var + AIndex: Integer; +begin + AIndex := Length(FSeparatorsData); + SetLength(FSeparatorsData, AIndex + 1); + with FSeparatorsData[AIndex] do + begin + AssociatedItemControl := AAssociatedItemControl; + Bounds := ARect; + Kind := AKind; + end; +end; + +procedure TCustomdxBarControlViewInfo.Clear; +begin + FItemControlViewInfos.Clear; + RemoveSeparatorInfos; +end; + +procedure TCustomdxBarControlViewInfo.RemoveItemControlViewInfo( + AViewInfo: TdxBarItemControlViewInfo); +begin + FItemControlViewInfos.Remove(AViewInfo); +end; + +procedure TCustomdxBarControlViewInfo.RemoveSeparatorInfos; +begin + SetLength(FSeparatorsData, 0); +end; + +function TCustomdxBarControlViewInfo.GetItemControlCount: Integer; +begin + Result := FItemControlViewInfos.Count; +end; + +function TCustomdxBarControlViewInfo.GetItemControlViewInfo( + AIndex: Integer): TdxBarItemControlViewInfo; +begin + Result := TdxBarItemControlViewInfo(FItemControlViewInfos[AIndex]); +end; + +function TCustomdxBarControlViewInfo.GetSeparatorCount: Integer; +begin + Result := Length(FSeparatorsData); +end; + +function TCustomdxBarControlViewInfo.GetSeparatorInfo( + AIndex: Integer): TdxBarItemSeparatorInfo; +begin + with FSeparatorsData[AIndex] do + begin + Result.Bounds := Bounds; + Result.Kind := Kind; + end; +end; + +procedure TCustomdxBarControlViewInfo.SetSeparatorInfo(AIndex: Integer; + const Value: TdxBarItemSeparatorInfo); +begin + with FSeparatorsData[AIndex] do + begin + Bounds := Value.Bounds; + Kind := Value.Kind; + end; +end; + +{ TdxBarDragInfo } + +constructor TdxBarDragInfo.Create(ABarManager: TdxBarmanager); +begin + inherited Create; + FBarManager := ABarManager; +end; + +destructor TdxBarDragInfo.Destroy; +begin + cxRemoveObjectLink(FDragOverBarControlLink); + cxRemoveObjectLink(FDragLineBarControlLink); + inherited; +end; + +procedure TdxBarDragInfo.BeginDrag(AItem: TdxBarItem; AItemLink: TdxBarItemLink); +begin + FDraggingItem := AItem; + FDraggingItemLink := AItemLink; + if FDraggingItemLink <> nil then + FDragDownPoint := FDraggingItemLink.ScreenToClient(GetMouseCursorPos); + FDefaultCursor := Screen.Cursor; + FCaptureWnd := FBarManager.GetWindowForMouseCapturing; + SetCapture(FCaptureWnd); + ProcessMouseMessages; +end; + +procedure TdxBarDragInfo.DragDrop; +begin + case DraggingState of + dsNoDrop: DeleteDraggingItemLink; + dsNoDrag: {do nothing}; + dsBeginGroup: ChangeBeginGroup; + dsCategory: MoveItemToAnotherCategory; + dsCopy, dsDrag: + begin + FDraggingState := dsNoDrag; + CreateNewItemLink; + end; + end; +end; + +procedure TdxBarDragInfo.EndDrag; +begin + if GetCapture = FCaptureWnd then + ReleaseCapture; + DraggingState := dsNoDrag; + + DestroyWindow(FDraggingItemLinkParentHandle); + + RepaintItemControl(DraggingControl); + FDraggingItem := nil; + FDraggingItemLink := nil; + DragOverBarControl := nil; + DragLineBarControl := nil; +end; + +procedure TdxBarDragInfo.HandleDragging; +var + AWnd: HWND; + AMsg: TMsg; + P: TPoint; + AControl: TWinControl; + ACategoryItemIndex: Integer; + AAccept: Boolean; +begin + Include(BarDesignController.FDesignStates, dsKeyAlreadyProcessed); + try + while GetCapture = FCaptureWnd do + begin + case Integer(GetMessage(AMsg, 0, 0, 0)) of + -1: Break; + 0: begin + PostQuitMessage(AMsg.wParam); + Break; + end; + end; + case AMsg.message of + WM_KEYDOWN: + case AMsg.wParam of + VK_ESCAPE: Break; + VK_CONTROL: + if HasTarget then + DraggingState := dsCopy; + end; + WM_KEYUP: + case AMsg.wParam of + VK_CONTROL: + if HasTarget then + DraggingState := dsDrag; + end; + WM_MOUSEMOVE: + begin + P := GetMouseCursorPos; + + AWnd := WindowFromPointEx(P); + AControl := FindControl(AWnd); + + if CategoriesList <> nil then + if AControl = CategoriesList then + begin + P := CategoriesList.ScreenToClient(P); + ACategoryItemIndex := CategoriesList.ItemAtPos(P, True); + if (0 <= ACategoryItemIndex) and (ACategoryItemIndex <= CategoriesList.Items.Count - 1) then + begin + CategoriesList.ItemIndex := ACategoryItemIndex; + DraggingState := dsCategory; + end + else + begin + CategoriesList.ItemIndex := FDraggingItem.Category; + DraggingState := dsNoDrop; + end; + Continue; + end + else + begin + CategoriesList.ItemIndex := FDraggingItem.Category; + end; + + BeginUpdate; + try + if (dxBarSubMenuEditor <> nil) and (dxBarSubMenuEditor.Handle = AWnd) then + dxBarSubMenuEditor.Perform(CM_ACTIVATE, 0, 0); + + CalcDragOverItemParameters(P); + + AAccept := True; + if DragOverBarControl <> nil then + DragOverBarControl.DragOver(P.X, P.Y, AAccept); + + if AAccept and HasTarget then + begin + if IsDragCopy then + DraggingState := dsCopy + else + begin + if (DragOverItemControl <> nil) and (FDraggingItemLink <> nil) and + ((DragOverItemLink = FDraggingItemLink) or NoNeedDragLine) then + DraggingState := dsBeginGroup + else + DraggingState := dsDrag + end; + end + else + DraggingState := dsNoDrop; + finally + EndUpdate; + end; + end; + WM_LBUTTONUP: + begin + DragDrop; + Break; + end; + else + TranslateMessage(AMsg); + DispatchMessage(AMsg); + end; + end; + finally + Exclude(BarDesignController.FDesignStates, dsKeyAlreadyProcessed); + end; +end; + +procedure TdxBarDragInfo.BeginUpdate; +begin + Inc(FLockCount); +end; + +procedure TdxBarDragInfo.EndUpdate; +begin + if FLockCount > 0 then + begin + Dec(FLockCount); + DragInfoChanged; + end; +end; + +procedure TdxBarDragInfo.CalcDragOverItemParameters(var ACursorPos: TPoint); + + function GetDragOverBarControl(AControl: TWinControl): TCustomdxBarControl; + var + I: Integer; + ABarControl: TdxBarControl; + begin + Result := nil; + if AControl is TCustomdxBarControl then + begin + if TCustomdxBarControl(AControl).BarManager = FBarManager then + Result := TCustomdxBarControl(AControl) + end + else + for I := 0 to FBarManager.Bars.Count - 1 do + begin + ABarControl := FBarManager.Bars[I].Control; + if (ABarControl <> nil) and ABarControl.WantMouse then + begin + Result := ABarControl; + Break; + end; + end; + + if (Result <> nil) and not Result.CanCustomizing then + Result := nil; + end; + +var + AItemLink: TdxBarItemLink; + AIsBeginGroup, AIsFirstPart, AIsVerticalDirection: Boolean; +begin + AIsFirstPart := False; + AIsBeginGroup := False; + AIsVerticalDirection := False; + AItemLink := nil; + DragOverBarControl := GetDragOverBarControl(FindControl(WindowFromPointEx(ACursorPos))); + if DragOverBarControl <> nil then + begin + ACursorPos := DragOverBarControl.ScreenToClient(ACursorPos); + DragOverBarControl.CalcDragOverParameters(ACursorPos, AItemLink, + AIsBeginGroup, AIsFirstPart, AIsVerticalDirection); + end; + DragOverItemLink := AItemLink; + DragOverBeginGroup := AIsBeginGroup; + DragOverFirstPart := AIsFirstPart; + DragOverVerticalDirection := AIsVerticalDirection; +end; + +function TdxBarDragInfo.CategoriesList: TListBox; +begin + if (dxBarCustomizingForm <> nil) and (FDraggingItemLink = nil) and FBarManager.Designing then + Result := dxBarCustomizingForm.lbCategories + else + Result := nil; +end; + +procedure TdxBarDragInfo.DragInfoChanged; +var + ACursor: TCursor; +begin + if FLockCount = 0 then + begin + case DraggingState of + dsNoDrop: + begin + ACursor := crdxBarDragNoDrop; + DrawDraggingLine(False); + FDragOverItemLink := nil; + end; + dsDrag: + begin + DrawDraggingLine(False); + ACursor := crdxBarDrag; + if not NoNeedDragLine then + DrawDraggingLine(True); + end; + dsCopy: + begin + DrawDraggingLine(False); + ACursor := crdxBarDragCopy; + DrawDraggingLine(True); + end; + dsCategory: ACursor := crdxBarDrag; + dsBeginGroup: + begin + DrawDraggingLine(False); + ACursor := crdxBarDrag; + end; + else {dsNoDrag} + begin + ACursor := FDefaultCursor; + DrawDraggingLine(False); + end; + end; + SetCursor(Screen.Cursors[ACursor]); + FModified := False; + end + else + FModified := True; +end; + +procedure TdxBarDragInfo.DrawDraggingLine(AVisible: Boolean); + + procedure CalculateDragLineParameters; + var + ADragLineItemLink: TdxBarItemLink; + AIsLastControl: Boolean; + AParentLinks: TdxBarItemLinks; + begin + FDragLineVerticalDirection := DragOverVerticalDirection; + + if DragOverItemLink <> nil then + begin + ADragLineItemLink := DragOverItemLink; + FDragLineFirstPart := DragOverFirstPart; + AParentLinks := FDragOverItemLink.Owner; + if FDragOverBeginGroup then + begin + if FDragLineFirstPart then + ADragLineItemLink := AParentLinks.Prev(ADragLineItemLink, True); + FDragLineFirstPart := not FDragLineFirstPart; + end + else + if not FDragLineFirstPart then + begin + AIsLastControl := ADragLineItemLink.Control.FLastInRow or AParentLinks.Next(ADragLineItemLink, True).BeginGroup; + if not AIsLastControl then + begin + ADragLineItemLink := AParentLinks.Next(ADragLineItemLink, True); + FDragLineFirstPart := True; + end; + end; + FDragLineRect := ADragLineItemLink.ItemRect; + end + else + begin + FDragLineFirstPart := True; + FDragLineRect := DragLineBarControl.ClientRect; + end; + end; + +begin + if (FDragLineVisible <> AVisible) then + begin + (* + {TODO CHECK IT} + if not ADragLineVisible then + FDragOverItemControl.Parent.Update; + *) + if AVisible then + begin + if DragOverBarControl <> nil then + begin + DragLineBarControl := DragOverBarControl; + CalculateDragLineParameters; + InternalDrawDraggingLine; + FDragLineVisible := AVisible; + end; + end + else + begin + if DragLineBarControl <> nil then + InternalDrawDraggingLine; + + DragLineBarControl := nil; + FDragLineVisible := AVisible; + end; + end; +end; + +function TdxBarDragInfo.HasTarget: Boolean; +begin + Result := (DragOverItemControl <> nil) or + (DragOverBarControl <> nil) and (DragOverBarItemLinks.VisibleItemCount = 0); +end; + +function TdxBarDragInfo.IsDragCopy: Boolean; +begin + Result := (GetAsyncKeyState(VK_CONTROL) < 0) or (FDraggingItemLink = nil); +end; + +function TdxBarDragInfo.NoNeedDragLine: Boolean; +begin +//#DG to drop on empty toolbar Result := (FDragOverItemLink = nil) or + Result := not HasTarget or //#DG to drop on empty toolbar + ((DraggingItemLink <> nil) and + ((DragOverItemLink = DraggingItemLink) and (not DragOverBeginGroup or not FDragOverFirstPart) or + + (FDraggingItemLink.VisibleIndex > 0) and + (DragOverItemLink = FDraggingItemLink.Owner.Prev(FDraggingItemLink, True)) and + (not FDraggingItemLink.BeginGroup and not FDragOverBeginGroup and not FDragOverFirstPart) or + + (FDraggingItemLink.VisibleIndex < (FDraggingItemLink.Owner.VisibleItemCount - 1)) and + ((DragOverItemLink = FDraggingItemLink.Owner.Next(FDraggingItemLink, True)) and + ((FDragOverBeginGroup or not DragOverItemLink.BeginGroup) and FDragOverFirstPart)))); +end; + +procedure TdxBarDragInfo.ChangeBeginGroup; +var + ACursorPos: TPoint; + ABeginGroup: Boolean; + ACursorOffset: Integer; +begin + ACursorPos := FDraggingItemLink.ScreenToClient(GetMouseCursorPos); + if DragOverBarControl.IsVerticalDirection then + ACursorOffset := ACursorPos.Y - FDragDownPoint.Y + else + ACursorOffset := ACursorPos.X - FDragDownPoint.X; + ABeginGroup := ACursorOffset > 0; + if Abs(ACursorOffset) >= MakeBeginGroupDragSize then + if FDraggingItemLink.BeginGroup <> ABeginGroup then + begin + FDraggingItemLink.BarControl.SelectedLink := DraggingItemLink; + FBarManager.InternalSetSelectedItem(DraggingControl); + FDraggingItemLink.BeginGroup := ABeginGroup; + end + else + FDraggingItemLink.BarControl.SetKeySelectedItem(DraggingControl); +end; + +procedure TdxBarDragInfo.CreateNewItemLink; +var + ASetBeginGroup{, ANeedRepaintBar}: Boolean; + AItemLink: TdxBarItemLink; +begin + FBarManager.LockDesignerModified(True); + FBarManager.BeginUpdate; //#DG without this - AV, when dropped on empty subcontrol + FBarManager.ItemList.BeginUpdate; + DragOverBarItemLinks.BeginUpdate; //#DG + try + AItemLink := DragOverBarItemLinks.Add; + begin + AItemLink.InternalBringToTopInRecentList(True); + + if FDraggingItemLink <> nil then + begin + if not IsDragCopy then + FDraggingItemLink.FIsMarkedForDeletion := True; + try + AItemLink.Assign(FDraggingItemLink); + finally + FDraggingItemLink.FIsMarkedForDeletion := False; + end; + AItemLink.FBeginGroup := False; + end + else + AItemLink.Item := FDraggingItem; + + if DragOverItemLink <> nil then + begin + ASetBeginGroup := FDragOverBeginGroup and not FDragOverFirstPart or + not FDragOverBeginGroup and FDragOverFirstPart and DragOverItemLink.BeginGroup; + AItemLink.Index := DragOverItemLink.Index + + Byte(not FDragOverBeginGroup and not FDragOverFirstPart); + if ASetBeginGroup then + begin + AItemLink.BeginGroup := True; + DragOverItemLink.BeginGroup := False; + end; + end; + + AItemLink.CreateControl; + FBarManager.InternalSetSelectedItem(AItemLink.Control); + DragOverBarControl.SelectedLink := AItemLink; + + //temp + if not IsDragCopy then + DeleteDraggingItemLink; + + { WHY ??? + if (FDraggingItemLink <> nil) and not IsDragCopy then + begin + ANeedRepaintBar := FDraggingItemLink.Owner <> DragOverBarItemLinks; + DeleteDraggingItemlink; + end + else + ANeedRepaintBar := True; + + if ANeedRepaintBar then + DragOverBarControl.RepaintBar; + } + + // activate barcontrol which contains new itemlink + if (ActiveBarControl <> nil) and (DragOverBarControl is TdxBarControl) and + (ActiveBarControl <> DragOverBarControl) then + begin + ActiveBarControl.HideAll; + TdxBarControl(DragOverBarControl).BarGetFocus(AItemLink.Control); + end; + BarDesignController.SelectItem(AItemLink, soAdd); + end + finally + DragOverBarItemLinks.EndUpdate; + FBarManager.ItemList.EndUpdate(False); + FBarManager.EndUpdate; + FBarManager.LockDesignerModified(False); + end; +end; + +procedure TdxBarDragInfo.DeleteDraggingItemLink; +begin + if FDraggingItemLink <> nil then + FDraggingItemLink.MoveBeginGroupItemIfNeeded; + dxFreeAndNil(FDraggingItemLink); + FBarManager.DesignerModified; +end; + +procedure TdxBarDragInfo.InternalDrawDraggingLine; +const + LineSize = 6; + Pairs: array[0..5] of DWORD = (2, 2, 2, 2, 2, 2); + + procedure PolyPolyLine(ADC: HDC; const Points: array of TPoint); + begin + Windows.PolyPolyLine(ADC, Points, Pairs, 6); + end; + +var + ADC: HDC; + AOrigin: Integer; +begin + ADC := DragLineBarControl.Canvas.Handle; + SetROP2(ADC, R2_NOT); + try + with FDragLineRect do + if FDragLineVerticalDirection then + begin + if FDragLineFirstPart then + AOrigin := Top + else + AOrigin := Bottom - LineSize; + PolyPolyLine(ADC, + [Point(Left, AOrigin), Point(Left, AOrigin + LineSize), + Point(Left + 1, AOrigin + 1), Point(Left + 1, AOrigin + LineSize - 1), + + Point(Left + 2, AOrigin + 2), Point(Right - 2, AOrigin + 2), + Point(Left + 2, AOrigin + 3), Point(Right - 2, AOrigin + 3), + + Point(Right - 2, AOrigin + 1), Point(Right - 2, AOrigin + LineSize - 1), + Point(Right - 1, AOrigin), Point(Right - 1, AOrigin + LineSize)]); + end + else + begin + if FDragLineFirstPart then + AOrigin := Left + else + AOrigin := Right - LineSize; + PolyPolyLine(ADC, + [Point(AOrigin, Top), Point(AOrigin + LineSize, Top), + Point(AOrigin + 1, Top + 1), Point(AOrigin + LineSize - 1, Top + 1), + + Point(AOrigin + 2, Top + 2), Point(AOrigin + 2, Bottom - 2), + Point(AOrigin + 3, Top + 2), Point(AOrigin + 3, Bottom - 2), + + Point(AOrigin + 1, Bottom - 2), Point(AOrigin + LineSize - 1, Bottom - 2), + Point(AOrigin, Bottom - 1), Point(AOrigin + LineSize, Bottom - 1)]); + end; + finally + SetROP2(ADC, R2_COPYPEN); + end; +end; + +procedure TdxBarDragInfo.MoveItemToAnotherCategory; +begin + if (CategoriesList <> nil) and (FDraggingItem.Category <> CategoriesList.ItemIndex) then + FDraggingItem.Category := CategoriesList.ItemIndex; +end; + +function TdxBarDragInfo.GetDraggingControl: TdxBarItemControl; +begin + Result := GetControlByLink(FDraggingItemLink); +end; + +function TdxBarDragInfo.GetDragLineBarControl: TCustomdxBarControl; +begin + Result := TCustomdxBarControl(GetObjectByObjectLink(FDragLineBarControlLink)); +end; + +function TdxBarDragInfo.GetDragOverBarControl: TCustomdxBarControl; +begin + Result := TCustomdxBarControl(GetObjectByObjectLink(FDragOverBarControlLink)); +end; + +function TdxBarDragInfo.GetDragOverBarItemLinks: TdxBarItemLinks; +begin + if DragOverBarControl <> nil then + Result := DragOverBarControl.ItemLinks + else + Result := nil; +end; + +function TdxBarDragInfo.GetDragOverItemControl: TdxBarItemControl; +begin + Result := GetControlByLink(FDragOverItemLink); +end; + +procedure TdxBarDragInfo.SetDraggingState(Value: TdxBarDraggingState); +begin + if FDraggingState <> Value then + begin + FDraggingState := Value; + DragInfoChanged; + end; +end; + +procedure TdxBarDragInfo.SetDragLineBarControl(Value: TCustomdxBarControl); +begin + cxRemoveObjectLink(FDragLineBarControlLink); + FDragLineBarControlLink := cxAddObjectLink(Value); +end; + +procedure TdxBarDragInfo.SetDragOverBarControl(Value: TCustomdxBarControl); +begin + cxRemoveObjectLink(FDragOverBarControlLink); + FDragOverBarControlLink := cxAddObjectLink(Value); +end; + +procedure TdxBarDragInfo.SetDragOverBeginGroup(Value: Boolean); +begin + if FDragOverBeginGroup <> Value then + begin + FDragOverBeginGroup := Value; + DragInfoChanged; + end; +end; + +procedure TdxBarDragInfo.SetDragOverFirstPart(Value: Boolean); +begin + if FDragOverFirstPart <> Value then + begin + FDragOverFirstPart := Value; + DragInfoChanged; + end; +end; + +procedure TdxBarDragInfo.SetDragOverVerticalDirection(Value: Boolean); +begin + if FDragOverVerticalDirection <> Value then + begin + FDragOverVerticalDirection := Value; + DragInfoChanged; + end; +end; + +procedure TdxBarDragInfo.SetDragOverItemLink(Value: TdxBarItemLink); +begin + if FDragOverItemLink <> Value then + begin + FDragOverItemLink := Value; + + if FDragOverItemLink <> nil then + begin + DrawDraggingLine(False); + if (DragOverItemControl is TdxBarSubItemControl) or + (DragOverBarControl.SelectedControl is TdxBarSubItemControl) then + DragOverBarControl.SetMouseSelectedItem(DragOverItemControl) + else + begin // for better painting + FBarManager.SelectedItem := DragOverItemControl; + DragOverBarControl.SelectedLink := DragOverItemLink; + end; + ProcessPaintMessages; + end; + + DragInfoChanged; + end; +end; + +{ TdxBarImageOptions } + +constructor TdxBarImageOptions.Create; +begin + inherited; + FNotifyComponent := TcxFreeNotificator.Create(nil); + FNotifyComponent.OnFreeNotification := FreeNotification; + + FImagesChangeLink := TChangeLink.Create; + FLargeImagesChangeLink := TChangeLink.Create; + FHotImagesChangeLink := TChangeLink.Create; + FDisabledImagesChangeLink := TChangeLink.Create; + FDisabledLargeImagesChangeLink := TChangeLink.Create; + + FCacheGlyphs := True; + FUseLeftBottomPixelAsTransparent := True; + FStretchGlyphs := True; + FImageListBkColor := clFuchsia; + CalcGlyphSize; +end; + +destructor TdxBarImageOptions.Destroy; +begin + FreeAndNil(FDisabledImagesChangeLink); + FreeAndNil(FDisabledLargeImagesChangeLink); + FreeAndNil(FHotImagesChangeLink); + FreeAndNil(FLargeImagesChangeLink); + FreeAndNil(FImagesChangeLink); + + FreeAndNil(FNotifyComponent); + inherited; +end; + +procedure TdxBarImageOptions.Assign(Source: TPersistent); +begin + if Source is TdxBarImageOptions then + begin + DisabledImages := TdxBarImageOptions(Source).DisabledImages; + DisabledLargeImages := TdxBarImageOptions(Source).DisabledLargeImages; + HotImages := TdxBarImageOptions(Source).HotImages; + ImageListBkColor := TdxBarImageOptions(Source).ImageListBkColor; + Images := TdxBarImageOptions(Source).Images; + LargeImages := TdxBarImageOptions(Source).LargeImages; + LargeIcons := TdxBarImageOptions(Source).LargeIcons; + MakeDisabledImagesFaded := TdxBarImageOptions(Source).MakeDisabledImagesFaded; + SmoothGlyphs := TdxBarImageOptions(Source).SmoothGlyphs; + StretchGlyphs := TdxBarImageOptions(Source).StretchGlyphs; + UseLargeImagesForLargeIcons := TdxBarImageOptions(Source).UseLargeImagesForLargeIcons; + UseLeftBottomPixelAsTransparent := TdxBarImageOptions(Source).UseLeftBottomPixelAsTransparent; + end + else + inherited Assign(Source); +end; + +function TdxBarImageOptions.GetIsLoading: Boolean; + + function InternalIsLoading(AImages: TCustomImageList): Boolean; + begin + Result := (AImages <> nil) and (csLoading in AImages.ComponentState); + end; + +begin + Result := InternalIsLoading(FImages) or InternalIsLoading(FDisabledImages) or + InternalIsLoading(FDisabledLargeImages) or InternalIsLoading(FHotImages) or + InternalIsLoading(FLargeImages); +end; + +procedure TdxBarImageOptions.SetImageList(var ANewValue, AOldValue: TCustomImageList; const AChangeLink: TChangeLink); +begin + cxSetImageList(ANewValue, AOldValue, AChangeLink, FNotifyComponent); +end; + +procedure TdxBarImageOptions.SetHotImages(Value: TCustomImageList); +begin + SetImageList(Value, FHotImages, FHotImagesChangeLink); +end; + +procedure TdxBarImageOptions.SetImageListBkColor(Value: TColor); +begin + if FImageListBkColor <> Value then + begin + FImageListBkColor := Value; + CallNotify(FOnImageOptionsChange, Self); + end; +end; + +procedure TdxBarImageOptions.SetImages(Value: TCustomImageList); +begin + SetImageList(Value, FImages, FImagesChangeLink); +end; + +procedure TdxBarImageOptions.SetDisabledImages(Value: TCustomImageList); +begin + SetImageList(Value, FDisabledImages, FDisabledImagesChangeLink); +end; + +procedure TdxBarImageOptions.SetDisabledLargeImages(Value: TCustomImageList); +begin + SetImageList(Value, FDisabledLargeImages, FDisabledLargeImagesChangeLink); +end; + +procedure TdxBarImageOptions.SetLargeIcons(Value: Boolean); +begin + if FLargeIcons <> Value then + begin + FLargeIcons := Value; + CallNotify(FOnLargeIconsChange, Self); + end; +end; + +procedure TdxBarImageOptions.SetLargeImages(Value: TCustomImageList); +begin + if FLargeImages <> Value then + begin + SetImageList(Value, FLargeImages, FLargeImagesChangeLink); + if LargeIcons and UseLargeImagesForLargeIcons then + CallNotify(FOnLargeIconsChange, Self); + end; +end; + +procedure TdxBarImageOptions.SetMakeDisabledImagesFaded(Value: Boolean); +begin + if FMakeDisabledImagesFaded <> Value then + begin + FMakeDisabledImagesFaded := Value; + CallNotify(FOnImageOptionsChange, Self); + end; +end; + +procedure TdxBarImageOptions.SetUseLargeImagesForLargeIcons(Value: Boolean); +begin + if FUseLargeImagesForLargeIcons <> Value then + begin + FUseLargeImagesForLargeIcons := Value; + CallNotify(FOnImageOptionsChange, Self); + end; +end; + +procedure TdxBarImageOptions.SetUseLeftBottomPixelAsTransparent(Value: Boolean); +begin + if FUseLeftBottomPixelAsTransparent <> Value then + begin + FUseLeftBottomPixelAsTransparent := Value; + CallNotify(FOnImageOptionsChange, Self); + end; +end; + +procedure TdxBarImageOptions.CalcGlyphSize; +begin + if LargeIcons then + begin + if IsLargeImagesForLargeIcons then + FGlyphSize := LargeImages.Width + else + FGlyphSize := DefautGlyphSize * 2; + end + else + FGlyphSize := DefautGlyphSize; // * (1 + Byte(FLargeIcons)); +end; + +function TdxBarImageOptions.IsLargeImagesForLargeIcons: Boolean; +begin + Result := UseLargeImagesForLargeIcons and (LargeImages <> nil); +end; + +procedure TdxBarImageOptions.FreeNotification(AComponent: TComponent); +begin + if AComponent = DisabledLargeImages then DisabledLargeImages := nil; + if AComponent = DisabledImages then DisabledImages := nil; + if AComponent = HotImages then HotImages := nil; + if AComponent = Images then Images := nil; + if AComponent = LargeImages then LargeImages := nil; +end; + +{ TdxBarManager } + +constructor TdxBarManager.Create(AOwner: TComponent); +begin + Include(FInternalState, bisCreating); + if (AOwner = nil) and (Application.MainForm <> nil) then + AOwner := Application.MainForm; + if not (AOwner is TWinControl) then + raise Exception.Create(cxGetResourceString(@dxSBAR_BARMANAGERBADOWNER)); + if GetBarManagerByComponent(AOwner) <> nil then + raise Exception.Create(cxGetResourceString(@dxSBAR_BARMANAGERMORETHANONE)); + Exclude(FInternalState, bisCreating); + + inherited Create(AOwner); + + RegisterdxBarManager(Self); + FBackgrounds := TdxBarBackgrounds.Create(Self); + FLookAndFeel := TcxLookAndFeel.Create(Self); + FLookAndFeel.OnChanged := LFChanged; + Style := bmsEnhanced; + FAllowReset := True; + FAutoDockColor := True; + + FInternalItems := TComponentList.Create; + FItems := TdxBarComponentList.Create; //#DG list + + FCategories := TdxBarManagerCategories.Create(Self); + FDockControls := TList.Create; + FPopupMenus := TComponentList.Create(False); + FBars := TdxBars.Create(Self); + + FReadIniFileHandlers := TcxEventHandlerCollection.Create; + FWriteIniFileHandlers := TcxEventHandlerCollection.Create; + FMDIStateChangedHandlers := TcxEventHandlerCollection.Create; + FSystemFontChangedHandlers := TcxEventHandlerCollection.Create; + + FCanCustomize := True; + FDockColor := clBtnFace; + FBarCaptionFont := TFont.Create; + FEditFont := TFont.Create; + FFont := TFont.Create; + FFont.OnChange := FontChanged; + + FGroups := TdxBarComponentList.Create; //#DG list + + FHelpButtonGlyph := dxBarCreateBitmap(HelpButtonGlyphChanged); + FHideFloatingBarsWhenInactive := True; + + FThemeChangedNotificator := TdxThemeChangedNotificator.Create; + FThemeChangedNotificator.OnThemeChanged := ThemeChanged; + FButtonArrowWidth := dxBarDefaultButtonArrowWidth; + FLargeButtonArrowWidth := dxBarDefaultLargeButtonArrowWidth; + FMenusShowRecentItemsFirst := True; + FMostRecentItemsPercents := 95; + CalcMostRecentlyUsedUseCount; + FPopupMenuLinks := TdxBarPopupMenuLinks.Create(Self); + FScaled := True; + FShowFullMenusAfterDelay := True; + FShowHint := True; + FShowHintForDisabledItems := True; + + FUseF10ForMenu := True; + UseSystemFont := True; + FWaitForDockingTime := 21; + CreateToolbarsBrushes; + + FDragInfo := TdxBarDragInfo.Create(Self); + + FImageOptions := TdxBarImageOptions.Create(Self); + FImageOptions.FImagesChangeLink.OnChange := ImageListChange; + FImageOptions.FLargeImagesChangeLink.OnChange := LargeImageListChange; + FImageOptions.FHotImagesChangeLink.OnChange := HotImageListChange; + FImageOptions.FDisabledImagesChangeLink.OnChange := DisabledImageListChange; + FImageOptions.FDisabledLargeImagesChangeLink.OnChange := DisabledLargeImageListChange; + FImageOptions.FOnImageOptionsChange := ImageOptionsChange; + FImageOptions.FOnLargeIconsChange := LargeIconsChange; + if not (csDesigning in ComponentState) then + FSavedState := TMemIniFile.Create(''); +end; + +destructor TdxBarManager.Destroy; +begin + if not (bisCreating in FInternalState) then + begin + UnregisterdxBarManager(Self); + + FHintObject := nil; + FreeAndNil(FSavedState); + FreeAndNil(FImageOptions); + FreeAndNil(FDragInfo); + FreeAndNil(FLookAndFeel); + + FreeAndNil(FThemeChangedNotificator); + + if FHintTimerID <> 0 then + begin + KillHintTimer; + HideHint; + end; + KillHiddenHintTimer; + Customizing(False); + + DestroyToolbarsBrushes; + FPopupMenus.OwnsObjects := True; + FreeAndNil(FPopupMenus); + FreeAndNil(FHelpButtonGlyph); + FGroups.OwnsObjects := True; + FreeAndNil(FGroups); + FreeAndNil(FFont); + FreeAndNil(FEditFont); + FreeAndNil(FBarCaptionFont); + dxFreeAndNil(FBars); + + FreeAndNil(FMDIStateChangedHandlers); + FreeAndNil(FSystemFontChangedHandlers); + FreeAndNil(FReadIniFileHandlers); + FreeAndNil(FWriteIniFileHandlers); + + FreeAndNil(FDockControls); + DestroyItems; +//#DG UnregisterdxBarManager(Self); + FreeAndNil(FCategories); + DestroyBarRestoringList; + FreeAndNil(FPopupMenuLinks); + FreeAndNil(FBackgrounds); + FreeAndNil(FDefaultPainter); + end; + inherited Destroy; +end; + +procedure TdxBarManager.ActivateHint(AShow: Boolean; const CustomHint: string; AHintObject: TObject = nil); +begin + if not IsCustomizing and ShowHint then + begin + if AShow and FHintWindow.IsScreenTipWindow then + DoActivateHint(False, '', nil); + DoActivateHint(AShow, CustomHint, AHintObject); + end; +end; + +procedure TdxBarManager.HideHint; +begin + ActivateHint(False, ''); +end; + +procedure TdxBarManager.BeginUpdate; +begin + Inc(FLockUpdateCount); + if FLockUpdateCount = 1 then + DoLockUpdate(True, False); +end; + +procedure TdxBarManager.EndUpdate(ACheckBarsChanges: Boolean = True); +begin + Dec(FLockUpdateCount); + if (FLockUpdateCount = 0) and not IsDestroying then + DoLockUpdate(False, ACheckBarsChanges); +end; + +procedure TdxBarManager.InternalSetSelectedItem(Value: TdxBarItemControl); +begin + FSelectedItem := Value; +end; + +function TdxBarManager.GetBarControlFocused: Boolean; +begin + Result := FFocusedBarControl <> nil; +end; + +function TdxBarManager.GetBarsLoading: Boolean; +begin + Result := bisBarsLoading in FInternalState; +end; + +function TdxBarManager.GetCanModifyDesigner: Boolean; +begin + Result := FLockDesignerModifiedCount = 0; +end; + +function TdxBarManager.GetCategoryItemsVisible(AIndex: Integer): TdxBarItemVisible; +begin + if (0 <= AIndex) and (AIndex < FCategories.Count) then + with FCategories do + if Objects[AIndex] = nil then + Result := ivAlways + else + Result := TdxBarCategoryData(Objects[AIndex]).ItemsVisible + else Result := ivNever; +end; + +function TdxBarManager.GetCategoryVisible(AIndex: Integer): Boolean; +begin + if (0 <= AIndex) and (AIndex < FCategories.Count) then + with FCategories do + Result := (Objects[AIndex] = nil) or TdxBarCategoryData(Objects[AIndex]).Visible + else Result := False; +end; + +function TdxBarManager.GetDesigning: Boolean; +begin + Result := csDesigning in ComponentState; +end; + +function TdxBarManager.GetDockColor: TColor; +begin + if FAutoDockColor then + Result := TControlAccess(Owner).Color + else + Result := FDockColor; +end; + +function TdxBarManager.GetDockControl(Index: Integer): TdxDockControl; +begin + Result := FDockControls[Index]; +end; + +function TdxBarManager.GetDockControlCount: Integer; +begin + Result := FDockControls.Count; +end; + +function TdxBarManager.GetDragging: Boolean; +begin + Result := DragInfo.DraggingState <> dsNoDrag; +end; + +function TdxBarManager.GetDraggingItem: TdxBarItem; +begin + Result := DragInfo.DraggingItem; +end; + +function TdxBarManager.GetDraggingItemLink: TdxBarItemLink; +begin + Result := DragInfo.DraggingItemLink; +end; + +function TdxBarManager.GetFlat: Boolean; +begin + Result := FStyle = bmsFlat; +end; + +function TdxBarManager.GetFlatToolbarsBorderColor: COLORREF; + + function GetDarkValue(Value: Byte): Byte; + begin + Result := MulDiv(Value, 8, 10); + end; + +begin + Result := GetSysColor(COLOR_BTNSHADOW); + Result := RGB( + GetDarkValue(GetRValue(Result)), + GetDarkValue(GetGValue(Result)), + GetDarkValue(GetBValue(Result))); + Result := GetRealColor(Result); +end; + +function TdxBarManager.GetFlatToolbarsColor: COLORREF; + + function GetLightValue(Value: Byte): Byte; + begin + Result := Value + MulDiv(255 - Value, 16, 100); + end; + +begin + Result := GetSysColor(COLOR_BTNFACE); + Result := RGB( + GetLightValue(GetRValue(Result)), + GetLightValue(GetGValue(Result)), + GetLightValue(GetBValue(Result))); + Result := GetRealColor(Result); +end; + +function TdxBarManager.GetFlatToolbarsDownedColor: COLORREF; +begin + Result := GetRealColor(GetLightColor(11, 9, 73)); +end; + +function TdxBarManager.GetFlatToolbarsDownedSelColor: COLORREF; +begin + Result := GetRealColor(GetLightColor(14, 44, 40)); +end; + +function TdxBarManager.GetFlatToolbarsSelColor: COLORREF; +begin + Result := GetRealColor(GetLightColor(-2, 30, 72)); +end; + +function TdxBarManager.GetGroup(Index: Integer): TdxBarGroup; +begin + Result := TdxBarGroup(FGroups[Index]); +end; + +function TdxBarManager.GetGroupCount: Integer; +begin + Result := FGroups.Count; +end; + +function TdxBarManager.GetInternalDockControl( + ADockingStyle: TdxBarDockedDockingStyle): TdxDockControl; +begin + Result := DockControls[Integer(ADockingStyle) - 1]; +end; + +function TdxBarManager.GetIsCustomizing: Boolean; +begin + Result := FIsCustomizing or Designing; +end; + +function TdxBarManager.GetIsDestroying: Boolean; +begin + Result := csDestroying in ComponentState; +end; + +function TdxBarManager.GetIsHandleCreating: Boolean; +begin + Result := bisHandleCreating in FInternalState; +end; + +function TdxBarManager.GetIsInitializing: Boolean; +begin + Result := IsLoading or (bisAfterLoading in FInternalState); +end; + +function TdxBarManager.GetItemCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxBarManager.GetItem(Index: Integer): TdxBarItem; +begin + if (0 <= Index) and (Index < FItems.Count) then + Result := TdxBarItem(FItems[Index]) + else + Result := nil; +end; + +function TdxBarManager.GetLastSelectedLinkAtDesign: TdxBarItemLink; +var + ASelectedItem: TPersistent; +begin +{ +#DG remove from BarControl + if BarManager.Dragging then + Result := BarManager.DraggingItemLink + else + if (SelectedItem = BarManager.SelectedItem) and (SelectedItem <> nil) then + Result := BarManager.SelectedItem.ItemLink + else + Result := nil +} + ASelectedItem := GetInstance(BarDesignController.LastSelectedItem); + if not(ASelectedItem is TdxBarItemLink) or (TdxBarItemLink(ASelectedItem).BarManager <> Self) then + ASelectedItem := nil; + + Result := TdxBarItemLink(ASelectedItem); +end; + +function TdxBarManager.GetRestoringListBar(Index: Integer): TdxBar; +begin + Result := TdxBar(FBarRestoringList[Index]); +end; + +function TdxBarManager.GetRestoringListBarCount: Integer; +begin + if BarRestoringListExists then + Result := FBarRestoringList.Count + else + Result := 0; +end; + +function TdxBarManager.GetTabOrder: Integer; +begin + Result := dxBarManagerList.IndexOf(Self); +end; + +procedure TdxBarManager.IniFileCollectionCallMethods(ACollection: TcxEventHandlerCollection; + AIniFile: TCustomIniFile; AStoringKind: TdxBarStoringKind; ASection: string); +var + AIniFileEventData: TdxBarIniFileEventData; +begin + AIniFileEventData.IniFile := AIniFile; + AIniFileEventData.StoringKind := AStoringKind; + AIniFileEventData.BaseSection := ASection; + AIniFileEventData.Delimiter := GetSectionDelimiter(AStoringKind); + ACollection.CallEvents(Self, AIniFileEventData); +end; + +function TdxBarManager.InternalGetPainterClass: TdxBarPainterClass; +begin + Result := TdxBarPainterClass(DefaultPainter.ClassType); +end; + +procedure TdxBarManager.SetAutoAlignBars(Value: Boolean); +begin + if FAutoAlignBars <> Value then + begin + FAutoAlignBars := Value; + DoLockUpdate(False, False); + end; +end; + +procedure TdxBarManager.SetAutoDockColor(Value: Boolean); +var + I: Integer; +begin + if FAutoDockColor <> Value then + begin + FAutoDockColor := Value; + for I := 0 to DockControlCount - 1 do + DockControls[I].ColorChanged; + end; +end; + +procedure TdxBarManager.SetAutoHideEmptyBars(Value: Boolean); +var + I: Integer; +begin + if FAutoHideEmptyBars <> Value then + begin + FAutoHideEmptyBars := Value; + if not Value then + for I := 0 to FBars.Count - 1 do + Bars[I].FInternallyHidden := False; + end; +end; + +procedure TdxBarManager.SetBackgrounds(Value: TdxBarBackgrounds); +begin + FBackgrounds.Assign(Value); +end; + +procedure TdxBarManager.SetButtonArrowWidth(Value: Integer); +begin + if FButtonArrowWidth <> Value then + begin + if Value < 2 then Exit; + FButtonArrowWidth := Value; + Bars.Repaint; + end; +end; + +procedure TdxBarManager.SetCategories(Value: TStrings); +begin + Categories.Assign(Value); +end; + +procedure TdxBarManager.SetCategoryItemsVisible(AIndex: Integer; Value: TdxBarItemVisible); +var + ACategoryData: TdxBarCategoryData; + AEmptyBars, AList: TList; + APrevValue: TdxBarItemVisible; + I: Integer; +begin + if (AIndex < 0) or (AIndex >= FCategories.Count) then + Exit; + + APrevValue := CategoryItemsVisible[AIndex]; + with FCategories do + begin + ACategoryData := TdxBarCategoryData(Objects[AIndex]); + if ACategoryData = nil then + begin + Objects[AIndex] := TdxBarCategoryData.Create; + ACategoryData := TdxBarCategoryData(Objects[AIndex]); + ACategoryData.ItemsVisible := ivAlways; + ACategoryData.Visible := True; + end; + if Self.IsLoading then + begin + ACategoryData.LoadedItemsVisible := Value; + Exit; + end; + ACategoryData.ItemsVisible := Value; + + if not Designing then + begin + AEmptyBars := nil; + if AutoHideEmptyBars then + begin + AEmptyBars := TList.Create; + for I := 0 to FBars.Count - 1 do + if FBars[I].ItemLinks.AvailableItemCount = 0 then AEmptyBars.Add(FBars[I]); + end; + Self.BeginUpdate; + + AList := TList.Create; + try + GetAllItemsByCategory(AIndex, AList); + if Value = ivAlways then + begin + for I := AList.Count - 1 downto 0 do + if TdxBarItem(AList[I]).Visible = APrevValue then + TdxBarItem(AList[I]).Visible := Value; + end + else + for I := 0 to AList.Count - 1 do + if TdxBarItem(AList[I]).Visible = APrevValue then + TdxBarItem(AList[I]).Visible := Value; + finally + AList.Free; + + if AutoHideEmptyBars then + for I := 0 to Bars.Count - 1 do + if (Value = ivNever) and (Bars[I].ItemLinks.AvailableItemCount = 0) and (AEmptyBars.IndexOf(Bars[I]) = -1) or + (Value = ivAlways) and (Bars[I].ItemLinks.AvailableItemCount > 0) and Bars[I].FInternallyHidden then + begin + Bars[I].Visible := Value = ivAlways; + Bars[I].FInternallyHidden := Value = ivNever; + end; + FreeAndNil(AEmptyBars); + Self.EndUpdate; + end; + end; + end; + if Value <> APrevValue then + DesignerModified; +end; + +procedure TdxBarManager.SetCategoryVisible(AIndex: Integer; Value: Boolean); +begin + if (0 <= AIndex) and (AIndex < FCategories.Count) and + (CategoryVisible[AIndex] <> Value) then + begin + with FCategories do + begin + if Objects[AIndex] = nil then + begin + Objects[AIndex] := TdxBarCategoryData.Create; + TdxBarCategoryData(Objects[AIndex]).ItemsVisible := ivAlways; + end; + TdxBarCategoryData(Objects[AIndex]).Visible := Value; + end; + DesignerModified; + end; +end; + +function TdxBarManager.GetMainForm: TCustomForm; +begin + Result := GetBarManagerForm(Self, fkMain); +end; + +function TdxBarManager.GetMainMenuControl: TdxBarControl; +begin + if MainMenuBar <> nil then + Result := FMainMenuBar.Control + else + Result := nil; +end; + +function TdxBarManager.GetMasterForm: TCustomForm; +begin + Result := GetBarManagerForm(Self, fkMainOrMDIChild); +end; + +function TdxBarManager.GetNotDocking: TdxBarDockingStyles; +begin + Result := FNotDocking; +end; + +function TdxBarManager.GetParentBarManager: TdxBarManager; +begin + Result := nil; + if Owner.HandleAllocated then + Result := GetBarManagerForComponent(GetChildWindowVCLParent(Owner.Handle)); +end; + +function TdxBarManager.GetParentedOwner: TWinControl; +begin + Result := TWinControl(inherited Owner); +end; + +function TdxBarManager.GetParentForm: TCustomForm; +begin + Result := GetBarManagerForm(Self, fkAny); +end; + +procedure TdxBarManager.SetDockColor(Value: TColor); +var + I: Integer; +begin + if FDockColor <> Value then + begin + FDockColor := Value; + FAutoDockColor := False; + for I := 0 to DockControlCount - 1 do + DockControls[I].ColorChanged; + end; +end; + +procedure TdxBarManager.SetFlatCloseButton(Value: Boolean); +begin + if FFlatCloseButton <> Value then + begin + FFlatCloseButton := Value; + if MainMenuControl <> nil then + begin + //#DG + if (SelectedItem <> nil) and (SelectedItem.Parent = MainMenuControl) then + SelectedItem := nil; + MainMenuControl.RepaintBar; + end; + end; +end; + +procedure TdxBarManager.SetFont(Value: TFont); +begin + Font.Assign(Value); +end; + +procedure TdxBarManager.SetHelpButtonGlyph(Value: TBitmap); +begin + FHelpButtonGlyph.Assign(Value); +end; + +procedure TdxBarManager.SetHideFloatingBarsWhenInactive(Value: Boolean); +begin + if FHideFloatingBarsWhenInactive <> Value then + begin + FHideFloatingBarsWhenInactive := Value; + ShowToolbars(FMainFormActive or not FHideFloatingBarsWhenInactive, False, 0); + end; +end; + +procedure TdxBarManager.SetDraggingItem(Value: TdxBarItem); +begin + DragInfo.DraggingItem := Value; +end; + +procedure TdxBarManager.SetDraggingItemLink(Value: TdxBarItemLink); +begin + DragInfo.DraggingItemLink := Value; +end; + +function TdxBarManager.GetIsLoading: Boolean; +begin + Result := csLoading in ComponentState; +end; + +function TdxBarManager.GetIsRecreating: Boolean; +begin +{$IFDEF DELPHI10} + Result := csRecreating in Owner.ControlState; +{$ELSE} + Result := False; +{$ENDIF} +end; + +function TdxBarManager.GetIsStateSaving: Boolean; +begin + Result := bisStateSaving in FInternalState; +end; + +procedure TdxBarManager.SetLargeButtonArrowWidth(Value: Integer); +var + I: Integer; +begin + if FLargeButtonArrowWidth <> Value then + begin + if Value < 2 then Exit; + FLargeButtonArrowWidth := Value; + for I := 0 to Bars.Count - 1 do + with Bars[I] do + if Control <> nil then Control.RepaintBar; + end; +end; + +procedure TdxBarManager.SetLockUpdate(Value: Boolean); +begin + if Value <> FLockUpdate then + begin + FLockUpdate := Value; + if FLockUpdate then + BeginUpdate + else + EndUpdate(False); + end; +end; + +procedure TdxBarManager.SetLookAndFeel(Value: TcxLookAndFeel); +begin + FLookAndFeel.Assign(Value); +end; + +procedure TdxBarManager.SetMenuAnimations(Value: TdxBarMenuAnimations); +begin + if FMenuAnimations <> Value then + begin + FMenuAnimations := Value; + DesignerModified; + UpdateBarManagerOptions; + end; +end; + +procedure TdxBarManager.SetMenusShowRecentItemsFirst(Value: Boolean); +begin + if FMenusShowRecentItemsFirst <> Value then + begin + FMenusShowRecentItemsFirst := Value; + DesignerModified; + UpdateBarManagerOptions; + end; +end; + +procedure TdxBarManager.SetMostRecentItemsPercents(Value: Byte); +begin + if Value > 100 then Value := 100; + FMostRecentItemsPercents := Value; + CalcMostRecentlyUsedUseCount; +end; + +procedure TdxBarManager.SetNotDocking(Value: TdxBarDockingStyles); +begin + if FNotDocking <> Value then + begin + FNotDocking := Value; + InternalStyleChanged; // TODO: ??? + end; +end; + +procedure TdxBarManager.SetPopupMenuLinks(Value: TdxBarPopupMenuLinks); +begin + FPopupMenuLinks.Assign(Value); +end; + +procedure TdxBarManager.SetRegistryPath(Value: string); +begin + FRegistryPath := Value; + CorrectRegistryPath(FRegistryPath); +end; + +procedure TdxBarManager.SetScaled(Value: Boolean); +begin + if FScaled <> Value then + begin + FScaled := Value; + if Value and not FUseSystemFont then AssignFont; + end; +end; + +procedure TdxBarManager.SetSelectedItem(Value: TdxBarItemControl); +//#DG var +//#DG OldSelectedItem: TdxBarItemControl; +begin + if FSelectedItem <> Value then + begin + if IsCustomizing and (FSelectedItem <> nil) and + ((Value = nil) or + (GetParentBarForControl(Value) <> GetParentBarForControl(FSelectedItem))) then + if GetParentBarForControl(FSelectedItem) <> nil then + GetParentBarForControl(FSelectedItem).SetMouseSelectedItem(nil) + else + if (dxBarSubMenuEditor <> nil) and (GetParentBarOrSubMenuForControl(FSelectedItem) = + dxBarSubMenuEditor.ItemLinks.BarControl) then + dxBarSubMenuEditor.ItemLinks.DestroyBarControl; +//#DG OldSelectedItem := FSelectedItem; + InternalSetSelectedItem(Value); +{#DG may be un necessary ? + if (OldSelectedItem <> nil) and (OldSelectedItem.Parent <> nil) and not Dragging then + OldSelectedItem.Repaint; +} +{#DG + if Designing and (FSelectedItem <> nil) and not Dragging then + SelectComponent(FSelectedItem.ItemLink.Item); +} +(* #DG LastSelectedObject idea + if (Value = nil) and IsCustomizing and not Designing then + SelectedLink := nil; +*) + end; +end; + +procedure TdxBarManager.SetShowCloseButton(Value: Boolean); +begin + if FShowCloseButton <> Value then + begin + FShowCloseButton := Value; + if MainMenuControl <> nil then + begin + //#DG + if (SelectedItem <> nil) and (SelectedItem.Parent = MainMenuControl) then + SelectedItem := nil; + MainMenuControl.RepaintBar; + end; + end; +end; + +procedure TdxBarManager.SetShowFullMenusAfterDelay(Value: Boolean); +begin + if FShowFullMenusAfterDelay <> Value then + begin + FShowFullMenusAfterDelay := Value; + DesignerModified; + UpdateBarManagerOptions; + end; +end; + +procedure TdxBarManager.SetShowHelpButton(Value: Boolean); +begin + if FShowHelpButton <> Value then + begin + FShowHelpButton := Value; + UpdateHelpButton; + end; +end; + +procedure TdxBarManager.SetShowHint(Value: Boolean); +begin + if FShowHint <> Value then + begin + FShowHint := Value; + DesignerModified; + UpdateBarManagerOptions; + end; +end; + +procedure TdxBarManager.SetShowShortCutInHint(Value: Boolean); +begin + if FShowShortCutInHint <> Value then + begin + FShowShortCutInHint := Value; + DesignerModified; + UpdateBarManagerOptions; + end; +end; + +procedure TdxBarManager.SetStyle(Value: TdxBarManagerStyle); +begin + if FStyle <> Value then + begin + FStyle := Value; + InternalStyleChanged; + end; +end; + +procedure TdxBarManager.SetSunkenBorder(Value: Boolean); +var + I: Integer; +begin + if FSunkenBorder <> Value then + begin + FSunkenBorder := Value; + for I := 0 to DockControlCount - 1 do + DockControls[I].NCChanged; + end; +end; + +procedure TdxBarManager.SetTabOrder(Value: Integer); +begin + if Value < 0 then Value := 0; + if Value >= dxBarManagerList.Count then Value := dxBarManagerList.Count - 1; + dxBarManagerList.Move(dxBarManagerList.IndexOf(Self), Value); +end; + +procedure TdxBarManager.SetUseSystemFont(Value: Boolean); +begin + if FUseSystemFont <> Value then + begin + FUseSystemFont := Value; + if FUseSystemFont then + OwnerWndProc(0, WM_SETTINGCHANGE, SPI_SETNONCLIENTMETRICS, 0); + end; +end; + +procedure TdxBarManager.SetWaitForDockingTime(Value: Integer); +begin + if Value >= 0 then FWaitForDockingTime := Value; +end; + +function TdxBarManager.GetDisabledImages: TCustomImageList; +begin + Result := FImageOptions.DisabledImages; +end; + +function TdxBarManager.GetDisabledLargeImages: TCustomImageList; +begin + Result := FImageOptions.DisabledLargeImages; +end; + +function TdxBarManager.GetGlyphSize: Integer; +begin + Result := FImageOptions.FGlyphSize; +end; + +function TdxBarManager.GetHotImages: TCustomImageList; +begin + Result := FImageOptions.HotImages; +end; + +function TdxBarManager.GetImageListBkColor: TColor; +begin + Result := FImageOptions.FImageListBkColor; +end; + +function TdxBarManager.GetImages: TCustomImageList; +begin + Result := FImageOptions.Images; +end; + +function TdxBarManager.GetLargeImages: TCustomImageList; +begin + Result := FImageOptions.LargeImages; +end; + +function TdxBarManager.GetLargeIcons: Boolean; +begin + Result := FImageOptions.LargeIcons; +end; + +function TdxBarManager.GetMainMenuBar: TdxBar; +begin + Result := FMainMenuBar; + if (Result <> nil) and (Result.Control <> nil) and not Result.Control.IsMainMenu then + Result := nil; +end; + +function TdxBarManager.GetMakeDisabledImagesFaded: Boolean; +begin + Result := FImageOptions.MakeDisabledImagesFaded; +end; + +function TdxBarManager.GetStretchGlyphs: Boolean; +begin + Result := FImageOptions.StretchGlyphs; +end; + +function TdxBarManager.GetUseLargeImagesForLargeIcons: Boolean; +begin + Result := FImageOptions.UseLargeImagesForLargeIcons; +end; + +procedure TdxBarManager.SetDisabledImages(Value: TCustomImageList); +begin + FImageOptions.DisabledImages := Value; +end; + +procedure TdxBarManager.SetDisabledLargeImages(Value: TCustomImageList); +begin + FImageOptions.DisabledLargeImages := Value; +end; + +procedure TdxBarManager.SetGlyphSize(Value: Integer); +begin + FImageOptions.FGlyphSize := Value; +end; + +procedure TdxBarManager.SetHotImages(Value: TCustomImageList); +begin + FImageOptions.HotImages := Value; +end; + +procedure TdxBarManager.SetImageListBkColor(Value: TColor); +begin + FImageOptions.ImageListBkColor := Value; +end; + +procedure TdxBarManager.SetImages(Value: TCustomImageList); +begin + FImageOptions.Images := Value; +end; + +procedure TdxBarManager.SetLargeIcons(Value: Boolean); +begin + FImageOptions.LargeIcons := Value; +end; + +procedure TdxBarManager.SetLargeImages(Value: TCustomImageList); +begin + FImageOptions.LargeImages := Value; +end; + +procedure TdxBarManager.SetMakeDisabledImagesFaded(Value: Boolean); +begin + FImageOptions.MakeDisabledImagesFaded := Value; +end; + +procedure TdxBarManager.SetStretchGlyphs(Value: Boolean); +begin + FImageOptions.StretchGlyphs := Value; +end; + +procedure TdxBarManager.SetUseLargeImagesForLargeIcons(Value: Boolean); +begin + FImageOptions.UseLargeImagesForLargeIcons := Value; +end; + +procedure TdxBarManager.DisabledImageListChange(Sender: TObject); +begin + CustomImagesChanged(DisabledImagesChanged); +end; + +procedure TdxBarManager.DisabledLargeImageListChange(Sender: TObject); +begin + CustomImagesChanged(DisabledLargeImagesChanged); +end; + +procedure TdxBarManager.HotImageListChange(Sender: TObject); +begin + CustomImagesChanged(HotImagesChanged); +end; + +procedure TdxBarManager.ImageListChange(Sender: TObject); +begin + CustomImagesChanged(ImagesChanged); +end; + +procedure TdxBarManager.ImageOptionsChange(Sender: TObject); +begin + Bars.Repaint; +end; + +procedure TdxBarManager.LargeIconsChange; +begin + FImageOptions.CalcGlyphSize; + DesignerModified; + UpdateBarManagerOptions; + Bars.Repaint; +end; + +procedure TdxBarManager.LargeImageListChange(Sender: TObject); +begin + CustomImagesChanged(LargeImagesChanged); +end; + +function TdxBarManager.BarByNewName(const AName: string): TdxBar; +var + I: Integer; +begin + for I := 0 to FBars.Count - 1 do + begin + Result := FBars[I]; + if Result.Name = AName then Exit; + end; + Result := nil; +end; + +procedure TdxBarManager.FontChanged(Sender: TObject); + + procedure ProcessBars; + var + I: Integer; + begin + for I := 0 to Bars.Count - 1 do + with Bars[I] do + begin + FInternalFontChange := True; + try + if UseOwnFont then + FontChanged(nil) + else + Font := Self.Font; + finally + FInternalFontChange := False; + end; + end; + end; + + procedure ProcessPopupMenus; + var + I: Integer; + begin + for I := 0 to FPopupMenus.Count - 1 do + with TdxBarPopupMenu(FPopupMenus[I]) do + begin + FInternalFontChange := True; + try + if UseOwnFont then + FontChanged(nil) + else + Font := Self.Font; + finally + FInternalFontChange := False; + end; + end; + end; + + procedure ProcessSystemFontListeners; + begin + FSystemFontChangedHandlers.CallEvents(Self, []); + end; + +begin + if not FInternalFontChange then + FUseSystemFont := False; + if FScaled then + begin + Font.OnChange := nil; + try + AssignFont; + finally + Font.OnChange := FontChanged; + end; + end; + CreateEditFontHandle(Font, FEditFont, FScaled); + FBarCaptionFont.Handle := CreateToolbarCaptionFontHandle(Font, UseSystemFont); + ProcessSystemFontListeners; + ProcessBars; + ProcessPopupMenus; +end; + +{ TSystemMenuSubItem } + +type + TSystemMenuSubItem = class(TCustomdxBarSubItem) + private + FMDIChildHandle: HWND; + function GetIconHandle: HICON; + procedure ButtonClick(Sender: TObject); + protected + procedure BuildMenu; + procedure DirectClick; override; + public + property IconHandle: HICON read GetIconHandle; + property MDIChildHandle: HWND read FMDIChildHandle write FMDIChildHandle; + end; + +function TSystemMenuSubItem.GetIconHandle: HICON; +begin + Result := SendMessage(FMDIChildHandle, WM_GETICON, ICON_SMALL, 0); + if Result = 0 then + Result := SendMessage(FMDIChildHandle, WM_GETICON, ICON_BIG, 0); + Result := + CopyImage(Result, IMAGE_ICON, 16, 16, LR_COPYFROMRESOURCE); +end; + +procedure TSystemMenuSubItem.ButtonClick(Sender: TObject); +begin + with TdxBarItem(Sender) do + SendMessage(MDIChildHandle, WM_SYSCOMMAND, Tag, 0); +end; + +procedure TSystemMenuSubItem.BuildMenu; +const + SLength = 1024; + + procedure BuildSubMenu(SubItem: TCustomdxBarSubItem; Menu: HWND); + const + BitmapNames: array[HBMMENU_POPUP_CLOSE..HBMMENU_POPUP_MINIMIZE] of string = + ('DXBARCLOSE', 'DXBARRESTORE', 'DXBARMAXIMIZE', 'DXBARMINIMIZE'); + var + ABeginGroup: Boolean; + S: PChar; + I, P: Integer; + MI: TMenuItemInfo; + AShortCutText: string; + AItem: TdxBarItem; + begin + ABeginGroup := False; + GetMem(S, SLength); + try + for I := 0 to GetMenuItemCount(Menu) - 1 do + begin + with MI do + begin + if IsWin98Or2000 then + cbSize := SizeOf(MI) + else + begin + cbSize := 44; + MI.hbmpItem := 0; + end; + fMask := + MIIM_CHECKMARKS or MIIM_ID or MIIM_STATE or MIIM_SUBMENU or MIIM_TYPE; + dwTypeData := S; + cch := SLength; + end; + GetMenuItemInfo(Menu, I, True, MI); + + if MI.fType and MFT_SEPARATOR <> 0 then + begin + ABeginGroup := True; + Continue; + end; + + if MI.fType and MFT_BITMAP <> 0 then + GetMenuString(Menu, I, S, SLength, MF_BYPOSITION) + else + if MI.cch = 0 then StrCopy(S, ''); + P := Pos(#9, S); + if P = 0 then + AShortCutText := '' + else + begin + AShortCutText := Copy(S, P + 1, Length(S) - P); + StrLCopy(S, S, P - 1); + end; + + if MI.hSubMenu = 0 then + begin + AItem := TdxBarButton.Create(Owner); + if MI.fState and MFS_CHECKED <> 0 then + with TdxBarButton(AItem) do + begin + ButtonStyle := bsChecked; + Down := True; + end; + with AItem do + begin + Tag := MI.wID; + OnClick := ButtonClick; + end; + end + else + begin + AItem := TdxBarSubItem.Create(Owner); + BuildSubMenu(TCustomdxBarSubItem(AItem), MI.hSubMenu); + end; + BarDesignController.AddInternalItem(AItem); + with AItem do + begin + Caption := S; + Enabled := MI.fState and (MFS_DISABLED or MFS_GRAYED) = 0; + if MI.hbmpItem in [HBMMENU_POPUP_CLOSE..HBMMENU_POPUP_MINIMIZE] then + Glyph.Handle := LoadBitmap(HInstance, PChar(BitmapNames[MI.hbmpItem])) + else + begin + if MI.fState and MFS_CHECKED <> 0 then + if MI.hbmpChecked <> 0 then + Glyph.Handle := CopyImage(MI.hbmpChecked, IMAGE_BITMAP, 0, 0, 0) + else + else + if MI.hbmpUnchecked <> 0 then + Glyph.Handle := CopyImage(MI.hbmpUnchecked, IMAGE_BITMAP, 0, 0, 0); + if (Glyph.Handle = 0) and (MI.fType and MFT_BITMAP <> 0) then + Glyph.Handle := CopyImage(HBITMAP(MI.dwTypeData), IMAGE_BITMAP, 0, 0, 0); + end; + ShortCut := TextToShortCut(AShortCutText); + end; + + with SubItem.ItemLinks.Add do + begin + BeginGroup := ABeginGroup; + Item := AItem; + end; + ABeginGroup := False; + end; + finally + FreeMem(S); + end; + end; + +begin + BarDesignController.ClearInternalItems; + BuildSubMenu(Self, GetSystemMenu(FMDIChildHandle, False)); +end; + +procedure TSystemMenuSubItem.DirectClick; +begin + BuildMenu; + inherited; +end; + +{ TSystemMenuSubItemControl } + +type + TSystemMenuSubItemControl = class(TdxBarSubItemControl) + private + function GetItem: TSystemMenuSubItem; + protected + function CanCustomize: Boolean; override; + function CanSelect: Boolean; override; + procedure DblClick; override; + procedure DoPaint(ARect: TRect; PaintType: TdxBarPaintType); override; + function HasShadow: Boolean; override; + function GetDefaultHeight: Integer; override; + function GetDefaultWidth: Integer; override; + function IsExpandable: Boolean; override; + function WantsDblClick: Boolean; override; + public + property Item: TSystemMenuSubItem read GetItem; + end; + +function TSystemMenuSubItemControl.GetItem: TSystemMenuSubItem; +begin + Result := TSystemMenuSubItem(ItemLink.Item); +end; + +function TSystemMenuSubItemControl.CanCustomize: Boolean; +begin + Result := False; +end; + +function TSystemMenuSubItemControl.CanSelect: Boolean; +begin + Result := not BarManager.IsCustomizing; +end; + +procedure TSystemMenuSubItemControl.DblClick; +begin + inherited; + Parent.HideAll; + with Item do + SendMessage(FMDIChildHandle, WM_SYSCOMMAND, + GetMenuDefaultItem(GetSystemMenu(FMDIChildHandle, False), 0, 0), 0); +end; + +procedure TSystemMenuSubItemControl.DoPaint(ARect: TRect; PaintType: TdxBarPaintType); +var + Icon: HIcon; +begin + Icon := Item.IconHandle; + with ARect do + begin + Parent.FillBackground(Canvas.Handle, ARect, Parent.BkBrush, clNone, True); + DrawIconEx(Canvas.Handle, Left, Top, Icon, + Right - Left, Bottom - Top, 0, 0{Parent.BkBrush}, DI_NORMAL); + end; + DestroyIcon(Icon); +end; + +function TSystemMenuSubItemControl.HasShadow: Boolean; +begin + Result := False; +end; + +function TSystemMenuSubItemControl.GetdefaultHeight: Integer; +begin + Result := GetSystemMetrics(SM_CYSMICON); +end; + +function TSystemMenuSubItemControl.GetDefaultWidth: Integer; +begin + Result := GetSystemMetrics(SM_CXSMICON); +end; + +function TSystemMenuSubItemControl.IsExpandable: Boolean; +begin + Result := False; +end; + +function TSystemMenuSubItemControl.WantsDblClick: Boolean; +begin + Result := True; +end; + +{ continuation } + +function TdxBarManager.ActiveMDIChild: HWND; +begin + if (Application.MainForm <> nil) and (Application.MainForm.ClientHandle <> 0) then + Result := SendMessage(Application.MainForm.ClientHandle, WM_MDIGETACTIVE, 0, 0) + else + Result := 0; +end; + +procedure TdxBarManager.CreateMDIChildSystemMenu(AWnd: HWND); +var + ASystemMenuSubItem: TSystemMenuSubItem; +begin + if GetSystemMenu(AWnd, False) = 0 then Exit; + ASystemMenuSubItem := TSystemMenuSubItem.Create(Owner);//#DG + BarDesignController.AddInternalItem(ASystemMenuSubItem, FInternalItems); + ASystemMenuSubItem.MDIChildHandle := AWnd; + with MainMenuBar.ItemLinks.Add do + begin + Item := ASystemMenuSubItem; + Index := 0; + end; +end; + +procedure TdxBarManager.DestroyMDIChildSystemMenu; +begin + FInternalItems.Clear; +end; + +function TdxBarManager.IsMDIChildSystemMenuExist: Boolean; +begin + Result := FInternalItems.Count <> 0; // TODO +end; + +procedure TdxBarManager.MDIStateChanged(AChange: TdxBarMDIStateChange; AWnd: HWND); +type + TMergeOperation = (moNone, moMerge, moUnmerge); +var + ANeedsUnlockUpdate: Boolean; + + procedure CheckIsUpdateLocked; + begin + if not IsUpdateLocked then + begin + BeginUpdate; + ANeedsUnlockUpdate := True; + end; + end; + + procedure UpdateSystemMenu; + begin + if MainMenuBar <> nil then + if (AChange <> scChildDeactivated) and IsMDIMaximized then + begin + CheckIsUpdateLocked; + CreateMDIChildSystemMenu(AWnd); + end + else + if ((AChange = scChildDeactivated) or (AChange = scMaximizedChanged) and not IsMDIMaximized) and + IsMDIChildSystemMenuExist then + begin + CheckIsUpdateLocked; + DestroyMDIChildSystemMenu; + end; + end; + + function GetMergeOperation: TMergeOperation; + begin + Result := moNone; + if not ((AChange = scMaximizedChanged) and FAlwaysMerge) then + if (AChange <> scChildDeactivated) and (FAlwaysMerge or IsMDIMaximized) then + Result := moMerge + else + if (AChange = scChildDeactivated) or (AChange = scMaximizedChanged) and not IsMDIMaximized then + Result := moUnmerge; + end; + + procedure DoMenuMerging; + var + ABar: TdxBar; + ABarManager: TdxBarManager; + AMergedBarList: TList; + I: Integer; + begin + ABarManager := GetBarManagerByHandle(AWnd); + if (MainMenuBar = nil) or (ABarManager = nil) or (ABarManager.MainMenuBar = nil) then + Exit; + + CheckIsUpdateLocked; + + case GetMergeOperation of + moMerge: + if Assigned(FOnMenuMerge) then + begin + FOnMenuMerge(Self, ABarManager, True); + if ABarManager.MainMenuBar.MergeData.MergedWith = nil then + begin + ABarManager.MainMenuBar.MergeData.MergedWith := MainMenuBar; + MainMenuBar.MergeData.MergedBarList.Add(ABarManager.MainMenuBar); + ABarManager.MainMenuBar.MergeData.VisibleBeforeMerging := ABarManager.MainMenuBar.Visible; + end; + ABarManager.MainMenuBar.SetVisibility(False); + end + else + MainMenuBar.Merge(ABarManager.MainMenuBar); + moUnmerge: + begin + AMergedBarList := TList.Create; + try + MainMenuBar.MergeData.SaveMergedBarList(AMergedBarList); + MainMenuBar.InternalUnmergeFromBar(nil, False); + if Assigned(FOnMenuMerge) then + FOnMenuMerge(Self, ABarManager, False); + for I := 0 to AMergedBarList.Count - 1 do + begin + ABar := TdxBar(AMergedBarList[I]); + ABar.SetVisibility(ABar.MergeData.VisibleBeforeMerging); + end; + finally + AMergedBarList.Free; + end; + end; + end; + end; + + procedure DoMerging; + var + ABarManager: TdxBarManager; + begin + if Assigned(FOnMerge) then + begin + ABarManager := GetBarManagerByHandle(AWnd); + if (ABarManager <> nil) and (GetMergeOperation <> moNone) then + begin + CheckIsUpdateLocked; + FOnMerge(Self, ABarManager, GetMergeOperation = moMerge); + end; + end; + end; + +var + AEventData: TdxBarMDIStateChangeEventData; +begin + ANeedsUnlockUpdate := False; + try + UpdateSystemMenu; + DoMenuMerging; + DoMerging; + finally + if ANeedsUnlockUpdate then + EndUpdate; + end; + AEventData.Change := AChange; + AEventData.Wnd := AWnd; + FMDIStateChangedHandlers.CallEvents(Self, AEventData); +end; + +procedure TdxBarManager.CheckToolbarsVisibility; +var + WorkArea, R: TRect; + I: Integer; +begin + WorkArea := GetWorkArea(Point(Owner.Left + Owner.Width div 2, Owner.Top + Owner.Height div 2));//#DG + for I := 0 to FBars.Count - 1 do + with FBars[I] do + if DockingStyle = dsNone then + begin + if Control = nil then + R := Bounds(FloatLeft, FloatTop, + BarNCSizeX(dsNone) + FloatClientWidth, BarNCSizeY(dsNone) + FloatClientHeight) + else + R := Control.BoundsRect; + with WorkArea do + begin + if R.Bottom > Bottom then OffsetRect(R, 0, Bottom - R.Bottom); + if R.Top < Top then OffsetRect(R, 0, Top - R.Top); + if R.Right > Right then OffsetRect(R, Right - R.Right, 0); + if R.Left < Left then OffsetRect(R, Left - R.Left, 0); + end; + if Control = nil then + begin + LockDesignerModified(True); + try + FloatLeft := R.Left; + FloatTop := R.Top; + finally + LockDesignerModified(False); + end; + end + else + Control.BoundsRect := R; + end; +end; + +class function TdxBarManager.IsFormBroadcastMessage(AMsg: UINT): Boolean; +begin + Result := (AMsg = WM_ACTIVATE) or (AMsg = WM_ACTIVATEAPP) or + (AMsg = WM_CHILDACTIVATE) or (AMsg = WM_MDIACTIVATE) or + (AMsg = WM_SETTINGCHANGE) or (AMsg = WM_SYSCOLORCHANGE) or + (AMsg = WM_SYSCOMMAND) or (AMsg = WM_WINDOWPOSCHANGED) or + (AMsg = WM_WINDOWPOSCHANGING); +end; + +procedure TdxBarManager.MainFormClientWndProc(Msg: UINT; wParam: WPARAM; lParam: LPARAM); +var + APrevIsMDIMaximized: Boolean; +begin + APrevIsMDIMaximized := IsMDIMaximized; + FIsMDIMaximized := (ActiveMDIChild <> 0) and IsZoomed(ActiveMDIChild); + + if ActiveMDIChild <> FPrevActiveMDIChild then + begin + MDIStateChanged(scChildDeactivated, FPrevActiveMDIChild); + MDIStateChanged(scChildActivated, ActiveMDIChild); + end + else + if IsMDIMaximized <> APrevIsMDIMaximized then + MDIStateChanged(scMaximizedChanged, ActiveMDIChild); + + if (IsMDIMaximized <> APrevIsMDIMaximized) and (MainMenuControl <> nil) then + MainMenuControl.RepaintBar; + FPrevActiveMDIChild := ActiveMDIChild; +end; + +procedure TdxBarManager.OwnerWndProc(AWnd: HWND; AMsg: UINT; wParam: WPARAM; + lParam: LPARAM); + + procedure HandleFormBroadcastMessage; + var + ABar: TdxBar; + I: Integer; + begin + case AMsg of + WM_ACTIVATE: + DoActivate(LOWORD(wParam), HiWord(wParam), AWnd, lParam); + WM_ACTIVATEAPP: + DoActivateApp(Bool(wParam), lParam); + WM_CHILDACTIVATE: + ActivateFloatToolbars(True, False, 0); + WM_MDIACTIVATE: + ActivateFloatToolbars(HWND(lParam) = AWnd, False, 0); + WM_SETTINGCHANGE: + case wParam of + SPI_SETNONCLIENTMETRICS: AssignFont; + SPI_SETWORKAREA: CheckToolbarsVisibility; + end; + WM_SYSCOLORCHANGE: + begin + RefreshDeviceConsts; + CreatePatternBrush; + RecreateToolbarsBrushes; + RefreshFloatingBarsShadows; + end; + WM_SYSCOMMAND: + begin + if (wParam = SC_CLOSE) and Designing and (ActiveBarControl <> nil) and + (ActiveBarManager = Self) then + ActiveBarControl.HideAll; + if (wParam = SC_MINIMIZE) or (wParam = SC_MAXIMIZE) or + (wParam = SC_RESTORE) or (wParam = SC_CLOSE) then + begin + for I := 0 to Bars.Count - 1 do + begin + ABar := Bars[I]; + if ABar.Visible and (ABar.Control <> nil) and (ABar.DockingStyle = dsNone) then + if (wParam = SC_MINIMIZE) or (wParam = SC_CLOSE) then + ShowWindow(ABar.Control.Handle, SW_HIDE) + else + begin + ShowWindow(ABar.Control.Handle, SW_SHOWNOACTIVATE); + UpdateWindow(ABar.Control.Handle); + end; + end; + //if IsWindowVisible(MainForm.Handle) then ProcessPaintMessages; + end; + end; + WM_WINDOWPOSCHANGING: + if PWindowPos(lParam).flags and SWP_HIDEWINDOW <> 0 then + ActivateFloatToolbars(False, True, 0); + WM_WINDOWPOSCHANGED: + begin + if FIsCustomizing and (dxBarCustomizingForm <> nil) then + begin + dxBarCustomizingForm.UpdateVisibility(PWindowPos(lParam)^); + if dxBarSubMenuEditor <> nil then + if PWindowPos(lParam).flags and SWP_SHOWWINDOW <> 0 then + ShowWindow(dxBarSubMenuEditor.Handle, SW_SHOWNA) + else + if PWindowPos(lParam).flags and SWP_HIDEWINDOW <> 0 then + ShowWindow(dxBarSubMenuEditor.Handle, SW_HIDE); + end; + if PWindowPos(lParam).flags and SWP_SHOWWINDOW <> 0 then + ActivateFloatToolbars(True, False, 0); + end; + end; + end; + + procedure HandleOwnerMessage; + var + AContextID: Integer; + AControl: TWinControl; + AItem: TdxBarItemControl; + P: TPoint; + begin + case AMsg of + WM_CANCELMODE: + DoModalActivate; + WM_CREATE: + DoCreate; + WM_DISPLAYCHANGE: + CheckToolbarsVisibility; + WM_HELP: + if not Designing and (PHelpInfo(lParam).iContextType = HELPINFO_WINDOW) then + with PHelpInfo(lParam)^ do + begin + AItem := nil; + if ActiveBarControl <> nil then + begin + AControl := ActiveBarControl; + AItem := TCustomdxBarControl(AControl).SelectedControl; + if (AItem = nil) or (AItem.Item.HelpContext = 0) then + begin + while TCustomdxBarControl(AControl).ParentBar <> nil do + begin + AItem := TdxBarSubMenuControl(AControl).FSubItem; + AControl := TCustomdxBarControl(AControl).ParentBar; + if (AItem = nil) or (AItem.Item.HelpContext <> 0) then Break; + end; + if (AItem = nil) or (AItem.Item.HelpContext = 0) then + begin + HideAll; + AContextID := AControl.HelpContext; + if AContextID <> 0 then + if biHelp in TCustomFormAccess(GetBarManagerForm(Self, fkAny)).BorderIcons then + Application.HelpCommand(HELP_CONTEXTPOPUP, AContextID) + else + Application.HelpContext(AContextID); + Exit; + end; + end; + end + else + begin + AControl := FindControl(hItemHandle); + if AControl is TCustomdxBarControl then + begin + P := MousePos; + ScreenToClient(AControl.Handle, P); + AItem := TCustomdxBarControl(AControl).ItemAtPos(P); + end; + end; + if AItem <> nil then + begin + with AItem.ItemBounds do P := Point((Left + Right) div 2, Bottom); + ClientToScreen(AControl.Handle, P); + AContextID := AItem.Item.HelpContext; + HideAll; + if AContextID = 0 then Exit; + if biHelp in TCustomFormAccess(GetBarManagerForm(Self, fkAny)).BorderIcons then + begin + Application.HelpCommand(HELP_SETPOPUP_POS, Longint(PointToSmallPoint(P))); + Application.HelpCommand(HELP_CONTEXTPOPUP, AContextID); + end + else + Application.HelpContext(AContextID); + end; + end; + end; + end; + +begin + if (csDestroying in Owner.ComponentState) or (Owner = dxBarCustomizingForm) then + begin + if (AMsg = WM_DESTROY) and not Designing then + begin + if StoreInRegistry then + SaveToRegistry(RegistryPath); + if StoreInIniFile then + SaveToIniFile(IniFileName); + end; + Exit; + end; + + if Bars = nil then + Exit; + + if IsFormBroadcastMessage(AMsg) then + HandleFormBroadcastMessage + else + HandleOwnerMessage; + {WM_NCACTIVATE: - does not allow submenu.edit.setfocus + if TCustomFormAccess(MainForm).FormStyle = fsMDIChild then + ActivateToolbars(Boolean(wParam), False, 0);} +end; + +class procedure TdxBarManager.SendFormBroadcastMessage( + AOwnerHandle: HWND; AMsg: UINT; wParam: WPARAM; lParam: LPARAM); +var + ABarManager: TdxBarManager; + I: Integer; +begin + if IsFormBroadcastMessage(AMsg) then + for I := 0 to dxBarManagerList.Count - 1 do + begin + ABarManager := dxBarManagerList[I]; + if ABarManager.Owner.HandleAllocated and (ABarManager.Owner.Handle <> AOwnerHandle) and + IsBarManagerOwner(ABarManager, AOwnerHandle) then + ABarManager.OwnerWndProc(AOwnerHandle, AMsg, wParam, lParam); + end; +end; + +var + HintTimerABarManager: TdxBarManager; + +procedure ShowHintTimerProc(Wnd: HWnd; Msg, TimerID, SysTime: Longint); stdcall; +begin + if (HintTimerABarManager <> nil) and + not HintTimerABarManager.IsDestroying then + with HintTimerABarManager do + begin + KillHintTimer; + DisplayHint; + end; +end; + +procedure HideHintTimerProc(Wnd: HWnd; Msg, TimerID, SysTime: Longint); stdcall; +begin + if (HintTimerABarManager <> nil) and + not HintTimerABarManager.IsDestroying then + with HintTimerABarManager do + begin + KillHintTimer; + HideHint; + end; +end; + +procedure KillHiddenHintTimerProc(Wnd: HWnd; Msg, TimerID, SysTime: Longint); stdcall; +begin + KillHiddenHintTimer; +end; + +procedure TdxBarManager.DisplayHint; + + function ActivateHintWindow(const AHintText: string; AShortCut: string = ''): Boolean; + begin + Result := FHintWindow.ActivateHint(Self, AHintText, AShortCut); + if Result then + begin + FHintWindowShowing := True; + HintTimerABarManager := Self; + FHintTimerID := SetTimer(0, 0, FHintWindow.HideHintTime, @HideHintTimerProc); + end; + end; + +var + AHintKeeper: IdxBarHintKeeper; + ANeedDeactivate: Boolean; + AHintText, AShortCut: string; +begin + ANeedDeactivate := True; + if FCustomHint <> '' then + ANeedDeactivate := not ActivateHintWindow(FCustomHint) + else + if Supports(FHintObject, IdxBarHintKeeper, AHintKeeper) then + if AHintKeeper.DoHint(ANeedDeactivate, AHintText, AShortCut) then + begin + if AHintKeeper.GetEnabled or ShowHintForDisabledItems then + begin + if not ShowShortCutInHint and not Application.HintShortCuts then + AShortCut := ''; + ANeedDeactivate := not ActivateHintWindow(AHintText, AShortCut); + end + else + ANeedDeactivate := True; + end; + if ANeedDeactivate then + HideHint; +end; + +var + FHintTimerPrevShow: Boolean; //*** + +procedure TdxBarManager.DoActivateHint(AShow: Boolean; const CustomHint: string; AHintObject: TObject); +var + PrevShow: Boolean; +begin + if not AShow and not FHintTimerPrevShow{***} then Exit; + FHintTimerPrevShow := AShow; //*** + FCustomHint := CustomHint; + FHintWindowShowing := False; + PrevShow := AShow; +//#DG + AShow := AShow and + ((SelectedItem <> nil) and not SelectedItem.Parent.IsActive or (FCustomHint <> '') or (AHintObject <> nil)); + KillHintTimer; + FHintObject := AHintObject; + if AShow then + begin + if not IsControlVisible(FHintWindow) and not FLiveHiddenHint then + begin + HintTimerABarManager := Self; + FHintTimerID := SetTimer(0, 0, FHintWindow.ShowHintTime, @ShowHintTimerProc); + end + else + DisplayHint; + end + else + begin + if IsControlVisible(FHintWindow) then + begin + ShowWindow(FHintWindow.Handle, SW_HIDE); + if PrevShow then + begin + KillHiddenHintTimer; + FLiveHiddenHint := True; + FHiddenHintTimerID := SetTimer(0, 0, dxBarHiddedHintLifeTime, @KillHiddenHintTimerProc); + end; + end; + end; +end; + +procedure TdxBarManager.DestroyItems; +begin + FreeAndNil(FInternalItems); + FItems.OwnsObjects := True; + FreeAndNil(FItems); +end; + +procedure TdxBarManager.HelpButtonGlyphChanged(Sender: TObject); +begin + UpdateHelpButton; +end; + +procedure TdxBarManager.CalcMostRecentlyUsedUseCount; +var + I: Integer; +begin + if FMostRecentItemsPercents = 100 then FMostRecentlyUsedUseCount := 0 + else + for I := 1 to MaxInt do + if I * (100 - FMostRecentItemsPercents) div 100 > 0 then + begin + FMostRecentlyUsedUseCount := I; + Break; + end; +end; + +function TdxBarManager.ShowRecentItemsFirst: Boolean; +begin + Result := CanShowRecentItems and MenusShowRecentItemsFirst; +end; + +procedure TdxBarManager.AddDockControl(ADockControl: TdxDockControl); +begin + FDockControls.Add(ADockControl); + FreeNotification(ADockControl); +end; + +procedure TdxBarManager.RemoveDockControl(ADockControl: TdxDockControl); +var + I: Integer; +begin + if FBars <> nil then + for I := 0 to FBars.Count - 1 do + with FBars[I] do + begin + if DockControl = ADockControl then DockControl := nil; + if DockedDockControl = ADockControl then DockedDockControl := nil; + if RealDockControl = ADockControl then Visible := False; + end; + if FDockControls <> nil then FDockControls.Remove(ADockControl); + if ADockControl.Main and (FBars <> nil) then + FBars.FDockControls[ADockControl.FDockingStyle] := nil; + ADockControl.ParentColor := True; +end; + +procedure TdxBarManager.AddGroup(AGroup: TdxBarGroup); +begin + FGroups.Add(AGroup); + AGroup.FBarManager := Self; +end; + +{#DG +procedure TdxBarManager.RemoveGroup(AGroup: TdxBarGroup); +begin + FGroups.Remove(AGroup); +end; +} + +function TdxBarManager.CorrectRegistryPath(var APath: string): Boolean; +begin + Result := APath <> ''; + if Result then + begin + if APath[1] <> '\' then + APath := '\' + APath; + if APath[Length(APath)] <> '\' then + APath := APath + '\'; + end; +end; + +function TdxBarManager.GetSavedBarIndex(const ABarCaption: string): Integer; +var + ABarCount, I: Integer; +begin + Result := -1; + ABarCount := SavedState.ReadInteger( + GetBarManagerSection(GetBaseIniSection, skIni), 'BarCount', 0); + for I := 0 to ABarCount - 1 do + if SavedState.ReadString(TdxBar.GetIniSection(GetBaseIniSection, I), 'Caption', '') = ABarCaption then + begin + Result := I; + Break; + end; +end; + +function TdxBarManager.IsDockColorStored: Boolean; +begin + Result := not FAutoDockColor; +end; + +procedure TdxBarManager.LoadLinkItemNames; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + if Items[I].GetItemLinks <> nil then + Items[I].GetItemLinks.LoadItemNames; + for I := 0 to Bars.Count - 1 do + Bars[I].ItemLinks.LoadItemNames; +end; + +procedure TdxBarManager.ReadBars(AReader: TReader); +var + AItem: TdxBar; + I: Integer; +begin + AReader.ReadValue; + I := 0; + while not AReader.EndOfList do + begin + if AReader.NextValue in [vaInt8, vaInt16, vaInt32] then + AReader.ReadInteger; + if I < Bars.Count then + AItem := Bars[I] + else + AItem := Bars.Add; + Inc(I); + AItem.FIsNameLocked := True; + try + AReader.ReadListBegin; + while not AReader.EndOfList do + TReaderAccess(AReader).ReadProperty(AItem); + AReader.ReadListEnd; + finally + AItem.FIsNameLocked := False; + end; + end; + AReader.ReadListEnd; +end; + +procedure TdxBarManager.ReadDockControlHeights(Reader: TReader); +begin + with Reader, FBars do + begin + ReadListBegin; + try + FDockControls[dsLeft].Width := ReadInteger; + FDockControls[dsRight].Width := ReadInteger; + FDockControls[dsTop].Height := ReadInteger; + FDockControls[dsBottom].Height := ReadInteger; + finally + ReadListEnd; + end; + end; +end; + +procedure TdxBarManager.SaveState; +begin + if SavedState <> nil then + begin + Include(FInternalState, bisStateSaving); + try + SaveBarManager(SavedState, GetBaseIniSection, skIni); + finally + Exclude(FInternalState, bisStateSaving); + end; + end; +end; + +procedure TdxBarManager.WriteDockControlHeights(Writer: TWriter); +begin + with Writer, FBars do + begin + WriteListBegin; + try + WriteInteger(FDockControls[dsLeft].Width); + WriteInteger(FDockControls[dsRight].Width); + WriteInteger(FDockControls[dsTop].Height); + WriteInteger(FDockControls[dsBottom].Height); + finally + WriteListEnd; + end; + end; +end; + +procedure TdxBarManager.CreateFlatToolbarsBrushes; +begin + DestroyFlatToolbarsBrushes; + FFlatToolbarsBorderBrush := CreateSolidBrush(FlatToolbarsBorderColor); + FFlatToolbarsBrush := CreateSolidBrush(FlatToolbarsColor); + FFlatToolbarsDownedBrush := CreateSolidBrush(FlatToolbarsDownedColor); + FFlatToolbarsDownedSelBrush := CreateSolidBrush(FlatToolbarsDownedSelColor); + FFlatToolbarsSelBrush := CreateSolidBrush(FlatToolbarsSelColor); +end; + +procedure TdxBarManager.DestroyFlatToolbarsBrushes; +begin + DeleteGDIObject(FFlatToolbarsSelBrush); + DeleteGDIObject(FFlatToolbarsDownedSelBrush); + DeleteGDIObject(FFlatToolbarsDownedBrush); + DeleteGDIObject(FFlatToolbarsBrush); + DeleteGDIObject(FFlatToolbarsBorderBrush); +end; + +procedure TdxBarManager.CreateThemeToolbarsBrushes; +begin + DestroyThemeToolbarsBrushes; + if FThemeAvailable then + begin + FThemeToolbarsBrush := CreateSolidBrush(ThemeToolbarColor); +// FThemeToolbarsDownedBrush := CreateSolidBrush(); +// FThemeToolbarsDownedSelBrush := CreateSolidBrush(); +// FThemeToolbarsSelBrush := CreateSolidBrush(); + end; +end; + +procedure TdxBarManager.DestroyThemeToolbarsBrushes; +begin +// if FThemeToolbarsSelBrush <> 0 then DeleteObject(FThemeToolbarsSelBrush); +// if FThemeToolbarsDownedSelBrush <> 0 then DeleteObject(FThemeToolbarsDownedSelBrush); +// if FThemeToolbarsDownedBrush <> 0 then DeleteObject(FThemeToolbarsDownedBrush); + DeleteGDIObject(FThemeToolbarsBrush); +end; + +procedure TdxBarManager.DestroyToolbarsBrushes; +begin + DestroyThemeToolbarsBrushes; + DestroyFlatToolbarsBrushes; + ReleaseOffice11Colors; +end; + +procedure TdxBarManager.CreateToolbarsBrushes; +begin + CreateFlatToolbarsBrushes; + CreateThemeToolbarsBrushes; + CreateOffice11Colors; + ResetBackgrounds; +end; + +procedure TdxBarManager.RecreateToolbarsBrushes; +begin + CreateFlatToolbarsBrushes; + CreateThemeToolbarsBrushes; + RefreshOffice11Colors; + ResetBackgrounds; +end; + +procedure TdxBarManager.RefreshFloatingBarsShadows; +var + I: Integer; +begin + for I := 0 to Bars.Count - 1 do + if (Bars[I].DockingStyle = dsNone) and (Bars[I].Control <> nil) then + Bars[I].Control.RefreshShadow; +end; + +procedure TdxBarManager.ResetBackgrounds; +var + I: Integer; +begin + for I := 0 to DockControlCount - 1 do + begin +// DockControls[I].ResetBackground; + DockControls[I].BarManagerChanged; + DockControls[I].UpdateDoubleBuffered; + DockControls[I].Invalidate; + end; + for I := 0 to Bars.Count - 1 do + if Bars[I].Control <> nil then + begin + Bars[I].Control.ResetBackground; + Bars[I].Control.UpdateDoubleBuffered; + Bars[I].Control.FullInvalidate; + end; +end; + +procedure TdxBarManager.InitPainter; +begin + FThemeAvailable := AreVisualStylesAvailable([totToolBar, totComboBox, totEdit, + totWindow, totScrollBar, totRebar, totStatus, totSpin, totProgress]); + FreeAndNil(FDefaultPainter); + FDefaultPainter := GetPainterClass.Create(Integer(LookAndFeel.SkinPainter)); +end; + +procedure TdxBarManager.InternalStyleChanged; +var + I: Integer; +begin + FChangingStyle := True; + try + InitPainter; + if Bars <> nil then + begin + for I := 0 to Bars.Count - 1 do + if Bars[I].Control <> nil then + Bars[I].Control.BarManagerStyleChanged; + HostBarManagerStyleChanged; + ResetBackgrounds; + end; + finally + FChangingStyle := False; + end; +end; + +procedure TdxBarManager.ThemeChanged; +begin + InternalStyleChanged; +end; + +procedure TdxBarManager.LFChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); +begin + if not IsDestroying then + InternalStyleChanged; +end; + +procedure TdxBarManager.DoActivate(AState, AMinimized: WORD; AHandle, AWndPrevious: HWND); +var + AControl: TWinControl; + AMainForm: TCustomForm; + ANeedActivate: Boolean; +begin + Include(FInternalState, bisFormActivating); + try + AMainForm := GetBarManagerForm(Self, fkMainOrMDIChild); + if IsMDIChild(AMainForm) and (Application.MainForm.ActiveMDIChild <> AMainForm) then + Exit; + AMainForm := GetMainForm; + AControl := FindControl(AWndPrevious); + + if (AState = WA_INACTIVE) and (AControl is TCustomdxBarControl) and + (TCustomdxBarControl(AControl).BarManager.GetMainForm = AMainForm) then + Exit; + if {(AState = WA_INACTIVE) and }(ActiveBarControl <> nil) and + (ActiveBarControl.SelectedControl <> nil) and + ActiveBarControl.SelectedControl.IsChildWindow(AWndPrevious) then + Exit; + + ANeedActivate := MainFormActive and not (IsWindowEnabled(AMainForm.Handle) or Designing) or + (AState <> WA_INACTIVE) or (AMainForm.Handle = AWndPrevious); + ActivateFloatToolbars(ANeedActivate, False, AWndPrevious); + + if not (bisToolbarsVisibleChanging in FInternalState) and (AState <> WA_INACTIVE) and //ANeedActivate and + (dxBarCustomizingForm <> nil) and FIsCustomizing and not IsWindowEnabled(AMainForm.Handle) + and not IsChildEx(dxBarCustomizingForm.Handle, AHandle) then + SendMessage(dxBarCustomizingForm.Handle, WM_ACTIVATE, MakeWParam(AState, AMinimized), AMainForm.Handle); + + if (AState = WA_INACTIVE) and (AMainForm.Handle <> AWndPrevious) and (FMouseTrackingBarControl <> nil) then + FMouseTrackingBarControl.MouseLeave; + finally + Exclude(FInternalState, bisFormActivating); + end; +end; + +procedure TdxBarManager.DoActivateApp(AActivate: Boolean; AThreadID: DWORD); +begin + if bisModalActivating in FInternalState then + Exit; + if not AActivate then + begin + if MainFormActive and not IsWindowEnabled(GetMainForm.Handle) then + Include(FInternalState, bisWasActive); + ActivateFloatToolbars(False, False, 0); + if (ActiveBarControl <> nil) and (ActiveBarControl.BarManager = Self) then + ActiveBarControl.HideAll; //SC-Q93427 + //#DG + if SelectedItem <> nil then + SendMessage(SelectedItem.Parent.Handle, WM_MOUSELEAVE, 0, 0); +//#DG SelectedItem := nil; + end + else {TODO} + if bisWasActive in FInternalState then + begin + ActivateFloatToolbars(True, False, 0); + Exclude(FInternalState, bisWasActive); + end; +end; + +procedure TdxBarManager.DoCreate; +var + I: Integer; +begin + if BarRestoringListExists then + begin + Include(FInternalState, bisHandleCreating); + try + for I := 0 to DockControlCount - 1 do + if CanAllocateHandle(DockControls[I]) then // for BarDockControl + DockControls[I].HandleNeeded; + ShowBarsFromRestoringList(nil); + finally + if RestoringListBarCount = 0 then // for BarDockControl + DestroyBarRestoringList; + Exclude(FInternalState, bisHandleCreating); + end; + end; +end; + +procedure TdxBarManager.DoModalActivate; +begin + Include(FInternalState, bisModalActivating); + try + if not IsInternalWindowsDisabling and + (ActiveBarControl <> nil) and (ActiveBarControl.BarManager = Self){SC-S90738} and ActiveBarControl.HideOnClick then + ActiveBarControl.HideAll; + finally + Exclude(FInternalState, bisModalActivating); + end; +end; + +procedure TdxBarManager.DoLockUpdate(ALock: Boolean; + ACheckBarsChanges: Boolean); + + function IsBarHasChanges(ABar: TdxBar): Boolean; + begin + Result := (ABar.DockingStyle = dsNone) or ACheckBarsChanges and ABar.FChanged; + end; + +var + ABar: TdxBar; + ADockControl: TdxDockControl; + I, J: Integer; +begin + try + for I := 0 to DockControlCount - 1 do + if DockControls[I].Visible and DockControls[I].HandleAllocated then + SendMessage(DockControls[I].Handle, WM_SETREDRAW, WPARAM(not ALock), 0); + + if not ALock then + begin + if FChangedSubMenuControl <> nil then + begin + FChangedSubMenuControl.RepaintBar; + FChangedSubMenuControl := nil; + end; + + for I := 0 to Bars.Count - 1 do + begin + ABar := Bars[I]; + if (ABar.Control <> nil) and IsBarHasChanges(ABar) then + ABar.Control.RecreateControls; + end; + + for I := 0 to Bars.Count - 1 do + begin + ABar := Bars[I]; + if (ABar.Control <> nil) and IsBarHasChanges(ABar) then + ABar.Control.RepaintBarEx(False) + end; + + for I := 0 to DockControlCount - 1 do + begin + ADockControl := DockControls[I]; + for J := ADockControl.RowCount - 1 downto 0 do + if TdxDockRow(ADockControl.RowList[J]).FBars.Count = 0 then + begin + TdxDockRow(ADockControl.RowList[J]).Free; + ADockControl.RowList.Delete(J); + end; + if ADockControl.Visible and ADockControl.HandleAllocated then + begin + ADockControl.UpdateDock; + SendMessage(ADockControl.Handle, WM_NCPAINT, 0, 0); + end; + end; + + for I := 0 to Bars.Count - 1 do + begin + ABar := Bars[I]; + if (ABar.Control <> nil) and not IsBarHasChanges(ABar) then + begin + ABar.Control.FrameChanged; + ABar.Control.Repaint; + end; + end; + end; + finally + for I := 0 to Bars.Count - 1 do + Bars[I].FChanged := False; + end; +end; + +function TdxBarManager.GetItemLinkWithAccel(AKey: Word; + AShift: TShiftState): TdxBarItemLink; + + function GlobalFindItemWithAccel(ABarManager: TdxBarManager): TdxBarItemLink; + var + ABar: TdxBar; + I: Integer; + begin + if ABarManager.MainMenuControl <> nil then + Result := ABarManager.MainMenuBar.ItemLinks.FindItemWithAccel(AKey, AShift, nil) + else + Result := nil; + if Result = nil then + for I := 0 to ABarManager.Bars.Count - 1 do + begin + ABar := ABarManager.Bars[I]; + if ABar.Visible and (ABar <> ABarManager.MainMenuBar) then + begin + Result := ABar.ItemLinks.FindItemWithAccel(AKey, AShift, nil); + if Result <> nil then Break; + end; + end; + end; + +var + ATempBarManager: TdxBarManager; + AWnd: HWND; +begin + Result := nil; + AWnd := Owner.Handle; + repeat + ATempBarManager := GetBarManagerByHandle(AWnd); + if ATempBarManager <> nil then + Result := GlobalFindItemWithAccel(ATempBarManager); + if not IsChildClassWindow(AWnd) then + Break; + AWnd := GetParent(AWnd); + until Result <> nil; + + if Result = nil then + begin + ATempBarManager := Self; + repeat + ATempBarManager := dxBarManagerList.NextActive(ATempBarManager, True); + if ATempBarManager = Self then + Break; + Result := GlobalFindItemWithAccel(ATempBarManager); + until Result <> nil; + end; +end; + +function TdxBarManager.HandleShortCut(AShortCut: TShortCut): Boolean; + + function IsBarManagerShortCut(ABarManager: TdxBarManager; + AShortCut: TShortCut): Boolean; + var + ABar: TdxBar; + I: Integer; + begin + Result := (ABarManager.MainMenuBar <> nil) and + (ABarManager.MainMenuBar.IsShortCut(AShortCut)); + if not Result then + for I := 0 to ABarManager.Bars.Count - 1 do + begin + ABar := ABarManager.Bars[I]; + if ABar.Visible and (ABar <> ABarManager.MainMenuBar) and + (ABar.Control <> nil) and ABar.Control.CanProcessShortCut then + begin + Result := ABar.IsShortCut(AShortCut); + if Result then Break; + end; + end; + if not Result then + for I := 0 to ABarManager.FPopupMenus.Count - 1 do + begin + Result := TdxBarCustomPopupMenu(ABarManager.FPopupMenus[I]).IsShortCut(AShortCut); + if Result then Break; + end; + end; + +var + AControl: TWinControl; + ATempBarManager: TdxBarManager; + AWnd: HWND; +begin + AControl := FindVCLControl(GetFocus); + ATempBarManager := GetBarManagerForComponent(AControl); + Result := (ATempBarManager <> nil) and ATempBarManager.PopupMenuLinks.IsShortCut(AControl, AShortCut); + if not Result then + begin + AWnd := Owner.Handle; + repeat + ATempBarManager := GetBarManagerByHandle(AWnd); + Result := (ATempBarManager <> nil) and + IsBarManagerShortCut(ATempBarManager, AShortCut); + if not IsChildClassWindow(AWnd) then + Break; + AWnd := GetParent(AWnd); + until Result; + end; + if not Result then + begin + ATempBarManager := Self; + repeat + ATempBarManager := dxBarManagerList.NextActive(ATempBarManager, True); + if ATempBarManager = Self then + Break; + Result := IsBarManagerShortCut(ATempBarManager, AShortCut); + until Result; + end; +end; + +function TdxBarManager.CanDeleteComponent(AComponent: TComponent): Boolean; +begin + Result := (FdxBarDesignHelper = nil) or + FdxBarDesignHelper.CanDeleteComponent(AComponent); +end; + +procedure TdxBarManager.GetSelection(AList: TList); +begin + if FdxBarDesignHelper <> nil then + FdxBarDesignHelper.GetSelection(AList); +end; + +function TdxBarManager.GetSelectionStatus(AComponent: TPersistent): TdxBarSelectionStatus; +begin + if FdxBarDesignHelper <> nil then + Result := FdxBarDesignHelper.GetSelectionStatus(AComponent) + else + Result := ssUnselected; +end; + +function TdxBarManager.IsComponentSelected(AComponent: TPersistent): Boolean; +begin + Result := (GetSelectionStatus(AComponent) = ssActiveSelected); +end; + +procedure TdxBarManager.SelectComponent(AComponent: TPersistent; ASelectionOperation: TdxBarSelectionOperation = soExclusive); +begin + if FdxBarDesignHelper <> nil then + FdxBarDesignHelper.SelectComponent(AComponent, ASelectionOperation); +end; + +procedure TdxBarManager.SetSelection(AList: TList); +begin + if FdxBarDesignHelper <> nil then + FdxBarDesignHelper.SetSelection(AList); +end; + +procedure TdxBarManager.ShowDefaultEventHandler(AItem: TdxBarItem); +begin + if FdxBarDesignHelper <> nil then + FdxBarDesignHelper.ShowDefaultEventHandler(AItem); +end; + +function TdxBarManager.UniqueName(const BaseName: string): string; +begin + if FdxBarDesignHelper <> nil then + Result := FdxBarDesignHelper.UniqueName(BaseName) +end; + +procedure TdxBarManager.CreateBarRestoringList; +begin + if not BarRestoringListExists then + FBarRestoringList := TList.Create; +end; + +procedure TdxBarManager.DestroyBarRestoringList; +begin + FreeAndNil(FBarRestoringList); +end; + +function TdxBarManager.BarRestoringListExists: Boolean; +begin + Result := FBarRestoringList <> nil; +end; + +procedure TdxBarManager.AddBarToRestoringList(ABar: TdxBar); +begin + if BarRestoringListExists and (FBarRestoringList.IndexOf(ABar) = -1) then + FBarRestoringList.Add(ABar); +end; + +procedure TdxBarManager.RemoveBarFromRestoringList(ABar: TdxBar); +begin + if BarRestoringListExists then + FBarRestoringList.Remove(ABar); +end; + +procedure TdxBarManager.ShowBarsFromRestoringList(ADockControl: TdxBarDockControl); + + function CanShowBar(ABar: TdxBar): Boolean; + begin + if ADockControl = nil then + Result := (ABar.RealDockControl = nil) or ABar.RealDockControl.HandleAllocated + else + Result := (ABar.DockControl = ADockControl) and (ABar.DockingStyle <> dsNone); + end; + +var + I: Integer; +begin + for I := RestoringListBarCount - 1 downto 0 do + if CanShowBar(RestoringListBars[I]) then + RestoringListBars[I].Visible := True; +end; + +function TdxBarManager.GetBarIndexInRestoringList(ABar: TdxBar): Integer; +begin + if BarRestoringListExists then + Result := FBarRestoringList.IndexOf(ABar) + else + Result := -1; +end; + +procedure TdxBarManager.AssignFont; +var + NonClientMetrics: TNonClientMetrics; +begin + NonClientMetrics.cbSize := SizeOf(NonClientMetrics); + SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, @NonClientMetrics, 0); + if FUseSystemFont then + begin + FInternalFontChange := True; + try + Font.Handle := CreateFontIndirect(NonClientMetrics.lfMenuFont); + finally + FInternalFontChange := False; + end; + end + else + if FScaled then + Font.Height := NonClientMetrics.lfMenuFont.lfHeight; +end; + +function TdxBarManager.CanReset: Boolean; +begin + Result := (FReadStateCount > 0) and FAllowReset; +end; + +procedure TdxBarManager.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('Bars', ReadBars, nil, False); + Filer.DefineProperty('DockControlHeights', ReadDockControlHeights, WriteDockControlHeights, True); +end; + +procedure TdxBarManager.DesignerModified; +begin + if not (IsInitializing or IsDestroying) then + if not CanModifyDesigner then + FDesignerModifiedInvoked := True + else + begin + FModified := True; + if Designing and not (csUpdating in ComponentState) and not IsRecreating and + ([bisBarsLoading, bisHandleCreating] * FInternalState = []) and not FImageOptions.IsLoading then + BarDesignController.DesignerModified(ParentForm); + end; +end; + +procedure TdxBarManager.DoBarAfterReset(ABar: TdxBar); +begin + if Assigned(FOnBarAfterReset) then FOnBarAfterReset(Self, ABar); +end; + +procedure TdxBarManager.DoBarBeforeReset(ABar: TdxBar); +begin + if Assigned(FOnBarBeforeReset) then FOnBarBeforeReset(Self, ABar); +end; + +procedure TdxBarManager.DoBarClose(ABar: TdxBar); +begin + if Assigned(FOnBarClose) then FOnBarClose(Self, ABar); +end; + +procedure TdxBarManager.DoBarDockingStyleChanged(ABar: TdxBar); +begin + if not BarsLoading then + begin + if Assigned(FOnBarDockingStyleChange) then + FOnBarDockingStyleChange(Self, ABar); +//#DG DesignerModified; + ABar.Changed(True); + end; +end; + +procedure TdxBarManager.DoClickItem(AItem: TdxBarItem); +begin + if Assigned(FOnClickItem) then FOnClickItem(Self, AItem); +end; + +procedure TdxBarManager.DoCloseButtonClick; +begin + CallNotify(FOnCloseButtonClick, Self); +end; + +function TdxBarManager.DoDocking(ABar: TdxBar; AStyle: TdxBarDockingStyle; + ADockControl: TdxDockControl): Boolean; +begin + Result := + not (AStyle in ABar.NotDocking) and + (((ADockControl = nil) or ADockControl.Main) and not (AStyle in NotDocking) or + (ADockControl <> nil) and not ADockControl.Main and ADockControl.CanDocking(ABar)); + if Assigned(FOnDocking) then FOnDocking(ABar, AStyle, ADockControl, Result); +end; + +procedure TdxBarManager.DoItemLinkChange(AItemLink: TdxBarItemLink); +begin + if Assigned(OnItemLinkChange) and not IsLoading then + OnItemLinkChange(Self, AItemLink); +end; + +procedure TdxBarManager.DoHelpButtonClick; +begin + CallNotify(FOnHelpButtonClick, Self); +end; + +procedure TdxBarManager.DoMergeItemLink( + ADstItemLinks, ASrcItemLinks: TdxBarItemLinks; ASrcItemLink: TdxBarItemLink; + var AMergeKind: TdxBarItemMergeKind; var AMergeIndex: Integer); +begin + if Assigned(FOnMergeItemLink) then + FOnMergeItemLink(Self, ADstItemLinks, ASrcItemLinks, ASrcItemLink, + AMergeKind, AMergeIndex); +end; + +procedure TdxBarManager.DoShowCustomizingPopup(PopupItemLinks: TdxBarItemLinks); +begin + if Assigned(FOnShowCustomizingPopup) then FOnShowCustomizingPopup(Self, PopupItemLinks); +end; + +procedure TdxBarManager.DoShowToolbarsPopup(PopupItemLinks: TdxBarItemLinks); +begin + if Assigned(FOnShowToolbarsPopup) then FOnShowToolbarsPopup(Self, PopupItemLinks); +end; + +procedure TdxBarManager.DragAndDrop(AItem: TdxBarItem; AItemLink: TdxBarItemLink); +begin + DragInfo.BeginDrag(AItem, AItemLink); + try + DragInfo.HandleDragging; + finally + DragInfo.EndDrag; + end; +end; + +function TdxBarManager.FindDockControl(APath: string): TdxBarDockControl; +var + ARootName: string; + ARoot: TComponent; +begin + ARootName := Copy(APath, 1, Pos('.', APath) - 1); + if ARootName <> '' then + begin + ARoot := FindGlobalComponent(ARootName); + Delete(APath, 1, Length(ARootName) + 1); + end + else + ARoot := Owner;//#DG + Result := FindNestedComponent(ARoot, APath) as TdxBarDockControl; +end; + +function TdxBarManager.GetCategoryRealIndex(AIndex: Integer): Integer; +var + I: Integer; +begin + if Designing then Result := AIndex + else + begin + Result := -1; + for I := 0 to FCategories.Count - 1 do + if CategoryVisible[I] then + begin + Inc(Result); + if Result = AIndex then + begin + Result := I; + Exit; + end; + end; + Result := -1; + end; +end; + +procedure TdxBarManager.GetChildren(Proc: TGetChildProc; Root: TComponent); +var + I: Integer; +begin + for I := 0 to Bars.Count - 1 do + if Bars[I].Owner = Root then Proc(Bars[I]); + for I := 0 to ItemCount - 1 do + if (Items[I].Owner = Root) and (Items[I].Category > -1) then Proc(Items[I]); + for I := 0 to GroupCount - 1 do + if Groups[I].Owner = Root then Proc(Groups[I]); +end; + +function TdxBarManager.GetChildOwner: TComponent; +begin + Result := Owner; +end; + +function TdxBarManager.GetPainterClass: TdxBarPainterClass; +begin + case GetRealPaintStyle of + rpsEnhanced: + Result := TdxBarEnhancedPainter; + rpsFlat: + Result := TdxBarFlatPainter; + rpsXP: + Result := TdxBarXPPainter; + rpsOffice11: + Result := TdxBarOffice11Painter; + rpsSkin: + Result := dxBarSkinPainterClass; + else{rpsStandard} + Result := TdxBarStandardPainter; + end; +end; + +procedure TdxBarManager.GetRealLookAndFeel(ALookAndFeel: TcxLookAndFeel); +begin + ALookAndFeel.Reset; + ALookAndFeel.SkinName := ''; + case GetRealPaintStyle of + rpsXP: + ALookAndFeel.SetStyle(lfsNative); + rpsStandard, rpsEnhanced: + ALookAndFeel.SetStyle(lfsFlat); + rpsFlat: + ALookAndFeel.SetStyle(lfsUltraFlat); + rpsOffice11: + ALookAndFeel.SetStyle(lfsOffice11); + else{rpsSkin} + ALookAndFeel.Assign(LookAndFeel); + end; +end; + +function TdxBarManager.GetRealPaintStyle: TdxBarRealPaintStyle; +const + BarManagerStyle2RealPaintStyle: array [bmsStandard..bmsOffice11] of TdxBarRealPaintStyle = + (rpsStandard, rpsEnhanced, rpsFlat, rpsXP, rpsOffice11); + LookAndFeelKind2RealPaintStyle: array [TcxLookAndFeelKind] of TdxBarRealPaintStyle = + (rpsEnhanced, rpsStandard, rpsFlat, rpsOffice11); +begin + case Style of + bmsUseLookAndFeel: + if LookAndFeel.NativeStyle and FThemeAvailable then + Result := rpsXP + else + if LookAndFeel.SkinPainter <> nil then + Result := rpsSkin + else + Result := LookAndFeelKind2RealPaintStyle[LookAndFeel.Kind]; + bmsXP: + if not FThemeAvailable then + Result := rpsEnhanced + else + Result := rpsXP; + else + Result := BarManagerStyle2RealPaintStyle[Style]; + end; +end; + +function TdxBarManager.GetWindowForMouseCapturing: HWND; +begin + if FIsCustomizing and (dxBarCustomizingForm <> nil) then + Result := dxBarCustomizingForm.Handle + else + if IsWindowVisible(Application.Handle) then + Result := Application.Handle + else + Result := Owner.Handle;//#DG +end; + +procedure TdxBarManager.SetChildOrder(Child: TComponent; Order: Integer); +begin + inherited; + if Child is TdxBarItem then + TdxBarItem(Child).Index := Order - Bars.Count; + if Child is TdxBarGroup then + TdxBarGroup(Child).Index := Order - Bars.Count - ItemCount; +end; + +procedure TdxBarManager.CustomImagesChanged(AChangeProc: TdxBarItemChangeProc); +var + I: Integer; +begin + if not IsLoading and not IsDestroying then + begin + BeginUpdate; + try + for I := 0 to ItemCount - 1 do + AChangeProc(Items[I]); + finally + EndUpdate; + end; + end; +end; + +procedure TdxBarManager.DisabledImagesChanged(AItem: TdxBarItem); +begin + if AItem.ImageIndex > -1 then AItem.GlyphChanged; +end; + +procedure TdxBarManager.DisabledLargeImagesChanged(AItem: TdxBarItem); +begin + if AItem.UseLargeImages then AItem.LargeGlyphChanged; +end; + +procedure TdxBarManager.HotImagesChanged(AItem: TdxBarItem); +begin + if AItem.UseHotImages then AItem.HotGlyphChanged; +end; + +procedure TdxBarManager.ImagesChanged(AItem: TdxBarItem); +begin + if AItem.ImageIndex > -1 then AItem.GlyphChanged; +end; + +function TdxBarManager.IsLargeImagesForLargeIcons: Boolean; +begin + Result := FImageOptions.IsLargeImagesForLargeIcons; +end; + +procedure TdxBarManager.LargeImagesChanged(AItem: TdxBarItem); +begin + if AItem.UseLargeImages then AItem.LargeGlyphChanged; +end; + +procedure TdxBarManager.DisableFloatToolBars; +var + I: Integer; +begin + FDisabledToolBarsList := TList.Create; + for I := 0 to Bars.Count - 1 do + if Bars[I].IsFloat then + DisableWindow(FDisabledToolBarsList, Bars[I].Control.Handle); +end; + +procedure TdxBarManager.EnableFloatToolBars; +begin + EnableWindows(FDisabledToolBarsList); + FreeAndNil(FDisabledToolBarsList); +end; + +procedure TdxBarManager.ActivateFloatToolbars(AActivate, AForceHiding: Boolean; AActiveWindow: HWND); +begin + if AActivate <> FMainFormActive then + begin + FMainFormActive := AActivate; + ShowToolbars(AActivate, AForceHiding, AActiveWindow); + end; +end; + +function TdxBarManager.IsInternalDockControl( + ADockControl: TdxDockControl): Boolean; +var + ADockingStyle: TdxBarDockedDockingStyle; +begin + for ADockingStyle := Low(TdxBarDockedDockingStyle) to High(TdxBarDockedDockingStyle) do + begin + Result := ADockControl = InternalDockControls[ADockingStyle]; + if Result then + Break; + end; +end; + +function TdxBarManager.IsUpdateLocked: Boolean; +begin + Result := FLockUpdateCount > 0; +end; + +procedure TdxBarManager.Loaded; + + procedure SortItems; + var + I: Integer; + ASorted: Boolean; + begin + repeat + ASorted := True; + for I := 0 to ItemCount - 2 do + if Items[I].Category > Items[I + 1].Category then + begin + MoveItem(I + 1, I); + ASorted := False; + end; + until ASorted; + end; + +var + I: Integer; +begin + inherited Loaded; + + if IsUpdateLocked then Exit; + + Include(FInternalState, bisAfterLoading); + try + LoadLinkItemNames; + if Designing then + SortItems; + Include(FInternalState, bisBarsLoading); + try + for I := 0 to ItemCount - 1 do + with Items[I] do + Visible := FLoadedVisible; + for I := 0 to FBars.Count - 1 do + with FBars[I] do + begin + FIsPredefined := True; + DockControl := FLoadedDockControl; + if DockControl = nil then + DockingStyle := FLoadedDockingStyle; + Visible := FLoadedVisible; + end; + SaveState; + if not Designing then + begin + if FStoreInRegistry then LoadFromRegistry(FRegistryPath); + if FStoreInIniFile then LoadFromIniFile(FIniFileName); + end; + finally + Exclude(FInternalState, bisBarsLoading); + end; + + for I := 0 to FCategories.Count - 1 do + if FCategories.Objects[I] <> nil then + CategoryItemsVisible[I] := TdxBarCategoryData(FCategories.Objects[I]).LoadedItemsVisible; + + for I := 0 to DockControlCount - 1 do + DockControls[I].UpdateDock; + finally + Exclude(FInternalState, bisAfterLoading); + end; +end; + +procedure TdxBarManager.LockDesignerModified(ALock: Boolean; + AInvokeDesignerModifiedOnUnlock: Boolean = True); +begin + if ALock then + begin + if FLockDesignerModifiedCount = 0 then + FDesignerModifiedInvoked := False; + Inc(FLockDesignerModifiedCount); + end + else + begin + Dec(FLockDesignerModifiedCount); + if (FLockDesignerModifiedCount = 0) and AInvokeDesignerModifiedOnUnlock and FDesignerModifiedInvoked then + DesignerModified; + end; +end; + +procedure TdxBarManager.Notification(AComponent: TComponent; Operation: TOperation); +var + I: Integer; +begin + inherited; + if Operation = opRemove then + begin + if AComponent is TControl then + for I := 0 to FPopupMenuLinks.Count - 1 do + if FPopupMenuLinks[I].Control = AComponent then + FPopupMenuLinks[I].Control := nil; + if AComponent is TdxBarPopupMenu then + for I := 0 to FPopupMenuLinks.Count - 1 do + if FPopupMenuLinks[I].PopupMenu = AComponent then + FPopupMenuLinks[I].PopupMenu := nil; + end; +end; + +procedure TdxBarManager.ReadState(Reader: TReader); +begin + inherited; + Inc(FReadStateCount); +end; + +procedure TdxBarManager.SetName(const NewName: TComponentName); +var + I: Integer; + OldName, ItemName, NamePrefix: TComponentName; + Item: TdxBarItem; +begin + OldName := Name; + inherited SetName(NewName); + if Designing and (Name <> OldName) then + for I := 0 to FItems.Count - 1 do + begin + Item := Items[I]; + if Item.Owner = Owner then + begin + ItemName := Item.Name; + NamePrefix := ItemName; + if Length(NamePrefix) > Length(OldName) then + begin + SetLength(NamePrefix, Length(OldName)); + if CompareText(OldName, NamePrefix) = 0 then + begin + System.Delete(ItemName, 1, Length(OldName)); + System.Insert(NewName, ItemName, 1); + try + Item.Name := ItemName; + except + on EComponentError do + end; + end; + end; + end; + end; +end; + +procedure TdxBarManager.ShowToolbars(Show, ForceHiding: Boolean; ActiveWindow: HWND); + + function CanHideToolbars: Boolean; + begin + Result := HideFloatingBarsWhenInactive or ForceHiding; + end; + + procedure InvalidateBarsCaptions; + var + I: Integer; + begin + for I := 0 to Bars.Count - 1 do + if Bars[I].IsFloat then + Bars[I].Control.FrameChanged; + end; + +var + I: Integer; +begin + if bisToolbarsVisibleChanging in FInternalState then + Exit; + Include(FInternalState, bisToolbarsVisibleChanging); + try + if not CanHideToolbars then + InvalidateBarsCaptions; + if not Show then + begin + if GetParent(ActiveWindow) = GetMainForm.Handle then + Exit; + if (ActiveBarControl <> nil) and ActiveBarControl.CanDeactivate(Self, ActiveWindow) then //#DG rollback to 302-nd version +//#DG while (ActiveBarControl <> nil) and ActiveBarControl.CanDeactivate(Self, ActiveWindow) do + ActiveBarControl.HideAll; + + BarNavigationController.StopKeyboardHandling; + + if not CanHideToolbars then + begin + if BarDesignController.QuickControl <> nil then + BarDesignController.QuickControl.CloseUp; + Exit; + end; + if (ActiveWindow = 0) or (FindControl(ActiveWindow) is TCustomForm) and + ((dxBarCustomizingForm = nil) or (ActiveWindow <> dxBarCustomizingForm.Handle) or not FIsCustomizing) or + IsAnotherApplicatonWindow(ActiveWindow) or + (ActiveWindow = Application.Handle) then + begin + for I := 0 to Bars.Count - 1 do + if Bars[I].IsFloat and Bars[I].Control.CanHide then + Bars[I].Control.Hide; + SendMessage(ParentForm.Handle, WM_NCACTIVATE, 0, 0); + end; + end + else + if IsOwnerVisible then + for I := 0 to Bars.Count - 1 do + if Bars[I].IsFloat and Bars[I].Visible then + Bars[I].Control.Show; + finally + Exclude(FInternalState, bisToolbarsVisibleChanging); + end; +end; + +function TdxBarManager.IsOwnerVisible: Boolean; +var + AWnd: HWND; +begin + Result := IsControlVisible(Owner); + if Result then + begin + AWnd := Owner.Handle; + while not IsIconic(AWnd) and IsChildClassWindow(AWnd) do + AWnd := GetParent(AWnd); + Result := not IsIconic(AWnd); + end; +end; + +function TdxBarManager.IsUncustomizable: Boolean; +var + ACustomizingBarManager: TdxBarManager; +begin + ACustomizingBarManager := dxBarManagerList.GetCustomizingBarManager; + Result := (ACustomizingBarManager <> nil) and (Self <> ACustomizingBarManager); +end; + +function TdxBarManager.CanAddComponents: Boolean; +begin + Result := Owner.ComponentState * [csDesigning, csInline] <> [csDesigning, csInline]; +end; + +function TdxBarManager.GetLightColor(ABtnFaceColorPart, AHighlightColorPart, AWindowColorPart: Integer): COLORREF; +begin + Result := dxOffice11.GetLightColor(ABtnFaceColorPart, AHighlightColorPart, AWindowColorPart); +end; + +function TdxBarManager.BarByCaption(const ACaption: string): TdxBar; +var + I: Integer; +begin + for I := 0 to FBars.Count - 1 do + begin + Result := FBars[I]; + if Result.Caption = ACaption then Exit; + end; + Result := nil; +end; + +function TdxBarManager.BarByComponentName(const AName: string): TdxBar; +var + I: Integer; +begin + Result := nil; + for I := 0 to Bars.Count - 1 do + if Bars[I].Name = AName then + begin + Result := Bars[I]; + Break; + end; +end; + +function TdxBarManager.BarByOldName(const AName: string): TdxBar; +var + I: Integer; +begin + Result := nil; + for I := 0 to Bars.Count - 1 do + if Bars[I].OldName = AName then + begin + Result := Bars[I]; + Break; + end; +end; + +//function TdxBarManager.CheckBarName(const AName: string): string; +//begin +// if BarByNewName(AName) = nil then +// Result := AName +// else +// Result := GetUniqueToolbarName(AName); +//end; + +function TdxBarManager.GetUniqueToolbarCaption(const ABaseName: string): string; +var + I: Integer; +begin + I := 0; + repeat + Inc(I); + Result := ABaseName + IntToStr(I); + until BarByCaption(Result) = nil; +end; + +function TdxBarManager.GetUniqueToolbarName(const ABaseName: string): string; +var + I: Integer; +begin + if not IsLoading and Designing then + Result := UniqueName(ABaseName) + else + begin + I := 0; + repeat + Inc(I); + Result := ABaseName + IntToStr(I); + until BarByNewName(Result) = nil; + end; +end; + +function TdxBarManager.GetAllItemsByCategory(ACategory: Integer; List: TList): Integer; +var + I: Integer; +begin + List.Clear; + if (0 <= ACategory) and (ACategory < Categories.Count) then + for I := 0 to ItemCount - 1 do + if Items[I].Category = ACategory then List.Add(Items[I]); + Result := List.Count; +end; + +function TdxBarManager.GetCountByCategory(ACategory: Integer): Integer; +var + I: Integer; +begin + Result := 0; + if (0 <= ACategory) and (ACategory < Categories.Count) then + for I := 0 to ItemCount - 1 do + with Items[I] do + if (Category = ACategory) and + (Designing or ActuallyVisible and not Hidden) then + Inc(Result); +end; + +function TdxBarManager.GetItemByCategory(ACategory, AIndex: Integer): TdxBarItem; +var + AList: TList; +begin + Result := nil; + AList := TList.Create; + try + GetItemsByCategory(ACategory, AList); + if (0 <= AIndex) and (AIndex < AList.Count) then + Result := TdxBarItem(AList[AIndex]); + finally + AList.Free; + end; +end; + +function TdxBarManager.GetItemByName(const AName: string): TdxBarItem; +var + I: Integer; +begin + Result := nil; + for I := 0 to ItemCount - 1 do + if CompareText(Items[I].Name, AName) = 0 then + begin + Result := Items[I]; + Break; + end; +end; + +function TdxBarManager.GetItemsByCategory(ACategory: Integer; List: TList): Integer; +var + I: Integer; +begin + if Designing then + Result := GetAllItemsByCategory(ACategory, List) + else + begin + List.Clear; + if (0 <= ACategory) and (ACategory < Categories.Count) then + for I := 0 to ItemCount - 1 do + with Items[I] do + if (Category = ACategory) and ActuallyVisible and not Hidden then + List.Add(Items[I]); + Result := List.Count; + end; +end; + +function TdxBarManager.GetUniqueItemName(ABarItemClass: TdxBarItemClass): string; +var + S, S1: string; + I, J: Integer; + AFound: Boolean; +begin + S := ABarItemClass.ClassName; + Delete(S, 1, 1); + if Designing then + Result := UniqueName(S) + else + begin + J := 0; + repeat + Inc(J); + S1 := S + IntToStr(J); + AFound := False; + for I := 0 to ItemCount - 1 do + if CompareText(S1, Items[I].Name) = 0 then + begin + AFound := True; + Break; + end; + until not AFound; + Result := S1; + end; +end; + +function TdxBarManager.AddButton: TdxBarButton; +begin + Result := TdxBarButton(AddItem(TdxBarButton)); +end; + +function TdxBarManager.AddItem(AClass: TdxBarItemClass): TdxBarItem; +var + ACategoryIndex: Integer; +begin + Result := AClass.Create(Self); + ACategoryIndex := Categories.IndexOf(dxSBAR_DEFAULTCATEGORYNAME); + if ACategoryIndex = -1 then + ACategoryIndex := 0; + Result.Category := ACategoryIndex; +end; + +function TdxBarManager.AddSubItem: TdxBarSubItem; +begin + Result := TdxBarSubItem(AddItem(TdxBarSubItem)); +end; + +function TdxBarManager.AddToolBar(AIsMainMenu: Boolean = False; + ANeedEditCaption: Boolean = False): TdxBar; +var + AWorkArea: TRect; + ACaption: string; +begin + Result := nil; + ACaption := GetUniqueToolbarCaption(cxGetResourceString(@dxSBAR_TOOLBARNEWNAME)); + if ANeedEditCaption and not dxBarEditName(ACaption, 0, 0, Self, nil) then + Exit; + BeginUpdate; + try + Bars.BeginUpdate; // TODO FIX!!! + try + Result := Bars.Add; + Result.Caption := ACaption; + AWorkArea := GetWorkArea(Point(Owner.Left, Owner.Top)); + Result.FloatLeft := Owner.Left - 50; + if Result.FloatLeft < AWorkArea.Left then + Result.FloatLeft := Owner.Left + Owner.Width + 10; + Result.FloatTop := Owner.Top; + if Result.FloatTop < AWorkArea.Top then + Result.FloatTop := AWorkArea.Top + 10; + Result.DockingStyle := dsTop; + if AIsMainMenu then + begin + Result.Row := 0; + Result.IsMainMenu := True; + Result.Visible := True; + end + else + begin + Result.Row := Result.RealDockControl.RowCount; + Result.OneOnRow := True; + Result.Visible := True; + Result.OneOnRow := False; + end; + BarDesignController.SelectItem(Result); + finally + Bars.EndUpdate; + end; + finally + EndUpdate; + end; +end; + +procedure TdxBarManager.DeleteToolBar(ABar: TdxBar; AConfirmation: Boolean); +begin + if ABar = nil then + Exit; + if not AConfirmation or + (dxBarMessageBox(Format(cxGetResourceString(@dxSBAR_WANTTODELETETOOLBAR), [ABar.Caption]), + MB_ICONEXCLAMATION or MB_OKCANCEL) = ID_OK) then + ABar.Free; +end; + +procedure TdxBarManager.ExchangeItems(Index1, Index2: Integer); +begin + FItems.Exchange(Index1, Index2); + DesignerModified; +end; + +{procedure TdxBarManager.FocusItem(AItem: TdxBarItem); +var + AdxBarItemLink : TdxBarItemLink; +begin + AdxBarItemLink := AItem.GetCurItemLink; + if AdxBarItemLink = nil then + AdxBarItemLink := AItem.GetLinks(0); + if (AdxBarItemLink <> nil) then + begin + if AdxBarItemLink.BarControl = nil then + TdxBarSubItem(TdxBarItemLinks(AdxBarItemLink.owner).owner).DropDown; + if AdxBarItemLink.FControl <> nil then + begin + TdxBarWinControl(AdxBarItemLink.FControl).SetFocused(True); + AdxBarItemLink.GetBarControl.SetSelectedItem(AdxBarItemLink.FControl); + end; + end; +end;} + +procedure TdxBarManager.MoveItem(CurIndex, NewIndex: Integer); +begin + FItems.Move(CurIndex, NewIndex); + DesignerModified; +end; + +procedure TdxBarManager.RenameToolBar(ABar: TdxBar); +var + ACaption: string; +begin + if ABar = nil then + Exit; + ACaption := ABar.Caption; + if dxBarEditName(ACaption, 0, 1, Self, ABar) then + ABar.Caption := ACaption; +end; + +procedure TdxBarManager.ResetToolBar(ABar: TdxBar); +begin + if ABar <> nil then + ABar.ResetWithConfirmation; +end; + +procedure TdxBarManager.Merge(ABarManager: TdxBarManager; + ACanCreateNewBar: Boolean = True); +var + ABar, ANewBar: TdxBar; + I: Integer; +begin + if (ABarManager = nil) or (ABarManager = Self) then + raise Exception.Create(cxGetResourceString(@dxSBAR_CANTMERGEBARMANAGER)); + for I := 0 to ABarManager.Bars.Count - 1 do + begin + ABar := ABarManager.Bars[I]; + if ABar.MergeData.MergedWith <> nil then + raise Exception.Create(cxGetResourceString(@dxSBAR_ONEOFTOOLBARSALREADYMERGED)); + if ABar.MergeData.MergedBarList.Count <> 0 then + raise Exception.Create(cxGetResourceString(@dxSBAR_ONEOFTOOLBARSHASMERGEDTOOLBARS)); + end; + + for I := 0 to ABarManager.Bars.Count - 1 do + begin + ABar := ABarManager.Bars[I]; + if ABar.Visible and (BarByCaption(ABar.Caption) <> nil) then + BarByCaption(ABar.Caption).Merge(ABar); + end; + + if ACanCreateNewBar then + for I := 0 to ABarManager.Bars.Count - 1 do + begin + ABar := ABarManager.Bars[I]; + if ABar.Visible and (ABar.MergeData.MergedWith = nil) then + begin + ANewBar := CreateBarAsByMerging; + ANewBar.Caption := ABar.Caption; + ANewBar.Merge(ABar); + ANewBar.Visible := True; + end; + end; +end; + +procedure TdxBarManager.Unmerge(ABarManager: TdxBarManager = nil); +begin + InternalUnmerge(ABarManager, False); +end; + +procedure TdxBarManager.Customizing(Show: Boolean); +var + APrevBarCount, I: Integer; +begin + if (FIsCustomizing <> Show) and (not Show or (dxBarCustomizingForm = nil)) then + begin +// BeginUpdate; //#DG flickers + try + for I := Bars.Count - 1 downto 0 do + if Bars[I].Control <> nil then + with Bars[I].Control do + begin + APrevBarCount := Self.Bars.Count; + HideAll; + if APrevBarCount = Self.Bars.Count then // HideAll can destroy Bar + DestroyControls; + end; + FIsCustomizing := Show; + for I := 0 to Bars.Count - 1 do + with Bars[I] do + begin + ItemLinks.RefreshVisibilityLists; + if Control <> nil then Control.CreateControls; + end; + for I := 0 to ItemCount - 1 do + if Items[I] is TCustomdxBarSubItem then + TCustomdxBarSubItem(Items[I]).ItemLinks.RefreshVisibilityLists; + for I := 0 to FPopupMenus.Count - 1 do + TdxBarPopupMenu(FPopupMenus[I]).ItemLinks.RefreshVisibilityLists; + finally +// EndUpdate(False); + end; + dxBarCustomizing(Self, Show); + for I := 0 to Bars.Count - 1 do + with Bars[I] do + if Control <> nil then + with Control do + begin + UpdateControlState; + RepaintBar; + end; + end; +end; + +procedure TdxBarManager.HideAll; +begin + if (ActiveBarControl <> nil) {and (ActiveBarControl.BarManager = Self) }then + ActiveBarControl.HideAll; +end; + +procedure TdxBarManager.ResetUsageData; +var + ABarIndex: Integer; + I: Integer; +begin + BeginUpdate; + try + for I := 0 to ItemCount - 1 do + Items[I].LoadUsageData(SavedState, GetBaseIniSection); + + for I := 0 to Bars.Count - 1 do + begin + ABarIndex := GetSavedBarIndex(Bars[I].Caption); + if ABarIndex <> -1 then + Bars[I].LoadUsageData(SavedState, GetBaseIniSection, ABarIndex); + end; + finally + EndUpdate; + end; +end; + +procedure TdxBarManager.ResetUsageDataWithConfirmation; +begin + if dxBarMessageBox(cxGetResourceString(@dxSBAR_WANTTORESETUSAGEDATA), + MB_YESNO or MB_DEFBUTTON2 or MB_ICONEXCLAMATION) = ID_YES then + ResetUsageData; +end; + +function GetComponentPath(ABarManagerOwner, AComponent: TComponent): string; +begin + Result := AComponent.Name; + if (Result <> '') and (AComponent.Owner <> ABarManagerOwner) then + while not (AComponent is TCustomForm) and (AComponent.Owner <> nil) and + (AComponent.Owner.Name <> '') do + begin + AComponent := AComponent.Owner; + Result := AComponent.Name + '.' + Result; + end; +end; + +function TdxBarManager.GetBarManagerSection(const ABaseSection: string; + AStoringKind: TdxBarStoringKind): string; +begin + Result := ABaseSection; + if AStoringKind = skIni then + Result := Result + 'Main'; +end; + +function TdxBarManager.GetBaseIniSection: string; +var + AOwner: TComponent; +begin + Result := Name + GetSectionDelimiter(skIni); + AOwner := Owner; + while (AOwner <> nil) and (AOwner.Name <> '') do + begin + Result := AOwner.Name + GetSectionDelimiter(skIni) + Result; + if AOwner is TCustomForm then + Break; + AOwner := AOwner.Owner; + end; +end; + +procedure TdxBarManager.LoadBarManager(ASource: TCustomIniFile; const ASection: string; AStoringKind: TdxBarStoringKind); +var + ABarCount, AItemCount, I: Integer; + ACurrentSection: string; +begin + ACurrentSection := GetBarManagerSection(ASection, AStoringKind); + BeginUpdate; + try + if CanShowRecentItems then + begin + MenusShowRecentItemsFirst := ASource.ReadBool(ACurrentSection, 'MenusShowRecentItemsFirst', MenusShowRecentItemsFirst); + ShowFullMenusAfterDelay := ASource.ReadBool(ACurrentSection, 'ShowFullMenusAfterDelay', ShowFullMenusAfterDelay); + end; + LargeIcons := ASource.ReadBool(ACurrentSection, 'LargeIcons', LargeIcons); + MenuAnimations := TdxBarMenuAnimations(ASource.ReadInteger(ACurrentSection, 'MenuAnimations', Byte(MenuAnimations))); + ShowHint := ASource.ReadBool(ACurrentSection, 'ShowHint', ShowHint); + ShowShortCutInHint := ASource.ReadBool(ACurrentSection, 'ShowShortCutInHint', ShowShortCutInHint); + ABarCount := ASource.ReadInteger(ACurrentSection, 'BarCount', 0); + AItemCount := ASource.ReadInteger(ASection + 'Items', 'ItemCount', -1); + if AItemCount > -1 then + begin + FNewItems := TStringList.Create; + for I := 0 to ItemCount - 1 do + if not ASource.ReadBool(ASection + 'Items', Items[I].Name, False) then + FNewItems.Add(Items[I].Name); + end; + if ABarCount > 0 then + begin + for I := 0 to Bars.Count - 1 do + begin + Bars[I].Visible := False; + Bars[I].DockRow := nil; + end; + for I := 0 to ABarCount - 1 do + begin + if I >= Bars.Count then + Bars.Add; + Bars[I].LoadFromIni(ASource, ASection, I, AStoringKind); + end; + end; + for I := 0 to ItemCount - 1 do + Items[I].LoadFromIni(ASource, ASection, AStoringKind); + if AItemCount > -1 then + FreeAndNil(FNewItems); + IniFileCollectionCallMethods(ReadIniFileHandlers, ASource, AStoringKind, ASection); + finally + EndUpdate; + end; +end; + +procedure TdxBarManager.SaveBarManager(ADestination: TCustomIniFile; const ASection: string; AStoringKind: TdxBarStoringKind); + + procedure ClearOldData(ADestination: TCustomIniFile; const ASection: string); + var + AKeys: TStringList; + I: Integer; + begin + AKeys := TStringList.Create; + try + ADestination.ReadSections(AKeys); + for I := 0 to AKeys.Count - 1 do + if Copy(AKeys[I], 1, Length(ASection)) = ASection then + ADestination.EraseSection(AKeys[I]); + finally + AKeys.Free; + end; + if AStoringKind = skReg then + ADestination.EraseSection(ASection); + end; + + function GetBarCount: Integer; + var + I: Integer; + begin + Result := 0; + for I := 0 to Bars.Count - 1 do + if not Bars[I].MergeData.CreatedByMerging then + Inc(Result); + end; + +var + ACurrentSection: string; + I: Integer; +begin + ClearOldData(ADestination, ASection); + ACurrentSection := GetBarManagerSection(ASection, AStoringKind); + ADestination.WriteInteger(ACurrentSection, 'Version', dxBuildNumber); + if CanShowRecentItems then + begin + ADestination.WriteBool(ACurrentSection, 'MenusShowRecentItemsFirst', MenusShowRecentItemsFirst); + ADestination.WriteBool(ACurrentSection, 'ShowFullMenusAfterDelay', ShowFullMenusAfterDelay); + end; + ADestination.WriteBool(ACurrentSection, 'LargeIcons', LargeIcons); + ADestination.WriteInteger(ACurrentSection, 'MenuAnimations', Ord(MenuAnimations)); + ADestination.WriteBool(ACurrentSection, 'ShowHint', ShowHint); + ADestination.WriteBool(ACurrentSection, 'ShowShortCutInHint', ShowShortCutInHint); + ADestination.WriteInteger(ACurrentSection, 'BarCount', GetBarCount); + ADestination.WriteInteger(ASection + 'Items', 'ItemCount', ItemCount); + for I := 0 to ItemCount - 1 do + ADestination.WriteBool(ASection + 'Items', Items[I].Name, True); + for I := 0 to Bars.Count - 1 do + if not Bars[I].MergeData.CreatedByMerging then + Bars[I].SaveToIni(ADestination, ASection, I, AStoringKind); + for I := 0 to ItemCount - 1 do + Items[I].SaveToIni(ADestination, ASection, AStoringKind); + IniFileCollectionCallMethods(WriteIniFileHandlers, ADestination, AStoringKind, ASection); +end; + +function TdxBarManager.CreateBarAsByMerging: TdxBar; +begin + Result := Bars.Add; + Result.MergeData.CreatedByMerging := True; + Result.Move(dsTop, DockControls[Integer(dsTop) - 1].RowCount, 0); +end; + +procedure TdxBarManager.InternalUnmerge(ABarManager: TdxBarManager; + AForCustomization: Boolean); +var + ABar: TdxBar; + ABarLink: TcxObjectLink; + ABarList: TList; + I: Integer; +begin + ABarList := nil; + try + if AForCustomization then + begin + ABarManager := nil; + ABarList := TList.Create; + for I := 0 to Bars.Count - 1 do + if (Bars[I].MergeData.MergedWith <> nil) and + (Bars[I].MergeData.MergedWith.BarManager = Self) then + ABarList.Add(Bars[I]); + end; + + for I := Bars.Count - 1 downto 0 do + begin + ABarLink := cxAddObjectLink(Bars[I]); + try + if AForCustomization then + begin + Bars[I].SaveMergeState; + if Bars[I].MergeData.CreatedByMerging then + Bars[I].ShouldNotBeDestroyedIfEmptyAfterUnmerge := True; + end; + Bars[I].InternalUnmergeFromBarManager(ABarManager, not AForCustomization); + if ABarLink.Ref <> nil then + Bars[I].ShouldNotBeDestroyedIfEmptyAfterUnmerge := False; + finally + cxRemoveObjectLink(ABarLink); + end; + end; + + if AForCustomization then + for I := 0 to ABarList.Count - 1 do + begin + ABar := TdxBar(ABarList[I]); + ABar.SetVisibility(ABar.MergeData.VisibleBeforeMerging); + end; + finally + FreeAndNil(ABarList); + end; +end; + +procedure TdxBarManager.RestoreMergeState; +var + ABar: TdxBar; + I: Integer; +begin + for I := 0 to Bars.Count - 1 do + begin + ABar := Bars[I]; + if not ABar.MergeData.CreatedByMerging then + ABar.RestoreMergeState; + end; + + for I := 0 to Bars.Count - 1 do + begin + ABar := Bars[I]; + if ABar.MergeData.CreatedByMerging then + begin + ABar.RestoreMergeState; + ABar.Hidden := False; + ABar.SetVisibility(ABar.MergeData.CreatedByMergingBarVisibleBeforeCustomization); + end; + end; +end; + +procedure TdxBarManager.GetActiveSelection(AList: TList); +var + I: Integer; +begin + GetSelection(AList); + for I := AList.Count - 1 downto 0 do + if GetSelectionStatus(TPersistent(AList[I])) <> ssActiveSelected then + AList.Delete(I); +end; + +procedure TdxBarManager.BeginMouseTracking(ABarControl: TCustomdxBarControl); +begin + if FMouseTrackingBarControl <> ABarControl then + begin + if FMouseTrackingBarControl <> nil then + FMouseTrackingBarControl.MouseLeave; + FMouseTrackingBarControl := ABarControl; + cxControls.BeginMouseTracking(ABarControl, ABarControl.GetMouseTrackingBounds, ABarControl); + end; +end; + +procedure TdxBarManager.EndMouseTracking(ABarControl: TCustomdxBarControl); +begin + if IsMouseTracking(ABarControl) then + FMouseTrackingBarControl := nil; + cxControls.EndMouseTracking(ABarControl); +end; + +function TdxBarManager.IsMouseTracking(ABarControl: TCustomdxBarControl): Boolean; +begin + Result := ABarControl = FMouseTrackingBarControl; +end; + +procedure TdxBarManager.LoadFromRegistry(ARegistryPath: string); +var + Registry: TRegistryIniFile; +begin + if not CorrectRegistryPath(ARegistryPath) then + Exit; + Registry := TRegistryIniFile.Create(ARegistryPath); + try + LoadBarManager(Registry, ARegistryPath, skReg); + finally + Registry.Free; + end; +end; + +procedure TdxBarManager.SaveToRegistry(ARegistryPath: string); +var + Registry: TRegistryIniFile; +begin + if not CorrectRegistryPath(ARegistryPath) then + Exit; + Registry := TRegistryIniFile.Create(ARegistryPath); + try + SaveBarManager(Registry, ARegistryPath, skReg); + finally + Registry.Free; + end; +end; + +procedure TdxBarManager.LoadFromIniFile(const AFileName: string); +var + AIniFile: TMemIniFile; + ATempList: TStringList; +begin + if (AFileName = '') and (FIniFileStream = nil) then + Exit; + AIniFile := TMemIniFile.Create(AFileName); + try + if FIniFileStream <> nil then + begin + ATempList := TStringList.Create; + try + ATempList.LoadFromStream(FIniFileStream); + AIniFile.SetStrings(ATempList); + finally + ATempList.Free; + end; + end; + LoadBarManager(AIniFile, GetBaseIniSection, skIni); + finally + AIniFile.Free; + end; +end; + +procedure TdxBarManager.SaveToIniFile(const AFileName: string); +var + AIniFile: TMemIniFile; + ATempList: TStringList; +begin + if (AFileName = '') and (FIniFileStream = nil) then Exit; + AIniFile := TMemIniFile.Create(AFileName); + try + SaveBarManager(AIniFile, GetBaseIniSection, skIni); + finally + if FIniFileStream = nil then + AIniFile.UpdateFile + else + begin + ATempList := TStringList.Create; + try + AIniFile.GetStrings(ATempList); + ATempList.SaveToStream(FIniFileStream); + finally + ATempList.Free; + end; + end; + AIniFile.Free; + end; +end; + +procedure TdxBarManager.LoadFromStream(AStream: TStream); +begin + FIniFileStream := AStream; + try + LoadFromIniFile(''); + finally + FIniFileStream := nil; + end; +end; + +procedure TdxBarManager.SaveToStream(AStream: TStream); +begin + FIniFileStream := AStream; + try + SaveToIniFile(''); + finally + FIniFileStream := nil; + end; +end; + +function TdxBarManager.CreateGroup: TdxBarGroup; +begin + Result := TdxBarGroup.Create(Owner);//#DG + AddGroup(Result); +end; + +function TdxBarManager.CanShowRecentItems: Boolean; +begin + Result := GetPaintStyle <> bmsStandard; +end; + +function TdxBarManager.GetPaintStyle: TdxBarManagerStyle; +const + AStyles: array[TcxLookAndFeelKind] of TdxBarManagerStyle = ( + bmsEnhanced, bmsStandard, bmsFlat{$IFDEF DXVER500}, bmsOffice11{$ENDIF}); +begin + if Style = bmsUseLookAndFeel then + begin + if LookAndFeel.NativeStyle and FThemeAvailable then + Result := bmsXP + else + Result := AStyles[LookAndFeel.Kind] + end + else + Result := Style; +end; + +{ TdxBarManagerList } + +destructor TdxBarManagerList.Destroy; +begin + FinalizationBars; + inherited Destroy; +end; + +function TdxBarManagerList.GetBarManager(Index: Integer): TdxBarManager; +begin + Result := TdxBarManager(inherited GetItem(Index)); +end; + +function TdxBarManagerList.GetCustomizingBarManager: TdxBarManager; +var + I: Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + if BarManagers[I].FIsCustomizing then + begin + Result := BarManagers[I]; + Break; + end; +end; + +function TdxBarManagerList.NextActive(ABarManager: TdxBarManager; + AGoForward: Boolean): TdxBarManager; + + function IsBarManagerValid(ABarManager: TdxBarManager; + AMainForm: TCustomForm): Boolean; + var + AForm: TCustomForm; + begin + Result := IsBarManagerOwner(ABarManager, AMainForm.Handle); + if Result then + begin + AForm := GetBarManagerForm(ABarManager, fkMainOrMDIChild); + Result := not IsMDIChild(AForm) or (AForm.Handle = ABarManager.ActiveMDIChild); + end; + end; + +var + AMainForm: TCustomForm; + AIndex, AStartIndex: Integer; +begin + AMainForm := ABarManager.GetMainForm; + AStartIndex := IndexOf(ABarManager); + AIndex := AStartIndex; + repeat + if AGoForward then + begin + Inc(AIndex); + if AIndex = Count then + AIndex := 0; + end + else + begin + Dec(AIndex); + if AIndex < 0 then + AIndex := Count - 1; + end + until (AIndex = AStartIndex) or IsBarManagerValid(BarManagers[AIndex], AMainForm); + Result := BarManagers[AIndex]; +end; + +{ TdxBarMergeData } + +constructor TdxBarMergeData.Create; +begin + inherited Create; + FFreeNotificator := TcxFreeNotificator.Create(nil); + FFreeNotificator.OnFreeNotification := FreeNotification; + FMergedBarList := TList.Create; + FSavedMergedBarList := TList.Create; +end; + +destructor TdxBarMergeData.Destroy; +begin + ClearSavedMergedBarList; + FreeAndNil(FSavedMergedBarList); + FreeAndNil(FMergedBarList); + FreeAndNil(FFreeNotificator); + inherited Destroy; +end; + +procedure TdxBarMergeData.ClearSavedMergedBarList; +var + I: Integer; +begin + for I := 0 to SavedMergedBarCount - 1 do + FreeNotificator.RemoveSender(FSavedMergedBarList[I]); + FSavedMergedBarList.Clear; +end; + +procedure TdxBarMergeData.SaveMergedBarList(AList: TList = nil); +var + I: Integer; +begin + if AList = nil then + AList := FSavedMergedBarList; + for I := 0 to MergedBarList.Count - 1 do + AList.Add(MergedBarList[I]); + if AList = FSavedMergedBarList then + SetFreeNotifications; +end; + +procedure TdxBarMergeData.FreeNotification(Sender: TComponent); +begin + FSavedMergedBarList.Remove(Sender); +end; + +function TdxBarMergeData.GetSavedMergedBar(AIndex: Integer): TdxBar; +begin + Result := TdxBar(FSavedMergedBarList[AIndex]); +end; + +function TdxBarMergeData.GetSavedMergedBarListCount: Integer; +begin + Result := FSavedMergedBarList.Count; +end; + +procedure TdxBarMergeData.SetFreeNotifications; +var + I: Integer; +begin + for I := 0 to SavedMergedBarCount - 1 do + FreeNotificator.AddSender(TComponent(FSavedMergedBarList[I])); +end; + +{ TdxBarAccessibilityHelper } + +function TdxBarAccessibilityHelper.GetFirstSelectableObject: TdxBarAccessibilityHelper; +var + I: Integer; +begin + Result := nil; + if Visible then + if Selectable then + Result := Self + else + for I := 0 to ChildCount - 1 do + begin + Result := Childs[I].GetFirstSelectableObject; + if Result <> nil then + Break; + end; +end; + +// IcxAccessibilityHelper +procedure TdxBarAccessibilityHelper.OwnerObjectDestroyed; +begin + inherited OwnerObjectDestroyed; + if BarNavigationController <> nil then + BarNavigationController.UnassignObject(Self); +end; + +// IdxBarAccessibilityHelper +function TdxBarAccessibilityHelper.AreKeyTipsSupported( + out AKeyTipWindowsManager: IdxBarKeyTipWindowsManager): Boolean; +begin + if ParentForKeyTip <> nil then + Result := ParentForKeyTip.AreKeyTipsSupported(AKeyTipWindowsManager) + else + Result := False; +end; + +function TdxBarAccessibilityHelper.CanNavigateToChildren(AKey: Word): Boolean; +begin + Result := True; +end; + +function TdxBarAccessibilityHelper.GetBarHelper: TdxBarAccessibilityHelper; +begin + Result := Self; +end; + +function TdxBarAccessibilityHelper.GetBarManager: TdxBarManager; +begin + raise Exception.Create(''); +end; + +function TdxBarAccessibilityHelper.GetDefaultAccessibleObject: IdxBarAccessibilityHelper; +begin + raise Exception.Create(''); +end; + +function TdxBarAccessibilityHelper.GetNextAccessibleObject( + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; +var + AObjects: TList; +begin + AObjects := TList.Create; + try + GetChildrenForNavigation(Self, GetRootAccessibleObject.GetBarHelper, + GetScreenBounds(cxAccessibleObjectSelfID), ADirection, True, AObjects); + Result := dxBar.GetNextAccessibleObject( + BarNavigationController.SelectedObject.GetBarHelper, AObjects, ADirection, True); + finally + AObjects.Free; + end; +end; + +function TdxBarAccessibilityHelper.GetRootAccessibleObject: IdxBarAccessibilityHelper; +begin + Result := GetRootHelper as IdxBarAccessibilityHelper; +end; + +function TdxBarAccessibilityHelper.HandleNavigationKey(var AKey: Word): Boolean; +begin + Result := False; +end; + +function TdxBarAccessibilityHelper.IsNavigationKey(AKey: Word): Boolean; +begin + Result := False; +end; + +function TdxBarAccessibilityHelper.IsSelected: Boolean; +var + ASelectedObject: IdxBarAccessibilityHelper; +begin + ASelectedObject := BarNavigationController.SelectedObject; + Result := (ASelectedObject <> nil) and (ASelectedObject.GetHelper = Self); +end; + +function TdxBarAccessibilityHelper.LogicalNavigationGetNextAccessibleObject( + AGoForward: Boolean): IdxBarAccessibilityHelper; +begin + Result := Parent.LogicalNavigationGetNextChild(Parent.LogicalNavigationGetChildIndex(Self), AGoForward); +end; + +procedure TdxBarAccessibilityHelper.Select(ASetFocus: Boolean); +begin + BarNavigationController.SelectedObject := Self; + BarNavigationController.SelectedObjectParent := Parent; +end; + +procedure TdxBarAccessibilityHelper.Unselect( + ANextSelectedObject: IdxBarAccessibilityHelper); +begin + BarNavigationController.SelectedObject := nil; + BarNavigationController.SelectedObjectParent := nil; +end; + +procedure TdxBarAccessibilityHelper.GetChildrenForNavigation( + ASelectedObject, AParentObject: TdxBarAccessibilityHelper; + const ASelectedObjectScreenBounds: TRect; + ADirection: TcxAccessibilityNavigationDirection; + AAreOnlyNearObjectsAccepted: Boolean; AObjects: TList); + + function CheckObject(AObject: TdxBarAccessibilityHelper): Boolean; + var + R: TRect; + begin + Result := AObject.Selectable; + if not Result then + Exit; + R := AObject.GetScreenBounds(cxAccessibleObjectSelfID); + if AAreOnlyNearObjectsAccepted then + if ADirection in [andLeft, andRight] then + Result := (R.Bottom > ASelectedObjectScreenBounds.Top) and (R.Top < ASelectedObjectScreenBounds.Bottom) + else + Result := (R.Right > ASelectedObjectScreenBounds.Left) and (R.Left < ASelectedObjectScreenBounds.Right); + if Result then + case ADirection of + andLeft, andRight: + Result := not ((R.Left = ASelectedObjectScreenBounds.Left) and (R.Right = ASelectedObjectScreenBounds.Right)); + andUp: + Result := R.Bottom <= ASelectedObjectScreenBounds.Top; + andDown: + Result := R.Top >= ASelectedObjectScreenBounds.Bottom; + end; + end; + +var + I: Integer; +begin + if (AParentObject <> ASelectedObject) and AParentObject.Visible then + begin + if CheckObject(AParentObject) then + AObjects.Add(AParentObject); + for I := 0 to AParentObject.ChildCount - 1 do + GetChildrenForNavigation(ASelectedObject, AParentObject.Childs[I], + ASelectedObjectScreenBounds, ADirection, AAreOnlyNearObjectsAccepted, AObjects) + end; +end; + +procedure TdxBarAccessibilityHelper.GetChilds(AChilds: TList; AOnlyVisible: Boolean); +var + AChild: TdxBarAccessibilityHelper; + I: Integer; +begin + if not AOnlyVisible or Visible then + for I := 0 to ChildCount - 1 do + begin + AChild := Childs[I]; + if AChild.Selectable then + AChilds.Add(AChild) + else + AChild.GetChilds(AChilds); + end; +end; + +function TdxBarAccessibilityHelper.GetKeyTip: string; +begin + if GetAssignedKeyTip <> '' then + Result := GetAssignedKeyTip + else + Result := GetDefaultKeyTip; + if Length(Result) > 3 then + SetLength(Result, 3); +end; + +function TdxBarAccessibilityHelper.CreateKeyTipData: TdxBarKeyTipData; +var + AKeyTipInfo: TdxBarKeyTipInfo; +begin + GetKeyTipInfo(AKeyTipInfo); + Result := TdxBarKeyTipData.Create(AKeyTipInfo); +end; + +procedure TdxBarAccessibilityHelper.GetKeyTipInfo(out AKeyTipInfo: TdxBarKeyTipInfo); +begin + cxZeroMemory(@AKeyTipInfo, SizeOf(AKeyTipInfo)); + AKeyTipInfo.KeyTip := GetKeyTip; + AKeyTipInfo.Visible := Visible; + AKeyTipInfo.OnExecute := KeyTipHandler; +end; + +procedure TdxBarAccessibilityHelper.GetKeyTipData(AKeyTipsData: TList); +begin + AKeyTipsData.Add(CreateKeyTipData); +end; + +procedure TdxBarAccessibilityHelper.DoGetKeyTipsData(AKeyTipsData: TList); +var + AChild: TdxBarAccessibilityHelper; + I: Integer; +begin + if Visible then + for I := 0 to ChildCount - 1 do + begin + AChild := Childs[I]; + if AChild.Selectable then + AChild.GetKeyTipData(AKeyTipsData) + else + AChild.DoGetKeyTipsData(AKeyTipsData); + end; +end; + +procedure TdxBarAccessibilityHelper.GetKeyTipsData(AKeyTipsData: TList); +begin + DoGetKeyTipsData(AKeyTipsData); + GenerateUniqueKeyTips(AKeyTipsData); +end; + +procedure TdxBarAccessibilityHelper.GenerateUniqueKeyTips(AKeyTipsData: TList); + + function GetKeyTip(AList: TList; AIndex: Integer): string; // TODO TdxBarKeyTipsDataList + begin + Result := TdxBarKeyTipData(AList[AIndex]).KeyTip; + end; + + function RemoveCollision(AIndex: Integer): Boolean; + + function GetSuffix(ATotalCount, AIndex: Integer): string; + var + I: Integer; + begin + Result := IntToStr(AIndex + 1); + for I := Length(Result) to Length(IntToStr(ATotalCount)) - 1 do + Result := '0' + Result; + end; + + procedure InternalRemoveCollision(ACollisions: TdxObjectList); + var + I: Integer; + begin + for I := 0 to ACollisions.Count - 1 do + TdxBarKeyTipData(ACollisions[I]).KeyTip := GetKeyTip(ACollisions, I) + GetSuffix(ACollisions.Count, I); + end; + + var + ACollisions: TdxObjectList; + I: Integer; + begin + ACollisions := TdxObjectList.Create; + try + for I := 0 to AKeyTipsData.Count - 1 do + if GetKeyTip(AKeyTipsData, AIndex) = GetKeyTip(AKeyTipsData, I) then + ACollisions.Add(AKeyTipsData[I]); + Result := ACollisions.Count > 1; + if Result then + InternalRemoveCollision(ACollisions) + else + begin + for I := 0 to AKeyTipsData.Count - 1 do + if (I <> AIndex) and (Pos(GetKeyTip(AKeyTipsData, AIndex), GetKeyTip(AKeyTipsData, I)) = 1) then + begin + InternalRemoveCollision(ACollisions); + Result := True; + Break; + end; + end; + finally + ACollisions.Free; + end; + end; + +var + I: Integer; + AHasCollisions: Boolean; +begin + repeat + AHasCollisions := False; + for I := 0 to AKeyTipsData.Count - 1 do + AHasCollisions := RemoveCollision(I) or AHasCollisions; + until not AHasCollisions; +end; + +function TdxBarAccessibilityHelper.GetParentForKeyTip: TdxBarAccessibilityHelper; +begin + Result := Parent; +end; + +function TdxBarAccessibilityHelper.IsKeyTipContainer: Boolean; +begin + Result := Selectable; +end; + +procedure TdxBarAccessibilityHelper.KeyTipHandler(Sender: TObject); +begin +end; + +procedure TdxBarAccessibilityHelper.KeyTipsEscapeHandler; +var + ANewKeyTipContainer: IdxBarAccessibilityHelper; +begin + ANewKeyTipContainer := GetKeyTipContainerParent(Self); + if ANewKeyTipContainer = nil then + BarNavigationController.StopKeyboardHandling + else + begin + BarNavigationController.SetKeyTipsShowingState(ANewKeyTipContainer, ''); + BarNavigationController.ChangeSelectedObject(True, Self); + end; +end; + +function TdxBarAccessibilityHelper.LogicalNavigationGetChild( + AIndex: Integer): TdxBarAccessibilityHelper; +begin + Result := Childs[AIndex]; +end; + +function TdxBarAccessibilityHelper.LogicalNavigationGetChildCount: Integer; +begin + Result := ChildCount; +end; + +function TdxBarAccessibilityHelper.LogicalNavigationGetChildIndex( + AChild: TdxBarAccessibilityHelper): Integer; +begin + Result := GetChildIndex(AChild); +end; + +function TdxBarAccessibilityHelper.LogicalNavigationGetNextChild( + AChildIndex: Integer; AGoForward: Boolean): TdxBarAccessibilityHelper; + + function LogicalNavigationGetFirstChild(AContainer: TdxBarAccessibilityHelper): TdxBarAccessibilityHelper; + var + AChild: TdxBarAccessibilityHelper; + I: Integer; + begin + Result := nil; + if AGoForward then + I := 0 + else + I := AContainer.LogicalNavigationGetChildCount - 1; + while (Result = nil) and (I >= 0) and (I < AContainer.LogicalNavigationGetChildCount) do + begin + AChild := AContainer.LogicalNavigationGetChild(I); + if AChild.Selectable then + Result := AChild + else + Result := LogicalNavigationGetFirstChild(AChild); + if AGoForward then + Inc(I) + else + Dec(I); + end; + end; + +var + AChild: TdxBarAccessibilityHelper; +begin + Result := nil; + while Result = nil do + begin + if AGoForward then + Inc(AChildIndex) + else + Dec(AChildIndex); + if (AChildIndex = -1) or (AChildIndex = LogicalNavigationGetChildCount) then + begin + if Parent = nil then + Result := LogicalNavigationGetFirstChild(Self) + else + Result := Parent.LogicalNavigationGetNextChild( + Parent.LogicalNavigationGetChildIndex(Self), AGoForward); + Exit; + end; + AChild := LogicalNavigationGetChild(AChildIndex); + if AChild.Selectable then + Result := AChild + else + Result := LogicalNavigationGetFirstChild(AChild); + end; +end; + +function TdxBarAccessibilityHelper.InternalGetChild( + AIndex: Integer): TdxBarAccessibilityHelper; +begin + Result := TdxBarAccessibilityHelper(GetChild(AIndex)); +end; + +function TdxBarAccessibilityHelper.InternalGetParent: TdxBarAccessibilityHelper; +begin + Result := TdxBarAccessibilityHelper(GetParent); +end; + +{ TdxBarCaptionButton } + +constructor TdxBarCaptionButton.Create(Collection: TCollection); +begin + inherited; + FGlyph := dxBarCreateBitmap(GlyphChanged); + + FNotifyComponent := TcxFreeNotificator.Create(nil); + FNotifyComponent.OnFreeNotification := FreeNotification; + Enabled := True; +end; + +destructor TdxBarCaptionButton.Destroy; +begin + BarAccessibilityHelperOwnerObjectDestroyed(FIAccessibilityHelper); + FreeAndNil(FNotifyComponent); + FreeAndNil(FGlyph); + inherited; +end; + +procedure TdxBarCaptionButton.Assign(Source: TPersistent); +begin + if Source is TdxBarCaptionButton then + begin + Enabled := TdxBarCaptionButton(Source).Enabled; + Glyph := TdxBarCaptionButton(Source).Glyph; + Hint := TdxBarCaptionButton(Source).Hint; + KeyTip := TdxBarCaptionButton(Source).KeyTip; + Rect := TdxBarCaptionButton(Source).Rect; + OnClick := TdxBarCaptionButton(Source).OnClick; + end + else + inherited Assign(Source); +end; + +procedure TdxBarCaptionButton.Click; +begin + CallNotify(OnClick, Self); +end; + +function TdxBarCaptionButton.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxBarCaptionButtonAccessibilityHelper; +end; + +// IUnknown +function TdxBarCaptionButton._AddRef: Integer; +begin + Result := -1; +end; + +function TdxBarCaptionButton._Release: Integer; +begin + Result := -1; +end; + +function TdxBarCaptionButton.QueryInterface(const IID: TGUID; out Obj): HResult; +const + E_NOINTERFACE = HResult($80004002); +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +// IdxBarHintKeeper +function TdxBarCaptionButton.DoHint(var ANeedDeactivate: Boolean; out AHintText: string; out AShortCut: string): Boolean; +begin + Result := False; + ANeedDeactivate := False; + AShortCut := ''; + AHintText := ''; + + if State = DXBAR_HOT then + begin + AHintText := Hint; + Result := True; + end; +end; + +function TdxBarCaptionButton.CreateHintViewInfo(const AHintText, AShortCut: string): TdxBarCustomHintViewInfo; +begin + Result := Parent.CreateHintViewInfo(AHintText, AShortCut, ScreenTip); +end; + +function TdxBarCaptionButton.GetEnabled: Boolean; +begin + Result := State <> DXBAR_DISABLED; +end; + +function TdxBarCaptionButton.GetHintPosition(const ACursorPos: TPoint; AHeight: Integer): TPoint; +begin + Result := Parent.GetHintPosition(Rect, ACursorPos, AHeight); +end; + +function TdxBarCaptionButton.GetCollection: TdxBarCaptionButtons; +begin + Result := TdxBarCaptionButtons(inherited Collection); +end; + +function TdxBarCaptionButton.GetIAccessibilityHelper: IdxBarAccessibilityHelper; +begin + if FIAccessibilityHelper = nil then + FIAccessibilityHelper := GetAccessibilityHelper(GetAccessibilityHelperClass.Create(Self)); + Result := FIAccessibilityHelper; +end; + +function TdxBarCaptionButton.GetParent: TdxBarControl; +begin + Result := Collection.Bar.Control; +end; + +procedure TdxBarCaptionButton.GlyphChanged(Sender: TObject); +begin + Changed(False); +end; + +procedure TdxBarCaptionButton.SetEnabled(Value: Boolean); +begin + FEnabled := Value; + if Value then + State := DXBAR_NORMAL + else + State := DXBAR_DISABLED; +end; + +procedure TdxBarCaptionButton.SetGlyph(Value: TBitmap); +begin + FGlyph.Assign(Value); +end; + +procedure TdxBarCaptionButton.SetScreenTip(Value: TdxBarScreenTip); +begin + if FScreenTip <> Value then + begin + if FScreenTip <> nil then + FNotifyComponent.RemoveFreeNotification(FScreenTip); + FScreenTip := Value; + if FScreenTip <> nil then + FNotifyComponent.FreeNotification(FScreenTip); + end; +end; + +procedure TdxBarCaptionButton.SetState(Value: Integer); +begin + if FState <> Value then + begin + FState := Value; + if Parent <> nil then + Parent.ActivateHint(FState = DXBAR_HOT, Hint, Self); + Changed(False); + end; +end; + +procedure TdxBarCaptionButton.SetOnClick(Value: TNotifyEvent); +begin + FOnClick := Value; + Changed(True); +end; + +procedure TdxBarCaptionButton.FreeNotification(AComponent: TComponent); +begin + FScreenTip := nil; +end; + +{ TdxBarCaptionButtons } + +constructor TdxBarCaptionButtons.Create(ABar: TdxBar); +begin + inherited Create(TdxBarCaptionButton); + FBar := ABar; +end; + +destructor TdxBarCaptionButtons.Destroy; +begin + BarAccessibilityHelperOwnerObjectDestroyed(FIAccessibilityHelper); + inherited Destroy; +end; + +function TdxBarCaptionButtons.Add: TdxBarCaptionButton; +begin + BeginUpdate; + try + Result := TdxBarCaptionButton(inherited Add); + finally + EndUpdate; + end; +end; + +procedure TdxBarCaptionButtons.UpdateButtonStates(const AMousePos: TPoint; AMousePressed: Boolean = False); +var + I: Integer; +begin + for I := 0 to Count - 1 do + if Items[I].Enabled then + if PtInRect(Items[I].Rect, AMousePos) or Items[I].IAccessibilityHelper.IsSelected then + if AMousePressed then + Items[I].State := DXBAR_PRESSED + else + Items[I].State := DXBAR_HOT + else + Items[I].State := DXBAR_NORMAL; +end; + +function TdxBarCaptionButtons.GetOwner: TPersistent; +begin + Result := FBar; +end; + +procedure TdxBarCaptionButtons.Update(Item: TCollectionItem); +begin + inherited; + OnNotify(Self, Item); +end; + +function TdxBarCaptionButtons.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxBarCaptionButtonsAccessibilityHelper; +end; + +function TdxBarCaptionButtons.GetButtonIndex(const APoint: TPoint): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Count - 1 do + if Items[I].Enabled and PtInRect(Items[I].Rect, APoint) then + begin + Result := I; + Break; + end; +end; + +function TdxBarCaptionButtons.GetIAccessibilityHelper: IdxBarAccessibilityHelper; +begin + if FIAccessibilityHelper = nil then + FIAccessibilityHelper := GetAccessibilityHelper(GetAccessibilityHelperClass.Create(Self)); + Result := FIAccessibilityHelper; +end; + +function TdxBarCaptionButtons.GetItem(Index: Integer): TdxBarCaptionButton; +begin + Result := TdxBarCaptionButton(inherited GetItem(Index)); +end; + +function TdxBarCaptionButtons.GetRect: TRect; +var + I: Integer; +begin + Result := cxEmptyRect; + for I := 0 to Count - 1 do + if not IsRectEmpty(Items[I].Rect) then + UnionRect(Result, Result, Items[I].Rect); +end; + +procedure TdxBarCaptionButtons.SetItem(Index: Integer; Value: TdxBarCaptionButton); +begin + inherited SetItem(Index, Value); +end; + +{ TdxBar } + +constructor TdxBar.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FAlphaBlendValue := 255; + FBackgroundBitmap := dxBarCreateBitmap(BitmapChanged); + FAllowClose := True; + FAllowCustomizing := True; + FAllowQuickCustomizing := True; + FAllowReset := True; + FBorderStyle := bbsSingle; + FColor := clDefault; + FDockedDockingStyle := dsTop; + FEditFont := TFont.Create; + FFont := TFont.Create; + FFont.OnChange := FontChanged; + FFreeNotificationItems := TList.Create; + FGlyph := dxBarCreateBitmap(GlyphChanged); + FMergeData := TdxBarMergeData.Create; + FRotateWhenVertical := True; + FShowMark := True; + FSizeGrip := True; + + FCaptionButtons := TdxBarCaptionButtons.Create(Self); + FCaptionButtons.OnNotify := CaptionButtonsNotification; +end; + +destructor TdxBar.Destroy; +begin + DoDestroy; + if not BarManager.IsDestroying and Assigned(BarManager.FOnBarDelete) then + BarManager.OnBarDelete(BarManager, Self); + + FreeAndNil(FCaptionButtons); + + if FMergeData.MergedWith <> nil then + FMergeData.MergedWith.Unmerge(Self); + Unmerge; + FreeAndNil(FMergeData); + +//#DG BarDesignController.DeselectIfSelected(Self); + + Visible := False; + RemoveFromDockRow(True); + MakeFreeNotification; + FreeAndNil(FFreeNotificationItems); + if BarManager.MainMenuBar = Self then + BarManager.FMainMenuBar := nil; + FreeAndNil(FItemLinks); + FreeAndNil(FGlyph); + FreeAndNil(FFont); + FreeAndNil(FEditFont); + FreeAndNil(FBackgroundBitmap); + cxClearObjectLinks(Self); + inherited Destroy; +end; + +procedure TdxBar.Assign(Source: TPersistent); +var + Bar: TdxBar; +begin + if Source is TdxBar then + begin + Bar := TdxBar(Source); + + AllowClose := Bar.AllowClose; + AllowCustomizing := Bar.AllowCustomizing; + AllowQuickCustomizing := Bar.AllowQuickCustomizing; + AllowReset := Bar.AllowReset; + BorderStyle := Bar.BorderStyle; + Caption := Bar.Caption; + CaptionButtons := Bar.CaptionButtons; + DockedDockControl := Bar.DockedDockControl; + DockedDockingStyle := Bar.DockedDockingStyle; + DockedLeft := Bar.DockedLeft; + DockedTop := Bar.DockedTop; + FloatLeft := Bar.FloatLeft; + FloatTop := Bar.FloatTop; + FloatClientWidth := Bar.FloatClientWidth; + FloatClientHeight := Bar.FloatClientHeight; + Hidden := Bar.Hidden; + IsMainMenu := Bar.IsMainMenu; + ItemLinks := Bar.ItemLinks; + NotDocking := Bar.NotDocking; + OldName := Bar.OldName; + OneOnRow := Bar.OneOnRow; + RotateWhenVertical := Bar.RotateWhenVertical; + Row := Bar.Row; + ShowMark := Bar.ShowMark; + SizeGrip := Bar.SizeGrip; + WholeRow := Bar.WholeRow; + ChangeDockingStyle(Bar.DockingStyle, Bar.DockControl); + UseRecentItems := Bar.UseRecentItems; + UseRestSpace := Bar.UseRestSpace; + Color := Bar.Color; + Font := Bar.Font; + UseOwnFont := Bar.UseOwnFont; + Visible := Bar.Visible; + end + else inherited Assign(Source); +end; + +procedure TdxBar.BitmapChanged(Sender: TObject); +begin + if Control <> nil then + Control.RebuildBar; +end; + +procedure TdxBar.DoDestroy; +begin +//#DG Destroying; + CallNotify(FOnDestroy, Self); +end; + +function TdxBar.GetBars: TdxBars; +begin + if GetBarManager = nil then + Result := nil + else + Result := GetBarManager.Bars; +end; + +function TdxBar.GetControl: TdxBarControl; +begin + if ItemLinks <> nil then + Result := TdxBarControl(ItemLinks.FBarControl) + else + Result := nil; +end; + +function TdxBar.GetDockControl: TdxBarDockControl; +begin + if IsAncestorComponentDifferencesDetection(Self) then + Result := FLoadedDockControl + else + Result := FDockControl; +end; + +function TdxBar.GetDockedDockingStyle: TdxBarDockingStyle; +begin + if FDockedDockControl = nil then + Result := FDockedDockingStyle + else + Result := FDockedDockControl.DockingStyle; +end; + +function TdxBar.GetDockingStyle: TdxBarDockingStyle; +begin + if IsAncestorComponentDifferencesDetection(Self) then + Result := FLoadedDockingStyle + else + if FDockControl = nil then + Result := FDockingStyle + else + Result := FDockControl.DockingStyle; +end; + +function TdxBar.GetNext: TdxBar; +begin + if Index + 1 < Bars.Count then + Result := Bars[Index + 1] + else + if Index <> 0 then + Result := Bars[0] + else + Result := nil; +end; + +function TdxBar.GetNotDocking: TdxBarDockingStyles; +begin + Result := FNotDocking; +end; + +function TdxBar.GetPainter: TdxBarPainter; +begin + if RealDockControl <> nil then + Result := RealDockControl.Painter + else + Result := BarManager.DefaultPainter; +end; + +function TdxBar.GetRealDockControl: TdxDockControl; +begin + Result := FDockControl; + if (Result = nil) and (FDockingStyle <> dsNone) then + Result := Bars.FDockControls[FDockingStyle]; +end; + +function TdxBar.GetRow: Integer; +begin + if DockRow <> nil then + Result := DockRow.DockControl.RowList.IndexOf(DockRow) + else + Result := FRow; +end; + +function TdxBar.GetUseRecentItems: Boolean; +begin + Result := FItemLinks.FUseRecentItems; +end; + +function TdxBar.GetVisible: Boolean; +begin + if IsAncestorComponentDifferencesDetection(Self) then + Result := FLoadedVisible + else + Result := FVisible; +end; + +procedure TdxBar.GlyphChanged(Sender: TObject); +begin + if Control <> nil then + Control.GlyphChanged; +end; + +procedure TdxBar.SetAllowClose(Value: Boolean); +begin + if FAllowClose <> Value then + begin + FAllowClose := Value; + if (DockingStyle = dsNone) and (Control <> nil) then + Control.CaptionChanged; + Changed(False); + end; +end; + +procedure TdxBar.SetAllowQuickCustomizing(Value: Boolean); +begin + if FAllowQuickCustomizing <> Value then + begin + FAllowQuickCustomizing := Value; + if Control <> nil then + if DockingStyle = dsNone then + Control.CaptionChanged + else + if BarManager.CanShowRecentItems then + Control.RepaintBar; + end; +end; + +procedure TdxBar.SetAlphaBlendValue(Value: Byte); +begin + if FAlphaBlendValue <> Value then + begin + FAlphaBlendValue := Value; + if (Control <> nil) and (Control.DockingStyle = dsNone) then + Control.SetLayeredAttributes; + end; +end; + +procedure TdxBar.SetBackgroundBitmap(Value: TBitmap); +var + AChanged: Boolean; +begin + AChanged := not ((Value = nil) and FBackgroundBitmap.Empty); + FBackgroundBitmap.Assign(Value); + if AChanged then + BitmapChanged(nil); +end; + +procedure TdxBar.SetBorderStyle(Value: TdxBarBorderStyle); +begin + if FBorderStyle <> Value then + begin + FBorderStyle := Value; + if Control <> nil then Control.RebuildBar; + end; +end; + +procedure TdxBar.SetCaption(Value: string); +begin + if FCaption <> Value then + begin + if BarManager.BarByCaption(Value) <> nil then + Exit; + FCaption := Value; + if Control <> nil then + Control.CaptionChanged; +// if (Name = '') and not BarManager.IsLoading then +// CheckBarName(Value); + Changed(False); + end; +end; + +procedure TdxBar.SetCaptionButtons(Value: TdxBarCaptionButtons); +begin + FCaptionButtons.Assign(Value); +end; + +procedure TdxBar.SetColor(Value: TColor); +begin + if FColor <> Value then + begin + FColor := Value; + if Control <> nil then + Control.RebuildBar; + end; +end; + +procedure TdxBar.SetDockControl(Value: TdxBarDockControl); +var + PrevDockingStyle: TdxBarDockingStyle; + NeedHiding: Boolean; +begin + if (Value <> nil) and (Value.BarManager <> BarManager) then Exit; + if BarManager.IsLoading then + begin + FLoadedDockControl := Value; + Exit; + end; + if FDockControl <> Value then + begin + PrevDockingStyle := DockingStyle; + NeedHiding := not FChangingDockingStyle and (Control <> nil); + if NeedHiding then + if Value = nil then +// NeedHiding := (DockingStyle <> dsNone) and (Control.DockControl <> Value) + NeedHiding := + (DockingStyle <> dsNone) and + not ((Control.DockControl <> nil) and Control.DockControl.Main) + else + NeedHiding := Control.DockControl <> Value; + if NeedHiding then Visible := False; + FDockControl := Value; + ItemLinks.RecentItemCount := -1; + if not FChangingDockingStyle then + begin + FChangingDockingStyle := True; + try + if Value = nil then + DockingStyle := PrevDockingStyle//dsNone + else + DockingStyle := Value.DockingStyle; + finally + FChangingDockingStyle := False; + end; + end; + if NeedHiding then Visible := True; + if Control <> nil then + Control.DockControl := RealDockControl; + if not FChangingDockingStyle then + BarManager.DoBarDockingStyleChanged(Self); + end; +end; + +procedure TdxBar.SetDockedDockControl(Value: TdxBarDockControl); +begin + if (Value <> nil) and (Value.BarManager <> BarManager) then Exit; + if FDockedDockControl <> Value then + begin + FDockedDockControl := Value; + Changed(False); + end; +end; + +procedure TdxBar.SetDockedValue(Index: Integer; Value: Integer); +var + PrevValue: Integer; +begin + if Value < 0 then Value := 0; + PrevValue := 0; + case Index of + 1: PrevValue := FDockedLeft; + 2: PrevValue := FDockedTop; + end; + if PrevValue <> Value then + begin + case Index of + 1: FDockedLeft := Value; + 2: FDockedTop := Value; + end; + if csUpdating in ComponentState then + FNeedUpdateControlPosition := True + else + UpdateControlPosition; + Changed(False); + end; +end; + +procedure TdxBar.SetDockingStyle(Value: TdxBarDockingStyle); +var + ControlExists: Boolean; +begin + if BarManager.IsLoading then + begin + FLoadedDockingStyle := Value; + Exit; + end; + if FDockingStyle <> Value then + begin + ControlExists := + not FChangingDockingStyle and + (Control <> nil) and (Control.DockingStyle <> Value); + if ControlExists then Visible := False; + FDockingStyle := Value; + if not FChangingDockingStyle then + begin + FChangingDockingStyle := True; + try + DockControl := nil; + finally + FChangingDockingStyle := False; + end; + end; + ItemLinks.RecentItemCount := -1; + if ControlExists then + begin + Visible := True; + Control.DockingStyle := Value; + end; + if not FChangingDockingStyle then + BarManager.DoBarDockingStyleChanged(Self); + end; +end; + +procedure TdxBar.SetDockRow(Value: TdxDockRow); +begin + if (FDockRow = Value) or BarManager.IsDestroying then + Exit; + if FDockRow <> nil then FDockRow.DeleteBar(Self, True); + FDockRow := Value; + if Value <> nil then FDockRow.AddBar(Self); +end; + +procedure TdxBar.SetFloatValue(Index: Integer; Value: Integer); +var + PrevValue: Integer; +begin + PrevValue := 0; + case Index of + 1: PrevValue := FFloatLeft; + 2: PrevValue := FFloatTop; + 3: PrevValue := FFloatClientWidth; + 4: PrevValue := FFloatClientHeight; + end; + if PrevValue <> Value then + begin + case Index of + 1: FFloatLeft := Value; + 2: FFloatTop := Value; + 3: FFloatClientWidth := Value; + 4: FFloatClientHeight := Value; + end; + if csUpdating in ComponentState then + FNeedUpdateControlPosition := True + else + UpdateControlPosition; + Changed(False); + end; +end; + +procedure TdxBar.SetFont(Value: TFont); +begin + Font.Assign(Value); +end; + +procedure TdxBar.SetGlyph(Value: TBitmap); +begin + Glyph.Assign(Value); +end; + +procedure TdxBar.SetHidden(Value: Boolean); +begin + if FHidden <> Value then + begin + FHidden := Value; + Changed(False); + end; +end; + +procedure TdxBar.SetIsMainMenu(Value: Boolean); +begin + if FIsMainMenu <> Value then + begin + BarManager.BeginUpdate; + try + if Value and (BarManager.MainMenuBar <> nil) then + BarManager.MainMenuBar.IsMainMenu := False; + FIsMainMenu := Value; + if Value then + begin + BarManager.FMainMenuBar := Self; + WholeRow := True; + MultiLine := True; + end + else + begin + BarManager.FMainMenuBar := nil; + MultiLine := False; + WholeRow := False; + end; + if BarManager.IsLoading then Exit; + if Control <> nil then + if FDockingStyle = dsNone then + Control.CaptionChanged + else + Control.RepaintBar; + Changed(False); + finally + BarManager.EndUpdate; + end; + end; +end; + +procedure TdxBar.SetItemLinks(Value: TdxBarItemLinks); +begin + FItemLinks.Assign(Value); +end; + +procedure TdxBar.SetLockUpdate(Value: Boolean); +begin + if Value <> FLockUpdate then + begin + FLockUpdate := Value; + if FLockUpdate then + BarManager.BeginUpdate + else + BarManager.EndUpdate; + end; +end; + +procedure TdxBar.SetMultiLine(Value: Boolean); +begin + if (FMultiLine <> Value) and (Value or not IsMainMenu) then + begin + FMultiLine := Value; + if (Control <> nil) and (DockingStyle <> dsNone) then + Control.RepaintBar; + end; +end; + +procedure TdxBar.SetName(const NewName: TComponentName); +begin + if FIsNameLocked then + FOldName := NewName + else + inherited SetName(NewName); +end; + +procedure TdxBar.Updated; +begin + inherited Updated; + if FNeedUpdateControlPosition then + UpdateControlPosition; +end; + +procedure TdxBar.Updating; +begin + inherited Updating; + FNeedUpdateControlPosition := False; +end; + +procedure TdxBar.SetNotDocking(Value: TdxBarDockingStyles); +begin + if FNotDocking <> Value then + begin + FNotDocking := Value; + if Control <> nil then Control.RepaintBar; + end; +end; + +procedure TdxBar.SetOneOnRow(Value: Boolean); +begin + if (RealDockControl = nil) or not RealDockControl.IsBarHandleDestroying then + FOneOnRow := Value; +end; + +function TdxBar.CreateControl: TdxBarControl; +begin + Result := GetControlClass.CreateEx(BarManager, Self); + Result.UpdateFont; +end; + +function TdxBar.GetControlClass: TdxBarControlClass; +begin + if RealDockControl <> nil then + Result := RealDockControl.GetDockedBarControlClass + else + Result := TdxBarControl; +end; + +procedure TdxBar.ShowControl; + + function CanShowBar: Boolean; + begin + Result := (DockingStyle <> dsNone) or BarManager.IsOwnerVisible and + (not BarManager.HideFloatingBarsWhenInactive or BarManager.FIsCustomizing or IsFormActive(BarManager.ParentForm)); + end; + +var + P: TPoint; +begin + if DockingStyle <> dsNone then + begin + Control.BeginInternal; + try + Control.ChangeStyleWinTo(DockingStyle, RealDockControl); + P := Point(DockedLeft, DockedTop); + Windows.ClientToScreen(RealDockControl.Handle, P); + Bars.RegInDock(DockingStyle, RealDockControl, Control, P); + finally + Control.EndInternal; + end; + end + else + begin + Control.BeginInternal; + try + Control.ChangeStyleWinTo(DockingStyle, nil); + finally + Control.EndInternal; + end; + P := Control.GetTrackSize(DockingStyle); + Control.SetBounds(FloatLeft, FloatTop, P.X, P.Y); + end; + if CanShowBar then + ShowWindow(Control.Handle, SW_SHOWNA); + BarManager.RemoveBarFromRestoringList(Self); +end; + +class function TdxBar.GetIniSection(const ABaseSection: string; ABarIndex: Integer): string; +begin + Result := ABaseSection + 'Bar' + IntToStr(ABarIndex); +end; + +procedure TdxBar.LoadFromIni(ASource: TCustomIniFile; const ABaseSection: string; + ABarIndex: Integer; AStoringKind: TdxBarStoringKind; AFullLoad: Boolean = True); + + procedure ReadDockControl(const ASection: string); + var + ADockControl: TdxBarDockControl; + begin + ADockControl := BarManager.FindDockControl(ASource.ReadString(ASection, 'DockControl', '')); + if (ADockControl <> nil) or (DockControl <> nil) and DockControl.AllowUndockWhenLoadFromIni then + DockControl := ADockControl; + end; + +var + ASection: string; +begin + ASection := GetIniSection(ABaseSection, ABarIndex); + ItemLinks.LoadFromIni(ASource, ASection, AStoringKind); + if AFullLoad then + try + with ASource do + begin + Caption := ReadString(ASection, 'Caption', Caption); + DockedDockControl := BarManager.FindDockControl(ReadString(ASection, 'DockedDockControl', '')); + DockedDockingStyle := TdxBarDockingStyle(ReadInteger(ASection, 'DockedDockingStyle', Integer(DockedDockingStyle))); + DockedLeft := ReadInteger(ASection, 'DockedLeft', DockedLeft); + DockedTop := ReadInteger(ASection, 'DockedTop', DockedTop); + OneOnRow := ReadBool(ASection, 'OneOnRow', OneOnRow); + FloatLeft := ReadInteger(ASection, 'FloatLeft', FloatLeft); + FloatTop := ReadInteger(ASection, 'FloatTop', FloatTop); + FloatClientWidth := ReadInteger(ASection, 'FloatClientWidth', FloatClientWidth); + FloatClientHeight := ReadInteger(ASection, 'FloatClientHeight', FloatClientHeight); + + ReadDockControl(ASection); + DockingStyle := TdxBarDockingStyle(ReadInteger(ASection, 'DockingStyle', Integer(DockingStyle))); + Row := ReadInteger(ASection, 'Row', Row); + Visible := ReadBool(ASection, 'Visible', False); + MergeData.MergedWith := nil; + end; + except + Visible := True; + end; +end; + +procedure TdxBar.LoadUsageData(ASource: TCustomIniFile; const ABaseSection: string; ABarIndex: Integer); +begin + ItemLinks.LoadUsageData(ASource, GetIniSection(ABaseSection, ABarIndex)); +end; + +procedure TdxBar.SaveToIni(ADestination: TCustomIniFile; const ABaseSection: string; ABarIndex: Integer; AStoringKind: TdxBarStoringKind); +var + ASection: string; + APath: string; +begin + ASection := GetIniSection(ABaseSection, ABarIndex); + with ADestination do + begin + WriteString(ASection, 'Caption', Caption); + if DockControl <> nil then + begin + APath := GetComponentPath(BarManager.Owner, DockControl); + if APath <> '' then + WriteString(ASection, 'DockControl', APath); + end; + if DockedDockControl <> nil then + begin + APath := GetComponentPath(BarManager.Owner, DockedDockControl); + if APath <> '' then + WriteString(ASection, 'DockedDockControl', APath); + end; + WriteInteger(ASection, 'DockedDockingStyle', Ord(DockedDockingStyle)); + WriteInteger(ASection, 'DockedLeft', DockedLeft); + WriteInteger(ASection, 'DockedTop', DockedTop); + WriteInteger(ASection, 'DockingStyle', Ord(DockingStyle)); + WriteInteger(ASection, 'FloatClientHeight', FloatClientHeight); + WriteInteger(ASection, 'FloatClientWidth', FloatClientWidth); + WriteInteger(ASection, 'FloatLeft', FloatLeft); + WriteInteger(ASection, 'FloatTop', FloatTop); + WriteBool(ASection, 'OneOnRow', OneOnRow); + WriteInteger(ASection, 'Row', Row); + if MergeData.MergedWith = nil then + WriteBool(ASection, 'Visible', + Visible or (BarManager.GetBarIndexInRestoringList(Self) <> -1)) + else + WriteBool(ASection, 'Visible', MergeData.VisibleBeforeMerging); + end; + ItemLinks.SaveToIni(ADestination, ASection, AStoringKind); +end; + +procedure TdxBar.InternalMerge(ABar: TdxBar; ASaveMergingBarVisibility: Boolean); +var + AIsBarMerged: Boolean; +begin + if MergeData.MergedWith <> nil then + raise Exception.Create(cxGetResourceString(@dxSBAR_CANTMERGEWITHMERGEDTOOLBAR)); + if (ABar = Self) or (ABar = nil) then + raise Exception.Create(cxGetResourceString(@dxSBAR_CANTMERGETOOLBAR)); + if ABar.MergeData.MergedWith = Self then + raise Exception.Create(Format(cxGetResourceString(@dxSBAR_TOOLBARSALREADYMERGED), [ABar.Caption, Caption])); + if ABar.MergeData.MergedBarList.Count > 0 then + raise Exception.Create(Format(cxGetResourceString(@dxSBAR_TOOLBARHASMERGEDTOOLBARS), [ABar.Caption])); + AIsBarMerged := ABar.MergeData.MergedWith <> nil; + if AIsBarMerged then + ABar.MergeData.MergedWith.InternalUnmergeFromBar(ABar, False); + FMergingWith := ABar; + try + ABar.MergeData.MergedWith := Self; + MergeData.MergedBarList.Add(ABar); + BarManager.BeginUpdate; + try + ItemLinks.Merge(ABar.ItemLinks); + finally + BarManager.EndUpdate; + end; + if not AIsBarMerged and ASaveMergingBarVisibility then + ABar.MergeData.VisibleBeforeMerging := ABar.Visible; + ABar.SetVisibility(False); + finally + FMergingWith := nil; + end; +end; + +procedure TdxBar.InternalUnmergeFromBar(ABar: TdxBar; + ARestoreMergedBarsVisibility: Boolean); + + procedure RestoreMergedBar(ABar: TdxBar); + begin + ABar.MergeData.MergedWith := nil; + MergeData.MergedBarList.Remove(ABar); + if ARestoreMergedBarsVisibility then + ABar.SetVisibility(ABar.MergeData.VisibleBeforeMerging); + end; + + procedure RestoreMergedBars; + var + I: Integer; + begin + if ABar <> nil then + RestoreMergedBar(ABar) + else + for I := MergeData.MergedBarList.Count - 1 downto 0 do + RestoreMergedBar(TdxBar(MergeData.MergedBarList[I])); + end; + +begin + if ABar = Self then + raise Exception.Create(cxGetResourceString(@dxSBAR_CANTUNMERGETOOLBAR)); + if (ABar <> nil) and (ABar.MergeData.MergedWith = nil) then + Exit; + if (ABar <> nil) and (ABar.MergeData.MergedWith <> Self) then + raise Exception.Create(Format(cxGetResourceString(@dxSBAR_TOOLBARSARENOTMERGED), [ABar.Caption, Caption])); + if MergeData.MergedBarList.Count = 0 then + Exit; + + BarManager.BeginUpdate; + try + ItemLinks.Unmerge(ABar); + finally + BarManager.EndUpdate; + end; + RestoreMergedBars; + + if (MergeData.MergedBarList.Count = 0) and MergeData.CreatedByMerging then + if ShouldNotBeDestroyedIfEmptyAfterUnmerge then + begin + MergeData.CreatedByMergingBarVisibleBeforeCustomization := Visible; + SetVisibility(False); + Hidden := True; + end + else + Free; +end; + +procedure TdxBar.InternalUnmergeFromBarManager(ABarManager: TdxBarManager; + ARestoreMergedBarsVisibility: Boolean); +var + ABar: TdxBar; + I: Integer; +begin + for I := MergeData.MergedBarList.Count - 1 downto 0 do + begin + ABar := MergeData.MergedBarList[I]; + if (ABarManager = nil) or (ABar.BarManager = ABarManager) then + InternalUnmergeFromBar(ABar, ARestoreMergedBarsVisibility); + end; +end; + +procedure TdxBar.RestoreMergeState; +var + ABar: TdxBar; + I: Integer; +begin + for I := 0 to MergeData.SavedMergedBarCount - 1 do + begin + ABar := TdxBar(MergeData.SavedMergedBars[I]); + InternalMerge(ABar, ABar.BarManager = BarManager); + end; + MergeData.ClearSavedMergedBarList; +end; + +procedure TdxBar.SaveMergeState; +begin + MergeData.SaveMergedBarList; +end; + +procedure TdxBar.SetVisibility(Value: Boolean); + + procedure SetMDIChildRightWindowRect(out APrevBoundsRect: TRect); + var + AHandle: HWND; + AParentForm: TCustomForm; + R: TRect; + begin + AParentForm := TCustomForm(BarManager.Owner); + if AParentForm.HandleAllocated then + begin + AHandle := AParentForm.Handle; + APrevBoundsRect := AParentForm.BoundsRect; + GetWindowRect(AHandle, R); + MapWindowPoints(0, GetParent(AHandle), R, 2); + TCustomFormAccess(AParentForm).WindowHandle := 0; + AParentForm.BoundsRect := R; + TCustomFormAccess(AParentForm).WindowHandle := AHandle; + end; + end; + + procedure RestoreMDIChildWindowRect(const APrevBoundsRect: TRect); + var + AHandle: HWND; + AParentForm: TCustomForm; + begin + AParentForm := TCustomForm(BarManager.Owner); + if AParentForm.HandleAllocated then + begin + AHandle := AParentForm.Handle; + TCustomFormAccess(AParentForm).WindowHandle := 0; + AParentForm.BoundsRect := APrevBoundsRect; + TCustomFormAccess(AParentForm).WindowHandle := AHandle; + end; + end; + + function IsMDIChildToolbar: Boolean; + begin + Result := (BarManager.Owner is TCustomForm) and + IsMDIChild(TCustomForm(BarManager.Owner)); + end; + +var + APrevBoundsRect: TRect; +begin + if Value <> Visible then + begin + if IsMDIChildToolbar then + SetMDIChildRightWindowRect(APrevBoundsRect); + Visible := Value; + if IsMDIChildToolbar then + RestoreMDIChildWindowRect(APrevBoundsRect); + end; +end; + +procedure TdxBar.CaptionButtonsNotification(Sender: TObject; AItem: TCollectionItem); +begin + if Control <> nil then + Control.UpdateCaptionButtons(TdxBarCaptionButton(AItem)); +end; + +procedure TdxBar.DoChanged; +begin + FChanged := True; +end; + +procedure TdxBar.SetRotateWhenVertical(Value: Boolean); +begin + if FRotateWhenVertical <> Value then + begin + FRotateWhenVertical := Value; + if Control <> nil then Control.Perform(CM_FONTCHANGED, 0, 0); + end; +end; + +procedure TdxBar.SetRow(Value: Integer); +var + ADockRow: TdxDockRow; +begin + if Value < 0 then + Value := 0; + if (Row = Value) and (DockRow <> nil) then + Exit; + FRow := Value; + if RealDockControl <> nil then + begin + if FRow > RealDockControl.RowCount - 1 then + begin + repeat + ADockRow := TdxDockRow.Create(RealDockControl); + RealDockControl.RowList.Add(ADockRow); + until not (BarManager.IsUpdateLocked or BarManager.BarsLoading) or (RealDockControl.RowCount > FRow); + SetDockRow(ADockRow); + end + else + SetDockRow(RealDockControl.RowList[FRow]); + end; + Changed(False); + if RealDockControl <> nil then + RealDockControl.UpdateDock; +end; + +procedure TdxBar.SetShowMark(Value: Boolean); +begin + if FShowMark <> Value then + begin + FShowMark := Value; + if Control <> nil then Control.RepaintBar; + end; +end; + +procedure TdxBar.SetSizeGrip(Value: Boolean); +begin + if FSizeGrip <> Value then + begin + FSizeGrip := Value; + if IsStatusBar and (Control <> nil) then + Control.RebuildBar; + end; +end; + +procedure TdxBar.SetUseOwnFont(Value: Boolean); +begin + if FUseOwnFont <> Value then + begin + FUseOwnFont := Value; + FInternalFontChange := True; + try + if FUseOwnFont then + FontChanged(nil) + else + Font := BarManager.Font; + finally + FInternalFontChange := False; + end; + end; +end; + +procedure TdxBar.SetUseRecentItems(Value: Boolean); +begin + if UseRecentItems <> Value then + begin + FItemLinks.FUseRecentItems := Value; + if Control <> nil then + Control.RepaintBar; + end; +end; + +procedure TdxBar.SetUseRestSpace(Value: Boolean); +begin + if FUseRestSpace <> Value then + begin + FUseRestSpace := Value; + if Control <> nil then Control.RepaintBar; + end; +end; + +procedure TdxBar.SetVisible(Value: Boolean); +begin + if Value and BarManager.IsDestroying then Exit; + if not FVisible and not Value then + BarManager.RemoveBarFromRestoringList(Self); + + if BarManager.IsLoading then + begin + if FVisible <> Value then + FInternallyHidden := False; + FLoadedVisible := Value; + Exit; + end; + if FVisible <> Value then + begin + FInternallyHidden := False; + if not Value and (Control <> nil) then Control.SavePos; + FVisible := Value; + if FVisible then + begin + FItemLinks.CreateBarControl; + ShowControl; + end + else // Visible = False + ItemLinks.DestroyBarControl; + + Changed(False);//#DG + + if not BarManager.IsDestroying and Assigned(BarManager.FOnBarVisibleChange) then + BarManager.FOnBarVisibleChange(BarManager, Self); + end; +end; + +procedure TdxBar.SetWholeRow(Value: Boolean); +begin + if FWholeRow <> Value then + begin + FWholeRow := Value; + if (Control <> nil) and (DockingStyle <> dsNone) then + begin + Visible := False; + Visible := True; + end; + end; +end; + +procedure TdxBar.FontChanged(Sender: TObject); +begin + if not FInternalFontChange then + FUseOwnFont := True; + if FUseOwnFont then + CreateEditFontHandle(Font, FEditFont, False); + if Control <> nil then + Control.UpdateFont; +end; + +procedure TdxBar.Move(X, Y: Integer); +begin + DockingStyle := dsNone; + FloatLeft := X; + FloatTop := Y; +end; + +procedure TdxBar.Move(ADockControl: TdxDockControl; ARow, APosition: Integer); +var + ADockRow: TdxDockRow; + APrevOneOnRow, APrevVisible: Boolean; +begin + if (RealDockControl = nil) and (ADockControl = nil) or + (ADockControl <> nil) and (ADockControl.BarManager <> BarManager) then + Exit; + + if ADockControl = nil then + ADockControl := RealDockControl; + if (ADockControl = RealDockControl) and (ARow = Row) and (APosition = GetDockedPosition) then + Exit; + + APrevOneOnRow := OneOnRow; + APrevVisible := Visible; + Visible := False; + + if BarManager.IsInternalDockControl(ADockControl) then + DockingStyle := ADockControl.DockingStyle + else + FDockControl := TdxBarDockControl(ADockControl); + + if ARow >= ADockControl.RowCount then + begin + ADockRow := TdxDockRow.Create(ADockControl); + ADockControl.RowList.Add(ADockRow); + end; + if ADockControl.Vertical then + DockedTop := APosition + else + DockedLeft := APosition; + Row := ARow; + OneOnRow := APrevOneOnRow; + Visible := APrevVisible; + RealDockControl.AssignPositions; +end; + +procedure TdxBar.Move(ADockingStyle: TdxBarDockedDockingStyle; + ARow, APosition: Integer); +begin + Move(BarManager.InternalDockControls[ADockingStyle], ARow, APosition); +end; + +procedure TdxBar.Move(ABar: TdxBar; AInsertAfter: Boolean = True); +var + APosition: Integer; +begin + if (ABar.RealDockControl = nil) or (ABar.BarManager <> BarManager) or + AInsertAfter and (ABar.Control = nil) then + Exit; + APosition := ABar.GetDockedPosition; + if AInsertAfter then + if ABar.IsVertical then + Inc(APosition, ABar.Control.Height) + else + Inc(APosition, ABar.Control.Width); + OneOnRow := False; + Move(ABar.RealDockControl, ABar.Row, APosition); +end; + +procedure TdxBar.UpdateControlPosition; +var + P: TPoint; +begin + if (Control <> nil) and not Bars.IsMoving and not Control.FPosSaving then + if DockingStyle = dsNone then + begin + P := Control.GetTrackSize(dsNone); + Control.SetBounds(FloatLeft, FloatTop, P.X, P.Y); + end + else + begin + if DockRow <> nil then + DockRow.DeleteCol(Control); + ShowControl; + end; +end; + +function TdxBar.IsDockedDockingStyleStored: Boolean; +begin + Result := FDockedDockControl = nil; +end; + +function TdxBar.IsDockingStyleStored: Boolean; +begin + Result := FDockControl = nil; +end; + +procedure TdxBar.AddFreeNotification(AItem: TdxBarItem); +begin + FFreeNotificationItems.Add(AItem); +end; + +procedure TdxBar.RemoveFreeNotification(AItem: TdxBarItem); +begin + FFreeNotificationItems.Remove(AItem); +end; + +procedure TdxBar.MakeFreeNotification; +var + I: Integer; +begin + for I := FFreeNotificationItems.Count - 1 downto 0 do + TdxBarItem(FFreeNotificationItems[I]).ObjectNotification(opRemove, Self); +end; + +procedure TdxBar.RemoveFromDockRow(ADestroyEmptyDockRow: Boolean); +begin + if FDockRow <> nil then + FDockRow.DeleteBar(Self, ADestroyEmptyDockRow); + FDockRow := nil; +end; + +function TdxBar.BarNCSizeX(AStyle: TdxBarDockingStyle): Integer; +begin + with Painter.GetToolbarContentOffsets(Self, AStyle, HasSizeGrip) do + Result := Left + Right; +end; + +function TdxBar.BarNCSizeY(AStyle: TdxBarDockingStyle): Integer; +begin + with Painter.GetToolbarContentOffsets(Self, AStyle, HasSizeGrip) do + Result := Top + Bottom; +end; + +function TdxBar.CanClose: Boolean; +begin + Result := FAllowClose and not FIsMainMenu and + ((Control = nil) or Control.HasCaption); +end; + +function TdxBar.CanMoving: Boolean; +const + AllDockingStyles = [Low(TdxBarDockingStyle)..High(TdxBarDockingStyle)]; +begin + Result := (NotDocking <> AllDockingStyles) and + (BarManager.NotDocking <> AllDockingStyles); +end; + +function TdxBar.CanReset: Boolean; +begin + Result := FIsPredefined and FAllowReset; +end; + +function TdxBar.GetDockedPosition: Integer; +begin + if IsVertical then + Result := DockedTop + else + Result := DockedLeft; +end; + +function TdxBar.HasSizeGrip: Boolean; +var + Parent: HWND; + R, CR: TRect; + + function FindForm(AHandle: HWND): TCustomForm; + var + AControl: TWinControl; + begin + AControl := FindControl(AHandle); + if AControl is TCustomForm then + Result := TCustomForm(AControl) + else + Result := nil; + end; + + function IsBottom(AHandle: HWND): Boolean; + begin + Parent := GetParent(AHandle); + Result := (Parent = 0) or IsMDIChild(FindForm(AHandle)); + if not Result then + begin + GetWindowRect(AHandle, R); + MapWindowRect(0, Parent, R); + GetClientRect(Parent, CR); + Result := (R.Bottom = CR.Bottom) and IsBottom(Parent); + end; + end; + +begin + Result := IsStatusBar and SizeGrip and not IsZoomed(BarManager.Owner.Handle) and + ((Control = nil) or IsBottom(Control.Handle)); +end; + +function TdxBar.IsFloat: Boolean; +begin + Result := (Control <> nil) and (DockingStyle = dsNone); +end; + +function TdxBar.IsShortCut(AShortCut: TShortCut): Boolean; +begin + Result := FItemLinks.IsShortCut(AShortCut); +end; + +function TdxBar.IsStatusBar: Boolean; +begin + Result := (FBorderStyle = bbsNone) and (DockingStyle = dsBottom) and + WholeRow; // !!! +end; + +//IdxBarSelectableItem +function TdxBar.CanDelete(ADestruction: Boolean = False): Boolean; +begin + Result := (BarManager.Designing or not IsPredefined and CanClose) and + BarManager.CanDeleteComponent(Self); +end; + +procedure TdxBar.DeleteSelection(var AReference: IdxBarSelectableItem; ADestruction: Boolean); +begin + if CanDelete(ADestruction) then + begin + AReference := nil; + Free; + end; +end; + +procedure TdxBar.ExecuteCustomizationAction(ABasicAction: TdxBarCustomizationAction); +begin +// do nothing +end; + +function TdxBar.GetBarManager: TdxBarManager; +begin + Result := TdxBarManager(GetParentComponent); +end; + +procedure TdxBar.GetMasterObjects(AList: TdxObjectList); +begin + AList.Add(BarManager.Owner); +end; + +function TdxBar.GetNextSelectableItem: IdxBarSelectableItem; +begin + Result := GetNext; +end; + +function TdxBar.GetSelectableParent: TPersistent; + + function FindSelectableParent(AControl: TWinControl): TWinControl; + begin + Result := nil; + while (AControl <> nil) and (Result = nil) do + if GetClass(AControl.ClassName) <> nil then + Result := AControl + else + AControl := AControl.Parent; + end; + +begin + Result := FindSelectableParent(DockControl); + if Result = nil then + Result := BarManager.Owner; +end; + +function TdxBar.GetSelectionStatus: TdxBarSelectionStatus; +begin + Result := BarManager.GetSelectionStatus(Self); +end; + +function TdxBar.GetSupportedActions: TdxBarCustomizationActions; +begin + Result := [caDelete]; +end; + +procedure TdxBar.Invalidate; +begin + if Control <> nil then + Control.Invalidate; +end; + +function TdxBar.IsComplex: Boolean; +begin + Result := False; +end; + +function TdxBar.IsComponentSelected: Boolean; +begin + Result := BarManager.IsComponentSelected(Self); +end; + +procedure TdxBar.SelectComponent(ASelectionOperation: TdxBarSelectionOperation = soExclusive); +begin + BarManager.SelectComponent(Self, ASelectionOperation); +end; + +function TdxBar.SelectParentComponent: Boolean; +begin + BarManager.SelectComponent(GetSelectableParent); + Result := True; +end; + +procedure TdxBar.SelectionChanged; +begin + BarDesignController.SynchronizeLastSelectedItem; + Invalidate; +end; + +// IdxBarLinksOwner +function TdxBar.CanContainItem(AItem: TdxBarItem; + out AErrorText: string): Boolean; +begin + Result := AItem.CanBePlacedOn(pkBar, Self, AErrorText); +end; + +function TdxBar.CreateBarControl: TCustomdxBarControl; +begin + Result := CreateControl; +end; + +function TdxBar.GetItemLinks: TdxBarItemLinks; +begin + Result := FItemLinks; +end; + +function TdxBar.GetComponentInstance: TComponent; +begin + Result := Self; +end; + +function TdxBar.GetPersistentInstance: TPersistent; +begin + Result := Self; +end; + +procedure TdxBar.ChangeDockingStyle(AStyle: TdxBarDockingStyle; + ADockControl: TdxDockControl); +begin + if (ADockControl <> nil) and ADockControl.Main then + ADockControl := nil; + if DockingStyle = AStyle then + DockControl := TdxBarDockControl(ADockControl) + else + if DockControl = ADockControl then + DockingStyle := AStyle + else + if ADockControl = nil then + DockingStyle := AStyle + else + DockControl := TdxBarDockControl(ADockControl); +end; + +function TdxBar.GetCollectionFromParent(AParent: TComponent): TcxComponentCollection; +begin + Result := (AParent as TdxBarManager).Bars; +end; + +function TdxBar.IsVertical: Boolean; +begin + Result := (DockingStyle in [dsLeft, dsRight]) and RotateWhenVertical; +end; + +procedure TdxBar.Reset; + + procedure InternalReset(ASource: TCustomIniFile; const ABaseSection: string; ABarIndex: Integer); + begin + ResettingToolbar := True; + try + LoadFromIni(ASource, ABaseSection, ABarIndex, skIni, BarManager.UseFullReset); + LoadUsageData(ASource, ABaseSection, ABarIndex); + ItemLinks.CheckLinks(ASource, ABaseSection); + finally + ResettingToolbar := False; + end; + end; + +var + ABarIndex: Integer; + APrevVisible: Boolean; +begin + ABarIndex := BarManager.GetSavedBarIndex(Caption); + if ABarIndex <> -1 then + begin + BarManager.DoBarBeforeReset(Self); + BarManager.BeginUpdate; + try + APrevVisible := Visible; + if BarManager.UseFullReset then + Visible := False; + try + InternalReset(BarManager.SavedState, BarManager.GetBaseIniSection, ABarIndex); + finally + if BarManager.UseFullReset then + Visible := APrevVisible; + end; + finally + BarManager.EndUpdate; + end; + BarManager.DoBarAfterReset(Self); + end; +end; + +procedure TdxBar.ResetWithConfirmation; +begin + if dxBarMessageBox(Format(cxGetResourceString(@dxSBAR_WANTTORESETTOOLBAR), [Caption]), + MB_OKCANCEL or MB_ICONEXCLAMATION) = ID_OK then + Reset; +end; + +procedure TdxBar.SetParentComponent(AParent: TComponent); +begin + inherited SetParentComponent(AParent); + FItemLinks := TdxBarControlItemLinks.Create(BarManager, Self); + Font.OnChange := nil; + Font.Assign(BarManager.Font); + Font.OnChange := FontChanged; + if not BarManager.IsLoading then + begin + if Assigned(BarManager.OnBarAdd) then + BarManager.OnBarAdd(BarManager, Self); + Changed(False); + end; +end; + +procedure TdxBar.Merge(ABar: TdxBar); +begin + InternalMerge(ABar, True); +end; + +procedure TdxBar.Unmerge(ABar: TdxBar = nil); +begin + InternalUnmergeFromBar(ABar, True); +end; + +{ TdxBars } + +constructor TdxBars.Create(ABarManager: TdxBarManager); +var + ADockingStyle: TdxBarDockingStyle; +begin + inherited Create(ABarManager, TdxBar); + FBarManager := ABarManager; + FDockingZoneSize := MinToolbarSize; + for ADockingStyle := dsLeft to dsBottom do + begin + FDockControls[ADockingStyle] := TdxDockControl.CreateEx(nil, FBarManager, ADockingStyle); + FDockControls[ADockingStyle].Parent := FBarManager.Owner; + end; +end; + +destructor TdxBars.Destroy; +var + I: TdxBarDockingStyle; +begin + for I := dsLeft to dsBottom do + begin + FDockControls[I].Free; + FDockControls[I] := nil; + end; + inherited; +end; + +function TdxBars.GetDockControl(Index: TdxBarDockingStyle): TdxDockControl; +begin + Result := FDockControls[Index]; +end; + +function TdxBars.GetItem(Index: Integer): TdxBar; +begin + Result := TdxBar(inherited Items[Index]); +end; + +procedure TdxBars.SetItem(Index: Integer; Value: TdxBar); +begin + Items[Index].Assign(Value); +end; + +{ +function TdxBars.GetOwner: TPersistent; +begin + Result := FBarManager; +end; +} + +procedure TdxBars.RegInDock(AStyle: TdxBarDockingStyle; ADockControl: TdxDockControl; + ABarControl: TdxBarControl; APos: TPoint); +begin + if ADockControl <> nil then + ADockControl.AddBarControl(ABarControl, APos, True) + else + if (AStyle <> dsNone) and (FDockControls[AStyle] <> nil) then + FDockControls[AStyle].AddBarControl(ABarControl, APos, True); +end; + +procedure TdxBars.UnregFromDock(AStyle: TdxBarDockingStyle; + ADockControl: TdxDockControl; ABarControl: TdxBarControl); +begin + if ADockControl <> nil then + ADockControl.DeleteBarControl(ABarControl, nil, True) + else + if (AStyle <> dsNone) and (FDockControls[AStyle] <> nil) then + FDockControls[AStyle].DeleteBarControl(ABarControl, nil, True); +end; + +procedure DockTimerProc(Wnd: HWND; Msg: UINT; idEvent: UINT; Time: DWORD); stdcall; +var + P: TPoint; +begin + dxKillTimer(0, FDockTimerID); + if FDockBarManager <> nil then + with FDockBarManager.Bars do + begin + P := GetMouseCursorPos; + Inc(P.X, FMovingOffset.X); + Inc(P.Y, FMovingOffset.Y); + FDocking := True; + ChangeBarControlPos(FMovingBarControl, P); + FDocking := False; + FDockBarManager := nil; + end; +end; + +procedure TdxBars.ChangeBarControlPos(ABarControl: TdxBarControl; APos: TPoint); +var + AStyle: TdxBarDockingStyle; + ADockControl: TdxDockControl; + ASize: TPoint; +begin + AStyle := GetDockingStyleAtPos(ABarControl.Bar, APos, ADockControl); + if not FBarManager.DoDocking(ABarControl.Bar, AStyle, ADockControl) then Exit; + + if not FDocking and (ABarControl.DockingStyle = dsNone) and (AStyle <> dsNone) then + begin + dxKillTimer(0, FDockTimerID); + FDockBarManager := BarManager; + FDockTimerID := SetTimer(0, 0, BarManager.WaitForDockingTime, @DockTimerProc); + ADockControl := nil; + AStyle := dsNone; + end; + + if AStyle = dsNone then + begin + Dec(APos.X, FMovingOffset.X); + Dec(APos.Y, FMovingOffset.Y); + end; + if (ABarControl.DockingStyle <> AStyle) or + (ABarControl.DockControl <> ADockControl) then + begin + ABarControl.Hide; + if ABarControl.DockingStyle <> dsNone then + begin + UnregFromDock(ABarControl.DockingStyle, ABarControl.DockControl, ABarControl); + ABarControl.ItemLinks.RecentItemCount := -1; + end; + if AStyle <> dsNone then + begin + with ABarControl do + begin + BeginInternal; //!!! + try + ChangeStyleWinTo(AStyle, ADockControl); + finally + EndInternal; + end; + end; + RegInDock(AStyle, ADockControl, ABarControl, APos); + end + else + with ABarControl do + begin + BeginInternal; // for WMSize + try + ChangeStyleWinTo(AStyle, nil); + finally + EndInternal; + end; + ASize := GetTrackSize(AStyle); + with GetDragPointOffset(AStyle) do + SetWindowPos(Handle, 0, APos.X - X, APos.Y - Y, ASize.X, ASize.Y, + SWP_NOZORDER or SWP_NOACTIVATE); + end; + Windows.ShowWindow(ABarControl.Handle, SW_SHOWNA); + end + else + if ABarControl.DockingStyle <> dsNone then + ADockControl.MoveBarControl(ABarControl, APos) + else + with ABarControl, GetDragPointOffset(AStyle) do + SetWindowPos(Handle, 0, APos.X - X, APos.Y - Y, 0, 0, + SWP_NOZORDER or SWP_NOSIZE or SWP_NOACTIVATE); +end; + +function TdxBars.GetDockingStyleAtPos(Bar: TdxBar; Pos: TPoint; + var DockControl: TdxDockControl): TdxBarDockingStyle; +var + ADockControl: TdxDockControl; + + function PtInControlRect(ADockControl: TWinControl; const R: TRect; P: TPoint): Boolean; + var + AParent: TWinControl; + begin + Result := PtInRect(R, P); + if Result and ADockControl.HandleAllocated and + (ADockControl.Parent <> nil) and (ADockControl.Parent.Parent <> nil) then + begin + AParent := ADockControl.Parent.Parent; + P := AParent.ScreenToClient(P); + Result := ADockControl.Parent.Handle = + ChildWindowFromPointEx(AParent.Handle, P, CWP_SKIPINVISIBLE); + end; + end; + + function CheckDockZone(ADockingStyle: TdxBarDockingStyle): Boolean; + var + I: Integer; + begin + Result := False; + for I := 0 to FBarManager.DockControlCount - 1 do + begin + ADockControl := FBarManager.DockControls[I]; + with ADockControl do + if (DockingStyle = ADockingStyle) and (CanFocus or BarManager.Designing) then + begin + Result := + FBarManager.DoDocking(Bar, ADockingStyle, ADockControl) and + PtInControlRect(ADockControl, GetDockZoneBounds, Pos); + if Result then Break; + end; + end; + if Result then + begin + DockControl := ADockControl; + GetDockingStyleAtPos := ADockingStyle; + end; + end; + +begin + DockControl := nil; + Result := dsNone; + + if FMoving and (GetAsyncKeyState(VK_CONTROL) < 0) then Exit; + + if CheckDockZone(dsLeft) then Exit; + if CheckDockZone(dsRight) then Exit; + if CheckDockZone(dsTop) then Exit; + if CheckDockZone(dsBottom) then Exit; + + if FMoving then + begin + Dec(Pos.X, FMovingOffset.X); + Dec(Pos.Y, FMovingOffset.Y); + end; + if CheckDockZone(dsLeft) then Exit; + if CheckDockZone(dsRight) then Exit; + if CheckDockZone(dsTop) then Exit; + if CheckDockZone(dsBottom) then Exit; +end; + +procedure TdxBars.Moving(AMovingBarControl: TdxBarControl); +var + CaptureWnd: HWND; + Msg: TMsg; + PrevP, CalcP, P: TPoint; +begin + // --- + if not AMovingBarControl.CanMoving then Exit; + + with AMovingBarControl, Bar do + if DockingStyle <> dsNone then + GetDockCol.FPos := Point(DockedLeft, DockedTop); + + FMoving := True; + AMovingBarControl.Moving := True; + + PrevP := GetMouseCursorPos; + + FMovingBarOriginalDockingStyle := FMovingBarControl.DockingStyle; + FMovingOffset := cxNullPoint; + FMovingStaticOffset := cxNullPoint; + with FMovingBarControl, Bar do + if DockingStyle <> dsNone then + begin + P := GetDockCol.Pos; + Windows.ClientToScreen(RealDockControl.Handle, P); + + RealDockControl.DeleteBarControl(Control, nil, False); + CalcP := PrevP; + RealDockControl.GetPosForRow(Row, OneOnRow, CalcP); + if Control.Vertical then + FMovingOffset.X := CalcP.X - PrevP.X + else + FMovingOffset.Y := CalcP.Y - PrevP.Y; + Control.BeginInternal; + try + RealDockControl.AddBarControl(Control, P, False); + finally + Control.EndInternal; + end; + + FMovingStaticOffset := Point(Left, Top); + Windows.ClientToScreen(RealDockControl.Handle, FMovingStaticOffset); + with FMovingStaticOffset do + begin + X := PrevP.X - X; + Y := PrevP.Y - Y; + end; + end; + + ProcessPaintMessages; + + Include(BarDesignController.FDesignStates, dsKeyAlreadyProcessed); + CaptureWnd := BarManager.GetWindowForMouseCapturing; + SetCapture(CaptureWnd); + try + while GetCapture = CaptureWnd do + begin + case Integer(GetMessage(Msg, 0, 0, 0)) of + -1: Break; + 0: begin + PostQuitMessage(Msg.wParam); + Break; + end; + end; + with Msg do + if ((message = WM_KEYDOWN) or (message = WM_KEYUP)) and + (wParam = VK_CONTROL) then + begin + message := WM_MOUSEMOVE; + hwnd := 0; + lParam := Windows.LPARAM(PointToSmallPoint(GetMouseCursorPos)); + PrevP := cxInvalidPoint; + end; + case Msg.message of + WM_KEYDOWN, WM_KEYUP: + if Msg.wParam = VK_ESCAPE then Break; + WM_MOUSEMOVE: + begin + P := SmallPointToPoint(TSmallPoint(Msg.lParam)); + ClientToScreen(Msg.hwnd, P); + if (P.X <> PrevP.X) or (P.Y <> PrevP.Y) then + begin + CalcP := P; + Inc(CalcP.X, FMovingOffset.X); + Inc(CalcP.Y, FMovingOffset.Y); + ChangeBarControlPos(FMovingBarControl, CalcP); + //ProcessPaintMessages; + PrevP := P; + end; + end; + WM_LBUTTONUP: + Break; + else + TranslateMessage(Msg); + DispatchMessage(Msg); + end; + end; + finally + if dxKillTimer(0, FDockTimerID) then + FDockBarManager := nil; + if GetCapture = CaptureWnd then ReleaseCapture; + AMovingBarControl := FMovingBarControl; + FMovingBarControl.Moving := False; + if AMovingBarControl.DockingStyle <> dsNone then + AMovingBarControl.DockControl.AssignPositions; + FMoving := False; + Exclude(BarDesignController.FDesignStates, dsKeyAlreadyProcessed); + end; +end; + +procedure TdxBars.Repaint; +var + I: Integer; +begin + for I := 0 to Count - 1 do + with Items[I] do + if Control <> nil then + Control.RepaintBar; +end; + +procedure TdxBars.SetItemName(AItem: TcxComponentCollectionItem); +begin + AItem.Name := GetUniqueToolBarName(BarManager.Name + 'Bar'); +end; + +procedure TdxBars.Update(AItem: TcxComponentCollectionItem; AAction: TcxComponentCollectionNotification); +begin + inherited; + if AAction = ccnChanged then + BarManager.DesignerModified; //#DG +end; + +function TdxBars.Add: TdxBar; +begin + Result := TdxBar(inherited Add); +end; + +function TdxBars.GetUniqueToolbarName(const ABaseName: string): string; +begin + Result := BarManager.GetUniqueToolbarName(ABaseName); +end; + +function TdxBars.Insert(Index: Integer): TdxBar; +begin + Result := TdxBar(inherited Insert(Index)); +end; + +{ TdxBarItemOptions } + +constructor TdxBarItemOptions.Create(AItemLinks: TdxBarItemLinks); +begin + inherited Create; + FItemLinks := AItemLinks; + + FShowDescriptions := GetDefaultValue(ioShowDescriptions); + FShowShortCuts := GetDefaultValue(ioShowShortCuts); + FSize := GetDefaultValue(ioSize); +end; + +procedure TdxBarItemOptions.Assign(Source: TPersistent); +begin + if Source is TdxBarItemOptions then + begin + FAssignedValues := TdxBarItemOptions(Source).FAssignedValues; + FShowDescriptions := TdxBarItemOptions(Source).FShowDescriptions; + FShowShortCuts := TdxBarItemOptions(Source).FShowShortCuts; + FSize := TdxBarItemOptions(Source).FSize; + end + else + inherited; +end; + +function TdxBarItemOptions.GetAssignedValues: TdxBarItemOptionValues; +begin + Result := FAssignedValues; +end; + +function TdxBarItemOptions.GetDefaultValue(AOption: TdxBarItemOptionValue): Variant; +begin + Result := FItemLinks.GetDefaultValue(AOption); +end; + +function TdxBarItemOptions.GetValue(AOption: TdxBarItemOptionValue): Variant; +begin + case AOption of + ioShowDescriptions: Result := ShowDescriptions; + ioShowShortCuts: Result := ShowShortCuts; + else {ioSize} + Result := Size; + end; +end; + +function TdxBarItemOptions.GetShowDescriptions: Boolean; +begin + if IsShowDescriptionsStored then + Result := FShowDescriptions + else + Result := GetDefaultValue(ioShowDescriptions); +end; + +function TdxBarItemOptions.GetShowShortCuts: Boolean; +begin + if IsShowShortCutsStored then + Result := FShowShortCuts + else + Result := GetDefaultValue(ioShowShortCuts); +end; + +function TdxBarItemOptions.GetSize: TdxBarMenuItemSize; +begin + if IsSizeStored then + Result := FSize + else + Result := GetDefaultValue(ioSize); +end; + +procedure TdxBarItemOptions.SetAssignedValues(AValue: TdxBarItemOptionValues); +begin + FAssignedValues := AValue; +{ + if FAssignedValues <> AValue then + begin + FAssignedValues := AValue; + if not IsValueStored(ioShowDescriptions) then + FShowDescriptions := GetDefaultValue(ioShowDescriptions); + if not IsValueStored(ioShowShortCuts) then + FShowShortCuts := GetDefaultValue(ioShowShortCuts); + if not IsValueStored(ioSize) then + FSize := GetDefaultValue(ioSize); + end; +} +end; + +procedure TdxBarItemOptions.SetShowDescriptions(AValue: Boolean); +begin + FShowDescriptions := AValue; + Include(FAssignedValues, ioShowDescriptions); +end; + +procedure TdxBarItemOptions.SetShowShortCuts(AValue: Boolean); +begin + FShowShortCuts := AValue; + Include(FAssignedValues, ioShowShortCuts); +end; + +procedure TdxBarItemOptions.SetSize(AValue: TdxBarMenuItemSize); +begin + FSize := AValue; + Include(FAssignedValues, ioSize); +end; + +function TdxBarItemOptions.IsValueStored(AOption: TdxBarItemOptionValue): Boolean; +begin + Result := AOption in AssignedValues; +end; + +function TdxBarItemOptions.IsShowDescriptionsStored: Boolean; +begin + Result := IsValueStored(ioShowDescriptions); +end; + +function TdxBarItemOptions.IsShowShortCutsStored: Boolean; +begin + Result := IsValueStored(ioShowShortCuts) +end; + +function TdxBarItemOptions.IsSizeStored: Boolean; +begin + Result := IsValueStored(ioSize); +end; + +{ TdxBarItemLink } + +constructor TdxBarItemLink.Create(Collection: TCollection); +begin + inherited Create(Collection); + FButtonGroup := bgpNone; + FLoadedRecentIndex := -1; + FLoadedVisible := True; + FMostRecentlyUsed := True; + FPosition := ipBeginsNewRow; + FUseCount := BarManager.FMostRecentlyUsedUseCount; + FUserGlyph := dxBarCreateBitmap(OnUserGlyphChanged); + FViewLevels := dxBarItemAllViewLevels; + FVisible := True; + AddToRecentList; + if not BarManager.IsLoading and Assigned(BarManager.FOnItemLinkAdd) then + BarManager.FOnItemLinkAdd(BarManager, Self); +end; + +destructor TdxBarItemLink.Destroy; +var + ABarControl: TCustomdxBarControl; +begin + if not BarManager.IsDestroying and + Assigned(BarManager.FOnItemLinkDelete) then + BarManager.FOnItemLinkDelete(BarManager, Self); + ABarControl := BarControl; + + if FControl <> nil then + begin + if (ABarControl <> nil) and not ABarControl.IsDestroying then + begin + if ABarControl.SelectedControl = FControl then + begin + BarManager.InternalSetSelectedItem(nil); + ABarControl.SelectedControl := nil; + end; + if BarControl.FPrevTrackedLink = Self then + BarControl.FPrevTrackedLink := nil; + end; + DestroyControl; + end; // obsolete + if BarDesignController <> nil then + BarDesignController.DropSelection(Self); + if FItem <> nil then FItem.FLinks.Remove(Self); + FreeAndNil(FUserGlyph); + + RemoveFromRecentList; + inherited Destroy; + +{ if (ABarControl <> nil) and ABarControl.HandleAllocated and + not ABarControl.IsDestroying then + begin + ABarControl.RepaintBar; + if Assigned(AItemLinks.FOnChange) then AItemLinks.FOnChange(AItemLinks); + end;} +end; + +function TdxBarItemLink.GetAllowedViewLevels: TdxBarItemViewLevels; +begin + Result := ViewLevels; +end; + +function TdxBarItemLink.GetAvailableIndex: Integer; +begin + if Owner = nil then + Result := -1 + else + Result := Owner.AvailableIndexOf(Self); +end; + +function TdxBarItemLink.GetBarControl: TCustomdxBarControl; +begin + Result := Owner.FBarControl; +end; + +function TdxBarItemLink.GetBeginGroup: Boolean; +var + AVisibleIndex: Integer; + + function NeedShowHiddenBeginGroup: Boolean; + begin + Result := not((Control <> nil) and + (bboExtendItemWhenAlignedToClient in Control.Parent.BehaviorOptions) and + (Control.Align in [iaCenter, iaRight])); + end; + + function HiddenBeginGroupExists: Boolean; + var + I: Integer; + begin + for I := Owner.VisibleItems[AVisibleIndex - 1].Index + 1 to Index - 1 do + begin + Result := Owner[I].BeginGroup; + if Result then Exit; + end; + Result := False; + end; + +begin + AVisibleIndex := VisibleIndex; + Result := FBeginGroup and (AVisibleIndex <> 0) or + (AVisibleIndex > 0) and NeedShowHiddenBeginGroup and HiddenBeginGroupExists; +end; + +function TdxBarItemLink.GetCanVisibleIndex: Integer; +begin + if Owner = nil then + Result := -1 + else + Result := Owner.CanVisibleIndexOf(Self); +end; + +function TdxBarItemLink.GetCaption: string; +begin + if not (udCaption in FUserDefine) and (FItem <> nil) then + Result := FItem.Caption + else + Result := FUserCaption; +end; + +function TdxBarItemLink.GetCollection: TdxBarItemLinks; +begin + Result := TdxBarItemLinks(inherited Collection); +end; + +function TdxBarItemLink.GetGlyph: TBitmap; +begin + if not (udGlyph in FUserDefine) and (FItem <> nil) then + Result := FItem.Glyph + else + Result := FUserGlyph; +end; + +function TdxBarItemLink.GetNext: TdxBarItemLink; +begin + if Collection.Next(Self, True) <> Self then + Result := Collection.Next(Self, True) + else + Result := nil; +end; + +function TdxBarItemLink.GetOwnerValue: TdxBarItemLinks; +begin + Result := Collection; +end; + +function TdxBarItemLink.GetPaintStyle: TdxBarPaintStyle; +begin + if not (udPaintStyle in FUserDefine) and (FItem <> nil) then + Result := FItem.PaintStyle + else + Result := FUserPaintStyle; +end; + +function TdxBarItemLink.GetUserDefine: TdxBarUserDefines; +begin + Result := FUserDefine; +end; + +function TdxBarItemLink.GetVisibleIndex: Integer; +begin + if Owner = nil then + Result := -1 + else + Result := Owner.VisibleIndexOf(Self); +end; + +function TdxBarItemLink.GetWidth: Integer; +begin + if udWidth in FUserDefine then + Result := FUserWidth + else + if Item is TdxCustomBarEdit then + Result := TdxCustomBarEdit(Item).Width + else + Result := 0 +end; + +procedure TdxBarItemLink.ReadItemName(AReader: TReader); +begin + FLoadedItemName := AReader.ReadString; +end; + +procedure TdxBarItemLink.SetBeginGroup(Value: Boolean); +begin + if FBeginGroup <> Value then + begin + FBeginGroup := Value; + if Control <> nil then Control.BeginGroupChanged; + Changed(False); +//#DG ItemLinkChanged; + end; +end; + +procedure TdxBarItemLink.SetButtonGroup(Value: TdxBarButtonGroupPosition); +begin + if Value <> FButtonGroup then + begin + FButtonGroup := Value; + Changed(True); + end; +end; + +procedure TdxBarItemLink.SetCollection(Value: TdxBarItemLinks); +begin + inherited Collection := Value; +end; + +procedure TdxBarItemLink.SetItem(Value: TdxBarItem); +var + AErrorText: string; +begin + if FItem <> Value then + begin + Owner.BeginUpdate; + try + DestroyControl; + if FItem <> nil then FItem.FLinks.Remove(Self); + FItem := nil; + if Value <> nil then + begin + try + if not Owner.CanContainItem(Value, AErrorText) then + raise Exception.Create(AErrorText); + FItem := Value; + FItem.FLinks.Add(Self); + Owner.RefreshVisibilityLists; + if (Owner.Owner <> nil) and not (csLoading in Owner.Owner.ComponentState) then + CheckMostRecentlyUsed; + finally + if Owner.UpdateCount = 1 then + BarManager.DoItemLinkChange(Self); // TdxBarItemLink.SetItem should fire OnItemLinkChange for compatibility with Bars5 + end; + end + else + Free; + finally + Owner.EndUpdate; + end; +//#DG if (Owner.UpdateCount = 0) and (BarControl <> nil) then BarControl.RepaintBar; + end; +end; + +procedure TdxBarItemLink.SetItemRect(Value: TRect); +begin + FItemRect := Value; + if Control <> nil then + Control.DoCalculateParts; +end; + +procedure TdxBarItemLink.SetMostRecentlyUsed(Value: Boolean); +begin + if FMostRecentlyUsed <> Value then + begin + FMostRecentlyUsed := Value; + CheckMostRecentlyUsed; + if BarControl <> nil then BarControl.RepaintBar; + Changed(False); //#DG +//#DG ItemLinkChanged; + end; +end; + +procedure TdxBarItemLink.SetPosition(Value: TdxBarItemPosition); +begin + if Value <> FPosition then + begin + FPosition := Value; + Changed(True); + end; +end; + +procedure TdxBarItemLink.ForceSetUserDefine(AValue: TdxBarUserDefine); +begin + FUserDefine := FUserDefine - [AValue]; + UserDefine := UserDefine + [AValue]; +end; + +procedure TdxBarItemLink.SetUserDefine(Value: TdxBarUserDefines); + + procedure ExcludeProperty(AProperty: TdxBarUserDefine); + begin + Exclude(FUserDefine, AProperty); + case AProperty of + udCaption: FUserCaption := ''; + udGlyph: FUserGlyph.Assign(nil); + udPaintStyle: FUserPaintStyle := psStandard; + udWidth: FUserWidth := 0; + end; + end; + + function CheckChanges(AProperty: TdxBarUserDefine): Boolean; + begin + Result := True; + if (AProperty in FUserDefine) and not(AProperty in Value) then + ExcludeProperty(AProperty) + else + if not(AProperty in FUserDefine) and (AProperty in Value) then + Include(FUserDefine, AProperty) + else + Result := False; + end; + + procedure PropertyChanged(AProperty: TdxBarUserDefine); + begin + if Control <> nil then + case AProperty of + udCaption: Control.CaptionChanged; + udGlyph: Control.GlyphChanged; + udPaintStyle: Control.PaintStyleChanged; + udWidth: Control.WidthChanged; + end; + end; + +var + AProperty: TdxBarUserDefine; +begin + if FUserDefine <> Value then + begin + for AProperty := Low(TdxBarUserDefine) to High(TdxBarUserDefine) do + if CheckChanges(AProperty) then + PropertyChanged(AProperty); + + Changed(False); //#DG + end; +end; + +procedure TdxBarItemLink.SetUserCaption(const Value: string); +begin + if FUserCaption <> Value then + begin + FUserCaption := Value; + ForceSetUserDefine(udCaption); + end; +end; + +procedure TdxBarItemLink.SetUserGlyph(Value: TBitmap); +begin + if FUserGlyph <> Value then + begin + FUserGlyph.Assign(Value); + ForceSetUserDefine(udGlyph); + end; +end; + +procedure TdxBarItemLink.SetUserPaintStyle(Value: TdxBarPaintStyle); +begin + if PaintStyle <> Value then + begin + FUserPaintStyle := Value; + ForceSetUserDefine(udPaintStyle); + end; +end; + +procedure TdxBarItemLink.SetUserWidth(Value: Integer); +begin + if Width <> Value then + begin + FUserWidth := Value; + ForceSetUserDefine(udWidth); + end; +end; + +procedure TdxBarItemLink.SetViewLevels(Value: TdxBarItemViewLevels); +begin + if Value <> FViewLevels then + begin + FViewLevels := Value; + Changed(True); + end; +end; + +procedure TdxBarItemLink.SetVisible(Value: Boolean); +begin + if BarManager.IsLoading or Owner.FAssigning then + begin + FLoadedVisible := Value; + Exit; + end; + if FVisible <> Value then + begin + FVisible := Value; + if not BarManager.Designing then + begin + Owner.RefreshVisibilityLists; + if Value then + begin + BringToTopInRecentList(False); + if BarControl <> nil then + begin + CreateControl; + Control.VisibleChanged; + end; + end + else + begin + SendToBottomInRecentList; + if Control <> nil then + begin + Control.VisibleChanged; + DestroyControl; + end; + end; + end; + Changed(False); //#DG +//#DG ItemLinkChanged; + end; +end; + +procedure TdxBarItemLink.WriteItemName(AWriter: TWriter); +begin + if Item <> nil then + AWriter.WriteString(Item.Name) + else + AWriter.WriteString(''); +end; + +procedure TdxBarItemLink.AddToRecentList; +begin + Owner.FRecentItems.Add(Self); +end; + +procedure TdxBarItemLink.RemoveFromRecentList; +begin + with Owner do + if FRecentItems <> nil then FRecentItems.Remove(Self); +end; + +procedure TdxBarItemLink.RestoreRecentIndex; +begin + RecentIndex := FPrevRecentIndex; +end; + +procedure TdxBarItemLink.SaveRecentIndex; +begin + FPrevRecentIndex := RecentIndex; +end; + +procedure TdxBarItemLink.InternalBringToTopInRecentList(IncCount: Boolean); +begin + if (Owner <> nil) and not Owner.CanUseRecentItems then Exit; + RecentIndex := 0; + if IncCount then Inc(FUseCount); +end; + +procedure TdxBarItemLink.Synchronize(AItemLink: TdxBarItemLink); +begin + FUseCount := AItemLink.FUseCount; + RecentIndex := AItemLink.RecentIndex; +end; + +procedure TdxBarItemLink.CheckMostRecentlyUsed; +begin + if MostRecentlyUsed then + begin + FUseCount := BarManager.FMostRecentlyUsedUseCount; + BringToTopInRecentList(False); + end + else + begin + FUseCount := 0; + SendToBottomInRecentList; + end +end; + +function TdxBarItemLink.GetRecentIndex: Integer; +begin + Result := Owner.FRecentItems.IndexOf(Self); +end; + +procedure TdxBarItemLink.SetRecentIndex(Value: Integer); +begin + if Owner = nil then + FPrevRecentIndex := Value + else + with Owner, FRecentItems do + begin + if Value >= Count then Value := Count - 1; + Move(IndexOf(Self), Value); + RefreshVisibilityLists; + end; +end; + +function TdxBarItemLink.CanVisible: Boolean; +begin + Result := Item.ActuallyVisible and Visible; +end; + +function TdxBarItemLink.GetItem: TdxBarItem; +begin + if (Owner <> nil) and (Owner.Owner <> nil) and (FLoadedItemName <> '') and + IsAncestorComponentDifferencesDetection(Owner.Owner) then + Result := BarManager.GetItemByName(FLoadedItemName) + else + Result := FItem; +end; + +function TdxBarItemLink.GetRealItemLink: TdxBarItemLink; +begin + if FOriginalItemLink <> nil then + Result := FOriginalItemLink + else + Result := Self +end; + +procedure TdxBarItemLink.OnUserGlyphChanged(Sender: TObject); +begin + UserGlyphChanged; +end; + +procedure TdxBarItemLink.DefineProperties(Filer: TFiler); + + function NeedWriteItemName: Boolean; + var + AAncestorItem: TdxBarItem; + begin + if Filer.Ancestor is TdxBarItemLink then + begin + AAncestorItem := TdxBarItemLink(Filer.Ancestor).Item; + Result := (AAncestorItem = nil) and (Item <> nil) or + (AAncestorItem <> nil) and (Item = nil) or + (AAncestorItem <> nil) and (AAncestorItem.Name <> Item.Name); + end + else + Result := Item <> nil; + end; + +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('ItemName', ReadItemName, WriteItemName, NeedWriteItemName); +end; + +procedure TdxBarItemLink.LoadItemName; +begin + if FLoadedItemName <> '' then + begin + Item := BarManager.GetItemByName(FLoadedItemName); + FLoadedItemName := ''; + end; +end; + +class function TdxBarItemLink.GetIniSection(const ABaseSection: string; ALinkIndex: Integer; + AStoringKind: TdxBarStoringKind): string; +begin + Result := ABaseSection + GetSectionDelimiter(AStoringKind) + 'ItemLink' + IntToStr(ALinkIndex); +end; + +procedure TdxBarItemLink.LoadFromIni(ASource: TCustomIniFile; const ABaseSection: string; + ALinkIndex: Integer; AStoringKind: TdxBarStoringKind); + +{$IFNDEF DELPHI6} + function ReadBinaryStream(const ASection, AName: string; AValue: TMemoryStream): Integer; + var + Info: TRegDataInfo; + Text: string; + Pos: Integer; + begin + Result := 0; + case AStoringKind of + skReg: + with TRegistryIniFile(ASource) do + if RegIniFile.OpenKey(ASection, False) then + try + if RegIniFile.ValueExists(AName) then + begin + if RegIniFile.GetDataInfo(AName, Info) then + begin + if (Info.RegData = rdBinary) or (Info.RegData = rdUnknown) then + begin + AValue.Size := AValue.Position + Info.DataSize; + Result := RegIniFile.ReadBinaryData(AName, Pointer(Integer(AValue.Memory) + AValue.Position)^, AValue.Size); + end; + end; + end; + finally + RegIniFile.CloseKey; + end; + skIni: + with ASource do + begin + Text := ReadString(ASection, AName, ''); + if Text <> '' then + begin + Pos := AValue.Position; + AValue.SetSize(AValue.Size + Length(Text) div 2); + HexToBin(PChar(Text), PChar(Integer(AValue.Memory) + AValue.Position), Length(Text) div 2); + AValue.Position := Pos; + Result := AValue.Size - Pos; + end + end; + end; + end; +{$ENDIF} + +var + ASection, S: string; + AStream: TMemoryStream; + AViewLevels: TdxBarItemViewLevels; +begin + ASection := GetIniSection(ABaseSection, ALinkIndex, AStoringKind); + if ASource.ReadString(ASection, 'ItemName', '') = '' then Exit; + Item := BarManager.GetItemByName(ASource.ReadString(ASection, 'ItemName', '')); + if Item = nil then + Free + else + with ASource do + begin + AStream := TMemoryStream.Create; + try + BeginGroup := ReadBool(ASection, 'BeginGroup', False); + if AStoringKind = skIni then + S := ReadString(ASection, 'UserDefine', '') + else + S := ''; + if Length(S) = 1 then + FUserDefine := TdxBarUserDefines(Byte(StrToInt(S))) // for compatibility with Bars 5 + else + if ReadBinaryStream(ASection, 'UserDefine', AStream) <> 0 then + begin + AStream.Read(FUserDefine, SizeOf(TdxBarUserDefines)); + AStream.Position := 0; + end; + if udCaption in UserDefine then + UserCaption := ReadString(ASection, 'UserCaption', ''); + if udPaintStyle in UserDefine then + UserPaintStyle := TdxBarPaintStyle(ReadInteger(ASection, 'UserPaintStyle', 0)); + if udWidth in UserDefine then + UserWidth := ReadInteger(ASection, 'UserWidth', 100); + // don't load UserGlyph for IniFile + if (AStoringKind = skReg) and (udGlyph in UserDefine) then + begin + if ReadBinaryStream(ASection, 'UserGlyph', AStream) <> 0 then + begin + UserGlyph.LoadFromStream(AStream); + AStream.Position := 0; + end; + end; + if Collection.Owner is TdxBar then + begin + ButtonGroup := TdxBarButtonGroupPosition(ReadInteger(ASection, 'ButtonGroup', Integer(bgpNone))); + Position := TdxBarItemPosition(ReadInteger(ASection, 'Position', Integer(dxBarItemDefaultPosition))); + if ReadBinaryStream(ASection, 'ViewLevels', AStream) <> 0 then + begin + AStream.Read(AViewLevels, SizeOf(TdxBarItemViewLevels)); + AStream.Position := 0; + ViewLevels := AViewLevels; + end; + FLoadedVisible := ReadBool(ASection, 'Visible', True); + end; + if BarManager.CanShowRecentItems and TdxBarItemLinks(Collection).FUseRecentItems then + begin + FLoadedUseCount := ReadInteger(ASection, 'UseCount', 0); + FLoadedRecentIndex := ReadInteger(ASection, 'RecentIndex', -1); + end; + finally + AStream.Free; + end; + end; +end; + +procedure TdxBarItemLink.LoadUsageData(ASource: TCustomIniFile; ABaseSection: string; + ALinkIndex: Integer); +begin + FMostRecentlyUsed := ASource.ReadBool( + GetIniSection(ABaseSection, ALinkIndex, skIni), 'MostRecentlyUsed', True); +end; + +procedure TdxBarItemLink.SaveToIni(ADestination: TCustomIniFile; const ABaseSection: string; + ALinkIndex: Integer; AStoringKind: TdxBarStoringKind); + +{$IFNDEF DELPHI6} + procedure WriteBinaryStream(const Section, Name: string; AValue: TMemoryStream); + var + Text: string; + begin + case AStoringKind of + skReg: + with TRegistryIniFile(ADestination) do + with RegIniFile do + begin + if OpenKey(Section, True) then + try + WriteBinaryData(Name, Pointer(Integer(AValue.Memory) + AValue.Position)^, + AValue.Size - AValue.Position); + finally + CloseKey; + end; + end; + skIni: + with ADestination do + begin + SetLength(Text, (AValue.Size - AValue.Position) * 2); + if Length(Text) > 0 then + BinToHex(PChar(Integer(AValue.Memory) + AValue.Position), PChar(Text), AValue.Size - AValue.Position); + WriteString(Section, Name, Text); + end; + end; + end; +{$ENDIF} + +var + AStream: TMemoryStream; + ASection: string; +begin + with ADestination do + begin + ASection := GetIniSection(ABaseSection, ALinkIndex, AStoringKind); + AStream := TMemoryStream.Create; + try + WriteString(ASection, 'ItemName', Item.Name); + WriteBool(ASection, 'BeginGroup', BeginGroup); + AStream.SetSize(SizeOf(TdxBarUserDefines)); + AStream.Write(FUserDefine, SizeOf(TdxBarUserDefines)); + AStream.Position := 0; + WriteBinaryStream(ASection, 'UserDefine', AStream); + if udCaption in UserDefine then + WriteString(ASection, 'UserCaption', UserCaption); + if udPaintStyle in UserDefine then + WriteInteger(ASection, 'UserPaintStyle', Ord(UserPaintStyle)); + if udWidth in UserDefine then + WriteInteger(ASection, 'UserWidth', UserWidth); + // don't save UserGlyph to IniFile + if (AStoringKind = skReg) and (udGlyph in UserDefine) then + begin + UserGlyph.SaveToStream(AStream); + AStream.Position := 0; + WriteBinaryStream(ASection, 'UserGlyph', AStream); + end; + if Collection.Owner is TdxBar then + begin + WriteInteger(ASection, 'ButtonGroup', Ord(ButtonGroup)); + WriteInteger(ASection, 'Position', Ord(Position)); + AStream.SetSize(SizeOf(TdxBarItemViewLevels)); + AStream.Write(ViewLevels, SizeOf(TdxBarItemViewLevels)); + AStream.Position := 0; + WriteBinaryStream(ASection, 'ViewLevels', AStream); + WriteBool(ASection, 'Visible', Visible); + end; + if BarManager.CanShowRecentItems and TdxBarItemLinks(Collection).FUseRecentItems then + begin + WriteInteger(ASection, 'UseCount', FUseCount); + WriteInteger(ASection, 'RecentIndex', RecentIndex); + end; + if BarManager.IsStateSaving then + WriteBool(ASection, 'MostRecentlyUsed', MostRecentlyUsed); + finally + AStream.Free; + end; + end; +end; + +procedure TdxBarItemLink.InitiateAction; +begin + if (Item <> nil) and (Item.ActionLink <> nil) then Item.ActionLink.Update; +end; + +function TdxBarItemLink.CanChangePaintStyle: Boolean; +begin + Result := Item.CanChangePaintStyle; +end; + +function TdxBarItemLink.HasItem(AItem: TdxBarItem): Boolean; +begin + Result := FItem = AItem; + if not Result and (FItem is TCustomdxBarSubItem) then + Result := TCustomdxBarSubItem(FItem).ItemLinks.HasItem(AItem); +end; + +function TdxBarItemLink.IsReferencedBy(ALinksOwner: IdxBarLinksOwner): Boolean; +var + ASelfLinksOwner: IdxBarLinksOwner; +begin + ASelfLinksOwner := GetLinksOwner(FItem); + Result := (ASelfLinksOwner <> nil) and + ((ASelfLinksOwner = ALinksOwner) or + (ASelfLinksOwner.GetItemLinks <> nil) and (ASelfLinksOwner.GetItemLinks.IsReferencedBy(ALinksOwner))); +end; + +function TdxBarItemLink.IsAccel(Key: Word; Shift: TShiftState): Boolean; +var + Accel: Char; + VK: SHORT; + AShift: TShiftState; + + function GetAccel(S: string): Char; + var + APos: Integer; + begin + APos := GetAccelPos(S); + if APos = 0 then + Result := #0 + else + begin + Result := AnsiLowerCase(S[APos])[1]; + if Result <> S[APos] then + Shift := Shift - [ssShift]; + end; + end; + +begin + Accel := GetAccel(Caption); + if Accel = #0 then + Result := False + else + if (Accel in ['0'..'9']) and (Key = Ord(Accel)) and (Shift = []) then + Result := True + else + begin + VK := VkKeyScan(Accel); + if Lo(VK) = Key then + begin + VK := Hi(VK); + AShift := []; + if VK and 1 = 1 then Include(AShift, ssShift); + if VK and 2 = 2 then Include(AShift, ssCtrl); + Result := AShift = Shift; + end + else + Result := False; + end; +end; + +procedure TdxBarItemLink.MoveBeginGroupItemIfNeeded; +var + ANextItemLink: TdxBarItemLink; +begin + if (Item <> nil) and + (CanVisibleIndex < Owner.CanVisibleItemCount - 1) and + ((CanVisibleIndex = 0) and Owner.CanVisibleItems[CanVisibleIndex + 1].BeginGroup or + BeginGroup and not Owner.CanVisibleItems[CanVisibleIndex + 1].BeginGroup) then + begin + ANextItemLink := Owner.CanVisibleItems[CanVisibleIndex + 1]; + ANextItemLink.BeginGroup := not ANextItemLink.BeginGroup; + end; +end; + +function TdxBarItemLink.ScreenToClient(const AScreenPos: TPoint): TPoint; +begin + Result := AScreenPos; + Windows.ScreenToClient(BarControl.Handle, Result); + Dec(Result.X, ItemRect.Left); + Dec(Result.Y, ItemRect.Top); +end; + +procedure TdxBarItemLink.UserGlyphChanged; +begin + if Control <> nil then + Control.GlyphChanged; +end; + +function TdxBarItemLink.QueryInterface(const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +function TdxBarItemLink._AddRef: Integer; +begin + Result := InterlockedIncrement(FRefCount); +end; + +function TdxBarItemLink._Release: Integer; +begin + Result := InterlockedDecrement(FRefCount); +end; + +function TdxBarItemLink.CanDelete(ADestruction: Boolean = False): Boolean; +begin + Result := True; +end; + +procedure TdxBarItemLink.DeleteSelection(var AReference: IdxBarSelectableItem; ADestruction: Boolean); +begin + if CanDelete(ADestruction) then + begin + AReference := nil; + Free; + end; +end; + +procedure TdxBarItemLink.ExecuteCustomizationAction(ABasicAction: TdxBarCustomizationAction); +begin + case ABasicAction of + caReset: + UserDefine := []; + caChangeCaption: + Item.Caption := BarDesignController.CustomizingItemLink.Caption; + caChangeButtonPaintStyle: + UserPaintStyle := BarDesignController.CustomizingItemLink.UserPaintStyle; + caChangePosition: + Position := BarDesignController.CustomizingItemLink.Position; + caChangeViewLevels: + ViewLevels := BarDesignController.CustomizingItemLink.ViewLevels; + caChangeButtonGroup: + ButtonGroup := BarDesignController.CustomizingItemLink.ButtonGroup; + caChangeBeginGroup: + BeginGroup := BarDesignController.CustomizingItemLink.BeginGroup; + caChangeVisible: + Visible := BarDesignController.CustomizingItemLink.Visible; + caChangeRecentList: + MostRecentlyUsed := BarDesignController.CustomizingItemLink.MostRecentlyUsed; + end; +end; + +function TdxBarItemLink.GetBarManager: TdxBarManager; +begin + Result := Owner.BarManager; +end; + +function TdxBarItemLink.GetInstance: TPersistent; +begin + Result := Self; +end; + +procedure TdxBarItemLink.GetMasterObjects(AList: TdxObjectList); +begin + AList.Add(BarControl.GetSelectableObject); + AList.Add(FItem); +end; + +function TdxBarItemLink.GetNextSelectableItem: IdxBarSelectableItem; +begin + Result := GetNext; +end; + +function TdxBarItemLink.GetSelectableParent: TPersistent; +begin + if BarControl <> nil then + Result := BarControl.GetSelectableObject + else + Result := nil; +end; + +function TdxBarItemLink.GetSelectionStatus: TdxBarSelectionStatus; +begin + Result := BarManager.GetSelectionStatus(Self); +end; + +function TdxBarItemLink.GetSupportedActions: TdxBarCustomizationActions; +begin + Result := Item.GetSupportedActions; +end; + +procedure TdxBarItemLink.Invalidate; +begin + RepaintItemControl(Control); +end; + +function TdxBarItemLink.IsComplex: Boolean; +begin + Result := False; +end; + +function TdxBarItemLink.IsComponentSelected: Boolean; +begin + Result := BarManager.IsComponentSelected(Self) or BarManager.IsComponentSelected(Item); +end; + +procedure TdxBarItemLink.SelectComponent(ASelectionOperation: TdxBarSelectionOperation = soExclusive); +begin + if ASelectionOperation = soExclude then + BarManager.SelectComponent(Self, ASelectionOperation); + BarManager.SelectComponent(Item, ASelectionOperation); +end; + +function TdxBarItemLink.SelectParentComponent: Boolean; +begin + Result := True; + BarManager.InternalSetSelectedItem(nil); // otherwise HideAll will be executed + BarControl.SetKeySelectedItem(nil); + BarDesignController.SelectObject(GetSelectableParent); +end; + +procedure TdxBarItemLink.SelectionChanged; +begin + Item.SelectionChanged; +end; + +procedure TdxBarItemLink.Assign(Source: TPersistent); + + function IsInheritanceUpdating: Boolean; + begin + //#DG TODO: LinksOwner + Result := (csUpdating in BarManager.ComponentState) or + ((Owner.Owner is TdxBarCustomPopupMenu) or (Owner.Owner is TCustomdxBarSubItem) or (Owner.Owner is TdxBar)) and + (csUpdating in TComponent(Owner.Owner).ComponentState); + end; + +var + Link: TdxBarItemLink; +begin + if Source is TdxBarItemLink then + begin + Link := TdxBarItemLink(Source); + Data := Link.Data; + FUserCaption := Link.FUserCaption; + FUserGlyph.Assign(Link.FUserGlyph); + FUserPaintStyle := Link.FUserPaintStyle; + FUserWidth := Link.FUserWidth; + if ResettingToolbar then + Item := TdxBarItem(BarManager.Owner.FindComponent(Link.Item.Name)) + else + begin + if Assigned(Link.Item) and IsInheritanceUpdating then + Item := BarManager.GetItemByName(Link.Item.Name) + else + Item := Link.Item; + end; + UserDefine := Link.UserDefine; + BeginGroup := Link.BeginGroup; + ButtonGroup := Link.ButtonGroup; + Position := Link.Position; + ViewLevels := Link.ViewLevels; + Visible := Link.Visible; + // do not assign MostRecentlyUsed property + FCreatedFromMergingWith := FMergingWith; + end + else inherited Assign(Source); +end; + +procedure TdxBarItemLink.BringToTopInRecentList(IncCount: Boolean); +var + PrevVisibleIndex: Integer; + AParentItem: TdxBarItem; +begin + if not CanVisible then Exit; + + PrevVisibleIndex := VisibleIndex; + InternalBringToTopInRecentList(IncCount); + if CanVisibleIndex > -1 then + begin + if (PrevVisibleIndex = -1) and (BarControl <> nil) then + BarControl.LayoutChanged; + + AParentItem := nil; + with Owner do + if Owner is TCustomdxBarSubItem then + AParentItem := TCustomdxBarSubItem(Owner) + else + if Owner is TdxBarCustomPopupMenu then + if (BarControl <> nil) and (TdxBarSubMenuControl(BarControl).FDropDownButton <> nil) then + AParentItem := TdxBarSubMenuControl(BarControl).FDropDownButton.Item; + if AParentItem <> nil then + with AParentItem do + if (CurItemLink <> nil) and (CurItemLink.RealItemLink <> nil) then + CurItemLink.RealItemLink.BringToTopInRecentList(IncCount); + end; +end; + +procedure TdxBarItemLink.CreateControl; +begin + if (FControl = nil) and (Item <> nil) and +//#DG (BarControl <> nil) and not BarControl.FDestroyFlag then + (BarControl <> nil) and not BarControl.IsDestroying then + FControl := Item.GetControlClass(BarControl.IsVertical).Create(Self); +end; + +procedure TdxBarItemLink.DestroyControl; +begin + FreeAndNil(FControl); +end; + +procedure TdxBarItemLink.RecreateControl; +begin + if not BarManager.IsUpdateLocked then + begin + DestroyControl; + CreateControl; + end; +end; + +procedure TdxBarItemLink.SendToBottomInRecentList; +var + PrevVisibleIndex: Integer; +begin + PrevVisibleIndex := VisibleIndex; + RecentIndex := Owner.FRecentItems.Count - 1; + if (PrevVisibleIndex > -1) and (BarControl <> nil) then + BarControl.LayoutChanged; +end; + +{ TdxBarItemLinks } + +constructor TdxBarItemLinks.Create(ABarManager: TdxBarManager; ALinksOwner: IdxBarLinksOwner); +begin + inherited Create(TdxBarItemLink); + FBarManager := ABarManager; + FLinksOwner := ALinksOwner; + FAvailableItems := TList.Create; + FCanVisibleItems := TList.Create; + FVisibleItems := TList.Create; + FRecentItems := TList.Create; + FRecentItemCount := -1; + FUseRecentItems := True; + FItemOptions := TdxBarItemOptions.Create(Self); +end; + +destructor TdxBarItemLinks.Destroy; +begin + FreeAndNil(FItemOptions); + if (FBarControl <> nil) and not FBarControl.IsDestroying then + FreeAndNil(FBarControl); + FreeAndNil(FRecentItems); + FreeAndNil(FVisibleItems); + FreeAndNil(FCanVisibleItems); + FreeAndNil(FAvailableItems); + inherited; +end; + +procedure TdxBarItemLinks.DesignerModified; +begin + if Owner is TdxBarCustomPopupMenu then + TdxBarCustomPopupMenu(Owner).OwnerDesignerModified + else + BarManager.DesignerModified; +end; + +function TdxBarItemLinks.GetAvailableItem(Index: Integer): TdxBarItemLink; +begin + Result := TdxBarItemLink(FAvailableItems[Index]); +end; + +function TdxBarItemLinks.GetAvailableItemCount: Integer; +begin + Result := FAvailableItems.Count; +end; + +function TdxBarItemLinks.GetCanVisibleItem(Index: Integer): TdxBarItemLink; +begin + Result := TdxBarItemLink(FCanVisibleItems[Index]); +end; + +function TdxBarItemLinks.GetCanVisibleItemCount: Integer; +begin + Result := FCanVisibleItems.Count; +end; + +function TdxBarItemLinks.GetIndexByItemName(const AItemName: string): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Count - 1 do + if Items[I].Item.Name = AItemName then + begin + Result := I; + Break; + end; +end; + +function TdxBarItemLinks.GetItem(Index: Integer): TdxBarItemLink; +begin + Result := TdxBarItemLink(inherited Items[Index]); +end; + +function TdxBarItemLinks.GetMostRecentItemCount: Integer; +var + AMinCount, AMaxCount, I, Level: Integer; +begin + if CanUseRecentItems then + begin + AMinCount := MaxInt; + AMaxCount := 0; + for I := 0 to CanVisibleItemCount - 1 do + begin + AMinCount := Min(AMinCount, CanVisibleItems[I].FUseCount); + AMaxCount := Max(AMaxCount, CanVisibleItems[I].FUseCount); + end; + Level := AMinCount + + MulDiv(AMaxCount - AMinCount, 100 - BarManager.MostRecentItemsPercents, 100); + Result := 0; + for I := CanVisibleItemCount - 1 downto 0 do + with TdxBarItemLink(FRecentItems[I]) do + if (FUseCount >= Level) and (Owner = Self) then + begin + Result := I + 1; + Break; + end; + if Result = CanVisibleItemCount then Result := -1; + end + else + Result := -1; +end; + +function TdxBarItemLinks.GetParentLinks: TdxBarItemLinks; +begin + if (BarControl <> nil) and (BarControl.ParentBar <> nil) then + Result := BarControl.ParentBar.ItemLinks + else + Result := nil; +end; + +function TdxBarItemLinks.GetRealVisibleItemCount: Integer; +var + R, AItemRect, ResultR: TRect; + I: Integer; +begin + Result := VisibleItemCount; + if not IsScrollable then + begin + R := BarControl.ClientRect; + for I := 0 to Result - 1 do + begin + AItemRect := VisibleItems[I].ItemRect; + IntersectRect(ResultR, R, AItemRect); + if not EqualRect(AItemRect, ResultR) or IsRectEmpty(AItemRect) then + begin + Result := I; + Break; + end; + end; + end; +end; + +function TdxBarItemLinks.GetItemShowDescriptions: Boolean; +begin + Result := GetOptionsValue(ioShowDescriptions, Self); +end; + +function TdxBarItemLinks.GetItemShowShortCuts: Boolean; +begin + Result := GetOptionsValue(ioShowShortCuts, Self); +end; + +function TdxBarItemLinks.GetItemSize: TdxBarMenuItemSize; +begin + Result := GetOptionsValue(ioSize, Self); +end; + +function TdxBarItemLinks.GetVisibleItem(Index: Integer): TdxBarItemLink; +begin + Result := TdxBarItemLink(FVisibleItems[Index]); +end; + +function TdxBarItemLinks.GetVisibleItemCount: Integer; +begin + Result := FVisibleItems.Count; +end; + +procedure TdxBarItemLinks.SetItem(Index: Integer; Value: TdxBarItemLink); +begin + Items[Index].Assign(Value); +end; + +procedure TdxBarItemLinks.SetItemOptions(AValue: TdxBarItemOptions); +begin + FItemOptions.Assign(AValue); +end; + +procedure TdxBarItemLinks.SetRecentItemCount(Value: Integer); +begin + FPrevRecentItemCount := FRecentItemCount; + if not CanUseRecentItems then Value := -1; + FRecentItemCount := Value; + RefreshVisibilityLists; +end; + +function VisibleItemsCompare(Item1, Item2: Pointer): Integer; +begin + Result := TdxBarItemLink(Item1).CanVisibleIndex - TdxBarItemLink(Item2).CanVisibleIndex; +end; + +function TdxBarItemLinks.IsUpdateLocked: Boolean; +begin + Result := UpdateCount > 0; +end; + +procedure TdxBarItemLinks.RefreshVisibilityLists; + + procedure InternalRefreshVisibilityLists; + var + AIsDesignTime: Boolean; + I: Integer; + AItemLink: TdxBarItemLink; + AItem: TdxBarItem; + begin + if FAvailableItems = nil then + Exit; + FAvailableItems.Clear; + FCanVisibleItems.Clear; + FVisibleItems.Clear; + AIsDesignTime := BarManager.Designing; + for I := 0 to Count - 1 do + begin + AItemLink := Items[I]; + AItem := AItemLink.Item; + if (AItem <> nil) and + ({Item.AlwaysVisible or }AIsDesignTime or AItem.ActuallyVisible) then + begin + FAvailableItems.Add(AItemLink); + if {Item.AlwaysVisible or }AIsDesignTime or AItemLink.Visible then + begin + FCanVisibleItems.Add(AItemLink); + if {Item.AlwaysVisible or }AIsDesignTime or (RecentItemCount = -1) then + FVisibleItems.Add(AItemLink); + end; + end; + end; + if not AIsDesignTime and (RecentItemCount > 0) then + begin + for I := 0 to FRecentItems.Count - 1 do + if CanVisibleIndexOf(FRecentItems[I]) <> -1 then + begin + FVisibleItems.Add(FRecentItems[I]); + if FVisibleItems.Count = RecentItemCount then Break; + end; + FVisibleItems.Sort(VisibleItemsCompare); + end; + end; + + procedure RefreshSeparatorsVisibility; + + function IsSeparator(ALink: TObject): Boolean; + begin + Result := TdxBarItemLink(ALink).Item is TdxBarSeparator; + end; + + procedure HideSeparator(ALink: TdxBarItemLink); + begin + FCanVisibleItems.Remove(Alink); + FVisibleItems.Remove(ALink); + end; + + var + I: Integer; + APrevIsSeparator, ACurrentIsSeparator: Boolean; + begin + APrevIsSeparator := True; + for I := FVisibleItems.Count - 1 downto 0 do + begin + ACurrentIsSeparator := IsSeparator(FVisibleItems[I]); + if ACurrentIsSeparator and APrevIsSeparator then + HideSeparator(FVisibleItems[I]); + APrevIsSeparator := ACurrentIsSeparator; + end; + end; + +begin + InternalRefreshVisibilityLists; + if not BarManager.IsCustomizing and not IsUpdateLocked then + RefreshSeparatorsVisibility; +end; + +procedure TdxBarItemLinks.RestoreRecentItemCount; +begin + FRecentItemCount := FPrevRecentItemCount; + RefreshVisibilityLists; +end; + +procedure TdxBarItemLinks.Loaded(CheckVisible: Boolean); +var + J, I: Integer; +begin + for J := Count - 1 downto 0 do + with Items[J] do + if Item = nil then + //Free + else + CheckMostRecentlyUsed; + if CheckVisible then + for J := Count - 1 downto 0 do + with Items[J] do + Visible := FLoadedVisible; + for I := 0 to Count - 1 do + for J := 0 to Count - 1 do + with Items[J] do + if FLoadedRecentIndex = I then + begin + FUseCount := FLoadedUseCount; + RecentIndex := FLoadedRecentIndex; + FLoadedRecentIndex := -1; + end; + if FBarControl <> nil then + FBarControl.CreateControls; +end; + +procedure TdxBarItemLinks.CheckVisibleIntegrity; +var + I, J: Integer; + ItemLink: TdxBarItemLink; +begin + for I := 0 to FRecentItems.Count - 1 do + begin + ItemLink := TdxBarItemLink(FRecentItems[I]); + if ItemLink.CanVisibleIndex = -1 then Break; + end; + for J := I + 1 to FRecentItems.Count - 1 do + begin + ItemLink := TdxBarItemLink(FRecentItems[J]); + if ItemLink.CanVisibleIndex > -1 then + begin + ItemLink.RecentIndex := I; + Inc(I); + end; + end; +end; + +procedure TdxBarItemLinks.EmptyItemRects; +var + I: Integer; +begin + for I := 0 to Count - 1 do + SetRectEmpty(Items[I].FItemRect); +end; + +function TdxBarItemLinks.CanUseRecentItems: Boolean; +begin + Result := BarManager.CanShowRecentItems and FUseRecentItems and ((ParentLinks = nil) or (ParentLinks.CanUseRecentItems)); +end; + +procedure TdxBarItemLinks.InitiateActions; +var + I: Integer; +begin + for I := 0 to Count - 1 do Items[I].InitiateAction; +end; + +function TdxBarItemLinks.IsShortCut(AShortCut: TShortCut): Boolean; +var + I: Integer; +begin + Result := False; + if AShortCut = 0 then Exit; + InitiateActions; + for I := 0 to AvailableItemCount - 1 do + begin + Result := AvailableItems[I].Item.IsShortCut(AShortCut); + if Result then Break; + end; +end; + +function TdxBarItemLinks.IsScrollable: Boolean; +begin + Result := not (Owner is TdxBar); +end; + +function TdxBarItemLinks.FindItemWithAccel(AKey: Word; AShift: TShiftState; ACurrentLink: TdxBarItemLink): TdxBarItemLink; +begin + AShift := AShift - [ssAlt]; + Result := DoFindItemWithAccel(AKey, AShift, ACurrentLink); +end; + +function TdxBarItemLinks.First: TdxBarItemLink; +var + I: Integer; +begin + for I := 0 to RealVisibleItemCount - 1 do + begin + Result := VisibleItems[I]; + if Result.Control.CanSelect then Exit; + end; + Result := nil; +end; + +function TdxBarItemLinks.Last: TdxBarItemLink; +var + I: Integer; +begin + for I := RealVisibleItemCount - 1 downto 0 do + begin + Result := VisibleItems[I]; + if Result.Control.CanSelect then Exit; + end; + Result := nil; +end; + +function TdxBarItemLinks.Next(Current: TdxBarItemLink; AAnyone: Boolean = False): TdxBarItemLink; +var + CurrentIndex, I, ACount: Integer; +begin + if Current = nil then Result := First + else + begin + CurrentIndex := Current.VisibleIndex; + I := CurrentIndex; + ACount := RealVisibleItemCount; + repeat + Inc(I); + if I > ACount - 1 then I := 0; + Result := VisibleItems[I]; + if AAnyone or Result.Control.CanSelect then Exit; + until I = CurrentIndex; + Result := nil; + end; +end; + +function TdxBarItemLinks.Prev(Current: TdxBarItemLink; AAnyone: Boolean = False): TdxBarItemLink; +var + CurrentIndex, I: Integer; +begin + if Current = nil then Result := Last + else + begin + CurrentIndex := Current.VisibleIndex; + I := CurrentIndex; + repeat + Dec(I); + if I = -1 then I := RealVisibleItemCount - 1; + Result := VisibleItems[I]; + if AAnyone or Result.Control.CanSelect then Exit; + until I = CurrentIndex; + Result := nil; + end; +end; + +procedure TdxBarItemLinks.CheckLinks(ASource: TCustomIniFile; const ABaseSection: string); +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].Item.CheckLinks(ASource, ABaseSection); +end; + +procedure TdxBarItemLinks.LoadFromIni(ASource: TCustomIniFile; const ASection: string; AStoringKind: TdxBarStoringKind); +var + I, ACount, ANewItemLinkCount: Integer; +begin + BeginUpdate; //#DG + try + ANewItemLinkCount := 0; + if (BarManager.FNewItems = nil) or (BarManager.FNewItems.Count = 0) then + Clear + else + for I := Count - 1 downto 0 do + if BarManager.FNewItems.IndexOf(Items[I].Item.Name) < 0 then + Delete(I) + else + begin + Items[I].FCreatedFromMergingWith := nil; + Inc(ANewItemLinkCount); + if I > 0 then + Items[I].FPrevItemName := Items[I - 1].Item.Name; + end; + try + ACount := ASource.ReadInteger(ASection, 'ItemLinkCount', 0); + for I := ACount - 1 downto 0 do + Insert(0).LoadFromIni(ASource, ASection, I, AStoringKind); + for I := Count - ANewItemLinkCount to Count - 1 do + if Items[I].FPrevItemName = '' then + Move(I, 0) + else + if GetIndexByItemName(Items[I].FPrevItemName) > 0 then + Move(I, GetIndexByItemName(Items[I].FPrevItemName) + 1); + RefreshVisibilityLists; + finally + Loaded(True); + end; + finally + EndUpdate; + end; +end; + +procedure TdxBarItemLinks.LoadUsageData(ASource: TCustomIniFile; ASection: string); +var + ALinkCount, I: Integer; +begin + // TODO search by unique ID, check merging + ALinkCount := ASource.ReadInteger(ASection, 'ItemLinkCount', 0); + for I := 0 to Count - 1 do + if I < ALinkCount then + Items[I].LoadUsageData(ASource, ASection, I); + Loaded(False); + CheckVisibleIntegrity; +end; + +procedure TdxBarItemLinks.SaveToIni(ADestination: TCustomIniFile; const ASection: string; AStoringKind: TdxBarStoringKind); +var + I, ACount: Integer; +begin + ACount := 0; + for I := 0 to Count - 1 do + if (Items[I].Item <> nil) and (Items[I].Item.Name <> '') and (Items[I].FCreatedFromMergingWith = nil) then + begin + Items[I].SaveToIni(ADestination, ASection, ACount, AStoringKind); + Inc(ACount); + end; + ADestination.WriteInteger(ASection, 'ItemLinkCount', ACount); +end; + +procedure TdxBarItemLinks.Merge(AItemLinks: TdxBarItemLinks); + + procedure CheckMergeOperationParameters(AMergingLink: TdxBarItemLink; + var AKind: TdxBarItemMergeKind; var ALinkIndex: Integer); + begin + if ALinkIndex < 0 then + AKind := mkNone; + if (AKind = mkMergeByCaption) and ((ALinkIndex >= Count) or + not Items[ALinkIndex].Item.CanMergeWith(AMergingLink.Item)) then + AKind := mkNone; + if (AKind = mkAdd) and (ALinkIndex > Count) then + AKind := mkNone; + end; + + procedure GetMergeOperationParameters(AMergingLink: TdxBarItemLink; + out AKind: TdxBarItemMergeKind; out ALinkIndex: Integer); + var + AItem: TdxBarItem; + I: Integer; + begin + ALinkIndex := -1; + AKind := AMergingLink.Item.MergeKind; + if AKind <> mkNone then + begin + if AMergingLink.Item.MergeKind = mkMergeByCaption then + for I := 0 to Count - 1 do + if (Items[I].Item.MergeKind = mkMergeByCaption) and + (Items[I].Caption = AMergingLink.Caption) and // TODO Accel chars + Items[I].Item.CanMergeWith(AMergingLink.Item) then + ALinkIndex := I; + if ALinkIndex <> -1 then + AKind := mkMergeByCaption + else + begin + for I := 0 to Count - 1 do + begin + AItem := Items[I].Item; + if AItem.MergeOrder <= AMergingLink.Item.MergeOrder then + if (ALinkIndex = -1) or (AItem.MergeOrder >= Items[ALinkIndex].Item.MergeOrder) then + ALinkIndex := I; + end; + Inc(ALinkIndex); + AKind := mkAdd; + end; + end; + BarManager.DoMergeItemLink(Self, AItemLinks, AMergingLink, AKind, ALinkIndex); + CheckMergeOperationParameters(AMergingLink, AKind, ALinkIndex); + end; + +var + AItemLink: TdxBarItemLink; + AMergeKind: TdxBarItemMergeKind; + AMergeLinkIndex, I: Integer; +begin + for I := 0 to AItemLinks.Count - 1 do + begin + GetMergeOperationParameters(AItemLinks[I], AMergeKind, AMergeLinkIndex); + if AMergeKind = mkMergeByCaption then + Items[AMergeLinkIndex].Item.GetItemLinks.Merge( + AItemLinks[I].Item.GetItemLinks) + else + if AMergeKind = mkAdd then + begin + AItemLink := Insert(AMergeLinkIndex); + AItemLink.Assign(AItemLinks[I]); + end; + end; +end; + +procedure TdxBarItemLinks.Unmerge(ABar: TdxBar); +var + AItemLink: TdxBarItemLink; + I: Integer; +begin + for I := Count - 1 downto 0 do + begin + AItemLink := Items[I]; + if (AItemLink.FCreatedFromMergingWith <> nil) and + ((ABar = nil) or (AItemLink.FCreatedFromMergingWith = ABar)) then + AItemLink.Free + else + if AItemLink.Item.GetItemLinks <> nil then + AItemLink.Item.GetItemLinks.Unmerge(ABar); + end; +end; + +function TdxBarItemLinks.AddItem(AItemClass: TdxBarItemClass; AOwner: TComponent): TdxBarItemLink; +begin + Result := Add; + try + if AOwner = nil then + AOwner := BarManager; + Result.Item := AItemClass.Create(AOwner); + except + Result.Item.Free; + Result.Item := nil; + raise; + end; +end; + +function TdxBarItemLinks.GetOwner: TPersistent; +begin + Result := GetOwnerComponent; +end; + +function TdxBarItemLinks.GetOwnerComponent: TComponent; +begin + if FLinksOwner <> nil then + Result := FLinksOwner.GetInstance + else + Result := nil; +end; + +procedure TdxBarItemLinks.LoadItemNames; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].LoadItemName; + Loaded(True); +end; + +procedure TdxBarItemLinks.Update(Item: TCollectionItem); +begin +{ #DG + if (Owner is TComponent) and not (Owner is TdxBar) and + (csDestroying in TComponent(Owner).ComponentState) then + Exit; +} + if Item = nil then + RefreshVisibilityLists; + if csDestroying in Owner.ComponentState then + Exit; + + inherited Update(Item); + if not Internal then + DesignerModified; //#DG + if Item <> nil then + BarManager.DoItemLinkChange(TdxBarItemLink(Item)) + else + begin + if (BarControl <> nil) and BarControl.Enabled then // #DG Enabled - why??? + BarControl.RepaintBar; + CallNotify(OnChange, Self); + end; +end; + +function TdxBarItemLinks.GetDefaultValue(AOption: TdxBarItemOptionValue): Variant; +begin + case AOption of + ioShowDescriptions: Result := False; + ioShowShortCuts: Result := True; + else {ioSize} + Result := misNormal; + end; +end; + +function TdxBarItemLinks.GetOptionsValue(AOption: TdxBarItemOptionValue; AItemLinks: TdxBarItemLinks): Variant; +begin + if not ItemOptions.IsValueStored(AOption) and (GetParentLinks <> nil) then + Result := GetParentLinks.GetOptionsValue(AOption, AItemLinks) + else + Result := ItemOptions.GetValue(AOption); +end; + +function TdxBarItemLinks.Add: TdxBarItemLink; +begin + Result := TdxBarItemLink(inherited Add); +end; + +function TdxBarItemLinks.Add(AItem: TdxBarItem): TdxBarItemLink; +begin + BeginUpdate; + try + Result := Add; + Result.Item := AItem; + finally + EndUpdate; + end; +end; + +function TdxBarItemLinks.AddItem(AItemClass: TdxBarItemClass): TdxBarItemLink; +begin + Result := Add(BarManager.AddItem(AItemClass)); +end; + +function TdxBarItemLinks.AddButton: TdxBarItemLink; +begin + Result := Add(BarManager.AddButton); +end; + +function TdxBarItemLinks.AddSubItem: TdxBarItemLink; +begin + Result := Add(BarManager.AddSubItem); +end; + +procedure TdxBarItemLinks.Assign(Source: TPersistent); +var + ContainsMDISystemMenu: Boolean; + SystemMenuSubItem: TSystemMenuSubItem; + I: Integer; +begin + ContainsMDISystemMenu := + (Count <> 0) and (Items[0].Item is TSystemMenuSubItem); + if ContainsMDISystemMenu then + SystemMenuSubItem := TSystemMenuSubItem(Items[0].Item) + else + SystemMenuSubItem := nil; + FAssigning := True; + try + inherited Assign(Source); + finally + FAssigning := False; + for I := 0 to Count - 1 do + with Items[I] do + Visible := FLoadedVisible; + if ContainsMDISystemMenu then + with Add do + begin + Item := SystemMenuSubItem; + Index := 0; + end; + end; +end; + +function TdxBarItemLinks.AvailableIndexOf(Value: TdxBarItemLink): Integer; +begin + Result := FAvailableItems.IndexOf(Value); +end; + +function TdxBarItemLinks.CanContainItem(AItem: TdxBarItem; + out AErrorText: string): Boolean; +begin + Result := FLinksOwner.CanContainItem(AItem, AErrorText); +end; + +function TdxBarItemLinks.CanVisibleIndexOf(Value: TdxBarItemLink): Integer; +begin + Result := FCanVisibleItems.IndexOf(Value); +end; + +procedure TdxBarItemLinks.CreateBarControl; +begin + FBarControl := FLinksOwner.CreateBarControl; + FBarControl.ItemLinks := Self; +end; + +procedure TdxBarItemLinks.DestroyBarControl; +begin + FreeAndNil(FBarControl); +end; + +procedure TdxBarItemLinks.FreeForeignItems(ForeignBarManager: TdxBarManager); +var + I: Integer; +begin + if Owner is TdxBar then + TdxBar(Owner).BarManager.BeginUpdate; + for I := 0 to Count - 1 do + if (ForeignBarManager <> nil) and (Items[I].BarManager = ForeignBarManager) or + (ForeignBarManager = nil) and (Items[I].BarManager <> BarManager) then + begin + Items[I].Free; + Items[I] := nil; + end; + if Owner is TdxBar then + TdxBar(Owner).BarManager.EndUpdate; +end; + +function TdxBarItemLinks.HasItem(AItem: TdxBarItem): Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to Count - 1 do + if Items[I].HasItem(AItem) then + begin + Result := True; + Break; + end; +end; + +function TdxBarItemLinks.IsControlExists(AItem: TdxBarItemControl): Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to Count - 1 do + if Items[I].Control = AItem then + begin + Result := True; + Break; + end; +end; + +function TdxBarItemLinks.IsReferencedBy(ALinksOwner: IdxBarLinksOwner): Boolean; +var + I: Integer; +begin + Result := Self = ALinksOwner.GetItemLinks; + if not Result then + for I := 0 to Count - 1 do + if Items[I].IsReferencedBy(ALinksOwner) then + begin + Result := True; + Break; + end; +end; + +function TdxBarItemLinks.IndexOf(Value: TdxBarItemLink): Integer; +begin + if (Value <> nil) and (Value.Collection = Self) then + Result := Value.Index + else + Result := -1; +end; + +function TdxBarItemLinks.Insert(AIndex: Integer): TdxBarItemLink; +begin + Result := TdxBarItemLink(inherited Insert(AIndex)); +end; + +procedure TdxBarItemLinks.Move(ACurIndex, ANewIndex: Integer); +begin + BeginUpdate; + try + if (ACurIndex < Count) and (ACurIndex > -1) and + (ANewIndex < Count) and (ANewIndex > -1) and + (ACurIndex <> ANewIndex) then + Items[ACurIndex].SetIndex(ANewIndex); + finally + EndUpdate; + end; + if BarControl <> nil then BarControl.RepaintBar; +end; + +function TdxBarItemLinks.VisibleIndexOf(Value: TdxBarItemLink): Integer; +begin + Result := FVisibleItems.IndexOf(Value); +end; + +{ TdxBarControlItemLinks } + +function TdxBarControlItemLinks.DoFindItemWithAccel(AKey: Word; AShift: TShiftState; ACurrentLink: TdxBarItemLink): TdxBarItemLink; +begin + if IsControlVisible(BarControl) then + begin + Result := ACurrentLink; + repeat + Result := Next(Result); + if Result = nil then Break; + if Result.Item.HasAccel(Result) and Result.IsAccel(AKey, AShift) then Exit; + if Result = ACurrentLink then Break; + if ACurrentLink = nil then ACurrentLink := Result; + until False; + end; + Result := nil; +end; + +{ TdxBarSubMenuControlItemLinks } + +function TdxBarSubMenuControlItemLinks.DoFindItemWithAccel(AKey: Word; AShift: TShiftState; ACurrentLink: TdxBarItemLink): TdxBarItemLink; +begin + if CanVisibleItemCount = 0 then + begin + Result := nil; + Exit; + end; + if ACurrentLink = nil then ACurrentLink := CanVisibleItems[0]; + Result := ACurrentLink; + repeat + if Result = CanVisibleItems[CanVisibleItemCount - 1] then + Result := CanVisibleItems[0] + else + Result := CanVisibleItems[Result.CanVisibleIndex + 1]; + if Result.Item.HasAccel(Result) and Result.IsAccel(AKey, AShift) then Exit; + until Result = ACurrentLink; + Result := nil; +end; + +function TdxBarSubMenuControlItemLinks.IsScrollable: Boolean; +begin + Result := True; +end; + +{ TdxBarPopupMenu } + +constructor TdxBarCustomPopupMenu.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + if dxBarManagerList.Count = 0 then + raise Exception.Create(cxGetResourceString(@dxSBAR_NOBARMANAGERS)); + FBackgroundBitmap := TBitmap.Create; + BarManager := GetBarManagerByComponent(AOwner); + if FBarManager = nil then + BarManager := TdxBarManager(dxBarManagerList[0]); + FEditFont := TFont.Create; + FFont := TFont.Create; + FFont.Assign(BarManager.Font); + FFont.OnChange := FontChanged; + FItemLinks := GetItemLinksClass.Create(FBarManager, Self); + UseRecentItems := False; + FShowAnimation := True; + FUseOwnMessageLoop := True; +end; + +destructor TdxBarCustomPopupMenu.Destroy; +begin +//#DG Destroying; +//#DG BarDesignController.DeselectIfSelected(Self); + FreeAndNil(FItemLinks); + FreeAndNil(FFont); + FreeAndNil(FEditFont); + FreeAndNil(FBackgroundBitmap); + inherited Destroy; +end; + +function TdxBarCustomPopupMenu.GetItemOptions: TdxBarItemOptions; +begin + Result := FItemLinks.ItemOptions; +end; + +function TdxBarCustomPopupMenu.GetSubMenuControl: TdxBarSubMenuControl; +begin + Result := TdxBarSubMenuControl(FItemLinks.BarControl); +end; + +function TdxBarCustomPopupMenu.GetUseRecentItems: Boolean; +begin + Result := FItemLinks.FUseRecentItems; +end; + +procedure TdxBarCustomPopupMenu.SetBackgroundBitmap(Value: TBitmap); +begin + FBackgroundBitmap.Assign(Value); +end; + +procedure TdxBarCustomPopupMenu.SetBarManager(Value: TdxBarManager); +begin + if (FBarManager <> Value) and (Value <> nil) then + begin + if FBarManager <> nil then FBarManager.FPopupMenus.Remove(Self); + FBarManager := Value; + if FItemLinks <> nil then FItemLinks.FBarManager := Value; + FBarManager.FPopupMenus.Add(Self); + end; +end; + +procedure TdxBarCustomPopupMenu.SetBarSize(Value: Integer); +begin + if Value < 0 then Value := 0; + FBarSize := Value; +end; + +procedure TdxBarCustomPopupMenu.SetFont(Value: TFont); +begin + Font.Assign(Value); +end; + +procedure TdxBarCustomPopupMenu.SetItemLinks(Value: TdxBarItemLinks); +begin + FItemLinks.Assign(Value); +end; + +procedure TdxBarCustomPopupMenu.SetItemOptions(Value: TdxBarItemOptions); +begin + FItemLinks.ItemOptions := Value; +end; + +procedure TdxBarCustomPopupMenu.SetUseOwnFont(Value: Boolean); +begin + if FUseOwnFont <> Value then + begin + FUseOwnFont := Value; + FInternalFontChange := True; + try + if FUseOwnFont then + FontChanged(nil) + else + Font := BarManager.Font; + finally + FInternalFontChange := False; + end; + end; +end; + +procedure TdxBarCustomPopupMenu.SetUseRecentItems(Value: Boolean); +begin + FItemLinks.FUseRecentItems := Value; +end; + +procedure TdxBarCustomPopupMenu.FontChanged(Sender: TObject); +begin + if not FInternalFontChange then + FUseOwnFont := True; + if FUseOwnFont then + CreateEditFontHandle(Font, FEditFont, False); +end; + +procedure TdxBarCustomPopupMenu.SubMenuCloseUp(Sender: TObject); +begin + FPopupMenuVisible := False; + DoCloseUp; +end; + +procedure TdxBarCustomPopupMenu.SubMenuPopup(Sender: TObject); +begin + FPopupMenuVisible := True; + DoPopup; +end; + +procedure TdxBarCustomPopupMenu.OwnerDesignerModified; +begin + if [csDesigning, csLoading, csDestroying, csUpdating] * ComponentState = [csDesigning] then + BarDesignController.DesignerModified(GetComponentForm(Self)); +end; + +function TdxBarCustomPopupMenu.GetEnabled: Boolean; +begin + Result := True; +end; + +procedure TdxBarCustomPopupMenu.SetEnabled(Value: Boolean); +begin +end; + +procedure TdxBarCustomPopupMenu.SetVisible(Value: TdxBarItemVisible); +begin +end; + +procedure TdxBarCustomPopupMenu.DoCloseUp; +begin + CallNotify(OnCloseUp, Self); +end; + +procedure TdxBarCustomPopupMenu.DoPopup; +begin + CallNotify(OnPopup, Self); +end; + +function TdxBarCustomPopupMenu.GetControlClass: TCustomdxBarControlClass; +begin + Result := TdxBarSubMenuControl; +end; + +function TdxBarCustomPopupMenu.GetItemLinksClass: TdxBarItemLinksClass; +begin + Result := TdxBarSubMenuControlItemLinks; +end; + +function TdxBarCustomPopupMenu.IsShortCut(AShortCut: TShortCut): Boolean; +begin + Result := False; +end; + +function TdxBarCustomPopupMenu.IsShortCutKey(var Message: TWMKey): Boolean; +var + AShortCut: TShortCut; +begin + AShortCut := GetShortCutFromMessageData(TMessage(Message).WParam, TMessage(Message).LParam); + Result := (AShortCut <> 0) and ItemLinks.IsShortCut(AShortCut); +end; + +procedure TdxBarCustomPopupMenu.Loaded; +begin + inherited Loaded; + BarDesignController.LockDesignerModified; + try + FItemLinks.LoadItemNames; + finally + BarDesignController.UnLockDesignerModified; + end; +end; + +// IdxBarLinksOwner +function TdxBarCustomPopupMenu.CanContainItem(AItem: TdxBarItem; out AErrorText: string): Boolean; +begin + Result := AItem.CanBePlacedOn(pkSubItemOrPopupMenu, nil, AErrorText); + if Result then + begin + Result := (GetOwnedLinks(AItem) = nil) or not GetOwnedLinks(AItem).IsReferencedBy(Self); + if not Result then + AErrorText := cxGetResourceString(@dxSBAR_RECURSIVEMENUS); + end; +end; + +function TdxBarCustomPopupMenu.CreateBarControl: TCustomdxBarControl; +begin + Result := GetControlClass.Create(BarManager); +end; + +function TdxBarCustomPopupMenu.GetItemLinks: TdxBarItemLinks; +begin + Result := FItemLinks; +end; + +// IdxBarSubMenuOwner +function TdxBarCustomPopupMenu.GetBarSize: Integer; +begin + Result := FBarSize; +end; + +procedure TdxBarCustomPopupMenu.DoPaintBar(Canvas: TCanvas; const R: TRect); +begin + if Assigned(FOnPaintBar) then FOnPaintBar(Self, Canvas, R); +end; + +procedure TdxBarCustomPopupMenu.Popup(X, Y: Integer); +var + Msg: TMsg; +begin + if FItemLinks.BarControl <> nil then + Exit; + + dxBar.SendCancelMode; + if not BarManager.IsCustomizing and (GetCapture <> 0) then + begin + SendMessage(GetCapture, CM_CANCELMODE, 0, 0); + ReleaseCapture; + end; + FItemLinks.CreateBarControl; + + FItemLinks.BarControl.Left := X; + FItemLinks.BarControl.Top := Y; + with TdxBarSubMenuControl(FItemLinks.BarControl) do + begin + if FOwnerItemControl <> nil then + FOwnerItemControl.Parent.ChildBar := FItemLinks.BarControl; + + if Self.FOwnerBounds <> nil then + OwnerBounds := Self.FOwnerBounds^; + FOwnerControl := Self.FOwnerControl; + OwnerWidth := Self.FOwnerWidth; + OwnerHeight := Self.FOwnerHeight; + if Self.Owner is TWinControl then + ParentWnd := TWinControl(Self.Owner).Handle; + OnCloseUp := SubMenuCloseUp; + OnPopup := SubMenuPopup; + FShowAnimation := Self.FShowAnimation; + try + Show; + except + HideAll; + raise; + end; + + if FUseOwnMessageLoop then + repeat + case Integer(GetMessage(Msg, 0, 0, 0)) of + -1: Break; + 0: begin + PostQuitMessage(Msg.wParam); + Break; + end; + end; + if not FPopupMenuVisible then + with Msg do + PostMessage(hwnd, message, wParam, lParam) + else + if Msg.message = WM_COMMAND then // do nothing + else + begin + TranslateMessage(Msg); + DispatchMessage(Msg); + end; + until not FPopupMenuVisible; + end; +end; + +procedure TdxBarCustomPopupMenu.PopupEx(X, Y, AOwnerWidth, AOwnerHeight: Integer; + AShowAnimation: Boolean; AOwnerBounds: PRect; AUseOwnMessageLoop: Boolean = True; + AOwnerControl: TWinControl = nil); +begin + FOwnerWidth := AOwnerWidth; + FOwnerHeight := AOwnerHeight; + FShowAnimation := AShowAnimation; + FOwnerBounds := AOwnerBounds; + FOwnerControl := AOwnerControl; + FUseOwnMessageLoop := AUseOwnMessageLoop; + Popup(X, Y); + FUseOwnMessageLoop := True; + FOwnerControl := nil; + FOwnerWidth := 0; + FOwnerHeight := 0; + FShowAnimation := True; +end; + +procedure TdxBarCustomPopupMenu.PopupFromCursorPos; +begin + with GetMouseCursorPos do + Popup(X, Y); +end; + +{ TdxBarCustomApplicationMenu } + +type + { TdxBarExtraPaneDockControlAccessibilityHelper } + + TdxBarExtraPaneDockControlAccessibilityHelper = class(TdxDockControlAccessibilityHelper) + protected + function GetParent: TcxAccessibilityHelper; override; + end; + + { TdxBarExtraPaneControlAccessibilityHelper } + + TdxBarExtraPaneControlAccessibilityHelper = class(TdxBarControlAccessibilityHelper) + protected + procedure DoGetKeyTipsData(AKeyTipsData: TList); override; + function GetNextAccessibleObject(AItemControl: TdxBarItemControl; + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; override; + function HandleNavigationKey(var AKey: Word): Boolean; override; + end; + + { TdxBarApplicationMenuControlAccessibilityHelper } + + TdxBarApplicationMenuControlAccessibilityHelper = class(TdxBarSubMenuControlAccessibilityHelper) + private + function GetBarControl: TdxBarApplicationMenuControl; + function GetNextLinks(ACurrentLinks: TdxBarItemLinks): TdxBarItemLinks; + function GetPreviousLinks(ACurrentLinks: TdxBarItemLinks): TdxBarItemLinks; + function InternalGetNextItemLink(ACurrentLinks: TdxBarItemLinks; + ASelectedLink: TdxBarItemLink; AUpKey: Boolean; AFirstVisibleIndex: Integer = 0): TdxBarItemLink; + procedure PopulateNavigationList(AList: TList); + protected + function GetChild(AIndex: Integer): TcxAccessibilityHelper; override; + function GetChildCount: Integer; override; + function GetChildIndex(AChild: TcxAccessibilityHelper): Integer; override; + + procedure GetItemControlKeyTipPosition(AItemControl: TdxBarItemControl; + out ABasePoint: TPoint; out AHorzAlign: TAlignment; out AVertAlign: TcxAlignmentVert); override; + function GetNextAccessibleObject(AItemControl: TdxBarItemControl; + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; override; + function GetNextItemLink(AItemLink: TdxBarItemLink; + AGoForward: Boolean): TdxBarItemLink; override; + function GetParentForKeyTip: TdxBarAccessibilityHelper; override; + + property BarControl: TdxBarApplicationMenuControl read GetBarControl; + end; + + TdxBarApplicationMenuControlDesignHelper = class(TCustomdxBarControlDesignHelper); + + TdxBarApplicationMenuItemLinks = class(TdxBarSubMenuControlItemLinks) + private + function GetInternalDefaultValue(AOption: TdxBarItemOptionValue; AItemLinks: TdxBarItemLinks): Variant; + protected + function GetDefaultValue(AOption: TdxBarItemOptionValue): Variant; override; + function GetOptionsValue(AOption: TdxBarItemOptionValue; AItemLinks: TdxBarItemLinks): Variant; override; + end; + +{ TdxBarExtraPaneDockControl } + +constructor TdxBarExtraPaneDockControl.Create(AOwner: TComponent); +begin + inherited; + AllowDocking := False; +end; + +procedure TdxBarExtraPaneDockControl.CalcRowToolbarPositions(ARowIndex: Integer; AClientSize: Integer); +var + AToolbar: TdxBarControl; + R: TRect; +begin + R := ClientRect; + AToolbar := Rows[0].Cols[0].BarControl; + if (AToolbar.Left <> R.Left) or (AToolbar.Top <> R.Top) or + (AToolbar.Width <> cxRectWidth(R)) or (AToolbar.Height <> cxRectHeight(R)) then + begin + if AToolbar.HandleAllocated then + begin + SetWindowPos(AToolbar.Handle, 0, R.Left, R.Top, + cxRectWidth(R), cxRectHeight(R), SWP_NOZORDER or SWP_NOACTIVATE); + SendMessage(AToolbar.Handle, WM_NCPAINT, 0, 0); + end + else + AToolbar.SetBounds(R.Left, R.Top, cxRectWidth(R), cxRectHeight(R)); + end; +end; + +function TdxBarExtraPaneDockControl.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxBarExtraPaneDockControlAccessibilityHelper; +end; + +function TdxBarExtraPaneDockControl.GetDockedBarControlClass: TdxBarControlClass; +begin + Result := TdxBarExtraPaneControl; +end; + +{ TdxBarExtraPaneDockControlAccessibilityHelper } + +function TdxBarExtraPaneDockControlAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := TdxBarApplicationMenuControl(DockControl.Parent).IAccessibilityHelper.GetBarHelper; +end; + +{ TdxBarExtraPaneControl } + +destructor TdxBarExtraPaneControl.Destroy; +begin + inherited; +end; + +procedure TdxBarExtraPaneControl.CalcControlsPositions; +begin + if not FIsControlsCreated then + CreateControls; + inherited; + CalcItemRects(ptMenu); +end; + +procedure TdxBarExtraPaneControl.CalcItemsRect; +begin + inherited; + FItemsRect.Left := FItemsRect.Left + MenuSeparatorSize; +end; + +function TdxBarExtraPaneControl.CanMoving: Boolean; +begin + Result := False; +end; + +function TdxBarExtraPaneControl.CanProcessMouseMessage: Boolean; +begin + Result := inherited CanProcessMouseMessage or TdxBarApplicationMenuControl(BasicControl).CanProcessMouseMessage; +end; + +procedure TdxBarExtraPaneControl.DoCreateControls; +begin + FIsControlsCreated := True; + if not IsCustomizing then + ExpandContainerItems; + inherited DoCreateControls; +end; + +procedure TdxBarExtraPaneControl.DoDestroyControls; +begin + inherited DoDestroyControls; + if not IsCustomizing then + CollapseContainerItems; + FIsControlsCreated := False; +end; + +procedure TdxBarExtraPaneControl.DoDrawBeginGroup(const ASeparatorRect: TRect; AHorz: Boolean); +begin + Painter.ExtraMenuControlDrawBeginGroup(Self, Canvas, ASeparatorRect, ToolbarBrush, AHorz); +end; + +procedure TdxBarExtraPaneControl.DoNCPaint(DC: HDC); +begin +// do nothing +end; + +procedure TdxBarExtraPaneControl.DoHideAll; +begin + inherited; + BasicControl.HideAll; +end; + +procedure TdxBarExtraPaneControl.DrawContentBackground; +begin + DrawBackground(Canvas, ClientRect, ToolbarBrush, clNone); +end; + +procedure TdxBarExtraPaneControl.FillBackground(ADC: HDC; const ARect: TRect; ABrush: HBRUSH; AColor: TColor; + AIsClientArea: Boolean); +begin + BarCanvas.BeginPaint(ADC); + try + DrawBackground(BarCanvas, ARect, ABrush, AColor); + finally + BarCanvas.EndPaint; + end; +end; + +function TdxBarExtraPaneControl.FindLinkWithAccel(AKey: Word; AShift: TShiftState; ACurrentLink: TdxBarItemLink; out ADuplicate: Boolean): TdxBarItemLink; +begin + Result := BasicControl.FindLinkWithAccel(AKey, AShift, ACurrentLink, ADuplicate); +end; + +function TdxBarExtraPaneControl.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxBarExtraPaneControlAccessibilityHelper; +end; + +function TdxBarExtraPaneControl.GetBehaviorOptions: TdxBarBehaviorOptions; +begin + Result := BasicControl.BehaviorOptions; +end; + +function TdxBarExtraPaneControl.GetPainter: TdxBarPainter; +begin + Result := BasicControl.Painter; +end; + +function TdxBarExtraPaneControl.GetViewInfoClass: TCustomdxBarControlViewInfoClass; +begin + Result := TdxBarExtraPaneControlViewInfo; +end; + +procedure TdxBarExtraPaneControl.HideAllByEscape; +begin + TdxBarApplicationMenuControl(BasicControl).HideByEscape; +end; + +procedure TdxBarExtraPaneControl.LayoutChanged; +begin +// do nothing; +end; + +procedure TdxBarExtraPaneControl.SetAccelSelectedItem(AItemControl: TdxBarItemControl; ADuplicate: Boolean); +begin + BasicControl.SetAccelSelectedItem(AItemControl, ADuplicate); +end; + +function TdxBarExtraPaneControl.CanShowPopupMenuOnMouseClick(AMousePressed: Boolean): Boolean; +begin + Result := BasicControl.CanShowPopupMenuOnMouseClick(AMousePressed); +end; + +procedure TdxBarExtraPaneControl.InitCustomizationPopup(AItemLinks: TdxBarItemLinks); +begin + BasicControl.InitCustomizationPopup(AItemLinks); +end; + +procedure TdxBarExtraPaneControl.ShowPopup(AItem: TdxBarItemControl); +begin + BasicControl.ShowPopup(AItem); +end; + +procedure TdxBarExtraPaneControl.DrawBackground(ACanvas: TcxCanvas; const ARect: TRect; ABrush: HBRUSH; AColor: TColor); +begin + Painter.ExtraMenuControlDrawBackground(Self, ACanvas, ARect, ABrush, AColor); +end; + +function TdxBarExtraPaneControl.GetBasicControl: TCustomdxBarControl; +begin + Result := TCustomdxBarControl(DockControl.Parent); +end; + +procedure TdxBarExtraPaneControl.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + if Message.CalcValidRects then + Message.Result := 0 + else + inherited; +end; + +{ TdxBarExtraPaneControlViewInfo } + +procedure TdxBarExtraPaneControlViewInfo.DoCalcSeparatorInfo(AItemLink: TdxBarItemLink; const AItemRect: TRect); +var + R: TRect; +begin + R := Rect(AItemRect.Left, AItemRect.Top - BarControl.BeginGroupSize, + AItemRect.Right, AItemRect.Top); + AddSeparatorInfo(R, skHorizontal, AItemLink.Control); +end; + +{ TdxBarExtraPaneControlAccessibilityHelper } + +procedure TdxBarExtraPaneControlAccessibilityHelper.DoGetKeyTipsData( + AKeyTipsData: TList); +begin +end; + +function TdxBarExtraPaneControlAccessibilityHelper.GetNextAccessibleObject( + AItemControl: TdxBarItemControl; + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; + + function BasicControlObject: TdxBarApplicationMenuControlAccessibilityHelper; + begin + Result := TdxBarApplicationMenuControlAccessibilityHelper( + TdxBarExtraPaneControl(BarControl).BasicControl.IAccessibilityHelper.GetHelper); + end; + +begin + Result := BasicControlObject.GetNextAccessibleObject(AItemControl, ADirection); +end; + +function TdxBarExtraPaneControlAccessibilityHelper.HandleNavigationKey(var AKey: Word): Boolean; +var + AShift: TShiftState; +begin + Result := False; + AShift := InternalGetShiftState; + if AKey = VK_TAB then + if AShift = [] then + AKey := VK_DOWN + else + AKey := VK_UP + else + Result := inherited HandleNavigationKey(AKey); +end; + +{ TdxBarApplicationMenuControl } + +constructor TdxBarApplicationMenuControl.Create(AOwner: TComponent); +begin + inherited; + + // to prohibit FBar from appearing in the Object TreeView + if NeedExtraPane then + begin + FDockControl := GetExtraPaneDockControlClass.Create(AOwner); + FDockControl.Align := dalNone; + FDockControl.BarManager := BarManager; + FDockControl.Parent := Self; + + BarManager.Bars.BeginUpdate; + try + FBar := BarManager.Bars.Add; + FBar.AllowQuickCustomizing := False; + FBar.AllowCustomizing := False; + FBar.NotDocking := [dsNone]; + FBar.Hidden := True; + FBar.Font := Font; + FBar.UseOwnFont := False; + finally + BarManager.Bars.EndUpdate(False); + end; + end; + FButtonLinks := TdxBarApplicationMenuButtonItemLinks.Create(BarManager, nil); + FButtonLinks.BarControl := Self; +end; + +destructor TdxBarApplicationMenuControl.Destroy; +begin + FreeAndNil(FButtonLinks); + FreeAndNil(FTotalItemLinks); + FreeAndNil(FBar); + FreeAndNil(FDockControl); + + inherited; +end; + +procedure TdxBarApplicationMenuControl.CalcItemRects(APaintStyle: TdxBarPaintType; ATopIndex: Integer); +begin + inherited CalcItemRects(APaintStyle, ATopIndex); + + ButtonLinks.CalcItemsRects(FButtonsRect); +end; + +procedure TdxBarApplicationMenuControl.CalcItemsRect; +begin + inherited CalcItemsRect; + FButtonsRect := FItemsRect; + FButtonsRect.Top := FItemsRect.Bottom; + FButtonsRect.Bottom := ContentRect.Bottom; + FButtonsRect := cxRectInflate(FButtonsRect, 0, -4, 1, -1); + if NeedExtraPane then + begin + FExtraPaneRect := FItemsRect; + Dec(FItemsRect.Right, FExtraPaneSize); + FExtraPaneRect.Left := FItemsRect.Right; + end; +end; + +function TdxBarApplicationMenuControl.CalcChildBarBounds(out ARect: TRect): Boolean; +begin + Result := NeedExtraPane; + if Result then + begin + ARect := FExtraPaneRect; + MapWindowRect(Handle, 0, ARect); + end; +end; + +procedure TdxBarApplicationMenuControl.DoCalcSize(out ASize: TSize); +begin + inherited DoCalcSize(ASize); + if ASize.cx = 0 then + ASize.cx := dxBarEmptySubMenuControlContentWidth; + if NeedExtraPane then + begin + if ApplicationMenu.ExtraPaneSize <> 0 then + FExtraPaneSize := MulDiv(ApplicationMenu.ExtraPaneSize, TextSize, Painter.SubMenuControlNormalItemHeight) + else + FExtraPaneSize := Round(ASize.cx * ApplicationMenu.ExtraPaneWidthRatio); + Inc(ASize.cx, FExtraPaneSize); + end; +end; + +function TdxBarApplicationMenuControl.GetViewInfoClass: TCustomdxBarControlViewInfoClass; +begin + Result := TdxBarApplicationMenuControlViewInfo; +end; + +function TdxBarApplicationMenuControl.GetExtraPaneDockControlClass: TdxBarDockControlClass; +begin + Result := TdxBarExtraPaneDockControl; +end; + +procedure TdxBarApplicationMenuControl.DoNCPaint(DC: HDC; const ARect: TRect); +begin + Painter.ApplicationMenuDrawBorder(Self, DC, ARect); +end; + +procedure TdxBarApplicationMenuControl.DoShow; +begin + if NeedExtraPane then + InitializeExtraPaneControl; + HandleNeeded; + CalcControlsPositions; + if NeedExtraPane then + ShowExtraPaneControl; + inherited; +end; + +procedure TdxBarApplicationMenuControl.DrawContent; +begin + inherited; + DrawContentArea(Canvas); +end; + +procedure TdxBarApplicationMenuControl.DrawContentArea(ACanvas: TcxCanvas); +var + AItemsArea: TRect; +begin + UnionRect(AItemsArea, ItemsRect, FExtraPaneRect); + UnionRect(AItemsArea, AItemsArea, BarRect); + ACanvas.SaveClipRegion; + try + ACanvas.SetClipRegion(TcxRegion.Create(ContentRect), roIntersect); + Painter.ApplicationMenuDrawContentArea(Self, ACanvas, ContentRect, AItemsArea); + finally + ACanvas.RestoreClipRegion; + end; +end; + +procedure TdxBarApplicationMenuControl.DoFillBackgroundEx(ACanvas: TcxCanvas; + const ARect: TRect; ABrush: HBRUSH; AColor: TColor; AIsClientArea: Boolean); +begin + inherited; + DrawContentArea(ACanvas); +end; + +function TdxBarApplicationMenuControl.DoFindLinkWithAccel(AKey: Word; AShift: TShiftState; ACurrentLink: TdxBarItemLink): TdxBarItemLink; +begin + Result := TotalItemLinks.FindItemWithAccel(AKey, AShift, ACurrentLink); +end; + +function TdxBarApplicationMenuControl.FindLinkWithAccel(AKey: Word; AShift: TShiftState; ACurrentLink: TdxBarItemLink; out ADuplicate: Boolean): TdxBarItemLink; + + procedure PopulateTotalItemLinks; + + procedure InternalAssign(AItemLinks: TdxBarItemLinks); + var + I: Integer; + ALink: TdxBarItemLink; + begin + if AItemLinks <> nil then + for I := 0 to AItemLinks.Count - 1 do + begin + ALink := TotalItemLinks.Add; + ALink.Assign(AItemLinks[I]); + ALink.Data := Integer(AItemLinks[I]); + end; + end; + + begin + TotalItemLinks.BeginUpdate; + try + TotalItemLinks.Clear; + InternalAssign(ItemLinks); + InternalAssign(ExtraPaneItemLinks); + InternalAssign(ButtonLinks); + finally + TotalItemLinks.EndUpdate; + end; + end; + + function ImportCurrentLink(ACurrentLink: TdxBarItemLink): TdxBarItemLink; + var + I: Integer; + begin + Result := nil; + if ACurrentLink <> nil then + for I := 0 to TotalItemLinks.Count - 1 do + if TotalItemLinks[I].Data = Integer(ACurrentLink) then + begin + Result := TotalItemLinks[I]; + Break; + end; + end; + + function ExportCurrentLink(ACurrentLink: TdxBarItemLink): TdxBarItemLink; + begin + if ACurrentLink <> nil then + Result := TdxBarItemLink(ACurrentLink.Data) + else + Result := nil; + end; + +begin + PopulateTotalItemLinks; + Result := ExportCurrentLink(inherited FindLinkWithAccel(AKey, AShift, ImportCurrentLink(ACurrentLink), ADuplicate)); +end; + +function TdxBarApplicationMenuControl.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxBarApplicationMenuControlAccessibilityHelper; +end; + +function TdxBarApplicationMenuControl.GetBehaviorOptions: TdxBarBehaviorOptions; +begin + Result := [bboAllowSelectWindowItemsWithoutFocusing, bboAllowShowHints, + bboClickItemsBySpaceKey, bboExtendItemWhenAlignedToClient, bboUnmoved]; +end; + +function TdxBarApplicationMenuControl.GetItemsRectOffset: TRect; + + function Scale(const ARect: TRect; ARatio: Double): TRect; + begin + Result.Left := Round(ARect.Left * ARatio); + Result.Top := Round(ARect.Top * ARatio); + Result.Right := Round(ARect.Right * ARatio); + Result.Bottom := Round(ARect.Bottom * ARatio); + end; + +var + AFrameSizes: TRect; +begin + Result := inherited GetItemsRectOffset; + AFrameSizes := Scale(Painter.ApplicationMenuGetFrameSizes, Ratio); + Result.Left := Result.Left + AFrameSizes.Left; + Result.Top := Result.Top + AFrameSizes.Top; + Result.Right := Result.Right + AFrameSizes.Right; + Result.Bottom := Result.Bottom + AFrameSizes.Bottom; +end; + +function TdxBarApplicationMenuControl.IsControlExists(ABarItemControl: TdxBarItemControl): Boolean; +begin + Result := inherited IsControlExists(ABarItemControl) or (ButtonLinks.IsControlExists(ABarItemControl)); +end; + +procedure TdxBarApplicationMenuControl.SetAccelSelectedItem(AItemControl: TdxBarItemControl; ADuplicate: Boolean); +begin + if BarNavigationController.SelectedObject <> nil then + BarNavigationController.SelectedObject.Unselect(AItemControl.IAccessibilityHelper); + AItemControl.IAccessibilityHelper.Select(True); + if not ADuplicate then + SendMessage(AItemControl.Parent.Handle, WM_KEYDOWN, VK_RETURN, 0); +end; + +procedure TdxBarApplicationMenuControl.SetControlVisible(AControl: TdxBarItemControl); +begin + if AControl.GetPaintType = ptMenu then + inherited SetControlVisible(AControl); +end; + +procedure TdxBarApplicationMenuControl.SetItemLinks(Value: TdxBarItemLinks); +begin + inherited; + FButtonLinks.FLinksOwner := ApplicationMenu; +end; + +procedure TdxBarApplicationMenuControl.InitializeExtraPaneControl; +begin + ApplicationMenu.Buttons.PopulateItemLinks(ButtonLinks); + ExtraPaneItemLinks.Add(ApplicationMenu.ExtraPane.ListItem); +end; + +procedure TdxBarApplicationMenuControl.ShowExtraPaneControl; +begin + FBar.DockControl := FDockControl; + FBar.BorderStyle := bbsNone; + FBar.Visible := True; + SetWindowPos(FDockControl.Handle, 0, + FExtraPaneRect.Left, FExtraPaneRect.Top, cxRectWidth(FExtraPaneRect), cxRectHeight(FExtraPaneRect), + SWP_NOZORDER or SWP_NOACTIVATE or SWP_SHOWWINDOW); +end; + +function TdxBarApplicationMenuControl.GetApplicationMenu: TdxBarCustomApplicationMenu; +begin + Result := TdxBarCustomApplicationMenu(ItemLinks.Owner); +end; + +function TdxBarApplicationMenuControl.GetExtraPaneItemLinks: TdxBarItemLinks; +begin + if NeedExtraPane then + Result := FBar.ItemLinks + else + Result := nil; +end; + +function TdxBarApplicationMenuControl.GetTotalItemLinks: TdxBarItemLinks; +begin + if FTotalItemLinks = nil then + FTotalItemLinks := TdxBarSubMenuControlItemLinks.Create(BarManager, ApplicationMenu); + Result := FTotalItemLinks; +end; + +function TdxBarApplicationMenuControl.NeedExtraPane: Boolean; +begin + // see constructor + Result := not IsCustomizing; +end; + +{ TdxBarApplicationMenuControlViewInfo } + +function TdxBarApplicationMenuControlViewInfo.GetBarControl: TdxBarApplicationMenuControl; +begin + Result := TdxBarApplicationMenuControl(inherited GetBarControl); +end; + +procedure TdxBarApplicationMenuControlViewInfo.Calculate; +var + I: Integer; + AControl: TdxBarItemControl; + ALinks: TdxBarItemLinks; + AVisibleItemRect: TRect; +begin + inherited Calculate; + if ItemControlCount > 0 then + begin + ALinks := BarControl.ButtonLinks; + for I := 0 to ALinks.VisibleItemCount - 1 do + begin + AControl := ALinks.VisibleItems[I].Control; + AVisibleItemRect := BarControl.GetItemRect(AControl); + if not IsRectEmpty(AVisibleItemRect) then + begin + AddItemControlViewInfo(AControl.ViewInfo); + IdxBarItemControlViewInfo(AControl.ViewInfo).SetBounds(AVisibleItemRect); + end; + end; + end; +end; + +{ TdxBarApplicationMenuControlAccessibilityHelper } + +function TdxBarApplicationMenuControlAccessibilityHelper.GetChild( + AIndex: Integer): TcxAccessibilityHelper; +begin + if AIndex = ChildCount - 1 then + Result := BarControl.ExtraPaneControlDockControl.IAccessibilityHelper.GetHelper + else + Result := inherited GetChild(AIndex); +end; + +function TdxBarApplicationMenuControlAccessibilityHelper.GetChildCount: Integer; +begin + Result := inherited GetChildCount + 1; +end; + +function TdxBarApplicationMenuControlAccessibilityHelper.GetChildIndex( + AChild: TcxAccessibilityHelper): Integer; +begin + if AChild = BarControl.ExtraPaneControlDockControl.IAccessibilityHelper.GetHelper then + Result := inherited GetChildCount + else + Result := inherited GetChildIndex(AChild); +end; + +procedure TdxBarApplicationMenuControlAccessibilityHelper.GetItemControlKeyTipPosition( + AItemControl: TdxBarItemControl; out ABasePoint: TPoint; + out AHorzAlign: TAlignment; out AVertAlign: TcxAlignmentVert); +begin + if BarControl.ButtonLinks.IndexOf(AItemControl.ItemLink) <> -1 then + begin + ABasePoint := cxRectCenter(GetItemControlScreenBounds(AItemControl)); + AHorzAlign := taCenter; + AVertAlign := vaBottom; + end + else + inherited GetItemControlKeyTipPosition(AItemControl, ABasePoint, AHorzAlign, AVertAlign); +end; + +function TdxBarApplicationMenuControlAccessibilityHelper.GetNextAccessibleObject( + AItemControl: TdxBarItemControl; + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; + + function GetScreenBoundsForNavigation: TRect; + begin + if (BarControl.ItemLinks.IsControlExists(AItemControl)) then + begin + Result := AItemControl.ItemBounds; + Result.Top := BarControl.ItemsRect.Top; + if BarControl.ExtraPaneItemLinks.RealVisibleItemCount > 1 then + Result.Bottom := BarControl.ItemsRect.Bottom + else + Result.Bottom := BarControl.ContentRect.Bottom; + Result.TopLeft := BarControl.ClientToScreen(Result.TopLeft); + Result.BottomRight := BarControl.ClientToScreen(Result.BottomRight); + end + else + Result := AItemControl.IAccessibilityHelper.GetBarHelper.GetScreenBounds(cxAccessibleObjectSelfID); + end; + +var + AObjects: TList; + AItemLink: TdxBarItemLink; + ASelectedLink: TdxBarItemLink; +begin + if ADirection in [andUp, andDown] then + begin + ASelectedLink := BarControl.FBar.Control.SelectedLink; + if ASelectedLink = nil then + AItemLink := BarControl.ItemLinks.First + else + AItemLink := InternalGetNextItemLink(BarControl.ExtraPaneItemLinks, ASelectedLink, ADirection = andUp, 1); + if AItemLink <> nil then + Result := AItemLink.Control.IAccessibilityHelper; + end + else + begin + AObjects := TList.Create; + try + GetChildrenForNavigation(AItemControl.IAccessibilityHelper.GetBarHelper, Self, + GetScreenBoundsForNavigation, ADirection, True, AObjects); + Result := dxBar.GetNextAccessibleObject( + AItemControl.IAccessibilityHelper.GetBarHelper, AObjects, ADirection, True); + finally + AObjects.Free; + end; + end; +end; + +function TdxBarApplicationMenuControlAccessibilityHelper.GetNextItemLink( + AItemLink: TdxBarItemLink; AGoForward: Boolean): TdxBarItemLink; +var + ACurrentLinks: TdxBarItemLinks; +begin + if AItemLink = nil then + begin + if ItemLinks.RealVisibleItemCount > 0 then + Result := ItemLinks.First + else + Result := nil; + end + else + begin + ACurrentLinks := ItemLinks; + if BarControl.ButtonLinks.IsControlExists(AItemLink.Control) then + ACurrentLinks := BarControl.ButtonLinks; + Result := InternalGetNextItemLink(ACurrentLinks, AItemLink, not AGoForward); + end; +end; + +function TdxBarApplicationMenuControlAccessibilityHelper.GetParentForKeyTip: TdxBarAccessibilityHelper; +var + AIAccessibleObject: IdxBarAccessibleObject; +begin + if Supports(BarControl.RealOwnerControl, IdxBarAccessibleObject, AIAccessibleObject) then + Result := AIAccessibleObject.GetAccessibilityHelper.GetBarHelper + else + Result := nil; +end; + +function TdxBarApplicationMenuControlAccessibilityHelper.GetBarControl: TdxBarApplicationMenuControl; +begin + Result := TdxBarApplicationMenuControl(FOwnerObject); +end; + +function TdxBarApplicationMenuControlAccessibilityHelper.GetNextLinks(ACurrentLinks: TdxBarItemLinks): TdxBarItemLinks; +var + AIndex: Integer; + AList: TList; +begin + AList := TList.Create; + try + PopulateNavigationList(AList); + AIndex := AList.IndexOf(ACurrentLinks); + if AIndex < AList.Count - 1 then + Inc(AIndex) + else + AIndex := 0; + Result := TdxBarItemLinks(AList[AIndex]) + finally + AList.Free; + end; +end; + +function TdxBarApplicationMenuControlAccessibilityHelper.GetPreviousLinks(ACurrentLinks: TdxBarItemLinks): TdxBarItemLinks; +var + AIndex: Integer; + AList: TList; +begin + AList := TList.Create; + try + PopulateNavigationList(AList); + AIndex := AList.IndexOf(ACurrentLinks); + if AIndex > 0 then + Dec(AIndex) + else + AIndex := AList.Count - 1; + Result := TdxBarItemLinks(AList[AIndex]) + finally + AList.Free; + end; +end; + +function TdxBarApplicationMenuControlAccessibilityHelper.InternalGetNextItemLink(ACurrentLinks: TdxBarItemLinks; + ASelectedLink: TdxBarItemLink; AUpKey: Boolean; AFirstVisibleIndex: Integer = 0): TdxBarItemLink; +begin + if AUpKey then + if ASelectedLink.VisibleIndex = AFirstVisibleIndex then + Result := GetPreviousLinks(ACurrentLinks).Last + else + Result := ACurrentLinks.Prev(ASelectedLink) + else + if ASelectedLink.VisibleIndex = ACurrentLinks.RealVisibleItemCount - 1 then + Result := GetNextLinks(ACurrentLinks).First + else + Result := ACurrentLinks.Next(ASelectedLink); +end; + +procedure TdxBarApplicationMenuControlAccessibilityHelper.PopulateNavigationList(AList: TList); +begin + if BarControl.ItemLinks.RealVisibleItemCount > 0 then + AList.Add(BarControl.ItemLinks); + if BarControl.ExtraPaneItemLinks.RealVisibleItemCount > 1 then + AList.Add(BarControl.ExtraPaneItemLinks); + if BarControl.ButtonLinks.RealVisibleItemCount > 0 then + AList.Add(BarControl.ButtonLinks); +end; + +{ TdxBarApplicationMenuItemLinks } + +function TdxBarApplicationMenuItemLinks.GetDefaultValue(AOption: TdxBarItemOptionValue): Variant; +begin + Result := GetInternalDefaultValue(AOption, nil); +end; + +function TdxBarApplicationMenuItemLinks.GetOptionsValue(AOption: TdxBarItemOptionValue; AItemLinks: TdxBarItemLinks): Variant; +begin + if not ItemOptions.IsValueStored(AOption) and (GetParentLinks = nil) then + Result := GetInternalDefaultValue(AOption, AItemLinks) + else + Result := inherited GetOptionsValue(AOption, AItemLinks); +end; + +function TdxBarApplicationMenuItemLinks.GetInternalDefaultValue(AOption: TdxBarItemOptionValue; AItemLinks: TdxBarItemLinks): Variant; +begin + case AOption of + ioShowDescriptions: Result := AItemLinks <> Self; + ioShowShortCuts: Result := False; + else {ioSize} + Result := misLarge; + end; +end; + +{ TdxExtraPaneItem } + +constructor TdxBarExtraPaneItem.Create(Collection: TCollection); +begin + inherited; + ImageIndex := -1; +end; + +procedure TdxBarExtraPaneItem.Assign(Source: TPersistent); +begin + if Source is TdxBarExtraPaneItem then + begin + Data := TdxBarExtraPaneItem(Source).Data; + DisplayText := TdxBarExtraPaneItem(Source).DisplayText; + ImageIndex := TdxBarExtraPaneItem(Source).ImageIndex; + Text := TdxBarExtraPaneItem(Source).Text; + end + else + inherited; +end; + +procedure TdxBarExtraPaneItem.SetDisplayText(const Value: string); +begin + if DisplayText <> Value then + begin + FDisplayText := Value; + Changed(False); + end; +end; + +procedure TdxBarExtraPaneItem.SetText(const Value: string); +begin + if Text <> Value then + begin + FText := Value; + Changed(False); + end; +end; + +{ TdxExtraPaneItems } + +constructor TdxBarExtraPaneItems.Create(AApplicationMenu: TdxBarCustomApplicationMenu); +begin + inherited Create(TdxBarExtraPaneItem); + FApplicationMenu := AApplicationMenu; +end; + +function TdxBarExtraPaneItems.Add: TdxBarExtraPaneItem; +begin + Result := TdxBarExtraPaneItem(inherited Add); +end; + +function TdxBarExtraPaneItems.IndexOf(const AItemText: string): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Count - 1 do + if Items[I].Text = AItemText then + begin + Result := I; + Break; + end; +end; + +function TdxBarExtraPaneItems.Insert(AIndex: Integer): TdxBarExtraPaneItem; +begin + Result := TdxBarExtraPaneItem(inherited Insert(AIndex)); +end; + +function TdxBarExtraPaneItems.GetOwner: TPersistent; +begin + Result := FApplicationMenu; +end; + +function TdxBarExtraPaneItems.GetItem(Index: Integer): TdxBarExtraPaneItem; +begin + Result := TdxBarExtraPaneItem(inherited GetItem(Index)); +end; + +procedure TdxBarExtraPaneItems.SetItem(Index: Integer; Value: TdxBarExtraPaneItem); +begin + inherited SetItem(Index, Value); +end; + +{ TdxBarApplicationMenuExtraPane } + +constructor TdxBarApplicationMenuExtraPane.Create(AnApplicationMenu: TdxBarCustomApplicationMenu); +begin + inherited Create; + + FApplicationMenu := AnApplicationMenu; + + FWidthRatio := dxBarExtraPaneWidthRatio; + FListItem := TdxBarExtraPaneListItem.Create(FApplicationMenu.BarManager); + FListItem.Caption := dxBarExtraPaneHeader; + FListItem.OnClick := ItemClick; + FListItem.OnGetDisplayText := GetItemDisplayText; + BarDesignController.RemoveItemFromBarManagerList(FListItem); + FItems := TdxBarExtraPaneItems.Create(FApplicationMenu); +end; + +destructor TdxBarApplicationMenuExtraPane.Destroy; +begin + FreeAndNil(FItems); + FreeAndNil(FListItem); + inherited; +end; + +procedure TdxBarApplicationMenuExtraPane.Assign(Source: TPersistent); +var + AExtraPane: TdxBarApplicationMenuExtraPane; +begin + if Source is TdxBarApplicationMenuExtraPane then + begin + AExtraPane := TdxBarApplicationMenuExtraPane(Source); + WidthRatio := AExtraPane.WidthRatio; + Size := AExtraPane.Size; + Items := AExtraPane.Items; + Header := AExtraPane.Header; + OnItemClick := AExtraPane.OnItemClick; + end + else + inherited; +end; + +function TdxBarApplicationMenuExtraPane.GetOwner: TPersistent; +begin + Result := FApplicationMenu; +end; + +function TdxBarApplicationMenuExtraPane.IsHeaderStored: Boolean; +begin + Result := Header <> dxBarExtraPaneHeader; +end; + +function TdxBarApplicationMenuExtraPane.IsWidthRatioStored: Boolean; +begin + Result := FWidthRatio <> dxBarExtraPaneWidthRatio; +end; + +function TdxBarApplicationMenuExtraPane.GetHeader: string; +begin + Result := FListItem.Caption; +end; + +function TdxBarApplicationMenuExtraPane.GetListItem: TdxBarExtraPaneListItem; +var + I: Integer; +begin + FListItem.Items.BeginUpdate; + try + FListItem.Items.Clear; + for I := 0 to FItems.Count - 1 do + FListItem.Items.AddObject(FItems[I].Text, FItems[I]); + finally + FListItem.Items.EndUpdate; + end; + Result := FListItem; +end; + +procedure TdxBarApplicationMenuExtraPane.SetItems(AValue: TdxBarExtraPaneItems); +begin + FItems.Assign(AValue); +end; + +procedure TdxBarApplicationMenuExtraPane.SetHeader(AValue: string); +begin + FListItem.Caption := AValue; +end; + +procedure TdxBarApplicationMenuExtraPane.ItemClick(Sender: TObject); +begin + if Assigned(OnItemClick) then + OnItemClick(FApplicationMenu, FListItem.ItemIndex); +end; + +procedure TdxBarApplicationMenuExtraPane.GetItemDisplayText(Sender: TObject; AIndex: Integer; var ADisplayText: string); +begin + if Assigned(OnGetItemDisplayText) then + OnGetItemDisplayText(FApplicationMenu, AIndex, ADisplayText); +end; + +{ TdxBarApplicationMenuButton } + +constructor TdxBarApplicationMenuButton.Create(Collection: TCollection); +begin + inherited Create(Collection); + + FInternalItem := TdxBarApplicationMenuButtonItem.Create(Self.Collection.FApplicationMenu.BarManager); + InternalItem.Visible := ivNever; + InternalItem.OnClick := ButtonClick; + BarDesignController.RemoveItemFromBarManagerList(FInternalItem); + + FNotifyList := TdxBarComponentList.Create; + FNotifyList.OnComponentListChanged := ExternalItemChanged; +end; + +destructor TdxBarApplicationMenuButton.Destroy; +begin + FreeAndNil(FNotifyList); + FreeAndNil(FInternalItem); + inherited Destroy; +end; + +procedure TdxBarApplicationMenuButton.Assign(Source: TPersistent); +var + ASource: TdxBarApplicationMenuButton; +begin + if Source is TdxBarApplicationMenuButton then + begin + ASource := TdxBarApplicationMenuButton(Source); + Width := ASource.Width; + Item := ASource.Item; + end + else + inherited Assign(Source); +end; + +function TdxBarApplicationMenuButton.GetCollection: TdxBarApplicationMenuButtons; +begin + Result := TdxBarApplicationMenuButtons(inherited Collection); +end; + +function TdxBarApplicationMenuButton.GetWidth: Integer; +begin + Result := FInternalItem.Width; +end; + +procedure TdxBarApplicationMenuButton.SetItem(Value: TdxBarButton); +begin + if FExternalItem <> Value then + begin + FNotifyList.BeginUpdate; + try + FNotifyList.Extract(FExternalItem); + FNotifyList.Add(Value); + FExternalItem := Value; + finally + FNotifyList.EndUpdate; + end; + end; +end; + +procedure TdxBarApplicationMenuButton.SetWidth(Value: Integer); +begin + InternalItem.Width := Value; +end; + +procedure TdxBarApplicationMenuButton.ButtonClick(Sender: TObject); +begin + if Item <> nil then + CallNotify(Item.OnClick, Item); +end; + +procedure TdxBarApplicationMenuButton.ExternalItemChanged(Sender: TObject; + AComponent: TComponent; AAction: TcxComponentCollectionNotification); +begin + if AAction = ccnExtracted then + Item := nil + else + UpdateInternalItem; +end; + +procedure TdxBarApplicationMenuButton.UpdateInternalItem; +var + AItem: TdxBarButton; +begin + AItem := Item; + if Item <> nil then + begin + InternalItem.Caption := AItem.Caption; + InternalItem.Enabled := AItem.Enabled; + InternalItem.Glyph := AItem.Glyph; + InternalItem.Hint := AItem.Hint; + InternalItem.ImageIndex := AItem.ImageIndex; + InternalItem.ScreenTip := AItem.ScreenTip; + InternalItem.Visible := AItem.Visible; + end + else + begin + InternalItem.Caption := ''; + InternalItem.Enabled := True; + InternalItem.Glyph := nil; + InternalItem.Hint := ''; + InternalItem.ImageIndex := -1; + InternalItem.ScreenTip := nil; + InternalItem.Visible := ivNever; + end; +end; + +{ TdxBarApplicationMenuButtons } + +constructor TdxBarApplicationMenuButtons.Create(AApplicationMenu: TdxBarCustomApplicationMenu); +begin + inherited Create(TdxBarApplicationMenuButton); + FApplicationMenu := AApplicationMenu; +end; + +function TdxBarApplicationMenuButtons.Add: TdxBarApplicationMenuButton; +begin + Result := TdxBarApplicationMenuButton(inherited Add); +end; + +function TdxBarApplicationMenuButtons.Insert(AIndex: Integer): TdxBarApplicationMenuButton; +begin + Result := TdxBarApplicationMenuButton(inherited Insert(AIndex)); +end; + +function TdxBarApplicationMenuButtons.GetOwner: TPersistent; +begin + Result := FApplicationMenu; +end; + +function TdxBarApplicationMenuButtons.GetItem(Index: Integer): TdxBarApplicationMenuButton; +begin + Result := TdxBarApplicationMenuButton(inherited GetItem(Index)); +end; + +procedure TdxBarApplicationMenuButtons.SetItem(Index: Integer; Value: TdxBarApplicationMenuButton); +begin + inherited SetItem(Index, Value); +end; + +procedure TdxBarApplicationMenuButtons.PopulateItemLinks(AItemLinks: TdxBarItemLinks); +var + I: Integer; +begin + for I := 0 to Count - 1 do + AItemLinks.Add(Items[I].InternalItem); +end; + +{ TdxBarApplicationMenuButtonItemLinks } + +procedure TdxBarApplicationMenuButtonItemLinks.CalcItemsRects(ARect: TRect); +const + ApplicationMenuButtonsControlOffset = 6; // !!! +var + I: Integer; + AItemLink: TdxBarItemLink; + AItemRect: TRect; + AOffsetItemBounds: Integer; +begin + EmptyItemRects; + AItemRect := ARect; + for I := 0 to VisibleItemCount - 1 do + begin + AItemLink := VisibleItems[I]; + AItemLink.CreateControl; + AItemRect.Right := AItemRect.Left + AItemLink.Control.Width; + if AItemRect.Right > ARect.Right then + Break; + AItemLink.ItemRect := AItemRect; + AItemRect.Left := AItemRect.Right + ApplicationMenuButtonsControlOffset; + end; + if RealVisibleItemCount > 0 then + AOffsetItemBounds := ARect.Right - VisibleItems[RealVisibleItemCount - 1].ItemRect.Right + else + AOffsetItemBounds := 0; + for I := 0 to RealVisibleItemCount - 1 do + begin + AItemLink := VisibleItems[I]; + AItemLink.ItemRect := cxRectOffsetHorz(AItemLink.ItemRect, AOffsetItemBounds); + end; +end; + +function TdxBarApplicationMenuButtonItemLinks.IsScrollable: Boolean; +begin + Result := False; +end; + +{ TdxBarCustomApplicationMenu } + +constructor TdxBarCustomApplicationMenu.Create(AOwner: TComponent); +begin + inherited; + FExtraPane := TdxBarApplicationMenuExtraPane.Create(Self); + FButtons := TdxBarApplicationMenuButtons.Create(Self); +end; + +destructor TdxBarCustomApplicationMenu.Destroy; +begin + FreeAndNil(FButtons); + FreeAndNil(FExtraPane); + inherited; +end; + +function TdxBarCustomApplicationMenu.GetControlClass: TCustomdxBarControlClass; +begin + Result := TdxBarApplicationMenuControl; +end; + +function TdxBarCustomApplicationMenu.GetItemLinksClass: TdxBarItemLinksClass; +begin + Result := TdxBarApplicationMenuItemLinks; +end; + +function TdxBarCustomApplicationMenu.IsShortCut(AShortCut: TShortCut): Boolean; +begin + Result := ItemLinks.IsShortCut(AShortCut); +end; + +function TdxBarCustomApplicationMenu.GetExtraPaneWidthRatio: Double; +begin + Result := FExtraPane.WidthRatio; +end; + +function TdxBarCustomApplicationMenu.GetExtraPaneSize: Integer; +begin + Result := FExtraPane.Size; +end; + +function TdxBarCustomApplicationMenu.GetExtraPaneItems: TdxBarExtraPaneItems; +begin + Result := FExtraPane.Items; +end; + +function TdxBarCustomApplicationMenu.GetExtraPaneHeader: string; +begin + Result := FExtraPane.Header; +end; + +function TdxBarCustomApplicationMenu.GetOnExtraPaneItemClick: TdxBarExtraPaneNotifyEvent; +begin + Result := FExtraPane.OnItemClick; +end; + +procedure TdxBarCustomApplicationMenu.SetButtons(AValue: TdxBarApplicationMenuButtons); +begin + FButtons.Assign(AValue); +end; + +procedure TdxBarCustomApplicationMenu.SetExtraPane(AValue: TdxBarApplicationMenuExtraPane); +begin + FExtraPane.Assign(AValue); +end; + +procedure TdxBarCustomApplicationMenu.SetExtraPaneWidthRatio(AValue: Double); +begin + FExtraPane.WidthRatio := AValue; +end; + +procedure TdxBarCustomApplicationMenu.SetExtraPaneSize(AValue: Integer); +begin + FExtraPane.Size := AValue; +end; + +procedure TdxBarCustomApplicationMenu.SetExtraPaneItems(AValue: TdxBarExtraPaneItems); +begin + FExtraPane.Items := AValue; +end; + +procedure TdxBarCustomApplicationMenu.SetExtraPaneHeader(AValue: string); +begin + FExtraPane.Header := AValue; +end; + +procedure TdxBarCustomApplicationMenu.SetOnExtraPaneItemClick(AValue: TdxBarExtraPaneNotifyEvent); +begin + FExtraPane.OnItemClick := AValue; +end; + +{ TdxDockControl } + +constructor TdxDockControl.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FBackgroundBitmap := dxBarCreateBitmap(BitmapChanged); + FBackgroundTempBitmap := TBitmap.Create; + ParentColor := True; + FAllowDocking := True; + FRowMarginSize := InsertZone; + FRowList := TList.Create; +end; + +constructor TdxDockControl.CreateEx(AOwner: TComponent; + ABarManager: TdxBarManager; ADockStyle: TdxBarDockingStyle); +const + Styles: array[dsLeft..dsBottom] of TAlign = + (alLeft, alTop, alRight, alBottom); +begin + Create(AOwner); + Align := Styles[ADockStyle]; + ControlStyle := [csDoubleClicks, csNoDesignVisible]; + if ADockStyle = dsTop then + ControlStyle := ControlStyle + [csActionClient]; + FDockingStyle := ADockStyle; + BarManager := ABarManager; +end; + +destructor TdxDockControl.Destroy; +begin +//#DG Destroying; + BarAccessibilityHelperOwnerObjectDestroyed(FIAccessibilityHelper); + BarManager := nil; + while RowCount <> 0 do + begin + while Rows[0].ColCount <> 0 do + Rows[0].DeleteCol(0); + Rows[0].Free; + RowList.Delete(0); + end; + FreeAndNil(FRowList); + FreeAndNil(FBackgroundTempBitmap); + FreeAndNil(FBackgroundBitmap); + inherited Destroy; +end; + +procedure TdxDockControl.BitmapChanged(Sender: TObject); +begin + Invalidate; + UpdateDoubleBuffered; + RepaintBarControls; +end; + +function TdxDockControl.GetBars: TdxBars; +begin + if FBarManager = nil then + Result := nil + else + Result := FBarManager.Bars; +end; + +function TdxDockControl.GetDockingStyle: TdxBarDockingStyle; +const + Styles: array[TAlign] of TdxBarDockingStyle = + (dsTop, dsTop, dsBottom, dsLeft, dsRight, dsTop{$IFDEF DELPHI6}, dsTop{$ENDIF}); +begin + Result := Styles[Align]; +end; + +function TdxDockControl.GetHorizontal: Boolean; +begin + Result := DockingStyle in [dsTop, dsBottom]; +end; + +function TdxDockControl.GetIAccessibilityHelper: IdxBarAccessibilityHelper; +begin + if FIAccessibilityHelper = nil then + FIAccessibilityHelper := GetAccessibilityHelper(GetAccessibilityHelperClass.Create(Self)); + Result := FIAccessibilityHelper; +end; + +function TdxDockControl.GetIsDesigning: Boolean; +begin + Result := csDesigning in ComponentState; +end; + +function TdxDockControl.GetIsLoading: Boolean; +begin + Result := csLoading in ComponentState; +end; + +function TdxDockControl.GetMain: Boolean; +begin + Result := FDockingStyle <> dsNone; +end; + +function TdxDockControl.GetRow(Index: Integer): TdxDockRow; +begin + Result := FRowList[Index]; +end; + +function TdxDockControl.GetRowCount: Integer; +begin + Result := FRowList.Count; +end; + +function TdxDockControl.GetTopLeft: Boolean; +begin + Result := DockingStyle in [dsLeft, dsTop]; +end; + +function TdxDockControl.GetVertical: Boolean; +begin + Result := DockingStyle in [dsLeft, dsRight]; +end; + +procedure TdxDockControl.SetBarManager(Value: TdxBarManager); +begin + if FBarManager <> Value then + begin + if FBarManager <> nil then + FBarManager.RemoveDockControl(Self); + FBarManager := Value; + if FBarManager <> nil then + FBarManager.AddDockControl(Self); + BarManagerChanged; + end; +end; + +procedure TdxDockControl.SetBackgroundBitmap(Value: TBitmap); +var + AChanged: Boolean; +begin + AChanged := not ((Value = nil) and FBackgroundBitmap.Empty); + FBackgroundBitmap.Assign(Value); + if AChanged then + BitmapChanged(nil); +end; + +procedure TdxDockControl.WMDestroy(var Message: TMessage); +begin + if FBarManager <> nil then + FBarManager.CreateBarRestoringList; + inherited; +end; + +procedure TdxDockControl.WMEraseBkgnd(var Message: TWMEraseBkgnd); +var + R: TRect; +begin + R := ClientRect; + FillBackground(Message.DC, R, R, 0, Color); + Message.Result := 1; +end; + +procedure TdxDockControl.WMGetObject(var Message: TMessage); +begin +// if CanReturnAccessibleObject(Message) then +// Message.Result := WMGetObjectResultFromIAccessibilityHelper(Message, IAccessibilityHelper) +// else + inherited; +end; + +procedure TdxDockControl.WMLButtonDblClk(var Message: TWMLButtonDblClk); +begin + if (FBarManager <> nil) and FBarManager.CanCustomize then + FBarManager.Customizing(True); + Message.Result := 0; +end; + +procedure TdxDockControl.WMMouseActivate(var Message: TWMMouseActivate); +begin + inherited; + if (FBarManager <> nil) and not IsDesigning and (GetParentPopupWindow(Self, True) = nil) then + begin + Message.Result := MA_NOACTIVATE; + dxSetZOrder(MainForm.Handle, HWND_TOP, True); + end; +end; + +procedure TdxDockControl.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + inherited; + if SunkenBorder then + InflateRect(Message.CalcSize_Params.rgrc[0], -1, -1); +end; + +procedure TdxDockControl.WMNCPaint(var Message: TWMNCPaint); +var + R: TRect; + DC: HDC; +begin + inherited; + if SunkenBorder then + begin + GetWindowRect(Handle, R); + OffsetRect(R, -R.Left, -R.Top); + DC := GetWindowDC(Handle); + DrawEdge(DC, R, BDR_SUNKENOUTER, BF_RECT); + ReleaseDC(Handle, DC); + end; +end; + +procedure TdxDockControl.WMSize(var Message: TWMSize); +begin + ResetBackground; + inherited; +end; + +procedure TdxDockControl.WMRButtonDown(var Message: TWMRButtonDown); +begin + inherited; + if (FBarManager <> nil) and not FBarManager.IsCustomizing then + ShowCustomizePopup; +end; + +procedure TdxDockControl.WMWindowPosChanged(var Message: TWMWindowPosChanged); +var + I, J: Integer; +begin + inherited; + if (BarManager <> nil) and + (Message.WindowPos^.flags and (SWP_NOMOVE or SWP_NOSIZE) <> SWP_NOMOVE or SWP_NOSIZE) then + begin + Inc(BarManager.FLockUpdateCount); + try + if DockingStyle = dsBottom then + for I := 0 to RowCount - 1 do + for J := 0 to Rows[I].ColCount - 1 do + with Rows[I].Cols[J].BarControl do + if Bar.IsStatusBar then RebuildBar; + finally + Dec(BarManager.FLockUpdateCount); + end; + if IsTransparent then + RepaintBarControls; + end; +end; + +procedure TdxDockControl.CMSysColorChange(var Message: TMessage); +begin + inherited; + if IsWin95Or98 and Main and (DockingStyle = dsLeft) then + BarManager.OwnerWndProc(0, WM_SYSCOLORCHANGE, 0, 0); +end; + +procedure TdxDockControl.AlignControls(AControl: TControl; var Rect: TRect); +begin + if (FBarManager <> nil) and not FBarManager.IsLoading then + UpdateDock; +end; + +procedure TdxDockControl.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + begin + Style := WS_CHILD or WS_CLIPCHILDREN or WS_CLIPSIBLINGS; + ExStyle := 0; + WindowClass.Style := CS_DBLCLKS; + end; +end; + +procedure TdxDockControl.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited; + if (Operation = opRemove) and (AComponent = BarManager) then + BarManager := nil; +end; + +procedure TdxDockControl.RequestAlign; +begin + if not (csDestroyingHandle in ControlState) then + inherited; +end; + +procedure TdxDockControl.AddBarControl(ABarControl: TdxBarControl; APos: TPoint; + Update: Boolean); +var + Ins: Boolean; + ARow, ACol, I: Integer; + DockRow: TdxDockRow; + DockCol: TdxDockCol; +begin + if BarManager = nil then + Exit; + Ins := False; + ARow := 0; + + if ABarControl <> nil then + begin + if not ABarControl.InternallyLocked then + ARow := GetRowAtPos(APos, Ins) + else + if ABarControl.Bar <> nil then + begin + if IsMultiRow then + ARow := ABarControl.Bar.Row + else + ARow := 0; + Ins := ABarControl.Bar.OneOnRow; + end; + if (ABarControl.Bar <> nil) and ABarControl.Bar.WholeRow then + Ins := True; + end; + + if ABarControl.InternallyLocked and (BarManager.BarsLoading or BarManager.IsHandleCreating) and + (ARow > FRowList.Count - 1) then + for I := FRowList.Count to ARow do + FRowList.Insert(I, TdxDockRow.Create(Self)) + else + begin + if ARow > FRowList.Count - 1 + Byte(Ins) then + begin + //Ins := True; + ARow := FRowList.Count - Byte(not Ins){!}; + end; + if ARow < 0 then ARow := 0; + end; + if ARow >= FRowList.Count then Ins := True; + + if not Ins then + for I := 0 to Rows[ARow].ColCount - 1 do + with Rows[ARow].Cols[I] do + if BarControl.Bar.WholeRow and (BarControl <> ABarControl) then + begin + Ins := True; + Break; + end; + +// if (ABarControl <> nil) and (ABarControl.DockControl = Self) and +// (ABarControl.Bar <> nil) and (ABarControl.Bar.DockRow <> nil) and +// (RowList.IndexOf(ABarControl.Bar.DockRow) = ARow) then +// Ins := False; + + if Ins then + begin + if ABarControl.InternallyLocked and (BarManager.BarsLoading or BarManager.IsHandleCreating) then + DockRow := Rows[ARow] + else + begin + DockRow := TdxDockRow.Create(Self); + FRowList.Insert(ARow, DockRow); + end; + DockCol := DockRow.AddCol(ABarControl); + ABarControl.FBar.SetDockRow(DockRow); + end + else + begin + DockCol := TdxDockCol.Create(TdxDockRow(FRowList[ARow]), ABarControl); + ACol := GetColAtPos(ARow, APos); + GetColAtPos(ARow, APos); + Rows[ARow].ColList.Insert(ACol, DockCol); + Rows[ARow].UpdateOneOnRows; + ABarControl.FBar.SetDockRow(Rows[ARow]); + end; + + if not ABarControl.InternallyLocked then + begin + with Bars, FMovingOffset do + if FMoving then + begin + Dec(APos.X, X); + Dec(APos.Y, Y); + end; + with ABarControl, GetDragPointOffset(DockingStyle) do + begin + Dec(APos.X, X); + Dec(APos.Y, Y); + end; + end; + + Windows.ScreenToClient(Handle, APos); + case Horizontal of + True: + if APos.X < 0 then APos.X := 0; + False: + if APos.Y < 0 then APos.Y := 0; + end; + + DockCol.FPos := APos; + + if Update then + begin + if not {Bars.}ABarControl.FMoving then + with ABarControl do + begin + Left := APos.X; + Top := APos.Y; + end; + UpdateDock; + if not BarManager.BarsLoading and not BarManager.IsHandleCreating then + DockCol.AssignPosition; + end; +end; + +procedure TdxDockControl.DeleteBarControl(ABarControl: TdxBarControl; ADockCol: TObject; + Update: Boolean); +var + I, J: Integer; + + procedure DeleteCol; + begin + Rows[I].DeleteCol(J); + if Update then + UpdateDock; + end; + +var + ADockRow: TdxDockRow; +begin + if BarManager = nil then + Exit; + for I := 0 to RowCount - 1 do + begin + ADockRow := Rows[I]; + if ADockCol <> nil then + begin + J := ADockRow.ColList.IndexOf(ADockCol); + if J > -1 then + begin + DeleteCol; + Exit; + end; + end + else + for J := 0 to ADockRow.ColCount - 1 do + if ADockRow.Cols[J].BarControl = ABarControl then + begin + DeleteCol; + Exit; + end; + end; +end; + +procedure TdxDockControl.MoveBarControl(ABarControl: TdxBarControl; APos: TPoint); +var + DockCol: Pointer; +begin + if FBarManager = nil then Exit; + DockCol := Rows[ABarControl.GetRow].Cols[ABarControl.GetCol]; + DeleteBarControl(ABarControl, DockCol, False); + AddBarControl(ABarControl, APos, True); + if IsTransparent then + begin + ResetBackground; + RepaintBarControls; + end; +end; + +procedure TdxDockControl.AssignPositions; +var + I, J: Integer; +begin + for I := 0 to RowCount - 1 do + with Rows[I] do + for J := 0 to ColCount - 1 do + Cols[J].AssignPosition; +end; + +procedure TdxDockControl.BarManagerChanged; +begin + ResetBackground; +end; + +procedure TdxDockControl.CalcLayout; +var + AClientSize, I: Integer; +begin + if Vertical then + AClientSize := ClientHeight + else + AClientSize := ClientWidth; + for I := 0 to RowCount - 1 do + if Rows[I].Visible then + CalcRowToolbarPositions(I, AClientSize); +end; + +procedure TdxDockControl.CalcRowToolbarPositions(ARowIndex: Integer; + AClientSize: Integer); + + function RotatePoint(const APoint: TPoint): TPoint; + begin + Result := Point(APoint.Y, APoint.X); + end; + + function GetMinSize(ABarControl: TdxBarControl): Integer; + begin + if Vertical then + Result := ABarControl.GetMinHeight(DockingStyle) + else + Result := ABarControl.GetMinWidth(DockingStyle); + end; + + function GetMaxSizeX(ABarControl: TdxBarControl): Integer; + begin + if Vertical then + Result := ABarControl.GetMaxHeight(DockingStyle) + else + Result := ABarControl.GetMaxWidth(DockingStyle); + end; + + function GetMaxSizeY(ABarControl: TdxBarControl): Integer; + begin + if Vertical then + Result := ABarControl.GetMaxWidth(DockingStyle) + else + Result := ABarControl.GetMaxHeight(DockingStyle); + end; + + function NCSizeX(ABarControl: TdxBarControl): Integer; + begin + if Vertical then + Result := ABarControl.Bar.BarNCSizeY(DockingStyle) + else + Result := ABarControl.Bar.BarNCSizeX(DockingStyle); + end; + + function NCSizeY(ABarControl: TdxBarControl): Integer; + begin + if Vertical then + Result := ABarControl.Bar.BarNCSizeX(DockingStyle) + else + Result := ABarControl.Bar.BarNCSizeY(DockingStyle); + end; + + function GetFullSize(ABarControl: TdxBarControl; ASize: Integer): TPoint; + begin + Dec(ASize, NCSizeX(ABarControl)); + if not Painter.BarAllowQuickCustomizing then + Dec(ASize, ABarControl.GetMarkSize); + if Vertical then + Result := RotatePoint(ABarControl.GetSizeForHeight(DockingStyle, ASize)) + else + Result := ABarControl.GetSizeForWidth(DockingStyle, ASize); + end; + + procedure CalcDefaultParams(ARow: TdxDockRow; out AWidthSum: Integer); + var + I: Integer; + ABarControl: TdxBarControl; + begin + AWidthSum := 0; + for I := 0 to ARow.ColCount - 1 do + begin + ABarControl := ARow.Cols[I].BarControl; + ABarControl.FTruncated := False; + ABarControl.ItemLinks.RecentItemCount := -1; + ABarControl.FMinSize := GetMinSize(ABarControl) + NCSizeX(ABarControl); + ABarControl.FMaxSize := GetMaxSizeX(ABarControl) + NCSizeX(ABarControl); + if not ABarControl.MarkExists and (ABarControl.FMinSize <> ABarControl.FMaxSize) then + Inc(ABarControl.FMinSize, ABarControl.MarkSize); + Inc(AWidthSum, ABarControl.FMaxSize); + end; + end; + + procedure CalcNewBoundsForWholeRowBar(ARow: TdxDockRow; const ARowBounds: TRect; ARowWidth: Integer; var AMaxHeight: Integer); + var + ABarControl: TdxBarControl; + begin + ABarControl := ARow.Cols[0].BarControl; + ABarControl.NewLeft := ARowBounds.Left; + ABarControl.NewTop := ARowBounds.Top; + ABarControl.NewWidth := Max(ARowWidth, ABarControl.FMinSize); + ABarControl.NewHeight := GetFullSize(ABarControl, ABarControl.NewWidth).Y + NCSizeY(ABarControl); + ABarControl.FTruncated := not ABarControl.MultiLine and (ABarControl.NewWidth < ABarControl.FMaxSize); + AMaxHeight := Max(AMaxHeight, ABarControl.NewHeight); + end; + + procedure CalcNewBoundsForLocatedBars(ARow: TdxDockRow; const ARowBounds: TRect; ARowWidth: Integer; var AMaxHeight: Integer); + var + I, J: Integer; + AMargin, AFixedSize, ANewLeft: Integer; + ACol: TdxDockCol; + ABarControl: TdxBarControl; + begin + AMargin := ARowWidth; + for I := ARow.ColCount - 1 downto 0 do + begin + ACol := ARow.Cols[I]; + ABarControl := ACol.BarControl; + ABarControl.NewTop := ARowBounds.Top; + ABarControl.NewWidth := ABarControl.FMaxSize; + if ABarControl.MultiLine then + ABarControl.NewHeight := GetFullSize(ABarControl, ABarControl.NewWidth).Y + else + ABarControl.NewHeight := GetMaxSizeY(ABarControl); + Inc(ABarControl.NewHeight, NCSizeY(ABarControl)); + AMaxHeight := Max(AMaxHeight, ABarControl.NewHeight); + + AFixedSize := 0; + for J := 0 to I - 1 do + Inc(AFixedSize, ARow.Cols[J].BarControl.FMaxSize); + ANewLeft := IfThen(Vertical, ACol.Pos.Y, ACol.Pos.X); + if ANewLeft + ABarControl.NewWidth > AMargin then + ANewLeft := AMargin - ABarControl.NewWidth; + ABarControl.NewLeft := Max(ANewLeft, AFixedSize); + AMargin := ABarControl.NewLeft; + end; + end; + + procedure CalcNewBoundsForNonLocatedBars(ARow: TdxDockRow; const ARowBounds: TRect; ARowWidth: Integer; var AMaxHeight: Integer); + var + I, K: Integer; + ASize, ARestSize, AFixedSize, AMaxFixedSize, AMinSize, AMaxSize: Integer; + ACol, APrevCol: TdxDockCol; + ABarControl, APrevBarControl: TdxBarControl; + begin + ASize := ARowWidth; + for I := ARow.ColCount - 1 downto 0 do + begin + ACol := ARow.Cols[I]; + ABarControl := ACol.BarControl; + if Vertical then + AFixedSize := ACol.Pos.Y + else + AFixedSize := ACol.Pos.X; + AMinSize := 0; + AMaxSize := 0; + for K := I - 1 downto 0 do + begin + Inc(AMinSize, ARow.Cols[K].BarControl.FMinSize); + Inc(AMaxSize, ARow.Cols[K].BarControl.FMaxSize); + end; + AFixedSize := Min(Max(AFixedSize, AMinSize), AMaxSize); + if (I > 0) and (ARow.Cols[I - 1].BarControl = Bars.FMovingBarControl) then + begin + APrevCol := ARow.Cols[I - 1]; + APrevBarControl := APrevCol.BarControl; + AMaxFixedSize := IfThen(Vertical, APrevCol.Pos.Y, APrevCol.Pos.X); + AMaxFixedSize := Max(AMaxFixedSize, AMinSize - APrevBarControl.FMinSize); + Inc(AMaxFixedSize, APrevBarControl.FMaxSize); + if AFixedSize > AMaxFixedSize then + begin + if Vertical then + ACol.FPos.Y := AMaxFixedSize + else + ACol.FPos.X := AMaxFixedSize; + AFixedSize := AMaxFixedSize; + end; + end; + ARestSize := ASize - AFixedSize; + + if ARestSize >= ABarControl.FMaxSize then + begin + ABarControl.NewWidth := ABarControl.FMaxSize; + if ABarControl.MultiLine then + ABarControl.NewHeight := GetFullSize(ABarControl, ABarControl.NewWidth).Y + else + ABarControl.NewHeight := GetMaxSizeY(ABarControl); + end + else + begin + ABarControl.FTruncated := not ABarControl.MultiLine and (ABarControl.FMinSize <> ABarControl.FMaxSize); + ABarControl.NewWidth := Max(ARestSize, ABarControl.FMinSize); + ABarControl.NewHeight := GetFullSize(ABarControl, ABarControl.NewWidth).Y; + end; + + if (I = 0) and (ABarControl.NewWidth < ASize) then + ABarControl.NewWidth := ASize; + ABarControl.NewLeft := Min(Max(ASize - ABarControl.NewWidth, AMinSize), AMaxSize); + ABarControl.NewTop := ARowBounds.Top; + Inc(ABarControl.NewHeight, NCSizeY(ABarControl)); + AMaxHeight := Max(AMaxHeight, ABarControl.NewHeight); + + Dec(ASize, ABarControl.NewWidth); + end; + end; + + procedure CalcNewBoundsForAutoAlignBars(ARow: TdxDockRow); + var + I: Integer; + ABarControl: TdxBarControl; + begin + for I := 0 to ARow.ColCount - 1 do + begin + ABarControl := ARow.Cols[I].BarControl; + if ABarControl.Bar.UseRestSpace or BarManager.AutoAlignBars then + begin + if I = 0 then + ABarControl.NewLeft := 0 + else + ABarControl.NewLeft := ARow.Cols[I - 1].BarControl.NewLeft + ARow.Cols[I - 1].BarControl.NewWidth; + end; + + if ABarControl.Bar.UseRestSpace then + begin + if I = ARow.ColCount - 1 then + ABarControl.NewWidth := AClientSize - ABarControl.NewLeft + else + ABarControl.NewWidth := ARow.Cols[I + 1].BarControl.NewLeft - ABarControl.NewLeft; + ABarControl.NewWidth := Max(ABarControl.NewWidth, ABarControl.FMinSize); + end; + end; + end; + + procedure SetNewBounds(ARow: TdxDockRow; AMaxHeight: Integer); + var + I, ATemp: Integer; + ABarControl: TdxBarControl; + begin + for I := 0 to ARow.ColCount - 1 do + begin + ABarControl := ARow.Cols[I].BarControl; + if ABarControl.FTruncated and (I = ARow.ColCount - 1) then + ABarControl.NewWidth := Max(AClientSize - ABarControl.NewLeft, ABarControl.FMinSize); + ABarControl.NewHeight := AMaxHeight; + // for the RecentItemCount calculating + GetFullSize(ABarControl, ABarControl.NewWidth); + if Vertical then + begin + ATemp := ABarControl.NewLeft; + ABarControl.NewLeft := ABarControl.NewTop; + ABarControl.NewTop := ATemp; + ATemp := ABarControl.NewWidth; + ABarControl.NewWidth := ABarControl.NewHeight; + ABarControl.NewHeight := ATemp; + end; + ABarControl.SetNewBounds; + + ABarControl.CalcLayout; + end; + end; + +var + AWidthSum, ARowWidth, AMaxHeight: Integer; + ARow: TdxDockRow; + R: TRect; +begin + ARow := Rows[ARowIndex]; + if ARow.ColCount = 0 then + Exit; + R := GetRectForRow(ARowIndex); + if Vertical then + R.TopLeft := RotatePoint(R.TopLeft); + ARowWidth := AClientSize; + AMaxHeight := 0; + + CalcDefaultParams(ARow, AWidthSum); + + if ARow.Cols[0].BarControl.Bar.WholeRow then + CalcNewBoundsForWholeRowBar(ARow, R, ARowWidth, AMaxHeight) + else + if AWidthSum <= ARowWidth then + CalcNewBoundsForLocatedBars(ARow, R, ARowWidth, AMaxHeight) + else + CalcNewBoundsForNonLocatedBars(ARow, R, ARowWidth, AMaxHeight); + + CalcNewBoundsForAutoAlignBars(ARow); + + SetNewBounds(ARow, AMaxHeight); +end; + +function TdxDockControl.CanDocking(Bar: TdxBar): Boolean; +begin + Result := FAllowDocking; +end; + +procedure TdxDockControl.ColorChanged; +begin + if (FBarManager = nil) or FBarManager.AutoDockColor then + ParentColor := True + else + Color := FBarManager.DockColor; +end; + +function TdxDockControl.GetDockZoneBounds: TRect; +begin + Result := BoundsRect; + InflateRect(Result, Bars.DockingZoneSize, Byte(Horizontal) * Bars.DockingZoneSize); + MapWindowRect(GetParent(Handle), 0, Result); +end; + +procedure TdxDockControl.GetDockZoneMargins(Row, ZoneNumber: Integer; var M1, M2: Integer); +var + IM1, IM2: Integer; +begin + M1 := 0; + M2 := 0; + if Row = -1 then + if TopLeft then + begin + M1 := -Bars.DockingZoneSize; + M2 := 0; + end + else + begin + if DockingStyle = dsRight then + M1 := ClientWidth + else + M1 := ClientHeight; + M1 := M1 - GetClientSize - Bars.DockingZoneSize; + M2 := M1 + Bars.DockingZoneSize; + end + else + if Row = FRowList.Count then + if TopLeft then + begin + M1 := GetClientSize; + M2 := M1 + Bars.DockingZoneSize; + end + else + begin + if DockingStyle = dsRight then + M1 := ClientWidth + else + M1 := ClientHeight; + M2 := M1 + Bars.DockingZoneSize; + end + else + with GetRectForRow(Row) do + if Horizontal then + begin + M1 := Top; + M2 := Bottom; + end + else + begin + M1 := Left; + M2 := Right; + end; + case DockingStyle of + dsLeft, dsTop: + IM1 := M1 + (Bars.DockingZoneSize - InsertZone div 2) div 2; + dsRight, dsBottom: + IM1 := M2 - (Bars.DockingZoneSize - InsertZone div 2) div 2 - InsertZone div 2; + else + IM1 := 0; + end; + IM2 := IM1 + InsertZone div 2; + + case ZoneNumber of + 0: M2 := IM1; + 1: begin + M1 := IM1; + M2 := IM2; + end; + 2: M1 := IM2; + end; +end; + +function TdxDockControl.GetRectForRow(ARow: Integer): TRect; +var + I: Integer; + Origin, Size: Integer; + + function GetRowHeight(ARow: Integer): Integer; + var + J: Integer; + begin + Result := 0; + if not Rows[ARow].Visible then + Exit; + for J := 0 to Rows[ARow].ColCount - 1 do + with TdxDockCol(Rows[ARow].Cols[J]).BarControl do + case Self.DockingStyle of + dsLeft, dsRight: if Result < Width then Result := Width; + dsTop, dsBottom: if Result < Height then Result := Height; + end; + if ARow < RowCount - 1 then + Inc(Result, Painter.BarDockedGetRowIndent); + end; + +begin + SetRectEmpty(Result); + if (ARow < 0) or (ARow > FRowList.Count - 1) then Exit; + Size := 0; + if not Bars.FMoving or (DockingStyle in [dsLeft, dsTop]) then + begin + Origin := 0; + for I := 0 to ARow do + begin + Inc(Origin, Size); + Size := GetRowHeight(I); + end; + end + else + begin + if DockingStyle = dsRight then + Origin := ClientWidth + else + Origin := ClientHeight; + for I := FRowList.Count - 1 downto ARow do + begin + Size := GetRowHeight(I); + Dec(Origin, Size); + end; + end; + case DockingStyle of + dsLeft, dsRight: + Result := Bounds(Origin, 0, Size, ClientHeight); + dsTop, dsBottom: + Result := Bounds(0, Origin, ClientWidth, Size); + end; +end; + +function TdxDockControl.GetClientSize: Integer; +var + I: Integer; + R: TRect; +begin + Result := 0; + case DockingStyle of + dsLeft, dsRight: + for I := 0 to FRowList.Count - 1 do + begin + R := GetRectForRow(I); + Inc(Result, R.Right - R.Left); + end; + dsTop, dsBottom: + for I := 0 to FRowList.Count - 1 do + begin + R := GetRectForRow(I); + Inc(Result, R.Bottom - R.Top); + end; + end; +end; + +function TdxDockControl.GetSize: Integer; +begin + Result := GetClientSize; + if (Result > 0) and SunkenBorder then Inc(Result, 2); +end; + +function TdxDockControl.GetRowAtPos(APos: TPoint; var Insert: Boolean): Integer; +var + I, J, Z, M1, M2: Integer; + Found: Boolean; +begin + if FRowList.Count = 0 then + begin + Result := 0; + Insert := True; + Exit; + end; + + Result := -1; + Insert := False; + Windows.ScreenToClient(Handle, APos); + if Vertical then + Z := APos.X + else + Z := APos.Y; + Found := False; + for I := -1 to FRowList.Count - 1 do + begin + for J := 0 to 2 do + begin + GetDockZoneMargins(I, J, M1, M2); + if (M1 <= Z) and (Z < M2) then + begin + Result := I + Byte(J > 0); + Insert := J = 1; + Found := True; + Break; + end; + end; + if Found then Break; + end; + + if Result = -1 then + begin + Insert := True; + if Z >= GetClientSize then + Result := FRowList.Count + else + Result := 0; + end + else + if Result >= RowCount then Insert := True; +end; + +function TdxDockControl.GetColAtPos(ARow: Integer; APos: TPoint): Integer; +var + I: Integer; +begin + Result := 0; + if (FRowList[ARow] = nil) or + (Rows[ARow].ColCount = 0) then Exit; + Windows.ScreenToClient(Handle, APos); + if Bars.FMoving and not Bars.FMovingBarControl.InternallyLocked then + with Bars.FMovingBarControl.GetDragPointOffset(DockingStyle) do + case DockingStyle of + dsLeft, dsRight: + Dec(APos.Y, Y); + dsTop, dsBottom: + Dec(APos.X, X); + end; + with Rows[ARow] do + begin + for I := 0 to ColCount - 1 do + with Cols[I], BarControl.Bar do + case DockingStyle of + dsLeft, dsRight: + if APos.Y <= DockedTop then + begin + Result := I; + Exit; + end; + dsTop, dsBottom: + if APos.X <= DockedLeft then + begin + Result := I; + Exit; + end; + end; + Result := ColCount; + end; +end; + +procedure TdxDockControl.GetPosForRow(Row: Integer; OneOnRow: Boolean; var P: TPoint); +var + M1, M2, Temp: Integer; +begin + if OneOnRow and (Row = FRowList.Count) then OneOnRow := False; + if OneOnRow then + GetDockZoneMargins(Row - 1, 1, M1, M2) + else + begin + GetDockZoneMargins(Row - 1, 2, M1, Temp); + GetDockZoneMargins(Row, 0, Temp, M2); + if Temp - M1 > M2 - Temp then M1 := Temp - (M2 - Temp); + end; + Temp := (M1 + M2) div 2; + Windows.ScreenToClient(Handle, P); + if Vertical then + P.X := Temp + else + P.Y := Temp; + Windows.ClientToScreen(Handle, P); +end; + +function TdxDockControl.GetSunkenBorder: Boolean; +begin + if BarManager = nil then + Result := False + else + Result := BarManager.SunkenBorder; +end; + +function TdxDockControl.GetMainForm: TCustomForm; +begin + Result := GetControlForm(Self, fkMain); + if (Result = nil) and (BarManager <> nil) then // Result.HandleAllocated? + Result := BarManager.GetMainForm; +end; + +function TdxDockControl.GetMasterForm: TCustomForm; +begin + Result := GetControlForm(Self, fkMainOrMDIChild); + if (Result = nil) and (BarManager <> nil) then // Result.HandleAllocated? + Result := BarManager.MasterForm; +end; + +function TdxDockControl.GetParentForm: TCustomForm; +begin + Result := GetControlForm(Self, fkAny); + if (Result = nil) and (BarManager <> nil) then // Result.HandleAllocated? + Result := BarManager.ParentForm; +end; + +function TdxDockControl.IsMultiRow: Boolean; +begin + Result := True; +end; + +procedure TdxDockControl.NCChanged; +var + I, J: Integer; +begin + if not HandleAllocated then Exit; + SetWindowPos(Handle, 0, 0, 0, 0, 0, + SWP_NOZORDER or SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE or SWP_FRAMECHANGED); + for I := 0 to RowCount - 1 do + for J := 0 to Rows[I].ColCount - 1 do + Rows[I].Cols[J].BarControl.FrameChanged{RebuildBar}; + UpdateDock; +end; + +procedure TdxDockControl.PaintBarControls; +begin + if (RowList = nil) or (BarManager = nil) or BarManager.BarsLoading or BarManager.IsDestroying then + Exit; + + if not BarManager.Designing and HandleAllocated then + dxSetZOrder(Handle, HWND_TOP); + + DisableAlign; + try + CalcLayout; + finally + EnableAlign; + end; + Repaint; +end; + +procedure TdxDockControl.SetSize; + + function Appropriate(var Variable; Value: TObject): Boolean; + begin + TObject(Variable) := TObject(Value); + Result := True; + end; + + function IsCurrentDockControl(AParentBar: TCustomdxBarControl): Boolean; + begin + Result := (AParentBar <> nil) and + not ((AParentBar is TdxBarControl) and (Self is TdxBarDockControl) and + not (TdxBarControl(AParentBar).DockControl is TdxBarDockControl) or + (AParentBar.BarManager <> BarManager) and (Forms.GetParentForm(Self) <> nil)); + end; + +var + ASize, PrevSize: Integer; + AParentBar: TCustomdxBarControl; +begin + ASize := GetSize; + PrevSize := 0; + case DockingStyle of + dsLeft, dsRight: + begin + PrevSize := Width; + if DockingStyle = dsRight then + begin + Parent.DisableAlign; + Left := Left - (ASize - Width); + end; + Width := ASize; + if DockingStyle = dsRight then Parent.EnableAlign; + end; + dsTop, dsBottom: + begin + PrevSize := Height; + if DockingStyle = dsBottom then + begin + Parent.DisableAlign; + Top := Top - (ASize - Height); + end; + Height := ASize; + if DockingStyle = dsBottom then Parent.EnableAlign; + end; + end; + if Visible and (ASize <> PrevSize) and (ActiveBarControl <> nil) and + Appropriate(AParentBar, GetParentBarForBar(ActiveBarControl)) and + not (AParentBar is TdxbarQuickControl) and (ActiveBarControl.Handle <> GetCapture) and + IsCurrentDockControl(AParentBar) then + ActiveBarControl.HideAll; +end; + +procedure TdxDockControl.ShowCustomizePopup; +begin + BarDesignController.ShowToolbarsPopup(FBarManager, Painter); +end; + +procedure TdxDockControl.UpdateDock; +begin + if (BarManager <> nil) and not BarManager.IsUpdateLocked and not BarManager.IsDestroying then + begin + PaintBarControls; + SetSize; + end; +end; + +function TdxDockControl.GetDockedBarControlClass: TdxBarControlClass; +begin + Result := TdxBarControl; +end; + +function TdxDockControl.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxDockControlAccessibilityHelper; +end; + +function TdxDockControl.GetPainter: TdxBarPainter; +begin + Result := BarManager.DefaultPainter; +end; + +procedure TdxDockControl.FillBackground(DC: HDC; const ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); +var + CR: TRect; +begin + if not BackgroundBitmap.Empty or (BarManager = nil) then + FillBackgroundRect(DC, ADestR, ASourceR, ABrush, AColor, BackgroundBitmap) + else + begin + if not BarManager.Backgrounds.Bar.Empty then + FillBackgroundRect(DC, ADestR, ASourceR, ABrush, AColor, BarManager.Backgrounds.Bar) + else + begin + CR := ClientRect; + if not IsRectEmpty(CR) then + Painter.DockControlFillBackground(Self, DC, ADestR, ASourceR, CR, ABrush, AColor) + end; + end; +end; + +function TdxDockControl.IsBackgroundBitmap: Boolean; +begin + Result := not BackgroundBitmap.Empty; +end; + +function TdxDockControl.IsDrawDesignBorder: Boolean; +begin + Result := IsDesigning; +end; + +function TdxDockControl.IsTransparent: Boolean; +begin + Result := not BackgroundBitmap.Empty or + ((BarManager <> nil) and (Painter.IsNativeBackground or + not BarManager.Backgrounds.Bar.Empty)); +end; + +procedure TdxDockControl.RepaintBarControls; +var + I, J: Integer; +begin + for I := 0 to RowCount - 1 do + for J := 0 to Rows[I].ColCount - 1 do + Rows[I].Cols[J].BarControl.FullRepaint; +end; + +procedure TdxDockControl.ResetBackground; +begin + FBackgroundTempBitmap.Assign(nil); +end; + +procedure TdxDockControl.UpdateDoubleBuffered; +begin + DoubleBuffered := IsTransparent; +end; + +procedure TdxDockControl.InitiateAction; +var + I: Integer; +begin + if FBarManager <> nil then + with FBarManager do + for I := 0 to Bars.Count - 1 do + with Bars[I] do + if Visible then ItemLinks.InitiateActions; +end; + +{ TdxBarDockControl } + +constructor TdxBarDockControl.Create(AOwner: TComponent); +begin + inherited; + Align := dalTop; +end; + +function TdxBarDockControl.GetAlign: TdxBarDockAlign; +begin + Result := TdxBarDockAlign(inherited Align); +end; + +function TdxBarDockControl.GetColor: TColor; +begin + Result := inherited Color; +end; + +function TdxBarDockControl.GetIsLoading: Boolean; +begin + Result := (csLoading in ComponentState) or (BarManager <> nil) and BarManager.BarsLoading; +end; + +function TdxBarDockControl.GetParentColor: Boolean; +begin + Result := inherited ParentColor; +end; + +procedure TdxBarDockControl.SetAlign(Value: TdxBarDockAlign); +const + Styles: array[TdxBarDockAlign] of TdxBarDockingStyle = + (dsTop, dsTop, dsBottom, dsLeft, dsRight); +var + I, J: Integer; +begin + if Align <> Value then + begin + if BarManager <> nil then + BarManager.BeginUpdate; + try + for I := 0 to RowCount - 1 do + for J := 0 to Rows[I].ColCount - 1 do + Rows[I].Cols[J].BarControl.DockingStyle := Styles[Value]; + inherited Align := TAlign(Value); + finally + if BarManager <> nil then + begin + BarManager.EndUpdate; + for I := 0 to RowCount - 1 do + for J := 0 to Rows[I].ColCount - 1 do + Rows[I].Cols[J].BarControl.RepaintBar; + if Parent <> nil then Parent.Invalidate; + end; + end; + end; +end; + +procedure TdxBarDockControl.SetAllowZeroSizeInDesignTime(Value: Boolean); +begin + if FAllowZeroSizeInDesignTime <> Value then + begin + FAllowZeroSizeInDesignTime := Value; + Perform(WM_SIZE, 0, 0); + end; +end; + +procedure TdxBarDockControl.SetColor(Value: TColor); +begin + if Color <> Value then + begin + inherited Color := Value; + if not IsLoading then UseOwnColor := True; + end; +end; + +procedure TdxBarDockControl.SetParentColor(Value: Boolean); +begin + if ParentColor <> Value then + begin + inherited ParentColor := Value; + if not IsLoading then UseOwnColor := True; + end; +end; + +procedure TdxBarDockControl.SetSunkenBorder(Value: Boolean); +begin + if SunkenBorder <> Value then + begin + FSunkenBorder := Value; + FUseOwnSunkenBorder := True; + NCChanged; + end; +end; + +procedure TdxBarDockControl.SetUseOwnColor(Value: Boolean); +begin + if FUseOwnColor <> Value then + begin + FUseOwnColor := Value; + if not Value then ColorChanged; + end; +end; + +procedure TdxBarDockControl.SetUseOwnSunkenBorder(Value: Boolean); +var + PrevSunkenBorder: Boolean; +begin + if FUseOwnSunkenBorder <> Value then + begin + PrevSunkenBorder := SunkenBorder; + FUseOwnSunkenBorder := Value; + if Value then + FSunkenBorder := PrevSunkenBorder + else + if SunkenBorder <> PrevSunkenBorder then NCChanged; + end; +end; + +function TdxBarDockControl.IsColorStored: Boolean; +begin + Result := FUseOwnColor and not ParentColor; +end; + +procedure TdxBarDockControl.WMCreate(var Message: TWMCreate); +begin + inherited; + if BarManager <> nil then + BarManager.ShowBarsFromRestoringList(Self); +end; + +procedure TdxBarDockControl.WMSize(var Message: TWMSize); +begin + inherited; + if not IsLoading and (RowCount = 0) then + if Horizontal then + ClientHeight := GetMinSize + else + ClientWidth := GetMinSize; +end; + +function TdxBarDockControl.AllowUndockWhenLoadFromIni: Boolean; +begin + Result := True; +end; + +procedure TdxBarDockControl.CreateParams(var Params: TCreateParams); +begin + inherited; + if IsDesigning then + with Params do + WindowClass.Style := WindowClass.Style or CS_HREDRAW or CS_VREDRAW; +end; + +procedure TdxBarDockControl.Paint; +begin + inherited; + if IsDrawDesignBorder then + begin + Canvas.Brush.Style := bsClear; + Canvas.Pen.Style := psDot; + Canvas.Rectangle(0, 0, ClientWidth, ClientHeight); + Canvas.Pen.Style := psSolid; + Canvas.Brush.Style := bsSolid; + end; +end; + +procedure TdxBarDockControl.BarManagerChanged; +begin + inherited; + if not (csDestroying in ComponentState) then + begin + ColorChanged; + NCChanged; + end; +end; + +function TdxBarDockControl.CanDocking(Bar: TdxBar): Boolean; +begin + Result := inherited CanDocking(Bar) and + ((Bar.Control = nil) or not HasAsParent(Handle, Bar.Control.Handle)); +end; + +procedure TdxBarDockControl.ColorChanged; +begin + if not FUseOwnColor then + begin + inherited; + FUseOwnColor := False; + end; +end; + +function TdxBarDockControl.GetClientSize: Integer; +begin + if IsLoading then + if Horizontal then + Result := ClientHeight + else + Result := ClientWidth + else + begin + Result := inherited GetClientSize; + if Result = 0 then Result := GetMinSize; + end; +end; + +function TdxBarDockControl.GetMinSize: Integer; +begin + if IsDesigning and not AllowZeroSizeInDesignTime then + Result := MinDockSize + else + Result := 0; +end; + +function TdxBarDockControl.GetSunkenBorder: Boolean; +begin + if FUseOwnSunkenBorder then + Result := FSunkenBorder + else + Result := inherited GetSunkenBorder; +end; + +{ TdxBarShadowPart } + +constructor TdxBarShadowPart.CreateEx(AOwner: TdxBarShadow; + AKind: TdxBarShadowPartKind; ACorners: TdxBarShadowCorners); +begin + Create(nil); + FOwner := AOwner; + FKind := AKind; + FCorners := ACorners; + FImage := TBitmap.Create; +end; + +destructor TdxBarShadowPart.Destroy; +begin + FreeAndNil(FImage); + inherited; +end; + +function TdxBarShadowPart.GetControl: TWinControl; +begin + Result := FOwner.Owner; +end; + +function TdxBarShadowPart.GetShadowSize: Integer; +begin + Result := FOwner.ShadowSize; +end; + +function TdxBarShadowPart.GetTransparent: Boolean; +begin + Result := FOwner.Transparent; +end; + +procedure TdxBarShadowPart.WMNCHitTest(var Message: TWMNCHitTest); +begin + inherited; + Message.Result := HTTRANSPARENT; +end; + +function TdxBarShadowPart.CanShow: Boolean; +begin + Result := (FCorners = []) or (Width >= ShadowSize) and (Height >= ShadowSize); +end; + +procedure TdxBarShadowPart.CreateParams(var Params: TCreateParams); +begin + inherited; + with Params do + begin + Style := WS_POPUP; + if Transparent then + ExStyle := WS_EX_LAYERED + else + ExStyle := 0; + if GetWindowLong(Control.Handle, GWL_EXSTYLE) and WS_EX_TOPMOST <> 0 then + ExStyle := ExStyle or WS_EX_TOPMOST; + WndParent := Control.Handle; + WindowClass.style := 0; + end; +end; + +procedure TdxBarShadowPart.Paint; +begin + with Canvas do + begin + Brush.Color := clBtnShadow; + FillRect(ClientRect); + end; +end; + +procedure TdxBarShadowPart.UpdateImage; +var + AColors: TRGBColors; + + function GetAlphaIndex(X, Y: Integer): Integer; + begin + Result := Y * Width + X; + end; + + function GetAlpha(X, Y: Integer): Byte; + begin + Result := AColors[GetAlphaIndex(X, Y)].rgbReserved; + end; + + procedure SetAlpha(X, Y: Integer; Value: Byte); + begin + AColors[GetAlphaIndex(X, Y)].rgbReserved := Value; + end; + + procedure ProcessMainContent; + const + AlphaStep = 15; + var + X, Y: Integer; + begin + for X := 0 to Width - 1 do + for Y := 0 to Height - 1 do + if FKind = spHorizontal then + SetAlpha(X, Y, (Height - Y) * AlphaStep) + else + SetAlpha(X, Y, (Width - X) * AlphaStep); + end; + + procedure ProcessCorners; + type + TCornerKind = (ckLeft, ckRight, ckTop); + + procedure ProcessCorner(ACornerKind: TCornerKind); + var + I, J, X, Y: Integer; + + procedure ConvertCoordinates; + begin + case ACornerKind of + ckLeft: + begin + X := I; + Y := J; + end; + ckRight: + begin + X := Width - 1 - I; + Y := J; + end; + ckTop: + begin + X := J; + Y := I; + end; + end; + end; + + begin + for I := 0 to ShadowSize - 1 do + for J := 0 to ShadowSize - 1 do + begin + ConvertCoordinates; + SetAlpha(X, Y, MulDiv(GetAlpha(X, Y), 1 + I, 1 + ShadowSize)); + end; + end; + + begin + if FKind = spHorizontal then + begin + if scLeft in FCorners then + ProcessCorner(ckLeft); + if scRight in FCorners then + ProcessCorner(ckRight); + end + else + if scTop in FCorners then + ProcessCorner(ckTop); + end; + +begin + if not CanShow then Exit; + FImage.PixelFormat := pf32bit; + FImage.Width := Width; + FImage.Height := Height; + SetLength(AColors, Width * Height); + ProcessMainContent; + ProcessCorners; + SetBitmapBits(FImage, AColors, True); +end; + +procedure TdxBarShadowPart.Hide; +begin + if HandleAllocated then + ShowWindow(Handle, SW_HIDE); + DestroyHandle; +end; + +procedure TdxBarShadowPart.Show; + + procedure MakeAlphaBlended; + var + ASize: TSize; + P: TPoint; + ABlend: TBlendFunction; + begin + ASize := TSize(ClientRect.BottomRight); + P := cxNullPoint; + with ABlend do + begin + BlendOp := AC_SRC_OVER; + BlendFlags := 0; + SourceConstantAlpha := 255; + AlphaFormat := AC_SRC_ALPHA; + end; + UpdateLayeredWindow(Handle, 0, nil, @ASize, FImage.Canvas.Handle, @P, 0, + @ABlend, LWA_ALPHA); + end; + +begin + if not CanShow then Exit; + if Transparent then MakeAlphaBlended; + dxSetZOrder(Handle, Control.Handle, False, SWP_SHOWWINDOW); +end; + +procedure TdxBarShadowPart.UpdateBounds(const ABounds: TRect); +begin + BoundsRect := ABounds; + UpdateImage; + if FOwner.Visible then Show; +end; + +{ TdxBarShadow } + +constructor TdxBarShadow.Create(AOwner: TWinControl); +begin + inherited Create; + FOwner := AOwner; +end; + +destructor TdxBarShadow.Destroy; +begin + DestroyParts; + inherited; +end; + +function TdxBarShadow.GetShadowSize: Integer; +begin + if Transparent then + Result := dxBarTransparentShadowSize + else + Result := dxBarOpaqueShadowSize; +end; + +function TdxBarShadow.GetTransparent: Boolean; +begin + Result := (@UpdateLayeredWindow <> nil) and (BitsPerPixel > 8); +end; + +procedure TdxBarShadow.SetVisible(Value: Boolean); +begin + if FVisible <> Value then + begin + FVisible := Value; + if FVisible then + Show + else + Hide; + end; +end; + +procedure TdxBarShadow.CreateParts; +var + APartCount: Integer; + + procedure CreatePart(AKind: TdxBarShadowPartKind; ACorners: TdxBarShadowCorners; + const ABounds: TRect); + begin + if IsRectEmpty(ABounds) then Exit; + FParts[APartCount] := TdxBarShadowPart.CreateEx(Self, AKind, ACorners); + FParts[APartCount].UpdateBounds(ABounds); + Inc(APartCount); + end; + + procedure CreatePartsForHorizontalMode; + begin + if not IsRectEmpty(R1) then + CreatePart(spVertical, [scTop], + Rect(R1.Right, R1.Top + ShadowSize, R1.Right + ShadowSize, R1.Bottom)); + CreatePart(spHorizontal, [scLeft, scRight], + Rect(R2.Left + ShadowSize, R2.Bottom, R2.Right + ShadowSize, R2.Bottom + ShadowSize)); + + if not IsRectEmpty(R1) then + begin + if R1.Left + ShadowSize < R2.Left then + CreatePart(spHorizontal, [scLeft], + Rect(R1.Left + ShadowSize, R1.Bottom, R2.Left, R1.Bottom + ShadowSize)); + if R1.Right > R2.Right then + CreatePart(spHorizontal, [scRight], + Rect(R2.Right, R1.Bottom, R1.Right + ShadowSize, R1.Bottom + ShadowSize)); + end; + + if IsRectEmpty(R1) or (R1.Right < R2.Right) then + CreatePart(spVertical, [scTop], + Rect(R2.Right, R2.Top + ShadowSize, R2.Right + ShadowSize, R2.Bottom)) + else + CreatePart(spVertical, [], + Rect(R2.Right, R2.Top, R2.Right + ShadowSize, R2.Bottom)); + end; + + procedure CreatePartsForVerticalMode; + begin + CreatePart(spVertical, [scTop], + Rect(R2.Right, R2.Top + ShadowSize, R2.Right + ShadowSize, R2.Bottom)); + + if R1.Top + ShadowSize < R2.Top then + CreatePart(spVertical, [scTop], + Rect(R1.Right, R1.Top + ShadowSize, R1.Right + ShadowSize, R2.Top)); + + if R1.Bottom > R2.Bottom then + begin + CreatePart(spHorizontal, [scLeft, scRight], + Rect(R1.Left + ShadowSize, R1.Bottom, R1.Right + ShadowSize, R1.Bottom + ShadowSize)); + CreatePart(spVertical, [], + Rect(R1.Right, R2.Bottom, R1.Right + ShadowSize, R1.Bottom)); + end + else + CreatePart(spHorizontal, [scLeft], + Rect(R1.Left + ShadowSize, R1.Bottom, R1.Right, R1.Bottom + ShadowSize)); + + if R1.Bottom >= R2.Bottom then + CreatePart(spHorizontal, [scRight], + Rect(R2.Left, R2.Bottom, R2.Right + ShadowSize, R2.Bottom + ShadowSize)) + else + CreatePart(spHorizontal, [scLeft, scRight], + Rect(R2.Left + ShadowSize, R2.Bottom, R2.Right + ShadowSize, R2.Bottom + ShadowSize)); + end; + +begin + APartCount := 0; + if FHorizontal then + CreatePartsForHorizontalMode + else + CreatePartsForVerticalMode; +end; + +procedure TdxBarShadow.DestroyParts; +var + I: Integer; +begin + for I := Low(FParts) to High(FParts) do + begin + FParts[I].Free; + FParts[I] := nil; + end; +end; + +procedure TdxBarShadow.Hide; +var + I: Integer; +begin + for I := Low(FParts) to High(FParts) do + if FParts[I] <> nil then FParts[I].Hide; +end; + +procedure TdxBarShadow.Show; +var + I: Integer; +begin + for I := Low(FParts) to High(FParts) do + if FParts[I] <> nil then FParts[I].Show; +end; + +procedure TdxBarShadow.Refresh; +begin + DestroyParts; + CreateParts; +end; + +procedure TdxBarShadow.SetOwnerBounds(AR1, AR2: TRect); + + procedure SwapRects; + var + R: TRect; + begin + R := R1; + R1 := R2; + R2 := R; + end; + +begin + R1 := AR1; + R2 := AR2; + FHorizontal := IsRectEmpty(R1) or (R1.Bottom = R2.Top) or (R1.Top = R2.Bottom); + if FHorizontal and (R1.Top = R2.Bottom) or + not FHorizontal and (R1.Left = R2.Right) then + SwapRects; + Refresh; +end; + +{ TCustomdxBarControl } + +constructor TCustomdxBarControl.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FCanvas := TcxCanvas.Create(inherited Canvas); + FViewInfo := GetViewInfoClass.Create(Self); + AddBarControl(Self); + ControlStyle := ControlStyle - [csCaptureMouse]; + UpdateControlStyle; + Color := clBtnFace; + FLastMousePos := cxInvalidPoint; + FShadow := TdxBarShadow.Create(Self); + Visible := False; + SetBounds(100, 100, 30, 50); + FBackgroundTempBitmap := TBitmap.Create; + FViewState := bvsNormal; +end; + +destructor TCustomdxBarControl.Destroy; +begin + BarAccessibilityHelperOwnerObjectDestroyed(FIAccessibilityHelper); + BarManager.EndMouseTracking(Self); + DoDestroy; +//#DG + if (BarManager <> nil) and (BarManager.FSelectedItem <> nil) and + (BarManager.FSelectedItem.Parent = Self) then + BarManager.InternalSetSelectedItem(nil); + if FItemLinks <> nil then FItemLinks.FBarControl := nil; + if IsCustomizing and (Self is TdxBarSubMenuControl) then + begin + SelectedLink := nil; + with TdxBarSubMenuControl(Self) do + if FSubItem <> nil then + with FSubItem do + begin + BarManager.InternalSetSelectedItem(FSubItem); + FIsActive := False; + Repaint; + end; + end; + RemoveBarControl(Self); + cxClearObjectLinks(Self); + FreeAndNil(FShadow); + FreeAndNil(FBackgroundTempBitmap); + FreeAndNil(FViewInfo); + FreeAndNil(FCanvas); + FreeAndNil(FActiveCanvas); + inherited Destroy; +end; + +procedure TCustomdxBarControl.BarGetFocus(ASelectedItem: TdxBarItemControl); +begin + DoBarGetFocus(ASelectedItem); +end; + +procedure TCustomdxBarControl.BarLostFocus; +begin + if IsFocused then + DoBarLostFocus; +end; + +procedure TCustomdxBarControl.BeforeDestruction; +begin + inherited; + if (ChildBar <> nil) and not ChildBar.IsDestroying then + FreeAndNil(FChildBar); + if ParentBar <> nil then + ParentBar.ChildBar := nil; +end; + +procedure TCustomdxBarControl.MouseDownNotifyControls( + ALinkAtPos: TdxBarItemLink; const AMousePos: TPoint; Button: TMouseButton; + Shift: TShiftState); +begin + if GetControlByLink(ALinkAtPos) <> nil then + GetControlByLink(ALinkAtPos).MouseDown(Button, Shift, AMousePos.X, AMousePos.Y); +end; + +procedure TCustomdxBarControl.MouseNotifyControls(ALinkAtPos: TdxBarItemLink; + const AMousePos: TPoint; Shift: TShiftState); +begin + if FPrevTrackedLink <> ALinkAtPos then + begin + if GetControlByLink(FPrevTrackedLink) <> nil then + GetControlByLink(FPrevTrackedLink).MouseLeave; + FPrevTrackedLink := ALinkAtPos; + if GetControlByLink(ALinkAtPos) <> nil then + GetControlByLink(ALinkAtPos).MouseEnter(Shift, AMousePos.X, AMousePos.Y); + end; + if GetControlByLink(ALinkAtPos) <> nil then + GetControlByLink(ALinkAtPos).MouseMove(Shift, AMousePos.X, AMousePos.Y); +end; + +procedure TCustomdxBarControl.MouseUpNotifyControls(ALinkAtPos: TdxBarItemLink; + const AMousePos: TPoint; Button: TMouseButton; Shift: TShiftState); +begin + if GetControlByLink(ALinkAtPos) <> nil then + GetControlByLink(ALinkAtPos).MouseUp(Button, Shift, AMousePos.X, AMousePos.Y); +end; + +function TCustomdxBarControl.GetActiveCanvas: TcxCanvas; +begin + if HandleAllocated then + begin + if FActiveCanvas <> nil then + begin + FreeAndNil(FActiveCanvas); + UpdateCanvasFont; + end; + Result := FCanvas; + end + else + begin + if FActiveCanvas = nil then + begin + FActiveCanvas := TcxScreenCanvas.Create; + UpdateCanvasFont; + end; + Result := FActiveCanvas; + end; +end; + +function TCustomdxBarControl.GetBarControlOwnerBrush: HBRUSH; +begin + Result := Painter.BarControlOwnerBrush(BarManager); +end; + +function TCustomdxBarControl.GetBarManager: TdxBarManager; +begin + Result := Owner as TdxBarManager; +end; + +function TCustomdxBarControl.GetCanvas: TcxCanvas; +begin + Result := ActiveCanvas; +end; + +function TCustomdxBarControl.GetFlat: Boolean; +begin + // TODO: obsolete + Result := BarManager.Flat; +end; + +function TCustomdxBarControl.GetIsDestroying: Boolean; +begin + Result := csDestroying in ComponentState; +end; + +function TCustomdxBarControl.GetOwnerLinkBounds(AOwnerPart: Boolean): TRect; +var + AOwnerBounds: TRect; + AFirstCase: Boolean; + + procedure ConvertRects; + + procedure ConvertRect(var R: TRect); + + procedure ConvertPoint(var P: TPoint); + var + APrevX: Integer; + begin + with P do + begin + APrevX := X; + X := Y; + Y := APrevX; + end; + end; + + begin + ConvertPoint(R.TopLeft); + ConvertPoint(R.BottomRight); + end; + + begin + if not FShadow.Horizontal then + begin + ConvertRect(Result); + ConvertRect(AOwnerBounds); + end; + end; + +begin + if IsRectEmpty(FOwnerBounds) or not IsLinkedToOwner then + SetRectEmpty(Result) + else + begin + Result := WindowRect; + AOwnerBounds := FOwnerBounds; + with Result do + begin + OffsetRect(AOwnerBounds, -Left, -Top); + OffsetRect(Result, -Left, -Top); + ConvertRects; + + AFirstCase := AOwnerBounds.Bottom = Top; + if AFirstCase then + Bottom := Top + 1 + else + Top := Bottom - 1; + if AOwnerPart then + OffsetRect(Result, 0, -(2 * Ord(AFirstCase) - 1)); + + if Left < AOwnerBounds.Left + 1 then + Left := AOwnerBounds.Left + 1 + else + Inc(Left); + if Right > AOwnerBounds.Right - 1 then + Right := AOwnerBounds.Right - 1 + else + Dec(Right); + + ConvertRects; + end; + if AOwnerPart then + OffsetRect(Result, Left, Top); + end; +end; + +function TCustomdxBarControl.GetPainterClass: TdxBarPainterClass; +begin + Result := TdxBarPainterClass(Painter.ClassType); +end; + +function TCustomdxBarControl.GetSelectedControlAtDesign: TdxBarItemControl; +begin + if (BarManager.LastSelectedLinkAtDesign <> nil) and (BarManager.LastSelectedLinkAtDesign.BarControl = Self) then + Result := BarManager.LastSelectedLinkAtDesign.Control + else + Result := nil; +end; + +function TCustomdxBarControl.GetSelectedControl: TdxBarItemControl; +begin + Result := GetControlByLink(SelectedLink); +end; + +function TCustomdxBarControl.ItemAtMousePos: TdxBarItemControl; +begin + Result := ItemAtPos(ScreenToClient(GetMouseCursorPos)); +end; + +procedure TCustomdxBarControl.SetChildBar(Value: TCustomdxBarControl); + + procedure InternalSetParentBar(AParent, AChild: TCustomdxBarControl); + begin + if AChild <> nil then + AChild.ParentBar := AParent; + end; + +//var +// APrevChildBar: TCustomdxBarControl; +begin + + FChildBar := Value; + if (Value <> nil) and (Value.ParentBar <> Self) then + Value.ParentBar := Self; + +{ + if FChildBar <> Value then + begin + APrevChildBar := FChildBar; + FChildBar := Value; + InternalSetParentBar(nil, APrevChildBar); + InternalSetParentBar(Self, FChildBar); + end; +} +end; + +procedure TCustomdxBarControl.SetDockControl(Value: TdxDockControl); +begin + FDockControl := Value; + UpdateDoubleBuffered; //! +end; + +procedure TCustomdxBarControl.SetIsActive(Value: Boolean); +begin + BarManager.HideHint; + if (FIsActive <> Value) and CanActiveChange or IsCustomizing and not Value then + DoSetIsActive(Value); +end; + +procedure TCustomdxBarControl.SetParentBar(Value: TCustomdxBarControl); + + procedure InternalSetChidBar(AParent, AChild: TCustomdxBarControl); + begin + if AParent <> nil then + AParent.ChildBar := AChild; + end; + +//var +// APrevParentBar: TCustomdxBarControl; +begin + FParentBar := Value; + if (Value <> nil) and (Value.ChildBar <> Self) then + Value.ChildBar := Self; + +{ + if FParentBar <> Value then + begin + APrevParentBar := FParentBar; + FParentBar := Value; + InternalSetChidBar(APrevParentBar, nil); + InternalSetChidBar(FParentBar, Self); + end; +} +end; + +procedure TCustomdxBarControl.SetViewState(Value: TdxBarViewState); +var + APrevViewState: TdxBarViewState; +begin + if (Value <> FViewState) and not IsCustomizing then + begin + APrevViewState := FViewState; + FViewState := Value; + ViewStateChanged(APrevViewState); + end; +end; + +procedure TCustomdxBarControl.WMCaptureChanged(var Message: TMessage); +begin + inherited; + if FDragDown then + begin + BarManager.DraggingItem := nil; + BarManager.DraggingItemLink := nil; + FDragDown := False; + end; + FClickedControl := nil; +end; + +procedure TCustomdxBarControl.WMDestroy(var Message: TMessage); +begin + if not IsDestroying then + begin + MarkState := msNone; + BeforeDestroyHandle; + end; + inherited; +end; + +procedure TCustomdxBarControl.WMEraseBkgnd(var Message: TWMEraseBkgnd); +begin +// if FItemLinks.CanVisibleItemCount = 0 then // else Fill Rgn is called +// FillBackground(Message.DC, ClientRect, ToolbarBrush, clNone, True); + Message.Result := 1; +end; + +procedure TCustomdxBarControl.WMKeyDown(var Message: TWMKeyDown); +var + AKey: Word; + IsTabKey, ADuplicate: Boolean; + AItemLink: TdxBarItemLink; + ATabForward: Boolean; +begin + inherited; + if ActiveBarControl = nil then Exit; + + AKey := Message.CharCode; + + if IsRealVertical then + begin + case AKey of + VK_LEFT: + AKey := VK_UP; + VK_RIGHT: + AKey := VK_DOWN; + VK_UP: + AKey := VK_LEFT; + VK_DOWN: + AKey := VK_RIGHT; + end; + Message.CharCode := AKey; + end; + + if Self is TdxBarSubMenuControl then + case AKey of + VK_LEFT, VK_RIGHT: + AKey := 0; + VK_UP: + AKey := VK_LEFT; + VK_DOWN: + AKey := VK_RIGHT; + end; + IsTabKey := AKey = VK_TAB; + ATabForward := False; + if IsTabKey then + begin + if GetKeyState(VK_CONTROL) < 0 then + ATabForward := not (GetKeyState(VK_SHIFT) < 0) + else + if GetKeyState(VK_SHIFT) < 0 then + AKey := VK_LEFT + else + AKey := VK_RIGHT; + end; + + case AKey of + VK_TAB: // + Ctrl + FocusNextBarControl(ATabForward); + VK_F10, VK_MENU: + if (AKey = VK_MENU) or BarManager.UseF10ForMenu then + begin + Message.CharCode := 0; + HideAll; + end; + VK_LEFT: + begin + if SelectedLink = nil then + AItemLink := ItemLinks.First + else + AItemLink := ItemLinks.Prev(SelectedLink); + if AItemLink <> nil then SetKeySelectedItem(AItemLink.Control); + if IsTabKey and SelectedControl.HasWindow then + SelectedControl.Click(False); + end; + VK_RIGHT: + begin + if SelectedLink = nil then + AItemLink := ItemLinks.First + else + AItemLink := ItemLinks.Next(SelectedLink); + if AItemLink <> nil then + begin + SetKeySelectedItem(AItemLink.Control); + if IsTabKey and SelectedControl.HasWindow then + SelectedControl.Click(False); + end; + end; + VK_HOME: + begin + AItemLink := ItemLinks.First; + if AItemLink <> nil then SetKeySelectedItem(AItemLink.Control); + end; + VK_END: + begin + AItemLink := ItemLinks.Last; + if AItemLink <> nil then SetKeySelectedItem(AItemLink.Control); + end; + else + begin + AKey := MapVirtualKey(AKey, 2); + if AKey in [Ord('A')..Ord('Z'), Ord('0')..Ord('9')] then + begin + AItemLink := FindLinkWithAccel(AKey, KeyDataToShiftState(Message.KeyData), GetLinkByControl(SelectedControl), ADuplicate); + if AItemLink <> nil then + SetAccelSelectedItem(GetControlByLink(AItemLink), ADuplicate); + end; + end; + end; +end; + +procedure TCustomdxBarControl.WMLButtonDblClk(var Message: TWMLButtonDblClk); +begin + if not FIgnoreMouseClick then + inherited; +end; + +procedure TCustomdxBarControl.WMLButtonDown(var Message: TWMLButtonDown); +begin + if not FIgnoreMouseClick then + inherited; +end; + +procedure TCustomdxBarControl.WMLButtonUp(var Message: TWMLButtonUp); +var + P: TPoint; + Item, AClickedControl: TdxBarItemControl; +begin + if FIgnoreMouseClick then + begin + FIgnoreMouseClick := False; + Exit; + end; + + inherited; + if FDragDown then + ReleaseCapture + else + begin + P.X := Message.XPos; + P.Y := Message.YPos; + AClickedControl := FClickedControl; + if AClickedControl <> nil then ReleaseCapture; + if PtInRect(ClientRect, P) and IsActive then + begin + Item := ItemAtPos(P); + if not IsCustomizing and (Item <> nil) and Item.HotPartWantMouse then + if Item.Enabled and (Item = SelectedControl) then + begin + if Item.HasWindow then + TdxBarWinControl(Item).TransferMessage(Handle, TMessage(Message)); + Item.ControlUnclick(True); + end + else + if not Item.Enabled and (Item <> SelectedControl) and (Self is TdxBarControl) and + not ((SelectedControl is TdxBarButtonControl) and + TdxBarButtonControl(SelectedControl).DroppedDown) then + TdxBarControl(Self).HideAll;//BarLostFocus; + end; + if (AClickedControl <> nil) and BarControlExists(Self) then + HideAll; + end; +end; + +procedure TCustomdxBarControl.WMMouseActivate(var Message: TWMMouseActivate); +begin + inherited; + Message.Result := MA_NOACTIVATE; +end; + +procedure TCustomdxBarControl.WMMouseMove(var Message: TWMMouseMove); +var + ALinkSelf: TcxObjectLink; +begin + ALinkSelf := cxAddObjectLink(Self); + try + inherited; + if ALinkSelf.Ref <> nil then + AfterMouseMove(KeysToShiftState(Message.Keys), Message.XPos, Message.YPos); + finally + cxRemoveObjectLink(ALinkSelf); + end; +end; + +procedure TCustomdxBarControl.WMNCPaint(var Message: TMessage); +var + ADC: HDC; +begin + if AllowNCPaint then + begin + ADC := GetNCDrawingDC(Message.WParam); + try + inherited; + NCPaint(ADC); + finally + ReleaseNCDrawingDC(ADC); + end; + end + else + inherited; +end; + +procedure TCustomdxBarControl.WMPaint(var Message: TWMPaint); +begin + if not IsDestroying then + inherited; +end; + +procedure TCustomdxBarControl.WMRepaintBar(var Message: TMessage); +begin + RepaintBar; +end; + +procedure TCustomdxBarControl.WMSetCursor(var Message: TWMSetCursor); +begin + with Message do + if (HitTest = HTCLIENT) and (CursorWnd = Handle) then + begin + Windows.SetCursor(Screen.Cursors[Cursor]); + Result := 1; + end + else + inherited; +end; + +procedure TCustomdxBarControl.WMSize(var Message: TWMSize); +begin +// ResetBackground; + inherited; +end; + +procedure TCustomdxBarControl.WMWindowPosChanged(var Message: TWMWindowPosChanged); +begin + inherited; + if not IsDestroying then + WindowPosChanged(Message); +end; + +procedure TCustomdxBarControl.AdjustSize; +begin +// do nothing +end; + +procedure TCustomdxBarControl.AdjustHintWindowPosition(var APos: TPoint; const ABoundsRect: TRect; AHeight: Integer); +begin + if GetDesktopWorkArea(APos).Bottom - APos.Y < AHeight then + APos.Y := ClientToScreen(cxNullPoint).Y - AHeight; +end; + +procedure TCustomdxBarControl.AfterControlEscape(AControl: TdxBarItemControl); +begin + if not (bboAllowSelectWindowItemsWithoutFocusing in BehaviorOptions) then + HideAllByEscape + else + SelectedControl := AControl; +end; + +procedure TCustomdxBarControl.AfterMouseMove(Shift: TShiftState; X, Y: Integer); +begin + if not NotHandleMouseMove then + FLastMousePos := ClientToScreen(Point(X, Y)) // FLastMousePos := GetMouseCursorPos - incorrect (SC B20836) + else + if NotHandleMouseMove(False) then + MouseLeave; +end; + +procedure TCustomdxBarControl.CreateWindowHandle(const Params: TCreateParams); +begin + inherited; + CreateControls; + SetLayeredAttributes; +end; + +procedure TCustomdxBarControl.CreateWnd; +begin + inherited; + SetFont; + CalcDrawingConsts; +end; + +procedure TCustomdxBarControl.DestroyWindowHandle; +begin + if WindowHandle <> 0 then + BeforeDestroyHandle; + DestroyControls; + inherited DestroyWindowHandle; +end; + +procedure TCustomdxBarControl.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + + procedure CorrectCurrentMessage; + begin + case FCurrentMessage.Msg of + WM_LBUTTONDBLCLK: FCurrentMessage.Msg := WM_LBUTTONDOWN; + WM_RBUTTONDBLCLK: FCurrentMessage.Msg := WM_RBUTTONDOWN; + WM_MBUTTONDBLCLK: FCurrentMessage.Msg := WM_MBUTTONDOWN; + end; + end; + +var + P: TPoint; + AItemControl: TdxBarItemControl; +begin + inherited; + P := Point(X, Y); + AItemControl := ItemAtPos(P); + + if cxPointIsEqual(FLastMousePos, cxInvalidPoint) and not IsCustomizing then + DoBarMouseEnter(Shift, P, AItemControl); + + if (ssDouble in Shift) and (AItemControl <> nil) and (AItemControl = SelectedControl) and AItemControl.WantsDblClick then + DblClickOnItem(AItemControl) + else + begin + CorrectCurrentMessage; + DoBarMouseDown(Button, Shift, P, AItemControl, PtInRect(ClientRect, P)); + end; +end; + +procedure TCustomdxBarControl.MouseLeave; +begin + FLastMousePos := cxInvalidPoint; + if BarManager.IsMouseTracking(Self) then + begin + BarManager.EndMouseTracking(Self); + DoBarMouseLeave; + end; +end; + +procedure TCustomdxBarControl.MouseMove(Shift: TShiftState; X, Y: Integer); + + function DragAndDrop(const P: TPoint): Boolean; + + function DragRect: TRect; + begin + Result := Bounds(0, 0, GetSystemMetrics(SM_CXDRAG), GetSystemMetrics(SM_CYDRAG)); + OffsetRect(Result, FDragPoint.X - Result.Right div 2, FDragPoint.Y - Result.Bottom div 2); + end; + + begin + Result := FDragDown and not PtInRect(DragRect, P); + if Result then + begin + FDragDown := False; + ReleaseCapture; + with BarManager do + begin + DraggingItemLink.Control.ControlInactivate(True); + DragAndDrop(DraggingItem, DraggingItemLink); + end; + end; + end; + +var + P: TPoint; + AItemControl: TdxBarItemControl; +begin + inherited; + P := Point(X, Y); + if IsDestroying or DragAndDrop(P) then + Exit; + + AItemControl := ItemAtPos(P); + if cxPointIsEqual(FLastMousePos, cxInvalidPoint) and not NotHandleMouseMove then + DoBarMouseEnter(Shift, P, AItemControl); + DoBarMouseMove(Shift, P, AItemControl); +end; + +procedure TCustomdxBarControl.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + P: TPoint; + AItemControl: TdxBarItemControl; +begin + inherited; + P := Point(X, Y); + AItemControl := ItemAtPos(P); + DoBarMouseUp(Button, Shift, P, AItemControl, PtInRect(ClientRect, P)); +end; + +function TCustomdxBarControl.NeedsMouseWheel: Boolean; +begin + Result := False; +end; + +procedure TCustomdxBarControl.ProcessMouseDownMessageForMeaningParent(AWnd: HWND; + AMsg: UINT; const AMousePos: TPoint); +begin +end; + +function TCustomdxBarControl.PtInCaller(const P: TPoint): Boolean; + + function PtInItemControl: Boolean; + var + AItemControl: TdxBarItemControl; + begin + AItemControl := ItemAtPos(P); + Result := (AItemControl <> nil) and AItemControl.IsHitTestTransparent; + end; + +begin + if IsFocused then + Result := PtInRect(GetMouseTrackingBounds, ClientToScreen(P)) + else + Result := (WindowFromPointEx(ClientToScreen(P)) = Handle) or PtInItemControl; +end; + +procedure TCustomdxBarControl.Resize; +begin + inherited; + if IsPopup then + Painter.SetWindowRgn(Handle, NCRect, True); +end; + +procedure TCustomdxBarControl.WindowPosChanged(var Message: TWMWindowPosChanged); +begin + with Message.WindowPos^ do + if (flags and SWP_NOSIZE = 0) or (flags and SWP_NOMOVE = 0) then + ResizeShadow; + FShadow.Visible := IsShadowVisible; + ResetBackground; +end; + +procedure TCustomdxBarControl.WndProc(var Message: TMessage); + + function FindEditControl(AHandle: HWND): TdxBarEditControl; + var + AEditControl: TdxBarEditControl; + I: Integer; + begin + Result := nil; + for I := 0 to ItemLinks.Count - 1 do + if ItemLinks[I].Control is TdxBarEditControl then + begin + AEditControl := TdxBarEditControl(ItemLinks[I].Control); + if AEditControl.HandleAllocated and (AEditControl.Handle = AHandle) then + begin + Result := AEditControl; + Break; + end; + end; + end; + +var + ABkColor, ATextColor: COLORREF; + AEditControl: TdxBarCustomEditControl; +begin + case Message.Msg of + WM_CTLCOLOREDIT, WM_CTLCOLORSTATIC: //don't use VCL-like method + begin + AEditControl := FindEditControl(Message.LParam); + if AEditControl = nil then + inherited + else + begin + Painter.EditGetColors(AEditControl, ATextColor, ABkColor); + SetBkColor(Message.WParam, ColorToRGB(ABkColor)); + SetTextColor(Message.WParam, ColorToRGB(ATextColor)); + Message.Result := AEditControl.EditBkBrush; + if IsOnGlass and not AEditControl.InnerControlBufferedPaint then + begin + AEditControl.InnerControlBufferedPaint := True; + PostMessage(Message.LParam, CM_BUFFEREDPAINTONGLASS, 0, 0); + end; + end; + end; + WM_KILLFOCUS: + begin + inherited; + if Message.wParam = 0 then + HideAll; + end; + WM_NCACTIVATE: + begin + if (Message.wParam = Longint(True)) and not BarManager.IsCustomizing then + SendMessage(GetParent(Handle), WM_NCACTIVATE, Longint(True), 0); + Message.wParam := Longint(True); + inherited; + end; + WM_SETFOCUS: + if not (SelectedControl is TdxBarWinControl) then + begin + if IsCustomizing and (dxBarCustomizingForm <> nil) then + begin + dxSetZOrder(Handle); + Windows.SetFocus(dxBarCustomizingForm.Handle); + dxSetZOrder(Handle, HWND_NOTOPMOST); + end + else + if IsControlVisible(BarManager.Owner) then + Windows.SetFocus(BarManager.Owner.Handle) + else + Windows.SetFocus(GetNextWindow(BarManager.Owner.Handle, GW_HWNDNEXT)); + end + else + inherited; + WM_MOUSEFIRST..WM_MOUSELAST, WM_NCMOUSEMOVE..WM_NCMBUTTONDBLCLK: + if CanProcessMouseMessage then + inherited; + WM_COMMAND: + begin + inherited; + if (Message.Result = 0) and (HiWord(Message.wParam) = EN_CHANGE) and (Message.lParam <> 0) then + Message.Result := SendMessage(Message.lParam, Message.Msg, Message.wParam, Message.lParam); + end; + else + inherited; + end; +end; + +function TCustomdxBarControl.CalcChildBarBounds(out ARect: TRect): Boolean; +begin + Result := False; +end; + +procedure TCustomdxBarControl.CalcControlsPositions; +begin + CalcItemsRect; +end; + +procedure TCustomdxBarControl.CalcDragOverParameters(const ACursorPos: TPoint; + var ADragOverItemLink: TdxBarItemLink; + var AIsBeginGroup, AIsFirstPart, AIsVerticalDirection: Boolean); +var + ACalcVerticalDirection: Boolean; + AControl: TdxBarItemControl; + AItemRect: TRect; + ASeparatorIndex, I: Integer; + ARgn: HRGN; +begin + AIsVerticalDirection := IsVerticalDirection; + + for I := 0 to FItemLinks.VisibleItemCount - 1 do + begin + AControl := FItemLinks.VisibleItems[I].Control; + if AControl.CanCustomize then + begin + ARgn := GetItemRegion(AControl); + try + if PtInRegion(ARgn, ACursorPos.X, ACursorPos.Y) then + begin + ADragOverItemLink := AControl.ItemLink; + AItemRect := GetFullItemRect(AControl); + + ACalcVerticalDirection := AIsVerticalDirection; + + if not PtInRect(AItemRect, ACursorPos) and + ViewInfo.IsAssociatedWithSeparator(AControl, ASeparatorIndex) then + begin + AIsBeginGroup := True; + if ACursorPos.Y < AItemRect.Top then + ACalcVerticalDirection := True; + + AItemRect := ViewInfo.SeparatorInfos[ASeparatorIndex].Bounds; + end; + if ACalcVerticalDirection then + AIsFirstPart := (ACursorPos.Y - AItemRect.Top) < (AItemRect.Bottom - ACursorPos.Y) + else + AIsFirstPart := (ACursorPos.X - AItemRect.Left) < (AItemRect.Right - ACursorPos.X); + + Break; + end; + finally + DeleteObject(ARgn); + end; + end; + end; +end; + +procedure TCustomdxBarControl.CalcDrawingConsts; +var + ASize: TSize; +begin + FTextSize := GetTextSize; + FRatio := Max(1, FTextSize / GetNormalItemHeight); + + FMenuArrowHeight := FTextSize div 5; + if FMenuArrowHeight < 4 then FMenuArrowHeight := 4; + + FIconAreaSize := GetIconAreaSize; + + ASize := cxTextExtent(EditFont, '0'); + FEditTextSize := Painter.EditTextSize(Self, ASize.cy); + FComboBoxArrowWidth := Painter.ComboBoxArrowWidth(Self, ASize.cx); +end; + +procedure TCustomdxBarControl.CalcItemsRect; +begin + FItemsRect := ClientRect; +end; + +procedure TCustomdxBarControl.CalcColumnItemRects(ATopIndex: Integer; + out ALastItemBottom: Integer); +var + I: Integer; + AItemLink: TdxBarItemLink; + AItemRect: TRect; +begin + AItemRect := VisibleItemsRect; + AItemRect.Bottom := AItemRect.Top; + ALastItemBottom := AItemRect.Bottom; + for I := ATopIndex to ItemLinks.VisibleItemCount - 1 do + begin + AItemLink := ItemLinks.VisibleItems[I]; + AItemRect.Top := AItemRect.Bottom + GetItemControlOffset(AItemLink); + AItemRect.Bottom := AItemRect.Top + AItemLink.Control.Height; + if AItemRect.Bottom > VisibleItemsRect.Bottom then + begin + if CanDrawClippedItem(AItemRect) then + begin + AItemLink.ItemRect := AItemRect; + ALastItemBottom := VisibleItemsRect.Bottom; + end + else + if I > ATopIndex then + ALastItemBottom := ItemLinks.VisibleItems[I - 1].ItemRect.Bottom + else + ALastItemBottom := AItemRect.Top; + Break; + end; + AItemLink.ItemRect := AItemRect; + ALastItemBottom := AItemRect.Bottom; + end; +end; + +procedure TCustomdxBarControl.CalcRowItemRects; +begin +// do nothing +end; + +procedure TCustomdxBarControl.CalcItemRects(APaintStyle: TdxBarPaintType; ATopIndex: Integer); +var + ALastItemBottom: Integer; +begin + FVisibleItemsRect := ItemsRect; + CorrectVisibleItemsRectTop; + + ItemLinks.EmptyItemRects; + case APaintStyle of + ptHorz, ptVert: CalcRowItemRects; + ptMenu: CalcColumnItemRects(ATopIndex, ALastItemBottom); + end; + + CorrectVisibleItemsRectBottom; +end; + +procedure TCustomdxBarControl.CalcLayout; +begin + ViewInfo.Calculate; +end; + +procedure TCustomdxBarControl.BeforeDestroyHandle; +var + I: Integer; +begin + if not IsDestroying then + MouseLeave; + for I := 0 to ItemLinks.CanVisibleItemCount - 1 do + with ItemLinks.CanVisibleItems[I] do + if Control <> nil then Control.BeforeDestroyParentHandle; +end; + +procedure TCustomdxBarControl.CreateControls; +begin + if ([bsCreatingControls, bsDestroyingControls] * FState <> []) then + Exit; + Include(FState, bsCreatingControls); + try + DoCreateControls; + finally + Exclude(FState, bsCreatingControls); + end; +end; + +procedure TCustomdxBarControl.DestroyControls; +begin + if ([bsCreatingControls, bsDestroyingControls] * FState <> []) then + Exit; + Include(FState, bsDestroyingControls); + try + DoDestroyControls; + finally + Exclude(FState, bsDestroyingControls); + end; +end; + +procedure TCustomdxBarControl.ExpandContainerItems; +var + ADoneItems: TList; + I: Integer; + AItemLink: TdxBarItemLink; + AFirstCall, AHideWhenRun: Boolean; +begin + if FItemLinks <> nil then + begin + ADoneItems := TList.Create; + try + I := 0; + while I <= FItemLinks.CanVisibleItemCount - 1 do + begin + AItemLink := FItemLinks.CanVisibleItems[I]; + if AItemLink.Item is TCustomdxBarContainerItem then + begin + if FExpandedItemLinks = nil then + FExpandedItemLinks := TList.Create; + FExpandedItemLinks.Count := AItemLink.Index + 1; + FExpandedItemLinks[AItemLink.Index] := AItemLink; + + AFirstCall := ADoneItems.IndexOf(AItemLink.Item) = -1; + if AFirstCall then + ADoneItems.Add(AItemLink.Item); + + AHideWhenRun := TCustomdxBarContainerItem(AItemLink.Item).HideWhenRun; + if AHideWhenRun then + AItemLink.SaveRecentIndex; + + TCustomdxBarContainerItem(AItemLink.Item).AddListedItemLinks(FItemLinks, + AItemLink.Index + 1, AFirstCall, AItemLink); + if AHideWhenRun then + begin + AItemLink.SendToBottomInRecentList; + AItemLink.Collection := nil; + Dec(I); + end; + end; + Inc(I); + end; + finally + ADoneItems.Free; + end; + end; +end; + +procedure TCustomdxBarControl.CollapseContainerItems; +var + I: Integer; + AHideWhenRun: Boolean; +begin + if FExpandedItemLinks <> nil then + try + for I := FExpandedItemLinks.Count - 1 downto 0 do + if FExpandedItemLinks[I] <> nil then + with TdxBarItemLink(FExpandedItemLinks[I]) do + begin + AHideWhenRun := TCustomdxBarContainerItem(Item).HideWhenRun; + TCustomdxBarContainerItem(Item).DeleteListedItemLinks(FItemLinks, I + Byte(not AHideWhenRun)); + if AHideWhenRun then + begin + Collection := FItemLinks; + Index := I; + RestoreRecentIndex; + end; + end; + + for I := 0 to FExpandedItemLinks.Count - 1 do + if FExpandedItemLinks[I] <> nil then + TCustomdxBarContainerItem(TdxBarItemLink(FExpandedItemLinks[I]).Item).NeedClearItemList; + finally + FreeAndNil(FExpandedItemLinks); + end; +end; + +procedure TCustomdxBarControl.LayoutChanged; +begin +// do nothing +end; + +procedure TCustomdxBarControl.RecreateControls; +begin + DestroyControls; + CreateControls; + UpdateControlByMouse; +end; + +procedure TCustomdxBarControl.UpdateControlByMouse; +var + AControl: TWinControl; + P: TPoint; +begin + P := GetMouseCursorPos; + AControl := FindControl(WindowFromPointEx(P)); + if AControl is TCustomdxBarControl then + with TCustomdxBarControl(AControl) do + begin + Windows.ScreenToClient(Handle, P); + FLastMousePos := cxInvalidPoint; + PostMessage(Handle, WM_MOUSEMOVE, 0, MakeLParam(P.X, P.Y)); + end; +end; + +function TCustomdxBarControl.CanActiveChange: Boolean; +begin + Result := IsApplicationActive or IsWindowEnabled or IsCustomizing; +end; + +function TCustomdxBarControl.CanAlignControl(AControl: TdxBarItemControl): Boolean; +begin + Result := False; +end; + +function TCustomdxBarControl.CanCallInheritedNCCalcSize: Boolean; // obsolete +begin + Result := True; +end; + +function TCustomdxBarControl.CanControlPaint(AControl: TdxBarItemControl): Boolean; +begin + Result := not IsDestroying and (AControl <> nil) and (AControl.ItemLink <> nil) and + (AControl.ItemLink.Control <> nil) and not AControl.ItemLink.Item.IsDestroying and + not (bsPaintItem in FState) and not CheckLockUpdate and ViewInfo.IsItemControlVisible(AControl); +end; + +function TCustomdxBarControl.CanCustomizing: Boolean; +begin + Result := BarManager.Designing; +end; + +function TCustomdxBarControl.CanDeactivate(ABarManager: TdxBarManager; AActiveWindow: HWND): Boolean; +begin + Result := ABarManager.IsCustomizing and (BarManager.Owner = dxBarCustomizingForm) and (Handle <> AActiveWindow) or + (SelectedControl = nil) or SelectedControl.CanDeselect(ABarManager); +end; + +function TCustomdxBarControl.CanDrawClippedItem(AItemRect: TRect): Boolean; +begin + Result := False; +end; + +function TCustomdxBarControl.CanHide: Boolean; +begin + Result := ((SelectedControl = nil) or (SelectedControl.CanHide)) and + ((ChildBar = nil) or ChildBar.CanHide); +end; + +function TCustomdxBarControl.CanProcessMouseMessage: Boolean; +var + AControl: TCustomdxBarControl; +begin + AControl := ActiveBarControl; + Result := AControl = nil; + while not Result and (AControl <> nil) do + begin + Result := AControl = Self; + AControl := AControl.GetEquivalentParentBar; + end; +end; + +function TCustomdxBarControl.CanShowPopupMenuOnMouseClick(AMousePressed: Boolean): Boolean; + + function CanShowOnMouseDown: Boolean; + begin + Result := (not (bboItemCustomizePopup in BehaviorOptions) and not IsInternal) or IsCustomizing; + end; + + function CanShowOnMouseUp: Boolean; + begin + Result := bboItemCustomizePopup in BehaviorOptions + end; + +begin + Result := AMousePressed and CanShowOnMouseDown or + not AMousePressed and CanShowOnMouseUp and not CanShowOnMouseDown; +end; + +function TCustomdxBarControl.CanShowHint: Boolean; +begin + Result := not IsActive; +end; + +function TCustomdxBarControl.CheckLockUpdate: Boolean; +begin + Result := BarManager.IsUpdateLocked; +end; + +function TCustomdxBarControl.ChildrenHaveShadows: Boolean; +begin + Result := Painter.BarChildrenHaveShadows(Self); +end; + +procedure TCustomdxBarControl.CorrectVisibleItemsRectTop; +begin +// do nothing +end; + +procedure TCustomdxBarControl.CorrectVisibleItemsRectBottom; +begin +// do nothing +end; + +procedure TCustomdxBarControl.CustomizePrepare(APoint: TPoint; ASecondClick: Boolean); +begin + if (SelectedControlAtDesign <> nil) and SelectedControlAtDesign.CanCustomize then + begin + FDragPoint := APoint; + BarManager.DraggingItem := GetItemByControl(SelectedControlAtDesign); + BarManager.DraggingItemLink := GetLinkByControl(SelectedControlAtDesign); + FDragDown := True; + SetCapture(Handle); + end; +end; + +procedure TCustomdxBarControl.DblClickOnItem(AItemControl: TdxBarItemControl); +begin + if BarManager.Designing then + AItemControl.Item.ShowDefaultEventHandler + else + if AItemControl.IsExpandable then + with TCustomdxBarSubItem(AItemControl.Item).ItemLinks do + if (BarControl <> nil) and BarControl.MarkExists then + BarControl.MarkState := msPressed + else + else + AItemControl.DblClick; +end; + +procedure TCustomdxBarControl.DoBarGetFocus(ASelectedItem: TdxBarItemControl); +begin + SetKeySelectedItem(ASelectedItem); + IsActive := True; +end; + +procedure TCustomdxBarControl.DoBarLostFocus; +begin + SetKeySelectedItem(nil); //TODO CHECK + IsActive := False; +end; + +procedure TCustomdxBarControl.DoBarMouseEnter(Shift: TShiftState; const APoint: TPoint; AItemControl: TdxBarItemControl); +begin + BarManager.BeginMouseTracking(Self); + MouseNotifyControls(GetLinkByControl(AItemControl), APoint, Shift); + ViewState := bvsHot; +end; + +procedure TCustomdxBarControl.DoBarMouseDown(Button: TMouseButton; Shift: TShiftState; + const APoint: TPoint; AItemControl: TdxBarItemControl; APointInClientRect: Boolean); +var + APrevSelectedControl: TdxBarItemControl; +begin + if not NotHandleMouseMove(False) then + MouseDownNotifyControls(GetLinkByControl(AItemControl), APoint, Button, Shift); + APrevSelectedControl := SelectedControlAtDesign; + if IsCustomizing then + SelectItemControl(AItemControl, Button, Shift); + case Button of + mbLeft: + if IsCustomizing then + CustomizePrepare(APoint, APrevSelectedControl = SelectedControlAtDesign) + else + FocusItemControl(AItemControl); + mbRight: + begin + if SelectedControl <> AItemControl then + BarLostFocus; + if CanShowPopupMenuOnMouseClick(True) then + ShowPopup(AItemControl) + end; + end; +end; + +procedure TCustomdxBarControl.DoBarMouseLeave; +begin + ViewState := bvsNormal; + + MouseNotifyControls(nil, cxInvalidPoint, []); + + if MarkState = msSelected then + MarkState := msNone; + + if (FClickedControl = nil) and (SelectedControl <> nil) and not SelectedControl.IsDroppedDown and not IsCustomizing then + SetMouseSelectedItem(nil) +end; + +procedure TCustomdxBarControl.DoBarMouseMove(Shift: TShiftState; const APoint: TPoint; + AItemControl: TdxBarItemControl); +var + FocusedControlExists: Boolean; +begin + if not NotHandleMouseMove then + begin + MouseNotifyControls(GetLinkByControl(AItemControl), APoint, Shift); + + //#DG + FocusedControlExists := (BarManager.SelectedItem <> nil) and + (BarManager.SelectedItem is TdxBarWinControl) and + TdxBarWinControl(BarManager.SelectedItem).Focused; + +{ + //#DG + if (ActiveBarControl = nil) or (ActiveBarControl = Self) then + if (AItemControl is TdxBarWinControl) and + PtInRect(TdxBarWinControl(AItemControl).WindowRect, APoint) and + (not FocusedControlExists or (AItemControl = BarManager.SelectedItem)) then + Cursor := crIBeam + else + Cursor := crDefault; +} + + if FocusedControlExists then Exit; + + if (AItemControl <> nil) and not AItemControl.CanMouseSelect then AItemControl := nil; + if (Self is TdxBarControl) and IsActive and (AItemControl = nil) then Exit; + + if (FClickedControl = nil) and ((AItemControl <> nil) or (ChildBar = nil)) then + SetMouseSelectedItem(AItemControl); + + {#DG + // TODO if Item <> nil + if (SelectedControl <> nil) and SelectedControl.FSelectedByMouse then + SelectedControl.MouseMove(KeysToShiftState(Message.Keys), P.X, P.Y); + } + end; +end; + +procedure TCustomdxBarControl.DoBarMouseUp(Button: TMouseButton; Shift: TShiftState; + const APoint: TPoint; AItemControl: TdxBarItemControl; APointInClientRect: Boolean); +begin + if not NotHandleMouseMove(False) then + MouseUpNotifyControls(GetLinkByControl(AItemControl), APoint, Button, Shift); + if (Button = mbRight) and CanShowPopupMenuOnMouseClick(False) then + ShowPopup(AItemControl); +end; + +procedure TCustomdxBarControl.DoCreateControls; +var + I: Integer; +begin + if FItemLinks <> nil then + for I := 0 to FItemLinks.CanVisibleItemCount - 1 do + FItemLinks.CanVisibleItems[I].CreateControl; +end; + +procedure TCustomdxBarControl.DoDestroy; +begin +//#DG Destroying; + CallNotify(OnDestroy, Self); +end; + +procedure TCustomdxBarControl.DoDestroyControls; +var + I: Integer; +//#DG PrevDestroyFlag: Boolean; +begin +{ + if FItemLinks <> nil then + begin + PrevDestroyFlag := FDestroyFlag; + FDestroyFlag := True; + for I := 0 to FItemLinks.CanVisibleItemCount - 1 do + FItemLinks.CanVisibleItems[I].DestroyControl; + FDestroyFlag := PrevDestroyFlag; + end; +} + if FItemLinks <> nil then + for I := 0 to FItemLinks.CanVisibleItemCount - 1 do + FItemLinks.CanVisibleItems[I].DestroyControl; +end; + +procedure TCustomdxBarControl.DoHideAll; +var + ALinkSelf: TcxObjectLink; +begin + ALinkSelf := cxAddObjectLink(Self); + try + IsActive := False; + if (ALinkSelf.Ref <> nil) and (ParentBar <> nil) and not ClosedByEscape then + ParentBar.HideAll; + finally + cxRemoveObjectLink(ALinkSelf); + end; +end; + +procedure TCustomdxBarControl.DoPaintItem(AControl: TdxBarItemControl; ACanvas: TcxCanvas; const AItemRect: TRect); +begin + ACanvas.SaveClipRegion; + try + ACanvas.SetClipRegion(TcxRegion.Create(AControl.ViewInfo.Bounds), roSet); + AControl.Paint(ACanvas, AItemRect, GetPaintType); + finally + ACanvas.RestoreClipRegion; + end; + DrawSelectedItem(ACanvas.Handle, AControl, AItemRect); +end; + +procedure TCustomdxBarControl.DoRepaintBar(ARecreateControls: Boolean); +begin + if ARecreateControls then + RecreateControls; +end; + +procedure TCustomdxBarControl.DoSetIsActive(AValue: Boolean); +begin + FIsActive := AValue; + if FIsActive then + begin + if FActiveBarControl = nil then ShowFullMenus := IsCustomizing; + FPrevActiveBarControl := FActiveBarControl; + FActiveBarControl := Self; + if not IsCustomizing then ItemLinks.InitiateActions; + end + else + begin + if IsCustomizing then + SelectedLink := nil + else + SetKeySelectedItem(nil); + if FActiveBarControl = Self then + FActiveBarControl := FPrevActiveBarControl; + if (FActiveBarControl <> nil) and + (not BarControlExists(FActiveBarControl) or not FActiveBarControl.IsActive) then + FActiveBarControl := nil; + end; +end; + +procedure TCustomdxBarControl.DrawItems; +var + I: Integer; + AItemControlViewInfo: TdxBarItemControlViewInfo; +begin + for I := 0 to ViewInfo.ItemControlCount - 1 do + begin + AItemControlViewInfo := ViewInfo.ItemControlViewInfos[I]; + if CanControlPaint(AItemControlViewInfo.Control) then + PaintItem(Canvas, AItemControlViewInfo.Control); + Canvas.ExcludeClipRect(AItemControlViewInfo.Bounds); + end; +end; + +procedure TCustomdxBarControl.DrawSelectedItem(ADC: HDC; AControl: TdxBarItemControl; const AItemRect: TRect); +var + ALink: TdxBarItemLink; +begin + ALink := GetLinkByControl(AControl); + if (ALink <> nil) and ALink.IsComponentSelected then + begin + if BarDesignController.NeedDefaultSelection(ALink) then + dxBarFrameRect(ADC, AItemRect, COLOR_WINDOWTEXT) + else + dxBarFocusRect(ADC, AItemRect); + end; +end; + +procedure TCustomdxBarControl.DragOver(X, Y: Integer; var Accept: Boolean); +begin +// do nothing +end; + +function TCustomdxBarControl.DoFindLinkWithAccel(AKey: Word; AShift: TShiftState; ACurrentLink: TdxBarItemLink): TdxBarItemLink; +begin + Result := ItemLinks.FindItemWithAccel(AKey, AShift, ACurrentLink); +end; + +function TCustomdxBarControl.FindLinkWithAccel(AKey: Word; AShift: TShiftState; ACurrentLink: TdxBarItemLink; out ADuplicate: Boolean): TdxBarItemLink; +begin + Result := DoFindLinkWithAccel(AKey, AShift, ACurrentLink); + if (Result <> nil) and Result.Item.Enabled then + ADuplicate := DoFindLinkWithAccel(AKey, AShift, Result) <> Result + else + Result := nil; +end; + +procedure TCustomdxBarControl.FocusItemControl(AItemControl: TdxBarItemControl); +var + ABarButtonControl: TdxBarButtonControl; + ALinkSelf: TcxObjectLink; +begin + if (AItemControl <> nil) and AItemControl.Enabled and AItemControl.HotPartWantMouse then + begin + SetKeySelectedItem(AItemControl); + BarManager.HideHint; + if SelectedControl is TdxBarButtonLikeControl then + TdxBarButtonLikeControl(SelectedControl).FShowAnimation := True; + if SelectedControl.HasWindow then // is focusable + SetControlVisible(SelectedControl); + ALinkSelf := cxAddObjectLink(Self); + try + AItemControl.ControlClick(True); + if (ALinkSelf.Ref <> nil) and IsControlExists(AItemControl) then + begin + if SelectedControl is TdxBarButtonControl then + begin + ABarButtonControl := TdxBarButtonControl(SelectedControl); + ABarButtonControl.FShowAnimation := False; + // *** + // if (ABarButtonControl.AItemControl.FDropDownMenu <> nil) and + // (ABarButtonControl.AItemControl.FDropDownMenu.SubMenuControl <> nil) then + // ABarButtonControl.AItemControl.FDropDownMenu.SubMenuControl.ParentBar := Self; + end; + end; + finally + cxRemoveObjectLink(ALinkSelf); + end; + end; +end; + +procedure TCustomdxBarControl.FocusNextBarControl(AForward: Boolean); +var + APrevBarControl: TCustomdxBarControl; + AIndex, APrevIndex, APrevBarIndex: Integer; + ABar: TdxBar; + ABars: TdxBars; +begin + APrevBarControl := GetParentBarForBar(Self); + if APrevBarControl is TdxBarControl then + begin + ABar := TdxBarControl(APrevBarControl).Bar; + APrevBarIndex := dxBarManagerList.IndexOf(ABar.Bars.BarManager); + APrevIndex := ABar.Index; + repeat + AIndex := ABar.Index; + if AForward then + begin + Inc(AIndex); + if AIndex >= ABar.Bars.Count then + begin + ABar := dxBarManagerList.NextActive(ABar.Bars.BarManager, True).Bars[0]; + AIndex := 0; + end; + end + else + begin + Dec(AIndex); + if AIndex < 0 then + begin + ABars := dxBarManagerList.NextActive(ABar.Bars.BarManager, False).Bars; + ABar := ABars[ABars.Count - 1]; + AIndex := ABar.Bars.Count - 1; + end; + end; + if (APrevBarIndex = dxBarManagerList.IndexOf(ABar.Bars.BarManager)) and (AIndex = APrevIndex) then + Break; + ABar := ABar.Bars[AIndex]; + if (ABar.Control <> nil) and (ABar.ItemLinks.First <> nil) then + begin + TdxBarControl(APrevBarControl).BarLostFocus; + ABar.Control.BarGetFocus(ABar.ItemLinks.First.Control); + Break; + end; + until False; + end; +end; + +function TCustomdxBarControl.GetIAccessibilityHelper: IdxBarAccessibilityHelper; +begin + if (FIAccessibilityHelper = nil) and (GetAccessibilityHelperClass <> nil) then + FIAccessibilityHelper := GetAccessibilityHelper(GetAccessibilityHelperClass.Create(Self)); + Result := FIAccessibilityHelper; +end; + +function TCustomdxBarControl.GetBehaviorOptions: TdxBarBehaviorOptions; +begin + if ParentBar <> nil then + Result := ParentBar.BehaviorOptions + else + Result := [bboAllowSelectWindowItemsWithoutFocusing, bboExtendItemWhenAlignedToClient, bboAllowDetach]; +end; + +function TCustomdxBarControl.GetClientOffset: TPoint; +begin + with ClientOrigin do + Result := Point(X - WindowRect.Left, Y - WindowRect.Top); +end; + +function TCustomdxBarControl.GetDefaultItemHeight(AItem: TdxBarItemControl): Integer; +begin + Result := AItem.GetTextSize; + if Result = 0 then + Result := TextSize; +end; + +function TCustomdxBarControl.GetDefaultItemGlyph: TBitmap; +begin + Result := nil; +end; + +function TCustomdxBarControl.GetEditFont: TFont; +begin + Result := BarManager.FEditFont; +end; + +function TCustomdxBarControl.GetClientBounds: TRect; +begin + Result := cxRectOffset(ClientRect, cxPointOffset(ClientToScreen(cxNullPoint), cxPointInvert(WindowRect.TopLeft))); +end; + +function TCustomdxBarControl.GetMouseTrackingBounds: TRect; +begin +// Result := GetWindowRect; + Result := BoundsRect; +end; + +function TCustomdxBarControl.GetNCRect: TRect; +begin + Result := cxRectOffset(WindowRect, cxPointInvert(WindowRect.TopLeft)); +end; + +function TCustomdxBarControl.GetEditFontHandle: HFONT; +begin + Result := GetEditFont.Handle; +end; + +function TCustomdxBarControl.GetEquivalentParentBar: TCustomdxBarControl; +begin + if IsInternal and (ParentBar <> nil) and not ParentBar.IsInternal then + Result := nil + else + Result := ParentBar; +end; + +function TCustomdxBarControl.GetFader: TdxFader; +begin + Result := nil; +end; + +function TCustomdxBarControl.GetFullItemRect(Item: TdxBarItemControl): TRect; +begin + Result := GetItemRect(Item); +end; + +function TCustomdxBarControl.GetIsCustomizing; +begin + Result := BarManager.IsCustomizing; +end; + +function TCustomdxBarControl.GetIsFocused: Boolean; +begin + Result := BarManager.FocusedBarControl = Self; +end; + +function TCustomdxBarControl.GetIsShadowVisible: Boolean; +begin + Result := HasShadow and IsWindowVisible(Handle); +end; + +function TCustomdxBarControl.GetItemControlDefaultViewLevel( + AItemControl: TdxBarItemControl): TdxBarItemViewLevel; +begin + Result := ivlDefault; +end; + +function TCustomdxBarControl.GetItemControlOffset(AItemLink: TdxBarItemLink): Integer; +begin + if AItemLink.BeginGroup and (AItemLink.VisibleIndex > 0) then + Result := BeginGroupSize + else + Result := 0; +end; + +function TCustomdxBarControl.GetItemRect(Item: TdxBarItemControl): TRect; +begin + if Item = nil then + SetRectEmpty(Result) + else + Result := Item.ItemBounds; +end; + +function TCustomdxBarControl.GetItemRectEx(Item: TdxBarItemControl; + IsBeginGroup: Boolean): TRect; +begin + Result := GetItemRect(Item); +end; + +function TCustomdxBarControl.GetItemRegion(Item: TdxBarItemControl): HRGN; +begin + Result := CreateRectRgnIndirect(GetItemRectEx(Item, True)); +end; + +function TCustomdxBarControl.GetItemScreenRect(Item: TdxBarItemControl): TRect; +begin + Result := GetItemRect(Item); + MapWindowRect(Handle, 0, Result); +end; + +function TCustomdxBarControl.GetMarkDrawState: TdxBarMarkState; +begin + Result := MarkState; +end; + +function TCustomdxBarControl.GetMarkSize: Integer; +begin + if MarkExists then + Result := MarkSize + else + Result := 0; +end; + +function TCustomdxBarControl.GetNormalItemHeight: Integer; +begin + // TODO: NormalItemHeight for BarControl + Result := Painter.SubMenuControlNormalItemHeight; +end; + +function TCustomdxBarControl.GetOwnerControl: TWinControl; +begin + if not IsRectEmpty(FOwnerBounds) then + Result := FOwnerControl + else + Result := nil; +end; + +function TCustomdxBarControl.GetPainter: TdxBarPainter; +begin + if FPainter <> nil then + Result := FPainter + else + if ParentBar <> nil then + Result := ParentBar.GetPainter + else + if DockControl <> nil then + Result := DockControl.Painter + else + Result := BarManager.DefaultPainter; +end; + +function TCustomdxBarControl.GetPaintType: TdxBarPaintType; +begin + if IsVertical then + Result := ptVert + else + Result := ptHorz; +end; + +function TCustomdxBarControl.GetSelectableObject: TPersistent; +begin + Result := nil; +end; + +function TCustomdxBarControl.GetSelectionOperation(AButton: TMouseButton; + AShift: TShiftState; ASelectableItem: IdxBarSelectableItem): TdxBarSelectionOperation; +begin + if AButton = mbRight then + begin + if ASelectableItem.IsComponentSelected and not BarDesignController.IsSelectionComplex(BarManager) then + Result := soAdd + else + Result := soExclusive; + end + else + if ([ssShift, ssCtrl] * AShift = [ssShift]) then + begin + if ASelectableItem.IsComponentSelected then + Result := soExclude + else + Result := soAdd; + end + else + { #DG - Mouse click on item must cause exclusive selection + if ASelectableItem.IsComponentSelected then + Result := soAdd + else + } + Result := soExclusive; +end; + +function TCustomdxBarControl.GetToolbarBrush: HBRUSH; +begin + Result := Painter.BarToolbarBrush(Self); +end; + +function TCustomdxBarControl.GetToolbarDownedBrush: HBRUSH; +begin + Result := Painter.BarToolbarDownedBrush(Self); +end; + +function TCustomdxBarControl.GetToolbarDownedSelBrush: HBRUSH; +begin + Result := Painter.BarToolbarDownedSelBrush(Self); +end; + +function TCustomdxBarControl.GetToolbarSelBrush: HBRUSH; +begin + Result := Painter.BarToolbarSelBrush(Self); +end; + +procedure TCustomdxBarControl.RepaintBarEx(ARecreateControls: Boolean); +var + APrevSelectedItemLink: TdxBarItemLink; +begin + if IsDestroying or not HandleAllocated or + ([bsCreatingControls, bsDestroyingControls, bsRepaintBar] * FState <> []) or + CheckLockUpdate then + Exit; + + Include(FState, bsRepaintBar); + try + APrevSelectedItemLink := nil; + if IsCustomizing then + begin + //#DG + if (BarManager.SelectedItem <> nil) and (BarManager.SelectedItem.Parent = Self) then + begin + APrevSelectedItemLink := BarManager.SelectedItem.ItemLink; + BarManager.InternalSetSelectedItem(nil); + end; + SelectedLink := nil; + end; + + DoRepaintBar(ARecreateControls); + + if APrevSelectedItemLink <> nil then + SetKeySelectedItem(APrevSelectedItemLink.Control); + finally + Exclude(FState, bsRepaintBar); + end; +end; + +procedure TCustomdxBarControl.SetControlVisible(AControl: TdxBarItemControl); +begin + // do nothing +end; + +procedure TCustomdxBarControl.SetItemLinks(Value: TdxBarItemLinks); +begin + FItemLinks := Value; +end; + +function TCustomdxBarControl.GetNCDrawingDC(AUpdatedRgn: HRGN): HDC; +begin + Result := GetWindowDC(Handle); +end; + +procedure TCustomdxBarControl.ReleaseNCDrawingDC(ADC: HDC); +begin + ReleaseDC(Handle, ADC); +end; + +function TCustomdxBarControl.GetBorderSize: Integer; +begin + Result := Painter.GetBorderSize; +end; + +function TCustomdxBarControl.GetIconAreaSize: Integer; +begin + Result := Painter.GetIconAreaSize(Self); +end; + +function TCustomdxBarControl.GetTextSize: Integer; +begin + Result := Painter.GetDefaultTextSize(Canvas); +end; + +function TCustomdxBarControl.GetWindowRect: TRect; +begin + Windows.GetWindowRect(Handle, Result); +end; + +function TCustomdxBarControl.GetWindowPoint(const AClientPoint: TPoint): TPoint; +begin + Result := AClientPoint; + Result.X := Result.X + NCOffset.X; + Result.Y := Result.Y + NCOffset.Y; +end; + +function TCustomdxBarControl.HasShadow: Boolean; +begin + Result := Painter.BarHasShadow(Self); +end; + +procedure TCustomdxBarControl.HideAllByEscape; +begin + ClosedByEscape := True; + HideAll; +end; + +function TCustomdxBarControl.HideOnClick: Boolean; +begin + Result := False; +end; + +function TCustomdxBarControl.IsChildBar(Value: TCustomdxBarControl): Boolean; +begin + Result := False; + while Value.ParentBar <> nil do + begin + Value := Value.ParentBar; + if Self = Value then + begin + Result := True; + Exit; + end; + end; +end; + +function TCustomdxBarControl.IsChildWindow(AWnd: HWND): Boolean; +begin + Result := IsChildEx(Handle, AWnd) or + (SelectedControl <> nil) and SelectedControl.IsChildWindow(AWnd); +end; + +function TCustomdxBarControl.IsControlExists(ABarItemControl: TdxBarItemControl): Boolean; +begin + Result := ItemLinks.IsControlExists(ABarItemControl); +end; + +function TCustomdxBarControl.IsLinkedToOwner: Boolean; +var + R1, R2: TRect; +begin + R1 := FOwnerBounds; + R2 := BoundsRect; + Result := + ((R1.Bottom = R2.Top) or (R1.Top = R2.Bottom)) and + (R1.Left < R2.Right) and (R1.Right > R2.Left) or + ((R1.Right = R2.Left) or (R1.Left = R2.Right)) and + (R1.Top < R2.Bottom) and (R1.Bottom > R2.Top); +end; + +function TCustomdxBarControl.IsMeaningParent(AWnd: HWND): Boolean; +begin + Result := False; +end; + +function TCustomdxBarControl.IsPopup: Boolean; +begin + Result := False; +end; + +function TCustomdxBarControl.IsVerticalDirection: Boolean; +begin + Result := IsRealVertical; +end; + +function TCustomdxBarControl.IsWindowEnabled: Boolean; +begin + Result := HandleAllocated and dxBar.IsWindowEnabled(Handle); +//TODO Windows.IsWindowEnabled(Handle) and Windows.IsWindowEnabled(BarManager.Owner.Handle);//#DG +end; + +procedure TCustomdxBarControl.MakeItemControlFullyVisible( + AItemControl: TdxBarItemControl); +begin +end; + +function TCustomdxBarControl.MarkExists: Boolean; +begin + Result := False; +end; + +function TCustomdxBarControl.MarkRect: TRect; +begin + Result := cxNullRect; +end; + +function TCustomdxBarControl.MouseOnMark(const AMousePos: TPoint): Boolean; +begin + Result := PtInRect(MarkRect, AMousePos); +end; + +function TCustomdxBarControl.MouseOnMark: Boolean; +begin + Result := MouseOnMark(ScreenToClient(GetMouseCursorPos)); +end; + +procedure TCustomdxBarControl.ActivateHint(AShow: Boolean; const ACustomHint: string; AHintObject: TObject = nil); +begin + BarManager.ActivateHint(AShow, ACustomHint, AHintObject); +end; + +function TCustomdxBarControl.CreateHintViewInfo(const AHintText, AShortCut: string; AScreenTip: TdxBarScreenTip): TdxBarCustomHintViewInfo; +begin + Result := Painter.CreateHintViewInfo(BarManager, AHintText, AShortCut, AScreenTip); +end; + +function TCustomdxBarControl.GetHintPosition(const AItemBounds: TRect; const ACursorPos: TPoint; AHeight: Integer): TPoint; +begin + Result := Painter.GetBarItemContolHintPosition(Self, AItemBounds, ACursorPos, AHeight); +end; + +function TCustomdxBarControl.NeedShowGlyphAndCheckForItem: Boolean; +begin + Result := False; +end; + +function TCustomdxBarControl.NotHandleMouseMove + (ACheckLastMousePos: Boolean = True): Boolean; +begin + Result := IsCustomizing or + ACheckLastMousePos and cxPointIsEqual(FLastMousePos, GetMouseCursorPos) or + not PtInRect(WindowRect, GetMouseCursorPos); +end; + +procedure TCustomdxBarControl.PaintItem(ACanvas: TcxCanvas; AControl: TdxBarItemControl); +begin + Include(FState, bsPaintItem); + try + FBkBrush := ToolbarBrush; + DoPaintItem(AControl, ACanvas, AControl.ItemBounds); + finally + Exclude(FState, bsPaintItem); + end; +end; + +procedure TCustomdxBarControl.ResizeShadow; +var + R: TRect; +begin + if IsLinkedToOwner and Painter.BarLinkedOwnerHasShadow(Self) then + R := FOwnerBounds + else + SetRectEmpty(R); + FShadow.SetOwnerBounds(R, BoundsRect); +end; + +procedure TCustomdxBarControl.SetCursorForMoving(AMoving: Boolean); +const + Cursors: array[Boolean] of TCursor = (crDefault, crSizeAll); +begin + Cursor := Cursors[AMoving]; +end; + +procedure TCustomdxBarControl.SetDockingStyle(Value: TdxBarDockingStyle); +begin + if FDockingStyle <> Value then + begin + FDockingStyle := Value; + ResetBackground; + Perform(CM_FONTCHANGED, 0, 0); + SetLayeredAttributes; + end; +end; + +procedure TCustomdxBarControl.SetLayeredAttributes; +begin +end; + +function TCustomdxBarControl.SelectedItemWantsKey(Key: Word): Boolean; +begin + Result := (SelectedControl <> nil) and SelectedControl.Enabled and + SelectedControl.WantsKey(Key); + if Result then SelectedControl.KeyDown(Key, []); +end; + +procedure TCustomdxBarControl.SelectItemControl(AItemControl: TdxBarItemControl; AButton: TMouseButton; AShift: TShiftState); +var + ASelectableItem: IdxBarSelectableItem; +begin + if AButton = mbRight then + AShift := []; + if (AItemControl = nil) then + ASelectableItem := GetSelectableItem(GetSelectableObject) + else + begin + BarGetFocus(AItemControl); + + ASelectableItem := GetSelectableItem(AItemControl.GetSelectableObject); + + case AButton of + mbLeft: + begin + if ViewInfo.ItemControlCount = 0 then //#DG ??? + Exit; + + if AItemControl.CanCustomize then {1} + begin + if AItemControl = SelectedControl then + begin + if AItemControl.IsActive then + AItemControl.ControlInactivate(True) + else + AItemControl.ControlActivate(True); + //#DG + BarManager.SelectedItem := AItemControl; +//#DG To exclude superfluous Repaint AItemControl.Repaint; + end; + SetMouseSelectedItem(AItemControl); + end; + end; + mbRight: + begin + if SelectedControl <> nil then + SelectedControl.ControlInactivate(True); + if AItemControl = SelectedControl then + begin + BarManager.SelectedItem := AItemControl; +//#DG To exclude superfluous Repaint AItemControl.Repaint; + end; + SetKeySelectedItem(AItemControl); + end; + end; + end; + BarDesignController.SelectItem(ASelectableItem, + GetSelectionOperation(AButton, AShift, ASelectableItem)); +end; + +procedure TCustomdxBarControl.SetAccelSelectedItem(AItemControl: TdxBarItemControl; ADuplicate: Boolean); +begin + SetKeySelectedItem(AItemControl); + if not ADuplicate then + SendMessage(Handle, WM_KEYDOWN, VK_RETURN, 0); +end; + +procedure TCustomdxBarControl.SetKeySelectedItem(Value: TdxBarItemControl); +begin + if not HandleAllocated or (csDestroying in ComponentState) then Exit; + if SelectedControl <> Value then + begin + if (SelectedControl <> nil) and SelectedControl.IsActive then + SelectedControl.ControlInactivate(True); + if not BarControlExists(Self) then + Exit; + if Value is TdxBarSubItemControl then + TdxBarSubItemControl(Value).FShowAnimation := False; + if Value <> nil then Value.FSelectedByMouse := False; + SelectedControl := Value; + if Value <> nil then + MakeItemControlFullyVisible(Value); + end; +end; + +procedure TCustomdxBarControl.SetMouseSelectedItem(Value: TdxBarItemControl); +var + AErrorText: string; +begin + if not HandleAllocated or (csDestroying in ComponentState) or + (BarNavigationController.IsNavigationBarControl(Self)) and (bboMouseCantUnselectNavigationItem in BehaviorOptions) then Exit; + if (SelectedControl <> Value) and not ((SelectedControl <> nil) and + SelectedControl.HasWindow and TdxBarWinControl(SelectedControl).Focused) then + begin + if (SelectedControl <> nil) and SelectedControl.IsActive then + SelectedControl.ControlInactivate(False); + if Value <> nil then Value.FSelectedByMouse := True; + SelectedControl := Value; + if not BarControlExists(Self) then Exit; + if SelectedControl <> nil then + begin + if SelectedControl is TdxBarSubItemControl then + with TCustomdxBarSubItem(GetItemByLink(SelectedLink)) do + if BarManager.Dragging and not CanContainItem(BarManager.DraggingItem, AErrorText) then + Exit + else + TdxBarSubItemControl(SelectedControl).FShowAnimation := True; + SelectedControl.ControlActivate(False); + end; + end; +end; + +procedure TCustomdxBarControl.SetSelectedControl(Value: TdxBarItemControl); +var + AOldSelectedControl: TdxBarItemControl; + AParentBar: TCustomdxBarControl; + AQuickControl: TdxBarQuickControl; +begin + if SelectedControl <> Value then + begin + if BarDesignController.QuickControl is TdxBarQuickControl then + begin + AQuickControl := TdxBarQuickControl(BarDesignController.QuickControl); + if not AQuickControl.IsActive and (AQuickControl <> Self) and (Value <> nil) then + AQuickControl.StartHidingTimer; + end; + AOldSelectedControl := SelectedControl; + SelectedLink := GetLinkByControl(Value); + if bboMouseCantUnselectNavigationItem in BehaviorOptions then + IsDowned := False; + if IsCustomizing then + begin + BarManager.SelectedItem := Value; + if not BarControlExists(Self) then Exit; + end + else + if not BarManager.IsCustomizing then + BarManager.InternalSetSelectedItem(Value); + + UpdateItem(AOldSelectedControl); + UpdateItem(SelectedControl); + +//#DG GetCursorPos(FLastMousePos); + if SelectedControl = nil then + Cursor := crDefault; + if (SelectedControl <> nil) or + (Self is TdxBarSubMenuControl) or (TdxBarControl(Self).MarkState = msNone) then + BarManager.ActivateHint(True, '', SelectedControl); + // for Application.Hint: + if (SelectedControl <> nil) and + (SelectedControl.Enabled or BarManager.ShowHintForDisabledItems) then + Hint := GetLongHint(SelectedControl.Hint) + else + Hint := ''; + AParentBar := GetParentBarOrSubMenuForBar(Self); + if (AParentBar is TdxBarSubMenuControl) and + (AParentBar.ItemLinks.Owner is TdxBarCustomPopupMenu) and + TdxBarCustomPopupMenu(AParentBar.ItemLinks.Owner).FUseOwnMessageLoop then + Application.Hint := Hint; + end; +end; + +procedure TCustomdxBarControl.Show; +begin + ShowWindow(Handle, SW_SHOWNOACTIVATE); + if SelectedControl <> nil then + SelectedControl.ParentVisibleChange(True); +end; + +procedure TCustomdxBarControl.UpdateCanvasFont; +var + ALogFont: TLogFont; +begin + if bsUpdatingCanvasFont in FState then + Exit; + Include(FState, bsUpdatingCanvasFont); + try + if IsVertical then + begin + cxGetFontData(Font.Handle, ALogFont); + ALogFont.lfEscapement := -900; + ALogFont.lfOrientation := ALogFont.lfEscapement; + ALogFont.lfOutPrecision := OUT_TT_ONLY_PRECIS; + Canvas.Font.Handle := CreateFontIndirect(ALogFont); + end + else + Canvas.Font := Font; + finally + Exclude(FState, bsUpdatingCanvasFont); + end; +end; + +procedure TCustomdxBarControl.UpdateControlStyle; +begin + if (BarManager.GetPaintStyle = bmsStandard) and not IsCustomizing then // ??? + ControlStyle := ControlStyle - [csDoubleClicks] + else + ControlStyle := ControlStyle + [csDoubleClicks]; +end; + +procedure TCustomdxBarControl.ViewStateChanged(APrevValue: TdxBarViewState); +begin +end; + +function TCustomdxBarControl.WantMouse: Boolean; +begin + Result := WindowFromPointEx(GetMouseCursorPos) = Handle; +end; + +procedure TCustomdxBarControl.DoShowPopup(ASelectedControl: TdxBarItemControl); +begin + if (ASelectedControl <> nil) or BarManager.Designing then + BarDesignController.ShowCustomizePopup(Self, GetLinkByControl(ASelectedControl)); +end; + +procedure TCustomdxBarControl.InitCustomizationPopup(AItemLinks: TdxBarItemLinks); +begin +// do nothing +end; + +procedure TCustomdxBarControl.ShowPopup(AItem: TdxBarItemControl); +begin + DoShowPopup(SelectedControlAtDesign); +end; + +function TCustomdxBarControl.AllowNCPaint: Boolean; +begin + Result := True; +end; + +procedure TCustomdxBarControl.FillBackgroundRgn(DC: HDC; ARgn: HRGN; ABrush: HBRUSH; + AIsClientArea: Boolean); +var + AClipRgn: HRGN; + AClipRgnExists: Boolean; +begin + SaveClipRgn(DC, AClipRgn, AClipRgnExists); + ExtSelectClipRgn(DC, ARgn, RGN_AND); + FillBackground(DC, NCRect, ABrush, clNone, AIsClientArea); + RestoreClipRgn(DC, AClipRgn, AClipRgnExists); +end; + +procedure TCustomdxBarControl.FullInvalidate; +begin + if HandleAllocated then + SendMessage(Handle, WM_NCPAINT, 0, 0); + Invalidate; +end; + +procedure TCustomdxBarControl.FullRepaint; +begin + if HandleAllocated then + SendMessage(Handle, WM_NCPAINT, 0, 0); + Repaint; +end; + +procedure TCustomdxBarControl.InvalidateNCRect(ARect: TRect); +var + ARegion: HRGN; +begin + ARect := cxRectOffset(ARect, WindowRect.TopLeft); + ARegion := CreateRectRgnIndirect(ARect); + SendMessage(Handle, WM_NCPAINT, ARegion, 0); + DeleteObject(ARegion); +end; + +function TCustomdxBarControl.IsInternal: Boolean; +begin + Result := False; +end; + +function TCustomdxBarControl.IsBackgroundBitmap: Boolean; +begin + Result := (DockControl <> nil) and DockControl.IsBackgroundBitmap; +end; + +function TCustomdxBarControl.IsNeedBufferedOnGlass( + AControl: TdxBarItemControl): Boolean; +begin + Result := IsOnGlass and not AControl.IsTransparentOnGlass; +end; + +function TCustomdxBarControl.IsTransparent: Boolean; +begin + Result := (DockControl <> nil) and DockControl.IsTransparent; +end; + +function TCustomdxBarControl.NCOffset: TPoint; +begin + Result.X := 0; + Result.Y := 0; +end; + +procedure TCustomdxBarControl.NCPaint(ADC: HDC); +begin +// do nothing +end; + +function TCustomdxBarControl.PointBarToDock(const APoint: TPoint): TPoint; +var + ABounds: TRect; +begin + ABounds := BoundsRect; + Result.X := APoint.X + ABounds.Left; + Result.Y := APoint.Y + ABounds.Top; +end; + +procedure TCustomdxBarControl.ResetBackground; +begin + FBackgroundTempBitmap.Assign(nil); +end; + +procedure TCustomdxBarControl.UpdateDoubleBuffered; +begin + DoubleBuffered := IsTransparent or BarManager.IsUncustomizable; +end; + +procedure TCustomdxBarControl.HideAll; +var + ALinkSelf: TcxObjectLink; +begin + if bsHideAll in FState then + Exit; + + ALinkSelf := cxAddObjectLink(Self); + Include(FState, bsHideAll); + try + DoHideAll; + finally + if ALinkSelf.Ref <> nil then + Exclude(FState, bsHideAll); + cxRemoveObjectLink(ALinkSelf); + end; +end; + +function TCustomdxBarControl.IsOnGlass: Boolean; +begin + Result := False; +end; + +function TCustomdxBarControl.IsRealVertical: Boolean; +begin + Result := False; +end; + +function TCustomdxBarControl.IsVertical: Boolean; +begin + Result := False; +end; + +function TCustomdxBarControl.ItemAtPos(const APos: TPoint): TdxBarItemControl; +var + I: Integer; +begin + Result := nil; + if not IsCustomizing or CanCustomizing then + for I := 0 to ViewInfo.ItemControlCount - 1 do + if PtInRect(ViewInfo.ItemControlViewInfos[I].Bounds, APos) then + begin + Result := ViewInfo.ItemControlViewInfos[I].Control; + if IsCustomizing and Result.IsHiddenForCustomization then + Result := nil; + Break; + end; +end; + +procedure TCustomdxBarControl.RepaintBar; +begin + RepaintBarEx(True); +end; + +{ TdxDockCol } + +constructor TdxDockCol.Create(ADockRow: TdxDockRow; ABarControl: TdxBarControl); +begin + inherited Create; + FDockRow := ADockRow; + FBarControl := ABarControl; +end; + +procedure TdxDockCol.AssignPosition; +begin + with FBarControl do + FPos := Point(Left, Top); +end; + +{ TdxDockRow } + +constructor TdxDockRow.Create(ADockControl: TdxDockControl); +begin + inherited Create; + FDockControl := ADockControl; + FColList := TList.Create; + FBars := TList.Create; +end; + +destructor TdxDockRow.Destroy; +var + I: Integer; +begin + for I := ColCount - 1 downto 0 do + Cols[I].Free; + FreeAndNil(FColList); + while FBars.Count <> 0 do + TdxBar(FBars[0]).RemoveFromDockRow(False); + FreeAndNil(FBars); + inherited; +end; + +function TdxDockRow.AddCol(ABarControl: TdxBarControl): TdxDockCol; +begin + Result := TdxDockCol.Create(Self, ABarControl); + ColList.Add(Result); + UpdateOneOnRows; +end; + +procedure TdxDockRow.DeleteCol(ABarControl: TdxBarControl); +var + I: Integer; +begin + if FColList = nil then + Exit; + for I := 0 to ColCount - 1 do + if Cols[I].BarControl = ABarControl then + begin + DeleteCol(I); + Break; + end; +end; + +procedure TdxDockRow.DeleteCol(AIndex: Integer); +begin + Cols[AIndex].Free; + ColList.Delete(AIndex); + UpdateOneOnRows; +end; + +procedure TdxDockRow.AddBar(ABar: TdxBar); +var + I: Integer; + ACol: TdxDockCol; +begin + FBars.Add(ABar); + if (FBars.Count > ColCount) and (ABar.Control <> nil) and (ABar.RealDockControl = DockControl) then + begin + for I := 0 to ColCount - 1 do + if TdxDockCol(ColList[I]).BarControl = ABar.Control then Exit; + ACol := TdxDockCol.Create(Self, ABar.Control); + ColList.Add(ACol); + UpdateOneOnRows; + ACol.Pos := Point(ABar.DockedLeft, ABar.DockedTop); + end; +end; + +procedure TdxDockRow.DeleteBar(ABar: TdxBar; ADestroyEmptyDockRow: Boolean); +begin + if FBars.IndexOf(ABar) < 0 then + Exit; + FBars.Delete(FBars.IndexOf(ABar)); + if ABar.Control <> nil then + DeleteCol(ABar.Control); + if (FBars.Count = 0) and ADestroyEmptyDockRow then + begin + FDockControl.RowList.Delete(FDockControl.RowList.IndexOf(Self)); + Free; + end; +end; + +function TdxDockRow.GetCol(Index: Integer): TdxDockCol; +begin + Result := FColList[Index]; +end; + +function TdxDockRow.GetColCount: Integer; +begin + Result := FColList.Count; +end; + +function TdxDockRow.GetVisible: Boolean; +var + ABarControl: TdxBarControl; + I: Integer; +begin + Result := False; + for I := 0 to FBars.Count - 1 do + begin + ABarControl := TdxBar(FBars[I]).Control; + if (ABarControl <> nil) and (ABarControl.DockingStyle <> dsNone) then + begin + Result := True; + Break; + end; + end; +end; + +procedure TdxDockRow.UpdateOneOnRows; +var + I: Integer; +begin + for I := 0 to ColCount - 1 do + Cols[I].BarControl.Bar.OneOnRow := ColCount = 1; +end; + +{ TdxBarControl } + +constructor TdxBarControl.CreateEx(AOwner: TComponent; ABar: TdxBar); +begin + inherited Create(AOwner); + FBar := ABar; +end; + +constructor TdxBarControl.CreateForPopup(AParentBarControl: TdxBarControl; + ABar: TdxBar); +begin + CreateEx(ABar.BarManager, ABar); + FPopupBar := ABar; + ParentBar := AParentBarControl; + BarManager.Bars.BeginUpdate; + try + Bar := BarManager.Bars.Add; + Bar.AllowQuickCustomizing := False; + Bar.Hidden := True; + Bar.Font := AParentBarControl.Font; + Bar.UseOwnFont := False; + finally + BarManager.Bars.EndUpdate(False); + end; + ItemLinks := Bar.ItemLinks; + ItemLinks.BarControl := Self; + ItemLinks.Internal := True; +end; + +destructor TdxBarControl.Destroy; +begin +//#DG Destroying; + BarAccessibilityHelperOwnerObjectDestroyed(FMarkIAccessibilityHelper); + if (FBar <> nil) and (FBar.Bars <> nil) and (DockingStyle <> dsNone) then + FBar.Bars.UnregFromDock(FDockingStyle, FDockControl, Self); + + BarLostFocus; // HideAll; //#DG TODO: CHECK IT!!! + + if WindowHandle = 0 then + DestroyControls + else + DestroyHandle; + inherited Destroy; + if IsPopup then + FreeAndNil(FBar); +end; + +function TdxBarControl.ClientToScreen(const APoint: TPoint): TPoint; +begin + Result := APoint; + Windows.ClientToScreen(Handle, Result); +end; + +procedure TdxBarControl.CloseUp; +begin + ParentBar.MarkState := msNone; +end; + +procedure TdxBarControl.Hide; +begin + SetWindowPos(Handle, 0, 0, 0, 0, 0, + SWP_NOZORDER or SWP_NOMOVE or SWP_NOSIZE or SWP_HIDEWINDOW or SWP_NOACTIVATE); + + if SelectedControl <> nil then + SelectedControl.ParentVisibleChange(False); +end; + +function TdxBarControl.GetCaptionBkColor: COLORREF; +begin + Result := Painter.BarCaptionBkColor(Self, BarManager.MainFormActive); +end; + +function TdxBarControl.GetCaptionButtons: TdxBarCaptionButtons; +begin + Result := Bar.CaptionButtons; +end; + +function TdxBarControl.GetCaptionColor: COLORREF; +begin + Result := Painter.BarCaptionColor(Self); +end; + +function TdxBarControl.GetHorizontal: Boolean; +begin + Result := DockingStyle in [dsTop, dsBottom]; +end; + +function TdxBarControl.GetInternallyLocked: Boolean; +begin + Result := FInternalLockCount <> 0; +end; + +function TdxBarControl.GetMarkIAccessibilityHelper: IdxBarAccessibilityHelper; +begin + if FMarkIAccessibilityHelper = nil then + FMarkIAccessibilityHelper := GetAccessibilityHelper(GetMarkAccessibilityHelperClass.Create(Self)); + Result := FMarkIAccessibilityHelper; +end; + +function TdxBarControl.GetVertical: Boolean; +begin + Result := DockingStyle in [dsLeft, dsRight]; +end; + +procedure TdxBarControl.SetCloseButtonState(Value: TdxBarMarkState); +var + DC: HDC; +begin + if FCloseButtonState <> Value then + begin + FCloseButtonState := Value; + if HandleAllocated then + begin + DC := GetWindowDC(Handle); + DrawCloseButton(DC); + ReleaseDC(Handle, DC); + end; + end; +end; + +procedure TdxBarControl.SetNewBounds; +begin + if (Left <> NewLeft) or (Top <> NewTop) or (Width <> NewWidth) or (Height <> NewHeight) then + SetWindowPos(Handle, 0, NewLeft, NewTop, NewWidth, NewHeight, SWP_NOZORDER or SWP_NOACTIVATE); +end; + +procedure TdxBarControl.SetMoving(Value: Boolean); +var + I: Integer; + KillingHandle: HWND; +begin + if FMoving <> Value then + begin + FMovingChanging := True; + try + FMoving := Value; + if Value then + FBar.Bars.FMovingBarControl := Self + else + FBar.Bars.FMovingBarControl := nil; +// SetCursorForMoving(Value); + for I := 0 to ItemLinks.CanVisibleItemCount - 1 do + if ItemLinks.CanVisibleItems[I].Control.HasWindow then + with TdxBarWinControl(ItemLinks.CanVisibleItems[I].Control) do + if FMoving then + DestroyInnerEdit + else + CreateInnerEdit; + if FMoving then + begin + if FDockingStyle = dsNone then + begin + FFloatingHandle := Handle; + FDockingStyle := dsLeft; + FDockControl := FBar.Bars.FDockControls[dsLeft]; + DestroyControls; + WindowHandle := 0; + CreateHandle; + FDockedHandle := Handle; + WindowHandle := 0; + FDockingStyle := Bar.DockingStyle; + FDockControl := nil; + BeginInternal; + try + CreateHandle; + finally + EndInternal; + end; + Windows.SetParent(FDockedHandle, 0); + end + else + begin + FDockedHandle := Handle; + FDockingStyle := dsNone; + DestroyControls; + WindowHandle := 0; + CreateHandle; + FFloatingHandle := Handle; + WindowHandle := 0; + FDockingStyle := Bar.DockingStyle; + BeginInternal; + try + CreateHandle; + finally + EndInternal; + end; + end; + // this code creates problems with other relative popups +// SetWindowPos(FFloatingHandle, HWND_TOPMOST, 0, 0, 0, 0, +// SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE); + end + else + begin + // this code makes top-most windows normal + //SetWindowPos(FFloatingHandle, HWND_NOTOPMOST, 0, 0, 0, 0, + // SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE); + if FDockingStyle = dsNone then + KillingHandle := FDockedHandle + else + KillingHandle := FFloatingHandle; + SetWindowLong(KillingHandle, GWL_WNDPROC, Longint(DefWndProc)); + DestroyWindow(KillingHandle); + SavePos; + end; + SetCursorForMoving(Value); + Perform(WM_SIZE, 0, 0); // to store normal size + RepaintBar; + finally + FMovingChanging := False; + end; + end; +end; + +procedure TdxBarControl.ChangeStyleWinTo(AStyle: TdxBarDockingStyle; + ADockControl: TdxDockControl); +begin + if (FBar = nil) or (FBar.Bars = nil) or IsDestroying then Exit; + if FMoving then + begin + DockControl := ADockControl; + DockingStyle := AStyle; + WindowHandle := 0; + BeginInternal; + try + CreateHandle; + finally + EndInternal; + end; + if FDockingStyle = dsNone then + Windows.SetParent(FDockedHandle, 0) + else + Windows.SetParent(Handle, FDockControl.Handle); + RepaintBar; + end + else + begin + BeginInternal; + try + DestroyHandle; + finally + EndInternal; + end; + DockControl := ADockControl; + DockingStyle := AStyle; + CreateHandle; + FrameChanged; + end; +end; + +function TdxBarControl.GetDragPointOffset(Style: TdxBarDockingStyle): TPoint; +begin + if (Style <> dsNone) and (Self = Bar.Bars.FMovingBarControl) and + (Style = Bar.Bars.FMovingBarOriginalDockingStyle) then + with Bar.Bars do + if Vertical then + Result := Point(-FMovingOffset.X, FMovingStaticOffset.Y) + else + Result := Point(FMovingStaticOffset.X, -FMovingOffset.Y) + else + with GetTrackSize(Style) do + begin + Result.X := MulDiv(X, RX.X, RX.Y); + Result.Y := MulDiv(Y, RY.X, RY.Y); + end; +end; + +function TdxBarControl.GetCaptionNCRect: TRect; +begin + Result := Painter.GetToolbarCaptionRect(NCRect); +end; + +procedure TdxBarControl.DrawCloseButton(DC: HDC); +begin + Painter.BarDrawCloseButton(Self, DC, CloseButtonRectNC); +end; + +procedure TdxBarControl.DrawMark(DC: HDC); +begin + Painter.BarDrawMark(Self, DC, MarkNCRect); +end; + +procedure TdxBarControl.DrawMDIButton(AButton: TdxBarMDIButton; ASelected, APressed: Boolean); + + function GetMDIButtonState: Integer; + begin + Result := DXBAR_NORMAL; + if not MDIButtonEnabled(AButton, MF_GRAYED) then + Result := DXBAR_DISABLED + else + if ASelected or APressed then + if ASelected and APressed then + Result := DXBAR_PRESSED + else + if ASelected then + Result := DXBAR_HOT + else + Result := DXBAR_ACTIVE + end; + +var + R: TRect; + DC: HDC; +begin + R := RectMDI(AButton); + DC := Canvas.Handle; + Painter.BarDrawMDIButton(Self, AButton, GetMDIButtonState, DC, R); +end; + +function TdxBarControl.GetMDIWidth: Integer; +begin + if RealMDIButtonsOnBar then + if IsRealVertical then + Result := MDIButtonWidth + else + Result := 3 * MDIButtonWidth + 2 + else + Result := MDIButtonWidth; +end; + +function TdxBarControl.GetMDIHeight: Integer; +begin + if RealMDIButtonsOnBar then + if IsRealVertical then + Result := 3 * MDIButtonHeight + 2 + else + Result := MDIButtonHeight + else + Result := MDIButtonHeight; +end; + +function TdxBarControl.RectMDI(Button: TdxBarMDIButton): TRect; +var + AVertical: Boolean; + AWidth, AHeight, W, H, MDISize, Offset: Integer; + + function MDIButtonsHaveOwnRow: Boolean; + var + I, L: Integer; + begin + Result := False; + L := ItemLinks.VisibleItemCount - 1; + for I := L downto 0 do + with ItemLinks.VisibleItems[I] do + begin + if Control.FLastInRow and (I <> L) then + begin + Result := True; + Break; + end; + if AVertical then + if ItemRect.Left < Offset then Break + else + else + if ItemRect.Bottom > Offset then Break; + if I = 0 then Result := True; + end; + end; + +begin + SetRectEmpty(Result); + + AVertical := Vertical; + if AVertical then + begin + AWidth := ClientHeight; + AHeight := ClientWidth; + W := MDIButtonHeight; + H := MDIButtonWidth; + MDISize := GetMDIHeight; + end + else + begin + AWidth := ClientWidth; + AHeight := ClientHeight; + W := MDIButtonWidth; + H := MDIButtonHeight; + MDISize := GetMDIWidth; + end; + if DockingStyle <> dsNone then + Dec(AWidth, GetMarkSize); + + if MultiLine then + begin + if AVertical then + Offset := H + else + Offset := AHeight - H; + if not MDIButtonsHaveOwnRow then + if ItemLinks.VisibleItemCount = 0 then + Offset := (AHeight - H) div 2 + else + Offset := AHeight - + (ItemLinks.VisibleItems[ItemLinks.VisibleItemCount - 1].RowHeight - H) div 2 - H + else + if AVertical then Offset := AHeight - Offset; + end + else + Offset := (AHeight - H) div 2; + + if RealMDIButtonsOnBar then + begin + Result := Bounds(AWidth - MDISize + W * Ord(Button), Offset, W, H); + if Button = mdibClose then OffsetRect(Result, 2, 0); + end + else + Result := Bounds(AWidth - W, Offset, W, H); + if AVertical then + with Result do + begin + W := Left; + Left := AHeight - Bottom; + Bottom := Right; + Right := AHeight - Top; + Top := W; + end; +end; + +function TdxBarControl.RealMDIButtonsOnBar: Boolean; +begin + Result := IsMainMenu and BarManager.IsMDIMaximized and + (GetSystemMenu(BarManager.ActiveMDIChild, False) <> 0); +end; + +function TdxBarControl.MDIButtonsOnBar: Boolean; +begin + Result := RealMDIButtonsOnBar or IsMainMenu and BarManager.ShowCloseButton; +end; + +function TdxBarControl.MDIButtonEnabled(AButton: TdxBarMDIButton; State: Integer): Boolean; +begin + Result := + (AButton = mdibRestore) or + (AButton = mdibClose) and not RealMDIButtonsOnBar and MDIButtonsOnBar or + (GetMenuState(GetSystemMenu(BarManager.ActiveMDIChild, False), + MDIButtonCommands[AButton], MF_BYCOMMAND) and State = 0); +end; + +procedure MoreButtonsHintTimerProc(Wnd: HWND; Msg: UINT; idEvent: UINT; Time: DWORD); stdcall; +var + BarControl: TdxBarControl; +begin + BarControl := TdxBarControl(FindControl(Wnd)); + with BarControl do + if not IsWindowVisible(Handle) or not MouseOnMark then + FinishMoreButtonsHintTimer; +end; + +procedure TdxBarControl.StartMoreButtonsHintTimer; +begin + FMoreButtonsHintTimer := SetTimer(Handle, 1, 50, @MoreButtonsHintTimerProc); +end; + +procedure TdxBarControl.FinishMoreButtonsHintTimer; +begin + if dxKillTimer(0, FMoreButtonsHintTimer) and (MarkState = msSelected) then + MarkState := msNone; +end; + +function TdxBarControl.CanResizeSelectedLink(APoint: TPoint): Boolean; +begin + Result := (SelectedControlAtDesign <> nil) and SelectedControlAtDesign.CanResize(APoint); +end; + +procedure TdxBarControl.WMCaptureChanged(var Message: TMessage); +begin + inherited; + if FIsResizing then + begin + FIsResizing := False; + SelectedControl.EndResize(False); + end; +end; + +procedure TdxBarControl.WMDestroy(var Message: TMessage); +var + ADockControl: TdxDockControl; +begin + ADockControl := DockControl; + if ADockControl <> nil then + ADockControl.IsBarHandleDestroying := True; + try + FinishMoreButtonsHintTimer; + inherited; + if (FBar <> nil) and not InternallyLocked and not IsInternal and FBar.Visible and + not BarManager.IsDestroying then + begin + BarManager.AddBarToRestoringList(Bar); + FBar.Visible := False; + end; + finally + if ADockControl <> nil then + ADockControl.IsBarHandleDestroying := False; + end; +end; + +procedure TdxBarControl.WMGetDlgCode(var Message: TWMGetDlgCode); +begin + Message.Result := DLGC_WANTALLKEYS or DLGC_WANTARROWS or DLGC_WANTTAB; +end; + +procedure TdxBarControl.WMGetMinMaxInfo(var Message: TWMGetMinmaxInfo); +begin + inherited; + with Message.MinMaxInfo^ do + begin + ptMinTrackSize := Point(10, 10); + ptMaxTrackSize := Point(30000, 30000); // because of Win95/98 + ptMaxSize := ptMaxTrackSize; + ptMaxPosition := ptMaxSize; + end; +end; + +procedure TdxBarControl.WMGetObject(var Message: TMessage); +begin +// if CanReturnAccessibleObject(Message) then +// Message.Result := WMGetObjectResultFromIAccessibilityHelper(Message, IAccessibilityHelper) +// else + inherited; +end; + +procedure TdxBarControl.WMKeyDown(var Message: TWMKeyDown); +begin + inherited; + if (ActiveBarControl = nil) or SelectedItemWantsKey(Message.CharCode) then + Exit; + with Message do + case CharCode of + VK_ESCAPE: + begin + CharCode := 0; + HideAllByEscape; + end; + VK_RETURN: + if SelectedControl <> nil then + SelectedControl.Click(False); + end; +end; + +procedure TdxBarControl.WMLButtonDblClk(var Message: TWMLButtonDblClk); +begin + CheckMarkState(Point(Message.XPos, Message.YPos)); + inherited; +end; + +procedure TdxBarControl.WMLButtonUp(var Message: TWMLButtonUp); +var + P: TPoint; + AButton: TdxBarMDIButton; +begin + if FIgnoreMouseClick then + begin + FIgnoreMouseClick := False; + Exit; + end; + + if FIsResizing then + begin + FIsResizing := False; + SelectedControl.EndResize(True); + ReleaseCapture; + Exit; + end; + + P := Point(Message.XPos, Message.YPos); + if MDIButtonsOnBar and FIsMDIButtonPressed then + begin + ReleaseCapture; + FIsMDIButtonPressed := False; + FIsMouseOverMDIButton := False; + RepaintMDIButtons; + if not RealMDIButtonsOnBar then + begin + if PtInRect(RectMDI(mdibClose), P) then + BarManager.DoCloseButtonClick; + end + else + begin + for AButton := Low(TdxBarMDIButton) to High(TdxBarMDIButton) do + if PtInRect(RectMDI(AButton), P) then + begin + if AButton = FPressedMDIButton then + SendMessage(BarManager.ActiveMDIChild, WM_SYSCOMMAND, MDIButtonCommands[AButton], 0); + Break; + end; + end; + end; + inherited; +end; + +procedure TdxBarControl.WMMouseActivate(var Message: TWMMouseActivate); +begin + inherited; + if not IsActive and (DockingStyle = dsNone) then + dxSetZOrder(Handle, HWND_TOP); + //ProcessPaintMessages; +end; + +procedure TdxBarControl.WMNCCalcSize(var Message: TWMNCCalcSize); +var + AContentOffsets: TRect; +begin + if not FMovingChanging then + FHasSizeGrip := FBar.HasSizeGrip; + AContentOffsets := Painter.GetToolbarContentOffsets(Bar, DockingStyle, FHasSizeGrip); + + with Message.CalcSize_Params^.rgrc[0] do + begin + Inc(Left, AContentOffsets.Left); + Inc(Top, AContentOffsets.Top); + Dec(Right, AContentOffsets.Right); + Dec(Bottom, AContentOffsets.Bottom); + end; +end; + +procedure TdxBarControl.WMNCHitTest(var Message: TWMNCHitTest); +var + P: TPoint; + AControl: TdxBarItemControl; + + function MouseAboveMDIButtons: Boolean; + begin + Result := MDIButtonsOnBar and + (RealMDIButtonsOnBar and + (PtInRect(RectMDI(mdibMinimize), P) or PtInRect(RectMDI(mdibRestore), P)) or + PtInRect(RectMDI(mdibClose), P)); + end; + + function NoControl: Boolean; + begin + Result := (AControl = nil) or not IsCustomizing and not AControl.HotPartWantMouse; + end; + + procedure CheckResizingHitTest(var AHitTest: Integer; P: TPoint); + var + R, RW: TRect; + ASizingBorders: TSize; + begin + if AHitTest = HTNOWHERE then + begin + ASizingBorders.cx := Painter.BorderSizeX; + ASizingBorders.cy := Painter.BorderSizeY; + RW := GetWindowRect; + Dec(P.X, RW.Left); + Dec(P.Y, RW.Top); + OffsetRect(RW, -RW.Left, -RW.Top); + R := RW; + R.Bottom := R.Top + ASizingBorders.cy; + if cxRectPtIn(R, P) then + AHitTest := HTTOP + else + begin + R := RW; + R.Left := R.Right - ASizingBorders.cx; + if cxRectPtIn(R, P) then + AHitTest := HTRIGHT + else + begin + R := RW; + R.Top := R.Bottom - ASizingBorders.cy; + if cxRectPtIn(R, P) then + AHitTest := HTBOTTOM + else + begin + R := RW; + R.Right := R.Left + ASizingBorders.cx; + if cxRectPtIn(R, P) then + AHitTest := HTLEFT; + end; + end; + end; + end; + end; + +begin + inherited; + if bboUnmoved in BehaviorOptions then + begin + FHitTest := Message.Result; + Exit; + end; + FHitTest := 0; + P := SmallPointToPoint(Message.Pos); + Windows.ScreenToClient(Handle, P); + with Message do + if DockingStyle = dsNone then + begin + case Result of + HTCLIENT: + begin + AControl := ItemAtPos(P); + if NoControl and not MouseAboveMDIButtons then + begin + FHitTest := HTCAPTION; + Result := HTCLIENT; + end; + end; + HTNOWHERE: + begin + CheckResizingHitTest(Result, GetMouseCursorPos); + if Result <> HTNOWHERE then + begin + FHitTest := Result; + Exit; + end; + if not IsCustomizing and MarkExists and MouseOnMark(P) then + FHitTest := HTCLIENT + else + if PtInRect(CloseButtonRect, P) then + if not Painter.BarUseSystemClose then + FHitTest := HTCLOSE + else + begin + FHitTest := HTCLIENT; + Result := HTCLOSE; + Exit; + end + else + FHitTest := HTCAPTION; + Result := HTCLIENT; + end; + else + FHitTest := Result; + end + end + else // DockingStyle <> dsNone + begin + if Result = HTCLIENT then + AControl := ItemAtPos(P) + else + AControl := nil; + if (Result = HTCLIENT) and NoControl or (Result = HTNOWHERE) then + begin + if not Vertical and (P.X < 0) or Vertical and (P.Y < 0) or + NoControl and not MouseAboveMDIButtons and + (not MarkExists or not MouseOnMark(P)) then + if FHasSizeGrip and PtInRect(SizeGripRect, P) then + begin + FHitTest := HTBOTTOMRIGHT; + Result := HTBOTTOMRIGHT; + end + else + begin + FHitTest := HTCAPTION; + Result := HTCLIENT; + end; + end + else + begin + FHitTest := Result; + Result := HTCLIENT; + end; + end; +end; + +procedure TdxBarControl.WMNCLButtonDown(var Message: TWMNCLButtonDown); + +const + CloseButtonID = -2; +var + ACloseButtonRectNC: TRect; + AActiveButtonID: Integer; + + function GetWindowCursorPos: TPoint; + begin + Result := cxPointOffset(GetMouseCursorPos, cxPointInvert(WindowRect.TopLeft)); + end; + + function GetButtonID(const APoint: TPoint): Integer; + begin + if PtInRect(ACloseButtonRectNC, APoint) then + Result := CloseButtonID + else + Result := CaptionButtons.GetButtonIndex(APoint); + end; + + procedure UpdateButtonState(AMousePressed: Boolean); + var + APoint: TPoint; + begin + APoint := GetWindowCursorPos; + if AActiveButtonID = CloseButtonID then + if GetButtonID(APoint) = CloseButtonID then + if AMousePressed then + CloseButtonState := msPressed + else + CloseButtonState := msSelected + else + if AMousePressed then + CloseButtonState := msSelected + else + CloseButtonState := msNone + else + CaptionButtons.UpdateButtonStates(APoint, AMousePressed); + end; + + procedure DoClick; + var + ABar: TdxBar; + begin + if AActiveButtonID = CloseButtonID then + begin + ABar := FBar; + Bar.Visible := False; + ABar.BarManager.DesignerModified; + ABar.BarManager.DoBarClose(ABar); + end + else + CaptionButtonClick(AActiveButtonID); + end; + +var + ASuccessfulDragging: Boolean; + ACaptureWnd: HWND; + AMsg: TMsg; +begin + if NeedHideOnNCMouseClick then + HideAll; + if not BarControlExists(Self) then Exit; + + ACloseButtonRectNC := CloseButtonRectNC; + + AActiveButtonID := GetButtonID(GetWindowCursorPos); + + if AActiveButtonID <> -1 then + begin + if not BarManager.HideFloatingBarsWhenInactive then + SetActiveWindow(BarManager.Owner.Handle); + + UpdateButtonState(True); + ASuccessfulDragging := False; + + ACaptureWnd := Handle; + SetCapture(ACaptureWnd); + try + while GetCapture = ACaptureWnd do + begin + case Integer(GetMessage(AMsg, 0, 0, 0)) of + -1: Break; + 0: begin + PostQuitMessage(AMsg.wParam); + Break; + end; + end; + with AMsg do + case message of + WM_LBUTTONUP: + begin + ASuccessfulDragging := GetButtonID(GetWindowCursorPos) = AActiveButtonID; + Break; + end; + WM_MOUSEMOVE: + if PtInRect(WindowRect, GetMouseCursorPos) then + begin + if cxPointIsEqual(FLastMousePos, cxInvalidPoint) then + DoBarMouseEnter([], cxInvalidPoint, nil); + FLastMousePos := GetMouseCursorPos; + + UpdateButtonState(True); + end; + else + TranslateMessage(AMsg); + DispatchMessage(AMsg); + end; + end; + finally + if GetCapture = ACaptureWnd then + ReleaseCapture; + UpdateButtonState(False); +// CloseButtonState := msNone; + if ASuccessfulDragging then + DoClick; + end; + Exit; + end; + inherited; +end; + +procedure TdxBarControl.WMSetCursor(var Message: TWMSetCursor); +var + P: TPoint; +begin + P := ScreenToClient(GetMouseCursorPos); + + if FIsResizing or CanResizeSelectedLink(P) then + SetCursor(Screen.Cursors[crdxBarEditSizing]) + else + begin + if not Moving and CanMoving then // --- + SetCursorForMoving(PtInRect(GetSizeAllCursorBounds, P)); + inherited; + end; +end; + +procedure TdxBarControl.WMSize(var Message: TWMSize); +begin + if IsDestroying then Exit; + inherited; + CalcLayout; +end; + +procedure TdxBarControl.WMSizing(var Message: TMessage); +var + Size: TPoint; + NCSize: Integer; +begin + inherited; + if DockingStyle = dsNone then + with Message, PRect(lParam)^ do + begin + case wParam of + WMSZ_LEFT, WMSZ_RIGHT: + begin + NCSize := Bar.BarNCSizeX(dsNone); + Size := GetSizeForWidth(DockingStyle, Right - Left - NCSize); + if wParam = WMSZ_LEFT then + Left := Right - Size.X - NCSize + else + Right := Left + Size.X + NCSize; + Bottom := Top + Size.Y + Bar.BarNCSizeY(dsNone); + end; + WMSZ_TOP, WMSZ_BOTTOM: + begin + NCSize := Bar.BarNCSizeY(dsNone); + Size := GetSizeForHeight(DockingStyle, Bottom - Top - NCSize); + Right := Left + Size.X + Bar.BarNCSizeX(dsNone); + if wParam = WMSZ_TOP then + Top := Bottom - Size.Y - NCSize + else + Bottom := Top + Size.Y + NCSize; + end; + else + PRect(lParam)^ := BoundsRect; + Result := 1; + end; + // against windows' bug: + if Top < -15 then OffsetRect(PRect(lParam)^, 0, -15 - Top); + Result := 1; + end; +end; + +procedure TdxBarControl.WMWindowPosChanging(var Message: TWMWindowPosChanging); + + procedure CalcCoords(const AWindowPos: TWindowPos; var ALeft, ATop, AWidth, AHeight: Integer); + begin + if AWindowPos.flags and SWP_NOMOVE = 0 then + begin + ALeft := AWindowPos.x; + ATop := AWindowPos.y; + end + else + begin + ALeft := Left; + ATop := Top; + end; + if AWindowPos.flags and SWP_NOSIZE = 0 then + begin + AWidth := AWindowPos.cx; + AHeight := AWindowPos.cy; + end + else + begin + AWidth := Width; + AHeight := Height; + end; + end; + +var + L, T, W, H: Integer; + I: Integer; + AIntersect: Boolean; + P: TPoint; + R, ABarRect, ARect: TRect; +begin + inherited; + if DockingStyle <> dsNone then Exit; + if (Message.WindowPos^.flags and SWP_NOMOVE = 0) or + (Message.WindowPos^.flags and SWP_NOSIZE = 0) then + begin + CalcCoords(Message.WindowPos^, L, T, W, H); + + ABarRect := Bounds(L, T, W, H); + AIntersect := False; + for I := 0 to Screen.MonitorCount - 1 do + begin + // begin BoundsRect + P := Point(Screen.Monitors[I].Left, Screen.Monitors[I].Top); + R := GetWorkArea(P); + // end BoundsRect + if IntersectRect(ARect, R, ABarRect) then + begin + AIntersect := True; + Break; + end; + end; + + if not AIntersect then + begin + R := GetWorkArea(GetMouseCursorPos); + with Message.WindowPos^ do + begin + with R do + begin + if L + W <= Left then + begin + x := Left; + y := T; + flags := flags and not SWP_NOMOVE; + end; + if T + H <= Top then + begin + x := L; + y := Top; + flags := flags and not SWP_NOMOVE; + end; + if L >= Right then + begin + x := Right - W; + y := T; + flags := flags and not SWP_NOMOVE; + end; + if T >= Bottom then + begin + x := L; + y := Bottom - H; + flags := flags and not SWP_NOMOVE; + end; + end; + end; + end; + end; +end; + +procedure TdxBarControl.CMFontChanged(var Message: TMessage); +begin + UpdateCanvasFont; + if not HandleAllocated then + Exit; + CalcDrawingConsts; + if not InternallyLocked then + begin + SetMouseSelectedItem(nil); + RepaintBar; + end; + inherited; +end; + +procedure TdxBarControl.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + begin + Style := WS_CLIPCHILDREN or WS_CLIPSIBLINGS; + WindowClass.Style := CS_DBLCLKS or CS_HREDRAW or CS_VREDRAW; + ExStyle := 0; + if DockingStyle = dsNone then + begin + Style := (Style or WS_POPUP) and not WS_BORDER; + WndParent := BarManager.Owner.Handle; + end + else + begin + Style := Style or WS_CHILD; + WndParent := FDockControl.Handle; + end; + end; +end; + +procedure TdxBarControl.CreateWnd; +begin + if FMoving and InternallyLocked then + if FDockingStyle = dsNone then + WindowHandle := FFloatingHandle + else + WindowHandle := FDockedHandle + else + inherited; + Text := GetCaption; + SendMessage(Handle, WM_NCACTIVATE, Longint(True), 0); // don't remove (AV in ntdll.dll) +end; + +procedure TdxBarControl.Paint; +var + APrevRegion: TcxRegion; +begin + APrevRegion := Canvas.GetClipRegion; + try + inherited; + DoPaint; + if BarManager.IsUncustomizable then + begin + Canvas.SetClipRegion(APrevRegion, roSet, False); + DrawDisablingHatch(Canvas.Handle, ClientRect); + end; + finally + APrevRegion.Free; + end; +end; + +procedure TdxBarControl.Resize; +begin + inherited; + UpdateCaptionButtons(nil); +end; + +procedure TdxBarControl.WindowPosChanged(var Message: TWMWindowPosChanged); +begin + inherited; + if (FBar = nil) or InternallyLocked then + Exit; + FBar.ChangeDockingStyle(DockingStyle, DockControl); + SavePos; + with Message.WindowPos^ do + begin + if ((flags and SWP_NOSIZE = 0) or (flags and SWP_NOMOVE = 0)) and + (FQuickPopup <> nil) then + begin + FQuickPopup.OwnerBounds := MarkScreenRect; + FQuickPopup.ResizeShadow; + SendMessage(FQuickPopup.Handle, WM_NCPAINT, 0, 0); + end; + if (flags and SWP_NOSIZE <> 0) and (flags and SWP_NOMOVE = 0) and + (FHasSizeGrip <> FBar.HasSizeGrip) then + RebuildBar; + end; + if IsPopup and (Message.WindowPos^.flags and SWP_HIDEWINDOW <> 0) and not IsDestroying then + CloseUp; +end; + +procedure TdxBarControl.BeginInternal; +begin + Inc(FInternalLockCount); +end; + +procedure TdxBarControl.EndInternal; +begin + if FInternalLockCount > 0 then + Dec(FInternalLockCount); +end; + +procedure TdxBarControl.LayoutChanged; +begin + if BarManager.CanShowRecentItems and (DockingStyle <> dsNone) then + PostMessage(Handle, WM_REPAINTBAR, 0, 0); +end; + +procedure TdxBarControl.CalcControlsPositions; +begin + inherited CalcControlsPositions; + CalcItemRects(GetPaintType); +end; + +procedure TdxBarControl.CalcRowItemRects; +var + FirstInRow, X, Y, ARowHeight, ABeginGroupSize, ASize, VerSize, AWidth, AHeight: Integer; + AMultiLine, AVertical, ItemControlAlignApplied: Boolean; + AItemLink: TdxBarItemLink; + + function GetMDIButtonSize(AIsVertical: Boolean): Integer; + begin + if not MDIButtonsOnBar then + Result := 0 + else + if AIsVertical then + Result := GetMDIHeight + else + Result := GetMDIWidth; + end; + + procedure InitValues; + begin + X := 0; + Y := 0; + VerSize := 0; + AItemLink := nil; + AMultiLine := MultiLine; + AVertical := Vertical; + + if AVertical then + ASize := ClientHeight + else + ASize := ClientWidth; + if DockingStyle <> dsNone then + Dec(ASize, GetMarkSize); + + if AMultiLine then + begin + if AVertical then + VerSize := ClientWidth; + ARowHeight := 0; + FirstInRow := 0; + end + else + begin + if AVertical then + ARowHeight := ClientWidth + else + ARowHeight := ClientHeight; + Dec(ASize, GetMDIButtonSize(AVertical)); + end; + end; + + procedure InitItemControlValues; + begin + with AItemLink.Control do + begin + FLastInRow := False; + if AVertical then + begin + AWidth := Height; + AHeight := Width; + end + else + begin + AWidth := Width; + AHeight := Height; + end; + end; + if AItemLink.BeginGroup and (X > 0) then + ABeginGroupSize := BeginGroupSize + else + ABeginGroupSize := 0; + end; + + function ItemControlBreaksRow: Boolean; + begin + Result := + ((X > 0) or not AMultiLine and CanHideAllItemsInSingleLine) and (X + ABeginGroupSize + AWidth > ASize) or + AMultiLine and AItemLink.Control.FBreakingRow; + end; + + procedure ArrangeControlsOnRow(const LastInRow: Integer); + var + I: Integer; + begin + for I := FirstInRow to LastInRow do + with ItemLinks.VisibleItems[I], ItemRect do + begin + if AVertical then + ItemRect := cxRectOffset(ItemRect, -(ARowHeight - (Right - Left)) div 2, 0) + else + ItemRect := cxRectOffset(ItemRect, 0, (ARowHeight - (Bottom - Top)) div 2); + RowHeight := ARowHeight; + end; + FirstInRow := LastInRow + 1; + end; + + function GetItemControlRect: TRect; + + procedure ApplyAlign; + + procedure CheckSize; + var + AMDISize: Integer; + begin + if AMultiLine and (AItemLink.Control.Align <> iaLeft) and MDIButtonsOnBar then + begin + if AVertical then + AMDISize := GetMDIHeight + else + AMDISize := GetMDIWidth; + if Result.Right + AMDISize <= ASize then + Dec(ASize, AMDISize); + end; + end; + + begin + CheckSize; + ItemControlAlignApplied := True; + case AItemLink.Control.Align of + iaLeft: + ItemControlAlignApplied := False; + iaCenter: + if AVertical then + OffsetRect(Result, 0, (ASize - Result.Bottom) div 2) + else + OffsetRect(Result, (ASize - Result.Right) div 2, 0); + iaRight: + if AVertical then + OffsetRect(Result, 0, ASize - Result.Bottom) + else + OffsetRect(Result, ASize - Result.Right, 0); + iaClient: + with Result do + if AVertical then + begin + Bottom := ASize; + if Bottom - Top < AItemLink.Control.MinWidth then + Bottom := Top + AItemLink.Control.MinWidth; + end + else + begin + Right := ASize; + if Right - Left < AItemLink.Control.MinWidth then + Right := Left + AItemLink.Control.MinWidth; + end; + end; + end; + + begin + if AMultiLine then + if AVertical then + Result := Bounds(VerSize - Y - AHeight, X + ABeginGroupSize, AHeight, AWidth) + else + Result := Bounds(X + ABeginGroupSize, Y, AWidth, AHeight) + else + case DockingStyle of + dsTop, dsBottom: + Result := + Bounds(X + ABeginGroupSize, (ARowHeight - AHeight) div 2, AWidth, AHeight); + dsLeft, dsRight: + Result := + Bounds((ARowHeight - AHeight) div 2, X + ABeginGroupSize, AHeight, AWidth); + end; + ApplyAlign; + end; + + procedure CalcX(ALinkIndex: Integer); + begin + if ItemControlAlignApplied then + begin + X := ASize; + if ALinkIndex < ItemLinks.VisibleItemCount - 1 then + FTruncated := True; + end + else + Inc(X, ABeginGroupSize + AWidth); + end; + +var + I: Integer; +begin + InitValues; + for I := 0 to ItemLinks.VisibleItemCount - 1 do + begin + AItemLink := ItemLinks.VisibleItems[I]; + if AItemLink.Control = nil then AItemLink.CreateControl; + InitItemControlValues; + if ItemControlBreaksRow then + if AMultiLine then + begin + ItemLinks.VisibleItems[I - 1].Control.FLastInRow := True; + ArrangeControlsOnRow(I - 1); + Inc(Y, ARowHeight + ABeginGroupSize); + X := 0; + ABeginGroupSize := 0; + ARowHeight := 0; + end + else + begin + if I = 0 then + AItemLink := nil + else + AItemLink := ItemLinks.VisibleItems[I - 1]; + Break; + end; + AItemLink.ItemRect := GetItemControlRect; + AItemLink.RowHeight := ARowHeight; + CalcX(I); + if ARowHeight < AHeight then ARowHeight := AHeight; + end; + if AItemLink <> nil then + AItemLink.Control.FLastInRow := True; + if AMultiLine then + ArrangeControlsOnRow(ItemLinks.VisibleItemCount - 1); +end; + +procedure TdxBarControl.CalcDrawingConsts; +begin + inherited CalcDrawingConsts; + FMDIButtonWidth := GetSystemMetrics(SM_CXMENUSIZE) - 2; + FMDIButtonHeight := GetSystemMetrics(SM_CYMENUSIZE) - 2 * 2; + FMarkSize := Painter.MarkSizeX(Self); +end; + +procedure TdxBarControl.CalcDragOverParameters(const ACursorPos: TPoint; + var ADragOverItemLink: TdxBarItemLink; + var AIsBeginGroup, AIsFirstPart, AIsVerticalDirection: Boolean); + + function GetRowLastItemControl(const ACursorPos: TPoint): TdxBarItemControl; + var + AControl: TdxBarItemControl; + AItemRect: TRect; + AVertical: Boolean; + I: Integer; + begin + Result := nil; + for I := 0 to ItemLinks.VisibleItemCount - 1 do + begin + AControl := ItemLinks.VisibleItems[I].Control; + if AControl.CanCustomize and AControl.LastInRow then + begin + AItemRect := GetItemRect(AControl); + AVertical := Vertical; + if AVertical and (AItemRect.Left <= ACursorPos.X) and (ACursorPos.X < AItemRect.Right) or + not AVertical and (AItemRect.Top <= ACursorPos.Y) and (ACursorPos.Y < AItemRect.Bottom) then + begin + Result := AControl; + Break; + end; + end; + end; + end; + + function GetRowFirstItemControl(ARowLastItemControl: TdxBarItemControl): TdxBarItemControl; + var + AControl: TdxBarItemControl; + I: Integer; + begin + Result := ARowLastItemControl; + for I := ARowLastItemControl.ItemLink.VisibleIndex - 1 downto 0 do + begin + AControl := ItemLinks.VisibleItems[I].Control; + if AControl.LastInRow then + Break + else + Result := AControl; + end; + end; + +var + AControl: TdxBarItemControl; + AItemRect: TRect; + AVertical: Boolean; +begin + inherited CalcDragOverParameters(ACursorPos, ADragOverItemLink, + AIsBeginGroup, AIsFirstPart, AIsVerticalDirection); + if (ADragOverItemLink <> nil) or not PtInRect(ClientRect, ACursorPos) then + Exit; + AControl := GetRowLastItemControl(ACursorPos); + if AControl <> nil then + begin + AItemRect := GetItemRect(AControl); + AVertical := Vertical; + if AVertical and (ACursorPos.Y < AItemRect.Top) or + not AVertical and (ACursorPos.X < AItemRect.Left) then + begin + AIsFirstPart := True; + if AControl.Align in [iaCenter, iaRight] then + ADragOverItemLink := AControl.ItemLink + else + ADragOverItemLink := GetRowFirstItemControl(AControl).ItemLink; + end + else + ADragOverItemLink := AControl.ItemLink; + end; +end; + +function TdxBarControl.CanAlignControl(AControl: TdxBarItemControl): Boolean; +begin + with AControl.ItemLink do + Result := Bar.UseRestSpace and (CanVisibleIndex = Owner.CanVisibleItemCount - 1); +end; + +function TdxBarControl.CanCallInheritedNCCalcSize: Boolean; // obsolete +begin + Result := (DockingStyle <> dsNone) or not Flat; +end; + +function TdxBarControl.CanCustomizing: Boolean; +begin + Result := inherited CanCustomizing or FBar.AllowCustomizing; +end; + +function TdxBarControl.CanHideAllItemsInSingleLine: Boolean; +begin + Result := False; +end; + +function TdxBarControl.CanMoving: Boolean; +begin + Result := Bar.CanMoving; +end; + +function TdxBarControl.CanProcessShortCut: Boolean; +begin + Result := HandleAllocated and IsWindowVisible(Handle); +end; + +procedure TdxBarControl.CaptionButtonClick(AIndex: Integer); +var + AButton: TdxBarCaptionButton; +begin + if IsPopup then + AButton := PopupBar.CaptionButtons[AIndex] + else + AButton := CaptionButtons[AIndex]; + if not NeedHideOnNCMouseClick then + CloseUp; + AButton.Click; +end; + +function TdxBarControl.GetCaptionRect: TRect; +begin + Result := cxRectOffset(GetCaptionNCRect, WindowRect.TopLeft); + MapWindowRect(0, Handle, Result); +end; + +procedure TdxBarControl.CheckMarkState(const P: TPoint); +begin + if IsMarkAccessible and MouseOnMark(P) then + if MarkState = msPressed then + MarkState := msSelected + else + MarkState := msPressed; +end; + +function TdxBarControl.CloseButtonRect: TRect; +var + ASize: TSize; + RW, RH: Integer; +begin + if HasCloseButton then + begin + Result := GetCaptionRect; + with Result do + Left := Right - Painter.BarCaptionSize; + ASize := Painter.BarCloseButtonSize; + RW := Result.Right - Result.Left; + if ASize.cx < RW then + begin + Result.Left := Result.Left + (RW div 2) - (ASize.cx div 2); + Result.Right := Result.Left + ASize.cx; + end; + RH := Result.Bottom - Result.Top; + if ASize.cy < RH then + begin + Result.Top := Result.Top + (RH div 2) - (ASize.cy div 2); + Result.Bottom := Result.Top + ASize.cy; + end; + end + else + Result := cxEmptyRect; +end; + +function TdxBarControl.CloseButtonRectNC: TRect; +begin + Result := CloseButtonRect; + MapWindowRect(Handle, 0, Result); + OffsetRect(Result, -WindowRect.Left, -WindowRect.Top); +end; + +function TdxBarControl.CheckLockUpdate: Boolean; +begin + Result := inherited CheckLockUpdate; + if Result and (Bar <> nil) then + Bar.DoChanged; +end; + +procedure TdxBarControl.CustomizePrepare(APoint: TPoint; ASecondClick: Boolean); +begin + if ASecondClick and CanResizeSelectedLink(APoint) then + begin + FIsResizing := True; + SelectedControlAtDesign.BeginResize(APoint); + SetCapture(Handle); + end + else + inherited; +end; + +procedure TdxBarControl.DoBarGetFocus(ASelectedItem: TdxBarItemControl); +var + AControl: TWinControl; + ItemLink: TdxBarItemLink; +begin + AControl := FindControl(WindowFromPointEx(GetMouseCursorPos)); + if (AControl is TCustomdxBarControl) and (AControl <> Self) then + TCustomdxBarControl(AControl).MouseLeave; + + dxBar.SendCancelMode; + + FBeforeBarGetFocusFocusedWnd := GetFocus; + + if not IsCustomizing and + not (IsPopup and ParentBar.Focused) and (GetParentPopupWindow(Self, True) = nil) then + dxSetZOrder(MasterForm.Handle, HWND_TOP, True); + + if ASelectedItem = nil then + begin + ItemLink := nil; + repeat + ItemLink := ItemLinks.Next(ItemLink); + until (ItemLink = nil) or (ItemLink.Control <> nil) and + not (ItemLink.Control is TSystemMenuSubItemControl); // !!! + if ItemLink <> nil then + ASelectedItem := ItemLink.Control; + end; + + inherited DoBarGetFocus(ASelectedItem); + + if not IsFocused then + begin + dxFreeAndNilObjectLink(FPrevFocusedBarControlLink); + if BarManager.FFocusedBarControl <> nil then + FPrevFocusedBarControlLink := cxAddObjectLink(BarManager.FFocusedBarControl); + BarManager.FFocusedBarControl := Self; + end; +end; + +procedure TdxBarControl.DoBarLostFocus; +begin + if (FPrevFocusedBarControlLink <> nil) and (FPrevFocusedBarControlLink.Ref <> nil) then + begin + BarManager.FFocusedBarControl := TCustomdxBarControl(FPrevFocusedBarControlLink.Ref); + dxFreeAndNilObjectLink(FPrevFocusedBarControlLink); + end + else + BarManager.FFocusedBarControl := nil; + + inherited DoBarLostFocus; + UpdateControlByMouse; + + if Application.Active and IsFormActive(ParentForm) and // -> bug with toolbars' hiding (without Application.Active) + IsWindowVisible(FBeforeBarGetFocusFocusedWnd) then + Windows.SetFocus(FBeforeBarGetFocusFocusedWnd); +end; + +procedure TdxBarControl.DoBarMouseDown(Button: TMouseButton; Shift: TShiftState; + const APoint: TPoint; AItemControl: TdxBarItemControl; APointInClientRect: Boolean); + + function CheckMDIButton(AButton: TdxBarMDIButton): Boolean; + begin + Result := PtInRect(RectMDI(AButton), APoint); + if Result then + begin + FIsMDIButtonPressed := True; + FIsMouseOverMDIButton := True; + FPressedMDIButton := AButton; + FSelectedMDIButton := FPressedMDIButton; + DrawMDIButtons([AButton]); + SetCapture(Handle); + end + end; + +var + AButton: TdxBarMDIButton; + R: TRect; +begin + case Button of + mbLeft: + begin + // !!! + if not BarManager.HideFloatingBarsWhenInactive and (not IsInternal and (DockingStyle = dsNone)) then + SetActiveWindow(BarManager.Owner.Handle); + end; + mbRight: + ReleaseCapture; + end; + + inherited; + + if not BarControlExists(Self) then Exit; + + case Button of + mbLeft: + begin + if MDIButtonsOnBar and not BarManager.IsCustomizing then + if RealMDIButtonsOnBar then + for AButton := Low(TdxBarMDIButton) to High(TdxBarMDIButton) do + if MDIButtonEnabled(AButton, MF_DISABLED or MF_GRAYED) and + CheckMDIButton(AButton) then Exit + else + else + if CheckMDIButton(mdibClose) then Exit; + + if FHitTest = HTCAPTION then + begin + R := WindowRect; + RX.X := GetMouseCursorPos.X - R.Left; + RY.X := GetMouseCursorPos.Y - R.Top; + RX.Y := R.Right - R.Left; + RY.Y := R.Bottom - R.Top; + FBar.Bars.Moving(Self); + end + else + begin + CheckMarkState(APoint); + if not IsCustomizing and not APointInClientRect then + begin + SendMessage(Handle, WM_NCLBUTTONDOWN, FHitTest, LPARAM(PointToSmallPoint(GetMouseCursorPos))); + end; + end; + end; + end; +end; + +procedure TdxBarControl.DoBarMouseLeave; +begin + inherited; + CaptionButtons.UpdateButtonStates(cxInvalidPoint); + if not IsActive then + begin +//#DG inherited; + CloseButtonState := msNone; + // MDI + if MDIButtonsOnBar then + begin + FIsMouseOverMDIButton := False; + RepaintMDIButtons; + end; + end + else + if SelectedControl is TdxBarButtonControl then + SelectedControl.Repaint; +end; + +procedure TdxBarControl.DoBarMouseMove(Shift: TShiftState; const APoint: TPoint; + AItemControl: TdxBarItemControl); +var + PrevIsMouseOverMDIButton: Boolean; + PrevSelectedMDIButton: TdxBarMDIButton; + AButton: TdxBarMDIButton; + AButtons: TdxBarMDIButtons; + AChangeMark: Boolean; +begin + if FIsMDIButtonPressed then + begin + PrevIsMouseOverMDIButton := FIsMouseOverMDIButton; + FIsMouseOverMDIButton := PtInRect(RectMDI(FPressedMDIButton), APoint); + if FIsMouseOverMDIButton <> PrevIsMouseOverMDIButton then + DrawMDIButtons([FPressedMDIButton]); + end + else + begin + // check MDI + if MDIButtonsOnBar then + begin + PrevIsMouseOverMDIButton := FIsMouseOverMDIButton; + PrevSelectedMDIButton := FSelectedMDIButton; + FIsMouseOverMDIButton := False; + if not RealMDIButtonsOnBar then + begin + if MDIButtonEnabled(mdibClose, MF_GRAYED) and + PtInRect(RectMDI(mdibClose), APoint) then + begin + FIsMouseOverMDIButton := True; + FSelectedMDIButton := mdibClose; + end + end + else + begin + for AButton := Low(TdxBarMDIButton) to High(TdxBarMDIButton) do + if MDIButtonEnabled(AButton, MF_GRAYED) and + PtInRect(RectMDI(AButton), APoint) then + begin + FIsMouseOverMDIButton := True; + FSelectedMDIButton := AButton; + Break; + end; + end; + if (FIsMouseOverMDIButton <> PrevIsMouseOverMDIButton) or + (FSelectedMDIButton <> PrevSelectedMDIButton) then + begin + AButtons := [PrevSelectedMDIButton]; + if FSelectedMDIButton <> PrevSelectedMDIButton then + AButtons := AButtons + [FSelectedMDIButton]; + DrawMDIButtons(AButtons); + end; + end; + +// if IsCustomizing and FIsResizing and (GetCapture = Handle) then + if FIsResizing then + SelectedControlAtDesign.Resizing(APoint); //#DG +//#DG SelectedItem.Resizing(P); + + AChangeMark := False; + if not NotHandleMouseMove then + begin + CaptionButtons.UpdateButtonStates(cxPointOffset(APoint, NCOffset)); + if ActiveBarControl = nil then + begin + if Painter.BarAllowQuickCustomizing and MarkExists and (MarkState <> msPressed) then + if MouseOnMark(APoint) then + MarkState := msSelected + else + AChangeMark := True; + if HasCloseButton and Painter.BarAllowHotTrack then + if PtInRect(CloseButtonRect, APoint) then + CloseButtonState := msSelected + else + CloseButtonState := msNone; + end; + end; + inherited; + if AChangeMark then MarkState := msNone; + end; +end; + +procedure TdxBarControl.DoHideAll; +var + ALinkSelf: TcxObjectLink; + AWasPopup: Boolean; +begin + ALinkSelf := cxAddObjectLink(Self); + try + AWasPopup := IsPopup; + BarLostFocus; + inherited; + if (ALinkSelf.Ref <> nil) and AWasPopup then + begin + if LeftButtonPressed and PtInRect(IgnoreClickAreaWhenHidePopup, GetMouseCursorPos) then + ParentBar.FIgnoreMouseClick := True; + CloseUp; + end; + finally + cxRemoveObjectLink(ALinkSelf); + end; +end; + +procedure TdxBarControl.DoRepaintBar(ARecreateControls: Boolean); +var + P: TPoint; +begin + inherited DoRepaintBar(ARecreateControls); + if DockingStyle = dsNone then + begin + if HandleAllocated then + begin + P := GetSizeForWidth(DockingStyle, ClientWidth); + ClientWidth := P.X; + ClientHeight := P.Y; + end; + CalcLayout; + end + else + FDockControl.UpdateDock; + //Repaint; + Invalidate; + if BarManager.IsUncustomizable then + SendMessage(Handle, WM_NCPAINT, 1, 0) + else + if IsTransparent then + SendMessage(Handle, WM_NCPAINT, 0, 0); +end; + +procedure TdxBarControl.DoSetIsActive(AValue: Boolean); +begin + if not AValue then + begin + if IsCustomizing and (SelectedControl <> nil) then + SetMouseSelectedItem(nil); + if IsActive and (SelectedControl is TdxBarButtonControl) and + TdxBarButtonControl(SelectedControl).DroppedDown then + SelectedControl.ControlInactivate(True); + if IsDowned then + begin + IsDowned := False; + if not IsCustomizing then {HideAll;//}BarLostFocus; + end; + end; + inherited; + + BarLostFocus; // !!! +end; + +procedure TdxBarControl.FocusItemControl(AItemControl: TdxBarItemControl); +var + AProcessedByItemControl: Boolean; + ALinkSelf: TcxObjectLink; +begin + if (AItemControl <> nil) and AItemControl.Enabled and AItemControl.HotPartWantMouse then + begin + AProcessedByItemControl := False; + ALinkSelf := cxAddObjectLink(Self); + try + if IsActive and not ((bboNeedsFocusWhenActive in BehaviorOptions) and not IsFocused) then + AItemControl.ControlGetFocus(AItemControl = SelectedControl, AProcessedByItemControl) + else + BarGetFocus(AItemControl); + + if (ALinkSelf.Ref = nil) or AProcessedByItemControl then + Exit; + finally + cxRemoveObjectLink(ALinkSelf); + end; + + if IsActive and not AItemControl.HasWindow then + IsDowned := True; + + if (SelectedControl <> nil) and SelectedControl.NeedCaptureMouse then + begin + FClickedControl := AItemControl; + SetCapture(Handle); + AItemControl.Repaint; + end; + end + else + IsActive := False; + + inherited; +end; + +function TdxBarControl.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxBarControlAccessibilityHelper; +end; + +function TdxBarControl.GetAlphaBlendValue: Byte; +begin + if {not FMovingChanging and }(DockingStyle = dsNone) then + Result := 200 + else + Result := 255; +end; + +function TdxBarControl.GetBackgroundBitmap: TBitmap; +begin + Result := Bar.BackgroundBitmap; +end; + +function TdxBarControl.GetBeginGroupSize: Integer; +begin + Result := Painter.BarBeginGroupSize; +end; + +function TdxBarControl.GetCol: Integer; +var + I, J: Integer; +begin + Result := 0; + if (FBar = nil) or (FBar.Bars = nil) or (DockingStyle = dsNone) or + (FDockControl = nil) then Exit; + with FDockControl do + for I := 0 to FRowList.Count - 1 do + for J := 0 to Rows[I].ColCount - 1 do + if Rows[I].Cols[J].BarControl = Self then + begin + Result := J; + Exit; + end; +end; + +procedure TdxBarControl.WndProc(var Message: TMessage); +var + AStyle: TdxBarDockingStyle; + ADockControl: TdxDockControl; +begin + FCurrentMessage := Message; //#DG + + if Message.Msg = WM_SETFOCUS then + Exit; + if (FIsMDIButtonPressed or FIsMouseOverMDIButton) and (Message.Msg = WM_CANCELMODE) then + begin + ReleaseCapture; + FIsMDIButtonPressed := False; + FIsMouseOverMDIButton := False; + RepaintMDIButtons; + end; + if (Message.Msg = WM_LBUTTONDBLCLK) and (FHitTest = HTCAPTION) then + begin + if not BarManager.Designing then + with Bar do + begin + ADockControl := nil; + if DockingStyle = dsNone then + if DockedDockingStyle <> dsNone then + begin + AStyle := DockedDockingStyle; + ADockControl := DockedDockControl; + if ADockControl = nil then + ADockControl := Bars.FDockControls[AStyle]; + end + else + begin + AStyle := dsTop; + ADockControl := Bars.FDockControls[dsTop]; + end + else + AStyle := dsNone; + if BarManager.DoDocking(Bar, AStyle, ADockControl) then + begin + Visible := False; + if DockingStyle = dsNone then + begin + ChangeDockingStyle(AStyle, ADockControl); + if DockedDockingStyle = dsNone then + begin + OneOnRow := True; + Row := ADockControl.RowCount; + end; + end + else + DockingStyle := dsNone; + Visible := True; + end; + end; + Exit; + end; + inherited; +end; + +function TdxBarControl.GetDockCol: TdxDockCol; +var + I, J: Integer; +begin + Result := nil; + if (FBar = nil) or (FBar.Bars = nil) or (DockingStyle = dsNone) or + (FDockControl = nil) then Exit; + with FDockControl do + for I := 0 to RowCount - 1 do + for J := 0 to Rows[I].ColCount - 1 do + if Rows[I].Cols[J].BarControl = Self then + begin + Result := Rows[I].Cols[J]; + Exit; + end; +end; + +function TdxBarControl.GetIsMainMenu: Boolean; +begin + Result := (Bar <> nil) and Bar.IsMainMenu; +end; + +function TdxBarControl.GetIsStatusBar: Boolean; +begin + Result := (Bar <> nil) and Bar.IsStatusBar; +end; + +function TdxBarControl.GetMarkAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxBarControlMarkAccessibilityHelper; +end; + +function TdxBarControl.GetMarkDrawState: TdxBarMarkState; +begin + if MarkIAccessibilityHelper.IsSelected then + Result := msSelected + else + Result := inherited GetMarkDrawState; +end; + +function TdxBarControl.GetMoreButtonsHint: string; +begin + Result := cxGetResourceString(@dxSBAR_MOREBUTTONS); +end; + +function TdxBarControl.GetMultiLine: Boolean; +begin + Result := (DockingStyle = dsNone) or FBar.MultiLine; +end; + +function TdxBarControl.GetQuickControlClass: TdxBarControlClass; +begin + Result := TdxBarQuickControl; +end; + +function TdxBarControl.GetRow: Integer; +var + I, J: Integer; +begin + Result := 0; + if (FBar = nil) or (FBar.Bars = nil) or (DockingStyle = dsNone) or + (FDockControl = nil) then Exit; + with FDockControl do + for I := 0 to RowCount - 1 do + for J := 0 to Rows[I].ColCount - 1 do + if Rows[I].Cols[J].BarControl = Self then + begin + Result := I; + Exit; + end; +end; + +function TdxBarControl.GetViewInfoClass: TCustomdxBarControlViewInfoClass; +begin + Result := TdxBarControlViewInfo; +end; + +function TdxBarControl.GetNCDrawingDC(AUpdatedRgn: HRGN): HDC; +var + CR: TRect; +begin + FDrawBitmap := nil; + FPrevClipRgn := nil; + if BarManager.IsUncustomizable then + begin + if AUpdatedRgn = 1 then + FPrevClipRgn := TcxRegion.Create(0, 0, Width, Height) + else + begin + FPrevClipRgn := TcxRegion.Create; + CombineRgn(FPrevClipRgn.Handle, FPrevClipRgn.Handle, AUpdatedRgn, RGN_OR); + FPrevClipRgn.Offset(-WindowRect.Left, -WindowRect.Top); + FPrevClipRgn.Combine(TcxRegion.Create(0, 0, Width, Height), roIntersect); + end; + + CR := cxRectOffset(ClientRect, GetClientOffset); + FPrevClipRgn.Combine(TcxRegion.Create(CR), roSubtract); + + FDrawBitmap := cxCreateBitmap(Width, Height, pf32bit); + Result := FDrawBitmap.Canvas.Handle; + + SelectClipRgn(Result, FPrevClipRgn.Handle); + end + else + Result := inherited GetNCDrawingDC(AUpdatedRgn); +end; + +procedure TdxBarControl.ReleaseNCDrawingDC(ADC: HDC); +begin + FreeAndNil(FDrawBitmap); + FreeAndNil(FPrevClipRgn); + if not BarManager.IsUncustomizable then + inherited; +end; + +function TdxBarControl.GetMasterForm: TCustomForm; +begin + if DockControl <> nil then + Result := DockControl.MasterForm + else + Result := BarManager.MasterForm; +end; + +function TdxBarControl.GetParentForm: TCustomForm; +begin + if DockControl <> nil then + Result := DockControl.ParentForm + else + Result := BarManager.ParentForm; +end; + +function TdxBarControl.GetSelectableObject: TPersistent; +begin + Result := Bar; +end; + +function TdxBarControl.AllowQuickCustomizing: Boolean; +begin + Result := Bar.AllowQuickCustomizing; +end; + +procedure TdxBarControl.HandleQuickAccessSubItemPopup(Sender: TObject); +begin + BarDesignController.ClearOwnedItems(TdxBarSubItem(Sender).ItemLinks); + InitAddRemoveSubItemPopup(TdxBarSubItem(Sender).ItemLinks); +end; + +procedure TdxBarControl.InitQuickControl(AQuickControlItemLinks: TdxBarItemLinks); +var + I: Integer; + AItemLink: TdxBarItemLink; +begin + for I := 0 to ItemLinks.CanVisibleItemCount - 1 do + begin + AItemLink := ItemLinks.CanVisibleItems[I]; + if (AItemLink.VisibleIndex = -1) or + (AItemLink.Control <> nil) and IsRectEmpty(AItemLink.ItemRect) then + begin + with AQuickControlItemLinks.Add do + begin + Assign(AItemLink); + FOriginalItemLink := AItemLink; + end; + end; + end; + + if AllowQuickCustomizing then + InitQuickCustomizeItemLinks(AQuickControlItemLinks); +end; + +procedure TdxBarControl.InitQuickCustomizeItemLinks(AQuickControlItemLinks: TdxBarItemLinks); +var + AItemLink: TdxBarItemLink; + AAddRemoveSubItem: TdxBarSubItem; +begin + AItemLink := BarDesignController.AddInternalItem(AQuickControlItemLinks, TdxBarQuickAccessItem, + cxGetResourceString(@dxSBAR_ADDREMOVEBUTTONS)); + AItemLink.BeginGroup := True; + AAddRemoveSubItem := TdxBarSubItem(AItemLink.Item); +// AAddRemoveSubItem.Enabled := AllowQuickCustomizing; + AAddRemoveSubItem.OnPopup := HandleQuickAccessSubItemPopup; +end; + +procedure TdxBarControl.InitAddRemoveSubItemPopup(AItemLinks: TdxBarItemLinks); +var + I: Integer; + AItemLink: TdxBarItemLink; + AllowReset: Boolean; + AQuickCustItem: TdxBarQuickCustItem; +begin + AQuickCustItem := TdxBarQuickCustItem.Create(BarManager.Owner);//#DG + BarDesignController.AddInternalItem(AQuickCustItem); + + for I := 0 to ItemLinks.AvailableItemCount - 1 do + begin + AItemLink := ItemLinks.AvailableItems[I]; + if (AItemLink.Control = nil) or AItemLink.Control.CanCustomize then + with AItemLinks.Add do + begin + Item := AQuickCustItem; + Data := Integer(AItemLink); + end; + end; + // add reset button + AllowReset := BarManager.CanReset and Bar.CanReset; + if AllowReset then + BarDesignController.AddInternalItem(AItemLinks, TdxBarQuickCustExtButton, + cxGetResourceString(@dxSBAR_RESETTOOLBAR), ResetToolbarClick).BeginGroup := True; + // add customize button + BarDesignController.AddCustomizeItem(AItemLinks, TdxBarQuickCustExtButton, not AllowReset); +end; + +procedure TdxBarControl.ResetToolbarClick(Sender: TObject); +begin + Bar.ResetWithConfirmation; +end; + +function TdxBarControl.GetMinWidth(AStyle: TdxBarDockingStyle): Integer; +var + I, AWidth: Integer; +begin + if (AStyle in [dsLeft, dsRight]) or MultiLine then + begin + Result := 0; + if ItemLinks.CanVisibleItemCount <> 0 then + for I := 0 to ItemLinks.CanVisibleItemCount - 1 do + begin + AWidth := ItemLinks.CanVisibleItems[I].Control.Width; + Result := Max(Result, AWidth); + end + else + if AStyle <> dsNone then + Result := Painter.GetButtonWidth(BarManager.GlyphSize, TextSize); + if MDIButtonsOnBar and (Result < GetMDIWidth) then + Result := GetMDIWidth; + if AStyle = dsNone then + begin + AWidth := GetMarkSize; + if HasCloseButton then + Inc(AWidth, Painter.BarCloseButtonSize.cx); + AWidth := Max(AWidth, dxBarFloatToolbarMinWidth); + Result := Max(Result, AWidth); + end; + end + else + begin + if ItemLinks.CanVisibleItemCount = 0 then + Result := Painter.GetButtonWidth(BarManager.GlyphSize, TextSize) + else + begin + ItemLinks.RecentItemCount := 1; + Result := ItemLinks.VisibleItems[0].Control.Width; + ItemLinks.RestoreRecentItemCount; + end; + if MDIButtonsOnBar then + Inc(Result, GetMDIWidth); + end; + if Horizontal then + Inc(Result, GetMarkSize); +end; + +function TdxBarControl.GetMinHeight(AStyle: TdxBarDockingStyle): Integer; +var + I, AHeight: Integer; +begin + if (AStyle in [dsTop, dsBottom]) or MultiLine then + begin + if ItemLinks.CanVisibleItemCount = 0 then + Result := Painter.GetButtonHeight(BarManager.GlyphSize, TextSize) + else + begin + Result := 0; + for I := 0 to ItemLinks.CanVisibleItemCount - 1 do + begin + AHeight := ItemLinks.CanVisibleItems[I].Control.Height; + Result := Max(Result, AHeight); + end; + end; + if MDIButtonsOnBar and (Result < GetMDIHeight) then + Result := GetMDIHeight; + end + else + begin + if ItemLinks.CanVisibleItemCount = 0 then + Result := Painter.GetButtonHeight(BarManager.GlyphSize, TextSize) + else + begin + ItemLinks.RecentItemCount := 1; + Result := ItemLinks.VisibleItems[0].Control.Height; + ItemLinks.RestoreRecentItemCount; + end; + if MDIButtonsOnBar then + Inc(Result, GetMDIHeight); + end; + if Vertical then + Inc(Result, GetMarkSize); +end; + +function TdxBarControl.GetMaxWidth(AStyle: TdxBarDockingStyle): Integer; +var + AWidth, I: Integer; + AItemLink: TdxBarItemLink; +begin + Result := GetMinWidth(AStyle); + AWidth := 0; + if (AStyle in [dsTop, dsBottom]) or MultiLine then + begin + ItemLinks.RecentItemCount := -1; + for I := 0 to ItemLinks.VisibleItemCount - 1 do + begin + AItemLink := ItemLinks.VisibleItems[I]; + if AItemLink.BeginGroup then Inc(AWidth, BeginGroupSize); + Inc(AWidth, AItemLink.Control.Width); + end; + ItemLinks.RestoreRecentItemCount; + if MDIButtonsOnBar then + Inc(AWidth, GetMDIWidth); + if Horizontal then + Inc(AWidth, GetMarkSize); + end + else + begin + for I := 0 to ItemLinks.CanVisibleItemCount - 1 do + begin + AItemLink := ItemLinks.CanVisibleItems[I]; + if AWidth < AItemLink.Control.Width then + AWidth := AItemLink.Control.Width; + end; + if MDIButtonsOnBar and (AWidth < GetMDIWidth) then AWidth := GetMDIWidth; + end; + if Result < AWidth then Result := AWidth; +end; + +function TdxBarControl.GetMaxHeight(AStyle: TdxBarDockingStyle): Integer; +var + AHeight, I: Integer; + AItemLink: TdxBarItemLink; +begin + Result := GetMinHeight(AStyle); + AHeight := 0; + if (AStyle in [dsLeft, dsRight]) or MultiLine then + begin + ItemLinks.RecentItemCount := -1; + for I := 0 to ItemLinks.VisibleItemCount - 1 do + begin + AItemLink := ItemLinks.VisibleItems[I]; + if AItemLink.BeginGroup then Inc(AHeight, BeginGroupSize); + Inc(AHeight, AItemLink.Control.Height); + end; + ItemLinks.RestoreRecentItemCount; + if MDIButtonsOnBar then + Inc(AHeight, GetMDIHeight); + if Vertical then + Inc(AHeight, GetMarkSize); + end + else + begin + for I := 0 to ItemLinks.CanVisibleItemCount - 1 do + begin + AItemLink := ItemLinks.CanVisibleItems[I]; + if AHeight < AItemLink.Control.Height then + AHeight := AItemLink.Control.Height; + end; + if MDIButtonsOnBar and (AHeight < GetMDIHeight) then + AHeight := GetMDIHeight; + end; + if Result < AHeight then Result := AHeight; +end; + +procedure TdxBarControl.GetMultiLineBarSize(AStyle: TdxBarDockingStyle; + ASize: Integer; var Result: TPoint); +var + ABeginGroupSize, ACount, ACurRowHeight, ACurX, ACurY, + ALastItemLinkWithBeginGroupCurX, ALastItemLinkWithBeginGroupCurRowHeight, + AMaxSize, I, H, W: Integer; + AItemLink, ALastItemLinkWithBeginGroup: TdxBarItemLink; + ABreakingRow, AEntireRow, AVertical: Boolean; +begin + AVertical := Vertical; + if AVertical and (ASize < Result.Y) then + ASize := Result.Y + else + if not AVertical and (ASize < Result.X) then + ASize := Result.X; + if AStyle <> dsNone then + Dec(ASize, GetMarkSize); + ACurX := 0; + ACurY := 0; + ACurRowHeight := 0; + AMaxSize := 0; + ALastItemLinkWithBeginGroup := nil; + ALastItemLinkWithBeginGroupCurX := 0; + ALastItemLinkWithBeginGroupCurRowHeight := 0; + ABreakingRow := False; + AEntireRow := True; + + ACount := ItemLinks.VisibleItemCount; + I := 0; + while I < ACount do + begin + AItemLink := ItemLinks.VisibleItems[I]; + if AItemLink.BeginGroup and (ACurX > 0) then + begin + ABeginGroupSize := BeginGroupSize; + ALastItemLinkWithBeginGroup := AItemLink; + ALastItemLinkWithBeginGroupCurX := ACurX; + ALastItemLinkWithBeginGroupCurRowHeight := ACurRowHeight; + end + else + ABeginGroupSize := 0; + + with AItemLink.Control do + if AVertical then + begin + W := Height; + H := Width; + end + else + begin + W := Width; + H := Height; + end; + + if (ACurX > 0) and (ACurX + ABeginGroupSize + W > ASize) or + ABreakingRow or (ABeginGroupSize > 0) and not AEntireRow then + begin + AEntireRow := True; + AItemLink.Control.FBreakingRow := True; + if ALastItemLinkWithBeginGroup = nil then + AEntireRow := False + else + if ABreakingRow then + begin + ALastItemLinkWithBeginGroup := nil; + ABreakingRow := False; + end + else + begin + I := ALastItemLinkWithBeginGroup.VisibleIndex; + ACurX := ALastItemLinkWithBeginGroupCurX; + ACurRowHeight := ALastItemLinkWithBeginGroupCurRowHeight; + ABreakingRow := True; + Continue; + end; + Inc(ACurY, ABeginGroupSize + ACurRowHeight); + ACurRowHeight := 0; + if AMaxSize < ACurX then AMaxSize := ACurX; + ACurX := W; + end + else + begin + AItemLink.Control.FBreakingRow := False; + Inc(ACurX, ABeginGroupSize + W); + end; + if ACurRowHeight < H then ACurRowHeight := H; + Inc(I); + end; + if ItemLinks.VisibleItemCount > 0 then + if AVertical then + Result.X := ACurY + ACurRowHeight + else + Result.Y := ACurY + ACurRowHeight; + if MDIButtonsOnBar then + begin + if AVertical then + I := GetMDIHeight + else + I := GetMDIWidth; + if ACurX + I <= ASize then + Inc(ACurX, I) + else + if AVertical then + Inc(Result.X, GetMDIWidth) + else + Inc(Result.Y, GetMDIHeight); + end; + if AMaxSize < ACurX then AMaxSize := ACurX; + if AVertical then + if Result.Y < AMaxSize then Result.Y := AMaxSize + else + else + if Result.X < AMaxSize then Result.X := AMaxSize; + CalcLayout; // because of a FBreakingRow +end; + +function TdxBarControl.GetSizeAllCursorBounds: TRect; +begin + if (DockingStyle = dsNone) or (Bar.BorderStyle = bbsNone) then + SetRectEmpty(Result) + else + if Horizontal then + Result := Rect(-100, -100, 0, 100) + else + Result := Rect(-100, -100, 100, 0); +end; + +function TdxBarControl.GetSizeForWidth(AStyle: TdxBarDockingStyle; + AWidth: Integer): TPoint; +var + J, ABeginGroupSize: Integer; + AItemLink: TdxBarItemLink; + Found: Boolean; + PrevSize, Size: TPoint; + + function CalcSize(var Size: TPoint): Boolean; + var + I: Integer; + begin + Result := False; + Size.X := 0; + Size.Y := 0; + for I := 0 to ItemLinks.VisibleItemCount - 1 do + begin + AItemLink := ItemLinks.VisibleItems[I]; + if AItemLink.BeginGroup then + ABeginGroupSize := BeginGroupSize + else + ABeginGroupSize := 0; + with AItemLink.Control do + begin + if (Size.X + ABeginGroupSize + Width > AWidth) and (I <> 0) then + begin + Result := True; + Break; + end; + Inc(Size.X, ABeginGroupSize + Width); + if Size.Y < Height then Size.Y := Height; + end; + end; + end; + +begin +// if ItemLinks.RecentItemCount <> -1 then + begin + ItemLinks.RecentItemCount := -1; + CalcLayout; + ItemLinks.RestoreRecentItemCount; + end; + + if MultiLine then + if Vertical then + begin + Size := GetSizeForHeight(AStyle, GetMaxHeight(AStyle)); + repeat + if Size.X >= AWidth then Break; + PrevSize := Size; + Dec(Size.Y); + Size := GetSizeForHeight(AStyle, Size.Y); + until Size.Y = PrevSize.Y; + Result := Size; + end + else + begin + Result := Point(GetMinWidth(AStyle), GetMinHeight(AStyle)); + GetMultiLineBarSize(AStyle, AWidth, Result); + end + else + case AStyle of + dsTop, dsBottom: + begin + Result := Point(GetMinWidth(AStyle), GetMinHeight(AStyle)); + if AWidth < Result.X then AWidth := Result.X; + if MDIButtonsOnBar then Dec(AWidth, GetMDIWidth); + ItemLinks.RecentItemCount := -1; + if ItemLinks.CanVisibleItemCount > 0 then + begin + Dec(AWidth, GetMarkSize); + if ItemLinks.CanUseRecentItems and not BarManager.Designing then + begin + PrevSize := Result; + Dec(PrevSize.X, GetMarkSize); + Found := False; + for J := 1 to ItemLinks.CanVisibleItemCount do + begin + ItemLinks.RecentItemCount := J; + Found := CalcSize(Size); + if Found then + begin + ItemLinks.RecentItemCount := J - 1; + Size := PrevSize; + Break; + end; + PrevSize := Size; + end; + if not Found then ItemLinks.RecentItemCount := -1; + end + else + CalcSize(Size); + Inc(Size.X, GetMarkSize); + + if Result.X < Size.X then Result.X := Size.X; + Result.Y := Size.Y; + if MDIButtonsOnBar then + begin + Inc(Result.X, GetMDIWidth); + if Result.Y < GetMDIHeight then Result.Y := GetMDIHeight; + end; + end; + end; + dsLeft, dsRight: + Result := Point(GetMinWidth(AStyle), GetMaxHeight(AStyle)); + else + Result := cxNullPoint; + end; +end; + +function TdxBarControl.GetSizeForHeight(AStyle: TdxBarDockingStyle; + AHeight: Integer): TPoint; +var + J, ABeginGroupSize: Integer; + AItemLink: TdxBarItemLink; + Found: Boolean; + PrevSize, Size: TPoint; + + function CalcSize(var Size: TPoint): Boolean; + var + I: Integer; + begin + Result := False; + Size.X := 0; + Size.Y := 0; + for I := 0 to ItemLinks.VisibleItemCount - 1 do + begin + AItemLink := ItemLinks.VisibleItems[I]; + if AItemLink.BeginGroup then + ABeginGroupSize := BeginGroupSize + else + ABeginGroupSize := 0; + with AItemLink.Control do + begin + if (Size.Y + ABeginGroupSize + Height > AHeight) and (I <> 0) then + begin + Result := True; + Break; + end; + Inc(Size.Y, ABeginGroupSize + Height); + if Size.X < Width then Size.X := Width; + end; + end; + end; + +begin + if ItemLinks.RecentItemCount <> -1 then + begin + ItemLinks.RecentItemCount := -1; + CalcLayout; + ItemLinks.RestoreRecentItemCount; + end; + + if MultiLine then + if Vertical then + begin + Result := Point(GetMinWidth(AStyle), GetMinHeight(AStyle)); + GetMultiLineBarSize(AStyle, AHeight, Result); + end + else + begin + Size := GetSizeForWidth(AStyle, GetMaxWidth(AStyle)); + repeat + if Size.Y >= AHeight then Break; + PrevSize := Size; + Dec(Size.X); + Size := GetSizeForWidth(AStyle, Size.X); + until Size.X = PrevSize.X; + Result := Size; + end + else + case AStyle of + dsTop, dsBottom: + Result := Point(GetMaxWidth(AStyle), GetMinHeight(AStyle)); + + dsLeft, dsRight: + begin + Result := Point(GetMinWidth(AStyle), GetMinHeight(AStyle)); + if AHeight < Result.Y then AHeight := Result.Y; + if MDIButtonsOnBar then Dec(AHeight, GetMDIHeight); + ItemLinks.RecentItemCount := -1; + if ItemLinks.CanVisibleItemCount > 0 then + begin + Dec(AHeight, GetMarkSize); + if ItemLinks.CanUseRecentItems and not BarManager.Designing then + begin + PrevSize := Result; + Dec(PrevSize.Y, GetMarkSize); + Found := False; + for J := 1 to ItemLinks.CanVisibleItemCount do + begin + ItemLinks.RecentItemCount := J; + Found := CalcSize(Size); + if Found then + begin + ItemLinks.RecentItemCount := J - 1; + Size := PrevSize; + Break; + end; + PrevSize := Size; + end; + if not Found then ItemLinks.RecentItemCount := -1; + end + else + CalcSize(Size); + Inc(Size.Y, GetMarkSize); + + if Result.Y < Size.Y then Result.Y := Size.Y; + Result.X := Size.X; + if MDIButtonsOnBar then + begin + Inc(Result.Y, GetMDIHeight); + if Result.X < GetMDIWidth then Result.X := GetMDIWidth; + end; + end; + end; + end; +end; + +function TdxBarControl.GetSizeForPopup: TSize; +begin + Result := cxNullSize; +end; + +function TdxBarControl.GetTrackSize(AStyle: TdxBarDockingStyle): TPoint; +var + PrevRecentItemCount: Integer; +begin + if bboUnmoved in BehaviorOptions then + AStyle := dsNone; + Result.X := 0; + Result.Y := 0; + PrevRecentItemCount := ItemLinks.RecentItemCount; + case AStyle of + dsNone: + begin + Result := GetSizeForWidth(AStyle, Bar.FloatClientWidth); + Inc(Result.X, Bar.BarNCSizeX(AStyle)); + Inc(Result.Y, Bar.BarNCSizeY(AStyle)); + end; + dsTop, dsBottom: + begin + if (FBar <> nil) and FBar.WholeRow then + Result.X := FDockControl.ClientWidth - FBar.BarNCSizeX(AStyle) + else + Result.X := GetMaxWidth(AStyle); + Result := GetSizeForWidth(AStyle, Result.X); + if (FBar <> nil) and FBar.WholeRow then + Result.X := FDockControl.ClientWidth + else + Inc(Result.X, Bar.BarNCSizeX(AStyle)); + Inc(Result.Y, Bar.BarNCSizeY(AStyle)); + end; + dsLeft, dsRight: + begin + if (FBar <> nil) and FBar.WholeRow then + Result.Y := FDockControl.ClientHeight - FBar.BarNCSizeY(AStyle) + else + Result.Y := GetMaxHeight(AStyle); + Result := GetSizeForHeight(AStyle, Result.Y); + Inc(Result.X, Bar.BarNCSizeX(AStyle)); + if (FBar <> nil) and FBar.WholeRow then + Result.Y := FDockControl.ClientHeight + else + Inc(Result.Y, Bar.BarNCSizeY(AStyle)); + end; + end; + if ItemLinks.RecentItemCount <> PrevRecentItemCount then + begin + ItemLinks.RecentItemCount := PrevRecentItemCount; + CalcLayout; + end; +end; + +function TdxBarControl.HasCaption: Boolean; +begin + Result := True; +end; + +function TdxBarControl.HasCloseButton: Boolean; +begin + Result := (DockingStyle = dsNone) and Bar.CanClose; +end; + +function TdxBarControl.HideOnClick: Boolean; +begin + Result := IsPopup; +end; + +function TdxBarControl.IgnoreClickAreaWhenHidePopup: TRect; +begin + Result := ParentBar.MarkRect; + MapWindowRect(ParentBar.Handle, 0, Result); +end; + +procedure TdxBarControl.InvalidateMark; +begin + Painter.BarMarkRectInvalidate(Self); +end; + +function TdxBarControl.IsMarkAccessible: Boolean; +begin + Result := Painter.BarAllowQuickCustomizing and MarkExists; +end; + +function TdxBarControl.IsInternal: Boolean; +begin + Result := IsPopup; +end; + +function TdxBarControl.GetMouseTrackingBounds: TRect; +begin + Result := inherited GetMouseTrackingBounds; + if DockControl <> nil then + begin + IntersectRect(Result, DockControl.ClientRect, Result); + Result := cxRectOffset(Result, DockControl.ClientOrigin); + end; +end; + +function TdxBarControl.MarkExists: Boolean; +begin + Result := Bar.ShowMark and (FTruncated or + (Painter.BarAllowQuickCustomizing and Bar.AllowQuickCustomizing)); +end; + +function TdxBarControl.MarkNCRect: TRect; +begin + Result := MarkScreenRect; + OffsetRect(Result, -WindowRect.Left, -WindowRect.Top); +end; + +function TdxBarControl.MarkRect: TRect; +begin + Result := Painter.BarMarkRect(Self); +end; + +function TdxBarControl.MarkScreenRect: TRect; +begin + Result := MarkRect; + MapWindowRect(Handle, 0, Result); +end; + +procedure TdxBarControl.SetMarkState(Value: TdxBarMarkState); +var + ALinkSelf: TcxObjectLink; +begin + if IsCustomizing then Exit; + if FMarkState <> Value then + begin + FMarkState := Value; + FinishMoreButtonsHintTimer; + if FMarkState = msPressed then + begin + //PlaySound(psMenuPopup); + BarDesignController.ShowQuickControl(Self, MarkScreenRect); + FQuickPopup := BarDesignController.QuickControl; + end + else + begin + ALinkSelf := cxAddObjectLink(Self); + try + FreeAndNil(FQuickPopup); + if ALinkSelf.Ref = nil then + Exit; + finally + cxRemoveObjectLink(ALinkSelf); + end; + if FMarkState = msSelected then + begin + if DockingStyle = dsNone then StartMoreButtonsHintTimer; + BarManager.ActivateHint(True, GetMoreButtonsHint, Self); + end + else + if SelectedControl = nil then + BarManager.HideHint; + end; + InvalidateMark; + end; +end; + +procedure TdxBarControl.SelectItemControl(AItemControl: TdxBarItemControl; AButton: TMouseButton; AShift: TShiftState); +begin + if (AItemControl = nil) then + IsActive := False; //#DG first subitem - blue caption + inherited; +end; + +procedure TdxBarControl.ShowPopup(AItem: TdxBarItemControl); +begin + if not BarManager.IsCustomizing then + BarDesignController.ShowToolbarsPopup(BarManager, Painter) + else + inherited; +end; + +function TdxBarControl.SizeGripRect: TRect; +begin + with Result do + begin + Left := ClientWidth; + Right := Left + Painter.StatusBarGripSize(BarManager).cx; + Bottom := ClientHeight; + Top := Bottom - Painter.StatusBarGripSize(BarManager).cy; + end; +end; + +procedure TdxBarControl.UpdateCaptionButtons(ACaptionButton: TdxBarCaptionButton); +begin +// do nothing +end; + +procedure TdxBarControl.UpdateItem(AControl: TdxBarItemControl); +begin + cxInvalidateRect(Handle, GetItemRect(AControl), False); +end; + +function TdxBarControl.AllowNCPaint: Boolean; +begin + Result := not ((ClientHeight = Height) and (ClientWidth = Width) or IsDestroying); +end; + +procedure TdxBarControl.BarManagerStyleChanged; +var + ABar: TdxBar; +begin + UpdateControlStyle; + CalcDrawingConsts; + if DockingStyle = dsNone then + begin + ABar := Bar; + ABar.Visible := False; + ABar.Visible := True; + end + else + RebuildBar; +end; + +procedure TdxBarControl.CaptionChanged; +begin + Text := GetCaption; + SendMessage(Handle, WM_NCPAINT, 0, 0); +end; + +procedure TdxBarControl.DoDrawBeginGroup(const ASeparatorRect: TRect; AHorz: Boolean); +begin + Painter.BarDrawBeginGroup(Self, Canvas.Handle, ASeparatorRect, ToolbarBrush, AHorz); +end; + +procedure TdxBarControl.DoNCPaint(DC: HDC); + + procedure DrawStatusBar(const ARect: TRect; AToolbarBrush: HBRUSH); + begin + Painter.BarDrawStatusBarBorder(Self, DC, ARect, AToolbarBrush); + if FHasSizeGrip then + Painter.BarDrawStatusBarGrip(Self, DC, ARect, AToolbarBrush); + end; + + procedure DrawBorders; + var + AWindowRect, R, CR: TRect; + Rgn, Rgn1: HRGN; + AToolbarBrush: HBRUSH; + BR: TRect; + begin + AWindowRect := WindowRect; + CR := ClientBounds; + R := NCRect; + AToolbarBrush := ToolbarBrush; + if DockingStyle = dsNone then + begin + Painter.BarDrawFloatingBarBorder(Self, DC, R, CR, AToolbarBrush); + R := CR; + if HasCaption then + begin + Dec(R.Left, Painter.BarHorSize); + Inc(R.Right, Painter.BarHorSize); + Dec(R.Top, Painter.BarTopSize); + Inc(R.Bottom, Painter.BarBottomSize); + end; + Rgn := CreateRectRgn(R.Left, R.Top, R.Right, R.Bottom); + end + else + begin + Painter.BarBorderPaintSizes(Self, BR); + Rgn := CreateRectRgn(R.Left + BR.Left, R.Top + BR.Top, R.Right - BR.Right, R.Bottom - BR.Bottom); + end; + Rgn1 := CreateRectRgn(CR.Left, CR.Top, CR.Right, CR.Bottom); + CombineRgn(Rgn, Rgn1, Rgn, RGN_XOR); + DeleteObject(Rgn1); + + FillBackgroundRgn(DC, Rgn, AToolbarBrush, False); + + DeleteObject(Rgn); + + if DockingStyle <> dsNone then + Painter.BarDrawDockedBarBorder(Self, DC, R, AToolbarBrush); + end; + +begin + if Painter.IsCompoundPainting then + Painter.DrawToolbarNonContentPart(Self, DC) + else + if (DockingStyle <> dsNone) and (FBar.BorderStyle = bbsNone) then + begin + if FBar.IsStatusBar then + DrawStatusBar(NCRect, ToolbarBrush); + end + else + begin + DrawBorders; + if (DockingStyle = dsNone) and HasCaption then + Painter.BarDrawFloatingBarCaption(Self, DC, GetCaptionNCRect, GetCaptionNCRect, ToolbarBrush); + end; +end; + +procedure TdxBarControl.DoPaint; +var + AButtons: TdxBarMDIButtons; + AItemLink: TdxBarItemLink; + I: Integer; +begin +//#DG if {not IsWindowVisible(BarManager.Owner.Handle) or} FDestroyFlag then Exit; + if {not IsWindowVisible(BarManager.Owner.Handle) or} IsDestroying then + Exit; + +// // recalc positions of items +// CalcLayout; + + // hide invisible items that require that + if not BarManager.Designing then + for I := 0 to FItemLinks.CanVisibleItemCount - 1 do + begin + AItemLink := FItemLinks.CanVisibleItems[I]; + with AItemLink do + if Item.NeedToBeHidden and (VisibleIndex = -1) then + Item.HideControl(Control); + end; + + Canvas.SaveClipRegion; + try + if Painter.IsCompoundPainting then + DrawContentBackground; + + DrawItems; + DrawBeginGroups; + if MDIButtonsOnBar then + begin + if RealMDIButtonsOnBar then + AButtons := [mdibMinimize, mdibRestore, mdibClose] + else + AButtons := [mdibClose]; + DrawMDIButtons(AButtons, True); + end; + if (DockingStyle <> dsNone) and MarkExists then + DrawMarks; + if not Painter.IsCompoundPainting then + DrawContentBackground; + finally + Canvas.RestoreClipRegion; + end; + + DrawSelection(Canvas.Handle); +end; + +procedure TdxBarControl.DrawBeginGroups; +var + I: Integer; + ASeparatorRect: TRect; +begin + for I := 0 to ViewInfo.SeparatorCount - 1 do + begin + ASeparatorRect := ViewInfo.SeparatorInfos[I].Bounds; + DoDrawBeginGroup(ASeparatorRect, ViewInfo.SeparatorInfos[I].Kind = skHorizontal); + Canvas.ExcludeClipRect(ASeparatorRect); + end; +end; + +procedure TdxBarControl.DrawContentBackground; +begin + Painter.DrawToolbarContentPart(Self, Canvas); +end; + +procedure TdxBarControl.DrawMarks; +var + AMarkRect: TRect; +begin + AMarkRect := Painter.BarMarkItemRect(Self); + Painter.BarDrawMarks(Self, Canvas, AMarkRect, ToolbarBrush); + Canvas.ExcludeClipRect(AMarkRect); +end; + +procedure TdxBarControl.DrawMDIButtons(AButtons: TdxBarMDIButtons; AExcludeClipRect: Boolean = False); +var + AButton: TdxBarMDIButton; +begin + for AButton := Low(TdxBarMDIButton) to High(TdxBarMDIButton) do + if AButton in AButtons then + begin + DrawMDIButton(AButton, FIsMouseOverMDIButton and (AButton = FSelectedMDIButton), + FIsMDIButtonPressed and (AButton = FPressedMDIButton)); + if AExcludeClipRect then + Canvas.ExcludeClipRect(RectMDI(AButton)); + end; +end; + +procedure TdxBarControl.DrawSelection(ADC: HDC); +begin + if BarManager.Designing and Bar.IsComponentSelected then + begin + if BarDesignController.NeedDefaultSelection(Bar) then + dxBarFrameRect(ADC, ClientRect, COLOR_WINDOWTEXT) + else + dxBarFocusRect(ADC, ClientRect); + end; +end; + +procedure TdxBarControl.FillBackground(ADC: HDC; const ARect: TRect; ABrush: HBRUSH; + AColor: TColor; AIsClientArea: Boolean); +var + R: TRect; +begin + // calc rect + if AIsClientArea then + R := cxRectOffset(ARect, NCOffset) + else + R := ARect; + Painter.BarDrawBackground(Self, ADC, ARect, R, ABrush, AColor); +end; + +procedure TdxBarControl.FrameChanged; +begin + SetWindowPos(Handle, 0, 0, 0, 0, 0, + SWP_NOZORDER or SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE or SWP_FRAMECHANGED); +end; + +function TdxBarControl.GetCaption: TCaption; +begin + Result := Bar.Caption; +end; + +function TdxBarControl.GetEditFont: TFont; +begin + if FBar.UseOwnFont then + Result := FBar.FEditFont + else + Result := inherited GetEditFont; +end; + +function TdxBarControl.GetFont: TFont; +begin + Result := Bar.Font; +end; + +function TdxBarControl.GetFullItemRect(Item: TdxBarItemControl): TRect; +begin + Result := GetItemRect(Item); + with Item.ItemLink, Result do + if Vertical then + begin + Dec(Left, (RowHeight - (Right - Left)) div 2); + Right := Left + RowHeight; + end + else + begin + Dec(Top, (RowHeight - (Bottom - Top)) div 2); + Bottom := Top + RowHeight; + end; +end; + +function TdxBarControl.GetItemRegion(Item: TdxBarItemControl): HRGN; +var + Rgn: HRGN; + ASeparatorIndex: Integer; +begin + Result := CreateRectRgnIndirect(GetFullItemRect(Item)); + if ViewInfo.IsAssociatedWithSeparator(Item, ASeparatorIndex) then + begin + Rgn := CreateRectRgnIndirect(ViewInfo.SeparatorInfos[ASeparatorIndex].Bounds); + CombineRgn(Result, Result, Rgn, RGN_OR); + DeleteObject(Rgn); + end; +end; + +function TdxBarControl.GetToolbarBrush: HBRUSH; +begin + Result := Painter.BarToolbarBrushEx(Self); +end; + +procedure TdxBarControl.GlyphChanged; +begin +end; + +function TdxBarControl.IsBackgroundBitmap: Boolean; +begin + Result := inherited IsBackgroundBitmap or + not Bar.BackgroundBitmap.Empty or + not BarManager.Backgrounds.Bar.Empty; +end; + +function TdxBarControl.IsTransparent: Boolean; +begin + Result := (Bar.Color <> clDefault) or not Bar.BackgroundBitmap.Empty or + not BarManager.Backgrounds.Bar.Empty or inherited IsTransparent or + Painter.IsCompoundPainting; +end; + +function TdxBarControl.LockHotTrackWhenPopup: Boolean; +begin + Result := True; +end; + +function TdxBarControl.NCOffset: TPoint; +begin +// Result := inherited NCOffset; +// if DockingStyle <> dsNone then + Result := ClientBounds.TopLeft; +end; + +procedure TdxBarControl.NCPaint(ADC: HDC); +var + ATempDC: HDC; +begin + DoNCPaint(ADC); + if BarManager.IsUncustomizable then + begin + SelectClipRgn(ADC, FPrevClipRgn.Handle); + DrawDisablingHatch(ADC, Rect(0, 0, Width, Height)); + ATempDC := GetWindowDC(Handle); + try + SelectClipRgn(ATempDC, FPrevClipRgn.Handle); + BitBlt(ATempDC, 0, 0, Width, Height, ADC, 0, 0, SRCCOPY); + finally + ReleaseDC(Handle, ATempDC); + end; + end; +end; + +function TdxBarControl.NeedHideOnNCMouseClick: Boolean; +begin + Result := GetParentPopupWindow(Self, True) = nil; +end; + +function TdxBarControl.NotHandleMouseMove(ACheckLastMousePos: Boolean = True): Boolean; + + function ControlContainerActive: Boolean; + begin + Result := HasAsParent(GetActiveWindow, BarManager.Owner.Handle); + end; + +var + AQuickControl: TdxBarControl; +begin + Result := inherited NotHandleMouseMove(ACheckLastMousePos) or + (DockingStyle <> dsNone) and not IsFormActive(ParentForm) and not ControlContainerActive; + if not Result then + begin + AQuickControl := BarDesignController.QuickControl; + Result := (AQuickControl <> nil) and AQuickControl.LockHotTrackWhenPopup and + not ((Self = AQuickControl) or AQuickControl.IsChildBar(Self)); + end; +end; + +procedure TdxBarControl.RebuildBar; +begin + UpdateDoubleBuffered; + FrameChanged; + RepaintBar; +end; + +procedure TdxBarControl.RefreshShadow; +begin + FShadow.Refresh; +end; + +procedure TdxBarControl.RepaintMDIButtons; +var + AButtons: TdxBarMDIButtons; +begin + if RealMDIButtonsOnBar then + AButtons := [mdibMinimize, mdibRestore, mdibClose] + else + AButtons := [mdibClose]; + DrawMDIButtons(AButtons); +end; + +procedure TdxBarControl.SavePos; +begin + if not FBar.Visible or FMoving or BarManager.IsDestroying then + Exit; + FPosSaving := True; + BarManager.LockDesignerModified(True); + try + if DockingStyle = dsNone then + begin + Bar.FloatLeft := Left; + Bar.FloatTop := Top; + Bar.FloatClientWidth := ClientWidth; + Bar.FloatClientHeight := ClientHeight; + end + else + if (DockControl <> nil) and not DockControl.IsBarHandleDestroying and + not BarManager.IsHandleCreating then + begin + Bar.DockedDockingStyle := DockingStyle; + if DockControl.Main then + Bar.DockedDockControl := nil + else + Bar.DockedDockControl := TdxBarDockControl(DockControl); + if GetDockCol <> nil then + begin + Bar.OneOnRow := GetDockCol.DockRow.FBars.Count = 1; +// FBar.Bars.BeginUpdate; + try + Bar.DockedLeft := Left; + Bar.DockedTop := Top; + finally +// FBar.Bars.EndUpdate; + end; + end; + end; + finally + FPosSaving := False; + BarManager.LockDesignerModified(False); + end; +end; + +procedure TdxBarControl.SetFont; +begin + Font := GetFont; +end; + +procedure TdxBarControl.SetDockingStyle(Value: TdxBarDockingStyle); +begin + if DockingStyle <> Value then FTruncated := False; + inherited; +end; + +procedure TdxBarControl.SetKeySelectedItem(Value: TdxBarItemControl); +var + APrevSelectedControl: TdxBarItemControl; +begin + APrevSelectedControl := SelectedControl; + inherited SetKeySelectedItem(Value); + if (SelectedControl <> APrevSelectedControl) and + (SelectedControl <> nil) and not SelectedControl.IsActive and not IsCustomizing then + if SelectedControl is TdxBarSubItemControl then + SelectedControl.ControlClick(False) + else + SelectedControl.ControlActivate(True); +end; + +procedure TdxBarControl.SetLayeredAttributes; +var + AAlphaBlendValue: Byte; +begin + if FMoving or ((DockingStyle = dsNone) and not IsInternal) then + AAlphaBlendValue := Bar.AlphaBlendValue + else + AAlphaBlendValue := 255; + if FMoving then + SetLayeredWndAttributes(FFloatingHandle, AAlphaBlendValue) + else + SetLayeredWndAttributes(Handle, AAlphaBlendValue); +end; + +function TdxBarControl.IsRealVertical: Boolean; +begin + Result := Vertical; +end; + +function TdxBarControl.IsVertical: Boolean; +begin + Result := IsRealVertical and Bar.RotateWhenVertical; +end; + +function TdxBarControl.Kind: TdxBarKind; +begin + Result := bkBarControl; +end; + +procedure TdxBarControl.Popup(const AOwnerRect: TRect); +begin + PopupEx(AOwnerRect, xdRight); +end; + +procedure TdxBarControl.PopupEx(const AOwnerRect: TRect; APopupDirection: TXDirection); +var + AWorkArea: TRect; + ASize: TSize; + P: TPoint; +begin + ClosedByEscape := False; + ASize := GetSizeForPopup; + if ParentBar.IsRealVertical then + P := Point(AOwnerRect.Right, AOwnerRect.Top) + else + case APopupDirection of + xdLeft: P := Point(AOwnerRect.Right - ASize.cx, AOwnerRect.Bottom); + xdRight: P := Point(AOwnerRect.Left, AOwnerRect.Bottom); + end; + AWorkArea := GetWorkArea(P); + if ParentBar.IsRealVertical then + begin + if P.X + ASize.cx > AWorkArea.Right then P.X := AOwnerRect.Left - ASize.cx; + if P.Y < AWorkArea.Top then P.Y := AWorkArea.Top; + if P.Y + ASize.cy > AWorkArea.Bottom then P.Y := AWorkArea.Bottom - ASize.cy; + end + else + begin + if P.X < AWorkArea.Left then P.X := AWorkArea.Left; + if P.X + ASize.cx > AWorkArea.Right then P.X := AWorkArea.Right - ASize.cx; + if P.Y + ASize.cy > AWorkArea.Bottom then P.Y := AOwnerRect.Top - ASize.cy; + end; + SetWindowPos(Handle, HWND_TOP, P.X, P.Y, ASize.cx, ASize.cy, + SWP_SHOWWINDOW or SWP_NOACTIVATE); +end; + +procedure TdxBarControl.Repaint; +begin + if (Bar <> nil) and Bar.BarManager.IsUpdateLocked then + Bar.DoChanged + else + inherited; +end; + +procedure TdxBarControl.UpdateFont; +begin + Font := GetFont; + Perform(CM_FONTCHANGED, 0, 0); +end; + +procedure TdxBarControlViewInfo.Calculate; +var + AItemLink: TdxBarItemLink; + I: Integer; +begin + BarControl.CalcControlsPositions; + inherited Calculate; + for I := 0 to BarControl.ItemLinks.VisibleItemCount - 1 do + begin + AItemLink := BarControl.ItemLinks.VisibleItems[I]; + if AItemLink.Control = nil then + Continue; + AddItemControlViewInfo(AItemLink.Control.ViewInfo); + IdxBarItemControlViewInfo(AItemLink.Control.ViewInfo).SetBounds(BarControl.GetItemRect(AItemLink.Control)); + CalcSeparatorInfo(AItemLink); + if IsLastVisibleItemControl(AItemLink.Control) then + Break; + end; +end; + +procedure TdxBarControlViewInfo.CalcSeparatorInfo(AItemLink: TdxBarItemLink); +var + AItemRect: TRect; +begin + if not CanShowSeparators then Exit; + AItemRect := AItemLink.Control.ViewInfo.Bounds; + if AItemLink.BeginGroup and not IsRectEmpty(AItemRect) then + DoCalcSeparatorInfo(AItemLink, AItemRect); +end; + +function TdxBarControlViewInfo.CanShowButtonGroups: Boolean; +begin + Result := False; +end; + +function TdxBarControlViewInfo.CanShowSeparators: Boolean; +begin + Result := True; +end; + +procedure TdxBarControlViewInfo.DoCalcSeparatorInfo(AItemLink: TdxBarItemLink; const AItemRect: TRect); +var + R: TRect; + AMarkSize: Integer; +begin + if BarControl.DockingStyle <> dsNone then + AMarkSize := BarControl.GetMarkSize + else + AMarkSize := 0; + if not BarControl.Vertical and (AItemRect.Left = 0) and (AItemRect.Top > 0) or + BarControl.Vertical and (AItemRect.Top > 0) then + begin // begin group in vertical direction + if BarControl.Vertical then + R := Bounds(AItemRect.Left - (AItemLink.FRowHeight - cxRectWidth(AItemRect)) div 2, + AItemRect.Top - BarControl.BeginGroupSize, AItemLink.FRowHeight, BarControl.BeginGroupSize) + else + R := Bounds( + 0, + AItemRect.Top - (AItemLink.FRowHeight - cxRectHeight(AItemRect)) div 2 - BarControl.BeginGroupSize, + BarControl.ClientWidth - AMarkSize, + BarControl.BeginGroupSize); + AddSeparatorInfo(R, skHorizontal, AItemLink.Control); + end + else + begin // begin group in horizontal direction + if BarControl.Vertical then + R := Bounds( + AItemRect.Right + (AItemLink.FRowHeight - cxRectWidth(AItemRect)) div 2, 0, + BarControl.BeginGroupSize, + BarControl.ClientHeight - AMarkSize) + else + R := Bounds( + AItemRect.Left - BarControl.BeginGroupSize, + AItemRect.Top - (AItemLink.FRowHeight - cxRectHeight(AItemRect)) div 2, + BarControl.BeginGroupSize, AItemLink.FRowHeight); + AddSeparatorInfo(R, skVertical, AItemLink.Control); + end; +end; + +function TdxBarControlViewInfo.IsLastVisibleItemControl( + AItemControl: TdxBarItemControl): Boolean; +begin + Result := False; +end; + +function TdxBarControlViewInfo.GetBarControl: TdxBarControl; +begin + Result := TdxBarControl(FBarControl); +end; + +{ TdxBarSubMenuControl } + +type + TdxBarAnimationInfo = record + AnimationMenu: TdxBarSubMenuControl; + AnimationType: TdxBarMenuAnimations; + LeftDirection, TopDirection: Boolean; + RealLeft, RealTop: Integer; + RealClientWidth, RealClientHeight: Integer; + BorderWidth, BorderHeight: Integer; + FirstValue: Integer; + Delta: Integer; + Step: Integer; + OldClientRect: TRect; + end; + + TdxBarAnimationThread = class(TThread) + private + FAnimationInfo: TdxBarAnimationInfo; + FPrevGDIObject: HGDIOBJ; + FCompatibleDC: HDC; + procedure DoAnimation; + procedure DoOneStepOfAnimation(AIteration: Integer); + procedure DoFinishAnimation; + protected + procedure DoTerminate; override; + procedure Execute; override; + public + constructor Create(const AAnimationInfo: TdxBarAnimationInfo); + destructor Destroy; override; + procedure TerminateAnimation; + end; + +constructor TdxBarAnimationThread.Create(const AAnimationInfo: TdxBarAnimationInfo); +var + ADC: HDC; +begin + inherited Create(True); + FreeOnTerminate := True; + FAnimationInfo := AAnimationInfo; + + ADC := FAnimationInfo.AnimationMenu.Canvas.Handle; + FCompatibleDC := CreateCompatibleDC(ADC); + FPrevGDIObject := SelectObject(FCompatibleDC, CreateCompatibleBitmap(ADC, FAnimationInfo.RealClientWidth, FAnimationInfo.RealClientHeight)); + FAnimationInfo.AnimationMenu.PaintWindow(FCompatibleDC); +end; + +destructor TdxBarAnimationThread.Destroy; +begin + ReverseGDIObject(FCompatibleDC, FPrevGDIObject); + DeleteDC(FCompatibleDC); + inherited; +end; + +procedure TdxBarAnimationThread.TerminateAnimation; +begin + FreeOnTerminate := False; + try + Terminate; + WaitFor; + finally + Free; + end; +end; + +procedure TdxBarAnimationThread.DoTerminate; +begin + inherited; + Synchronize(DoFinishAnimation); +end; + +procedure TdxBarAnimationThread.Execute; +begin + DoAnimation; +end; + +procedure TdxBarAnimationThread.DoAnimation; +var + AFirstTime: DWORD; + I: Integer; +begin + for I := 1 to FAnimationInfo.Delta div FAnimationInfo.Step do + begin + if Terminated then + Break; + AFirstTime := GetTickCount; + DoOneStepOfAnimation(I); + Sleep(1); + while (GetTickCount - AFirstTime < 1) and not Terminated do {loop}; + end; +end; + +procedure TdxBarAnimationThread.DoOneStepOfAnimation(AIteration: Integer); +var + ANewLeft, ANewTop, ANewClientWidth, ANewClientHeight: Integer; + R, R1, R2: TRect; + DC: HDC; +begin + with FAnimationInfo do + begin + if FirstValue >= 0 then + begin + ANewClientWidth := Step * AIteration; + ANewClientHeight := FirstValue + ANewClientWidth; + if AnimationType = maSlide then + ANewClientWidth := AnimationMenu.ClientWidth; + end + else + begin + ANewClientHeight := Step * AIteration; + ANewClientWidth := Abs(FirstValue) + ANewClientHeight; + end; + + if LeftDirection then + ANewLeft := AnimationMenu.Left - (ANewClientWidth - AnimationMenu.ClientWidth) + else + ANewLeft := AnimationMenu.Left; + if TopDirection then + ANewTop := AnimationMenu.Top - (ANewClientHeight - AnimationMenu.ClientHeight) + else + ANewTop := AnimationMenu.Top; + + SetWindowPos(AnimationMenu.Handle, 0, ANewLeft, ANewTop, + BorderWidth + ANewClientWidth, BorderHeight + ANewClientHeight, + SWP_NOZORDER or SWP_NOACTIVATE or SWP_SHOWWINDOW); + + DC := GetDC(AnimationMenu.Handle); + AnimationMenu.PreparePalette(DC); + + R1 := OldClientRect; + if TopDirection then + begin + R := Rect(0, 0, ANewClientWidth, ANewClientHeight); + OffsetRect(R1, 0, ANewClientHeight - R1.Bottom); + cxBitBlt(DC, DC, OldClientRect, R1.TopLeft, SRCCOPY); + R1 := OldClientRect; + + BitBlt(DC, 0, R1.Bottom, AnimationMenu.ClientWidth, AnimationMenu.ClientHeight - R1.Bottom, + FCompatibleDC, R.Left, R.Top + R1.Bottom, SRCCOPY); + BitBlt(DC, R1.Right, R1.Top, AnimationMenu.ClientWidth - R1.Right, R1.Bottom - R1.Top, + FCompatibleDC, R.Left + R1.Right, R.Top, SRCCOPY); + end + else + if LeftDirection then + begin + R := Rect(RealClientWidth - AnimationMenu.ClientWidth, RealClientHeight - AnimationMenu.ClientHeight, RealClientWidth, RealClientHeight); + OffsetRect(R1, AnimationMenu.ClientWidth - R1.Right, 0); + R2 := R1; + OffsetRect(R2, 0, AnimationMenu.ClientHeight - R1.Bottom); + cxBitBlt(DC, DC, R2, R1.TopLeft, SRCCOPY); + R1 := R2; + + BitBlt(DC, 0, 0, AnimationMenu.ClientWidth, R1.Top, FCompatibleDC, R.Left, R.Top, SRCCOPY); + BitBlt(DC, 0, R1.Top, R1.Left, AnimationMenu.ClientHeight - R1.Top, + FCompatibleDC, R.Left, R.Top + R1.Top, SRCCOPY); + end + else + begin + R := Rect(0, RealClientHeight - AnimationMenu.ClientHeight, AnimationMenu.ClientWidth, RealClientHeight); + OffsetRect(R1, 0, AnimationMenu.ClientHeight - R1.Bottom); + cxBitBlt(DC, DC, R1, OldClientRect.TopLeft, SRCCOPY); + + BitBlt(DC, 0, 0, AnimationMenu.ClientWidth, R1.Top, FCompatibleDC, R.Left, R.Top, SRCCOPY); + BitBlt(DC, R1.Right, R1.Top, AnimationMenu.ClientWidth - R1.Right, AnimationMenu.ClientHeight - R1.Top, + FCompatibleDC, R.Left + R1.Right, R.Top + R1.Top, SRCCOPY); + end; + OldClientRect := AnimationMenu.ClientRect; + + AnimationMenu.UnpreparePalette(DC); + UpdateColors(DC); + ReleaseDC(AnimationMenu.Handle, DC); + end; +end; + +procedure TdxBarAnimationThread.DoFinishAnimation; +begin + with FAnimationInfo do + if not AnimationMenu.IsDestroying then + begin + AnimationMenu.FShowAnimation := False; + SetWindowPos(AnimationMenu.Handle, 0, RealLeft, RealTop, + BorderWidth + RealClientWidth, + BorderHeight + RealClientHeight, + SWP_NOZORDER or SWP_NOACTIVATE or SWP_SHOWWINDOW or SWP_FRAMECHANGED {to enforce WM_WINDOWPOSCHANGED}); + AnimationMenu.Repaint; + end; +end; + +constructor TdxBarSubMenuControl.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Width := 0; + FXDirection := xdRight; + FYDirection := ydBottom; +end; + +destructor TdxBarSubMenuControl.Destroy; +begin + if BarManager.FChangedSubMenuControl = Self then + BarManager.FChangedSubMenuControl := nil; + IsActive := False; + inherited Destroy; +end; + +function TdxBarSubMenuControl.GetBandSize: Integer; +begin + Result := Painter.SubMenuControlGetBandSize(Self); +end; + +function TdxBarSubMenuControl.GetBarSize: Integer; +begin + if GetSubMenuOwner <> nil then + Result := GetSubMenuOwner.GetBarSize + else + Result := 0; +end; + +function TdxBarSubMenuControl.GetBarRect: TRect; +begin + Result := Rect(ItemsRect.Left - BarSize, ItemsRect.Top, ItemsRect.Left, ItemsRect.Bottom); +end; + +function TdxBarSubMenuControl.GetBottomVisibleItemIndex: Integer; +var + AMaxVisibleItemCount: Integer; +begin + AMaxVisibleItemCount := Max(GetMaxVisibleCount, 1); + Result := TopIndex + AMaxVisibleItemCount - 1; + if not UseScrollButtons and DownArrowExists then + Dec(Result); +end; + +function TdxBarSubMenuControl.GetBorderSize: Integer; +begin + Result := Painter.SubMenuControlBorderSize; +end; + +function TdxBarSubMenuControl.GetContentRect: TRect; +begin + Result := cxRectContent(ClientRect, Painter.SubMenuControlContentRectOffset(Self)); +end; + +function TdxBarSubMenuControl.GetDetachCaptionSize: Integer; +begin + Result := Canvas.TextHeight('Qq') div 2; + if not Odd(Result) then Inc(Result); +end; + +function TdxBarSubMenuControl.GetMaxVisibleCount: Integer; +var + I: Integer; +begin + for I := TopIndex to ItemLinks.VisibleItemCount - 1 do + if ItemLinks.VisibleItems[I].ItemRect.Bottom = 0 then + begin + Result := I - TopIndex; + Exit; + end; + Result := ItemLinks.VisibleItemCount - TopIndex; +end; + +function TdxBarSubMenuControl.GetParentItemControl: TdxBarItemControl; +begin + if FDropDownButton <> nil then + Result := FDropDownButton + else + Result := FSubItem; +end; + +function TdxBarSubMenuControl.GetSubMenuOwner: IdxBarSubMenuOwner; +begin + Supports(TObject(ItemLinks.Owner), IdxBarSubMenuOwner, Result); +end; + +function TdxBarSubMenuControl.GetToolbarItemsBrush: HBRUSH; +begin + Result := Painter.SubMenuControlToolbarItemsBrush(Self); +end; + +function TdxBarSubMenuControl.GetTopVisibleItemIndex: Integer; +begin + Result := TopIndex; + if not UseScrollButtons and UpArrowExists then + Inc(Result); +end; + +procedure TdxBarSubMenuControl.SetDetachCaptionSelected(AValue: Boolean); +begin + if IsCustomizing or (GetCapture <> 0) then Exit; + if FDetachCaptionSelected <> AValue then + begin + FDetachCaptionSelected := AValue; + InvalidateDetachCaption; + SetCursorForMoving(AValue); + if AValue then + BarManager.ActivateHint(True, cxGetResourceString(@dxSBAR_DRAGTOMAKEMENUFLOAT), Self) + else + if SelectedControl = nil then + BarManager.HideHint; + end; +end; + +procedure TdxBarSubMenuControl.SetTopIndex(AValue: Integer); +begin + if AValue < 0 then AValue := 0; + if FTopIndex <> AValue then + begin + FTopIndex := AValue; + InvalidateItemsRect; + end; +end; + +procedure TdxBarSubMenuControl.CalcBounds(out ASize: TSize); + + procedure CalcItemSizeParams; + var + ARecentItemCount: Integer; + AExtendedView: Boolean; + ALastWasRecentItem: Boolean; + I: Integer; + AItemLink: TdxBarItemLink; + begin + ARecentItemCount := ItemLinks.MostRecentItemCount; + if ARecentItemCount = -1 then + ARecentItemCount := ItemLinks.CanVisibleItemCount; + AExtendedView := ExtendedView; + + ALastWasRecentItem := True; + for I := TopIndex to ItemLinks.VisibleItemCount - 1 do + begin + AItemLink := ItemLinks.VisibleItems[I]; + AItemLink.Control.FNonRecent := AExtendedView and (AItemLink.RecentIndex >= ARecentItemCount); + AItemLink.Control.FChangeRecentGroup := AExtendedView and + ((I > TopIndex) or Detachable) and (AItemLink.Control.FNonRecent = ALastWasRecentItem); + ALastWasRecentItem := not AItemLink.Control.FNonRecent; + end; + end; + +begin + CalcItemSizeParams; + CalcSize(ASize); +end; + +procedure TdxBarSubMenuControl.CalcSize(out ASize: TSize); +begin + DoCalcSize(ASize); + + if ASize.cx = 0 then + ASize.cx := dxBarEmptySubMenuControlContentWidth; + if ASize.cy <= 2 then + Inc(ASize.cy, TextSize); + if MarkExists then + Inc(ASize.cy, MarkSize); + + DoCorrectSize(ASize); +end; + +procedure TdxBarSubMenuControl.CreateLightBrush; +var + Color: COLORREF; + R, G, B: Integer; + DC: HDC; + LogPalette: TLogPalette; +begin + Color := GetSysColor(COLOR_BTNFACE); + R := Min(255, GetRValue(Color) + dxBarNonrecentlyUsedItemsColorDelta); + G := Min(255, GetGValue(Color) + dxBarNonrecentlyUsedItemsColorDelta); + B := Min(255, GetBValue(Color) + dxBarNonrecentlyUsedItemsColorDelta); + + DC := GetDC(0); + if BarManager.ShowRecentItemsFirst and (GetDeviceCaps(DC, BITSPIXEL) <= 8) then + begin + with LogPalette do + begin + palVersion := $0300; + palNumEntries := 1; + with palPalEntry[0] do + begin + peRed := R; + peGreen := G; + peBlue := B; + peFlags := 0; + end; + end; + FLightPalette := CreatePalette(LogPalette); + FLightBrush := CreateSolidBrush(PaletteIndex(0)); + end + else + begin + Color := RGB(R, G, B); + FLightBrush := CreateSolidBrush(Color); + end; + ReleaseDC(0, DC); +end; + +procedure TdxBarSubMenuControl.DestroyLightBrush; +begin + DeleteGDIObject(FLightBrush); + DeleteGDIObject(FLightPalette); +end; + +procedure TdxBarSubMenuControl.PreparePalette(DC: HDC); +begin + if FLightPalette <> 0 then + begin + SelectPalette(DC, FLightPalette, True); + RealizePalette(DC); + end; +end; + +procedure TdxBarSubMenuControl.UnpreparePalette(DC: HDC); +begin + if FLightPalette <> 0 then + begin + SelectPalette(DC, GetStockObject(DEFAULT_PALETTE), True); + RealizePalette(DC); + end; +end; + +procedure TdxBarSubMenuControl.ExpandMenu; +begin + if MarkExists then + begin + ShowFullMenus := True; + FShowAnimation := True; + FExpandingMenu := True; + try + DestroyWnd; + finally + FExpandingMenu := False; + end; + Left := FOnShowLeft; + Top := FOnShowTop; + Show; + end; +end; + +function TdxBarSubMenuControl.ExtendedView: Boolean; +begin + Result := BarManager.ShowRecentItemsFirst and ShowFullMenus; +end; + +procedure TdxBarSubMenuControl.InvalidateItemsRect; +begin + cxInvalidateRect(Handle, ItemsRect, False); +end; + +procedure TdxBarSubMenuControl.InvalidateDetachCaption; +var + DC: HDC; +begin + DC := GetWindowDC(Handle); + Painter.SubMenuControlDrawDetachCaption(Self, DC, DetachCaptionRect); + ReleaseDC(Handle, DC); +end; + +function TdxBarSubMenuControl.MouseOnArrow(AArrowDirection: TcxArrowDirection): Boolean; +begin + Result := PtInRect(Painter.SubMenuControlGetScrollBandBounds(Self, AArrowDirection), ScreenToClient(GetMouseCursorPos)); +end; + +function TdxBarSubMenuControl.MouseOnUpArrow: Boolean; +begin + Result := MouseOnArrow(adUp); +end; + +function TdxBarSubMenuControl.MouseOnDownArrow: Boolean; +begin + Result := MouseOnArrow(adDown); +end; + +procedure ExpandMenuTimerProc(Wnd: HWND; Msg: UINT; idEvent: UINT; Time: DWORD); stdcall; +begin + with TdxBarSubMenuControl(FindControl(Wnd)) do + begin + KillExpandMenuTimer; + if idEvent = 3 then + MarkState := msPressed + else + if ChildBar = nil then + MarkState := msSelected; + end; +end; + +procedure TdxBarSubMenuControl.SetExpandMenuTimer(Time: UINT; ExpandAfterDelay: Boolean); +begin + FExpandMenuTimer := SetTimer(Handle, 2 + Byte(ExpandAfterDelay), Time, @ExpandMenuTimerProc); +end; + +procedure TdxBarSubMenuControl.KillExpandMenuTimer; +begin + if FExpandMenuTimer <> 0 then + dxKillTimer(Handle, FExpandMenuTimer); +end; + +procedure TdxBarSubMenuControl.KillScrollTimer; +begin + if FScrollTimerID <> 0 then + dxKillTimer(Handle, FScrollTimerID); +end; + +function TdxBarSubMenuControl.IsAnimationRunning: Boolean; +begin + Result := (FAnimationThread <> nil) and not FAnimationThread.Suspended; +end; + +procedure TdxBarSubMenuControl.OnTerminateAnimation(Sender: TObject); +begin + FAnimationThread := nil; +end; + +procedure TdxBarSubMenuControl.WMGetDlgCode; +begin + Message.Result := DLGC_WANTALLKEYS or DLGC_WANTARROWS or DLGC_WANTTAB; +end; + +procedure TdxBarSubMenuControl.WMKeyDown(var Message: TWMKeyDown); +var + Shift: TShiftState; + ParentBarControl: TCustomdxBarControl; + ALinkSelf: TcxObjectLink; +begin + TerminateAnimation; + + Shift := KeyDataToShiftState(Message.KeyData); + if (Message.CharCode in [VK_DOWN, VK_TAB]) and MarkExists then + if (Message.CharCode = VK_DOWN) and (Shift = [ssCtrl]) then + begin + MarkState := msPressed; + Exit; + end + else + if (Shift = []) and (SelectedControl <> nil) then + with SelectedControl.ItemLink do + if VisibleIndex = Owner.VisibleItemCount - 1 then + begin + MarkState := msPressed; + SendMessage(Handle, WM_KEYDOWN, Message.CharCode, 1); + Exit; + end; + + ALinkSelf := cxAddObjectLink(Self); + try + inherited; + if (ALinkSelf.Ref <> nil) and (ActiveBarControl <> nil) and not SelectedItemWantsKey(Message.CharCode) then + with Message do + begin + case CharCode of + VK_ESCAPE: + if (ParentBar <> nil) and (ParentBar.SelectedControl <> nil) then + begin + ClosedByEscape := True; + ParentBarControl := ParentBar; + ParentBarControl.SelectedControl.ControlInactivate(True); + ParentBarControl.IsDowned := False; + end + else + HideByEscape; + VK_LEFT: + begin + ParentBarControl := ParentBar; + if (ParentBarControl <> nil) and (ParentBarControl.SelectedControl <> nil) then + if ParentBarControl is TdxBarSubMenuControl then + ParentBarControl.SelectedControl.ControlInactivate(True) + else + begin + ParentBarControl := GetParentBarForBar(Self); + if ParentBarControl <> nil then + if ParentBarControl.IsRealVertical then + Message.Result := SendMessage(Handle, WM_KEYDOWN, VK_ESCAPE, 0) + else + Message.Result := SendMessage(ParentBarControl.Handle, + WM_KEYDOWN, VK_LEFT, 0); + end; + end; + VK_RIGHT: + begin + ParentBarControl := GetParentBarForBar(Self); + if ParentBarControl <> nil then + Message.Result := SendMessage(ParentBarControl.Handle, + WM_KEYDOWN, VK_RIGHT, 0); + end; + VK_RETURN: + if SelectedControl <> nil then SelectedControl.Click(False); + end; + end; + finally + cxRemoveObjectLink(ALinkSelf); + end; +end; + +procedure TdxBarSubMenuControl.WMLButtonDown(var Message: TWMLButtonDown); +begin + if FScrollTimerId <> 0 then Exit; + inherited; + if not BarControlExists(Self) then Exit; + if FIgnoreMouseClick then Exit; + TerminateAnimation; + if DetachCaptionSelected then + DoDetachMenu + else + if MarkExists and MouseOnMark then + if MarkState = msNone then + begin + SetKeySelectedItem(nil); + MarkState := msSelected; + end + else + begin + FIgnoreMouseClick := True; + MarkState := msPressed; + end; +end; + +procedure TdxBarSubMenuControl.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + inherited; + with Message.CalcSize_Params^ do + rgrc[0] := cxRectContent(rgrc[0], GetClientOffset); +end; + +procedure TdxBarSubMenuControl.WMNCHitTest(var Message: TWMNCHitTest); +var + ADetachCaptionRect: TRect; +begin + if Detachable then + begin + ADetachCaptionRect := cxRectOffset(DetachCaptionRect, Left, Top); + if PtInRect(ADetachCaptionRect, SmallPointToPoint(Message.Pos)) then + Message.Result := HTCLIENT + else + inherited; + end + else + inherited; +end; + +procedure TdxBarSubMenuControl.WMPrint(var Message: TMessage); +begin + inherited; + NCPaint(Message.WParam); +end; + +procedure TdxBarSubMenuControl.WMPrintClient(var Message: TMessage); +begin + inherited; + PaintWindow(Message.WParam); +end; + +procedure TdxBarSubMenuControl.WMRButtonDown(var Message: TWMRButtonUp); +begin + inherited; + if IsContextMenu then + with TMessage(Message) do + SendMessage(Handle, WM_LBUTTONDOWN, WParam, LParam); +end; + +procedure TdxBarSubMenuControl.WMRButtonUp(var Message: TWMRButtonUp); +begin + inherited; + if IsContextMenu then + with TMessage(Message) do + SendMessage(Handle, WM_LBUTTONUP, WParam, LParam); +end; + +procedure TdxBarSubMenuControl.WMTimer(var Message: TWMTimer); + + procedure EndScrollingSubMenu; + var + P: TPoint; + begin + KillScrollTimer; + FLastMousePos := cxInvalidPoint; + P := GetMouseCursorPos; + if BarManager.Dragging then + begin + Windows.ScreenToClient(BarManager.Owner.Handle, P); //#DG + PostMessage(BarManager.Owner.Handle, WM_MOUSEMOVE, 0, MakeLParam(P.X, P.Y)); //#DG + end + else + begin + Windows.ScreenToClient(Handle, P); + SendMessage(Handle, WM_MOUSEMOVE, 0, MakeLParam(P.X, P.Y)); + end; + end; + +begin + if UpArrowExists and MouseOnUpArrow then + TopIndex := TopIndex - 1 + else + if DownArrowExists and MouseOnDownArrow then + TopIndex := TopIndex + 1 + else + EndScrollingSubMenu; +end; + +procedure TdxBarSubMenuControl.CMFontChanged(var Message: TMessage); +begin + inherited; + Canvas.Font := Font; + CalcDrawingConsts; +end; + +procedure TdxBarSubMenuControl.AdjustHintWindowPosition(var APos: TPoint; const ABoundsRect: TRect; AHeight: Integer); +begin + APos.Y := ABoundsRect.Bottom + HintOffset; + if GetDesktopWorkArea(APos).Bottom - APos.Y < AHeight then + APos.Y := ABoundsRect.Top - AHeight - HintOffset; +end; + +procedure TdxBarSubMenuControl.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + begin + Style := WS_CLIPCHILDREN or WS_CLIPSIBLINGS or WS_POPUP; + ExStyle := ExStyle or WS_EX_TOPMOST; + WindowClass.Style := + CS_DBLCLKS or CS_HREDRAW or CS_VREDRAW or CS_OWNDC or CS_SAVEBITS; + if ParentWnd > 0 then + WndParent := ParentWnd + else + WndParent := BarManager.Owner.Handle; + end; +end; + +procedure TdxBarSubMenuControl.CreateWnd; +var + AChangeXDirection, AChangeYDirection: Boolean; + AAnimationInfo: TdxBarAnimationInfo; +begin + //ProcessPaintMessages; - destroys submenu because of PeekMessage + CreateLightBrush; + inherited CreateWnd; + FOnShowLeft := Left; + FOnShowTop := Top; + IsActive := True; + SetRecentItemCount; + FTopIndex := -1; + TopIndex := 0; + SetSizeAndCheckBounds(cxNullSize, AChangeXDirection, AChangeYDirection); +// PlaySound(psMenuPopup); + if FShowAnimation then + with AAnimationInfo do + begin + RealLeft := Left; + RealTop := Top; + RealClientWidth := ClientWidth; + RealClientHeight := ClientHeight; + BorderWidth := Width - ClientWidth; + BorderHeight := Height - ClientHeight; + LeftDirection := ((FXDirection = xdLeft) and not AChangeXDirection) or + ((FXDirection = xdRight) and AChangeXDirection); + TopDirection := ((FYDirection = ydTop) and not AChangeYDirection) or + ((FYDirection = ydBottom) and AChangeYDirection); + AnimationType := FMenuAnimations; + case AnimationType of + maUnfold: + begin + FirstValue := ClientHeight - ClientWidth; + if FirstValue > 0 then + begin + OldClientRect := Rect(0, 0, 0, FirstValue); + Delta := ClientWidth; + end + else + begin + OldClientRect := Rect(0, 0, -FirstValue, 0); + Delta := ClientHeight; + end; + Step := 8; + end; + maSlide: + begin + FirstValue := 0; + OldClientRect := Rect(0, 0, ClientWidth, 0); + Delta := ClientHeight; + Step := 17; + end; + else + begin + FirstValue := 0; + Delta := 128; + Step := 1; + end; + end; + AnimationMenu := Self; + + FAnimationThread := TdxBarAnimationThread.Create(AAnimationInfo); + FAnimationThread.OnTerminate := OnTerminateAnimation; + FAnimationThread.Resume; + end; + + PlaySound(psMenuPopup); +end; + +procedure TdxBarSubMenuControl.DestroyWindowHandle; +begin + if BarManager.Dragging and (BarManager.DraggingItemLink <> nil) and + (ItemLinks.IndexOf(BarManager.DraggingItemLink) > -1) and + (BarManager.DragInfo.DraggingItemLinkParentHandle = 0) then + begin + BarManager.DragInfo.DraggingItemLinkParentHandle := WindowHandle; + Perform(WM_DESTROY, 0, 0); + SetWindowLong(WindowHandle, GWL_WNDPROC, Longint(DefWndProc)); + ShowWindow(WindowHandle, SW_HIDE); + DestroyControls; + WindowHandle := 0; + end + else inherited; +end; + +procedure TdxBarSubMenuControl.DestroyWnd; +begin + if not HandleAllocated or (bsDestroyingWindow in FState) then + Exit; + Include(FState, bsDestroyingWindow); + try + TerminateAnimation; + KillScrollTimer; + KillExpandMenuTimer; + //#DG if (ChildBar <> nil) and not ChildBar.FDestroyFlag and + if ChildBar <> nil then + ChildBar.DestroyWnd; + if not FExpandingMenu then + IsActive := False; + inherited DestroyWnd; + // ProcessPaintMessages; + DoCloseUp; + DestroyLightBrush; + finally + Exclude(FState, bsDestroyingWindow); + end; +end; + +procedure TdxBarSubMenuControl.DoCloseUp; +begin + CallNotify(FOnCloseUp, Self); +end; + +procedure TdxBarSubMenuControl.DoPopup; +begin + CallNotify(FOnPopup, Self); +end; + +procedure TdxBarSubMenuControl.Paint; +begin + if IsAnimationRunning or IsDestroying then + Exit; + + Canvas.SaveClipRegion; + try + SelectClipRgn(Canvas.Handle, 0); // because of CS_OWNDC + Painter.SubMenuControlDrawClientBorder(Self, Canvas.Handle, ClientRect, ToolbarBrush); + DrawContent; + DrawBar; + finally + Canvas.RestoreClipRegion; + end; +end; + +procedure TdxBarSubMenuControl.NCPaint(ADC: HDC); +begin + DoNCPaint(ADC, NCRect); +end; + +procedure TdxBarSubMenuControl.CalcControlsPositions; +begin + inherited; + CalcItemRects(ptMenu, TopIndex); + CalcLayout; +end; + +procedure TdxBarSubMenuControl.CalcDrawingConsts; +begin + inherited CalcDrawingConsts; + Painter.SubMenuControlCalcDrawingConsts(Canvas, FTextSize, FMenuArrowWidth, FMarkSize); +end; + +procedure TdxBarSubMenuControl.CalcDragOverParameters(const ACursorPos: TPoint; + var ADragOverItemLink: TdxBarItemLink; + var AIsBeginGroup, AIsFirstPart, AIsVerticalDirection: Boolean); +begin + if not (UpArrowExists and MouseOnUpArrow or + DownArrowExists and MouseOnDownArrow or + MarkExists and MouseOnMark) then + inherited CalcDragOverParameters(ACursorPos, ADragOverItemLink, AIsBeginGroup, AIsFirstPart, AIsVerticalDirection); +end; + +procedure TdxBarSubMenuControl.CalcItemsRect; +var + AOffset: TRect; +begin + AOffset := GetItemsRectOffset; + FItemsRect := Rect( + AOffset.Left, + AOffset.Top, + ClientWidth - AOffset.Right, + ClientHeight - AOffset.Bottom - GetMarkSize); +end; + +function TdxBarSubMenuControl.CanActiveChange: Boolean; +begin + Result := True; +end; + +function TdxBarSubMenuControl.CanCustomizing: Boolean; +begin + Result := inherited CanCustomizing or + (ItemLinks.Owner is TdxBarSubItem) and TdxBarSubItem(ItemLinks.Owner).AllowCustomizing or + (ItemLinks.Owner is TdxBarCustomPopupMenu); +end; + +function TdxBarSubMenuControl.CanDrawClippedItem(AItemRect: TRect): Boolean; +begin + Result := AItemRect.Top < Painter.SubMenuControlGetScrollBandBounds(Self, adDown).Top; +end; + +function TdxBarSubMenuControl.CanShowHint: Boolean; +begin + Result := bboAllowShowHints in BehaviorOptions; +end; + +function TdxBarSubMenuControl.CheckLockUpdate: Boolean; +begin + Result := inherited CheckLockUpdate; + if Result and + ((BarManager.FChangedSubMenuControl = nil) or IsChildBar(BarManager.FChangedSubMenuControl)) then + BarManager.FChangedSubMenuControl := Self; +end; + +function TdxBarSubMenuControl.ChildrenHaveShadows: Boolean; +begin + Result := False; +end; + +procedure TdxBarSubMenuControl.CorrectVisibleItemsRectBottom; +begin + if UseScrollButtons and DownArrowExists then + Dec(FVisibleItemsRect.Bottom, Painter.SubMenuControlGetScrollBandSize(Self)); +end; + +procedure TdxBarSubMenuControl.CorrectVisibleItemsRectTop; +begin + if UseScrollButtons and UpArrowExists then + Inc(FVisibleItemsRect.Top, Painter.SubMenuControlGetScrollBandSize(Self)); +end; + +procedure TdxBarSubMenuControl.DoCreateControls; +begin + if not IsCustomizing then + ExpandContainerItems; + inherited DoCreateControls; +end; + +procedure TdxBarSubMenuControl.DoDestroyControls; +begin + inherited DoDestroyControls; + if not IsCustomizing then + CollapseContainerItems; +end; + +procedure TdxBarSubMenuControl.DoBarMouseLeave; +begin + DetachCaptionSelected := False; + if UpArrowExists or DownArrowExists then + DrawScrollArea; + inherited; +end; + +procedure TdxBarSubMenuControl.DoBarMouseMove(Shift: TShiftState; const APoint: TPoint; + AItemControl: TdxBarItemControl); +begin + if not NotHandleMouseMove then + begin + TerminateAnimation; + if not BarControlExists(Self) then Exit; + end + else + if IsAnimationRunning then + Exit; + + if WantMouse and (ParentBar <> nil) and (ParentItemControl <> nil) then + ParentBar.SetMouseSelectedItem(ParentItemControl); + if Detachable then + DetachCaptionSelected := MouseOnDetachCaption; + if MarkExists then + if MouseOnMark then + MarkState := msSelected + else + MarkState := msNone; + if UpArrowExists and MouseOnUpArrow or DownArrowExists and MouseOnDownArrow then + begin + if (FScrollTimerId = 0) and not cxPointIsEqual(FLastMousePos, ClientToScreen(APoint)) then + begin + //#DG + if SelectedControl = BarManager.SelectedItem then + BarManager.InternalSetSelectedItem(nil); // otherwise BarManager will hide all + SetKeySelectedItem(nil); + FScrollTimerId := SetTimer(Handle, 1, GetScrollTime, nil); + end; + end + else + begin + if (FScrollTimerId <> 0) and dxKillTimer(Handle, FScrollTimerId) then + begin + FLastMousePos := cxInvalidPoint; + DrawScrollArea; + end; + inherited; + end; +end; + +procedure TdxBarSubMenuControl.DoNCPaint(DC: HDC; const ARect: TRect); +begin + Painter.SubMenuControlDrawBorder(Self, DC, ARect); +end; + +procedure TdxBarSubMenuControl.DoHideAll; +begin + if ParentBar = nil then + begin + ChildBar := nil; + Hide; + ProcessPaintMessages; + end + else + inherited; +end; + +procedure TdxBarSubMenuControl.DoPaintItem(AControl: TdxBarItemControl; ACanvas: TcxCanvas; const AItemRect: TRect); +var + ASeparatorIndex: Integer; + ANonRecent: Boolean; +begin + if IsRectEmpty(AItemRect) then + Exit; + ANonRecent := not Painter.IgnoreNonRecentColor and AControl.FNonRecent; + if ANonRecent then + begin + PreparePalette(ACanvas.Handle); + FBkBrush := FLightBrush; + end + else + Painter.SubMenuControlPrepareBkBrush(Self, FBkBrush); + + if ViewInfo.IsAssociatedWithSeparator(AControl, ASeparatorIndex) then + Painter.SubMenuControlDrawBeginGroup(Self, AControl, ACanvas, + ViewInfo.SeparatorInfos[ASeparatorIndex].Bounds); + + Painter.SubMenuControlDrawItemFrame(Self, AControl, ACanvas.Handle, AItemRect, AControl.ItemLink.VisibleIndex); + + inherited DoPaintItem(AControl, ACanvas, AItemRect); + + if ANonRecent then + UnpreparePalette(ACanvas.Handle); +end; + +procedure TdxBarSubMenuControl.DoRepaintBar(ARecreateControls: Boolean); +var + AWasVisible, AChangeXDirection, AChangeYDirection, NeedRepaint: Boolean; + PrevTopIndex: Integer; +begin + AWasVisible := IsWindowVisible(Handle); + + inherited DoRepaintBar(ARecreateControls); + + SetRecentItemCount; + if (Left <> FOnShowLeft) or (Top <> FOnShowTop) then + begin + ShowWindow(Handle, SW_HIDE); + Left := FOnShowLeft; + Top := FOnShowTop; + NeedRepaint := False; + end + else + NeedRepaint := True; + SetSizeAndCheckBounds(cxNullSize, AChangeXDirection, AChangeYDirection); + CalcControlsPositions; + + if UpArrowExists and not DownArrowExists then + begin + PrevTopIndex := FTopIndex; + repeat + Dec(FTopIndex); + CalcControlsPositions; + until DownArrowExists or (FTopIndex = 0); + if DownArrowExists then Inc(FTopIndex); + NeedRepaint := NeedRepaint or (FTopIndex <> PrevTopIndex); + end; + + if AWasVisible then Show; + if NeedRepaint then + begin + CalcControlsPositions; + Invalidate; + end; +end; + +procedure TdxBarSubMenuControl.DoSetIsActive(AValue: Boolean); +begin + inherited; + if not BarControlExists(Self) then Exit; + if IsActive and + BarManager.ShowRecentItemsFirst and not ShowFullMenus and + BarManager.ShowFullMenusAfterDelay then + SetExpandMenuTimer(dxBarSlowExpandMenuTime, True); +end; + +procedure TdxBarSubMenuControl.DragOver(X, Y: Integer; var Accept: Boolean); +begin + SendMessage(Handle, WM_MOUSEMOVE, 0, MakeLParam(X, Y)); + if FScrollTimerID > 0 then + Accept := False; +end; + +function TdxBarSubMenuControl.ChangeSizeByChildItemControl( + out ASize: TSize): Boolean; +begin + ASize := cxNullSize; + Result := False; +end; + +function TdxBarSubMenuControl.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxBarSubMenuControlAccessibilityHelper; +end; + +function TdxBarSubMenuControl.GetBeginGroupSize: Integer; +begin + Result := Painter.SubMenuControlBeginGroupSize; +end; + +function TdxBarSubMenuControl.GetBehaviorOptions: TdxBarBehaviorOptions; +begin + Result := inherited GetBehaviorOptions + + [bboAllowSelectWindowItemsWithoutFocusing, bboExtendItemWhenAlignedToClient] - + [bboMouseCantUnselectNavigationItem, bboSubMenuCaptureMouse]; +end; + +function TdxBarSubMenuControl.GetBottomItemControl: TdxBarItemControl; +begin + Result := ItemLinks.VisibleItems[TopIndex + Max(MaxVisibleCount, 1) - 1].Control; +end; + +function TdxBarSubMenuControl.GetDefaultItemHeight(AItem: TdxBarItemControl): Integer; +var + AItemHeight: Integer; +begin + AItemHeight := inherited GetDefaultItemHeight(AItem); + case AItem.MenuItemSize of + misNormal: Result := AItemHeight; + else {misLarge} + if ItemLinks.ItemShowDescriptions then + Result := Trunc(AItemHeight * 2.5) +// Result := Round(AItemHeight * 2.35) + else + Result := AItemHeight * 2; + end; +end; + +function TdxBarSubMenuControl.GetEditFont: TFont; +begin + if ParentBar = nil then + if (ItemLinks.Owner is TdxBarCustomPopupMenu) and + TdxBarCustomPopupMenu(ItemLinks.Owner).UseOwnFont then + Result := TdxBarCustomPopupMenu(ItemLinks.Owner).FEditFont + else + Result := inherited GetEditFont + else + Result := ParentBar.GetEditFont; +end; + +function TdxBarSubMenuControl.GetIsContextMenu: Boolean; +begin + Result := + (OwnerWidth = 0) and (OwnerHeight = 0) or + (ParentBar is TdxBarSubMenuControl) and TdxBarSubMenuControl(ParentBar).IsContextMenu; +end; + +function TdxBarSubMenuControl.GetIsCustomizing: Boolean; +begin + if IsInternal or + (GetItemByControl(FSubItem) is TdxBarSubItem) and TdxBarSubItem(GetItemByControl(FSubItem)).IsInternal then + Result := False + else + Result := inherited GetIsCustomizing; +end; + +function TdxBarSubMenuControl.GetIsMainMenu: Boolean; +begin + Result := False; +end; + +function TdxBarSubMenuControl.GetIsStatusBar: Boolean; +begin + Result := False; +end; + +function TdxBarSubMenuControl.GetIsShadowVisible: Boolean; +begin + Result := inherited GetIsShadowVisible and not FShowAnimation; +end; + +function TdxBarSubMenuControl.GetItemControlOffset(AItemLink: TdxBarItemLink): Integer; +begin + Result := 0; + if AItemLink.Control.FChangeRecentGroup and Painter.SubMenuControlIsOffsetRecentGroupNeeded then + Inc(Result); + if AItemLink.BeginGroup and + not ((AItemLink.VisibleIndex = TopIndex) or UpArrowExists and (AItemLink.VisibleIndex = TopIndex + 1)) then + Inc(Result, BeginGroupSize); +end; + +function TdxBarSubMenuControl.GetItemRectEx(Item: TdxBarItemControl; + IsBeginGroup: Boolean): TRect; +var + AIndex: Integer; +begin + Result := inherited GetItemRectEx(Item, IsBeginGroup); + if Item <> nil then + begin + if Item.FChangeRecentGroup and + Painter.SubMenuControlIsOffsetRecentGroupNeeded then + Dec(Result.Top); + if IsBeginGroup and Item.ItemLink.BeginGroup then + begin + AIndex := Item.ItemLink.VisibleIndex; + if (AIndex > TopIndex) and not (UpArrowExists and (AIndex = TopIndex + 1)) then + Dec(Result.Top, BeginGroupSize); + end; + end; +end; + +function TdxBarSubMenuControl.GetItemsPaneSize: TSize; +var + I: Integer; + AItemLink: TdxBarItemLink; +begin + Result := Size(0, 0); + for I := TopIndex to ItemLinks.VisibleItemCount - 1 do + begin + AItemLink := ItemLinks.VisibleItems[I]; + Result.cx := Max(Result.cx, AItemLink.Control.Width); + Result.cy := Result.cy + GetItemControlOffset(AItemLink) + AItemLink.Control.Height; + end; + if UseScrollButtons and UpArrowExists then + Inc(Result.cy, Painter.SubMenuControlGetScrollBandSize(Self)); +end; + +function TdxBarSubMenuControl.GetPaintType: TdxBarPaintType; +begin + Result := ptMenu; +end; + +function TdxBarSubMenuControl.GetSelectableObject: TPersistent; +begin + if (ParentBar <> nil) and (ParentBar.SelectedControl <> nil) then + Result := ParentBar.SelectedControl.ItemLink + else + Result := ItemLinks.Owner; +end; + +function TdxBarSubMenuControl.GetTextSize: Integer; +begin + Result := Painter.SubMenuControlTextSize(Canvas); +end; + +function TdxBarSubMenuControl.GetTopItemControl: TdxBarItemControl; +begin + Result := ItemLinks.VisibleItems[TopIndex].Control; +end; + +function TdxBarSubMenuControl.GetViewInfoClass: TCustomdxBarControlViewInfoClass; +begin + Result := TdxBarSubMenuControlViewInfo; +end; + +procedure TdxBarSubMenuControl.HideByEscape; +begin + ClosedByEscape := True; + Hide; +end; + +function TdxBarSubMenuControl.HideOnClick: Boolean; +begin + Result := True; +end; + +function TdxBarSubMenuControl.IsInternal: Boolean; +begin + Result := (ParentBar <> nil) and (ParentBar.IsInternal); //#DG +end; + +function TdxBarSubMenuControl.IsMeaningParent(AWnd: HWND): Boolean; +begin + Result := (FOwnerControl <> nil) and (FOwnerControl.HandleAllocated) and + (AWnd = FOwnerControl.Handle); +end; + +function TdxBarSubMenuControl.IsPopup: Boolean; +begin + Result := True; +end; + +function TdxBarSubMenuControl.IsVerticalDirection: Boolean; +begin + Result := True; +end; + +function TdxBarSubMenuControl.MustFitInWorkAreaWidth: Boolean; +begin + Result := False; +end; + +function TdxBarSubMenuControl.NeedBufferedRepaint: Boolean; +begin + Result := Painter.IsNativeBackground; +end; + +function TdxBarSubMenuControl.NeedsSelectFirstItemOnDropDownByKey: Boolean; +begin + Result := True; +end; + +procedure TdxBarSubMenuControl.SetFont; +begin + if ParentBar = nil then + if ItemLinks.Owner is TdxBarCustomPopupMenu then + Font := TdxBarCustomPopupMenu(ItemLinks.Owner).Font + else + Font := BarManager.Font + else + Font := ParentBar.Font; +end; + +procedure TdxBarSubMenuControl.SetRecentItemCount; +begin + with ItemLinks do + if BarManager.ShowRecentItemsFirst and not ShowFullMenus then + RecentItemCount := MostRecentItemCount + else + RecentItemCount := -1; +end; + +procedure TdxBarSubMenuControl.SetAccelSelectedItem(AItemControl: TdxBarItemControl; ADuplicate: Boolean); +var + AHidden: Boolean; +begin + AHidden := AItemControl.ItemLink.VisibleIndex = -1; + if (BarManager.GetPaintStyle <> bmsStandard) and + AHidden and (ADuplicate or not AItemControl.IsDestroyOnClick) then + MarkState := msPressed; + inherited; +end; + +procedure TdxBarSubMenuControl.SetControlVisible(AControl: TdxBarItemControl); + + function ScrollNeeded(AScrollDirection: TcxArrowDirection): Boolean; + var + AIndex: Integer; + begin + AIndex := AControl.ItemLink.VisibleIndex; + case AScrollDirection of + adUp: + Result := (AIndex < TopVisibleItemIndex) or + (not IsRectEmpty(AControl.ItemBounds) and (AControl.ItemBounds.Top < VisibleItemsRect.Top)); + else {adDown} + Result := (AIndex > BottomVisibleItemIndex) or + (not IsRectEmpty(AControl.ItemBounds) and (AControl.ItemBounds.Bottom > VisibleItemsRect.Bottom)); + end; + end; + + procedure Scroll(AScrollDirection: TcxArrowDirection); + const + AStep: array [TcxArrowDirection] of Integer = (-1, 1, 0, 0); + begin + repeat + FTopIndex := Max(FTopIndex + AStep[AScrollDirection], 0); + CalcControlsPositions; + until not ScrollNeeded(AScrollDirection); + InvalidateItemsRect; + end; + +begin + if UpArrowExists and ScrollNeeded(adUp) then + Scroll(adUp) + else + if DownArrowExists and ScrollNeeded(adDown) then + Scroll(adDown); +end; + +procedure TdxBarSubMenuControl.SetSelectedControl(Value: TdxBarItemControl); +begin + if MarkState = msNone then + begin + KillExpandMenuTimer; + if IsActive and BarManager.ShowRecentItemsFirst and + not ShowFullMenus and BarManager.ShowFullMenusAfterDelay then + SetExpandMenuTimer(dxBarSlowExpandMenuTime, False); + end; + if (Value <> nil) and not Value.FSelectedByMouse then + SetControlVisible(Value); + inherited SetSelectedControl(Value); +end; + +procedure TdxBarSubMenuControl.SetSizeAndCheckBounds( + const APredefinedSize: TSize; + out AChangeXDirection, AChangeYDirection: Boolean); +var + ASize: TSize; + AWorkArea, ABounds: TRect; + AReturnedChangeXDirection, AReturnedChangeYDirection: Boolean; +begin + if (ParentBar = nil) or not ParentBar.CalcChildBarBounds(ABounds) then + begin + if cxSizeIsEqual(APredefinedSize, cxNullSize) then + CalcBounds(ASize) + else + ASize := APredefinedSize; + + AWorkArea := GetWorkArea(Point(Left, Top)); + AChangeXDirection := False; + AChangeYDirection := False; + + if Left + ASize.cx > AWorkArea.Right then + if OwnerWidth = 0 then + if (OwnerHeight = 0) and (Left - ASize.cx >= AWorkArea.Left) then + begin + Left := Left - ASize.cx; // for popupmenu + AChangeXDirection := True; + end + else + Left := AWorkArea.Right - ASize.cx + else + if Left - OwnerWidth - AWorkArea.Left > AWorkArea.Right - Left then + begin + Left := Left - OwnerWidth - ASize.cx; + AChangeXDirection := True; + end; + if Left < AWorkArea.Left then + if OwnerWidth = 0 then + Left := AWorkArea.Left + else + if (FXDirection = xdLeft) and + (AWorkArea.Right - (Left + ASize.cx + OwnerWidth) > Left + ASize.cx - AWorkArea.Left) then + begin + Left := Left + ASize.cx + OwnerWidth; + AChangeXDirection := True; + end; + if Left + ASize.cx > AWorkArea.Right then Left := AWorkArea.Right - ASize.cx; + if Left < AWorkArea.Left then Left := AWorkArea.Left; + if MustFitInWorkAreaWidth and (Left + ASize.cx > AWorkArea.Right) then + ASize.cx := AWorkArea.Right - Left; + + if Top + ASize.cy > AWorkArea.Bottom then + if OwnerHeight = 0 then + if (OwnerWidth = 0) and (Top - ASize.cy >= AWorkArea.Top) then // for popupmenu + begin + Top := Top - ASize.cy; + AChangeYDirection := True; + end + else + Top := AWorkArea.Bottom - ASize.cy + else + if Top - OwnerHeight - AWorkArea.Top > AWorkArea.Bottom - Top then + begin + Top := Top - OwnerHeight - ASize.cy; + AChangeYDirection := True; + end + else + ASize.cy := AWorkArea.Bottom - Top; + if Top < AWorkArea.Top then + if FYDirection = ydBottom then + if AChangeYDirection and (OwnerHeight <> 0) then + begin + ASize.cy := ASize.cy - (AWorkArea.Top - Top); + Top := AWorkArea.Top; + end + else + begin + Top := AWorkArea.Top; + if Top + ASize.cy > AWorkArea.Bottom then + ASize.cy := AWorkArea.Bottom - Top; + end + else + if (OwnerHeight <> 0) and + (AWorkArea.Bottom - (Top + ASize.cy + OwnerHeight) > Top + ASize.cy - AWorkArea.Top) then + begin + Top := Top + ASize.cy + OwnerHeight; + if Top + ASize.cy > AWorkArea.Bottom then ASize.cy := AWorkArea.Bottom - Top; + AChangeYDirection := True; + end; + ABounds := cxRectBounds(Left, Top, ASize.cx, ASize.cy); + end; + SetBounds(ABounds.Left, ABounds.Top, cxRectWidth(ABounds), cxRectHeight(ABounds)); + if not FLockChangeSizeByChildItemControl and + ChangeSizeByChildItemControl(ASize) then + begin + FLockChangeSizeByChildItemControl := True; + try + SetSizeAndCheckBounds(ASize, AReturnedChangeXDirection, + AReturnedChangeYDirection); + AChangeXDirection := AChangeXDirection xor AReturnedChangeXDirection; + AChangeYDirection := AChangeYDirection xor AReturnedChangeYDirection; + finally + FLockChangeSizeByChildItemControl := False; + end; + end; +end; + +procedure TdxBarSubMenuControl.ShowPopup(AItem: TdxBarItemControl); +begin + if not BarManager.IsCustomizing and (GetLinkByControl(AItem) <> nil) then + BarDesignController.ShowCustomCustomizePopup(BarManager, InitCustomizationPopup, Painter, Self, GetLinkByControl(AItem)) + else + if (ItemLinks.Count = 0) and (ParentBar <> nil) then + DoShowPopup(ParentBar.SelectedControlAtDesign) + else + inherited; +end; + +procedure TdxBarSubMenuControl.TerminateAnimation; +begin + if FAnimationThread <> nil then + TdxBarAnimationThread(FAnimationThread).TerminateAnimation; +end; + +procedure TdxBarSubMenuControl.UpdateItem(AControl: TdxBarItemControl); + + function GetSeparatorBounds: TRect; + var + ASeparatorIndex: Integer; + begin + if ViewInfo.IsAssociatedWithSeparator(AControl, ASeparatorIndex) then + Result := ViewInfo.SeparatorInfos[ASeparatorIndex].Bounds + else + Result := cxEmptyRect; + end; + +var + ABitmapRect: TRect; + ACanvas: TcxCanvas; + ATempCanvas: TCanvas; +begin + if CanControlPaint(AControl) then + begin + if NeedBufferedRepaint then + begin + ABitmapRect := cxRectUnion(AControl.ViewInfo.Bounds, GetSeparatorBounds); + BackgroundTempBitmap.Width := cxRectWidth(ABitmapRect); + BackgroundTempBitmap.Height := cxRectHeight(ABitmapRect); + ATempCanvas := BackgroundTempBitmap.Canvas; + end + else + ATempCanvas := Canvas.Canvas; + + ACanvas := TcxCanvas.Create(ATempCanvas); + try + if NeedBufferedRepaint then + ACanvas.WindowOrg := ABitmapRect.TopLeft; + PaintItem(ACanvas, AControl); + if NeedBufferedRepaint then + begin + Canvas.SaveClipRegion; + Canvas.ExcludeClipRect(AControl.GetNonBufferedRect); + cxBitBlt(Canvas.Handle, ACanvas.Handle, ABitmapRect, ABitmapRect.TopLeft, SRCCOPY); + Canvas.RestoreClipRegion; + end; + finally + ACanvas.Free; + end; + end; +end; + +procedure TdxBarSubMenuControl.InitCustomizationPopup(AItemLinks: TdxBarItemLinks); +begin + if ParentBar <> nil then + ParentBar.InitCustomizationPopup(AItemLinks); +end; + +function TdxBarSubMenuControl.CanDetach: Boolean; +begin + Result := Detachable and + (FSubItem.Item.GetDetachingBar <> nil) and + ((GetParentBarForBar(FSubItem.Parent) = nil) or + (GetParentBarForBar(FSubItem.Parent) <> FSubItem.Item.GetDetachingBar.Control)); +end; + +function TdxBarSubMenuControl.Detachable: Boolean; +begin + Result := (bboAllowDetach in BehaviorOptions) and (FSubItem <> nil) and FSubItem.Item.Detachable; +end; + +function TdxBarSubMenuControl.DetachCaptionAreaSize: Integer; +begin + Result := Painter.SubMenuControlDetachCaptionAreaSize(Self); +end; + +function TdxBarSubMenuControl.DetachCaptionRect: TRect; +begin + Result := NCRect; + Painter.SubMenuControlOffsetDetachCaptionRect(Self, Result); + with Result do + Bottom := Top + DetachCaptionSize; +end; + +function TdxBarSubMenuControl.MouseOnDetachCaption: Boolean; +begin + Result := PtInRect(DetachCaptionRect, cxPointOffset(GetMouseCursorPos, -Left, -Top)); +end; + +procedure TdxBarSubMenuControl.DoDetachMenu; +var + ADetachingBar: TdxBar; + ASubItem: TdxBarSubItemControl; + NonDetachableArea: TRect; + Success, Started: Boolean; + PrevP, P: TPoint; + CaptureWnd: HWND; + Msg: TMsg; + ABarCaptionAriaSize: Integer; +begin + FSubItem.Item.DoDetaching; + if not CanDetach then Exit; + ADetachingBar := FSubItem.Item.GetDetachingBar; + ASubItem := FSubItem; + + NonDetachableArea := DetachCaptionRect; + OffsetRect(NonDetachableArea, Left, Top); + InflateRect(NonDetachableArea, DetachAreaDelta, DetachAreaDelta); + + Success := False; + Started := False; + PrevP := GetMouseCursorPos; + ABarCaptionAriaSize := Painter.BarCaptionAreaSize; + + Include(BarDesignController.FDesignStates, dsKeyAlreadyProcessed); + CaptureWnd := ParentBar.Handle; + SetCapture(CaptureWnd); + try + while GetCapture = CaptureWnd do + begin + case Integer(GetMessage(Msg, 0, 0, 0)) of + -1: Break; + 0: begin + PostQuitMessage(Msg.wParam); + Break; + end; + end; + case Msg.message of + WM_KEYDOWN, WM_KEYUP: + if Msg.wParam = VK_ESCAPE then + begin + ASubItem.ControlActivate(True); + Break; + end; + WM_MOUSEMOVE: + begin + P := SmallPointToPoint(TSmallPoint(Msg.lParam)); + Windows.ClientToScreen(Msg.hwnd, P); + if (P.X <> PrevP.X) or (P.Y <> PrevP.Y) then + begin + if not Started and not PtInRect(NonDetachableArea, P) then + begin + ASubItem.ControlInactivate(True); + if ADetachingBar.DockingStyle <> dsNone then + begin + ADetachingBar.Visible := False; + ADetachingBar.DockingStyle := dsNone; + end; + if not ADetachingBar.Visible then + begin + ADetachingBar.FloatLeft := P.X - 100; + ADetachingBar.FloatTop := P.Y - ABarCaptionAriaSize div 2; + ADetachingBar.Visible := True; + end; + Started := True; + end; + if Started then + if PtInRect(NonDetachableArea, P) then + begin + ADetachingBar.Visible := False; + ASubItem.ControlActivate(True); + Break; + end + else + with ADetachingBar.Control do + SetWindowPos(Handle, + 0, P.X - Width div 2, P.Y - Painter.BarCaptionAreaSize div 2, 0, 0, + SWP_NOZORDER or SWP_NOSIZE or SWP_NOACTIVATE); + PrevP := P; + end; + end; + WM_LBUTTONUP: + begin + Success := True; + Break; + end; + else + TranslateMessage(Msg); + DispatchMessage(Msg); + end; + end; + finally + if GetCapture = CaptureWnd then ReleaseCapture; + if Started then + if Success then + ADetachingBar.BarManager.HideAll + else + ADetachingBar.Visible := False; + Exclude(BarDesignController.FDesignStates, dsKeyAlreadyProcessed); + end; +end; + +function TdxBarSubMenuControl.MarkArrowSize: Integer; +begin + Result := Painter.SubMenuControlMarkArrowSize(MarkSize); +end; + +function TdxBarSubMenuControl.MarkExists: Boolean; +begin + Result := BarManager.ShowRecentItemsFirst and + (ItemLinks.VisibleItemCount < ItemLinks.CanVisibleItemCount); +end; + +function TdxBarSubMenuControl.MarkRect: TRect; +var + AOffset: Integer; +begin + Result := ClientRect; + AOffset := Painter.SubMenuControlClientBorderSize; + with Result do + begin + Inc(Left, AOffset + BarSize); + Dec(Right, AOffset); + Dec(Bottom, AOffset); + Top := Bottom - MarkSize; + end; +end; + +procedure TdxBarSubMenuControl.SetMarkState(Value: TdxBarMarkState); +begin + if IsCustomizing or not BarManager.ShowRecentItemsFirst then Exit; + if (Value = msSelected) and (SelectedControl is TdxBarWinControl) and + TdxBarWinControl(SelectedControl).Focused then Value := msNone; + if FMarkState <> Value then + begin + FMarkState := Value; + if Value = msPressed then + ExpandMenu + else + cxInvalidateRect(Handle, MarkRect, False); + if BarManager.ShowFullMenusAfterDelay then + begin + KillExpandMenuTimer; + if (FMarkState = msSelected) and MouseOnMark then + SetExpandMenuTimer(FHintWindow.ShowHintTime, True); + end + else + if FMarkState = msSelected then + BarManager.ActivateHint(True, cxGetResourceString(@dxSBAR_EXPAND), Self) + else + BarManager.HideHint; + end; +end; + +function TdxBarSubMenuControl.DownArrowExists: Boolean; +begin + Result := (ItemLinks.VisibleItemCount - TopIndex > MaxVisibleCount) or + (ItemLinks.VisibleItemCount > 0) and (ItemLinks.VisibleItems[ItemLinks.VisibleItemCount - 1].ItemRect.Bottom > ItemsRect.Bottom); +end; + +function TdxBarSubMenuControl.GetScrollTime: Integer; +begin + if UseScrollButtons then + Result := dxBarSmoothScrollMenuTime + else + Result := dxBarScrollMenuTime; +end; + +function TdxBarSubMenuControl.UpArrowExists: Boolean; +begin + Result := TopIndex > 0; +end; + +function TdxBarSubMenuControl.UseScrollButtons: Boolean; +begin + Result := Painter.SubMenuControlUseScrollButtons; +end; + +procedure TdxBarSubMenuControl.DoCalcSize(out ASize: TSize); +begin + ASize := GetItemsPaneSize; +end; + +procedure TdxBarSubMenuControl.DoCorrectSize(var ASize: TSize); + + procedure IncByOffset(const AOffset: TRect); + begin + Inc(ASize.cx, AOffset.Left + AOffset.Right); + Inc(ASize.cy, AOffset.Top + AOffset.Bottom); + end; + +begin + IncByOffset(GetClientOffset); + IncByOffset(GetItemsRectOffset); +end; + +procedure TdxBarSubMenuControl.DoShow; +const + Shows: array[Boolean] of Integer = (0, SWP_SHOWWINDOW); +begin + if (FMenuAnimations = maFade) and Assigned(AnimateWindowProc) and + not IsWin95Or98 then + begin + ProcessPaintMessages; + AnimateWindowProc(Handle, 150, AW_BLEND); + end + else + begin + SetWindowPos(Handle, 0, 0, 0, 0, 0, + SWP_NOZORDER or SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE or + Shows[not FShowAnimation]); + ProcessPaintMessages; + end; +end; + +procedure TdxBarSubMenuControl.DrawBar; +begin + if BarManager.Designing then + FillGradientRect(Canvas.Handle, BarRect, 0, clBlue, False) + else + if GetSubMenuOwner <> nil then + GetSubMenuOwner.DoPaintBar(Canvas.Canvas, BarRect) +end; + +procedure TdxBarSubMenuControl.DrawContent; +begin + CalcControlsPositions; + + if (ItemLinks.CanVisibleItemCount > 0) or (ViewInfo.ItemControlCount > 0) then + begin + DrawScrollArea; + DrawItems; + end + else + FillBackground(Canvas.Handle, FItemsRect, ToolbarBrush, clNone, True); +end; + +procedure TdxBarSubMenuControl.DrawItems; +var + I: Integer; + AControl: TdxBarItemControl; +begin + for I := 0 to ItemLinks.VisibleItemCount - 1 do + begin + AControl := ItemLinks.VisibleItems[I].Control; + AControl.RealVisibleChanging(ViewInfo.IsItemControlVisible(AControl)); + end; + + for I := 0 to ViewInfo.ItemControlCount - 1 do + ViewInfo.ItemControlViewInfos[I].Control.FLastInRow := False; + + inherited; + + if ViewInfo.ItemControlCount > 0 then + ViewInfo.ItemControlViewInfos[ViewInfo.ItemControlCount - 1].Control.FLastInRow := True; +end; + +procedure TdxBarSubMenuControl.DrawScrollArea; + + procedure DrawBottomAreaBackground; + var + R: TRect; + AControl: TdxBarItemControl; + begin + AControl := BottomItemControl; + R := GetItemRectEx(AControl, True); + R.Top := R.Bottom; + R.Bottom := ItemsRect.Bottom; + FillBackground(Canvas.Handle, R, ToolbarItemsBrush, clNone, True); + end; + +begin + Canvas.SaveClipRegion; + try + if UpArrowExists then + Painter.SubMenuControlDrawScrollBand(Self, Canvas, adUp); + + if DownArrowExists then + Painter.SubMenuControlDrawScrollBand(Self, Canvas, adDown); + + if MarkExists then + Painter.SubMenuControlDrawMarkBand(Self, MarkRect, MarkDrawState = msSelected); + + if ItemLinks.VisibleItemCount > 0 then + DrawBottomAreaBackground; + finally + Canvas.RestoreClipRegion; + end; +end; + +procedure TdxBarSubMenuControl.FillBackground(DC: HDC; const ARect: TRect; + ABrush: HBRUSH; AColor: TColor; AIsClientArea: Boolean); +begin + BarCanvas.BeginPaint(DC); + try + FillBackgroundEx(BarCanvas, ARect, ABrush, AColor, AIsClientArea); + finally + BarCanvas.EndPaint; + end; +end; + +procedure TdxBarSubMenuControl.DoFillBackgroundEx(ACanvas: TcxCanvas; + const ARect: TRect; ABrush: HBRUSH; AColor: TColor; AIsClientArea: Boolean); +begin + Painter.SubMenuControlDrawBackground(Self, ACanvas, ARect, ABrush, AColor); +end; + +procedure TdxBarSubMenuControl.FillBackgroundEx(ACanvas: TcxCanvas; + const ARect: TRect; ABrush: HBRUSH; AColor: TColor; AIsClientArea: Boolean); +begin + ACanvas.SaveClipRegion; + try + ACanvas.SetClipRegion(TcxRegion.Create(ARect), roIntersect); + DoFillBackgroundEx(ACanvas, ARect, ABrush, AColor, AIsClientArea); + finally + ACanvas.RestoreClipRegion; + end; +end; + +function TdxBarSubMenuControl.GetBackgroundBitmap: TBitmap; +begin + Result := BarManager.Backgrounds.SubMenu; + if (ItemLinks.Owner is TdxBarCustomPopupMenu) and + not TdxBarCustomPopupMenu(ItemLinks.Owner).BackgroundBitmap.Empty then + Result := TdxBarCustomPopupMenu(ItemLinks.Owner).BackgroundBitmap; +end; + +function TdxBarSubMenuControl.GetClientOffset( + AIncludeDetachCaption: Boolean = True): TRect; +var + AOffset: Integer; +begin + AOffset := Painter.SubMenuControlNCBorderSize; + Result := Rect(AOffset, AOffset, AOffset, AOffset); + if AIncludeDetachCaption and Detachable then + Result.Top := Result.Top + DetachCaptionAreaSize; +end; + +function TdxBarSubMenuControl.GetIndent1: Integer; +begin + // WARNING: sync with TdxBarButtonControl.GetDefaultHeight + Result := Painter.SubMenuControlGetControlContentIndent(Self); +end; + +function TdxBarSubMenuControl.GetIndent2: Integer; +begin + // WARNING: sync with TdxBarButtonControl.GetDefaultHeight + if NeedShowGlyphAndCheckForItem then + begin + Result := TextSize; + Painter.CorrectButtonControlDefaultHeight(Result); + end + else + Result := 0; +end; + +function TdxBarSubMenuControl.GetItemsRectOffset: TRect; +begin + Result := Painter.SubMenuControlContentRectOffset(Self); + Result.Left := Result.Left + BarSize; +end; + +function TdxBarSubMenuControl.IsTransparent: Boolean; +begin + Result := (ItemLinks.Owner is TdxBarCustomPopupMenu) and + not TdxBarCustomPopupMenu(ItemLinks.Owner).BackgroundBitmap.Empty or + not BarManager.Backgrounds.SubMenu.Empty or Painter.IsCompoundPainting; +end; + +function TdxBarSubMenuControl.GetMouseTrackingBounds: TRect; +begin + Result := inherited GetMouseTrackingBounds; + ExtendRect(Result, GetClientOffset(False)); +end; + +procedure TdxBarSubMenuControl.Hide; +begin + if not IsDestroying then + begin + Include(FState, bsHideAll); +//#DG Destroying; + DestroyWnd; + Free; + end; +end; + +function TdxBarSubMenuControl.Kind: TdxBarKind; +begin + Result := bkSubMenu; +end; + +procedure TdxBarSubMenuControl.Show; +var + AParentBar: TCustomdxBarControl; + ARandom: Double; +begin + ClosedByEscape := False; + DoPopup; + AParentBar := GetParentBarForBar(Self); + if AParentBar <> nil then + FMenuAnimations := AParentBar.BarManager.MenuAnimations + else + FMenuAnimations := BarManager.MenuAnimations; + // prepare AMenuAnimations + if FMenuAnimations = maRandom then + begin + ARandom := Random(100); + if ARandom < 33 then + FMenuAnimations := maUnfold + else + if ARandom < 66 then + FMenuAnimations := maSlide + else + FMenuAnimations := maFade; + end; + FShowAnimation := FShowAnimation and not (FMenuAnimations in [maNone, maFade]) and + not ((ItemLinks.CanVisibleItemCount = 0) or BarManager.IsCustomizing); + DoShow; +end; + +procedure TdxBarSubMenuControlViewInfo.Calculate; + + procedure CalcSeparatorInfo(AIndex: Integer); + var + AItemLink: TdxBarItemLink; + AItemRect: TRect; + begin + AItemLink := BarControl.ItemLinks.VisibleItems[AIndex]; + AItemRect := AItemLink.Control.ViewInfo.Bounds; + if not IsRectEmpty(AItemRect) and AItemLink.BeginGroup and + (AIndex > BarControl.TopIndex) and not (BarControl.UpArrowExists and (AIndex = BarControl.TopIndex + 1)) then + AddSeparatorInfo(BarControl.Painter.SubMenuControlBeginGroupRect(BarControl, AItemLink.Control, AItemRect), skHorizontal, AItemLink.Control); + end; + +var + AItemLink: TdxBarItemLink; + I: Integer; + AVisibleItemRect: TRect; +begin + inherited Calculate; + if BarControl.ItemLinks.CanVisibleItemCount > 0 then + begin + for I := BarControl.TopVisibleItemIndex to BarControl.BottomVisibleItemIndex do + begin + AItemLink := BarControl.ItemLinks.VisibleItems[I]; + AddItemControlViewInfo(AItemLink.Control.ViewInfo); + AVisibleItemRect := BarControl.GetItemRect(AItemLink.Control); + AVisibleItemRect.Bottom := Min(BarControl.VisibleItemsRect.Bottom, AVisibleItemRect.Bottom); + IdxBarItemControlViewInfo(AItemLink.Control.ViewInfo).SetBounds(AVisibleItemRect); + CalcSeparatorInfo(I); + end; + end; +end; + +function TdxBarSubMenuControlViewInfo.GetBarControl: TdxBarSubMenuControl; +begin + Result := TdxBarSubMenuControl(FBarControl); +end; + +{ TdxBarInternalSubMenuControl } + +constructor TdxBarInternalSubMenuControl.Create(AOwner: TComponent); +begin + inherited; + FItemLinks := TdxBarSubMenuControlItemLinks.Create(BarManager, Self); + FItemLinks.Internal := True; + FItemLinks.FBarControl := Self; +end; + +destructor TdxBarInternalSubMenuControl.Destroy; +begin + FreeAndNil(FItemLinks); + inherited Destroy; +end; + +function TdxBarInternalSubMenuControl.GetIsCustomizing: Boolean; +begin + Result := False; +end; + +function TdxBarInternalSubMenuControl.IsInternal: Boolean; +begin + Result := True; +end; + +// IdxBarLinksOwner +function TdxBarInternalSubMenuControl.CanContainItem(AItem: TdxBarItem; + out AErrorText: string): Boolean; +begin + Result := True; +end; + +function TdxBarInternalSubMenuControl.CreateBarControl: TCustomdxBarControl; +begin + Result := Self; +end; + +function TdxBarInternalSubMenuControl.GetInstance: TComponent; +begin + Result := Self; +end; + +function TdxBarInternalSubMenuControl.GetItemLinks: TdxBarItemLinks; +begin + Result := FItemLinks; +end; + +{ TdxBarCustomizingPopup } +// TODO: remove to designer + +constructor TdxBarCustomizingPopup.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FShowAnimation := False; +end; + +procedure TdxBarCustomizingPopup.DoShowCustomizingPopup; +begin + BarManager.DoShowCustomizingPopup(FItemLinks) +end; + +{ TdxBarItemActionLink } + +procedure TdxBarItemActionLink.AssignClient(AClient: TObject); +begin + FClient := AClient as TdxBarItem; +end; + +function TdxBarItemActionLink.IsCaptionLinked: Boolean; +begin + Result := inherited IsCaptionLinked and + (FClient.Caption = (Action as TCustomAction).Caption); +end; + +function TdxBarItemActionLink.IsCheckedLinked: Boolean; +begin + Result := inherited IsCheckedLinked and (FClient is TdxBarButton) and + (TdxBarButton(FClient).Down = (Action as TCustomAction).Checked); +end; + +function TdxBarItemActionLink.IsEnabledLinked: Boolean; +begin + Result := inherited IsEnabledLinked and + (FClient.Enabled = (Action as TCustomAction).Enabled); +end; + +function TdxBarItemActionLink.IsHelpContextLinked: Boolean; +begin + Result := inherited IsHelpContextLinked and + (FClient.HelpContext = (Action as TCustomAction).HelpContext); +end; + +function TdxBarItemActionLink.IsHintLinked: Boolean; +begin + Result := inherited IsHintLinked and + ((FClient.Hint = (Action as TCustomAction).Hint) or FClient.IsHintFromCaption); +end; + +function TdxBarItemActionLink.IsImageIndexLinked: Boolean; +begin + Result := inherited IsImageIndexLinked and + (FClient.ActionImageIndex = (Action as TCustomAction).ImageIndex); +end; + +function TdxBarItemActionLink.IsShortCutLinked: Boolean; +begin + Result := inherited IsShortCutLinked and + (FClient.ShortCut = (Action as TCustomAction).ShortCut); +end; + +function TdxBarItemActionLink.IsVisibleLinked: Boolean; + + function GetClientVisible: TdxBarItemVisible; + begin + if FClient.IsLoading then + Result := FClient.FLoadedVisible + else + Result := FClient.Visible; + end; + +begin + Result := inherited IsVisibleLinked and + (GetClientVisible = VisibleTodxBarVisible((Action as TCustomAction).Visible)); +end; + +function TdxBarItemActionLink.IsOnExecuteLinked: Boolean; +begin + Result := inherited IsOnExecuteLinked and + (@FClient.OnClick = @Action.OnExecute); +end; + +procedure TdxBarItemActionLink.SetCaption(const Value: string); +begin + if IsCaptionLinked then FClient.Caption := Value; +end; + +procedure TdxBarItemActionLink.SetChecked(Value: Boolean); +begin + if IsCheckedLinked and (FClient is TdxBarButton) then + TdxBarButton(FClient).Down := Value; +end; + +procedure TdxBarItemActionLink.SetEnabled(Value: Boolean); +begin + if IsEnabledLinked then FClient.Enabled := Value; +end; + +procedure TdxBarItemActionLink.SetHelpContext(Value: THelpContext); +begin + if IsHelpContextLinked then FClient.HelpContext := Value; +end; + +procedure TdxBarItemActionLink.SetHint(const Value: string); +begin + if IsHintLinked then FClient.Hint := Value; +end; + +procedure TdxBarItemActionLink.SetImageIndex(Value: Integer); +begin + if IsImageIndexLinked then FClient.ActionImageIndex := Value; +end; + +procedure TdxBarItemActionLink.SetShortCut(Value: TShortCut); +begin + if IsShortCutLinked then FClient.ShortCut := Value; +end; + +procedure TdxBarItemActionLink.SetVisible(Value: Boolean); +begin + if IsVisibleLinked then FClient.Visible := VisibleTodxBarVisible(Value); +end; + +procedure TdxBarItemActionLink.SetOnExecute(Value: TNotifyEvent); +begin + if IsOnExecuteLinked then FClient.OnClick := Value; +end; + +{ TdxBarItemStylesData } + +constructor TdxBarItemStylesData.Create(AStyleCount: Integer); +var + I: Integer; +begin + inherited Create(nil); + FStyleCount := AStyleCount; + SetLength(FStylesData, AStyleCount); + for I := 0 to AStyleCount - 1 do + begin + FStylesData[I].AssignedValues := []; + FStylesData[I].Style := nil; + end; +end; + +destructor TdxBarItemStylesData.Destroy; +var + I: Integer; +begin + FIsDestroying := True; + for I := 0 to StyleCount - 1 do + Styles[I] := nil; + inherited Destroy; +end; + +procedure TdxBarItemStylesData.StyleChanged(AStyle: TcxCustomStyle); +begin + InternalStyleChanged(TcxStyle(AStyle)); +end; + +procedure TdxBarItemStylesData.StyleRemoved(AStyle: TcxCustomStyle); +begin + InternalStyleRemoved(TcxStyle(AStyle)); +end; + +procedure TdxBarItemStylesData.DoChange(AChangeKind: TdxBarItemStyleChangeKind); +begin + if IsChangeEventLocked then + begin + if (AChangeKind <> FChangeKind) and (FChangeKind in [sckNone, sckDrawing]) then + FChangeKind := AChangeKind; + end + else + if Assigned(FOnChange) then + FOnChange(AChangeKind); +end; + +function TdxBarItemStylesData.GetStyle(AIndex: Integer): TcxStyle; +begin + Result := FStylesData[AIndex].Style; +end; + +function TdxBarItemStylesData.GetStyleReferenceCount(AStyle: TcxStyle): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to StyleCount - 1 do + if Styles[I] = AStyle then + Inc(Result); +end; + +procedure TdxBarItemStylesData.InternalSetStyle(AIndex: Integer; Value: TcxStyle); +begin + FStylesData[AIndex].Style := Value; +end; + +procedure TdxBarItemStylesData.InternalStyleChanged(AIndex: Integer); + + procedure GetFontData(AFont: TFont; out AFontData: TFontData); + begin + AFontData.Height := AFont.Height; + {$IFDEF DELPHI9} + AFontData.Orientation := AFont.Orientation; + {$ENDIF} + AFontData.Pitch := AFont.Pitch; + AFontData.Style := AFont.Style; + AFontData.Charset := AFont.Charset; + AFontData.Name := AFont.Name; + end; + + function IsFontChanged(const APrevFontData: TFontData; AFont: TFont): Boolean; + begin + Result := (APrevFontData.Height <> AFont.Height){$IFDEF DELPHI9} or + (APrevFontData.Orientation <> AFont.Orientation){$ENDIF} or + (APrevFontData.Pitch <> AFont.Pitch) or + (APrevFontData.Style <> AFont.Style) or + (APrevFontData.Charset <> AFont.Charset) or + (APrevFontData.Name <> AFont.Name); + end; + +var + AAssignedValues1, AAssignedValues2: TcxStyleValues; + AColorChanged, AFontChanged, ATextColorChanged: Boolean; + AStyle: TcxStyle; +begin + if IsDestroying then + Exit; + + AStyle := Styles[AIndex]; + AAssignedValues1 := FStylesData[AIndex].AssignedValues; + AAssignedValues2 := []; + if AStyle <> nil then + AAssignedValues2 := AStyle.AssignedValues; + + AColorChanged := not (not (svColor in AAssignedValues1) and not (svColor in AAssignedValues2)); + if AColorChanged and (svColor in AAssignedValues1) and (svColor in AAssignedValues2) then + AColorChanged := ColorToRGB(FStylesData[AIndex].Color) <> ColorToRGB(AStyle.Color); + + AFontChanged := not (not (svFont in AAssignedValues1) and not (svFont in AAssignedValues2)); + if AFontChanged and (svFont in AAssignedValues1) and (svFont in AAssignedValues2) then + AFontChanged := IsFontChanged(FStylesData[AIndex].FontData, AStyle.Font); + + ATextColorChanged := not (not (svTextColor in AAssignedValues1) and not (svTextColor in AAssignedValues2)); + if ATextColorChanged and (svTextColor in AAssignedValues1) and (svTextColor in AAssignedValues2) then + ATextColorChanged := ColorToRGB(FStylesData[AIndex].TextColor) <> ColorToRGB(AStyle.TextColor); + + FStylesData[AIndex].AssignedValues := AAssignedValues2; + if svColor in AAssignedValues2 then + FStylesData[AIndex].Color := AStyle.Color; + if svFont in AAssignedValues2 then + GetFontData(AStyle.Font, FStylesData[AIndex].FontData); + if svTextColor in AAssignedValues2 then + FStylesData[AIndex].TextColor := AStyle.TextColor; + + if AFontChanged then + DoChange(sckStructure) + else + if AColorChanged or ATextColorChanged then + DoChange(sckDrawing); +end; + +procedure TdxBarItemStylesData.InternalStyleChanged(AStyle: TcxStyle); +var + I: Integer; +begin + LockChangeEvent(True); + try + for I := 0 to StyleCount - 1 do + if Styles[I] = AStyle then + InternalStyleChanged(I); + finally + LockChangeEvent(False); + end; +end; + +procedure TdxBarItemStylesData.InternalStyleRemoved(AStyle: TcxStyle); +var + I: Integer; +begin + LockChangeEvent(True); + try + for I := 0 to StyleCount - 1 do + if Styles[I] = AStyle then + Styles[I] := nil; + finally + LockChangeEvent(False); + end; +end; + +function TdxBarItemStylesData.IsChangeEventLocked: Boolean; +begin + Result := FChangeEventLockCount > 0; +end; + +procedure TdxBarItemStylesData.LockChangeEvent(ALock: Boolean); +begin + if ALock then + begin + if FChangeEventLockCount = 0 then + FChangeKind := sckNone; + Inc(FChangeEventLockCount); + end + else + begin + Dec(FChangeEventLockCount); + if (FChangeEventLockCount = 0) and (FChangeKind <> sckNone) then + DoChange(FChangeKind); + end; +end; + +procedure TdxBarItemStylesData.SetStyle(AIndex: Integer; Value: TcxStyle); +var + AStyleValue: TcxStyle; +begin + AStyleValue := Styles[AIndex]; + if Value <> AStyleValue then + begin + InternalSetStyle(AIndex, Value); + if (AStyleValue <> nil) and (GetStyleReferenceCount(AStyleValue) = 0) then + AStyleValue.RemoveListener(Self); + if (Value <> nil) and (GetStyleReferenceCount(Value) = 1) then + Value.AddListener(Self); + InternalStyleChanged(AIndex); + end; +end; + +{ TdxBarCustomScreenTipBand } + +constructor TdxBarCustomScreenTipBand.Create(ABandType: TdxBarScreenTipBandType); +begin + inherited Create; + FBandType := ABandType; + FGlyph := TBitmap.Create; + FGlyph.Transparent := True; + FTextAlign := stbtaRight; +end; + +destructor TdxBarCustomScreenTipBand.Destroy; +begin + FreeAndNil(FGlyph); + inherited Destroy; +end; + +procedure TdxBarCustomScreenTipBand.Assign(Source: TPersistent); +begin + if Source is TdxBarScreenTipBand then + begin + Text := TdxBarScreenTipBand(Source).Text; + TextAlign := TdxBarScreenTipBand(Source).TextAlign; + Glyph := TdxBarScreenTipBand(Source).Glyph; + end + else + inherited; +end; + +procedure TdxBarCustomScreenTipBand.Changed; +begin + if Assigned(FOnChange) then + FOnChange(Self); +end; + +function TdxBarCustomScreenTipBand.IsVisible(const AHintText: string): Boolean; +begin + Result := (Text <> '') or not Glyph.Empty; + if not Result and (BandType = stbHeader) then + Result := AHintText <> ''; +end; + +procedure TdxBarCustomScreenTipBand.SetGlyph(Value: TBitmap); +begin + FGlyph.Assign(Value); + Changed; +end; + +procedure TdxBarCustomScreenTipBand.SetText(const Value: string); +begin + if FText <> Value then + begin + FText := Value; + Changed; + end; +end; + +procedure TdxBarCustomScreenTipBand.SetTextAlign(Value: TdxBarScreenTipBandTextAlign); +begin + if FTextAlign <> Value then + begin + FTextAlign := Value; + Changed; + end; +end; + +{ TdxBarScreenTipBand } + +constructor TdxBarScreenTipBand.Create(AScreenTip: TdxBarScreenTip; + ABandType: TdxBarScreenTipBandType); +begin + inherited Create(ABandType); + FScreenTip := AScreenTip; +end; + +function TdxBarScreenTipBand.GetFont: TFont; +begin + Result := ScreenTip.Collection.Repository.GetBandFont(BandType); +end; + +{ TdxBarScreenTipFooterBand } + +constructor TdxBarScreenTipFooterBand.Create( + ARepository: TdxBarScreenTipRepository); +begin + inherited Create(stbFooter); + FRepository := ARepository; +end; + +function TdxBarScreenTipFooterBand.GetFont: TFont; +begin + Result := Repository.GetBandFont(BandType); +end; + +{ TdxBarScreenTip } + +constructor TdxBarScreenTip.Create(AOwner: TComponent); +var + I: TdxBarScreenTipBandType; +begin + inherited Create(AOwner); + for I := Low(TdxBarScreenTipBandType) to High(TdxBarScreenTipBandType) do + FBands[I] := TdxBarScreenTipBand.Create(Self, I); +end; + +destructor TdxBarScreenTip.Destroy; +var + I: TdxBarScreenTipBandType; +begin + for I := Low(TdxBarScreenTipBandType) to High(TdxBarScreenTipBandType) do + FreeAndNil(FBands[I]); + inherited Destroy; +end; + +procedure TdxBarScreenTip.Assign(Source: TPersistent); +begin + if Source is TdxBarScreenTip then + begin + Header := TdxBarScreenTip(Source).Header; + Description := TdxBarScreenTip(Source).Description; + Footer := TdxBarScreenTip(Source).Footer; + UseHintAsHeader := TdxBarScreenTip(Source).UseHintAsHeader; + UseStandardFooter := TdxBarScreenTip(Source).UseStandardFooter; + Width := TdxBarScreenTip(Source).Width; + end + else + inherited; +end; + +function TdxBarScreenTip.GetCollectionFromParent(AParent: TComponent): TcxComponentCollection; +begin + Result := (AParent as TdxBarScreenTipRepository).Items; +end; + +function TdxBarScreenTip.GetDisplayName: string; +begin + Result := Format('%s - ''%s''', [Name, Header.Text]); +end; + +function TdxBarScreenTip.GetWidth: Integer; +begin + Result := Width; + if Result = 0 then + begin + if not Description.Glyph.Empty then + Result := WidthToCurrentDpi(318) + else + Result := WidthToCurrentDpi(210); + end; +end; + +procedure TdxBarScreenTip.SetName(const Value: TComponentName); +var + AChangeText: Boolean; +begin + AChangeText := not (csLoading in ComponentState) and (Name = Header.Text) and + ((Owner = nil) or not (Owner is TControl) or + not (csLoading in TControl(Owner).ComponentState)); + inherited SetName(Value); + if AChangeText then + Header.Text := Value; +end; + +function TdxBarScreenTip.GetBandForCalculation( + Index: TdxBarScreenTipBandType): TdxBarCustomScreenTipBand; +begin + if FUseStandardFooter and (Index = stbFooter) then + Result := Collection.Repository.StandardFooter + else + Result := GetBand(Ord(Index)); +end; + +function TdxBarScreenTip.GetCollection: TdxBarScreenTipCollection; +begin + Result := TdxBarScreenTipCollection(inherited Collection); +end; + +function TdxBarScreenTip.GetBand(Index: Integer): TdxBarScreenTipBand; +begin + Result := FBands[TdxBarScreenTipBandType(Index)]; +end; + +procedure TdxBarScreenTip.SetBand(Index: Integer; Value: TdxBarScreenTipBand); +begin + FBands[TdxBarScreenTipBandType(Index)].Assign(Value); +end; + +{ TdxBarScreenTipCollection } + +constructor TdxBarScreenTipCollection.Create(AParentComponent: TComponent; AItemClass: TcxComponentCollectionItemClass); +begin + inherited Create(AParentComponent, AItemClass); + FRepository := TdxBarScreenTipRepository(AParentComponent); +end; + +function TdxBarScreenTipCollection.Add: TdxBarScreenTip; +begin + Result := TdxBarScreenTip(inherited Add); +end; + +procedure TdxBarScreenTipCollection.SetItemName(AItem: TcxComponentCollectionItem); +begin + AItem.Name := CreateUniqueName(ParentComponent.Owner, ParentComponent, AItem, + 'TdxBar', ''); +end; + +procedure TdxBarScreenTipCollection.UpdateFonts; +begin + //FHeaderFont.Assign(FBarManager.Font); + // FDescriptionFont.Assign(FBarManager.Font); + // FFooterFont.Assign(FBarManager.Font); +end; + +function TdxBarScreenTipCollection.GetItem(Index: Integer): TdxBarScreenTip; +begin + Result := TdxBarScreenTip(inherited Items[Index]); +end; + +procedure TdxBarScreenTipCollection.SetItem(Index: Integer; Value: TdxBarScreenTip); +begin + Items[Index].Assign(Value); +end; + +{ TdxBarScreenTipRepository } + +constructor TdxBarScreenTipRepository.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + CreateFonts; + FStandardFooter := TdxBarScreenTipFooterBand.Create(Self); + FItems := CreateScreenTips; + FShowDescription := True; +end; + +destructor TdxBarScreenTipRepository.Destroy; +var + I: TdxBarScreenTipBandType; +begin + FreeAndNil(FItems); + FreeAndNil(FStandardFooter); + for I := Low(TdxBarScreenTipBandType) to High(TdxBarScreenTipBandType) do + FreeAndNil(FFonts[I]); + FreeAndNil(FSystemFont); + inherited Destroy; +end; + +procedure TdxBarScreenTipRepository.Assign(Source: TPersistent); +begin + if Source is TdxBarScreenTipRepository then + begin + Items := TdxBarScreenTipRepository(Source).Items; + StandardFooter := TdxBarScreenTipRepository(Source).StandardFooter; + DescriptionFont := TdxBarScreenTipRepository(Source).DescriptionFont; + FooterFont := TdxBarScreenTipRepository(Source).FooterFont; + HeaderFont := TdxBarScreenTipRepository(Source).HeaderFont; + FAssignedFonts := TdxBarScreenTipRepository(Source).AssignedFonts; + ShowDescription := TdxBarScreenTipRepository(Source).ShowDescription; + end + else + inherited Assign(Source); +end; + +function TdxBarScreenTipRepository.CreateScreenTips: TdxBarScreenTipCollection; +begin + Result := TdxBarScreenTipCollection.Create(Self, TdxBarScreenTip); +end; + +function TdxBarScreenTipRepository.GetBandFont(ABandType: TdxBarScreenTipBandType): TFont; +begin + if ABandType in AssignedFonts then + begin + case ABandType of + stbHeader: Result := HeaderFont; + stbDescription: Result := DescriptionFont; + else {stbFooter} + Result := FooterFont; + end; + end + else + Result := GetSystemFont(ABandType); +end; + +procedure TdxBarScreenTipRepository.GetChildren(Proc: TGetChildProc; Root: TComponent); +var + I: Integer; +begin + for I := 0 to Items.Count - 1 do + if Items[I].Owner = Root then Proc(Items[I]); +end; + +function TdxBarScreenTipRepository.GetFont(Index: Integer): TFont; +begin + Result := FFonts[TdxBarScreenTipBandType(Index)]; +end; + +function TdxBarScreenTipRepository.GetSystemFont(ABandType: TdxBarScreenTipBandType): TFont; +begin + Result := FSystemFont; + Result.Assign(Screen.HintFont); + Result.Color := dxBarScreenTipFontColor; + if ABandType in [stbHeader, stbFooter] then + Result.Style := Result.Style + [fsBold]; +end; + +function TdxBarScreenTipRepository.IsFontStored(Index: Integer): Boolean; +begin + Result := TdxBarScreenTipBandType(Index) in AssignedFonts; +end; + +procedure TdxBarScreenTipRepository.CreateFonts; + + function CreateFont(ABandType: TdxBarScreenTipBandType): TFont; + begin + Result := TFont.Create; + Result.Assign(Screen.HintFont); + Result.Color := dxBarScreenTipFontColor; + if ABandType in [stbHeader, stbFooter] then + Result.Style := Result.Style + [fsBold]; + Result.OnChange := FontChanged; + end; + +var + I: TdxBarScreenTipBandType; +begin + FSystemFont := TFont.Create; + for I := Low(TdxBarScreenTipBandType) to High(TdxBarScreenTipBandType) do + FFonts[I] := CreateFont(I); +end; + +procedure TdxBarScreenTipRepository.FontChanged(Sender: TObject); +var + I: TdxBarScreenTipBandType; +begin + if csLoading in ComponentState then Exit; + for I := Low(TdxBarScreenTipBandType) to High(TdxBarScreenTipBandType) do + if FFonts[I] = Sender then + Include(FAssignedFonts, I); +end; + +procedure TdxBarScreenTipRepository.SetFont(Index: Integer; Value: TFont); +begin + FFonts[TdxBarScreenTipBandType(Index)].Assign(Value); +end; + +procedure TdxBarScreenTipRepository.SetItems(AValue: TdxBarScreenTipCollection); +begin + FItems.Assign(AValue); +end; + +procedure TdxBarScreenTipRepository.SetStandardFooter(Value: TdxBarScreenTipFooterBand); +begin + FStandardFooter.Assign(Value); +end; + +{ TdxBarCustomHintViewInfo } + +constructor TdxBarCustomHintViewInfo.Create(ABarManager: TdxBarManager); +begin + inherited Create; + FBarManager := ABarManager; +end; + +function TdxBarCustomHintViewInfo.IsScreenTip: Boolean; +begin + Result := False; +end; + +procedure TdxBarCustomHintViewInfo.SetWindowDrawParams(AWindow: TdxBarHintWindow); +begin + AWindow.IsScreenTipWindow := IsScreenTip; + AWindow.HandleNeeded; +end; + +{ TdxBarHintViewInfo } + +constructor TdxBarHintViewInfo.Create(ABarManager: TdxBarManager; const AHint, AShortCut: string; const ACursorPos: TPoint); +begin + inherited Create(ABarManager); + if AHint <> '' then + FText := AHint + AShortCut; + FPos := ACursorPos; +end; + +procedure TdxBarHintViewInfo.Calculate(ACanvas: TCanvas); +var + ASize: TSize; +begin + if FText <> '' then + begin + ASize := CalculateMinSize(ACanvas); + CorrectMinSize(ASize); + BoundsRect := cxRectBounds(0, 0, ASize.cx, ASize.cy); + end + else + BoundsRect := cxEmptyRect; +end; + +procedure TdxBarHintViewInfo.Paint(ACanvas: TCanvas); +var + R: TRect; +begin + R := BoundsRect; + DrawEdge(ACanvas.Handle, R, BDR_RAISEDOUTER, BF_RECT); + DrawText(ACanvas); +end; + +procedure TdxBarHintViewInfo.CorrectMinSize(var ASize: TSize); +begin + Inc(ASize.cx, 2 * (1 + 2)); + Inc(ASize.cy, 2 * (1 + 2)); +end; + +function TdxBarHintViewInfo.GetTextRect: TRect; +begin + Result := cxRectInflate(BoundsRect, -3, -3, -1, -1); +end; + +procedure TdxBarHintViewInfo.DrawText(ACanvas: TCanvas); +var + R: TRect; +begin + R := GetTextRect; + cxDrawText(ACanvas.Handle, FText, R, DT_LEFT or DT_NOCLIP or DT_NOPREFIX or DT_WORDBREAK); +end; + +procedure TdxBarHintViewInfo.SetWindowDrawParams(AWindow: TdxBarHintWindow); +begin + inherited SetWindowDrawParams(AWindow); + AWindow.Caption := FText; + SetWindowFont(AWindow); + AWindow.Color := Application.HintColor; +end; + +procedure TdxBarHintViewInfo.SetWindowFont(AWindow: TdxBarHintWindow); +var + NonClientMetrics: TNonClientMetrics; +begin + if (BarManager <> nil) and not BarManager.UseSystemFont then + AWindow.Canvas.Font := BarManager.Font + else + begin + NonClientMetrics.cbSize := SizeOf(NonClientMetrics); + if SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, @NonClientMetrics, 0) then + AWindow.Canvas.Font.Handle := CreateFontIndirect(NonClientMetrics.lfStatusFont) + else + AWindow.Canvas.Font.Size := 8; + end; +{$IFNDEF DELPHI6} + AWindow.Canvas.Font.Color := clInfoText; +{$ELSE} + AWindow.Canvas.Font.Color := Screen.HintFont.Color; +{$ENDIF} +end; + +function TdxBarHintViewInfo.CalculateMinSize(ACanvas: TCanvas): TSize; +var + R: TRect; + AWidth: Integer; +begin + AWidth := cxRectWidth(GetWorkArea(GetMouseCursorPos)); + R := Rect(0, 0, AWidth, 0); + cxDrawText(ACanvas.Handle, FText, R, DT_CALCRECT or DT_LEFT or DT_NOPREFIX or DT_WORDBREAK); + Result := cxSize(R.Right, R.Bottom); +end; + +{ TdxBarLikeHintScreenTipViewInfo } + +procedure TdxBarLikeHintScreenTipViewInfo.CorrectMinSize(var ASize: TSize); +begin + inherited CorrectMinSize(ASize); + Inc(ASize.cx, 5); + Inc(ASize.cy, 5); +end; + +function TdxBarLikeHintScreenTipViewInfo.GetTextRect: TRect; +begin + Result := cxRectInflate(BoundsRect, -5, -6, -6, -5); +end; + +function TdxBarLikeHintScreenTipViewInfo.IsScreenTip: Boolean; +begin + Result := True; +end; + +constructor TdxBarLikeHintScreenTipViewInfo.Create(ABarManager: TdxBarManager; APainter: TdxBarPainter; + const AHint, AShortCut: string; const ACursorPos: TPoint); +begin + inherited Create(ABarManager, AHint, AShortCut, ACursorPos); + FPainter := APainter; +end; + +procedure TdxBarLikeHintScreenTipViewInfo.Paint(ACanvas: TCanvas); +begin + BarCanvas.BeginPaint(ACanvas); + try + FPainter.ScreenTipDrawBackground(BarCanvas, BoundsRect); + DrawText(ACanvas); + finally + BarCanvas.EndPaint; + end; +end; + +{ TdxBarScreenTipBandViewInfo } + +constructor TdxBarScreenTipBandViewInfo.Create(ABand: TdxBarCustomScreenTipBand; + const AHintText, AShortCut: string); +begin + inherited Create; + FBand := ABand; + FHintText := AHintText; + FShortCut := AShortCut; +end; + +procedure TdxBarScreenTipBandViewInfo.Calculate(AWidth: Integer; var ATop: Integer; AHeight: Integer; APainter: TdxBarPainter); +begin + FTop := ATop; + FWidth := AWidth; + if HasText then + begin + FTextBounds.Top := ATop + GetVertIndent(APainter); + FTextBounds.Bottom := FTextBounds.Top + FTextSize.cy; + FTextBounds.Left := GetHorzIndent; + if Band.TextAlign = stbtaRight then + begin + if HasGlyph then + Inc(FTextBounds.Left, GetAvailGlyphWidth + GetHorzIndent); + FTextBounds.Right := AWidth - GetHorzIndent; + end + else + FTextBounds.Right := FTextBounds.Left + FTextSize.cx; + end; + if HasGlyph then + begin + if FBand.BandType = stbDescription then + FGlyphBounds.Top := ATop + GetVertIndent(APainter) + else + FGlyphBounds.Top := ATop + (AHeight - FGlyphSize.cy) div 2; + FGlyphBounds.Bottom := FGlyphBounds.Top + FGlyphSize.cy; + if Band.TextAlign = stbtaRight then + begin + FGlyphBounds.Left := GetHorzIndent + (GetAvailGlyphWidth - FGlyphSize.cx) div 2; + FGlyphBounds.Right := FGlyphBounds.Left + FGlyphSize.cx; + end + else + begin + FGlyphBounds.Right := Width - (GetHorzIndent + (GetAvailGlyphWidth - FGlyphSize.cx) div 2); + FGlyphBounds.Left := FGlyphBounds.Right - FGlyphSize.cx; + end; + end; +end; + +function TdxBarScreenTipBandViewInfo.GetHeight(ACanvas: TCanvas; const AWidth: Integer; APainter: TdxBarPainter): Integer; + + function GetTextFlags: Integer; + begin + Result := DT_CALCRECT or DT_LEFT or DT_NOPREFIX; + if Band.BandType = stbDescription then + Result := Result or DT_WORDBREAK; + end; + +var + AvailWidth: Integer; + R: TRect; +begin + Result := 0; + if not (HasGlyph or HasText) then Exit; + if HasGlyph then + begin + AvailWidth := GetAvailGlyphWidth; + if Band.Glyph.Width < AvailWidth then + begin + Result := Band.Glyph.Height; + FGlyphSize.cx := Band.Glyph.Width; + end + else + begin + Result := Round(AvailWidth * Band.Glyph.Height / Band.Glyph.Width); + FGlyphSize.cx := AvailWidth; + end; + FGlyphSize.cy := Result; + end + else + FGlyphSize := cxNullSize; + if HasText then + begin + AvailWidth := AWidth; + Dec(AvailWidth, 2 * GetHorzIndent); + if HasGlyph then + Dec(AvailWidth, GetAvailGlyphWidth + GetHorzIndent); + ACanvas.Font.Assign(Band.Font); + R := cxRectBounds(0, 0, AvailWidth, 0); + cxDrawText(ACanvas.Handle, GetText, R, GetTextFlags); + FTextSize.cx := R.Right; + FTextSize.cy := R.Bottom; + end + else + FTextSize := cxNullSize; + Result := Max(FGlyphSize.cy, FTextSize.cy); + Inc(Result, 2 * GetVertIndent(APainter)); +end; + +function TdxBarScreenTipBandViewInfo.IsVisible: Boolean; +begin + Result := HasText or HasGlyph; +end; + +function TdxBarScreenTipBandViewInfo.GetAvailGlyphWidth: Integer; +begin + if Band.BandType = stbDescription then + Result := WidthToCurrentDpi(108) - GetHorzIndent + else + Result := WidthToCurrentDpi(16); +end; + +function TdxBarScreenTipBandViewInfo.GetHorzIndent: Integer; +begin + if Band.BandType = stbDescription then + Result := WidthToCurrentDpi(14) + else + Result := WidthToCurrentDpi(6); +end; + +function TdxBarScreenTipBandViewInfo.GetVertIndent(APainter: TdxBarPainter): Integer; +begin + Result := 6; + if FBand.BandType = stbFooter then + Inc(Result, APainter.ScreenTipGetFooterLineSize); + Result := WidthToCurrentDpi(Result); +end; + +function TdxBarScreenTipBandViewInfo.GetText: string; +begin + Result := Band.Text; + if Band.BandType = stbHeader then + begin + if FHintText <> '' then + Result := FHintText; + Result := Result + FShortCut; + end; +end; + +function TdxBarScreenTipBandViewInfo.HasGlyph: Boolean; +begin + Result := not FBand.FGlyph.Empty; +end; + +function TdxBarScreenTipBandViewInfo.HasText: Boolean; +begin + Result := GetText <> ''; +end; + +function TdxBarScreenTipBandViewInfo.HeightToCurrentDpi(AValue: Integer): Integer; +begin + Result := Round(AValue * VertPixelsPerInch / 96); +end; + +function TdxBarScreenTipBandViewInfo.WidthToCurrentDpi(AValue: Integer): Integer; +begin + Result := Round(AValue * HorzPixelsPerInch / 96); +end; + +function TdxBarScreenTipBandViewInfo.HorzPixelsPerInch: Integer; +begin + Result := cxGetScreenPixelsPerInch(True); +end; + +function TdxBarScreenTipBandViewInfo.VertPixelsPerInch: Integer; +begin + Result := Screen.PixelsPerInch; +end; + +procedure TdxBarScreenTipBandViewInfo.Paint(ACanvas: TcxCanvas; APainter: TdxBarPainter); + + procedure DrawTextField(const AText: string; ARect: TRect); + begin + cxDrawText(ACanvas.Handle, AText, ARect, DT_LEFT {or DT_NOCLIP} or DT_NOPREFIX or DT_WORDBREAK); + end; + +var + AColor: TColor; +begin + if HasText then + begin + ACanvas.Font.Assign(Band.Font); + if Band.BandType = stbDescription then + AColor := APainter.ScreenTipGetDescriptionTextColor + else + AColor := APainter.ScreenTipGetTitleTextColor; + if AColor <> clDefault then + ACanvas.Font.Color := AColor; + DrawTextField(GetText, TextBounds); + end; + if HasGlyph then + ACanvas.Canvas.StretchDraw(GlyphBounds, Band.Glyph); + if Band.BandType = stbFooter then + APainter.ScreenTipDrawFooterLine(ACanvas, cxRect(5, Top, Width - 5, Top + APainter.ScreenTipGetFooterLineSize)); +end; + +{ TdxBarScreenTipViewInfo } + +constructor TdxBarScreenTipViewInfo.Create(AScreenTip: TdxBarScreenTip; + APainter: TdxBarPainter; const AHintText: string; AShortCut: string = ''); +begin + inherited Create(BarManager); + FScreenTip := AScreenTip; + FPainter := APainter; + if (FScreenTip <> nil) and FScreenTip.UseHintAsHeader then + FHintText := AHintText; + FShortCut := AShortCut; +end; + +destructor TdxBarScreenTipViewInfo.Destroy; +begin + DestroyBandViewInfos; + inherited Destroy; +end; + +procedure TdxBarScreenTipViewInfo.Calculate(ACanvas: TCanvas); +var + AHeight, ATop: Integer; + ABand: TdxBarCustomScreenTipBand; + ABandViewInfo: TdxBarScreenTipBandViewInfo; + I: TdxBarScreenTipBandType; +begin + ATop := 0; + FWidth := FScreenTip.GetWidth; + DestroyBandViewInfos; + for I := Low(TdxBarScreenTipBandType) to High(TdxBarScreenTipBandType) do + begin + ABand := FScreenTip.GetBandForCalculation(I); + if ABand.IsVisible(FHintText) then + begin + ABandViewInfo := CreateBandViewInfo(ABand); + AHeight := ABandViewInfo.GetHeight(ACanvas, FWidth, FPainter); + ABandViewInfo.Calculate(FWidth, ATop, AHeight, FPainter); + Inc(ATop, AHeight); + SetLength(FBandViewInfos, Length(FBandViewInfos) + 1); + FBandViewInfos[Length(FBandViewInfos) - 1] := ABandViewInfo; + end; + end; + + FBoundsRect := Rect(0, 0, FWidth, ATop); +end; + +procedure TdxBarScreenTipViewInfo.Paint(ACanvas: TCanvas); +var + I: Integer; +begin + BarCanvas.BeginPaint(ACanvas); + try + FPainter.ScreenTipDrawBackground(BarCanvas, BoundsRect); + for I := 0 to BandViewInfosCount - 1 do + FBandViewInfos[I].Paint(BarCanvas, FPainter); + finally + BarCanvas.EndPaint; + end; +end; + +procedure TdxBarScreenTipViewInfo.DestroyBandViewInfos; +var + I: Integer; +begin + for I := 0 to BandViewInfosCount - 1 do + FreeAndNil(FBandViewInfos[I]); + FBandViewInfos := nil; +end; + +function TdxBarScreenTipViewInfo.CreateBandViewInfo( + ABand: TdxBarCustomScreenTipBand): TdxBarScreenTipBandViewInfo; +begin + Result := TdxBarScreenTipBandViewInfo.Create(ABand, FHintText, FShortCut); +end; + +function TdxBarScreenTipViewInfo.IsScreenTip: Boolean; +begin + Result := True; +end; + +function TdxBarScreenTipViewInfo.GetBandViewInfos(Index: Integer): TdxBarScreenTipBandViewInfo; +begin + if Index < BandViewInfosCount then + Result := FBandViewInfos[Index] + else + Result := nil; +end; + +function TdxBarScreenTipViewInfo.GetBandViewInfosCount: Integer; +begin + Result := Length(FBandViewInfos); +end; + +{ TdxBarHintWindow } + +constructor TdxBarHintWindow.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Color := clInfoBk; + NeedEraseBackground := True; + AnimationStyle := cxhaNone; +end; + +destructor TdxBarHintWindow.Destroy; +begin + FreeAndNil(FViewInfo); + inherited Destroy; +end; + +function TdxBarHintWindow.GetHideHintTime: Integer; +begin + if FIsScreenTipWindow then + Result := 200000 + else + Result := dxBarWaitForHideHintTime; +end; + +function TdxBarHintWindow.GetShowHintTime: Integer; +begin + if FIsScreenTipWindow then + Result := 900 + else + Result := dxBarWaitForShowHintTime; +end; + +procedure TdxBarHintWindow.Paint; +begin + ClientWidth := cxRectWidth(FViewInfo.BoundsRect); + ClientHeight := cxRectHeight(FViewInfo.BoundsRect); + FViewInfo.Paint(Canvas); +end; + +procedure TdxBarHintWindow.RecreateWindow; +var + AParams: TCreateParams; + ATempClass: TWndClass; + AClassRegistered: Boolean; +begin + if not IsWinXP then + RecreateWnd + else + begin + DestroyHandle; + CreateParams(AParams); + with AParams do + begin + AClassRegistered := Windows.GetClassInfo(WindowClass.hInstance, WinClassName, ATempClass); + if AClassRegistered then + Windows.UnregisterClass(WinClassName, HInstance); + end; + HandleNeeded; + end; +end; + +function TdxBarHintWindow.ActivateHint(ABarManager: TdxBarManager; const AHintText, AShortCut: string): Boolean; +var + P: TPoint; + AHintKeeper: IdxBarHintKeeper; + ABarControl: TCustomdxBarControl; +begin + FreeAndNil(FViewInfo); + AHintKeeper := nil; + ABarControl := nil; + if not Supports(ABarManager.FHintObject, IdxBarHintKeeper, AHintKeeper) then + if ABarManager.FHintObject is TCustomdxBarControl then + ABarControl := TCustomdxBarControl(ABarManager.FHintObject); + + if AHintKeeper <> nil then + FViewInfo := AHintKeeper.CreateHintViewInfo(AHintText, AShortCut) + else + if ABarControl <> nil then + FViewInfo := ABarControl.Painter.CreateHintViewInfo(ABarManager, AHintText, AShortCut, nil) + else + FViewInfo := TdxBarHintViewInfo.Create(ABarManager, AHintText, AShortCut, GetMouseCursorPos); + FViewInfo.SetWindowDrawParams(Self); + FViewInfo.Calculate(Canvas); + + Result := not IsRectEmpty(FViewInfo.BoundsRect); + if Result then + begin + if AHintKeeper <> nil then + P := AHintKeeper.GetHintPosition(GetMouseCursorPos, Height) + else + if ABarControl <> nil then + P := ABarControl.Painter.GetBarItemContolHintPosition(ABarControl, ABarControl.MarkRect, + GetMouseCursorPos, Height) + else + P := GetMouseCursorPos; + dxSetZOrder(Handle); + inherited ActivateHint(cxRectBounds(P.X, P.Y, cxRectWidth(FViewInfo.BoundsRect), cxRectHeight(FViewInfo.BoundsRect)), AHintText); + end; +end; + +procedure TdxBarHintWindow.SetIsScreenTipWindow(Value: Boolean); +begin + if IsScreenTipWindow <> Value then + begin + Visible := False; + FIsScreenTipWindow := Value; + DoubleBuffered := Value; + RecreateWindow; + end; +end; + +procedure TdxBarHintWindow.WMShowWindow(var Message: TWMShowWindow); +begin + if not Message.Show then + FreeAndNil(FViewInfo); +end; + +procedure TdxBarHintWindow.WMSize(var Message: TWMSize); +begin + inherited; + if FIsScreenTipWindow then + SetWindowRgn(Handle, CreateRoundRectRgn(0, 0, Message.Width + 1, Message.Height + 1, 2, 2), True); +end; + +{ TdxBarItem } + +constructor TdxBarItem.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FBarManager := GetBarManagerByComponent(AOwner); + if (FBarManager = nil) and (dxBarManagerList.Count > 0) then + FBarManager := TdxBarManager(dxBarManagerList[0]); + if BarManager <> nil then BarManager.FItems.Add(Self); + FLinks := TList.Create; + FStylesData := TdxBarItemStylesData.Create(GetStyleCount); + FStylesData.OnChange := InternalStyleChanged; + FEnabled := True; + + FGlyph := dxBarCreateBitmap(OnGlyphChanged); + FLargeGlyph := dxBarCreateBitmap(OnLargeGlyphChanged); + FImageIndex := -1; + FLargeImageIndex := -1; + + FGlyphLayout := glTop; + FCanSelect := True; + FCategory := -1; + FLoadedVisible := ivAlways; + FMergeKind := mkAdd; + FVisible := ivAlways; +end; + +destructor TdxBarItem.Destroy; +begin +//#DG BarDesignController.DeselectIfSelected(Self); + FreeAndNil(FStylesData); + FreeAndNil(FLinks); + FreeAndNil(FActionLink); + FreeAndNil(FLargeGlyph); + FreeAndNil(FGlyph); + cxClearObjectLinks(Self); + inherited Destroy; +end; + +procedure TdxBarItem.Assign(Source: TPersistent); +var + AItem: TdxBarItem; +begin + if Source is TdxBarItem then + begin + AItem := TdxBarItem(Source); + Action := AItem.Action; + Align := AItem.Align; + Caption := AItem.Caption; + Category := AItem.Category; + Description := AItem.Description; + Enabled := AItem.Enabled; + HelpContext := AItem.HelpContext; + Hint := AItem.Hint; + KeyTip := AItem.KeyTip; + MergeKind := AItem.MergeKind; + MergeOrder := AItem.MergeOrder; + Style := AItem.Style; + ScreenTip := AItem.ScreenTip; + Visible := AItem.Visible; + + Data := AItem.Data; + Glyph := AItem.Glyph; + ImageIndex := AItem.ImageIndex; + LargeGlyph := AItem.LargeGlyph; + LargeImageIndex := AItem.LargeImageIndex; + ShortCut := AItem.ShortCut; + OnClick := AItem.OnClick; + end + else + inherited; +end; + +procedure TdxBarItem.BeforeDestruction; +begin + inherited; + CallNotify(FOnDestroy, Self); + DestroyLinks; +end; + +function TdxBarItem.GetAction: TBasicAction; +begin + if FActionLink = nil then + Result := nil + else + Result := FActionLink.Action; +end; + +function TdxBarItem.GetActiveLink: TdxBarItemLink; +begin + if GetItemByLink(BarManager.LastSelectedLinkAtDesign) = Self then + Result := BarManager.LastSelectedLinkAtDesign + else + if LinkCount > 0 then + Result := Links[0] + else + Result := nil; +end; + +function TdxBarItem.GetActuallyVisible: Boolean; +begin + Result := + ((Visible = ivAlways) and (InternalActuallyVisible or BarManager.IsCustomizing) or + (Visible = ivInCustomizing) and BarManager.IsCustomizing); +end; + +function TdxBarItem.GetCurItemLink: TdxBarItemLink; +var + I: Integer; +begin + Result := nil; + for I := 0 to LinkCount - 1 do + if (Links[I].Control <> nil) and Links[I].Control.IsActive then + begin + Result := Links[I]; + Break; + end; +end; + +function TdxBarItem.GetFlat: Boolean; +begin + // TODO: obsolete + Result := BarManager.Flat; +end; + +function TdxBarItem.GetIndex: Integer; +begin + Result := BarManager.FItems.IndexOf(Self); +end; + +function TdxBarItem.GetIsDesigning: Boolean; +begin + Result := csDesigning in ComponentState; +end; + +function TdxBarItem.GetIsDestroying: Boolean; +begin + Result := csDestroying in ComponentState; +end; + +function TdxBarItem.GetIsLoading: Boolean; +begin + Result := csLoading in ComponentState; +end; + +function TdxBarItem.GetLinkCount: Integer; +begin + Result := FLinks.Count; +end; + +function TdxBarItem.GetLinks(Index: Integer): TdxBarItemLink; +begin + Result := nil; + if (Index > -1) and (Index < LinkCount) then + Result := TdxBarItemLink(FLinks[Index]); +end; + +function TdxBarItem.GetPainterClass: TdxBarPainterClass; +begin + Result := BarManager.PainterClass; +end; + +function TdxBarItem.GetVisibleForUser: Boolean; +var + I: Integer; +begin + Result := True; + for I := 0 to LinkCount - 1 do + if Links[I].CanVisibleIndex <> -1 then Exit; + Result := False; +end; + +procedure TdxBarItem.SetAction(Value: TBasicAction); +begin + if Action <> Value then + if Value = nil then + FreeAndNil(FActionLink) + else + begin + if csLoading in Value.ComponentState then + BarManager.LockDesignerModified(True); + try + if FActionLink = nil then + FActionLink := GetActionLinkClass.Create(Self); + FActionLink.Action := Value; + FActionLink.OnChange := DoActionChange; + ActionChange(Value, csLoading in Value.ComponentState); + Value.FreeNotification(Self); + finally + if csLoading in Value.ComponentState then + BarManager.LockDesignerModified(False, False); + end; + end; +end; + +procedure TdxBarItem.SetAlign(Value: TdxBarItemAlign); +begin + if FAlign <> Value then + begin + FAlign := Value; + UpdateEx; + end; +end; + +procedure TdxBarItem.SetCategory(Value: Integer); + + procedure Rank; + var + AList: TList; + ANewIndex: Integer; + begin + AList := TList.Create; + try + BarManager.GetAllItemsByCategory(Value, AList); + if AList.Count > 0 then + begin + if Index <= TdxBarItem(AList.Last).Index then + ANewIndex := TdxBarItem(AList.Last).Index + else + ANewIndex := TdxBarItem(AList.Last).Index + 1; + BarManager.MoveItem(Index, ANewIndex); + end; + finally + AList.Free; + end; + end; + +begin + if IsLoading then + FCategory := Value + else + if (BarManager <> nil) and TdxBarManagerCategories(BarManager.Categories).IsIndexValid(Value) then + begin + Rank; + FCategory := Value; + Changed(True); + end; +end; + +procedure TdxBarItem.SetDescription(Value: string); +begin + if FDescription <> Value then + begin + FDescription := Value; + Changed; + end; +end; + +procedure TdxBarItem.SetGlyph(Value: TBitmap); +begin + FGlyph.Assign(Value); +end; + +procedure TdxBarItem.SetGlyphLayout(Value: TdxBarGlyphLayout); +begin + if FGlyphLayout <> Value then + begin + FGlyphLayout := Value; + UpdateEx; + end; +end; + +procedure TdxBarItem.SetIndex(Value: Integer); +begin + if Index <> Value then + BarManager.ItemList.Move(Index, Value); +end; + +procedure TdxBarItem.SetLargeGlyph(Value: TBitmap); +begin + FLargeGlyph.Assign(Value); +end; + +procedure TdxBarItem.SetMergeOrder(Value: Integer); +begin + FMergeOrder := Max(Value, 0); +end; + +procedure TdxBarItem.SetPaintStyle(Value: TdxBarPaintStyle); +begin + if FPaintStyle <> Value then + begin + FPaintStyle := Value; + if not IsLoading then PaintStyleChanged; + end; +end; + +procedure TdxBarItem.SetScreenTip(Value: TdxBarScreenTip); +begin + if FScreenTip <> Value then + begin + if FScreenTip <> nil then + FScreenTip.RemoveFreeNotification(Self); + FScreenTip := Value; + if FScreenTip <> nil then + FScreenTip.FreeNotification(Self); + end; +end; + +procedure TdxBarItem.SetShowCaption(Value: Boolean); +begin + if FShowCaption <> Value then + begin + FShowCaption := Value; + if not IsLoading then UpdateEx; + end; +end; + +procedure TdxBarItem.SetShortCut(Value: TShortCut); +begin + if FShortCut <> Value then + begin + FShortCut := Value; + if not IsLoading then ShortCutChanged; + end; +end; + +procedure TdxBarItem.DestroyLinks; + + function HasItemLinkOnUnlockedBar: Boolean; + var + I: Integer; + begin + Result := False; + for I := 0 to LinkCount - 1 do + if (Links[I].BarControl is TdxBarControl) and + not TdxBarControl(Links[I].BarControl).Bar.BarManager.IsUpdateLocked then + begin + Result := True; + Break; + end; + end; + +var + Item: TdxBarItemLink; + ALock: Boolean; +begin + ALock := not BarManager.IsDestroying and HasItemLinkOnUnlockedBar; + if ALock then + BarManager.BeginUpdate; + try + while LinkCount > 0 do + begin + Item := TdxBarItemLink(FLinks.Last); + FLinks.Remove(Item); + Item.Free; + end; + finally + if ALock then + BarManager.EndUpdate; + end; +end; + +procedure TdxBarItem.DoActionChange(Sender: TObject); +begin + if Sender = Action then ActionChange(Sender, False); +end; + +function TdxBarItem.IsEnabledStored: Boolean; +begin + Result := (FActionLink = nil) or not FActionLink.IsEnabledLinked; +end; + +function TdxBarItem.IsHelpContextStored: Boolean; +begin + Result := (ActionLink = nil) or not FActionLink.IsHelpContextLinked; +end; + +function TdxBarItem.IsHintStored: Boolean; +begin + Result := (FActionLink = nil) or not FActionLink.IsHintLinked; +end; + +function TdxBarItem.IsImageIndexStored: Boolean; +begin + Result := (FActionLink = nil) or not FActionLink.IsImageIndexLinked; +end; + +function TdxBarItem.IsShortCutStored: Boolean; +begin + Result := (FActionLink = nil) or not FActionLink.IsShortCutLinked; +end; + +function TdxBarItem.IsVisibleStored: Boolean; +begin + Result := (FActionLink = nil) or not FActionLink.IsVisibleLinked; +end; + +function TdxBarItem.IsOnClickStored: Boolean; +begin + Result := (FActionLink = nil) or not FActionLink.IsOnExecuteLinked; +end; + +function TdxBarItem.GetHintFromCaption: string; +var + P: Integer; +begin + Result := Caption; + P := Pos('&', Result); + if P > 0 then Delete(Result, P, 1); + P := Pos('...', Result); + if P > 0 then Delete(Result, P, 3); +end; + +procedure TdxBarItem.OnGlyphChanged(Sender: TObject); +begin + GlyphChanged; +end; + +procedure TdxBarItem.OnLargeGlyphChanged(Sender: TObject); +begin + LargeGlyphChanged; +end; + +procedure TdxBarItem.AssignTo(Dest: TPersistent); +begin + if Dest is TCustomAction then + with TCustomAction(Dest) do + begin + Caption := Self.Caption; + if Self is TdxBarButton then + Checked := TdxBarButton(Self).Down; + Enabled := Self.Enabled; + HelpContext := Self.HelpContext; + Hint := Self.Hint; + ImageIndex := Self.ImageIndex; + ShortCut := Self.ShortCut; + case Self.Visible of + ivNever: Visible := False; + ivAlways: Visible := True; + end; + OnExecute := Self.OnClick; + end + else inherited AssignTo(Dest); +end; + +function TdxBarItem.GetEnabled: Boolean; +begin + if not BarManager.Designing and BarManager.IsCustomizing and (Category > -1) then + Result := True + else + Result := FEnabled; +end; + +function TdxBarItem.GetWidth: Integer; +begin + Result := FWidth; +end; + +procedure TdxBarItem.Loaded; +begin + inherited; + if Action <> nil then ActionChange(Action, True); + CallNotify(FOnCreate, Self); +end; + +procedure TdxBarItem.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if Operation = opRemove then + begin + if AComponent = Action then + Action := nil; + if AComponent = FScreenTip then + FScreenTip := nil; + end; +end; + +procedure TdxBarItem.ReadState(Reader: TReader); +begin + inherited ReadState(Reader); + if Reader.Parent is TdxBarManager then + begin + FBarManager := TdxBarManager(Reader.Parent); + BarManagerChanged; + end; +end; + +procedure TdxBarItem.SelectionChanged; +var + I: Integer; +begin + BarDesignController.SynchronizeLastSelectedItem; + for I := 0 to LinkCount - 1 do + RepaintItemControl(Links[I].Control); +end; + +procedure TdxBarItem.SetName(const NewName: TComponentName); +begin + inherited; + if not ((csDesigning in ComponentState) and (NewName = '')) then + Changed; +end; + +procedure TdxBarItem.SetEnabled(Value: Boolean); +begin + if FEnabled <> Value then + begin + FEnabled := Value; + if not IsLoading then EnabledChanged; + end; +end; + +procedure TdxBarItem.SetVisible(Value: TdxBarItemVisible); +begin + if IsLoading then + FLoadedVisible := Value + else + if FVisible <> Value then + begin + FVisible := Value; + VisibleChanged; + end; +end; + +procedure TdxBarItem.SetWidth(Value: Integer); +begin + if (FWidth <> Value) and (Value >= 0) then + begin + FWidth := Value; + WidthChanged; + end; +end; + +procedure TdxBarItem.Invalidate; +begin + Update; +end; + +function TdxBarItem.IsComplex: Boolean; +begin + Result := LinkCount > 1; +end; + +function TdxBarItem.CanDelete(ADestruction: Boolean = False): Boolean; +begin + Result := ((LinkCount > 0) and not ADestruction) or + BarManager.CanDeleteComponent(Self); +end; + +procedure TdxBarItem.ExecuteCustomizationAction(ABasicAction: TdxBarCustomizationAction); +begin + if (LinkCount = 1) and (GetSelectableItem(Links[0]) <> BarDesignController.LastSelectedItem) then + Links[0].ExecuteCustomizationAction(ABasicAction); +end; + +procedure TdxBarItem.GetMasterObjects(AList: TdxObjectList); +begin + AList.Add(BarManager.Owner); +end; + +function TdxBarItem.GetNextSelectableItem: IdxBarSelectableItem; + + function GetNextLink(AItemLink: TdxBarItemLink): TdxBarItemLink; + begin + if AItemLink <> nil then + Result := AItemLink.GetNext + else + Result := nil; + end; + + function GetNextItem(AItemLink: TdxBarItemLink): TdxBarItem; + var + ANext: TdxBarItemLink; + begin + Result := nil; + ANext := AItemLink; + repeat + ANext := GetNextLink(ANext); + if GetItemByLink(ANext) <> Self then + begin + Result := GetItemByLink(ANext); + Break; + end; + until (ANext = nil) or (ANext = AItemLink); + end; + +begin + Result := GetNextItem(GetActiveLink); +end; + +function TdxBarItem.GetSelectableParent: TPersistent; +begin + if GetActiveLink <> nil then + Result := GetActiveLink.GetSelectableParent + else + Result := nil; +end; + +function TdxBarItem.GetSupportedActions: TdxBarCustomizationActions; +begin + if BarManager.Designing then + begin + if BarDesignController.IsItemLinkCustomized then + Result := [caReset, caDelete, caDeleteItem, caDeleteLink, + caChangeCaption, caChangePosition, caChangeViewLevels, + caChangeBeginGroup, caChangeVisible, caChangeRecentList] + else + Result := [caDelete]; + end + else + Result := [caReset, caDeleteLink, caChangeCaption, caChangeBeginGroup]; +end; + +procedure TdxBarItem.DeleteSelection(var AReference: IdxBarSelectableItem; ADestruction: Boolean); +begin + if ADestruction or (LinkCount = 0) then + inherited + else + DestroyLinks; +end; + +function TdxBarItem.SelectParentComponent: Boolean; +begin + if GetActiveLink <> nil then + Result := GetActiveLink.SelectParentComponent + else + Result := False; +end; + +procedure TdxBarItem.ActionChange(Sender: TObject; CheckDefaults: Boolean); +begin + if Action is TCustomAction then + with TCustomAction(Sender) do + begin + FCheckDefaults := CheckDefaults; + try + if not CheckDefaults or (Self.Caption = '') then + Self.Caption := Caption; + finally + FCheckDefaults := False; + end; + if (Self is TdxBarButton) and + (not CheckDefaults or (TdxBarButton(Self).Down = False)) then + TdxBarButton(Self).Down := Checked; + if not CheckDefaults or (Self.Enabled = True) then + Self.Enabled := Enabled; + if not CheckDefaults or (Self.HelpContext = 0) then + Self.HelpContext := HelpContext; + if not CheckDefaults or (Self.Hint = '') then + Self.Hint := Hint; + if not CheckDefaults or (Self.ActionImageIndex = -1) then + Self.ActionImageIndex := ImageIndex; + if not CheckDefaults or (Self.ShortCut = scNone) then + Self.ShortCut := ShortCut; + if not CheckDefaults or (Self.Visible = ivAlways) then + Self.Visible := VisibleTodxBarVisible(Visible); + if not CheckDefaults or not Assigned(Self.OnClick) then + Self.OnClick := OnExecute; + end; +end; + +procedure TdxBarItem.BarManagerChanged; +begin +end; + +function TdxBarItem.CanBePlacedOn(AParentKind: TdxBarItemControlParentKind; + AToolbar: TdxBar; out AErrorText: string): Boolean; +begin + Result := True; +end; + +function TdxBarItem.CanChangePaintStyle: Boolean; +begin + Result := False; +end; + +function TdxBarItem.CanClicked: Boolean; +begin + Result := True; +end; + +function TdxBarItem.CanMergeWith(AItem: TdxBarItem): Boolean; +begin + Result := InternalCanMergeWith(AItem) and AItem.InternalCanMergeWith(Self); +end; + +function TdxBarItem.CurImageIndexLinked: Boolean; +begin + Result := IsImageIndexLinked(GetCurImages, ImageIndex) +end; + +procedure TdxBarItem.DrawCustomizingImage(ACanvas: TCanvas; + const ARect: TRect; AState: TOwnerDrawState); +begin + dxBarCustomizingForm.PainterClass.DrawButtonOrSubItem(ACanvas, ARect, Self, + GetTextOf(Caption), odSelected in AState); +end; + +procedure TdxBarItem.DrawCustomizingImageContent(ACanvas: TCanvas; + const ARect: TRect; ASelected: Boolean); +begin + ACanvas.Brush.Color := clWindow; + ACanvas.FillRect(ARect); +end; + +function TdxBarItem.GetActionLinkClass: TdxBarItemActionLinkClass; +begin + Result := TdxBarItemActionLink; +end; + +function TdxBarItem.GetActionImageIndex: Integer; +begin + Result := ImageIndex; +end; + +procedure TdxBarItem.SetActionImageIndex(Value: Integer); +begin + ImageIndex := Value; +end; + +function TdxBarItem.GetControlClass(AIsVertical: Boolean): TdxBarItemControlClass; +var + I: Integer; +begin + Result := nil; + for I := 0 to RegdxItemList.Count - 1 do + if ClassInfo = RegdxItemList.Items[I].FItemClass.ClassInfo then + begin + Result := RegdxItemList.Items[I].FItemControlClass; + Break; + end; +end; + +function TdxBarItem.GetHidden: Boolean; +begin + Result := False; +end; + +function TdxBarItem.GetItemLinks: TdxBarItemLinks; +begin + Result := nil; +end; + +class function TdxBarItem.GetStyleCount: Integer; +begin + Result := 1; +end; + +function TdxBarItem.GetStyleValue(AIndex: Integer): TcxStyle; +begin + Result := StylesData.Styles[AIndex]; +end; + +function TdxBarItem.HasAccel(AItemLink: TdxBarItemLink): Boolean; +begin + Result := Enabled;//True +end; + +function TdxBarItem.HasControls: Boolean; +var + I: Integer; +begin + Result := True; + for I := 0 to LinkCount - 1 do + if Links[I].Control <> nil then Exit; + Result := False; +end; + +procedure TdxBarItem.HideControl(AControl: TdxBarItemControl); +begin +end; + +function TdxBarItem.InternalActuallyVisible: Boolean; +begin + Result := True; +end; + +function TdxBarItem.InternalCanMergeWith(AItem: TdxBarItem): Boolean; +begin + Result := False; +end; + +function TdxBarItem.IsHintFromCaption: Boolean; +begin + Result := GetShortHint(Hint) = GetHintFromCaption; +end; + +function TdxBarItem.IsImageIndexLinked(AImageList: TCustomImageList; AImageIndex: Integer): Boolean; +begin + Result := IsImageAssigned(AImageList, AImageIndex); +end; + +function TdxBarItem.IsShortCut(AShortCut: TShortCut): Boolean; +begin + Result := False; + if Enabled then + begin + if CanClicked then + Result := ShortCut = AShortCut; + if Result then + Click + else + if GetItemLinks <> nil then + Result := GetItemLinks.IsShortCut(AShortCut); + end; +end; + +function TdxBarItem.IsStyleColorSupported: Boolean; +begin + Result := False; +end; + +function TdxBarItem.NeedToBeHidden: Boolean; +begin + Result := False; +end; + +procedure TdxBarItem.ObjectNotification(AOperation: TOperation; AObject: TObject); +begin +end; + +procedure TdxBarItem.Recalculate; +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + if Links[I].Control <> nil then + with Links[I].Control do + PartsChanged; +end; + +procedure TdxBarItem.SetImageIndex(Value: Integer); +begin + if FImageIndex <> Value then + begin + FImageIndex := Value; + GlyphChanged; + end; +end; + +procedure TdxBarItem.SetLargeImageIndex(Value: Integer); +begin + if FLargeImageIndex <> Value then + begin + FLargeImageIndex := Value; + LargeGlyphChanged; + end; +end; + +procedure TdxBarItem.SetStyleValue(AIndex: Integer; Value: TcxStyle); +begin + StylesData.Styles[AIndex] := Value; +end; + +procedure TdxBarItem.ShowDefaultEventHandler; +begin + BarManager.ShowDefaultEventHandler(Self); +end; + +procedure TdxBarItem.Update; +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + if Links[I].Control <> nil then + with Links[I].Control do + if not IsSelected or not Parent.IsActive then + Repaint; +end; + +procedure TdxBarItem.UpdateEx(AParentKinds: TdxBarKinds = dxBarKindAny); +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + if Links[I].Control <> nil then + with Links[I].Control do + if (Parent.Kind in AParentKinds) and (not IsSelected or not Parent.IsActive) then + Parent.RepaintBar; +end; + +function TdxBarItem.UseHotImages: Boolean; +begin + Result := False; +end; + +function TdxBarItem.UseLargeImages: Boolean; +begin + Result := (ImageIndex > -1) or (LargeImageIndex > -1); +end; + +procedure TdxBarItem.CaptionChanged; +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + if not (udCaption in Links[I].UserDefine) and (Links[I].Control <> nil) then + Links[I].Control.CaptionChanged; + Changed; +end; + +procedure TdxBarItem.EnabledChanged; +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + if Links[I].Control <> nil then + begin + Links[I].Control.ResetCachedValues(False); + Links[I].Control.EnabledChanged; + end; +end; + +procedure TdxBarItem.GlyphChanged; +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + if not (udGlyph in Links[I].UserDefine) and (Links[I].Control <> nil) then + Links[I].Control.ResetCachedValues(True); + for I := 0 to LinkCount - 1 do + if not (udGlyph in Links[I].UserDefine) and (Links[I].Control <> nil) then + Links[I].Control.GlyphChanged; + Changed; +end; + +procedure TdxBarItem.HotGlyphChanged; +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + if Links[I].Control <> nil then + begin + Links[I].Control.ResetCachedValues(False); + Links[I].Control.HotGlyphChanged; + end; +end; + +procedure TdxBarItem.InternalStyleChanged(AChangeKind: TdxBarItemStyleChangeKind); + + procedure DoItemLinkChange(ALink: TdxBarItemLink); + begin + if AChangeKind = sckDrawing then + ALink.Control.CalcDrawingConsts + else + ALink.RecreateControl; + end; + + procedure DoItemChange; + begin + if AChangeKind = sckDrawing then + Update + else + UpdateEx; + end; + +var + I: Integer; +begin + if not (csDestroying in ComponentState) then + begin + for I := 0 to LinkCount - 1 do + if Links[I].Control <> nil then + DoItemLinkChange(Links[I]); + DoItemChange; + end; +end; + +procedure TdxBarItem.LargeGlyphChanged; +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + if Links[I].Control <> nil then + Links[I].Control.ResetCachedValues(True); + + for I := 0 to LinkCount - 1 do + if Links[I].Control <> nil then + Links[I].Control.LargeGlyphChanged; + Changed; +end; + +procedure TdxBarItem.PaintStyleChanged; +begin +// do nothing +end; + +procedure TdxBarItem.ShortCutChanged; +begin + UpdateEx([bkSubMenu]); + Changed; +end; + +procedure TdxBarItem.VisibleChanged; +var + I: Integer; +begin + if IsDesigning then Exit; + BarManager.BeginUpdate; + try + for I := 0 to LinkCount - 1 do + begin + Links[I].Owner.RefreshVisibilityLists; + if ActuallyVisible then + begin + Links[I].BringToTopInRecentList(False); + if Links[I].Control = nil then Links[I].CreateControl; + if Links[I].Control <> nil then + Links[I].Control.VisibleChanged; + end + else + begin + Links[I].SendToBottomInRecentList; + if Links[I].Control <> nil then + begin + Links[I].Control.VisibleChanged; + Links[I].DestroyControl; + end; + end; + end; + finally + BarManager.EndUpdate; + Changed; + end; +end; + +procedure TdxBarItem.WidthChanged; +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + if not (udWidth in Links[I].UserDefine) and (Links[I].Control <> nil) then + Links[I].Control.WidthChanged; +end; + +function TdxBarItem.GetCaption: string; +begin + Result := FCaption; +end; + +function TdxBarItem.IsCaptionStored: Boolean; +begin + Result := (FActionLink = nil) or not FActionLink.IsCaptionLinked; +end; + +procedure TdxBarItem.SetCaption(const Value: string); +var + AMakeHint: Boolean; + S: string; +begin + if FCaption <> Value then + begin + AMakeHint := not FCheckDefaults and not (Self is TCustomdxBarSubItem) and + ((Hint = '') or IsHintFromCaption); + FCaption := Value; + if not IsLoading then + begin + if AMakeHint then + begin + S := GetHintFromCaption; + if Pos('|', Hint) = 0 then + Hint := S + else + Hint := S + '|' + GetLongHint(Hint); + end; + CaptionChanged; + end; + end; +end; + +procedure TdxBarItem.CheckLinks(ASource: TCustomIniFile; const ABaseSection: string); +begin +// do nothing +end; + +procedure TdxBarItem.LoadFromIni(ASource: TCustomIniFile; const ABaseSection: string; AStoringKind: TdxBarStoringKind); +begin +// do nothing +end; + +procedure TdxBarItem.LoadUsageData(ASource: TCustomIniFile; const ABaseSection: string); +begin +// do nothing +end; + +procedure TdxBarItem.SaveToIni(ADestination: TCustomIniFile; const ABaseSection: string; AStoringKind: TdxBarStoringKind); +begin +// do nothing +end; + +procedure TdxBarItem.GetTextViewParams(out AViewParams: TcxViewParams); +begin + GetViewParams(Style, AViewParams); +end; + +procedure TdxBarItem.GetViewParams(AStyle: TcxStyle; out AViewParams: TcxViewParams); +begin + AViewParams := DefaultViewParams; + if AStyle <> nil then + begin + if svBitmap in AStyle.AssignedValues then + AViewParams.Bitmap := AStyle.Bitmap; + if svColor in AStyle.AssignedValues then + AViewParams.Color := AStyle.Color; + if svFont in AStyle.AssignedValues then + AViewParams.Font := AStyle.Font; + if svTextColor in AStyle.AssignedValues then + AViewParams.TextColor := AStyle.TextColor; + end; +end; + +class function TdxBarItem.GetNewCaption: string; +begin + Result := dxSBAR_NEWITEMCAPTION; +end; + +procedure TdxBarItem.Click; +begin + if CanClicked then DirectClick; +end; + +procedure TdxBarItem.DirectClick; +begin + if Enabled then + try + BarManager.DoClickItem(Self); + DoClick; + except + Application.HandleException(Self); + end; +end; + +procedure TdxBarItem.DoClick; +begin + if Assigned(FOnClick) and ((Action = nil) or (@FOnClick <> @Action.OnExecute)) then + FOnClick(Self) + else + if not IsDesigning and (FActionLink <> nil) then + FActionLink.Execute{$IFDEF DELPHI6}(Self){$ENDIF}; +end; + +function TdxBarItem.GetAddMessageName: string; +begin + Result := ''; +end; + +function TdxBarItem.GetCurImages: TCustomImageList; +begin + Result := BarManager.Images; +end; + +function TdxBarItem.GetParentComponent: TComponent; +begin + if HasParent then Result := FBarManager + else Result := nil; +end; + +function TdxBarItem.HasParent: Boolean; +begin + Result := FCategory > -1; +end; + +procedure TdxBarItem.SetParentComponent(AParent: TComponent); +begin + if not IsLoading then + begin + FBarManager := AParent as TdxBarManager; + BarManagerChanged; + end; +end; + +{ TdxBarLabel } + +constructor TdxBarLabel.Create(AOwner: TComponent); +begin + inherited; + FShowCaption := True; +end; + +{ TdxBarSeparator } + +function TdxBarSeparator.CanBePlacedOn(AParentKind: TdxBarItemControlParentKind; + AToolbar: TdxBar; out AErrorText: string): Boolean; +begin + Result := AParentKind = pkSubItemOrPopupMenu; + if not Result then + AErrorText := dxSBAR_CANTPLACESEPARATOR; +end; + +class function TdxBarSeparator.GetNewCaption: string; +begin + Result := dxSBAR_NEWSEPARATORCAPTION; +end; + +function TdxBarSeparator.GetSupportedActions: TdxBarCustomizationActions; +begin + Result := inherited GetSupportedActions - [caChangeRecentList]; +end; + +{ TdxBarWindowItem } + +function TdxBarWindowItem.GetCurText: string; +begin + if CurItemLink = nil then Result := Text + else + if CurItemLink.Control is TdxBarWinControl then + Result := TdxBarWinControl(CurItemLink.Control).Text; +end; + +function TdxBarWindowItem.GetFocusedItemLink: TdxBarItemLink; +begin + if (CurItemLink <> nil) and (CurItemLink.Control is TdxBarWinControl) and + TdxBarWinControl(CurItemLink.Control).Focused then + Result := CurItemLink + else + Result := nil; +end; + +procedure TdxBarWindowItem.SetCurText(Value: string); +begin + if CurItemLink = nil then Text := Value + else + if CurItemLink.Control is TdxBarWinControl then + TdxBarWinControl(CurItemLink.Control).Text := Value; +end; + +function TdxBarWindowItem.CanClicked: Boolean; +begin + Result := False; +end; + +procedure TdxBarWindowItem.Change; +begin + if not IsLoading and Assigned(FOnChange) then FOnChange(Self); +end; + +procedure TdxBarWindowItem.CurChange; +begin + CallNotify(FOnCurChange, Self); +end; + +procedure TdxBarWindowItem.DoEnter; +begin + CallNotify(FOnEnter, Self); +end; + +procedure TdxBarWindowItem.DoExit; +begin + CallNotify(FOnExit, Self); +end; + +function TdxBarWindowItem.GetControlClass(AIsVertical: Boolean): TdxBarItemControlClass; +begin + if AIsVertical then + Result := TdxBarButtonControl + else + Result := inherited GetControlClass(AIsVertical); +end; + +function TdxBarWindowItem.GetText: string; +begin + Result := FText; +end; + +procedure TdxBarWindowItem.KeyDown(var Key: Word; Shift: TShiftState); +begin + if Assigned(FOnKeyDown) then FOnKeyDown(Self, Key, Shift); +end; + +procedure TdxBarWindowItem.KeyPress(var Key: Char); +begin + if Assigned(FOnKeyPress) then FOnKeyPress(Self, Key); +end; + +procedure TdxBarWindowItem.KeyUp(var Key: Word; Shift: TShiftState); +begin + if Assigned(FOnKeyUp) then FOnKeyUp(Self, Key, Shift); +end; + +procedure TdxBarWindowItem.SetText(Value: string); +begin + if FText <> Value then + begin + FText := Value; +{ if (CurItemLink <> nil) and (CurItemLink.Control is TdxBarWinControl) then + TdxBarWinControl(CurItemLink.Control).Text := FText;} + Update; + Change; + Update; + end; +end; + +procedure TdxBarWindowItem.SetFocus(ACheckBarControlVisibility: Boolean = False); +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + with Links[I] do + if Control is TdxBarWinControl and + (not ACheckBarControlVisibility or IsControlVisible(BarControl)) then + begin + (BarControl as TdxBarControl).BarGetFocus(Control); + Control.Click(False); + Break; + end; +end; + +{ TdxBarButton } + +var + ABarActivationDropDownControl: TdxBarButtonLikeControl; + ABarActivationDropDownControlTimerID: UINT; + + ABarDeActivationDropDownControl: TdxBarButtonLikeControl; + ABarDeActivationDropDownControlTimerID: UINT; + +constructor TdxBarButton.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FCloseSubMenuOnClick := True; + FDropDownEnabled := True; + FUnclickAfterDoing := True; +end; + +function TdxBarButton.GetButtonStyle: TdxBarButtonStyle; +begin + if FInternalStates = [] then + Result := bsDefault + else + if FInternalStates = [bstChecked] then + Result := bsChecked + else + if FInternalStates = [bstDropDown] then + Result := bsDropDown + else + Result := bsCheckedDropDown; +end; + +procedure TdxBarButton.SetAllowAllUp(Value: Boolean); +var + I: Integer; +begin + if FAllowAllUp <> Value then + begin + FAllowAllUp := Value; + if GroupIndex <> 0 then + with BarManager do + for I := 0 to ItemCount - 1 do + if (Items[I] is TdxBarButton) and (TdxBarButton(Items[I]).GroupIndex = GroupIndex) then + TdxBarButton(Items[I]).FAllowAllUp := FAllowAllUp; + end; +end; + +procedure TdxBarButton.SetButtonStyle(Value: TdxBarButtonStyle); +begin + if ButtonStyle <> Value then + begin + case Value of + bsDefault: FInternalStates := []; + bsChecked: FInternalStates := [bstChecked]; + bsDropDown: FInternalStates := [bstDropDown]; + bsCheckedDropDown: FInternalStates := [bstChecked, bstDropDown]; + end; + Down := False; + if not IsLoading then + UpdateEx; + Changed; + end; +end; + +procedure TdxBarButton.SetDown; +var + DownedButton: TdxBarButton; + + function GetDownedButton: TdxBarButton; + var + I: Integer; + begin + with BarManager do + for I := 0 to ItemCount - 1 do + if Items[I] is TdxBarButton then + begin + Result := TdxBarButton(Items[I]); + with Result do + if (bstChecked in FInternalStates) and (GroupIndex = Self.GroupIndex) and Down then + Exit; + end; + Result := nil; + end; + + function AnotherDownedButtonExists: Boolean; + var + I: Integer; + begin + Result := True; + with BarManager do + for I := 0 to ItemCount - 1 do + if (Items[I] <> Self) and (Items[I] is TdxBarButton) then + with TdxBarButton(Items[I]) do + if (bstChecked in FInternalStates) and (GroupIndex = Self.GroupIndex) and Down then + Exit; + Result := False; + end; + +begin + if (FDown <> Value) and ((bstChecked in FInternalStates) or not Value) then + begin + if not IsLoading and (bstChecked in FInternalStates) and (GroupIndex <> 0) then + if Value then + DownedButton := GetDownedButton + else + if not AllowAllUp and not AnotherDownedButtonExists then + Exit + else + DownedButton := nil + else + DownedButton := nil; + FDown := Value; + if not IsLoading then + begin + Update; + if DownedButton <> nil then DownedButton.Down := False; + end; + end; +end; + +procedure TdxBarButton.SetDropDownEnabled(Value: Boolean); +begin + if FDropDownEnabled <> Value then + begin + FDropDownEnabled := Value; + if not IsLoading then Update; + end; +end; + +procedure TdxBarButton.SetDropDownMenu(Value: TdxBarPopupMenu); +begin + if Value <> FDropDownMenu then + begin + if (Value <> nil) and Value.GetItemLinks.IsReferencedBy(Self) then + raise Exception.Create(cxGetResourceString(@dxSBAR_RECURSIVEMENUS)) + else + begin + FDropDownMenu := Value; + if Value <> nil then Value.FreeNotification(Self); + end; + end; +end; + +procedure TdxBarButton.SetGroupIndex(Value: Integer); +begin + if FGroupIndex <> Value then + begin + if not (bstChecked in FInternalStates) then + Value := 0; + FGroupIndex := Value; + Down := False; + end; +end; + +procedure TdxBarButton.SetLowered(Value: Boolean); +begin + if FLowered <> Value then + begin + FLowered := Value; + if not IsLoading then UpdateEx; + end; +end; + +function TdxBarButton.IsDownStored: Boolean; +begin + Result := (FActionLink = nil) or not FActionLink.IsCheckedLinked; +end; + +function TdxBarButton.CanChangePaintStyle: Boolean; +begin + Result := True; +end; + +procedure TdxBarButton.DoDropDown(AControl: TdxBarButtonControl; X, Y: Integer; + ByMouse: Boolean); +var + R: TRect; +begin + if FDropDownMenu <> nil then + begin + if AControl.HasShadow then + R := AControl.Parent.GetItemScreenRect(AControl) + else + R := Rect(0, 0, 0, 0); + FDropDownMenu.FOwnerItemControl := AControl; + try + with AControl, ItemBounds do + if (Parent.Kind = bkSubMenu) or Parent.IsRealVertical then + FDropDownMenu.PopupEx(X, Y, Right - Left, 0, FShowAnimation, @R, False, AControl.Parent) + else + FDropDownMenu.PopupEx(X, Y, 0, Bottom - Top, FShowAnimation, @R, False, AControl.Parent); + finally + FDropDownMenu.FOwnerItemControl := nil; + end; + with FDropDownMenu.SubMenuControl do + begin + FDropDownButton := AControl; + if not ByMouse and (ItemLinks.First <> nil) then + SetKeySelectedItem(ItemLinks.First.Control); + end; + if AControl.Parent.Kind = bkSubMenu then + AControl.Parent.ChildBar := FDropDownMenu.SubMenuControl; + end; +end; + +function TdxBarButton.HasAccel(AItemLink: TdxBarItemLink): Boolean; +begin + Result := inherited HasAccel(AItemLink) and + (not (AItemLink.Owner.Owner is TdxBar) or + (AItemLink.PaintStyle in [psCaption, psCaptionGlyph]) or + (AItemLink.Control <> nil) and + (TdxBarButtonControl(AItemLink.Control).PaintStyle in [psCaption, psCaptionGlyph])); +end; + +procedure TdxBarButton.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if (Operation = opRemove) and (AComponent = DropDownMenu) then + DropDownMenu := nil; +end; + +procedure TdxBarButton.PaintStyleChanged; +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + if not (udPaintStyle in Links[I].UserDefine) and (Links[I].Control <> nil) then + TdxBarButtonControl(Links[I].Control).PaintStyleChanged; +end; + +// IdxBarLinksOwner +function TdxBarButton.CanContainItem(AItem: TdxBarItem; + out AErrorText: string): Boolean; +begin + Result := (DropDownMenu <> nil) and DropDownMenu.CanContainItem(AItem, AErrorText); +end; + +function TdxBarButton.CreateBarControl: TCustomdxBarControl; +begin + if DropDownMenu <> nil then + Result := DropDownMenu.CreateBarControl + else + Result := nil; +end; + +function TdxBarButton.GetItemLinks: TdxBarItemLinks; +begin + if DropDownMenu <> nil then + Result := DropDownMenu.ItemLinks + else + Result := inherited GetItemLinks; +end; + +function TdxBarButton.GetSupportedActions: TdxBarCustomizationActions; +begin + Result := inherited GetSupportedActions + [caChangeButtonPaintStyle]; + if BarManager.Designing then + Include(Result, caChangeButtonGroup); +end; + +class function TdxBarButton.GetNewCaption: string; +begin + Result := dxSBAR_NEWBUTTONCAPTION; +end; + +procedure TdxBarButton.Click; +begin + if Enabled and (bstChecked in FInternalStates) then + Down := not Down; + inherited Click; +end; + +{ TcxCustomBarEdit } + +constructor TdxCustomBarEdit.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FWidth := 100; +end; + +procedure TdxCustomBarEdit.ReadState(Reader: TReader); +begin + if not FGlyphLoaded then // the same as in cxButtonEdit + begin + Glyph := nil; + FGlyphLoaded := True; + end; + inherited; +end; + +procedure TdxCustomBarEdit.DrawCustomizingImage(ACanvas: TCanvas; + const ARect: TRect; AState: TOwnerDrawState); +begin + dxBarCustomizingForm.PainterClass.DrawEdit(ACanvas, ARect, Self, + odSelected in AState, False); +end; + +procedure TdxCustomBarEdit.GetEditViewParams(out AViewParams: TcxViewParams); +begin + GetViewParams(StyleEdit, AViewParams); +end; + +class function TdxCustomBarEdit.GetStyleCount: Integer; +begin + Result := 2; +end; + +function TdxCustomBarEdit.HasAccel(AItemLink: TdxBarItemLink): Boolean; +begin + Result := inherited HasAccel(AItemLink) and + (FShowCaption or not (AItemLink.Owner.Owner is TdxBar)); +end; + +procedure TdxCustomBarEdit.SetWidth(Value: Integer); +begin + if (FWidth <> Value) and (Value > 0) then + begin + FWidth := Value; + if not IsLoading then + WidthChanged; + end; +end; + +{ TdxBarEdit } + +procedure TdxBarEdit.SetMaxLength(Value: Integer); +begin + FMaxLength := Value; + if FMaxLength <= 0 then FMaxLength := 0; +end; + +procedure TdxBarEdit.DrawInterior(ABarEditControl: TdxBarEditControl; ACanvas: TCanvas; + R: TRect; ItemLink: TdxBarItemLink); +begin + ABarEditControl.Painter.EditDrawInterior(ABarEditControl, Self, ACanvas, R, ItemLink); +end; + +{ TCustomdxBarCombo } + +function TCustomdxBarCombo.GetDroppedDown: Boolean; +begin + if CurItemLink = nil then + Result := False + else + if CurItemLink.Control is TCustomdxBarComboControl then + Result := TCustomdxBarComboControl(CurItemLink.Control).DroppedDown + else + Result := False; +end; + +function TCustomdxBarCombo.GetShowEditor: Boolean; +begin + Result := not EmptyWindow; +end; + +procedure TCustomdxBarCombo.SetDroppedDown(Value: Boolean); +begin + if (CurItemLink <> nil) and (CurItemLink.Control is TCustomdxBarComboControl) then + TCustomdxBarComboControl(CurItemLink.Control).DroppedDown := Value; +end; + +procedure TCustomdxBarCombo.SetShowEditor(Value: Boolean); +begin + EmptyWindow := not Value; +end; + +procedure TCustomdxBarCombo.AfterDropDown; +begin +end; + +procedure TCustomdxBarCombo.CheckDropDownPoint(var X, Y: Integer); +var + R: TRect; + ControlWidth, ControlHeight, DropDownWindowWidth, DropDownWindowHeight: Integer; +begin + if DropDownWindow > 0 then + with R do + begin + with CurItemLink.ItemRect do + begin + ControlWidth := Right - Left; + ControlHeight := Bottom - Top; + end; + GetWindowRect(DropDownWindow, R); + DropDownWindowWidth := Right - Left; + DropDownWindowHeight := Bottom - Top; + R := GetWorkArea(Point(X, Y)); + if (CurItemLink.BarControl is TdxBarSubMenuControl) or + CurItemLink.BarControl.IsRealVertical then + begin + if (X + DropDownWindowWidth > Right) and + (X - ControlWidth - Left > Right - X) then + Dec(X, ControlWidth + DropDownWindowWidth); + if Y + DropDownWindowHeight > Bottom then + Y := Bottom - DropDownWindowHeight; + end + else + begin + if X + DropDownWindowWidth > Right then + X := Right - DropDownWindowWidth; + if (Y + DropDownWindowHeight > Bottom) and + (Y - ControlHeight - Top > Bottom - Y) then + Dec(Y, ControlHeight + DropDownWindowHeight); + end; + if X < Left then X := Left; + if Y < Top then Y := Top; + end; +end; + +function TCustomdxBarCombo.CheckKeyForDropDownWindow(Key: Word; + Shift: TShiftState): Boolean; +begin + Result := (Key <> VK_ESCAPE) and (Key <> VK_RETURN) and (Key <> VK_TAB); + if Assigned(FOnCheckKeyForDropDownWindow) then + FOnCheckKeyForDropDownWindow(Self, Key, Shift, Result); +end; + +procedure TCustomdxBarCombo.CloseUp; +begin + if DropDownWindow <> 0 then ShowWindow(DropDownWindow, SW_HIDE); + CallNotify(FOnCloseUp, Self); +end; + +procedure TCustomdxBarCombo.DrawCustomizingImage(ACanvas: TCanvas; + const ARect: TRect; AState: TOwnerDrawState); +begin + dxBarCustomizingForm.PainterClass.DrawEdit(ACanvas, ARect, Self, + odSelected in AState, True); +end; + +procedure TCustomdxBarCombo.DropDown(X, Y: Integer); +begin + CallNotify(FOnDropDown, Self); + if DropDownWindow <> 0 then + begin + InitDropDownWindow; + CheckDropDownPoint(X, Y); + SetWindowPos(DropDownWindow, 0, X, Y, 0, 0, + SWP_NOZORDER or SWP_NOSIZE or SWP_NOACTIVATE); + SetWindowPos(DropDownWindow, HWND_TOP, 0, 0, 0, 0, + SWP_NOMOVE or SWP_NOSIZE or SWP_SHOWWINDOW or SWP_NOACTIVATE or SWP_FRAMECHANGED); + AfterDropDown; + end; +end; + +function TCustomdxBarCombo.GetDropDownWindow: HWND; +begin + Result := 0; + if Assigned(FOnGetDropDownWindow) then FOnGetDropDownWindow(Self, Result); +end; + +procedure TCustomdxBarCombo.InitDropDownWindow; +begin +end; + +procedure TCustomdxBarCombo.InternalInitDropDownWindow(ADropDownWindow: TWinControl); +var + ABkColor, ATextColor: COLORREF; + AEditControl: TdxBarCustomEditControl; +begin + AEditControl := TdxBarCustomEditControl(CurItemLink.Control); + TControlAccess(ADropDownWindow).Font := AEditControl.EditFont; + AEditControl.Painter.EditGetColors(AEditControl, ATextColor, ABkColor); + TControlAccess(ADropDownWindow).Color := ABkColor; + TControlAccess(ADropDownWindow).Font.Color := ATextColor; +end; + +{ TdxBarCustomCombo } + +constructor TdxBarCustomCombo.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FDropDownCount := 8; + FItemIndex := -1; + FItems := TStringList.Create; + TStringList(FItems).OnChange := ItemsChanged; + FListBox := TdxBarDropDownListBox.Create(Self); + with TdxBarDropDownListBox(FListBox) do + begin + FCombo := Self; + OnDrawItem := ListBoxDrawItem; + OnMeasureItem := ListBoxMeasureItem; + end; +end; + +destructor TdxBarCustomCombo.Destroy; +begin + FreeAndNil(FListBox); + FreeAndNil(FItems); + inherited Destroy; +end; + +function TdxBarCustomCombo.GetCurItemIndex: Integer; +begin + if FocusedItemLink = nil then + Result := ItemIndex + else + Result := TdxBarComboControl(FocusedItemLink.Control).LocalItemIndex; +end; + +function TdxBarCustomCombo.GetItemsHeight(Index: Integer): Integer; +begin + MeasureItem(Index, Result); +end; + +procedure TdxBarCustomCombo.SetCurItemIndex(Value: Integer); +begin + if FocusedItemLink = nil then + ItemIndex := Value + else + TdxBarComboControl(FocusedItemLink.Control).LocalItemIndex := Value; +end; + +procedure TdxBarCustomCombo.SetItemIndex(Value: Integer); +var + AText: string; +begin + if FItemIndex <> Value then + begin + FItemIndex := Value; + if (FItemIndex < 0) or (FItemIndex > Items.Count - 1) then + FItemIndex := -1; + if FItemIndex = -1 then AText := '' + else AText := Items[FItemIndex]; + if Text = AText then + begin + Update; + Change; + Update; + end + else + Text := AText; + end; +end; + +procedure TdxBarCustomCombo.SetItems(Value: TStrings); +begin + FItems.Assign(Value); +end; + +procedure TdxBarCustomCombo.SetSorted(Value: Boolean); +begin + if FSorted <> Value then + begin + FSorted := Value; + TStringList(FItems).Sorted := FSorted; + FItemIndex := FItems.IndexOf(Text); + end; +end; + +procedure TdxBarCustomCombo.CheckLocalPos; +var + AText: string; + AItemIndex: Integer; +begin + if (CurItemLink = nil) or not (CurItemLink.Control is TdxBarComboControl) then + Exit; + AText := TdxBarComboControl(CurItemLink.Control).Text; + AItemIndex := TdxBarComboControl(CurItemLink.Control).LocalItemIndex; + if not ((0 <= AItemIndex) and (AItemIndex < Items.Count) and (Items[AItemIndex] = AText)) then + AItemIndex := GetNearestItemIndex(AText); + TdxBarComboControl(CurItemLink.Control).FLocalItemIndex := AItemIndex; + if DroppedDown then + if (AItemIndex > -1) and (AnsiCompareText(AText, Items[AItemIndex]) = 0) then + ListBox.ItemIndex := AItemIndex + else + begin + ListBox.ItemIndex := -1; + ListBox.TopIndex := AItemIndex; + end; +end; + +procedure TdxBarCustomCombo.ItemsChanged(Sender: TObject); +begin + if ItemIndex > Items.Count - 1 then ItemIndex := -1 + else Update; +end; + +procedure TdxBarCustomCombo.ListBoxDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); +begin + DrawItem(CurItemLink.Control.Painter, Index, Rect, State); +end; + +procedure TdxBarCustomCombo.ListBoxMeasureItem(Control: TWinControl; Index: Integer; + var Height: Integer); +begin + MeasureItem(Index, Height); +end; + +procedure TdxBarCustomCombo.AfterDropDown; +begin + with TdxBarDropDownListBox(ListBox) do + if LeftButtonPressed then + begin + SetCapture(Handle); + WaitForCapture := True; + end + else + WaitForCapture := False; +end; + +function TdxBarCustomCombo.CheckKeyForDropDownWindow(Key: Word; + Shift: TShiftState): Boolean; +begin + Result := (Shift = []) and + ((Key = VK_UP) or (Key = VK_DOWN) or (Key = VK_PRIOR) or (Key = VK_NEXT)); +end; + +procedure TdxBarCustomCombo.CloseUp; +begin + inherited; + FListBox.Parent := nil; +end; + +procedure TdxBarCustomCombo.CurChange; +begin + inherited; + CheckLocalPos; +end; + +procedure TdxBarCustomCombo.DrawInterior(ABarEditControl: TdxBarEditControl; ACanvas: TCanvas; + R: TRect; ItemLink: TdxBarItemLink); +var + AIndex: Integer; +begin + FCanvas := ACanvas; + try + if FocusedItemLink = ItemLink then + AIndex := TdxBarComboControl(CurItemLink.Control).LocalItemIndex + else + AIndex := ItemIndex; + FInteriorIsDrawing := True; + try + DrawItem(ABarEditControl.Painter, AIndex, R, []); + finally + FInteriorIsDrawing := False; + end; + finally + FCanvas := nil; + end; +end; + +procedure TdxBarCustomCombo.DrawItem(APainter: TdxBarPainter; + AIndex: Integer; ARect: TRect; AState: TOwnerDrawState); +begin + if Assigned(FOnDrawItem) then + FOnDrawItem(Self, AIndex, ARect, AState) + else + APainter.CustomComboDrawItem(Self, Canvas, AIndex, ARect, AState, FInteriorIsDrawing); + if odFocused in AState then DrawFocusRect(Canvas.Handle, ARect); // for hiding focus rect +end; + +procedure TdxBarCustomCombo.DropDown(X, Y: Integer); +begin + FListBox.Parent := CurItemLink.Control.Parent; //BarManager.MainForm; + inherited; + CheckLocalPos; +end; + +function TdxBarCustomCombo.GetCanvas: TCanvas; +begin + if FCanvas <> nil then + Result := FCanvas + else + Result := FListBox.Canvas; +end; + +function TdxBarCustomCombo.GetDropDownWidth: Integer; +var + I, ItemWidth: Integer; +begin + Result := DropDownWidth; + if Result <= 0 then + begin + if CurItemLink <> nil then + Result := cxRectWidth(TdxBarComboControl(CurItemLink.Control).GetEditRect) - 2 * 2; + if DropDownCount < Items.Count then + Dec(Result, GetSystemMetrics(SM_CXVSCROLL)); + for I := 0 to Items.Count - 1 do + begin + MeasureItemWidth(I, ItemWidth); + if ItemWidth > Result then Result := ItemWidth; + end; + end; + Inc(Result, 2 + 2); + if DropDownCount < Items.Count then + Inc(Result, GetSystemMetrics(SM_CXVSCROLL)); +end; + +function TdxBarCustomCombo.GetDropDownWindow: HWND; +begin + Result := inherited GetDropDownWindow; + if Result = 0 then Result := FListBox.Handle; +end; + +function TdxBarCustomCombo.GetNearestItemIndex(AText: string): Integer; +var + AItem: string; + FoundChars, I, J: Integer; +begin + AText := AnsiUpperCase(AText); + FoundChars := 0; + Result := -1; + for I := 0 to Items.Count - 1 do + begin + AItem := AnsiUpperCase(Items[I]); + if Copy(AItem, 1, FoundChars) = Copy(AText, 1, FoundChars) then + for J := FoundChars + 1 to Length(AText) do + if (J <= Length(AItem)) and (AItem[J] = AText[J]) then + begin + FoundChars := J; + Result := I; + if J = Length(AText) then Exit; + end + else Break; + end; +end; + +procedure TdxBarCustomCombo.InitDropDownWindow; +var + AWidth, AHeight, I: Integer; +begin + InternalInitDropDownWindow(FListBox); + FListBox.Canvas.Font := TdxBarDropDownListBox(FListBox).Font; + FListBox.Items.Assign(Items); + + AWidth := GetDropDownWidth; + if DropDownCount > Items.Count then + I := Items.Count + else + I := DropDownCount; + AHeight := 2 * 2; + for I := 0 to I - 1 do Inc(AHeight, ItemsHeight[I]); + + SetWindowPos(FListBox.Handle, 0, 0, 0, AWidth, AHeight, + SWP_NOZORDER or SWP_NOMOVE or SWP_NOACTIVATE); +end; + +procedure TdxBarCustomCombo.MeasureItem(AIndex: Integer; var AHeight: Integer); +begin + if ItemHeight <= 0 then AHeight := Canvas.TextHeight('Qq') + else AHeight := ItemHeight; + if Assigned(FOnMeasureItem) then FOnMeasureItem(Self, AIndex, AHeight); +end; + +procedure TdxBarCustomCombo.MeasureItemWidth(AIndex: Integer; var AWidth: Integer); +begin + AWidth := 1 + Canvas.TextWidth(Items[AIndex]) + 1; +end; + +procedure TdxBarCustomCombo.SetText(Value: string); +begin + if (FItemIndex = -1) or (Items[FItemIndex] <> Value) then + FItemIndex := Items.IndexOf(Value); + inherited; +end; + +{ TCustomdxBarSubItem } + +constructor TCustomdxBarSubItem.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FItemLinks := TdxBarSubMenuControlItemLinks.Create(BarManager, Self); + FShowCaption := True; +end; + +destructor TCustomdxBarSubItem.Destroy; +begin + DetachingBar := -1; + FreeAndNil(FItemLinks); + inherited Destroy; +end; + +function TCustomdxBarSubItem.GetDetachingBarIndex: Integer; +begin + if FDetachingBar = nil then + Result := -1 + else + Result := FDetachingBar.Index; +end; + +function TCustomdxBarSubItem.GetItemOptions: TdxBarItemOptions; +begin + Result := FItemLinks.ItemOptions; +end; + +procedure TCustomdxBarSubItem.SetBarSize(Value: Integer); +begin + if Value < 0 then Value := 0; + FBarSize := Value; +end; + +procedure TCustomdxBarSubItem.SetDetachingBar(Value: Integer); +begin + if (BarManager.Bars = nil) or + (Value < -1) or (Value > BarManager.Bars.Count - 1) then Value := -1; + if DetachingBar <> Value then + begin + if FDetachingBar <> nil then + FDetachingBar.RemoveFreeNotification(Self); + if Value = -1 then + FDetachingBar := nil + else + FDetachingBar := BarManager.Bars[Value]; + if FDetachingBar <> nil then + FDetachingBar.AddFreeNotification(Self); + end; +end; + +procedure TCustomdxBarSubItem.SetIsInternal(Value: Boolean); +begin + if FIsInternal <> Value then + begin + FIsInternal := Value; + FItemLinks.Internal := Value; + end; +end; + +procedure TCustomdxBarSubItem.SetItemLinks(Value: TdxBarItemLinks); +begin + FItemLinks.Assign(Value); +end; + +procedure TCustomdxBarSubItem.SetItemOptions(Value: TdxBarItemOptions); +begin + FItemLinks.ItemOptions := Value; +end; + +procedure TCustomdxBarSubItem.BarManagerChanged; +begin + if FItemLinks <> nil then + FItemLinks.FBarManager := BarManager; +end; + +function TCustomdxBarSubItem.CanClicked: Boolean; +begin + Result := False; +end; + +procedure TCustomdxBarSubItem.DoCloseUp; +begin + CallNotify(FOnCloseUp, Self); +end; + +procedure TCustomdxBarSubItem.DoDetaching; +begin + CallNotify(FOnDetaching, Self); +end; + +procedure TCustomdxBarSubItem.DoPopup; +begin + CallNotify(FOnPopup, Self); +end; + +procedure TCustomdxBarSubItem.InternalDropDown( + AItemControl: TdxBarSubItemControl; AByMouse: Boolean); +begin + if AByMouse then + AItemControl.Parent.SetMouseSelectedItem(AItemControl); + AItemControl.Parent.BarGetFocus(AItemControl); + AItemControl.DropDown(AByMouse); +end; + +procedure TCustomdxBarSubItem.ObjectNotification(AOperation: TOperation; + AObject: TObject); +begin + inherited; + if (AOperation = opRemove) and (AObject = FDetachingBar) then + DetachingBar := -1; +end; + +procedure TCustomdxBarSubItem.CheckLinks(ASource: TCustomIniFile; const ABaseSection: string); +begin + LoadFromIni(ASource, ABaseSection, skIni); + LoadUsageData(ASource, ABaseSection); + ItemLinks.CheckLinks(ASource, ABaseSection); +end; + +function TCustomdxBarSubItem.GetIniSection(const ABaseSection: string): string; +begin + Result := ABaseSection + 'SubItem_' + Name; +end; + +procedure TCustomdxBarSubItem.LoadFromIni(ASource: TCustomIniFile; const ABaseSection: string; AStoringKind: TdxBarStoringKind); +begin + if (Name <> '') and (ASource.ReadInteger(GetIniSection(ABaseSection), 'ItemLinkCount', -1) > -1) then + ItemLinks.LoadFromIni(ASource, GetIniSection(ABaseSection), AStoringKind); +end; + +procedure TCustomdxBarSubItem.LoadUsageData(ASource: TCustomIniFile; const ABaseSection: string); +begin + ItemLinks.LoadUsageData(ASource, GetIniSection(ABaseSection)); +end; + +procedure TCustomdxBarSubItem.SaveToIni(ADestination: TCustomIniFile; const ABaseSection: string; AStoringKind: TdxBarStoringKind); +begin + if Name <> '' then + ItemLinks.SaveToIni(ADestination, GetIniSection(ABaseSection), AStoringKind); +end; + +// IdxBarLinksOwner +function TCustomdxBarSubItem.CanContainItem(AItem: TdxBarItem; out AErrorText: string): Boolean; +begin + Result := AItem.CanBePlacedOn(pkSubItemOrPopupMenu, nil, AErrorText); + if Result then + begin + Result := (GetOwnedLinks(AItem) = nil) or not GetOwnedLinks(AItem).IsReferencedBy(Self); + if not Result then + AErrorText := cxGetResourceString(@dxSBAR_RECURSIVEMENUS); + end; +end; + +function TCustomdxBarSubItem.CreateBarControl: TCustomdxBarControl; +begin + if CurItemLink <> nil then + Result := TdxBarSubMenuControl.Create(CurItemLink.BarManager) + else + Result := TdxBarSubMenuControl.Create(BarManager); +end; + +function TCustomdxBarSubItem.GetItemLinks: TdxBarItemLinks; +begin + Result := FItemLinks; +end; + +// IdxBarSelectableItem +function TCustomdxBarSubItem.GetSupportedActions: TdxBarCustomizationActions; +begin + Result := inherited GetSupportedActions; + if BarManager.Designing then + Include(Result, caChangeButtonGroup); +end; + +// IdxBarSubMenuOwner +function TCustomdxBarSubItem.GetBarSize: Integer; +begin + Result := FBarSize; +end; + +procedure TCustomdxBarSubItem.DoPaintBar(Canvas: TCanvas; const R: TRect); +begin + if Assigned(FOnPaintBar) then FOnPaintBar(Self, Canvas, R); +end; + +function TCustomdxBarSubItem.GetDetachingBar: TdxBar; +begin + Result := FDetachingBar; +end; + +procedure TCustomdxBarSubItem.DropDown(AByMouse: Boolean = False); +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + with Links[I] do + if Control is TdxBarSubItemControl and IsControlVisible(BarControl) then + begin + InternalDropDown(TdxBarSubItemControl(Control), AByMouse); + Break; + end; +end; + +{ TdxBarSubItem } + +constructor TdxBarSubItem.Create(AOwner: TComponent); +begin + inherited; + FAllowCustomizing := True; +end; + +class function TdxBarSubItem.GetNewCaption: string; +begin + Result := dxSBAR_NEWSUBITEMCAPTION; +end; + +function TdxBarSubItem.InternalCanMergeWith(AItem: TdxBarItem): Boolean; +begin + Result := AItem is TdxBarSubItem; +end; + +{ TCustomdxBarContainerItem } + +destructor TCustomdxBarContainerItem.Destroy; +begin + if FNeedClearItemList then ClearItemList; + inherited; +end; + +procedure TCustomdxBarContainerItem.AddListedItemLinks(AItemLinks: TdxBarItemLinks; + AIndex: Integer; FirstCall: Boolean; CallingItemLink: TdxBarItemLink); +begin + if FNeedClearItemList then ClearItemList; + if FirstCall and Assigned(FOnGetData) then + begin + FInOnGetData := True; + try + FOnGetData(Self); + finally + FInOnGetData := False; + end; + end; +end; + +procedure TCustomdxBarContainerItem.DeleteListedItemLinks(AItemLinks: TdxBarItemLinks; + AIndex: Integer); +begin +end; + +procedure TCustomdxBarContainerItem.ClearItemList; +begin + FNeedClearItemList := False; +end; + +function TCustomdxBarContainerItem.HideWhenRun: Boolean; +begin + Result := True; +end; + +function TCustomdxBarContainerItem.InternalActuallyVisible: Boolean; +begin + Result := Assigned(FOnGetData); +end; + +procedure TCustomdxBarContainerItem.ItemsChanged(AItemLinks: TObject); +begin + if not FInOnGetData and not ResettingToolbar then + VisibleChanged; +end; + +procedure TCustomdxBarContainerItem.NeedClearItemList; +begin + FNeedClearItemList := True; +end; + +{ TdxBarListItem } + +constructor TdxBarListItem.Create(AOwner: TComponent); +begin + inherited; + FItems := TStringList.Create; + TStringList(FItems).OnChange := ItemsChanged; + FItemIndex := -1; + FItemList := TList.Create; + FShowNumbers := True; +end; + +destructor TdxBarListItem.Destroy; +begin + FreeAndNil(FItemList); + FreeAndNil(FItems); + inherited; +end; + +function TdxBarListItem.GetDataIndex: Integer; +var + I: Integer; +begin + Result := -1; + if (0 <= FItemIndex) and (FItemIndex < Items.Count) then + for I := 0 to FItemIndex do + if Items[I] <> ListItemSeparator then Inc(Result); +end; + +procedure TdxBarListItem.SetDataIndex(Value: Integer); +var + J, I: Integer; +begin + if Items.Count = 0 then + I := -1 + else + begin + J := -1; + for I := 0 to Items.Count - 1 do + begin + if Items[I] <> ListItemSeparator then Inc(J); + if J = Value then Break; + end; + end; + ItemIndex := I; +end; + +procedure TdxBarListItem.SetItems(Value: TStrings); +begin + FItems.Assign(Value); +end; + +procedure TdxBarListItem.ClickItem(Sender: TObject); +begin + FItemIndex := TComponent(Sender).Tag; + DirectClick; +end; + +procedure TdxBarListItem.AddListedItemLinks(AItemLinks: TdxBarItemLinks; + AIndex: Integer; FirstCall: Boolean; CallingItemLink: TdxBarItemLink); +var + I, CurIndex: Integer; + IsBeginGroup, ItemListExists: Boolean; +begin + inherited; + IsBeginGroup := False; + ItemListExists := FItemList.Count > 0; + CurIndex := 0; + for I := 0 to Items.Count - 1 do + if Items[I] = ListItemSeparator then + IsBeginGroup := True + else + begin + if not ItemListExists then + begin + FItemList.Add(TdxBarButton.Create(BarManager.Owner)); + with TdxBarButton(FItemList[CurIndex]) do + begin + Action := Self.Action; + if ShowCheck and (I{CurIndex} = FItemIndex) then + begin + ButtonStyle := bsChecked; + Down := True; + end; + if FShowNumbers then + begin + if CurIndex < 9 then + FCaption := IntToStr(CurIndex + 1) + else + FCaption := Chr(Ord('A') + CurIndex - 9); + FCaption := '&' + FCaption + ' '; + end + else + FCaption := ''; + FCaption := FCaption + GetDisplayText(I); + Hint := GetDisplayHint(Items[I]); + Tag := I; //CurIndex; + OnClick := ClickItem; + Enabled := Self.Enabled; + end; + end; + with AItemLinks.Add do + begin + FOriginalItemLink := CallingItemLink; + Index := AIndex + CurIndex; + Item := TdxBarItem(FItemList[CurIndex]); + if (CurIndex = 0) or IsBeginGroup then BeginGroup := True; + Synchronize(CallingItemLink); + end; + IsBeginGroup := False; + Inc(CurIndex); + end; +end; + +procedure TdxBarListItem.ClearItemList; +begin + if (FItemList <> nil) and + (FItemList.Count > 0) and (TdxBarItem(FItemList.First).LinkCount = 0) then + while FItemList.Count > 0 do + begin + TdxBarItem(FItemList.Last).Free; + FItemList.Delete(FItemList.Count - 1); + end; + inherited; +end; + +procedure TdxBarListItem.DeleteListedItemLinks(AItemLinks: TdxBarItemLinks; + AIndex: Integer); +var + I: Integer; +begin + inherited; + for I := 0 to Items.Count - 1 do + if Items[I] <> ListItemSeparator then + AItemLinks[AIndex].Free; +end; + +function TdxBarListItem.GetDisplayHint(const AText: string): string; +begin + Result := ''; +end; + +function TdxBarListItem.GetDisplayText(const AText: string): string; +begin + Result := AText; +end; + +function TdxBarListItem.GetDisplayText(AItemIndex: Integer): string; +begin + Result := GetDisplayText(Items[AItemIndex]); +end; + +function TdxBarListItem.InternalActuallyVisible: Boolean; +begin + Result := inherited InternalActuallyVisible or (Items.Count > 0); +end; + +procedure TdxBarListItem.DirectClick; +begin + if CurItemLink = nil then inherited; +end; + +{ TdxBarContainerItem } + +constructor TdxBarContainerItem.Create(AOwner: TComponent); +begin + inherited; + FItemLinks.OnChange := ItemsChanged; +end; + +procedure TdxBarContainerItem.AddListedItemLinks(AItemLinks: TdxBarItemLinks; + AIndex: Integer; FirstCall: Boolean; CallingItemLink: TdxBarItemLink); +var + I: Integer; +begin + inherited; + if AItemLinks = ItemLinks then Exit; + AItemLinks.BeginUpdate; + try + for I := 0 to FItemLinks.CanVisibleItemCount - 1 do + with AItemLinks.Add do + begin + FOriginalItemLink := CallingItemLink; + Assign(FItemLinks.CanVisibleItems[I]); + Index := AIndex + I; + if (I = 0) and HideWhenRun then BeginGroup := True; + Synchronize(FOriginalItemLink); + end; + finally + AItemLinks.EndUpdate; + end; +end; + +procedure TdxBarContainerItem.DeleteListedItemLinks(AItemLinks: TdxBarItemLinks; + AIndex: Integer); +var + I: Integer; +begin + inherited; + if AItemLinks = ItemLinks then Exit; + for I := 0 to FItemLinks.CanVisibleItemCount - 1 do + AItemLinks[AIndex].Free; +end; + +function TdxBarContainerItem.InternalActuallyVisible: Boolean; +begin + Result := inherited InternalActuallyVisible or IsItemsExist; +end; + +function TdxBarContainerItem.InternalCanMergeWith(AItem: TdxBarItem): Boolean; +begin + Result := AItem is TdxBarContainerItem; +end; + +function TdxBarContainerItem.IsItemsExist: Boolean; +var + I: Integer; + AItemExists: Boolean; +begin + Result := ItemLinks.Count > 0; + if Result then // check empty items + begin + AItemExists := False; + for I := 0 to ItemLinks.Count - 1 do + if ItemLinks[I].Item <> nil then + begin + AItemExists := True; + Break; + end; + if AItemExists then + begin + Result := False; + for I := 0 to ItemLinks.Count - 1 do + if (ItemLinks[I].Item <> nil) and + ItemLinks[I].Item.ActuallyVisible then + begin + Result := True; + Break; + end; + end; + end; +end; + +{ TdxBarExtraPaneListItem } + +procedure TdxBarExtraPaneListItem.AddListedItemLinks(AItemLinks: TdxBarItemLinks; + AIndex: Integer; FirstCall: Boolean; CallingItemLink: TdxBarItemLink); + + procedure UpdateListedItemLinks; + var + I: Integer; + APaintStyle: TdxBarPaintStyle; + begin + APaintStyle := psStandard; + for I := 0 to Items.Count - 1 do + if ExtraPaneItem[I].ImageIndex <> -1 then + begin + TdxBarButton(FItemList[I]).ImageIndex := ExtraPaneItem[I].ImageIndex; + APaintStyle := psCaptionGlyph; + end; + for I := 0 to Items.Count - 1 do + TdxBarButton(FItemList[I]).PaintStyle := APaintStyle; + end; + +var + AHeader: TdxBarItem; +begin + inherited; + + UpdateListedItemLinks; + + AHeader := TdxBarLabel.Create(BarManager.Owner); + FItemList.Add(AHeader); + AHeader.Caption := Caption; + with AItemLinks.Add do + begin + FOriginalItemLink := CallingItemLink; + Index := AIndex; + Item := AHeader; + Synchronize(CallingItemLink); + end; +end; + +function TdxBarExtraPaneListItem.GetDisplayHint(const AText: string): string; +begin + Result := AText; +end; + +function TdxBarExtraPaneListItem.GetDisplayText(AItemIndex: Integer): string; +begin + Result := ExtraPaneItem[AItemIndex].DisplayText; + if Assigned(OnGetDisplayText) then + FOnGetDisplayText(Self, AItemIndex, Result); + if Result = '' then + Result := ChangeFileExt(ExtractFileName(ExtraPaneItem[AItemIndex].Text), ''); +end; + +function TdxBarExtraPaneListItem.InternalActuallyVisible: Boolean; +begin + Result := inherited InternalActuallyVisible or (Caption <> ''); +end; + +function TdxBarExtraPaneListItem.GetExtraPaneItem(AIndex: Integer): TdxBarExtraPaneItem; +begin + Result := TdxBarExtraPaneItem(Items.Objects[AIndex]); +end; + +{ TdxBarItemControlDrawParams } + +constructor TdxBarItemControlDrawParams.Create(ABarItemControl: TdxBarItemControl); +begin + inherited Create; + FBarItemControl := ABarItemControl; +end; + +procedure TdxBarItemControlDrawParams.SetViewSize(Value: TdxBarItemControlViewSize); +begin + if FViewSize <> Value then + begin + FViewSize := Value; + if FBarItemControl <> nil then + FBarItemControl.ResetCachedValues(False); + end; +end; + +{ TdxBarEditLikeControlDrawParams } + +function TdxBarEditLikeControlDrawParams.GetBarEditControl: TdxBarEditControl; +begin + Result := TdxBarEditControl(BarItemControl); +end; + +{ TdxBarStaticLikeControlDrawParams } + +function TdxBarStaticLikeControlDrawParams.GetBarStaticControl: TdxBarCustomStaticControl; +begin + Result := TdxBarCustomStaticControl(BarItemControl); +end; + +{ TdxBarItemControlViewInfo } + +constructor TdxBarItemControlViewInfo.Create(AControl: TdxBarItemControl); +begin + inherited Create(nil); + FControl := AControl; + FAllowedViewLevels := Control.ViewLevels; + FMinPossibleViewLevel := GetMinViewLevel(Control.PossibleViewLevels); + FViewLevelForButtonGroup := GetMinViewLevel(FAllowedViewLevels); + if FViewLevelForButtonGroup = ivlLargeIconWithText then + FViewLevelForButtonGroup := FMinPossibleViewLevel; + ResetCachedValues; +end; + +destructor TdxBarItemControlViewInfo.Destroy; +begin + if not Control.Parent.IsDestroying then + Control.Parent.ViewInfo.RemoveItemControlViewInfo(Self); + inherited Destroy; +end; + +procedure TdxBarItemControlViewInfo.ResetCachedValues; +var + AViewLevel: TdxBarItemRealViewLevel; +begin + for AViewLevel := Low(TdxBarItemRealViewLevel) to High(TdxBarItemRealViewLevel) do + FViewLevelInfos[AViewLevel].Calculated := False; +end; + +// IdxBarItemControlViewInfo +procedure TdxBarItemControlViewInfo.CalculateFinalize; +begin + BoundsCalculated; +end; + +function TdxBarItemControlViewInfo.GetAlign: TdxBarItemAlign; +begin + Result := Control.Item.Align; +end; + +function TdxBarItemControlViewInfo.GetAllowedViewLevels: TdxBarItemViewLevels; +begin + Result := FAllowedViewLevels; +end; + +function TdxBarItemControlViewInfo.GetBounds: TRect; +begin + Result := FBounds; +end; + +function TdxBarItemControlViewInfo.GetColumnRowCount: Integer; +begin + Result := FColumnRowCount; +end; + +function TdxBarItemControlViewInfo.GetPosition: TdxBarItemPosition; +begin + Result := Control.ItemLink.Position; +end; + +function TdxBarItemControlViewInfo.GetPositionInButtonGroup: TdxBarButtonGroupPosition; +begin + if Control.CanBePartOfButtonGroup then + Result := Control.ItemLink.ButtonGroup + else + Result := bgpNone; +end; + +function TdxBarItemControlViewInfo.GetRealPositionInButtonGroup: TdxBarButtonGroupRealPosition; +begin + Result := FRealPositionInButtonGroup; +end; + +function TdxBarItemControlViewInfo.GetRow: Integer; +begin + Result := FRow; +end; + +function TdxBarItemControlViewInfo.GetViewLevel: TdxBarItemViewLevel; +begin + Result := FViewLevel; +end; + +function TdxBarItemControlViewInfo.GetViewLevelForButtonGroup: TdxBarItemRealViewLevel; +begin + Result := FViewLevelForButtonGroup; +end; + +function TdxBarItemControlViewInfo.GetWidth( + AViewLevel: TdxBarItemRealViewLevel): Integer; +var + AMultiColumnItemControlViewInfo: IdxBarMultiColumnItemControlViewInfo; +begin + if IsMultiColumnItemControl(True, AMultiColumnItemControlViewInfo) then + begin + Result := AMultiColumnItemControlViewInfo.GetWidthForColumnCount(AMultiColumnItemControlViewInfo.GetColumnCount); + Exit; + end; + if not (AViewLevel in GetAllowedViewLevels) then + raise Exception.Create('Testing! The level is not allowed'); + if not FViewLevelInfos[AViewLevel].Calculated then + begin + FViewLevelInfos[AViewLevel].Width := Control.GetWidthByViewLevel(AViewLevel); + FViewLevelInfos[AViewLevel].Calculated := True; + end; + Result := FViewLevelInfos[AViewLevel].Width; +end; + +function TdxBarItemControlViewInfo.HasSeparator: Boolean; +begin + Result := Control.ItemLink.BeginGroup; // TODO check +end; + +function TdxBarItemControlViewInfo.IsMultiColumnItemControl(ACheckCollapsed: Boolean; + out AIMultiColumnItemControlViewInfo: IdxBarMultiColumnItemControlViewInfo): Boolean; +begin + Result := Supports(TObject(Self), IdxBarMultiColumnItemControlViewInfo, + AIMultiColumnItemControlViewInfo) and (not ACheckCollapsed or not AIMultiColumnItemControlViewInfo.GetCollapsed); +end; + +procedure TdxBarItemControlViewInfo.SetBounds(const Value: TRect); +begin + FBounds := Value; +end; + +procedure TdxBarItemControlViewInfo.SetColumnRowCount(Value: Integer); +begin + FColumnRowCount := Value; +end; + +procedure TdxBarItemControlViewInfo.SetRealPositionInButtonGroup( + Value: TdxBarButtonGroupRealPosition); +begin + FRealPositionInButtonGroup := Value; +end; + +procedure TdxBarItemControlViewInfo.SetRow(Value: Integer); +begin + FRow := Value; +end; + +procedure TdxBarItemControlViewInfo.SetViewLevel( + Value: TdxBarItemViewLevel); +begin + FViewLevel := Value; +end; + +procedure TdxBarItemControlViewInfo.BoundsCalculated; +begin +end; + +{ TdxCachedImageOptions } + +constructor TdxCachedImageOptions.Create; +begin + inherited; + FGlyph := TcxBitmap.Create; +end; + +destructor TdxCachedImageOptions.Destroy; +begin + FreeAndNil(FGlyph); + inherited; +end; + +procedure TdxCachedImageOptions.Cache(const ARect: TRect; AGlyph: TBitmap; + AImages: TCustomImageList; AImageIndex: Integer; ADrawMode: TcxImageDrawMode; + ATransparentColor: TColor; ASmoothImage, AUseLeftBottomPixelAsTransparent: Boolean); +var + AClientRect: TRect; +begin + AClientRect := cxRect(0, 0, cxRectWidth(ARect), cxRectHeight(ARect)); + FGlyph.SetSize(AClientRect.Right, AClientRect.Bottom); + cxDrawImage(FGlyph.Canvas.Handle, + AClientRect, AClientRect, AGlyph, AImages, AImageIndex, ADrawMode, + ASmoothImage, 0, ATransparentColor, AUseLeftBottomPixelAsTransparent); + FCachedDrawMode := ADrawMode; + FCachedImages := AImages; + FCachedGlyph := AGlyph; + FCached := True; +end; + +function TdxCachedImageOptions.IsCached(ADrawMode: TcxImageDrawMode; AGlyph: TBitmap; AImages: TCustomImageList): Boolean; +begin + Result := FCached and (FCachedDrawMode = ADrawMode) and + ((AGlyph <> nil) and (FCachedGlyph = AGlyph) or (AGlyph = nil) and (FCachedImages = AImages)) and + not FGlyph.Empty; +end; + +{ TdxBarItemControl } + +constructor TdxBarItemControl.Create(AItemLink: TdxBarItemLink); +begin + inherited Create; + FItemLink := AItemLink; + FParent := AItemLink.BarControl; + FDrawParams := GetDrawParamsClass.Create(Self); + FCachedImageOptions := TdxCachedImageOptions.Create; + + FViewInfo := GetViewInfoClass.Create(Self); + CalcDrawingConsts; + + FHotPartIndex := icpNone; + CalcDrawParams; + IdxBarItemControlViewInfo(ViewInfo).SetViewLevel(Parent.GetItemControlDefaultViewLevel(Self)); +end; + +destructor TdxBarItemControl.Destroy; +begin + BarAccessibilityHelperOwnerObjectDestroyed(FIAccessibilityHelper); + if CanFade then + GetFader.Remove(Self); + +//#DG + if (BarManager <> nil) and (BarManager.FSelectedItem = Self) then + BarManager.InternalSetSelectedItem(nil); + if FItemLink <> nil then FItemLink.FControl := nil; + if (FParent <> nil) and not BarManager.IsDestroying and + (FParent.SelectedControl = Self) and not BarManager.IsCustomizing then + if (FItemLink <> nil) and (FItemLink.VisibleIndex <> -1) then + FParent.SetMouseSelectedItem(nil) + else + FParent.SelectedLink := nil; + DeleteGDIObject(FBkBrush); + cxClearObjectLinks(Self); + FreeAndNil(FViewInfo); + FreeAndNil(FCachedImageOptions); + FreeAndNil(FDrawParams); + inherited Destroy; +end; + +procedure TdxBarItemControl.DoCalculateParts; +begin + CalcDrawParams(False); + CalcParts; +end; + +function TdxBarItemControl.FindPartAtPos(APoint: TPoint): Integer; +var + I: Integer; +begin + if not PtInRect(ItemBounds, APoint) then + Result := icpNone + else + begin + Result := icpNonClient; + for I := Low(FParts) to High(FParts) do + if PtInRect(FParts[I], APoint) then + begin + Result := I; + Break; + end; + end; +end; + +function TdxBarItemControl.GetAlign: TdxBarItemAlign; +begin + Result := Item.Align; + if (Result <> iaLeft) and not Parent.CanAlignControl(Self) then + Result := iaLeft; +end; + +function TdxBarItemControl.GetBarManager: TdxBarManager; +begin + if FItemLink <> nil then + Result := FItemLink.BarManager + else + Result := nil; +end; + +function TdxBarItemControl.GetBkBrush: HBRUSH; +begin + Result := FBkBrush; + if Result = 0 then + Result := Parent.BkBrush; +end; + +function TdxBarItemControl.GetCanvas: TcxCanvas; +begin + if FActiveCanvas <> nil then + Result := FActiveCanvas + else + Result := Parent.Canvas; +end; + +function TdxBarItemControl.GetFlat: Boolean; +begin + // TODO: obsolete + Result := Parent.Flat; +end; + +function TdxBarItemControl.GetIAccessibilityHelper: IdxBarAccessibilityHelper; +begin + if FIAccessibilityHelper = nil then + FIAccessibilityHelper := GetAccessibilityHelper(GetAccessibilityHelperClass.Create(Self)); + Result := FIAccessibilityHelper; +end; + +function TdxBarItemControl.GetIsSelected: Boolean; +begin + Result := (FParent <> nil) and (FParent.SelectedControl = Self) and + (Enabled or not FSelectedByMouse); +end; + +function TdxBarItemControl.GetItem: TdxBarItem; +begin + Result := GetItemByLink(FItemLink); +end; + +function TdxBarItemControl.GetItemBounds: TRect; +begin + Result := ItemLink.ItemRect; +end; + +function TdxBarItemControl.GetPainterClass: TdxBarPainterClass; +begin + Result := TdxBarPainterClass(Painter.ClassType); +end; + +function TdxBarItemControl.GetRealHeight: Integer; +var + ASavedFont: TdxBarSavedFont; +begin + PrepareCanvasFont(0, Item.Style, ASavedFont); + try + Result := GetHeight; + if (Align = iaClient) and Parent.IsRealVertical then + if Parent.IsVertical then + Result := MinWidth + else + Result := MinHeight; + finally + RestoreCanvasFont(ASavedFont); + end; +end; + +function TdxBarItemControl.GetRealWidth: Integer; +var + ASavedFont: TdxBarSavedFont; +begin + PrepareCanvasFont(0, Item.Style, ASavedFont); + try + Result := GetWidth; + if (Align = iaClient) and (bboExtendItemWhenAlignedToClient in Parent.BehaviorOptions) and + not Parent.IsRealVertical or (Result < MinWidth) then + Result := MinWidth; + finally + RestoreCanvasFont(ASavedFont); + end; +end; + +function TdxBarItemControl.GetShowDescription: Boolean; +begin + Result := (ItemLink.Owner.ItemSize = misLarge) and ItemLink.Owner.ItemShowDescriptions; +end; + +function TdxBarItemControl.GetSubMenuParent: TdxBarSubMenuControl; +begin + Result := Parent as TdxBarSubMenuControl; +end; + +function TdxBarItemControl.GetUnclickAfterDoing: Boolean; +begin + if Item is TdxBarButton then + Result := Item.UnclickAfterDoing + else + Result := True; +end; + +function TdxBarItemControl.InternalGetPossibleViewLevels: TdxBarItemViewLevels; +begin + Result := GetPossibleViewLevels; + if Result = [] then + raise Exception.Create(ClassName + '.GetPossibleViewLevels = []'); +end; + +procedure TdxBarItemControl.SetPressed(Value: Boolean); +begin + if FPressed <> Value then + begin + FPressed := Value; + PressedChanged; + end; +end; + +//IdxFadingObject +function TdxBarItemControl.CanFade: Boolean; +begin + Result := GetFader <> nil; +end; + +procedure TdxBarItemControl.DrawBitmap(ABitmap: TBitmap); +begin + Canvas.Draw(ItemBounds.Left, ItemBounds.Top, ABitmap); +end; + +procedure TdxBarItemControl.GetFadingParams( + out AFadeOutImage, AFadeInImage: TBitmap; + var AFadeInStageCount, AFadeInStageInterval, + AFadeOutStageCount, AFadeOutStageInterval: Integer); +begin +{ + AFadeOutImage := TBitmap.Create; + AFadeOutImage.Width := cxRectWidth(ItemBounds); + AFadeOutImage.Height := cxRectHeight(ItemBounds); + + AFadeInImage := TBitmap.Create; + AFadeInImage.Width := cxRectWidth(ItemBounds); + AFadeInImage.Height := cxRectHeight(ItemBounds); + + FDrawParams.Canvas.Canvas.Handle := AFadeInImage.Canvas.Handle; + Paint(Rect(0, 0, AFadeInImage.Width, AFadeInImage.Height), GetPaintType); + FDrawParams.Canvas.Canvas.Handle := 0; +} +end; + +function TdxBarItemControl.GetFader: TdxFader; +begin + Result := Parent.GetFader; +end; + +// IdxBarHintKeeper +function TdxBarItemControl.DoHint(var ANeedDeactivate: Boolean; out AHintText: string; out AShortCut: string): Boolean; +var + Action: TBasicAction; +begin + Result := False; + ANeedDeactivate := False; + AShortCut := ''; + AHintText := ''; + + if (Parent <> nil) and Parent.CanShowHint and (Parent.ItemAtMousePos = Self) then + begin + AHintText := GetShortHint(Hint); + AShortCut := GetShortCutToHint(ShortCut); + Action := Item.Action; + if Action is TCustomAction then + if not TCustomAction(Action).DoHint(AHintText) then + begin + ANeedDeactivate := True; + Exit; + end; + Result := True; + end; +end; + +function TdxBarItemControl.CreateHintViewInfo(const AHintText, AShortCut: string): TdxBarCustomHintViewInfo; +begin + Result := Parent.CreateHintViewInfo(AHintText, AShortCut, Item.ScreenTip); +end; + +function TdxBarItemControl.GetEnabled: Boolean; +begin + if Item <> nil then + Result := Item.Enabled + else + Result := False; +end; + +function TdxBarItemControl.GetHintPosition(const ACursorPos: TPoint; AHeight: Integer): TPoint; +begin + Result := Parent.GetHintPosition(ViewInfo.Bounds, ACursorPos, AHeight); +end; + +procedure TdxBarItemControl.BeginGroupChanged; +begin + FParent.RepaintBar; +end; + +procedure TdxBarItemControl.CaptionChanged; +begin + if (Align = iaClient) and (bboExtendItemWhenAlignedToClient in Parent.BehaviorOptions) then + Repaint + else + FParent.RepaintBar; +end; + +procedure TdxBarItemControl.EnabledChanged; +begin + if not Enabled and (Parent.SelectedControl = Self) then + Parent.SelectedLink := nil; + Repaint; +end; + +procedure TdxBarItemControl.GlyphChanged; + + function GlyphAreaWidthChanged: Boolean; + begin + Result := (IdxBarItemControlViewInfo(ViewInfo).GetAllowedViewLevels <> ViewLevels) or + ((cpIcon in FDrawParams.ViewStructure) <> (cpIcon in GetViewStructure)); + end; + +begin + if GlyphAreaWidthChanged then + Parent.RepaintBar + else + Repaint; +end; + +procedure TdxBarItemControl.HotGlyphChanged; +begin +// do nothing +end; + +procedure TdxBarItemControl.LargeGlyphChanged; +begin + if FDrawParams.ViewSize <> cvsSmall then + if FDrawParams.PaintType <> ptMenu then + Parent.RepaintBar + else + Repaint; +end; + +procedure TdxBarItemControl.PartsChanged; +begin + DoCalculateParts; + Repaint; +end; + +procedure TdxBarItemControl.PaintStyleChanged; +begin +// do nothing +end; + +procedure TdxBarItemControl.ParentVisibleChange(AIsShowing: Boolean); +begin +// do nothing +end; + +procedure TdxBarItemControl.PressedChanged; +begin + if not FPressed then Repaint; +end; + +procedure TdxBarItemControl.RealVisibleChanging(AVisible: Boolean); +begin +end; + +procedure TdxBarItemControl.VisibleChanged; +begin + FParent.RepaintBar; +end; + +procedure TdxBarItemControl.WidthChanged; +begin + if Parent is TdxBarControl then + Parent.RepaintBar; +end; + +procedure TdxBarItemControl.ResetCachedValues(AFull: Boolean); +begin + if AFull then + ViewInfo.ResetCachedValues; + FCachedImageOptions.Cached := False; +end; + +function TdxBarItemControl.UseLargeGlyph(AViewSize: TdxBarItemControlViewSize): Boolean; +begin + Result := IsGlyphAssigned(Item.LargeGlyph) and + UseLargeImageSource(AViewSize); +end; + +function TdxBarItemControl.UseLargeIcons: Boolean; +begin + Result := BarManager.LargeIcons and Painter.AllowLargeIcons; +end; + +function TdxBarItemControl.UseLargeImageSource(AViewSize: TdxBarItemControlViewSize): Boolean; +begin + Result := (AViewSize = cvsLarge) or + (GetPaintType <> ptMenu) and UseLargeIcons and BarManager.UseLargeImagesForLargeIcons; +end; + +function TdxBarItemControl.UseLargeImageList(AViewSize: TdxBarItemControlViewSize): Boolean; +begin + Result := UseLargeImageSource(AViewSize) and + Item.IsImageIndexLinked(LargeImages, GetCurrentImageIndex(AViewSize)); +end; + +procedure TdxBarItemControl.BeforeDestroyParentHandle; +begin +end; + +function TdxBarItemControl.CanBePartOfButtonGroup: Boolean; +begin + Result := False; +end; + +function TdxBarItemControl.CanClicked: Boolean; +begin + Result := True; +end; + +function TdxBarItemControl.CanCustomize: Boolean; +begin + Result := + (BarManager = Item.BarManager) or + (csAncestor in BarManager.ComponentState); +end; + +function TdxBarItemControl.CanDeselect(ABarManager: TdxBarManager): Boolean; +begin + Result := CanHide; +end; + +function TdxBarItemControl.CanHide: Boolean; +begin + Result := True; +end; + +function TdxBarItemControl.CanMouseSelect: Boolean; +begin + Result := CanSelect; +end; + +function TdxBarItemControl.CanSelect: Boolean; +begin + Result := not IsSelectionForbidden; +end; + +function TdxBarItemControl.CanShowShortCut: Boolean; +begin + Result := ItemLink.Owner.ItemShowShortCuts; +end; + +function TdxBarItemControl.CanVisuallyPressed: Boolean; +begin + Result := not Parent.HideOnClick; +end; + +procedure TdxBarItemControl.CheckHotTrack(APoint: TPoint); +var + ACurrentHotPart: Integer; +begin + if Enabled then + begin + ACurrentHotPart := FindPartAtPos(APoint); + if ACurrentHotPart <> FHotPartIndex then + begin + FHotPartIndex := ACurrentHotPart; + Repaint; + end; + end + else + FHotPartIndex := icpNone; +end; + +procedure TdxBarItemControl.Click(AByMouse: Boolean; AKey: Char = #0); +var + AParent: TCustomdxBarControl; +begin + if Enabled then + begin + AParent := Parent; + ControlClick(AByMouse, AKey); + if BarControlExists(AParent) and AParent.IsControlExists(Self) then + ControlUnclick(AByMouse); + end; +end; + +procedure TdxBarItemControl.ControlActivate(Immediately: Boolean); +begin + FIsActive := True; +end; + +procedure TdxBarItemControl.ControlInactivate(Immediately: Boolean); +begin + FIsActive := False; +end; + +procedure TdxBarItemControl.ControlClick(AByMouse: Boolean; AKey: Char = #0); +begin +end; + +procedure TdxBarItemControl.ControlUnclick(ByMouse: Boolean); +var + AItem: TdxBarItem; + AItemLink: TdxBarItemLink; + AllowClick, AIsDestroyOnClick, AllowPressed: Boolean; +// AParent: TCustomdxBarControl; + ALinkSelf, ALinkItem: TcxObjectLink; +begin + if (Self is TdxBarButtonControl) and (Parent.Kind = bkSubMenu) then + PlaySound(psMenuCommand); + AItemLink := FItemLink.RealItemLink; + AItem := FItemLink.Item; + AllowClick := CanClicked; + AIsDestroyOnClick := IsDestroyOnClick; +// AParent := Parent; + try + if AIsDestroyOnClick then + begin + AItemLink.BringToTopInRecentList(True); + // for TCustomdxBarContainerItem: + if AItemLink <> FItemLink then FItemLink.BringToTopInRecentList(True); + end; + except + end; + + ALinkSelf := cxAddObjectLink(Self); + AllowPressed := + UnclickAfterDoing and (not AIsDestroyOnClick or CanVisuallyPressed); + if AllowPressed then Pressed := True; + try + if AIsDestroyOnClick then + Parent.HideAll + else + if AItemLink = nil then AItemLink := FItemLink; + if AllowClick then + begin + ALinkItem := cxAddObjectLink(AItem); + AItem.FClickItemLink := AItemLink; + try + AItem.DirectClick; + finally + if ALinkItem.Ref <> nil then + AItem.FClickItemLink := nil; + cxRemoveObjectLink(ALinkItem); + end; + end; + finally + if (ALinkSelf.Ref <> nil) and AllowPressed {and BarControlExists(AParent)} then + Pressed := False; + cxRemoveObjectLink(ALinkSelf); + end; +end; + +procedure TdxBarItemControl.ControlGetFocus(AIsSelected: Boolean; var AProcessed: Boolean); +begin + Parent.IsDowned := False; + Parent.SetKeySelectedItem(Self); +end; + +procedure TdxBarItemControl.DblClick; +begin +end; + +function TdxBarItemControl.DrawSelected: Boolean; +begin + Result := IsSelected; +end; + +function TdxBarItemControl.GetSelectableObject: TPersistent; +begin + Result := ItemLink; +end; + +function TdxBarItemControl.WantsDblClick: Boolean; +begin + Result := BarManager.Designing or IsExpandable; +end; + +procedure TdxBarItemControl.KeyDown(var Key: Word; Shift: TShiftState); +begin +end; + +procedure TdxBarItemControl.KeyUp(var Key: Word; Shift: TShiftState); +begin +end; + +procedure TdxBarItemControl.KeyPress(var Key: Char); +begin +end; + +procedure TdxBarItemControl.MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin +// do nothing; +end; + +procedure TdxBarItemControl.MouseEnter(Shift: TShiftState; X, Y: Integer); +begin + CheckHotTrack(Point(X, Y)); +end; + +procedure TdxBarItemControl.MouseLeave; +begin + CheckHotTrack(Point(-1, -1)); +end; + +procedure TdxBarItemControl.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + CheckHotTrack(Point(X, Y)); +end; + +procedure TdxBarItemControl.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin +// do nothing; +end; + +function TdxBarItemControl.WantsKey(Key: Word): Boolean; +begin + Result := False; +end; + +function TdxBarItemControl.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxBarItemControlAccessibilityHelper; +end; + +function TdxBarItemControl.GetPossibleViewLevels: TdxBarItemViewLevels; +begin + Result := [ivlSmallIconWithText]; + if IconAssigned(cvsSmall) then + Include(Result, ivlSmallIcon); +end; + +function TdxBarItemControl.GetViewLevels: TdxBarItemViewLevels; +begin + Result := PossibleViewLevels; + if Result * ItemLink.GetAllowedViewLevels <> [] then + Result := Result * ItemLink.GetAllowedViewLevels; +end; + +function TdxBarItemControl.GetViewStructure: TdxBarItemControlViewStructure; +begin + case ViewInfo.ViewLevel of + ivlLargeIconWithText, ivlSmallIconWithText: + begin + Result := [cpText]; + if IconAssigned(GetViewSize) then + Include(Result, cpIcon); + end; + ivlSmallIcon: + if IconAssigned(GetViewSize) then + Result := [cpIcon] + else + Result := []; + ivlControlOnly: Result := []; + ivlDefault: Result := GetDefaultViewStructure; + end; +end; + +function TdxBarItemControl.GetDefaultViewStructure: TdxBarItemControlViewStructure; +begin + Result := []; +end; + +function TdxBarItemControl.GetViewSize: TdxBarItemControlViewSize; +begin + case ViewInfo.ViewLevel of + ivlLargeIconWithText: Result := cvsLarge; + ivlSmallIconWithText, ivlSmallIcon: Result := cvsSmall; + else + Result := GetDefaultViewSize; + end; +end; + +function TdxBarItemControl.GetDefaultViewSize: TdxBarItemControlViewSize; +begin + if MenuItemSize = misLarge then + Result := cvsLarge + else + if UseLargeIcons then + Result := cvsMedium + else + Result := cvsSmall; +end; + +function TdxBarItemControl.GetPaintType: TdxBarPaintType; +begin + Result := Parent.GetPaintType; +end; + +function TdxBarItemControl.GetPartCount: Integer; +begin + Result := 1; +end; + +function TdxBarItemControl.GetViewInfoClass: TdxBarItemControlViewInfoClass; +begin + Result := TdxBarItemControlViewInfo; +end; + +function TdxBarItemControl.GrayScale: Boolean; +begin + Result := False; +end; + +function TdxBarItemControl.HasIcon(AViewSize: TdxBarItemControlViewSize; AViewStructure: TdxBarItemControlViewStructure): Boolean; +begin + Result := IconAssigned(AViewSize) and (cpIcon in AViewStructure); +end; + +function TdxBarItemControl.IconAssigned(AViewSize: TdxBarItemControlViewSize): Boolean; +var + ACurrentGlyph: TBitmap; + ACurrentImageIndex: Integer; + ACurrentImages: TCustomImageList; +begin + Result := GetCurrentImage(AViewSize, False, ACurrentGlyph, ACurrentImages, ACurrentImageIndex); +end; + +procedure TdxBarItemControl.FrameAndFillRect(DC: HDC; var R: TRect; + Enabled, Selected, Pressed: Boolean); +begin + Painter.FrameAndFillRect(Self, DC, R, Enabled, Selected, Pressed); +end; + +function TdxBarItemControl.GetCaption: string; +begin + if FItemLink <> nil then + Result := FItemLink.Caption + else + Result := ''; +end; + +function TdxBarItemControl.GetControl: TControl; +begin + Result := nil; +end; + +function TdxBarItemControl.GetDrawParamsClass: TdxBarItemControlDrawParamsClass; +begin + Result := TdxBarItemControlDrawParams; +end; + +function TdxBarItemControl.GetGlyph: TBitmap; +begin + if FItemLink <> nil then + Result := FItemLink.Glyph + else + Result := nil; +end; + +function TdxBarItemControl.GetImageEnabled(APaintType: TdxBarPaintType): Boolean; +var + ACurrentGlyph: TBitmap; + ACurrentImages: TCustomImageList; + ACurrentImageIndex: Integer; +begin + GetCurrentImage(FDrawParams.ViewSize, False, ACurrentGlyph, ACurrentImages, ACurrentImageIndex); + Result := Enabled or + not IsGlyphAssigned(ACurrentGlyph) and + (not UseLargeImageList(FDrawParams.ViewSize) and (BarManager.DisabledImages <> nil) or + UseLargeImageList(FDrawParams.ViewSize) and (BarManager.DisabledLargeImages <> nil)); +end; + +function TdxBarItemControl.GetImageIndex: Integer; +begin + Result := Item.ImageIndex; +end; + +function TdxBarItemControl.GetImageList(AViewSize: TdxBarItemControlViewSize): TCustomImageList; +begin + if UseLargeImageList(AViewSize) then + Result := LargeImages + else + Result := Images; +end; + +function TdxBarItemControl.GetImages: TCustomImageList; +begin + if not Enabled and (BarManager.DisabledImages <> nil) then + Result := BarManager.DisabledImages + else + Result := BarManager.Images; +end; + +function TdxBarItemControl.GetHint; +begin + if Item <> nil then + Result := Item.Hint + else + Result := ''; +end; + +function TdxBarItemControl.GetHotImages: TCustomImageList; +begin + Result := FItemLink.Item.BarManager.HotImages; +end; + +function TdxBarItemControl.GetLargeGlyph: TBitmap; +begin + Result := Item.LargeGlyph; +end; + +function TdxBarItemControl.GetLargeImageIndex: Integer; +begin + Result := Item.LargeImageIndex; +end; + +function TdxBarItemControl.GetLargeImages: TCustomImageList; +begin + if not Enabled and (BarManager.DisabledLargeImages <> nil) then + Result := BarManager.DisabledLargeImages + else + Result := BarManager.LargeImages; +end; + +function TdxBarItemControl.GetMenuItemSize: TdxBarMenuItemSize; +begin + Result := ItemLink.Owner.ItemSize; +end; + +function TdxBarItemControl.GetPainter: TdxBarPainter; +begin + Result := Parent.Painter; +end; + +function TdxBarItemControl.GetShortCut; +begin + if Item <> nil then + Result := Item.ShortCut + else + Result := 0; +end; + +function TdxBarItemControl.GetTextAreaOffset: Integer; +begin + Result := Painter.TextAreaOffset(Self); +end; + +procedure TdxBarItemControl.CalcDrawParams(AFull: Boolean = True); +begin + if AFull then + begin + FDrawParams.Caption := Caption; + FDrawParams.Description := Item.Description; + FDrawParams.ShortCut := ''; + FDrawParams.PaintType := GetPaintType; + FDrawParams.Enabled := Enabled; + FDrawParams.CanSelect := CanSelect; + FDrawParams.DrawSelected := DrawSelected; + FDrawParams.IsDropDown := IsDropDown; + FDrawParams.HotPartIndex := FHotPartIndex; + FDrawParams.IsCustomizing := FParent.IsCustomizing; + FDrawParams.SelectedByKey := DrawSelected and not FSelectedByMouse; + end; + FDrawParams.Canvas := Canvas; + FDrawParams.ViewSize := GetViewSize; + FDrawParams.ViewStructure := GetViewStructure; + FDrawParams.DefaultButtonSize := Painter.GetButtonSize(BarManager.GlyphSize, GetTextSize); +end; + +procedure TdxBarItemControl.CalcParts; +var + I: Integer; +begin + SetLength(FParts, GetPartCount); + for I := Low(FParts) to High(FParts) do + FParts[I] := ItemBounds; +end; + +procedure TdxBarItemControl.CalcDrawingConsts; +var + ASavedFont: TdxBarSavedFont; +begin + PrepareCanvasFont(0, Item.Style, ASavedFont); + try + DoCalcDrawingConsts; + finally + RestoreCanvasFont(ASavedFont); + end; +end; + +procedure TdxBarItemControl.DoCalcDrawingConsts; +var + ATextViewParams: TcxViewParams; +begin + DeleteGDIObject(FBkBrush); + if Item.IsStyleColorSupported then + begin + Item.GetTextViewParams(ATextViewParams); + if ATextViewParams.Color <> clDefault then + FBkBrush := CreateSolidBrush(ColorToRGB(ATextViewParams.Color)); + end; + FTextSize := Parent.GetTextSize; +end; + +procedure TdxBarItemControl.DoPaint(ARect: TRect; PaintType: TdxBarPaintType); +begin +// do nothing +end; + +function TdxBarItemControl.IsTransparentOnGlass: Boolean; +begin + Result := True; +end; + +procedure TdxBarItemControl.Paint(ACanvas: TcxCanvas; ARect: TRect; PaintType: TdxBarPaintType); +var + ASavedFont: TdxBarSavedFont; +begin + if not IsRectEmpty(ARect) then + begin + ACanvas.SaveState; + try + if ACanvas <> Canvas then + ACanvas.Font := Canvas.Font; + FActiveCanvas := ACanvas; + try + PrepareCanvasFont(0, Item.Style, ASavedFont); + try + CalcDrawParams; + DoPaint(ARect, PaintType); + finally + RestoreCanvasFont(ASavedFont); + end; + finally + FActiveCanvas := nil; + CalcDrawParams(False); + end; + finally + ACanvas.RestoreState; + end; + end; +end; + +procedure TdxBarItemControl.PrepareCanvasFont(ABaseFont: HFONT; + AStyle: TcxStyle; out ASavedFont: TdxBarSavedFont); +var + ABaseLogFont, ALogFont: TLogFont; +begin + ASavedFont.Saved := (AStyle <> nil) and (svFont in AStyle.AssignedValues) or + (ABaseFont <> 0); + if ASavedFont.Saved then + begin + cxGetFontData(Canvas.Font.Handle, ASavedFont.LogFont); + if ABaseFont <> 0 then + cxGetFontData(ABaseFont, ABaseLogFont) + else + ABaseLogFont := ASavedFont.LogFont; + if (AStyle <> nil) and (svFont in AStyle.AssignedValues) then + begin + cxGetFontData(AStyle.Font.Handle, ALogFont); + ALogFont.lfEscapement := ABaseLogFont.lfEscapement; + ALogFont.lfOrientation := ALogFont.lfEscapement; + ALogFont.lfOutPrecision := ABaseLogFont.lfOutPrecision; + Canvas.Font.Handle := CreateFontIndirect(ALogFont); + end + else + Canvas.Font.Handle := CreateFontIndirect(ABaseLogFont); + end; +end; + +procedure TdxBarItemControl.RestoreCanvasFont(const ASavedFont: TdxBarSavedFont); +begin + if ASavedFont.Saved then + begin + Canvas.Font.Handle := CreateFontIndirect(ASavedFont.LogFont); + Canvas.Handle; // RequiredState(csAllValid) + end; +end; + +function TdxBarItemControl.GetOwnedBarControl: TCustomdxBarControl; +begin + Result := nil; +end; + +function TdxBarItemControl.GetNonBufferedRect: TRect; +begin + Result := cxEmptyRect; +end; + +function TdxBarItemControl.GetCaptionWidth: Integer; +var + ASavedFont: TdxBarSavedFont; +begin + PrepareCanvasFont(0, Item.Style, ASavedFont); + try + Result := cxRectWidth(Painter.GetControlCaptionRect(FDrawParams)); + finally + RestoreCanvasFont(ASavedFont); + end; +end; + +function TdxBarItemControl.GetCurrentImage(AViewSize: TdxBarItemControlViewSize; ASelected: Boolean; + out ACurrentGlyph: TBitmap; out ACurrentImages: TCustomImageList; out ACurrentImageIndex: Integer): Boolean; +begin + ACurrentImages := GetImageList(AViewSize); + ACurrentImageIndex := GetCurrentImageIndex(AViewSize); + + if UseLargeGlyph(AViewSize) then + ACurrentGlyph := Item.LargeGlyph + else + if not UseLargeImageList(AViewSize) then + ACurrentGlyph := Glyph + else + ACurrentGlyph := nil; + if not IsGlyphAssigned(ACurrentGlyph) then + ACurrentGlyph := nil; + + Result := IsGlyphAssigned(ACurrentGlyph) or Item.IsImageIndexLinked(ACurrentImages, ACurrentImageIndex); + if not Result then + begin + ACurrentGlyph := Parent.GetDefaultItemGlyph; + Result := IsGlyphAssigned(ACurrentGlyph); + end; +end; + +function TdxBarItemControl.GetCurrentImageIndex(AViewSize: TdxBarItemControlViewSize): Integer; +begin + if UseLargeImageSource(AViewSize) and (LargeImages <> nil) and (LargeImageIndex <> -1) then + Result := LargeImageIndex + else + Result := ImageIndex; +end; + +function TdxBarItemControl.GetGlyphSize(AViewSize: TdxBarItemControlViewSize; ASelected: Boolean = False): TSize; +var + ACurrentGlyph: TBitmap; + ACurrentImages: TCustomImageList; + ACurrentImageIndex: Integer; +begin + if not GetCurrentImage(AViewSize, ASelected, ACurrentGlyph, ACurrentImages, ACurrentImageIndex) then + begin + if AViewSize = cvsLarge then + Result := cxSize(20, 20) + else + Result := cxSize(BarManager.GlyphSize, BarManager.GlyphSize); + end + else + if ACurrentGlyph = nil then + Result := cxSize(ACurrentImages.Width, ACurrentImages.Height) + else + Result := cxSize(ACurrentGlyph.Width, ACurrentGlyph.Height); +end; + +function TdxBarItemControl.GetIndents(ADrawAreaType: TdxBarItemControlPart): TRect; +begin + Result := Painter.ItemControlGetIndents(FDrawParams, ADrawAreaType); +end; + +function TdxBarItemControl.GetRotationDependentHeight(ASourceSize: TSize): Integer; +begin + if IsRotated then + Result := ASourceSize.cx + else + Result := ASourceSize.cy; +end; + +function TdxBarItemControl.GetRotationDependentWidth(ASourceSize: TSize): Integer; +begin + if IsRotated then + Result := ASourceSize.cy + else + Result := ASourceSize.cx; +end; + +function TdxBarItemControl.GetTextExtent(const AText: string): TSize; +var + ASavedFont: TdxBarSavedFont; +begin + PrepareCanvasFont(0, Item.Style, ASavedFont); + try + Result := Canvas.TextExtent(AText); + finally + RestoreCanvasFont(ASavedFont); + end; +end; + +function TdxBarItemControl.GetTextHeight: Integer; +begin + Result := GetTextExtent('Qq').cy; +end; + +function TdxBarItemControl.GetTextSize: Integer; +begin + if (Item.Style <> nil) and (svFont in Item.Style.AssignedValues) then + Result := FTextSize + else + Result := Parent.TextSize; +end; + +function TdxBarItemControl.GetTextWidth(const AText: string): Integer; +begin + Result := GetTextExtent(AText).cx; +end; + +function TdxBarItemControl.GetCaptionAreaWidth: Integer; + + function GetTailAreaSize: Integer; + begin + Result := Painter.GetTailAreaSize(FDrawParams); + end; + + function GetShortCutAreaSize: Integer; + begin + if CanShowShortCut and (ShortCut <> 0) then + Result := Parent.TextSize - 6 + GetTextWidth(FDrawParams.ShortCut) + else + Result := 0; + end; + +var + ADescriptionWidth: Integer; +begin + if cpText in FDrawParams.ViewStructure then + begin + if FDrawParams.PaintType = ptMenu then + begin + Result := GetCaptionWidth + GetShortCutAreaSize; + if (MenuItemSize = misLarge) and ShowDescription and (FDrawParams.Description <> '') then + begin + ADescriptionWidth := cxRectWidth(cxGetTextRect(Canvas.Handle, FDrawParams.Description, 2)); + Result := Max(Result, ADescriptionWidth); + end; + Inc(Result, GetIndents(cpText).Left + GetIndents(cpText).Right); + Inc(Result, GetTailAreaSize); + end + else + begin + Result := GetCaptionWidth; + if cpIcon in FDrawParams.ViewStructure then + Inc(Result, Painter.GetControlTextIndents.Left) + else + Inc(Result, GetControlCaptionOffset * 2); + end + end + else + Result := 0; +end; + +function TdxBarItemControl.GetControlAreaWidth: Integer; +begin + Result := 0; +end; + +function TdxBarItemControl.GetGlyphAreaWidth: Integer; +begin + if FDrawParams.PaintType = ptMenu then + Result := Parent.IconAreaSize + else + if cpIcon in FDrawParams.ViewStructure then + Result := GetRotationDependentWidth(FDrawParams.DefaultButtonSize) + else + Result := 0; +end; + +function TdxBarItemControl.GetControlCaptionOffset: Integer; +begin + Result := Parent.Font.Size div 2; +end; + +function TdxBarItemControl.GetDefaultHeight: Integer; +begin + if Parent.Kind = bkSubMenu then + Result := GetDefaultHeightInSubMenu + else + if IsRotated then + Result := InternalGetDefaultWidth + else + Result := InternalGetDefaultHeight; +end; + +function TdxBarItemControl.GetDefaultWidth: Integer; +begin + if FDrawParams.PaintType = ptMenu then + Result := GetDefaultWidthInSubMenu + else + if IsRotated then + Result := InternalGetDefaultHeight + else + Result := InternalGetDefaultWidth; +end; + +function TdxBarItemControl.GetDefaultWidthHorzLayout: Integer; +begin + Result := GetGlyphAreaWidth + GetCaptionAreaWidth + GetControlAreaWidth; +end; + +function TdxBarItemControl.GetDefaultWidthVertLayout: Integer; +var + W: Integer; +begin + Result := GetRotationDependentWidth(GetGlyphSize(cvsLarge)); + + if cpText in FDrawParams.ViewStructure then + begin + W := 3 + GetCaptionWidth + 3; + if Item.GlyphLayout in [glLeft, glRight] then + Inc(Result, W) + else + Result := Max(Result, W); + end; + Inc(Result, 1 + 4 + 4 + 1); +end; + +function TdxBarItemControl.GetDefaultHeightInSubMenu: Integer; +begin + Result := Parent.GetDefaultItemHeight(Self); + Painter.CorrectButtonControlDefaultHeight(Result); +end; + +function TdxBarItemControl.GetDefaultWidthInSubMenu: Integer; +begin + Result := GetDefaultWidthHorzLayout; + Painter.CorrectButtonControlDefaultWidth(Result); +end; + +function TdxBarItemControl.GetMinHeight: Integer; +begin + Result := 1; +end; + +function TdxBarItemControl.GetMinWidth: Integer; +begin + Result := 1; +end; + +function TdxBarItemControl.GetHeight: Integer; +begin + CalcDrawParams(False); + Result := GetDefaultHeight; +end; + +function TdxBarItemControl.GetWidth: Integer; +begin + CalcDrawParams(False); + Result := GetDefaultWidth; +end; + +function TdxBarItemControl.GetWidthByViewLevel( + AViewLevel: TdxBarItemRealViewLevel): Integer; +var + APrevViewLevel: TdxBarItemViewLevel; +begin + APrevViewLevel := ViewInfo.ViewLevel; + try + IdxBarItemControlViewInfo(ViewInfo).SetViewLevel(AViewLevel); + Result := Width; + finally + IdxBarItemControlViewInfo(ViewInfo).SetViewLevel(APrevViewLevel); + end; +end; + +function TdxBarItemControl.InternalGetDefaultHeight: Integer; +begin + if FDrawParams.ViewSize = cvsLarge then + Result := GetLargeHeight + else + Result := GetSmallHeight; +end; + +function TdxBarItemControl.GetLargeHeight: Integer; +var + H: Integer; +begin + Result := GetRotationDependentHeight(GetGlyphSize(cvsLarge)); + + if cpText in FDrawParams.ViewStructure then + begin + H := GetTextHeight; + if Item.GlyphLayout in [glTop, glBottom] then + Inc(Result, H + 1) + else + Result := Max(Result, H); + end; + Inc(Result, 1 + 2 + 2 + 1); +end; + +function TdxBarItemControl.GetSmallHeight: Integer; +begin + Result := 0; + if cpText in FDrawParams.ViewStructure then + Result := Max(Result, GetTextSize); + if cpIcon in FDrawParams.ViewStructure then + Result := Max(Result, GetRotationDependentHeight(FDrawParams.DefaultButtonSize)); +end; + +function TdxBarItemControl.InternalGetDefaultWidth: Integer; +begin + if FDrawParams.ViewSize = cvsLarge then + Result := GetDefaultWidthVertLayout + else + Result := GetDefaultWidthHorzLayout; +end; + +function TdxBarItemControl.HasHint: Boolean; +begin + Result := (Hint <> '') and (Parent is TdxBarControl); +end; + +function TdxBarItemControl.HasShadow: Boolean; +begin + Result := FParent.ChildrenHaveShadows; +end; + +function TdxBarItemControl.HotPartWantMouse: Boolean; +begin + Result := WantMouse; +end; + +function TdxBarItemControl.IsBkColorAssigned: Boolean; +begin + Result := FBkBrush <> 0; +end; + +function TdxBarItemControl.IsChildWindow(AWnd: HWND): Boolean; +begin + Result := IsChildEx(Parent.Handle, AWnd); +end; + +function TdxBarItemControl.IsDestroyOnClick: Boolean; +begin + Result := True; +end; + +function TdxBarItemControl.IsDropDown: Boolean; +begin + Result := False; +end; + +function TdxBarItemControl.IsEditTransparent: Boolean; +begin + Result := False; +end; + +function TdxBarItemControl.IsExpandable: Boolean; +begin + Result := False; +end; + +function TdxBarItemControl.IsHiddenForCustomization: Boolean; +begin + Result := False; +end; + +function TdxBarItemControl.IsHitTestTransparent: Boolean; +begin + Result := True; +end; + +function TdxBarItemControl.IsInvertTextColor: Boolean; +begin + Result := False; +end; + +function TdxBarItemControl.IsMenuItem: Boolean; +begin + Result := False; +end; + +function TdxBarItemControl.IsRotated: Boolean; +begin + Result := Parent.IsVertical; +end; + +function TdxBarItemControl.IsSelectionForbidden: Boolean; +begin + Result := (Parent.IsCustomizing and (BarManager <> Item.BarManager) and + not (csAncestor in BarManager.ComponentState)); +end; + +function TdxBarItemControl.MousePressed: Boolean; +var + R: TRect; + P: TPoint; +begin + R := Parent.GetItemRect(Self); + P := Parent.ScreenToClient(GetMouseCursorPos); + Result := Enabled and PtInRect(R, P); + if Result then + if InMouseHook then + Result := LeftButtonPressed + else + Result := GetKeyState(VK_LBUTTON) < 0; +end; + +function TdxBarItemControl.NeedCaptureMouse: Boolean; +begin + Result := False; +end; + +function TdxBarItemControl.WantMouse: Boolean; +begin + Result := CanSelect or CanClicked; +end; + +procedure TdxBarItemControl.CheckNonRecent; +begin + if Parent.Kind = bkSubMenu then + SubMenuParent.FNonRecent := FNonRecent; +end; + +procedure TdxBarItemControl.UncheckNonRecent; +begin + if Parent.Kind = bkSubMenu then + SubMenuParent.FNonRecent := False; +end; + +procedure TdxBarItemControl.BeginResize(APoint: TPoint); +begin +// do nothing +end; + +function TdxBarItemControl.CanResize(APoint: TPoint): Boolean; +begin + Result := False; +end; + +procedure TdxBarItemControl.EndResize(AAllowResize: Boolean); +begin +// do nothing +end; + +procedure TdxBarItemControl.Resizing(APoint: TPoint); +begin +// do nothing +end; + +class function TdxBarItemControl.HasWindow: Boolean; +begin + Result := False; +end; + +function TdxBarItemControl.IsDroppedDown: Boolean; +begin + Result := False; +end; + +procedure TdxBarItemControl.Repaint; +begin + Parent.UpdateItem(Self); +end; + +{ TdxBarCustomStaticControl} + +function TdxBarCustomStaticControl.CanClicked: Boolean; +begin + Result := False; +end; + +function TdxBarCustomStaticControl.CanSelect: Boolean; +begin + Result := inherited CanSelect and BarManager.IsCustomizing; +end; + +procedure TdxBarCustomStaticControl.DoPaint(ARect: TRect; PaintType: TdxBarPaintType); +begin + Painter.DrawStaticGlyphAndCaption(DrawParams, ARect); +end; + +function TdxBarCustomStaticControl.GetDefaultViewStructure: TdxBarItemControlViewStructure; +begin + Result := []; + if Item.ShowCaption then + Result := [cpText]; + if IconAssigned(GetViewSize) then + Include(Result, cpIcon); +end; + +function TdxBarCustomStaticControl.GetDrawParamsClass: TdxBarItemControlDrawParamsClass; +begin + Result := TdxBarStaticLikeControlDrawParams; +end; + +function TdxBarCustomStaticControl.GetDrawParams: TdxBarStaticLikeControlDrawParams; +begin + Result := TdxBarStaticLikeControlDrawParams(FDrawParams); +end; + +{ TdxBarSeparatorControl } + +procedure TdxBarSeparatorControl.CalcDrawParams(AFull: Boolean = True); +begin + inherited; + DrawParams.IsTop := ItemLink.VisibleIndex = 0; +end; + +procedure TdxBarSeparatorControl.DoPaint(ARect: TRect; PaintType: TdxBarPaintType); +begin + Painter.DrawSeparatorControl(DrawParams, ARect); +end; + +function TdxBarSeparatorControl.GetIndents(ADrawAreaType: TdxBarItemControlPart): TRect; +begin + Result := Painter.SeparatorControlGetIndents(DrawParams, ADrawAreaType); +end; + +function TdxBarSeparatorControl.GetMenuItemSize: TdxBarMenuItemSize; +begin + Result := misNormal; +end; + +function TdxBarSeparatorControl.GetGlyphAreaWidth: Integer; +begin + Result := 0; +end; + +function TdxBarSeparatorControl.GetDefaultHeightInSubMenu: Integer; +const + ASeparatorsCount: array [Boolean] of Integer = (2, 1); +begin + if cpText in DrawParams.ViewStructure then + Result := inherited GetDefaultHeightInSubMenu + Painter.SubMenuGetSeparatorSize * ASeparatorsCount[DrawParams.IsTop] + else + Result := Parent.BeginGroupSize +end; + +function TdxBarSeparatorControl.GetDefaultWidthInSubMenu: Integer; +begin + Result := inherited GetDefaultWidthInSubMenu; +end; + +function TdxBarSeparatorControl.GetMinWidth: Integer; +begin + Result := Parent.IconAreaSize + Painter.GetTailAreaSize(FDrawParams); +end; + +function TdxBarSeparatorControl.InternalGetDefaultHeight: Integer; +begin + Result := GetTextSize; +end; + +function TdxBarSeparatorControl.InternalGetDefaultWidth: Integer; +begin + Result := Parent.BeginGroupSize; +end; + +procedure TdxBarSeparatorControl.PrepareCanvasFont(ABaseFont: HFONT; AStyle: TcxStyle; + out ASavedFont: TdxBarSavedFont); +begin + Canvas.Font.Style := [fsBold]; +end; + +procedure TdxBarSeparatorControl.RestoreCanvasFont(const ASavedFont: TdxBarSavedFont); +begin + Canvas.Font.Style := []; +end; + +function TdxBarSeparatorControl.GetDefaultViewStructure: TdxBarItemControlViewStructure; +begin + if (DrawParams.PaintType = ptMenu) and Item.ShowCaption then + Result := [cpText] + else + Result := []; +end; + +function TdxBarSeparatorControl.GetDrawParamsClass: TdxBarItemControlDrawParamsClass; +begin + Result := TdxBarSeparatorControlDrawParams; +end; + +function TdxBarSeparatorControl.GetDrawParams: TdxBarSeparatorControlDrawParams; +begin + Result := TdxBarSeparatorControlDrawParams(FDrawParams); +end; + +{ TdxBarWinControl } + +procedure TdxBarWinControl.DefaultHandler(var Message); +begin + inherited; + if Handle <> 0 then + with TMessage(Message) do + Result := CallWindowProc(FPrevDefWndProc, Handle, Msg, WParam, LParam); +end; + +class function TdxBarWinControl.HasWindow: Boolean; +begin + Result := True; +end; + +function TdxBarWinControl.HandleAllocated: Boolean; +begin + Result := Handle <> 0; +end; + +function TdxBarWinControl.DoCallKeyboardHook(wParam: WParam; lParam: LParam): Boolean; +begin + DontCallNextKeybHook := True; + try + Result := dxBarKeyboardHook(0, WParam, LParam) = 1; + finally + DontCallNextKeybHook := False; + end; +end; + +function TdxBarWinControl.GetItem: TdxBarWindowItem; +begin + Result := TdxBarWindowItem(ItemLink.Item); +end; + +function TdxBarWinControl.GetWindowRect: TRect; +begin + if Enabled and not Item.EmptyWindow then + Result := FWindowRect + else + Result := cxEmptyRect; +end; + +procedure TdxBarWinControl.SetWindowRect(const Value: TRect); +var + R: TRect; +begin + FWindowRect := Value; + if IsWindowVisible(Handle) then + begin + Windows.GetWindowRect(Handle, R); + if not EqualRect(R, FWindowRect) then + begin + with WindowRect do + SetWindowPos(Handle, 0, Left, Top, + Right - Left, Bottom - Top, SWP_NOZORDER or SWP_NOACTIVATE {SWP_SHOWWINDOW}); + PrepareEditWnd; + end; + end; +end; + +function TdxBarWinControl.CanClicked: Boolean; +begin + Result := FParent.IsVertical; +end; + +function TdxBarWinControl.CanDeselect(ABarManager: TdxBarManager): Boolean; +begin + Result := inherited CanDeselect(ABarManager) and + ((BarManager = ABarManager) or + IsMDIForm(ABarManager.MasterForm) and IsMDIChild(BarManager.MasterForm) and not FFocusing); +end; + +function TdxBarWinControl.CanSelect: Boolean; +begin + Result := inherited CanSelect and Item.CanSelect; +end; + +procedure TdxBarWinControl.ControlInactivate(Immediately: Boolean); +begin + inherited; + Focused := False; +end; + +procedure TdxBarWinControl.ControlClick(AByMouse: Boolean; AKey: Char = #0); +begin + Focused := True; + inherited; + ActivateEdit(AByMouse, AKey); +end; + +procedure TdxBarWinControl.ControlGetFocus(AIsSelected: Boolean; var AProcessed: Boolean); +begin + if AIsSelected and Focused then + begin + AProcessed := True; + if not PtInRect(WindowRect, GetMouseCursorPos) then + TransferMessage(Parent.Handle, Parent.FCurrentMessage); + end + else + inherited +end; + +procedure TdxBarWinControl.EnabledChanged; +begin + Focused := False; + inherited; +end; + +function TdxBarWinControl.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxBarWinControlAccessibilityHelper; +end; + +function TdxBarWinControl.IsChildWindow(AWnd: HWND): Boolean; +begin + Result := inherited IsChildWindow(AWnd) or IsChildEx(Handle, AWnd); +end; + +function TdxBarWinControl.IsDestroyOnClick: Boolean; +begin + Result := False; +end; + +function TdxBarWinControl.IsWindowEnabled: Boolean; +begin + Result := Parent.IsWindowEnabled and + (not HandleAllocated or Windows.IsWindowEnabled(Handle)); +end; + +procedure TdxBarWinControl.KeyDown(var Key: Word; Shift: TShiftState); + + function IsSysKeyDown: Boolean; + begin + Result := (Key = VK_F10) or (Key = VK_MENU) or (ssAlt in Shift); + end; + +var + ALinkSelf: TcxObjectLink; +begin + if IsSysKeyDown then + SysKeyDown(Key, Shift) + else + begin + ALinkSelf := cxAddObjectLink(Self); + try + Item.KeyDown(Key, Shift); + if ALinkSelf.Ref = nil then + Key := 0; + case Key of + VK_ESCAPE: + begin + DoEscape; + Key := 0; + end; + VK_RETURN: + begin + DoEnter; + Key := 0; + end; + VK_TAB: + begin + DoNavigation; + Key := 0; + end; + end; + finally + cxRemoveObjectLink(ALinkSelf); + end; + end; +end; + +procedure TdxBarWinControl.KeyPress(var Key: Char); +begin + Item.KeyPress(Key); +end; + +procedure TdxBarWinControl.KeyUp(var Key: Word; Shift: TShiftState); + + function IsSysKeyUp: Boolean; + begin + Result := (Key = VK_MENU) or (ssAlt in Shift); + end; + +begin + if IsSysKeyUp then + SyskeyUp(Key, Shift) + else + Item.KeyUp(Key, Shift); +end; + +function TdxBarWinControl.ClientToParent(const APoint: TPoint): TPoint; +begin + Result := APoint; + MapWindowPoint(Handle, Parent.Handle, Result); +end; + +function TdxBarWinControl.ParentToClient(const APoint: TPoint): TPoint; +begin + Result := APoint; + MapWindowPoint(Parent.Handle, Handle, Result); +end; + +procedure TdxBarWinControl.CreateInnerEdit; +begin + if Handle <> 0 then + begin + FDefWndProc := MakeObjectInstance(WndProc); + FPrevDefWndProc := Pointer(SetWindowLong(Handle, GWL_WNDPROC, Longint(FDefWndProc))); + end; +end; + +procedure TdxBarWinControl.DestroyInnerEdit(AFullDestroy: Boolean = True); +begin + if Handle <> 0 then + begin + Focused := False; + SetWindowLong(Handle, GWL_WNDPROC, Longint(FPrevDefWndProc)); + FreeObjectInstance(FDefWndProc); + FDefWndProc := nil; + end; +end; + +procedure TdxBarWinControl.DoEnter; +var + AHandle: HWND; + AParent: TCustomdxBarControl; +begin + AHandle := Handle; + AParent := Parent; + if (ItemLink.RealItemLink <> nil) then + ItemLink.RealItemLink.BringToTopInRecentList(True); + StoreDisplayValue; + if IsWindowVisible(AHandle) then + begin + AParent.SetKeySelectedItem(nil); + KillBeep(AHandle); + AParent.HideAll; + end; +end; + +procedure TdxBarWinControl.DoEscape; +begin + Parent.SetKeySelectedItem(nil); + KillBeep(Handle); + Parent.AfterControlEscape(Self); +end; + +procedure TdxBarWinControl.DoNavigation; +begin + StoreDisplayValue; + if IsWindowVisible(Handle) then + begin + KillBeep(Handle); + BarNavigationController.HandleKey(VK_TAB); + end; +end; + +function TdxBarWinControl.DoKeyDown(var Message: TWMKey): Boolean; +begin + KeyDown(Message.CharCode, KeyDataToShiftState(Message.KeyData)); + Result := (Message.CharCode = 0); +end; + +function TdxBarWinControl.DoKeyPress(var Message: TWMKey): Boolean; +var + Ch: Char; +begin + Ch := Char(Message.CharCode); + KeyPress(Ch); + Message.CharCode := Word(Ch); + Result := (Ch = #0); +end; + +function TdxBarWinControl.DoKeyUp(var Message: TWMKey): Boolean; +begin + KeyUp(Message.CharCode, KeyDataToShiftState(Message.KeyData)); + Result := (Message.CharCode = 0); +end; + +procedure TdxBarWinControl.DoKillFocus(var Message: TMessage); +begin + KillFocus(Message.WParam); +end; + +procedure TdxBarWinControl.DoMouseDown(var Message: TWMMouse; + AButton: TMouseButton; AShift: TShiftState); +var + APoint: TPoint; +begin + MouseDown(AButton, KeysToShiftState(Message.Keys), Message.XPos, Message.YPos); + + if mbRight = AButton then + begin + APoint := ClientToParent(Point(Message.XPos, Message.YPos)); + SendMessage(Parent.Handle, WM_RBUTTONDOWN, Message.Keys, MakeLParam(APoint.X, APoint.Y)); + end; +end; + +procedure TdxBarWinControl.DoMouseMove(var Message: TWMMouse); +var + P: TPoint; + AMessage: TWMMouse; +begin + AMessage := Message; + P := ClientToParent(Point(Message.XPos, Message.YPos)); + AMessage.XPos := P.X; + AMessage.YPos := P.Y; + Parent.WMMouseMove(AMessage); // to invoke AfterMouseMove +end; + +procedure TdxBarWinControl.ActivateEdit(AByMouse: Boolean; AKey: Char = #0); +var + P: TPoint; +begin + if AByMouse then + begin + P := Parent.ScreenToClient(GetMouseCursorPos); + if not PtInRect(WindowRect, P) then + begin + P := ParentToClient(P); + SendMessage(Handle, WM_LBUTTONDOWN, ShiftStateToKeys(InternalGetShiftState), MakeLParam(P.X, P.Y)); + end; + end; +end; + +function TdxBarWinControl.GetText: string; +var + S: PChar; + Len: Integer; +begin + if Handle <> 0 then + begin + S := StrAlloc(256); + Len := SendMessage(Handle, WM_GETTEXT, 255, Longint(S)); + if Len = 0 then Result := '' + else Result := S; + StrDispose(S); + end; +end; + +procedure TdxBarWinControl.KillFocus(AHandle: THandle); +begin + // do nothing +end; + +procedure TdxBarWinControl.PrepareEditWnd; +begin + // do nothing +end; + +procedure TdxBarWinControl.RestoreDisplayValue; +begin + Text := Item.Text; +end; + +procedure TdxBarWinControl.SetFocused(Value: Boolean); +var + IsDesignForm: Boolean; + + procedure SetTopMosts(AShow: Boolean); + begin + if BarDesignController.IsCustomizedByPopup then + BarDesignController.SetCustomizePopupTopMosts(AShow); + end; + +begin + if FFocused <> Value then + begin + FFocused := Value; + if FFocused then + begin + FPrevFocusedControl := Windows.GetFocus; + if not IsActive then + ControlActivate(True); + Parent.MakeItemControlFullyVisible(Self); + Show; + end + else + begin +{ if FHandle <> 0 then + SetWindowPos(Handle, 0, 0, 0, 0, 0, + SWP_NOZORDER or SWP_NOMOVE or SWP_NOSIZE or SWP_HIDEWINDOW or SWP_NOACTIVATE);} + + Hide(BarManager.AlwaysSaveText and + ((GetAsyncKeyState(VK_ESCAPE) >= 0) or + (GetAsyncKeyState(VK_CONTROL) < 0) or (GetAsyncKeyState(VK_MENU) < 0))); + if not (bisToolbarsVisibleChanging in BarManager.FInternalState) then + begin + IsDesignForm := (dxBarCustomizingForm <> nil) and + (GetParentForm(FindControl(FPrevFocusedControl)) = dxBarCustomizingForm); + if IsDesignForm then SetTopMosts(True); + if (FPrevFocusedControl > 0) and IsWindowVisible(FPrevFocusedControl) then + SetFocus(FPrevFocusedControl) + else + if IsControlVisible(BarManager.Owner) then + Windows.SetFocus(BarManager.Owner.Handle) + else + Windows.SetFocus(GetNextWindow(BarManager.Owner.Handle, GW_HWNDNEXT)); + if IsDesignForm then SetTopMosts(False); + FPrevFocusedControl := 0; + end; + end; + end; +end; + +procedure TdxBarWinControl.SetText(Value: string); +begin + SetWindowText(Handle, PChar(Value)); + if Item.EmptyWindow then Repaint; +end; + +procedure TdxBarWinControl.Show; +begin + FOnGlass := Parent.IsOnGlass; +end; + +procedure TdxBarWinControl.StoreDisplayValue; +begin + Item.Text := Text; +end; + +procedure TdxBarWinControl.SysKeyDown(var Key: Word; Shift: TShiftState); +begin + Inc(FKeyPressedInside); + case Key of + VK_MENU: Key := 0; + VK_F10: + begin + FKeyPressedInside := 0; + Parent.HideAll; + if (ssShift in Shift) or DoCallKeyboardHook(Key, 1) then + Key := 0; + end; + end; +end; + +procedure TdxBarWinControl.SysKeyUp(var Key: Word; Shift: TShiftState); +begin + if FKeyPressedInside > 0 then + begin + FKeyPressedInside := 0; + if (Key = VK_MENU) then + begin + Parent.HideAll; + WaitForMenu := True; + if DoCallKeyboardHook(Key, Integer($80000001)) then + Key := 0; + end; + end + else + Key := 0; +end; + +procedure TdxBarWinControl.TransferMessage(AFromWindow: HWND; const Message: TMessage); +var + APoint: TPoint; +begin + case Message.Msg of + WM_MOUSEFIRST..WM_MOUSELAST: + begin + APoint := SmallPointToPoint(TSmallPoint(Message.lParam)); + MapWindowPoint(AFromWindow, Handle, APoint); + SendMessage(Handle, Message.Msg, Message.WParam, MakeLParam(APoint.X, APoint.Y)); + end; + end; +end; + +procedure TdxBarWinControl.WndProc(var Message: TMessage); +var + AItem: TdxBarWindowItem; + AFocusedParent: HWND; + ALinkSelf: TcxObjectLink; + P: TPoint; +begin + AItem := Item; + ALinkSelf := cxAddObjectLink(Self); + try + case Message.Msg of + WM_SETFOCUS: + AItem.DoEnter; + WM_KILLFOCUS: + try + DoKillFocus(Message); + if Focused then + begin + DefaultHandler(Message); + //KillBeep(Handle); + Parent.HideAll; + Exit; + end; + if Parent is TdxBarControl then + begin + if GetFocus = Parent.Handle then + AFocusedParent := Parent.Handle + else + AFocusedParent := GetParent(GetFocus); + if not (FindControl(AFocusedParent) is TdxBarControl) then + AFocusedParent := GetParent(AFocusedParent); + if AFocusedParent <> Parent.Handle then + begin + DefaultHandler(Message); + KillBeep(Handle); + Parent.HideAll; + Exit; + end; + end; + finally + AItem.DoExit; + end; + WM_MOUSEFIRST..WM_MOUSELAST: + case Message.Msg of + WM_RBUTTONDOWN: + begin + DoMouseDown(TWMMouse(Message), mbRight, []); + Exit; + end; + WM_MOUSEMOVE: + DoMouseMove(TWMMouse(Message)); + else + P := ClientToParent(Point(TWMMouse(Message).XPos, TWMMouse(Message).YPos)); + if (GetCapture <> Handle) and + not PtInRect(WindowRect, P) and PtInRect(Parent.GetItemRect(Self), P) then + Exit; + end; + WM_CHAR: + if DoKeyPress(TWMKey(Message)) then + Exit; + WM_KEYDOWN, WM_SYSKEYDOWN: + if DoKeyDown(TWMKey(Message)) then + Exit; + WM_KEYUP, WM_SYSKEYUP: + if DoKeyUp(TWMKey(Message)) then + Exit; + WM_COMMAND: + if (HiWord(Message.WParam) = EN_CHANGE) and not FFocusing then + Item.CurChange; + end; + if ALinkSelf.Ref <> nil then + DefaultHandler(Message); + finally + cxRemoveObjectLink(ALinkSelf); + end; +end; + +{ TdxBarButtonLikeControl } + +procedure FinishSubMenuTracking(var ADropDownControl: TdxBarButtonLikeControl; var ATimerID: DWORD); +begin + dxKillTimer(0, ATimerID); + ADropDownControl := nil; +end; + +procedure FinishSubMenuActivationTracking; +begin + FinishSubMenuTracking(ABarActivationDropDownControl, ABarActivationDropDownControlTimerID); +end; + +procedure FinishSubMenuDeActivationTracking; +begin + FinishSubMenuTracking(ABarDeActivationDropDownControl, ABarDeActivationDropDownControlTimerID); +end; + +procedure DeActivateSubMenu; +begin + if ABarDeActivationDropDownControl <> nil then + ABarDeActivationDropDownControl.ControlInActivate(True); + FinishSubMenuDeActivationTracking; +end; + +procedure ActivateSubMenu; +begin + if ABarActivationDropDownControl <> nil then + ABarActivationDropDownControl.ControlActivate(True); + FinishSubMenuActivationTracking; +end; + +procedure ActivateSubMenuTimerProc(Wnd: HWnd; Msg, TimerID, SysTime: Longint); stdcall; +begin + ActivateSubMenu; +end; + +procedure DeActivateSubMenuTimerProc(Wnd: HWnd; Msg, TimerID, SysTime: Longint); stdcall; +begin + DeActivateSubMenu; +end; + +procedure StartSubMenuActivationTracking(ADropDownControl: TdxBarButtonLikeControl); +begin + ABarActivationDropDownControl := ADropDownControl; + ABarActivationDropDownControlTimerID := SetTimer(0, 0, dxBarWaitForSubMenuTime, @ActivateSubMenuTimerProc); +end; + +procedure StartSubMenuDeActivationTracking(ADropDownControl: TdxBarButtonLikeControl); +begin + ABarDeActivationDropDownControl := ADropDownControl; + ABarDeActivationDropDownControlTimerID := SetTimer(0, 0, dxBarWaitForSubMenuTime, @DeActivateSubMenuTimerProc); +end; + +destructor TdxBarButtonLikeControl.Destroy; +begin + FinishSubMenuTracking; + if (SubMenuControl <> nil) {and not ItemLink.Item.IsDestroying} then + SubMenuControl.Hide; + inherited; +end; + +function TdxBarButtonLikeControl.ArrowWidth: Integer; +begin + if Parent.Kind = bkSubMenu then + Result := Parent.MenuArrowWidth + else + Result := Painter.RealButtonArrowWidth(BarManager); +end; + +procedure TdxBarButtonLikeControl.CalcDrawParams(AFull: Boolean = True); +begin + inherited CalcDrawParams(AFull); + if AFull then + begin + DrawParams.ButtonGroup := ViewInfo.RealPositionInButtonGroup; + DrawParams.IsTextSelected := IsTextSelected; + DrawParams.IsFlatText := IsFlatText; + end; + + DrawParams.ArrowSize := cxSize(ArrowWidth, Parent.MenuArrowHeight); +end; + +function TdxBarButtonLikeControl.CanBePartOfButtonGroup: Boolean; +begin + Result := True; +end; + +function TdxBarButtonLikeControl.CanActivate: Boolean; +begin + Result := Enabled or BarManager.Designing; +end; + +procedure TdxBarButtonLikeControl.ControlActivate(Immediately: Boolean); +begin + if IsDroppedDown then + FinishSubMenuTracking + else + begin + inherited; + if IsDropDown and CanActivate then + begin + if Parent is TdxBarControl then + if Parent.IsCustomizing or TdxBarControl(Parent).IsDowned then + Immediately := True + else + Exit; + if not Immediately and not BarManager.IsCustomizing then + StartSubMenuTracking(True) + else + begin + DeActivateSubMenu; + DoDropDown(True); + end; + end; + end; +end; + +procedure TdxBarButtonLikeControl.ControlInactivate(Immediately: Boolean); +begin + if Parent is TdxBarControl then + Immediately := True; + + if not Immediately and {(ABarDeActivationDropDownControl = nil) and }(Parent <> nil) and + not Parent.IsDestroying and not BarManager.IsCustomizing then + begin + StartSubMenuTracking(False); + Exit; + end; + + inherited; + + DoCloseUp(SubMenuControl <> nil); +end; + +procedure TdxBarButtonLikeControl.ControlGetFocus(AIsSelected: Boolean; var AProcessed: Boolean); +begin + if not AIsSelected then + inherited + else + if Parent.IsDowned and IsDroppedDown then + Parent.BarLostFocus; +end; + +procedure TdxBarButtonLikeControl.DoPaint(ARect: TRect; PaintType: TdxBarPaintType); +begin + Painter.DrawButtonLikeControl(DrawParams, ARect); +end; + +procedure TdxBarButtonLikeControl.DropDown(AByMouse: Boolean); +begin + Parent.IsDowned := True; +end; + +function TdxBarButtonLikeControl.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxBarButtonLikeControlAccessibilityHelper; +end; + +function TdxBarButtonLikeControl.GetDrawParamsClass: TdxBarItemControlDrawParamsClass; +begin + Result := TdxBarButtonLikeControlDrawParams; +end; + +function TdxBarButtonLikeControl.GetSubMenuControl: TdxBarSubMenuControl; +begin + Result := nil; +end; + +function TdxBarButtonLikeControl.IsFlatText: Boolean; +begin + Result := Painter.UseTextColorForItemArrow; +end; + +function TdxBarButtonLikeControl.IsTextSelected: Boolean; +begin + Result := Painter.IsCustomSelectedTextColorExists(Self); +end; + +procedure TdxBarButtonLikeControl.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited; + if WantsKey(Key) then + DropDown(False); +end; + +function TdxBarButtonLikeControl.WantsKey(Key: Word): Boolean; +begin + Result := inherited WantsKey(Key) or + IsDropDown and + ((Parent.Kind = bkSubMenu) and (Key = VK_RIGHT) or + (Parent.Kind <> bkSubMenu) and (Key in [VK_UP, VK_DOWN])); +end; + +procedure TdxBarButtonLikeControl.FinishSubMenuTracking; +begin + if ABarActivationDropDownControl = Self then + FinishSubMenuActivationTracking; + if ABarDeActivationDropDownControl = Self then + FinishSubMenuDeActivationTracking; +end; + +procedure TdxBarButtonLikeControl.StartSubMenuTracking(AActivation: Boolean); +begin + if AActivation then + begin + if ABarDeActivationDropDownControl = Self then + FinishSubMenuDeActivationTracking; + if ABarActivationDropDownControl <> nil then + FinishSubMenuActivationTracking; + StartSubMenuActivationTracking(Self); + end + else + begin + if ABarActivationDropDownControl = Self then + FinishSubMenuActivationTracking; + if IsDroppedDown then + begin + if ABarDeActivationDropDownControl <> nil then + FinishSubMenuDeActivationTracking; + StartSubMenuDeActivationTracking(Self); + end; + end; +end; + +procedure TdxBarButtonLikeControl.DoCloseUp(AHadSubMenuControl: Boolean); +begin + FinishSubMenuTracking; + if AHadSubMenuControl then + SubMenuControl.Hide; + Repaint; +end; + +function TdxBarButtonLikeControl.GetDrawParams: TdxBarButtonLikeControlDrawParams; +begin + Result := TdxBarButtonLikeControlDrawParams(FDrawParams); +end; + +{ TdxBarButtonControl } + +function TdxBarButtonControl.IsDroppedDown: Boolean; +begin + Result := FDroppedDown and (SubMenuControl <> nil); +end; + +function TdxBarButtonControl.GetButtonItem: TdxBarButton; +begin + if Item is TdxBarButton then + Result := TdxBarButton(Item) + else + Result := nil; +end; + +function TdxBarButtonControl.GetDown: Boolean; +begin + if ButtonItem <> nil then + Result := ButtonItem.Down + else + Result := False; +end; + +function TdxBarButtonControl.GetDropDownEnabled: Boolean; +begin + Result := (ButtonItem <> nil) and ButtonItem.DropDownEnabled; +end; + +function TdxBarButtonControl.GetDroppedDownFlat: Boolean; +begin + Result := Painter.IsFlatItemText and IsDroppedDown; +end; + +function TdxBarButtonControl.GetGroupIndex: Integer; +begin + Result := ButtonItem.GroupIndex; +end; + +function TdxBarButtonControl.GetInternalStates: TdxBarButtonStates; +begin + if ButtonItem <> nil then + Result := ButtonItem.FInternalStates + else + Result := []; +end; + +function TdxBarButtonControl.GetLowered: Boolean; +begin + Result := (ButtonItem <> nil) and ButtonItem.Lowered; +end; + +function TdxBarButtonControl.MouseOverArrow: Boolean; +begin + Result := IsDropDown and (FHotPartIndex = bcpDropButton); +end; + +function TdxBarButtonControl.ArrowPressed: Boolean; +begin + Result := MousePressed and MouseOverArrow; +end; + +procedure TdxBarButtonControl.CalcDrawParams(AFull: Boolean = True); +begin + inherited CalcDrawParams(AFull); + if AFull then + begin + DrawParams.ShortCut := ShortCutToText(ShortCut); + DrawParams.IsPressed := IsPressed; + DrawParams.Downed := Down; + DrawParams.DrawDowned := DrawParams.IsPressed; + DrawParams.DroppedDown := DroppedDown; + DrawParams.DroppedDownFlat := DroppedDownFlat; + DrawParams.SplitDropDown := True; + DrawParams.DropDownEnabled := DropDownEnabled; + DrawParams.GrayScale := GrayScale; + DrawParams.IsLowered := Lowered; + end; +end; + +procedure TdxBarButtonControl.CalcParts; +begin + inherited; + Painter.CalculateButtonParts(DrawParams, FParts, ItemBounds); +end; + +procedure TdxBarButtonControl.ControlClick(AByMouse: Boolean; AKey: Char = #0); +begin + inherited; + +//#DG TODO: + if (Parent is TdxBarControl) and not TdxBarControl(Parent).IsDowned then + Exit; + + if IsDropDown and ArrowPressed then + ControlActivate(True) + else + if (Parent is TdxBarControl) or IsDropDown then + Repaint; +end; + +procedure TdxBarButtonControl.ControlUnclick(ByMouse: Boolean); +begin + if not ByMouse or (FHotPartIndex = bcpButton) then + begin + if (ButtonItem <> nil) and (bstChecked in ButtonItem.FInternalStates) then + ButtonItem.Down := not ButtonItem.Down; + ControlInactivate(True); + inherited; + end; +end; + +procedure TdxBarButtonControl.ControlGetFocus(AIsSelected: Boolean; var AProcessed: Boolean); +begin + if AIsSelected and Parent.IsDowned and IsDroppedDown and (FHotPartIndex = bcpButton) then + begin + if bboSubMenuCaptureMouse in Parent.BehaviorOptions then + Parent.BarLostFocus; + Parent.BarGetFocus(Self) + end + else + inherited; +end; + +procedure TdxBarButtonControl.DoCloseUp(AHadSubMenuControl: Boolean); +begin + if AHadSubMenuControl then + SubMenuControl.FDropDownButton := nil; + FDroppedDown := False; + inherited; +end; + +procedure TdxBarButtonControl.DoDropDown(AByMouse: Boolean); +var + Rect: TRect; + P: TPoint; +begin + if not FDroppedDown and Enabled and DropDownEnabled and + (ButtonItem.DropDownMenu <> nil) then + begin + FDroppedDown := True; + Parent.MakeItemControlFullyVisible(Self); + Repaint; + Rect := Parent.GetItemRect(Self); + with Rect do + if (Parent.Kind = bkSubMenu) or Parent.IsRealVertical then + begin + P := Point(Right, Top); + if {not Flat or }(Parent.Kind = bkSubMenu) then // fix + Dec(P.Y, SubMenuParent.BorderSize); + end + else + P := Point(Left, Bottom); + P := Parent.ClientToScreen(P); + ButtonItem.DoDropDown(Self, P.X, P.Y, AByMouse); + if Painter.IsDropDownRepaintNeeded then Repaint; + end; +end; + +function TdxBarButtonControl.DrawSelected: Boolean; +begin + Result := inherited DrawSelected and not FParent.IsCustomizing or Pressed; +end; + +procedure TdxBarButtonControl.DropDown(AByMouse: Boolean); +begin + inherited; + DoDropDown(AByMouse); +end; + +function TdxBarButtonControl.GetSubMenuControl: TdxBarSubMenuControl; +begin + if (ButtonItem <> nil) and (ButtonItem.DropDownMenu <> nil) then + Result := TdxBarSubMenuControl(ButtonItem.DropDownMenu.ItemLinks.BarControl) + else + Result := nil; +end; + +function TdxBarButtonControl.IsFlatText: Boolean; +begin + Result := not IsTextSelected or inherited IsFlatText; +end; + +function TdxBarButtonControl.IsTextSelected: Boolean; +begin + Result := Painter.IsFlatItemText and + (((IsPressed or Down and DrawSelected) and Painter.IsItemTextSelectedInverted) or + ((IsPressed or Down or DrawSelected) and (IsHighContrastWhite and not DroppedDown or inherited IsTextSelected))); +end; + +function TdxBarButtonControl.GetDefaultHeight: Integer; +begin + Result := inherited GetDefaultHeight; + if Lowered then + Inc(Result, 2 * Painter.LoweredBorderSize(Self)); +end; + +function TdxBarButtonControl.GetDefaultWidth: Integer; +begin + Result := inherited GetDefaultWidth; + Painter.InflateSizeForArrow(DrawParams, Result); + if Lowered then + Inc(Result, 2 * Painter.LoweredBorderSize(Self)); +end; + +function TdxBarButtonControl.GetSmallHeight: Integer; +begin + Result := inherited GetSmallHeight; + if cpText in DrawParams.ViewStructure then + Result := Max(Result, GetRotationDependentHeight(DrawParams.DefaultButtonSize)); +end; + +function TdxBarButtonControl.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxBarButtonControlAccessibilityHelper; +end; + +function TdxBarButtonControl.GetDefaultViewStructure: TdxBarItemControlViewStructure; +begin + case PaintStyle of + psStandard: + if GetPaintType = ptMenu then + Result := [cpIcon, cpText] + else + if IconAssigned(GetViewSize) then + Result := [cpIcon] + else + Result := [cpText]; + psCaption: Result := [cpText]; + psCaptionInMenu: + if GetPaintType = ptMenu then + Result := [cpText] + else + Result := [cpIcon]; + psCaptionGlyph: Result := [cpIcon, cpText]; + end; +end; + +function TdxBarButtonControl.GetOwnedBarControl: TCustomdxBarControl; +begin + Result := SubMenuControl; +end; + +function TdxBarButtonControl.GetPaintStyle: TdxBarPaintStyle; +begin + if FItemLink <> nil then + Result := FItemLink.PaintStyle + else + Result := psStandard; +// if (Parent is TdxBarControl) and (Result = psStandard) and not ImageExists then +// Result := psCaption; + if (Parent is TdxBarControl) and (Result = psStandard) then + PreparePaintStyleOnBar(Result); +end; + +function TdxBarButtonControl.GetPartCount: Integer; +begin + if FDrawParams.IsDropDown then + Result := 2 + else + Result := 1; +end; + +function TdxBarButtonControl.GetViewStructure: TdxBarItemControlViewStructure; +begin + if ViewInfo.ViewLevel = ivlSmallIcon then + Result := [cpIcon] + else + Result := inherited GetViewStructure; +end; + +function TdxBarButtonControl.IsDestroyOnClick: Boolean; +begin + Result := (Parent is TdxBarControl) or ButtonItem.CloseSubMenuOnClick; +end; + +function TdxBarButtonControl.IsDropDown: Boolean; +begin + Result := bstDropDown in InternalStates; +end; + +function TdxBarButtonControl.IsPressed: Boolean; +begin + Result := DrawSelected and Parent.IsActive and MousePressed and (FHotPartIndex = bcpButton) or + Pressed and not(bstChecked in InternalStates); +end; + +function TdxBarButtonControl.NeedCaptureMouse: Boolean; +begin + Result := not DroppedDown and (Parent.Kind = bkBarQuickControl); +end; + +procedure TdxBarButtonControl.PaintStyleChanged; +begin + Parent.RepaintBar; +end; + +procedure TdxBarButtonControl.PreparePaintStyleOnBar(var APaintStyle: TdxBarPaintStyle); +begin + if not IconAssigned(GetViewSize) then + APaintStyle := psCaption; +end; + +{ TdxBarApplicationMenuButtonControl } + +procedure TdxBarApplicationMenuButtonControl.CalcDrawParams(AFull: Boolean = False); +begin + inherited CalcDrawParams(AFull); + if AFull then + DrawParams.ContentWidth := inherited InternalGetDefaultWidth; +end; + +procedure TdxBarApplicationMenuButtonControl.DoPaint(ARect: TRect; PaintType: TdxBarPaintType); +begin + Painter.ApplicationMenuDrawButton(DrawParams, ARect); +end; + +function TdxBarApplicationMenuButtonControl.GetDefaultViewStructure: TdxBarItemControlViewStructure; +begin + Result := [cpText]; + if IconAssigned(GetViewSize) then + Include(Result, cpIcon); +end; + +function TdxBarApplicationMenuButtonControl.GetDrawParamsClass: TdxBarItemControlDrawParamsClass; +begin + Result := TdxBarApplicationMenuButtonControlDrawParams; +end; + +function TdxBarApplicationMenuButtonControl.GetPaintType: TdxBarPaintType; +begin + Result := ptHorz; +end; + +function TdxBarApplicationMenuButtonControl.InternalGetDefaultWidth: Integer; +begin + if Item.Width <> 0 then + Result := Item.Width + else + Result := inherited InternalGetDefaultWidth; +end; + +procedure TdxBarApplicationMenuButtonControl.CaptionChanged; +begin + Parent.Repaint; +end; + +procedure TdxBarApplicationMenuButtonControl.GlyphChanged; +begin + Parent.Repaint; +end; + +procedure TdxBarApplicationMenuButtonControl.VisibleChanged; +begin + Parent.Repaint; +end; + +procedure TdxBarApplicationMenuButtonControl.WidthChanged; +begin + Parent.Repaint; +end; + +function TdxBarApplicationMenuButtonControl.GetDrawParams: TdxBarApplicationMenuButtonControlDrawParams; +begin + Result := TdxBarApplicationMenuButtonControlDrawParams(FDrawParams); +end; + +{ TdxBarCustomEditControl } + +destructor TdxBarCustomEditControl.Destroy; +begin + FreeAndNil(FBkBrush); + inherited Destroy; +end; + +procedure TdxBarCustomEditControl.CorrectFrameRect(var ARect: TRect); +begin +// do nothing +end; + +procedure TdxBarCustomEditControl.DoCalcDrawingConsts; +var + ASavedFont: TdxBarSavedFont; +begin + inherited DoCalcDrawingConsts; + PrepareCanvasFont(Parent.EditFontHandle, Item.StyleEdit, ASavedFont); + try + FEditTextSize := Parent.GetTextSize; + finally + RestoreCanvasFont(ASavedFont); + end; +end; + +procedure TdxBarCustomEditControl.DoPaint(ARect: TRect; PaintType: TdxBarPaintType); +begin + Painter.DrawEditLikeControl(DrawParams, ARect); +end; + +procedure TdxBarCustomEditControl.DrawFrame; + + function IsEditorFrameOnly: Boolean; + begin + Result := not IsEditTransparent or (GetPaintType = ptMenu); + end; + +var + AFrameRect, AContentRect: TRect; +begin + if IsEditorFrameOnly then + AFrameRect := GetEditRect + else + AFrameRect := ItemBounds; + + CorrectFrameRect(AFrameRect); + AContentRect := AFrameRect; + Painter.EditControlDrawBorder(DrawParams, AContentRect); + ExcludeFrameRegion(Canvas, AFrameRect, AContentRect); +end; + +procedure TdxBarCustomEditControl.CalcDrawParams(AFull: Boolean = True); +begin + inherited; + if AFull then + begin + DrawParams.IsTransparent := IsEditTransparent; + DrawParams.Focused := Focused; + end; +end; + +procedure TdxBarCustomEditControl.CalcParts; +begin + inherited; + Painter.CalculateEditParts(DrawParams, FParts, ItemBounds); +end; + +procedure TdxBarCustomEditControl.DrawEditSizingFrame(AWidth: Integer); +var + AItemRect: TRect; + ADC: HDC; +begin + AItemRect := ItemBounds; + if FRightBorderSizing then + AItemRect.Right := AItemRect.Left + AWidth + else + AItemRect.Left := AItemRect.Right - AWidth; + ADC := GetDC(0); + MapWindowRect(Parent.Handle, 0, AItemRect); + with AItemRect do + begin + PatBlt(ADC, Left, Top, Right - Left, 2, DSTINVERT); + PatBlt(ADC, Left, Bottom - 2, Right - Left, 2, DSTINVERT); + PatBlt(ADC, Left, Top + 2, 2, Bottom - Top - 4, DSTINVERT); + PatBlt(ADC, Right - 2, Top + 2, 2, Bottom - Top - 4, DSTINVERT); + end; + ReleaseDC(0, ADC); +end; + +function TdxBarCustomEditControl.DrawSelected: Boolean; +begin + Result := inherited DrawSelected and not FParent.IsCustomizing; +end; + +function TdxBarCustomEditControl.GetDefaultViewStructure: TdxBarItemControlViewStructure; +begin + Result := []; + if ShowCaption then + Result := [cpText]; + if IconAssigned(GetViewSize) and Painter.EditControlShowIconDefault(DrawParams) then + Include(Result, cpIcon); +end; + +function TdxBarCustomEditControl.GetDrawParamsClass: TdxBarItemControlDrawParamsClass; +begin + Result := TdxBarEditLikeControlDrawParams; +end; + +function TdxBarCustomEditControl.GetPartCount: Integer; +begin + Result := inherited GetPartCount + 2; +end; + +function TdxBarCustomEditControl.GetPossibleViewLevels: TdxBarItemViewLevels; +begin + Result := inherited GetPossibleViewLevels; + Include(Result, ivlControlOnly); +end; + +function TdxBarCustomEditControl.GetCaptionAreaWidth: Integer; +begin + Result := 0; + if cpText in DrawParams.ViewStructure then + begin + Result := GetCaptionWidth; + Inc(Result, GetIndents(cpText).Left + GetIndents(cpText).Right); + end; +end; + +function TdxBarCustomEditControl.GetControlAreaWidth: Integer; +begin + Result := ItemLink.Width; +end; + +function TdxBarCustomEditControl.GetGlyphAreaWidth: Integer; +begin + if cpIcon in DrawParams.ViewStructure then + begin + Result := GetGlyphSize(DrawParams.ViewSize).cx; + Inc(Result, GetIndents(cpIcon).Left + GetIndents(cpIcon).Right); + end + else + Result := 0; +end; + +function TdxBarCustomEditControl.GetDefaultHeight: Integer; +begin + Result := GetEditTextSize; + if ShowCaption then + Result := Max(Result, Parent.GetDefaultItemHeight(Self)); +end; + +function TdxBarCustomEditControl.GetDefaultWidth: Integer; +begin + Result := GetDefaultWidthHorzLayout; +end; + +function TdxBarCustomEditControl.GetEditOffset: Integer; +begin + Result := GetEditRect.Left - ItemBounds.Left; +end; + +function TdxBarCustomEditControl.GetEditRect: TRect; +begin + Result := ItemBounds; + if not IsRectEmpty(Result) then + begin + if (Align = iaClient) and not (bboExtendItemWhenAlignedToClient in Parent.BehaviorOptions) then + Result.Left := Result.Right - GetControlAreaWidth + else + Result.Left := ItemBounds.Left + GetCaptionAreaWidth + GetGlyphAreaWidth; + end; +end; + +function TdxBarCustomEditControl.GetEditTextSize: Integer; +begin + if (Item.StyleEdit <> nil) and (svFont in Item.StyleEdit.AssignedValues) then + Result := FEditTextSize + else + Result := Parent.EditTextSize; +end; + +function TdxBarCustomEditControl.GetIndents(ADrawAreaType: TdxBarItemControlPart): TRect; +begin + Result := Painter.EditControlIndents(DrawParams, ADrawAreaType); +end; + +function TdxBarCustomEditControl.GetMinWidth: Integer; +begin + Result := GetCaptionAreaWidth + GetMinEditorWidth; +end; + +function TdxBarCustomEditControl.GetShowCaption: Boolean; +begin + Result := (Parent.Kind = bkSubMenu) or Item.ShowCaption; +end; + +procedure TdxBarCustomEditControl.Show; +begin + inherited Show; + InitEdit; +end; + +procedure TdxBarCustomEditControl.BeginResize(APoint: TPoint); +begin + FRightBorderSizing := PtInRect(RightSizingRect, APoint); + FSizingEditWidth := cxRectWidth(ItemBounds); + Paint(Canvas, ItemBounds, ptHorz); + DrawEditSizingFrame(FSizingEditWidth); +end; + +function TdxBarCustomEditControl.CanResize(APoint: TPoint): Boolean; +begin + Result := BarManager.IsCustomizing and (PtInRect(RightSizingRect, APoint) or PtInRect(LeftSizingRect, APoint)); +end; + +procedure TdxBarCustomEditControl.EndResize(AAllowResize: Boolean); +begin + DrawEditSizingFrame(FSizingEditWidth); + if AAllowResize and (GetControlAreaWidth <> FSizingEditWidth - GetEditOffset) then + ItemLink.UserWidth := FSizingEditWidth - GetEditOffset + else + Repaint; +end; + +procedure TdxBarCustomEditControl.Resizing(APoint: TPoint); +var + AItemRect: TRect; + APrevSizingEditWidth: Integer; +begin + AItemRect := ItemBounds; + APrevSizingEditWidth := FSizingEditWidth; + if FRightBorderSizing then + FSizingEditWidth := APoint.X - AItemRect.Left + else + FSizingEditWidth := AItemRect.Right - APoint.X; + + CheckEditWidth(FSizingEditWidth, MinWidth); + + if FSizingEditWidth <> APrevSizingEditWidth then + begin + DrawEditSizingFrame(APrevSizingEditWidth); + DrawEditSizingFrame(FSizingEditWidth); + end; +end; + +function TdxBarCustomEditControl.HotPartWantMouse: Boolean; +begin + Result := inherited HotPartWantMouse; + if not BarManager.IsCustomizing and (GetPaintType <> ptMenu) then + // Result := Result and not (FHotPartIndex in ecpHeaderParts); + Result := Result and not (FHotPartIndex in [ecpIcon, ecpText]) // TODO must be checked +end; + +procedure TdxBarCustomEditControl.RefreshBkBrush(var AHandle: HBRUSH); +begin + if FBkBrush = nil then + FBkBrush := TBrush.Create; + FBkBrush.Color := Painter.EditGetBkColor(DrawParams); + AHandle := FBkBrush.Handle; +end; + +function TdxBarCustomEditControl.GetCaptionBkBrush: HBRUSH; +begin + if DrawSelected and (GetPaintType = ptMenu) then + Result := Parent.ToolbarSelBrush + else + Result := Parent.BkBrush; +end; + +function TdxBarCustomEditControl.GetDrawParams: TdxBarEditLikeControlDrawParams; +begin + Result := TdxBarEditLikeControlDrawParams(FDrawParams); +end; + +function TdxBarCustomEditControl.GetEditBkBrush: HBRUSH; +begin + RefreshBkBrush(Result); +end; + +function TdxBarCustomEditControl.GetEditFont: TFont; +var + AStyleEdit: TcxStyle; +begin + AStyleEdit := Item.StyleEdit; + if (AStyleEdit <> nil) and (svFont in AStyleEdit.AssignedValues) then + Result := AStyleEdit.Font + else + Result := Parent.EditFont; +end; + +function TdxBarCustomEditControl.GetItem: TdxCustomBarEdit; +begin + Result := TdxCustomBarEdit(inherited GetItem); +end; + +function TdxBarCustomEditControl.LeftSizingRect: TRect; +begin + Result := ItemBounds; + Result.Right := Result.Left + EditSizingZoneSize; +end; + +function TdxBarCustomEditControl.RightSizingRect: TRect; +begin + Result := ItemBounds; + Result.Left := Result.Right - EditSizingZoneSize; +end; + +{ TdxBarEditControl } + +constructor TdxBarEditControl.Create(AItemLink: TdxBarItemLink); +begin + inherited Create(AItemLink); + if not ((Parent is TdxBarControl) and TdxBarControl(Parent).Moving) then + CreateInnerEdit; +end; + +destructor TdxBarEditControl.Destroy; +begin + if not ((Parent is TdxBarControl) and TdxBarControl(Parent).Moving) then + DestroyInnerEdit; + inherited Destroy; +end; + +procedure TdxBarEditControl.CreateWindowHandle; +begin + FHandle := CreateWindowEx(0, 'EDIT', '', + WS_CHILD or Painter.EditControlES_Style, + 0, 0, 100, 100, Parent.Handle, 0, HInstance, nil); + + RestoreDisplayValue; + SendMessage(FHandle, EM_SETLIMITTEXT, MaxLength, 0); +end; + +procedure TdxBarEditControl.DestroyWindowHandle(ADestroyWindow: Boolean = True); +begin + dxBar.DestroyWindowHandle(FHandle, ADestroyWindow); +end; + +function TdxBarEditControl.GetItem: TdxBarEdit; +begin + Result := TdxBarEdit(ItemLink.Item); +end; + +function TdxBarEditControl.GetMaxLength: Integer; +begin + Result := Item.MaxLength; +end; + +function TdxBarEditControl.GetReadOnly: Boolean; +begin + Result := Item.ReadOnly; +end; + +function TdxBarEditControl.CanDrawEditor: Boolean; +begin + Result := not Focused or not Enabled; +end; + +procedure TdxBarEditControl.ControlClick(AByMouse: Boolean; AKey: Char = #0); +begin + inherited; + if Focused then SendMessage(FHandle, EM_SETSEL, 0, -1); +end; + +procedure TdxBarEditControl.CreateInnerEdit; +begin + CreateWindowHandle; + inherited CreateInnerEdit; +end; + +procedure TdxBarEditControl.DestroyInnerEdit(AFullDestroy: Boolean = True); +begin + inherited DestroyInnerEdit(AFullDestroy); + DestroyWindowHandle(AFullDestroy); +end; + +procedure TdxBarEditControl.DrawTextField; +var + ASavedFont: TdxBarSavedFont; +begin + if Enabled then + WindowRect := FParts[ecpEdit]; + if CanDrawEditor then + begin + PrepareCanvasFont(Parent.EditFontHandle, Item.StyleEdit, ASavedFont); + try + Painter.EditControlDrawTextField(Self, Canvas, FParts[ecpEdit]); + finally + RestoreCanvasFont(ASavedFont); + end; + end; +end; + +function TdxBarEditControl.GetHandle: HWND; +begin + Result := FHandle; +end; + +function TdxBarEditControl.GetMinEditorWidth: Integer; +begin + Result := MinEditWidth; +end; + +function TdxBarEditControl.GetNonBufferedRect: TRect; +begin + if CanDrawEditor then + Result := inherited GetNonBufferedRect + else + Result := FParts[ecpEdit]; +end; + +procedure TdxBarEditControl.Hide(AStoreDisplayValue: Boolean); +begin + if Handle <> 0 then + ShowWindow(Handle, SW_HIDE); + if AStoreDisplayValue then + StoreDisplayValue; +end; + +procedure TdxBarEditControl.InitEdit; +begin + CalcDrawParams; +end; + +function TdxBarEditControl.IsTransparentOnGlass: Boolean; +begin + Result := False; +end; + +procedure TdxBarEditControl.PrepareEditWnd; +begin + Painter.EditControlPrepareEditWnd(Self, Handle); +end; + +procedure TdxBarEditControl.SetFocused(Value: Boolean); +begin + if Value <> FFocused then + begin + if Value{Focused} then + SendMessage(Handle, EM_SETREADONLY, WPARAM(ReadOnly or Item.EmptyWindow), 0); + inherited; + Repaint; + end; +end; + +procedure TdxBarEditControl.SetText(Value: string); +var + ANotEqual: Boolean; +begin + ANotEqual := Text <> Value; + inherited; + Painter.EditControlUpdateWndText(Self, Handle, ANotEqual); +end; + +procedure TdxBarEditControl.Show; +begin + inherited Show; + SendMessage(Handle, WM_SETFONT, EditFont.Handle, 0); + with WindowRect do + SetWindowPos(Handle, 0, Left, Top, Right - Left, Bottom - Top, SWP_SHOWWINDOW); + PrepareEditWnd; + + FFocusing := True; + try + RestoreDisplayValue; + finally + FFocusing := False; + end; + + SetFocus(Handle); +end; + +procedure TdxBarEditControl.WndProc(var Message: TMessage); + + procedure DoBufferedPaint(DC: HDC; Rect: TRect); + var + MemDC: HDC; + PaintBuffer: THandle; + begin + PaintBuffer := BeginBufferedPaint(DC, @Rect, BPBF_TOPDOWNDIB, nil, MemDC); + try + SendMessage(Handle, WM_ERASEBKGND, MemDC, MemDC); + SendMessage(Handle, WM_PRINTCLIENT, MemDC, PRF_CLIENT); + BufferedPaintSetAlpha(PaintBuffer, @Rect, 255); + finally + HideCaret(Handle); + EndBufferedPaint(PaintBuffer, True); + ShowCaret(Handle); + end; + end; + + procedure DoWMPaint; + var + DC: HDC; + PS: TPaintStruct; + begin + DC := BeginPaint(Handle, PS); + try + DoBufferedPaint(DC, PS.rcPaint); + finally + EndPaint(Handle, PS); + end; + end; + +var + DC: HDC; + R: TRect; +begin + case Message.Msg of + WM_DESTROY: + begin + Focused := False; + DefaultHandler(Message); + DestroyInnerEdit(False); + end; + WM_PAINT: + if OnGlass then + begin + DoWMPaint; + Message.Result := 1; + end + else + DefaultHandler(Message); + CM_BUFFEREDPAINTONGLASS: + if OnGlass and InnerControlBufferedPaint then + begin + DC := GetDC(Handle); + try + GetClientRect(Handle, R); + DoBufferedPaint(DC, R); + finally + InnerControlBufferedPaint := False; + ReleaseDC(Handle, DC); + end; + end; + else + inherited WndProc(Message); + end; +end; + +{ TCustomdxBarComboControl } + +destructor TCustomdxBarComboControl.Destroy; +begin + DroppedDown := False; + inherited; +end; + +function TCustomdxBarComboControl.IsDroppedDown: Boolean; +begin + Result := DroppedDown; +end; + +function TCustomdxBarComboControl.GetDropDownWindow: HWND; +begin + Result := Item.DropDownWindow; +end; + +function TCustomdxBarComboControl.GetItem: TCustomdxBarCombo; +begin + Result := TCustomdxBarCombo(ItemLink.Item); +end; + +procedure TCustomdxBarComboControl.CalcDrawParams(AFull: Boolean = True); +begin + inherited; + if AFull then + DrawParams.DroppedDown := FDroppedDown; +end; + +procedure TCustomdxBarComboControl.CalcParts; +begin + inherited; + Painter.CalculateComboParts(DrawParams, FParts, ItemBounds); +end; + +function TCustomdxBarComboControl.CanDrawEditor: Boolean; +begin + Result := not Enabled or not Focused or Item.EmptyWindow; +end; + +procedure TCustomdxBarComboControl.ControlInactivate(Immediately: Boolean); +begin + DroppedDown := False; + inherited; +end; + +procedure TCustomdxBarComboControl.CorrectFrameRect(var ARect: TRect); +begin + ARect.Right := FParts[ccpDropButton].Right + Painter.ComboControlButtonOffsets(DrawParams.PaintType).Right; +end; + +procedure TCustomdxBarComboControl.DrawTextField; +begin + Painter.ComboControlDrawArrowButton(DrawParams, FParts[ccpDropButton], True); + inherited DrawTextField; +end; + +procedure TCustomdxBarComboControl.EnabledChanged; +begin + DroppedDown := False; + inherited; +end; + +function TCustomdxBarComboControl.GetPartCount: Integer; +begin + Result := inherited GetPartCount + 1; +end; + +function TCustomdxBarComboControl.IsChildWindow(AWnd: HWND): Boolean; +begin + Result := inherited IsChildWindow(AWnd) or + (DroppedDown and IsWindowVisible(DropDownWindow) and IsChildEx(DropDownWindow, AWnd)); +end; + +procedure TCustomdxBarComboControl.SetDroppedDown(Value: Boolean); +var + P: TPoint; +begin + if (FDroppedDown <> Value) and not Item.ReadOnly then + begin + FDroppedDown := Value; + Repaint; + if FDroppedDown then + begin + with Parent.GetItemRect(Self), P do + if (Parent.Kind = bkSubMenu) or Parent.IsRealVertical then + begin + X := Right; + Y := Top; + end + else + begin + X := Left + GetEditOffset; + Y := Bottom; + end; + ClientToScreen(Parent.Handle, P); + Item.DropDown(P.X, P.Y); + end + else + Item.CloseUp; + end; +end; + +procedure TCustomdxBarComboControl.SysKeyDown(var Key: Word; Shift: TShiftState); +begin + if (Key = VK_UP) or (Key = VK_DOWN) then + begin + DroppedDown := not DroppedDown; + Key := 0; + end; + inherited SysKeyDown(Key, Shift); +end; + +procedure TCustomdxBarComboControl.SysKeyUp(var Key: Word; Shift: TShiftState); +begin + if (Key = VK_UP) or (Key = VK_DOWN) then + Key := 0; + inherited SysKeyUp(Key, Shift); +end; + +procedure TCustomdxBarComboControl.WndProc(var Message: TMessage); + + function IsMouseCursorInDroppedDownArea: Boolean; + begin + if Item.ShowEditor then + Result := FHotPartIndex in [ccpDropButton] + else + Result := FHotPartIndex in [ecpEdit, ccpDropButton]; + end; + + function LButtonDowned: Boolean; + begin + with Message do + LButtonDowned := (Msg = WM_LBUTTONDOWN) or (Msg = WM_LBUTTONDBLCLK); + end; + +var + Shift: TShiftState; + AHandle: HWND; +begin + with Message do + case Msg of + WM_KEYDOWN, WM_KEYUP, WM_CHAR: + begin + Shift := KeyDataToShiftState(lParam); + if (Msg = WM_KEYDOWN) and (wParam = VK_F4) then + begin + DroppedDown := not DroppedDown; + Exit; + end + else + if DroppedDown and (DropDownWindow <> 0) and + Item.CheckKeyForDropDownWindow(wParam, Shift) then + begin + Result := SendMessage(DropDownWindow, Msg, wParam, lParam); + Exit; + end; + end; + end; + AHandle := Handle; + inherited; + if not IsWindowVisible(AHandle) then Exit; + if LButtonDowned then FOnPressDroppedDown := DroppedDown; + if IsMouseCursorInDroppedDownArea and (not FOnPressDroppedDown and LButtonDowned or + FOnPressDroppedDown and (Message.Msg = WM_LBUTTONUP)) then + DroppedDown := not DroppedDown; +end; + +{ TdxBarComboControl } + +function TdxBarComboControl.GetItem: TdxBarCustomCombo; +begin + Result := TdxBarCustomCombo(ItemLink.Item); +end; + +function TdxBarComboControl.GetItemIndex: Integer; +begin + Result := Item.ItemIndex; +end; + +function TdxBarComboControl.GetItems: TStrings; +begin + Result := Item.Items; +end; + +function TdxBarComboControl.GetSorted: Boolean; +begin + Result := Item.Sorted; +end; + +procedure TdxBarComboControl.SetLocalItemIndex(Value: Integer); +begin + FLocalItemIndex := Value; + RestoreDisplayValue; + if Item.EmptyWindow then Repaint; +end; + +procedure TdxBarComboControl.RestoreDisplayValue; +begin + if (0 <= FLocalItemIndex) and (FLocalItemIndex <= Items.Count - 1) then + Text := Items[FLocalItemIndex] + else + inherited RestoreDisplayValue; +end; + +procedure TdxBarComboControl.SetFocused(Value: Boolean); +begin + FFocusing := True; + try + if Value then LocalItemIndex := ItemIndex; + finally + FFocusing := False; + end; + inherited; +end; + +procedure TdxBarComboControl.WndProc(var Message: TMessage); +var + Shift: TShiftState; +begin + if not ReadOnly then + begin + with Message do + case Msg of + WM_MOUSEWHEEL: + begin + if SmallInt(HIWORD(TWMMOuse(Message).Keys)) > 0 then + begin + if not DroppedDown then + begin + if LocalItemIndex > 0 then + LocalItemIndex := LocalItemIndex - 1; + end + else + SendMessage(DropDownWindow, WM_VScroll, SB_LINEUP, 0); + end + else + begin + if not DroppedDown then + begin + if LocalItemIndex < (Items.Count - 1) then + LocalItemIndex := LocalItemIndex + 1; + end + else + SendMessage(DropDownWindow, WM_VScroll, SB_LINEDOWN, 0); + end; + end; + WM_KEYDOWN: + begin + if (wParam = VK_RETURN) or (wParam = VK_TAB) then + begin + if (LocalItemIndex <> -1) and (Item.Items[LocalItemIndex] = Text) then + begin + Item.ItemIndex := LocalItemIndex; + if not IsWindowVisible(Handle) then Exit; + end; + end + else + begin + Shift := KeyDataToShiftState(lParam); + if not DroppedDown and ((wParam = VK_UP) or (wParam = VK_DOWN)) and (Shift = []) then + begin + if (wParam = VK_UP) and (LocalItemIndex > 0) then + LocalItemIndex := LocalItemIndex - 1 + else + if (wParam = VK_DOWN) and (LocalItemIndex < Items.Count - 1) then + LocalItemIndex := LocalItemIndex + 1; + Exit; + end; + end; + end; + end; + end; + inherited WndProc(Message); +end; + +{ TdxBarSubItemControl } + +destructor TdxBarSubItemControl.Destroy; +begin + FIsActive := False; + inherited Destroy; +end; + +function TdxBarSubItemControl.IsDroppedDown: Boolean; +begin + Result := (SubMenuControl <> nil) and IsActive and (SubMenuControl.ParentItemControl = Self); +end; + +function TdxBarSubItemControl.GetCaptionOffset: Integer; +begin + Result := Painter.GetControlCaptionOffset(Self); +end; + +function TdxBarSubItemControl.GetItem: TCustomdxBarSubItem; +begin + Result := TCustomdxBarSubItem(ItemLink.Item); +end; + +function TdxBarSubItemControl.GetSubMenuControl: TdxBarSubMenuControl; +begin + if Item.ItemLinks = nil then + Result := nil + else + Result := TdxBarSubMenuControl(Item.ItemLinks.BarControl); +end; + +procedure TdxBarSubItemControl.CalcDrawParams(AFull: Boolean = True); +begin + inherited; + if AFull then + begin + DrawParams.IsPressed := IsPressed; + DrawParams.DrawDowned := IsDroppedDown; + DrawParams.DroppedDown := IsDroppedDown; + DrawParams.IsMenuItem := IsMenuItem; + end; +end; + +function TdxBarSubItemControl.CanActivate: Boolean; +begin + Result := inherited CanActivate and (Enabled or not Item.IsInternal); +end; + +function TdxBarSubItemControl.CanClicked: Boolean; +begin + Result := False; +end; + +procedure TdxBarSubItemControl.ControlActivate(Immediately: Boolean); +begin + if not HasSubMenu then Exit; + +{ #DG TODO: Check it + if IsDroppedDown then + if (ItemLink.Item.CurItemLink = nil) or (Self = ItemLink.Item.CurItemLink.Control) then + begin + FinishSubMenuTracking; + Exit; + end + else + ItemLink.Item.CurItemLink.Control.ControlInActivate(True); +} + + inherited; +end; + +procedure TdxBarSubItemControl.ControlInactivate(Immediately: Boolean); +begin + if HasSubMenu then + inherited; +end; + +procedure TdxBarSubItemControl.ControlClick(AByMouse: Boolean; AKey: Char = #0); +begin + if IsDroppedDown then + begin + if Parent.IsCustomizing or (BarManager.GetPaintStyle = bmsStandard) then // ??? + ControlInactivate(True) + end + else + begin + ControlActivate(True); + if not AByMouse and (SubMenuControl <> nil) then + with SubMenuControl do + if NeedsSelectFirstItemOnDropDownByKey and (ItemLinks.First <> nil) then + SetKeySelectedItem(ItemLinks.First.Control); + end; +end; + +procedure TdxBarSubItemControl.CreateSubMenuControl; +begin + Item.ItemLinks.CreateBarControl; +end; + +procedure TdxBarSubItemControl.DoCreateSubMenuControl; +begin + CreateSubMenuControl; + if SubMenuControl <> nil then + SubMenuControl.FSubItem := Self; + if HasShadow and IsDroppedDown then + begin + SubMenuControl.OwnerBounds := Parent.GetItemScreenRect(Self); + SubMenuControl.FOwnerControl := Parent; + end; +end; + +procedure TdxBarSubItemControl.DoCloseUp(AHadSubMenuControl: Boolean); +begin + if AHadSubMenuControl then + SubMenuControl.FSubItem := nil; + inherited DoCloseUp(AHadSubMenuControl); + if AHadSubMenuControl then + Item.DoCloseUp; +end; + +procedure TdxBarSubItemControl.DoDropDown(AByMouse: Boolean); +begin + Item.DoPopup; + Item.DirectClick; + DoCreateSubMenuControl; + if SubMenuControl <> nil then + ShowSubMenuControl; +end; + +procedure TdxBarSubItemControl.DropDown(AByMouse: Boolean); +begin + inherited; + Click(AByMouse); +end; + +procedure TdxBarSubItemControl.GetSubMenuControlPositionParams(out P: TPoint; + out AOwnerWidth, AOwnerHeight: Integer); +var + R: TRect; +begin + AOwnerWidth := 0; + AOwnerHeight := 0; + R := Parent.GetItemRect(Self); + if Parent.Kind = bkSubMenu then + begin + P := Point(R.Right, R.Top - SubMenuParent.BorderSize); + AOwnerWidth := R.Right - R.Left; + end + else + if Parent.IsRealVertical then + begin + P := Point(R.Right, R.Top); + AOwnerWidth := R.Right - R.Left; + end + else + begin + P := Point(R.Left, R.Bottom); + AOwnerHeight := R.Bottom - R.Top; + end; + P := Parent.ClientToScreen(P); +end; + +function TdxBarSubItemControl.IsFlatText: Boolean; +begin + Result := Painter.IsFlatItemText and (not IsHighContrastWhite or inherited IsFlatText); +end; + +function TdxBarSubItemControl.IsTextSelected: Boolean; + + function IsFlatText: Boolean; + begin + Result := Painter.IsFlatItemText and IsHighContrastWhite; + end; + +begin + Result := DrawSelected and + (not IsFlatText and Painter.IsMenuItem(Self) or IsFlatText and not IsDroppedDown or inherited IsTextSelected); +end; + +procedure TdxBarSubItemControl.ShowSubMenuControl; +var + AOwnerHeight, AOwnerWidth: Integer; + P: TPoint; +begin + GetSubMenuControlPositionParams(P, AOwnerWidth, AOwnerHeight); + SubMenuControl.OwnerWidth := AOwnerWidth; + SubMenuControl.OwnerHeight := AOwnerHeight; + SubMenuControl.Left := P.X; + SubMenuControl.Top := P.Y; + // *** + Parent.ChildBar := SubMenuControl; +//#DG SubMenuControl.UpdateDoubleBuffered; - ? why ? + // *** + if Parent.Kind <> bkSubMenu then + Repaint; + SubMenuControl.FShowAnimation := FShowAnimation; + FShowAnimation := False; + SubMenuControl.Show; + if Painter.IsDropDownRepaintNeeded then + Repaint; +end; + +function TdxBarSubItemControl.GetCaptionAreaWidth: Integer; +begin + Result := inherited GetCaptionAreaWidth; + Painter.InflateSizeForArrow(DrawParams, Result); +end; + +function TdxBarSubItemControl.GetControlCaptionOffset: Integer; +begin + Result := Painter.GetControlCaptionOffset(Self); +end; + +function TdxBarSubItemControl.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxBarSubItemControlAccessibilityHelper; +end; + +function TdxBarSubItemControl.GetOwnedBarControl: TCustomdxBarControl; +begin + Result := SubMenuControl; +end; + +function TdxBarSubItemControl.HasSubMenu: Boolean; +begin + Result := True; +end; + +function TdxBarSubItemControl.IsDestroyOnClick: Boolean; +begin + Result := False; +end; + +function TdxBarSubItemControl.IsDropDown: Boolean; +begin + Result := True; +end; + +function TdxBarSubItemControl.IsExpandable: Boolean; +begin + Result := True; +end; + +function TdxBarSubItemControl.IsMenuItem: Boolean; +begin + Result := Parent.IsMainMenu; +end; + +function TdxBarSubItemControl.IsPressed: Boolean; +begin + Result := IsDroppedDown and (FHotPartIndex <> icpNone) and MousePressed; +end; + +function TdxBarSubItemControl.WantsDblClick: Boolean; +begin + Result := inherited WantsDblClick and not BarManager.Designing; +end; + +function TdxBarSubItemControl.WantsKey(Key: Word): Boolean; +begin + Result := inherited WantsKey(Key) or (Key = VK_RETURN); +end; + +function TdxBarSubItemControl.GetPossibleViewLevels: TdxBarItemViewLevels; +begin + Result := inherited GetPossibleViewLevels; + Include(Result, ivlLargeIconWithText); +end; + +function TdxBarSubItemControl.GetDefaultViewStructure: TdxBarItemControlViewStructure; +begin + Result := []; + if Item.ShowCaption or (GetPaintType = ptMenu) then + Include(Result, cpText); + if IconAssigned(GetViewSize) or not (cpText in Result) then + Include(Result, cpIcon); +end; + +{ TContainerItemSubMenuControl } + +type + TContainerItemSubMenuControl = class(TdxBarSubMenuControl) + private + FContainerItem: TCustomdxBarContainerItem; + protected + procedure DoCloseUp; override; + function GetIsCustomizing: Boolean; override; + public + destructor Destroy; override; + end; + +destructor TContainerItemSubMenuControl.Destroy; +var + AContainerItem: TCustomdxBarContainerItem; +begin + AContainerItem := FContainerItem; + inherited; + AContainerItem.NeedClearItemList; +end; + +procedure TContainerItemSubMenuControl.DoCloseUp; +begin + with FContainerItem do + DeleteListedItemLinks(ItemLinks, 0); + inherited DoCloseUp; +end; + +function TContainerItemSubMenuControl.GetIsCustomizing: Boolean; +begin + Result := False; +end; + +{ TdxBarContainerItemControl } + +function TdxBarContainerItemControl.GetItem: TCustomdxBarContainerItem; +begin + Result := TCustomdxBarContainerItem(ItemLink.Item); +end; + +procedure TdxBarContainerItemControl.CreateSubMenuControl; +begin + if BarManager.IsCustomizing then Exit; + Item.ItemLinks.FBarControl := TContainerItemSubMenuControl.Create(BarManager); + SubMenuControl.FItemLinks := Item.ItemLinks; + TContainerItemSubMenuControl(SubMenuControl).FContainerItem := Item; + with Item do AddListedItemLinks(ItemLinks, 0, True, ItemLink); +end; + +procedure TdxBarContainerItemControl.DoPaint(ARect: TRect; PaintType: TdxBarPaintType); +begin + if PaintType = ptMenu then + Painter.DrawGlyphAndTextInSubMenu(DrawParams, ARect) + else + inherited; +end; + +function TdxBarContainerItemControl.DrawSelected: Boolean; +begin + Result := inherited DrawSelected and not Parent.IsCustomizing; +end; + +function TdxBarContainerItemControl.GetCaption: string; +begin + Result := inherited GetCaption; + if not ShowRealCaption then + Result := '(' + Result + ')'; +end; + +function TdxBarContainerItemControl.IsExpandable: Boolean; +begin + Result := not BarManager.IsCustomizing; +end; + +function TdxBarContainerItemControl.ShowRealCaption: Boolean; +begin + Result := (Parent is TdxBarControl) or not Item.HideWhenRun; +end; + +{ TdxBarPainter } + +constructor TdxBarPainter.Create(AData: Integer); +begin + inherited Create; +end; + +procedure TdxBarPainter.CalculateButtonParts( + const ADrawParams: TdxBarButtonLikeControlDrawParams; var AParts: array of TRect; const AItemRect: TRect); +begin + if ADrawParams.IsDropDown then + begin + AParts[bcpDropButton].Left := AParts[bcpDropButton].Right - ADrawParams.ArrowSize.cx; + AParts[bcpButton].Right := AParts[bcpDropButton].Left; + end; +end; + +procedure TdxBarPainter.CalculateColorComboParts(const ADrawParams: TdxBarColorComboControlDrawParams; + var AParts: array of TRect; const AItemRect: TRect); +begin + AParts[clcpCustomColorButton] := GetCustomColorButtonBounds(ADrawParams, AItemRect); + AParts[ccpDropButton].Right := AParts[clcpCustomColorButton].Left; + if IsCustomColorButtonVisible(ADrawParams) then + Dec(AParts[ccpDropButton].Right, GetCustomColorButtonIndents(ADrawParams.PaintType).Left); + if not ColorComboHasCompleteFrame or not IsCustomColorButtonVisible(ADrawParams) then + Dec(AParts[ccpDropButton].Right, ComboControlButtonOffsets(ADrawParams.PaintType).Right); + InternalCalculateComboParts(ADrawParams, AParts); +end; + +procedure TdxBarPainter.CalculateComboParts(const ADrawParams: TdxBarEditLikeControlDrawParams; + var AParts: array of TRect; const AItemRect: TRect); +begin + AParts[ccpDropButton] := cxRectContent(AItemRect, ComboControlButtonOffsets(ADrawParams.PaintType)); + InternalCalculateComboParts(ADrawParams, AParts); +end; + +procedure TdxBarPainter.CalculateEditParts(const ADrawParams: TdxBarEditLikeControlDrawParams; + var AParts: array of TRect; const AItemRect: TRect); +var + ATransparentIndent: Integer; +begin + with ADrawParams do + begin + if IsTransparent and (PaintType <> ptMenu) then + ATransparentIndent := EditControlBorderOffsets(PaintType).Left + else + ATransparentIndent := 0; + + AParts[ecpIcon].Left := AParts[ecpIcon].Left + ATransparentIndent; + AParts[ecpIcon].Right := AParts[ecpIcon].Left + BarEditControl.GetGlyphAreaWidth; + + AParts[ecpText].Left := AParts[ecpIcon].Right; + AParts[ecpText].Right := AParts[ecpText].Left + BarEditControl.GetCaptionAreaWidth; + + AParts[ecpEdit] := EditControlGetContentRect(PaintType, BarEditControl.GetEditRect); + end; +end; + +procedure TdxBarPainter.CalculateSpinEditParts(const ADrawParams: TdxBarSpinEditDrawParams; + var AParts: array of TRect; const AItemRect: TRect); +begin + AParts[secButtonUp] := GetSpinEditButtonBounds(ADrawParams, AItemRect, sbUp); + AParts[secButtonDown] := GetSpinEditButtonBounds(ADrawParams, AItemRect, sbDown); + AParts[ecpEdit].Right := AParts[secButtonUp].Left - EditControlBorderOffsets(ADrawParams.PaintType).Right - GetSpinEditButtonIndents(ADrawParams.PaintType).Left; +end; + +function TdxBarPainter.GetToolbarContentOffsets(ABar: TdxBar; + ADockingStyle: TdxBarDockingStyle; AHasSizeGrip: Boolean): TRect; +begin + if ADockingStyle = dsNone then + begin + Result := Rect(BorderSizeX, BorderSizeY, BorderSizeX, BorderSizeY); + if (ABar.Control = nil) or ABar.Control.HasCaption then + begin + Inc(Result.Left, BarHorSize); + Inc(Result.Right, BarHorSize); + Inc(Result.Top, BarCaptionAreaSize + BarTopSize); + Inc(Result.Bottom, BarBottomSize); + end; + end + else + if ABar.BorderStyle = bbsSingle then + begin + BarBorderSizes(ABar, ADockingStyle, Result); + if ADockingStyle in [dsTop, dsBottom] then + Inc(Result.Left, BarFingersSize(ABar)) + else + Inc(Result.Top, BarFingersSize(ABar)); + end + else + begin + Result := cxEmptyRect; + if ABar.IsStatusBar then + begin + Inc(Result.Top, StatusBarTopBorderSize); + Result.TopLeft := cxPointOffset(Result.TopLeft, StatusBarBorderOffsets.TopLeft); + Result.BottomRight := cxPointOffset(Result.BottomRight, StatusBarBorderOffsets.BottomRight); + end; + if AHasSizeGrip then + Inc(Result.Right, StatusBarGripSize(ABar.BarManager).cx); + end; +end; + +function TdxBarPainter.GetToolbarsOffsetForAutoAlign: Integer; +begin + Result := 0; +end; + +class procedure TdxBarPainter.CalculateArrowPoints(const ARect: TRect; AArrowSize: Integer; AArrowDirection: TcxArrowDirection; out P: TcxArrowPoints); + + procedure OffsetPoints(var P: TcxArrowPoints; ADisplace: TPoint); + var + I: Integer; + begin + for I := Low(P) to High(P) do + P[I] := cxPointOffset(P[I], ADisplace); + end; + + procedure CorrectArrowPoints(var P: TcxArrowPoints; AArrowDirection: TcxArrowDirection); + begin + case AArrowDirection of + adUp: + begin + P[cxArrowLeftBasePointIndex] := cxPointOffset(P[cxArrowLeftBasePointIndex], 0, 1); + P[cxArrowRightBasePointIndex] := cxPointOffset(P[cxArrowRightBasePointIndex], 1, 1); + end; + adDown: + begin + P[cxArrowLeftBasePointIndex] := cxPointOffset(P[cxArrowLeftBasePointIndex], 1, 0); + P[cxArrowTopPointIndex] := cxPointOffset(P[cxArrowTopPointIndex], 0, 1); + if Odd(AArrowSize + cxRectHeight(ARect)) then + OffsetPoints(P, Point(0, -1)); + end; + adLeft: + begin + P[cxArrowLeftBasePointIndex] := cxPointOffset(P[cxArrowLeftBasePointIndex], 1, 1); + P[cxArrowRightBasePointIndex] := cxPointOffset(P[cxArrowRightBasePointIndex], 1, 0); + end; + adRight: + begin + P[cxArrowRightBasePointIndex] := cxPointOffset(P[cxArrowRightBasePointIndex], 0, 1); + P[cxArrowTopPointIndex] := cxPointOffset(P[cxArrowRightBasePointIndex], 1, 0); + if Odd(AArrowSize + cxRectWidth(ARect)) then + OffsetPoints(P, Point(-1, 0)); + end; + end; + end; + +begin + TcxCustomLookAndFeelPainter.CalculateArrowPoints(ARect, P, AArrowDirection, False, AArrowSize); + CorrectArrowPoints(P, AArrowDirection); +end; + +class function TdxBarPainter.GetArrowRectByPoints(const P: TcxArrowPoints; AArrowDirection: TcxArrowDirection): TRect; +begin + case AArrowDirection of + adUp: + Result := Rect(P[cxArrowLeftBasePointIndex].X, P[cxArrowTopPointIndex].Y, P[cxArrowRightBasePointIndex].X, P[cxArrowRightBasePointIndex].Y); + adDown: + Result := Rect(P[cxArrowRightBasePointIndex].X, P[cxArrowRightBasePointIndex].Y, P[cxArrowLeftBasePointIndex].X, P[cxArrowTopPointIndex].Y); + adLeft: + Result := Rect(P[cxArrowTopPointIndex].X, P[cxArrowRightBasePointIndex].Y, P[cxArrowLeftBasePointIndex].X, P[cxArrowLeftBasePointIndex].Y); + adRight: + Result := Rect(P[cxArrowLeftBasePointIndex].X, P[cxArrowLeftBasePointIndex].Y, P[cxArrowTopPointIndex].X, P[cxArrowRightBasePointIndex].Y); + end; +end; + +procedure TdxBarPainter.GetTextColors(ABarItemControl: TdxBarItemControl; + AEnabled, ASelected, AFlat: Boolean; var AColor1, AColor2: TColor); +var + ATextViewParams: TcxViewParams; +begin + if AEnabled then + begin + ABarItemControl.Item.GetTextViewParams(ATextViewParams); + if ATextViewParams.TextColor <> clDefault then + AColor1 := ATextViewParams.TextColor + else + AColor1 := GetEnabledTextColor(ABarItemControl, ASelected, AFlat); + AColor2 := AColor1; + end + else + GetDisabledTextColors(ABarItemControl, ASelected, AFlat, AColor1, AColor2); +end; + +class procedure TdxBarPainter.SetArrowRegion(ACanvas: TcxCanvas; AArrowDirection: TcxArrowDirection; + P: TcxArrowPoints; AOperation: TcxRegionOperation); + + procedure CalculateClipArea(var P: TcxArrowPoints); + begin + case AArrowDirection of + adUp: + begin + Dec(P[cxArrowLeftBasePointIndex].X); + Inc(P[cxArrowRightBasePointIndex].X); + Dec(P[cxArrowTopPointIndex].Y); + end; + adLeft: + begin + Inc(P[cxArrowRightBasePointIndex].X); + Dec(P[cxArrowRightBasePointIndex].Y, 2); + Dec(P[cxArrowTopPointIndex].X); + end; + adRight: + begin + Dec(P[cxArrowLeftBasePointIndex].X); + Dec(P[cxArrowLeftBasePointIndex].Y, 2); + end; + end; + end; + +var + ARgn: HRGN; +begin + CalculateClipArea(P); + ARgn := CreatePolygonRgn(P, 3, WINDING); + ACanvas.SetClipRegion(TcxRegion.Create(ARgn), AOperation); +end; + +class function TdxBarPainter.GetControlCaptionOffset(ABarItemControl: TdxBarItemControl): Integer; +begin + Result := -ABarItemControl.Parent.Font.Height div 2; +end; + +class function TdxBarPainter.GetDefaultTextSize(ACanvas: TcxCanvas): Integer; +begin + Result := ACanvas.TextHeight('Wg') + 6; +end; + +class function TdxBarPainter.GetPopupWindowBorderWidth: Integer; +begin + Result := 2; +end; + +class function TdxBarPainter.SubMenuControlGetItemIconRect( + const AItemRect: TRect; AIconAreaSize: Integer): TRect; +begin + Result := AItemRect; + Result.Right := Result.Left + AIconAreaSize; +end; + +class function TdxBarPainter.SubMenuControlGetItemTextRect(const ADrawParams: TdxBarButtonLikeControlDrawParams; const AItemRect: TRect): TRect; +begin + Result := AItemRect; + Inc(Result.Left, SubMenuControlGetItemTextIndent(ADrawParams)); +end; + +class function TdxBarPainter.SubMenuControlGetItemTextIndent(const ADrawParams: TdxBarItemControlDrawParams): Integer; +begin + Result := ADrawParams.BarItemControl.SubMenuParent.BandSize + 3; +end; + +class procedure TdxBarPainter.DrawBackground(ABarItemControl: TdxBarItemControl; + DC: HDC; const R: TRect; ABrush: HBRUSH; AOpaque: Boolean); +begin + if AOpaque then + FillRect(DC, R, ABrush) + else + begin + ABarItemControl.CheckNonRecent; + try + ABarItemControl.Parent.FillBackground(DC, R, ABrush, clNone, True); + finally + ABarItemControl.UncheckNonRecent; + end; + end; +end; + +class procedure TdxBarPainter.DrawBackgroundFrameRect(ABarItemControl: TdxBarItemControl; + DC: HDC; R: TRect; ABrush: HBRUSH; AOpaque: Boolean); +var + AClipRgn: HRGN; + AClipRgnExists: Boolean; +begin + if AOpaque then + FrameRect(DC, R, ABrush) + else + begin + SaveClipRgn(DC, AClipRgn, AClipRgnExists); + InflateRect(R, -1, -1); + with R do + ExcludeClipRect(DC, Left, Top, Right, Bottom); + InflateRect(R, 1, 1); + DrawBackground(ABarItemControl, DC, R, ABrush, False); + RestoreClipRgn(DC, AClipRgn, AClipRgnExists); + end; +end; + +class procedure TdxBarPainter.DrawDisabledShadowRect(ABarItemControl: TdxBarItemControl; + DC: HDC; R: TRect); +begin + FillRect(DC, R, COLOR_BTNSHADOW + 1); +end; + +procedure TdxBarPainter.DrawItemBackground(ABarItemControl: TdxBarItemControl; + ACanvas: TcxCanvas; const ASourceRect: TRect; ABrush: HBRUSH); +begin + ABarItemControl.Parent.FillBackground(ACanvas.Handle, ASourceRect, ABrush, clNone, True); +end; + +procedure TdxBarPainter.DrawGlyph(ABarItemControl: TdxBarItemControl; ADC: HDC; + ADrawRect: TRect; const AFullBounds: TRect; APaintType: TdxBarPaintType; + AGlyphEmpty, ASelected, ADowned, ADrawDowned, ADroppedDown, ACenter, AForceUseBkBrush, AIsSplit: Boolean); +var + AImageBounds: TRect; +begin + DrawGlyph(ABarItemControl, ADC, ADrawRect, AFullBounds, AImageBounds, + APaintType, ABarItemControl.GetViewStructure, ABarItemControl.GetViewSize, + AGlyphEmpty, ASelected, ADowned, ADrawDowned, ADroppedDown, ACenter, AForceUseBkBrush, False, AIsSplit); +end; + +procedure TdxBarPainter.DrawGlyph( + ABarItemControl: TdxBarItemControl; ADC: HDC; + ADrawRect: TRect; const AFullBounds: TRect; out AImageBounds: TRect; + APaintType: TdxBarPaintType; AViewStructure: TdxBarItemControlViewStructure; + AViewSize: TdxBarItemControlViewSize; + AGlyphEmpty, ASelected, ADowned, ADrawDowned, ADroppedDown, ACenter, AForceUseBkBrush, AGrayScale, AIsSplit: Boolean); +var + ACurrentGlyph: TBitmap; + ACurrentImages: TCustomImageList; + ACurrentImageIndex: Integer; +begin + GetImageParams(ABarItemControl, ADrawRect, APaintType, AViewStructure, AViewSize, ACenter, + ASelected, ADowned, ADrawDowned, AGlyphEmpty, ACurrentGlyph, ACurrentImages, ACurrentImageIndex, AImageBounds); + + ABarItemControl.ViewInfo.ImageBounds := AImageBounds; + + if not IsRectEmpty(AFullBounds) then + ADrawRect := AFullBounds; + DrawGlyphAndBkgnd(ABarItemControl, ADC, ADrawRect, AImageBounds, APaintType, ACurrentGlyph, + ACurrentImages, ACurrentImageIndex, + AGlyphEmpty, ASelected, ADowned, ADrawDowned, ADroppedDown, + AForceUseBkBrush, AGrayScale, AIsSplit); +end; + +procedure TdxBarPainter.DrawGlyphAndBkgnd( + ABarItemControl: TdxBarItemControl; ADC: HDC; + const R, AGlyphRect: TRect; APaintType: TdxBarPaintType; AGlyph: TBitmap; + AImages: TCustomImageList; AImageIndex: Integer; AGlyphEmpty, ASelected, ADowned, + ADrawDowned, ADroppedDown, AForceUseBkBrush, AGrayScale, AIsSplit: Boolean); + + procedure GetDimensions(out AWidth, AHeight: Integer); + begin + AWidth := cxRectWidth(R); + AHeight := cxRectHeight(R); + end; + + procedure GetImageDimensions(out AWidth, AHeight: Integer); + begin + AWidth := cxRectWidth(AGlyphRect); + AHeight := cxRectHeight(AGlyphRect); + end; + + function GetImageGlyphRect(const ARect: TRect; ANeedBorder: Boolean): TRect; + begin + if ANeedBorder then + Result := cxRectInflate(ARect, -1, -1) + else + Result := ARect; + end; + + procedure DrawGlyphImageBackground(ABarItemControl: TdxBarItemControl; ADC: HDC; const R: TRect; + ADown, ADrawDowned, ASelected, AGlyphEmpty: Boolean; ABrush: HBRUSH); + begin + if not IsNativeBackground and + (AGlyphEmpty or not AGlyphEmpty and IsGlyphImageTransparent(ABarItemControl)) then + DrawBackground(ABarItemControl, ADC, R, ABrush, + IsGlyphImageBackgroundOpaque(ABarItemControl, ADown, ADrawDowned, ASelected, AGlyphEmpty)); + end; + +var + ABrush: HBRUSH; + AWidth, AHeight, AImageWidth, AImageHeight: Integer; + ANeedBorder: Boolean; + AFullGlyphRect: TRect; +begin + GetDimensions(AWidth, AHeight); + ABrush := GlyphBkgndBrush(ABarItemControl, APaintType, AGlyphEmpty, ASelected, + ADowned, ADrawDowned, ADroppedDown, AForceUseBkBrush, AGrayScale); + + if AGlyphEmpty then + begin + ANeedBorder := + (ABarItemControl.BarManager.GlyphSize + 2 <= AWidth) and + (ABarItemControl.BarManager.GlyphSize + 2 <= AHeight); + end + else + begin + GetImageDimensions(AImageWidth, AImageHeight); + ANeedBorder := + (AImageWidth + 2 <= AWidth) and (AImageHeight + 2 <= AHeight); + end; + + if IsNativeBackground then + DrawGlyphBorder(ABarItemControl, ADC, ABrush, ANeedBorder, R, APaintType, AGlyphEmpty, + ASelected, ADowned, ADrawDowned, ADroppedDown, AIsSplit); + + AFullGlyphRect := GetImageGlyphRect(R, ANeedBorder); + DrawGlyphImageBackground(ABarItemControl, ADC, AFullGlyphRect, + ADowned, ADrawDowned, ASelected, AGlyphEmpty, ABrush); + + if AGlyphEmpty then + DrawGlyphEmptyImage(ABarItemControl, ADC, AFullGlyphRect, APaintType, ADowned) + else + begin + if IsGlyphImageTransparent(ABarItemControl) then + ABrush := 0; + + TransparentDraw(ABarItemControl, ADC, ABrush, AFullGlyphRect, AGlyphRect, + AGlyph, AImages, AImageIndex, ABarItemControl.BarManager.ImageListBkColor, + ABarItemControl.GetImageEnabled(APaintType), AGrayScale, IsFlatGlyphImage, ASelected, ADowned, ADrawDowned, + IsGlyphImageHasShadow, GetFaded(ABarItemControl.Parent){Faded}, + ABarItemControl.BarManager.ImageOptions.SmoothGlyphs, + ABarItemControl.BarManager.ImageOptions.UseLeftBottomPixelAsTransparent); + end; + + if not IsNativeBackground then + DrawGlyphBorder(ABarItemControl, ADC, ABrush, ANeedBorder, R, APaintType, AGlyphEmpty, + ASelected, ADowned, ADrawDowned, ADroppedDown, AIsSplit); +end; + +procedure TdxBarPainter.DrawGlyphAndTextInSubMenu( + const ADrawParams: TdxBarButtonLikeControlDrawParams; const R: TRect); +var + AIsGlyphEmpty: Boolean; +begin + with ADrawParams do + begin + DrawItemBackgroundInSubMenu(ADrawParams, R); + + AIsGlyphEmpty := not BarItemControl.HasIcon(ViewSize, ViewStructure); + DrawGlyph(BarItemControl, Canvas.Handle, SubMenuControlGetItemIconRect(R, BarItemControl.Parent.IconAreaSize), + cxEmptyRect, ptMenu, AIsGlyphEmpty, DrawSelected, Downed, False, False, False, False, False); + + DrawItemTextInSubMenu(ADrawParams, SubMenuControlGetItemTextRect(ADrawParams, R)); + end; +end; + +procedure TdxBarPainter.DrawItemBackgroundInSubMenu(const ADrawParams: TdxBarButtonLikeControlDrawParams; R: TRect); +begin + // Required +end; + +procedure TdxBarPainter.DrawItemMultilineText(const ADrawParams: TdxBarItemControlDrawParams; + const AText: string; const ATextRect: TRect; AAlignment: UINT; AMaxLineCount: Integer); +var + ALines: TStrings; + I, ALettersCount, ALineHeight: Integer; + ARect: TRect; +begin + ARect := ATextRect; + ALines := TStringList.Create; + try + cxGetTextLines(AText, ADrawParams.Canvas, ARect, ALines); + if ALines.Count > AMaxLineCount then + begin + for I := ALines.Count - 1 downto AMaxLineCount - 1 do + ALines.Delete(I); + if ALines.Count > 0 then + ALettersCount := Length(ALines[0]) + 1 + else + ALettersCount := 0; + ALines.Add(Trim(Copy(AText, ALettersCount, MaxInt))); + end; + ALineHeight := ADrawParams.Canvas.TextHeight('Wg'); + for I := 0 to ALines.Count - 1 do + begin + DrawItemText(ADrawParams.BarItemControl, ADrawParams.Canvas.Handle, + ALines[I], ARect, AAlignment or DT_TOP, ADrawParams.Enabled, + ADrawParams.DrawSelected, False, True, IsFlatItemTextForMenu, DT_END_ELLIPSIS); + OffsetRect(ARect, 0, ALineHeight); + end; + finally + ALines.Free; + end; +end; + +procedure TdxBarPainter.DrawItemText(ABarItemControl: TdxBarItemControl; + ADC: HDC; S: string; APaintRect: TRect; AAlignment: UINT; AEnabled, ASelected, + ARotated, AClipped, AFlatText: Boolean; AFormat: UINT); + + procedure UnderlineAccel(ACanvas: TcxCanvas; const APaintRect: TRect; const ATextSize: TSize; AAccelWidth, AAccelOffset: Integer); + var + X, Y: Integer; + ATextMetric: TTextMetric; + begin + ACanvas.Pen.Color := ACanvas.Font.Color; + GetTextMetrics(ACanvas.Handle, ATextMetric); + X := (APaintRect.Left + APaintRect.Right - ATextSize.cy) div 2 + ATextMetric.tmDescent - 2; + Y := APaintRect.Top + AAccelOffset; + ACanvas.MoveTo(X, Y); + ACanvas.LineTo(X, Y + AAccelWidth); + end; + +var + R: TRect; + AAccelPos: Integer; + AFlat: Boolean; + AColor1, AColor2: TColor; + ATextSize: TSize; + ATextOffsetY, AAccelWidth, AAccelOffsetY: Integer; +begin + BarCanvas.BeginPaint(ADC); + try + R := APaintRect; + if not AClipped then + AFormat := AFormat or DT_NOCLIP + else + if ARotated then + begin + AFormat := AFormat or DT_NOCLIP; + BarCanvas.SetClipRegion(TcxRegion.Create(APaintRect), roIntersect); + end; + + AAccelPos := 0; + AAccelWidth := 0; + AAccelOffsetY := 0; + if ARotated then + begin + AAccelPos := GetAccelPos(S, True); + if AAccelPos > 0 then + AFormat := AFormat or DT_NOPREFIX; + ATextSize := BarCanvas.TextExtent(S); + case AAlignment of + DT_CENTER: + ATextOffsetY := (cxRectHeight(APaintRect) - ATextSize.cx) div 2; + DT_RIGHT: + ATextOffsetY := cxRectHeight(APaintRect) - ATextSize.cx; + else + ATextOffsetY := 0; + end; + OffsetRect(APaintRect, (cxRectWidth(APaintRect) + ATextSize.cy) div 2, ATextOffsetY); + if AAccelPos > 0 then + begin + AAccelOffsetY := ATextOffsetY + BarCanvas.TextWidth(Copy(S, 1, AAccelPos - 1)); + AAccelWidth := BarCanvas.TextWidth(S[AAccelPos]); + end; + end + else + AFormat := AFormat or AAlignment or DT_VCENTER; + + AFlat := IsFlatItemText and AFlatText; // TODO and ... + GetTextColors(ABarItemControl, AEnabled, ASelected, AFlat, AColor1, AColor2); + BarCanvas.Brush.Style := bsClear; + + if AColor2 <> AColor1 then + begin + BarCanvas.Font.Color := AColor1; + OffsetRect(APaintRect, 1, 1); + cxDrawText(BarCanvas.Handle, S, APaintRect, AFormat); + OffsetRect(APaintRect, -1, -1); + if ARotated and (AAccelPos > 0) then + begin + OffsetRect(R, 1, 1); + UnderlineAccel(BarCanvas, R, ATextSize, AAccelWidth, AAccelOffsetY); + OffsetRect(R, -1, -1); + end; + end; + + BarCanvas.Font.Color := AColor2; + cxDrawText(BarCanvas.Handle, S, APaintRect, AFormat); + if ARotated and (AAccelPos > 0) then + UnderlineAccel(BarCanvas, R, ATextSize, AAccelWidth, AAccelOffsetY); + finally + BarCanvas.EndPaint; + end; +end; + +procedure TdxBarPainter.DrawItemTextInSubMenu(const ADrawParams: TdxBarButtonLikeControlDrawParams; R: TRect); + + procedure DrawDescription(var ACaptionRect: TRect); + var + ADescriptionRect: TRect; + ATextHeight, AOffset: Integer; + begin + with ADrawParams do + begin + if Description <> '' then + begin + ATextHeight := Canvas.TextHeight('Wg'); + AOffset := (cxRectHeight(R) - ATextHeight * 3) div 4; + + ADescriptionRect.Left := R.Left; + ADescriptionRect.Top := R.Bottom - (ATextHeight + AOffset) * 2; + ADescriptionRect.Right := R.Right - BarItemControl.Parent.TextSize; + ADescriptionRect.Bottom := R.Bottom; + + ACaptionRect.Bottom := ADescriptionRect.Top; + + DrawItemMultilineText(ADrawParams, Description, ADescriptionRect, DT_LEFT, 2); + end; + Canvas.Font.Style := Canvas.Font.Style + [fsBold]; + end; + end; + +var + ACaptionRect: TRect; +begin + with ADrawParams do + begin + InflateRect(R, 0, SubMenuControlInternalBorderSize); + ACaptionRect := R; + if BarItemControl.ShowDescription then + DrawDescription(ACaptionRect); + DrawItemText(BarItemControl, Canvas.Handle, Caption, ACaptionRect, DT_LEFT, + Enabled, DrawSelected, False, False, IsFlatItemTextForMenu); + if BarItemControl.CanShowShortCut and (ShortCut <> '') then + begin + Dec(ACaptionRect.Right, 5 + BarItemControl.Parent.TextSize); + DrawItemText(BarItemControl, Canvas.Handle, ShortCut, ACaptionRect, DT_RIGHT, + Enabled, DrawSelected, False, False, IsFlatItemTextForMenu); + end; + end; +end; + +class procedure TdxBarPainter.DrawLowered(DC: HDC; var R: TRect); +begin + DrawEdge(DC, R, BDR_SUNKENOUTER, BF_RECT); + InflateRect(R, -1, -1); // LoweredBorderSize(ABarItemControl) = 1 +end; + +class procedure TdxBarPainter.FrameAndFillRect(ABarItemControl: TdxBarItemControl; + DC: HDC; var R: TRect; Enabled, Selected, Pressed: Boolean); +begin + // Required +end; + +class function TdxBarPainter.GetCaptionOffsets: TRect; +begin + Result := Rect(2, 2, 2, 3); +end; + +class function TdxBarPainter.GlyphBkgndBrush(ABarItemControl: TdxBarItemControl; + APaintType: TdxBarPaintType; AGlyphEmpty, ASelected, ADowned, ADrawDowned, ADroppedDown, + AForceUseBkBrush, AGrayScale: Boolean): HBRUSH; +begin + Result := ABarItemControl.BkBrush; +end; + +class function TdxBarPainter.GlyphDownShift(ABarItemControl: TdxBarItemControl): Integer; +begin + Result := 0; +end; + +class function TdxBarPainter.GlyphDrawDownedShift(ABarItemControl: TdxBarItemControl; + ADown: Boolean): Integer; +begin + Result := 0; +end; + +class function TdxBarPainter.IsFlatGlyphImage: Boolean; +begin + Result := False; +end; + +class function TdxBarPainter.IsFlatItemText: Boolean; +begin + Result := False; +end; + +class function TdxBarPainter.IsFlatItemTextForMenu: Boolean; +begin + Result := IsFlatItemText and not IsHighContrastWhite; +end; + +function TdxBarPainter.IsCustomSelectedTextColorExists(ABarItemControl: TdxBarItemControl): Boolean; +begin + Result := False; +end; + +class function TdxBarPainter.IsGlyphImageBackgroundOpaque(ABarItemControl: TdxBarItemControl; + ADown, ADrawDowned, ASelected, AGlyphEmpty: Boolean): Boolean; +begin + Result := ABarItemControl.FNonRecent; + if AGlyphEmpty then + Result := Result or ADown or ADrawDowned or ASelected + else + Result := Result or ABarItemControl.IsBkColorAssigned; +end; + +class function TdxBarPainter.IsGlyphImageHasShadow: Boolean; +begin + Result := False; +end; + +class function TdxBarPainter.IsGlyphImageTransparent(ABarItemControl: TdxBarItemControl): Boolean; +begin + Result := IsNativeBackground or not ABarItemControl.FNonRecent and ABarItemControl.Parent.IsTransparent; +end; + +class function TdxBarPainter.IsItemTextSelectedInverted: Boolean; +begin + Result := True; +end; + +class function TdxBarPainter.LoweredBorderSize(ABarItemControl: TdxBarItemControl): Integer; +begin + Result := 0; +end; + +class function TdxBarPainter.TextAreaOffset(ABarItemControl: TdxBarItemControl): Integer; +begin + if ABarItemControl.Parent.Kind = bkSubMenu then + Result := ABarItemControl.Parent.TextSize + 1 + else + Result := 0; +end; + +function TdxBarPainter.BarFingersSize(ABar: TdxBar): Integer; +begin + if ABar.Control.CanMoving then + Result := FingersSize(ABar.Control) + else + Result := EmptyFingersSize; +end; + +function TdxBarPainter.BeforeFingersSize: Integer; +begin + // Required + Result := 0; +end; + +class function TdxBarPainter.BorderSizeX: Integer; +begin + Result := GetSystemMetrics(SM_CXFRAME); +end; + +class function TdxBarPainter.BorderSizeY: Integer; +begin + Result := GetSystemMetrics(SM_CYFRAME); +end; + +class function TdxBarPainter.EmptyFingersSize: Integer; +begin + Result := 0; +end; + +function TdxBarPainter.FingersSize(ABarControl: TdxBarControl): Integer; +begin + // Required + Result := 0; +end; + +function TdxBarPainter.GripperSize(ABarControl: TdxBarControl): Integer; +begin + Result := dxBarFingerSize; +end; + +class function TdxBarPainter.RealButtonArrowWidth(ABarManager: TdxBarManager): Integer; +begin + Result := (1 + Byte(ABarManager.LargeIcons)) * ABarManager.FButtonArrowWidth; + if not Odd(Result) then Inc(Result); +end; + +class function TdxBarPainter.RealLargeButtonArrowWidth(ABarManager: TdxBarManager): Integer; +begin + Result := ABarManager.FLargeButtonArrowWidth; +end; + +class function TdxBarPainter.SubMenuBeginGroupIndent: Integer; +begin + // Required + Result := 0; +end; + +procedure TdxBarPainter.DockControlFillBackground(ADockControl: TdxDockControl; + DC: HDC; ADestR, ASourceR, AWholeR: TRect; ABrush: HBRUSH; AColor: TColor); +begin + FillBackgroundRect(DC, ADestR, ASourceR, ABrush, AColor, nil); +end; + +class function TdxBarPainter.IsNativeBackground: Boolean; +begin + Result := False; +end; + +class function TdxBarPainter.BarChildrenHaveShadows(ABarControl: TCustomdxBarControl): Boolean; +begin + Result := False; +end; + +procedure TdxBarPainter.BarDrawDockedBackground(ABarControl: TdxBarControl; + DC: HDC; ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); +begin + BarFillParentBackground(ABarControl, DC, ADestR, ASourceR, ABrush, AColor); +end; + +class function TdxBarPainter.BarControlOwnerBrush(ABarManager: TdxBarManager): HBRUSH; +begin + Result := ABarManager.FlatToolbarsBrush; +end; + +class function TdxBarPainter.BarDockedGetRowIndent: Integer; +begin + Result := 0; +end; + +procedure TdxBarPainter.BarDrawFloatingBackground(ABarControl: TCustomdxBarControl; + DC: HDC; ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); +begin + FillBackgroundRect(DC, ADestR, ASourceR, ABrush, AColor, ABarControl.BarManager.Backgrounds.Bar); +end; + +class procedure TdxBarPainter.BarDrawOwnerLink(ABarControl: TCustomdxBarControl; DC: HDC); +begin + if not IsRectEmpty(ABarControl.OwnerLinkBounds[False]) then + FillRect(DC, ABarControl.OwnerLinkBounds[False], ABarControl.BarControlOwnerBrush); +end; + +procedure TdxBarPainter.BarFillParentBackground(ABarControl: TCustomdxBarControl; + DC: HDC; const ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); +var + ABounds: TRect; +begin + ABounds := ABarControl.BoundsRect; + ABarControl.DockControl.FillBackground(DC, ADestR, cxRectOffset(ASourceR, ABounds.Left, ABounds.Top), ABrush, AColor); +end; + +function TdxBarPainter.BarHasShadow(ABarControl: TCustomdxBarControl): Boolean; +begin + Result := IsButtonControlArrowFlat and (ABarControl.DockingStyle = dsNone); +end; + +function TdxBarPainter.BarLinkedOwnerHasShadow(ABarControl: TCustomdxBarControl): Boolean; +begin + Result := BarHasShadow(ABarControl); +end; + +class function TdxBarPainter.BarToolbarBrush(ABarControl: TCustomdxBarControl): HBRUSH; +begin + Result := GetSysColorBrush(COLOR_BTNFACE); +end; + +class function TdxBarPainter.BarToolbarBrushEx(ABarControl: TdxBarControl): HBRUSH; +begin + Result := BarToolbarBrush(ABarControl); +end; + +class function TdxBarPainter.BarToolbarDownedBrush(ABarControl: TCustomdxBarControl): HBRUSH; +begin + Result := PatternBrush; +end; + +class function TdxBarPainter.BarToolbarDownedSelBrush(ABarControl: TCustomdxBarControl): HBRUSH; +begin + Result := GetSysColorBrush(COLOR_BTNFACE); +end; + +class function TdxBarPainter.BarToolbarSelBrush(ABarControl: TCustomdxBarControl): HBRUSH; +begin + Result := GetSysColorBrush(COLOR_HIGHLIGHT); +end; + +function TdxBarPainter.ComboBoxArrowWidth(ABarControl: TCustomdxBarControl; cX: Integer): Integer; +begin + Result := 2 * cX - 1; +end; + +class function TdxBarPainter.EditTextSize(ABarControl: TCustomdxBarControl; cY: Integer): Integer; +var + ABorderOffsets, ATextOffsets: TRect; + ATextHeightCorrection: Integer; +begin + ABorderOffsets := EditControlBorderOffsets(ABarControl.GetPaintType); + GetEditTextParams(ATextOffsets, ATextHeightCorrection); + Result := ABorderOffsets.Top + ATextOffsets.Top + cY + ATextOffsets.Bottom + + ABorderOffsets.Bottom + ATextHeightCorrection; +end; + +class procedure TdxBarPainter.GetEditTextParams(out AOffsets: TRect; + out AHeightCorrection: Integer); +var + ACaptionOffsets: TRect; +begin + ACaptionOffsets := GetCaptionOffsets; + AOffsets := ACaptionOffsets; + GetEditTextVerticalOffsets(AOffsets.Top, AOffsets.Bottom); + AHeightCorrection := ACaptionOffsets.Top + ACaptionOffsets.Bottom - + (AOffsets.Top + AOffsets.Bottom); +end; + +class procedure TdxBarPainter.GetEditTextVerticalOffsets( + out ATop, ABottom: Integer); +begin + ATop := 2; + ABottom := 2; +end; + +class procedure TdxBarPainter.SetWindowRgn(AHandle: THandle; + const AWindowRect: TRect; ARedraw: Boolean = False); +begin +// do nothing +end; + +class function TdxBarPainter.BarAllowHotTrack: Boolean; +begin + Result := True; +end; + +class function TdxBarPainter.BarAllowQuickCustomizing: Boolean; +begin + Result := True; +end; + +function TdxBarPainter.BarBeginGroupSideSize: Integer; +begin + Result := (BarBeginGroupSize - (1 + 1){|}) div 2; +end; + +function TdxBarPainter.BarBeginGroupSize: Integer; +begin + Result := 2 + (1 + 1){|} + 2; +end; + +procedure TdxBarPainter.BarBorderPaintSizes(ABarControl: TdxBarControl; + var R: TRect); +begin + R := Rect(BarBorderSize, BarBorderSize, BarBorderSize, BarBorderSize); +end; + +class function TdxBarPainter.BarBorderSize: Integer; +begin + Result := 1; +end; + +procedure TdxBarPainter.BarBorderSizes(ABar: TdxBar; AStyle: TdxBarDockingStyle; + var R: TRect); +begin + R := Rect(2, 2, 2, 2); +end; + +class function TdxBarPainter.BarCaptionAreaSize: Integer; +begin + Result := BarCaptionSize + 1; +end; + +procedure TdxBarPainter.BarCaptionFillBackground(ABarControl: TdxBarControl; + DC: HDC; R: TRect; AToolbarBrush: HBRUSH); +begin + FillRect(DC, R, AToolbarBrush); +end; + +class function TdxBarPainter.BarCaptionSize: Integer; +var + NonClientMetrics: TNonClientMetrics; +begin + NonClientMetrics.cbSize := SizeOf(NonClientMetrics); + SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, @NonClientMetrics, 0); + Result := NonClientMetrics.iSmCaptionHeight; +end; + +class function TdxBarPainter.BarCaptionTransparent: Boolean; +begin + Result := False; +end; + +class function TdxBarPainter.BarCloseButtonSize: TSize; +begin + Result.cx := BarCaptionSize; + Result.cy := Result.cx; +end; + +procedure TdxBarPainter.BarDrawBackground(ABarControl: TdxBarControl; ADC: HDC; + const ADestRect, ASourceRect: TRect; ABrush: HBRUSH; AColor: TColor); +begin + // check background + if not ABarControl.GetBackgroundBitmap.Empty then + FillBackgroundRect(ADC, ADestRect, ASourceRect, ABrush, AColor, ABarControl.GetBackgroundBitmap) + else + begin + if ABarControl.Bar.IsStatusBar and ABarControl.BarManager.Backgrounds.Bar.Empty then + StatusBarFillBackground(ABarControl, ADC, ADestRect, ASourceRect, Rect(0, 0, ABarControl.Width, ABarControl.Height), ABrush, AColor) + else + begin + if ABarControl.Bar.Color = clDefault then + begin + if ABarControl.DockControl <> nil then + BarDrawDockedBackground(ABarControl, ADC, ADestRect, ASourceRect, ABrush, AColor) + else + BarDrawFloatingBackground(ABarControl, ADC, ADestRect, ASourceRect, ABrush, AColor) + end + else + FillRectByColor(ADC, ADestRect, ABarControl.Bar.Color); // TODO + end; + end; +end; + +procedure TdxBarPainter.BarDrawBeginGroup(ABarControl: TCustomdxBarControl; + DC: HDC; ABeginGroupRect: TRect; AToolbarBrush: HBRUSH; AHorz: Boolean); +begin + if AHorz then + begin + with ABeginGroupRect do + begin + ABarControl.FillBackground(DC, + Rect(Left, Top, Right, Top + BarBeginGroupSideSize), + AToolbarBrush, clNone, True); + ABarControl.FillBackground(DC, + Rect(Left, Bottom - BarBeginGroupSideSize, Right, Bottom), + AToolbarBrush, clNone, True); + end; + InflateRect(ABeginGroupRect, 0, -BarBeginGroupSideSize); + DrawEdge(DC, ABeginGroupRect, EDGE_ETCHED, BF_TOP) + end + else + begin + with ABeginGroupRect do + begin + ABarControl.FillBackground(DC, + Rect(Left, Top, Left + BarBeginGroupSideSize, Bottom), + AToolbarBrush, clNone, True); + ABarControl.FillBackground(DC, + Rect(Right - BarBeginGroupSideSize, Top, Right, Bottom), + AToolbarBrush, clNone, True); + end; + InflateRect(ABeginGroupRect, -BarBeginGroupSideSize, 0); + DrawEdge(DC, ABeginGroupRect, EDGE_ETCHED, BF_LEFT); + end; +end; + +class procedure TdxBarPainter.BarDrawCaptionElement(ABarControl: TdxBarControl; + DC: HDC; R: TRect; AState: TdxBarMarkState); +var + ABrush: HBRUSH; +begin + if AState <> msNone then + begin + FrameFlatSelRect(DC, R); + InflateRect(R, -1, -1); + if AState = msSelected then + ABrush := ABarControl.ToolbarSelBrush + else + ABrush := ABarControl.ToolbarDownedSelBrush; + FillRect(DC, R, ABrush); + end + else + FillRectByColor(DC, R, ABarControl.CaptionBkColor); +end; + +procedure TdxBarPainter.BarDrawCloseButton(ABarControl: TdxBarControl; + DC: HDC; R: TRect); +begin + // Required +end; + +procedure TdxBarPainter.BarDrawDockedBarBorder(ABarControl: TdxBarControl; + DC: HDC; R: TRect; AToolbarBrush: HBRUSH); +begin + // Required +end; + +procedure TdxBarPainter.BarDrawFloatingBarBorder(ABarControl: TdxBarControl; + DC: HDC; R, CR: TRect; AToolbarBrush: HBRUSH); +begin + // Required +end; + +procedure TdxBarPainter.BarDrawFloatingBarCaption(ABarControl: TdxBarControl; + DC: HDC; R, CR: TRect; AToolbarBrush: HBRUSH); +var + R1: TRect; + X: Integer; + ATransparent: Boolean; + + procedure DrawCaption; + var + S: string; + AFont: HFONT; + Size: TSize; + APrevBkMode: Integer; + AFlags: Integer; + begin + if R.Right - R.Left <= 0 then Exit; + S := ABarControl.GetCaption; + AFont := SelectObject(DC, CreateToolbarCaptionFontHandle(ABarControl.Font, ABarControl.BarManager.UseSystemFont)); +// SetTextColor(DC, GetSysColor(COLOR_CAPTIONTEXT)); + SetTextColor(DC, ABarControl.CaptionColor); + SetBkColor(DC, ABarControl.CaptionBkColor); + AFlags := ETO_CLIPPED; + if ATransparent then + APrevBkMode := SetBkMode(DC, TRANSPARENT) + else + begin + AFlags := AFlags or ETO_OPAQUE; + APrevBkMode := 0; // WARN OFF + end; + cxGetTextExtentPoint32(DC, S, Size); + cxExtTextOut(DC, S, Point(X, (R.Top + R.Bottom - Size.cy) div 2), R, AFlags); + if ATransparent then + SetBkMode(DC, APrevBkMode); + DeleteObject(SelectObject(DC, AFont)); + end; + +begin + R1 := R; + R1.Top := R.Bottom; + R1.Bottom := R1.Top + 1; + FillRect(DC, R1, AToolbarBrush); + + ATransparent := BarCaptionTransparent; + if ATransparent then + BarCaptionFillBackground(ABarControl, DC, R, AToolbarBrush); + if ABarControl.HasCloseButton then + begin + Dec(R.Right, BarCaptionSize); + ABarControl.DrawCloseButton(DC); + end; + X := R.Left; + if ABarControl.MarkExists then + BarOffsetFloatingBarCaption(ABarControl, X, R) + else + Inc(X, 2); + + DrawCaption; + if ABarControl.MarkExists then ABarControl.DrawMark(DC); +end; + +procedure TdxBarPainter.BarDrawMark(ABarControl: TdxBarControl; DC: HDC; MarkR: TRect); +begin + BarDrawMarkArrow(ABarControl, DC, MarkR); +end; + +procedure TdxBarPainter.BarDrawMarks(ABarControl: TdxBarControl; + ACanvas: TcxCanvas; const AItemRect: TRect; AToolbarBrush: HBRUSH); +begin + BarDrawMarkBackground(ABarControl, ACanvas.Handle, AItemRect, AToolbarBrush); + BarDrawMarkElements(ABarControl, ACanvas.Handle, AItemRect); +end; + +procedure TdxBarPainter.BarDrawMDIButton(ABarControl: TdxBarControl; + AButton: TdxBarMDIButton; AState: Integer; DC: HDC; R: TRect); +begin + // Required +end; + +procedure TdxBarPainter.BarDrawStatusBarGrip(ABarControl: TdxBarControl; + DC: HDC; const R: TRect; AToolbarBrush: HBRUSH); +var + AGripRect: TRect; + AGripBackgroundRect: TRect; +begin + AGripBackgroundRect := cxRectContent(R, StatusBarBorderOffsets); + AGripBackgroundRect.Left := AGripBackgroundRect.Right - StatusBarGripSize(ABarControl.BarManager).cx; + AGripRect := AGripBackgroundRect; + AGripRect.Top := AGripRect.Bottom - StatusBarGripSize(ABarControl.BarManager).cy; + ABarControl.FillBackground(DC, AGripBackgroundRect, AToolbarBrush, clNone, False); + BarDrawGrip(ABarControl, DC, AGripRect, AToolbarBrush); +end; + +procedure TdxBarPainter.BarDrawStatusBarBorder(ABarControl: TdxBarControl; DC: HDC; + R: TRect; AToolbarBrush: HBRUSH); +begin + R.Bottom := R.Top + StatusBarTopBorderSize; + ABarControl.FillBackground(DC, R, AToolbarBrush, clNone, False); +end; + +class function TdxBarPainter.BarHorSize: Integer; +begin + Result := 0; +end; + +function TdxBarPainter.BarMarkRect(ABarControl: TdxBarControl): TRect; +begin + Result := BarMarkItemRect(ABarControl); +end; + +function TdxBarPainter.BarMarkItemRect(ABarControl: TdxBarControl): TRect; +var + ACaptionRect: TRect; +begin + case ABarControl.DockingStyle of + dsTop, dsBottom: + with Result do + begin + Left := ABarControl.ClientWidth - ABarControl.MarkSize; + Top := 0; + Right := Left + ABarControl.MarkSize; + Bottom := ABarControl.ClientHeight; + end; + dsLeft, dsRight: + with Result do + begin + Left := 0; + Top := ABarControl.ClientHeight - ABarControl.MarkSize; + Right := ABarControl.ClientWidth; + Bottom := Top + ABarControl.MarkSize; + end; + else + Result := ABarControl.GetCaptionRect; + if ABarControl.DockingStyle = dsNone then + begin + ACaptionRect := Result; + Result.Left := Result.Right - cxRectHeight(Result); + if ABarControl.HasCloseButton then + OffsetRect(Result, -(cxRectWidth(ABarControl.CloseButtonRect) + FloatToolbarMarkIndent), 0); + Result.Left := Max(Result.Left, ACaptionRect.Left{ - 3}); + end; + end; +end; + +procedure TdxBarPainter.BarMarkRectInvalidate(ABarControl: TdxBarControl); +var + DC: HDC; +begin + if ABarControl.DockingStyle = dsNone then + begin + DC := GetWindowDC(ABarControl.Handle); + ABarControl.DrawMark(DC); + ReleaseDC(ABarControl.Handle, DC); + end + else + cxInvalidateRect(ABarControl.Handle, BarMarkItemRect(ABarControl), False); +end; + +class function TdxBarPainter.BarTopSize: Integer; +begin + Result := 0; +end; + +class function TdxBarPainter.BarBottomSize: Integer; +begin + Result := 0; +end; + +class function TdxBarPainter.BarUseSystemClose: Boolean; +begin + Result := False; +end; + +class function TdxBarPainter.BarUseSystemNCBorder: Boolean; +begin + Result := False; +end; + +function TdxBarPainter.MarkSizeX(ABarControl: TdxBarControl): Integer; +begin + Result := 11; +end; + +procedure TdxBarPainter.StatusBarFillBackground(ABarControl: TdxBarControl; DC: HDC; + ADestR, ASourceR, AWholeR: TRect; ABrush: HBRUSH; AColor: TColor); +begin + if IsNativeBackground and ABarControl.BarManager.FThemeAvailable then + TdxBarXPPainter.StatusBarFillNativeBackground(ABarControl, DC, ADestR, + ASourceR, AWholeR, ABrush, AColor) + else + FillBackgroundRect(DC, ADestR, ASourceR, ABrush, AColor, nil); +end; + +function TdxBarPainter.StatusBarBorderOffsets: TRect; +begin + Result := cxEmptyRect; +end; + +class function TdxBarPainter.StatusBarTopBorderSize: Integer; +begin + Result := 2; +end; + +function TdxBarPainter.StatusBarGripSize(ABarManager: TdxBarManager): TSize; +begin + if IsNativeBackground and ABarManager.FThemeAvailable then + Result := TdxBarXPPainter.StatusBarNativeGripSize(ABarManager) + else + Result := cxSize(GetSystemMetrics(SM_CXHSCROLL), GetSystemMetrics(SM_CYHSCROLL)); +end; + +class function TdxBarPainter.BarToolbarBrushEx2(ABarControl: TdxBarControl): HBRUSH; +begin + Result := BarToolbarBrushEx(ABarControl); +end; + +class procedure TdxBarPainter.DrawQuickCustItemFrame(ABarItemControl: TdxBarItemControl; + DC: HDC; var R, ARect: TRect; Selected: Boolean); +begin + with R do + Right := Left + Bottom - Top; + ARect.Left := R.Right; +end; + +class procedure TdxBarPainter.DrawQuickCustItemFrameSelected(ABarItemControl: TdxBarItemControl; + DC: HDC; WholeR, R: TRect; Selected: Boolean); +begin +end; + +class function TdxBarPainter.IsQuickControlPopupOnRight: Boolean; +begin + Result := False; +end; + +class function TdxBarPainter.GetTailAreaSize(const ADrawParams: TdxBarItemControlDrawParams): Integer; +begin + Result := ADrawParams.BarItemControl.Parent.IconAreaSize; +end; + +class function TdxBarPainter.ItemControlGetIndents(const ADrawParams: TdxBarItemControlDrawParams; + ADrawAreaType: TdxBarItemControlPart): TRect; +begin + Result := cxRect(3, 0, 3, 0); +end; + +function TdxBarPainter.ButtonControlArrowBrush(const ADrawParams: TdxBarItemControlDrawParams): HBRUSH; +begin + Result := ADrawParams.BarItemControl.BkBrush; +end; + +function TdxBarPainter.IsButtonControlArrowBackgroundOpaque(const ADrawParams: TdxBarButtonLikeControlDrawParams): Boolean; +begin + with ADrawParams do + Result := BarItemControl.FNonRecent or IsFlatItemText and (DroppedDown or DrawSelected); +end; + +function TdxBarPainter.IsButtonControlArrowDrawSelected(const ADrawParams: TdxBarButtonLikeControlDrawParams): Boolean; +begin + with ADrawParams do + Result := IsFlatItemText and + (IsHighContrastWhite and DrawSelected and + ((PaintType = ptMenu) or not DroppedDown) or ((PaintType = ptMenu) and DroppedDown)) or + not IsFlatItemText and IsButtonControlArrowFlat and DroppedDown; +end; + +function TdxBarPainter.IsButtonControlArrowFlat: Boolean; +begin + Result := IsFlatItemText; +end; + +function TdxBarPainter.IsDropDownRepaintNeeded: Boolean; +begin + Result := IsFlatItemText; +end; + +function TdxBarPainter.GetButtonBorderHeight: Integer; +begin + Result := dxBarButtonBorderHeight; +end; + +function TdxBarPainter.GetButtonBorderWidth: Integer; +begin + Result := dxBarButtonBorderWidth; +end; + +function TdxBarPainter.GetButtonHeight(AIconSize, ATextSize: Integer): Integer; +begin + Result := AIconSize + GetButtonBorderHeight; +end; + +function TdxBarPainter.GetButtonWidth(AIconSize, ATextSize: Integer): Integer; +begin + Result := AIconSize + GetButtonBorderWidth; +end; + +function TdxBarPainter.GetButtonSize(AIconSize, ATextSize: Integer): TSize; +begin + Result := Size(GetButtonWidth(AIconSize, ATextSize), GetButtonHeight(AIconSize, ATextSize)); +end; + +class procedure TdxBarPainter.CorrectButtonControlDefaultHeight(var DefaultHeight: Integer); +begin +end; + +class procedure TdxBarPainter.CorrectButtonControlDefaultWidth(var DefaultWidth: Integer); +begin +end; + +procedure TdxBarPainter.OffsetCaptionBounds(ADowned, ADrawDowned: Boolean; var R: TRect); +begin + if not IsFlatItemText then + begin + if ADowned or ADrawDowned then + OffsetRect(R, 1, 1); + if not IsButtonControlArrowFlat and ADowned and ADrawDowned then + OffsetRect(R, 1, 1); + end; +end; + +class procedure TdxBarPainter.OffsetEllipsisBounds(APressed: Boolean; var R: TRect); +begin + if not IsFlatItemText and APressed then + OffsetRect(R, 1, 1); +end; + +procedure TdxBarPainter.DrawButtonLikeControl( + const ADrawParams: TdxBarButtonLikeControlDrawParams; ARect: TRect); + + function GetFullBounds(const AFullRect: TRect): TRect; + begin + if ADrawParams.DroppedDownFlat then + Result := ARect + else + if ADrawParams.ViewSize = cvsLarge then + Result := AFullRect + else + Result := cxEmptyRect; + end; + +var + R, AFullRect, AImageBounds: TRect; + ATextAlignment: DWORD; +begin + with ADrawParams do + begin + if IsLowered then + DrawLowered(Canvas.Handle, ARect); + + if PaintType = ptMenu then + DrawGlyphAndTextInSubMenu(ADrawParams, ARect) + else + begin + R := ARect; + + if IsDropDown and SplitDropDown then + Dec(R.Right, cxRectWidth(BarItemControl.FParts[bcpDropButton])); + + if ViewSize = cvsLarge then + begin + AFullRect := R; + InflateRect(R, -1, -1); + OffsetCaptionBounds(Downed, DrawDowned, R); + end + else + AFullRect := ARect; + + DrawGlyph(BarItemControl, Canvas.Handle, R, GetFullBounds(AFullRect), AImageBounds, + PaintType, ViewStructure, ViewSize, not (cpIcon in ViewStructure), + DrawSelected, Downed, DrawDowned, DroppedDown, False, False, GrayScale, SplitDropDown and IsDropDown); + + if cpText in ViewStructure then + begin + CorrectCaptionParams(ADrawParams, R, AImageBounds, ATextAlignment); + DrawItemText(BarItemControl, Canvas.Handle, Caption, R, ATextAlignment, Enabled, IsTextSelected, PaintType = ptVert, False, IsFlatText); + end; + end; + + if IsDropDown and not IsMenuItem then + begin + if SplitDropDown then + DrawSplitControlArrow(ADrawParams, ARect) + else + DrawAssociateControlArrow(ADrawParams, ARect); + end; + end; +end; + +procedure TdxBarPainter.DrawButtonLikeControlCaption( + const ADrawParams: TdxBarButtonLikeControlDrawParams; const ARect, AImageBounds: TRect); +var + ATextAlignment: DWORD; + ATextBounds: TRect; +begin + if cpText in ADrawParams.ViewStructure then + begin + ATextBounds := ARect; + CorrectCaptionParams(ADrawParams, ATextBounds, AImageBounds, ATextAlignment); + ButtonLikeControlDoDrawCaption(ADrawParams, ATextBounds, ATextAlignment, DT_END_ELLIPSIS or DT_SINGLELINE); + end; +end; + +procedure TdxBarPainter.DrawButtonControlArrow(const ADrawParams: TdxBarButtonLikeControlDrawParams; + R1: TRect); +begin + with ADrawParams do + begin + if not IsButtonControlArrowFlat and DroppedDown and ((cxRectWidth(R1) > 9) or (PaintType = ptMenu)) then + OffsetRect(R1, 1, 1); + + if PaintType = ptMenu then + DrawLargeItemArrow(Canvas.Handle, R1, adRight, ArrowSize.cy, + IsButtonControlArrowDrawSelected(ADrawParams), Enabled and DropDownEnabled, IsButtonControlArrowFlat, GetItemArrowColor(ADrawParams)) + else + DrawItemArrow(Canvas.Handle, R1, adDown, Enabled and DropDownEnabled, + IsButtonControlArrowDrawSelected(ADrawParams), IsButtonControlArrowFlat, GetItemArrowColor(ADrawParams)); + end; +end; + +procedure TdxBarPainter.DrawButtonControlArrowBackground(const ADrawParams: TdxBarButtonLikeControlDrawParams; + var R1: TRect; ABrush: HBRUSH); +begin + with ADrawParams do + begin + if IsFlatItemText and (PaintType <> ptMenu) then + Dec(R1.Left); + if not IsFlatItemText or (PaintType = ptMenu) or not DroppedDown then + DrawBackground(BarItemControl, Canvas.Handle, R1, ABrush, IsButtonControlArrowBackgroundOpaque(ADrawParams)); + end; +end; + +procedure TdxBarPainter.DrawSplitControlArrow( + const ADrawParams: TdxBarButtonLikeControlDrawParams; ARect: TRect); +begin + ARect.Left := ARect.Right - ADrawParams.ArrowSize.cx; + DrawButtonControlArrowBackground(ADrawParams, ARect, ButtonControlArrowBrush(ADrawParams)); + DrawButtonControlArrow(ADrawParams, ARect); +end; + +procedure TdxBarPainter.DrawAssociateControlArrow( + const ADrawParams: TdxBarButtonLikeControlDrawParams; ARect: TRect); + + function IsArrowDrawSelected: Boolean; + begin + with ADrawParams do + Result := (PaintType = ptMenu) and DrawSelected and not IsFlatItemTextForMenu or + (PaintType <> ptMenu) and IsTextSelected; + end; + + function GetArrowRect(const ARect: TRect): TRect; + begin + Result := ARect; + with ADrawParams do + case PaintType of + ptVert: Result.Top := Result.Bottom - BarItemControl.Parent.TextSize div 2 + BarItemControl.Parent.Font.Height div 2; + ptHorz: Result.Left := Result.Right - BarItemControl.Parent.TextSize div 2 + BarItemControl.Parent.Font.Height div 2; + else{ptMenu} + Result.Left := Result.Right - BarItemControl.Parent.TextSize + ArrowSize.cy; + end; + end; + + function GetArrowSize: Integer; + begin + Result := ADrawParams.ArrowSize.cy; + if ADrawParams.PaintType <> ptMenu then + Dec(Result); + end; + +const + Direction: array[TdxBarPaintType] of TcxArrowDirection = (adDown, adRight, adRight); +begin + with ADrawParams do + begin + if PaintType <> ptMenu then + OffsetCaptionBounds(False, DroppedDown, ARect); + DrawLargeItemArrow(Canvas.Handle, GetArrowRect(ARect), Direction[PaintType], GetArrowSize, + IsArrowDrawSelected, Enabled, IsFlatItemText, GetItemArrowColor(ADrawParams)); + end; +end; + +function TdxBarPainter.ComboControlArrowColor(ADrawParams: TdxBarItemControlDrawParams): TColor; +begin + Result := clBtnText; +end; + +function TdxBarPainter.ComboControlButtonBrush(const ADrawParams: TdxBarItemControlDrawParams): HBRUSH; +begin + Result := ButtonControlArrowBrush(ADrawParams); +end; + +class function TdxBarPainter.ComboControlArrowOffset: Integer; +begin + Result := 1; +end; + +class function TdxBarPainter.ComboControlButtonOffsets(APaintType: TdxBarPaintType): TRect; +begin + Result := EditControlBorderOffsets(APaintType); +end; + +procedure TdxBarPainter.ComboControlDrawArrowButton( + const ADrawParams: TdxBarEditLikeControlDrawParams; ARect: TRect; + AInClientArea: Boolean); + + function GetArrowSize(const AArrowRect: TRect): Integer; + begin + Result := cxRectWidth(AArrowRect) div 4; + if not Odd(Result) then + Inc(Result); + end; + +begin + ComboControlDrawSimpleButton(ADrawParams, ARect, ComboControlButtonBrush(ADrawParams)); + ComboControlDrawArrow(ADrawParams, ARect, GetArrowSize(ARect), ComboControlArrowColor(ADrawParams)); +end; + +class procedure TdxBarPainter.ComboControlDrawSimpleButton(const ADrawParams: TdxBarEditLikeControlDrawParams; var ARect: TRect; ABrush: HBRUSH); +begin + // Required +end; + +class function TdxBarPainter.DropDownListBoxBorderSize: Integer; +begin + Result := 2; +end; + +procedure TdxBarPainter.DropDownListBoxDrawBorder(DC: HDC; AColor: TColor; ARect: TRect); +begin + FrameRect(DC, ARect, GetSysColorBrush(COLOR_BTNSHADOW)); + InflateRect(ARect, -1, -1); + FrameRectByColor(DC, ARect, AColor); +end; + +class function TdxBarPainter.SubMenuControlHasBand: Boolean; +begin + Result := False; +end; + +class function TdxBarPainter.SubMenuControlIsOffsetRecentGroupNeeded: Boolean; +begin + Result := False; +end; + +class function TdxBarPainter.SubMenuControlArrowsOffset: Integer; +begin + Result := 2; +end; + +class function TdxBarPainter.SubMenuControlArrowWidth(ATextSize: Integer): Integer; +begin + Result := ATextSize div 4 * 3 + 1; +end; + +function TdxBarPainter.SubMenuControlBeginGroupRect( + ABarSubMenuControl: TdxBarSubMenuControl; AControl: TdxBarItemControl; + const AItemRect: TRect): TRect; +begin + Result := AItemRect; + if AControl.FChangeRecentGroup and AControl.NonRecent then + Dec(Result.Top); + Result.Bottom := Result.Top; + Dec(Result.Top, ABarSubMenuControl.BeginGroupSize); +end; + +function TdxBarPainter.SubMenuControlBeginGroupSize: Integer; +begin + Result := 4 + 2 + 4; +end; + +class function TdxBarPainter.SubMenuControlBorderSize: Integer; +begin + Result := SubMenuControlNCBorderSize + SubMenuControlClientBorderSize; +end; + +class function TdxBarPainter.SubMenuControlNCBorderSize: Integer; +begin + Result := 1; +end; + +class function TdxBarPainter.SubMenuControlClientBorderSize: Integer; +begin + Result := 1; +end; + +procedure TdxBarPainter.SubMenuControlCalcDrawingConsts(ACanvas: TcxCanvas; + ATextSize: Integer; out AMenuArrowWidth, AMarkSize: Integer); +var + AArrowSize: Integer; +begin + AMenuArrowWidth := SubMenuControlArrowWidth(ATextSize); + AMarkSize := ACanvas.TextHeight('0') + 1; + AArrowSize := SubMenuControlMarkArrowSize(AMarkSize); + if Odd(AArrowSize) then AMarkSize := (AArrowSize - 1) * 2 + 2 * 3; +end; + +class function TdxBarPainter.SubMenuControlInternalBorderSize: Integer; +begin + Result := 0; +end; + +class function TdxBarPainter.SubMenuControlInternalBorderOffset: Integer; +begin + Result := 0; +end; + +class function TdxBarPainter.SubMenuControlContentRectOffset(ABarSubMenuControl: TdxBarSubMenuControl): TRect; +var + AOffset: Integer; +begin + AOffset := SubMenuControlClientBorderSize; + Result := Rect(AOffset, AOffset, AOffset, AOffset); +end; + +class function TdxBarPainter.SubMenuControlDetachCaptionAreaSize(ABarSubMenuControl: TdxBarSubMenuControl): Integer; +begin + Result := 2 + ABarSubMenuControl.DetachCaptionSize + 1; +end; + +procedure TdxBarPainter.SubMenuControlDrawScrollButton(ABarSubMenuControl: TdxBarSubMenuControl; ACanvas: TcxCanvas; AArrowDirection: TcxArrowDirection); +begin + // do nothing +end; + +procedure TdxBarPainter.SubMenuControlDrawBackground(ABarSubMenuControl: TdxBarSubMenuControl; + ACanvas: TcxCanvas; ARect: TRect; ABrush: HBRUSH; AColor: TColor); +begin + FillBackgroundRect(ACanvas.Handle, ARect, ARect, ABrush, AColor, ABarSubMenuControl.GetBackgroundBitmap); +end; + +procedure TdxBarPainter.SubMenuControlDrawBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); +begin + with R do + begin + FillRect(DC, Rect(Left, Top, Left + 1, Bottom - 1), COLOR_BTNFACE + 1); + FillRect(DC, Rect(Left + 1, Top, Right - 1, Top + 1), COLOR_BTNFACE + 1); + end; + DrawEdge(DC, R, BDR_RAISEDOUTER, BF_BOTTOMRIGHT); + if ABarSubMenuControl.Detachable then + begin + InflateRect(R, -1, -1); + DrawEdge(DC, R, BDR_RAISEDINNER, BF_RECT - BF_BOTTOM); + InflateRect(R, -1, -1); + R.Bottom := R.Top + ABarSubMenuControl.DetachCaptionAreaSize - 1; + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + SubMenuControlDrawDetachCaption(ABarSubMenuControl, DC, ABarSubMenuControl.DetachCaptionRect); + end; +end; + +procedure TdxBarPainter.SubMenuControlDrawClientBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; const R: TRect; ABrush: HBRUSH); +var + ARect: TRect; +begin + ARect := R; + if ABarSubMenuControl.Detachable then + ARect.Top := ARect.Top - 2; + DrawEdge(DC, ARect, BDR_RAISEDINNER, BF_RECT); + InflateRect(ARect, -1, -1); + FrameRect(DC, ARect, ABrush); +end; + +procedure TdxBarPainter.SubMenuControlDrawDetachCaption(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); +const + Colors: array[Boolean] of COLORREF = (COLOR_INACTIVECAPTION, COLOR_ACTIVECAPTION); +begin + FillRect(DC, R, Colors[ABarSubMenuControl.DetachCaptionSelected] + 1); +end; + +procedure TdxBarPainter.SubMenuControlDrawBeginGroup(ABarSubMenuControl: TdxBarSubMenuControl; + AControl: TdxBarItemControl; ACanvas: TcxCanvas; const ABeginGroupRect: TRect); +var + R: TRect; + ABrush: HBRUSH; + LD, RD: Integer; + AOpaque: Boolean; + ADC: HDC; +begin + ADC := ACanvas.Handle; + RD := Byte(AControl.FNonRecent); + R := ABeginGroupRect; + if AControl.FChangeRecentGroup and AControl.FNonRecent then + begin + RD := 0; + ABrush := ABarSubMenuControl.ToolbarBrush; + end + else + ABrush := ABarSubMenuControl.BkBrush; + LD := RD * Ord(ABarSubMenuControl.BarSize = 0); + AOpaque := AControl.FNonRecent and not AControl.FChangeRecentGroup; + DrawBackground(AControl, ADC, Rect(R.Left - LD, R.Top, R.Right + 2 * RD, R.Bottom), ABrush, AOpaque); + InflateRect(R, -SubMenuBeginGroupIndent, -4); + SubMenuControlDrawSeparator(ACanvas, R); +end; + +class procedure TdxBarPainter.SubMenuControlDrawItemFrame(ABarSubMenuControl: TdxBarSubMenuControl; + AControl: TdxBarItemControl; DC: HDC; AItemRect: TRect; AIndex: Integer); +begin +// do nothing +end; + +procedure TdxBarPainter.SubMenuControlDrawSeparator(ACanvas: TcxCanvas; const ARect: TRect); +var + R: TRect; +begin + R := ARect; + DrawEdge(ACanvas.Handle, R, EDGE_ETCHED, BF_TOP); +end; + +class function TdxBarPainter.SubMenuControlGetBandSize(ABarSubMenuControl: TdxBarSubMenuControl): Integer; +begin + Result := ABarSubMenuControl.IconAreaSize; +end; + +class function TdxBarPainter.SubMenuControlGetControlContentIndent(ABarSubMenuControl: TdxBarSubMenuControl): Integer; +begin + Result := ABarSubMenuControl.BarSize + ABarSubMenuControl.IconAreaSize; + CorrectButtonControlDefaultHeight(Result); +end; + +class function TdxBarPainter.SubMenuControlMarkArrowSize(AMarkSize: Integer): Integer; +begin + Result := (AMarkSize - 2 * (2 + 1)) div 2; +end; + +class function TdxBarPainter.SubMenuControlNormalItemHeight: Integer; +begin + Result := 19; +end; + +class procedure TdxBarPainter.SubMenuControlOffsetDetachCaptionRect(ABarSubMenuControl: TdxBarSubMenuControl; + var R: TRect); +begin + InflateRect(R, -3, -3); +end; + +class procedure TdxBarPainter.SubMenuControlPrepareBkBrush(ABarSubMenuControl: TdxBarSubMenuControl; + var ABkBrush: HBRUSH); +begin + if BarAllowHotTrack then + ABkBrush := SubMenuControlToolbarItemsBrush(ABarSubMenuControl); +end; + +class function TdxBarPainter.SubMenuControlTextSize(ACanvas: TcxCanvas): Integer; +begin + Result := GetDefaultTextSize(ACanvas); +end; + +class function TdxBarPainter.SubMenuControlToolbarItemsBrush(ABarSubMenuControl: TdxBarSubMenuControl): HBRUSH; +begin + Result := COLOR_BTNFACE + 1; +end; + +procedure TdxBarPainter.ApplicationMenuDrawBorder( + ABarSubMenuControl: TdxBarSubMenuControl; DC: HDC; const ARect: TRect); +begin + SubMenuControlDrawBorder(ABarSubMenuControl, DC, ARect); +end; + +procedure TdxBarPainter.ApplicationMenuDrawButton(const ADrawParams: TdxBarApplicationMenuButtonControlDrawParams; var R: TRect); +begin + // do nothing +end; + +procedure TdxBarPainter.ApplicationMenuDrawContentArea( + ABarSubMenuControl: TdxBarSubMenuControl; ACanvas: TcxCanvas; const AContentRect, AItemsArea: TRect); +begin + ACanvas.ExcludeClipRect(AItemsArea); + SubMenuControlDrawBackground(ABarSubMenuControl, ACanvas, AContentRect, ABarSubMenuControl.ToolbarDownedBrush, clNone); +end; + +function TdxBarPainter.ApplicationMenuGetFrameSizes: TRect; +begin + Result := cxNullRect; +end; + +procedure TdxBarPainter.ExtraMenuControlDrawBackground(AExtraMenuControl: TCustomdxBarControl; + ACanvas: TcxCanvas; ARect: TRect; ABrush: HBRUSH; AColor: TColor); +begin + FillBackgroundRect(ACanvas.Handle, ARect, ARect, ABrush, AColor, AExtraMenuControl.GetBackgroundBitmap); +// SubMenuControlDrawBackground(ABarSubMenuControl, ACanvas, ARect, ABrush, AColor); +end; + +procedure TdxBarPainter.ExtraMenuControlDrawBeginGroup(AExtraMenuControl: TCustomdxBarControl; + ACanvas: TcxCanvas; ABeginGroupRect: TRect; AToolbarBrush: HBRUSH; AHorz: Boolean); +begin + BarDrawBeginGroup(AExtraMenuControl, ACanvas.Handle, ABeginGroupRect, AToolbarBrush, AHorz); +end; + +class procedure TdxBarPainter.EditDrawInterior(ABarEditControl: TdxBarEditControl; + ABarEdit: TdxBarEdit; ACanvas: TCanvas; R: TRect; ItemLink: TdxBarItemLink); +var + ADC: HDC; + S: string; +begin + ADC := ACanvas.Handle; + FillRect(ADC, R, ACanvas.Brush.Handle); // draw only client area + EditOffsetInteriorRect(ABarEditControl, R); + if ABarEdit.FocusedItemLink = ItemLink then + S := ABarEdit.CurText + else + S := ABarEdit.Text; + SetBkMode(ADC, TRANSPARENT); + cxDrawText(ADC, S, R, DT_NOPREFIX); + SetBkMode(ADC, OPAQUE); +end; + +procedure TdxBarPainter.EditGetRealLookAndFeel(ABarManager: TdxBarManager; ALookAndFeel: TcxLookAndFeel); +begin + ABarManager.GetRealLookAndFeel(ALookAndFeel); +end; + +function TdxBarPainter.EditGetEnabledBkColor(ABarItemControl: TdxBarCustomEditControl): COLORREF; +begin + Result := GetSysColor(COLOR_WINDOW); +end; + +function TdxBarPainter.EditGetDisabledBkColor(ABarItemControl: TdxBarCustomEditControl): COLORREF; +begin + Result := cxGetBrushData(ABarItemControl.Parent.BkBrush).lbColor; +end; + +function TdxBarPainter.EditGetBkColor(const ADrawParams: TdxBarEditLikeControlDrawParams): COLORREF; +var + AEditViewParams: TcxViewParams; +begin + with ADrawParams do + if Enabled then + begin + BarEditControl.Item.GetEditViewParams(AEditViewParams); + Result := AEditViewParams.Color; + if Result = COLORREF(clDefault) then + Result := EditGetEnabledBkColor(BarEditControl); + end + else + Result := EditGetDisabledBkColor(BarEditControl); +end; + +function TdxBarPainter.EditGetEnabledTextColor: COLORREF; +begin + Result := GetSysColor(COLOR_WINDOWTEXT); +end; + +function TdxBarPainter.EditGetDisabledTextColor: COLORREF; +begin + Result := GetSysColor(COLOR_GRAYTEXT); +end; + +function TdxBarPainter.EditGetTextColor(ABarItemControl: TdxBarCustomEditControl): COLORREF; +var + AEditViewParams: TcxViewParams; +begin + if ABarItemControl.Enabled then + begin + ABarItemControl.Item.GetEditViewParams(AEditViewParams); + Result := AEditViewParams.TextColor; + if Result = COLORREF(clDefault) then + Result := EditGetEnabledTextColor; + end + else + Result := EditGetDisabledTextColor; +end; + +procedure TdxBarPainter.EditGetColors(ABarItemControl: TdxBarCustomEditControl; + var ATextColor, ABkColor: COLORREF); +begin + ATextColor := EditGetTextColor(ABarItemControl); + ABkColor := EditGetBkColor(ABarItemControl.DrawParams); +end; + +function TdxBarPainter.EditButtonAllowOffsetContent: Boolean; +begin + Result := True; +end; + +procedure TdxBarPainter.EditButtonDrawBackground(const ADrawParams: TdxBarEditLikeControlDrawParams; AState: Integer; + ARect: TRect; ABrush: HBrush); +begin +// do nothing +end; + +function TdxBarPainter.EditButtonAllowCompositeFrame: Boolean; +begin + Result := False; +end; + +class function TdxBarPainter.EditButtonAllowHotTrack(const ADrawParams: TdxBarItemControlDrawParams): Boolean; +begin + Result := ADrawParams.DrawSelected; +end; + +function TdxBarPainter.EditButtonIsCustomBorder: Boolean; +begin + Result := False; +end; + +function TdxBarPainter.EditButtonIsCustomBackground(AState: Integer): Boolean; +begin + Result := False; +end; + +procedure TdxBarPainter.EditButtonCorrectDefaultWidth(var ADefaultWidth: Integer); +begin + // do nothing +end; + +procedure TdxBarPainter.EditButtonDrawBorder( + const ADrawParams: TdxBarItemControlDrawParams; AState: Integer; var ADrawRect: TRect; out AContentRect: TRect); +begin + // do nothing +end; + +class procedure TdxBarPainter.CustomComboDrawItem(ABarCustomCombo: TdxBarCustomCombo; + ACanvas: TCanvas; AIndex: Integer; ARect: TRect; AState: TOwnerDrawState; AInteriorIsDrawing: Boolean); +var + S: string; +begin + with ACanvas, ARect do + begin + if AIndex = -1 then + S := ABarCustomCombo.Text + else + S := ABarCustomCombo.Items[AIndex]; + FillRect(ARect); + TextOut(Left + 2, Top, S); + end; +end; + +procedure TdxBarPainter.DrawEditLikeControl(const ADrawParams: TdxBarEditLikeControlDrawParams; ARect: TRect); +begin + with ADrawParams do + begin + EditControlDrawBackground(ADrawParams); + + if (PaintType = ptMenu) and DrawSelected then + EditControlDrawSelectionFrame(ADrawParams, ARect); + + BarEditControl.DrawFrame; + + if cpIcon in ViewStructure then + EditControlDrawGlyph(ADrawParams, BarEditControl.FParts[ecpIcon]); + + if cpText in ViewStructure then + EditControlDrawCaption(ADrawParams, BarEditControl.FParts[ecpText]); + + BarEditControl.DrawTextField; + end; +end; + +class function TdxBarPainter.EditControlBorderOffsets(APaintType: TdxBarPaintType): TRect; +begin + Result := Rect(2, 2, 2, 2); +end; + +procedure TdxBarPainter.EditControlDrawBackground(const ADrawParams: TdxBarEditLikeControlDrawParams); +var + AIndentRect, ATextRect: TRect; +begin + with ADrawParams do + begin + if (cpText in ViewStructure) or (PaintType = ptMenu) and SubMenuControlHasBand and not (cpIcon in ViewStructure) then + begin + ATextRect := BarEditControl.FParts[ecpText]; + AIndentRect := ATextRect; + + ATextRect.Right := ATextRect.Right - EditControlIndents(ADrawParams, cpText).Right; + AIndentRect.Left := ATextRect.Right; + + DrawBackground(BarEditControl, Canvas.Handle, ATextRect, + BarEditControl.CaptionBkBrush, EditControlCaptionBackgroundIsOpaque(ADrawParams)); + DrawBackground(BarEditControl, Canvas.Handle, AIndentRect, + EditControlGetRightCaptionIndentBrush(BarEditControl), EditControlCaptionRightIndentIsOpaque(ADrawParams)); + end; + + if (cpIcon in ViewStructure) and (PaintType <> ptMenu) then + DrawBackground(BarEditControl, Canvas.Handle, BarEditControl.FParts[ecpIcon], BarEditControl.CaptionBkBrush, + EditControlCaptionBackgroundIsOpaque(ADrawParams)); + end; +end; + +procedure TdxBarPainter.EditControlDrawBorder( + const ADrawParams: TdxBarEditLikeControlDrawParams; var ARect: TRect); +var + ABrush: HBRUSH; +begin + with ADrawParams do + begin + if DrawSelected then + DrawEdge(Canvas.Handle, ARect, BDR_SUNKENOUTER, BF_RECT) + else + DrawBackgroundFrameRect(BarEditControl, Canvas.Handle, ARect, + BarEditControl.Parent.BkBrush, BarEditControl.FNonRecent); + InflateRect(ARect, -1, -1); + if Enabled or IsTransparent then + ABrush := BarEditControl.Parent.BkBrush + else + ABrush := GetSysColorBrush(COLOR_BTNHIGHLIGHT); + DrawBackgroundFrameRect(BarEditControl, Canvas.Handle, ARect, ABrush, BarEditControl.FNonRecent or + (DrawSelected or not Enabled) and not IsTransparent); + InflateRect(ARect, -1, -1); + end; +end; + +procedure TdxBarPainter.EditControlDrawCaption(const ADrawParams: TdxBarEditLikeControlDrawParams; const ARect: TRect); +var + ATextRect: TRect; +begin + with ADrawParams do + begin + ATextRect := ARect; + ATextRect.Right := ATextRect.Right - EditControlIndents(ADrawParams, cpText).Right; + + DrawItemText(BarEditControl, Canvas.Handle, Caption, ATextRect, DT_RIGHT, Enabled, + DrawSelected and (PaintType = ptMenu), False, False, IsFlatItemTextForMenu); + + Canvas.SetClipRegion(TcxRegion.Create(ARect), roSubtract); + end; +end; + +procedure TdxBarPainter.EditControlDrawSelectionFrame(const ADrawParams: TdxBarEditLikeControlDrawParams; const ARect: TRect); +begin + FrameFlatSelRect(ADrawParams.Canvas.Handle, ARect); +end; + +procedure TdxBarPainter.EditControlDrawGlyph(const ADrawParams: TdxBarEditLikeControlDrawParams; ARect: TRect); +begin + with ADrawParams do + begin + if PaintType <> ptMenu then + begin + Inc(ARect.Left, EditControlIndents(ADrawParams, cpIcon).Left); + Dec(ARect.Right, EditControlIndents(ADrawParams, cpIcon).Right); + end; + + DrawGlyph(BarEditControl, Canvas.Handle, ARect, ARect, PaintType, False, + EditControlGlyphIsDrawSelected(BarEditControl), False, False, False, True, + False, False); + + Canvas.SetClipRegion(TcxRegion.Create(ARect), roSubtract); + end; +end; + +class function TdxBarPainter.EditControlCaptionBackgroundIsOpaque( + const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; +begin + with ADrawParams do + Result := (PaintType = ptMenu) and (DrawSelected or ADrawParams.BarItemControl.FNonRecent); +end; + +class function TdxBarPainter.EditControlCaptionRightIndentIsOpaque( + const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; +begin + with ADrawParams do + Result := (PaintType = ptMenu) and (ADrawParams.BarItemControl.FNonRecent); +end; + +procedure TdxBarPainter.EditControlDrawTextField(ABarEditControl: TdxBarEditControl; + ACanvas: TcxCanvas; const ARect: TRect); + + procedure SetColors(ATextColor, ABkColor: COLORREF); + begin + ACanvas.Font.Color := ATextColor; + ACanvas.Brush.Color := ABkColor; + ACanvas.Handle; // RequiredState(csAllValid) + end; + +var + ATextColor, ABkColor: COLORREF; +begin + EditGetColors(ABarEditControl, ATextColor, ABkColor); + SetColors(ATextColor, ABkColor); + + ACanvas.SaveClipRegion; + ACanvas.SetClipRegion(TcxRegion.Create(ARect), roIntersect); + try + ABarEditControl.Item.DrawInterior(ABarEditControl, ACanvas.Canvas, + ARect, ABarEditControl.ItemLink); + finally + ACanvas.RestoreClipRegion; + end; +end; + +class function TdxBarPainter.EditControlES_Style: Integer; +begin + Result := ES_AUTOHSCROLL or ES_MULTILINE; +end; + +function TdxBarPainter.EditControlGetContentRect(APaintType: TdxBarPaintType; const ARect: TRect): TRect; +begin + Result := cxRectContent(ARect, EditControlBorderOffsets(APaintType)); +end; + +class function TdxBarPainter.EditControlShowIconDefault(const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; +begin + Result := False; +end; + +class function TdxBarPainter.EditControlIndents( + const ADrawParams: TdxBarEditLikeControlDrawParams; ADrawAreaType: TdxBarItemControlPart): TRect; +begin + case ADrawAreaType of + cpText: + Result := Rect(EditControlCaptionLeftIndent(ADrawParams), 0, EditControlCaptionRightIndent, 0);//4 + else {cpIcon} + if ADrawParams.PaintType = ptMenu then + Result := EditControlSubMenuGlyphIndents(ADrawParams) //Result := Rect(2, 0, 2, 0) + else + Result := Rect((ADrawParams.DefaultButtonSize.cx - ADrawParams.BarItemControl.GetGlyphSize(ADrawParams.ViewSize).cx) div 2, 0, GetControlTextIndents.Left, 0); + end; +end; + +class function TdxBarPainter.EditControlCaptionLeftIndent( + const ADrawParams: TdxBarEditLikeControlDrawParams): Integer; +begin + if (cpIcon in ADrawParams.ViewStructure) then + if (ADrawParams.PaintType <> ptMenu) then + Result := 0 + else + Result := EditControlCaptionRelativeLeftIndent(ADrawParams) //In SubMenu + else + Result := EditControlCaptionAbsoluteLeftIndent(ADrawParams); +end; + +class function TdxBarPainter.EditControlCaptionRelativeLeftIndent( + const ADrawParams: TdxBarEditLikeControlDrawParams): Integer; +begin + Result := 2; +end; + +class function TdxBarPainter.EditControlCaptionAbsoluteLeftIndent( + const ADrawParams: TdxBarEditLikeControlDrawParams): Integer; +begin + Result := 2 +end; + +class function TdxBarPainter.EditControlCaptionRightIndent: Integer; +begin + Result := 4; +end; + +class function TdxBarPainter.EditControlSubMenuGlyphIndents( + const ADrawParams: TdxBarEditLikeControlDrawParams): TRect; +begin + Result := Rect(4, 0, 0, 0); +end; + +class function TdxBarPainter.EditControlGetRightCaptionIndentBrush( + ABarEditControl: TdxBarCustomEditControl): HBRUSH; +begin + Result := ABarEditControl.Parent.BkBrush; +end; + +class function TdxBarPainter.EditControlGlyphIsDrawSelected( + ABarEditControl: TdxBarCustomEditControl): Boolean; +begin + Result := False; +end; + +class procedure TdxBarPainter.EditControlPrepareEditWnd(ABarEditControl: TdxBarEditControl; + AHandle: HWND); +var + R: TRect; +begin + R := ABarEditControl.WindowRect; + OffsetRect(R, -R.Left, -R.Top); + EditOffsetInteriorRect(ABarEditControl, R); + SendMessage(AHandle, EM_SETRECTNP, 0, LPARAM(@R)); +end; + +class procedure TdxBarPainter.EditControlUpdateWndText(ABarEditControl: TdxBarEditControl; + AHandle: HWND; ANotEqual: Boolean); +begin + if ANotEqual then + SendMessage(AHandle, WM_COMMAND, MAKEWPARAM(0, EN_CHANGE), AHandle); + SendMessage(AHandle, EM_SETSEL, 0, -1); +end; + +function TdxBarPainter.ColorComboHasCompleteFrame: Boolean; +begin + Result := False; +end; + +function TdxBarPainter.IsCustomColorButtonVisible( + const ADrawParams: TdxBarColorComboControlDrawParams): Boolean; +begin + Result := cxRectWidth(ADrawParams.BarItemControl.FParts[clcpCustomColorButton]) <> 0; +end; + +procedure TdxBarPainter.ColorComboCorrectFrameRect( + const ADrawParams: TdxBarColorComboControlDrawParams; var ARect: TRect); +begin + if ColorComboHasCompleteFrame and IsCustomColorButtonVisible(ADrawParams) then + ARect.Right := ADrawParams.BarItemControl.FParts[clcpCustomColorButton].Right + GetCustomColorButtonIndents(ADrawParams.PaintType).Right; +end; + +function TdxBarPainter.GetCustomColorButtonIndents(APaintType: TdxBarPaintType): TRect; +begin + Result := Rect(1, 2, 1, 2); +end; + +procedure TdxBarPainter.ColorComboDrawCustomButton( + const ADrawParams: TdxBarColorComboControlDrawParams; ARect: TRect); +begin + with ADrawParams do + FrameAndFillRect(BarItemControl, Canvas.Handle, ARect, Enabled, DrawSelected, IsPressed); + DrawDots(ADrawParams, ARect); +end; + +procedure TdxBarPainter.ColorComboDrawCustomButtonAdjacentZone( + const ADrawParams: TdxBarColorComboControlDrawParams; ARect: TRect); +begin + with ADrawParams do + begin + DrawBackgroundFrameRect(BarItemControl, Canvas.Handle, ARect, BarItemControl.Parent.BkBrush, False); + InflateRect(ARect, 0, -1); + DrawBackgroundFrameRect(BarItemControl, Canvas.Handle, ARect, BarItemControl.Parent.BkBrush, False); + end; +end; + +class procedure TdxBarPainter.SysPanelCalcSize(AHandle: HWND; var ARect: TRect; + var Corner: TdxCorner; Combo: TdxBarItem; AllowResizing: Boolean); +var + R: TRect; + AControl: TdxBarWinControl; +begin + InflateRect(ARect, -1, -1); + if AllowResizing and + (Combo.CurItemLink <> nil) and (Combo.CurItemLink.Control <> nil) then + begin + GetWindowRect(AHandle, R); + AControl := TdxBarWinControl(Combo.CurItemLink.Control); + MapWindowRect(0, AControl.Parent.Handle, R); + Corner := GetCornerForRects(AControl.WindowRect, R); + with ARect do + if Corner in [coBottomLeft, coBottomRight] then + Dec(Bottom, SysPanelSize) + else + Inc(Top, SysPanelSize); + end; +end; + +class procedure TdxBarPainter.SysPanelDraw(AHandle: HWND; AllowResizing, + MouseAboveCloseButton, CloseButtonIsTracking: Boolean; var CloseButtonRect, + GripRect: TRect; Corner: TdxCorner); +begin + dxBarPopupNCPaint(AHandle, AllowResizing, False, MouseAboveCloseButton, + CloseButtonIsTracking, CloseButtonRect, GripRect, Corner); +end; + +class function TdxBarPainter.SysPanelSize: Integer; +begin + Result := dxDropDownNCHeight; +end; + +class function TdxBarPainter.IsDateNavigatorFlat: Boolean; +begin + Result := False; +end; + +procedure TdxBarPainter.DateNavigatorDrawButton(ABarItem: TdxBarItem; + DC: HDC; R: TRect; const ACaption: string; APressed: Boolean); +var + Offset: Integer; + APrevPen: HPEN; +begin + Offset := 0; + with R do + begin + if APressed then + begin + DrawFrameControl(DC, R, DFC_BUTTON, DFCS_BUTTONPUSH or DFCS_PUSHED); + Offset := 1; + end + else + begin + APrevPen := SelectObject(DC, CreatePen(PS_SOLID, 1, GetSysColor(COLOR_BTNTEXT))); + MoveToEx(DC, Left, Bottom - 1, nil); + LineTo(DC, Right - 1, Bottom - 1); + LineTo(DC, Right - 1, Top); + DeleteObject(SelectObject(DC, APrevPen)); + + APrevPen := SelectObject(DC, CreatePen(PS_SOLID, 1, GetSysColor(COLOR_BTNFACE))); + LineTo(DC, Left, Top); + LineTo(DC, Left, Bottom - 1); + DeleteObject(SelectObject(DC, APrevPen)); + + APrevPen := SelectObject(DC, CreatePen(PS_SOLID, 1, GetSysColor(COLOR_BTNSHADOW))); + MoveToEx(DC, Left + 1, Bottom - 2, nil); + LineTo(DC, Right - 2, Bottom - 2); + LineTo(DC, Right - 2, Top + 1); + DeleteObject(SelectObject(DC, APrevPen)); + + APrevPen := SelectObject(DC, CreatePen(PS_SOLID, 1, GetSysColor(COLOR_BTNHIGHLIGHT))); + MoveToEx(DC, Left + 1, Bottom - 3, nil); + LineTo(DC, Left + 1, Top + 1); + LineTo(DC, Right - 2, Top + 1); + DeleteObject(SelectObject(DC, APrevPen)); + + SetPixel(DC, Right - 2, Top + 1, GetSysColor(COLOR_BTNFACE)); + end; + InflateRect(R, -2, -2); + end; + // draw button's caption + DateNavigatorDrawButtonCaption(DC, R, Offset, ACaption, True); +end; + +function TdxBarPainter.DateNavigatorHeaderColor: TColor; +begin + Result := clBtnFace; +end; + +function TdxBarPainter.GetSpinEditArrowPos(const ADrawParams: TdxBarSpinEditDrawParams; ARect: TRect; AButtonIndex: Integer): TPoint; +begin + with ADrawParams do + begin + Result.X := ARect.Left + ArrowSize.cy; + ARect.Top := (ARect.Top + ARect.Bottom - ArrowSize.cy) div 2 + Byte(AButtonIndex = secButtonUp) * (ArrowSize.cy - 1); + Result.Y := ARect.Top; + end; +end; + +procedure TdxBarPainter.SpinEditCorrectFrameRect(const ADrawParams: TdxBarItemControlDrawParams; var ARect: TRect); +begin + ARect.Right := ADrawParams.BarItemControl.FParts[secButtonUp].Left - GetSpinEditButtonIndents(ADrawParams.PaintType).Left; +end; + +function TdxBarPainter.GetSpinEditArrowSize(AHeight: Integer): TSize; +begin + Result.cy := (AHeight div 2 - 2) div 2; + Result.cx := 2 * Result.cy - 1; +end; + +function TdxBarPainter.GetSpinEditButtonBounds(const ADrawParams: TdxBarSpinEditDrawParams; const ARect: TRect; AButton: TdxBarSpinEditButton): TRect; + + function IsButtonsWidthTooLarge(AButtonsWidth: Integer): Boolean; + begin + Result := AButtonsWidth >= cxRectWidth(ADrawParams.BarEditControl.GetEditRect) div 2; + end; + +begin + Result := ARect; + Result.Left := Result.Right - GetSpinEditButtonWidth(ADrawParams.PaintType, ARect) - GetSpinEditButtonIndents(ADrawParams.PaintType).Left - + GetSpinEditButtonIndents(ADrawParams.PaintType).Right; + + if IsButtonsWidthTooLarge(cxRectWidth(Result)) then + Result.Left := Result.Right + else + begin + Result := cxRectContent(Result, GetSpinEditButtonIndents(ADrawParams.PaintType)); + case AButton of + sbUp: Result.Bottom := (Result.Bottom + Result.Top) div 2; + sbDown: Result.Top := (Result.Bottom + Result.Top) div 2; + end; + end; +end; + +function TdxBarPainter.GetSpinEditButtonIndents(APaintType: TdxBarPaintType): TRect; +begin + Result := Rect(1, 0, 1, 0); +end; + +function TdxBarPainter.GetSpinEditButtonWidth(APaintType: TdxBarPaintType; const ARect: TRect): Integer; +var + AArrowSize: TSize; +begin + AArrowSize := GetSpinEditArrowSize(cxRectHeight(ARect)); + Result := AArrowSize.cx + 2 * (1 + 1 + AArrowSize.cy); + Result := Result - GetSpinEditButtonIndents(APaintType).Left - + GetSpinEditButtonIndents(APaintType).Right +end; + +function TdxBarPainter.GetSpinEditButtonState(const ADrawParams: TdxBarSpinEditDrawParams; AButtonIndex: Integer): TcxButtonState; +begin + with ADrawParams do + if not Enabled then + Result := cxbsDisabled + else + if AButtonIndex = ActiveButtonIndex then + Result := cxbsPressed + else + if AButtonIndex = HotPartIndex then + Result := cxbsHot + else + Result := cxbsNormal; +end; + +procedure TdxBarPainter.SpinEditControlDrawButton(const ADrawParams: TdxBarSpinEditDrawParams; ARect: TRect; AButtonIndex: Integer); + + procedure OffsetArrowPosIfActive(var AArrowPos: TPoint); + begin + if AButtonIndex = ADrawParams.ActiveButtonIndex then + AArrowPos := cxPointOffset(AArrowPos, 1, 1); + end; + +var + AArrowPos: TPoint; +begin + with ADrawParams do + begin + FrameAndFillRect(BarEditControl, Canvas.Handle, ARect, Enabled, DrawSelected, + ActiveButtonIndex = AButtonIndex); + AArrowPos := GetSpinEditArrowPos(ADrawParams, ARect, AButtonIndex); + OffsetArrowPosIfActive(AArrowPos); + DrawSpinEditArrow(ADrawParams, AArrowPos, AButtonIndex); + end; +end; + +procedure TdxBarPainter.SpinEditControlDrawButtonsAdjacentZone(const ADrawParams: TdxBarSpinEditDrawParams; const ARect: TRect); +begin + with ADrawParams do + DrawBackground(BarEditControl, Canvas.Handle, ARect, BarEditControl.Parent.BkBrush, False); +end; + +class function TdxBarPainter.ProgressControlBarBrushColor: TColorRef; +begin + Result := GetSysColor(COLOR_HIGHLIGHT); +end; + +function TdxBarPainter.ProgressControlBarHeight(ABarItemControl: TdxBarItemControl): Integer; +begin + Result := 12; +end; + +procedure TdxBarPainter.ProgressControlDrawBar(const ADrawParams: TdxbarProgressControlDrawParams; BarR: TRect; ABarBrushColor: TColorRef); +var + R: TRect; + Limit, Step: Integer; + ALeft, ARight: ^Integer; + ABarBrush: HBRUSH; +begin + with ADrawParams do + begin + R := BarR; + ProgressControlDrawBackground(ADrawParams, R); + with R do + if PaintType = ptVert then + begin + ALeft := @Top; + ARight := @Bottom; + end + else + begin + ALeft := @Left; + ARight := @Right; + end; + ARight^ := ALeft^ + MulDiv(ARight^ - ALeft^, Position - Min, Max - Min); + Limit := ARight^; + ABarBrush := CreateSolidBrush(ABarBrushColor); + if Smooth then + ProgressControlFillContent(ADrawParams, R, ABarBrush) + else + begin + with R do + if PaintType = ptVert then + Step := MulDiv(Right - Left, 2, 3) + else + Step := MulDiv(Bottom - Top, 2, 3); + repeat + ARight^ := ALeft^ + Step; + if ARight^ > Limit then ARight^ := Limit; + ProgressControlFillDiscreteContent(ADrawParams, R, ABarBrush); + ALeft^ := ARight^; + Inc(ARight^, 2); + if ARight^ > Limit then ARight^ := Limit; + ALeft^ := ARight^; + until ARight^ = Limit; + end; + if PaintType = ptVert then + BarR.Top := Limit + else + BarR.Left := Limit; + DeleteObject(ABarBrush); + end; +end; + +procedure TdxBarPainter.ProgressControlFillContent(const ADrawParams: TdxBarItemControlDrawParams; const R: TRect; ABarBrush: HBRUSH); +begin + FillRect(ADrawParams.Canvas.Handle, R, ABarBrush); +end; + +procedure TdxBarPainter.ProgressControlFillDiscreteContent(const ADrawParams: TdxBarItemControlDrawParams; const R: TRect; ABarBrush: HBRUSH); +begin + ProgressControlFillContent(ADrawParams, R, ABarBrush); +end; + +procedure TdxBarPainter.ProgressControlDrawBackground(const ADrawParams: TdxBarItemControlDrawParams; var BarR: TRect); +begin + with ADrawParams do + DrawBackground(BarItemControl, Canvas.Handle, BarR, BarItemControl.Parent.BkBrush, False); +end; + +class function TdxBarPainter.ProgressControlIndent(const ADrawParams: TdxBarItemControlDrawParams): Integer; +begin + Result := 0; +end; + +class function TdxBarPainter.ContainerControlSubMenuOffset: Integer; +begin + Result := 0; +end; + +class function TdxBarPainter.InPlaceSubItemControlBrush: HBRUSH; +begin + Result := GetSysColorBrush(COLOR_BTNSHADOW); +end; + +class function TdxBarPainter.InPlaceSubItemGetArrowWidth(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams): Integer; +begin + Result := ADrawParams.BarItemControl.SubMenuParent.TextSize; +end; + +class function TdxBarPainter.InPlaceSubItemGetTextIndent: Integer; +begin + Result := 5; +end; + +function TdxBarPainter.InPlaceSubItemControlIsFlatItemText(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams): Boolean; +begin + Result := ADrawParams.DrawSelected; +end; + +function TdxBarPainter.InPlaceSubItemControlIsArrowSelected(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams): Boolean; +begin + Result := True; +end; + +procedure TdxBarPainter.InPlaceSubItemControlDrawArrow(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams; + ADirection: TcxArrowDirection; ARect: TRect); +var + ASize: Integer; +begin + with ADrawParams do + begin + ASize := ArrowSize.cy; + ARect.Left := ARect.Right - ArrowSize.cx; + if not IsExpanded then + Inc(ARect.Left, ASize); + DrawLargeItemArrow(Canvas.Handle, ARect, ADirection, ASize, + InPlaceSubItemControlIsArrowSelected(ADrawParams), True, IsFlatItemText, GetItemArrowColor(ADrawParams)); + end; +end; + +procedure TdxBarPainter.InPlaceSubItemControlDrawBackground(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams; ARect: TRect); +const + InternalSeparatorSize = 1; +var + ABrush: HBRUSH; +begin + with ADrawParams do + begin + FillRect(Canvas.Handle, cxRectInflate(ARect, 0, cxRectHeight(ARect) - InternalSeparatorSize, 0, 0), BarItemControl.Parent.BkBrush); + + Dec(ARect.Bottom, InternalSeparatorSize); + + if DrawSelected then + ABrush := BarItemControl.Parent.ToolbarSelBrush + else + ABrush := InPlaceSubItemControlBrush; + + DrawBackground(BarItemControl, Canvas.Handle, ARect, ABrush, True{Opaque}); + + if DrawSelected then + FrameFlatSelRect(Canvas.Handle, ARect); + end; +end; + +procedure TdxBarPainter.InPlaceSubItemControlDrawInMenu(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams; ARect: TRect); +const + Arrows: array[Boolean] of TcxArrowDirection = (adRight, adDown); +begin + with ADrawParams do + begin + InPlaceSubItemControlDrawBackground(ADrawParams, ARect); + + Inc(ARect.Left, InPlaceSubItemGetTextIndent); + DrawItemText(BarItemControl, Canvas.Handle, Caption, + ARect, DT_LEFT, True, True, False, False, InPlaceSubItemControlIsFlatItemText(ADrawParams)); + + if Enabled then + InPlaceSubItemControlDrawArrow(ADrawParams, Arrows[IsExpanded], ARect); + end; +end; + +procedure TdxBarPainter.DrawStaticBackground(const ADrawParams: TdxBarStaticLikeControlDrawParams; ARect: TRect); +begin + with ADrawParams do + DrawBackground(BarItemControl, Canvas.Handle, ARect, BarItemControl.BkBrush, StaticBackgroundIsOpaque(ADrawParams)); +end; + +procedure TdxBarPainter.DrawStaticBorder(const ADrawParams: TdxBarStaticLikeControlDrawParams; var ARect: TRect); +const + Borders: array[TdxBarStaticBorderStyle] of Integer = + (0, BDR_SUNKENOUTER, BDR_RAISEDINNER, EDGE_ETCHED, 0); +begin + with ADrawParams do + begin + if BorderStyle = sbsNone then Exit; + if BorderStyle = sbsBump then + begin + DrawEdge(Canvas.Handle, ARect, BDR_RAISEDINNER, BF_RECT); + InflateRect(ARect, -1, -1); + DrawEdge(Canvas.Handle, ARect, BDR_SUNKENOUTER, BF_RECT); + InflateRect(ARect, -1, -1); + end + else + begin + DrawEdge(Canvas.Handle, ARect, Borders[BorderStyle], BF_RECT); + ARect := cxRectContent(ARect, BorderOffsets); + end; + end; +end; + +procedure TdxBarPainter.DrawStaticGlyphAndCaption(const ADrawParams: TdxBarStaticLikeControlDrawParams; const ARect: TRect); + + function IsGlyphCenter: Boolean; + begin + Result := ADrawParams.AllowCenter; + if ADrawParams.PaintType = ptMenu then + Result := Result and not (cpText in ADrawParams.ViewStructure); + end; + + function GetGlyphRect: TRect; + begin + Result := ARect; + with ADrawParams do + case PaintType of + ptMenu: + if not IsGlyphCenter then + Result := SubMenuControlGetItemIconRect(ARect, BarItemControl.Parent.IconAreaSize); + ptHorz: + if cpText in ViewStructure then + Result.Right := Result.Left + DefaultButtonSize.cx; + ptVert: + if cpText in ViewStructure then + Result.Bottom := Result.Top + DefaultButtonSize.cy; + end; + end; + + function IsTextCenter: Boolean; + begin + Result := ADrawParams.AllowCenter and (ADrawParams.Alignment = taCenter); + end; + + function GetTextIndent: Integer; + begin + Result := 0; + with ADrawParams do + if cpIcon in ViewStructure then + case PaintType of + ptHorz: Result := DefaultButtonSize.cx + 2; + ptVert: Result := DefaultButtonSize.cy + 2; + ptMenu: + if Alignment = taLeftJustify then + Result := SubMenuControlGetItemTextIndent(ADrawParams) + end + else + if not IsTextCenter then + Result := BarItemControl.Parent.TextSize div 4; + end; + + function GetTextRect: TRect; + var + ALeftJustify: Boolean; + begin + Result := ARect; + with ADrawParams do + begin + ALeftJustify := Alignment = taLeftJustify; + if PaintType in [ptMenu, ptHorz] then + if ALeftJustify or IsTextCenter then + Inc(Result.Left, GetTextIndent) + else + Dec(Result.Right, 2) + else + if ALeftJustify or IsTextCenter then + Inc(Result.Top, GetTextIndent) + else + Dec(Result.Bottom, 2); + end; + end; + +begin + with ADrawParams do + begin + DrawStaticBackground(ADrawParams, ARect); + if cpIcon in ViewStructure then + DrawGlyph(BarItemControl, Canvas.Handle, GetGlyphRect, cxEmptyRect, ptMenu, False, False, False, False, False, IsGlyphCenter, True, False); + + if cpText in ViewStructure then + DrawItemText(BarItemControl, Canvas.Handle, Caption, GetTextRect, SystemAlignmentsHorz[Alignment], Enabled, False, + PaintType = ptVert, True, False); + end; +end; + +procedure TdxBarPainter.DrawStaticLikeControl(const ADrawParams: TdxBarStaticLikeControlDrawParams; var ARect: TRect; const AIndentsRect: TRect); + + procedure DrawIndents; + + procedure DrawLeftIndent; + var + R: TRect; + begin + R := ARect; + if AIndentsRect.Left <> 0 then + begin + if ADrawParams.PaintType = ptVert then + begin + Inc(ARect.Top, AIndentsRect.Left); + R.Bottom := ARect.Top; + end + else + begin + Inc(ARect.Left, AIndentsRect.Left); + R.Right := ARect.Left; + end; + with ADrawParams do + DrawBackground(BarItemControl, Canvas.Handle, R, BarItemControl.Parent.BkBrush, False); + end; + end; + + procedure DrawRightIndent; + var + R: TRect; + begin + R := ARect; + if AIndentsRect.Right <> 0 then + begin + if ADrawParams.PaintType = ptVert then + begin + R.Bottom := ARect.Bottom; + Dec(ARect.Bottom, AIndentsRect.Right); + R.Top := ARect.Bottom; + end + else + begin + R.Right := ARect.Right; + Dec(ARect.Right, AIndentsRect.Right); + R.Left := ARect.Right; + end; + with ADrawParams do + DrawBackground(BarItemControl, Canvas.Handle, R, BarItemControl.Parent.BkBrush, False); + end; + end; + + begin + DrawLeftIndent; + DrawRightIndent; + end; + +begin + with ADrawParams do + begin + DrawIndents; + DrawStaticBorder(ADrawParams, ARect); + BarStaticControl.DrawInterior(ARect); + end; +end; + +class function TdxBarPainter.StaticBackgroundIsOpaque(const ADrawParams: TdxBarItemControlDrawParams): Boolean; +begin + Result := ADrawParams.BarItemControl.IsBkColorAssigned; +end; + +function TdxBarPainter.StaticControlGetBorderOffsets(AParent: TCustomdxBarControl; ABorderStyle: TdxBarStaticBorderStyle): TRect; +const + Widths: array[TdxBarStaticBorderStyle] of Integer = (0, 1, 1, 2, 2); +var + ABorderWidth: Integer; +begin + ABorderWidth := Widths[ABorderStyle]; + Result := Rect(ABorderWidth, ABorderWidth, ABorderWidth, ABorderWidth); +end; + +class function TdxBarPainter.SeparatorControlGetIndents(const ADrawParams: TdxBarSeparatorControlDrawParams; + ADrawAreaType: TdxBarItemControlPart): TRect; +begin + Result := cxRect(6, 0, 0, 0); +end; + +function TdxBarPainter.SubMenuGetSeparatorSize: Integer; +begin + Result := MenuSeparatorSize; +end; + +procedure TdxBarPainter.DrawSeparatorGlyphAndCaption(const ADrawParams: TdxBarSeparatorControlDrawParams; const ARect: TRect); +begin + DrawStaticGlyphAndCaption(ADrawParams, ARect); +end; + +procedure TdxBarPainter.DrawSeparatorControl(const ADrawParams: TdxBarSeparatorControlDrawParams; const ARect: TRect); +begin + with ADrawParams do + if cpText in ADrawParams.ViewStructure then + begin + DrawSeparatorGlyphAndCaption(ADrawParams, ARect); + if not IsTop then + SubMenuControlDrawSeparator(Canvas, cxRectSetTop(ARect, ARect.Top, SubMenuGetSeparatorSize)); + SubMenuControlDrawSeparator(Canvas, cxRectSetBottom(ARect, ARect.Bottom, SubMenuGetSeparatorSize)); + end + else + if PaintType = ptMenu then + SubMenuControlDrawBeginGroup(BarItemControl.SubMenuParent, BarItemControl, Canvas, ARect) + else + BarDrawBeginGroup(BarItemControl.Parent, Canvas.Handle, ARect, BarItemControl.Parent.ToolbarBrush, False); +end; + +function TdxBarPainter.ScreenTipGetDescriptionTextColor: TColor; +begin + Result := clDefault; +end; + +function TdxBarPainter.ScreenTipGetTitleTextColor: TColor; +begin + Result := clDefault; +end; + +function TdxBarPainter.ScreenTipGetFooterLineSize: Integer; +begin + Result := 3; +end; + +procedure TdxBarPainter.ScreenTipDrawBackground(ACanvas: TcxCanvas; ARect: TRect); +begin + // do nothing +end; + +procedure TdxBarPainter.ScreenTipDrawFooterLine(ACanvas: TcxCanvas; const ARect: TRect); +begin + // do nothing +end; + +class function TdxBarPainter.HasEditControlExternalFrame( + APaintType: TdxBarPaintType; ASelected: Boolean): Boolean; +begin + Result := False; +end; + +class function TdxBarPainter.IsCompoundPainting: Boolean; +begin + Result := False; +end; + +procedure TdxBarPainter.DrawToolbarContentPart( + ABarControl: TdxBarControl; ACanvas: TcxCanvas); +begin + with ABarControl do + FillBackground(Canvas.Handle, ClientRect, ToolbarBrush, clNone, True); +end; + +procedure TdxBarPainter.DrawToolbarNonContentPart( + ABarControl: TdxBarControl; DC: HDC); +begin +end; + +class function TdxBarPainter.GetDefaultArrowSignSize: TSize; +begin + Result := Size(5, 3); +end; + +function TdxBarPainter.GetToolbarCaptionRect(const ARect: TRect): TRect; +begin + Result := ARect; + InflateRect(Result, -BorderSizeX, -BorderSizeY); + Result.Bottom := Result.Top + BarCaptionSize; +end; + +function TdxBarPainter.AllowLargeIcons: Boolean; +begin + Result := True; +end; + +procedure TdxBarPainter.CorrectCaptionParams( + const ADrawParams: TdxBarButtonLikeControlDrawParams; + var ATextBounds: TRect; const AImageBounds: TRect; out ATextAlignment: DWORD); + + procedure OffsetTextBounds(var ATextBounds: TRect); + begin + if not IsMenuItem(ADrawParams.BarItemControl) then + OffsetCaptionBounds(ADrawParams.Downed, ADrawParams.DrawDowned, ATextBounds); + end; + +begin + if ADrawParams.ViewSize = cvsLarge then + begin + ATextAlignment := DT_CENTER; + case ADrawParams.BarItemControl.Item.GlyphLayout of + glLeft: + begin + ATextAlignment := DT_LEFT; + if ADrawParams.PaintType = ptHorz then + ATextBounds.Left := AImageBounds.Right + 3 + else + ATextBounds.Top := AImageBounds.Bottom + 3; + end; + glRight: + begin + ATextAlignment := DT_RIGHT; + if ADrawParams.PaintType = ptHorz then + ATextBounds.Right := AImageBounds.Left - 3 + else + ATextBounds.Bottom := AImageBounds.Top - 3; + end; + glTop: + if ADrawParams.PaintType = ptHorz then + ATextBounds.Top := AImageBounds.Bottom + else + ATextBounds.Right := AImageBounds.Left; + glBottom: + if ADrawParams.PaintType = ptHorz then + ATextBounds.Bottom := AImageBounds.Top + else + ATextBounds.Left := AImageBounds.Right; + end; + end + else + begin + ATextAlignment := DT_LEFT; + if cpIcon in ADrawParams.ViewStructure then + if ADrawParams.PaintType = ptHorz then + Inc(ATextBounds.Left, ADrawParams.DefaultButtonSize.cx) + else + Inc(ATextBounds.Top, ADrawParams.DefaultButtonSize.cy) + else + if ADrawParams.PaintType = ptHorz then + Inc(ATextBounds.Left, ADrawParams.BarItemControl.GetControlCaptionOffset) + else + Inc(ATextBounds.Top, ADrawParams.BarItemControl.GetControlCaptionOffset); + + OffsetTextBounds(ATextBounds); + end; +end; + +function TdxBarPainter.GetBorderSize: Integer; +begin + Result := 0; +end; + +function TdxBarPainter.GetIconAreaSize(ABarControl: TCustomdxBarControl): Integer; +const + AIconAreaOffset = 4; // ! +begin + case ABarControl.ItemLinks.ItemSize of + misNormal: Result := ABarControl.TextSize; + else //misLarge + Result := Round((DefautGlyphSize * 2 + AIconAreaOffset * 2) * ABarControl.Ratio); + end; + CorrectButtonControlDefaultHeight(Result); +end; + +procedure TdxBarPainter.DrawGlyphBorder(ABarItemControl: TdxBarItemControl; + DC: HDC; ABrush: HBRUSH; NeedBorder: Boolean; R: TRect; PaintType: TdxBarPaintType; + IsGlyphEmpty, Selected, Down, DrawDowned, ADroppedDown, IsSplit: Boolean); +begin + // Required +end; + +procedure TdxBarPainter.DrawGlyphCheckMark(ABarItemControl: TdxBarItemControl; + DC: HDC; X, Y, DoubleSize: Integer); +begin + // Required + // TODO: make default from Flat? +end; + +procedure TdxBarPainter.DrawGlyphEmptyImage(ABarItemControl: TdxBarItemControl; + DC: HDC; R: TRect; APaintType: TdxBarPaintType; ADown: Boolean); +var + ADoubleSize: Integer; +begin + if (APaintType = ptMenu) and ADown then + with R do + begin + ADoubleSize := 1 + Byte(ABarItemControl.Parent.Font.Size >= 16); + DrawGlyphCheckMark(ABarItemControl, DC, + (Left + Right - ADoubleSize * 9) div 2, + (Top + Bottom - ADoubleSize * 7) div 2, ADoubleSize); + end; +end; + +class procedure TdxBarPainter.DrawItemArrow(DC: HDC; R: TRect; + ArrowType: TcxArrowDirection; Enabled, Selected, Flat: Boolean; AColor: TColor = clDefault); +begin + dxBar.DrawItemArrow(DC, R, ArrowType, Enabled, Selected, Flat, AColor); +end; + +procedure TdxBarPainter.DrawLargeItemArrow(DC: HDC; R: TRect; + ArrowType: TcxArrowDirection; Size: Integer; Selected, Enabled, Flat: Boolean; AColor: TColor = clDefault); +begin + dxBar.DrawLargeItemArrow(DC, R, ArrowType, Size, Selected, Enabled, Flat, AColor); +end; + +class procedure TdxBarPainter.FrameFlatSelRect(DC: HDC; const R: TRect); +begin + // do nothing +end; + +procedure TdxBarPainter.GetImageParams(AItemControl: TdxBarItemControl; + const ADrawRect: TRect; APaintType: TdxBarPaintType; + AViewStructure: TdxBarItemControlViewStructure; + AViewSize: TdxBarItemControlViewSize; ACenter, ASelected, ADowned, ADrawDowned: Boolean; + var AGlyphEmpty: Boolean; out ACurrentGlyph: TBitmap; + out ACurrentImages: TCustomImageList; out ACurrentImageIndex: Integer; out AImageBounds: TRect); +var + AImageSize: TSize; +begin + AImageSize := AItemControl.GetGlyphSize(AViewSize, ASelected); + AGlyphEmpty := not AItemControl.GetCurrentImage(AViewSize, ASelected, ACurrentGlyph, ACurrentImages, ACurrentImageIndex) or AGlyphEmpty; + + if (AViewSize = cvsLarge) and (APaintType <> ptMenu) then + AImageBounds := GetLargeImageBounds(AItemControl, AImageSize, ADrawRect, APaintType, AViewStructure, AItemControl.Item.GlyphLayout) + else + AImageBounds := GetSmallImageBounds(AItemControl, AImageSize, ADrawRect, APaintType, AViewStructure, ACenter, AGlyphEmpty, AItemControl.BarManager.StretchGlyphs, ADowned, ADrawDowned); +end; + +function TdxBarPainter.GetLargeImageBounds(AItemControl: TdxBarItemControl; + const AImageSize: TSize; const ADrawRect: TRect; APaintType: TdxBarPaintType; + AViewStructure: TdxBarItemControlViewStructure; AGlyphLayout: TdxBarGlyphLayout): TRect; + + function GetImageOffset: TPoint; + begin + Result := cxRectCenter(ADrawRect, AImageSize).TopLeft; + if cpText in AViewStructure then + begin + case APaintType of + ptHorz: + case AGlyphLayout of + glLeft: + Result.X := ADrawRect.Left + 4; + glRight: + Result.X := ADrawRect.Right - 4 - AImageSize.cx; + glTop: + Result.Y := ADrawRect.Top + 2; + glBottom: + Result.Y := ADrawRect.Bottom - 2 - AImageSize.cy; + end; + ptVert: + case AGlyphLayout of + glLeft: + Result.Y := ADrawRect.Top + 4; + glRight: + Result.Y := ADrawRect.Bottom - 4 - AImageSize.cy; + glTop: + Result.X := ADrawRect.Right - 2 - AImageSize.cx; + glBottom: + Result.X := ADrawRect.Left + 2; + end; + end; + end; + end; + +var + AOffset: TPoint; +begin + AOffset := GetImageOffset; + Result := cxRectBounds(AOffset.X, AOffset.Y, AImageSize.cx, AImageSize.cy); +end; + +class function TdxBarPainter.GetSmallImageBounds(AItemControl: TdxBarItemControl; + const AImageSize: TSize; const ADrawRect: TRect; APaintType: TdxBarPaintType; + AViewStructure: TdxBarItemControlViewStructure; + ACenter, AGlyphEmpty, AStretchGlyph, ADowned, ADrawDowned: Boolean): TRect; + + procedure GetDimensions(out AWidth, AHeight: Integer); + begin + AWidth := cxRectWidth(ADrawRect); + AHeight := cxRectHeight(ADrawRect); + if not ACenter then + case APaintType of + ptHorz: AWidth := AItemControl.FDrawParams.DefaultButtonSize.cx; + ptVert: AHeight := AItemControl.FDrawParams.DefaultButtonSize.cy; + end; + end; + + procedure GetRealImageDimensions(AWidth, AHeight: Integer; out AImageWidth, AImageHeight: Integer); + var + ARatio: Double; + begin + AImageWidth := AImageSize.cx; + AImageHeight := AImageSize.cy; + if APaintType = ptMenu then + begin + if AStretchGlyph then + begin + ARatio := AItemControl.Parent.Ratio; + AImageWidth := Round(AImageWidth * ARatio); + AImageHeight := Round(AImageHeight * ARatio); + if Odd(AWidth - AImageWidth) and Odd(AHeight - AImageHeight) then + begin + Dec(AImageWidth); + Dec(AImageHeight); + end; + end + end + else + begin + if AItemControl.UseLargeIcons then + begin + if AItemControl.BarManager.IsLargeImagesForLargeIcons then + begin + AImageWidth := AItemControl.BarManager.LargeImages.Width; + AImageHeight := AItemControl.BarManager.LargeImages.Height; + end + else + if not AItemControl.BarManager.UseLargeImagesForLargeIcons or + not IsGlyphAssigned(AItemControl.LargeGlyph) then + begin + AImageWidth := 2 * AImageWidth; + AImageHeight := 2 * AImageHeight; + end; + end; + end; + end; + + function GetImageBounds(AWidth, AHeight, AImageWidth, AImageHeight: Integer): TRect; + begin + Result := Bounds( + ADrawRect.Left + (AWidth - AImageWidth) div 2, + ADrawRect.Top + (AHeight - AImageHeight) div 2, + AImageWidth, AImageHeight); + if ADowned then + OffsetRect(Result, GlyphDownShift(AItemControl), GlyphDownShift(AItemControl)); + if ADrawDowned then + OffsetRect(Result, GlyphDrawDownedShift(AItemControl, ADowned), GlyphDrawDownedShift(AItemControl, ADowned)); + end; + +var + AWidth, AHeight, AImageWidth, AImageHeight: Integer; +begin + Result := Rect(0, 0, AImageSize.cx, AImageSize.cy); + GetDimensions(AWidth, AHeight); + +//#DG SC-AS12012 if not AGlyphEmpty or ADowned then + begin + GetRealImageDimensions(AWidth, AHeight, AImageWidth, AImageHeight); + Result := GetImageBounds(AWidth, AHeight, AImageWidth, AImageHeight); + end; +end; + +function TdxBarPainter.GetDefaultEnabledTextColor( + ABarItemControl: TdxBarItemControl; ASelected, AFlat: Boolean): TColor; +begin + if ASelected and not AFlat then + Result := GetSysColor(COLOR_HIGHLIGHTTEXT) + else + Result := GetSysColor(COLOR_BTNTEXT); +end; + +procedure TdxBarPainter.GetDisabledTextColors( + ABarItemControl: TdxBarItemControl; ASelected, AFlat: Boolean; + var AColor1, AColor2: TColor); +begin + if ASelected or AFlat then + begin + AColor1 := GetSysColor(COLOR_GRAYTEXT); + AColor2 := AColor1; + end + else + begin + AColor1 := GetSysColor(COLOR_BTNHIGHLIGHT); + AColor2 := GetSysColor(COLOR_BTNSHADOW); + end; +end; + +function TdxBarPainter.GetEnabledTextColor( + ABarItemControl: TdxBarItemControl; ASelected, AFlat: Boolean): TColor; +begin + Result := GetDefaultEnabledTextColor(ABarItemControl, ASelected, AFlat); +end; + +function TdxBarPainter.GetItemArrowColor(const ADrawParams: TdxBarButtonLikeControlDrawParams): TColor; +begin + if UseTextColorForItemArrow then + with ADrawParams do + GetTextColors(BarItemControl, Enabled, IsTextSelected, IsFlatText, Result, Result) + else + Result := clDefault; +end; + +class function TdxBarPainter.GetFaded(ABarControl: TCustomdxBarControl): Boolean; +begin + Result := ABarControl.BarManager.MakeDisabledImagesFaded; +end; + +class function TdxBarPainter.IgnoreGlyphOpaque: Boolean; +begin + Result := False; +end; + +class function TdxBarPainter.IgnoreNonRecentColor: Boolean; +begin + Result := False; +end; + +class function TdxBarPainter.IsMenuItem(ABarItemControl: TdxBarItemControl): Boolean; +begin + Result := False; +end; + +class function TdxBarPainter.UseTextColorForItemArrow: Boolean; +begin + Result := False; +end; + +class function TdxBarPainter.GetBarItemContolHintPosition( + ABarControl: TCustomdxBarControl; const AItemBounds: TRect; + const ACursorPos: TPoint; AHeight: Integer): TPoint; +begin + Result := ACursorPos; + Inc(Result.Y, HintOffset); +end; + +function TdxBarPainter.CreateHintViewInfo(ABarManager: TdxBarManager; AHintText: string; const AShortCut: string; + AScreenTip: TdxBarScreenTip): TdxBarCustomHintViewInfo; +begin + Result := TdxBarHintViewInfo.Create(ABarManager, AHintText, AShortCut, GetMouseCursorPos); +end; + +class function TdxBarPainter.BarIsBarSmall(ABarControl: TdxBarControl; + const R: TRect): Boolean; +begin + with R do + Result := Bottom - Top <= 1 + 3 + 5 + 3 + 3 + 1; +end; + +class function TdxBarPainter.BarCaptionBkColor(ABarControl: TdxBarControl; + AMainFormActive: Boolean): COLORREF; +const + CaptionBkColors: array[Boolean] of Integer = + (COLOR_INACTIVECAPTION, COLOR_ACTIVECAPTION); +begin + Result := GetSysColor(CaptionBkColors[AMainFormActive]); +end; + +function TdxBarPainter.BarCaptionColor(ABarControl: TdxBarControl): COLORREF; +begin + Result := GetSysColor(COLOR_CAPTIONTEXT); +end; + +class function TdxBarPainter.BarMarkArrowColor(ABarControl: TdxBarControl; + AState: TdxBarMarkState): COLORREF; +begin + Result := GetSysColor(COLOR_CAPTIONTEXT); +end; + +procedure TdxBarPainter.BarDrawGrip(ABarControl: TdxBarControl; + DC: HDC; R: TRect; AToolbarBrush: HBRUSH); +begin + if IsNativeBackground and ABarControl.BarManager.FThemeAvailable then + TdxBarXPPainter.BarDrawNativeGrip(ABarControl, DC, R, AToolbarBrush) + else + // DrawFrameControl(DC, R, DFC_SCROLL, DFCS_SCROLLSIZEGRIP); + BarDrawSizeGrip(DC, R); +end; + +procedure TdxBarPainter.BarDrawMarkArrow(ABarControl: TdxBarControl; + DC: HDC; MarkR: TRect); +var + P: array[1..3] of TPoint; + AColor: COLORREF; +begin + with MarkR, P[1] do + begin + P[1] := Point((Left + Right - MarkSizeArrowX) div 2, + (Top + Bottom - MarkSizeArrowY) div 2 + (Top + Bottom - MarkSizeArrowY) mod 2); + P[2] := Point(X + MarkSizeArrowX - 1, Y); + P[3] := Point(X + MarkSizeArrowX div 2, Y + MarkSizeArrowY - 1); + end; + AColor := BarMarkArrowColor(ABarControl, ABarControl.MarkDrawState); + PolygonByColor(DC, P, AColor, AColor); +end; + +class procedure TdxBarPainter.BarDrawMarkAtPos(ABarControl: TdxBarControl; + DC: HDC; const ItemRect: TRect; Offset: Integer); +var + APen: HPEN; + X, Y: Integer; +begin + APen := SelectObject(DC, CreatePen(PS_SOLID, 1, GetSysColor(COLOR_BTNTEXT))); + if ABarControl.Horizontal then + begin + X := Offset; + Y := 4 - Byte(BarIsBarSmall(ABarControl, ItemRect)); + MoveToEx(DC, X, Y, nil); + LineTo(DC, X + 2, Y + 2); + LineTo(DC, X - 1, Y + 5); + MoveToEx(DC, X + 1, Y, nil); + LineTo(DC, X + 3, Y + 2); + LineTo(DC, X, Y + 5); + end + else + begin + X := ABarControl.ClientWidth - 8; + MoveToEx(DC, X, Offset, nil); + LineTo(DC, X + 2, Offset + 2); + LineTo(DC, X + 5, Offset - 1); + MoveToEx(DC, X, Offset + 1, nil); + LineTo(DC, X + 2, Offset + 3); + LineTo(DC, X + 5, Offset); + end; + ReverseGDIObject(DC, APen); +end; + +procedure TdxBarPainter.BarDrawMarkBackground(ABarControl: TdxBarControl; + DC: HDC; ItemRect: TRect; AToolbarBrush: HBRUSH); +begin + // Required +end; + +procedure TdxBarPainter.BarDrawMarkElements(ABarControl: TdxBarControl; + DC: HDC; ItemRect: TRect); + + procedure DrawArrow(X, Y: Integer; Vertical: Boolean); + var + P: array[1..3] of TPoint; + AColor: COLORREF; + begin + if Vertical then + begin + P[1] := Point(X, Y); + P[2] := Point(X, Y + 4); + P[3] := Point(X - 2, Y + 2); + end + else + begin + P[1] := Point(X, Y); + P[2] := Point(X + 4, Y); + P[3] := Point(X + 2, Y + 2); + end; + AColor := GetSysColor(GetDrawMarkElementColor(ABarControl)); + PolygonByColor(DC, P, AColor, AColor); + end; + +begin + with ItemRect do + begin + if BarAllowQuickCustomizing then + if ABarControl.Horizontal then + DrawArrow(Left + 3, Bottom - 7 + Byte(BarIsBarSmall(ABarControl, ItemRect)), False) + else + DrawArrow(Left + 5, Top + 3, True); + + if ABarControl.FTruncated then + if ABarControl.Horizontal then + begin + BarDrawMarkAtPos(ABarControl, DC, ItemRect, Left + 2); + BarDrawMarkAtPos(ABarControl, DC, ItemRect, Left + 6); + end + else + begin + BarDrawMarkAtPos(ABarControl, DC, ItemRect, Top + 2); + BarDrawMarkAtPos(ABarControl, DC, ItemRect, Top + 6); + end; + end; +end; + +class procedure TdxBarPainter.BarOffsetFloatingBarCaption(ABarControl: TdxBarControl; + var X: Integer; var R: TRect); +begin + X := ABarControl.MarkNCRect.Right + 3 * FloatToolbarMarkIndent; +end; + +class function TdxBarPainter.GetDrawMarkElementColor(ABarControl: TdxBarControl): Integer; +begin + Result := COLOR_BTNTEXT; +end; + +procedure TdxBarPainter.ButtonLikeControlDoDrawCaption(const ADrawParams: TdxBarButtonLikeControlDrawParams; + const ATextBounds: TRect; ATextAlignment, AFormat: DWORD); +begin + with ADrawParams do + DrawItemText(BarItemControl, Canvas.Handle, Caption, ATextBounds, + ATextAlignment, Enabled, IsTextSelected, PaintType = ptVert, False, IsFlatText, AFormat); +end; + +class function TdxBarPainter.GetControlTextIndents: TRect; +begin + Result := Rect(4, 0, 0, 0); +end; + +class function TdxBarPainter.GetControlCaptionRect(const ADrawParams: TdxBarItemControlDrawParams): TRect; +begin + Result := cxGetTextRect(ADrawParams.Canvas.Handle, ADrawParams.Caption, 1); +end; + +procedure TdxBarPainter.InflateSizeForArrow(const ADrawParams: TdxBarButtonLikeControlDrawParams; var ASize: Integer); +begin + if ADrawParams.SplitDropDown then + begin + if (ADrawParams.PaintType <> ptMenu) and ADrawParams.IsDropDown then + Inc(ASize, GetControlTextIndents.Right + ADrawParams.ArrowSize.cx); + end + else + if not ADrawParams.IsMenuItem then + Inc(ASize, ADrawParams.BarItemControl.Parent.TextSize div 2); +end; + +function TdxBarPainter.GetDotSpaceAfter(ADotWidth: Integer): Integer; +begin + Result := ADotWidth; +end; + +function TdxBarPainter.GetCustomColorButtonBounds(const ADrawParams: TdxBarColorComboControlDrawParams; ARect: TRect): TRect; + + function IsCustomButtonTooLarge(AButtonWidth: Integer): Boolean; + begin + Result := AButtonWidth >= (cxRectWidth(ADrawParams.BarEditControl.GetEditRect) div 2); + end; + +begin + Result := ARect; + Result.Left := Result.Right - GetCustomColorButtonWidth(ADrawParams.PaintType, ARect) - GetCustomColorButtonIndents(ADrawParams.PaintType).Left - + GetCustomColorButtonIndents(ADrawParams.PaintType).Right; + if IsCustomButtonTooLarge(cxRectWidth(Result)) or not ADrawParams.IsShowCustomColorButton then + Result.Left := Result.Right + else + Result := cxRectContent(Result, GetCustomColorButtonIndents(ADrawParams.PaintType)); +end; + +function TdxBarPainter.GetCustomColorButtonWidth(APaintType: TdxBarPaintType; const ARect: TRect): Integer; +begin + Result := (cxRectHeight(ARect) - 2 - 2) div 7 * 7 + 2 + 2 - GetCustomColorButtonIndents(APaintType).Left - GetCustomColorButtonIndents(APaintType).Right; +end; + +procedure TdxBarPainter.DrawDot(const ADrawParams: TdxBarEditLikeControlDrawParams; ARect: TRect); +begin + if ADrawParams.Enabled then + if IsHighContrastWhite and ADrawParams.DrawSelected then + FillRect(ADrawParams.Canvas.Handle, ARect, COLOR_BTNFACE + 1) + else + FillRect(ADrawParams.Canvas.Handle, ARect, COLOR_BTNTEXT + 1) + else + DrawDisabledShadowRect(ADrawParams.BarItemControl, ADrawParams.Canvas.Handle, ARect); +end; + +procedure TdxBarPainter.DrawDots(const ADrawParams: TdxBarEditLikeControlDrawParams; ARect: TRect); + + procedure CalculateFirstDotBounds(ADotWidth: Integer; var ARect: TRect); + var + ALeftIndent, ASpaceAfter: Integer; + begin + ALeftIndent := (cxRectWidth(ARect) - ADotWidth * 5) div 2; + ARect.Right := ARect.Left + ADotWidth; + ARect.Top := ARect.Bottom - ADotWidth; + ASpaceAfter := GetDotSpaceAfter(ADotWidth); + OffsetRect(ARect, ALeftIndent, - ASpaceAfter); + end; + +const + DotsCount = 3; +var + ADotWidth, I: Integer; +begin + with ADrawParams do + begin + ADotWidth := (ARect.Right - ARect.Left) div 7; + CalculateFirstDotBounds(ADotWidth, ARect); + OffsetEllipsisBounds(IsPressed, ARect); + for I := 0 to DotsCount - 1 do + begin + DrawDot(ADrawParams, ARect); + OffsetRect(ARect, ADotWidth * 2, 0); + end; + end; +end; + +class procedure TdxBarPainter.ComboControlDrawArrow(const ADrawParams: TdxBarEditLikeControlDrawParams; + const ARect: TRect; ASize: Integer; AColor: TColor); +begin + if not IsFlatItemText and not ADrawParams.Enabled then + AColor := clDefault; + dxBar.DrawLargeItemArrow(ADrawParams.Canvas.Handle, ARect, True, ASize, False, ADrawParams.Enabled, IsFlatItemText, AColor); +end; + +procedure TdxBarPainter.SubMenuControlFillScrollArrow(ACanvas: TcxCanvas; ARect: TRect; AColor: TColor); +begin + FillRectByColor(ACanvas.Handle, ARect, AColor); +end; + +procedure TdxBarPainter.SubMenuControlDrawScrollArrow(ABarSubMenuControl: TdxBarSubMenuControl; ACanvas: TcxCanvas; + const AArrowRect: TRect; AColor: COLORREF; AArrowDirection: TcxArrowDirection); +var + P: TcxArrowPoints; +begin + CalculateArrowPoints(AArrowRect, SubMenuControlGetScrollArrowSize(ABarSubMenuControl.TextSize), AArrowDirection, P); + ACanvas.SaveClipRegion; + try + SetArrowRegion(ACanvas, AArrowDirection, P, roSet); + SubMenuControlFillScrollArrow(ACanvas, GetArrowRectByPoints(P, AArrowDirection), AColor); + finally + ACanvas.RestoreClipRegion; + end; + SetArrowRegion(ACanvas, AArrowDirection, P, roSubtract); +end; + +procedure TdxBarPainter.SubMenuControlDrawScrollBand(ABarSubMenuControl: TdxBarSubMenuControl; ACanvas: TcxCanvas; AArrowDirection: TcxArrowDirection); +begin + SubMenuControlDrawScrollArrow(ABarSubMenuControl, ACanvas, SubMenuControlGetScrollBandBounds(ABarSubMenuControl, AArrowDirection), + GetSysColor(COLOR_BTNTEXT), AArrowDirection); + SubMenuControlDrawScrollButton(ABarSubMenuControl, ACanvas, AArrowDirection); + SubMenuControlDrawNonRecentGroupSeparator(ABarSubMenuControl, ACanvas, AArrowDirection); + SubMenuControlDrawScrollBandBackground(ABarSubMenuControl, ACanvas, AArrowDirection); +end; + +procedure TdxBarPainter.SubMenuControlDrawScrollBandBackground(ABarSubMenuControl: TdxBarSubMenuControl; ACanvas: TcxCanvas; AArrowDirection: TcxArrowDirection); +var + AControl: TdxBarItemControl; +begin + case AArrowDirection of + adUp: + AControl := ABarSubMenuControl.TopItemControl; + else {adDown} + AControl := ABarSubMenuControl.BottomItemControl; + end; + DrawBackground(AControl, ACanvas.Handle, ABarSubMenuControl.GetItemRectEx(AControl, True), + ABarSubMenuControl.ToolbarItemsBrush, False); +end; + +procedure TdxBarPainter.SubMenuControlDrawNonRecentGroupSeparator(ABarSubMenuControl: TdxBarSubMenuControl; ACanvas: TcxCanvas; AArrowDirection: TcxArrowDirection); +const + BrushColors: array[Boolean] of COLORREF = (COLOR_BTNHIGHLIGHT, COLOR_BTNSHADOW); +var + R: TRect; +begin + with ABarSubMenuControl do + if (AArrowDirection = adDown) and BottomItemControl.FChangeRecentGroup then + begin + R := GetItemRectEx(BottomItemControl, True); + R := Rect(R.Left - 1, R.Top, R.Right + 1, R.Top + 1); + DrawBackground(BottomItemControl, ACanvas.Handle, R, + BrushColors[BottomItemControl.FNonRecent] + 1, False); + ACanvas.SetClipRegion(TcxRegion.Create(R), roSubtract); + end +end; + +function TdxBarPainter.SubMenuControlGetScrollBandBounds(ABarSubMenuControl: TdxBarSubMenuControl; AArrowDirection: TcxArrowDirection): TRect; +var + AScrollAreaSize: Integer; +begin + AScrollAreaSize := SubMenuControlGetScrollBandSize(ABarSubMenuControl); + Result := ABarSubMenuControl.FItemsRect; + if AArrowDirection = adUp then + Result.Bottom := Result.Top + AScrollAreaSize + else + Result.Top := Result.Bottom - AScrollAreaSize; +end; + +function TdxBarPainter.SubMenuControlGetScrollBandSize(ABarSubMenuControl: TdxBarSubMenuControl): Integer; +begin + Result := ABarSubMenuControl.TextSize; +end; + +class function TdxBarPainter.SubMenuControlGetScrollArrowSize(ATextSize: Integer): Integer; +begin + Result := ATextSize div 3 - 1 +end; + +procedure TdxBarPainter.SubMenuControlDrawMarkContent(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect; ASelected: Boolean); +var + APen: HPEN; + Size, X, Y, I: Integer; + + procedure DrawOneMark(const Y: Integer); + begin + MoveToEx(DC, X, Y, nil); + LineTo(DC, X + Size div 2, Y + Size div 2); + LineTo(DC, X + Size + 1, Y - 1); + end; + +var + AColor: COLORREF; +begin + Size := ABarSubMenuControl.MarkArrowSize; + if IsHighContrastWhite and IsFlatItemText and ASelected then + AColor := GetSysColor(COLOR_BTNFACE) + else + AColor := GetSysColor(COLOR_BTNTEXT); + APen := SelectObject(DC, CreatePen(PS_SOLID, 1, AColor)); + with R do + begin + X := (Left + Right - (Size + 1)) div 2; + Y := Top + (ABarSubMenuControl.MarkSize - 2 * Size) div 2; + for I := Y to Y + Size - 1 do + DrawOneMark(I + Byte(I >= Y + Size div 2) * Size div 2); + end; + ReverseGDIObject(DC, APen); +end; + +procedure TdxBarPainter.SubMenuControlDrawMarkBand( + ABarSubMenuControl: TdxBarSubMenuControl; const AMarkRect: TRect; ASelected: Boolean); + + procedure DrawMarkBackground(ABarSubMenuControl: TdxBarSubMenuControl; ADC: HDC; const AMarkRect: TRect); + begin + ABarSubMenuControl.FillBackground(ADC, AMarkRect, ABarSubMenuControl.ToolbarItemsBrush, clNone, True); + if ASelected then + SubMenuControlDrawMarkSelection(ABarSubMenuControl, ADC, AMarkRect); + end; + +var + ABitmap: TBitmap; +begin + ABitmap := cxCreateBitmap(AMarkRect); + try + BarCanvas.BeginPaint(ABitmap.Canvas); + try + BarCanvas.WindowOrg := AMarkRect.TopLeft; + DrawMarkBackground(ABarSubMenuControl, BarCanvas.Handle, AMarkRect); + SubMenuControlDrawMarkContent(ABarSubMenuControl, BarCanvas.Handle, AMarkRect, ASelected); + ABarSubMenuControl.Canvas.CopyRect(AMarkRect, BarCanvas.Canvas, AMarkRect); + finally + BarCanvas.EndPaint; + end; + finally + FreeAndNil(ABitmap); + end; + ABarSubMenuControl.Canvas.SetClipRegion(TcxRegion.Create(AMarkRect), roSubtract); +end; + +procedure TdxBarPainter.SubMenuControlDrawMarkSelection( + ABarSubMenuControl: TdxBarSubMenuControl; ADC: HDC; const AMarkRect: TRect); +var + R: TRect; +begin + R := AMarkRect; + DrawEdge(ADC, R, BDR_RAISEDINNER, BF_RECT); + ABarSubMenuControl.PreparePalette(ADC); + DrawBackground(ABarSubMenuControl.BottomItemControl, ADC, cxRectInflate(R, -1, -1), ABarSubMenuControl.FLightBrush, False); + ABarSubMenuControl.UnpreparePalette(ADC); +end; + +class function TdxBarPainter.SubMenuControlUseScrollButtons: Boolean; +begin + Result := False; +end; + +class procedure TdxBarPainter.EditOffsetInteriorRect(ABarEditControl: TdxBarCustomEditControl; var R: TRect); +var + AOffsets: TRect; + AHeightCorrection: Integer; +begin + GetEditTextParams(AOffsets, AHeightCorrection); + R := cxRectContent(R, AOffsets); +end; + +procedure TdxBarPainter.DrawSpinEditArrow(const ADrawParams: TdxBarSpinEditDrawParams; AArrowPos: TPoint; AButtonIndex: Integer); +begin + with ADrawParams do + begin + if Enabled then + SpinEditControlDrawArrowByPoints(ADrawParams, AArrowPos, COLOR_BTNTEXT, AButtonIndex) + else + begin + SpinEditControlDrawArrowByPoints(ADrawParams, Point(AArrowPos.X + 1, AArrowPos.Y + 1), COLOR_BTNHIGHLIGHT, AButtonIndex); + SpinEditControlDrawArrowByPoints(ADrawParams, AArrowPos, COLOR_BTNSHADOW, AButtonIndex); + end; + end; +end; + +class procedure TdxBarPainter.SpinEditControlDrawArrowByPoints(const ADrawParams: TdxBarSpinEditDrawParams; + AStartPoint: TPoint; AColorIndex: Integer; AButtonIndex: Integer); +var + P: array[1..3] of TPoint; + AColor: COLORREF; +begin + P[1] := Point(AStartPoint.X, AStartPoint.Y); + P[2] := Point(AStartPoint.X + ADrawParams.ArrowSize.cx - 1, AStartPoint.Y); + if AButtonIndex = secButtonUp then + P[3] := Point(AStartPoint.X + ADrawParams.ArrowSize.cx div 2, + AStartPoint.Y - ADrawParams.ArrowSize.cx div 2) + else + P[3] := Point(AStartPoint.X + ADrawParams.ArrowSize.cx div 2, + AStartPoint.Y + ADrawParams.ArrowSize.cx div 2); + + AColor := GetSysColor(AColorIndex); + PolygonByColor(ADrawParams.Canvas.Handle, P, AColor, AColor); +end; + +class procedure TdxBarPainter.DateNavigatorDrawButtonCaption(DC: HDC; const R: TRect; + AOffset: Integer; const ACaption: string; AOpaque: Boolean); +var + AFlags: Integer; + ASize: TSize; + APrevBkMode: Integer; +begin + cxGetTextExtentPoint32(DC, ACaption, ASize); + SetTextColor(DC, GetSysColor(COLOR_BTNTEXT)); + SetBkColor(DC, GetSysColor(COLOR_BTNFACE)); + AFlags := ETO_CLIPPED; + APrevBkMode := GetBkMode(DC); + if AOpaque then + AFlags := AFlags or ETO_OPAQUE + else + SetBkMode(DC, TRANSPARENT); + cxExtTextOut(DC, ACaption, cxPointOffset(cxRectCenter(R, ASize).TopLeft, AOffset, AOffset), R, AFlags); + SetBkMode(DC, APrevBkMode); +end; + +procedure TdxBarPainter.InternalCalculateComboParts( + const ADrawParams: TdxBarEditLikeControlDrawParams; var AParts: array of TRect); +begin + AParts[ccpDropButton].Left := AParts[ccpDropButton].Right - ADrawParams.BarItemControl.Parent.ComboBoxArrowWidth; + AParts[ecpEdit].Right := AParts[ccpDropButton].Left - ComboControlArrowOffset; +end; + +{ TdxBarStandardPainter } + +class procedure TdxBarStandardPainter.DrawDisabledShadowRect(ABarItemControl: TdxBarItemControl; + DC: HDC; R: TRect); +begin + OffsetRect(R, 1, 1); + FillRect(DC, R, COLOR_BTNHIGHLIGHT + 1); + OffsetRect(R, -1, -1); + inherited DrawDisabledShadowRect(ABarItemControl, DC, R); +end; + +procedure TdxBarStandardPainter.DrawItemBackgroundInSubMenu(const ADrawParams: TdxBarButtonLikeControlDrawParams; R: TRect); +var + AIconRect: TRect; + AIsGlyphEmpty, AOpaque: Boolean; + Brush: HBRUSH; + ADC: HDC; +begin + with ADrawParams do + begin + AIconRect := SubMenuControlGetItemIconRect(R, BarItemControl.Parent.IconAreaSize); + AIsGlyphEmpty := not BarItemControl.HasIcon(ViewSize, ViewStructure); + ADC := Canvas.Handle; + + if DrawSelected and AIsGlyphEmpty and not Downed then + Brush := BarItemControl.Parent.ToolbarSelBrush + else + Brush := BarItemControl.BkBrush; + + R.Left := AIconRect.Right + 1; + + AOpaque := DrawSelected or BarItemControl.FNonRecent; + DrawBackground(BarItemControl, ADC, Rect(AIconRect.Right, AIconRect.Top, R.Left, AIconRect.Bottom), Brush, AOpaque); + if AIconRect.Top > R.Top then + DrawBackground(BarItemControl, ADC, Rect(AIconRect.Left, R.Top, R.Left, AIconRect.Top), Brush, AOpaque); + if AIconRect.Bottom < R.Bottom then + DrawBackground(BarItemControl, ADC, Rect(AIconRect.Left, AIconRect.Bottom, R.Left, R.Bottom), Brush, AOpaque); + + if DrawSelected then + Brush := BarItemControl.Parent.ToolbarSelBrush + else + Brush := BarItemControl.BkBrush; + DrawBackground(BarItemControl, ADC, R, Brush, AOpaque); + end; +end; + +class procedure TdxBarStandardPainter.FrameAndFillRect(ABarItemControl: TdxBarItemControl; + DC: HDC; var R: TRect; Enabled, Selected, Pressed: Boolean); +const + Borders: array[Boolean] of Integer = (BDR_RAISEDINNER, BDR_SUNKENOUTER); +var + Brush: HBRUSH; +begin + Brush := ABarItemControl.Parent.BkBrush; + if Selected then + DrawEdge(DC, R, Borders[Pressed], BF_RECT) + else + FrameRect(DC, R, ABarItemControl.Parent.BkBrush); + InflateRect(R, -1, -1); + FillRect(DC, R, Brush); +end; + +class function TdxBarStandardPainter.GlyphBkgndBrush(ABarItemControl: TdxBarItemControl; + APaintType: TdxBarPaintType; AGlyphEmpty, ASelected, ADowned, ADrawDowned, ADroppedDown, + AForceUseBkBrush, AGrayScale: Boolean): HBRUSH; +begin + if ADowned and ABarItemControl.Enabled then + if ASelected then + Result := ABarItemControl.Parent.ToolbarDownedSelBrush + else + Result := ABarItemControl.Parent.ToolbarDownedBrush + else + if ASelected and (APaintType = ptMenu) and AGlyphEmpty and not ADowned then + Result := ABarItemControl.Parent.ToolbarSelBrush + else + Result := ABarItemControl.BkBrush; +end; + +class function TdxBarStandardPainter.GlyphDownShift(ABarItemControl: TdxBarItemControl): Integer; +begin + Result := 1; +end; + +class function TdxBarStandardPainter.GlyphDrawDownedShift(ABarItemControl: TdxBarItemControl; + ADown: Boolean): Integer; +begin + Result := 1; +end; + +class function TdxBarStandardPainter.LoweredBorderSize(ABarItemControl: TdxBarItemControl): Integer; +begin + Result := 1; +end; + +function TdxBarStandardPainter.BeforeFingersSize: Integer; +begin + Result := 2; +end; + +function TdxBarStandardPainter.FingersSize(ABarControl: TdxBarControl): Integer; +begin + Result := BeforeFingersSize + 2 * GripperSize(ABarControl) + 1; +end; + +class procedure TdxBarStandardPainter.GetEditTextVerticalOffsets(out ATop, ABottom: Integer); +begin + ATop := 0; + ABottom := 2; +end; + +class function TdxBarStandardPainter.BarAllowHotTrack: Boolean; +begin + Result := False; +end; + +class function TdxBarStandardPainter.BarAllowQuickCustomizing: Boolean; +begin + Result := False; +end; + +procedure TdxBarStandardPainter.BarDrawCloseButton(ABarControl: TdxBarControl; + DC: HDC; R: TRect); +const + Pushes: array[Boolean] of Integer = (0, DFCS_PUSHED); +begin + FrameRectByColor(DC, R, ABarControl.CaptionBkColor); + InflateRect(R, -1, -1); + DrawFrameControl(DC, R, DFC_CAPTION, + DFCS_CAPTIONCLOSE or Pushes[ABarControl.CloseButtonState = msPressed]); +end; + +procedure TdxBarStandardPainter.BarDrawDockedBarBorder(ABarControl: TdxBarControl; + DC: HDC; R: TRect; AToolbarBrush: HBRUSH); + + procedure DrawFinger; + begin + with R do + begin + DrawEdge(DC, R, BDR_RAISEDINNER, BF_RECT); + if ABarControl.Horizontal then + SetPixel(DC, Left, Bottom - 1, GetSysColor(COLOR_BTNHIGHLIGHT)) + else + SetPixel(DC, Right - 1, Top, GetSysColor(COLOR_BTNHIGHLIGHT)); + InflateRect(R, -1, -1); + FillRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + InflateRect(R, 1, 1); + ExcludeClipRect(DC, Left, Top, Right, Bottom); + end; + end; + +var + AGripperSize: Integer; +begin + with R do + begin + DrawEdge(DC, R, BDR_RAISEDINNER, BF_RECT); + InflateRect(R, -2, -2); + if ABarControl.CanMoving then + begin + AGripperSize := GripperSize(ABarControl); + if ABarControl.Horizontal then + begin + Inc(Left, BeforeFingersSize); + Right := Left + AGripperSize; + end + else + begin + Inc(Top, BeforeFingersSize); + Bottom := Top + AGripperSize; + end; + DrawFinger; + if ABarControl.Horizontal then + OffsetRect(R, AGripperSize, 0) + else + OffsetRect(R, 0, AGripperSize); + DrawFinger; + end; + end; +end; + +procedure TdxBarStandardPainter.BarDrawFloatingBarBorder(ABarControl: TdxBarControl; + DC: HDC; R, CR: TRect; AToolbarBrush: HBRUSH); +begin + DrawEdge(DC, R, EDGE_RAISED, BF_RECT); + InflateRect(R, -2, -2); + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + InflateRect(R, -1, -1); + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); +end; + +procedure TdxBarStandardPainter.BarDrawMDIButton(ABarControl: TdxBarControl; + AButton: TdxBarMDIButton; AState: Integer; DC: HDC; R: TRect); +const + Borders: array[Boolean] of Integer = (BDR_RAISEDINNER, BDR_SUNKENOUTER); +var + AFlat, ClipRgnExists: Boolean; + Rgn1, Rgn2: HRGN; + AFlags: Integer; +begin + AFlat := + (AButton = mdibClose) and ABarControl.BarManager.FlatCloseButton and + ABarControl.MDIButtonsOnBar and not ABarControl.RealMDIButtonsOnBar; + Rgn1 := 0; + ClipRgnExists := False; + if AFlat then + begin + Rgn1 := CreateRectRgn(0, 0, 0, 0); + ClipRgnExists := GetClipRgn(DC, Rgn1) = 1; + InflateRect(R, -1, -1); + Rgn2 := CreateRectRgnIndirect(R); + SelectClipRgn(DC, Rgn2); + DeleteObject(Rgn2); + InflateRect(R, 1, 1); + end; + + AFlags := 0; + if AState = DXBAR_DISABLED then + AFlags := AFlags or DFCS_INACTIVE + else + if AState = DXBAR_PRESSED then + AFlags := AFlags or DFCS_PUSHED; + DrawFrameControl(DC, R, DFC_CAPTION, + MDIButtonStyles[AButton] or AFlags or Byte(AFlat) * DFCS_FLAT); + + if AFlat then + begin + if ClipRgnExists then + SelectClipRgn(DC, Rgn1) + else + SelectClipRgn(DC, 0); + DeleteObject(Rgn1); + DrawEdge(DC, R, Borders[AState = DXBAR_PRESSED], BF_RECT); + end; +end; + +class function TdxBarStandardPainter.BarHorSize: Integer; +begin + Result := dxBarHorSize; +end; + +function TdxBarStandardPainter.BarMarkItemRect(ABarControl: TdxBarControl): TRect; +begin + if ABarControl.DockingStyle = dsNone then + begin + Result := ABarControl.GetCaptionRect; + Result.Right := Result.Left + 3 + 7 + 3; + end + else + Result := inherited BarMarkItemRect(ABarControl); +end; + +class function TdxBarStandardPainter.BarTopSize: Integer; +begin + Result := dxBarTopSize; +end; + +class function TdxBarStandardPainter.BarBottomSize: Integer; +begin + Result := dxBarBottomSize; +end; + +class function TdxBarStandardPainter.BarUseSystemClose: Boolean; +begin + Result := True; +end; + +class function TdxBarStandardPainter.BarUseSystemNCBorder: Boolean; +begin + Result := True; +end; + +class function TdxBarStandardPainter.SubMenuBeginGroupIndent: Integer; +begin + Result := 2; +end; + +procedure TdxBarStandardPainter.DrawButtonControlArrowBackground(const ADrawParams: TdxBarButtonLikeControlDrawParams; + var R1: TRect; ABrush: HBRUSH); +const + Borders: array[Boolean] of Integer = (BDR_RAISEDINNER, BDR_SUNKENOUTER); +var + R: TRect; +begin + inherited; + with ADrawParams do + if DrawSelected then + DrawEdge(Canvas.Handle, R1, Borders[DroppedDown], BF_RECT) + else + if PaintType = ptMenu then + begin + R := cxRectSetWidth(R1, R1.Left - 1, 2); + DrawEdge(Canvas.Handle, R, EDGE_ETCHED, BF_LEFT or BF_RIGHT); + end; +end; + +class procedure TdxBarStandardPainter.ComboControlDrawSimpleButton(const ADrawParams: TdxBarEditLikeControlDrawParams; var ARect: TRect; ABrush: HBRUSH); +const + Borders: array[Boolean] of Integer = (BDR_RAISEDINNER, BDR_SUNKENOUTER); +var + ASpaceBrush: HBRUSH; +begin + with ADrawParams do + begin + if DrawSelected and Enabled then + begin + DrawEdge(Canvas.Handle, ARect, Borders[DroppedDown], BF_RECT); + ASpaceBrush := BarEditControl.Parent.BkBrush; + end + else + begin + if Enabled then + ASpaceBrush := BarEditControl.EditBkBrush + else + ASpaceBrush := BarEditControl.Parent.BkBrush; + FrameRect(Canvas.Handle, ARect, ASpaceBrush); + end; + FillRect(Canvas.Handle, Rect(ARect.Left - 1, ARect.Top, ARect.Left, ARect.Bottom), ASpaceBrush); + InflateRect(ARect, -1, -1); + FillRect(Canvas.Handle, ARect, ABrush); + if DroppedDown then + OffsetRect(ARect, 1, 1); + end; +end; + +procedure TdxBarStandardPainter.DropDownListBoxDrawBorder(DC: HDC; AColor: TColor; ARect: TRect); +begin + DrawEdge(DC, ARect, EDGE_RAISED, BF_RECT); +end; + +class procedure TdxBarStandardPainter.SubMenuControlDrawItemFrame(ABarSubMenuControl: TdxBarSubMenuControl; + AControl: TdxBarItemControl; DC: HDC; AItemRect: TRect; AIndex: Integer); + + procedure DrawChangeRecentGroupLine(ALeftDelta: Integer); + const + ABrushColors: array[Boolean] of COLORREF = (COLOR_BTNHIGHLIGHT, COLOR_BTNSHADOW); + var + R: TRect; + ASeparatorIndex: Integer; + begin + R := AItemRect; + if not AControl.FNonRecent and ABarSubMenuControl.ViewInfo.IsAssociatedWithSeparator(AControl, ASeparatorIndex) then + R.Top := ABarSubMenuControl.ViewInfo.SeparatorInfos[ASeparatorIndex].Bounds.Top; + with R do + begin + Bottom := Top; + Dec(Top); + Dec(Left, ALeftDelta); + Inc(Right); + end; + FillRect(DC, R, GetSysColor(ABrushColors[AControl.FNonRecent])); + end; + +var + ALeftDelta: Integer; +begin + ALeftDelta := Ord(ABarSubMenuControl.BarSize = 0); + if AControl.FChangeRecentGroup then + DrawChangeRecentGroupLine(ALeftDelta); + + if AControl.FNonRecent then + with AItemRect do + begin + if (AIndex = 0) and not ABarSubMenuControl.Detachable then + begin + FillRect(DC, Rect(Left - ALeftDelta, Top - 1, Right + 2, Top), ABarSubMenuControl.BkBrush); + SetPixel(DC, Right + 1, Top - 2, GetSysColor(COLOR_BTNHIGHLIGHT)); + end; + FillRect(DC, Rect(Left - ALeftDelta, Top, Left, Bottom), ABarSubMenuControl.BkBrush); + FillRect(DC, Rect(Right, Top, Right + 2, Bottom), ABarSubMenuControl.BkBrush); + if AIndex = AControl.ItemLink.Owner.VisibleItemCount - 1 then + begin + FillRect(DC, Rect(Left - ALeftDelta, Bottom, Right + 2, ABarSubMenuControl.ClientHeight), ABarSubMenuControl.BkBrush); + if ALeftDelta <> 0 then + SetPixel(DC, Left - 2, ABarSubMenuControl.ClientHeight - 1, GetSysColor(COLOR_BTNHIGHLIGHT)); + end; + end; +end; + +class function TdxBarStandardPainter.SubMenuControlIsOffsetRecentGroupNeeded: Boolean; +begin + Result := True; +end; + +class function TdxBarStandardPainter.SubMenuControlContentRectOffset(ABarSubMenuControl: TdxBarSubMenuControl): TRect; +begin + Result := inherited SubMenuControlContentRectOffset(ABarSubMenuControl); + if ABarSubMenuControl.Detachable then + Result.Top := 0; +end; + +class function TdxBarStandardPainter.SubMenuControlClientBorderSize: Integer; +begin + Result := 2; +end; + +function TdxBarStandardPainter.GetBorderSize: Integer; +begin + Result := 2; +end; + +class function TdxBarStandardPainter.GetCaptionOffsets: TRect; +begin + Result := Rect(2, 1, 2, 1); +end; + +procedure TdxBarStandardPainter.DrawGlyphBorder(ABarItemControl: TdxBarItemControl; + DC: HDC; ABrush: HBRUSH; NeedBorder: Boolean; R: TRect; PaintType: TdxBarPaintType; + IsGlyphEmpty, Selected, Down, DrawDowned, ADroppedDown, IsSplit: Boolean); +const + Borders: array[Boolean] of Integer = (BDR_RAISEDINNER, BDR_SUNKENOUTER); +begin + if Down or (Selected and ((PaintType <> ptMenu) or not IsGlyphEmpty)) then + DrawEdge(DC, R, Borders[Down or DrawDowned or ADroppedDown and not IsSplit], BF_RECT) + else + if NeedBorder then + DrawBackgroundFrameRect(ABarItemControl, DC, R, ABrush, Selected or Down or + DrawDowned or ABarItemControl.FNonRecent or ABarItemControl.IsBkColorAssigned); +end; + +procedure TdxBarStandardPainter.DrawGlyphCheckMark(ABarItemControl: TdxBarItemControl; + DC: HDC; X, Y, DoubleSize: Integer); +const + Colors: array[Boolean] of TColor = (clBlack, clWhite); +var + OffsetY, I: Integer; + + procedure DrawOneMark; + begin + with ABarItemControl.Canvas do + begin + MoveTo(X + DoubleSize * 1, Y + OffsetY + DoubleSize * 2); + LineTo(X + DoubleSize * 3, Y + OffsetY + DoubleSize * 4); + LineTo(X + DoubleSize * 8, Y + OffsetY - DoubleSize * 1); + end; + Inc(OffsetY); + end; + +begin + with ABarItemControl.Canvas do + if ABarItemControl.Enabled then + begin + OffsetY := 0; + Pen.Color := clSilver; + for I := 1 to DoubleSize do DrawOneMark; + Pen.Color := Colors[GetSysColor(COLOR_BTNFACE) = 0]; + for I := 1 to 2 * DoubleSize do DrawOneMark; + Pen.Color := Colors[GetSysColor(COLOR_BTNFACE) <> 0]; + for I := 1 to DoubleSize do DrawOneMark; + MoveTo(X + DoubleSize - 1, Y + DoubleSize * 3 - (DoubleSize - 1)); + LineTo(X + DoubleSize - 1, Y + DoubleSize * 5 + (DoubleSize - 1)); + MoveTo(X + DoubleSize * 8, Y - DoubleSize * 1 + 2); + LineTo(X + DoubleSize * 8, Y + DoubleSize * 3); + end + else + begin + OffsetY := 1; + Pen.Color := GetSysColor(COLOR_BTNSHADOW); + for I := 1 to 2 * DoubleSize do DrawOneMark; + Pen.Color := GetSysColor(COLOR_BTNHIGHLIGHT); + for I := 0 to DoubleSize - 1 do + begin + MoveTo(X + DoubleSize * 4 - (DoubleSize - 1), + Y + DoubleSize * 6 + (DoubleSize - 1 - I)); + LineTo(X + DoubleSize * 9, Y + DoubleSize * 1 - I); + MoveTo(X + DoubleSize * 4, Y + DoubleSize * 7 - I); + LineTo(X + DoubleSize * 9, Y + DoubleSize * 2 - I); + end; + end; +end; + +class function TdxBarStandardPainter.IgnoreGlyphOpaque: Boolean; +begin + Result := True; +end; + +class function TdxBarStandardPainter.BarIsBarSmall(ABarControl: TdxBarControl; + const R: TRect): Boolean; +begin + Result := False; +end; + +class procedure TdxBarStandardPainter.BarDrawMarkAtPos(ABarControl: TdxBarControl; + DC: HDC; const ItemRect: TRect; Offset: Integer); +var + Pen: HPEN; + X: Integer; +begin + if ABarControl.Horizontal then + begin + Pen := SelectObject(DC, CreatePen(PS_SOLID, 1, GetSysColor(COLOR_BTNHIGHLIGHT))); + X := Offset; + MoveToEx(DC, X - 1, 1, nil); + LineTo(DC, X + 2, 4); + MoveToEx(DC, X + 3, 4, nil); + LineTo(DC, X - 1, 8); + ReverseGDIObject(DC, Pen); + + Pen := SelectObject(DC, CreatePen(PS_SOLID, 1, GetSysColor(COLOR_BTNSHADOW))); + MoveToEx(DC, X, 1, nil); + LineTo(DC, X + 2, 3); + LineTo(DC, X + 2, 4); + LineTo(DC, X - 1, 7); + ReverseGDIObject(DC, Pen); + end + else + begin + Pen := SelectObject(DC, CreatePen(PS_SOLID, 1, GetSysColor(COLOR_BTNSHADOW))); + X := ABarControl.ClientWidth - 8; + MoveToEx(DC, X, Offset, nil); + LineTo(DC, X + 4, Offset + 4); + MoveToEx(DC, X + 4, Offset + 1, nil); + LineTo(DC, X + 6, Offset - 1); + ReverseGDIObject(DC, Pen); + + Pen := SelectObject(DC, CreatePen(PS_SOLID, 1, GetSysColor(COLOR_BTNHIGHLIGHT))); + MoveToEx(DC, X + 1, Offset, nil); + LineTo(DC, X + 3, Offset + 2); + LineTo(DC, X + 4, Offset + 2); + LineTo(DC, X + 7, Offset - 1); + ReverseGDIObject(DC, Pen); + end; +end; + +procedure TdxBarStandardPainter.BarDrawMarkBackground(ABarControl: TdxBarControl; + DC: HDC; ItemRect: TRect; AToolbarBrush: HBRUSH); +begin + ABarControl.FillBackground(DC, ItemRect, AToolbarBrush, clNone, True); +end; + +{ TdxBarEnhancedPainter } + +function TdxBarEnhancedPainter.BeforeFingersSize: Integer; +begin + Result := 1; +end; + +function TdxBarEnhancedPainter.FingersSize(ABarControl: TdxBarControl): Integer; +begin + Result := BeforeFingersSize + GripperSize(ABarControl) + 2; +end; + +class function TdxBarEnhancedPainter.SubMenuBeginGroupIndent: Integer; +begin + Result := 12; +end; + +class function TdxBarEnhancedPainter.BarAllowQuickCustomizing: Boolean; +begin + Result := True; +end; + +procedure TdxBarEnhancedPainter.BarDrawDockedBarBorder(ABarControl: TdxBarControl; + DC: HDC; R: TRect; AToolbarBrush: HBRUSH); + + procedure DrawFinger; + begin + with R do + begin + DrawEdge(DC, R, BDR_RAISEDINNER, BF_RECT); + InflateRect(R, -1, -1); + FillRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + InflateRect(R, 1, 1); + ExcludeClipRect(DC, Left, Top, Right, Bottom); + end; + end; + +begin + with R do + begin + DrawEdge(DC, R, BDR_RAISEDINNER, BF_RECT); + InflateRect(R, -2, -2); + if ABarControl.CanMoving then + begin + if ABarControl.Horizontal then + begin + Inc(Left, BeforeFingersSize); + Right := Left + GripperSize(ABarControl); + InflateRect(R, 0, -1); + end + else + begin + Inc(Top, BeforeFingersSize); + Bottom := Top + GripperSize(ABarControl); + InflateRect(R, -1, 0); + end; + DrawFinger; + end; + end; +end; + +class procedure TdxBarEnhancedPainter.BarDrawMarkAtPos(ABarControl: TdxBarControl; + DC: HDC; const ItemRect: TRect; Offset: Integer); +begin + TdxBarPainter.BarDrawMarkAtPos(ABarControl, DC, ItemRect, Offset); +end; + +procedure TdxBarEnhancedPainter.BarDrawMarkBackground(ABarControl: TdxBarControl; + DC: HDC; ItemRect: TRect; AToolbarBrush: HBRUSH); +const + MarkEdges: array[msSelected..msPressed] of UINT = (BDR_RAISEDINNER, BDR_SUNKENOUTER); +begin + if ABarControl.MarkDrawState = msNone then + FrameRect(DC, ItemRect, AToolbarBrush) + else + DrawEdge(DC, ItemRect, MarkEdges[ABarControl.MarkDrawState], BF_RECT); + InflateRect(ItemRect, -1, -1); + ABarControl.FillBackground(DC, ItemRect, AToolbarBrush, clNone, True); + InflateRect(ItemRect, 1, 1); +end; + +{ TdxBarFlatPainter } + +procedure TdxBarFlatPainter.CalculateSpinEditParts(const ADrawParams: TdxBarSpinEditDrawParams; + var AParts: array of TRect; const AItemRect: TRect); +begin + inherited; + Inc(AParts[secButtonUp].Bottom); +end; + +class function TdxBarFlatPainter.GetControlCaptionOffset(ABarItemControl: TdxBarItemControl): Integer; +begin + if ABarItemControl.IsMenuItem then + Result := 8 + else + Result := inherited GetControlCaptionOffset(ABarItemControl); +end; + +procedure TdxBarFlatPainter.DrawItemBackgroundInSubMenu(const ADrawParams: TdxBarButtonLikeControlDrawParams; R: TRect); +var + AIconRect: TRect; + AOpaque: Boolean; + ABrush: HBRUSH; + ADC: HDC; + I: Integer; +begin + with ADrawParams do + begin + AIconRect := SubMenuControlGetItemIconRect(R, BarItemControl.Parent.IconAreaSize); + ADC := Canvas.Handle; + + AOpaque := DrawSelected or BarItemControl.FNonRecent; + if DrawSelected then + FrameFlatSelRect(ADC, R) + else + begin + I := R.Left + 1 + BarItemControl.Parent.IconAreaSize; + + ABrush := BarItemControl.BarManager.FlatToolbarsBrush; + DrawBackground(BarItemControl, ADC, Rect(R.Left, R.Top, I, R.Top + 1), ABrush, AOpaque); + DrawBackground(BarItemControl, ADC, Rect(R.Left, R.Bottom - 1, I, R.Bottom), ABrush, AOpaque); + DrawBackground(BarItemControl, ADC, Rect(R.Left, R.Top + 1, R.Left + 1, R.Bottom - 1), ABrush, AOpaque); + + ABrush := BarItemControl.Parent.BkBrush; + DrawBackground(BarItemControl, ADC, Rect(I, R.Top, R.Right, R.Top + 1), ABrush, AOpaque); + DrawBackground(BarItemControl, ADC, Rect(I, R.Bottom - 1, R.Right, R.Bottom), ABrush, AOpaque); + DrawBackground(BarItemControl, ADC, Rect(R.Right - 1, R.Top + 1, R.Right, R.Bottom - 1), ABrush, AOpaque); + end; + InflateRect(R, -1, -1); + + if DrawSelected then + ABrush := BarItemControl.Parent.ToolbarSelBrush + else + ABrush := BarItemControl.BarManager.FlatToolbarsBrush; + R.Left := AIconRect.Right + 2; + DrawBackground(BarItemControl, ADC, Rect(AIconRect.Right, AIconRect.Top, R.Left, AIconRect.Bottom), ABrush, AOpaque); + if AIconRect.Top > R.Top then + DrawBackground(BarItemControl, ADC, Rect(AIconRect.Left, R.Top, R.Left, AIconRect.Top), ABrush, AOpaque); + if AIconRect.Bottom < R.Bottom then + DrawBackground(BarItemControl, ADC, Rect(AIconRect.Left, AIconRect.Bottom, R.Left, R.Bottom), ABrush, AOpaque); + + if DrawSelected then + ABrush := BarItemControl.Parent.ToolbarSelBrush + else + ABrush := BarItemControl.BkBrush; + DrawBackground(BarItemControl, ADC, R, ABrush, AOpaque); + end; +end; + +class procedure TdxBarFlatPainter.DrawLowered(DC: HDC; var R: TRect); +begin + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNSHADOW)); + InflateRect(R, -1, -1); // LoweredBorderSize(ABarItemControl) = 1 +end; + +procedure TdxBarFlatPainter.DrawStaticBorder(const ADrawParams: TdxBarStaticLikeControlDrawParams; var ARect: TRect); +var + AContentRect: TRect; +begin + with ADrawParams do + begin + AContentRect := cxRectContent(ARect, BorderOffsets); + Canvas.SaveClipRegion; + Canvas.ExcludeClipRect(AContentRect); + FillRect(Canvas.Handle, ARect, StaticBorderBrush(BarItemControl, BorderStyle)); + Canvas.RestoreClipRegion; + ARect := AContentRect; + end; +end; + +class procedure TdxBarFlatPainter.FrameAndFillRect(ABarItemControl: TdxBarItemControl; + DC: HDC; var R: TRect; Enabled, Selected, Pressed: Boolean); +var + Brush: HBRUSH; +begin + Brush := ABarItemControl.Parent.BkBrush; + if Selected then + begin + FrameFlatSelRect(DC, R); + if Pressed then + Brush := ABarItemControl.Parent.ToolbarDownedSelBrush + else + Brush := ABarItemControl.Parent.ToolbarSelBrush; + end + else + FrameRect(DC, R, ABarItemControl.Parent.BkBrush); + InflateRect(R, -1, -1); + FillRect(DC, R, Brush); +end; + +class function TdxBarFlatPainter.GlyphBkgndBrush(ABarItemControl: TdxBarItemControl; + APaintType: TdxBarPaintType; AGlyphEmpty, ASelected, ADowned, ADrawDowned, ADroppedDown, + AForceUseBkBrush, AGrayScale: Boolean): HBRUSH; +begin + if ADroppedDown then + if ADowned then + Result := ABarItemControl.Parent.ToolbarDownedSelBrush + else + Result := ABarItemControl.Parent.BarControlOwnerBrush + else + if ASelected then + if ADowned or ADrawDowned then + Result := ABarItemControl.Parent.ToolbarDownedSelBrush + else + Result := ABarItemControl.Parent.ToolbarSelBrush + else + if ADowned then + Result := ABarItemControl.Parent.ToolbarDownedBrush + else + if (APaintType = ptMenu) and not AForceUseBkBrush then + Result := GetToolbarBrush(ABarItemControl) + else + Result := ABarItemControl.BkBrush; +end; + +class function TdxBarFlatPainter.IsFlatGlyphImage: Boolean; +begin + Result := True; +end; + +class function TdxBarFlatPainter.IsFlatItemText: Boolean; +begin + Result := True; +end; + +class function TdxBarFlatPainter.IsGlyphImageBackgroundOpaque(ABarItemControl: TdxBarItemControl; + ADown, ADrawDowned, ASelected, AGlyphEmpty: Boolean): Boolean; +begin + Result := inherited IsGlyphImageBackgroundOpaque(ABarItemControl, ADown, ADrawDowned, ASelected, AGlyphEmpty); + if not AGlyphEmpty then + Result := Result or ADown or ADrawDowned or ASelected; +end; + +class function TdxBarFlatPainter.IsGlyphImageHasShadow: Boolean; +begin + Result := True; +end; + +class function TdxBarFlatPainter.LoweredBorderSize(ABarItemControl: TdxBarItemControl): Integer; +begin + Result := 1; +end; + +class function TdxBarFlatPainter.StaticBorderBrush(ABarItemControl: TdxBarItemControl; + ABorderStyle: TdxBarStaticBorderStyle): HBRUSH; +begin + Result := GetSysColorBrush(COLOR_BTNSHADOW); +end; + +class function TdxBarFlatPainter.TextAreaOffset(ABarItemControl: TdxBarItemControl): Integer; +begin + // WARNING!!! sync with Indent + if ABarItemControl.Parent.Kind = bkSubMenu then + Result := 1 + ABarItemControl.Parent.TextSize + 2 + else + Result := 0; +end; + +function TdxBarFlatPainter.BeforeFingersSize: Integer; +begin + Result := 1; +end; + +function TdxBarFlatPainter.FingersSize(ABarControl: TdxBarControl): Integer; +begin + Result := BeforeFingersSize + GripperSize(ABarControl) + 2; +end; + +class function TdxBarFlatPainter.RealButtonArrowWidth(ABarManager: TdxBarManager): Integer; +begin + Result := inherited RealButtonArrowWidth(ABarManager); + Dec(Result); +end; + +class function TdxBarFlatPainter.RealLargeButtonArrowWidth(ABarManager: TdxBarManager): Integer; +begin + Result := inherited RealLargeButtonArrowWidth(ABarManager) - 1; +end; + +class function TdxBarFlatPainter.SubMenuBeginGroupIndent: Integer; +begin + Result := 8; +end; + +class function TdxBarFlatPainter.BarChildrenHaveShadows(ABarControl: TCustomdxBarControl): Boolean; +begin + Result := True; +end; + +class procedure TdxBarFlatPainter.BarDrawBarControlOwner(ACustomBarControl: TCustomdxBarControl; + DC: HDC; R: TRect; ABarControl: TCustomdxBarControl); +begin + BarDrawBarControlOwnerBorder(ACustomBarControl, DC, R, nil, ABarControl); + InflateRect(R, -1, -1); + FillRect(DC, R, ACustomBarControl.BarControlOwnerBrush); +end; + +class procedure TdxBarFlatPainter.BarDrawBarControlOwnerBorder(ACustomBarControl: TCustomdxBarControl; + DC: HDC; R: TRect; ABarItemControl: TdxBarItemControl; ABarControl: TCustomdxBarControl); +var + AClipRgn: HRGN; + AClipRgnExists: Boolean; + + procedure DrawBarControlOwnerLink; + var + ALinkR, ATempRect, CR, WR: TRect; + AOrigin: TPoint; + AHandle: HWND; + begin + AClipRgn := 0; + if not ABarControl.HandleAllocated then Exit; + ALinkR := ABarControl.OwnerLinkBounds[True]; + + if ABarControl.OwnerControl = nil then // !!! + begin + GetDCOrgEx(DC, AOrigin); + OffsetRect(ALinkR, -AOrigin.X, -AOrigin.Y); + end + else + begin + AHandle := ABarControl.OwnerControl.Handle; + GetClientRect(AHandle, CR); + MapWindowRect(AHandle, 0, CR); + if IntersectRect(ATempRect, CR, ALinkR) then // client area + OffsetRect(ALinkR, -CR.Left, -CR.Top) + else + begin + GetWindowRect(AHandle, WR); // NC + OffsetRect(ALinkR, -WR.Left, -WR.Top); + end; + end; + BarDrawBarControlOwnerLink(ACustomBarControl, DC, R, ALinkR, ABarItemControl); + AClipRgn := CreateRectRgn(0, 0, 0, 0); + AClipRgnExists := GetClipRgn(DC, AClipRgn) = 1; + with ALinkR do + ExcludeClipRect(DC, Left, Top, Right, Bottom); + end; + +begin + DrawBarControlOwnerLink; + BarDrawBarControlOwnerFrame(ACustomBarControl, DC, R); + if AClipRgn <> 0 then + begin + if AClipRgnExists then + SelectClipRgn(DC, AClipRgn) + else + SelectClipRgn(DC, 0); + DeleteObject(AClipRgn); + end; +end; + +class procedure TdxBarFlatPainter.BarDrawBarControlOwnerFrame(ACustomBarControl: TCustomdxBarControl; + DC: HDC; R: TRect); +begin + FrameRect(DC, R, ACustomBarControl.BarManager.FlatToolbarsBorderBrush); +end; + +class procedure TdxBarFlatPainter.BarDrawBarControlOwnerLink(ACustomBarControl: TCustomdxBarControl; + DC: HDC; R, ALinkR: TRect; ABarItemControl: TdxBarItemControl); +begin + FillRect(DC, ALinkR, ACustomBarControl.BarControlOwnerBrush); +end; + +class function TdxBarFlatPainter.BarToolbarBrush(ABarControl: TCustomdxBarControl): HBRUSH; +begin + Result := ABarControl.BarManager.FlatToolbarsBrush; +end; + +class function TdxBarFlatPainter.BarToolbarBrushEx(ABarControl: TdxBarControl): HBRUSH; +begin + if not (ABarControl.IsMainMenu or ABarControl.Bar.IsStatusBar) then + Result := inherited BarToolbarBrushEx(ABarControl) + else + Result := GetSysColorBrush(COLOR_BTNFACE); +end; + +class function TdxBarFlatPainter.BarToolbarDownedBrush(ABarControl: TCustomdxBarControl): HBRUSH; +begin + Result := ABarControl.BarManager.FlatToolbarsDownedBrush; +end; + +class function TdxBarFlatPainter.BarToolbarDownedSelBrush(ABarControl: TCustomdxBarControl): HBRUSH; +begin + Result := ABarControl.BarManager.FlatToolbarsDownedSelBrush; +end; + +class function TdxBarFlatPainter.BarToolbarSelBrush(ABarControl: TCustomdxBarControl): HBRUSH; +begin + Result := ABarControl.BarManager.FlatToolbarsSelBrush; +end; + +function TdxBarFlatPainter.BarBeginGroupSideSize: Integer; +begin + Result := (BarBeginGroupSize - 1{|}) div 2; +end; + +function TdxBarFlatPainter.BarBeginGroupSize: Integer; +begin + Result := 2 + 1{|} + 2; +end; + +procedure TdxBarFlatPainter.BarDrawBeginGroup(ABarControl: TCustomdxBarControl; + DC: HDC; ABeginGroupRect: TRect; AToolbarBrush: HBRUSH; AHorz: Boolean); +begin + with ABeginGroupRect do + if AHorz then + begin + ABarControl.FillBackground(DC, + Rect(Left, Top, Right, Top + BarBeginGroupSideSize), + AToolbarBrush, clNone, True); + ABarControl.FillBackground(DC, + Rect(Left, Bottom - BarBeginGroupSideSize, Right, Bottom), + AToolbarBrush, clNone, True); + InflateRect(ABeginGroupRect, 0, -BarBeginGroupSideSize); + FillRect(DC, Rect(Left, Top, Right, Top + 1), COLOR_BTNSHADOW + 1); + end + else + begin + ABarControl.FillBackground(DC, + Rect(Left, Top, Left + BarBeginGroupSideSize, Bottom), + AToolbarBrush, clNone, True); + ABarControl.FillBackground(DC, + Rect(Right - BarBeginGroupSideSize, Top, Right, Bottom), + AToolbarBrush, clNone, True); + InflateRect(ABeginGroupRect, -BarBeginGroupSideSize, 0); + FillRect(DC, Rect(Left, Top, Left + 1, Bottom), COLOR_BTNSHADOW + 1); + end; +end; + +procedure TdxBarFlatPainter.BarDrawCloseButton(ABarControl: TdxBarControl; + DC: HDC; R: TRect); + + procedure DrawCross(var R: TRect); +// const +// CrossColors: array[Boolean] of Integer = (COLOR_CAPTIONTEXT, COLOR_BTNTEXT); + var + APen: HPEN; + begin + InflateRect(R, -3, -4); + with R do + begin + if Odd(Right - Left) then Dec(Right); + Bottom := Top + (Right - Left - 1); + end; + with R do + begin +// APen := SelectObject(DC, CreatePen(PS_SOLID, 1, +// GetSysColor(CrossColors[ABarControl.CloseButtonState = msSelected]))); + APen := SelectObject(DC, CreatePen(PS_SOLID, 1, + BarMarkArrowColor(ABarControl, ABarControl.CloseButtonState))); + + MoveToEx(DC, Left, Top, nil); + LineTo(DC, Right - 1, Bottom); + MoveToEx(DC, Left + 1, Top, nil); + LineTo(DC, Right, Bottom); + + MoveToEx(DC, Left, Bottom - 1, nil); + LineTo(DC, Right - 1, Top - 1); + MoveToEx(DC, Left + 1, Bottom - 1, nil); + LineTo(DC, Right, Top - 1); + + DeleteObject(SelectObject(DC, APen)); + end; + end; + +begin + BarDrawCaptionElement(ABarControl, DC, R, ABarControl.CloseButtonState); + DrawCross(R); +end; + +procedure TdxBarFlatPainter.BarDrawDockedBarBorder(ABarControl: TdxBarControl; + DC: HDC; R: TRect; AToolbarBrush: HBRUSH); + + procedure DrawFinger; + var + I: Integer; + Brush: HBRUSH; + begin + with R do + begin + if ABarControl.Horizontal then + for I := Top to Bottom - 1 do + begin + if Odd(I - Top) then + Brush := AToolbarBrush + else + Brush := COLOR_BTNSHADOW + 1; + FillRect(DC, Rect(Left, I, Right, I + 1), Brush); + end + else + for I := Left to Right - 1 do + begin + if Odd(I - Left) then + Brush := AToolbarBrush + else + Brush := COLOR_BTNSHADOW + 1; + FillRect(DC, Rect(I, Top, I + 1, Bottom), Brush); + end; + end; + end; + +begin + with R do + begin + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + InflateRect(R, -1, -1); + FillRect(DC, Rect(Left, Top, Left + 1, Top + 1), COLOR_BTNFACE + 1); + FillRect(DC, Rect(Right - 1, Top, Right, Top + 1), COLOR_BTNFACE + 1); + FillRect(DC, Rect(Left, Bottom - 1, Left + 1, Bottom), COLOR_BTNFACE + 1); + FillRect(DC, Rect(Right - 1, Bottom - 1, Right, Bottom), COLOR_BTNFACE + 1); + InflateRect(R, -1, -1); + if ABarControl.CanMoving then + begin + if ABarControl.Horizontal then + begin + Inc(Left, BeforeFingersSize); + Right := Left + GripperSize(ABarControl); + InflateRect(R, 0, -3); + end + else + begin + Inc(Top, BeforeFingersSize); + Bottom := Top + GripperSize(ABarControl); + InflateRect(R, -3, 0); + end; + DrawFinger; + end; + end; +end; + +procedure TdxBarFlatPainter.BarDrawFloatingBarBorder(ABarControl: TdxBarControl; + DC: HDC; R, CR: TRect; AToolbarBrush: HBRUSH); +var + I: Integer; +begin + FrameRect(DC, R, ABarControl.BarManager.FlatToolbarsBorderBrush); + InflateRect(R, -1, -1); + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNHIGHLIGHT)); + for I := R.Left + 1 to CR.Left - 1 do + begin + InflateRect(R, -1, -1); + FrameRect(DC, R, AToolbarBrush); + end; +end; + +procedure TdxBarFlatPainter.BarDrawMark(ABarControl: TdxBarControl; + DC: HDC; MarkR: TRect); + + procedure DrawBackground; + var + R: TRect; + begin + if ABarControl.HasCloseButton then + begin + R := MarkR; + with R do + begin + Left := Right; + Right := Left + FloatToolbarMarkIndent; + end; + FillRectByColor(DC, R, ABarControl.CaptionBkColor); + end; + if ABarControl.MarkDrawState = msPressed then + BarDrawBarControlOwner(ABarControl, DC, MarkR, ABarControl.FQuickPopup) + else + BarDrawCaptionElement(ABarControl, DC, MarkR, ABarControl.MarkDrawState); + end; + +begin + DrawBackground; + inherited BarDrawMark(ABarControl, DC, MarkR); +end; + +procedure TdxBarFlatPainter.BarDrawMDIButton(ABarControl: TdxBarControl; + AButton: TdxBarMDIButton; AState: Integer; DC: HDC; R: TRect); +const + Enables: array[Boolean] of Integer = (DFCS_INACTIVE, 0); +var + ABitmap: TBitmap; + ABrush: HBRUSH; +begin + ABitmap := TBitmap.Create; + try + InflateRect(R, -1, -1); + ABitmap.Width := R.Right - R.Left; + ABitmap.Height := R.Bottom - R.Top; + DrawFrameControl(ABitmap.Canvas.Handle, + Rect(-1, -1, ABitmap.Width + 1, ABitmap.Height + 1), + DFC_CAPTION, MDIButtonStyles[AButton] or DFCS_FLAT or + Enables[AState <> DXBAR_DISABLED]); + + if AState in [DXBAR_ACTIVE, DXBAR_HOT, DXBAR_PRESSED] then + begin + case AState of + DXBAR_ACTIVE: + ABrush := ABarControl.ToolbarDownedBrush; + DXBAR_HOT: + ABrush := ABarControl.ToolbarSelBrush; + else{DXBAR_PRESSED} + ABrush := ABarControl.ToolbarDownedSelBrush; + end; + + FillRect(DC, R, ABrush); + FrameFlatSelRect(DC, cxRectInflate(R, 1, 1)); + end + else + ABarControl.FillBackground(DC, cxRectInflate(R, 1, 1), ABarControl.BkBrush, clNone, True); + + TransparentDraw(DC, R, ABitmap); + finally + ABitmap.Free; + end; +end; + +class function TdxBarFlatPainter.BarToolbarBrushEx2(ABarControl: TdxBarControl): HBRUSH; +begin + Result := GetSysColorBrush(COLOR_WINDOW); +end; + +class procedure TdxBarFlatPainter.DrawQuickCustItemFrame(ABarItemControl: TdxBarItemControl; + DC: HDC; var R, ARect: TRect; Selected: Boolean); +begin + inherited; + if not Selected then + DrawBackgroundFrameRect(ABarItemControl, DC, R, BarToolbarBrush(ABarItemControl.Parent), False); + + InflateRect(R, -1, -1); +end; + +class procedure TdxBarFlatPainter.DrawQuickCustItemFrameSelected(ABarItemControl: TdxBarItemControl; + DC: HDC; WholeR, R: TRect; Selected: Boolean); +begin + if Selected then + begin + FrameFlatSelRect(DC, WholeR); + with R do + begin + Left := Right; + Right := Left + 2; // paint over! + end; + FillRect(DC, R, ABarItemControl.Parent.ToolbarSelBrush); + end; +end; + +class function TdxBarFlatPainter.IsQuickControlPopupOnRight: Boolean; +begin + Result := True; +end; + +function TdxBarFlatPainter.ButtonControlArrowBrush(const ADrawParams: TdxBarItemControlDrawParams): HBRUSH; +begin + with ADrawParams do + if DrawSelected then + if DroppedDown or IsHighContrastWhite then + Result := BarItemControl.Parent.ToolbarDownedSelBrush + else + Result := BarItemControl.Parent.ToolbarSelBrush + else + Result := inherited ButtonControlArrowBrush(ADrawParams); +end; + +class procedure TdxBarFlatPainter.CorrectButtonControlDefaultHeight(var DefaultHeight: Integer); +begin + Inc(DefaultHeight, 2); +end; + +class procedure TdxBarFlatPainter.CorrectButtonControlDefaultWidth(var DefaultWidth: Integer); +begin + Inc(DefaultWidth, 2 + 1 + 6); +end; + +procedure TdxBarFlatPainter.DrawButtonControlArrowBackground(const ADrawParams: TdxBarButtonLikeControlDrawParams; + var R1: TRect; ABrush: HBRUSH); +begin + inherited; + with ADrawParams do + if (PaintType = ptMenu) or not DroppedDown then + DrawFrameRect(BarItemControl, Canvas.Handle, R1, ABrush, PaintType, DrawSelected, Downed); +end; + +function TdxBarFlatPainter.ComboControlArrowColor(ADrawParams: TdxBarItemControlDrawParams): TColor; +begin + Result := inherited ComboControlArrowColor(ADrawParams); + with ADrawParams do + if DrawSelected then + begin + if DroppedDown or IsHighContrastWhite then + Result := clHighlightText; + end + else + if not Enabled then + Result := clBtnShadow; +end; + +function TdxBarFlatPainter.ComboControlButtonBrush(const ADrawParams: TdxBarItemControlDrawParams): HBRUSH; +begin + Result := inherited ComboControlButtonBrush(ADrawParams); + with ADrawParams do + if (PaintType = ptMenu) and not DrawSelected then + Result := BarItemControl.Parent.ToolbarBrush; +end; + +class procedure TdxBarFlatPainter.ComboControlDrawSimpleButton(const ADrawParams: TdxBarEditLikeControlDrawParams; var ARect: TRect; ABrush: HBRUSH); +var + ASpaceBrush: HBRUSH; +begin + with ADrawParams do + begin + if DrawSelected then + begin + InflateRect(ARect, 1, 1); + FrameFlatSelRect(Canvas.Handle, ARect); + end + else + begin + if Enabled then + ASpaceBrush := BarEditControl.EditBkBrush + else + ASpaceBrush := BarEditControl.Parent.BkBrush; + FrameRect(Canvas.Handle, ARect, ASpaceBrush); + FillRect(Canvas.Handle, Rect(ARect.Left - 1, ARect.Top, ARect.Left, ARect.Bottom), ASpaceBrush); + end; + InflateRect(ARect, -1, -1); + FillRect(Canvas.Handle, ARect, ABrush); + end; +end; + +class function TdxBarFlatPainter.SubMenuControlArrowsOffset: Integer; +begin + Result := 1; +end; + +function TdxBarFlatPainter.SubMenuControlBeginGroupRect( + ABarSubMenuControl: TdxBarSubMenuControl; AControl: TdxBarItemControl; + const AItemRect: TRect): TRect; +begin + Result := AItemRect; + Result.Bottom := Result.Top; + Dec(Result.Top, SubMenuControlBeginGroupSize); +end; + +function TdxBarFlatPainter.SubMenuControlBeginGroupSize: Integer; +begin + Result := 2 + 1 + 2; +end; + +procedure TdxBarFlatPainter.SubMenuControlCalcDrawingConsts(ACanvas: TcxCanvas; + ATextSize: Integer; out AMenuArrowWidth, AMarkSize: Integer); +var + AArrowSize: Integer; +begin + inherited; + AArrowSize := SubMenuControlMarkArrowSize(AMarkSize - 2); + if Odd(AArrowSize) then AMarkSize := (AArrowSize - 1) * 2 + 2 * 3; +end; + +class function TdxBarFlatPainter.SubMenuControlDetachCaptionAreaSize(ABarSubMenuControl: TdxBarSubMenuControl): Integer; +begin + Result := ABarSubMenuControl.DetachCaptionSize + 1; +end; + +class function TdxBarFlatPainter.SubMenuControlGetItemIconRect(const AItemRect: TRect; AIconAreaSize: Integer): TRect; +begin + Result := inherited SubMenuControlGetItemIconRect(cxRectInflate(AItemRect, -1, -1), AIconAreaSize - 2) +end; + +class function TdxBarFlatPainter.SubMenuControlGetItemTextRect(const ADrawParams: TdxBarButtonLikeControlDrawParams; const AItemRect: TRect): TRect; +begin + Result := inherited SubMenuControlGetItemTextRect(ADrawParams, cxRectInflate(AItemRect, 0, -1, -1, -1)); +end; + +class function TdxBarFlatPainter.SubMenuControlGetItemTextIndent(const ADrawParams: TdxBarItemControlDrawParams): Integer; +begin + Result := inherited SubMenuControlGetItemTextIndent(ADrawParams) + 6; +end; + +procedure TdxBarFlatPainter.SubMenuControlDrawBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); + + procedure DrawFlatBorder; + begin + FrameRect(DC, R, ABarSubMenuControl.BarManager.FlatToolbarsBorderBrush); + BarDrawOwnerLink(ABarSubMenuControl, DC); + end; + +begin + with R do + begin + DrawFlatBorder; + if ABarSubMenuControl.Detachable then + begin + InflateRect(R, -1, -1); + Bottom := Top + 1; + FillRect(DC, R, COLOR_WINDOW + 1); + Top := Bottom; + Bottom := Top + ABarSubMenuControl.DetachCaptionSize; + FillRect(DC, Rect(Left, Top, Left + 1, Bottom), COLOR_WINDOW + 1); + FillRect(DC, Rect(Right - 1, Top, Right, Bottom), COLOR_WINDOW + 1); + SubMenuControlDrawDetachCaption(ABarSubMenuControl, DC, ABarSubMenuControl.DetachCaptionRect); + end; + end +end; + +procedure TdxBarFlatPainter.SubMenuControlDrawClientBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; const R: TRect; ABrush: HBRUSH); +begin + FrameRect(DC, R, ABarSubMenuControl.ToolbarItemsBrush); + with R do + FillRect(DC, Rect(Left, Top + 1, Left + 1, Bottom - 1), ABrush); +end; + +procedure TdxBarFlatPainter.SubMenuControlDrawDetachCaption(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); +const + MarkSize = 33; + Colors: array[Boolean] of COLORREF = (COLOR_BTNSHADOW, COLOR_BTNTEXT); +var + Brush: HBRUSH; + I: Integer; +begin + if ABarSubMenuControl.DetachCaptionSelected then + begin + FrameFlatSelRect(DC, R); + InflateRect(R, -1, -1); + Brush := ABarSubMenuControl.ToolbarSelBrush; + end + else + Brush := ABarSubMenuControl.BarManager.FlatToolbarsBrush; + FillRect(DC, R, Brush); + Brush := Colors[ABarSubMenuControl.DetachCaptionSelected] + 1; + with R do + begin + InflateRect(R, -(Right - Left - MarkSize) div 2, -1); + Right := Left + MarkSize; + for I := Top to Bottom - 1 do + if not Odd(I - Top) then + FillRect(DC, Rect(Left, I, Right, I + 1), Brush); + end; +end; + +procedure TdxBarFlatPainter.SubMenuControlDrawBeginGroup(ABarSubMenuControl: TdxBarSubMenuControl; + AControl: TdxBarItemControl; ACanvas: TcxCanvas; const ABeginGroupRect: TRect); +var + R: TRect; + ABrush: HBRUSH; + LD, RD: Integer; + AOpaque: Boolean; + ADC: HDC; +begin + ADC := ACanvas.Handle; + R := ABeginGroupRect; + if not IgnoreNonRecentColor and AControl.FChangeRecentGroup and AControl.FNonRecent then + ABrush := SubMenuControlToolbarItemsBrush(ABarSubMenuControl) + else + ABrush := ABarSubMenuControl.BkBrush; + AOpaque := not IgnoreNonRecentColor and AControl.FNonRecent and not AControl.FChangeRecentGroup; + with R do + begin + LD := Left + AControl.TextAreaOffset; + DrawBackground(AControl, ADC, Rect(Left, Top, LD, Bottom), ABarSubMenuControl.BarManager.FlatToolbarsBrush, AOpaque); + DrawBackground(AControl, ADC, Rect(LD, Top, Right, Bottom), ABrush, AOpaque); + RD := (Top + Bottom) div 2; + SubMenuControlDrawSeparator(ACanvas, Rect(LD + SubMenuBeginGroupIndent, RD, Right + 1, RD + 1)); + end; +end; + +procedure TdxBarFlatPainter.SubMenuControlDrawSeparator(ACanvas: TcxCanvas; const ARect: TRect); +begin + ACanvas.FrameRect(ARect, SubMenuControlGetSeparatorColor, 1, [bTop]); +end; + +class function TdxBarFlatPainter.SubMenuControlGetSeparatorColor: TColor; +begin + Result := GetSysColor(COLOR_BTNSHADOW); +end; + +class function TdxBarFlatPainter.SubMenuControlMarkArrowSize(AMarkSize: Integer): Integer; +begin + Result := (AMarkSize - 2 * 2) div 2; + if (Result > 4) and Odd(Result) then + Dec(Result); +end; + +class function TdxBarFlatPainter.SubMenuControlNormalItemHeight: Integer; +begin + Result := 19 + 1; +end; + +class procedure TdxBarFlatPainter.SubMenuControlOffsetDetachCaptionRect(ABarSubMenuControl: TdxBarSubMenuControl; + var R: TRect); +begin + InflateRect(R, -2, -2); +end; + +class function TdxBarFlatPainter.SubMenuControlTextSize(ACanvas: TcxCanvas): Integer; +begin + Result := inherited SubMenuControlTextSize(ACanvas) + 1; +end; + +class function TdxBarFlatPainter.SubMenuControlToolbarItemsBrush(ABarSubMenuControl: TdxBarSubMenuControl): HBRUSH; +begin + Result := GetSysColorBrush(COLOR_WINDOW); +end; + +class procedure TdxBarFlatPainter.CustomComboDrawItem(ABarCustomCombo: TdxBarCustomCombo; + ACanvas: TCanvas; AIndex: Integer; ARect: TRect; AState: TOwnerDrawState; + AInteriorIsDrawing: Boolean); +var + S: string; +begin + with ACanvas, ARect do + begin + if AIndex = -1 then + S := ABarCustomCombo.Text + else + S := ABarCustomCombo.Items[AIndex]; + FillRect(ARect); + TextOut(Left + 2, Top + Byte(AInteriorIsDrawing) * 2, S); + end; +end; + +class function TdxBarFlatPainter.EditControlBorderOffsets(APaintType: TdxBarPaintType): TRect; +begin + Result := Rect(1, 1, 1, 1); +end; + +procedure TdxBarFlatPainter.EditControlDrawBorder( + const ADrawParams: TdxBarEditLikeControlDrawParams; var ARect: TRect); +begin + with ADrawParams do + begin + if DrawSelected then + FrameFlatSelRect(Canvas.Handle, ARect) + else + if (PaintType = ptMenu) and not IsTransparent then + FrameRect(Canvas.Handle, ARect, BarEditControl.Parent.ToolbarBrush) + else + if not Enabled and not IsTransparent then + FrameRect(Canvas.Handle, ARect, GetSysColorBrush(COLOR_BTNSHADOW)) + else + DrawBackgroundFrameRect(BarEditControl, Canvas.Handle, ARect, BarEditControl.Parent.BkBrush, + IsTransparent and BarEditControl.FNonRecent); + InflateRect(ARect, -1, -1); + end; +end; + +procedure TdxBarFlatPainter.EditControlDrawSelectionFrame(const ADrawParams: TdxBarEditLikeControlDrawParams; const ARect: TRect); +begin + inherited; + ExcludeFrameRegion(ADrawParams.Canvas, ARect, cxRectInflate(ARect, -1, -1)); +end; + +class function TdxBarFlatPainter.EditControlCaptionRightIndentIsOpaque( + const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; +begin + with ADrawParams do + Result := (PaintType = ptMenu) and (DrawSelected or BarItemControl.FNonRecent); +end; + +class function TdxBarFlatPainter.EditControlCaptionRelativeLeftIndent(const ADrawParams: TdxBarEditLikeControlDrawParams): Integer; +begin + Result := SubMenuControlGetItemTextIndent(ADrawParams) - ADrawParams.BarItemControl.Parent.GetIconAreaSize; +end; + +class function TdxBarFlatPainter.EditControlCaptionAbsoluteLeftIndent(const ADrawParams: TdxBarEditLikeControlDrawParams): Integer; +begin + Result := 6; +end; + +class function TdxBarFlatPainter.EditControlCaptionRightIndent: Integer; +begin + Result := 5; +end; + +class function TdxBarFlatPainter.EditControlSubMenuGlyphIndents(const ADrawParams: TdxBarEditLikeControlDrawParams): TRect; +begin + Result := Rect(7, 0, 0, 0); +end; + +class function TdxBarFlatPainter.EditControlGetRightCaptionIndentBrush(ABarEditControl: TdxBarCustomEditControl): HBRUSH; +begin + Result := ABarEditControl.CaptionBkBrush; +end; + +class function TdxBarFlatPainter.EditControlGlyphIsDrawSelected(ABarEditControl: TdxBarCustomEditControl): Boolean; +begin + Result := ABarEditControl.DrawSelected and (ABarEditControl.GetPaintType = ptMenu) +end; + +class function TdxBarFlatPainter.HasEditControlExternalFrame( + APaintType: TdxBarPaintType; ASelected: Boolean): Boolean; +begin + Result := ASelected and (APaintType = ptMenu); +end; + +class procedure TdxBarFlatPainter.SysPanelDraw(AHandle: HWND; AllowResizing, + MouseAboveCloseButton, CloseButtonIsTracking: Boolean; var CloseButtonRect, + GripRect: TRect; Corner: TdxCorner); +begin + dxBarPopupNCPaint(AHandle, AllowResizing, True, MouseAboveCloseButton, + CloseButtonIsTracking, CloseButtonRect, GripRect, Corner); +end; + +class function TdxBarFlatPainter.IsDateNavigatorFlat: Boolean; +begin + Result := True; +end; + +procedure TdxBarFlatPainter.DateNavigatorDrawButton(ABarItem: TdxBarItem; + DC: HDC; R: TRect; const ACaption: string; APressed: Boolean); +begin + with R do + begin + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNSHADOW)); + InflateRect(R, -1, -1); + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + InflateRect(R, -1, -1); + end; + DateNavigatorDrawButtonCaption(DC, R, 0, ACaption, True); +end; + +procedure TdxBarFlatPainter.SpinEditControlDrawButton(const ADrawParams: TdxBarSpinEditDrawParams; ARect: TRect; AButtonIndex: Integer); +var + AArrowPos: TPoint; +begin + with ADrawParams do + begin + FrameAndFillRect(BarEditControl, Canvas.Handle, ARect, Enabled, DrawSelected, + ActiveButtonIndex = AButtonIndex); + AArrowPos := GetSpinEditArrowPos(ADrawParams, ARect, AButtonIndex); + DrawSpinEditArrow(ADrawParams, AArrowPos, AButtonIndex); + end; +end; + +class function TdxBarFlatPainter.ContainerControlSubMenuOffset: Integer; +begin + Result := 2 + 1 + 6; +end; + +function TdxBarFlatPainter.InPlaceSubItemControlIsFlatItemText(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams): Boolean; +begin + Result := inherited InPlaceSubItemControlIsFlatItemText(ADrawParams) and IsFlatItemTextForMenu; +end; + +function TdxBarFlatPainter.InPlaceSubItemControlIsArrowSelected(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams): Boolean; +begin + Result := not ADrawParams.DrawSelected or IsHighContrastWhite; +end; + +function TdxBarFlatPainter.GetBorderSize: Integer; +begin + Result := 1; +end; + +procedure TdxBarFlatPainter.DrawGlyphBorder(ABarItemControl: TdxBarItemControl; + ADC: HDC; ABrush: HBRUSH; ANeedBorder: Boolean; R: TRect; APaintType: TdxBarPaintType; + AGlyphEmpty, ASelected, ADowned, ADrawDowned, ADroppedDown, AIsSplit: Boolean); +begin + if ADroppedDown then + BarDrawBarControlOwnerBorder(ABarItemControl.Parent, ADC, R, ABarItemControl, ABarItemControl.OwnedBarControl) + else + if ADowned or (ASelected and (APaintType <> ptMenu)) then + FrameFlatSelRect(ADC, R) + else + if ANeedBorder then + DrawBackgroundFrameRect(ABarItemControl, ADC, R, ABrush, ASelected or ADowned or + ADrawDowned or ABarItemControl.FNonRecent or ABarItemControl.IsBkColorAssigned); +end; + +procedure TdxBarFlatPainter.DrawGlyphCheckMark(ABarItemControl: TdxBarItemControl; + DC: HDC; X, Y, DoubleSize: Integer); +//const +// Colors: array[Boolean] of TColor = (clBlack, clWhite); +var + OffsetY, I: Integer; + + procedure DrawOneMark; + begin + with ABarItemControl.Canvas do + begin + MoveTo(X + DoubleSize * 1, Y + OffsetY + DoubleSize * 2); + LineTo(X + DoubleSize * 3, Y + OffsetY + DoubleSize * 4); + LineTo(X + DoubleSize * 8, Y + OffsetY - DoubleSize * 1); + end; + Inc(OffsetY); + end; + +begin + with ABarItemControl.Canvas do + if ABarItemControl.Enabled then + begin + OffsetY := 0; + if IsHighContrastWhite or IsHighContrast2 then + Pen.Color := clWhite + else{ + if IsHighContrast2 then + Pen.Color := clBlack + else} + Pen.Color := clBlack; +// Pen.Color := Colors[GetSysColor(COLOR_BTNFACE) = 0]; + for I := 1 to 2 * DoubleSize do DrawOneMark; + end + else + begin + OffsetY := 1; + Pen.Color := GetSysColor(COLOR_BTNSHADOW); + for I := 1 to 2 * DoubleSize do DrawOneMark; + end; +end; + +class procedure TdxBarFlatPainter.DrawFrameRect(ABarItemControl: TdxBarItemControl; + ADC: HDC; const ARect: TRect; ABrush: HBRUSH; APaintType: TdxBarPaintType; ASelected, ADowned: Boolean); +begin + if (APaintType = ptMenu) or ASelected or ADowned then + if (APaintType = ptMenu) and not ASelected then + FrameRect(ADC, ARect, GetSysColorBrush(COLOR_BTNSHADOW)) + else + FrameFlatSelRect(ADC, ARect) + else + FrameRect(ADC, ARect, ABarItemControl.Parent.BkBrush); +end; + +class procedure TdxBarFlatPainter.FrameFlatSelRect(DC: HDC; const R: TRect); +begin + if IsHighContrastBlack or IsHighContrast2 then + FrameRectByColor(DC, R, clHighlightText) + else + dxBar.FrameFlatSelRect(DC, R); +end; + +class function TdxBarFlatPainter.GetToolbarBrush(ABarItemControl: TdxBarItemControl): HBRUSH; +begin + Result := ABarItemControl.BarManager.FlatToolbarsBrush; +end; + +class function TdxBarFlatPainter.BarCaptionBkColor(ABarControl: TdxBarControl; + AMainFormActive: Boolean): COLORREF; +begin + Result := inherited BarCaptionBkColor(ABarControl, False); +end; + +class function TdxBarFlatPainter.BarMarkArrowColor(ABarControl: TdxBarControl; + AState: TdxBarMarkState): COLORREF; +begin + if AState <> msNone then + Result := GetSysColor(COLOR_BTNTEXT) + else + Result := inherited BarMarkArrowColor(ABarControl, AState); +end; + +procedure TdxBarFlatPainter.BarDrawMarkBackground(ABarControl: TdxBarControl; + DC: HDC; ItemRect: TRect; AToolbarBrush: HBRUSH); +begin + if ABarControl.MarkDrawState = msPressed then + BarDrawBarControlOwner(ABarControl, DC, ItemRect, ABarControl.FQuickPopup) + else + begin + if ABarControl.MarkDrawState = msNone then + FrameRect(DC, ItemRect, AToolbarBrush) + else + FrameFlatSelRect(DC, ItemRect); + InflateRect(ItemRect, -1, -1); + if ABarControl.MarkDrawState = msSelected then + begin + AToolbarBrush := ABarControl.ToolbarSelBrush; + FillRect(DC, ItemRect, AToolbarBrush); + end + else + ABarControl.FillBackground(DC, ItemRect, AToolbarBrush, clNone, True); + InflateRect(ItemRect, 1, 1); + end; +end; + +class procedure TdxBarFlatPainter.BarOffsetFloatingBarCaption(ABarControl: TdxBarControl; + var X: Integer; var R: TRect); +begin + Inc(X, 2); + R.Right := ABarControl.MarkNCRect.Left; +end; + +class function TdxBarFlatPainter.GetDrawMarkElementColor(ABarControl: TdxBarControl): Integer; +begin + if IsHighContrastWhite and (ABarControl.MarkDrawState = msSelected) then + Result := COLOR_BTNFACE + else + Result := inherited GetDrawMarkElementColor(ABarControl); +end; + +procedure TdxBarFlatPainter.SubMenuControlDrawNonRecentGroupSeparator(ABarSubMenuControl: TdxBarSubMenuControl; ACanvas: TcxCanvas; AArrowDirection: TcxArrowDirection); +begin +// do nothing +end; + +procedure TdxBarFlatPainter.SubMenuControlDrawMarkSelection( + ABarSubMenuControl: TdxBarSubMenuControl; ADC: HDC; const AMarkRect: TRect); +begin + FrameFlatSelRect(ADC, AMarkRect); + DrawBackground(ABarSubMenuControl.BottomItemControl, ADC, cxRectInflate(AMarkRect, -1, -1), ABarSubMenuControl.ToolbarSelBrush, True); +end; + +procedure TdxBarFlatPainter.DrawSpinEditArrow(const ADrawParams: TdxBarSpinEditDrawParams; AArrowPos: TPoint; AButtonIndex: Integer); +var + AColor: Integer; +begin + with ADrawParams do + begin + if Enabled then + begin + if IsHighContrastWhite and DrawSelected then + AColor := COLOR_BTNFACE + else + AColor := COLOR_BTNTEXT; + end + else + AColor := COLOR_BTNSHADOW; + + SpinEditControlDrawArrowByPoints(ADrawParams, AArrowPos, AColor, AButtonIndex); + end; +end; + +{ TdxBarOffice11Painter } + +procedure TdxBarOffice11Painter.DrawItemBackgroundInSubMenu(const ADrawParams: TdxBarButtonLikeControlDrawParams; R: TRect); +var + AIconRect: TRect; + AOpaque: Boolean; + ABrush: HBRUSH; + ADC: HDC; + I: Integer; +begin + with ADrawParams do + begin + AIconRect := SubMenuControlGetItemIconRect(R, BarItemControl.Parent.IconAreaSize); + ADC := Canvas.Handle; + + AOpaque := DrawSelected; + if DrawSelected then + FrameFlatSelRect(ADC, R) + else + begin + I := R.Left + 1 + BarItemControl.Parent.IconAreaSize; + + ABrush := BarItemControl.Parent.BkBrush; + DrawBackground(BarItemControl, ADC, Rect(R.Left, R.Top, I, R.Top + 1), ABrush, AOpaque); + DrawBackground(BarItemControl, ADC, Rect(R.Left, R.Bottom - 1, I, R.Bottom), ABrush, AOpaque); + DrawBackground(BarItemControl, ADC, Rect(R.Left, R.Top + 1, R.Left + 1, R.Bottom - 1), ABrush, AOpaque); + + ABrush := BarItemControl.Parent.BkBrush; + DrawBackground(BarItemControl, ADC, Rect(I, R.Top, R.Right, R.Top + 1), ABrush, AOpaque); + DrawBackground(BarItemControl, ADC, Rect(I, R.Bottom - 1, R.Right, R.Bottom), ABrush, AOpaque); + DrawBackground(BarItemControl, ADC, Rect(R.Right - 1, R.Top + 1, R.Right, R.Bottom - 1), ABrush, AOpaque); + end; + InflateRect(R, -1, -1); + + if DrawSelected then + ABrush := BarItemControl.Parent.ToolbarSelBrush + else + ABrush := BarItemControl.Parent.BkBrush; + R.Left := AIconRect.Right + 2; + DrawBackground(BarItemControl, ADC, Rect(AIconRect.Right, AIconRect.Top, R.Left, AIconRect.Bottom), ABrush, AOpaque); + if AIconRect.Top > R.Top then + DrawBackground(BarItemControl, ADC, Rect(AIconRect.Left, R.Top, R.Left, AIconRect.Top), ABrush, AOpaque); + if AIconRect.Bottom < R.Bottom then + DrawBackground(BarItemControl, ADC, Rect(AIconRect.Left, AIconRect.Bottom, R.Left, R.Bottom), ABrush, AOpaque); + + if DrawSelected then + ABrush := BarItemControl.Parent.ToolbarSelBrush + else + ABrush := BarItemControl.Parent.BkBrush; + DrawBackground(BarItemControl, ADC, R, ABrush, AOpaque); + end; +end; + +class procedure TdxBarOffice11Painter.FrameAndFillRect(ABarItemControl: TdxBarItemControl; + DC: HDC; var R: TRect; Enabled, Selected, Pressed: Boolean); +var + Brush: HBRUSH; +begin + if Selected then + begin + FrameFlatSelRect(DC, R); + if Pressed then + Brush := ABarItemControl.Parent.ToolbarDownedSelBrush + else + Brush := ABarItemControl.Parent.ToolbarSelBrush; + end + else + begin + if Enabled then + begin + FrameRect(DC, R, ABarItemControl.Parent.BkBrush); + Brush := dxOffice11OwnerControlDownedBrush; + end + else + begin + FrameRectByColor(DC, R, dxOffice11TextDisabledColor); + Brush := GetSysColorBrush(COLOR_BTNFACE); + end; + end; + InflateRect(R, -1, -1); + FillRect(DC, R, Brush); +end; + +class function TdxBarOffice11Painter.IsFlatGlyphImage: Boolean; +begin + Result := False; +end; + +class function TdxBarOffice11Painter.IsGlyphImageHasShadow: Boolean; +begin + Result := False; +end; + +class function TdxBarOffice11Painter.IsItemTextSelectedInverted: Boolean; +begin + if IsXPStandardScheme then + Result := False + else + Result := inherited IsItemTextSelectedInverted; +end; + +class function TdxBarOffice11Painter.StaticBorderBrush(ABarItemControl: TdxBarItemControl; + ABorderStyle: TdxBarStaticBorderStyle): HBRUSH; +begin + Result := dxOffice11StaticBorderBrush; +end; + +function TdxBarOffice11Painter.BeforeFingersSize: Integer; +begin + Result := inherited BeforeFingersSize + BarBeforeFingersIndent; +end; + +class function TdxBarOffice11Painter.BorderSizeX: Integer; +begin + Result := 3; +end; + +class function TdxBarOffice11Painter.BorderSizeY: Integer; +begin + Result := 3; +end; + +class function TdxBarOffice11Painter.EmptyFingersSize: Integer; +begin + Result := 2; +end; + +procedure TdxBarOffice11Painter.DockControlFillBackground(ADockControl: TdxDockControl; + DC: HDC; ADestR, ASourceR, AWholeR: TRect; ABrush: HBRUSH; AColor: TColor); + + procedure FillBackgroundTempBitmap(ABitmap: TBitmap); + var + AColor1, AColor2: TColor; + begin + with AWholeR do + begin + ABitmap.Width := Right - Left; + ABitmap.Height := Bottom - Top; + end; + GetDockColors(ADockControl, AColor1, AColor2); + FillGradientRect(ABitmap.Canvas.Handle, AWholeR, AColor1, AColor2, True); + end; + +begin + if ADockControl.BackgroundTempBitmap.Empty then + FillBackgroundTempBitmap(ADockControl.BackgroundTempBitmap); + cxBitBlt(DC, ADockControl.BackgroundTempBitmap.Canvas.Handle, ADestR, ASourceR.TopLeft, SRCCOPY); +end; + +class function TdxBarOffice11Painter.IsNativeBackground: Boolean; +begin + Result := True; +end; + +class function TdxBarOffice11Painter.BarControlOwnerBrush(ABarManager: TdxBarManager): HBRUSH; +begin + Result := dxOffice11OwnerControlDownedBrush; +end; + +class procedure TdxBarOffice11Painter.BarDrawBarControlOwnerFrame(ACustomBarControl: TCustomdxBarControl; + DC: HDC; R: TRect); +begin + FrameRect(DC, R, dxOffice11DropDownBorderBrush1); +end; + +class procedure TdxBarOffice11Painter.BarDrawBarControlOwnerLink(ACustomBarControl: TCustomdxBarControl; + DC: HDC; R, ALinkR: TRect; ABarItemControl: TdxBarItemControl); +var + AColor: TColor; +begin + if (ABarItemControl = nil) or not IsMenuGradient(ABarItemControl) then + inherited + else + begin + if (ALinkR.Right - ALinkR.Left) > (ALinkR.Bottom - ALinkR.Top) then // Horz + begin + if ALinkR.Top > ((R.Bottom + R.Top) div 2) then // bottom + AColor := dxOffice11MenuDownedColor2 + else + AColor := dxOffice11MenuDownedColor1; + end + else + begin + if ALinkR.Left > ((R.Right + R.Left) div 2) then // right + AColor := dxOffice11MenuDownedColor2 + else + AColor := dxOffice11MenuDownedColor1; + end; + FillRectByColor(DC, ALinkR, AColor); + end; +end; + +procedure TdxBarOffice11Painter.BarDrawDockedBackground(ABarControl: TdxBarControl; + DC: HDC; ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); +var + AWholeR: TRect; + AClipRgn: HRGN; + AClipRgnExists: Boolean; +begin + if (ABarControl.Bar.BorderStyle = bbsNone) or + (ABarControl.IsMainMenu or ABarControl.IsBackgroundBitmap) then + inherited + else + begin + SaveClipRgn(DC, AClipRgn, AClipRgnExists); + with ADestR do + IntersectClipRect(DC, Left, Top, Right, Bottom); + + AWholeR := GetBarGradientRect(ABarControl); + OffsetRect(AWholeR, -(ASourceR.Left - ADestR.Left), -(ASourceR.Top - ADestR.Top)); // NC offset + + FillTubeGradientRect(DC, AWholeR, dxOffice11ToolbarsColor1, dxOffice11ToolbarsColor2, + (ABarControl is TdxBarControl) and TdxBarControl(ABarControl).Vertical); + RestoreClipRgn(DC, AClipRgn, AClipRgnExists); + end; +end; + +procedure TdxBarOffice11Painter.BarDrawFloatingBackground(ABarControl: TCustomdxBarControl; + DC: HDC; ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); +var + R: TRect; + AClipRgn: HRGN; + AClipRgnExists: Boolean; +begin + if ABarControl.IsInternal or ABarControl.IsBackgroundBitmap then + inherited + else + begin + R := ABarControl.ClientRect; + SaveClipRgn(DC, AClipRgn, AClipRgnExists); + with ADestR do + IntersectClipRect(DC, Left, Top, Right, Bottom); + FillGradientRect(DC, R, dxOffice11ToolbarsColor1, + dxOffice11ToolbarsColor2, False); + RestoreClipRgn(DC, AClipRgn, AClipRgnExists); + end; +end; + +class procedure TdxBarOffice11Painter.BarDrawOwnerLink(ABarControl: TCustomdxBarControl; + DC: HDC); +var + R: TRect; +begin + R := ABarControl.OwnerLinkBounds[False]; + if not IsRectEmpty(R) then + FillRect(DC, R, dxOffice11DropDownBorderBrush2); +end; + +function TdxBarOffice11Painter.BarHasShadow(ABarControl: TCustomdxBarControl): Boolean; +begin + Result := ABarControl.IsPopup; +end; + +class function TdxBarOffice11Painter.BarToolbarBrush(ABarControl: TCustomdxBarControl): HBRUSH; +begin + // TODO: ? + Result := dxOffice11MenuBrush; +end; + +class function TdxBarOffice11Painter.BarToolbarBrushEx(ABarControl: TdxBarControl): HBRUSH; +begin + // TODO + if not (ABarControl.IsMainMenu or ABarControl.Bar.IsStatusBar) then + Result := inherited BarToolbarBrushEx(ABarControl) + else + Result := GetSysColorBrush(COLOR_BTNFACE); +end; + +class function TdxBarOffice11Painter.BarToolbarDownedBrush(ABarControl: TCustomdxBarControl): HBRUSH; +begin + Result := dxOffice11DownedBrush; +end; + +class function TdxBarOffice11Painter.BarToolbarDownedSelBrush(ABarControl: TCustomdxBarControl): HBRUSH; +begin + Result := dxOffice11DownedSelectedBrush; +end; + +class function TdxBarOffice11Painter.BarToolbarSelBrush(ABarControl: TCustomdxBarControl): HBRUSH; +begin + Result := dxOffice11ToolbarSelectedBrush; +end; + +function TdxBarOffice11Painter.ComboBoxArrowWidth(ABarControl: TCustomdxBarControl; cX: Integer): Integer; +begin + Result := 13; +end; + +class function TdxBarOffice11Painter.BarBeforeFingersIndent: Integer; +begin + Result := 2; +end; + +procedure TdxBarOffice11Painter.BarBorderPaintSizes(ABarControl: TdxBarControl; + var R: TRect); +begin + BarBorderSizes(ABarControl.Bar, ABarControl.DockingStyle, R); +end; + +procedure TdxBarOffice11Painter.BarBorderSizes(ABar: TdxBar; AStyle: TdxBarDockingStyle; + var R: TRect); +begin + if ABar.IsMainMenu then +// SetRectEmpty(R) + begin + if AStyle in [dsTop, dsBottom] then + R := Rect(0, 2, 0, 2) + else + R := Rect(2, 0, 2, 0); + end + else + inherited; +end; + +procedure TdxBarOffice11Painter.BarDrawBeginGroup(ABarControl: TCustomdxBarControl; + DC: HDC; ABeginGroupRect: TRect; AToolbarBrush: HBRUSH; AHorz: Boolean); +begin + ABarControl.FillBackground(DC, ABeginGroupRect, AToolbarBrush, clNone, True); + with ABeginGroupRect do + if AHorz then + begin + InflateRect(ABeginGroupRect, 0, -BarBeginGroupSideSize); + FillRect(DC, Rect(Left + 3, Top, Right - 4, Top + 1), + dxOffice11BarSeparatorBrush1); + FillRect(DC, Rect(Left + 3 + 1, Top + 1, Right - 4 + 1, Top + 2), + dxOffice11BarSeparatorBrush2); + end + else + begin + InflateRect(ABeginGroupRect, -BarBeginGroupSideSize, 0); + FillRect(DC, Rect(Left, Top + 3, Left + 1, Bottom - 4), + dxOffice11BarSeparatorBrush1); + FillRect(DC, Rect(Left + 1, Top + 3 + 1, Left + 1 + 1, Bottom - 4 + 1), + dxOffice11BarSeparatorBrush2); + end; +end; + +class procedure TdxBarOffice11Painter.BarDrawCaptionElement(ABarControl: TdxBarControl; + DC: HDC; R: TRect; AState: TdxBarMarkState); +var + AColor: TColor; +begin + if AState <> msNone then + begin + Office11FrameSelectedRect(DC, R); + InflateRect(R, -1, -1); + if AState = msSelected then + AColor := dxOffice11SelectedColor1 + else + AColor := dxOffice11SelectedColor2; + FillRectByColor(DC, R, AColor); + end + else + FillRectByColor(DC, R, ABarControl.CaptionBkColor); +end; + +procedure TdxBarOffice11Painter.BarDrawDockedBarBorder(ABarControl: TdxBarControl; + DC: HDC; R: TRect; AToolbarBrush: HBRUSH); +var + B1: HBRUSH; + AMarkColor1, AMarkColor2, AColor6, AColor9: TColor; + + procedure DrawFinger(ARect: TRect); + begin + // TODO: ! +// if ABarControl.Bar.NotDocking = [Low(TdxBarDockingStyle)..High(TdxBarDockingStyle)] then Exit; + InflateRect(ARect, -2, -2); + with ARect do + if ABarControl.Horizontal then + begin + Inc(Left, BeforeFingersSize); + Right := Left + GripperSize(ABarControl); + InflateRect(ARect, 0, -3); + end + else + begin + Inc(Top, BeforeFingersSize); + Bottom := Top + GripperSize(ABarControl); + InflateRect(ARect, -3, 0); + end; + BarDrawFingerElements(ABarControl, DC, ARect, ABarControl.Horizontal); + end; + + procedure FillParentBackground(DC: HDC; const R: TRect); + begin + BarFillParentBackground(ABarControl, DC, R, R, AToolbarBrush, clNone); + end; + + procedure FillBackground(DC: HDC; const R: TRect); + begin + BarDrawDockedBackground(ABarControl, DC, R, R, AToolbarBrush, clNone); + end; + + procedure DrawLeftBorder(var ARect: TRect); + var + ADockColor, AC11pxColor, AColor1, AColor2, AColor: TColor; + R: TRect; + begin + GetDockColors(ABarControl.DockControl, AColor1, AColor2); + with ARect do + begin + if ABarControl.Horizontal then + begin + FillParentBackground(DC, Rect(Left, Top, Left + BarBeforeFingersIndent, Bottom)); + Inc(ARect.Left, BarBeforeFingersIndent); + FillParentBackground(DC, Rect(Left, Top, Right, Top + 1)); + Inc(ARect.Top); + // only for Horizontal + FillParentBackground(DC, Rect(Left, Bottom - 2, Left + 1, Bottom - 1)); + FillParentBackground(DC, Rect(Left + 1, Bottom - 1, Left + 2, Bottom)); + // left + FillBackground(DC, Rect(Left, Top + 2, Left + 1, Bottom - 3)); + // edge pixels + SetPixel(DC, Left + 1, Bottom - 3, dxOffice11BarBorderColors[2]); + // #3 = (Dock, #2, 50%) + ADockColor := GetGradientColorRect(ABarControl.DockControl.ClientRect, + ABarControl.PointBarToDock(Point(Left, Top)).X, AColor1, AColor2, True); + AColor := GetMiddleRGB(ADockColor, dxOffice11BarBorderColors[2], 50); + SetPixel(DC, Left, Bottom - 3, ColorToRGB(AColor)); + SetPixel(DC, Left + 1, Bottom - 2, ColorToRGB(AColor)); + // #4 = Dock, C1 + 1px + ADockColor := GetGradientColorRect(ABarControl.DockControl.ClientRect, + ABarControl.PointBarToDock(Point(Left, Top)).X, AColor1, AColor2, True); + AC11pxColor := GetGradientColorRect(GetBarGradientRect(ABarControl), + Top + 1, dxOffice11ToolbarsColor1, + dxOffice11ToolbarsColor2, False); + AColor := GetMiddleRGB(ADockColor, AC11pxColor, 50); + SetPixel(DC, Left, Top + 1, AColor); + SetPixel(DC, Left + 1, Top, AColor); + end + else + begin + FillParentBackground(DC, Rect(Left, Top, Right, Top + BarBeforeFingersIndent)); + Inc(ARect.Top, BarBeforeFingersIndent); + FillParentBackground(DC, Rect(Left, Top, Left + 1, Bottom)); + Inc(ARect.Left); + + R := Rect(Left, Top + 2, Left + 1, Bottom - 2); + Dec(R.Bottom, ABarControl.GetMarkSize); + FillBackground(DC, R); + + FillBackground(DC, Rect(Left + 2, Top, Right - 2, Top + 1)); + // edge pixels + SetPixel(DC, Right - 2, Top + 1, dxOffice11BarBorderColors[2]); + // #3 = (Dock, #2, 50%) + ADockColor := GetGradientColorRect(ABarControl.DockControl.ClientRect, + ABarControl.PointBarToDock(Point(Left, Top)).X, AColor1, AColor2, True); + AColor := GetMiddleRGB(ADockColor, dxOffice11BarBorderColors[2], 50); + SetPixel(DC, Right - 2, Top, ColorToRGB(AColor)); + SetPixel(DC, Right - 1, Top + 1, ColorToRGB(AColor)); + // #4 = Dock, C1 + 1px + ADockColor := GetGradientColorRect(ABarControl.DockControl.ClientRect, + ABarControl.PointBarToDock(Point(Left, Top)).X, AColor1, AColor2, True); + AC11pxColor := GetGradientColorRect(GetBarGradientRect(ABarControl), + Left, dxOffice11ToolbarsColor1, + dxOffice11ToolbarsColor2, True); + AColor := GetMiddleRGB(ADockColor, AC11pxColor, 50); + SetPixel(DC, Left, Top + 1, AColor); + SetPixel(DC, Left + 1, Top, AColor); + end; + end; + end; + + procedure DrawTopBorder(ARect: TRect); + var + ADockColor, AC11pxColor, AColor1, AColor2, AColor: TColor; + R: TRect; + begin + GetDockColors(ABarControl.DockControl, AColor1, AColor2); + with ARect do + begin + if ABarControl.Horizontal then + begin + R := Rect(Left + 2, Top, Right - 2, Top + 1); + Dec(R.Right, ABarControl.GetMarkSize); + FillBackground(DC, R); + + ADockColor := GetGradientColorRect(ABarControl.DockControl.ClientRect, + ABarControl.PointBarToDock(Point(Right, Top)).X, AColor1, AColor2, True); + + if ABarControl.MarkExists then + begin + // #6 + SetPixel(DC, Right - ABarControl.MarkSize - 1, Top, AColor6); + SetPixel(DC, Right - 2, Top + 1, AColor6); + // #5 = #6, C1+1px + AC11pxColor := GetGradientColorRect(GetBarGradientRect(ABarControl), + Top + 1, dxOffice11ToolbarsColor1, + dxOffice11ToolbarsColor2, False); + AColor := GetMiddleRGB(AColor6, AC11pxColor, 50); + SetPixel(DC, Right - ABarControl.MarkSize - 2, Top, AColor); + // #7 = #6, Dock + AColor := GetMiddleRGB(AColor6, ADockColor, 50); + SetPixel(DC, Right - 2, Top, AColor); + SetPixel(DC, Right - 1, Top + 1, AColor); + end + else + begin + // #5 = Dock, C1 + 1px + AC11pxColor := GetGradientColorRect(GetBarGradientRect(ABarControl), + Top + 1, dxOffice11ToolbarsColor1, + dxOffice11ToolbarsColor2, False); + AColor := GetMiddleRGB(ADockColor, AC11pxColor, 50); + SetPixel(DC, Right - 2, Top, AColor); + SetPixel(DC, Right - 1, Top + 1, AColor); + end; + end + else + begin + ADockColor := GetGradientColorRect(ABarControl.DockControl.ClientRect, + ABarControl.PointBarToDock(Point(Left, Bottom)).X, AColor1, AColor2, True); + if ABarControl.MarkExists then + begin + // #5 = #6, C1+1px + AC11pxColor := GetGradientColorRect(GetBarGradientRect(ABarControl), + Left + 1, dxOffice11ToolbarsColor1, + dxOffice11ToolbarsColor2, True); + AColor := GetMiddleRGB(AColor6, AC11pxColor, 50); + SetPixel(DC, Left, Bottom - ABarControl.MarkSize - 2, AColor); + // #6 + SetPixel(DC, Left, Bottom - ABarControl.MarkSize - 1, AColor6); + SetPixel(DC, Left + 1, Bottom - 2, AColor6); + // #7 = #6, Dock + AColor := GetMiddleRGB(AColor6, ADockColor, 50); + SetPixel(DC, Left, Bottom - 2, AColor); + SetPixel(DC, Left + 1, Bottom - 1, AColor); + end + else + begin + // #5 = Dock, C1 + 1px + AC11pxColor := GetGradientColorRect(GetBarGradientRect(ABarControl), + Left + 1, dxOffice11ToolbarsColor1, + dxOffice11ToolbarsColor2, True); + AColor := GetMiddleRGB(ADockColor, AC11pxColor, 50); + SetPixel(DC, Left, Bottom - 2, AColor); + SetPixel(DC, Left + 1, Bottom - 1, AColor); + end; + end; + end; + end; + + procedure DrawRightBorder(ARect: TRect); + var + R: TRect; + AClipRgn: HRGN; + AClipRgnExists: Boolean; + ADockColor, AColor1, AColor2, AColor: TColor; + begin + with ARect do + begin + if ABarControl.Horizontal then + begin + if not ABarControl.MarkExists then + begin + R := Rect(Right - 2, Top + 1, Right - 1, Bottom - 2); + FillBackground(DC, R); + end; + end + else + begin + R := Rect(Right - 2, Top + 2, Right - 1, Bottom - 2); + Dec(R.Bottom, ABarControl.GetMarkSize); + FillBackground(DC, R); + end; + + if ABarControl.MarkExists then + begin + SaveClipRgn(DC, AClipRgn, AClipRgnExists); + if ABarControl.Horizontal then + begin + IntersectClipRect(DC, Right - ABarControl.MarkSize - 2 + 2, Top, Right - 2, Top + 1); + AddClipRect(DC, Rect(Right - 2, Top + 2, Right, Bottom - 2)); + AddClipRect(DC, Rect(Right - ABarControl.MarkSize - 1, Bottom - 1, Right - 2, Bottom)); + AddClipRect(DC, Rect(Right - ABarControl.MarkSize, Bottom - 2, Right - 1, Bottom - 1)); + R := Rect(Right - ABarControl.MarkSize - 1, Top, Right, Bottom); + end + else + begin + IntersectClipRect(DC, Left, Bottom - ABarControl.MarkSize, Left + 1, Bottom - 2); + AddClipRect(DC, Rect(Left + 2, Bottom - 2, Right - 2, Bottom)); + AddClipRect(DC, Rect(Right - 2, Bottom - ABarControl.MarkSize, Right - 1, Bottom - 1)); + AddClipRect(DC, Rect(Right - 1, Bottom - ABarControl.MarkSize - 1, Right, Bottom - 2)); + R := Rect(Left, Bottom - ABarControl.MarkSize - 1, Right, Bottom); + end; + FillTubeGradientRect(DC, R, AMarkColor1, AMarkColor2, not ABarControl.Horizontal); + RestoreClipRgn(DC, AClipRgn, AClipRgnExists); + // #8 = B, Dock + GetDockColors(ABarControl.DockControl, AColor1, AColor2); + ADockColor := GetGradientColorRect(ABarControl.DockControl.ClientRect, + ABarControl.PointBarToDock(Point(Right, Bottom)).X, AColor1, AColor2, True); + AColor := GetMiddleRGB(AMarkColor2, ADockColor, 50); + SetPixel(DC, Right - 1, Bottom - 2, AColor); + SetPixel(DC, Right - 2, Bottom - 1, AColor); + end + else + begin + if ABarControl.Horizontal then + FillBackground(DC, Rect(Right - 1, Top + 2, Right, Bottom - 1)) + else + FillBackground(DC, Rect(Left + 2, Bottom - 1, Right - 1, Bottom)); + end; + end; + end; + + procedure DrawBottomBorder(ARect: TRect); + var + ADockColor, AColor1, AColor2, AColor: TColor; + R: TRect; + begin + with ARect do + begin + if ABarControl.Horizontal then + begin + R := Rect(Left + 2, Bottom - 2, Right - 2, Bottom - 1); + Dec(R.Right, ABarControl.GetMarkSize); + FillBackground(DC, R); + end + else + begin + if not ABarControl.MarkExists then + begin + R := Rect(Left + 1, Bottom - 2, Right - 2, Bottom - 1); + FillBackground(DC, R); + end; + end; + + if ABarControl.MarkExists then + begin + // #9 = B, #2 + AColor := GetMiddleRGB(AMarkColor2, dxOffice11BarBorderColors[2], 50); + if ABarControl.Horizontal then + begin + SetPixel(DC, Right - 2 - ABarControl.MarkSize, Bottom - 1, AColor); + SetPixel(DC, Right - 1 - ABarControl.MarkSize, Bottom - 2, AColor); + SetPixel(DC, Right - 2 - ABarControl.MarkSize, Bottom - 2, dxOffice11BarBorderColors[2]); + FillRect(DC, Rect(Left + 2, Bottom - 1, Right - 2 - ABarControl.MarkSize, Bottom), B1); + end + else + begin + SetPixel(DC, Right - 2, Bottom - 1 - ABarControl.MarkSize, AColor); + SetPixel(DC, Right - 1, Bottom - 2 - ABarControl.MarkSize, AColor); + SetPixel(DC, Right - 2, Bottom - 2 - ABarControl.MarkSize, dxOffice11BarBorderColors[2]); + FillRect(DC, Rect(Right - 1, Top + 2, Right, Bottom - ABarControl.MarkSize - 2), B1); + end; + end + else + begin + // #9 = Dock, #2 + GetDockColors(ABarControl.DockControl, AColor1, AColor2); + ADockColor := GetGradientColorRect(ABarControl.DockControl.ClientRect, + ABarControl.PointBarToDock(Point(Right, Bottom)).X, AColor1, AColor2, True); + AColor := GetMiddleRGB(dxOffice11BarBorderColors[2], ADockColor, 50); + SetPixel(DC, Right - 2, Bottom - 1, AColor); + SetPixel(DC, Right - 1, Bottom - 2, AColor); + + SetPixel(DC, Right - 2, Bottom - 2, dxOffice11BarBorderColors[2]); + if ABarControl.Horizontal then + FillRect(DC, Rect(Left + 2, Bottom - 1, Right - 2, Bottom), B1) + else + FillRect(DC, Rect(Right - 1, Top + 2, Right, Bottom - 2), B1); + end; + end; + end; + + procedure DrawBorder(ARect: TRect); + begin + DrawLeftBorder(ARect); + DrawTopBorder(ARect); + DrawRightBorder(ARect); + DrawBottomBorder(ARect); + with ARect do + begin + FillParentBackground(DC, Rect(Left, Top, Left + 1, Top + 1)); + FillParentBackground(DC, Rect(Right - 1, Top, Right, Top + 1)); + FillParentBackground(DC, Rect(Left, Bottom - 1, Left + 1, Bottom)); + FillParentBackground(DC, Rect(Right - 1, Bottom - 1, Right, Bottom)); + end; + end; + + procedure DrawMainMenuBorder(ARect: TRect); + begin + with ARect do + if ABarControl.Horizontal then + begin + FillParentBackground(DC, Rect(Left, Top, Right, Top + 2)); + FillParentBackground(DC, Rect(Left, Bottom - 2, Right, Bottom)); + end + else + begin + FillParentBackground(DC, Rect(Left, Top, Left + 2, Bottom)); + FillParentBackground(DC, Rect(Right - 2, Top, Right, Bottom)); + end; + end; + +begin + B1 := CreateSolidBrush(dxOffice11BarBorderColors[1]); + GetMarkColors(ABarControl, AMarkColor1, AMarkColor2, AColor6, AColor9); + if ABarControl.IsMainMenu then + DrawMainMenuBorder(R) + else + if ABarControl.Bar.BorderStyle = bbsSingle then + DrawBorder(R); + if ABarControl.CanMoving then + DrawFinger(R); + DeleteObject(B1); +end; + +procedure TdxBarOffice11Painter.BarDrawFloatingBarBorder(ABarControl: TdxBarControl; + DC: HDC; R, CR: TRect; AToolbarBrush: HBRUSH); +var + I: Integer; + B1, B2: HBRUSH; +begin + if not ABarControl.IsInternal then + begin + B1 := CreateSolidBrush(dxOffice11BarFloatingBorderColor1); + B2 := CreateSolidBrush(dxOffice11BarFloatingBorderColor2); + FrameRect(DC, R, B1); + InflateRect(R, -1, -1); + FrameRect(DC, R, B1); + InflateRect(R, -1, -1); + FrameRect(DC, R, B2); + with R do + begin + FillRect(DC, Rect(Left, Top, Left + 1, Top + 1), B1); + FillRect(DC, Rect(Right - 1, Top, Right, Top + 1), B1); + FillRect(DC, Rect(Right - 1, Bottom - 1, Right, Bottom), B1); + FillRect(DC, Rect(Left, Bottom - 1, Left + 1, Bottom), B1); + end; + DeleteObject(B2); + DeleteObject(B1); + end + else + begin + FrameRect(DC, R, dxOffice11DropDownBorderBrush1); + for I := R.Left + 1 to CR.Left - 1 do + begin + InflateRect(R, -1, -1); + FrameRect(DC, R, AToolbarBrush); + end; + end; +end; + +procedure TdxBarOffice11Painter.BarDrawFloatingBarCaption(ABarControl: TdxBarControl; + DC: HDC; R, CR: TRect; AToolbarBrush: HBRUSH); +begin + AToolbarBrush := CreateSolidBrush(dxOffice11BarFloatingBorderColor3); + inherited; + DeleteObject(AToolbarBrush); +end; + +function TdxBarOffice11Painter.BarMarkRect(ABarControl: TdxBarControl): TRect; +begin + Result := inherited BarMarkRect(ABarControl); + if not IsSimpleMark(ABarControl) then + case ABarControl.DockingStyle of + dsTop, dsBottom: + begin + Dec(Result.Top, 1); + Inc(Result.Right, 2); + Inc(Result.Bottom, 1); + end; + dsLeft, dsRight: + begin + Dec(Result.Left, 1); + Inc(Result.Right, 1); + Inc(Result.Bottom, 2); + end; + end; +end; + +procedure TdxBarOffice11Painter.BarMarkRectInvalidate(ABarControl: TdxBarControl); +begin + inherited; + if ABarControl.DockingStyle <> dsNone then + SendMessage(ABarControl.Handle, WM_NCPAINT, 0, 0); +end; + +class function TdxBarOffice11Painter.SubMenuControlGetSeparatorColor: TColor; +begin + Result := dxOffice11BarSeparatorColor1; +end; + +class function TdxBarOffice11Painter.SubMenuControlToolbarItemsBrush(ABarSubMenuControl: TdxBarSubMenuControl): HBRUSH; +begin + Result := dxOffice11MenuBrush; +end; + +class function TdxBarOffice11Painter.SubMenuControlHasBand: Boolean; +begin + Result := True; +end; + +class function TdxBarOffice11Painter.SubMenuControlIsSingleMenuBorder(ABarSubMenuControl: TdxBarSubMenuControl): Boolean; +begin + Result := not ABarSubMenuControl.GetBackgroundBitmap.Empty or + (ABarSubMenuControl.BarSize <> 0); +end; + +class procedure TdxBarOffice11Painter.SubMenuControlOffsetDetachCaptionRect(ABarSubMenuControl: TdxBarSubMenuControl; + var R: TRect); +begin + InflateRect(R, -2, -4); +end; + +procedure TdxBarOffice11Painter.SubMenuControlCalcDrawingConsts(ACanvas: TcxCanvas; + ATextSize: Integer; out AMenuArrowWidth, AMarkSize: Integer); +begin + inherited; + AMarkSize := dxOffice11SubMenuExpandBitmap.Height + SubMenuControlMarkBorderSize; +// AMarkSize := ACanvas.TextHeight('0') + 5; // to scale +end; + +class function TdxBarOffice11Painter.SubMenuControlDetachCaptionAreaSize(ABarSubMenuControl: TdxBarSubMenuControl): Integer; +begin + Result := ABarSubMenuControl.DetachCaptionSize + 5; +end; + +procedure TdxBarOffice11Painter.SubMenuControlDrawBackground(ABarSubMenuControl: TdxBarSubMenuControl; + ACanvas: TcxCanvas; ARect: TRect; ABrush: HBRUSH; AColor: TColor); +var + W1: Integer; + W2: Integer; + AColor1, AColor2: TColor; +begin + if not ABarSubMenuControl.GetBackgroundBitmap.Empty then + inherited + else + begin + W1 := ABarSubMenuControl.GetIndent1; + W2 := ABarSubMenuControl.GetIndent2; + ACanvas.SaveClipRegion; + try + ACanvas.SetClipRegion(TcxRegion.Create(ARect), roIntersect); + with ARect do + begin + // fill + if ABarSubMenuControl.FNonRecent then + begin + AColor1 := dxOffice11MenuNonRecentIndentColor1; + AColor2 := dxOffice11MenuNonRecentIndentColor2; + end + else + begin + AColor1 := dxOffice11MenuIndentColor1; + AColor2 := dxOffice11MenuIndentColor2; + end; + FillTubeGradientRect(ACanvas.Handle, Rect(0, Top, W1, Bottom), AColor1, AColor2, True); + if W2 <> 0 then + FillRectByColor(ACanvas.Handle, Rect(W1, Top, W1 + W2, Bottom), AColor2); + if Right > (W1 + W2) then + FillRect(ACanvas.Handle, Rect(W1 + W2, Top, Right, Bottom), ABrush); + end; + finally + ACanvas.RestoreClipRegion; + end; + end; +end; + +procedure TdxBarOffice11Painter.SubMenuControlDrawBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); + + procedure DrawFlatBorder; + var + ARect: TRect; + begin + FrameRect(DC, R, dxOffice11DropDownBorderBrush1); + ARect := ABarSubMenuControl.OwnerLinkBounds[False]; + if not IsRectEmpty(ARect) then + FillRect(DC, ARect, dxOffice11MenuBrush); + end; + +begin + with R do + begin + DrawFlatBorder; + if ABarSubMenuControl.Detachable then + begin + InflateRect(R, -1, -1); + Bottom := Top + ABarSubMenuControl.DetachCaptionSize + 3 + 2; + FrameRect(DC, R, dxOffice11MenuBrush); + InflateRect(R, 0, -1); + FillRect(DC, Rect(Left, Top, Right, Top + 2), dxOffice11MenuBrush); + FillRect(DC, Rect(Left, Bottom - 1, Right, Bottom), dxOffice11MenuBrush); + SubMenuControlDrawDetachCaption(ABarSubMenuControl, DC, ABarSubMenuControl.DetachCaptionRect); + end; + end +end; + +procedure TdxBarOffice11Painter.SubMenuControlDrawClientBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; const R: TRect; ABrush: HBRUSH); +begin + if SubMenuControlIsSingleMenuBorder(ABarSubMenuControl) then + FrameRect(DC, R, dxOffice11MenuBrush) + else + with R do + begin + FillRect(DC, Rect(Left, Top, Right, Top + 1), dxOffice11MenuBrush); + FillRect(DC, Rect(Right - 1, Top, Right, Bottom), dxOffice11MenuBrush); + FillRect(DC, Rect(Left, Bottom - 1, Right, Bottom), dxOffice11MenuBrush); + // Indent + FillRectByColor(DC, Rect(Left, Top + 1, Left + 1, Bottom - 1), dxOffice11MenuIndentColor1); + end; +end; + +procedure TdxBarOffice11Painter.SubMenuControlDrawDetachCaption(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); +var + ABrush: HBRUSH; + DXY: Integer; +begin + if ABarSubMenuControl.DetachCaptionSelected then + begin + Office11FrameSelectedRect(DC, R); + InflateRect(R, -1, -1); + ABrush := dxOffice11DetachableSelectedBrush; + DXY := 0; + end + else + begin + ABrush := dxOffice11DetachableBrush; + DXY := 1; + end; + FillRect(DC, R, ABrush); + // draw marks + InflateRect(R, -(((R.Right - R.Left + DXY * 2) div 4)), -(DXY + 1)); + BarDrawFingerElements(ABarSubMenuControl, DC, R, False); +end; + +procedure TdxBarOffice11Painter.DropDownListBoxDrawBorder(DC: HDC; AColor: TColor; ARect: TRect); +begin + FrameRect(DC, ARect, dxOffice11DropDownBorderBrush1); + InflateRect(ARect, -1, -1); + FrameRect(DC, ARect, dxOffice11DropDownBorderBrush2); +end; + +class function TdxBarOffice11Painter.BarToolbarBrushEx2(ABarControl: TdxBarControl): HBRUSH; +begin + Result := dxOffice11MenuBrush; +end; + +class procedure TdxBarOffice11Painter.DrawQuickCustItemFrameSelected(ABarItemControl: TdxBarItemControl; + DC: HDC; WholeR, R: TRect; Selected: Boolean); +begin + if Selected then + begin + Office11FrameSelectedRect(DC, WholeR); + with R do + begin + Left := Right; + Right := Left + 2; // paint over! + end; + FillRect(DC, R, ABarItemControl.Parent.ToolbarSelBrush); + end; +end; + +function TdxBarOffice11Painter.ButtonControlArrowBrush(const ADrawParams: TdxBarItemControlDrawParams): HBRUSH; +begin + with ADrawParams do + if Enabled then + if DrawSelected then + if DroppedDown then + Result := BarItemControl.Parent.ToolbarDownedSelBrush + else + Result := BarItemControl.Parent.ToolbarSelBrush + else + Result := BarItemControl.Parent.BkBrush + else + Result := GetSysColorBrush(COLOR_BTNFACE); +end; + +function TdxBarOffice11Painter.EditButtonIsCustomBackground(AState: Integer): Boolean; +begin + Result := AState in [DXBAR_NORMAL, DXBAR_ACTIVE]; +end; + +procedure TdxBarOffice11Painter.EditButtonDrawBackground(const ADrawParams: TdxBarEditLikeControlDrawParams; AState: Integer; + ARect: TRect; ABrush: HBrush); +begin + if ADrawParams.PaintType = ptMenu then + FillRect(ADrawParams.Canvas.Handle, ARect, dxOffice11OwnerControlDownedBrush) + else + DrawBackground(ADrawParams.BarItemControl, ADrawParams.Canvas.Handle, ARect, ABrush, ADrawParams.BarItemControl.NonRecent); +end; + +class function TdxBarOffice11Painter.EditControlBorderOffsets(APaintType: TdxBarPaintType): TRect; +begin + Result := Rect(1, 1, 1, 1); +end; + +procedure TdxBarOffice11Painter.EditControlDrawBorder( + const ADrawParams: TdxBarEditLikeControlDrawParams; var ARect: TRect); +begin + with ADrawParams do + begin + if DrawSelected then + Office11FrameSelectedRect(Canvas.Handle, ARect) + else + if not Enabled and not IsTransparent then + FrameRectByColor(Canvas.Handle, ARect, dxOffice11TextDisabledColor) + else + if (PaintType = ptMenu) and not IsTransparent then + FrameRect(Canvas.Handle, ARect, dxOffice11OwnerControlDownedBrush) + else + DrawBackgroundFrameRect(BarEditControl, Canvas.Handle, ARect, BarEditControl.Parent.BkBrush, False); + InflateRect(ARect, -1, -1); + end; +end; + +class function TdxBarOffice11Painter.EditControlCaptionBackgroundIsOpaque( + const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; +begin + Result := (ADrawParams.PaintType = ptMenu) and ADrawParams.DrawSelected; +end; + +class function TdxBarOffice11Painter.EditControlCaptionAbsoluteLeftIndent( + const ADrawParams: TdxBarEditLikeControlDrawParams): Integer; +begin + if ADrawParams.PaintType = ptMenu then + Result := SubMenuControlGetItemTextIndent(ADrawParams) + else + Result := ADrawParams.BarItemControl.GetControlCaptionOffset; +end; + +class function TdxBarOffice11Painter.EditControlCaptionRightIndentIsOpaque( + const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; +begin + Result := (ADrawParams.PaintType = ptMenu) and ADrawParams.DrawSelected; +end; + +class function TdxBarOffice11Painter.EditControlShowIconDefault( + const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; +begin + Result := ADrawParams.PaintType = ptMenu; +end; + +class function TdxBarOffice11Painter.EditControlSubMenuGlyphIndents(const ADrawParams: TdxBarEditLikeControlDrawParams): TRect; +begin + Result := cxEmptyRect; + Result.Left := ADrawParams.BarItemControl.SubMenuParent.GetIconAreaSize - ADrawParams.BarItemControl.GetGlyphSize(ADrawParams.ViewSize).cx; +end; + +function TdxBarOffice11Painter.ComboControlArrowColor(ADrawParams: TdxBarItemControlDrawParams): TColor; +begin + with ADrawParams do + if Enabled then + begin + Result := dxOffice11TextEnabledColor; + if DrawSelected then + if IsHighContrastWhite then + Result := clWhite + else + if DroppedDown and not IsXPStandardScheme then + Result := ColorToRGB(clHighlightText); + end + else + Result := dxOffice11TextDisabledColor; +end; + +function TdxBarOffice11Painter.ComboControlButtonBrush(const ADrawParams: TdxBarItemControlDrawParams): HBRUSH; +begin + Result := ButtonControlArrowBrush(ADrawParams); + with ADrawParams do + if DrawSelected then + Result := BarItemControl.Parent.ToolbarSelBrush + else + if DroppedDown then + Result := BarItemControl.Parent.ToolbarDownedSelBrush; +end; + +class procedure TdxBarOffice11Painter.ComboControlDrawSimpleButton(const ADrawParams: TdxBarEditLikeControlDrawParams; var ARect: TRect; ABrush: HBRUSH); +var + AColor1, AColor2: TColor; + ASpaceBrush: HBRUSH; +begin + with ADrawParams do + if DrawSelected then + begin + InflateRect(ARect, 1, 1); + Office11FrameSelectedRect(Canvas.Handle, ARect); + InflateRect(ARect, -1, -1); + GetSelectedColors(BarEditControl, DroppedDown, DrawSelected, AColor1, AColor2); + FillGradientRect(Canvas.Handle, ARect, AColor1, AColor2, False); + InflateRect(ARect, -1, -1); + end + else + begin + if Enabled then + ASpaceBrush := BarEditControl.EditBkBrush + else + ASpaceBrush := ABrush; + FrameRect(Canvas.Handle, ARect, ASpaceBrush); + FillRect(Canvas.Handle, Rect(ARect.Left - 1, ARect.Top, ARect.Left, ARect.Bottom), ASpaceBrush); + InflateRect(ARect, -1, -1); + if (PaintType = ptMenu) and Enabled then + FillRect(Canvas.Handle, ARect, dxOffice11OwnerControlDownedBrush) + else + DrawBackground(BarEditControl, Canvas.Handle, ARect, ABrush, not Enabled); + if DroppedDown then + OffsetRect(ARect, 1, 1); + end; +end; + +class function TdxBarOffice11Painter.ProgressControlIndent(const ADrawParams: TdxBarItemControlDrawParams): Integer; +begin + Result := 0; + if not (cpIcon in ADrawParams.ViewStructure) and (ADrawParams.PaintType = ptMenu) then + Inc(Result, TdxBarSubMenuControl(ADrawParams.BarItemControl.Parent).GetIndent1); +end; + +procedure TdxBarOffice11Painter.DateNavigatorDrawButton(ABarItem: TdxBarItem; + DC: HDC; R: TRect; const ACaption: string; APressed: Boolean); +begin + if not ABarItem.BarManager.FThemeAvailable then + inherited + else + TdxBarXPPainter.DateNavigatorDrawNativeButton(ABarItem, DC, R, ACaption, APressed); +end; + +function TdxBarOffice11Painter.DateNavigatorHeaderColor: TColor; +begin + Result := dxOffice11DateHeaderColor; +end; + +class function TdxBarOffice11Painter.InPlaceSubItemControlBrush: HBRUSH; +begin + Result := dxOffice11InPlaceSubItemBrush; +end; + +function TdxBarOffice11Painter.EditGetDisabledBkColor(ABarItemControl: TdxBarCustomEditControl): COLORREF; +begin + Result := GetSysColor(COLOR_BTNFACE); +end; + +function TdxBarOffice11Painter.EditGetDisabledTextColor: COLORREF; +begin + Result := dxOffice11TextDisabledColor; +end; + +procedure TdxBarOffice11Painter.DrawSeparatorGlyphAndCaption(const ADrawParams: TdxBarSeparatorControlDrawParams; const ARect: TRect); +var + APrevBrush: HBRUSH; +begin + APrevBrush := ADrawParams.BarItemControl.FBkBrush; + ADrawParams.BarItemControl.FBkBrush := CreateSolidBrush(dxOffice11MenuIndentColor2); + inherited; + DeleteGDIObject(ADrawParams.BarItemControl.FBkBrush); + ADrawParams.BarItemControl.FBkBrush := APrevBrush; +end; + +procedure TdxBarOffice11Painter.DrawGlyphBorder(ABarItemControl: TdxBarItemControl; + DC: HDC; ABrush: HBRUSH; NeedBorder: Boolean; R: TRect; PaintType: TdxBarPaintType; IsGlyphEmpty, + Selected, Down, DrawDowned, ADroppedDown, IsSplit: Boolean); +var + AOpaque, AVertical: Boolean; + AColor1, AColor2: TColor; +begin + if (PaintType = ptMenu) and Selected and IsGlyphEmpty and not Down or ABarItemControl.IsBkColorAssigned then + FillRect(DC, R, ABrush) + else + begin + AOpaque := Selected or Down or DrawDowned; + AVertical := ABarItemControl.Parent.IsRealVertical; + if ADroppedDown and IsMenuGradient(ABarItemControl) and not Down then + FillGradientRect(DC, R, dxOffice11MenuDownedColor1, + dxOffice11MenuDownedColor2, AVertical) + else + begin + if (PaintType <> ptMenu) and AOpaque then + begin + GetSelectedColors(ABarItemControl, Down or DrawDowned, Selected, AColor1, AColor2); + FillGradientRect(DC, R, AColor1, AColor2, AVertical); + end + else + DrawBackground(ABarItemControl, DC, R, ABrush, AOpaque); + end; + + if Down or (Selected and (PaintType <> ptMenu)) or ADroppedDown then + begin + if ADroppedDown then + BarDrawBarControlOwnerBorder(ABarItemControl.Parent, DC, R, ABarItemControl, ABarItemControl.OwnedBarControl) + else + if Selected or + (Down and (ABarItemControl is TdxBarButtonControl) and TdxBarButtonControl(ABarItemControl).Down) then + Office11FrameSelectedRect(DC, R) + else + FrameRect(DC, R, dxOffice11SelectedBorderBrush); + end + else + if NeedBorder then + DrawBackgroundFrameRect(ABarItemControl, DC, R, ABrush, AOpaque); + end; +end; + +class procedure TdxBarOffice11Painter.DrawItemArrow(DC: HDC; R: TRect; + ArrowType: TcxArrowDirection; Enabled, Selected, Flat: Boolean; AColor: TColor = clDefault); +begin + Office11DrawItemArrow(DC, R, ArrowType = adDown, Enabled, Selected, Flat); +end; + +procedure TdxBarOffice11Painter.DrawLargeItemArrow(DC: HDC; R: TRect; + ArrowType: TcxArrowDirection; Size: Integer; Selected, Enabled, Flat: Boolean; AColor: TColor = clDefault); +begin + Office11DrawLargeItemArrow(DC, R, ArrowType = adDown, Size, Selected, Enabled, Flat); +end; + +class procedure TdxBarOffice11Painter.DrawFrameRect(ABarItemControl: TdxBarItemControl; + ADC: HDC; const ARect: TRect; ABrush: HBRUSH; APaintType: TdxBarPaintType; ASelected, ADowned: Boolean); +begin + if (APaintType = ptMenu) or ASelected or ADowned then + if (APaintType = ptMenu) and not ASelected then + FrameRect(ADC, ARect, dxOffice11BarSeparatorBrush1) + else + Office11FrameSelectedRect(ADC, ARect) + else + DrawBackgroundFrameRect(ABarItemControl, ADC, ARect, ABrush, False); +end; + +class procedure TdxBarOffice11Painter.FrameFlatSelRect(DC: HDC; const R: TRect); +begin + Office11FrameSelectedRect(DC, R); +end; + +class function TdxBarOffice11Painter.GetBarGradientRect(ABarControl: TCustomdxBarControl): TRect; +begin + Result := Rect(0, 0, ABarControl.Width, ABarControl.Height); + if ABarControl is TdxBarControl then + begin + if TdxBarControl(ABarControl).Horizontal then + InflateRect(Result, 0, -1) + else + InflateRect(Result, -1, 0); + end; +end; + +class procedure TdxBarOffice11Painter.GetDockColors(ADockControl: TdxDockControl; var AColor1, AColor2: TColor); +begin + AColor1 := dxOffice11DockColor1; + AColor2 := dxOffice11DockColor2; + if ADockControl.Align = alLeft then + AColor2 := AColor1 + else + if ADockControl.Align = alRight then + AColor1 := AColor2; +end; + +class procedure TdxBarOffice11Painter.GetMarkColors(ABarControl: TdxBarControl; + var AMarkColor1, AMarkColor2, AColor6, AColor9: TColor); +var + I: Integer; +begin + I := Integer(ABarControl.MarkDrawState) + 1; + AMarkColor1 := dxOffice11BarMarkColors1[I]; + AMarkColor2 := dxOffice11BarMarkColors2[I]; + AColor6 := dxOffice11BarBorderMarkColors[1, I]; + AColor9 := dxOffice11BarBorderMarkColors[2, I]; +end; + +class procedure TdxBarOffice11Painter.GetSelectedColors(ABarItemControl: TdxBarItemControl; + ADown, ASelected: Boolean; var AColor1, AColor2: TColor); +begin +//#DG if ABarItemControl.Parent.NeedShowGlyphAndCheckForItem then - ??? + if ABarItemControl.Parent.IsInternal then + begin + if ADown then + AColor1 := dxOffice11OwnerControlDownedColor + else + AColor1 := dxOffice11SelectedColor1; + AColor2 := AColor1; + end + else + begin + if ADown then + begin + if not ASelected then + begin + AColor1 := dxOffice11SelectedDownColor1; + AColor2 := dxOffice11SelectedDownColor2; + if AColor1 = AColor2 then + begin + AColor1 := dxOffice11DownedColor; //dxOffice11SelectedColor1; + AColor2 := AColor1; + end; + end + else + begin + AColor1 := dxOffice11SelectedDownColor2; + AColor2 := dxOffice11SelectedDownColor1; + end; + end + else + begin + AColor1 := dxOffice11SelectedColor1; + AColor2 := dxOffice11SelectedColor2; + end; + end; +end; + +class function TdxBarOffice11Painter.GetToolbarBrush(ABarItemControl: TdxBarItemControl): HBRUSH; +begin + Result := ABarItemControl.Parent.ToolbarBrush; +end; + +function TdxBarOffice11Painter.GetDefaultEnabledTextColor( + ABarItemControl: TdxBarItemControl; ASelected, AFlat: Boolean): TColor; +begin + if (ABarItemControl.IsInvertTextColor or True) and ASelected and not AFlat then + begin + Result := dxOffice11InPlaceSubItemTextColor; // GetSysColor(COLOR_HIGHLIGHTTEXT) + if IsHighContrastWhite then + Result := clWhite; + end + else + Result := dxOffice11TextEnabledColor; +end; + +procedure TdxBarOffice11Painter.GetDisabledTextColors( + ABarItemControl: TdxBarItemControl; ASelected, AFlat: Boolean; + var AColor1, AColor2: TColor); +begin + AColor1 := dxOffice11TextDisabledColor; + AColor2 := AColor1; +end; + +class function TdxBarOffice11Painter.GetFaded(ABarControl: TCustomdxBarControl): Boolean; +begin + Result := True; +end; + +class function TdxBarOffice11Painter.IgnoreNonRecentColor: Boolean; +begin + Result := True; +end; + +class function TdxBarOffice11Painter.IsMenuGradient(ABarItemControl: TdxBarItemControl): Boolean; +begin + Result := not ABarItemControl.Parent.NeedShowGlyphAndCheckForItem and ((ABarItemControl is TdxBarSubItemControl) or + ((ABarItemControl is TdxBarButtonControl) and TdxBarButtonControl(ABarItemControl).DroppedDownFlat)); +end; + +class function TdxBarOffice11Painter.IsSimpleMark(ABarControl: TdxBarControl): Boolean; +begin + Result := (ABarControl.Bar.BorderStyle = bbsNone) or ABarControl.IsMainMenu; +end; + +class function TdxBarOffice11Painter.BarCaptionBkColor(ABarControl: TdxBarControl; + AMainFormActive: Boolean): COLORREF; +begin + Result := dxOffice11BarFloatingCaptionColor; +end; + +function TdxBarOffice11Painter.BarCaptionColor(ABarControl: TdxBarControl): COLORREF; +begin + Result := dxOffice11BarFloatingCaptionTextColor1; +end; + +class function TdxBarOffice11Painter.BarMarkArrowColor(ABarControl: TdxBarControl; + AState: TdxBarMarkState): COLORREF; +begin + case AState of + msSelected: + Result := dxOffice11BarFloatingCaptionTextColor2; + msPressed: + Result := dxOffice11BarFloatingCaptionTextColor3; + else // msNone + Result := dxOffice11BarFloatingCaptionTextColor1; + end; +end; + +class procedure TdxBarOffice11Painter.BarDrawFingerElements(ABarControl: TCustomdxBarControl; + DC: HDC; ARect: TRect; AHorizontal: Boolean); +begin + Office11DrawFingerElements(DC, ARect, AHorizontal); +end; + +procedure TdxBarOffice11Painter.BarDrawMarkBackground(ABarControl: TdxBarControl; + DC: HDC; ItemRect: TRect; AToolbarBrush: HBRUSH); +var + R1, R2, R3: TRect; + C1, C2, AColor6, C4: TColor; + AC11pxColor, AColor: TColor; +begin + // TODO: states and colors + GetMarkColors(ABarControl, C1, C2, AColor6, C4); + if (ABarControl.Bar.BorderStyle = bbsNone) or + ABarControl.IsMainMenu then + begin + R2 := ItemRect; +{ if ABarControl.Bar.IsMainMenu then + begin + InflateRect(R2, 0, -1); + with R2 do + begin + ABarControl.FillBackground(DC, Rect(Left, Top - 1, Right, Top), AToolbarBrush, clNone, True); + ABarControl.FillBackground(DC, Rect(Left, Bottom, Right, Bottom + 1), AToolbarBrush, clNone, True); + end; + end;} + end + else + begin + R1 := ItemRect; + R2 := ItemRect; + if ABarControl.Horizontal then + begin + R1.Right := R1.Left + 2; + Inc(R2.Left, 2); + InflateRect(R2, 0, 2); + with R1 do + R3 := Rect(Right - 1, Top, Right, Top + 1); + AC11pxColor := GetGradientColorRect(GetBarGradientRect(ABarControl), + R3.Top + 2, dxOffice11ToolbarsColor1, + dxOffice11ToolbarsColor2, False); + end + else + begin + R1.Bottom := R1.Top + 2; + Inc(R2.Top, 2); + InflateRect(R2, 2, 0); + with R1 do + R3 := Rect(Left, Bottom - 1, Left + 1, Bottom); + AC11pxColor := GetGradientColorRect(GetBarGradientRect(ABarControl), + R3.Left + 2, dxOffice11ToolbarsColor1, + dxOffice11ToolbarsColor2, True); + end; + ABarControl.FillBackground(DC, R1, AToolbarBrush, clNone, True); + + AColor := GetMiddleRGB(AColor6, AC11pxColor, 50); + SetPixel(DC, R3.Left, R3.Top, AColor); + end; + FillTubeGradientRect(DC, R2, C1, C2, not ABarControl.Horizontal); +end; + +procedure TdxBarOffice11Painter.BarDrawMarkElements(ABarControl: TdxBarControl; + DC: HDC; ItemRect: TRect); + + procedure DrawArrow(X, Y: Integer; AVertical: Boolean; AColor: COLORREF); + const + YOffset = 3; + var + P: array[1..3] of TPoint; + begin + if AVertical then + begin + FillRectByColor(DC, Rect(X, Y, X + 1, Y + 5), AColor); + P[1] := Point(X + YOffset, Y); + P[2] := Point(X + YOffset, Y + 4); + P[3] := Point(X + YOffset + 2, Y + 2); + end + else + begin + FillRectByColor(DC, Rect(X, Y, X + 5, Y + 1), AColor); + P[1] := Point(X, Y + YOffset); + P[2] := Point(X + 4, Y + YOffset); + P[3] := Point(X + 2, Y + 2 + YOffset); + end; + PolygonByColor(DC, P, AColor, AColor); + end; + + procedure DrawArrows(X, Y: Integer; Vertical: Boolean); + begin + DrawArrow(X + 1, Y + 1, Vertical, dxOffice11BarMarkArrowColor2); + DrawArrow(X, Y, Vertical, dxOffice11BarMarkArrowColor1); + end; + + procedure DrawMark(X, Y: Integer; AVertical: Boolean; AColor: COLORREF); + var + P: array[1..3] of TPoint; + begin + if AVertical then + begin + P[1] := Point(X, Y); + P[2] := Point(X + 1, Y + 1); + P[3] := Point(X + 2, Y); + end + else + begin + P[1] := Point(X, Y); + P[2] := Point(X + 1, Y + 1); + P[3] := Point(X, Y + 2); + end; + PolygonByColor(DC, P, AColor, AColor); + end; + + procedure DrawMarks(X, Y: Integer; Vertical: Boolean); + var + AOffsetX, AOffsetY: Integer; + begin + DrawMark(X + 1, Y + 1, Vertical, dxOffice11BarMarkArrowColor2); + DrawMark(X, Y, Vertical, dxOffice11BarMarkArrowColor1); + if Vertical then + begin + AOffsetX := 0; + AOffsetY := 4; + end + else + begin + AOffsetX := 4; + AOffsetY := 0; + end; + DrawMark(X + 1 + AOffsetX, Y + 1 + AOffsetY, Vertical, dxOffice11BarMarkArrowColor2); + DrawMark(X + AOffsetX, Y + AOffsetY, Vertical, dxOffice11BarMarkArrowColor1); + end; + +var + AOffsetX, AOffsetY: Integer; +begin + with ItemRect do + begin + if (ABarControl.Bar.BorderStyle = bbsNone) or ABarControl.IsMainMenu then + begin + AOffsetX := 2; + AOffsetY := 1; + end + else + begin + AOffsetX := 0; + AOffsetY := 0; + end; + if ABarControl.Horizontal then + begin + DrawArrows(Right - 6 - AOffsetX, Bottom - 8 - AOffsetY, False); + if ABarControl.FTruncated then + DrawMarks(Right - 7 - AOffsetX, Top + 3 - AOffsetY, False); // TODO + end + else + begin + DrawArrows(Right - 8 - AOffsetY, Bottom - 6 - AOffsetX, True); + if ABarControl.FTruncated then + DrawMarks(Left + 3 - AOffsetX, Bottom - 7 - AOffsetY, True); // TODO + end; + end; +end; + +function TdxBarOffice11Painter.SubMenuControlMarkBorderSize: Integer; +begin + Result := 2; +end; + +function TdxBarOffice11Painter.SubMenuControlMarkContentRect(const ADrawRect: TRect): TRect; +var + AMarkSize: TSize; +begin + AMarkSize.cx := cxRectHeight(ADrawRect) - SubMenuControlMarkBorderSize; + AMarkSize.cy := AMarkSize.cx; + Result := cxRectCenter(ADrawRect, AMarkSize); +end; + +procedure TdxBarOffice11Painter.SubMenuControlDrawMarkContent(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect; ASelected: Boolean); +begin + TransparentDraw(DC, SubMenuControlMarkContentRect(R), dxOffice11SubMenuExpandBitmap); +end; + +{ TdxBarXPPainter } + +constructor TdxBarXPPainter.Create(AData: Integer); +begin + inherited Create(AData); + InitParams; +end; + +procedure TdxBarXPPainter.DrawItemBackgroundInSubMenu(const ADrawParams: TdxBarButtonLikeControlDrawParams; R: TRect); +var + AIconRect: TRect; + AIsGlyphEmpty, AOpaque: Boolean; + Brush: HBRUSH; + ADC: HDC; +begin + with ADrawParams do + begin + AIconRect := SubMenuControlGetItemIconRect(R, BarItemControl.Parent.IconAreaSize); + AIsGlyphEmpty := not BarItemControl.HasIcon(ViewSize, ViewStructure); + ADC := Canvas.Handle; + + if DrawSelected and AIsGlyphEmpty and not Downed then + Brush := BarItemControl.Parent.ToolbarSelBrush + else + Brush := BarItemControl.Parent.BkBrush; + R.Left := AIconRect.Right + 1; + AOpaque := DrawSelected or BarItemControl.FNonRecent; + DrawBackground(BarItemControl, ADC, Rect(AIconRect.Right, AIconRect.Top, R.Left, AIconRect.Bottom), Brush, AOpaque); + if AIconRect.Top > R.Top then + DrawBackground(BarItemControl, ADC, Rect(AIconRect.Left, R.Top, R.Left, AIconRect.Top), Brush, AOpaque); + if AIconRect.Bottom < R.Bottom then + DrawBackground(BarItemControl, ADC, Rect(AIconRect.Left, AIconRect.Bottom, R.Left, R.Bottom), Brush, AOpaque); + + if DrawSelected then + Brush := BarItemControl.Parent.ToolbarSelBrush + else + Brush := BarItemControl.Parent.BkBrush; + DrawBackground(BarItemControl, ADC, R, Brush, AOpaque); + end; +end; + +class function TdxBarXPPainter.GlyphBkgndBrush(ABarItemControl: TdxBarItemControl; + APaintType: TdxBarPaintType; AGlyphEmpty, ASelected, ADowned, ADrawDowned, ADroppedDown, + AForceUseBkBrush, AGrayScale: Boolean): HBRUSH; +begin + if ASelected and (APaintType = ptMenu) and AGlyphEmpty and not ADowned then // TODO: ref func + Result := ABarItemControl.Parent.ToolbarSelBrush + else + Result := ABarItemControl.BkBrush; +end; + +class function TdxBarXPPainter.GlyphDownShift(ABarItemControl: TdxBarItemControl): Integer; +begin + Result := 1; +end; + +class function TdxBarXPPainter.GlyphDrawDownedShift(ABarItemControl: TdxBarItemControl; + ADown: Boolean): Integer; +begin + if not ADown then + Result := 1 + else + Result := 0; +end; + +class function TdxBarXPPainter.IsFlatGlyphImage: Boolean; +begin + Result := True; +end; + +function TdxBarXPPainter.BeforeFingersSize: Integer; +begin +// Result := 3; + Result := 0; +end; + +function TdxBarXPPainter.FingersSize(ABarControl: TdxBarControl): Integer; +begin + Result := BeforeFingersSize + GripperSize(ABarControl) + 2; +end; + +function TdxBarXPPainter.GripperSize(ABarControl: TdxBarControl): Integer; +begin + Result := FdxBarXPPainterParams.GripperSize; +end; + +class function TdxBarXPPainter.RealButtonArrowWidth(ABarManager: TdxBarManager): Integer; +begin + Result := inherited RealButtonArrowWidth(ABarManager); + Inc(Result, 3); +end; + +class function TdxBarXPPainter.RealLargeButtonArrowWidth(ABarManager: TdxBarManager): Integer; +begin + Result := inherited RealLargeButtonArrowWidth(ABarManager); + Inc(Result, 3); +end; + +procedure TdxBarXPPainter.DockControlFillBackground(ADockControl: TdxDockControl; + DC: HDC; ADestR, ASourceR, AWholeR: TRect; ABrush: HBRUSH; AColor: TColor); + + procedure FillBackgroundTempBitmap(ABitmap: TBitmap); + var + ATheme: TdxTheme; + begin + ATheme := OpenTheme(totRebar); + with AWholeR do + begin + ABitmap.Width := Right - Left; + ABitmap.Height := Bottom - Top; + end; + DrawThemeBackground(ATheme, ABitmap.Canvas.Handle, 0, CHEVS_NORMAL, AWholeR); + end; + + procedure DrawBarSeparators(DC: HDC); + + function GetRowBar(ARow: TdxDockRow): TdxBar; + var + I: Integer; + ABar: TdxBar; + begin + if ARow.ColCount = 0 then + begin + Result := nil; + Exit; + end; + Result := ARow.Cols[0].BarControl.Bar; + if Result.BorderStyle = bbsNone then + for I := 1 to ARow.ColCount - 1 do + begin + ABar := ARow.Cols[I].BarControl.Bar; + if ABar.BorderStyle <> bbsNone then + begin + Result := ABar; + Break; + end; + end; + end; + + function IsNoBorder(ARow: TdxDockRow): Boolean; + var + ABar: TdxBar; + begin + ABar := GetRowBar(ARow); + Result := (ABar <> nil) and ((ABar.BorderStyle = bbsNone) or ABar.IsStatusBar); + end; + + procedure CalcLines(ARow: TdxDockRow; AHorz: Boolean; + var AIsFirstLineNeeded, AIsLastLineNeeded: Boolean); + var + AIsTop, AIsBottom, AIsTopBottom, AIsLeft, AIsRight: Boolean; + begin + if IsNoBorder(ARow) then + begin + AIsFirstLineNeeded := False; + AIsLastLineNeeded := False; + end + else + begin + AIsFirstLineNeeded := True; + AIsLastLineNeeded := True; + if AHorz then + begin + AIsTop := (ADockControl.DockingStyle = dsTop) and (ARow = ADockControl.Rows[0]); + AIsBottom := (ADockControl.DockingStyle = dsBottom) and + (ARow = ADockControl.Rows[ADockControl.RowCount - 1]); + AIsTopBottom := (ADockControl.DockingStyle = dsTop) and + (ARow = ADockControl.Rows[ADockControl.RowCount - 1]); + if AIsTop then AIsFirstLineNeeded := False; + if AIsBottom or AIsTopBottom then AIsLastLineNeeded := False; + end + else + begin + AIsLeft := (ADockControl.DockingStyle = dsLeft) and (ARow = ADockControl.Rows[0]); + AIsRight := (ADockControl.DockingStyle = dsRight) and + (ARow = ADockControl.Rows[ADockControl.RowCount - 1]); + if AIsLeft then AIsFirstLineNeeded := False; + if AIsRight then AIsLastLineNeeded := False; + end; + end; + end; + + var + I: Integer; + R, R1, R2: TRect; + AHorz: Boolean; + AIsFirstLineNeeded, AIsLastLineNeeded: Boolean; + begin + AHorz := ADockControl.DockingStyle in [dsTop, dsBottom]; + for I := 0 to ADockControl.RowCount - 1 do + begin + // rects + R := ADockControl.GetRectForRow(I); + if AHorz then + begin + R1 := Rect(R.Left, R.Top, R.Right, R.Top + 1); + R2 := Rect(R.Left, R.Bottom - 1, R.Right, R.Bottom); + end + else + begin + R1 := Rect(R.Left, R.Top, R.Left + 1, R.Bottom); + R2 := Rect(R.Right - 1, R.Top, R.Right, R.Bottom); + end; + // draw + CalcLines(ADockControl.Rows[I], AHorz, AIsFirstLineNeeded, AIsLastLineNeeded); + if AIsFirstLineNeeded then + FillRect(DC, R1, GetSysColorBrush(COLOR_BTNHIGHLIGHT)); + if AIsLastLineNeeded then + FillRect(DC, R2, GetSysColorBrush(COLOR_BTNSHADOW)); // TODO: color? + end; + end; + +begin + if ADockControl.BackgroundTempBitmap.Empty then + begin + FillBackgroundTempBitmap(ADockControl.BackgroundTempBitmap); + DrawBarSeparators(ADockControl.BackgroundTempBitmap.Canvas.Handle); + end; + cxBitBlt(DC, ADockControl.BackgroundTempBitmap.Canvas.Handle, ADestR, ASourceR.TopLeft, SRCCOPY); +end; + +class function TdxBarXPPainter.IsNativeBackground: Boolean; +begin + Result := True; +end; + +{class function TdxBarXPPainter.BarChildrenHaveShadows(ABarControl: TCustomdxBarControl): Boolean; +begin + Result := False; +end;} + +class function TdxBarXPPainter.BarToolbarBrush(ABarControl: TCustomdxBarControl): HBRUSH; +begin + Result := ABarControl.BarManager.ThemeToolbarsBrush; +end; + +class function TdxBarXPPainter.BarToolbarBrushEx(ABarControl: TdxBarControl): HBRUSH; +begin + Result := BarToolbarBrush(ABarControl); +end; + +class function TdxBarXPPainter.BarToolbarDownedBrush(ABarControl: TCustomdxBarControl): HBRUSH; +begin + // TODO + Result := PatternBrush; +// Result := ABarControl.BarManager.FlatToolbarsDownedBrush; +end; + +class function TdxBarXPPainter.BarToolbarDownedSelBrush(ABarControl: TCustomdxBarControl): HBRUSH; +begin + // TODO + Result := GetSysColorBrush(COLOR_BTNFACE); +// Result := ABarControl.BarManager.FlatToolbarsDownedSelBrush; +end; + +class function TdxBarXPPainter.BarToolbarSelBrush(ABarControl: TCustomdxBarControl): HBRUSH; +begin + // TODO + Result := GetSysColorBrush(COLOR_HIGHLIGHT); +// Result := ABarControl.BarManager.FlatToolbarsSelBrush; +end; + +function TdxBarXPPainter.ComboBoxArrowWidth(ABarControl: TCustomdxBarControl; cX: Integer): Integer; +begin + Result := FdxBarXPPainterParams.ComboBoxArrowWidth; +end; + +function TdxBarXPPainter.BarBeginGroupSideSize: Integer; +begin + // don't use in xp painter + Result := (BarBeginGroupSize - 1{|}) div 2; +end; + +function TdxBarXPPainter.BarBeginGroupSize: Integer; +begin + Result := FdxBarXPPainterParams.BarBeginGroupSize; +end; + +class function TdxBarXPPainter.BarBorderSize: Integer; +begin + Result := 0; +end; + +procedure TdxBarXPPainter.BarCaptionFillBackground(ABarControl: TdxBarControl; + DC: HDC; R: TRect; AToolbarBrush: HBRUSH); +const + CaptionBkColors: array[Boolean] of Integer = + (COLOR_INACTIVECAPTION, COLOR_ACTIVECAPTION); +//const +// CaptionStates: array[Boolean] of Integer = (CS_INACTIVE, CS_ACTIVE); +//var +// ATheme: TdxTheme; +begin +// ATheme := OpenTheme(totWindow); +// DrawThemeBackground(ATheme, DC, WP_SMALLCAPTION, +// CaptionStates[ABarControl.BarManager.MainFormActive], @R); + FillRect(DC, R, GetSysColorBrush(CaptionBkColors[ABarControl.BarManager.MainFormActive])); +end; + +{class function TdxBarXPPainter.BarCaptionSize: Integer; +var + ATheme: TdxTheme; + ASize: TSize; +begin + ATheme := OpenTheme(totWindow); + GetThemePartSize(ATheme, 0, WP_SMALLCAPTION, CS_ACTIVE, TS_TRUE, ASize); + Result := ASize.cy; +end;} + +class function TdxBarXPPainter.BarCaptionTransparent: Boolean; +begin + Result := True; +end; + +class function TdxBarXPPainter.BarCloseButtonSize: TSize; +begin + Result := FdxBarXPPainterParams.BarCloseButtonSize; +end; + +procedure TdxBarXPPainter.BarDrawBeginGroup(ABarControl: TCustomdxBarControl; + DC: HDC; ABeginGroupRect: TRect; AToolbarBrush: HBRUSH; AHorz: Boolean); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totToolBar); + // * IsThemeBackgroundPartiallyTransparent + ABarControl.FillBackground(DC, ABeginGroupRect, AToolbarBrush, clNone, True); + if AHorz then + DrawThemeBackground(ATheme, DC, TP_SEPARATORVERT, TS_NORMAL, ABeginGroupRect) + else + DrawThemeBackground(ATheme, DC, TP_SEPARATOR, TS_NORMAL, ABeginGroupRect); +end; + +procedure TdxBarXPPainter.BarDrawCloseButton(ABarControl: TdxBarControl; + DC: HDC; R: TRect); +const + ButtonStates: array [TdxBarMarkState] of Integer = (CBS_NORMAL, CBS_HOT, CBS_PUSHED); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totWindow); + // FillTransparent is not needed (BarCaptionTransparent) + DrawThemeBackground(ATheme, DC, WP_SMALLCLOSEBUTTON, ButtonStates[ABarControl.CloseButtonState], R); +end; + +procedure TdxBarXPPainter.BarDrawDockedBarBorder(ABarControl: TdxBarControl; + DC: HDC; R: TRect; AToolbarBrush: HBRUSH); +const + Grippers: array[Boolean] of Integer = (RP_GRIPPER, RP_GRIPPERVERT); +var + ATheme: TdxTheme; +begin + InflateRect(R, -2, -2); + if not ABarControl.CanMoving then Exit; + ATheme := OpenTheme(totRebar); + with R do + if ABarControl.Horizontal then + begin + Inc(Left, BeforeFingersSize); + Right := Left + GripperSize(ABarControl); + InflateRect(R, 0, -0); + end + else + begin + Inc(Top, BeforeFingersSize); + Bottom := Top + GripperSize(ABarControl); + InflateRect(R, -0, 0); + end; + // FillTransparent is not needed (FillBackgroundRgn) + DrawThemeBackground(ATheme, DC, Grippers[ABarControl.Vertical], CHEVS_NORMAL, R); +end; + +procedure TdxBarXPPainter.BarDrawFloatingBarBorder(ABarControl: TdxBarControl; + DC: HDC; R, CR: TRect; AToolbarBrush: HBRUSH); +begin + dxBarFlatPainter.BarDrawFloatingBarBorder(ABarControl, DC, R, CR, AToolbarBrush); +end; + +class function TdxBarXPPainter.StatusBarNativeGripSize(ABarManager: TdxBarManager): TSize; +begin + Result := FdxBarXPPainterParams.StatusBarGripSize; +end; + +procedure TdxBarXPPainter.BarDrawMDIButton(ABarControl: TdxBarControl; + AButton: TdxBarMDIButton; AState: Integer; DC: HDC; R: TRect); +const + Buttons: array[TdxBarMDIButton] of Integer = + (WP_MDIMINBUTTON, WP_MDIRESTOREBUTTON, WP_MDICLOSEBUTTON); + States: array[TdxBarMDIButton, 1..4] of Integer = ( + (MINBS_DISABLED, MINBS_HOT, MINBS_NORMAL, MINBS_PUSHED), + (RBS_DISABLED, RBS_HOT, RBS_NORMAL, RBS_PUSHED), + (CBS_DISABLED, CBS_HOT, CBS_NORMAL, CBS_PUSHED)); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totWindow); + // * IsThemeBackgroundPartiallyTransparent + // ABarControl.MDIButtonEnabled(AButton, MF_GRAYED) + // MINBS_DISABLED, MINBS_HOT, MINBS_NORMAL, MINBS_PUSHED + case AState of + DXBAR_HOT: + AState := 2; + DXBAR_PRESSED: + AState := 4; + DXBAR_DISABLED: + AState := 1; + else{DXBAR_NORMAL, DXBAR_ACTIVE} + AState := 3; + end; + ABarControl.FillBackground(DC, R, ABarControl.ToolbarBrush, clNone, True); + DrawThemeBackground(ATheme, DC, Buttons[AButton], States[AButton, AState], R); +end; + +class procedure TdxBarXPPainter.StatusBarFillNativeBackground(ABarControl: TdxBarControl; + DC: HDC; ADestR, ASourceR, AWholeR: TRect; ABrush: HBRUSH; AColor: TColor); + + procedure FillBackgroundTempBitmap(ABitmap: TBitmap); + var + ATheme: TdxTheme; + begin + ATheme := OpenTheme(totStatus); + with AWholeR do + begin + ABitmap.Width := Right - Left; + ABitmap.Height := Bottom - Top; + end; + DrawThemeBackground(ATheme, ABitmap.Canvas.Handle, 0, 0, AWholeR); + end; + +begin + if ABarControl.BackgroundTempBitmap.Empty then + FillBackgroundTempBitmap(ABarControl.BackgroundTempBitmap); + cxBitBlt(DC, ABarControl.BackgroundTempBitmap.Canvas.Handle, ADestR, ASourceR.TopLeft, SRCCOPY); +end; + +class function TdxBarXPPainter.SubMenuControlArrowsOffset: Integer; +begin + Result := 1; +end; + +function TdxBarXPPainter.SubMenuControlBeginGroupRect( + ABarSubMenuControl: TdxBarSubMenuControl; AControl: TdxBarItemControl; + const AItemRect: TRect): TRect; +begin + Result := AItemRect; + Result.Bottom := Result.Top; + Dec(Result.Top, ABarSubMenuControl.BeginGroupSize); +end; + +function TdxBarXPPainter.SubMenuControlBeginGroupSize: Integer; +begin + Result := FdxBarXPPainterParams.SubMenuControlBeginGroupSize; +end; + +class function TdxBarXPPainter.SubMenuControlDetachCaptionAreaSize(ABarSubMenuControl: TdxBarSubMenuControl): Integer; +begin + Result := ABarSubMenuControl.DetachCaptionSize + 1; +end; + +procedure TdxBarXPPainter.SubMenuControlDrawBeginGroup(ABarSubMenuControl: TdxBarSubMenuControl; + AControl: TdxBarItemControl; ACanvas: TcxCanvas; const ABeginGroupRect: TRect); +begin + // * IsThemeBackgroundPartiallyTransparent + DrawBackground(AControl, ACanvas.Handle, ABeginGroupRect, ABarSubMenuControl.BkBrush, + AControl.FNonRecent and not AControl.FChangeRecentGroup); + SubMenuControlDrawSeparator(ACanvas, ABeginGroupRect) +end; + +procedure TdxBarXPPainter.SubMenuControlDrawSeparator(ACanvas: TcxCanvas; const ARect: TRect); +begin + DrawThemeBackground(OpenTheme(totToolBar), ACanvas.Handle, TP_SEPARATORVERT, TS_NORMAL, ARect); +end; + +procedure TdxBarXPPainter.SubMenuControlDrawBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); +begin + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNSHADOW)); + if ABarSubMenuControl.Detachable then + begin + InflateRect(R, -1, -1); + R.Bottom := R.Top + ABarSubMenuControl.DetachCaptionAreaSize + 1; + FrameRect(DC, R, ABarSubMenuControl.ToolbarItemsBrush); + SubMenuControlDrawDetachCaption(ABarSubMenuControl, DC, ABarSubMenuControl.DetachCaptionRect); + end; +end; + +procedure TdxBarXPPainter.SubMenuControlDrawClientBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; const R: TRect; ABrush: HBRUSH); +begin + FrameRect(DC, R, ABarSubMenuControl.ToolbarItemsBrush); +end; + +class procedure TdxBarXPPainter.SubMenuControlOffsetDetachCaptionRect(ABarSubMenuControl: TdxBarSubMenuControl; + var R: TRect); +begin + InflateRect(R, -2, -2); +end; + +class function TdxBarXPPainter.SubMenuControlToolbarItemsBrush(ABarSubMenuControl: TdxBarSubMenuControl): HBRUSH; +begin + Result := GetSysColorBrush(COLOR_MENU); +end; + +function TdxBarXPPainter.GetCustomColorButtonIndents(APaintType: TdxBarPaintType): TRect; +begin + Result := Rect(1, 1, 1, 1); +end; + +procedure TdxBarXPPainter.ColorComboDrawCustomButton( + const ADrawParams: TdxBarColorComboControlDrawParams; ARect: TRect); +begin + with ADrawParams do + DrawGlyphBorder(BarItemControl, Canvas.Handle, BarItemControl.Parent.BkBrush, True, + ARect, ptHorz, True, DrawSelected, False, IsPressed, False, False); + DrawDots(ADrawParams, ARect); +end; + +procedure TdxBarXPPainter.ColorComboDrawCustomButtonAdjacentZone( + const ADrawParams: TdxBarColorComboControlDrawParams; ARect: TRect); +begin + with ADrawParams do + DrawBackgroundFrameRect(BarItemControl, Canvas.Handle, ARect, BarItemControl.Parent.BkBrush, False); +end; + +class function TdxBarXPPainter.IsDateNavigatorFlat: Boolean; +begin + Result := True; +end; + +class procedure TdxBarXPPainter.DateNavigatorDrawNativeButton(ABarItem: TdxBarItem; + DC: HDC; R: TRect; const ACaption: string; APressed: Boolean); +var + ATheme: TdxTheme; + AState: Integer; + AOffset: Integer; +begin + ATheme := OpenTheme(totToolbar); + FillRect(DC, R, GetSysColorBrush(COLOR_WINDOW)); + if APressed then + begin + AState := TS_PRESSED; + AOffset := 1; + end + else + begin + AState := TS_HOT; + AOffset := 0; + end; + DrawThemeBackground(ATheme, DC, TP_BUTTON, AState, R); + DateNavigatorDrawButtonCaption(DC, R, AOffset, ACaption, False); +end; + +procedure TdxBarXPPainter.DateNavigatorDrawButton(ABarItem: TdxBarItem; + DC: HDC; R: TRect; const ACaption: string; APressed: Boolean); +begin + DateNavigatorDrawNativeButton(ABarItem, DC, R, ACaption, APressed); +end; + +class procedure TdxBarXPPainter.SysPanelDraw(AHandle: HWND; + AllowResizing, MouseAboveCloseButton, CloseButtonIsTracking: Boolean; + var CloseButtonRect, GripRect: TRect; Corner: TdxCorner); +var + R, CR: TRect; + B: Integer; + BorderBrush: HBRUSH; + DC: HDC; + AStyle: Longint; +begin + DC := GetWindowDC(AHandle); + try + GetWindowRect(AHandle, R); + CloseButtonRect := R; + GripRect := R; + GetClientRect(AHandle, CR); + MapWindowRect(0, AHandle, R); + B := -R.Left; + OffsetRect(CR, -R.Left, -R.Top); + OffsetRect(R, -R.Left, -R.Top); + + BorderBrush := GetSysColorBrush(COLOR_BTNSHADOW); + FrameRect(DC, R, BorderBrush); + + if not AllowResizing then + begin + SetRectEmpty(CloseButtonRect); + SetRectEmpty(GripRect); + Exit; + end; + + InflateRect(R, -B, -B); + if Corner in [coBottomLeft, coBottomRight] then + begin + R.Top := R.Bottom - SysPanelSize + 1; + FillRect(DC, Rect(R.Left, R.Top - 1, R.Right, R.Top), BorderBrush); + end + else + begin + R.Bottom := R.Top + SysPanelSize - 1; + FillRect(DC, Rect(R.Left, R.Bottom, R.Right, R.Bottom + 1), BorderBrush); + end; + + CR := R; + ThemeDrawSizeGrip(DC, CR, Corner); // TODO: + with CR do + ExcludeClipRect(DC, Left, Top, Right, Bottom); + InflateRect(CR, 2, 2); + if CR.Top < R.Top then CR.Top := R.Top; + if CR.Bottom > R.Bottom then CR.Bottom := R.Bottom; + OffsetRect(CR, GripRect.Left, GripRect.Top); + GripRect := CR; + + CR := R; + ThemeDrawCloseButton(DC, CR, MouseAboveCloseButton or CloseButtonIsTracking, + MouseAboveCloseButton and CloseButtonIsTracking, Corner); + + with CR do + ExcludeClipRect(DC, Left, Top, Right, Bottom); + with CloseButtonRect do OffsetRect(CR, Left, Top); + CloseButtonRect := CR; + + FillRect(DC, R, COLOR_BTNFACE + 1); + if Corner in [coBottomLeft, coBottomRight] then + begin + AStyle := GetWindowLong(AHandle, GWL_STYLE); + if (AStyle and WS_HSCROLL <> 0) and (AStyle and WS_VSCROLL <> 0) then + with R do + begin + Left := Right - GetSystemMetrics(SM_CXVSCROLL); + Bottom := Top - 1; + Top := Bottom - GetSystemMetrics(SM_CYHSCROLL); + FillRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + end; + end; + finally + ReleaseDC(AHandle, DC); + end; +end; + +class function TdxBarXPPainter.SysPanelSize: Integer; +var + ASizeGripSize: Integer; +begin + Result := ThemeCloseButtonSize.cy + 2 * 2; + ASizeGripSize := ThemeSizeGripSize.cy + 1; + if Result < ASizeGripSize then + Result := ASizeGripSize; +end; + +procedure TdxBarXPPainter.SpinEditControlDrawButton(const ADrawParams: TdxBarSpinEditDrawParams; ARect: TRect; AButtonIndex: Integer); +const + AThemePartId: array [Boolean] of Integer = (SPNP_DOWN, SPNP_UP); + AThemeSpinState: array[TcxButtonState] of Integer = (UPS_NORMAL, UPS_NORMAL, UPS_HOT, UPS_PRESSED, UPS_DISABLED); +begin + with ADrawParams do + begin + // * IsThemeBackgroundPartiallyTransparent + DrawBackground(BarEditControl, Canvas.Handle, ARect, BarEditControl.Parent.BkBrush, False); + DrawThemeBackground(OpenTheme(totSpin), Canvas.Handle, AThemePartId[AButtonIndex = secButtonUp], + AThemeSpinState[GetSpinEditButtonState(ADrawParams, AButtonIndex)], ARect); + end; +end; + +function TdxBarXPPainter.GetSpinEditButtonIndents(APaintType: TdxBarPaintType): TRect; +begin + Result := cxEmptyRect; +end; + +class function TdxBarXPPainter.ProgressControlBarBrushColor: TColorRef; +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totProgress); + if FAILED(GetThemeColor(ATheme, PP_CHUNK, 0, TMT_FILLCOLOR, Result)) then + Result := inherited ProgressControlBarBrushColor; +end; + +function TdxBarXPPainter.ProgressControlBarHeight(ABarItemControl: TdxBarItemControl): Integer; +begin + Result := FdxBarXPPainterParams.ProgressControlBarHeight; +end; + +procedure TdxBarXPPainter.ProgressControlDrawBar(const ADrawParams: TdxbarProgressControlDrawParams; BarR: TRect; ABarBrushColor: TColorRef); +const + BarParts: array[Boolean] of Integer = (PP_BAR, PP_BARVERT); + ChunkParts: array[Boolean] of Integer = (PP_CHUNK, PP_CHUNKVERT); +var + ATheme: TdxTheme; + ABarPartId, AChunkPartId: Integer; + CR: TRect; + ALeft, ARight: ^Integer; + + procedure DrawChunk; + var + ABarBrush: HBRUSH; + begin + if ADrawParams.Smooth then + begin + ABarBrush := CreateSolidBrush(ABarBrushColor); + FillRect(ADrawParams.Canvas.Handle, CR, ABarBrush); + DeleteObject(ABarBrush); + end + else + DrawThemeBackground(ATheme, ADrawParams.Canvas.Handle, AChunkPartId, 0, @CR); + end; + +begin + with ADrawParams do + begin + ATheme := OpenTheme(totProgress); + // * IsThemeBackgroundPartiallyTransparent + ABarPartId := BarParts[PaintType = ptVert]; + AChunkPartId := ChunkParts[PaintType = ptVert]; + if IsThemeBackgroundPartiallyTransparent(ATheme, ABarPartId, 0) then + DrawBackground(BarItemControl, Canvas.Handle, BarR, BarItemControl.Parent.BkBrush, False); + GetThemeBackgroundContentRect(ATheme, Canvas.Handle, ABarPartId, 0, BarR, CR); + // calc rect + with CR do + if PaintType = ptVert then + begin + ALeft := @Top; + ARight := @Bottom; + end + else + begin + ALeft := @Left; + ARight := @Right; + end; + ARight^ := ALeft^ + MulDiv(ARight^ - ALeft^, Position - Min, Max - Min); + // draw chunk + DrawThemeBackground(ATheme, Canvas.Handle, ABarPartId, 0, BarR); + DrawChunk; + end; +end; + +function TdxBarXPPainter.EditGetEnabledBkColor(ABarItemControl: TdxBarCustomEditControl): COLORREF; +begin + Result := ThemeEditColor(OpenTheme(totEdit), ETS_NORMAL); +end; + +function TdxBarXPPainter.EditGetDisabledBkColor(ABarItemControl: TdxBarCustomEditControl): COLORREF; +begin + Result := ThemeEditColor(OpenTheme(totEdit), ETS_DISABLED); +end; + +function TdxBarXPPainter.EditGetEnabledTextColor: COLORREF; +begin + Result := ThemeEditTextColor(OpenTheme(totEdit), ETS_NORMAL); +end; + +function TdxBarXPPainter.EditGetDisabledTextColor: COLORREF; +begin + Result := ThemeEditTextColor(OpenTheme(totEdit), ETS_DISABLED); +end; + +function TdxBarXPPainter.SubMenuGetSeparatorSize: Integer; +begin + Result := FdxBarXPPainterParams.SubMenuControlBeginGroupSize; +end; + +class function TdxBarXPPainter.IsQuickControlPopupOnRight: Boolean; +begin + Result := True; +end; + +function TdxBarXPPainter.IsButtonControlArrowFlat: Boolean; +begin + Result := True; +end; + +function TdxBarXPPainter.GetButtonBorderHeight: Integer; +begin + Result := FdxBarXPPainterParams.ButtonBorderHeight; +end; + +function TdxBarXPPainter.GetButtonBorderWidth: Integer; +begin + Result := GetButtonBorderHeight; +end; + +class procedure TdxBarXPPainter.CorrectButtonControlDefaultHeight(var DefaultHeight: Integer); +begin +// Inc(DefaultHeight, 2); // TODO: check!!! + Inc(DefaultHeight, 1); +end; + +procedure TdxBarXPPainter.DrawButtonControlArrow(const ADrawParams: TdxBarButtonLikeControlDrawParams; + R1: TRect); +begin + if ADrawParams.PaintType = ptMenu then + inherited; +end; + +procedure TdxBarXPPainter.DrawButtonControlArrowBackground(const ADrawParams: TdxBarButtonLikeControlDrawParams; + var R1: TRect; ABrush: HBRUSH); + + function GetState: Integer; + begin + with ADrawParams do + if not (Enabled and DropDownEnabled) then + Result := TS_DISABLED + else + if DroppedDown or IsArrowButtonDowned(PaintType, IsPressed) then + Result := TS_PRESSED + else + if Downed and (PaintType <> ptMenu) then + Result := TS_CHECKED + else + if DrawSelected then + Result := TS_HOT + else + Result := TS_NORMAL; + end; + +var + ATheme: TdxTheme; +begin + inherited; + with ADrawParams do + begin + ATheme := OpenTheme(totToolBar); + // * IsThemeBackgroundPartiallyTransparent + if PaintType = ptMenu then + DrawThemeBackground(ATheme, Canvas.Handle, TP_BUTTON, GetState, R1) + else + DrawThemeBackground(ATheme, Canvas.Handle, TP_SPLITBUTTONDROPDOWN, GetState, R1); + end; +end; + +class function TdxBarXPPainter.EditControlBorderOffsets(APaintType: TdxBarPaintType): TRect; +begin + Result := FdxBarXPPainterParams.EditControlBorderOffsets; +end; + +procedure TdxBarXPPainter.EditControlDrawBorder( + const ADrawParams: TdxBarEditLikeControlDrawParams; var ARect: TRect); +var + ATheme: TdxTheme; + AClipRgn: HRGN; + AClipRgnExists: Boolean; + AEditState: Integer; + R: TRect; +begin + with ADrawParams do + begin + ATheme := OpenTheme(totEdit); + AEditState := ThemeEditState(BarEditControl); + R := ARect; + GetThemeBackgroundContentRect(ATheme, Canvas.Handle, EP_EDITTEXT, AEditState, R, ARect); + SaveClipRgn(Canvas.Handle, AClipRgn, AClipRgnExists); + with ARect do + ExcludeClipRect(Canvas.Handle, Left, Top, Right, Bottom); + if (not Enabled or (PaintType = ptMenu)) and not IsTransparent or DrawSelected then + DrawThemeBackground(ATheme, Canvas.Handle, EP_EDITTEXT, AEditState, R) + else + DrawBackground(BarEditControl, Canvas.Handle, R, BarEditControl.Parent.BkBrush, BarEditControl.FNonRecent); + RestoreClipRgn(Canvas.Handle, AClipRgn, AClipRgnExists); + end; +end; + +class function TdxBarXPPainter.EditControlCaptionRightIndentIsOpaque( + const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; +begin + with ADrawParams do + Result := (PaintType = ptMenu) and (DrawSelected or BarItemControl.FNonRecent); +end; + +class function TdxBarXPPainter.EditControlCaptionAbsoluteLeftIndent( + const ADrawParams: TdxBarEditLikeControlDrawParams): Integer; +begin + Result := 6; +end; + +class function TdxBarXPPainter.EditControlCaptionRightIndent: Integer; +begin + Result := 5; +end; + +class function TdxBarXPPainter.EditControlSubMenuGlyphIndents( + const ADrawParams: TdxBarEditLikeControlDrawParams): TRect; +begin + Result := Rect(5, 0, 0, 0); +end; + +class function TdxBarXPPainter.EditControlGetRightCaptionIndentBrush(ABarEditControl: TdxBarCustomEditControl): HBRUSH; +begin + Result := ABarEditControl.CaptionBkBrush; +end; + +class procedure TdxBarXPPainter.CustomComboDrawItem(ABarCustomCombo: TdxBarCustomCombo; + ACanvas: TCanvas; AIndex: Integer; ARect: TRect; AState: TOwnerDrawState; + AInteriorIsDrawing: Boolean); +begin + TdxBarFlatPainter.CustomComboDrawItem(ABarCustomCombo, ACanvas, + AIndex, ARect, AState, AInteriorIsDrawing); +end; + +class function TdxBarXPPainter.ComboControlArrowOffset: Integer; +begin + Result := 0; +end; + +procedure TdxBarXPPainter.ComboControlDrawArrowButton( + const ADrawParams: TdxBarEditLikeControlDrawParams; ARect: TRect; + AInClientArea: Boolean); + + function GetState: Integer; + begin + with ADrawParams do + if not Enabled then + Result := CBXS_DISABLED + else + if DroppedDown then + Result := CBXS_PRESSED + else + if DrawSelected then + Result := CBXS_HOT + else + Result := CBXS_NORMAL; + end; + +var + AButtonState: Integer; +begin + AButtonState := GetState; + if IsThemeBackgroundPartiallyTransparent(OpenTheme(totComboBox), + CP_DROPDOWNBUTTON, AButtonState) then + FillRectByColor(ADrawParams.Canvas.Handle, ARect, EditGetBkColor(ADrawParams)); + DrawThemeBackground(OpenTheme(totComboBox), ADrawParams.Canvas.Handle, + CP_DROPDOWNBUTTON, AButtonState, ARect); +end; + +procedure TdxBarXPPainter.DrawGlyphBorder(ABarItemControl: TdxBarItemControl; + DC: HDC; ABrush: HBRUSH; NeedBorder: Boolean; R: TRect; PaintType: TdxBarPaintType; IsGlyphEmpty, + Selected, Down, DrawDowned, ADroppedDown, IsSplit: Boolean); +var + ATheme: TdxTheme; + AState: Integer; +begin + ATheme := OpenTheme(totToolBar); + // * IsThemeBackgroundPartiallyTransparent + if (PaintType = ptMenu) and (Selected or ABarItemControl.FNonRecent) and + IsGlyphEmpty and not Down or ABarItemControl.IsBkColorAssigned then + FillRect(DC, R, ABrush) + else + begin + DrawBackground(ABarItemControl, DC, R, ABrush, False); + if IsMenuItem(ABarItemControl) and (PaintType <> ptMenu) and + (Selected or DrawDowned or Down or ADroppedDown) then + FillRect(DC, R, GetSysColorBrush(COLOR_HIGHLIGHT)) // *** + else + begin + if not ABarItemControl.Enabled then + AState := TS_DISABLED + else + if DrawDowned then + AState := TS_PRESSED + else + if Down or ADroppedDown and not IsSplit then + AState := TS_CHECKED + else + if Selected then + AState := TS_HOT + else + AState := TS_NORMAL; + + if IsSplit then + DrawThemeBackground(ATheme, DC, TP_SPLITBUTTON, AState, R) + else + DrawThemeBackground(ATheme, DC, TP_BUTTON, AState, R); + end; + end; +end; + +procedure TdxBarXPPainter.DrawGlyphCheckMark(ABarItemControl: TdxBarItemControl; + DC: HDC; X, Y, DoubleSize: Integer); +begin + dxBarFlatPainter.DrawGlyphCheckMark(ABarItemControl, DC, X, Y, DoubleSize); +end; + +class function TdxBarXPPainter.GetFaded(ABarControl: TCustomdxBarControl): Boolean; +begin + Result := True; +end; + +class function TdxBarXPPainter.IsMenuItem(ABarItemControl: TdxBarItemControl): Boolean; +begin + Result := ABarItemControl.IsMenuItem; +end; + +class procedure TdxBarXPPainter.BarDrawNativeGrip(ABarControl: TdxBarControl; + DC: HDC; R: TRect; AToolbarBrush: HBRUSH); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totStatus); + // * IsThemeBackgroundPartiallyTransparent + DrawThemeBackground(ATheme, DC, SP_GRIPPER, 0, R); +end; + +procedure TdxBarXPPainter.BarDrawMarkBackground(ABarControl: TdxBarControl; + DC: HDC; ItemRect: TRect; AToolbarBrush: HBRUSH); +const + States: array[TdxBarMarkState] of Integer = + (TS_NORMAL, TS_HOT, TS_PRESSED); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totToolbar); + // * IsThemeBackgroundPartiallyTransparent + ABarControl.FillBackground(DC, ItemRect, AToolbarBrush, clNone, True); + if ABarControl.Bar.BorderStyle = bbsNone then + begin + if ABarControl.Horizontal then + InflateRect(ItemRect, 0, -2) + else + InflateRect(ItemRect, -2, 0); + end; + DrawThemeBackground(ATheme, DC, TP_BUTTON, States[ABarControl.MarkDrawState], ItemRect); +end; + +class procedure TdxBarXPPainter.BarOffsetFloatingBarCaption(ABarControl: TdxBarControl; + var X: Integer; var R: TRect); +begin + Inc(X, 2); + R.Right := ABarControl.MarkNCRect.Left; +end; + +function TdxBarXPPainter.GetDotSpaceAfter(ADotWidth: Integer): Integer; +begin + Result := ADotWidth * 2; +end; + +procedure TdxBarXPPainter.DrawDot(const ADrawParams: TdxBarEditLikeControlDrawParams; ARect: TRect); +begin + if ADrawParams.Enabled then + FillRect(ADrawParams.Canvas.Handle, ARect, COLOR_BTNTEXT + 1) + else + inherited; +end; + +procedure TdxBarXPPainter.BarBeginGroupSizeInit; +var + ATheme: TdxTheme; + ASize: TSize; +begin + ATheme := OpenTheme(totToolBar); + GetThemePartSize(ATheme, 0, TP_SEPARATOR, TS_NORMAL, TS_MIN, ASize); + FdxBarXPPainterParams.BarBeginGroupSize := ASize.cx; +end; + +procedure TdxBarXPPainter.BarCloseButtonSizeInit; +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totWindow); + GetThemePartSize(ATheme, 0, WP_SMALLCLOSEBUTTON, CBS_NORMAL, TS_TRUE, FdxBarXPPainterParams.BarCloseButtonSize); +end; + +procedure TdxBarXPPainter.ButtonBorderHeightInit; +var + R, RC: TRect; +begin + R := Rect(0, 0, 100, 100); + GetThemeBackgroundContentRect(OpenTheme(totToolBar), 0, TP_SPLITBUTTON, TS_NORMAL, R, RC); // ? + FdxBarXPPainterParams.ButtonBorderHeight := cxRectHeight(R) - cxRectHeight(RC); +end; + +procedure TdxBarXPPainter.ComboBoxArrowWidthInit; +var + ATheme: TdxTheme; + ASize: TSize; +begin + ATheme := OpenTheme(totComboBox); + GetThemePartSize(ATheme, 0, CP_DROPDOWNBUTTON, CBXS_NORMAL, TS_TRUE, ASize); + FdxBarXPPainterParams.ComboBoxArrowWidth := ASize.cx; +end; + +procedure TdxBarXPPainter.EditControlBorderOffsetsInit; +var + AContentRect, R: TRect; +begin + R := Rect(0, 0, 100, 100); + GetThemeBackgroundContentRect(OpenTheme(totEdit), 0, EP_EDITTEXT, ETS_NORMAL, R, AContentRect); + FdxBarXPPainterParams.EditControlBorderOffsets := Rect(AContentRect.Left, AContentRect.Top, + R.Right - AContentRect.Right, R.Bottom - AContentRect.Bottom); +end; + +procedure TdxBarXPPainter.GripperSizeInit; +var + ATheme: TdxTheme; + ASize: TSize; +begin + ATheme := OpenTheme(totRebar); + GetThemePartSize(ATheme, 0, RP_GRIPPER, CHEVS_NORMAL, TS_TRUE, ASize); + FdxBarXPPainterParams.GripperSize := ASize.cx; +end; + +procedure TdxBarXPPainter.InitParams; +begin + BarBeginGroupSizeInit; + BarCloseButtonSizeInit; + ButtonBorderHeightInit; + ComboBoxArrowWidthInit; + EditControlBorderOffsetsInit; + GripperSizeInit; + ProgressControlBarHeightInit; + SubMenuControlBeginGroupSizeInit; + StatusBarGripSizeInit; +end; + +procedure TdxBarXPPainter.ProgressControlBarHeightInit; +var + ATheme: TdxTheme; + ASize: TSize; + R, CR: TRect; +begin + ATheme := OpenTheme(totProgress); + GetThemePartSize(ATheme, 0, PP_CHUNK, 0, TS_TRUE, ASize); + GetThemeBackgroundContentRect(ATheme, 0, PP_BAR, 0, R, CR); + FdxBarXPPainterParams.ProgressControlBarHeight := ASize.cy + (R.Right - R.Left) - (CR.Right - CR.Left); +end; + +procedure TdxBarXPPainter.StatusBarGripSizeInit; +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totStatus); + GetThemePartSize(ATheme, 0, SP_GRIPPER, 0, TS_TRUE, FdxBarXPPainterParams.StatusBarGripSize); +end; + +procedure TdxBarXPPainter.SubMenuControlBeginGroupSizeInit; +var + ATheme: TdxTheme; + ASize: TSize; +begin + ATheme := OpenTheme(totToolBar); + GetThemePartSize(ATheme, 0, TP_SEPARATORVERT, TS_NORMAL, TS_TRUE, ASize); + FdxBarXPPainterParams.SubMenuControlBeginGroupSize := ASize.cy; +end; + +class function TdxBarXPPainter.IsArrowButtonDowned(APaintStyle: TdxBarPaintType; AIsPressed: Boolean): Boolean; +begin + Result := (APaintStyle <> ptMenu) and AIsPressed; +end; + +{ TdxBarSkinnedPainter } + +constructor TdxBarSkinnedPainter.Create(AData: Integer); +begin + inherited Create(AData); + FSkinnedObject := TObject(AData); +end; + +procedure TdxBarSkinnedPainter.CalculateButtonParts( + const ADrawParams: TdxBarButtonLikeControlDrawParams; var AParts: array of TRect; const AItemRect: TRect); +var + ACaptionHeight: Integer; +begin + if ADrawParams.IsDropDown then + begin + if (ADrawParams.PaintType = ptMenu) or (ADrawParams.ViewSize = cvsSmall) then + inherited + else + begin + ACaptionHeight := cxRectHeight(cxGetTextRect(ADrawParams.Canvas.Handle, ADrawParams.Caption, GetMaxLineCount, True)) + 2{!!!}; + AParts[bcpDropButton].Top := AParts[bcpDropButton].Bottom - ACaptionHeight; + AParts[bcpButton].Bottom := AParts[bcpDropButton].Top; + end; + end; +end; + +procedure TdxBarSkinnedPainter.CalculateSpinEditParts(const ADrawParams: TdxBarSpinEditDrawParams; + var AParts: array of TRect; const AItemRect: TRect); +begin + inherited; + Dec(AParts[secButtonUp].Bottom); + AParts[ecpEdit].Right := AParts[secButtonUp].Left; +end; + +procedure TdxBarSkinnedPainter.DrawArrow(ADC: HDC; ARect: TRect; AArrowState: Integer); +begin + Inc(ARect.Left, (cxRectWidth(ARect) div 2) - (GetDefaultArrowSignSize.cx div 2)); + Inc(ARect.Top, (cxRectHeight(ARect) div 2) - (GetDefaultArrowSignSize.cy div 2)); + ARect.Right := ARect.Left + GetDefaultArrowSignSize.cx; + ARect.Bottom := ARect.Top + GetDefaultArrowSignSize.cy; + Skin.DrawBackground(ADC, ARect, DXBAR_ARROWDOWN, AArrowState); +end; + +class function TdxBarSkinnedPainter.GetDefaultTextSize(ACanvas: TcxCanvas): Integer; +begin + Result := ACanvas.TextHeight('Wg') + 3; +end; + +procedure TdxBarSkinnedPainter.DrawItemBackgroundInSubMenu(const ADrawParams: TdxBarButtonLikeControlDrawParams; R: TRect); + + procedure InternalDrawBackground(AControlPart, ASkinPart: Integer); + + function InternalGetPartState: Integer; + begin + if (AControlPart = bcpDropButton) and ADrawParams.DroppedDown or + (AControlPart = bcpButton) and ADrawParams.DrawSelected and (ADrawParams.ViewSize <> cvsLarge) then + Result := DXBAR_HOT + else + Result := GetPartState(ADrawParams, AControlPart); + end; + + begin + Skin.DrawBackground(ADrawParams.Canvas.Handle, + ADrawParams.BarItemControl.FParts[AControlPart], ASkinPart, InternalGetPartState); + end; + +var + AButtonPart, AGlyphPart, ADropButtonPart: Integer; +begin + with ADrawParams do + begin + DrawBackground(BarItemControl, Canvas.Handle, R, 0, False); + if DrawSelected then + begin + AButtonPart := DXBAR_SMALLBUTTON; + AGlyphPart := DXBAR_SMALLBUTTON_GLYPH; + ADropButtonPart := DXBAR_SMALLBUTTON_DROPBUTTON; + + if SplitDropDown and IsDropDown then + begin + InternalDrawBackground(bcpButton, AGlyphPart); + InternalDrawBackground(bcpDropButton, ADropButtonPart); + end + else + InternalDrawBackground(bcpButton, AButtonPart); + end; + end; +end; + +procedure TdxBarSkinnedPainter.DrawGlyphAndBkgnd( + ABarItemControl: TdxBarItemControl; ADC: HDC; + const R, AGlyphRect: TRect; APaintType: TdxBarPaintType; AGlyph: TBitmap; + AImages: TCustomImageList; AImageIndex: Integer; AGlyphEmpty, ASelected, ADowned, + ADrawDowned, ADroppedDown, AForceUseBkBrush, AGrayScale, AIsSplit: Boolean); +var + ACheckSize: Integer; + ACheckRect: TRect; + AState: Integer; +begin + if (APaintType = ptMenu) and ADowned then + begin + if ABarItemControl.Enabled then + AState := DXBAR_NORMAL + else + AState := DXBAR_DISABLED; + ACheckSize := Min(cxRectWidth(R), cxRectHeight(R)); + ACheckRect := cxRectCenter(R, cxSize(ACheckSize, ACheckSize)); + InflateRect(ACheckRect, -1, -1); + if AGlyphEmpty then + Skin.DrawBackground(ADC, ACheckRect, DXBAR_MENUCHECKMARK, AState) + else + Skin.DrawBackground(ADC, ACheckRect, DXBAR_MENUCHECK, AState); + end; + if not AGlyphEmpty then + TransparentDraw(ABarItemControl, ADC, 0, R, AGlyphRect, + AGlyph, AImages, AImageIndex, ABarItemControl.BarManager.ImageListBkColor, + ABarItemControl.GetImageEnabled(APaintType), AGrayScale, False {Flat}, ASelected, ADowned, ADrawDowned, + False{Shadow}, GetFaded(ABarItemControl.Parent){Faded}, + ABarItemControl.BarManager.ImageOptions.SmoothGlyphs, + ABarItemControl.BarManager.ImageOptions.UseLeftBottomPixelAsTransparent); +end; + +function TdxBarSkinnedPainter.GetToolbarContentOffsets(ABar: TdxBar; + ADockingStyle: TdxBarDockingStyle; AHasSizeGrip: Boolean): TRect; +begin + Result := Skin.GetContentOffsets(DXBAR_TOOLBAR); +end; + +function TdxBarSkinnedPainter.GetToolbarsOffsetForAutoAlign: Integer; +begin + Result := Skin.GetPartOffset(DXBAR_TOOLBAR); +end; + +class function TdxBarSkinnedPainter.RealButtonArrowWidth(ABarManager: TdxBarManager): Integer; +begin + Result := 13; +end; + +class function TdxBarSkinnedPainter.LoweredBorderSize(ABarItemControl: TdxBarItemControl): Integer; +begin + Result := 0; +end; + +function TdxBarSkinnedPainter.BarLinkedOwnerHasShadow(ABarControl: TCustomdxBarControl): Boolean; +begin + Result := False; +end; + +procedure TdxBarSkinnedPainter.BarDrawBackground(ABarControl: TdxBarControl; ADC: HDC; + const ADestRect, ASourceRect: TRect; ABrush: HBRUSH; AColor: TColor); +begin + BarCanvas.BeginPaint(ADC); + try + BarCanvas.SetClipRegion(TcxRegion.Create(ADestRect), roIntersect); + DrawToolbarContentPart(ABarControl, BarCanvas); + finally + BarCanvas.EndPaint; + end; +end; + +procedure TdxBarSkinnedPainter.BarDrawDockedBackground( + ABarControl: TdxBarControl; DC: HDC; ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); +begin + Skin.DrawBackground(DC, ADestR, DXBAR_TOOLBAR, GetBarControlState(ABarControl)); +end; + +function TdxBarSkinnedPainter.ComboBoxArrowWidth(ABarControl: TCustomdxBarControl; cX: Integer): Integer; +begin + if Skin.GetName <> '' then + Result := 19 + else + Result := cX + 8; +end; + +class procedure TdxBarSkinnedPainter.SetWindowRgn(AHandle: THandle; + const AWindowRect: TRect; ARedraw: Boolean = False); +var + ARegion: HRGN; +begin + with AWindowRect do + ARegion := CreateRoundRectRgn(0, 0, Right + 1, Bottom + 1, 2, 2); + Windows.SetWindowRgn(AHandle, ARegion, ARedraw); +end; + +procedure TdxBarSkinnedPainter.BarDrawBeginGroup( + ABarControl: TCustomdxBarControl; DC: HDC; ABeginGroupRect: TRect; + AToolbarBrush: HBRUSH; AHorz: Boolean); +begin + InternalDrawBeginGroup(DC, ABeginGroupRect, AHorz, $EBE8E6, $AAA6A2); +end; + +class function TdxBarSkinnedPainter.GetTailAreaSize(const ADrawParams: TdxBarItemControlDrawParams): Integer; +begin + if ADrawParams.ViewSize = cvsLarge then + Result := ADrawParams.BarItemControl.Parent.TextSize + else + Result := inherited GetTailAreaSize(ADrawParams); +end; + +function TdxBarSkinnedPainter.GetButtonBorderHeight: Integer; +begin + with Skin.GetContentOffsets(DXBAR_SMALLBUTTON) do + Result := Top + Bottom; +end; + +function TdxBarSkinnedPainter.GetButtonBorderWidth: Integer; +begin + with Skin.GetContentOffsets(DXBAR_SMALLBUTTON) do + Result := Left + Right; +end; + +function TdxBarSkinnedPainter.GetButtonHeight(AIconSize, ATextSize: Integer): Integer; +begin + Result := Max(GetSmallIconSize, ATextSize) + GetButtonBorderHeight; + if Odd(Result) then + Inc(Result); +end; + +function TdxBarSkinnedPainter.GetButtonWidth(AIconSize, ATextSize: Integer): Integer; +begin + Result := Max(GetSmallIconSize, ATextSize) + GetButtonBorderWidth; + if Odd(Result) then + Inc(Result); +end; + +class procedure TdxBarSkinnedPainter.CorrectButtonControlDefaultHeight(var DefaultHeight: Integer); +begin +// do nothing +end; + +procedure TdxBarSkinnedPainter.DrawButtonLikeControl( + const ADrawParams: TdxBarButtonLikeControlDrawParams; ARect: TRect); +var + AImageBounds: TRect; +begin + with ADrawParams do + begin + if PaintType = ptMenu then + DrawGlyphAndTextInSubMenu(ADrawParams, ARect) + else + begin + DrawButtonBackground(ADrawParams); + + DrawGlyph(BarItemControl, Canvas.Handle, ARect, ARect, AImageBounds, PaintType, + ViewStructure, ViewSize, not (cpIcon in ViewStructure), DrawSelected, + Downed, DrawDowned, DroppedDown, False, False, False, SplitDropDown and IsDropDown); + + DrawButtonLikeControlCaption(ADrawParams, ARect, AImageBounds); + end; + if IsDropDown and not IsMenuItem then + if SplitDropDown then + DrawSplitControlArrow(ADrawParams, ARect) + else + DrawAssociateControlArrow(ADrawParams, ARect); + end; +end; + +procedure TdxBarSkinnedPainter.DrawButtonControlArrow(const ADrawParams: TdxBarButtonLikeControlDrawParams; R1: TRect); +begin + if ADrawParams.PaintType = ptMenu then + ButtonLikeControlDrawMenuArrow(ADrawParams, adRight, R1) + else + if ADrawParams.ViewSize <> cvsLarge then + DrawArrow(ADrawParams.Canvas.Handle, GetArrowRect(ADrawParams, R1), GetButtonPartState(ADrawParams, bcpDropButton)); +end; + +procedure TdxBarSkinnedPainter.DrawSplitControlArrow(const ADrawParams: TdxBarButtonLikeControlDrawParams; ARect: TRect); +var + ARatio: Double; +begin + DrawButtonControlArrow(ADrawParams, ARect); + + if (ADrawParams.PaintType = ptMenu) and (ADrawParams.ViewSize <> cvsLarge) and not ADrawParams.DrawSelected then + begin + ARect := GetArrowRect(ADrawParams, ARect); + ARatio := Max(1, cxRectHeight(ARect) / SubMenuControlNormalItemHeight); + InflateRect(ARect, 0, -Round((cxRectHeight(ARect) - 14 * ARatio) / 2)); + ADrawParams.Canvas.DrawComplexFrame(ARect, Skin.GetPartColor(DXBAR_MENUARROWSEPARATOR), clNone, [bLeft]); + end; +end; + +procedure TdxBarSkinnedPainter.DrawAssociateControlArrow(const ADrawParams: TdxBarButtonLikeControlDrawParams; ARect: TRect); +begin + DrawButtonControlArrow(ADrawParams, ARect); +end; + +function TdxBarSkinnedPainter.GetBorderSize: Integer; +begin + Result := 2; +end; + +function TdxBarSkinnedPainter.GetIconAreaSize(ABarControl: TCustomdxBarControl): Integer; +begin + Result := inherited GetIconAreaSize(ABarControl); + if (ABarControl.Kind = bkSubMenu) and (ABarControl.ItemLinks.ItemSize = misNormal) then + Inc(Result, MenuSeparatorSize); +end; + +procedure TdxBarSkinnedPainter.CorrectCaptionParams( + const ADrawParams: TdxBarButtonLikeControlDrawParams; + var ATextBounds: TRect; const AImageBounds: TRect; out ATextAlignment: DWORD); +var + ACaptionRect: TRect; +begin + ACaptionRect := GetControlCaptionRect(ADrawParams); + if ADrawParams.ViewSize = cvsLarge then + begin + OffsetRect(ACaptionRect, + ATextBounds.Left + (cxRectWidth(ATextBounds) - cxRectWidth(ACaptionRect)) div 2, + ATextBounds.Top + cxRectHeight(ATextBounds) - (cxRectHeight(ACaptionRect) + 1)); + ATextBounds := ACaptionRect; + ATextAlignment := DT_CENTER; + end + else + begin + if cpIcon in ADrawParams.ViewStructure then + ATextBounds.Left := AImageBounds.Right + GetControlTextIndents.Left + else + ATextBounds.Left := ATextBounds.Left + ADrawParams.BarItemControl.GetControlCaptionOffset; + InflateRect(ATextBounds, 0, -(cxRectHeight(ATextBounds) - cxRectHeight(ACaptionRect)) div 2); + ATextAlignment := DT_LEFT; + end; +end; + +function TdxBarSkinnedPainter.AllowLargeIcons: Boolean; +begin + Result := False; +end; + +procedure TdxBarSkinnedPainter.BarDrawMarkElements( + ABarControl: TdxBarControl; DC: HDC; ItemRect: TRect); + + function GetMarkState: Integer; + begin + case ABarControl.MarkDrawState of + msSelected: Result := DXBAR_HOT; + msPressed: Result := DXBAR_PRESSED; + else {msNone} + Result := DXBAR_NORMAL; + end; + end; +begin + if ABarControl.FTruncated then + Skin.DrawBackground(DC, ItemRect, DXBAR_MARKTRUNCATED, GetMarkState) + else + Skin.DrawBackground(DC, ItemRect, DXBAR_MARKARROW, GetMarkState); +end; + +procedure TdxBarSkinnedPainter.DropDownListBoxDrawBorder(DC: HDC; AColor: TColor; ARect: TRect); +begin + Skin.DrawBackground(DC, ARect, DXBAR_DROPDOWNBORDER, DXBAR_NORMAL); +end; + +class function TdxBarSkinnedPainter.SubMenuControlHasBand: Boolean; +begin + Result := True; +end; + +class function TdxBarSkinnedPainter.SubMenuControlArrowWidth(ATextSize: Integer): Integer; +begin + Result := ATextSize; +end; + +function TdxBarSkinnedPainter.SubMenuControlBeginGroupSize: Integer; +begin + Result := 3; +end; + +class function TdxBarSkinnedPainter.SubMenuControlDetachCaptionAreaSize(ABarSubMenuControl: TdxBarSubMenuControl): Integer; +begin + Result := 2 + ABarSubMenuControl.DetachCaptionSize + 1; +end; + +class function TdxBarSkinnedPainter.SubMenuControlGetItemIconRect(const AItemRect: TRect; AIconAreaSize: Integer): TRect; +begin + Result := TdxBarPainter.SubMenuControlGetItemIconRect(AItemRect, AIconAreaSize); +end; + +class function TdxBarSkinnedPainter.SubMenuControlGetItemTextIndent(const ADrawParams: TdxBarItemControlDrawParams): Integer; +begin + with ADrawParams.BarItemControl do + if SubMenuParent.ItemLinks.ItemSize = misNormal then + Result := SubMenuParent.IconAreaSize + SubMenuControlTextIndent + else + Result := SubMenuParent.IconAreaSize + 4; //! +end; + +procedure TdxBarSkinnedPainter.SubMenuControlDrawScrollBandBackground(ABarSubMenuControl: TdxBarSubMenuControl; ACanvas: TcxCanvas; AArrowDirection: TcxArrowDirection); +begin +// do nothing +end; + +procedure TdxBarSkinnedPainter.SubMenuControlDrawScrollButton(ABarSubMenuControl: TdxBarSubMenuControl; ACanvas: TcxCanvas; AArrowDirection: TcxArrowDirection); +var + AState: Integer; + ARect: TRect; +begin + ARect := SubMenuControlGetScrollBandBounds(ABarSubMenuControl, AArrowDirection); + if (AArrowDirection = adUp) and (ABarSubMenuControl.MouseOnUpArrow) or + (AArrowDirection = adDown) and (ABarSubMenuControl.MouseOnDownArrow) then + AState := DXBAR_HOT + else + AState := DXBAR_NORMAL; + + ABarSubMenuControl.FillBackgroundEx(ACanvas, ARect, 0, clNone, True); + Skin.DrawBackground(ACanvas.Handle, ARect, DXBAR_MENUSCROLLAREA, AState); + ACanvas.ExcludeClipRect(ARect); +end; + +procedure TdxBarSkinnedPainter.SubMenuControlDrawBackground(ABarSubMenuControl: TdxBarSubMenuControl; + ACanvas: TcxCanvas; ARect: TRect; ABrush: HBRUSH; AColor: TColor); +begin + SubMenuControlDrawItemBackground(ABarSubMenuControl, ACanvas, ARect); +end; + +procedure TdxBarSkinnedPainter.SubMenuControlDrawBeginGroup(ABarSubMenuControl: TdxBarSubMenuControl; + AControl: TdxBarItemControl; ACanvas: TcxCanvas; const ABeginGroupRect: TRect); +var + ASeparatorRect: TRect; +begin + with ABeginGroupRect do + ASeparatorRect := cxRect(Left + ABarSubMenuControl.GetIndent1 + SubMenuControlTextIndent, + Bottom - SubMenuGetSeparatorSize, + Right, + Bottom); + SubMenuControlDrawBackground(ABarSubMenuControl, ACanvas, ABeginGroupRect, 0, clNone); + SubMenuControlDrawSeparator(ACanvas, ASeparatorRect); +end; + +procedure TdxBarSkinnedPainter.SubMenuControlDrawSeparator(ACanvas: TcxCanvas; const ARect: TRect); +begin + Skin.DrawBackground(ACanvas.Handle, ARect, DXBAR_MENUSEPARATORHORZ, DXBAR_NORMAL); +end; + +procedure TdxBarSkinnedPainter.SubMenuControlDrawBorder( + ABarSubMenuControl: TdxBarSubMenuControl; DC: HDC; R: TRect); +var + ARect: TRect; +begin + BarCanvas.BeginPaint(DC); + try + ARect := cxRectOffset(ABarSubMenuControl.ClientRect, ABarSubMenuControl.GetClientOffset.TopLeft); + BarCanvas.ExcludeClipRect(ARect); + + Skin.DrawBackground(DC, R, DXBAR_DROPDOWNBORDER, DXBAR_NORMAL); + + if ABarSubMenuControl.Detachable then + begin + InflateRect(R, -SubMenuControlBorderSize, -SubMenuControlBorderSize); + FillRectByColor(DC, R, Skin.GetPartColor(DXBAR_MENUDETACHCAPTIONAREA)); + SubMenuControlDrawDetachCaption(ABarSubMenuControl, DC, ABarSubMenuControl.DetachCaptionRect); + end; + finally + BarCanvas.EndPaint; + end; +end; + +procedure TdxBarSkinnedPainter.SubMenuControlDrawClientBorder( + ABarSubMenuControl: TdxBarSubMenuControl; DC: HDC; const R: TRect; ABrush: HBRUSH); +begin + // no client border +end; + +procedure TdxBarSkinnedPainter.SubMenuControlDrawDetachCaption( + ABarSubMenuControl: TdxBarSubMenuControl; DC: HDC; R: TRect); +const + DetachCaptionStates: array[Boolean] of Integer = (DXBAR_NORMAL, DXBAR_HOT); +begin + Skin.DrawBackground(DC, R, DXBAR_MENUDETACHCAPTION, DetachCaptionStates[ABarSubMenuControl.DetachCaptionSelected]); +end; + +procedure TdxBarSkinnedPainter.SubMenuControlDrawItemBackground( + ABarSubMenuControl: TdxBarSubMenuControl; ACanvas: TcxCanvas; AItemRect: TRect); +var + AContentRect, ABarRect, ABandRect, ASeparatorRect, AControlRect: TRect; +begin + cxRectIntersect(AContentRect, ABarSubMenuControl.ContentRect, AItemRect); + ABarRect := ABarSubMenuControl.BarRect; + + ABandRect := Rect(ABarRect.Right, AContentRect.Top, + ABarRect.Right + ABarSubMenuControl.BandSize, AContentRect.Bottom); + ASeparatorRect := Rect(ABandRect.Right, AContentRect.Top, + ABandRect.Right + MenuSeparatorSize, AContentRect.Bottom); + AControlRect := Rect(ASeparatorRect.Right, AContentRect.Top, AContentRect.Right, AContentRect.Bottom); + + if ABarSubMenuControl.ItemLinks.ItemSize = misNormal then + begin + Skin.DrawBackground(ACanvas.Handle, ABandRect, DXBAR_MENUGLYPH); + Skin.DrawBackground(ACanvas.Handle, ASeparatorRect, DXBAR_MENUSEPARATORVERT); + end + else + begin + Skin.DrawBackground(ACanvas.Handle, ABandRect, DXBAR_MENUCONTENT); + Skin.DrawBackground(ACanvas.Handle, ASeparatorRect, DXBAR_MENUCONTENT); + end; + Skin.DrawBackground(ACanvas.Handle, AControlRect, DXBAR_MENUCONTENT); +end; + +class function TdxBarSkinnedPainter.SubMenuControlGetBandSize(ABarSubMenuControl: TdxBarSubMenuControl): Integer; +begin + Result := SubMenuControlInternalBorderSize + ABarSubMenuControl.IconAreaSize - MenuSeparatorSize; +end; + +class function TdxBarSkinnedPainter.SubMenuControlNormalItemHeight: Integer; +begin + Result := 22; +end; + +class function TdxBarSkinnedPainter.SubMenuControlTextIndent: Integer; +begin + Result := 7; +end; + +class function TdxBarSkinnedPainter.SubMenuControlInternalBorderSize: Integer; +begin + Result := 2; +end; + +class function TdxBarSkinnedPainter.SubMenuControlInternalBorderOffset: Integer; +begin + Result := 1; +end; + +class function TdxBarSkinnedPainter.SubMenuControlTextSize(ACanvas: TcxCanvas): Integer; +begin + Result := GetDefaultTextSize(ACanvas) + (SubMenuControlInternalBorderSize + SubMenuControlInternalBorderOffset) * 2; +end; + +class function TdxBarSkinnedPainter.SubMenuControlNCBorderSize: Integer; +begin + Result := 2; +end; + +class function TdxBarSkinnedPainter.SubMenuControlClientBorderSize: Integer; +begin + Result := 0; +end; + +procedure TdxBarSkinnedPainter.ApplicationMenuDrawBorder(ABarSubMenuControl: TdxBarSubMenuControl; DC: HDC; const ARect: TRect); +begin + BarCanvas.BeginPaint(DC); + try + BarCanvas.ExcludeClipRect(cxRectInflate(ARect, -SubMenuControlInternalBorderSize, -SubMenuControlInternalBorderSize)); + Skin.DrawBackground(BarCanvas.Handle, ARect, DXBAR_APPLICATIONMENUBORDER); + finally + BarCanvas.EndPaint; + end; +end; + +procedure TdxBarSkinnedPainter.ApplicationMenuDrawButton(const ADrawParams: TdxBarApplicationMenuButtonControlDrawParams; var R: TRect); +const + AState: array [Boolean] of Integer = (DXBAR_NORMAL, DXBAR_HOT); +var + AImageBounds: TRect; +begin + with ADrawParams do + begin + DrawBackground(BarItemControl, Canvas.Handle, R, 0, False); + Skin.DrawBackground(Canvas.Handle, R, DXBAR_APPLICATIONMENUBUTTON, AState[DrawSelected]); + R.Left := R.Left + Max((cxRectWidth(R) - ContentWidth) div 2, 0); + DrawGlyph(BarItemControl, Canvas.Handle, R, R, AImageBounds, PaintType, + ViewStructure, ViewSize, not (cpIcon in ViewStructure), DrawSelected, False, False, False, False, False, False, False); + + DrawButtonLikeControlCaption(ADrawParams, R, AImageBounds) + end; +end; + +procedure TdxBarSkinnedPainter.ApplicationMenuDrawContentArea( + ABarSubMenuControl: TdxBarSubMenuControl; ACanvas: TcxCanvas; const AContentRect, AItemsArea: TRect); +var + AInnerBorderRect, AOuterBorderRect, AHeaderRect, AFooterRect, ALeftSideRect, ARightSideRect: TRect; +begin + AInnerBorderRect := cxRectInflate(AItemsArea, 1, 1); + AOuterBorderRect := cxRectInflate(AInnerBorderRect, 1, 1); + AHeaderRect := AContentRect; + AHeaderRect.Bottom := AOuterBorderRect.Top; + AFooterRect := AContentRect; + AFooterRect.Top := AOuterBorderRect.Bottom; + ALeftSideRect := Rect(AContentRect.Left, AHeaderRect.Bottom, AOuterBorderRect.Left, AFooterRect.Top); + ARightSideRect := Rect(AOuterBorderRect.Right, AHeaderRect.Bottom, AContentRect.Right, AFooterRect.Top); + + ACanvas.FrameRect(AInnerBorderRect, Skin.GetPartColor(DXBAR_APPLICATIONMENUCONTENTINNERBORDER)); + ACanvas.FrameRect(AOuterBorderRect, Skin.GetPartColor(DXBAR_APPLICATIONMENUCONTENTOUTERBORDER)); + Skin.DrawBackground(ACanvas.Handle, AHeaderRect, DXBAR_APPLICATIONMENUCONTENTHEADER); + Skin.DrawBackground(ACanvas.Handle, AFooterRect, DXBAR_APPLICATIONMENUCONTENTFOOTER); + ACanvas.FillRect(ALeftSideRect, Skin.GetPartColor(DXBAR_APPLICATIONMENUCONTENTSIDES)); + ACanvas.FillRect(ARightSideRect, Skin.GetPartColor(DXBAR_APPLICATIONMENUCONTENTSIDES)); +end; + +function TdxBarSkinnedPainter.ApplicationMenuGetFrameSizes: TRect; +begin + Result := Rect(4, 16, 4, 27); +end; + +procedure TdxBarSkinnedPainter.ExtraMenuControlDrawBackground(AExtraMenuControl: TCustomdxBarControl; + ACanvas: TcxCanvas; ARect: TRect; ABrush: HBRUSH; AColor: TColor); +begin + ExtraMenuControlDrawItemBackground(AExtraMenuControl, ACanvas, ARect); +end; + +procedure TdxBarSkinnedPainter.ExtraMenuControlDrawBeginGroup(AExtraMenuControl: TCustomdxBarControl; + ACanvas: TcxCanvas; ABeginGroupRect: TRect; AToolbarBrush: HBRUSH; AHorz: Boolean); +begin + InternalDrawBeginGroup(ACanvas.Handle, ABeginGroupRect, AHorz, $F5F5F5, $D8D8D8); +end; + +procedure TdxBarSkinnedPainter.ExtraMenuControlDrawItemBackground(AExtraMenuControl: TCustomdxBarControl; + ACanvas: TcxCanvas; AItemRect: TRect); +var + AExtraPaneRect, AContentRect, ASeparatorRect: TRect; +begin + ACanvas.SaveClipRegion; + try + ACanvas.SetClipRegion(TcxRegion.Create(AItemRect), roIntersect); + + AExtraPaneRect := AExtraMenuControl.ClientRect; + ASeparatorRect := Rect(AExtraPaneRect.Left, AExtraPaneRect.Top, + AExtraPaneRect.Left + MenuSeparatorSize, AExtraPaneRect.Bottom); + AContentRect := Rect(ASeparatorRect.Right, AExtraPaneRect.Top, AExtraPaneRect.Right, AExtraPaneRect.Bottom); + Skin.DrawBackground(ACanvas.Handle, ASeparatorRect, DXBAR_MENUSEPARATORVERT); + FillRectByColor(ACanvas.Handle, AContentRect, Skin.GetPartColor(DXBAR_MENUEXTRAPANE)); + finally + ACanvas.RestoreClipRegion; + end; +end; + +function TdxBarSkinnedPainter.EditButtonAllowOffsetContent: Boolean; +begin + Result := False; +end; + +function TdxBarSkinnedPainter.EditButtonAllowCompositeFrame: Boolean; +begin + Result := Skin.GetName = ''; +end; + +class function TdxBarSkinnedPainter.EditButtonAllowHotTrack(const ADrawParams: TdxBarItemControlDrawParams): Boolean; +begin + Result := True; +end; + +function TdxBarSkinnedPainter.EditButtonIsCustomBorder: Boolean; +begin + Result := Skin.GetName = ''; +end; + +function TdxBarSkinnedPainter.EditButtonIsCustomBackground(AState: Integer): Boolean; +begin + Result := True; +end; + +procedure TdxBarSkinnedPainter.EditButtonCorrectDefaultWidth(var ADefaultWidth: Integer); +begin + Dec(ADefaultWidth); +end; + +procedure TdxBarSkinnedPainter.EditButtonDrawBackground(const ADrawParams: TdxBarEditLikeControlDrawParams; AState: Integer; + ARect: TRect; ABrush: HBrush); +begin + if Skin.GetName = '' then + Skin.DrawBackground(ADrawParams.Canvas.Handle, ARect, DXBAR_EDIT_BUTTON, AState) + else + FillRectByColor(ADrawParams.Canvas.Handle, ARect, EditGetBkColor(ADrawParams)); +end; + +procedure TdxBarSkinnedPainter.EditButtonDrawBorder( + const ADrawParams: TdxBarItemControlDrawParams; AState: Integer; var ADrawRect: TRect; out AContentRect: TRect); +begin + AContentRect := EditControlGetContentRect(ADrawParams.PaintType, ADrawRect); + if (Skin.GetName = '') and (AState in [DXBAR_HOT..DXBAR_HOTCHECK]) then + with ADrawParams do + begin + Canvas.SaveClipRegion; + Canvas.SetClipRegion(TcxRegion.Create(BarItemControl.ViewInfo.Bounds), roSet); + Canvas.SetClipRegion(TcxRegion.Create(ADrawRect), roIntersect); + FrameRectByColor(Canvas.Handle, ADrawRect, Skin.GetPartColor(DXBAR_EDIT_BUTTON_BORDER, AState)); + Canvas.RestoreClipRegion; + ADrawRect := AContentRect; + end; +end; + +class function TdxBarSkinnedPainter.EditControlCaptionBackgroundIsOpaque( + const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; +begin + Result := False; +end; + +class function TdxBarSkinnedPainter.EditControlCaptionRightIndentIsOpaque( + const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; +begin + Result := EditControlCaptionBackgroundIsOpaque(ADrawParams); +end; + +procedure TdxBarSkinnedPainter.EditControlDrawBorder( + const ADrawParams: TdxBarEditLikeControlDrawParams; var ARect: TRect); +begin + if not ADrawParams.IsTransparent then + FrameRectByColor(ADrawParams.Canvas.Handle, ARect, Skin.GetPartColor(DXBAR_EDIT_BORDER, GetEditPartState(ADrawParams, ecpEdit))); + InflateRect(ARect, -1, -1); +end; + +procedure TdxBarSkinnedPainter.EditControlDrawSelectionFrame( + const ADrawParams: TdxBarEditLikeControlDrawParams; const ARect: TRect); + + procedure DrawSelection(AState: Integer); + begin + with ADrawParams do + begin + Skin.DrawBackground(Canvas.Handle, ARect, DXBAR_SMALLBUTTON, AState); + Canvas.DrawComplexFrame(cxRectInflate(BarEditControl.GetEditRect, 0, -1), + Skin.GetPartColor(DXBAR_MENUEDITSEPARATOR, AState), clNone, [bLeft]); + end; + end; + +var + AState: Integer; +begin + with ADrawParams do + begin + Canvas.SaveClipRegion; + Canvas.SetClipRegion(TcxRegion.Create(EditControlGetContentRect(PaintType, BarEditControl.GetEditRect)), roSubtract); + try + if Enabled then + AState := DXBAR_ACTIVE + else + AState := DXBAR_ACTIVEDISABLED; + DrawSelection(AState); + finally + Canvas.RestoreClipRegion; + end; + end; +end; + +procedure TdxBarSkinnedPainter.EditControlDrawBackground(const ADrawParams: TdxBarEditLikeControlDrawParams); +begin + with ADrawParams do + begin + Canvas.SaveClipRegion; + Canvas.ExcludeClipRect(EditControlGetContentRect(PaintType, BarEditControl.GetEditRect)); + DrawBackground(BarEditControl, Canvas.Handle, BarEditControl.ItemBounds, 0, False); + Canvas.RestoreClipRegion; + end; +end; + +procedure TdxBarSkinnedPainter.EditGetRealLookAndFeel(ABarManager: TdxBarManager; ALookAndFeel: TcxLookAndFeel); +begin + ALookAndFeel.NativeStyle := False; + ALookAndFeel.SkinName := Skin.GetName; + if Skin.GetName = '' then + if ABarManager.FThemeAvailable then + ALookAndFeel.SetStyle(lfsNative) + else + inherited EditGetRealLookAndFeel(ABarManager, ALookAndFeel); +end; + +function TdxBarSkinnedPainter.EditGetBkColor( + const ADrawParams: TdxBarEditLikeControlDrawParams): COLORREF; +begin + Result := Skin.GetPartColor(DXBAR_EDIT_BACKGROUND, GetEditPartState(ADrawParams, ecpEdit)); +end; + +class function TdxBarSkinnedPainter.EditControlShowIconDefault( + const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; +begin + Result := True; +end; + +class function TdxBarSkinnedPainter.ComboControlArrowOffset: Integer; +begin + Result := 0; +end; + +class function TdxBarSkinnedPainter.ComboControlButtonOffsets(APaintType: TdxBarPaintType): TRect; +begin + Result := cxEmptyRect; +end; + +procedure TdxBarSkinnedPainter.ComboControlDrawArrowButton( + const ADrawParams: TdxBarEditLikeControlDrawParams; ARect: TRect; + AInClientArea: Boolean); +begin + InternalDrawEditButton(ADrawParams, ccpDropButton, ARect); +end; + +function TdxBarSkinnedPainter.ColorComboHasCompleteFrame: Boolean; +begin + Result := True; +end; + +function TdxBarSkinnedPainter.GetCustomColorButtonWidth(APaintType: TdxBarPaintType; const ARect: TRect): Integer; +begin + if Skin.GetName <> '' then + Result := 19 + else + Result := inherited GetCustomColorButtonWidth(APaintType, ARect); +end; + +function TdxBarSkinnedPainter.GetCustomColorButtonIndents(APaintType: TdxBarPaintType): TRect; +begin + Result := cxEmptyRect; +end; + +procedure TdxBarSkinnedPainter.ColorComboDrawCustomButton( + const ADrawParams: TdxBarColorComboControlDrawParams; ARect: TRect); +begin + InternalDrawEditButton(ADrawParams, clcpCustomColorButton, ARect); +end; + +procedure TdxBarSkinnedPainter.ColorComboDrawCustomButtonAdjacentZone( + const ADrawParams: TdxBarColorComboControlDrawParams; ARect: TRect); +begin +// do nothing +end; + +function TdxBarSkinnedPainter.DateNavigatorHeaderColor: TColor; +begin + Result := Skin.GetPartColor(DXBAR_DATENAVIGATOR_HEADER); +end; + +class function TdxBarSkinnedPainter.InPlaceSubItemGetArrowWidth(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams): Integer; +begin + Result := ADrawParams.ArrowSize.cx; +end; + +procedure TdxBarSkinnedPainter.InPlaceSubItemControlDrawArrow(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams; + ADirection: TcxArrowDirection; ARect: TRect); +begin + ButtonLikeControlDrawMenuArrow(ADrawParams, ADirection, ARect); +end; + +procedure TdxBarSkinnedPainter.InPlaceSubItemControlDrawBackground(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams; ARect: TRect); +begin + if ADrawParams.DrawSelected then + DrawItemBackgroundInSubMenu(ADrawParams, ARect) + else + Skin.DrawBackground(ADrawParams.Canvas.Handle, ARect, DXBAR_MENUGLYPH); +end; + +procedure TdxBarSkinnedPainter.ProgressControlDrawBackground( + const ADrawParams: TdxBarItemControlDrawParams; var R: TRect); +begin + inherited; + Skin.DrawBackground(ADrawParams.Canvas.Handle, R, DXBAR_PROGRESSSUBSTRATE, DXBAR_NORMAL); + InflateRect(R, -2, -2); +end; + +procedure TdxBarSkinnedPainter.ProgressControlFillContent( + const ADrawParams: TdxBarItemControlDrawParams; const R: TRect; ABarBrush: HBRUSH); +begin + Skin.DrawBackground(ADrawParams.Canvas.Handle, R, DXBAR_PROGRESSSOLIDBAND, DXBAR_NORMAL); +end; + +procedure TdxBarSkinnedPainter.ProgressControlFillDiscreteContent( + const ADrawParams: TdxBarItemControlDrawParams; const R: TRect; ABarBrush: HBRUSH); +begin + Skin.DrawBackground(ADrawParams.Canvas.Handle, R, DXBAR_PROGRESSDISCRETEBAND, DXBAR_NORMAL); +end; + +function TdxBarSkinnedPainter.GetSpinEditArrowPos( + const ADrawParams: TdxBarSpinEditDrawParams; ARect: TRect; AButtonIndex: Integer): TPoint; +var + AYArrowOffset: Integer; +begin + with ADrawParams do + begin + Result.X := ARect.Left + (cxRectWidth(ARect) div 2) - (ArrowSize.cx div 2); + AYArrowOffset := (cxRectHeight(ARect) div 2) - (ArrowSize.cy div 2); + if AButtonIndex = secButtonUp then + Result.Y := ARect.Bottom - AYArrowOffset + else + Result.Y := ARect.Top + AYArrowOffset - 1; + end; +end; + +procedure TdxBarSkinnedPainter.SpinEditCorrectFrameRect( + const ADrawParams: TdxBarItemControlDrawParams; var ARect: TRect); +begin +// do nothing; +end; + +function TdxBarSkinnedPainter.GetSpinEditArrowSize(AHeight: Integer): TSize; +begin + Result := Size(5, 3); +end; + +function TdxBarSkinnedPainter.GetSpinEditButtonBounds(const ADrawParams: TdxBarSpinEditDrawParams; const ARect: TRect; AButton: TdxBarSpinEditButton): TRect; +begin + Result := inherited GetSpinEditButtonBounds(ADrawParams, cxRectInflate(ARect, -1, -1), AButton); +end; + +procedure TdxBarSkinnedPainter.SpinEditControlDrawButton( + const ADrawParams: TdxBarSpinEditDrawParams; ARect: TRect; AButtonIndex: Integer); + + procedure DrawButtonFrame(AState: Integer; var ARect: TRect; out AContentRect: TRect); + begin + AContentRect := cxRectInflate(ARect, -1, -1); + if AState in [DXBAR_NORMAL, DXBAR_DISABLED, DXBAR_ACTIVE, DXBAR_ACTIVEDISABLED] then + begin + if AButtonIndex = secButtonUp then + Inc(ARect.Bottom) + else + Dec(ARect.Top); + end + else + FrameRectByColor(ADrawParams.Canvas.Handle, ARect, Skin.GetPartColor(DXBAR_EDIT_BUTTON_BORDER, AState)); + InflateRect(ARect, -1, -1); + end; + +var + AEditButtonState: Integer; + AArrowPos: TPoint; + AContentRect: TRect; + APart: Integer; +begin + with ADrawParams do + begin + AEditButtonState := GetSpinEditPartState(TdxBarSpinEditDrawParams(BarEditControl.DrawParams), AButtonIndex); + if Skin.GetName = '' then + DrawButtonFrame(AEditButtonState, ARect, AContentRect); + EditButtonDrawBackground(ADrawParams, AEditButtonState, ARect, 0); + if Skin.GetName <> '' then + begin + if AButtonIndex = secButtonUp then + APart := DXBAR_SPINEDIT_UPBUTTON + else + APart := DXBAR_SPINEDIT_DOWNBUTTON; + Skin.DrawBackground(ADrawParams.Canvas.Handle, ARect, APart, AEditButtonState); + end + else + begin + AArrowPos := GetSpinEditArrowPos(ADrawParams, AContentRect, AButtonIndex); + DrawSpinEditArrow(ADrawParams, AArrowPos, AButtonIndex); + end; + end; +end; + +procedure TdxBarSkinnedPainter.SpinEditControlDrawButtonsAdjacentZone(const ADrawParams: TdxBarSpinEditDrawParams; const ARect: TRect); +begin + if Skin.GetName = '' then + SpinEditControlDrawButtonsExternalFrame(ADrawParams, ARect); +end; + +procedure TdxBarSkinnedPainter.SpinEditControlDrawButtonsExternalFrame(const ADrawParams: TdxBarSpinEditDrawParams; ARect: TRect); +var + AEditState: Integer; + AColor: TColor; +begin + with ADrawParams do + begin + AEditState := GetEditPartState(ADrawParams, ecpEdit); + + if not (HotPartIndex in ecpHeaderParts) and (HotPartIndex <> icpNone) then + AColor := Skin.GetPartColor(DXBAR_EDIT_BUTTON_BORDER, DXBAR_ACTIVE) + else + if AEditState = DXBAR_DISABLED then + AColor := Skin.GetPartColor(DXBAR_EDIT_BACKGROUND, DXBAR_DISABLED) + else + AColor := Skin.GetPartColor(DXBAR_EDIT_BACKGROUND, DXBAR_NORMAL); + FrameRectByColor(Canvas.Handle, ARect, AColor); + end; +end; + +function TdxBarSkinnedPainter.GetSpinEditButtonIndents(APaintType: TdxBarPaintType): TRect; +begin + Result := cxEmptyRect; +end; + +function TdxBarSkinnedPainter.GetSpinEditButtonWidth(APaintType: TdxBarPaintType; const ARect: TRect): Integer; +begin + if Skin.GetName <> '' then + Result := 17 + else + begin + Result := cxRectHeight(ARect) div 2 * 8 div 5 + 1; + Result := Result - GetSpinEditButtonIndents(APaintType).Left - + GetSpinEditButtonIndents(APaintType).Right; + end; +end; + +procedure TdxBarSkinnedPainter.DrawStaticBorder(const ADrawParams: TdxBarStaticLikeControlDrawParams; var ARect: TRect); +begin + with ADrawParams do + begin + if BorderStyle = sbsNone then Exit; + Canvas.FrameRect(ARect, Skin.GetPartColor(DXBAR_EDIT_BORDER)); + InflateRect(ARect, -1, -1); + end; +end; + +class function TdxBarSkinnedPainter.StaticBackgroundIsOpaque(const ADrawParams: TdxBarItemControlDrawParams): Boolean; +begin + Result := False; +end; + +procedure TdxBarSkinnedPainter.DrawSeparatorGlyphAndCaption(const ADrawParams: TdxBarSeparatorControlDrawParams; const ARect: TRect); +var + ACaptionRect: TRect; +begin + with ADrawParams do + begin + FillRectByColor(Canvas.Handle, ARect, Skin.GetPartColor(DXBAR_SEPARATOR_BACKGROUND)); + ACaptionRect := ARect; + ACaptionRect.Left := ACaptionRect.Left + + SeparatorControlGetIndents(ADrawParams, cpText).Left; + DrawItemText(BarItemControl, Canvas.Handle, Caption, ACaptionRect, + SystemAlignmentsHorz[Alignment], Enabled, False, PaintType = ptVert, True, + False); + end; +end; + +procedure TdxBarSkinnedPainter.ScreenTipDrawBackground(ACanvas: TcxCanvas; ARect: TRect); +begin + Skin.DrawBackground(ACanvas.Handle, ARect, DXBAR_SCREENTIP); +end; + +procedure TdxBarSkinnedPainter.ScreenTipDrawFooterLine(ACanvas: TcxCanvas; const ARect: TRect); +var + R: TRect; +begin + R := cxRectSetHeight(ARect, 1); + FillRectByColor(ACanvas.Handle, R, Skin.GetPartColor(DXBAR_SCREENTIP_FOOTERLINE)); + OffsetRect(R, 0, 1); + FillRectByColor(ACanvas.Handle, R, clWhite); +end; + +procedure TdxBarSkinnedPainter.DrawToolbarContentPart( + ABarControl: TdxBarControl; ACanvas: TcxCanvas); +var + APrevWindowOrg: TPoint; + DC: HDC; +begin + DC := ACanvas.Handle; + with ABarControl.NCOffset do + OffsetWindowOrgEx(DC, X, Y, APrevWindowOrg); + try + Skin.DrawBackground(DC, ABarControl.NCRect, DXBAR_TOOLBAR, GetBarControlState(ABarControl)); + finally + SetWindowOrgEx(DC, APrevWindowOrg.X, APrevWindowOrg.Y, nil); + end; +end; + +procedure TdxBarSkinnedPainter.DrawToolbarNonContentPart( + ABarControl: TdxBarControl; DC: HDC); +var + ABarControlState: Integer; + ACaptionRect: TRect; +begin + with ABarControl.ClientBounds do + ExcludeClipRect(DC, Left, Top, Right, Bottom); + ABarControlState := GetBarControlState(ABarControl); + Skin.DrawBackground(DC, ABarControl.NCRect, DXBAR_TOOLBAR, ABarControlState); + + ACaptionRect := Skin.GetCaptionRect(ABarControl.NCRect, DXBAR_TOOLBAR); + if ABarControl.CaptionButtons.Count > 0 then + ACaptionRect.Right := ACaptionRect.Right - cxRectWidth(ABarControl.CaptionButtons.Rect) - Skin.GetContentOffsets(DXBAR_TOOLBAR).Right; + Skin.DrawCaption(DC, ABarControl.GetCaption, ACaptionRect, DXBAR_TOOLBAR, ABarControlState); +end; + +class function TdxBarSkinnedPainter.GetDefaultArrowSignSize: TSize; +begin + Result := cxSize(5, 4); +end; + +class function TdxBarSkinnedPainter.GetControlTextIndents: TRect; +begin + Result := Rect(3, 0, 2, 0); +end; + +class function TdxBarSkinnedPainter.GetControlCaptionRect(const ADrawParams: TdxBarItemControlDrawParams): TRect; +begin + if (ADrawParams.ViewSize = cvsLarge) and (ADrawParams.PaintType <> ptMenu) then + Result := cxGetTextRect(ADrawParams.Canvas.Handle, ADrawParams.Caption + GetTextInsteadArrow(ADrawParams), GetMaxLineCount, True) + else + Result := inherited GetControlCaptionRect(ADrawParams); +end; + +function TdxBarSkinnedPainter.GetLargeImageBounds(AItemControl: TdxBarItemControl; + const AImageSize: TSize; const ADrawRect: TRect; APaintType: TdxBarPaintType; + AViewStructure: TdxBarItemControlViewStructure; AGlyphLayout: TdxBarGlyphLayout): TRect; + + function GetImageOffset(const AImageSize: TSize): TSize; + var + ACaptionRect: TRect; + begin + ACaptionRect := GetControlCaptionRect(AItemControl.FDrawParams); + Result.cx := (ADrawRect.Left + ADrawRect.Right - AImageSize.cx) div 2; + Result.cy := (ADrawRect.Top + ADrawRect.Bottom - cxRectHeight(ACaptionRect) - AImageSize.cy) div 2; + end; + + function GetCenterImageRect(const AImageSize: TSize): TRect; + var + AOffset: TSize; + begin + Result := Rect(0, 0, AImageSize.cx, AImageSize.cy); + AOffset := GetImageOffset(AImageSize); + OffsetRect(Result, AOffset.cx, AOffset.cy); + end; + + function GetStretchImageRect: TRect; + var + ACaptionRect: TRect; + AImageSize: Integer; + begin + ACaptionRect := GetControlCaptionRect(AItemControl.FDrawParams); + AImageSize := Min(cxRectWidth(ADrawRect) - GetButtonBorderWidth, + cxRectHeight(ADrawRect) - cxRectHeight(ACaptionRect) - GetButtonBorderHeight); + Result := GetCenterImageRect(Size(AImageSize, AImageSize)); + end; + +begin +{ + if AItemControl.BarManager.ImageOptions.StretchGlyphs then + Result := GetStretchImageRect + else +} + Result := GetCenterImageRect(AImageSize); +end; + +function TdxBarSkinnedPainter.GetSmallIconSize: Integer; +begin + Result := DefautGlyphSize; +end; + +function TdxBarSkinnedPainter.GetDefaultEnabledTextColor( + ABarItemControl: TdxBarItemControl; ASelected, AFlat: Boolean): TColor; +const + AItemTextPartMap: array [TdxBarPaintType] of Integer = (DXBAR_ITEMTEXT, DXBAR_MENUITEMTEXT, DXBAR_ITEMTEXT); +begin + Result := Skin.GetPartColor(AItemTextPartMap[ABarItemControl.GetPaintType], GetPartState(ABarItemControl.FDrawParams, icpControl)); +end; + +function TdxBarSkinnedPainter.GetEnabledTextColor( + ABarItemControl: TdxBarItemControl; ASelected, AFlat: Boolean): TColor; +begin +// Result := ABarItemControl.Parent.Font.Color; +// if Result = clDefault then + Result := inherited GetEnabledTextColor(ABarItemControl, ASelected, AFlat); +end; + +procedure TdxBarSkinnedPainter.GetDisabledTextColors( + ABarItemControl: TdxBarItemControl; ASelected, AFlat: Boolean; + var AColor1, AColor2: TColor); +begin + AColor1 := GetDefaultEnabledTextColor(ABarItemControl, ASelected, AFlat); + AColor2 := AColor1; +end; + +function TdxBarSkinnedPainter.GetToolbarCaptionRect( + const ARect: TRect): TRect; +begin + Result := Skin.GetCaptionRect(ARect, DXBAR_TOOLBAR); +end; + +procedure TdxBarSkinnedPainter.InflateSizeForArrow(const ADrawParams: TdxBarButtonLikeControlDrawParams; var ASize: Integer); +begin + if (ADrawParams.PaintType <> ptMenu) and (ADrawParams.ViewSize = cvsSmall) and ADrawParams.IsDropDown then + if ADrawParams.SplitDropDown then + Inc(ASize, GetControlTextIndents.Right + ADrawParams.ArrowSize.cx) + else + Inc(ASize, ADrawParams.ArrowSize.cx); +end; + +class function TdxBarSkinnedPainter.IsCompoundPainting: Boolean; +begin + Result := True; +end; + +class function TdxBarSkinnedPainter.GetButtonPartState(const ADrawParams: TdxBarButtonLikeControlDrawParams; AControlPart: Integer): Integer; +begin + Result := DXBAR_NORMAL; + if not ADrawParams.IsCustomizing then + case AControlPart of + bcpButton: + if ADrawParams.IsPressed then + Result := DXBAR_PRESSED + else + begin + if ADrawParams.Downed then + if ADrawParams.DroppedDown then + Result := DXBAR_ACTIVE + else + if (ADrawParams.HotPartIndex = AControlPart) or + ADrawParams.SelectedByKey and not ADrawParams.IsDropDown then + Result := DXBAR_HOTCHECK + else + Result := DXBAR_CHECKED + else + if ADrawParams.DroppedDown then + if ADrawParams.IsDropDown and ADrawParams.SplitDropDown then + Result := DXBAR_ACTIVE + else + Result := DXBAR_DROPPEDDOWN + else + Result := GetPartState(ADrawParams, AControlPart); + end; + bcpDropButton: + if ADrawParams.DroppedDown then + Result := DXBAR_DROPPEDDOWN + else + if ADrawParams.Downed and (ADrawParams.HotPartIndex = icpNone) and not ADrawParams.SelectedByKey then + Result := DXBAR_CHECKED + else + Result := GetPartState(ADrawParams, AControlPart); + end + else + if ADrawParams.Downed then + Result := DXBAR_CHECKED + else + if ADrawParams.DroppedDown then + Result := DXBAR_DROPPEDDOWN; +end; + +class function TdxBarSkinnedPainter.GetEditPartState(const ADrawParams: TdxBarEditLikeControlDrawParams; AControlPart: Integer): Integer; +begin + Result := DXBAR_NORMAL; + if not ADrawParams.IsCustomizing then + case AControlPart of + ecpEdit: + if ADrawParams.DroppedDown then + Result := DXBAR_DROPPEDDOWN + else + if ADrawParams.Focused then + Result := DXBAR_FOCUSED + else + Result := GetPartState(ADrawParams, AControlPart, ecpHeaderParts); + ccpDropButton: + if ADrawParams.DroppedDown then + Result := DXBAR_DROPPEDDOWN + else + if ADrawParams.IsPressed and (ADrawParams.HotPartIndex = AControlPart) or ADrawParams.Focused then + Result := DXBAR_HOT + else + Result := GetPartState(ADrawParams, AControlPart, ecpHeaderParts); + clcpCustomColorButton: + if ADrawParams.IsPressed then + Result := DXBAR_PRESSED + else + if ADrawParams.DroppedDown or ADrawParams.Focused then + Result := DXBAR_HOT + else + Result := GetPartState(ADrawParams, AControlPart, ecpHeaderParts); + end; +end; + +class function TdxBarSkinnedPainter.GetSpinEditPartState(const ADrawParams: TdxBarSpinEditDrawParams; + AControlPart: Integer): Integer; +begin + Result := DXBAR_NORMAL; + if not ADrawParams.IsCustomizing then + if (AControlPart = ADrawParams.ActiveButtonIndex) and (AControlPart = ADrawParams.HotPartIndex) then + Result := DXBAR_DROPPEDDOWN + else + begin + Result := GetPartState(ADrawParams, AControlPart, ecpHeaderParts); + if (Result = DXBAR_ACTIVE) and ((ADrawParams.HotPartIndex = icpNone) or (ADrawParams.HotPartIndex in ecpHeaderParts)) then + Result := DXBAR_NORMAL; + end; +end; + +class function TdxBarSkinnedPainter.GetPartState( + const ADrawParams: TdxBarItemControlDrawParams; AControlPart: Integer; AForbiddenParts: TdxByteSet = []): Integer; + + function IsControlSelected: Boolean; + begin + Result := ADrawParams.DrawSelected; +{ + Result := ADrawParams.SelectedByKey or + (ADrawParams.HotPartIndex <> icpNone) and + (not (ADrawParams.HotPartIndex in AForbiddenParts) or (ADrawParams.PaintType = ptMenu)); +} + end; + +begin + if (ADrawParams.HotPartIndex = AControlPart) and ADrawParams.CanSelect then + Result := DXBAR_HOT + else + if ADrawParams.CanSelect and IsControlSelected or (ADrawParams.HotPartIndex <> icpNone) then + if not ADrawParams.Enabled then + Result := DXBAR_ACTIVEDISABLED + else + Result := DXBAR_ACTIVE + else + if not ADrawParams.Enabled then + Result := DXBAR_DISABLED + else + Result := DXBAR_NORMAL; +end; + +function TdxBarSkinnedPainter.GetBarControlState( + ABarControl: TdxBarControl): Integer; +const + BarControlStates: array [TdxBarViewState] of Integer = + (DXBAR_NORMAL, DXBAR_HOT); +begin + Result := BarControlStates[ABarControl.ViewState]; +end; + +class function TdxBarSkinnedPainter.GetBarItemContolHintPosition( + ABarControl: TCustomdxBarControl; const AItemBounds: TRect; + const ACursorPos: TPoint; AHeight: Integer): TPoint; +var + R: TRect; +begin + Result := inherited GetBarItemContolHintPosition(ABarControl, AItemBounds, ACursorPos, AHeight); + R := AItemBounds; + MapWindowRect(ABarControl.Handle, 0, R); + ABarControl.AdjustHintWindowPosition(Result, R, AHeight); +end; + +function TdxBarSkinnedPainter.CreateHintViewInfo(ABarManager: TdxBarManager; AHintText: string; const AShortCut: string; + AScreenTip: TdxBarScreenTip): TdxBarCustomHintViewInfo; +begin + Result := dxBarCreateScreenTipViewInfo(ABarManager, AHintText, AShortCut, AScreenTip, Self); +end; + +procedure TdxBarSkinnedPainter.ButtonLikeControlDoDrawCaption(const ADrawParams: TdxBarButtonLikeControlDrawParams; + const ATextBounds: TRect; ATextAlignment, AFormat: DWORD); + + procedure DrawArrowInEnd(ALastLine: string; var ARectOut: TRect); + var + ATextRect, AArrowRect, ATextArrowRect: TRect; + begin + if ALastLine <> '' then + begin + ATextRect := cxGetTextRect(ADrawParams.Canvas.Handle, ALastLine, 1); + + ALastLine := ALastLine + GetTextInsteadArrow(ADrawParams); + ATextArrowRect := cxGetTextRect(ADrawParams.Canvas.Handle, ALastLine, 1); + + ARectOut := cxRectOffset(ATextArrowRect, + ARectOut.Left + (cxRectWidth(ARectOut) - cxRectWidth(ATextArrowRect)) div 2, + ARectOut.Top); + + AArrowRect := ARectOut; + AArrowRect.Left := AArrowRect.Right - GetDefaultArrowSignSize.cx; + + ARectOut.Right := ARectOut.Left + cxRectWidth(ATextRect); + end + else + AArrowRect := ARectOut; + + DrawArrow(ADrawParams.Canvas.Handle, AArrowRect, GetButtonPartState(ADrawParams, bcpDropButton)); + end; + +var + ALines: TStrings; + I, ATextHeight: Integer; + ARectOut: TRect; + AColor1, AColor2: TColor; +begin + with ADrawParams do + begin + SetBkMode(Canvas.Handle, TRANSPARENT); + if BarItemControl <> nil then + GetTextColors(BarItemControl, Enabled, DrawSelected, IsFlatText, AColor1, AColor2) + else + AColor1 := Skin.GetPartColor(DXBAR_ITEMTEXT, GetPartState(ADrawParams, icpControl)); + SetTextColor(Canvas.Handle, AColor1); + + ARectOut := ATextBounds; + if ViewSize = cvsLarge then + begin + ALines := TStringList.Create; + try + cxGetTextLines(Caption, Canvas, ATextBounds, ALines); + for I := ALines.Count + 1 to GetMaxLineCount do + ALines.Add(''); + + ATextHeight := cxTextSize(Canvas.Handle, 'Wg').cy; + ARectOut.Bottom := ARectOut.Top + ATextHeight; + + for I := 0 to ALines.Count - 1 do + begin + if (I = ALines.Count - 1) and IsDropDown then + DrawArrowInEnd(ALines[I], ARectOut); + cxDrawText(Canvas.Handle, ALines[I], ARectOut, ATextAlignment or AFormat); + OffsetRect(ARectOut, 0, ATextHeight); + end; + finally + ALines.Free; + end; + end + else + cxDrawText(Canvas.Handle, Caption, ARectOut, ATextAlignment or AFormat); + + SetBkMode(Canvas.Handle, OPAQUE); + end; +end; + +procedure TdxBarSkinnedPainter.ButtonLikeControlDrawMenuArrow(const ADrawParams: TdxBarButtonLikeControlDrawParams; ADirection: TcxArrowDirection; + ARect: TRect); +var + AArrowRect: TRect; + ARatio: Double; + APart: Integer; +begin + ARatio := ADrawParams.BarItemControl.Parent.Ratio; + ARect := GetArrowRect(ADrawParams, ARect); + if ADirection = adRight then + begin + AArrowRect := Rect(0, 0, Round(4 * ARatio), Trunc(7 * ARatio)); + APart := DXBAR_MENUARROWRIGHT; + end + else + begin + AArrowRect := Rect(0, 0, Trunc(7 * ARatio), Round(4 * ARatio)); + APart := DXBAR_MENUARROWDOWN; + end; + + AArrowRect := cxRectOffset(AArrowRect, cxRectCenter(ARect, cxRectSize(AArrowRect)).TopLeft); + Skin.DrawBackground(ADrawParams.Canvas.Handle, AArrowRect, APart, DXBAR_NORMAL); +end; + +procedure TdxBarSkinnedPainter.DrawSpinEditArrow(const ADrawParams: TdxBarSpinEditDrawParams; AArrowPos: TPoint; AButtonIndex: Integer); +var + P: TcxArrowPoints; + AArrowDirection: TcxArrowDirection; +begin + case AButtonIndex of + secButtonUp: AArrowDirection := adUp; + else {secButtonDown} + AArrowDirection := adDown; + end; + + CalculateArrowPoints(ADrawParams.BarEditControl.FParts[AButtonIndex], ADrawParams.ArrowSize.cy, AArrowDirection, P); + ADrawParams.Canvas.SaveClipRegion; + try + SetArrowRegion(ADrawParams.Canvas, AArrowDirection, P, roSet); + Skin.DrawBackground(ADrawParams.Canvas.Handle, GetArrowRectByPoints(P, AArrowDirection), DXBAR_SCROLLARROW); + finally + ADrawParams.Canvas.RestoreClipRegion; + end; + SetArrowRegion(ADrawParams.Canvas, AArrowDirection, P, roSubtract); +end; + +procedure TdxBarSkinnedPainter.SubMenuControlDrawMarkContent(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect; ASelected: Boolean); +begin + Skin.DrawBackground(DC, SubMenuControlMarkContentRect(R), DXBAR_MENUMARK); +end; + +procedure TdxBarSkinnedPainter.SubMenuControlDrawMarkSelection( + ABarSubMenuControl: TdxBarSubMenuControl; ADC: HDC; const AMarkRect: TRect); +begin + Skin.DrawBackground(ADC, AMarkRect, DXBAR_SMALLBUTTON, DXBAR_HOT); +end; + +procedure TdxBarSkinnedPainter.SubMenuControlFillScrollArrow(ACanvas: TcxCanvas; ARect: TRect; AColor: TColor); +begin + Skin.DrawBackground(ACanvas.Handle, ARect, DXBAR_SCROLLARROW); +end; + +function TdxBarSkinnedPainter.SubMenuControlGetScrollBandSize(ABarSubMenuControl: TdxBarSubMenuControl): Integer; +begin + Result := inherited SubMenuControlGetScrollBandSize(ABarSubMenuControl); + Result := (Result - 6) * 3 div 4; +end; + +class function TdxBarSkinnedPainter.SubMenuControlGetScrollArrowSize(ATextSize: Integer): Integer; +begin + Result := ATextSize div 7; +end; + +class function TdxBarSkinnedPainter.SubMenuControlUseScrollButtons: Boolean; +begin + Result := True; +end; + +function TdxBarSkinnedPainter.GetSkin: IdxSkin; +begin + Supports(FSkinnedObject, IdxSkin, Result); +end; + +procedure TdxBarSkinnedPainter.DrawButtonBackground( + const ADrawParams: TdxBarButtonLikeControlDrawParams); + + procedure InternalDrawBackground(AControlPart, ASkinPart: Integer); + + function GetButtonGroupPosition: TdxBarButtonGroupRealPosition; + begin + Result := ADrawParams.ButtonGroup; + if ADrawParams.SplitDropDown and ADrawParams.IsDropDown then + case AControlPart of + bcpButton: + case Result of + bgrpFinish: Result := bgrpMember; + bgrpSingle: Result := bgrpStart; + end; + bcpDropButton: + case Result of + bgrpStart: Result := bgrpMember; + bgrpSingle: Result := bgrpFinish; + end; + end + end; + + procedure CalculateRects(var APartRect: TRect; out ALeftBorderRect, ARightBorderRect, AMiddleButtonRect, ASplitRect: TRect); + begin + ALeftBorderRect := APartRect; + ALeftBorderRect.Right := ALeftBorderRect.Left + 2; + + ASplitRect := APartRect; + ASplitRect.Left := ASplitRect.Left - 1; + ASplitRect.Right := ASplitRect.Left + 2; + + ARightBorderRect := APartRect; + ARightBorderRect.Left := ARightBorderRect.Right - 2; + + AMiddleButtonRect := APartRect; + AMiddleButtonRect.Left := AMiddleButtonRect.Right - 1; + + case GetButtonGroupPosition of + bgrpNone: + begin + ALeftBorderRect := cxEmptyRect; + ARightBorderRect := cxEmptyRect; + ASplitRect := cxEmptyRect; + AMiddleButtonRect := cxEmptyRect; + end; + bgrpStart: + begin + ARightBorderRect := cxEmptyRect; + + APartRect.Left := APartRect.Left + 1; + end; + bgrpMember: + begin + ALeftBorderRect := cxEmptyRect; + ARightBorderRect := cxEmptyRect; + end; + bgrpFinish: + begin + ALeftBorderRect := cxEmptyRect; + AMiddleButtonRect := cxEmptyRect; + + APartRect.Right := APartRect.Right - 1; + end; + bgrpSingle: + begin + AMiddleButtonRect := cxEmptyRect; + + APartRect.Left := APartRect.Left + 1; + APartRect.Right := APartRect.Right - 1; + end; + end; + end; + + var + APartState: Integer; + APartRect, ALeftBorderRect, ARightBorderRect, AMiddleButtonRect, ASplitRect: TRect; + begin + with ADrawParams do + begin + APartState := GetButtonPartState(ADrawParams, AControlPart); + APartRect := BarItemControl.FParts[AControlPart]; + + CalculateRects(APartRect, ALeftBorderRect, ARightBorderRect, AMiddleButtonRect, ASplitRect); + Skin.DrawBackground(Canvas.Handle, APartRect, ASkinPart, APartState); + Skin.DrawBackground(Canvas.Handle, ALeftBorderRect, DXBAR_BUTTONGROUPBORDERLEFT); + Skin.DrawBackground(Canvas.Handle, ARightBorderRect, DXBAR_BUTTONGROUPBORDERRIGHT); + if SplitDropDown and IsDropDown then + begin + if AControlPart = bcpDropButton then + begin + Skin.DrawBackground(Canvas.Handle, ASplitRect, DXBAR_BUTTONGROUPSPLITBUTTONSEPARATOR, APartState); + Skin.DrawBackground(Canvas.Handle, AMiddleButtonRect, DXBAR_BUTTONGROUPBORDERMIDDLE, APartState); + end; + end + else + Skin.DrawBackground(Canvas.Handle, AMiddleButtonRect, DXBAR_BUTTONGROUPBORDERMIDDLE, APartState); + end; + end; + +var + AButtonPart, AGlyphPart, ADropButtonPart: Integer; +begin + with ADrawParams do + begin + if ViewSize = cvsSmall then + begin + if ButtonGroup = bgrpNone then + begin + AButtonPart := DXBAR_SMALLBUTTON; + AGlyphPart := DXBAR_SMALLBUTTON_GLYPH; + ADropButtonPart := DXBAR_SMALLBUTTON_DROPBUTTON; + end + else + begin + AButtonPart := DXBAR_BUTTONGROUP; + AGlyphPart := DXBAR_BUTTONGROUP; + ADropButtonPart := DXBAR_BUTTONGROUP; + end; + end + else + begin + AButtonPart := DXBAR_LARGEBUTTON; + AGlyphPart := DXBAR_LARGEBUTTON_GLYPH; + ADropButtonPart := DXBAR_LARGEBUTTON_DROPBUTTON; + end; + + if SplitDropDown and IsDropDown then + begin + InternalDrawBackground(bcpButton, AGlyphPart); + InternalDrawBackground(bcpDropButton, ADropButtonPart); + end + else + InternalDrawBackground(bcpButton, AButtonPart); + end; +end; + +function TdxBarSkinnedPainter.GetArrowRect(const ADrawParams: TdxBarButtonLikeControlDrawParams; const ARect: TRect): TRect; +var + AArrowRectWidth: Integer; +begin + Result := ARect; + AArrowRectWidth := ADrawParams.ArrowSize.cx; + if ADrawParams.PaintType <> ptMenu then + Result.Right := Result.Right - GetBorderSize; + Result.Left := Result.Right - AArrowRectWidth; +end; + +class function TdxBarSkinnedPainter.GetTextInsteadArrow(const ADrawParams: TdxBarItemControlDrawParams): string; +begin + Result := ''; + if ADrawParams.IsDropDown then + begin + while GetDefaultArrowSignSize.cx > cxTextSize(ADrawParams.Canvas.Handle, Result).cx do + Result := Result + '.'; + Result := ' ' + Result; + end; +end; + +class function TdxBarSkinnedPainter.GetMaxLineCount: Integer; +begin + Result := 2; +end; + +procedure TdxBarSkinnedPainter.InternalDrawBeginGroup(DC: HDC; const ABeginGroupRect: TRect; AHorz: Boolean; AColor1, AColor2: TColor); +var + R: TRect; +begin +{ +TODO: Skin.GetPartColor or Skin.DrawBackground - DXBAR_ITEMSEPARATOR +} + if AHorz then + begin + R := cxRectCenter(ABeginGroupRect, cxRectWidth(ABeginGroupRect), 1); + FillRectByColor(DC, R, AColor2); + FillRectByColor(DC, cxRectOffset(R, 0, 1), AColor1); + end + else + begin + R := cxRectCenter(ABeginGroupRect, 1, cxRectHeight(ABeginGroupRect)); + FillRectByColor(DC, R, AColor1); + FillRectByColor(DC, cxRectOffset(R, 1, 0), AColor2); + end; +end; + +procedure TdxBarSkinnedPainter.InternalDrawEditButton( + const ADrawParams: TdxBarEditLikeControlDrawParams; APartIndex: Integer; ARect: TRect); +var + AContentRect: TRect; + AState: Integer; +begin + AState := GetEditPartState(ADrawParams, APartIndex); + EditButtonDrawBorder(ADrawParams, AState, ARect, AContentRect); + EditButtonDrawBackground(ADrawParams, AState, ARect, 0); + case APartIndex of + ccpDropButton: + if Skin.GetName <> '' then + Skin.DrawBackground(ADrawParams.Canvas.Handle, AContentRect, DXBAR_EDIT_ARROWBUTTON, AState) + else + DrawArrow(ADrawParams.Canvas.Handle, AContentRect, AState); + clcpCustomColorButton: + if Skin.GetName <> '' then + Skin.DrawBackground(ADrawParams.Canvas.Handle, AContentRect, DXBAR_EDIT_ELLIPSISBUTTON, AState) + else + DrawDots(ADrawParams, AContentRect); + end; +end; + +{ TRegItemRecord } + +constructor TRegItemRecord.Create(AItemClass: TdxBarItemClass; + AItemControlClass: TdxBarItemControlClass; AVisible: Boolean); +begin + FItemClass := AItemClass; + FItemControlClass := AItemControlClass; + FVisible := AVisible; +end; + +{ TdxBarItemList } + +destructor TdxBarItemList.Destroy; +var + I: Integer; +begin + for I := Count - 1 downto 0 do + Unregister(I); + inherited Destroy; +end; + +procedure TdxBarItemList.Register(AItemClass: TdxBarItemClass; + AItemControlClass: TdxBarItemControlClass; AVisible: Boolean); +var + ARecord: TRegItemRecord; +begin + ARecord := TRegItemRecord.Create(AItemClass, AItemControlClass, AVisible); + Add(ARecord); + RegisterClass(ARecord.FItemClass); +end; + +procedure TdxBarItemList.Unregister(AItemClass: TdxBarItemClass); +var + I: Integer; +begin + for I := 0 to Count - 1 do + if ItemClass[I] = AItemClass then + begin + Unregister(I); + Break; + end; +end; + +procedure TdxBarItemList.Unregister(Index: Integer); +var + ARecord: TRegItemRecord; +begin + ARecord := Items[Index]; + UnregisterClass(ARecord.FItemClass); + Delete(Index); + ARecord.Free; +end; + +function TdxBarItemList.GetItem(Index: Integer): TRegItemRecord; +begin + Result := TRegItemRecord(inherited Items[Index]); +end; + +function TdxBarItemList.GetItemClass(Index: Integer): TdxBarItemClass; +begin + Result := Items[Index].FItemClass; +end; + +function TdxBarItemList.GetVisibleItemCount: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + if Items[I].FVisible then + Inc(Result); +end; + +function TdxBarItemList.GetVisibleItemClass(Index: Integer): TdxBarItemClass; +var + VisibleIndex, I: Integer; +begin + Result := nil; + VisibleIndex := -1; + for I := 0 to Count - 1 do + begin + if Items[I].FVisible then + Inc(VisibleIndex); + if VisibleIndex = Index then + begin + Result := ItemClass[I]; + Exit; + end; + end; +end; + +{ TdxBarNavigationController } + +destructor TdxBarNavigationController.Destroy; +begin + FreeAndNil(FKeyTipsShowingState.KeyTipsData); + EndKeyTipsWaiting(False); + inherited Destroy; +end; + +procedure TdxBarNavigationController.BeginKeyTipsWaiting( + ARootObject: IdxBarAccessibilityHelper); +begin + if (ARootObject = nil) or IsKeyTipsWaiting and + (ARootObject.GetHelper <> FKeyTipsWaitingRootObject.GetHelper) then + raise Exception.Create(''); + if KeyTipsHandlingMode then + Exit; + if not IsKeyTipsWaiting then + begin + FKeyTipsWaitingRootObject := ARootObject; + FKeyTipsWaitingTimer := TcxTimer.Create(nil); + FKeyTipsWaitingTimer.Interval := dxBarWaitForKeyTipsTime; + FKeyTipsWaitingTimer.OnTimer := KeyTipsWaitingTimerHandler; + end; +end; + +procedure TdxBarNavigationController.ChangeSelectedObject( + ASetFocus: Boolean; ANewSelectedObject: IdxBarAccessibilityHelper; + APrevSelectedObject: IdxBarAccessibilityHelper = nil); +begin + if ANewSelectedObject = nil then + Exit; + if APrevSelectedObject = nil then + APrevSelectedObject := SelectedObject; + if ANewSelectedObject <> APrevSelectedObject then + begin + if APrevSelectedObject <> nil then + APrevSelectedObject.Unselect(ANewSelectedObject); + ANewSelectedObject.Select(ASetFocus); + end; +end; + +procedure TdxBarNavigationController.EndKeyTipsWaiting( + AShowKeyTipWindows: Boolean); +var + ANewActiveKeyTipContainer: IdxBarAccessibilityHelper; +begin + WaitForMenu := False; + if IsKeyTipsWaiting then + begin + DestroyKeyTipsWaitingTimer; + ANewActiveKeyTipContainer := FKeyTipsWaitingRootObject; + FKeyTipsWaitingRootObject := nil; + if AShowKeyTipWindows then + SetKeyTipsShowingState(ANewActiveKeyTipContainer, ''); + end; +end; + +procedure TdxBarNavigationController.HandleKey(AKey: Word; + ASelectedObjectParent: IdxBarAccessibilityHelper = nil; + ASelectedObject: IdxBarAccessibilityHelper = nil); + + function GetNavigationDirection: TcxAccessibilityNavigationDirection; + begin + Result := andLeft; + case AKey of + VK_LEFT: + Result := andLeft; + VK_RIGHT: + Result := andRight; + VK_UP: + Result := andUp; + VK_DOWN: + Result := andDown; + end; + end; + +var + AIsKeyAcceptable: Boolean; + AKeyTargetObject, ANextSelectedObject: IdxBarAccessibilityHelper; + AKeyTipData: TdxBarKeyTipData; +begin + FHandleKey := True; + try + if IsKeyTipsWaiting then + begin + WaitForMenu := False; + if IsKeyTipsKey(AKey, AIsKeyAcceptable, AKeyTipData) then + begin + if not AIsKeyAcceptable then + Exit; + HandleKeyTipKey(AKey); + EndKeyTipsWaiting(False); + Exit; + end; + end; + + if KeyTipsHandlingMode and (AKey <> VK_ESCAPE) then + if IsKeyTipsKey(AKey, AIsKeyAcceptable, AKeyTipData) then + begin + if AIsKeyAcceptable then + HandleKeyTipKey(AKey); + Exit; + end + else + StopKeyTipsHandlingMode; + + if ASelectedObjectParent = nil then + ASelectedObjectParent := SelectedObjectParent; + if ASelectedObject = nil then + ASelectedObject := SelectedObject; + AKeyTargetObject := ASelectedObject; + if AKeyTargetObject = nil then + AKeyTargetObject := ASelectedObjectParent; + + if (AKey = VK_ESCAPE) and KeyTipsHandlingMode then + KeyTipsEscapeHandler + else + if AKey in [VK_MENU, VK_F10, VK_ESCAPE] then + begin + if not ((AKey = VK_ESCAPE) and AKeyTargetObject.HandleNavigationKey(AKey)) then + AKeyTargetObject.Unselect(nil); + end + else + if not AKeyTargetObject.HandleNavigationKey(AKey) then + begin + if ASelectedObject = nil then + ANextSelectedObject := ASelectedObjectParent.GetBarHelper.GetFirstSelectableObject + else + begin + if AKey = VK_TAB then + ANextSelectedObject := ASelectedObject.LogicalNavigationGetNextAccessibleObject(GetKeyState(VK_SHIFT) >= 0) + else + ANextSelectedObject := ASelectedObject.GetNextAccessibleObject(GetNavigationDirection); + end; + ChangeSelectedObject(AKey = VK_TAB, ANextSelectedObject, ASelectedObject); + end; + finally + FHandleKey := False; + end; +end; + +function TdxBarNavigationController.IsKeyTipsKey(AKey: Word): Boolean; +var + AIsKeyAcceptable: Boolean; + AKeyTipData: TdxBarKeyTipData; +begin + Result := IsKeyTipsKey(AKey, AIsKeyAcceptable, AKeyTipData); +end; + +function TdxBarNavigationController.IsKeyTipsWaiting: Boolean; +begin + Result := FKeyTipsWaitingRootObject <> nil; +end; + +function TdxBarNavigationController.IsNavigationBarControl( + ABarControl: TCustomdxBarControl): Boolean; +begin + Result := NavigationMode and (ABarControl = GetActiveBarControl); +end; + +function TdxBarNavigationController.IsNavigationKey(AKey: Word): Boolean; +begin + Result := (AKey in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN]) or + (AKey = VK_TAB) and (GetKeyState(VK_CONTROL) >= 0); +end; + +function TdxBarNavigationController.NeedsKey(AKey: Word): Boolean; +begin + Result := IsNavigationControllerKey(AKey) and (SelectedObjectParent <> nil) and + SelectedObjectParent.CanNavigateToChildren(AKey) or + (IsKeyTipsWaiting or KeyTipsHandlingMode) and IsKeyTipsKey(AKey); +end; + +procedure TdxBarNavigationController.SelectDefaultObject( + ARootObject: IdxBarAccessibilityHelper); +var + ADefaultObject: IdxBarAccessibilityHelper; +begin + ADefaultObject := ARootObject.GetDefaultAccessibleObject; + if ADefaultObject <> nil then + begin + FNavigationMode := True; + ADefaultObject.Select(False); + end; +end; + +procedure TdxBarNavigationController.SetKeyTipsShowingState( + AActiveKeyTipContainer: IdxBarAccessibilityHelper; + const AKeyTipsTypingString: string); + + function GetHelperInstance( + AHelper: IdxBarAccessibilityHelper): TObject; + begin + Result := nil; + if AHelper <> nil then + Result := AHelper.GetBarHelper; + end; + + procedure SynchronizeKeyTipWindows; + var + AKeyTipData: TdxBarKeyTipData; + AKeyTipWindowsManager: IdxBarKeyTipWindowsManager; + I: Integer; + begin + FKeyTipsShowingState.ActiveContainer.AreKeyTipsSupported(AKeyTipWindowsManager); + for I := 0 to FKeyTipsShowingState.KeyTipsData.Count - 1 do + begin + AKeyTipData := TdxBarKeyTipData(FKeyTipsShowingState.KeyTipsData[I]); + if not AKeyTipData.Visible then + Continue; + if (FKeyTipsShowingState.TypingString = '') or + (Pos(FKeyTipsShowingState.TypingString, AKeyTipData.NormalizedKeyTip) = 1) then + AKeyTipData.ShowKeyTipWindow(AKeyTipWindowsManager) + else + AKeyTipData.HideKeyTipWindow(AKeyTipWindowsManager); + end; + AKeyTipWindowsManager.Show; + end; + +var + AKeyTipWindowsManager: IdxBarKeyTipWindowsManager; + ANewContainer, APrevContainer: TObject; + I: Integer; +begin + APrevContainer := GetHelperInstance(FKeyTipsShowingState.ActiveContainer); + ANewContainer := GetHelperInstance(AActiveKeyTipContainer); + if ANewContainer <> APrevContainer then + begin + if FKeyTipsShowingState.ActiveContainer <> nil then + begin + FKeyTipsShowingState.ActiveContainer.AreKeyTipsSupported(AKeyTipWindowsManager); + for I := 0 to FKeyTipsShowingState.KeyTipsData.Count - 1 do + TdxBarKeyTipData(FKeyTipsShowingState.KeyTipsData[I]).HideKeyTipWindow(AKeyTipWindowsManager); + FreeAndNil(FKeyTipsShowingState.KeyTipsData); + end; + FKeyTipsShowingState.ActiveContainer := AActiveKeyTipContainer; + FKeyTipsShowingState.TypingString := ''; + if FKeyTipsShowingState.ActiveContainer <> nil then + begin + FKeyTipsShowingState.ActiveContainer.AreKeyTipsSupported(AKeyTipWindowsManager); + FKeyTipsShowingState.TypingString := AnsiUpperCase(AKeyTipsTypingString); + FKeyTipsShowingState.KeyTipsData := TdxObjectList.Create(True); + FKeyTipsShowingState.ActiveContainer.GetBarHelper.GetKeyTipsData(FKeyTipsShowingState.KeyTipsData); + SynchronizeKeyTipWindows; + end; + end + else + if not AnsiSameText(FKeyTipsShowingState.TypingString, AKeyTipsTypingString) then + begin + FKeyTipsShowingState.TypingString := AnsiUpperCase(AKeyTipsTypingString); + SynchronizeKeyTipWindows; + end; +end; + +procedure TdxBarNavigationController.StopKeyboardHandling; +begin + WaitForMenu := False; + if SelectedObject <> nil then + SelectedObject.GetBarManager.HideHint; + UnselectAssignedSelectedObject; + if SelectedObject <> nil then + SelectedObject.Unselect(nil); + StopKeyTipsHandlingMode; +end; + +procedure TdxBarNavigationController.UnassignObject( + AObject: IdxBarAccessibilityHelper); +begin + if (FSelectedObject <> nil) and (AObject.GetHelper = FSelectedObject.GetHelper) then + FSelectedObject := nil; + if (FSelectedObjectParent <> nil) and (AObject.GetHelper = FSelectedObjectParent.GetHelper) then + begin + FSelectedObject := nil; + FSelectedObjectParent := nil; + end; + if (FKeyTipsShowingState.ActiveContainer <> nil) and + (FKeyTipsShowingState.ActiveContainer.GetHelper = AObject.GetHelper) then + SetKeyTipsShowingState(nil, ''); +end; + +procedure TdxBarNavigationController.UnselectAssignedSelectedObject; +begin + if BarNavigationController.AssignedSelectedObject <> nil then + BarNavigationController.AssignedSelectedObject.Unselect(nil); +end; + +procedure TdxBarNavigationController.ResetNavigationMode; +begin + FNavigationMode := False; +end; + +procedure TdxBarNavigationController.DestroyKeyTipsWaitingTimer; +begin + FreeAndNil(FKeyTipsWaitingTimer); +end; + +function TdxBarNavigationController.GetActiveBarControl: TCustomdxBarControl; +begin + if ActiveBarControl = nil then + Result := BarDesignController.QuickControl + else + if IsActiveBarControlAccessible and not ActiveBarControl.IsCustomizing then + Result := ActiveBarControl + else + Result := nil; +end; + +function TdxBarNavigationController.GetKeyTipsHandlingMode: Boolean; +begin + Result := FKeyTipsShowingState.ActiveContainer <> nil; +end; + +function TdxBarNavigationController.GetSelectedObject: IdxBarAccessibilityHelper; +var + AActiveBarControl: TCustomdxBarControl; +begin + AActiveBarControl := GetActiveBarControl; + if AActiveBarControl <> nil then + begin + if AActiveBarControl.SelectedControl <> nil then + Result := AActiveBarControl.SelectedControl.IAccessibilityHelper + else + Result := FSelectedObject; + end + else + Result := FSelectedObject; +end; + +function TdxBarNavigationController.GetSelectedObjectParent: IdxBarAccessibilityHelper; +begin + if GetActiveBarControl <> nil then + Result := GetActiveBarControl.IAccessibilityHelper + else + Result := FSelectedObjectParent; +end; + +procedure TdxBarNavigationController.HandleKeyTipKey(AKey: Word); +var + AIsKeyAcceptable: Boolean; + AKeyTipData: TdxBarKeyTipData; + AKeyTipContainer: IdxBarAccessibilityHelper; +begin + IsKeyTipsKey(AKey, AIsKeyAcceptable, AKeyTipData); + if AKeyTipData <> nil then + begin + FKeyTipsWaitingRootObject := nil; + if AKeyTipData.Enabled and Assigned(AKeyTipData.OnExecute) then + AKeyTipData.OnExecute(nil); + end + else + begin + AKeyTipContainer := FKeyTipsShowingState.ActiveContainer; + if AKeyTipContainer = nil then + begin + AKeyTipContainer := FKeyTipsWaitingRootObject; + FKeyTipsWaitingRootObject := nil; + end; + SetKeyTipsShowingState(AKeyTipContainer, FKeyTipsShowingState.TypingString + Char(AKey)); + end; +end; + +function TdxBarNavigationController.IsKeyTipsKey(AKey: Word; + out AIsKeyAcceptable: Boolean; out AKeyTipData: TdxBarKeyTipData): Boolean; + + function GetKey(AKey: Word): string; + var + AScanCode: UINT; + AKeyState: TKeyboardState; + ABufChar: Word; + begin + ABufChar := 0; + AScanCode := MapVirtualKey(AKey, MAPVK_VK_TO_VSC); + GetKeyboardState(AKeyState); + if ToAscii(AKey, AScanCode, AKeyState, @ABufChar, 0) = 1 then + Result := PChar(@ABufChar) + else + Result := ''; + end; + +var + AKeyTipsData: TdxObjectList; + AKeyTipsTypingString: string; + I: Integer; +begin + Result := KeyTipsHandlingMode and (AKey = VK_ESCAPE); + if Result then + Exit; + + Result := IsTextCharForKeyTip(AKey); + if not Result then + Exit; + AIsKeyAcceptable := False; + AKeyTipData := nil; + AKeyTipsData := nil; + try + if FKeyTipsShowingState.ActiveContainer = nil then + begin + AKeyTipsData := TdxObjectList.Create(True); + FKeyTipsWaitingRootObject.GetBarHelper.GetKeyTipsData(AKeyTipsData); + AKeyTipsTypingString := ''; + end + else + begin + AKeyTipsData := FKeyTipsShowingState.KeyTipsData; + AKeyTipsTypingString := FKeyTipsShowingState.TypingString; + end; + AKeyTipsTypingString := AKeyTipsTypingString + AnsiUpperCase(GetKey(AKey)); + for I := 0 to AKeyTipsData.Count - 1 do + if AnsiPos(AKeyTipsTypingString, TdxBarKeyTipData(AKeyTipsData[I]).NormalizedKeyTip) = 1 then + begin + AIsKeyAcceptable := True; + if AnsiSameStr(AKeyTipsTypingString, TdxBarKeyTipData(AKeyTipsData[I]).NormalizedKeyTip) then + AKeyTipData := TdxBarKeyTipData(AKeyTipsData[I]); + Break; + end; + if FHandleKey and not AIsKeyAcceptable then + SysUtils.Beep; + finally + if FKeyTipsShowingState.ActiveContainer = nil then + FreeAndNil(AKeyTipsData); + end; +end; + +function TdxBarNavigationController.IsNavigationControllerKey(AKey: Word): Boolean; +begin + Result := IsNavigationKey(AKey) or + (ActiveBarControl = nil) and (BarDesignController.QuickControl = nil) and + ((AKey = VK_MENU) or (AKey = VK_F10) and (SelectedObjectParent <> nil) and SelectedObjectParent.GetBarManager.UseF10ForMenu); + if SelectedObject <> nil then + Result := Result or SelectedObject.IsNavigationKey(AKey) + else + if SelectedObjectParent <> nil then + Result := Result or SelectedObjectParent.IsNavigationKey(AKey); +end; + +procedure TdxBarNavigationController.KeyTipsEscapeHandler; +begin + HandleKeyTipsEscape(FKeyTipsShowingState.ActiveContainer); +end; + +procedure TdxBarNavigationController.KeyTipsWaitingTimerHandler(Sender: TObject); +begin + if WaitForMenu then + EndKeyTipsWaiting(True) + else + DestroyKeyTipsWaitingTimer; +end; + +procedure TdxBarNavigationController.StopKeyTipsHandlingMode; +begin + EndKeyTipsWaiting(False); + SetKeyTipsShowingState(nil, ''); +end; + +procedure RetrieveWindowsVersion; +var + Info: TOSVersionInfo; +begin + Info.dwOSVersionInfoSize := SizeOf(Info); + GetVersionEx(Info); + IsWin95Or98 := Info.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS; + IsWin95 := IsWin95Or98 and (Info.dwMinorVersion = 0); + IsWin98Or2000 := + (Info.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS) and (Info.dwMinorVersion <> 0) or + (Info.dwPlatformId = VER_PLATFORM_WIN32_NT) and (Info.dwMajorVersion = 5); +end; + +initialization + RegisterClasses([TdxBar, TdxBarGroup, TdxBarScreenTip, TdxBarScreenTipBand, TdxBarScreenTipCollection, TdxBarApplicationMenuButtons, TdxBarApplicationMenuButton]); + + RetrieveWindowsVersion; + FUser32DLL := LoadLibrary('USER32'); + if FUser32DLL > 32 then + begin + @UpdateLayeredWindow := GetProcAddress(FUser32DLL, 'UpdateLayeredWindow'); + @AnimateWindowProc := GetProcAddress(FUser32DLL, 'AnimateWindow'); + @SetLayeredWindowAttributes := GetProcAddress(FUser32DLL, 'SetLayeredWindowAttributes'); + end; + GetMem(AClassName, 256); + dxBarManagerList := TdxBarManagerList.Create; + RefreshDeviceConsts; + CreatePatternBrush; + + FBarControls := TList.Create; + FBarNavigationController := TdxBarNavigationController.Create; + FBarSystemController := TdxBarSystemController.Create; + + dxBarRegisterItem(TdxBarButton, TdxBarButtonControl, True); + dxBarRegisterItem(TdxBarEdit, TdxBarEditControl, True); + dxBarRegisterItem(TCustomdxBarCombo, TCustomdxBarComboControl, True); + dxBarRegisterItem(TdxBarCombo, TdxBarComboControl, True); + dxBarRegisterItem(TdxBarSubItem, TdxBarSubItemControl, True); + dxBarRegisterItem(TdxBarListItem, TdxBarContainerItemControl, True); + dxBarRegisterItem(TdxBarContainerItem, TdxBarContainerItemControl, True); + dxBarRegisterItem(TdxBarExtraPaneListItem, TdxBarContainerItemControl, False); + dxBarRegisterItem(TdxBarLabel, TdxBarCustomStaticControl, False); + dxBarRegisterItem(TdxBarSeparator, TdxBarSeparatorControl, True); + dxBarRegisterItem(TdxBarApplicationMenuButtonItem, TdxBarApplicationMenuButtonControl, False); + + dxBarRegisterItem(TdxBarQuickCustExtButton, TdxBarQuickCustExtButtonControl, False); + dxBarRegisterItem(TdxBarQuickCustItem, TdxBarQuickCustItemControl, False); + dxBarRegisterItem(TdxBarQuickAccessItem, TdxBarSubItemControl, False); + + dxBarRegisterItem(TSystemMenuSubItem, TSystemMenuSubItemControl, False); + + BarDesignController.RegisterBarControlEditor(TdxAddSubItemEditor); + BarDesignController.RegisterBarControlEditor(TdxAddButtonEditor); + BarDesignController.RegisterBarControlEditor(TdxItemsEditorEx); + + BarDesignController.RegisterBarControlDesignHelper(TdxBarControl, TdxBarControlDesignHelper); + BarDesignController.RegisterBarControlDesignHelper(TdxBarSubMenuControl, TdxBarSubMenuControlDesignHelper); + BarDesignController.RegisterBarControlDesignHelper(TdxBarApplicationMenuControl, TdxBarApplicationMenuControlDesignHelper); + + Screen.Cursors[crdxBarDrag] := LoadCursor(HInstance, 'DXBARDRAGCURSOR'); + Screen.Cursors[crdxBarDragCopy] := LoadCursor(HInstance, 'DXBARDRAGCOPYCURSOR'); + Screen.Cursors[crdxBarDragNoDrop] := LoadCursor(HInstance, 'DXBARDRAGNODROPCURSOR'); + Screen.Cursors[crdxBarEditSizing] := LoadCursor(HInstance, 'DXBAREDITSIZINGCURSOR'); + + if not IsLibrary then + begin + FPrevInitProc := InitProc; + InitProc := @dxBarInitProc; + end; + +finalization + FdxBarIsFinalized := True; + FreeAndNil(FBarSystemController); + FreeAndNil(FBarNavigationController); + FBarControls.Free; + + FreeAndNil(FRegdxItemList); + FreeAndNil(FBarDesignController); + FreeAndNil(FBarCanvas); + FreeAndNil(FBarFlatPainter); + + DeleteObject(PatternBrush); + dxFreeAndNil(dxBarManagerList); + FreeMem(AClassName, 256); + if FUser32DLL > 32 then + FreeLibrary(FUser32DLL); + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBar.res b/official/x.35/ExpressBars 6/Sources/dxBar.res new file mode 100644 index 00000000..14681a0c Binary files /dev/null and b/official/x.35/ExpressBars 6/Sources/dxBar.res differ diff --git a/official/x.35/ExpressBars 6/Sources/dxBarAccessibility.pas b/official/x.35/ExpressBars 6/Sources/dxBarAccessibility.pas new file mode 100644 index 00000000..e39a1e6a --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarAccessibility.pas @@ -0,0 +1,1582 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars components } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarAccessibility; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Windows, Classes, SysUtils, cxAccessibility, cxClasses, dxBar; + +type + { TdxDockControlAccessibilityHelper } + + TdxDockControlAccessibilityHelper = class(TdxBarAccessibilityHelper) + private + function GetDockControl: TdxDockControl; + protected + // IdxBarAccessibilityHelper + function GetBarManager: TdxBarManager; override; + + function GetChild(AIndex: Integer): TcxAccessibilityHelper; override; + function GetChildCount: Integer; override; + function GetChildIndex(AChild: TcxAccessibilityHelper): Integer; override; + function GetOwnerObjectWindow: HWND; override; + function GetScreenBounds(AChildID: TcxAccessibleSimpleChildElementID): TRect; override; + function GetState(AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + property DockControl: TdxDockControl read GetDockControl; + end; + + { TCustomdxBarControlAccessibilityHelper } + + TCustomdxBarControlAccessibilityHelper = class(TdxBarAccessibilityHelper) + protected + // IdxBarAccessibilityHelper + function CanNavigateToChildren(AKey: Word): Boolean; override; + + function GetChild(AIndex: Integer): TcxAccessibilityHelper; override; + function GetChildCount: Integer; override; + function GetChildIndex(AChild: TcxAccessibilityHelper): Integer; override; + function GetOwnerObjectWindow: HWND; override; + function GetScreenBounds(AChildID: TcxAccessibleSimpleChildElementID): TRect; override; + function GetState(AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + function Expand: TCustomdxBarControlAccessibilityHelper; virtual; + function GetBarControlInstance: TCustomdxBarControl; virtual; abstract; + procedure GetItemControlKeyTipPosition(AItemControl: TdxBarItemControl; + out ABasePoint: TPoint; out AHorzAlign: TAlignment; out AVertAlign: TcxAlignmentVert); virtual; + function GetItemControlScreenBounds(AItemControl: TdxBarItemControl): TRect; + function GetNextAccessibleObject(AItemControl: TdxBarItemControl; + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; overload; virtual; + function IsCollapsed: Boolean; virtual; + procedure UnselectSelectedItemControl; virtual; + + property BarControl: TCustomdxBarControl read GetBarControlInstance; // TODO remove + property BarControlInstance: TCustomdxBarControl read GetBarControlInstance; + end; + + { TdxBarControlAccessibilityHelper } + + TdxBarControlAccessibilityHelper = class(TCustomdxBarControlAccessibilityHelper) + private + function GetBar: TdxBar; + function GetBarControl: TdxBarControl; + protected + // IdxBarAccessibilityHelper + function GetBarManager: TdxBarManager; override; + function GetDefaultAccessibleObject: IdxBarAccessibilityHelper; override; + function HandleNavigationKey(var AKey: Word): Boolean; override; + procedure Select(ASetFocus: Boolean); override; + procedure Unselect(ANextSelectedObject: IdxBarAccessibilityHelper); override; + + function GetChild(AIndex: Integer): TcxAccessibilityHelper; override; + function GetChildCount: Integer; override; + function GetChildIndex(AChild: TcxAccessibilityHelper): Integer; override; + function GetParent: TcxAccessibilityHelper; override; + +// function ChildIsSimpleElement(AIndex: Integer): Boolean; override; +// function GetChildIndex(AChild: TcxAccessibilityHelper): Integer; override; +// function GetHitTest(AScreenX, AScreenY: Integer; out AChildIndex: Integer): TcxAccessibleObjectHitTest; override; +// function GetName(AChildID: TcxAccessibleSimpleChildElementID): string; override; +// function GetSupportedProperties( +// AChildID: TcxAccessibleSimpleChildElementID): TcxAccessibleObjectProperties; override; +// function NavigateToChild(ACurrentChildIndex: Integer; ADirection: TcxAccessibilityNavigationDirection): Integer; override; + + function GetBarControlInstance: TCustomdxBarControl; override; + procedure GetCaptionButtonKeyTipPosition(ACaptionButton: TdxBarCaptionButton; + out ABasePointY: Integer; out AVertAlign: TcxAlignmentVert); virtual; + function GetNextAccessibleObject(AItemControl: TdxBarItemControl; + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; override; + + property Bar: TdxBar read GetBar; + property BarControl: TdxBarControl read GetBarControl; + end; + + { TdxBarControlMarkAccessibilityHelper } + + TdxBarControlMarkAccessibilityHelper = class(TdxBarAccessibilityHelper) + private + function GetBarControl: TdxBarControl; + protected + // IdxBarAccessibilityHelper + function GetBarManager: TdxBarManager; override; + function HandleNavigationKey(var AKey: Word): Boolean; override; + function IsNavigationKey(AKey: Word): Boolean; override; + procedure Select(ASetFocus: Boolean); override; + procedure Unselect(ANextSelectedObject: IdxBarAccessibilityHelper); override; + + function GetOwnerObjectWindow: HWND; override; + function GetParent: TcxAccessibilityHelper; override; + function GetScreenBounds(AChildID: TcxAccessibleSimpleChildElementID): TRect; override; + function GetSelectable: Boolean; override; + function GetState(AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + procedure DropDown; + procedure UpdateMarkState; + + property BarControl: TdxBarControl read GetBarControl; + public + procedure CloseUpHandler(AClosedByEscape: Boolean); + end; + + { TdxBarCaptionButtonsAccessibilityHelper } + + TdxBarCaptionButtonsAccessibilityHelper = class(TdxBarAccessibilityHelper) + private + function GetCaptionButtons: TdxBarCaptionButtons; + protected + // IdxBarAccessibilityHelper + function GetBarManager: TdxBarManager; override; + procedure Unselect(ANextSelectedObject: IdxBarAccessibilityHelper); override; + + function GetChild(AIndex: Integer): TcxAccessibilityHelper; override; + function GetChildCount: Integer; override; + function GetChildIndex(AChild: TcxAccessibilityHelper): Integer; override; + function GetOwnerObjectWindow: HWND; override; + function GetParent: TcxAccessibilityHelper; override; + function GetScreenBounds(AChildID: TcxAccessibleSimpleChildElementID): TRect; override; + function GetState(AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + procedure UpdateCaptionButtons; + + property CaptionButtons: TdxBarCaptionButtons read GetCaptionButtons; + end; + + { TdxBarCaptionButtonAccessibilityHelper } + + TdxBarCaptionButtonAccessibilityHelper = class(TdxBarAccessibilityHelper) + private + procedure DoButtonClick; + function GetCaptionButton: TdxBarCaptionButton; + protected + // IdxBarAccessibilityHelper + function GetBarManager: TdxBarManager; override; + function HandleNavigationKey(var AKey: Word): Boolean; override; + function IsNavigationKey(AKey: Word): Boolean; override; + procedure Select(ASetFocus: Boolean); override; + procedure Unselect(ANextSelectedObject: IdxBarAccessibilityHelper); override; + + function GetOwnerObjectWindow: HWND; override; + function GetParent: TcxAccessibilityHelper; override; + function GetScreenBounds(AChildID: TcxAccessibleSimpleChildElementID): TRect; override; + function GetSelectable: Boolean; override; + function GetState(AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + function GetAssignedKeyTip: string; override; + function GetDefaultKeyTip: string; override; + procedure GetKeyTipInfo(out AKeyTipInfo: TdxBarKeyTipInfo); override; + procedure KeyTipHandler(Sender: TObject); override; + + property CaptionButton: TdxBarCaptionButton read GetCaptionButton; + end; + + { TdxBarSubMenuControlAccessibilityHelper } + + TdxBarSubMenuControlAccessibilityHelper = class(TCustomdxBarControlAccessibilityHelper) + private + function GetBarControl: TdxBarSubMenuControl; + function GetItemLinks: TdxBarItemLinks; + protected + // IdxBarAccessibilityHelper + function GetBarManager: TdxBarManager; override; + function HandleNavigationKey(var AKey: Word): Boolean; override; + + function GetBarControlInstance: TCustomdxBarControl; override; + procedure GetItemControlKeyTipPosition(AItemControl: TdxBarItemControl; + out ABasePoint: TPoint; out AHorzAlign: TAlignment; + out AVertAlign: TcxAlignmentVert); override; + function GetNextItemLink(AItemLink: TdxBarItemLink; + AGoForward: Boolean): TdxBarItemLink; virtual; + function GetParentForKeyTip: TdxBarAccessibilityHelper; override; + procedure HandleHorzNavigationKey(ALeftKey: Boolean); virtual; + procedure HandleVertNavigationKey(AUpKey, AFocusItemControl: Boolean); virtual; + function IsKeyTipContainer: Boolean; override; + procedure KeyTipsEscapeHandler; override; + procedure UnselectSelectedItemControl; override; + + property BarControl: TdxBarSubMenuControl read GetBarControl; + property ItemLinks: TdxBarItemLinks read GetItemLinks; + end; + + { TdxBarItemControlAccessibilityHelper } + + TdxBarItemControlAccessibilityHelper = class(TdxBarAccessibilityHelper) + private + function GetItemControl: TdxBarItemControl; + procedure InvisibleKeyTipHandler(Sender: TObject); + protected + // IdxBarAccessibilityHelper + function GetBarManager: TdxBarManager; override; + function GetNextAccessibleObject( + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; override; + function HandleNavigationKey(var AKey: Word): Boolean; override; + procedure Select(ASetFocus: Boolean); override; + procedure Unselect(ANextSelectedObject: IdxBarAccessibilityHelper); override; + + function GetOwnerObjectWindow: HWND; override; + function GetParent: TcxAccessibilityHelper; override; + function GetScreenBounds(AChildID: TcxAccessibleSimpleChildElementID): TRect; override; + function GetSelectable: Boolean; override; + function GetState(AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + +// function GetDescription(AChildID: TcxAccessibleSimpleChildElementID): string; override; +// procedure GetKeyboardAccessParameters(AChildID: TcxAccessibleSimpleChildElementID; +// out AShortCut: TShortCut; out ACaptionWithAccelChars: string); override; +// function GetName(AChildID: TcxAccessibleSimpleChildElementID): string; override; +// function GetSupportedProperties( +// AChildID: TcxAccessibleSimpleChildElementID): TcxAccessibleObjectProperties; override; + + function CanSelect: Boolean; + function GetAssignedKeyTip: string; override; + function GetDefaultKeyTip: string; override; + procedure GetKeyTipInfo(out AKeyTipInfo: TdxBarKeyTipInfo); override; + function NeedsVisibilityForKeyTipHandling: Boolean; virtual; + + property ItemControl: TdxBarItemControl read GetItemControl; + end; + + { TdxBarButtonLikeControlAccessibilityHelper } + + TdxBarButtonLikeControlAccessibilityHelper = class(TdxBarItemControlAccessibilityHelper) + private + function GetItemControl: TdxBarButtonLikeControl; + protected + procedure DoClick; virtual; + procedure DoDropDown; + function IsDropDownControl: Boolean; virtual; + procedure KeyTipHandler(Sender: TObject); override; + function NeedsVisibilityForKeyTipHandling: Boolean; override; + function ShowDropDownWindow: Boolean; virtual; abstract; + + property ItemControl: TdxBarButtonLikeControl read GetItemControl; + end; + + { TdxBarButtonControlAccessibilityHelper } + + TdxBarButtonControlAccessibilityHelper = class(TdxBarButtonLikeControlAccessibilityHelper) + private + function GetItemControl: TdxBarButtonControl; + protected +// procedure DoDefaultAction(AChildID: TcxAccessibleSimpleChildElementID); override; +// function GetDefaultActionDescription(AChildID: TcxAccessibleSimpleChildElementID): string; override; +// function GetRole(AChildID: TcxAccessibleSimpleChildElementID): Integer; override; +// function GetState(AChildID: TcxAccessibleSimpleChildElementID): Integer; override; +// function GetSupportedProperties(AChildID: TcxAccessibleSimpleChildElementID): TcxAccessibleObjectProperties; override; + + function IsDropDownControl: Boolean; override; + function ShowDropDownWindow: Boolean; override; + + property ItemControl: TdxBarButtonControl read GetItemControl; + end; + + { TdxBarSubItemControlAccessibilityHelper } + + TdxBarSubItemControlAccessibilityHelper = class(TdxBarButtonLikeControlAccessibilityHelper) + protected + function IsDropDownControl: Boolean; override; + function ShowDropDownWindow: Boolean; override; + end; + + { TdxBarWinControlAccessibilityHelper } + + TdxBarWinControlAccessibilityHelper = class(TdxBarItemControlAccessibilityHelper) + protected + procedure KeyTipHandler(Sender: TObject); override; + function NeedsVisibilityForKeyTipHandling: Boolean; override; + end; + +implementation + +uses + Messages, Controls, cxContainer, cxControls, cxGeometry, cxGraphics, Menus, + dxBarStrs; + +type + TCustomdxBarControlAccess = class(TCustomdxBarControl); + TdxBarButtonControlAccess = class(TdxBarButtonControl); + TdxBarControlAccess = class(TdxBarControl); + TdxBarItemControlAccess = class(TdxBarItemControl); + TdxBarItemLinksAccess = class(TdxBarItemLinks); + TdxBarManagerAccess = class(TdxBarManager); + TdxBarSubItemAccess = class(TdxBarSubItem); + TdxBarSubItemControlAccess = class(TdxBarSubItemControl); + TdxBarSubMenuControlAccess = class(TdxBarSubMenuControl); + +{ TdxDockControlAccessibilityHelper } + +// IdxBarAccessibilityHelper +function TdxDockControlAccessibilityHelper.GetBarManager: TdxBarManager; +begin + Result := DockControl.BarManager; +end; + +function TdxDockControlAccessibilityHelper.GetChild( + AIndex: Integer): TcxAccessibilityHelper; +var + I: Integer; +begin + I := 0; + while AIndex >= DockControl.Rows[I].ColCount do + begin + Dec(AIndex, DockControl.Rows[I].ColCount); + Inc(I); + end; + Result := DockControl.Rows[I].Cols[AIndex].BarControl.IAccessibilityHelper.GetHelper; +end; + +function TdxDockControlAccessibilityHelper.GetChildCount: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to DockControl.RowCount - 1 do + Inc(Result, DockControl.Rows[I].ColCount); +end; + +function TdxDockControlAccessibilityHelper.GetChildIndex( + AChild: TcxAccessibilityHelper): Integer; +var + AIndex, I, J: Integer; +begin + Result := -1; + AIndex := 0; + for I := 0 to DockControl.RowCount - 1 do + for J := 0 to DockControl.Rows[I].ColCount - 1 do + if DockControl.Rows[I].Cols[J].BarControl.IAccessibilityHelper.GetHelper = AChild then + begin + Result := AIndex; + Break; + end + else + Inc(AIndex); +end; + +function TdxDockControlAccessibilityHelper.GetOwnerObjectWindow: HWND; +begin + if DockControl.HandleAllocated then + Result := DockControl.Handle + else + Result := 0; +end; + +function TdxDockControlAccessibilityHelper.GetScreenBounds( + AChildID: TcxAccessibleSimpleChildElementID): TRect; +begin + if Visible then + GetWindowRect(GetOwnerObjectWindow, Result) + else + Result := cxEmptyRect; +end; + +function TdxDockControlAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +var + AHandle: HWND; +begin + Result := cxSTATE_SYSTEM_NORMAL; + AHandle := GetOwnerObjectWindow; + if (AHandle = 0) or not IsWindowVisible(AHandle) then + Result := Result or cxSTATE_SYSTEM_INVISIBLE; +end; + +function TdxDockControlAccessibilityHelper.GetDockControl: TdxDockControl; +begin + Result := TdxDockControl(FOwnerObject); +end; + +{ TCustomdxBarControlAccessibilityHelper } + +// IdxBarAccessibilityHelper +function TCustomdxBarControlAccessibilityHelper.CanNavigateToChildren(AKey: Word): Boolean; +var + ABarControlInstance: TCustomdxBarControlAccess; +begin + ABarControlInstance := TCustomdxBarControlAccess(BarControlInstance); + Result := not (ABarControlInstance.SelectedControl is TdxBarWinControl and + TdxBarWinControl(ABarControlInstance.SelectedControl).Focused); +end; + +function TCustomdxBarControlAccessibilityHelper.GetChild( + AIndex: Integer): TcxAccessibilityHelper; +begin + Result := BarControlInstance.ViewInfo.ItemControlViewInfos[AIndex].Control.IAccessibilityHelper.GetHelper; +end; + +function TCustomdxBarControlAccessibilityHelper.GetChildCount: Integer; +begin + Result := BarControlInstance.ViewInfo.ItemControlCount; +end; + +function TCustomdxBarControlAccessibilityHelper.GetChildIndex( + AChild: TcxAccessibilityHelper): Integer; +begin + if AChild is TdxBarItemControlAccessibilityHelper then + Result := BarControlInstance.ViewInfo.GetItemControlIndex(TdxBarItemControlAccessibilityHelper(AChild).ItemControl) + else + Result := -1; +end; + +function TCustomdxBarControlAccessibilityHelper.GetOwnerObjectWindow: HWND; +begin + if BarControlInstance.HandleAllocated then + Result := BarControlInstance.Handle + else + Result := 0; +end; + +function TCustomdxBarControlAccessibilityHelper.GetScreenBounds( + AChildID: TcxAccessibleSimpleChildElementID): TRect; +begin + if Visible then + GetWindowRect(GetOwnerObjectWindow, Result) + else + Result := cxEmptyRect; +end; + +function TCustomdxBarControlAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +var + AHandle: HWND; +begin + Result := cxSTATE_SYSTEM_NORMAL; + AHandle := GetOwnerObjectWindow; + if (AHandle = 0) or not IsWindowVisible(AHandle) then + Result := Result or cxSTATE_SYSTEM_INVISIBLE; +end; + +function TCustomdxBarControlAccessibilityHelper.Expand: TCustomdxBarControlAccessibilityHelper; +begin + raise Exception.Create(''); +end; + +procedure TCustomdxBarControlAccessibilityHelper.GetItemControlKeyTipPosition( + AItemControl: TdxBarItemControl; out ABasePoint: TPoint; + out AHorzAlign: TAlignment; out AVertAlign: TcxAlignmentVert); +begin + ABasePoint := cxRectCenter(GetItemControlScreenBounds(AItemControl)); + AHorzAlign := taCenter; + AVertAlign := vaCenter; +end; + +function TCustomdxBarControlAccessibilityHelper.GetItemControlScreenBounds( + AItemControl: TdxBarItemControl): TRect; +begin + Result := TdxBarItemControlAccessibilityHelper( + AItemControl.IAccessibilityHelper.GetHelper).GetScreenBounds(cxAccessibleObjectSelfID); +end; + +function TCustomdxBarControlAccessibilityHelper.GetNextAccessibleObject( + AItemControl: TdxBarItemControl; + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; +var + AObjects: TList; +begin + AObjects := TList.Create; + try + GetChildrenForNavigation(AItemControl.IAccessibilityHelper.GetBarHelper, + Self, GetItemControlScreenBounds(AItemControl), ADirection, True, AObjects); + Result := dxBar.GetNextAccessibleObject( + AItemControl.IAccessibilityHelper.GetBarHelper, AObjects, ADirection, False); + finally + AObjects.Free; + end; +end; + +function TCustomdxBarControlAccessibilityHelper.IsCollapsed: Boolean; +begin + Result := False; +end; + +procedure TCustomdxBarControlAccessibilityHelper.UnselectSelectedItemControl; +begin + if TdxBarManagerAccess(BarControlInstance.BarManager).FocusedBarControl = BarControlInstance then + BarControlInstance.BarLostFocus + else + TCustomdxBarControlAccess(BarControlInstance).SetKeySelectedItem(nil); +end; + +{ TdxBarControlAccessibilityHelper } + +// IdxBarAccessibilityHelper +function TdxBarControlAccessibilityHelper.GetBarManager: TdxBarManager; +begin + Result := Bar.BarManager; +end; + +function TdxBarControlAccessibilityHelper.GetDefaultAccessibleObject: IdxBarAccessibilityHelper; +begin + Result := Self; +end; + +function TdxBarControlAccessibilityHelper.HandleNavigationKey(var AKey: Word): Boolean; +var + ATempKey: Word; +begin + Result := inherited HandleNavigationKey(AKey); + if Result then + Exit; + + ATempKey := AKey; + if BarControl.IsRealVertical then + begin + case ATempKey of + VK_LEFT: + ATempKey := VK_UP; + VK_RIGHT: + ATempKey := VK_DOWN; + VK_UP: + ATempKey := VK_LEFT; + VK_DOWN: + ATempKey := VK_RIGHT; + end; + end; + Result := TdxBarControlAccess(BarControl).SelectedItemWantsKey(ATempKey); +end; + +procedure TdxBarControlAccessibilityHelper.Select(ASetFocus: Boolean); +begin + BarControl.BarGetFocus(nil); +end; + +procedure TdxBarControlAccessibilityHelper.Unselect( + ANextSelectedObject: IdxBarAccessibilityHelper); +begin + inherited Unselect(ANextSelectedObject); + BarControl.HideAll; +end; + +function TdxBarControlAccessibilityHelper.GetChild( + AIndex: Integer): TcxAccessibilityHelper; +begin + if AIndex = BarControl.ViewInfo.ItemControlCount then + Result := BarControl.Bar.CaptionButtons.IAccessibilityHelper.GetHelper + else + Result := inherited GetChild(AIndex); +end; + +function TdxBarControlAccessibilityHelper.GetChildCount: Integer; +begin + Result := inherited GetChildCount + 1; +end; + +function TdxBarControlAccessibilityHelper.GetChildIndex( + AChild: TcxAccessibilityHelper): Integer; +begin + if AChild = BarControl.Bar.CaptionButtons.IAccessibilityHelper.GetHelper then + Result := inherited GetChildCount + else + Result := inherited GetChildIndex(AChild); +end; + +function TdxBarControlAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + if BarControl.DockControl <> nil then + Result := BarControl.DockControl.IAccessibilityHelper.GetHelper + else + Result := inherited GetParent; +end; + +//function TdxBarControlAccessibilityHelper.ChildIsSimpleElement( +// AIndex: Integer): Boolean; +//begin +// Result := False; +//end; +// +//function TdxBarControlAccessibilityHelper.GetChildIndex( +// AChild: TcxAccessibilityHelper): Integer; +//begin +// Result := BarControl.ViewInfo.GetItemControlIndex( +// TdxBarItemControlAccessibilityHelper(AChild).ItemControl); +//end; +// +//function TdxBarControlAccessibilityHelper.GetHitTest(AScreenX, AScreenY: Integer; +// out AChildIndex: Integer): TcxAccessibleObjectHitTest; +//var +// AItemControl: TdxBarItemControl; +//begin +// AItemControl := BarControl.ItemAtPos(BarControl.ScreenToClient(Point(AScreenX, AScreenY))); +// if AItemControl <> nil then +// begin +// AChildIndex := BarControl.ViewInfo.GetItemControlIndex(AItemControl); +// Result := aohtChild; +// end +// else +// Result := aohtSelf; +//end; +// +//function TdxBarControlAccessibilityHelper.GetName( +// AChildID: TcxAccessibleSimpleChildElementID): string; +//begin +// Result := BarControl.Bar.Caption; +//end; +// +//function TdxBarControlAccessibilityHelper.GetSupportedProperties( +// AChildID: TcxAccessibleSimpleChildElementID): TcxAccessibleObjectProperties; +//begin +// Result := [aopLocation]; +//end; +// +//function TdxBarControlAccessibilityHelper.NavigateToChild( +// ACurrentChildIndex: Integer; ADirection: TcxAccessibilityNavigationDirection): Integer; +//begin +// Result := ACurrentChildIndex; +// case ADirection of +// andLeft: +// if ACurrentChildIndex > 0 then +// Dec(Result); +// andRight: +// if ACurrentChildIndex + 1 < GetChildCount then +// Inc(Result); +// end; +//end; + +function TdxBarControlAccessibilityHelper.GetBarControlInstance: TCustomdxBarControl; +begin + Result := Bar.Control; +end; + +procedure TdxBarControlAccessibilityHelper.GetCaptionButtonKeyTipPosition( + ACaptionButton: TdxBarCaptionButton; out ABasePointY: Integer; + out AVertAlign: TcxAlignmentVert); +begin + raise Exception.Create(''); +end; + +function TdxBarControlAccessibilityHelper.GetNextAccessibleObject( + AItemControl: TdxBarItemControl; + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; +var + AItemLink: TdxBarItemLink; + ARelativeDirection: TcxAccessibilityNavigationDirection; +begin + ARelativeDirection := ADirection; + if BarControl.IsRealVertical then + case ADirection of + andLeft: + ARelativeDirection := andUp; + andRight: + ARelativeDirection := andDown; + andUp: + ARelativeDirection := andLeft; + andDown: + ARelativeDirection := andRight; + end; + + if ARelativeDirection in [andUp, andDown] then + Result := inherited GetNextAccessibleObject(AItemControl, ADirection) + else + begin + if ARelativeDirection = andLeft then + AItemLink := TdxBarItemLinksAccess(BarControl.ItemLinks).Prev(AItemControl.ItemLink) + else + AItemLink := TdxBarItemLinksAccess(BarControl.ItemLinks).Next(AItemControl.ItemLink); + if (AItemLink <> nil) and (AItemLink.Control <> nil) then + Result := AItemLink.Control.IAccessibilityHelper + else + Result := nil; + end; +end; + +function TdxBarControlAccessibilityHelper.GetBar: TdxBar; +begin + Result := BarControl.Bar;//TdxBar(FOwnerObject); +end; + +function TdxBarControlAccessibilityHelper.GetBarControl: TdxBarControl; +begin + Result := TdxBarControl(FOwnerObject); +end; + +{ TdxBarControlMarkAccessibilityHelper } + +procedure TdxBarControlMarkAccessibilityHelper.CloseUpHandler( + AClosedByEscape: Boolean); +begin + if AClosedByEscape and BarNavigationController.NavigationMode then + BarControl.MarkIAccessibilityHelper.Select(False); +end; + +// IdxBarAccessibilityHelper +function TdxBarControlMarkAccessibilityHelper.GetBarManager: TdxBarManager; +begin + Result := BarControl.BarManager; +end; + +function TdxBarControlMarkAccessibilityHelper.HandleNavigationKey(var AKey: Word): Boolean; +begin + Result := inherited HandleNavigationKey(AKey); + if not Result then + begin + Result := AKey in [VK_RETURN, VK_SPACE]; + if Result then + DropDown; + end; +end; + +function TdxBarControlMarkAccessibilityHelper.IsNavigationKey( + AKey: Word): Boolean; +begin + Result := inherited IsNavigationKey(AKey) or + (AKey in [VK_ESCAPE, VK_RETURN, VK_SPACE]); +end; + +procedure TdxBarControlMarkAccessibilityHelper.Select(ASetFocus: Boolean); +begin + inherited Select(ASetFocus); + TdxBarControlAccess(BarControl).InvalidateMark; +end; + +procedure TdxBarControlMarkAccessibilityHelper.Unselect( + ANextSelectedObject: IdxBarAccessibilityHelper); +begin + inherited Unselect(ANextSelectedObject); + TdxBarControlAccess(BarControl).InvalidateMark; +end; + +function TdxBarControlMarkAccessibilityHelper.GetOwnerObjectWindow: HWND; +begin + Result := Parent.OwnerObjectWindow; +end; + +function TdxBarControlMarkAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := BarControl.IAccessibilityHelper.GetHelper; +end; + +function TdxBarControlMarkAccessibilityHelper.GetScreenBounds( + AChildID: TcxAccessibleSimpleChildElementID): TRect; +begin + if Visible then + begin + Result := TCustomdxBarControlAccess(BarControl).MarkRect; + Result.TopLeft := BarControl.ClientToScreen(Result.TopLeft); + Result.BottomRight := BarControl.ClientToScreen(Result.BottomRight); + end + else + Result := cxEmptyRect; +end; + +function TdxBarControlMarkAccessibilityHelper.GetSelectable: Boolean; +begin + Result := Visible; +end; + +function TdxBarControlMarkAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := Parent.States[cxAccessibleObjectSelfID]; + if not TCustomdxBarControlAccess(BarControl).MarkExists or + IsRectEmpty(TCustomdxBarControlAccess(BarControl).MarkRect) then + Result := Result or STATE_SYSTEM_INVISIBLE; +end; + +procedure TdxBarControlMarkAccessibilityHelper.DropDown; +begin + Unselect(nil); + TdxBarControlAccess(BarControl).MarkState := msPressed; +end; + +procedure TdxBarControlMarkAccessibilityHelper.UpdateMarkState; +begin + TdxBarControlAccess(BarControl).CheckMarkState( + BarControl.ScreenToClient(GetMouseCursorPos)); +end; + +function TdxBarControlMarkAccessibilityHelper.GetBarControl: TdxBarControl; +begin + Result := TdxBarControl(FOwnerObject); +end; + +{ TdxBarCaptionButtonsAccessibilityHelper } + +// IdxBarAccessibilityHelper +function TdxBarCaptionButtonsAccessibilityHelper.GetBarManager: TdxBarManager; +begin + Result := CaptionButtons.Bar.BarManager; +end; + +procedure TdxBarCaptionButtonsAccessibilityHelper.Unselect( + ANextSelectedObject: IdxBarAccessibilityHelper); +begin + inherited Unselect(ANextSelectedObject); + UpdateCaptionButtons; +end; + +function TdxBarCaptionButtonsAccessibilityHelper.GetChild( + AIndex: Integer): TcxAccessibilityHelper; +begin + Result := CaptionButtons[CaptionButtons.Count - 1 - AIndex].IAccessibilityHelper.GetHelper; +end; + +function TdxBarCaptionButtonsAccessibilityHelper.GetChildCount: Integer; +begin + Result := CaptionButtons.Count; +end; + +function TdxBarCaptionButtonsAccessibilityHelper.GetChildIndex( + AChild: TcxAccessibilityHelper): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to ChildCount - 1 do + if CaptionButtons[I].IAccessibilityHelper.GetHelper = AChild then + begin + Result := ChildCount - 1 - I; + end; +end; + +function TdxBarCaptionButtonsAccessibilityHelper.GetOwnerObjectWindow: HWND; +begin + Result := Parent.OwnerObjectWindow; +end; + +function TdxBarCaptionButtonsAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := CaptionButtons.Bar.Control.IAccessibilityHelper.GetHelper; +end; + +function TdxBarCaptionButtonsAccessibilityHelper.GetScreenBounds( + AChildID: TcxAccessibleSimpleChildElementID): TRect; +var + R: TRect; +begin + if Visible then + begin + Result := CaptionButtons.Rect; + GetWindowRect(OwnerObjectWindow, R); + OffsetRect(Result, R.Left, R.Top); + end + else + Result := cxEmptyRect; +end; + +function TdxBarCaptionButtonsAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := Parent.States[cxAccessibleObjectSelfID]; + if (Result and cxSTATE_SYSTEM_INVISIBLE = 0) and (IsRectEmpty(CaptionButtons.Rect) or + TCustomdxBarControlAccessibilityHelper(Parent).IsCollapsed) then + Result := Result or cxSTATE_SYSTEM_INVISIBLE; +end; + +procedure TdxBarCaptionButtonsAccessibilityHelper.UpdateCaptionButtons; +var + P: TPoint; + R: TRect; +begin + P := GetMouseCursorPos; + GetWindowRect(OwnerObjectWindow, R); + CaptionButtons.UpdateButtonStates(cxPointOffset(P, -R.Left, -R.Top)); +end; + +function TdxBarCaptionButtonsAccessibilityHelper.GetCaptionButtons: TdxBarCaptionButtons; +begin + Result := TdxBarCaptionButtons(FOwnerObject); +end; + +{ TdxBarCaptionButtonAccessibilityHelper } + +// IdxBarAccessibilityHelper +function TdxBarCaptionButtonAccessibilityHelper.GetBarManager: TdxBarManager; +begin + Result := Parent.BarManager; +end; + +function TdxBarCaptionButtonAccessibilityHelper.HandleNavigationKey( + var AKey: Word): Boolean; +begin + Result := inherited HandleNavigationKey(AKey); + if Result then + Exit; + + Result := True; + case AKey of + VK_ESCAPE: + begin + Unselect(nil); + TdxBarControlAccess(CaptionButton.Collection.Bar.Control).HideAllByEscape; + end; + VK_RETURN, VK_SPACE: + begin + Unselect(nil); + DoButtonClick; + end + else + Result := False; + end; +end; + +function TdxBarCaptionButtonAccessibilityHelper.IsNavigationKey( + AKey: Word): Boolean; +begin + Result := inherited IsNavigationKey(AKey) or (AKey in [VK_ESCAPE, VK_RETURN, VK_SPACE]); +end; + +procedure TdxBarCaptionButtonAccessibilityHelper.Select(ASetFocus: Boolean); +begin + inherited Select(ASetFocus); + TdxBarCaptionButtonsAccessibilityHelper(Parent).UpdateCaptionButtons; +end; + +procedure TdxBarCaptionButtonAccessibilityHelper.Unselect( + ANextSelectedObject: IdxBarAccessibilityHelper); +begin + inherited Unselect(ANextSelectedObject); + TdxBarCaptionButtonsAccessibilityHelper(Parent).UpdateCaptionButtons; +end; + +function TdxBarCaptionButtonAccessibilityHelper.GetOwnerObjectWindow: HWND; +begin + Result := Parent.OwnerObjectWindow; +end; + +function TdxBarCaptionButtonAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := TdxBarCaptionButtons(CaptionButton.Collection).IAccessibilityHelper.GetHelper; +end; + +function TdxBarCaptionButtonAccessibilityHelper.GetScreenBounds( + AChildID: TcxAccessibleSimpleChildElementID): TRect; +var + R: TRect; +begin + if Visible then + begin + Result := CaptionButton.Rect; + GetWindowRect(OwnerObjectWindow, R); + OffsetRect(Result, R.Left, R.Top); + end + else + Result := cxEmptyRect; +end; + +function TdxBarCaptionButtonAccessibilityHelper.GetSelectable: Boolean; +begin + Result := Visible; +end; + +function TdxBarCaptionButtonAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := Parent.States[cxAccessibleObjectSelfID]; + if (Result and cxSTATE_SYSTEM_INVISIBLE = 0) and IsRectEmpty(CaptionButton.Rect) then + Result := Result or cxSTATE_SYSTEM_INVISIBLE; +end; + +function TdxBarCaptionButtonAccessibilityHelper.GetAssignedKeyTip: string; +begin + Result := CaptionButton.KeyTip; +end; + +function TdxBarCaptionButtonAccessibilityHelper.GetDefaultKeyTip: string; +begin + Result := 'Y'; +end; + +procedure TdxBarCaptionButtonAccessibilityHelper.GetKeyTipInfo(out AKeyTipInfo: TdxBarKeyTipInfo); +var + ABasePoint: TPoint; +begin + inherited; + if Visible then + begin + with GetScreenBounds(cxAccessibleObjectSelfID) do + ABasePoint.X := (Left + Right) div 2; + TdxBarControlAccessibilityHelper(Parent.Parent).GetCaptionButtonKeyTipPosition( + CaptionButton, ABasePoint.Y, AKeyTipInfo.VertAlign); + AKeyTipInfo.BasePoint := ABasePoint; + AKeyTipInfo.HorzAlign := taCenter; + end; + AKeyTipInfo.Enabled := CaptionButton.Enabled; +end; + +procedure TdxBarCaptionButtonAccessibilityHelper.KeyTipHandler(Sender: TObject); +begin + BarNavigationController.StopKeyboardHandling; + DoButtonClick; +end; + +procedure TdxBarCaptionButtonAccessibilityHelper.DoButtonClick; +begin + TdxBarControlAccess(CaptionButton.Collection.Bar.Control).CaptionButtonClick(CaptionButton.Index); +end; + +function TdxBarCaptionButtonAccessibilityHelper.GetCaptionButton: TdxBarCaptionButton; +begin + Result := TdxBarCaptionButton(FOwnerObject); +end; + +{ TdxBarSubMenuControlAccessibilityHelper } + +// IdxBarAccessibilityHelper +function TdxBarSubMenuControlAccessibilityHelper.GetBarManager: TdxBarManager; +begin + Result := ItemLinks.BarManager; +end; + +function TdxBarSubMenuControlAccessibilityHelper.HandleNavigationKey( + var AKey: Word): Boolean; +var + ABarControl: TdxBarSubMenuControlAccess; + AFocusItemControl: Boolean; + AItemLink: TdxBarItemLink; + AShift: TShiftState; + ATempKey: Word; +begin + Result := inherited HandleNavigationKey(AKey); + if Result then + Exit; + + Result := True; + AShift := InternalGetShiftState; + ABarControl := TdxBarSubMenuControlAccess(BarControl); + ABarControl.TerminateAnimation; + + if ABarControl.MarkExists then + begin + if (AKey = VK_DOWN) and (AShift = [ssCtrl]) then + begin + ABarControl.MarkState := msPressed; + Exit; + end + else + if ((AKey = VK_DOWN) or (AKey = VK_TAB) and (AShift = [])) and (ABarControl.SelectedControl <> nil) then + begin + AItemLink := ABarControl.SelectedControl.ItemLink; + if AItemLink.VisibleIndex = AItemLink.Owner.VisibleItemCount - 1 then + begin + ABarControl.MarkState := msPressed; + ATempKey := VK_DOWN; + HandleNavigationKey(ATempKey); + Exit; + end; + end; + end; + AFocusItemControl := AKey = VK_TAB; + if AFocusItemControl then + if AShift = [] then + AKey := VK_DOWN + else + AKey := VK_UP; + + if ABarControl.SelectedItemWantsKey(AKey) then + Exit; + case AKey of + VK_LEFT, VK_RIGHT: + HandleHorzNavigationKey(AKey = VK_LEFT); + VK_UP, VK_DOWN: + HandleVertNavigationKey(AKey = VK_UP, AFocusItemControl); + end; +end; + +function TdxBarSubMenuControlAccessibilityHelper.GetBarControlInstance: TCustomdxBarControl; +begin + Result := ItemLinks.BarControl; +end; + +procedure TdxBarSubMenuControlAccessibilityHelper.GetItemControlKeyTipPosition( + AItemControl: TdxBarItemControl; out ABasePoint: TPoint; + out AHorzAlign: TAlignment; out AVertAlign: TcxAlignmentVert); +begin + with TdxBarSubMenuControlAccess(BarControl) do + ABasePoint.X := ClientOrigin.X + BarRect.Right + BandSize div 2; + with GetItemControlScreenBounds(AItemControl) do + ABasePoint.Y := (Top + Bottom) div 2; + AHorzAlign := taRightJustify; + AVertAlign := vaBottom; +end; + +function TdxBarSubMenuControlAccessibilityHelper.GetNextItemLink( + AItemLink: TdxBarItemLink; AGoForward: Boolean): TdxBarItemLink; +begin + if AItemLink = nil then + begin + if TdxBarItemLinksAccess(ItemLinks).RealVisibleItemCount > 0 then + Result := TdxBarItemLinksAccess(ItemLinks).First + else + Result := nil; + end + else + if AGoForward then + Result := TdxBarItemLinksAccess(ItemLinks).Next(AItemLink) + else + Result := TdxBarItemLinksAccess(ItemLinks).Prev(AItemLink); +end; + +function TdxBarSubMenuControlAccessibilityHelper.GetParentForKeyTip: TdxBarAccessibilityHelper; +begin + if BarControl.ParentBar <> nil then + Result := TCustomdxBarControlAccess(BarControl.ParentBar).SelectedControl.IAccessibilityHelper.GetBarHelper + else + Result := nil; +end; + +procedure TdxBarSubMenuControlAccessibilityHelper.HandleHorzNavigationKey( + ALeftKey: Boolean); +const + ANavigationDirectionMap: array[Boolean] of TcxAccessibilityNavigationDirection = + (andRight, andLeft); +var + ABarControl: TdxBarSubMenuControlAccess; + ANextObject, ASelectedObject: IdxBarAccessibilityHelper; + AParentBarControl: TCustomdxBarControlAccess; +begin + ABarControl := TdxBarSubMenuControlAccess(BarControl); + if ABarControl.SelectedLink <> nil then + begin + ASelectedObject := ABarControl.SelectedLink.Control.IAccessibilityHelper; + ANextObject := ASelectedObject.GetNextAccessibleObject( + ANavigationDirectionMap[ALeftKey]); + if (ANextObject <> nil) and (ANextObject.GetBarHelper <> ASelectedObject.GetBarHelper) then + begin + ASelectedObject.Unselect(ANextObject); + ANextObject.Select(False); + Exit; + end; + end; + if ALeftKey then + begin + AParentBarControl := TCustomdxBarControlAccess(ABarControl.ParentBar); + if (AParentBarControl <> nil) and (AParentBarControl.SelectedControl <> nil) then + if ABarControl.ParentBar is TdxBarSubMenuControl then + TdxBarItemControlAccess(AParentBarControl.SelectedControl).ControlInactivate(True) + else + begin + AParentBarControl := TCustomdxBarControlAccess(GetParentBarForBar(ABarControl)); + if AParentBarControl <> nil then + if AParentBarControl.IsRealVertical then + SendMessage(ABarControl.Handle, WM_KEYDOWN, VK_ESCAPE, 0) + else + if not (bboMouseCantUnselectNavigationItem in AParentBarControl.BehaviorOptions) then + BarNavigationController.HandleKey(VK_LEFT, AParentBarControl.IAccessibilityHelper, AParentBarControl.SelectedControl.IAccessibilityHelper); + end; + end + else + begin + AParentBarControl := TCustomdxBarControlAccess(GetParentBarForBar(ABarControl)); + if (AParentBarControl <> nil) and not (bboMouseCantUnselectNavigationItem in AParentBarControl.BehaviorOptions) then + BarNavigationController.HandleKey(VK_RIGHT, AParentBarControl.IAccessibilityHelper, AParentBarControl.SelectedControl.IAccessibilityHelper); + end; +end; + +procedure TdxBarSubMenuControlAccessibilityHelper.HandleVertNavigationKey( + AUpKey, AFocusItemControl: Boolean); +var + ANextItemLink: TdxBarItemLink; + ANextObject: IdxBarAccessibilityHelper; + ASelectedLink: TdxBarItemLink; +begin + ASelectedLink := TdxBarSubMenuControlAccess(BarControl).SelectedLink; + ANextItemLink := GetNextItemLink(ASelectedLink, not AUpKey); + if (ANextItemLink <> nil) and (ANextItemLink.Control <> nil) then + begin + ANextObject := ANextItemLink.Control.IAccessibilityHelper; + if ASelectedLink <> nil then + ASelectedLink.Control.IAccessibilityHelper.Unselect(ANextObject); + ANextObject.Select(AFocusItemControl); + end; +end; + +function TdxBarSubMenuControlAccessibilityHelper.IsKeyTipContainer: Boolean; +begin + Result := True; +end; + +procedure TdxBarSubMenuControlAccessibilityHelper.KeyTipsEscapeHandler; +var + ANewKeyTipContainer: IdxBarAccessibilityHelper; +begin + ANewKeyTipContainer := GetKeyTipContainerParent(ParentForKeyTip); + if ANewKeyTipContainer = nil then + ANewKeyTipContainer := ParentForKeyTip; + SendMessage(BarControl.Handle, WM_KEYDOWN, VK_ESCAPE, 0); + BarNavigationController.SetKeyTipsShowingState(ANewKeyTipContainer, ''); +end; + +procedure TdxBarSubMenuControlAccessibilityHelper.UnselectSelectedItemControl; +begin + TdxBarSubMenuControlAccess(BarControl).SetKeySelectedItem(nil); +end; + +function TdxBarSubMenuControlAccessibilityHelper.GetBarControl: TdxBarSubMenuControl; +begin + Result := TdxBarSubMenuControl(FOwnerObject); +end; + +function TdxBarSubMenuControlAccessibilityHelper.GetItemLinks: TdxBarItemLinks; +begin + Result := BarControl.ItemLinks; +end; + +{ TdxBarItemControlAccessibilityHelper } + +// IdxBarAccessibilityHelper +function TdxBarItemControlAccessibilityHelper.GetBarManager: TdxBarManager; +begin + Result := ItemControl.BarManager; +end; + +function TdxBarItemControlAccessibilityHelper.GetNextAccessibleObject( + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; +begin + Result := TCustomdxBarControlAccessibilityHelper(Parent).GetNextAccessibleObject(ItemControl, ADirection); +end; + +function TdxBarItemControlAccessibilityHelper.HandleNavigationKey( + var AKey: Word): Boolean; +begin + Result := inherited HandleNavigationKey(AKey) or + TCustomdxBarControlAccessibilityHelper(Parent).HandleNavigationKey(AKey); +end; + +procedure TdxBarItemControlAccessibilityHelper.Select(ASetFocus: Boolean); +begin + if ItemControl.Parent.IsActive then + TCustomdxBarControlAccess(ItemControl.Parent).SetKeySelectedItem(ItemControl) + else + ItemControl.Parent.BarGetFocus(ItemControl); + if ItemControl.HasWindow and (ASetFocus or not (bboAllowSelectWindowItemsWithoutFocusing in ItemControl.Parent.BehaviorOptions)) then + TdxBarItemControlAccess(ItemControl).Click(False); +end; + +procedure TdxBarItemControlAccessibilityHelper.Unselect( + ANextSelectedObject: IdxBarAccessibilityHelper); +begin + inherited Unselect(ANextSelectedObject); + if not ((ANextSelectedObject <> nil) and + (ANextSelectedObject.GetHelper is TdxBarItemControlAccessibilityHelper) and + (ANextSelectedObject.GetHelper.Parent = Parent)) then + TCustomdxBarControlAccessibilityHelper(Parent).UnselectSelectedItemControl; +end; + +function TdxBarItemControlAccessibilityHelper.GetOwnerObjectWindow: HWND; +begin + if ItemControl.Parent.HandleAllocated then + Result := ItemControl.Parent.Handle + else + Result := 0; +end; + +function TdxBarItemControlAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + if ItemControl.Parent.IAccessibilityHelper <> nil then + Result := ItemControl.Parent.IAccessibilityHelper.GetHelper + else + Result := nil; +end; + +function TdxBarItemControlAccessibilityHelper.GetScreenBounds( + AChildID: TcxAccessibleSimpleChildElementID): TRect; +begin + if Visible then + begin + Result := ItemControl.ViewInfo.Bounds; + with ItemControl.Parent do + begin + Result.TopLeft := ClientToScreen(Result.TopLeft); + Result.BottomRight := ClientToScreen(Result.BottomRight); + end; + end + else + Result := cxEmptyRect; +end; + +function TdxBarItemControlAccessibilityHelper.GetSelectable: Boolean; +begin + Result := Visible and CanSelect; +end; + +function TdxBarItemControlAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +var + AHandle: HWND; +begin + Result := cxSTATE_SYSTEM_NORMAL; + AHandle := GetOwnerObjectWindow; + if (AHandle = 0) or not IsWindowVisible(AHandle) or TCustomdxBarControlAccessibilityHelper(Parent).IsCollapsed then + Result := Result or cxSTATE_SYSTEM_INVISIBLE; +end; + +//function TdxBarItemControlAccessibilityHelper.GetDescription( +// AChildID: TcxAccessibleSimpleChildElementID): string; +//begin +// Result := ItemControl.Item.Description; +//end; +// +//procedure TdxBarItemControlAccessibilityHelper.GetKeyboardAccessParameters( +// AChildID: TcxAccessibleSimpleChildElementID; out AShortCut: TShortCut; +// out ACaptionWithAccelChars: string); +//begin +// AShortCut := ItemControl.Item.ShortCut; +// ACaptionWithAccelChars := ItemControl.ItemLink.Caption; +//end; +// +//function TdxBarItemControlAccessibilityHelper.GetName( +// AChildID: TcxAccessibleSimpleChildElementID): string; +//begin +// Result := ItemControl.ItemLink.Caption; +//end; +// +//function TdxBarItemControlAccessibilityHelper.GetSupportedProperties( +// AChildID: TcxAccessibleSimpleChildElementID): TcxAccessibleObjectProperties; +//begin +// Result := [aopLocation, aopShortcut]; +// if GetDescription(AChildID) <> '' then +// Include(Result, aopDescription); +//end; + +function TdxBarItemControlAccessibilityHelper.CanSelect: Boolean; +begin + Result := TdxBarItemControlAccess(ItemControl).CanSelect; +end; + +function TdxBarItemControlAccessibilityHelper.GetAssignedKeyTip: string; +begin + Result := ItemControl.Item.KeyTip; +end; + +function TdxBarItemControlAccessibilityHelper.GetDefaultKeyTip: string; + + function IsShortCutAcceptible(AShortCut: TShortCut): Boolean; + begin + Result := (AShortCut >= 16449{Ctrl+A}) and (AShortCut <= 16474{Ctrl+Z}) + end; + + function GetKeyTipByShortCut(AShortCut: TShortCut): string; + var + AShortCutText: string; + begin + AShortCutText := ShortCutToText(AShortCut); + if AShortCutText <> '' then + Result := AShortCutText[Length(AShortCutText)] + else + Result := ''; + end; + +var + AnAccelPos: Integer; + ACaption: string; + AShortCut: TShortCut; +begin + AShortCut := TdxBarItemControlAccess(ItemControl).ShortCut; + if IsShortCutAcceptible(AShortCut) then + Result := GetKeyTipByShortCut(AShortCut) + else + begin + ACaption := ItemControl.Item.Caption; + AnAccelPos := GetAccelPos(ACaption); + if AnAccelPos <> 0 then + Result := AnsiUpperCase(ACaption[AnAccelPos]) + else + Result := 'Y'; + end; +end; + +procedure TdxBarItemControlAccessibilityHelper.GetKeyTipInfo(out AKeyTipInfo: TdxBarKeyTipInfo); +begin + inherited GetKeyTipInfo(AKeyTipInfo); + if Visible then + begin + TCustomdxBarControlAccessibilityHelper(Parent).GetItemControlKeyTipPosition( + ItemControl, AKeyTipInfo.BasePoint, AKeyTipInfo.HorzAlign, AKeyTipInfo.VertAlign); + end + else + AKeyTipInfo.OnExecute := InvisibleKeyTipHandler; + AKeyTipInfo.Enabled := ItemControl.Enabled; +end; + +function TdxBarItemControlAccessibilityHelper.NeedsVisibilityForKeyTipHandling: Boolean; +begin + Result := False; +end; + +function TdxBarItemControlAccessibilityHelper.GetItemControl: TdxBarItemControl; +begin + Result := TdxBarItemControl(FOwnerObject); +end; + +procedure TdxBarItemControlAccessibilityHelper.InvisibleKeyTipHandler( + Sender: TObject); +var + AExpandedBarControlObject: TCustomdxBarControlAccessibilityHelper; + AIndex: Integer; +begin + if NeedsVisibilityForKeyTipHandling then + begin + AExpandedBarControlObject := TCustomdxBarControlAccessibilityHelper(Parent).Expand; + AIndex := ItemControl.Parent.ViewInfo.GetItemControlIndex(ItemControl); + TdxBarItemControlAccessibilityHelper(AExpandedBarControlObject.BarControl.ViewInfo.ItemControlViewInfos[AIndex].Control.IAccessibilityHelper.GetHelper).KeyTipHandler(Sender); + end + else + KeyTipHandler(Sender); +end; + +{ TdxBarButtonLikeControlAccessibilityHelper } + +procedure TdxBarButtonLikeControlAccessibilityHelper.DoClick; +var + AItem: TdxBarItem; + APrevUnclickAfterDoing: Boolean; +begin + BarNavigationController.StopKeyboardHandling; + AItem := ItemControl.Item; + APrevUnclickAfterDoing := AItem.UnclickAfterDoing; + try + AItem.UnclickAfterDoing := False; + TdxBarItemControlAccess(ItemControl).ControlUnclick(False); + finally + AItem.UnclickAfterDoing := APrevUnclickAfterDoing; + end; +end; + +procedure TdxBarButtonLikeControlAccessibilityHelper.DoDropDown; +begin + BarNavigationController.ChangeSelectedObject(True, ItemControl.IAccessibilityHelper); + if ShowDropDownWindow then + begin + BarNavigationController.SetKeyTipsShowingState( + nil, ''); + BarNavigationController.SetKeyTipsShowingState( + ActiveBarControl.IAccessibilityHelper, ''); + end; +end; + +function TdxBarButtonLikeControlAccessibilityHelper.IsDropDownControl: Boolean; +begin + Result := False; +end; + +procedure TdxBarButtonLikeControlAccessibilityHelper.KeyTipHandler(Sender: TObject); +begin + if IsDropDownControl then + DoDropDown + else + DoClick; +end; + +function TdxBarButtonLikeControlAccessibilityHelper.NeedsVisibilityForKeyTipHandling: Boolean; +begin + Result := IsDropDownControl; +end; + +function TdxBarButtonLikeControlAccessibilityHelper.GetItemControl: TdxBarButtonLikeControl; +begin + Result := TdxBarButtonLikeControl(FOwnerObject); +end; + +{ TdxBarButtonControlAccessibilityHelper } + +//procedure TdxBarButtonControlAccessibilityHelper.DoDefaultAction( +// AChildID: TcxAccessibleSimpleChildElementID); +//begin +// ButtonControl.Item.Click; +//end; +// +//function TdxBarButtonControlAccessibilityHelper.GetDefaultActionDescription( +// AChildID: TcxAccessibleSimpleChildElementID): string; +//begin +// Result := cxGetResourceString(@dxSBAR_BUTTONDEFAULTACTIONDESCRIPTION); +//end; +// +//function TdxBarButtonControlAccessibilityHelper.GetRole( +// AChildID: TcxAccessibleSimpleChildElementID): Integer; +//begin +// Result := cxROLE_SYSTEM_PUSHBUTTON; +//end; +// +//function TdxBarButtonControlAccessibilityHelper.GetState( +// AChildID: TcxAccessibleSimpleChildElementID): Integer; +//begin +// Result := cxSTATE_SYSTEM_NORMAL; +//end; +// +//function TdxBarButtonControlAccessibilityHelper.GetSupportedProperties( +// AChildID: TcxAccessibleSimpleChildElementID): TcxAccessibleObjectProperties; +//begin +// Result := inherited GetSupportedProperties(AChildID); +// if ButtonControl.Item.Enabled then +// Include(Result, aopDefaultAction); +//end; + +function TdxBarButtonControlAccessibilityHelper.IsDropDownControl: Boolean; +begin + Result := ItemControl.ButtonItem.ButtonStyle in [bsDropDown, bsCheckedDropDown]; +end; + +function TdxBarButtonControlAccessibilityHelper.ShowDropDownWindow: Boolean; +begin + TdxBarButtonControlAccess(ItemControl).DoDropDown(False); + Result := ItemControl.IsDroppedDown; +end; + +function TdxBarButtonControlAccessibilityHelper.GetItemControl: TdxBarButtonControl; +begin + Result := TdxBarButtonControl(FOwnerObject); +end; + +{ TdxBarSubItemControlAccessibilityHelper } + +function TdxBarSubItemControlAccessibilityHelper.IsDropDownControl: Boolean; +begin + Result := True; +end; + +function TdxBarSubItemControlAccessibilityHelper.ShowDropDownWindow: Boolean; +begin + TdxBarSubItemControlAccess(ItemControl).DropDown(True); + Result := ItemControl.IsDroppedDown; +end; + +{ TdxBarWinControlAccessibilityHelper } + +procedure TdxBarWinControlAccessibilityHelper.KeyTipHandler( + Sender: TObject); +begin + BarNavigationController.StopKeyboardHandling; + BarNavigationController.ChangeSelectedObject(True, Self); +end; + +function TdxBarWinControlAccessibilityHelper.NeedsVisibilityForKeyTipHandling: Boolean; +begin + Result := True; +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBarAddGroupItemsEd.dfm b/official/x.35/ExpressBars 6/Sources/dxBarAddGroupItemsEd.dfm new file mode 100644 index 00000000..3795a17c --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarAddGroupItemsEd.dfm @@ -0,0 +1,96 @@ +object frmAddGroupItems: TfrmAddGroupItems + Left = 209 + Top = 107 + Width = 364 + Height = 400 + Caption = 'Add Group Items' + Color = clBtnFace + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object Panel2: TPanel + Left = 0 + Top = 5 + Width = 5 + Height = 334 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + end + object Panel3: TPanel + Left = 351 + Top = 5 + Width = 5 + Height = 334 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + end + object Panel4: TPanel + Left = 0 + Top = 0 + Width = 356 + Height = 5 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + end + object lbGroupItems: TListBox + Left = 5 + Top = 5 + Width = 346 + Height = 334 + Align = alClient + ItemHeight = 16 + MultiSelect = True + Style = lbOwnerDrawVariable + TabOrder = 3 + OnDrawItem = lbGroupItemsDrawItem + OnMeasureItem = lbGroupItemsMeasureItem + end + object Panel1: TPanel + Left = 0 + Top = 339 + Width = 356 + Height = 34 + Align = alBottom + BevelOuter = bvNone + TabOrder = 4 + object Panel5: TPanel + Left = 191 + Top = 0 + Width = 165 + Height = 34 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btnOk: TButton + Left = 0 + Top = 7 + Width = 76 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object btnCancel: TButton + Left = 84 + Top = 7 + Width = 76 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + end + end +end diff --git a/official/x.35/ExpressBars 6/Sources/dxBarAddGroupItemsEd.pas b/official/x.35/ExpressBars 6/Sources/dxBarAddGroupItemsEd.pas new file mode 100644 index 00000000..ade228c0 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarAddGroupItemsEd.pas @@ -0,0 +1,239 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars choose group item form } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarAddGroupItemsEd; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + ComCtrls, ExtCtrls, StdCtrls, dxCommon, dxBar, cxGraphics; + +type + TfrmAddGroupItems = class(TForm) + Panel2: TPanel; + Panel3: TPanel; + Panel4: TPanel; + lbGroupItems: TListBox; + Panel1: TPanel; + Panel5: TPanel; + btnOk: TButton; + btnCancel: TButton; + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + procedure lbGroupItemsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure lbGroupItemsMeasureItem(Control: TWinControl; Index: Integer; + var Height: Integer); + private + FGroup: TdxBarGroup; + PrevListBoxWndProc: TWndMethod; + procedure SetGroup(Value: TdxBarGroup); + procedure ListBoxWndProc(var Message: TMessage); + public + GroupItems: TList; + property Group: TdxBarGroup read FGroup write SetGroup; + end; + +function dxBarChooseGroupItem(AGroup: TdxBarGroup; AGroupItems: TList): Boolean; + +implementation + +{$R *.DFM} + +function dxBarChooseGroupItem(AGroup: TdxBarGroup; AGroupItems: TList): Boolean; +begin + with TfrmAddGroupItems.Create(nil) do + try + Group := AGroup; + GroupItems := AGroupItems; + Result := ShowModal = mrOk; + finally + Free; + end; +end; + +procedure TfrmAddGroupItems.FormCreate(Sender: TObject); +begin + with lbGroupItems do + begin + SetClassLong(Handle, GCL_STYLE, GetClassLong(Handle, GCL_STYLE) or CS_HREDRAW); + PrevListBoxWndProc := WindowProc; + WindowProc := ListBoxWndProc; + end; +end; + +procedure TfrmAddGroupItems.FormDestroy(Sender: TObject); +begin + with lbGroupItems do + WindowProc := PrevListBoxWndProc; +end; + +procedure TfrmAddGroupItems.FormCloseQuery(Sender: TObject; + var CanClose: Boolean); +var + I: Integer; +begin + if ModalResult = mrOK then + with lbGroupItems, Items do + for I := 0 to Count - 1 do + if Selected[I] then + GroupItems.Add(Objects[I]); +end; + +procedure TfrmAddGroupItems.lbGroupItemsDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +var + S: string; + Item: TdxBarComponent; + R: TRect; + LineColor: COLORREF; +begin + with TListBox(Control), Canvas do + begin + S := Items[Index]; + if (Length(S) <> 0) and (S[1] = '~') then + begin + Delete(S, 1, 1); + Font.Color := clBtnText; + Brush.Color := clBtnFace; + with Rect do + cxExtTextOut(Handle, S, Point(Left + 2, Top + 1), Rect, ETO_OPAQUE); + end + else + begin + Item := TdxBarComponent(Items.Objects[Index]); + S := ' ' + S; + R := Rect; + if Item is TdxBarItem then + with R do + Right := (Left + Right) div 2 - 1; + if Group.IndexOf(Item) <> -1 then + begin + Font.Color := clBtnFace; + Brush.Color := clWindow; + end; + FillRect(R); + SetBkMode(Handle, TRANSPARENT); + cxDrawText(Handle, S, R, DT_SINGLELINE or DT_VCENTER); + SetBkMode(Handle, OPAQUE); + + if Item is TdxBarItem then + begin + R.Left := R.Right; + Inc(R.Right); + if Brush.Color = clHighlight then + LineColor := COLOR_HIGHLIGHTTEXT + else + LineColor := COLOR_WINDOWTEXT; + Windows.FillRect(Handle, R, LineColor + 1); + + R.Left := R.Right; + R.Right := Rect.Right; + S := Item.Name; + with R do + cxExtTextOut(Handle, S, Point(Left + 2, Top + 1), R, ETO_OPAQUE); + end; + end; + if Index = Items.Count - 1 then + begin + Rect.Top := Rect.Bottom; + Rect.Bottom := ClientHeight; + Windows.FillRect(Handle, Rect, COLOR_BTNFACE + 1); + end; + end; +end; + +procedure TfrmAddGroupItems.lbGroupItemsMeasureItem(Control: TWinControl; + Index: Integer; var Height: Integer); +begin + with TListBox(Control) do + Canvas.Font := Font; + Height := TListBox(Control).Canvas.TextHeight('Qq') + 2; +end; + +procedure TfrmAddGroupItems.SetGroup(Value: TdxBarGroup); +var + List: TList; + I, J: Integer; +begin + FGroup := Value; + Font := FGroup.BarManager.Font; + with lbGroupItems.Items do + begin + List := TList.Create; + BeginUpdate; + try + if Group.BarManager.GroupCount > 1 then + begin + Add('~< Groups >'); + with Group.BarManager do + for I := 0 to GroupCount - 1 do + if Groups[I] <> Group then + AddObject(Groups[I].Name, Groups[I]); + end; + for I := 0 to Group.BarManager.Categories.Count - 1 do + begin + J := Group.BarManager.GetItemsByCategory(I, List); + if J <> 0 then + begin + Add('~' + Group.BarManager.Categories[I]); + for J := 0 to J - 1 do + with TdxBarItem(List[J]) do + AddObject(Caption, List[J]); + end; + end; + finally + EndUpdate; + List.Free; + end; + end; +end; + +procedure TfrmAddGroupItems.ListBoxWndProc(var Message: TMessage); +begin + with Message do + if Msg = WM_ERASEBKGND then + begin + Result := 1; + Exit; + end; + PrevListBoxWndProc(Message); +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBarCommon.pas b/official/x.35/ExpressBars 6/Sources/dxBarCommon.pas new file mode 100644 index 00000000..27c5ab81 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarCommon.pas @@ -0,0 +1,222 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars common } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarCommon; + +{$I cxVer.inc} + +interface + +uses + Windows, dxCommon, dxBar; + +procedure DrawCloseButton(DC: HDC; var ARect: TRect; Selected, Pressed, Flat: Boolean; + ACorner: TdxCorner); + +procedure dxBarPopupNCCalcSize(Handle: HWND; var ARect: TRect; + var Corner: TdxCorner; Combo: TdxBarItem; AllowResizing: Boolean); // obsolete +procedure dxBarPopupNCPaint(Handle: HWND; AllowResizing, Flat, + MouseAboveCloseButton, CloseButtonIsTracking: Boolean; + var CloseButtonRect, GripRect: TRect; Corner: TdxCorner); + +implementation + +uses + Classes; + +// TODO: !!! use PainterClass +// dxDropDownNCHeight ? + +procedure DrawCloseButton(DC: HDC; var ARect: TRect; Selected, Pressed, Flat: Boolean; + ACorner: TdxCorner); +const + Borders: array[Boolean] of Longint = (BDR_RAISEDINNER, BDR_SUNKENOUTER); + States: array[Boolean] of Longint = (0, DFCS_PUSHED); +var + Delta, SX, SY: Integer; + Rgn1, Rgn2: HRGN; + ClipRgnExists: Boolean; +begin + SX := GetSystemMetrics(SM_CXSIZE); + Delta := 1;//Byte(SX = 18); + SY := GetSystemMetrics(SM_CXSIZE) + Delta; + with ARect do + begin + if ACorner in [coTopRight, coBottomRight] then + Right := Left + SX + else + Left := Right - SX; + Top := (Top + Bottom - SY) div 2; + if ACorner in [coBottomLeft, coBottomRight] then Inc(Top, Delta); + Bottom := Top + SY; + end; + InflateRect(ARect, -1, -2); + if Selected and not Flat then + DrawEdge(DC, ARect, Borders[Pressed], BF_RECT) + else + FrameRect(DC, ARect, GetSysColorBrush(COLOR_BTNFACE)); + InflateRect(ARect, -1, -1); + FrameRect(DC, ARect, GetSysColorBrush(COLOR_BTNFACE)); + + Rgn1 := CreateRectRgn(0, 0, 0, 0); + ClipRgnExists := GetClipRgn(DC, Rgn1) = 1; + with ARect do + Rgn2 := CreateRectRgn(Left + 1, Top + 1, Right - 1, Bottom - 1); + SelectClipRgn(DC, Rgn2); + DeleteObject(Rgn2); + InflateRect(ARect, 1, 1); + if SX <> 22 then Inc(ARect.Top, Delta); + DrawFrameControl(DC, ARect, DFC_CAPTION, + DFCS_CAPTIONCLOSE or DFCS_FLAT or States[Pressed and not Flat]); + if SX <> 22 then Dec(ARect.Top, Delta); + if ClipRgnExists then + SelectClipRgn(DC, Rgn1) + else + SelectClipRgn(DC, 0); + DeleteObject(Rgn1); +end; + +{ +TODO:? +function dxBarDropDownNCHeight: Integer; +begin + Result := dxDropDownNCHeight; +end;} + +procedure dxBarPopupNCCalcSize(Handle: HWND; var ARect: TRect; + var Corner: TdxCorner; Combo: TdxBarItem; AllowResizing: Boolean); // obsolete +var + R: TRect; + AControl: TdxBarWinControl; +begin + InflateRect(ARect, -1, -1); + if AllowResizing and + (Combo.CurItemLink <> nil) and (Combo.CurItemLink.Control <> nil) then + begin + GetWindowRect(Handle, R); + AControl := TdxBarWinControl(Combo.CurItemLink.Control); + MapWindowPoints(0, AControl.Parent.Handle, R, 2); + Corner := GetCornerForRects(AControl.WindowRect, R); + with ARect do + if Corner in [coBottomLeft, coBottomRight] then + Dec(Bottom, dxDropDownNCHeight) + else + Inc(Top, dxDropDownNCHeight); + end; +end; + +procedure dxBarPopupNCPaint(Handle: HWND; AllowResizing, Flat, + MouseAboveCloseButton, CloseButtonIsTracking: Boolean; + var CloseButtonRect, GripRect: TRect; Corner: TdxCorner); +var + R, CR: TRect; + B: Integer; + BorderBrush: HBRUSH; + DC: HDC; + AStyle: Longint; +begin + DC := GetWindowDC(Handle); + try + GetWindowRect(Handle, R); + CloseButtonRect := R; + GripRect := R; + GetClientRect(Handle, CR); + MapWindowPoints(0, Handle, R, 2); + B := -R.Left; + OffsetRect(CR, -R.Left, -R.Top); + OffsetRect(R, -R.Left, -R.Top); + + if Flat then + BorderBrush := GetSysColorBrush(COLOR_BTNSHADOW) + else + BorderBrush := GetSysColorBrush(COLOR_WINDOWFRAME); + FrameRect(DC, R, BorderBrush); + + if not AllowResizing then + begin + SetRectEmpty(CloseButtonRect); + SetRectEmpty(GripRect); + Exit; + end; + + InflateRect(R, -B, -B); + if Corner in [coBottomLeft, coBottomRight] then + begin + R.Top := R.Bottom - dxDropDownNCHeight + 1; + FillRect(DC, Rect(R.Left, R.Top - 1, R.Right, R.Top), BorderBrush); + end + else + begin + R.Bottom := R.Top + dxDropDownNCHeight - 1; + FillRect(DC, Rect(R.Left, R.Bottom, R.Right, R.Bottom + 1), BorderBrush); + end; + + CR := R; + DrawSizeGrip(DC, CR, Corner); + with CR do + ExcludeClipRect(DC, Left, Top, Right, Bottom); + InflateRect(CR, 2, 2); + if CR.Top < R.Top then CR.Top := R.Top; + if CR.Bottom > R.Bottom then CR.Bottom := R.Bottom; + OffsetRect(CR, GripRect.Left, GripRect.Top); + GripRect := CR; + + CR := R; + DrawCloseButton(DC, CR, MouseAboveCloseButton or CloseButtonIsTracking, + MouseAboveCloseButton and CloseButtonIsTracking, Flat, Corner); + with CR do + ExcludeClipRect(DC, Left, Top, Right, Bottom); + with CloseButtonRect do OffsetRect(CR, Left, Top); + CloseButtonRect := CR; + + FillRect(DC, R, COLOR_BTNFACE + 1); + if Corner in [coBottomLeft, coBottomRight] then + begin + AStyle := GetWindowLong(Handle, GWL_STYLE); + if (AStyle and WS_HSCROLL <> 0) and (AStyle and WS_VSCROLL <> 0) then + with R do + begin + Left := Right - GetSystemMetrics(SM_CXVSCROLL); + Bottom := Top - 1; + Top := Bottom - GetSystemMetrics(SM_CYHSCROLL); + FillRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + end; + end; + finally + ReleaseDC(Handle, DC); + end; +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBarConverter.dcr b/official/x.35/ExpressBars 6/Sources/dxBarConverter.dcr new file mode 100644 index 00000000..07d83994 Binary files /dev/null and b/official/x.35/ExpressBars 6/Sources/dxBarConverter.dcr differ diff --git a/official/x.35/ExpressBars 6/Sources/dxBarConverter.pas b/official/x.35/ExpressBars 6/Sources/dxBarConverter.pas new file mode 100644 index 00000000..e51b9b5a --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarConverter.pas @@ -0,0 +1,285 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars converter component } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarConverter; + +{$I cxVer.inc} + +interface + +uses + Classes, Menus,{$IFDEF DELPHI6} DesignIntf, DesignEditors,{$ELSE} DsgnIntf,{$ENDIF} dxBar; + +type + TCurDesigner = + {$IFDEF DELPHI6}IDesigner{$ELSE}{$IFDEF DELPHI4}IFormDesigner{$ELSE}TFormDesigner{$ENDIF}{$ENDIF}; + + TdxBarConverter = class(TComponent) + private + FBarManager: TdxBarManager; + FConverting: Boolean; + FExecute: Boolean; + FMenu: TMenu; + protected + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + public + procedure Convert(ADesigner: TCurDesigner); + published + property BarManager: TdxBarManager read FBarManager write FBarManager; + property Menu: TMenu read FMenu write FMenu; + property Execute: Boolean read FExecute write FExecute; + end; + +procedure Register; + +implementation + +uses + SysUtils, Controls, Forms, dxBarCustForm; + +procedure TdxBarConverter.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if Operation = opRemove then + begin + if AComponent = FBarManager then BarManager := nil; + if AComponent = FMenu then Menu := nil; + end; +end; + +procedure TdxBarConverter.Convert(ADesigner: TCurDesigner); +var + AOwner: TWinControl; + ACategoryName, APopupMenuName: string; + ACategory: Integer; + APopupMenu: TdxBarPopupMenu; + AItemLinks: TdxBarItemLinks; + + function FindItem(const ACaption: string; AOnClick: Pointer): TdxBarItem; + var + I: Integer; + begin + Result := nil; + with BarManager do + for I := 0 to ItemCount - 1 do + with Items[I] do + if (Items[I] is TdxBarButton) and + (Caption = ACaption) and (@OnClick = AOnClick) then + begin + Result := Items[I]; + Break; + end; + end; + + function ConvertItem(AMenuItem: TMenuItem; ACategory: Integer; CreateCategory: Boolean): TdxBarItem; + var + AItem, AChildItem: TdxBarItem; + AItemLink: TdxBarItemLink; + ABeginGroup: Boolean; + AMenuItemName: string; + begin + if AMenuItem.Parent = nil then AItem := nil + else + begin + if AMenuItem.Count > 0 then AItem := TdxBarSubItem.Create(AOwner) + else + begin + AItem := FindItem(AMenuItem.Caption, @AMenuItem.OnClick); + if AItem <> nil then + begin + AMenuItem.Free; + Result := AItem; + Exit; + end; + AItem := TdxBarButton.Create(AOwner); + end; + AItem.Category := ACategory; + end; + + with AMenuItem do + begin + if Parent <> nil then + begin + {$IFDEF DELPHI4} + AItem.Action := Action; + AItem.ImageIndex := ImageIndex; + {$ENDIF} + AItem.Caption := Caption; + AItem.Enabled := Enabled; + AItem.HelpContext := HelpContext; + AItem.Hint := Hint; + AItem.ShortCut := ShortCut; + AItem.Tag := Tag; + AItem.OnClick := OnClick; + if AItem is TdxBarButton then + with TdxBarButton(AItem) do + begin + if Checked or RadioItem then ButtonStyle := bsChecked; + if RadioItem then GroupIndex := AMenuItem.GroupIndex; + Down := Checked; + end; + + if (Count > 0) and CreateCategory then + with BarManager.Categories do + begin + ACategoryName := GetTextOf(Caption); + if IndexOf(ACategoryName) < 0 then Add(ACategoryName); + ACategory := IndexOf(ACategoryName); + end; + end; + + ABeginGroup := False; + while Count > 0 do + if Items[0].Caption = '-' then + begin + ABeginGroup := True; + Items[0].Free; + end + else + begin + AChildItem := ConvertItem(Items[0], ACategory, + (Parent = nil) and (Menu is TMainMenu)); + if Parent = nil then AItemLink := AItemLinks.Add + else + AItemLink := TdxBarSubItem(AItem).ItemLinks.Add; + AItemLink.Item := AChildItem; + if ABeginGroup then + begin + AItemLink.BeginGroup := True; + ABeginGroup := False; + end; + end; + end; + + with AMenuItem do + begin + AMenuItemName := Name; + if Parent <> nil then Free; + end; + if AItem <> nil then AItem.Name := AMenuItemName; + + Result := AItem; + end; + +begin + if FConverting or not (csDesigning in ComponentState) or (BarManager = nil) or + ((dxBarCustomizingForm <> nil) and (dxBarCustomizingForm.BarManager = BarManager)) or + (Menu = nil) or (Menu.Items.Count = 0) then Exit; + Screen.Cursor := crHourGlass; + FConverting := True; + try + AOwner := BarManager.Owner; + if Menu is TMainMenu then + begin + ACategoryName := 'Menus'; + APopupMenu := nil; + if BarManager.MainMenuBar = nil then + with BarManager.Bars.Add do + begin + Caption := 'Main Menu'; + DockingStyle := dsTop; + IsMainMenu := True; + Visible := True; + end; + AItemLinks := BarManager.MainMenuBar.ItemLinks; + end + else + begin + APopupMenuName := Menu.Name; + ACategoryName := APopupMenuName; + with ADesigner, LongRec(Self.Menu.DesignInfo) do + APopupMenu := TdxBarPopupMenu(CreateComponent(TdxBarPopupMenu, AOwner, Lo, Hi, 1, 1)); + APopupMenu.OnPopup := TPopupMenu(Menu).OnPopup; + AItemLinks := APopupMenu.ItemLinks; + end; + {$IFDEF DELPHI4} + if BarManager.Images = nil then BarManager.Images := Menu.Images; + {$ENDIF} + with BarManager.Categories do + begin + if IndexOf(ACategoryName) < 0 then Add(ACategoryName); + ACategory := IndexOf(ACategoryName); + end; + + if Menu is TMainMenu then + BarManager.BeginUpdate; + try + ConvertItem(Menu.Items, ACategory, False); + finally + if Menu is TMainMenu then + BarManager.EndUpdate; + end; + + Menu.Free; + with BarManager.Categories do + Move(ACategory, Count - 1); + if APopupMenu <> nil then APopupMenu.Name := APopupMenuName; + finally + FConverting := False; + Screen.Cursor := crDefault; + end; +end; + +type + TdxConverterExecutePropertyEditor = class(TPropertyEditor) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + end; + +procedure TdxConverterExecutePropertyEditor.Edit; +begin + TdxBarConverter(GetComponent(0)).Convert(Designer); +end; + +function TdxConverterExecutePropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paDialog, paReadOnly]; +end; + +function TdxConverterExecutePropertyEditor.GetValue: string; +begin + Result := 'Press to Convert'; +end; + +procedure Register; +begin + RegisterComponents('ExpressBars', [TdxBarConverter]); + RegisterPropertyEditor(TypeInfo(Boolean), TdxBarConverter, 'Execute', + TdxConverterExecutePropertyEditor); +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBarCustForm.dfm b/official/x.35/ExpressBars 6/Sources/dxBarCustForm.dfm new file mode 100644 index 00000000..bcc641ea --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarCustForm.dfm @@ -0,0 +1,1420 @@ +object dxBarCustomizingForm: TdxBarCustomizingForm + Left = 707 + Top = 171 + BorderIcons = [biSystemMenu] + Caption = 'Customize' + ClientHeight = 310 + ClientWidth = 366 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + OnClose = FormClose + OnCreate = FormCreate + OnDestroy = FormDestroy + OnHide = FormHide + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 0 + Top = 274 + Width = 366 + Height = 36 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object BClose: TButton + Left = 285 + Top = 8 + Width = 75 + Height = 23 + Cancel = True + Caption = 'Close' + Default = True + ModalResult = 1 + TabOrder = 1 + OnClick = BCloseClick + end + object BHelp: TBitBtn + Left = 6 + Top = 8 + Width = 24 + Height = 23 + TabOrder = 0 + OnClick = BHelpClick + Style = bsNew + end + end + object PageControl: TPageControl + Left = 6 + Top = 8 + Width = 354 + Height = 266 + ActivePage = tsToolbars + Align = alClient + TabOrder = 0 + object tsToolbars: TTabSheet + Caption = ' Toolbars ' + object LabelToobars: TLabel + Left = 4 + Top = 4 + Width = 44 + Height = 13 + Caption = 'Toolb&ars:' + end + object BBarDelete: TButton + Left = 239 + Top = 79 + Width = 104 + Height = 22 + Action = aDeleteToolBar + TabOrder = 3 + end + object BBarNew: TButton + Left = 239 + Top = 21 + Width = 104 + Height = 22 + Action = aNewToolBar + TabOrder = 1 + end + object BBarRename: TButton + Left = 239 + Top = 50 + Width = 104 + Height = 22 + Action = aRenameToolBar + TabOrder = 2 + end + object lbBarsList: TListBox + Left = 4 + Top = 20 + Width = 227 + Height = 213 + Style = lbOwnerDrawFixed + Anchors = [akLeft, akTop, akBottom] + ItemHeight = 13 + TabOrder = 0 + OnClick = lbBarsListClick + OnDblClick = lbBarsListDblClick + OnDrawItem = lbBarsListDrawItem + OnKeyDown = lbBarsListKeyDown + OnMouseDown = lbBarsListMouseDown + end + object BBarReset: TButton + Left = 239 + Top = 108 + Width = 104 + Height = 22 + Action = aResetToolBar + TabOrder = 4 + end + end + object tsItems: TTabSheet + Caption = ' Commands ' + object Panel6: TPanel + Left = 0 + Top = 0 + Width = 346 + Height = 25 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object LabelCategories: TLabel + Left = 6 + Top = 8 + Width = 53 + Height = 13 + Caption = 'Cate&gories:' + FocusControl = lbCategories + end + object LabelCommands: TLabel + Left = 148 + Top = 8 + Width = 55 + Height = 13 + Caption = 'Comman&ds:' + end + object CategoriesPopupButtonPlace: TSpeedButton + Left = 65 + Top = 6 + Width = 75 + Height = 17 + end + object CommandsPopupButtonPlace: TSpeedButton + Left = 207 + Top = 6 + Width = 134 + Height = 17 + end + end + object Panel7: TPanel + Left = 5 + Top = 25 + Width = 336 + Height = 213 + Align = alClient + BevelOuter = bvNone + Caption = 'Panel7' + TabOrder = 1 + object lbCategories: TListBox + Left = 0 + Top = 0 + Width = 135 + Height = 147 + Align = alLeft + ItemHeight = 13 + TabOrder = 0 + OnClick = lbCategoriesClick + OnDragOver = lbCategoriesDragOver + OnEndDrag = lbCategoriesEndDrag + OnKeyDown = lbCategoriesKeyDown + OnMouseDown = lbCategoriesMouseDown + end + object lbItems: TListBox + Left = 142 + Top = 0 + Width = 194 + Height = 147 + Style = lbOwnerDrawFixed + Align = alRight + Color = clBtnFace + ItemHeight = 22 + TabOrder = 1 + OnClick = lbItemsClick + OnDblClick = lbItemsDblClick + OnDrawItem = lbItemsDrawItem + OnKeyDown = lbItemsKeyDown + OnMeasureItem = lbItemsMeasureItem + OnMouseDown = lbItemsMouseDown + OnMouseUp = lbItemsMouseUp + end + object Panel9: TPanel + Left = 0 + Top = 147 + Width = 336 + Height = 66 + Align = alBottom + BevelOuter = bvNone + TabOrder = 2 + object DescriptionLabel: TLabel + Left = 0 + Top = 20 + Width = 335 + Height = 40 + AutoSize = False + WordWrap = True + end + object Bevel1: TBevel + Left = 0 + Top = 10 + Width = 337 + Height = 5 + Shape = bsTopLine + end + object LabelDescription: TLabel + Left = 0 + Top = 4 + Width = 59 + Height = 13 + Caption = 'Description ' + end + end + end + object Panel5: TPanel + Left = 0 + Top = 25 + Width = 5 + Height = 213 + Align = alLeft + BevelOuter = bvNone + TabOrder = 2 + end + object Panel8: TPanel + Left = 341 + Top = 25 + Width = 5 + Height = 213 + Align = alRight + BevelOuter = bvNone + TabOrder = 3 + end + end + object tsOptions: TTabSheet + Caption = ' Options ' + object StandardOptionsPanel: TPanel + Left = 0 + Top = 0 + Width = 346 + Height = 238 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object LabelMenuAnimations: TLabel + Left = 24 + Top = 152 + Width = 83 + Height = 13 + Caption = '&Menu animations:' + FocusControl = ComboBoxMenuAnimations + end + object ComboBoxMenuAnimations: TComboBox + Left = 134 + Top = 148 + Width = 93 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 3 + OnClick = ComboBoxMenuAnimationsClick + Items.Strings = ( + '(None)' + 'Random' + 'Unfold' + 'Slide') + end + object CBHint1: TCheckBox + Left = 24 + Top = 63 + Width = 301 + Height = 17 + Caption = 'Show Tool&Tips on toolbars' + TabOrder = 1 + OnClick = CBHint1Click + end + object CBHint2: TCheckBox + Left = 24 + Top = 85 + Width = 301 + Height = 17 + Caption = 'Show s&hortcut keys in ToolTips' + TabOrder = 2 + OnClick = CBHint2Click + end + object CBLargeIcons: TCheckBox + Left = 24 + Top = 38 + Width = 301 + Height = 17 + Caption = '&Large icons' + TabOrder = 0 + OnClick = CBLargeIconsClick + end + end + object EnhancedOptionsPanel: TPanel + Left = 0 + Top = 0 + Width = 346 + Height = 238 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + object Label1: TLabel + Left = 20 + Top = 200 + Width = 83 + Height = 13 + Caption = '&Menu animations:' + FocusControl = ComboBoxMenuAnimationsEx + end + object Bevel2: TBevel + Left = 12 + Top = 122 + Width = 317 + Height = 9 + Shape = bsTopLine + end + object Label2: TLabel + Left = 12 + Top = 116 + Width = 32 + Height = 13 + Caption = 'Other ' + end + object Bevel3: TBevel + Left = 12 + Top = 18 + Width = 317 + Height = 7 + Shape = bsTopLine + end + object Label3: TLabel + Left = 12 + Top = 12 + Width = 166 + Height = 13 + Caption = 'Personalized Menus and Toolbars ' + end + object ComboBoxMenuAnimationsEx: TComboBox + Left = 132 + Top = 196 + Width = 93 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 6 + OnClick = ComboBoxMenuAnimationsClick + Items.Strings = ( + '(None)' + 'Random' + 'Unfold' + 'Slide') + end + object CBHint1Ex: TCheckBox + Left = 20 + Top = 152 + Width = 309 + Height = 17 + Caption = 'Show Tool&Tips on toolbars' + TabOrder = 4 + OnClick = CBHint1ExClick + end + object CBHint2Ex: TCheckBox + Left = 36 + Top = 172 + Width = 293 + Height = 17 + Caption = 'Show s&hortcut keys in ToolTips' + TabOrder = 5 + OnClick = CBHint2Click + end + object CBLargeIconsEx: TCheckBox + Left = 20 + Top = 132 + Width = 309 + Height = 17 + Caption = '&Large icons' + TabOrder = 3 + OnClick = CBLargeIconsClick + end + object CBMenusShowRecentItemsFirst: TCheckBox + Left = 20 + Top = 32 + Width = 309 + Height = 17 + Caption = 'Me&nus show recently used commands first' + TabOrder = 0 + OnClick = CBMenusShowRecentItemsFirstClick + end + object CBShowFullMenusAfterDelay: TCheckBox + Left = 36 + Top = 52 + Width = 293 + Height = 17 + Caption = 'Show f&ull menus after a short delay' + TabOrder = 1 + OnClick = CBShowFullMenusAfterDelayClick + end + object BResetUsageData: TButton + Left = 20 + Top = 76 + Width = 119 + Height = 22 + Caption = '&Reset my usage data' + TabOrder = 2 + OnClick = BResetUsageDataClick + end + end + end + object tsCommands: TTabSheet + Caption = ' All commands ' + object LAllCommands: TListBox + Left = 6 + Top = 8 + Width = 333 + Height = 200 + Style = lbOwnerDrawFixed + Anchors = [akLeft, akTop, akBottom] + ItemHeight = 16 + MultiSelect = True + TabOrder = 0 + OnClick = LAllCommandsClick + OnDrawItem = LAllCommandsDrawItem + end + object CBShowCommandsWithShortCut: TCheckBox + Left = 6 + Top = 216 + Width = 333 + Height = 17 + Anchors = [akLeft, akBottom] + Caption = 'Show commands that may have a shortcut' + Checked = True + State = cbChecked + TabOrder = 1 + OnClick = CBShowCommandsWithShortCutClick + end + end + object tsGroups: TTabSheet + Caption = 'Groups' + object Bevel4: TBevel + Left = 171 + Top = 0 + Width = 4 + Height = 238 + Align = alLeft + Shape = bsSpacer + end + object gpGroupItems: TGroupBox + Left = 175 + Top = 0 + Width = 171 + Height = 238 + Align = alClient + Caption = ' Items ' + TabOrder = 0 + object lbGroupItems: TListBox + Left = 2 + Top = 44 + Width = 167 + Height = 192 + Style = lbOwnerDrawVariable + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + TabOrder = 0 + OnClick = lbGroupItemsClick + OnDrawItem = lbGroupItemsDrawItem + OnKeyDown = lbGroupItemsKeyDown + OnMeasureItem = lbGroupsMeasureItem + end + object tbGroupItems: TToolBar + Left = 2 + Top = 15 + Width = 167 + Height = 29 + Caption = 'tbGroupItems' + EdgeBorders = [ebBottom] + EdgeOuter = esNone + Flat = True + Images = imgGroups + ParentShowHint = False + ShowHint = True + TabOrder = 1 + object btnAddGroupItem: TToolButton + Left = 0 + Top = 0 + Hint = 'Add Item... (Ins)' + Action = aAddGroupItem + Caption = 'Add...' + end + object btnDeleteGroupItem: TToolButton + Left = 23 + Top = 0 + Hint = 'Delete Item (Del)' + Action = aDeleteGroupItem + end + object ToolButton8: TToolButton + Left = 46 + Top = 0 + Width = 8 + Caption = 'ToolButton8' + ImageIndex = 2 + Style = tbsSeparator + end + object btnMoveUpGroupItem: TToolButton + Left = 54 + Top = 0 + Hint = 'Move Up Item' + Action = aMoveUpGroupItem + Caption = 'Up' + end + object btnMoveDownGroupItem: TToolButton + Left = 77 + Top = 0 + Hint = 'Move Down Item' + Action = aMoveDownGroupItem + Caption = 'Down' + end + end + end + object gbGroups: TGroupBox + Left = 0 + Top = 0 + Width = 171 + Height = 238 + Align = alLeft + Caption = ' Groups ' + TabOrder = 1 + object lbGroups: TListBox + Left = 2 + Top = 44 + Width = 167 + Height = 192 + Style = lbOwnerDrawVariable + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + TabOrder = 0 + OnClick = lbGroupsClick + OnDrawItem = lbGroupsDrawItem + OnKeyDown = lbGroupsKeyDown + OnMeasureItem = lbGroupsMeasureItem + end + object tbGroups: TToolBar + Left = 2 + Top = 15 + Width = 167 + Height = 29 + Caption = 'tbGroups' + EdgeBorders = [ebBottom] + EdgeOuter = esNone + Flat = True + Images = imgGroups + ParentShowHint = False + ShowHint = True + TabOrder = 1 + object btnAddGroup: TToolButton + Left = 0 + Top = 0 + Action = aAddGroup + Caption = 'Add' + end + object btnDeleteGroup: TToolButton + Left = 23 + Top = 0 + Action = aDeleteGroup + Caption = 'Delete' + end + object ToolButton3: TToolButton + Left = 46 + Top = 0 + Width = 8 + Caption = 'ToolButton3' + ImageIndex = 2 + Style = tbsSeparator + end + object btnMoveUpGroup: TToolButton + Left = 54 + Top = 0 + Action = aMoveUpGroup + AllowAllUp = True + Caption = 'Up' + end + object btnMoveDownGroup: TToolButton + Left = 77 + Top = 0 + Action = aMoveDownGroup + Caption = 'Down' + end + end + end + end + object TabSheet1: TTabSheet + Caption = 'Key Tips' + ImageIndex = 5 + TabVisible = False + object tvKeyTips: TTreeView + Left = 11 + Top = 13 + Width = 314 + Height = 204 + Indent = 19 + TabOrder = 0 + end + end + end + object Panel2: TPanel + Left = 0 + Top = 8 + Width = 6 + Height = 266 + Align = alLeft + BevelOuter = bvNone + TabOrder = 2 + end + object Panel3: TPanel + Left = 360 + Top = 8 + Width = 6 + Height = 266 + Align = alRight + BevelOuter = bvNone + TabOrder = 3 + end + object Panel4: TPanel + Left = 0 + Top = 0 + Width = 366 + Height = 8 + Align = alTop + BevelOuter = bvNone + TabOrder = 4 + end + object BarManager1: TdxBarManager + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Categories.Strings = ( + 'Categories' + 'Commands') + Categories.ItemsVisibles = ( + 2 + 2) + Categories.Visibles = ( + True + True) + PopupMenuLinks = <> + StretchGlyphs = False + UseSystemFont = False + Left = 170 + Top = 278 + DockControlHeights = ( + 0 + 0 + 0 + 0) + object CategoriesAdd: TdxBarButton + Caption = 'Add...' + Category = 0 + Hint = 'Add' + Visible = ivAlways + Glyph.Data = { + F6000000424DF600000000000000760000002800000010000000100000000100 + 0400000000008000000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888 + 888888888888888888888800000000000888880FFFFFFFFF0888880FFFFFFFFF + 0888880FFFFFFFFF0888880FFFFFFFFF0888880FFFFFFFFF0888880FFFFFFFFF + 0888880FFFFFFFFF0888880FFFFFFFFF0888880FFFFFF0000888880FFFFFF0F0 + 8888880FFFFFF008888888000000008888888888888888888888} + OnClick = CategoriesAddClick + end + object CategoriesInsert: TdxBarButton + Caption = 'Insert...' + Category = 0 + Hint = 'Insert' + Visible = ivAlways + ShortCut = 45 + OnClick = CategoriesInsertClick + end + object CategoriesRename: TdxBarButton + Caption = 'Rename...' + Category = 0 + Hint = 'Rename' + Visible = ivAlways + OnClick = CategoriesRenameClick + end + object CategoriesVisible: TdxBarButton + Caption = 'Visible' + Category = 0 + Hint = 'Visible' + Visible = ivAlways + ButtonStyle = bsChecked + OnClick = CategoriesVisibleClick + end + object CommandsAdd: TdxBarButton + Caption = 'Add...' + Category = 1 + Hint = 'Add' + Visible = ivAlways + Glyph.Data = { + F6000000424DF600000000000000760000002800000010000000100000000100 + 0400000000008000000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888 + 888888888888888888888800000000000888880FFFFFFFFF0888880FFFFFFFFF + 0888880FFFFFFFFF0888880FFFFFFFFF0888880FFFFFFFFF0888880FFFFFFFFF + 0888880FFFFFFFFF0888880FFFFFFFFF0888880FFFFFF0000888880FFFFFF0F0 + 8888880FFFFFF008888888000000008888888888888888888888} + ShortCut = 45 + OnClick = CommandsAddClick + end + object CommandsDelete: TdxBarButton + Caption = 'Delete' + Category = 1 + Hint = 'Delete' + Visible = ivAlways + Glyph.Data = { + EE000000424DEE000000000000007600000028000000100000000F0000000100 + 0400000000007800000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888 + 888888888888888880F88880F8888888888888000F8888880F8888000F888880 + F888888000F88800F8888888000F800F88888888800000F88888888888000F88 + 88888888800000F888888888000F80F88888880000F88800F88880000F888880 + 0F88800F8888888800F88888888888888888} + ShortCut = 46 + OnClick = CommandsDeleteClick + end + object CommandsClear: TdxBarButton + Caption = 'Clear' + Category = 1 + Hint = 'Clear' + Visible = ivAlways + OnClick = CommandsClearClick + end + object CommandsMoveUp: TdxBarButton + Caption = 'Move Up' + Category = 1 + Hint = 'Move Up' + Visible = ivAlways + Glyph.Data = { + F6000000424DF600000000000000760000002800000010000000100000000100 + 0400000000008000000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888 + 8888888888888888888888888888888888888888800000888888888880666088 + 8888888880666088888888888066608888888800006660000888888066666660 + 8888888806666608888888888066608888888888880608888888888888808888 + 8888888888888888888888888888888888888888888888888888} + ShortCut = 16422 + OnClick = CommandsMoveUpClick + end + object CommandsMoveDown: TdxBarButton + Caption = 'Move Down' + Category = 1 + Hint = 'Move Down' + Visible = ivAlways + Glyph.Data = { + F6000000424DF600000000000000760000002800000010000000100000000100 + 0400000000008000000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888 + 8888888888888888888888888888888888888888888088888888888888060888 + 8888888880666088888888880666660888888880666666608888880000666000 + 0888888880666088888888888066608888888888806660888888888880000088 + 8888888888888888888888888888888888888888888888888888} + ShortCut = 16424 + OnClick = CommandsMoveDownClick + end + object CommandsSubMenuEditor: TdxBarButton + Caption = 'SubMenu Editor...' + Category = 1 + Hint = 'SubMenu Editor' + Visible = ivAlways + OnClick = CommandsSubMenuEditorClick + end + object CategoriesItemsVisible: TdxBarCombo + Caption = 'Items Visible:' + Category = 0 + Hint = 'Items Visible:' + Visible = ivAlways + OnChange = CategoriesItemsVisibleChange + Width = 100 + ShowEditor = False + Items.Strings = ( + 'Never' + 'InCustomizing' + 'Always') + ItemIndex = -1 + end + object CategoriesDelete: TdxBarButton + Caption = 'Delete' + Category = 0 + Hint = 'Delete' + Visible = ivAlways + Glyph.Data = { + EE000000424DEE000000000000007600000028000000100000000F0000000100 + 0400000000007800000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888 + 888888888888888880F88880F8888888888888000F8888880F8888000F888880 + F888888000F88800F8888888000F800F88888888800000F88888888888000F88 + 88888888800000F888888888000F80F88888880000F88800F88880000F888880 + 0F88800F8888888800F88888888888888888} + ShortCut = 46 + OnClick = CategoriesDeleteClick + end + end + object CategoriesPopupMenu: TdxBarPopupMenu + BarManager = BarManager1 + ItemLinks = < + item + Visible = True + ItemName = 'CategoriesAdd' + end + item + Visible = True + ItemName = 'CategoriesInsert' + end + item + Visible = True + ItemName = 'CategoriesRename' + end + item + BeginGroup = True + Visible = True + ItemName = 'CategoriesVisible' + end + item + Visible = True + ItemName = 'CategoriesItemsVisible' + end + item + BeginGroup = True + Visible = True + ItemName = 'CategoriesDelete' + end> + UseOwnFont = False + OnPopup = CategoriesPopupMenuPopup + Left = 204 + Top = 278 + end + object CommandsPopupMenu: TdxBarPopupMenu + BarManager = BarManager1 + ItemLinks = < + item + Visible = True + ItemName = 'CommandsAdd' + end + item + Visible = True + ItemName = 'CommandsDelete' + end + item + Visible = True + ItemName = 'CommandsClear' + end + item + BeginGroup = True + Visible = True + ItemName = 'CommandsMoveUp' + end + item + Visible = True + ItemName = 'CommandsMoveDown' + end + item + BeginGroup = True + Visible = True + ItemName = 'CommandsSubMenuEditor' + end> + UseOwnFont = False + OnPopup = CommandsPopupMenuPopup + Left = 236 + Top = 278 + end + object alCustomize: TActionList + Images = imgGroups + Left = 136 + Top = 280 + object aAddItem: TAction + Category = 'Items' + Caption = 'Add Item' + ImageIndex = 4 + OnExecute = aAddItemExecute + end + object aAddGroup: TAction + Category = 'Groups' + Caption = 'Add Group' + Hint = 'Add Group (Ins)' + ImageIndex = 0 + OnExecute = aAddGroupExecute + end + object aDeleteGroup: TAction + Category = 'Groups' + Caption = 'Delete Group' + Hint = 'Delete Group (Del)' + ImageIndex = 1 + OnExecute = aDeleteGroupExecute + end + object aNewToolBar: TAction + Category = 'ToolBars' + Caption = '&New...' + OnExecute = aNewToolBarExecute + end + object aMoveUpGroup: TAction + Tag = -1 + Category = 'Groups' + Caption = 'Move Up Group' + Hint = 'Move Up Group' + ImageIndex = 2 + OnExecute = aMoveGroupExecute + end + object aRenameToolBar: TAction + Category = 'ToolBars' + Caption = 'R&ename...' + OnExecute = aRenameToolBarExecute + end + object aMoveDownGroup: TAction + Tag = 1 + Category = 'Groups' + Caption = 'Move Down Group' + Hint = 'Move Down Group' + ImageIndex = 3 + OnExecute = aMoveGroupExecute + end + object aDeleteToolBar: TAction + Category = 'ToolBars' + Caption = '&Delete' + OnExecute = aDeleteToolBarExecute + end + object aResetToolBar: TAction + Category = 'ToolBars' + Caption = '&Reset...' + OnExecute = aResetToolBarExecute + end + object aAddGroupItem: TAction + Category = 'GroupItems' + Caption = '&Add...' + ImageIndex = 0 + OnExecute = aAddGroupItemExecute + end + object aDeleteGroupItem: TAction + Category = 'GroupItems' + Caption = 'Delete' + ImageIndex = 1 + OnExecute = aDeleteGroupItemExecute + end + object aMoveUpGroupItem: TAction + Tag = -1 + Category = 'GroupItems' + Caption = 'Move Up Item' + ImageIndex = 2 + OnExecute = aMoveGroupItemExecute + end + object aMoveDownGroupItem: TAction + Tag = 1 + Category = 'GroupItems' + Caption = 'aMoveDownGroupItem' + ImageIndex = 3 + OnExecute = aMoveGroupItemExecute + end + object aDeleteItem: TAction + Category = 'Items' + Caption = 'Delete Item' + ImageIndex = 5 + OnExecute = aDeleteItemExecute + end + object aMoveUpItem: TAction + Tag = -1 + Category = 'Items' + Caption = 'Move Up' + ImageIndex = 2 + OnExecute = aMoveItemExecute + end + object aMoveDownItem: TAction + Tag = 1 + Category = 'Items' + Caption = 'Move Down' + ImageIndex = 3 + OnExecute = aMoveItemExecute + end + object aSubMenuEditor: TAction + Category = 'Items' + Caption = 'SubMenu Editor...' + OnExecute = aSubMenuEditorExecute + end + object aClearItemList: TAction + Category = 'Items' + Caption = 'Clear' + OnExecute = aClearItemListExecute + end + end + object imgGroups: TImageList + Left = 106 + Top = 280 + Bitmap = { + 494C010106000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 0000FFFFFF0000FFFF0000000000808080000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 0000FFFFFF0000FFFF0000000000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000000000C0C0 + C00000000000FFFFFF000000000080808000808080000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000000000C0C0 + C00000000000FFFFFF0000000000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000FF + FF00C0C0C0000000000000000000808080000000800000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000FF + FF00C0C0C0000000000000000000808080000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000808000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000 + 000000000000000000000000000080808000000080000000800000FFFF00FFFF + FF0000FFFF00FFFFFF00808080000000800000FFFF00FFFFFF00000000000000 + 0000000000000000000000000000808080000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000000000FFFFFF008080 + 800000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00000000008080800080808000000080008080800000FF + FF00FFFFFF00808080000000800080808000FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000808080000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080000080800000808000008080000080800000000000000000 + 0000000000000000000000000000000000008080800000FFFF0000FFFF008080 + 8000FFFFFF0000FFFF008080800000FFFF00FFFFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000808080000000000000008000000080008080 + 800000FFFF000000800000008000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000808080000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000808000008080000080800000808000008080000080800000808000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF008080 + 800000FFFF008080800000FFFF00FFFFFF0000FFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000808080000000000080808000000080000000 + 80000000800000008000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000808080000000000000000000000000000000 + 0000808000008080000080800000808000008080000080800000808000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 000000000000000000000000000000000000808080008080800080808000FFFF + FF0080808000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000808080000000000080808000000080000000 + 800000008000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000808080000000000000000000000000000000 + 0000000000008080000080800000808000008080000080800000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000FFFF008080800000FF + FF00FFFFFF008080800080808000808080008080800000000000000000000000 + 0000000000000000000000000000000000008080800000008000000080000000 + 8000000080008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 000000000000000000000000000000000000000000008080800000FFFF008080 + 800000FFFF008080800000FFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000800000008000808080000000 + 0000000080000000800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000808000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000008080800000FFFF00000000008080 + 8000FFFFFF00000000008080800000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000800000008000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF0000000000000000008080 + 800000FFFF000000000000000000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000008000000080008080800000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFF00000000FFFFFFFF00000000 + C007FFF900000000C007E7FF00000000C007C3F300000000C007C3E700000000 + C007E1C700000000C007F08F00000000C007F81F00000000C007FC3F00000000 + C007F81F00000000C007F09F00000000C00FC1C700000000C01F83E300000000 + C03F8FF100000000FFFFFFFF00000000C000C000FFFFFFFF80008000FFFFFFFF + 80008000FFFFFFFF80000000F83FFEFF80000000F83FFC7F80000000F83FF83F + 00000000F83FF01F00008000C007E00F80008000E00FC00700008000F01FF83F + 00010001F83FF83F81FF11FFFC7FF83F24FFF8FFFEFFF83F66FFFC7FFFFFFFFF + E7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressBars 6/Sources/dxBarCustForm.pas b/official/x.35/ExpressBars 6/Sources/dxBarCustForm.pas new file mode 100644 index 00000000..de03a9c5 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarCustForm.pas @@ -0,0 +1,3710 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars customizing form } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarCustForm; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ComCtrls, ExtCtrls, Menus, Buttons, cxClasses, dxBar, ActnList, + ToolWin, ImgList, Contnrs; + +type + TdxBarCustomizingFormPainter = class + protected + class procedure DrawCaption(ACanvas: TCanvas; var AItemRect: TRect; + AItem: TdxCustomBarEdit; ASelected: Boolean); virtual; + class procedure DrawEditEdge(ACanvas: TCanvas; var AItemRect: TRect; + AItem: TdxCustomBarEdit; ASelected: Boolean); virtual; + class procedure DrawEditContent(ACanvas: TCanvas; AItemRect: TRect; + AItem: TdxCustomBarEdit; ASelected, ADrawArrowButton: Boolean); virtual; + class procedure InternalDrawCaption(ACanvas: TCanvas; var ATextRect: TRect; + const AText: string; AItem: TdxCustomBarEdit; ASelected: Boolean); virtual; + class procedure InternalDrawEditContent(ACanvas: TCanvas; AItemRect: TRect; + AItem: TdxCustomBarEdit; ASelected: Boolean); virtual; + + class procedure DrawSubItemArrow(ACanvas: TCanvas; X, Y: Integer; ASelected: Boolean); virtual; + public + class function BrushColors(Selected: Boolean; AItem: TdxBarItem): TColor; virtual; + class procedure DrawButtonOrSubItem(ACanvas: TCanvas; ARect: TRect; + AItem: TdxBarItem; ACaption: string; Selected: Boolean); virtual; + class procedure DrawComboBoxButton(ACanvas: TCanvas; AItem: TdxBarItem; + ARect: TRect; ASelected: Boolean); virtual; + class procedure DrawEdit(ACanvas: TCanvas; ARect: TRect; + AItem: TdxCustomBarEdit; Selected, ADrawArrowButton: Boolean); virtual; + class procedure DrawFocusedRect(ACanvas: TCanvas; ARect: TRect; AItem: TdxBarItem); virtual; + class function FontColors(Selected: Boolean): TColor; virtual; + class function GetButtonColor(AItem: TdxBarItem; + ASelected: Boolean): Integer; virtual; + class function GetComboBoxButtonWidth: Integer; virtual; + end; + + TdxBarCustomizingFormPainterClass = class of TdxBarCustomizingFormPainter; + + TdxBarCustomizingFormStandardPainter = class(TdxBarCustomizingFormPainter) + public + class procedure DrawFocusedRect(ACanvas: TCanvas; ARect: TRect; AItem: TdxBarItem); override; + end; + + TdxBarCustomizingFormFlatPainter = class(TdxBarCustomizingFormPainter) + protected + class procedure DrawEditEdge(ACanvas: TCanvas; var AItemRect: TRect; + AItem: TdxCustomBarEdit; ASelected: Boolean); override; + class procedure InternalDrawCaption(ACanvas: TCanvas; var ATextRect: TRect; + const AText: string; AItem: TdxCustomBarEdit; ASelected: Boolean); override; + public + class function BrushColors(Selected: Boolean; AItem: TdxBarItem): TColor; override; + class procedure DrawButtonOrSubItem(ACanvas: TCanvas; ARect: TRect; + AItem: TdxBarItem; ACaption: string; Selected: Boolean); override; + class procedure DrawComboBoxButton(ACanvas: TCanvas; AItem: TdxBarItem; + ARect: TRect; ASelected: Boolean); override; + class procedure DrawFocusedRect(ACanvas: TCanvas; ARect: TRect; AItem: TdxBarItem); override; + class function FontColors(Selected: Boolean): TColor; override; + end; + + TdxBarCustomizingFormOffice11Painter = class(TdxBarCustomizingFormFlatPainter) + protected + class procedure DrawEditEdge(ACanvas: TCanvas; var AItemRect: TRect; + AItem: TdxCustomBarEdit; ASelected: Boolean); override; + class procedure InternalDrawCaption(ACanvas: TCanvas; var ATextRect: TRect; + const AText: string; AItem: TdxCustomBarEdit; ASelected: Boolean); override; + public + class function BrushColors(Selected: Boolean; AItem: TdxBarItem): TColor; override; + class procedure DrawButtonOrSubItem(ACanvas: TCanvas; ARect: TRect; + AItem: TdxBarItem; ACaption: string; Selected: Boolean); override; + class procedure DrawComboBoxButton(ACanvas: TCanvas; AItem: TdxBarItem; + ARect: TRect; ASelected: Boolean); override; + class function FontColors(Selected: Boolean): TColor; override; + class function GetButtonColor(AItem: TdxBarItem; + ASelected: Boolean): Integer; override; + end; + + TdxBarCustomizingFormXPPainter = class(TdxBarCustomizingFormPainter) + class procedure DrawEditEdge(ACanvas: TCanvas; var AItemRect: TRect; + AItem: TdxCustomBarEdit; ASelected: Boolean); override; + class procedure InternalDrawEditContent(ACanvas: TCanvas; AItemRect: TRect; + AItem: TdxCustomBarEdit; ASelected: Boolean); override; + public + class procedure DrawButtonOrSubItem(ACanvas: TCanvas; ARect: TRect; + AItem: TdxBarItem; ACaption: string; Selected: Boolean); override; + class procedure DrawComboBoxButton(ACanvas: TCanvas; AItem: TdxBarItem; + ARect: TRect; ASelected: Boolean); override; + class procedure DrawFocusedRect(ACanvas: TCanvas; ARect: TRect; AItem: TdxBarItem); override; + class function GetComboBoxButtonWidth: Integer; override; + end; + + TdxBarRunTimeSelectionController = class(TInterfacedObject, IdxBarDesigner) + private + FSelectionList: TdxComponentList; + FOnSelectionChanged: TNotifyEvent; + procedure AddSelection(AComponent: TComponent); + procedure SelectionListNotify(Sender: TObject; AComponent: TComponent; AAction: TListNotification); + procedure SelectionListChanged(Sender: TObject; AComponent: TComponent; AAction: TcxComponentCollectionNotification); + public + constructor Create; + destructor Destroy; override; + + // IdxBarDesigner + function CanDeleteComponent(AComponent: TComponent): Boolean; + procedure GetSelection(AList: TList); + function GetSelectionStatus(AComponent: TPersistent): TdxBarSelectionStatus; + function IsComponentSelected(AComponent: TPersistent): Boolean; + procedure SelectComponent(AComponent: TPersistent; ASelectionOperation: TdxBarSelectionOperation = soExclusive); + procedure SetSelection(AList: TList); + procedure ShowDefaultEventHandler(AItem: TdxBarItem); + function UniqueName(const BaseName: string): string; + + property OnSelectionChanged: TNotifyEvent read FOnSelectionChanged write FOnSelectionChanged; + end; + + TdxBarPermissiveProc = function (Sender: TComponent): Boolean of object; + + TdxBarCustomizingForm = class(TForm) + Panel1: TPanel; + PageControl: TPageControl; + tsToolbars: TTabSheet; + tsItems: TTabSheet; + BBarDelete: TButton; + BBarNew: TButton; + BBarRename: TButton; + BClose: TButton; + LabelToobars: TLabel; + tsOptions: TTabSheet; + Panel2: TPanel; + Panel3: TPanel; + Panel4: TPanel; + Panel6: TPanel; + Panel7: TPanel; + lbCategories: TListBox; + lbItems: TListBox; + LabelCategories: TLabel; + LabelCommands: TLabel; + tsCommands: TTabSheet; + LAllCommands: TListBox; + CBShowCommandsWithShortCut: TCheckBox; + Panel5: TPanel; + Panel8: TPanel; + Panel9: TPanel; + DescriptionLabel: TLabel; + LabelDescription: TLabel; + Bevel1: TBevel; + BarManager1: TdxBarManager; + CategoriesPopupMenu: TdxBarPopupMenu; + CategoriesAdd: TdxBarButton; + CategoriesInsert: TdxBarButton; + CategoriesRename: TdxBarButton; + CategoriesDelete: TdxBarButton; + CommandsAdd: TdxBarButton; + CommandsDelete: TdxBarButton; + CommandsClear: TdxBarButton; + CommandsPopupMenu: TdxBarPopupMenu; + CommandsSubMenuEditor: TdxBarButton; + CommandsMoveUp: TdxBarButton; + CommandsMoveDown: TdxBarButton; + CategoriesVisible: TdxBarButton; + CategoriesItemsVisible: TdxBarCombo; + lbBarsList: TListBox; + CategoriesPopupButtonPlace: TSpeedButton; + CommandsPopupButtonPlace: TSpeedButton; + BBarReset: TButton; + StandardOptionsPanel: TPanel; + LabelMenuAnimations: TLabel; + ComboBoxMenuAnimations: TComboBox; + CBHint1: TCheckBox; + CBHint2: TCheckBox; + CBLargeIcons: TCheckBox; + EnhancedOptionsPanel: TPanel; + Label1: TLabel; + ComboBoxMenuAnimationsEx: TComboBox; + CBHint1Ex: TCheckBox; + CBHint2Ex: TCheckBox; + CBLargeIconsEx: TCheckBox; + Bevel2: TBevel; + Label2: TLabel; + Label3: TLabel; + Bevel3: TBevel; + CBMenusShowRecentItemsFirst: TCheckBox; + CBShowFullMenusAfterDelay: TCheckBox; + BResetUsageData: TButton; + BHelp: TBitBtn; + tsGroups: TTabSheet; + gbGroups: TGroupBox; + gpGroupItems: TGroupBox; + lbGroups: TListBox; + lbGroupItems: TListBox; + alCustomize: TActionList; + aNewToolBar: TAction; + aRenameToolBar: TAction; + aDeleteToolBar: TAction; + aResetToolBar: TAction; + aAddGroupItem: TAction; + aDeleteGroupItem: TAction; + tbGroups: TToolBar; + btnAddGroup: TToolButton; + btnDeleteGroup: TToolButton; + ToolButton3: TToolButton; + btnMoveUpGroup: TToolButton; + btnMoveDownGroup: TToolButton; + aAddGroup: TAction; + aDeleteGroup: TAction; + imgGroups: TImageList; + aMoveUpGroup: TAction; + aMoveDownGroup: TAction; + aMoveUpGroupItem: TAction; + aMoveDownGroupItem: TAction; + tbGroupItems: TToolBar; + btnAddGroupItem: TToolButton; + btnDeleteGroupItem: TToolButton; + ToolButton8: TToolButton; + btnMoveUpGroupItem: TToolButton; + btnMoveDownGroupItem: TToolButton; + Bevel4: TBevel; + aDeleteItem: TAction; + aAddItem: TAction; + aMoveUpItem: TAction; + aMoveDownItem: TAction; + aSubMenuEditor: TAction; + aClearItemList: TAction; + TabSheet1: TTabSheet; + tvKeyTips: TTreeView; + + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure FormHide(Sender: TObject); + + procedure lbBarsListClick(Sender: TObject); + procedure lbBarsListMouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure lbBarsListDblClick(Sender: TObject); + procedure lbBarsListKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure lbBarsListDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); + + procedure BHelpClick(Sender: TObject); + procedure BCloseClick(Sender: TObject); + procedure lbCategoriesClick(Sender: TObject); + procedure lbCategoriesKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure lbCategoriesMouseDown(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + procedure lbCategoriesDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure lbCategoriesEndDrag(Sender, Target: TObject; X, Y: Integer); + procedure CategoriesPopupMenuPopup(Sender: TObject); + procedure CategoriesAddClick(Sender: TObject); + procedure CategoriesInsertClick(Sender: TObject); + procedure CategoriesRenameClick(Sender: TObject); + procedure CategoriesItemsVisibleChange(Sender: TObject); + procedure CategoriesVisibleClick(Sender: TObject); + procedure CategoriesDeleteClick(Sender: TObject); + + procedure lbItemsClick(Sender: TObject); + procedure lbItemsDblClick(Sender: TObject); + procedure lbItemsKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure lbItemsMeasureItem(Control: TWinControl; + Index: Integer; var Height: Integer); + procedure lbItemsMouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure lbItemsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure lbItemsMouseUp(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + + procedure CommandsPopupMenuPopup(Sender: TObject); + procedure CommandsAddClick(Sender: TObject); + procedure CommandsDeleteClick(Sender: TObject); + procedure CommandsClearClick(Sender: TObject); + procedure CommandsMoveUpClick(Sender: TObject); + procedure CommandsMoveDownClick(Sender: TObject); + procedure CommandsSubMenuEditorClick(Sender: TObject); + procedure CBMenusShowRecentItemsFirstClick(Sender: TObject); + procedure CBShowFullMenusAfterDelayClick(Sender: TObject); + procedure BResetUsageDataClick(Sender: TObject); + procedure CBLargeIconsClick(Sender: TObject); + procedure CBHint1Click(Sender: TObject); + procedure CBHint1ExClick(Sender: TObject); + procedure CBHint2Click(Sender: TObject); + procedure ComboBoxMenuAnimationsClick(Sender: TObject); + procedure LAllCommandsClick(Sender: TObject); + procedure LAllCommandsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure CBShowCommandsWithShortCutClick(Sender: TObject); + + procedure lbGroupsClick(Sender: TObject); + procedure lbGroupsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure lbGroupsKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure lbGroupsMeasureItem(Control: TWinControl; Index: Integer; + var Height: Integer); + + procedure lbGroupItemsClick(Sender: TObject); + procedure lbGroupItemsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure lbGroupItemsKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure aNewToolBarExecute(Sender: TObject); + procedure aRenameToolBarExecute(Sender: TObject); + procedure aDeleteToolBarExecute(Sender: TObject); + procedure aResetToolBarExecute(Sender: TObject); + procedure aAddGroupItemExecute(Sender: TObject); + procedure aDeleteGroupItemExecute(Sender: TObject); + procedure aAddGroupExecute(Sender: TObject); + procedure aDeleteGroupExecute(Sender: TObject); + procedure aMoveGroupExecute(Sender: TObject); + procedure aMoveGroupItemExecute(Sender: TObject); + procedure aMoveItemExecute(Sender: TObject); + procedure aAddItemExecute(Sender: TObject); + procedure aDeleteItemExecute(Sender: TObject); + procedure aSubMenuEditorExecute(Sender: TObject); + procedure aClearItemListExecute(Sender: TObject); + private + FDisabledWindows: TList; + FSelectionList: TdxComponentList; + + FBarListBoxOldWndProc: TWndMethod; + FBarsOldChangeEvent: TcxComponentCollectionChangeEvent; + + FCategoryListBoxOldWndProc: TWndMethod; + + FItemListBoxOldWndProc: TWndMethod; + FItemsOldChangeEvent: TdxBarListChangeEvent; + + FCommandListBoxOldWndProc: TWndMethod; + + FGroupListBoxOldWndProc: TWndMethod; + FGroupsOldChangeEvent: TdxBarListChangeEvent; + + FGroupItemListBoxOldWndProc: TWndMethod; + FSelectedGroupItems: TdxBarComponentList; + + FDraggingCategoryIndex: Integer; + + FAllCommandsNameWidth: Integer; + FAllCommandsCaptionWidth: Integer; + FAllCommandsShortCutWidth: Integer; + + FAlreadySynchronous: TListBox; + + //Common Tools + procedure DeleteSelectedObjects(AListBox: TListBox; + ADeleteProc: TNotifyEvent = nil; ASynchronizeDesigner: Boolean = True); + procedure EnableWindows(AEnable: Boolean); + function GetVisibleItemsCount(AListBox: TListBox): Integer; + function GetExclusiveObject(AListBox: TListBox): TObject; + function GetObjectFromListBox(AListBox: TListBox; AIndex: Integer): TObject; + function GetNextSelectedObject(AListBox: TListBox): TObject; + function GetPainterClass: TdxBarCustomizingFormPainterClass; + function GetSelCount(AListBox: TListBox): Integer; + procedure GetSelection(AListBox: TListBox; AList: TList); + procedure MoveItems(AListBox: TListBox; + ABarComponentList: TdxBarComponentList; ADirection: Integer); + procedure SelectBarManager; + procedure SetNewWindowProc(AControl: TControl; ANewWindowProc: TWndMethod; + out AOldWindowProc: TWndMethod); + procedure SetSelection(AListBox: TListBox; AList: TList); overload; + procedure SetSelection(AListBox: TListBox; AObject: TObject); overload; + procedure SynchronizeDesigner(ANewSelection: IdxBarSelectableItem); overload; + procedure SynchronizeDesigner(AListBox: TListBox); overload; + procedure SynchronizeListBox(AListBox: TListBox; AChangedObject: TObject = nil; AAction: TcxComponentCollectionNotification = ccnChanged); + procedure SynchronizeListBoxes; + procedure SynchronizeListBoxSelection(AListBox: TListBox); + procedure UpdateCommonEvents(AListBox: TListBox; + AAddAction, ADeleteAction, AMoveUpAction, AMoveDownAction: TAction; + ADeletePermissiveProc: TdxBarPermissiveProc = nil); + procedure UpdateTopIndex(AListBox: TListBox); + + //BarList + procedure BarListToggleCheck(AIndex: Integer); + procedure BarListBoxWndProc(var Message: TMessage); + procedure BarsChange(Sender: TObject; AItem: TcxComponentCollectionItem; + AAction: TcxComponentCollectionNotification); + function CanDeleteBar(ABar: TComponent): Boolean; + function GetBarList(Index: Integer): TdxBar; + function GetSelectedBar: TdxBar; + function IsBarPredefined(ABar: TdxBar): Boolean; + + //CategoryList + function CanDeleteSelectedCategory: Boolean; + function CanDeleteSelectedCategoryCommands: Boolean; + procedure CategoryListBoxWndProc(var Message: TMessage); + + //ItemList + function GetItemList(Index: Integer): TdxBarItem; + function GetSelectedItem: TdxBarItem; + procedure ItemListBoxWndProc(var Message: TMessage); + procedure ItemsChange(Sender: TObject; AComponent: TComponent; + AAction: TcxComponentCollectionNotification); + procedure MoveItem(Delta: Integer); + + //CommandList + procedure CommandListBoxWndProc(var Message: TMessage); + function GetCommandList(Index: Integer): TdxBarItem; + procedure RefreshAllCommandListBox; + + //GroupList + function GetSelectedGroup: TdxBarGroup; + procedure GroupListBoxWndProc(var Message: TMessage); + procedure GroupsChange(Sender: TObject; AComponent: TComponent; + AAction: TcxComponentCollectionNotification); + procedure MoveGroup(ADirection: Integer); + procedure RememberSelectedList; + + //GroupItemList + procedure GroupItemListBoxWndProc(var Message: TMessage); + procedure GroupStuctureChange; + procedure DeleteGroupItem(AGroupItem: TObject); + procedure MoveGroupItem(ADirection: Integer); + procedure UpdateGroupItemEvents; + + procedure WMActivate(var Message: TMessage); message WM_ACTIVATE; + procedure WMDestroy(var Message: TWMDestroy); message WM_DESTROY; + procedure WMNCHitTest(var Message: TMessage); message WM_NCHITTEST; + + property BarList[Index: Integer]: TdxBar read GetBarList; + property CommandList[Index: Integer]: TdxBarItem read GetCommandList; + property ItemList[Index: Integer]: TdxBarItem read GetItemList; + + property SelectedBar: TdxBar read GetSelectedBar; + property SelectedGroup: TdxBarGroup read GetSelectedGroup; + property SelectedItem: TdxBarItem read GetSelectedItem; + protected + procedure CreateParams(var Params: TCreateParams); override; + {$IFDEF DELPHI9} + procedure DestroyWindowHandle; override; + {$ENDIF} + public + BarManager: TdxBarManager; + constructor CreateEx(ABarManager: TdxBarManager); + destructor Destroy; override; + procedure MouseWheelHandler(var Message: TMessage); override; + procedure BarManagerStyleChanged; + procedure DesignSelectionChanged(Sender: TObject); + procedure SelectPage(APageIndex: Integer); + procedure UpdateHelpButton; + procedure UpdateOptions; + procedure UpdateVisibility(const AWindowPos: TWindowPos); + property PainterClass: TdxBarCustomizingFormPainterClass read GetPainterClass; + end; + +procedure dxBarCustomizing(ABarManager: TdxBarManager; AShow: Boolean); +function dxBarCustomizingForm: TdxBarCustomizingForm; +function IsCustomization: Boolean; +procedure PrepareCustomizationFormFont(AForm: TCustomForm; + ABarManager: TdxBarManager); + +procedure HostBarManagerStyleChanged; +procedure UpdateHelpButton; +procedure UpdateBarManagerOptions; + +implementation + +{$R *.DFM} + +uses +{$IFDEF DELPHI8} + Types, +{$ENDIF} + dxBarNameEd, dxBarPopupMenuEd, dxBarItemEd, dxBarStrs, dxBarAddGroupItemsEd, + TypInfo, dxUxTheme, dxThemeManager, dxThemeConsts, dxOffice11, cxContainer, + cxControls, cxGraphics, Math, cxLookAndFeelPainters; + +const + AllCommandsIndent = 5; + + AToolBarsPage = 0; + ACommandsPage = 1; + AAllCommandsPage = 3; + AGroupsPage = 4; + + LB_SYNCHRONYZE = WM_DX + 1; + LB_SYNCHRONYZESELECTION = WM_DX + 2; + LB_UPDATEEVENTS = WM_DX + 3; + +type + TCustomdxBarContainerItemAccess = class(TCustomdxBarContainerItem); + TdxBarAccess = class(TdxBar); + TdxBarGroupAccess = class(TdxBarGroup); + TdxBarControlAccess = class(TdxBarControl); + TdxBarItemAccess = class(TdxBarItem); + TdxBarManagerAccess = class(TdxBarManager); + TdxCustomBarEditAccess = class(TdxCustomBarEdit); + +{ TCheckListBox } + +{ procedures } + +var + FdxBarCustomizingForm: TdxBarCustomizingForm; + FCloseCustomizingFormFlag: Boolean; + +procedure dxBarCustomizing(ABarManager: TdxBarManager; AShow: Boolean); + + procedure InvalidateUncustomizableToolbars; + var + ABar: TdxBar; + I, J: Integer; + begin + for I := 0 to dxBarManagerList.Count - 1 do + if dxBarManagerList[I] <> ABarManager then + for J := 0 to dxBarManagerList[I].Bars.Count - 1 do + begin + ABar := dxBarManagerList[I].Bars[J]; + if ABar.Visible and (ABar.Control <> nil) and + ABar.Control.HandleAllocated then + begin + TdxBarControlAccess(ABar.Control).UpdateDoubleBuffered; + ABar.Control.Invalidate; + SendMessage(ABar.Control.Handle, WM_NCPAINT, 1, 0); + end; + end; + end; + + procedure DoShowCustomizingForm; + begin + if Assigned(ABarManager.OnShowCustomizingForm) then + ABarManager.OnShowCustomizingForm(ABarManager); + end; + + procedure DoHideCustomizingForm; + begin + if Assigned(ABarManager.OnHideCustomizingForm) then + ABarManager.OnHideCustomizingForm(ABarManager); + end; + +begin + if AShow then + begin + if FdxBarCustomizingForm <> nil then Exit; + + TdxBarManagerAccess(ABarManager).InternalUnmerge(nil, True); + DoShowCustomizingForm; + InvalidateUncustomizableToolbars; + + FdxBarCustomizingForm := TdxBarCustomizingForm.CreateEx(ABarManager); + FdxBarCustomizingForm.Show; + end + else + begin + if not FCloseCustomizingFormFlag then + FreeAndNil(FdxBarCustomizingForm); + dxBarSubMenuEditor.Free; + + DoHideCustomizingForm; + InvalidateUncustomizableToolbars; + TdxBarManagerAccess(ABarManager).RestoreMergeState; + end; +end; + +function dxBarCustomizingForm: TdxBarCustomizingForm; +begin + Result := FdxBarCustomizingForm; +end; + +function IsCustomization: Boolean; +begin + Result := FdxBarCustomizingForm <> nil; +end; + +procedure PrepareCustomizationFormFont(AForm: TCustomForm; + ABarManager: TdxBarManager); +begin + AForm.Font.Name := ABarManager.Font.Name; + AForm.Font.Charset := ABarManager.Font.Charset; +end; + +procedure HostBarManagerStyleChanged; +begin + if FdxBarCustomizingForm <> nil then + FdxBarCustomizingForm.BarManagerStyleChanged; +end; + +procedure UpdateHelpButton; +begin + if FdxBarCustomizingForm <> nil then + FdxBarCustomizingForm.UpdateHelpButton; +end; + +procedure UpdateBarManagerOptions; +begin + if FdxBarCustomizingForm <> nil then + FdxBarCustomizingForm.UpdateOptions; +end; + +{ TCommandsListBox } + +const + dxBarGlyphSize = 16; + dxBarButtonWidth = 23; + dxBarButtonHeight = 22; + dxBarComboBoxArrowWidth = 11; + +{ TCheckableButton } + +type + TCheckableButton = class(TGraphicControl) + private + FDown: Boolean; + FDropDownMenu: TdxBarPopupMenu; + LButtonDown: Boolean; + procedure SetDown(Value: Boolean); + procedure SetDropDownMenu(Value: TdxBarPopupMenu); + procedure DropDownMenuCloseup(Sender: TObject); + procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + protected + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure Paint; override; + public + constructor Create(AOwner: TComponent); override; + procedure AdjustWithControl(AControl: TControl); + property Down: Boolean read FDown write SetDown; + property DropDownMenu: TdxBarPopupMenu read FDropDownMenu write SetDropDownMenu; + end; + +constructor TCheckableButton.Create(AOwner: TComponent); +begin + inherited; + ControlStyle := ControlStyle - [csCaptureMouse]; +end; + +procedure TCheckableButton.AdjustWithControl(AControl: TControl); +var + AAdjustment: Integer; +begin + AAdjustment := AControl.BoundsRect.Right + 5 - Left; + SetBounds(Left + AAdjustment, Top, Width - AAdjustment, Height); +end; + +procedure TCheckableButton.SetDown(Value: Boolean); +begin + if FDown <> Value then + begin + FDown := Value; + Repaint; + if FDown and (FDropDownMenu <> nil) then + with ClientToScreen(Point(0, Height)) do + FDropDownMenu.PopupEx(X, Y, 0, Height, True, nil); + end; +end; + +procedure TCheckableButton.SetDropDownMenu(Value: TdxBarPopupMenu); +begin + if FDropDownMenu <> Value then + begin + FDropDownMenu := Value; + FDropDownMenu.OnCloseup := DropDownMenuCloseup; + end; +end; + +procedure TCheckableButton.DropDownMenuCloseup(Sender: TObject); +var + P: TPoint; +begin + if FDown then + begin + GetCursorPos(P); + P := ScreenToClient(P); + LButtonDown := LeftButtonPressed and PtInRect(ClientRect, P); + Down := False; + end; +end; + +procedure TCheckableButton.CMMouseEnter(var Message: TMessage); +begin + inherited; + Repaint; +end; + +procedure TCheckableButton.CMMouseLeave(var Message: TMessage); +begin + inherited; + Repaint; +end; + +procedure TCheckableButton.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + inherited; + if LButtonDown then LButtonDown := False + else + if Button = mbLeft then Down := True; +end; + +procedure TCheckableButton.Paint; +const + Borders: array[Boolean] of Integer = (BDR_RAISEDINNER, BDR_SUNKENOUTER); +var + R: TRect; + P: TPoint; +begin + with Canvas do + begin + R := ClientRect; + GetCursorPos(P); + P := ScreenToClient(P); + if PtInRect(R, P) and GetParentForm(Self).Active or FDown then + DrawEdge(Handle, R, Borders[FDown], BF_RECT); + InflateRect(R, -1, -1); + if FDown then OffsetRect(R, 1, 1); + Brush.Style := bsClear; + Font := Self.Font; + Font.Color := clBtnText; + cxDrawText(Handle, Caption, R, DT_CENTER or DT_NOCLIP or DT_SINGLELINE or DT_VCENTER); + Brush.Style := bsSolid; + end; +end; + +{ TdxBarCustomizingFormPainter } + +class function TdxBarCustomizingFormPainter.BrushColors(Selected: Boolean; AItem: TdxBarItem): TColor; +begin + if Selected then + Result := clHighlight + else + Result := clBtnFace; +end; + +class procedure TdxBarCustomizingFormPainter.DrawButtonOrSubItem(ACanvas: TCanvas; + ARect: TRect; AItem: TdxBarItem; ACaption: string; Selected: Boolean); +var + R: TRect; + S: string; + IsGlyph: Boolean; + W, H: Integer; + FullImageRect: TRect; +begin + R := ARect; + with TdxBarItemAccess(AItem) do + IsGlyph := not Glyph.Empty or CurImageIndexLinked; + with ACanvas, R do + begin + Right := Left + dxBarButtonWidth; + Brush.Color := BrushColors(not IsGlyph and Selected, AItem); + FillRect(R); + Pen.Color := Brush.Color; + MoveTo(Right, Top); + LineTo(Right, Bottom); + + if IsGlyph then + begin + if Selected then + DrawEdge(Handle, R, BDR_RAISEDINNER, BF_RECT); + + if AItem.Glyph.Empty then + with AItem.GetCurImages do + begin + W := Width; + H := Height; + end + else + with AItem.Glyph do + begin + W := Width; + H := Height; + end; + with R do + R := Bounds((Left + Right - W) div 2, (Top + Bottom - H) div 2, W, H); + FullImageRect := R; + + TransparentDraw(Handle, Brush.Handle, FullImageRect, R, AItem.Glyph, + AItem.GetCurImages, AItem.ImageIndex, AItem.BarManager.ImageListBkColor, + True, False, False{Flat}, Selected, False, False, False{Shadow}, False{Faded}, + AItem.BarManager.ImageOptions.UseLeftBottomPixelAsTransparent); + end; + + Font.Color := FontColors(Selected); + Brush.Color := BrushColors(Selected, AItem); + R := ARect; + if (AItem is TdxBarButton) and (TdxBarButton(AItem).ButtonStyle = bsDropDown) then + Dec(R.Right, 4 + 4 + 5); + Inc(Left, dxBarButtonWidth + 1); + FillRect(R); + Inc(Left, 2); + S := ACaption; + if (AItem is TCustomdxBarContainerItem) and + TCustomdxBarContainerItemAccess(AItem).HideWhenRun then + S := '(' + ACaption + ')'; + cxDrawText(Handle, S, R, DT_NOCLIP or DT_NOPREFIX or DT_SINGLELINE or DT_LEFT or DT_VCENTER); + + if (AItem is TdxBarButton) and (TdxBarButton(AItem).ButtonStyle = bsDropDown) then + begin + R.Left := R.Right; + R.Right := ARect.Right; + if Selected then + begin + DrawEdge(Handle, R, BDR_RAISEDINNER, BF_RECT); + InflateRect(R, -1, -1); + end + else + begin + Dec(R.Left); + DrawEdge(Handle, R, EDGE_ETCHED, BF_LEFT); + Inc(R.Left, 2); + end; + Brush.Color := BrushColors(False, AItem); + FillRect(R); + Font.Color := FontColors(False); + DrawSubItemArrow(ACanvas, ARect.Right - (4 + 5), ARect.Top + (dxBarButtonHeight - 7) div 2, False); + end + else + if (AItem is TCustomdxBarSubItem) and not (AItem is TCustomdxBarContainerItem) or + (AItem is TCustomdxBarContainerItem) and not TCustomdxBarContainerItemAccess(AItem).HideWhenRun then + DrawSubItemArrow(ACanvas, ARect.Right - (4 + 5), ARect.Top + (dxBarButtonHeight - 7) div 2, False); + end; +end; + +class procedure TdxBarCustomizingFormPainter.DrawComboBoxButton( + ACanvas: TCanvas; AItem: TdxBarItem; ARect: TRect; ASelected: Boolean); +begin + with ACanvas do + begin + Inc(ARect.Left); + if ASelected then + begin + DrawEdge(Handle, ARect, BDR_RAISEDINNER, BF_RECT); + Pen.Color := BrushColors(False, AItem); + end + else + begin + Brush.Color := clBtnHighlight; + FrameRect(ARect); + Pen.Color := Brush.Color; + end; + MoveTo(ARect.Left - 1, ARect.Top); + LineTo(ARect.Left - 1, ARect.Bottom); + InflateRect(ARect, -1, -1); + Brush.Color := BrushColors(False, AItem); + FillRect(ARect); + Pen.Color := clBtnText; + InflateRect(ARect, 2, 0); + DrawItemArrow(Handle, ARect, adDown, True, False, False{Flat}); + end; +end; + +class procedure TdxBarCustomizingFormPainter.DrawEdit(ACanvas: TCanvas; + ARect: TRect; AItem: TdxCustomBarEdit; Selected, ADrawArrowButton: Boolean); +begin + DrawCaption(ACanvas, ARect, AItem, Selected); + DrawEditEdge(ACanvas, ARect, AItem, Selected); + DrawEditContent(ACanvas, ARect, AItem, Selected, ADrawArrowButton); +end; + +class procedure TdxBarCustomizingFormPainter.DrawFocusedRect(ACanvas: TCanvas; + ARect: TRect; AItem: TdxBarItem); +begin + SetTextColor(ACanvas.Handle, ColorToRGB(FontColors(True))); + SetBkColor(ACanvas.Handle, ColorToRGB(BrushColors(True, AItem))); + Windows.DrawFocusRect(ACanvas.Handle, ARect); +end; + +class function TdxBarCustomizingFormPainter.FontColors(Selected: Boolean): TColor; +begin + if Selected then + Result := clHighlightText + else + Result := clBtnText; +end; + +class function TdxBarCustomizingFormPainter.GetButtonColor( + AItem: TdxBarItem; ASelected: Boolean): Integer; +begin + Result := clBtnFace; +end; + +class function TdxBarCustomizingFormPainter.GetComboBoxButtonWidth: Integer; +begin + Result := dxBarComboBoxArrowWidth + 1; +end; + +class procedure TdxBarCustomizingFormPainter.DrawCaption(ACanvas: TCanvas; + var AItemRect: TRect; AItem: TdxCustomBarEdit; ASelected: Boolean); +var + ATextRect: TRect; + AText: string; +begin + AText := GetTextOf(AItem.Caption); + ATextRect := AItemRect; + ATextRect.Right := ACanvas.TextWidth(AText); + + InternalDrawCaption(ACanvas, ATextRect, AText, AItem, ASelected); + + AItemRect.Left := ATextRect.Right; +end; + +class procedure TdxBarCustomizingFormPainter.DrawEditEdge(ACanvas: TCanvas; + var AItemRect: TRect; AItem: TdxCustomBarEdit; ASelected: Boolean); +begin + if ASelected then + DrawEdge(ACanvas.Handle, AItemRect, BDR_SUNKENOUTER, BF_RECT) + else + ACanvas.FrameRect(AItemRect); + InflateRect(AItemRect, -1, -1); + ACanvas.FrameRect(AItemRect); + InflateRect(AItemRect, -1, -1); +end; + +class procedure TdxBarCustomizingFormPainter.DrawEditContent(ACanvas: TCanvas; + AItemRect: TRect; AItem: TdxCustomBarEdit; ASelected, ADrawArrowButton: Boolean); +begin + if ADrawArrowButton then + begin + Dec(AItemRect.Right, GetComboBoxButtonWidth); + DrawComboBoxButton(ACanvas, AItem, + Rect(AItemRect.Right, AItemRect.Top, AItemRect.Right + GetComboBoxButtonWidth, AItemRect.Bottom), ASelected); + end; + InternalDrawEditContent(ACanvas, AItemRect, AItem, ASelected); +end; + +class procedure TdxBarCustomizingFormPainter.DrawSubItemArrow(ACanvas: TCanvas; + X, Y: Integer; ASelected: Boolean); +begin + with ACanvas do + begin + if ASelected and IsHighContrastWhite then + Pen.Color := clWhite + else + Pen.Color := Font.Color; + Brush.Color := Pen.Color; + Polygon([Point(X, Y), Point(X, Y + 6), Point(X + 3, Y + 3)]); + end; +end; + +class procedure TdxBarCustomizingFormPainter.InternalDrawCaption(ACanvas: TCanvas; + var ATextRect: TRect; const AText: string; AItem: TdxCustomBarEdit; ASelected: Boolean); +const + ATextOffset = 2; +var + ARect: TRect; +begin + ARect := ATextRect; + + ACanvas.Brush.Color := BrushColors(ASelected, AItem); + Inc(ARect.Right, ATextOffset + 1); + ACanvas.FillRect(ARect); + + Inc(ARect.Left, ATextOffset); + ACanvas.Font.Color := FontColors(ASelected); + cxDrawText(ACanvas.Handle, AText, ARect, DT_NOCLIP or DT_NOPREFIX or DT_SINGLELINE or DT_LEFT or DT_VCENTER); + + ACanvas.Brush.Color := BrushColors(False, AItem); + ARect.Left := ARect.Right; + Inc(ARect.Right, 4); + ACanvas.FillRect(ARect); + + ATextRect.Right := ARect.Right; +end; + +class procedure TdxBarCustomizingFormPainter.InternalDrawEditContent(ACanvas: TCanvas; + AItemRect: TRect; AItem: TdxCustomBarEdit; ASelected: Boolean); +begin + ACanvas.Font.Color := FontColors(False); + TdxCustomBarEditAccess(AItem).DrawCustomizingImageContent(ACanvas, AItemRect, ASelected); +end; + +{ TdxBarCustomizingFormStandardPainter } + +class procedure TdxBarCustomizingFormStandardPainter.DrawFocusedRect(ACanvas: TCanvas; + ARect: TRect; AItem: TdxBarItem); +begin + InflateRect(ARect, -2, -2); + inherited DrawFocusedRect(ACanvas, ARect, AItem); +end; + +{ TdxBarCustomizingFormFlatPainter } + +class function TdxBarCustomizingFormFlatPainter.BrushColors(Selected: Boolean; AItem: TdxBarItem): TColor; +begin + if Selected then + Result := TdxBarManagerAccess(AItem.BarManager).FlatToolbarsSelColor + else + Result := clWindow; +end; + +class procedure TdxBarCustomizingFormFlatPainter.DrawButtonOrSubItem(ACanvas: TCanvas; + ARect: TRect; AItem: TdxBarItem; ACaption: string; Selected: Boolean); +var + R: TRect; + S: string; + IsGlyph: Boolean; + W, H: Integer; + FullImageRect: TRect; +begin + R := ARect; + with TdxBarItemAccess(AItem) do + IsGlyph := not Glyph.Empty or CurImageIndexLinked; + with ACanvas, R do + begin + Brush.Color := BrushColors(Selected, AItem); + if Selected then + begin + FillRect(R); + Right := Left + Bottom - Top; + end + else + begin + Inc(Left, Bottom - Top); + FillRect(R); + Right := Left; + Left := ARect.Left; + Brush.Color := clBtnFace; + FillRect(R); + end; + + if IsGlyph then + begin + if AItem.Glyph.Empty then + with AItem.GetCurImages do + begin + W := Width; + H := Height; + end + else + with AItem.Glyph do + begin + W := Width; + H := Height; + end; + with R do + R := Bounds((Left + Right - W) div 2, (Top + Bottom - H) div 2, W, H); + FullImageRect := R; + InflateRect(FullImageRect, 1, 1); + + TransparentDraw(Handle, Brush.Handle, FullImageRect, R, AItem.Glyph, + AItem.GetCurImages, AItem.ImageIndex, AItem.BarManager.ImageListBkColor, + True, False, True{Flat}, Selected, False, False, True{Shadow}, False{Faded}, + AItem.BarManager.ImageOptions.UseLeftBottomPixelAsTransparent); + end; + + Font.Color := FontColors(Selected); + Brush.Color := BrushColors(Selected, AItem); + R := ARect; + if (AItem is TdxBarButton) and (TdxBarButton(AItem).ButtonStyle = bsDropDown) then + Dec(R.Right, 4 + 4 + 5); + Left := Bottom - Top + 10; + S := ACaption; + if (AItem is TCustomdxBarContainerItem) and + TCustomdxBarContainerItemAccess(AItem).HideWhenRun then + S := '(' + ACaption + ')'; + cxDrawText(Handle, S, R, DT_NOCLIP or DT_NOPREFIX or DT_SINGLELINE or DT_LEFT or DT_VCENTER); + + if (AItem is TdxBarButton) and (TdxBarButton(AItem).ButtonStyle = bsDropDown) then + begin + R.Left := R.Right; + R.Right := ARect.Right; + if Selected then + FrameFlatSelRect(Handle, R) + else + Windows.FrameRect(Handle, R, GetSysColorBrush(COLOR_BTNSHADOW)); + InflateRect(R, -1, -1); + Brush.Color := BrushColors(Selected, AItem); + FillRect(R); + Font.Color := FontColors(False); + DrawSubItemArrow(ACanvas, ARect.Right - (4 + 5), ARect.Top + (dxBarButtonHeight - 7) div 2, Selected); + end + else + if (AItem is TCustomdxBarSubItem) and not (AItem is TCustomdxBarContainerItem) or + (AItem is TCustomdxBarContainerItem) and not TCustomdxBarContainerItemAccess(AItem).HideWhenRun then + DrawSubItemArrow(ACanvas, ARect.Right - (4 + 5), ARect.Top + (dxBarButtonHeight - 7) div 2, Selected); + if Selected then + FrameFlatSelRect(Handle, ARect); + end; +end; + +class procedure TdxBarCustomizingFormFlatPainter.DrawComboBoxButton( + ACanvas: TCanvas; AItem: TdxBarItem; ARect: TRect; ASelected: Boolean); +begin + with ACanvas do + begin + Inc(ARect.Left); + if ASelected then + begin + InflateRect(ARect, 1, 1); + FrameFlatSelRect(Handle, ARect); + end + else + begin + Brush.Color := clBtnHighlight; + FrameRect(ARect); + Pen.Color := Brush.Color; + end; + if not ASelected then + begin + MoveTo(ARect.Left - 1, ARect.Top); + LineTo(ARect.Left - 1, ARect.Bottom); + end; + InflateRect(ARect, -1, -1); + if ASelected then + Brush.Color := TdxBarManagerAccess(AItem.BarManager).FlatToolbarsSelColor + else + Brush.Color := BrushColors(False, AItem); + FillRect(ARect); + Pen.Color := clBtnText; + if ASelected then + InflateRect(ARect, -1, -1); + InflateRect(ARect, 2, 0); + DrawItemArrow(Handle, ARect, adDown, True, ASelected and IsHighContrastWhite, True{Flat}); + end; +end; + +class procedure TdxBarCustomizingFormFlatPainter.DrawFocusedRect(ACanvas: TCanvas; ARect: TRect; AItem: TdxBarItem); +begin +// do nothing +end; + +class function TdxBarCustomizingFormFlatPainter.FontColors(Selected: Boolean): TColor; +begin + Result := clBtnText; + if Selected and IsHighContrastWhite then + Result := clBtnFace; +end; + +class procedure TdxBarCustomizingFormFlatPainter.DrawEditEdge(ACanvas: TCanvas; + var AItemRect: TRect; AItem: TdxCustomBarEdit; ASelected: Boolean); +begin + ACanvas.Brush.Color := BrushColors(False, AItem); + if ASelected then + FrameFlatSelRect(ACanvas.Handle, AItemRect) + else + Windows.FrameRect(ACanvas.Handle, AItemRect, GetSysColorBrush(COLOR_BTNSHADOW)); + InflateRect(AItemRect, -1, -1); +end; + +class procedure TdxBarCustomizingFormFlatPainter.InternalDrawCaption(ACanvas: TCanvas; + var ATextRect: TRect; const AText: string; AItem: TdxCustomBarEdit; ASelected: Boolean); +const + ATextOffset = 5; +var + ARect: TRect; +begin + ARect := ATextRect; + + ACanvas.Brush.Color := BrushColors(ASelected, AItem); + Inc(ARect.Right, 1 + ATextOffset + 5); + ACanvas.FillRect(ARect); + if ASelected then + begin + Inc(ARect.Right); + FrameFlatSelRect(ACanvas.Handle, ARect); + Dec(ARect.Right); + end; + + Inc(ARect.Left, ATextOffset); + ACanvas.Font.Color := FontColors(ASelected); + cxDrawText(ACanvas.Handle, AText, ARect, DT_NOCLIP or DT_NOPREFIX or DT_SINGLELINE or DT_LEFT or DT_VCENTER); + + ATextRect.Right := ARect.Right; +end; + +{ TdxBarCustomizingFormOffice11Painter } + +class function TdxBarCustomizingFormOffice11Painter.BrushColors( + Selected: Boolean; AItem: TdxBarItem): TColor; +begin + if Selected then + Result := dxOffice11ToolbarSelectedColor + else + Result := dxOffice11MenuColor; +end; + +class procedure TdxBarCustomizingFormOffice11Painter.DrawButtonOrSubItem(ACanvas: TCanvas; + ARect: TRect; AItem: TdxBarItem; ACaption: string; Selected: Boolean); +var + R: TRect; + S: string; + IsGlyph: Boolean; + W, H: Integer; + FullImageRect: TRect; +begin + R := ARect; + with TdxBarItemAccess(AItem) do + IsGlyph := not Glyph.Empty or CurImageIndexLinked; + with ACanvas, R do + begin + Brush.Color := BrushColors(Selected, AItem); + if Selected then + begin + FillRect(R); + Right := Left + Bottom - Top; + end + else + begin + Inc(Left, Bottom - Top); + FillRect(R); + Right := Left; + Left := ARect.Left; + FillTubeGradientRect(Handle, R, dxOffice11MenuIndentColor1, dxOffice11MenuIndentColor2, True); + end; + + if IsGlyph then + begin + if AItem.Glyph.Empty then + with AItem.GetCurImages do + begin + W := Width; + H := Height; + end + else + with AItem.Glyph do + begin + W := Width; + H := Height; + end; + with R do + R := Bounds((Left + Right - W) div 2, (Top + Bottom - H) div 2, W, H); + FullImageRect := R; + InflateRect(FullImageRect, 1, 1); + + TransparentDraw(Handle, 0, FullImageRect, R, AItem.Glyph, + AItem.GetCurImages, AItem.ImageIndex, AItem.BarManager.ImageListBkColor, + True, False, False{Flat}, Selected, False, False, False{Shadow}, False{Faded}, + AItem.BarManager.ImageOptions.UseLeftBottomPixelAsTransparent); + end; + + Font.Color := FontColors(Selected); + Brush.Color := BrushColors(Selected, AItem); + R := ARect; + if (AItem is TdxBarButton) and (TdxBarButton(AItem).ButtonStyle = bsDropDown) then + Dec(R.Right, 4 + 4 + 5); + Left := Bottom - Top + 10; + S := ACaption; + if (AItem is TCustomdxBarContainerItem) and + TCustomdxBarContainerItemAccess(AItem).HideWhenRun then + S := '(' + ACaption + ')'; + cxDrawText(Handle, S, R, DT_NOCLIP or DT_NOPREFIX or DT_SINGLELINE or DT_LEFT or DT_VCENTER); + + if (AItem is TdxBarButton) and (TdxBarButton(AItem).ButtonStyle = bsDropDown) then + begin + R.Left := R.Right; + R.Right := ARect.Right; + if Selected then + Office11FrameSelectedRect(Handle, R) + else + Windows.FrameRect(Handle, R, dxOffice11BarSeparatorBrush1); + InflateRect(R, -1, -1); + Brush.Color := BrushColors(Selected, AItem); + FillRect(R); + Font.Color := FontColors(False); + DrawSubItemArrow(ACanvas, ARect.Right - (4 + 5), ARect.Top + (dxBarButtonHeight - 7) div 2, Selected); + end + else + if (AItem is TCustomdxBarSubItem) and not (AItem is TCustomdxBarContainerItem) or + (AItem is TCustomdxBarContainerItem) and not TCustomdxBarContainerItemAccess(AItem).HideWhenRun then + DrawSubItemArrow(ACanvas, ARect.Right - (4 + 5), ARect.Top + (dxBarButtonHeight - 7) div 2, Selected); + if Selected then + Office11FrameSelectedRect(Handle, ARect); + end; +end; + +class procedure TdxBarCustomizingFormOffice11Painter.DrawComboBoxButton( + ACanvas: TCanvas; AItem: TdxBarItem; ARect: TRect; ASelected: Boolean); +begin + with ACanvas do + begin + Inc(ARect.Left); + if ASelected then + begin + InflateRect(ARect, 1, 1); + Office11FrameSelectedRect(Handle, ARect); + end + else + begin + Brush.Color := clWindow; + FrameRect(ARect); + Pen.Color := Brush.Color; + end; + if not ASelected then + begin + MoveTo(ARect.Left - 1, ARect.Top); + LineTo(ARect.Left - 1, ARect.Bottom); + end; + InflateRect(ARect, -1, -1); + if ASelected then + Brush.Color := dxOffice11ToolbarSelectedColor + else + Brush.Color := dxOffice11OwnerControlDownedColor; + FillRect(ARect); + Pen.Color := clBtnText; + if ASelected then + InflateRect(ARect, -1, -1); + InflateRect(ARect, 2, 0); + DrawItemArrow(Handle, ARect, adDown, True, ASelected and IsHighContrastWhite, True{Flat}); + end; +end; + +class function TdxBarCustomizingFormOffice11Painter.FontColors( + Selected: Boolean): TColor; +begin + Result := dxOffice11TextEnabledColor; + if Selected and IsHighContrastWhite then + Result := clBtnFace; +end; + +class function TdxBarCustomizingFormOffice11Painter.GetButtonColor( + AItem: TdxBarItem; ASelected: Boolean): Integer; +begin + Result := dxOffice11OwnerControlDownedColor; +end; + +class procedure TdxBarCustomizingFormOffice11Painter.DrawEditEdge(ACanvas: TCanvas; + var AItemRect: TRect; AItem: TdxCustomBarEdit; ASelected: Boolean); +begin + ACanvas.Brush.Color := BrushColors(False, AItem); + if ASelected then + Office11FrameSelectedRect(ACanvas.Handle, AItemRect) + else + Windows.FrameRect(ACanvas.Handle, AItemRect, dxOffice11OwnerControlDownedBrush); + InflateRect(AItemRect, -1, -1); +end; + +class procedure TdxBarCustomizingFormOffice11Painter.InternalDrawCaption(ACanvas: TCanvas; + var ATextRect: TRect; const AText: string; AItem: TdxCustomBarEdit; ASelected: Boolean); +const + ATextOffset = 10; +var + AItemHeight: Integer; + ARect, AIndentRect: TRect; +begin + ARect := ATextRect; + AItemHeight := ARect.Bottom - ARect.Top; + + ACanvas.Brush.Color := BrushColors(ASelected, AItem); + Inc(ARect.Right, 1 + 5 + ATextOffset + AItemHeight); + if ASelected then + begin + ACanvas.FillRect(ARect); + + Inc(ARect.Right); + Office11FrameSelectedRect(ACanvas.Handle, ARect); + Dec(ARect.Right); + end + else + begin + AIndentRect := ARect; + AIndentRect.Right := AIndentRect.Left + AItemHeight; + FillTubeGradientRect(ACanvas.Handle, AIndentRect, dxOffice11MenuIndentColor1, dxOffice11MenuIndentColor2, True); + + Inc(ARect.Left, AItemHeight); + ACanvas.FillRect(ARect); + Dec(ARect.Left, AItemHeight); + end; + Inc(ARect.Left, ATextOffset + AItemHeight); + ACanvas.Font.Color := FontColors(ASelected); + cxDrawText(ACanvas.Handle, AText, ARect, DT_NOCLIP or DT_NOPREFIX or DT_SINGLELINE or DT_LEFT or DT_VCENTER); + + ATextRect.Right := ARect.Right; +end; + +{ TdxBarCustomizingFormXPPainter } + +class procedure TdxBarCustomizingFormXPPainter.DrawButtonOrSubItem(ACanvas: TCanvas; + ARect: TRect; AItem: TdxBarItem; ACaption: string; Selected: Boolean); +var + R: TRect; + S: string; + IsGlyph: Boolean; + W, H: Integer; + FullImageRect: TRect; + ATheme: TdxTheme; +begin + R := ARect; + with TdxBarItemAccess(AItem) do + IsGlyph := not Glyph.Empty or CurImageIndexLinked; + with ACanvas, R do + begin + Right := Left + dxBarButtonWidth; + Brush.Color := BrushColors(not IsGlyph and Selected, AItem); + FillRect(R); + Pen.Color := Brush.Color; + MoveTo(Right, Top); + LineTo(Right, Bottom); + + if IsGlyph then + begin + if Selected and (AItem is TdxBarButton) then + begin + // xp + ATheme := OpenTheme(totToolBar); + DrawThemeBackground(ATheme, Handle, TP_BUTTON, TS_HOT, @R); + // xp end + end; + + if AItem.Glyph.Empty then + with AItem.GetCurImages do + begin + W := Width; + H := Height; + end + else + with AItem.Glyph do + begin + W := Width; + H := Height; + end; + with R do + R := Bounds((Left + Right - W) div 2, (Top + Bottom - H) div 2, W, H); + FullImageRect := R; + + TransparentDraw(Handle, 0, FullImageRect, R, AItem.Glyph, + AItem.GetCurImages, AItem.ImageIndex, AItem.BarManager.ImageListBkColor, + True, False, False{Flat}, Selected, False, False, False{Shadow}, False{Faded}, + AItem.BarManager.ImageOptions.UseLeftBottomPixelAsTransparent); + end; + + Font.Color := FontColors(Selected); + Brush.Color := BrushColors(Selected, AItem); + R := ARect; + if (AItem is TdxBarButton) and (TdxBarButton(AItem).ButtonStyle = bsDropDown) then + Dec(R.Right, 4 + 4 + 5); + Inc(Left, dxBarButtonWidth + 1); + FillRect(R); + Inc(Left, 2); + S := ACaption; + if (AItem is TCustomdxBarContainerItem) and + TCustomdxBarContainerItemAccess(AItem).HideWhenRun then + S := '(' + ACaption + ')'; + cxDrawText(Handle, S, R, DT_NOCLIP or DT_NOPREFIX or DT_SINGLELINE or DT_LEFT or DT_VCENTER); + + if (AItem is TdxBarButton) and (TdxBarButton(AItem).ButtonStyle = bsDropDown) then + begin + R.Left := R.Right; + R.Right := ARect.Right; + Brush.Color := BrushColors(False, AItem); + FillRect(R); + // xp + ATheme := OpenTheme(totToolBar); + DrawThemeBackground(ATheme, Handle, TP_BUTTON, TS_HOT, @R); + // xp end + Font.Color := FontColors(False); + DrawSubItemArrow(ACanvas, ARect.Right - (4 + 5), ARect.Top + (dxBarButtonHeight - 7) div 2, False); + end + else + if (AItem is TCustomdxBarSubItem) and not (AItem is TCustomdxBarContainerItem) or + (AItem is TCustomdxBarContainerItem) and not TCustomdxBarContainerItemAccess(AItem).HideWhenRun then + DrawSubItemArrow(ACanvas, ARect.Right - (4 + 5), ARect.Top + (dxBarButtonHeight - 7) div 2, False); + end; +end; + +class procedure TdxBarCustomizingFormXPPainter.DrawComboBoxButton( + ACanvas: TCanvas; AItem: TdxBarItem; ARect: TRect; ASelected: Boolean); +begin + DrawThemeBackground(OpenTheme(totComboBox), ACanvas.Handle, CP_DROPDOWNBUTTON, + CBXS_NORMAL, @ARect); +end; + +class procedure TdxBarCustomizingFormXPPainter.DrawFocusedRect(ACanvas: TCanvas; + ARect: TRect; AItem: TdxBarItem); +var + IsGlyph: Boolean; +begin +// InflateRect(ARect, -1, -1); + with TdxBarItemAccess(AItem) do + IsGlyph := not (AItem is TdxBarEdit) and (not Glyph.Empty or CurImageIndexLinked); + if IsGlyph then + Inc(ARect.Left, dxBarButtonWidth + 1); + inherited DrawFocusedRect(ACanvas, ARect, AItem); +end; + +class function TdxBarCustomizingFormXPPainter.GetComboBoxButtonWidth: Integer; +begin + Result := dxBarComboBoxArrowWidth + 2; +end; + +class procedure TdxBarCustomizingFormXPPainter.DrawEditEdge(ACanvas: TCanvas; + var AItemRect: TRect; AItem: TdxCustomBarEdit; ASelected: Boolean); +begin + ACanvas.FrameRect(AItemRect); + InflateRect(AItemRect, -1, -1); +end; + +class procedure TdxBarCustomizingFormXPPainter.InternalDrawEditContent(ACanvas: TCanvas; + AItemRect: TRect; AItem: TdxCustomBarEdit; ASelected: Boolean); +var + AClipRgn: HRGN; + AClipRgnExists: Boolean; +begin + InflateRect(AItemRect, -1, -1); + inherited InternalDrawEditContent(ACanvas, AItemRect, AItem, ASelected); + + SaveClipRgn(ACanvas.Handle, AClipRgn, AClipRgnExists); + with AItemRect do + ExcludeClipRect(ACanvas.Handle, Left, Top, Right, Bottom); + InflateRect(AItemRect, 1, 1); + DrawThemeBackground(OpenTheme(totEdit), ACanvas.Handle, EP_EDITTEXT, ETS_NORMAL, AItemRect); + RestoreClipRgn(ACanvas.Handle, AClipRgn, AClipRgnExists); +end; + +{ TdxBarRuntimeSelectionController } + +constructor TdxBarRunTimeSelectionController.Create; +begin + inherited Create; + FSelectionList := TdxComponentList.Create; + FSelectionList.OnNotify := SelectionListNotify; + FSelectionList.OnComponentListChanged := SelectionListChanged; +end; + +destructor TdxBarRuntimeSelectionController.Destroy; +begin + FreeAndNil(FSelectionList); + inherited; +end; + +function TdxBarRunTimeSelectionController.CanDeleteComponent( + AComponent: TComponent): Boolean; +begin + Result := True; +end; + +procedure TdxBarRunTimeSelectionController.GetSelection(AList: TList); +var + I: Integer; +begin + for I := 0 to FSelectionList.Count - 1 do + AList.Add(FSelectionList[I]); +end; + +function TdxBarRunTimeSelectionController.GetSelectionStatus(AComponent: TPersistent): TdxBarSelectionStatus; +begin + if IsComponentSelected(AComponent) then + Result := ssActiveSelected + else + Result := ssUnselected; +end; + +function TdxBarRunTimeSelectionController.IsComponentSelected(AComponent: TPersistent): Boolean; +begin + Result := FSelectionList.IndexOf(TComponent(AComponent)) <> -1; +end; + +procedure TdxBarRunTimeSelectionController.SelectComponent(AComponent: TPersistent; ASelectionOperation: TdxBarSelectionOperation = soExclusive); +begin + case ASelectionOperation of + soAdd, soExclusive: AddSelection(TComponent(AComponent)); + end; +end; + +procedure TdxBarRunTimeSelectionController.SetSelection(AList: TList); +var + I: Integer; +begin + FSelectionList.BeginUpdate; + try + for I := 0 to AList.Count - 1 do + AddSelection(AList[I]); + finally + FSelectionList.EndUpdate; + end; +end; + +procedure TdxBarRunTimeSelectionController.ShowDefaultEventHandler(AItem: TdxBarItem); +begin + // do nothing +end; + +function TdxBarRunTimeSelectionController.UniqueName(const BaseName: string): string; +begin + Result := ''; +end; + +procedure TdxBarRunTimeSelectionController.AddSelection(AComponent: TComponent); +var + I: Integer; + ABaseClass: TComponentClass; +begin + if FSelectionList.IndexOf(AComponent) = -1 then + begin + if AComponent is TdxBar then + ABaseClass := TdxBar + else + ABaseClass := TdxBarItem; + + for I := FSelectionList.Count - 1 downto 0 do + if FSelectionList[I].InheritsFrom(ABaseClass) then + FSelectionList.Delete(I); + if AComponent <> nil then + FSelectionList.Add(AComponent); + end; +end; + +procedure TdxBarRunTimeSelectionController.SelectionListNotify(Sender: TObject; + AComponent: TComponent; AAction: TListNotification); +var + ASelectableItem: IdxBarSelectableItem; +begin + if IsSelectableItem(AComponent, ASelectableItem) then + ASelectableItem.SelectionChanged; +end; + +procedure TdxBarRunTimeSelectionController.SelectionListChanged(Sender: TObject; + AComponent: TComponent; AAction: TcxComponentCollectionNotification); +begin + if Assigned(OnSelectionChanged) then + OnSelectionChanged(Self); +end; + +{ TdxBarCustomizingForm } + +constructor TdxBarCustomizingForm.CreateEx(ABarManager: TdxBarManager); + + procedure PrepareMenuAnimationsLabel(ALabel: TLabel; ComboBox: TComboBox); + begin + with ALabel do + begin + Caption := cxGetResourceString(@dxSBAR_MENUANIMATIONS); + if Left + Width + 10 > ComboBox.Left then + ComboBox.Left := Left + Width + 10; + end; + end; + + procedure PrepareMenuAnimationsComboBox(ComboBox: TComboBox); + var + W, I: Integer; + begin + with ComboBox, Items do + begin + Clear; + Add(cxGetResourceString(@dxSBAR_MENUANIM1)); + Add(cxGetResourceString(@dxSBAR_MENUANIM2)); + Add(cxGetResourceString(@dxSBAR_MENUANIM3)); + Add(cxGetResourceString(@dxSBAR_MENUANIM4)); + Add(cxGetResourceString(@dxSBAR_MENUANIM5)); + W := 0; + for I := 0 to Count - 1 do + W := Max(W, cxTextWidth(Font, Items[I])); + Width := W + 54; + end; + end; + +{$IFDEF DELPHI7} + procedure SetupBevelSize(ALabel: TLabel; ABevel: TBevel); + begin + with ABevel, BoundsRect do + BoundsRect := Rect(ALabel.BoundsRect.Right, Top, Right, Bottom); + end; +{$ENDIF} + + procedure PrepareToolBarsSheet; + begin + tsToolbars.Caption := cxGetResourceString(@dxSBAR_TABSHEET1); + + SetNewWindowProc(lbBarsList, BarListBoxWndProc, FBarListBoxOldWndProc); + lbBarsList.ItemHeight := Canvas.TextHeight('Zg') + 2; + lbBarsList.MultiSelect := BarManager.Designing; + + BBarReset.Visible := not BarManager.Designing and TdxBarManagerAccess(BarManager).CanReset; + aNewToolBar.Caption := cxGetResourceString(@dxSBAR_TNEW); + aRenameToolBar.Caption := cxGetResourceString(@dxSBAR_TRENAME); + aDeleteToolBar.Caption := cxGetResourceString(@dxSBAR_TDELETE); + aResetToolBar.Caption := cxGetResourceString(@dxSBAR_TRESET); + + LabelToobars.FocusControl := lbBarsList; + LabelToobars.Caption := cxGetResourceString(@dxSBAR_TOOLBARS); + + FBarsOldChangeEvent := BarManager.Bars.OnChange; + BarManager.Bars.OnChange := BarsChange; + end; + + procedure PrepareItemsSheet; + begin + tsItems.Caption := cxGetResourceString(@dxSBAR_TABSHEET2); + + SetNewWindowProc(lbCategories, CategoryListBoxWndProc, FCategoryListBoxOldWndProc); + SetNewWindowProc(lbItems, ItemListBoxWndProc, FItemListBoxOldWndProc); + lbItems.ItemHeight := dxBarButtonHeight; + lbItems.ControlStyle := lbItems.ControlStyle + [csOpaque] - [csCaptureMouse]; + lbItems.MultiSelect := BarManager.Designing; + LabelCommands.FocusControl := lbItems; + + if BarManager.Designing then + begin + with TCheckableButton.Create(Self) do + begin + Caption := cxGetResourceString(@dxSBAR_MODIFY); + BoundsRect := CategoriesPopupButtonPlace.BoundsRect; + AdjustWithControl(LabelCategories); + DropDownMenu := CategoriesPopupMenu; + Parent := CategoriesPopupButtonPlace.Parent; + end; + with TCheckableButton.Create(Self) do + begin + Caption := cxGetResourceString(@dxSBAR_MODIFY); + BoundsRect := CommandsPopupButtonPlace.BoundsRect; + AdjustWithControl(LabelCommands); + DropDownMenu := CommandsPopupMenu; + Parent := CommandsPopupButtonPlace.Parent; + end; + end; + CategoriesPopupButtonPlace.Free; + CommandsPopupButtonPlace.Free; + + LabelCategories.Caption := cxGetResourceString(@dxSBAR_CATEGORIES); + LabelCommands.Caption := cxGetResourceString(@dxSBAR_COMMANDS); + LabelDescription.Caption := cxGetResourceString(@dxSBAR_DESCRIPTION); + + CategoriesAdd.Caption := cxGetResourceString(@dxSBAR_ADDEX); + CategoriesInsert.Caption := cxGetResourceString(@dxSBAR_INSERTEX); + CategoriesRename.Caption := cxGetResourceString(@dxSBAR_RENAMEEX); + CategoriesVisible.Caption := cxGetResourceString(@dxSBAR_VISIBLE); + CategoriesDelete.Caption := cxGetResourceString(@dxSBAR_DELETE); + + CommandsAdd.Caption := cxGetResourceString(@dxSBAR_ADDEX); + CommandsDelete.Caption := cxGetResourceString(@dxSBAR_DELETE); + CommandsClear.Caption := cxGetResourceString(@dxSBAR_CLEAR); + CommandsMoveUp.Caption := cxGetResourceString(@dxSBAR_MOVEUP); + CommandsMoveDown.Caption := cxGetResourceString(@dxSBAR_MOVEDOWN); + CommandsSubMenuEditor.Caption := cxGetResourceString(@dxSBAR_SUBMENUEDITOR); + + FItemsOldChangeEvent := TdxBarManagerAccess(BarManager).ItemList.OnComponentListChanged; + TdxBarManagerAccess(BarManager).ItemList.OnComponentListChanged := ItemsChange; + end; + + procedure PrepareOptionsSheet; + begin + tsOptions.Caption := cxGetResourceString(@dxSBAR_TABSHEET3); + + if BarManager.GetPaintStyle = bmsStandard then + begin + CBLargeIcons.Caption := cxGetResourceString(@dxSBAR_LARGEICONS); + CBHint1.Caption := cxGetResourceString(@dxSBAR_HINTOPT1); + CBHint2.Caption := cxGetResourceString(@dxSBAR_HINTOPT2); + PrepareMenuAnimationsLabel(LabelMenuAnimations, ComboBoxMenuAnimations); + PrepareMenuAnimationsComboBox(ComboBoxMenuAnimations); + end + else + begin + Label3.Caption := cxGetResourceString(@dxSBAR_PERSMENUSANDTOOLBARS); + CBMenusShowRecentItemsFirst.Caption := cxGetResourceString(@dxSBAR_MENUSSHOWRECENTITEMS); + CBShowFullMenusAfterDelay.Caption := cxGetResourceString(@dxSBAR_SHOWFULLMENUSAFTERDELAY); + with BResetUsageData do + begin + Caption := cxGetResourceString(@dxSBAR_RESETUSAGEDATA); + Width := cxTextWidth(Font, GetTextOf(Caption)) + 17; + end; + Label2.Caption := cxGetResourceString(@dxSBAR_OTHEROPTIONS); + CBLargeIconsEx.Caption := cxGetResourceString(@dxSBAR_LARGEICONS); + CBHint1Ex.Caption := cxGetResourceString(@dxSBAR_HINTOPT1); + CBHint2Ex.Caption := cxGetResourceString(@dxSBAR_HINTOPT2); + PrepareMenuAnimationsLabel(Label1, ComboBoxMenuAnimationsEx); + PrepareMenuAnimationsComboBox(ComboBoxMenuAnimationsEx); + end; + end; + + procedure PrepareCommandsSheet; + begin + tsCommands.TabVisible := BarManager.Designing; + SetNewWindowProc(LAllCommands, CommandListBoxWndProc, FCommandListBoxOldWndProc); + end; + + procedure PrepareGroupsSheet; + begin + tsGroups.TabVisible := BarManager.Designing; + SetNewWindowProc(lbGroups, GroupListBoxWndProc, FGroupListBoxOldWndProc); + SetNewWindowProc(lbGroupItems, GroupItemListBoxWndProc, FGroupItemListBoxOldWndProc); + FGroupsOldChangeEvent := TdxBarManagerAccess(BarManager).GroupList.OnComponentListChanged; + TdxBarManagerAccess(BarManager).GroupList.OnComponentListChanged := GroupsChange; + end; + + procedure PrepareKeyTipsSheet; + + procedure GetKeyTipsTree(AContainer: IdxBarAccessibilityHelper; + ANodes: TTreeNodes; AParentNode: TTreeNode); + var + AChild, AContainerHelper: TdxBarAccessibilityHelper; + I: Integer; + begin + AContainerHelper := AContainer.GetBarHelper; + if AContainerHelper.Selectable then + AParentNode := ANodes.AddChild(AParentNode, AContainerHelper.OwnerObject.ClassName); + for I := 0 to AContainerHelper.ChildCount - 1 do + begin + AChild := AContainerHelper.Childs[I]; + GetKeyTipsTree(AChild, ANodes, AParentNode); + end; + end; + + var + AKeyTipWindowsManager: IdxBarKeyTipWindowsManager; + ARootAccessibleObject: IdxBarAccessibilityHelper; + begin + ARootAccessibleObject := GetRootAccessibleObject(BarManager.Owner.Handle); + if (ARootAccessibleObject <> nil) and ARootAccessibleObject.AreKeyTipsSupported(AKeyTipWindowsManager) then + begin + GetKeyTipsTree(ARootAccessibleObject, tvKeyTips.Items, nil); + end; + end; + + procedure PrepareButtons; + begin + BResetUsageData.Enabled := not BarManager.Designing; + with BClose do + begin + Caption := cxGetResourceString(@dxSBAR_CLOSE); + Width := cxTextWidth(Font, GetTextOf(Caption)) + 49; + Left := Parent.Width - Panel3.Width - Width; + end; + UpdateHelpButton; + end; + +var + ARunTimeSelectionController: TdxBarRunTimeSelectionController; +begin + BarManager := ABarManager; + inherited Create(nil); + +{$IFDEF DELPHI9} + PopupMode := pmAuto; +{$ENDIF} + + PrepareCustomizationFormFont(Self, BarManager); + BarManager1.Font := BarManager.Font; + + // Global + + if not BarManager.Designing then + begin + ARunTimeSelectionController := TdxBarRunTimeSelectionController.Create; + ARunTimeSelectionController.OnSelectionChanged := DesignSelectionChanged; + TdxBarManagerAccess(BarManager).FdxBarDesignHelper := ARunTimeSelectionController; + if BarManager.Bars.Count > 0 then + SynchronizeDesigner(BarManager.Bars[0]); + end; + FSelectedGroupItems := TdxBarComponentList.Create(False); + + Caption := cxGetResourceString(@dxSBAR_CAPTION); + PrepareButtons; + + PrepareToolBarsSheet; + PrepareItemsSheet; + PrepareOptionsSheet; + PrepareCommandsSheet; + PrepareGroupsSheet; + PrepareKeyTipsSheet; + + BarManagerStyleChanged; + +{$IFDEF DELPHI7} + SetupBevelSize(LabelDescription, Bevel1); + SetupBevelSize(Label3, Bevel3); + SetupBevelSize(Label2, Bevel2); +{$ENDIF} +end; + +destructor TdxBarCustomizingForm.Destroy; +begin + FreeAndNil(FSelectedGroupItems); + if not BarManager.Designing then + TdxBarManagerAccess(BarManager).FdxBarDesignHelper := nil; + inherited; + +//#DG FdxBarCustomizingForm := nil; + +//#DG if not (csDestroying in ABarManager.ComponentState) and ABarManager.Designing then +//#DG dxBarDesigner.SelectComponent(ABarManager, ABarManager); +end; + +procedure TdxBarCustomizingForm.MouseWheelHandler(var Message: TMessage); +var + P: TPoint; + R: TRect; + H: HWND; + AControl: TWinControl; + + I, AScrollCode, AScrollLines: Integer; +begin + P := SmallPointToPoint(TWMMouseWheel(Message).Pos); + H := WindowFromPoint(P); + if H <> 0 then + begin + GetWindowRect(H, R); + AControl := FindControl(H); + if (AControl is TCustomListBox) and PtInRect(R, P) and + not (ActiveControl is TCustomListBox) then + begin + if SmallInt(HIWORD(Message.wParam)) > 0 then + AScrollCode := SB_LINEUP + else + AScrollCode := SB_LINEDOWN; + AScrollLines := {$IFDEF DELPHI4}Mouse.WheelScrollLines{$ELSE}3{$ENDIF}; + for I := 0 to AScrollLines - 1 do + SendMessage(AControl.Handle, WM_VSCROLL, AScrollCode, 0); + Exit; + end; + end; + inherited MouseWheelHandler(Message); +end; + +procedure TdxBarCustomizingForm.DeleteSelectedObjects(AListBox: TListBox; + ADeleteProc: TNotifyEvent = nil; ASynchronizeDesigner: Boolean = True); +var + I: Integer; + ASelectedObjects: TObjectList; + ANextObject: TObject; +begin + ANextObject := GetNextSelectedObject(AListBox); + ASelectedObjects := TObjectList.Create(False); + try + GetSelection(AListBox, ASelectedObjects); +//#DG - it was attempt to resolve blinking SetSelection(AListBox, ANextObject); +//#DG - to resolve blinking SetSelection(AListBox, TObject(nil)); + AListBox.Items.BeginUpdate; + try + for I := ASelectedObjects.Count - 1 downto 0 do + if not Assigned(ADeleteProc) then + ASelectedObjects[I].Free + else + ADeleteProc(ASelectedObjects[I]); + finally + AListBox.Items.EndUpdate; + end; + SetSelection(AListBox, ANextObject); // must be after deleting, because deleting causes update of ListBox + if ASynchronizeDesigner then + SynchronizeDesigner(AListBox); + finally + ASelectedObjects.Free; + TdxBarManagerAccess(BarManager).DesignerModified; + end; +end; + +procedure TdxBarCustomizingForm.EnableWindows(AEnable: Boolean); +var + I: Integer; + ADisabledParent: TWinControl; +begin + if AEnable then + begin + for I := 0 to dxBarManagerList.Count - 1 do + TdxBarManagerAccess(dxBarManagerList[I]).EnableFloatToolBars; + cxContainer.EnableWindows(FDisabledWindows); + FreeAndNil(FDisabledWindows); + end + else + begin + FDisabledWindows := TList.Create; + for I := 0 to dxBarManagerList.Count - 1 do + begin +{#DG - because can close master form} + if dxBarManagerList[I].Designing then +//#DG ADisabledParent := dxBarManagerList[I].Owner {#DG - because can close master form in D7} + ADisabledParent := dxBarManagerList[I].ParentForm + else + ADisabledParent := dxBarManagerList[I].MasterForm; + + if (ADisabledParent <> Self) and ADisabledParent.HandleAllocated then + begin + if dxBarManagerList[I] <> BarManager then + TdxBarManagerAccess(dxBarManagerList[I]).DisableFloatToolBars; + DisableWindow(FDisabledWindows, ADisabledParent.Handle); + end; + end; + end; +end; + +function TdxBarCustomizingForm.GetVisibleItemsCount(AListBox: TListBox): Integer; +begin + Result := AListBox.Height div AListBox.ItemHeight; +end; + +function TdxBarCustomizingForm.GetExclusiveObject(AListBox: TListBox): TObject; +var + AIndex: Integer; +begin + if AListBox.MultiSelect then + if AListBox.SelCount = 1 then + SendMessage(AListBox.Handle, LB_GETSELITEMS, 1, Integer(@AIndex)) + else + AIndex := -1 + else + AIndex := AListBox.ItemIndex; + + Result := GetObjectFromListBox(AListBox, AIndex); +end; + +function TdxBarCustomizingForm.GetObjectFromListBox(AListBox: TListBox; AIndex: Integer): TObject; +begin + if (0 <= AIndex) and (AIndex < AListBox.Items.Count) then + Result := AListBox.Items.Objects[AIndex] + else + Result := nil; +end; + +function TdxBarCustomizingForm.GetNextSelectedObject(AListBox: TListBox): TObject; +var + I, ASelectedIndex: Integer; +begin + ASelectedIndex := -1; + for I := AListBox.ItemIndex + 1 to AListBox.Items.Count - 1 do + if not AListBox.Selected[I] then + begin + ASelectedIndex := I; + Break; + end; + if ASelectedIndex = -1 then + for I := AListBox.ItemIndex - 1 downto 0 do + if not AListBox.Selected[I] then + begin + ASelectedIndex := I; + Break; + end; + Result := GetObjectFromListBox(AListBox, ASelectedIndex); +end; + +function TdxBarCustomizingForm.GetPainterClass: TdxBarCustomizingFormPainterClass; +begin + if BarManager.PainterClass = TdxBarXPPainter then + Result := TdxBarCustomizingFormXPPainter + else + if BarManager.PainterClass = TdxBarOffice11Painter then + Result := TdxBarCustomizingFormOffice11Painter + else + if BarManager.PainterClass = TdxBarFlatPainter then + Result := TdxBarCustomizingFormFlatPainter + else + Result := TdxBarCustomizingFormStandardPainter; +end; + +function TdxBarCustomizingForm.GetSelCount(AListBox: TListBox): Integer; +begin + if AListBox.MultiSelect then + Result := AListBox.SelCount + else + if AListBox.ItemIndex <> -1 then + Result := 1 + else + Result := 0; +end; + +procedure TdxBarCustomizingForm.GetSelection(AListBox: TListBox; AList: TList); +var + I: Integer; +begin + if AListBox <> nil then + for I := 0 to AListBox.Items.Count - 1 do + if AListBox.Selected[I] then + AList.Add(AListBox.Items.Objects[I]); +end; + +procedure TdxBarCustomizingForm.MoveItems(AListBox: TListBox; + ABarComponentList: TdxBarComponentList; ADirection: Integer); +const + AMoveUp = -1; + AMoveDown = 1; +var + I, J, K: Integer; + ASelectedItems: TList; +begin + ASelectedItems := TList.Create; + try + GetSelection(AListBox, ASelectedItems); + ABarComponentList.BeginUpdate; + try + K := 0; + case ADirection of + AMoveUp: + for I := 0 to ASelectedItems.Count - 1 do + begin + J := ABarComponentList.IndexOf(ASelectedItems[I]); + if I = 0 then + begin + K := J - 1; + if K < 0 then + K := 0; + ABarComponentList.Move(J, K); + end + else + ABarComponentList.Move(J, K + I); + end; + AMoveDown: + for I := ASelectedItems.Count - 1 downto 0 do + begin + J := ABarComponentList.IndexOf(ASelectedItems[I]); + if I = ASelectedItems.Count - 1 then + begin + K := J + 1; + if K > ABarComponentList.Count - 1 then + K := ABarComponentList.Count - 1; + ABarComponentList.Move(J, K); + Dec(K, ASelectedItems.Count - 1); + end + else + ABarComponentList.Move(J, K + I); + end; + end; + finally + ABarComponentList.EndUpdate; + end; + finally + ASelectedItems.Free; + end; + TdxBarManagerAccess(BarManager).DesignerModified; +end; + +procedure TdxBarCustomizingForm.SelectBarManager; +begin + if not TdxBarManagerAccess(BarManager).IsDestroying then + (BarManager as IdxBarDesigner).SelectComponent(BarManager); +end; + +procedure TdxBarCustomizingForm.SetNewWindowProc(AControl: TControl; + ANewWindowProc: TWndMethod; out AOldWindowProc: TWndMethod); +begin + AOldWindowProc := AControl.WindowProc; + AControl.WindowProc := ANewWindowProc; +end; + +procedure TdxBarCustomizingForm.SetSelection(AListBox: TListBox; AList: TList); +var + I, AIndex: Integer; +begin + AListBox.Items.BeginUpdate; + try + if AListBox.MultiSelect then + for I := 0 to AListBox.Items.Count - 1 do + AListBox.Selected[I] := AList.IndexOf(AListBox.Items.Objects[I]) <> -1 + else + begin + AIndex := -1; + for I := 0 to AListBox.Items.Count - 1 do + if AList.IndexOf(AListBox.Items.Objects[I]) <> -1 then + AIndex := I; + AListBox.ItemIndex := AIndex; + end; + UpdateTopIndex(AListBox); + finally + AListBox.Items.EndUpdate; + if not AListBox.MultiSelect then + SendMessage(AListBox.Handle, WM_NCPAINT, 0, 0); + end; +end; + +procedure TdxBarCustomizingForm.SetSelection(AListBox: TListBox; AObject: TObject); +var + ASelectedObjects: TList; +begin + ASelectedObjects := TList.Create; + try + ASelectedObjects.Add(AObject); + SetSelection(AListBox, ASelectedObjects); + finally + ASelectedObjects.Free; + end; +end; + +procedure TdxBarCustomizingForm.SynchronizeDesigner(ANewSelection: IdxBarSelectableItem); +begin + if ANewSelection <> nil then + ANewSelection.SelectComponent + else + SelectBarManager; +end; + +procedure TdxBarCustomizingForm.SynchronizeDesigner(AListBox: TListBox); +var + ASelectedObjects: TObjectList; +begin + FAlreadySynchronous := AListBox; + try +//#DG AListBox.Items.BeginUpdate; + try + ASelectedObjects := TObjectList.Create(False); + try + GetSelection(AListBox, ASelectedObjects); + if ASelectedObjects.Count > 0 then + (BarManager as IdxBarDesigner).SetSelection(ASelectedObjects) + else + SelectBarManager; + finally + ASelectedObjects.Free; + end; + finally +//#DG AListBox.Items.EndUpdate; + end; + finally + FAlreadySynchronous := nil; + end; +end; + +procedure TdxBarCustomizingForm.SynchronizeListBox(AListBox: TListBox; + AChangedObject: TObject = nil; AAction: TcxComponentCollectionNotification = ccnChanged); +var + AObjectIndex, APrevTopIndex: Integer; + AIsSelected: Boolean; +begin + if not TdxBarManagerAccess(BarManager).IsDestroying then + begin + AListBox.Items.BeginUpdate; + try + APrevTopIndex := AListBox.TopIndex; + if (AAction = ccnChanged) and (AChangedObject <> nil) then + begin + AObjectIndex := AListBox.Items.IndexOfObject(AChangedObject); + if AObjectIndex <> -1 then + begin + AIsSelected := AListBox.Selected[AObjectIndex]; + SendMessage(AListBox.Handle, LB_SYNCHRONYZE, Integer(AChangedObject), AObjectIndex); + if AListBox.MultiSelect then + AListBox.Selected[AObjectIndex] := AIsSelected; + end; + SendMessage(AListBox.Handle, LB_UPDATEEVENTS, 0, 0); + end + else + begin + AListBox.Items.Clear; + SendMessage(AListBox.Handle, LB_SYNCHRONYZE, 0, 0); + SendMessage(AListBox.Handle, LB_SYNCHRONYZESELECTION, 0, 0); + end; + AListBox.TopIndex := APrevTopIndex; + UpdateTopIndex(AListBox); + finally + AListBox.Items.EndUpdate; + end; + end; +end; + +procedure TdxBarCustomizingForm.SynchronizeListBoxes; +begin + SynchronizeListBox(lbBarsList); + SynchronizeListBox(lbCategories); + SynchronizeListBox(lbItems); + SynchronizeListBox(LAllCommands); + SynchronizeListBox(lbGroups); +end; + +procedure TdxBarCustomizingForm.SynchronizeListBoxSelection(AListBox: TListBox); +var + AList: TList; +begin + if FAlreadySynchronous <> AListBox then + begin + AList := TList.Create; + try + (BarManager as IdxBarDesigner).GetSelection(AList); + SetSelection(AListBox, AList); + finally + AList.Free; + end; + end; + SendMessage(AListBox.Handle, LB_UPDATEEVENTS, 0, 0); +end; + +procedure TdxBarCustomizingForm.UpdateCommonEvents(AListBox: TListBox; + AAddAction, ADeleteAction, AMoveUpAction, AMoveDownAction: TAction; + ADeletePermissiveProc: TdxBarPermissiveProc = nil); +var + I: Integer; + ASelectedObjects: TList; + AMoveEnabled: Boolean; +begin + ASelectedObjects := TList.Create; + try + GetSelection(AListBox, ASelectedObjects); + + if AAddAction <> nil then + AAddAction.Enabled := TdxBarManagerAccess(BarManager).CanAddComponents; + + if ADeleteAction <> nil then + begin + ADeleteAction.Enabled := GetSelCount(AListBox) > 0; + for I := 0 to ASelectedObjects.Count - 1 do + begin + ADeleteAction.Enabled := ADeleteAction.Enabled and + (not Assigned(ADeletePermissiveProc) and IdxBarDesigner(BarManager).CanDeleteComponent(ASelectedObjects[I]) or + Assigned(ADeletePermissiveProc) and ADeletePermissiveProc(ASelectedObjects[I])); + end; + end; + + if AMoveUpAction <> nil then + begin + AMoveEnabled := False; + for I := 0 to ASelectedObjects.Count - 1 do + if AListBox.Items.IndexOfObject(ASelectedObjects[I]) <> I then + begin + AMoveEnabled := True; + Break; + end; + AMoveUpAction.Enabled := AMoveEnabled; + end; + + if AMoveDownAction <> nil then + begin + AMoveEnabled := False; + for I := 0 to ASelectedObjects.Count - 1 do + if AListBox.Items.IndexOfObject(ASelectedObjects[I]) <> + AListBox.Items.Count - ASelectedObjects.Count + I then + begin + AMoveEnabled := True; + Break; + end; + AMoveDownAction.Enabled := AMoveEnabled; + end; + finally + ASelectedObjects.Free; + end; +end; + +procedure TdxBarCustomizingForm.UpdateTopIndex(AListBox: TListBox); + + function GetAnchorIndex: Integer; + var + I: Integer; + begin + Result := -1; + for I := 0 to AListBox.Items.Count - 1 do + if AListBox.Selected[I] then + begin + Result := I; + Break; + end; + end; + +var + AAnchorIndex: Integer; +begin + AAnchorIndex := GetAnchorIndex; + if (AAnchorIndex <> -1) then + if AAnchorIndex < AListBox.TopIndex then + AListBox.TopIndex := AAnchorIndex + else + if AAnchorIndex > (AListBox.TopIndex + GetVisibleItemsCount(AListBox) - 1) then + AListBox.TopIndex := AAnchorIndex - (GetVisibleItemsCount(AListBox) - 1); +end; + +procedure TdxBarCustomizingForm.BarListToggleCheck(AIndex: Integer); +begin + if BarList[AIndex] <> nil then + if TdxBarAccess(BarList[AIndex]).CanClose then + BarList[AIndex].Visible := not BarList[AIndex].Visible + else + MessageBeep(MB_OK); +end; + +procedure TdxBarCustomizingForm.BarListBoxWndProc(var Message: TMessage); + + procedure SynchronizeBarListBox; + var + I: Integer; + ABar: TdxBar; + begin + ABar := TdxBar(Message.WParam); + if ABar = nil then + begin + for I := 0 to BarManager.Bars.Count - 1 do + if BarManager.Designing or not BarManager.Bars[I].Hidden then + lbBarsList.Items.AddObject(BarManager.Bars[I].Caption, BarManager.Bars[I]) + end + else + lbBarsList.Items[Message.LParam] := ABar.Caption; + end; + + procedure UpdateToolBarsEvents; + var + ABar: TdxBar; + begin + ABar := SelectedBar; + aRenameToolBar.Enabled := (ABar <> nil) and not IsBarPredefined(ABar); + aResetToolBar.Enabled := (ABar <> nil) and TdxBarAccess(ABar).CanReset; + UpdateCommonEvents(lbBarsList, aNewToolBar, aDeleteToolBar, nil, nil, CanDeleteBar); + end; + +var + ADIS: PDrawItemStruct; +begin + case Message.Msg of + LB_SYNCHRONYZE: SynchronizeBarListBox; + LB_SYNCHRONYZESELECTION: SynchronizeListBoxSelection(lbBarsList); + LB_UPDATEEVENTS: UpdateToolBarsEvents; + WM_LBUTTONDBLCLK: + if (LOWORD(Message.lParam) < lbBarsList.ItemHeight) then + Message.Msg := WM_LBUTTONDOWN; + CN_DRAWITEM: + begin + ADIS := TWMDrawItem(Message).DrawItemStruct; + Inc(ADIS.rcItem.Left, lbBarsList.ItemHeight); + end; + end; + FBarListBoxOldWndProc(Message); +end; + +procedure TdxBarCustomizingForm.BarsChange(Sender: TObject; + AItem: TcxComponentCollectionItem; AAction: TcxComponentCollectionNotification); +begin + if Assigned(FBarsOldChangeEvent) then + FBarsOldChangeEvent(Sender, AItem, AAction); + SynchronizeListBox(lbBarsList, AItem, AAction); +end; + +function TdxBarCustomizingForm.CanDeleteBar(ABar: TComponent): Boolean; +var + ASelectableItem: IdxBarSelectableItem; +begin + Result := IsSelectableItem(ABar, ASelectableItem) and ASelectableItem.CanDelete; +end; + +function TdxBarCustomizingForm.GetBarList(Index: Integer): TdxBar; +begin + Result := TdxBar(GetObjectFromListBox(lbBarsList, Index)); +end; + +function TdxBarCustomizingForm.GetSelectedBar: TdxBar; +begin + Result := TdxBar(GetExclusiveObject(lbBarsList)); +end; + +function TdxBarCustomizingForm.IsBarPredefined(ABar: TdxBar): Boolean; +begin + Result := not BarManager.Designing and ABar.IsPredefined; +end; + +function TdxBarCustomizingForm.CanDeleteSelectedCategory: Boolean; +begin + Result := (lbCategories.Items.Count > 1) and (lbCategories.ItemIndex > -1) and + CanDeleteSelectedCategoryCommands; +end; + +function TdxBarCustomizingForm.CanDeleteSelectedCategoryCommands: Boolean; +var + I: Integer; +begin + Result := True; + for I := 0 to lbItems.Items.Count - 1 do + begin + Result := IdxBarDesigner(BarManager).CanDeleteComponent(ItemList[I]); + if not Result then + Break; + end; +end; + +procedure TdxBarCustomizingForm.CategoryListBoxWndProc(var Message: TMessage); + + procedure SynchronizeCategoryList; + var + I: Integer; + begin + for I := 0 to BarManager.Categories.Count - 1 do + if BarManager.Designing or BarManager.CategoryVisible[I] then + lbCategories.Items.Add(BarManager.Categories[I]); + if lbCategories.Items.Count > 0 then + lbCategories.ItemIndex := 0; + end; + +begin + case Message.Msg of + LB_SYNCHRONYZE: SynchronizeCategoryList; + end; + + FCategoryListBoxOldWndProc(Message); +end; + +function TdxBarCustomizingForm.GetItemList(Index: Integer): TdxBarItem; +begin + Result := TdxBarItem(GetObjectFromListBox(lbItems, Index)); +end; + +function TdxBarCustomizingForm.GetSelectedItem: TdxBarItem; +begin + Result := TdxBarItem(GetExclusiveObject(lbItems)); +end; + +procedure TdxBarCustomizingForm.ItemListBoxWndProc(var Message: TMessage); + + procedure SynchronizeItemList; + var + I: Integer; + AList: TList; + AItem: TdxBarItem; + begin + if lbCategories.ItemIndex > -1 then + begin + AItem := TdxBarItem(Message.WParam); + if AItem = nil then + begin + AList := TList.Create; + try + with TdxBarManagerAccess(BarManager) do + GetItemsByCategory(GetCategoryRealIndex(lbCategories.ItemIndex), AList); + for I := 0 to AList.Count - 1 do + begin + AItem := TdxBarItem(AList[I]); + lbItems.Items.AddObject(AItem.Caption, AItem); + end; + finally + AList.Free; + end; + end + else + lbItems.Items[Message.LParam] := AItem.Caption; + end; + end; + + procedure UpdateItemEvents; + begin + aSubMenuEditor.Enabled := (SelectedItem is TdxBarSubItem) or (SelectedItem is TdxBarContainerItem); + aClearItemList.Enabled := (lbItems.Items.Count > 0) and CanDeleteSelectedCategoryCommands; + UpdateCommonEvents(lbItems, aAddItem, aDeleteItem, aMoveUpItem, aMoveDownItem); + + if SelectedItem = nil then + DescriptionLabel.Caption := '' + else + DescriptionLabel.Caption := SelectedItem.Description; + end; + + procedure WMEraseBkGnd; + var + R: TRect; + begin + R := lbItems.ClientRect; + if lbItems.Items.Count <> 0 then + R.Top := lbItems.ItemRect(lbItems.Items.Count - 1).Bottom; + FillRect(TWMEraseBkGnd(Message).DC, R, lbItems.Brush.Handle); + Message.Result := 1; + end; + + procedure WMMouseActivate; + var + P: TPoint; + AItemIndex: Integer; + begin + FItemListBoxOldWndProc(Message); + GetCursorPos(P); + Windows.ScreenToClient(lbItems.Handle, P); + AItemIndex := lbItems.ItemAtPos(P, True); + if AItemIndex > -1 then + lbItems.ItemIndex := AItemIndex; + end; + + procedure WMSetFocus; + begin + FItemListBoxOldWndProc(Message); + { + if (lbItems.ItemIndex = -1) and (lbItems.Items.Count > 0) then + begin + lbItems.ItemIndex := 0; + SelectItem; + end; + } + end; + + procedure CNDrawItem; + var + State: TOwnerDrawState; + R: TRect; + begin + if lbItems.Items.Count > 0 then + begin + FItemListBoxOldWndProc(Message); + with TWMDrawItem(Message).DrawItemStruct^ do + begin + State := TOwnerDrawState(LongRec(itemState).Lo); + R := rcItem; + if odFocused in State then DrawFocusRect(hDC, R); // hide default draw focus rect + end; + end; + end; + +begin + case Message.Msg of + LB_SYNCHRONYZE: SynchronizeItemList; + LB_SYNCHRONYZESELECTION: SynchronizeListBoxSelection(lbItems); + LB_UPDATEEVENTS: UpdateItemEvents; + + WM_ERASEBKGND: WMEraseBkGnd; + WM_MOUSEACTIVATE: WMMouseActivate; + WM_SETFOCUS: WMSetFocus; + CN_DRAWITEM: CNDrawItem; + else + FItemListBoxOldWndProc(Message); + end; +end; + +procedure TdxBarCustomizingForm.ItemsChange(Sender: TObject; + AComponent: TComponent; AAction: TcxComponentCollectionNotification); +begin + if Assigned(FItemsOldChangeEvent) then + FItemsOldChangeEvent(Sender, AComponent, AAction); + + SynchronizeListBox(lbItems, AComponent, AAction); + SynchronizeListBox(LAllCommands, AComponent, AAction); + SynchronizeListBox(lbGroupItems, AComponent, AAction); +end; + +procedure TdxBarCustomizingForm.MoveItem(Delta: Integer); +begin + MoveItems(lbItems, TdxBarManagerAccess(BarManager).ItemList, Delta); + lbItems.SetFocus; +end; + +procedure TdxBarCustomizingForm.CommandListBoxWndProc(var Message: TMessage); + + procedure SynchronizeCommandList; + var + I: Integer; + AItem: TdxBarItem; + begin + AItem := TdxBarItem(Message.WParam); + if AItem = nil then + begin + SendMessage(LAllCommands.Handle, WM_SETREDRAW, WPARAM(False), 0); + try + for I := 0 to BarManager.ItemCount - 1 do + if (BarManager.Items[I].Category >= 0) and + (not CBShowCommandsWithShortCut.Checked or + (GetPropInfo(BarManager.Items[I].ClassInfo, 'ShortCut') <> nil)) then + LAllCommands.Items.AddObject('', BarManager.Items[I]); + finally + SendMessage(LAllCommands.Handle, WM_SETREDRAW, WPARAM(True), 0); + end; + end; + RefreshAllCommandListBox; + end; + +begin + case Message.Msg of + LB_SYNCHRONYZE: SynchronizeCommandList; + LB_SYNCHRONYZESELECTION: SynchronizeListBoxSelection(LAllCommands); + end; + FCommandListBoxOldWndProc(Message); +end; + +function TdxBarCustomizingForm.GetCommandList(Index: Integer): TdxBarItem; +begin + Result := TdxBarItem(GetObjectFromListBox(LAllCommands, Index)); +end; + +procedure TdxBarCustomizingForm.RefreshAllCommandListBox; +var + I, W: Integer; +begin + FAllCommandsNameWidth := 0; + FAllCommandsCaptionWidth := 0; + FAllCommandsShortCutWidth := 0; + LAllCommands.Canvas.Font := LAllCommands.Font; + for I := 0 to LAllCommands.Items.Count - 1 do + with CommandList[I] do + begin + W := LAllCommands.Canvas.TextWidth(Name); + if W > FAllCommandsNameWidth then FAllCommandsNameWidth := W; + W := LAllCommands.Canvas.TextWidth(Caption); + if W > FAllCommandsCaptionWidth then FAllCommandsCaptionWidth := W; + W := LAllCommands.Canvas.TextWidth(ShortCutToText(ShortCut)); + if W > FAllCommandsShortCutWidth then FAllCommandsShortCutWidth := W; + end; + LAllCommands.Invalidate; + + SendMessage(LAllCommands.Handle, LB_SETHORIZONTALEXTENT, + AllCommandsIndent + FAllCommandsNameWidth + AllCommandsIndent + + AllCommandsIndent + FAllCommandsCaptionWidth + AllCommandsIndent + + AllCommandsIndent + FAllCommandsShortCutWidth + AllCommandsIndent, 0); +end; + +function TdxBarCustomizingForm.GetSelectedGroup: TdxBarGroup; +begin + Result := TdxBarGroup(GetExclusiveObject(lbGroups)); +end; + +procedure TdxBarCustomizingForm.GroupListBoxWndProc(var Message: TMessage); + + procedure SynchronizeGroupList; + var + I: Integer; + AGroup: TdxBarGroup; + begin + AGroup := TdxBarGroup(Message.WParam); + if AGroup = nil then + for I := 0 to BarManager.GroupCount - 1 do + begin + AGroup := BarManager.Groups[I]; + lbGroups.Items.AddObject(AGroup.Name, AGroup); + end + else + lbGroups.Items[Message.LParam] := AGroup.Name; + end; + + procedure UpdateGroupEvents; + begin + SynchronizeListBox(lbGroupItems); + + UpdateCommonEvents(lbGroups, aAddGroup, aDeleteGroup, aMoveUpGroup, aMoveDownGroup); + end; + +begin + case Message.Msg of + LB_SYNCHRONYZE: SynchronizeGroupList; + LB_SYNCHRONYZESELECTION: SynchronizeListBoxSelection(lbGroups); + LB_UPDATEEVENTS: UpdateGroupEvents; + end; + + FGroupListBoxOldWndProc(Message); +end; + +procedure TdxBarCustomizingForm.GroupsChange(Sender: TObject; + AComponent: TComponent; AAction: TcxComponentCollectionNotification); +begin + if Assigned(FGroupsOldChangeEvent) then + FGroupsOldChangeEvent(Sender, AComponent, AAction); + SynchronizeListBox(lbGroups, AComponent, AAction); +end; + +procedure TdxBarCustomizingForm.MoveGroup(ADirection: Integer); +begin + MoveItems(lbGroups, TdxBarManagerAccess(BarManager).GroupList, ADirection); +end; + +procedure TdxBarCustomizingForm.RememberSelectedList; +begin + FSelectedGroupItems.Clear; + GetSelection(lbGroupItems, FSelectedGroupItems); +end; + +procedure TdxBarCustomizingForm.GroupItemListBoxWndProc(var Message: TMessage); + + procedure SynchronizeGroupItemList; + var + I: Integer; + AGroup: TdxBarGroup; + AItem: TComponent; + begin + AItem := TComponent(Message.WParam); + if AItem = nil then + begin + AGroup := SelectedGroup; + if AGroup <> nil then + for I := 0 to AGroup.Count - 1 do + begin + AItem := AGroup[I]; + lbGroupItems.Items.AddObject(AItem.Name, AItem); + end; + end + else + lbGroupItems.Items[Message.LParam] := AItem.Name; + end; + + procedure SynchronizeGroupListSelection; + begin + SetSelection(lbGroupItems, FSelectedGroupItems); + UpdateGroupItemEvents; + end; + +begin + case Message.Msg of + LB_SYNCHRONYZE: SynchronizeGroupItemList; + LB_SYNCHRONYZESELECTION: SynchronizeGroupListSelection; + LB_UPDATEEVENTS: UpdateGroupItemEvents; + end; + FGroupItemListBoxOldWndProc(Message); +end; + +procedure TdxBarCustomizingForm.GroupStuctureChange; +begin + SynchronizeListBox(lbGroupItems); +end; + +procedure TdxBarCustomizingForm.DeleteGroupItem(AGroupItem: TObject); +begin + SelectedGroup.Remove(TdxBarComponent(AGroupItem)); +end; + +procedure TdxBarCustomizingForm.MoveGroupItem(ADirection: Integer); +begin + MoveItems(lbGroupItems, TdxBarGroupAccess(SelectedGroup).ItemList, ADirection); +end; + +procedure TdxBarCustomizingForm.UpdateGroupItemEvents; +begin + aAddGroupItem.Enabled := SelectedGroup <> nil; + UpdateCommonEvents(lbGroupItems, nil, aDeleteGroupItem, aMoveUpGroupItem, aMoveDownGroupItem); +end; + +procedure TdxBarCustomizingForm.WMActivate(var Message: TMessage); +var + AParentForm: TCustomForm; +begin + inherited; + + if not (csDestroying in ComponentState) and not (bisFormActivating in TdxBarManagerAccess(BarManager).InternalState) then + begin + if BarManager.Designing then + AParentForm := BarManager.ParentForm + else + AParentForm := BarManager.MasterForm; + if //(Message.wParam <> WA_INACTIVE) and + (HWND(Message.lParam) <> AParentForm.Handle) then + SendMessage(AParentForm.Handle, Message.Msg, Message.wParam, Message.lParam); + {#DG + if (Message.wParam <> WA_INACTIVE) and not BarDesignController.IsCustomizedByPopup then + PageControlChange(nil); + } + end; +end; + +procedure TdxBarCustomizingForm.WMDestroy(var Message: TWMDestroy); +begin + inherited; +//#DG BarManager.Customizing(False); +end; + +procedure TdxBarCustomizingForm.WMNCHitTest(var Message: TMessage); +begin + inherited; + case Message.Result of + HTLEFT, HTRIGHT: Message.Result := HTCLIENT; + HTTOPLEFT, HTTOPRIGHT: Message.Result := HTTOP; + HTBOTTOMLEFT, HTBOTTOMRIGHT: Message.Result := HTBOTTOM; + end; +end; + +procedure TdxBarCustomizingForm.CreateParams(var Params: TCreateParams); +begin + inherited; + Params.Style := WS_POPUP or WS_CLIPSIBLINGS or WS_SYSMENU or WS_CAPTION or WS_THICKFRAME; + Params.ExStyle := WS_EX_DLGMODALFRAME or WS_EX_WINDOWEDGE; + Params.WindowClass.Style := CS_OWNDC or CS_SAVEBITS; + Params.WndParent := BarManager.Owner.Handle; +end; + +{$IFDEF DELPHI9} +procedure TdxBarCustomizingForm.DestroyWindowHandle; +begin + EnableWindows(True); + inherited; +end; +{$ENDIF} + +procedure TdxBarCustomizingForm.BarManagerStyleChanged; +begin + SynchronizeListBoxes; + UpdateOptions; + + BarManager1.Style := BarManager.Style; + BarManager1.LookAndFeel := BarManager.LookAndFeel; + if BarManager.GetPaintStyle = bmsFlat then + lbItems.Color := clWindow + else + lbItems.Color := clBtnFace; +end; + +procedure TdxBarCustomizingForm.DesignSelectionChanged(Sender: TObject); +begin + if not (csDestroying in (Application.ComponentState + ComponentState)) then + begin + SynchronizeListBoxSelection(lbBarsList); + SynchronizeListBoxSelection(lbItems); + SynchronizeListBoxSelection(LAllCommands); + SynchronizeListBoxSelection(lbGroups); + end; +end; + +procedure TdxBarCustomizingForm.SelectPage(APageIndex: Integer); +begin + PageControl.ActivePageIndex := APageIndex; +end; + +procedure TdxBarCustomizingForm.UpdateHelpButton; +begin + BHelp.Glyph := BarManager.HelpButtonGlyph; + BHelp.Visible := BarManager.ShowHelpButton; +end; + +procedure TdxBarCustomizingForm.UpdateOptions; +begin + StandardOptionsPanel.Visible := BarManager.GetPaintStyle = bmsStandard; + EnhancedOptionsPanel.Visible := BarManager.GetPaintStyle <> bmsStandard; + + CBMenusShowRecentItemsFirst.Checked := BarManager.MenusShowRecentItemsFirst; + CBShowFullMenusAfterDelay.Checked := BarManager.ShowFullMenusAfterDelay; + CBShowFullMenusAfterDelay.Enabled := CBMenusShowRecentItemsFirst.Checked; + + CBLargeIcons.Checked := BarManager.LargeIcons; + CBLargeIconsEx.Checked := BarManager.LargeIcons; + CBHint1.Checked := BarManager.ShowHint; + CBHint1Ex.Checked := BarManager.ShowHint; + CBHint2.Checked := BarManager.ShowShortcutInHint; + CBHint2Ex.Checked := BarManager.ShowShortcutInHint; + CBHint2Ex.Enabled := CBHint1Ex.Checked; + ComboBoxMenuAnimations.ItemIndex := Ord(BarManager.MenuAnimations); + ComboBoxMenuAnimationsEx.ItemIndex := Ord(BarManager.MenuAnimations); +end; + +procedure TdxBarCustomizingForm.UpdateVisibility(const AWindowPos: TWindowPos); +begin + if AWindowPos.flags and SWP_SHOWWINDOW <> 0 then + ShowWindow(Handle, SW_SHOW) + else + if AWindowPos.flags and SWP_HIDEWINDOW <> 0 then + ShowWindow(Handle, SW_HIDE); +end; + +procedure TdxBarCustomizingForm.FormClose(Sender: TObject; var Action: TCloseAction); +begin + Action := caFree; +end; + +procedure TdxBarCustomizingForm.FormCreate(Sender: TObject); +begin + Constraints.MinHeight := Height; + + FSelectionList := TdxComponentList.Create; + (BarManager as IdxBarDesigner).GetSelection(FSelectionList); +end; + +procedure TdxBarCustomizingForm.FormDestroy(Sender: TObject); +begin + FdxBarCustomizingForm := nil; //#DG + + BarManager.Bars.OnChange := FBarsOldChangeEvent; + TdxBarManagerAccess(BarManager).GroupList.OnComponentListChanged := FGroupsOldChangeEvent; + TdxBarManagerAccess(BarManager).ItemList.OnComponentListChanged := FItemsOldChangeEvent; + if not FCloseCustomizingFormFlag then + begin + FCloseCustomizingFormFlag := True; + BarManager.Customizing(False); + FCloseCustomizingFormFlag := False; + end; +// SelectBarManager; //#DG + (BarManager as IdxBarDesigner).SetSelection(FSelectionList); + FreeAndNil(FSelectionList); +end; + +procedure TdxBarCustomizingForm.FormShow(Sender: TObject); +begin + EnableWindows(False); +end; + +procedure TdxBarCustomizingForm.FormHide(Sender: TObject); +begin + EnableWindows(True); +end; + +procedure TdxBarCustomizingForm.lbBarsListClick(Sender: TObject); +begin + SynchronizeDesigner(lbBarsList); +end; + +procedure TdxBarCustomizingForm.lbBarsListMouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + AIndex: Integer; +begin + AIndex := lbBarsList.ItemAtPos(Point(X, Y), True); + if (AIndex > -1) and (lbBarsList.Items.Count > 0) and + (X - lbBarsList.ItemRect(AIndex).Left < lbBarsList.ItemHeight) then + BarListToggleCheck(AIndex); +end; + +procedure TdxBarCustomizingForm.lbBarsListDblClick(Sender: TObject); +begin + BarListToggleCheck(lbBarsList.ItemIndex); +end; + +procedure TdxBarCustomizingForm.lbBarsListKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + case Key of + VK_DELETE: aDeleteToolBar.Execute; + VK_INSERT: aNewToolBar.Execute; + VK_SPACE: BarListToggleCheck(lbBarsList.ItemIndex); + end; +end; + +procedure TdxBarCustomizingForm.lbBarsListDrawItem( + Control: TWinControl; Index: Integer; Rect: TRect; + State: TOwnerDrawState); +const + Checks: array[Boolean] of Integer = (0, DFCS_CHECKED); + Inactives: array[Boolean] of Integer = (DFCS_INACTIVE, 0); + + procedure DrawCheckBox(ARect: TRect); + begin + Dec(ARect.Left, lbBarsList.ItemHeight); + ARect.Right := ARect.Left + lbBarsList.ItemHeight; + InflateRect(ARect, -1, -1); + with TdxBarAccess(BarList[Index]) do + DrawFrameControl(lbBarsList.Canvas.Handle, ARect, DFC_BUTTON, + DFCS_BUTTONCHECK or Checks[Visible] or Inactives[CanClose]); + end; + +var + AFlags: Integer; +begin + if BarList[Index] = nil then //#DG ??? + Exit; + DrawCheckBox(Rect); + lbBarsList.Canvas.FillRect(Rect); + if Index < lbBarsList.Items.Count then + begin + AFlags := DrawTextBiDiModeFlags(DT_SINGLELINE or DT_VCENTER or DT_NOPREFIX); + if not lbBarsList.UseRightToLeftAlignment then + Inc(Rect.Left, 2) + else + Dec(Rect.Right, 2); + cxDrawText(lbBarsList.Canvas.Handle, lbBarsList.Items[Index], Rect, AFlags); + end; +end; + +procedure TdxBarCustomizingForm.BHelpClick(Sender: TObject); +begin + if not BarManager.Designing then + begin + TdxBarManagerAccess(BarManager).DoHelpButtonClick; + if BarManager.HelpContext <> 0 then + Application.HelpContext(BarManager.HelpContext); + end; +end; + +procedure TdxBarCustomizingForm.BCloseClick(Sender: TObject); +begin + Close; +end; + +procedure TdxBarCustomizingForm.lbCategoriesClick(Sender: TObject); +begin + SynchronizeListBox(lbItems); +end; + +procedure TdxBarCustomizingForm.lbCategoriesKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if BarManager.Designing then + case Key of + VK_INSERT: if Shift = [] then CategoriesInsertClick(nil); + VK_DELETE: if Shift = [] then CategoriesDeleteClick(nil); + end; +end; + +procedure TdxBarCustomizingForm.lbCategoriesMouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + ANewIndex: Integer; +begin + with lbCategories do + case Button of + mbLeft: + if BarManager.Designing and (ItemAtPos(Point(X, Y), True) > -1) then + begin + FDraggingCategoryIndex := ItemIndex; + DragMode := dmAutomatic; + end; + mbRight: + begin + SetFocus; + ANewIndex := ItemAtPos(Point(X, Y), True); + if (ANewIndex <> -1) and (ANewIndex <> ItemIndex) then + begin + ItemIndex := ANewIndex; + SynchronizeListBox(lbItems); + end; + if BarManager.Designing then + with ClientToScreen(Point(X, Y)) do + CategoriesPopupMenu.Popup(X, Y); + end; + end; +end; + +procedure TdxBarCustomizingForm.lbCategoriesDragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); +var + AItemIndex: Integer; +begin + Accept := Source = Sender; + if Accept then + begin + AItemIndex := lbCategories.ItemAtPos(Point(X, Y), True); + if AItemIndex > -1 then + begin + BarManager.Categories.Move(FDraggingCategoryIndex, AItemIndex); + lbCategories.Items.Move(FDraggingCategoryIndex, AItemIndex); + lbCategories.ItemIndex := AItemIndex; + FDraggingCategoryIndex := AItemIndex; + end; + end; +end; + +procedure TdxBarCustomizingForm.lbCategoriesEndDrag(Sender, Target: TObject; + X, Y: Integer); +begin + lbCategories.DragMode := dmManual; +end; + +procedure TdxBarCustomizingForm.CategoriesPopupMenuPopup(Sender: TObject); +begin + CategoriesInsert.Enabled := lbCategories.ItemIndex > -1; + CategoriesRename.Enabled := lbCategories.ItemIndex > -1; + with CategoriesVisible do + begin + Enabled := lbCategories.ItemIndex > -1; + Down := Enabled and Self.BarManager.CategoryVisible[lbCategories.ItemIndex]; + end; + with CategoriesItemsVisible do + begin + Enabled := CategoriesVisible.Enabled; + if Enabled then + ItemIndex := Ord(Self.BarManager.CategoryItemsVisible[lbCategories.ItemIndex]); + end; + CategoriesDelete.Enabled := CanDeleteSelectedCategory; +end; + +procedure TdxBarCustomizingForm.CategoriesAddClick(Sender: TObject); +var + S: string; +begin + S := ''; + if dxBarEditName(S, 1, 0, BarManager, nil) then + begin + BarManager.Categories.Add(S); + lbCategories.Items.Add(S); + lbCategories.ItemIndex := lbCategories.Items.Count - 1; + SynchronizeListBox(lbItems); + lbCategories.SetFocus; + end; +end; + +procedure TdxBarCustomizingForm.CategoriesInsertClick(Sender: TObject); +var + S: string; + AItemIndex: Integer; +begin + AItemIndex := lbCategories.ItemIndex; + if AItemIndex > -1 then + begin + S := ''; + if dxBarEditName(S, 1, 1, BarManager, nil) then + begin + AItemIndex := lbCategories.ItemIndex; + BarManager.Categories.Insert(AItemIndex, S); + lbCategories.Items.Insert(AItemIndex, S); + lbCategories.ItemIndex := AItemIndex; + SynchronizeListBox(lbItems); + lbCategories.SetFocus; + end; + end; +end; + +procedure TdxBarCustomizingForm.CategoriesRenameClick(Sender: TObject); +var + S: string; + AItemIndex: Integer; +begin + AItemIndex := lbCategories.ItemIndex; + if AItemIndex > -1 then + begin + S := lbCategories.Items[AItemIndex]; + if dxBarEditName(S, 1, 2, BarManager, nil) then + begin + BarManager.Categories[AItemIndex] := S; + lbCategories.Items[AItemIndex] := S; + lbCategories.ItemIndex := AItemIndex; + lbCategories.SetFocus; + end; + end +end; + +procedure TdxBarCustomizingForm.CategoriesVisibleClick(Sender: TObject); +begin + BarManager.CategoryVisible[lbCategories.ItemIndex] := TdxBarButton(Sender).Down; + lbCategories.SetFocus; +end; + +procedure TdxBarCustomizingForm.CategoriesItemsVisibleChange( + Sender: TObject); +begin + BarManager.CategoryItemsVisible[lbCategories.ItemIndex] := + TdxBarItemVisible(TdxBarCombo(Sender).ItemIndex); + lbCategories.SetFocus; +end; + +procedure TdxBarCustomizingForm.CategoriesDeleteClick(Sender: TObject); +var + AItemIndex: Integer; +begin + if CanDeleteSelectedCategory then + begin + AItemIndex := lbCategories.ItemIndex; + if dxBarMessageBox(Format(cxGetResourceString(@dxSBAR_WANTTODELETECATEGORY), [lbCategories.Items[AItemIndex]]), + MB_ICONEXCLAMATION or MB_OKCANCEL) = ID_OK then + begin + SelectBarManager; + BarManager.Categories.Delete(AItemIndex); + lbCategories.Items.Delete(AItemIndex); + if AItemIndex = lbCategories.Items.Count then Dec(AItemIndex); + lbCategories.ItemIndex := AItemIndex; + SynchronizeListBox(lbItems); + lbCategories.SetFocus; + end; + end; +end; + +procedure TdxBarCustomizingForm.lbItemsClick(Sender: TObject); +begin + SynchronizeDesigner(lbItems); +end; + +procedure TdxBarCustomizingForm.lbItemsDblClick(Sender: TObject); +begin + if SelectedItem <> nil then + TdxBarItemAccess(SelectedItem).ShowDefaultEventHandler; +end; + +procedure TdxBarCustomizingForm.lbItemsDrawItem( + Control: TWinControl; Index: Integer; Rect: TRect; + State: TOwnerDrawState); + + function BrushColors(AItem: TdxBarItem; ASelected: Boolean): TColor; + begin + Result := PainterClass.BrushColors(ASelected, AItem); + end; + +var + AItem: TdxBarItem; + R: TRect; +begin + AItem := ItemList[Index]; + if AItem = nil then + Exit; + + TdxBarItemAccess(AItem).DrawCustomizingImage(lbItems.Canvas, Rect, State); + R := Rect; + if Index = lbItems.Items.Count - 1 then + begin + R := Rect; + R.Top := R.Bottom; + R.Bottom := ClientHeight; + lbItems.Canvas.Brush.Color := BrushColors(AItem, False); + lbItems.Canvas.FillRect(R); + end; + + if odFocused in State then + PainterClass.DrawFocusedRect(lbItems.Canvas, Rect, AItem); +end; + +procedure TdxBarCustomizingForm.lbItemsKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if BarManager.Designing then + case Key of + VK_INSERT: if Shift = [] then aAddItem.Execute; + VK_DELETE: if Shift = [] then aDeleteItem.Execute; + VK_UP: + if Shift = [ssCtrl] then + begin + aMoveUpItem.Execute; + Key := 0; + end; + VK_DOWN: + if Shift = [ssCtrl] then + begin + aMoveDownItem.Execute; + Key := 0; + end; + end; +end; + +procedure TdxBarCustomizingForm.lbItemsMeasureItem( + Control: TWinControl; Index: Integer; var Height: Integer); +begin + Height := dxBarButtonHeight; // todo delete +end; + +procedure TdxBarCustomizingForm.lbItemsMouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + AIsDragging: Boolean; +begin + AIsDragging := (Button = mbLeft) and Windows.DragDetect(lbItems.Handle, GetMouseCursorPos); + if Button = mbRight then + begin + lbItems.SetFocus; + SetSelection(lbItems, ItemList[lbItems.ItemAtPos(Point(X, Y), True)]); + end; + SynchronizeDesigner(lbItems); + if AIsDragging and (SelectedItem <> nil) then + TdxBarManagerAccess(BarManager).DragAndDrop(SelectedItem, nil); +end; + +procedure TdxBarCustomizingForm.lbItemsMouseUp(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + if (Button = mbRight) and (BarManager.Designing) then + CommandsPopupMenu.PopupFromCursorPos; +end; + +procedure TdxBarCustomizingForm.CommandsPopupMenuPopup(Sender: TObject); +begin + CommandsAdd.Enabled := aAddItem.Enabled; + CommandsDelete.Enabled := aDeleteItem.Enabled; + CommandsClear.Enabled := aClearItemList.Enabled; + CommandsMoveUp.Enabled := aMoveUpItem.Enabled; + CommandsMoveDown.Enabled := aMoveDownItem.Enabled; + CommandsSubMenuEditor.Enabled := aSubMenuEditor.Enabled; +end; + +procedure TdxBarCustomizingForm.CommandsAddClick(Sender: TObject); +begin + aAddItem.Execute; +end; + +procedure TdxBarCustomizingForm.CommandsDeleteClick(Sender: TObject); +begin + aDeleteItem.Execute; +end; + +procedure TdxBarCustomizingForm.CommandsClearClick(Sender: TObject); +begin + aClearItemList.Execute; +end; + +procedure TdxBarCustomizingForm.CommandsMoveUpClick(Sender: TObject); +begin + aMoveUpItem.Execute; +end; + +procedure TdxBarCustomizingForm.CommandsMoveDownClick(Sender: TObject); +begin + aMoveDownItem.Execute; +end; + +procedure TdxBarCustomizingForm.CommandsSubMenuEditorClick(Sender: TObject); +begin + aSubMenuEditor.Execute; +end; + +procedure TdxBarCustomizingForm.CBMenusShowRecentItemsFirstClick(Sender: TObject); +begin + CBShowFullMenusAfterDelay.Enabled := CBMenusShowRecentItemsFirst.Checked; + BarManager.MenusShowRecentItemsFirst := CBMenusShowRecentItemsFirst.Checked; +end; + +procedure TdxBarCustomizingForm.CBShowFullMenusAfterDelayClick(Sender: TObject); +begin + BarManager.ShowFullMenusAfterDelay := CBShowFullMenusAfterDelay.Checked; +end; + +procedure TdxBarCustomizingForm.BResetUsageDataClick(Sender: TObject); +begin + BarManager.ResetUsageDataWithConfirmation; +end; + +procedure TdxBarCustomizingForm.CBLargeIconsClick(Sender: TObject); +begin + BarManager.LargeIcons := TCheckBox(Sender).Checked; +end; + +procedure TdxBarCustomizingForm.CBHint1Click(Sender: TObject); +begin + BarManager.ShowHint := TCheckBox(Sender).Checked; +end; + +procedure TdxBarCustomizingForm.CBHint1ExClick(Sender: TObject); +begin + CBHint2Ex.Enabled := CBHint1Ex.Checked; + CBHint1Click(Sender); +end; + +procedure TdxBarCustomizingForm.CBHint2Click(Sender: TObject); +begin + BarManager.ShowShortCutInHint := TCheckBox(Sender).Checked; +end; + +procedure TdxBarCustomizingForm.ComboBoxMenuAnimationsClick(Sender: TObject); +begin + BarManager.MenuAnimations := TdxBarMenuAnimations(TComboBox(Sender).ItemIndex); +end; + +procedure TdxBarCustomizingForm.LAllCommandsClick(Sender: TObject); +begin + SynchronizeDesigner(LAllCommands); +end; + +procedure TdxBarCustomizingForm.LAllCommandsDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +var + W: Integer; + LastRow: Boolean; +begin + LastRow := Index = TListBox(Control).Items.Count - 1; + with TListBox(Control), Canvas, TdxBarItem(Items.Objects[Index]), Rect do + begin + Pen.Color := Font.Color; + FillRect(Rect); + + TextOut(Left + AllCommandsIndent, Top, Name); + W := AllCommandsIndent + FAllCommandsNameWidth + AllCommandsIndent; + MoveTo(W, Top); + LineTo(W, Bottom); + + TextOut(W + AllCommandsIndent, Top, Caption); + Inc(W, AllCommandsIndent + FAllcommandsCaptionWidth + AllCommandsIndent); + MoveTo(W, Top); + LineTo(W, Bottom); + + TextOut(W + AllCommandsIndent, Top, ShortCutToText(ShortCut)); + + if LastRow then + begin + Pen.Color := clWindowText; + W := AllCommandsIndent + FAllCommandsNameWidth + AllCommandsIndent; + MoveTo(W, Bottom); + LineTo(W, ClientHeight); + Inc(W, AllCommandsIndent + FAllCommandsCaptionWidth + AllCommandsIndent); + MoveTo(W, Bottom); + LineTo(W, ClientHeight); + end; + end; +end; + +procedure TdxBarCustomizingForm.CBShowCommandsWithShortCutClick(Sender: TObject); +begin + SynchronizeListBox(LAllCommands); +end; + +procedure TdxBarCustomizingForm.lbGroupsClick(Sender: TObject); +begin + SynchronizeDesigner(lbGroups); +end; + +procedure TdxBarCustomizingForm.lbGroupsDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +begin + with TListBox(Control) do + begin + Canvas.Font.Style := Canvas.Font.Style + [fsBold]; + cxExtTextOut(Canvas.Handle, Items[Index], Point(Rect.Left + 2, Rect.Top + 1), + Rect, ETO_OPAQUE); + end; +end; + +procedure TdxBarCustomizingForm.lbGroupsKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + case Key of + VK_INSERT: aAddGroup.Execute; + VK_DELETE: aDeleteGroup.Execute; + VK_UP: + if Shift = [ssCtrl] then + begin + aMoveUpGroup.Execute; + Key := 0; + end; + VK_DOWN: + if Shift = [ssCtrl] then + begin + aMoveDownGroup.Execute; + Key := 0; + end; + end; +end; + +procedure TdxBarCustomizingForm.lbGroupsMeasureItem(Control: TWinControl; + Index: Integer; var Height: Integer); +begin + with TListBox(Control) do + Canvas.Font := Font; + Height := TListBox(Control).Canvas.TextHeight('Qq') + 2; +end; + +procedure TdxBarCustomizingForm.lbGroupItemsClick(Sender: TObject); +begin + RememberSelectedList; + UpdateGroupItemEvents; +end; + +procedure TdxBarCustomizingForm.lbGroupItemsDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +begin + with TListBox(Control) do + begin + if Items.Objects[Index] is TdxBarGroup then + Canvas.Font.Style := Canvas.Font.Style + [fsBold]; + cxExtTextOut(Canvas.Handle, Items[Index], Point(Rect.Left + 2, Rect.Top + 1), Rect, ETO_OPAQUE); + end; +end; + +procedure TdxBarCustomizingForm.lbGroupItemsKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + case Key of + VK_INSERT: aAddGroupItem.Execute; + VK_DELETE: aDeleteGroupItem.Execute; + VK_UP: + if Shift = [ssCtrl] then + begin + aMoveUpGroupItem.Execute; + Key := 0; + end; + VK_DOWN: + if Shift = [ssCtrl] then + begin + aMoveDownGroupItem.Execute; + Key := 0; + end; + end; +end; + +procedure TdxBarCustomizingForm.aNewToolBarExecute(Sender: TObject); +begin +//#DG lbBarsList.Items.BeginUpdate; { #DG - because modal form erased items} + try + BarManager.AddToolBar(False, True); + finally +//#DG lbBarsList.Items.EndUpdate; + end; +end; + +procedure TdxBarCustomizingForm.aRenameToolBarExecute(Sender: TObject); +begin + BarManager.RenameToolBar(SelectedBar); +end; + +procedure TdxBarCustomizingForm.aDeleteToolBarExecute(Sender: TObject); +var + AConfirmString: string; +begin +//#DG BarManager.Bars.BeginUpdate; {#DG AV - when inside delete proc repaint listbox calls} + try + if GetSelCount(lbBarsList) > 1 then + AConfirmString := cxGetResourceString(@dxSBAR_WANTTODELETETOOLBARS) + else + AConfirmString := Format(cxGetResourceString(@dxSBAR_WANTTODELETETOOLBAR), [SelectedBar.Caption]); + + if dxBarMessageBox(AConfirmString, MB_ICONEXCLAMATION or MB_OKCANCEL) = ID_OK then + DeleteSelectedObjects(lbBarsList); + SetZOrder(True); + finally +//#DG BarManager.Bars.EndUpdate; + end; +end; + +procedure TdxBarCustomizingForm.aResetToolBarExecute(Sender: TObject); +begin + BarManager.ResetToolBar(SelectedBar); + SetZOrder(True); +end; + +procedure TdxBarCustomizingForm.aAddGroupItemExecute(Sender: TObject); +var + Group: TdxBarGroup; + AGroupItems: TdxObjectList; + I: Integer; +begin + Group := SelectedGroup; + AGroupItems := TdxObjectList.Create; + try + if dxBarChooseGroupItem(Group, AGroupItems) then + begin + TdxBarGroupAccess(Group).ItemList.BeginUpdate; + try + for I := 0 to AGroupItems.Count - 1 do + Group.Add(TdxBarComponent(AGroupItems[I])); + finally + TdxBarGroupAccess(Group).ItemList.EndUpdate; + end; + AGroupItems.CopyTo(FSelectedGroupItems); + GroupStuctureChange; + end; + finally + AGroupItems.Free; + end; + TdxBarManagerAccess(BarManager).DesignerModified; +end; + +procedure TdxBarCustomizingForm.aDeleteGroupItemExecute(Sender: TObject); +//#DGvar +//#DG AGroup: TdxBarGroup; +begin +//#DG AGroup := SelectedGroup; +//#DG TdxBarGroupAccess(AGroup).ItemList.BeginUpdate; + try + DeleteSelectedObjects(lbGroupItems, DeleteGroupItem, False); + RememberSelectedList; + finally +//#DG TdxBarGroupAccess(AGroup).ItemList.EndUpdate; + end; + GroupStuctureChange; +end; + +procedure TdxBarCustomizingForm.aAddGroupExecute(Sender: TObject); +var + AGroup: TdxBarGroup; +begin + TdxBarManagerAccess(BarManager).GroupList.BeginUpdate; + try + AGroup := BarManager.CreateGroup; + AGroup.Name := (BarManager as IdxBarDesigner).UniqueName('dxBarGroup'); + SynchronizeDesigner(AGroup); + finally + TdxBarManagerAccess(BarManager).GroupList.EndUpdate; + end; + TdxBarManagerAccess(BarManager).DesignerModified; +end; + +procedure TdxBarCustomizingForm.aDeleteGroupExecute(Sender: TObject); +begin + DeleteSelectedObjects(lbGroups); +end; + +procedure TdxBarCustomizingForm.aMoveGroupExecute(Sender: TObject); +begin + MoveGroup(TAction(Sender).Tag); +end; + +procedure TdxBarCustomizingForm.aMoveGroupItemExecute(Sender: TObject); +begin + MoveGroupItem(TAction(Sender).Tag); + GroupStuctureChange; +end; + +procedure TdxBarCustomizingForm.aMoveItemExecute(Sender: TObject); +begin + MoveItem(TAction(Sender).Tag); +end; + +procedure TdxBarCustomizingForm.aAddItemExecute(Sender: TObject); +var + AItem: TdxBarItem; +begin + TdxBarManagerAccess(BarManager).ItemList.BeginUpdate; + try + AItem := dxBarItemAddEditor(BarManager, lbCategories.ItemIndex); + if AItem <> nil then + begin + SynchronizeDesigner(AItem); + lbItems.SetFocus; + end; + finally + TdxBarManagerAccess(BarManager).ItemList.EndUpdate; + end; +end; + +procedure TdxBarCustomizingForm.aDeleteItemExecute(Sender: TObject); +begin + DeleteSelectedObjects(lbItems); + lbItems.SetFocus; +end; + +procedure TdxBarCustomizingForm.aSubMenuEditorExecute(Sender: TObject); +var + ASubItem: TCustomdxBarSubItem; +begin + lbItems.SetFocus; + ASubItem := TCustomdxBarSubItem(lbItems.Items.Objects[lbItems.ItemIndex]); + ShowdxBarSubMenuEditor(ASubItem.ItemLinks); +end; + +procedure TdxBarCustomizingForm.aClearItemListExecute(Sender: TObject); + + procedure SelectAllItems(AListBox: TListBox); + begin + SendMessage(AListBox.Handle, LB_SETSEL, Integer(True), -1); + end; + +begin + if dxBarMessageBox(Format(cxGetResourceString(@dxSBAR_WANTTOCLEARCOMMANDS), [lbCategories.Items[lbCategories.ItemIndex]]), + MB_ICONEXCLAMATION or MB_OKCANCEL) = ID_OK then + begin + lbItems.Items.BeginUpdate; + try + SelectAllItems(lbItems); + DeleteSelectedObjects(lbItems); + lbItems.SetFocus; + finally + lbItems.Items.EndUpdate; + end; + end; +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBarDBCheckLinksEd.dfm b/official/x.35/ExpressBars 6/Sources/dxBarDBCheckLinksEd.dfm new file mode 100644 index 00000000..84dc3540 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarDBCheckLinksEd.dfm @@ -0,0 +1,156 @@ +object dxBarDBCheckLinksEditor: TdxBarDBCheckLinksEditor + Left = 233 + Top = 127 + BorderStyle = bsDialog + Caption = 'ExpressBars DBCheckLinks Editor' + ClientHeight = 278 + ClientWidth = 412 + Color = clBtnFace + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object GroupBox1: TGroupBox + Left = 6 + Top = 6 + Width = 171 + Height = 231 + Caption = ' CheckLinks ' + TabOrder = 0 + object ListBox: TListBox + Left = 10 + Top = 17 + Width = 151 + Height = 172 + ItemHeight = 13 + TabOrder = 0 + OnClick = ListBoxClick + end + object Button1: TButton + Left = 16 + Top = 198 + Width = 65 + Height = 23 + Caption = 'Add' + TabOrder = 1 + OnClick = Button1Click + end + object Button2: TButton + Left = 90 + Top = 198 + Width = 65 + Height = 23 + Caption = 'Delete' + TabOrder = 2 + OnClick = Button2Click + end + end + object GroupBox2: TGroupBox + Left = 184 + Top = 6 + Width = 221 + Height = 231 + Caption = ' Properties ' + TabOrder = 1 + object Label1: TLabel + Left = 13 + Top = 24 + Width = 20 + Height = 13 + Caption = 'Item' + end + object Label2: TLabel + Left = 12 + Top = 56 + Width = 62 + Height = 13 + Caption = 'EnableTypes' + end + object Bevel1: TBevel + Left = 80 + Top = 62 + Width = 129 + Height = 9 + Shape = bsTopLine + end + object ComboBox: TComboBox + Left = 42 + Top = 20 + Width = 167 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + end + object CheckBox1: TCheckBox + Left = 16 + Top = 78 + Width = 97 + Height = 17 + Caption = 'dxdbtCanModify' + TabOrder = 1 + end + object CheckBox4: TCheckBox + Left = 16 + Top = 138 + Width = 116 + Height = 17 + Caption = 'dxdbtHasRecords' + TabOrder = 4 + end + object CheckBox2: TCheckBox + Left = 16 + Top = 98 + Width = 97 + Height = 17 + Caption = 'dxdbtNotEOF' + TabOrder = 2 + end + object CheckBox5: TCheckBox + Left = 16 + Top = 158 + Width = 116 + Height = 17 + Caption = 'dxdbtIsModified' + TabOrder = 5 + end + object CheckBox6: TCheckBox + Left = 16 + Top = 178 + Width = 116 + Height = 17 + Caption = 'dxdbtIsNotModified' + TabOrder = 6 + end + object CheckBox3: TCheckBox + Left = 16 + Top = 118 + Width = 97 + Height = 17 + Caption = 'dxbdbtNotBOF' + TabOrder = 3 + end + end + object Button3: TButton + Left = 252 + Top = 248 + Width = 72 + Height = 23 + Caption = 'OK' + TabOrder = 2 + OnClick = Button3Click + end + object Button4: TButton + Left = 334 + Top = 248 + Width = 72 + Height = 23 + Cancel = True + Caption = 'Cancel' + TabOrder = 3 + OnClick = Button4Click + end +end diff --git a/official/x.35/ExpressBars 6/Sources/dxBarDBCheckLinksEd.pas b/official/x.35/ExpressBars 6/Sources/dxBarDBCheckLinksEd.pas new file mode 100644 index 00000000..9353de2e --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarDBCheckLinksEd.pas @@ -0,0 +1,197 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars DB Navigator checklinks editor } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarDBCheckLinksEd; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls, dxBarDBNav, dxBar; + +type + TdxBarDBCheckLinksEditor = class(TForm) + GroupBox1: TGroupBox; + ListBox: TListBox; + GroupBox2: TGroupBox; + ComboBox: TComboBox; + CheckBox1: TCheckBox; + CheckBox4: TCheckBox; + CheckBox2: TCheckBox; + CheckBox5: TCheckBox; + CheckBox6: TCheckBox; + CheckBox3: TCheckBox; + Label1: TLabel; + Label2: TLabel; + Button3: TButton; + Button4: TButton; + Button1: TButton; + Button2: TButton; + Bevel1: TBevel; + procedure Button3Click(Sender: TObject); + procedure Button4Click(Sender: TObject); + procedure ListBoxClick(Sender: TObject); + procedure Button1Click(Sender: TObject); + procedure Button2Click(Sender: TObject); + private + FBarDBNavigator: TdxBarDBNavigator; + SelectedDBCheckLink: TdxBarDBCheckLink; + procedure RefreshItems(OldIndex: Integer); + end; + +function dxBarDBCheckLinksEditor(ABarDBNavigator: TdxBarDBNavigator): Boolean; + +implementation + +{$R *.DFM} + +function dxBarDBCheckLinksEditor(ABarDBNavigator: TdxBarDBNavigator): Boolean; +var + AForm: TdxBarDBCheckLinksEditor; + I: Integer; + ADBCheckLinks: TdxBarDBCheckLinks; +begin + AForm := TdxBarDBCheckLinksEditor.Create(nil); + with AForm do + begin + FBarDBNavigator := ABarDBNavigator; + ADBCheckLinks := TdxBarDBCheckLinks.Create(TdxBarDBCheckLink); + ADBCheckLinks.Assign(FBarDBNavigator.DBCheckLinks); + if FBarDBNavigator.BarManager <> nil then + for I := 0 to FBarDBNavigator.BarManager.ItemCount - 1 do + with FBarDBNavigator.BarManager do + if Items[I].Category > -1 then + ComboBox.Items.AddObject(Items[I].Name, Items[I]); + RefreshItems(0); + end; + Result := AForm.ShowModal = mrOK; + if not Result then + ABarDBNavigator.DBCheckLinks.Assign(ADBCheckLinks); + ADBCheckLinks.Free; + AForm.Free; +end; + +procedure TdxBarDBCheckLinksEditor.RefreshItems(OldIndex: Integer); +var + I: Integer; +begin + ListBox.Items.BeginUpdate; + ListBox.Items.Clear; + for I := 0 to FBarDBNavigator.DBCheckLinks.Count - 1 do + ListBox.Items.AddObject(TdxBarDBCheckLink.ClassName + ' - ' + IntToStr(I), + FBarDBNavigator.DBCheckLinks[I]); + if OldIndex > ListBox.Items.Count - 1 then + OldIndex := ListBox.Items.Count - 1; + ListBox.Items.EndUpdate; + ListBox.ItemIndex := OldIndex; + ListBoxClick(nil); +end; + +procedure TdxBarDBCheckLinksEditor.Button3Click(Sender: TObject); +begin + ListBoxClick(nil); + ModalResult := mrOK; +end; + +procedure TdxBarDBCheckLinksEditor.Button4Click(Sender: TObject); +begin + ModalResult := mrCancel; +end; + +procedure TdxBarDBCheckLinksEditor.ListBoxClick(Sender: TObject); +begin + if (ListBox.ItemIndex = -1) and (ListBox.Items.Count > 0) then + ListBox.ItemIndex := 0; + + if ListBox.ItemIndex > -1 then + begin + if SelectedDBCheckLink <> nil then + begin + if ComboBox.ItemIndex > -1 then + SelectedDBCheckLink.Item := TdxBarItem(ComboBox.Items.Objects[ComboBox.ItemIndex]); + with SelectedDBCheckLink do + begin + EnableTypes := []; + if CheckBox1.Checked then EnableTypes := EnableTypes + [dxdbtCanModify]; + if CheckBox2.Checked then EnableTypes := EnableTypes + [dxdbtNotEOF]; + if CheckBox3.Checked then EnableTypes := EnableTypes + [dxdbtNotBOF]; + if CheckBox4.Checked then EnableTypes := EnableTypes + [dxdbtHasRecords]; + if CheckBox5.Checked then EnableTypes := EnableTypes + [dxdbtIsModified]; + if CheckBox6.Checked then EnableTypes := EnableTypes + [dxdbtIsNotModified]; + end; + end; + SelectedDBCheckLink := TdxBarDBCheckLink(ListBox.Items.Objects[ListBox.ItemIndex]); + if SelectedDBCheckLink <> nil then + with SelectedDBCheckLink do + begin + CheckBox1.Checked := dxdbtCanModify in EnableTypes; + CheckBox2.Checked := dxdbtNotEOF in EnableTypes; + CheckBox3.Checked := dxdbtNotBOF in EnableTypes; + CheckBox4.Checked := dxdbtHasRecords in EnableTypes; + CheckBox5.Checked := dxdbtIsModified in EnableTypes; + CheckBox6.Checked := dxdbtIsNotModified in EnableTypes; + ComboBox.ItemIndex := ComboBox.Items.IndexOfObject(Item); + end; + end + else SelectedDBCheckLink := nil; + GroupBox2.Enabled := ListBox.ItemIndex > -1; +end; + +procedure TdxBarDBCheckLinksEditor.Button1Click(Sender: TObject); +var + ABarDBCheckLink: TdxBarDBCheckLink; +begin + ABarDBCheckLink := FBarDBNavigator.DBCheckLinks.Add; + RefreshItems(ABarDBCheckLink.Index); +end; + +procedure TdxBarDBCheckLinksEditor.Button2Click(Sender: TObject); +var + ABarDBCheckLink: TdxBarDBCheckLink; + PrevIndex: Integer; +begin + if ListBox.Items.Count > 0 then + begin + ABarDBCheckLink := TdxBarDBCheckLink(ListBox.Items.Objects[ListBox.ItemIndex]); + PrevIndex := ABarDBCheckLink.Index; + ABarDBCheckLink.Free; + SelectedDBCheckLink := nil; + RefreshItems(PrevIndex); + end; +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBarDBNav.pas b/official/x.35/ExpressBars 6/Sources/dxBarDBNav.pas new file mode 100644 index 00000000..fbb74f5c --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarDBNav.pas @@ -0,0 +1,584 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars DB Navigator } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarDBNav; + +interface + +{$I cxVer.inc} + +uses + Classes, Messages, DB, cxClasses, dxBar; + +type + TdxBarDBNavigator = class; + TdxBarDBNavButton = class; + + TdxBarDBNavDataLink = class(TDataLink) + private + FNavigator: TdxBarDBNavigator; + protected + procedure ActiveChanged; override; + procedure DataSetChanged; override; + procedure EditingChanged; override; + end; + + TdxBarDBEnableType = (dxdbtCanModify, dxdbtNotEOF, dxdbtNotBOF, + dxdbtHasRecords, dxdbtIsModified, dxdbtIsNotModified); + TdxBarDBEnableTypes = set of TdxBarDBEnableType; + + TdxBarDBCheckLink = class(TCollectionItem) + private + FEnableTypes: TdxBarDBEnableTypes; + FFreeNotificator: TcxFreeNotificator; + FItem: TdxBarItem; + procedure FreeNotification(Sender: TComponent); + function GetDBNavigator: TdxBarDBNavigator; + procedure SetEnableTypes(Value: TdxBarDBEnableTypes); + procedure SetItem(Value: TdxBarItem); + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Value: TPersistent); override; + property DBNavigator: TdxBarDBNavigator read GetDBNavigator; + published + property Item: TdxBarItem read FItem write SetItem; + property EnableTypes: TdxBarDBEnableTypes read FEnableTypes write SetEnableTypes; + end; + + TdxBarDBCheckLinks = class(TCollection) + private + FDBNavigator: TdxBarDBNavigator; + function GetItem(Index: Integer): TdxBarDBCheckLink; + protected + function GetOwner: TPersistent; override; + public + function Add: TdxBarDBCheckLink; + property Items[Index: Integer]: TdxBarDBCheckLink read GetItem; default; + end; + + TdxBarDBNavButtonType = (dxbnFirst, dxbnPrior, dxbnNext, dxbnLast, + dxbnInsert, dxbnDelete, dxbnEdit, dxbnPost, dxbnCancel, dxbnRefresh); + TdxBarDBNavButtonTypes = set of TdxBarDBNavButtonType; + + TdxBarDBNavButton = class(TdxBarButton) + private + FBarDBNavigator: TdxBarDBNavigator; + FNavButton: TdxBarDBNavButtonType; + procedure SetNavButton(Value: TdxBarDBNavButtonType); + protected + procedure Loaded; override; + public + destructor Destroy; override; + procedure DoClick; override; + published + property BarDBNavigator: TdxBarDBNavigator read FBarDBNavigator write FBarDBNavigator; + property NavButton: TdxBarDBNavButtonType read FNavButton write SetNavButton; + end; + + TdxBarDBNavigator = class(TComponent) + private + FBarManager: TdxBarManager; + FCategoryName: string; + FConfirmDelete: Boolean; + FDataLink: TdxBarDBNavDataLink; + FDBCheckLinks: TdxBarDBCheckLinks; + FSetVisFlag: Boolean; + FVisibleButtons: TdxBarDBNavButtonTypes; + + function GetDataSource: TDataSource; + procedure SetBarManager(Value: TdxBarManager); + procedure SetCategoryName(Value: string); + procedure SetDataSource(Value: TDataSource); + procedure SetDBNavItems(Value: TdxBarDBCheckLinks); + procedure SetVisibleButtons(Value: TdxBarDBNavButtonTypes); + + procedure AddButton(AButton: TdxBarDBNavButton); + procedure RemoveButton(AButton: TdxBarDBNavButton); + procedure CheckItemsEnable; + protected + Buttons: array[TdxBarDBNavButtonType] of TdxBarDBNavButton; + procedure ActiveChanged; + procedure DataChanged; + procedure EditingChanged; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + published + property BarManager: TdxBarManager read FBarManager write SetBarManager; + property CategoryName: string read FCategoryName write SetCategoryName; + property ConfirmDelete: Boolean read FConfirmDelete write FConfirmDelete; + property DataSource: TDataSource read GetDataSource write SetDataSource; + property DBCheckLinks: TdxBarDBCheckLinks read FDBCheckLinks write SetDBNavItems; + property VisibleButtons: TdxBarDBNavButtonTypes read FVisibleButtons + write SetVisibleButtons default []; + end; + +implementation + +{$R dxBarDBNav.res} + +uses + Windows, SysUtils, Forms, dxBarDBNavStrs; + +const + BtnResStr = 'DXBARDBNAVBTN_'; + dxBarDBNavBtnName = 'dxBarDBNav'; + +{ TdxBarDBNavDataLink } + +procedure TdxBarDBNavDataLink.ActiveChanged; +begin + if FNavigator <> nil then FNavigator.ActiveChanged; +end; + +procedure TdxBarDBNavDataLink.DataSetChanged; +begin + if FNavigator <> nil then FNavigator.DataChanged; +end; + +procedure TdxBarDBNavDataLink.EditingChanged; +begin + if FNavigator <> nil then FNavigator.EditingChanged; +end; + +{ TdxBarDBCheckLink } + +procedure TdxBarDBCheckLink.FreeNotification(Sender: TComponent); +begin + Free; +end; + +function TdxBarDBCheckLink.GetDBNavigator: TdxBarDBNavigator; +begin + Result := TdxBarDBCheckLinks(Collection).FDBNavigator; +end; + +procedure TdxBarDBCheckLink.SetEnableTypes(Value: TdxBarDBEnableTypes); +begin + if FEnableTypes <> Value then + begin + FEnableTypes := Value; + TdxBarDBCheckLinks(Collection).FDBNavigator.DataChanged; + end; +end; + +procedure TdxBarDBCheckLink.SetItem(Value: TdxBarItem); +begin + if Value <> FItem then + begin + if FItem <> nil then + FFreeNotificator.RemoveSender(FItem); + FItem := Value; + if FItem <> nil then + FFreeNotificator.AddSender(FItem); + end; +end; + +constructor TdxBarDBCheckLink.Create(Collection: TCollection); +begin + inherited Create(Collection); + FFreeNotificator := TcxFreeNotificator.Create(nil); + FFreeNotificator.OnFreeNotification := FreeNotification; +end; + +destructor TdxBarDBCheckLink.Destroy; +begin + Item := nil; + FreeAndNil(FFreeNotificator); + inherited Destroy; +end; + +procedure TdxBarDBCheckLink.Assign(Value: TPersistent); +var + ADBNavItem: TdxBarDBCheckLink; +begin + if Value is TdxBarDBCheckLink then + begin + ADBNavItem := TdxBarDBCheckLink(Value); + if (ADBNavItem.Item <> nil) and (DBNavigator <> nil) and + (csUpdating in DBNavigator.ComponentState) and (DBNavigator.BarManager <> nil) then + Item := DBNavigator.BarManager.GetItemByName(ADBNavItem.Item.Name) + else + Item := ADBNavItem.Item; + FEnableTypes := ADBNavItem.FEnableTypes; + end + else + inherited Assign(Value); +end; + +{ TdxBarDBCheckLinks } + +function TdxBarDBCheckLinks.GetItem(Index: Integer): TdxBarDBCheckLink; +begin + if (Index > -1) and (Index < Count) then + Result := TdxBarDBCheckLink(inherited Items[Index]) + else Result := nil; +end; + +function TdxBarDBCheckLinks.GetOwner: TPersistent; +begin + Result := FDBNavigator; +end; + +function TdxBarDBCheckLinks.Add: TdxBarDBCheckLink; +begin + Result := TdxBarDBCheckLink(inherited Add); +end; + +{ dxBarDBNavButton } + +destructor TdxBarDBNavButton.Destroy; +begin + if BarDBNavigator <> nil then + BarDBNavigator.RemoveButton(Self); + inherited Destroy; +end; + +procedure TdxBarDBNavButton.SetNavButton(Value: TdxBarDBNavButtonType); +const + dxBarNames: array[TdxBarDBNavButtonType] of string = + ('First', 'Prev', 'Next', 'Last', + 'Insert', 'Delete', 'Edit', 'Post', 'Cancel', 'Refresh'); + PResStrs: array[TdxBarDBNavButtonType] of Pointer = (@dxSBAR_BTNCAPTION_FIRST, + @dxSBAR_BTNCAPTION_PRIOR, @dxSBAR_BTNCAPTION_NEXT, @dxSBAR_BTNCAPTION_LAST, + @dxSBAR_BTNCAPTION_INSERT, @dxSBAR_BTNCAPTION_DELETE, @dxSBAR_BTNCAPTION_EDIT, + @dxSBAR_BTNCAPTION_POST, @dxSBAR_BTNCAPTION_CANCEL, @dxSBAR_BTNCAPTION_REFRESH); +begin + if (FNavButton <> Value) or (Name = '') then + if csLoading in ComponentState then + FNavButton := Value + else + begin + if (BarDBNavigator <> nil) and not BarDBNavigator.FSetVisFlag and + (BarDBNavigator.Buttons[Value] <> nil) then + raise Exception.Create(cxGetResourceString(@dxSBAR_DBNAVERROR1)); + if (BarDBNavigator <> nil) and not BarDBNavigator.FSetVisFlag then + BarDBNavigator.RemoveButton(Self); + FNavButton := Value; + if BarDBNavigator <> nil then + begin + BarDBNavigator.AddButton(Self); + Glyph.LoadFromResourceName(HInstance, + PChar(BtnResStr + IntToStr(Integer(FNavButton) + 1))); + end; + try + if BarManager.Designing then + Name := (BarManager as IdxBarDesigner).UniqueName(dxBarDBNavBtnName + dxBarNames[FNavButton]); + Caption := cxGetResourceString(PResStrs[FNavButton]); + Hint := Caption; + except + raise; + end; + end; +end; + +procedure TdxBarDBNavButton.Loaded; +begin + inherited Loaded; + if BarDBNavigator <> nil then + begin + BarDBNavigator.AddButton(Self); + BarDBNavigator.ActiveChanged; + end; +end; + +procedure TdxBarDBNavButton.DoClick; +begin + inherited; + if Assigned(OnClick) then Exit; + if BarDBNavigator <> nil then + with BarDBNavigator.FDataLink.DataSet do + case FNavButton of + dxbnFirst: First; + dxbnPrior: Prior; + dxbnNext: Next; + dxbnLast: Last; + dxbnInsert: Insert; + dxbnDelete: + if not BarDBNavigator.ConfirmDelete or + (Application.MessageBox(PChar(cxGetResourceString(@dxSBAR_DELETERECORD)), + PChar(Application.Title), MB_ICONQUESTION or MB_YESNO) = ID_YES) then + Delete; + dxbnEdit: Edit; + dxbnPost: Post; + dxbnCancel: Cancel; + dxbnRefresh: Refresh; + end; +end; + +{ TdxBarDBNavigator } + +constructor TdxBarDBNavigator.Create(AOwner: TComponent); +var + ABarManager: TdxBarManager; +begin + ABarManager := GetBarManagerForComponent(AOwner); + {if (ABarManager = nil) and (dxBarManagerList.Count <> 0) then + ABarManager := dxBarManagerList[0];} + inherited Create(AOwner); + FBarManager := ABarManager; + FDataLink := TdxBarDBNavDataLink.Create; + FDataLink.FNavigator := Self; + FCategoryName := cxGetResourceString(@dxSBAR_CATEGORYNAME); + FDBCheckLinks := TdxBarDBCheckLinks.Create(TdxBarDBCheckLink); + FDBCheckLinks.FDBNavigator := Self; +end; + +destructor TdxBarDBNavigator.Destroy; +begin + VisibleButtons := []; + FDBCheckLinks.Free; + FDataLink.FNavigator := nil; + FDataLink.Free; + inherited Destroy; +end; + +procedure TdxBarDBNavigator.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if Operation = opRemove then + begin + if AComponent = BarManager then BarManager := nil; + if AComponent = DataSource then DataSource := nil; + end; +end; + +procedure TdxBarDBNavigator.CheckItemsEnable; +var + I: Integer; + Flag: Boolean; +begin + for I := 0 to FDBCheckLinks.Count - 1 do + with FDBCheckLinks[I] do + if Item <> nil then + begin + Flag := FDataLink.Active; + if dxdbtCanModify in EnableTypes then + Flag := Flag and FDataLink.DataSet.CanModify; + if dxdbtNotEOF in EnableTypes then + Flag := Flag and not FDataLink.DataSet.EOF; + if dxdbtNotBOF in EnableTypes then + Flag := Flag and not FDataLink.DataSet.BOF; + if dxdbtHasRecords in EnableTypes then + Flag := Flag and not (FDataLink.DataSet.BOF and FDataLink.DataSet.EOF); + if dxdbtIsModified in EnableTypes then + Flag := Flag and FDataLink.Editing; + if dxdbtIsNotModified in EnableTypes then + Flag := Flag and not FDataLink.Editing; + Item.Enabled := Flag; + end; +end; + +procedure TdxBarDBNavigator.DataChanged; +var + UpEnable, DnEnable: Boolean; +begin + UpEnable := FDataLink.Active and not FDataLink.DataSet.BOF; + DnEnable := FDataLink.Active and not FDataLink.DataSet.EOF; + if Buttons[dxbnFirst] <> nil then + Buttons[dxbnFirst].Enabled := UpEnable; + if Buttons[dxbnPrior] <> nil then + Buttons[dxbnPrior].Enabled := UpEnable; + if Buttons[dxbnNext] <> nil then + Buttons[dxbnNext].Enabled := DnEnable; + if Buttons[dxbnLast] <> nil then + Buttons[dxbnLast].Enabled := DnEnable; + if Buttons[dxbnDelete] <> nil then + Buttons[dxbnDelete].Enabled := FDataLink.Active and FDataLink.DataSet.CanModify and + not (FDataLink.DataSet.BOF and FDataLink.DataSet.EOF); + if Buttons[dxbnRefresh] <> nil then + Buttons[dxbnRefresh].Enabled := FDataLink.Active; + CheckItemsEnable; +end; + +procedure TdxBarDBNavigator.EditingChanged; +var + CanModify: Boolean; +begin + CanModify := FDataLink.Active and FDataLink.DataSet.CanModify; + if Buttons[dxbnInsert] <> nil then + Buttons[dxbnInsert].Enabled := CanModify; + if Buttons[dxbnEdit] <> nil then + Buttons[dxbnEdit].Enabled := CanModify and not FDataLink.Editing; + if Buttons[dxbnPost] <> nil then + Buttons[dxbnPost].Enabled := CanModify and FDataLink.Editing; + if Buttons[dxbnCancel] <> nil then + Buttons[dxbnCancel].Enabled := CanModify and FDataLink.Editing; + CheckItemsEnable; +end; + +procedure TdxBarDBNavigator.ActiveChanged; +var + I: TdxBarDBNavButtonType; + J: Integer; +begin + if not FDataLink.Active then + begin + for I := Low(Buttons) to High(Buttons) do + if Buttons[I] <> nil then + Buttons[I].Enabled := False; + for J := 0 to FDBCheckLinks.Count - 1 do + if FDBCheckLinks[J].Item <> nil then + FDBCheckLinks[J].Item.Enabled := False; + end + else + begin + DataChanged; + EditingChanged; + end; +end; + +function TdxBarDBNavigator.GetDataSource: TDataSource; +begin + Result := FDataLink.DataSource; +end; + +procedure TdxBarDBNavigator.SetBarManager(Value: TdxBarManager); +var + SaveVisButtons: TdxBarDBNavButtonTypes; +begin + if FBarManager <> Value then + begin + SaveVisButtons := FVisibleButtons; + VisibleButtons := []; + FBarManager := Value; + VisibleButtons := SaveVisButtons; + end; +end; + +procedure TdxBarDBNavigator.SetCategoryName(Value: string); +var + Index1, Index2: Integer; + I: TdxBarDBNavButtonType; +begin + if FCategoryName <> Value then + if csLoading in ComponentState then + FCategoryName := Value + else + if BarManager <> nil then + begin + Index1 := BarManager.Categories.IndexOf(FCategoryName); + FCategoryName := Value; + Index2 := BarManager.Categories.IndexOf(FCategoryName); + if Index2 = -1 then + begin + BarManager.Categories.Add(FCategoryName); + Index2 := BarManager.Categories.IndexOf(FCategoryName); + end; + for I := Low(Buttons) to High(Buttons) do + if Buttons[I] <> nil then Buttons[I].Category := Index2; + if (Index1 > -1) and (BarManager.GetCountByCategory(Index1) = 0) then + BarManager.Categories.Delete(Index1); + end; +end; + +procedure TdxBarDBNavigator.SetDataSource(Value: TDataSource); +begin + FDataLink.DataSource := Value; + if not (csLoading in ComponentState) then ActiveChanged; + if Value <> nil then Value.FreeNotification(Self); +end; + +procedure TdxBarDBNavigator.SetDBNavItems(Value: TdxBarDBCheckLinks); +begin + FDBCheckLinks.Assign(Value); + DataChanged; +end; + +procedure TdxBarDBNavigator.SetVisibleButtons(Value: TdxBarDBNavButtonTypes); +var + I: TdxBarDBNavButtonType; + AIndex: Integer; +begin + if FVisibleButtons <> Value then + begin + FVisibleButtons := Value; + FSetVisFlag := True; + if not (csLoading in ComponentState) and (BarManager <> nil) then + for I := Low(Buttons) to High(Buttons) do + begin + if (Buttons[I] <> nil) and //not (csDestroying in Buttons[I].ComponentState) and + not (I in Value) then + begin + Buttons[I].Free; + Buttons[I] := nil; + end; + if (Buttons[I] = nil) and (I in Value) then + begin + Buttons[I] := TdxBarDBNavButton.Create(Owner); + with Buttons[I] do + begin + BarDBNavigator := Self; + AIndex := BarManager.Categories.IndexOf(FCategoryName); + if AIndex = -1 then + begin + BarManager.Categories.Add(FCategoryName); + AIndex := BarManager.Categories.IndexOf(FCategoryName); + end; + Category := AIndex; + NavButton := I; + end; + end; + end; + ActiveChanged; + FSetVisFlag := False; + end; + if (FVisibleButtons = []) and (BarManager <> nil) and + not (csDestroying in BarManager.ComponentState) then + begin + AIndex := BarManager.Categories.IndexOf(FCategoryName); + if (AIndex > -1) and (BarManager.GetCountByCategory(AIndex) = 0) then + BarManager.Categories.Delete(AIndex); + end; +end; + +procedure TdxBarDBNavigator.AddButton(AButton: TdxBarDBNavButton); +begin + Buttons[AButton.NavButton] := AButton; + FVisibleButtons := FVisibleButtons + [AButton.NavButton]; +end; + +procedure TdxBarDBNavigator.RemoveButton(AButton: TdxBarDBNavButton); +begin + Buttons[AButton.NavButton] := nil; + FVisibleButtons := FVisibleButtons - [AButton.NavButton]; +end; + +initialization + dxBarRegisterItem(TdxBarDBNavButton, TdxBarButtonControl, False); + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBarDBNav.res b/official/x.35/ExpressBars 6/Sources/dxBarDBNav.res new file mode 100644 index 00000000..bbba3ec0 Binary files /dev/null and b/official/x.35/ExpressBars 6/Sources/dxBarDBNav.res differ diff --git a/official/x.35/ExpressBars 6/Sources/dxBarDBNavReg.dcr b/official/x.35/ExpressBars 6/Sources/dxBarDBNavReg.dcr new file mode 100644 index 00000000..e7b38737 Binary files /dev/null and b/official/x.35/ExpressBars 6/Sources/dxBarDBNavReg.dcr differ diff --git a/official/x.35/ExpressBars 6/Sources/dxBarDBNavReg.pas b/official/x.35/ExpressBars 6/Sources/dxBarDBNavReg.pas new file mode 100644 index 00000000..ed4c7dd3 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarDBNavReg.pas @@ -0,0 +1,88 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars DB Navigator registring unit } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarDBNavReg; + +{$I cxVer.inc} + +interface + +procedure Register; + +implementation + +uses + Classes, SysUtils,{$IFDEF DELPHI6} DesignIntf, DesignEditors,{$ELSE} DsgnIntf,{$ENDIF} + dxBarDBNav, dxBarDBCheckLinksEd; + +{ TdxBarDBCheckLinksPropertyEditor } + +type + TdxBarDBCheckLinksPropertyEditor = class(TPropertyEditor) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + end; + +procedure TdxBarDBCheckLinksPropertyEditor.Edit; +begin + if dxBarDBCheckLinksEditor(TdxBarDBNavigator(GetComponent(0))) then Modified; +end; + +function TdxBarDBCheckLinksPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paDialog]; +end; + +function TdxBarDBCheckLinksPropertyEditor.GetValue: string; +begin + Result := Format('(%s)', [TdxBarDBCheckLinks.ClassName]); +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterComponents('ExpressBars', [TdxBarDBNavigator]); + RegisterNoIcon([TdxBarDBNavButton]); + RegisterPropertyEditor(TypeInfo(TdxBarDBNavigator), TdxBarDBNavButton, + 'BarDBNavigator', nil); + RegisterPropertyEditor(TypeInfo(TdxBarDBCheckLinks), TdxBarDBNavigator, + 'DBCheckLinks', TdxBarDBCheckLinksPropertyEditor); +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBarDBNavStrs.pas b/official/x.35/ExpressBars 6/Sources/dxBarDBNavStrs.pas new file mode 100644 index 00000000..ee8b4fca --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarDBNavStrs.pas @@ -0,0 +1,59 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars DB Navigator string table constants } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarDBNavStrs; + +interface + +resourcestring + dxSBAR_DBNAVERROR1 = 'You already have an existing DBNavigator button with the same defined style'; + + dxSBAR_CATEGORYNAME = 'DB Navigator'; + dxSBAR_DELETERECORD = 'Do you want to delete the current record?'; + + dxSBAR_BTNCAPTION_FIRST = 'First'; + dxSBAR_BTNCAPTION_PRIOR = 'Prior'; + dxSBAR_BTNCAPTION_NEXT = 'Next'; + dxSBAR_BTNCAPTION_LAST = 'Last'; + dxSBAR_BTNCAPTION_INSERT = 'Insert'; + dxSBAR_BTNCAPTION_DELETE = 'Delete'; + dxSBAR_BTNCAPTION_EDIT = 'Edit'; + dxSBAR_BTNCAPTION_POST = 'Post'; + dxSBAR_BTNCAPTION_CANCEL = 'Cancel'; + dxSBAR_BTNCAPTION_REFRESH = 'Refresh'; + +implementation + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBarExtDBItems.pas b/official/x.35/ExpressBars 6/Sources/dxBarExtDBItems.pas new file mode 100644 index 00000000..1579cc5c --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarExtDBItems.pas @@ -0,0 +1,1440 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars extended DB items } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarExtDBItems; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Db, StdCtrls, Forms, + dxCommon, dxBar; + +type + TdxBarLookupCombo = class; + TdxBarPopupLookupControl = class; + + TdxBarLookupLink = class(TDataLink) + private + FBarLookupCombo: TdxBarLookupCombo; + protected + procedure ActiveChanged; override; + procedure DataSetChanged; override; + procedure LayoutChanged; override; + end; + + TdxBarLookupCombo = class(TCustomdxBarCombo) + private + FAllowResizing: Boolean; + FCurKeyValue: Variant; + FListLink: TdxBarLookupLink; + FPopupList: TdxBarPopupLookupControl; + FKeyFieldName: string; + FListFieldName: string; + FListFieldIndex: Integer; + FKeyField: TField; + FListField: TField; + FListFields: TList; + FKeyValue: Variant; + FSetValue: Boolean; + FListActive: Boolean; + FColor: TColor; + FImmediateDropDown : Boolean; + FPopupWidth: Integer; + + FRowCount: Integer; + + FListVisible: Boolean; + FFindSelection: Boolean; + FFindStr: string; + FInFindSelection: Boolean; + + FLocateEdit: TEdit; + FLocateList: TdxBarPopupLookupControl; + + FOnKeyValueChange: TNotifyEvent; + + FForm: TForm; + ButtonOk, ButtonCancel: TButton; + + function GetListSource: TDataSource; + procedure SetKeyFieldName(const Value: string); + procedure SetKeyValue(const Value: Variant); + procedure SetListFieldIndex(Value: Integer); + procedure SetListFieldName(const Value: string); + procedure SetListSource(Value: TDataSource); + procedure SetRowCount(Value: Integer); + + function GetEditHandle : Integer; + function GetEditText : String; + procedure SetEditText(AText : String); + procedure DoKeyPress(Sender: TObject; var Key: Char); + procedure DoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + + procedure FormSize(Sender: TObject); + protected + procedure CloseUp; override; + procedure DoEnter; override; + procedure DropDown(X, Y: Integer); override; + function GetDropDownWindow: HWND; override; + function CheckKeyForDropDownWindow(Key: Word; Shift: TShiftState): Boolean; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + + procedure UpdateListFields; + procedure ListLinkDataChanged; + procedure KeyValueChanged; + function LocateKey: Boolean; + procedure ResetFindStr; + + property EditText: string read GetEditText write SetEditText; + property ListFields: TList read FListFields; + property ListLink: TdxBarLookupLink read FListLink; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure DoClick; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + + property KeyValue: Variant read FKeyValue write SetKeyValue; + published + property AllowResizing: Boolean read FAllowResizing write FAllowResizing default True; + property Color: TColor read FColor write FColor default clWindow; + property ImmediateDropDown: Boolean read FImmediateDropDown write FImmediateDropDown default False; + property KeyField: string read FKeyFieldName write SetKeyFieldName; + property ListField: string read FListFieldName write SetListFieldName; + property ListFieldIndex: Integer read FListFieldIndex write SetListFieldIndex default 0; + property ListSource: TDataSource read GetListSource write SetListSource; + property RowCount: Integer read FRowCount write SetRowCount; + property Text stored False; + property PopupWidth: Integer read FPopupWidth write FPopupWidth default 0; + + property OnKeyValueChange: TNotifyEvent read FOnKeyValueChange write FOnKeyValueChange; + end; + + TdxBarLookupComboControl = class(TCustomdxBarComboControl) + protected + procedure SetFocused(Value: Boolean); override; + procedure WndProc(var Message: TMessage); override; + end; + + TdxBarPopupLookupLink = class(TDataLink) + private + FBarPopupLookup: TdxBarPopupLookupControl; + protected + procedure ActiveChanged; override; + procedure DataSetChanged; override; + procedure LayoutChanged; override; + procedure DataSetScrolled(Distance: Integer); override; + end; + + TdxBarPopupLookupControl = class(TCustomControl) + private + FListLink: TdxBarPopupLookupLink; + FListFieldName: string; + FListFieldIndex: Integer; + FListField: TField; + FListFields: TList; + FListActive : Boolean; + + FRecordIndex: Integer; + FRecordCount: Integer; + FRowCount: Integer; + FTracking: Boolean; + FTimerActive: Boolean; + FMousePos: Integer; + FSelectedItem: string; + + FHScrollWidth : Integer; + FVScrollWidth : Integer; + FCloseBtnDown : Boolean; + FCloseBtnPaint : Boolean; + FComboTop : Integer; + + FCombo: TdxBarLookupCombo; + FCorner: TdxCorner; + FCloseButtonRect, FGripRect: TRect; + FCloseButtonIsTracking: Boolean; + FMouseAboveCloseButton: Boolean; + + function GetListSource: TDataSource; + function GetPainter: TdxBarPainter; + procedure SetListFieldName(const Value: string); + procedure SetListSource(Value: TDataSource); + + procedure SelectCurrent; + procedure SelectItemAt(X, Y: Integer); + procedure SetRowCount(Value: Integer); + procedure StopTimer; + procedure StopTracking; + procedure TimerScroll; + procedure UpdateScrollBar; + + procedure WMCancelMode(var Message: TMessage); message WM_CANCELMODE; + procedure WMCaptureChanged(var Message: TMessage); message WM_CAPTURECHANGED; + procedure WMEraseBkgnd(var Message: TWmEraseBkgnd); message WM_ERASEBKGND; + procedure WMGetDlgCode(var Message: TMessage); message WM_GETDLGCODE; + procedure WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); message WM_GETMINMAXINFO; + procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCHitTest(var Message: TWMNCHITTEST); message WM_NCHITTEST; + procedure WMNCLButtonDown(var Message: TWMNCLButtonDown); message WM_NCLBUTTONDOWN; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure WMSize(var Message: TWMSize); message WM_SIZE; + procedure WMTimer(var Message: TMessage); message WM_TIMER; + procedure WMVScroll(var Message: TWMVScroll); message WM_VSCROLL; + procedure WMWindowPosChanging(var Message : TWMWINDOWPOSCHANGING); message WM_WINDOWPOSCHANGING; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + procedure DblClick; override; + procedure Notification(AComponent: TComponent; + Operation: TOperation); override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure ListLinkDataChanged; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure Paint; override; + + function GetTextHeight: Integer; + procedure UpdateListFields; + + property ListField: string read FListFieldName write SetListFieldName; + property ListFieldIndex: Integer read FListFieldIndex write FListFieldIndex default 0; + property ListFields: TList read FListFields; + property ListLink: TdxBarPopupLookupLink read FListLink; + property ListSource: TDataSource read GetListSource write SetListSource; + property Painter: TdxBarPainter read GetPainter; + public + IsPopup: Boolean; + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + property ComboTop: Integer read FComboTop write FComboTop; + property RowCount: Integer read FRowCount write SetRowCount stored False; + property SelectedItem: string read FSelectedItem; + end; + +implementation + +{$R dxBarExtDBItems.res} + +uses + {$IFDEF DELPHI6}Variants,{$ENDIF} dxBarCommon, cxClasses, dxBarStrs; + +function VarEquals(const V1, V2: Variant): Boolean; +begin + Result := False; + try + Result := V1 = V2; + except + end; +end; + +{ TdxBarLookupLink } + +procedure TdxBarLookupLink.ActiveChanged; +begin + if FBarLookupCombo <> nil then FBarLookupCombo.UpdateListFields; +end; + +procedure TdxBarLookupLink.DataSetChanged; +begin + if FBarLookupCombo <> nil then FBarLookupCombo.ListLinkDataChanged; +end; + +procedure TdxBarLookupLink.LayoutChanged; +begin + if FBarLookupCombo <> nil then FBarLookupCombo.UpdateListFields; +end; + +{ TdxBarLookupCombo } + +constructor TdxBarLookupCombo.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Glyph.LoadFromResourceName(HInstance, 'DXBARLOOKUPCOMBO'); + + FAllowResizing := True; + FListLink := TdxBarLookupLink.Create; + FListLink.FBarLookupCombo := Self; + FListFields := TList.Create; + FKeyValue := Null; + FRowCount := 7; + FPopupList := TdxBarPopupLookupControl.Create(nil); + FColor := clWindow; + with FPopupList do + begin + FCombo := Self; + end; +end; + +destructor TdxBarLookupCombo.Destroy; +begin + FPopupList.Free; + FListFields.Free; + FListLink.FBarLookupCombo := nil; + FListLink.Free; + + inherited Destroy; +end; + +procedure TdxBarLookupCombo.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if Operation = opRemove then + if (FListLink <> nil) and (AComponent = ListSource) then ListSource := nil; +end; + +procedure TdxBarLookupCombo.CloseUp; +begin + if GetCapture = FPopupList.Handle then ReleaseCapture; + + RowCount := FPopupList.RowCount; + FPopupWidth := FPopupList.Width; + FListVisible := False; + ResetFindStr; + if FKeyField = nil then + FCurKeyValue := Null + else + FCurKeyValue := FKeyField.Value; + + inherited; + + FPopupList.ListSource := nil; + FPopupList.Parent := nil; +end; + +procedure TdxBarLookupCombo.DoEnter; +begin + ResetFindStr; + inherited; +end; + +procedure TdxBarLookupCombo.DropDown(X, Y: Integer); +var + AControlWidth: Integer; + R: TRect; + W: Integer; +begin + FSetValue := False; + + with FPopupList do + begin + IsPopup := True; + Parent := CurItemLink.Control.Parent; + GetWindowRect(TdxBarLookupComboControl(CurItemLink.Control).Handle, R); + ComboTop := R.Top + (R.Bottom - R.Top) div 2; + InternalInitDropDownWindow(FPopupList); + if Self.Color <> clWindow then + Color := Self.Color; + + if Self.ListField <> '' then + ListField := Self.ListField + else + ListField := Self.KeyField; + ListFieldIndex := Self.ListFieldIndex; + RowCount := Self.RowCount; + ListSource := Self.ListSource; + if FListLink.Active then + FRecordCount := FListLink.RecordCount; + if not FInFindSelection and not VarIsNull(FCurKeyValue) and FListLink.Active then + FListLink.DataSet.Locate(FKeyFieldName, FCurKeyValue, []); + end; + + with CurItemLink.ItemRect do + W := Right - Left - TdxBarLookupComboControl(CurItemLink.Control).GetCaptionAreaWidth; + if W > FPopupWidth then + AControlWidth := W + else + AControlWidth := FPopupWidth; + + SetWindowPos(FPopupList.Handle, 0, 0, 0, AControlWidth, FPopupList.Height, + SWP_NOZORDER or SWP_NOMOVE or SWP_NOACTIVATE); + FListVisible := True; + + inherited DropDown(X, Y); +end; + +procedure TdxBarLookupCombo.DoClick; +var + W, H, D, I, J: Integer; +begin + inherited DoClick; + if Assigned(OnClick) or ReadOnly then + Exit; + + FForm := TForm.Create(nil); + with FForm do + begin + if FAllowResizing then + BorderIcons := [] + else + BorderStyle := bsDialog; + Caption := cxGetResourceString(@dxSBAR_LOOKUPDIALOGCAPTION); + Font := BarManager.Font; + Position := poScreenCenter; + + FLocateEdit := TEdit.Create(FForm); + with FLocateEdit do + begin + Parent := FForm; + OnKeyPress := DoKeyPress; + OnKeyDown := DoKeyDown; + end; + FLocateList := TdxBarPopupLookupControl.Create(FForm); + with FLocateList do + begin + FCombo := Self; + IsPopup := False; + Parent := FForm; + Color := clWindow; + if Self.ListField <> '' then + ListField := Self.ListField + else + ListField := Self.KeyField; + ListFieldIndex := Self.ListFieldIndex; + ListSource := Self.ListSource; + + Height := 2 * 2 + Self.RowCount * GetTextHeight; + if Self.FPopupWidth = 0 then + Width := FLocateEdit.Width + else + Width := Self.FPopupWidth; + end; + ButtonOk := TButton.Create(FForm); + with ButtonOk do + begin + Caption := cxGetResourceString(@dxSBAR_LOOKUPDIALOGOK); + Default := True; + ModalResult := mrOk; + Parent := FForm; + end; + ButtonCancel := TButton.Create(FForm); + with ButtonCancel do + begin + Caption := cxGetResourceString(@dxSBAR_LOOKUPDIALOGCANCEL); + Cancel := True; + ModalResult := mrCancel; + Parent := FForm; + end; + + H := MulDiv(FLocateEdit.Height, 43, 42); + W := MulDiv(H, 13, 4); + D := FLocateEdit.Height div 4; + + FLocateEdit.SetBounds(D, D, FLocateList.Width, FLocateEdit.Height); + with FLocateList do + begin + Left := D; + Top := FLocateEdit.BoundsRect.Bottom + D; + end; + ButtonOk.SetBounds(FLocateList.BoundsRect.Right + D, D, W, H); + ButtonCancel.SetBounds(ButtonOk.Left, ButtonOk.BoundsRect.Bottom + D, W, H); + I := D + FLocateList.Width + D + W + D; + J := D + FLocateEdit.Height + D + FLocateList.Height + D; + if J < 3 * D + 2 * H then J := 3 * D + 2 * H; + while (ClientWidth <> I) or (ClientHeight <> J) do + begin + ClientWidth := I; + ClientHeight := J; + end; + + OnResize := FormSize; + FLocateEdit.Text := Text; + LocateKey; + FListVisible := True; + if (ShowModal = mrOk) and FListActive then + begin + if FKeyField <> nil then FKeyValue := FKeyField.Value; + KeyValueChanged; + end; + RowCount := FLocateList.RowCount; + FPopupWidth := FLocateList.Width; + ResetFindStr; + FListVisible := False; + Free; + FLocateEdit := nil; + end; +end; + +function TdxBarLookupCombo.GetEditHandle: Integer; +begin + if FLocateEdit = nil then + Result := TCustomdxBarComboControl(CurItemLink.Control).Handle + else + Result := FLocateEdit.Handle; +end; + +function TdxBarLookupCombo.GetEditText: string; +begin + if FLocateEdit = nil then + Result := CurText + else + Result := FLocateEdit.Text; +end; + +procedure TdxBarLookupCombo.SetEditText(AText: string); +begin + if FLocateEdit = nil then + CurText := AText + else + FLocateEdit.Text := AText; +end; + +function TdxBarLookupCombo.GetDropDownWindow: HWND; +begin + Result := inherited GetDropDownWindow; + if Result = 0 then Result := FPopupList.Handle; +end; + +procedure TdxBarLookupCombo.DoKeyPress(Sender: TObject; var Key: Char); +begin + KeyPress(Key); +end; + +procedure TdxBarLookupCombo.DoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); +begin + if CheckKeyForDropDownWindow(Key, Shift) then + begin + FLocateList.KeyDown(Key, Shift); + Key := 0; + end; +end; + +procedure TdxBarLookupCombo.FormSize(Sender: TObject); +var + H, W, D: Integer; +begin + H := MulDiv(FLocateEdit.Height, 43, 42); + W := MulDiv(H, 13, 4); + D := FLocateEdit.Height div 4; + + FLocateEdit.SetBounds(D, D, FForm.ClientWidth - (D + D + W + D), FLocateEdit.Height); + with FLocateList do + begin + Left := D; + Top := FLocateEdit.Top + FLocateEdit.Height + D; + Width := FLocateEdit.Width; + Height := FForm.ClientHeight - D - Top; + end; + ButtonOk.SetBounds(FForm.ClientWidth - D - W, D, W, H); + ButtonCancel.SetBounds(ButtonOk.Left, ButtonOk.Top + ButtonOk.Height + D, W, H); +end; + +function TdxBarLookupCombo.CheckKeyForDropDownWindow(Key: Word; Shift: TShiftState): Boolean; +begin +// if {(FCombo <> nil) and }(Key = VK_RETURN) then + if Key in [VK_RETURN, VK_TAB] then + FSetValue := True; + Result := Key in [VK_UP, VK_LEFT, VK_DOWN, VK_RIGHT, VK_PRIOR, VK_NEXT, VK_HOME, VK_END]; +end; + +procedure TdxBarLookupCombo.KeyDown(var Key: Word; Shift: TShiftState); +begin + if Key = VK_ESCAPE then + ResetFindStr; + inherited KeyDown(Key, Shift); +end; + +procedure TdxBarLookupCombo.KeyPress(var Key: Char); +var + lFind, ASelectedAll: Boolean; + AStartPos, AEndPos: Integer; +begin + if FListField <> nil then + try + case Key of + #8: // BkSpace + begin + SendMessage(GetEditHandle, EM_GETSEL, Longint(@AStartPos), Longint(@AEndPos)); + ASelectedAll := (AEndPos - AStartPos) = Length(EditText); + if ASelectedAll then + begin + ResetFindStr; + EditText := ''; + end + else + if FFindSelection then + begin + FFindStr := Copy(FFindStr, 0, Length(FFindStr)-1); + SendMessage(GetEditHandle, EM_SETSEL, Length(FFindStr), Length(EditText)); + end; + end; + #32..#255: + begin + FInFindSelection := True; + try + if FFindSelection then begin + FFindStr := FFindStr + Key; + end else begin + FFindSelection := true; + FFindStr := Key; + end; + lFind := False; + try + lFind := FListLink.DataSet.Locate(FListField.FieldName, FFindStr, [loCaseInsensitive, loPartialKey]) + except end; + if lFind then + begin + EditText := FListField.DisplayText; + SendMessage(GetEditHandle, EM_SETSEL, Length(FFindStr), Length(EditText)); + // FSetValue := True; + end + else + begin + if FFindSelection and (Length(FFindStr) > 1) then + begin + FFindStr := Copy(FFindStr, 1, Length(FFindStr)-1); + if not FListVisible then DroppedDown := True; + end + else + begin + ResetFindStr; + EditText := ''; + end; + if not FListVisible then DroppedDown := True; + end; + if FImmediateDropDown and not FListVisible then + begin + DroppedDown := True; + end; + finally + FInFindSelection := False; + end; + end; + end; + finally + Key := #0; + inherited KeyPress(Key); + end; +end; + +procedure TdxBarLookupCombo.UpdateListFields; +var + DataSet: TDataSet; +begin + FKeyField := nil; + FListField := nil; + FListFields.Clear; + FListActive := False; + if FListLink.Active {and (FKeyFieldName <> '') }then + begin + DataSet := FListLink.DataSet; + FKeyField := DataSet.FindField(FKeyFieldName); + try + DataSet.GetFieldList(FListFields, FListFieldName); + except + raise; + end; + if (FListFields.Count = 0) and (FKeyField <> nil) then + FListFields.Add(FKeyField); + if FListFields.Count <> 0 then + if (0 <= FListFieldIndex) and (FListFieldIndex < FListFields.Count) then + FListField := FListFields[FListFieldIndex] + else + FListField := FListFields[0]; + FListActive := FListField <> nil; + end; + if FKeyField = nil then FKeyValue := Null; +end; + +procedure TdxBarLookupCombo.ListLinkDataChanged; +begin + if FListActive then + begin + if not VarIsNull(FKeyValue) and VarEquals(FKeyValue, FKeyField.Value) then + Text := FListField.DisplayText; + end; +end; + +procedure TdxBarLookupCombo.KeyValueChanged; +begin + if FListActive and not LocateKey then + ListLink.DataSet.First; + if (FListField <> nil) {and not VarIsNULL(FKeyValue) }then + CurText := FListField.DisplayText + else + CurText := ''; + if Assigned(FOnKeyValueChange) then FOnKeyValueChange(Self); + Text := CurText; +end; + +function TdxBarLookupCombo.LocateKey: Boolean; +var + KeySave: Variant; +begin + if FKeyField = nil then + Result := True + else + begin + Result := False; + try + KeySave := FKeyValue; + if not VarIsNull(FKeyValue) and FListLink.Active and + FListLink.DataSet.Locate(FKeyFieldName, FKeyValue, []) then + begin + Result := True; + FKeyValue := KeySave; + end; + except + end; + end; +end; + +procedure TdxBarLookupCombo.ResetFindStr; +begin + FFindStr := ''; + FFindSelection := False; +// FSetValue := False; +end; + +function TdxBarLookupCombo.GetListSource: TDataSource; +begin + Result := FListLink.DataSource; +end; + +procedure TdxBarLookupCombo.SetKeyFieldName(const Value: string); +begin + if FKeyFieldName <> Value then + begin + FKeyFieldName := Value; + UpdateListFields; + end; +end; + +procedure TdxBarLookupCombo.SetKeyValue(const Value: Variant); +begin + if not VarEquals(FKeyValue, Value) then + begin + FKeyValue := Value; + KeyValueChanged; + end; +end; + +procedure TdxBarLookupCombo.SetListFieldIndex(Value: Integer); +begin + if Value < 0 then Exit; + FListFieldIndex := Value; +end; + +procedure TdxBarLookupCombo.SetListFieldName(const Value: string); +begin + if FListFieldName <> Value then + begin + FListFieldName := Value; + UpdateListFields; + end; +end; + +procedure TdxBarLookupCombo.SetListSource(Value: TDataSource); +begin + FListLink.DataSource := Value; + if Value <> nil then Value.FreeNotification(Self); +end; + +procedure TdxBarLookupCombo.SetRowCount(Value: Integer); +begin + if Value < 1 then Exit; + FRowCount := Value; +end; + +{ TdxBarLookupComboControl } + +procedure TdxBarLookupComboControl.SetFocused(Value: Boolean); +var + FCombo: TdxBarLookupCombo; +begin + if Focused <> Value then + begin + inherited SetFocused(Value); + FCombo := TdxBarLookupCombo(Item); + if Value then + FCombo.FCurKeyValue := FCombo.FKeyValue; + if FCombo.FListActive and FCombo.FSetValue then + if Value then + FCombo.LocateKey + else + if (Text <> '') and (FCombo.FKeyField <> nil) then + FCombo.KeyValue := FCombo.FKeyField.Value + else + FCombo.KeyValue := Null; + end; +end; + +procedure TdxBarLookupComboControl.WndProc(var Message: TMessage); +begin + with Message do + if (Msg = WM_KEYDOWN) and ((wParam = VK_RETURN) or (wParam = VK_TAB)) then + with TdxBarLookupCombo(Item) do + begin + if FKeyField <> nil then FKeyValue := FKeyField.Value; + KeyValueChanged; + end; + inherited WndProc(Message); +end; + +{ TdxBarPopupLookupLink } + +procedure TdxBarPopupLookupLink.ActiveChanged; +begin + if FBarPopupLookup <> nil then FBarPopupLookup.UpdateListFields; +end; + +procedure TdxBarPopupLookupLink.DataSetChanged; +begin + if FBarPopupLookup <> nil then FBarPopupLookup.ListLinkDataChanged; +end; + +procedure TdxBarPopupLookupLink.LayoutChanged; +begin + if FBarPopupLookup <> nil then FBarPopupLookup.UpdateListFields; +end; + +procedure TdxBarPopupLookupLink.DataSetScrolled(Distance: Integer); +begin + if FBarPopupLookup <> nil then FBarPopupLookup.ListLinkDataChanged; +end; + +{ TdxBarPopupLookupControl } + +constructor TdxBarPopupLookupControl.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + + ControlStyle := ControlStyle - [csCaptureMouse]; + + FListLink := TdxBarPopupLookupLink.Create; + FListLink.FBarPopupLookup := Self; + FListFields := TList.Create; + FRowCount := 7; +end; + +destructor TdxBarPopupLookupControl.Destroy; +begin + FListFields.Free; + FListLink.FBarPopupLookup := nil; + FListLink.Free; + + inherited Destroy; +end; + +procedure TdxBarPopupLookupControl.WMCancelMode(var Message: TMessage); +begin + StopTracking; + inherited; +end; + +procedure TdxBarPopupLookupControl.WMCaptureChanged(var Message: TMessage); +begin + inherited; + if FCloseButtonIsTracking then + begin + FCloseButtonIsTracking := False; + FMouseAboveCloseButton := False; + SendMessage(Handle, WM_NCPAINT, 0, 0); + end; + StopTracking; +end; + +procedure TdxBarPopupLookupControl.WMEraseBkgnd(var Message: TWmEraseBkgnd); +begin + Message.Result := 1; +end; + +procedure TdxBarPopupLookupControl.WMGetDlgCode(var Message: TMessage); +begin + Message.Result := DLGC_WANTARROWS or DLGC_WANTCHARS; +end; + +procedure TdxBarPopupLookupControl.WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); +begin + inherited; + Message.MinMaxInfo^.ptMinTrackSize := Point(100, 100); +end; + +procedure TdxBarPopupLookupControl.WMLButtonUp(var Message: TWMLButtonUp); +begin + inherited; + if FCloseButtonIsTracking then + begin + FCloseButtonIsTracking := False; + ReleaseCapture; + if FMouseAboveCloseButton then + FCombo.BarManager.HideAll + else + SendMessage(Handle, WM_NCPAINT, 0, 0); + end; +end; + +procedure TdxBarPopupLookupControl.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + inherited; + if IsPopup then + Painter.SysPanelCalcSize(Handle, Message.CalcSize_Params^.rgrc[0], + FCorner, FCombo, FCombo.AllowResizing); +end; + +procedure TdxBarPopupLookupControl.WMNCHitTest(var Message : TWMNCHITTEST); +var + PrevMouseAboveCloseButton: Boolean; +begin + inherited; + with Message do + if PtInRect(FGripRect, SmallPointToPoint(Pos)) then + Result := GetHitTestByCorner(FCorner) + else + begin + PrevMouseAboveCloseButton := FMouseAboveCloseButton; + FMouseAboveCloseButton := (GetTopWindow(0) = Handle) and + ((GetCapture = 0) or FCloseButtonIsTracking) and + PtInRect(FCloseButtonRect, SmallPointToPoint(Pos)); + if FMouseAboveCloseButton then Result := HTBORDER; + if PrevMouseAboveCloseButton <> FMouseAboveCloseButton then + SendMessage(Handle, WM_NCPAINT, 0, 0); + end; +end; + +procedure TdxBarPopupLookupControl.WMNCLButtonDown(var Message: TWMNCLButtonDown); +begin + inherited; + if FMouseAboveCloseButton then + begin + FCloseButtonIsTracking := True; + SetCapture(Handle); + SendMessage(Handle, WM_NCPAINT, 0, 0); + end; +end; + +procedure TdxBarPopupLookupControl.WMNCPaint(var Message: TWMNCPaint); +begin + inherited; + if IsPopup then + Painter.SysPanelDraw(Handle, FCombo.AllowResizing, + FMouseAboveCloseButton, FCloseButtonIsTracking, FCloseButtonRect, FGripRect, FCorner); +end; + +procedure TdxBarPopupLookupControl.WMSize(var Message: TWMSize); +var + TextHeight, Rows: Integer; +begin + inherited; + TextHeight := GetTextHeight; + Rows := Message.Height div TextHeight; + if Rows < 1 then Rows := 1; + FRowCount := Rows; + if ListLink.BufferCount <> Rows then + begin + ListLink.BufferCount := Rows; + ListLinkDataChanged; + end; +end; + +procedure TdxBarPopupLookupControl.WMTimer(var Message: TMessage); +begin + TimerScroll; +end; + +procedure TdxBarPopupLookupControl.WMVScroll(var Message: TWMVScroll); +var + SI: TScrollInfo; +begin + with Message, ListLink.DataSet do + case ScrollCode of + SB_LINEUP: MoveBy(-FRecordIndex - 1); + SB_LINEDOWN: MoveBy(FRecordCount - FRecordIndex); + SB_PAGEUP: MoveBy(-FRecordIndex - FRecordCount + 1); + SB_PAGEDOWN: MoveBy(FRecordCount - FRecordIndex + FRecordCount - 2); + SB_THUMBPOSITION: + if IsSequenced then + begin + SI.cbSize := sizeof(SI); + SI.fMask := SIF_ALL; + GetScrollInfo(Self.Handle, SB_VERT, SI); + if SI.nTrackPos <= 1 then First + else if SI.nTrackPos >= RecordCount then Last + else RecNo := SI.nTrackPos; + end + else + case Pos of + 0: First; + 1: MoveBy(-FRecordIndex - FRecordCount + 1); + 2: Exit; + 3: MoveBy(FRecordCount - FRecordIndex + FRecordCount - 2); + 4: Last; + end; + SB_BOTTOM: Last; + SB_TOP: First; + end; +end; + +procedure TdxBarPopupLookupControl.WMWindowPosChanging(var Message : TWMWINDOWPOSCHANGING); +var + BorderSize, TextHeight, Rows, AHeight: Integer; +begin + if IsPopup then + begin + BorderSize := 2 + Byte(FCombo.AllowResizing) * dxDropDownNCHeight; + TextHeight := GetTextHeight; + with Message.WindowPos^ do + AHeight := cy; + Rows := (AHeight - BorderSize) div TextHeight; + if Rows < 1 then Rows := 1; + with Message.WindowPos^ do + if ComboTop < y + cy then + cy := Rows * TextHeight + BorderSize + else + if (AHeight <> 0) then begin + cy := Rows * TextHeight + BorderSize; + y := y + AHeight - cy; + end; + end; + inherited; +end; + +procedure TdxBarPopupLookupControl.CMMouseLeave(var Message: TMessage); +begin + inherited; + if FMouseAboveCloseButton then + begin + FMouseAboveCloseButton := False; + if HandleAllocated then SendMessage(Handle, WM_NCPAINT, 0, 0); + end; +end; + +procedure TdxBarPopupLookupControl.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + if IsPopup then + ExStyle := WS_EX_TOOLWINDOW or WS_EX_TOPMOST + else + ExStyle := ExStyle or WS_EX_CLIENTEDGE; +end; + +procedure TdxBarPopupLookupControl.CreateWnd; +begin + inherited CreateWnd; + if IsPopup then + begin + Windows.SetParent(Handle, 0); + CallWindowProc(DefWndProc, Handle, WM_SETFOCUS, 0, 0); + FHScrollWidth := GetSystemMetrics(SM_CYHSCROLL); + FVScrollWidth := GetSystemMetrics(SM_CXVSCROLL); + FCloseBtnDown := False; + FCloseBtnPaint := False; + end; + UpdateScrollBar; +end; + +procedure TdxBarPopupLookupControl.DblClick; +begin + inherited; + if not IsPopup then + FCombo.FForm.ModalResult := mrOk; +end; + +procedure TdxBarPopupLookupControl.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if Operation = opRemove then + if (FListLink <> nil) and (AComponent = ListSource) then ListSource := nil; +end; + +procedure TdxBarPopupLookupControl.KeyDown(var Key: Word; Shift: TShiftState); +var + Delta: Integer; +begin + inherited KeyDown(Key, Shift); + if not FListActive then Exit; + Delta := 0; + case Key of + VK_UP, VK_LEFT: Delta := -1; + VK_DOWN, VK_RIGHT: Delta := 1; + VK_PRIOR: Delta := 1 - FRowCount; + VK_NEXT: Delta := FRowCount - 1; + VK_HOME: Delta := -Maxint; + VK_END: Delta := Maxint; + end; + if Delta <> 0 then + begin + if Delta = -Maxint then + ListLink.DataSet.First + else + if Delta = Maxint then + ListLink.DataSet.Last + else + ListLink.DataSet.MoveBy(Delta); + SelectCurrent; + end; +end; + +procedure TdxBarPopupLookupControl.ListLinkDataChanged; +begin + if FListActive then + begin + FRecordIndex := ListLink.ActiveRecord; + FRecordCount := ListLink.RecordCount; + end else + begin + FRecordIndex := 0; + FRecordCount := 0; + end; + if HandleAllocated then + begin + UpdateScrollBar; + Invalidate; + end; +end; + +procedure TdxBarPopupLookupControl.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + if (Button = mbLeft) and + Assigned(ListLink.DataSet) {and ListLink.DataSet.CanModify} then + if ssDouble in Shift then + if FRecordIndex = Y div GetTextHeight then + DblClick + else + else + begin + MouseCapture := True; + FTracking := True; + SelectItemAt(X, Y); + end; + inherited MouseDown(Button, Shift, X, Y); +end; + +procedure TdxBarPopupLookupControl.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + if FTracking then + begin + SelectItemAt(X, Y); + FMousePos := Y; + TimerScroll; + end; + inherited MouseMove(Shift, X, Y); +end; + +procedure TdxBarPopupLookupControl.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + if FTracking then + begin + StopTracking; + SelectItemAt(X, Y); + if (FCombo <> nil) and ListLink.Active and IsPopup then + begin + if Y < 0 then Y := 0; + if Y >= ClientHeight then Y := ClientHeight - 1; + Y := Y div GetTextHeight; + if Y >= ListLink.RecordCount then Exit; + with FCombo do + try + if FKeyField <> nil then FKeyValue := FKeyField.Value; + KeyValueChanged; + finally + if (CurItemLink <> nil) and (CurItemLink.RealItemLink <> nil) then + CurItemLink.RealItemLink.BringToTopInRecentList(True); + try + BarManager.HideAll; + except + end; + end; + end; + end; + inherited MouseUp(Button, Shift, X, Y); +end; + +procedure TdxBarPopupLookupControl.Paint; +var + I, J, W, X, TextWidth, TextHeight, LastFieldIndex, SelectedRecord: Integer; + Selected : Boolean; + S: string; + R: TRect; + Field: TField; + AAlignment: TAlignment; +begin + if not FListActive then + begin + Canvas.FillRect(ClientRect); + Exit; + end; + + Canvas.Font := Font; + TextWidth := Canvas.TextWidth('0'); + TextHeight := Canvas.TextHeight('0'); + LastFieldIndex := ListFields.Count - 1; + if ColorToRGB(Color) <> ColorToRGB(clBtnFace) then + Canvas.Pen.Color := clBtnFace else + Canvas.Pen.Color := clBtnShadow; + SelectedRecord := ListLink.ActiveRecord; + for I := 0 to FRowCount - 1 do + begin + Canvas.Font.Color := Font.Color; + Canvas.Brush.Color := Color; + R.Top := I * TextHeight; + R.Bottom := R.Top + TextHeight; + Selected := False; + if I < FRecordCount then + begin + ListLink.ActiveRecord := I; + if (SelectedRecord = I) then + begin + Canvas.Font.Color := clHighlightText; + Canvas.Brush.Color := clHighlight; + Selected := True; + end; + R.Right := 0; + for J := 0 to LastFieldIndex do + begin + Field := ListFields[J]; + if J < LastFieldIndex then + W := Field.DisplayWidth * TextWidth + 4 else + W := ClientWidth - R.Right; + S := Field.DisplayText; + X := 2; + AAlignment := Field.Alignment; + case AAlignment of + taRightJustify: X := W - Canvas.TextWidth(S) - 3; + taCenter: X := (W - Canvas.TextWidth(S)) div 2; + end; + R.Left := R.Right; + R.Right := R.Right + W; + Canvas.TextRect(R, R.Left + X, R.Top, S); + if J < LastFieldIndex then + begin + Canvas.MoveTo(R.Right, R.Top); + Canvas.LineTo(R.Right, R.Bottom); + Inc(R.Right); + if R.Right >= ClientWidth then Break; + end; + end; + end; + R.Left := 0; + R.Right := ClientWidth; + if I >= FRecordCount then Canvas.FillRect(R); + if Selected then + Canvas.DrawFocusRect(R); + end; + R.Top := R.Bottom; + R.Bottom := ClientHeight; + Canvas.Brush.Color := Color; + Canvas.FillRect(R); + if FRecordCount <> 0 then ListLink.ActiveRecord := FRecordIndex; +end; + +function TdxBarPopupLookupControl.GetTextHeight: Integer; +var + DC: HDC; + SaveFont: HFont; + Metrics: TTextMetric; +begin + DC := GetDC(0); + SaveFont := SelectObject(DC, Font.Handle); + GetTextMetrics(DC, Metrics); + SelectObject(DC, SaveFont); + ReleaseDC(0, DC); + Result := Metrics.tmHeight; +end; + +procedure TdxBarPopupLookupControl.UpdateListFields; +var + DataSet: TDataSet; +begin + FListField := nil; + FListFields.Clear; + FListActive := False; + if FListLink.Active then + begin + DataSet := FListLink.DataSet; + try + DataSet.GetFieldList(FListFields, FListFieldName); + except + raise; + end; + if (FListFieldIndex >= 0) and (FListFieldIndex < FListFields.Count) then + FListField := FListFields[FListFieldIndex] + else + if (FListFields.Count > 0) then + FListField := FListFields[0]; + FListActive := FListField <> nil; + end; +end; + +function TdxBarPopupLookupControl.GetListSource: TDataSource; +begin + Result := FListLink.DataSource; +end; + +function TdxBarPopupLookupControl.GetPainter: TdxBarPainter; +begin + if IsPopup then + Result := FCombo.CurItemLink.Control.Painter + else + Result := FCombo.BarManager.DefaultPainter; +end; + +procedure TdxBarPopupLookupControl.SetListFieldName(const Value: string); +begin + if FListFieldName <> Value then + begin + FListFieldName := Value; + UpdateListFields; + end; +end; + +procedure TdxBarPopupLookupControl.SetListSource(Value: TDataSource); +begin + FListLink.DataSource := Value; + if Value <> nil then Value.FreeNotification(Self); +end; + +procedure TdxBarPopupLookupControl.SelectCurrent; +begin + if FCombo <> nil then + begin + FCombo.EditText := FListField.DisplayText; + FCombo.ResetFindStr; + SendMessage(FCombo.GetEditHandle, EM_SETSEL, 0, Length(FCombo.EditText)); + end; +end; + +procedure TdxBarPopupLookupControl.SelectItemAt(X, Y: Integer); +var + Delta: Integer; +begin + if not FCombo.FListActive then Exit; + if Y < 0 then Y := 0; + if Y >= ClientHeight then Y := ClientHeight - 1; + Delta := Y div GetTextHeight - FRecordIndex; + ListLink.DataSet.MoveBy(Delta); + SelectCurrent; +end; + +procedure TdxBarPopupLookupControl.SetRowCount(Value: Integer); +begin + if Value < 1 then Value := 1; + if Value > 100 then Value := 100; + Height := Value * GetTextHeight + 2 + + Byte(IsPopup and FCombo.AllowResizing) * dxDropDownNCHeight; +end; + +procedure TdxBarPopupLookupControl.StopTimer; +begin + if FTimerActive then + begin + KillTimer(Handle, 1); + FTimerActive := False; + end; +end; + +procedure TdxBarPopupLookupControl.StopTracking; +begin + if FTracking then + begin + StopTimer; + FTracking := False; + MouseCapture := False; + end; +end; + +procedure TdxBarPopupLookupControl.TimerScroll; +var + Delta, Distance, Interval: Integer; +begin + Delta := 0; + Distance := 0; + if FMousePos < 0 then + begin + Delta := -1; + Distance := -FMousePos; + end; + if FMousePos >= ClientHeight then + begin + Delta := 1; + Distance := FMousePos - ClientHeight + 1; + end; + if Delta = 0 then StopTimer else + begin + if ListLink.DataSet.MoveBy(Delta) <> 0 then SelectCurrent; + Interval := 200 - Distance * 15; + if Interval < 0 then Interval := 0; + SetTimer(Handle, 1, Interval, nil); + FTimerActive := True; + end; +end; + +procedure TdxBarPopupLookupControl.UpdateScrollBar; +var + SIOld, SINew: TScrollInfo; +begin + if FListLink.Active and HandleAllocated then + with ListLink.DataSet do + begin + SIOld.cbSize := sizeof(SIOld); + SIOld.fMask := SIF_ALL; + GetScrollInfo(Self.Handle, SB_VERT, SIOld); + SINew := SIOld; + if IsSequenced then + begin + SINew.nMin := 1; + SINew.nPage := FRowCount; + SINew.nMax := Integer(DWORD(RecordCount) + SINew.nPage - 1); + if State in [dsInactive, dsBrowse, dsEdit] then + SINew.nPos := RecNo; + end + else + begin + SINew.nMin := 0; + SINew.nPage := 0; + SINew.nMax := 4; + if BOF then SINew.nPos := 0 + else if EOF then SINew.nPos := 4 + else SINew.nPos := 2; + end; + if (SINew.nMin <> SIOld.nMin) or (SINew.nMax <> SIOld.nMax) or + (SINew.nPage <> SIOld.nPage) or (SINew.nPos <> SIOld.nPos) then + SetScrollInfo(Self.Handle, SB_VERT, SINew, True); + end; +end; + +initialization + dxBarRegisterItem(TdxBarLookupCombo, TdxBarLookupComboControl, True); + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBarExtDBItems.res b/official/x.35/ExpressBars 6/Sources/dxBarExtDBItems.res new file mode 100644 index 00000000..4983674b Binary files /dev/null and b/official/x.35/ExpressBars 6/Sources/dxBarExtDBItems.res differ diff --git a/official/x.35/ExpressBars 6/Sources/dxBarExtDBItemsReg.pas b/official/x.35/ExpressBars 6/Sources/dxBarExtDBItemsReg.pas new file mode 100644 index 00000000..38c590be --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarExtDBItemsReg.pas @@ -0,0 +1,104 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars extended DB items registring unit } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarExtDBItemsReg; + +{$I cxVer.inc} + +interface + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI6} + DesignIntf, DesignEditors, +{$ELSE} + DsgnIntf, +{$ENDIF} +{$IFDEF DELPHI10} + WideStrings, +{$ENDIF} + Classes, dxBarExtDBItems; + +{ TdxBarLookupComboFieldProperty } + +type + TdxBarLookupComboFieldProperty = class(TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + end; + +function TdxBarLookupComboFieldProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList, paSortList, paMultiSelect]; +end; + +procedure TdxBarLookupComboFieldProperty.GetValues(Proc: TGetStrProc); +var + AComponent: TdxBarLookupCombo; + AValues: {$IFDEF DELPHI10}TWideStringList{$ELSE}TStringList{$ENDIF}; + I: Integer; +begin + AValues := {$IFDEF DELPHI10}TWideStringList{$ELSE}TStringList{$ENDIF}.Create; + try + AComponent := TdxBarLookupCombo(GetComponent(0)); + if (AComponent.ListSource <> nil) and (AComponent.ListSource.DataSet <> nil) then + begin + AComponent.ListSource.DataSet.GetFieldNames(AValues); + for I := 0 to AValues.Count - 1 do + Proc(AValues[I]); + end; + finally + AValues.Free; + end; +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterNoIcon([TdxBarLookupCombo]); + RegisterPropertyEditor(TypeInfo(string), TdxBarLookupCombo, + 'KeyField', TdxBarLookupComboFieldProperty); + RegisterPropertyEditor(TypeInfo(string), TdxBarLookupCombo, + 'ListField', TdxBarLookupComboFieldProperty); +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBarExtItems.pas b/official/x.35/ExpressBars 6/Sources/dxBarExtItems.pas new file mode 100644 index 00000000..b904ac5f --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarExtItems.pas @@ -0,0 +1,6536 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars extended items } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarExtItems; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Windows, Messages, CommCtrl, Classes, Controls, Forms, Graphics, Dialogs, + StdCtrls, ComCtrls, ImgList, dxBar, dxBarAccessibility, dxCommon, + dxBarSkinConsts; + +type + TdxBarStatic = class(TdxBarItem) + private + FAlignment: TAlignment; + FAllowClick: Boolean; + FBorderStyle: TdxBarStaticBorderStyle; + FHeight: Integer; + FLeftIndent: Integer; + FRightIndent: Integer; + FWidth: Integer; + procedure SetAlignment(Value: TAlignment); + procedure SetBorderStyle(Value: TdxBarStaticBorderStyle); + procedure SetSizeValue(Index: Integer; Value: Integer); + protected + function CanClicked: Boolean; override; + function HasAccel(AItemLink: TdxBarItemLink): Boolean; override; + function IsStyleColorSupported: Boolean; override; + public + constructor Create(AOwner: TComponent); override; + published + property Alignment: TAlignment read FAlignment write SetAlignment default taCenter; + property AllowClick: Boolean read FAllowClick write FAllowClick default False; + property BorderStyle: TdxBarStaticBorderStyle read FBorderStyle write SetBorderStyle + default sbsNone; + property Glyph; + property Height: Integer index 4 read FHeight write SetSizeValue default 0; + property ImageIndex; + property LeftIndent: Integer index 1 read FLeftIndent write SetSizeValue default 0; + property RightIndent: Integer index 2 read FRightIndent write SetSizeValue default 0; + property ShowCaption default True; + property Width: Integer index 3 read FWidth write SetSizeValue default 0; + property OnClick; + end; + + TdxBarStaticControl = class(TdxBarCustomStaticControl) + private + function GetBorderStyle: TdxBarStaticBorderStyle; + function GetBorderOffsets: TRect; + function GetItem: TdxBarStatic; + function GetSizeValue(Index: Integer): Integer; + protected + procedure CalcDrawParams(AFull: Boolean = True); override; + function CanClicked: Boolean; override; + function CanHaveZeroSize: Boolean; virtual; + function CanMouseSelect: Boolean; override; + procedure CaptionChanged; override; + procedure DoPaint(ARect: TRect; PaintType: TdxBarPaintType); override; + procedure DrawInterior(ARect: TRect); override; + function GetAlignment: TAlignment; virtual; + function GetAutoHeight(ADefaultButtonSize: Integer): Integer; + function GetAutoWidth(ADefaultButtonSize: Integer): Integer; + function GetDefaultHeight: Integer; override; + function GetDefaultWidth: Integer; override; + function InternalGetDefaultHeight: Integer; override; + function InternalGetDefaultWidth: Integer; override; + function IsDestroyOnClick: Boolean; override; + + property Alignment: TAlignment read GetAlignment; + property BorderStyle: TdxBarStaticBorderStyle read GetBorderStyle; + property BorderOffsets: TRect read GetBorderOffsets; + property Height: Integer index 4 read GetSizeValue; + property LeftIndent: Integer index 1 read GetSizeValue; + property RightIndent: Integer index 2 read GetSizeValue; + property Width: Integer index 3 read GetSizeValue; + public + property Item: TdxBarStatic read GetItem; + end; + + TdxBarLargeButton = class(TdxBarButton) + private + FAutoGrayScale: Boolean; + FHeight: Integer; + FHotImageIndex: Integer; + FInSyncImageIndex: Boolean; + FHotGlyph: TBitmap; + FSyncImageIndex: Boolean; + + FSetImageIndex: Boolean; + FSetLargeImageIndex: Boolean; + FSetSyncImageIndex: Boolean; + + function IsImageIndexStored: Boolean; + function IsLargeImageIndexStored: Boolean; + procedure SetAutoGrayScale(Value: Boolean); + procedure SetHeight(Value: Integer); + procedure SetHotGlyph(Value: TBitmap); + procedure SetHotImageIndex(Value: Integer); + procedure SetSyncImageIndex(Value: Boolean); + + procedure OnHotGlyphChanged(Sender: TObject); + protected + procedure DefineProperties(Filer: TFiler); override; + procedure Loaded; override; + procedure ReadImageIndex(Reader: TReader); + procedure WriteImageIndex(Writer: TWriter); + + function GetActionImageIndex: Integer; override; + procedure SetActionImageIndex(Value: Integer); override; + + function HasAccel(AItemLink: TdxBarItemLink): Boolean; override; + procedure HotGlyphChanged; override; + function IsHotImageLinked: Boolean; + function IsLargeImageLinked: Boolean; + procedure LargeGlyphChanged; override; + procedure SetImageIndex(Value: Integer); override; + procedure SetLargeImageIndex(Value: Integer); override; + function UseHotImages: Boolean; override; + function UseLargeImages: Boolean; override; + procedure WidthChanged; override; + + // IdxBarSelectableItem + function GetSupportedActions: TdxBarCustomizationActions; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + published + property AutoGrayScale: Boolean read FAutoGrayScale write SetAutoGrayScale default True; + property GlyphLayout default glTop; + property Height: Integer read FHeight write SetHeight default 0; + property HotGlyph: TBitmap read FHotGlyph write SetHotGlyph; + property HotImageIndex: Integer read FHotImageIndex write SetHotImageIndex default -1; + property LargeImageIndex stored IsLargeImageIndexStored; + property ShowCaption default True; + property Width default 0; + property ImageIndex stored False{see DefineProperties: IsImageIndexStored}; + property SyncImageIndex: Boolean read FSyncImageIndex write SetSyncImageIndex default True; + end; + + TdxBarLargeButtonControl = class(TdxBarButtonControl) + private + function GetHotGlyph: TBitmap; + function GetItem: TdxBarLargeButton; + + function IsInheritedBehaviour: Boolean; + function IsSizeAssigned: Boolean; + protected + function ArrowWidth: Integer; override; + procedure HotGlyphChanged; override; + procedure LargeGlyphChanged; override; + + function GetCurrentImage(AViewSize: TdxBarItemControlViewSize; ASelected: Boolean; + out ACurrentGlyph: TBitmap; out ACurrentImages: TCustomImageList; out ACurrentImageIndex: Integer): Boolean; override; + function GetDefaultViewStructure: TdxBarItemControlViewStructure; override; + function GetDefaultViewSize: TdxBarItemControlViewSize; override; + function GetPossibleViewLevels: TdxBarItemViewLevels; override; + function GrayScale: Boolean; override; + function InternalGetDefaultHeight: Integer; override; + function InternalGetDefaultWidth: Integer; override; + + function IsRotated: Boolean; override; + + procedure PreparePaintStyleOnBar(var APaintStyle: TdxBarPaintStyle); override; + + property HotGlyph: TBitmap read GetHotGlyph; + public + property Item: TdxBarLargeButton read GetItem; + end; + + TdxBarColorCombo = class(TdxBarCustomCombo) + private + FAutoColor: TColor; + FAutoColorText: string; + FColor: TColor; + FCustomColorText: string; + FExchangeColor: TColor; + FHasExchangeColor: Boolean; + FInRefreshColorNames: Boolean; + FSettingColor: Boolean; + FShowAutoColor: Boolean; + FShowCustomColorButton: Boolean; + + function GetCurColor: TColor; + procedure SetAutoColor(Value: TColor); + procedure SetAutoColorText(Value: string); + procedure SetColor(Value: TColor); + procedure SetCurColor(Value: TColor); + procedure SetCustomColorText(Value: string); + procedure SetShowAutoColor(Value: Boolean); + procedure SetShowCustomColorButton(Value: Boolean); + + procedure CreateItemsList; + function GetColorByIndex(AIndex: Integer): TColor; + function GetIndexOfColor(AColor: TColor): Integer; + function IsAutoColorTextStored: Boolean; + function IsCustomColorTextStored: Boolean; + function IsDropDownCountStored: Boolean; + protected + procedure Change; override; + procedure DrawItem(APainter: TdxBarPainter; AIndex: Integer; ARect: TRect; + AState: TOwnerDrawState); override; + procedure MeasureItem(AIndex: Integer; var AHeight: Integer); override; + procedure MeasureItemWidth(AIndex: Integer; var AWidth: Integer); override; + property ExchangeColor: TColor read FExchangeColor; + property HasExchangeColor: Boolean read FHasExchangeColor; + public + constructor Create(AOwner: TComponent); override; + procedure DoClick; override; + procedure RefreshColorNames; + property CurColor: TColor read GetCurColor write SetCurColor; + published + property AutoColor: TColor read FAutoColor write SetAutoColor default clWindowText; + property AutoColorText: string read FAutoColorText write SetAutoColorText + stored IsAutoColorTextStored; + property Color: TColor read FColor write SetColor; + property CustomColorText: string read FCustomColorText write SetCustomColorText + stored IsCustomColorTextStored; + property DropDownCount stored IsDropDownCountStored; + property ShowAutoColor: Boolean read FShowAutoColor write SetShowAutoColor default False; + property ShowCustomColorButton: Boolean read FShowCustomColorButton + write SetShowCustomColorButton default False; + property ShowEditor default False; + property Text stored False; + end; + + TdxBarColorComboControl = class(TdxBarComboControl) + private + function GetDrawParams: TdxBarColorComboControlDrawParams; + function GetItem: TdxBarColorCombo; + protected + procedure CalcDrawParams(AFull: Boolean = True); override; + procedure CalcParts; override; + procedure CorrectFrameRect(var ARect: TRect); override; + function DrawSelected: Boolean; override; + procedure DrawTextField; override; + function GetDrawParamsClass: TdxBarItemControlDrawParamsClass; override; + function GetPartCount: Integer; override; + procedure PressedChanged; override; + procedure WndProc(var Message: TMessage); override; + property DrawParams: TdxBarColorComboControlDrawParams read GetDrawParams; + public + property Item: TdxBarColorCombo read GetItem; + end; + + TdxBarFontNameCombo = class(TdxBarCustomCombo) + protected + procedure DrawItem(APainter: TdxBarPainter; AIndex: Integer; ARect: TRect; + AState: TOwnerDrawState); override; + procedure LoadFontNames; + procedure MeasureItemWidth(AIndex: Integer; var AWidth: Integer); override; + procedure SetText(Value: string); override; + public + constructor Create(AOwner: TComponent); override; + procedure DoClick; override; + published + property ShowEditor default False; + end; + + TDayOfWeek = 0..6; + TDay = (dSunday, dMonday, dTuesday, dWednesday, dThursday, dFriday, dSaturday); + TDays = set of TDay; + TdxBarCalendarStyle = (cs3D, csFlat, csUltraFlat); + + TdxBarCustomCalendar = class(TCustomControl) + private + FDragDate: TDateTime; + FFirstDate: TDateTime; + FSelStart: TDateTime; + FSelFinish: TDateTime; + FStyle: TdxBarCalendarStyle; + + FOnDateTimeChanged: TNotifyEvent; + + function GetFlat: Boolean; + function GetUltraFlat: Boolean; + procedure SetStyle(Value: TdxBarCalendarStyle); + + procedure WMCancelMode(var Message: TMessage); message WM_CANCELMODE; + procedure WMCaptureChanged(var Message: TMessage); message WM_CAPTURECHANGED; + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND; + protected + function GetStyle: TdxBarCalendarStyle; virtual; + function GetRealFirstDate: TDateTime; virtual; + function GetRealLastDate: TDateTime; virtual; + function GetLastDate: TDateTime; virtual; abstract; + function GetSelStart: TDateTime; virtual; + function GetSelFinish: TDateTime; virtual; + procedure SetFirstDate(Value: TDateTime); virtual; + procedure SetSelStart(Value: TDateTime); virtual; + procedure SetSelFinish(Value: TDateTime); virtual; + + procedure CancelAll; dynamic; + procedure CheckFirstDate; virtual; abstract; + procedure DoDateTimeChanged; dynamic; + procedure DoInternalSelectPeriod(ADate: TDateTime); + function PosToDateTime(P: TPoint): TDateTime; virtual; abstract; + + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + + property Flat: Boolean read GetFlat; + property UltraFlat: Boolean read GetUltraFlat; + + property RealFirstDate: TDateTime read GetRealFirstDate; + property RealLastDate: TDateTime read GetRealLastDate; + public + constructor Create(AOwner: TComponent); override; + + property FirstDate: TDateTime read FFirstDate write SetFirstDate; + property LastDate: TDateTime read GetLastDate; + property SelStart: TDateTime read GetSelStart write SetSelStart; + property SelFinish: TDateTime read GetSelFinish write SetSelFinish; + property Style: TdxBarCalendarStyle read GetStyle write SetStyle; + property OnDateTimeChanged: TNotifyEvent read FOnDateTimeChanged + write FOnDateTimeChanged; + end; + + TdxBarDateCombo = class; + + TdxBarDateNavigator = class(TdxBarCustomCalendar) + private + FCombo: TdxBarDateCombo; + FColCount: Integer; + FRowCount: Integer; + FColWidth, FSideWidth, + FRowHeight, FHeaderHeight, FDaysOfWeekHeight: Integer; + FTodayButtonWidth, FClearButtonWidth, FButtonsOffset, FButtonsHeight, + FButtonsRegionHeight: Integer; + FListBox: TWinControl; + FListBoxDelta: Integer; + FTimer: UINT; + FTodayButtonActive, FTodayButtonPressed: Boolean; + FClearButtonActive, FClearButtonPressed: Boolean; + + procedure CheckSelection(MarginDate: TDateTime); + function ColOfDate(ADate: TDateTime): Integer; + function GetHeaderRect: TRect; + function GetInternalRect: TRect; + function GetLeftArrowRect: TRect; + function GetPainter: TdxBarPainter; + function GetRightArrowRect: TRect; + function GetMonthNameRect: TRect; + function GetTodayButtonRect: TRect; + function GetClearButtonRect: TRect; + function GetShowButtonsArea: Boolean; + procedure FreeTimer; + procedure RepaintTodayButton; + procedure RepaintClearButton; + + procedure WMDestroy(var Message: TMessage); message WM_DESTROY; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure WMSize(var Message: TWMSize); message WM_SIZE; + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; + protected + function GetStyle: TdxBarCalendarStyle; override; + function GetRealFirstDate: TDateTime; override; + function GetRealLastDate: TDateTime; override; + function GetLastDate: TDateTime; override; + procedure SetFirstDate(Value: TDateTime); override; + procedure SetSelFinish(Value: TDateTime); override; + procedure StepToPast; + procedure StepToFuture; + procedure CancelAll; override; + procedure CheckFirstDate; override; + procedure DeactivateAll; + function PosToDateTime(P: TPoint): TDateTime; override; + + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + procedure DblClick; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure Paint; override; + + property ColCount: Integer read FColCount; + property Painter: TdxBarPainter read GetPainter; + property RowCount: Integer read FRowCount; + property ShowButtonsArea: Boolean read GetShowButtonsArea; + public + IsPopup: Boolean; + ShowTodayButton, ShowClearButton: Boolean; + constructor Create(AOwner: TComponent); override; + procedure SetSize; + function GetWidth: Integer; + function GetHeight: Integer; + end; + + TdxBarDateOnStart = (bdsToday, bdsNullDate, bdsCustom); + + TdxBarDateCombo = class(TCustomdxBarCombo) + private + FDateOnStart: TdxBarDateOnStart; + FDatePopup, FDateNavigator: TdxBarDateNavigator; + FDateEdit: TEdit; + FForm: TForm; + FInternalUpdate: Boolean; + FMinDate: TDateTime; + FMaxDate: TDateTime; + FShowDayText: Boolean; + FShowTodayButton: Boolean; + FShowClearButton: Boolean; + function GetCurDate: TDateTime; + function GetDate: TDateTime; + procedure SetCurDate(Value: TDateTime); + procedure SetDate(Value: TDateTime); + procedure DateChanged(Sender: TObject); + procedure DialogClick(Sender: TObject); + procedure DialogDateChanged(Sender: TObject); + procedure DialogDateEditChange(Sender: TObject); + function GetDateOfText(AText: string): TDateTime; + function GetDateText(ADate: TDateTime): string; + function IsMinDateStored: Boolean; + function IsMaxDateStored: Boolean; + function IsTextStored: Boolean; + procedure SetDateOnStart(Value: TdxBarDateOnStart); + procedure SetMinDate(Value: TDateTime); + procedure SetMaxDate(Value: TDateTime); + procedure SetShowDayText(Value: Boolean); + protected + procedure Loaded; override; + procedure CheckDateOnStart; + procedure CheckRange; + function CheckKeyForDropDownWindow(Key: Word; Shift: TShiftState): Boolean; override; + procedure CloseUp; override; + procedure DropDown(X, Y: Integer); override; + function GetDropDownWindow: HWND; override; + procedure ResetDate; + procedure SetText(Value: string); override; + + property DatePopup: TdxBarDateNavigator read FDatePopup; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function CheckDate(ADate: TDateTime): TDateTime; + procedure DoClick; override; + + property CurDate: TDateTime read GetCurDate write SetCurDate; + property Date: TDateTime read GetDate write SetDate; + published + property DateOnStart: TdxBarDateOnStart read FDateOnStart write SetDateOnStart default bdsToday; + property MaxDate: TDateTime read FMaxDate write SetMaxDate stored IsMaxDateStored; + property MinDate: TDateTime read FMinDate write SetMinDate stored IsMinDateStored; + property ShowTodayButton: Boolean read FShowTodayButton write FShowTodayButton default True; + property ShowClearButton: Boolean read FShowClearButton write FShowClearButton default True; + property ShowDayText: Boolean read FShowDayText write SetShowDayText default True; + property Text stored IsTextStored; + end; + + TdxBarDateComboControl = class(TCustomdxBarComboControl) + private + function GetDate: TDateTime; + function GetItem: TdxBarDateCombo; + procedure SetDate(const Value: TDateTime); + protected + procedure WndProc(var Message: TMessage); override; + property Date: TDateTime read GetDate write SetDate; + public + property Item: TdxBarDateCombo read GetItem; + end; + + TdxBarTreeViewCombo = class; + +{$IFNDEF DELPHI6} + + TdxBarTreeNode = class(TTreeNode) + public + destructor Destroy; override; + end; + +{$ENDIF} + + TdxBarTreeView = class(TCustomTreeView) + private + FCloseButtonRect, FGripRect: TRect; + FCloseButtonIsTracking: Boolean; + FCombo: TdxBarTreeViewCombo; + FCorner: TdxCorner; + FMouseAboveCloseButton: Boolean; + function FindNode(const AText: string): TTreeNode; + function GetPainter: TdxBarPainter; + procedure SaveAndHide; + procedure TVMSetImageList(var Message: TMessage); message TVM_SETIMAGELIST; + procedure TVMSetItem(var Message: TMessage); message TVM_SETITEM; + procedure WMCaptureChanged(var Message: TMessage); message WM_CAPTURECHANGED; + procedure WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); message WM_GETMINMAXINFO; + procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + procedure WMNCLButtonDown(var Message: TWMNCLButtonDown); message WM_NCLBUTTONDOWN; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure WMSysColorChange(var Message: TWMSysColorChange); message WM_SYSCOLORCHANGE; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure CNNotify(var Message: TWMNotify); message CN_NOTIFY; + protected + procedure Change(Node: TTreeNode); override; + {$IFNDEF DELPHI6} + function CreateNode: TTreeNode; override; + {$ENDIF} + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + procedure DblClick; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + property Painter: TdxBarPainter read GetPainter; + public + IsPopup: Boolean; + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure SetFocus; override; + property Items; + property OnDeletion; + property Combo: TdxBarTreeViewCombo read FCombo; + end; + + TdxBarTreeViewComboCanSelectNodeEvent = procedure(Sender: TdxBarTreeViewCombo; + Node: TTreeNode; var CanSelect: Boolean) of object; + + TdxBarTreeViewCombo = class(TCustomdxBarCombo) + private + FAllowResizing: Boolean; + FButtonOk, FButtonCancel: TButton; + FChooseByDblClick: Boolean; + FForm: TForm; + FFormTreeView, FTreeView: TdxBarTreeView; + FFullExpand: Boolean; + FInSelectedNodeChanged: Boolean; + FLoadedText: string; + FSelectedNode: TTreeNode; + FShowImageInEdit: Boolean; + FOnCanSelectNode: TdxBarTreeViewComboCanSelectNodeEvent; + + function GetDropDownHeight: Integer; + function GetDropDownWidth: Integer; + function GetImages: TCustomImageList; + function GetIndent: Integer; + function GetItems: TTreeNodes; + function GetShowButtons: Boolean; + function GetShowLines: Boolean; + function GetShowRoot: Boolean; + function GetSortType: TSortType; + function GetStateImages: TCustomImageList; + function GetOnExpanded: TTVExpandedEvent; + function GetOnExpanding: TTVExpandingEvent; + function GetOnChanging: TTVChangingEvent; + function GetOnCollapsed: TTVExpandedEvent; + function GetOnCollapsing: TTVCollapsingEvent; + function GetOnCompare: TTVCompareEvent; + function GetOnGetImageIndex: TTVExpandedEvent; + function GetOnGetSelectedIndex: TTVExpandedEvent; + function GetOnTreeViewChange: TTVChangedEvent; + + procedure SetDropDownHeight(Value: Integer); + procedure SetDropDownWidth(Value: Integer); + procedure SetImages(Value: TCustomImageList); + procedure SetIndent(Value: Integer); + procedure SetItems(Value: TTreeNodes); + procedure SetSelectedNode(Value: TTreeNode); + procedure SetShowButtons(Value: Boolean); + procedure SetShowImageInEdit(Value: Boolean); + procedure SetShowLines(Value: Boolean); + procedure SetShowRoot(Value: Boolean); + procedure SetSortType(Value: TSortType); + procedure SetStateImages(Value: TCustomImageList); + procedure SetOnExpanded(Value: TTVExpandedEvent); + procedure SetOnExpanding(Value: TTVExpandingEvent); + procedure SetOnChanging(Value: TTVChangingEvent); + procedure SetOnCollapsed(Value: TTVExpandedEvent); + procedure SetOnCollapsing(Value: TTVCollapsingEvent); + procedure SetOnCompare(Value: TTVCompareEvent); + procedure SetOnGetImageIndex(Value: TTVExpandedEvent); + procedure SetOnGetSelectedIndex(Value: TTVExpandedEvent); + procedure SetOnTreeViewChange(Value: TTVChangedEvent); + + procedure FormSize(Sender: TObject); + protected + function CheckKeyForDropDownWindow(Key: Word; Shift: TShiftState): Boolean; override; + function DoCanSelectNode: Boolean; + procedure DoSelectedNodeChanged; virtual; + procedure DrawInterior(ABarEditControl: TdxBarEditControl; ACanvas: TCanvas; + R: TRect; ItemLink: TdxBarItemLink); override; + procedure DropDown(X, Y: Integer); override; + function GetDropDownWindow: HWND; override; + function HasImageInEdit: Boolean; + procedure Loaded; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure SetText(Value: string); override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure DoClick; override; + + property SelectedNode: TTreeNode read FSelectedNode write SetSelectedNode; + property TreeView: TdxBarTreeView read FTreeView; + published + property AllowResizing: Boolean read FAllowResizing write FAllowResizing default True; + property ChooseByDblClick: Boolean read FChooseByDblClick write FChooseByDblClick default True; + property DropDownHeight: Integer read GetDropDownHeight write SetDropDownHeight default 200; + property DropDownWidth: Integer read GetDropDownWidth write SetDropDownWidth default 150; + property FullExpand: Boolean read FFullExpand write FFullExpand default False; + property Images: TCustomImageList read GetImages write SetImages; + property Indent: Integer read GetIndent write SetIndent; + property Items: TTreeNodes read GetItems write SetItems; + property ShowButtons: Boolean read GetShowButtons write SetShowButtons; + property ShowEditor default False; + property ShowImageInEdit: Boolean read FShowImageInEdit write SetShowImageInEdit + default True; + property ShowLines: Boolean read GetShowLines write SetShowLines; + property ShowRoot: Boolean read GetShowRoot write SetShowRoot; + property SortType: TSortType read GetSortType write SetSortType; + property StateImages: TCustomImageList + read GetStateImages write SetStateImages; + + property OnExpanded: TTVExpandedEvent read GetOnExpanded write SetOnExpanded; + property OnExpanding: TTVExpandingEvent read GetOnExpanding write SetOnExpanding; + property OnCanSelectNode: TdxBarTreeViewComboCanSelectNodeEvent read FOnCanSelectNode + write FOnCanSelectNode; + property OnChanging: TTVChangingEvent read GetOnChanging write SetOnChanging; + property OnCollapsed: TTVExpandedEvent read GetOnCollapsed write SetOnCollapsed; + property OnCollapsing: TTVCollapsingEvent read GetOnCollapsing write SetOnCollapsing; + property OnCompare: TTVCompareEvent read GetOnCompare write SetOnCompare; + property OnGetImageIndex: TTVExpandedEvent read GetOnGetImageIndex write SetOnGetImageIndex; + property OnGetSelectedIndex: TTVExpandedEvent read GetOnGetSelectedIndex write SetOnGetSelectedIndex; + property OnTreeViewChange: TTVChangedEvent read GetOnTreeViewChange write SetOnTreeViewChange; + end; + + TdxBarTreeViewComboControl = class(TCustomdxBarComboControl) + private + function GetItem: TdxBarTreeViewCombo; + protected + function GetDefaultHeight: Integer; override; + procedure SetFocused(Value: Boolean); override; + public + property Item: TdxBarTreeViewCombo read GetItem; + end; + + TdxBarImageCombo = class(TdxBarCustomCombo) + private + FDialogListBox: TListBox; + FForm: TForm; + FImageChangeLink: TChangeLink; + FImages: TCustomImageList; + FShowText: Boolean; + + function GetImageIndexes(Index: Integer): Integer; + procedure SetImageIndexes(Index: Integer; Value: Integer); + procedure SetImages(Value: TCustomImageList); + procedure SetShowText(Value: Boolean); + procedure ImageListChange(Sender: TObject); + procedure ReadImageIndexes(Reader: TReader); + procedure WriteImageIndexes(Writer: TWriter); + + procedure DialogListBoxDblClick(Sender: TObject); + procedure DialogListBoxDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure DialogListBoxMeasureItem(Control: TWinControl; Index: Integer; + var Height: Integer); + protected + procedure DefineProperties(Filer: TFiler); override; + procedure DrawItem(APainter: TdxBarPainter; AIndex: Integer; ARect: TRect; + AState: TOwnerDrawState); override; + procedure ImagesChanged; virtual; + procedure MeasureItem(AIndex: Integer; var AHeight: Integer); override; + procedure MeasureItemWidth(AIndex: Integer; var AWidth: Integer); override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure DoClick; override; + property ImageIndexes[Index: Integer]: Integer read GetImageIndexes write SetImageIndexes; + published + property Images: TCustomImageList read FImages write SetImages; + property Items; + property ShowEditor default False; + property Sorted; + property ItemIndex; // loading after all + property ShowText: Boolean read FShowText write SetShowText default True; + end; + + TdxBarImageComboControl = class(TdxBarComboControl) + protected + function GetDefaultHeight: Integer; override; + procedure ImagesChanged; virtual; + end; + + TdxBarToolbarsListItem = class(TCustomdxBarSubItem) + protected + function InternalCanMergeWith(AItem: TdxBarItem): Boolean; override; + end; + + TdxBarToolbarsListItemControl = class(TdxBarSubItemControl) + protected + procedure CreateSubMenuControl; override; + end; + + TdxBarSpinEdit = class; + TdxBarSpinEditValueType = (svtInteger, svtFloat); + TdxBarSpinEditPrefixPlace = (ppStart, ppEnd); + TdxBarSpinEditButtonClickEvent = procedure(Sender: TdxBarSpinEdit; + Button: TdxBarSpinEditButton) of object; + + TdxBarSpinEdit = class(TdxBarEdit) + private + FIncrement: Extended; + FMaxValue: Extended; + FMinValue: Extended; + FPrefix: string; + FPrefixPlace: TdxBarSpinEditPrefixPlace; + FValueType: TdxBarSpinEditValueType; + FOnButtonClick: TdxBarSpinEditButtonClickEvent; + + function GetCurValue: Extended; + function GetIntCurValue: Integer; + function GetIntValue: Integer; + function GetValue: Extended; + procedure SetCurValue(Value: Extended); + procedure SetIncrement(Value: Extended); + procedure SetIntCurValue(Value: Integer); + procedure SetIntValue(Value: Integer); + procedure SetMaxValue(Value: Extended); + procedure SetMinValue(Value: Extended); + procedure SetPrefix(const Value: string); + procedure SetPrefixPlace(Value: TdxBarSpinEditPrefixPlace); + procedure SetValue(Value: Extended); + procedure SetValueType(Value: TdxBarSpinEditValueType); + + function IsIncrementStored: Boolean; + function IsMaxValueStored: Boolean; + function IsMinValueStored: Boolean; + function IsValueStored: Boolean; + + procedure AddPrefix(var Text: string); + procedure RemovePrefix(var Text: string); + protected + function CheckRange: Boolean; + procedure DoButtonClick(Button: TdxBarSpinEditButton); + function GetCheckedValue(Value: Extended): Extended; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + procedure PrepareValue(var Value: Extended); + function TextToValue(Text: string): Extended; + procedure SetText(Value: string); override; + function ValueToText(Value: Extended): string; + public + constructor Create(AOwner: TComponent); override; + property CurValue: Extended read GetCurValue write SetCurValue; + property IntCurValue: Integer read GetIntCurValue write SetIntCurValue; + property IntValue: Integer read GetIntValue write SetIntValue; + published + property ValueType: TdxBarSpinEditValueType read FValueType write SetValueType + default svtInteger; // must be loaded before all + property Increment: Extended read FIncrement write SetIncrement + stored IsIncrementStored; + property MaxValue: Extended read FMaxValue write SetMaxValue stored IsMaxValueStored; + property MinValue: Extended read FMinValue write SetMinValue stored IsMinValueStored; + property Prefix: string read FPrefix write SetPrefix; + property PrefixPlace: TdxBarSpinEditPrefixPlace read FPrefixPlace write SetPrefixPlace + default ppEnd; + property Text stored False; + property Value: Extended read GetValue write SetValue stored IsValueStored; + property OnButtonClick: TdxBarSpinEditButtonClickEvent read FOnButtonClick + write FOnButtonClick; + end; + + TdxBarSpinEditControl = class(TdxBarEditControl) + private + FActiveButtonIndex: Integer; + FTimerID: UINT; + function GetActiveButton: TdxBarSpinEditButton; + function GetButtonPressed: Boolean; + function GetDrawParams: TdxBarSpinEditDrawParams; + function GetItem: TdxBarSpinEdit; + procedure SetActiveButtonIndex(Value: Integer); + protected + procedure BreakProcess; + procedure CalcDrawParams(AFull: Boolean = True); override; + procedure CalcParts; override; + procedure CorrectFrameRect(var ARect: TRect); override; + procedure DrawTextField; override; + function GetDrawParamsClass: TdxBarItemControlDrawParamsClass; override; + function GetPartCount: Integer; override; + procedure KillFocus(AHandle: THandle); override; + procedure WndProc(var Message: TMessage); override; + property ActiveButton: TdxBarSpinEditButton read GetActiveButton; + property ActiveButtonIndex: Integer read FActiveButtonIndex write SetActiveButtonIndex; + property ButtonPressed: Boolean read GetButtonPressed; + property DrawParams: TdxBarSpinEditDrawParams read GetDrawParams; + public + property Item: TdxBarSpinEdit read GetItem; + end; + + TdxBarControlContainerItem = class(TdxBarItem) + private + FControl: TControl; + FPlace: TCustomForm; + FPrevControlSize: TPoint; + FPrevControlWndProc: TWndMethod; + function GetControlVisible: Boolean; + function GetInPlaceControl: Boolean; + procedure SetControl(Value: TControl); + procedure ControlWndProc(var Message: TMessage); + function IsControlAssigned(AControl: TControl): Boolean; + procedure SaveControlSize; + procedure SetControlVisible(Value: Boolean); + protected + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure SetName(const NewName: TComponentName); override; + + function CanClicked: Boolean; override; + function GetHidden: Boolean; override; + function HasAccel(AItemLink: TdxBarItemLink): Boolean; override; + procedure HideControl(AControl: TdxBarItemControl); override; + function NeedToBeHidden: Boolean; override; + + property ControlVisible: Boolean read GetControlVisible write SetControlVisible; + property InPlaceControl: Boolean read GetInPlaceControl; + property Place: TCustomForm read FPlace; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + published + property Control: TControl read FControl write SetControl; + end; + + TdxBarControlContainerControl = class(TdxBarItemControl) + private + FInPlaceControl: Boolean; + FPlacedControl: Boolean; + function GetItem: TdxBarControlContainerItem; + function GetPlace: TCustomForm; + procedure InternalPaint; + procedure PlaceControl; + protected + procedure BeforeDestroyParentHandle; override; + procedure CalcParts; override; + function CanClicked: Boolean; override; + function CanSelect: Boolean; override; + procedure DoPaint(ARect: TRect; PaintType: TdxBarPaintType); override; + function GetControl: TControl; override; + function GetDefaultHeight: Integer; override; + function GetDefaultWidth: Integer; override; + function IsDestroyOnClick: Boolean; override; + function IsHitTestTransparent: Boolean; override; + function IsShowingControl: Boolean; + function NeedCaptureMouse: Boolean; override; + + procedure RealVisibleChanging(AVisible: Boolean); override; + function ShowsControl: Boolean; + + property InPlaceControl: Boolean read FInPlaceControl; + property Place: TCustomForm read GetPlace; + public + destructor Destroy; override; + property Item: TdxBarControlContainerItem read GetItem; + end; + + TdxBarProgressItem = class(TdxBarStatic) + private + FColor: TColor; + FMax: Integer; + FMin: Integer; + FPosition: Integer; + FSmooth: Boolean; + FStep: Integer; + procedure SetColor(Value: TColor); + procedure SetMax(Value: Integer); + procedure SetMin(Value: Integer); + procedure SetPosition(Value: Integer); + procedure SetSmooth(Value: Boolean); + procedure SetStep(Value: Integer); + protected + procedure UpdateBar; + public + constructor Create(AOwner: TComponent); override; + procedure SetParams(AMin, AMax: Integer); + procedure StepBy(Delta: Integer); + procedure StepIt; + published + property BorderStyle default sbsLowered; + property Color: TColor read FColor write SetColor default clDefault; + property Max: Integer read FMax write SetMax default 100; + property Min: Integer read FMin write SetMin default 0; + property Position: Integer read FPosition write SetPosition default 0; + property Smooth: Boolean read FSmooth write SetSmooth default False; + property Step: Integer read FStep write SetStep default 10; + end; + + TdxBarProgressControl = class(TdxBarStaticControl) + private + function GetDrawParams: TdxbarProgressControlDrawParams; + function GetItem: TdxBarProgressItem; + protected + function BarBrushColor: TColorRef; virtual; + function BarHeight: Integer; + function BarRect: TRect; + function BarWidth: Integer; + procedure CalcDrawParams(AFull: Boolean); override; + function CanHaveZeroSize: Boolean; override; + procedure DrawInterior(ARect: TRect); override; + function GetAlignment: TAlignment; override; + function GetDrawParamsClass: TdxBarItemControlDrawParamsClass; override; + function GetPossibleViewLevels: TdxBarItemViewLevels; override; + function InternalGetDefaultHeight: Integer; override; + function InternalGetDefaultWidth: Integer; override; + procedure UpdateBar; + property DrawParams: TdxbarProgressControlDrawParams read GetDrawParams; + public + property Item: TdxBarProgressItem read GetItem; + end; + + TdxBarMRUListItem = class(TdxBarListItem) + private + FMaxItemCount: Integer; + FRemoveItemOnClick: Boolean; + procedure SetMaxItemCount(Value: Integer); + protected + procedure CheckItemCount; + function GetDisplayText(const AText: string): string; override; + public + constructor Create(AOwner: TComponent); override; + procedure DirectClick; override; + procedure AddItem(const S: string; AObject: TObject); + procedure RemoveItem(const S: string; AObject: TObject); + published + property MaxItemCount: Integer read FMaxItemCount write SetMaxItemCount default 5; + property RemoveItemOnClick: Boolean read FRemoveItemOnClick + write FRemoveItemOnClick default False; + end; + + TdxBarInPlaceSubItem = class; + + TdxBarInPlaceSubItemEvent = + procedure(Sender: TdxBarInPlaceSubItem; Link: TdxBarItemLink) of object; + + TdxBarInPlaceSubItem = class(TdxBarContainerItem) + private + FExpanded: Boolean; + FExpandedChanging: Boolean; + FKeepBeginGroupWhileExpanded: Boolean; + FOnAfterExpand: TdxBarInPlaceSubItemEvent; + FOnBeforeCollapse: TdxBarInPlaceSubItemEvent; + procedure SetExpanded(Value: Boolean); + protected + procedure AddListedItemLinks(AItemLinks: TdxBarItemLinks; AIndex: Integer; + FirstCall: Boolean; CallingItemLink: TdxBarItemLink); override; + procedure DeleteListedItemLinks(AItemLinks: TdxBarItemLinks; AIndex: Integer); override; + function HideWhenRun: Boolean; override; + function InternalActuallyVisible: Boolean; override; + function InternalCanMergeWith(AItem: TdxBarItem): Boolean; override; + + procedure ChangeNextItemLinkBeginGroup(ALink: TdxBarItemLink; Value: Boolean); + procedure DoAfterExpand(ALink: TdxBarItemLink); dynamic; + procedure DoBeforeCollapse(ALink: TdxBarItemLink); dynamic; + published + property Expanded: Boolean read FExpanded write SetExpanded default False; + property KeepBeginGroupWhileExpanded: Boolean read FKeepBeginGroupWhileExpanded + write FKeepBeginGroupWhileExpanded; + property OnAfterExpand: TdxBarInPlaceSubItemEvent read FOnAfterExpand + write FOnAfterExpand; + property OnBeforeCollapse: TdxBarInPlaceSubItemEvent read FOnBeforeCollapse + write FOnBeforeCollapse; + end; + + TdxBarInPlaceSubItemControl = class(TdxBarContainerItemControl) + private + function GetDrawParams: TdxBarInPlaceSubItemControlDrawParams; + function GetItem: TdxBarInPlaceSubItem; + protected + procedure CalcDrawParams(AFull: Boolean = False); override; + procedure ControlClick(AByMouse: Boolean; AKey: Char = #0); override; + procedure DblClick; override; + procedure DoPaint(ARect: TRect; PaintType: TdxBarPaintType); override; + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; override; + function GetDefaultHeight: Integer; override; + function GetDefaultWidth: Integer; override; + function GetDrawParamsClass: TdxBarItemControlDrawParamsClass; override; + function HasSubMenu: Boolean; override; + function IsExpandable: Boolean; override; + function IsInvertTextColor: Boolean; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + function WantsKey(Key: Word): Boolean; override; + + property DrawParams: TdxBarInPlaceSubItemControlDrawParams read GetDrawParams; + public + property Item: TdxBarInPlaceSubItem read GetItem; + end; + + { TdxBarInPlaceSubItemControlAccessibilityHelper } + + TdxBarInPlaceSubItemControlAccessibilityHelper = class(TdxBarSubItemControlAccessibilityHelper) + protected + function ShowDropDownWindow: Boolean; override; + end; + +var + // first day of week + StartOfWeek: Word; //TDayOfWeek; + +// Use cxSetResourceString instead global variable +// for example, old code: +// sdxBarDatePopupToday := ... +// new code: +// cxSetResourceString(@dxSBAR_DATETODAY, ...); +function sdxBarDatePopupToday: string; +function sdxBarDatePopupClear: string; + +function dxBarColorDialog: TColorDialog; +function dxBarFontDialog: TFontDialog; + +implementation + +{$R dxBarExtItems.res} + +uses + Math, SysUtils, ActiveX, Printers, dxBarCommon, dxBarStrs, + cxClasses, cxGraphics, cxGeometry, cxDateUtils; + +const + Colors: array[0..15] of TColor = + (clBlack, clMaroon, clGreen, clOlive, clNavy, clPurple, clTeal, clGray, + clSilver, clRed, clLime, clYellow, clBlue, clFuchsia, clAqua, clWhite); + ADateNavigatorTime = 170; + ProgressBarDefaultWidth = 150; + ProgressBarIndent = 2; + +type + TWinControlAccess = class(TWinControl); + TBarManagerAccess = class(TdxBarManager); + TCustomdxBarControlAccess = class(TCustomdxBarControl); + TdxBarItemActionLinkAccess = class(TdxBarItemActionLink); + TPlaceForm = class(TCustomForm) + private + FBarItemControl: TdxBarItemControl; + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND; + end; + +procedure TPlaceForm.WMEraseBkgnd(var Message: TWMEraseBkgnd); +var + APrevWindowOrg: TPoint; + R: TRect; +begin + if FBarItemControl = nil then + FillRect(Message.DC, ClientRect, Brush.Handle) + else + begin + R := ClientRect; + BeforeDrawBackground(Self, FBarItemControl.Parent, Message.DC, R, APrevWindowOrg); + try + BarCanvas.BeginPaint(Message.DC); + try + FBarItemControl.Painter.DrawItemBackground(FBarItemControl, BarCanvas, R, Brush.Handle); + finally + BarCanvas.EndPaint; + end; + finally + AfterDrawBackground(Message.DC, APrevWindowOrg); + end; + end; + Message.Result := 1; +end; + +var + FColorDialog: TColorDialog; + FFontDialog: TFontDialog; + FTrueTypeFontBitmap, FNonTrueTypeFontBitmap: TBitmap; + +function GetCuttedString(const S: string): string; +var + C: PChar; + R: TRect; + DC: HDC; +begin + GetMem(C, 2 * (MAX_PATH + 1)); + StrPCopy(C, S); + R := Rect(0, 0, 300, 100); + DC := GetDC(0); + DrawText(DC, C, Length(S), R, + DT_CALCRECT or DT_MODIFYSTRING or + DT_NOPREFIX or DT_SINGLELINE or DT_PATH_ELLIPSIS); + ReleaseDC(0, DC); + Result := C; + FreeMem(C); +end; + +function sdxBarDatePopupToday: string; +begin + Result := cxGetResourceString(@dxSBAR_DATETODAY); +end; + +function sdxBarDatePopupClear: string; +begin + Result := cxGetResourceString(@dxSBAR_DATECLEAR); +end; + +{ TdxBarStatic } + +constructor TdxBarStatic.Create(AOwner: TComponent); +begin + inherited; + FAlignment := taCenter; + FShowCaption := True; +end; + +procedure TdxBarStatic.SetAlignment(Value: TAlignment); +begin + if FAlignment <> Value then + begin + FAlignment := Value; + if not IsLoading then Update; + end; +end; + +procedure TdxBarStatic.SetBorderStyle(Value: TdxBarStaticBorderStyle); +begin + if FBorderStyle <> Value then + begin + FBorderStyle := Value; + if not IsLoading then + if (Width = 0) or (Height = 0) then + UpdateEx + else + Update; + end; +end; + +procedure TdxBarStatic.SetSizeValue(Index: Integer; Value: Integer); +var + PrevValue: Integer; +begin + if Value < 0 then Value := 0; + case Index of + 1: PrevValue := FLeftIndent; + 2: PrevValue := FRightIndent; + 3: PrevValue := FWidth; + 4: PrevValue := FHeight; + else + PrevValue := 0; + end; + if PrevValue <> Value then + begin + case Index of + 1: FLeftIndent := Value; + 2: FRightIndent := Value; + 3: FWidth := Value; + 4: FHeight := Value; + end; + if not IsLoading then UpdateEx; + end; +end; + +function TdxBarStatic.CanClicked: Boolean; +begin + Result := FAllowClick; +end; + +function TdxBarStatic.HasAccel(AItemLink: TdxBarItemLink): Boolean; +begin + Result := False; +end; + +function TdxBarStatic.IsStyleColorSupported: Boolean; +begin + Result := True; +end; + +{ TdxBarStaticControl } + +function TdxBarStaticControl.GetBorderStyle: TdxBarStaticBorderStyle; +begin + Result := Item.BorderStyle; +end; + +function TdxBarStaticControl.GetBorderOffsets: TRect; +begin + Result := Painter.StaticControlGetBorderOffsets(Parent, BorderStyle); +end; + +function TdxBarStaticControl.GetItem: TdxBarStatic; +begin + Result := TdxBarStatic(ItemLink.Item); +end; + +function TdxBarStaticControl.GetSizeValue(Index: Integer): Integer; +begin + case Index of + 1: Result := Item.LeftIndent; + 2: Result := Item.RightIndent; + 3: Result := Item.Width; + 4: Result := Item.Height; + else + Result := 0; + end; +end; + +function TdxBarStaticControl.CanHaveZeroSize: Boolean; +begin + Result := False; +end; + +procedure TdxBarStaticControl.CalcDrawParams(AFull: Boolean = True); +begin + inherited; + if AFull then + begin + DrawParams.Alignment := Alignment; + DrawParams.AllowCenter := True; + DrawParams.BorderOffsets := BorderOffsets; + DrawParams.BorderStyle := BorderStyle; + end; +end; + +function TdxBarStaticControl.CanClicked: Boolean; +begin + Result := Item.AllowClick; +end; + +function TdxBarStaticControl.CanMouseSelect: Boolean; +begin + Result := not IsSelectionForbidden; +end; + +procedure TdxBarStaticControl.CaptionChanged; +begin + if Width = 0 then + inherited + else + Repaint; +end; + +procedure TdxBarStaticControl.DoPaint(ARect: TRect; PaintType: TdxBarPaintType); +begin + Painter.DrawStaticLikeControl(DrawParams, ARect, cxRect(LeftIndent, LeftIndent, RightIndent, RightIndent)); +end; + +procedure TdxBarStaticControl.DrawInterior(ARect: TRect); +begin + Painter.DrawStaticGlyphAndCaption(DrawParams, ARect); +end; + +function TdxBarStaticControl.GetAlignment: TAlignment; +begin + Result := Item.Alignment; +end; + +function TdxBarStaticControl.GetAutoHeight(ADefaultButtonSize: Integer): Integer; +begin + if Parent.Kind = bkSubMenu then + Result := GetTextSize + else + begin + if cpText in DrawParams.ViewStructure then + begin + if cpIcon in DrawParams.ViewStructure then + Result := Max(ADefaultButtonSize, GetTextSize - 3) + else + Result := GetTextSize - 3; + end + else + begin + if (cpIcon in DrawParams.ViewStructure) or not CanHaveZeroSize then + Result := ADefaultButtonSize + else + Result := GetTextSize - 3; + end; + end; + Inc(Result, BorderOffsets.Top); + Inc(Result, BorderOffsets.Bottom); +end; + +function TdxBarStaticControl.GetAutoWidth(ADefaultButtonSize: Integer): Integer; +begin + if cpText in DrawParams.ViewStructure then + begin + if (cpIcon in DrawParams.ViewStructure) then + if DrawParams.PaintType <> ptMenu then + Result := ADefaultButtonSize + 4 + GetCaptionWidth + else + Result := Painter.SubMenuControlGetItemTextIndent(DrawParams) + GetCaptionWidth + 4 + else + Result := GetCaptionWidth + Parent.TextSize div 2; + end + else + begin + if (cpIcon in DrawParams.ViewStructure) or not CanHaveZeroSize then + Result := ADefaultButtonSize + else + Result := 0; + end; + + Inc(Result, LeftIndent + RightIndent + BorderOffsets.Left + BorderOffsets.Right); +end; + +function TdxBarStaticControl.GetDefaultHeight: Integer; +begin + if IsRotated then + Result := InternalGetDefaultWidth + else + Result := InternalGetDefaultHeight; +end; + +function TdxBarStaticControl.GetDefaultWidth: Integer; +begin + if IsRotated then + Result := InternalGetDefaultHeight + else + Result := InternalGetDefaultWidth; +end; + +function TdxBarStaticControl.InternalGetDefaultHeight: Integer; +begin + if Height = 0 then + Result := GetAutoHeight(GetRotationDependentHeight(DrawParams.DefaultButtonSize)) + else + Result := Height; +end; + +function TdxBarStaticControl.InternalGetDefaultWidth: Integer; +begin + if Width = 0 then + Result := GetAutoWidth(GetRotationDependentWidth(DrawParams.DefaultButtonSize)) + else + Result := Width; +end; + +function TdxBarStaticControl.IsDestroyOnClick: Boolean; +begin + Result := Item.AllowClick; +end; + +{ TdxBarLargeButton } + +constructor TdxBarLargeButton.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FAutoGrayScale := True; + FHotGlyph := TBitmap.Create; + FHotGlyph.OnChange := OnHotGlyphChanged; + FHotImageIndex := -1; + FShowCaption := True; + FSyncImageIndex := True; +end; + +destructor TdxBarLargeButton.Destroy; +begin + FreeAndNil(FHotGlyph); + inherited; +end; + +function TdxBarLargeButton.IsImageIndexStored: Boolean; +begin + Result := not SyncImageIndex; +end; + +function TdxBarLargeButton.IsLargeImageIndexStored: Boolean; +begin + Result := (ActionLink = nil) or + not TdxBarItemActionLinkAccess(ActionLink).IsImageIndexLinked; +end; + +procedure TdxBarLargeButton.SetAutoGrayScale(Value: Boolean); +begin + if FAutoGrayScale <> Value then + begin + FAutoGrayScale := Value; + Update; + end; +end; + +procedure TdxBarLargeButton.SetHeight(Value: Integer); +begin + if FHeight <> Value then + begin + if Value < 0 then Exit; + FHeight := Value; + UpdateEx; + end; +end; + +procedure TdxBarLargeButton.SetHotGlyph(Value: TBitmap); +begin + FHotGlyph.Assign(Value); +end; + +procedure TdxBarLargeButton.SetHotImageIndex(Value: Integer); +begin + if FHotImageIndex <> Value then + begin + FHotImageIndex := Value; + HotGlyphChanged; + end; +end; + +procedure TdxBarLargeButton.SetSyncImageIndex(Value: Boolean); +begin + if IsLoading and not FInSyncImageIndex then + FSetSyncImageIndex := True; + if FSyncImageIndex <> Value then + begin + FSyncImageIndex := Value; + if FSyncImageIndex then + LargeGlyphChanged; + end; +end; + +procedure TdxBarLargeButton.OnHotGlyphChanged(Sender: TObject); +begin + HotGlyphChanged; +end; + +procedure TdxBarLargeButton.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('ImageIndex', ReadImageIndex, WriteImageIndex, IsImageIndexStored); +end; + +procedure TdxBarLargeButton.Loaded; +begin + inherited Loaded; + FSetImageIndex := False; + FSetLargeImageIndex := False; + FSetSyncImageIndex := False; +end; + +procedure TdxBarLargeButton.ReadImageIndex(Reader: TReader); +begin + ImageIndex := Reader.ReadInteger; +end; + +procedure TdxBarLargeButton.WriteImageIndex(Writer: TWriter); +begin + Writer.WriteInteger(ImageIndex); +end; + +function TdxBarLargeButton.GetActionImageIndex: Integer; +begin + Result := LargeImageIndex; +end; + +procedure TdxBarLargeButton.SetActionImageIndex(Value: Integer); +begin + LargeImageIndex := Value; +end; + +function TdxBarLargeButton.HasAccel(AItemLink: TdxBarItemLink): Boolean; +begin + Result := inherited HasAccel(AItemLink) and + (not (AItemLink.Owner.Owner is TdxBar) or FShowCaption); +end; + +procedure TdxBarLargeButton.HotGlyphChanged; +var + I: Integer; +{var + AItemLink: TdxBarItemLink;} +begin +{ AItemLink := CurItemLink; + if (AItemLink <> nil) and (AItemLink.Control <> nil) then + TdxBarLargeButtonControl(AItemLink.Control).HotGlyphChanged;} + for I := 0 to LinkCount - 1 do + if Links[I].Control <> nil then + TdxBarLargeButtonControl(Links[I].Control).HotGlyphChanged; +end; + +function TdxBarLargeButton.IsHotImageLinked: Boolean; +begin + Result := IsImageIndexLinked(BarManager.HotImages, FHotImageIndex); +end; + +function TdxBarLargeButton.IsLargeImageLinked: Boolean; +begin + Result := IsImageIndexLinked(BarManager.LargeImages, LargeImageIndex); +end; + +procedure TdxBarLargeButton.LargeGlyphChanged; +begin + if not FInSyncImageIndex and SyncImageIndex then + begin + if IsLoading and FSetImageIndex then + SyncImageIndex := LargeImageIndex = ImageIndex + else + begin + FInSyncImageIndex := True; + try + ImageIndex := LargeImageIndex; + finally + FInSyncImageIndex := False; + end; + end; + end; + inherited; +end; + +procedure TdxBarLargeButton.SetImageIndex(Value: Integer); +begin + if IsLoading and not FInSyncImageIndex then + FSetImageIndex := True; + inherited SetImageIndex(Value); + if not FInSyncImageIndex then + begin + if IsLoading and (LargeImageIndex = -1) and (SyncImageIndex or not FSetSyncImageIndex) then + begin + FInSyncImageIndex := True; + try + LargeImageIndex := ImageIndex; + finally + FInSyncImageIndex := False; + end; + end + else +// if not FInSyncImageIndex then + if not FSetSyncImageIndex then + SyncImageIndex := False; + end; +end; + +procedure TdxBarLargeButton.SetLargeImageIndex(Value: Integer); +begin + if IsLoading and not FInSyncImageIndex then + FSetLargeImageIndex := True; + inherited; +end; + +function TdxBarLargeButton.UseHotImages: Boolean; +begin + Result := HotImageIndex > -1; +end; + +function TdxBarLargeButton.UseLargeImages: Boolean; +begin + Result := LargeImageIndex > -1; +end; + +procedure TdxBarLargeButton.WidthChanged; +begin + UpdateEx; +end; + +function TdxBarLargeButton.GetSupportedActions: TdxBarCustomizationActions; +begin + Result := inherited GetSupportedActions - [caChangeButtonPaintStyle]; +end; + +{ TdxBarLargeButtonControl } + +function TdxBarLargeButtonControl.GetHotGlyph: TBitmap; +begin + Result := Item.HotGlyph; +end; + +function TdxBarLargeButtonControl.GetItem: TdxBarLargeButton; +begin + Result := TdxBarLargeButton(ItemLink.Item); +end; + +function TdxBarLargeButtonControl.IsInheritedBehaviour: Boolean; +begin + Result := GetPaintType = ptMenu; +end; + +function TdxBarLargeButtonControl.IsSizeAssigned: Boolean; +begin + with Item do + Result := (Width <> 0) and (Height <> 0); +end; + +function TdxBarLargeButtonControl.ArrowWidth: Integer; +begin + if Parent is TdxBarControl then + Result := Painter.RealLargeButtonArrowWidth(BarManager) + else + Result := inherited ArrowWidth; +end; + +procedure TdxBarLargeButtonControl.HotGlyphChanged; +begin + LargeGlyphChanged; +end; + +procedure TdxBarLargeButtonControl.LargeGlyphChanged; +begin + if DrawParams.ViewSize = cvsLarge then + if IsSizeAssigned or (DrawParams.PaintType = ptMenu) then + Repaint + else + Parent.RepaintBar; +end; + +function TdxBarLargeButtonControl.GetCurrentImage(AViewSize: TdxBarItemControlViewSize; ASelected: Boolean; + out ACurrentGlyph: TBitmap; out ACurrentImages: TCustomImageList; out ACurrentImageIndex: Integer): Boolean; + + function CheckHotGlyph: Boolean; + begin + Result := True; + if not HotGlyph.Empty then + ACurrentGlyph := HotGlyph + else + if Item.IsHotImageLinked then + begin + ACurrentImages := HotImages; + ACurrentImageIndex := Item.HotImageIndex; + end + else + Result := False; + end; + + function CheckLargeGlyph: Boolean; + begin + Result := True; + if not LargeGlyph.Empty then + ACurrentGlyph := LargeGlyph + else + if Item.IsLargeImageLinked then + begin + ACurrentImages := LargeImages; + ACurrentImageIndex := LargeImageIndex; + end + else + Result := False; + end; + + function GetCurrentImages: TCustomImageList; + begin + if LargeImages <> nil then + Result := LargeImages + else + Result := HotImages; + end; + +begin + if DrawParams.ViewSize = cvsLarge then + begin + ACurrentGlyph := nil; + ACurrentImages := nil; + ACurrentImageIndex := -1; + if ASelected then + Result := CheckHotGlyph or CheckLargeGlyph + else + Result := CheckLargeGlyph or CheckHotGlyph; + if not Result then + ACurrentImages := GetCurrentImages; + end + else + Result := inherited GetCurrentImage(AViewSize, ASelected, ACurrentGlyph, ACurrentImages, ACurrentImageIndex); +end; + +function TdxBarLargeButtonControl.GetDefaultViewStructure: TdxBarItemControlViewStructure; +begin + if IsInheritedBehaviour then + Result := inherited GetDefaultViewStructure + else + begin + Result := [cpIcon]; + if Item.ShowCaption then + Include(Result, cpText); + end; +end; + +function TdxBarLargeButtonControl.GetDefaultViewSize: TdxBarItemControlViewSize; +begin + if IsInheritedBehaviour then + Result := inherited GetDefaultViewSize + else + Result := cvsLarge; +end; + +function TdxBarLargeButtonControl.GetPossibleViewLevels: TdxBarItemViewLevels; +begin + Result := inherited GetPossibleViewLevels; + Include(Result, ivlLargeIconWithText); +end; + +function TdxBarLargeButtonControl.GrayScale: Boolean; +begin + Result := not DrawSelected and Enabled and Item.AutoGrayScale; +end; + +function TdxBarLargeButtonControl.InternalGetDefaultHeight: Integer; +begin + if Item.Height = 0 then + Result := inherited InternalGetDefaultHeight + else + Result := Item.Height; +end; + +function TdxBarLargeButtonControl.InternalGetDefaultWidth: Integer; +begin + if Item.Width = 0 then + Result := inherited InternalGetDefaultWidth + else + Result := Item.Width; +end; + +function TdxBarLargeButtonControl.IsRotated: Boolean; +begin + Result := inherited IsRotated and Item.ShowCaption; +end; + +procedure TdxBarLargeButtonControl.PreparePaintStyleOnBar(var APaintStyle: TdxBarPaintStyle); +begin + APaintStyle := psCaption; +end; + +{ TdxBarColorCombo } + +constructor TdxBarColorCombo.Create(AOwner: TComponent); +begin + inherited; + FAutoColor := clWindowText; + FAutoColorText := cxGetResourceString(@dxSBAR_COLORAUTOTEXT); + FCustomColorText := cxGetResourceString(@dxSBAR_COLORCUSTOMTEXT); + DropDownCount := 16; + Glyph.LoadFromResourceName(HInstance, 'DXBARCOLORCOMBO'); + CreateItemsList; + ItemIndex := 0; + ShowEditor := False; +end; + +function TdxBarColorCombo.GetCurColor: TColor; +begin + Result := GetColorByIndex(CurItemIndex); +end; + +procedure TdxBarColorCombo.SetAutoColor(Value: TColor); +begin + if FAutoColor <> Value then + begin + FAutoColor := Value; + if FShowAutoColor then + begin + FSettingColor := True; + try + ItemIndex := GetIndexOfColor(FColor); + finally + FSettingColor := False; + Update; + end; + end; + end; +end; + +procedure TdxBarColorCombo.SetAutoColorText(Value: string); +begin + if FAutoColorText <> Value then + begin + FAutoColorText := Value; + if FShowAutoColor then + begin + Items[0] := Value; + Update; + end; + end; +end; + +procedure TdxBarColorCombo.SetColor(Value: TColor); +var + AIndex: Integer; +begin + if FColor <> Value then + begin + FColor := Value; + FSettingColor := True; + try + AIndex := GetIndexOfColor(FColor); + if ItemIndex = AIndex then + begin + Update; + Change; + end + else ItemIndex := AIndex; + finally + FSettingColor := False; + end; + end; +end; + +procedure TdxBarColorCombo.SetCurColor(Value: TColor); +begin + if CurColor <> Value then + CurItemIndex := GetIndexOfColor(Value); +end; + +procedure TdxBarColorCombo.SetCustomColorText(Value: string); +begin + if FCustomColorText <> Value then + begin + FCustomColorText := Value; + Update; + end; +end; + +procedure TdxBarColorCombo.SetShowAutoColor(Value: Boolean); +begin + if FShowAutoColor <> Value then + begin + FShowAutoColor := Value; + FSettingColor := True; + try + if Value then Items.Insert(0, FAutoColorText) + else Items.Delete(0); + if DropDownCount = Byte(not Value) + 16 then + DropDownCount := Byte(Value) + 16; + ItemIndex := GetIndexOfColor(FColor); + finally + FSettingColor := False; + Update; + end; + end; +end; + +procedure TdxBarColorCombo.SetShowCustomColorButton(Value: Boolean); +begin + if FShowCustomColorButton <> Value then + begin + FShowCustomColorButton := Value; + Recalculate; + end; +end; + +procedure TdxBarColorCombo.CreateItemsList; +begin + with Items do + begin + Clear; + if FShowAutoColor then Add(FAutoColorText); + Add(cxGetResourceString(@dxSBAR_COLOR_STR_0)); + Add(cxGetResourceString(@dxSBAR_COLOR_STR_1)); + Add(cxGetResourceString(@dxSBAR_COLOR_STR_2)); + Add(cxGetResourceString(@dxSBAR_COLOR_STR_3)); + Add(cxGetResourceString(@dxSBAR_COLOR_STR_4)); + Add(cxGetResourceString(@dxSBAR_COLOR_STR_5)); + Add(cxGetResourceString(@dxSBAR_COLOR_STR_6)); + Add(cxGetResourceString(@dxSBAR_COLOR_STR_7)); + Add(cxGetResourceString(@dxSBAR_COLOR_STR_8)); + Add(cxGetResourceString(@dxSBAR_COLOR_STR_9)); + Add(cxGetResourceString(@dxSBAR_COLOR_STR_10)); + Add(cxGetResourceString(@dxSBAR_COLOR_STR_11)); + Add(cxGetResourceString(@dxSBAR_COLOR_STR_12)); + Add(cxGetResourceString(@dxSBAR_COLOR_STR_13)); + Add(cxGetResourceString(@dxSBAR_COLOR_STR_14)); + Add(cxGetResourceString(@dxSBAR_COLOR_STR_15)); + end; +end; + +function TdxBarColorCombo.GetColorByIndex(AIndex: Integer): TColor; +begin + if (0 <= AIndex) and (AIndex < 16 + Byte(FShowAutoColor)) then + if FShowAutoColor and (AIndex = 0) then + Result := FAutoColor + else + Result := Colors[AIndex - Byte(FShowAutoColor)] + else Result := FColor; +end; + +function TdxBarColorCombo.GetIndexOfColor(AColor: TColor): Integer; +begin + if FShowAutoColor and (AColor = FAutoColor) then + Result := 0 + else + begin + AColor := ColorToRGB(AColor); + for Result := Low(Colors) + Byte(FShowAutoColor) to High(Colors) + Byte(FShowAutoColor) do + if ColorToRGB(Colors[Result - Byte(FShowAutoColor)]) = AColor then Exit; + Result := -1; + end; +end; + +function TdxBarColorCombo.IsAutoColorTextStored: Boolean; +begin + Result := FAutoColorText <> cxGetResourceString(@dxSBAR_COLORAUTOTEXT); +end; + +function TdxBarColorCombo.IsCustomColorTextStored: Boolean; +begin + Result := FCustomColorText <> cxGetResourceString(@dxSBAR_COLORCUSTOMTEXT); +end; + +function TdxBarColorCombo.IsDropDownCountStored: Boolean; +begin + Result := DropDownCount <> Byte(FShowAutoColor) + 16; +end; + +procedure TdxBarColorCombo.Change; +begin + if not FSettingColor then + FColor := GetColorByIndex(ItemIndex); + if not FInRefreshColorNames then + inherited; +end; + +procedure TdxBarColorCombo.DrawItem(APainter: TdxBarPainter; + AIndex: Integer; ARect: TRect; AState: TOwnerDrawState); +var + PrevBrushColor: TColor; + S: string; + R: TRect; + HasIndent: Boolean; +begin + if Assigned(OnDrawItem) then + inherited + else + with Canvas, ARect do + begin + PrevBrushColor := Brush.Color; + if AIndex = -1 then + S := FCustomColorText + else + S := Items[AIndex]; + R := ARect; + HasIndent := (AIndex <> -1) or (FColor >= 0) or (FColor <= clInfoBk); + if HasIndent then Inc(R.Left, 30); + FillRect(R); + TextOut(R.Left + 1, (Top + Bottom - TextHeight(S)) div 2, S); + if HasIndent then + begin + R.Right := R.Left; + R.Left := Left; + FrameRect(R); + InflateRect(R, -1, -1); + Brush.Color := clBtnShadow; + FrameRect(R); + InflateRect(R, -1, -1); + Brush.Color := GetColorByIndex(AIndex); + FillRect(R); + end; + Brush.Color := PrevBrushColor; + if odFocused in AState then Windows.DrawFocusRect(Handle, ARect); // for hiding focus rect + end; +end; + +procedure TdxBarColorCombo.MeasureItem(AIndex: Integer; var AHeight: Integer); +begin + if Assigned(OnMeasureItem) then + inherited MeasureItem(AIndex, AHeight) + else + AHeight := 2 + Canvas.TextHeight('0') + 2; +end; + +procedure TdxBarColorCombo.MeasureItemWidth(AIndex: Integer; var AWidth: Integer); +begin + inherited; + Inc(AWidth, 30); +end; + +procedure TdxBarColorCombo.DoClick; +begin + try + inherited; + if not Assigned(OnClick) and not ReadOnly then + with dxBarColorDialog do + begin + if FHasExchangeColor then + Color := FExchangeColor + else + Color := Self.Color; + if Execute then Self.Color := Color; + end; + finally + FHasExchangeColor := False; + end; +end; + +procedure TdxBarColorCombo.RefreshColorNames; +var + APrevItemIndex: Integer; +begin + APrevItemIndex := ItemIndex; + FInRefreshColorNames := True; + try + CreateItemsList; + ItemIndex := APrevItemIndex; + finally + FInRefreshColorNames := False; + end; + Update; +end; + +{ TdxBarColorComboControl } + +function TdxBarColorComboControl.GetDrawParams: TdxBarColorComboControlDrawParams; +begin + Result := TdxBarColorComboControlDrawParams(FDrawParams); +end; + +function TdxBarColorComboControl.GetItem: TdxBarColorCombo; +begin + Result := TdxBarColorCombo(ItemLink.Item); +end; + +procedure TdxBarColorComboControl.CalcDrawParams(AFull: Boolean = True); +begin + inherited; + if AFull then + DrawParams.IsPressed := Pressed; + DrawParams.IsShowCustomColorButton := Item.ShowCustomColorButton; +end; + +procedure TdxBarColorComboControl.CalcParts; +begin + inherited; + Painter.CalculateColorComboParts(DrawParams, FParts, ItemBounds); +end; + +procedure TdxBarColorComboControl.CorrectFrameRect(var ARect: TRect); +begin + inherited; + Painter.ColorComboCorrectFrameRect(DrawParams, ARect); +end; + +function TdxBarColorComboControl.DrawSelected: Boolean; +begin + Result := inherited DrawSelected or Pressed; +end; + +procedure TdxBarColorComboControl.DrawTextField; + + procedure DrawCustomButton; + var + AIndentsRect, AAdjacentZoneRect: TRect; + begin + if Painter.IsCustomColorButtonVisible(DrawParams) then + begin + AIndentsRect := Painter.GetCustomColorButtonIndents(DrawParams.PaintType); + AAdjacentZoneRect := cxRectInflate(FParts[clcpCustomColorButton], + AIndentsRect.Left, AIndentsRect.Top, AIndentsRect.Right, AIndentsRect.Bottom); + + // TODO: Regions + Canvas.SaveClipRegion; + Canvas.SetClipRegion(TcxRegion.Create(AAdjacentZoneRect), roSet); + Painter.ColorComboDrawCustomButtonAdjacentZone(DrawParams, AAdjacentZoneRect); + Canvas.RestoreClipRegion; + + Painter.ColorComboDrawCustomButton(DrawParams, FParts[clcpCustomColorButton]); + end; + end; + +begin + inherited; + DrawCustomButton; +end; + +function TdxBarColorComboControl.GetDrawParamsClass: TdxBarItemControlDrawParamsClass; +begin + Result := TdxBarColorComboControlDrawParams; +end; + +function TdxBarColorComboControl.GetPartCount: Integer; +begin + Result := inherited GetPartCount + 1; +end; + +procedure TdxBarColorComboControl.PressedChanged; +begin + Repaint; + if Pressed then + DroppedDown := False; +end; + +procedure TdxBarColorComboControl.WndProc(var Message: TMessage); +var + AAllowPressed: Boolean; + ARealItemLink: TdxBarItemLink; + AItem: TdxBarColorCombo; + ALinkSelf: TcxObjectLink; +begin + with Message do + if (Msg = WM_LBUTTONDOWN) and (FHotPartIndex = clcpCustomColorButton) or + (Msg = WM_KEYDOWN) and (wParam = VK_RETURN) and (GetKeyState(VK_CONTROL) < 0) then + begin + AItem := Item; + AItem.FHasExchangeColor := True; + AItem.FExchangeColor := AItem.CurColor; + AAllowPressed := CanVisuallyPressed; + ARealItemLink := ItemLink.RealItemLink; + if ARealItemLink <> nil then + ARealItemLink.BringToTopInRecentList(True); + if AAllowPressed then + Pressed := True + else + Parent.HideAll; + + ALinkSelf := cxAddObjectLink(Self); + try + try + AItem.DirectClick; + finally + if (ALinkSelf.Ref <> nil) and AAllowPressed then + Pressed := False; + end; + finally + cxRemoveObjectLink(ALinkSelf); + end; + end + else + inherited; +end; + +{ TdxBarFontNameCombo } + +constructor TdxBarFontNameCombo.Create(AOwner: TComponent); +begin + inherited; + DropDownCount := 12; + Glyph.LoadFromResourceName(HInstance, 'DXBARFONTNAMECOMBO'); + ShowEditor := False; + Sorted := True; + LoadFontNames; + Width := 160; +end; + +procedure TdxBarFontNameCombo.DrawItem(APainter: TdxBarPainter; + AIndex: Integer; ARect: TRect; AState: TOwnerDrawState); +var + W, H: Integer; + CurrentBitmap: TBitmap; + R: TRect; + S: string; +begin + if Assigned(OnDrawItem) or (AIndex = -1) then + inherited + else + with Canvas, ARect do + begin + if Boolean(Items.Objects[AIndex]) then + CurrentBitmap := FTrueTypeFontBitmap + else + CurrentBitmap := FNonTrueTypeFontBitmap; + W := CurrentBitmap.Width; + H := CurrentBitmap.Height; + R := Bounds(Left, (Top + Bottom - H) div 2, W, H); + TransparentDraw(Handle, Brush.Handle, ARect, R, CurrentBitmap, nil, -1, clNone, + True, False, False, False, False, False, False, False{Faded}, True); + + S := Items[AIndex]; + TextOut(R.Right + 2, (Top + Bottom - TextHeight(S)) div 2, S); + if odFocused in AState then Windows.DrawFocusRect(Handle, ARect); // for hiding focus rect + end; +end; + +function EnumFontsProc(var LogFont: TLogFont; var TextMetric: TTextMetric; + FontType: Integer; Data: Pointer): Integer; stdcall; +begin + TStrings(Data).AddObject(LogFont.lfFaceName, Pointer(FontType and TRUETYPE_FONTTYPE <> 0)); + Result := 1; +end; + +procedure TdxBarFontNameCombo.LoadFontNames; +var + DC: HDC; + AIsWindowDC: Boolean; + + procedure EnumFonts(DC: HDC); + var + LogFont: TLogFont; + begin + with LogFont do + begin + lfCharset := DEFAULT_CHARSET; + lfFaceName := ''; + lfPitchAndFamily := 0; + end; + EnumFontFamiliesEx(DC, LogFont, @EnumFontsProc, Integer(Items), 0); + end; + +begin + if Printer.Printers.Count = 0 then + DC := 0 + else + try + DC := Printer.Handle; + except + DC := 0; + end; + AIsWindowDC := DC = 0; + if AIsWindowDC then DC := GetDC(0); + try + EnumFonts(DC); + finally + if AIsWindowDC then ReleaseDC(0, DC); + end; +end; + +procedure TdxBarFontNameCombo.MeasureItemWidth(AIndex: Integer; var AWidth: Integer); +begin + inherited; + Inc(AWidth, FTrueTypeFontBitmap.Width + 1); +end; + +procedure TdxBarFontNameCombo.SetText(Value: string); +var + AIndex: Integer; +begin + if CurItemLink <> nil then + begin + AIndex := GetNearestItemIndex(Value); + if (AIndex = -1) and (Value <> '') then Exit; + if AIndex > -1 then Value := Items[AIndex]; + end; + inherited; +end; + +procedure TdxBarFontNameCombo.DoClick; +begin + inherited; + if not Assigned(OnClick) and not ReadOnly then + with dxBarFontDialog do + begin + Font.Name := Text; + if Execute then Text := Font.Name; + end; +end; + +function dxBarColorDialog: TColorDialog; +begin + if FColorDialog = nil then + FColorDialog := TColorDialog.Create(nil); + Result := FColorDialog; +end; + +function dxBarFontDialog: TFontDialog; +begin + if FFontDialog = nil then + FFontDialog := TFontDialog.Create(nil); + Result := FFontDialog; +end; + +{ TdxBarDateCombo support classes } + +function TextToDate(AText: string): TDateTime; +var + I: Integer; + V1, V2: OleVariant; +begin + for I := 1 to Length(AText) do + if AText[I] = '.' then AText[I] := ' '; + V1 := AText; + if VariantChangeType(V2, V1, 0, VT_DATE) = S_OK then + Result := V2 + else + Result := NullDate; +end; + +{ TAMonthListBox } + +type + TAMonthListBox = class(TCustomControl) + private + FTopDate: TDateTime; + FItemHeight: Integer; + FItemIndex: Integer; + FItems: TStrings; + FTimer: UINT; + FTimerId: UINT; + + procedure FreeTimer; + + function GetDate: TDateTime; + procedure SetItemIndex(Value: Integer); + procedure SetTopDate(Value: TDateTime); + + procedure WMDestroy(var Message: TMessage); message WM_DESTROY; + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND; + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure Paint; override; + + property ItemHeight: Integer read FItemHeight; + property ItemIndex: Integer read FItemIndex write SetItemIndex; + property Items: TStrings read FItems; + property TopDate: TDateTime read FTopDate write SetTopDate; + public + constructor Create(AOwner: TComponent); override; + + property Date: TDateTime read GetDate; + end; + +constructor TAMonthListBox.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FTopDate := NullDate; +end; + +procedure TAMonthListBox.FreeTimer; +begin + dxKillTimer(Handle, FTimerId); +end; + +function TAMonthListBox.GetDate: TDateTime; +var + Year, Month, Day: Word; +begin + if ItemIndex = -1 then Result := NullDate + else + begin + DecodeDate(TopDate, Year, Month, Day); + ChangeMonth(Year, Month, ItemIndex); + Result := EncodeDate(Year, Month, 1); + end; +end; + +procedure TAMonthListBox.SetItemIndex(Value: Integer); +var + PrevItemIndex: Integer; + + procedure InvalidateItemRect(Index: Integer); + var + R: TRect; + begin + if Index = -1 then Exit; + with R do + begin + Left := 0; + Top := Index * ItemHeight; + Right := ClientWidth; + Bottom := Top + ItemHeight; + end; + InvalidateRect(Handle, @R, False); + end; + +begin + if FItemIndex <> Value then + begin + PrevItemIndex := FItemIndex; + FItemIndex := Value; + InvalidateItemRect(PrevItemIndex); + InvalidateItemRect(FItemIndex); + end; +end; + +procedure TAMonthListBox.SetTopDate(Value: TDateTime); +begin + if FTopDate <> Value then + begin + FTopDate := Value; + Repaint; + end; +end; + +procedure TAMonthListBox.WMDestroy(var Message: TMessage); +begin + FreeTimer; + inherited; +end; + +procedure TAMonthListBox.WMEraseBkgnd(var Message: TWMEraseBkgnd); +begin + Message.Result := 1; +end; + +procedure TAMonthListBox.CMFontChanged(var Message: TMessage); +begin + inherited; + Canvas.Font.Assign(Font); + with TdxBarDateNavigator(Parent) do + begin + FItemHeight := FHeaderHeight - 2; + Self.Width := 2 * GetSystemMetrics(SM_CXBORDER) + 6 * FColWidth; + Self.Height := 2 * GetSystemMetrics(SM_CYBORDER) + 7 * ItemHeight; + end; +end; + +procedure TAMonthListBox.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + begin + Style := WS_POPUP or WS_BORDER; + ExStyle := WS_EX_TOPMOST; + WindowClass.Style := WindowClass.Style or CS_SAVEBITS; + end; +end; + +procedure AMonthListBoxTimerProc(Wnd: HWND; Msg: UINT; idEvent: UINT; + Time: DWORD); stdcall; +var + AControl: TAMonthListBox; + Year, Month, Day: Word; +begin + AControl := TAMonthListBox(FindControl(Wnd)); + with AControl do + begin + DecodeDate(TopDate, Year, Month, Day); + ChangeMonth(Year, Month, 2 * Integer(idEvent > 5) - 1); + TopDate := EncodeDate(Year, Month, 1); + end; +end; + +procedure TAMonthListBox.MouseMove(Shift: TShiftState; X, Y: Integer); +const + Times: array[1..4] of UINT = (500, 250, 100, 50); +var + Delta, Sign: Integer; + NewTimerId: UINT; +begin + if PtInRect(ClientRect, Point(X, Y)) then + begin + FreeTimer; + ItemIndex := Y div ItemHeight; + end + else + begin + ItemIndex := -1; + if Y < 0 then Delta := Y + else + if Y >= ClientHeight then + Delta := 1 + Y - ClientHeight + else Exit; + Sign := Delta div Abs(Delta); + NewTimerId := Sign + Delta div 12; + if Abs(NewTimerId) > 4 then + NewTimerId := Sign * 4; + NewTimerId := NewTimerId + 5; + if (FTimer = 0) or (NewTimerId <> FTimerId) then + begin + FreeTimer; + FTimerId := NewTimerId; + FTimer := SetTimer(Handle, FTimerId, Times[Abs(FTimerId - 5)], + @AMonthListBoxTimerProc); + end; + end; +end; + +procedure TAMonthListBox.Paint; + + function GetItemColor(ASelected: Boolean): TColor; + begin + if ASelected then + Result := clWindowText + else + Result := Color; + end; + +//const +// Colors: array[Boolean] of TColor = (clWindow, clWindowText); +var + ADay, AMonth, AYear: Word; + ASelected: Boolean; + I: Integer; + R: TRect; + S: string; +begin + DecodeDate(TopDate, AYear, AMonth, ADay); + with R do + begin + Left := 0; + Top := 0; + Right := ClientWidth; + Bottom := ItemHeight; + end; + for I := 0 to 6 do + begin + ASelected := I = ItemIndex; + with Canvas do + begin + Font.Color := GetItemColor(not ASelected); + Brush.Color := GetItemColor(ASelected); + Windows.FillRect(Handle, R, Brush.Handle); + S := LongMonthNames[AMonth] + ' ' + IntToStr(AYear); + cxDrawText(Handle, S, R, DT_SINGLELINE or DT_NOCLIP or DT_CENTER or DT_VCENTER); + end; + IncMonth(AYear, AMonth); + OffsetRect(R, 0, ItemHeight); + end; +end; + +{ TdxBarCustomCalendar } + +constructor TdxBarCustomCalendar.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := ControlStyle + [csDoubleClicks]; + FFirstDate := Date; + FSelStart := FFirstDate; + FSelFinish := FSelStart; + FStyle := csFlat; +end; + +function TdxBarCustomCalendar.GetFlat: Boolean; +begin + Result := FStyle <> cs3D; +end; + +function TdxBarCustomCalendar.GetUltraFlat: Boolean; +begin + Result := Style = csUltraFlat; +end; + +procedure TdxBarCustomCalendar.SetStyle(Value: TdxBarCalendarStyle); +begin + if FStyle <> Value then + begin + FStyle := Value; + RecreateWnd; + end; +end; + +procedure TdxBarCustomCalendar.WMCancelMode(var Message: TMessage); +begin + inherited; + CancelAll; +end; + +procedure TdxBarCustomCalendar.WMCaptureChanged(var Message: TMessage); +begin + inherited; + with Message do + if (lParam <> 0) and (HWND(lParam) <> Handle) then CancelAll; +end; + +procedure TdxBarCustomCalendar.WMEraseBkgnd(var Message: TWMEraseBkgnd); +begin + Message.Result := 1; +end; + +function TdxBarCustomCalendar.GetStyle: TdxBarCalendarStyle; +begin + Result := FStyle; +end; + +function TdxBarCustomCalendar.GetRealFirstDate: TDateTime; +begin + Result := FirstDate; +end; + +function TdxBarCustomCalendar.GetRealLastDate: TDateTime; +begin + Result := LastDate; +end; + +function TdxBarCustomCalendar.GetSelStart: TDateTime; +begin + if (FSelStart < FSelFinish) or (FSelFinish = NullDate) then + Result := FSelStart + else + Result := FSelFinish; +end; + +function TdxBarCustomCalendar.GetSelFinish: TDateTime; +begin + if FSelStart < FSelFinish then + Result := FSelFinish + else + Result := FSelStart; +end; + +procedure TdxBarCustomCalendar.SetFirstDate(Value: TDateTime); +begin + if FFirstDate <> Value then + begin + FFirstDate := Value; + end; +end; + +procedure TdxBarCustomCalendar.SetSelStart(Value: TDateTime); +begin + FSelStart := Value; + FSelFinish := NullDate; + SelFinish := Value; +end; + +procedure TdxBarCustomCalendar.SetSelFinish(Value: TDateTime); +var + OldSelFinish: TDateTime; +begin + if FSelFinish <> Value then + begin + CheckFirstDate; + OldSelFinish := FSelFinish; + FSelFinish := Value; + if FSelFinish <> OldSelFinish then + begin + CheckFirstDate; + Repaint; + end; + end; +end; + +procedure TdxBarCustomCalendar.CancelAll; +begin + SendMessage(Handle, WM_LBUTTONUP, 0, LParam(PointToSmallPoint(Point(-1, -1)))); +end; + +procedure TdxBarCustomCalendar.DoDateTimeChanged; +begin + if Assigned(FOnDateTimeChanged) then FOnDateTimeChanged(Self); +end; + +procedure TdxBarCustomCalendar.DoInternalSelectPeriod(ADate: TDateTime); +var + PrevSelFinish: TDateTime; +begin + if (SelFinish <> ADate) and (ADate <> NullDate) then + begin + PrevSelFinish := FSelFinish; + SelFinish := ADate; + if FSelFinish = PrevSelFinish then Repaint; + end; +end; + +procedure TdxBarCustomCalendar.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + Style := Style or WS_CLIPCHILDREN; +end; + +procedure TdxBarCustomCalendar.CreateWnd; +begin + inherited CreateWnd; + SendMessage(Handle, CM_FONTCHANGED, 0, 0); +end; + +procedure TdxBarCustomCalendar.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +var + ADate: TDateTime; +begin + if ssDouble in Shift then Exit; + inherited MouseDown(Button, Shift, X, Y); + ADate := PosToDateTime(Point(X, Y)); + if Button = mbLeft then + begin + FDragDate := SelStart; + if ADate <> NullDate then SelStart := ADate; + end; +end; + +procedure TdxBarCustomCalendar.MouseMove(Shift: TShiftState; X, Y: Integer); +var + ADate: TDateTime; +begin + ADate := NullDate; + if (ssLeft in Shift) and (GetCapture = Handle) then + ADate := PosToDateTime(Point(X, Y)); + inherited MouseMove(Shift, X, Y); + if (ssLeft in Shift) and (GetCapture = Handle) then + if ADate <> NullDate then SelFinish := ADate + else + if not PtInRect(ClientRect, Point(X, Y)) then + DoInternalSelectPeriod(FDragDate); + Update; +end; + +{ TdxBarDateNavigator } + +constructor TdxBarDateNavigator.Create(AOwner: TComponent); +var + Year, Month, Day: Word; +begin + inherited Create(AOwner); + Visible := False; + DecodeDate(FFirstDate, Year, Month, Day); + FFirstDate := EncodeDate(Year, Month, 1); + Width := 20; + Height := 20; + FColCount := 1; + FRowCount := 1; + ShowTodayButton := True; +end; + +procedure TdxBarDateNavigator.CheckSelection(MarginDate: TDateTime); +begin + Repaint; +end; + +function TdxBarDateNavigator.ColOfDate(ADate: TDateTime): Integer; +begin + Result := DayOfWeek(ADate) - StartOfWeek - 1; + if Result < 0 then Inc(Result, 7); +end; + +function TdxBarDateNavigator.GetHeaderRect: TRect; +begin + with Result do + begin + Left := 0; + Top := 0; + Right := ClientWidth; + Bottom := Top + FHeaderHeight; + end; +end; + +function TdxBarDateNavigator.GetInternalRect: TRect; +begin + with Result do + begin + Left := 0; + Top := FHeaderHeight + Byte(not Flat); + Right := ClientWidth; + Bottom := Top + FDaysOfWeekHeight + 6 * FRowHeight + 1; + end; +end; + +function TdxBarDateNavigator.GetLeftArrowRect: TRect; +begin + SetRect(Result, 1, 1, FColWidth - 1, FHeaderHeight - 1); +end; + +function TdxBarDateNavigator.GetPainter: TdxBarPainter; +begin + if IsPopup and (FCombo.CurItemLink <> nil) then + Result := FCombo.CurItemLink.Control.Painter + else + Result := FCombo.BarManager.DefaultPainter; +end; + +function TdxBarDateNavigator.GetRightArrowRect: TRect; +begin + SetRect(Result, ClientWidth - FColWidth, 1, + ClientWidth - 1 - Byte(not Flat), FHeaderHeight - 1); +end; + +function TdxBarDateNavigator.GetMonthNameRect: TRect; +begin + Result := GetInternalRect; + with Result do + begin + Inc(Left, FColWidth); + Dec(Right, FColWidth + Byte(not Flat)); + Bottom := Top - Byte(not Flat) - 1; + Top := Bottom - (FHeaderHeight - 2); + end; +end; + +function TdxBarDateNavigator.GetTodayButtonRect: TRect; +begin + Result := + Bounds( + (ClientWidth - FTodayButtonWidth - Byte(ShowClearButton) * FClearButtonWidth) div + (3 - Byte(not ShowClearButton)), + ClientHeight - FButtonsRegionHeight + FButtonsOffset, + FTodayButtonWidth, FButtonsHeight); +end; + +function TdxBarDateNavigator.GetClearButtonRect: TRect; +begin + Result := + Bounds(ClientWidth - FClearButtonWidth - + (ClientWidth - Byte(ShowTodayButton) * FTodayButtonWidth - FClearButtonWidth) div + (3 - Byte(not ShowTodayButton)), + ClientHeight - FButtonsRegionHeight + FButtonsOffset, + FClearButtonWidth, FButtonsHeight); +end; + +function TdxBarDateNavigator.GetShowButtonsArea: Boolean; +begin + Result := ShowTodayButton or ShowClearButton; +end; + +procedure TdxBarDateNavigator.FreeTimer; +begin + dxKillTimer(Handle, FTimer); +end; + +procedure TdxBarDateNavigator.RepaintTodayButton; +begin + cxInvalidateRect(Handle, GetTodayButtonRect, False); +end; + +procedure TdxBarDateNavigator.RepaintClearButton; +begin + cxInvalidateRect(Handle, GetClearButtonRect, False); +end; + +procedure TdxBarDateNavigator.WMDestroy(var Message: TMessage); +begin + FreeTimer; + inherited; +end; + +procedure TdxBarDateNavigator.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + inherited; + if Flat then + InflateRect(Message.CalcSize_Params^.rgrc[0], -1, -1); +end; + +procedure TdxBarDateNavigator.WMNCPaint(var Message: TWMNCPaint); +var + R, CR: TRect; + Delta: Integer; + DC: HDC; +begin + inherited; + if Flat then + begin + GetWindowRect(Handle, R); + OffsetRect(R, -R.Left, -R.Top); + DC := GetWindowDC(Handle); + if Style = csFlat then + begin + Windows.GetClientRect(Handle, CR); + Delta := (R.Right - CR.Right) div 2 - 1; + InflateRect(R, -Delta, -Delta); + DrawEdge(DC, R, BDR_SUNKENOUTER, BF_RECT); + end + else + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNSHADOW)); + ReleaseDC(Handle, DC); + end; +end; + +procedure TdxBarDateNavigator.WMSize(var Message: TWMSize); +begin + inherited; + SetSize; +end; + +procedure TdxBarDateNavigator.CMFontChanged(var Message: TMessage); +begin + inherited; + Canvas.Font.Assign(Font); + FColWidth := 3 * Canvas.TextWidth('0'); + FSideWidth := 2 * Canvas.TextWidth('0'); + FRowHeight := Canvas.TextHeight('0') + 2; + FHeaderHeight := FRowHeight + 2 + Byte(Flat); + FDaysOfWeekHeight := FRowHeight + 1; + FTodayButtonWidth := Canvas.TextWidth(sdxBarDatePopupToday) + + FColWidth; + FClearButtonWidth := Canvas.TextWidth(sdxBarDatePopupClear) + + FColWidth; + FButtonsOffset := Font.Size div 2; + FButtonsHeight := MulDiv(Font.Size, 5, 2); + FButtonsRegionHeight := FButtonsOffset + FButtonsHeight + + Font.Size * 3 div 4; + SendMessage(Handle, WM_SIZE, 0, 0); +end; + +function TdxBarDateNavigator.GetStyle: TdxBarCalendarStyle; +begin + Result := inherited GetStyle; + if (Result = csFlat) and Painter.IsDateNavigatorFlat then + Result := csUltraFlat; +end; + +function TdxBarDateNavigator.GetRealFirstDate: TDateTime; +var + ACol: Integer; +begin + Result := FirstDate; + ACol := ColOfDate(FirstDate); + if ACol = 0 then + Result := Result - 7 + else + Result := Result - ACol; +end; + +function TdxBarDateNavigator.GetRealLastDate: TDateTime; +var + Year, Month, Day: Word; + ACol: Integer; +begin + Result := LastDate; + DecodeDate(Result, Year, Month, Day); + ACol := ColOfDate(EncodeDate(Year, Month, 1)); + Result := Result + 6 * 7 - DaysPerMonth(Year, Month) - ACol; + if ACol = 0 then Result := Result - 7; +end; + +function TdxBarDateNavigator.GetLastDate: TDateTime; +var + Year, Month, Day: Word; +begin + DecodeDate(FirstDate, Year, Month, Day); + Result := EncodeDate(Year, Month, DaysPerMonth(Year, Month)); +end; + +procedure TdxBarDateNavigator.SetFirstDate(Value: TDateTime); +begin + Value := DateOf(Value) - (GetDateElement(Value, deDay) - 1); + inherited SetFirstDate(Value); +end; + +procedure TdxBarDateNavigator.SetSelFinish(Value: TDateTime); +begin + if FSelFinish <> Value then + begin + FSelStart := Value; + inherited SetSelFinish(Value); + end; +end; + +procedure TdxBarDateNavigator.StepToPast; +var + Year, Month, Day: Word; +begin + DecodeDate(FirstDate, Year, Month, Day); + DecMonth(Year, Month); + FirstDate := EncodeDate(Year, Month, 1); + if SelStart > LastDate then + CheckSelection(LastDate) + else + Repaint; +end; + +procedure TdxBarDateNavigator.StepToFuture; +var + Year, Month, Day: Word; +begin + DecodeDate(FirstDate, Year, Month, Day); + IncMonth(Year, Month); + FirstDate := EncodeDate(Year, Month, 1); + if SelStart < FirstDate then + CheckSelection(FirstDate) + else + Repaint; +end; + +procedure TdxBarDateNavigator.CancelAll; +begin + inherited; + DeactivateAll; +end; + +procedure TdxBarDateNavigator.CheckFirstDate; +var + Year, Month, Day: Word; +begin + if FSelStart < RealFirstDate then + begin + DecodeDate(FSelStart, Year, Month, Day); + ChangeMonth(Year, Month, -1{(ColCount * RowCount - 1)}); + FirstDate := EncodeDate(Year, Month, CheckDay(Year, Month, Day)); + end; + if FSelStart > RealLastDate then + FirstDate := DateOf(FSelStart); +end; + +procedure TdxBarDateNavigator.DeactivateAll; +begin + FreeTimer; + dxFreeAndNil(FListBox); + FTodayButtonActive := False; + FClearButtonActive := False; +end; + +function TdxBarDateNavigator.PosToDateTime(P: TPoint): TDateTime; +var + ACol, ARow, X, Y: Integer; + R: TRect; + Year, Month, Day, AYear, AMonth: Word; + ADate: TDateTime; +begin + if PtInRect(ClientRect, P) then + begin + ACol := P.X div (ClientWidth div ColCount); + ARow := P.Y div (ClientHeight div RowCount); + R := GetInternalRect; + with R do + begin + Inc(Top, FDaysOfWeekHeight); + Inc(Left, FSideWidth); + Dec(Right, FSideWidth); + Bottom := Top + 6 * FRowHeight; + if PtInRect(R, P) then + begin + Dec(P.X, Left); + Dec(P.Y, Top); + X := P.X div FColWidth; + Y := P.Y div FRowHeight; + DecodeDate(FirstDate, Year, Month, Day); + ChangeMonth(Year, Month, ARow * ColCount + ACol); + ADate := EncodeDate(Year, Month, 1); + Result := ADate - ColOfDate(ADate) + Y * 7 + X; + if (ACol + ARow = 0) and (ColOfDate(FirstDate) = 0) then + Result := Result - 7; + DecodeDate(Result, AYear, AMonth, Day); + if ((Result < ADate) and (ACol + ARow > 0)) or + ((Result >= ADate + DaysPerMonth(Year, Month)) and + not ((ACol = ColCount - 1) and (ARow = RowCount - 1))) then + Result := NullDate; + end + else + Result := NullDate; + end; + end + else + Result := NullDate; +end; + +procedure TdxBarDateNavigator.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + begin + if IsPopup then + begin + Style := WS_CHILD or Byte(not UltraFlat) * WS_DLGFRAME; + ExStyle := WS_EX_TOOLWINDOW or WS_EX_TOPMOST; + WindowClass.Style := WindowClass.Style or CS_SAVEBITS; + end; + if not Flat then + ExStyle := ExStyle or WS_EX_CLIENTEDGE; + end; +end; + +procedure TdxBarDateNavigator.CreateWnd; +begin + inherited CreateWnd; + + if FCombo.CurItemLink <> nil then + FCombo.InternalInitDropDownWindow(Self) + else + begin + Color := clWindow; + Font.Color := clWindowText; + end; + Canvas.Font := Font; + + if IsPopup then + begin + Windows.SetParent(Handle, 0); + CallWindowProc(DefWndProc, Handle, WM_SETFOCUS, 0, 0); + end; +end; + +procedure TdxBarDateNavigator.DblClick; +var + P: TPoint; +begin + inherited; + GetCursorPos(P); + Windows.ScreenToClient(Handle, P); + if not IsPopup and (PosToDateTime(P) <> NullDate) then + FCombo.FForm.ModalResult := mrOk; +end; + +procedure TdxBarDateNavigator.KeyDown(var Key: Word; Shift: TShiftState); +var + AYear, AMonth, ADay: Word; + + procedure MoveByMonth(AForward: Boolean); + begin + DecodeDate(SelStart, AYear, AMonth, ADay); + if AForward then + IncMonth(AYear, AMonth) + else + DecMonth(AYear, AMonth); + ADay := CheckDay(AYear, AMonth, ADay); + SelStart := EncodeDate(AYear, AMonth, ADay); + end; + +begin + inherited KeyDown(Key, Shift); + if IsPopup then + case Key of + VK_RETURN: + if FListBox = nil then DoDateTimeChanged; + VK_LEFT: SelStart := SelStart - 1; + VK_RIGHT: SelStart := SelStart + 1; + VK_UP: SelStart := SelStart - 7; + VK_DOWN: SelStart := SelStart + 7; + VK_HOME: + if Shift = [ssCtrl] then + SelStart := SelStart - (GetDateElement(SelStart, deDay) - 1) + else + SelStart := SelStart - ColOfDate(SelStart); + VK_END: + if Shift = [ssCtrl] then + begin + DecodeDate(SelStart, AYear, AMonth, ADay); + SelStart := SelStart + (DaysPerMonth(AYear, AMonth) - ADay) + end + else + SelStart := SelStart + (6 - ColOfDate(SelStart)); + VK_PRIOR: MoveByMonth(False); + VK_NEXT: MoveByMonth(True) + end; +end; + +procedure ADateNavigatorTimerProc(Wnd: HWND; Msg: UINT; idEvent: UINT; + Time: DWORD); stdcall; +var + AControl: TdxBarDateNavigator; + P: TPoint; +begin + AControl := TdxBarDateNavigator(FindControl(Wnd)); + GetCursorPos(P); + P := AControl.ScreenToClient(P); + with AControl do + case idEvent of + 1: if PtInRect(GetLeftArrowRect, P) then StepToPast; + 2: if PtInRect(GetRightArrowRect, P) then StepToFuture; + end; +end; + +procedure TdxBarDateNavigator.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +var + Col, Row: Integer; + Year, Month, Day: Word; + R: TRect; +begin + if (Button = mbLeft) and IsPopup then + if ShowTodayButton and PtInRect(GetTodayButtonRect, Point(X, Y)) then + begin + FTodayButtonActive := True; + FTodayButtonPressed := True; + RepaintTodayButton; + Exit; + end + else + if ShowClearButton and PtInRect(GetClearButtonRect, Point(X, Y)) then + begin + FClearButtonActive := True; + FClearButtonPressed := True; + RepaintClearButton; + Exit; + end + else + if ShowButtonsArea and (Y >= ClientHeight - FButtonsRegionHeight) then + Exit; + inherited MouseDown(Button, Shift, X, Y); + if Button = mbLeft then + begin + Col := X div (ClientWidth div ColCount); + Row := Y div (ClientHeight div RowCount); + if PtInRect(GetMonthNameRect, Point(X, Y)) then + begin // show month's list box + FListBoxDelta := Row * ColCount + Col; + FListBox := TAMonthListBox.Create(Self); + FListBox.Visible := False; + FListBox.Parent := Self; + DecodeDate(FirstDate, Year, Month, Day); + ChangeMonth(Year, Month, FListBoxDelta - 3); + R := GetMonthNameRect; + MapWindowPoints(Handle, 0, R, 2); + with TAMonthListBox(FListBox) do + begin + Font.Assign(Self.Font); + SendMessage(Handle, CM_FONTCHANGED, 0, 0); + TopDate := EncodeDate(Year, Month, 1); + Left := (R.Left + R.Right - Width) div 2; + Top := (R.Top + R.Bottom) div 2 - Height div 2; + ShowWindow(Handle, SW_SHOWNOACTIVATE); + end; + end + else + if PtInRect(GetLeftArrowRect, Point(X, Y)) then + begin // shift by month to past + StepToPast; + if FTimer = 0 then + FTimer := SetTimer(Handle, 1, ADateNavigatorTime, + @ADateNavigatorTimerProc); + end + else + if PtInRect(GetRightArrowRect, Point(X, Y)) then + begin // shift by month to future + StepToFuture; + if FTimer = 0 then + FTimer := SetTimer(Handle, 2, ADateNavigatorTime, + @ADateNavigatorTimerProc); + end; + end; +end; + +procedure TdxBarDateNavigator.MouseMove(Shift: TShiftState; X, Y: Integer); +var + P: TPoint; +begin + if FTimer > 0 then Exit; + if FListBox <> nil then + begin + P := Point(X, Y); + MapWindowPoints(Handle, FListBox.Handle, P, 1); + TAMonthListBox(FListBox).MouseMove(Shift, P.X, P.Y); + Exit; + end; + if FTodayButtonActive then + begin + if FTodayButtonPressed <> PtInRect(GetTodayButtonRect, Point(X, Y)) then + begin + FTodayButtonPressed := not FTodayButtonPressed; + RepaintTodayButton; + end; + Exit; + end; + if FClearButtonActive then + begin + if FClearButtonPressed <> PtInRect(GetClearButtonRect, Point(X, Y)) then + begin + FClearButtonPressed := not FClearButtonPressed; + RepaintClearButton; + end; + Exit; + end; + inherited MouseMove(Shift, X, Y); +end; + +procedure TdxBarDateNavigator.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +var + ADate: TDateTime; + Year, Month, Day: Word; + P: TPoint; +begin + if FTimer > 0 then + begin + FreeTimer; + Exit; + end; + if FListBox <> nil then + begin + ADate := TAMonthListBox(FListBox).Date; + dxFreeAndNil(FListBox); + if ADate <> NullDate then + begin + DecodeDate(ADate, Year, Month, Day); + ChangeMonth(Year, Month, -FListBoxDelta); + FirstDate := EncodeDate(Year, Month, 1); + if SelStart < FirstDate then + CheckSelection(FirstDate) + else + if SelStart > LastDate then + CheckSelection(LastDate) + else + Repaint; + end; + Exit; + end; + if FTodayButtonActive then + begin + FTodayButtonActive := False; + if FTodayButtonPressed then + SelStart := Date + else + Exit; + end; + if FClearButtonActive then + begin + FClearButtonActive := False; + if FClearButtonPressed then + SelStart := NullDate + else + Exit; + end; + inherited MouseUp(Button, Shift, X, Y); + if not (ssDouble in Shift) then + begin + P := Point(X, Y); + if PtInRect(ClientRect, P) and + ((PosToDateTime(P) <> NullDate) or + ShowTodayButton and PtInRect(GetTodayButtonRect, P) or + ShowClearButton and PtInRect(GetClearButtonRect, P)) then + DoDateTimeChanged + else + DoInternalSelectPeriod(FDragDate); + end; +end; + +procedure TdxBarDateNavigator.Paint; +const + FontColors: array[Boolean] of Integer = (COLOR_WINDOWTEXT, COLOR_HIGHLIGHTTEXT); +var + I, J, ArrowHeight: Integer; + Region, Rgn: HRGN; + CurDate, ALastDate: TDateTime; + + procedure ExcludeRect(const R: TRect); + begin + Rgn := CreateRectRgnIndirect(R); + CombineRgn(Region, Region, Rgn, RGN_DIFF); + DeleteObject(Rgn); + end; + + procedure DrawArrow(const R: TRect; LeftArrow: Boolean); + var + X, Sign: Integer; + P: array[1..3] of TPoint; + Rgn: HRGN; + begin + with Canvas, R do + begin + if LeftArrow then + X := Left - 1 + else + X := Right; + Sign := 2 * Byte(LeftArrow) - 1; + P[1] := Point(X + Sign * (FSideWidth - 1), (Top + Bottom - ArrowHeight) div 2); + P[2] := Point(P[1].X, P[1].Y + ArrowHeight - 1); + P[3] := Point(P[1].X - Sign * ArrowHeight div 2, P[1].Y + ArrowHeight div 2); + Pen.Color := clBtnText; + Brush.Color := clBtnText; + Polygon(P); + // exclude arrow area from clipregion + if LeftArrow then + begin + Inc(P[1].X); + Inc(P[2].X); + end + else + Inc(P[3].X); + Dec(P[1].Y); + Inc(P[2].Y); + Rgn := CreatePolygonRgn(P, 3, WINDING); + ExtSelectClipRgn(Handle, Rgn, RGN_DIFF); + DeleteObject(Rgn); + end; + end; + + procedure DrawMonth(Col, Row: Integer); + + function GetDayBrushColor(ASelected: Boolean): TColor; + begin + if not ASelected then + Result := Color + else + if Flat then + Result := clBtnFace + else + Result := clHighlight; + end; + + var + Size: TSize; + R, TextR, SideR: TRect; + I, J, DayBase, CurDay, ADaysPerMonth: Integer; + Year, Month, Day: Word; + ADate, DateBase: TDateTime; + S: string; + Selected: Boolean; + begin + DecodeDate(FirstDate, Year, Month, Day); + ChangeMonth(Year, Month, Row * ColCount + Col); + with Canvas do + begin + R := GetInternalRect; + with R do + ExcludeRect(Rect(Left + FSideWidth, Top, Right - FSideWidth, Bottom - 1)); + // draw header's frame + TextR := GetHeaderRect; + with TextR do ArrowHeight := (Bottom - Top) div 2; + if not Odd(ArrowHeight) then Inc(ArrowHeight); + if not Flat then InflateRect(TextR, 0, 1); + ExcludeRect(TextR); + if not Flat then InflateRect(TextR, 0, -1); + Brush.Color := clBtnFace; + Pen.Color := clBtnText; + if not Flat then + with TextR do + begin + MoveToEx(Handle, Left, Bottom, nil); + Windows.LineTo(Handle, Right, Bottom); + if Col = ColCount - 1 then + begin + MoveToEx(Handle, Right - 1, Top, nil); + Windows.LineTo(Handle, Right - 1, Bottom); + Dec(TextR.Right); + end; + end; + if UltraFlat then + with TextR do + begin + Windows.FillRect(Handle, Rect(Left, Bottom - 1, Right, Bottom), COLOR_BTNSHADOW + 1); + Dec(Bottom); + end + else + begin + DrawEdge(Handle, TextR, BDR_RAISEDINNER, BF_TOP or BF_BOTTOM or + Byte(Col = 0) * BF_LEFT or Byte(Col = ColCount - 1) * BF_RIGHT); + InflateRect(TextR, -1, -1); + end; + {if Col < ColCount - 1 then + with TextR do + begin + SideR := Rect(Right - 1, Top + 2, Right + 1, Bottom - 2); + DrawEdge(Handle, SideR, EDGE_ETCHED, BF_LEFT); + with SideR do + begin + Windows.FillRect(Handle, Rect(Left, Top - 1, Right, Top), Brush.Handle); + Windows.FillRect(Handle, Rect(Left, Bottom, Right, Bottom + 1), Brush.Handle); + end; + end;} + // draw arrows + if Row = 0 then + begin + if Col = 0 then DrawArrow(TextR, True); + if Col = ColCount - 1 then DrawArrow(TextR, False); + end; + // write month's and year's names + S := LongMonthNames[Month] + ' ' + IntToStr(Year); + GetTextExtentPoint32(Handle, PChar(S), Length(S), Size); + SetTextColor(Handle, GetSysColor(COLOR_BTNTEXT)); + Brush.Color := Painter.DateNavigatorHeaderColor; + with TextR do + cxExtTextOut(Handle, S, Point((Left + Right - Size.cX) div 2, (Top + Bottom - Size.cY) div 2), + TextR, ETO_CLIPPED or ETO_OPAQUE); + // write first letters of day's names + Brush.Color := Self.Color; + with TextR do + begin + Left := R.Left + FSideWidth; + Right := R.Right - FSideWidth; + Top := R.Top; + Bottom := Top + FDaysOfWeekHeight - 2; + Windows.FillRect(Handle, Rect(Left - 8, Top, Left, Bottom + 2), Brush.Handle); + Windows.FillRect(Handle, Rect(Right, Top, Right + 8, Bottom + 2), Brush.Handle); + Pen.Color := clBtnShadow; + MoveToEx(Handle, Left, Bottom, nil); + Windows.LineTo(Handle, Right, Bottom); + Pen.Color := Self.Color; + MoveToEx(Handle, Left, Bottom + 1, nil); + Windows.LineTo(Handle, Right, Bottom + 1); + Right := Left; + end; + for I := 0 to 6 do + begin + with TextR do + begin + Left := Right; + Right := Left + FColWidth; + end; + J := StartOfWeek + 1 + I; + if J > 7 then Dec(J, 7); + if cxGetWritingDirection(Font.Charset, ShortDayNames[1]) = coRightToLeft then + S := AnsiLastChar(ShortDayNames[J]) + else + S := WideString(ShortDayNames[J])[1]; + GetTextExtentPoint32(Handle, PChar(S), Length(S), Size); + with TextR do + cxExtTextOut(Handle, S, Point(Right - 3 - Size.cX, (Top + Bottom - Size.cY) div 2), + TextR, ETO_OPAQUE); + end; + // write numbers of days + DateBase := EncodeDate(Year, Month, 1) - 1; + DayBase := 1 - ColOfDate(DateBase + 1); + if (DayBase = 1) and (Col + Row = 0) then Dec(DayBase, 7); + ADaysPerMonth := DaysPerMonth(Year, Month); + for I := 0 to 6 do + for J := 0 to 5 do + begin + with TextR do + begin + Left := R.Left + FSideWidth + I * FColWidth; + Top := R.Top + FDaysOfWeekHeight + J * FRowHeight; + Right := Left + FColWidth; + Bottom := Top + FRowHeight; + end; + + CurDay := DayBase + J * 7 + I; + if (CurDay < 1) and (Col + Row <> 0) or + (CurDay > ADaysPerMonth) and ((Col <> ColCount - 1) or (Row <> RowCount - 1)) then + ADate := NullDate + else + ADate := DateBase + CurDay; + Selected := (ADate >= SelStart) and (ADate <= SelFinish); + + if ADate = NullDate then + begin + Brush.Color := Self.Color; + Windows.FillRect(Handle, TextR, Brush.Handle); + Continue; + end; + + SideR := TextR; + // draw frame around current date + if ADate = CurDate then + begin + Brush.Color := clMaroon; + FrameRect(TextR); + InflateRect(TextR, -1, -1); + end; + if Selected and UltraFlat then + Brush.Color := TBarManagerAccess(FCombo.BarManager).FlatToolbarsSelColor + else + Brush.Color := GetDayBrushColor(Selected); + // draw text of day's number + if not Selected and + (((ADate < FirstDate) and (Col + Row = 0)) or + ((ADate > ALastDate) and + (Col = ColCount - 1) and (Row = RowCount - 1))) then + SetTextColor(Handle, GetSysColor(COLOR_GRAYTEXT)) + else + SetTextColor(Handle, GetSysColor(FontColors[Selected and not UltraFlat])); + + S := IntToStr(GetDateElement(ADate, deDay)); + GetTextExtentPoint32(Handle, PChar(S), Length(S), Size); + with SideR do + cxExtTextOut(Handle, S, Point(Right - 3 - Size.cX, (Top + Bottom - Size.cY) div 2), TextR, ETO_OPAQUE); + end; + end; + end; + + procedure DrawButton(R: TRect; ACaption: string; Pressed: Boolean); + begin + ExcludeRect(R); + Painter.DateNavigatorDrawButton(FCombo, Canvas.Handle, R, ACaption, Pressed); + end; + +begin + CurDate := Date; + ALastDate := LastDate; + Region := CreateRectRgnIndirect(ClientRect); + with Canvas do + begin + for I := 0 to RowCount - 1 do + for J := 0 to ColCount - 1 do DrawMonth(J, I); + if IsPopup and ShowButtonsArea then + begin + Pen.Color := clBtnShadow; + MoveTo(FSideWidth, ClientHeight - FButtonsRegionHeight - 1); + LineTo(ClientWidth - FSideWidth, PenPos.Y); + with PenPos do + ExcludeRect(Rect(FSideWidth, Y, X, Y + 1)); + // draw today and clear buttons + if ShowTodayButton then + DrawButton(GetTodayButtonRect, sdxBarDatePopupToday, + FTodayButtonActive and FTodayButtonPressed); + if ShowClearButton then + DrawButton(GetClearButtonRect, sdxBarDatePopupClear, + FClearButtonActive and FClearButtonPressed); + end; + Brush.Color := Self.Color; + PaintRgn(Handle, Region); + DeleteObject(Region); + end; +end; + +procedure TdxBarDateNavigator.SetSize; +begin + Width := GetWidth; + Height := GetHeight; +end; + +function TdxBarDateNavigator.GetWidth: Integer; +var + WR, CR: TRect; +begin + GetWindowRect(Handle, WR); + OffsetRect(WR, -WR.Left, -WR.Top); + Windows.GetClientRect(Handle, CR); + Result := WR.Right - CR.Right + 2 * FSideWidth + 7 * FColWidth; +end; + +function TdxBarDateNavigator.GetHeight: Integer; +var + WR, CR: TRect; +begin + GetWindowRect(Handle, WR); + OffsetRect(WR, -WR.Left, -WR.Top); + Windows.GetClientRect(Handle, CR); + Result := WR.Bottom - CR.Bottom + + FHeaderHeight + Byte(not Flat) + FDaysOfWeekHeight + 6 * FRowHeight + 1; + if IsPopup and ShowButtonsArea then + Inc(Result, FButtonsRegionHeight); +end; + +{ TdxBarDateCombo } + +constructor TdxBarDateCombo.Create(AOwner: TComponent); +begin + inherited; + Glyph.LoadFromResourceName(HInstance, 'DXBARDATECOMBO'); + FShowTodayButton := True; + FShowClearButton := True; + FInternalUpdate := True; + try + Date := SysUtils.Date; + finally + FInternalUpdate := False; + end; + FDatePopup := TdxBarDateNavigator.Create(Self); + with FDatePopup do + begin + FCombo := Self; + IsPopup := True; + end; + FShowDayText := True; +end; + +destructor TdxBarDateCombo.Destroy; +begin + FreeAndNil(FDatePopup); + inherited; +end; + +function TdxBarDateCombo.GetCurDate: TDateTime; +begin + Result := GetDateOfText(CurText); +end; + +function TdxBarDateCombo.GetDate: TDateTime; +begin + Result := GetDateOfText(Text); +end; + +procedure TdxBarDateCombo.SetCurDate(Value: TDateTime); +begin + CurText := GetDateText(CheckDate(Value)); +end; + +procedure TdxBarDateCombo.SetDate(Value: TDateTime); +begin + Text := GetDateText(CheckDate(Value)); +end; + +procedure TdxBarDateCombo.DateChanged(Sender: TObject); +begin + if (CurItemLink <> nil) and (CurItemLink.RealItemLink <> nil) then + begin + CurItemLink.RealItemLink.BringToTopInRecentList(True); + BarManager.HideAll; + end; + Date := TdxBarDateNavigator(Sender).SelStart; +end; + +procedure TdxBarDateCombo.DialogClick(Sender: TObject); +begin + case TWinControl(Sender).Tag of + 1: FDateNavigator.SelStart := SysUtils.Date; + 2: FDateNavigator.SelStart := NullDate; + end; + DialogDateChanged(nil); +end; + +procedure TdxBarDateCombo.DialogDateChanged(Sender: TObject); +begin + FDateEdit.Text := GetDateText(FDateNavigator.SelStart); +end; + +procedure TdxBarDateCombo.DialogDateEditChange(Sender: TObject); +var + ADate: TDateTime; +begin + ADate := GetDateOfText(FDateEdit.Text); + if (ADate <> NullDate) or (FDateEdit.Text = '') then + FDateNavigator.SelStart := ADate; +end; + +function TdxBarDateCombo.GetDateOfText(AText: string): TDateTime; + + function IsStringWithDayText(const S: string): Boolean; + var + I: Integer; + begin + Result := False; + for I := 1 to 7 do + if Pos(ShortDayNames[I] + ' ', S) <> 0 then + begin + Result := True; + Break; + end; + end; + +var + P: Integer; +begin + if IsStringWithDayText(AText) then + begin + P := Pos(' ', AText); + if P > 0 then Delete(AText, 1, P); + end; + Result := TextToDate(AText); +end; + +function TdxBarDateCombo.GetDateText(ADate: TDateTime): string; +begin + if ADate = NullDate then + Result := '' + else + begin + if ShowDayText then + Result := FormatDateTime('ddd ', ADate) + else + Result := ''; + Result := Result + cxDateTimeToText(ADate); + end; +end; + +function TdxBarDateCombo.IsMinDateStored: Boolean; +begin + Result := FMinDate <> 0; +end; + +function TdxBarDateCombo.IsMaxDateStored: Boolean; +begin + Result := FMaxDate <> 0; +end; + +function TdxBarDateCombo.IsTextStored: Boolean; +begin + Result := FDateOnStart = bdsCustom; +end; + +procedure TdxBarDateCombo.SetDateOnStart(Value: TdxBarDateOnStart); +begin + if FDateOnStart <> Value then + begin + FDateOnStart := Value; + CheckDateOnStart; + end; +end; + +procedure TdxBarDateCombo.SetMinDate(Value: TDateTime); +begin + Value := Min(Value, FMaxDate); + if FMinDate <> Value then + begin + FMinDate := Value; + CheckRange; + end; +end; + +procedure TdxBarDateCombo.SetMaxDate(Value: TDateTime); +begin + Value := Max(Value, FMinDate); + if FMaxDate <> Value then + begin + FMaxDate := Value; + CheckRange; + end; +end; + +procedure TdxBarDateCombo.SetShowDayText(Value: Boolean); +begin + if FShowDayText <> Value then + begin + FShowDayText := Value; + ResetDate; + end; +end; + +procedure TdxBarDateCombo.Loaded; +begin + CheckDateOnStart; + inherited Loaded; +end; + +procedure TdxBarDateCombo.CheckDateOnStart; +begin + FInternalUpdate := True; + try + case DateOnStart of + bdsToday: + Date := SysUtils.Date; + bdsNullDate: + Date := NullDate; + bdsCustom: + Date := Date; + end; + finally + FInternalUpdate := False; + end; +end; + +procedure TdxBarDateCombo.CheckRange; +var + ADate: TDateTime; +begin + ADate := CheckDate(Date); + if Date <> ADate then + Date := ADate; +end; + +function TdxBarDateCombo.CheckKeyForDropDownWindow(Key: Word; Shift: TShiftState): Boolean; +begin + Result := (Key = VK_RETURN) or + inherited CheckKeyForDropDownWindow(Key, Shift); +end; + +procedure TdxBarDateCombo.CloseUp; +begin + with FDatePopup do + if IsWindowVisible(Handle) then + begin + if GetCapture = Handle then ReleaseCapture; + DeactivateAll; + end; + inherited; + FDatePopup.Parent := nil; +end; + +procedure TdxBarDateCombo.DropDown(X, Y: Integer); +var + ADate: TDateTime; +begin + with FDatePopup do + begin + ADate := Date; + if ADate = NullDate then ADate := SysUtils.Date; + FirstDate := ADate; + SelStart := ADate; + OnDateTimeChanged := DateChanged; + ShowTodayButton := Self.ShowTodayButton; + ShowClearButton := Self.ShowClearButton; + Parent := CurItemLink.Control.Parent; //BarManager.MainForm; + end; + inherited; +end; + +function TdxBarDateCombo.GetDropDownWindow: HWND; +begin + Result := inherited GetDropDownWindow; + if Result = 0 then Result := FDatePopup.Handle; +end; + +procedure TdxBarDateCombo.ResetDate; +begin + FInternalUpdate := True; + try + Date := Date; // reset + finally + FInternalUpdate := False; + end; +end; + +procedure TdxBarDateCombo.SetText(Value: string); +begin + Value := GetDateText(CheckDate(GetDateOfText(Value))); + if not FInternalUpdate then + FDateOnStart := bdsCustom; + inherited; +end; + +function TdxBarDateCombo.CheckDate(ADate: TDateTime): TDateTime; +begin + if (MinDate <> 0) or (MaxDate <> 0) then + Result := Min(Max(ADate, MinDate), MaxDate) + else + Result := ADate; +end; + +procedure TdxBarDateCombo.DoClick; +var + ButtonOk, ButtonCancel, ButtonToday, ButtonClear: TButton; + W, H, D: Integer; +begin + inherited; + if not Assigned(OnClick) and not ReadOnly then + begin + FForm := TForm.Create(nil); + with FForm do + begin + BorderStyle := bsDialog; + Caption := cxGetResourceString(@dxSBAR_DATEDIALOGCAPTION); + Font := BarManager.Font; + Position := poScreenCenter; + + FDateEdit := TEdit.Create(FForm); + with FDateEdit do + begin + Parent := FForm; + OnChange := DialogDateEditChange; + HandleNeeded; + end; + FDateNavigator := TdxBarDateNavigator.Create(FForm); + with FDateNavigator do + begin + Style := cs3D; + FCombo := Self; + Parent := FForm; + Visible := True; + OnDateTimeChanged := DialogDateChanged; + HandleNeeded; + end; + ButtonOk := TButton.Create(FForm); + with ButtonOk do + begin + Caption := cxGetResourceString(@dxSBAR_DIALOGOK); + Default := True; + ModalResult := mrOk; + Parent := FForm; + end; + ButtonCancel := TButton.Create(FForm); + with ButtonCancel do + begin + Caption := cxGetResourceString(@dxSBAR_DIALOGCANCEL); + Cancel := True; + ModalResult := mrCancel; + Parent := FForm; + end; + if ShowTodayButton then + begin + ButtonToday := TButton.Create(FForm); + with ButtonToday do + begin + Caption := sdxBarDatePopupToday; + Parent := FForm; + Tag := 1; + OnClick := DialogClick; + end; + end + else + ButtonToday := nil; + if ShowClearButton then + begin + ButtonClear := TButton.Create(FForm); + with ButtonClear do + begin + Caption := sdxBarDatePopupClear; + Parent := FForm; + Tag := 2; + OnClick := DialogClick; + end; + end + else + ButtonClear := nil; + + W := MulDiv(FDateNavigator.FTodayButtonWidth, 3, 2); + H := MulDiv(FDateNavigator.FButtonsHeight, 7, 6); + D := FDateNavigator.FButtonsHeight div 4; + + ClientWidth := D + FDateNavigator.Width + D + W + D; + ClientHeight := D + FDateEdit.Height + D + FDateNavigator.Height + D; + FDateEdit.SetBounds(D, D, FDateNavigator.Width, FDateEdit.Height); + FDateNavigator.SetBounds(D, FDateEdit.Top + FDateEdit.Height + D, 0, 0); + ButtonOk.SetBounds(FDateEdit.Left + FDateEdit.Width + D, D, W, H); + ButtonCancel.SetBounds(ButtonOk.Left, ButtonOk.Top + ButtonOk.Height + D, W, H); + if ButtonToday <> nil then + ButtonToday.SetBounds(ButtonOk.Left, ClientHeight - D - H - D - H, W, H); + if ButtonClear <> nil then + ButtonClear.SetBounds(ButtonOk.Left, ClientHeight - D - H, W, H); + + FDateEdit.Text := GetDateText(Date); + if ShowModal = mrOk then + Date := GetDateOfText(FDateEdit.Text); + Free; + end; + end; +end; + +{ TdxBarDateComboControl } + +function TdxBarDateComboControl.GetDate: TDateTime; +begin + Result := Item.GetDateOfText(Text); +end; + +function TdxBarDateComboControl.GetItem: TdxBarDateCombo; +begin + Result := TdxBarDateCombo(ItemLink.Item); +end; + +procedure TdxBarDateComboControl.SetDate(const Value: TDateTime); +begin + Text := Item.GetDateText(Value); +end; + +procedure TdxBarDateComboControl.WndProc(var Message: TMessage); +begin + with Message do + if Msg = WM_CHAR then + case wParam of + Ord('+'): + begin + if Date <> NullDate then Date := Date + 1; + wParam := 0; + end; + Ord('-'): + begin + if Date <> NullDate then Date := Date - 1; + wParam := 0; + end; + end; + inherited; +end; + +{$IFNDEF DELPHI6} + +{ TdxBarTreeNode } + +destructor TdxBarTreeNode.Destroy; +begin + if Owner.Owner <> nil then + TdxBarTreeView(Owner.Owner).Delete(Self); + inherited; +end; + +{$ENDIF} + +{ TdxBarTreeView } + +constructor TdxBarTreeView.Create(AOwner: TComponent); +begin + inherited; + Visible := False; + ReadOnly := True; + SetBounds(0, 0, 150, 200); +end; + +destructor TdxBarTreeView.Destroy; + + procedure FreeNode(ANode: TTreeNode); + var + I: Integer; + begin + for I := 0 to ANode.Count - 1 do + FreeNode(ANode[0]); + ANode.Free; + end; + +begin + while Items.Count <> 0 do + FreeNode(Items.GetFirstNode); + inherited; +end; + +function TdxBarTreeView.FindNode(const AText: string): TTreeNode; +var + ANode: TTreeNode; + + function FindOne(ARootNode: TTreeNode): TTreeNode; + var + ANode: TTreeNode; + begin + if AnsiCompareText(AText, ARootNode.Text) = 0 then Result := ARootNode + else + begin + Result := nil; + ANode := ARootNode.GetFirstChild; + while ANode <> nil do + begin + Result := FindOne(ANode); + if Result <> nil then Exit; + ANode := ARootNode.GetNextChild(ANode); + end; + end; + end; + +begin + Result := nil; + with Items do + begin + ANode := GetFirstNode; + while ANode <> nil do + begin + Result := FindOne(ANode); + if Result <> nil then Break; + ANode := ANode.GetNext; + end; + end; +end; + +function TdxBarTreeView.GetPainter: TdxBarPainter; +begin + if IsPopup and (FCombo.CurItemLink <> nil) then + Result := FCombo.CurItemLink.Control.Painter + else + Result := FCombo.BarManager.DefaultPainter; +end; + +procedure TdxBarTreeView.SaveAndHide; +begin + if (Selected <> nil) and FCombo.DoCanSelectNode then + if IsPopup then + begin + with FCombo do + begin + if (CurItemLink <> nil) and (CurItemLink.RealItemLink <> nil) then + CurItemLink.RealItemLink.BringToTopInRecentList(True); + BarManager.HideAll; + end; + FCombo.SelectedNode := Selected; + end + else + begin + FCombo.Text := Selected.Text; + FCombo.FForm.ModalResult := mrOk; + end; +end; + +procedure TdxBarTreeView.TVMSetImageList(var Message: TMessage); +begin + inherited; + if IsPopup then FCombo.UpdateEx;//DoImageListChanged; +end; + +procedure TdxBarTreeView.TVMSetItem(var Message: TMessage); +begin + inherited; + if not (csDestroying in ComponentState) and + (FCombo.SelectedNode <> nil) and + (PTVItem(Message.lParam)^.hitem = FCombo.SelectedNode.ItemId) then + FCombo.DoSelectedNodeChanged; +end; + +procedure TdxBarTreeView.WMCaptureChanged(var Message: TMessage); +begin + inherited; + if FCloseButtonIsTracking then + begin + FCloseButtonIsTracking := False; + FMouseAboveCloseButton := False; + SendMessage(Handle, WM_NCPAINT, 0, 0); + end; +end; + +procedure TdxBarTreeView.WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); +begin + inherited; + Message.MinMaxInfo^.ptMinTrackSize := Point(100, 100); +end; + +procedure TdxBarTreeView.WMLButtonUp(var Message: TWMLButtonUp); +begin + inherited; + if FCloseButtonIsTracking then + begin + FCloseButtonIsTracking := False; + ReleaseCapture; + if FMouseAboveCloseButton then + FCombo.BarManager.HideAll + else + SendMessage(Handle, WM_NCPAINT, 0, 0); + end; +end; + +procedure TdxBarTreeView.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + inherited; + if IsPopup then + Painter.SysPanelCalcSize(Handle, Message.CalcSize_Params^.rgrc[0], + FCorner, FCombo, FCombo.AllowResizing); +end; + +procedure TdxBarTreeView.WMNCHitTest(var Message: TWMNCHitTest); +var + PrevMouseAboveCloseButton: Boolean; +begin + inherited; + with Message do + if PtInRect(FGripRect, SmallPointToPoint(Pos)) then + Result := GetHitTestByCorner(FCorner) + else + begin + PrevMouseAboveCloseButton := FMouseAboveCloseButton; + FMouseAboveCloseButton := (GetTopWindow(0) = Handle) and + ((GetCapture = 0) or FCloseButtonIsTracking) and + PtInRect(FCloseButtonRect, SmallPointToPoint(Pos)); + if FMouseAboveCloseButton then Result := HTBORDER; + if PrevMouseAboveCloseButton <> FMouseAboveCloseButton then + SendMessage(Handle, WM_NCPAINT, 0, 0); + end; +end; + +procedure TdxBarTreeView.WMNCLButtonDown(var Message: TWMNCLButtonDown); +begin + inherited; + if FMouseAboveCloseButton then + begin + FCloseButtonIsTracking := True; + SetCapture(Handle); + SendMessage(Handle, WM_NCPAINT, 0, 0); + end; +end; + +procedure TdxBarTreeView.WMNCPaint(var Message: TWMNCPaint); +begin + inherited; + if IsPopup then + Painter.SysPanelDraw(Handle, FCombo.AllowResizing, + FMouseAboveCloseButton, FCloseButtonIsTracking, FCloseButtonRect, FGripRect, FCorner); +end; + +procedure TdxBarTreeView.WMSysColorChange(var Message: TWMSysColorChange); +begin + inherited; + RecreateWnd; +end; + +procedure TdxBarTreeView.CMMouseLeave(var Message: TMessage); +begin + inherited; + if FMouseAboveCloseButton then + begin + FMouseAboveCloseButton := False; + SendMessage(Handle, WM_NCPAINT, 0, 0); + end; +end; + +procedure TdxBarTreeView.CNNotify(var Message: TWMNotify); +begin + case Message.NMHdr^.code of + TVN_DELETEITEM: + if FCombo.SelectedNode <> nil then + with PNMTreeView(Pointer(Message.NMHdr))^ do + if itemOld.hItem = FCombo.SelectedNode.ItemId then + FCombo.FSelectedNode := nil; + end; + inherited; +end; + +procedure TdxBarTreeView.Change(Node: TTreeNode); +begin + inherited; + if (FCombo.FocusedItemLink <> nil) and IsPopup and (Node <> nil) then + FCombo.CurText := Node.Text; +end; + +{$IFNDEF DELPHI6} + +function TdxBarTreeView.CreateNode: TTreeNode; +begin + Result := TdxBarTreeNode.Create(Items); +end; + +{$ENDIF} + +procedure TdxBarTreeView.CreateParams(var Params: TCreateParams); +begin + inherited; + with Params do + begin + if csDesigning in FCombo.ComponentState then + Style := Style and not WS_CHILD or WS_POPUP; + if IsPopup then + begin + ExStyle := ExStyle and not WS_EX_CLIENTEDGE or WS_EX_TOOLWINDOW or WS_EX_TOPMOST; + WindowClass.Style := WindowClass.Style or CS_SAVEBITS; + end; + end; +end; + +procedure TdxBarTreeView.CreateWnd; +begin + inherited; + if IsPopup then + begin + Windows.SetParent(Handle, 0); + CallWindowProc(DefWndProc, Handle, WM_SETFOCUS, 0, 0); + end; +end; + +procedure TdxBarTreeView.DblClick; +var + P: TPoint; +begin + inherited; + if FCombo.ChooseByDblClick then + begin + GetCursorPos(P); + Windows.ScreenToClient(Handle, P); + if GetHitTestInfoAt(P.X, P.Y) * [htOnItem, htOnIcon, htOnLabel, htOnStateIcon] <> [] then + SaveAndHide; + end; +end; + +procedure TdxBarTreeView.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited; + if Key = VK_RETURN then SaveAndHide; +end; + +procedure TdxBarTreeView.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + inherited; + if not FCombo.ChooseByDblClick and + (GetHitTestInfoAt(X, Y) * [htOnItem, htOnIcon, htOnLabel, htOnStateIcon] <> []) then + SaveAndHide; +end; + +procedure TdxBarTreeView.SetFocus; +begin +end; + +{ TdxBarTreeViewCombo } + +constructor TdxBarTreeViewCombo.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Glyph.LoadFromResourceName(HInstance, 'DXBARTREEVIEWCOMBO'); + ShowEditor := False; + FAllowResizing := True; + FChooseByDblClick := True; + FShowImageInEdit := True; + FTreeView := TdxBarTreeView.Create(Self); + FTreeView.IsPopup := True; + FTreeView.FCombo := Self; + if not (csDesigning in ComponentState) then + FTreeView.Parent := BarManager.Owner; +end; + +destructor TdxBarTreeViewCombo.Destroy; +begin + FreeAndNil(FTreeView); + inherited; +end; + +function TdxBarTreeViewCombo.GetDropDownHeight: Integer; +begin + Result := FTreeView.Height; +end; + +function TdxBarTreeViewCombo.GetDropDownWidth: Integer; +begin + Result := FTreeView.Width; +end; + +function TdxBarTreeViewCombo.GetImages: TCustomImageList; +begin + Result := FTreeView.Images; +end; + +function TdxBarTreeViewCombo.GetIndent: Integer; +begin + Result := FTreeView.Indent; +end; + +function TdxBarTreeViewCombo.GetItems: TTreeNodes; +begin + Result := FTreeView.Items; +end; + +function TdxBarTreeViewCombo.GetShowButtons: Boolean; +begin + Result := FTreeView.ShowButtons; +end; + +function TdxBarTreeViewCombo.GetShowLines: Boolean; +begin + Result := FTreeView.ShowLines; +end; + +function TdxBarTreeViewCombo.GetShowRoot: Boolean; +begin + Result := FTreeView.ShowRoot; +end; + +function TdxBarTreeViewCombo.GetSortType: TSortType; +begin + Result := FTreeView.SortType; +end; + +function TdxBarTreeViewCombo.GetStateImages: TCustomImageList; +begin + Result := FTreeView.StateImages; +end; + +function TdxBarTreeViewCombo.GetOnExpanded: TTVExpandedEvent; +begin + Result := FTreeView.OnExpanded; +end; + +function TdxBarTreeViewCombo.GetOnExpanding: TTVExpandingEvent; +begin + Result := FTreeView.OnExpanding; +end; + +function TdxBarTreeViewCombo.GetOnChanging: TTVChangingEvent; +begin + Result := FTreeView.OnChanging; +end; + +function TdxBarTreeViewCombo.GetOnCollapsed: TTVExpandedEvent; +begin + Result := FTreeView.OnCollapsed; +end; + +function TdxBarTreeViewCombo.GetOnCollapsing: TTVCollapsingEvent; +begin + Result := FTreeView.OnCollapsing; +end; + +function TdxBarTreeViewCombo.GetOnCompare: TTVCompareEvent; +begin + Result := FTreeView.OnCompare; +end; + +function TdxBarTreeViewCombo.GetOnGetImageIndex: TTVExpandedEvent; +begin + Result := FTreeView.OnGetImageIndex; +end; + +function TdxBarTreeViewCombo.GetOnGetSelectedIndex: TTVExpandedEvent; +begin + Result := FTreeView.OnGetSelectedIndex; +end; + +function TdxBarTreeViewCombo.GetOnTreeViewChange: TTVChangedEvent; +begin + Result := FTreeView.OnChange; +end; + +procedure TdxBarTreeViewCombo.SetDropDownHeight(Value: Integer); +begin + if Value < 100 then Value := 100; + FTreeView.Height := Value; +end; + +procedure TdxBarTreeViewCombo.SetDropDownWidth(Value: Integer); +begin + if Value < 100 then Value := 100; + FTreeView.Width := Value; +end; + +procedure TdxBarTreeViewCombo.SetImages(Value: TCustomImageList); +begin + FTreeView.Images := Value; +end; + +procedure TdxBarTreeViewCombo.SetIndent(Value: Integer); +begin + FTreeView.Indent := Value; +end; + +procedure TdxBarTreeViewCombo.SetItems(Value: TTreeNodes); +begin + FTreeView.Items := Value; +end; + +procedure TdxBarTreeViewCombo.SetSelectedNode(Value: TTreeNode); +begin + if FSelectedNode <> Value then + begin + FSelectedNode := Value; + DoSelectedNodeChanged; + end; +end; + +procedure TdxBarTreeViewCombo.SetShowButtons(Value: Boolean ); +begin + FTreeView.ShowButtons := Value; +end; + +procedure TdxBarTreeViewCombo.SetShowImageInEdit(Value: Boolean); +begin + if FShowImageInEdit <> Value then + begin + FShowImageInEdit := Value; + if (Images <> nil) or (StateImages <> nil) then UpdateEx; + end; +end; + +procedure TdxBarTreeViewCombo.SetShowLines(Value: Boolean); +begin + FTreeView.ShowLines := Value; +end; + +procedure TdxBarTreeViewCombo.SetShowRoot(Value: Boolean); +begin + FTreeView.ShowRoot := Value; +end; + +procedure TdxBarTreeViewCombo.SetSortType(Value: TSortType); +begin + FTreeView.SortType := Value; +end; + +procedure TdxBarTreeViewCombo.SetStateImages(Value: TCustomImageList); +begin + FTreeView.StateImages := Value; +end; + +procedure TdxBarTreeViewCombo.SetOnExpanded(Value: TTVExpandedEvent); +begin + FTreeView.OnExpanded := Value; +end; + +procedure TdxBarTreeViewCombo.SetOnExpanding(Value: TTVExpandingEvent); +begin + FTreeView.OnExpanding := Value; +end; + +procedure TdxBarTreeViewCombo.SetOnChanging(Value: TTVChangingEvent); +begin + FTreeView.OnChanging := Value; +end; + +procedure TdxBarTreeViewCombo.SetOnCollapsed(Value: TTVExpandedEvent); +begin + FTreeView.OnCollapsed := Value; +end; + +procedure TdxBarTreeViewCombo.SetOnCollapsing(Value: TTVCollapsingEvent); +begin + FTreeView.OnCollapsing := Value; +end; + +procedure TdxBarTreeViewCombo.SetOnCompare(Value: TTVCompareEvent); +begin + FTreeView.OnCompare := Value; +end; + +procedure TdxBarTreeViewCombo.SetOnGetImageIndex(Value: TTVExpandedEvent); +begin + FTreeView.OnGetImageIndex := Value; +end; + +procedure TdxBarTreeViewCombo.SetOnGetSelectedIndex(Value: TTVExpandedEvent); +begin + FTreeView.OnGetSelectedIndex := Value; +end; + +procedure TdxBarTreeViewCombo.SetOnTreeViewChange(Value: TTVChangedEvent); +begin + FTreeView.OnChange := Value; +end; + +procedure TdxBarTreeViewCombo.FormSize(Sender: TObject); +var + H, W, D: Integer; +begin + W := 12 * FForm.Canvas.TextWidth('0'); + H := MulDiv(FForm.Canvas.TextHeight('0'), 5, 3); + D := H div 4; + + with FFormTreeView do + begin + Left := D; + Top := D; + Width := FForm.ClientWidth - (D + D + W + D); + Height := FForm.ClientHeight - (D + D); + end; + FButtonOk.SetBounds(FForm.ClientWidth - D - W, D, W, H); + FButtonCancel.SetBounds(FButtonOk.Left, FButtonOk.Top + FButtonOk.Height + D, W, H); +end; + +function TdxBarTreeViewCombo.CheckKeyForDropDownWindow(Key: Word; Shift: TShiftState): Boolean; +begin + Result := (Key = VK_RETURN) or inherited CheckKeyForDropDownWindow(Key, Shift); +end; + +function TdxBarTreeViewCombo.DoCanSelectNode: Boolean; +begin + Result := True; + if Assigned(FOnCanSelectNode) then + FOnCanSelectNode(Self, TreeView.Selected, Result); +end; + +procedure TdxBarTreeViewCombo.DoSelectedNodeChanged; +var + AText: string; +begin + FInSelectedNodeChanged := True; + try + if SelectedNode = nil then + AText := '' + else + AText := SelectedNode.Text; + if Text = AText then + Change + else + Text := AText; + Update; + finally + FInSelectedNodeChanged := False; + end; +end; + +procedure TdxBarTreeViewCombo.DrawInterior(ABarEditControl: TdxBarEditControl; ACanvas: TCanvas; + R: TRect; ItemLink: TdxBarItemLink); +var + DC: HDC; + ANode: TTreeNode; + AIndex: Integer; + S: string; +begin + if not HasImageInEdit then + inherited + else + begin + if FocusedItemLink = ItemLink then + ANode := FTreeView.Selected + else + ANode := SelectedNode; + DC := ACanvas.Handle; + FillRect(DC, R, ACanvas.Brush.Handle); + with R do + begin + Inc(Left); + if (StateImages <> nil) and (ANode <> nil) and + (0 <= ANode.StateIndex) and (ANode.StateIndex < StateImages.Count) then + with StateImages do + begin + Draw(ACanvas, Left, (Top + Bottom - Height) div 2, ANode.StateIndex); + Inc(Left, Width); + end; + if Images <> nil then + with Images do + begin + if ANode = nil then + AIndex := -1 + else + if (0 <= ANode.SelectedIndex) and (ANode.SelectedIndex < Count) then + AIndex := ANode.SelectedIndex + else + if (0 <= ANode.ImageIndex) and (ANode.ImageIndex < Count) then + AIndex := ANode.ImageIndex + else + AIndex := -1; + if AIndex <> -1 then + Draw(ACanvas, Left, (Top + Bottom - Height) div 2, AIndex); + Inc(Left, Width + 3); + end; + if FocusedItemLink <> nil then + S := CurText + else + S := Text; + //Canvas.TextOut(Left + 2, (Top + Bottom - Canvas.TextHeight(S)) div 2, S); + Inc(Left, 2); + Dec(Right, 2); + cxDrawText(DC, S, R, DT_SINGLELINE or DT_NOPREFIX or DT_VCENTER); + end; + end; +end; + +procedure TdxBarTreeViewCombo.DropDown(X, Y: Integer); +begin + InternalInitDropDownWindow(FTreeView); + if FFullExpand then FTreeView.FullExpand; + if CurText <> Text then + FTreeView.Selected := FTreeView.FindNode(CurText); + if (FTreeView.Selected = nil) and (FTreeView.Items.Count > 0) then + with FTreeView.Items[0] do + begin + Focused := True; + MakeVisible; + end; + if FTreeView.Selected <> nil then + FTreeView.Selected.MakeVisible; + inherited; +end; + +function TdxBarTreeViewCombo.GetDropDownWindow: HWND; +begin + Result := inherited GetDropDownWindow; + if Result = 0 then Result := FTreeView.Handle; +end; + +function TdxBarTreeViewCombo.HasImageInEdit: Boolean; +begin + Result := FShowImageInEdit and ((Images <> nil) or (StateImages <> nil)); +end; + +procedure TdxBarTreeViewCombo.Loaded; +begin + inherited; + Text := FLoadedText; +end; + +procedure TdxBarTreeViewCombo.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if Operation = opRemove then + if AComponent = FTreeView then FTreeView := nil; +end; + +procedure TdxBarTreeViewCombo.SetText(Value: string); +begin + if Text <> Value then + if csLoading in ComponentState then FLoadedText := Value + else + begin + if not FInSelectedNodeChanged then + FSelectedNode := FTreeView.FindNode(Value); + inherited; + end; +end; + +procedure TdxBarTreeViewCombo.DoClick; +var + W, H, D, I, J: Integer; +begin + inherited; + if Assigned(OnClick) or ReadOnly then Exit; + + FForm := TForm.Create(nil); + with FForm do + begin + if FAllowResizing then + BorderIcons := [] + else + BorderStyle := bsDialog; + Caption := cxGetResourceString(@dxSBAR_TREEVIEWDIALOGCAPTION); + Font := BarManager.Font; + Position := poScreenCenter; + + FFormTreeView := TdxBarTreeView.Create(FForm); + with FFormTreeView do + begin + FCombo := Self; + Visible := True; + Parent := FForm; + + Images := FTreeView.Images; + Indent := FTreeView.Indent; + Items.Assign(FTreeView.Items); + ShowButtons := FTreeView.ShowButtons; + ShowLines := FTreeView.ShowLines; + ShowRoot := FTreeView.ShowRoot; + SortType := FTreeView.SortType; + StateImages := FTreeView.StateImages; + + HandleNeeded; + while (ClientHeight <> FTreeView.ClientHeight) or + (ClientWidth <> FTreeView.ClientWidth) do + begin + ClientHeight := FTreeView.ClientHeight; + ClientWidth := FTreeView.ClientWidth; + end; + end; + FButtonOk := TButton.Create(FForm); + with FButtonOk do + begin + Caption := cxGetResourceString(@dxSBAR_DIALOGOK); + Default := True; + ModalResult := mrOk; + Parent := FForm; + end; + FButtonCancel := TButton.Create(FForm); + with FButtonCancel do + begin + Caption := cxGetResourceString(@dxSBAR_DIALOGCANCEL); + Cancel := True; + ModalResult := mrCancel; + Parent := FForm; + end; + + Canvas.Font := Font; + W := 12 * Canvas.TextWidth('0'); + H := MulDiv(Canvas.TextHeight('0'), 5, 3); + D := H div 4; + + with FFormTreeView do + begin + Left := D; + Top := D; + end; + FButtonOk.SetBounds(FFormTreeView.BoundsRect.Right + D, D, W, H); + FButtonCancel.SetBounds(FButtonOk.Left, FButtonOk.Top + FButtonOk.Height + D, W, H); + I := D + FFormTreeView.Width + D + W + D; + J := D + FFormTreeView.Height + D; + while (I <> ClientWidth) or (J <> ClientHeight) do + begin + ClientWidth := I; + ClientHeight := J; + end; + + OnResize := FormSize; + if FFullExpand then FFormTreeView.FullExpand; + FFormTreeView.Selected := FFormTreeView.FindNode(Text); + if (FFormTreeView.Selected = nil) and (FFormTreeView.Items.Count > 0) then + with FFormTreeView.Items[0] do + begin + Focused := True; + MakeVisible; + end; + if (ShowModal = mrOk) and (FFormTreeView.Selected <> nil) then + Text := FFormTreeView.Selected.Text; + while (FTreeView.ClientHeight <> FFormTreeView.ClientHeight) or + (FTreeView.ClientWidth <> FFormTreeView.ClientWidth) do + begin + FTreeView.ClientHeight := FFormTreeView.ClientHeight; + FTreeView.ClientWidth := FFormTreeView.ClientWidth; + end; + Free; + end; +end; + +{ TdxBarTreeViewComboControl } + +function TdxBarTreeViewComboControl.GetItem: TdxBarTreeViewCombo; +begin + Result := TdxBarTreeViewCombo(ItemLink.Item); +end; + +function TdxBarTreeViewComboControl.GetDefaultHeight: Integer; +var + AItem: TdxBarTreeViewCombo; + Value: Integer; +begin + Result := inherited GetDefaultHeight; + AItem := Item; + if not Parent.IsVertical and AItem.HasImageInEdit then + begin + if AItem.Images = nil then + Value := 0 + else + Value := AItem.Images.Height; + if (AItem.StateImages <> nil) and (AItem.StateImages.Height > Value) then + Value := AItem.StateImages.Height; + Value := 2 + 1 + Value + 1 + 2; + if Value > Result then Result := Value; + end; +end; + +procedure TdxBarTreeViewComboControl.SetFocused(Value: Boolean); +begin + inherited; + if Value then + with Item do + if SelectedNode = nil then + TreeView.Selected := TreeView.FindNode(Text) + else + TreeView.Selected := SelectedNode; +end; + +{ TdxBarImageCombo } + +constructor TdxBarImageCombo.Create(AOwner: TComponent); +begin + inherited; + Glyph.LoadFromResourceName(HInstance, 'DXBARIMAGECOMBO'); + ShowEditor := False; + FImageChangeLink := TChangeLink.Create; + FImageChangeLink.OnChange := ImageListChange; + FShowText := True; +end; + +destructor TdxBarImageCombo.Destroy; +begin + FreeAndNil(FImageChangeLink); + inherited; +end; + +function TdxBarImageCombo.GetImageIndexes(Index: Integer): Integer; +begin + Result := Integer(Items.Objects[Index]) - 1; +end; + +procedure TdxBarImageCombo.SetImageIndexes(Index: Integer; Value: Integer); +begin + Items.Objects[Index] := TObject(Value + 1); + if Index = ItemIndex then Update; +end; + +procedure TdxBarImageCombo.SetImages(Value: TCustomImageList); +begin + cxSetImageList(Value, FImages, FImageChangeLink, Self); +end; + +procedure TdxBarImageCombo.SetShowText(Value: Boolean); +begin + if FShowText <> Value then + begin + FShowText := Value; + Update; + end +end; + +procedure TdxBarImageCombo.ImageListChange(Sender: TObject); +begin + if not (csLoading in ComponentState) then ImagesChanged; +end; + +procedure TdxBarImageCombo.ReadImageIndexes(Reader: TReader); +var + I: Integer; +begin + Reader.ReadListBegin; + for I := 0 to Items.Count - 1 do + if Reader.EndOfList then Break + else + ImageIndexes[I] := Reader.ReadInteger; + Reader.ReadListEnd; +end; + +procedure TdxBarImageCombo.WriteImageIndexes(Writer: TWriter); +var + I: Integer; +begin + Writer.WriteListBegin; + for I := 0 to Items.Count - 1 do + Writer.WriteInteger(ImageIndexes[I]); + Writer.WriteListEnd; +end; + +procedure TdxBarImageCombo.DialogListBoxDblClick(Sender: TObject); +begin + FForm.ModalResult := mrOk; +end; + +procedure TdxBarImageCombo.DialogListBoxDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); +begin + FCanvas := FDialogListBox.Canvas; + DrawItem(ClickItemLink.Control.Painter, Index, Rect, State); + FCanvas := nil; +end; + +procedure TdxBarImageCombo.DialogListBoxMeasureItem(Control: TWinControl; Index: Integer; + var Height: Integer); +begin + FCanvas := FDialogListBox.Canvas; + MeasureItem(Index, Height); + FCanvas := nil; +end; + +procedure TdxBarImageCombo.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('ImageIndexes', ReadImageIndexes, WriteImageIndexes, True); +end; + +procedure TdxBarImageCombo.DrawItem(APainter: TdxBarPainter; + AIndex: Integer; ARect: TRect; AState: TOwnerDrawState); +var + OriginX, AImageIndex: Integer; + R: TRect; + S: string; +begin + if Assigned(OnDrawItem) or (Images = nil) then + inherited + else + with Canvas, ARect do + begin + FillRect(ARect); + with Images do + begin + if FShowText then + OriginX := Left + 1 + else + OriginX := (Left + Right - Width) div 2; + R := Bounds(OriginX, (Top + Bottom - Height) div 2, Width, Height); + if AIndex <> -1 then + begin + AImageIndex := ImageIndexes[AIndex]; + if (0 <= AImageIndex) and (AImageIndex < Count) then + Draw(Canvas, R.Left, R.Top, AImageIndex) + else + if FocusedItemLink = nil then R.Right := R.Left; + end + else + if FocusedItemLink = nil then R.Right := R.Left; + end; + if FShowText then + begin + if AIndex = -1 then + S := Text + else + S := Items[AIndex]; + TextOut(R.Right + 2, (Top + Bottom - TextHeight(S)) div 2, S); + end; + if odFocused in AState then Windows.DrawFocusRect(Handle, ARect); // for hiding focus rect + end; +end; + +procedure TdxBarImageCombo.ImagesChanged; +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + if Links[I].Control is TdxBarImageComboControl then + TdxBarImageComboControl(Links[I].Control).ImagesChanged; +end; + +procedure TdxBarImageCombo.MeasureItem(AIndex: Integer; var AHeight: Integer); +begin + if Assigned(OnMeasureItem) then inherited + else + begin + inherited; + if (Images <> nil) and (1 + Images.Height + 1 > AHeight) then + AHeight := 1 + Images.Height + 1; + end; +end; + +procedure TdxBarImageCombo.MeasureItemWidth(AIndex: Integer; var AWidth: Integer); +begin + inherited; + if Images <> nil then + begin + if not FShowText then AWidth := 0; + Inc(AWidth, 1 + Images.Width + 1); + end; +end; + +procedure TdxBarImageCombo.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if (Operation = opRemove) and (AComponent = Images) then Images := nil; +end; + +procedure TdxBarImageCombo.DoClick; +var + W, H, D, C: Integer; + FButtonOk, FButtonCancel: TButton; +begin + inherited; + if Assigned(OnClick) or ReadOnly then Exit; + + FForm := TForm.Create(nil); + with FForm do + begin + BorderStyle := bsDialog; + Caption := cxGetResourceString(@dxSBAR_IMAGEDIALOGCAPTION); + Font := BarManager.Font; + Position := poScreenCenter; + + Canvas.Font := Font; + W := 12 * Canvas.TextWidth('0'); + H := MulDiv(Canvas.TextHeight('0'), 5, 3); + D := H div 4; + + FDialogListBox := TListBox.Create(FForm); + with FDialogListBox do + begin + Parent := FForm; + Items.Assign(Self.Items); + FCanvas := Canvas; + if Items.Count < DropDownCount then C := Items.Count + else C := DropDownCount; + ClientHeight := ItemsHeight[0] * C; + if Height < H + D + H then Height := H + D + H; + ClientWidth := GetDropDownWidth - (2 + 2); + FCanvas := nil; + Style := lbOwnerDrawVariable; + OnDblClick := DialogListBoxDblClick; + OnDrawItem := DialogListBoxDrawItem; + OnMeasureItem := DialogListBoxMeasureItem; + end; + FButtonOk := TButton.Create(FForm); + with FButtonOk do + begin + Caption := cxGetResourceString(@dxSBAR_DIALOGOK); + Default := True; + ModalResult := mrOk; + Parent := FForm; + end; + FButtonCancel := TButton.Create(FForm); + with FButtonCancel do + begin + Caption := cxGetResourceString(@dxSBAR_DIALOGCANCEL); + Cancel := True; + ModalResult := mrCancel; + Parent := FForm; + end; + + ClientWidth := D + FDialogListBox.Width + D + W + D; + ClientHeight := D + FDialogListBox.Height + D; + with FDialogListBox do + begin + Left := D; + Top := D; + end; + FButtonOk.SetBounds(ClientWidth - D - W, D, W, H); + FButtonCancel.SetBounds(FButtonOk.Left, FButtonOk.Top + FButtonOk.Height + D, W, H); + + FDialogListBox.ItemIndex := ItemIndex; + if ShowModal = mrOk then ItemIndex := FDialogListBox.ItemIndex; + Free; + end; +end; + +{ TdxBarImageComboControl } + +function TdxBarImageComboControl.GetDefaultHeight: Integer; +var + AItem: TdxBarImageCombo; + Value: Integer; +begin + Result := inherited GetDefaultHeight; + AItem := TdxBarImageCombo(Item); + if not Parent.IsVertical and (AItem.Images <> nil) then + begin + Value := 2 + 1 + AItem.Images.Height + 1 + 2; + if Value > Result then Result := Value; + end; +end; + +procedure TdxBarImageComboControl.ImagesChanged; +begin + Parent.RepaintBar; +end; + +{ TdxBarToolbarsListItem } + +function TdxBarToolbarsListItem.InternalCanMergeWith(AItem: TdxBarItem): Boolean; +begin + Result := AItem is TdxBarToolbarsListItem; +end; + +{ TdxBarToolbarsListItemControl } + +procedure TdxBarToolbarsListItemControl.CreateSubMenuControl; +begin + if BarManager.IsCustomizing then Exit; + BarDesignController.InitToolBarPopup(Item.ItemLinks); + Item.ItemLinks.BarControl := TdxBarSubMenuControl.Create(BarManager); + SubMenuControl.ItemLinks := Item.ItemLinks; +end; + +{ TdxBarSpinEdit } + +constructor TdxBarSpinEdit.Create(AOwner: TComponent); +begin + inherited; + FIncrement := 1; + FPrefixPlace := ppEnd; + Text := '0'; +end; + +function TdxBarSpinEdit.GetCurValue: Extended; +begin + Result := TextToValue(CurText); +end; + +function TdxBarSpinEdit.GetIntCurValue: Integer; +begin + Result := Trunc(CurValue); +end; + +function TdxBarSpinEdit.GetIntValue: Integer; +begin + Result := Trunc(Value); +end; + +function TdxBarSpinEdit.GetValue: Extended; +begin + Result := TextToValue(Text); +end; + +procedure TdxBarSpinEdit.SetCurValue(Value: Extended); +begin + Value := GetCheckedValue(Value); + if CurValue <> Value then CurText := ValueToText(Value); +end; + +procedure TdxBarSpinEdit.SetIncrement(Value: Extended); +begin + PrepareValue(Value); + case FValueType of + svtInteger: + if Value < 1 then Value := 1; + svtFloat: + if Value <= 0 then Value := 1; + end; + FIncrement := Value; +end; + +procedure TdxBarSpinEdit.SetIntCurValue(Value: Integer); +begin + CurValue := Value; +end; + +procedure TdxBarSpinEdit.SetIntValue(Value: Integer); +begin + Self.Value := Value; +end; + +procedure TdxBarSpinEdit.SetMaxValue(Value: Extended); +begin + PrepareValue(Value); + if FMaxValue <> Value then + begin + FMaxValue := Value; + if FMinValue > FMaxValue then FMinValue := FMaxValue; + Self.Value := GetCheckedValue(Self.Value); + CurValue := GetCheckedValue(CurValue); + end; +end; + +procedure TdxBarSpinEdit.SetMinValue(Value: Extended); +begin + PrepareValue(Value); + if FMinValue <> Value then + begin + FMinValue := Value; + if FMaxValue < FMinValue then FMaxValue := FMinValue; + Self.Value := GetCheckedValue(Self.Value); + CurValue := GetCheckedValue(CurValue); + end; +end; + +procedure TdxBarSpinEdit.SetPrefix(const Value: string); +var + AValue: Extended; +begin + AValue := Self.Value; + if FPrefix <> Value then + begin + FPrefix := Value; + Text := ValueToText(AValue); + end; +end; + +procedure TdxBarSpinEdit.SetPrefixPlace(Value: TdxBarSpinEditPrefixPlace); +begin + if FPrefixPlace <> Value then + begin + FPrefixPlace := Value; + Text := ValueToText(Self.Value); + end; +end; + +procedure TdxBarSpinEdit.SetValue(Value: Extended); +begin + Value := GetCheckedValue(Value); + if Self.Value <> Value then Text := ValueToText(Value); +end; + +procedure TdxBarSpinEdit.SetValueType(Value: TdxBarSpinEditValueType); +var + PrevValue, PrevCurValue: Extended; +begin + if FValueType <> Value then + begin + PrevValue := Self.Value; + PrevCurValue := Self.CurValue; + FValueType := Value; + if Value = svtInteger then + begin + Increment := Increment; + MinValue := MinValue; + MaxValue := MaxValue; + Self.Value := PrevValue; + CurValue := PrevCurValue; + end; + end; +end; + +function TdxBarSpinEdit.IsIncrementStored: Boolean; +begin + Result := FIncrement <> 1; +end; + +function TdxBarSpinEdit.IsMaxValueStored: Boolean; +begin + Result := FMaxValue <> 0; +end; + +function TdxBarSpinEdit.IsMinValueStored: Boolean; +begin + Result := FMinValue <> 0; +end; + +function TdxBarSpinEdit.IsValueStored: Boolean; +begin + Result := Value <> 0; +end; + +procedure TdxBarSpinEdit.AddPrefix(var Text: string); +begin + if FPrefixPlace = ppEnd then + Text := Text + FPrefix + else + Text := FPrefix + Text; +end; + +procedure TdxBarSpinEdit.RemovePrefix(var Text: string); +var + P: Integer; +begin + P := Pos(FPrefix, Text); + if P <> 0 then Delete(Text, P, Length(FPrefix)); +end; + +function TdxBarSpinEdit.CheckRange: Boolean; +begin + Result := (FMinValue <> FMaxValue) or (FMinValue <> 0); +end; + +procedure TdxBarSpinEdit.DoButtonClick(Button: TdxBarSpinEditButton); +begin + case Button of + sbUp: CurValue := CurValue + Increment; + sbDown: CurValue := CurValue - Increment; + end; + if Assigned(FOnButtonClick) then FOnButtonClick(Self, Button); +end; + +function TdxBarSpinEdit.GetCheckedValue(Value: Extended): Extended; +begin + Result := Value; + PrepareValue(Result); + if CheckRange then + begin + if Result < FMinValue then Result := FMinValue; + if Result > FMaxValue then Result := FMaxValue; + end; +end; + +procedure TdxBarSpinEdit.KeyDown(var Key: Word; Shift: TShiftState); +const + Buttons: array[Boolean] of Integer = (secButtonDown, secButtonUp); +var + Control: TdxBarSpinEditControl; +begin + inherited; + if (Key in [VK_UP, VK_DOWN]) and (FocusedItemLink <> nil) and not ReadOnly then + begin + Control := TdxBarSpinEditControl(FocusedItemLink.Control); + if Control.FTimerID = 0 then + begin + Control.ActiveButtonIndex := Buttons[Key = VK_UP]; + DoButtonClick(Control.ActiveButton); + end; + Key := 0; + end; +end; + +procedure TdxBarSpinEdit.KeyPress(var Key: Char); +var + KeySet: set of Char; +begin + inherited; + KeySet := [Chr(VK_BACK), ^C, ^V, ^X, '0'..'9']; + if FMinValue < 0 then Include(KeySet, '-'); + if FValueType = svtFloat then Include(KeySet, DecimalSeparator); + if not (Key in KeySet) then Key := #0; +end; + +procedure TdxBarSpinEdit.KeyUp(var Key: Word; Shift: TShiftState); +begin + inherited; + if FocusedItemLink <> nil then + with TdxBarSpinEditControl(FocusedItemLink.Control) do + if (Key in [VK_UP, VK_DOWN]) and (FTimerID = 0) then + ActiveButtonIndex := - 1; +end; + +procedure TdxBarSpinEdit.PrepareValue(var Value: Extended); +begin + if FValueType = svtInteger then Value := Trunc(Value); +end; + +function TdxBarSpinEdit.TextToValue(Text: string): Extended; +begin + RemovePrefix(Text); + try + if FValueType = svtInteger then + Result := StrToInt(Text) + else + Result := StrToFloat(Text); + except + on EConvertError do Result := FMinValue; + end; +end; + +procedure TdxBarSpinEdit.SetText(Value: string); +begin + RemovePrefix(Value); + try + if FValueType = svtInteger then + StrToInt(Value) + else + StrToFloat(Value); + except + on EConvertError do Exit; + end; + inherited SetText(ValueToText(GetCheckedValue(TextToValue(Value)))); +end; + +function TdxBarSpinEdit.ValueToText(Value: Extended): string; +begin + if FValueType = svtInteger then + Result := IntToStr(Trunc(Value)) + else + Result := FloatToStr(Value); + AddPrefix(Result); +end; + +{ TdxBarSpinEditControl } + +function TdxBarSpinEditControl.GetActiveButton: TdxBarSpinEditButton; +begin + case FActiveButtonIndex of + secButtonUp: Result := sbUp; + secButtonDown: Result := sbDown + else + Result := sbNone; + end; +end; + +function TdxBarSpinEditControl.GetButtonPressed: Boolean; +begin + Result := ActiveButtonIndex in [secButtonUp, secButtonDown]; +end; + +function TdxBarSpinEditControl.GetDrawParams: TdxBarSpinEditDrawParams; +begin + Result := TdxBarSpinEditDrawParams(FDrawParams); +end; + +function TdxBarSpinEditControl.GetItem: TdxBarSpinEdit; +begin + Result := TdxBarSpinEdit(ItemLink.Item); +end; + +procedure TdxBarSpinEditControl.SetActiveButtonIndex(Value: Integer); +begin + if Item.ReadOnly then + FActiveButtonIndex := - 1 + else + if FActiveButtonIndex <> Value then + begin + FActiveButtonIndex := Value; + Repaint; + end; +end; + +procedure TdxBarSpinEditControl.BreakProcess; +begin + if GetCapture = Handle then ReleaseCapture; + ActiveButtonIndex := - 1; + if FTimerID <> 0 then + dxKillTimer(Handle, FTimerID); +end; + +procedure TdxBarSpinEditControl.CalcDrawParams(AFull: Boolean = True); +begin + inherited CalcDrawParams(AFull); + if AFull then + begin + DrawParams.ActiveButtonIndex := ActiveButtonIndex; + DrawParams.ArrowSize := Painter.GetSpinEditArrowSize(cxRectHeight(ItemBounds)); + DrawParams.IsPressed := Pressed; + end; +end; + +procedure TdxBarSpinEditControl.CalcParts; +begin + inherited; + Painter.CalculateSpinEditParts(DrawParams, FParts, ItemBounds); +end; + +procedure TdxBarSpinEditControl.CorrectFrameRect(var ARect: TRect); +begin + Painter.SpinEditCorrectFrameRect(DrawParams, ARect); +end; + +procedure TdxBarSpinEditControl.DrawTextField; + + function IsSpinButtonsVisible: Boolean; + begin + Result := cxRectWidth(FParts[secButtonUp]) <> 0 + end; + + procedure DrawButton(AButtonIndex: Integer); + begin + Painter.SpinEditControlDrawButton(DrawParams, FParts[AButtonIndex], AButtonIndex); + end; + +var + AIndentsRect, AAdjacentZoneRect: TRect; +begin + if IsSpinButtonsVisible then + begin + AIndentsRect := Painter.GetSpinEditButtonIndents(DrawParams.PaintType); + AAdjacentZoneRect := cxRectUnion(FParts[secButtonUp], FParts[secButtonDown]); + AAdjacentZoneRect := cxRectInflate(AAdjacentZoneRect, AIndentsRect.Left, AIndentsRect.Top, + AIndentsRect.Right, AIndentsRect.Bottom); + Canvas.SetClipRegion(TcxRegion.Create(AAdjacentZoneRect), roAdd); + Canvas.SetClipRegion(TcxRegion.Create(ViewInfo.Bounds), roIntersect); + Painter.SpinEditControlDrawButtonsAdjacentZone(DrawParams, AAdjacentZoneRect); + DrawButton(secButtonUp); + DrawButton(secButtonDown); + Canvas.SetClipRegion(TcxRegion.Create(AAdjacentZoneRect), roSubtract); + end; + + inherited; +end; + +function TdxBarSpinEditControl.GetDrawParamsClass: TdxBarItemControlDrawParamsClass; +begin + Result := TdxBarSpinEditDrawParams; +end; + +function TdxBarSpinEditControl.GetPartCount: Integer; +begin + Result := inherited GetPartCount + 2; +end; + +procedure TdxBarSpinEditControl.KillFocus(AHandle: THandle); +begin + if not ButtonPressed then + BreakProcess; + inherited; +end; + +procedure TdxBarSpinEditControl.WndProc(var Message: TMessage); +begin + inherited; + with Message do + case Msg of + WM_MOUSEWHEEL: + if not Item.ReadOnly then + if SmallInt(HiWord(TWMMouse(Message).Keys)) > 0 then + Item.DoButtonClick(sbUp) + else + Item.DoButtonClick(sbDown); + WM_CAPTURECHANGED: + if FTimerID <> 0 then BreakProcess; + {WM_LBUTTONDBLCLK, }WM_LBUTTONDOWN: + if not ButtonPressed then + begin + ActiveButtonIndex := FHotPartIndex; + if ButtonPressed then + begin + SetCapture(Handle); + Item.DoButtonClick(ActiveButton); + FTimerID := SetTimer(Handle, 1, GetDoubleClickTime - 100, nil); + end; + end; + WM_LBUTTONUP: + if FTimerID <> 0 then BreakProcess; + WM_MOUSEMOVE: + if (FTimerID <> 0) then + ActiveButtonIndex := FHotPartIndex; + WM_TIMER: + case wParam of + 1: begin + KillTimer(Handle, FTimerID); + FTimerID := SetTimer(Handle, 2, 100, nil); + end; + 2: if ButtonPressed then Item.DoButtonClick(ActiveButton); + end; + end; +end; + +{ TdxBarControlContainerItem } + +constructor TdxBarControlContainerItem.Create(AOwner: TComponent); +begin + inherited; + FPlace := TPlaceForm.CreateNew(nil); + FPlace.BorderStyle := bsNone; +end; + +destructor TdxBarControlContainerItem.Destroy; +begin + Control := nil; + FreeAndNil(FPlace); + inherited; +end; + +function TdxBarControlContainerItem.GetControlVisible: Boolean; +begin + Result := (FPlace <> nil) and FPlace.Visible; +end; + +function TdxBarControlContainerItem.GetInPlaceControl: Boolean; +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + begin + Result := (Links[I].Control <> nil) and + TdxBarControlContainerControl(Links[I].Control).InPlaceControl; + if Result then Exit; + end; + Result := False; +end; + +procedure TdxBarControlContainerItem.SetControl(Value: TControl); +begin + if (Value <> nil) and IsControlAssigned(Value) then + raise Exception.Create(dxSBAR_CANTASSIGNCONTROL); + if FControl <> Value then + begin + if FControl <> nil then + begin + FControl.WindowProc := FPrevControlWndProc; + if not (csDestroying in FControl.ComponentState) and + not BarManager.Designing then + FControl.Parent := nil; + end; + FControl := Value; + if FControl <> nil then + begin + FControl.FreeNotification(Self); + FPrevControlWndProc := FControl.WindowProc; + FControl.WindowProc := ControlWndProc; + SaveControlSize; + end; + UpdateEx; + end; +end; + +procedure TdxBarControlContainerItem.ControlWndProc(var Message: TMessage); + + function IsSizeChanged: Boolean; + begin + with Control, FPrevControlSize do + Result := (Width <> X) or (Height <> Y); + end; + +begin + if Message.Msg = CM_RECREATEWND then + begin + Control.WindowProc := FPrevControlWndProc; + try + FPrevControlWndProc(Message); + finally + if Control <> nil then + begin + FPrevControlWndProc := Control.WindowProc; + Control.WindowProc := ControlWndProc; + end; + end; + Exit; + end; + + FPrevControlWndProc(Message); + with Message do + if not InPlaceControl and IsSizeChanged and + ((Msg = WM_SIZE) or (Msg = WM_WINDOWPOSCHANGED) and (lParam = 0)) then + begin + SaveControlSize; + UpdateEx; + end; +end; + +function TdxBarControlContainerItem.IsControlAssigned(AControl: TControl): Boolean; +var + I: Integer; + ABarItem: TdxBarItem; +begin + Result := True; + for I := 0 to BarManager.ItemCount - 1 do + begin + ABarItem := BarManager.Items[I]; + if (ABarItem is TdxBarControlContainerItem) and (ABarItem <> Self) and + (TdxBarControlContainerItem(ABarItem).Control = AControl) then Exit; + end; + Result := False; +end; + +procedure TdxBarControlContainerItem.SaveControlSize; +begin + with Control do + FPrevControlSize := Point(Width, Height); +end; + +procedure TdxBarControlContainerItem.SetControlVisible(Value: Boolean); +begin + if ControlVisible <> Value then + begin + if FPlace <> nil then + FPlace.Visible := Value; + end; +end; + +procedure TdxBarControlContainerItem.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited; + if (Operation = opRemove) and (AComponent = Control) then Control := nil; +end; + +procedure TdxBarControlContainerItem.SetName(const NewName: TComponentName); +begin + inherited; + if (Control = nil) and not IsLoading then UpdateEx; +end; + +function TdxBarControlContainerItem.CanClicked: Boolean; +begin + Result := False; +end; + +function TdxBarControlContainerItem.GetHidden: Boolean; +begin + Result := True; +end; + +function TdxBarControlContainerItem.HasAccel(AItemLink: TdxBarItemLink): Boolean; +begin + Result := (AItemLink.Control <> nil) and + (AItemLink.Control.Parent.Kind = bkBarQuickControl); +end; + +procedure TdxBarControlContainerItem.HideControl(AControl: TdxBarItemControl); +begin + if TdxBarControlContainerControl(AControl).ShowsControl then + begin + FPlace.Visible := False; + FPlace.ParentWindow := 0; + end; +end; + +function TdxBarControlContainerItem.NeedToBeHidden: Boolean; +begin + Result := True; +end; + +{ TdxBarControlContainerControl } + +destructor TdxBarControlContainerControl.Destroy; +begin + Item.HideControl(Self); + inherited; +end; + +function TdxBarControlContainerControl.GetItem: TdxBarControlContainerItem; +begin + Result := TdxBarControlContainerItem(ItemLink.Item); +end; + +function TdxBarControlContainerControl.GetPlace: TCustomForm; +begin + Result := Item.Place; +end; + +procedure TdxBarControlContainerControl.InternalPaint; +begin + PlaceControl; + Place.Invalidate; + +{ TODO: + if not FPlacedControl then + PlaceControl + else + Place.Invalidate; +} +end; + +procedure TdxBarControlContainerControl.PlaceControl; +begin + if ShowsControl then + begin + if FInPlaceControl or Item.InPlaceControl then Exit; + FInPlaceControl := True; + try + if not IsRectEmpty(ItemBounds) or (Item.LinkCount = 1) then + Place.ParentWindow := Parent.Handle; + {$IFDEF DELPHI9} + TPlaceForm(Place).Position := poDesigned; + {$ENDIF} + if not IsRectEmpty(ItemBounds) or IsShowingControl then + Place.BoundsRect := ItemBounds; + Control.Parent := Place; + if not IsRectEmpty(ItemBounds) then + with Control do + begin + BoundsRect := Parent.ClientRect; + Visible := True; + end; + Place.Brush.Color := cxGetBrushData(Parent.BkBrush).lbColor; + TPlaceForm(Place).FBarItemControl := Self; + Place.Visible := True; + FPlacedControl := True; + finally + FInPlaceControl := False; + end; + end; +end; + +procedure TdxBarControlContainerControl.BeforeDestroyParentHandle; +begin + inherited; + if IsShowingControl and (Control is TWinControl) then + begin + TWinControlAccess(Control).DestroyHandle; + Place.Visible := False; // work-around for the controls that + Place.ParentWindow := 0; // don't check HandleAllocated + end; +end; + +procedure TdxBarControlContainerControl.CalcParts; +begin + inherited CalcParts; + if IsRectEmpty(ItemBounds) and (Place <> nil) then + Place.Visible := False; +end; + +function TdxBarControlContainerControl.CanClicked: Boolean; +begin + Result := Parent.Kind = bkBarQuickControl; +end; + +function TdxBarControlContainerControl.CanSelect: Boolean; +begin + if Parent.Kind = bkBarQuickControl then + Result := True + else + Result := BarManager.Designing; +end; + +procedure TdxBarControlContainerControl.DoPaint(ARect: TRect; + PaintType: TdxBarPaintType); +const + Borders: array[Boolean] of Integer = (BDR_RAISEDINNER, BDR_SUNKENOUTER); +var + R: TRect; + DC: HDC; + ABrush: HBRUSH; + PrevBkColor: COLORREF; + S: string; + APressed: Boolean; +begin + R := ARect; + DC := Canvas.Handle; + if Parent.Kind = bkBarQuickControl then + begin + APressed := DrawSelected and Parent.IsActive and MousePressed; + Painter.DrawGlyph(Self, DC, R, cxEmptyRect, PaintType, False, DrawSelected, False, APressed, False, False, False, False); + if IconAssigned(GetViewSize) then + Inc(R.Left, FDrawParams.DefaultButtonSize.cx) + else + Inc(R.Left, Parent.Font.Size div 2); + Painter.OffsetEllipsisBounds(APressed, R); + Painter.DrawItemText(Self, DC, Caption, R, DT_LEFT, Enabled, False, False, False, False); + end + else + if (Control = nil) or BarManager.Designing then + begin + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNSHADOW)); + InflateRect(R, -1, -1); + + ABrush := CreateHatchBrush(HS_BDIAGONAL, GetSysColor(COLOR_BTNSHADOW)); + + PrevBkColor := SetBkColor(DC, cxGetBrushData(Parent.BkBrush).lbColor); + FillRect(DC, R, ABrush); + SetBkColor(DC, PrevBkColor); + DeleteObject(ABrush); + + if Control = nil then + S := Item.Name + else + S := cxGetResourceString(@dxSBAR_PLACEFORCONTROL) + Control.Name; + Painter.DrawItemText(Self, DC, S, R, DT_CENTER, True, False, PaintType = ptVert, True, False); + end + else + InternalPaint; +end; + +function TdxBarControlContainerControl.GetControl: TControl; +begin + if Item = nil then + Result := nil + else + Result := Item.Control; +end; + +function TdxBarControlContainerControl.GetDefaultHeight: Integer; +begin + if (Control = nil) or (Parent.Kind = bkBarQuickControl) then + begin + if Parent.Kind = bkSubMenu then + Result := GetTextSize + else + Result := Max(GetTextSize, FDrawParams.DefaultButtonSize.cy); + end + else + Result := Control.Height; +end; + +function TdxBarControlContainerControl.GetDefaultWidth: Integer; +begin + if (Control = nil) or (Parent.Kind = bkBarQuickControl) then + begin + if Parent.Kind = bkSubMenu then + Result := 2 * Parent.TextSize + 3 + GetTextWidth(GetTextOf(Item.Name)) + 3 + Painter.ContainerControlSubMenuOffset + else + if Parent.Kind = bkBarQuickControl then + begin + if IconAssigned(FDrawParams.ViewSize) then + Result := GetCaptionWidth + FDrawParams.DefaultButtonSize.cx + 4 + else + Result := GetCaptionWidth + Parent.Font.Size; + end + else + Result := GetTextWidth(GetTextOf(Item.Name)) + Canvas.Font.Size + end + else + Result := Control.Width; +end; + +function TdxBarControlContainerControl.IsDestroyOnClick: Boolean; +begin + Result := Parent.Kind = bkBarQuickControl; +end; + +function TdxBarControlContainerControl.IsHitTestTransparent: Boolean; +begin + Result := not FPlacedControl; +end; + +function TdxBarControlContainerControl.IsShowingControl: Boolean; +begin + Result := (Control <> nil) and (Place.ParentWindow = Parent.Handle); +end; + +function TdxBarControlContainerControl.NeedCaptureMouse: Boolean; +begin + Result := Parent.Kind = bkBarQuickControl; +end; + +procedure TdxBarControlContainerControl.RealVisibleChanging(AVisible: Boolean); +begin + if FPlacedControl then + Item.ControlVisible := AVisible; +end; + +function TdxBarControlContainerControl.ShowsControl: Boolean; +begin + Result := (Parent.Kind <> bkBarQuickControl) and (Control <> nil) and + not BarManager.Designing; +end; + +{ TdxBarProgressItem } + +constructor TdxBarProgressItem.Create(AOwner: TComponent); +begin + inherited; + BorderStyle := sbsLowered; + FColor := clDefault; + FMax := 100; + FStep := 10; +end; + +procedure TdxBarProgressItem.SetColor(Value: TColor); +begin + if FColor <> Value then + begin + FColor := Value; + UpdateBar; + end; +end; + +procedure TdxBarProgressItem.SetMax(Value: Integer); +var + AMin, AMax: Integer; +begin + if FMax <> Value then + begin + AMin := FMin; + AMax := Value; + if AMin > AMax then AMin := AMax; + SetParams(AMin, AMax); + end; +end; + +procedure TdxBarProgressItem.SetMin(Value: Integer); +var + AMin, AMax: Integer; +begin + if FMin <> Value then + begin + AMin := Value; + AMax := FMax; + if AMax < AMin then AMax := AMin; + SetParams(AMin, AMax); + end; +end; + +procedure TdxBarProgressItem.SetPosition(Value: Integer); +begin + if Value < FMin then Value := FMin; + if Value > FMax then Value := FMax; + if FPosition <> Value then + begin + FPosition := Value; + UpdateBar; + end; +end; + +procedure TdxBarProgressItem.SetSmooth(Value: Boolean); +begin + if FSmooth <> Value then + begin + FSmooth := Value; + UpdateBar; + end; +end; + +procedure TdxBarProgressItem.SetStep(Value: Integer); +begin + FStep := Value; +end; + +procedure TdxBarProgressItem.UpdateBar; +var + I: Integer; +begin + if not IsLoading then + for I := 0 to LinkCount - 1 do + if Links[I].Control <> nil then + TdxBarProgressControl(Links[I].Control).UpdateBar; +end; + +procedure TdxBarProgressItem.SetParams(AMin, AMax: Integer); +begin + if (FMin <> AMin) or (FMax <> AMax) then + begin + FMin := AMin; + FMax := AMax; + if IsLoading then Exit; + if FMin > FMax then FMin := FMax; + if FPosition < FMin then + Position := FMin + else + if FPosition > FMax then + Position := FMax + else + UpdateBar; + end; +end; + +procedure TdxBarProgressItem.StepBy(Delta: Integer); +begin + Position := Position + Delta; +end; + +procedure TdxBarProgressItem.StepIt; +begin + if FPosition + FStep > FMax then + Position := FPosition + FStep - FMax + else + if FPosition + FStep < FMin then + Position := FMax - (FMin - (FPosition + FStep)) + else + Position := Position + Step; +end; + +{ TdxBarProgressControl } + +function TdxBarProgressControl.GetDrawParams: TdxbarProgressControlDrawParams; +begin + Result := TdxbarProgressControlDrawParams(FDrawParams); +end; + +function TdxBarProgressControl.GetItem: TdxBarProgressItem; +begin + Result := TdxBarProgressItem(ItemLink.Item); +end; + +function TdxBarProgressControl.BarBrushColor: TColorRef; +begin + if Item.Color = clDefault then + Result := Painter.ProgressControlBarBrushColor + else + Result := ColorToRGB(Item.Color); +end; + +function TdxBarProgressControl.BarHeight: Integer; +var + AHeight: Integer; +begin + if Parent.IsVertical then + AHeight := cxRectWidth(ItemBounds) + else + AHeight := cxRectHeight(ItemBounds); + Result := MulDiv(AHeight - (BorderOffsets.Top + BorderOffsets.Bottom), 2, 3); + if Odd(AHeight) <> Odd(Result) then + Inc(Result); +end; + +function TdxBarProgressControl.BarRect: TRect; +var + W, H, RightOffset: Integer; +begin + W := BarWidth; + H := BarHeight; + RightOffset := W + ProgressBarIndent + BorderOffsets.Right + RightIndent; + with ItemBounds do + if Parent.IsVertical then + Result := Bounds((Left + Right - H) div 2, Bottom - RightOffset, H, W) + else + Result := Bounds(Right - RightOffset, (Top + Bottom - H) div 2, W, H); +end; + +function TdxBarProgressControl.BarWidth: Integer; + + function GetProgressBarIndent: Integer; + begin + Result := ProgressBarIndent; + if not(cpText in DrawParams.ViewStructure) then + Result := Result * 2; + end; + +var + AWidth: Integer; +begin + if (Width = 0) and (Align <> iaClient) then + Result := ProgressBarDefaultWidth + else + begin + AWidth := GetRotationDependentWidth(cxRectSize(ItemBounds)); + if (Parent.Kind <> bkSubMenu) and (ALign <> iaClient) then + AWidth := Width; + + Result := AWidth - GetAutoWidth(GetRotationDependentWidth(DrawParams.DefaultButtonSize)) - GetProgressBarIndent; + if Result < 0 then Result := 0; + end; +end; + +procedure TdxBarProgressControl.CalcDrawParams(AFull: Boolean); +begin + inherited; + if AFull then + begin + DrawParams.AllowCenter := False; + DrawParams.Max := Item.Max; + DrawParams.Min := Item.Min; + DrawParams.Position := Item.Position; + DrawParams.Smooth := Item.Smooth; + end; +end; + +function TdxBarProgressControl.CanHaveZeroSize: Boolean; +begin + Result := True; +end; + +procedure TdxBarProgressControl.DrawInterior(ARect: TRect); +var + BarR: TRect; + AIndent: Integer; +begin + BarR := BarRect; + + Canvas.SaveDC; + try + Canvas.SetClipRegion(TcxRegion.Create(BarR), roSubtract); + AIndent := Painter.ProgressControlIndent(DrawParams); + + if AIndent <> 0 then + with ARect do + Painter.DrawBackground(Self, Canvas.Handle, Rect(Left, Top, Left + AIndent, Bottom), Parent.BkBrush, False); + Inc(ARect.Left, AIndent); + inherited; + finally + Canvas.RestoreDC; + end; + + if not IsRectEmpty(BarR) then + Painter.ProgressControlDrawBar(DrawParams, BarR, BarBrushColor); +end; + +function TdxBarProgressControl.GetAlignment: TAlignment; +begin + Result := taLeftJustify; +end; + +function TdxBarProgressControl.GetDrawParamsClass: TdxBarItemControlDrawParamsClass; +begin + Result := TdxBarProgressControlDrawParams; +end; + +function TdxBarProgressControl.GetPossibleViewLevels: TdxBarItemViewLevels; +begin + Result := inherited GetPossibleViewLevels + [ivlControlOnly]; +end; + +function TdxBarProgressControl.InternalGetDefaultHeight: Integer; +var + ABarHeight: Integer; +begin + Result := inherited InternalGetDefaultHeight; + ABarHeight := Painter.ProgressControlBarHeight(Self) + BorderOffsets.Top + BorderOffsets.Bottom + 2; + if Result < ABarHeight then + Result := ABarHeight; +end; + +function TdxBarProgressControl.InternalGetDefaultWidth: Integer; +begin + Result := inherited InternalGetDefaultWidth; + if Width = 0 then + Inc(Result, (Byte(not (cpText in DrawParams.ViewStructure)) + 1) * ProgressBarIndent + + ProgressBarDefaultWidth); + Inc(Result, Painter.ProgressControlIndent(DrawParams)); +end; + +procedure TdxBarProgressControl.UpdateBar; +var + R: TRect; +begin + R := BarRect; + InvalidateRect(Parent.Handle, @R, False); +end; + +{ TdxBarMRUListItem } + +constructor TdxBarMRUListItem.Create(AOwner: TComponent); +begin + inherited; + FMaxItemCount := 5; +end; + +procedure TdxBarMRUListItem.SetMaxItemCount(Value: Integer); +begin + if Value < 0 then Value := 0; + if FMaxItemCount <> Value then + begin + FMaxItemCount := Value; + CheckItemCount; + end; +end; + +procedure TdxBarMRUListItem.CheckItemCount; +var + I: Integer; +begin + if FMaxItemCount = 0 then Exit; + for I := Items.Count - 1 downto FMaxItemCount do + Items.Delete(I); +end; + +function TdxBarMRUListItem.GetDisplayText(const AText: string): string; +begin + Result := GetCuttedString(inherited GetDisplayText(AText)); +end; + +procedure TdxBarMRUListItem.DirectClick; +begin + inherited; + if ((CurItemLink = nil) or (CurItemLink.Item <> Self)) and + not BarManager.IsCustomizing and FRemoveItemOnClick then + begin + RemoveItem(Items[ItemIndex], nil); + ItemIndex := -1; + end; +end; + +procedure TdxBarMRUListItem.AddItem(const S: string; AObject: TObject); +var + I: Integer; +begin + I := Items.IndexOf(S); + if (I = -1) and (AObject <> nil) then + I := Items.IndexOfObject(AObject); + if I = -1 then + begin + Items.InsertObject(0, S, AObject); + CheckItemCount; + end + else + Items.Move(I, 0); +end; + +procedure TdxBarMRUListItem.RemoveItem(const S: string; AObject: TObject); +var + I: Integer; +begin + with Items do + begin + if S <> '' then + I := IndexOf(S) + else + I := IndexOfObject(AObject); + if I <> -1 then Delete(I); + end; +end; + +{ TdxBarInPlaceSubItem } + +procedure TdxBarInPlaceSubItem.SetExpanded(Value: Boolean); +var + List: TList; + I: Integer; +begin + if FExpanded <> Value then + begin + if not Value then + for I := 0 to LinkCount - 1 do + DoBeforeCollapse(Links[I]); + FExpanded := Value; + if not IsLoading then + begin + List := TList.Create; + FExpandedChanging := True; + try + for I := 0 to LinkCount - 1 do + with Links[I] do + if (Control <> nil) and (Control.Parent is TdxBarSubMenuControl) and + (List.IndexOf(Control.Parent) = -1) then + begin + List.Add(Control.Parent); + Control.Parent.RepaintBar; + end; + finally + FExpandedChanging := False; + List.Free; + end; + end; + if Value then + for I := 0 to LinkCount - 1 do + DoAfterExpand(Links[I]); + end; +end; + +procedure TdxBarInPlaceSubItem.AddListedItemLinks(AItemLinks: TdxBarItemLinks; + AIndex: Integer; FirstCall: Boolean; CallingItemLink: TdxBarItemLink); +begin + if FExpanded then inherited; +end; + +procedure TdxBarInPlaceSubItem.DeleteListedItemLinks(AItemLinks: TdxBarItemLinks; + AIndex: Integer); +begin + if FExpanded and not FExpandedChanging or + not FExpanded and FExpandedChanging then inherited; +end; + +function TdxBarInPlaceSubItem.HideWhenRun: Boolean; +begin + Result := False; +end; + +function TdxBarInPlaceSubItem.InternalActuallyVisible: Boolean; +begin + Result := True; +end; + +function TdxBarInPlaceSubItem.InternalCanMergeWith(AItem: TdxBarItem): Boolean; +begin + Result := AItem is TdxBarInPlaceSubItem; +end; + +procedure TdxBarInPlaceSubItem.ChangeNextItemLinkBeginGroup(ALink: TdxBarItemLink; + Value: Boolean); +var + NextItemLinkIndex: Integer; +begin + if FKeepBeginGroupWhileExpanded then + with ALink.Owner do + if not (BarControl is TdxBarControl) then + begin + NextItemLinkIndex := ALink.VisibleIndex + 1; + if not BarManager.Designing then + Inc(NextItemLinkIndex, ItemLinks.VisibleItemCount); + if NextItemLinkIndex <= VisibleItemCount - 1 then + VisibleItems[NextItemLinkIndex].BeginGroup := Value; + end; +end; + +procedure TdxBarInPlaceSubItem.DoAfterExpand(ALink: TdxBarItemLink); +begin + if Assigned(FOnAfterExpand) then FOnAfterExpand(Self, ALink); + ChangeNextItemLinkBeginGroup(ALink, True); +end; + +procedure TdxBarInPlaceSubItem.DoBeforeCollapse(ALink: TdxBarItemLink); +begin + if Assigned(FOnBeforeCollapse) then FOnBeforeCollapse(Self, ALink); + ChangeNextItemLinkBeginGroup(ALink, False); +end; + +{ TdxBarInPlaceSubItemControl } + +function TdxBarInPlaceSubItemControl.GetDrawParams: TdxBarInPlaceSubItemControlDrawParams; +begin + Result := TdxBarInPlaceSubItemControlDrawParams(FDrawParams); +end; + +function TdxBarInPlaceSubItemControl.GetItem: TdxBarInPlaceSubItem; +begin + Result := TdxBarInPlaceSubItem(ItemLink.Item); +end; + +procedure TdxBarInPlaceSubItemControl.CalcDrawParams(AFull: Boolean = False); +begin + inherited CalcDrawParams(AFull); + if AFull then + DrawParams.IsExpanded := Item.Expanded; + if DrawParams.PaintType = ptMenu then + DrawParams.ArrowSize.cx := Painter.InPlaceSubItemGetArrowWidth(DrawParams); +end; + +procedure TdxBarInPlaceSubItemControl.ControlClick(AByMouse: Boolean; AKey: Char = #0); +var + AOriginalItemLink: TdxBarItemLink; + AParent: TdxBarSubMenuControl; + ASelectedItemLinkIndex: Integer; +begin + inherited; + if Parent is TdxBarSubMenuControl then + begin + AParent := SubMenuParent; + AOriginalItemLink := ItemLink.OriginalItemLink; + if IsSelected then + ASelectedItemLinkIndex := ItemLink.Index + else + ASelectedItemLinkIndex := -1; + with Item do + begin + DirectClick; + Expanded := not Expanded; + end; + if ASelectedItemLinkIndex <> -1 then + with TCustomdxBarControlAccess(AParent) do + if (ASelectedItemLinkIndex < ItemLinks.VisibleItemCount) and + (ItemLinks[ASelectedItemLinkIndex].OriginalItemLink = AOriginalItemLink) then + SelectedControl := ItemLinks[ASelectedItemLinkIndex].Control; + end; +end; + +procedure TdxBarInPlaceSubItemControl.DblClick; +begin + if Enabled then ControlClick(True); +end; + +procedure TdxBarInPlaceSubItemControl.DoPaint(ARect: TRect; PaintType: TdxBarPaintType); +begin + if PaintType = ptMenu then + Painter.InPlaceSubItemControlDrawInMenu(DrawParams, ARect) + else + inherited; +end; + +function TdxBarInPlaceSubItemControl.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxBarInPlaceSubItemControlAccessibilityHelper; +end; + +function TdxBarInPlaceSubItemControl.GetDefaultHeight: Integer; +begin + Result := inherited GetDefaultHeight; + if Parent is TdxBarSubMenuControl then Inc(Result); +end; + +function TdxBarInPlaceSubItemControl.GetDefaultWidth: Integer; +begin + if Parent is TdxBarSubMenuControl then + Result := Painter.InPlaceSubItemGetTextIndent + GetCaptionWidth + DrawParams.ArrowSize.cx + else + Result := inherited GetDefaultWidth; +end; + +function TdxBarInPlaceSubItemControl.GetDrawParamsClass: TdxBarItemControlDrawParamsClass; +begin + Result := TdxBarInPlaceSubItemControlDrawParams; +end; + +function TdxBarInPlaceSubItemControl.HasSubMenu: Boolean; +begin + Result := not (Parent is TdxBarSubMenuControl); +end; + +function TdxBarInPlaceSubItemControl.IsExpandable: Boolean; +begin + Result := not (Parent is TdxBarSubMenuControl) and inherited IsExpandable; +end; + +function TdxBarInPlaceSubItemControl.IsInvertTextColor: Boolean; +begin + Result := Parent is TdxBarSubMenuControl; +end; + +procedure TdxBarInPlaceSubItemControl.KeyDown(var Key: Word; Shift: TShiftState); +begin + case Key of + VK_LEFT, VK_RIGHT: + ControlClick(False, Char(Key)); + end; +end; + +function TdxBarInPlaceSubItemControl.WantsKey(Key: Word): Boolean; +begin + if Parent is TdxBarSubMenuControl then + Result := + (Key = VK_LEFT) and Item.Expanded or + (Key = VK_RIGHT) and not Item.Expanded + else + Result := inherited WantsKey(Key); +end; + +{ TdxBarInPlaceSubItemControlAccessibilityHelper } + +function TdxBarInPlaceSubItemControlAccessibilityHelper.ShowDropDownWindow: Boolean; +begin + Result := inherited ShowDropDownWindow or (ItemControl.Parent.Kind = bkSubMenu); +end; + +initialization + FTrueTypeFontBitmap := TBitmap.Create; + FTrueTypeFontBitmap.LoadFromResourceName(HInstance, 'DXBARTRUETYPEFONT'); + FNonTrueTypeFontBitmap := TBitmap.Create; + FNonTrueTypeFontBitmap.LoadFromResourceName(HInstance, 'DXBARNONTRUETYPEFONT'); + + StartOfWeek := GetStartOfWeek; + + dxBarRegisterItem(TdxBarStatic, TdxBarStaticControl, True); + dxBarRegisterItem(TdxBarLargeButton, TdxBarLargeButtonControl, True); + dxBarRegisterItem(TdxBarColorCombo, TdxBarColorComboControl, True); + dxBarRegisterItem(TdxBarFontNameCombo, TdxBarComboControl, True); + dxBarRegisterItem(TdxBarDateCombo, TdxBarDateComboControl, True); + dxBarRegisterItem(TdxBarTreeViewCombo, TdxBarTreeViewComboControl, True); + dxBarRegisterItem(TdxBarImageCombo, TdxBarImageComboControl, True); + dxBarRegisterItem(TdxBarToolbarsListItem, TdxBarToolbarsListItemControl, True); + dxBarRegisterItem(TdxBarSpinEdit, TdxBarSpinEditControl, True); + dxBarRegisterItem(TdxBarControlContainerItem, TdxBarControlContainerControl, True); + dxBarRegisterItem(TdxBarProgressItem, TdxBarProgressControl, True); + dxBarRegisterItem(TdxBarMRUListItem, TdxBarContainerItemControl, True); + dxBarRegisterItem(TdxBarInPlaceSubItem, TdxBarInPlaceSubItemControl, True); + +finalization + dxBarUnregisterItem(TdxBarStatic); + dxBarUnregisterItem(TdxBarLargeButton); + dxBarUnregisterItem(TdxBarColorCombo); + dxBarUnregisterItem(TdxBarFontNameCombo); + dxBarUnregisterItem(TdxBarDateCombo); + dxBarUnregisterItem(TdxBarTreeViewCombo); + dxBarUnregisterItem(TdxBarImageCombo); + dxBarUnregisterItem(TdxBarToolbarsListItem); + dxBarUnregisterItem(TdxBarSpinEdit); + dxBarUnregisterItem(TdxBarControlContainerItem); + dxBarUnregisterItem(TdxBarProgressItem); + dxBarUnregisterItem(TdxBarMRUListItem); + dxBarUnregisterItem(TdxBarInPlaceSubItem); + + FreeAndNil(FFontDialog); + FreeAndNil(FColorDialog); + FreeAndNil(FNonTrueTypeFontBitmap); + FreeAndNil(FTrueTypeFontBitmap); + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBarExtItems.res b/official/x.35/ExpressBars 6/Sources/dxBarExtItems.res new file mode 100644 index 00000000..7030bc61 Binary files /dev/null and b/official/x.35/ExpressBars 6/Sources/dxBarExtItems.res differ diff --git a/official/x.35/ExpressBars 6/Sources/dxBarExtItemsReg.pas b/official/x.35/ExpressBars 6/Sources/dxBarExtItemsReg.pas new file mode 100644 index 00000000..65af9eba --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarExtItemsReg.pas @@ -0,0 +1,124 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars extended items registring unit } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarExtItemsReg; + +{$I cxVer.inc} + +interface + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI6} + DesignIntf, DesignEditors, +{$ELSE} + DsgnIntf, +{$ENDIF} + Classes, SysUtils, Graphics, ImgList, dxBarExtItems, dxBarImageComboEditor, + cxLibraryReg, dxBarReg; + +type + TDummydxBarImageCombo = class(TdxBarImageCombo); + +{ TdxBarImageComboItemsProperty } + +type + TDummyStringList = class(TStringList); + + TdxBarImageComboItemsProperty = class(TPropertyEditor) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + end; + +procedure TdxBarImageComboItemsProperty.Edit; +begin + if dxBarImageComboEdit(TdxBarImageCombo(GetComponent(0))) then + begin + Modified; + TDummyStringList(TDummydxBarImageCombo(GetComponent(0)).Items).Changed; + end; +end; + +function TdxBarImageComboItemsProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paDialog, paReadOnly]; +end; + +function TdxBarImageComboItemsProperty.GetValue: string; +begin + Result := Format('(%s)', [TStrings.ClassName]); +end; + +{ THotImageIndexProperty } + +type + TdxBarItemHotImageIndexProperty = class(TdxBarItemImageIndexProperty) + public + function GetImages: TCustomImageList; override; + end; + +function TdxBarItemHotImageIndexProperty.GetImages: TCustomImageList; +begin + Result := BarManager.HotImages; +end; + +{ register } + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterNoIcon([TdxBarStatic, TdxBarLargeButton, TdxBarColorCombo, TdxBarFontNameCombo, + TdxBarDateCombo, TdxBarTreeViewCombo, TdxBarImageCombo, + TdxBarToolbarsListItem, TdxBarSpinEdit, + TdxBarControlContainerItem, TdxBarProgressItem, TdxBarMRUListItem, TdxBarInPlaceSubItem]); + RegisterPropertyEditor(TypeInfo(TStrings), TdxBarImageCombo, 'Items', + TdxBarImageComboItemsProperty); + RegisterPropertyEditor(TypeInfo(Integer), TdxBarLargeButton, 'HotImageIndex', + TdxBarItemHotImageIndexProperty); + + RegisterPropertyEditor(TypeInfo(TBitmap), TdxBarLargeButton, 'HotGlyph', TcxBitmapProperty); +// RegisterPropertyEditor(TypeInfo(Integer), TdxBarLargeButton, 'ImageIndex', nil); +// RegisterPropertyEditor(TypeInfo(TBitmap), TdxBarLargeButton, 'Glyph', nil); +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBarImageComboEditor.dfm b/official/x.35/ExpressBars 6/Sources/dxBarImageComboEditor.dfm new file mode 100644 index 00000000..cdc4532a --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarImageComboEditor.dfm @@ -0,0 +1,85 @@ +object dxBarImageComboEditorForm: TdxBarImageComboEditorForm + Left = 219 + Top = 82 + BorderStyle = bsDialog + Caption = 'ExpressBars ImageCombo Editor' + ClientHeight = 286 + ClientWidth = 362 + Color = clBtnFace + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Position = poScreenCenter + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object ButtonOk: TButton + Left = 284 + Top = 230 + Width = 72 + Height = 22 + Caption = '&OK' + Default = True + ModalResult = 1 + TabOrder = 4 + end + object ButtonCancel: TButton + Left = 284 + Top = 258 + Width = 72 + Height = 22 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 5 + end + object ButtonAdd: TButton + Left = 284 + Top = 6 + Width = 72 + Height = 22 + Caption = '&Add' + TabOrder = 1 + OnClick = ButtonAddClick + end + object ButtonDelete: TButton + Left = 284 + Top = 62 + Width = 72 + Height = 22 + Caption = '&Delete' + TabOrder = 3 + OnClick = ButtonDeleteClick + end + object Grid: TStringGrid + Left = 6 + Top = 6 + Width = 271 + Height = 273 + ColCount = 3 + DefaultRowHeight = 20 + FixedCols = 0 + RowCount = 2 + Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goDrawFocusSelected, goEditing, goThumbTracking] + TabOrder = 0 + OnDrawCell = GridDrawCell + OnGetEditText = GridGetEditText + OnKeyDown = GridKeyDown + OnSelectCell = GridSelectCell + OnSetEditText = GridSetEditText + ColWidths = ( + 43 + 63 + 150) + end + object ButtonInsert: TButton + Left = 284 + Top = 34 + Width = 72 + Height = 22 + Caption = '&Insert' + TabOrder = 2 + OnClick = ButtonInsertClick + end +end diff --git a/official/x.35/ExpressBars 6/Sources/dxBarImageComboEditor.pas b/official/x.35/ExpressBars 6/Sources/dxBarImageComboEditor.pas new file mode 100644 index 00000000..02e658ae --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarImageComboEditor.pas @@ -0,0 +1,251 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars imagecombo item editor } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarImageComboEditor; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + Grids, StdCtrls, dxBarExtItems; + +type + TdxBarImageComboEditorForm = class(TForm) + ButtonOk: TButton; + ButtonCancel: TButton; + ButtonAdd: TButton; + ButtonDelete: TButton; + Grid: TStringGrid; + ButtonInsert: TButton; + procedure ButtonAddClick(Sender: TObject); + procedure ButtonInsertClick(Sender: TObject); + procedure ButtonDeleteClick(Sender: TObject); + procedure GridDrawCell(Sender: TObject; Col, Row: Integer; Rect: TRect; State: TGridDrawState); + procedure GridSelectCell(Sender: TObject; Col, Row: Integer; var CanSelect: Boolean); + procedure GridSetEditText(Sender: TObject; ACol, ARow: Integer; const Value: string); + procedure GridGetEditText(Sender: TObject; ACol, ARow: Integer; var Value: String); + procedure FormShow(Sender: TObject); + procedure GridKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + private + FCombo: TdxBarImageCombo; + FPrevCellText: string; + end; + +function dxBarImageComboEdit(ACombo: TdxBarImageCombo): Boolean; + +implementation + +uses + cxClasses, dxBarStrs; + +{$R *.DFM} + +const + DXBAR_IMAGEINDEX = 39456; // from dxBarExtItems.res + DXBAR_IMAGETEXT = 39457; + +type + TDummyGrid = class(TStringGrid); + +function dxBarImageComboEdit(ACombo: TdxBarImageCombo): Boolean; +var + I: Integer; +begin + with TdxBarImageComboEditorForm.Create(nil) do + begin + FCombo := ACombo; + with Grid do + begin + if ACombo.Images <> nil then ColWidths[0] := ACombo.Images.Width; + ColWidths[2] := ClientWidth - GetSystemMetrics(SM_CXVSCROLL) - + (ColWidths[0] + 1 + ColWidths[1] + 1); + if ACombo.Images <> nil then + DefaultRowHeight := ACombo.Images.Height + else + DefaultRowHeight := 20; + RowHeights[0] := 20; + if ACombo.Items.Count = 0 then + begin + RowCount := 2; + Cells[1, 1] := '-1'; + end + else RowCount := 1 + ACombo.Items.Count; + Cells[1, 0] := cxGetResourceString(@dxSBAR_IMAGEINDEX); + Cells[2, 0] := cxGetResourceString(@dxSBAR_IMAGETEXT); + for I := 0 to ACombo.Items.Count - 1 do + begin + Cells[1, I + 1] := IntToStr(ACombo.ImageIndexes[I]); + Cells[2, I + 1] := ACombo.Items[I]; + end; + end; + Result := ShowModal = mrOk; + if Result then + with Grid do + begin + ACombo.Items.Clear; + if (RowCount > 2) or (Cells[2, 1] <> '') then + for I := 1 to RowCount - 1 do + begin + ACombo.Items.Add(Cells[2, I]); + try + ACombo.ImageIndexes[I - 1] := StrToInt(Cells[1, I]); + except + end; + end; + end; + Free; + end; +end; + +procedure TdxBarImageComboEditorForm.ButtonAddClick(Sender: TObject); +var + AImageIndex: Integer; +begin + with TDummyGrid(Grid) do + begin + RowCount := RowCount + 1; + try + AImageIndex := StrToInt(Cells[1, RowCount - 2]); + if AImageIndex > -1 then Inc(AImageIndex); + except + AImageIndex := -1; + end; + Cells[1, RowCount - 1] := IntToStr(AImageIndex); + Cells[2, RowCount - 1] := ''; + InvalidateCell(0, RowCount - 1); + Row := RowCount - 1; + end; +end; + +procedure TdxBarImageComboEditorForm.ButtonInsertClick(Sender: TObject); +var + PrevRow, I: Integer; +begin + if Grid.Row < 1 then Exit; + with TDummyGrid(Grid) do + begin + PrevRow := Row; + RowCount := RowCount + 1; + for I := RowCount - 2 downto Row do MoveRow(I, I + 1); + Cells[1, PrevRow] := '-1'; + Cells[2, PrevRow] := ''; + InvalidateCell(0, PrevRow); + Row := PrevRow; + end; +end; + +procedure TdxBarImageComboEditorForm.ButtonDeleteClick(Sender: TObject); +var + PrevRow: Integer; +begin + with TDummyGrid(Grid) do + if Row > 0 then + begin + PrevRow := Row; + if RowCount > 2 then DeleteRow(Row) + else + begin + Cells[1, 1] := '-1'; + Cells[2, 1] := ''; + InvalidateCell(0, 1); + end; + if PrevRow <= RowCount - 1 then Row := PrevRow + else Row := RowCount - 1; + end; +end; + +procedure TdxBarImageComboEditorForm.GridDrawCell(Sender: TObject; + Col, Row: Integer; Rect: TRect; State: TGridDrawState); +var + AImageIndex: Integer; +begin + if (Col = 0) and (Row > 0) and (FCombo.Images <> nil) then + begin + try + AImageIndex := StrToInt(Grid.Cells[1, Row]); + except + AImageIndex := -1; + end; + if (0 <= AImageIndex) and (AImageIndex < FCombo.Images.Count) then + FCombo.Images.Draw(Grid.Canvas, Rect.Left, Rect.Top, AImageIndex) + else + Grid.Canvas.FillRect(Rect); + end; +end; + +procedure TdxBarImageComboEditorForm.GridSelectCell(Sender: TObject; + Col, Row: Integer; var CanSelect: Boolean); +begin + if Col = 0 then CanSelect := False; +end; + +procedure TdxBarImageComboEditorForm.FormShow(Sender: TObject); +begin + Grid.Col := 1; +end; + +procedure TdxBarImageComboEditorForm.GridSetEditText(Sender: TObject; + ACol, ARow: Integer; const Value: string); +begin + TDummyGrid(Grid).InvalidateCell(0, ARow); +end; + +procedure TdxBarImageComboEditorForm.GridKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + case Key of + VK_ESCAPE: + with Grid do + if EditorMode then + if Cells[Col, Row] <> FPrevCellText then + Cells[Col, Row] := FPrevCellText + else + EditorMode := False; + VK_INSERT: + if not Grid.EditorMode then ButtonAdd.Click; + VK_DELETE: + if not Grid.EditorMode then ButtonDelete.Click; + end; +end; + +procedure TdxBarImageComboEditorForm.GridGetEditText(Sender: TObject; + ACol, ARow: Integer; var Value: String); +begin + FPrevCellText := Grid.Cells[ACol, ARow]; +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBarItemEd.dfm b/official/x.35/ExpressBars 6/Sources/dxBarItemEd.dfm new file mode 100644 index 00000000..34b22ef8 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarItemEd.dfm @@ -0,0 +1,106 @@ +object dxBarItemAddEditor: TdxBarItemAddEditor + Left = 352 + Top = 153 + BorderStyle = bsDialog + Caption = 'Add New ExpressBars Item' + ClientHeight = 150 + ClientWidth = 263 + Color = clBtnFace + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + FormStyle = fsStayOnTop + Position = poScreenCenter + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object LName: TLabel + Left = 8 + Top = 68 + Width = 47 + Height = 13 + AutoSize = False + Caption = 'Name:' + end + object LCaption: TLabel + Left = 8 + Top = 96 + Width = 47 + Height = 13 + AutoSize = False + Caption = 'Caption:' + end + object LType: TLabel + Left = 8 + Top = 12 + Width = 47 + Height = 13 + AutoSize = False + Caption = 'Type:' + end + object LCategory: TLabel + Left = 8 + Top = 40 + Width = 47 + Height = 13 + AutoSize = False + Caption = 'Category:' + end + object Edit1: TEdit + Left = 62 + Top = 64 + Width = 194 + Height = 21 + TabOrder = 2 + end + object Edit2: TEdit + Left = 62 + Top = 92 + Width = 194 + Height = 21 + TabOrder = 3 + Text = 'New Item' + end + object ComboBox1: TComboBox + Left = 62 + Top = 8 + Width = 194 + Height = 21 + Style = csDropDownList + DropDownCount = 100 + ItemHeight = 13 + TabOrder = 0 + OnClick = ComboBox1Click + end + object ComboBox2: TComboBox + Left = 62 + Top = 36 + Width = 194 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 1 + end + object BOk: TButton + Left = 100 + Top = 122 + Width = 73 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 4 + OnClick = BOkClick + end + object BCancel: TButton + Left = 184 + Top = 122 + Width = 73 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 5 + end +end diff --git a/official/x.35/ExpressBars 6/Sources/dxBarItemEd.pas b/official/x.35/ExpressBars 6/Sources/dxBarItemEd.pas new file mode 100644 index 00000000..e8502d79 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarItemEd.pas @@ -0,0 +1,128 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars item editor } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarItemEd; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, dxBar; + +type + TdxBarItemAddEditor = class(TForm) + LName: TLabel; + LCaption: TLabel; + LType: TLabel; + LCategory: TLabel; + Edit1: TEdit; + Edit2: TEdit; + ComboBox1: TComboBox; + ComboBox2: TComboBox; + BOk: TButton; + BCancel: TButton; + procedure FormShow(Sender: TObject); + procedure ComboBox1Click(Sender: TObject); + procedure BOkClick(Sender: TObject); + private + ABarItem: TdxBarItem; + BarManager: TdxBarManager; + end; + +function dxBarItemAddEditor(ABarManager: TdxBarManager; ACategoryIndex: Integer): TdxBarItem; + +implementation + +{$R *.DFM} + +uses + TypInfo, dxBarCustForm, dxBarStrs; + +function dxBarItemAddEditor(ABarManager: TdxBarManager; ACategoryIndex: Integer): TdxBarItem; +var + AForm: TdxBarItemAddEditor; + I: Integer; +begin + Result := nil; + AForm := TdxBarItemAddEditor.Create(nil); + with AForm do + begin + BarManager := ABarManager; + Font := dxBarCustomizingForm.Font; + + for I := 0 to BarManager.Categories.Count - 1 do + ComboBox2.Items.Add(BarManager.Categories[I]); + if (0 <= ACategoryIndex) and (ACategoryIndex < BarManager.Categories.Count) then + ComboBox2.ItemIndex := ACategoryIndex + else + ComboBox2.ItemIndex := 0; + + for I := 0 to RegdxItemList.VisibleItemCount - 1 do + ComboBox1.Items.Add(RegdxItemList.VisibleItemClass[I].ClassName); + ComboBox1.ItemIndex := 0; + ComboBox1Click(nil); + + if ShowModal = mrOK then Result := ABarItem; + Free; + end; +end; + +procedure TdxBarItemAddEditor.FormShow(Sender: TObject); +begin + Edit1.SetFocus; +end; + +procedure TdxBarItemAddEditor.ComboBox1Click(Sender: TObject); +begin + Edit1.Text := BarManager.GetUniqueItemName(RegdxItemList.VisibleItemClass[ComboBox1.ItemIndex]); +end; + +procedure TdxBarItemAddEditor.BOkClick(Sender: TObject); +begin + ABarItem := RegdxItemList.VisibleItemClass[ComboBox1.ItemIndex].Create(BarManager.Owner); + try + ABarItem.Name := Edit1.Text; + ABarItem.Category := ComboBox2.ItemIndex; + ABarItem.Caption := Edit2.Text; + except + ABarItem.Free; + ComboBox1Click(Sender); + ModalResult := mrNone; + end; +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBarNameEd.dfm b/official/x.35/ExpressBars 6/Sources/dxBarNameEd.dfm new file mode 100644 index 00000000..c1527f25 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarNameEd.dfm @@ -0,0 +1,53 @@ +object dxBarNameEd: TdxBarNameEd + Left = 199 + Top = 196 + BorderIcons = [] + BorderStyle = bsDialog + ClientHeight = 87 + ClientWidth = 266 + Color = clBtnFace + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + FormStyle = fsStayOnTop + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + PixelsPerInch = 96 + TextHeight = 13 + object LName: TLabel + Left = 8 + Top = 8 + Width = 68 + Height = 13 + Caption = '&Toolbar name:' + end + object EName: TEdit + Left = 8 + Top = 27 + Width = 251 + Height = 21 + TabOrder = 0 + OnChange = ENameChange + end + object BOK: TButton + Left = 106 + Top = 58 + Width = 73 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object BCancel: TButton + Left = 186 + Top = 58 + Width = 73 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end +end diff --git a/official/x.35/ExpressBars 6/Sources/dxBarNameEd.pas b/official/x.35/ExpressBars 6/Sources/dxBarNameEd.pas new file mode 100644 index 00000000..fb643e98 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarNameEd.pas @@ -0,0 +1,131 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars name editor } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarNameEd; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls, dxBar; + +type + TdxBarNameEd = class(TForm) + EName: TEdit; + BOK: TButton; + BCancel: TButton; + LName: TLabel; + procedure ENameChange(Sender: TObject); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + public + Kind: Integer; + BarManager: TdxBarManager; + Bar: TdxBar; + end; + +function dxBarEditName(var AName: string; Kind1, Kind2: Integer; + ABarManager: TdxBarManager; ABar: TdxBar): Boolean; + +implementation + +{$R *.DFM} + +uses + dxBarCustForm, dxBarStrs, cxClasses; + +function dxBarEditName(var AName: string; Kind1, Kind2: Integer; + ABarManager: TdxBarManager; ABar: TdxBar): Boolean; +var + AForm: TdxBarNameEd; +begin + AForm := TdxBarNameEd.Create(nil); + AForm.ParentWindow := GetActiveWindow; + PrepareCustomizationFormFont(AForm, ABarManager); + with AForm do + begin + Kind := Kind1; + BarManager := ABarManager; + Bar := ABar; + if Kind1 = 0 then + begin + case Kind2 of + 0: Caption := cxGetResourceString(@dxSBAR_TOOLBARADD); + 1: Caption := cxGetResourceString(@dxSBAR_TOOLBARRENAME); + end; + LName.Caption := cxGetResourceString(@dxSBAR_TOOLBARNAME); + end + else + begin + case Kind2 of + 0: Caption := cxGetResourceString(@dxSBAR_CATEGORYADD); + 1: Caption := cxGetResourceString(@dxSBAR_CATEGORYINSERT); + 2: Caption := cxGetResourceString(@dxSBAR_CATEGORYRENAME); + end; + LName.Caption := cxGetResourceString(@dxSBAR_CATEGORYNAME); + end; + EName.Text := AName; + BOK.Caption := cxGetResourceString(@dxSBAR_OK); + BOK.Enabled := EName.Text <> ''; + BCancel.Caption := cxGetResourceString(@dxSBAR_CANCEL); + ActiveControl := EName; + Result := ShowModal = mrOk; + if Result then AName := EName.Text; + Free; + end; +end; + +procedure TdxBarNameEd.ENameChange(Sender: TObject); +begin + BOk.Enabled := EName.Text <> ''; +end; + +procedure TdxBarNameEd.FormCloseQuery(Sender: TObject; + var CanClose: Boolean); +var + ABar: TdxBar; +begin + if (ModalResult = mrOk) and (Kind = 0) then + begin + ABar := BarManager.BarByCaption(EName.Text); + CanClose := (ABar = nil) or (ABar = Bar); + if not CanClose then + dxBarMessageBox(Format(cxGetResourceString(@dxSBAR_TOOLBAREXISTS), [EName.Text]), + MB_ICONSTOP or MB_OK); + end; +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBarPopupMenuEd.dfm b/official/x.35/ExpressBars 6/Sources/dxBarPopupMenuEd.dfm new file mode 100644 index 00000000..8c6b1e44 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarPopupMenuEd.dfm @@ -0,0 +1,22 @@ +object dxBarSubMenuEditor: TdxBarSubMenuEditor + Tag = 100 + Left = 2 + Top = 105 + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'ExpressBars SubMenu Editor' + ClientHeight = 4 + ClientWidth = 196 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + OnActivate = FormActivate + OnClose = FormClose + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 +end diff --git a/official/x.35/ExpressBars 6/Sources/dxBarPopupMenuEd.pas b/official/x.35/ExpressBars 6/Sources/dxBarPopupMenuEd.pas new file mode 100644 index 00000000..10dc2331 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarPopupMenuEd.pas @@ -0,0 +1,230 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars popupmenu editor } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarPopupMenuEd; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, dxBar; + +type + TdxBarSubMenuEditor = class(TForm) + procedure FormDestroy(Sender: TObject); + procedure FormActivate(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + private + FItemLinks: TdxBarItemLinks; + FItemLinksOwner: TComponent; + FSubMenuWidth: Integer; + function GetSubMenuControl: TdxBarSubMenuControl; + procedure SetItemLinks(Value: TdxBarItemLinks); + procedure WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); message WM_GETMINMAXINFO; + procedure WMMove(var Message: TWMMove); message WM_MOVE; + procedure WMNCLButtonDown(var Message: TWMNCLButtonDown); message WM_NCLBUTTONDOWN; + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + + property SubMenuControl: TdxBarSubMenuControl read GetSubMenuControl; + public + constructor Create(AOwner: TComponent); override; + procedure Release; + property ItemLinks: TdxBarItemLinks read FItemLinks write SetItemLinks; + end; + +procedure ShowdxBarSubMenuEditor(AItemLinks: TdxBarItemLinks); + +function dxBarSubMenuEditor: TdxBarSubMenuEditor; + +implementation + +{$R *.DFM} + +uses + dxBarCustForm, dxBarStrs, cxClasses; + +var + FdxBarSubMenuEditor: TdxBarSubMenuEditor; + +procedure ShowdxBarSubMenuEditor(AItemLinks: TdxBarItemLinks); +begin + AItemLinks.BarManager.Customizing(True); + if AItemLinks.BarManager.IsCustomizing then + with dxBarCustomizingForm do + PageControl.ActivePage := tsItems; + if FdxBarSubMenuEditor = nil then + FdxBarSubMenuEditor := TdxBarSubMenuEditor.Create(nil); + with FdxBarSubMenuEditor do + begin + ClientHeight := 0; + ItemLinks := AItemLinks; + ProcessMouseMessages; + Show; + end; +end; + +function dxBarSubMenuEditor: TdxBarSubMenuEditor; +begin + Result := FdxBarSubMenuEditor; +end; + +{ TdxBarSubMenuEditor } + +constructor TdxBarSubMenuEditor.Create(AOwner: TComponent); +begin + inherited; + Caption := cxGetResourceString(@dxSBAR_SUBMENUEDITORCAPTION); +end; + +procedure TdxBarSubMenuEditor.Release; +begin + if not (csDestroying in ComponentState) then + if HandleAllocated then + inherited Release + else + Free; +end; + +function TdxBarSubMenuEditor.GetSubMenuControl: TdxBarSubMenuControl; +begin + if ItemLinks <> nil then + Result := TdxBarSubMenuControl(ItemLinks.BarControl) + else + Result := nil; +end; + +procedure TdxBarSubMenuEditor.SetItemLinks(Value: TdxBarItemLinks); +begin + if FItemLinks <> Value then + begin + FItemLinks := Value; + if FItemLinks = nil then + Release + else + begin + FItemLinksOwner := FItemLinks.Owner; + FItemLinksOwner.FreeNotification(Self); + end; + end; +end; + +procedure TdxBarSubMenuEditor.WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); +begin + with Message.MinMaxInfo^ do + begin + ptMaxSize.Y := Height; + ptMinTrackSize.Y := Height; + ptMaxTrackSize.Y := Height; + if SubMenuControl <> nil then + FSubMenuWidth := SubMenuControl.Width; + ptMaxSize.X := FSubMenuWidth; + ptMinTrackSize.X := FSubMenuWidth; + ptMaxTrackSize.X := FSubMenuWidth; + end; +end; + +procedure TdxBarSubMenuEditor.WMMove(var Message: TWMMove); +begin + inherited; + if SubMenuControl <> nil then + SetWindowPos(SubMenuControl.Handle, 0, Left, Top + Height, 0, 0, + SWP_NOZORDER or SWP_NOSIZE or SWP_NOACTIVATE or SWP_SHOWWINDOW); +end; + +procedure TdxBarSubMenuEditor.WMNCLButtonDown(var Message: TWMNCLButtonDown); +begin + inherited; + if Message.Hittest <> HTCLOSE then Activate + else + if SubMenuControl <> nil then + SubMenuControl.Hide; +end; + +procedure TdxBarSubMenuEditor.CreateParams(var Params: TCreateParams); +begin + inherited; + with Params do + begin + Style := WS_POPUP or WS_CLIPSIBLINGS or WS_SYSMENU or WS_CAPTION; + ExStyle := WS_EX_DLGMODALFRAME or WS_EX_WINDOWEDGE; + WindowClass.Style := CS_OWNDC or CS_SAVEBITS; + WndParent := GetParent(dxBarCustomizingForm.Handle); + end; +end; + +procedure TdxBarSubMenuEditor.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if (Operation = opRemove) and (AComponent = FItemLinksOwner) then + ItemLinks := nil; +end; + +procedure TdxBarSubMenuEditor.FormDestroy(Sender: TObject); +begin + if SubMenuControl <> nil then + SubMenuControl.Hide; + FdxBarSubMenuEditor := nil; +end; + +type + TdxBarManagerAccess = class(TdxBarManager); + +procedure TdxBarSubMenuEditor.FormActivate(Sender: TObject); +var + AErrorText: string; +begin + with TdxBarManagerAccess(ItemLinks.BarManager) do + if Dragging and not ItemLinks.CanContainItem(DraggingItem, AErrorText) then Exit; + if SubMenuControl = nil then + begin + ItemLinks.CreateBarControl; + SubMenuControl.Left := Left; + SubMenuControl.Top := Top + Height; + SubMenuControl.OwnerHeight := Height; + SubMenuControl.Show; + end; + Width := SubMenuControl.Width; +end; + +procedure TdxBarSubMenuEditor.FormClose(Sender: TObject; + var Action: TCloseAction); +begin + Action := caFree; +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBarReg.dcr b/official/x.35/ExpressBars 6/Sources/dxBarReg.dcr new file mode 100644 index 00000000..2586d8b3 Binary files /dev/null and b/official/x.35/ExpressBars 6/Sources/dxBarReg.dcr differ diff --git a/official/x.35/ExpressBars 6/Sources/dxBarReg.pas b/official/x.35/ExpressBars 6/Sources/dxBarReg.pas new file mode 100644 index 00000000..54a06759 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarReg.pas @@ -0,0 +1,682 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars registring unit } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarReg; + +{$I cxVer.inc} + +interface + +uses + ImgList, +{$IFDEF DELPHI6} + DesignEditors, DesignIntf, DesignMenus, VCLEditors, +{$ELSE} + DsgnIntf, Menus, +{$ENDIF} + Windows, Classes, Controls, Graphics, cxDesignWindows, dxBar, Contnrs, cxLibraryReg, cxPropEditors; + +const + dxBarMajorVersion = '6'; + dxBarProductName = 'ExpressBars'; + +type + TdxBarComponentEditor = class(TcxComponentEditor) + protected + function GetProductMajorVersion: string; override; + function GetProductName: string; override; + end; + + TdxBarItemImageIndexProperty = class(TImageIndexProperty) + private + function GetBarManager: TdxBarManager; + protected + property BarManager: TdxBarManager read GetBarManager; + public + function GetImages: TCustomImageList; override; + end; + + TdxBarItemLargeImageIndexProperty = class(TdxBarItemImageIndexProperty) + public + function GetImages: TCustomImageList; override; + end; + + TdxBarItemLinksPropertyEditor = class(TPropertyEditor) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + end; + +procedure Register; + +implementation + +uses + Messages, SysUtils, Forms, Dialogs, + TypInfo, EditIntf, TreeIntf, + dxBarCustForm, dxBarPopupMenuEd, dxBarStrs, dxRegEd, cxClasses, cxComponentCollectionEditor; + +type + TdxBarManagerAccess = class(TdxBarManager); + + { TdxBarDesignHelper } + + TdxBarDesignHelper = class(TcxDesignHelper, IdxBarDesigner) + public + // IdxBarDesigner + function CanDeleteComponent(AComponent: TComponent): Boolean; + function GetSelectionStatus(AComponent: TPersistent): TdxBarSelectionStatus; + function IdxBarDesigner.IsComponentSelected = IsObjectSelected; + procedure SelectComponent(AComponent: TPersistent; ASelectionOperation: TdxBarSelectionOperation = soExclusive); + procedure ShowDefaultEventHandler(AItem: TdxBarItem); + end; + + { TdxBarDesignWindow } + + TdxBarDesignWindow = class(TcxDesignWindow) + private + FActiveDesigner: IDesigner; +// FCurrentSelectionList: TComponentList; + FCurrentSelectionList: TObjectList; + FOnSelectionChanged: TcxNotifyProcedure; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + function IsComponentSelected(AComponent: TPersistent): Boolean; + + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + + {$IFNDEF DELPHI6} + procedure ComponentDeleted(Component: IPersistent); override; + procedure SelectionChanged(ASelection: TDesignerSelectionList); override; + {$ELSE} + procedure ItemDeleted(const ADesigner: IDesigner; Item: TPersistent); override; + procedure SelectionChanged(const ADesigner: IDesigner; const ASelection: TDesignerSelectionList); override; + {$ENDIF} + procedure SelectionsChanged(const ASelection: TDesignerSelectionList); override; + + property ActiveDesigner: IDesigner read FActiveDesigner; + property OnSelectionChanged: TcxNotifyProcedure read FOnSelectionChanged write FOnSelectionChanged; + end; + +var + FdxBarDesignWindow: TdxBarDesignWindow; + +{ TdxBarDesignHelper } + +function TdxBarDesignHelper.CanDeleteComponent(AComponent: TComponent): Boolean; +begin + Result := cxDesignWindows.CanDeleteComponent(Component, AComponent, Designer); +end; + +function TdxBarDesignHelper.GetSelectionStatus(AComponent: TPersistent): TdxBarSelectionStatus; +begin + if FdxBarDesignWindow.IsComponentSelected(AComponent) then + Result := ssActiveSelected + else + if IsObjectSelected(AComponent) then + Result := ssInactiveSelected + else + Result := ssUnselected; +end; + +procedure TdxBarDesignHelper.SelectComponent(AComponent: TPersistent; ASelectionOperation: TdxBarSelectionOperation = soExclusive); +begin + case ASelectionOperation of + soAdd: SelectObject(AComponent, False); + soExclude: UnselectObject(AComponent); + soExclusive: SelectObject(AComponent, True, False); + end; +end; + +procedure TdxBarDesignHelper.ShowDefaultEventHandler(AItem: TdxBarItem); +begin + ShowComponentDefaultEventHandler(AItem); +end; + +{ TdxBarDesignWindow } + +constructor TdxBarDesignWindow.Create(AOwner: TComponent); +begin + inherited Create(AOwner); +// FCurrentSelectionList := TComponentList.Create(False); + FCurrentSelectionList := TObjectList.Create(False); +end; + +destructor TdxBarDesignWindow.Destroy; +begin + FreeAndNil(FCurrentSelectionList); + inherited; +end; + +function TdxBarDesignWindow.IsComponentSelected(AComponent: TPersistent): Boolean; +begin + Result := FCurrentSelectionList.IndexOf(TComponent(AComponent)) <> -1; +end; + +procedure TdxBarDesignWindow.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if Operation = opRemove then + FCurrentSelectionList.Remove(AComponent); +end; + +{$IFNDEF DELPHI6} +procedure TdxBarDesignWindow.ComponentDeleted(Component: IPersistent); + function Item: TPersistent; + begin + Result := ExtractPersistent(Component); + end; +begin + FCurrentSelectionList.Remove(Item); +end; +{$ELSE} +procedure TdxBarDesignWindow.ItemDeleted(const ADesigner: IDesigner; Item: TPersistent); +begin + FCurrentSelectionList.Remove(Item); +end; +{$ENDIF} + +{$IFNDEF DELPHI6} +procedure TdxBarDesignWindow.SelectionChanged(ASelection: TDesignerSelectionList); +begin + if LockCount = 0 then + SelectionsChanged(ASelection); +end; +{$ELSE} +procedure TdxBarDesignWindow.SelectionChanged(const ADesigner: IDesigner; + const ASelection: TDesignerSelectionList); +begin + if LockCount = 0 then + SelectionsChanged(ASelection); +end; +{$ENDIF} + +procedure TdxBarDesignWindow.SelectionsChanged(const ASelection: TDesignerSelectionList); +var + I: Integer; + ANewSelection, AOldSelection, ASelectionChanges: TdxObjectList; + ASelectableItem: IdxBarSelectableItem; +begin + inherited; + + ASelectionChanges := TdxObjectList.Create(False); + AOldSelection := TdxObjectList.Create(False); + ANewSelection := TdxObjectList.Create(False); + try + AOldSelection.CopyFrom(FCurrentSelectionList); + ConvertSelectionToList(ASelection, ANewSelection); + CleanSelectableItems(ANewSelection); + ANewSelection.CopyTo(FCurrentSelectionList); + + ASelectionChanges.XorList(FCurrentSelectionList, AOldSelection); + + // add to invalidation single selected object + if ASelectionChanges.Count > 0 then + begin + if AOldSelection.Count = 1 then + ASelectionChanges.Add(AOldSelection[0]); + if ANewSelection.Count = 1 then + ASelectionChanges.Add(ANewSelection[0]); + end; + + for I := ASelectionChanges.Count - 1 downto 0 do + begin + if IsSelectableItem(ASelectionChanges[I], ASelectableItem) then + ASelectableItem.SelectionChanged; + end; + + for I := 0 to AOldSelection.Count - 1 do + if AOldSelection[I] is TComponent then + TComponent(AOldSelection[I]).RemoveFreeNotification(Self); + for I := 0 to FCurrentSelectionList.Count - 1 do + if FCurrentSelectionList[I] is TComponent then + TComponent(FCurrentSelectionList[I]).FreeNotification(Self); + + finally + ANewSelection.Free; + AOldSelection.Free; + ASelectionChanges.Free; + end; + + if Assigned(OnSelectionChanged) then + OnSelectionChanged(Self); +end; + +{ TdxBarManagerEditor } + +type + TdxBarManagerEditor = class(TdxBarComponentEditor) + protected + function InternalGetVerb(AIndex: Integer): string; override; + function InternalGetVerbCount: Integer; override; + procedure InternalExecuteVerb(AIndex: Integer); override; + public + procedure PrepareItem(Index: Integer; const AItem: TDesignMenuItem); override; + // routines + function BarManager: TdxBarManager; + end; + + TdxBarPopupMenuEditor = class(TdxBarComponentEditor) + protected + function InternalGetVerb(AIndex: Integer): string; override; + function InternalGetVerbCount: Integer; override; + procedure InternalExecuteVerb(AIndex: Integer); override; + end; + +{ TdxBarComponentEditor } + +function TdxBarComponentEditor.GetProductMajorVersion: string; +begin + Result := dxBarMajorVersion; +end; + +function TdxBarComponentEditor.GetProductName: string; +begin + Result := dxBarProductName; +end; + +{ TdxBarManagerEditor } + +procedure TdxBarManagerEditor.PrepareItem(Index: Integer; const AItem: TDesignMenuItem); +begin + inherited PrepareItem(Index, AItem); + if Index in [1, 2] then + AItem.Enabled := TdxBarManagerAccess(BarManager).CanAddComponents; + if Index = 2 then + AItem.Enabled := AItem.Enabled and (BarManager.MainMenuBar = nil); +end; + +function TdxBarManagerEditor.BarManager: TdxBarManager; +begin + Result := TdxBarManager(Component); +end; + +function TdxBarManagerEditor.InternalGetVerb(AIndex: Integer): string; +begin + case AIndex of + 0: Result := cxGetResourceString(@dxSBAR_CUSTOMIZINGFORM); + 1: Result := 'Add Toolbar'; + 2: Result := 'Add MainMenu'; + else + Result := inherited InternalGetVerb(AIndex); + end; +end; + +function TdxBarManagerEditor.InternalGetVerbCount: Integer; +begin + Result := 3; +end; + +procedure TdxBarManagerEditor.InternalExecuteVerb(AIndex: Integer); +begin + case AIndex of + 0: BarManager.Customizing(True); + 1: BarManager.AddToolBar; + 2: BarManager.AddToolBar(True) + end; +end; + +{ TdxBarPopupMenuEditor } + +function TdxBarPopupMenuEditor.InternalGetVerb(AIndex: Integer): string; +begin + Result := cxGetResourceString(@dxSBAR_POPUPMENUEDITOR); +end; + +function TdxBarPopupMenuEditor.InternalGetVerbCount: Integer; +begin + Result := 1; +end; + +procedure TdxBarPopupMenuEditor.InternalExecuteVerb(AIndex: Integer); +begin + ShowdxBarSubMenuEditor(TdxBarCustomPopupMenu(Component).ItemLinks); +end; + +{ TdxBarsPropertyEditor } + +type + TdxBarsPropertyEditor = class(TPropertyEditor) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + end; + +procedure TdxBarsPropertyEditor.Edit; +var + BarManager: TdxBarManager; +begin + BarManager := TdxBarManager(GetComponent(0)); + BarManager.Customizing(True); + if BarManager.IsCustomizing then + dxBarCustomizingForm.SelectPage(0); +end; + +function TdxBarsPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paDialog, paReadOnly]; +end; + +function TdxBarsPropertyEditor.GetValue: string; +begin + Result := Format('(%s)', [TdxBars.ClassName]); +end; + +{ TdxCategoriesPropertyEditor } + +type + TdxCategoriesPropertyEditor = class(TPropertyEditor) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + end; + +procedure TdxCategoriesPropertyEditor.Edit; +var + BarManager: TdxBarManager; +begin + BarManager := TdxBarManager(GetComponent(0)); + BarManager.Customizing(True); + if BarManager.IsCustomizing then + dxBarCustomizingForm.SelectPage(1); +end; + +function TdxCategoriesPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paDialog, paReadOnly]; +end; + +function TdxCategoriesPropertyEditor.GetValue: string; +begin + Result := Format('(%s)', [TStrings.ClassName]); +end; + +{ TdxRegistryPathProperty } + +type + TdxRegistryPathProperty = class(TStringProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + +procedure TdxRegistryPathProperty.Edit; +var + BarManager: TdxBarManager; + S: string; +begin + BarManager := TdxBarManager(GetComponent(0)); + S := BarManager.RegistryPath; + if dxGetRegistryPath(S) then + begin + BarManager.RegistryPath := S; + Designer.Modified; + end; +end; + +function TdxRegistryPathProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog]; +end; + +{ TDetachingBarPropertyEditor } + +const + NoneBarCaption = ''; + +type + TDetachingBarPropertyEditor = class(TPropertyEditor) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + function GetValue: string; override; + procedure SetValue(const Value: string); override; + end; + +function TDetachingBarPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList{$IFNDEF DELPHI6}, paReadOnly{$ENDIF}]; +end; + +procedure TDetachingBarPropertyEditor.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + Proc(NoneBarCaption); + with TdxBarItem(GetComponent(0)).BarManager do + for I := 0 to Bars.Count - 1 do + Proc(Bars[I].Caption); +end; + +function TDetachingBarPropertyEditor.GetValue: string; +begin + with TCustomdxBarSubItem(GetComponent(0)) do + if GetDetachingBar = nil then + Result := NoneBarCaption + else + Result := GetDetachingBar.Caption; +end; + +procedure TDetachingBarPropertyEditor.SetValue(const Value: string); +begin + with TCustomdxBarSubItem(GetComponent(0)) do + if (Value = NoneBarCaption) or (BarManager.BarByCaption(Value) = nil) then + DetachingBar := -1 + else + DetachingBar := BarManager.BarByCaption(Value).Index; + Modified; +end; + +{ TdxBarItemImageIndexProperty } + +function TdxBarItemImageIndexProperty.GetImages: TCustomImageList; +begin + Result := BarManager.Images; +end; + +function TdxBarItemImageIndexProperty.GetBarManager: TdxBarManager; +begin + Result := (GetComponent(0) as TdxBarItem).BarManager; +end; + +{ TdxBarItemLargeImageIndexProperty } + +function TdxBarItemLargeImageIndexProperty.GetImages: TCustomImageList; +begin + Result := BarManager.LargeImages; +end; + +{ TdxBarItemLinksPropertyEditor } + +procedure TdxBarItemLinksPropertyEditor.Edit; +begin + if not (GetComponent(0) is TdxBar) then + ShowdxBarSubMenuEditor(TdxBarItemLinks(GetOrdValue)); +end; + +function TdxBarItemLinksPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paReadOnly]; + if not (GetComponent(0) is TdxBar) then Include(Result, paDialog); +end; + +function TdxBarItemLinksPropertyEditor.GetValue: string; +begin + Result := Format('(%s)', [TdxBarItemLinks.ClassName]); +end; + +{ TdxBarScreenTipRepositoryEditor } + +type + TdxBarScreenTipRepositoryEditor = class(TdxBarComponentEditor) + private + function GetRepository: TdxBarScreenTipRepository; + protected + function InternalGetVerb(AIndex: Integer): string; override; + function InternalGetVerbCount: Integer; override; + procedure InternalExecuteVerb(AIndex: Integer); override; + public + property Repository: TdxBarScreenTipRepository read GetRepository; + end; + +function TdxBarScreenTipRepositoryEditor.InternalGetVerb(AIndex: Integer): string; +begin + Result := 'Items Editor...'; +end; + +function TdxBarScreenTipRepositoryEditor.InternalGetVerbCount: Integer; +begin + Result := 1 +end; + +procedure TdxBarScreenTipRepositoryEditor.InternalExecuteVerb(AIndex: Integer); +begin + ShowFormEditorClass(Designer, Component, Repository.Items, 'Items', TfrmComponentCollectionEditor); +end; + +function TdxBarScreenTipRepositoryEditor.GetRepository: TdxBarScreenTipRepository; +begin + Result := Component as TdxBarScreenTipRepository; +end; + +{ TdxBarItemLinksSprig } + +type + TdxBarItemLinksSprig = class(TCollectionSprig) + public + function AddTypeCount: Integer; override; + end; + +function TdxBarItemLinksSprig.AddTypeCount: Integer; +begin + Result := 0; +end; + +{ register } + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterComponents('ExpressBars', [TdxBarManager, + TdxBarPopupMenu, TdxBarDockControl, TdxBarScreenTipRepository]); + RegisterNoIcon([ + TdxBarGroup, TdxBarButton, + TdxBarEdit, TCustomdxBarCombo, TdxBarCombo, TdxBarSeparator, + TdxBarSubItem, TdxBarListItem, TdxBarContainerItem, TdxBar, TdxBarScreenTip]); + + RegisterComponentEditor(TdxBarManager, TdxBarManagerEditor); + RegisterComponentEditor(TdxBarCustomPopupMenu, TdxBarPopupMenuEditor); + RegisterComponentEditor(TdxBarScreenTipRepository, TdxBarScreenTipRepositoryEditor); + +{$IFDEF DELPHI6} + RegisterPropertyEditor(TypeInfo(TShortCut), TdxBarButton, 'ShortCut', TShortCutProperty); +{$ENDIF} + + RegisterPropertyEditor(TypeInfo(TdxBars), TdxBarManager, 'Bars', + TdxBarsPropertyEditor); + RegisterPropertyEditor(TypeInfo(TStrings), TdxBarManager, 'Categories', + TdxCategoriesPropertyEditor); + RegisterPropertyEditor(TypeInfo(string), TdxBarManager, 'RegistryPath', + TdxRegistryPathProperty); + RegisterPropertyEditor(TypeInfo(TdxBarItemLinks), TdxBar, 'ItemLinks', + TdxBarItemLinksPropertyEditor); + RegisterPropertyEditor(TypeInfo(TdxBarItemLinks), TdxBarCustomPopupMenu, 'ItemLinks', + TdxBarItemLinksPropertyEditor); + RegisterPropertyEditor(TypeInfo(TdxBarItemLinks), TdxBarSubItem, 'ItemLinks', + TdxBarItemLinksPropertyEditor); + RegisterPropertyEditor(TypeInfo(TdxBarItemLinks), TdxBarContainerItem, 'ItemLinks', + TdxBarItemLinksPropertyEditor); + RegisterPropertyEditor(TypeInfo(Integer), TCustomdxBarSubItem, 'DetachingBar', + TDetachingBarPropertyEditor); + RegisterPropertyEditor(TypeInfo(Integer), TdxBarItem, 'ImageIndex', + TdxBarItemImageIndexProperty); + RegisterPropertyEditor(TypeInfo(Integer), TdxBarItem, 'LargeImageIndex', + TdxBarItemLargeImageIndexProperty); + + RegisterPropertyEditor(TypeInfo(TBitmap), TdxBarItem, 'Glyph', TcxBitmapProperty); + RegisterPropertyEditor(TypeInfo(TBitmap), TdxBarItem, 'LargeGlyph', TcxBitmapProperty); + RegisterPropertyEditor(TypeInfo(TBitmap), TdxBarItemLink, 'UserGlyph', TcxBitmapProperty); + + RegisterSprigType(TdxBarItemLinks, TdxBarItemLinksSprig); + + // ImageOptions + HideClassProperties(TdxBarManager, ['DisabledImages', 'DisabledLargeImages', + 'HotImages', 'Images', 'LargeImages', 'ImageListBkColor', 'LargeIcons', + 'MakeDisabledImagesFaded', 'StretchGlyphs', 'UseLargeImagesForLargeIcons']); + + HideClassProperties(TdxBarSeparator, ['Action', 'Align', 'Category', + 'Description', 'Enabled', 'HelpContext', 'Hint', 'MergeKind', 'MergeOrder', + 'Style', 'ScreenTip', 'OnDestroy']); +end; + +procedure DesignSelectionChanged(ASender: TObject); +begin + if dxBarCustomizingForm <> nil then + dxBarCustomizingForm.DesignSelectionChanged(ASender); +end; + +procedure RegisterBarManager(ASender: TObject); +begin + if dxBarManagerList.Count = 1 then + begin + FdxBarDesignWindow := TdxBarDesignWindow.Create(nil); + FdxBarDesignWindow.OnSelectionChanged := DesignSelectionChanged; + end; + TdxBarManagerAccess(ASender).FdxBarDesignHelper := TdxBarDesignHelper.Create(TComponent(ASender)); +end; + +procedure UnregisterBarManager(ASender: TObject); +begin + if (FdxBarDesignWindow <> nil) and ((dxBarManagerList = nil) or (dxBarManagerList.Count = 0)) then + begin + FdxBarDesignWindow.Release; + FdxBarDesignWindow := nil; + end; + TdxBarManagerAccess(ASender).FdxBarDesignHelper := nil; +end; + +initialization + FOnRegisterBarManager := RegisterBarManager; + FOnUnregisterBarManager := UnregisterBarManager; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBarSkin.pas b/official/x.35/ExpressBars 6/Sources/dxBarSkin.pas new file mode 100644 index 00000000..118f6719 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarSkin.pas @@ -0,0 +1,735 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars components } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarSkin; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, ImgList, ExtCtrls, cxGraphics, dxGDIPlusAPI; + +type + TcxSkinRectType = (spt1x1, spt3x1, spt1x3, spt3x3); + + TdxCustomBarSkin = class; + + { TdxSkinnedRect } + + TdxSkin3x3Part = ( + sp3x3TopLeft, sp3x3Top, sp3x3TopRight, + sp3x3Left, sp3x3Center, sp3x3Right, + sp3x3BottomLeft, sp3x3Bottom, sp3x3BottomRight + ); + + { TdxSkinnedRect } + + TdxSkinnedRect = class + private + FAlphaValue: Byte; + FCalculatedSize: TSize; + FDrawPartSizes: array[TdxSkin3x3Part] of TSize; + FFixedPartSize: TRect; + FGPImage: GpBitmap; + FGPCacheBitmap: GpBitmap; + FID: Integer; + FInterpolationMode: Integer; + FLastSize: TSize; + FMinSize: TSize; + FName: string; + FOpaque: Boolean; + FOwner: TdxCustomBarSkin; + FPartBounds: array[TdxSkin3x3Part] of TRect; + FTextOffset: TRect; + procedure CalculatePartBounds(const ARect: TRect); + procedure CheckCachedImage; + procedure CheckCalculate(AWidth, AHeight: Integer); + procedure UpdateCacheImage; + procedure UpdateSizes; + protected + procedure Calculate(AWidth, AHeight: Integer); virtual; + procedure Clear; virtual; + procedure DefaultDraw(DC: HDC; const R: TRect); virtual; + procedure DoDraw(DC: HDC; const R: TRect); virtual; + + property CalculatedSize: TSize read FCalculatedSize; + public + constructor Create(AOpaque: Boolean = False); + destructor Destroy; override; + procedure Draw(DC: HDC; const R: TRect; AlphaValue: Byte = 255); + function GetBitmap(const AWidth, AHeight: Integer; AUseAlphaChannel: Boolean = False): TBitmap; + function GetTextBounds(const R: TRect): TRect; virtual; + procedure LoadFromBitmap(ABitmap: GpBitmap; const ARect, AFixedPartSize: TRect); + procedure LoadFromFile(const AFileName: string; const AFixedPartSize: TRect); overload; + procedure LoadFromFile(const AFileName: string; const ARect, AFixedPartSize: TRect); overload; + + property AlphaValue: Byte read FAlphaValue write FAlphaValue default 255; + property ID: Integer read FID write FID; + property InterpolationMode: Integer read FInterpolationMode write FInterpolationMode + default InterpolationModeDefault; + property MinSize: TSize read FMinSize write FMinSize; + property Name: string read FName write FName; + property Opaque: Boolean read FOpaque write FOpaque; + property Owner: TdxCustomBarSkin read FOwner; + property TextOffset: TRect read FTextOffset write FTextOffset; + end; + + { TdxCustomBarSkin } + + TdxCustomBarSkin = class(TList) + private + FName: string; + function GetPart(Index: Integer): TdxSkinnedRect; + protected + function IsPersistent: Boolean; virtual; + public + constructor Create(const AName: string); + procedure Clear; override; + function Add(ASkinnedRect: TdxSkinnedRect): Integer; + function AddPart1x1(ABitmap: GpBitmap; const R: TRect; AID: Integer; + const AName: string = ''; AInterpolationMode: Integer = InterpolationModeDefault): Integer; + function AddPart1x3(ABitmap: GpBitmap; const R: TRect; ATop, ABottom, AID: Integer; + const AName: string = ''; AInterpolationMode: Integer = InterpolationModeDefault): Integer; + function AddPart3x3(ABitmap: GpBitmap; const R, AFixedSize: TRect; + AID: Integer; const AName: string = ''; AInterpolationMode: Integer = InterpolationModeDefault): Integer; + function PartByName(const AName: string): TdxSkinnedRect; + function PartByID(const AID: Integer): TdxSkinnedRect; + property Name: string read FName write FName; + property Parts[Index: Integer]: TdxSkinnedRect read GetPart; default; + end; + + { TcxSkinManager } + + TdxBarSkinManager = class(TPersistent) + private + FList: TList; + function GetSkin(Index: Integer): TdxCustomBarSkin; + function GetSkinCount: Integer; + protected + function CanDeleteSkin(ASkin: TdxCustomBarSkin): Boolean; + procedure Changed; virtual; + public + constructor Create; + destructor Destroy; override; + function AddSkin(ASkin: TdxCustomBarSkin): Integer; + function RemoveSkin(ASkin: TdxCustomBarSkin): Boolean; + function SkinByName(const AName: string): TdxCustomBarSkin; + property SkinCount: Integer read GetSkinCount; + property Skins[Index: Integer]: TdxCustomBarSkin read GetSkin; default; + end; + +function SkinManager: TdxBarSkinManager; +function GetImageFromStream(AStream: TStream): GPImage; + +implementation + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + cxGeometry, dxOffice11, cxControls, dxBar, cxDWMApi, ActiveX; + +var + FSkinManager: TdxBarSkinManager; + +function SkinManager: TdxBarSkinManager; +begin + if FSkinManager = nil then + FSkinManager := TdxBarSkinManager.Create; + Result := FSkinManager; +end; + +function GetImageFromStream(AStream: TStream): GPImage; +var + Data: HGlobal; + DataPtr: Pointer; + AccessStream: IStream; +begin + Result := nil; + if not CheckGdiPlus then Exit; + Data := GlobalAlloc(GMEM_MOVEABLE + GMEM_DDESHARE, AStream.Size); + try + DataPtr := GlobalLock(Data); + try + AStream.Read(DataPtr^, AStream.Size); + GdipCheck(CreateStreamOnHGlobal(Data, False, AccessStream) = s_OK); + GdipCheck(GdipCreateBitmapFromStream(AccessStream, Result)); + finally + GlobalUnlock(Data); + AccessStream := nil; + end; + finally + GlobalFree(Data); + end; +end; + +function dxAlphaBlend(ADestDC: HDC; const ADestRect: TRect; ASrcDC: HDC; const ASrcRect: TRect; + AlphaValue: Byte = 255): Boolean; +begin + if not IsWin95X then + Result := SystemAlphaBlend(ADestDC, ASrcDC, ADestRect, ASrcRect, AlphaValue) + else + begin + Result := True; + cxAlphaBlend(ADestDC, ASrcDC, ADestRect, ASrcRect, False, AlphaValue); + end; +end; + +{ TdxSkinnedRect } + +constructor TdxSkinnedRect.Create(AOpaque: Boolean = False); +begin + FAlphaValue := 255; + FID := -1; + FOpaque := AOpaque; + FTextOffset := cxRect(8, 8, 8, 8); + FInterpolationMode := InterpolationModeDefault; +end; + +destructor TdxSkinnedRect.Destroy; +begin + if FGPImage <> nil then + GdipDisposeImage(FGPImage); + if FGPCacheBitmap <> nil then + GdipDisposeImage(FGPCacheBitmap); + inherited Destroy; +end; + +procedure TdxSkinnedRect.Calculate(AWidth, AHeight: Integer); +var + W, H: Integer; +begin + if (FFixedPartSize.Left + FFixedPartSize.Right) >= AWidth then + begin + W := AWidth div 2; + FDrawPartSizes[sp3x3TopLeft].cx := W; + FDrawPartSizes[sp3x3BottomLeft].cx := W; + FDrawPartSizes[sp3x3Left].cx := W; + W := AWidth - W; + FDrawPartSizes[sp3x3TopRight].cx := W; + FDrawPartSizes[sp3x3BottomRight].cx := W; + FDrawPartSizes[sp3x3Right].cx := W; + //don't draw + FDrawPartSizes[sp3x3Center].cx := 0; + FDrawPartSizes[sp3x3Top].cx := 0; + FDrawPartSizes[sp3x3Bottom].cx := 0; + end + else + begin + FDrawPartSizes[sp3x3TopLeft].cx := FFixedPartSize.Left; + FDrawPartSizes[sp3x3Left].cx := FFixedPartSize.Left; + FDrawPartSizes[sp3x3BottomLeft].cx := FFixedPartSize.Left; + FDrawPartSizes[sp3x3TopRight].cx := FFixedPartSize.Right; + FDrawPartSizes[sp3x3Right].cx := FFixedPartSize.Right; + FDrawPartSizes[sp3x3BottomRight].cx := FFixedPartSize.Right; + FDrawPartSizes[sp3x3Center].cx := AWidth - (FFixedPartSize.Right + FFixedPartSize.Left); + FDrawPartSizes[sp3x3Top].cx := FDrawPartSizes[sp3x3Center].cx; + FDrawPartSizes[sp3x3Bottom].cx := FDrawPartSizes[sp3x3Center].cx; + end; + if (FFixedPartSize.Top + FFixedPartSize.Bottom) >= AHeight then + begin + H := AHeight div 2; + FDrawPartSizes[sp3x3TopLeft].cy := H; + FDrawPartSizes[sp3x3TopRight].cy := H; + FDrawPartSizes[sp3x3Top].cy := H; + H := AHeight - H; + FDrawPartSizes[sp3x3BottomLeft].cy := H; + FDrawPartSizes[sp3x3BottomRight].cy := H; + FDrawPartSizes[sp3x3Bottom].cy := H; + //don't draw + FDrawPartSizes[sp3x3Center].cy := 0; + FDrawPartSizes[sp3x3Left].cy := 0; + FDrawPartSizes[sp3x3Right].cy := 0; + end + else + begin + FDrawPartSizes[sp3x3TopLeft].cy := FFixedPartSize.Top; + FDrawPartSizes[sp3x3Top].cy := FFixedPartSize.Top; + FDrawPartSizes[sp3x3TopRight].cy := FFixedPartSize.Top; + FDrawPartSizes[sp3x3BottomLeft].cy := FFixedPartSize.Bottom; + FDrawPartSizes[sp3x3Bottom].cy := FFixedPartSize.Bottom; + FDrawPartSizes[sp3x3BottomRight].cy := FFixedPartSize.Bottom; + FDrawPartSizes[sp3x3Center].cy := AHeight - (FFixedPartSize.Bottom + FFixedPartSize.Top); + FDrawPartSizes[sp3x3Left].cy := FDrawPartSizes[sp3x3Center].cy; + FDrawPartSizes[sp3x3Right].cy := FDrawPartSizes[sp3x3Center].cy; + end; +end; + +procedure TdxSkinnedRect.Clear; +begin + FCalculatedSize := cxNullSize; +end; + +procedure TdxSkinnedRect.DefaultDraw(DC: HDC; const R: TRect); +begin + FillRectByColor(DC, R, clBtnFace); +end; + +procedure TdxSkinnedRect.DoDraw(DC: HDC; const R: TRect); +var + H, OldBitmap: HBITMAP; + BDC: HDC; +begin + CheckCachedImage; + GdipCreateHBITMAPFromBitmap(FGPCacheBitmap, H, 0); + BDC := CreateCompatibleDC(DC); + OldBitmap := SelectObject(BDC, H); + if not FOpaque and not dxAlphaBlend(DC, R, BDC, cxRect(0, 0, CalculatedSize.cx, CalculatedSize.cy), AlphaValue) then + cxBitBlt(DC, BDC, R, cxPoint(0, 0), srccopy); + SelectObject(BDC, OldBitmap); + DeleteDC(BDC); + DeleteObject(H); +end; + +procedure TdxSkinnedRect.Draw(DC: HDC; const R: TRect; AlphaValue: Byte = 255); +begin + FAlphaValue := AlphaValue; + if (R.Right - R.Left <= 0) or (R.Bottom - R.Top <= 0) then Exit; + CheckCalculate(R.Right - R.Left, R.Bottom - R.Top); + if RectVisible(DC, R) then + DoDraw(DC, R) +end; + +function TdxSkinnedRect.GetBitmap(const AWidth, AHeight: Integer; + AUseAlphaChannel: Boolean = False): TBitmap; +begin + Result := TcxBitmap.CreateSize(AWidth, AHeight);; + if AUseAlphaChannel then + Result.PixelFormat := pf32bit; + Draw(Result.Canvas.Handle, cxRect(0, 0, AWidth, AHeight)); + if AUseAlphaChannel then + TcxBitmap(Result).RecoverAlphaChannel(clFuchsia); +end; + +function TdxSkinnedRect.GetTextBounds(const R: TRect): TRect; +begin + Result := R; + Inc(Result.Left, FTextOffset.Left); + Inc(Result.Top, FTextOffset.Top); + Dec(Result.Right, FTextOffset.Right); + Dec(Result.Bottom, FTextOffset.Bottom); +end; + +procedure TdxSkinnedRect.LoadFromBitmap(ABitmap: GpBitmap; + const ARect, AFixedPartSize: TRect); +var + G: GpGraphics; +begin + Clear; + GdipCheck(GdipCreateBitmapFromScan0(ARect.Right - ARect.Left, ARect.Bottom - ARect.Top, + 0, PixelFormat32bppPARGB, nil, FGPImage)); + GdipCheck(GdipGetImageGraphicsContext(FGPImage, G)); + GdipCheck(GdipSetInterpolationMode(G, InterpolationModeNearestNeighbor)); + GdipCheck(GdipSetCompositingMode(G, CompositingModeSourceCopy)); + GdipCheck(GdipDrawImageRectRectI(G, ABitmap, 0, 0, ARect.Right - ARect.Left, ARect.Bottom - ARect.Top, + ARect.Left, ARect.Top, ARect.Right - ARect.Left, ARect.Bottom - ARect.Top, UnitPixel, nil, nil, nil)); + GdipCheck(GdipDeleteGraphics(G)); + FFixedPartSize := AFixedPartSize; + CalculatePartBounds(ARect); + UpdateSizes; +end; + +procedure TdxSkinnedRect.LoadFromFile(const AFileName: string; + const AFixedPartSize: TRect); +var + ARect: TRect; +begin + Clear; + FFixedPartSize := AFixedPartSize; + ARect.Left := 0; + ARect.Top := 0; + GdipCheck(GdipLoadImageFromFile(PWideChar(WideString(AFileName)), FGPImage)); + GdipCheck(GdipGetImageWidth(FGPImage, ARect.Right)); + GdipCheck(GdipGetImageHeight(FGPImage, ARect.Bottom)); + CalculatePartBounds(ARect); + UpdateSizes; +end; + +procedure TdxSkinnedRect.LoadFromFile(const AFileName: string; + const ARect, AFixedPartSize: TRect); +var + B: GpBitmap; + G: GpGraphics; +begin + Clear; + FFixedPartSize := AFixedPartSize; + GdipCheck(GdipLoadImageFromFile(PWideChar(WideString(AFileName)), B)); + GdipCheck(GdipCreateBitmapFromScan0(ARect.Right - ARect.Left, ARect.Bottom - ARect.Top, + 0, PixelFormat32bppPARGB, nil, FGPImage)); + GdipCheck(GdipGetImageGraphicsContext(FGPImage, G)); + GdipCheck(GdipDrawImageRectRectI(G, B, 0, 0, ARect.Right - ARect.Left, ARect.Bottom - ARect.Top, + ARect.Left, ARect.Top, ARect.Right - ARect.Left, ARect.Bottom - ARect.Top, UnitPixel, nil, nil, nil)); + GdipCheck(GdipDeleteGraphics(G)); + GdipCheck(GdipDisposeImage(B)); + CalculatePartBounds(ARect); + UpdateSizes; +end; + +procedure TdxSkinnedRect.CalculatePartBounds(const ARect: TRect); +var + I: TdxSkin3x3Part; + R: TRect; +begin + for I := sp3x3TopLeft to sp3x3BottomRight do + begin + case I of + sp3x3TopLeft: + R := cxRectBounds(ARect.Left, ARect.Top, + FFixedPartSize.Left, FFixedPartSize.Top); + sp3x3Top: + R := cxRect(ARect.Left + FFixedPartSize.Left, ARect.Top, + ARect.Right - FFixedPartSize.Right, ARect.Top + FFixedPartSize.Top); + sp3x3TopRight: + R := cxRect(ARect.Right - FFixedPartSize.Right, ARect.Top, ARect.Right, + ARect.Top + FFixedPartSize.Top); + sp3x3Left: + R := cxRect(ARect.Left, ARect.Top + FFixedPartSize.Top, + ARect.Left + FFixedPartSize.Left, ARect.Bottom - FFixedPartSize.Bottom); + sp3x3Center: + R := cxRect(ARect.Left + FFixedPartSize.Left, ARect.Top + FFixedPartSize.Top, + ARect.Right - FFixedPartSize.Right, ARect.Bottom - FFixedPartSize.Bottom); + sp3x3Right: + R := cxRect(ARect.Right - FFixedPartSize.Right, ARect.Top + FFixedPartSize.Top, + ARect.Right, ARect.Bottom - FFixedPartSize.Bottom); + sp3x3BottomLeft: + R := cxRect(ARect.Left, ARect.Bottom - FFixedPartSize.Bottom, + ARect.Left + FFixedPartSize.Left, ARect.Bottom); + sp3x3Bottom: + R := cxRect(ARect.Left + FFixedPartSize.Left, ARect.Bottom - FFixedPartSize.Bottom, + ARect.Right - FFixedPartSize.Right, ARect.Bottom); + else + R := cxRect(ARect.Right - FFixedPartSize.Right, + ARect.Bottom - FFixedPartSize.Bottom, ARect.Right, ARect.Bottom); + end; + FPartBounds[I] := cxRectBounds(R.Left - ARect.Left, R.Top - ARect.Top, + R.Right - R.Left, R.Bottom - R.Top); + end; +end; + +procedure TdxSkinnedRect.CheckCachedImage; +begin + if (FLastSize.cx = CalculatedSize.cx) and (FLastSize.cy = CalculatedSize.cy) then Exit; + FLastSize := CalculatedSize; + if FGPCacheBitmap <> nil then + GdipDisposeImage(FGPCacheBitmap); + GdipCreateBitmapFromScan0(CalculatedSize.cx, CalculatedSize.cy, 0, + PixelFormat32bppPARGB, nil, FGPCacheBitmap); + UpdateCacheImage; +end; + +procedure TdxSkinnedRect.CheckCalculate(AWidth, AHeight: Integer); +begin + if (AWidth <> CalculatedSize.cx) or (AHeight <> CalculatedSize.cy) then + begin + Calculate(AWidth, AHeight); + FCalculatedSize.cx := AWidth; + FCalculatedSize.cy := AHeight; + end; +end; + +procedure TdxSkinnedRect.UpdateCacheImage; +var + X, Y: Integer; + G: GpGraphics; + + procedure StretchDraw(X, Y, W, H: Integer; const ASrcRect: TRect); + var + ASrcWidth, ASrcHeight: Integer; + begin + ASrcWidth := ASrcRect.Right - ASrcRect.Left; + ASrcHeight := ASrcRect.Bottom - ASrcRect.Top; + if (ASrcWidth > 1) and (W > ASrcWidth) then Dec(ASrcWidth); + if (ASrcHeight > 1) and (H > ASrcHeight) then Dec(ASrcHeight); + GdipDrawImageRectRectI(G, FGPImage, X, Y, W, H, ASrcRect.Left, ASrcRect.Top, + ASrcWidth, ASrcHeight, UnitPixel, + nil, nil, nil); + end; + + procedure DrawPart(var X: Integer; Y: Integer; APart: TdxSkin3x3Part); + var + W, H: Integer; + begin + W := FDrawPartSizes[APart].cx; + H := FDrawPartSizes[APart].cy; + if (W > 0) and (H > 0) then + StretchDraw(X, Y, W, H, FPartBounds[APart]); + Inc(X, W); + end; + +begin + GdipGetImageGraphicsContext(FGPCacheBitmap, G); + GdipSetInterpolationMode(G, FInterpolationMode); + GdipSetCompositingMode(G, CompositingModeSourceCopy); + + X := 0; + Y := 0; + DrawPart(X, Y, sp3x3TopLeft); + DrawPart(X, Y, sp3x3Top); + DrawPart(X, Y, sp3x3TopRight); + X := 0; + Inc(Y, FDrawPartSizes[sp3x3TopLeft].cy); + DrawPart(X, Y, sp3x3Left); + DrawPart(X, Y, sp3x3Center); + DrawPart(X, Y, sp3x3Right); + X := 0; + Inc(Y, FDrawPartSizes[sp3x3Left].cy); + DrawPart(X, Y, sp3x3BottomLeft); + DrawPart(X, Y, sp3x3Bottom); + DrawPart(X, Y, sp3x3BottomRight); + GdipDeleteGraphics(G); +end; + +procedure TdxSkinnedRect.UpdateSizes; +begin + FTextOffset := FFixedPartSize; + FMinSize.cx := FTextOffset.Left + FTextOffset.Right; + FMinSize.cy := FTextOffset.Top + FTextOffset.Bottom; +end; + +{ TdxCustomBarSkin } + +constructor TdxCustomBarSkin.Create(const AName: string); +begin + FName := AName; +end; + +function TdxCustomBarSkin.Add(ASkinnedRect: TdxSkinnedRect): Integer; +var + I: Integer; + +// j: TdxSkin3x3Part; +// R: TRect; + +begin + Result := -1; + if ASkinnedRect = nil then Exit; + for I := 0 to Count - 1 do + with Parts[I] do + if (ASkinnedRect.ID <> -1) and (ASkinnedRect.ID = ID) then + raise Exception.CreateFmt('ERROR: Duplicate part''s ID = %d', [ASkinnedRect.ID]) + else if (ASkinnedRect.Name <> '') and (AnsiSameText(ASkinnedRect.Name, Name)) then + raise Exception.CreateFmt('ERROR: Duplicate part''s name = "%s"', [ASkinnedRect.Name]); + Result := inherited Add(ASkinnedRect); + +// for j := sp3x3TopLeft to sp3x3BottomRight do +// with ASkinnedRect.FPartBounds[j] do +// begin +// if (Bottom - Top = 1) or (Right - Left = 1) then +// raise Exception.CreateFmt('ERROR: Duplicate part''s ID = %d', [ASkinnedRect.ID]) +// end; + +end; + +function TdxCustomBarSkin.AddPart1x1(ABitmap: GpBitmap; + const R: TRect; AID: Integer; const AName: string = ''; + AInterpolationMode: Integer = InterpolationModeDefault): Integer; +var + P: TdxSkinnedRect; +begin + P := TdxSkinnedRect.Create; + P.LoadFromBitmap(ABitmap, R, cxNullRect); + P.ID := AID; + P.Name := AName; + P.InterpolationMode := AInterpolationMode; + Result := Add(P); +end; + +function TdxCustomBarSkin.AddPart1x3(ABitmap: GpBitmap; + const R: TRect; ATop, ABottom, AID: Integer; const AName: string = ''; + AInterpolationMode: Integer = InterpolationModeDefault): Integer; +var + P: TdxSkinnedRect; +begin + P := TdxSkinnedRect.Create; + P.LoadFromBitmap(ABitmap, R, cxRect(0, ATop, 0, ABottom)); + P.ID := AID; + P.Name := AName; + P.InterpolationMode := AInterpolationMode; + Result := Add(P); +end; + +function TdxCustomBarSkin.AddPart3x3(ABitmap: GpBitmap; const R, + AFixedSize: TRect; AID: Integer; const AName: string = ''; + AInterpolationMode: Integer = InterpolationModeDefault): Integer; +var + P: TdxSkinnedRect; +begin + P := TdxSkinnedRect.Create; + P.LoadFromBitmap(ABitmap, R, AFixedSize); + P.ID := AID; + P.Name := AName; + P.InterpolationMode := AInterpolationMode; + Result := Add(P); +end; + +procedure TdxCustomBarSkin.Clear; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Parts[I].Free; + inherited Clear; +end; + +function TdxCustomBarSkin.PartByID(const AID: Integer): TdxSkinnedRect; +var + I: Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + if AID = Parts[I].ID then + begin + Result := Parts[I]; + Break; + end; +end; + +function TdxCustomBarSkin.PartByName(const AName: string): TdxSkinnedRect; +var + I: Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + if AnsiSameText(AName, Parts[I].Name) then + begin + Result := Parts[I]; + Break; + end; +end; + +function TdxCustomBarSkin.IsPersistent: Boolean; +begin + Result := False; +end; + +function TdxCustomBarSkin.GetPart(Index: Integer): TdxSkinnedRect; +begin + Result := TdxSkinnedRect(List^[Index]); +end; + +{ TdxBarSkinManager } + +constructor TdxBarSkinManager.Create; +begin + FList := TList.Create; +end; + +destructor TdxBarSkinManager.Destroy; +var + I: Integer; +begin + for I := 0 to FList.Count - 1 do + Skins[I].Free; + FList.Free; + inherited Destroy; +end; + +function TdxBarSkinManager.AddSkin(ASkin: TdxCustomBarSkin): Integer; +var + I: Integer; +begin + Result := -1; + if not CheckGdiPlus then Exit; + if (ASkin <> nil) and (ASkin.Name <> '') then + begin + for I := 0 to SkinCount - 1 do + if AnsiSameText(ASkin.Name, Skins[I].Name) then + Exit; + Result := FList.Add(ASkin); + Changed; + end +end; + +function TdxBarSkinManager.CanDeleteSkin(ASkin: TdxCustomBarSkin): Boolean; +begin + Result := not ASkin.IsPersistent; +end; + +procedure TdxBarSkinManager.Changed; +begin +end; + +function TdxBarSkinManager.GetSkin(Index: Integer): TdxCustomBarSkin; +begin + Result := TdxCustomBarSkin(FList[Index]); +end; + +function TdxBarSkinManager.RemoveSkin(ASkin: TdxCustomBarSkin): Boolean; +var + I: Integer; +begin + Result := CanDeleteSkin(ASkin); + if Result then + begin + I := FList.IndexOf(ASkin); + if I >= 0 then + begin + ASkin.Free; + FList.Delete(I); + Changed; + end; + end; +end; + +function TdxBarSkinManager.SkinByName(const AName: string): TdxCustomBarSkin; +var + I: Integer; +begin + Result := nil; + for I := 0 to SkinCount - 1 do + if AnsiSameText(AName, Skins[I].Name) then + begin + Result := Skins[I]; + Break; + end; +end; + +function TdxBarSkinManager.GetSkinCount: Integer; +begin + Result := FList.Count; +end; + +procedure DestroySkinManager; +begin + FreeAndNil(FSkinManager); +end; + +initialization + +finalization + DestroySkinManager; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBarSkinConsts.pas b/official/x.35/ExpressBars 6/Sources/dxBarSkinConsts.pas new file mode 100644 index 00000000..a1ca83c1 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarSkinConsts.pas @@ -0,0 +1,163 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars components } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarSkinConsts; + +{$I cxVer.inc} + +interface + +const +//Parts + DXBAR_ITEMSEPARATOR = 0; + DXBAR_ITEMTEXT = 335; + DXBAR_TOOLBAR = 1; + DXBAR_MARKARROW = 336; + DXBAR_MARKTRUNCATED = 337; + DXBAR_ARROWDOWN = 340; + DXBAR_SCROLLARROW = 360; +// DXBAR_MENU = 360; + DXBAR_MENUITEMTEXT = 362; + DXBAR_MENUARROWDOWN = 365; + DXBAR_MENUARROWRIGHT = 366; + DXBAR_MENUDETACHCAPTION = 370; + DXBAR_MENUDETACHCAPTIONAREA = 375; + DXBAR_MENUGLYPH = 380; + DXBAR_MENUCONTENT = 390; + DXBAR_MENUEXTRAPANE = 395; + DXBAR_MENUSEPARATORHORZ = 400; + DXBAR_MENUSEPARATORVERT = 410; + DXBAR_MENUARROWSEPARATOR = 420; + DXBAR_MENUEDITSEPARATOR = 425; + DXBAR_MENUCHECK = 430; + DXBAR_MENUCHECKMARK = 440; + DXBAR_MENUMARK = 442; + DXBAR_MENUSCROLLAREA = 446; + DXBAR_DROPDOWNBORDER = 450; + DXBAR_DROPDOWNBORDER_INNERLINE = 451; + DXBAR_COLLAPSEDTOOLBAR = 1000; + DXBAR_COLLAPSEDTOOLBARGLYPHBACKGROUND = 1001; + //ApplicationMenu + DXBAR_APPLICATIONMENUBORDER = 452; + DXBAR_APPLICATIONMENUCONTENTHEADER = 453; + DXBAR_APPLICATIONMENUCONTENTFOOTER = 454; + DXBAR_APPLICATIONMENUCONTENTSIDES = 455; + DXBAR_APPLICATIONMENUCONTENTOUTERBORDER = 456; + DXBAR_APPLICATIONMENUCONTENTINNERBORDER = 457; + DXBAR_APPLICATIONMENUBUTTON = 458; + //Button + DXBAR_SMALLBUTTON = 3; + DXBAR_SMALLBUTTON_DROPBUTTON = 4; + DXBAR_SMALLBUTTON_GLYPH = 5; + DXBAR_LARGEBUTTON = 6; + DXBAR_LARGEBUTTON_DROPBUTTON = 7; + DXBAR_LARGEBUTTON_GLYPH = 8; + DXBAR_BUTTONGROUP = 460; + DXBAR_BUTTONGROUPBORDERLEFT = 470; + DXBAR_BUTTONGROUPBORDERMIDDLE = 480; + DXBAR_BUTTONGROUPBORDERRIGHT = 490; + DXBAR_BUTTONGROUPSPLITBUTTONSEPARATOR = 500; + DXBAR_LAUNCHBUTTONDEFAULTGLYPH = 510; + DXBAR_LAUNCHBUTTONBACKGROUND = 515; + DXBAR_QUICKACCESSGROUPBUTTON = 520; + //Edit + DXBAR_EDIT_BACKGROUND = 9; + DXBAR_EDIT_BORDER = 10; + DXBAR_EDIT_BUTTON = 11; + DXBAR_EDIT_BUTTON_BORDER = 12; + DXBAR_EDIT_ARROWBUTTON = 13; + DXBAR_EDIT_ELLIPSISBUTTON = 14; + DXBAR_SPINEDIT_DOWNBUTTON = 15; + DXBAR_SPINEDIT_UPBUTTON = 16; + //Date Navigator + DXBAR_DATENAVIGATOR_HEADER = 19; + //Separator + DXBAR_SEPARATOR_BACKGROUND = 20; + //Progress + DXBAR_PROGRESSSOLIDBAND = 30; + DXBAR_PROGRESSDISCRETEBAND = 31; + DXBAR_PROGRESSSUBSTRATE = 32; + //ToolTips + DXBAR_SCREENTIP = 40; + DXBAR_SCREENTIP_FOOTERLINE = 41; + //Gallery + DXBAR_INRIBBONGALLERY = 50; + DXBAR_INRIBBONGALLERY_BACKGROUND = 51; + DXBAR_INRIBBONGALLERY_BORDER = 52; + DXBAR_INRIBBONGALLERYSCROLLBAR_LINEUPBUTTON = 53; + DXBAR_INRIBBONGALLERYSCROLLBAR_LINEDOWNBUTTON = 54; + DXBAR_INRIBBONGALLERYSCROLLBAR_DROPDOWNBUTTON = 55; + DXBAR_DROPDOWNGALLERY = 56; + DXBAR_DROPDOWNGALLERY_TOPSIZINGBAND = 57; + DXBAR_DROPDOWNGALLERY_BOTTOMSIZINGBAND = 58; + DXBAR_DROPDOWNGALLERY_TOPSIZEGRIP = 59; + DXBAR_DROPDOWNGALLERY_BOTTOMSIZEGRIP = 60; + DXBAR_DROPDOWNGALLERY_TOPVERTICALSIZEGRIP = 61; + DXBAR_DROPDOWNGALLERY_BOTTOMVERTICALSIZEGRIP = 62; + DXBAR_GALLERYGROUPHEADERBACKGROUND = 63; + DXBAR_GALLERYGROUPHEADERTEXT = 64; + DXBAR_GALLERYFILTERBAND = 65; + DXBAR_GALLERYFILTERBANDTEXT = 66; + DXBAR_GALLERYGROUPITEM_OUTERBORDER = 67; + DXBAR_GALLERYGROUPITEM_INNERBORDER = 68; + +// States + DXBAR_STATESCOUNT = 9; + + DXBAR_NORMAL = 0; + DXBAR_DISABLED = 1; + DXBAR_HOT = 2; + DXBAR_ACTIVE = 3; + DXBAR_PRESSED = 4; + DXBAR_FOCUSED = 4; + DXBAR_DROPPEDDOWN = 5; + DXBAR_CHECKED = 6; + DXBAR_HOTCHECK = 7; + DXBAR_ACTIVEDISABLED = 8; + + DXBAR_BTN_STATES = [DXBAR_HOT..DXBAR_ACTIVEDISABLED]; + +{ + DXBAR_NORMAL = 1; + DXBAR_HOT = 2; + DXBAR_PRESSED = 3; + DXBAR_FOCUSED = 3; + DXBAR_DISABLED = 4; + DXBAR_ACTIVE = 5; + DXBAR_DROPPEDDOWN = 6; +} + +implementation + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxBarStrs.pas b/official/x.35/ExpressBars 6/Sources/dxBarStrs.pas new file mode 100644 index 00000000..0a0e6fbf --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxBarStrs.pas @@ -0,0 +1,250 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars string table constants } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBarStrs; + +{$I cxVer.inc} + +interface + +resourcestring + dxSBAR_LOOKUPDIALOGCAPTION = 'Select value'; + dxSBAR_LOOKUPDIALOGOK = 'OK'; + dxSBAR_LOOKUPDIALOGCANCEL = 'Cancel'; + + dxSBAR_DIALOGOK = 'OK'; + dxSBAR_DIALOGCANCEL = 'Cancel'; + dxSBAR_COLOR_STR_0 = 'Black'; + dxSBAR_COLOR_STR_1 = 'Maroon'; + dxSBAR_COLOR_STR_2 = 'Green'; + dxSBAR_COLOR_STR_3 = 'Olive'; + dxSBAR_COLOR_STR_4 = 'Navy'; + dxSBAR_COLOR_STR_5 = 'Purple'; + dxSBAR_COLOR_STR_6 = 'Teal'; + dxSBAR_COLOR_STR_7 = 'Gray'; + dxSBAR_COLOR_STR_8 = 'Silver'; + dxSBAR_COLOR_STR_9 = 'Red'; + dxSBAR_COLOR_STR_10 = 'Lime'; + dxSBAR_COLOR_STR_11 = 'Yellow'; + dxSBAR_COLOR_STR_12 = 'Blue'; + dxSBAR_COLOR_STR_13 = 'Fuchsia'; + dxSBAR_COLOR_STR_14 = 'Aqua'; + dxSBAR_COLOR_STR_15 = 'White'; + dxSBAR_COLORAUTOTEXT = '(automatic)'; + dxSBAR_COLORCUSTOMTEXT = '(custom)'; + dxSBAR_DATETODAY = 'Today'; + dxSBAR_DATECLEAR = 'Clear'; + dxSBAR_DATEDIALOGCAPTION = 'Select the date'; + dxSBAR_TREEVIEWDIALOGCAPTION = 'Select item'; + dxSBAR_IMAGEDIALOGCAPTION = 'Select item'; + dxSBAR_IMAGEINDEX = 'Image Index'; + dxSBAR_IMAGETEXT = 'Text'; + dxSBAR_PLACEFORCONTROL = 'The place for the '; + dxSBAR_CANTASSIGNCONTROL = 'You cannot assign the same control to more than one TdxBarControlContainerItem'; + dxSBAR_CXEDITVALUEDIALOGCAPTION = 'Enter value'; + + dxSBAR_WANTTORESETTOOLBAR = 'Are you sure you want to reset the changes made to the ''%s'' toolbar?'; + dxSBAR_WANTTORESETUSAGEDATA = 'This will delete the record of the commands you''ve used in this application and restore the default set of visible commands to the menus and toolbars. It will not undo any explicit customizations. Are you sure you want to proceed?'; + dxSBAR_BARMANAGERMORETHANONE = 'A control should contain only a single TdxBarManager'; + dxSBAR_BARMANAGERBADOWNER = 'TdxBarManager should have TWinControl as its Owner'; + dxSBAR_NOBARMANAGERS = 'There are no TdxBarManagers available'; + dxSBAR_WANTTODELETETOOLBAR = 'Are you sure you want to delete the ''%s'' toolbar?'; + dxSBAR_WANTTODELETETOOLBARS = 'Are you sure you want to delete selected toolbars?'; + dxSBAR_WANTTODELETECATEGORY = 'Are you sure you want to delete the ''%s'' category?'; + dxSBAR_WANTTOCLEARCOMMANDS = 'Are you sure you want to delete all commands in the ''%s'' category?'; + dxSBAR_RECURSIVEMENUS = 'You cannot create recursive menus'; + dxSBAR_COMMANDNAMECANNOTBEBLANK = 'A command name cannot be blank. Please enter a name.'; + dxSBAR_TOOLBAREXISTS = 'A toolbar named ''%s'' already exists. Type another name.'; + dxSBAR_RECURSIVEGROUPS = 'You cannot create recursive groups'; + dxSBAR_WANTTODELETECOMPLEXITEM = 'One of the selected objects is an item which has several links. Are you sure you want to delete these links?'; + dxSBAR_CANTPLACEQUICKACCESSGROUPBUTTON = 'You can place TdxRibbonQuickAccessGroupButton only on TdxRibbonQuickAccessToolbar'; + dxSBAR_QUICKACCESSGROUPBUTTONTOOLBARNOTDOCKEDINRIBBON = 'Quick Access Group Button''s Toolbar is not docked in the Ribbon'; + dxSBAR_QUICKACCESSALREADYHASGROUPBUTTON = 'The Quick Access Toolbar already contains GroupButton with the same toolbar'; + dxSBAR_CANTPLACESEPARATOR = 'A separator item cannot be placed on the specified toolbar'; + dxSBAR_CANTPLACERIBBONGALLERY = 'You can place TdxRibbonGalleryItem only on the Ribbon'; + + dxSBAR_CANTMERGEBARMANAGER = 'You cannot merge with the specified bar manager'; + dxSBAR_CANTMERGETOOLBAR = 'You cannot merge with the specified toolbar'; + dxSBAR_CANTMERGEWITHMERGEDTOOLBAR = 'You cannot merge a toolbar with a toolbar that is already merged'; + dxSBAR_CANTUNMERGETOOLBAR = 'You cannot unmerge the specified toolbar'; + dxSBAR_ONEOFTOOLBARSALREADYMERGED = 'One of the toolbars of the specified bar manager is already merged'; + dxSBAR_ONEOFTOOLBARSHASMERGEDTOOLBARS = 'One of the toolbars of the specified bar manager has merged toolbars'; + dxSBAR_TOOLBARHASMERGEDTOOLBARS = 'The ''%s'' toolbar has merged toolbars'; + dxSBAR_TOOLBARSALREADYMERGED = 'The ''%s'' toolbar is already merged with the ''%s'' toolbar'; + dxSBAR_TOOLBARSARENOTMERGED = 'The ''%s'' toolbar is not merged with the ''%s'' toolbar'; + + dxSBAR_DEFAULTCATEGORYNAME = 'Default'; + // begin DesignTime section + dxSBAR_NEWBUTTONCAPTION = 'New Button'; + dxSBAR_NEWITEMCAPTION = 'New Item'; + dxSBAR_NEWRIBBONGALLERYITEMCAPTION = 'New Gallery'; + dxSBAR_NEWSEPARATORCAPTION = 'New Separator'; + dxSBAR_NEWSUBITEMCAPTION = 'New SubItem'; + + dxSBAR_CP_ADDSUBITEM = 'Add &SubItem'; + dxSBAR_CP_ADDBUTTON = 'Add &Button'; + dxSBAR_CP_ADDSEPARATOR = 'Add &Separator'; + dxSBAR_CP_ADDDXITEM = 'Add &Item'; + dxSBAR_CP_ADDCXITEM = 'Add &cxEditItem'; + dxSBAR_CP_ADDGROUPBUTTON = 'Add Gro&upButton'; + dxSBAR_CP_DELETEITEM = 'Delete Item'; + dxSBAR_CP_DELETELINK = 'Delete Link'; + // end DesignTime section + + dxSBAR_CP_RESET = '&Reset'; + dxSBAR_CP_DELETE = '&Delete'; + dxSBAR_CP_NAME = '&Name:'; + dxSBAR_CP_CAPTION = '&Caption:'; // is the same as dxSBAR_CP_NAME (at design time) + dxSBAR_CP_BUTTONPAINTSTYLEMENU = 'Button Paint &Style'; + dxSBAR_CP_DEFAULTSTYLE = 'Defa&ult style'; + dxSBAR_CP_TEXTONLYALWAYS = '&Text Only (Always)'; + dxSBAR_CP_TEXTONLYINMENUS = 'Text &Only (in Menus)'; + dxSBAR_CP_IMAGEANDTEXT = 'Image &and Text'; + dxSBAR_CP_BEGINAGROUP = 'Begin a &Group'; + dxSBAR_CP_VISIBLE = '&Visible'; + dxSBAR_CP_MOSTRECENTLYUSED = '&Most recently used'; + // begin DesignTime section + dxSBAR_CP_POSITIONMENU = '&Position'; + dxSBAR_CP_VIEWLEVELSMENU = 'View&Levels'; + dxSBAR_CP_ALLVIEWLEVELS = 'All'; + dxSBAR_CP_SINGLEVIEWLEVELITEMSUFFIX = ' ONLY'; + dxSBAR_CP_BUTTONGROUPMENU = 'ButtonG&roup'; + dxSBAR_CP_BUTTONGROUP = 'Group'; + dxSBAR_CP_BUTTONUNGROUP = 'Ungroup'; + // end DesignTime section + + dxSBAR_ADDEX = 'Add...'; + dxSBAR_RENAMEEX = 'Rename...'; + dxSBAR_DELETE = 'Delete'; + dxSBAR_CLEAR = 'Clear'; + dxSBAR_VISIBLE = 'Visible'; + dxSBAR_OK = 'OK'; + dxSBAR_CANCEL = 'Cancel'; + dxSBAR_SUBMENUEDITOR = 'SubMenu Editor...'; + dxSBAR_SUBMENUEDITORCAPTION = 'ExpressBars SubMenu Editor'; + dxSBAR_INSERTEX = 'Insert...'; + + dxSBAR_MOVEUP = 'Move Up'; + dxSBAR_MOVEDOWN = 'Move Down'; + dxSBAR_POPUPMENUEDITOR = 'PopupMenu Editor...'; + dxSBAR_TABSHEET1 = ' Toolbars '; + dxSBAR_TABSHEET2 = ' Commands '; + dxSBAR_TABSHEET3 = ' Options '; + dxSBAR_TOOLBARS = 'Toolb&ars:'; + dxSBAR_TNEW = '&New...'; + dxSBAR_TRENAME = 'R&ename...'; + dxSBAR_TDELETE = '&Delete'; + dxSBAR_TRESET = '&Reset...'; + dxSBAR_CLOSE = 'Close'; + dxSBAR_CAPTION = 'Customize'; + dxSBAR_CATEGORIES = 'Cate&gories:'; + dxSBAR_COMMANDS = 'Comman&ds:'; + dxSBAR_DESCRIPTION = 'Description '; + + dxSBAR_MDIMINIMIZE = 'Minimize Window'; + dxSBAR_MDIRESTORE = 'Restore Window'; + dxSBAR_MDICLOSE = 'Close Window'; + dxSBAR_CUSTOMIZE = '&Customize...'; + dxSBAR_ADDREMOVEBUTTONS = '&Add or Remove Buttons'; + dxSBAR_MOREBUTTONS = 'More Buttons'; + dxSBAR_RESETTOOLBAR = '&Reset Toolbar'; + dxSBAR_EXPAND = 'Expand (Ctrl-Down)'; + dxSBAR_DRAGTOMAKEMENUFLOAT = 'Drag to make this menu float'; + dxSBAR_MORECOMMANDS = '&More Commands...'; + dxSBAR_SHOWBELOWRIBBON = '&Show Quick Access Toolbar Below the Ribbon'; + dxSBAR_SHOWABOVERIBBON = '&Show Quick Access Toolbar Above the Ribbon'; + dxSBAR_MINIMIZERIBBON = 'Mi&nimize the Ribbon'; + dxSBAR_ADDTOQAT = '&Add to Quick Access Toolbar'; + dxSBAR_ADDTOQATITEMNAME = '&Add %s to Quick Access Toolbar'; + dxSBAR_REMOVEFROMQAT = '&Remove from Quick Access Toolbar'; + dxSBAR_CUSTOMIZEQAT = 'Customize Quick Access Toolbar'; + dxSBAR_ADDGALLERYNAME = 'Gallery'; + dxSBAR_SHOWALLGALLERYGROUPS = 'Show all groups'; + dxSBAR_HIDEALLGALLERYGROUPS = 'Hide all groups'; + dxSBAR_CLEARGALLERYFILTER = 'Clear filter'; + dxSBAR_GALLERYEMPTYFILTERCAPTION = ''; + + dxSBAR_TOOLBARNEWNAME = 'Custom '; + dxSBAR_CATEGORYADD = 'Add Category'; + dxSBAR_CATEGORYINSERT = 'Insert Category'; + dxSBAR_CATEGORYRENAME = 'Rename Category'; + dxSBAR_TOOLBARADD = 'Add Toolbar'; + dxSBAR_TOOLBARRENAME = 'Rename Toolbar'; + dxSBAR_CATEGORYNAME = '&Category name:'; + dxSBAR_TOOLBARNAME = '&Toolbar name:'; + dxSBAR_CUSTOMIZINGFORM = 'Customization Form...'; + + dxSBAR_MODIFY = '... modify'; + dxSBAR_PERSMENUSANDTOOLBARS = 'Personalized Menus and Toolbars '; + dxSBAR_MENUSSHOWRECENTITEMS = 'Me&nus show recently used commands first'; + dxSBAR_SHOWFULLMENUSAFTERDELAY = 'Show f&ull menus after a short delay'; + dxSBAR_RESETUSAGEDATA = '&Reset my usage data'; + + dxSBAR_OTHEROPTIONS = 'Other '; + dxSBAR_LARGEICONS = '&Large icons'; + dxSBAR_HINTOPT1 = 'Show Tool&Tips on toolbars'; + dxSBAR_HINTOPT2 = 'Show s&hortcut keys in ToolTips'; + dxSBAR_MENUANIMATIONS = '&Menu animations:'; + dxSBAR_MENUANIM1 = '(None)'; + dxSBAR_MENUANIM2 = 'Random'; + dxSBAR_MENUANIM3 = 'Unfold'; + dxSBAR_MENUANIM4 = 'Slide'; + dxSBAR_MENUANIM5 = 'Fade'; + + dxSBAR_CANTFINDBARMANAGERFORSTATUSBAR = 'A bar manager cannot be found for the status bar'; + + dxSBAR_BUTTONDEFAULTACTIONDESCRIPTION = 'Press'; + + SBlob = '(Blob)'; +{$IFNDEF DELPHI6} + SNull = '(Null)'; +{$ENDIF} + + dxSBAR_GDIPLUSNEEDED = '%s requires the Microsoft GDI+ library to be installed'; + dxSBAR_RIBBONMORETHANONE = 'There should be only one %s instance on the form'; + dxSBAR_RIBBONBADOWNER = '%s should have TCustomForm as its Owner'; + dxSBAR_RIBBONBADPARENT = '%s should have TCustomForm as its Parent'; + dxSBAR_RIBBONADDTAB = 'Add Tab'; + dxSBAR_RIBBONDELETETAB = 'Delete Tab'; + dxSBAR_RIBBONADDEMPTYGROUP = 'Add Empty Group'; + dxSBAR_RIBBONADDGROUPWITHTOOLBAR = 'Add Group With Toolbar'; + dxSBAR_RIBBONDELETEGROUP = 'Delete Group'; + + dxSBAR_ACCESSIBILITY_RIBBONNAME = 'Ribbon'; + dxSBAR_ACCESSIBILITY_RIBBONTABCOLLECTIONNAME = 'Ribbon Tabs'; + +implementation + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxFading.pas b/official/x.35/ExpressBars 6/Sources/dxFading.pas new file mode 100644 index 00000000..2e32ea5b --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxFading.pas @@ -0,0 +1,423 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars components } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxFading; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Windows, Classes, SysUtils, Graphics, cxGraphics, ExtCtrls; + +const + dxDefaultStageCount: Integer = 12; + dxDefaultStageInterval: Integer = 20; + +type + TdxFadingList = class; + + IdxFadingObject = interface + ['{73AB2A92-CDD9-4F13-965A-DC799DE837F9}'] + function CanFade: Boolean; + procedure DrawBitmap(ABitmap: TBitmap); + procedure GetFadingParams(out AFadeOutImage, AFadeInImage: TBitmap; + var AFadeInStageCount, AFadeInStageInterval, + AFadeOutStageCount, AFadeOutStageInterval: Integer); + end; + + { TdxFadingElement } + + TdxFadingState = (fsFadeIn, fsFadeOut); + + TdxFadingElement = class + private + FTimer: TTimer; + FFadeOutImage: TBitmap; + FFadeInImage: TBitmap; + FFadingObject: IdxFadingObject; + FElement: TObject; + FOwner: TdxFadingList; + FStage: Integer; + FFadeInStageCount: Integer; + FFadeInStageInterval: Integer; + FFadeOutStageCount: Integer; + FFadeOutStageInterval: Integer; + FState: TdxFadingState; + procedure CreateTimer; + procedure GetFadingParams; + procedure SetState(const Value: TdxFadingState); + procedure ValidateStageParams; + protected + procedure DrawBlended(Alpha: Byte); + function GetInvertedStage: Integer; + function GetStageAlpha: Byte; + procedure OnTimer(Sender: TObject); + + property FadeInStageCount: Integer read FFadeInStageCount; + property FadeInStageInterval: Integer read FFadeInStageInterval; + property FadeOutStageCount: Integer read FFadeOutStageCount; + property FadeOutStageInterval: Integer read FFadeOutStageInterval; + property Owner: TdxFadingList read FOwner; + property Stage: Integer read FStage; + public + constructor Create(AOwner: TdxFadingList; AElement: TObject; + AState: TdxFadingState); + destructor Destroy; override; + procedure Finalize; + + property Element: TObject read FElement; + property State: TdxFadingState read FState write SetState; + end; + + { TdxFadingList } + + TdxFadingList = class(TList) + private + FClearing: Boolean; + function GetItems(Index: Integer): TdxFadingElement; + protected + property Clearing: Boolean read FClearing; + public + procedure Clear; override; + property Items[Index: Integer]: TdxFadingElement read GetItems; default; + end; + + { TdxFader } + + TdxFader = class + private + FList: TdxFadingList; + FQueueDepth: Integer; + procedure SetQueueDepth(Value: Integer); + procedure ValidateQueue; + protected + procedure DoFade(AObject: TObject; AState: TdxFadingState); + function Find(AObject: TObject): TdxFadingElement; + public + constructor Create; + destructor Destroy; override; + procedure Clear; + function Contains(AObject: TObject): Boolean; + procedure FadeIn(AObject: TObject); + procedure FadeOut(AObject: TObject); + procedure Remove(AObject: TObject; ADestroying: Boolean = True); + property QueueDepth: Integer read FQueueDepth write SetQueueDepth; + end; + +implementation + +uses + Math, Forms; + +const + dxMaxStageCount = 32; + dxMaxStageInterval = 300; + dxMaxFadingQueueDepth = 8; + +{ TdxFadingElement } + +constructor TdxFadingElement.Create(AOwner: TdxFadingList; + AElement: TObject; AState: TdxFadingState); +begin + inherited Create; + FOwner := AOwner; + FElement := AElement; + FState := AState; + Supports(AElement, IdxFadingObject, FFadingObject); + GetFadingParams; + CreateTimer; +end; + +destructor TdxFadingElement.Destroy; +begin + FreeAndNil(FTimer); + if not Owner.Clearing then + Owner.Remove(Self); + FFadingObject := nil; + FFadeOutImage.Free; + FFadeInImage.Free; + inherited Destroy; +end; + +procedure TdxFadingElement.Finalize; +var + ABitmap: TBitmap; +begin + if State = fsFadeIn then + ABitmap := FFadeInImage + else + ABitmap := FFadeOutImage; + FFadingObject.DrawBitmap(ABitmap); + Free; +end; + +procedure TdxFadingElement.DrawBlended(Alpha: Byte); +var + B: TBitmap; +begin + B := TBitmap.Create; + try + {$IFDEF DELPHI10} + B.SetSize(FFadeOutImage.Width, FFadeOutImage.Height); + {$ELSE} + B.Width := FFadeOutImage.Width; + B.Height := FFadeOutImage.Height; + {$ENDIF} + cxAlphaBlend(B, FFadeOutImage, FFadeInImage, Alpha); + FFadingObject.DrawBitmap(B); + finally + B.Free; + end; +end; + +function TdxFadingElement.GetInvertedStage: Integer; +var + A: Integer; +begin + A := GetStageAlpha; + if State = fsFadeIn then + Result := Min(FadeOutStageCount, A div (256 div (FadeOutStageCount + 1))) + else + Result := Min(FadeInStageCount, A div (256 div (FadeInStageCount + 1))); +end; + +function TdxFadingElement.GetStageAlpha: Byte; +begin + if State = fsFadeIn then + begin + if Stage >= FFadeInStageCount then + Result := 255 + else + Result := Min(255, Stage * (256 div FadeInStageCount)); + end + else + begin + if Stage >= FadeOutStageCount then + Result := 0 + else + Result := Max(0, 255 - Stage * (256 div FadeOutStageCount)); + end; +end; + +procedure TdxFadingElement.OnTimer(Sender: TObject); +begin + if ((State = fsFadeIn) and (Stage >= FadeInStageCount)) or + ((State = fsFadeOut) and (Stage >= FadeOutStageCount)) then + Finalize + else + begin + Inc(FStage); + DrawBlended(GetStageAlpha); + end; +end; + +procedure TdxFadingElement.CreateTimer; +begin + FTimer := TTimer.Create(nil); + FTimer.Interval := FFadeInStageInterval; + FTimer.OnTimer := OnTimer; +end; + +procedure TdxFadingElement.GetFadingParams; +begin + FFadeInStageCount := dxDefaultStageCount; + FFadeInStageInterval := dxDefaultStageInterval; + FFadeOutStageCount := dxDefaultStageCount; + FFadeOutStageInterval := dxDefaultStageInterval; + FFadingObject.GetFadingParams(FFadeOutImage, FFadeInImage, + FFadeInStageCount, FFadeInStageInterval, FFadeOutStageCount, + FFadeOutStageInterval); + ValidateStageParams; +end; + +procedure TdxFadingElement.ValidateStageParams; +begin + if FFadeInStageCount < 0 then + FFadeInStageCount := dxDefaultStageCount + else if FFadeInStageCount > dxMaxStageCount then + FFadeInStageCount := dxMaxStageCount; + if FFadeInStageInterval < 10 then + FFadeInStageInterval := dxDefaultStageInterval + else if FFadeInStageInterval > dxMaxStageInterval then + FFadeInStageInterval := dxMaxStageInterval; + if FFadeOutStageCount < 0 then + FFadeOutStageCount := dxDefaultStageCount + else if FFadeOutStageCount > dxMaxStageCount then + FFadeOutStageCount := dxMaxStageCount; + if FFadeOutStageInterval < 10 then + FFadeOutStageInterval := dxDefaultStageInterval + else if FFadeOutStageInterval > dxMaxStageInterval then + FFadeOutStageInterval := dxMaxStageInterval; +end; + +procedure TdxFadingElement.SetState(const Value: TdxFadingState); +begin + if FState <> Value then + begin + FStage := GetInvertedStage; + FState := Value; + FTimer.Enabled := False; + if State = fsFadeIn then + FTimer.Interval := FadeInStageInterval + else + FTimer.Interval := FadeOutStageInterval; + FTimer.Enabled := True; + end; +end; + +{ TdxFadingList } + +procedure TdxFadingList.Clear; +var + I: Integer; +begin + FClearing := True; + try + for I := 0 to Count - 1 do + Items[I].Free; + finally + FClearing := False; + end; + inherited Clear; +end; + +function TdxFadingList.GetItems(Index: Integer): TdxFadingElement; +begin + Result := TdxFadingElement(List^[Index]); +end; + +{ TdxFader } + +constructor TdxFader.Create; +begin + inherited Create; + FList := TdxFadingList.Create; + FQueueDepth := 6; +end; + +destructor TdxFader.Destroy; +begin + Clear; + FList.Free; + inherited Destroy; +end; + +procedure TdxFader.Clear; +begin + while FList.Count > 0 do + FList[0].Finalize; +end; + +function TdxFader.Contains(AObject: TObject): Boolean; +begin + Result := Find(AObject) <> nil; +end; + +procedure TdxFader.FadeIn(AObject: TObject); +begin + DoFade(AObject, fsFadeIn); +end; + +procedure TdxFader.FadeOut(AObject: TObject); +begin + DoFade(AObject, fsFadeOut); +end; + +procedure TdxFader.DoFade(AObject: TObject; AState: TdxFadingState); +var + AElement: TdxFadingElement; + AIntf: IdxFadingObject; +begin + if not Supports(AObject, IdxFadingObject, AIntf) or not AIntf.CanFade then Exit; + AElement := Find(AObject); + if AElement = nil then + begin + FList.Add(TdxFadingElement.Create(FList, AObject, AState)); + ValidateQueue; + end + else + AElement.State := AState; +end; + +function TdxFader.Find(AObject: TObject): TdxFadingElement; +var + I: Integer; +begin + Result := nil; + for I := 0 to FList.Count - 1 do + if FList[I].Element = AObject then + begin + Result := FList[I]; + Break; + end; +end; + +procedure TdxFader.Remove(AObject: TObject; ADestroying: Boolean = True); +var + AElement: TdxFadingElement; +begin + AElement := Find(AObject); + if AElement <> nil then + begin + if ADestroying then + AElement.Free + else + AElement.Finalize; + end; +end; + +procedure TdxFader.SetQueueDepth(Value: Integer); +begin + if Value < 0 then Value := 0; + if Value > dxMaxFadingQueueDepth then + Value := dxMaxFadingQueueDepth; + if FQueueDepth <> Value then + begin + FQueueDepth := Value; + ValidateQueue; + end; +end; + +procedure TdxFader.ValidateQueue; +begin + while FList.Count > FQueueDepth do + FList[0].Finalize; +end; + +end. + diff --git a/official/x.35/ExpressBars 6/Sources/dxRibbon.pas b/official/x.35/ExpressBars 6/Sources/dxRibbon.pas new file mode 100644 index 00000000..a9f9f686 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxRibbon.pas @@ -0,0 +1,13135 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars components } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxRibbon; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, Classes, SysUtils, Graphics, Controls, cxClasses, + cxGraphics, cxControls, dxBar, dxRibbonSkins, dxRibbonFormCaptionHelper, + dxRibbonForm, dxBarSkin, dxFading, ExtCtrls, ImgList, cxContainer, Forms, + cxAccessibility, dxBarAccessibility, IniFiles, Contnrs, cxLookAndFeels; + +const + dxRibbonFormCaptionMinWidth = 50; + dxRibbonFormCaptionTextSpace = 4; + dxRibbonTabMinWidth = 28; + dxRibbonTabTextOffset = 5; + dxRibbonTabIndent = 17; + dxRibbonOptimalTabSpace = dxRibbonTabTextOffset * 2 + dxRibbonTabIndent; + dxRibbonTabSeparatorVisibilityLimit = dxRibbonTabMinWidth div 2; + dxRibbonApplicationButtonIndent = 4; + dxRibbonOwnerMinimalWidth: Integer = 300; + dxRibbonOwnerMinimalHeight: Integer = 250; + dxRibbonScrollDelay = 400; + dxRibbonScrollInterval = 20; + + dxRibbonGroupRowCount = 3; + + CM_SELECTAPPMENUFIRSTITEMCONTROL = WM_DX + 25; + CM_SHOWKEYTIPS = WM_DX + 26; + +type + TdxBarApplicationMenu = class; + TdxCustomRibbon = class; + TdxRibbonGroupBarControl = class; + TdxRibbonGroupBarControlViewInfo = class; + TdxRibbonGroupsDockControl = class; + TdxRibbonGroupsDockControlSite = class; + TdxRibbonGroupsDockControlSiteViewInfo = class; + TdxRibbonGroupsDockControlViewInfo = class; + TdxRibbonGroupsDockControlViewInfoClass = class of TdxRibbonGroupsDockControlViewInfo; + TdxRibbonQuickAccessBarControlViewInfo = class; + TdxRibbonQuickAccessDockControl = class; + TdxRibbonQuickAccessToolbar = class; + TdxRibbonTab = class; + TdxRibbonCollapsedGroupPopupBarControl = class; + TdxRibbonTabGroup = class; + TdxRibbonTabPainterClass = class of TdxRibbonTabPainter; + TdxRibbonTabViewInfo = class; + TdxRibbonViewInfo = class; + + EdxRibbonException = class(Exception); + + IdxRibbonFormStatusBarDraw = interface + ['{E6AA56DF-B87A-4D98-98CF-B41BA751594D}'] + function GetActive(AForm: TCustomForm): Boolean; + function GetHeight: Integer; + function GetIsRaised(ALeft: Boolean): Boolean; + end; + + IdxRibbonFormNonClientDraw = interface + ['{0A28260B-C352-4704-A88B-44DD8461955C}'] + procedure Add(AObject: TObject); + procedure Remove(AObject: TObject); + end; + + { TdxDesignSelectionHelper } + + TdxDesignSelectionHelper = class(TInterfacedObject, + IdxBarSelectableItem + ) + private + FOwner: TPersistent; + FRibbon: TdxCustomRibbon; + FParent: TPersistent; + protected + //IdxBarSelectableItem + function CanDelete(ADestruction: Boolean = False): Boolean; + procedure DeleteSelection(var AReference: IdxBarSelectableItem; ADestruction: Boolean); + procedure ExecuteCustomizationAction(ABasicAction: TdxBarCustomizationAction); + function GetBarManager: TdxBarManager; + function GetInstance: TPersistent; + procedure GetMasterObjects(AList: TdxObjectList); + function GetNextSelectableItem: IdxBarSelectableItem; + function GetSelectableParent: TPersistent; + function GetSelectionStatus: TdxBarSelectionStatus; + function GetSupportedActions: TdxBarCustomizationActions; + procedure Invalidate; + function IsComplex: Boolean; + function IsComponentSelected: Boolean; + procedure SelectComponent(ASelectionOperation: TdxBarSelectionOperation = soExclusive); + function SelectParentComponent: Boolean; + procedure SelectionChanged; + public + constructor Create(ARibbon: TdxCustomRibbon; AOwner: TPersistent; AParent: TPersistent); + end; + + { TdxRibbonTabPainter } + + TdxRibbonTabPainter = class + private + FColorScheme: TdxCustomRibbonSkin; + protected + procedure DrawBackground(ACanvas: TcxCanvas; const ABounds: TRect; + AState: TdxRibbonTabState); virtual; + procedure DrawTabSeparator(ACanvas: TcxCanvas; const ABounds: TRect; + Alpha: Byte); virtual; + procedure DrawText(ACanvas: TcxCanvas; const ABounds: TRect; + const AText: string; AHasSeparator: Boolean); virtual; + public + constructor Create(AColorScheme: TdxCustomRibbonSkin); + property ColorScheme: TdxCustomRibbonSkin read FColorScheme; + end; + + { TdxRibbonPainter } + + TdxRibbonPainterClass = class of TdxRibbonPainter; + + TdxRibbonPainter = class + private + FRibbon: TdxCustomRibbon; + function GetViewInfo: TdxRibbonViewInfo; + function GetColorScheme: TdxCustomRibbonSkin; + protected + procedure DrawEmptyRibbon(ACanvas: TcxCanvas); + function GetFormIconHandle: HICON; + public + constructor Create(ARibbon: TdxCustomRibbon); virtual; + + //non-client routines + procedure DrawRibbonFormCaption(ACanvas: TcxCanvas; const ABounds: TRect; + const AData: TdxRibbonFormData); virtual; + procedure DrawRibbonFormBorderIcon(ACanvas: TcxCanvas; const ABounds: TRect; + AIcon: TdxBorderDrawIcon; AState: TdxBorderIconState); virtual; + procedure DrawRibbonFormBorders(ACanvas: TcxCanvas; + const ABordersWidth: TRect; const AData: TdxRibbonFormData); virtual; + //client routines + procedure DrawApplicationButton(ACanvas: TcxCanvas; const ABounds: TRect; AState: TdxApplicationButtonState); virtual; + procedure DrawApplicationButtonGlyph(ACanvas: TcxCanvas; const ABounds: TRect; AGlyph: TBitmap; AStretch: Boolean); virtual; + procedure DrawBackground(ACanvas: TcxCanvas; const ABounds: TRect); virtual; + procedure DrawBottomBorder(ACanvas: TcxCanvas); + procedure DrawDefaultFormIcon(ACanvas: TcxCanvas; const ABounds: TRect); + procedure DrawGlowingText(DC: HDC; const AText: string; + AFont: TFont; const ABounds: TRect; AColor: TColor; AFlags: DWORD); + + procedure DrawGroupsArea(ACanvas: TcxCanvas; const ABounds: TRect); virtual; + procedure DrawGroupsScrollButton(ACanvas: TcxCanvas; const ABounds: TRect; + ALeft, APressed, AHot: Boolean); virtual; + procedure DrawRibbonFormCaptionText(ACanvas: TcxCanvas; const ABounds: TRect; + const ADocumentName, ACaption: string; const AData: TdxRibbonFormData); virtual; + procedure DrawRibbonGlassFormCaptionText(ACanvas: TcxCanvas; const ABounds: TRect; + const ADocumentName, ACaption: string; AIsActive: Boolean); virtual; + procedure DrawQuickAccessToolbar(ACanvas: TcxCanvas; const ABounds: TRect; + AIsActive: Boolean); virtual; + procedure DrawTabScrollButton(ACanvas: TcxCanvas; const ABounds: TRect; + ALeft, APressed, AHot: Boolean); virtual; + procedure DrawHelpButton(ACanvas: TcxCanvas; const ABounds: TRect; + AState: TdxBorderIconState); + procedure DrawMDIButton(ACanvas: TcxCanvas; const ABounds: TRect; + AButton: TdxBarMDIButton; AState: TdxBorderIconState); virtual; + + property ColorScheme: TdxCustomRibbonSkin read GetColorScheme; + property Ribbon: TdxCustomRibbon read FRibbon; + property ViewInfo: TdxRibbonViewInfo read GetViewInfo; + end; + + { TdxRibbonTabViewInfo } + + TdxRibbonTabViewInfoClass = class of TdxRibbonTabViewInfo; + + TdxRibbonTabViewInfo = class + private + FPainter: TdxRibbonTabPainter; + FTab: TdxRibbonTab; + function GetCanvas: TcxCanvas; + function GetFont: TFont; + protected + FCanHasSeparator: Boolean; + FMinWidth: Integer; + FOptimalWidth: Integer; + FTextBounds: TRect; + FTextWidth: Integer; + FSeparatorAlphaValue: Integer; + FSeparatorBounds: TRect; + FWidth: Integer; + procedure CalculateWidths; virtual; + function GetTextBounds: TRect; virtual; + function GetSeparatorBounds: TRect; virtual; + function GetState: TdxRibbonTabState; virtual; + function GetPainterClass: TdxRibbonTabPainterClass; virtual; + function IsSelected: Boolean; + procedure DrawBitmap(ABitmap: TBitmap; AForeground: Boolean); + + property Canvas: TcxCanvas read GetCanvas; + property Painter: TdxRibbonTabPainter read FPainter; + property Width: Integer read FWidth; + public + Bounds: TRect; + constructor Create(ATab: TdxRibbonTab); virtual; + destructor Destroy; override; + procedure Calculate(const ABounds: TRect; ASeparatorAlpha: Byte); virtual; + function HasSeparator: Boolean; + procedure Paint(ACanvas: TcxCanvas); + property Font: TFont read GetFont; + property MinWidth: Integer read FMinWidth; + property OptimalWidth: Integer read FOptimalWidth; + property SeparatorAlphaValue: Integer read FSeparatorAlphaValue; + property SeparatorBounds: TRect read FSeparatorBounds; + property State: TdxRibbonTabState read GetState; + property Tab: TdxRibbonTab read FTab; + property TextBounds: TRect read FTextBounds; + property TextWidth: Integer read FTextWidth; + end; + + { TdxRibbonTabViewInfos } + + TdxRibbonViewInfoClass = class of TdxRibbonViewInfo; + + TdxRibbonHitTest = (rhtNone, rhtTab, rhtApplicationMenu, + rhtTabScrollLeft, rhtTabScrollRight, rhtGroupScrollLeft, rhtGroupScrollRight, //keep order + rhtHelpButton, rhtMDIMinimizeButton, rhtMDIRestoreButton, rhtMDICloseButton); //keep order + + TdxRibbonHitInfo = record + HitTest: TdxRibbonHitTest; + Tab: TdxRibbonTab; + end; + + TdxRibbonScrollButton = (rsbLeft, rsbRight); + TdxRibbonScrollButtons = set of TdxRibbonScrollButton; + + TdxRibbonTabsViewInfo = class(TList) + private + FBounds: TRect; + FHasButtonOnRight: Boolean; + FNeedShowHint: Boolean; + FOwner: TdxRibbonViewInfo; + FScrollButtons: TdxRibbonScrollButtons; + FScrollButtonBounds: array[TdxRibbonScrollButton] of TRect; + FScrollPosition: Integer; + FScrollWidth: Integer; + FSeparatorAlpha: Byte; + FTotalMinimalWidth: Integer; + FTotalOptimalWidth: Integer; + procedure CalculateScrollButtons; + procedure CheckScrollPosition(var Value: Integer); + function GetLongestTabWidth: Integer; + function GetPainter: TdxRibbonPainter; + function GetRealMinItemWidth(Index: Integer): Integer; + function GetScrollButtonBounds(Index: TdxRibbonScrollButton): TRect; + function GetScrollButtonHot(Index: TdxRibbonScrollButton): Boolean; + function GetScrollButtonPressed(Index: TdxRibbonScrollButton): Boolean; + function GetScrollWidth: Integer; + function GetTabViewInfo(Index: Integer): TdxRibbonTabViewInfo; + procedure RemoveScrolling; + procedure SetScrollPosition(Value: Integer); + protected + procedure CalculateComplexTabLayout; virtual; + procedure CalculateSimpleTabLayout; virtual; + procedure CalculateScrollingTabLayout; virtual; + procedure BalancedReduce(ATotalDelta: Integer); + procedure SimpleReduce(ATotalDelta: Integer); + + property Owner: TdxRibbonViewInfo read FOwner; + public + constructor Create(AOwner: TdxRibbonViewInfo); + procedure Calculate(const ABounds: TRect); virtual; + procedure Clear; override; + function GetHitInfo(var AHitInfo: TdxRibbonHitInfo; X, Y: Integer): Boolean; + function GetRealBounds: TRect; + procedure Invalidate; + procedure MakeTabVisible(ATab: TdxRibbonTab); + procedure Paint(ACanvas: TcxCanvas); + procedure UpdateDockControls; + procedure UpdateTabList; + + property Bounds: TRect read FBounds; + property Items[Index: Integer]: TdxRibbonTabViewInfo read GetTabViewInfo; default; + property NeedShowHint: Boolean read FNeedShowHint; + property Painter: TdxRibbonPainter read GetPainter; + property ScrollButtonBounds[Index: TdxRibbonScrollButton]: TRect read GetScrollButtonBounds; + property ScrollButtonHot[Index: TdxRibbonScrollButton]: Boolean read GetScrollButtonHot; + property ScrollButtonPressed[Index: TdxRibbonScrollButton]: Boolean read GetScrollButtonPressed; + property ScrollButtons: TdxRibbonScrollButtons read FScrollButtons; + property ScrollPosition: Integer read FScrollPosition write SetScrollPosition; + end; + + { TdxRibbonViewInfo } + + TdxRibbonViewInfo = class + private + FApplicationButtonBounds: TRect; + FApplicationButtonImageBounds: TRect; + FBounds: TRect; + FDrawEmptyRibbon: Boolean; + FFont: TFont; + FFormCaptionBounds: TRect; + FHelpButtonBounds: TRect; + FGroupsDockControlSiteBounds: TRect; + FMDIButtonBounds: array[TdxBarMDIButton] of TRect; + FQATBarControlSize: TSize; + FQuickAccessToolbarBounds: TRect; + FRibbon: TdxCustomRibbon; + FSupportNonClientDrawing: Boolean; + FTabGroupsDockControlBounds: TRect; + FTabsViewInfo: TdxRibbonTabsViewInfo; + FUseGlass: Boolean; + procedure CheckHelpButtonHitTest(var AHitTest: TdxRibbonHitTest; X: Integer; Y: Integer); + procedure CheckMDIButtonsHitTest(var AHitTest: TdxRibbonHitTest; X: Integer; Y: Integer); + function GetButtonState(AButton: TdxRibbonHitTest): TdxBorderIconState; + function GetCanvas: TcxCanvas; + function GetGroupsDockControlSiteViewInfo: TdxRibbonGroupsDockControlSiteViewInfo; + function GetIsFormCaptionActive: Boolean; + function GetMDIButtonState(AButton: TdxBarMDIButton): TdxBorderIconState; + function GetPainter: TdxRibbonPainter; + function GetQATDockControl: TdxRibbonQuickAccessDockControl; + function GetScrollButtonWidth: Integer; + function GetTabsVerticalOffset: Integer; + procedure UpdateGroupsDockControlSite; + protected + procedure CalculateApplicationButton; virtual; + procedure CalculateQuickAccessToolbar; virtual; + procedure CalculateRibbonFormCaption; virtual; + procedure CalculateTabGroups; virtual; + procedure CalculateTabs; virtual; + procedure CheckButtonsHitTest(var AHitTest: TdxRibbonHitTest; X: Integer; Y: Integer); + function GetRibbonHeight: Integer; virtual; + + function GetApplicationButtonBounds: TRect; virtual; + function GetApplicationButtonGlyphSize: TSize; virtual; + function GetApplicationButtonImageBounds: TRect; virtual; + function GetApplicationButtonOffset: TRect; virtual; + function GetApplicationButtonRegion: HRGN; virtual; + function GetApplicationButtonSize: TSize; virtual; + function GetApplicationButtonState: TdxApplicationButtonState; virtual; + function GetNonClientAreaHeight: Integer; virtual; + //form caption + function GetCaption: string; virtual; + function GetDocumentName: string; virtual; + function GetRibbonFormCaptionClientBounds: TRect; virtual; + function GetRibbonFormCaptionTextBounds: TRect; virtual; + //QuickAccessToolbar + function GetQATAvailWidth: Integer; + function GetQATBarControlSize: TSize; virtual; + function GetQATBounds: TRect; virtual; + function GetQATHeight: Integer; virtual; + function GetQATLeft: Integer; virtual; + function GetQATOverrideWidth(AIgnoreHidden: Boolean = False): Integer; + function GetQATTop: Integer; virtual; + function GetQATWidth: Integer; virtual; + function GetQATDockControlBounds: TRect; virtual; + function GetQATDockControlOffset(AIgnoreHidden: Boolean = False): TRect; virtual; + //TabGroups + function GetGroupsDockControlSiteBounds: TRect; virtual; + function GetTabGroupsDockControlBounds: TRect; virtual; + function GetTabGroupsDockControlOffset: TRect; virtual; + function GetTabGroupsHeight(AIgnoreHidden: Boolean = False): Integer; virtual; + //Tabs + function GetTabsBounds: TRect; virtual; + function GetTabsHeight: Integer; virtual; + function GetTabViewInfoClass: TdxRibbonTabViewInfoClass; virtual; + //MDI support + procedure CalculateMDIButtons; + procedure DrawMDIButtons(ACanvas: TcxCanvas); + function HasMDIButtons: Boolean; + procedure InvalidateMDIButtons; + function IsMDIButtonEnabled(AButton: TdxBarMDIButton; AState: Integer): Boolean; + + procedure CalculateHelpButton; + function CanShowBarControls(AIgnoreHidden: Boolean = False): Boolean; + procedure DrawHelpButton(ACanvas: TcxCanvas); + procedure DrawRibbonBackground(ACanvas: TcxCanvas); + function HasHelpButton: Boolean; + procedure InvalidateHelpButton; + function IsNeedDrawBottomLine: Boolean; + function IsNeedHideControl: Boolean; + function IsQATAtBottom: Boolean; + procedure SetSize; + procedure UpdateQATDockControl; + + function GetPainterClass: TdxRibbonPainterClass; virtual; + + property Canvas: TcxCanvas read GetCanvas; + property DrawEmptyRibbon: Boolean read FDrawEmptyRibbon; + property QATDockControl: TdxRibbonQuickAccessDockControl read GetQATDockControl; + property ScrollButtonWidth: Integer read GetScrollButtonWidth; + property TabsHeight: Integer read GetTabsHeight; + property UseGlass: Boolean read FUseGlass; + public + constructor Create(ARibbon: TdxCustomRibbon); virtual; + destructor Destroy; override; + procedure Calculate(const ABounds: TRect); virtual; + function GetDocumentNameTextColor(AIsActive: Boolean): TColor; + function GetFormCaptionFont(AIsActive: Boolean): TFont; + function GetFormCaptionText: TCaption; + function GetHitInfo(X, Y: Integer): TdxRibbonHitInfo; + function GetTabAtPos(X, Y: Integer): TdxRibbonTab; + function IsApplicationButtonVisible(AIgnoreHidden: Boolean = False): Boolean; + function IsQATAtNonClientArea(AIgnoreHidden: Boolean = False): Boolean; + function IsQATOnGlass: Boolean; + function IsQATVisible(AIgnoreHidden: Boolean = False): Boolean; + function IsTabsVisible(AIgnoreHidden: Boolean = False): Boolean; + function IsTabGroupsVisible(AIgnoreHidden: Boolean = False): Boolean; + procedure Paint(ACanvas: TcxCanvas); + + property Bounds: TRect read FBounds; + property FormCaptionBounds: TRect read FFormCaptionBounds; + property ApplicationButtonBounds: TRect read FApplicationButtonBounds; + property ApplicationButtonImageBounds: TRect read FApplicationButtonImageBounds; + property ApplicationButtonState: TdxApplicationButtonState read GetApplicationButtonState; + + property HelpButtonBounds: TRect read FHelpButtonBounds; + property IsFormCaptionActive: Boolean read GetIsFormCaptionActive; + property Painter: TdxRibbonPainter read GetPainter; + property QuickAccessToolbarBounds: TRect read FQuickAccessToolbarBounds; + property Ribbon: TdxCustomRibbon read FRibbon; + property SupportNonClientDrawing: Boolean read FSupportNonClientDrawing; + + property GroupsDockControlSiteBounds: TRect read FGroupsDockControlSiteBounds; + property TabGroupsDockControlBounds: TRect read FTabGroupsDockControlBounds; + + property GroupsDockControlSiteViewInfo: TdxRibbonGroupsDockControlSiteViewInfo read GetGroupsDockControlSiteViewInfo; + property TabsViewInfo: TdxRibbonTabsViewInfo read FTabsViewInfo; + end; + + { TdxRibbonBarPainter } + + TdxRibbonBarPainter = class(TdxBarSkinnedPainter) + private + FCollapsedGroupElementSizeDenominator: Integer; + FCollapsedGroupElementSizeNumerator: Integer; + FDrawParams: TdxBarButtonLikeControlDrawParams; + FRibbon: TdxCustomRibbon; + function GetCollapsedGroupGlyph(ABarControl: TdxBarControl): TBitmap; + function GetCollapsedGroupGlyphBackgroundSize(ABarControl: TdxBarControl): TSize; + function GetCollapsedGroupGlyphSize(ABarControl: TdxBarControl): TSize; + function GetGroupState(ABarControl: TdxBarControl): Integer; + function InternalGetGroupCaptionHeight(ATextHeight: Integer): Integer; + protected + procedure DrawToolbarContentPart(ABarControl: TdxBarControl; ACanvas: TcxCanvas); override; + function GetCollapsedGroupWidth(ABarControl: TdxRibbonGroupBarControl): Integer; virtual; + function GetGroupCaptionHeight(ACaptionFont: TFont): Integer; virtual; + function GetCollapsedGroupCaptionRect(const AGroupRect: TRect): TRect; virtual; + function GetGroupMinWidth(ABarControl: TdxRibbonGroupBarControl): Integer; virtual; + property DrawParams: TdxBarButtonLikeControlDrawParams read FDrawParams; + public + constructor Create(AData: Integer); override; + destructor Destroy; override; + procedure BarDrawBackground(ABarControl: TdxBarControl; ADC: HDC; + const ADestRect: TRect; const ASourceRect: TRect; ABrush: HBRUSH; + AColor: TColor); override; + function BarMarkRect(ABarControl: TdxBarControl): TRect; override; + function BarMarkItemRect(ABarControl: TdxBarControl): TRect; override; + function GetGroupRowHeight(AIconSize: Integer; AGroupFont: TFont): Integer; + function GetToolbarContentOffsets(ABar: TdxBar; + ADockingStyle: TdxBarDockingStyle; AHasSizeGrip: Boolean): TRect; override; + function SubMenuControlBeginGroupSize: Integer; override; + function SubMenuGetSeparatorSize: Integer; override; + property Ribbon: TdxCustomRibbon read FRibbon; + end; + + { TdxCustomRibbonDockControl } + + TdxCustomRibbonDockControl = class(TdxBarDockControl) + private + procedure CMVisibleChanged(var Message: TMessage); message CM_VISIBLECHANGED; + procedure WMLButtonDblClk(var Message: TWMLButtonDblClk); message WM_LBUTTONDBLCLK; + protected + function AllowUndockWhenLoadFromIni: Boolean; override; + procedure FillBackground(DC: HDC; const ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); override; + function IsDrawDesignBorder: Boolean; override; + function IsTransparent: Boolean; override; + function IsNeedRedrawBarControlsOnPaint: Boolean; virtual; + procedure Paint; override; + procedure VisibleChanged; virtual; + public + procedure UpdateColorScheme; virtual; + end; + + { IdxRibbonGroupViewInfo } + + TdxRibbonGroupOffsetsInfo = record + ButtonGroupOffset: Integer; + ContentLeftOffset: Integer; + ContentRightOffset: Integer; + end; + + IdxRibbonGroupViewInfo = interface + ['{A2CAD367-1836-4FA7-8730-8E7531463C8C}'] + procedure AddSeparator(const Value: TdxBarItemSeparatorInfo); + procedure DeleteSeparators; + function GetContentSize: TSize; + function GetItemControlCount: Integer; + function GetItemControlViewInfo(AIndex: Integer): IdxBarItemControlViewInfo; + function GetMinContentWidth: Integer; + function GetOffsetsInfo: TdxRibbonGroupOffsetsInfo; + function GetSeparatorCount: Integer; + function GetSeparatorInfo(AIndex: Integer): TdxBarItemSeparatorInfo; + procedure SetContentSize(const Value: TSize); + procedure SetSeparatorInfo(AIndex: Integer; + const Value: TdxBarItemSeparatorInfo); + end; + + { IdxRibbonGroupLayoutCalculator } + + IdxRibbonGroupLayoutCalculator = interface + ['{894AC146-F69A-4ED2-9293-AA54AAAE1189}'] + procedure CalcInit(AGroupViewInfo: IdxRibbonGroupViewInfo); + procedure CalcLayout(AGroupViewInfo: IdxRibbonGroupViewInfo); + function CollapseMultiColumnItemControls( + AGroupViewInfo: IdxRibbonGroupViewInfo): Boolean; + function DecreaseMultiColumnItemControlsColumnCount( + AGroupViewInfo: IdxRibbonGroupViewInfo): Boolean; + function Reduce(AGroupViewInfo: IdxRibbonGroupViewInfo; + AUpToViewLevel: TdxBarItemRealViewLevel): Boolean; + procedure ReduceInit(AGroupViewInfo: IdxRibbonGroupViewInfo); + end; + + { TdxRibbonGroupsDockControl } + + TdxRibbonGroupsDockControl = class(TdxCustomRibbonDockControl) + private + FTab: TdxRibbonTab; + procedure DesignMenuClick(Sender: TObject); + function GetRibbon: TdxCustomRibbon; + procedure InitDesignMenu(AItemLinks: TdxBarItemLinks); + procedure ShowDesignMenu; + protected + FViewInfo: TdxRibbonGroupsDockControlViewInfo; + procedure AlignControls(AControl: TControl; var Rect: TRect); override; + procedure CalcRowToolbarPositions(ARowIndex: Integer; AClientSize: Integer); override; + procedure DblClick; override; + procedure FillBackground(DC: HDC; const ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); override; + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; override; + function GetDockedBarControlClass: TdxBarControlClass; override; + function GetPainter: TdxBarPainter; override; + function GetViewInfoClass: TdxRibbonGroupsDockControlViewInfoClass; virtual; + function IsMultiRow: Boolean; override; + procedure MakeRectFullyVisible(const R: TRect); virtual; + procedure Paint; override; + procedure SetSize; override; + procedure ShowCustomizePopup; override; + procedure UpdateGroupPositions; + procedure VisibleChanged; override; + + property Ribbon: TdxCustomRibbon read GetRibbon; + property ViewInfo: TdxRibbonGroupsDockControlViewInfo read FViewInfo; + public + constructor Create(ATab: TdxRibbonTab); reintroduce; virtual; + destructor Destroy; override; + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; + + property Tab: TdxRibbonTab read FTab; + end; + + { TdxRibbonGroupsDockControlViewInfo } + + TdxRibbonGroupsDockControlViewInfo = class + private + FPrevGroupCollapsedStates: array of Boolean; + FScrollButtons: TdxRibbonScrollButtons; + FScrollPosition: Integer; + procedure CheckGroupCollapsedStates; + function GetFirstGroupPosition: Integer; + function GetGroupCount: Integer; + function GetGroupViewInfo(AIndex: Integer): TdxRibbonGroupBarControlViewInfo; + function IsValidToolbar(AToolbar: TdxBar): Boolean; + procedure SaveGroupCollapsedStates; + function TotalGroupsWidth: Integer; + function TryPlaceGroups(AMaxContentWidth: Integer): Boolean; + protected + FDockControl: TdxRibbonGroupsDockControl; + procedure CalculateGroupsScrollInfo(AMaxContentWidth: Integer); virtual; + procedure InternalScrollGroups(ADelta: Integer; AMaxContentWidth: Integer); virtual; + public + constructor Create(ADockControl: TdxRibbonGroupsDockControl); virtual; + procedure Calculate(const ABoundsRect: TRect); virtual; + procedure ResetScrollInfo; + procedure ScrollGroups(AScrollLeft: Boolean; AMaxContentWidth: Integer); virtual; + property DockControl: TdxRibbonGroupsDockControl read FDockControl; + property FirstGroupPosition: Integer read GetFirstGroupPosition; + property GroupCount: Integer read GetGroupCount; + property GroupViewInfos[AIndex: Integer]: TdxRibbonGroupBarControlViewInfo read GetGroupViewInfo; + property ScrollButtons: TdxRibbonScrollButtons read FScrollButtons; + end; + + { TdxRibbonTabGroupsPopupWindow } + + TdxRibbonTabGroupsPopupWindow = class(TcxCustomPopupWindow) + private + FRibbon: TdxCustomRibbon; + FShadow: TdxBarShadow; + function GetBounds: TRect; + function GetGroupsDockControlSite: TdxRibbonGroupsDockControlSite; + procedure WMNCPaint(var Message: TMessage); message WM_NCPAINT; + procedure WMSize(var Message: TWMSize); message WM_SIZE; + protected + function CalculatePosition: TPoint; override; + procedure CalculateSize; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure DoClosed; override; + procedure DoShowed; override; + procedure DoShowing; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + function NeedIgnoreMouseMessageAfterCloseUp(AWnd: THandle; AMsg: Cardinal; + AShift: TShiftState; const APos: TPoint): Boolean; override; + procedure HandleNavigationKey(AKey: Word); + procedure SetGroupsDockControlSite; + public + constructor Create(ARibbon: TdxCustomRibbon); reintroduce; virtual; + destructor Destroy; override; + property GroupsDockControlSite: TdxRibbonGroupsDockControlSite + read GetGroupsDockControlSite; + property Ribbon: TdxCustomRibbon read FRibbon; + end; + + { TdxRibbonCustomBarControl } + + TdxRibbonPopupMenuItem = (rpmiItems, rpmiMoreCommands, rpmiQATPosition, + rpmiQATAddRemoveItem, rpmiMinimizeRibbon); + TdxRibbonPopupMenuItems = set of TdxRibbonPopupMenuItem; + + TdxRibbonCustomBarControl = class(TdxBarControl) + private + function GetQuickAccessToolbar: TdxRibbonQuickAccessToolbar; + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + protected + function AllowQuickCustomizing: Boolean; override; + function CanAlignControl(AControl: TdxBarItemControl): Boolean; override; + function CanMoving: Boolean; override; + function GetBehaviorOptions: TdxBarBehaviorOptions; override; + function GetEditFont: TFont; override; + function GetFont: TFont; override; + function GetFullItemRect(Item: TdxBarItemControl): TRect; override; + function GetIsMainMenu: Boolean; override; + function GetMultiLine: Boolean; override; + function GetRibbon: TdxCustomRibbon; virtual; abstract; + function HasCloseButton: Boolean; override; + function MarkExists: Boolean; override; + function NotHandleMouseMove(ACheckLastMousePos: Boolean = True): Boolean; override; + function RealMDIButtonsOnBar: Boolean; override; + // + function ClickAtHeader: Boolean; virtual; + procedure DoPopupMenuClick(Sender: TObject); virtual; + function GetPopupMenuItems: TdxRibbonPopupMenuItems; virtual; + procedure InitCustomizationPopup(AItemLinks: TdxBarItemLinks); override; + procedure PopupMenuClick(Sender: TObject); + procedure ShowPopup(AItem: TdxBarItemControl); override; + // + property QuickAccessToolbar: TdxRibbonQuickAccessToolbar read GetQuickAccessToolbar; + public + constructor CreateEx(AOwner: TComponent; ABar: TdxBar); override; + property Ribbon: TdxCustomRibbon read GetRibbon; + end; + + { TdxRibbonQuickAccessBarControl } + + TdxRibbonQuickAccessBarControl = class(TdxRibbonCustomBarControl) + private + FBitmap: TcxBitmap; + FDefaultGlyph: TBitmap; + FIsWindowCreation: Boolean; + FInternalItems: TComponentList; + function GetSeparatorWidth(AItemControl: TdxBarItemControl): Integer; + function GetViewInfo: TdxRibbonQuickAccessBarControlViewInfo; + procedure WMPaint(var Message: TWMPaint); message WM_PAINT; + {$IFNDEF DELPHI7} + procedure WMPrintClient(var Message: TWMPrintClient); message WM_PRINTCLIENT; + {$ENDIF} + protected + function AllItemsVisible: Boolean; + procedure CalcControlsPositions; override; + function CanHideAllItemsInSingleLine: Boolean; override; + procedure CreateWnd; override; + procedure DoPaintItem(AControl: TdxBarItemControl; ACanvas: TcxCanvas; const AItemRect: TRect); override; + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; override; + function GetClientOffset: TRect; virtual; + function GetDefaultItemGlyph: TBitmap; override; + function GetItemControlDefaultViewLevel( + AItemControl: TdxBarItemControl): TdxBarItemViewLevel; override; + function GetMarkAccessibilityHelperClass: TdxBarAccessibilityHelperClass; override; + function GetMarkSize: Integer; override; + function GetMinHeight(AStyle: TdxBarDockingStyle): Integer; override; + function GetMinWidth(AStyle: TdxBarDockingStyle): Integer; override; + function GetPopupMenuItems: TdxRibbonPopupMenuItems; override; + function GetQuickControlClass: TdxBarControlClass; override; + function GetRibbon: TdxCustomRibbon; override; + function GetSize(AMaxWidth: Integer): TSize; + function GetSizeForWidth(AStyle: TdxBarDockingStyle; AWidth: Integer): TPoint; override; + function GetViewInfoClass: TCustomdxBarControlViewInfoClass; override; + + function AllowQuickCustomizing: Boolean; override; + procedure InitQuickCustomizeItemLinks(AQuickControlItemLinks: TdxBarItemLinks); override; + procedure InitAddRemoveSubItemPopup(AItemLinks: TdxBarItemLinks); override; + + procedure InitCustomizationPopup(AItemLinks: TdxBarItemLinks); override; + function MarkExists: Boolean; override; + procedure RemoveItemFromQAT; + procedure ShowPopup(AItem: TdxBarItemControl); override; + procedure UpdateDefaultGlyph(AGlyph: TBitmap); virtual; + procedure UpdateDoubleBuffered; override; + + property ViewInfo: TdxRibbonQuickAccessBarControlViewInfo read GetViewInfo; + public + constructor CreateEx(AOwner: TComponent; ABar: TdxBar); override; + destructor Destroy; override; + function IsOnGlass: Boolean; override; + end; + + { TdxRibbonQuickAccessBarControlViewInfo } + + TdxRibbonQuickAccessBarControlViewInfo = class(TdxBarControlViewInfo) + protected + function CanShowSeparators: Boolean; override; + function IsLastVisibleItemControl(AItemControl: TdxBarItemControl): Boolean; override; + end; + + { TdxRibbonQuickAccessItemControlPainter } + + TdxRibbonQuickAccessPainter = class(TdxRibbonBarPainter) + protected + procedure BarDrawMarkBackground(ABarControl: TdxBarControl; DC: HDC; + ItemRect: TRect; AToolbarBrush: HBRUSH); override; + procedure DrawGroupButtonControl(ADrawParams: TdxBarButtonLikeControlDrawParams; + const ARect: TRect); virtual; + procedure DrawToolbarContentPart(ABarControl: TdxBarControl; ACanvas: TcxCanvas); override; + function MarkButtonWidth: Integer; virtual; + public + function BarMarkRect(ABarControl: TdxBarControl): TRect; override; + function BarMarkItemRect(ABarControl: TdxBarControl): TRect; override; + procedure ComboControlDrawArrowButton( + const ADrawParams: TdxBarEditLikeControlDrawParams; ARect: TRect; AInClientArea: Boolean); override; + function GetToolbarContentOffsets(ABar: TdxBar; + ADockingStyle: TdxBarDockingStyle; AHasSizeGrip: Boolean): TRect; override; + function MarkButtonOffset: Integer; virtual; + function MarkSizeX(ABarControl: TdxBarControl): Integer; override; + end; + + { TdxRibbonQuickAccessDockControl } + + TdxRibbonQuickAccessDockControl = class(TdxCustomRibbonDockControl) + private + FPainter: TdxRibbonQuickAccessPainter; + FRibbon: TdxCustomRibbon; + protected + procedure CalcLayout; override; + function GetDockedBarControlClass: TdxBarControlClass; override; + function GetPainter: TdxBarPainter; override; + procedure VisibleChanged; override; + public + constructor Create(AOwner: TdxCustomRibbon); reintroduce; virtual; + destructor Destroy; override; + property Ribbon: TdxCustomRibbon read FRibbon; + end; + + { TdxRibbonQuickAccessBarControlDesignHelper } + + TdxRibbonQuickAccessBarControlDesignHelper = class(TCustomdxBarControlDesignHelper) + public + class procedure GetEditors(AEditors: TList); override; + class function GetForbiddenActions: TdxBarCustomizationActions; override; + end; + + { TdxRibbonQuickAccessPopupBarControl } + + TdxRibbonQuickAccessPopupBarControl = class(TdxRibbonQuickAccessBarControl) + private + FPainter: TdxBarPainter; + function GetQuickAccessBarControl: TdxRibbonQuickAccessBarControl; + function GetMarkLink: TdxBarItemLink; + function GetMarkSubItem: TCustomdxBarSubItem; + protected + function GetClientOffset: TRect; override; + function GetPainter: TdxBarPainter; override; + function GetRibbon: TdxCustomRibbon; override; + function GetSizeForPopup: TSize; override; + function HasShadow: Boolean; override; + function IsPopup: Boolean; override; + property QuickAccessBarControl: TdxRibbonQuickAccessBarControl + read GetQuickAccessBarControl; + public + constructor CreateEx(AOwner: TComponent; ABar: TdxBar); override; + destructor Destroy; override; + procedure CloseUp; override; + procedure Popup(const AOwnerRect: TRect); override; + end; + + { TdxRibbonQuickAccessPopupItemControlPainter } + + TdxRibbonQuickAccessPopupPainter = class(TdxRibbonQuickAccessPainter) + protected + procedure DrawQuickAccessPopupSubItem(DC: HDC; const ARect: TRect; + AState: Integer); virtual; + procedure DrawToolbarContentPart(ABarControl: TdxBarControl; ACanvas: TcxCanvas); override; + public + function MarkButtonOffset: Integer; override; + function MarkSizeX(ABarControl: TdxBarControl): Integer; override; + end; + + { TdxRibbonQuickAccessPopupSubItem } + + TdxRibbonQuickAccessPopupSubItem = class(TdxBarSubItem) + protected + function CreateBarControl: TCustomdxBarControl; override; + end; + + TdxRibbonQuickAccessPopupSubMenuControl = class(TdxBarSubMenuControl) + protected + procedure ShowPopup(AItem: TdxBarItemControl); override; + end; + + { TdxRibbonQuickAccessPopupSubItemControl } + + TdxRibbonQuickAccessPopupSubItemControl = class(TdxBarSubItemControl) + protected + procedure DoCloseUp(AHadSubMenuControl: Boolean); override; + procedure DoPaint(ARect: TRect; PaintType: TdxBarPaintType); override; + function GetDefaultWidth: Integer; override; + end; + + { TdxRibbonQuickAccessPopupSubItemButton } + + TdxRibbonQuickAccessPopupSubItemButton = class(TdxBarButton) + public + procedure DoClick; override; + end; + + { TdxRibbonQuickAccessPopupSubItemButtonControl } + + TdxRibbonQuickAccessPopupSubItemButtonControl = class(TdxBarButtonControl) + end; + + { TdxRibbonGroupBarControl } + + TdxRibbonGroupBarControl = class(TdxRibbonCustomBarControl, + {$IFNDEF DELPHI6} + IUnknown, + {$ENDIF} + IdxFadingObject + ) + private + FGroup: TdxRibbonTabGroup; + FRibbon: TdxCustomRibbon; + procedure DesignMenuClick(Sender: TObject); + procedure DrawBarParentBackground(ACanvas: TcxCanvas); + procedure DrawCaptionButtons(ACanvas: TcxCanvas); + procedure DrawSelectedFrame(DC: HDC); + procedure FillParentBackground; + function GetCollapsed: Boolean; + function GetGroupDesignRect: TRect; + function GetViewInfo: TdxRibbonGroupBarControlViewInfo; + procedure PaintGroupMark(ACanvas: TcxCanvas); + procedure InitDesignMenu(AItemLinks: TdxBarItemLinks); + procedure ShowGroupDesignMenu; + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + procedure WMPaint(var Message: TWMPaint); message WM_PAINT; + protected + //IdxFadingObject + function IdxFadingObject.CanFade = FadingCanFade; + procedure IdxFadingObject.DrawBitmap = FadingDrawBitmap; + procedure IdxFadingObject.GetFadingParams = FadingGetFadingParams; + function FadingCanFade: Boolean; + procedure FadingDrawBitmap(ABitmap: TBitmap); + procedure FadingGetFadingParams(out AFadeOutImage, AFadeInImage: TBitmap; + var AFadeInStageCount, AFadeInStageInterval, + AFadeOutStageCount, AFadeOutStageInterval: Integer); + //methods + procedure AdjustHintWindowPosition(var APos: TPoint; const ABoundsRect: TRect; AHeight: Integer); override; + procedure CalcLayout; override; + function CanProcessShortCut: Boolean; override; + procedure CaptionChanged; override; + procedure DoHideAll; override; + procedure DoNCPaint(DC: HDC); override; + procedure DoOpaqueNCPaint(DC: HDC); + procedure DoTransparentNCPaint(DC: HDC); + procedure DoPaint; override; + + procedure DoBarMouseDown(Button: TMouseButton; Shift: TShiftState; + const APoint: TPoint; AItemControl: TdxBarItemControl; APointInClientRect: Boolean); override; + + function ClickAtHeader: Boolean; override; + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; override; + function GetMarkDrawState: TdxBarMarkState; override; + function GetMoreButtonsHint: string; override; + function GetQuickControlClass: TdxBarControlClass; override; + function GetRibbon: TdxCustomRibbon; override; + function GetViewInfoClass: TCustomdxBarControlViewInfoClass; override; + procedure GlyphChanged; override; + procedure InitQuickControl(AQuickControlItemLinks: TdxBarItemLinks); override; + procedure MakeItemControlFullyVisible(AItemControl: TdxBarItemControl); override; + function MarkExists: Boolean; override; + procedure ViewStateChanged(APrevValue: TdxBarViewState); override; + procedure UpdateCaptionButtons(ACaptionButton: TdxBarCaptionButton); override; + + property ViewInfo: TdxRibbonGroupBarControlViewInfo read GetViewInfo; + public + constructor CreateEx(AOwner: TComponent; ABar: TdxBar); override; + destructor Destroy; override; + procedure CloseUp; override; + property Collapsed: Boolean read GetCollapsed; + property Group: TdxRibbonTabGroup read FGroup; + end; + + TdxRibbonGroupKeyTipsBaseLinePositions = record + BottomKeyTipsBaseLinePosition: Integer; + Calculated: Boolean; + RowKeyTipsBaseLinePositions: array of Integer; + end; + + { TdxRibbonGroupBarControlViewInfo } + + TdxRibbonGroupBarControlViewInfo = class(TCustomdxBarControlViewInfo) + private + FCollapsed: Boolean; + FContentSize: TSize; + FGroupRowHeight: Integer; + FKeyTipsBaseLinePositions: TdxRibbonGroupKeyTipsBaseLinePositions; + FLayoutCalculator: IdxRibbonGroupLayoutCalculator; + FNonContentAreaSize: TSize; + function CreateCalculateHelper: IdxRibbonGroupViewInfo; + function GetBarControl: TdxRibbonGroupBarControl; + function GetBottomKeyTipsBaseLinePosition: Integer; + function GetRowKeyTipsBaseLinePosition(ARowIndex: Integer): Integer; + function GetSize: TSize; + protected + procedure CalculateKeyTipsBaseLinePositions; + function CreateLayoutCalculator: IdxRibbonGroupLayoutCalculator; virtual; + procedure DoCalculateKeyTipsBaseLinePositions; virtual; + function GetNonContentAreaSize: TSize; virtual; + procedure UpdateItemRects; + property ContentSize: TSize read FContentSize write FContentSize; + property LayoutCalculator: IdxRibbonGroupLayoutCalculator read FLayoutCalculator; + public + procedure Calculate; override; + procedure CalculateFinalize; virtual; + procedure CalculateInit; virtual; + function CollapseMultiColumnItemControls: Boolean; + function DecreaseMultiColumnItemControlsColumnCount: Boolean; + function Reduce(AUpToViewLevel: TdxBarItemRealViewLevel): Boolean; + procedure ReduceInit; + property BarControl: TdxRibbonGroupBarControl read GetBarControl; + property Collapsed: Boolean read FCollapsed write FCollapsed; + property Size: TSize read GetSize; + + property BottomKeyTipsBaseLinePosition: Integer read GetBottomKeyTipsBaseLinePosition; + property RowKeyTipsBaseLinePositions[ARowIndex: Integer]: Integer + read GetRowKeyTipsBaseLinePosition; + end; + + { TdxRibbonGroupBarControlDesignHelper } + + TdxRibbonGroupBarControlDesignHelper = class(TCustomdxBarControlDesignHelper) + public + class function GetForbiddenActions: TdxBarCustomizationActions; override; + end; + + { TdxRibbonCollapsedGroupPopupBarControl } + + TdxRibbonCollapsedGroupPopupBarControl = class(TdxRibbonGroupBarControl) + protected + function GetCaption: TCaption; override; + function GetPainter: TdxBarPainter; override; + function GetSizeForPopup: TSize; override; + function IgnoreClickAreaWhenHidePopup: TRect; override; + function IsPopup: Boolean; override; + function NeedHideOnNCMouseClick: Boolean; override; + public + constructor CreateForPopup(AParentBarControl: TdxBarControl; + AOwnerBar: TdxBar); override; + destructor Destroy; override; + procedure Hide; override; + procedure Popup(const AOwnerRect: TRect); override; + end; + + { TdxRibbonTabGroup } + + TdxRibbonTabGroupClass = class of TdxRibbonTabGroup; + + TdxRibbonTabGroup = class(TCollectionItem, + IUnknown, + IdxBarSelectableItem + ) + private + FCanCollapse: Boolean; + FDesignSelectionHelper: IdxBarSelectableItem; + FLoadedToolbarName: string; + FToolbar: TdxBar; + procedure CheckUndockToolbar; + function GetTab: TdxRibbonTab; + function GetToolbar: TdxBar; + procedure ReadToolbarName(AReader: TReader); + procedure SetCanCollapse(Value: Boolean); + procedure SetToolbar(Value: TdxBar); + procedure ValidateToolbar(Value: TdxBar); + procedure WriteToolbarName(AWriter: TWriter); + protected + procedure DefineProperties(Filer: TFiler); override; + procedure DockToolbar(AToolbar: TdxBar); virtual; + function IsToolbarAcceptable(AToolbar: TdxBar): Boolean; + procedure UpdateBarManager(ABarManager: TdxBarManager); + procedure UpdateToolbarValue; + + property DesignSelectionHelper: IdxBarSelectableItem + read FDesignSelectionHelper implements IdxBarSelectableItem; + property Unknown: IdxBarSelectableItem + read FDesignSelectionHelper implements IUnknown; + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + property Tab: TdxRibbonTab read GetTab; + published + property CanCollapse: Boolean read FCanCollapse write SetCanCollapse default True; + property ToolBar: TdxBar read GetToolbar write SetToolbar stored False; + end; + + TdxRibbonTabGroups = class(TCollection) + private + FTab: TdxRibbonTab; + function GetItem(Index: Integer): TdxRibbonTabGroup; + procedure SetItem(Index: Integer; const Value: TdxRibbonTabGroup); + protected + function GetOwner: TPersistent; override; + {$IFDEF DELPHI6} + procedure Notify(Item: TCollectionItem; Action: TCollectionNotification); override; + {$ENDIF} + procedure Update(Item: TCollectionItem); override; + procedure UpdateGroupToolbarValues; + public + constructor Create(ATab: TdxRibbonTab); + function Add: TdxRibbonTabGroup; + property Tab: TdxRibbonTab read FTab; + property Items[Index: Integer]: TdxRibbonTabGroup read GetItem write SetItem; default; + end; + + { TdxRibbonQuickAccessToolbar } + + TdxQuickAccessToolbarPosition = (qtpAboveRibbon, qtpBelowRibbon); + + TdxRibbonQuickAccessToolbar = class(TPersistent) + private + FDockControl: TdxRibbonQuickAccessDockControl; + FRibbon: TdxCustomRibbon; + FVisible: Boolean; + FToolbar: TdxBar; + FPosition: TdxQuickAccessToolbarPosition; + procedure CheckUndockGroupToolbar(const Value: TdxBar); + procedure SetPosition(const Value: TdxQuickAccessToolbarPosition); + procedure SetToolbar(const Value: TdxBar); + procedure SetVisible(const Value: Boolean); + protected + function Contains(AItemLink: TdxBarItemLink): Boolean; + + function CreateDockControl: TdxRibbonQuickAccessDockControl; virtual; + function GetMenuItemsForMark: TdxRibbonPopupMenuItems; virtual; + procedure UpdateColorScheme; virtual; + procedure UpdateGroupButton(AForToolbar: TdxBar; ABeforeUndock: Boolean); + procedure UpdateMenuItems(AItems: TdxBarItemLinks); + procedure UpdateRibbon; + + property DockControl: TdxRibbonQuickAccessDockControl read FDockControl; + public + constructor Create(ARibbon: TdxCustomRibbon); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function HasGroupButtonForToolbar(AToolbar: TdxBar): Boolean; + + property Ribbon: TdxCustomRibbon read FRibbon; + published + property Position: TdxQuickAccessToolbarPosition read FPosition write SetPosition default qtpAboveRibbon; + property Toolbar: TdxBar read FToolbar write SetToolbar; + property Visible: Boolean read FVisible write SetVisible default True; + end; + + { TdxRibbonApplicationButton } + + TdxRibbonApplicationButton = class(TPersistent) + private + FGlyph: TBitmap; + FIAccessibilityHelper: IdxBarAccessibilityHelper; + FKeyTip: string; + FMenu: TdxBarApplicationMenu; + FRibbon: TdxCustomRibbon; + FScreenTip: TdxBarScreenTip; + FStretchGlyph: Boolean; + FVisible: Boolean; + function GetIAccessibilityHelper: IdxBarAccessibilityHelper; + procedure GlyphChanged(Sender: TObject); + procedure SetGlyph(const Value: TBitmap); + procedure SetMenu(const Value: TdxBarApplicationMenu); + procedure SetVisible(const Value: Boolean); + procedure SetScreenTip(const Value: TdxBarScreenTip); + procedure SetStretchGlyph(const Value: Boolean); + protected + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; virtual; + procedure Update; + + property IAccessibilityHelper: IdxBarAccessibilityHelper read GetIAccessibilityHelper; + public + constructor Create(ARibbon: TdxCustomRibbon); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + property Ribbon: TdxCustomRibbon read FRibbon; + published + property Glyph: TBitmap read FGlyph write SetGlyph; + property KeyTip: string read FKeyTip write FKeyTip; + property Menu: TdxBarApplicationMenu read FMenu write SetMenu; + property ScreenTip: TdxBarScreenTip read FScreenTip write SetScreenTip; + property StretchGlyph: Boolean read FStretchGlyph write SetStretchGlyph default True; + property Visible: Boolean read FVisible write SetVisible default True; + end; + + { TdxRibbonTab } + + TdxRibbonTabClass = class of TdxRibbonTab; + + TdxRibbonTab = class( + TcxComponentCollectionItem, + {$IFNDEF DELPHI6} + IUnknown, + {$ENDIF} + IdxBarSelectableItem, + IdxFadingObject + ) + private + FCaption: string; + FDesignSelectionHelper: IdxBarSelectableItem; + FDockControl: TdxRibbonGroupsDockControl; + FIAccessibilityHelper: IdxBarAccessibilityHelper; + FKeyTip: string; + FLastIndex: Integer; + FLocked: Boolean; + FRibbon: TdxCustomRibbon; + FGroups: TdxRibbonTabGroups; + FVisible: Boolean; + function CanFade: Boolean; + function GetActive: Boolean; + function GetFocused: Boolean; + function GetHighlighted: Boolean; + function GetIAccessibilityHelper: IdxBarAccessibilityHelper; + function GetViewInfo: TdxRibbonTabViewInfo; + function GetVisibleIndex: Integer; + procedure SetActive(Value: Boolean); + procedure SetCaption(const Value: string); + procedure SetHighlighted(Value: Boolean); + procedure SetRibbon(Value: TdxCustomRibbon); + procedure SetGroups(const Value: TdxRibbonTabGroups); + procedure SetVisible(Value: Boolean); + protected + //IdxFadingObject + procedure IdxFadingObject.DrawBitmap = FadingDrawBitmap; + procedure IdxFadingObject.GetFadingParams = FadingGetFadingParams; + procedure FadingDrawBitmap(ABitmap: TBitmap); + procedure FadingGetFadingParams(out AFadeOutImage, AFadeInImage: TBitmap; + var AFadeInStageCount, AFadeInStageInterval, + AFadeOutStageCount, AFadeOutStageInterval: Integer); + //inherited + function GetCollectionFromParent(AParent: TComponent): TcxComponentCollection; override; + function GetDisplayName: string; override; + procedure Loaded; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure SetName(const Value: TComponentName); override; + //methods + procedure Activate; virtual; + procedure CheckGroupToolbarsDockControl; + procedure Deactivate; virtual; + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; virtual; + function GetDockControlBounds: TRect; virtual; + function GetGroupClass: TdxRibbonTabGroupClass; virtual; + procedure ScrollDockControlGroups(AScrollLeft, AOnTimer: Boolean); + procedure UpdateBarManager(ABarManager: TdxBarManager); + procedure UpdateColorScheme; virtual; + procedure UpdateDockControl; + procedure UpdateDockControlBounds; + procedure UpdateGroupsFont; + + property DesignSelectionHelper: IdxBarSelectableItem + read FDesignSelectionHelper implements IdxBarSelectableItem; + property Focused: Boolean read GetFocused; + property Highlighted: Boolean read GetHighlighted write SetHighlighted; + property LastIndex: Integer read FLastIndex; + property Locked: Boolean read FLocked; + property ViewInfo: TdxRibbonTabViewInfo read GetViewInfo; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure AddToolBar(AToolBar: TdxBar); + procedure Invalidate; + procedure MakeVisible; + + property DockControl: TdxRibbonGroupsDockControl read FDockControl; + property IAccessibilityHelper: IdxBarAccessibilityHelper read GetIAccessibilityHelper; + property Ribbon: TdxCustomRibbon read FRibbon write SetRibbon; + published + property Active: Boolean read GetActive write SetActive default False;//stored False; + property Caption: string read FCaption write SetCaption; + property Groups: TdxRibbonTabGroups read FGroups write SetGroups; + property KeyTip: string read FKeyTip write FKeyTip; + property Visible: Boolean read FVisible write SetVisible default True; + property VisibleIndex: Integer read GetVisibleIndex; + end; + + TdxRibbonTabCollection = class(TcxComponentCollection) + private + FIAccessibilityHelper: IdxBarAccessibilityHelper; + FOwner: TdxCustomRibbon; + function GetIAccessibilityHelper: IdxBarAccessibilityHelper; + function GetItem(Index: Integer): TdxRibbonTab; + procedure SetItem(Index: Integer; const Value: TdxRibbonTab); + protected + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; virtual; + procedure Notify(AItem: TcxComponentCollectionItem; + AAction: TcxComponentCollectionNotification); override; + procedure SetItemName(AItem: TcxComponentCollectionItem); override; + procedure Update(AItem: TcxComponentCollectionItem; + AAction: TcxComponentCollectionNotification); override; + procedure UpdateBarManager(ABarManager: TdxBarManager); + + property IAccessibilityHelper: IdxBarAccessibilityHelper read GetIAccessibilityHelper; + property Owner: TdxCustomRibbon read FOwner; + public + constructor Create(AOwner: TdxCustomRibbon); reintroduce; + destructor Destroy; override; + function Add: TdxRibbonTab; + + function Insert(AIndex: Integer): TdxRibbonTab; + property Items[Index: Integer]: TdxRibbonTab read GetItem write SetItem; default; + end; + + { TdxRibbonFonts } + + TdxRibbonAssignedFont = (afTabHeader, afGroup, afGroupHeader); + TdxRibbonAssignedFonts = set of TdxRibbonAssignedFont; + + TdxRibbonFonts = class(TPersistent) + private + FAssignedFonts: TdxRibbonAssignedFonts; + FDocumentNameColor: TColor; + FCaptionFont: TFont; + FFont: TFont; + FFonts: array[TdxRibbonAssignedFont] of TFont; + FLocked: Boolean; + FRibbon: TdxCustomRibbon; + procedure FontChanged(Sender: TObject); + function GetDefaultCaptionTextColor(AIsActive: Boolean): TColor; + function GetFont(const Index: Integer): TFont; + function IsFontStored(const Index: Integer): Boolean; + procedure SetAssignedFonts(const Value: TdxRibbonAssignedFonts); + procedure SetDocumentNameColor(const Value: TColor); + procedure SetFont(const Index: Integer; const Value: TFont); + procedure UpdateGroupsFont; + protected + procedure Invalidate; + procedure UpdateDefaultFont(I: TdxRibbonAssignedFont); + procedure UpdateFonts; + property Locked: Boolean read FLocked; + public + constructor Create(AOwner: TdxCustomRibbon); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + function GetFormCaptionFont(AIsActive: Boolean): TFont; virtual; + function GetGroupFont: TFont; virtual; + function GetGroupHeaderFont: TFont; virtual; + function GetTabHeaderFont(AState: Integer): TFont; virtual; + + property Ribbon: TdxCustomRibbon read FRibbon; + published + property AssignedFonts: TdxRibbonAssignedFonts + read FAssignedFonts write SetAssignedFonts default []; + property DocumentNameColor: TColor + read FDocumentNameColor write SetDocumentNameColor default clDefault; + property Group: TFont index Ord(afGroup) + read GetFont write SetFont stored IsFontStored; + property GroupHeader: TFont index Ord(afGroupHeader) + read GetFont write SetFont stored IsFontStored; + property TabHeader: TFont index Ord(afTabHeader) + read GetFont write SetFont stored IsFontStored; + end; + + { TdxRibbonPopupMenu } + + TdxRibbonPopupMenu = class(TdxBarPopupMenu) + private + FRibbon: TdxCustomRibbon; + procedure CheckAssignRibbon; + procedure SetRibbon(Value: TdxCustomRibbon); + protected + function CreateBarControl: TCustomdxBarControl; override; + function GetControlClass: TCustomdxBarControlClass; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + public + constructor Create(AOwner: TComponent); override; + published + property Ribbon: TdxCustomRibbon read FRibbon write SetRibbon; + end; + + { TdxRibbonPopupMenuControl } + + TdxRibbonPopupMenuControl = class(TdxBarSubMenuControl) + protected + function GetBehaviorOptions: TdxBarBehaviorOptions; override; + end; + + { TdxBarApplicationMenu } + + TdxBarApplicationMenu = class(TdxBarCustomApplicationMenu) + protected + function GetControlClass: TCustomdxBarControlClass; override; + published + property BackgroundBitmap; + property BarManager; + property BarSize; + property Buttons; + property ExtraPane; + property ExtraPaneEvents; + property Font; + property ItemLinks; + property ItemOptions; + property UseOwnFont; + + property OnCloseUp; + property OnPaintBar; + property OnPopup; + + // obsolette + property ExtraPaneWidthRatio stored False; + property ExtraPaneSize stored False; + property ExtraPaneItems stored False; + property ExtraPaneHeader stored False; + property OnExtraPaneItemClick stored False; + end; + + TdxRibbonApplicationMenuControl = class(TdxBarApplicationMenuControl) + private + function GetRibbon: TdxCustomRibbon; + procedure DoPopupMenuClick(Sender: TObject); + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + protected + function GetBehaviorOptions: TdxBarBehaviorOptions; override; + procedure InitCustomizationPopup(AItemLinks: TdxBarItemLinks); override; + + function GetPopupMenuItems: TdxRibbonPopupMenuItems; + procedure PopupMenuClick(Sender: TObject); + property Ribbon: TdxCustomRibbon read GetRibbon; + end; + + { TdxRibbonController } + + TdxRibbonController = class(TcxIUnknownObject, IdxBarHintKeeper) + private + FRibbon: TdxCustomRibbon; + FHotObject: TdxRibbonHitTest; + FPressedObject: TdxRibbonHitTest; + FScrollKind: TdxRibbonHitTest; + FScrollTimer: TTimer; + FHintInfo: TdxRibbonHitInfo; + procedure CancelScroll; + function CanProcessDesignTime: Boolean; + procedure ClearHintInfo; + procedure CreateTimer; + function GetViewInfo: TdxRibbonViewInfo; + procedure Invalidate(AOld, ANew: TdxRibbonHitTest); + procedure InvalidateScrollButtons; + procedure InvalidateButtons; + procedure OnTimer(Sender: TObject); + procedure StartScroll(AScrollKind: TdxRibbonHitTest); + procedure SetHintInfo(const Value: TdxRibbonHitInfo); + procedure SetHotObject(const Value: TdxRibbonHitTest); + procedure SetPressedObject(const Value: TdxRibbonHitTest); + protected + // IdxBarHintKeeper + function DoHint(var ANeedDeactivate: Boolean; out AHintText: string; out AShortCut: string): Boolean; + function CreateHintViewInfo(const AHintText, AShortCut: string): TdxBarCustomHintViewInfo; + function GetEnabled: Boolean; + function GetHintPosition(const ACursorPos: TPoint; AHeight: Integer): TPoint; + + procedure CancelHint; + procedure CancelMode; virtual; + procedure CheckButtonsMouseUp(X: Integer; Y: Integer); + procedure DesignTabMenuClick(Sender: TObject); + procedure DoScroll(AOnTimer: Boolean); + procedure HideHint; virtual; + procedure InitTabDesignMenu(AItemLinks: TdxBarItemLinks); virtual; + function IsApplicationMenuDropped: Boolean; + function IsNeedShowHint(AObject: TdxRibbonHitTest): Boolean; virtual; + function IsOwnerForHintObject(AObject: TdxRibbonHitTest): Boolean; virtual; + procedure KeyDown(var Key: Word; Shift: TShiftState); virtual; + procedure KeyPress(var Key: Char); virtual; + procedure KeyUp(var Key: Word; Shift: TShiftState); virtual; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); virtual; + procedure MouseLeave; virtual; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); virtual; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); virtual; + function MouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean; virtual; + function MouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean; virtual; + function NotHandleMouseMove(P: TPoint): Boolean; virtual; + procedure ProcessTabClick(ATab: TdxRibbonTab; Button: TMouseButton; Shift: TShiftState); + procedure ScrollGroups(AScrollLeft, AOnTimer: Boolean); + procedure ScrollTabs(AScrollLeft, AOnTimer: Boolean); + procedure ShowTabDesignMenu; virtual; + property HintInfo: TdxRibbonHitInfo read FHintInfo write SetHintInfo; + property HotObject: TdxRibbonHitTest read FHotObject write SetHotObject; + property PressedObject: TdxRibbonHitTest read FPressedObject write SetPressedObject; + public + constructor Create(ARibbon: TdxCustomRibbon); virtual; + destructor Destroy; override; + function NextTab(ATab: TdxRibbonTab): TdxRibbonTab; + function PrevTab(ATab: TdxRibbonTab): TdxRibbonTab; + + property Ribbon: TdxCustomRibbon read FRibbon; + property ScrollKind: TdxRibbonHitTest read FScrollKind; + property ViewInfo: TdxRibbonViewInfo read GetViewInfo; + end; + + { TdxRibbonGroupsDockControlSiteViewInfo } + + TdxRibbonGroupsDockControlSiteViewInfo = class + private + FSite: TdxRibbonGroupsDockControlSite; + FTabGroupsScrollButtonBounds: array[TdxRibbonScrollButton] of TRect; + FTabGroupsScrollButtons: TdxRibbonScrollButtons; + function GetTabGroupsScrollButtonHot(AButton: TdxRibbonScrollButton): Boolean; + function GetTabGroupsScrollButtonPressed(AButton: TdxRibbonScrollButton): Boolean; + public + constructor Create(ASite: TdxRibbonGroupsDockControlSite); + procedure Calculate; + function GetHitInfo(var AHitInfo: TdxRibbonHitInfo; X, Y: Integer): Boolean; + procedure InvalidateScrollButtons; + procedure Paint(ACanvas: TcxCanvas); + property TabGroupsScrollButtons: TdxRibbonScrollButtons read FTabGroupsScrollButtons; + end; + + { TdxRibbonGroupsDockControlSite } + + TdxRibbonGroupsDockControlSite = class(TcxControl) + private + FRibbon: TdxCustomRibbon; + FViewInfo: TdxRibbonGroupsDockControlSiteViewInfo; + function GetDockControl: TdxRibbonGroupsDockControl; + protected + procedure AlignControls(AControl: TControl; var Rect: TRect); override; + procedure CreateParams(var Params: TCreateParams); override; + procedure DoCancelMode; override; + function DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean; override; + function DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean; override; + function MayFocus: Boolean; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseLeave(AControl: TControl); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + function NeedsScrollBars: Boolean; override; + procedure Paint; override; + property Ribbon: TdxCustomRibbon read FRibbon; + property DockControl: TdxRibbonGroupsDockControl read GetDockControl; + property ViewInfo: TdxRibbonGroupsDockControlSiteViewInfo read FViewInfo; + public + constructor Create(ARibbon: TdxCustomRibbon); reintroduce; + destructor Destroy; override; + function CanFocus: Boolean; override; + end; + + { TdxCustomRibbon } + + TdxRibbonEvent = procedure(Sender: TdxCustomRibbon) of object; + TdxRibbonApplicationMenuClickEvent = procedure (Sender: TdxCustomRibbon; + var AHandled: Boolean) of object; + TdxRibbonTabChangingEvent = procedure(Sender: TdxCustomRibbon; + ANewTab: TdxRibbonTab; var Allow: Boolean) of object; + TdxRibbonTabGroupNotifyEvent = procedure(Sender: TdxCustomRibbon; + ATab: TdxRibbonTab; AGroup: TdxRibbonTabGroup) of object; + TdxRibbonHideMinimizedByClickEvent = procedure(Sender: TdxCustomRibbon; + AWnd: THandle; AShift: TShiftState; const APos: TPoint; + var AAllowProcessing: Boolean) of object; + + TdxRibbonInternalState = (risCreating, risAppMenuActive); + TdxRibbonInternalStates = set of TdxRibbonInternalState; + + TdxCustomRibbon = class(TcxControl, + IdxSkin, + IdxRibbonFormNonClientPainter, + IdxRibbonFormNonClientDraw, + IdxFormKeyPreviewListener, + IdxBarAccessibleObject) + private + FActiveTab: TdxRibbonTab; + FApplicationButton: TdxRibbonApplicationButton; + FApplicationButtonPressed: Boolean; + FApplicationButtonState: TdxApplicationButtonState; + FBarManager: TdxBarManager; + FCalculatedFormCaptionHeight: Integer; + FColorScheme: TdxCustomRibbonSkin; + FColorSchemeHandlers: TcxEventHandlerCollection; + FController: TdxRibbonController; + FDocumentName: TCaption; + FFader: TdxFader; + FFading: Boolean; + FFonts: TdxRibbonFonts; + FFormCaptionHelper: TdxRibbonFormCaptionHelper; + FGroupsDockControlSite: TdxRibbonGroupsDockControlSite; + FGroupsPainter: TdxRibbonBarPainter; + FHelpButtonScreenTip: TdxBarScreenTip; + FHidden: Boolean; + FHighlightedTab: TdxRibbonTab; + FIAccessibilityHelper: IdxBarAccessibilityHelper; + FInternalItems: TComponentList; + FInternalState: TdxRibbonInternalStates; + FLockCount: Integer; + FLockModified: Boolean; + FPainter: TdxRibbonPainter; + FPopupMenuItems: TdxRibbonPopupMenuItems; + FPrevOnApplicationMenuPopup: TNotifyEvent; + FQuickAccessToolbar: TdxRibbonQuickAccessToolbar; + FRibbonFormNonClientPainters: TList; + FShowTabGroups: Boolean; + FShowTabHeaders: Boolean; + FSupportNonClientDrawing: Boolean; + FTabGroupsPopupWindow: TdxRibbonTabGroupsPopupWindow; + FTabs: TdxRibbonTabCollection; + FTabsLoaded: Boolean; + FViewInfo: TdxRibbonViewInfo; + FOnApplicationMenuClick: TdxRibbonApplicationMenuClickEvent; + FOnHelpButtonClick: TdxRibbonEvent; + FOnHideMinimizedByClick: TdxRibbonHideMinimizedByClickEvent; + FOnMoreCommandsExecute: TdxRibbonEvent; + FOnTabChanged: TdxRibbonEvent; + FOnTabChanging: TdxRibbonTabChangingEvent; + FOnTabGroupCollapsed: TdxRibbonTabGroupNotifyEvent; + FOnTabGroupExpanded: TdxRibbonTabGroupNotifyEvent; + procedure CalculateFormCaptionHeight; + procedure CheckDrawRibbonFormStatusBarBorders(ACanvas: TcxCanvas; + const AData: TdxRibbonFormData; const ABordersWidth: TRect); + procedure DrawApplicationMenuHeader(ADC: THandle; AIsClientArea: Boolean); + function GetApplicationButtonIAccessibilityHelper: IdxBarAccessibilityHelper; + function GetColorSchemeName: string; + function GetIAccessibilityHelper: IdxBarAccessibilityHelper; + function GetIniSection(const ADelimiter: string; const ASection: string): string; + function GetIsPopupGroupsMode: Boolean; + function GetNextActiveTab(ATab: TdxRibbonTab): TdxRibbonTab; + function GetQATIAccessibilityHelper: IdxBarAccessibilityHelper; + function GetRibbonForm: TdxCustomRibbonForm; + function GetStatusBarInterface: IdxRibbonFormStatusBarDraw; + function GetTabCount: Integer; + function GetTabsIAccessibilityHelper: IdxBarAccessibilityHelper; + function GetVisibleTab(Index: Integer): TdxRibbonTab; + function GetVisibleTabCount: Integer; + procedure InitCustomizePopupMenu(AItemLinks: TdxBarItemLinks); + procedure IniFileProceduresAdd; + procedure IniFileProceduresRemove; + procedure InitColorScheme; + procedure RibbonFormInvalidate; + procedure SetActiveTab(Value: TdxRibbonTab); + procedure SetApplicationButton(const Value: TdxRibbonApplicationButton); + procedure SetApplicationButtonState(const Value: TdxApplicationButtonState); + procedure SetBarManager(Value: TdxBarManager); + procedure SetColorScheme(const Value: TdxCustomRibbonSkin); + procedure SetColorSchemeName(const Value: string); + procedure SetDocumentName(const Value: TCaption); + procedure SetFading(const Value: Boolean); + procedure SetFonts(const Value: TdxRibbonFonts); + procedure SetHelpButtonScreenTip(const Value: TdxBarScreenTip); + procedure SetHighlightedTab(const Value: TdxRibbonTab); + procedure SetPopupMenuItems(const Value: TdxRibbonPopupMenuItems); + procedure SetQuickAccessToolbar(const Value: TdxRibbonQuickAccessToolbar); + procedure SetShowTabGroups(const Value: Boolean); + procedure SetShowTabHeaders(const Value: Boolean); + procedure SetSupportNonClientDrawing(const Value: Boolean); + procedure SetTabs(Value: TdxRibbonTabCollection); + procedure UpdateColorSchemeListeners; + procedure UpdateNonClientDrawing(const Value: Boolean); + procedure WMGetObject(var Message: TMessage); message WM_GETOBJECT; + procedure WMPaint(var Message: TWMPaint); message WM_PAINT; + procedure CMSelectAppMenuFirstItemControl(var Message: TMessage); + message CM_SELECTAPPMENUFIRSTITEMCONTROL; + procedure CMShowKeyTips(var Message: TMessage); message CM_SHOWKEYTIPS; + + procedure ApplicationMenuPopupNotification(Sender: TObject); + procedure BarManagerLoadIni(Sender: TObject; const AEventArgs); + procedure BarManagerSaveIni(Sender: TObject; const AEventArgs); + + procedure MDIStateChanged(Sender: TObject; const AEventArgs); + procedure SystemFontChanged(Sender: TObject; const AEventArgs); + procedure UpdateColorScheme; + protected + //IdxRibbonFormNonClientPainter + procedure DrawRibbonFormCaption(ACanvas: TcxCanvas; const ABounds: TRect; + const ACaption: string; const AData: TdxRibbonFormData); + procedure DrawRibbonFormBorderIcon(ACanvas: TcxCanvas; const ABounds: TRect; + AIcon: TdxBorderDrawIcon; AState: TdxBorderIconState); + procedure DrawRibbonFormBorders(ACanvas: TcxCanvas; + const AData: TdxRibbonFormData; const ABordersWidth: TRect); + function GetRibbonApplicationButtonRegion: HRGN; + function GetRibbonFormCaptionHeight: Integer; virtual; + function GetRibbonFormColor: TColor; + function GetTaskBarCaption: TCaption; + function GetWindowBordersWidth: TRect; + function HasStatusBar: Boolean; + procedure RibbonFormCaptionChanged; virtual; + procedure RibbonFormResized; virtual; + procedure UpdateNonClientArea; virtual; + //IdxSkin + procedure IdxSkin.DrawBackground = SkinDrawBackground; + procedure IdxSkin.DrawCaption = SkinDrawCaption; + function IdxSkin.GetCaptionRect = SkinGetCaptionRect; + function IdxSkin.GetContentOffsets = SkinGetContentOffsets; + function IdxSkin.GetName = SkinGetName; + function IdxSkin.GetPartColor = SkinGetPartColor; + function IdxSkin.GetPartOffset = SkinGetPartOffset; + procedure DrawTabGroupBackground(DC: HDC; const ARect: TRect; AState: Integer); + function GetGroupCaptionHeight: Integer; + function GetGroupContentHeight: Integer; + function GetGroupHeight: Integer; + function GetGroupRowHeight: Integer; + procedure SkinDrawBackground(DC: HDC; const ARect: TRect; APart, AState: Integer); + procedure SkinDrawCaption(DC: HDC; const ACaption: string; const ARect: TRect; + APart, AState: Integer); + function SkinGetCaptionRect(const ARect: TRect; APart: Integer): TRect; + function SkinGetContentOffsets(APart: Integer): TRect; + function SkinGetName: string; + function SkinGetPartColor(APart: Integer; AState: Integer = 0): TColor; + function SkinGetPartOffset(APart: Integer): Integer; + //IdxFormKeyPreviewListener + procedure FormKeyDown(var Key: Word; Shift: TShiftState); + //IdxBarAccessibleObject + function GetAccessibilityHelper: IdxBarAccessibilityHelper; + //IdxRibbonFormNonClientDraw + procedure IdxRibbonFormNonClientDraw.Add = RibbonFormNonClientDrawAdd; + procedure IdxRibbonFormNonClientDraw.Remove = RibbonFormNonClientDrawRemove; + procedure RibbonFormNonClientDrawAdd(AObject: TObject); + procedure RibbonFormNonClientDrawRemove(AObject: TObject); + + procedure BoundsChanged; override; + function CanResize(var NewWidth, NewHeight: Integer): Boolean; override; + function CanScrollTabs: Boolean; + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWindowHandle(const Params: TCreateParams); override; + procedure DoCancelMode; override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); override; + function DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean; override; + function DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean; override; + procedure FontChanged; override; + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + function GetDesignHitTest(X, Y: Integer; Shift: TShiftState): Boolean; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + procedure Loaded; override; + function MayFocus: Boolean; override; + procedure Modified; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseLeave(AControl: TControl); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + function NeedsScrollBars: Boolean; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure Paint; override; + procedure ReadState(Reader: TReader); override; + procedure SetName(const Value: TComponentName); override; + procedure SetParent(AParent: TWinControl); override; + + procedure CancelUpdate; + function CanFade: Boolean; + function CanPaint: Boolean; + function CreateApplicationButton: TdxRibbonApplicationButton; virtual; + function CreateController: TdxRibbonController; virtual; + function CreateFormCaptionHelper: TdxRibbonFormCaptionHelper; virtual; + function CreatePainter: TdxRibbonPainter; virtual; + function CreateQuickAccessToolbar: TdxRibbonQuickAccessToolbar; virtual; + function CreateGroupsPainter: TdxRibbonBarPainter; virtual; + function CreateViewInfo: TdxRibbonViewInfo; virtual; + procedure DesignAddTabGroup(ATab: TdxRibbonTab; ANewToolbar: Boolean); + function DoApplicationMenuClick: Boolean; + procedure DoHelpButtonClick; virtual; + function DoHideMinimizedByClick(AWnd: THandle; AShift: TShiftState; const APos: TPoint): Boolean; virtual; + function DoTabChanging(ANewTab: TdxRibbonTab): Boolean; virtual; + procedure DoTabChanged; virtual; + procedure DoTabGroupCollapsed(ATab: TdxRibbonTab; AGroup: TdxRibbonTabGroup); virtual; + procedure DoTabGroupExpanded(ATab: TdxRibbonTab; AGroup: TdxRibbonTabGroup); virtual; + procedure DoMoreCommandsExecute; virtual; + + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; virtual; + function GetBar(ACustomizingBarControl: TCustomdxBarControl): TdxBar; + function GetTabClass: TdxRibbonTabClass; virtual; + function IsBarManagerValid: Boolean; + function IsLocked: Boolean; + function IsQuickAccessToolbarValid: Boolean; + procedure Hide; + procedure PopulatePopupMenuItems(ALinks: TdxBarItemLinks; + AItems: TdxRibbonPopupMenuItems; AOnClick: TNotifyEvent); + procedure PopupMenuItemClick(Sender: TObject); + procedure SetRedraw(ARedraw: Boolean); + procedure ShowCustomizePopup; virtual; + procedure UpdateControlsVisibility; + + procedure AddTab(ATab: TdxRibbonTab); + procedure RemoveTab(ATab: TdxRibbonTab); + procedure SetNextActiveTab(ATab: TdxRibbonTab); + + procedure Changed; + procedure FullInvalidate; + procedure RecalculateBars; + + property ApplicationButtonIAccessibilityHelper: IdxBarAccessibilityHelper + read GetApplicationButtonIAccessibilityHelper; + property QATIAccessibilityHelper: IdxBarAccessibilityHelper + read GetQATIAccessibilityHelper; + property TabsIAccessibilityHelper: IdxBarAccessibilityHelper + read GetTabsIAccessibilityHelper; + + property ApplicationButtonPressed: Boolean read FApplicationButtonPressed write FApplicationButtonPressed; + property ApplicationButtonState: TdxApplicationButtonState read FApplicationButtonState write SetApplicationButtonState; + property Fader: TdxFader read FFader; + property FormCaptionHelper: TdxRibbonFormCaptionHelper read FFormCaptionHelper; + property GroupsPainter: TdxRibbonBarPainter read FGroupsPainter; + property HighlightedTab: TdxRibbonTab read FHighlightedTab write SetHighlightedTab; + property TabGroupsPopupWindow: TdxRibbonTabGroupsPopupWindow read FTabGroupsPopupWindow; + + property Controller: TdxRibbonController read FController; + property Fading: Boolean read FFading write SetFading default False; //todo: + property GroupsDockControlSite: TdxRibbonGroupsDockControlSite read FGroupsDockControlSite; + property InternalState: TdxRibbonInternalStates read FInternalState; + property Painter: TdxRibbonPainter read FPainter; + property RibbonForm: TdxCustomRibbonForm read GetRibbonForm; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function ApplicationMenuPopup: Boolean; + function AreGroupsVisible: Boolean; + procedure BeginUpdate; + function CanFocus: Boolean; override; + procedure CheckHide; + procedure CloseTabGroupsPopupWindow; + procedure EndUpdate; + function GetTabAtPos(X, Y: Integer): TdxRibbonTab; + procedure ShowTabGroupsPopupWindow; + + property ActiveTab: TdxRibbonTab read FActiveTab write SetActiveTab; + property ApplicationButton: TdxRibbonApplicationButton read FApplicationButton write SetApplicationButton; + property BarManager: TdxBarManager read FBarManager write SetBarManager; + property ColorScheme: TdxCustomRibbonSkin read FColorScheme write SetColorScheme; + property ColorSchemeHandlers: TcxEventHandlerCollection read FColorSchemeHandlers; + property ColorSchemeName: string read GetColorSchemeName write SetColorSchemeName stored True; + property DocumentName: TCaption read FDocumentName write SetDocumentName; + property Fonts: TdxRibbonFonts read FFonts write SetFonts; + property HelpButtonScreenTip: TdxBarScreenTip read FHelpButtonScreenTip write SetHelpButtonScreenTip; + property Hidden: Boolean read FHidden; + property IAccessibilityHelper: IdxBarAccessibilityHelper read GetIAccessibilityHelper; + property IsPopupGroupsMode: Boolean read GetIsPopupGroupsMode; + property LockCount: Integer read FLockCount; + property QuickAccessToolbar: TdxRibbonQuickAccessToolbar read FQuickAccessToolbar write SetQuickAccessToolbar; + property PopupMenuItems: TdxRibbonPopupMenuItems + read FPopupMenuItems write SetPopupMenuItems + default [rpmiItems, rpmiMoreCommands, rpmiQATPosition, rpmiQATAddRemoveItem, rpmiMinimizeRibbon]; + property ShowTabGroups: Boolean read FShowTabGroups write SetShowTabGroups default True; + property ShowTabHeaders: Boolean read FShowTabHeaders write SetShowTabHeaders default True; + property SupportNonClientDrawing: Boolean read FSupportNonClientDrawing write SetSupportNonClientDrawing default False; + property TabCount: Integer read GetTabCount; + property Tabs: TdxRibbonTabCollection read FTabs write SetTabs; + property ViewInfo: TdxRibbonViewInfo read FViewInfo; + property VisibleTabCount: Integer read GetVisibleTabCount; + property VisibleTabs[Index: Integer]: TdxRibbonTab read GetVisibleTab; + + property OnApplicationMenuClick: TdxRibbonApplicationMenuClickEvent + read FOnApplicationMenuClick write FOnApplicationMenuClick; + property OnHelpButtonClick: TdxRibbonEvent + read FOnHelpButtonClick write FOnHelpButtonClick; + property OnHideMinimizedByClick: TdxRibbonHideMinimizedByClickEvent + read FOnHideMinimizedByClick write FOnHideMinimizedByClick; + property OnMoreCommandsExecute: TdxRibbonEvent + read FOnMoreCommandsExecute write FOnMoreCommandsExecute; + property OnTabChanged: TdxRibbonEvent + read FOnTabChanged write FOnTabChanged; + property OnTabChanging: TdxRibbonTabChangingEvent + read FOnTabChanging write FOnTabChanging; + property OnTabGroupCollapsed: TdxRibbonTabGroupNotifyEvent + read FOnTabGroupCollapsed write FOnTabGroupCollapsed; + property OnTabGroupExpanded: TdxRibbonTabGroupNotifyEvent + read FOnTabGroupExpanded write FOnTabGroupExpanded; + end; + + TdxRibbon = class(TdxCustomRibbon) + published + property ApplicationButton; + property BarManager; + property ColorSchemeName; + property DocumentName; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property Fonts; + property HelpButtonScreenTip; + property PopupMenuItems; + property QuickAccessToolbar; + property ShowTabGroups; + property ShowTabHeaders; + property SupportNonClientDrawing; + property Tabs; + property TabOrder; + property TabStop; + + property OnApplicationMenuClick; + property OnHelpButtonClick; + property OnHideMinimizedByClick; + property OnMoreCommandsExecute; + property OnTabChanged; + property OnTabChanging; + property OnTabGroupCollapsed; + property OnTabGroupExpanded; + + property OnClick; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnMouseWheel; + property OnMouseWheelDown; + property OnMouseWheelUp; + property OnResize; + property OnStartDock; + property OnStartDrag; + end; + + { TdxRibbonQuickAccessGroupButton } + + TdxRibbonQuickAccessGroupButton = class(TdxBarItem) + private + FToolbar: TdxBar; + function HasGroupButtonForToolbar(AParentBar, AToolbar: TdxBar): Boolean; + function IsToolbarDockedInRibbon(ARibbon: TdxCustomRibbon; AToolbar: TdxBar): Boolean; + procedure SetToolbar(Value: TdxBar); + procedure ToolbarChanged; + protected + function CanBePlacedOn(AParentKind: TdxBarItemControlParentKind; + AToolbar: TdxBar; out AErrorText: string): Boolean; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + + function GetCaption: string; override; + function IsCaptionStored: Boolean; override; + procedure SetCaption(const Value: string); override; + public + function IsToolbarAcceptable(AToolbar: TdxBar): Boolean; + published + property Toolbar: TdxBar read FToolbar write SetToolbar; + end; + + { TdxRibbonQuickAccessGroupButtonControl } + + TdxRibbonQuickAccessGroupButtonControl = class(TdxBarButtonLikeControl) + private + FPopupBarControl: TdxBarControl; + function GetItem: TdxRibbonQuickAccessGroupButton; + protected + procedure CalcDrawParams(AFull: Boolean = True); override; + function CanActivate: Boolean; override; + procedure ControlClick(AByMouse: Boolean; AKey: Char = #0); override; + procedure DoCloseUp(AHadSubMenuControl: Boolean); override; + procedure DoDropDown(AByMouse: Boolean); override; + procedure DoPaint(ARect: TRect; PaintType: TdxBarPaintType); override; + procedure DropDown(AByMouse: Boolean); override; + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; override; + function GetCurrentImage(AViewSize: TdxBarItemControlViewSize; ASelected: Boolean; + out ACurrentGlyph: TBitmap; out ACurrentImages: TCustomImageList; out ACurrentImageIndex: Integer): Boolean; override; + function GetHint: string; override; + function GetViewStructure: TdxBarItemControlViewStructure; override; + function IsDestroyOnClick: Boolean; override; + function IsDropDown: Boolean; override; + procedure ClosePopup; + public + destructor Destroy; override; + function IsDroppedDown: Boolean; override; + property Item: TdxRibbonQuickAccessGroupButton read GetItem; + end; + + { TdxRibbonQuickAccessGroupButtonPopupBarControl } + + TdxRibbonQuickAccessGroupButtonPopupBarControl = class(TdxRibbonCollapsedGroupPopupBarControl) + private + FGroupButtonControl: TdxRibbonQuickAccessGroupButtonControl; + FIsActiveChangeLocked: Boolean; + protected + function CanActiveChange: Boolean; override; + procedure CreateWnd; override; + procedure DestroyWnd; override; + procedure FocusItemControl(AItemControl: TdxBarItemControl); override; + function GetBehaviorOptions: TdxBarBehaviorOptions; override; + procedure HideAllByEscape; override; + public + constructor CreateForPopup(AGroupButtonControl: TdxRibbonQuickAccessGroupButtonControl); reintroduce; virtual; + procedure CloseUp; override; + end; + + { TdxAddGroupButtonEditor } + + TdxAddGroupButtonEditor = class(TdxAddSubItemEditor) + protected + class function GetAddedItemClass(const AAddedItemName: string): TdxBarItemClass; override; + class function GetPopupItemCaption: string; override; + end; + + { TdxRibbonAccessibilityHelper } + + TdxRibbonAccessibilityHelper = class(TdxBarAccessibilityHelper) + private + FKeyTipWindowsManager: IdxBarKeyTipWindowsManager; + function GetRibbon: TdxCustomRibbon; + protected + // IdxBarAccessibilityHelper + function AreKeyTipsSupported( + out AKeyTipWindowsManager: IdxBarKeyTipWindowsManager): Boolean; override; + function GetBarManager: TdxBarManager; override; + function GetDefaultAccessibleObject: IdxBarAccessibilityHelper; override; + + function GetChild(AIndex: Integer): TcxAccessibilityHelper; override; + function GetChildCount: Integer; override; + function GetChildIndex(AChild: TcxAccessibilityHelper): Integer; override; + function GetOwnerObjectWindow: HWND; override; + function GetScreenBounds(AChildID: TcxAccessibleSimpleChildElementID): TRect; override; + function GetState(AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + +// function ChildIsSimpleElement(AIndex: Integer): Boolean; override; +// function GetChildIndex(AChild: TcxAccessibilityHelper): Integer; override; +// function GetName(AChildID: TcxAccessibleSimpleChildElementID): string; override; +// function GetRole(AChildID: TcxAccessibleSimpleChildElementID): Integer; override; +// function GetSupportedProperties(AChildID: TcxAccessibleSimpleChildElementID): TcxAccessibleObjectProperties; override; + + function LogicalNavigationGetChild(AIndex: Integer): TdxBarAccessibilityHelper; override; + function LogicalNavigationGetChildIndex(AChild: TdxBarAccessibilityHelper): Integer; override; + + property Ribbon: TdxCustomRibbon read GetRibbon; + end; + + { TdxRibbonTabCollectionAccessibilityHelper } + + TdxRibbonTabCollectionAccessibilityHelper = class(TdxBarAccessibilityHelper) + private + function GetTabCollection: TdxRibbonTabCollection; + protected + // IdxBarAccessibilityHelper + function GetBarManager: TdxBarManager; override; + function GetDefaultAccessibleObject: IdxBarAccessibilityHelper; override; + + function GetChild(AIndex: Integer): TcxAccessibilityHelper; override; + function GetChildCount: Integer; override; + function GetChildIndex(AChild: TcxAccessibilityHelper): Integer; override; + function GetOwnerObjectWindow: HWND; override; + function GetParent: TcxAccessibilityHelper; override; + function GetScreenBounds(AChildID: TcxAccessibleSimpleChildElementID): TRect; override; + function GetState(AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + +// function ChildIsSimpleElement(AIndex: Integer): Boolean; override; +// function GetChildIndex(AChild: TcxAccessibilityHelper): Integer; override; +// function GetName(AChildID: TcxAccessibleSimpleChildElementID): string; override; +// function GetRole(AChildID: TcxAccessibleSimpleChildElementID): Integer; override; +// function GetSupportedProperties(AChildID: TcxAccessibleSimpleChildElementID): TcxAccessibleObjectProperties; override; + + function LogicalNavigationGetChild(AIndex: Integer): TdxBarAccessibilityHelper; override; + function LogicalNavigationGetChildCount: Integer; override; + function LogicalNavigationGetChildIndex(AChild: TdxBarAccessibilityHelper): Integer; override; + + property TabCollection: TdxRibbonTabCollection read GetTabCollection; + end; + + { TdxRibbonTabAccessibilityHelper } + + TdxRibbonTabAccessibilityHelper = class(TdxBarAccessibilityHelper) + private + function GetTab: TdxRibbonTab; + protected + // IdxBarAccessibilityHelper + function GetBarManager: TdxBarManager; override; + function GetNextAccessibleObject( + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; override; + function HandleNavigationKey(var AKey: Word): Boolean; override; + function IsNavigationKey(AKey: Word): Boolean; override; + function LogicalNavigationGetNextAccessibleObject( + AGoForward: Boolean): IdxBarAccessibilityHelper; override; + procedure Select(ASetFocus: Boolean); override; + procedure Unselect(ANextSelectedObject: IdxBarAccessibilityHelper); override; + + function GetChild(AIndex: Integer): TcxAccessibilityHelper; override; + function GetChildCount: Integer; override; + function GetChildIndex(AChild: TcxAccessibilityHelper): Integer; override; + function GetOwnerObjectWindow: HWND; override; + function GetParent: TcxAccessibilityHelper; override; + function GetScreenBounds(AChildID: TcxAccessibleSimpleChildElementID): TRect; override; + function GetSelectable: Boolean; override; + function GetState(AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + function GetAssignedKeyTip: string; override; + function GetDefaultKeyTip: string; override; + procedure GetKeyTipInfo(out AKeyTipInfo: TdxBarKeyTipInfo); override; + procedure KeyTipHandler(Sender: TObject); override; + procedure KeyTipsEscapeHandler; override; + + property Tab: TdxRibbonTab read GetTab; + public + procedure CloseUpHandler(AClosedByEscape: Boolean); + end; + + { TdxRibbonApplicationButtonAccessibilityHelper } + + TdxRibbonApplicationButtonAccessibilityHelper = class(TdxBarAccessibilityHelper) + private + FPrevOnApplicationMenuCloseUp: TNotifyEvent; + procedure ApplicationMenuCloseUpHandler(Sender: TObject); + function GetRibbon: TdxCustomRibbon; + procedure ShowApplicationMenu(APostMessage: UINT); + protected + // IdxBarAccessibilityHelper + function GetBarManager: TdxBarManager; override; + function GetNextAccessibleObject( + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; override; + function HandleNavigationKey(var AKey: Word): Boolean; override; + function IsNavigationKey(AKey: Word): Boolean; override; + procedure Select(ASetFocus: Boolean); override; + procedure Unselect(ANextSelectedObject: IdxBarAccessibilityHelper); override; + + function GetOwnerObjectWindow: HWND; override; + function GetParent: TcxAccessibilityHelper; override; + function GetScreenBounds(AChildID: TcxAccessibleSimpleChildElementID): TRect; override; + function GetSelectable: Boolean; override; + function GetState(AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + function GetAssignedKeyTip: string; override; + function GetDefaultKeyTip: string; override; + procedure GetKeyTipInfo(out AKeyTipInfo: TdxBarKeyTipInfo); override; + procedure KeyTipHandler(Sender: TObject); override; + + property Ribbon: TdxCustomRibbon read GetRibbon; + end; + + { TdxRibbonGroupsDockControlAccessibilityHelper } + + TdxRibbonGroupsDockControlAccessibilityHelper = class(TdxDockControlAccessibilityHelper) + private + function GetDockControl: TdxRibbonGroupsDockControl; + protected + function GetChild(AIndex: Integer): TcxAccessibilityHelper; override; + function GetChildCount: Integer; override; + function GetChildIndex(AChild: TcxAccessibilityHelper): Integer; override; + function GetParent: TcxAccessibilityHelper; override; + function GetState(AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + function GetParentForKeyTip: TdxBarAccessibilityHelper; override; + + property DockControl: TdxRibbonGroupsDockControl read GetDockControl; + end; + + { TdxRibbonQuickAccessBarControlAccessibilityHelper } + + TdxRibbonQuickAccessBarControlAccessibilityHelper = class(TdxBarControlAccessibilityHelper) + private + function GetBarControl: TdxRibbonQuickAccessBarControl; + protected + function GetChild(AIndex: Integer): TcxAccessibilityHelper; override; + function GetChildCount: Integer; override; + function GetChildIndex(AChild: TcxAccessibilityHelper): Integer; override; + function GetParent: TcxAccessibilityHelper; override; + + procedure DoGetKeyTipsData(AKeyTipsData: TList); override; + procedure GetItemControlKeyTipPosition(AItemControl: TdxBarItemControl; + out ABasePoint: TPoint; out AHorzAlign: TAlignment; + out AVertAlign: TcxAlignmentVert); override; + function GetNextAccessibleObject(AItemControl: TdxBarItemControl; + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; override; + function GetParentForKeyTip: TdxBarAccessibilityHelper; override; + function IsKeyTipContainer: Boolean; override; + procedure KeyTipsEscapeHandler; override; + + property BarControl: TdxRibbonQuickAccessBarControl read GetBarControl; + end; + + { TdxRibbonQuickAccessBarControlMarkAccessibilityHelper } + + TdxRibbonQuickAccessBarControlMarkAccessibilityHelper = class(TdxBarControlMarkAccessibilityHelper) + private + function GetBarControl: TdxRibbonQuickAccessBarControl; + protected + // IdxBarAccessibilityHelper + function HandleNavigationKey(var AKey: Word): Boolean; override; + procedure GetKeyTipInfo(out AKeyTipInfo: TdxBarKeyTipInfo); override; + function GetKeyTip: string; override; + procedure KeyTipHandler(Sender: TObject); override; + + property BarControl: TdxRibbonQuickAccessBarControl read GetBarControl; + end; + + { TdxRibbonGroupBarControlAccessibilityHelper } + + TdxRibbonGroupBarControlAccessibilityHelper = class(TdxBarControlAccessibilityHelper) + private + function GetBarControl: TdxRibbonGroupBarControl; + procedure ShowPopupBarControl; + protected + // IdxBarAccessibilityHelper + function GetNextAccessibleObject( + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; override; + function HandleNavigationKey(var AKey: Word): Boolean; override; + function IsNavigationKey(AKey: Word): Boolean; override; + procedure Select(ASetFocus: Boolean); override; + procedure Unselect(ANextSelectedObject: IdxBarAccessibilityHelper); override; + + function GetSelectable: Boolean; override; + + function Expand: TCustomdxBarControlAccessibilityHelper; override; + procedure GetCaptionButtonKeyTipPosition(ACaptionButton: TdxBarCaptionButton; + out ABasePointY: Integer; out AVertAlign: TcxAlignmentVert); override; + procedure GetItemControlKeyTipPosition(AItemControl: TdxBarItemControl; + out ABasePoint: TPoint; out AHorzAlign: TAlignment; + out AVertAlign: TcxAlignmentVert); override; + + function GetAssignedKeyTip: string; override; + function GetDefaultKeyTip: string; override; + procedure GetKeyTipInfo(out AKeyTipInfo: TdxBarKeyTipInfo); override; + procedure GetKeyTipData(AKeyTipsData: TList); override; + + function GetNextAccessibleObject(AItemControl: TdxBarItemControl; + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; override; + function GetParentForKeyTip: TdxBarAccessibilityHelper; override; + function IsCollapsed: Boolean; override; + function IsKeyTipContainer: Boolean; override; + procedure KeyTipHandler(Sender: TObject); override; + procedure KeyTipsEscapeHandler; override; + + property BarControl: TdxRibbonGroupBarControl read GetBarControl; + public + procedure CloseUpHandler(AClosedByEscape: Boolean); + end; + + { TdxRibbonQuickAccessGroupButtonControlAccessibilityHelper } + + TdxRibbonQuickAccessGroupButtonControlAccessibilityHelper = class(TdxBarButtonLikeControlAccessibilityHelper) + protected + function IsDropDownControl: Boolean; override; + function ShowDropDownWindow: Boolean; override; + end; + + { TdxRibbonKeyTipWindow } + + TdxRibbonKeyTipWindow = class(TCustomControl) + private + FColorScheme: TdxCustomRibbonSkin; + procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED; + procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED; + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + protected + function CalcBoundsRect: TRect; + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWindowHandle(const Params: TCreateParams); override; + procedure Paint; override; + procedure UpdateBounds; + public + constructor Create(AColorScheme: TdxCustomRibbonSkin); reintroduce; virtual; + procedure ShowKeyTip; + property Caption; + property Enabled; + end; + + { TdxRibbonKeyTipWindows } + + TdxRibbonKeyTipWindows = class(TInterfacedObject, IdxBarKeyTipWindowsManager) + private + FRibbon: TdxCustomRibbon; + FWindowList: TcxObjectList; + function GetColorScheme: TdxCustomRibbonSkin; + function GetCount: Integer; + protected + // IdxBarKeyTipWindowsManager + procedure Add(const ACaption: string; const ABasePoint: TPoint; + AHorzAlign: TAlignment; AVertAlign: TcxAlignmentVert; AEnabled: Boolean; + out AWindow: TObject); + procedure Delete(AWindow: TObject); + procedure Show; + + property ColorScheme: TdxCustomRibbonSkin read GetColorScheme; + property Count: Integer read GetCount; + public + constructor Create(ARibbon: TdxCustomRibbon); reintroduce; + destructor Destroy; override; + end; + +procedure RibbonCheckCreateComponent(var AOwner: TComponent; AClass: TClass); +procedure RibbonDockToolBar(AToolBar: TdxBar; ADockControl: TdxBarDockControl); +procedure RibbonUndockToolBar(AToolBar: TdxBar); + +implementation + +uses +{$IFDEF DELPHI6} + Types, +{$ELSE} + MultiMon, +{$ENDIF} + dxOffice11, CommCtrl, cxGeometry, dxBarStrs, dxBarSkinConsts, + dxRibbonGroupLayoutCalculator, Math, cxDrawTextUtils, cxLookAndFeelPainters, + cxDWMApi, dxUxTheme, dxThemeConsts, dxThemeManager, dxGDIPlusAPI; + +const + dxRibbonTabSeparatorWidth = 1; + dxRibbonTabsRightSpace = 6; + dxRibbonTabsLeftSpace = 8; + + dxRibbonCollapsedGroupGlyphBackgroundOffsets: TRect = (Left: 3; Top: 3; Right: 3; Bottom: 4); + dxRibbonEmptyHeight = 24; + dxRibbonGroupCaptionHeightCorrection = 1; + dxRibbonGroupCaptionOffsets: TRect = (Left: 0; Top: 1; Right: 0; Bottom: 3); + dxRibbonGroupContentLeftOffset = 2; + dxRibbonGroupContentRightOffset = 2; + dxRibbonGroupRowHeightCorrection = 3; + + dxRibbonGroupsScrollDelta = 10; + dxCaptionGlowRadius = 10; + + dxRibbonBarBehaviorOptions: TdxBarBehaviorOptions = [bboAllowShowHints, + bboClickItemsBySpaceKey, bboMouseCantUnselectNavigationItem, bboUnmoved, bboItemCustomizePopup, bboSubMenuCaptureMouse]; + +type + TMouseHookStructEx = packed record + pt: TPoint; + hwnd: HWND; + wHitTestCode: UINT; + dwExtraInfo: DWORD; + mouseData: DWORD; + end; + PMouseHookStructEx = ^TMouseHookStructEx; + + TCustomdxBarControlAccess = class(TCustomdxBarControl); + TdxBarControlAccess = class(TdxBarControl); + TdxBarAccessibilityHelperAccess = class(TdxBarAccessibilityHelper); + TdxBarCaptionButtonAccessibilityHelperAccess = class(TdxBarCaptionButtonAccessibilityHelper); + TdxBarItemControlAccess = class(TdxBarItemControl); + TdxBarItemControlAccessibilityHelperAccess = class(TdxBarItemControlAccessibilityHelper); + TdxBarItemLinkAccess = class(TdxBarItemLink); + TdxBarItemLinksAccess = class(TdxBarItemLinks); + TdxBarManagerAccess = class(TdxBarManager); + TdxBarSubMenuControlAccess = class(TdxBarSubMenuControl); + +function HasComponentOnForm(AForm: TCustomForm; AClass: TClass): Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to AForm.ComponentCount - 1 do + begin + if AForm.Components[I] is AClass then + begin + Result := True; + Break; + end; + end; +end; + +procedure RibbonCheckCreateComponent(var AOwner: TComponent; AClass: TClass); +begin + if not CheckGdiPlus then + raise Exception.CreateFmt(cxGetResourceString(@dxSBAR_GDIPLUSNEEDED), [AClass.ClassName]); + if (AOwner = nil) and (Application.MainForm <> nil) then + AOwner := Application.MainForm; + if not (AOwner is TCustomForm) then + raise Exception.CreateFmt(cxGetResourceString(@dxSBAR_RIBBONBADOWNER), [AClass.ClassName]); + if HasComponentOnForm(TCustomForm(AOwner), AClass) then + raise Exception.CreateFmt(cxGetResourceString(@dxSBAR_RIBBONMORETHANONE), [AClass.ClassName]); +end; + +procedure WinControlFullInvalidate(AControl: TWinControl; AIncludeChildren: Boolean = False; AForceUpdate: Boolean = False); +var + AFlags: Cardinal; +begin + if (AControl <> nil) and AControl.HandleAllocated and IsWindowVisible(AControl.Handle) then + begin + AControl.Invalidate; + AFlags := RDW_ERASE or RDW_INVALIDATE or RDW_FRAME; + if AIncludeChildren then + AFlags := AFlags or RDW_ALLCHILDREN; + if AForceUpdate then + AFlags := AFlags or RDW_UPDATENOW or RDW_ERASENOW; + RedrawWindow(AControl.Handle, nil, 0, AFlags); + if not AForceUpdate then + AControl.Update; + end; +end; + +var + FMouseHook: HHOOK; + +function FindRibbon(AWnd: HWND; AFindOnForm: Boolean): TdxCustomRibbon; +var + AControl: TWinControl; + I: Integer; +begin + Result := nil; + + AControl := FindControl(AWnd); + if AFindOnForm and (AControl is TCustomForm) then + for I := 0 to AControl.ComponentCount - 1 do + if AControl.Components[I] is TdxCustomRibbon then + begin + Result := TdxCustomRibbon(AControl.Components[I]); + Break; + end; + + if Result = nil then + repeat + if AControl is TdxCustomRibbon then + begin + Result := TdxCustomRibbon(AControl); + Break; + end; + if not IsChildClassWindow(AWnd) then + Break; + AWnd := GetParent(AWnd); + AControl := FindControl(AWnd); + until AWnd = 0; + + if Result <> nil then + if Result.Hidden or (not Result.ShowTabHeaders and not Result.ShowTabGroups) then + Result := nil; +end; + +function dxRibbonMouseHook(Code: Integer; wParam: WParam; lParam: LParam): LRESULT; stdcall; +var + AMHS: PMouseHookStructEx; + + procedure DoRibbonMouseWheel(ARibbon: TdxCustomRibbon); + var + AKeyState: TKeyboardState; + begin + GetKeyboardState(AKeyState); + ARibbon.DoMouseWheel(KeyboardStateToShiftState(AKeyState), + ShortInt(HiWord(AMHS.mouseData)), cxPoint(-1, -1)); + end; + + procedure ForwardMouseWheelMsgToActiveBarControl; + begin + SendMessage(ActiveBarControl.Handle, WM_MOUSEWHEEL, + MakeWParam(ShiftStateToKeys(InternalGetShiftState), HiWord(AMHS.mouseData)), + MakeLParam(AMHS.pt.X, AMHS.pt.Y)); + end; + +var + ARibbon: TdxCustomRibbon; +begin + if (Code < 0) or (wParam <> WM_MOUSEWHEEL) or not Mouse.WheelPresent then + begin + Result := CallNextHookEx(FMouseHook, Code, wParam, lParam); + Exit; + end; + + Result := 0; + + AMHS := PMouseHookStructEx(lParam); + case BarGetMouseWheelReceiver of + mwrActiveBarControl: + begin + ForwardMouseWheelMsgToActiveBarControl; + Result := 1; + end; + mwrWindow: + begin + ARibbon := FindRibbon(WindowFromPoint(AMHS.pt), False); + if (ARibbon <> nil) and IsWindowEnabled(ARibbon.Handle) then + begin + DoRibbonMouseWheel(ARibbon); + Result := 1; + end + end; + end; + + if Result = 0 then + Result := CallNextHookEx(FMouseHook, Code, wParam, lParam); +end; + +procedure DrawRect(DC: HDC; const R: TRect; AColor: TColor; AExclude: Boolean); +begin + FillRectByColor(DC, R, AColor); + if AExclude then + ExcludeClipRect(DC, R.Left, R.Top, R.Right, R.Bottom); +end; + +{$IFNDEF DELPHI6} +function FindMonitor(Handle: HMONITOR): TMonitor; +var + I: Integer; +begin + Result := nil; + for I := 0 to Screen.MonitorCount - 1 do + if Screen.Monitors[I].Handle = Handle then + begin + Result := Screen.Monitors[I]; + break; + end; +end; + +function GetWorkareaRect(Handle: HMONITOR): TRect; +var + MonInfo: TMonitorInfo; +begin + MonInfo.cbSize := SizeOf(MonInfo); + GetMonitorInfo(Handle, @MonInfo); + Result := MonInfo.rcWork; +end; + +function MonitorFromPoint(const P: TPoint): TMonitor; +begin + Result := FindMonitor(MultiMon.MonitorFromPoint(P, MONITOR_DEFAULTTONEAREST)); +end; + +function MonitorFromWindow(const Handle: THandle): TMonitor; +begin + Result := FindMonitor(MultiMon.MonitorFromWindow(Handle, MONITOR_DEFAULTTONEAREST)); +end; +{$ENDIF} + +function GetMonitorWorkArea(AWnd: HWND): TRect; +var + AMonitor: TMonitor; +begin + if AWnd = 0 then + AMonitor := {$IFDEF DELPHI6}Screen.{$ENDIF}MonitorFromPoint(GetMouseCursorPos) + else + AMonitor := {$IFDEF DELPHI6}Screen.{$ENDIF}MonitorFromWindow(AWnd); + if Assigned(AMonitor) then + Result := {$IFDEF DELPHI6}AMonitor.WorkareaRect{$ELSE}GetWorkareaRect(AMonitor.Handle){$ENDIF} + else + with Screen do + Result := cxRectBounds(DesktopLeft, DesktopTop, DesktopWidth, DesktopHeight); +end; + +function GetRibbonAccessibilityHelper(AParentWnd: HWND): IdxBarAccessibilityHelper; +var + ARibbon: TdxCustomRibbon; +begin + Result := nil; + ARibbon := FindRibbon(AParentWnd, True); + if (ARibbon <> nil) and ARibbon.Visible then + Result := ARibbon.IAccessibilityHelper; +end; + +procedure SelectFirstSelectableAccessibleObject( + AParentObject: TdxBarAccessibilityHelper); +begin + BarNavigationController.ChangeSelectedObject(False, + AParentObject.GetFirstSelectableObject); +end; + +//routines +procedure RibbonDockToolBar(AToolBar: TdxBar; ADockControl: TdxBarDockControl); +var + APrevVisible: Boolean; +begin + if (AToolBar = nil) or (AToolBar.DockControl = ADockControl) then Exit; + APrevVisible := AToolBar.Visible; + if not (csLoading in AToolBar.ComponentState) then + AToolBar.Visible := False; + try + AToolBar.DockControl := ADockControl; + finally + if not (csLoading in AToolBar.ComponentState) then + AToolBar.Visible := APrevVisible; + end; +end; + +procedure RibbonUndockToolBar(AToolBar: TdxBar); +var + APrevVisible: Boolean; +begin + if (AToolbar = nil) or (csDestroying in AToolbar.ComponentState) then Exit; + APrevVisible := AToolbar.Visible; + AToolbar.Visible := False; + AToolbar.DockControl := nil; + AToolbar.DockedDockControl := nil; + AToolbar.DockedDockingStyle := dsNone; + AToolbar.DockingStyle := dsNone; + AToolbar.Visible := APrevVisible; +end; + +type + { TdxRibbonGroupBarControlViewInfoHelper } + + TdxRibbonGroupBarControlViewInfoHelper = class(TInterfacedObject, + IdxRibbonGroupViewInfo) + private + FViewInfo: TdxRibbonGroupBarControlViewInfo; + + // IdxRibbonGroupViewInfo + procedure AddSeparator(const Value: TdxBarItemSeparatorInfo); + procedure DeleteSeparators; + function GetContentSize: TSize; + function GetItemControlCount: Integer; + function GetItemControlViewInfo(AIndex: Integer): IdxBarItemControlViewInfo; + function GetMinContentWidth: Integer; + function GetOffsetsInfo: TdxRibbonGroupOffsetsInfo; + function GetSeparatorCount: Integer; + function GetSeparatorInfo(AIndex: Integer): TdxBarItemSeparatorInfo; + procedure SetContentSize(const Value: TSize); + procedure SetSeparatorInfo(AIndex: Integer; + const Value: TdxBarItemSeparatorInfo); + protected + property ViewInfo: TdxRibbonGroupBarControlViewInfo read FViewInfo; + public + constructor Create(AViewInfo: TdxRibbonGroupBarControlViewInfo); + end; + +constructor TdxRibbonGroupBarControlViewInfoHelper.Create( + AViewInfo: TdxRibbonGroupBarControlViewInfo); +begin + inherited Create; + FViewInfo := AViewInfo; +end; + +// IdxRibbonGroupViewInfo +procedure TdxRibbonGroupBarControlViewInfoHelper.AddSeparator( + const Value: TdxBarItemSeparatorInfo); +begin + ViewInfo.AddSeparatorInfo(Value.Bounds, Value.Kind, nil); +end; + +procedure TdxRibbonGroupBarControlViewInfoHelper.DeleteSeparators; +begin + ViewInfo.RemoveSeparatorInfos; +end; + +function TdxRibbonGroupBarControlViewInfoHelper.GetContentSize: TSize; +begin + Result := ViewInfo.ContentSize; +end; + +function TdxRibbonGroupBarControlViewInfoHelper.GetItemControlCount: Integer; +begin + Result := ViewInfo.ItemControlCount; +end; + +function TdxRibbonGroupBarControlViewInfoHelper.GetItemControlViewInfo( + AIndex: Integer): IdxBarItemControlViewInfo; +begin + Result := ViewInfo.ItemControlViewInfos[AIndex]; +end; + +function TdxRibbonGroupBarControlViewInfoHelper.GetMinContentWidth: Integer; +var + ABarControl: TdxRibbonGroupBarControl; +begin + ABarControl := ViewInfo.BarControl; + Result := ABarControl.Ribbon.GroupsPainter.GetGroupMinWidth(ABarControl); +end; + +function TdxRibbonGroupBarControlViewInfoHelper.GetOffsetsInfo: TdxRibbonGroupOffsetsInfo; +begin + Result.ButtonGroupOffset := IdxSkin(ViewInfo.BarControl.Ribbon).GetPartOffset(DXBAR_BUTTONGROUP); + Result.ContentLeftOffset := dxRibbonGroupContentLeftOffset; + Result.ContentRightOffset := dxRibbonGroupContentRightOffset; +end; + +function TdxRibbonGroupBarControlViewInfoHelper.GetSeparatorCount: Integer; +begin + Result := ViewInfo.SeparatorCount; +end; + +function TdxRibbonGroupBarControlViewInfoHelper.GetSeparatorInfo( + AIndex: Integer): TdxBarItemSeparatorInfo; +begin + Result := ViewInfo.SeparatorInfos[AIndex]; +end; + +procedure TdxRibbonGroupBarControlViewInfoHelper.SetContentSize( + const Value: TSize); +begin + ViewInfo.ContentSize := Value; +end; + +procedure TdxRibbonGroupBarControlViewInfoHelper.SetSeparatorInfo( + AIndex: Integer; const Value: TdxBarItemSeparatorInfo); +begin + ViewInfo.SeparatorInfos[AIndex] := Value; +end; + +{ TdxDesignSelectionHelper } + +constructor TdxDesignSelectionHelper.Create(ARibbon: TdxCustomRibbon; + AOwner: TPersistent; AParent: TPersistent); +begin + FOwner := AOwner; + FRibbon := ARibbon; + FParent := AParent; +end; + +//IdxBarSelectableItem +function TdxDesignSelectionHelper.CanDelete(ADestruction: Boolean): Boolean; +begin + if FOwner is TComponent then + Result := IdxBarDesigner(GetBarManager).CanDeleteComponent(TComponent(FOwner)) + else + Result := True; +end; + +procedure TdxDesignSelectionHelper.DeleteSelection( + var AReference: IdxBarSelectableItem; ADestruction: Boolean); +begin + if CanDelete(ADestruction) then + begin + AReference := nil; + FOwner.Free; + end; +end; + +procedure TdxDesignSelectionHelper.ExecuteCustomizationAction(ABasicAction: TdxBarCustomizationAction); +begin +// do nothing; +end; + +function TdxDesignSelectionHelper.GetBarManager: TdxBarManager; +begin + Result := FRibbon.BarManager; +end; + +function TdxDesignSelectionHelper.GetInstance: TPersistent; +begin + Result := FOwner; +end; + +procedure TdxDesignSelectionHelper.GetMasterObjects(AList: TdxObjectList); +begin + AList.Add(FParent); +end; + +function TdxDesignSelectionHelper.GetNextSelectableItem: IdxBarSelectableItem; +begin + Result := nil; +end; + +function TdxDesignSelectionHelper.GetSelectableParent: TPersistent; +begin + Result := FParent; +end; + +function TdxDesignSelectionHelper.GetSelectionStatus: TdxBarSelectionStatus; +begin + if (GetBarManager <> nil) then + Result := (GetBarManager as IdxBarDesigner).GetSelectionStatus(FOwner) + else + Result := ssUnselected; +end; + +function TdxDesignSelectionHelper.GetSupportedActions: TdxBarCustomizationActions; +begin + Result := []; +end; + +procedure TdxDesignSelectionHelper.Invalidate; +begin + FRibbon.FullInvalidate; +end; + +function TdxDesignSelectionHelper.IsComplex: Boolean; +begin + Result := False; +end; + +function TdxDesignSelectionHelper.IsComponentSelected: Boolean; +begin + Result := (GetBarManager <> nil) and + (GetBarManager as IdxBarDesigner).IsComponentSelected(FOwner); +end; + +procedure TdxDesignSelectionHelper.SelectComponent( + ASelectionOperation: TdxBarSelectionOperation); +begin + if GetBarManager <> nil then + (GetBarManager as IdxBarDesigner).SelectComponent(FOwner, ASelectionOperation); +end; + +procedure TdxDesignSelectionHelper.SelectionChanged; +begin + Invalidate; +end; + +function TdxDesignSelectionHelper.SelectParentComponent: Boolean; +begin + Result := True; + if GetBarManager <> nil then + (GetBarManager as IdxBarDesigner).SelectComponent(GetSelectableParent); +end; + +{ TdxRibbonTabPainter } + +constructor TdxRibbonTabPainter.Create(AColorScheme: TdxCustomRibbonSkin); +begin + FColorScheme := AColorScheme; +end; + +procedure TdxRibbonTabPainter.DrawBackground(ACanvas: TcxCanvas; + const ABounds: TRect; AState: TdxRibbonTabState); +begin + ColorScheme.DrawTab(ACanvas.Handle, ABounds, AState); +end; + +procedure TdxRibbonTabPainter.DrawTabSeparator(ACanvas: TcxCanvas; + const ABounds: TRect; Alpha: Byte); +begin + ColorScheme.DrawTabSeparator(ACanvas.Handle, ABounds, Alpha); +end; + +procedure TdxRibbonTabPainter.DrawText(ACanvas: TcxCanvas; const ABounds: TRect; + const AText: string; AHasSeparator: Boolean); +const + Flags: array[Boolean] of Integer = + (cxAlignBottom or cxAlignHCenter or cxSingleLine, + cxAlignBottom or cxAlignLeft or cxSingleLine); +begin + ACanvas.Brush.Style := bsClear; + ACanvas.DrawText(AText, ABounds, Flags[AHasSeparator]); + ACanvas.Brush.Style := bsSolid; +end; + +{ TdxRibbonPainter } + +constructor TdxRibbonPainter.Create(ARibbon: TdxCustomRibbon); +begin + FRibbon := ARibbon; +end; + +procedure TdxRibbonPainter.DrawApplicationButton(ACanvas: TcxCanvas; + const ABounds: TRect; AState: TdxApplicationButtonState); +var + B: TBitmap; + R: TRect; +begin + if not ViewInfo.IsApplicationButtonVisible or cxRectIsEmpty(ABounds) then Exit; + ColorScheme.DrawApplicationButton(ACanvas.Handle, ABounds, AState); + B := Ribbon.ApplicationButton.Glyph; + if (B <> nil) and not B.Empty then + DrawApplicationButtonGlyph(ACanvas, ABounds, B, Ribbon.ApplicationButton.StretchGlyph) + else + begin + R := ABounds; + InflateRect(R, -9, -9); + DrawDefaultFormIcon(ACanvas, R); + end; +end; + +procedure TdxRibbonPainter.DrawApplicationButtonGlyph(ACanvas: TcxCanvas; + const ABounds: TRect; AGlyph: TBitmap; AStretch: Boolean); +var + R: TRect; + APrevBrushStyle: TBrushStyle; +begin + if AStretch then + R := cxRectInflate(ABounds, -9, -9) + else + R := cxRectCenter(ABounds, AGlyph.Width, AGlyph.Height); + OffsetRect(R, -1, -1); + if AGlyph.PixelFormat = pf32bit then + cxAlphaBlend(ACanvas.Handle, AGlyph, R, cxRect(0, 0, AGlyph.Width, AGlyph.Height), True) + else + begin + APrevBrushStyle := ACanvas.Brush.Style; + ACanvas.Brush.Style := bsClear; + ACanvas.Canvas.BrushCopy(R, AGlyph, Rect(0, 0, AGlyph.Width, AGlyph.Height), + AGlyph.TransparentColor); + ACanvas.Brush.Style := APrevBrushStyle; + end; +end; + +procedure TdxRibbonPainter.DrawBackground(ACanvas: TcxCanvas; const ABounds: TRect); +var + R: TRect; +begin + R := ABounds; + if ViewInfo.IsQATVisible and not ViewInfo.IsQATAtBottom and + not ViewInfo.SupportNonClientDrawing then + begin + R.Bottom := ViewInfo.QuickAccessToolbarBounds.Bottom; + ColorScheme.DrawRibbonClientTopArea(ACanvas.Handle, R); + R := ABounds; + R.Top := ViewInfo.QuickAccessToolbarBounds.Bottom; + end; + ColorScheme.DrawRibbonBackground(ACanvas.Handle, R); +end; + +procedure TdxRibbonPainter.DrawBottomBorder(ACanvas: TcxCanvas); +var + R: TRect; +begin + R := ViewInfo.Bounds; + R.Top := R.Bottom - 2; + ColorScheme.DrawRibbonBottomBorder(ACanvas.Handle, R); + ACanvas.ExcludeClipRect(R); +end; + +procedure TdxRibbonPainter.DrawDefaultFormIcon(ACanvas: TcxCanvas; const ABounds: TRect); +var + B: TcxBitmap; +begin + if cxRectIsEmpty(ABounds) then Exit; + if ViewInfo.UseGlass then + begin + B := TcxBitmap.CreateSize(ABounds); + try + DrawIconEx(B.Canvas.Handle, 0, 0, GetFormIconHandle, B.Width, B.Height, 0, 0, DI_NORMAL); + cxDrawImage(ACanvas.Handle, ABounds, ABounds, B, nil, -1, idmNormal); + finally + B.Free; + end; + end + else + begin + DrawIconEx(ACanvas.Handle, ABounds.Left, ABounds.Top, GetFormIconHandle, + ABounds.Right - ABounds.Left, ABounds.Bottom - ABounds.Top, 0, 0, DI_NORMAL); + end; +end; + +procedure TdxRibbonPainter.DrawGlowingText(DC: HDC; const AText: string; + AFont: TFont; const ABounds: TRect; AColor: TColor; AFlags: DWORD); +var + AMemoryDC: HDC; + AInfo: TBitmapInfo; + dib, OldBitmap: HBITMAP; + dttOpts: TdxDTTOpts; + P: Pointer; + ATheme: TdxTheme; +begin + AMemoryDC := CreateCompatibleDC(DC); + + AInfo.bmiHeader.biSize := SizeOf(TBitmapInfo); + AInfo.bmiHeader.biWidth := cxRectWidth(ABounds); + AInfo.bmiHeader.biHeight := -cxRectHeight(ABounds); + AInfo.bmiHeader.biPlanes := 1; + AInfo.bmiHeader.biBitCount := 32; + AInfo.bmiHeader.biCompression := BI_RGB; + + dib := CreateDIBSection(DC, AInfo, DIB_RGB_COLORS, P, 0, 0); + OldBitmap := SelectObject(AMemoryDC, dib); + + // Draw glowing text + SelectObject(AMemoryDC, AFont.Handle); + dttOpts.dwSize := SizeOf(TdxDTTOpts); + dttOpts.dwFlags := DTT_COMPOSITED or DTT_GLOWSIZE or DTT_TEXTCOLOR; + dttOpts.crText := ColorToRGB(AColor); + dttOpts.iGlowSize := dxCaptionGlowRadius; // This is about the size Microsoft Word 2007 uses + + ATheme := OpenTheme(totWindow); + DrawThemeTextEx(ATheme, AMemoryDC, 0, 0, AText, -1, AFlags, + cxRect(0, 0, ABounds.Right - ABounds.Left, ABounds.Bottom - ABounds.Top), dttOpts); + + // Copy to foreground + cxBitBlt(DC, AMemoryDC, ABounds, cxNullPoint, SRCCOPY); + + // Clean up + SelectObject(AMemoryDC, OldBitmap); + DeleteObject(dib); + DeleteDC(AMemoryDC); +end; + +procedure TdxRibbonPainter.DrawGroupsArea(ACanvas: TcxCanvas; const ABounds: TRect); +begin + ColorScheme.DrawTabGroupsArea(ACanvas.Handle, ABounds); +end; + +procedure TdxRibbonPainter.DrawGroupsScrollButton(ACanvas: TcxCanvas; const ABounds: TRect; + ALeft, APressed, AHot: Boolean); +const + ArrowDirection: array[Boolean] of TcxArrowDirection = (adRight, adLeft); +var + AState: Integer; +begin + if APressed then + AState := DXBAR_PRESSED + else if AHot then + AState := DXBAR_HOT + else + AState := DXBAR_NORMAL; + ColorScheme.DrawGroupScrollButton(ACanvas.Handle, ABounds, ALeft, AState); + if ColorScheme.NeedDrawGroupScrollArrow then + TcxCustomLookAndFeelPainter.DrawArrow(ACanvas, + cxRectInflate(ABounds, -2, 0, -2, -2), ArrowDirection[ALeft], clBlack); + ACanvas.ExcludeClipRect(ABounds); +end; + +procedure TdxRibbonPainter.DrawQuickAccessToolbar(ACanvas: TcxCanvas; + const ABounds: TRect; AIsActive: Boolean); +begin + if not ViewInfo.IsQATAtNonClientArea then + begin + ACanvas.SaveClipRegion; + ACanvas.SetClipRegion(TcxRegion.Create(ABounds), roIntersect); + DrawBackground(ACanvas, ViewInfo.Bounds); + ACanvas.RestoreClipRegion; + end; + ColorScheme.DrawQuickAccessToolbar(ACanvas.Handle, ABounds, + ViewInfo.IsQATAtBottom, ViewInfo.SupportNonClientDrawing, + ViewInfo.IsApplicationButtonVisible, AIsActive, not ViewInfo.UseGlass); +end; + +procedure TdxRibbonPainter.DrawTabScrollButton(ACanvas: TcxCanvas; + const ABounds: TRect; ALeft, APressed, AHot: Boolean); +const + ArrowDirection: array[Boolean] of TcxArrowDirection = (adRight, adLeft); +var + AState: Integer; +begin + if APressed then + AState := DXBAR_PRESSED + else if AHot then + AState := DXBAR_HOT + else + AState := DXBAR_NORMAL; + ColorScheme.DrawTabScrollButton(ACanvas.Handle, ABounds, ALeft, AState); + TcxCustomLookAndFeelPainter.DrawArrow(ACanvas, + cxRectInflate(ABounds, -2, 0, -2, -4), ArrowDirection[ALeft], clBlack); + ACanvas.ExcludeClipRect(ABounds); +end; + +procedure TdxRibbonPainter.DrawHelpButton(ACanvas: TcxCanvas; + const ABounds: TRect; AState: TdxBorderIconState); +begin + ColorScheme.DrawHelpButton(ACanvas.Handle, ABounds, AState); + ColorScheme.DrawHelpButtonGlyph(ACanvas.Handle, ABounds, nil); //!!!todo: + ACanvas.ExcludeClipRect(ABounds); +end; + +procedure TdxRibbonPainter.DrawMDIButton(ACanvas: TcxCanvas; const ABounds: TRect; + AButton: TdxBarMDIButton; AState: TdxBorderIconState); +begin + ColorScheme.DrawMDIButton(ACanvas.Handle, ABounds, AButton, AState); + ACanvas.ExcludeClipRect(ABounds); +end; + +procedure TdxRibbonPainter.DrawRibbonFormCaptionText(ACanvas: TcxCanvas; + const ABounds: TRect; const ADocumentName, ACaption: string; + const AData: TdxRibbonFormData); +var + R: TRect; +begin + ACanvas.Font := ViewInfo.GetFormCaptionFont(AData.Active); + R := ABounds; + if UseAeroNCPaint(AData) then + DrawRibbonGlassFormCaptionText(ACanvas, ABounds, ADocumentName, ACaption, True) + else + cxTextOut(ACanvas.Handle, PChar(ADocumentName + ACaption), R, + CXTO_PREVENT_LEFT_EXCEED or CXTO_CENTER_HORIZONTALLY or + CXTO_CENTER_VERTICALLY or CXTO_SINGLELINE or CXTO_END_ELLIPSIS, + 0, Length(ADocumentName), clNone, ViewInfo.GetDocumentNameTextColor(AData.Active)); +end; + +procedure TdxRibbonPainter.DrawRibbonGlassFormCaptionText(ACanvas: TcxCanvas; + const ABounds: TRect; const ADocumentName, ACaption: string; AIsActive: Boolean); + + function IsFormZoomed: Boolean; + var + F: TCustomForm; + begin + F := Ribbon.RibbonForm; + Result := (F <> nil) and F.HandleAllocated and IsZoomed(F.Handle); + end; + +var + R: TRect; + S: string; +begin + if IsFormZoomed then + begin + ACanvas.Brush.Style := bsClear; + ACanvas.Font.Color := clWhite; + ACanvas.DrawTexT(ADocumentName + ACaption, ABounds, cxAlignLeft or + cxAlignVCenter or cxSingleLine or cxShowEndEllipsis); + ACanvas.Brush.Style := bsSolid; + end + else + begin + R := ABounds; + S := cxGetStringAdjustedToWidth(ACanvas.Handle, ACanvas.Font.Handle, + ADocumentName + ACaption, cxRectWidth(R) - 2 * dxCaptionGlowRadius); + R.Right := R.Left + cxTextWidth(ACanvas.Font, S) + 2 * dxCaptionGlowRadius; + DrawGlowingText(ACanvas.Handle, S, ACanvas.Font, R, ACanvas.Font.Color, + DT_CENTER or DT_SINGLELINE or DT_END_ELLIPSIS or DT_VCENTER or DT_NOPREFIX); + end; +end; + +procedure TdxRibbonPainter.DrawRibbonFormCaption(ACanvas: TcxCanvas; + const ABounds: TRect; const AData: TdxRibbonFormData); +begin + if not UseAeroNCPaint(AData) then + ColorScheme.DrawFormCaption(ACanvas.Handle, ABounds, AData); + if Ribbon.Hidden then + DrawDefaultFormIcon(ACanvas, Ribbon.FormCaptionHelper.SysMenuIconBounds) + else + begin + if ViewInfo.IsQATAtNonClientArea then + DrawQuickAccessToolbar(ACanvas, ViewInfo.QuickAccessToolbarBounds, AData.Active); + if ViewInfo.IsApplicationButtonVisible then + DrawApplicationButton(ACanvas, ViewInfo.ApplicationButtonImageBounds, ViewInfo.ApplicationButtonState) + else + DrawDefaultFormIcon(ACanvas, Ribbon.FormCaptionHelper.SysMenuIconBounds); + end; + DrawRibbonFormCaptionText(ACanvas, ViewInfo.FormCaptionBounds, + ViewInfo.GetDocumentName, ViewInfo.GetCaption, AData); +end; + +procedure TdxRibbonPainter.DrawRibbonFormBorderIcon(ACanvas: TcxCanvas; + const ABounds: TRect; AIcon: TdxBorderDrawIcon; AState: TdxBorderIconState); +begin + ColorScheme.DrawFormBorderIcon(ACanvas.Handle, ABounds, AIcon, AState); +end; + +procedure TdxRibbonPainter.DrawRibbonFormBorders(ACanvas: TcxCanvas; + const ABordersWidth: TRect; const AData: TdxRibbonFormData); +begin + ColorScheme.DrawFormBorders(ACanvas.Handle, ABordersWidth, + Ribbon.GetRibbonFormCaptionHeight, AData); +end; + +procedure TdxRibbonPainter.DrawEmptyRibbon(ACanvas: TcxCanvas); +var + ABrush: HBRUSH; + APrevBkColor: TColor; +begin + APrevBkColor := GetBkColor(ACanvas.Handle); + SetBkColor(ACanvas.Handle, clSilver); + ABrush := CreateHatchBrush(HS_BDIAGONAL, clBlack); + FillRect(ACanvas.Handle, ViewInfo.Bounds, ABrush); + DeleteObject(ABrush); + SetBkColor(ACanvas.Handle, APrevBkColor); +end; + +function TdxRibbonPainter.GetFormIconHandle: HICON; +var + F: TCustomForm; +begin + F := GetParentForm(Ribbon); + if F is TForm then + Result := TForm(F).Icon.Handle + else + Result := 0; + if Result = 0 then + Result := Application.Icon.Handle; +end; + +function TdxRibbonPainter.GetColorScheme: TdxCustomRibbonSkin; +begin + Result := Ribbon.ColorScheme; +end; + +function TdxRibbonPainter.GetViewInfo: TdxRibbonViewInfo; +begin + Result := Ribbon.ViewInfo; +end; + +{ TdxRibbonTabViewInfo } + +constructor TdxRibbonTabViewInfo.Create(ATab: TdxRibbonTab); +begin + inherited Create; + FTab := ATab; + FPainter := GetPainterClass.Create(ATab.Ribbon.ColorScheme); +end; + +destructor TdxRibbonTabViewInfo.Destroy; +begin + FPainter.Free; + inherited Destroy; +end; + +procedure TdxRibbonTabViewInfo.Calculate(const ABounds: TRect; ASeparatorAlpha: Byte); +begin + Bounds := ABounds; + FSeparatorAlphaValue := ASeparatorAlpha; + if HasSeparator then + FSeparatorBounds := GetSeparatorBounds + else + FSeparatorBounds := cxEmptyRect; + FTextBounds := GetTextBounds; +end; + +function TdxRibbonTabViewInfo.HasSeparator: Boolean; +begin + Result := FCanHasSeparator and (FSeparatorAlphaValue > 0); +end; + +procedure TdxRibbonTabViewInfo.Paint(ACanvas: TcxCanvas); +begin + with Painter do + begin + DrawBackground(ACanvas, Bounds, State); + ACanvas.Font := Font; + DrawText(ACanvas, TextBounds, Tab.Caption, SeparatorAlphaValue = 255); + if HasSeparator then + DrawTabSeparator(ACanvas, SeparatorBounds, SeparatorAlphaValue); + if Tab.DesignSelectionHelper.IsComponentSelected then + ACanvas.DrawDesignSelection(cxRectInflate(Bounds, -2, -2)); + end; +end; + +procedure TdxRibbonTabViewInfo.CalculateWidths; +begin + Canvas.Font := Tab.Ribbon.Fonts.TabHeader; + FTextWidth := Canvas.TextWidth(Tab.Caption); + FOptimalWidth := FTextWidth + dxRibbonOptimalTabSpace; + FMinWidth := Max(Canvas.TextWidth(Copy(Tab.Caption, 1, 3)) + dxRibbonTabTextOffset * 2, + dxRibbonOptimalTabSpace); +end; + +function TdxRibbonTabViewInfo.GetPainterClass: TdxRibbonTabPainterClass; +begin + Result := TdxRibbonTabPainter; +end; + +function TdxRibbonTabViewInfo.GetTextBounds: TRect; +begin + Result := cxRectInflate(Bounds, -dxRibbonTabTextOffset, -4); +end; + +function TdxRibbonTabViewInfo.GetSeparatorBounds: TRect; +begin + Result := cxRect(Bounds.Right - dxRibbonTabSeparatorWidth, Bounds.Top, + Bounds.Right, Bounds.Bottom - 1); +end; + +function TdxRibbonTabViewInfo.GetState: TdxRibbonTabState; + + function GetFocusedState: TdxRibbonTabState; + begin + if Tab.Ribbon.AreGroupsVisible then + Result := rtsFocused + else + Result := rtsHot; + end; + +begin + with Tab do + begin + if Focused then + Result := GetFocusedState + else + if not (Highlighted or Active) then + Result := rtsNormal + else + begin + if Tab.Ribbon.AreGroupsVisible then + begin + if Active then + begin + if Highlighted and not Tab.Ribbon.IsPopupGroupsMode then + Result := rtsActiveHot + else + Result := rtsActive + end + else + if Highlighted then + Result := rtsHot + else + Result := rtsNormal; + end + else + if Highlighted then + Result := rtsHot + else + Result := rtsNormal; + end; + end; +end; + +function TdxRibbonTabViewInfo.IsSelected: Boolean; +begin + Result := Tab.DesignSelectionHelper.IsComponentSelected; +end; + +procedure TdxRibbonTabViewInfo.DrawBitmap(ABitmap: TBitmap; + AForeground: Boolean); +var + AState: TdxRibbonTabState; + ACanvas: TcxCanvas; + R: TRect; +begin + ACanvas := TcxCanvas.Create(ABitmap.Canvas); + try + R := Bounds; + OffsetRect(R, -R.Left, -R.Top); + {$IFDEF DELPHI10} + ABitmap.SetSize(R.Right, R.Bottom); + {$ELSE} + ABitmap.Width := R.Right; + ABitmap.Height := R.Bottom; + {$ENDIF} + ACanvas.Font := Font; + if AForeground then + begin + if Tab.Active then + AState := rtsActiveHot + else + AState := rtsHot + end + else + begin + if Tab.Active then + AState := rtsActive + else + AState := rtsNormal + end; + Painter.DrawBackground(ACanvas, R, AState); + R := TextBounds; + OffsetRect(R, -Bounds.Left, -Bounds.Top); + Painter.DrawText(ACanvas, R, Tab.Caption, HasSeparator); + finally + ACanvas.Free; + end; +end; + +function TdxRibbonTabViewInfo.GetCanvas: TcxCanvas; +begin + Result := FTab.Ribbon.Canvas; +end; + +function TdxRibbonTabViewInfo.GetFont: TFont; + + function GetTabState: Integer; + begin + //(rtsNormal, rtsHot, rtsActive, rtsActiveHot, rtsFocused); + if Tab.Active and Tab.Ribbon.AreGroupsVisible then + Result := DXBAR_ACTIVE + else + if State = rtsNormal then + Result := DXBAR_NORMAL + else + Result := DXBAR_HOT; + end; + +begin + Result := Tab.Ribbon.Fonts.GetTabHeaderFont(GetTabState); +end; + +{ TdxRibbonTabsViewInfo } + +constructor TdxRibbonTabsViewInfo.Create(AOwner: TdxRibbonViewInfo); +begin + inherited Create; + FOwner := AOwner; +end; + +procedure TdxRibbonTabsViewInfo.Calculate(const ABounds: TRect); +var + I, AHigh, AWidth: Integer; +begin + FBounds := ABounds; + FNeedShowHint := False; + FScrollButtons := []; + FSeparatorAlpha := 0; + AWidth := ABounds.Right - ABounds.Left; + FTotalMinimalWidth := 0; + FTotalOptimalWidth := 0; + FHasButtonOnRight := Owner.HasMDIButtons or Owner.HasHelpButton; + AHigh := Count - 1; + for I := 0 to AHigh do + with Items[I] do + begin + CalculateWidths; + Inc(FTotalOptimalWidth, OptimalWidth); + Inc(FTotalMinimalWidth, MinWidth); + FCanHasSeparator := (I < AHigh) or FHasButtonOnRight; + end; + if FTotalOptimalWidth <= AWidth then + CalculateSimpleTabLayout + else if FTotalMinimalWidth <= AWidth then + CalculateComplexTabLayout + else + CalculateScrollingTabLayout; +end; + +procedure TdxRibbonTabsViewInfo.Clear; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].Free; + inherited Clear; +end; + +function TdxRibbonTabsViewInfo.GetHitInfo(var AHitInfo: TdxRibbonHitInfo; + X, Y: Integer): Boolean; +var + I: Integer; +begin + AHitInfo.Tab := nil; + if (rsbLeft in ScrollButtons) and cxRectPtIn(FScrollButtonBounds[rsbLeft], X, Y) then + AHitInfo.HitTest := rhtTabScrollLeft + else if (rsbRight in ScrollButtons) and cxRectPtIn(FScrollButtonBounds[rsbRight], X, Y) then + AHitInfo.HitTest := rhtTabScrollRight + else + if cxRectPtIn(GetRealBounds, X, Y) then + for I := 0 to Count - 1 do + if cxRectPtIn(Items[I].Bounds, X, Y) then + begin + AHitInfo.HitTest := rhtTab; + AHitInfo.Tab := Items[I].Tab; + Break; + end; + Result := AHitInfo.HitTest in [rhtTab, rhtTabScrollLeft, rhtTabScrollRight]; +end; + +function TdxRibbonTabsViewInfo.GetRealBounds: TRect; +begin + Result := Bounds; + if rsbLeft in ScrollButtons then + Result.Left := FScrollButtonBounds[rsbLeft].Right; + if rsbRight in ScrollButtons then + Result.Right := FScrollButtonBounds[rsbRight].Left; +end; + +procedure TdxRibbonTabsViewInfo.Invalidate; +begin + Owner.Ribbon.InvalidateRect(Bounds, False); +end; + +procedure TdxRibbonTabsViewInfo.MakeTabVisible(ATab: TdxRibbonTab); +var + P, I: Integer; + R: TRect; +begin + if ScrollButtons = [] then Exit; + for I := 0 to Count - 1 do + if Items[I].Tab = ATab then + begin + R := Items[I].Bounds; + P := ScrollPosition; + if R.Left < Bounds.Left then + begin + Dec(P, Bounds.Left - R.Left); + if I > 0 then + Dec(P, Owner.ScrollButtonWidth); + end + else if R.Right > Bounds.Right then + begin + Inc(P, R.Right - Bounds.Right); + if I < Count - 1 then + Inc(P, Owner.ScrollButtonWidth); + end; + SetScrollPosition(P); + Break; + end; +end; + +procedure TdxRibbonTabsViewInfo.Paint(ACanvas: TcxCanvas); + + procedure DrawScrollButton(AButton: TdxRibbonScrollButton); + begin + Painter.DrawTabScrollButton(ACanvas, FScrollButtonBounds[AButton], AButton = rsbLeft, + ScrollButtonPressed[AButton], ScrollButtonHot[AButton]); + ACanvas.ExcludeClipRect(FScrollButtonBounds[AButton]); + end; + + procedure DrawScrollButtons; + begin + if rsbLeft in ScrollButtons then + DrawScrollButton(rsbLeft); + if rsbRight in ScrollButtons then + DrawScrollButton(rsbRight); + end; + + procedure ExcludeTabs; + var + I: Integer; + R: TRect; + begin + for I := 0 to Count - 1 do + begin + R := Items[I].Bounds; + cxRectIntersect(R, R, Bounds); + if not cxRectIsEmpty(R) then + ACanvas.ExcludeClipRect(R); + end; + end; + +var + I: Integer; +begin + DrawScrollButtons; + ACanvas.SaveClipRegion; + ACanvas.IntersectClipRect(GetRealBounds); + for I := 0 to Count - 1 do + Items[I].Paint(ACanvas); + ACanvas.RestoreClipRegion; + ExcludeTabs; +end; + +procedure TdxRibbonTabsViewInfo.UpdateDockControls; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].Tab.UpdateDockControl; +end; + +procedure TdxRibbonTabsViewInfo.UpdateTabList; +var + I: Integer; + ATab: TdxRibbonTab; +begin + Clear; + for I := 0 to Owner.Ribbon.TabCount - 1 do + begin + ATab := Owner.Ribbon.Tabs[I]; + if ATab.Visible then + Add(Owner.GetTabViewInfoClass.Create(ATab)); + end; +end; + +procedure TdxRibbonTabsViewInfo.BalancedReduce(ATotalDelta: Integer); +var + I: Integer; + ALimit: Integer; + AHasReduce: Boolean; +begin + FSeparatorAlpha := 255; + ALimit := GetLongestTabWidth - 1; + repeat + AHasReduce := False; + for I := 0 to Count - 1 do + with Items[I] do + if (Width > ALimit) and (Width > GetRealMinItemWidth(I)) then + begin + AHasReduce := True; + Dec(FWidth); + Dec(ATotalDelta); + if ATotalDelta = 0 then + Break; + end; + Dec(ALimit); + until (ATotalDelta = 0) or not AHasReduce; + FNeedShowHint := AHasReduce; +end; + +procedure TdxRibbonTabsViewInfo.CalculateComplexTabLayout; +var + I, ADelta, ASimpleReduceWidth: Integer; + R: TRect; +begin + RemoveScrolling; + R := Bounds; + ADelta := FTotalOptimalWidth - (R.Right - R.Left); + ASimpleReduceWidth := dxRibbonTabIndent * Count; + if ADelta <= ASimpleReduceWidth then + SimpleReduce(ADelta) + else + begin + Dec(ADelta, ASimpleReduceWidth); + BalancedReduce(ADelta); + end; + for I := 0 to Count - 1 do + with Items[I] do + begin + R.Right := R.Left + FWidth; + Calculate(R, FSeparatorAlpha); + R.Left := R.Right; + end; +end; + +procedure TdxRibbonTabsViewInfo.CalculateScrollingTabLayout; +var + I, AHight: Integer; + R: TRect; +begin + R := Bounds; + FSeparatorAlpha := 255; + FScrollWidth := GetScrollWidth; + CheckScrollPosition(FScrollPosition); + Dec(R.Left, FScrollPosition); + AHight := Count - 1; + for I := 0 to AHight do + with Items[I] do + begin + R.Right := R.Left + GetRealMinItemWidth(I); + Calculate(R, FSeparatorAlpha); + R.Left := R.Right; + end; + CalculateScrollButtons; + FNeedShowHint := True; +end; + +procedure TdxRibbonTabsViewInfo.CalculateSimpleTabLayout; +var + I, AHight: Integer; + R: TRect; +begin + RemoveScrolling; + R := Bounds; + AHight := Count - 1; + for I := 0 to AHight do + with Items[I] do + begin + R.Right := R.Left + OptimalWidth; + Calculate(R, 0); + R.Left := R.Right; + end; +end; + +procedure TdxRibbonTabsViewInfo.SimpleReduce(ATotalDelta: Integer); +var + I, ADelta, ARemainder: Integer; +begin + FSeparatorAlpha := MulDiv(ATotalDelta, 255, + Count * (dxRibbonOptimalTabSpace - dxRibbonTabTextOffset * 2)); + ADelta := ATotalDelta div Count; + ARemainder := ATotalDelta - (Count * ADelta); + for I := Count - 1 downto 0 do + with Items[I] do + begin + FWidth := OptimalWidth - ADelta; + if Count - I <= ARemainder then + Dec(FWidth); + end; +end; + +procedure TdxRibbonTabsViewInfo.CalculateScrollButtons; +var + AButtonWidth: Integer; +begin + AButtonWidth := Owner.GetScrollButtonWidth; + if FScrollPosition = 0 then + FScrollButtons := [rsbRight] + else if FScrollPosition = FScrollWidth then + FScrollButtons := [rsbLeft] + else + FScrollButtons := [rsbLeft, rsbRight]; + with Bounds do + begin + if rsbLeft in ScrollButtons then + FScrollButtonBounds[rsbLeft] := cxRect(Left, Top, Left + AButtonWidth, Bottom); + if rsbRight in ScrollButtons then + FScrollButtonBounds[rsbRight] := cxRect(Right - AButtonWidth, Top, Right, Bottom); + end; +end; + +procedure TdxRibbonTabsViewInfo.CheckScrollPosition(var Value: Integer); +begin + Value := Min(Max(0, Value), FScrollWidth); +end; + +function TdxRibbonTabsViewInfo.GetLongestTabWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + with Items[I] do + begin + FWidth := TextWidth + dxRibbonTabTextOffset * 2; + Result := Max(Result, Width); + end; +end; + +function TdxRibbonTabsViewInfo.GetPainter: TdxRibbonPainter; +begin + Result := Owner.Painter; +end; + +function TdxRibbonTabsViewInfo.GetRealMinItemWidth(Index: Integer): Integer; +begin + Result := GetTabViewInfo(Index).MinWidth; + if Index < Count - 1 then + Inc(Result, dxRibbonTabSeparatorWidth); +end; + +function TdxRibbonTabsViewInfo.GetScrollButtonBounds(Index: TdxRibbonScrollButton): TRect; +begin + Result := FScrollButtonBounds[Index]; +end; + +function TdxRibbonTabsViewInfo.GetScrollButtonHot(Index: TdxRibbonScrollButton): Boolean; +begin + with Owner.Ribbon.Controller do + Result := + ((HotObject = rhtTabScrollLeft) and (Index = rsbLeft)) or + ((HotObject = rhtTabScrollRight) and (Index = rsbRight)); +end; + +function TdxRibbonTabsViewInfo.GetScrollButtonPressed(Index: TdxRibbonScrollButton): Boolean; +begin + with Owner.Ribbon.Controller do + Result := + ((ScrollKind = rhtTabScrollLeft) and (Index = rsbLeft)) or + ((ScrollKind = rhtTabScrollRight) and (Index = rsbRight)); +end; + +function TdxRibbonTabsViewInfo.GetScrollWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + Inc(Result, GetRealMinItemWidth(I)); + Dec(Result, Bounds.Right - Bounds.Left); +end; + +function TdxRibbonTabsViewInfo.GetTabViewInfo( + Index: Integer): TdxRibbonTabViewInfo; +begin + Result := inherited Items[Index]; +end; + +procedure TdxRibbonTabsViewInfo.RemoveScrolling; +begin + FScrollPosition := 0; + FScrollButtons := []; + FScrollButtonBounds[rsbLeft] := cxEmptyRect; + FScrollButtonBounds[rsbRight] := cxEmptyRect; +end; + +procedure TdxRibbonTabsViewInfo.SetScrollPosition(Value: Integer); +begin + CheckScrollPosition(Value); + if FScrollPosition <> Value then + begin + FScrollPosition := Value; + Owner.Ribbon.Changed; + //CalculateScrollingTabLayout; + //Owner.Ribbon.InvalidateRect(Bounds, False); + end; +end; + +{ TdxRibbonViewInfo } + +constructor TdxRibbonViewInfo.Create(ARibbon: TdxCustomRibbon); +begin + inherited Create; + FRibbon := ARibbon; + FFont := TFont.Create; + FTabsViewInfo := TdxRibbonTabsViewInfo.Create(Self); +end; + +destructor TdxRibbonViewInfo.Destroy; +begin + FTabsViewInfo.Free; + FFont.Free; + inherited Destroy; +end; + +procedure TdxRibbonViewInfo.Calculate(const ABounds: TRect); +var + AForm: TdxCustomRibbonForm; +begin + FBounds := ABounds; + AForm := Ribbon.RibbonForm; + FSupportNonClientDrawing := Ribbon.SupportNonClientDrawing and (AForm <> nil); + FUseGlass := FSupportNonClientDrawing and AForm.IsUseAeroNCPaint; + Ribbon.Fonts.UpdateFonts; + CalculateApplicationButton; + CalculateQuickAccessToolbar; + CalculateRibbonFormCaption; + if (Ribbon.Hidden xor IsNeedHideControl) then + begin + Ribbon.FHidden := not Ribbon.FHidden; + Calculate(ABounds); + if Ribbon.Hidden and (Ribbon.ActiveTab <> nil) then + Ribbon.ActiveTab.UpdateDockControl; + end + else + begin + TabsViewInfo.UpdateTabList; + CalculateTabGroups; + CalculateMDIButtons; + CalculateHelpButton; + CalculateTabs; + SetSize; + end; +end; + +function TdxRibbonViewInfo.GetDocumentNameTextColor(AIsActive: Boolean): TColor; +begin + Result := Ribbon.Fonts.DocumentNameColor; + if Result = clDefault then + Result := Ribbon.ColorScheme.GetPartColor(rspDocumentNameText, Ord(not AIsActive)); +end; + +function TdxRibbonViewInfo.GetFormCaptionFont(AIsActive: Boolean): TFont; +begin + Result := Ribbon.Fonts.GetFormCaptionFont(AIsActive); +end; + +function TdxRibbonViewInfo.GetFormCaptionText: TCaption; +begin + Result := GetDocumentName + GetCaption; +end; + +function TdxRibbonViewInfo.GetHitInfo(X, Y: Integer): TdxRibbonHitInfo; +begin + Result.HitTest := rhtNone; + Result.Tab := nil; + CheckButtonsHitTest(Result.HitTest, X, Y); + if (Result.HitTest = rhtNone) and + not (TabsViewInfo.GetHitInfo(Result, X, Y) or GroupsDockControlSiteViewInfo.GetHitInfo(Result, X, Y)) then + begin + if IsApplicationButtonVisible and cxRectPtIn(ApplicationButtonImageBounds, X, Y) then + Result.HitTest := rhtApplicationMenu; + end; +end; + +function TdxRibbonViewInfo.GetTabAtPos(X, Y: Integer): TdxRibbonTab; +var + I: Integer; +begin + for I := 0 to TabsViewInfo.Count - 1 do + if PtInRect(TabsViewInfo[I].Bounds, Point(X, Y)) then + begin + Result := TabsViewInfo[I].Tab; + Exit; + end; + Result := nil; +end; + +procedure TdxRibbonViewInfo.Paint(ACanvas: TcxCanvas); +begin + if DrawEmptyRibbon then + begin + Painter.DrawEmptyRibbon(ACanvas); + Exit; + end; + DrawRibbonBackground(ACanvas); + if HasMDIButtons then + DrawMDIButtons(ACanvas); + if HasHelpButton then + DrawHelpButton(ACanvas); + if IsQATVisible and not IsQATAtNonClientArea then + Painter.DrawQuickAccessToolbar(ACanvas, QuickAccessToolbarBounds, True); + if IsNeedDrawBottomLine then + Painter.DrawBottomBorder(ACanvas); + if IsTabsVisible and (TabsViewInfo.Count > 0) then + TabsViewInfo.Paint(ACanvas); + if IsTabGroupsVisible then + Painter.DrawGroupsArea(ACanvas, GroupsDockControlSiteBounds); + if IsApplicationButtonVisible then + Painter.DrawApplicationButton(ACanvas, ApplicationButtonImageBounds, + ApplicationButtonState); +end; + +procedure TdxRibbonViewInfo.UpdateQATDockControl; +begin + with QATDockControl do + begin + HandleNeeded; + Visible := IsQATVisible; + if Visible then + BoundsRect := GetQATDockControlBounds + else + UpdateBoundsRect(GetQATDockControlBounds); + end; +end; + +function TdxRibbonViewInfo.GetRibbonHeight: Integer; +begin + if IsQATVisible and IsQATAtBottom and not Ribbon.IsPopupGroupsMode then + Result := GetQATBounds.Bottom + else + begin + if IsTabGroupsVisible and not Ribbon.IsPopupGroupsMode then + Result := GetGroupsDockControlSiteBounds.Bottom + else + Result := TabsHeight + GetTabsVerticalOffset + 1; + end; + FDrawEmptyRibbon := (Result < 8) and Ribbon.IsDesigning; + if FDrawEmptyRibbon then + Result := dxRibbonEmptyHeight; +end; + +procedure TdxRibbonViewInfo.CalculateApplicationButton; +begin + if IsApplicationButtonVisible then + begin + FApplicationButtonBounds := GetApplicationButtonBounds; + FApplicationButtonImageBounds := GetApplicationButtonImageBounds; + end + else + begin + FApplicationButtonBounds := cxEmptyRect; + FApplicationButtonImageBounds := cxEmptyRect; + end; +end; + +procedure TdxRibbonViewInfo.CalculateQuickAccessToolbar; +begin + if IsQATVisible then + begin + FQATBarControlSize := GetQATBarControlSize; + FQuickAccessToolbarBounds := GetQATBounds; + end + else + FQuickAccessToolbarBounds := cxEmptyRect; + UpdateQATDockControl; +end; + +procedure TdxRibbonViewInfo.CalculateRibbonFormCaption; +begin + if SupportNonClientDrawing then + FFormCaptionBounds := GetRibbonFormCaptionTextBounds + else + FFormCaptionBounds := cxEmptyRect; +end; + +procedure TdxRibbonViewInfo.CalculateTabGroups; +begin + if IsTabGroupsVisible and not Ribbon.IsPopupGroupsMode then + begin + FGroupsDockControlSiteBounds := GetGroupsDockControlSiteBounds; + FTabGroupsDockControlBounds := GetTabGroupsDockControlBounds; + end + else + begin + FGroupsDockControlSiteBounds := cxEmptyRect; + FTabGroupsDockControlBounds := cxEmptyRect; + end; + if not Ribbon.IsPopupGroupsMode then + begin + UpdateGroupsDockControlSite; + if IsTabGroupsVisible then + TabsViewInfo.UpdateDockControls; + end; +end; + +procedure TdxRibbonViewInfo.CalculateTabs; +begin + if IsTabsVisible and (TabsViewInfo.Count > 0) then + TabsViewInfo.Calculate(GetTabsBounds); +end; + +procedure TdxRibbonViewInfo.CheckButtonsHitTest(var AHitTest: TdxRibbonHitTest; X: Integer; Y: Integer); +begin + if HasMDIButtons then + CheckMDIButtonsHitTest(AHitTest, X, Y); + if (AHitTest = rhtNone) and HasHelpButton then + CheckHelpButtonHitTest(AHitTest, X, Y); +end; + +function TdxRibbonViewInfo.GetApplicationButtonBounds: TRect; +begin + with GetApplicationButtonSize do + Result := cxRectBounds(0, 0, cx, cy); + with GetApplicationButtonOffset do + begin + Inc(Result.Right, Left + Right); + Inc(Result.Bottom, Top + Bottom); + end; +end; + +function TdxRibbonViewInfo.GetApplicationButtonGlyphSize: TSize; +begin + Result := Ribbon.ColorScheme.GetApplicationMenuGlyphSize; +end; + +function TdxRibbonViewInfo.GetApplicationButtonImageBounds: TRect; +begin + Result := cxRectCenter(ApplicationButtonBounds, GetApplicationButtonSize); +end; + +function TdxRibbonViewInfo.GetApplicationButtonOffset: TRect; +begin + Result := cxRect(WidthToCurrentDpi(dxRibbonApplicationButtonIndent), + WidthToCurrentDpi(dxRibbonApplicationButtonIndent * 2 + 2), + WidthToCurrentDpi(dxRibbonApplicationButtonIndent), 0); +end; + +function TdxRibbonViewInfo.GetApplicationButtonRegion: HRGN; +begin + if IsApplicationButtonVisible then + Result := CreateRectRgnIndirect(ApplicationButtonBounds) + else + Result := 0; +end; + +function TdxRibbonViewInfo.GetApplicationButtonSize: TSize; +begin + with GetApplicationButtonGlyphSize do + begin + Result.cx := WidthToCurrentDpi(cx); + Result.cy := WidthToCurrentDpi(cy); + end; +end; + +function TdxRibbonViewInfo.GetApplicationButtonState: TdxApplicationButtonState; +begin + if Ribbon.ApplicationButtonIAccessibilityHelper.IsSelected then + Result := absHot + else + Result := Ribbon.ApplicationButtonState; +end; + +function TdxRibbonViewInfo.GetNonClientAreaHeight: Integer; +begin + if SupportNonClientDrawing then + Result := Ribbon.GetRibbonFormCaptionHeight + else + Result := 0; +end; + +function TdxRibbonViewInfo.GetCaption: string; +begin + if Ribbon.RibbonForm <> nil then + begin + Result := Ribbon.RibbonForm.Caption; + if GetDocumentName <> '' then + Result := ' - ' + Result; + end + else + Result := ''; +end; + +function TdxRibbonViewInfo.GetDocumentName: string; +begin + Result := Ribbon.DocumentName; +end; + +function TdxRibbonViewInfo.GetRibbonFormCaptionClientBounds: TRect; +begin + Result := Ribbon.FormCaptionHelper.TextBounds; + if not Ribbon.Hidden then + begin + if IsQATAtNonClientArea then + Result.Left := GetQATBounds.Right + + Ribbon.ColorScheme.GetQuickAccessToolbarRightIndent(IsApplicationButtonVisible) + else + if IsApplicationButtonVisible then + Result.Left := ApplicationButtonBounds.Right; + Result.Bottom := GetNonClientAreaHeight; + end; +end; + +function TdxRibbonViewInfo.GetRibbonFormCaptionTextBounds: TRect; +var + W, AExtraSpace: Integer; + R: TRect; +begin + Result := GetRibbonFormCaptionClientBounds; + InflateRect(Result, -dxRibbonFormCaptionTextSpace, 0); + W := cxTextWidth(GetFormCaptionFont(True), GetFormCaptionText); + if UseGlass then + AExtraSpace := 2 * dxCaptionGlowRadius // add a glow radious around text + else + AExtraSpace := 0; + Inc(W, AExtraSpace); + R := cxRect(Bounds.Left + dxRibbonFormCaptionTextSpace, + Result.Top, Bounds.Right - dxRibbonFormCaptionTextSpace, Result.Bottom); + W := cxRectWidth(R) - W; + if (W >= 0) {and (Ribbon.RibbonForm.FormStyle <> fsMDIChild)} then + begin + Inc(R.Left, W div 2); + Dec(R.Right, W div 2 - 1); + if cxRectContain(Result, R) then + Result := R; + end; +end; + +function TdxRibbonViewInfo.GetQATAvailWidth: Integer; +var + R: TRect; + ALeft, ARight: Integer; +begin + ALeft := 0; + ARight := Bounds.Right; + if not IsQATAtBottom then + begin + if IsApplicationButtonVisible then + ALeft := ApplicationButtonBounds.Right - GetQATOverrideWidth; + if SupportNonClientDrawing then + begin + R := Ribbon.FormCaptionHelper.TextBounds; + Inc(R.Left, Ribbon.ColorScheme.GetQuickAccessToolbarRightIndent(IsApplicationButtonVisible)); + if UseGlass then + Dec(R.Right, 2 * dxCaptionGlowRadius); + ALeft := Max(R.Left, ALeft); + ARight := R.Right - dxRibbonFormCaptionMinWidth; + end; + end; + Result := Max(ARight - ALeft, 0); +end; + +function TdxRibbonViewInfo.GetQATBarControlSize: TSize; +var + AControl: TdxBarControl; + AvailControlWidth: Integer; +begin + Result.cx := 0; + Result.cy := 0; + if IsQATVisible then + begin + AControl := Ribbon.QuickAccessToolbar.Toolbar.Control; + if AControl is TdxRibbonQuickAccessBarControl then + begin + AvailControlWidth := GetQATAvailWidth; + with GetQATDockControlOffset do + Dec(AvailControlWidth, Left + Right); + Result := TdxRibbonQuickAccessBarControl(AControl).GetSize(AvailControlWidth); + end; + end; +end; + +function TdxRibbonViewInfo.GetQATBounds: TRect; +begin + Result := cxRectBounds(GetQATLeft, GetQATTop, GetQATWidth, GetQATHeight); +end; + +function TdxRibbonViewInfo.GetQATHeight: Integer; +begin + Result := 0; + if IsQATVisible then + begin + Result := FQATBarControlSize.cy; + with GetQATDockControlOffset do + Inc(Result, Top + Bottom); + end; +end; + +function TdxRibbonViewInfo.GetQATLeft: Integer; +var + AApplicationButtonVisible: Boolean; +begin + Result := Bounds.Left; + if not IsQATAtBottom then + begin + AApplicationButtonVisible := IsApplicationButtonVisible; + Inc(Result, 2); + if AApplicationButtonVisible then + Result := ApplicationButtonBounds.Right - GetQATOverrideWidth + else + if SupportNonClientDrawing then + Result := Ribbon.FormCaptionHelper.TextBounds.Left + 4; + Inc(Result, Ribbon.ColorScheme.GetQuickAccessToolbarLeftIndent( + AApplicationButtonVisible, UseGlass)); + end; +end; + +function TdxRibbonViewInfo.GetQATOverrideWidth(AIgnoreHidden: Boolean = False): Integer; +begin + Result := Ribbon.ColorScheme.GetQuickAccessToolbarOverrideWidth( + IsApplicationButtonVisible(AIgnoreHidden), UseGlass); +end; + +function TdxRibbonViewInfo.GetQATTop: Integer; +begin + Result := 0; + if IsQATAtBottom then + begin + Result := GetNonClientAreaHeight + TabsHeight + GetTabGroupsHeight; + if IsTabsVisible then + Dec(Result); + end; +end; + +function TdxRibbonViewInfo.GetQATWidth: Integer; +begin + Result := 0; + if IsQATVisible then + begin + if not IsQATAtBottom then + begin + Result := FQATBarControlSize.cx; + with GetQATDockControlOffset do + Inc(Result, Left + Right); + end + else + Result := Bounds.Right; + end; +end; + +function TdxRibbonViewInfo.GetQATDockControlBounds: TRect; +begin + with GetQATDockControlOffset do + Result := cxRectInflate(QuickAccessToolbarBounds, -Left, -Top, -Right, -Bottom); + Result.Right := Result.Left + FQATBarControlSize.cx; +end; + +function TdxRibbonViewInfo.GetQATDockControlOffset(AIgnoreHidden: Boolean = False): TRect; +var + H: Integer; +begin + if not IsQATAtBottom then + begin + Result := cxRect(GetQATOverrideWidth(AIgnoreHidden) + 1, 0, 0, 0); + if (FQATBarControlSize.cx <> 0) and (Ribbon.PopupMenuItems = []) then + begin + Inc(Result.Right, ((FQATBarControlSize.cy + 2) div 2) or 1); + Inc(Result.Right, 12); + end; + if SupportNonClientDrawing then + begin + H := GetNonClientAreaHeight - FQATBarControlSize.cy; + Result.Bottom := H div 2; + Result.Top := H - Result.Bottom; + end + else + begin + Result.Top := 4; + Result.Bottom := 5; + end; + end + else + Result := cxRect(2, 2, 2, 2); +end; + +function TdxRibbonViewInfo.GetGroupsDockControlSiteBounds: TRect; +begin + Result := Bounds; + Inc(Result.Top, GetTabsVerticalOffset); + Inc(Result.Top, GetTabsHeight); + if IsTabsVisible then + Dec(Result.Top); + Result.Bottom := Result.Top + GetTabGroupsHeight; +end; + +function TdxRibbonViewInfo.GetTabGroupsDockControlBounds: TRect; +begin + Result := GetGroupsDockControlSiteBounds; + OffsetRect(Result, -Result.Left, -Result.Top); + with GetTabGroupsDockControlOffset do + Result := cxRectInflate(Result, -Left, -Top, -Right, -Bottom); +end; + +function TdxRibbonViewInfo.GetTabGroupsDockControlOffset: TRect; +begin + Result := cxRect(4, 3, 4, 4); +end; + +function TdxRibbonViewInfo.GetTabsBounds: TRect; +begin + Result := Bounds; + Result.Left := Max(ApplicationButtonBounds.Right, dxRibbonTabsLeftSpace); + if HasHelpButton then + Result.Right := FHelpButtonBounds.Left - 1 + else + if HasMDIButtons then + Result.Right := FMDIButtonBounds[mdibMinimize].Left - 1 + else + Dec(Result.Right, dxRibbonTabsRightSpace); + Result.Bottom := Result.Top + TabsHeight; + OffsetRect(Result, 0, GetTabsVerticalOffset); +end; + +function TdxRibbonViewInfo.GetTabsHeight: Integer; +var + AFont: TFont; +begin + Result := 0; + if not IsTabsVisible then + Exit; + AFont := Ribbon.Fonts.TabHeader; + Result := Abs(AFont.Height) * 2 + 2; +end; + +function TdxRibbonViewInfo.GetTabGroupsHeight(AIgnoreHidden: Boolean = False): Integer; +begin + if IsTabGroupsVisible or AIgnoreHidden then + begin + Result := Ribbon.GetGroupHeight; + with GetTabGroupsDockControlOffset do + Inc(Result, Top + Bottom); + end + else + Result := 0; +end; + +function TdxRibbonViewInfo.GetTabViewInfoClass: TdxRibbonTabViewInfoClass; +begin + Result := TdxRibbonTabViewInfo; +end; + +procedure TdxRibbonViewInfo.CalculateMDIButtons; +var + AButton: TdxBarMDIButton; + R: TRect; +begin + if HasMDIButtons then + begin + R := Bounds; + R.Bottom := R.Top + TabsHeight - 2; + OffsetRect(R, 0, GetTabsVerticalOffset); + R.Left := R.Right - (R.Bottom - R.Top); + for AButton := High(AButton) downto Low(AButton) do + begin + FMDIButtonBounds[AButton] := R; + OffsetRect(R, -(R.Right - R.Left), 0); + end; + end + else + for AButton := Low(AButton) to High(AButton) do + FMDIButtonBounds[AButton] := cxEmptyRect; +end; + +procedure TdxRibbonViewInfo.DrawMDIButtons(ACanvas: TcxCanvas); +var + AButton: TdxBarMDIButton; +begin + for AButton := Low(AButton) to High(AButton) do + Painter.DrawMDIButton(ACanvas, FMDIButtonBounds[AButton], AButton, GetMDIButtonState(AButton)); +end; + +function TdxRibbonViewInfo.HasMDIButtons: Boolean; +begin + if not Ribbon.Hidden and IsTabsVisible and Ribbon.IsBarManagerValid then + Result := Ribbon.BarManager.IsMDIMaximized and (GetSystemMenu(Ribbon.BarManager.ActiveMDIChild, False) <> 0) + else + Result := False; +end; + +procedure TdxRibbonViewInfo.InvalidateMDIButtons; +var + R: TRect; +begin + if not HasMDIButtons then Exit; + R := FMDIButtonBounds[mdibMinimize]; + R.Right := FMDIButtonBounds[mdibClose].Right; + Ribbon.InvalidateRect(R, False); +end; + +function TdxRibbonViewInfo.IsMDIButtonEnabled(AButton: TdxBarMDIButton; + AState: Integer): Boolean; +begin + Result := ((AButton = mdibRestore) or + (GetMenuState(GetSystemMenu(Ribbon.BarManager.ActiveMDIChild, False), + MDIButtonCommands[AButton], MF_BYCOMMAND) and AState = 0)); +end; + +function TdxRibbonViewInfo.IsApplicationButtonVisible(AIgnoreHidden: Boolean = False): Boolean; +begin + Result := (not Ribbon.Hidden or AIgnoreHidden) and + Ribbon.ApplicationButton.Visible and IsTabsVisible(AIgnoreHidden) and + (SupportNonClientDrawing or (IsQATVisible(AIgnoreHidden) and not IsQATAtBottom)); +end; + +function TdxRibbonViewInfo.IsQATAtNonClientArea(AIgnoreHidden: Boolean = False): Boolean; +begin + Result := SupportNonClientDrawing and not IsQATAtBottom and + IsQATVisible(AIgnoreHidden); +end; + +function TdxRibbonViewInfo.IsQATOnGlass: Boolean; +begin + Result := UseGlass and IsQATAtNonClientArea; +end; + +function TdxRibbonViewInfo.IsQATVisible(AIgnoreHidden: Boolean = False): Boolean; +begin + with Ribbon.QuickAccessToolbar do + Result := CanShowBarControls(AIgnoreHidden) and + Visible and (Toolbar <> nil) and Toolbar.Visible; +end; + +function TdxRibbonViewInfo.IsTabGroupsVisible(AIgnoreHidden: Boolean = False): Boolean; +begin + Result := CanShowBarControls(AIgnoreHidden) and + (Ribbon.ShowTabGroups or Ribbon.IsPopupGroupsMode) and (TabsViewInfo.Count > 0); +end; + +function TdxRibbonViewInfo.IsTabsVisible(AIgnoreHidden: Boolean = False): Boolean; +begin + Result := (not Ribbon.Hidden or AIgnoreHidden) and Ribbon.ShowTabHeaders; +end; + +procedure TdxRibbonViewInfo.CalculateHelpButton; +begin + if HasHelpButton then + begin + FHelpButtonBounds := Bounds; + FHelpButtonBounds.Bottom := FHelpButtonBounds.Top + TabsHeight - 2; + OffsetRect(FHelpButtonBounds, 0, GetTabsVerticalOffset); + if HasMDIButtons then + FHelpButtonBounds.Right := FMDIButtonBounds[mdibMinimize].Left; + FHelpButtonBounds.Left := FHelpButtonBounds.Right - + (FHelpButtonBounds.Bottom - FHelpButtonBounds.Top); + end + else + FHelpButtonBounds := cxEmptyRect; +end; + +function TdxRibbonViewInfo.CanShowBarControls( + AIgnoreHidden: Boolean = False): Boolean; +begin + Result := Ribbon.IsBarManagerValid and (not Ribbon.Hidden or AIgnoreHidden); +end; + +procedure TdxRibbonViewInfo.DrawHelpButton(ACanvas: TcxCanvas); +begin + Painter.DrawHelpButton(ACanvas, FHelpButtonBounds, GetButtonState(rhtHelpButton)); +end; + +procedure TdxRibbonViewInfo.DrawRibbonBackground(ACanvas: TcxCanvas); +var + R: TRect; +begin + R := Bounds; + R.Top := FFormCaptionBounds.Bottom; + ACanvas.SaveClipRegion; + ACanvas.IntersectClipRect(R); + Painter.DrawBackground(ACanvas, Bounds); + ACanvas.RestoreClipRegion; +end; + +function TdxRibbonViewInfo.HasHelpButton: Boolean; +begin + if not Ribbon.Hidden and IsTabsVisible then + Result := Assigned(Ribbon.OnHelpButtonClick) + else + Result := False; +end; + +procedure TdxRibbonViewInfo.InvalidateHelpButton; +begin + if HasHelpButton then + Ribbon.InvalidateRect(FHelpButtonBounds, False); +end; + +function TdxRibbonViewInfo.IsNeedDrawBottomLine: Boolean; +begin + Result := IsTabsVisible and (not IsTabGroupsVisible or Ribbon.IsPopupGroupsMode) and + (not IsQATVisible or not IsQATAtBottom); +end; + +function TdxRibbonViewInfo.IsNeedHideControl: Boolean; +var + F: TCustomForm; +begin + if Ribbon.IsDesigning then + begin + Result := False; + Exit; + end; + F := GetParentForm(Ribbon); + Result := (F <> nil) and + (IsIconic(F.Handle) or (F.Width < dxRibbonOwnerMinimalWidth) or + (F.Height < dxRibbonOwnerMinimalHeight)); +end; + +function TdxRibbonViewInfo.IsQATAtBottom: Boolean; +begin + Result := Ribbon.QuickAccessToolbar.Position = qtpBelowRibbon; +end; + +procedure TdxRibbonViewInfo.SetSize; +begin + if Ribbon.Hidden and not Ribbon.IsDesigning then + Ribbon.Height := GetNonClientAreaHeight + else + Ribbon.Height := GetRibbonHeight; +end; + +procedure TdxRibbonViewInfo.CheckHelpButtonHitTest(var AHitTest: TdxRibbonHitTest; X: Integer; Y: Integer); +begin + if cxRectPtIn(FHelpButtonBounds, X, Y) then + AHitTest := rhtHelpButton; +end; + +procedure TdxRibbonViewInfo.CheckMDIButtonsHitTest(var AHitTest: TdxRibbonHitTest; X: Integer; Y: Integer); +const + MDIButtonToHitTest: array[TdxBarMDIButton] of TdxRibbonHitTest = + (rhtMDIMinimizeButton, rhtMDIRestoreButton, rhtMDICloseButton); +var + AButton: TdxBarMDIButton; +begin + for AButton := Low(TdxBarMDIButton) to High(TdxBarMDIButton) do + if cxRectPtIn(FMDIButtonBounds[AButton], X, Y) then + begin + AHitTest := MDIButtonToHitTest[AButton]; + Break; + end; +end; + +function TdxRibbonViewInfo.GetButtonState(AButton: TdxRibbonHitTest): TdxBorderIconState; +var + AHasPressedObject: Boolean; +begin + with Ribbon.Controller do + begin + AHasPressedObject := not (PressedObject in [rhtNone, rhtTab]); + if (HotObject <> AButton) or (AHasPressedObject and (PressedObject <> AButton)) then + Result := bisNormal + else + if AHasPressedObject and (PressedObject = AButton) then + Result := bisPressed + else + Result := bisHot + end; +end; + +function TdxRibbonViewInfo.GetCanvas: TcxCanvas; +begin + Result := Ribbon.Canvas; +end; + +function TdxRibbonViewInfo.GetGroupsDockControlSiteViewInfo: TdxRibbonGroupsDockControlSiteViewInfo; +begin + Result := Ribbon.GroupsDockControlSite.ViewInfo; +end; + +function TdxRibbonViewInfo.GetIsFormCaptionActive: Boolean; +begin + Result := SupportNonClientDrawing and Ribbon.RibbonForm.IsActive; +end; + +function TdxRibbonViewInfo.GetMDIButtonState(AButton: TdxBarMDIButton): TdxBorderIconState; +const + ConvertButtons: array[TdxBarMDIButton] of TdxRibbonHitTest = + (rhtMDIMinimizeButton, rhtMDIRestoreButton, rhtMDICloseButton); +begin + if IsMDIButtonEnabled(AButton, 0) then + Result := GetButtonState(ConvertButtons[AButton]) + else + Result := bisInactive; +end; + +function TdxRibbonViewInfo.GetPainter: TdxRibbonPainter; +begin + Result := Ribbon.Painter; +end; + +function TdxRibbonViewInfo.GetQATDockControl: TdxRibbonQuickAccessDockControl; +begin + Result := Ribbon.QuickAccessToolbar.DockControl; +end; + +function TdxRibbonViewInfo.GetScrollButtonWidth: Integer; +var + AFont: TFont; +begin + AFont := Ribbon.Fonts.TabHeader; + Result := (Abs(AFont.Height) * 2 + 2) div 2 + 1; +end; + +function TdxRibbonViewInfo.GetTabsVerticalOffset: Integer; +begin + if SupportNonClientDrawing then + Result := GetNonClientAreaHeight + else + if IsQATVisible and (Ribbon.QuickAccessToolbar.Position = qtpAboveRibbon) then + Result := GetQATBounds.Bottom + else + Result := 0; +end; + +procedure TdxRibbonViewInfo.UpdateGroupsDockControlSite; +begin + Ribbon.GroupsDockControlSite.BoundsRect := GroupsDockControlSiteBounds; +end; + +function TdxRibbonViewInfo.GetPainterClass: TdxRibbonPainterClass; +begin + Result := TdxRibbonPainter; +end; + +{ TdxRibbonBarPainter } + +constructor TdxRibbonBarPainter.Create(AData: Integer); + + function GetDefaultGroupHeight: Integer; + const + DefaultFontHeight = 13; + begin + Result := Skin.GetContentOffsets(DXBAR_COLLAPSEDTOOLBAR).Top + + GetButtonHeight(GetSmallIconSize, DefaultFontHeight + dxRibbonGroupRowHeightCorrection) * dxRibbonGroupRowCount + + dxRibbonGroupCaptionOffsets.Top + InternalGetGroupCaptionHeight(DefaultFontHeight) + dxRibbonGroupCaptionOffsets.Bottom; + end; + +begin + inherited Create(AData); + FRibbon := TdxCustomRibbon(AData); + FDrawParams := TdxBarButtonLikeControlDrawParams.Create(nil); + with Skin.GetContentOffsets(DXBAR_COLLAPSEDTOOLBARGLYPHBACKGROUND) do + FCollapsedGroupElementSizeNumerator := GetSmallIconSize + Top + Bottom + dxRibbonCollapsedGroupGlyphBackgroundOffsets.Top + dxRibbonCollapsedGroupGlyphBackgroundOffsets.Bottom; + FCollapsedGroupElementSizeDenominator := GetDefaultGroupHeight; + with Skin.GetContentOffsets(DXBAR_COLLAPSEDTOOLBAR) do + Dec(FCollapsedGroupElementSizeDenominator, Top + Bottom); +end; + +destructor TdxRibbonBarPainter.Destroy; +begin + FreeAndNil(FDrawParams); + inherited Destroy; +end; + +procedure TdxRibbonBarPainter.BarDrawBackground(ABarControl: TdxBarControl; + ADC: HDC; const ADestRect: TRect; const ASourceRect: TRect; ABrush: HBRUSH; + AColor: TColor); +begin + BarCanvas.BeginPaint(ADC); + try + BarCanvas.SetClipRegion(TcxRegion.Create(ADestRect), roIntersect); + TdxRibbonGroupBarControl(ABarControl).DrawBarParentBackground(BarCanvas); + DrawToolbarContentPart(ABarControl, BarCanvas); + finally + BarCanvas.EndPaint; + end; +end; + +function TdxRibbonBarPainter.BarMarkRect( + ABarControl: TdxBarControl): TRect; +begin + Result := ABarControl.ClientRect; +end; + +function TdxRibbonBarPainter.BarMarkItemRect( + ABarControl: TdxBarControl): TRect; +begin + Result := ABarControl.ClientRect; +end; + +function TdxRibbonBarPainter.GetGroupRowHeight(AIconSize: Integer; + AGroupFont: TFont): Integer; +//var +// ACanvas: TcxScreenCanvas; +begin +// ACanvas.Font := Font; +// ACanvas.Font.Height := -MulDiv(ACanvas.Font.Size, 96, 72); +// AScreenLogPixels := GetDeviceCaps(ACanvas.Handle, LOGPIXELSY); +// Result := ACanvas.TextHeight('Wg'); +// Result := Result * 22 div 13; +// Result := Result * AScreenLogPixels div 96; + + Result := GetButtonHeight(AIconSize, cxTextHeight(AGroupFont) + dxRibbonGroupRowHeightCorrection); +end; + +function TdxRibbonBarPainter.GetToolbarContentOffsets(ABar: TdxBar; + ADockingStyle: TdxBarDockingStyle; AHasSizeGrip: Boolean): TRect; +begin + if TdxRibbonGroupBarControl(ABar.Control).Collapsed then + Result := cxEmptyRect + else + Result := inherited GetToolbarContentOffsets(ABar, ADockingStyle, AHasSizeGrip); +end; + +function TdxRibbonBarPainter.SubMenuControlBeginGroupSize: Integer; +begin + Result := Ribbon.ColorScheme.GetMenuSeparatorSize; +end; + +function TdxRibbonBarPainter.SubMenuGetSeparatorSize: Integer; +begin + Result := Ribbon.ColorScheme.GetMenuSeparatorSize; +end; + +procedure TdxRibbonBarPainter.DrawToolbarContentPart( + ABarControl: TdxBarControl; ACanvas: TcxCanvas); + + procedure InitDrawParams(AState: Integer); + begin + case AState of + DXBAR_PRESSED: + begin + DrawParams.HotPartIndex := icpControl; + DrawParams.IsPressed := True; + end; + DXBAR_HOT: DrawParams.HotPartIndex := icpControl; + DXBAR_NORMAL: DrawParams.HotPartIndex := icpNone; + end; + DrawParams.Canvas := ACanvas; + DrawParams.Caption := TdxRibbonGroupBarControl(ABarControl).GetCaption; + DrawParams.IsDropDown := True; + DrawParams.ViewSize := cvsLarge; + DrawParams.Enabled := True; + DrawParams.CanSelect := True; + end; + +var + ACaptionRect, R: TRect; + AGroupGlyphBackgroundSize, AGroupGlyphSize: TSize; + AGroupState: Integer; +begin + if not TdxRibbonGroupBarControl(ABarControl).Collapsed then + begin + inherited DrawToolbarContentPart(ABarControl, ACanvas); + Exit; + end; + + AGroupState := GetGroupState(ABarControl); + Skin.DrawBackground(ACanvas.Handle, ABarControl.ClientRect, DXBAR_COLLAPSEDTOOLBAR, AGroupState); + ACaptionRect := GetCollapsedGroupCaptionRect(ABarControl.ClientRect); + + InitDrawParams(AGroupState); + //#DG ABarControl.Canvas.Font := ABarControl.Font; + ButtonLikeControlDoDrawCaption(DrawParams, ACaptionRect, DT_CENTER); + + R := ABarControl.ClientRect; + ExtendRect(R, Skin.GetContentOffsets(DXBAR_COLLAPSEDTOOLBAR)); + R.Bottom := ACaptionRect.Top; + AGroupGlyphBackgroundSize := GetCollapsedGroupGlyphBackgroundSize(ABarControl); + Inc(R.Left, (cxRectWidth(R) - AGroupGlyphBackgroundSize.cx) div 2); + R.Right := R.Left + AGroupGlyphBackgroundSize.cx; + ExtendRect(R, Rect(0, dxRibbonCollapsedGroupGlyphBackgroundOffsets.Top, 0, dxRibbonCollapsedGroupGlyphBackgroundOffsets.Bottom)); + Inc(R.Top, (cxRectHeight(R) - AGroupGlyphBackgroundSize.cy) div 2); + R.Bottom := R.Top + AGroupGlyphBackgroundSize.cy; + Skin.DrawBackground(ACanvas.Handle, R, DXBAR_COLLAPSEDTOOLBARGLYPHBACKGROUND, AGroupState); + + if GetCollapsedGroupGlyph(ABarControl) <> nil then + begin + with Skin.GetContentOffsets(DXBAR_COLLAPSEDTOOLBARGLYPHBACKGROUND) do + begin + Inc(R.Top, Top); + Dec(R.Bottom, Bottom); + end; + AGroupGlyphSize := GetCollapsedGroupGlyphSize(ABarControl); + Inc(R.Top, (cxRectHeight(R) - AGroupGlyphSize.cy) div 2); + R.Bottom := R.Top + AGroupGlyphSize.cy; + Inc(R.Left, (cxRectWidth(R) - AGroupGlyphSize.cx) div 2); + R.Right := R.Left + AGroupGlyphSize.cx; + TransparentDraw(ACanvas.Handle, R, GetCollapsedGroupGlyph(ABarControl)); + end; +end; + +function TdxRibbonBarPainter.GetCollapsedGroupWidth( + ABarControl: TdxRibbonGroupBarControl): Integer; + + procedure InitDrawParams; + begin + cxScreenCanvas.Font := ABarControl.Font; + DrawParams.Canvas := cxScreenCanvas; + DrawParams.Caption := ABarControl.GetCaption; + DrawParams.ViewSize := cvsLarge; + DrawParams.IsDropDown := True; + end; + +var + AGlyphBackgroundAreaWidth: Integer; + R: TRect; +begin + InitDrawParams; + Result := GetControlCaptionRect(DrawParams).Right; + + R := Rect(0, 0, 100, 100); + with GetCollapsedGroupCaptionRect(R) do + Inc(Result, (Left - R.Left) + (R.Right - Right)); + AGlyphBackgroundAreaWidth := GetCollapsedGroupGlyphBackgroundSize(ABarControl).cx + + dxRibbonCollapsedGroupGlyphBackgroundOffsets.Left + dxRibbonCollapsedGroupGlyphBackgroundOffsets.Right; + with Skin.GetContentOffsets(DXBAR_COLLAPSEDTOOLBAR) do + Inc(AGlyphBackgroundAreaWidth, Left + Right); + if Result < AGlyphBackgroundAreaWidth then + Result := AGlyphBackgroundAreaWidth; +end; + +function TdxRibbonBarPainter.GetGroupCaptionHeight( + ACaptionFont: TFont): Integer; +var + ACanvas: TcxScreenCanvas; +begin + ACanvas := TcxScreenCanvas.Create; + try + ACanvas.Font := ACaptionFont; + if ACanvas.Font.Size < 8 then + ACanvas.Font.Size := 8; + Result := InternalGetGroupCaptionHeight(ACanvas.TextHeight('Qq')); + finally + ACanvas.Free; + end; +end; + +function TdxRibbonBarPainter.GetCollapsedGroupCaptionRect( + const AGroupRect: TRect): TRect; +begin + Result := AGroupRect; + ExtendRect(Result, Skin.GetContentOffsets(DXBAR_COLLAPSEDTOOLBAR)); + InflateRect(Result, -1, 0); + Inc(Result.Top, cxRectHeight(Result) * FCollapsedGroupElementSizeNumerator div FCollapsedGroupElementSizeDenominator); +end; + +function TdxRibbonBarPainter.GetGroupMinWidth(ABarControl: TdxRibbonGroupBarControl): Integer; +var + ACanvas: TcxScreenCanvas; +begin + ACanvas := TcxScreenCanvas.Create; + try + ACanvas.Font := ABarControl.Ribbon.Fonts.GetGroupHeaderFont; + Result := ACanvas.TextWidth(ABarControl.GetCaption); + if ABarControl.CaptionButtons.Count > 0 then + Inc(Result, cxRectWidth(ABarControl.CaptionButtons.Rect) + Skin.GetContentOffsets(DXBAR_TOOLBAR).Right); + finally + ACanvas.Free; + end; +end; + +function TdxRibbonBarPainter.GetCollapsedGroupGlyph(ABarControl: TdxBarControl): TBitmap; +begin + Result := ABarControl.Bar.Glyph; + if (Result <> nil) and Result.Empty then + Result := nil; +end; + +function TdxRibbonBarPainter.GetCollapsedGroupGlyphBackgroundSize( + ABarControl: TdxBarControl): TSize; +var + AGroupContentHeight: Integer; +begin + AGroupContentHeight := ABarControl.Height; + with Skin.GetContentOffsets(DXBAR_COLLAPSEDTOOLBAR) do + Dec(AGroupContentHeight, Top + Bottom); + with Skin.GetContentOffsets(DXBAR_COLLAPSEDTOOLBARGLYPHBACKGROUND) do + Result.cy := (Top + GetSmallIconSize + Bottom) * AGroupContentHeight div FCollapsedGroupElementSizeDenominator; + Result.cx := Result.cy; +end; + +function TdxRibbonBarPainter.GetCollapsedGroupGlyphSize(ABarControl: TdxBarControl): TSize; +var + AGlyphSize: TSize; + AGroupGlyph: TBitmap; +// AMaxGlyphHeight: Integer; +// R: TRect; +begin + AGroupGlyph := GetCollapsedGroupGlyph(ABarControl); + if AGroupGlyph <> nil then + AGlyphSize := cxSize(AGroupGlyph.Width, AGroupGlyph.Height) + else + AGlyphSize := cxSize(GetSmallIconSize, GetSmallIconSize); +// R := ABarControl.ClientRect; +// ExtendRect(R, Skin.GetContentOffsets(DXBAR_COLLAPSEDTOOLBAR)); +// R.Bottom := GetGroupCaptionRect(ABarControl.ClientRect).Top; +// with Skin.GetContentOffsets(DXBAR_COLLAPSEDTOOLBARGLYPHBACKGROUND) do +// AMaxGlyphHeight := cxRectHeight(R) - (Top + Bottom) - (dxRibbonCollapsedGroupGlyphBackgroundOffsets.Top + dxRibbonCollapsedGroupGlyphBackgroundOffsets.Bottom); +// Result.cy := AGlyphSize.cy; +// if Result.cy > AMaxGlyphHeight then +// Result.cy := AMaxGlyphHeight; +// Result.cx := MulDiv(AGlyphSize.cx, Result.cy, AGlyphSize.cy); + + if (AGlyphSize.cx <= GetSmallIconSize) and (AGlyphSize.cy <= GetSmallIconSize) then + Result := AGlyphSize + else + if AGlyphSize.cx > AGlyphSize.cy then + begin + Result.cx := GetSmallIconSize; + Result.cy := AGlyphSize.cy * GetSmallIconSize div AGlyphSize.cx; + end + else + begin + Result.cy := GetSmallIconSize; + Result.cx := AGlyphSize.cx * GetSmallIconSize div AGlyphSize.cy; + end; +end; + +function TdxRibbonBarPainter.GetGroupState(ABarControl: TdxBarControl): Integer; +const + GroupStates: array[TdxBarMarkState] of Integer = (DXBAR_NORMAL, DXBAR_HOT, DXBAR_PRESSED); +begin + if ABarControl.IAccessibilityHelper.IsSelected then + Result := DXBAR_ACTIVE + else + Result := GroupStates[TdxRibbonGroupBarControl(ABarControl).MarkDrawState]; +end; + +function TdxRibbonBarPainter.InternalGetGroupCaptionHeight( + ATextHeight: Integer): Integer; +begin + Result := ATextHeight + dxRibbonGroupCaptionHeightCorrection; +end; + +{ TdxCustomRibbonDockControl } + +procedure TdxCustomRibbonDockControl.UpdateColorScheme; +begin + RepaintBarControls; + Invalidate; +end; + +function TdxCustomRibbonDockControl.AllowUndockWhenLoadFromIni: Boolean; +begin + Result := False; +end; + +procedure TdxCustomRibbonDockControl.FillBackground(DC: HDC; + const ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); +begin +end; + +function TdxCustomRibbonDockControl.IsDrawDesignBorder: Boolean; +begin + Result := False; +end; + +function TdxCustomRibbonDockControl.IsTransparent: Boolean; +begin + Result := False; +end; + +function TdxCustomRibbonDockControl.IsNeedRedrawBarControlsOnPaint: Boolean; +begin + Result := {(csDesigning in ComponentState) and} (csPaintCopy in ControlState); +end; + +procedure TdxCustomRibbonDockControl.Paint; +//var +// I, J: Integer; +// ABarControl: TdxBarControl; +// P, ASaveOrg: TPoint; +begin + inherited; + if IsNeedRedrawBarControlsOnPaint then + begin +{ +// BarCanvas.BeginPaint(Canvas.Handle); +// ASaveOrg := BarCanvas.WindowOrg; + for I := 0 to RowCount - 1 do + for J := 0 to Rows[I].ColCount - 1 do + begin + ABarControl := Rows[I].Cols[J].BarControl; + ABarControl.repaint; + //P := ASaveOrg; + //P := cxNullPoint; + //MapWindowPoint(ABarControl.Handle, Handle, P); + //BarCanvas.WindowOrg := P; + + //FillRectByColor(BarCanvas.Handle, ABarControl.ClientBounds, clRed); + + //ABarControl.PaintTo(BarCanvas.Handle, P.X, P.Y); + //ABarControl.PaintTo(BarCanvas.Handle, ABarControl.Left, ABarControl.Top); + //BarCanvas.WindowOrg := ASaveOrg; + end; +// BarCanvas.EndPaint; +} + end; +end; + +procedure TdxCustomRibbonDockControl.VisibleChanged; +begin +end; + +procedure TdxCustomRibbonDockControl.CMVisibleChanged(var Message: TMessage); +begin + if HandleAllocated and not Visible then + ShowWindow(Handle, SW_HIDE); // SC's bugs ID CB41787, CB47149 + VisibleChanged; + inherited; +end; + +procedure TdxCustomRibbonDockControl.WMLButtonDblClk( + var Message: TWMLButtonDblClk); +begin + if BarManager <> nil then + begin + if BarManager.Designing then + inherited + else + Message.Result := 0; + end; +end; + +{ TdxRibbonGroupsDockControl } + +constructor TdxRibbonGroupsDockControl.Create(ATab: TdxRibbonTab); +begin + inherited Create(nil); + AllowDocking := False; + FTab := ATab; + FViewInfo := GetViewInfoClass.Create(Self); +end; + +destructor TdxRibbonGroupsDockControl.Destroy; +begin + FreeAndNil(FViewInfo); + inherited Destroy; +end; + +procedure TdxRibbonGroupsDockControl.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); +var + AScrollButtonWidth: Integer; + R: TRect; +begin + if (Ribbon <> nil) and not Ribbon.IsLocked then + begin + Ribbon.GroupsDockControlSite.ViewInfo.Calculate; + R := Tab.GetDockControlBounds; + AScrollButtonWidth := Ribbon.ViewInfo.ScrollButtonWidth; + if rsbLeft in ViewInfo.ScrollButtons then + begin + Inc(ALeft, AScrollButtonWidth - R.Left); + Dec(AWidth, AScrollButtonWidth - R.Left); + end; + if rsbRight in ViewInfo.ScrollButtons then + Dec(AWidth, AScrollButtonWidth - R.Left); + inherited SetBounds(ALeft, ATop, AWidth, AHeight); + UpdateGroupPositions; + Ribbon.ViewInfo.GroupsDockControlSiteViewInfo.InvalidateScrollButtons; + end + else + inherited SetBounds(ALeft, ATop, AWidth, AHeight); +end; + +procedure TdxRibbonGroupsDockControl.AlignControls(AControl: TControl; + var Rect: TRect); +begin + if HandleAllocated and Ribbon.ColorScheme.HasGroupTransparency then + RedrawWindow(Handle, nil, 0, RDW_FRAME or RDW_INVALIDATE or RDW_ALLCHILDREN); +end; + +procedure TdxRibbonGroupsDockControl.CalcRowToolbarPositions(ARowIndex: Integer; + AClientSize: Integer); +begin + if Visible then + Tab.UpdateDockControl; +end; + +procedure TdxRibbonGroupsDockControl.DblClick; +begin +end; + +procedure TdxRibbonGroupsDockControl.FillBackground(DC: HDC; + const ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); +var + AViewInfo: TdxRibbonViewInfo; +begin + BarCanvas.BeginPaint(DC); + try + AViewInfo := Ribbon.ViewInfo; + with AViewInfo.GroupsDockControlSiteBounds do + BarCanvas.WindowOrg := cxPointOffset(BarCanvas.WindowOrg, Left + Self.Left, Top + Self.Top); + AViewInfo.Painter.DrawGroupsArea(BarCanvas, AViewInfo.GetGroupsDockControlSiteBounds); + finally + BarCanvas.EndPaint; + end; +end; + +function TdxRibbonGroupsDockControl.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxRibbonGroupsDockControlAccessibilityHelper; +end; + +function TdxRibbonGroupsDockControl.GetDockedBarControlClass: TdxBarControlClass; +begin + Result := TdxRibbonGroupBarControl; +end; + +function TdxRibbonGroupsDockControl.GetPainter: TdxBarPainter; +begin + if Ribbon <> nil then + Result := Ribbon.GroupsPainter + else + Result := inherited GetPainter; +end; + +function TdxRibbonGroupsDockControl.GetViewInfoClass: TdxRibbonGroupsDockControlViewInfoClass; +begin + Result := TdxRibbonGroupsDockControlViewInfo; +end; + +function TdxRibbonGroupsDockControl.IsMultiRow: Boolean; +begin + Result := False; +end; + +procedure TdxRibbonGroupsDockControl.MakeRectFullyVisible(const R: TRect); +var + ANewLeft: Integer; +begin + if (R.Left < 0) or (R.Right > ClientWidth) then + begin + if (cxRectWidth(R) > ClientWidth) or (R.Left < 0) then + ANewLeft := 0 + else + ANewLeft := ClientWidth - cxRectWidth(R); + if ANewLeft <> R.Left then + ViewInfo.InternalScrollGroups(ANewLeft - R.Left, cxRectWidth(Ribbon.ViewInfo.GetTabGroupsDockControlBounds)); + end; +end; + +procedure TdxRibbonGroupsDockControl.Paint; +var + AViewInfo: TdxRibbonViewInfo; + R: TRect; +begin + BarCanvas.BeginPaint(Canvas); + try + AViewInfo := Ribbon.ViewInfo; + R := AViewInfo.GetGroupsDockControlSiteBounds; + BarCanvas.WindowOrg := cxPointOffset(BarCanvas.WindowOrg, R.Left + Left, R.Top + Top); + AViewInfo.Painter.DrawGroupsArea(BarCanvas, R); + finally + BarCanvas.EndPaint; + end; +end; + +procedure TdxRibbonGroupsDockControl.SetSize; +begin +end; + +procedure TdxRibbonGroupsDockControl.ShowCustomizePopup; +begin + if Ribbon.IsDesigning then + ShowDesignMenu; +end; + +procedure TdxRibbonGroupsDockControl.UpdateGroupPositions; +var + AToolbar: TdxRibbonGroupBarControl; + I, X: Integer; + R: TRect; + WP: Cardinal; +begin + WP := BeginDeferWindowPos(ViewInfo.GroupCount); + try + X := ViewInfo.FirstGroupPosition; + for I := 0 to ViewInfo.GroupCount - 1 do + begin + AToolbar := ViewInfo.GroupViewInfos[I].BarControl; + with AToolbar.ViewInfo.GetSize do + R := Rect(X, 0, X + cx, cy); + if (AToolbar.Left <> R.Left) or (AToolbar.Top <> R.Top) or + (AToolbar.Width <> cxRectWidth(R)) or (AToolbar.Height <> cxRectHeight(R)) then + begin + if AToolbar.HandleAllocated then + DeferWindowPos(WP, AToolbar.Handle, 0, R.Left, R.Top, cxRectWidth(R), cxRectHeight(R), + SWP_DRAWFRAME or SWP_NOACTIVATE or SWP_NOOWNERZORDER or SWP_NOZORDER) + else + AToolbar.SetBounds(R.Left, R.Top, cxRectWidth(R), cxRectHeight(R)); + end; + X := R.Right + Painter.GetToolbarsOffsetForAutoAlign; + end; + finally + EndDeferWindowPos(WP); + end; +end; + +procedure TdxRibbonGroupsDockControl.VisibleChanged; +begin + if HandleAllocated and Visible then + begin + Tab.UpdateDockControl; + RepaintBarControls; + end; +end; + +procedure TdxRibbonGroupsDockControl.DesignMenuClick(Sender: TObject); +begin + case TdxBarButton(Sender).Tag of + 0: Ribbon.Tabs.Add.DesignSelectionHelper.SelectComponent; + 1: Ribbon.DesignAddTabGroup(Tab, False); + 2: Ribbon.DesignAddTabGroup(Tab, True); + end; +end; + +function TdxRibbonGroupsDockControl.GetRibbon: TdxCustomRibbon; +begin + Result := Tab.Ribbon; +end; + +procedure TdxRibbonGroupsDockControl.InitDesignMenu(AItemLinks: TdxBarItemLinks); +begin + BarDesignController.AddInternalItem(AItemLinks, TdxBarButton, + cxGetResourceString(@dxSBAR_RIBBONADDTAB), DesignMenuClick, 0); + BarDesignController.AddInternalItem(AItemLinks, TdxBarButton, + cxGetResourceString(@dxSBAR_RIBBONADDEMPTYGROUP), DesignMenuClick, 1, True); + BarDesignController.AddInternalItem(AItemLinks, TdxBarButton, + cxGetResourceString(@dxSBAR_RIBBONADDGROUPWITHTOOLBAR), DesignMenuClick, 2); +end; + +procedure TdxRibbonGroupsDockControl.ShowDesignMenu; +begin + BarDesignController.ShowCustomCustomizePopup(BarManager, InitDesignMenu, Painter); +end; + +{ TdxRibbonGroupsDockControlViewInfo } + +constructor TdxRibbonGroupsDockControlViewInfo.Create( + ADockControl: TdxRibbonGroupsDockControl); +begin + inherited Create; + FDockControl := ADockControl; + FScrollButtons := []; +end; + +procedure TdxRibbonGroupsDockControlViewInfo.Calculate(const ABoundsRect: TRect); +type + TGroupsReduceStage = (grsMultiColumnItemControlsColumnCount, + grsMultiColumnItemControlsCollapsing, grsItemControlsViewLevel, + grsGroupsCollapsing); + + function AllGroupsFitIn: Boolean; + begin + Result := TryPlaceGroups(cxRectWidth(ABoundsRect)); + end; + + procedure ReduceGroups(AStage: TGroupsReduceStage; + AUpToViewLevel: TdxBarItemRealViewLevel); + var + AGroupViewInfo: TdxRibbonGroupBarControlViewInfo; + ARes: Boolean; + I: Integer; + begin + for I := GroupCount - 1 downto 0 do + begin + AGroupViewInfo := GroupViewInfos[I]; + repeat + ARes := False; + case AStage of + grsMultiColumnItemControlsColumnCount: + ARes := AGroupViewInfo.DecreaseMultiColumnItemControlsColumnCount; + grsMultiColumnItemControlsCollapsing: + ARes := AGroupViewInfo.CollapseMultiColumnItemControls; + grsItemControlsViewLevel: + ARes := AGroupViewInfo.Reduce(AUpToViewLevel); + grsGroupsCollapsing: + begin + if AGroupViewInfo.BarControl.Group.CanCollapse then + begin + AGroupViewInfo.Collapsed := True; + AGroupViewInfo.Calculate; + end; + end; + end; + if not ARes then + Break; + until AllGroupsFitIn; + if AllGroupsFitIn then + Break; + end; + end; + +var + AGroupsReduceStage: TGroupsReduceStage; + AUpToViewLevel: TdxBarItemRealViewLevel; + I: Integer; +begin + SaveGroupCollapsedStates; + for I := 0 to GroupCount - 1 do + GroupViewInfos[I].CalculateInit; + try + for I := 0 to GroupCount - 1 do + GroupViewInfos[I].Calculate; + if not AllGroupsFitIn then + begin + for I := 0 to GroupCount - 1 do + GroupViewInfos[I].ReduceInit; + for AGroupsReduceStage := Low(TGroupsReduceStage) to High(TGroupsReduceStage) do + begin + if AGroupsReduceStage <> grsItemControlsViewLevel then + ReduceGroups(AGroupsReduceStage, ivlLargeIconWithText) + else + for AUpToViewLevel := Succ(Low(TdxBarItemRealViewLevel)) to High(TdxBarItemRealViewLevel) do + begin + ReduceGroups(AGroupsReduceStage, AUpToViewLevel); + if AllGroupsFitIn then + Break; + end; + if AllGroupsFitIn then + Break; + end; + end; + finally + for I := 0 to GroupCount - 1 do + GroupViewInfos[I].CalculateFinalize; + end; + CalculateGroupsScrollInfo(cxRectWidth(ABoundsRect)); + CheckGroupCollapsedStates; +end; + +procedure TdxRibbonGroupsDockControlViewInfo.ResetScrollInfo; +begin + FScrollPosition := 0; + FScrollButtons := []; +end; + +procedure TdxRibbonGroupsDockControlViewInfo.ScrollGroups(AScrollLeft: Boolean; + AMaxContentWidth: Integer); +begin + if AScrollLeft then + InternalScrollGroups(-dxRibbonGroupsScrollDelta, AMaxContentWidth) + else + InternalScrollGroups(dxRibbonGroupsScrollDelta, AMaxContentWidth); +end; + +procedure TdxRibbonGroupsDockControlViewInfo.CalculateGroupsScrollInfo( + AMaxContentWidth: Integer); +var + ATotalGroupsWidth: Integer; +begin + ATotalGroupsWidth := TotalGroupsWidth; + if ATotalGroupsWidth <= AMaxContentWidth then + begin + FScrollButtons := []; + FScrollPosition := 0; + end + else + begin + if FScrollButtons = [] then + FScrollButtons := [rsbRight] + else + if FScrollButtons = [rsbLeft] then + FScrollPosition := AMaxContentWidth - ATotalGroupsWidth + else + if FScrollButtons = [rsbLeft, rsbRight] then + begin + if FScrollPosition + ATotalGroupsWidth <= AMaxContentWidth then + begin + FScrollButtons := [rsbLeft]; + FScrollPosition := AMaxContentWidth - ATotalGroupsWidth; + end; + end; + end; +end; + +procedure TdxRibbonGroupsDockControlViewInfo.InternalScrollGroups( + ADelta: Integer; AMaxContentWidth: Integer); + + procedure CheckScrollPosition; + begin + if FScrollPosition > 0 then + FScrollPosition := 0 + else + FScrollPosition := Max(FScrollPosition, AMaxContentWidth - TotalGroupsWidth); + end; + +begin + Inc(FScrollPosition, ADelta); + CheckScrollPosition; + FScrollButtons := []; + if FScrollPosition < 0 then + Include(FScrollButtons, rsbLeft); + if FScrollPosition + TotalGroupsWidth > AMaxContentWidth then + Include(FScrollButtons, rsbRight); + DockControl.Tab.UpdateDockControlBounds; +end; + +procedure TdxRibbonGroupsDockControlViewInfo.CheckGroupCollapsedStates; +var + AGroup: TdxRibbonTabGroup; + AGroupViewInfo: TdxRibbonGroupBarControlViewInfo; + I: Integer; +begin + for I := 0 to High(FPrevGroupCollapsedStates) do + begin + AGroupViewInfo := GroupViewInfos[I]; + if AGroupViewInfo.Collapsed <> FPrevGroupCollapsedStates[I] then + begin + AGroup := AGroupViewInfo.BarControl.Group; + if AGroupViewInfo.Collapsed then + AGroup.Tab.Ribbon.DoTabGroupCollapsed(AGroup.Tab, AGroup) + else + AGroup.Tab.Ribbon.DoTabGroupExpanded(AGroup.Tab, AGroup); + end; + end; +end; + +function TdxRibbonGroupsDockControlViewInfo.GetFirstGroupPosition: Integer; +begin + Result := FScrollPosition; + if rsbLeft in ScrollButtons then + Dec(Result, DockControl.Left - DockControl.Ribbon.ViewInfo.GetTabGroupsDockControlOffset.Left); +end; + +function TdxRibbonGroupsDockControlViewInfo.GetGroupCount: Integer; +var + AToolbar: TdxBar; + I: Integer; +begin + Result := 0; + for I := 0 to DockControl.Tab.Groups.Count - 1 do + begin + AToolbar := DockControl.Tab.Groups[I].ToolBar; + if IsValidToolbar(AToolbar) then + Inc(Result); + end; +end; + +function TdxRibbonGroupsDockControlViewInfo.GetGroupViewInfo( + AIndex: Integer): TdxRibbonGroupBarControlViewInfo; +var + AToolbar: TdxBar; + I: Integer; +begin + Result := nil; + for I := 0 to DockControl.Tab.Groups.Count - 1 do + begin + AToolbar := DockControl.Tab.Groups[I].ToolBar; + if IsValidToolbar(AToolbar) then + if AIndex = 0 then + begin + Result := TdxRibbonGroupBarControl(AToolBar.Control).ViewInfo; + Break; + end + else + Dec(AIndex); + end; +end; + +function TdxRibbonGroupsDockControlViewInfo.IsValidToolbar(AToolbar: TdxBar): Boolean; +begin + Result := (AToolbar <> nil) and (AToolbar.Control <> nil) and (AToolbar.Control.DockControl = DockControl); +end; + +procedure TdxRibbonGroupsDockControlViewInfo.SaveGroupCollapsedStates; +var + I: Integer; +begin + SetLength(FPrevGroupCollapsedStates, GroupCount); + for I := 0 to High(FPrevGroupCollapsedStates) do + FPrevGroupCollapsedStates[I] := GroupViewInfos[I].Collapsed; +end; + +function TdxRibbonGroupsDockControlViewInfo.TotalGroupsWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to GroupCount - 1 do + Inc(Result, GroupViewInfos[I].GetSize.cx); + if GroupCount > 1 then + Inc(Result, DockControl.Painter.GetToolbarsOffsetForAutoAlign * (GroupCount - 1)); +end; + +function TdxRibbonGroupsDockControlViewInfo.TryPlaceGroups( + AMaxContentWidth: Integer): Boolean; +var + AGroupWidth, I, X: Integer; +begin + Result := True; + X := 0; + for I := 0 to GroupCount - 1 do + begin + AGroupWidth := GroupViewInfos[I].GetSize.cx; + if X + AGroupWidth > AMaxContentWidth then + begin + Result := False; + Break; + end; + Inc(X, AGroupWidth + DockControl.Painter.GetToolbarsOffsetForAutoAlign); + end; +end; + +{ TdxRibbonTabGroupsPopupWindow } + +constructor TdxRibbonTabGroupsPopupWindow.Create(ARibbon: TdxCustomRibbon); +begin + inherited Create(ARibbon); + FRibbon := ARibbon; + FShadow := TdxBarShadow.Create(Self); + ModalMode := False; +end; + +destructor TdxRibbonTabGroupsPopupWindow.Destroy; +begin + FreeAndNil(FShadow); + inherited Destroy; +end; + +function TdxRibbonTabGroupsPopupWindow.CalculatePosition: TPoint; +begin + Result := GetBounds.TopLeft; +end; + +procedure TdxRibbonTabGroupsPopupWindow.CalculateSize; +var + R: TRect; +begin + R := GetBounds; + SetBounds(Left, Top, cxRectWidth(R), cxRectHeight(R)); +end; + +procedure TdxRibbonTabGroupsPopupWindow.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + WindowClass.Style := WindowClass.Style or CS_SAVEBITS; +end; + +procedure TdxRibbonTabGroupsPopupWindow.DoClosed; +begin + inherited DoClosed; + FShadow.Visible := False; + GroupsDockControlSite.BoundsRect := cxEmptyRect; + GroupsDockControlSite.Parent := Ribbon; + Ribbon.Invalidate; +end; + +procedure TdxRibbonTabGroupsPopupWindow.DoShowed; +begin + inherited DoShowed; + FShadow.SetOwnerBounds(cxEmptyRect, BoundsRect); + FShadow.Visible := True; +end; + +procedure TdxRibbonTabGroupsPopupWindow.DoShowing; +begin + inherited DoShowing; + SetGroupsDockControlSite; +end; + +procedure TdxRibbonTabGroupsPopupWindow.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited KeyDown(Key, Shift); + HandleNavigationKey(Key); +end; + +procedure TdxRibbonTabGroupsPopupWindow.KeyPress(var Key: Char); +begin + inherited KeyPress(Key); + if Word(Key) = VK_ESCAPE then + CloseUp + else + HandleNavigationKey(Word(Key)); +end; + +function TdxRibbonTabGroupsPopupWindow.NeedIgnoreMouseMessageAfterCloseUp( + AWnd: THandle; AMsg: Cardinal; AShift: TShiftState; const APos: TPoint): Boolean; +var + AHitInfo: TdxRibbonHitInfo; + F: TCustomForm; + P: TPoint; +begin + if AWnd = Ribbon.Handle then + begin + P := Ribbon.ScreenToClient(APos); + AHitInfo := Ribbon.ViewInfo.GetHitInfo(P.X, P.Y); + Result := (AHitInfo.HitTest = rhtTab) and (AHitInfo.Tab = Ribbon.ActiveTab) and + (AMsg = WM_LBUTTONDOWN) and not (ssDouble in AShift); + end + else + begin + F := GetParentForm(Ribbon); + if (F.Handle <> AWnd) and not HasAsParent(AWnd, Ribbon.Handle) then + Result := not Ribbon.DoHideMinimizedByClick(AWnd, AShift, APos) + else + Result := False + end; +end; + +procedure TdxRibbonTabGroupsPopupWindow.HandleNavigationKey(AKey: Word); +begin + if BarNavigationController.IsNavigationKey(AKey) then + begin + BarNavigationController.SetKeyTipsShowingState(nil, ''); + SelectFirstSelectableAccessibleObject(GroupsDockControlSite.DockControl.IAccessibilityHelper.GetBarHelper); + end; +end; + +procedure TdxRibbonTabGroupsPopupWindow.SetGroupsDockControlSite; +var + R: TRect; +begin + if Ribbon.ActiveTab <> nil then + begin + GroupsDockControlSite.Parent := Self; + GroupsDockControlSite.BoundsRect := GetControlRect(Self); + R := GroupsDockControlSite.BoundsRect; + with Ribbon.ViewInfo.GetTabGroupsDockControlOffset do + R := cxRectInflate(R, -Left, -Top, -Right, -Bottom); + GroupsDockControlSite.DockControl.ViewInfo.ResetScrollInfo; + GroupsDockControlSite.DockControl.HandleNeeded; + GroupsDockControlSite.DockControl.ViewInfo.Calculate(R); + GroupsDockControlSite.DockControl.BoundsRect := R; + GroupsDockControlSite.DockControl.Visible := True; + end; +end; + +function TdxRibbonTabGroupsPopupWindow.GetBounds: TRect; +var + AMonitorRect, ARibbonRect, ATabsRect: TRect; + ATabGroupsHeight: Integer; +begin + ARibbonRect := Ribbon.ClientRect; + MapWindowRect(Ribbon.Handle, 0, ARibbonRect); + ATabsRect := Ribbon.ViewInfo.TabsViewInfo.Bounds; + MapWindowRect(Ribbon.Handle, 0, ATabsRect); + Result := cxRect(ARibbonRect.Left, ATabsRect.Top - 1, ARibbonRect.Right, ATabsRect.Bottom - 1); + ATabGroupsHeight := Ribbon.ViewInfo.GetTabGroupsHeight(True); + AMonitorRect := GetMonitorWorkArea(0); + cxRectIntersect(Result, Result, AMonitorRect); + if Result.Bottom + ATabGroupsHeight > AMonitorRect.Bottom then + Result := cxRect(Result.Left, Result.Top - ATabGroupsHeight, Result.Right, Result.Top) + else + Result := cxRect(Result.Left, Result.Bottom, Result.Right, Result.Bottom + ATabGroupsHeight); +end; + +function TdxRibbonTabGroupsPopupWindow.GetGroupsDockControlSite: TdxRibbonGroupsDockControlSite; +begin + Result := Ribbon.GroupsDockControlSite; +end; + +procedure TdxRibbonTabGroupsPopupWindow.WMNCPaint(var Message: TMessage); +var + DC: HDC; + AFlags: Integer; + ARgn: HRGN; +begin + AFlags := DCX_CACHE or DCX_CLIPSIBLINGS or DCX_WINDOW or DCX_VALIDATE; + if Message.WParam <> 1 then + begin + ARgn := CreateRectRgnIndirect(cxEmptyRect); + CombineRgn(ARgn, Message.WParam, 0, RGN_COPY); + DC := GetDCEx(Handle, ARgn, AFlags or DCX_INTERSECTRGN); + end + else + DC := GetDCEx(Handle, 0, AFlags); + try + Ribbon.ColorScheme.DrawTabGroupsArea(DC, ClientRect); + finally + ReleaseDC(Handle, DC); + end; +end; + +procedure TdxRibbonTabGroupsPopupWindow.WMSize(var Message: TWMSize); +var + Rgn: HRGN; +begin + inherited; + Rgn := CreateRoundRectRgn(0, 0, Message.Width + 1, Message.Height + 1, 4, 4); + SetWindowRgn(Handle, Rgn, True); +end; + +{ TdxRibbonQuickAccessItemControlPainter } + +function TdxRibbonQuickAccessPainter.BarMarkRect( + ABarControl: TdxBarControl): TRect; +begin + Result := BarMarkItemRect(ABarControl); +end; + +function TdxRibbonQuickAccessPainter.BarMarkItemRect( + ABarControl: TdxBarControl): TRect; +begin + Result := ABarControl.ClientRect; + Result.Left := Result.Right - (MarkSizeX(ABarControl) - MarkButtonOffset); +end; + +procedure TdxRibbonQuickAccessPainter.BarDrawMarkBackground( + ABarControl: TdxBarControl; DC: HDC; ItemRect: TRect; AToolbarBrush: HBRUSH); +const + States: array[TdxBarMarkState] of Integer = + (DXBAR_NORMAL, DXBAR_ACTIVE, DXBAR_PRESSED); +var + AState: Integer; +begin + AState := States[TdxRibbonQuickAccessBarControl(ABarControl).MarkDrawState]; + if AState <> DXBAR_NORMAL then + Skin.DrawBackground(DC, ItemRect, DXBAR_SMALLBUTTON, AState); +end; + +procedure TdxRibbonQuickAccessPainter.ComboControlDrawArrowButton( + const ADrawParams: TdxBarEditLikeControlDrawParams; ARect: TRect; + AInClientArea: Boolean); +var + ABitmap: TcxBitmap; + ASaveCanvas: TcxCanvas; +begin + if AInClientArea or not ADrawParams.BarEditControl.OnGlass then + inherited + else + begin + ABitmap := TcxBitmap.CreateSize(ARect); + try + ABitmap.cxCanvas.WindowOrg := ARect.TopLeft; + ASaveCanvas := ADrawParams.Canvas; + ADrawParams.Canvas := ABitmap.cxCanvas; + inherited; + ADrawParams.Canvas := ASaveCanvas; + ABitmap.MakeOpaque; + ABitmap.cxCanvas.WindowOrg := cxNullPoint; + cxBitBlt(ADrawParams.Canvas.Handle, ABitmap.cxCanvas.Handle, ARect, cxNullPoint, SRCCOPY); + finally + ABitmap.Free; + end; + end +end; + +procedure TdxRibbonQuickAccessPainter.DrawGroupButtonControl( + ADrawParams: TdxBarButtonLikeControlDrawParams; const ARect: TRect); +var + R: TRect; +begin + Skin.DrawBackground(ADrawParams.Canvas.Handle, ARect, + DXBAR_QUICKACCESSGROUPBUTTON, GetButtonPartState(ADrawParams, bcpButton)); + R := ARect; + ExtendRect(R, Skin.GetContentOffsets(DXBAR_QUICKACCESSGROUPBUTTON)); + with ADrawParams do + DrawGlyph(BarItemControl, Canvas.Handle, R, R, ptHorz, False, False, False, + False, False, True, False, False); +end; + +procedure TdxRibbonQuickAccessPainter.DrawToolbarContentPart( + ABarControl: TdxBarControl; ACanvas: TcxCanvas); +var + AViewInfo: TdxRibbonViewInfo; + P: TPoint; +begin + AViewInfo := Ribbon.ViewInfo; + ACanvas.SaveDC; + try + if AViewInfo.UseGlass and AViewInfo.IsQATAtNonClientArea then + FillRect(ACanvas.Handle, ABarControl.ClientRect, GetStockObject(BLACK_BRUSH)); + P := ACanvas.WindowOrg; + MapWindowPoint(ABarControl.Handle, Ribbon.Handle, P); + ACanvas.WindowOrg := P; + if AViewInfo.IsQATAtNonClientArea and Assigned(Ribbon.FormCaptionHelper) then + Ribbon.FormCaptionHelper.UpdateCaptionArea(ACanvas) + else + begin + AViewInfo.Painter.DrawQuickAccessToolbar(ACanvas, + AViewInfo.QuickAccessToolbarBounds, True); + end; + finally + ACanvas.RestoreDC; + end; +end; + +function TdxRibbonQuickAccessPainter.MarkButtonWidth: Integer; +begin + Result := ((Ribbon.GetGroupRowHeight + 2) div 2) or 1; +end; + +function TdxRibbonQuickAccessPainter.GetToolbarContentOffsets( + ABar: TdxBar; ADockingStyle: TdxBarDockingStyle; + AHasSizeGrip: Boolean): TRect; +begin + Result := cxEmptyRect; +end; + +function TdxRibbonQuickAccessPainter.MarkButtonOffset: Integer; +begin + Result := Ribbon.ColorScheme.GetQuickAccessToolbarMarkButtonOffset( + Ribbon.ViewInfo.IsApplicationButtonVisible, + Ribbon.QuickAccessToolbar.Position = qtpBelowRibbon); +end; + +function TdxRibbonQuickAccessPainter.MarkSizeX(ABarControl: TdxBarControl): Integer; +begin + Result := MarkButtonWidth + MarkButtonOffset; +end; + +{ TdxRibbonQuickAccessBarControl } + +constructor TdxRibbonQuickAccessBarControl.CreateEx(AOwner: TComponent; ABar: TdxBar); +begin + inherited CreateEx(AOwner, ABar); + FDefaultGlyph := cxCreateBitmap(16, 16, pf32bit); + if ABar.DockControl <> nil then + ABar.DockControl.Visible := True; + FInternalItems := TComponentList.Create; + FBitmap := TcxBitmap.Create; +end; + +destructor TdxRibbonQuickAccessBarControl.Destroy; +begin + FreeAndNil(FBitmap); + FreeAndNil(FInternalItems); + if DockControl <> nil then + DockControl.Visible := False; + FreeAndNil(FDefaultGlyph); + inherited Destroy; +end; + +function TdxRibbonQuickAccessBarControl.IsOnGlass: Boolean; +begin + Result := Ribbon.ViewInfo.IsQATOnGlass; +end; + +function TdxRibbonQuickAccessBarControl.AllItemsVisible: Boolean; +var + AItemLink: TdxBarItemLink; + I: Integer; +begin + Result := True; + for I := 0 to ItemLinks.CanVisibleItemCount - 1 do + begin + AItemLink := ItemLinks.CanVisibleItems[I]; + if (AItemLink.VisibleIndex = -1) or + (AItemLink.Control <> nil) and IsRectEmpty(AItemLink.ItemRect) then + begin + Result := False; + Break; + end; + end; +end; + +procedure TdxRibbonQuickAccessBarControl.CalcControlsPositions; + + procedure CalcItemControlsRealPositionInButtonGroup; + var + AItemControlViewInfos: TList; + AItemLink: TdxBarItemLink; + I: Integer; + begin + if not ViewInfo.CanShowButtonGroups then + Exit; + + for I := 0 to ItemLinks.VisibleItemCount - 1 do + begin + AItemLink := ItemLinks.VisibleItems[I]; + if AItemLink.Control = nil then + AItemLink.CreateControl; + end; + + AItemControlViewInfos := TList.Create; + try + for I := 0 to ItemLinks.VisibleItemCount - 1 do + AItemControlViewInfos.Add(Pointer(IdxBarItemControlViewInfo(ItemLinks.VisibleItems[I].Control.ViewInfo))); + dxRibbonGroupLayoutCalculator.CalcItemControlsRealPositionInButtonGroup(AItemControlViewInfos); + finally + AItemControlViewInfos.Free; + end; + end; + +var + AItemControlWidth, ASeparatorWidth, I, X: Integer; + AItemLink: TdxBarItemLink; + R: TRect; +begin + R := GetClientOffset; + TdxBarItemLinksAccess(ItemLinks).EmptyItemRects; + X := R.Left; + Truncated := False; + AItemLink := nil; + CalcItemControlsRealPositionInButtonGroup; + for I := 0 to ItemLinks.VisibleItemCount - 1 do + begin + AItemLink := ItemLinks.VisibleItems[I]; + if AItemLink.Control = nil then + AItemLink.CreateControl; + TdxBarItemControlAccess(AItemLink.Control).LastInRow := False; + AItemControlWidth := TdxBarItemControlAccess(AItemLink.Control).Width; + ASeparatorWidth := GetSeparatorWidth(AItemLink.Control); + Truncated := X + ASeparatorWidth + AItemControlWidth > ClientWidth - GetMarkSize; + if Truncated then + begin + if I > 0 then + AItemLink := ItemLinks.VisibleItems[I - 1]; + Break; + end; + Inc(X, ASeparatorWidth); + AItemLink.ItemRect := Rect(X, R.Top, X + AItemControlWidth, ClientHeight - R.Bottom); + TdxBarItemLinkAccess(AItemLink).RowHeight := ClientHeight; + Inc(X, AItemControlWidth); + end; + if AItemLink <> nil then + TdxBarItemControlAccess(AItemLink.Control).LastInRow := True; +end; + +function TdxRibbonQuickAccessBarControl.CanHideAllItemsInSingleLine: Boolean; +begin + Result := True; +end; + +procedure TdxRibbonQuickAccessBarControl.CreateWnd; +begin + FIsWindowCreation := True; + try + inherited CreateWnd; + finally + FIsWindowCreation := False; + end; + UpdateDefaultGlyph(FDefaultGlyph); +end; + +procedure TdxRibbonQuickAccessBarControl.DoPaintItem(AControl: TdxBarItemControl; ACanvas: TcxCanvas; const AItemRect: TRect); +begin + ACanvas.SaveClipRegion; + try + ACanvas.SetClipRegion(TcxRegion.Create(AControl.ViewInfo.Bounds), roSet); + if IsNeedBufferedOnGlass(AControl) then + begin + with AItemRect do + FBitmap.SetSize(Right - Left, Bottom - Top); + FBitmap.cxCanvas.WindowOrg := AItemRect.TopLeft; + FillRect(FBitmap.cxCanvas.Handle, AItemRect, GetStockObject(BLACK_BRUSH)); + AControl.Paint(FBitmap.cxCanvas, AItemRect, GetPaintType); + FBitmap.MakeOpaque; + FBitmap.cxCanvas.WindowOrg := cxNullPoint; + cxBitBlt(ACanvas.Handle, FBitmap.cxCanvas.Handle, + AItemRect, cxNullPoint, SRCCOPY); + end + else + AControl.Paint(ACanvas, AItemRect, GetPaintType); + finally + ACanvas.RestoreClipRegion; + end; + DrawSelectedItem(ACanvas.Handle, AControl, AItemRect); +end; + +function TdxRibbonQuickAccessBarControl.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxRibbonQuickAccessBarControlAccessibilityHelper; +end; + +function TdxRibbonQuickAccessBarControl.GetClientOffset: TRect; +begin + Result := cxEmptyRect; +end; + +function TdxRibbonQuickAccessBarControl.GetDefaultItemGlyph: TBitmap; +begin + Result := FDefaultGlyph; +end; + +function TdxRibbonQuickAccessBarControl.GetItemControlDefaultViewLevel( + AItemControl: TdxBarItemControl): TdxBarItemViewLevel; +begin + Result := AItemControl.ViewInfo.MinPossibleViewLevel; +end; + +function TdxRibbonQuickAccessBarControl.GetMarkAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxRibbonQuickAccessBarControlMarkAccessibilityHelper; +end; + +function TdxRibbonQuickAccessBarControl.GetMarkSize: Integer; +begin + if MarkExists then + Result := Painter.MarkSizeX(Self) + else + Result := 0; +end; + +function TdxRibbonQuickAccessBarControl.GetMinHeight( + AStyle: TdxBarDockingStyle): Integer; +begin + if Visible then + Result := Max(inherited GetMinHeight(AStyle), Ribbon.GetGroupRowHeight) + else + Result := Ribbon.GetGroupRowHeight; +end; + +function TdxRibbonQuickAccessBarControl.GetMinWidth( + AStyle: TdxBarDockingStyle): Integer; +begin + Result := 0; +end; + +function TdxRibbonQuickAccessBarControl.GetPopupMenuItems: TdxRibbonPopupMenuItems; +begin + Result := inherited GetPopupMenuItems; + if BarDesignController.CustomizingItemLink = nil then + Exclude(Result, rpmiQATAddRemoveItem); +end; + +function TdxRibbonQuickAccessBarControl.GetQuickControlClass: TdxBarControlClass; +begin + Result := TdxRibbonQuickAccessPopupBarControl; +end; + +function TdxRibbonQuickAccessBarControl.GetRibbon: TdxCustomRibbon; +begin + if DockControl <> nil then + Result := TdxRibbonQuickAccessDockControl(DockControl).Ribbon + else + Result := nil; +end; + +function TdxRibbonQuickAccessBarControl.GetSize(AMaxWidth: Integer): TSize; +var + AItem: TdxBarItemLink; + AItemControl: TdxBarItemControlAccess; + AItemControlHeight, AItemControlWidth, ASeparatorWidth, I: Integer; +begin + if not CanAllocateHandle(Self) and not IsPopup or FIsWindowCreation then + begin + Result := cxSize(0, 0); + Exit; + end; + HandleNeeded; + + Result := cxSize(GetMarkSize, GetMinHeight(dsTop)); + for I := 0 to ItemLinks.CanVisibleItemCount - 1 do + begin + AItem := ItemLinks.CanVisibleItems[I]; + if AItem.Control = nil then + AItem.CreateControl; + AItemControl := TdxBarItemControlAccess(AItem.Control); + AItemControlWidth := AItemControl.Width; + ASeparatorWidth := GetSeparatorWidth(AItemControl); + if Result.cx + ASeparatorWidth + AItemControlWidth > AMaxWidth then + Break; + Inc(Result.cx, ASeparatorWidth + AItemControlWidth); + AItemControlHeight := AItemControl.Height; + if AItemControlHeight > Result.cy then + Result.cy := AItemControlHeight; + end; + if MarkExists and (Result.cx = GetMarkSize) then + Dec(Result.cx, TdxRibbonQuickAccessPainter(Painter).MarkButtonOffset); + with GetClientOffset do + begin + Inc(Result.cx, Left + Right); + Inc(Result.cy, Top + Bottom); + end; +end; + +function TdxRibbonQuickAccessBarControl.GetSizeForWidth( + AStyle: TdxBarDockingStyle; AWidth: Integer): TPoint; +begin + with GetSize(AWidth) do + Result := Point(cx, cy); +end; + +function TdxRibbonQuickAccessBarControl.GetViewInfoClass: TCustomdxBarControlViewInfoClass; +begin + Result := TdxRibbonQuickAccessBarControlViewInfo; +end; + +function TdxRibbonQuickAccessBarControl.AllowQuickCustomizing: Boolean; +begin + Result := True; +end; + +procedure TdxRibbonQuickAccessBarControl.InitQuickCustomizeItemLinks(AQuickControlItemLinks: TdxBarItemLinks); +var + ASubItem: TdxRibbonQuickAccessPopupSubItem; +begin + FInternalItems.Clear; + ASubItem := TdxRibbonQuickAccessPopupSubItem(AQuickControlItemLinks.AddItem(TdxRibbonQuickAccessPopupSubItem).Item); + BarDesignController.AddInternalItem(ASubItem, FInternalItems); + ASubItem.OnPopup := HandleQuickAccessSubItemPopup; +end; + +procedure TdxRibbonQuickAccessBarControl.InitAddRemoveSubItemPopup(AItemLinks: TdxBarItemLinks); +var + I: Integer; + AItemLink: TdxBarItemLink; + ASubItemButton: TdxRibbonQuickAccessPopupSubItemButton; + ASeparator: TdxBarItem; +begin + if ItemLinks.AvailableItemCount > 0 then + begin + ASeparator := AItemLinks.AddItem(TdxBarSeparator).Item; + ASeparator.Caption := cxGetResourceString(@dxSBAR_CUSTOMIZEQAT); + BarDesignController.AddInternalItem(ASeparator, FInternalItems); + + for I := 0 to ItemLinks.AvailableItemCount - 1 do + begin + AItemLink := ItemLinks.AvailableItems[I]; + ASubItemButton := TdxRibbonQuickAccessPopupSubItemButton(AItemLinks.AddItem(TdxRibbonQuickAccessPopupSubItemButton).Item); + ASubItemButton.Tag := Integer(AItemLink); + ASubItemButton.ButtonStyle := bsChecked; + ASubItemButton.Down := AItemLink.Visible; + BarDesignController.AddInternalItem(ASubItemButton, FInternalItems); + ASubItemButton.Caption := AItemLink.Caption; + end; + end; + QuickAccessToolbar.UpdateMenuItems(AItemLinks); +end; + +procedure TdxRibbonQuickAccessBarControl.InitCustomizationPopup(AItemLinks: TdxBarItemLinks); +begin + Ribbon.PopulatePopupMenuItems(AItemLinks, GetPopupMenuItems, PopupMenuClick); +end; + +function TdxRibbonQuickAccessBarControl.MarkExists: Boolean; +begin + Result := Ribbon.PopupMenuItems <> []; +end; + +procedure TdxRibbonQuickAccessBarControl.RemoveItemFromQAT; +begin + if BarDesignController.CustomizingItemLink.Item is TdxRibbonQuickAccessGroupButton then + BarDesignController.DeleteCustomizingItem + else + begin + if BarDesignController.CustomizingItemLink.OriginalItemLink <> nil then + BarDesignController.CustomizingItemLink.OriginalItemLink.Free + else + BarDesignController.DeleteCustomizingItemLink; + end; +end; + +procedure TdxRibbonQuickAccessBarControl.ShowPopup(AItem: TdxBarItemControl); +var + AItemLink: TdxBarItemLink; +begin + if not BarManager.IsCustomizing then + begin + if AItem <> nil then + AItemLink := AItem.ItemLink + else + AItemLink := nil; + BarDesignController.ShowCustomCustomizePopup(BarManager, InitCustomizationPopup, Ribbon.GroupsPainter, Self, AItemLink); + end + else + inherited; +end; + +procedure TdxRibbonQuickAccessBarControl.UpdateDefaultGlyph(AGlyph: TBitmap); +var + AGlyphSize: Integer; + R: TRect; +begin + if Ribbon = nil then Exit; + AGlyphSize := TdxRibbonBarPainter(Painter).GetSmallIconSize; + AGlyph.Width := AGlyphSize; + AGlyph.Height := AGlyphSize; + R := cxRect(0, 0, AGlyphSize, AGlyphSize); + FillRectByColor(AGlyph.Canvas.Handle, R, 0); + Ribbon.ColorScheme.DrawQuickAccessToolbarDefaultGlyph(AGlyph.Canvas.Handle, R); +end; + +procedure TdxRibbonQuickAccessBarControl.UpdateDoubleBuffered; +begin + DoubleBuffered := True; +end; + +function TdxRibbonQuickAccessBarControl.GetSeparatorWidth( + AItemControl: TdxBarItemControl): Integer; +begin + if AItemControl.ItemLink.BeginGroup and ViewInfo.CanShowSeparators then + Result := BeginGroupSize + else + Result := 0; +end; + +function TdxRibbonQuickAccessBarControl.GetViewInfo: TdxRibbonQuickAccessBarControlViewInfo; +begin + Result := TdxRibbonQuickAccessBarControlViewInfo(FViewInfo); +end; + +procedure TdxRibbonQuickAccessBarControl.WMPaint(var Message: TWMPaint); +var + DC, MemDC: HDC; + MemBitmap, OldBitmap: HBITMAP; + PS: TPaintStruct; + PaintBuffer: THandle; +begin + if Ribbon.IsDestroying then + begin + Message.Result := 0; + Exit; + end; + if not FDoubleBuffered or (Message.DC <> 0) then + begin + if not (csCustomPaint in ControlState) and (ControlCount = 0) then + inherited + else + PaintHandler(Message); + end + else + begin + if Ribbon.ViewInfo.UseGlass then + begin + DC := BeginPaint(Handle, PS); + try + PaintBuffer := BeginBufferedPaint(DC, @PS.rcPaint, BPBF_TOPDOWNDIB, nil, MemDC); + Perform(WM_ERASEBKGND, MemDC, MemDC); + Perform(WM_PRINTCLIENT, MemDC, PRF_CLIENT); + EndBufferedPaint(PaintBuffer, True); + finally + EndPaint(Handle, PS); + end; + end + else + begin + DC := BeginPaint(Handle, PS); + MemBitmap := CreateCompatibleBitmap(DC, PS.rcPaint.Right - PS.rcPaint.Left, + PS.rcPaint.Bottom - PS.rcPaint.Top); + try + MemDC := CreateCompatibleDC(DC); + OldBitmap := SelectObject(MemDC, MemBitmap); + try + SetWindowOrgEx(MemDC, PS.rcPaint.Left, PS.rcPaint.Top, nil); + Perform(WM_ERASEBKGND, MemDC, MemDC); + Message.DC := MemDC; + WMPaint(Message); + Message.DC := 0; + BitBlt(DC, PS.rcPaint.Left, PS.rcPaint.Top, + PS.rcPaint.Right - PS.rcPaint.Left, + PS.rcPaint.Bottom - PS.rcPaint.Top, + MemDC, + PS.rcPaint.Left, PS.rcPaint.Top, + SRCCOPY); + finally + SelectObject(MemDC, OldBitmap); + end; + finally + EndPaint(Handle, PS); + DeleteDC(MemDC); + DeleteObject(MemBitmap); + end; + end; + end; +end; + +{$IFNDEF DELPHI7} +procedure TdxRibbonQuickAccessBarControl.WMPrintClient(var Message: TWMPrintClient); +var + SaveIndex: Integer; +begin + with Message do + if Result <> 1 then + if ((Flags and PRF_CHECKVISIBLE) = 0) or Visible then + begin + SaveIndex := SaveDC(DC); + try + PaintHandler(TWMPaint(Message)); + finally + RestoreDC(DC, SaveIndex); + end; + end + else + inherited + else + inherited; +end; +{$ENDIF} + +{ TdxRibbonQuickAccessBarControlViewInfo } + +function TdxRibbonQuickAccessBarControlViewInfo.CanShowSeparators: Boolean; +begin + Result := False; +end; + +function TdxRibbonQuickAccessBarControlViewInfo.IsLastVisibleItemControl( + AItemControl: TdxBarItemControl): Boolean; +begin + Result := TdxBarItemControlAccess(AItemControl).LastInRow; +end; + +{ TdxRibbonQuickAccessDockControl } + +constructor TdxRibbonQuickAccessDockControl.Create(AOwner: TdxCustomRibbon); +begin + inherited Create(nil); + FRibbon := AOwner; + FPainter := TdxRibbonQuickAccessPainter.Create(Integer(Ribbon)); + Parent := AOwner; + AllowDocking := False; + Align := dalNone; +end; + +destructor TdxRibbonQuickAccessDockControl.Destroy; +begin + FPainter.Free; + inherited Destroy; +end; + +procedure TdxRibbonQuickAccessDockControl.CalcLayout; +begin + Ribbon.Changed; + inherited CalcLayout; +end; + +function TdxRibbonQuickAccessDockControl.GetDockedBarControlClass: TdxBarControlClass; +begin + Result := TdxRibbonQuickAccessBarControl; +end; + +function TdxRibbonQuickAccessDockControl.GetPainter: TdxBarPainter; +begin + Result := FPainter; +end; + +procedure TdxRibbonQuickAccessDockControl.VisibleChanged; +begin + with Ribbon do + begin + if not IsDestroying and IsBarManagerValid then + Changed; + end; +end; + +{ TdxRibbonCustomBarControl } + +constructor TdxRibbonCustomBarControl.CreateEx(AOwner: TComponent; ABar: TdxBar); +begin + inherited CreateEx(AOwner, ABar); + if not (csDesigning in ComponentState) then + ControlStyle := ControlStyle - [csDoubleClicks]; +end; + +function TdxRibbonCustomBarControl.AllowQuickCustomizing: Boolean; +begin + Result := False; +end; + +function TdxRibbonCustomBarControl.CanAlignControl(AControl: TdxBarItemControl): Boolean; +begin + Result := True; +end; + +function TdxRibbonCustomBarControl.CanMoving: Boolean; +begin + Result := False; +end; + +function TdxRibbonCustomBarControl.GetBehaviorOptions: TdxBarBehaviorOptions; +begin + Result := dxRibbonBarBehaviorOptions; +end; + +function TdxRibbonCustomBarControl.GetEditFont: TFont; +begin + if Ribbon = nil then + Result := inherited GetEditFont + else + Result := Ribbon.Fonts.GetGroupFont; +end; + +function TdxRibbonCustomBarControl.GetFont: TFont; +begin + if Ribbon = nil then + Result := inherited GetFont + else + Result := Ribbon.Fonts.GetGroupFont; +end; + +function TdxRibbonCustomBarControl.GetFullItemRect(Item: TdxBarItemControl): TRect; +begin + Result := GetItemRect(Item); +end; + +function TdxRibbonCustomBarControl.GetIsMainMenu: Boolean; +begin + Result := False; +end; + +function TdxRibbonCustomBarControl.GetMultiLine: Boolean; +begin + Result := False; +end; + +function TdxRibbonCustomBarControl.HasCloseButton: Boolean; +begin + Result := False; +end; + +function TdxRibbonCustomBarControl.MarkExists: Boolean; +begin + Result := False; +end; + +function TdxRibbonCustomBarControl.NotHandleMouseMove( + ACheckLastMousePos: Boolean = True): Boolean; +begin + Result := inherited NotHandleMouseMove(ACheckLastMousePos) or HasPopupWindowAbove(Self, True); +end; + +function TdxRibbonCustomBarControl.RealMDIButtonsOnBar: Boolean; +begin + Result := False; +end; + +function TdxRibbonCustomBarControl.ClickAtHeader: Boolean; +var + R: TRect; +begin + R := WindowRect; + R.Top := R.Bottom - (Height - ClientBounds.Bottom); + Result := cxRectPtIn(R, GetMouseCursorPos); +end; + +procedure TdxRibbonCustomBarControl.DoPopupMenuClick(Sender: TObject); +begin + Ribbon.PopupMenuItemClick(Sender); +end; + +function TdxRibbonCustomBarControl.GetPopupMenuItems: TdxRibbonPopupMenuItems; +begin + Result := Ribbon.PopupMenuItems - [rpmiItems]; + if not Ribbon.IsQuickAccessToolbarValid then + Exclude(Result, rpmiQATAddRemoveItem); +end; + +procedure TdxRibbonCustomBarControl.InitCustomizationPopup(AItemLinks: TdxBarItemLinks); +begin + Ribbon.PopulatePopupMenuItems(AItemLinks, GetPopupMenuItems, PopupMenuClick); +end; + +procedure TdxRibbonCustomBarControl.PopupMenuClick(Sender: TObject); +var + ALinkSelf: TcxObjectLink; +begin + ALinkSelf := cxAddObjectLink(Self); + try + DoPopupMenuClick(Sender); + if ALinkSelf.Ref <> nil then + HideAll; + finally + cxRemoveObjectLink(ALinkSelf); + end; +end; + +procedure TdxRibbonCustomBarControl.ShowPopup(AItem: TdxBarItemControl); +var + AItemLink: TdxBarItemLink; +begin + if not BarManager.IsCustomizing then + begin + if AItem <> nil then + AItemLink := AItem.ItemLink + else + AItemLink := nil; + if (AItemLink <> nil) or ClickAtHeader then + BarDesignController.ShowCustomCustomizePopup(BarManager, InitCustomizationPopup, Painter, Self, AItemLink); + end + else + inherited; +end; + +function TdxRibbonCustomBarControl.GetQuickAccessToolbar: TdxRibbonQuickAccessToolbar; +begin + if Ribbon <> nil then + Result := Ribbon.QuickAccessToolbar + else + Result := nil; +end; + +procedure TdxRibbonCustomBarControl.WMNCHitTest(var Message: TWMNCHitTest); +var + R: TRect; +begin + R := cxRectOffset(ClientRect, ClientToScreen(cxNullPoint)); + inherited; + if PtInRect(R, SmallPointToPoint(Message.Pos)) then + begin + if HitTest = HTCAPTION then + HitTest := HTCLIENT; + end + else + begin + Message.Result := HTCLIENT; + HitTest := HTCLIENT; + end; +end; + +{ TdxRibbonQuickAccessBarControlDesignHelper } + +class procedure TdxRibbonQuickAccessBarControlDesignHelper.GetEditors(AEditors: TList); +begin + inherited GetEditors(AEditors); + AEditors.Add(TdxAddGroupButtonEditor); +end; + +class function TdxRibbonQuickAccessBarControlDesignHelper.GetForbiddenActions: TdxBarCustomizationActions; +begin + Result := inherited GetForbiddenActions + [caChangeBeginGroup]; +end; + +{ TdxRibbonQuickAccessPopupBarControl } + +constructor TdxRibbonQuickAccessPopupBarControl.CreateEx(AOwner: TComponent; ABar: TdxBar); +begin + inherited CreateEx(AOwner, ABar); + FPainter := TdxRibbonQuickAccessPopupPainter.Create(Integer(Ribbon)); +end; + +destructor TdxRibbonQuickAccessPopupBarControl.Destroy; +begin + FreeAndNil(FPainter); + IsActive := False; + inherited Destroy; +end; + +procedure TdxRibbonQuickAccessPopupBarControl.CloseUp; +var + AAccessibilityHelper: TdxBarControlMarkAccessibilityHelper; + AClosedByEscape: Boolean; +begin + AAccessibilityHelper := TdxBarControlMarkAccessibilityHelper(QuickAccessBarControl.MarkIAccessibilityHelper.GetHelper); + AClosedByEscape := ClosedByEscape; + inherited CloseUp; + AAccessibilityHelper.CloseUpHandler(AClosedByEscape); +end; + +procedure TdxRibbonQuickAccessPopupBarControl.Popup(const AOwnerRect: TRect); +var + R: TRect; +begin + inherited Popup(AOwnerRect); + if QuickAccessBarControl.AllItemsVisible then + begin + SetWindowRgn(Handle, CreateRectRgnIndirect(cxEmptyRect), True); + + R := TdxBarAccessibilityHelperAccess(QuickAccessBarControl.MarkIAccessibilityHelper.GetHelper).GetScreenBounds(cxAccessibleObjectSelfID); + R.TopLeft := ScreenToClient(R.TopLeft); + R.BottomRight := ScreenToClient(R.BottomRight); + GetMarkLink.ItemRect := R; + + GetMarkSubItem.DropDown(not BarNavigationController.NavigationMode); + end; +end; + +function TdxRibbonQuickAccessPopupBarControl.GetClientOffset: TRect; +begin + Result := cxRect(3, 3, 3, 3); +end; + +function TdxRibbonQuickAccessPopupBarControl.GetPainter: TdxBarPainter; +begin + Result := FPainter; +end; + +function TdxRibbonQuickAccessPopupBarControl.GetRibbon: TdxCustomRibbon; +begin + Result := QuickAccessBarControl.Ribbon; +end; + +function TdxRibbonQuickAccessPopupBarControl.GetSizeForPopup: TSize; +begin + Result := GetSize(MaxInt); +end; + +function TdxRibbonQuickAccessPopupBarControl.HasShadow: Boolean; +begin + Result := not QuickAccessBarControl.AllItemsVisible; +end; + +function TdxRibbonQuickAccessPopupBarControl.IsPopup: Boolean; +begin + Result := True; +end; + +function TdxRibbonQuickAccessPopupBarControl.GetQuickAccessBarControl: TdxRibbonQuickAccessBarControl; +begin + if ParentBar <> nil then + Result := TdxRibbonQuickAccessBarControl(ParentBar) + else + Result := TdxRibbonQuickAccessBarControl(Bar.Control); +end; + +function TdxRibbonQuickAccessPopupBarControl.GetMarkLink: TdxBarItemLink; +begin + Result := ItemLinks[ItemLinks.Count - 1]; +end; + +function TdxRibbonQuickAccessPopupBarControl.GetMarkSubItem: TCustomdxBarSubItem; +begin + Result := TCustomdxBarSubItem(GetMarkLink.Item); +end; + +{ TdxRibbonQuickAccessPopupPainter } + +function TdxRibbonQuickAccessPopupPainter.MarkButtonOffset: Integer; +begin + Result := 0; +end; + +function TdxRibbonQuickAccessPopupPainter.MarkSizeX(ABarControl: TdxBarControl): Integer; +begin + Result := 0; +end; + +procedure TdxRibbonQuickAccessPopupPainter.DrawQuickAccessPopupSubItem( + DC: HDC; const ARect: TRect; AState: Integer); +begin + if AState <> DXBAR_NORMAL then + Skin.DrawBackground(DC, ARect, DXBAR_SMALLBUTTON, AState); + if AState = DXBAR_ACTIVE then + AState := DXBAR_HOT; + Skin.DrawBackground(DC, ARect, DXBAR_MARKARROW, AState); +end; + +procedure TdxRibbonQuickAccessPopupPainter.DrawToolbarContentPart( + ABarControl: TdxBarControl; ACanvas: TcxCanvas); +begin + Ribbon.ColorScheme.DrawQuickAccessToolbarPopup(ACanvas.Handle, + ABarControl.ClientRect); +end; + +{ TdxRibbonQuickAccessPopupSubItem } + +function TdxRibbonQuickAccessPopupSubItem.CreateBarControl: TCustomdxBarControl; +begin + Result := TdxRibbonQuickAccessPopupSubMenuControl.Create(BarManager); +end; + +procedure TdxRibbonQuickAccessPopupSubMenuControl.ShowPopup(AItem: TdxBarItemControl); +begin +// do nothing +end; + +{ TdxRibbonQuickAccessPopupSubItemControl } + +procedure TdxRibbonQuickAccessPopupSubItemControl.DoCloseUp( + AHadSubMenuControl: Boolean); +var + AClosedByEscape: Boolean; + AQATBarControl: TdxRibbonQuickAccessBarControl; +begin + AClosedByEscape := AHadSubMenuControl and + TdxBarSubMenuControlAccess(Item.ItemLinks.BarControl).ClosedByEscape; + inherited DoCloseUp(AHadSubMenuControl); + AQATBarControl := TdxRibbonQuickAccessPopupBarControl(Parent).QuickAccessBarControl; + if AClosedByEscape then + begin + if AQATBarControl.AllItemsVisible then + begin + AQATBarControl.MarkState := msNone; + if BarNavigationController.NavigationMode then + AQATBarControl.MarkIAccessibilityHelper.Select(False); + end; + end + else + if AHadSubMenuControl and (BarNavigationController.AssignedSelectedObject <> nil) and + (BarNavigationController.AssignedSelectedObject.GetHelper = AQATBarControl.MarkIAccessibilityHelper.GetHelper) then + AQATBarControl.MarkIAccessibilityHelper.Unselect(nil); +end; + +procedure TdxRibbonQuickAccessPopupSubItemControl.DoPaint(ARect: TRect; + PaintType: TdxBarPaintType); + + function GetState: Integer; + begin + if DrawParams.DroppedDown then + Result := DXBAR_PRESSED + else + if DrawSelected then + Result := DXBAR_ACTIVE + else + Result := DXBAR_NORMAL; + end; + +begin + TdxRibbonQuickAccessPopupPainter(Painter).DrawQuickAccessPopupSubItem(Canvas.Handle, ARect, GetState); +end; + +function TdxRibbonQuickAccessPopupSubItemControl.GetDefaultWidth: Integer; +begin + Result := TdxRibbonQuickAccessPopupPainter(Painter).MarkButtonWidth; +end; + +{ TdxRibbonQuickAccessPopupSubItemButton } + +procedure TdxRibbonQuickAccessPopupSubItemButton.DoClick; +begin + TdxBarItemLink(Tag).Visible := Down; +end; + +{ TdxRibbonGroupBarControl } + +constructor TdxRibbonGroupBarControl.CreateEx(AOwner: TComponent; ABar: TdxBar); + + function GetGroup: TdxRibbonTabGroup; + var + ATab: TdxRibbonTab; + I: Integer; + begin + Result := nil; + ATab := TdxRibbonGroupsDockControl(Bar.DockControl).Tab; + for I := 0 to ATab.Groups.Count - 1 do + if ATab.Groups[I].ToolBar = ABar then + begin + Result := ATab.Groups[I]; + Break; + end; + end; + +begin + inherited CreateEx(AOwner, ABar); + FGroup := GetGroup; + FRibbon := FGroup.Tab.Ribbon; +end; + +destructor TdxRibbonGroupBarControl.Destroy; +begin + if Ribbon.CanFade then + Ribbon.Fader.Remove(Self); + inherited Destroy; +end; + +procedure TdxRibbonGroupBarControl.CloseUp; +var + AAccessibilityHelper: TdxRibbonGroupBarControlAccessibilityHelper; + AClosedByEscape: Boolean; +begin + if GetParentPopupWindow(Self, False) <> nil then + begin + TdxRibbonTabAccessibilityHelper(Group.Tab.IAccessibilityHelper.GetHelper).CloseUpHandler(ClosedByEscape); + TdxRibbonTabGroupsPopupWindow(DockControl.Parent.Parent).CloseUp; + end + else + begin + AAccessibilityHelper := TdxRibbonGroupBarControlAccessibilityHelper(ParentBar.IAccessibilityHelper.GetHelper); + AClosedByEscape := ClosedByEscape; + inherited CloseUp; + AAccessibilityHelper.CloseUpHandler(AClosedByEscape); + end; +end; + +function TdxRibbonGroupBarControl.FadingCanFade: Boolean; +begin + Result := HandleAllocated and not (csDestroying in ComponentState); +end; + +procedure TdxRibbonGroupBarControl.FadingDrawBitmap(ABitmap: TBitmap); +var + DC: HDC; + I: Integer; + R: TRect; +begin + if not HandleAllocated then Exit; + DC := GetDCEx(Handle, 0, DCX_CACHE or DCX_CLIPSIBLINGS or DCX_WINDOW or DCX_VALIDATE); +// GetWindowRect(R); +// Dec(R.Left, ClientOrigin.X); +// Dec(R.Top, ClientOrigin.Y); +// SetWindowOrgEx(DC, R.Left, R.Top, nil); + Canvas.WindowOrg := R.TopLeft; + for I := 0 to ItemLinks.VisibleItemCount - 1 do + with ItemLinks.VisibleItems[I] do + //if Ribbon.Fader.Contains(Control) then + ExcludeClipRect(DC, ItemRect.Left, ItemRect.Top, ItemRect.Right, ItemRect.Bottom); + BitBlt(DC, 0, 0, Width, Height, ABitmap.Canvas.Handle, 0, 0, SRCCOPY); + ReleaseDC(Handle, DC); +end; + +procedure TdxRibbonGroupBarControl.FadingGetFadingParams( + out AFadeOutImage, AFadeInImage: TBitmap; + var AFadeInStageCount, AFadeInStageInterval, + AFadeOutStageCount, AFadeOutStageInterval: Integer); + + procedure Draw(ACanvas: TCanvas; AState: TdxBarViewState); + var + APrevViewState: TdxBarViewState; + R: TRect; + begin + APrevViewState := FViewState; + Canvas.Canvas.Handle := ACanvas.Handle; + FViewState := AState; + R := WindowRect; + Dec(R.Left, ClientOrigin.X); + Dec(R.Top, ClientOrigin.Y); + Canvas.WindowOrg := R.TopLeft; + DoPaint; + Canvas.WindowOrg := cxNullPoint; + DoNCPaint(Canvas.Handle); + FViewState := APrevViewState; + Canvas.Canvas.Handle := 0; + end; + +begin + AFadeInImage := TBitmap.Create; + AFadeOutImage := TBitmap.Create; +{$IFDEF DELPHI10} + AFadeInImage.SetSize(Width, Height); + AFadeOutImage.SetSize(Width, Height); +{$ELSE} + AFadeInImage.Width := Width; + AFadeInImage.Height := Height; + AFadeOutImage.Width := Width; + AFadeOutImage.Height := Height; +{$ENDIF} + //todo: + Draw(AFadeInImage.Canvas, bvsHot); + Draw(AFadeInImage.Canvas, bvsNormal); +end; + +procedure TdxRibbonGroupBarControl.AdjustHintWindowPosition(var APos: TPoint; + const ABoundsRect: TRect; AHeight: Integer); +const + HintIndent = 2; +begin + APos.X := ABoundsRect.Left; + APos.Y := Ribbon.ClientToScreen(cxPoint(0, Ribbon.Height)).Y; + APos.Y := Max(APos.Y, ClientToScreen(cxPoint(0, Height + HintIndent)).Y); + if GetDesktopWorkArea(APos).Bottom - APos.Y < AHeight then + begin + APos.Y := Ribbon.ClientToScreen(cxNullPoint).Y - AHeight - HintIndent; + APos.Y := Min(APos.Y, ClientToScreen(cxNullPoint).Y - AHeight - 2 * HintIndent); + end; +end; + +procedure TdxRibbonGroupBarControl.CalcLayout; +begin + if Ribbon.CanFade then + Ribbon.Fader.Clear; +end; + +function TdxRibbonGroupBarControl.CanProcessShortCut: Boolean; +begin + Result := True; +end; + +procedure TdxRibbonGroupBarControl.CaptionChanged; +begin + inherited CaptionChanged; + RebuildBar; +end; + +procedure TdxRibbonGroupBarControl.DoHideAll; +var + ALinkSelf: TcxObjectLink; +begin + ALinkSelf := cxAddObjectLink(Self); + try + inherited; + if (ALinkSelf.Ref <> nil) and (GetParentPopupWindow(Self, True) <> nil) then + CloseUp; + finally + cxRemoveObjectLink(ALinkSelf); + end; +end; + +procedure TdxRibbonGroupBarControl.DoNCPaint(DC: HDC); +begin + if Ribbon.ColorScheme.HasGroupTransparency then + DoTransparentNCPaint(DC) + else + DoOpaqueNCPaint(DC); +end; + +procedure TdxRibbonGroupBarControl.DoOpaqueNCPaint(DC: HDC); +begin + if not Collapsed then + begin + BarCanvas.BeginPaint(DC); + try + PaintGroupMark(BarCanvas); + inherited DoNCPaint(BarCanvas.Handle); + DrawCaptionButtons(BarCanvas); + finally + BarCanvas.EndPaint; + end; + end; +end; + +procedure TdxRibbonGroupBarControl.DoTransparentNCPaint(DC: HDC); +var + P: TPoint; + R, BR: TRect; + H: HWND; + AIndex: Integer; + B: TcxBitmap; +begin + B := TcxBitmap.CreateSize(Width, Height); + try + AIndex := SaveDC(DC); + R := ClientRect; + BR := Painter.GetToolbarContentOffsets(Bar, dsNone, False); + OffsetRect(R, BR.Left, BR.Top); + ExcludeClipRect(DC, R.Left, R.Top, R.Right, R.Bottom); + if not IsPopup then + begin + P := cxNullPoint; + H := Ribbon.FGroupsDockControlSite.Handle; + Windows.GetWindowRect(H, R); + OffsetRect(R, -R.Left, -R.Top); + MapWindowPoint(Handle, H, P); + Dec(P.X, BR.Left); + Dec(P.Y, BR.Top); + SetWindowOrgEx(B.Canvas.Handle, P.X, P.Y, nil); + Ribbon.ColorScheme.DrawTabGroupsArea(B.Canvas.Handle, R); + SetWindowOrgEx(B.Canvas.Handle, 0, 0, nil); + end + else + begin + R := GetWindowRect; + OffsetRect(R, -R.Left, -R.Top); + Ribbon.ColorScheme.DrawTabGroupsArea(B.Canvas.Handle, R); + end; + DoOpaqueNCPaint(B.Canvas.Handle); + cxBitBlt(DC, B.Canvas.Handle, R, cxNullPoint, SRCCOPY); + RestoreDC(DC, AIndex); + finally + B.Free; + end; +end; + +procedure TdxRibbonGroupBarControl.DoPaint; +begin + FillParentBackground; + if Collapsed then + begin + PaintGroupMark(Canvas); + TdxRibbonBarPainter(Painter).DrawToolbarContentPart(Self, Canvas); + end + else + inherited DoPaint; +end; + +procedure TdxRibbonGroupBarControl.DoBarMouseDown(Button: TMouseButton; Shift: TShiftState; + const APoint: TPoint; AItemControl: TdxBarItemControl; APointInClientRect: Boolean); +begin + with GetWindowPoint(APoint) do + if cxRectPtIn(GetGroupDesignRect, X, Y) then + begin + Group.DesignSelectionHelper.SelectComponent; + if Button = mbRight then + ShowGroupDesignMenu; + end + else + inherited; +end; + +function TdxRibbonGroupBarControl.ClickAtHeader: Boolean; +begin + Result := Collapsed and cxRectPtIn(WindowRect, GetMouseCursorPos) or inherited ClickAtHeader; +end; + +function TdxRibbonGroupBarControl.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxRibbonGroupBarControlAccessibilityHelper; +end; + +function TdxRibbonGroupBarControl.GetMarkDrawState: TdxBarMarkState; +begin + if IAccessibilityHelper.IsSelected then + Result := msSelected + else + Result := MarkState; +end; + +function TdxRibbonGroupBarControl.GetMoreButtonsHint: string; +begin + Result := Caption; +end; + +function TdxRibbonGroupBarControl.GetQuickControlClass: TdxBarControlClass; +begin + Result := TdxRibbonCollapsedGroupPopupBarControl; +end; + +function TdxRibbonGroupBarControl.GetRibbon: TdxCustomRibbon; +begin + Result := FRibbon; +end; + +function TdxRibbonGroupBarControl.GetViewInfoClass: TCustomdxBarControlViewInfoClass; +begin + Result := TdxRibbonGroupBarControlViewInfo; +end; + +procedure TdxRibbonGroupBarControl.GlyphChanged; +begin + Ribbon.QuickAccessToolbar.UpdateGroupButton(Bar, False); +end; + +procedure TdxRibbonGroupBarControl.InitQuickControl( + AQuickControlItemLinks: TdxBarItemLinks); +begin +// do nothing +end; + +procedure TdxRibbonGroupBarControl.MakeItemControlFullyVisible( + AItemControl: TdxBarItemControl); +var + R: TRect; +begin + if DockControl = nil then + Exit; + R := AItemControl.ViewInfo.Bounds; + R.TopLeft := DockControl.ScreenToClient(ClientToScreen(R.TopLeft)); + R.BottomRight := DockControl.ScreenToClient(ClientToScreen(R.BottomRight)); + TdxRibbonGroupsDockControl(DockControl).MakeRectFullyVisible(R); +end; + +function TdxRibbonGroupBarControl.MarkExists: Boolean; +begin + Result := Collapsed; +end; + +procedure TdxRibbonGroupBarControl.ViewStateChanged(APrevValue: TdxBarViewState); +var + I: Integer; +begin + if Ribbon.CanFade then + begin + if ViewState = bvsHot then + Ribbon.Fader.FadeIn(Self) + else + begin + for I := 0 to ItemLinks.Count - 1 do + Ribbon.Fader.Remove(ItemLinks[I]); + Ribbon.Fader.FadeOut(Self); + end; + end + else + FullInvalidate; +end; + +procedure TdxRibbonGroupBarControl.UpdateCaptionButtons(ACaptionButton: TdxBarCaptionButton); +var + I: Integer; + AButtonRect: TRect; + AButtonWidth: Integer; +begin + if ACaptionButton = nil then + begin + AButtonRect := Ribbon.SkinGetCaptionRect(NCRect, DXBAR_TOOLBAR); + AButtonWidth := cxRectHeight(AButtonRect) + 1; + AButtonRect.Left := AButtonRect.Right - AButtonWidth; + for I := 0 to Bar.CaptionButtons.Count - 1 do + begin + Bar.CaptionButtons[I].Rect := AButtonRect; + OffsetRect(AButtonRect, -AButtonWidth, 0); + end; + InvalidateNCRect(CaptionButtons.Rect); + end + else + InvalidateNCRect(ACaptionButton.Rect); +end; + +procedure TdxRibbonGroupBarControl.DesignMenuClick(Sender: TObject); +begin + case TdxBarButton(Sender).Tag of + 0: Ribbon.DesignAddTabGroup(Group.Tab, False); + 1: Ribbon.DesignAddTabGroup(Group.Tab, True); + 2: BarDesignController.DeleteSelectedObjects(True, True) + end; +end; + +procedure TdxRibbonGroupBarControl.DrawBarParentBackground(ACanvas: TcxCanvas); +var + APoint: TPoint; + ARect: TRect; + H: HWND; +begin + if Ribbon.ColorScheme.HasGroupTransparency then + begin + Canvas.SaveState; + if not IsPopup then + begin + H := Ribbon.FGroupsDockControlSite.Handle; + APoint := cxNullPoint; + Windows.GetClientRect(H, ARect); + MapWindowPoint(Handle, H, APoint); + OffsetRect(ARect, -APoint.X, -APoint.Y); + Ribbon.Painter.DrawGroupsArea(ACanvas, ARect); + end; + Canvas.RestoreState; + end; +end; + +procedure TdxRibbonGroupBarControl.DrawCaptionButtons(ACanvas: TcxCanvas); + + procedure DrawGlyph(AButton: TdxBarCaptionButton); + const + ADefaultGlyphSize = 12; // same as dxRibbonSkins.LaunchButtonGlyphSize + var + AGlyphRectSize: Integer; + AGlyphRect: TRect; + AGlyphRatio: Integer; + begin + AGlyphRectSize := Min(cxRectWidth(AButton.Rect), cxRectHeight(AButton.Rect)) - 2 {BorderSize} * 2; + AGlyphRatio := Round(Max(1, AGlyphRectSize / ADefaultGlyphSize)); + AGlyphRectSize := ADefaultGlyphSize * AGlyphRatio; + if AGlyphRatio > 1 then + Dec(AGlyphRectSize, AGlyphRatio); // GDI+ feature + AGlyphRect := cxRectCenter(AButton.Rect, AGlyphRectSize, AGlyphRectSize); + if not AButton.Glyph.Empty then + TransparentDraw(ACanvas.Handle, AGlyphRect, AButton.Glyph, AButton.Enabled) + else + begin + OffsetRect(AGlyphRect, 1, 1); // because shadow + Ribbon.GroupsPainter.Skin.DrawBackground(ACanvas.Handle, AGlyphRect, DXBAR_LAUNCHBUTTONDEFAULTGLYPH, AButton.State); + end; + end; + +var + I: Integer; + AButton: TdxBarCaptionButton; +begin + if CaptionButtons.Count = 0 then + Exit; + + ACanvas.SetClipRegion(TcxRegion.Create(CaptionButtons.Rect), roSet); + for I := 0 to CaptionButtons.Count - 1 do + begin + AButton := CaptionButtons[I]; + Ribbon.GroupsPainter.Skin.DrawBackground(ACanvas.Handle, AButton.Rect, DXBAR_LAUNCHBUTTONBACKGROUND, AButton.State); + DrawGlyph(AButton); + end; +end; + +procedure TdxRibbonGroupBarControl.DrawSelectedFrame(DC: HDC); + + procedure DrawLine(const R: TRect); + begin + DrawRect(DC, R, clBlack, True); + end; + +var + R: TRect; +begin + R := NCRect; + DrawLine(cxRect(R.Left, R.Top, R.Right, R.Top + 2)); + DrawLine(cxRect(R.Left, R.Bottom - 2, R.Right, R.Bottom)); + DrawLine(cxRect(R.Left, R.Top, R.Left + 2, R.Bottom)); + DrawLine(cxRect(R.Right - 2, R.Top, R.Right, R.Bottom)); +end; + +procedure TdxRibbonGroupBarControl.FillParentBackground; +var + P: TPoint; + R, BR: TRect; + H: HWND; +begin + if Ribbon.ColorScheme.HasGroupTransparency then + begin + Canvas.SaveState; + if not IsPopup then + begin + P := cxNullPoint; + H := Ribbon.FGroupsDockControlSite.Handle; + Windows.GetClientRect(H, R); + MapWindowPoint(Handle, H, P); + Canvas.WindowOrg := P; + end + else + begin + R := GetWindowRect; + OffsetRect(R, -R.Left, -R.Top); + BR := Painter.GetToolbarContentOffsets(Bar, dsNone, False); + OffsetRect(R, -BR.Left, -BR.Top); + end; + Ribbon.Painter.DrawGroupsArea(Canvas, R); + Canvas.RestoreState; + end; +end; + +function TdxRibbonGroupBarControl.GetCollapsed: Boolean; +begin + Result := ViewInfo.Collapsed; +end; + +function TdxRibbonGroupBarControl.GetGroupDesignRect: TRect; +const + MarkSize = 14; +begin + if csDesigning in ComponentState then + begin + Result := WindowRect; + OffsetRect(Result, -(Result.Left - 3), -(Result.Top + 3)); + Result.Top := Result.Bottom - MarkSize; + Result.Right := Result.Left + MarkSize; + end + else + Result := cxEmptyRect; +end; + +function TdxRibbonGroupBarControl.GetViewInfo: TdxRibbonGroupBarControlViewInfo; +begin + Result := TdxRibbonGroupBarControlViewInfo(FViewInfo); +end; + +procedure TdxRibbonGroupBarControl.PaintGroupMark(ACanvas: TcxCanvas); +var + ASelected: Boolean; +begin + ASelected := Group.DesignSelectionHelper.IsComponentSelected; + cxDrawDesignRect(ACanvas, GetGroupDesignRect, ASelected); + if ASelected then + DrawSelectedFrame(ACanvas.Handle); +end; + +procedure TdxRibbonGroupBarControl.InitDesignMenu(AItemLinks: TdxBarItemLinks); +begin + BarDesignController.AddInternalItem(AItemLinks, TdxBarButton, + cxGetResourceString(@dxSBAR_RIBBONADDEMPTYGROUP), DesignMenuClick, 0); + BarDesignController.AddInternalItem(AItemLinks, TdxBarButton, + cxGetResourceString(@dxSBAR_RIBBONADDGROUPWITHTOOLBAR), DesignMenuClick, 1); + BarDesignController.AddInternalItem(AItemLinks, TdxBarButton, + cxGetResourceString(@dxSBAR_RIBBONDELETEGROUP), DesignMenuClick, 2, True); +end; + +procedure TdxRibbonGroupBarControl.ShowGroupDesignMenu; +begin + BarDesignController.ShowCustomCustomizePopup(BarManager, InitDesignMenu, Painter); +end; + +procedure TdxRibbonGroupBarControl.WMNCHitTest(var Message: TWMNCHitTest); +begin + if Collapsed then + begin + Message.Result := HTCLIENT; + HitTest := HTCLIENT; + end + else + inherited; +end; + +//don't use Delphi 2007 WM_PAINT handler +procedure TdxRibbonGroupBarControl.WMPaint(var Message: TWMPaint); +var + DC, MemDC: HDC; + MemBitmap, OldBitmap: HBITMAP; + PS: TPaintStruct; +begin + if not FDoubleBuffered or (Message.DC <> 0) then + begin + if not (csCustomPaint in ControlState) and (ControlCount = 0) then + inherited + else + PaintHandler(Message); + end + else + begin + DC := GetDC(0); + MemBitmap := CreateCompatibleBitmap(DC, ClientRect.Right, ClientRect.Bottom); + ReleaseDC(0, DC); + MemDC := CreateCompatibleDC(0); + OldBitmap := SelectObject(MemDC, MemBitmap); + try + DC := BeginPaint(Handle, PS); + Perform(WM_ERASEBKGND, MemDC, MemDC); + Message.DC := MemDC; + WMPaint(Message); + Message.DC := 0; + BitBlt(DC, 0, 0, ClientRect.Right, ClientRect.Bottom, MemDC, 0, 0, SRCCOPY); + EndPaint(Handle, PS); + finally + SelectObject(MemDC, OldBitmap); + DeleteDC(MemDC); + DeleteObject(MemBitmap); + end; + end; +end; + +{ TdxRibbonGroupBarControlViewInfo } + +procedure TdxRibbonGroupBarControlViewInfo.Calculate; +var + I: Integer; +begin + FNonContentAreaSize := GetNonContentAreaSize; + if Collapsed then + begin + ContentSize := cxClasses.Size(BarControl.Ribbon.GroupsPainter.GetCollapsedGroupWidth(BarControl), + BarControl.Ribbon.GetGroupHeight); + RemoveSeparatorInfos; + for I := 0 to ItemControlCount - 1 do + IdxBarItemControlViewInfo(ItemControlViewInfos[I]).SetBounds(cxEmptyRect); + end + else + LayoutCalculator.CalcLayout(CreateCalculateHelper); +end; + +procedure TdxRibbonGroupBarControlViewInfo.CalculateFinalize; +begin + FKeyTipsBaseLinePositions.Calculated := False; + FLayoutCalculator := nil; + UpdateItemRects; +end; + +procedure TdxRibbonGroupBarControlViewInfo.CalculateInit; +var + AItemControl: TdxBarItemControl; + AItemLinks: TdxBarItemLinks; + I: Integer; +begin + Clear; + Collapsed := False; + AItemLinks := BarControl.ItemLinks; + if (AItemLinks.CanVisibleItemCount > 0) and (AItemLinks.CanVisibleItems[0].Control <> nil(*TODO*)) then + for I := 0 to AItemLinks.CanVisibleItemCount - 1 do + begin + AItemControl := BarControl.ItemLinks.CanVisibleItems[I].Control; + TdxBarItemControlAccess(AItemControl).LastInRow := I = AItemLinks.CanVisibleItemCount - 1; + AddItemControlViewInfo(AItemControl.ViewInfo); + end; + FLayoutCalculator := CreateLayoutCalculator; + FLayoutCalculator.CalcInit(CreateCalculateHelper); +end; + +function TdxRibbonGroupBarControlViewInfo.CollapseMultiColumnItemControls: Boolean; +begin + Result := LayoutCalculator.CollapseMultiColumnItemControls( + CreateCalculateHelper); +end; + +function TdxRibbonGroupBarControlViewInfo.DecreaseMultiColumnItemControlsColumnCount: Boolean; +begin + Result := LayoutCalculator.DecreaseMultiColumnItemControlsColumnCount( + CreateCalculateHelper); +end; + +function TdxRibbonGroupBarControlViewInfo.Reduce( + AUpToViewLevel: TdxBarItemRealViewLevel): Boolean; +begin + Result := LayoutCalculator.Reduce(CreateCalculateHelper, AUpToViewLevel); +end; + +procedure TdxRibbonGroupBarControlViewInfo.ReduceInit; +begin + LayoutCalculator.ReduceInit(CreateCalculateHelper); +end; + +procedure TdxRibbonGroupBarControlViewInfo.CalculateKeyTipsBaseLinePositions; +begin + if not BarControl.HandleAllocated or not IsWindowVisible(BarControl.Handle) then + raise Exception.Create(''); + if not FKeyTipsBaseLinePositions.Calculated then + begin + DoCalculateKeyTipsBaseLinePositions; + FKeyTipsBaseLinePositions.Calculated := True; + end; +end; + +function TdxRibbonGroupBarControlViewInfo.CreateLayoutCalculator: IdxRibbonGroupLayoutCalculator; +begin + FGroupRowHeight := BarControl.Ribbon.GetGroupRowHeight; + Result := TdxRibbonGroupLayoutCalculator.Create(FGroupRowHeight, + dxRibbonGroupRowCount); +end; + +procedure TdxRibbonGroupBarControlViewInfo.DoCalculateKeyTipsBaseLinePositions; +begin + SetLength(FKeyTipsBaseLinePositions.RowKeyTipsBaseLinePositions, dxRibbonGroupRowCount); + FKeyTipsBaseLinePositions.RowKeyTipsBaseLinePositions[0] := BarControl.ClientOrigin.Y - BarControl.WindowRect.Top; + FKeyTipsBaseLinePositions.RowKeyTipsBaseLinePositions[2] := + BarControl.Ribbon.SkinGetCaptionRect(BarControl.NCRect, DXBAR_TOOLBAR).Top; + with FKeyTipsBaseLinePositions do + RowKeyTipsBaseLinePositions[1] := (RowKeyTipsBaseLinePositions[0] + RowKeyTipsBaseLinePositions[2]) div 2; + + FKeyTipsBaseLinePositions.BottomKeyTipsBaseLinePosition := BarControl.Height - + BarControl.Ribbon.SkinGetContentOffsets(DXBAR_COLLAPSEDTOOLBAR).Bottom; +end; + +function TdxRibbonGroupBarControlViewInfo.GetNonContentAreaSize; +begin + with BarControl.Painter.GetToolbarContentOffsets(BarControl.Bar, dsNone, False) do + Result := cxClasses.Size(Left + Right, Top + Bottom); +end; + +procedure TdxRibbonGroupBarControlViewInfo.UpdateItemRects; + + function GetItemControlBounds(AIndex: Integer): TRect; + begin + if Collapsed then + Result := cxEmptyRect + else + Result := ItemControlViewInfos[AIndex].Bounds; + end; + +var + AItemLink: TdxBarItemLink; + ANeedsInvalidateBarControl: Boolean; + I: Integer; +begin + ANeedsInvalidateBarControl := False; + for I := 0 to ItemControlCount - 1 do + begin + AItemLink := ItemControlViewInfos[I].Control.ItemLink; + ANeedsInvalidateBarControl := ANeedsInvalidateBarControl or not EqualRect(AItemLink.ItemRect, GetItemControlBounds(I)); + AItemLink.ItemRect := GetItemControlBounds(I); + end; + if ANeedsInvalidateBarControl and BarControl.HandleAllocated then + InvalidateRect(BarControl.Handle, nil, False); +end; + +function TdxRibbonGroupBarControlViewInfo.CreateCalculateHelper: IdxRibbonGroupViewInfo; +begin + Result := TdxRibbonGroupBarControlViewInfoHelper.Create(Self); +end; + +function TdxRibbonGroupBarControlViewInfo.GetBarControl: TdxRibbonGroupBarControl; +begin + Result := TdxRibbonGroupBarControl(FBarControl); +end; + +function TdxRibbonGroupBarControlViewInfo.GetBottomKeyTipsBaseLinePosition: Integer; +begin + CalculateKeyTipsBaseLinePositions; + Result := FKeyTipsBaseLinePositions.BottomKeyTipsBaseLinePosition + + BarControl.WindowRect.Top; +end; + +function TdxRibbonGroupBarControlViewInfo.GetRowKeyTipsBaseLinePosition( + ARowIndex: Integer): Integer; +begin + CalculateKeyTipsBaseLinePositions; + if (ARowIndex < 0) or (ARowIndex > High(FKeyTipsBaseLinePositions.RowKeyTipsBaseLinePositions)) then + raise Exception.Create(''); + Result := FKeyTipsBaseLinePositions.RowKeyTipsBaseLinePositions[ARowIndex] + + BarControl.WindowRect.Top; +end; + +function TdxRibbonGroupBarControlViewInfo.GetSize: TSize; +begin + Result := cxClasses.Size(FContentSize.cx + FNonContentAreaSize.cx, + FContentSize.cy + FNonContentAreaSize.cy); +end; + +{ TdxRibbonGroupBarControlDesignHelper } + +class function TdxRibbonGroupBarControlDesignHelper.GetForbiddenActions: TdxBarCustomizationActions; +begin + Result := [caChangeButtonPaintStyle, caChangeRecentList]; +end; + +{ TdxRibbonCollapsedGroupPopupBarControl } + +constructor TdxRibbonCollapsedGroupPopupBarControl.CreateForPopup( + AParentBarControl: TdxBarControl; AOwnerBar: TdxBar); +begin + AOwnerBar.BarManager.Bars.BeginUpdate; + try + inherited CreateForPopup(AParentBarControl, AOwnerBar); + Bar.ItemLinks := AOwnerBar.ItemLinks; + Bar.CaptionButtons := AOwnerBar.CaptionButtons; + finally + AOwnerBar.BarManager.Bars.EndUpdate; + end; + CreateControls; + UpdateDoubleBuffered; +end; + +destructor TdxRibbonCollapsedGroupPopupBarControl.Destroy; +begin + IsActive := False; + inherited Destroy; +end; + +procedure TdxRibbonCollapsedGroupPopupBarControl.Hide; +begin + CloseUp; +end; + +procedure TdxRibbonCollapsedGroupPopupBarControl.Popup(const AOwnerRect: TRect); +begin + inherited Popup(AOwnerRect); + FullInvalidate; +end; + +function TdxRibbonCollapsedGroupPopupBarControl.GetCaption: TCaption; +begin + Result := PopupBar.Caption; +end; + +function TdxRibbonCollapsedGroupPopupBarControl.GetPainter: TdxBarPainter; +begin + Result := Ribbon.GroupsPainter; +end; + +function TdxRibbonCollapsedGroupPopupBarControl.GetSizeForPopup: TSize; +begin + HandleNeeded; + ViewInfo.CalculateInit; + try + ViewInfo.Calculate; + finally + ViewInfo.CalculateFinalize; + end; + Result := ViewInfo.GetSize; +end; + +function TdxRibbonCollapsedGroupPopupBarControl.IgnoreClickAreaWhenHidePopup: TRect; +begin + Result := TdxRibbonGroupBarControl(ParentBar).WindowRect; +end; + +function TdxRibbonCollapsedGroupPopupBarControl.IsPopup: Boolean; +begin + Result := True; +end; + +function TdxRibbonCollapsedGroupPopupBarControl.NeedHideOnNCMouseClick: Boolean; +begin + Result := False; +end; + +{ TdxRibbonTabGroup } + +constructor TdxRibbonTabGroup.Create(Collection: TCollection); +begin + inherited Create(Collection); + FCanCollapse := True; + FDesignSelectionHelper := GetSelectableItem(TdxDesignSelectionHelper.Create(Tab.Ribbon, Self, Tab)); +end; + +destructor TdxRibbonTabGroup.Destroy; +begin + CheckUndockToolbar; + inherited Destroy; + FDesignSelectionHelper := nil; +end; + +procedure TdxRibbonTabGroup.Assign(Source: TPersistent); + + function IsInheritanceUpdating: Boolean; + begin + Result := (Tab <> nil) and (csUpdating in Tab.ComponentState); + end; + +begin + if Source is TdxRibbonTabGroup then + begin + CanCollapse := TdxRibbonTabGroup(Source).CanCollapse; + if (TdxRibbonTabGroup(Source).Toolbar <> nil) and IsInheritanceUpdating then + ToolBar := Tab.Ribbon.BarManager.BarByComponentName(TdxRibbonTabGroup(Source).Toolbar.Name) + else + ToolBar := TdxRibbonTabGroup(Source).Toolbar; + end + else + inherited Assign(Source); +end; + +procedure TdxRibbonTabGroup.DefineProperties(Filer: TFiler); + + function NeedWriteToolbarName: Boolean; + var + AAncestorToolbar: TdxBar; + begin + if Filer.Ancestor <> nil then + begin + AAncestorToolbar := TdxRibbonTabGroup(Filer.Ancestor).ToolBar; + Result := (AAncestorToolbar = nil) and (Toolbar <> nil) or + (AAncestorToolbar <> nil) and (ToolBar = nil) or + (AAncestorToolbar <> nil) and (AAncestorToolbar.Name <> Toolbar.Name); + end + else + Result := ToolBar <> nil; + end; + +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('ToolbarName', ReadToolbarName, WriteToolbarName, NeedWriteToolbarName); +end; + +procedure TdxRibbonTabGroup.DockToolbar(AToolbar: TdxBar); +var + ADockControl: TdxRibbonGroupsDockControl; +begin + if Tab.Active or not (AToolbar.DockControl is TdxRibbonGroupsDockControl) then + RibbonDockToolBar(AToolbar, Tab.DockControl) + else + begin + ADockControl := TdxRibbonGroupsDockControl(AToolbar.DockControl); + if (ADockControl.Tab.Ribbon <> Tab.Ribbon) or not ADockControl.Tab.Active then + RibbonDockToolBar(AToolbar, Tab.DockControl); + end; +end; + +function TdxRibbonTabGroup.IsToolbarAcceptable(AToolbar: TdxBar): Boolean; +begin + Result := (AToolbar = nil) or (Tab.Ribbon.BarManager <> nil) and + (Tab.Ribbon.BarManager = AToolbar.BarManager); +end; + +procedure TdxRibbonTabGroup.UpdateBarManager(ABarManager: TdxBarManager); +begin + if ToolBar <> nil then + ToolBar.DockControl := Tab.DockControl; +end; + +procedure TdxRibbonTabGroup.UpdateToolbarValue; +begin + if FLoadedToolbarName <> '' then + begin + ToolBar := Tab.Ribbon.BarManager.BarByComponentName(FLoadedToolbarName); + FLoadedToolbarName := ''; + end; +end; + +procedure TdxRibbonTabGroup.CheckUndockToolbar; +var + I, J: Integer; + ATab: TdxRibbonTab; +begin + if FToolbar = nil then Exit; + for I := 0 to Tab.Ribbon.TabCount - 1 do + begin + ATab := Tab.Ribbon.Tabs[I]; + if ATab <> Tab then + begin + for J := 0 to ATab.Groups.Count - 1 do + if ATab.Groups[J].ToolBar = FToolbar then + begin + RibbonDockToolBar(FToolbar, ATab.DockControl); + Exit; + end; + end; + end; + RibbonUndockToolBar(FToolbar); +end; + +function TdxRibbonTabGroup.GetTab: TdxRibbonTab; +begin + if Collection <> nil then + Result := (Collection as TdxRibbonTabGroups).Tab + else + Result := nil; +end; + +function TdxRibbonTabGroup.GetToolbar: TdxBar; +begin + if (FLoadedToolbarName <> '') and (Tab <> nil) and + IsAncestorComponentDifferencesDetection(Tab) then + Result := Tab.Ribbon.BarManager.BarByComponentName(FLoadedToolbarName) + else + Result := FToolbar; +end; + +procedure TdxRibbonTabGroup.ReadToolbarName(AReader: TReader); +begin + FLoadedToolbarName := AReader.ReadString; +end; + +procedure TdxRibbonTabGroup.SetCanCollapse(Value: Boolean); +begin + if Value <> FCanCollapse then + begin + FCanCollapse := Value; + if (ToolBar <> nil) and (Toolbar.Control <> nil) then + Toolbar.Control.RepaintBar; + end; +end; + +procedure TdxRibbonTabGroup.SetToolbar(Value: TdxBar); +begin + if not IsToolbarAcceptable(Value) then + Exit; + if FToolbar <> Value then + begin + CheckUndockToolbar; + if Value = nil then + begin + Tab.Ribbon.QuickAccessToolbar.UpdateGroupButton(FToolbar, True); + FToolbar := Value; + Free; + end + else + begin + ValidateToolbar(Value); + if FToolbar <> nil then + Tab.Ribbon.QuickAccessToolbar.UpdateGroupButton(FToolbar, True); + FToolbar := Value; + Value.FreeNotification(Tab); + DockToolbar(Value); + end; + end; +end; + +procedure TdxRibbonTabGroup.ValidateToolbar(Value: TdxBar); +var + I: Integer; +begin + if Value = Tab.Ribbon.QuickAccessToolbar.Toolbar then + raise EdxRibbonException.Create('This toolbar is already used as the QuickAccessToolbar'); + for I := 0 to Tab.Groups.Count - 1 do + if (Tab.Groups[I] <> Self) and (Tab.Groups[I].ToolBar = Value) then + raise EdxRibbonException.Create('At least one group in this tab already contains this toolbar'); +end; + +procedure TdxRibbonTabGroup.WriteToolbarName(AWriter: TWriter); +begin + if ToolBar <> nil then + AWriter.WriteString(ToolBar.Name) + else + AWriter.WriteString(''); +end; + +{ TdxRibbonTabGroups } + +constructor TdxRibbonTabGroups.Create(ATab: TdxRibbonTab); +begin + inherited Create(ATab.GetGroupClass); + FTab := ATab; +end; + +function TdxRibbonTabGroups.Add: TdxRibbonTabGroup; +begin + Result := TdxRibbonTabGroup(inherited Add); +end; + +function TdxRibbonTabGroups.GetOwner: TPersistent; +begin + Result := Tab; +end; + +{$IFDEF DELPHI6} +procedure TdxRibbonTabGroups.Notify(Item: TCollectionItem; + Action: TCollectionNotification); +begin + inherited; + Tab.Ribbon.Changed; +end; +{$ENDIF} + +procedure TdxRibbonTabGroups.Update(Item: TCollectionItem); +begin + Tab.Ribbon.Changed; + if Tab.Active then + Tab.DockControl.UpdateDock; +end; + +procedure TdxRibbonTabGroups.UpdateGroupToolbarValues; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].UpdateToolbarValue; +end; + +function TdxRibbonTabGroups.GetItem(Index: Integer): TdxRibbonTabGroup; +begin + Result := TdxRibbonTabGroup(inherited Items[Index]); +end; + +procedure TdxRibbonTabGroups.SetItem(Index: Integer; + const Value: TdxRibbonTabGroup); +begin + TdxRibbonTabGroup(inherited Items[Index]).Assign(Value); +end; + +{ TdxRibbonQuickAccessToolbar } + +constructor TdxRibbonQuickAccessToolbar.Create(ARibbon: TdxCustomRibbon); +begin + inherited Create; + FRibbon := ARibbon; + FPosition := qtpAboveRibbon; + FVisible := True; + FDockControl := CreateDockControl; +end; + +destructor TdxRibbonQuickAccessToolbar.Destroy; +begin + Toolbar := nil; + FreeAndNil(FDockControl); + inherited Destroy; +end; + +procedure TdxRibbonQuickAccessToolbar.Assign(Source: TPersistent); +begin + if Source is TdxRibbonQuickAccessToolbar then + begin + Ribbon.BeginUpdate; + try + Position := TdxRibbonQuickAccessToolbar(Source).Position; + Toolbar := TdxRibbonQuickAccessToolbar(Source).Toolbar; + Visible := TdxRibbonQuickAccessToolbar(Source).Visible; + finally + Ribbon.EndUpdate; + end; + end; +end; + +function TdxRibbonQuickAccessToolbar.HasGroupButtonForToolbar( + AToolbar: TdxBar): Boolean; +var + I: Integer; +begin + Result := False; + if (Toolbar <> nil) and (AToolbar <> nil) then + for I := 0 to Toolbar.ItemLinks.Count - 1 do + if (Toolbar.ItemLinks[I].Item is TdxRibbonQuickAccessGroupButton) and + (TdxRibbonQuickAccessGroupButton(Toolbar.ItemLinks[I].Item).Toolbar = AToolbar) then + begin + Result := True; + Break; + end; +end; + +procedure TdxRibbonQuickAccessToolbar.CheckUndockGroupToolbar(const Value: TdxBar); +var + I, J: Integer; +begin + for I := 0 to Ribbon.TabCount - 1 do + for J := Ribbon.Tabs[I].Groups.Count - 1 downto 0 do + begin + with Ribbon.Tabs[I].Groups[J] do + if ToolBar = Value then ToolBar := nil; + end; +end; + +function TdxRibbonQuickAccessToolbar.Contains(AItemLink: TdxBarItemLink): Boolean; +begin + if (AItemLink <> nil) and (AItemLink.OriginalItemLink <> nil) then + AItemLink := AItemLink.OriginalItemLink; + Result := Toolbar.ItemLinks.IndexOf(AItemLink) <> -1; +end; + +function TdxRibbonQuickAccessToolbar.CreateDockControl: TdxRibbonQuickAccessDockControl; +begin + Result := TdxRibbonQuickAccessDockControl.Create(Ribbon); +end; + +function TdxRibbonQuickAccessToolbar.GetMenuItemsForMark: TdxRibbonPopupMenuItems; +begin + Result := Ribbon.PopupMenuItems - [rpmiQATAddRemoveItem]; +end; + +procedure TdxRibbonQuickAccessToolbar.UpdateColorScheme; +begin + if Visible and DockControl.Visible then + DockControl.UpdateColorScheme; +end; + +procedure TdxRibbonQuickAccessToolbar.UpdateGroupButton(AForToolbar: TdxBar; + ABeforeUndock: Boolean); +var + AGroupButton: TdxRibbonQuickAccessGroupButton; + I: Integer; +begin + if Toolbar = nil then + Exit; + for I := 0 to Toolbar.ItemLinks.Count - 1 do + if Toolbar.ItemLinks[I].Item is TdxRibbonQuickAccessGroupButton then + begin + AGroupButton := TdxRibbonQuickAccessGroupButton(Toolbar.ItemLinks[I].Item); + if AGroupButton.Toolbar = AForToolbar then + begin + if ABeforeUndock then + AGroupButton.Toolbar := nil + else + AGroupButton.Update; + Break; + end; + end; +end; + +procedure TdxRibbonQuickAccessToolbar.UpdateMenuItems(AItems: TdxBarItemLinks); +begin + Ribbon.PopulatePopupMenuItems(AItems, GetMenuItemsForMark, Ribbon.PopupMenuItemClick); +end; + +procedure TdxRibbonQuickAccessToolbar.UpdateRibbon; +begin + if Ribbon.IsDestroying then Exit; + Ribbon.SetRedraw(False); + try + Ribbon.Changed; + finally + Ribbon.SetRedraw(True); + WinControlFullInvalidate(Ribbon.Parent, True); + Ribbon.Update; + end; +end; + +procedure TdxRibbonQuickAccessToolbar.SetPosition( + const Value: TdxQuickAccessToolbarPosition); +begin + if FPosition <> Value then + begin + FPosition := Value; + UpdateRibbon; + end; +end; + +procedure TdxRibbonQuickAccessToolbar.SetToolbar(const Value: TdxBar); + + procedure RemoveGroupButtons(AToolbar: TdxBar); + var + I: Integer; + begin + for I := AToolbar.ItemLinks.Count - 1 downto 0 do + if AToolbar.ItemLinks[I].Item is TdxRibbonQuickAccessGroupButton then + AToolbar.ItemLinks[I].Item.Free; + end; + +begin + if FToolbar <> Value then + begin + Ribbon.BeginUpdate; + if (FToolbar <> nil) and not (csDestroying in FToolbar.ComponentState) then + begin + FToolbar.RemoveFreeNotification(Ribbon); + RemoveGroupButtons(FToolbar); + RibbonUndockToolBar(FToolbar); + end; + FToolbar := Value; + if FToolbar <> nil then + begin + CheckUndockGroupToolbar(Value); + FToolbar.FreeNotification(Ribbon); + RibbonDockToolBar(FToolbar, DockControl); + end + else + DockControl.Visible := False; + Ribbon.CancelUpdate; + UpdateRibbon; + end; +end; + +procedure TdxRibbonQuickAccessToolbar.SetVisible(const Value: Boolean); +begin + if FVisible <> Value then + begin + FVisible := Value; + DockControl.Visible := Value and (Toolbar <> nil); + UpdateRibbon; + end; +end; + +{ TdxRibbonApplicationButton } + +constructor TdxRibbonApplicationButton.Create(ARibbon: TdxCustomRibbon); +begin + inherited Create; + FRibbon := ARibbon; + FGlyph := TBitmap.Create; + FGlyph.OnChange := GlyphChanged; + FVisible := True; + FStretchGlyph := True; +end; + +destructor TdxRibbonApplicationButton.Destroy; +begin + BarAccessibilityHelperOwnerObjectDestroyed(FIAccessibilityHelper); + Menu := nil; + FGlyph.Free; + inherited Destroy; +end; + +procedure TdxRibbonApplicationButton.Assign(Source: TPersistent); +begin + if Source is TdxRibbonApplicationButton then + begin + Ribbon.BeginUpdate; + try + Glyph := TdxRibbonApplicationButton(Source).Glyph; + KeyTip := TdxRibbonApplicationButton(Source).KeyTip; + Menu := TdxRibbonApplicationButton(Source).Menu; + Visible := TdxRibbonApplicationButton(Source).Visible; + ScreenTip := TdxRibbonApplicationButton(Source).ScreenTip; + StretchGlyph := TdxRibbonApplicationButton(Source).StretchGlyph; + finally + Ribbon.EndUpdate; + end; + end; +end; + +function TdxRibbonApplicationButton.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxRibbonApplicationButtonAccessibilityHelper; +end; + +procedure TdxRibbonApplicationButton.Update; +begin + with Ribbon do + begin + Changed; + if FormCaptionHelper <> nil then + FormCaptionHelper.Calculate; + FullInvalidate; + end; +end; + +procedure TdxRibbonApplicationButton.GlyphChanged(Sender: TObject); +begin + Update; +end; + +function TdxRibbonApplicationButton.GetIAccessibilityHelper: IdxBarAccessibilityHelper; +begin + if FIAccessibilityHelper = nil then + FIAccessibilityHelper := GetAccessibilityHelper(GetAccessibilityHelperClass.Create(Self)); + Result := FIAccessibilityHelper; +end; + +procedure TdxRibbonApplicationButton.SetGlyph(const Value: TBitmap); +begin + if IsGlyphAssigned(Value) and (Value.PixelFormat <> pf32bit) then + cxMakeTrueColorBitmap(Value, FGlyph) + else + FGlyph.Assign(Value); +end; + +procedure TdxRibbonApplicationButton.SetMenu(const Value: TdxBarApplicationMenu); +begin + if FMenu <> Value then + begin + if FMenu <> nil then + FMenu.RemoveFreeNotification(Ribbon); + FMenu := Value; + if FMenu <> nil then + FMenu.FreeNotification(Ribbon); + end; +end; + +procedure TdxRibbonApplicationButton.SetScreenTip(const Value: TdxBarScreenTip); +begin + if FScreenTip <> Value then + begin + if FScreenTip <> nil then + FScreenTip.RemoveFreeNotification(Ribbon); + FScreenTip := Value; + if FScreenTip <> nil then + FScreenTip.FreeNotification(Ribbon); + end; +end; + +procedure TdxRibbonApplicationButton.SetStretchGlyph(const Value: Boolean); +begin + if FStretchGlyph <> Value then + begin + FStretchGlyph := Value; + Update; + end; +end; + +procedure TdxRibbonApplicationButton.SetVisible(const Value: Boolean); +begin + if FVisible <> Value then + begin + FVisible := Value; + Update; + end; +end; + +{ TdxRibbonTab } + +constructor TdxRibbonTab.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FDockControl := TdxRibbonGroupsDockControl.Create(Self); + FDockControl.Visible := False; + FDockControl.Align := dalNone; + FVisible := True; + FGroups := TdxRibbonTabGroups.Create(Self); +end; + +destructor TdxRibbonTab.Destroy; +begin + BarAccessibilityHelperOwnerObjectDestroyed(FIAccessibilityHelper); + FLastIndex := Index; + if Ribbon.CanFade then + Ribbon.Fader.Remove(Self); + FGroups.Free; + FreeAndNil(FDockControl); + inherited Destroy; + FDesignSelectionHelper := nil; +end; + +procedure TdxRibbonTab.AddToolBar(AToolBar: TdxBar); +begin + if AToolbar <> nil then + Groups.Add.Toolbar := AToolBar; +end; + +procedure TdxRibbonTab.Invalidate; +begin + Ribbon.InvalidateRect(ViewInfo.Bounds, False); + Ribbon.GroupsDockControlSite.Invalidate; +end; + +procedure TdxRibbonTab.MakeVisible; +begin + Visible := True; + Ribbon.ViewInfo.TabsViewInfo.MakeTabVisible(Self); +end; + +procedure TdxRibbonTab.Assign(Source: TPersistent); +begin + if Source is TdxRibbonTab then + begin + Ribbon.BeginUpdate; + try + Active := TdxRibbonTab(Source).Active; + Caption := TdxRibbonTab(Source).Caption; + Groups := TdxRibbonTab(Source).Groups; + KeyTip := TdxRibbonTab(Source).KeyTip; + Visible := TdxRibbonTab(Source).Visible; + finally + Ribbon.EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +function TdxRibbonTab.GetCollectionFromParent(AParent: TComponent): TcxComponentCollection; +begin + Result := (AParent as TdxCustomRibbon).Tabs; +end; + +function TdxRibbonTab.GetDisplayName: string; +begin + Result := Format('%s - ''%s''', [Name, Caption]); +end; + +procedure TdxRibbonTab.Loaded; +begin + inherited Loaded; + Groups.UpdateGroupToolbarValues; +end; + +procedure TdxRibbonTab.Notification(AComponent: TComponent; Operation: TOperation); +var + I: Integer; +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and not ((csDestroying in ComponentState) or + (csDestroying in Ribbon.ComponentState)) then + begin + for I := Groups.Count - 1 downto 0 do + if Groups[I].Toolbar = AComponent then + Groups[I].Toolbar := nil; + end; +end; + +procedure TdxRibbonTab.SetName(const Value: TComponentName); +var + AChangeText: Boolean; +begin + AChangeText := not (csLoading in ComponentState) and (Name = Caption) and + ((Owner = nil) or not (Owner is TControl) or + not (csLoading in TControl(Owner).ComponentState)); + inherited SetName(Value); + if AChangeText then + Caption := Value; +end; + +procedure TdxRibbonTab.Activate; +begin + MakeVisible; + if Ribbon.ShowTabGroups then + begin + UpdateDockControl; + CheckGroupToolbarsDockControl; + FDockControl.Visible := True; + end + else + CheckGroupToolbarsDockControl; +end; + +procedure TdxRibbonTab.CheckGroupToolbarsDockControl; +var + I: Integer; + AToolbar: TdxBar; +begin + for I := 0 to Groups.Count - 1 do + begin + AToolbar := Groups[I].ToolBar; + if (AToolBar <> nil) and (AToolBar.DockControl <> DockControl) then + AToolBar.DockControl := DockControl; + end; +end; + +procedure TdxRibbonTab.Deactivate; +begin + if not (csDestroying in ComponentState) then + DockControl.Visible := False; +end; + +function TdxRibbonTab.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxRibbonTabAccessibilityHelper; +end; + +function TdxRibbonTab.CanFade: Boolean; +begin + Result := Ribbon.CanFade and (ViewInfo <> nil); +end; + +function TdxRibbonTab.GetActive: Boolean; +begin + Result := Ribbon.ActiveTab = Self; +end; + +function TdxRibbonTab.GetFocused: Boolean; +begin + Result := IAccessibilityHelper.IsSelected; +end; + +function TdxRibbonTab.GetHighlighted: Boolean; +begin + Result := Ribbon.HighlightedTab = Self; +end; + +function TdxRibbonTab.GetIAccessibilityHelper: IdxBarAccessibilityHelper; +begin + if FIAccessibilityHelper = nil then + FIAccessibilityHelper := GetAccessibilityHelper(GetAccessibilityHelperClass.Create(Self)); + Result := FIAccessibilityHelper; +end; + +function TdxRibbonTab.GetViewInfo: TdxRibbonTabViewInfo; +var + I: Integer; +begin + Result := nil; + with Ribbon.ViewInfo do + begin + for I := 0 to TabsViewInfo.Count - 1 do + if TabsViewInfo[I].Tab = Self then + begin + Result := TabsViewInfo[I]; + Break; + end; + end; +end; + +function TdxRibbonTab.GetVisibleIndex: Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Ribbon.VisibleTabCount - 1 do + if Ribbon.VisibleTabs[I] = Self then + begin + Result := I; + break; + end; +end; + +procedure TdxRibbonTab.SetActive(Value: Boolean); +begin + if Value then + Ribbon.ActiveTab := Self; +end; + +procedure TdxRibbonTab.SetCaption(const Value: string); +begin + if FCaption <> Value then + begin + FCaption := Value; + Ribbon.Changed; + end; +end; + +procedure TdxRibbonTab.SetHighlighted(Value: Boolean); +begin + if Value then + Ribbon.HighlightedTab := Self; +end; + +procedure TdxRibbonTab.SetRibbon(Value: TdxCustomRibbon); +begin + if FRibbon <> Value then + begin + FRibbon := Value; + if FRibbon <> nil then + begin + FDesignSelectionHelper := nil; + FDesignSelectionHelper := GetSelectableItem(TdxDesignSelectionHelper.Create(Ribbon, Self, Ribbon)); + FDockControl.BarManager := FRibbon.BarManager; + FDockControl.Parent := FRibbon.GroupsDockControlSite; + end; + end; +end; + +function TdxRibbonTab.GetDockControlBounds: TRect; +begin + Result := GetControlRect(Ribbon.GroupsDockControlSite); + with Ribbon.ViewInfo.GetTabGroupsDockControlOffset do + Result := cxRectInflate(Result, -Left, -Top, -Right, -Bottom); +end; + +function TdxRibbonTab.GetGroupClass: TdxRibbonTabGroupClass; +begin + Result := TdxRibbonTabGroup; +end; + +procedure TdxRibbonTab.ScrollDockControlGroups(AScrollLeft, AOnTimer: Boolean); +var + AMaxContentWidth: Integer; +begin + AMaxContentWidth := Ribbon.GroupsDockControlSite.Width; + with Ribbon.ViewInfo.GetTabGroupsDockControlOffset do + Dec(AMaxContentWidth, Left + Right); + DockControl.ViewInfo.ScrollGroups(AScrollLeft, AMaxContentWidth); +end; + +procedure TdxRibbonTab.UpdateBarManager(ABarManager: TdxBarManager); +var + I: Integer; +begin + FDockControl.BarManager := ABarManager; + for I := 0 to Groups.Count - 1 do + Groups[I].UpdateBarManager(ABarManager); +end; + +procedure TdxRibbonTab.UpdateColorScheme; +begin + DockControl.UpdateColorScheme; +end; + +procedure TdxRibbonTab.UpdateDockControl; +var + AIsDockControlVisible: Boolean; +begin + if not Ribbon.IsLocked then + if GetParentPopupWindow(DockControl, True) = nil then + begin + AIsDockControlVisible := Visible and not Ribbon.Hidden and Ribbon.ShowTabGroups and Active; + if AIsDockControlVisible then + begin + DockControl.ViewInfo.Calculate(GetDockControlBounds); + UpdateDockControlBounds; + end; + DockControl.Visible := AIsDockControlVisible; + end + else + begin + DockControl.ViewInfo.Calculate(DockControl.ClientRect); + DockControl.UpdateGroupPositions; + end; +end; + +procedure TdxRibbonTab.UpdateDockControlBounds; +begin + if not Ribbon.IsLocked then + DockControl.BoundsRect := GetDockControlBounds; +end; + +procedure TdxRibbonTab.UpdateGroupsFont; +var + I, J: Integer; + ABarControl: TdxBarControl; +begin + for I := 0 to DockControl.RowCount - 1 do + with DockControl.Rows[I] do + begin + for J := 0 to ColCount - 1 do + begin + ABarControl := Cols[J].BarControl; + if (ABarControl <> nil) and ABarControl.HandleAllocated then + ABarControl.UpdateFont; + end; + end; +end; + +procedure TdxRibbonTab.SetGroups(const Value: TdxRibbonTabGroups); +begin + FGroups.Assign(Value); +end; + +procedure TdxRibbonTab.SetVisible(Value: Boolean); +begin + if FVisible <> Value then + begin + FVisible := Value; + if Active and not Value then + Ribbon.SetNextActiveTab(Self); + Ribbon.Changed; + end; +end; + +procedure TdxRibbonTab.FadingDrawBitmap(ABitmap: TBitmap); +var + P: TPoint; +begin + if CanFade then + begin + P := ViewInfo.Bounds.TopLeft; + BitBlt(Ribbon.Canvas.Handle, P.X, P.Y, ABitmap.Width, ABitmap.Height, + ABitmap.Canvas.Handle, 0, 0, SRCCOPY); + end; +end; + +procedure TdxRibbonTab.FadingGetFadingParams( + out AFadeOutImage, AFadeInImage: TBitmap; + var AFadeInStageCount, AFadeInStageInterval, + AFadeOutStageCount, AFadeOutStageInterval: Integer); +begin + AFadeInStageCount := 3; + AFadeInStageInterval := 10; + AFadeOutStageCount := 16; + AFadeOutStageInterval := -1; + AFadeOutImage := TBitmap.Create; + AFadeInImage := TBitmap.Create; + if CanFade then + begin + ViewInfo.DrawBitmap(AFadeOutImage, False); + ViewInfo.DrawBitmap(AFadeInImage, True); + end; +end; + +{ TdxRibbonTabCollection } + +constructor TdxRibbonTabCollection.Create(AOwner: TdxCustomRibbon); +begin + inherited Create(AOwner, AOwner.GetTabClass); + FOwner := AOwner; +end; + +destructor TdxRibbonTabCollection.Destroy; +var + I: Integer; +begin + BarAccessibilityHelperOwnerObjectDestroyed(FIAccessibilityHelper); + for I := Count - 1 downto 0 do + Items[I].Free; + inherited Destroy; +end; + +function TdxRibbonTabCollection.Add: TdxRibbonTab; +begin + Result := TdxRibbonTab(inherited Add); +end; + +function TdxRibbonTabCollection.Insert(AIndex: Integer): TdxRibbonTab; +begin + Result := TdxRibbonTab(inherited Insert(AIndex)); +end; + +function TdxRibbonTabCollection.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxRibbonTabCollectionAccessibilityHelper; +end; + +procedure TdxRibbonTabCollection.Notify(AItem: TcxComponentCollectionItem; + AAction: TcxComponentCollectionNotification); +begin + case AAction of + ccnAdded: + Owner.AddTab(TdxRibbonTab(AItem)); + ccnExtracted: + Owner.RemoveTab(TdxRibbonTab(AItem)); + end; + inherited; +end; + +procedure TdxRibbonTabCollection.Update(AItem: TcxComponentCollectionItem; + AAction: TcxComponentCollectionNotification); +begin + inherited; + if (AItem = nil) and not Owner.IsLocked then + Owner.Changed; +end; + +procedure TdxRibbonTabCollection.UpdateBarManager(ABarManager: TdxBarManager); +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].UpdateBarManager(ABarManager); +end; + +procedure TdxRibbonTabCollection.SetItemName(AItem: TcxComponentCollectionItem); +begin + AItem.Name := CreateUniqueName(TdxRibbonTab(AItem).Ribbon.Owner, + TdxRibbonTab(AItem).Ribbon, AItem, 'TdxRibbon', ''); +end; + +function TdxRibbonTabCollection.GetIAccessibilityHelper: IdxBarAccessibilityHelper; +begin + if FIAccessibilityHelper = nil then + FIAccessibilityHelper := GetAccessibilityHelper(GetAccessibilityHelperClass.Create(Self)); + Result := FIAccessibilityHelper; +end; + +function TdxRibbonTabCollection.GetItem(Index: Integer): TdxRibbonTab; +begin + Result := TdxRibbonTab(inherited Items[Index]); +end; + +procedure TdxRibbonTabCollection.SetItem(Index: Integer; + const Value: TdxRibbonTab); +begin + Items[Index].Assign(Value); +end; + +{ TdxRibbonFonts } + +constructor TdxRibbonFonts.Create(AOwner: TdxCustomRibbon); +var + I: TdxRibbonAssignedFont; +begin + inherited Create; + FRibbon := AOwner; + FDocumentNameColor := clDefault; + FCaptionFont := TFont.Create; + FFont := TFont.Create; + for I := Low(TdxRibbonAssignedFont) to High(TdxRibbonAssignedFont) do + begin + FFonts[I] := TFont.Create; + FFonts[I].OnChange := FontChanged; + end; +end; + +destructor TdxRibbonFonts.Destroy; +var + I: TdxRibbonAssignedFont; +begin + for I := Low(TdxRibbonAssignedFont) to High(TdxRibbonAssignedFont) do + FFonts[I].Free; + FFont.Free; + FCaptionFont.Free; + inherited Destroy; +end; + +procedure TdxRibbonFonts.Assign(Source: TPersistent); +var + I: TdxRibbonAssignedFont; +begin + if Source is TdxRibbonFonts then + begin + Ribbon.BeginUpdate; + FDocumentNameColor := TdxRibbonFonts(Source).DocumentNameColor; + try + for I := Low(TdxRibbonAssignedFont) to High(TdxRibbonAssignedFont) do + FFonts[I].Assign(TdxRibbonFonts(Source).FFonts[I]); + FAssignedFonts := TdxRibbonFonts(Source).FAssignedFonts + finally + Ribbon.EndUpdate; + end; + end + else + inherited; +end; + +function TdxRibbonFonts.GetFormCaptionFont(AIsActive: Boolean): TFont; +begin + Result := FFont; + Result.Assign(FCaptionFont); + Result.Color := GetDefaultCaptionTextColor(AIsActive); + Result.Size := Ribbon.ColorScheme.GetCaptionFontSize(Result.Size); +end; + +function TdxRibbonFonts.GetGroupFont: TFont; +begin + Result := FFont; + Result.Assign(FFonts[afGroup]); +end; + +function TdxRibbonFonts.GetGroupHeaderFont: TFont; +begin + Result := FFont; + Result.Assign(FFonts[afGroupHeader]); + Result.Color := Ribbon.ColorScheme.GetPartColor(rspTabGroupHeaderText) +end; + +function TdxRibbonFonts.GetTabHeaderFont(AState: Integer): TFont; +begin + Result := FFont; + Result.Assign(FFonts[afTabHeader]); + Result.Color := Ribbon.ColorScheme.GetPartColor(rspTabHeaderText, AState); +end; + +procedure TdxRibbonFonts.Invalidate; +begin + if Ribbon.Visible and (Ribbon.ActiveTab <> nil) then + Ribbon.ActiveTab.UpdateColorScheme; + Ribbon.RibbonFormInvalidate; +end; + +procedure TdxRibbonFonts.UpdateDefaultFont(I: TdxRibbonAssignedFont); +begin + if Ribbon.IsBarManagerValid and (I in [afTabHeader, afGroup, afGroupHeader]) then + FFonts[I].Assign(Ribbon.BarManager.Font); + case I of + afGroup: + FFonts[I].Color := Ribbon.ColorScheme.GetPartColor(rspTabGroupText); + afGroupHeader: + FFonts[I].Color := Ribbon.ColorScheme.GetPartColor(rspTabGroupHeaderText); + end; +end; + +procedure TdxRibbonFonts.UpdateFonts; +var + I: TdxRibbonAssignedFont; + ANonClientMetrics: TNonClientMetrics; +begin + ANonClientMetrics.cbSize := SizeOf(ANonClientMetrics); + SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, @ANonClientMetrics, 0); + FCaptionFont.Handle := CreateFontIndirect(ANonClientMetrics.lfCaptionFont); + FLocked := True; + try + for I := Low(TdxRibbonAssignedFont) to High(TdxRibbonAssignedFont) do + if not (I in AssignedFonts) then + begin + FFonts[I].Assign(Ribbon.Font); + UpdateDefaultFont(I); + end; + finally + FLocked := False; + end; +end; + +procedure TdxRibbonFonts.FontChanged(Sender: TObject); +var + I: TdxRibbonAssignedFont; +begin + if Locked or Ribbon.IsLoading then Exit; + Ribbon.BeginUpdate; + try + for I := Low(TdxRibbonAssignedFont) to High(TdxRibbonAssignedFont) do + if Sender = FFonts[I] then + begin + Include(FAssignedFonts, TdxRibbonAssignedFont(I)); + break; + end; + UpdateGroupsFont; + finally + Ribbon.EndUpdate; + Invalidate; + end; +end; + +function TdxRibbonFonts.GetDefaultCaptionTextColor(AIsActive: Boolean): TColor; + + function IsFormZoomed: Boolean; + var + F: TCustomForm; + begin + F := Ribbon.RibbonForm; + Result := (F <> nil) and F.HandleAllocated and IsZoomed(F.Handle); + end; + +begin + if Ribbon.ViewInfo.UseGlass then + begin + if IsFormZoomed then + Result := clWindow + else + if AIsActive then + Result := clCaptionText + else + Result := clInactiveCaptionText + end + else + Result := Ribbon.ColorScheme.GetPartColor(rspFormCaptionText, Ord(not AIsActive)); +end; + +function TdxRibbonFonts.GetFont(const Index: Integer): TFont; +begin + Result := FFonts[TdxRibbonAssignedFont(Index)] +end; + +function TdxRibbonFonts.IsFontStored(const Index: Integer): Boolean; +begin + Result := TdxRibbonAssignedFont(Index) in FAssignedFonts; +end; + +procedure TdxRibbonFonts.SetAssignedFonts(const Value: TdxRibbonAssignedFonts); +begin + if (FAssignedFonts <> Value) then + begin + FAssignedFonts := Value; + UpdateFonts; + FontChanged(nil); + end; +end; + +procedure TdxRibbonFonts.SetDocumentNameColor(const Value: TColor); +begin + if FDocumentNameColor <> Value then + begin + FDocumentNameColor := Value; + Ribbon.RibbonFormInvalidate; + end; +end; + +procedure TdxRibbonFonts.SetFont(const Index: Integer; const Value: TFont); +begin + FFonts[TdxRibbonAssignedFont(Index)].Assign(Value); +end; + +procedure TdxRibbonFonts.UpdateGroupsFont; +var + I: Integer; +begin + for I := 0 to Ribbon.TabCount - 1 do + Ribbon.Tabs[I].UpdateGroupsFont; +end; + +{ TdxRibbonPopupMenu } + +constructor TdxRibbonPopupMenu.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + CheckAssignRibbon; +end; + +function TdxRibbonPopupMenu.CreateBarControl: TCustomdxBarControl; +begin + Result := inherited CreateBarControl; + if Ribbon <> nil then + TdxRibbonPopupMenuControl(Result).FPainter := Ribbon.GroupsPainter; +end; + +function TdxRibbonPopupMenu.GetControlClass: TCustomdxBarControlClass; +begin + Result := TdxRibbonPopupMenuControl; +end; + +procedure TdxRibbonPopupMenu.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if (Operation = opRemove) and (AComponent = Ribbon) then + Ribbon := nil; +end; + +procedure TdxRibbonPopupMenu.CheckAssignRibbon; +var + AForm: TCustomForm; + I: Integer; +begin + if not ((csDesigning in ComponentState) and (Owner is TCustomForm)) then Exit; + AForm := TCustomForm(Owner); + if AForm <> nil then + begin + for I := 0 to AForm.ComponentCount - 1 do + if AForm.Components[I] is TdxCustomRibbon then + begin + Ribbon := TdxCustomRibbon(AForm.Components[I]); + Break; + end; + end; +end; + +procedure TdxRibbonPopupMenu.SetRibbon(Value: TdxCustomRibbon); +begin + if Ribbon <> Value then + begin + if Ribbon <> nil then + Ribbon.RemoveFreeNotification(Self); + FRibbon := Value; + if Ribbon <> nil then + Ribbon.FreeNotification(Self); + end; +end; + +{ TdxRibbonPopupMenuControl } + +function TdxRibbonPopupMenuControl.GetBehaviorOptions: TdxBarBehaviorOptions; +begin + Result := dxRibbonBarBehaviorOptions + + [bboAllowSelectWindowItemsWithoutFocusing, bboExtendItemWhenAlignedToClient] - + [bboMouseCantUnselectNavigationItem, bboSubMenuCaptureMouse]; +end; + +{ TdxBarApplicationMenu } + +function TdxBarApplicationMenu.GetControlClass: TCustomdxBarControlClass; +begin + Result := TdxRibbonApplicationMenuControl; +end; + +{ TdxRibbonApplicationMenuControl } + +function TdxRibbonApplicationMenuControl.GetBehaviorOptions: TdxBarBehaviorOptions; +begin + Result := inherited GetBehaviorOptions + [bboItemCustomizePopup]; +end; + +procedure TdxRibbonApplicationMenuControl.InitCustomizationPopup(AItemLinks: TdxBarItemLinks); +begin + if Ribbon <> nil then + Ribbon.PopulatePopupMenuItems(AItemLinks, GetPopupMenuItems, PopupMenuClick); +end; + +function TdxRibbonApplicationMenuControl.GetPopupMenuItems: TdxRibbonPopupMenuItems; +begin + Result := Ribbon.PopupMenuItems; + if ExtraPaneItemLinks.IndexOf(BarDesignController.CustomizingItemLink) <> -1 then + Exclude(Result, rpmiQATAddRemoveItem); +end; + +procedure TdxRibbonApplicationMenuControl.PopupMenuClick(Sender: TObject); // see TdxRibbonCustomBarControl +var + ALinkSelf: TcxObjectLink; +begin + ALinkSelf := cxAddObjectLink(Self); + try + DoPopupMenuClick(Sender); + if ALinkSelf.Ref <> nil then + HideAll; + finally + cxRemoveObjectLink(ALinkSelf); + end; +end; + +function TdxRibbonApplicationMenuControl.GetRibbon: TdxCustomRibbon; +begin + if OwnerControl is TdxCustomRibbon then + Result := TdxCustomRibbon(OwnerControl) + else + Result := nil; +end; + +procedure TdxRibbonApplicationMenuControl.DoPopupMenuClick(Sender: TObject); +begin + Ribbon.PopupMenuItemClick(Sender); +end; + +procedure TdxRibbonApplicationMenuControl.WMNCHitTest(var Message: TWMNCHitTest); +var + ARect: TRect; +begin + if (Ribbon <> nil) and Ribbon.HandleAllocated then + begin + ARect := Ribbon.ViewInfo.ApplicationButtonBounds; + MapWindowRect(Ribbon.Handle, 0, ARect); + if PtInRect(ARect, SmallPointToPoint(Message.Pos)) then + Message.Result := HTTRANSPARENT + else + inherited; + end + else + inherited; +end; + +{ TdxRibbonController } + +constructor TdxRibbonController.Create(ARibbon: TdxCustomRibbon); +begin + inherited Create; + FRibbon := ARibbon; + ClearHintInfo; + CreateTimer; +end; + +destructor TdxRibbonController.Destroy; +begin + FreeAndNil(FScrollTimer); + inherited Destroy; +end; + +function TdxRibbonController.NextTab(ATab: TdxRibbonTab): TdxRibbonTab; +var + I: Integer; +begin + Result := nil; + for I := 0 to ViewInfo.TabsViewInfo.Count - 1 do + if ViewInfo.TabsViewInfo[I].Tab = ATab then + begin + if I + 1 < ViewInfo.TabsViewInfo.Count then + begin + Result := ViewInfo.TabsViewInfo[I + 1].Tab; + Exit; + end; + end; + if (ATab = nil) and (ViewInfo.TabsViewInfo.Count > 0) then + Result := ViewInfo.TabsViewInfo[0].Tab; +end; + +function TdxRibbonController.PrevTab(ATab: TdxRibbonTab): TdxRibbonTab; +var + I: Integer; +begin + Result := nil; + for I := ViewInfo.TabsViewInfo.Count - 1 downto 0 do + if ViewInfo.TabsViewInfo[I].Tab = ATab then + begin + if I - 1 >= 0 then + begin + Result := ViewInfo.TabsViewInfo[I - 1].Tab; + Exit; + end; + end; + if (ATab = nil) and (ViewInfo.TabsViewInfo.Count > 0) then + Result := ViewInfo.TabsViewInfo[ViewInfo.TabsViewInfo.Count - 1].Tab; +end; + +procedure TdxRibbonController.CheckButtonsMouseUp(X: Integer; Y: Integer); +var + AHitInfo: TdxRibbonHitInfo; +begin + AHitInfo := ViewInfo.GetHitInfo(X, Y); + if AHitInfo.HitTest = PressedObject then + begin + case PressedObject of + rhtMDIMinimizeButton: + SendMessage(Ribbon.BarManager.ActiveMDIChild, WM_SYSCOMMAND, SC_MINIMIZE, 0); + rhtMDIRestoreButton: + SendMessage(Ribbon.BarManager.ActiveMDIChild, WM_SYSCOMMAND, SC_RESTORE, 0); + rhtMDICloseButton: + SendMessage(Ribbon.BarManager.ActiveMDIChild, WM_SYSCOMMAND, SC_CLOSE, 0); + rhtHelpButton: + Ribbon.DoHelpButtonClick; + end; + end; +end; + +procedure TdxRibbonController.DoScroll(AOnTimer: Boolean); +begin + CancelHint; + case FScrollKind of + rhtTabScrollLeft, rhtTabScrollRight: + ScrollTabs(FScrollKind = rhtTabScrollRight, AOnTimer); + rhtGroupScrollLeft, rhtGroupScrollRight: + ScrollGroups(FScrollKind = rhtGroupScrollRight, AOnTimer); + end; +end; + +procedure TdxRibbonController.InitTabDesignMenu(AItemLinks: TdxBarItemLinks); +begin + BarDesignController.AddInternalItem(AItemLinks, TdxBarButton, + cxGetResourceString(@dxSBAR_RIBBONADDTAB), DesignTabMenuClick, 0); + if BarDesignController.LastSelectedItem <> nil then + BarDesignController.AddInternalItem(AItemLinks, TdxBarButton, + cxGetResourceString(@dxSBAR_RIBBONDELETETAB), DesignTabMenuClick, 1); + BarDesignController.AddInternalItem(AItemLinks, TdxBarButton, + cxGetResourceString(@dxSBAR_RIBBONADDEMPTYGROUP), DesignTabMenuClick, 2, True); + BarDesignController.AddInternalItem(AItemLinks, TdxBarButton, + cxGetResourceString(@dxSBAR_RIBBONADDGROUPWITHTOOLBAR), DesignTabMenuClick, 3); +end; + +function TdxRibbonController.IsApplicationMenuDropped: Boolean; +begin + Result := risAppMenuActive in Ribbon.InternalState; +end; + +function TdxRibbonController.IsNeedShowHint(AObject: TdxRibbonHitTest): Boolean; +begin + Result := IsOwnerForHintObject(AObject); + if Result then + begin + case AObject of + rhtTab: + Result := (HintInfo.Tab <> nil) and ViewInfo.TabsViewInfo.NeedShowHint; + rhtApplicationMenu: + Result := (Ribbon.ApplicationButton.ScreenTip <> nil) and not IsApplicationMenuDropped; + rhtHelpButton: + Result := Ribbon.HelpButtonScreenTip <> nil; + end; + end; +end; + +function TdxRibbonController.IsOwnerForHintObject(AObject: TdxRibbonHitTest): Boolean; +begin + Result := AObject in [rhtTab, rhtApplicationMenu, rhtHelpButton, + rhtMDIMinimizeButton, rhtMDIRestoreButton, rhtMDICloseButton]; +end; + +procedure TdxRibbonController.HideHint; +begin + if Ribbon.IsBarManagerValid then + Ribbon.BarManager.HideHint; +end; + +procedure TdxRibbonController.KeyDown(var Key: Word; Shift: TShiftState); +begin + HideHint; +end; + +procedure TdxRibbonController.KeyPress(var Key: Char); +begin +end; + +procedure TdxRibbonController.KeyUp(var Key: Word; Shift: TShiftState); +begin +end; + +procedure TdxRibbonController.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +var + AHitInfo: TdxRibbonHitInfo; + ARibbonParentForm: TCustomForm; +begin + HideHint; + if IsApplicationMenuDropped and + Assigned(Ribbon.ApplicationButton.Menu) and Ribbon.ApplicationButton.Menu.Visible then + Ribbon.ApplicationButton.Menu.SubMenuControl.HideAll; + + AHitInfo := ViewInfo.GetHitInfo(X, Y); + case AHitInfo.HitTest of + rhtTab: + if not Ribbon.IsDesigning and (ssDouble in Shift) and AHitInfo.Tab.Active then + Ribbon.ShowTabGroups := not Ribbon.ShowTabGroups + else + ProcessTabClick(AHitInfo.Tab, Button, Shift); + rhtApplicationMenu: + if Button = mbLeft then + begin + if ssDouble in Shift then + begin + ARibbonParentForm := GetParentForm(Ribbon); + if ARibbonParentForm <> nil then + ARibbonParentForm.Close; + end + else + if Ribbon.ApplicationMenuPopup then Exit; + end; + rhtTabScrollLeft..rhtGroupScrollRight: + if Button = mbLeft then + StartScroll(AHitInfo.HitTest); + else + if Button = mbRight then + begin + if cxRectPtIn(ViewInfo.TabsViewInfo.Bounds, X, Y) or + (Ribbon.IsQuickAccessToolbarValid and ViewInfo.IsQATAtBottom and + cxRectPtIn(ViewInfo.QuickAccessToolbarBounds, X, Y)) then + Ribbon.ShowCustomizePopup; + end; + end; + if Button = mbLeft then + PressedObject := AHitInfo.HitTest; +end; + +procedure TdxRibbonController.MouseLeave; +begin + if IsOwnerForHintObject(HintInfo.HitTest) then + CancelHint; + Ribbon.HighlightedTab := nil; + HotObject := rhtNone; +end; + +procedure TdxRibbonController.MouseMove(Shift: TShiftState; X, Y: Integer); +var + AHitInfo: TdxRibbonHitInfo; +begin + AHitInfo := ViewInfo.GetHitInfo(X, Y); + if ViewInfo.IsApplicationButtonVisible then + begin + if Ribbon.ApplicationButtonPressed or IsApplicationMenuDropped then + Ribbon.ApplicationButtonState := absPressed + else if AHitInfo.HitTest = rhtApplicationMenu then + Ribbon.ApplicationButtonState := absHot + else + Ribbon.ApplicationButtonState := absNormal; + end; + if NotHandleMouseMove(cxPoint(X, Y)) then Exit; + Ribbon.HighlightedTab := AHitInfo.Tab; + HotObject := AHitInfo.HitTest; + HintInfo := AHitInfo; +end; + +procedure TdxRibbonController.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + CancelScroll; + if Button = mbLeft then + begin + ReleaseCapture; + if ViewInfo.IsApplicationButtonVisible then + Ribbon.ApplicationButtonPressed := False; + CheckButtonsMouseUp(X, Y); + PressedObject := rhtNone; + end; +end; + +function TdxRibbonController.MouseWheelDown(Shift: TShiftState; + MousePos: TPoint): Boolean; +var + ATab: TdxRibbonTab; +begin + ATab := NextTab(Ribbon.ActiveTab); + Result := (ATab <> nil) and Ribbon.CanScrollTabs; + if Result then + Ribbon.ActiveTab := ATab; +end; + +function TdxRibbonController.MouseWheelUp(Shift: TShiftState; + MousePos: TPoint): Boolean; +var + ATab: TdxRibbonTab; +begin + ATab := PrevTab(Ribbon.ActiveTab); + Result := (ATab <> nil) and Ribbon.CanScrollTabs; + if Result then + Ribbon.ActiveTab := ATab; +end; + +function TdxRibbonController.DoHint(var ANeedDeactivate: Boolean; out AHintText: string; out AShortCut: string): Boolean; +begin + ANeedDeactivate := False; + Result := IsNeedShowHint(HintInfo.HitTest); + AHintText := ''; + AShortCut := ''; + if Result then + begin + case HintInfo.HitTest of + rhtTab: + AHintText := FHintInfo.Tab.Caption; + rhtApplicationMenu: + AHintText := Ribbon.ApplicationButton.ScreenTip.Header.Text; + rhtHelpButton: + AHintText := Ribbon.HelpButtonScreenTip.Header.Text; + rhtMDIMinimizeButton: + AHintText := cxGetResourceString(@dxSBAR_MDIMINIMIZE); + rhtMDIRestoreButton: + AHintText := cxGetResourceString(@dxSBAR_MDIRESTORE); + rhtMDICloseButton: + AHintText := cxGetResourceString(@dxSBAR_MDICLOSE); + end; + end; +end; + +function TdxRibbonController.CreateHintViewInfo( + const AHintText, AShortCut: string): TdxBarCustomHintViewInfo; +var + ABarManager: TdxBarManager; + AScreenTip: TdxBarScreenTip; +begin + if Ribbon.IsBarManagerValid then + ABarManager := Ribbon.BarManager + else + ABarManager := nil; + case HintInfo.HitTest of + rhtApplicationMenu: + AScreenTip := Ribbon.ApplicationButton.ScreenTip; + rhtHelpButton: + AScreenTip := Ribbon.HelpButtonScreenTip; + else + AScreenTip := nil; + end; + Result := dxBarCreateScreenTipViewInfo(ABarManager, AHintText, AShortCut, + AScreenTip, Ribbon.GroupsPainter); +end; + +function TdxRibbonController.GetEnabled: Boolean; +begin + Result := True;// TODO +end; + +function TdxRibbonController.GetHintPosition(const ACursorPos: TPoint; AHeight: Integer): TPoint; +var + AIndent: Integer; + R: TRect; +begin + Result := ACursorPos; + AIndent := 0; + case HintInfo.HitTest of + rhtApplicationMenu: + begin + R := ViewInfo.ApplicationButtonBounds; + Result := cxPoint(R.Left, R.Bottom); + Result := Ribbon.ClientToScreen(Result); + if GetDesktopWorkArea(Result).Bottom - Result.Y < AHeight then + begin + Result := Ribbon.ClientToScreen(cxPoint(R.Left, 0)); + Dec(Result.Y, AHeight + AIndent); + end; + end; + else + Inc(Result.Y, 20 {HintOffset}); + end; +end; + +procedure TdxRibbonController.CancelHint; +begin + ClearHintInfo; + HideHint; +end; + +procedure TdxRibbonController.CancelMode; +begin + Ribbon.HighlightedTab := nil; + CancelScroll; + CancelHint; +end; + +procedure TdxRibbonController.DesignTabMenuClick(Sender: TObject); +begin + case TdxBarButton(Sender).Tag of + 0: Ribbon.Tabs.Add; + 1: BarDesignController.DeleteSelectedObjects(True, True); + 2: Ribbon.DesignAddTabGroup(nil, False); + 3: Ribbon.DesignAddTabGroup(nil, True); + end; + Ribbon.Modified; +end; + +procedure TdxRibbonController.ScrollGroups(AScrollLeft, AOnTimer: Boolean); +begin + Ribbon.ActiveTab.ScrollDockControlGroups(AScrollLeft, AOnTimer); +end; + +procedure TdxRibbonController.ScrollTabs(AScrollLeft, AOnTimer: Boolean); +const + ScrollDelta: array[Boolean, Boolean] of Integer = ((-dxRibbonTabMinWidth div 2, dxRibbonTabMinWidth div 2), (-3, 3)); +begin + with ViewInfo.TabsViewInfo do + ScrollPosition := ScrollPosition + ScrollDelta[AOnTimer, AScrollLeft]; +end; + +procedure TdxRibbonController.SetHintInfo(const Value: TdxRibbonHitInfo); +var + ANeedHide: Boolean; +begin + if Ribbon.IsLocked or not Ribbon.IsBarManagerValid then Exit; + if (HintInfo.HitTest <> Value.HitTest) or (HintInfo.Tab <> Value.Tab) then + begin + ANeedHide := IsOwnerForHintObject(HintInfo.HitTest); + FHintInfo := Value; + if IsOwnerForHintObject(HintInfo.HitTest) then + Ribbon.BarManager.ActivateHint(True, '', Self) + else + if ANeedHide then + HideHint; + end; +end; + +procedure TdxRibbonController.SetHotObject(const Value: TdxRibbonHitTest); +var + APrev: TdxRibbonHitTest; +begin + if FHotObject <> Value then + begin + APrev := FHotObject; + FHotObject := Value; + if ViewInfo.IsApplicationButtonVisible and not IsApplicationMenuDropped then + Ribbon.ApplicationButtonState := absNormal; + Invalidate(APrev, FHotObject); + end; +end; + +procedure TdxRibbonController.SetPressedObject(const Value: TdxRibbonHitTest); +var + APrev: TdxRibbonHitTest; +begin + if FPressedObject <> Value then + begin + APrev := FPressedObject; + FPressedObject := Value; + if not (FPressedObject in [rhtNone, rhtTab, rhtApplicationMenu]) then + SetCapture(Ribbon.Handle); + Invalidate(APrev, FPressedObject); + end; +end; + +procedure TdxRibbonController.ShowTabDesignMenu; +begin + BarDesignController.ShowCustomCustomizePopup(Ribbon.BarManager, + InitTabDesignMenu, Ribbon.GroupsPainter); +end; + +function TdxRibbonController.NotHandleMouseMove(P: TPoint): Boolean; +begin + if Ribbon.IsBarManagerValid and not Ribbon.IsDesigning then + Result := (FScrollKind <> rhtNone) or + (not IsFormActive(Ribbon.BarManager.ParentForm) and not IsFormActive(Ribbon.FTabGroupsPopupWindow) or HasPopupWindowAbove(nil, False)) + else + Result := True; +end; + +procedure TdxRibbonController.ProcessTabClick(ATab: TdxRibbonTab; + Button: TMouseButton; Shift: TShiftState); +begin + if CanProcessDesignTime then + begin + Ribbon.ActiveTab := ATab; + BarDesignController.SelectItem(ATab); + if Button = mbRight then + ShowTabDesignMenu; + end; + if not Ribbon.IsDesigning then + begin + if Button = mbLeft then + begin + Ribbon.ActiveTab := ATab; + if not (ssDouble in Shift) and not Ribbon.ShowTabGroups and + (not Assigned(Ribbon.TabGroupsPopupWindow) or not Ribbon.TabGroupsPopupWindow.JustClosed) then + Ribbon.ShowTabGroupsPopupWindow; + end + else if Button = mbRight then + Ribbon.ShowCustomizePopup; + end; +end; + +procedure TdxRibbonController.CancelScroll; +begin + FScrollKind := rhtNone; + InvalidateScrollButtons; + FScrollTimer.Enabled := False; +end; + +function TdxRibbonController.CanProcessDesignTime: Boolean; +begin + Result := Ribbon.IsDesigning and Ribbon.IsBarManagerValid; +end; + +procedure TdxRibbonController.ClearHintInfo; +begin + FHintInfo.HitTest := rhtNone; + FHintInfo.Tab := nil; +end; + +procedure TdxRibbonController.CreateTimer; +begin + FScrollTimer := TTimer.Create(nil); + FScrollTimer.Enabled := False; + FScrollTimer.OnTimer := OnTimer; +end; + +function TdxRibbonController.GetViewInfo: TdxRibbonViewInfo; +begin + Result := Ribbon.ViewInfo; +end; + +procedure TdxRibbonController.Invalidate(AOld, ANew: TdxRibbonHitTest); + + procedure InvalidateObject(AObject: TdxRibbonHitTest); + begin + case AObject of + rhtTabScrollLeft..rhtGroupScrollRight: + InvalidateScrollButtons; + rhtHelpButton..rhtMDICloseButton: + InvalidateButtons; + end; + end; + +begin + InvalidateObject(AOld); + InvalidateObject(ANew); +end; + +procedure TdxRibbonController.InvalidateScrollButtons; +begin + with ViewInfo do + begin + TabsViewInfo.Invalidate; + GroupsDockControlSiteViewInfo.InvalidateScrollButtons; + end; +end; + +procedure TdxRibbonController.InvalidateButtons; +begin + with ViewInfo do + begin + InvalidateMDIButtons; + InvalidateHelpButton; + end; +end; + +procedure TdxRibbonController.StartScroll(AScrollKind: TdxRibbonHitTest); +begin + if not (AScrollKind in [rhtTabScrollLeft..rhtGroupScrollRight]) then Exit; + FScrollKind := AScrollKind; + FScrollTimer.Interval := dxRibbonScrollDelay; + DoScroll(False); + FScrollTimer.Enabled := True; +end; + +procedure TdxRibbonController.OnTimer(Sender: TObject); +var + P: TPoint; +begin + FScrollTimer.Interval := dxRibbonScrollInterval; + P := Ribbon.ScreenToClient(GetMouseCursorPos); + if ViewInfo.GetHitInfo(P.X, P.Y).HitTest = FScrollKind then + DoScroll(True); +end; + +{ TdxRibbonGroupsDockControlSiteViewInfo } + +constructor TdxRibbonGroupsDockControlSiteViewInfo.Create( + ASite: TdxRibbonGroupsDockControlSite); +begin + inherited Create; + FSite := ASite; +end; + +procedure TdxRibbonGroupsDockControlSiteViewInfo.Calculate; +var + AScrollButtonWidth: Integer; + R: TRect; +begin + FTabGroupsScrollButtonBounds[rsbLeft] := cxEmptyRect; + FTabGroupsScrollButtonBounds[rsbRight] := cxEmptyRect; + if FSite.Ribbon.ViewInfo.IsTabGroupsVisible and (FSite.Ribbon.ActiveTab <> nil) then + begin + FTabGroupsScrollButtons := FSite.Ribbon.ActiveTab.DockControl.ViewInfo.ScrollButtons; + R := GetControlRect(FSite); + AScrollButtonWidth := FSite.Ribbon.ViewInfo.GetScrollButtonWidth; + if rsbLeft in FTabGroupsScrollButtons then + FTabGroupsScrollButtonBounds[rsbLeft] := Rect(R.Left, R.Top, R.Left + AScrollButtonWidth, R.Bottom); + if rsbRight in FTabGroupsScrollButtons then + FTabGroupsScrollButtonBounds[rsbRight] := Rect(R.Right - AScrollButtonWidth, R.Top, R.Right, R.Bottom); + end; +end; + +function TdxRibbonGroupsDockControlSiteViewInfo.GetHitInfo( + var AHitInfo: TdxRibbonHitInfo; X, Y: Integer): Boolean; +const + AHitTestMap: array[TdxRibbonScrollButton] of TdxRibbonHitTest = + (rhtGroupScrollLeft, rhtGroupScrollRight); +var + AButton: TdxRibbonScrollButton; + P: TPoint; +begin + Result := False; + P := FSite.ScreenToClient(FSite.Ribbon.ClientToScreen(Point(X, Y))); + for AButton := Low(TdxRibbonScrollButton) to High(TdxRibbonScrollButton) do + if PtInRect(FTabGroupsScrollButtonBounds[AButton], P) then + begin + Result := True; + AHitInfo.HitTest := AHitTestMap[AButton]; + Break; + end; +end; + +procedure TdxRibbonGroupsDockControlSiteViewInfo.InvalidateScrollButtons; +begin + FSite.Invalidate; +end; + +procedure TdxRibbonGroupsDockControlSiteViewInfo.Paint(ACanvas: TcxCanvas); + + procedure DrawScrollButton(AButton: TdxRibbonScrollButton); + begin + FSite.Ribbon.Painter.DrawGroupsScrollButton(BarCanvas, FTabGroupsScrollButtonBounds[AButton], + AButton = rsbLeft, GetTabGroupsScrollButtonPressed(AButton), + GetTabGroupsScrollButtonHot(AButton)); + end; + +var + AViewInfo: TdxRibbonViewInfo; + ATab: TdxRibbonTab; + P, ASaveOrg: TPoint; +begin + BarCanvas.BeginPaint(ACanvas.Canvas); + try + AViewInfo := FSite.Ribbon.ViewInfo; + ASaveOrg := BarCanvas.WindowOrg; + P := ASaveOrg; + AViewInfo.Painter.DrawGroupsArea(BarCanvas, GetControlRect(FSite)); + MapWindowPoint(FSite.Handle, FSite.Ribbon.Handle, P); + BarCanvas.WindowOrg := P; + ATab := FSite.Ribbon.ActiveTab; + if (ATab <> nil) and (ATab.ViewInfo <> nil) then + begin + BarCanvas.SaveClipRegion; + BarCanvas.IntersectClipRect(AViewInfo.TabsViewInfo.GetRealBounds); + ATab.ViewInfo.Paint(BarCanvas); + BarCanvas.RestoreClipRegion; + end; + BarCanvas.WindowOrg := ASaveOrg; + if rsbLeft in TabGroupsScrollButtons then + DrawScrollButton(rsbLeft); + if rsbRight in TabGroupsScrollButtons then + DrawScrollButton(rsbRight); + finally + BarCanvas.EndPaint; + end; +end; + +function TdxRibbonGroupsDockControlSiteViewInfo.GetTabGroupsScrollButtonHot( + AButton: TdxRibbonScrollButton): Boolean; +begin + with FSite.Ribbon.Controller do + Result := + ((HotObject = rhtGroupScrollLeft) and (AButton = rsbLeft)) or + ((HotObject = rhtGroupScrollRight) and (AButton = rsbRight)); +end; + +function TdxRibbonGroupsDockControlSiteViewInfo.GetTabGroupsScrollButtonPressed( + AButton: TdxRibbonScrollButton): Boolean; +begin + with FSite.Ribbon.Controller do + Result := + ((ScrollKind = rhtGroupScrollLeft) and (AButton = rsbLeft)) or + ((ScrollKind = rhtGroupScrollRight) and (AButton = rsbRight)); +end; + +{ TdxRibbonGroupsDockControlSite } + +constructor TdxRibbonGroupsDockControlSite.Create(ARibbon: TdxCustomRibbon); +begin + inherited Create(ARibbon); + FRibbon := ARibbon; + FViewInfo := TdxRibbonGroupsDockControlSiteViewInfo.Create(Self); + DoubleBuffered := True; +end; + +destructor TdxRibbonGroupsDockControlSite.Destroy; +begin + FreeAndNil(FViewInfo); + inherited Destroy; +end; + +function TdxRibbonGroupsDockControlSite.CanFocus: Boolean; +begin + Result := False; +end; + +procedure TdxRibbonGroupsDockControlSite.AlignControls(AControl: TControl; + var Rect: TRect); +begin +end; + +procedure TdxRibbonGroupsDockControlSite.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + WindowClass.style := WindowClass.style and not (CS_VREDRAW + CS_HREDRAW); +end; + +procedure TdxRibbonGroupsDockControlSite.DoCancelMode; +begin + inherited DoCancelMode; + Ribbon.Controller.CancelMode; +end; + +function TdxRibbonGroupsDockControlSite.DoMouseWheelDown(Shift: TShiftState; + MousePos: TPoint): Boolean; +begin + Result := inherited DoMouseWheelDown(Shift, MousePos); + if not Result then + Result := Ribbon.Controller.MouseWheelDown(Shift, MousePos); +end; + +function TdxRibbonGroupsDockControlSite.DoMouseWheelUp(Shift: TShiftState; + MousePos: TPoint): Boolean; +begin + Result := inherited DoMouseWheelUp(Shift, MousePos); + if not Result then + Result := Ribbon.Controller.MouseWheelUp(Shift, MousePos); +end; + +function TdxRibbonGroupsDockControlSite.MayFocus: Boolean; +begin + Result := False; +end; + +procedure TdxRibbonGroupsDockControlSite.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + with Ribbon.ScreenToClient(ClientToScreen(Point(X, Y))) do + Ribbon.Controller.MouseDown(Button, Shift, X, Y); +end; + +procedure TdxRibbonGroupsDockControlSite.MouseLeave(AControl: TControl); +begin + inherited MouseLeave(AControl); + Ribbon.Controller.MouseLeave; +end; + +procedure TdxRibbonGroupsDockControlSite.MouseMove(Shift: TShiftState; + X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + with Ribbon.ScreenToClient(ClientToScreen(Point(X, Y))) do + Ribbon.Controller.MouseMove(Shift, X, Y); +end; + +procedure TdxRibbonGroupsDockControlSite.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + with Ribbon.ScreenToClient(ClientToScreen(Point(X, Y))) do + Ribbon.Controller.MouseUp(Button, Shift, X, Y); +end; + +function TdxRibbonGroupsDockControlSite.NeedsScrollBars: Boolean; +begin + Result := False; +end; + +procedure TdxRibbonGroupsDockControlSite.Paint; +begin + ViewInfo.Paint(Canvas); +end; + +function TdxRibbonGroupsDockControlSite.GetDockControl: TdxRibbonGroupsDockControl; +begin + Result := Ribbon.ActiveTab.DockControl; +end; + +{ TdxCustomRibbon } + +constructor TdxCustomRibbon.Create(AOwner: TComponent); +begin + Include(FInternalState, risCreating); + RibbonCheckCreateComponent(AOwner, ClassType); + Exclude(FInternalState, risCreating); + inherited Create(AOwner); + DoubleBuffered := True; + FPainter := CreatePainter; + FViewInfo := CreateViewInfo; + FGroupsDockControlSite := TdxRibbonGroupsDockControlSite.Create(Self); + FGroupsDockControlSite.Parent := Self; + FGroupsPainter := CreateGroupsPainter; + FFonts := TdxRibbonFonts.Create(Self); + FTabs := TdxRibbonTabCollection.Create(Self); + Align := alTop; + FShowTabGroups := True; + FShowTabHeaders := True; + FApplicationButton := CreateApplicationButton; + FQuickAccessToolbar := CreateQuickAccessToolbar; + FController := CreateController; + FFader := TdxFader.Create; + FPopupMenuItems := [rpmiItems, rpmiMoreCommands, rpmiQATPosition, rpmiQATAddRemoveItem, rpmiMinimizeRibbon]; + FColorSchemeHandlers := TcxEventHandlerCollection.Create; + + FLockModified := True; + try + InitColorScheme; + if IsDesigning then + begin + BarManager := GetBarManagerByComponent(AOwner); + if FBarManager = nil then + BarManager := TdxBarManager(dxBarManagerList[0]); + Tabs.Add; + end; + finally + FLockModified := False; + end; + //Fading := True; + FInternalItems := TComponentList.Create; + FRibbonFormNonClientPainters := TList.Create; +end; + +destructor TdxCustomRibbon.Destroy; +begin + if risCreating in FInternalState then Exit; + BarAccessibilityHelperOwnerObjectDestroyed(FIAccessibilityHelper); + FreeAndNil(FRibbonFormNonClientPainters); + FreeAndNil(FTabGroupsPopupWindow); + FreeAndNil(FInternalItems); + FreeAndNil(FController); + FreeAndNil(FColorSchemeHandlers); + IniFileProceduresRemove; //For removing procedures when BarManager in destroying state + BarManager := nil; + FreeAndNil(FFader); + SupportNonClientDrawing := False; + FreeAndNil(FApplicationButton); + FreeAndNil(FQuickAccessToolbar); + dxFreeAndNil(FTabs); + FreeAndNil(FViewInfo); + FreeAndNil(FGroupsPainter); + FreeAndNil(FPainter); + FreeAndNil(FFonts); + inherited Destroy; +end; + +function TdxCustomRibbon.ApplicationMenuPopup: Boolean; +var + P: TPoint; + AOwnerOffset: Integer; + AOwnerBounds: TRect; +begin + Result := False; + if not (risAppMenuActive in FInternalState) then + begin + FApplicationButtonPressed := True; + ApplicationButtonState := absPressed; + if not DoApplicationMenuClick and (ApplicationButton.Menu <> nil) then + begin + P := ViewInfo.ApplicationButtonBounds.TopLeft; + P.Y := ViewInfo.GetTabsBounds.Top; + AOwnerOffset := P.Y - ViewInfo.ApplicationButtonImageBounds.Top; + P := ClientToScreen(P); + AOwnerBounds := ViewInfo.ApplicationButtonImageBounds; + FPrevOnApplicationMenuPopup := ApplicationButton.Menu.OnPopup; + ApplicationButton.Menu.OnPopup := ApplicationMenuPopupNotification; + Include(FInternalState, risAppMenuActive); + try + ApplicationButton.Menu.PopupEx(P.X, P.Y, 0, AOwnerOffset, True, @AOwnerBounds, True, Self); + finally + Result := True; + Exclude(FInternalState, risAppMenuActive); + if ApplicationButton.Menu <> nil then + ApplicationButton.Menu.OnPopup := FPrevOnApplicationMenuPopup; + FApplicationButtonPressed := False; + ApplicationButtonState := absNormal; + Controller.PressedObject := rhtNone; + end; + end; + end; +end; + +function TdxCustomRibbon.AreGroupsVisible: Boolean; +begin + Result := not Hidden and (ShowTabGroups or IsPopupGroupsMode); +end; + +procedure TdxCustomRibbon.BeginUpdate; +begin + Inc(FLockCount); +end; + +function TdxCustomRibbon.CanFocus: Boolean; +begin + Result := False; +end; + +procedure TdxCustomRibbon.CheckHide; +var + F: TCustomForm; + DC: HDC; +begin + if FHidden xor ViewInfo.IsNeedHideControl then + begin + F := GetParentForm(Self{$IFDEF DELPHI8}, False{$ENDIF}); + if not FHidden and (F <> nil) and F.HandleAllocated then + begin + Changed; + F.Invalidate; + DC := GetDC(F.Handle); + try + SendMessage(F.Handle, WM_ERASEBKGND, DC, DC); + finally + ReleaseDC(F.Handle, DC); + end; + end + else + Changed; + end; +end; + +procedure TdxCustomRibbon.CloseTabGroupsPopupWindow; +begin + if IsPopupGroupsMode then + TabGroupsPopupWindow.CloseUp; +end; + +procedure TdxCustomRibbon.EndUpdate; +begin + Dec(FLockCount); + if (FLockCount = 0) and not IsDestroying then + begin + Changed; + RibbonFormInvalidate; + end; +end; + +function TdxCustomRibbon.GetTabAtPos(X, Y: Integer): TdxRibbonTab; +begin + Result := ViewInfo.GetTabAtPos(X, Y); +end; + +procedure TdxCustomRibbon.ShowTabGroupsPopupWindow; +begin + if ShowTabGroups then Exit; + if FTabGroupsPopupWindow = nil then + FTabGroupsPopupWindow := TdxRibbonTabGroupsPopupWindow.Create(Self); + FTabGroupsPopupWindow.OwnerBounds := BoundsRect; + FTabGroupsPopupWindow.OwnerParent := Parent; + FTabGroupsPopupWindow.Popup(nil); + FTabGroupsPopupWindow.Invalidate; + Invalidate; +end; + +procedure TdxCustomRibbon.AddTab(ATab: TdxRibbonTab); +begin + if ATab = nil then Exit; + ATab.Ribbon := Self; + if ActiveTab = nil then + ActiveTab := ATab; + Changed; +end; + +procedure TdxCustomRibbon.RemoveTab(ATab: TdxRibbonTab); +begin + if ATab = nil then Exit; + BarDesignController.LockDesignerModified; + try + ATab.Ribbon := nil; + if ActiveTab = ATab then + SetNextActiveTab(ATab); + finally + BarDesignController.UnLockDesignerModified; + end; + Changed; +end; + +procedure TdxCustomRibbon.SetNextActiveTab(ATab: TdxRibbonTab); +begin + FLockModified := csDestroying in ATab.ComponentState; + try + ActiveTab := GetNextActiveTab(ATab); + finally + FLockModified := False; + end; +end; + +procedure TdxCustomRibbon.FullInvalidate; +begin + if IsDestroying or not (HandleAllocated and Visible) then Exit; + QuickAccessToolbar.UpdateColorScheme; + if ActiveTab <> nil then + ActiveTab.UpdateColorScheme; + RibbonFormInvalidate; + FGroupsDockControlSite.Invalidate; //for CBuilder + Invalidate; +end; + +procedure TdxCustomRibbon.Changed; +begin + if IsLocked then Exit; + if not IsDesigning then + Fader.Clear; + Controller.CancelHint; + CalculateFormCaptionHeight; + if FormCaptionHelper <> nil then + FormCaptionHelper.Calculate; + ViewInfo.Calculate(ClientBounds); + Invalidate; +end; + +procedure TdxCustomRibbon.RecalculateBars; +var + I: Integer; +begin + if IsBarManagerValid then + begin + + with QuickAccessToolbar do + if Assigned(Toolbar) and (Toolbar.Control is TdxRibbonQuickAccessBarControl) then + begin + with TdxRibbonQuickAccessBarControl(Toolbar.Control) do + UpdateDefaultGlyph(FDefaultGlyph); + Toolbar.Control.RepaintBar; // Flush glyph cache + end; + + with BarManager do + begin + BeginUpdate; + try + for I := 0 to Bars.Count - 1 do + if Bars.Items[I].Control <> nil then + TdxBarControlAccess(Bars.Items[I].Control).CalcDrawingConsts; + finally + EndUpdate; + end; + end; + + end; +end; + +procedure TdxCustomRibbon.DrawRibbonFormCaption(ACanvas: TcxCanvas; + const ABounds: TRect; const ACaption: string; const AData: TdxRibbonFormData); +begin + Painter.DrawRibbonFormCaption(ACanvas, ABounds, AData); +end; + +procedure TdxCustomRibbon.DrawRibbonFormBorderIcon(ACanvas: TcxCanvas; + const ABounds: TRect; AIcon: TdxBorderDrawIcon; AState: TdxBorderIconState); +begin + Painter.DrawRibbonFormBorderIcon(ACanvas, ABounds, AIcon, AState); +end; + +procedure TdxCustomRibbon.DrawRibbonFormBorders(ACanvas: TcxCanvas; + const AData: TdxRibbonFormData; const ABordersWidth: TRect); +begin + CheckDrawRibbonFormStatusBarBorders(ACanvas, AData, ABordersWidth); + Painter.DrawRibbonFormBorders(ACanvas, ABordersWidth, AData); +end; + +function TdxCustomRibbon.GetRibbonApplicationButtonRegion: HRGN; +begin + Result := ViewInfo.GetApplicationButtonRegion; +end; + +function TdxCustomRibbon.GetRibbonFormCaptionHeight: Integer; +begin + Result := FCalculatedFormCaptionHeight; +end; + +function TdxCustomRibbon.GetRibbonFormColor: TColor; +begin + Result := ColorScheme.GetPartColor(rfspRibbonForm); +end; + +function TdxCustomRibbon.GetTaskBarCaption: TCaption; +begin + Result := ViewInfo.GetFormCaptionText; +end; + +function TdxCustomRibbon.GetWindowBordersWidth: TRect; +begin + Result := ColorScheme.GetWindowBordersWidth(HasStatusBar); +end; + +function TdxCustomRibbon.HasStatusBar: Boolean; +begin + Result := GetStatusBarInterface <> nil; +end; + +procedure TdxCustomRibbon.RibbonFormCaptionChanged; +var + AForm: TForm; +begin + BeginUpdate; + try + AForm := RibbonForm; + if (AForm <> nil) and (AForm.FormStyle = fsMDIForm) then + begin + AForm := AForm.ActiveMDIChild; + if (AForm <> nil) and IsZoomed(AForm.Handle) then + DocumentName := AForm.Caption + else + DocumentName := ''; + end; + finally + EndUpdate; + end; +end; + +procedure TdxCustomRibbon.RibbonFormResized; +begin + CheckHide; +end; + +procedure TdxCustomRibbon.UpdateNonClientArea; +begin + if HandleAllocated and Visible then + begin + RedrawWindow(Handle, nil, 0, RDW_ERASE or RDW_INVALIDATE or RDW_UPDATENOW or RDW_ERASENOW); + if ViewInfo.IsQATAtNonClientArea then + RedrawWindow(QuickAccessToolbar.DockControl.Handle, nil, 0, + RDW_ERASE or RDW_INVALIDATE or RDW_ALLCHILDREN or RDW_UPDATENOW or RDW_ERASENOW); + end; +end; + +procedure TdxCustomRibbon.DrawTabGroupBackground(DC: HDC; const ARect: TRect; + AState: Integer); +var + R: TRect; +begin + R := ARect; + Dec(R.Bottom, GetGroupCaptionHeight + dxRibbonGroupCaptionOffsets.Bottom); + ColorScheme.DrawTabGroupBackground(DC, R, AState); + ColorScheme.DrawTabGroupHeaderBackground(DC, Rect(R.Left, R.Bottom, R.Right, ARect.Bottom), AState); +end; + +function TdxCustomRibbon.GetGroupCaptionHeight: Integer; +begin + Result := GroupsPainter.GetGroupCaptionHeight(Fonts.GetGroupHeaderFont); +end; + +function TdxCustomRibbon.GetGroupContentHeight: Integer; +begin + Result := GetGroupRowHeight * dxRibbonGroupRowCount; +end; + +function TdxCustomRibbon.GetGroupHeight: Integer; +begin + Result := GetGroupContentHeight; + with SkinGetContentOffsets(DXBAR_TOOLBAR) do + Inc(Result, Top + Bottom); +end; + +function TdxCustomRibbon.GetGroupRowHeight: Integer; +begin + Result := GroupsPainter.GetGroupRowHeight(GroupsPainter.GetSmallIconSize, Fonts.GetGroupFont); +end; + +procedure TdxCustomRibbon.SkinDrawBackground(DC: HDC; const ARect: TRect; APart, AState: Integer); +begin + case APart of + DXBAR_TOOLBAR: DrawTabGroupBackground(DC, ARect, AState); + DXBAR_COLLAPSEDTOOLBAR: + ColorScheme.DrawCollapsedToolbarBackground(DC, ARect, AState); + DXBAR_MARKARROW: ColorScheme.DrawMarkArrow(DC, ARect, AState); + DXBAR_MARKTRUNCATED: ColorScheme.DrawMarkTruncated(DC, ARect, AState); + DXBAR_COLLAPSEDTOOLBARGLYPHBACKGROUND: + ColorScheme.DrawCollapsedToolbarGlyphBackground(DC, ARect, AState); + DXBAR_ARROWDOWN: ColorScheme.DrawArrowDown(DC, ARect, AState); + DXBAR_APPLICATIONMENUBUTTON: ColorScheme.DrawApplicationMenuButton(DC, ARect, AState); + DXBAR_APPLICATIONMENUBORDER: + begin + ColorScheme.DrawApplicationMenuBorder(DC, ARect); + DrawApplicationMenuHeader(DC, False); + end; + DXBAR_APPLICATIONMENUCONTENTHEADER: + begin + ColorScheme.DrawApplicationMenuContentHeader(DC, ARect); + DrawApplicationMenuHeader(DC, True); + end; + DXBAR_APPLICATIONMENUCONTENTFOOTER: ColorScheme.DrawApplicationMenuContentFooter(DC, ARect); + DXBAR_DROPDOWNBORDER: ColorScheme.DrawDropDownBorder(DC, ARect); + DXBAR_MENUARROWDOWN: ColorScheme.DrawMenuArrowDown(DC, ARect); + DXBAR_MENUARROWRIGHT: ColorScheme.DrawMenuArrowRight(DC, ARect); + DXBAR_MENUCHECK: ColorScheme.DrawMenuCheck(DC, ARect, AState); + DXBAR_MENUCHECKMARK: ColorScheme.DrawMenuCheckMark(DC, ARect, AState); + DXBAR_MENUCONTENT: ColorScheme.DrawMenuContent(DC, ARect); + DXBAR_MENUDETACHCAPTION: ColorScheme.DrawMenuDetachCaption(DC, ARect, AState); + DXBAR_MENUGLYPH: ColorScheme.DrawMenuGlyph(DC, ARect); + DXBAR_MENUMARK: ColorScheme.DrawMenuMark(DC, ARect); + DXBAR_MENUSEPARATORHORZ: ColorScheme.DrawMenuSeparatorHorz(DC, ARect); + DXBAR_MENUSEPARATORVERT: ColorScheme.DrawMenuSeparatorVert(DC, ARect); + DXBAR_MENUSCROLLAREA: ColorScheme.DrawMenuScrollArea(DC, ARect, AState); + DXBAR_SCROLLARROW: ColorScheme.DrawScrollArrow(DC, ARect); + DXBAR_EDIT_ARROWBUTTON: ColorScheme.DrawEditArrowButton(DC, ARect, AState); + DXBAR_EDIT_BUTTON: ColorScheme.DrawEditButton(DC, ARect, AState); + DXBAR_EDIT_ELLIPSISBUTTON: ColorScheme.DrawEditEllipsisButton(DC, ARect, AState); + DXBAR_SPINEDIT_UPBUTTON: ColorScheme.DrawEditSpinUpButton(DC, ARect, AState); + DXBAR_SPINEDIT_DOWNBUTTON: ColorScheme.DrawEditSpinDownButton(DC, ARect, AState); + DXBAR_SMALLBUTTON: ColorScheme.DrawSmallButton(DC, ARect, AState); + DXBAR_SMALLBUTTON_GLYPH: ColorScheme.DrawSmallButtonGlyphBackground(DC, ARect, AState); + DXBAR_SMALLBUTTON_DROPBUTTON: ColorScheme.DrawSmallButtonDropButton(DC, ARect, AState); + DXBAR_LARGEBUTTON: ColorScheme.DrawLargeButton(DC, ARect, AState); + DXBAR_LARGEBUTTON_GLYPH: ColorScheme.DrawLargeButtonGlyphBackground(DC, ARect, AState); + DXBAR_LARGEBUTTON_DROPBUTTON: ColorScheme.DrawLargeButtonDropButton(DC, ARect, AState); + DXBAR_BUTTONGROUP: ColorScheme.DrawButtonGroup(DC, ARect, AState); + DXBAR_BUTTONGROUPBORDERLEFT: ColorScheme.DrawButtonGroupBorderLeft(DC, ARect); + DXBAR_BUTTONGROUPBORDERMIDDLE: ColorScheme.DrawButtonGroupBorderMiddle(DC, ARect, AState); + DXBAR_BUTTONGROUPBORDERRIGHT: ColorScheme.DrawButtonGroupBorderRight(DC, ARect); + DXBAR_BUTTONGROUPSPLITBUTTONSEPARATOR: ColorScheme.DrawButtonGroupSplitButtonSeparator(DC, ARect, AState); + DXBAR_LAUNCHBUTTONDEFAULTGLYPH: ColorScheme.DrawLaunchButtonDefaultGlyph(DC, ARect, AState); + DXBAR_LAUNCHBUTTONBACKGROUND: ColorScheme.DrawLaunchButtonBackground(DC, ARect, AState); + DXBAR_PROGRESSSOLIDBAND: ColorScheme.DrawProgressSolidBand(DC, ARect); + DXBAR_PROGRESSSUBSTRATE: ColorScheme.DrawProgressSubstrate(DC, ARect); + DXBAR_PROGRESSDISCRETEBAND: ColorScheme.DrawProgressDiscreteBand(DC, ARect); + DXBAR_QUICKACCESSGROUPBUTTON: ColorScheme.DrawQuickAccessToolbarGroupButton(DC, ARect, + ViewInfo.IsQATAtBottom, ViewInfo.SupportNonClientDrawing, ViewInfo.IsFormCaptionActive, AState); + DXBAR_SCREENTIP: ColorScheme.DrawScreenTip(DC, ARect); + DXBAR_INRIBBONGALLERY: ColorScheme.DrawInRibbonGalleryBackground(DC, ARect, AState); + DXBAR_DROPDOWNGALLERY: ColorScheme.DrawDropDownGalleryBackground(DC, ARect); + DXBAR_INRIBBONGALLERYSCROLLBAR_LINEUPBUTTON: + ColorScheme.DrawInRibbonGalleryScrollBarButton(DC, ARect, gsbkLineUp, AState); + DXBAR_INRIBBONGALLERYSCROLLBAR_LINEDOWNBUTTON: + ColorScheme.DrawInRibbonGalleryScrollBarButton(DC, ARect, gsbkLineDown, AState); + DXBAR_INRIBBONGALLERYSCROLLBAR_DROPDOWNBUTTON: + ColorScheme.DrawInRibbonGalleryScrollBarButton(DC, ARect, gsbkDropDown, AState); + DXBAR_DROPDOWNGALLERY_TOPSIZINGBAND: + ColorScheme.DrawDropDownGalleryTopSizingBand(DC, ARect); + DXBAR_DROPDOWNGALLERY_BOTTOMSIZINGBAND: + ColorScheme.DrawDropDownGalleryBottomSizingBand(DC, ARect); + DXBAR_DROPDOWNGALLERY_TOPSIZEGRIP: + ColorScheme.DrawDropDownGalleryTopSizeGrip(DC, ARect); + DXBAR_DROPDOWNGALLERY_BOTTOMSIZEGRIP: + ColorScheme.DrawDropDownGalleryBottomSizeGrip(DC, ARect); + DXBAR_DROPDOWNGALLERY_TOPVERTICALSIZEGRIP: + ColorScheme.DrawDropDownGalleryTopVerticalSizeGrip(DC, ARect); + DXBAR_DROPDOWNGALLERY_BOTTOMVERTICALSIZEGRIP: + ColorScheme.DrawDropDownGalleryBottomVerticalSizeGrip(DC, ARect); + DXBAR_GALLERYGROUPHEADERBACKGROUND: + ColorScheme.DrawGalleryGroupHeaderBackground(DC, ARect); + DXBAR_GALLERYFILTERBAND: + ColorScheme.DrawGalleryFilterBandBackground(DC, ARect); + end; +end; + +procedure TdxCustomRibbon.SkinDrawCaption(DC: HDC; const ACaption: string; + const ARect: TRect; APart, AState: Integer); +var + ACaptionRect: TRect; + APrevFont: HFONT; + APrevTextColor: TColor; + AFont: TFont; +begin + if APart = DXBAR_TOOLBAR then + begin + AFont := Fonts.GetGroupHeaderFont; + SetBkMode(DC, TRANSPARENT); + APrevFont := SelectObject(DC, AFont.Handle); + APrevTextColor := GetTextColor(DC); + SetTextColor(DC, ColorToRGB(AFont.Color)); + ACaptionRect := ARect; + Inc(ACaptionRect.Top, dxRibbonGroupCaptionHeightCorrection); + cxDrawText(DC, ACaption, ACaptionRect, DT_SINGLELINE or DT_CENTER or DT_VCENTER); + SelectObject(DC, APrevFont); + SetTextColor(DC, APrevTextColor); + SetBkMode(DC, OPAQUE); + end; +end; + +function TdxCustomRibbon.SkinGetCaptionRect(const ARect: TRect; APart: Integer): TRect; +begin + if APart = DXBAR_TOOLBAR then + begin + Result := ARect; + with SkinGetContentOffsets(DXBAR_TOOLBAR) do + ExtendRect(Result, Rect(Left, 0, Right, dxRibbonGroupCaptionOffsets.Bottom)); + Result.Top := Result.Bottom - GetGroupCaptionHeight; + end + else + Result := cxEmptyRect; +end; + +function TdxCustomRibbon.SkinGetContentOffsets(APart: Integer): TRect; +begin + case APart of + DXBAR_COLLAPSEDTOOLBAR: + Result := Rect(2, 2, 2, 2); + DXBAR_COLLAPSEDTOOLBARGLYPHBACKGROUND: + Result := Rect(7, 4, 7, 11); + DXBAR_GALLERYFILTERBAND: + Result := ColorScheme.GetPartContentOffsets(APart); + DXBAR_QUICKACCESSGROUPBUTTON, DXBAR_SMALLBUTTON: + Result := Rect(3, 3, 3, 3); + DXBAR_TOOLBAR: + Result := Rect(2, 2, 3, dxRibbonGroupCaptionOffsets.Top + GetGroupCaptionHeight + dxRibbonGroupCaptionOffsets.Bottom); + else + Result := cxEmptyRect; + end; +end; + +function TdxCustomRibbon.SkinGetName: string; +begin + Result := ColorScheme.GetSkinName; +end; + +function TdxCustomRibbon.SkinGetPartColor(APart: Integer; AState: Integer = 0): TColor; +begin + Result := ColorScheme.GetPartColor(APart, AState); +end; + +function TdxCustomRibbon.SkinGetPartOffset(APart: Integer): Integer; +begin + case APart of + DXBAR_TOOLBAR: + Result := 2; + DXBAR_BUTTONGROUP: + Result := 3; + else + Result := 0; + end; +end; + +procedure TdxCustomRibbon.FormKeyDown(var Key: Word; Shift: TShiftState); +begin + if not IsDestroying and HandleAllocated then + begin + Controller.HideHint; + if (Key = VK_F1) and (ssCtrl in Shift) and not IsPopupGroupsMode then + begin + ShowTabGroups := not ShowTabGroups; + Key := 0; + end; + end; +end; + +function TdxCustomRibbon.GetAccessibilityHelper: IdxBarAccessibilityHelper; +begin + Result := IAccessibilityHelper; +end; + +procedure TdxCustomRibbon.RibbonFormNonClientDrawAdd(AObject: TObject); +begin + if FRibbonFormNonClientPainters.IndexOf(AObject) = -1 then + FRibbonFormNonClientPainters.Add(AObject); +end; + +procedure TdxCustomRibbon.RibbonFormNonClientDrawRemove(AObject: TObject); +begin + FRibbonFormNonClientPainters.Remove(AObject); +end; + +procedure TdxCustomRibbon.BoundsChanged; +begin + inherited; + Changed; +end; + +function TdxCustomRibbon.CanResize(var NewWidth, NewHeight: Integer): Boolean; +begin + Result := inherited CanResize(NewWidth, NewHeight); + NewHeight := ViewInfo.GetRibbonHeight; +end; + +function TdxCustomRibbon.CanScrollTabs: Boolean; +begin + Result := AreGroupsVisible and not IsPopupGroupsMode and + not ((ActiveBarControl is TdxRibbonCollapsedGroupPopupBarControl) or + HasPopupWindowAbove(ActiveBarControl, False)); +end; + +procedure TdxCustomRibbon.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params.WindowClass do + style := style and not(CS_HREDRAW or CS_VREDRAW); +end; + +procedure TdxCustomRibbon.CreateWindowHandle(const Params: TCreateParams); +begin + inherited CreateWindowHandle(Params); + if (FMouseHook = 0) and not IsDesigning and (IsWin2KOrXP or IsWinVista) then + FMouseHook := SetWindowsHookEx(WH_MOUSE, @dxRibbonMouseHook, 0, GetCurrentThreadId); +end; + +procedure TdxCustomRibbon.DoCancelMode; +begin + inherited DoCancelMode; + Controller.CancelMode; +end; + +procedure TdxCustomRibbon.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + inherited LookAndFeelChanged(Sender, AChangedValues); + UpdateColorScheme; +end; + +function TdxCustomRibbon.DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean; +begin + Result := inherited DoMouseWheelDown(Shift, MousePos); + if not Result then + Result := Controller.MouseWheelDown(Shift, MousePos); +end; + +function TdxCustomRibbon.DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean; +begin + Result := inherited DoMouseWheelUp(Shift, MousePos); + if not Result then + Result := Controller.MouseWheelUp(Shift, MousePos); +end; + +procedure TdxCustomRibbon.FontChanged; +begin + BeginUpdate; + try + inherited FontChanged; + FFonts.UpdateFonts; + if ActiveTab <> nil then + ActiveTab.UpdateGroupsFont; + finally + EndUpdate; + end; +end; + +procedure TdxCustomRibbon.GetChildren(Proc: TGetChildProc; Root: TComponent); +var + I: Integer; +begin + for I := 0 to Tabs.Count - 1 do + if Tabs[I].Owner = Root then Proc(Tabs[I]); +end; + +function TdxCustomRibbon.GetDesignHitTest(X, Y: Integer; Shift: TShiftState): Boolean; +begin + Result := inherited GetDesignHitTest(X, Y, Shift); + if not Result then + begin + Result := GetTabAtPos(X, Y) <> nil; + end; +end; + +procedure TdxCustomRibbon.KeyDown(var Key: Word; Shift: TShiftState); +begin + Controller.KeyDown(Key, Shift); + inherited; +end; + +procedure TdxCustomRibbon.KeyPress(var Key: Char); +begin + Controller.KeyPress(Key); + inherited; +end; + +procedure TdxCustomRibbon.KeyUp(var Key: Word; Shift: TShiftState); +begin + Controller.KeyUp(Key, Shift); + inherited; +end; + +procedure TdxCustomRibbon.Loaded; +begin + BeginUpdate; + try + Tabs.UpdateBarManager(BarManager); + inherited Loaded; + if ActiveTab <> nil then + ActiveTab.CheckGroupToolbarsDockControl; + finally + EndUpdate; + end; +end; + +function TdxCustomRibbon.MayFocus: Boolean; +begin + Result := False; +end; + +procedure TdxCustomRibbon.Modified; +begin + if not FLockModified then + inherited; +end; + +procedure TdxCustomRibbon.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + Controller.MouseDown(Button, Shift, X, Y); +end; + +procedure TdxCustomRibbon.MouseLeave(AControl: TControl); +begin + inherited MouseLeave(AControl); + Controller.MouseLeave; +end; + +procedure TdxCustomRibbon.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + Controller.MouseMove(Shift, X, Y); +end; + +procedure TdxCustomRibbon.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + Controller.MouseUp(Button, Shift, X, Y); +end; + +procedure TdxCustomRibbon.Paint; +var + AControl: TWinControl; + P: TPoint; + R: TRect; +begin + if SupportNonClientDrawing and (FormCaptionHelper <> nil) then + begin + if ViewInfo.UseGlass then + begin + R := ClientRect; + R.Bottom := R.Top + FCalculatedFormCaptionHeight; + Canvas.FillRect(R, clBlack); + end; + FormCaptionHelper.UpdateCaptionArea; + end; + ViewInfo.Paint(Canvas); + if IsDesigning and (csPaintCopy in ControlState) and HandleAllocated then + begin + if ViewInfo.IsQATVisible then + begin + Canvas.SaveDC; + AControl := QuickAccessToolbar.Toolbar.Control; + P := cxNullPoint; + MapWindowPoint(AControl.Handle, Handle, P); + AControl.PaintTo(Canvas.Canvas.Handle, P.X, P.Y); + Canvas.RestoreDC; + end; + end; +end; + +function TdxCustomRibbon.NeedsScrollBars: Boolean; +begin + Result := False; +end; + +procedure TdxCustomRibbon.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if Operation = opRemove then + begin + if AComponent = BarManager then + BarManager := nil; + if not IsDestroying then + begin + if AComponent = HelpButtonScreenTip then + HelpButtonScreenTip := nil; + if AComponent = BarManager then + QuickAccessToolbar.Toolbar := nil; + if AComponent = ApplicationButton.Menu then + ApplicationButton.Menu := nil; + if AComponent = ApplicationButton.ScreenTip then + ApplicationButton.ScreenTip := nil; + if AComponent = QuickAccessToolbar.Toolbar then + QuickAccessToolbar.Toolbar := nil; + end; + end; +end; + +procedure TdxCustomRibbon.ReadState(Reader: TReader); +begin + if not FTabsLoaded then + begin + Tabs.Clear; + FTabsLoaded := True; + end; + inherited ReadState(Reader); +end; + +procedure TdxCustomRibbon.SetName(const Value: TComponentName); +begin + inherited SetName(Value); + if not FTabsLoaded and IsDesigning and (Tabs.Count > 0) then + begin + Tabs.SetItemName(Tabs[0]); + Tabs[0].Caption := Tabs[0].Name; + end; +end; + +procedure TdxCustomRibbon.SetParent(AParent: TWinControl); +begin + if Assigned(AParent) then + begin + AParent := GetParentForm(AParent{$IFDEF DELPHI9}, not (csDesigning in ComponentState){$ENDIF}); + if Assigned(AParent) and not (AParent is TCustomForm) then + raise Exception.CreateFmt(cxGetResourceString(@dxSBAR_RIBBONBADPARENT), [ClassName]); + end; + inherited SetParent(AParent); + Top := 0; + if FSupportNonClientDrawing and not IsLoading and (AParent <> nil) then + UpdateNonClientDrawing(True); +end; + +procedure TdxCustomRibbon.CalculateFormCaptionHeight; +var + H: Integer; +begin + if not SupportNonClientDrawing or (RibbonForm = nil) then Exit; + //text part + if ViewInfo.UseGlass then + H := GetSystemMetrics(SM_CYCAPTION) + GetDefaultWindowBordersWidth(RibbonForm.Handle).Top + else + H := Max(GetSystemMetrics(SM_CYCAPTION) - 1, GetSystemMetrics(SM_CYSIZE)) + 6; + H := Max(Abs(Fonts.GetFormCaptionFont(True).Height) * 2, H); + H := Max(Abs(Fonts.GetFormCaptionFont(False).Height) * 2, H); + //quick access toolbar + if ViewInfo.IsQATAtNonClientArea and IsBarManagerValid then + H := Max(GetGroupRowHeight + 9, H); + FCalculatedFormCaptionHeight := H; +end; + +procedure TdxCustomRibbon.CheckDrawRibbonFormStatusBarBorders(ACanvas: TcxCanvas; + const AData: TdxRibbonFormData; const ABordersWidth: TRect); +var + ATop, ABottom: Integer; + ALeftStatusBarBounds, ARightStatusBarBounds: TRect; + AIntf: IdxRibbonFormStatusBarDraw; + AIsRectangular: Boolean; +begin + if AData.State <> wsNormal then Exit; + AIntf := GetStatusBarInterface; + if AIntf <> nil then + begin + with AData.Bounds do + begin + ATop := Bottom - AIntf.GetHeight - 1; + ABottom := Bottom; + AIsRectangular := IsRectangularFormBottom(AData); + if not AIsRectangular then Dec(ABottom); + ALeftStatusBarBounds := cxRect(0, ATop, ABordersWidth.Left, ABottom); + ColorScheme.DrawFormStatusBarPart(ACanvas.Handle, + ALeftStatusBarBounds, True, AData.Active, AIntf.GetIsRaised(True), AIsRectangular); + ACanvas.ExcludeClipRect(ALeftStatusBarBounds); + ARightStatusBarBounds := cxRect(Right - ABordersWidth.Right, ATop, Right, ABottom); + ColorScheme.DrawFormStatusBarPart(ACanvas.Handle, + ARightStatusBarBounds, False, AData.Active, AIntf.GetIsRaised(False), AIsRectangular); + ACanvas.ExcludeClipRect(ARightStatusBarBounds); + end; + end; +end; + +procedure TdxCustomRibbon.DrawApplicationMenuHeader(ADC: THandle; AIsClientArea: Boolean); + + function GetImageBounds: TRect; + var + AWindowRect, AMenuWindowRect: TRect; + ASubMenuControl: TdxBarSubMenuControl; + ADestinationOrigin: TPoint; + begin + GetWindowRect(Handle, AWindowRect); + ASubMenuControl := ApplicationButton.Menu.SubMenuControl; + GetWindowRect(ASubMenuControl.Handle, AMenuWindowRect); + if AIsClientArea then + ADestinationOrigin := ASubMenuControl.ClientOrigin + else + ADestinationOrigin := AMenuWindowRect.TopLeft; + + Result := cxRectOffset(ViewInfo.ApplicationButtonImageBounds, + AWindowRect.Left - ADestinationOrigin.X, + AWindowRect.Top + (Height - ClientHeight) - ADestinationOrigin.Y); + end; + +begin + BarCanvas.BeginPaint(ADC); + try + Painter.DrawApplicationButton(BarCanvas, GetImageBounds, absPressed); + finally + BarCanvas.EndPaint; + end; +end; + +function TdxCustomRibbon.GetApplicationButtonIAccessibilityHelper: IdxBarAccessibilityHelper; +begin + Result := ApplicationButton.IAccessibilityHelper; +end; + +procedure TdxCustomRibbon.CancelUpdate; +begin + Dec(FLockCount); +end; + +function TdxCustomRibbon.CanFade: Boolean; +begin + Result := Fading and not (IsLocked or IsDesigning); +end; + +function TdxCustomRibbon.CanPaint: Boolean; +begin + Result := ComponentState * [csLoading, csReading, csDestroying] = []; +end; + +function TdxCustomRibbon.CreateApplicationButton: TdxRibbonApplicationButton; +begin + Result := TdxRibbonApplicationButton.Create(Self); +end; + +function TdxCustomRibbon.CreateController: TdxRibbonController; +begin + Result := TdxRibbonController.Create(Self); +end; + +function TdxCustomRibbon.CreateFormCaptionHelper: TdxRibbonFormCaptionHelper; +begin + Result := TdxRibbonFormCaptionHelper.Create(Self); +end; + +function TdxCustomRibbon.CreatePainter: TdxRibbonPainter; +begin + Result := TdxRibbonPainter.Create(Self); +end; + +function TdxCustomRibbon.CreateQuickAccessToolbar: TdxRibbonQuickAccessToolbar; +begin + Result := TdxRibbonQuickAccessToolbar.Create(Self); +end; + +function TdxCustomRibbon.CreateGroupsPainter: TdxRibbonBarPainter; +begin + Result := TdxRibbonBarPainter.Create(Integer(Self)); +end; + +function TdxCustomRibbon.CreateViewInfo: TdxRibbonViewInfo; +begin + Result := TdxRibbonViewInfo.Create(Self); +end; + +procedure TdxCustomRibbon.DesignAddTabGroup(ATab: TdxRibbonTab; ANewToolbar: Boolean); +var + AGroup: TdxRibbonTabGroup; +begin + if ATab = nil then + ATab := ActiveTab; + if (ATab = nil) or not IsDesigning then Exit; + if ANewToolbar then + begin + BarManager.BeginUpdate; + try + AGroup := ATab.Groups.Add; + AGroup.ToolBar := BarManager.AddToolBar; + BarDesignController.SelectItem(AGroup.ToolBar); + finally + BarManager.EndUpdate; + end; + end + else + ATab.Groups.Add.DesignSelectionHelper.SelectComponent; +end; + +function TdxCustomRibbon.DoApplicationMenuClick: Boolean; +begin + Result := False; + if Assigned(FOnApplicationMenuClick) then + FOnApplicationMenuClick(Self, Result); +end; + +procedure TdxCustomRibbon.DoHelpButtonClick; +begin + if Assigned(FOnHelpButtonClick) then + FOnHelpButtonClick(Self); +end; + +function TdxCustomRibbon.DoHideMinimizedByClick(AWnd: THandle; + AShift: TShiftState; const APos: TPoint): Boolean; +begin + Result := True; + if Assigned(FOnHideMinimizedByClick) then + FOnHideMinimizedByClick(Self, AWnd, AShift, APos, Result); +end; + +function TdxCustomRibbon.DoTabChanging(ANewTab: TdxRibbonTab): Boolean; +begin + Result := True; + if Assigned(FOnTabChanging) then + FOnTabChanging(Self, ANewTab, Result); +end; + +procedure TdxCustomRibbon.DoTabChanged; +begin + if Assigned(FOnTabChanged) then + FOnTabChanged(Self); +end; + +procedure TdxCustomRibbon.DoTabGroupCollapsed(ATab: TdxRibbonTab; + AGroup: TdxRibbonTabGroup); +begin + if Assigned(FOnTabGroupCollapsed) then + FOnTabGroupCollapsed(Self, ATab, AGroup); +end; + +procedure TdxCustomRibbon.DoTabGroupExpanded(ATab: TdxRibbonTab; + AGroup: TdxRibbonTabGroup); +begin + if Assigned(FOnTabGroupExpanded) then + FOnTabGroupExpanded(Self, ATab, AGroup); +end; + +procedure TdxCustomRibbon.DoMoreCommandsExecute; +begin + if Assigned(FOnMoreCommandsExecute) then + FOnMoreCommandsExecute(Self) + else + BarManager.Customizing(True); +end; + +function TdxCustomRibbon.GetVisibleTab(Index: Integer): TdxRibbonTab; +var + I, J: Integer; +begin + Result := nil; + J := 0; + for I := 0 to FTabs.Count - 1 do + if Tabs[I].Visible then + begin + if J = Index then + begin + Result := Tabs[I]; + break; + end; + Inc(J); + end; +end; + +function TdxCustomRibbon.GetVisibleTabCount: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to FTabs.Count - 1 do + if Tabs[I].Visible then Inc(Result); +end; + +procedure TdxCustomRibbon.InitCustomizePopupMenu(AItemLinks: TdxBarItemLinks); +var + AItems: TdxRibbonPopupMenuItems; +begin + AItems := PopupMenuItems - [rpmiItems, rpmiQATAddRemoveItem]; + if not IsQuickAccessToolbarValid then + Exclude(AItems, rpmiQATAddRemoveItem); + PopulatePopupMenuItems(AItemLinks, AItems, PopupMenuItemClick); +end; + +procedure TdxCustomRibbon.IniFileProceduresAdd; +begin + FBarManager.ReadIniFileHandlers.Add(BarManagerLoadIni); + FBarManager.WriteIniFileHandlers.Add(BarManagerSaveIni); +end; + +procedure TdxCustomRibbon.IniFileProceduresRemove; +begin + if BarManager <> nil then + begin + FBarManager.ReadIniFileHandlers.Remove(BarManagerLoadIni); + FBarManager.WriteIniFileHandlers.Remove(BarManagerSaveIni); + end; +end; + +function TdxCustomRibbon.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxRibbonAccessibilityHelper; +end; + +function TdxCustomRibbon.GetBar(ACustomizingBarControl: TCustomdxBarControl): TdxBar; +var + ABarControlAccess: TdxBarControlAccess; +begin + ABarControlAccess := TdxBarControlAccess(ACustomizingBarControl); + if ABarControlAccess.IsPopup then + Result := ABarControlAccess.PopupBar + else + Result := ABarControlAccess.Bar; +end; + +function TdxCustomRibbon.GetTabClass: TdxRibbonTabClass; +begin + Result := TdxRibbonTab; +end; + +function TdxCustomRibbon.IsBarManagerValid: Boolean; +begin + Result := (BarManager <> nil) and not (csDestroying in BarManager.ComponentState); +end; + +function TdxCustomRibbon.IsLocked: Boolean; +begin + Result := (FLockCount > 0) or not HandleAllocated or + not CanAllocateHandle(Self) or //todo: check condition + ([csDestroying, csLoading] * ComponentState <> []); +end; + +function TdxCustomRibbon.IsQuickAccessToolbarValid: Boolean; +begin + Result := QuickAccessToolbar.Visible and (QuickAccessToolbar.Toolbar <> nil); +end; + +procedure TdxCustomRibbon.Hide; +begin + if Hidden then Exit; + FHidden := True; + Changed; + RibbonFormInvalidate; +end; + +procedure TdxCustomRibbon.PopulatePopupMenuItems(ALinks: TdxBarItemLinks; + AItems: TdxRibbonPopupMenuItems; AOnClick: TNotifyEvent); + + function GetQATPositionButtonCaption: string; + begin + if QuickAccessToolbar.Position = qtpAboveRibbon then + Result := cxGetResourceString(@dxSBAR_SHOWBELOWRIBBON) + else + Result := cxGetResourceString(@dxSBAR_SHOWABOVERIBBON); + end; + + function AddMenuItem(const ACaption: string; ANeedSeparator: Boolean; + AItem: TdxRibbonPopupMenuItem; AData: TObject = nil): TdxBarButton; + begin + Result := TdxBarButton.Create(BarManager); + BarDesignController.AddInternalItem(Result, FInternalItems); + Result.Caption := ACaption; + Result.OnClick := AOnClick; + Result.Tag := Ord(AItem); + Result.Data := AData; + ALinks.Add(Result).BeginGroup := ANeedSeparator; + end; + + procedure AddQATItem; + + function GetEnabled: Boolean; + var + ABar: TdxBar; + I: Integer; + begin + if BarDesignController.CustomizingItemLink = nil then + begin + ABar := GetBar(BarDesignController.CustomizingBarControl); + Result := not QuickAccessToolbar.HasGroupButtonForToolbar(ABar); + end + else + begin + Result := IsQuickAccessToolbarValid; + if Result then + begin + ABar := QuickAccessToolbar.Toolbar; + for I := 0 to ABar.ItemLinks.Count - 1 do + if ABar.ItemLinks[I].Item = BarDesignController.CustomizingItemLink.Item then + begin + Result := False; + Break; + end; + end; + end; + end; + + function GetAddMessage: string; + begin + if (BarDesignController.CustomizingItemLink = nil) or + (BarDesignController.CustomizingItemLink.Item.GetAddMessageName = '') then + Result := cxGetResourceString(@dxSBAR_ADDTOQAT) + else + Result := Format(cxGetResourceString(@dxSBAR_ADDTOQATITEMNAME), + [BarDesignController.CustomizingItemLink.Item.GetAddMessageName]); + end; + + begin + if QuickAccessToolbar.Contains(BarDesignController.CustomizingItemLink) then + AddMenuItem(cxGetResourceString(@dxSBAR_REMOVEFROMQAT), False, rpmiQATAddRemoveItem) + else + AddMenuItem(GetAddMessage, False, rpmiQATAddRemoveItem, + BarDesignController.CustomizingBarControl).Enabled := GetEnabled; + end; + +var + ANeedSeparator: Boolean; + AButton: TdxBarButton; +begin + FInternalItems.Clear; + if not (rpmiItems in AItems) then + ALinks.Clear; + if rpmiQATAddRemoveItem in AItems then + AddQATItem; + ANeedSeparator := ALinks.Count > 0; + if rpmiMoreCommands in AItems then + begin + AddMenuItem(cxGetResourceString(@dxSBAR_MORECOMMANDS), ANeedSeparator, rpmiMoreCommands); + ANeedSeparator := False; + end; + if rpmiQATPosition in AItems then + AddMenuItem(GetQATPositionButtonCaption, ANeedSeparator, rpmiQATPosition); + if rpmiMinimizeRibbon in AItems then + begin + AButton := AddMenuItem(cxGetResourceString(@dxSBAR_MINIMIZERIBBON), True, rpmiMinimizeRibbon); + if not ShowTabGroups then + begin + AButton.ButtonStyle := bsChecked; + AButton.Down := True; + end; + AButton.Enabled := ViewInfo.TabsViewInfo.Count > 0; + end; +end; + +procedure TdxCustomRibbon.PopupMenuItemClick(Sender: TObject); + + procedure AddItemToQAT; + + procedure AddGroupButton; + var + AGroupButton: TdxRibbonQuickAccessGroupButton; + begin + AGroupButton := TdxRibbonQuickAccessGroupButton(QuickAccessToolbar.Toolbar.ItemLinks.AddItem(TdxRibbonQuickAccessGroupButton).Item); + AGroupButton.Toolbar := GetBar(TCustomdxBarControl(TdxBarItem(Sender).Data)); + end; + + var + ACustomizingLink: TdxBarItemLink; + begin + ACustomizingLink := BarDesignController.CustomizingItemLink; + if ACustomizingLink <> nil then + QuickAccessToolbar.Toolbar.ItemLinks.Add.Item := ACustomizingLink.Item + else + AddGroupButton; + end; + + procedure RemoveItemFromQAT; + var + ACustomizingLink: TdxBarItemLink; + begin + ACustomizingLink := BarDesignController.CustomizingItemLink; + if ACustomizingLink.Item is TdxRibbonQuickAccessGroupButton then + BarDesignController.DeleteCustomizingItem + else + begin + if ACustomizingLink.OriginalItemLink <> nil then + ACustomizingLink.OriginalItemLink.Free + else + BarDesignController.DeleteCustomizingItemLink; + end; + end; + +begin + case TdxRibbonPopupMenuItem(TdxBarButton(Sender).Tag) of + rpmiQATAddRemoveItem: + if QuickAccessToolbar.Contains(BarDesignController.CustomizingItemLink) then + RemoveItemFromQAT + else + AddItemToQAT; + rpmiMoreCommands: + DoMoreCommandsExecute; + rpmiQATPosition: + with QuickAccessToolbar do + begin + if Position = qtpAboveRibbon then + Position := qtpBelowRibbon + else + Position := qtpAboveRibbon; + end; + rpmiMinimizeRibbon: + ShowTabGroups := not ShowTabGroups; + end; +end; + +procedure TdxCustomRibbon.SetRedraw(ARedraw: Boolean); +begin + if not (HandleAllocated and Visible) then Exit; + if not ARedraw then + SendMessage(Handle, WM_SETREDRAW, 0, 0) + else + begin + SendMessage(Handle, WM_SETREDRAW, 1, 0); + FullInvalidate; + end; +end; + +procedure TdxCustomRibbon.ShowCustomizePopup; +begin + if not IsBarManagerValid then Exit; + BarDesignController.ShowCustomCustomizePopup(BarManager, InitCustomizePopupMenu, GroupsPainter); +end; + +procedure TdxCustomRibbon.UpdateControlsVisibility; +begin + QuickAccessToolbar.DockControl.Visible := not Hidden and + QuickAccessToolbar.Visible and (QuickAccessToolbar.Toolbar <> nil); + if ActiveTab <> nil then + ActiveTab.DockControl.Visible := not Hidden; + Changed; + RibbonFormInvalidate; +end; + +function TdxCustomRibbon.GetColorSchemeName: string; +begin + Result := FColorScheme.Name; +end; + +function TdxCustomRibbon.GetIAccessibilityHelper: IdxBarAccessibilityHelper; +begin + if FIAccessibilityHelper = nil then + FIAccessibilityHelper := dxBar.GetAccessibilityHelper(GetAccessibilityHelperClass.Create(Self)); + Result := FIAccessibilityHelper; +end; + +function TdxCustomRibbon.GetIniSection(const ADelimiter: string; + const ASection: string): string; +var + AOwner: TComponent; +begin + Result := Name; + AOwner := Owner; + while (AOwner <> nil) and (AOwner.Name <> '') do + begin + Result := AOwner.Name + '_' + Result; + AOwner := AOwner.Owner; + end; + + Result := ASection + Result; +end; + +function TdxCustomRibbon.GetIsPopupGroupsMode: Boolean; +begin + Result := (FTabGroupsPopupWindow <> nil) and FTabGroupsPopupWindow.IsVisible; +end; + +function TdxCustomRibbon.GetNextActiveTab(ATab: TdxRibbonTab): TdxRibbonTab; + + function GetIndex(ATab: TdxRibbonTab): Integer; + begin + if ATab = nil then + Result := 0 + else + if not (csDestroying in ATab.ComponentState) then + Result := ATab.Index + else + Result := ATab.LastIndex; + end; + +var + I, AIndex: Integer; +begin + Result := nil; + AIndex := GetIndex(ATab); + for I := AIndex to Tabs.Count - 1 do + if Tabs[I].Visible then + begin + Result := Tabs[I]; + Break; + end; + if Result = nil then + for I := AIndex - 1 downto 0 do + if Tabs[I].Visible then + begin + Result := Tabs[I]; + Break; + end; +end; + +function TdxCustomRibbon.GetQATIAccessibilityHelper: IdxBarAccessibilityHelper; +begin + if (QuickAccessToolbar.Toolbar <> nil) and (QuickAccessToolbar.Toolbar.Control <> nil) then + Result := QuickAccessToolbar.Toolbar.Control.IAccessibilityHelper + else + Result := nil; +end; + +function TdxCustomRibbon.GetRibbonForm: TdxCustomRibbonForm; +begin + if (Owner is TdxCustomRibbonForm) and not (csDestroying in Owner.ComponentState) then + Result := TdxCustomRibbonForm(Owner) + else + Result := nil; +end; + +function TdxCustomRibbon.GetStatusBarInterface: IdxRibbonFormStatusBarDraw; +var + I: Integer; + AForm: TCustomForm; +begin + Result := nil; + if SupportNonClientDrawing and not ViewInfo.UseGlass then + begin + AForm := RibbonForm; + if (AForm <> nil) and AForm.HandleAllocated and (AForm.WindowState = wsNormal) then + for I := 0 to FRibbonFormNonClientPainters.Count - 1 do + if Supports(TObject(FRibbonFormNonClientPainters[I]), IdxRibbonFormStatusBarDraw, Result) and Result.GetActive(AForm) then + Break + else + Result := nil; + end; +end; + +function TdxCustomRibbon.GetTabCount: Integer; +begin + Result := FTabs.Count; +end; + +function TdxCustomRibbon.GetTabsIAccessibilityHelper: IdxBarAccessibilityHelper; +begin + Result := Tabs.IAccessibilityHelper; +end; + +procedure TdxCustomRibbon.InitColorScheme; +var + I: Integer; +begin + for I := 0 to SkinManager.SkinCount - 1 do + if SkinManager[I] is TdxCustomRibbonSkin then + begin + ColorSchemeName := SkinManager[I].Name; + break; + end; +end; + +procedure TdxCustomRibbon.RibbonFormInvalidate; +begin + if not SupportNonClientDrawing then Exit; + WinControlFullInvalidate(RibbonForm); +end; + +procedure TdxCustomRibbon.SetActiveTab(Value: TdxRibbonTab); +begin + if (FActiveTab <> Value) and not (csDestroying in ComponentState) then + begin + if not IsDesigning then + begin + if IsBarManagerValid then + BarManager.HideAll; + Fader.Remove(FActiveTab); + Fader.Remove(Value); + if not DoTabChanging(Value) then Exit; + end; + CloseTabGroupsPopupWindow; + if FActiveTab <> nil then + FActiveTab.Deactivate; + FActiveTab := Value; + + if GroupsDockControlSite.HandleAllocated then + SendMessage(GroupsDockControlSite.Handle, WM_SETREDRAW, 0, 0); + try + if FActiveTab <> nil then + FActiveTab.Activate; + Changed; + DoTabChanged; + finally + Changed; + if GroupsDockControlSite.HandleAllocated then + begin + SendMessage(GroupsDockControlSite.Handle, WM_SETREDRAW, 1, 0); + GroupsDockControlSite.InvalidateWithChildren; + end; + end; + Modified; + end; +end; + +procedure TdxCustomRibbon.SetApplicationButton(const Value: TdxRibbonApplicationButton); +begin + FApplicationButton.Assign(Value); +end; + +procedure TdxCustomRibbon.SetApplicationButtonState(const Value: TdxApplicationButtonState); +begin + if FApplicationButtonState <> Value then + begin + FApplicationButtonState := Value; + InvalidateRect(ViewInfo.ApplicationButtonImageBounds, False); + end; +end; + +procedure TdxCustomRibbon.SetBarManager(Value: TdxBarManager); +var + ALockedBarManager: TdxBarManager; +begin + if FBarManager <> Value then + begin + ALockedBarManager := nil; + if IsBarManagerValid then + begin + FBarManager.MDIStateChangedHandlers.Remove(MDIStateChanged); + FBarManager.SystemFontChangedHandlers.Remove(SystemFontChanged); + FBarManager.RemoveFreeNotification(Self); + if Value = nil then + ALockedBarManager := FBarManager; + IniFileProceduresRemove; + end; + FBarManager := Value; + if IsBarManagerValid then + begin + FBarManager.MDIStateChangedHandlers.Add(MDIStateChanged); + FBarManager.SystemFontChangedHandlers.Add(SystemFontChanged); + FBarManager.FreeNotification(Self); + Fonts.UpdateFonts; + IniFileProceduresAdd; + end; + if Assigned(ALockedBarManager) then ALockedBarManager.BeginUpdate; + try + Tabs.UpdateBarManager(Value); + QuickAccessToolbar.DockControl.BarManager := Value; + finally + if Assigned(ALockedBarManager) then ALockedBarManager.EndUpdate; + end; + Changed; + end; +end; + +procedure TdxCustomRibbon.SetColorScheme(const Value: TdxCustomRibbonSkin); +begin + if (FColorScheme <> Value) and (Value <> nil) then + begin + FColorScheme := Value; + UpdateColorScheme; + Modified; + end; +end; + +procedure TdxCustomRibbon.SetColorSchemeName(const Value: string); +var + ASkin: TdxCustomBarSkin; +begin + ASkin := SkinManager.SkinByName(Value); + if ASkin is TdxCustomRibbonSkin then + ColorScheme := TdxCustomRibbonSkin(ASkin); +end; + +procedure TdxCustomRibbon.SetDocumentName(const Value: TCaption); +{$IFDEF DELPHI11} +var + AForm: TCustomForm; +{$ENDIF} +begin + if FDocumentName <> Value then + begin + FDocumentName := Value; + {$IFDEF DELPHI11} + AForm := RibbonForm; + if (AForm <> nil) and (Application.MainForm = AForm) and (AForm.HandleAllocated) then + SetWindowTextWithoutRedraw(AForm.Handle, ViewInfo.GetFormCaptionText); + {$ENDIF} + Changed; + end; +end; + +procedure TdxCustomRibbon.SetFading(const Value: Boolean); +begin + if FFading <> Value then + begin + FFading := Value; + if not Value then + Fader.Clear; + Invalidate; + end; +end; + +procedure TdxCustomRibbon.SetFonts(const Value: TdxRibbonFonts); +begin + FFonts.Assign(Value); +end; + +procedure TdxCustomRibbon.SetHelpButtonScreenTip(const Value: TdxBarScreenTip); +begin + if FHelpButtonScreenTip <> Value then + begin + if FHelpButtonScreenTip <> nil then + FHelpButtonScreenTip.RemoveFreeNotification(Self); + FHelpButtonScreenTip := Value; + if FHelpButtonScreenTip <> nil then + FHelpButtonScreenTip.FreeNotification(Self); + end; +end; + +procedure TdxCustomRibbon.SetHighlightedTab(const Value: TdxRibbonTab); +begin + if FHighlightedTab <> Value then + begin + if CanFade then + Fader.FadeOut(FHighlightedTab); + FHighlightedTab := Value; + if CanFade then + Fader.FadeIn(FHighlightedTab) + else + InvalidateRect(ViewInfo.GetTabsBounds, False); + end; +end; + +procedure TdxCustomRibbon.SetPopupMenuItems(const Value: TdxRibbonPopupMenuItems); +begin + if Value <> FPopupMenuItems then + begin + FPopupMenuItems := Value; + Changed; + end; +end; + +procedure TdxCustomRibbon.SetQuickAccessToolbar(const Value: TdxRibbonQuickAccessToolbar); +begin + FQuickAccessToolbar.Assign(Value); +end; + +procedure TdxCustomRibbon.SetShowTabGroups(const Value: Boolean); +begin + if FShowTabGroups <> Value then + begin + FShowTabGroups := Value; + CloseTabGroupsPopupWindow; + if not Value and (ActiveTab <> nil) then + ActiveTab.DockControl.Visible := False; + Changed; + end; +end; + +procedure TdxCustomRibbon.SetShowTabHeaders(const Value: Boolean); +begin + if FShowTabHeaders <> Value then + begin + FShowTabHeaders := Value; + CloseTabGroupsPopupWindow; + Changed; + InvalidateWithChildren; + end; +end; + +procedure TdxCustomRibbon.SetSupportNonClientDrawing(const Value: Boolean); +begin + if FSupportNonClientDrawing <> Value then + begin + FSupportNonClientDrawing := Value; + CloseTabGroupsPopupWindow; + if Value then + FFormCaptionHelper := CreateFormCaptionHelper + else + FreeAndNil(FFormCaptionHelper); + UpdateNonClientDrawing(Value); + end; +end; + +procedure TdxCustomRibbon.SetTabs(Value: TdxRibbonTabCollection); +begin + FTabs.Assign(Value); +end; + +procedure TdxCustomRibbon.UpdateColorSchemeListeners; +begin + FColorSchemeHandlers.CallEvents(Self, []); +end; + +procedure TdxCustomRibbon.UpdateNonClientDrawing(const Value: Boolean); +var + AForm: TdxCustomRibbonForm; +begin + AForm := RibbonForm; + if AForm <> nil then + begin + AForm.RibbonNonClientHelper := FFormCaptionHelper; + if IsCompositionEnabled and not IsDestroying and //ViewInfo.UseGlass? + AForm.HandleAllocated and IsZoomed(AForm.Handle) then + begin + RecreateWnd; + if Assigned(FFormCaptionHelper) then + FFormCaptionHelper.Resize; + end; + UpdateControlsVisibility; + end; +end; + +procedure TdxCustomRibbon.WMGetObject(var Message: TMessage); +begin +// if CanReturnAccessibleObject(Message) then +// Message.Result := WMGetObjectResultFromIAccessibilityHelper(Message, IAccessibilityHelper) +// else + inherited; +end; + +procedure TdxCustomRibbon.WMPaint(var Message: TWMPaint); +var + DC, MemDC: HDC; + MemBitmap, OldBitmap: HBITMAP; + PS: TPaintStruct; +begin + if not CanPaint then Exit; + if not FDoubleBuffered or (Message.DC <> 0) then + begin + if not (csCustomPaint in ControlState) and (ControlCount = 0) then + inherited + else + PaintHandler(Message); + end + else + begin + DC := BeginPaint(Handle, PS); + MemBitmap := CreateCompatibleBitmap(DC, PS.rcPaint.Right - PS.rcPaint.Left, + PS.rcPaint.Bottom - PS.rcPaint.Top); + MemDC := CreateCompatibleDC(DC); + try + OldBitmap := SelectObject(MemDC, MemBitmap); + try + SetWindowOrgEx(MemDC, PS.rcPaint.Left, PS.rcPaint.Top, nil); + Perform(WM_ERASEBKGND, MemDC, MemDC); + Message.DC := MemDC; + WMPaint(Message); + Message.DC := 0; + BitBlt(DC, PS.rcPaint.Left, PS.rcPaint.Top, + PS.rcPaint.Right - PS.rcPaint.Left, + PS.rcPaint.Bottom - PS.rcPaint.Top, + MemDC, + PS.rcPaint.Left, PS.rcPaint.Top, + SRCCOPY); + finally + SelectObject(MemDC, OldBitmap); + end; + finally + EndPaint(Handle, PS); + DeleteDC(MemDC); + DeleteObject(MemBitmap); + end; + end; +end; + +procedure TdxCustomRibbon.CMSelectAppMenuFirstItemControl( + var Message: TMessage); +begin + if Controller.IsApplicationMenuDropped then + SelectFirstSelectableAccessibleObject( + ApplicationButton.Menu.ItemLinks.BarControl.IAccessibilityHelper.GetBarHelper); +end; + +procedure TdxCustomRibbon.CMShowKeyTips(var Message: TMessage); +begin + if Controller.IsApplicationMenuDropped then + BarNavigationController.SetKeyTipsShowingState( + ApplicationButton.Menu.ItemLinks.BarControl.IAccessibilityHelper, ''); +end; + +procedure TdxCustomRibbon.ApplicationMenuPopupNotification(Sender: TObject); +begin + TCustomdxBarControlAccess(ApplicationButton.Menu.SubMenuControl).FPainter := GroupsPainter; + if Assigned(FPrevOnApplicationMenuPopup) then + FPrevOnApplicationMenuPopup(Sender); +end; + +procedure TdxCustomRibbon.BarManagerLoadIni(Sender: TObject; const AEventArgs); +var + ASection: string; + AEventData: TdxBarIniFileEventData; +begin + AEventData := TdxBarIniFileEventData(AEventArgs); + ASection := GetIniSection(AEventData.Delimiter, AEventData.BaseSection); + if AEventData.IniFile.SectionExists(ASection) then + begin + QuickAccessToolbar.Position := TdxQuickAccessToolbarPosition( + AEventData.IniFile.ReadInteger(ASection, 'QuickAccessToolbarPosition', 0)); + ShowTabGroups := AEventData.IniFile.ReadBool(ASection, 'ShowTabGroups', True); + end; +end; + +procedure TdxCustomRibbon.BarManagerSaveIni(Sender: TObject; const AEventArgs); +var + ASection: string; + AEventData: TdxBarIniFileEventData; +begin + AEventData := TdxBarIniFileEventData(AEventArgs); + ASection := GetIniSection(AEventData.Delimiter, AEventData.BaseSection); + AEventData.IniFile.WriteInteger(ASection, 'QuickAccessToolbarPosition', Ord(QuickAccessToolbar.Position)); + AEventData.IniFile.WriteBool(ASection, 'ShowTabGroups', ShowTabGroups); +end; + +procedure TdxCustomRibbon.MDIStateChanged(Sender: TObject; const AEventArgs); +var + AEventData: TdxBarMDIStateChangeEventData; + ABuffer: array[0..1023] of Char; + AForm: TForm; +begin + AForm := RibbonForm; + if not IsDesigning and (AForm <> nil) and (AForm.FormStyle = fsMDIForm) then + begin + AEventData := TdxBarMDIStateChangeEventData(AEventArgs); + if AEventData.Change in [scMaximizedChanged, scChildActivated] then + begin + if IsZoomed(AEventData.Wnd) then + begin + GetWindowText(AEventData.Wnd, PChar(@ABuffer), 1023); + DocumentName := PChar(@ABuffer); + end + else + DocumentName := ''; + end; + end; +end; + +procedure TdxCustomRibbon.SystemFontChanged(Sender: TObject; const AEventArgs); +begin + FontChanged; +end; + +procedure TdxCustomRibbon.UpdateColorScheme; +var + AForm: TCustomForm; + AValid: Boolean; +begin + AForm := GetParentForm(Self{$IFDEF DELPHI8}, False{$ENDIF}); + AValid := Assigned(AForm) and AForm.HandleAllocated and IsWindowVisible(AForm.Handle); + if AValid then + SendMessage(AForm.Handle, WM_SETREDRAW, 0, 0); + try + Fonts.UpdateFonts; + RecalculateBars; + Changed; + finally + UpdateColorSchemeListeners; + if AValid then + begin + SendMessage(AForm.Handle, WM_SETREDRAW, 1, 0); + WinControlFullInvalidate(AForm, True, True); + end; + end; +end; + +{ TdxRibbonQuickAccessGroupButton } + +function TdxRibbonQuickAccessGroupButton.IsToolbarAcceptable( + AToolbar: TdxBar): Boolean; +begin + Result := TdxBarManagerAccess(BarManager).IsInitializing or (AToolbar = nil) or (LinkCount = 0) or + IsToolbarDockedInRibbon(TdxRibbonQuickAccessDockControl(TdxBar(Links[0].Owner.Owner).RealDockControl).Ribbon, AToolbar) and + not HasGroupButtonForToolbar(TdxBar(Links[0].Owner.Owner), AToolbar); +end; + +function TdxRibbonQuickAccessGroupButton.CanBePlacedOn( + AParentKind: TdxBarItemControlParentKind; AToolbar: TdxBar; + out AErrorText: string): Boolean; +begin + Result := TdxBarManagerAccess(BarManager).IsInitializing; + if Result then + Exit; + if (AParentKind <> pkBar) or + not GetBarControlClass(AToolbar).InheritsFrom(TdxRibbonQuickAccessBarControl) then + begin + AErrorText := cxGetResourceString(@dxSBAR_CANTPLACEQUICKACCESSGROUPBUTTON); + Exit; + end; + if (Toolbar <> nil) and not ((Toolbar.DockControl is TdxRibbonGroupsDockControl) and + (TdxRibbonGroupsDockControl(Toolbar.DockControl).BarManager = BarManager)) then + begin + AErrorText := cxGetResourceString(@dxSBAR_QUICKACCESSGROUPBUTTONTOOLBARNOTDOCKEDINRIBBON); + Exit; + end; + if HasGroupButtonForToolbar(AToolbar, Toolbar) then + begin + AErrorText := cxGetResourceString(@dxSBAR_QUICKACCESSALREADYHASGROUPBUTTON); + Exit; + end; + Result := True; +end; + +procedure TdxRibbonQuickAccessGroupButton.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (AComponent = Toolbar) then + Toolbar := nil; +end; + +function TdxRibbonQuickAccessGroupButton.GetCaption: string; +begin + if Toolbar = nil then + Result := 'GroupButton' + else + Result := Toolbar.Caption; +end; + +function TdxRibbonQuickAccessGroupButton.IsCaptionStored: Boolean; +begin + Result := False; +end; + +procedure TdxRibbonQuickAccessGroupButton.SetCaption(const Value: string); +begin +end; + +function TdxRibbonQuickAccessGroupButton.HasGroupButtonForToolbar( + AParentBar, AToolbar: TdxBar): Boolean; +var + AParentBarItemLinks: TdxBarItemLinks; + I: Integer; +begin + Result := False; + if AToolbar <> nil then + begin + if AParentBar.Control <> nil then + AParentBarItemLinks := AParentBar.Control.ItemLinks + else + AParentBarItemLinks := AParentBar.ItemLinks; + for I := 0 to AParentBarItemLinks.Count - 1 do + if not TdxBarItemLinkAccess(AParentBarItemLinks[I]).IsMarkedForDeletion and + (AParentBarItemLinks[I].Item is TdxRibbonQuickAccessGroupButton) and + (TdxRibbonQuickAccessGroupButton(AParentBarItemLinks[I].Item).Toolbar = AToolbar) then + begin + Result := True; + Break; + end; + end; +end; + +function TdxRibbonQuickAccessGroupButton.IsToolbarDockedInRibbon( + ARibbon: TdxCustomRibbon; AToolbar: TdxBar): Boolean; +begin + Result := (AToolbar.DockControl is TdxRibbonGroupsDockControl) and + (TdxRibbonGroupsDockControl(AToolbar.DockControl).Ribbon = ARibbon); +end; + +procedure TdxRibbonQuickAccessGroupButton.SetToolbar(Value: TdxBar); +begin + if not IsToolbarAcceptable(Value) then + Exit; + if Value <> FToolbar then + begin + if FToolbar <> nil then + FToolbar.RemoveFreeNotification(Self); + FToolbar := Value; + if FToolbar <> nil then + FToolbar.FreeNotification(Self); + ToolbarChanged; + end; +end; + +procedure TdxRibbonQuickAccessGroupButton.ToolbarChanged; +begin + Update; +end; + +{ TdxRibbonQuickAccessGroupButtonPopupBarControl } + +constructor TdxRibbonQuickAccessGroupButtonPopupBarControl.CreateForPopup( + AGroupButtonControl: TdxRibbonQuickAccessGroupButtonControl); +begin + inherited CreateForPopup(TdxBarControl(AGroupButtonControl.Parent), + TdxRibbonQuickAccessGroupButton(AGroupButtonControl.Item).Toolbar); + FGroupButtonControl := AGroupButtonControl; +end; + +procedure TdxRibbonQuickAccessGroupButtonPopupBarControl.CloseUp; +begin + FGroupButtonControl.ClosePopup; +end; + +function TdxRibbonQuickAccessGroupButtonPopupBarControl.CanActiveChange: Boolean; +begin + Result := not FIsActiveChangeLocked and inherited CanActiveChange; +end; + +procedure TdxRibbonQuickAccessGroupButtonPopupBarControl.CreateWnd; +begin + inherited CreateWnd; + IsActive := True; +end; + +procedure TdxRibbonQuickAccessGroupButtonPopupBarControl.DestroyWnd; +begin + if FGroupButtonControl.MousePressed then + TdxRibbonQuickAccessBarControl(FGroupButtonControl.Parent).IgnoreMouseClick := True; + inherited DestroyWnd; +end; + +procedure TdxRibbonQuickAccessGroupButtonPopupBarControl.FocusItemControl( + AItemControl: TdxBarItemControl); +begin + if AItemControl <> nil then + begin + FIsActiveChangeLocked := True; + try + inherited FocusItemControl(AItemControl); + finally + FIsActiveChangeLocked := False; + end; + end; +end; + +function TdxRibbonQuickAccessGroupButtonPopupBarControl.GetBehaviorOptions: TdxBarBehaviorOptions; +begin + Result := inherited GetBehaviorOptions + [bboNeedsFocusWhenActive]; +end; + +procedure TdxRibbonQuickAccessGroupButtonPopupBarControl.HideAllByEscape; +var + AGroupButtonControlToSelect: TdxRibbonQuickAccessGroupButtonControl; +begin + if BarNavigationController.NavigationMode then + AGroupButtonControlToSelect := FGroupButtonControl + else + AGroupButtonControlToSelect := nil; + inherited HideAllByEscape; + if AGroupButtonControlToSelect <> nil then + AGroupButtonControlToSelect.IAccessibilityHelper.Select(False); +end; + +{ TdxRibbonQuickAccessGroupButtonControl } + +destructor TdxRibbonQuickAccessGroupButtonControl.Destroy; +begin + ClosePopup; + inherited Destroy; +end; + +function TdxRibbonQuickAccessGroupButtonControl.IsDroppedDown: Boolean; +begin + Result := FPopupBarControl <> nil; +end; + +procedure TdxRibbonQuickAccessGroupButtonControl.CalcDrawParams(AFull: Boolean = True); +begin + inherited CalcDrawParams(AFull); + DrawParams.DroppedDown := IsDroppedDown; + DrawParams.Enabled := DrawParams.Enabled and (Item.IsDesigning or (Item.Toolbar <> nil)); +end; + +function TdxRibbonQuickAccessGroupButtonControl.CanActivate: Boolean; +begin + Result := not BarManager.Designing and inherited CanActivate; +end; + +procedure TdxRibbonQuickAccessGroupButtonControl.ControlClick(AByMouse: Boolean; + AKey: Char = #0); +begin + inherited ControlClick(AByMouse, AKey); + if TdxRibbonQuickAccessBarControl(Parent).IsDowned then + ControlActivate(True); +end; + +procedure TdxRibbonQuickAccessGroupButtonControl.DoCloseUp( + AHadSubMenuControl: Boolean); +begin + ClosePopup; + Repaint; +end; + +procedure TdxRibbonQuickAccessGroupButtonControl.DoDropDown(AByMouse: Boolean); +var + AToolbar: TdxBar; + R: TRect; +begin + AToolbar := Item.Toolbar; + if AToolbar <> nil then + begin + FPopupBarControl := TdxRibbonQuickAccessGroupButtonPopupBarControl.CreateForPopup(Self); + R := ItemLink.ItemRect; + R.TopLeft := Parent.ClientToScreen(R.TopLeft); + R.BottomRight := Parent.ClientToScreen(R.BottomRight); + FPopupBarControl.Popup(R); + if BarNavigationController.NavigationMode and not BarNavigationController.KeyTipsHandlingMode then + SelectFirstSelectableAccessibleObject(FPopupBarControl.IAccessibilityHelper.GetBarHelper); + Repaint; + end; +end; + +procedure TdxRibbonQuickAccessGroupButtonControl.DoPaint(ARect: TRect; + PaintType: TdxBarPaintType); +begin + TdxRibbonQuickAccessPainter(Painter).DrawGroupButtonControl(DrawParams, ARect); +end; + +procedure TdxRibbonQuickAccessGroupButtonControl.DropDown(AByMouse: Boolean); +begin + inherited DropDown(AByMouse); + Click(AByMouse); +end; + +function TdxRibbonQuickAccessGroupButtonControl.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxRibbonQuickAccessGroupButtonControlAccessibilityHelper; +end; + +function TdxRibbonQuickAccessGroupButtonControl.GetCurrentImage( + AViewSize: TdxBarItemControlViewSize; ASelected: Boolean; + out ACurrentGlyph: TBitmap; out ACurrentImages: TCustomImageList; + out ACurrentImageIndex: Integer): Boolean; +begin + if Item.Toolbar <> nil then + ACurrentGlyph := Item.Toolbar.Glyph + else + ACurrentGlyph := nil; + if (ACurrentGlyph <> nil) and ACurrentGlyph.Empty then + ACurrentGlyph := nil; + ACurrentImages := nil; + Result := ACurrentGlyph <> nil; +end; + +function TdxRibbonQuickAccessGroupButtonControl.GetHint: string; +begin + Result := ItemLink.Caption; +end; + +function TdxRibbonQuickAccessGroupButtonControl.GetViewStructure: TdxBarItemControlViewStructure; +begin + Result := [cpIcon]; +end; + +function TdxRibbonQuickAccessGroupButtonControl.IsDestroyOnClick: Boolean; +begin + Result := False; +end; + +function TdxRibbonQuickAccessGroupButtonControl.IsDropDown: Boolean; +begin + Result := True; +end; + +procedure TdxRibbonQuickAccessGroupButtonControl.ClosePopup; +begin + FreeAndNil(FPopupBarControl); +end; + +function TdxRibbonQuickAccessGroupButtonControl.GetItem: TdxRibbonQuickAccessGroupButton; +begin + Result := TdxRibbonQuickAccessGroupButton(inherited Item); +end; + +{ TdxAddGroupButtonEditor } + +class function TdxAddGroupButtonEditor.GetAddedItemClass( + const AAddedItemName: string): TdxBarItemClass; +begin + Result := TdxRibbonQuickAccessGroupButton; +end; + +class function TdxAddGroupButtonEditor.GetPopupItemCaption: string; +begin + Result := dxSBAR_CP_ADDGROUPBUTTON; +end; + +{ TdxRibbonAccessibilityHelper } + +// IdxBarAccessibilityHelper +function TdxRibbonAccessibilityHelper.AreKeyTipsSupported( + out AKeyTipWindowsManager: IdxBarKeyTipWindowsManager): Boolean; +begin + Result := True; + if FKeyTipWindowsManager = nil then + FKeyTipWindowsManager := TdxRibbonKeyTipWindows.Create(Ribbon); + AKeyTipWindowsManager := FKeyTipWindowsManager; +end; + +function TdxRibbonAccessibilityHelper.GetBarManager: TdxBarManager; +begin + Result := Ribbon.BarManager; +end; + +function TdxRibbonAccessibilityHelper.GetDefaultAccessibleObject: IdxBarAccessibilityHelper; +begin + Result := nil; + if Ribbon.AreGroupsVisible then + Result := Ribbon.TabsIAccessibilityHelper.GetDefaultAccessibleObject; + if (Result = nil) and Ribbon.ApplicationButtonIAccessibilityHelper.GetHelper.Visible then + Result := Ribbon.ApplicationButtonIAccessibilityHelper; +end; + +function TdxRibbonAccessibilityHelper.GetChild( + AIndex: Integer): TcxAccessibilityHelper; +begin + Result := nil; + case AIndex of + 0: Result := Ribbon.ApplicationButtonIAccessibilityHelper.GetHelper; + 1: Result := Ribbon.TabsIAccessibilityHelper.GetHelper; + 2: Result := Ribbon.QATIAccessibilityHelper.GetHelper; + end; +end; + +function TdxRibbonAccessibilityHelper.GetChildCount: Integer; +begin + Result := 2; + if Ribbon.QATIAccessibilityHelper <> nil then + Inc(Result); +end; + +function TdxRibbonAccessibilityHelper.GetChildIndex( + AChild: TcxAccessibilityHelper): Integer; +begin + Result := -1; + if AChild = Ribbon.ApplicationButtonIAccessibilityHelper.GetHelper then + Result := 0 + else + if AChild = Ribbon.TabsIAccessibilityHelper.GetHelper then + Result := 1 + else + if (Ribbon.QATIAccessibilityHelper.GetHelper <> nil) and (AChild = Ribbon.QATIAccessibilityHelper.GetHelper) then + Result := 2; +end; + +function TdxRibbonAccessibilityHelper.GetOwnerObjectWindow: HWND; +begin + if Ribbon.HandleAllocated then + Result := Ribbon.Handle + else + Result := 0; +end; + +function TdxRibbonAccessibilityHelper.GetScreenBounds( + AChildID: TcxAccessibleSimpleChildElementID): TRect; +begin + if Visible then + GetWindowRect(GetOwnerObjectWindow, Result) + else + Result := cxEmptyRect; +end; + +function TdxRibbonAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +var + AHandle: HWND; +begin + Result := cxSTATE_SYSTEM_NORMAL; + AHandle := GetOwnerObjectWindow; + if (AHandle = 0) or not IsWindowVisible(AHandle) then + Result := Result or cxSTATE_SYSTEM_INVISIBLE; +end; + +//function TdxRibbonAccessibilityHelper.ChildIsSimpleElement( +// AIndex: Integer): Boolean; +//begin +// Result := False; +//end; +// +//function TdxRibbonAccessibilityHelper.GetChildIndex( +// AChild: TcxAccessibilityHelper): Integer; +//begin +// Result := 0; +//end; +// +//function TdxRibbonAccessibilityHelper.GetName( +// AChildID: TcxAccessibleSimpleChildElementID): string; +//begin +// Result := cxGetResourceString(@dxSBAR_ACCESSIBILITY_RIBBONNAME); +//end; +// +//function TdxRibbonAccessibilityHelper.GetRole( +// AChildID: TcxAccessibleSimpleChildElementID): Integer; +//begin +// Result := cxROLE_SYSTEM_WINDOW; +//end; +// +//function TdxRibbonAccessibilityHelper.GetSupportedProperties( +// AChildID: TcxAccessibleSimpleChildElementID): TcxAccessibleObjectProperties; +//begin +// Result := [aopLocation]; +//end; + +function TdxRibbonAccessibilityHelper.LogicalNavigationGetChild( + AIndex: Integer): TdxBarAccessibilityHelper; +begin + Result := nil; + case AIndex of + 0: Result := Ribbon.TabsIAccessibilityHelper.GetBarHelper; + 1: Result := Ribbon.ApplicationButtonIAccessibilityHelper.GetBarHelper; + 2: Result := Ribbon.QATIAccessibilityHelper.GetBarHelper; + end; +end; + +function TdxRibbonAccessibilityHelper.LogicalNavigationGetChildIndex( + AChild: TdxBarAccessibilityHelper): Integer; +begin + Result := 0; + if AChild = Ribbon.TabsIAccessibilityHelper.GetBarHelper then + Exit; + Inc(Result); + + if AChild = Ribbon.ApplicationButtonIAccessibilityHelper.GetBarHelper then + Exit; + Inc(Result); + + if (Ribbon.QATIAccessibilityHelper.GetBarHelper <> nil) and (AChild = Ribbon.QATIAccessibilityHelper.GetBarHelper) then + Exit; + + Result := -1; +end; + +function TdxRibbonAccessibilityHelper.GetRibbon: TdxCustomRibbon; +begin + Result := TdxCustomRibbon(FOwnerObject); +end; + +{ TdxRibbonTabCollectionAccessibilityHelper } + +// IdxBarAccessibilityHelper +function TdxRibbonTabCollectionAccessibilityHelper.GetBarManager: TdxBarManager; +begin + Result := TabCollection.Owner.BarManager; +end; + +function TdxRibbonTabCollectionAccessibilityHelper.GetDefaultAccessibleObject: IdxBarAccessibilityHelper; +begin + if TabCollection.Owner.ActiveTab <> nil then + Result := TabCollection.Owner.ActiveTab.IAccessibilityHelper + else + Result := nil; +end; + +function TdxRibbonTabCollectionAccessibilityHelper.GetChild( + AIndex: Integer): TcxAccessibilityHelper; +begin + Result := TabCollection[AIndex].IAccessibilityHelper.GetHelper; +end; + +function TdxRibbonTabCollectionAccessibilityHelper.GetChildCount: Integer; +begin + Result := TabCollection.Count; +end; + +function TdxRibbonTabCollectionAccessibilityHelper.GetChildIndex( + AChild: TcxAccessibilityHelper): Integer; +begin + if (AChild is TdxRibbonTabAccessibilityHelper) and (TdxRibbonTabAccessibilityHelper(AChild).Parent = Self) then + Result := TdxRibbonTabAccessibilityHelper(AChild).Tab.Index + else + Result := -1; +end; + +function TdxRibbonTabCollectionAccessibilityHelper.GetOwnerObjectWindow: HWND; +begin + Result := Parent.OwnerObjectWindow; +end; + +function TdxRibbonTabCollectionAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := TabCollection.Owner.IAccessibilityHelper.GetHelper; +end; + +function TdxRibbonTabCollectionAccessibilityHelper.GetScreenBounds( + AChildID: TcxAccessibleSimpleChildElementID): TRect; +begin + if Visible then + begin + Result := TabCollection.Owner.ViewInfo.TabsViewInfo.Bounds; + with TabCollection.Owner do + begin + Result.TopLeft := ClientToScreen(Result.TopLeft); + Result.BottomRight := ClientToScreen(Result.BottomRight); + end; + end + else + Result := cxEmptyRect; +end; + +function TdxRibbonTabCollectionAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := Parent.States[cxAccessibleObjectSelfID]; + if not TabCollection.Owner.ViewInfo.IsTabsVisible then + Result := Result or cxSTATE_SYSTEM_INVISIBLE; +end; + +//function TdxRibbonTabCollectionAccessibilityHelper.ChildIsSimpleElement( +// AIndex: Integer): Boolean; +//begin +// Result := False; +//end; +// +//function TdxRibbonTabCollectionAccessibilityHelper.GetChildIndex( +// AChild: TcxAccessibilityHelper): Integer; +//var +// I: Integer; +//begin +// Result := -1; +// for I := 0 to TabCollection.Count - 1 do +// if GetChild(I) = AChild then +// begin +// Result := I; +// Break; +// end; +//end; +// +//function TdxRibbonTabCollectionAccessibilityHelper.GetName( +// AChildID: TcxAccessibleSimpleChildElementID): string; +//begin +// Result := cxGetResourceString(@dxSBAR_ACCESSIBILITY_RIBBONTABCOLLECTIONNAME); +//end; +// +//function TdxRibbonTabCollectionAccessibilityHelper.GetRole( +// AChildID: TcxAccessibleSimpleChildElementID): Integer; +//begin +// Result := cxROLE_SYSTEM_PAGETABLIST; +//end; +// +//function TdxRibbonTabCollectionAccessibilityHelper.GetSupportedProperties( +// AChildID: TcxAccessibleSimpleChildElementID): TcxAccessibleObjectProperties; +//begin +// Result := [aopLocation]; +//end; + +function TdxRibbonTabCollectionAccessibilityHelper.LogicalNavigationGetChild( + AIndex: Integer): TdxBarAccessibilityHelper; +begin + if TabCollection.Owner.AreGroupsVisible then + Result := TabCollection.Owner.ActiveTab.IAccessibilityHelper.GetBarHelper + else + Result := GetFirstSelectableObject; +end; + +function TdxRibbonTabCollectionAccessibilityHelper.LogicalNavigationGetChildCount: Integer; +var + AAreGroupsVisible: Boolean; +begin + AAreGroupsVisible := TabCollection.Owner.AreGroupsVisible; + if AAreGroupsVisible and (TabCollection.Owner.ActiveTab <> nil) or + not AAreGroupsVisible and (GetFirstSelectableObject <> nil) then + Result := 1 + else + Result := 0; +end; + +function TdxRibbonTabCollectionAccessibilityHelper.LogicalNavigationGetChildIndex( + AChild: TdxBarAccessibilityHelper): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to LogicalNavigationGetChildCount - 1 do + if AChild = LogicalNavigationGetChild(I) then + begin + Result := I; + Break; + end; +end; + +function TdxRibbonTabCollectionAccessibilityHelper.GetTabCollection: TdxRibbonTabCollection; +begin + Result := TdxRibbonTabCollection(FOwnerObject); +end; + +{ TdxRibbonTabAccessibilityHelper } + +procedure TdxRibbonTabAccessibilityHelper.CloseUpHandler( + AClosedByEscape: Boolean); +begin + if AClosedByEscape and BarNavigationController.NavigationMode then + Select(False); +end; + +// IdxBarAccessibilityHelper +function TdxRibbonTabAccessibilityHelper.GetBarManager: TdxBarManager; +begin + Result := Tab.Ribbon.BarManager; +end; + +function TdxRibbonTabAccessibilityHelper.GetNextAccessibleObject( + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; +var + ADockControlObject, ATabCollectionObject: TdxBarAccessibilityHelper; + AStep, I: Integer; +begin + Result := nil; + case ADirection of + andLeft, andRight: + begin + ATabCollectionObject := Parent; + if ADirection = andLeft then + begin + I := ATabCollectionObject.ChildCount - 1; + AStep := -1; + end + else + begin + I := 0; + AStep := 1; + end; + while ATabCollectionObject.Childs[I] <> Self do + Inc(I, AStep); + I := ATabCollectionObject.GetNextSelectableChildIndex(I, ADirection = andRight); + if I <> -1 then + Result := ATabCollectionObject.Childs[I] + else + if Tab.Ribbon.ApplicationButtonIAccessibilityHelper.GetHelper.Selectable then + Result := Tab.Ribbon.ApplicationButtonIAccessibilityHelper; + end; + andUp: + if Tab.Ribbon.QATIAccessibilityHelper = nil then + Result := Self; + andDown: + begin + ADockControlObject := Tab.DockControl.IAccessibilityHelper.GetBarHelper; + if ADockControlObject.Visible then + Result := ADockControlObject.GetFirstSelectableObject; + end; + end; + if Result = nil then + Result := inherited GetNextAccessibleObject(ADirection); +end; + +function TdxRibbonTabAccessibilityHelper.HandleNavigationKey( + var AKey: Word): Boolean; +begin + Result := inherited HandleNavigationKey(AKey); + if not Result and not Tab.Ribbon.AreGroupsVisible then + begin + Result := AKey in [VK_RETURN, VK_SPACE]; + if Result then + begin + Tab.Active := True; + Tab.Ribbon.ShowTabGroupsPopupWindow; + SelectFirstSelectableAccessibleObject(Tab.DockControl.IAccessibilityHelper.GetBarHelper); + end; + end; +end; + +function TdxRibbonTabAccessibilityHelper.IsNavigationKey(AKey: Word): Boolean; +begin + Result := inherited IsNavigationKey(AKey) or (AKey = VK_ESCAPE); + if not Tab.Ribbon.AreGroupsVisible then + Result := Result or (AKey in [VK_RETURN, VK_SPACE]); +end; + +function TdxRibbonTabAccessibilityHelper.LogicalNavigationGetNextAccessibleObject( + AGoForward: Boolean): IdxBarAccessibilityHelper; +begin + if AGoForward then + Result := LogicalNavigationGetNextChild(-1, True) + else + Result := inherited LogicalNavigationGetNextAccessibleObject(AGoForward); +end; + +procedure TdxRibbonTabAccessibilityHelper.Select(ASetFocus: Boolean); +begin + inherited Select(ASetFocus); + if Tab.Ribbon.AreGroupsVisible then + Tab.Active := True; + Tab.Invalidate; +end; + +procedure TdxRibbonTabAccessibilityHelper.Unselect( + ANextSelectedObject: IdxBarAccessibilityHelper); +begin + inherited Unselect(ANextSelectedObject); + Tab.Invalidate; +end; + +function TdxRibbonTabAccessibilityHelper.GetChild( + AIndex: Integer): TcxAccessibilityHelper; +begin + Result := Tab.DockControl.IAccessibilityHelper.GetHelper; +end; + +function TdxRibbonTabAccessibilityHelper.GetChildCount: Integer; +begin + Result := 1; +end; + +function TdxRibbonTabAccessibilityHelper.GetChildIndex( + AChild: TcxAccessibilityHelper): Integer; +begin + if AChild = Tab.DockControl.IAccessibilityHelper.GetHelper then + Result := 0 + else + Result := -1; +end; + +function TdxRibbonTabAccessibilityHelper.GetOwnerObjectWindow: HWND; +begin + Result := Parent.OwnerObjectWindow; +end; + +function TdxRibbonTabAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := TdxRibbonTabCollection(Tab.Collection).IAccessibilityHelper.GetHelper; +end; + +function TdxRibbonTabAccessibilityHelper.GetScreenBounds( + AChildID: TcxAccessibleSimpleChildElementID): TRect; +begin + if Visible then + begin + Result := Tab.ViewInfo.Bounds; + Result.TopLeft := Tab.Ribbon.ClientToScreen(Result.TopLeft); + Result.BottomRight := Tab.Ribbon.ClientToScreen(Result.BottomRight); + end + else + Result := cxEmptyRect; +end; + +function TdxRibbonTabAccessibilityHelper.GetSelectable: Boolean; +begin + Result := Visible; +end; + +function TdxRibbonTabAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := Parent.States[cxAccessibleObjectSelfID]; + if not Tab.Visible then + Result := Result or cxSTATE_SYSTEM_INVISIBLE; +end; + +function TdxRibbonTabAccessibilityHelper.GetAssignedKeyTip: string; +begin + Result := Tab.KeyTip; + if (Length(Result) > 0) and (Result[1] in ['0'..'9']) then + Result := ''; +end; + +function TdxRibbonTabAccessibilityHelper.GetDefaultKeyTip: string; +begin + Result := 'Y'; +end; + +procedure TdxRibbonTabAccessibilityHelper.GetKeyTipInfo(out AKeyTipInfo: TdxBarKeyTipInfo); +var + ABasePoint: TPoint; + ATextMetric: TTextMetric; +begin + inherited; + with TcxScreenCanvas.Create do + try + Font := Self.Tab.ViewInfo.Font; + GetTextMetrics(Handle, ATextMetric); + finally + Free; + end; + with Tab.ViewInfo.TextBounds do + begin + ABasePoint.X := (Left + Right) div 2; + ABasePoint.Y := Bottom - ATextMetric.tmDescent; + end; + AKeyTipInfo.BasePoint := Tab.Ribbon.ClientToScreen(ABasePoint); + AKeyTipInfo.HorzAlign := taCenter; + AKeyTipInfo.VertAlign := vaBottom; + AKeyTipInfo.Enabled := True; +end; + +procedure TdxRibbonTabAccessibilityHelper.KeyTipHandler(Sender: TObject); +begin + BarNavigationController.ChangeSelectedObject(True, Self); + if not Tab.Ribbon.AreGroupsVisible then + begin + Tab.Active := True; + BarNavigationController.UnselectAssignedSelectedObject; + Tab.Ribbon.ShowTabGroupsPopupWindow; + end; + BarNavigationController.SetKeyTipsShowingState(Self, ''); +end; + +procedure TdxRibbonTabAccessibilityHelper.KeyTipsEscapeHandler; +begin + Tab.Ribbon.CloseTabGroupsPopupWindow; + inherited KeyTipsEscapeHandler; +end; + +function TdxRibbonTabAccessibilityHelper.GetTab: TdxRibbonTab; +begin + Result := TdxRibbonTab(FOwnerObject); +end; + +{ TdxRibbonApplicationButtonAccessibilityHelper } + +// IdxBarAccessibilityHelper +function TdxRibbonApplicationButtonAccessibilityHelper.GetBarManager: TdxBarManager; +begin + Result := Ribbon.BarManager; +end; + +function TdxRibbonApplicationButtonAccessibilityHelper.GetNextAccessibleObject( + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; +var + ATabIndex: Integer; +begin + Result := nil; + case ADirection of + andLeft, andRight: + begin + ATabIndex := Ribbon.TabsIAccessibilityHelper.GetHelper.GetNextSelectableChildIndex( + -1, ADirection = andRight); + if ATabIndex <> -1 then + Result := Ribbon.TabsIAccessibilityHelper.GetBarHelper.Childs[ATabIndex]; + end; + andUp: + Result := Self; + end; + if Result = nil then + Result := inherited GetNextAccessibleObject(ADirection); +end; + +function TdxRibbonApplicationButtonAccessibilityHelper.HandleNavigationKey( + var AKey: Word): Boolean; +begin + Result := inherited HandleNavigationKey(AKey); + if Result then + Exit; + Result := AKey in [VK_DOWN, VK_SPACE]; + if Result and (Ribbon.ApplicationButton.Menu <> nil) then + ShowApplicationMenu(CM_SELECTAPPMENUFIRSTITEMCONTROL); +end; + +function TdxRibbonApplicationButtonAccessibilityHelper.IsNavigationKey( + AKey: Word): Boolean; +begin + Result := inherited IsNavigationKey(AKey) or (AKey in [VK_ESCAPE, VK_SPACE]); +end; + +procedure TdxRibbonApplicationButtonAccessibilityHelper.Select(ASetFocus: Boolean); +begin + inherited Select(ASetFocus); + Ribbon.InvalidateRect(Ribbon.ViewInfo.ApplicationButtonBounds, False); +end; + +procedure TdxRibbonApplicationButtonAccessibilityHelper.Unselect( + ANextSelectedObject: IdxBarAccessibilityHelper); +begin + inherited Unselect(ANextSelectedObject); + Ribbon.InvalidateRect(Ribbon.ViewInfo.ApplicationButtonBounds, False); +end; + +function TdxRibbonApplicationButtonAccessibilityHelper.GetOwnerObjectWindow: HWND; +begin + Result := Parent.OwnerObjectWindow; +end; + +function TdxRibbonApplicationButtonAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := Ribbon.IAccessibilityHelper.GetHelper; +end; + +function TdxRibbonApplicationButtonAccessibilityHelper.GetScreenBounds( + AChildID: TcxAccessibleSimpleChildElementID): TRect; +begin + if Visible then + begin + Result := Ribbon.ViewInfo.ApplicationButtonBounds; + Result.TopLeft := Ribbon.ClientToScreen(Result.TopLeft); + Result.BottomRight := Ribbon.ClientToScreen(Result.BottomRight); + end + else + Result := cxEmptyRect; +end; + +function TdxRibbonApplicationButtonAccessibilityHelper.GetSelectable: Boolean; +begin + Result := Visible; +end; + +function TdxRibbonApplicationButtonAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := Parent.States[cxAccessibleObjectSelfID]; + if not Ribbon.ViewInfo.IsApplicationButtonVisible then + Result := Result or cxSTATE_SYSTEM_INVISIBLE; +end; + +function TdxRibbonApplicationButtonAccessibilityHelper.GetAssignedKeyTip: string; +begin + Result := Ribbon.ApplicationButton.KeyTip; +end; + +function TdxRibbonApplicationButtonAccessibilityHelper.GetDefaultKeyTip: string; +begin + Result := 'F'; +end; + +procedure TdxRibbonApplicationButtonAccessibilityHelper.GetKeyTipInfo(out AKeyTipInfo: TdxBarKeyTipInfo); +begin + inherited; + AKeyTipInfo.BasePoint := cxRectCenter(GetScreenBounds(cxAccessibleObjectSelfID)); + AKeyTipInfo.HorzAlign := taCenter; + AKeyTipInfo.VertAlign := vaCenter; + AKeyTipInfo.Enabled := True; +end; + +procedure TdxRibbonApplicationButtonAccessibilityHelper.KeyTipHandler(Sender: TObject); +begin + if Ribbon.ApplicationButton.Menu <> nil then + ShowApplicationMenu(CM_SHOWKEYTIPS); +end; + +procedure TdxRibbonApplicationButtonAccessibilityHelper.ApplicationMenuCloseUpHandler( + Sender: TObject); +begin + if Assigned(FPrevOnApplicationMenuCloseUp) then + FPrevOnApplicationMenuCloseUp(Sender); + if TdxBarSubMenuControlAccess(TdxBarApplicationMenu(Sender).ItemLinks.BarControl).ClosedByEscape and + BarNavigationController.NavigationMode then + Select(False); +end; + +function TdxRibbonApplicationButtonAccessibilityHelper.GetRibbon: TdxCustomRibbon; +begin + Result := TdxRibbonApplicationButton(FOwnerObject).Ribbon; +end; + +procedure TdxRibbonApplicationButtonAccessibilityHelper.ShowApplicationMenu( + APostMessage: UINT); +begin + FPrevOnApplicationMenuCloseUp := Ribbon.ApplicationButton.Menu.OnCloseUp; + Ribbon.ApplicationButton.Menu.OnCloseUp := ApplicationMenuCloseUpHandler; + BarNavigationController.UnselectAssignedSelectedObject; + try + PostMessage(Ribbon.Handle, APostMessage, 0, 0); + Ribbon.ApplicationMenuPopup; + finally + if Ribbon.ApplicationButton.Menu <> nil then + Ribbon.ApplicationButton.Menu.OnCloseUp := FPrevOnApplicationMenuCloseUp; + end; +end; + +{ TdxRibbonGroupsDockControlAccessibilityHelper } + +function TdxRibbonGroupsDockControlAccessibilityHelper.GetChild( + AIndex: Integer): TcxAccessibilityHelper; +begin + Result := DockControl.ViewInfo.GroupViewInfos[AIndex].BarControl.IAccessibilityHelper.GetHelper; +end; + +function TdxRibbonGroupsDockControlAccessibilityHelper.GetChildCount: Integer; +begin + Result := DockControl.ViewInfo.GroupCount; +end; + +function TdxRibbonGroupsDockControlAccessibilityHelper.GetChildIndex( + AChild: TcxAccessibilityHelper): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to ChildCount - 1 do + if Childs[I] = AChild then + begin + Result := I; + Break; + end; +end; + +function TdxRibbonGroupsDockControlAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + if GetParentPopupWindow(DockControl, False) <> nil then + Result := nil + else + Result := TdxRibbonGroupsDockControl(DockControl).Tab.IAccessibilityHelper.GetHelper; +end; + +function TdxRibbonGroupsDockControlAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := inherited GetState(AChildID); + if not TdxRibbonGroupsDockControl(DockControl).Tab.Ribbon.AreGroupsVisible then + Result := Result or cxSTATE_SYSTEM_INVISIBLE; +end; + +function TdxRibbonGroupsDockControlAccessibilityHelper.GetParentForKeyTip: TdxBarAccessibilityHelper; +begin + if GetParentPopupWindow(DockControl, False) <> nil then + Result := DockControl.Tab.IAccessibilityHelper.GetBarHelper + else + Result := inherited GetParentForKeyTip; +end; + +function TdxRibbonGroupsDockControlAccessibilityHelper.GetDockControl: TdxRibbonGroupsDockControl; +begin + Result := TdxRibbonGroupsDockControl(FOwnerObject); +end; + +{ TdxRibbonQuickAccessToolbarAccessibilityHelper } + +function TdxRibbonQuickAccessBarControlAccessibilityHelper.GetChild( + AIndex: Integer): TcxAccessibilityHelper; +begin + if AIndex = ChildCount - 1 then + Result := BarControl.MarkIAccessibilityHelper.GetHelper + else + Result := inherited GetChild(AIndex); +end; + +function TdxRibbonQuickAccessBarControlAccessibilityHelper.GetChildCount: Integer; +begin + Result := inherited GetChildCount; + if TCustomdxBarControlAccess(BarControl).MarkExists then + Inc(Result); +end; + +function TdxRibbonQuickAccessBarControlAccessibilityHelper.GetChildIndex( + AChild: TcxAccessibilityHelper): Integer; +begin + if AChild = BarControl.MarkIAccessibilityHelper.GetHelper then + Result := inherited GetChildCount + else + Result := inherited GetChildIndex(AChild); +end; + +function TdxRibbonQuickAccessBarControlAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := TdxRibbonQuickAccessBarControl(BarControl).Ribbon.IAccessibilityHelper.GetHelper; +end; + +procedure TdxRibbonQuickAccessBarControlAccessibilityHelper.DoGetKeyTipsData(AKeyTipsData: TList); + + procedure GetItemsKeyTipsData( + ABarControl: TCustomdxBarControl; AStartIndex, AEndIndex: Integer; AKeyTipsData: TList; AVisible: Boolean); + var + I: Integer; + AChild: TdxBarAccessibilityHelper; + AKeyTipData: TdxBarKeyTipData; + begin + for I := AStartIndex to AEndIndex do + begin + AChild := ABarControl.ItemLinks.VisibleItems[I].Control.IAccessibilityHelper.GetBarHelper; + AKeyTipData := TdxBarAccessibilityHelperAccess(AChild).CreateKeyTipData; + AKeyTipData.Visible := AVisible; + AKeyTipsData.Add(AKeyTipData); + end; + end; + + procedure GenerateKeyTips(AItemKeyTipsData: TList); + var + I: Integer; + begin + for I := 0 to AItemKeyTipsData.Count - 1 do + begin + case I of + 0..8: TdxBarKeyTipData(AItemKeyTipsData[I]).KeyTip := IntToStr(I + 1); // '1'..'9' + 9..17: TdxBarKeyTipData(AItemKeyTipsData[I]).KeyTip := '0' + IntToStr(18 - I); // '09'..'01' + 18..44: TdxBarKeyTipData(AItemKeyTipsData[I]).KeyTip := '0' + Char(Ord('A') + (I - 18)); // '0A'..'0Z' + else + TdxBarKeyTipData(AItemKeyTipsData[I]).KeyTip := ''; + end; + AKeyTipsData.Add(AItemKeyTipsData[I]) + end; + end; + +var + VisibleItemCount, ARealVisibleItemCount: Integer; + AItemKeyTipsData: TList; +begin + AItemKeyTipsData := TList.Create; + try + VisibleItemCount := TdxBarItemLinksAccess(BarControl.ItemLinks).VisibleItemCount; + if BarControl.IsPopup then + begin + ARealVisibleItemCount := TdxBarItemLinksAccess(BarControl.ParentBar.ItemLinks).RealVisibleItemCount; + GetItemsKeyTipsData(BarControl.ParentBar, 0, ARealVisibleItemCount - 1, AItemKeyTipsData, False); + GetItemsKeyTipsData(BarControl, 0, VisibleItemCount - 1 - 1{Mark!!!}, AItemKeyTipsData, True); + end + else + begin + ARealVisibleItemCount := TdxBarItemLinksAccess(BarControl.ItemLinks).RealVisibleItemCount; + GetItemsKeyTipsData(BarControl, 0, ARealVisibleItemCount - 1, AItemKeyTipsData, True); + GetItemsKeyTipsData(BarControl, ARealVisibleItemCount, VisibleItemCount - 1, AItemKeyTipsData, False); + if not BarControl.AllItemsVisible then + TdxBarAccessibilityHelperAccess(BarControl.MarkIAccessibilityHelper.GetBarHelper).GetKeyTipData(AKeyTipsData); + end; + GenerateKeyTips(AItemKeyTipsData); + finally + AItemKeyTipsData.Free; + end; +end; + +procedure TdxRibbonQuickAccessBarControlAccessibilityHelper.GetItemControlKeyTipPosition( + AItemControl: TdxBarItemControl; out ABasePoint: TPoint; + out AHorzAlign: TAlignment; out AVertAlign: TcxAlignmentVert); +begin + inherited GetItemControlKeyTipPosition(AItemControl, ABasePoint, AHorzAlign, + AVertAlign); + AVertAlign := vaBottom; +end; + +function TdxRibbonQuickAccessBarControlAccessibilityHelper.GetNextAccessibleObject( + AItemControl: TdxBarItemControl; + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; + + function InternalGetRootObject: TdxBarAccessibilityHelper; + begin + if TdxRibbonQuickAccessBarControl(BarControl).IsPopup then + Result := Self + else + Result := GetRootAccessibleObject.GetBarHelper; + end; + +var + AObjects: TList; +begin + AObjects := TList.Create; + try + GetChildrenForNavigation( + AItemControl.IAccessibilityHelper.GetBarHelper, InternalGetRootObject, + TdxBarAccessibilityHelperAccess(AItemControl.IAccessibilityHelper.GetBarHelper).GetScreenBounds(cxAccessibleObjectSelfID), + ADirection, True, AObjects); + Result := dxBar.GetNextAccessibleObject( + AItemControl.IAccessibilityHelper.GetBarHelper, AObjects, ADirection, True); + finally + AObjects.Free; + end; +end; + +function TdxRibbonQuickAccessBarControlAccessibilityHelper.GetParentForKeyTip: TdxBarAccessibilityHelper; +begin + if BarControl.IsPopup then + Result := BarControl.ParentBar.IAccessibilityHelper.GetBarHelper + else + Result := inherited GetParentForKeyTip; +end; + +function TdxRibbonQuickAccessBarControlAccessibilityHelper.IsKeyTipContainer: Boolean; +begin + Result := BarControl.IsPopup; +end; + +procedure TdxRibbonQuickAccessBarControlAccessibilityHelper.KeyTipsEscapeHandler; +var + AMarkAccessibleObject: IdxBarAccessibilityHelper; + ASelectedControl: TdxBarItemControl; +begin + if not BarControl.IsPopup then + begin + ASelectedControl := TdxRibbonQuickAccessBarControl(BarControl).SelectedControl; + inherited KeyTipsEscapeHandler; + BarNavigationController.ChangeSelectedObject(True, ASelectedControl.IAccessibilityHelper); + end + else + begin + BarNavigationController.SetKeyTipsShowingState(GetKeyTipContainerParent(Self), ''); + AMarkAccessibleObject := TdxRibbonQuickAccessBarControl(BarControl.ParentBar).MarkIAccessibilityHelper; + TdxRibbonQuickAccessBarControl(BarControl.ParentBar).MarkState := msNone; + if AMarkAccessibleObject.GetHelper.IsOwnerObjectLive then + BarNavigationController.ChangeSelectedObject(True, AMarkAccessibleObject); + end; +end; + +function TdxRibbonQuickAccessBarControlAccessibilityHelper.GetBarControl: TdxRibbonQuickAccessBarControl; +begin + Result := TdxRibbonQuickAccessBarControl(FOwnerObject); +end; + +{ TdxRibbonQuickAccessBarControlMarkAccessibilityHelper } + +// IdxBarAccessibilityHelper +function TdxRibbonQuickAccessBarControlMarkAccessibilityHelper.HandleNavigationKey( + var AKey: Word): Boolean; +begin + Result := inherited HandleNavigationKey(AKey); + if (BarControl.MarkState = msPressed) and not BarControl.AllItemsVisible then + SelectFirstSelectableAccessibleObject( + BarDesignController.QuickControl.IAccessibilityHelper.GetBarHelper); +end; + +procedure TdxRibbonQuickAccessBarControlMarkAccessibilityHelper.GetKeyTipInfo(out AKeyTipInfo: TdxBarKeyTipInfo); +begin + inherited; + AKeyTipInfo.BasePoint := cxRectCenter(GetScreenBounds(cxAccessibleObjectSelfID)); + AKeyTipInfo.HorzAlign := taCenter; + AKeyTipInfo.VertAlign := vaBottom; + AKeyTipInfo.Enabled := True; +end; + +function TdxRibbonQuickAccessBarControlMarkAccessibilityHelper.GetKeyTip: string; +begin + if BarControl.AllItemsVisible then + Result := '' + else + Result := '00'; +end; + +procedure TdxRibbonQuickAccessBarControlMarkAccessibilityHelper.KeyTipHandler(Sender: TObject); +begin + DropDown; + BarNavigationController.SetKeyTipsShowingState(BarDesignController.QuickControl.IAccessibilityHelper, ''); +end; + +function TdxRibbonQuickAccessBarControlMarkAccessibilityHelper.GetBarControl: TdxRibbonQuickAccessBarControl; +begin + Result := TdxRibbonQuickAccessBarControl(FOwnerObject); +end; + +{ TdxRibbonGroupBarControlAccessibilityHelper } + +procedure TdxRibbonGroupBarControlAccessibilityHelper.CloseUpHandler( + AClosedByEscape: Boolean); +begin + if AClosedByEscape and BarNavigationController.NavigationMode then + Select(False); +end; + +// IdxBarAccessibilityHelper +function TdxRibbonGroupBarControlAccessibilityHelper.GetNextAccessibleObject( + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; +begin + if BarControl.Collapsed then + Result := GetNextAccessibleObject(nil, ADirection) + else + Result := inherited GetNextAccessibleObject(ADirection); +end; + +function TdxRibbonGroupBarControlAccessibilityHelper.HandleNavigationKey( + var AKey: Word): Boolean; +begin + Result := inherited HandleNavigationKey(AKey); + if Result then + Exit; + Result := BarControl.Collapsed and (AKey in [VK_RETURN, VK_SPACE]); + if Result then + begin + ShowPopupBarControl; + SelectFirstSelectableAccessibleObject( + BarDesignController.QuickControl.IAccessibilityHelper.GetBarHelper); + end; +end; + +function TdxRibbonGroupBarControlAccessibilityHelper.IsNavigationKey(AKey: Word): Boolean; +begin + Result := inherited IsNavigationKey(AKey); + if BarControl.Collapsed then + Result := Result or (AKey in [VK_ESCAPE, VK_RETURN, VK_SPACE]); +end; + +procedure TdxRibbonGroupBarControlAccessibilityHelper.Select(ASetFocus: Boolean); +begin + if not BarControl.Collapsed then + inherited Select(ASetFocus) + else + begin + BarNavigationController.SelectedObject := Self; + BarNavigationController.SelectedObjectParent := Parent; + BarControl.Invalidate; + + TdxRibbonGroupsDockControl(BarControl.DockControl).MakeRectFullyVisible(BarControl.BoundsRect); + end; +end; + +procedure TdxRibbonGroupBarControlAccessibilityHelper.Unselect( + ANextSelectedObject: IdxBarAccessibilityHelper); +begin + if not BarControl.Collapsed then + inherited Unselect(ANextSelectedObject) + else + begin + BarNavigationController.SelectedObject := nil; + BarNavigationController.SelectedObjectParent := nil; + BarControl.Invalidate; + end; +end; + +function TdxRibbonGroupBarControlAccessibilityHelper.GetSelectable: Boolean; +begin + if BarControl.Collapsed then + Result := Visible + else + Result := inherited GetSelectable; +end; + +function TdxRibbonGroupBarControlAccessibilityHelper.Expand: TCustomdxBarControlAccessibilityHelper; +begin + if not IsCollapsed then + raise Exception.Create(''); + ShowPopupBarControl; + Result := TCustomdxBarControlAccessibilityHelper(BarDesignController.QuickControl.IAccessibilityHelper.GetHelper); +end; + +procedure TdxRibbonGroupBarControlAccessibilityHelper.GetCaptionButtonKeyTipPosition( + ACaptionButton: TdxBarCaptionButton; out ABasePointY: Integer; + out AVertAlign: TcxAlignmentVert); +begin + ABasePointY := BarControl.ViewInfo.BottomKeyTipsBaseLinePosition; + AVertAlign := vaBottom; +end; + +procedure TdxRibbonGroupBarControlAccessibilityHelper.GetItemControlKeyTipPosition( + AItemControl: TdxBarItemControl; out ABasePoint: TPoint; + out AHorzAlign: TAlignment; out AVertAlign: TcxAlignmentVert); +var + AOneRowHeightItemControl: Boolean; + ARow: Integer; +begin + AOneRowHeightItemControl := AItemControl.ViewInfo.ViewLevel <> ivlLargeIconWithText; + + if not AOneRowHeightItemControl then + ABasePoint.Y := BarControl.ViewInfo.RowKeyTipsBaseLinePositions[dxRibbonGroupRowCount - 1] + else + begin + ARow := IdxBarItemControlViewInfo(AItemControl.ViewInfo).GetRow; + if (IdxBarItemControlViewInfo(AItemControl.ViewInfo).GetColumnRowCount = 2) and (ARow = 1) then + ARow := 2; + if IdxBarItemControlViewInfo(AItemControl.ViewInfo).GetColumnRowCount = 1 then + ARow := 1; + ABasePoint.Y := BarControl.ViewInfo.RowKeyTipsBaseLinePositions[ARow]; + end; + AVertAlign := vaCenter; + + if AOneRowHeightItemControl and + (cpIcon in TdxBarItemControlAccess(AItemControl).FDrawParams.ViewStructure) then + begin + ProcessPaintMessages; // AItemControl.ViewInfo.ImageBounds are calculated on painting + with AItemControl.ViewInfo.ImageBounds do + ABasePoint.X := (Left + Right) div 2; + ABasePoint.X := AItemControl.Parent.ClientToScreen(ABasePoint).X; + AHorzAlign := taRightJustify; + end + else + begin + with GetItemControlScreenBounds(AItemControl) do + ABasePoint.X := (Left + Right) div 2; + AHorzAlign := taCenter; + end; +end; + +function TdxRibbonGroupBarControlAccessibilityHelper.GetAssignedKeyTip: string; +begin + Result := BarControl.Bar.KeyTip; +end; + +function TdxRibbonGroupBarControlAccessibilityHelper.GetDefaultKeyTip: string; + + function GetFirstChar(const AText: string): string; + begin + if Length(AText) > 0 then + Result := AText[1] + else + Result := ''; + end; + +begin + Result := 'Z' + GetFirstChar(BarControl.Bar.Caption); +end; + +procedure TdxRibbonGroupBarControlAccessibilityHelper.GetKeyTipInfo(out AKeyTipInfo: TdxBarKeyTipInfo); +var + AKeyTipBasePoint: TPoint; +begin + inherited; + with GetScreenBounds(cxAccessibleObjectSelfID) do + AKeyTipBasePoint.X := (Left + Right) div 2; + AKeyTipBasePoint.Y := BarControl.ViewInfo.BottomKeyTipsBaseLinePosition; + AKeyTipInfo.BasePoint := AKeyTipBasePoint; + AKeyTipInfo.HorzAlign := taCenter; + AKeyTipInfo.VertAlign := vaBottom; + AKeyTipInfo.Enabled := True; +end; + +procedure TdxRibbonGroupBarControlAccessibilityHelper.GetKeyTipData(AKeyTipsData: TList); + + procedure AddKeyTipsForItemControls; + var + AItemControl: TdxBarItemControl; + I: Integer; + begin + for I := 0 to BarControl.ViewInfo.ItemControlCount - 1 do + begin + AItemControl := BarControl.ViewInfo.ItemControlViewInfos[I].Control; + with TdxBarItemControlAccessibilityHelperAccess(AItemControl.IAccessibilityHelper.GetBarHelper) do + if CanSelect then + GetKeyTipData(AKeyTipsData); + end; + end; + + procedure AddKeyTipsForCaptionButtons; + var + ACaptionButton: TdxBarCaptionButton; + I: Integer; + begin + for I := 0 to BarControl.Bar.CaptionButtons.Count - 1 do + begin + ACaptionButton := BarControl.Bar.CaptionButtons[I]; + TdxBarCaptionButtonAccessibilityHelperAccess(ACaptionButton.IAccessibilityHelper.GetHelper).GetKeyTipData(AKeyTipsData); + end; + end; + +begin + inherited; + + //TODO: GetKeyTipsData(AKeyTipsData); + + AddKeyTipsForItemControls; + AddKeyTipsForCaptionButtons; +end; + +function TdxRibbonGroupBarControlAccessibilityHelper.GetNextAccessibleObject( + AItemControl: TdxBarItemControl; + ADirection: TcxAccessibilityNavigationDirection): IdxBarAccessibilityHelper; + + function FindAmongItemControlsAndCollapsedBarControls( + ASelectedObject: TdxBarAccessibilityHelper; + const ASelectedObjectScreenBounds: TRect): IdxBarAccessibilityHelper; + + procedure GetBarControlChildren(ABarControl: TdxRibbonGroupBarControl; + AObjects: TList); + var + AItemControl1: TdxBarItemControl; + I: Integer; + begin + for I := 0 to ABarControl.ViewInfo.ItemControlCount - 1 do + begin + AItemControl1 := ABarControl.ViewInfo.ItemControlViewInfos[I].Control; + GetChildrenForNavigation(ASelectedObject, + AItemControl1.IAccessibilityHelper.GetBarHelper, ASelectedObjectScreenBounds, + ADirection, False, AObjects); + end; + end; + + var + ABarControl: TdxRibbonGroupBarControl; + AObjects: TList; + I: Integer; + begin + Result := nil; + AObjects := TList.Create; + try + if BarControl.IsPopup then + GetBarControlChildren(BarControl, AObjects) + else + for I := 0 to Parent.ChildCount - 1 do + begin + ABarControl := TdxRibbonGroupBarControlAccessibilityHelper(Parent.Childs[I]).BarControl; + if ABarControl.Collapsed then + GetChildrenForNavigation(ASelectedObject, + ABarControl.IAccessibilityHelper.GetBarHelper, ASelectedObjectScreenBounds, ADirection, False, AObjects) + else + if not ((ADirection in [andUp, andDown]) and (ABarControl <> BarControl)) then + GetBarControlChildren(ABarControl, AObjects); + end; + Result := dxBar.GetNextAccessibleObject(ASelectedObject, AObjects, ADirection, True); + finally + AObjects.Free; + end; + end; + +var + ACaptionButtonIndex: Integer; + AObjects: TList; + AScreenBounds: TRect; + ASelectedObject: TdxBarAccessibilityHelper; +begin + if AItemControl <> nil then + ASelectedObject := AItemControl.IAccessibilityHelper.GetBarHelper + else + ASelectedObject := Self; + AScreenBounds := TdxBarAccessibilityHelperAccess(ASelectedObject).GetScreenBounds(cxAccessibleObjectSelfID); + Result := FindAmongItemControlsAndCollapsedBarControls(ASelectedObject, AScreenBounds); + if Result <> nil then + Exit; + case ADirection of + andUp: + if not (BarControl.IsPopup or TdxRibbonGroupBarControl(BarControl).Ribbon.IsPopupGroupsMode) then + Result := TdxRibbonGroupBarControl(BarControl).Ribbon.ActiveTab.IAccessibilityHelper; + andDown: + begin + ACaptionButtonIndex := -1; + if not BarControl.Collapsed then + ACaptionButtonIndex := BarControl.Bar.CaptionButtons.IAccessibilityHelper.GetHelper.GetNextSelectableChildIndex(-1, False); + if ACaptionButtonIndex <> -1 then + Result := BarControl.Bar.CaptionButtons[ACaptionButtonIndex].IAccessibilityHelper + else + if not (BarControl.IsPopup or TdxRibbonGroupBarControl(BarControl).Ribbon.IsPopupGroupsMode) and + (BarControl.Ribbon.QATIAccessibilityHelper <> nil) then + begin + AObjects := TList.Create; + try + GetChildrenForNavigation(ASelectedObject, + BarControl.Ribbon.QATIAccessibilityHelper.GetBarHelper, + AScreenBounds, ADirection, False, AObjects); + Result := dxBar.GetNextAccessibleObject( + ASelectedObject, AObjects, ADirection, True); + finally + AObjects.Free; + end; + end; + end; + end; +end; + +function TdxRibbonGroupBarControlAccessibilityHelper.GetParentForKeyTip: TdxBarAccessibilityHelper; +begin + if BarControl.IsPopup then + Result := BarControl.ParentBar.IAccessibilityHelper.GetBarHelper + else + Result := inherited GetParentForKeyTip; +end; + +function TdxRibbonGroupBarControlAccessibilityHelper.IsCollapsed: Boolean; +begin + Result := BarControl.Collapsed; +end; + +function TdxRibbonGroupBarControlAccessibilityHelper.IsKeyTipContainer: Boolean; +begin + Result := BarControl.IsPopup; +end; + +procedure TdxRibbonGroupBarControlAccessibilityHelper.KeyTipHandler( + Sender: TObject); +begin + ShowPopupBarControl; + BarNavigationController.SetKeyTipsShowingState( + BarDesignController.QuickControl.IAccessibilityHelper, ''); +end; + +procedure TdxRibbonGroupBarControlAccessibilityHelper.KeyTipsEscapeHandler; +var + ASelectedItemControl: TdxBarItemControl; +begin + if BarControl.IsPopup then + begin + if BarControl = BarDesignController.QuickControl then + begin + TdxRibbonGroupBarControlAccessibilityHelper(BarControl.ParentBar.IAccessibilityHelper.GetHelper).KeyTipsEscapeHandler; + TCustomdxBarControlAccess(BarControl.ParentBar).MarkState := msNone; + end + else + begin + if not TCustomdxBarControlAccess(BarControl.ParentBar).IsPopup then + TdxRibbonGroupBarControlAccessibilityHelper(BarControl.ParentBar.IAccessibilityHelper.GetHelper).KeyTipsEscapeHandler + else + begin + ASelectedItemControl := TCustomdxBarControlAccess(BarControl.ParentBar).SelectedControl; + BarControl.Hide; + BarNavigationController.ChangeSelectedObject(True, ASelectedItemControl.IAccessibilityHelper); + BarNavigationController.SetKeyTipsShowingState(ASelectedItemControl.Parent.IAccessibilityHelper, ''); + end; + end; + end + else + inherited KeyTipsEscapeHandler; +end; + +function TdxRibbonGroupBarControlAccessibilityHelper.GetBarControl: TdxRibbonGroupBarControl; +begin + Result := TdxRibbonGroupBarControl(FOwnerObject); +end; + +procedure TdxRibbonGroupBarControlAccessibilityHelper.ShowPopupBarControl; +begin + BarNavigationController.UnselectAssignedSelectedObject; + BarControl.MarkState := msPressed; +end; + +{ TdxRibbonQuickAccessGroupButtonControlAccessibilityHelper } + +function TdxRibbonQuickAccessGroupButtonControlAccessibilityHelper.IsDropDownControl: Boolean; +begin + Result := True; +end; + +function TdxRibbonQuickAccessGroupButtonControlAccessibilityHelper.ShowDropDownWindow: Boolean; +begin + TdxRibbonQuickAccessGroupButtonControl(ItemControl).DropDown(True); + Result := ItemControl.IsDroppedDown; +end; + +{ TdxRibbonKeyTipWindow } + +constructor TdxRibbonKeyTipWindow.Create(AColorScheme: TdxCustomRibbonSkin); +begin + inherited Create(nil); + FColorScheme := AColorScheme; + Canvas.Font := Screen.HintFont; + Canvas.Brush.Style := bsClear; +end; + +procedure TdxRibbonKeyTipWindow.ShowKeyTip; +begin + ParentWindow := Application.Handle; + SetWindowRgn(Handle, CreateRoundRectRgn(0, 0, Width + 1, Height + 1, 2, 2), True); + Invalidate; +end; + +function TdxRibbonKeyTipWindow.CalcBoundsRect: TRect; +var + ATempCanvas: TcxScreenCanvas; +begin + Result := cxEmptyRect; + ATempCanvas := TcxScreenCanvas.Create; + try + ATempCanvas.Font := Canvas.Font; + cxDrawText(ATempCanvas.Handle, Caption, Result, + DT_CALCRECT or DT_SINGLELINE or DT_LEFT or DT_NOPREFIX); + finally + FreeAndNil(ATempCanvas); + end; + Inc(Result.Right, 6); + Result.Right := Max(Result.Right, 16); + Inc(Result.Bottom, 2); +end; + +procedure TdxRibbonKeyTipWindow.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + begin + Style := WS_POPUP; + ExStyle := WS_EX_TOOLWINDOW or WS_EX_TOPMOST; + end; +end; + +procedure TdxRibbonKeyTipWindow.CreateWindowHandle(const Params: TCreateParams); +begin + inherited; + if not Enabled then + SetLayeredWndAttributes(Handle, 153); +end; + +procedure TdxRibbonKeyTipWindow.Paint; +var + R: TRect; +begin + R := ClientRect; + FColorScheme.DrawScreenTip(Canvas.Handle, R); + Canvas.Font.Color := dxBarScreenTipFontColor; + cxDrawText(Canvas.Handle, Caption, R, DT_SINGLELINE or DT_CENTER or + DT_NOPREFIX or DT_VCENTER); +end; + +procedure TdxRibbonKeyTipWindow.UpdateBounds; +var + R: TRect; +begin + R := CalcBoundsRect; + UpdateBoundsRect(R); +end; + +procedure TdxRibbonKeyTipWindow.CMEnabledChanged(var Message: TMessage); +begin + RecreateWnd; +end; + +procedure TdxRibbonKeyTipWindow.CMTextChanged(var Message: TMessage); +begin + inherited; + UpdateBounds; +end; + +procedure TdxRibbonKeyTipWindow.WMNCHitTest(var Message: TWMNCHitTest); +begin + Message.Result := HTTRANSPARENT; +end; + +{ TdxRibbonKeyTipWindows } + +constructor TdxRibbonKeyTipWindows.Create(ARibbon: TdxCustomRibbon); +begin + inherited Create; + FRibbon := ARibbon; + FWindowList := TcxObjectList.Create; +end; + +destructor TdxRibbonKeyTipWindows.Destroy; +begin + FreeAndNil(FWindowList); + inherited Destroy; +end; + +// IdxBarKeyTipWindowsManager +procedure TdxRibbonKeyTipWindows.Add(const ACaption: string; + const ABasePoint: TPoint; AHorzAlign: TAlignment; + AVertAlign: TcxAlignmentVert; AEnabled: Boolean; out AWindow: TObject); + + function GetWindowPosition(const AWindowSize: TSize; const ABasePoint: TPoint; + AVertAlign: TcxAlignmentVert): TPoint; + begin + case AHorzAlign of + taLeftJustify: + Result.X := ABasePoint.X - AWindowSize.cx; + taCenter: + Result.X := ABasePoint.X - AWindowSize.cx div 2; + taRightJustify: + Result.X := ABasePoint.X; + end; + case AVertAlign of + vaTop: + Result.Y := ABasePoint.Y - AWindowSize.cy; + vaCenter: + Result.Y := ABasePoint.Y - AWindowSize.cy div 2; + vaBottom: + Result.Y := ABasePoint.Y; + end; + end; + +var + ATempWindow: TdxRibbonKeyTipWindow; +begin + ATempWindow := TdxRibbonKeyTipWindow.Create(ColorScheme); + ATempWindow.Caption := ACaption; + ATempWindow.Enabled := AEnabled; + with GetWindowPosition(cxSize(ATempWindow.Width, ATempWindow.Height), + ABasePoint, AVertAlign) do + begin + ATempWindow.Left := X; + ATempWindow.Top := Y; + end; + FWindowList.Add(ATempWindow); + AWindow := ATempWindow; +end; + +procedure TdxRibbonKeyTipWindows.Delete(AWindow: TObject); +var + AIndex: Integer; +begin + AIndex := FWindowList.IndexOf(AWindow); + if AIndex = -1 then + raise Exception.Create(''); + TdxRibbonKeyTipWindow(FWindowList[AIndex]).Free; + FWindowList.Delete(AIndex); +end; + +procedure TdxRibbonKeyTipWindows.Show; +var + AWindow: TdxRibbonKeyTipWindow; + I: Integer; + WP: HDWP; +begin + if Count = 0 then + Exit; + WP := BeginDeferWindowPos(Count); + try + for I := 0 to Count - 1 do + begin + AWindow := TdxRibbonKeyTipWindow(FWindowList[I]); + DeferWindowPos(WP, AWindow.Handle, HWND_TOPMOST, AWindow.Left, AWindow.Top, + AWindow.Width, AWindow.Height, SWP_NOACTIVATE or SWP_NOOWNERZORDER or SWP_NOZORDER); + AWindow.ShowKeyTip; + end; + finally + EndDeferWindowPos(WP); + end; +end; + +function TdxRibbonKeyTipWindows.GetColorScheme: TdxCustomRibbonSkin; +begin + Result := FRibbon.ColorScheme; +end; + +function TdxRibbonKeyTipWindows.GetCount: Integer; +begin + Result := FWindowList.Count; +end; + +initialization + RegisterClasses([TdxRibbonTab, TdxRibbonPopupMenu]); + dxBarRegisterItem(TdxRibbonQuickAccessPopupSubItem, + TdxRibbonQuickAccessPopupSubItemControl, False); + dxBarRegisterItem(TdxRibbonQuickAccessPopupSubItemButton, + TdxRibbonQuickAccessPopupSubItemButtonControl, False); + dxBarRegisterItem(TdxRibbonQuickAccessGroupButton, + TdxRibbonQuickAccessGroupButtonControl, False); + BarDesignController.RegisterBarControlDesignHelper( + TdxRibbonGroupBarControl, TdxRibbonGroupBarControlDesignHelper); + BarDesignController.RegisterBarControlDesignHelper( + TdxRibbonQuickAccessBarControl, TdxRibbonQuickAccessBarControlDesignHelper); + + dxBarGetRootAccessibleObject := GetRibbonAccessibilityHelper; + +finalization + dxBarGetRootAccessibleObject := nil; + + BarDesignController.UnregisterBarControlDesignHelper( + TdxRibbonQuickAccessBarControl, TdxRibbonQuickAccessBarControlDesignHelper); + BarDesignController.UnregisterBarControlDesignHelper( + TdxRibbonGroupBarControl, TdxRibbonGroupBarControlDesignHelper); + dxBarUnregisterItem(TdxRibbonQuickAccessGroupButton); + dxBarUnregisterItem(TdxRibbonQuickAccessPopupSubItemButton); + dxBarUnregisterItem(TdxRibbonQuickAccessPopupSubItem); + + if FMouseHook <> 0 then + UnhookWindowsHookEx(FMouseHook); + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxRibbonForm.pas b/official/x.35/ExpressBars 6/Sources/dxRibbonForm.pas new file mode 100644 index 00000000..f400e9bc --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxRibbonForm.pas @@ -0,0 +1,1401 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars components } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxRibbonForm; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, ExtCtrls, ImgList, cxClasses, cxGraphics, cxControls, + dxRibbonSkins, dxRibbonFormCaptionHelper, cxDWMApi; + +type + + { TdxCustomRibbonForm } + + TdxCustomRibbonForm = class(TForm) + private + FAutoScroll: Boolean; + FCaption: TCaption; + FCornerRegions: array[0..3] of HRGN; + FData: TdxRibbonFormData; + FDisableAero: Boolean; + FExtendFrameAtTopHeight: Integer; + FFakeClientHandle: HWND; + FZoomedBoundsOffsets: TRect; + FIsActive: Boolean; + FSizingBorders: TSize; + FSizingLoop: Boolean; + FUseSkin: Boolean; + FUseSkinColor: Boolean; + FVisibleChanging: Boolean; + FDefClientProc: TFarProc; + FNewClientInstance: TFarProc; + FRibbonNonClientHelper: TdxRibbonFormCaptionHelper; + procedure CalculateCornerRegions; + procedure CalculateZoomedOffsets; + procedure CheckExtendFrame(AZoomed: Boolean); + procedure CheckResizingNCHitTest(var AHitTest: Integer; const P: TPoint); + procedure CorrectZoomedBounds(var R: TRect); + procedure CreateCornerRegions; + procedure DestroyCornerRegions; + procedure ExcludeRibbonPaintArea(DC: HDC); + procedure ForceUpdateWindowSizeForVista; + function GetCurrentBordersWidth: TRect; + function GetUseSkin: Boolean; + procedure InvalidateFrame(AWnd: HWND; AUpdate: Boolean = False); + function IsNeedCorrectForAutoHideTaskBar: Boolean; + function IsNormalWindowState: Boolean; + procedure NewClientWndProc(var Message: TMessage); + procedure SetAutoScroll(const Value: Boolean); + procedure SetDisableAero(const Value: Boolean); + procedure SetRibbonNonClientHelper(const Value: TdxRibbonFormCaptionHelper); + procedure SetUseSkinColor(const Value: Boolean); + procedure UpdateSystemMenu; + //messages + procedure CMColorChanged(var Message: TMessage); message CM_COLORCHANGED; + procedure CMShowingChanged(var Message: TMessage); message CM_SHOWINGCHANGED; + procedure CMVisibleChanged(var Message: TMessage); message CM_VISIBLECHANGED; + procedure WMCaptureChanged(var Message: TMessage); message WM_CAPTURECHANGED; + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND; + procedure WMNCActivate(var Message: TWMNCActivate); message WM_NCACTIVATE; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + procedure WMNCPaint(var Message: TMessage); message WM_NCPAINT; + procedure WMPaint(var Message: TWMPaint); message WM_PAINT; + procedure WMShowWindow(var Message: TMessage); message WM_SHOWWINDOW; + procedure WMSize(var Message: TWMSize); message WM_SIZE; + procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND; + procedure WMCancelMode(var Message: TWMCancelMode); message WM_CANCELMODE; + procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; + procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; + procedure WMNCRButtonUp(var Message: TWMNCRButtonUp); message WM_NCRBUTTONUP; + procedure WMRButtonDown(var Message: TWMRButtonDown); message WM_RBUTTONDOWN; + procedure WMRButtonUp(var Message: TWMRButtonUp); message WM_RBUTTONUP; + procedure WMWindowPosChanged(var Message: TWMWindowPosChanged); message WM_WINDOWPOSCHANGED; + //vista support + procedure WMDWMCompositionChanged(var Message: TMessage); message WM_DWMCOMPOSITIONCHANGED; + //caption + procedure WMGetText(var Message: TWMGetText); message WM_GETTEXT; + procedure WMGetTextLength(var Message: TWMGetTextLength); message WM_GETTEXTLENGTH; + procedure WMSetText(var Message: TWMSetText); message WM_SETTEXT; + protected + procedure AdjustClientRect(var Rect: TRect); override; + procedure AdjustSize; override; + procedure CallDWMWindowProc(var Message); + procedure CaptionChanged; + procedure CreateWnd; override; + procedure DestroyWindowHandle; override; + procedure DrawNonClientArea(ADrawCaption: Boolean; AUpdateRegion: HRGN = 1); + procedure ExtendFrameIntoClientAreaAtTop(AHeight: Integer); + function GetFormBorderIcons: TBorderIcons; virtual; + function HandleWithHelper(ADown: Boolean; AButton: TMouseButton): Boolean; virtual; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure UpdateWindowStates; + procedure UpdateNonClientArea; + procedure WndProc(var Message: TMessage); override; + + property DisableAero: Boolean read FDisableAero write SetDisableAero default False; + property UseSkin: Boolean read GetUseSkin; + public + constructor Create(AOwner: TComponent); override; + constructor CreateNew(AOwner: TComponent; Dummy: Integer = 0); override; + destructor Destroy; override; + procedure Invalidate; override; + function IsUseAeroNCPaint: Boolean; + + property RibbonNonClientHelper: TdxRibbonFormCaptionHelper + read FRibbonNonClientHelper write SetRibbonNonClientHelper; + property IsActive: Boolean read FIsActive; + published + property AutoScroll: Boolean read FAutoScroll write SetAutoScroll default False; + property KeyPreview default True; + property UseSkinColor: Boolean read FUseSkinColor write SetUseSkinColor default True; + end; + + { TdxRibbonForm } + + TdxRibbonForm = class(TdxCustomRibbonForm); + +procedure SetWindowTextWithoutRedraw(AWnd: HWND; const AText: string); + +implementation + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + dxBar, cxGeometry, Math, dxOffice11, dxUxTheme, MultiMon, ShellAPI, dxRibbon, + dxStatusBar; + +const +{$IFNDEF DELPHI7} + WM_NCMOUSELEAVE = $02A2; +{$ENDIF} + WM_NCUAHDRAWCAPTION = $00AE; + WM_NCUAHDRAWFRAME = $00AF; + WM_SYNCPAINT = $0088; + + dxGlassMaximizedNonClientHeight = 4; + +procedure SetWindowTextWithoutRedraw(AWnd: HWND; const AText: string); +var + AFlags: Cardinal; +begin + AFlags := GetWindowLong(AWnd, GWL_STYLE); + SetWindowLong(AWnd, GWL_STYLE, AFlags and not WS_VISIBLE); + DefWindowProc(AWnd, WM_SETTEXT, 0, LongInt(PChar(AText))); + SetWindowLong(AWnd, GWL_STYLE, AFlags); +end; + +{ TdxCustomRibbonForm } + +constructor TdxCustomRibbonForm.Create(AOwner: TComponent); +begin + inherited Create(AOwner); //CBUILDER workaround +end; + +constructor TdxCustomRibbonForm.CreateNew(AOwner: TComponent; Dummy: Integer = 0); +begin + inherited CreateNew(AOwner, Dummy); + FAutoScroll := False; + FUseSkinColor := True; + AutoScroll := False; + KeyPreview := True; + CreateCornerRegions; +end; + +destructor TdxCustomRibbonForm.Destroy; +begin + DestroyCornerRegions; + inherited Destroy; +end; + +procedure TdxCustomRibbonForm.Invalidate; +begin + if HandleAllocated and not IsIconic(Handle) then + CheckExtendFrame(IsZoomed(Handle)); + inherited Invalidate; + if ClientHandle <> 0 then + InvalidateRect(ClientHandle, nil, True); +end; + +procedure TdxCustomRibbonForm.CreateWnd; +var + ClientCreateStruct: TClientCreateStruct; +begin + FExtendFrameAtTopHeight := -1; + inherited CreateWnd; + if not (csDesigning in ComponentState) and (FormStyle = fsMDIForm) then + begin + with ClientCreateStruct do + begin + idFirstChild := $FF00; //check + hWindowMenu := 0; + end; + FFakeClientHandle := Windows.CreateWindowEx(WS_EX_CLIENTEDGE, 'MDICLIENT', + nil, WS_CHILD or WS_VISIBLE or WS_GROUP or WS_TABSTOP or + WS_CLIPCHILDREN or WS_CLIPSIBLINGS or + MDIS_ALLCHILDSTYLES, 0, 0, ClientWidth, ClientHeight, Handle, 0, + HInstance, @ClientCreateStruct); + SetWindowPos(FFakeClientHandle, 0, -20, -20, 10, 10, SWP_NOACTIVATE or SWP_NOZORDER); + FDefClientProc := Pointer(GetWindowLong(FFakeClientHandle, GWL_WNDPROC)); + FNewClientInstance := {$IFDEF DELPHI6}Classes.{$ENDIF}MakeObjectInstance(NewClientWndProc); + SetWindowLong(ClientHandle, GWL_WNDPROC, Longint(FNewClientInstance)); + if ClientHandle <> 0 then + begin + SetWindowLong(ClientHandle, GWL_EXSTYLE, + GetWindowLong(ClientHandle, GWL_EXSTYLE) and not WS_EX_CLIENTEDGE); + InvalidateFrame(ClientHandle); + end; + end; + UpdateSystemMenu; +end; + +procedure TdxCustomRibbonForm.DestroyWindowHandle; +begin + inherited; + if csDestroying in ComponentState then + RibbonNonClientHelper := nil; +end; + +procedure TdxCustomRibbonForm.AdjustClientRect(var Rect: TRect); +begin + inherited; + if IsUseAeroNCPaint and IsZoomed(Handle) then + Inc(Rect.Top, dxGlassMaximizedNonClientHeight); +end; + +procedure TdxCustomRibbonForm.AdjustSize; +{$IFDEF DELPHI11} +var + AFlags: Cardinal; +{$ENDIF} +begin +{$IFDEF DELPHI11} + if not (csLoading in ComponentState) and HandleAllocated then + begin + AFlags := SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOZORDER; + if IsZoomed(Handle) then + AFlags := AFlags or SWP_NOSIZE; + SetWindowPos(Handle, 0, 0, 0, Width, Height, AFlags); + RequestAlign; + end; +{$ELSE} + inherited AdjustSize; +{$ENDIF} +end; + +procedure TdxCustomRibbonForm.CallDWMWindowProc(var Message); +begin + DwmDefWindowProc(Handle, TMessage(Message).Msg, TMessage(Message).WParam, + TMessage(Message).LParam, Integer(@TMessage(Message).Result)); +end; + +procedure TdxCustomRibbonForm.CaptionChanged; +begin + UpdateWindowStates; + RibbonNonClientHelper.CaptionChanged; +end; + +procedure TdxCustomRibbonForm.NewClientWndProc(var Message: TMessage); + + procedure Default; + begin + with Message do + Result := CallWindowProc(FDefClientProc, ClientHandle, Msg, wParam, lParam); + end; + + function MaximizedChildren: Boolean; + var + I: Integer; + begin + for I := 0 to MDIChildCount - 1 do + if MDIChildren[I].WindowState = wsMaximized then + begin + Result := True; + Exit; + end; + Result := False; + end; + +var + DC: HDC; + PS: TPaintStruct; + R: TRect; +// F: TForm; + AColor: TColor; +begin + if not UseSkin then + begin + Default; + Exit; + end; + with Message do + case Msg of + WM_KEYDOWN: + begin + KeyDown(WParamLo, KeyDataToShiftState(LParam)); + if WParamLo = 0 then Exit; + Default; + end; + WM_NCHITTEST: + begin + Default; + if Result = HTCLIENT then Result := HTTRANSPARENT; + end; + WM_ERASEBKGND: + begin + AColor := RibbonNonClientHelper.GetWindowColor; + FillRectByColor(TWMEraseBkGnd(Message).DC, ClientRect, AColor); + // Erase the background at the location of an MDI client window + if (FormStyle = fsMDIForm) and (ClientHandle <> 0) then + begin + Windows.GetClientRect(ClientHandle, R); + FillRectByColor(TWMEraseBkGnd(Message).DC, R, AColor); + end; + Result := 1; + end; + WM_NCCALCSIZE:; + WM_NCPAINT:; + WM_MDIREFRESHMENU: + Result := 0; + WM_NCACTIVATE: + Message.Result := 1; + { + $3F://! + begin + Default; + F := ActiveMDIChild; + if (F <> nil) and MaximizedChildren then + begin + //correct maximized bounds + GetWindowRect(ClientHandle, R); + R.Right := R.Right - R.Left + (F.Width - F.ClientWidth); + R.Bottom := R.Bottom - R.Top + (F.Height - F.ClientHeight); + if (F is TdxCustomRibbonForm) and TdxCustomRibbonForm(F).UseSkin then + Inc(R.Bottom, TdxCustomRibbonForm(F).RibbonNonClientHelper.GetWindowCaptionHeight); + SetWindowPos(F.Handle, 0, 0, 0, R.Right, R.Bottom, + SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOZORDER); + end; + end; + } + WM_PAINT: + begin + DC := TWMPaint(Message).DC; + if DC = 0 then + TWMPaint(Message).DC := BeginPaint(ClientHandle, PS); + try + if DC = 0 then + begin + GetWindowRect(ClientHandle, R); + R.TopLeft := ScreenToClient(R.TopLeft); + MoveWindowOrg(TWMPaint(Message).DC, -R.Left, -R.Top); + end; + PaintHandler(TWMPaint(Message)); + finally + if DC = 0 then + EndPaint(ClientHandle, PS); + end; + end; + else + Default; + end; +end; + +procedure TdxCustomRibbonForm.DrawNonClientArea(ADrawCaption: Boolean; AUpdateRegion: HRGN = 1); +var + DC: HDC; + AFlags: Integer; + ARgn: HRGN; + AZoomed: Boolean; +begin + if IsUseAeroNCPaint then Exit; + UpdateWindowStates; + AFlags := DCX_CACHE or DCX_CLIPSIBLINGS or DCX_WINDOW or DCX_VALIDATE; + if AUpdateRegion <> 1 then + begin + ARgn := CreateRectRgnIndirect(cxEmptyRect); + CombineRgn(ARgn, AUpdateRegion, 0, RGN_COPY); + DC := GetDCEx(Handle, ARgn, AFlags or DCX_INTERSECTRGN); + end + else + DC := GetDCEx(Handle, 0, AFlags); + BarCanvas.BeginPaint(DC); + BarCanvas.Canvas.Lock; + try + if IsIconic(Handle) then + RibbonNonClientHelper.DrawWindowCaption(BarCanvas, Caption) + else + begin + AZoomed := IsZoomed(Handle); + if not AZoomed then + RibbonNonClientHelper.DrawWindowBorders(BarCanvas); + if ADrawCaption then + RibbonNonClientHelper.DrawWindowCaption(nil, Caption); + end; + finally + BarCanvas.Canvas.Unlock; + BarCanvas.EndPaint; + ReleaseDC(Handle, DC); + end; +end; + +function TdxCustomRibbonForm.HandleWithHelper(ADown: Boolean; + AButton: TMouseButton): Boolean; +var + P: TPoint; +begin + Result := UseSkin; + if Result then + begin + P := GetMouseCursorPos; + if RibbonNonClientHelper.IsInCaptionArea(P.X, P.Y) then + begin + if ADown then + Result := RibbonNonClientHelper.MouseDown(P, AButton) + else + Result := RibbonNonClientHelper.MouseUp(P, AButton); + end + else + Result := False; + end; +end; + +procedure TdxCustomRibbonForm.KeyDown(var Key: Word; Shift: TShiftState); +var + I: Integer; + AIntf: IdxFormKeyPreviewListener; + AForm: TForm; +begin + inherited KeyDown(Key, Shift); + if KeyPreview then + begin + if FormStyle = fsMDIChild then + AForm := Application.MainForm + else + AForm := Self; + for I := 0 to AForm.ControlCount - 1 do + if Supports(TObject(AForm.Controls[I]), IdxFormKeyPreviewListener, AIntf) then + begin + AIntf.FormKeyDown(Key, Shift); + AIntf := nil; + end; + end; +end; + +procedure TdxCustomRibbonForm.CalculateCornerRegions; + + procedure CalculateRegion(ACornerRgn: HRGN; DX, DY: Integer; const ACornerRect: TRect); + var + R1, R2: HRGN; + begin + R1 := CreateRectRgnIndirect(cxEmptyRect); + GetWindowRgn(Handle, ACornerRgn); + GetWindowRgn(Handle, R1); + OffsetRgn(R1, DX, DY); + CombineRgn(ACornerRgn, ACornerRgn, R1, RGN_DIFF); + R2 := CreateRectRgnIndirect(ACornerRect); + CombineRgn(ACornerRgn, ACornerRgn, R2, RGN_AND); + DeleteObject(R1); + DeleteObject(R2); + end; + +var + H: Integer; +begin + H := GetSystemMetrics(SM_CYCAPTION); + CalculateRegion(FCornerRegions[0], FSizingBorders.cx, FSizingBorders.cy, + cxRect(0, 0, H, H)); + CalculateRegion(FCornerRegions[1], -FSizingBorders.cx, FSizingBorders.cy, + cxRect(Width - H, 0, Width, H)); + CalculateRegion(FCornerRegions[2], -FSizingBorders.cx, -FSizingBorders.cy, + cxRect(Width - H, Height - H, Width, Height)); + CalculateRegion(FCornerRegions[3], FSizingBorders.cx, -FSizingBorders.cy, + cxRect(0, Height - H, H, Height)); +end; + +procedure TdxCustomRibbonForm.CalculateZoomedOffsets; +var + ABData: TAppBarData; +begin + FZoomedBoundsOffsets := cxEmptyRect; + if IsNeedCorrectForAutoHideTaskBar then + begin + FillChar(ABData, sizeof(ABData), 0); + ABData.cbSize := sizeof(ABData); + ABData.hWnd := Handle; + SHAppBarMessage(ABM_GETTASKBARPOS, ABData); + if ABData.uEdge = ABE_LEFT then + FZoomedBoundsOffsets.Left := 1 + else if (ABData.uEdge = ABE_TOP) and not IsUseAeroNCPaint then + FZoomedBoundsOffsets.Top := 1 + else if ABData.uEdge = ABE_RIGHT then + FZoomedBoundsOffsets.Right := 1 + Ord(IsUseAeroNCPaint) + else if ABData.uEdge = ABE_BOTTOM then + FZoomedBoundsOffsets.Bottom := 1; + end; +end; + +procedure TdxCustomRibbonForm.CheckExtendFrame(AZoomed: Boolean); +var + ANonClientHeight: Integer; +begin + if UseSkin and HandleAllocated and IsUseAeroNCPaint then + begin + ANonClientHeight := RibbonNonClientHelper.GetWindowCaptionHeight; + //prevent client area rendering beyond the screen if maximized + if AZoomed and (ANonClientHeight > 0) then + Inc(ANonClientHeight, dxGlassMaximizedNonClientHeight); + ExtendFrameIntoClientAreaAtTop(ANonClientHeight); + end; +end; + + +function TdxCustomRibbonForm.GetUseSkin: Boolean; +begin + Result := FUseSkin //and (FormStyle <> fsMDIChild); +end; + +procedure TdxCustomRibbonForm.InvalidateFrame(AWnd: HWND; AUpdate: Boolean = False); +begin + SetWindowPos(AWnd, 0, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or + SWP_NOZORDER or SWP_NOACTIVATE or SWP_DRAWFRAME); + if AUpdate then + UpdateWindow(AWnd); +end; + +function TdxCustomRibbonForm.IsNeedCorrectForAutoHideTaskBar: Boolean; +var + ABData : TAppBarData; +begin + FillChar(ABData, sizeof(ABData), 0); + ABData.cbSize := sizeof(ABData); + Result := ((SHAppBarMessage(ABM_GETSTATE, ABData) and ABS_AUTOHIDE) > 0) and + (MonitorFromWindow(FindWindow('Shell_TrayWnd', nil), MONITOR_DEFAULTTONEAREST) = Monitor.Handle); +end; + +function TdxCustomRibbonForm.IsNormalWindowState: Boolean; +begin + Result := not (IsIconic(Handle) or IsZoomed(Handle)); +end; + +procedure TdxCustomRibbonForm.SetAutoScroll(const Value: Boolean); +begin + //don't change + inherited AutoScroll := False; +end; + +procedure TdxCustomRibbonForm.SetDisableAero(const Value: Boolean); +begin + if FDisableAero <> Value then + begin + FDisableAero := Value; + UpdateWindowStates; + if UseSkin and HandleAllocated and IsCompositionEnabled and IsWindowVisible(Handle) then + begin + SetWindowRgn(Handle, 0, False); + FExtendFrameAtTopHeight := -1; + ForceUpdateWindowSizeForVista; + FExtendFrameAtTopHeight := -1; + RedrawWindow(Handle, nil, 0, RDW_FRAME or RDW_INVALIDATE or RDW_ERASE or RDW_FRAME or + RDW_ALLCHILDREN{ or RDW_UPDATENOW or RDW_ERASENOW}); + end; + end; +end; + +procedure TdxCustomRibbonForm.SetRibbonNonClientHelper(const Value: TdxRibbonFormCaptionHelper); +begin + if FRibbonNonClientHelper <> Value then + begin + FRibbonNonClientHelper := Value; + FUseSkin := (Value <> nil) and (FRibbonNonClientHelper <> nil); + FExtendFrameAtTopHeight := -1; + if csDestroying in ComponentState then + FUseSkin := False + else + begin + UpdateWindowStates; + if HandleAllocated then + begin + if dxWMSetSkinnedMessage > 0 then + SendMessage(Handle, dxWMSetSkinnedMessage, Integer(FUseSkin), 0); + DisableAlign; + SetWindowRgn(Handle, 0, False); + if IsCompositionEnabled and not UseSkin then + ExtendFrameIntoClientAreaAtTop(0); + SetWindowPos(Handle, 0, 0, 0, Width, Height, SWP_NOMOVE or + SWP_NOZORDER or SWP_NOACTIVATE or SWP_DRAWFRAME); + if IsWindowVisible(Handle) then + RedrawWindow(Handle, nil, 0, RDW_INVALIDATE or RDW_ERASE or RDW_FRAME or RDW_ALLCHILDREN); + EnableAlign; + UpdateSystemMenu; + end; + end; + end; +end; + +procedure TdxCustomRibbonForm.SetUseSkinColor(const Value: Boolean); +begin + if FUseSkinColor <> Value then + begin + FUseSkinColor := Value; + if HandleAllocated then + InvalidateRect(Handle, nil, True); + end; +end; + +procedure TdxCustomRibbonForm.UpdateSystemMenu; +begin + if UseSkin then + begin + if not IsUseAeroNCPaint then + GetSystemMenu(Handle, True); //W2k painting bug workaround + RibbonNonClientHelper.InitWindowBorderIcons(GetFormBorderIcons); + end; +end; + +procedure TdxCustomRibbonForm.CMColorChanged(var Message: TMessage); +begin + if UseSkin then + begin + if (FormStyle = fsMDIForm) and (ClientHandle <> 0) then + Windows.InvalidateRect(ClientHandle, nil, True); + end; + inherited; +end; + +procedure TdxCustomRibbonForm.CMShowingChanged(var Message: TMessage); + + procedure UpdateRibbonControls(var ARibbon, AStatusBar: TWinControl); + var + I: Integer; + begin + for I := 0 to ControlCount - 1 do + begin + if Controls[I] is TdxCustomRibbon then + ARibbon := TWinControl(Controls[I]) + else if Controls[I] is TdxCustomStatusBar then + AStatusBar := TWinControl(Controls[I]); + if (ARibbon <> nil) and (AStatusBar <> nil) then Break; + end; + end; + + procedure CheckHideRibbonControl(var AControl: TWinControl); + begin + if (AControl <> nil) and AControl.HandleAllocated and AControl.Visible then + ShowWindow(AControl.Handle, SW_HIDE) + else + AControl := nil; + end; + + procedure ShowRibbonControl(AControl: TWinControl); + begin + if AControl <> nil then + begin + ShowWindow(AControl.Handle, SW_SHOWNA); + UpdateWindow(AControl.Handle); + end; + end; + +var + ANeedHideRibbonControls: Boolean; + ARibbon, AStatusBar: TWinControl; +begin + ARibbon := nil; //remove warnings + AStatusBar := nil; + ANeedHideRibbonControls := Visible and FVisibleChanging; + try + if ANeedHideRibbonControls then + begin + UpdateRibbonControls(ARibbon, AStatusBar); + CheckHideRibbonControl(ARibbon); + CheckHideRibbonControl(AStatusBar); + end; + inherited; + finally + if ANeedHideRibbonControls then + begin + ShowRibbonControl(ARibbon); + ShowRibbonControl(AStatusBar); + end; + end; +end; + +procedure TdxCustomRibbonForm.CMVisibleChanged(var Message: TMessage); +begin + FVisibleChanging := True; + try + inherited; + finally + FVisibleChanging := False; + end; +end; + +procedure TdxCustomRibbonForm.WMCancelMode(var Message: TWMCancelMode); +begin + if UseSkin then + RibbonNonClientHelper.CancelMode; + inherited; +end; + +procedure TdxCustomRibbonForm.WMCaptureChanged(var Message: TMessage); +begin + if UseSkin and (THandle(Message.LParam) <> Handle) then + begin + FSizingLoop := False; + RibbonNonClientHelper.CancelMode; + end; + inherited; +end; + +procedure TdxCustomRibbonForm.WMEraseBkgnd(var Message: TWMEraseBkgnd); + + function GetBkgColor: TColor; + begin + if FUseSkinColor then + Result := RibbonNonClientHelper.GetWindowColor + else + Result := Color; + end; + +var + R: TRect; +begin + if UseSkin and (IsUseAeroNCPaint or not DoubleBuffered or (TMessage(Message).wParam = TMessage(Message).lParam)) then + begin + R := ClientRect; + //reduce flickering + if IsUseAeroNCPaint then + Inc(R.Top, FExtendFrameAtTopHeight); + if not cxRectIsEmpty(R) then + FillRectByColor(Message.DC, R, GetBkgColor); + end + else + inherited; +end; + +procedure TdxCustomRibbonForm.WMLButtonDown(var Message: TWMLButtonDown); +begin + if HandleWithHelper(True, mbLeft) then + UpdateNonClientArea + else + inherited; +end; + +procedure TdxCustomRibbonForm.WMLButtonUp(var Message: TWMLButtonUp); +begin + if UseSkin then + begin + if HandleWithHelper(False, mbLeft) then + Message.Result := 0 + else + begin + RibbonNonClientHelper.CancelMode; + inherited; + end; + end + else inherited +end; + +procedure TdxCustomRibbonForm.WMRButtonDown(var Message: TWMRButtonDown); +begin + if HandleWithHelper(True, mbRight) then + Message.Result := 0 + else + inherited; +end; + +procedure TdxCustomRibbonForm.WMRButtonUp(var Message: TWMRButtonUp); +begin + if HandleWithHelper(False, mbRight) then + Message.Result := 0 + else + inherited; +end; + +procedure TdxCustomRibbonForm.WMNCRButtonUp(var Message: TWMNCRButtonUp); +begin + if HandleWithHelper(False, mbRight) then + Message.Result := 0 + else + inherited; +end; + +procedure TdxCustomRibbonForm.WMNCActivate(var Message: TWMNCActivate); +var + AFlags: Cardinal; +begin + FIsActive := Message.Active; + if UseSkin then + begin + UpdateWindowStates; + if (FormStyle = fsMDIChild) or IsUseAeroNCPaint then // AB15017 only on XP + begin // Aero required to call a default method + AFlags := GetWindowLong(Handle, GWL_STYLE); + SetWindowLong(Handle, GWL_STYLE, AFlags and not WS_VISIBLE); + Message.Result := DefWindowProc(Handle, WM_NCACTIVATE, TMessage(Message).WParam, 0); + SetWindowLong(Handle, GWL_STYLE, AFlags); + end + else + Message.Result := 1; //B20794 + if not (csDestroying in ComponentState) then + begin + if not FIsActive then + RibbonNonClientHelper.CancelMode; + UpdateNonClientArea + end; + if (FormStyle = fsMDIForm) and (ActiveMDIChild <> nil) then + ActiveMDIChild.Perform(WM_NCACTIVATE, Ord(IsActive), 0); + end + else + inherited; +end; + +procedure TdxCustomRibbonForm.WMNCCalcSize(var Message: TWMNCCalcSize); +var + R, SaveR0: TRect; + T: Integer; + AIsZoomed: Boolean; +begin + if not (UseSkin and Visible and not IsIconic(Handle) and not (csReading in ComponentState)) then + inherited + else + begin + if Message.CalcValidRects then + begin + AIsZoomed := IsZoomed(Handle); + if IsUseAeroNCPaint then + begin + T := Message.CalcSize_Params^.rgrc[0].Top; + if AIsZoomed and GetWindowRect(Handle, R) and not cxRectIsEqual(R, Message.CalcSize_Params^.rgrc[0]) then + Realign; + inherited; + SaveR0 := Message.CalcSize_Params^.rgrc[0]; + SaveR0.Top := T; + end + else + begin + R := GetCurrentBordersWidth; + SaveR0 := Message.CalcSize_Params^.rgrc[0]; + with Message.CalcSize_Params^.rgrc[0] do + begin + Inc(SaveR0.Top, R.Top); + Dec(SaveR0.Bottom, R.Bottom); + Inc(SaveR0.Left, R.Left); + Dec(SaveR0.Right, R.Right); + end; + end; + if AIsZoomed then + begin + if FormStyle = fsMDIChild then //check for the OS version + begin + if IsCompositionEnabled then + Inc(SaveR0.Top, 2) + else + Dec(SaveR0.Top, 2); + end + else + CorrectZoomedBounds(SaveR0); + end; + Message.CalcSize_Params^.rgrc[0] := SaveR0; + end + else + inherited; + Message.Result := 0; + end; +end; + +procedure TdxCustomRibbonForm.WMNCHitTest(var Message: TWMNCHitTest); +var + R: TRect; + P: TPoint; +begin + if UseSkin then + begin + Message.Result := HTNOWHERE; + if IsUseAeroNCPaint then + begin + CallDWMWindowProc(Message); + if Message.Result = HTNOWHERE then + inherited; + if not ((Message.Result = HTCAPTION) or (Message.Result = HTCLIENT)) then + Exit; + Message.Result := HTNOWHERE; + end; + GetWindowRect(Handle, R); + P := cxPoint(Message.XPos - R.Left, Message.YPos - R.Top); + if (BorderStyle in [bsSizeable, bsSizeToolWin]) then + CheckResizingNCHitTest(Message.Result, P); + if (Message.Result = HTNOWHERE) and RibbonNonClientHelper.IsInCaptionArea(Message.XPos, Message.YPos) then + RibbonNonClientHelper.GetWindowCaptionHitTest(Message); + if Message.Result = HTNOWHERE then + Message.Result := HTCLIENT; + end + else + inherited; +end; + +procedure TdxCustomRibbonForm.WMShowWindow(var Message: TMessage); +begin + inherited; + if WordBool(Message.WParam) and UseSkin and IsNormalWindowState then + begin + //for a showing MDIChild on vista without DWM + //make sure for WM_SIZE & WM_NCCALCSIZE + SetWindowPos(Handle, 0, 0, 0, Width, Height, SWP_NOZORDER or SWP_NOACTIVATE or + SWP_NOMOVE or SWP_FRAMECHANGED); + + RibbonNonClientHelper.InitWindowBorderIcons(GetFormBorderIcons); + CaptionChanged; + end; +end; + +procedure TdxCustomRibbonForm.WMNCPaint(var Message: TMessage); +begin + if UseSkin then + begin + if IsUseAeroNCPaint then + inherited; + DrawNonClientArea(False, Message.WParam); + Message.Result := 0; + end + else + inherited; +end; + +procedure TdxCustomRibbonForm.WMPaint(var Message: TWMPaint); +begin + if UseSkin then + begin + UpdateWindowStates; + if IsUseAeroNCPaint then + ExcludeRibbonPaintArea(Message.DC); + inherited; + end + else + inherited; +end; + +procedure TdxCustomRibbonForm.WMSize(var Message: TWMSize); +var + R: TRect; +begin + if UseSkin and not (csReading in ComponentState) then + begin + UpdateWindowStates; + RibbonNonClientHelper.Resize; + FSizingBorders.cx := GetSystemMetrics(SM_CXSIZEFRAME); + FSizingBorders.cy := GetSystemMetrics(SM_CYSIZEFRAME); + if IsUseAeroNCPaint then + begin + if Message.SizeType = SIZE_MAXIMIZED then + SetWindowRgn(Handle, 0, False); + CheckExtendFrame(Message.SizeType = SIZE_MAXIMIZED); + end + else + begin +// RibbonNonClientHelper.Resize; + if Message.SizeType = SIZE_MAXIMIZED then + begin + //clip borders + GetWindowRect(Handle, R); + OffsetRect(R, -R.Left, -R.Top); + with GetDefaultWindowBordersWidth(Handle) do + R := cxRectInflate(R, -Left, -Top, -Right, -Bottom); + SetWindowRgn(Handle, CreateRectRgnIndirect(R), True); + end + else + begin + SetWindowRgn(Handle, RibbonNonClientHelper.GetWindowRegion, True); + CalculateCornerRegions; + end; + end; + end; + inherited; +end; + +procedure TdxCustomRibbonForm.WMSysCommand(var Message: TWMSysCommand); +begin + if Message.CmdType and $FFF0 = SC_MAXIMIZE then + CalculateZoomedOffsets; + inherited; + if UseSkin then + begin + case (Message.CmdType and $FFF0) of + SC_MAXIMIZE, SC_RESTORE: + UpdateNonClientArea; + else + UpdateWindowStates; + end; + end; +end; + +procedure TdxCustomRibbonForm.WMWindowPosChanged(var Message: TWMWindowPosChanged); +begin + UpdateWindowStates; + inherited; +end; + +procedure TdxCustomRibbonForm.WMDWMCompositionChanged(var Message: TMessage); +begin + inherited; + if UseSkin then + begin + RecreateWnd; + UpdateNonClientArea; + InvalidateFrame(Handle); + Invalidate; + Message.Result := 0; + end; +end; + +procedure TdxCustomRibbonForm.WndProc(var Message: TMessage); +begin + if not UseSkin then + inherited WndProc(Message) + else + with Message do + begin + case Msg of + WM_ENTERSIZEMOVE: + begin + FSizingLoop := True; + inherited WndProc(Message); + end; + WM_EXITSIZEMOVE: + begin + FSizingLoop := False; + inherited WndProc(Message); + UpdateNonClientArea; + end; + WM_NCUAHDRAWCAPTION, + WM_NCUAHDRAWFRAME: + begin + if IsUseAeroNCPaint then + CallDWMWindowProc(Message); + DrawNonClientArea(True); + Message.Result := 0; + end; + WM_MOUSEACTIVATE, WM_SYNCPAINT: + begin + inherited WndProc(Message); + DrawNonClientArea(True); + end; + WM_NCLBUTTONDOWN: + begin + if not IsUseAeroNCPaint then + UpdateWindow(Handle); + inherited WndProc(Message); + if IsIconic(Handle) then + begin + DrawNonClientArea(True); + Result := 0; + Exit; + end; + end; + WM_NCMOUSELEAVE: + begin + if IsUseAeroNCPaint then + CallDWMWindowProc(Message) + else + inherited; + end; + WM_LBUTTONDOWN: + begin + //dmAutomatic suppress a dispatching + if (DragMode = dmAutomatic) and not IsUseAeroNCPaint then + if HandleWithHelper(True, mbLeft) then + Exit; + inherited; + end; + else + if (dxWMGetSkinnedMessage <> 0) and (Msg = dxWMGetSkinnedMessage) then + begin + Result := Ord(UseSkin); + Exit; + end; + inherited; + end; + end; +end; + +procedure TdxCustomRibbonForm.UpdateWindowStates; +var + R: TRect; +begin + if UseSkin and not (csDestroying in ComponentState) then + begin + FillChar(FData, SizeOf(TdxRibbonFormData), 0); + if HandleAllocated then + begin + FData.Handle := Handle; + if GetWindowRect(Handle, R) then + OffsetRect(R, -R.Left, -R.Top) + else + R := cxEmptyRect; + FData.Bounds := R; + if IsIconic(Handle) then + FData.State := wsMinimized + else if IsZoomed(Handle) then + FData.State := wsMaximized + else + FData.State := wsNormal; + end; + FData.Active := FIsActive; + FData.Border := BorderStyle; + FData.Style := FormStyle; + FData.DontUseAero := DisableAero; + RibbonNonClientHelper.CheckWindowStates(FData); + end; +end; + +procedure TdxCustomRibbonForm.UpdateNonClientArea; +begin + UpdateWindowStates; + if UseSkin and IsWindowVisible(Handle) then + begin + DrawNonClientArea(False); + RibbonNonClientHelper.UpdateNonClientArea; + end; +end; + +function TdxCustomRibbonForm.IsUseAeroNCPaint: Boolean; +begin + Result := UseAeroNCPaint(FData); +end; + +procedure TdxCustomRibbonForm.CheckResizingNCHitTest(var AHitTest: Integer; const P: TPoint); +const + CornerHitTests: array[0..3] of DWORD = (HTTOPLEFT, HTTOPRIGHT, HTBOTTOMRIGHT, HTBOTTOMLEFT); +var + I: Integer; + R, RW: TRect; +begin + if not IsNormalWindowState then Exit; + for I := 0 to 3 do + if PtInRegion(FCornerRegions[I], P.X, P.Y) then + begin + AHitTest := CornerHitTests[I]; + Break; + end; + if AHitTest = HTNOWHERE then + begin + GetWindowRect(Handle, RW); + OffsetRect(RW, -RW.Left, -RW.Top); + R := RW; + R.Bottom := R.Top + FSizingBorders.cy; + if cxRectPtIn(R, P) then + AHitTest := HTTOP + else + if not IsUseAeroNCPaint then + begin + R := RW; + R.Left := R.Right - FSizingBorders.cx; + if cxRectPtIn(R, P) then + AHitTest := HTRIGHT + else + begin + R := RW; + R.Top := R.Bottom - FSizingBorders.cy; + if cxRectPtIn(R, P) then + AHitTest := HTBOTTOM + else + begin + R := RW; + R.Right := R.Left + FSizingBorders.cx; + if cxRectPtIn(R, P) then + AHitTest := HTLEFT; + end; + end; + end; + end; +end; + +procedure TdxCustomRibbonForm.CreateCornerRegions; +var + I: Integer; +begin + for I := 0 to 3 do + FCornerRegions[I] := CreateRectRgnIndirect(cxEmptyRect); +end; + +procedure TdxCustomRibbonForm.DestroyCornerRegions; +var + I: Integer; +begin + for I := 0 to 3 do + DeleteObject(FCornerRegions[I]); +end; + +procedure TdxCustomRibbonForm.ExcludeRibbonPaintArea(DC: HDC); +var + R, CR: HRGN; + ARibbonRect: TRect; +begin + if FExtendFrameAtTopHeight = 0 then Exit; + R := GetClipRegion(DC); + ARibbonRect := cxRect(0, 0, ClientWidth, FExtendFrameAtTopHeight); + CR := CreateRectRgnIndirect(ARibbonRect); + SelectClipRgn(DC, CR); + FillRect(DC, ARibbonRect, GetStockObject(BLACK_BRUSH)); + CombineRgn(R, R, CR, RGN_DIFF); + SelectClipRgn(DC, R); + DeleteObject(R); + DeleteObject(CR); +end; + +procedure TdxCustomRibbonForm.ForceUpdateWindowSizeForVista; +const + Flags = {SWP_FRAMECHANGED or SWP_NOCOPYBITS or SWP_NOREDRAW or} + SWP_NOMOVE or SWP_NOZORDER or SWP_NOOWNERZORDER; +var + WP: Cardinal; +begin + if UseSkin and IsUseAeroNCPaint then + begin + WP := BeginDeferWindowPos(2); + try + DeferWindowPos(WP, Handle, 0, 0, 0, Width - 1, Height - 1, Flags); + DeferWindowPos(WP, Handle, 0, 0, 0, Width + 1, Height + 1, Flags); + finally + EndDeferWindowPos(WP); + end; + end; +end; + +procedure TdxCustomRibbonForm.ExtendFrameIntoClientAreaAtTop(AHeight: Integer); +var + M: TdxMargins; + DC: HDC; + R: TRect; +begin + if FExtendFrameAtTopHeight <> AHeight then + begin + if AHeight > FExtendFrameAtTopHeight then + begin + R := cxRect(0, FExtendFrameAtTopHeight, Width, AHeight); + if not FVisibleChanging then + Inc(R.Left, 100); + if not cxRectIsEmpty(R) then + begin + DC := GetWindowDC(Handle); + FillRect(DC, R, GetStockObject(BLACK_BRUSH)); + ReleaseDC(Handle, DC); + end; + end; + FExtendFrameAtTopHeight := AHeight; + M.cxLeftWidth := 0; + M.cxRightWidth := 0; + M.cyBottomHeight := 0; + M.cyTopHeight := AHeight; + DwmExtendFrameIntoClientArea(Handle, @M); + end; +end; + +function TdxCustomRibbonForm.GetFormBorderIcons: TBorderIcons; +var + ABorderStyle: TFormBorderStyle; +begin + ABorderStyle := BorderStyle; + if (FormStyle = fsMDIChild) and (ABorderStyle in [bsNone, bsDialog]) then + ABorderStyle := bsSizeable; + Result := BorderIcons; + case ABorderStyle of + bsNone: Result := []; + bsDialog: Result := (Result * [biSystemMenu, biHelp]) - [biMaximize]; + bsToolWindow, + bsSizeToolWin: Result := Result * [biSystemMenu]; + end; +end; + +procedure TdxCustomRibbonForm.CorrectZoomedBounds(var R: TRect); +begin + Inc(R.Left, FZoomedBoundsOffsets.Left); + Inc(R.Top, FZoomedBoundsOffsets.Top); + Dec(R.Right, FZoomedBoundsOffsets.Right); + Dec(R.Bottom, FZoomedBoundsOffsets.Bottom); +end; + +function TdxCustomRibbonForm.GetCurrentBordersWidth: TRect; +begin + if IsZoomed(Handle) then + begin + Result := GetDefaultWindowBordersWidth(Handle); + if FormStyle = fsMDIChild then + Result.Top := 0; + end + else + Result := RibbonNonClientHelper.GetWindowBordersWidth; +end; + +procedure TdxCustomRibbonForm.WMGetText(var Message: TWMGetText); +var + L: Integer; +begin + if (csLoading in ComponentState) or UseSkin then + begin + L := Length(FCaption); + FillChar(Pointer(Message.Text)^, Message.TextMax, #0); + if Message.TextMax - 1 < L then + L := Message.TextMax - 1; + if L > 0 then + Move(FCaption[1], Pointer(Message.Text)^, L); + Message.Result := L; + end + else + inherited; +end; + +procedure TdxCustomRibbonForm.WMGetTextLength(var Message: TWMGetTextLength); +begin + if (csLoading in ComponentState) or UseSkin then + Message.Result := Length(FCaption) + else + inherited; +end; + +procedure TdxCustomRibbonForm.WMSetText(var Message: TWMSetText); + + procedure UpdateMDIForm; + var + AForm: TdxCustomRibbonForm; + begin + if (FormStyle = fsMDIChild) and IsZoomed(Handle) and + (Application.MainForm is TdxCustomRibbonForm) then + begin + AForm := TdxCustomRibbonForm(Application.MainForm); + if AForm.UseSkin then + AForm.CaptionChanged; + end; + end; + +begin + if (csLoading in ComponentState) or UseSkin then + begin + FCaption := Message.Text; + if UseSkin then + begin + CaptionChanged; + UpdateMDIForm; + Perform(CM_TEXTCHANGED, 0, 0); + if GetWindowLong(Handle, GWL_EXSTYLE) and WS_EX_APPWINDOW = WS_EX_APPWINDOW then + SetWindowTextWithoutRedraw(Handle, RibbonNonClientHelper.GetTaskBarCaption); + end + else + begin + inherited; + UpdateMDIForm; + end; + end + else + begin + inherited; + UpdateMDIForm; + end; +end; + +initialization + if Win32MajorVersion >= 6 then + BufferedPaintInit; + +finalization + if Win32MajorVersion >= 6 then + BufferedPaintUnInit; + +end. + diff --git a/official/x.35/ExpressBars 6/Sources/dxRibbonFormCaptionHelper.pas b/official/x.35/ExpressBars 6/Sources/dxRibbonFormCaptionHelper.pas new file mode 100644 index 00000000..33f80b72 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxRibbonFormCaptionHelper.pas @@ -0,0 +1,1134 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars components } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxRibbonFormCaptionHelper; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Windows, Messages, SysUtils, Classes, Graphics, Controls, ExtCtrls, Forms, + cxClasses, cxGraphics, cxControls, dxRibbonSkins; + +type + TdxTrackedBorderIcon = (tbiNone, tbiSystemMenu, tbiMinimize, tbiMaximize, tbiHelp); + TdxBorderIconBounds = array[TBorderIcon] of TRect; + TdxRibbonFormRegion = (rfrWindow, rfrClient, rfrNCHitTest); + + IdxRibbonFormNonClientPainter = interface + ['{2F024903-3552-4859-961F-F778ED5E1DB6}'] + procedure DrawRibbonFormCaption(ACanvas: TcxCanvas; + const ABounds: TRect; const ACaption: string; const AData: TdxRibbonFormData); + procedure DrawRibbonFormBorders(ACanvas: TcxCanvas; + const AData: TdxRibbonFormData; const ABordersWidth: TRect); + procedure DrawRibbonFormBorderIcon(ACanvas: TcxCanvas; const ABounds: TRect; + AIcon: TdxBorderDrawIcon; AState: TdxBorderIconState); + function GetRibbonApplicationButtonRegion: HRGN; + function GetRibbonFormCaptionHeight: Integer; + function GetRibbonFormColor: TColor; + function GetTaskBarCaption: TCaption; + function GetWindowBordersWidth: TRect; + function HasStatusBar: Boolean; + procedure RibbonFormCaptionChanged; + procedure RibbonFormResized; + procedure UpdateNonClientArea; + end; + + IdxFormKeyPreviewListener = interface + ['{7192BF84-F80D-4DB0-A53B-06F6703B1A97}'] + procedure FormKeyDown(var Key: Word; Shift: TShiftState); + end; + + TdxRibbonFormCaptionHelper = class + private + FBitmap: TcxBitmap; + FBorderIcons: TBorderIcons; + FBorderIconsArea: TRect; + FFormCaptionDrawBounds: TRect; + FFormCaptionRegions: array[TdxRibbonFormRegion] of HRGN; + FHotBorderIcon: TdxTrackedBorderIcon; + FIsClientDrawing: Boolean; + FFormData: TdxRibbonFormData; + FMouseTimer: TTimer; + FOldWndProc: TWndMethod; + FOwner: TcxControl; + FPressedBorderIcon: TdxTrackedBorderIcon; + FSysMenuBounds: TRect; + FWasCapture: Boolean; + IRibbonFormNonClientDraw: IdxRibbonFormNonClientPainter; + procedure CalculateFormCaption; + function CanProcessFormCaptionHitTest(X, Y: Integer): Boolean; + procedure DestroyCaptionRegions; + procedure DrawBorderIcons(ACanvas: TcxCanvas); + procedure ExcludeCaptionRgn(DC: HDC); + function GetBorderIconState(AIcon: TBorderIcon): TdxBorderIconState; + function GetButtonFromPos(const P: TPoint): TBorderIcon; + function GetClientRect: TRect; + function GetClientCaptionBounds: TRect; + function GetClientCaptionRegion: HRGN; + function GetFormCaptionDrawBounds: TRect; + function GetNCHitTestRegion: HRGN; + function GetDrawIconFromBorderIcon(AIcon: TBorderIcon): TdxBorderDrawIcon; + function GetForm: TCustomForm; + function GetFormCaptionRegionsForDC(DC: HDC; ARegionKind: TdxRibbonFormRegion): HRGN; + function GetHandle: THandle; + function GetIsValid: Boolean; + function IsBorderIconMouseEvent(const P: TPoint; out CP: TPoint; + ACheckComposition: Boolean = True): Boolean; + procedure RepaintBorderIcons; + procedure StartMouseTimer; + procedure StopMouseTimer; + function TestWinStyle(AStyle : DWORD) : Boolean; + procedure MouseTimerHandler(Sender: TObject); + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); + procedure WMNCHitTest(var Message: TWMNCHitTest); + procedure WMPaint(var Message: TWMPaint); + procedure WMSize(var Message: TWMSize); + procedure WMShowWindow(var Message: TMessage); + protected + FBorderIconBounds: TdxBorderIconBounds; + FSysMenuIconBounds: TRect; + FTextBounds: TRect; + procedure CalculateBorderIcons; virtual; + procedure CalculateSysMenuIconBounds; virtual; + procedure CalculateTextBounds; virtual; + procedure BufferedDrawCaption(ADestCanvas: TcxCanvas; const ACaption: TCaption); + procedure DrawWindowBorderIcon(ACanvas: TcxCanvas; const ABounds: TRect; + AIcon: TBorderIcon; AState: TdxBorderIconState); + function GetApplicationButtonRegion: HRGN; virtual; + function GetWindowCaptionBounds: TRect; virtual; + function GetWindowCaptionRegion: HRGN; virtual; + function IsRoundedBottomCorners: Boolean; + procedure OriginalWndProc(var Message); + procedure WndProc(var Message: TMessage); virtual; + + property Control: TcxControl read FOwner; + property Form: TCustomForm read GetForm; + + property FormCaptionDrawBounds: TRect read FFormCaptionDrawBounds; + property FormData: TdxRibbonFormData read FFormData; + property Handle: THandle read GetHandle; + property Valid: Boolean read GetIsValid; + public + constructor Create(AOwner: TcxControl); + destructor Destroy; override; + procedure Calculate; + procedure CancelMode; + procedure CaptionChanged; + procedure CheckWindowStates(const AFormData: TdxRibbonFormData); + procedure DrawWindowBorders(ACanvas: TcxCanvas); + procedure DrawWindowCaption(ACanvas: TcxCanvas; const ACaption: TCaption); + function GetTaskBarCaption: TCaption; virtual; + function GetWindowBordersWidth: TRect; virtual; + function GetWindowCaptionHeight: Integer; virtual; + procedure GetWindowCaptionHitTest(var Message: TWMNCHitTest); virtual; + function GetWindowColor: TColor; + function GetWindowRegion: HRGN; virtual; + procedure InitWindowBorderIcons(const AIcons: TBorderIcons); + function IsInCaptionArea(X, Y: Integer): Boolean; virtual; + function MouseDown(const P: TPoint; AButton: TMouseButton): Boolean; virtual; + function MouseUp(const P: TPoint; AButton: TMouseButton): Boolean; virtual; + procedure Resize; + procedure ShowSystemMenu(const P: TPoint); + procedure UpdateCaptionArea(ACanvas: TcxCanvas = nil); + procedure UpdateNonClientArea; + + property SysMenuIconBounds: TRect read FSysMenuIconBounds; + property TextBounds: TRect read FTextBounds; + end; + +function GetClipRegion(DC: HDC): HRGN; +function GetDefaultWindowBordersWidth(H: THandle): TRect; +function UseAeroNCPaint(const AData: TdxRibbonFormData): Boolean; + +implementation + +uses + cxGeometry, Math, cxDWMApi, dxBar; + +const + crClient = True; + crForm = False; + + BorderIconsMap: array[TBorderIcon] of TdxTrackedBorderIcon = + (tbiSystemMenu, tbiMinimize, tbiMaximize, tbiHelp); + + BorderIconOrder: array[TBorderIcon] of TBorderIcon = + (biSystemMenu, biHelp, biMaximize, biMinimize); + +function GetClipRegion(DC: HDC): HRGN; +begin + Result := CreateRectRgn(0, 0, 0, 0); + if GetClipRgn(DC, Result) = 0 then + SetRectRgn(Result, 0, 0, 30000, 30000); +end; + +function GetDefaultWindowBordersWidth(H: THandle): TRect; +var + SizeParams: TNCCalcSizeParams; + WP: TWindowPos; +begin + if IsIconic(H) then + begin + Result := cxEmptyRect; + Exit; + end; + SizeParams.rgrc[0] := cxRect(0, 0, 500, 500); + SizeParams.rgrc[1] := cxNullRect; + SizeParams.rgrc[2] := cxNullRect; + SizeParams.lppos := @WP; + WP.hwnd := H; + WP.hwndInsertAfter := 0; + WP.x := 0; + WP.y := 0; + WP.cx := 0; + WP.cy := 0; + WP.flags := SWP_NOACTIVATE or SWP_NOCOPYBITS or SWP_NOMOVE or SWP_NOOWNERZORDER or + SWP_NOREDRAW or SWP_NOSENDCHANGING or SWP_NOSIZE or SWP_NOZORDER; + DefWindowProc(H, WM_NCCALCSIZE, 1, Integer(@SizeParams)); + with SizeParams.rgrc[0] do + Result := cxRect(Left, Top - GetSystemMetrics(SM_CYCAPTION), 500 - Right, 500 - Bottom); +end; + +function UseAeroNCPaint(const AData: TdxRibbonFormData): Boolean; +var + AParent: HWND; +begin + Result := not AData.DontUseAero and (AData.Style <> fsMDIChild) and + (AData.Handle <> 0) and IsCompositionEnabled; + if Result then + begin + AParent := GetParent(AData.Handle); + Result := (AParent = 0) or ((AData.Border = bsDialog) and (Application <> nil) and (Application.Handle = AParent)); + end; +end; + +{ TdxRibbonFormCaptionHelper } + +constructor TdxRibbonFormCaptionHelper.Create(AOwner: TcxControl); +begin + inherited Create; + Supports(TObject(AOwner), IdxRibbonFormNonClientPainter, IRibbonFormNonClientDraw); + FOwner := AOwner; + FBitmap := TcxBitmap.Create; + FOldWndProc := Control.WindowProc; + Control.WindowProc := WndProc; +end; + +destructor TdxRibbonFormCaptionHelper.Destroy; +begin + StopMouseTimer; + Control.WindowProc := FOldWndProc; + DestroyCaptionRegions; + FBitmap.Free; + inherited Destroy; +end; + +procedure TdxRibbonFormCaptionHelper.Calculate; +begin + CalculateFormCaption; + CalculateBorderIcons; + CalculateSysMenuIconBounds; + CalculateTextBounds; +end; + +procedure TdxRibbonFormCaptionHelper.CancelMode; +begin + FWasCapture := False; + if FPressedBorderIcon <> tbiNone then + begin + FPressedBorderIcon := tbiNone; + RepaintBorderIcons; + end; +end; + +procedure TdxRibbonFormCaptionHelper.CaptionChanged; +begin + IRibbonFormNonClientDraw.RibbonFormCaptionChanged; +end; + +procedure TdxRibbonFormCaptionHelper.CheckWindowStates( + const AFormData: TdxRibbonFormData); +begin + if not CompareMem(@AFormData, @FFormData, SizeOf(TdxRibbonFormData)) then + begin + FFormData := AFormData; + if FFormData.Handle <> 0 then + Calculate; + end; +end; + +procedure TdxRibbonFormCaptionHelper.DrawWindowBorderIcon(ACanvas: TcxCanvas; + const ABounds: TRect; AIcon: TBorderIcon; AState: TdxBorderIconState); +begin + IRibbonFormNonClientDraw.DrawRibbonFormBorderIcon(ACanvas, ABounds, + GetDrawIconFromBorderIcon(AIcon), AState); +end; + +function TdxRibbonFormCaptionHelper.GetTaskBarCaption: TCaption; +begin + Result := IRibbonFormNonClientDraw.GetTaskBarCaption; +end; + +function TdxRibbonFormCaptionHelper.GetWindowBordersWidth: TRect; +begin + Result := IRibbonFormNonClientDraw.GetWindowBordersWidth; +end; + +procedure TdxRibbonFormCaptionHelper.GetWindowCaptionHitTest(var Message: TWMNCHitTest); +var + I: TBorderIcon; + P: TPoint; +begin + Message.Result := HTCAPTION; + P := Control.ScreenToClient(cxPoint(Message.XPos, Message.YPos)); + if cxRectPtIn(FBorderIconsArea, P) then + begin + StartMouseTimer; + for I := Low(TBorderIcon) to High(TBorderIcon) do + if (I in FBorderIcons) and cxRectPtIn(FBorderIconBounds[I], P) then + begin + if FHotBorderIcon <> BorderIconsMap[I] then + begin + FHotBorderIcon := BorderIconsMap[I]; + RepaintBorderIcons; + end; + Message.Result := HTNOWHERE; + Exit; + end; + end; + if cxRectPtIn(FSysMenuBounds, P) then + Message.Result := HTSYSMENU; + if FHotBorderIcon <> tbiNone then + begin + FHotBorderIcon := tbiNone; + RepaintBorderIcons; + end; +end; + +function TdxRibbonFormCaptionHelper.GetWindowColor: TColor; +var + AForm: TCustomForm; +begin + if IRibbonFormNonClientDraw <> nil then + Result := IRibbonFormNonClientDraw.GetRibbonFormColor + else + begin + AForm := Form; + if AForm <> nil then + Result := AForm.Color + else + Result := clBtnFace; + end; +end; + +function TdxRibbonFormCaptionHelper.GetWindowRegion: HRGN; +const + Radius = 9; +var + F: TCustomForm; + R: HRGN; + RW: TRect; + AWidth, AHeight: Integer; +begin + Result := 0; + F := Form; + if (F = nil) or not F.HandleAllocated or not GetWindowRect(F.Handle, RW) then Exit; + AWidth := RW.Right - RW.Left; + AHeight := RW.Bottom - RW.Top; + if not IsRoundedBottomCorners then + begin + Result := CreateRoundRectRgn(0, 0, AWidth + 1, Radius * 2, Radius, Radius); + R := CreateRectRgn(0, Radius, AWidth + 1, AHeight + 1); + CombineRgn(Result, Result, R, RGN_OR); + DeleteObject(R); + end + else + Result := CreateRoundRectRgn(0, 0, AWidth + 1, AHeight + 1, Radius, Radius); +end; + +procedure TdxRibbonFormCaptionHelper.InitWindowBorderIcons( + const AIcons: TBorderIcons); +begin + FBorderIcons := AIcons; + FHotBorderIcon := tbiNone; + FPressedBorderIcon := tbiNone; + Calculate; +end; + +function TdxRibbonFormCaptionHelper.IsInCaptionArea(X, Y: Integer): Boolean; +var + P: TPoint; +begin + Result := (FFormCaptionRegions[rfrWindow] <> 0) and Valid; + if Result then + begin + if FormData.State = wsMinimized then + Result := True + else + begin + P := Control.ScreenToClient(cxPoint(X, Y)); + Result := PtInRegion(FFormCaptionRegions[rfrNCHitTest], P.X, P.Y) + end; + end; +end; + +procedure TdxRibbonFormCaptionHelper.Resize; +begin + Calculate; + IRibbonFormNonClientDraw.RibbonFormResized; +end; + +function TdxRibbonFormCaptionHelper.GetApplicationButtonRegion: HRGN; +begin + if (FormData.Handle <> 0) and (FormData.State <> wsMinimized) then + Result := IRibbonFormNonClientDraw.GetRibbonApplicationButtonRegion + else + Result := 0; +end; + +procedure TdxRibbonFormCaptionHelper.BufferedDrawCaption(ADestCanvas: TcxCanvas; + const ACaption: TCaption); +var + R1, R2: HRGN; +begin + ADestCanvas.SaveDC; + try + FBitmap.cxCanvas.FillRect(cxRect(0, 0, FBitmap.Width, FBitmap.Height), clBlack); + IRibbonFormNonClientDraw.DrawRibbonFormCaption(FBitmap.cxCanvas, + FFormCaptionDrawBounds, ACaption, FormData); + DrawBorderIcons(FBitmap.cxCanvas); + if FormData.State <> wsMinimized then + begin + R1 := GetClipRegion(ADestCanvas.Handle); + R2 := GetFormCaptionRegionsForDC(ADestCanvas.Handle, rfrClient); + CombineRgn(R2, R2, R1, RGN_AND); + SelectClipRgn(ADestCanvas.Handle, R2); + DeleteObject(R1); + DeleteObject(R2); + end; + BitBlt(ADestCanvas.Handle, 0, 0, Control.Width, Control.Height, + FBitmap.cxCanvas.Handle, 0, 0, SRCCOPY); + finally + ADestCanvas.RestoreDC; + end; +end; + +procedure TdxRibbonFormCaptionHelper.DrawWindowBorders(ACanvas: TcxCanvas); +begin + IRibbonFormNonClientDraw.DrawRibbonFormBorders(ACanvas, FormData, GetWindowBordersWidth); +end; + +procedure TdxRibbonFormCaptionHelper.DrawWindowCaption(ACanvas: TcxCanvas; + const ACaption: TCaption); +var + ASaveIndex: Integer; +begin + if Valid then + begin + if FIsClientDrawing or UseAeroNCPaint(FormData) then + begin + ASaveIndex := SaveDC(Control.Canvas.Handle); + SelectClipRgn(Control.Canvas.Handle, FFormCaptionRegions[rfrClient]); + IRibbonFormNonClientDraw.DrawRibbonFormCaption(Control.Canvas, + FFormCaptionDrawBounds, ACaption, FormData); + DrawBorderIcons(Control.Canvas); + RestoreDC(Control.Canvas.Handle, ASaveIndex); + ExcludeCaptionRgn(Control.Canvas.Handle); + end + else + if FormData.State = wsMinimized then + BufferedDrawCaption(ACanvas, ACaption) + else + begin + BufferedDrawCaption(Control.ActiveCanvas, ACaption); + ExcludeCaptionRgn(Control.ActiveCanvas.Handle); + end; + end; +end; + +procedure TdxRibbonFormCaptionHelper.CalculateBorderIcons; +var + R: TRect; + I, AIcon: TBorderIcon; + H: Integer; + AIconSize: TSize; +begin + if UseAeroNCPaint(FormData) then + begin + if FormData.Handle <> 0 then + DwmGetWindowAttribute(FormData.Handle, DWMWA_CAPTION_BUTTON_BOUNDS, @FBorderIconsArea, SizeOf(R)); + Exit; + end; + if (FormData.Handle <> 0) and not (FormData.Border in [bsToolWindow, bsSizeToolWin]) then + AIconSize := cxSize(GetSystemMetrics(SM_CXSIZE), GetSystemMetrics(SM_CYSIZE)) + else + AIconSize := cxSize(GetSystemMetrics(SM_CXSMSIZE), GetSystemMetrics(SM_CYSMSIZE)); + H := GetWindowCaptionHeight - AIconSize.cy; + R := GetClientRect; + R.Top := H - (H div 2); + R.Bottom := R.Top + AIconSize.cy; + R.Left := R.Right - AIconSize.cx; + if (FormData.Handle <> 0) and (FormData.State = wsMinimized) then + Dec(R.Bottom); + FBorderIconsArea := R; + for I := Low(TBorderIcon) to High(TBorderIcon) do + begin + AIcon := BorderIconOrder[I]; + if AIcon in FBorderIcons then + begin + FBorderIconBounds[AIcon] := R; + FBorderIconsArea.Left := R.Left; + OffsetRect(R, -AIconSize.cx, 0); + end + else + FBorderIconBounds[AIcon] := cxEmptyRect; + end; +end; + +procedure TdxRibbonFormCaptionHelper.CalculateFormCaption; +begin + DestroyCaptionRegions; + FFormCaptionRegions[rfrWindow] := GetWindowCaptionRegion; + FFormCaptionRegions[rfrClient] := GetClientCaptionRegion; + FFormCaptionRegions[rfrNCHitTest] := GetNCHitTestRegion; + FFormCaptionDrawBounds := GetFormCaptionDrawBounds; + + if Abs(cxRectWidth(FFormCaptionDrawBounds)) > 10000 then + begin + FFormCaptionDrawBounds.Left := 0; + FFormCaptionDrawBounds := GetFormCaptionDrawBounds; + end; + +{$IFDEF DELPHI10} + FBitmap.SetSize(cxRectWidth(FFormCaptionDrawBounds), GetWindowCaptionHeight); +{$ELSE} + FBitmap.Width := cxRectWidth(FFormCaptionDrawBounds); + FBitmap.Height := GetWindowCaptionHeight; +{$ENDIF} +end; + +function TdxRibbonFormCaptionHelper.CanProcessFormCaptionHitTest(X, Y: Integer): Boolean; +var + P: TPoint; +begin + Result := (FFormCaptionRegions[rfrNCHitTest] <> 0) and (GetCapture = 0); + if Result then + begin + P := Control.ScreenToClient(Point(X, Y)); + Result := PtInRegion(FFormCaptionRegions[rfrNCHitTest], P.X, P.Y); + end; +end; + +procedure TdxRibbonFormCaptionHelper.CalculateSysMenuIconBounds; +var + AHasSysMenu: Boolean; + R: TRect; + H: Integer; +begin + FSysMenuBounds := cxEmptyRect; + FSysMenuIconBounds := cxEmptyRect; + AHasSysMenu := TestWinStyle(WS_SYSMENU) and (FormData.Border in [bsSingle, bsSizeable]); + if AHasSysMenu then + begin + if UseAeroNCPaint(FormData) then + begin + H := GetSystemMetrics(SM_CYCAPTION); + if H < 24 then Exit; + H := (H - 3) and $FE; + R := GetDefaultWindowBordersWidth(FormData.Handle); + FSysMenuBounds := cxRectBounds(0, R.Top, H, H); + FSysMenuIconBounds := FSysMenuBounds; + end + else + begin + R := GetDefaultWindowBordersWidth(FormData.Handle); + FSysMenuBounds := cxRect(0, R.Top, GetSystemMetrics(SM_CYSIZE) + 2, GetWindowCaptionHeight - 2); + H := GetSystemMetrics(SM_CYSMICON); + FSysMenuIconBounds := cxRectBounds(0, R.Top, H, H); + OffsetRect(FSysMenuIconBounds, 0, (cxRectHeight(FSysMenuBounds) - H) div 2); + if FormData.State = wsMinimized then + OffsetRect(FSysMenuIconBounds, 4, 2); + end; + end; +end; + +procedure TdxRibbonFormCaptionHelper.CalculateTextBounds; +begin + FTextBounds := GetClientRect; + Inc(FTextBounds.Top); + FTextBounds.Left := FSysMenuIconBounds.Right; + FTextBounds.Bottom := GetWindowCaptionHeight; + if FBorderIcons <> [] then + FTextBounds.Right := FBorderIconsArea.Left; +end; + +procedure TdxRibbonFormCaptionHelper.DrawBorderIcons(ACanvas: TcxCanvas); +var + I: TBorderIcon; + R: TRect; +begin + if UseAeroNCPaint(FormData) then Exit; + for I := Low(TBorderIcon) to High(TBorderIcon) do + begin + if I in FBorderIcons then + begin + R := FBorderIconBounds[I]; + DrawWindowBorderIcon(ACanvas, R, I, GetBorderIconState(I)); + end; + end; +end; + +procedure TdxRibbonFormCaptionHelper.ExcludeCaptionRgn(DC: HDC); +var + R1, R2: HRGN; +begin + if FFormCaptionRegions[rfrClient] = 0 then Exit; + R1 := GetClipRegion(DC); + R2 := GetFormCaptionRegionsForDC(DC, rfrClient); + CombineRgn(R1, R1, R2, RGN_DIFF); + SelectClipRgn(DC, R1); + DeleteObject(R1); + DeleteObject(R2); +end; + +function TdxRibbonFormCaptionHelper.GetBorderIconState( + AIcon: TBorderIcon): TdxBorderIconState; +begin + if not FormData.Active then + begin + if BorderIconsMap[AIcon] = FHotBorderIcon then + Result := bisHotInactive + else + Result := bisInactive; + end + else + begin + if FPressedBorderIcon <> tbiNone then + begin + if (BorderIconsMap[AIcon] = FPressedBorderIcon) and (FPressedBorderIcon = FHotBorderIcon) then + Result := bisPressed + else + Result := bisNormal; + end + else if BorderIconsMap[AIcon] = FHotBorderIcon then + Result := bisHot + else + Result := bisNormal; + end; +end; + +function TdxRibbonFormCaptionHelper.GetButtonFromPos( + const P: TPoint): TBorderIcon; +var + I, AIcon: TBorderIcon; +begin + Result := biSystemMenu; + for I := Low(BorderIconOrder) to High(BorderIconOrder) do + begin + AIcon := BorderIconOrder[I]; + if (AIcon in FBorderIcons) and cxRectPtIn(FBorderIconBounds[AIcon], P) then + begin + Result := AIcon; + Exit; + end; + end; +end; + +function TdxRibbonFormCaptionHelper.GetClientRect: TRect; +var + R: TRect; +begin + if FormData.Handle > 0 then + begin + if FormData.State = wsMinimized then + begin + Result := FormData.Bounds; + R := GetWindowBordersWidth; + Dec(Result.Right, R.Left); + end + else + if not Windows.GetClientRect(FormData.Handle, Result) then + Result := cxNullRect; + end + else + Result := Control.ClientRect; +end; + +function TdxRibbonFormCaptionHelper.GetDrawIconFromBorderIcon( + AIcon: TBorderIcon): TdxBorderDrawIcon; +begin + case AIcon of + biMinimize: + begin + if FormData.State = wsMinimized then + Result := bdiRestore + else + Result := bdiMinimize; + end; + biMaximize: + begin + if FormData.State = wsMaximized then + Result := bdiRestore + else + Result := bdiMaximize; + end; + biSystemMenu: + Result := bdiClose; + else + Result := bdiHelp; + end; +end; + +function TdxRibbonFormCaptionHelper.GetForm: TCustomForm; +begin + if Control.Owner is TCustomForm then + Result := TCustomForm(Control.Owner) + else + Result := nil; +end; + +function TdxRibbonFormCaptionHelper.GetFormCaptionRegionsForDC(DC: HDC; + ARegionKind: TdxRibbonFormRegion): HRGN; +var + AWindowOrg, AViewportOrg: TPoint; +begin + Result := 0; + if FFormCaptionRegions[ARegionKind] = 0 then Exit; + Result := CreateRectRgnIndirect(cxEmptyRect); + CombineRgn(Result, FFormCaptionRegions[ARegionKind], 0, RGN_COPY); + GetWindowOrgEx(DC, AWindowOrg); + GetViewportOrgEx(DC, AViewportOrg); + OffsetRgn(Result, AViewportOrg.X - AWindowOrg.X, AViewportOrg.Y - AWindowOrg.Y); +end; + +function TdxRibbonFormCaptionHelper.GetHandle: THandle; +begin + Result := FOwner.Handle; +end; + +function TdxRibbonFormCaptionHelper.GetIsValid: Boolean; +begin + Result := FOwner.HandleAllocated and + (FOwner.ComponentState * [{csDestroying,} csLoading] = []); +end; + +function TdxRibbonFormCaptionHelper.IsBorderIconMouseEvent(const P: TPoint; + out CP: TPoint; ACheckComposition: Boolean = True): Boolean; +begin + CP := Control.ScreenToClient(P); + Result := not (ACheckComposition and UseAeroNCPaint(FormData)) and + cxRectPtIn(FBorderIconsArea, CP); +end; + +function TdxRibbonFormCaptionHelper.GetWindowCaptionBounds: TRect; +var + R: TRect; +begin + Result := Control.ClientRect; + if FormData.Handle <> 0 then + begin + Result := FormData.Bounds; + if FormData.State = wsMaximized then + begin + R := GetDefaultWindowBordersWidth(FormData.Handle); + Inc(Result.Left, R.Left); + Inc(Result.Top, R.Top); + Dec(Result.Right, R.Right); + end; + end; + Result.Bottom := Result.Top + GetWindowCaptionHeight; +end; + +function TdxRibbonFormCaptionHelper.GetWindowCaptionHeight: Integer; +begin + if (FormData.Handle <> 0) and (FormData.State = wsMinimized) then + Result := FormData.Bounds.Bottom - FormData.Bounds.Top + else + Result := IRibbonFormNonClientDraw.GetRibbonFormCaptionHeight +end; + +function TdxRibbonFormCaptionHelper.GetClientCaptionBounds: TRect; +var + R: TRect; +begin + if FormData.Handle <> 0 then + begin + Result := GetClientRect; + R := GetWindowBordersWidth; + Dec(Result.Left, R.Left); + Dec(Result.Top, R.Top); + Inc(Result.Right, R.Right); + end + else + Result := Control.ClientRect; + Result.Bottom := Result.Top + GetWindowCaptionHeight; +end; + +function TdxRibbonFormCaptionHelper.GetClientCaptionRegion: HRGN; +var + RW, B: TRect; + R: HRGN; +begin + if FFormCaptionRegions[rfrWindow] = 0 then + begin + Result := 0; + Exit; + end; + Result := CreateRectRgnIndirect(cxEmptyRect); + CombineRgn(Result, FFormCaptionRegions[rfrWindow], 0, RGN_COPY); + if (FormData.Handle <> 0) and (FormData.State <> wsMaximized) and GetWindowRect(FormData.Handle, RW) then + begin + OffsetRect(RW, -RW.Left, -RW.Top); + B := GetWindowBordersWidth; + R := CreateRectRgn(0, 0, B.Left, GetWindowCaptionHeight); + CombineRgn(Result, Result, R, RGN_DIFF); //exclude left border + DeleteObject(R); + R := CreateRectRgn(RW.Right - B.Right, 0, RW.Right, GetWindowCaptionHeight); + CombineRgn(Result, Result, R, RGN_DIFF); //exclude right border + DeleteObject(R); + OffsetRgn(Result, -B.Left, -B.Top); + end +end; + +function TdxRibbonFormCaptionHelper.GetFormCaptionDrawBounds: TRect; +begin + if (FormData.Handle <> 0) and (FormData.State = wsMinimized) then + begin + Result := GetClientRect; + Inc(Result.Right, GetWindowBordersWidth.Left); + end + else + Result := GetClientCaptionBounds; +end; + +function TdxRibbonFormCaptionHelper.GetNCHitTestRegion: HRGN; +var + R: HRGN; +begin + if FFormCaptionRegions[rfrClient] = 0 then + begin + Result := 0; + Exit; + end; + Result := CreateRectRgnIndirect(cxEmptyRect); + CombineRgn(Result, FFormCaptionRegions[rfrClient], 0, RGN_COPY); + R := GetApplicationButtonRegion; + if R <> 0 then + begin + CombineRgn(Result, Result, R, RGN_DIFF); + DeleteObject(R); + end; +end; + +function TdxRibbonFormCaptionHelper.GetWindowCaptionRegion: HRGN; +var + RW: TRect; +begin + if FormData.Handle = 0 then + begin + Result := 0; + Exit; + end; + RW := FormData.Bounds; + RW.Bottom := RW.Top + GetWindowCaptionHeight; + Result := CreateRectRgnIndirect(RW); +end; + +function TdxRibbonFormCaptionHelper.IsRoundedBottomCorners: Boolean; +begin + Result := not IsRectangularFormBottom(FormData); +end; + +procedure TdxRibbonFormCaptionHelper.RepaintBorderIcons; +var + ACanvas: TcxCanvas; + DC: HDC; +begin + if not Valid or UseAeroNCPaint(FormData) then Exit; + if FormData.State = wsMinimized then + begin + DC := GetDCEx(FormData.Handle, 0, DCX_CACHE or DCX_CLIPSIBLINGS or DCX_WINDOW or DCX_VALIDATE); + BarCanvas.BeginPaint(DC); + BarCanvas.Canvas.Lock; + try + BarCanvas.SetClipRegion(TcxRegion.Create(FBorderIconsArea), roSet); + BufferedDrawCaption(BarCanvas, ''); + finally + BarCanvas.Canvas.Unlock; + BarCanvas.EndPaint; + ReleaseDC(FormData.Handle, DC); + end; + end + else + begin + ACanvas := Control.ActiveCanvas; + ACanvas.Canvas.Lock; + try + ACanvas.SaveClipRegion; + ACanvas.SetClipRegion(TcxRegion.Create(FBorderIconsArea), roSet); + BufferedDrawCaption(ACanvas, ''); + ACanvas.RestoreClipRegion; + finally + ACanvas.Canvas.Unlock; + end; + end; +end; + +procedure TdxRibbonFormCaptionHelper.StartMouseTimer; +begin + if FMouseTimer <> nil then Exit; + FMouseTimer := TTimer.Create(nil); + FMouseTimer.Interval := 20; + FMouseTimer.OnTimer := MouseTimerHandler; +end; + +procedure TdxRibbonFormCaptionHelper.StopMouseTimer; +begin + FreeAndNil(FMouseTimer); +end; + +function TdxRibbonFormCaptionHelper.TestWinStyle(AStyle : DWORD) : Boolean; +begin + Result := (FormData.Handle <> 0) and + ((GetWindowLong(FormData.Handle, GWL_STYLE) and AStyle) <> 0); +end; + +function TdxRibbonFormCaptionHelper.MouseDown(const P: TPoint; + AButton: TMouseButton): Boolean; +var + CP: TPoint; +begin + Result := False; + if not Valid then Exit; + if (AButton = mbLeft) and IsBorderIconMouseEvent(P, CP) then + begin + Result := True; + FPressedBorderIcon := BorderIconsMap[GetButtonFromPos(CP)]; + RepaintBorderIcons; + SetCapture(FormData.Handle); + FWasCapture := True; + end; +end; + +function TdxRibbonFormCaptionHelper.MouseUp(const P: TPoint; + AButton: TMouseButton): Boolean; +const + Commands: array[Boolean, Boolean] of Word = ( + (SC_MINIMIZE, SC_RESTORE), + (SC_MAXIMIZE, SC_RESTORE)); +var + CP: TPoint; + AIcon: TBorderIcon; + ACommand: Word; +begin + Result := False; + if not Valid then Exit; + if AButton = mbLeft then + begin + if IsBorderIconMouseEvent(P, CP) and (FPressedBorderIcon <> tbiNone) then + begin + Result := True; + AIcon := GetButtonFromPos(CP); + if BorderIconsMap[AIcon] = FPressedBorderIcon then + begin + case AIcon of + biSystemMenu: + ACommand := SC_CLOSE; + biMinimize: + ACommand := Commands[False, FormData.State = wsMinimized]; + biMaximize: + ACommand := Commands[True, FormData.State = wsMaximized] + else + ACommand := SC_CONTEXTHELP; + end; + PostMessage(FormData.Handle, WM_SYSCOMMAND, ACommand, 0); + end; + FPressedBorderIcon := tbiNone; + RepaintBorderIcons; + end; + if FWasCapture and (GetCapture = FormData.Handle) then + ReleaseCapture; + end + else if (AButton = mbRight) and not IsBorderIconMouseEvent(P, CP, False) then + begin + Result := True; + ShowSystemMenu(P); + end; +end; + +procedure TdxRibbonFormCaptionHelper.MouseTimerHandler(Sender: TObject); + + function NeedRepaint(const AMousePos: TPoint; H: HWND): Boolean; + var + AClientPos: TPoint; + begin + AClientPos := AMousePos; + MapWindowPoint(0, H, AClientPos); + Result := not cxRectPtIn(FBorderIconsArea, AClientPos); + if not Result then + begin + if FormData.State = wsMinimized then + Result := WindowFromPoint(AMousePos) <> H + else + Result := RealChildWindowFromPoint(H, AClientPos) <> Handle; + end; + end; + +begin + if (FormData.Handle <> 0) and Valid then + begin + if NeedRepaint(GetMouseCursorPos, FormData.Handle) then + begin + FHotBorderIcon := tbiNone; + StopMouseTimer; + RepaintBorderIcons; + end; + end + else StopMouseTimer; +end; + +procedure TdxRibbonFormCaptionHelper.WMEraseBkgnd(var Message: TWMEraseBkgnd); +var + ASaveIndex: Integer; +begin + if Message.DC <> 0 then + begin + ASaveIndex := SaveDC(Message.DC); + ExcludeCaptionRgn(Message.DC); + inherited; + RestoreDC(Message.DC, ASaveIndex); + end + else + inherited; +end; + +procedure TdxRibbonFormCaptionHelper.WMNCHitTest(var Message: TWMNCHitTest); +begin + if CanProcessFormCaptionHitTest(Message.XPos, Message.YPos) then + Message.Result := HTTRANSPARENT + else + OriginalWndProc(Message); +end; + +procedure TdxRibbonFormCaptionHelper.WMPaint(var Message: TWMPaint); +begin + FIsClientDrawing := True; + OriginalWndProc(Message); + FIsClientDrawing := False; +end; + +procedure TdxRibbonFormCaptionHelper.WMSize(var Message: TWMSize); +begin + Calculate; + OriginalWndProc(Message); +end; + +procedure TdxRibbonFormCaptionHelper.WMShowWindow(var Message: TMessage); +begin + FHotBorderIcon := tbiNone; + FPressedBorderIcon := tbiNone; + if WordBool(Message.wParam) then + Calculate; + OriginalWndProc(Message); +end; + +procedure TdxRibbonFormCaptionHelper.OriginalWndProc(var Message); +begin + FOldWndProc(TMessage(Message)); +end; + +procedure TdxRibbonFormCaptionHelper.ShowSystemMenu(const P: TPoint); +var + M: HMENU; + ACommand: LongWord; +begin + M := GetSystemMenu(FormData.Handle, False); + ACommand := LongWord(TrackPopupMenu(M, TPM_RETURNCMD or TPM_TOPALIGN or TPM_LEFTALIGN, P.X, P.Y, 0, FormData.Handle, nil)); + PostMessage(FormData.Handle, WM_SYSCOMMAND, ACommand, 0); +end; + +procedure TdxRibbonFormCaptionHelper.UpdateCaptionArea(ACanvas: TcxCanvas = nil); +begin + if ACanvas = nil then + DrawWindowCaption(nil, '') + else + BufferedDrawCaption(ACanvas, ''); +end; + +procedure TdxRibbonFormCaptionHelper.UpdateNonClientArea; +begin + IRibbonFormNonClientDraw.UpdateNonClientArea; +end; + +procedure TdxRibbonFormCaptionHelper.DestroyCaptionRegions; +var + I: TdxRibbonFormRegion; +begin + for I := Low(TdxRibbonFormRegion) to High(TdxRibbonFormRegion) do + if FFormCaptionRegions[I] <> 0 then + begin + DeleteObject(FFormCaptionRegions[I]); + FFormCaptionRegions[I] := 0; + end; +end; + +procedure TdxRibbonFormCaptionHelper.WndProc(var Message: TMessage); +begin + if Control.IsDesigning then + OriginalWndProc(Message) + else + begin + case Message.Msg of + WM_SIZE: + WMSize(TWMSize(Message)); + WM_NCHITTEST: + WMNCHitTest(TWMNCHitTest(Message)); + WM_ERASEBKGND: + WMEraseBkgnd(TWMEraseBkgnd(Message)); + WM_PAINT: + WMPaint(TWMPaint(Message)); + WM_SHOWWINDOW: + WMShowWindow(Message); + else + OriginalWndProc(Message); + end; + end; +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxRibbonGallery.pas b/official/x.35/ExpressBars 6/Sources/dxRibbonGallery.pas new file mode 100644 index 00000000..37323be2 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxRibbonGallery.pas @@ -0,0 +1,8633 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars components } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxRibbonGallery; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, Messages, SysUtils, Graphics, Controls, StdCtrls, Contnrs, + ImgList, cxClasses, cxGraphics, cxGeometry, cxScrollBar, dxBar, + cxAccessibility, dxBarAccessibility, dxRibbon, cxControls, + cxLookAndFeelPainters, dxRibbonSkins; + +const + dxRibbonGalleryDefaultColumnCount = 5; + dxRibbonGalleryGroupItemIndent = 3; + dxRibbonGalleryMinColumnCount = 2; + +type + TdxRibbonDropDownGallery = class; + TdxRibbonDropDownGalleryControl = class; + TdxRibbonGalleryControl = class; + TdxRibbonGalleryControlViewInfo = class; + TdxRibbonGalleryFilter = class; + TdxRibbonGalleryFilterCategory = class; + TdxRibbonGalleryFilterMenuControl = class; + TdxRibbonGalleryGroup = class; + TdxRibbonGalleryGroupItemViewInfo = class; + TdxRibbonGalleryGroupOptions = class; + TdxRibbonGalleryGroupViewInfo = class; + TdxRibbonGalleryItem = class; + TdxRibbonGalleryScrollBar = class; + TdxRibbonOnSubMenuGalleryControlViewInfo = class; + + TdxRibbonDropDownGalleryNavigationDirection = (dgndNone, dgndUp, dgndDown); + TdxRibbonGalleryGroupItemTextKind = (itkNone, itkCaption, itkCaptionAndDescription); + TdxRibbonGalleryImagePosition = (gipLeft, gipRight, gipTop, + gipBottom); + TdxRibbonGalleryItemSelectionMode = (gsmNone, gsmSingle, gsmMultiple); + TdxRibbonGallerySubMenuResizing = (gsrNone, gsrHeight, gsrWidthAndHeight); + + { TcxItemSize } + + TcxItemSize = class(TcxSize) + private + FAssigned: Boolean; + FParent: TcxItemSize; + procedure SetAssigned(const Value: Boolean); + protected + procedure DoChange; override; + function GetValue(Index: Integer): Integer; override; + function IsSizeStored(Index: Integer): Boolean; override; + procedure SetSize(const Value: TSize); override; + + property Assigned: Boolean read FAssigned write SetAssigned; + property Parent: TcxItemSize read FParent write FParent; + end; + + { TdxRibbonGalleryItemPullHighlighting } + + TdxRibbonGalleryItemPullHighlightingDirection = (gphdStartToFinish, gphdFinishToStart); + + TdxRibbonGalleryItemPullHighlighting = class(TPersistent) + private + FActive: Boolean; + FIsAssigned: Boolean; + FDirection: TdxRibbonGalleryItemPullHighlightingDirection; + FParent: TdxRibbonGalleryItemPullHighlighting; + FOnChange: TNotifyEvent; + function GetActive: Boolean; + function GetDirection: TdxRibbonGalleryItemPullHighlightingDirection; + procedure SetActive(Value: Boolean); + procedure SetIsAssigned(Value: Boolean); + procedure SetDirection(Value: TdxRibbonGalleryItemPullHighlightingDirection); + protected + procedure DoChange; + function IsActiveStored: Boolean; virtual; + function IsDirectionStored: Boolean; virtual; + + property IsAssigned: Boolean read FIsAssigned write SetIsAssigned; + property Parent: TdxRibbonGalleryItemPullHighlighting read FParent write FParent; + public + procedure Assign(Source: TPersistent); override; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + published + property Active: Boolean read GetActive write SetActive stored IsActiveStored; + property Direction: TdxRibbonGalleryItemPullHighlightingDirection read GetDirection + write SetDirection stored IsDirectionStored; + end; + + { TdxRibbonGalleryCustomOptions } + + TdxRibbonGalleryCustomOptions = class(TPersistent) + private + FImages: TCustomImageList; + FImageChangeLink: TChangeLink; + FItemImagePosition: TdxRibbonGalleryImagePosition; + FItemImageSize: TcxItemSize; + FItemSize: TcxItemSize; + FItemTextKind: TdxRibbonGalleryGroupItemTextKind; + FOwner: TdxRibbonGalleryItem; + FItemPullHighlighting: TdxRibbonGalleryItemPullHighlighting; + FRemoveHorizontalItemPadding: Boolean; + FRemoveVerticalItemPadding: Boolean; + FSpaceAfterGroupHeader: Integer; + FSpaceBetweenItemCaptionAndDescription: Integer; + FSpaceBetweenItemImageAndText: Integer; + FSpaceBetweenItems: Integer; + procedure SetItemImageSize(Value: TcxItemSize); + procedure SetItemSize(Value: TcxItemSize); + procedure SetItemPullHighlighting(Value: TdxRibbonGalleryItemPullHighlighting); + protected + procedure Changed; virtual; + procedure CheckIntRange(var Value: Integer); + + function GetItemImagePosition: TdxRibbonGalleryImagePosition; virtual; + function GetItemTextKind: TdxRibbonGalleryGroupItemTextKind; virtual; + function GetRemoveHorizontalItemPadding: Boolean; virtual; + function GetRemoveVerticalItemPadding: Boolean; virtual; + function GetSpaceAfterGroupHeader: Integer; virtual; + function GetSpaceBetweenItems: Integer; virtual; + function GetSpaceBetweenItemCaptionAndDescription: Integer; virtual; + function GetSpaceBetweenItemImageAndText: Integer; virtual; + + function IsItemImagePositionStored: Boolean; virtual; + function IsItemImageSizeStored: Boolean; virtual; + function IsItemSizeStored: Boolean; virtual; + function IsItemTextKindStored: Boolean; virtual; + function IsItemPullHighlightingStored: Boolean; virtual; + function IsRemoveHorizontalItemPaddingStored: Boolean; virtual; + function IsRemoveVerticalItemPaddingStored: Boolean; virtual; + function IsSpaceAfterGroupHeaderStored: Boolean; virtual; + function IsSpaceBetweenItemCaptionAndDescriptionStored: Boolean; virtual; + function IsSpaceBetweenItemImageAndTextStored: Boolean; virtual; + function IsSpaceBetweenItemsStored: Boolean; virtual; + procedure ItemImageSizeChange(Sender: TObject); virtual; + procedure ItemSizeChange(Sender: TObject); virtual; + procedure ItemPullHighlightingChange(Sender: TObject); virtual; + + procedure SetImages(Value: TCustomImageList); virtual; + procedure SetItemImagePosition(Value: TdxRibbonGalleryImagePosition); virtual; + procedure SetItemTextKind(Value: TdxRibbonGalleryGroupItemTextKind); virtual; + procedure SetRemoveHorizontalItemPadding(Value: Boolean); virtual; + procedure SetRemoveVerticalItemPadding(Value: Boolean); virtual; + procedure SetSpaceAfterGroupHeader(Value: Integer); virtual; + procedure SetSpaceBetweenItems(Value: Integer); virtual; + procedure SetSpaceBetweenItemCaptionAndDescription(Value: Integer); virtual; + procedure SetSpaceBetweenItemImageAndText(Value: Integer); virtual; + + property ImageChangeLink: TChangeLink read FImageChangeLink; + property Owner: TdxRibbonGalleryItem read FOwner; + + property RemoveHorizontalItemPadding: Boolean + read GetRemoveHorizontalItemPadding write SetRemoveHorizontalItemPadding stored IsRemoveHorizontalItemPaddingStored; + property RemoveVerticalItemPadding: Boolean + read GetRemoveVerticalItemPadding write SetRemoveVerticalItemPadding stored IsRemoveVerticalItemPaddingStored; + public + constructor Create(AOwner: TdxRibbonGalleryItem); + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + property Images: TCustomImageList read FImages write SetImages; + property ItemImagePosition: TdxRibbonGalleryImagePosition + read GetItemImagePosition write SetItemImagePosition stored IsItemImagePositionStored; + property ItemImageSize: TcxItemSize + read FItemImageSize write SetItemImageSize stored IsItemImageSizeStored; + property ItemTextKind: TdxRibbonGalleryGroupItemTextKind + read GetItemTextKind write SetItemTextKind stored IsItemTextKindStored; + property ItemSize: TcxItemSize + read FItemSize write SetItemSize stored IsItemSizeStored; + property ItemPullHighlighting: TdxRibbonGalleryItemPullHighlighting read FItemPullHighlighting + write SetItemPullHighlighting stored IsItemPullHighlightingStored; + property SpaceAfterGroupHeader: Integer + read GetSpaceAfterGroupHeader write SetSpaceAfterGroupHeader stored IsSpaceAfterGroupHeaderStored; + property SpaceBetweenItems: Integer + read GetSpaceBetweenItems write SetSpaceBetweenItems stored IsSpaceBetweenItemsStored; + property SpaceBetweenItemCaptionAndDescription: Integer + read GetSpaceBetweenItemCaptionAndDescription write SetSpaceBetweenItemCaptionAndDescription stored IsSpaceBetweenItemCaptionAndDescriptionStored; + property SpaceBetweenItemImageAndText: Integer + read GetSpaceBetweenItemImageAndText write SetSpaceBetweenItemImageAndText stored IsSpaceBetweenItemImageAndTextStored; + end; + + { TdxRibbonGalleryGroupOptions } + + TdxRibbonGalleryGroupOptionsAssignedValue = ( + avItemImagePosition, avItemImageSize, avItemSize, avItemTextKind, + avItemPullHighlighting, {avRemoveHorizontalItemPadding, avRemoveVerticalItemPadding,} + avSpaceAfterGroupHeader, avSpaceBetweenItemCaptionAndDescription, + avSpaceBetweenItemImageAndText, avSpaceBetweenItems); + TdxRibbonGalleryGroupOptionsAssignedValues = set of TdxRibbonGalleryGroupOptionsAssignedValue; + + TdxRibbonGalleryGroupOptions = class(TdxRibbonGalleryCustomOptions) + private + FAssignedValues: TdxRibbonGalleryGroupOptionsAssignedValues; + FParentOptions: TdxRibbonGalleryCustomOptions; + procedure SetAssignedValues( + const Value: TdxRibbonGalleryGroupOptionsAssignedValues); + protected + function GetItemImagePosition: TdxRibbonGalleryImagePosition; override; + function GetItemTextKind: TdxRibbonGalleryGroupItemTextKind; override; + function GetRemoveHorizontalItemPadding: Boolean; override; + function GetRemoveVerticalItemPadding: Boolean; override; + function GetSpaceAfterGroupHeader: Integer; override; + function GetSpaceBetweenItems: Integer; override; + function GetSpaceBetweenItemCaptionAndDescription: Integer; override; + function GetSpaceBetweenItemImageAndText: Integer; override; + + function IsSpaceAfterGroupHeaderStored: Boolean; override; + function IsSpaceBetweenItemsStored: Boolean; override; + function IsSpaceBetweenItemCaptionAndDescriptionStored: Boolean; override; + function IsSpaceBetweenItemImageAndTextStored: Boolean; override; + function IsItemImagePositionStored: Boolean; override; + function IsItemImageSizeStored: Boolean; override; + function IsItemTextKindStored: Boolean; override; + function IsItemSizeStored: Boolean; override; + function IsItemPullHighlightingStored: Boolean; override; + function IsRemoveHorizontalItemPaddingStored: Boolean; override; + function IsRemoveVerticalItemPaddingStored: Boolean; override; + procedure ItemImageSizeChange(Sender: TObject); override; + procedure ItemSizeChange(Sender: TObject); override; + procedure ItemPullHighlightingChange(Sender: TObject); override; + + procedure SetItemImagePosition(Value: TdxRibbonGalleryImagePosition); override; + procedure SetItemTextKind(Value: TdxRibbonGalleryGroupItemTextKind); override; + procedure SetRemoveHorizontalItemPadding(Value: Boolean); override; + procedure SetRemoveVerticalItemPadding(Value: Boolean); override; + procedure SetSpaceAfterGroupHeader(Value: Integer); override; + procedure SetSpaceBetweenItems(Value: Integer); override; + procedure SetSpaceBetweenItemCaptionAndDescription(Value: Integer); override; + procedure SetSpaceBetweenItemImageAndText(Value: Integer); override; + + property ParentOptions: TdxRibbonGalleryCustomOptions read FParentOptions; + public + constructor Create(AOwner: TdxRibbonGalleryItem; + AParentOptions: TdxRibbonGalleryCustomOptions; AGroup: TdxRibbonGalleryGroup); + published + property AssignedValues: TdxRibbonGalleryGroupOptionsAssignedValues + read FAssignedValues write SetAssignedValues default []; + property Images; + property ItemImagePosition; + property ItemImageSize; + property ItemTextKind; + property ItemSize; + property ItemPullHighlighting; + {property RemoveHorizontalItemPadding; + property RemoveVerticalItemPadding;} + property SpaceAfterGroupHeader; + property SpaceBetweenItems; + property SpaceBetweenItemCaptionAndDescription; + property SpaceBetweenItemImageAndText; + end; + + { TdxRibbonGalleryOptions } + + TdxRibbonGalleryOptions = class(TdxRibbonGalleryCustomOptions) + private + FCanCollapse: Boolean; + FCollapsed: Boolean; + FColumnCount: Integer; + FEqualItemSizeInAllGroups: Boolean; + FItemAllowDeselect: Boolean; + FItemSelectionMode: TdxRibbonGalleryItemSelectionMode; + FMinColumnCount: Integer; + FRowCount: Integer; + FShowScrollbar: Boolean; // deprecated + FSpaceBetweenGroups: Integer; + FSpaceBetweenItemsAndBorder: Integer; + FSubMenuResizing: TdxRibbonGallerySubMenuResizing; + procedure SetCanCollapse(Value: Boolean); + procedure SetCollapsed(Value: Boolean); + procedure SetColumnCount(Value: Integer); + procedure SetSpaceBetweenGroups(Value: Integer); + procedure SetEqualItemSizeInAllGroups(Value: Boolean); + procedure SetItemSelectionMode(Value: TdxRibbonGalleryItemSelectionMode); + procedure SetMinColumnCount(Value: Integer); + procedure SetRowCount(Value: Integer); + procedure SetSpaceBetweenItemsAndBorder(Value: Integer); + public + constructor Create(AOwner: TdxRibbonGalleryItem); + procedure Assign(Source: TPersistent); override; + published + property CanCollapse: Boolean read FCanCollapse write SetCanCollapse default True; + property Collapsed: Boolean read FCollapsed write SetCollapsed default False; + property ColumnCount: Integer read FColumnCount write SetColumnCount + default dxRibbonGalleryDefaultColumnCount; + property EqualItemSizeInAllGroups: Boolean read FEqualItemSizeInAllGroups + write SetEqualItemSizeInAllGroups default True; + property Images; + property ItemAllowDeselect: Boolean read FItemAllowDeselect + write FItemAllowDeselect default False; + property ItemImagePosition; + property ItemImageSize; + property ItemSelectionMode: TdxRibbonGalleryItemSelectionMode + read FItemSelectionMode write SetItemSelectionMode default gsmSingle; + property ItemSize; + property ItemPullHighlighting; + property ItemTextKind; + property MinColumnCount: Integer read FMinColumnCount + write SetMinColumnCount default dxRibbonGalleryMinColumnCount; + {property RemoveHorizontalItemPadding; + property RemoveVerticalItemPadding;} + property RowCount: Integer read FRowCount write SetRowCount default 0; + property ShowScrollbar: Boolean read FShowScrollbar write FShowScrollbar stored False; // deprecated + property SpaceAfterGroupHeader; + property SpaceBetweenGroups: Integer read FSpaceBetweenGroups + write SetSpaceBetweenGroups default 0; + property SpaceBetweenItemCaptionAndDescription; + property SpaceBetweenItemImageAndText; + property SpaceBetweenItems; + property SpaceBetweenItemsAndBorder: Integer read FSpaceBetweenItemsAndBorder + write SetSpaceBetweenItemsAndBorder default 1; + property SubMenuResizing: TdxRibbonGallerySubMenuResizing read FSubMenuResizing + write FSubMenuResizing default gsrWidthAndHeight; + end; + + { TdxRibbonGalleryGroupHeader } + + TdxRibbonGalleryGroupHeader = class(TPersistent) + private + FAlignment: TAlignment; + FCaption: string; + FOwner: TdxRibbonGalleryGroup; + FVisible: Boolean; + procedure SetAlignment(Value: TAlignment); + procedure SetCaption(const Value: string); + procedure SetVisible(Value: Boolean); + protected + procedure Changed; + public + constructor Create(AOwner: TdxRibbonGalleryGroup); + procedure Assign(Source: TPersistent); override; + published + property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify; + property Caption: string read FCaption write SetCaption; + property Visible: Boolean read FVisible write SetVisible default False; + end; + + { TdxRibbonGalleryGroupItem } + + TdxRibbonGalleryGroupItem = class(TCollectionItem) + private + FCaption: string; + FDescription: string; + FGlyph: TBitmap; + FImageIndex: TImageIndex; + FSelected: Boolean; + FTag: TcxTag; + FOnClick: TNotifyEvent; + function GetGroup: TdxRibbonGalleryGroup; + function GetSelected: Boolean; + function GetSelectionMode: TdxRibbonGalleryItemSelectionMode; + procedure GlyphChanged(Sender: TObject); + procedure SetCaption(const Value: string); + procedure SetDescription(const Value: string); + procedure SetGlyph(Value: TBitmap); + procedure SetImageIndex(Value: TImageIndex); + procedure SetSelected(Value: Boolean); + protected + procedure DoClick; dynamic; + procedure DrawImage(DC: HDC; const ARect: TRect); + function GetImageSize: TSize; + function IsImageAssigned: Boolean; + property LoadedSelected: Boolean read FSelected write FSelected; + property SelectionMode: TdxRibbonGalleryItemSelectionMode read GetSelectionMode; + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + property Group: TdxRibbonGalleryGroup read GetGroup; + published + property Caption: string read FCaption write SetCaption; + property Description: string read FDescription write SetDescription; + property Glyph: TBitmap read FGlyph write SetGlyph; + property ImageIndex: TImageIndex read FImageIndex write SetImageIndex default -1; + property Selected: Boolean read GetSelected write SetSelected default False; + property Tag: TcxTag read FTag write FTag default 0; + property OnClick: TNotifyEvent read FOnClick write FOnClick; + end; + + { TdxRibbonGalleryGroupItems } + + TdxRibbonGalleryGroupItems = class(TCollection) + private + FGroup: TdxRibbonGalleryGroup; + function GetItem(Index: Integer): TdxRibbonGalleryGroupItem; + procedure SetItem(Index: Integer; Value: TdxRibbonGalleryGroupItem); + protected + function GetOwner: TPersistent; override; + procedure Update(Item: TCollectionItem); override; + + property Group: TdxRibbonGalleryGroup read FGroup; + public + constructor Create(AGroup: TdxRibbonGalleryGroup); virtual; + function Add: TdxRibbonGalleryGroupItem; + function Insert(Index: Integer): TdxRibbonGalleryGroupItem; + property Items[Index: Integer]: TdxRibbonGalleryGroupItem read GetItem write SetItem; default; + end; + + { TdxRibbonGalleryGroup } + + TdxRibbonGalleryGroup = class(TCollectionItem) + private + FHeader: TdxRibbonGalleryGroupHeader; + FItems: TdxRibbonGalleryGroupItems; + FOptions: TdxRibbonGalleryGroupOptions; + FVisible: Boolean; + function GetGalleryItem: TdxRibbonGalleryItem; + function GetImages: TCustomImageList; + procedure ImagesChange(Sender: Tobject); + procedure Notification(AComponent: TComponent; Operation: TOperation); + procedure SetHeader(Value: TdxRibbonGalleryGroupHeader); + procedure SetItems(Value: TdxRibbonGalleryGroupItems); + procedure SetOptions(Value: TdxRibbonGalleryGroupOptions); + procedure SetVisible(Value: Boolean); + protected + property Images: TCustomImageList read GetImages; + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + property GalleryItem: TdxRibbonGalleryItem read GetGalleryItem; + published + property Header: TdxRibbonGalleryGroupHeader read FHeader write SetHeader; + property Items: TdxRibbonGalleryGroupItems read FItems write SetItems; + property Options: TdxRibbonGalleryGroupOptions read FOptions write SetOptions; + property Visible: Boolean read FVisible write SetVisible default True; + end; + + { TdxRibbonGalleryGroups } + + TdxRibbonGalleryGroups = class(TCollection) + private + FGalleryItem: TdxRibbonGalleryItem; + function GetItem(Index: Integer): TdxRibbonGalleryGroup; + procedure RemoveFromFilter(AItem: TCollectionItem); + procedure SetItem(Index: Integer; Value: TdxRibbonGalleryGroup); + protected + function GetOwner: TPersistent; override; + procedure Notify(Item: TCollectionItem; Action: TCollectionNotification); override; + procedure Update(Item: TCollectionItem); override; + property GalleryItem: TdxRibbonGalleryItem read FGalleryItem; + public + constructor Create(AGalleryItem: TdxRibbonGalleryItem); virtual; + function Add: TdxRibbonGalleryGroup; + function Insert(Index: Integer): TdxRibbonGalleryGroup; + property Items[Index: Integer]: TdxRibbonGalleryGroup read GetItem write SetItem; default; + end; + + { TdxRibbonGalleryFilterCategoryGroups } + + TdxRibbonGalleryFilterCategoryGroups = class(TList) + private + FFilterCategory: TdxRibbonGalleryFilterCategory; + function CanAddGroup(AGroup: TdxRibbonGalleryGroup): Boolean; + function GetItem(Index: Integer): TdxRibbonGalleryGroup; + protected + procedure Notify(Ptr: Pointer; Action: TListNotification); override; + public + constructor Create(AFilterCategory: TdxRibbonGalleryFilterCategory); + procedure Assign(ASource: TdxRibbonGalleryFilterCategoryGroups); + function Add(AGroup: TdxRibbonGalleryGroup): Integer; + procedure Insert(AIndex: Integer; AGroup: TdxRibbonGalleryGroup); + property FilterCategory: TdxRibbonGalleryFilterCategory read FFilterCategory; + property Items[Index: Integer]: TdxRibbonGalleryGroup read GetItem; default; + end; + + { TdxRibbonGalleryFilterCategory } + + TdxRibbonGalleryFilterCategory = class(TCollectionItem) + private + FCaption: string; + FGroups: TdxRibbonGalleryFilterCategoryGroups; + function GetGalleryItem: TdxRibbonGalleryItem; + procedure ReadCategoryGroups(AReader: TReader); + procedure WriteCategoryGroups(AWriter: TWriter); + protected + procedure DefineProperties(Filer: TFiler); override; + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + property GalleryItem: TdxRibbonGalleryItem read GetGalleryItem; + published + property Caption: string read FCaption write FCaption; + property Groups: TdxRibbonGalleryFilterCategoryGroups read FGroups stored False; + end; + + { TdxRibbonGalleryFilterCategories } + + TdxRibbonGalleryFilterCategories = class(TCollection) + private + FGalleryFilter: TdxRibbonGalleryFilter; + function GetItem(Index: Integer): TdxRibbonGalleryFilterCategory; + procedure SetItem(Index: Integer; Value: TdxRibbonGalleryFilterCategory); + protected + procedure DeleteGroup(AGroup: TdxRibbonGalleryGroup); + function GetOwner: TPersistent; override; + procedure Update(Item: TCollectionItem); override; + + property GalleryFilter: TdxRibbonGalleryFilter read FGalleryFilter; + public + constructor Create(AGalleryFilter: TdxRibbonGalleryFilter); + function Add: TdxRibbonGalleryFilterCategory; + property Items[Index: Integer]: TdxRibbonGalleryFilterCategory read GetItem + write SetItem; default; + end; + + { TdxRibbonGalleryFilter } + + TdxRibbonGalleryFilter = class(TPersistent) + private + FActiveCategoryIndex: Integer; + FCaption: string; + FCategories: TdxRibbonGalleryFilterCategories; + FGalleryItem: TdxRibbonGalleryItem; + FLoadedActiveCategoryIndex: Integer; + FVisible: Boolean; + procedure SetActiveCategoryIndex(Value: Integer); + procedure SetCaption(const Value: string); + procedure SetCategories(Value: TdxRibbonGalleryFilterCategories); + protected + procedure CategoriesChanged; + function GetOwner: TPersistent; override; + procedure Loaded; + property GalleryItem: TdxRibbonGalleryItem read FGalleryItem; + public + constructor Create(AGalleryItem: TdxRibbonGalleryItem); + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function IsGroupFiltered(AGroup: TdxRibbonGalleryGroup): Boolean; + published + property ActiveCategoryIndex: Integer read FActiveCategoryIndex + write SetActiveCategoryIndex default -1; + property Caption: string read FCaption write SetCaption; + property Categories: TdxRibbonGalleryFilterCategories read FCategories + write SetCategories; + property Visible: Boolean read FVisible write FVisible default False; + end; + + { TdxRibbonGalleryItem } + + TdxRibbonGalleryFilterChangedEvent = procedure( + Sender: TdxRibbonGalleryItem) of object; + TdxRibbonGalleryGroupItemClickEvent = procedure(Sender: TdxRibbonGalleryItem; + AItem: TdxRibbonGalleryGroupItem) of object; + TdxRibbonGalleryHotTrackedItemChangedEvent = procedure( + APrevHotTrackedGroupItem, ANewHotTrackedGroupItem: TdxRibbonGalleryGroupItem) of object; + + TdxRibbonGalleryInitFilterMenuEvent = procedure(Sender: TdxRibbonGalleryItem; + AItemLinks: TdxBarItemLinks) of object; + + TdxRibbonGalleryItem = class(TCustomdxBarSubItem) + private + FDefaultTextColor: TColor; + FDefaultTextColorDetermined: Boolean; + FDropDownGallery: TdxRibbonDropDownGallery; + FFilterChangedLockCount: Integer; + FGalleryFilter: TdxRibbonGalleryFilter; + FGalleryGroups: TdxRibbonGalleryGroups; + FGalleryOptions: TdxRibbonGalleryOptions; + FIsClone: Boolean; + FLockGroupItemClickEventsCount: Integer; + FRecalculatingOnFilterChanged: Boolean; + FSelectedGroupItem: TdxRibbonGalleryGroupItem; + FSelectedTextColor: TColor; + FSelectedTextColorDetermined: Boolean; + FOnFilterChanged: TdxRibbonGalleryFilterChangedEvent; + FOnGroupItemClick: TdxRibbonGalleryGroupItemClickEvent; + FOnHotTrackedItemChanged: TdxRibbonGalleryHotTrackedItemChangedEvent; + FOnInitFilterMenu: TdxRibbonGalleryInitFilterMenuEvent; + procedure NotifyGroups(AComponent: TComponent; Operation: TOperation); + procedure SetDropDownGallery(Value: TdxRibbonDropDownGallery); + procedure SetGalleryFilter(Value: TdxRibbonGalleryFilter); + procedure SetGalleryGroups(Value: TdxRibbonGalleryGroups); + procedure SetGalleryOptions(Value: TdxRibbonGalleryOptions); + procedure SetSelectedGroupItem(Value: TdxRibbonGalleryGroupItem); + protected + FClickedGroupItem: TdxRibbonGalleryGroupItem; + function AreGroupItemClickEventsLocked: Boolean; + function CanBePlacedOn(AParentKind: TdxBarItemControlParentKind; + AToolbar: TdxBar; out AErrorText: string): Boolean; override; + function CreateCloneForDropDownGallery: TdxRibbonGalleryItem; virtual; + procedure DoCloseUp; override; + procedure DoFilterChanged; + procedure DoGroupItemClick(AItem: TdxRibbonGalleryGroupItem); virtual; + procedure DoHotTrackedItemChanged(APrevHotTrackedGroupItem, + ANewHotTrackedGroupItem: TdxRibbonGalleryGroupItem); virtual; + procedure DoInitFilterMenu(AItemLinks: TdxBarItemLinks); + procedure DoPopup; override; + procedure FilterCaptionChanged; + procedure FilterChanged; + procedure GalleryChanged; + function GetFilterCaption: string; + function GetImages: TCustomImageList; + class function GetNewCaption: string; override; + procedure GroupVisibleChanged; + procedure ImagesChange(Sender: TObject); + function InternalCanMergeWith(AItem: TdxBarItem): Boolean; override; + function IsFilterVisible: Boolean; + procedure Loaded; override; + procedure LockFilterChanged(ALock: Boolean); + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure RemoveGroupItem(AItem: TdxRibbonGalleryGroupItem); + + property DefaultTextColor: TColor read FDefaultTextColor; + property IsClone: Boolean read FIsClone; + property RecalculatingOnFilterChanged: Boolean read FRecalculatingOnFilterChanged; + property SelectedTextColor: TColor read FSelectedTextColor; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure DoClick; override; + function GetAddMessageName: string; override; + function IsGroupVisible(AGroupIndex: Integer; + AIgnoreVisibleProperty: Boolean = False): Boolean; + procedure LockGroupItemClickEvents(ALock: Boolean); + property SelectedGroupItem: TdxRibbonGalleryGroupItem + read FSelectedGroupItem write SetSelectedGroupItem; + published + property DropDownGallery: TdxRibbonDropDownGallery read FDropDownGallery write SetDropDownGallery; + property ItemLinks; + property ItemOptions; + property GalleryGroups: TdxRibbonGalleryGroups read FGalleryGroups write SetGalleryGroups; + property GalleryFilter: TdxRibbonGalleryFilter read FGalleryFilter write SetGalleryFilter; + property GalleryOptions: TdxRibbonGalleryOptions read FGalleryOptions write SetGalleryOptions; + property OnCloseUp; + property OnFilterChanged: TdxRibbonGalleryFilterChangedEvent + read FOnFilterChanged write FOnFilterChanged; + property OnGroupItemClick: TdxRibbonGalleryGroupItemClickEvent read FOnGroupItemClick write FOnGroupItemClick; + property OnHotTrackedItemChanged: TdxRibbonGalleryHotTrackedItemChangedEvent read FOnHotTrackedItemChanged write FOnHotTrackedItemChanged; + property OnInitFilterMenu: TdxRibbonGalleryInitFilterMenuEvent + read FOnInitFilterMenu write FOnInitFilterMenu; + property OnPopup; + end; + + { TdxRibbonGalleryController } + + TdxRibbonGalleryController = class + private + FGroupItemHotTrackEnabled: Boolean; + FHintItem: TdxRibbonGalleryGroupItem; + FKeyboardHotGroupItem: TdxRibbonGalleryGroupItem; + FLastCommandFromKeyboard: Boolean; + procedure UnsetDownedFromGroupItem(AGroupItem: TdxRibbonGalleryGroupItem); + function GetFirstGroupItem: TdxRibbonGalleryGroupItem; + function GetGalleryItem: TdxRibbonGalleryItem; + function GetGroupCount: Integer; + function GetKeyboardHotGroupItem: TdxRibbonGalleryGroupItem; + function GetViewInfo: TdxRibbonGalleryControlViewInfo; + procedure SetHotGroupItem(const Value: TdxRibbonGalleryGroupItem); + protected + FOwner: TdxRibbonGalleryControl; + + procedure CancelHint; + function GetGroupItem(AGroupIndex, AIndex: Integer): TdxRibbonGalleryGroupItem; + procedure HotTrackItem(AItem: TdxRibbonGalleryGroupItem); + procedure SetHintItem(AItem: TdxRibbonGalleryGroupItem); + + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); virtual; + procedure MouseLeave; virtual; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); virtual; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); virtual; + + property GalleryItem: TdxRibbonGalleryItem read GetGalleryItem; + property GroupCount: Integer read GetGroupCount; + property GroupItemHotTrackEnabled: Boolean read FGroupItemHotTrackEnabled write FGroupItemHotTrackEnabled; + public + constructor Create(AOwner: TdxRibbonGalleryControl); virtual; + property KeyboardHotGroupItem: TdxRibbonGalleryGroupItem + read GetKeyboardHotGroupItem write FKeyboardHotGroupItem; + property ViewInfo: TdxRibbonGalleryControlViewInfo read GetViewInfo; + end; + + { TdxRibbonOnSubMenuGalleryController } + + TdxRibbonOnSubMenuGalleryController = class(TdxRibbonGalleryController) + private + FFilterMenuControl: TdxRibbonGalleryFilterMenuControl; + FTempEventHandler: TNotifyEvent; + procedure CheckFilterMenuHotTrack; + procedure FilterMenuButtonClick(Sender: TObject); + procedure FilterMenuCategoryButtonClick(Sender: TObject); + procedure FilterMenuGroupButtonClick(Sender: TObject); + function GetFirstGroupItem: TdxRibbonGalleryGroupItem; + function GetGalleryWidth: Integer; + function GetLastGroupItem: TdxRibbonGalleryGroupItem; + function GetViewInfo: TdxRibbonOnSubMenuGalleryControlViewInfo; + procedure HideFilterMenu; + procedure InitFilterMenu(AItemLinks: TdxBarItemLinks); + function IsFilterMenuInternalButton(AItem: TdxBarItem): Boolean; + procedure ShowFilterMenu; + protected + procedure FilterMenuControlDestroyed; + procedure HotTrackFirstGroupItem; + procedure HotTrackLastGroupItem; + function IsFilterMenuShowed: Boolean; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseLeave; override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure Navigation(ADirection: TcxAccessibilityNavigationDirection); + procedure PageDown; + procedure PageUp; + procedure Tabulation; + public + property ViewInfo: TdxRibbonOnSubMenuGalleryControlViewInfo read GetViewInfo; + end; + + { TdxRibbonGalleryFilterMenuControl } + + TdxRibbonGalleryFilterMenuControl = class(TdxBarInternalSubMenuControl) + private + FGalleryControl: TdxRibbonGalleryControl; + FGalleryControlLink: TcxObjectLink; + protected + function GetBehaviorOptions: TdxBarBehaviorOptions; override; + function GetPainter: TdxBarPainter; override; + procedure ProcessMouseDownMessageForMeaningParent(AWnd: HWND; AMsg: UINT; + const AMousePos: TPoint); override; + property GalleryControl: TdxRibbonGalleryControl read FGalleryControl; + public + constructor Create(AGalleryControl: TdxRibbonGalleryControl); reintroduce; + destructor Destroy; override; + end; + + { TdxRibbonGalleryControl } + + TdxRibbonGalleryControl = class(TdxBarSubItemControl) + private + FCollapsed: Boolean; + FController: TdxRibbonGalleryController; + FDropDownGalleryItem: TdxRibbonGalleryItem; + FHintBounds: TRect; + FHintItem: TdxRibbonGalleryGroupItem; + FIsClickOnItemsArea: Boolean; + FIsCollapsedAssigned: Boolean; + FIsDroppingDown: Boolean; + FIsNeedScrollBarLock: Boolean; + FScrollBar: TdxRibbonGalleryScrollBar; + FSizeChanged: Boolean; + FLockCalcParts: Boolean; + procedure DoScrollBarDropDown(Sender: TObject); + procedure DrawInvalid(const ABounds: TRect); + function GetCollapsed: Boolean; + function GetItem: TdxRibbonGalleryItem; + function GetViewInfo: TdxRibbonGalleryControlViewInfo; + procedure ObtainTextColors; + procedure SetCollapsed(Value: Boolean); + protected + //hints + function DoHint(var ANeedDeactivate: Boolean; out AHintText: string; out AShortCut: string): Boolean; override; + function GetHintPosition(const ACursorPos: TPoint; AHeight: Integer): TPoint; override; + procedure UpdateHint(AHintItem: TdxRibbonGalleryGroupItem; const ABounds: TRect); + + function CalcDefaultWidth: Integer; virtual; + function CalcMinHeight: Integer; virtual; + procedure CalcParts; override; + function CanClicked: Boolean; override; + procedure ControlUnclick(ByMouse: Boolean); override; + function CreateController: TdxRibbonGalleryController; virtual; + procedure DoCloseUp(AHadSubMenuControl: Boolean); override; + procedure DoDropDown(AByMouse: Boolean); override; + procedure DropDown(AByMouse: Boolean); override; + procedure EnabledChanged; override; + function GetClientHeight: Integer; + function GetClientWidth: Integer; + function GetDefaultHeightInSubMenu: Integer; override; + function GetDefaultWidthInSubMenu: Integer; override; + //function GetMinWidth: Integer; override; + function GetMouseWheelStep: Integer; + procedure GetSubMenuControlPositionParams(out P: TPoint; + out AOwnerWidth, AOwnerHeight: Integer); override; + function InternalGetDefaultWidth: Integer; override; + function WantsKey(Key: Word): Boolean; override; + + procedure CalcDrawParams(AFull: Boolean = True); override; + procedure ControlActivate(Immediately: Boolean); override; + procedure ControlClick(AByMouse: Boolean; AKey: Char = #0); override; + procedure CreateSubMenuControl; override; + procedure DoPaint(ARect: TRect; PaintType: TdxBarPaintType); override; + procedure FilterCaptionChanged; + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; override; + function GetGroups: TdxRibbonGalleryGroups; + function GetViewInfoClass: TdxBarItemControlViewInfoClass; override; + function GetVisibleGroupCount: Integer; + function HasSubMenu: Boolean; override; + function IsDestroyOnClick: Boolean; override; + function IsEnabledScrollBar: Boolean; + function IsHiddenForCustomization: Boolean; override; + function IsNeedScrollBar: Boolean; virtual; + function IsValidPainter: Boolean; + + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseLeave; override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + + procedure DoScrollBarScroll(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer); + procedure DoScrollBarMouseMove(Sender: TObject; Shift: TShiftState; + X, Y: Integer); + procedure ScrollBarSetup; + procedure SetScrollBarPosition(APosition: Integer); virtual; + + property Collapsed: Boolean read GetCollapsed write SetCollapsed; + property Controller: TdxRibbonGalleryController read FController; + property LockCalcParts: Boolean read FLockCalcParts write FLockCalcParts; + property ScrollBar: TdxRibbonGalleryScrollBar read FScrollBar; + property SizeChanged: Boolean read FSizeChanged write FSizeChanged; + public + constructor Create(AItemLink: TdxBarItemLink); override; + destructor Destroy; override; + + property ClientHeight: Integer read GetClientHeight; + property ClientWidth: Integer read GetClientWidth; + property Item: TdxRibbonGalleryItem read GetItem; + property ViewInfo: TdxRibbonGalleryControlViewInfo read GetViewInfo; + end; + + { TdxRibbonGalleryGroupElementViewInfo } + + TdxRibbonGalleryGroupElementViewInfo = class + private + FBounds: TRect; + FOwner: TdxRibbonGalleryGroupViewInfo; + protected + function GetCaption: string; virtual; abstract; + function GetFont: TFont; virtual; + function GetGalleryItemControl: TdxRibbonGalleryControl; + function GetTextFlags(AnAlignment: TAlignment): Integer; + public + constructor Create(AOwner: TdxRibbonGalleryGroupViewInfo); + procedure Calculate(const ABounds: TRect); virtual; + procedure Paint(ACanvas: TcxCanvas); virtual; + + property Bounds: TRect read FBounds; + property Caption: string read GetCaption; + property Font: TFont read GetFont; + property Owner: TdxRibbonGalleryGroupViewInfo read FOwner; + end; + + { TdxRibbonGalleryGroupHeaderViewInfo } + + TdxRibbonGalleryGroupHeaderViewInfo = class(TdxRibbonGalleryGroupElementViewInfo) + private + FTextBounds: TRect; + function IsVisible: Boolean; + protected + function GetCaption: string; override; + function GetHeight(AWidth: Integer; AWithSpaceAfterHeader: Boolean): Integer; + function GetTextBounds: TRect; virtual; + public + procedure Calculate(const ABounds: TRect); override; + procedure Paint(ACanvas: TcxCanvas); override; + property TextBounds: TRect read FTextBounds; + end; + + { TdxRibbonGalleryGroupItemViewInfo } + + TdxRibbonGalleryGroupItemViewInfo = class(TdxRibbonGalleryGroupElementViewInfo) + private + FCaptionBounds: TRect; + FCaptionWidth: Integer; + FDescriptionBounds: TRect; + FDescriptionLength: Integer; + // FDescriptionRect: TRect; + FDescriptionRowCount: Integer; + FDescriptionSize: TSize; + FGroupItem: TdxRibbonGalleryGroupItem; + FImageBounds: TRect; + FPredefinedItemSize: TSize; + procedure CheckCaptionFontStyle(AFont: TFont); + function GetDescriptionLenght: Integer; + function GetDescriptionRect: TRect; + function GetDowned: Boolean; + function GetHotGroupItem: TdxRibbonGalleryGroupItem; + function GetHorizontalImageIndent: Integer; + function GetHotTracked: Boolean; + function GetImagePlace: TSize; + function GetIsItemPullHighlighting: Boolean; + function GetItemSize: TSize; + function GetOptions: TdxRibbonGalleryGroupOptions; + function GetPainter: TdxBarSkinnedPainter; + function GetRectConsiderBounds(const ARect: TRect): TRect; + function GetSelected: Boolean; + function GetVerticalImageIndent: Integer; + function IsCaptionVisible: Boolean; + function IsDescriptionVisible: Boolean; + function IsImageVisible: Boolean; + function IsInplaceGallery: Boolean; + function IsMergeItemsImages: Boolean; + function IsThisGroupItem(AGroupItem: TdxRibbonGalleryGroupItem): Boolean; + function ItemHeightWithoutImage: Integer; + function ItemWidthWithoutImage: Integer; + protected + procedure DrawItemText(ACanvas: TcxCanvas); virtual; + function GetCaption: string; override; + function GetCaptionHeight: Integer; virtual; + function GetCaptionWidth: Integer; virtual; + function GetDescription: string; virtual; + function GetDescriptionHeight: Integer; virtual; + function GetDescriptionWidth: Integer; virtual; + function GetSpaceBetweenItemCaptionAndDescription: Integer; virtual; + function GetSpaceBetweenItemImageAndText: Integer; virtual; + function GetImageSize: TSize; virtual; + function GetUnsizedImageSize: TSize; virtual; + + function GetCaptionBounds: TRect; virtual; + function GetDescriptionBounds: TRect; virtual; + function GetImageBounds: TRect; virtual; + function GetTextLeft: Integer; virtual; + function GetTextRight: Integer; virtual; + function GetTextTop: Integer; virtual; + function IsBoldCaption: Boolean; virtual; + + procedure SetPredefinedItemSize(const AValue: TSize); + + property HorizontalImageIndent: Integer read GetHorizontalImageIndent; + property HotGroupItem: TdxRibbonGalleryGroupItem read GetHotGroupItem; + property IsItemPullHighlighting: Boolean read GetIsItemPullHighlighting; + property ItemSize: TSize read GetItemSize; + property Options: TdxRibbonGalleryGroupOptions read GetOptions; + property Painter: TdxBarSkinnedPainter read GetPainter; + property VerticalImageIndent: Integer read GetVerticalImageIndent; + public + constructor Create(AOwner: TdxRibbonGalleryGroupViewInfo; AGroupItem: TdxRibbonGalleryGroupItem); + procedure Calculate(const ABounds: TRect); override; + procedure Paint(ACanvas: TcxCanvas); override; + property Description: string read GetDescription; + property GroupItem: TdxRibbonGalleryGroupItem read FGroupItem; + end; + + { TdxRibbonGalleryGroupViewInfo } + + TdxRibbonGalleryGroupRepaintPart = (ggrpAll, ggrpBefore, ggrpAfter, ggrpBetween); + + TdxRibbonGalleryGroupViewInfo = class + private + FBounds: TRect; + FGroup: TdxRibbonGalleryGroup; + FHeader: TdxRibbonGalleryGroupHeaderViewInfo; + FItems: TcxObjectList; + FItemSize: TSize; + FOwner: TdxRibbonGalleryControlViewInfo; + function GetFirstItemInGroupRow(ARowIndex, AColumnCount: Integer): Integer; + function GetFont: TFont; + function GetItem(Index: Integer): TdxRibbonGalleryGroupItemViewInfo; + function GetItemCount: Integer; + function GetItemSize: TSize; + function GetOptions: TdxRibbonGalleryGroupOptions; + function GetPainter: TdxBarSkinnedPainter; + protected + function CalculateItemSize(const APredefinedItemSize: TSize): TSize; + procedure ClearItems; + procedure CreateGroupItem(AItemIndex: Integer; const ABounds: TRect); + function GetColumnCount(AWidth: Integer): Integer; virtual; + function GetColumnCountInRow(ARow: Integer; AGroupWidth: Integer): Integer; virtual; + function GetColumnLeft(AColumnIndex: Integer; AGroupLeft: Integer): Integer; virtual; + function GetColumnWidth: Integer; + function GetGroupWidth: Integer; + function GetHeaderBounds(AGroupBounds: TRect): TRect; + function GetItemColumn(AIndex: Integer; AGroupWidth: Integer): Integer; + function GetItemIndex(ARow, AColumn: Integer; AGroupWidth: Integer): Integer; + function GetItemRow(AGroupItemIndex: Integer; AGroupWidth: Integer): Integer; + function GetLastItemInGroupRow(ARowIndex, AColumnCount: Integer): Integer; + function GetRowCount(AGroupWidth: Integer): Integer; + function GetRowHeight: Integer; + function GetRowTop(ARowIndex: Integer; AGroupTop: Integer; AGroupWidth: Integer): Integer; virtual; + function GetSpaceBetweenItems(IsAflat: Boolean): Integer; + procedure RepaintChainOfItems(AnItemIndex: Integer; IsHotTrack: Boolean; + ACanvas: TcxCanvas; APart: TdxRibbonGalleryGroupRepaintPart = ggrpAll; + AnItemIndex2: Integer = 0); + procedure SetBounds(const ABounds: TRect); + + property Font: TFont read GetFont; + property Options: TdxRibbonGalleryGroupOptions read GetOptions; + property Painter: TdxBarSkinnedPainter read GetPainter; + public + constructor Create(AOwner: TdxRibbonGalleryControlViewInfo; + AGroup: TdxRibbonGalleryGroup; const AItemSize: TSize); + destructor Destroy; override; + procedure Calculate(AGroupTop, AGroupBottom: Integer; const AControlClientRect: TRect); + function GetHeight(AWidth: Integer): Integer; + procedure Paint(ACanvas: TcxCanvas); + property Bounds: TRect read FBounds; + property Group: TdxRibbonGalleryGroup read FGroup; + property Header: TdxRibbonGalleryGroupHeaderViewInfo read FHeader; + property ItemCount: Integer read GetItemCount; + property Items[Index: Integer]: TdxRibbonGalleryGroupItemViewInfo read GetItem; + property ItemSize: TSize read FItemSize; + property Owner: TdxRibbonGalleryControlViewInfo read FOwner; + end; + + { TdxRibbonGalleryControlViewInfo } + + TdxRibbonGalleryControlViewInfo = class(TdxBarItemControlViewInfo) + private + FDontDisplayHotTrackedGroupItem: Integer; + FDontDisplayGroupHeaderWhenHotTrackingGroupItem: Integer; + FDownedGroupItem: TdxRibbonGalleryGroupItem; + FGlobalItemSize: TSize; + FGroupItemStoredSizes: array of TSize; + FHotGroupItem: TdxRibbonGalleryGroupItem; + FLayoutOffset: Integer; + + function GetGroupCount: Integer; + function GetGroups(Index: Integer): TdxRibbonGalleryGroupViewInfo; + function GetGroupItemSize(AGroupIndex: Integer): TSize; + + procedure CalculateGlobalItemSize; + function GetControl: TdxRibbonGalleryControl; + function GetGalleryBounds: TRect; + function GetGalleryItem: TdxRibbonGalleryItem; + function GetGalleryOptions: TdxRibbonGalleryOptions; + function GetGallerySize: TSize; + function GetPainter: TdxBarSkinnedPainter; + function GetScrollBarBounds: TRect; + function GetScrollBarWidth: Integer; + + procedure DrawGroupItem(const AGroupItem: TdxRibbonGalleryGroupItem); + procedure RepaintChainOfGroups(ANewItem, AOldItem: TdxRibbonGalleryGroupItem); + protected + FGroups: TcxObjectList; + procedure DisplayGroupItem(AGroupItem: TdxRibbonGalleryGroupItem); virtual; + procedure DrawBackground(const R: TRect); virtual; abstract; + procedure DrawSelectedGroupItem(ASelectedGroupItem, AOldSelectedGroupItem: TdxRibbonGalleryGroupItem); + procedure GalleryChanged; + function GetAbsoluteGroupTop(AGroupIndex: Integer; + AWidth: Integer): Integer; + function GetControlBounds: TRect; virtual; + function GetGalleryHeight(AWidth: Integer): Integer; virtual; + function GetGalleryMargins: TRect; virtual; abstract; + function GetGroupItemCount(ALastGroupIndex: Integer): Integer; + function GetHeight(AWidth: Integer): Integer; virtual; + function GetLayoutWidth(AColumnCount: Integer; out AGroupItemWidthIsNull: Boolean): Integer; virtual; abstract; + function GetMaxGroupItemSize: TSize; virtual; + function GetGroupItem(X, Y: Integer): TdxRibbonGalleryGroupItem; + function GetGroupItemStoredSize(AGroupIndex: Integer): TSize; + function GetGroupItemViewInfo(AGroupItem: TdxRibbonGalleryGroupItem): TdxRibbonGalleryGroupItemViewInfo; + function GetLeftLayoutIndent: Integer; virtual; + function GetMinSize: TSize; virtual; abstract; + function GetNextButtonEnabled: Boolean; + function GetPreviousButtonEnabled: Boolean; + function GetRightLayoutIndent: Integer; virtual; + function GetVisibleGroupIndex(AStartGroupIndex: Integer; AIncreaseIndex: Boolean): Integer; + function GetVisibleNotEmptyGroupIndex(AStartGroupIndex: Integer; AIncreaseIndex: Boolean): Integer; + function InternalGetScrollBarWidth: Integer; virtual; abstract; + function IsGroupHeaderVisible: Boolean; virtual; + function IsGroupItemAtThisPlace(X, Y: Integer): Boolean; + function IsInRibbon: Boolean; virtual; + procedure RemoveGroupItem(AItem: TdxRibbonGalleryGroupItem); + procedure SetDownedGroupItem(const Value: TdxRibbonGalleryGroupItem); + procedure SetGroupItemStoredSize(const Value: TSize; AGroupIndex: Integer); + procedure SetHotGroupItem(Value: TdxRibbonGalleryGroupItem); + procedure ShowGroupItem(AGroupItem: TdxRibbonGalleryGroupItem); virtual; + + property DontDisplayHotTrackedGroupItem: Integer read FDontDisplayHotTrackedGroupItem write FDontDisplayHotTrackedGroupItem; + property DontDisplayGroupHeaderWhenHotTrackingGroupItem: Integer read FDontDisplayGroupHeaderWhenHotTrackingGroupItem write FDontDisplayGroupHeaderWhenHotTrackingGroupItem; + property DownedGroupItem: TdxRibbonGalleryGroupItem read FDownedGroupItem; + property GalleryBounds: TRect read GetGalleryBounds; + property GalleryItem: TdxRibbonGalleryItem read GetGalleryItem; + property GalleryOptions: TdxRibbonGalleryOptions read GetGalleryOptions; + property GallerySize: TSize read GetGallerySize; + property GlobalItemSize: TSize read FGlobalItemSize; + property HotGroupItem: TdxRibbonGalleryGroupItem read FHotGroupItem write SetHotGroupItem; + property LayoutOffset: Integer read FLayoutOffset; + property Painter: TdxBarSkinnedPainter read GetPainter; + property ScrollBarWidth: Integer read GetScrollBarWidth; + public + constructor Create(AControl: TdxBarItemControl); override; + destructor Destroy; override; + procedure Calculate(ALayoutOffset: Integer; AScrollCode: TScrollCode); virtual; + function IsCollapsed: Boolean; virtual; abstract; + procedure Paint; + property Control: TdxRibbonGalleryControl read GetControl; + property GroupCount: Integer read GetGroupCount; + property Groups[Index: Integer]: TdxRibbonGalleryGroupViewInfo read GetGroups; + property ScrollBarBounds: TRect read GetScrollBarBounds; + end; + + { TdxInRibbonGalleryControlViewInfo } + + TdxInRibbonGalleryControlViewInfo = class(TdxRibbonGalleryControlViewInfo, + IdxBarMultiColumnItemControlViewInfo) + private + FCollapsed: Boolean; + FColumnCount: Integer; + FControlHeight: Integer; + FIsScrolling: Boolean; + FRowCount: Integer; + FScrollingBreak: Boolean; + FScrollingRowCounter: Integer; + FTopVisibleRow: Integer; + FWidthForColumnCountInfos: array of TdxBarItemCachedWidthInfo; + procedure FillGroupItemList(AFirstVisibleRow, ALastVisibleRow, AColumnCount: Integer; AList: TObjectList); + function GetControlHeight: Integer; + function GetVisibleRowCount: Integer; + + // IdxBarMultiColumnItemControlViewInfo + function CanCollapse: Boolean; + function GetCollapsed: Boolean; + function GetColumnCount: Integer; + function GetMaxColumnCount: Integer; + function GetRowIndex(AGroupItemIndex, AColumnCount: Integer): Integer; + function GetMinColumnCount: Integer; + function GetSpaceBetweenItems(IsAflat: Boolean): Integer; + function GetWidthForColumnCount(AColumnCount: Integer): Integer; + function IsScrollingPossible(ARowDelta: Integer): Boolean; + procedure ScrollingRowCounterRelease; + procedure SetCollapsed(Value: Boolean); + procedure SetColumnCount(Value: Integer); + procedure SetScrollingRowCounter(Value: Integer); + protected + procedure BoundsCalculated; override; + procedure CalculateLayout(ALayoutOffset, AColumnCount: Integer; AGroupItemsList: TObjectList); + function CorrectGroupItemSize(const AGroupItemSize: TSize): TSize; + procedure DoScrolling(ARowDelta: Integer); + procedure DrawBackground(const R: TRect); override; + function GetControlMargins: TRect; virtual; + function GetGalleryMargins: TRect; override; + function GetLayoutWidth(AColumnCount: Integer; out AGroupItemWidthIsNull: Boolean): Integer; override; + function GetMaxGroupItemSize: TSize; override; + function GetBottomLayoutIndent: Integer; + function GetLeftLayoutIndent: Integer; override; + function GetRightLayoutIndent: Integer; override; + function GetTopLayoutIndent: Integer; + function InternalGetScrollBarWidth: Integer; override; + function IsInRibbon: Boolean; override; + procedure ShowGroupItem(AGroupItem: TdxRibbonGalleryGroupItem); override; + property ControlHeight: Integer read GetControlHeight; + public + procedure Calculate(ALayoutOffset: Integer; AScrollCode: TScrollCode); override; + function IsCollapsed: Boolean; override; + procedure ResetCachedValues; override; + end; + + { TdxRibbonOnSubMenuGalleryControlViewInfo } + + TdxRibbonOnSubMenuGalleryControlViewInfo = class(TdxRibbonGalleryControlViewInfo) + private + FFilterBandContentRect: TRect; + FFilterBandHotTrack: Boolean; + FFilterBandRect: TRect; + procedure CalculateFilterBand; + procedure DrawFilterBand; + procedure DrawFilterCaption; + function GetBottomSeparatorHeight: Integer; + function GetFilterBandHeight: Integer; + function GetHeightByRowCount(AWidth: Integer): Integer; + function GetSpaceBetweenItems(AGroupIndex: Integer; IsAflat: Boolean): Integer; + function NeedsDrawBottomSeparator: Boolean; + protected + procedure DisplayGroupItem(AGroupItem: TdxRibbonGalleryGroupItem); override; + procedure DrawBackground(const R: TRect); override; + function GetControlBounds: TRect; override; + function GetGalleryHeight(AWidth: Integer): Integer; override; + function GetGalleryMargins: TRect; override; + function GetHeight(AWidth: Integer): Integer; override; + function GetLayoutWidth(AColumnCount: Integer; out AGroupItemWidthIsNull: Boolean): Integer; override; + procedure GroupItemYRange(const AGroupItem: TdxRibbonGalleryGroupItem; + var ATop, ABottom: Integer); + function GetMinSize: TSize; override; + function InternalGetScrollBarWidth: Integer; override; + public + procedure Calculate(ALayoutOffset: Integer; AScrollCode: TScrollCode); override; + procedure GetFilterMenuShowingParams(out APosition: TPoint; + out AOwnerHeight: Integer); + function IsCollapsed: Boolean; override; + function IsPtInFilterBandHotTrackArea(const P: TPoint): Boolean; + procedure RepaintFilterBand; + procedure SetFilterBandHotTrack(AValue: Boolean); + end; + + { TdxRibbonGalleryControlAccessibilityHelper } + + TdxRibbonGalleryControlAccessibilityHelper = class(TdxBarSubItemControlAccessibilityHelper) + private + function GetControl: TdxRibbonGalleryControl; + function GetOnSubMenuController: TdxRibbonOnSubMenuGalleryController; + protected + // IdxBarAccessibilityHelper + function HandleNavigationKey(var AKey: Word): Boolean; override; + function IsNavigationKey(AKey: Word): Boolean; override; + + procedure GetKeyTipData(AKeyTipsData: TList); override; + procedure GetKeyTipInfo(out AKeyTipInfo: TdxBarKeyTipInfo); override; + procedure OnSubMenuHotTrack( + ANavigationDirection: TdxRibbonDropDownGalleryNavigationDirection); + function ShowDropDownWindow: Boolean; override; + + property Control: TdxRibbonGalleryControl read GetControl; + property OnSubMenuController: TdxRibbonOnSubMenuGalleryController + read GetOnSubMenuController; + end; + + { TdxRibbonDropDownGalleryControlAccessibilityHelper } + + TdxRibbonDropDownGalleryControlAccessibilityHelper = class(TdxBarSubMenuControlAccessibilityHelper) + private + function GetBarControl: TdxRibbonDropDownGalleryControl; + function GetInternalGalleryItemControlAccessibilityHelper: TdxRibbonGalleryControlAccessibilityHelper; + protected + // IdxBarAccessibilityHelper + function HandleNavigationKey(var AKey: Word): Boolean; override; + function IsNavigationKey(AKey: Word): Boolean; override; + + procedure HandleVertNavigationKey(AUpKey, AFocusItemControl: Boolean); override; + property BarControl: TdxRibbonDropDownGalleryControl read GetBarControl; + property InternalGalleryItemControlAccessibilityHelper: TdxRibbonGalleryControlAccessibilityHelper + read GetInternalGalleryItemControlAccessibilityHelper; + end; + + { TdxRibbonGalleryScrollBarViewInfo } + + TdxRibbonGalleryScrollBarViewInfo = class(TcxScrollBarViewInfo) + private + FDropDownButtonRect: TRect; + protected + procedure CalculateRects; override; + public + property DropDownButtonRect: TRect read FDropDownButtonRect; + end; + + { TdxRibbonGalleryScrollBar } + + TdxRibbonGalleryScrollBar = class(TcxScrollBar) + private + FGalleryControl: TdxRibbonGalleryControl; + FIsDropDownButtonPressed: Boolean; + FOnDropDown: TNotifyEvent; + procedure DoDropDown; + function GetButtonSkinState(AState: TcxButtonState): Integer; + function GetPainter: TdxBarSkinnedPainter; + function GetViewInfo: TdxRibbonGalleryScrollBarViewInfo; + function IsButtonEnabled(AButtonKind: TdxInRibbonGalleryScrollBarButtonKind): Boolean; + function IsDropDownButtonUnderMouse: Boolean; + procedure WMCaptureChanged(var Message: TMessage); message WM_CAPTURECHANGED; + procedure WMNCDestroy(var Message: TWMNCDestroy); message WM_NCDESTROY; + protected + procedure DoPaint(ACanvas: TcxCanvas); override; + procedure DrawScrollBarPart(ACanvas: TcxCanvas; const R: TRect; + APart: TcxScrollBarPart; AState: TcxButtonState); override; + function GetViewInfoClass: TcxScrollBarViewInfoClass; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + property GalleryControl: TdxRibbonGalleryControl read FGalleryControl; + property Painter: TdxBarSkinnedPainter read GetPainter; + property ViewInfo: TdxRibbonGalleryScrollBarViewInfo read GetViewInfo; + public + constructor Create(AGalleryControl: TdxRibbonGalleryControl); reintroduce; + function IsDropDownStyle: Boolean; + property IsDropDownButtonPressed: Boolean read FIsDropDownButtonPressed; + property OnDropDown: TNotifyEvent read FOnDropDown write FOnDropDown; + end; + + { TdxRibbonDropDownGallery } + + TdxRibbonDropDownGallery = class(TdxRibbonPopupMenu) + private + FGalleryItem: TdxRibbonGalleryItem; + procedure SetGalleryItem(Value: TdxRibbonGalleryItem); + protected + function CreateBarControl: TCustomdxBarControl; override; + function GetControlClass: TCustomdxBarControlClass; override; + function HasValidGalleryItem: Boolean; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + public + destructor Destroy; override; + published + property GalleryItem: TdxRibbonGalleryItem read FGalleryItem + write SetGalleryItem; + end; + + { TdxRibbonDropDownGalleryGalleryItemItemLinks } + + TdxRibbonDropDownGalleryGalleryItemItemLinks = class(TdxBarSubMenuControlItemLinks) + public + function CanContainItem(AItem: TdxBarItem; out AErrorText: string): Boolean; override; + end; + + { TdxRibbonDropDownGalleryControlPainter } + + TdxRibbonDropDownGalleryControlPainter = class(TdxRibbonBarPainter) + protected + function HasSizingBand(AGalleryControl: TdxRibbonDropDownGalleryControl): Boolean; + public + function GetSizingBandHeight( + AGalleryControl: TdxRibbonDropDownGalleryControl): Integer; virtual; + function PtInSizingArea(AGalleryControl: TdxRibbonDropDownGalleryControl; + const P: TPoint): Boolean; virtual; + procedure SubMenuControlDrawBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); override; + end; + + { TdxRibbonDropDownGalleryControl } + + TdxRibbonDropDownGalleryControl = class(TdxRibbonPopupMenuControl) + private + FGalleryItem: TdxRibbonGalleryItem; + FGalleryItemItemLinks: TdxRibbonDropDownGalleryGalleryItemItemLinks; + FHeight: Integer; + FInternalPainter: TdxRibbonDropDownGalleryControlPainter; + FIsResizingAssigned: Boolean; + FMouseWheelStep: Integer; + FResizing: TdxRibbonGallerySubMenuResizing; + FUseInternalSizeValue: Boolean; + function GetInternalGalleryItemControl: TdxRibbonGalleryControl; + function GetInternalPainter: TdxRibbonDropDownGalleryControlPainter; + function GetMouseWheelStep: Integer; + function GetResizing: TdxRibbonGallerySubMenuResizing; + procedure SetResizing(Value: TdxRibbonGallerySubMenuResizing); + procedure WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); message WM_GETMINMAXINFO; + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + procedure WMNCLButtonDown(var Message: TWMLButtonDown); message WM_NCLBUTTONDOWN; + protected + procedure CalcColumnItemRects(ATopIndex: Integer; + out ALastItemBottom: Integer); override; + function ChangeSizeByChildItemControl(out ASize: TSize): Boolean; override; + procedure CreateWnd; override; + function DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean; override; + function DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean; override; + procedure DoNCPaint(DC: HDC; const ARect: TRect); override; + function DoFindLinkWithAccel(AKey: Word; AShift: TShiftState; ACurrentLink: TdxBarItemLink): TdxBarItemLink; override; + function GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; override; + function GetClientOffset( + AIncludeDetachCaption: Boolean = True): TRect; override; + function GetItemsPaneSize: TSize; override; + function GetMinSize: TSize; virtual; + function GetViewInfoClass: TCustomdxBarControlViewInfoClass; override; + function IsControlExists(ABarItemControl: TdxBarItemControl): Boolean; override; + function IsSizingBandAtBottom: Boolean; + function MustFitInWorkAreaWidth: Boolean; override; + function NeedsMouseWheel: Boolean; override; + function NeedsSelectFirstItemOnDropDownByKey: Boolean; override; + procedure Resize; override; + procedure UpdateItem(AControl: TdxBarItemControl); override; + property GalleryItem: TdxRibbonGalleryItem read FGalleryItem write FGalleryItem; + property InternalGalleryItemControl: TdxRibbonGalleryControl + read GetInternalGalleryItemControl; + property InternalPainter: TdxRibbonDropDownGalleryControlPainter + read GetInternalPainter; + property Resizing: TdxRibbonGallerySubMenuResizing read GetResizing + write SetResizing; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; + end; + + { TdxRibbonDropDownGalleryControlViewInfo } + + TdxRibbonDropDownGalleryControlViewInfo = class(TdxBarSubMenuControlViewInfo) + private + function GetBarControl: TdxRibbonDropDownGalleryControl; + public + procedure Calculate; override; + property BarControl: TdxRibbonDropDownGalleryControl read GetBarControl; + end; + +implementation + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Math, Forms, cxContainer, dxBarSkinConsts, dxBarStrs, dxOffice11; + +const + DropDownInflateX = 3; + DropDownInflateY = 3; + DropDownOffsetX = 1; + DropDownOffsetY = 1; + + FilterArrowOffset = 1; + FilterArrowSize = 4; + FilterBandOffset = 1; + FilterMenuLeftBoundCorrection = 1; + GroupHeaderCaptionOffset = 11; + + FilterCaptionDelimiter = ','; + +type + TRelativeLineLocation = (rllBefore, rllInside, rllAfter); + + TCollectionItemAccess = class(TCollectionItem); + TCustomdxBarControlAccess = class(TCustomdxBarControl); + TcxSizeAccess = class(TcxSize); + TdxBarItemControlAccess = class(TdxBarItemControl); + TdxBarItemLinkAccess = class(TdxBarItemLink); + TdxBarItemLinksAccess = class(TdxBarItemLinks); + TdxBarManagerAccess = class(TdxBarManager); + TdxBarPainterAccess = class(TdxBarPainter); + TdxBarSkinnedPainterAccess = class(TdxBarSkinnedPainter); + +var + FDontShowFilterMenuOnMouseDown: Boolean; + +function AreLinesIntersected(ABegin1, AEnd1, ABegin2, AEnd2: Integer): Boolean; + + function IsPointOnLine(ABegin, AEnd, APoint: Integer): Boolean; + begin + Result := (ABegin <= APoint) and (APoint <= AEnd); + end; + +begin + Result := (IsPointOnLine(ABegin1, AEnd1, ABegin2)) or + (IsPointOnLine(ABegin1, AEnd1, AEnd2)) or + (IsPointOnLine(ABegin2, AEnd2, ABegin1)); +end; + +function AreLinesIntersectedStrictly(ABegin1, AEnd1, ABegin2, + AEnd2: Integer): Boolean; + + function IsPointOnLine(ABegin, AEnd, APoint: Integer): Boolean; + begin + Result := (ABegin < APoint) and (APoint < AEnd) + end; + +begin + Result := (IsPointOnLine(ABegin1, AEnd1, ABegin2)) or + (IsPointOnLine(ABegin1, AEnd1, AEnd2)) or + (IsPointOnLine(ABegin2, AEnd2, ABegin1)) or + (IsPointOnLine(ABegin2, AEnd2, AEnd1)) or + (ABegin1 = ABegin2) and (AEnd1 = AEnd2) or + (ABegin1 = AEnd2) and (AEnd1 = ABegin2); +end; + +function GetGroupViewInfo(AGalleryGroups: TdxRibbonGalleryGroups; + AGalleryControlViewInfo: TdxRibbonGalleryControlViewInfo; + AGroupIndex: Integer; + out DestroyAfterUse: Boolean): TdxRibbonGalleryGroupViewInfo; +var + I: Integer; +begin + Result := nil; + DestroyAfterUse := False; + if (AGalleryControlViewInfo.GalleryItem.IsGroupVisible(AGroupIndex)) and + (0 <= AGroupIndex) and (AGroupIndex < AGalleryGroups.Count) then + begin + for I := 0 to AGalleryControlViewInfo.GroupCount - 1 do + if AGalleryControlViewInfo.Groups[I].Group.Index = AGroupIndex then + begin + Result := AGalleryControlViewInfo.Groups[I]; + Break; + end; + if Result = nil then + begin + Result := TdxRibbonGalleryGroupViewInfo.Create(AGalleryControlViewInfo, + AGalleryGroups[AGroupIndex], cxNullSize); + DestroyAfterUse := True; + end; + end; +end; + +function GetOuterGroupItem(AItem1, + AItem2: TdxRibbonGalleryGroupItem; + ADirection: TdxRibbonGalleryItemPullHighlightingDirection): TdxRibbonGalleryGroupItem; +begin + Result := nil; + if AItem1 <> nil then + begin + if AItem2 <> nil then + begin + if AItem1.Group.Index > AItem2.Group.Index then + Result := AItem1 + else + if AItem1.Group.Index < AItem2.Group.Index then + Result := AItem2 + else + begin + if AItem1.Index > AItem2.Index then + Result := AItem1 + else + Result := AItem2; + end; + end + else + Result := AItem1; + end + else + if AItem2 <> nil then + Result := AItem2; + if (ADirection = gphdFinishToStart) and (AItem1 <> nil) and (AItem2 <> nil) then + begin + if Result = AItem1 then + Result := AItem2 + else + Result := AItem1; + end; +end; + +function GetItemPullHighlightingIdentifier(AGroupItem: TdxRibbonGalleryGroupItem): Integer; +var + AGeneralItemPullHighlighting: TdxRibbonGalleryItemPullHighlighting; + AGroup: TdxRibbonGalleryGroup; +begin + AGroup := AGroupItem.Group; + AGeneralItemPullHighlighting := AGroup.GalleryItem.GalleryOptions.ItemPullHighlighting; + if (AGroup.Options.ItemPullHighlighting.Active = AGeneralItemPullHighlighting.Active) and + (AGroup.Options.ItemPullHighlighting.Direction = AGeneralItemPullHighlighting.Direction) then + Result := -1 + else + Result := AGroup.Index; +end; + +function IsFirstLineShorterOrEqualThanSecond(ABegin1, AEnd1, ABegin2, + AEnd2: Integer): Boolean; +begin + Result := AEnd1 - ABegin1 <= AEnd2 - ABegin2; +end; + +function RelativeLocationOfLines(ShortLineBegin, ShortLineEnd, LongLineBegin, + LongLineEnd: Integer): TRelativeLineLocation; +begin + if (ShortLineBegin < LongLineBegin) then + Result := rllBefore + else + if (LongLineEnd < ShortLineEnd) then + Result := rllAfter + else + Result := rllInside; +end; + +function CanUseSize(const ASize: TSize): Boolean; +begin + Result := (ASize.cx > 0) and (ASize.cy > 0); +end; + +{ TcxItemSize } + +procedure TcxItemSize.DoChange; +begin + Assigned := True; + inherited; +end; + +function TcxItemSize.GetValue(Index: Integer): Integer; +begin + if (Parent = nil) or Assigned then + Result := inherited GetValue(Index) + else + Result := Parent.GetValue(Index); +end; + +function TcxItemSize.IsSizeStored(Index: Integer): Boolean; +begin + Result := ((Parent = nil) or Assigned) and inherited IsSizeStored(Index); +end; + +procedure TcxItemSize.SetAssigned(const Value: Boolean); +begin + FAssigned := Value; + if not Value then + PSize(Data)^ := cxNullSize; +end; + +procedure TcxItemSize.SetSize(const Value: TSize); +begin + Assigned := True; + inherited SetSize(Value); +end; + +{ TdxRibbonGalleryItemPullHighlighting } + +procedure TdxRibbonGalleryItemPullHighlighting.Assign(Source: TPersistent); +begin + if Source is TdxRibbonGalleryItemPullHighlighting then + begin + Active := TdxRibbonGalleryItemPullHighlighting(Source).Active; + Direction := TdxRibbonGalleryItemPullHighlighting(Source).Direction; + end + else + inherited Assign(Source); +end; + +procedure TdxRibbonGalleryItemPullHighlighting.DoChange; +begin + IsAssigned := True; + if Assigned(FOnChange) then + FOnChange(Self); +end; + +function TdxRibbonGalleryItemPullHighlighting.IsActiveStored: Boolean; +begin + Result := ((Parent = nil) or IsAssigned) and FActive; +end; + +function TdxRibbonGalleryItemPullHighlighting.IsDirectionStored: Boolean; +begin + Result := ((Parent = nil) or IsAssigned) and (FDirection <> gphdStartToFinish); +end; + +function TdxRibbonGalleryItemPullHighlighting.GetActive: Boolean; +begin + if (Parent = nil) or IsAssigned then + Result := FActive + else + Result := Parent.GetActive; +end; + +function TdxRibbonGalleryItemPullHighlighting.GetDirection: TdxRibbonGalleryItemPullHighlightingDirection; +begin + if (Parent = nil) or IsAssigned then + Result := FDirection + else + Result := Parent.GetDirection; +end; + +procedure TdxRibbonGalleryItemPullHighlighting.SetActive(Value: Boolean); +begin + FActive := Value; + DoChange; +end; + +procedure TdxRibbonGalleryItemPullHighlighting.SetIsAssigned(Value: Boolean); +begin + FIsAssigned := Value; + if not Value then + begin + if Parent = nil then + begin + FActive := False; + FDirection := gphdStartToFinish; + end + else + begin + FActive := Parent.Active; + FDirection := Parent.Direction; + end; + end; +end; + +procedure TdxRibbonGalleryItemPullHighlighting.SetDirection( + Value: TdxRibbonGalleryItemPullHighlightingDirection); +begin + FDirection := Value; + DoChange; +end; + +{ TdxRibbonGalleryCustomOptions } + +constructor TdxRibbonGalleryCustomOptions.Create(AOwner: TdxRibbonGalleryItem); +begin + inherited Create; + FOwner := AOwner; + + FImageChangeLink := TChangeLink.Create; + FItemImageSize := TcxItemSize.Create(Self); + FItemImageSize.OnChange := ItemImageSizeChange; + FItemSize := TcxItemSize.Create(Self); + FItemSize.OnChange := ItemSizeChange; + FItemTextKind := itkCaption; + FItemPullHighlighting := TdxRibbonGalleryItemPullHighlighting.Create; + FItemPullHighlighting.OnChange := ItemPullHighlightingChange; + FSpaceAfterGroupHeader := 0; + FSpaceBetweenItems := 0; + FSpaceBetweenItemCaptionAndDescription := 0; + FSpaceBetweenItemImageAndText := 0; +end; + +destructor TdxRibbonGalleryCustomOptions.Destroy; +begin + Images := nil; + FreeAndNil(FImageChangeLink); + FreeAndNil(FItemImageSize); + FreeAndNil(FItemSize); + FreeAndNil(FItemPullHighlighting); + inherited Destroy; +end; + +procedure TdxRibbonGalleryCustomOptions.Assign(Source: TPersistent); +begin + if Source is TdxRibbonGalleryCustomOptions then + begin + Images := TdxRibbonGalleryCustomOptions(Source).Images; + ItemImagePosition := TdxRibbonGalleryCustomOptions(Source).ItemImagePosition; + ItemImageSize := TdxRibbonGalleryCustomOptions(Source).ItemImageSize; + ItemTextKind := TdxRibbonGalleryCustomOptions(Source).ItemTextKind; + ItemSize := TdxRibbonGalleryCustomOptions(Source).ItemSize; + ItemPullHighlighting := TdxRibbonGalleryOptions(Source).ItemPullHighlighting; + RemoveHorizontalItemPadding := TdxRibbonGalleryCustomOptions(Source).RemoveHorizontalItemPadding; + RemoveVerticalItemPadding := TdxRibbonGalleryCustomOptions(Source).RemoveVerticalItemPadding; + SpaceAfterGroupHeader := TdxRibbonGalleryCustomOptions(Source).SpaceAfterGroupHeader; + SpaceBetweenItems := TdxRibbonGalleryCustomOptions(Source).SpaceBetweenItems; + SpaceBetweenItemCaptionAndDescription := TdxRibbonGalleryCustomOptions(Source).SpaceBetweenItemCaptionAndDescription; + SpaceBetweenItemImageAndText := TdxRibbonGalleryCustomOptions(Source).SpaceBetweenItemImageAndText; + end + else + inherited Assign(Source); +end; + +function TdxRibbonGalleryCustomOptions.GetSpaceAfterGroupHeader: Integer; +begin + Result := FSpaceAfterGroupHeader; +end; + +function TdxRibbonGalleryCustomOptions.GetSpaceBetweenItems: Integer; +begin + Result := FSpaceBetweenItems; +end; + +function TdxRibbonGalleryCustomOptions.GetSpaceBetweenItemCaptionAndDescription: Integer; +begin + Result := FSpaceBetweenItemCaptionAndDescription; +end; + +function TdxRibbonGalleryCustomOptions.GetSpaceBetweenItemImageAndText: Integer; +begin + Result := FSpaceBetweenItemImageAndText; +end; + +function TdxRibbonGalleryCustomOptions.GetItemImagePosition: TdxRibbonGalleryImagePosition; +begin + Result := FItemImagePosition; +end; + +function TdxRibbonGalleryCustomOptions.GetItemTextKind: TdxRibbonGalleryGroupItemTextKind; +begin + Result := FItemTextKind; +end; + +function TdxRibbonGalleryCustomOptions.GetRemoveHorizontalItemPadding: Boolean; +begin + Result := FRemoveHorizontalItemPadding; +end; + +function TdxRibbonGalleryCustomOptions.GetRemoveVerticalItemPadding: Boolean; +begin + Result := FRemoveVerticalItemPadding; +end; + +function TdxRibbonGalleryCustomOptions.IsRemoveHorizontalItemPaddingStored: Boolean; +begin + Result := FRemoveHorizontalItemPadding; +end; + +function TdxRibbonGalleryCustomOptions.IsRemoveVerticalItemPaddingStored: Boolean; +begin + Result := FRemoveVerticalItemPadding; +end; + +function TdxRibbonGalleryCustomOptions.IsSpaceAfterGroupHeaderStored: Boolean; +begin + Result := FSpaceAfterGroupHeader <> 0; +end; + +function TdxRibbonGalleryCustomOptions.IsSpaceBetweenItemsStored: Boolean; +begin + Result := FSpaceBetweenItems <> 0; +end; + +function TdxRibbonGalleryCustomOptions.IsSpaceBetweenItemCaptionAndDescriptionStored: Boolean; +begin + Result := FSpaceBetweenItemCaptionAndDescription <> 0; +end; + +function TdxRibbonGalleryCustomOptions.IsSpaceBetweenItemImageAndTextStored: Boolean; +begin + Result := FSpaceBetweenItemImageAndText <> 0; +end; + +function TdxRibbonGalleryCustomOptions.IsItemImagePositionStored: Boolean; +begin + Result := FItemImagePosition <> gipLeft; +end; + +function TdxRibbonGalleryCustomOptions.IsItemImageSizeStored: Boolean; +begin + Result := (FItemImageSize.Width <> 0) or (FItemImageSize.Height <> 0); +end; + +function TdxRibbonGalleryCustomOptions.IsItemTextKindStored: Boolean; +begin + Result := FItemTextKind <> itkCaption; +end; + +function TdxRibbonGalleryCustomOptions.IsItemSizeStored: Boolean; +begin + Result := (FItemSize.Width <> 0) or (FItemSize.Height <> 0); +end; + +function TdxRibbonGalleryCustomOptions.IsItemPullHighlightingStored: Boolean; +begin + Result := (FItemPullHighlighting.Active <> False) or + (FItemPullHighlighting.Direction <> gphdStartToFinish); +end; + +procedure TdxRibbonGalleryCustomOptions.Changed; +begin + FOwner.GalleryChanged; +end; + +procedure TdxRibbonGalleryCustomOptions.SetImages(Value: TCustomImageList); +begin + if FImages <> Value then + begin + if FImages <> nil then + begin + FImages.UnRegisterChanges(FImageChangeLink); + FImages.RemoveFreeNotification(FOwner); + end; + FImages := Value; + if Images <> nil then + begin + Images.RegisterChanges(FImageChangeLink); + Images.FreeNotification(FOwner); + end; + Changed; + end; +end; + +procedure TdxRibbonGalleryCustomOptions.SetItemImagePosition( + Value: TdxRibbonGalleryImagePosition); +begin + if FItemImagePosition <> Value then + begin + FItemImagePosition := Value; + Changed; + end; +end; + +procedure TdxRibbonGalleryCustomOptions.SetItemImageSize(Value: TcxItemSize); +begin + FItemImageSize.Assign(Value); +end; + +procedure TdxRibbonGalleryCustomOptions.SetItemTextKind(Value: TdxRibbonGalleryGroupItemTextKind); +begin + if FItemTextKind <> Value then + begin + FItemTextKind := Value; + Changed; + end; +end; + +procedure TdxRibbonGalleryCustomOptions.SetRemoveHorizontalItemPadding(Value: Boolean); +begin + if FRemoveHorizontalItemPadding <> Value then + begin + FRemoveHorizontalItemPadding := Value; + Changed; + end; +end; + +procedure TdxRibbonGalleryCustomOptions.SetRemoveVerticalItemPadding(Value: Boolean); +begin + if FRemoveVerticalItemPadding <> Value then + begin + FRemoveVerticalItemPadding := Value; + Changed; + end; +end; + +procedure TdxRibbonGalleryCustomOptions.SetItemSize(Value: TcxItemSize); +begin + FItemSize.Assign(Value); +end; + +procedure TdxRibbonGalleryCustomOptions.SetSpaceAfterGroupHeader( + Value: Integer); +begin + CheckIntRange(Value); + if FSpaceAfterGroupHeader <> Value then + begin + FSpaceAfterGroupHeader := Value; + Changed; + end; +end; + +procedure TdxRibbonGalleryCustomOptions.SetSpaceBetweenItems( + Value: Integer); +begin + CheckIntRange(Value); + if FSpaceBetweenItems <> Value then + begin + FSpaceBetweenItems := Value; + Changed; + end; +end; + +procedure TdxRibbonGalleryCustomOptions.SetSpaceBetweenItemCaptionAndDescription( + Value: Integer); +begin + CheckIntRange(Value); + if FSpaceBetweenItemCaptionAndDescription <> Value then + begin + FSpaceBetweenItemCaptionAndDescription := Value; + Changed; + end; +end; + +procedure TdxRibbonGalleryCustomOptions.SetSpaceBetweenItemImageAndText( + Value: Integer); +begin + CheckIntRange(Value); + if FSpaceBetweenItemImageAndText <> Value then + begin + FSpaceBetweenItemImageAndText := Value; + Changed; + end; +end; + +procedure TdxRibbonGalleryCustomOptions.CheckIntRange(var Value: Integer); +begin + Value := Max(0, Value) +end; + +procedure TdxRibbonGalleryCustomOptions.ItemImageSizeChange(Sender: TObject); +begin + Changed; +end; + +procedure TdxRibbonGalleryCustomOptions.ItemSizeChange(Sender: TObject); +begin + Changed; +end; + +procedure TdxRibbonGalleryCustomOptions.ItemPullHighlightingChange(Sender: TObject); +begin + Changed; +end; + +procedure TdxRibbonGalleryCustomOptions.SetItemPullHighlighting( + Value: TdxRibbonGalleryItemPullHighlighting); +begin + FItemPullHighlighting.Assign(Value); +end; + +{ TdxRibbonGalleryGroupOptions } + +constructor TdxRibbonGalleryGroupOptions.Create(AOwner: TdxRibbonGalleryItem; + AParentOptions: TdxRibbonGalleryCustomOptions; AGroup: TdxRibbonGalleryGroup); +begin + inherited Create(AOwner); + FParentOptions := AParentOptions; + FAssignedValues := []; + ImageChangeLink.OnChange := AGroup.ImagesChange; + FItemSize.Parent := AParentOptions.ItemSize; + FItemImageSize.Parent := AParentOptions.ItemImageSize; + FItemPullHighlighting.Parent := AParentOptions.ItemPullHighlighting; +end; + +function TdxRibbonGalleryGroupOptions.GetItemImagePosition: TdxRibbonGalleryImagePosition; +begin + if IsItemImagePositionStored then + Result := inherited GetItemImagePosition + else + Result := ParentOptions.GetItemImagePosition; +end; + +function TdxRibbonGalleryGroupOptions.GetItemTextKind: TdxRibbonGalleryGroupItemTextKind; +begin + if IsItemTextKindStored then + Result := inherited GetItemTextKind + else + Result := ParentOptions.GetItemTextKind; +end; + +function TdxRibbonGalleryGroupOptions.GetRemoveHorizontalItemPadding; +begin + if IsRemoveHorizontalItemPaddingStored then + Result := inherited GetRemoveHorizontalItemPadding + else + Result := ParentOptions.GetRemoveHorizontalItemPadding; +end; + +function TdxRibbonGalleryGroupOptions.GetRemoveVerticalItemPadding; +begin + if IsRemoveVerticalItemPaddingStored then + Result := inherited GetRemoveVerticalItemPadding + else + Result := ParentOptions.GetRemoveVerticalItemPadding; +end; + +function TdxRibbonGalleryGroupOptions.GetSpaceAfterGroupHeader: Integer; +begin + if IsSpaceAfterGroupHeaderStored then + Result := inherited GetSpaceAfterGroupHeader + else + Result := ParentOptions.GetSpaceAfterGroupHeader; +end; + +function TdxRibbonGalleryGroupOptions.GetSpaceBetweenItemCaptionAndDescription: Integer; +begin + if IsSpaceBetweenItemCaptionAndDescriptionStored then + Result := inherited GetSpaceBetweenItemCaptionAndDescription + else + Result := ParentOptions.GetSpaceBetweenItemCaptionAndDescription; +end; + +function TdxRibbonGalleryGroupOptions.GetSpaceBetweenItemImageAndText: Integer; +begin + if IsSpaceBetweenItemImageAndTextStored then + Result := inherited GetSpaceBetweenItemImageAndText + else + Result := ParentOptions.GetSpaceBetweenItemImageAndText; +end; + +function TdxRibbonGalleryGroupOptions.GetSpaceBetweenItems: Integer; +begin + if IsSpaceBetweenItemsStored then + Result := inherited GetSpaceBetweenItems + else + Result := ParentOptions.GetSpaceBetweenItems; +end; + +function TdxRibbonGalleryGroupOptions.IsItemImagePositionStored: Boolean; +begin + Result := avItemImagePosition in FAssignedValues; +end; + +function TdxRibbonGalleryGroupOptions.IsItemImageSizeStored: Boolean; +begin + Result := avItemImageSize in FAssignedValues; +end; + +function TdxRibbonGalleryGroupOptions.IsItemSizeStored: Boolean; +begin + Result := avItemSize in FAssignedValues; +end; + +function TdxRibbonGalleryGroupOptions.IsItemPullHighlightingStored: Boolean; +begin + Result := avItemPullHighlighting in FAssignedValues; +end; + +function TdxRibbonGalleryGroupOptions.IsRemoveHorizontalItemPaddingStored: Boolean; +begin + Result := False//avRemoveHorizontalItemPadding in FAssignedValues; +end; + +function TdxRibbonGalleryGroupOptions.IsRemoveVerticalItemPaddingStored: Boolean; +begin + Result := False//avRemoveVerticalItemPadding in FAssignedValues; +end; + +procedure TdxRibbonGalleryGroupOptions.ItemImageSizeChange(Sender: TObject); +begin + Include(FAssignedValues, avItemImageSize); + inherited ItemImageSizeChange(Sender); +end; + +procedure TdxRibbonGalleryGroupOptions.ItemSizeChange(Sender: TObject); +begin + Include(FAssignedValues, avItemSize); + inherited ItemSizeChange(Sender); +end; + +procedure TdxRibbonGalleryGroupOptions.ItemPullHighlightingChange(Sender: TObject); +begin + Include(FAssignedValues, avItemPullHighlighting); + inherited ItemPullHighlightingChange(Sender); +end; + +function TdxRibbonGalleryGroupOptions.IsItemTextKindStored: Boolean; +begin + Result := avItemTextKind in FAssignedValues; +end; + +function TdxRibbonGalleryGroupOptions.IsSpaceAfterGroupHeaderStored: Boolean; +begin + Result := avSpaceAfterGroupHeader in FAssignedValues; +end; + +function TdxRibbonGalleryGroupOptions.IsSpaceBetweenItemCaptionAndDescriptionStored: Boolean; +begin + Result := avSpaceBetweenItemCaptionAndDescription in FAssignedValues; +end; + +function TdxRibbonGalleryGroupOptions.IsSpaceBetweenItemImageAndTextStored: Boolean; +begin + Result := avSpaceBetweenItemImageAndText in FAssignedValues; +end; + +function TdxRibbonGalleryGroupOptions.IsSpaceBetweenItemsStored: Boolean; +begin + Result := avSpaceBetweenItems in FAssignedValues; +end; + +procedure TdxRibbonGalleryGroupOptions.SetAssignedValues( + const Value: TdxRibbonGalleryGroupOptionsAssignedValues); +begin + if FAssignedValues <> Value then + begin + FAssignedValues := Value; + ItemSize.Assigned := avItemSize in FAssignedValues; + ItemImageSize.Assigned := avItemImageSize in FAssignedValues; + ItemPullHighlighting.IsAssigned := avItemPullHighlighting in FAssignedValues; + Changed; + end; +end; + +procedure TdxRibbonGalleryGroupOptions.SetItemImagePosition( + Value: TdxRibbonGalleryImagePosition); +begin + Include(FAssignedValues, avItemImagePosition); + inherited; +end; + +procedure TdxRibbonGalleryGroupOptions.SetItemTextKind( + Value: TdxRibbonGalleryGroupItemTextKind); +begin + Include(FAssignedValues, avItemTextKind); + inherited; +end; + +procedure TdxRibbonGalleryGroupOptions.SetRemoveHorizontalItemPadding( + Value: Boolean); +begin +// Include(FAssignedValues, avRemoveHorizontalItemPadding); + inherited; +end; + +procedure TdxRibbonGalleryGroupOptions.SetRemoveVerticalItemPadding( + Value: Boolean); +begin +// Include(FAssignedValues, avRemoveVerticalItemPadding); + inherited; +end; + +procedure TdxRibbonGalleryGroupOptions.SetSpaceAfterGroupHeader(Value: Integer); +begin + Include(FAssignedValues, avSpaceAfterGroupHeader); + inherited; +end; + +procedure TdxRibbonGalleryGroupOptions.SetSpaceBetweenItemCaptionAndDescription( + Value: Integer); +begin + Include(FAssignedValues, avSpaceBetweenItemCaptionAndDescription); + inherited; +end; + +procedure TdxRibbonGalleryGroupOptions.SetSpaceBetweenItemImageAndText( + Value: Integer); +begin + Include(FAssignedValues, avSpaceBetweenItemImageAndText); + inherited; +end; + +procedure TdxRibbonGalleryGroupOptions.SetSpaceBetweenItems(Value: Integer); +begin + Include(FAssignedValues, avSpaceBetweenItems); + inherited; +end; + +{ TdxRibbonGalleryOptions } + +constructor TdxRibbonGalleryOptions.Create(AOwner: TdxRibbonGalleryItem); +begin + inherited Create(AOwner); + FCanCollapse := True; + FColumnCount := dxRibbonGalleryDefaultColumnCount; + FEqualItemSizeInAllGroups := True; + ImageChangeLink.OnChange := AOwner.ImagesChange; + FItemSelectionMode := gsmSingle; + FMinColumnCount := dxRibbonGalleryMinColumnCount; + //FShowScrollbar := True; deprecated + FSpaceBetweenItemsAndBorder := 1; + FSubMenuResizing := gsrWidthAndHeight; +end; + +procedure TdxRibbonGalleryOptions.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TdxRibbonGalleryOptions then + begin + CanCollapse := TdxRibbonGalleryOptions(Source).CanCollapse; + Collapsed := TdxRibbonGalleryOptions(Source).Collapsed; + ColumnCount := TdxRibbonGalleryOptions(Source).ColumnCount; + EqualItemSizeInAllGroups := TdxRibbonGalleryOptions(Source).EqualItemSizeInAllGroups; + ItemAllowDeselect := TdxRibbonGalleryOptions(Source).ItemAllowDeselect; + ItemSelectionMode := TdxRibbonGalleryOptions(Source).ItemSelectionMode; + MinColumnCount := TdxRibbonGalleryOptions(Source).MinColumnCount; + RowCount := TdxRibbonGalleryOptions(Source).RowCount; + //ShowScrollBar := TdxRibbonGalleryOptions(Source).ShowScrollbar; deprecated + SpaceBetweenGroups := TdxRibbonGalleryOptions(Source).SpaceBetweenGroups; + SpaceBetweenItemsAndBorder := TdxRibbonGalleryOptions(Source).SpaceBetweenItemsAndBorder; + SubMenuResizing := TdxRibbonGalleryOptions(Source).SubMenuResizing; + end; +end; + +procedure TdxRibbonGalleryOptions.SetCanCollapse(Value: Boolean); +begin + if Value <> FCanCollapse then + begin + FCanCollapse := Value; + Changed; + end; +end; + +procedure TdxRibbonGalleryOptions.SetCollapsed(Value: Boolean); +begin + if Value <> FCollapsed then + begin + FCollapsed := Value; + Changed; + end; +end; + +procedure TdxRibbonGalleryOptions.SetColumnCount(Value: Integer); +begin + if Value <> FColumnCount then + begin + FColumnCount := Max(Value, 1); + MinColumnCount := Min(MinColumnCount, FColumnCount); + Changed; + end; +end; + +procedure TdxRibbonGalleryOptions.SetSpaceBetweenGroups(Value: Integer); +begin + if Value <> FSpaceBetweenGroups then + begin + FSpaceBetweenGroups := Value; + Changed; + end; +end; + +procedure TdxRibbonGalleryOptions.SetEqualItemSizeInAllGroups(Value: Boolean); +begin + if Value <> FEqualItemSizeInAllGroups then + begin + FEqualItemSizeInAllGroups := Value; + Changed; + end; +end; + +procedure TdxRibbonGalleryOptions.SetItemSelectionMode( + Value: TdxRibbonGalleryItemSelectionMode); +var + I, J: Integer; +begin + if Owner.IsLoading then + FItemSelectionMode := Value + else + if Value <> FItemSelectionMode then + begin + Owner.LockGroupItemClickEvents(True); + try + case FItemSelectionMode of + gsmNone, gsmMultiple: + if Value = gsmSingle then + for I := 0 to Owner.GalleryGroups.Count - 1 do + for J := 0 to Owner.GalleryGroups[I].Items.Count - 1 do + Owner.GalleryGroups[I].Items[J].Selected := False; + gsmSingle: + Owner.SelectedGroupItem := nil; + end; + finally + Owner.LockGroupItemClickEvents(False); + end; + FItemSelectionMode := Value; + end; +end; + +procedure TdxRibbonGalleryOptions.SetMinColumnCount(Value: Integer); +begin + if Value <> FMinColumnCount then + begin + FMinColumnCount := Max(Value, 1); + ColumnCount := Max(FMinColumnCount, ColumnCount); + Changed; + end; +end; + +procedure TdxRibbonGalleryOptions.SetRowCount(Value: Integer); +begin + if Value <> FRowCount then + begin + FRowCount := Max(Value, 0); + Changed; + end; +end; + +procedure TdxRibbonGalleryOptions.SetSpaceBetweenItemsAndBorder( + Value: Integer); +begin + CheckIntRange(Value); + if FSpaceBetweenItemsAndBorder <> Value then + begin + FSpaceBetweenItemsAndBorder := Value; + Changed; + end; +end; + +{ TdxRibbonGalleryGroupHeader } + +constructor TdxRibbonGalleryGroupHeader.Create( + AOwner: TdxRibbonGalleryGroup); +begin + inherited Create; + FOwner := AOwner; + FAlignment := taLeftJustify; + FVisible := False; +end; + +procedure TdxRibbonGalleryGroupHeader.Assign(Source: TPersistent); +begin + if Source is TdxRibbonGalleryGroupHeader then + begin + Alignment := TdxRibbonGalleryGroupHeader(Source).Alignment; + Caption := TdxRibbonGalleryGroupHeader(Source).Caption; + Visible := TdxRibbonGalleryGroupHeader(Source).Visible; + end + else + inherited Assign(Source); +end; + +procedure TdxRibbonGalleryGroupHeader.Changed; +begin + FOwner.Changed(True); +end; + +procedure TdxRibbonGalleryGroupHeader.SetAlignment( + Value: TAlignment); +begin + if FAlignment <> Value then + begin + FAlignment := Value; + Changed; + end; +end; + +procedure TdxRibbonGalleryGroupHeader.SetCaption(const Value: string); +begin + if FCaption <> Value then + begin + FCaption := Value; + Changed; + end; +end; + +procedure TdxRibbonGalleryGroupHeader.SetVisible(Value: Boolean); +begin + if FVisible <> Value then + begin + FVisible := Value; + Changed; + end; +end; + +{ TdxRibbonGalleryGroupItem } + +constructor TdxRibbonGalleryGroupItem.Create(Collection: TCollection); +begin + inherited Create(Collection); + FGlyph := TBitmap.Create; + FGlyph.OnChange := GlyphChanged; + FImageIndex := -1; +end; + +destructor TdxRibbonGalleryGroupItem.Destroy; +begin + Group.GalleryItem.RemoveGroupItem(Self); + FreeAndNil(FGlyph); + inherited Destroy; +end; + +procedure TdxRibbonGalleryGroupItem.Assign(Source: TPersistent); +begin + if Source is TdxRibbonGalleryGroupItem then + begin + Caption := TdxRibbonGalleryGroupItem(Source).Caption; + Description := TdxRibbonGalleryGroupItem(Source).Description; + Glyph := TdxRibbonGalleryGroupItem(Source).Glyph; + ImageIndex := TdxRibbonGalleryGroupItem(Source).ImageIndex; + Selected := TdxRibbonGalleryGroupItem(Source).Selected; + Tag := TdxRibbonGalleryGroupItem(Source).Tag; + end + else + inherited Assign(Source); +end; + +procedure TdxRibbonGalleryGroupItem.DoClick; +begin + if Assigned(FOnClick) and not Group.GalleryItem.AreGroupItemClickEventsLocked then + FOnClick(Self); +end; + +procedure TdxRibbonGalleryGroupItem.DrawImage(DC: HDC; const ARect: TRect); +begin + cxDrawImage(DC, ARect, ARect, Glyph, Group.Images, + ImageIndex, idmNormal); +end; + +function TdxRibbonGalleryGroupItem.GetImageSize: TSize; +var + AImages: TCustomImageList; +begin + Result := cxNullSize; + if IsGlyphAssigned(Glyph) then + begin + Result.cx := Glyph.Width; + Result.cy := Glyph.Height; + end + else + begin + AImages := Group.Images; + if AImages <> nil then + begin + Result.cx := Group.Images.Width; + Result.cy := Group.Images.Height; + end + end; +end; + +function TdxRibbonGalleryGroupItem.IsImageAssigned: Boolean; +begin + Result := IsGlyphAssigned(Glyph) or + cxGraphics.IsImageAssigned(Group.Images, ImageIndex); +end; + +function TdxRibbonGalleryGroupItem.GetGroup: TdxRibbonGalleryGroup; +begin + if Collection <> nil then + Result := TdxRibbonGalleryGroupItems(Collection).Group + else + Result := nil; +end; + +function TdxRibbonGalleryGroupItem.GetSelected: Boolean; +begin + case SelectionMode of + gsmNone, gsmMultiple: + Result := FSelected; + gsmSingle: + Result := Group.GalleryItem.SelectedGroupItem = Self; + else + Result := False; + end; +end; + +function TdxRibbonGalleryGroupItem.GetSelectionMode: TdxRibbonGalleryItemSelectionMode; +begin + Result := Group.GalleryItem.GalleryOptions.ItemSelectionMode; +end; + +procedure TdxRibbonGalleryGroupItem.GlyphChanged(Sender: TObject); +begin + Changed(True); +end; + +procedure TdxRibbonGalleryGroupItem.SetCaption(const Value: string); +begin + if FCaption <> Value then + begin + FCaption := Value; + Changed(True); + end; +end; + +procedure TdxRibbonGalleryGroupItem.SetDescription(const Value: string); +begin + if FDescription <> Value then + begin + FDescription := Value; + Changed(True); + end; +end; + +procedure TdxRibbonGalleryGroupItem.SetGlyph(Value: TBitmap); +begin + FGlyph.Assign(Value); +end; + +procedure TdxRibbonGalleryGroupItem.SetImageIndex(Value: TImageIndex); +begin + if FImageIndex <> Value then + begin + FImageIndex := Value; + Changed(True); + end; +end; + +procedure TdxRibbonGalleryGroupItem.SetSelected(Value: Boolean); +begin + if Group.GalleryItem.IsLoading then + FSelected := Value + else + case SelectionMode of + gsmNone, gsmMultiple: + if Value <> FSelected then + begin + FSelected := Value; + if SelectionMode = gsmMultiple then + begin + DoClick; + Group.GalleryItem.DoGroupItemClick(Self); + end; + Group.GalleryItem.Update; + end; + gsmSingle: + if Value then + Group.GalleryItem.SelectedGroupItem := Self + else + if Selected then + Group.GalleryItem.SelectedGroupItem := nil; + end; +end; + +{ TdxRibbonGalleryGroupItems } + +constructor TdxRibbonGalleryGroupItems.Create(AGroup: TdxRibbonGalleryGroup); +begin + inherited Create(TdxRibbonGalleryGroupItem); + FGroup := AGroup; +end; + +function TdxRibbonGalleryGroupItems.Add: TdxRibbonGalleryGroupItem; +begin + Result := TdxRibbonGalleryGroupItem(inherited Add); +end; + +function TdxRibbonGalleryGroupItems.Insert(Index: Integer): TdxRibbonGalleryGroupItem; +begin + Result := TdxRibbonGalleryGroupItem(inherited Insert(Index)); +end; + +function TdxRibbonGalleryGroupItems.GetOwner: TPersistent; +begin + Result := FGroup; +end; + +procedure TdxRibbonGalleryGroupItems.Update(Item: TCollectionItem); +begin + inherited Update(Item); + FGroup.Changed(True); +end; + +function TdxRibbonGalleryGroupItems.GetItem( + Index: Integer): TdxRibbonGalleryGroupItem; +begin + Result := TdxRibbonGalleryGroupItem(inherited GetItem(Index)); +end; + +procedure TdxRibbonGalleryGroupItems.SetItem(Index: Integer; + Value: TdxRibbonGalleryGroupItem); +begin + inherited SetItem(Index, Value); +end; + +{ TdxRibbonGalleryGroup } + +constructor TdxRibbonGalleryGroup.Create(Collection: TCollection); +var + AGalleryItem: TdxRibbonGalleryItem; +begin + if Collection <> nil then + Collection.BeginUpdate; + try + inherited Create(Collection); + FHeader := TdxRibbonGalleryGroupHeader.Create(Self); + FItems := TdxRibbonGalleryGroupItems.Create(Self); + AGalleryItem := TdxRibbonGalleryItem(TdxRibbonGalleryGroups(Collection).GetOwner); + FOptions := TdxRibbonGalleryGroupOptions.Create(AGalleryItem, + AGalleryItem.GalleryOptions, Self); + FVisible := True; + finally + if Collection <> nil then + Collection.EndUpdate; + end; +end; + +destructor TdxRibbonGalleryGroup.Destroy; +begin + FreeAndNil(FHeader); + FreeAndNil(FItems); + FreeAndNil(FOptions); + inherited Destroy; +end; + +procedure TdxRibbonGalleryGroup.Assign(Source: TPersistent); +begin + if Source is TdxRibbonGalleryGroup then + begin + Header := TdxRibbonGalleryGroup(Source).Header; + Items := TdxRibbonGalleryGroup(Source).Items; + Options := TdxRibbonGalleryGroup(Source).Options; + Visible := TdxRibbonGalleryGroup(Source).Visible; + end + else + inherited Assign(Source); +end; + +function TdxRibbonGalleryGroup.GetGalleryItem: TdxRibbonGalleryItem; +begin + Result := TdxRibbonGalleryGroups(Collection).FGalleryItem; +end; + +function TdxRibbonGalleryGroup.GetImages: TCustomImageList; +begin + Result := Options.Images; + if Result = nil then + Result := GalleryItem.GetImages; +end; + +procedure TdxRibbonGalleryGroup.ImagesChange(Sender: Tobject); +begin + Changed(True); +end; + +procedure TdxRibbonGalleryGroup.Notification(AComponent: TComponent; + Operation: TOperation); +begin + if Operation = opRemove then + if AComponent = Options.Images then + Options.Images := nil +end; + +procedure TdxRibbonGalleryGroup.SetHeader(Value: TdxRibbonGalleryGroupHeader); +begin + FHeader.Assign(Value); +end; + +procedure TdxRibbonGalleryGroup.SetItems(Value: TdxRibbonGalleryGroupItems); +begin + FItems.Assign(Value); +end; + +procedure TdxRibbonGalleryGroup.SetOptions(Value: TdxRibbonGalleryGroupOptions); +begin + FOptions.Assign(Value); +end; + +procedure TdxRibbonGalleryGroup.SetVisible(Value: Boolean); +begin + if FVisible <> Value then + begin + FVisible := Value; + if (Collection <> nil) and (TdxRibbonGalleryGroups(Collection).UpdateCount = 0) then + GalleryItem.GroupVisibleChanged; + end; +end; + +{ TdxRibbonGalleryGroups } + +constructor TdxRibbonGalleryGroups.Create(AGalleryItem: TdxRibbonGalleryItem); +begin + inherited Create(TdxRibbonGalleryGroup); + FGalleryItem := AGalleryItem; +end; + +function TdxRibbonGalleryGroups.Add: TdxRibbonGalleryGroup; +begin + Result := TdxRibbonGalleryGroup(inherited Add); +end; + +function TdxRibbonGalleryGroups.Insert(Index: Integer): TdxRibbonGalleryGroup; +begin + Result := TdxRibbonGalleryGroup(inherited Insert(Index)); +end; + +function TdxRibbonGalleryGroups.GetOwner: TPersistent; +begin + Result := GalleryItem; +end; + +procedure TdxRibbonGalleryGroups.Notify(Item: TCollectionItem; Action: TCollectionNotification); +begin + if (Action = cnExtracting) and not (csDestroying in GalleryItem.ComponentState) then + RemoveFromFilter(Item); + inherited Notify(Item, Action); +end; + +procedure TdxRibbonGalleryGroups.Update(Item: TCollectionItem); +begin + inherited Update(Item); + GalleryItem.GalleryChanged; +end; + +function TdxRibbonGalleryGroups.GetItem(Index: Integer): TdxRibbonGalleryGroup; +begin + Result := TdxRibbonGalleryGroup(inherited GetItem(Index)); +end; + +procedure TdxRibbonGalleryGroups.RemoveFromFilter(AItem: TCollectionItem); +begin + if AItem <> nil then + GalleryItem.GalleryFilter.Categories.DeleteGroup(TdxRibbonGalleryGroup(AItem)); +end; + +procedure TdxRibbonGalleryGroups.SetItem(Index: Integer; + Value: TdxRibbonGalleryGroup); +begin + inherited SetItem(Index, Value); +end; + +{ TdxRibbonGalleryFilterCategoryGroups } + +constructor TdxRibbonGalleryFilterCategoryGroups.Create( + AFilterCategory: TdxRibbonGalleryFilterCategory); +begin + inherited Create; + FFilterCategory := AFilterCategory; +end; + +procedure TdxRibbonGalleryFilterCategoryGroups.Assign( + ASource: TdxRibbonGalleryFilterCategoryGroups); +var + I: Integer; +begin + if FilterCategory.GalleryItem.GalleryGroups.Count <> + ASource.FilterCategory.GalleryItem.GalleryGroups.Count then + raise Exception.Create(''); + Clear; + for I := 0 to ASource.Count - 1 do + Add(FilterCategory.GalleryItem.GalleryGroups[ASource[I].Index]); +end; + +function TdxRibbonGalleryFilterCategoryGroups.Add(AGroup: TdxRibbonGalleryGroup): Integer; +begin + if CanAddGroup(AGroup) then + Result := inherited Add(AGroup) + else + Result := -1; +end; + +procedure TdxRibbonGalleryFilterCategoryGroups.Insert(AIndex: Integer; + AGroup: TdxRibbonGalleryGroup); +begin + if CanAddGroup(AGroup) then + inherited Insert(AIndex, AGroup); +end; + +procedure TdxRibbonGalleryFilterCategoryGroups.Notify(Ptr: Pointer; + Action: TListNotification); +begin + inherited Notify(Ptr, Action); + if Action in [lnAdded, lnDeleted] then + FilterCategory.Changed(False); +end; + +function TdxRibbonGalleryFilterCategoryGroups.CanAddGroup( + AGroup: TdxRibbonGalleryGroup): Boolean; + + function IsGroupValid: Boolean; + begin + Result := (AGroup <> nil) and (AGroup.GalleryItem = FilterCategory.GalleryItem); + end; + +begin + Result := IsGroupValid and (IndexOf(AGroup) = -1); +end; + +function TdxRibbonGalleryFilterCategoryGroups.GetItem( + Index: Integer): TdxRibbonGalleryGroup; +begin + Result := TdxRibbonGalleryGroup(inherited Items[Index]); +end; + +{ TdxRibbonGalleryFilterCategory } + +constructor TdxRibbonGalleryFilterCategory.Create(Collection: TCollection); +begin + inherited Create(Collection); + FGroups := TdxRibbonGalleryFilterCategoryGroups.Create(Self); +end; + +destructor TdxRibbonGalleryFilterCategory.Destroy; +begin + FreeAndNil(FGroups); + inherited Destroy; +end; + +procedure TdxRibbonGalleryFilterCategory.Assign(Source: TPersistent); +begin + if Source is TdxRibbonGalleryFilterCategory then + begin + Caption := TdxRibbonGalleryFilterCategory(Source).Caption; + Groups.Assign(TdxRibbonGalleryFilterCategory(Source).Groups); + end + else + inherited Assign(Source); +end; + +procedure TdxRibbonGalleryFilterCategory.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('CategoryGroups', ReadCategoryGroups, WriteCategoryGroups, FGroups.Count > 0); +end; + +function TdxRibbonGalleryFilterCategory.GetGalleryItem: TdxRibbonGalleryItem; +begin + Result := TdxRibbonGalleryFilterCategories(Collection).GalleryFilter.GalleryItem; +end; + +procedure TdxRibbonGalleryFilterCategory.ReadCategoryGroups(AReader: TReader); +var + AIndex: Integer; +begin + Groups.Clear; + AReader.ReadListBegin; + while not AReader.EndOfList do + begin + AIndex := AReader.ReadInteger; + if (AIndex >= 0) and (AIndex < GalleryItem.GalleryGroups.Count) and + (Groups.IndexOf(GalleryItem.GalleryGroups[AIndex]) = -1) then + Groups.Add(GalleryItem.GalleryGroups[AIndex]); + end; + AReader.ReadListEnd; +end; + +procedure TdxRibbonGalleryFilterCategory.WriteCategoryGroups(AWriter: TWriter); +var + I, J, AIndex: Integer; +begin + AWriter.WriteListBegin; + for I := 0 to Groups.Count - 1 do + begin + AIndex := -1; + for J := 0 to GalleryItem.GalleryGroups.Count - 1 do + if Groups[I] = GalleryItem.GalleryGroups[J] then + begin + AIndex := J; + Break; + end; + if AIndex <> -1 then + AWriter.WriteInteger(AIndex); + end; + AWriter.WriteListEnd; +end; + +{ TdxRibbonGalleryFilterCategories } + +constructor TdxRibbonGalleryFilterCategories.Create( + AGalleryFilter: TdxRibbonGalleryFilter); +begin + inherited Create(TdxRibbonGalleryFilterCategory); + FGalleryFilter := AGalleryFilter; +end; + +function TdxRibbonGalleryFilterCategories.Add: TdxRibbonGalleryFilterCategory; +begin + Result := TdxRibbonGalleryFilterCategory(inherited Add); +end; + +procedure TdxRibbonGalleryFilterCategories.DeleteGroup( + AGroup: TdxRibbonGalleryGroup); +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].Groups.Remove(AGroup); +end; + +function TdxRibbonGalleryFilterCategories.GetOwner: TPersistent; +begin + Result := FGalleryFilter; +end; + +procedure TdxRibbonGalleryFilterCategories.Update(Item: TCollectionItem); +begin + inherited Update(Item); + FGalleryFilter.CategoriesChanged; +end; + +function TdxRibbonGalleryFilterCategories.GetItem( + Index: Integer): TdxRibbonGalleryFilterCategory; +begin + Result := TdxRibbonGalleryFilterCategory(inherited GetItem(Index)); +end; + +procedure TdxRibbonGalleryFilterCategories.SetItem(Index: Integer; + Value: TdxRibbonGalleryFilterCategory); +begin + inherited SetItem(Index, Value); +end; + +{ TdxRibbonGalleryFilter } + +constructor TdxRibbonGalleryFilter.Create(AGalleryItem: TdxRibbonGalleryItem); +begin + inherited Create; + FGalleryItem := AGalleryItem; + FActiveCategoryIndex := -1; + FCategories := TdxRibbonGalleryFilterCategories.Create(Self); + FLoadedActiveCategoryIndex := -1; +end; + +destructor TdxRibbonGalleryFilter.Destroy; +begin + FreeAndNil(FCategories); + inherited Destroy; +end; + +procedure TdxRibbonGalleryFilter.Assign(Source: TPersistent); +begin + if Source is TdxRibbonGalleryFilter then + begin + Caption := TdxRibbonGalleryFilter(Source).Caption; + Categories := TdxRibbonGalleryFilter(Source).Categories; + ActiveCategoryIndex := TdxRibbonGalleryFilter(Source).ActiveCategoryIndex; // must be after Categories + Visible := TdxRibbonGalleryFilter(Source).Visible; + end + else + inherited Assign(Source); +end; + +function TdxRibbonGalleryFilter.IsGroupFiltered( + AGroup: TdxRibbonGalleryGroup): Boolean; +begin + Result := (ActiveCategoryIndex <> -1) and + (Categories[ActiveCategoryIndex].Groups.IndexOf(AGroup) = -1); +end; + +procedure TdxRibbonGalleryFilter.CategoriesChanged; +begin + if ActiveCategoryIndex >= Categories.Count then + ActiveCategoryIndex := -1 + else + if ActiveCategoryIndex <> -1 then + GalleryItem.FilterChanged; +end; + +function TdxRibbonGalleryFilter.GetOwner: TPersistent; +begin + Result := GalleryItem; +end; + +procedure TdxRibbonGalleryFilter.Loaded; +begin + ActiveCategoryIndex := FLoadedActiveCategoryIndex; +end; + +procedure TdxRibbonGalleryFilter.SetActiveCategoryIndex(Value: Integer); +begin + if GalleryItem.IsLoading then + begin + FLoadedActiveCategoryIndex := Value; + Exit; + end; + if Value < 0 then + Value := -1 + else + if Value >= Categories.Count then + Exit; + if FActiveCategoryIndex <> Value then + begin + FActiveCategoryIndex := Value; + GalleryItem.FilterChanged; + end; +end; + +procedure TdxRibbonGalleryFilter.SetCaption(const Value: string); +begin + if FCaption <> Value then + begin + FCaption := Value; + if Visible then + GalleryItem.FilterCaptionChanged; + end; +end; + +procedure TdxRibbonGalleryFilter.SetCategories( + Value: TdxRibbonGalleryFilterCategories); +begin + FCategories.Assign(Value); +end; + +{ TdxRibbonGalleryItem } + +constructor TdxRibbonGalleryItem.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FGalleryFilter := TdxRibbonGalleryFilter.Create(Self); + FGalleryGroups := TdxRibbonGalleryGroups.Create(Self); + FGalleryOptions := TdxRibbonGalleryOptions.Create(Self); +end; + +destructor TdxRibbonGalleryItem.Destroy; +begin + DropDownGallery := nil; + FreeAndNil(FGalleryFilter); + FreeAndNil(FGalleryGroups); + FreeAndNil(FGalleryOptions); + inherited; +end; + +procedure TdxRibbonGalleryItem.DoClick; + + procedure ClickWithoutSelection; + begin + FClickedGroupItem.DoClick; + DoGroupItemClick(FClickedGroupItem); + end; + +begin + if ClickItemLink = nil then + begin + inherited DoClick; + Exit; + end; + + if FClickedGroupItem <> nil then + begin + if FClickedGroupItem.Group.Options.ItemPullHighlighting.Active then + ClickWithoutSelection + else + case GalleryOptions.ItemSelectionMode of + gsmNone: + ClickWithoutSelection; + gsmSingle: + begin + if FClickedGroupItem <> SelectedGroupItem then + SelectedGroupItem := FClickedGroupItem + else + if GalleryOptions.ItemAllowDeselect then + SelectedGroupItem := nil; + end; + gsmMultiple: + FClickedGroupItem.Selected := not FClickedGroupItem.Selected; + end; + end; +end; + +function TdxRibbonGalleryItem.GetAddMessageName: string; +begin + Result := cxGetResourceString(@dxSBAR_ADDGALLERYNAME); +end; + +function TdxRibbonGalleryItem.IsGroupVisible(AGroupIndex: Integer; + AIgnoreVisibleProperty: Boolean = False): Boolean; +begin + Result := (AIgnoreVisibleProperty or GalleryGroups[AGroupIndex].Visible) and + ((GalleryGroups[AGroupIndex].Items.Count > 0) or GalleryGroups[AGroupIndex].Header.Visible) and + not GalleryFilter.IsGroupFiltered(GalleryGroups[AGroupIndex]); +end; + +function TdxRibbonGalleryItem.AreGroupItemClickEventsLocked: Boolean; +begin + Result := FLockGroupItemClickEventsCount <> 0; +end; + +function TdxRibbonGalleryItem.CanBePlacedOn( + AParentKind: TdxBarItemControlParentKind; AToolbar: TdxBar; + out AErrorText: string): Boolean; +begin + Result := (AParentKind = pkSubItemOrPopupMenu) or (TdxBarManagerAccess(BarManager).IsInitializing or + GetBarControlClass(AToolbar).InheritsFrom(TdxRibbonCustomBarControl)); + if not Result then + AErrorText := cxGetResourceString(@dxSBAR_CANTPLACERIBBONGALLERY); +end; + +function TdxRibbonGalleryItem.CreateCloneForDropDownGallery: TdxRibbonGalleryItem; +begin + Result := TdxRibbonGalleryItem(TdxBarItemClass(ClassType).Create(BarManager)); + Result.FIsClone := True; + Result.GalleryOptions.ItemSelectionMode := gsmNone; + Result.GalleryGroups := GalleryGroups; + Result.GalleryFilter := GalleryFilter; // must be after Result.GalleryGroups := GalleryGroups + Result.GalleryOptions := GalleryOptions; +end; + +procedure TdxRibbonGalleryItem.DoCloseUp; +begin + inherited DoCloseUp; + if DropDownGallery <> nil then + DropDownGallery.DoCloseUp; +end; + +procedure TdxRibbonGalleryItem.DoFilterChanged; +begin + if Assigned(OnFilterChanged) then + OnFilterChanged(Self); +end; + +procedure TdxRibbonGalleryItem.DoGroupItemClick(AItem: TdxRibbonGalleryGroupItem); +begin + if Assigned(FOnGroupItemClick) and not AreGroupItemClickEventsLocked then + FOnGroupItemClick(Self, AItem); +end; + +procedure TdxRibbonGalleryItem.DoHotTrackedItemChanged(APrevHotTrackedGroupItem, + ANewHotTrackedGroupItem: TdxRibbonGalleryGroupItem); +begin + if Assigned(FOnHotTrackedItemChanged) then + FOnHotTrackedItemChanged(APrevHotTrackedGroupItem, ANewHotTrackedGroupItem); +end; + +procedure TdxRibbonGalleryItem.DoInitFilterMenu(AItemLinks: TdxBarItemLinks); +begin + if Assigned(OnInitFilterMenu) then + OnInitFilterMenu(Self, AItemLinks); +end; + +procedure TdxRibbonGalleryItem.DoPopup; +begin + inherited DoPopup; + if DropDownGallery <> nil then + DropDownGallery.DoPopup; +end; + +procedure TdxRibbonGalleryItem.FilterCaptionChanged; +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + if Links[I].Control <> nil then + TdxRibbonGalleryControl(Links[I].Control).FilterCaptionChanged; +end; + +procedure TdxRibbonGalleryItem.FilterChanged; +var + I: Integer; +begin + FRecalculatingOnFilterChanged := True; + try + if FFilterChangedLockCount = 0 then + for I := 0 to LinkCount - 1 do + if Links[I].Control <> nil then + begin + Links[I].Control.ViewInfo.ResetCachedValues; + TCustomdxBarControlAccess(Links[I].Control.Parent).RepaintBarEx(False); + end; + finally + FRecalculatingOnFilterChanged := False; + end; +end; + +procedure TdxRibbonGalleryItem.GalleryChanged; +begin + UpdateEx; +end; + +function TdxRibbonGalleryItem.GetFilterCaption: string; +var + I: Integer; +begin + if GalleryFilter.Caption <> '' then + Result := GalleryFilter.Caption + else + begin + Result := ''; + if GalleryFilter.Categories.Count = 0 then + begin + for I := 0 to GalleryGroups.Count - 1 do + if IsGroupVisible(I) then + begin + if Result <> '' then + Result := Result + FilterCaptionDelimiter; + Result := Result + GalleryGroups[I].Header.Caption; + end + end + else + if GalleryFilter.ActiveCategoryIndex <> -1 then + Result := GalleryFilter.Categories[GalleryFilter.ActiveCategoryIndex].Caption; + if Result = '' then + Result := cxGetResourceString(@dxSBAR_GALLERYEMPTYFILTERCAPTION); + end; +end; + +function TdxRibbonGalleryItem.GetImages: TCustomImageList; +begin + Result := GalleryOptions.Images; + if Result = nil then + Result := BarManager.ImageOptions.Images; +end; + +class function TdxRibbonGalleryItem.GetNewCaption: string; +begin + Result := cxGetResourceString(@dxSBAR_NEWRIBBONGALLERYITEMCAPTION); +end; + +procedure TdxRibbonGalleryItem.GroupVisibleChanged; +begin + FilterChanged; +end; + +procedure TdxRibbonGalleryItem.ImagesChange(Sender: TObject); +begin + GalleryChanged; +end; + +function TdxRibbonGalleryItem.InternalCanMergeWith(AItem: TdxBarItem): Boolean; +begin + Result := False; +end; + +function TdxRibbonGalleryItem.IsFilterVisible: Boolean; + + function HasVisibleGroups: Boolean; + var + I: Integer; + begin + Result := False; + for I := 0 to GalleryGroups.Count - 1 do + if IsGroupVisible(I, True) then + begin + Result := True; + Break; + end; + end; + +begin + Result := GalleryFilter.Visible and + ((GalleryFilter.Categories.Count > 0) or HasVisibleGroups); +end; + +procedure TdxRibbonGalleryItem.Loaded; + + function GetSelectedGroupItem: TdxRibbonGalleryGroupItem; + var + I, J: Integer; + begin + Result := nil; + for I := 0 to GalleryGroups.Count - 1 do + for J := 0 to GalleryGroups[I].Items.Count - 1 do + if GalleryGroups[I].Items[J].LoadedSelected then + begin + Result := GalleryGroups[I].Items[J]; + Result.LoadedSelected := False; + Break; + end; + end; + +begin + inherited Loaded; + if GalleryOptions.ItemSelectionMode = gsmSingle then + begin + LockGroupItemClickEvents(True); + try + SelectedGroupItem := GetSelectedGroupItem; + finally + LockGroupItemClickEvents(False); + end; + end; + GalleryFilter.Loaded; +end; + +procedure TdxRibbonGalleryItem.LockFilterChanged(ALock: Boolean); +begin + if ALock then + Inc(FFilterChangedLockCount) + else + begin + if FFilterChangedLockCount = 0 then + raise Exception.Create(''); + Dec(FFilterChangedLockCount); + if FFilterChangedLockCount = 0 then + FilterChanged; + end; +end; + +procedure TdxRibbonGalleryItem.LockGroupItemClickEvents(ALock: Boolean); +begin + if ALock then + Inc(FLockGroupItemClickEventsCount) + else + if FLockGroupItemClickEventsCount > 0 then + Dec(FLockGroupItemClickEventsCount) + else + raise Exception.Create(''); +end; + +procedure TdxRibbonGalleryItem.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if AComponent <> Self then + begin + if Operation = opRemove then + if AComponent = DropDownGallery then + DropDownGallery := nil + else + if AComponent = GalleryOptions.Images then + GalleryOptions.Images := nil; + NotifyGroups(AComponent, Operation); + end; +end; + +procedure TdxRibbonGalleryItem.RemoveGroupItem(AItem: TdxRibbonGalleryGroupItem); +var + I: Integer; +begin + if FSelectedGroupItem = AItem then + FSelectedGroupItem := nil; + for I := 0 to LinkCount - 1 do + if Links[I].Control <> nil then + TdxRibbonGalleryControl(Links[I].Control).ViewInfo.RemoveGroupItem(AItem); +end; + +procedure TdxRibbonGalleryItem.NotifyGroups(AComponent: TComponent; + Operation: TOperation); +var + I: Integer; +begin + if (GalleryGroups <> nil) then + for I := 0 to GalleryGroups.Count - 1 do + GalleryGroups[I].Notification(AComponent, Operation); +end; + +procedure TdxRibbonGalleryItem.SetDropDownGallery(Value: TdxRibbonDropDownGallery); +begin + if Value <> FDropDownGallery then + begin + if FDropDownGallery <> nil then + FDropDownGallery.RemoveFreeNotification(Self); + FDropDownGallery := Value; + if FDropDownGallery <> nil then + FDropDownGallery.FreeNotification(Self); + end; +end; + +procedure TdxRibbonGalleryItem.SetGalleryFilter(Value: TdxRibbonGalleryFilter); +begin + FGalleryFilter.Assign(Value); +end; + +procedure TdxRibbonGalleryItem.SetGalleryGroups(Value: TdxRibbonGalleryGroups); +begin + FGalleryGroups.Assign(Value); +end; + +procedure TdxRibbonGalleryItem.SetGalleryOptions(Value: TdxRibbonGalleryOptions); +begin + FGalleryOptions.Assign(Value); +end; + +procedure TdxRibbonGalleryItem.SetSelectedGroupItem( + Value: TdxRibbonGalleryGroupItem); +var + APrevSelectedGroupItem: TdxRibbonGalleryGroupItem; +begin + if (GalleryOptions.ItemSelectionMode = gsmSingle) and (FSelectedGroupItem <> Value) then + begin + APrevSelectedGroupItem := FSelectedGroupItem; + FSelectedGroupItem := Value; + if APrevSelectedGroupItem <> nil then + APrevSelectedGroupItem.DoClick; + if FSelectedGroupItem <> nil then + FSelectedGroupItem.DoClick; + DoGroupItemClick(FSelectedGroupItem); + Update; + end; +end; + +{ TdxRibbonGalleryController } + +constructor TdxRibbonGalleryController.Create( + AOwner: TdxRibbonGalleryControl); +begin + inherited Create; + FOwner := AOwner; + + FGroupItemHotTrackEnabled := True; +end; + +procedure TdxRibbonGalleryController.CancelHint; +begin + FOwner.UpdateHint(nil, cxEmptyRect); +end; + +function TdxRibbonGalleryController.GetGroupItem(AGroupIndex, AIndex: Integer): TdxRibbonGalleryGroupItem; +var + AGroup: TdxRibbonGalleryGroup; +begin + Result := nil; + if InRange(AGroupIndex, 0, GroupCount - 1) then + begin + AGroup := FOwner.GetGroups[AGroupIndex]; + if InRange(AIndex, 0, AGroup.Items.Count - 1) then + Result := AGroup.Items[AIndex]; + end; +end; + +procedure TdxRibbonGalleryController.HotTrackItem( + AItem: TdxRibbonGalleryGroupItem); +begin + FKeyboardHotGroupItem := AItem; + SetHotGroupItem(FKeyboardHotGroupItem); +end; + +procedure TdxRibbonGalleryController.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + + function GetIsItemPullHighlighting(AGroupItem: TdxRibbonGalleryGroupItem): Boolean; + begin + Result := AGroupItem.Group.Options.ItemPullHighlighting.Active; + end; + +var + AGroupItem: TdxRibbonGalleryGroupItem; +begin + CancelHint; + AGroupItem := ViewInfo.GetGroupItem(X, Y); + FGroupItemHotTrackEnabled := AGroupItem <> nil; + if FGroupItemHotTrackEnabled and not GetIsItemPullHighlighting(AGroupItem) then + GetViewInfo.SetDownedGroupItem(AGroupItem); +end; + +procedure TdxRibbonGalleryController.MouseLeave; +begin + SetHotGroupItem(nil); + SetHintItem(nil); +end; + +procedure TdxRibbonGalleryController.MouseMove(Shift: TShiftState; + X, Y: Integer); +var + AGroupItem: TdxRibbonGalleryGroupItem; + AViewInfo: TdxRibbonGalleryControlViewInfo; +begin + if FGroupItemHotTrackEnabled then + begin + AViewInfo := GetViewInfo; + AViewInfo.DontDisplayHotTrackedGroupItem := + AViewInfo.DontDisplayHotTrackedGroupItem + 1; + try + AGroupItem := AViewInfo.GetGroupItem(X, Y); + SetHintItem(AGroupItem); + if (AGroupItem <> nil) or + not (FKeyboardHotGroupItem <> nil) or + not FLastCommandFromKeyboard then + begin + FLastCommandFromKeyboard := False; + SetHotGroupItem(AGroupItem); + end; + finally + AViewInfo.DontDisplayHotTrackedGroupItem := + AViewInfo.DontDisplayHotTrackedGroupItem - 1; + end; + end; +end; + +procedure TdxRibbonGalleryController.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +var + AViewInfo: TdxRibbonGalleryControlViewInfo; +begin + if FGroupItemHotTrackEnabled then + begin + AViewInfo := ViewInfo; + if AViewInfo.IsGroupItemAtThisPlace(X, Y) then + AViewInfo.SetDownedGroupItem(nil); + end; + FGroupItemHotTrackEnabled := True; +end; + +procedure TdxRibbonGalleryController.UnsetDownedFromGroupItem( + AGroupItem: TdxRibbonGalleryGroupItem); +begin + if (ViewInfo.DownedGroupItem <> AGroupItem) and + (ViewInfo.DownedGroupItem <> nil) then + begin + ViewInfo.SetDownedGroupItem(nil); + end; +end; + +function TdxRibbonGalleryController.GetFirstGroupItem: TdxRibbonGalleryGroupItem; +var + AGroupIndex: Integer; +begin + AGroupIndex := ViewInfo.GetVisibleNotEmptyGroupIndex(0, True); + if AGroupIndex <> -1 then + Result := FOwner.GetGroups[AGroupIndex].Items[0] + else + Result := nil; +end; + +function TdxRibbonGalleryController.GetGalleryItem: TdxRibbonGalleryItem; +begin + Result := TdxRibbonGalleryItem(FOwner.Item); +end; + +function TdxRibbonGalleryController.GetGroupCount: Integer; +begin + Result := FOwner.GetGroups.Count; +end; + +function TdxRibbonGalleryController.GetKeyboardHotGroupItem: TdxRibbonGalleryGroupItem; +var + ADestroyAfterUse: Boolean; + AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; +begin + Result := nil; + if (FKeyboardHotGroupItem <> nil) then + begin + AGroupViewInfo := GetGroupViewInfo(FOwner.GetGroups, + ViewInfo, FKeyboardHotGroupItem.Group.Index, ADestroyAfterUse); + try + if (AGroupViewInfo <> nil) then + Result := FKeyboardHotGroupItem; + finally + if ADestroyAfterUse then + AGroupViewInfo.Free; + end; + end; +end; + +function TdxRibbonGalleryController.GetViewInfo: TdxRibbonGalleryControlViewInfo; +begin + Result := FOwner.ViewInfo; +end; + +procedure TdxRibbonGalleryController.SetHintItem(AItem: TdxRibbonGalleryGroupItem); +var + R: TRect; + AGroupItemViewInfo: TdxRibbonGalleryGroupItemViewInfo; +begin + if FHintItem <> AItem then + begin + FHintItem := AItem; + AGroupItemViewInfo := ViewInfo.GetGroupItemViewInfo(FHintItem); + if AGroupItemViewInfo <> nil then + R := AGroupItemViewInfo.Bounds + else + R := cxEmptyRect; + FOwner.UpdateHint(AItem, R); + end; +end; + +procedure TdxRibbonGalleryController.SetHotGroupItem( + const Value: TdxRibbonGalleryGroupItem); +begin + if Value <> ViewInfo.HotGroupItem then + begin + ViewInfo.HotGroupItem := Value; + if Value <> nil then + FKeyboardHotGroupItem := Value; + UnsetDownedFromGroupItem(Value); + end; +end; + +{ TdxRibbonOnSubMenuGalleryController } + +procedure TdxRibbonOnSubMenuGalleryController.Navigation( + ADirection: TcxAccessibilityNavigationDirection); + +type + TXRange = record + Left: Integer; + Right: Integer; + end; + + procedure TransferToAnotherGroup(var AGroupIndex: Integer; + const AColumnRange: TXRange; ADownDirection: Boolean; + var ARow, AColumn: Integer); + var + AColumnCountInRow: Integer; + AColumnFind: Boolean; + ACurrentColumnIndex, ACurrentRowIndex: Integer; + AColumnLeft, AColumnRight: Integer; + ACurrentColumnIntersected, APreviousColumnIntersected: Boolean; + ADestroyAfterUse: Boolean; + AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; + ANextRow, ANextGroup: Boolean; + begin + if AGroupIndex >= GroupCount then + if TdxBarItemLinksAccess(FOwner.Parent.ItemLinks).First <> nil then + Exit + else + AGroupIndex := 0; + if AGroupIndex < 0 then + if TdxBarItemLinksAccess(FOwner.Parent.ItemLinks).Last <> nil then + Exit + else + AGroupIndex := GroupCount - 1; + + AColumnFind := False; + ACurrentColumnIndex := 0; + ACurrentRowIndex := 0; + if GalleryItem.IsGroupVisible(AGroupIndex) and + (FOwner.GetGroups[AGroupIndex].Items.Count > 0) then + begin + AGroupViewInfo := GetGroupViewInfo(FOwner.GetGroups, ViewInfo, + AGroupIndex, ADestroyAfterUse); + {if ADestroyAfterUse then + AGroupViewInfo.SetBounds(ViewInfo.GalleryBounds);} + + if not ADownDirection then + ACurrentRowIndex := AGroupViewInfo.GetRowCount(GetGalleryWidth) - 1; + + ANextGroup := False; + repeat + ANextRow := False; + AColumnCountInRow := AGroupViewInfo.GetColumnCountInRow(ACurrentRowIndex, + GetGalleryWidth); + ACurrentColumnIndex := 0; + APreviousColumnIntersected := False; + repeat + AColumnLeft := AGroupViewInfo.GetColumnLeft(ACurrentColumnIndex, + ViewInfo.GalleryBounds.Left); + AColumnRight := AColumnLeft + AGroupViewInfo.ItemSize.cx; + ACurrentColumnIntersected := AreLinesIntersectedStrictly(AColumnLeft, AColumnRight, + AColumnRange.Left, AColumnRange.Right); + if ADownDirection then + AColumnFind := ACurrentColumnIntersected + else + begin + AColumnFind := APreviousColumnIntersected and + (not ACurrentColumnIntersected); + if AColumnFind then + Dec(ACurrentColumnIndex); + if (ACurrentColumnIndex = AColumnCountInRow - 1) and + ACurrentColumnIntersected then + AColumnFind := True; + APreviousColumnIntersected := ACurrentColumnIntersected; + end; + if not AColumnFind then + begin + ANextRow := ACurrentColumnIndex = AColumnCountInRow - 1; + Inc(ACurrentColumnIndex); + end; + until AColumnFind or ANextRow; + + if not AColumnFind then + begin + if ADownDirection then + begin + Inc(ACurrentRowIndex); + ANextGroup := ACurrentRowIndex > + AGroupViewInfo.GetRowCount(GetGalleryWidth) - 1; + end + else + begin + Dec(ACurrentRowIndex); + ANextGroup := ACurrentRowIndex < 0; + end; + end; + until AColumnFind or ANextGroup; + + if ADestroyAfterUse then + AGroupViewInfo.Free; + end; + + if AColumnFind then + begin + AColumn := ACurrentColumnIndex; + ARow := ACurrentRowIndex; + end + else + begin + if ADownDirection then + Inc(AGroupIndex) + else + Dec(AGroupIndex); + TransferToAnotherGroup(AGroupIndex, AColumnRange, ADownDirection, ARow, + AColumn); + end; + end; + + function GetColumnRange(AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; + AColumn: Integer): TXRange; + begin + Result.Left := AGroupViewInfo.GetColumnLeft(AColumn, + ViewInfo.GalleryBounds.Left); + Result.Right := Result.Left + AGroupViewInfo.ItemSize.cx; + end; + + procedure DownDirection(AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; + var AGroupIndex: Integer; var ARow, AColumn: Integer); + var + ARange: TXRange; + begin + if (ARow < AGroupViewInfo.GetRowCount(GetGalleryWidth) - 1) and + (AColumn <= AGroupViewInfo.GetColumnCountInRow(ARow + 1, + GetGalleryWidth) - 1) then + Inc(ARow) + else + begin + ARange := GetColumnRange(AGroupViewInfo, AColumn); + Inc(AGroupIndex); + TransferToAnotherGroup(AGroupIndex, ARange, True, ARow, AColumn); + end; + end; + + procedure LeftDirection(AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; + var ARow, AColumn: Integer); + begin + if AColumn > 0 then + Dec(AColumn) + else + AColumn := AGroupViewInfo.GetColumnCountInRow(ARow, + GetGalleryWidth) - 1; + end; + + procedure RightDirection(AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; + var ARow, AColumn: Integer); + begin + if AColumn < AGroupViewInfo.GetColumnCountInRow(ARow, + GetGalleryWidth) - 1 then + Inc(AColumn) + else + AColumn := 0; + end; + + procedure UpDirection(AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; + var AGroupIndex: Integer; var ARow, AColumn: Integer); + var + ARange: TXRange; + begin + if ARow > 0 then + Dec(ARow) + else + begin + ARange := GetColumnRange(AGroupViewInfo, AColumn); + Dec(AGroupIndex); + TransferToAnotherGroup(AGroupIndex, ARange, False, ARow, AColumn); + end; + end; + +var + ADestroyAfterUse: Boolean; + AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; + AGroupIndex: Integer; + AGroupItemColumn: Integer; + AGroupItemRow: Integer; + AHotGroupItem: TdxRibbonGalleryGroupItem; + AKeyboardHotGroupItem: TdxRibbonGalleryGroupItem; +begin + AKeyboardHotGroupItem := KeyboardHotGroupItem; + if AKeyboardHotGroupItem <> nil then + begin + AGroupViewInfo := GetGroupViewInfo(FOwner.GetGroups, ViewInfo, + AKeyboardHotGroupItem.Group.Index, ADestroyAfterUse); + try + {if ADestroyAfterUse then + AGroupViewInfo.SetBounds(ViewInfo.GalleryBounds);} + AGroupIndex := AKeyboardHotGroupItem.Group.Index; + AGroupItemRow := AGroupViewInfo.GetItemRow(AKeyboardHotGroupItem.Index, + GetGalleryWidth); + AGroupItemColumn := AGroupViewInfo.GetItemColumn( + AKeyboardHotGroupItem.Index, GetGalleryWidth); + AHotGroupItem := AKeyboardHotGroupItem; + case ADirection of + andLeft: LeftDirection(AGroupViewInfo, AGroupItemRow, AGroupItemColumn); + andUp: UpDirection(AGroupViewInfo, AGroupIndex, AGroupItemRow, AGroupItemColumn); + andRight: RightDirection(AGroupViewInfo, AGroupItemRow, AGroupItemColumn); + andDown: DownDirection(AGroupViewInfo, AGroupIndex, AGroupItemRow, AGroupItemColumn); + end; + + if not InRange(AGroupIndex, 0, GroupCount - 1) then + begin + if AGroupIndex < 0 then + BarNavigationController.ChangeSelectedObject(False, TdxBarItemLinksAccess(FOwner.Parent.ItemLinks).Last.Control.IAccessibilityHelper) + else + BarNavigationController.ChangeSelectedObject(False, TdxBarItemLinksAccess(FOwner.Parent.ItemLinks).First.Control.IAccessibilityHelper); + AHotGroupItem := nil; + end + else + begin + if AHotGroupItem.Group.Index <> AGroupIndex then + begin + if ADestroyAfterUse then + FreeAndNil(AGroupViewInfo); + AGroupViewInfo := GetGroupViewInfo(FOwner.GetGroups, ViewInfo, + AGroupIndex, ADestroyAfterUse); + end; + AHotGroupItem := GetGroupItem(AGroupIndex, AGroupViewInfo.GetItemIndex( + AGroupItemRow, AGroupItemColumn, GetGalleryWidth)); + end; + finally + if ADestroyAfterUse then + FreeAndNil(AGroupViewInfo); + end; + end + else + AHotGroupItem := GetFirstGroupItem; + + SetHotGroupItem(AHotGroupItem); + FLastCommandFromKeyboard := True; +end; + +procedure TdxRibbonOnSubMenuGalleryController.FilterMenuControlDestroyed; +begin + FFilterMenuControl := nil; +end; + +procedure TdxRibbonOnSubMenuGalleryController.HotTrackFirstGroupItem; +begin + HotTrackItem(GetFirstGroupItem); +end; + +procedure TdxRibbonOnSubMenuGalleryController.HotTrackLastGroupItem; +begin + HotTrackItem(GetLastGroupItem); +end; + +function TdxRibbonOnSubMenuGalleryController.IsFilterMenuShowed: Boolean; +begin + Result := FFilterMenuControl <> nil; +end; + +procedure TdxRibbonOnSubMenuGalleryController.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + if FDontShowFilterMenuOnMouseDown then + FDontShowFilterMenuOnMouseDown := False + else + if (Button = mbLeft) and GalleryItem.IsFilterVisible and + ViewInfo.IsPtInFilterBandHotTrackArea(Point(X, Y)) then + begin + ShowFilterMenu; + GroupItemHotTrackEnabled := True; + end; + CheckFilterMenuHotTrack; +end; + +procedure TdxRibbonOnSubMenuGalleryController.MouseLeave; +begin + inherited MouseLeave; + if GalleryItem.IsFilterVisible then + ViewInfo.SetFilterBandHotTrack(False); +end; + +procedure TdxRibbonOnSubMenuGalleryController.MouseMove(Shift: TShiftState; + X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + if GalleryItem.IsFilterVisible then + CheckFilterMenuHotTrack; +end; + +procedure TdxRibbonOnSubMenuGalleryController.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + CheckFilterMenuHotTrack; +end; + +procedure TdxRibbonOnSubMenuGalleryController.PageDown; +var + AHotTrackedGroupItemBottom, AHotTrackedGroupItemTop: Integer; + ACurrentGroupItemBottom, ACurrentGroupItemTop, AWidth: Integer; + ACurrentGroupItem, AHotGroupItem, ARequiredGroupItem: TdxRibbonGalleryGroupItem; + AGroupIndex, AGroupRowIndex: Integer; + AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; + ADestroyAfterUse, AItemIsObtained: Boolean; + AViewInfo: TdxRibbonGalleryControlViewInfo; +begin + AViewInfo := ViewInfo; + AHotGroupItem := AViewInfo.HotGroupItem; + if AHotGroupItem = nil then + if GalleryItem.SelectedGroupItem <> nil then + AHotGroupItem := GalleryItem.SelectedGroupItem + else + AHotGroupItem := GetFirstGroupItem; + if AHotGroupItem = nil then + Exit; + + AWidth := AViewInfo.GallerySize.cx; + ViewInfo.GroupItemYRange(AHotGroupItem, + AHotTrackedGroupItemTop, AHotTrackedGroupItemBottom); + AGroupIndex := AHotGroupItem.Group.Index; + AGroupViewInfo := GetGroupViewInfo(FOwner.GetGroups, AViewInfo, AGroupIndex, + ADestroyAfterUse); + try + AGroupRowIndex := AGroupViewInfo.GetItemRow(AHotGroupItem.Index, AWidth); + ACurrentGroupItem := GetGroupItem(AGroupIndex, + AGroupViewInfo.GetItemIndex(AGroupRowIndex, + AGroupViewInfo.GetColumnCountInRow(AGroupRowIndex, AWidth) - 1, AWidth)); + finally + if ADestroyAfterUse then + AGroupViewInfo.Free; + end; + ARequiredGroupItem := ACurrentGroupItem; + AItemIsObtained := False; + AGroupIndex := ACurrentGroupItem.Group.Index; + repeat + AGroupViewInfo := GetGroupViewInfo(FOwner.GetGroups, AViewInfo, + AGroupIndex, ADestroyAfterUse); + if AGroupViewInfo <> nil then + try + repeat + ACurrentGroupItem := GetGroupItem(AGroupIndex, + AGroupViewInfo.GetItemIndex( + AGroupRowIndex, AGroupViewInfo.GetColumnCountInRow(AGroupRowIndex, + AWidth) - 1, AWidth)); + ViewInfo.GroupItemYRange(ACurrentGroupItem, + ACurrentGroupItemTop, ACurrentGroupItemBottom); + if (ACurrentGroupItemBottom - AHotTrackedGroupItemBottom) < + AViewInfo.GallerySize.cy then + ARequiredGroupItem := ACurrentGroupItem + else + AItemIsObtained := True; + Inc(AGroupRowIndex); + until (AGroupRowIndex > AGroupViewInfo.GetRowCount(AWidth) - 1) or + AItemIsObtained; + finally + if ADestroyAfterUse then + AGroupViewInfo.Free; + end; + Inc(AGroupIndex); + AGroupRowIndex := 0; + until AItemIsObtained or (AGroupIndex > GroupCount - 1); + if AItemIsObtained then + SetHotGroupItem(ARequiredGroupItem) + else + HotTrackLastGroupItem; +end; + +procedure TdxRibbonOnSubMenuGalleryController.PageUp; +var + AHotTrackedGroupItemBottom, AHotTrackedGroupItemTop: Integer; + ACurrentGroupItemBottom, ACurrentGroupItemTop: Integer; + ACurrentGroupItem, ARequiredGroupItem, AHotGroupItem: TdxRibbonGalleryGroupItem; + AWidth, AGroupIndex, AGroupRowIndex: Integer; + AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; + ADestroyAfterUse, AItemIsObtained: Boolean; + AViewInfo: TdxRibbonGalleryControlViewInfo; +begin + AViewInfo := ViewInfo; + AHotGroupItem := AViewInfo.HotGroupItem; + if AHotGroupItem = nil then + if GalleryItem.SelectedGroupItem <> nil then + AHotGroupItem := GalleryItem.SelectedGroupItem + else + AHotGroupItem := GetFirstGroupItem; + if AHotGroupItem = nil then + Exit; + + AWidth := AViewInfo.GallerySize.cx; + ViewInfo.GroupItemYRange(AHotGroupItem, + AHotTrackedGroupItemTop, AHotTrackedGroupItemBottom); + AGroupIndex := AHotGroupItem.Group.Index; + AGroupViewInfo := GetGroupViewInfo(FOwner.GetGroups, AViewInfo, AGroupIndex, ADestroyAfterUse); + try + AGroupRowIndex := AGroupViewInfo.GetItemRow(AHotGroupItem.Index, AWidth); + ACurrentGroupItem := GetGroupItem(AGroupIndex, + AGroupViewInfo.GetItemIndex(AGroupRowIndex, 0, AWidth)); + finally + if ADestroyAfterUse then + AGroupViewInfo.Free; + end; + ARequiredGroupItem := ACurrentGroupItem; + AItemIsObtained := False; + repeat + AGroupViewInfo := GetGroupViewInfo(FOwner.GetGroups, ViewInfo, + AGroupIndex, ADestroyAfterUse); + if AGroupViewInfo <> nil then + try + if AGroupRowIndex = -1 then + AGroupRowIndex := AGroupViewInfo.GetRowCount(AWidth) - 1; + repeat + ACurrentGroupItem := GetGroupItem(AGroupIndex, + AGroupViewInfo.GetItemIndex(AGroupRowIndex, 0, AWidth)); + ViewInfo.GroupItemYRange(ACurrentGroupItem, + ACurrentGroupItemTop, ACurrentGroupItemBottom); + if (AHotTrackedGroupItemTop - ACurrentGroupItemTop) < + AViewInfo.GallerySize.cy then + ARequiredGroupItem := ACurrentGroupItem + else + AItemIsObtained := True; + Dec(AGroupRowIndex); + until (AGroupRowIndex < 0) or AItemIsObtained; + finally + if ADestroyAfterUse then + AGroupViewInfo.Free; + end; + Dec(AGroupIndex); + AGroupRowIndex := -1; + until AItemIsObtained or (AGroupIndex < 0); + if AItemIsObtained then + begin + AViewInfo.DontDisplayGroupHeaderWhenHotTrackingGroupItem := + AViewInfo.DontDisplayGroupHeaderWhenHotTrackingGroupItem + 1; + try + SetHotGroupItem(ARequiredGroupItem) + finally + AViewInfo.DontDisplayGroupHeaderWhenHotTrackingGroupItem := + AViewInfo.DontDisplayGroupHeaderWhenHotTrackingGroupItem - 1; + end; + end + else + HotTrackFirstGroupItem; +end; + +procedure TdxRibbonOnSubMenuGalleryController.Tabulation; +var + AGroupIndex: Integer; + AGroupItem: TdxRibbonGalleryGroupItem; +begin + AGroupItem := KeyboardHotGroupItem; + if AGroupItem <> nil then + begin + if GetKeyState(VK_SHIFT) and 128 <> 128 then + begin + if AGroupItem.Index < AGroupItem.Group.Items.Count - 1 then + AGroupItem := AGroupItem.Group.Items[AGroupItem.Index + 1] + else + begin + AGroupIndex := -1; + if AGroupItem.Group.Index < FOwner.GetGroups.Count - 1 then + AGroupIndex := ViewInfo.GetVisibleNotEmptyGroupIndex( + AGroupItem.Group.Index + 1, True); + if AGroupIndex = -1 then + if TdxBarItemLinksAccess(FOwner.Parent.ItemLinks).First <> nil then + begin + BarNavigationController.ChangeSelectedObject(True, + TdxBarItemLinksAccess(FOwner.Parent.ItemLinks).First.Control.IAccessibilityHelper); + AGroupItem := nil; + end + else + AGroupIndex := ViewInfo.GetVisibleNotEmptyGroupIndex(0, True); + if AGroupIndex <> -1 then + AGroupItem := FOwner.GetGroups[AGroupIndex].Items[0]; + end; + end + else + if AGroupItem.Index > 0 then + AGroupItem := AGroupItem.Group.Items[AGroupItem.Index - 1] + else + begin + AGroupIndex := -1; + if AGroupItem.Group.Index > 0 then + AGroupIndex := ViewInfo.GetVisibleNotEmptyGroupIndex( + AGroupItem.Group.Index - 1, False); + if AGroupIndex = -1 then + if TdxBarItemLinksAccess(FOwner.Parent.ItemLinks).Last <> nil then + begin + BarNavigationController.ChangeSelectedObject(True, + TdxBarItemLinksAccess(FOwner.Parent.ItemLinks).Last.Control.IAccessibilityHelper); + AGroupItem := nil; + end + else + AGroupIndex := ViewInfo.GetVisibleNotEmptyGroupIndex( + FOwner.GetGroups.Count - 1, False); + if AGroupIndex <> -1 then + begin + AGroupItem := FOwner.GetGroups[AGroupIndex].Items[FOwner.GetGroups[AGroupIndex].Items.Count - 1]; + end; + end; + end + else + AGroupItem := GetFirstGroupItem; + SetHotGroupItem(AGroupItem); +end; + +procedure TdxRibbonOnSubMenuGalleryController.CheckFilterMenuHotTrack; +begin + ViewInfo.SetFilterBandHotTrack((ActiveBarControl = FOwner.Parent) and not (ssLeft in InternalGetShiftState) and + ViewInfo.IsPtInFilterBandHotTrackArea(FOwner.Parent.ScreenToClient(GetMouseCursorPos))); +end; + +procedure TdxRibbonOnSubMenuGalleryController.FilterMenuButtonClick(Sender: TObject); +begin + if GalleryItem.GalleryFilter.Categories.Count = 0 then + FilterMenuGroupButtonClick(Sender) + else + FilterMenuCategoryButtonClick(Sender); +end; + +procedure TdxRibbonOnSubMenuGalleryController.FilterMenuCategoryButtonClick( + Sender: TObject); +var + AItem: TdxBarItem; + ANewActiveCategoryIndex, I: Integer; +begin + ANewActiveCategoryIndex := TdxBarButton(Sender).Tag; + + for I := 0 to FFilterMenuControl.ItemLinks.VisibleItemCount - 1 do + begin + AItem := FFilterMenuControl.ItemLinks.VisibleItems[I].Item; + if IsFilterMenuInternalButton(AItem) and (AItem.Tag >= 0) then + TdxBarButton(AItem).Down := AItem.Tag = ANewActiveCategoryIndex; + end; + + if GalleryItem.GalleryFilter.ActiveCategoryIndex <> ANewActiveCategoryIndex then + begin + GalleryItem.GalleryFilter.ActiveCategoryIndex := ANewActiveCategoryIndex; + GalleryItem.DoFilterChanged; + ViewInfo.RepaintFilterBand; + end; + + HideFilterMenu; +end; + +procedure TdxRibbonOnSubMenuGalleryController.FilterMenuGroupButtonClick( + Sender: TObject); +var + AButton: TdxBarButton; + AIsFilterChanged, AShowAllGroups: Boolean; + AItem: TdxBarItem; + I: Integer; +begin + AButton := TdxBarButton(Sender); + if AButton.Tag >= 0 then + begin + GalleryItem.GalleryGroups[AButton.Tag].Visible := AButton.Down; + AIsFilterChanged := True; + end + else + begin + AIsFilterChanged := False; + AShowAllGroups := AButton.Tag = -1; + GalleryItem.LockFilterChanged(True); + try + for I := 0 to FFilterMenuControl.ItemLinks.VisibleItemCount - 1 do + begin + AItem := FFilterMenuControl.ItemLinks.VisibleItems[I].Item; + if IsFilterMenuInternalButton(AItem) and (AItem.Tag >= 0) and + (TdxBarButton(AItem).Down <> AShowAllGroups) then + begin + TdxBarButton(AItem).Down := AShowAllGroups; + GalleryItem.GalleryGroups[AItem.Tag].Visible := AShowAllGroups; + AIsFilterChanged := True; + end; + end; + finally + GalleryItem.LockFilterChanged(False); + end; + end; + if AIsFilterChanged then + begin + GalleryItem.DoFilterChanged; + ViewInfo.RepaintFilterBand; + end; +end; + +function TdxRibbonOnSubMenuGalleryController.GetFirstGroupItem: TdxRibbonGalleryGroupItem; +var + AGroup: TdxRibbonGalleryGroup; + I: Integer; +begin + Result := nil; + for I := 0 to GalleryItem.GalleryGroups.Count - 1 do + if GalleryItem.IsGroupVisible(I) then + begin + AGroup := GalleryItem.GalleryGroups[I]; + if AGroup.Items.Count <> 0 then + begin + Result := AGroup.Items[0]; + Break; + end; + end; +end; + +function TdxRibbonOnSubMenuGalleryController.GetGalleryWidth: Integer; +begin + Result := ViewInfo.GallerySize.cx; +end; + +function TdxRibbonOnSubMenuGalleryController.GetLastGroupItem: TdxRibbonGalleryGroupItem; +var + AGroup: TdxRibbonGalleryGroup; + I: Integer; +begin + Result := nil; + for I := GalleryItem.GalleryGroups.Count - 1 downto 0 do + if GalleryItem.IsGroupVisible(I) then + begin + AGroup := GalleryItem.GalleryGroups[I]; + if AGroup.Items.Count <> 0 then + begin + Result := AGroup.Items[AGroup.Items.Count - 1]; + Break; + end; + end; +end; + +function TdxRibbonOnSubMenuGalleryController.GetViewInfo: TdxRibbonOnSubMenuGalleryControlViewInfo; +begin + Result := TdxRibbonOnSubMenuGalleryControlViewInfo(FOwner.ViewInfo); +end; + +procedure TdxRibbonOnSubMenuGalleryController.HideFilterMenu; +begin + FFilterMenuControl.Hide; + CheckFilterMenuHotTrack; +end; + +procedure TdxRibbonOnSubMenuGalleryController.InitFilterMenu( + AItemLinks: TdxBarItemLinks); + + procedure AddButton(const ACaption: string; AIsCheckable, AIsDown: Boolean; + ATag: Longint; ABeginGroup: Boolean); + var + AButton: TdxBarButton; + begin + AButton := TdxBarButton(BarDesignController.AddInternalItem(AItemLinks, + TdxBarButton, ACaption, FilterMenuButtonClick).Item); + AButton.CloseSubMenuOnClick := False; + if AIsCheckable then + begin + AButton.ButtonStyle := bsChecked; + AButton.Down := AIsDown; + end; + AButton.Tag := ATag; + AButton.Links[0].BeginGroup := ABeginGroup; + end; + +var + I: Integer; +begin + BarDesignController.ClearInternalItems; + if GalleryItem.GalleryFilter.Categories.Count = 0 then + begin + for I := 0 to GalleryItem.GalleryGroups.Count - 1 do + if GalleryItem.IsGroupVisible(I, True) then + AddButton(GalleryItem.GalleryGroups[I].Header.Caption, True, + GalleryItem.GalleryGroups[I].Visible, I, False); + AddButton(cxGetResourceString(@dxSBAR_SHOWALLGALLERYGROUPS), False, False, -1, True); + AddButton(cxGetResourceString(@dxSBAR_HIDEALLGALLERYGROUPS), False, False, -2, False); + end + else + begin + for I := 0 to GalleryItem.GalleryFilter.Categories.Count - 1 do + AddButton(GalleryItem.GalleryFilter.Categories[I].Caption, True, + I = GalleryItem.GalleryFilter.ActiveCategoryIndex, I, False); + AddButton(cxGetResourceString(@dxSBAR_CLEARGALLERYFILTER), False, False, -1, True); + end; + + GalleryItem.DoInitFilterMenu(AItemLinks); +end; + +function TdxRibbonOnSubMenuGalleryController.IsFilterMenuInternalButton( + AItem: TdxBarItem): Boolean; +begin + FTempEventHandler := FilterMenuButtonClick; + Result := Assigned(AItem.OnClick) and + EqualMethods(TMethod(AItem.OnClick), TMethod(FTempEventHandler)); +end; + +procedure TdxRibbonOnSubMenuGalleryController.ShowFilterMenu; +var + AOwnerHeight: Integer; + P: TPoint; +begin + FFilterMenuControl := TdxRibbonGalleryFilterMenuControl.Create(FOwner); + FFilterMenuControl.ParentWnd := FOwner.Parent.Handle; + FFilterMenuControl.ParentBar := FOwner.Parent; + FFilterMenuControl.OwnerControl := FOwner.Parent; + InitFilterMenu(FFilterMenuControl.ItemLinks); + ViewInfo.GetFilterMenuShowingParams(P, AOwnerHeight); + FFilterMenuControl.OwnerHeight := AOwnerHeight; + FFilterMenuControl.Left := P.X; + FFilterMenuControl.Top := P.Y; + FFilterMenuControl.Show; +end; + +{ TdxRibbonGalleryFilterMenuControl } + +constructor TdxRibbonGalleryFilterMenuControl.Create( + AGalleryControl: TdxRibbonGalleryControl); +begin + inherited Create(AGalleryControl.BarManager); + FGalleryControl := AGalleryControl; + FGalleryControlLink := cxAddObjectLink(AGalleryControl); +end; + +destructor TdxRibbonGalleryFilterMenuControl.Destroy; +begin + if (FGalleryControlLink.Ref <> nil) and (FGalleryControl.Controller <> nil) then + TdxRibbonOnSubMenuGalleryController(GalleryControl.Controller).FilterMenuControlDestroyed; + cxRemoveObjectLink(FGalleryControlLink); + inherited Destroy; +end; + +function TdxRibbonGalleryFilterMenuControl.GetBehaviorOptions: TdxBarBehaviorOptions; +begin + Result := inherited GetBehaviorOptions - [bboItemCustomizePopup]; +end; + +function TdxRibbonGalleryFilterMenuControl.GetPainter: TdxBarPainter; +begin + Result := GalleryControl.Painter; +end; + +procedure TdxRibbonGalleryFilterMenuControl.ProcessMouseDownMessageForMeaningParent( + AWnd: HWND; AMsg: UINT; const AMousePos: TPoint); +begin + inherited ProcessMouseDownMessageForMeaningParent(AWnd, AMsg, AMousePos); + TdxRibbonOnSubMenuGalleryController(GalleryControl.Controller).HideFilterMenu; + if TdxRibbonOnSubMenuGalleryControlViewInfo(GalleryControl.ViewInfo).IsPtInFilterBandHotTrackArea( + RealOwnerControl.ScreenToClient(AMousePos)) then + FDontShowFilterMenuOnMouseDown := True; +end; + +{ TdxRibbonGalleryControl } + +constructor TdxRibbonGalleryControl.Create(AItemLink: TdxBarItemLink); +begin + inherited Create(AItemLink); + FController := CreateController; + FScrollBar := TdxRibbonGalleryScrollBar.Create(Self); + FScrollBar.Visible := False; + FScrollBar.Parent := Parent; + FScrollBar.SmallChange := 3; + FScrollBar.OnDropDown := DoScrollBarDropDown; + FScrollBar.OnMouseMove := DoScrollBarMouseMove; + FScrollBar.OnScroll := DoScrollBarScroll; +end; + +destructor TdxRibbonGalleryControl.Destroy; +begin + FreeAndNil(FScrollBar); + FreeAndNil(FController); + inherited; +end; + +function TdxRibbonGalleryControl.DoHint(var ANeedDeactivate: Boolean; + out AHintText: string; out AShortCut: string): Boolean; +begin + AHintText := ''; + AShortCut := ''; + ANeedDeactivate := False; + Result := FHintItem <> nil; + if Result then + AHintText := FHintItem.Caption; +end; + +function TdxRibbonGalleryControl.GetHintPosition(const ACursorPos: TPoint; + AHeight: Integer): TPoint; +begin + Result := inherited GetHintPosition(ACursorPos, AHeight); + if ViewInfo.IsInRibbon then + Result.X := Parent.ClientToScreen(FHintBounds.TopLeft).X + else + begin + Result := GetMouseCursorPos; + Inc(Result.Y, 20); + end; +end; + +procedure TdxRibbonGalleryControl.UpdateHint(AHintItem: TdxRibbonGalleryGroupItem; + const ABounds: TRect); +begin + FHintItem := AHintItem; + FHintBounds := ABounds; + if FHintItem <> nil then + BarManager.ActivateHint(True, '', Self) + else + BarManager.ActivateHint(False, ''); +end; + +function TdxRibbonGalleryControl.CalcDefaultWidth: Integer; + + function GetColumnCount: Integer; + begin + if Parent.Kind = bkBarControl then + Result := (ViewInfo as IdxBarMultiColumnItemControlViewInfo).GetColumnCount + else + Result := Item.GalleryOptions.ColumnCount; + end; + +const + MinWidth = 100; +var + AScrollbarAndIndents: Integer; + AGroupItemWidthIsNull: Boolean; +begin + if GetVisibleGroupCount > 0 then + begin + ViewInfo.CalculateGlobalItemSize; + Result := ViewInfo.GetLayoutWidth(GetColumnCount, AGroupItemWidthIsNull); + AScrollbarAndIndents := ViewInfo.GetScrollBarWidth + + ViewInfo.GetLeftLayoutIndent + + ViewInfo.GetRightLayoutIndent; //TODO: duplicated with TdxRibbonGalleryGroupViewInfo.GetColumnLeft + if (Result = 0) or AGroupItemWidthIsNull then + Result := MinWidth - AScrollbarAndIndents; + Result := Result + AScrollbarAndIndents; + Result := Result + + Max(0, ViewInfo.GetGalleryMargins.Left) + + Max(0, ViewInfo.GetGalleryMargins.Right); + end + else + Result := MinWidth;//TODO: GetMinWidth + Result := Min(Result, + Screen.Width - 2 * Painter.SubMenuControlNCBorderSize); +end; + +function TdxRibbonGalleryControl.CalcMinHeight: Integer; +var + AItemHeight, ARowHeight, AHeaderHeight: Integer; + ADestroyAfterUse: Boolean; + AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; + I: Integer; +begin + if GetGroups.Count > 0 then + begin + ARowHeight := 0; + AHeaderHeight := 0; + for I := 0 to GetGroups.Count - 1 do + if Item.IsGroupVisible(I) then + begin + AGroupViewInfo := GetGroupViewInfo(GetGroups, ViewInfo, I, + ADestroyAfterUse); + try + AItemHeight := AGroupViewInfo.GetRowHeight - + AGroupViewInfo.GetSpaceBetweenItems(False); + ARowHeight := Max(ARowHeight, AItemHeight); + AHeaderHeight := Max(AHeaderHeight, + AGroupViewInfo.Header.GetHeight(ViewInfo.GallerySize.cx, True)); + finally + if ADestroyAfterUse then + AGroupViewInfo.Free; + end; + if Item.GalleryOptions.EqualItemSizeInAllGroups then Break; + end; + Result := AHeaderHeight + ARowHeight; + end + else + Result := 0; +end; + +procedure TdxRibbonGalleryControl.CalcParts; +begin + inherited CalcParts; + if not FLockCalcParts then + begin + ScrollBarSetup; + if not Collapsed then + ViewInfo.Calculate(FScrollBar.Position, scPosition); + end; +end; + +function TdxRibbonGalleryControl.CanClicked: Boolean; +begin + Result := not Collapsed and not FIsDroppingDown; +end; + +procedure TdxRibbonGalleryControl.ControlUnclick(ByMouse: Boolean); +var + AInRibbonGalleryControlLink: TcxObjectLink; + AItem: TdxRibbonGalleryItem; + AGalleryControl: TdxRibbonGalleryControl; +begin + if not Collapsed and (Parent.Kind <> bkBarControl) and (Parent.ParentBar <> nil) and (Parent.ParentBar.Kind = bkBarControl) and + TdxBarItemControlAccess(TdxRibbonDropDownGalleryControl(Parent).ParentItemControl).IsExpandable then + AInRibbonGalleryControlLink := cxAddObjectLink(TdxRibbonDropDownGalleryControl(Parent).ParentItemControl) + else + AInRibbonGalleryControlLink := nil; + try + AItem := Item; + if ByMouse then + begin + with Parent.ScreenToClient(GetMouseCursorPos) do + Item.FClickedGroupItem := ViewInfo.GetGroupItem(X, Y); + if Item.FClickedGroupItem = nil then + Exit; + end + else + begin + {if Controller.KeyboardHotGroupItem = nil then + raise Exception.Create('');} + Item.FClickedGroupItem := Controller.KeyboardHotGroupItem; + end; + inherited ControlUnclick(ByMouse); + if (AInRibbonGalleryControlLink <> nil) and (AInRibbonGalleryControlLink.Ref <> nil) then + begin + AGalleryControl := TdxRibbonGalleryControl(AInRibbonGalleryControlLink.Ref); + if (AGalleryControl.Item = AItem) and not AGalleryControl.Collapsed then + AGalleryControl.ViewInfo.ShowGroupItem(AItem.FClickedGroupItem); + end; + finally + cxRemoveObjectLink(AInRibbonGalleryControlLink); + end; +end; + +function TdxRibbonGalleryControl.CreateController: TdxRibbonGalleryController; +begin + case Parent.Kind of + bkBarControl: Result := TdxRibbonGalleryController.Create(Self); + bkSubMenu: Result := TdxRibbonOnSubMenuGalleryController.Create(Self); + else + raise Exception.Create(''); + end; +end; + +procedure TdxRibbonGalleryControl.DoCloseUp(AHadSubMenuControl: Boolean); +begin + inherited DoCloseUp(AHadSubMenuControl); + Item.ItemLinks.BarControl := nil; +end; + +procedure TdxRibbonGalleryControl.DoDropDown(AByMouse: Boolean); +begin + inherited DoDropDown(AByMouse); + if IsDroppedDown then + Controller.GroupItemHotTrackEnabled := True; +end; + +procedure TdxRibbonGalleryControl.DropDown(AByMouse: Boolean); +begin + Controller.KeyboardHotGroupItem := nil; + FIsDroppingDown := True; + try + inherited DropDown(AByMouse); + finally + FIsDroppingDown := False; + end; +end; + +procedure TdxRibbonGalleryControl.EnabledChanged; +begin + inherited EnabledChanged; + ScrollBarSetup; +end; + +function TdxRibbonGalleryControl.GetClientHeight: Integer; +begin + Result := Max(0, ViewInfo.GallerySize.cy); +end; + +function TdxRibbonGalleryControl.GetClientWidth: Integer; +begin + Result := Max(0, ViewInfo.GallerySize.cx); +end; + +function TdxRibbonGalleryControl.GetDefaultHeightInSubMenu: Integer; +begin + if Collapsed then + Result := inherited GetDefaultHeightInSubMenu + else + Result := ViewInfo.GetHeight( + GetDefaultWidthInSubMenu) + Max(0, ViewInfo.GetGalleryMargins.Top) + + Max(0, ViewInfo.GetGalleryMargins.Bottom); +end; + +function TdxRibbonGalleryControl.GetDefaultWidthInSubMenu: Integer; +begin + if Collapsed then + Result := inherited GetDefaultWidthInSubMenu + else + Result := CalcDefaultWidth; +end; + +{function TdxRibbonGalleryControl.GetMinWidth: Integer; //TODO: dropdoun is use this for default width +begin + Result := 100; +end;} + +function TdxRibbonGalleryControl.GetMouseWheelStep: Integer; +const + WheelRowCount = 3; +var + AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; + I, AGroupCount, AHeightSum: Integer; + ADestroyAfterUse: Boolean; +begin + Result := 0; + AGroupCount := 0; + AHeightSum := 0; + for I := 0 to GetGroups.Count - 1 do + if Item.IsGroupVisible(I) then + begin + AGroupViewInfo := GetGroupViewInfo(GetGroups, ViewInfo, I, + ADestroyAfterUse); + try + Inc(AGroupCount); + AHeightSum := AHeightSum + AGroupViewInfo.GetRowHeight; + finally + if ADestroyAfterUse then + AGroupViewInfo.Free; + end; + end; + if AGroupCount <> 0 then + Result := MulDiv(AHeightSum, WheelRowCount, AGroupCount); +end; + +procedure TdxRibbonGalleryControl.GetSubMenuControlPositionParams(out P: TPoint; + out AOwnerWidth, AOwnerHeight: Integer); +begin + if not Collapsed and ScrollBar.IsDropDownStyle and not Parent.IsCustomizing then + begin + P := Parent.ClientToScreen(cxPointOffset( + ViewInfo.GalleryBounds.TopLeft, -DropDownOffsetX, -DropDownOffsetY)); + AOwnerWidth := 0; + AOwnerHeight := 1; + end + else + inherited GetSubMenuControlPositionParams(P, AOwnerWidth, AOwnerHeight); +end; + +function TdxRibbonGalleryControl.InternalGetDefaultWidth: Integer; +begin + if Collapsed then + Result := inherited InternalGetDefaultWidth + else + Result := CalcDefaultWidth; +end; + +function TdxRibbonGalleryControl.WantsKey(Key: Word): Boolean; +begin + Result := inherited WantsKey(Key) and + not ((Key = VK_RETURN) and not Collapsed and (Parent.Kind <> bkBarControl)); +end; + +procedure TdxRibbonGalleryControl.CalcDrawParams(AFull: Boolean = True); +begin + inherited CalcDrawParams(AFull); + if Collapsed then + Exit; + if AFull then + begin + FDrawParams.ShortCut := ''; + FDrawParams.PaintType := TCustomdxBarControlAccess(Parent).GetPaintType; + FDrawParams.Enabled := Enabled; + FDrawParams.SelectedByKey := False; + end; + FDrawParams.Canvas := Canvas; +end; + +procedure TdxRibbonGalleryControl.ControlActivate(Immediately: Boolean); + + function CanActivateControl: Boolean; + begin + Result := not Parent.IsCustomizing or + not (Immediately and not Collapsed and (Parent.Kind = bkBarControl) and + not ScrollBar.IsDropDownButtonPressed); + end; + +begin + if CanActivateControl then + inherited ControlActivate(Immediately); +end; + +procedure TdxRibbonGalleryControl.ControlClick(AByMouse: Boolean; AKey: Char = #0); +var + R: TRect; +begin + if AByMouse and not Collapsed and (Parent.Kind = bkBarControl) then + begin + GetWindowRect(ScrollBar.Handle, R); + FIsClickOnItemsArea := not PtInRect(R, InternalGetCursorPos); + end; + try + inherited ControlClick(AByMouse, AKey); + finally + FIsClickOnItemsArea := False; + end; +end; + +procedure TdxRibbonGalleryControl.CreateSubMenuControl; + + function CreateCloneForDropDownGallery(AGalleryItem: TdxRibbonGalleryItem): TdxRibbonGalleryItem; + begin + if Parent.IsCustomizing then + begin + FreeAndNil(FDropDownGalleryItem); + TdxBarManagerAccess(BarManager).ItemList.BeginUpdate; + try + FDropDownGalleryItem := AGalleryItem.CreateCloneForDropDownGallery; + Result := FDropDownGalleryItem; + BarDesignController.RemoveItemFromBarManagerList(FDropDownGalleryItem); + finally + TdxBarManagerAccess(BarManager).ItemList.EndUpdate(False); + end; + end + else + Result := AGalleryItem; + end; + +var + ASubMenuGalleryItem: TdxRibbonGalleryItem; +begin + Item.ItemLinks.BarControl := TdxRibbonDropDownGalleryControl.Create(BarManager); + if (Item.DropDownGallery <> nil) and Item.DropDownGallery.HasValidGalleryItem then + begin + SubMenuControl.ItemLinks := Item.DropDownGallery.ItemLinks; + SubMenuControl.ItemLinks.BarControl := SubMenuControl; + ASubMenuGalleryItem := Item.DropDownGallery.GalleryItem; + end + else + begin + SubMenuControl.ItemLinks := Item.ItemLinks; + ASubMenuGalleryItem := CreateCloneForDropDownGallery(Item); + end; + TdxRibbonDropDownGalleryControl(SubMenuControl).GalleryItem := ASubMenuGalleryItem; +end; + +procedure TdxRibbonGalleryControl.DoPaint(ARect: TRect; + PaintType: TdxBarPaintType); +begin + ObtainTextColors; + if not IsValidPainter then + begin + DrawInvalid(ARect); + Exit; + end; + if Collapsed then + begin + inherited DoPaint(ARect, PaintType); + Exit; + end; + ViewInfo.Paint; + with ViewInfo.ScrollBarBounds do + FScrollBar.SetBounds(Left, Top, Right - Left, Bottom - Top); + ShowWindow(FScrollBar.Handle, SW_SHOW); + FScrollBar.Invalidate; +end; + +procedure TdxRibbonGalleryControl.FilterCaptionChanged; +begin + if (Parent.Kind <> bkBarControl) and Item.IsFilterVisible then + TdxRibbonOnSubMenuGalleryControlViewInfo(ViewInfo).RepaintFilterBand; +end; + +function TdxRibbonGalleryControl.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxRibbonGalleryControlAccessibilityHelper; +end; + +function TdxRibbonGalleryControl.GetGroups: TdxRibbonGalleryGroups; +begin + Result := TdxRibbonGalleryItem(Item).GalleryGroups; +end; + +function TdxRibbonGalleryControl.GetViewInfoClass: TdxBarItemControlViewInfoClass; +begin + case Parent.Kind of + bkBarControl: Result := TdxInRibbonGalleryControlViewInfo; + bkSubMenu: Result := TdxRibbonOnSubMenuGalleryControlViewInfo; + else + raise Exception.Create(''); + end; +end; + +function TdxRibbonGalleryControl.GetVisibleGroupCount: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to GetGroups.Count - 1 do + if Item.IsGroupVisible(I) then + Inc(Result); +end; + +function TdxRibbonGalleryControl.HasSubMenu: Boolean; +begin + if not IsValidPainter then + begin + Result := False; + Exit; + end; + Result := Collapsed or (Parent.Kind = bkBarControl) and + (Parent.IsCustomizing or not FIsClickOnItemsArea); +end; + +function TdxRibbonGalleryControl.IsDestroyOnClick: Boolean; +begin + if not Collapsed and (Parent.Kind <> bkBarControl) and + TdxRibbonOnSubMenuGalleryControlViewInfo(ViewInfo).IsPtInFilterBandHotTrackArea( + Parent.ScreenToClient(GetMouseCursorPos)) then + Result := False + else + Result := CanClicked; +end; + +function TdxRibbonGalleryControl.IsEnabledScrollBar: Boolean; +begin + Result := Enabled and (ScrollBar.IsDropDownStyle or + (ViewInfo.GetGalleryHeight(ClientWidth) > ClientHeight) and + not Item.RecalculatingOnFilterChanged); +end; + +function TdxRibbonGalleryControl.IsHiddenForCustomization: Boolean; +begin + Result := Item.IsClone; +end; + +function TdxRibbonGalleryControl.IsNeedScrollBar: Boolean; +begin + if not FIsNeedScrollBarLock then + begin + FIsNeedScrollBarLock := True; + try + Result := not Collapsed and ((Parent.Kind = bkBarControl) or + (Item.GalleryOptions.SubMenuResizing in [gsrHeight, gsrWidthAndHeight]) or + IsEnabledScrollBar); + finally + FIsNeedScrollBarLock := False; + end; + end + else + Result := False; +end; + +function TdxRibbonGalleryControl.IsValidPainter: Boolean; +begin + Result := Painter is TdxBarSkinnedPainter; +end; + +procedure TdxRibbonGalleryControl.MouseLeave; +begin + inherited MouseLeave; + if not Collapsed then + Controller.MouseLeave; +end; + +procedure TdxRibbonGalleryControl.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + if not Collapsed then + Controller.MouseDown(Button, Shift, X, Y); +end; + +procedure TdxRibbonGalleryControl.MouseMove(Shift: TShiftState; + X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + if not Collapsed then + Controller.MouseMove(Shift, X, Y); +end; + +procedure TdxRibbonGalleryControl.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + if not Collapsed then + Controller.MouseUp(Button, Shift, X, Y); +end; + +procedure TdxRibbonGalleryControl.DoScrollBarScroll(Sender: TObject; + ScrollCode: TScrollCode; var ScrollPos: Integer); + + function CanHandleScrollCode: Boolean; + begin + Result := not (ScrollBar.IsDropDownStyle and ( + (ScrollCode = scLineUp) and not ViewInfo.GetPreviousButtonEnabled or + (ScrollCode = scLineDown) and not ViewInfo.GetNextButtonEnabled or + (ScrollCode = scEndScroll))); + end; + +begin + if not CanHandleScrollCode then + Exit; + ScrollPos := Min(ScrollPos, ViewInfo.GetGalleryHeight(ClientWidth) - + ClientHeight); + ViewInfo.Calculate(ScrollPos, ScrollCode); + ScrollBarSetup; + Repaint; +end; + +procedure TdxRibbonGalleryControl.DoScrollBarMouseMove( + Sender: TObject; Shift: TShiftState; X, Y: Integer); +begin + TCustomdxBarControlAccess(Parent).MouseMove(Shift, FScrollBar.Left + X, + FScrollBar.Top + Y); +end; + +procedure TdxRibbonGalleryControl.ScrollBarSetup; +var + AGalleryHeight, ALargeChange: Integer; +begin + FScrollBar.Visible := IsNeedScrollBar; + if Collapsed then + begin + ShowWindow(FScrollBar.Handle, SW_HIDE); + Exit; + end; + ALargeChange := 1; + AGalleryHeight := ViewInfo.GetGalleryHeight(ClientWidth); + if AGalleryHeight > ClientHeight then + begin + FScrollBar.SetScrollParams(0, Max(0, AGalleryHeight - 1), + ViewInfo.LayoutOffset, Max(0, ClientHeight)); + if (ClientHeight > 1) then + ALargeChange := ClientHeight; + end + else + FScrollBar.SetScrollParams(0, 1, 0, 0); + FScrollBar.LargeChange := ALargeChange; + ScrollBar.Enabled := IsEnabledScrollBar; +end; + +procedure TdxRibbonGalleryControl.SetScrollBarPosition(APosition: Integer); +var + AScrollCode: TScrollCode; +begin + if (FScrollBar.Enabled) and (FScrollBar.Position <> APosition) then + begin + if FScrollBar.Position > APosition then + AScrollCode := scLineUp + else + AScrollCode := scLineDown; + FScrollBar.Position := APosition; + DoScrollBarScroll(FScrollBar, AScrollCode, APosition); + end; +end; + +procedure TdxRibbonGalleryControl.DoScrollBarDropDown(Sender: TObject); +begin + if Parent.IsCustomizing then + begin + BarNavigationController.ChangeSelectedObject(True, IAccessibilityHelper); + DropDown(True); + end + else + SendMessage(Parent.Handle, WM_LBUTTONDOWN, ShiftStateToKeys(InternalGetShiftState), + MakeLParam(ScrollBar.Left, ScrollBar.Top)); +end; + +procedure TdxRibbonGalleryControl.DrawInvalid(const ABounds: TRect); +begin + Canvas.Pen.Color := clRed; + Canvas.SetBrushColor(clWhite); + Canvas.Brush.Style := bsSolid; + Canvas.Canvas.Rectangle(ABounds.Left, ABounds.Top, ABounds.Right, ABounds.Bottom); + Canvas.Canvas.MoveTo(ABounds.Left, ABounds.Top); + Canvas.Canvas.LineTo(ABounds.Right, ABounds.Bottom - 1); + Canvas.Canvas.MoveTo(ABounds.Right - 1, ABounds.Top); + Canvas.Canvas.LineTo(ABounds.Left, ABounds.Bottom - 1); + Canvas.Brush.Style := bsClear; + Canvas.DrawText(Item.Caption, ABounds, cxAlignCenter); + Canvas.Brush.Style := bsSolid; +end; + +function TdxRibbonGalleryControl.GetCollapsed: Boolean; +begin + if not IsValidPainter or (ViewInfo <> nil) and + (TCustomdxBarControlAccess(Parent).GetItemControlDefaultViewLevel(Self) <> ivlDefault) then + begin + Result := True; + Exit; + end; + + if FIsCollapsedAssigned then + Result := FCollapsed + else + Result := (ViewInfo <> nil) and ViewInfo.IsCollapsed; +end; + +function TdxRibbonGalleryControl.GetItem: TdxRibbonGalleryItem; +begin + Result := TdxRibbonGalleryItem(ItemLink.Item); +end; + +function TdxRibbonGalleryControl.GetViewInfo: TdxRibbonGalleryControlViewInfo; +begin + Result := TdxRibbonGalleryControlViewInfo(FViewInfo); +end; + +procedure TdxRibbonGalleryControl.ObtainTextColors; +var + AColor1: TColor; +begin + if (Self.DrawParams.HotPartIndex = icpControl) then + begin + if not Item.FSelectedTextColorDetermined then + Painter.GetTextColors(Self, True, False, True, AColor1, + Item.FSelectedTextColor); + Item.FSelectedTextColorDetermined := True; + end + else + if not Item.FDefaultTextColorDetermined then + begin + if (Self.DrawParams.HotPartIndex <> icpControl) then + Painter.GetTextColors(Self, True, False, True, AColor1, + Item.FDefaultTextColor) + else + Item.FDefaultTextColor := 0; + Item.FDefaultTextColorDetermined := True; + end; +end; + +procedure TdxRibbonGalleryControl.SetCollapsed(Value: Boolean); +begin + FIsCollapsedAssigned := True; + FCollapsed := Value; +end; + +{ TdxRibbonGalleryGroupElementViewInfo } + +constructor TdxRibbonGalleryGroupElementViewInfo.Create( + AOwner: TdxRibbonGalleryGroupViewInfo); +begin + inherited Create; + FOwner := AOwner; +end; + +procedure TdxRibbonGalleryGroupElementViewInfo.Calculate( + const ABounds: TRect); +begin + FBounds := ABounds; +end; + +procedure TdxRibbonGalleryGroupElementViewInfo.Paint(ACanvas: TcxCanvas); +begin +end; + +function TdxRibbonGalleryGroupElementViewInfo.GetFont: TFont; +begin + Result := Owner.Font; +end; + +function TdxRibbonGalleryGroupElementViewInfo.GetGalleryItemControl: TdxRibbonGalleryControl; +begin + Result := Owner.Owner.Control; +end; + +function TdxRibbonGalleryGroupElementViewInfo.GetTextFlags( + AnAlignment: TAlignment): Integer; +begin + Result := cxSingleLine or cxAlignVCenter or cxAlignmentsHorz[AnAlignment]; +end; + +{ TdxRibbonGalleryGroupHeaderViewInfo } + +procedure TdxRibbonGalleryGroupHeaderViewInfo.Calculate( + const ABounds: TRect); +begin + inherited Calculate(ABounds); + FTextBounds := GetTextBounds; +end; + +procedure TdxRibbonGalleryGroupHeaderViewInfo.Paint(ACanvas: TcxCanvas); +begin + if IsVisible then + begin + ACanvas.Font := GetFont; + ACanvas.Font.Color := Owner.Painter.Skin.GetPartColor(DXBAR_GALLERYGROUPHEADERTEXT); + ACanvas.Font.Style := [fsBold]; + ACanvas.Brush.Style := bsClear; + Owner.Painter.Skin.DrawBackground(ACanvas.Handle, Bounds, DXBAR_GALLERYGROUPHEADERBACKGROUND); + ACanvas.DrawText(Caption, cxRectInflate(Bounds, -GroupHeaderCaptionOffset, 0), + GetTextFlags(Owner.Group.Header.Alignment)); + ACanvas.Brush.Style := bsSolid; + end; +end; + +function TdxRibbonGalleryGroupHeaderViewInfo.GetCaption: string; +begin + Result := Owner.Group.Header.Caption; +end; + +function TdxRibbonGalleryGroupHeaderViewInfo.GetHeight(AWidth: Integer; + AWithSpaceAfterHeader: Boolean): Integer; +begin + if Owner.Group.Header.Visible and (AWidth <> 0) and + (Screen.PixelsPerInch <> 0) then + Result := Round(MulDiv(cxTextHeight(GetFont), 3, 2) * + 96 / Screen.PixelsPerInch) + + IfThen(AWithSpaceAfterHeader, Owner.Options.GetSpaceAfterGroupHeader) + else + Result := 0; +end; + +function TdxRibbonGalleryGroupHeaderViewInfo.GetTextBounds: TRect; +begin + Result := Bounds; +end; + +function TdxRibbonGalleryGroupHeaderViewInfo.IsVisible: Boolean; +begin + Result := Owner.Group.Header.Visible and Owner.Owner.IsGroupHeaderVisible and + not IsRectEmpty(Bounds); +end; + +{ TdxRibbonGalleryGroupItemViewInfo } + +constructor TdxRibbonGalleryGroupItemViewInfo.Create( + AOwner: TdxRibbonGalleryGroupViewInfo; + AGroupItem: TdxRibbonGalleryGroupItem); +begin + inherited Create(AOwner); + FGroupItem := AGroupItem; +end; + +procedure TdxRibbonGalleryGroupItemViewInfo.Calculate(const ABounds: TRect); +begin + inherited Calculate(ABounds); + FCaptionBounds := GetRectConsiderBounds(GetCaptionBounds); + FDescriptionBounds := GetRectConsiderBounds(GetDescriptionBounds); + FImageBounds := GetImageBounds; +end; + +procedure TdxRibbonGalleryGroupItemViewInfo.Paint(ACanvas: TcxCanvas); + + procedure DrawBackground; + begin + if GetDowned then + Painter.Skin.DrawBackground(ACanvas.Canvas.Handle, FBounds, + DXBAR_SMALLBUTTON, DXBAR_Pressed) + else + if GetHotTracked then + begin + if GetSelected then + Painter.Skin.DrawBackground(ACanvas.Canvas.Handle, FBounds, + DXBAR_SMALLBUTTON, DXBAR_HOTCHECK) + else + Painter.Skin.DrawBackground(ACanvas.Canvas.Handle, FBounds, + DXBAR_SMALLBUTTON, DXBAR_ACTIVE); + end + else + begin + if GetSelected then + Painter.Skin.DrawBackground(ACanvas.Canvas.Handle, FBounds, + DXBAR_SMALLBUTTON, DXBAR_CHECKED) + else + Owner.Owner.DrawBackground(Bounds); + end; + end; + + procedure DrawSelectionRect(ARect: TRect; AState: Integer); + var + ABrushStyle: TBrushStyle; + APenColor: TColor; + begin + ABrushStyle := ACanvas.Brush.Style; + ACanvas.Brush.Style := bsClear; + APenColor := ACanvas.Pen.Color; + try + ACanvas.Pen.Color := Owner.Painter.Skin.GetPartColor( + DXBAR_GALLERYGROUPITEM_OUTERBORDER, AState); + ARect := FImageBounds; + ACanvas.Canvas.Rectangle(ARect); + ACanvas.Pen.Color := Owner.Painter.Skin.GetPartColor( + DXBAR_GALLERYGROUPITEM_INNERBORDER, AState); + ARect := cxRectInflate(ARect, -1, -1); + ACanvas.Canvas.Rectangle(ARect); + finally + ACanvas.Brush.Style := ABrushStyle; + ACanvas.Pen.Color := APenColor; + end; + end; + + procedure DrawSelection; + var + AState: Integer; + begin + if IsImageVisible then + begin + if GetHotTracked then + begin + if GetSelected then + AState := DXBAR_HOTCHECK + else + AState := DXBAR_HOT; + DrawSelectionRect(FImageBounds, AState); + end + else + if GetSelected then + begin + AState := DXBAR_CHECKED; + DrawSelectionRect(FImageBounds, AState); + end; + end; + end; + +begin + if not IsMergeItemsImages then + DrawBackground + else + Owner.Owner.DrawBackground(Bounds); + + ACanvas.SaveState; + try + GroupItem.DrawImage(ACanvas.Canvas.Handle, FImageBounds); + DrawItemText(ACanvas); + finally + ACanvas.Brush.Style := bsSolid; + ACanvas.RestoreState; + end; + + if IsMergeItemsImages then + DrawSelection; +end; + +procedure TdxRibbonGalleryGroupItemViewInfo.DrawItemText(ACanvas: TcxCanvas); + + function GetTextAlignmentFlags: UINT; + begin + if Options.GetItemImagePosition in [gipLeft, gipRight] then + Result := cxAlignLeft + else + Result := cxAlignHCenter; + if FDescriptionRowCount = 1 then + Result := cxSingleLine or cxAlignVCenter or Result; + end; + +var + AParams: TdxBarButtonLikeControlDrawParams; + ADescriptionVisible: Boolean; +begin + ADescriptionVisible := IsDescriptionVisible; + ACanvas.Font := Font; + if GroupItem.Selected then + ACanvas.Font.Color := Owner.Owner.GalleryItem.SelectedTextColor + else + ACanvas.Font.Color := Owner.Owner.GalleryItem.DefaultTextColor; + ACanvas.Brush.Style := bsClear; + if IsCaptionVisible then + begin + CheckCaptionFontStyle(ACanvas.Font); + ACanvas.DrawText(Caption, FCaptionBounds, GetTextAlignmentFlags); + end; + if ADescriptionVisible then + begin + AParams := TdxBarButtonLikeControlDrawParams.Create(GetGalleryItemControl); + try + ACanvas.Font.Style := ACanvas.Font.Style - [fsBold]; + AParams.Canvas := ACanvas; + Painter.DrawItemMultilineText(AParams, Description, FDescriptionBounds, + cxFlagsToDTFlags(GetTextAlignmentFlags), FDescriptionRowCount); + finally + AParams.Free; + end; + end; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetCaption: string; +begin + Result := GroupItem.Caption; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetCaptionHeight: Integer; +begin + if IsCaptionVisible then + Result := cxTextHeight(Font) + else + Result := 0; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetCaptionWidth: Integer; +var + AFont: TFont; +begin + if IsCaptionVisible then + begin + if FCaptionWidth = 0 then + begin + AFont := TFont.Create; + try + AFont.Assign(Font); + CheckCaptionFontStyle(AFont); + Result := cxTextWidth(AFont, GroupItem.Caption); + finally + AFont.Free; + end; + FCaptionWidth := Result; + end + else + Result := FCaptionWidth; + end + else + Result := 0; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetDescription: string; +begin + Result := GroupItem.Description; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetDescriptionHeight: Integer; +var + ARect: TRect; +begin + if IsDescriptionVisible then + begin + if FDescriptionSize.cy = 0 then + begin + ARect := GetDescriptionRect; + Result := ARect.Bottom - ARect.Top; + FDescriptionSize.cy := Result; + end + else + Result := FDescriptionSize.cy; + end + else + Result := 0; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetDescriptionWidth: Integer; +var + ARect: TRect; +begin + if IsDescriptionVisible then + begin + if FDescriptionSize.cx = 0 then + begin + ARect := GetDescriptionRect; + Result := ARect.Right - ARect.Left; + FDescriptionSize.cx := Result; + end + else + Result := FDescriptionSize.cx; + end + else + Result := 0; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetSpaceBetweenItemCaptionAndDescription: Integer; +begin + if IsCaptionVisible and IsDescriptionVisible then + Result := Options.GetSpaceBetweenItemCaptionAndDescription + + dxRibbonGalleryGroupItemIndent + else + Result := 0; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetSpaceBetweenItemImageAndText: Integer; +begin + if IsCaptionVisible and CanUseSize(GetUnsizedImageSize) then + Result := Options.GetSpaceBetweenItemImageAndText + dxRibbonGalleryGroupItemIndent + else + Result := 0; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetImageSize: TSize; + + procedure FitToItemHeight(var AImageSize: TSize); + var + ANewImageHeight: Integer; + begin + if FPredefinedItemSize.cy <> 0 then + begin + ANewImageHeight := FPredefinedItemSize.cy - + 2 * VerticalImageIndent; + if AImageSize.cy > ANewImageHeight then + begin + AImageSize.cx := MulDiv(AImageSize.cx, ANewImageHeight, AImageSize.cy); + AImageSize.cy := ANewImageHeight; + end; + end; + end; + + procedure InscribeImage(var AImageSize: TSize); + var + APlaceSize: TSize; + AFactor: Double; + begin + if (Bounds.Right - Bounds.Left > 0) and + (Bounds.Bottom - Bounds.Top > 0) then + begin + APlaceSize := GetImagePlace; + if (AImageSize.cx = 0) or (AImageSize.cy = 0) then + AImageSize := cxNullSize + else + begin + if (APlaceSize.cx < AImageSize.cx) or (APlaceSize.cy < AImageSize.cy) then + begin + if APlaceSize.cx / AImageSize.cx < APlaceSize.cy / AImageSize.cy then + AFactor := APlaceSize.cx / AImageSize.cx + else + AFactor := APlaceSize.cy / AImageSize.cy; + AImageSize.cx := Round(AImageSize.cx * AFactor); + AImageSize.cy := Round(AImageSize.cy * AFactor); + end; + end; + end + else + FitToItemHeight(AImageSize); + end; + +begin + Result := GetUnsizedImageSize; + InscribeImage(Result); +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetUnsizedImageSize: TSize; +begin + Result := Owner.Group.Options.ItemImageSize.Size; + if not CanUseSize(Result) and IsImageVisible then + Result := FGroupItem.GetImageSize; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetCaptionBounds: TRect; +begin + Result.Left := GetTextLeft; + Result.Top := GetTextTop; + Result.Right := GetTextRight; + Result.Bottom := Result.Top + GetCaptionHeight; + if not (IsImageVisible or IsDescriptionVisible) then + Result := cxRectCenter(Bounds, cxSize(Result.Right - Result.Left, + Result.Bottom - Result.Top)); +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetDescriptionBounds: TRect; +begin + Result.Left := GetTextLeft; + Result.Top := GetTextTop + GetCaptionHeight + + GetSpaceBetweenItemCaptionAndDescription; + Result.Right := GetTextRight; + Result.Bottom := Result.Top + GetDescriptionHeight; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetImageBounds: TRect; +begin + if not IsCaptionVisible then + Result := cxRectCenter(Bounds, GetImageSize) + else + begin + case Options.GetItemImagePosition of + gipLeft: + begin + Result.Left := Bounds.Left + HorizontalImageIndent; + Result.Top := Bounds.Top + VerticalImageIndent; + Result.Right := Result.Left + GetImageSize.cx; + Result.Bottom := Bounds.Bottom - VerticalImageIndent; + end; + gipTop: + begin + Result.Left := Bounds.Left + HorizontalImageIndent; + Result.Top := Bounds.Top + VerticalImageIndent; + Result.Right := Bounds.Right - HorizontalImageIndent; + Result.Bottom := Result.Top + GetImageSize.cy; + end; + gipRight: + begin + Result.Right := Bounds.Right - HorizontalImageIndent; + Result.Top := Bounds.Top + VerticalImageIndent; + Result.Left := Result.Right - GetImageSize.cx; + Result.Bottom := Bounds.Bottom - VerticalImageIndent; + end; + else + Result.Bottom := Bounds.Bottom - VerticalImageIndent; + Result.Left := Bounds.Left + HorizontalImageIndent; + Result.Right := Bounds.Right - HorizontalImageIndent; + Result.Top := Result.Bottom - GetImageSize.cy; + end; + Result := cxRectCenter(Result, GetImageSize); + end; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetTextLeft: Integer; +begin + Result := Bounds.Left; + if Options.GetItemImagePosition = gipLeft then + Result := Result + + IfThen(CanUseSize(GetImageSize), GetImageSize.cx + + Options.GetSpaceBetweenItemImageAndText + + dxRibbonGalleryGroupItemIndent) + + dxRibbonGalleryGroupItemIndent + else + Result := Result + dxRibbonGalleryGroupItemIndent; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetTextRight: Integer; +begin + Result := Bounds.Right; + if Options.GetItemImagePosition = gipRight then + Result := Result - + IfThen(CanUseSize(GetImageSize), GetImageSize.cx + + Options.GetSpaceBetweenItemImageAndText + + dxRibbonGalleryGroupItemIndent) - + dxRibbonGalleryGroupItemIndent + else + Result := Result - dxRibbonGalleryGroupItemIndent; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetTextTop: Integer; +begin + Result := Bounds.Top; + if Options.GetItemImagePosition = gipTop then + Result := Result + + IfThen(CanUseSize(GetImageSize), GetImageSize.cy + + Options.GetSpaceBetweenItemImageAndText + + dxRibbonGalleryGroupItemIndent) + + dxRibbonGalleryGroupItemIndent + else + Result := Result + dxRibbonGalleryGroupItemIndent; +end; + +function TdxRibbonGalleryGroupItemViewInfo.IsBoldCaption: Boolean; +begin + Result := not IsInplaceGallery and + (Owner.Group.Options.ItemTextKind in [itkCaptionAndDescription]); +end; + +procedure TdxRibbonGalleryGroupItemViewInfo.SetPredefinedItemSize( + const AValue: TSize); +begin + FPredefinedItemSize := AValue; +end; + +procedure TdxRibbonGalleryGroupItemViewInfo.CheckCaptionFontStyle(AFont: TFont); +begin + if IsBoldCaption then + AFont.Style := AFont.Style + [fsBold]; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetDescriptionLenght: Integer; +begin + if FDescriptionLength = 0 then + begin + Result := cxTextWidth(GetFont, GroupItem.Description); + FDescriptionLength := Result; + end + else + Result := FDescriptionLength; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetDescriptionRect: TRect; +begin + FDescriptionRowCount := IfThen(GetDescriptionLenght > GetCaptionWidth, 2, 1); + {if cxRectIsEqual(FDescriptionRect, cxEmptyRect) then + begin} + GetGalleryItemControl.Canvas.SaveState; + try + GetGalleryItemControl.Canvas.Font := Font; + Result := cxGetTextRect(GetGalleryItemControl.Canvas.Handle, Description, + FDescriptionRowCount); + finally + GetGalleryItemControl.Canvas.RestoreState; + end; +{ FDescriptionRect := Result; + end + else + Result := FDescriptionRect;} + //Result := Rect(0,0,200,100); +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetDowned: Boolean; +begin + Result := IsThisGroupItem(Owner.Owner.DownedGroupItem); +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetHotGroupItem: TdxRibbonGalleryGroupItem; +begin + Result := Owner.Owner.HotGroupItem; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetHorizontalImageIndent: Integer; +begin + if Options.RemoveHorizontalItemPadding then + Result := 0 + else + Result := dxRibbonGalleryGroupItemIndent; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetHotTracked: Boolean; + + function GetGeneralItemPullHighlighting: TdxRibbonGalleryItemPullHighlighting; + begin + Result := Owner.Owner.GalleryOptions.ItemPullHighlighting; + end; + + function AgreeWithGeneralItemPullHighlighting: Boolean; + begin + Result := (Options.ItemPullHighlighting.Active = GetGeneralItemPullHighlighting.Active) and + (Options.ItemPullHighlighting.Direction = GetGeneralItemPullHighlighting.Direction); + end; + + function GetIsInHotTrackChain: Boolean; + begin + Result := ((GetOuterGroupItem(GroupItem, HotGroupItem, + Options.ItemPullHighlighting.Direction) <> GroupItem) or + (GroupItem = HotGroupItem)) and (GetItemPullHighlightingIdentifier(GroupItem) = + GetItemPullHighlightingIdentifier(HotGroupItem)) and + (GetGeneralItemPullHighlighting.Active and AgreeWithGeneralItemPullHighlighting or + not GetGeneralItemPullHighlighting.Active and Options.ItemPullHighlighting.Active ); + end; + +begin + if not IsItemPullHighlighting then + Result := IsThisGroupItem(HotGroupItem) + else + Result := (HotGroupItem <> nil) and GetIsInHotTrackChain; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetImagePlace: TSize; +var + AWidth, AHeight: Integer; +begin + AWidth := Bounds.Right - Bounds.Left; + AHeight := Bounds.Bottom - Bounds.Top; + case Options.GetItemImagePosition of + gipTop, gipBottom: + begin + Result.cx := AWidth - 2 * HorizontalImageIndent; + Result.cy := AHeight - ItemHeightWithoutImage; + end; + else + Result.cx := AWidth - ItemWidthWithoutImage; + Result.cy := AHeight - 2 * VerticalImageIndent; + end; + Result.cx := Max(0, Result.cx); + Result.cy := Max(0, Result.cy); +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetIsItemPullHighlighting: Boolean; +begin + Result := Owner.Group.Options.ItemPullHighlighting.Active and + not Owner.Owner.IsInRibbon; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetItemSize: TSize; +var + AWidth, AHeight: Integer; + AImageSize: TSize; +begin + AImageSize := GetImageSize; + case Options.GetItemImagePosition of + gipTop, gipBottom: + begin + AWidth := Max(Max(GetCaptionWidth, GetDescriptionWidth), + AImageSize.cx) + 2 * HorizontalImageIndent; + AHeight := AImageSize.cy + ItemHeightWithoutImage; + end; + else + AWidth := AImageSize.cx + ItemWidthWithoutImage; + AHeight := Max(AImageSize.cy, GetCaptionHeight + GetDescriptionHeight + + GetSpaceBetweenItemCaptionAndDescription) + + 2 * VerticalImageIndent; + end; + Result.cx := AWidth; + Result.cy := AHeight; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetOptions: TdxRibbonGalleryGroupOptions; +begin + Result := Owner.Group.Options; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetPainter: TdxBarSkinnedPainter; +begin + Result := TdxBarSkinnedPainter(Owner.Owner.Control.Painter); +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetRectConsiderBounds( + const ARect: TRect): TRect; +begin + if cxRectContain(Bounds, ARect) then + Result := ARect + else + Result := cxNullRect; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetSelected: Boolean; +begin + Result := GroupItem.Selected; +end; + +function TdxRibbonGalleryGroupItemViewInfo.GetVerticalImageIndent: Integer; +begin + if Options.RemoveVerticalItemPadding then + Result := 0 + else + Result := dxRibbonGalleryGroupItemIndent; +end; + +function TdxRibbonGalleryGroupItemViewInfo.IsCaptionVisible: Boolean; +begin + Result := (not IsInplaceGallery or not IsImageVisible) and + (Owner.Group.Options.ItemTextKind in [itkCaption, itkCaptionAndDescription]) and + (Caption <> '') and (not IsMergeItemsImages or not IsImageVisible); +end; + +function TdxRibbonGalleryGroupItemViewInfo.IsDescriptionVisible: Boolean; +begin + Result := not IsInplaceGallery and + (Owner.Group.Options.ItemTextKind in [itkCaptionAndDescription]) and + (Description <> '') and (Caption <> '') and not IsMergeItemsImages; +end; + +function TdxRibbonGalleryGroupItemViewInfo.IsImageVisible: Boolean; +begin + Result := GroupItem.IsImageAssigned; +end; + +function TdxRibbonGalleryGroupItemViewInfo.IsInplaceGallery: Boolean; +begin + Result := Owner.Owner.IsInRibbon; +end; + +function TdxRibbonGalleryGroupItemViewInfo.IsMergeItemsImages: Boolean; +begin + Result := (Options.RemoveHorizontalItemPadding or + Options.RemoveVerticalItemPadding) and IsImageVisible; +end; + +function TdxRibbonGalleryGroupItemViewInfo.IsThisGroupItem( + AGroupItem: TdxRibbonGalleryGroupItem): Boolean; +begin + Result := (AGroupItem = GroupItem) and (AGroupItem <> nil); +end; + +function TdxRibbonGalleryGroupItemViewInfo.ItemHeightWithoutImage: Integer; +begin + Result := GetCaptionHeight + GetDescriptionHeight + + GetSpaceBetweenItemCaptionAndDescription + GetSpaceBetweenItemImageAndText + + 2 * VerticalImageIndent; +end; + +function TdxRibbonGalleryGroupItemViewInfo.ItemWidthWithoutImage: Integer; +begin + Result := Max(GetCaptionWidth, GetDescriptionWidth) + + GetSpaceBetweenItemImageAndText + 2 * HorizontalImageIndent; +end; + +{ TdxRibbonGalleryGroupViewInfo } + +constructor TdxRibbonGalleryGroupViewInfo.Create( + AOwner: TdxRibbonGalleryControlViewInfo; + AGroup: TdxRibbonGalleryGroup; const AItemSize: TSize); +begin + inherited Create; + FGroup := AGroup; + FOwner := AOwner; + FHeader := TdxRibbonGalleryGroupHeaderViewInfo.Create(Self); + FItems := TcxObjectList.Create; + + if CanUseSize(AItemSize) then + FItemSize := AItemSize + else + if CanUseSize(Owner.GlobalItemSize) then + FItemSize := Owner.GlobalItemSize + else + if CanUseSize(Group.Options.ItemSize.Size) then + FItemSize := Group.Options.ItemSize.Size + else + FItemSize := GetItemSize; +end; + +destructor TdxRibbonGalleryGroupViewInfo.Destroy; +begin + FreeAndNil(FItems); + FreeandNil(FHeader); + inherited; +end; + +procedure TdxRibbonGalleryGroupViewInfo.Calculate(AGroupTop, + AGroupBottom: Integer; const AControlClientRect: TRect); +var + ARowIndex, ARowTop, ARowHeight, AColumnCount, ARowCount, + AItemIndex, AColumnIndex, AColumnLeft, AGroupWidth: Integer; +begin + FBounds := Rect(AControlClientRect.Left, AGroupTop, AControlClientRect.Right, + AGroupBottom); + Header.Calculate(GetHeaderBounds(Bounds)); + + ClearItems; + ARowIndex := 0; + ARowHeight := GetRowHeight; + AGroupWidth := GetGroupWidth; + AColumnCount := GetColumnCount(AGroupWidth); + ARowCount := GetRowCount(AGroupWidth); + while ARowIndex <= ARowCount - 1 do + begin + ARowTop := GetRowTop(ARowIndex, AGroupTop, AGroupWidth); + if AreLinesIntersectedStrictly(ARowTop, ARowTop + ARowHeight, + AControlClientRect.Top, AControlClientRect.Bottom) then + begin + AColumnIndex := 0; + for AItemIndex := GetFirstItemInGroupRow(ARowIndex, AColumnCount) to + GetLastItemInGroupRow(ARowIndex, AColumnCount) do + begin + AColumnLeft := GetColumnLeft(AColumnIndex, Bounds.Left); + CreateGroupItem(AItemIndex, Rect(AColumnLeft, ARowTop, + AColumnLeft + FItemSize.cx, ARowTop + FItemSize.cy)); + Inc(AColumnIndex); + end; + end; + Inc(ARowIndex); + end; +end; + +function TdxRibbonGalleryGroupViewInfo.GetHeight(AWidth: Integer): Integer; +var + ARowCount: Integer; +begin + ARowCount := GetRowCount(AWidth); + Result := Header.GetHeight(AWidth, True) + ARowCount * GetRowHeight - + IfThen(ARowCount > 0, GetSpaceBetweenItems(False)); +end; + +procedure TdxRibbonGalleryGroupViewInfo.Paint(ACanvas: TcxCanvas); +var + I: Integer; +begin + Header.Paint(ACanvas); + for I := 0 to ItemCount - 1 do + Items[I].Paint(ACanvas); +end; + +function TdxRibbonGalleryGroupViewInfo.CalculateItemSize( + const APredefinedItemSize: TSize): TSize; +var + AItem: TdxRibbonGalleryGroupItemViewInfo; + AItemSize: TSize; + I: Integer; + ASetItemSize: Boolean; +begin + ASetItemSize := CanUseSize(APredefinedItemSize); + Result := cxNullSize; + for I := 0 to Group.Items.Count - 1 do + begin + AItem := TdxRibbonGalleryGroupItemViewInfo.Create(Self, Group.Items[I]); + try + if ASetItemSize then + AItem.SetPredefinedItemSize(APredefinedItemSize); + AItemSize := AItem.ItemSize; + finally + AItem.Free; + end; + Result.cx := Max(Result.cx, AItemSize.cx); + Result.cy := Max(Result.cy, AItemSize.cy); + end; +end; + +procedure TdxRibbonGalleryGroupViewInfo.ClearItems; +begin + FItems.Clear; +end; + +procedure TdxRibbonGalleryGroupViewInfo.CreateGroupItem(AItemIndex: Integer; + const ABounds: TRect); +var + AGroupItem: TdxRibbonGalleryGroupItem; + AGroupItemViewInfo: TdxRibbonGalleryGroupItemViewInfo; +begin + AGroupItem := FGroup.Items.Items[AItemIndex]; + AGroupItemViewInfo := TdxRibbonGalleryGroupItemViewInfo.Create(Self, + AGroupItem); + AGroupItemViewInfo.Calculate(ABounds); + FItems.Add(AGroupItemViewInfo); +end; + +function TdxRibbonGalleryGroupViewInfo.GetColumnLeft( + AColumnIndex: Integer; AGroupLeft: Integer): Integer; +begin + Result := AGroupLeft + Owner.GetLeftLayoutIndent + + (FItemSize.cx + GetSpaceBetweenItems(True)) * AColumnIndex; +end; + +function TdxRibbonGalleryGroupViewInfo.GetColumnCount(AWidth: Integer): Integer; +var + ADenominator: Integer; +begin + ADenominator := FItemSize.cx + GetSpaceBetweenItems(True); + if ADenominator <> 0 then + Result := (AWidth - (Owner.GetLeftLayoutIndent + Owner.GetRightLayoutIndent) + + GetSpaceBetweenItems(True)) div ADenominator + else + Result := 0; +end; + +function TdxRibbonGalleryGroupViewInfo.GetColumnCountInRow( + ARow: Integer; AGroupWidth: Integer): Integer; +var + AGroupColumnCount: Integer; +begin + AGroupColumnCount := GetColumnCount(AGroupWidth); + if AGroupColumnCount <> 0 then + begin + if (ARow + 1) * AGroupColumnCount > Group.Items.Count then + Result := Group.Items.Count mod AGroupColumnCount + else + Result := AGroupColumnCount; + end + else + Result := 0; +end; + +function TdxRibbonGalleryGroupViewInfo.GetColumnWidth: Integer; +begin + Result := FItemSize.cx + GetSpaceBetweenItems(True); +end; + +function TdxRibbonGalleryGroupViewInfo.GetGroupWidth: Integer; +begin + Result := FBounds.Right - FBounds.Left; +end; + +function TdxRibbonGalleryGroupViewInfo.GetHeaderBounds(AGroupBounds: TRect): TRect; +begin + Result := AGroupBounds; + Result.Bottom := Result.Top + Header.GetHeight( + AGroupBounds.Right - AGroupBounds.Left, False); +end; + +function TdxRibbonGalleryGroupViewInfo.GetItemColumn( + AIndex: Integer; AGroupWidth: Integer): Integer; +var + AColumnCount: Integer; +begin + AColumnCount := GetColumnCount(AGroupWidth); + if AColumnCount <> 0 then + Result := AIndex mod AColumnCount + else + Result := 0; +end; + +function TdxRibbonGalleryGroupViewInfo.GetItemIndex(ARow, + AColumn: Integer; AGroupWidth: Integer): Integer; +begin + Result := ARow * GetColumnCount(AGroupWidth) + AColumn; +end; + +function TdxRibbonGalleryGroupViewInfo.GetItemRow( + AGroupItemIndex: Integer; AGroupWidth: Integer): Integer; +var + AColumnCount: Integer; +begin + AColumnCount := GetColumnCount(AGroupWidth); + if AColumnCount <> 0 then + Result := AGroupItemIndex div AColumnCount + else + Result := 0; +end; + +function TdxRibbonGalleryGroupViewInfo.GetLastItemInGroupRow(ARowIndex, + AColumnCount: Integer): Integer; +var + AGroupItemCount: Integer; +begin + Result := GetFirstItemInGroupRow(ARowIndex, AColumnCount) + AColumnCount - 1; + AGroupItemCount := FGroup.Items.Count; + if Result > AGroupItemCount - 1 then + Result := AGroupItemCount - 1; +end; + +function TdxRibbonGalleryGroupViewInfo.GetRowCount( + AGroupWidth: Integer): Integer; + + function CalcRowCount(AColumnCount: Integer): Integer; + var + AGroupItemCount: Integer; + begin + AGroupItemCount := FGroup.Items.Count; + if AColumnCount <> 0 then + Result := Ceil(AGroupItemCount / AColumnCount) + else + Result := 0; + end; + +begin + Result := CalcRowCount(GetColumnCount(AGroupWidth)); +end; + +function TdxRibbonGalleryGroupViewInfo.GetRowHeight: Integer; +begin + Result := FItemSize.cy + GetSpaceBetweenItems(False); +end; + +function TdxRibbonGalleryGroupViewInfo.GetRowTop(ARowIndex: Integer; + AGroupTop: Integer; AGroupWidth: Integer): Integer; +begin + Result := AGroupTop + Header.GetHeight(AGroupWidth, True) + + GetRowHeight * ARowIndex; +end; + +function TdxRibbonGalleryGroupViewInfo.GetSpaceBetweenItems( + IsAflat: Boolean): Integer; +begin + if (Options.RemoveHorizontalItemPadding and IsAflat) or + (Options.RemoveVerticalItemPadding and not IsAflat) then + Result := 0 + else + if Owner.IsInRibbon then + Result := Owner.GalleryItem.GalleryOptions.SpaceBetweenItems + else + Result := Options.SpaceBetweenItems; +end; + +procedure TdxRibbonGalleryGroupViewInfo.RepaintChainOfItems( + AnItemIndex: Integer; IsHotTrack: Boolean; ACanvas: TcxCanvas; + APart: TdxRibbonGalleryGroupRepaintPart = ggrpAll; AnItemIndex2: Integer = 0); + + function GetGroupItemViewInfoIndex(AGroupItemIndex: Integer): Integer; + var + I: Integer; + AFound, IsIndexGreater: Boolean; + begin + Result := -1; + AFound := False; + IsIndexGreater := False; + I := 0; + while (I < ItemCount) and not AFound do + begin + if Items[I].GroupItem.Index = AGroupItemIndex then + begin + Result := I; + AFound := True; + end; + IsIndexGreater := Items[I].GroupItem.Index < AGroupItemIndex; + Inc(I); + end; + if Result = -1 then + if IsIndexGreater then + Result := ItemCount - 1 + else + Result := 0; + end; + +var + I, AFinish: Integer; +begin + case APart of + ggrpBefore: + begin + I := 0; + AFinish := AnItemIndex; + end; + ggrpAfter: + begin + I := AnItemIndex; + AFinish := ItemCount - 1; + end; + ggrpBetween: + begin + I := AnItemIndex; + AFinish := AnItemIndex2; + end; + else + I := 0; + AFinish := ItemCount - 1; + end; + if APart in [ggrpAfter, ggrpBetween] then + I := GetGroupItemViewInfoIndex(I); + if APart in [ggrpBefore, ggrpBetween] then + AFinish := GetGroupItemViewInfoIndex(AFinish); + if AFinish < FItems.Count then + while I <= AFinish do + begin + Items[I].Paint(ACanvas); + Inc(I); + end; +end; + +procedure TdxRibbonGalleryGroupViewInfo.SetBounds(const ABounds: TRect); +begin + FBounds := ABounds; +end; + +function TdxRibbonGalleryGroupViewInfo.GetFirstItemInGroupRow(ARowIndex, + AColumnCount: Integer): Integer; +begin + Result := ARowIndex * AColumnCount; +end; + +function TdxRibbonGalleryGroupViewInfo.GetFont: TFont; +begin + Result := Owner.Control.Parent.Font; +end; + +function TdxRibbonGalleryGroupViewInfo.GetItem( + Index: Integer): TdxRibbonGalleryGroupItemViewInfo; +begin + Result := TdxRibbonGalleryGroupItemViewInfo(FItems[Index]); +end; + +function TdxRibbonGalleryGroupViewInfo.GetItemCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxRibbonGalleryGroupViewInfo.GetItemSize: TSize; +var + AStoredItemSize: TSize; +begin + AStoredItemSize := Owner.GetGroupItemStoredSize(FGroup.Index); + if CanUseSize(AStoredItemSize) then + Result := AStoredItemSize + else + begin + Result := CalculateItemSize(cxNullSize); + Owner.SetGroupItemStoredSize(Result, FGroup.Index); + end; +end; + +function TdxRibbonGalleryGroupViewInfo.GetOptions: TdxRibbonGalleryGroupOptions; +begin + Result := Group.Options; +end; + +function TdxRibbonGalleryGroupViewInfo.GetPainter: TdxBarSkinnedPainter; +begin + Result := TdxBarSkinnedPainter(Owner.Control.Painter); +end; + +{ TdxRibbonGalleryControlViewInfo } + +constructor TdxRibbonGalleryControlViewInfo.Create( + AControl: TdxBarItemControl); +begin + inherited Create(AControl); + FGroups := TcxObjectList.Create; + FDownedGroupItem := nil; + FHotGroupItem := nil; + GalleryChanged; +end; + +destructor TdxRibbonGalleryControlViewInfo.Destroy; +begin + FreeAndNil(FGroups); + inherited; +end; + +procedure TdxRibbonGalleryControlViewInfo.Calculate(ALayoutOffset: Integer; + AScrollCode: TScrollCode); +begin + CalculateGlobalItemSize; +end; + +procedure TdxRibbonGalleryControlViewInfo.Paint; + + function GetInRibbonGalleryState: Integer; + begin + Result := TdxBarSkinnedPainterAccess(Painter).GetPartState( + Control.DrawParams, icpControl); + end; + +var + I: Integer; +begin + DrawBackground(GetControlBounds); + Control.Canvas.SaveClipRegion; + try + Control.Canvas.SetClipRegion(TcxRegion.Create(GalleryBounds), roIntersect); + for I := 0 to GroupCount - 1 do + Groups[I].Paint(Control.Canvas); + finally + Control.Canvas.RestoreClipRegion; + end; +end; + +procedure TdxRibbonGalleryControlViewInfo.DisplayGroupItem( + AGroupItem: TdxRibbonGalleryGroupItem); +begin +// do nothing +end; + +procedure TdxRibbonGalleryControlViewInfo.DrawSelectedGroupItem( + ASelectedGroupItem, AOldSelectedGroupItem: TdxRibbonGalleryGroupItem); +begin + Control.Canvas.SaveState; + try + DrawGroupItem(AOldSelectedGroupItem); + DrawGroupItem(ASelectedGroupItem); + finally + Control.Canvas.RestoreState; + end; +end; + +procedure TdxRibbonGalleryControlViewInfo.GalleryChanged; +var + AGroupCount: Integer; + I: Integer; +begin + AGroupCount := Control.GetGroups.Count; + SetLength(FGroupItemStoredSizes, AGroupCount); + for I := 0 to AGroupCount - 1 do + FGroupItemStoredSizes[I] := cxNullSize; +end; + +function TdxRibbonGalleryControlViewInfo.GetAbsoluteGroupTop( + AGroupIndex: Integer; AWidth: Integer): Integer; +var + AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; + ADestroyAfterUse: Boolean; + I: Integer; +begin + Result := 0; + for I := 0 to AGroupIndex - 1 do + if GalleryItem.IsGroupVisible(I) then + begin + AGroupViewInfo := GetGroupViewInfo(Control.GetGroups, Self, I, + ADestroyAfterUse); + try + Result := Result + AGroupViewInfo.GetHeight(AWidth) + + IfThen(AWidth > 0, GalleryOptions.SpaceBetweenGroups); + finally + if ADestroyAfterUse then + AGroupViewInfo.Free; + end; + end; +end; + +function TdxRibbonGalleryControlViewInfo.GetControlBounds: TRect; +begin + Result := Bounds; +end; + +function TdxRibbonGalleryControlViewInfo.GetGalleryBounds: TRect; +var + AMargins: TRect; +begin + Result := GetControlBounds; + AMargins := GetGalleryMargins; + Result := cxRectInflate(Result, -AMargins.Left, -AMargins.Top, + -(AMargins.Right + GetScrollBarWidth), -AMargins.Bottom); +end; + +function TdxRibbonGalleryControlViewInfo.GetGalleryHeight( + AWidth: Integer): Integer; +begin + Result := 1; +end; + +function TdxRibbonGalleryControlViewInfo.GetGroupItemCount( + ALastGroupIndex: Integer): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to ALastGroupIndex do + if GalleryItem.IsGroupVisible(I) then + Result := Result + Control.GetGroups[I].Items.Count; +end; + +function TdxRibbonGalleryControlViewInfo.GetHeight(AWidth: Integer): Integer; +begin + Result := 0; +end; + +function TdxRibbonGalleryControlViewInfo.GetMaxGroupItemSize: TSize; +var + I: Integer; + AGroupItemSize: TSize; +begin + if CanUseSize(GlobalItemSize) then + Result := GlobalItemSize + else + begin + Result := cxNullSize; + for I := 0 to Control.GetGroups.Count - 1 do + begin + AGroupItemSize := GetGroupItemSize(I); + Result.cx := Max(Result.cx, AGroupItemSize.cx); + Result.cy := Max(Result.cy, AGroupItemSize.cy); + end; + end; +end; + +function TdxRibbonGalleryControlViewInfo.GetGroupItem( + X, Y: Integer): TdxRibbonGalleryGroupItem; +var + I, J: Integer; + AGroupItemFound: Boolean; +begin + Result := nil; + AGroupItemFound := False; + I := 0; + while (I < GroupCount) and not AGroupItemFound do + begin + if cxRectPtIn(Groups[I].Bounds, X, Y) then + begin + J := 0; + while (J < Groups[I].ItemCount) and not AGroupItemFound do + begin + if cxRectPtIn(Groups[I].Items[J].Bounds, X, Y) then + begin + Result := Groups[I].Items[J].GroupItem; + AGroupItemFound := True; + end; + Inc(J); + end; + end; + Inc(I); + end; +end; + +function TdxRibbonGalleryControlViewInfo.GetGroupItemStoredSize( + AGroupIndex: Integer): TSize; +begin + if AGroupIndex < Length(FGroupItemStoredSizes) then + Result := FGroupItemStoredSizes[AGroupIndex] + else + Result := cxNullSize; +end; + +function TdxRibbonGalleryControlViewInfo.GetGroupItemViewInfo( + AGroupItem: TdxRibbonGalleryGroupItem): TdxRibbonGalleryGroupItemViewInfo; + + function GetGroupViewInfo(AGroup: TdxRibbonGalleryGroup): TdxRibbonGalleryGroupViewInfo; + var + I: Integer; + begin + Result := nil; + for I := 0 to GroupCount - 1 do + if Groups[I].Group = AGroup then + begin + Result := Groups[I]; + Break; + end; + end; + +var + AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; + I: Integer; +begin + Result := nil; + if AGroupItem = nil then Exit; + AGroupViewInfo := GetGroupViewInfo(GalleryItem.GalleryGroups[AGroupItem.Group.Index]); + if AGroupViewInfo <> nil then + for I := 0 to AGroupViewInfo.ItemCount - 1 do + if AGroupViewInfo.Items[I].GroupItem = AGroupItem then + begin + Result := AGroupViewInfo.Items[I]; + Break; + end; +end; + +function TdxRibbonGalleryControlViewInfo.GetLeftLayoutIndent: Integer; +begin + Result := Max(1, GalleryOptions.SpaceBetweenItemsAndBorder) - 1; +end; + +function TdxRibbonGalleryControlViewInfo.GetNextButtonEnabled: Boolean; +var + ALastGroupIndex: Integer; + ALastGroupViewInfo: TdxRibbonGalleryGroupViewInfo; +begin + if GroupCount <> 0 then + begin + ALastGroupIndex := GetVisibleNotEmptyGroupIndex( + Control.GetGroups.Count - 1, False); + ALastGroupViewInfo := Groups[GroupCount - 1]; + Result := (ALastGroupIndex <> ALastGroupViewInfo.Group.Index) or + (Control.GetGroups[ALastGroupIndex].Items.Count - 1 <> + ALastGroupViewInfo.Items[ALastGroupViewInfo.ItemCount - 1].GroupItem.Index) or + not cxRectContain(GalleryBounds, + ALastGroupViewInfo.Items[ALastGroupViewInfo.ItemCount - 1].Bounds); + end + else + Result := False; +end; + +function TdxRibbonGalleryControlViewInfo.GetPreviousButtonEnabled: Boolean; +var + AFirstGroupIndex: Integer; +begin + if GroupCount <> 0 then + begin + AFirstGroupIndex := GetVisibleNotEmptyGroupIndex(0, True); + Result := (Groups[0].Group.Index <> AFirstGroupIndex) or + (Groups[0].Items[0].GroupItem.Index <> 0) or + not cxRectContain(GalleryBounds, Groups[0].Items[0].Bounds); + end + else + Result := False; +end; + +function TdxRibbonGalleryControlViewInfo.GetRightLayoutIndent: Integer; //TODO rename +begin + Result := GalleryOptions.SpaceBetweenItemsAndBorder; +end; + +function TdxRibbonGalleryControlViewInfo.GetVisibleGroupIndex( + AStartGroupIndex: Integer; AIncreaseIndex: Boolean): Integer; +begin + Result := AStartGroupIndex; + if AIncreaseIndex then + begin + while (Result < Control.GetGroups.Count) and + (not GalleryItem.IsGroupVisible(Result)) do + Inc(Result); + if Result >= Control.GetGroups.Count then + Result := -1; + end + else + begin + while (Result >= 0) and (not GalleryItem.IsGroupVisible(Result)) do + Dec(Result); + end; +end; + +function TdxRibbonGalleryControlViewInfo.GetVisibleNotEmptyGroupIndex( + AStartGroupIndex: Integer; AIncreaseIndex: Boolean): Integer; +var + AExit: Boolean; +begin + AExit := False; + repeat + Result := GetVisibleGroupIndex(AStartGroupIndex, AIncreaseIndex); + if Result <> -1 then + begin + if Control.GetGroups[Result].Items.Count > 0 then + AExit := True + else + begin + AStartGroupIndex := Result; + if AIncreaseIndex then + Inc(AStartGroupIndex) + else + Dec(AStartGroupIndex); + if (AStartGroupIndex < 0) or + (AStartGroupIndex > Control.GetGroups.Count - 1) then + begin + Result := -1; + AExit := True; + end; + end; + end + else + AExit := True; + until AExit; +end; + +function TdxRibbonGalleryControlViewInfo.IsGroupHeaderVisible: Boolean; +begin + Result := not IsInRibbon; +end; + +function TdxRibbonGalleryControlViewInfo.IsGroupItemAtThisPlace( + X, Y: Integer): Boolean; +begin + Result := GetGroupItem(X, Y) <> nil; +end; + +function TdxRibbonGalleryControlViewInfo.IsInRibbon: Boolean; +begin + Result := False; +end; + +procedure TdxRibbonGalleryControlViewInfo.RemoveGroupItem( + AItem: TdxRibbonGalleryGroupItem); +begin + if HotGroupItem = AItem then + FHotGroupItem := nil; + if DownedGroupItem = AItem then + FDownedGroupItem := nil; +end; + +procedure TdxRibbonGalleryControlViewInfo.SetDownedGroupItem( + const Value: TdxRibbonGalleryGroupItem); +var + AGroupItem: TdxRibbonGalleryGroupItem; +begin + if FDownedGroupItem <> Value then + begin + AGroupItem := FDownedGroupItem; + FDownedGroupItem := Value; + if Value = nil then + DrawGroupItem(AGroupItem) + else + begin + DrawGroupItem(Value); + if HotGroupItem <> Value then + Control.Controller.SetHotGroupItem(Value); + end; + end; +end; + +procedure TdxRibbonGalleryControlViewInfo.SetGroupItemStoredSize(const Value: TSize; + AGroupIndex: Integer); +begin + if AGroupIndex < Length(FGroupItemStoredSizes) then + FGroupItemStoredSizes[AGroupIndex] := Value; +end; + +procedure TdxRibbonGalleryControlViewInfo.SetHotGroupItem( + Value: TdxRibbonGalleryGroupItem); + + function HasGroupItemPullHighlighting(AGroupItem: TdxRibbonGalleryGroupItem): Boolean; + begin + Result := (AGroupItem <> nil) and + AGroupItem.Group.Options.ItemPullHighlighting.Active; + end; + + procedure DoSetHotGroupItem(Value: TdxRibbonGalleryGroupItem); + var + AOldHotGroupItem: TdxRibbonGalleryGroupItem; + begin + Control.Canvas.SaveState; + try + AOldHotGroupItem := FHotGroupItem; + FHotGroupItem := Value; + DisplayGroupItem(FHotGroupItem); + + if Control.ViewInfo.IsInRibbon then + begin + DrawGroupItem(AOldHotGroupItem); + DrawGroupItem(FHotGroupItem); + end + else + if HasGroupItemPullHighlighting(AOldHotGroupItem) and + HasGroupItemPullHighlighting(FHotGroupItem) then + begin + if GetItemPullHighlightingIdentifier(AOldHotGroupItem) = + GetItemPullHighlightingIdentifier(FHotGroupItem) then + RepaintChainOfGroups(FHotGroupItem, AOldHotGroupItem) + else + begin + RepaintChainOfGroups(FHotGroupItem, nil); + RepaintChainOfGroups(nil, AOldHotGroupItem); + end; + end + else + begin + if HasGroupItemPullHighlighting(FHotGroupItem) then + RepaintChainOfGroups(FHotGroupItem, nil) + else + DrawGroupItem(FHotGroupItem); + if HasGroupItemPullHighlighting(AOldHotGroupItem) then + RepaintChainOfGroups(nil, AOldHotGroupItem) + else + DrawGroupItem(AOldHotGroupItem); + end; + + GalleryItem.DoHotTrackedItemChanged(AOldHotGroupItem, FHotGroupItem); + finally + Control.Canvas.RestoreState; + end; + end; + +var + ADestroyAfterUse: Boolean; + AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; +begin + if Value <> nil then + begin + AGroupViewInfo := GetGroupViewInfo(Control.GetGroups, Self, + Value.Group.Index, ADestroyAfterUse); + try + if AGroupViewInfo <> nil then + DoSetHotGroupItem(Value); + finally + if ADestroyAfterUse then + AGroupViewInfo.Free; + end; + end + else + DoSetHotGroupItem(Value); +end; + +procedure TdxRibbonGalleryControlViewInfo.ShowGroupItem( + AGroupItem: TdxRibbonGalleryGroupItem); +begin + //do nothing +end; + +function TdxRibbonGalleryControlViewInfo.GetGroupCount: Integer; +begin + Result := FGroups.Count; +end; + +function TdxRibbonGalleryControlViewInfo.GetGroups( + Index: Integer): TdxRibbonGalleryGroupViewInfo; +begin + Result := TdxRibbonGalleryGroupViewInfo(FGroups[Index]); +end; + +function TdxRibbonGalleryControlViewInfo.GetGroupItemSize( + AGroupIndex: Integer): TSize; +var + ADestroyAfterUse: Boolean; + AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; +begin + if GalleryItem.IsGroupVisible(AGroupIndex) then + begin + AGroupViewInfo := GetGroupViewInfo(Control.GetGroups, Self, AGroupIndex, + ADestroyAfterUse); + try + Result := AGroupViewInfo.ItemSize; + finally + if ADestroyAfterUse then + AGroupViewInfo.Free; + end; + end + else + Result := cxNullSize; +end; + +procedure TdxRibbonGalleryControlViewInfo.CalculateGlobalItemSize; +begin + if (GalleryOptions.EqualItemSizeInAllGroups) or + (Control.Parent.Kind in [bkBarControl]) then + FGlobalItemSize := GetMaxGroupItemSize; +end; + +function TdxRibbonGalleryControlViewInfo.GetControl: TdxRibbonGalleryControl; +begin + Result := TdxRibbonGalleryControl(FControl); +end; + +function TdxRibbonGalleryControlViewInfo.GetGalleryItem: TdxRibbonGalleryItem; +begin + if Control <> nil then + Result := TdxRibbonGalleryItem(Control.Item) + else + Result := nil; +end; + +function TdxRibbonGalleryControlViewInfo.GetGalleryOptions: TdxRibbonGalleryOptions; +begin + Result := GalleryItem.GalleryOptions; +end; + +function TdxRibbonGalleryControlViewInfo.GetGallerySize: TSize; +var + ARect: TRect; +begin + ARect := GetGalleryBounds; + Result.cx := ARect.Right - ARect.Left; + Result.cy := ARect.Bottom - ARect.Top; +end; + +function TdxRibbonGalleryControlViewInfo.GetPainter: TdxBarSkinnedPainter; +begin + Result := TdxBarSkinnedPainter(Control.Painter); +end; + +function TdxRibbonGalleryControlViewInfo.GetScrollBarBounds: TRect; +var + AGalleryBounds: TRect; +begin + Result := Bounds; + Result.Left := Result.Right - GetScrollBarWidth; + AGalleryBounds := GalleryBounds; + Result.Top := AGalleryBounds.Top; + Result.Bottom := AGalleryBounds.Bottom; +end; + +function TdxRibbonGalleryControlViewInfo.GetScrollBarWidth: Integer; +begin + if Control.IsNeedScrollBar then + Result := InternalGetScrollBarWidth + else + Result := 0; +end; + +procedure TdxRibbonGalleryControlViewInfo.DrawGroupItem( + const AGroupItem: TdxRibbonGalleryGroupItem); +var + AItemViewInfo: TdxRibbonGalleryGroupItemViewInfo; +begin + if AGroupItem <> nil then + begin + Control.Canvas.SaveClipRegion; + try + Control.Canvas.SetClipRegion(TcxRegion.Create(GalleryBounds), roSet); + AItemViewInfo := GetGroupItemViewInfo(AGroupItem); + if AItemViewInfo <> nil then + AItemViewInfo.Paint(Control.Canvas); + finally + Control.Canvas.RestoreClipRegion; + end; + end; +end; + +procedure TdxRibbonGalleryControlViewInfo.RepaintChainOfGroups( + ANewItem, AOldItem: TdxRibbonGalleryGroupItem); + + function IsGroupPullDirectionAgreeWithGeneral(AnItem: TdxRibbonGalleryGroupItem): Boolean; + begin + Result := (AnItem = nil) or (AnItem.Group.Options.ItemPullHighlighting.Direction = + GalleryOptions.ItemPullHighlighting.Direction); + end; + + function UsePullDirectionOfGroup(out ADirection: TdxRibbonGalleryItemPullHighlightingDirection): Boolean; + begin + if not IsGroupPullDirectionAgreeWithGeneral(ANewItem) or + not IsGroupPullDirectionAgreeWithGeneral(AOldItem) then + begin + Result := True; + if ANewItem <> nil then + ADirection := ANewItem.Group.Options.ItemPullHighlighting.Direction + else + ADirection := AOldItem.Group.Options.ItemPullHighlighting.Direction; + end + else + Result := False; + end; + + function GetDirection: TdxRibbonGalleryItemPullHighlightingDirection; + begin + if not UsePullDirectionOfGroup(Result) then + Result := GalleryOptions.ItemPullHighlighting.Direction; + end; + + function IsStartToFinishDirection: Boolean; + begin + Result := GetDirection = gphdStartToFinish; + end; + + procedure DoRepaintChain(AStartGroupIndex, AStartGroupItemIndex, + AEndGroupIndex, AEndGroupItemIndex: Integer; IsHotTrack: Boolean); + + function GetGroupRepaintPart(AStartGroupIndex, AStartGroupItemIndex, + AEndGroupIndex, AEndGroupItemIndex, ACurrentGroupIndex: Integer; + out AnItemIndex, AnItemIndex2: Integer): TdxRibbonGalleryGroupRepaintPart; + begin + if ACurrentGroupIndex = GetVisibleGroupIndex(AStartGroupIndex, True) then + begin + AnItemIndex := AStartGroupItemIndex; + if ACurrentGroupIndex = AEndGroupIndex then + begin + Result := ggrpBetween; + AnItemIndex2 := AEndGroupItemIndex; + end + else + if IsStartToFinishDirection and + (ACurrentGroupIndex = GetVisibleGroupIndex(0, True)) then + Result := ggrpAll + else + Result := ggrpAfter; + end + else + if ACurrentGroupIndex = AEndGroupIndex then + begin + if not IsStartToFinishDirection and + (ACurrentGroupIndex = GetVisibleGroupIndex(GalleryItem.GalleryGroups.Count - 1, False)) then + Result := ggrpAll + else + begin + Result := ggrpBefore; + AnItemIndex := AEndGroupItemIndex; + end; + end + else + begin + Result := ggrpAll; + AnItemIndex := 0; + end; + end; + + var + AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; + AnItemIndex, AnItemIndex2, I: Integer; + APart: TdxRibbonGalleryGroupRepaintPart; + DestroyAfterUse: Boolean; + begin + Control.Canvas.SaveClipRegion; + try + Control.Canvas.SetClipRegion(TcxRegion.Create(GalleryBounds), roSet); + I := AStartGroupIndex; + while I <= AEndGroupIndex do + begin + AGroupViewInfo := GetGroupViewInfo(GalleryItem.GalleryGroups, Self, I, + DestroyAfterUse); + if AGroupViewInfo <> nil then + begin + if not DestroyAfterUse then + begin + APart := GetGroupRepaintPart(AStartGroupIndex, AStartGroupItemIndex, + AEndGroupIndex, AEndGroupItemIndex, I, AnItemIndex, AnItemIndex2); + AGroupViewInfo.RepaintChainOfItems(AnItemIndex, IsHotTrack, Control.Canvas, + APart, AnItemIndex2); + end + else + AGroupViewInfo.Free; + end; + Inc(I); + end; + finally + Control.Canvas.RestoreClipRegion; + end; + end; + + procedure ReturnRange(ANewItem, AOldItem: TdxRibbonGalleryGroupItem; + out AStartGroupItem, AEndGroupItem: TdxRibbonGalleryGroupItem; + out IsHotTrack: Boolean); + var + AnOuterGroupItem: TdxRibbonGalleryGroupItem; + begin + AnOuterGroupItem := GetOuterGroupItem(ANewItem, AOldItem, GetDirection); + IsHotTrack := AnOuterGroupItem = ANewItem; + if IsHotTrack xor not IsStartToFinishDirection then + begin + AStartGroupItem := AOldItem; + AEndGroupItem := ANewItem; + end + else + begin + AStartGroupItem := ANewItem; + AEndGroupItem := AOldItem; + end; + end; + + procedure ReturnRangeStart(AStartGroupItem: TdxRibbonGalleryGroupItem; + IsHotTrack: Boolean; out AStartGroupIndex, AStartGroupItemIndex: Integer); + begin + if AStartGroupItem <> nil then + begin + AStartGroupIndex := AStartGroupItem.Group.Index; + AStartGroupItemIndex := AStartGroupItem.Index; + if not IsHotTrack and IsStartToFinishDirection then + begin + Inc(AStartGroupItemIndex); + if AStartGroupItemIndex > AStartGroupItem.Group.Items.Count - 1 then + begin + AStartGroupItemIndex := 0; + Inc(AStartGroupIndex); + AStartGroupIndex := GetVisibleGroupIndex(AStartGroupIndex, True); + end; + end; + end + else + begin + AStartGroupIndex := 0; + AStartGroupItemIndex := 0; + end; + end; + + procedure ReturnRangeEnd(AEndGroupItem: TdxRibbonGalleryGroupItem; + IsHotTrack: Boolean; out AEndGroupIndex, AEndGroupItemIndex: Integer); + begin + if AEndGroupItem <> nil then + begin + AEndGroupIndex := AEndGroupItem.Group.Index; + AEndGroupItemIndex := AEndGroupItem.Index; + if not IsHotTrack and not IsStartToFinishDirection then + begin + Dec(AEndGroupItemIndex); + if AEndGroupItemIndex < 0 then + begin + Dec(AEndGroupIndex); + AEndGroupIndex := GetVisibleGroupIndex(AEndGroupIndex, False); + AEndGroupItemIndex := GalleryItem.GalleryGroups[AEndGroupIndex].Items.Count - 1; + end; + end; + end + else + begin + if IsStartToFinishDirection then + begin + AEndGroupIndex := 0; + AEndGroupItemIndex := 0; + end + else + begin + AEndGroupIndex := GetVisibleGroupIndex( + GalleryItem.GalleryGroups[GalleryItem.GalleryGroups.Count - 1].Index, False); + AEndGroupItemIndex := GalleryItem.GalleryGroups[AEndGroupIndex].Items.Count - 1; + end; + end; + end; + +var + IsHotTrack: Boolean; + AStartGroupItem, AEndGroupItem: TdxRibbonGalleryGroupItem; + AStartGroupIndex, AEndGroupIndex, AStartGroupItemIndex, AEndGroupItemIndex: Integer; +begin + if (ANewItem <> nil) or (AOldItem <> nil) then + begin + ReturnRange(ANewItem, AOldItem, AStartGroupItem, + AEndGroupItem, IsHotTrack); + ReturnRangeStart(AStartGroupItem, IsHotTrack, AStartGroupIndex, + AStartGroupItemIndex); + ReturnRangeEnd(AEndGroupItem, IsHotTrack, AEndGroupIndex, + AEndGroupItemIndex); + DoRepaintChain(AStartGroupIndex, AStartGroupItemIndex, + AEndGroupIndex, AEndGroupItemIndex, IsHotTrack); + end; +end; + +{ TdxInRibbonGalleryControlViewInfo } + +procedure TdxInRibbonGalleryControlViewInfo.Calculate( + ALayoutOffset: Integer; AScrollCode: TScrollCode); +var + ARowDelta: Integer; +begin + inherited Calculate(ALayoutOffset, AScrollCode); + if Control.GetGroups.Count = 0 then + Exit; + case AScrollCode of + scLineUp: ARowDelta := -1; + scLineDown: ARowDelta := 1; + else + ARowDelta := 0; + end; + if FIsScrolling then + SetScrollingRowCounter(ARowDelta) + else + DoScrolling(ARowDelta); +end; + +function TdxInRibbonGalleryControlViewInfo.IsCollapsed: Boolean; +begin + Result := GetCollapsed; +end; + +procedure TdxInRibbonGalleryControlViewInfo.ResetCachedValues; +var + I: Integer; +begin + inherited ResetCachedValues; + SetLength(FWidthForColumnCountInfos, GetMaxColumnCount - GetMinColumnCount + 1); + for I := 0 to High(FWidthForColumnCountInfos) do + FWidthForColumnCountInfos[I].Calculated := False; + FControlHeight := 0; +end; + +procedure TdxInRibbonGalleryControlViewInfo.BoundsCalculated; +begin + inherited BoundsCalculated; + if not Control.Collapsed then + with GetControlMargins do + Self.SetBounds(cxRectInflate(Self.Bounds, -Left, -Top, -Right, -Bottom)); +end; + +procedure TdxInRibbonGalleryControlViewInfo.CalculateLayout(ALayoutOffset, + AColumnCount: Integer; AGroupItemsList: TObjectList); +var + ARowTop, AColumnIndex: Integer; + I: Integer; + ACurrentGroupIndex, AItemGroupIndex: Integer; + AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; + AGroupItemBounds: TRect; + ABounds: TRect; +begin + FGroups.Clear; + AGroupViewInfo := nil; + ACurrentGroupIndex := -1; + AColumnIndex := 0; + ARowTop := ALayoutOffset; + ABounds := GalleryBounds; + for I := 0 to AGroupItemsList.Count - 1 do + begin + AItemGroupIndex := TdxRibbonGalleryGroup(TdxRibbonGalleryGroupItems(TCollectionItemAccess( + AGroupItemsList.Items[I]).GetOwner).GetOwner).Index; + if ACurrentGroupIndex <> AItemGroupIndex then + begin + ACurrentGroupIndex := AItemGroupIndex; + AGroupViewInfo := TdxRibbonGalleryGroupViewInfo.Create(Self, + Control.GetGroups[AItemGroupIndex], cxNullSize); + AGroupViewInfo.SetBounds(ABounds); + FGroups.Add(AGroupViewInfo); + AGroupViewInfo.ClearItems; + end; + AGroupItemBounds.Top := ARowTop + ABounds.Top; + AGroupItemBounds.Bottom := AGroupItemBounds.Top + AGroupViewInfo.ItemSize.cy; + AGroupItemBounds.Left := AGroupViewInfo.GetColumnLeft(AColumnIndex, Bounds.Left); + AGroupItemBounds.Right := AGroupItemBounds.Left + AGroupViewInfo.ItemSize.cx; + AGroupViewInfo.CreateGroupItem( + TdxRibbonGalleryGroupItem(AGroupItemsList.Items[I]).Index, AGroupItemBounds); + Inc(AColumnIndex); + if AColumnIndex = AColumnCount then + begin + AColumnIndex := 0; + ARowTop := ARowTop + AGroupViewInfo.GetRowHeight; + end; + end; +end; + +function TdxInRibbonGalleryControlViewInfo.CorrectGroupItemSize( + const AGroupItemSize: TSize): TSize; +var + I: Integer; + ASize: TSize; + AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; + ADestroyAfterUse: Boolean; +begin + Result := cxNullSize; + for I := 0 to Control.GetGroups.Count - 1 do + if GalleryItem.IsGroupVisible(I) then + begin + AGroupViewInfo := GetGroupViewInfo(Control.GetGroups, Self, I, + ADestroyAfterUse); + try + ASize := AGroupViewInfo.CalculateItemSize(AGroupItemSize); + finally + if ADestroyAfterUse then + AGroupViewInfo.Free; + end; + if Result.cx < ASize.cx then + Result.cx := ASize.cx; + if Result.cy < ASize.cy then + Result.cy := ASize.cy; + end; +end; + +procedure TdxInRibbonGalleryControlViewInfo.DoScrolling(ARowDelta: Integer); + + procedure DrawStep(ALayoutOffset: Integer; AColumnCount: Integer; + AGroupItemsList: TObjectList); + begin + CalculateLayout(GetTopLayoutIndent + ALayoutOffset, AColumnCount, AGroupItemsList); + cxInvalidateRect(Control.Parent.Handle, GalleryBounds, False); + Control.Parent.Update; + end; + + procedure Waiting; + var + ATickCount: Cardinal; + begin + ATickCount := GetTickCount; + while Abs(GetTickCount - ATickCount) < 10 do + //Application.ProcessMessages; //TODO: correct scrolling + end; + +var + AColumnCount: Integer; + ARowHeight: Integer; + AVisibleRowCount, ALastRowIndex, AGroupItemCount: Integer; + AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; + ADestroyAfterUse: Boolean; + ANewTopVisibleRow: Integer; + AFirstVisibleRow, ALastVisibleRow: Integer; + AGroupItemsList: TObjectList; + ALayoutOffset: Integer; + AnAdditionalVisibleRowCount: Integer; +begin + if Control.GetVisibleGroupCount <> 0 then + begin + FIsScrolling := True; + try + AGroupViewInfo := GetGroupViewInfo(Control.GetGroups, Self, + GetVisibleGroupIndex(0, True), ADestroyAfterUse); + try + AColumnCount := AGroupViewInfo.GetColumnCount(Control.ClientWidth); + ARowHeight := AGroupViewInfo.GetRowHeight; + finally + if ADestroyAfterUse then + AGroupViewInfo.Free; + end; + + AVisibleRowCount := GetVisibleRowCount; + AGroupItemCount := GetGroupItemCount(Control.GetGroups.Count - 1); + ALastRowIndex := GetRowIndex(AGroupItemCount - 1, AColumnCount); + if ALastRowIndex < FTopVisibleRow + AVisibleRowCount - 1 then + FTopVisibleRow := Max(0, ALastRowIndex - AVisibleRowCount + 1); + if (AColumnCount > 0) and IsScrollingPossible(ARowDelta) then + repeat + if ARowDelta < 0 then + begin + ANewTopVisibleRow := Max(FTopVisibleRow - 1, 0); + AnAdditionalVisibleRowCount := 1; + end + else + if ARowDelta > 0 then + begin + ANewTopVisibleRow := Min(FTopVisibleRow + 1, + Ceil(AGroupItemCount / AColumnCount)); + AnAdditionalVisibleRowCount := 1; + end + else + begin + ANewTopVisibleRow := FTopVisibleRow; + AnAdditionalVisibleRowCount := 0; + end; + AFirstVisibleRow := Min(ANewTopVisibleRow, FTopVisibleRow); + ALastVisibleRow := AFirstVisibleRow + (AVisibleRowCount - 1) + + AnAdditionalVisibleRowCount; + + AGroupItemsList := TObjectList.Create(False); + try + FillGroupItemList(AFirstVisibleRow, ALastVisibleRow, AColumnCount, + AGroupItemsList); + + if ARowDelta < 0 then + begin + for ALayoutOffset := -ARowHeight div 3 to 0 do + begin + DrawStep(ALayoutOffset * 3, AColumnCount, AGroupItemsList); + Waiting; + end; + end + else + if ARowDelta > 0 then + begin + for ALayoutOffset := 0 downto -ARowHeight div 3 do + begin + DrawStep(ALayoutOffset * 3, AColumnCount, AGroupItemsList); + Waiting; + end; + end; + FillGroupItemList(ANewTopVisibleRow, + ANewTopVisibleRow + (AVisibleRowCount - 1), AColumnCount, AGroupItemsList); + CalculateLayout(1 + GetTopLayoutIndent, AColumnCount, AGroupItemsList); + finally + AGroupItemsList.Free; + end; + + FTopVisibleRow := ANewTopVisibleRow; + if ARowDelta > 0 then + Dec(ARowDelta) + else + if ARowDelta < 0 then + Inc(ARowDelta); + until (ARowDelta = 0) or not IsScrollingPossible(ARowDelta) or + FScrollingBreak; + finally + FScrollingBreak := False; + FIsScrolling := False; + end; + end + else + FGroups.Clear; + ScrollingRowCounterRelease; +end; + +procedure TdxInRibbonGalleryControlViewInfo.DrawBackground(const R: TRect); + + function GetInRibbonGalleryState: Integer; + begin + Result := TdxBarSkinnedPainterAccess(Painter).GetPartState( + Control.DrawParams, icpControl); + end; + +begin + Control.Canvas.SaveClipRegion; + try + Control.Canvas.IntersectClipRect(R); + Painter.Skin.DrawBackground(Control.Canvas.Handle, GalleryBounds, + DXBAR_INRIBBONGALLERY, GetInRibbonGalleryState); + finally + Control.Canvas.RestoreClipRegion; + end; +end; + +function TdxInRibbonGalleryControlViewInfo.GetControlMargins: TRect; +begin + Result := Rect(0, 3, 0, 3); +end; + +function TdxInRibbonGalleryControlViewInfo.GetGalleryMargins: TRect; +begin + Result := Rect(0, 0, -Ord(Control.IsNeedScrollBar), 0); +end; + +function TdxInRibbonGalleryControlViewInfo.GetLayoutWidth( + AColumnCount: Integer; out AGroupItemWidthIsNull: Boolean): Integer; +begin + Result := AColumnCount * GetMaxGroupItemSize.cx + + (AColumnCount - 1) * GetSpaceBetweenItems(True); + AGroupItemWidthIsNull := GetMaxGroupItemSize.cx = 0; +end; + +function TdxInRibbonGalleryControlViewInfo.GetMaxGroupItemSize: TSize; +const + AMargin = 1; +var + AHeight, ARowCount, ADenominator, AIndent: Integer; +begin + if CanUseSize(GlobalItemSize) then + Result := GlobalItemSize + else + begin + Result := inherited GetMaxGroupItemSize; + AHeight := GallerySize.cy; + if AHeight <= 0 then + AHeight := ControlHeight; + ADenominator := Result.cy + GetSpaceBetweenItems(False); + if (AHeight > 0) and (ADenominator <> 0) then + begin + AIndent := 2 * AMargin + GetTopLayoutIndent + GetBottomLayoutIndent; + ARowCount := Max(1, (AHeight - AIndent) div ADenominator); + Result.cy := (AHeight - GetSpaceBetweenItems(False) * + (ARowCount - 1) - AIndent) div ARowCount; + Result.cx := CorrectGroupItemSize(Result).cx; + end + else + ARowCount := 1; + FRowCount := ARowCount; + end; +end; + +function TdxInRibbonGalleryControlViewInfo.GetBottomLayoutIndent: Integer; +begin + Result := GalleryOptions.SpaceBetweenItemsAndBorder; +end; + +function TdxInRibbonGalleryControlViewInfo.GetLeftLayoutIndent: Integer; +begin + Result := 1 + GalleryOptions.SpaceBetweenItemsAndBorder; +end; + +function TdxInRibbonGalleryControlViewInfo.GetRightLayoutIndent: Integer; +begin + Result := GalleryOptions.SpaceBetweenItemsAndBorder; +end; + +function TdxInRibbonGalleryControlViewInfo.GetTopLayoutIndent: Integer; +begin + Result := GalleryOptions.SpaceBetweenItemsAndBorder; +end; + +function TdxInRibbonGalleryControlViewInfo.InternalGetScrollBarWidth: Integer; +begin + with GetGalleryMargins do + Result := (Self.ControlHeight - (Top + Bottom)) div 4; +end; + +function TdxInRibbonGalleryControlViewInfo.IsInRibbon: Boolean; +begin + Result := True; +end; + +procedure TdxInRibbonGalleryControlViewInfo.ShowGroupItem( + AGroupItem: TdxRibbonGalleryGroupItem); +var + AGlobalIndex: Integer; +begin + if AGroupItem <> nil then + begin + AGlobalIndex := GetGroupItemCount(AGroupItem.Group.Index - 1) + + AGroupItem.Index; + FTopVisibleRow := Max(0, GetRowIndex(AGlobalIndex, GetColumnCount) - + GetVisibleRowCount + 1); + DoScrolling(0); + GetGalleryItem.Update; + end; +end; + +procedure TdxInRibbonGalleryControlViewInfo.FillGroupItemList(AFirstVisibleRow, + ALastVisibleRow, AColumnCount: Integer; AList: TObjectList); + + function GetGroupItemsCount(AGroupIndex: Integer): Integer; + begin + Result := IfThen(GalleryItem.IsGroupVisible(AGroupIndex), + Control.GetGroups[AGroupIndex].Items.Count); + end; + +var + I, J, ACurrentGroupItem, AFirstGroupItem, ALastGroupItem: Integer; +begin + AFirstGroupItem := AFirstVisibleRow * AColumnCount; + ALastGroupItem := (ALastVisibleRow + 1) * AColumnCount - 1; + ACurrentGroupItem := 0; + I := 0; + while (I <= Control.GetGroups.Count - 1) and + (ACurrentGroupItem + GetGroupItemsCount(I) <= AFirstGroupItem) do + begin + ACurrentGroupItem := ACurrentGroupItem + GetGroupItemsCount(I); + Inc(I); + end; + AList.Clear; + AList.Capacity := ALastGroupItem - AFirstGroupItem + 1; + J := AFirstGroupItem - ACurrentGroupItem; + ACurrentGroupItem := AFirstGroupItem; + while (ACurrentGroupItem <= ALastGroupItem) and + (I < Control.GetGroups.Count) do + begin + while GalleryItem.IsGroupVisible(I) and + (J < Control.GetGroups[I].Items.Count) and + (ACurrentGroupItem <= ALastGroupItem) do + begin + AList.Add(Control.GetGroups[I].Items[J]); + Inc(J); + Inc(ACurrentGroupItem); + end; + Inc(I); + J := 0; + end; +end; + +function TdxInRibbonGalleryControlViewInfo.GetControlHeight: Integer; +begin + if FControlHeight = 0 then + begin + FControlHeight := TdxRibbonBarPainter(Painter).GetGroupRowHeight( + Control.BarManager.ImageOptions.GlyphSize, Control.Parent.Font) * dxRibbonGroupRowCount; + with GetControlMargins do + Dec(FControlHeight, Top + Bottom); + end; + Result := FControlHeight; +end; + +function TdxInRibbonGalleryControlViewInfo.GetVisibleRowCount: Integer; +begin + if FRowCount = 0 then + raise Exception.Create(''); + Result := FRowCount; +end; + +// IdxBarMultiColumnItemControlViewInfo +function TdxInRibbonGalleryControlViewInfo.CanCollapse: Boolean; +begin + Result := GalleryOptions.CanCollapse; +end; + +function TdxInRibbonGalleryControlViewInfo.GetCollapsed: Boolean; +begin + Result := FCollapsed or GalleryOptions.Collapsed; +end; + +function TdxInRibbonGalleryControlViewInfo.GetColumnCount: Integer; +begin + Result := FColumnCount; +end; + +function TdxInRibbonGalleryControlViewInfo.GetMaxColumnCount: Integer; +begin + Result := GalleryOptions.ColumnCount; +end; + +function TdxInRibbonGalleryControlViewInfo.GetRowIndex(AGroupItemIndex, + AColumnCount: Integer): Integer; +begin + if AColumnCount <> 0 then + Result := AGroupItemIndex div AColumnCount + else + Result := 0; +end; + +function TdxInRibbonGalleryControlViewInfo.GetMinColumnCount: Integer; +begin + Result := GalleryOptions.MinColumnCount; +end; + +function TdxInRibbonGalleryControlViewInfo.GetSpaceBetweenItems( + IsAflat: Boolean): Integer; +begin + if (GalleryOptions.RemoveHorizontalItemPadding and IsAflat) or + (GalleryOptions.RemoveVerticalItemPadding and not IsAflat) then + Result := 0 + else + Result := GalleryOptions.SpaceBetweenItems; +end; + +function TdxInRibbonGalleryControlViewInfo.GetWidthForColumnCount( + AColumnCount: Integer): Integer; +begin + if FWidthForColumnCountInfos[AColumnCount - GetMinColumnCount].Calculated then + Result := FWidthForColumnCountInfos[AColumnCount - GetMinColumnCount].Width + else + begin + Result := Control.GetDefaultWidthInSubMenu; + with FWidthForColumnCountInfos[AColumnCount - GetMinColumnCount] do + begin + Width := Result; + Calculated := True; + end; + end; +end; + +function TdxInRibbonGalleryControlViewInfo.IsScrollingPossible( + ARowDelta: Integer): Boolean; +begin + Result := (ARowDelta < 0) and GetPreviousButtonEnabled or + (ARowDelta > 0) and GetNextButtonEnabled or (ARowDelta = 0); +end; + +procedure TdxInRibbonGalleryControlViewInfo.ScrollingRowCounterRelease; +var + AScrollingRowCounter: Integer; +begin + if FScrollingRowCounter <> 0 then + begin + AScrollingRowCounter := FScrollingRowCounter; + FScrollingRowCounter := 0; + DoScrolling(AScrollingRowCounter); + end; +end; + +procedure TdxInRibbonGalleryControlViewInfo.SetCollapsed(Value: Boolean); +begin + FCollapsed := Value; +end; + +procedure TdxInRibbonGalleryControlViewInfo.SetColumnCount(Value: Integer); +begin + FColumnCount := Value; +end; + +procedure TdxInRibbonGalleryControlViewInfo.SetScrollingRowCounter( + Value: Integer); +begin + if Value <> 0 then + if (FScrollingRowCounter = 0) or + ((Value > 0) xor (FScrollingRowCounter > 0)) then + begin + FScrollingRowCounter := Value; + FScrollingBreak := True; + end + else + FScrollingRowCounter := FScrollingRowCounter + Value; +end; + +{ TdxRibbonOnSubMenuGalleryControlViewInfo } + +procedure TdxRibbonOnSubMenuGalleryControlViewInfo.Calculate( + ALayoutOffset: Integer; AScrollCode: TScrollCode); +var + I, AMode, ACurrentGroupTop, AGroupBottom, AGalleryVisibleHeight: Integer; + AGalleryBounds: TRect; + AGallerySize: TSize; + AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; + AIsIntersected: Boolean; +begin + inherited Calculate(ALayoutOffset, AScrollCode); + AGalleryBounds := GalleryBounds; + AGallerySize := GallerySize; + FLayoutOffset := ALayoutOffset; + + if Control.SizeChanged then + begin + if (GalleryItem.SelectedGroupItem <> nil) and + GalleryItem.IsGroupVisible(GalleryItem.SelectedGroupItem.Group.Index) then + DisplayGroupItem(GalleryItem.SelectedGroupItem) + else + begin + AGalleryVisibleHeight := AGallerySize.cy; + if -FLayoutOffset + GetGalleryHeight(AGallerySize.cx) < + AGalleryVisibleHeight then + Control.SetScrollBarPosition(Max(0, GetGalleryHeight(AGallerySize.cx) - + AGalleryVisibleHeight)); + end; + end; + + FGroups.Clear; + AMode := 0; + I := 0; + ACurrentGroupTop := -FLayoutOffset + AGalleryBounds.Top; + while (AMode <> 2) and (I < Control.GetGroups.Count) do + begin + if GalleryItem.IsGroupVisible(I) then + begin + AGroupViewInfo := TdxRibbonGalleryGroupViewInfo.Create(Self, + Control.GetGroups[I], cxNullSize); + AGroupBottom := ACurrentGroupTop + + AGroupViewInfo.GetHeight(AGallerySize.cx) + + GalleryOptions.SpaceBetweenGroups; + AIsIntersected := AreLinesIntersectedStrictly(ACurrentGroupTop, + AGroupBottom, AGalleryBounds.Top, AGalleryBounds.Bottom); + if (AMode = 0) and AIsIntersected or + (AMode = 1) and not AIsIntersected then + Inc(AMode); + if AMode = 1 then + begin + AGroupViewInfo.Calculate(ACurrentGroupTop, AGroupBottom, AGalleryBounds); + FGroups.Add(AGroupViewInfo); + end + else + AGroupViewInfo.Free; + ACurrentGroupTop := AGroupBottom; + end; + Inc(I); + end; + + CalculateFilterBand; +end; + +procedure TdxRibbonOnSubMenuGalleryControlViewInfo.GetFilterMenuShowingParams( + out APosition: TPoint; out AOwnerHeight: Integer); +begin + APosition := Point(FFilterBandContentRect.Left + GroupHeaderCaptionOffset div 2 + + FilterMenuLeftBoundCorrection, FFilterBandRect.Bottom); + APosition := Control.Parent.ClientToScreen(APosition); + AOwnerHeight := cxRectHeight(FFilterBandRect); +end; + +function TdxRibbonOnSubMenuGalleryControlViewInfo.IsCollapsed: Boolean; +begin + Result := True; +end; + +function TdxRibbonOnSubMenuGalleryControlViewInfo.IsPtInFilterBandHotTrackArea( + const P: TPoint): Boolean; +begin + Result := PtInRect(FFilterBandRect, P); +end; + +procedure TdxRibbonOnSubMenuGalleryControlViewInfo.RepaintFilterBand; +begin + DrawFilterBand; +end; + +procedure TdxRibbonOnSubMenuGalleryControlViewInfo.SetFilterBandHotTrack( + AValue: Boolean); +begin + if FFilterBandHotTrack <> AValue then + begin + FFilterBandHotTrack := AValue; + DrawFilterBand; + end; +end; + +procedure TdxRibbonOnSubMenuGalleryControlViewInfo.DisplayGroupItem( + AGroupItem: TdxRibbonGalleryGroupItem); + + function DisplayGroupHeaderIfPossible(AGroupItemBottom, + AGroupIndex: Integer): Boolean; + var + AGroupTop: Integer; + begin + if FDontDisplayGroupHeaderWhenHotTrackingGroupItem = 0 then + begin + AGroupTop := GetAbsoluteGroupTop(AGroupIndex, GallerySize.cx); + if IsFirstLineShorterOrEqualThanSecond(AGroupTop, AGroupItemBottom, + GalleryBounds.Top, GalleryBounds.Bottom) and + (AGroupTop - FLayoutOffset < 0) then + begin + Control.SetScrollBarPosition(AGroupTop); + Result := True; + end + else + Result := False; + end + else + Result := False; + end; + + procedure MoveLayoutDown(AGroupItemTop, AGroupItemBottom, + AGroupIndex: Integer); + begin + if not DisplayGroupHeaderIfPossible(AGroupItemBottom, AGroupIndex) then + Control.SetScrollBarPosition(AGroupItemTop); + end; + + procedure MoveLayoutUp(AGroupItemBottom, AGroupIndex: Integer); + begin + if not DisplayGroupHeaderIfPossible(AGroupItemBottom, AGroupIndex) then + Control.SetScrollBarPosition(AGroupItemBottom - GallerySize.cy); + end; + +var + AGroupItemTop, AGroupItemBottom: Integer; + AnAbsoluteGroupItemTop, AnAbsoluteGroupItemBottom: Integer; +begin + if (AGroupItem <> nil) and (FDontDisplayHotTrackedGroupItem = 0) then + begin + GroupItemYRange(AGroupItem, AGroupItemTop, AGroupItemBottom); + AnAbsoluteGroupItemTop := AGroupItemTop + Control.FScrollBar.Position; + AnAbsoluteGroupItemBottom := AGroupItemBottom + Control.FScrollBar.Position; + case RelativeLocationOfLines(AGroupItemTop, AGroupItemBottom, + GalleryBounds.Top, GalleryBounds.Bottom) of + rllBefore: MoveLayoutDown(AnAbsoluteGroupItemTop, + AnAbsoluteGroupItemBottom, AGroupItem.Group.Index); + rllInside: DisplayGroupHeaderIfPossible(AnAbsoluteGroupItemBottom, + AGroupItem.Group.Index); + rllAfter: MoveLayoutUp(AnAbsoluteGroupItemBottom, + AGroupItem.Group.Index); + end; + end; +end; + +procedure TdxRibbonOnSubMenuGalleryControlViewInfo.DrawBackground(const R: TRect); + + function GetInRibbonGalleryState: Integer; + begin + Result := TdxBarSkinnedPainterAccess(Painter).GetPartState( + Control.DrawParams, icpControl); + end; + +var + ARect: TRect; +begin + Control.Canvas.SaveClipRegion; + try + Control.Canvas.IntersectClipRect(R); + Painter.Skin.DrawBackground(Control.Canvas.Handle, GalleryBounds, + DXBAR_DROPDOWNGALLERY, DXBAR_NORMAL); + DrawFilterBand; + if NeedsDrawBottomSeparator then + begin + ARect := Bounds; + ARect.Top := ARect.Bottom - GetBottomSeparatorHeight; + Painter.SubMenuControlDrawSeparator(Control.Canvas, ARect); + end; + finally + Control.Canvas.RestoreClipRegion; + end; +end; + +function TdxRibbonOnSubMenuGalleryControlViewInfo.GetControlBounds: TRect; +begin + Result := Control.ItemBounds; +end; + +function TdxRibbonOnSubMenuGalleryControlViewInfo.GetGalleryHeight( + AWidth: Integer): Integer; +begin + Result := GetAbsoluteGroupTop(Control.GetGroups.Count, AWidth) - + GalleryOptions.SpaceBetweenGroups; + if GalleryOptions.RemoveVerticalItemPadding then + Inc(Result); + Result := Max(0, Result); +end; + +function TdxRibbonOnSubMenuGalleryControlViewInfo.GetGalleryMargins: TRect; +begin + Result := cxNullRect; + if GalleryItem.IsFilterVisible then + Inc(Result.Top, GetFilterBandHeight + FilterBandOffset); + if NeedsDrawBottomSeparator then + Inc(Result.Bottom, GetBottomSeparatorHeight); +end; + +function TdxRibbonOnSubMenuGalleryControlViewInfo.GetHeight( + AWidth: Integer): Integer; +begin + if GalleryOptions.RowCount = 0 then + Result := GetGalleryHeight(AWidth) + else + Result := GetHeightByRowCount(AWidth); + Result := Max(Result, Control.CalcMinHeight); +end; + +function TdxRibbonOnSubMenuGalleryControlViewInfo.GetLayoutWidth( + AColumnCount: Integer; out AGroupItemWidthIsNull: Boolean): Integer; +var + I: Integer; +begin + Result := 0; + AGroupItemWidthIsNull := True; + for I := 0 to Control.GetGroups.Count - 1 do + begin + Result := Max(Result, GetGroupItemSize(I).cx * AColumnCount + + GetSpaceBetweenItems(I, True) * (AColumnCount - 1)); + if AGroupItemWidthIsNull and (GetGroupItemSize(I).cx <> 0) then + AGroupItemWidthIsNull := False; + end; +end; + +procedure TdxRibbonOnSubMenuGalleryControlViewInfo.GroupItemYRange( + const AGroupItem: TdxRibbonGalleryGroupItem; var ATop, ABottom: Integer); +var + AGroupViewInfo: TdxRibbonGalleryGroupViewInfo; + ADestroyAfterUse: Boolean; + AGallerySize: TSize; +begin + AGallerySize := GallerySize; + ATop := -FLayoutOffset + + GetAbsoluteGroupTop(AGroupItem.Group.Index, AGallerySize.cx); + AGroupViewInfo := GetGroupViewInfo(Control.GetGroups, Self, + AGroupItem.Group.Index, ADestroyAfterUse); + try + {if ADestroyAfterUse then + AGroupViewInfo.SetBounds(GalleryBounds);} + ATop := AGroupViewInfo.GetRowTop(AGroupViewInfo.GetItemRow( + AGroupItem.Index, AGallerySize.cx), ATop, AGallerySize.cx); + ABottom := ATop + AGroupViewInfo.FItemSize.cy; + finally + if ADestroyAfterUse then + AGroupViewInfo.Free; + end; +end; + +function TdxRibbonOnSubMenuGalleryControlViewInfo.GetMinSize: TSize; +begin + Result.cx := Control.CalcDefaultWidth + GetGalleryMargins.Left + + GetGalleryMargins.Right; + if GroupCount <> 0 then + Result.cy := Control.CalcMinHeight + GetGalleryMargins.Top + + GetGalleryMargins.Bottom + else + Result.cy := 0; +end; + +function TdxRibbonOnSubMenuGalleryControlViewInfo.InternalGetScrollBarWidth: Integer; +begin + Result := GetScrollBarSize.cx; +end; + +procedure TdxRibbonOnSubMenuGalleryControlViewInfo.CalculateFilterBand; +begin + if GalleryItem.IsFilterVisible then + begin + FFilterBandRect := cxRectSetHeight(GetControlBounds, GetFilterBandHeight); + FFilterBandContentRect := FFilterBandRect; + ExtendRect(FFilterBandContentRect, + Painter.Skin.GetContentOffsets(DXBAR_GALLERYFILTERBAND)); + end; +end; + +procedure TdxRibbonOnSubMenuGalleryControlViewInfo.DrawFilterBand; +begin + if GalleryItem.IsFilterVisible then + begin + FillRectByColor(Control.Canvas.Handle, + cxRectInflate(FFilterBandRect, 0, 0, 0, FilterBandOffset), + Painter.Skin.GetPartColor(DXBAR_DROPDOWNBORDER_INNERLINE)); + Painter.Skin.DrawBackground(Control.Canvas.Handle, FFilterBandRect, + DXBAR_GALLERYFILTERBAND); + DrawFilterCaption; + end; +end; + +procedure TdxRibbonOnSubMenuGalleryControlViewInfo.DrawFilterCaption; + + function GetDrawTextFlags: Integer; + begin + Result := cxSingleLine or cxAlignLeft or cxAlignTop or cxShowEndEllipsis; + end; + + function GetFilterArrowWidth: Integer; + begin + Result := FilterArrowSize * 2 - 1; + end; + + function GetFilterSkinState: Integer; + begin + if FFilterBandHotTrack and not TdxRibbonOnSubMenuGalleryController(Control.Controller).IsFilterMenuShowed then + Result := DXBAR_HOT + else + Result := DXBAR_NORMAL; + end; + +var + AArrowRect, ACaptionRect: TRect; + AArrowOffset: Integer; + ACanvas: TcxCanvas; + ACaption: string; + P: TcxArrowPoints; +begin + ACanvas := Control.Canvas; + ACanvas.Font.Color := Painter.Skin.GetPartColor(DXBAR_GALLERYFILTERBANDTEXT, GetFilterSkinState); + AArrowOffset := ACanvas.TextWidth(' ') + FilterArrowOffset; + ACaption := GalleryItem.GetFilterCaption; + + ACaptionRect := FFilterBandContentRect; + InflateRect(ACaptionRect, -GroupHeaderCaptionOffset, 0); + Dec(ACaptionRect.Right, GetFilterArrowWidth + AArrowOffset); + ACanvas.TextExtent(ACaption, ACaptionRect, GetDrawTextFlags); + ACanvas.Brush.Style := bsClear; + ACanvas.DrawText(ACaption, ACaptionRect, GetDrawTextFlags); + ACanvas.Brush.Style := bsSolid; + + AArrowRect := cxRectBounds(ACaptionRect.Right + AArrowOffset, + FFilterBandContentRect.Top + (cxRectHeight(FFilterBandContentRect) - FilterArrowSize) div 2, + GetFilterArrowWidth, FilterArrowSize); + TcxCustomLookAndFeelPainter.CalculateArrowPoints(AArrowRect, P, adDown, False, FilterArrowSize); + with ACanvas do + begin + Brush.Style := bsSolid; + SetBrushColor(ACanvas.Font.Color); + Pen.Color := ACanvas.Font.Color; + Polygon(P); + end; +end; + +function TdxRibbonOnSubMenuGalleryControlViewInfo.GetBottomSeparatorHeight: Integer; +begin + Result := Painter.SubMenuGetSeparatorSize; +end; + +function TdxRibbonOnSubMenuGalleryControlViewInfo.GetFilterBandHeight: Integer; +begin + Result := cxTextHeight(Control.Parent.Font); + with Painter.Skin.GetContentOffsets(DXBAR_GALLERYFILTERBAND) do + Inc(Result, Top + Bottom); +end; + +function TdxRibbonOnSubMenuGalleryControlViewInfo.GetHeightByRowCount( + AWidth: Integer): Integer; +var + ARowCount, ACurrentRow, ACurrentGroupIndex, AGroupRowCount: Integer; + ACurrentGroupViewInfo: TdxRibbonGalleryGroupViewInfo; + ADestroyAfterUse: Boolean; + AGalleryOptions: TdxRibbonGalleryOptions; +begin + Result := 0; + ACurrentRow := 0; + ACurrentGroupIndex := 0; + AGalleryOptions := GalleryOptions; + ARowCount := AGalleryOptions.RowCount; + while (ACurrentRow < ARowCount) and (ACurrentGroupIndex > -1) and + (ACurrentGroupIndex < Control.GetGroups.Count) do + begin + if Result <> 0 then + Inc(Result, AGalleryOptions.SpaceBetweenGroups); + ACurrentGroupIndex := GetVisibleGroupIndex(ACurrentGroupIndex, True); + if ACurrentGroupIndex <> -1 then + begin + ACurrentGroupViewInfo := GetGroupViewInfo(Control.GetGroups, Self, + ACurrentGroupIndex, ADestroyAfterUse); + try + Inc(Result, ACurrentGroupViewInfo.Header.GetHeight(AWidth, True)); + AGroupRowCount := Min(ACurrentGroupViewInfo.GetRowCount(AWidth), + ARowCount - ACurrentRow); + Inc(Result, Max(0, AGroupRowCount * ACurrentGroupViewInfo.GetRowHeight - + ACurrentGroupViewInfo.GetSpaceBetweenItems(False))); + Inc(ACurrentRow, AGroupRowCount); + Inc(ACurrentGroupIndex); + finally + if ADestroyAfterUse then + ACurrentGroupViewInfo.Free; + end; + end; + end; +end; + +function TdxRibbonOnSubMenuGalleryControlViewInfo.GetSpaceBetweenItems( + AGroupIndex: Integer; IsAflat: Boolean): Integer; +begin + if (Control.GetGroups[AGroupIndex].Options.RemoveHorizontalItemPadding and + IsAflat) or + (Control.GetGroups[AGroupIndex].Options.RemoveVerticalItemPadding and + not IsAflat) then + Result := 0 + else + Result := Control.GetGroups[AGroupIndex].Options.SpaceBetweenItems; +end; + +function TdxRibbonOnSubMenuGalleryControlViewInfo.NeedsDrawBottomSeparator: Boolean; +begin + Result := Control.Parent.ItemLinks.VisibleItemCount <> 0; //TODO +end; + +{ TdxRibbonGalleryControlAccessibilityHelper } + +function TdxRibbonGalleryControlAccessibilityHelper.HandleNavigationKey( + var AKey: Word): Boolean; +begin + Result := False; + + if not Control.Collapsed then + if Control.Parent.Kind = bkBarControl then + begin + Result := AKey in [VK_RETURN, VK_SPACE, VK_UP, VK_DOWN]; + if Result then + Control.DropDown(False); + end + else + begin + Result := True; + case AKey of + VK_DOWN: OnSubMenuController.Navigation(andDown); + VK_LEFT: OnSubMenuController.Navigation(andLeft); + VK_RIGHT: OnSubMenuController.Navigation(andRight); + VK_UP: OnSubMenuController.Navigation(andUp); + VK_TAB: OnSubMenuController.Tabulation; + VK_PRIOR: OnSubMenuController.PageUp; + VK_NEXT: OnSubMenuController.PageDown; + VK_HOME: OnSubMenuController.HotTrackFirstGroupItem; + VK_END: OnSubMenuController.HotTrackLastGroupItem; + end; + end; + + if not Result then + Result := inherited HandleNavigationKey(AKey); +end; + +function TdxRibbonGalleryControlAccessibilityHelper.IsNavigationKey( + AKey: Word): Boolean; +begin + Result := inherited IsNavigationKey(AKey); + if not Control.Collapsed then + begin + if Control.Parent.Kind = bkBarControl then + Result := Result or (AKey in [VK_RETURN, VK_SPACE, VK_UP, VK_DOWN]) + else + Result := Result or (AKey in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_TAB, + VK_PRIOR, VK_NEXT, VK_HOME, VK_END]); + end; +end; + +procedure TdxRibbonGalleryControlAccessibilityHelper.GetKeyTipData( + AKeyTipsData: TList); +begin + if not (not Control.Collapsed and (Control.Parent.Kind = bkSubMenu)) then + inherited GetKeyTipData(AKeyTipsData); +end; + +procedure TdxRibbonGalleryControlAccessibilityHelper.GetKeyTipInfo( + out AKeyTipInfo: TdxBarKeyTipInfo); +var + R: TRect; +begin + inherited GetKeyTipInfo(AKeyTipInfo); + if not Control.Collapsed and (Control.Parent.Kind = bkBarControl) then + begin + R := Control.ViewInfo.ScrollBarBounds; + OffsetRect(R, Control.Parent.ClientOrigin.X, 0); + AKeyTipInfo.BasePoint.X := cxRectCenter(R).X; + AKeyTipInfo.HorzAlign := taRightJustify; + end; +end; + +procedure TdxRibbonGalleryControlAccessibilityHelper.OnSubMenuHotTrack( + ANavigationDirection: TdxRibbonDropDownGalleryNavigationDirection); +begin + case ANavigationDirection of + dgndNone: + if Control.Item.SelectedGroupItem <> nil then + OnSubMenuController.HotTrackItem(Control.Item.SelectedGroupItem) + else + OnSubMenuController.HotTrackFirstGroupItem; + dgndUp: + OnSubMenuController.HotTrackLastGroupItem; + dgndDown: + OnSubMenuController.HotTrackFirstGroupItem; + end; +end; + +function TdxRibbonGalleryControlAccessibilityHelper.ShowDropDownWindow: Boolean; +begin + TdxRibbonGalleryControl(ItemControl).DropDown(False); + Result := ItemControl.IsDroppedDown; +end; + +function TdxRibbonGalleryControlAccessibilityHelper.GetControl: TdxRibbonGalleryControl; +begin + Result := TdxRibbonGalleryControl(FOwnerObject); +end; + +function TdxRibbonGalleryControlAccessibilityHelper.GetOnSubMenuController: TdxRibbonOnSubMenuGalleryController; +begin + if Control.Parent.Kind = bkBarControl then + raise Exception.Create(''); + Result := TdxRibbonOnSubMenuGalleryController(Control.Controller); +end; + +{ TdxRibbonDropDownGalleryControlAccessibilityHelper } + +// IdxBarAccessibilityHelper +function TdxRibbonDropDownGalleryControlAccessibilityHelper.HandleNavigationKey( + var AKey: Word): Boolean; + + procedure HandleKeyUp; + begin + TdxBarItemLinksAccess(ItemLinks).Last.Control.IAccessibilityHelper.Select(AKey = VK_TAB); + end; + + procedure HandleKeyDown; + begin + InternalGalleryItemControlAccessibilityHelper.Select(False); + InternalGalleryItemControlAccessibilityHelper.OnSubMenuHotTrack(dgndNone); + end; + +begin + if BarControl.SelectedControl = nil then + begin + Result := True; + case AKey of + VK_LEFT, VK_UP: + if TdxBarItemLinksAccess(ItemLinks).Last = nil then + HandleKeyDown + else + HandleKeyUp; + VK_RIGHT: + HandleKeyDown; + VK_DOWN, VK_PRIOR: + HandleKeyDown; + VK_TAB: + if ssShift in InternalGetShiftState then + HandleKeyUp + else + HandleKeyDown; + VK_NEXT: + begin + InternalGalleryItemControlAccessibilityHelper.Select(False); + TdxRibbonOnSubMenuGalleryController(BarControl.InternalGalleryItemControl.Controller).PageDown; + end; + end; + end + else + Result := inherited HandleNavigationKey(AKey); +end; + +function TdxRibbonDropDownGalleryControlAccessibilityHelper.IsNavigationKey( + AKey: Word): Boolean; +begin + Result := inherited IsNavigationKey(AKey); + if BarControl.SelectedControl = nil then + Result := Result or (AKey in [VK_PRIOR, VK_NEXT]); +end; + +procedure TdxRibbonDropDownGalleryControlAccessibilityHelper.HandleVertNavigationKey( + AUpKey, AFocusItemControl: Boolean); +begin + if AUpKey and (BarControl.SelectedLink = TdxBarItemLinksAccess(ItemLinks).First) or + not AUpKey and (BarControl.SelectedLink = TdxBarItemLinksAccess(ItemLinks).Last) then + begin + BarNavigationController.ChangeSelectedObject(AFocusItemControl, + BarControl.InternalGalleryItemControl.IAccessibilityHelper); + if AUpKey then + InternalGalleryItemControlAccessibilityHelper.OnSubMenuHotTrack(dgndUp) + else + InternalGalleryItemControlAccessibilityHelper.OnSubMenuHotTrack(dgndDown); + end + else + inherited HandleVertNavigationKey(AUpKey, AFocusItemControl); +end; + +function TdxRibbonDropDownGalleryControlAccessibilityHelper.GetBarControl: TdxRibbonDropDownGalleryControl; +begin + Result := TdxRibbonDropDownGalleryControl(FOwnerObject); +end; + +function TdxRibbonDropDownGalleryControlAccessibilityHelper.GetInternalGalleryItemControlAccessibilityHelper: TdxRibbonGalleryControlAccessibilityHelper; +begin + Result := TdxRibbonGalleryControlAccessibilityHelper( + BarControl.InternalGalleryItemControl.IAccessibilityHelper.GetHelper); +end; + +{ TdxRibbonGalleryScrollBarViewInfo } + +procedure TdxRibbonGalleryScrollBarViewInfo.CalculateRects; +var + AArrowButtonHeight: Integer; +begin + if not TdxRibbonGalleryScrollBar(ScrollBar).IsDropDownStyle then + begin + inherited CalculateRects; + Exit; + end; + AArrowButtonHeight := ScrollBar.Height div 3; + FTopLeftArrowRect := Bounds(0, 0, ScrollBar.Width, AArrowButtonHeight); + FBottomRightArrowRect := Bounds(0, FTopLeftArrowRect.Bottom, ScrollBar.Width, + AArrowButtonHeight); + CalculateThumbnailRect; + FDropDownButtonRect := Rect(0, FBottomRightArrowRect.Bottom, ScrollBar.Width, + ScrollBar.Height); +end; + +{ TdxRibbonGalleryScrollBar } + +constructor TdxRibbonGalleryScrollBar.Create( + AGalleryControl: TdxRibbonGalleryControl); +var + ASkinName: string; +begin + inherited Create(nil); + Kind := sbVertical; + FGalleryControl := AGalleryControl; + + if Painter <> nil then + ASkinName := Painter.Skin.GetName + else + ASkinName := ''; + LookAndFeel.SkinName := ASkinName; + LookAndFeel.NativeStyle := ASkinName = ''; + + UnlimitedTracking := True; +end; + +function TdxRibbonGalleryScrollBar.IsDropDownStyle: Boolean; +begin + Result := (Parent <> nil) and (TCustomdxBarControl(Parent).Kind = bkBarControl); +end; + +procedure TdxRibbonGalleryScrollBar.DoPaint(ACanvas: TcxCanvas); +var + ADropDownButtonState: TcxButtonState; + R: TRect; +begin + inherited DoPaint(ACanvas); + if IsDropDownStyle then + begin + if not Enabled then + ADropDownButtonState := cxbsDisabled + else if ((BarNavigationController.SelectedObject <> nil) and + (BarNavigationController.SelectedObject.GetHelper = FGalleryControl.IAccessibilityHelper.GetHelper) or + IsDropDownButtonUnderMouse) and not GalleryControl.IsDroppedDown and not (FState.HotPart in [sbpLineUp, sbpLineDown]) then + ADropDownButtonState := cxbsHot + else + ADropDownButtonState := cxbsNormal; + Painter.Skin.DrawBackground(ACanvas.Handle, ViewInfo.DropDownButtonRect, + DXBAR_INRIBBONGALLERYSCROLLBAR_DROPDOWNBUTTON, GetButtonSkinState(ADropDownButtonState)); + end; + if (GalleryControl <> nil) and TdxBarItemLinkAccess(GalleryControl.ItemLink).IsComponentSelected then + begin + R := ClientRect; + Dec(R.Left, 2); + if BarDesignController.NeedDefaultSelection(GalleryControl.ItemLink) then + dxBarFrameRect(ACanvas.Handle, R, COLOR_WINDOWTEXT) + else + dxBarFocusRect(ACanvas.Handle, R); + end; +end; + +procedure TdxRibbonGalleryScrollBar.DrawScrollBarPart(ACanvas: TcxCanvas; + const R: TRect; APart: TcxScrollBarPart; AState: TcxButtonState); + + function GetButtonKind: TdxInRibbonGalleryScrollBarButtonKind; + begin + if APart = sbpLineUp then + Result := gsbkLineUp + else + Result := gsbkLineDown; + end; + + function GetButtonSkinPart: Integer; + begin + case APart of + sbpLineUp: Result := DXBAR_INRIBBONGALLERYSCROLLBAR_LINEUPBUTTON; + sbpLineDown: Result := DXBAR_INRIBBONGALLERYSCROLLBAR_LINEDOWNBUTTON; + else + Result := 0; + end; + end; + +begin + if IsDropDownStyle then + begin + if GetButtonSkinPart = 0 then + Exit;//raise Exception.Create(''); + if not IsButtonEnabled(GetButtonKind) then + AState := cxbsDisabled; + + Painter.Skin.DrawBackground(ACanvas.Handle, R, GetButtonSkinPart, + GetButtonSkinState(AState)); + end + else + inherited DrawScrollBarPart(ACanvas, R, APart, AState); +end; + +function TdxRibbonGalleryScrollBar.GetViewInfoClass: TcxScrollBarViewInfoClass; +begin + Result := TdxRibbonGalleryScrollBarViewInfo; +end; + +procedure TdxRibbonGalleryScrollBar.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + if not IsDropDownButtonUnderMouse then + TCustomdxBarControlAccess(GalleryControl.Parent).SetKeySelectedItem(nil); + inherited MouseDown(Button, Shift, X, Y); + if (Button = mbLeft) and IsDropDownButtonUnderMouse then + begin + FIsDropDownButtonPressed := True; + Repaint; + DoDropDown; + end; +end; + +procedure TdxRibbonGalleryScrollBar.DoDropDown; +begin + if Assigned(OnDropDown) then + OnDropDown(Self); +end; + +function TdxRibbonGalleryScrollBar.GetButtonSkinState( + AState: TcxButtonState): Integer; +begin + case AState of + cxbsNormal: Result := DXBAR_NORMAL; + cxbsHot: Result := DXBAR_HOT; + cxbsPressed: Result := DXBAR_PRESSED; + cxbsDisabled: Result := DXBAR_DISABLED; + else + raise Exception.Create('') + end; +end; + +function TdxRibbonGalleryScrollBar.GetPainter: TdxBarSkinnedPainter; +begin + if GalleryControl.IsValidPainter then + Result := TdxBarSkinnedPainter(GalleryControl.Painter) + else + Result := nil; +end; + +function TdxRibbonGalleryScrollBar.GetViewInfo: TdxRibbonGalleryScrollBarViewInfo; +begin + Result := TdxRibbonGalleryScrollBarViewInfo(FViewInfo); +end; + +function TdxRibbonGalleryScrollBar.IsButtonEnabled( + AButtonKind: TdxInRibbonGalleryScrollBarButtonKind): Boolean; +begin + Result := Enabled; + if Result then + case AButtonKind of + gsbkLineUp: + Result := GalleryControl.ViewInfo.GetPreviousButtonEnabled; + gsbkLineDown: + Result := GalleryControl.ViewInfo.GetNextButtonEnabled; + end; +end; + +function TdxRibbonGalleryScrollBar.IsDropDownButtonUnderMouse: Boolean; +var + R: TRect; +begin + Result := HandleAllocated and (WindowFromPoint(GetMouseCursorPos) = Handle); + if Result then + begin + R := ViewInfo.DropDownButtonRect; + MapWindowRect(Handle, 0, R); + Result := PtInRect(R, GetMouseCursorPos); + end; +end; + +procedure TdxRibbonGalleryScrollBar.WMCaptureChanged( + var Message: TMessage); +begin + inherited; + FIsDropDownButtonPressed := False; +end; + +procedure TdxRibbonGalleryScrollBar.WMNCDestroy( + var Message: TWMNCDestroy); +begin + inherited; + FIsDropDownButtonPressed := False; +end; + +{ TdxRibbonDropDownGallery } + +destructor TdxRibbonDropDownGallery.Destroy; +begin + GalleryItem := nil; + inherited Destroy; +end; + +function TdxRibbonDropDownGallery.CreateBarControl: TCustomdxBarControl; +begin + Result := inherited CreateBarControl; + if HasValidGalleryItem then + TdxRibbonDropDownGalleryControl(Result).GalleryItem := GalleryItem; +end; + +function TdxRibbonDropDownGallery.GetControlClass: TCustomdxBarControlClass; +begin + if HasValidGalleryItem then + Result := TdxRibbonDropDownGalleryControl + else + Result := inherited GetControlClass; +end; + +function TdxRibbonDropDownGallery.HasValidGalleryItem: Boolean; +begin + Result := (GalleryItem <> nil) and (Ribbon <> nil) and + (GalleryItem.BarManager = Ribbon.BarManager); +end; + +procedure TdxRibbonDropDownGallery.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (AComponent = GalleryItem) then + GalleryItem := nil; +end; + +procedure TdxRibbonDropDownGallery.SetGalleryItem( + Value: TdxRibbonGalleryItem); +begin + if Value <> FGalleryItem then + begin + if FGalleryItem <> nil then + FGalleryItem.RemoveFreeNotification(Self); + FGalleryItem := Value; + if FGalleryItem <> nil then + FGalleryItem.FreeNotification(Self); + end; +end; + +{ TdxRibbonDropDownGalleryGalleryItemItemLinks } + +function TdxRibbonDropDownGalleryGalleryItemItemLinks.CanContainItem( + AItem: TdxBarItem; out AErrorText: string): Boolean; +begin + Result := True; +end; + +{ TdxRibbonDropDownGalleryControlPainter } + +function TdxRibbonDropDownGalleryControlPainter.GetSizingBandHeight( + AGalleryControl: TdxRibbonDropDownGalleryControl): Integer; +var + AButtonHeight: Integer; +begin + Result := 0; + if HasSizingBand(AGalleryControl) then + begin + AButtonHeight := GetGroupRowHeight(AGalleryControl.BarManager.ImageOptions.GlyphSize, + AGalleryControl.Font); + case AGalleryControl.Resizing of + gsrHeight: + Result := (AButtonHeight * 6 + 100) div 29; + gsrWidthAndHeight: + Result := (AButtonHeight * 9 + 121) div 29; + end; + end; +end; + +function TdxRibbonDropDownGalleryControlPainter.PtInSizingArea( + AGalleryControl: TdxRibbonDropDownGalleryControl; const P: TPoint): Boolean; +var + AOffsetX: Integer; + R: TRect; +begin + Result := False; + if AGalleryControl.IsSizingBandAtBottom then + begin + case AGalleryControl.Resizing of + gsrHeight: + begin + R := Rect(0, 0, AGalleryControl.Width, AGalleryControl.Height); + R.Top := R.Bottom - (GetSizingBandHeight(AGalleryControl) + SubMenuControlNCBorderSize); + Result := PtInRect(R, P); + end; + gsrWidthAndHeight: + begin + AOffsetX := P.X - (AGalleryControl.Width - GetSizingBandHeight(AGalleryControl)); + Result := (AOffsetX >= 0) and (P.Y < AGalleryControl.Height) and + (AGalleryControl.Height - 1 - P.Y <= AOffsetX); + end; + end; + end + else + begin + case AGalleryControl.Resizing of + gsrHeight: + begin + R := Rect(0, 0, AGalleryControl.Width, AGalleryControl.Height); + R.Bottom := R.Top + (GetSizingBandHeight(AGalleryControl) + SubMenuControlNCBorderSize); + Result := PtInRect(R, P); + end; + gsrWidthAndHeight: + begin + AOffsetX := P.X - (AGalleryControl.Width - GetSizingBandHeight(AGalleryControl) - 1); + Result := (AOffsetX >= 0) and (P.Y >= 0) and (P.Y <= AOffsetX); + end; + end; + end; +end; + +procedure TdxRibbonDropDownGalleryControlPainter.SubMenuControlDrawBorder( + ABarSubMenuControl: TdxBarSubMenuControl; DC: HDC; R: TRect); +const + ASizeGripParts: array[Boolean] of Integer = + (DXBAR_DROPDOWNGALLERY_TOPSIZEGRIP, DXBAR_DROPDOWNGALLERY_BOTTOMSIZEGRIP); + ASizingBandParts: array[Boolean] of Integer = + (DXBAR_DROPDOWNGALLERY_TOPSIZINGBAND, DXBAR_DROPDOWNGALLERY_BOTTOMSIZINGBAND); + AVerticalSizeGripParts: array[Boolean] of Integer = + (DXBAR_DROPDOWNGALLERY_TOPVERTICALSIZEGRIP, DXBAR_DROPDOWNGALLERY_BOTTOMVERTICALSIZEGRIP); +var + ABorderSize: Integer; + AIsSizingBandAtBottom: Boolean; +begin + inherited SubMenuControlDrawBorder(ABarSubMenuControl, DC, R); + if HasSizingBand(TdxRibbonDropDownGalleryControl(ABarSubMenuControl)) then + begin + AIsSizingBandAtBottom := TdxRibbonDropDownGalleryControl(ABarSubMenuControl).IsSizingBandAtBottom; + ABorderSize := SubMenuControlNCBorderSize; + InflateRect(R, -ABorderSize, -ABorderSize); + if AIsSizingBandAtBottom then + R.Top := R.Bottom - GetSizingBandHeight(TdxRibbonDropDownGalleryControl(ABarSubMenuControl)) + else + R.Bottom := R.Top + GetSizingBandHeight(TdxRibbonDropDownGalleryControl(ABarSubMenuControl)); + Skin.DrawBackground(DC, R, ASizingBandParts[AIsSizingBandAtBottom]); + case TdxRibbonDropDownGalleryControl(ABarSubMenuControl).Resizing of + gsrHeight: + Skin.DrawBackground(DC, R, AVerticalSizeGripParts[AIsSizingBandAtBottom]); + gsrWidthAndHeight: + Skin.DrawBackground(DC, R, ASizeGripParts[AIsSizingBandAtBottom]); + end; + end; +end; + +function TdxRibbonDropDownGalleryControlPainter.HasSizingBand( + AGalleryControl: TdxRibbonDropDownGalleryControl): Boolean; +begin + Result := AGalleryControl.Resizing <> gsrNone; +end; + +{ TdxRibbonDropDownGalleryControl } + +constructor TdxRibbonDropDownGalleryControl.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + DoubleBuffered := True; +end; + +destructor TdxRibbonDropDownGalleryControl.Destroy; +begin + FreeAndNil(FGalleryItemItemLinks); + FreeAndNil(FInternalPainter); + inherited Destroy; +end; + +procedure TdxRibbonDropDownGalleryControl.SetBounds(ALeft, ATop, AWidth, + AHeight: Integer); +begin + FHeight := AHeight; + FUseInternalSizeValue := True; + try + inherited SetBounds(ALeft, ATop, AWidth, AHeight); + finally + FUseInternalSizeValue := False; + end; +end; + +procedure TdxRibbonDropDownGalleryControl.CalcColumnItemRects( + ATopIndex: Integer; out ALastItemBottom: Integer); +var + AGalleryHeight, I: Integer; +begin + inherited CalcColumnItemRects(ATopIndex, ALastItemBottom); + if ItemLinks.VisibleItemCount > 0 then + begin + for I := 0 to ItemLinks.VisibleItemCount - 1 do + ItemLinks[I].ItemRect := cxRectOffset(ItemLinks[I].ItemRect, 0, + VisibleItemsRect.Bottom - ALastItemBottom); + AGalleryHeight := VisibleItemsRect.Bottom - ALastItemBottom; + end + else + AGalleryHeight := cxRectHeight(VisibleItemsRect); + FGalleryItemItemLinks[0].ItemRect := cxRectSetHeight(VisibleItemsRect, AGalleryHeight); + InternalGalleryItemControl.SizeChanged := False; +end; + +function TdxRibbonDropDownGalleryControl.ChangeSizeByChildItemControl( + out ASize: TSize): Boolean; +begin + Result := False; + ASize := cxNullSize; + if InternalGalleryItemControl.Item.GalleryOptions.FSubMenuResizing = gsrNone then + begin + InternalGalleryItemControl.LockCalcParts := True; + try + CalcControlsPositions; + finally + InternalGalleryItemControl.LockCalcParts := False; + end; + if (InternalGalleryItemControl.GetDefaultWidthInSubMenu > Width) and + (Screen.Width > + Width + InternalGalleryItemControl.ViewInfo.GetScrollBarWidth) then + begin + ASize.cx := Width + InternalGalleryItemControl.ViewInfo.GetScrollBarWidth; + ASize.cy := Height; + Result := True; + end; + end; +end; + +procedure TdxRibbonDropDownGalleryControl.CreateWnd; +begin + FreeAndNil(FGalleryItemItemLinks); + FGalleryItemItemLinks := TdxRibbonDropDownGalleryGalleryItemItemLinks.Create( + BarManager, TdxBarItemLinksAccess(ItemLinks).LinksOwner); + FGalleryItemItemLinks.Internal := True; + FGalleryItemItemLinks.BarControl := Self; + FGalleryItemItemLinks.Add.Item := GalleryItem; + FGalleryItemItemLinks[0].CreateControl; + InternalGalleryItemControl.Collapsed := False; + inherited CreateWnd; +end; + +function TdxRibbonDropDownGalleryControl.DoMouseWheelDown(Shift: TShiftState; + MousePos: TPoint): Boolean; +begin + Result := inherited DoMouseWheelDown(Shift, MousePos); + InternalGalleryItemControl.SetScrollBarPosition( + InternalGalleryItemControl.ScrollBar.Position + GetMouseWheelStep); +end; + +function TdxRibbonDropDownGalleryControl.DoMouseWheelUp(Shift: TShiftState; + MousePos: TPoint): Boolean; +begin + Result := inherited DoMouseWheelUp(Shift, MousePos); + InternalGalleryItemControl.SetScrollBarPosition( + InternalGalleryItemControl.ScrollBar.Position - GetMouseWheelStep); +end; + +procedure TdxRibbonDropDownGalleryControl.DoNCPaint(DC: HDC; const ARect: TRect); +begin + InternalPainter.SubMenuControlDrawBorder(Self, DC, ARect); +end; + +function TdxRibbonDropDownGalleryControl.DoFindLinkWithAccel(AKey: Word; + AShift: TShiftState; ACurrentLink: TdxBarItemLink): TdxBarItemLink; +begin + if (ACurrentLink <> nil) and (ACurrentLink.Control <> nil) and + (ACurrentLink.Control = InternalGalleryItemControl) then + Result := nil + else + Result := inherited DoFindLinkWithAccel(AKey, AShift, ACurrentLink); +end; + +function TdxRibbonDropDownGalleryControl.GetAccessibilityHelperClass: TdxBarAccessibilityHelperClass; +begin + Result := TdxRibbonDropDownGalleryControlAccessibilityHelper; +end; + +function TdxRibbonDropDownGalleryControl.GetClientOffset( + AIncludeDetachCaption: Boolean = True): TRect; +begin + Result := inherited GetClientOffset(AIncludeDetachCaption); + if Resizing <> gsrNone then + if IsSizingBandAtBottom then + Inc(Result.Bottom, InternalPainter.GetSizingBandHeight(Self)) + else + Inc(Result.Top, InternalPainter.GetSizingBandHeight(Self)) +end; + +function TdxRibbonDropDownGalleryControl.GetItemsPaneSize: TSize; +begin + Result := inherited GetItemsPaneSize; + Result.cx := Max(Result.cx, InternalGalleryItemControl.Width); + Inc(Result.cy, InternalGalleryItemControl.Height); +end; + +function TdxRibbonDropDownGalleryControl.GetMinSize: TSize; +var + I: Integer; + AItemsHeight: Integer; + AClientOffset: TRect; +begin + Result := InternalGalleryItemControl.ViewInfo.GetMinSize; + AItemsHeight := 0; + for I := 0 to ItemLinks.VisibleItemCount - 1 do + AItemsHeight := AItemsHeight + ItemLinks[I].ItemRect.Bottom - + ItemLinks[I].ItemRect.Top; + AClientOffset := GetClientOffset; + Result.cx := Result.cx + AClientOffset.Left + AClientOffset.Right; + Result.cy := Result.cy + AItemsHeight + AClientOffset.Top + + AClientOffset.Bottom; +end; + +function TdxRibbonDropDownGalleryControl.GetViewInfoClass: TCustomdxBarControlViewInfoClass; +begin + Result := TdxRibbonDropDownGalleryControlViewInfo; +end; + +function TdxRibbonDropDownGalleryControl.IsControlExists( + ABarItemControl: TdxBarItemControl): Boolean; +begin + Result := (ABarItemControl = InternalGalleryItemControl) or + inherited IsControlExists(ABarItemControl); +end; + +function TdxRibbonDropDownGalleryControl.IsSizingBandAtBottom: Boolean; +begin + Result := Top + IfThen(FUseInternalSizeValue, FHeight, Height) > OnShowTop; +end; + +function TdxRibbonDropDownGalleryControl.MustFitInWorkAreaWidth: Boolean; +begin + Result := True; +end; + +function TdxRibbonDropDownGalleryControl.NeedsMouseWheel: Boolean; +begin + Result := (SelectedControl = InternalGalleryItemControl) and + InternalGalleryItemControl.IsNeedScrollBar; +end; + +function TdxRibbonDropDownGalleryControl.NeedsSelectFirstItemOnDropDownByKey: Boolean; +begin + Result := False; +end; + +procedure TdxRibbonDropDownGalleryControl.Resize; +begin + InternalGalleryItemControl.SizeChanged := True; +end; + +procedure TdxRibbonDropDownGalleryControl.UpdateItem(AControl: TdxBarItemControl); +begin + cxInvalidateRect(Handle, GetItemRect(AControl), False); +end; + +function TdxRibbonDropDownGalleryControl.GetInternalGalleryItemControl: TdxRibbonGalleryControl; +begin + Result := TdxRibbonGalleryControl(FGalleryItemItemLinks[0].Control); +end; + +function TdxRibbonDropDownGalleryControl.GetInternalPainter: TdxRibbonDropDownGalleryControlPainter; +begin + if FInternalPainter = nil then + FInternalPainter := TdxRibbonDropDownGalleryControlPainter.Create( + Integer(TdxRibbonBarPainter(Painter).SkinnedObject)); + Result := FInternalPainter; +end; + +function TdxRibbonDropDownGalleryControl.GetMouseWheelStep: Integer; +begin + Result := IfThen(FMouseWheelStep = 0, + InternalGalleryItemControl.GetMouseWheelStep, FMouseWheelStep); +end; + +function TdxRibbonDropDownGalleryControl.GetResizing: TdxRibbonGallerySubMenuResizing; +begin + if FIsResizingAssigned then + Result := FResizing + else + Result := GalleryItem.GalleryOptions.SubMenuResizing; +end; + +procedure TdxRibbonDropDownGalleryControl.SetResizing( + Value: TdxRibbonGallerySubMenuResizing); +begin + FIsResizingAssigned := True; + FResizing := Value; +end; + +procedure TdxRibbonDropDownGalleryControl.WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); +var + S: TSize; +begin + with Message.MinMaxInfo^, Constraints do + begin + S := GetMinSize; + with ptMinTrackSize do + begin + X := S.cx; + Y := S.cy; + end; + end; + inherited; +end; + +procedure TdxRibbonDropDownGalleryControl.WMNCHitTest(var Message: TWMNCHitTest); +const + ANCHitTestConsts: array[Boolean, gsrHeight..gsrWidthAndHeight] of Longint = ( + (HTTOP, HTTOPRIGHT), + (HTBOTTOM, HTBOTTOMRIGHT) + ); +begin + inherited; + if (Resizing <> gsrNone) and InternalPainter.PtInSizingArea(Self, + cxPointOffset(SmallPointToPoint(Message.Pos), -Left, -Top)) then + Message.Result := ANCHitTestConsts[IsSizingBandAtBottom, Resizing]; +end; + +procedure TdxRibbonDropDownGalleryControl.WMNCLButtonDown( + var Message: TWMLButtonDown); +begin + SetKeySelectedItem(nil); + inherited; +end; + +{ TdxRibbonDropDownGalleryControlViewInfo } + +procedure TdxRibbonDropDownGalleryControlViewInfo.Calculate; +var + AGalleryItemControl: TdxRibbonGalleryControl; +begin + inherited Calculate; + AGalleryItemControl := BarControl.InternalGalleryItemControl; + AddItemControlViewInfo(AGalleryItemControl.ViewInfo); + IdxBarItemControlViewInfo(AGalleryItemControl.ViewInfo).SetBounds( + BarControl.GetItemRect(AGalleryItemControl)); +end; + +function TdxRibbonDropDownGalleryControlViewInfo.GetBarControl: TdxRibbonDropDownGalleryControl; +begin + Result := TdxRibbonDropDownGalleryControl(FBarControl); +end; + +initialization + RegisterClasses([TdxRibbonDropDownGallery]); + dxBarRegisterItem(TdxRibbonGalleryItem, TdxRibbonGalleryControl, True); + +finalization + dxBarUnregisterItem(TdxRibbonGalleryItem); +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxRibbonGalleryFilterEd.dfm b/official/x.35/ExpressBars 6/Sources/dxRibbonGalleryFilterEd.dfm new file mode 100644 index 00000000..04d280bd --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxRibbonGalleryFilterEd.dfm @@ -0,0 +1,59 @@ +object fmGalleryFilterGroups: TfmGalleryFilterGroups + Left = 0 + Top = 0 + AutoScroll = False + BorderStyle = bsSizeToolWin + Caption = 'fmGalleryFilterGroups' + ClientHeight = 265 + ClientWidth = 423 + Color = clBtnFace + Constraints.MinHeight = 250 + Constraints.MinWidth = 350 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object GroupBox1: TGroupBox + Left = 8 + Top = 8 + Width = 306 + Height = 250 + Anchors = [akLeft, akTop, akRight, akBottom] + Caption = ' Groups ' + TabOrder = 0 + object clbGroups: TCheckListBox + Left = 8 + Top = 16 + Width = 289 + Height = 225 + Anchors = [akLeft, akTop, akRight, akBottom] + ItemHeight = 13 + TabOrder = 0 + end + end + object btnOk: TButton + Left = 320 + Top = 23 + Width = 95 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'OK' + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 320 + Top = 54 + Width = 95 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end +end diff --git a/official/x.35/ExpressBars 6/Sources/dxRibbonGalleryFilterEd.pas b/official/x.35/ExpressBars 6/Sources/dxRibbonGalleryFilterEd.pas new file mode 100644 index 00000000..12753332 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxRibbonGalleryFilterEd.pas @@ -0,0 +1,88 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars components } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxRibbonGalleryFilterEd; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, CheckLst, dxRibbonGallery; + +type + TfmGalleryFilterGroups = class(TForm) + clbGroups: TCheckListBox; + GroupBox1: TGroupBox; + btnOk: TButton; + btnCancel: TButton; + public + procedure Init(AFilterCategory: TdxRibbonGalleryFilterCategory); + procedure Apply(AFilterCategory: TdxRibbonGalleryFilterCategory); + end; + +implementation + +{$R *.dfm} + +{ TfmGalleryFilterGroups } + +procedure TfmGalleryFilterGroups.Apply( + AFilterCategory: TdxRibbonGalleryFilterCategory); +var + I: Integer; +begin + AFilterCategory.Groups.Clear; + for I := 0 to clbGroups.Items.Count - 1 do + if clbGroups.Checked[I] then + AFilterCategory.Groups.Add(TdxRibbonGalleryGroup(clbGroups.Items.Objects[I])); +end; + +procedure TfmGalleryFilterGroups.Init( + AFilterCategory: TdxRibbonGalleryFilterCategory); +var + I: Integer; + AGroup: TdxRibbonGalleryGroup; +begin + Caption := Format('Editing %s.GalleryFilter.Categories[%d].Groups', [AFilterCategory.GalleryItem.Name, + AFilterCategory.Index]); + clbGroups.Clear; + for I := 0 to AFilterCategory.GalleryItem.GalleryGroups.Count - 1 do + begin + AGroup := AFilterCategory.GalleryItem.GalleryGroups[I]; + clbGroups.Items.AddObject(Format('%d - "%s"', [I, AGroup.Header.Caption]), AGroup); + clbGroups.Checked[I] := AFilterCategory.Groups.IndexOf(AGroup) >= 0; + end; +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxRibbonGalleryReg.pas b/official/x.35/ExpressBars 6/Sources/dxRibbonGalleryReg.pas new file mode 100644 index 00000000..b5c351e8 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxRibbonGalleryReg.pas @@ -0,0 +1,103 @@ +unit dxRibbonGalleryReg; + +{$I cxVer.inc} + +interface + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI6} + DesignIntf, DesignEditors, +{$ELSE} + DsgnIntf, +{$ENDIF} + Classes, Graphics, ImgList, dxBar, cxLibraryReg, dxBarReg, dxRibbonGallery, + cxPropEditors, Controls, dxRibbonGalleryFilterEd; + +type + { TdxRibboGalleryImageIndexProperty } + + TdxRibbonGalleryImageIndexProperty = class(TImageIndexProperty) + private + function GetGroup: TdxRibbonGalleryGroup; + protected + property Group: TdxRibbonGalleryGroup read GetGroup; + public + function GetImages: TCustomImageList; override; + end; + + { TdxRibbonGalleryFilterGroupsProperty } + + TdxRibbonGalleryFilterGroupsProperty = class(TClassProperty) + protected + function GetAttributes: TPropertyAttributes; override; + function FilterCategory: TdxRibbonGalleryFilterCategory; + public + procedure Edit; override; + end; + + TdxRibbonGalleryGroupAccess = class(TdxRibbonGalleryGroup); + +{ TdxRibboGalleryImageIndexProperty } + +function TdxRibbonGalleryImageIndexProperty.GetImages: TCustomImageList; +begin + Result := TdxRibbonGalleryGroupAccess(Group).Images; +end; + +function TdxRibbonGalleryImageIndexProperty.GetGroup: TdxRibbonGalleryGroup; +begin + Result := (GetComponent(0) as TdxRibbonGalleryGroupItem).Group; +end; + +{ TdxRibbonGalleryFilterGroupsProperty } + +procedure TdxRibbonGalleryFilterGroupsProperty.Edit; +begin + with TfmGalleryFilterGroups.Create(nil) do + try + Init(FilterCategory); + if ShowModal = mrOk then + begin + Apply(FilterCategory); + dxBarDesignerModified(FilterCategory.GalleryItem.BarManager); + end; + finally + Free; + end; +end; + +function TdxRibbonGalleryFilterGroupsProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paDialog, paReadOnly{$IFDEF DELPHI9}, paValueEditable{$ENDIF}]; +end; + +function TdxRibbonGalleryFilterGroupsProperty.FilterCategory: TdxRibbonGalleryFilterCategory; +begin + Result := TdxRibbonGalleryFilterCategoryGroups(GetOrdValue).FilterCategory; +end; + +procedure Register; +begin + RegisterComponents('ExpressBars', [TdxRibbonDropDownGallery]); + RegisterNoIcon([TdxRibbonGalleryItem]); + + RegisterPropertyEditor(TypeInfo(TBitmap), TdxRibbonGalleryGroupItem, + 'Glyph', TcxBitmapProperty); + RegisterPropertyEditor(TypeInfo(TImageIndex), TdxRibbonGalleryGroupItem, + 'ImageIndex', TdxRibbonGalleryImageIndexProperty); + RegisterPropertyEditor(TypeInfo(TdxBarItemLinks), TdxRibbonGalleryItem, + 'ItemLinks', TdxBarItemLinksPropertyEditor); + RegisterPropertyEditor(TypeInfo(TList), TdxRibbonGalleryFilterCategory, + 'Groups', TdxRibbonGalleryFilterGroupsProperty); + HideClassProperties(TdxRibbonGalleryItem, ['Detachable', 'DetachingBar', + 'OnDetaching']); + HideClassProperties(TdxRibbonDropDownGallery, ['BackgroundBitmap', + 'BarManager', 'UseRecentItems']); + HideClassProperties(TdxRibbonGalleryOptions, ['ShowScrollBar']); +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxRibbonGroupLayoutCalculator.pas b/official/x.35/ExpressBars 6/Sources/dxRibbonGroupLayoutCalculator.pas new file mode 100644 index 00000000..a35b9eb9 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxRibbonGroupLayoutCalculator.pas @@ -0,0 +1,1072 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars components } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxRibbonGroupLayoutCalculator; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Windows, Classes, dxBar, dxRibbon; + +type + { TdxRibbonGroupLayoutCalculator } + + TSequenceForWholeGroupHeightReducingItem = record + ItemControlViewInfo: IdxBarItemControlViewInfo; + OneRowHeightItemControlsBefore: Integer; + OneRowHeightItemControlsAfter: Integer; + end; + TSequenceForWholeGroupHeightReducing = array of TSequenceForWholeGroupHeightReducingItem; + TSequencesForWholeGroupHeightReducing = array of TSequenceForWholeGroupHeightReducing; + + TdxRibbonGroupLayoutCalculator = class(TInterfacedObject, + IdxRibbonGroupLayoutCalculator) + private + FColumnCount: Integer; + FGroupRowCount: Integer; + FGroupRowHeight: Integer; + FItemControlColumns: array of Integer; + FItemControlIndexForOneRowHeightReducing: Integer; + FItemControlSeparators: array of Integer; + FLastSequenceForWholeGroupHeightReducing: Integer; + FSequencesForWholeGroupHeightReducing: TSequencesForWholeGroupHeightReducing; + X: Integer; + procedure AlignOneRowHeightItemControl( + AItemControlViewInfo: IdxBarItemControlViewInfo; AColumnWidth: Integer); + procedure AlignOneRowHeightItemControls( + AGroupViewInfo: IdxRibbonGroupViewInfo; AFirstIndex, AColumnWidth: Integer); + procedure CheckDistanceBetweenTwoLastColumns( + AGroupViewInfo: IdxRibbonGroupViewInfo; ALastItemControlIndex: Integer); + procedure DistributeOneRowHeightItemControlsOnGroupHeight( + AGroupViewInfo: IdxRibbonGroupViewInfo; AFirstIndex, ALastIndex: Integer); + function GetGroupHeight: Integer; + procedure IncrementColumnCount(AGroupViewInfo: IdxRibbonGroupViewInfo; + ALastItemControlIndex: Integer); + procedure OffsetContent(AGroupViewInfo: IdxRibbonGroupViewInfo; + AFirstItemControlIndex, ALastItemControlIndex, AOffset: Integer); + procedure PlaceOneRowHeightItemControls( + AGroupViewInfo: IdxRibbonGroupViewInfo; AFirstIndex, ALastIndex: Integer; + ADistributeOnGroupHeight: Boolean); + procedure PlaceSeparator(AGroupViewInfo: IdxRibbonGroupViewInfo; + AItemControlIndex: Integer); + procedure PlaceWholeGroupHeightItemControl( + AGroupViewInfo: IdxRibbonGroupViewInfo; AIndex: Integer); + function ReduceOneRowHeightItemControlsWithText( + AGroupViewInfo: IdxRibbonGroupViewInfo; + AUpToViewLevel: TdxBarItemRealViewLevel): Boolean; + function ReduceSequenceForWholeGroupHeightReducing( + ASequenceIndex: Integer): Boolean; + function ReduceWholeGroupHeightItemControls( + AGroupViewInfo: IdxRibbonGroupViewInfo): Boolean; + protected + property GroupRowCount: Integer read FGroupRowCount; + property GroupRowHeight: Integer read FGroupRowHeight; + public + constructor Create(AGroupRowHeight, AGroupRowCount: Integer); + // IdxRibbonGroupLayoutCalculator + procedure CalcInit(AGroupViewInfo: IdxRibbonGroupViewInfo); + procedure CalcLayout(AGroupViewInfo: IdxRibbonGroupViewInfo); + function CollapseMultiColumnItemControls( + AGroupViewInfo: IdxRibbonGroupViewInfo): Boolean; + function DecreaseMultiColumnItemControlsColumnCount( + AGroupViewInfo: IdxRibbonGroupViewInfo): Boolean; + function Reduce(AGroupViewInfo: IdxRibbonGroupViewInfo; + AUpToViewLevel: TdxBarItemRealViewLevel): Boolean; + procedure ReduceInit(AGroupViewInfo: IdxRibbonGroupViewInfo); + end; + +procedure CalcItemControlsRealPositionInButtonGroup(AItemControlViewInfos: TList); + +implementation + +uses + SysUtils, cxClasses, cxGeometry, cxGraphics, Math; + +const + dxRibbonGroupMinContentWidth = 30; + + dxRibbonItemSeparatorTopOffset = 5; + dxRibbonItemSeparatorBottomOffset = 6; + dxRibbonItemSeparatorAreaWidth = 8; + +procedure FindFirstElementOfSequenceForWholeGroupHeightReducing( + AGroupViewInfo: IdxRibbonGroupViewInfo; var AFirstIndex: Integer; + out AOneRowHeightItemControlCount: Integer); forward; +procedure FindSequenceForWholeGroupHeightReducing( + AGroupViewInfo: IdxRibbonGroupViewInfo; var AFirstIndex: Integer; + out ASequence: TSequenceForWholeGroupHeightReducing); forward; +function GetItemControlCurrentWidth( + AItemControlViewInfo: IdxBarItemControlViewInfo): Integer; forward; +function IsNewColumnItemControl( + AItemControlViewInfo: IdxBarItemControlViewInfo): Boolean; overload; forward; +function IsNewColumnItemControl(AGroupViewInfo: IdxRibbonGroupViewInfo; + AItemControlIndex: Integer): Boolean; overload; forward; +function IsPartOfHorizontalBox(AGroupViewInfo: IdxRibbonGroupViewInfo; + AItemControlIndex: Integer): Boolean; forward; +function IsWholeGroupHeightItemControl( + AItemControlViewInfo: IdxBarItemControlViewInfo): Boolean; overload; forward; +function IsWholeGroupHeightItemControl(AGroupViewInfo: IdxRibbonGroupViewInfo; + AItemControlIndex: Integer): Boolean; overload; forward; +function IsWholeGroupHeightOnlyItemControl( + AItemControlViewInfo: IdxBarItemControlViewInfo): Boolean; overload; forward; +function IsWholeGroupHeightOnlyItemControl(AGroupViewInfo: IdxRibbonGroupViewInfo; + AItemControlIndex: Integer): Boolean; overload; forward; +function SkipHorizontalBox(AGroupViewInfo: IdxRibbonGroupViewInfo; + var AFirstIndex: Integer; out AIsWholeGroupHeightBox: Boolean): Boolean; forward; + +procedure CalcItemControlsRealPositionInButtonGroup(AItemControlViewInfos: TList); + + function GetItemControlViewInfo(AItemControlIndex: Integer): IdxBarItemControlViewInfo; + begin + Result := IdxBarItemControlViewInfo(AItemControlViewInfos[AItemControlIndex]); + end; + + function GetItemControlPositionInButtonGroup( + AItemControlViewInfo: IdxBarItemControlViewInfo): TdxBarButtonGroupPosition; + begin + Result := AItemControlViewInfo.GetPositionInButtonGroup; + if IsWholeGroupHeightOnlyItemControl(AItemControlViewInfo) then + Result := bgpNone; + end; + + function NextItemControlIsMemberOfButtonGroup(AItemControlIndex: Integer): Boolean; + var + AItemControlViewInfo: IdxBarItemControlViewInfo; + begin + Result := AItemControlIndex + 1 < AItemControlViewInfos.Count; + if Result then + begin + AItemControlViewInfo := GetItemControlViewInfo(AItemControlIndex + 1); + Result := (GetItemControlPositionInButtonGroup(AItemControlViewInfo) = bgpMember) and + not AItemControlViewInfo.HasSeparator; + end; + end; + + function GetItemControlRealPositionInButtonGroup( + AItemControlIndex: Integer): TdxBarButtonGroupRealPosition; + var + AItemControlViewInfo: IdxBarItemControlViewInfo; + begin + case GetItemControlPositionInButtonGroup(GetItemControlViewInfo(AItemControlIndex)) of + bgpStart: + if NextItemControlIsMemberOfButtonGroup(AItemControlIndex) then + Result := bgrpStart + else + Result := bgrpSingle; + bgpMember: + begin + Result := bgrpNone; + if not (GetItemControlViewInfo(AItemControlIndex).HasSeparator) and + (AItemControlIndex > 0) then + begin + AItemControlViewInfo := GetItemControlViewInfo(AItemControlIndex - 1); + if AItemControlViewInfo.GetRealPositionInButtonGroup in [bgrpStart, bgrpMember] then + begin + if NextItemControlIsMemberOfButtonGroup(AItemControlIndex) then + Result := bgrpMember + else + Result := bgrpFinish; + end; + end; + end; + else + Result := bgrpNone; + end; + end; + +var + I: Integer; +begin + for I := 0 to AItemControlViewInfos.Count - 1 do + GetItemControlViewInfo(I).SetRealPositionInButtonGroup( + GetItemControlRealPositionInButtonGroup(I)); +end; + +procedure FindFirstElementOfSequenceForWholeGroupHeightReducing( + AGroupViewInfo: IdxRibbonGroupViewInfo; var AFirstIndex: Integer; + out AOneRowHeightItemControlCount: Integer); +var + AIsWholeGroupHeightHorizontalBox: Boolean; +begin + AOneRowHeightItemControlCount := 0; + repeat + if IsWholeGroupHeightOnlyItemControl(AGroupViewInfo, AFirstIndex) then + begin + Inc(AFirstIndex); + Continue; + end; + if not SkipHorizontalBox(AGroupViewInfo, AFirstIndex, AIsWholeGroupHeightHorizontalBox) then + begin + if not IsWholeGroupHeightItemControl(AGroupViewInfo, AFirstIndex) then + begin + Inc(AOneRowHeightItemControlCount); + Inc(AFirstIndex); + end; + Break; + end; + if not AIsWholeGroupHeightHorizontalBox then + begin + Inc(AOneRowHeightItemControlCount); + Break; + end; + until AFirstIndex >= AGroupViewInfo.GetItemControlCount; +end; + +procedure FindSequenceForWholeGroupHeightReducing( + AGroupViewInfo: IdxRibbonGroupViewInfo; var AFirstIndex: Integer; + out ASequence: TSequenceForWholeGroupHeightReducing); + +var + AIsHorizontalBox, AIsWholeGroupHeightHorizontalBox: Boolean; + AOneRowHeightItemControlCount: Integer; +begin + SetLength(ASequence, 0); + if AFirstIndex >= AGroupViewInfo.GetItemControlCount then + Exit; + FindFirstElementOfSequenceForWholeGroupHeightReducing(AGroupViewInfo, + AFirstIndex, AOneRowHeightItemControlCount); + if AFirstIndex >= AGroupViewInfo.GetItemControlCount then + Exit; + if IsWholeGroupHeightItemControl(AGroupViewInfo, AFirstIndex) then + begin + SetLength(ASequence, Length(ASequence) + 1); + with ASequence[Length(ASequence) - 1] do + begin + ItemControlViewInfo := AGroupViewInfo.GetItemControlViewInfo(AFirstIndex); + OneRowHeightItemControlsBefore := AOneRowHeightItemControlCount; + OneRowHeightItemControlsAfter := 0; + end; + AOneRowHeightItemControlCount := 0; + Inc(AFirstIndex); + end; + while AFirstIndex < AGroupViewInfo.GetItemControlCount do + begin + if IsWholeGroupHeightOnlyItemControl(AGroupViewInfo, AFirstIndex) or + IsNewColumnItemControl(AGroupViewInfo, AFirstIndex) then + Break; + AIsHorizontalBox := SkipHorizontalBox(AGroupViewInfo, AFirstIndex, + AIsWholeGroupHeightHorizontalBox); + if AIsHorizontalBox and AIsWholeGroupHeightHorizontalBox then + Break; + if AIsHorizontalBox or not IsWholeGroupHeightItemControl(AGroupViewInfo, AFirstIndex) then + begin + if not AIsHorizontalBox then + Inc(AFirstIndex); + Inc(AOneRowHeightItemControlCount); + Continue; + end + else + begin + if Length(ASequence) > 0 then + ASequence[Length(ASequence) - 1].OneRowHeightItemControlsAfter := AOneRowHeightItemControlCount; + SetLength(ASequence, Length(ASequence) + 1); + with ASequence[Length(ASequence) - 1] do + begin + ItemControlViewInfo := AGroupViewInfo.GetItemControlViewInfo(AFirstIndex); + OneRowHeightItemControlsBefore := AOneRowHeightItemControlCount; + OneRowHeightItemControlsAfter := 0; + end; + AOneRowHeightItemControlCount := 0; + Inc(AFirstIndex); + end; + end; + if (Length(ASequence) > 0) and (AOneRowHeightItemControlCount > 0) then + ASequence[Length(ASequence) - 1].OneRowHeightItemControlsAfter := AOneRowHeightItemControlCount; + if (Length(ASequence) = 0) and (AFirstIndex < AGroupViewInfo.GetItemControlCount) then + FindSequenceForWholeGroupHeightReducing(AGroupViewInfo, AFirstIndex, ASequence); +end; + +function GetItemControlCurrentWidth( + AItemControlViewInfo: IdxBarItemControlViewInfo): Integer; +begin + Result := AItemControlViewInfo.GetWidth(AItemControlViewInfo.GetViewLevel); +end; + +function IsNewColumnItemControl( + AItemControlViewInfo: IdxBarItemControlViewInfo): Boolean; overload; +begin + Result := AItemControlViewInfo.HasSeparator or + (AItemControlViewInfo.GetPosition = ipBeginsNewColumn) and + (AItemControlViewInfo.GetRealPositionInButtonGroup in [bgrpNone, bgrpStart, bgrpSingle]); +end; + +function IsNewColumnItemControl(AGroupViewInfo: IdxRibbonGroupViewInfo; + AItemControlIndex: Integer): Boolean; overload; +begin + Result := IsNewColumnItemControl( + AGroupViewInfo.GetItemControlViewInfo(AItemControlIndex)); +end; + +function IsPartOfHorizontalBox(AGroupViewInfo: IdxRibbonGroupViewInfo; + AItemControlIndex: Integer): Boolean; +var + AItemControlViewInfo: IdxBarItemControlViewInfo; +begin + if AGroupViewInfo.GetItemControlViewInfo(AItemControlIndex).GetRealPositionInButtonGroup in [bgrpStart, bgrpMember, bgrpFinish] then + begin + Result := True; + Exit; + end; + Result := False; + if AItemControlIndex + 1 < AGroupViewInfo.GetItemControlCount then + begin + AItemControlViewInfo := AGroupViewInfo.GetItemControlViewInfo(AItemControlIndex + 1); + Result := not IsNewColumnItemControl(AItemControlViewInfo) and + (AItemControlViewInfo.GetPosition = ipContinuesRow); + end; + if not Result then + begin + AItemControlViewInfo := AGroupViewInfo.GetItemControlViewInfo(AItemControlIndex); + Result := (AItemControlViewInfo.GetPosition = ipContinuesRow) and + (AItemControlIndex > 0) and not IsNewColumnItemControl(AItemControlViewInfo); + end; +end; + +function IsWholeGroupHeightItemControl( + AItemControlViewInfo: IdxBarItemControlViewInfo): Boolean; overload; +var + AMultiColumnItemControlViewInfo: IdxBarMultiColumnItemControlViewInfo; +begin + Result := AItemControlViewInfo.IsMultiColumnItemControl(True, AMultiColumnItemControlViewInfo) or + (AItemControlViewInfo.GetViewLevel = ivlLargeIconWithText); +end; + +function IsWholeGroupHeightItemControl(AGroupViewInfo: IdxRibbonGroupViewInfo; + AItemControlIndex: Integer): Boolean; overload; +begin + Result := IsWholeGroupHeightItemControl( + AGroupViewInfo.GetItemControlViewInfo(AItemControlIndex)); +end; + +function IsWholeGroupHeightOnlyItemControl( + AItemControlViewInfo: IdxBarItemControlViewInfo): Boolean; overload; +var + AMultiColumnItemControlViewInfo: IdxBarMultiColumnItemControlViewInfo; +begin + Result := AItemControlViewInfo.IsMultiColumnItemControl(True, AMultiColumnItemControlViewInfo) or + (AItemControlViewInfo.GetAllowedViewLevels = [ivlLargeIconWithText]); +end; + +function IsWholeGroupHeightOnlyItemControl(AGroupViewInfo: IdxRibbonGroupViewInfo; + AItemControlIndex: Integer): Boolean; overload; +begin + Result := IsWholeGroupHeightOnlyItemControl(AGroupViewInfo.GetItemControlViewInfo(AItemControlIndex)); +end; + +function SkipHorizontalBox(AGroupViewInfo: IdxRibbonGroupViewInfo; + var AFirstIndex: Integer; out AIsWholeGroupHeightBox: Boolean): Boolean; +begin + Result := IsPartOfHorizontalBox(AGroupViewInfo, AFirstIndex); + if Result then + begin + AIsWholeGroupHeightBox := False; + repeat + AIsWholeGroupHeightBox := AIsWholeGroupHeightBox or + IsWholeGroupHeightItemControl(AGroupViewInfo, AFirstIndex); + Inc(AFirstIndex); + until (AFirstIndex >= AGroupViewInfo.GetItemControlCount) or + not IsPartOfHorizontalBox(AGroupViewInfo, AFirstIndex); + end; +end; + +{ TdxRibbonGroupLayoutCalculator } + +constructor TdxRibbonGroupLayoutCalculator.Create( + AGroupRowHeight, AGroupRowCount: Integer); +begin + inherited Create; + FGroupRowCount := AGroupRowCount; + FGroupRowHeight := AGroupRowHeight; +end; + +// IdxRibbonGroupLayoutCalculator +procedure TdxRibbonGroupLayoutCalculator.CalcInit( + AGroupViewInfo: IdxRibbonGroupViewInfo); +var + AItemControlViewInfo: IdxBarItemControlViewInfo; + AItemControlViewInfos: TList; + AMultiColumnItemControlViewInfo: IdxBarMultiColumnItemControlViewInfo; + I: Integer; +begin + AItemControlViewInfos := TList.Create; + try + for I := 0 to AGroupViewInfo.GetItemControlCount - 1 do + AItemControlViewInfos.Add(Pointer(AGroupViewInfo.GetItemControlViewInfo(I))); + CalcItemControlsRealPositionInButtonGroup(AItemControlViewInfos); + finally + AItemControlViewInfos.Free; + end; + + for I := 0 to AGroupViewInfo.GetItemControlCount - 1 do + begin + AItemControlViewInfo := AGroupViewInfo.GetItemControlViewInfo(I); + AItemControlViewInfo.SetBounds(cxEmptyRect); + if AItemControlViewInfo.GetRealPositionInButtonGroup = bgrpNone then + AItemControlViewInfo.SetViewLevel(GetMaxViewLevel(AItemControlViewInfo.GetAllowedViewLevels)) + else + AItemControlViewInfo.SetViewLevel(AItemControlViewInfo.GetViewLevelForButtonGroup); + if AItemControlViewInfo.IsMultiColumnItemControl(False, AMultiColumnItemControlViewInfo) then + begin + AMultiColumnItemControlViewInfo.SetCollapsed(False); + AMultiColumnItemControlViewInfo.SetColumnCount(AMultiColumnItemControlViewInfo.GetMaxColumnCount); + end; + end; +end; + +procedure TdxRibbonGroupLayoutCalculator.CalcLayout( + AGroupViewInfo: IdxRibbonGroupViewInfo); + + procedure CheckGroupMinContentWidth; + var + AMinContentWidth: Integer; + begin + AMinContentWidth := AGroupViewInfo.GetMinContentWidth; + if AMinContentWidth < dxRibbonGroupMinContentWidth then + AMinContentWidth := dxRibbonGroupMinContentWidth; + if X < AMinContentWidth then + begin + if X <> 0 then + OffsetContent(AGroupViewInfo, 0, AGroupViewInfo.GetItemControlCount - 1, + (AMinContentWidth - X) div 2); + X := AMinContentWidth; + end; + end; + + procedure CalcLayoutFinalize; + var + I: Integer; + begin + for I := 0 to AGroupViewInfo.GetItemControlCount - 1 do + AGroupViewInfo.GetItemControlViewInfo(I).CalculateFinalize; + end; + +var + AItemControlViewInfo: IdxBarItemControlViewInfo; + I, J: Integer; +begin + AGroupViewInfo.DeleteSeparators; + FColumnCount := -1; + X := 0; + SetLength(FItemControlColumns, AGroupViewInfo.GetItemControlCount); + SetLength(FItemControlSeparators, AGroupViewInfo.GetItemControlCount); + for I := 0 to High(FItemControlSeparators) do + FItemControlSeparators[I] := -1; + I := 0; + while I < AGroupViewInfo.GetItemControlCount do + begin + J := I; + while J < AGroupViewInfo.GetItemControlCount do + begin + AItemControlViewInfo := AGroupViewInfo.GetItemControlViewInfo(J); + if IsWholeGroupHeightItemControl(AItemControlViewInfo) or + (J > I) and IsNewColumnItemControl(AItemControlViewInfo) then + Break; + Inc(J); + end; + if I < J then + begin + IncrementColumnCount(AGroupViewInfo, I - 1); + PlaceOneRowHeightItemControls(AGroupViewInfo, I, J - 1, True); + end; + I := J; + while (I < AGroupViewInfo.GetItemControlCount) and + IsWholeGroupHeightItemControl(AGroupViewInfo.GetItemControlViewInfo(I)) do + begin + IncrementColumnCount(AGroupViewInfo, I - 1); + PlaceWholeGroupHeightItemControl(AGroupViewInfo, I); + Inc(I); + end; + end; + CheckDistanceBetweenTwoLastColumns(AGroupViewInfo, AGroupViewInfo.GetItemControlCount - 1); + with AGroupViewInfo.GetOffsetsInfo do + begin + OffsetContent(AGroupViewInfo, 0, AGroupViewInfo.GetItemControlCount - 1, ContentLeftOffset); + Inc(X, ContentLeftOffset + ContentRightOffset); + end; + CheckGroupMinContentWidth; + AGroupViewInfo.SetContentSize(Size(X, GetGroupHeight)); + CalcLayoutFinalize; +end; + +function TdxRibbonGroupLayoutCalculator.CollapseMultiColumnItemControls( + AGroupViewInfo: IdxRibbonGroupViewInfo): Boolean; +var + AItemControlViewInfo: IdxBarItemControlViewInfo; + AMultiColumnItemControlViewInfo: IdxBarMultiColumnItemControlViewInfo; + I: Integer; +begin + Result := False; + if AGroupViewInfo.GetItemControlCount = 0 then + Exit; + for I := AGroupViewInfo.GetItemControlCount - 1 downto 0 do + begin + AItemControlViewInfo := AGroupViewInfo.GetItemControlViewInfo(I); + if AItemControlViewInfo.IsMultiColumnItemControl(True, AMultiColumnItemControlViewInfo) and + AMultiColumnItemControlViewInfo.CanCollapse then + begin + Result := True; + AMultiColumnItemControlViewInfo.SetCollapsed(True); + Break; + end; + end; + if Result then + CalcLayout(AGroupViewInfo); +end; + +function TdxRibbonGroupLayoutCalculator.DecreaseMultiColumnItemControlsColumnCount( + AGroupViewInfo: IdxRibbonGroupViewInfo): Boolean; +var + AItemControlViewInfo: IdxBarItemControlViewInfo; + AMultiColumnItemControlViewInfo: IdxBarMultiColumnItemControlViewInfo; + I: Integer; +begin + Result := False; + if AGroupViewInfo.GetItemControlCount = 0 then + Exit; + for I := AGroupViewInfo.GetItemControlCount - 1 downto 0 do + begin + AItemControlViewInfo := AGroupViewInfo.GetItemControlViewInfo(I); + if AItemControlViewInfo.IsMultiColumnItemControl(True, AMultiColumnItemControlViewInfo) and + (AMultiColumnItemControlViewInfo.GetColumnCount > AMultiColumnItemControlViewInfo.GetMinColumnCount) then + begin + Result := True; + AMultiColumnItemControlViewInfo.SetColumnCount(AMultiColumnItemControlViewInfo.GetColumnCount - 1); + Break; + end; + end; + if Result then + CalcLayout(AGroupViewInfo); +end; + +function TdxRibbonGroupLayoutCalculator.Reduce( + AGroupViewInfo: IdxRibbonGroupViewInfo; AUpToViewLevel: TdxBarItemRealViewLevel): Boolean; +begin + if AGroupViewInfo.GetItemControlCount = 0 then + Result := False + else + if Pred(AUpToViewLevel) = ivlLargeIconWithText then + Result := ReduceWholeGroupHeightItemControls(AGroupViewInfo) + else + begin + Result := ReduceOneRowHeightItemControlsWithText(AGroupViewInfo, AUpToViewLevel); + if not Result then + FItemControlIndexForOneRowHeightReducing := AGroupViewInfo.GetItemControlCount - 1; + end; +end; + +procedure TdxRibbonGroupLayoutCalculator.ReduceInit( + AGroupViewInfo: IdxRibbonGroupViewInfo); +var + AIndex, ASequenceCount: Integer; +begin + ASequenceCount := 0; + AIndex := 0; + repeat + SetLength(FSequencesForWholeGroupHeightReducing, ASequenceCount + 1); + FindSequenceForWholeGroupHeightReducing(AGroupViewInfo, AIndex, + FSequencesForWholeGroupHeightReducing[ASequenceCount]); + if Length(FSequencesForWholeGroupHeightReducing[ASequenceCount]) = 0 then + begin + SetLength(FSequencesForWholeGroupHeightReducing, ASequenceCount); + Break; + end; + Inc(ASequenceCount); + until False; + FLastSequenceForWholeGroupHeightReducing := ASequenceCount - 1; + FItemControlIndexForOneRowHeightReducing := AGroupViewInfo.GetItemControlCount - 1; +end; + +procedure TdxRibbonGroupLayoutCalculator.AlignOneRowHeightItemControl( + AItemControlViewInfo: IdxBarItemControlViewInfo; AColumnWidth: Integer); +var + R: TRect; +begin + R := AItemControlViewInfo.GetBounds; + case AItemControlViewInfo.GetAlign of + iaCenter: + OffsetRect(R, (AColumnWidth - cxRectWidth(R)) div 2, 0); + iaRight: + OffsetRect(R, AColumnWidth - cxRectWidth(R), 0); + iaClient: + R.Right := R.Left + AColumnWidth; + end; + AItemControlViewInfo.SetBounds(R); +end; + +procedure TdxRibbonGroupLayoutCalculator.AlignOneRowHeightItemControls( + AGroupViewInfo: IdxRibbonGroupViewInfo; AFirstIndex, AColumnWidth: Integer); + + function SkipRowWithSeveralItemControls: Boolean; + var + AColumn, ARow: Integer; + begin + Result := False; + AColumn := FItemControlColumns[AFirstIndex]; + ARow := AGroupViewInfo.GetItemControlViewInfo(AFirstIndex).GetRow; + while (AFirstIndex + 1 < AGroupViewInfo.GetItemControlCount) and + (FItemControlColumns[AFirstIndex + 1] = AColumn) and + (AGroupViewInfo.GetItemControlViewInfo(AFirstIndex + 1).GetRow = ARow) do + begin + Result := True; + Inc(AFirstIndex); + end; + if Result then + Inc(AFirstIndex); + end; + +var + AColumn: Integer; +begin + AColumn := FItemControlColumns[AFirstIndex]; + while (AFirstIndex < AGroupViewInfo.GetItemControlCount) and + (FItemControlColumns[AFirstIndex] = AColumn) do + begin + if SkipRowWithSeveralItemControls then // TODO by first ItemControl + Continue; + AlignOneRowHeightItemControl(AGroupViewInfo.GetItemControlViewInfo(AFirstIndex), AColumnWidth); + Inc(AFirstIndex); + end; +end; + +procedure TdxRibbonGroupLayoutCalculator.CheckDistanceBetweenTwoLastColumns( + AGroupViewInfo: IdxRibbonGroupViewInfo; ALastItemControlIndex: Integer); + + function GetColumnFirstItemControlIndex(AColumnLastItemControlIndex: Integer): Integer; + var + AColumn: Integer; + begin + AColumn := FItemControlColumns[AColumnLastItemControlIndex]; + Result := AColumnLastItemControlIndex; + while (Result > 0) and (FItemControlColumns[Result - 1] = AColumn) do + Dec(Result); + end; + + procedure GetMaxBoundInfoForItemControls( + AFirstItemControlIndex, ALastItemControlIndex: Integer; + out AMaxRightBound, AMaxButtonGroupRightBound: Integer); + var + AItemControlViewInfo: IdxBarItemControlViewInfo; + I: Integer; + R: TRect; + begin + AMaxRightBound := -1; + AMaxButtonGroupRightBound := -1; + for I := AFirstItemControlIndex to ALastItemControlIndex do + begin + AItemControlViewInfo := AGroupViewInfo.GetItemControlViewInfo(I); + R := AItemControlViewInfo.GetBounds; + AMaxRightBound := Max(AMaxRightBound, R.Right); + if AItemControlViewInfo.GetRealPositionInButtonGroup in [bgrpFinish, bgrpSingle] then + AMaxButtonGroupRightBound := Max(AMaxButtonGroupRightBound, R.Right); + end; + end; + + procedure GetMinBoundInfoForItemControls( + AFirstItemControlIndex, ALastItemControlIndex: Integer; + out AMinLeftBound, AMinButtonGroupLeftBound: Integer); + var + AItemControlViewInfo: IdxBarItemControlViewInfo; + I: Integer; + begin + AMinLeftBound := AGroupViewInfo.GetItemControlViewInfo(AFirstItemControlIndex).GetBounds.Left; + AMinButtonGroupLeftBound := MaxInt; + for I := AFirstItemControlIndex to ALastItemControlIndex do + begin + AItemControlViewInfo := AGroupViewInfo.GetItemControlViewInfo(I); + if AItemControlViewInfo.GetRealPositionInButtonGroup in [bgrpStart, bgrpSingle] then + AMinButtonGroupLeftBound := Min(AMinButtonGroupLeftBound, + AItemControlViewInfo.GetBounds.Left); + end; + end; + +var + AFirstColumnFirstItemControlIndex, AFirstColumnLastItemControlIndex: Integer; + ASecondColumnFirstItemControlIndex, ASecondColumnLastItemControlIndex: Integer; + AFirstColumnMaxItemControlRightBound, AFirstColumnMaxButtonGroupRightBound: Integer; + ASecondColumnMinItemControlLeftBound, ASecondColumnMinButtonGroupLeftBound: Integer; + AButtonGroupOffset, AOffset, AOffset1, AOffset2: Integer; +begin + if FColumnCount < 1 then + Exit; + ASecondColumnLastItemControlIndex := ALastItemControlIndex; + ASecondColumnFirstItemControlIndex := GetColumnFirstItemControlIndex( + ASecondColumnLastItemControlIndex); + if AGroupViewInfo.GetItemControlViewInfo(ASecondColumnFirstItemControlIndex).HasSeparator then + Exit; + AFirstColumnLastItemControlIndex := ASecondColumnFirstItemControlIndex - 1; + AFirstColumnFirstItemControlIndex := GetColumnFirstItemControlIndex( + AFirstColumnLastItemControlIndex); + GetMaxBoundInfoForItemControls(AFirstColumnFirstItemControlIndex, AFirstColumnLastItemControlIndex, + AFirstColumnMaxItemControlRightBound, AFirstColumnMaxButtonGroupRightBound); + GetMinBoundInfoForItemControls(ASecondColumnFirstItemControlIndex, ASecondColumnLastItemControlIndex, + ASecondColumnMinItemControlLeftBound, ASecondColumnMinButtonGroupLeftBound); + + AButtonGroupOffset := AGroupViewInfo.GetOffsetsInfo.ButtonGroupOffset; + AOffset1 := 0; + if (AFirstColumnMaxButtonGroupRightBound <> -1) and + (ASecondColumnMinItemControlLeftBound - AFirstColumnMaxButtonGroupRightBound < AButtonGroupOffset) then + AOffset1 := AButtonGroupOffset - (ASecondColumnMinItemControlLeftBound - AFirstColumnMaxButtonGroupRightBound); + AOffset2 := 0; + if (ASecondColumnMinButtonGroupLeftBound <> MaxInt) and + (ASecondColumnMinButtonGroupLeftBound - AFirstColumnMaxItemControlRightBound < AButtonGroupOffset) then + AOffset2 := AButtonGroupOffset - (ASecondColumnMinButtonGroupLeftBound - AFirstColumnMaxItemControlRightBound); + AOffset := Max(AOffset1, AOffset2); + if AOffset <> 0 then + begin + OffsetContent(AGroupViewInfo, ASecondColumnFirstItemControlIndex, ASecondColumnLastItemControlIndex, AOffset); + Inc(X, AOffset); + end; +end; + +procedure TdxRibbonGroupLayoutCalculator.DistributeOneRowHeightItemControlsOnGroupHeight( + AGroupViewInfo: IdxRibbonGroupViewInfo; AFirstIndex, ALastIndex: Integer); +var + AColumn, AIndex, ARowCount, I: Integer; + AItemControlViewInfo: IdxBarItemControlViewInfo; + R: TRect; +begin + AColumn := FItemControlColumns[AFirstIndex]; + AIndex := AFirstIndex + 1; + while (AIndex <= ALastIndex) and (FItemControlColumns[AIndex] = AColumn) do + Inc(AIndex); + Dec(AIndex); + ARowCount := AGroupViewInfo.GetItemControlViewInfo(AIndex).GetRow + 1; + if ARowCount < GroupRowCount then + for I := AFirstIndex to AIndex do + begin + AItemControlViewInfo := AGroupViewInfo.GetItemControlViewInfo(I); + R := AItemControlViewInfo.GetBounds; + R.Top := GetGroupHeight - ((GetGroupHeight - GroupRowHeight * ARowCount) div (ARowCount + 1) + GroupRowHeight) * (ARowCount - AGroupViewInfo.GetItemControlViewInfo(I).GetRow); + R.Bottom := R.Top + GroupRowHeight; + AItemControlViewInfo.SetBounds(R); + end; + for I := AFirstIndex to AIndex do + AGroupViewInfo.GetItemControlViewInfo(I).SetColumnRowCount(ARowCount); + Inc(AIndex); + if AIndex <= ALastIndex then + DistributeOneRowHeightItemControlsOnGroupHeight(AGroupViewInfo, AIndex, ALastIndex); +end; + +function TdxRibbonGroupLayoutCalculator.GetGroupHeight: Integer; +begin + Result := GroupRowHeight * GroupRowCount; +end; + +procedure TdxRibbonGroupLayoutCalculator.IncrementColumnCount( + AGroupViewInfo: IdxRibbonGroupViewInfo; ALastItemControlIndex: Integer); +begin + CheckDistanceBetweenTwoLastColumns(AGroupViewInfo, ALastItemControlIndex); + Inc(FColumnCount); +end; + +procedure TdxRibbonGroupLayoutCalculator.OffsetContent( + AGroupViewInfo: IdxRibbonGroupViewInfo; + AFirstItemControlIndex, ALastItemControlIndex, AOffset: Integer); +var + AItemControlViewInfo: IdxBarItemControlViewInfo; + ASeparatorInfo: TdxBarItemSeparatorInfo; + I: Integer; + R: TRect; +begin + for I := AFirstItemControlIndex to ALastItemControlIndex do + begin + AItemControlViewInfo := AGroupViewInfo.GetItemControlViewInfo(I); + R := AItemControlViewInfo.GetBounds; + OffsetRect(R, AOffset, 0); + AItemControlViewInfo.SetBounds(R); + if FItemControlSeparators[I] <> -1 then + begin + ASeparatorInfo := AGroupViewInfo.GetSeparatorInfo(FItemControlSeparators[I]); + OffsetRect(ASeparatorInfo.Bounds, AOffset, 0); + AGroupViewInfo.SetSeparatorInfo(FItemControlSeparators[I], ASeparatorInfo); + end; + end; +end; + +procedure TdxRibbonGroupLayoutCalculator.PlaceOneRowHeightItemControls( + AGroupViewInfo: IdxRibbonGroupViewInfo; AFirstIndex, ALastIndex: Integer; + ADistributeOnGroupHeight: Boolean); +var + AItemControlViewInfo: IdxBarItemControlViewInfo; + AColumnFirstItemControlIntex, AItemControlWidth, AMaxRowX, ARow, ARowX, I: Integer; +begin + if AGroupViewInfo.GetItemControlViewInfo(AFirstIndex).HasSeparator then + PlaceSeparator(AGroupViewInfo, AFirstIndex); + ARow := 0; + AMaxRowX := X; + ARowX := X; + AColumnFirstItemControlIntex := AFirstIndex; + for I := AFirstIndex to ALastIndex do + begin + AItemControlViewInfo := AGroupViewInfo.GetItemControlViewInfo(I); + if I > AFirstIndex then + if (AItemControlViewInfo.GetPosition = ipBeginsNewRow) and + (AItemControlViewInfo.GetRealPositionInButtonGroup in [bgrpNone, bgrpStart, bgrpSingle]) then + begin + Inc(ARow); + if ARow < GroupRowCount then + ARowX := X + else + begin + AlignOneRowHeightItemControls(AGroupViewInfo, AColumnFirstItemControlIntex, AMaxRowX - X); + AColumnFirstItemControlIntex := I; + ARow := 0; + X := AMaxRowX; + IncrementColumnCount(AGroupViewInfo, I - 1); + ARowX := X; + AMaxRowX := X; + end; + end; + AItemControlWidth := GetItemControlCurrentWidth(AItemControlViewInfo); + FItemControlColumns[I] := FColumnCount; + AItemControlViewInfo.SetRow(ARow); + if not (AItemControlViewInfo.GetRealPositionInButtonGroup in [bgrpMember, bgrpFinish]) and + (I > AFirstIndex) and (FItemControlColumns[I - 1] = FItemControlColumns[I]) and (AGroupViewInfo.GetItemControlViewInfo(I - 1).GetRow = ARow) then + begin + if (AItemControlViewInfo.GetRealPositionInButtonGroup in [bgrpStart, bgrpSingle]) or + (AItemControlViewInfo.GetRealPositionInButtonGroup = bgrpNone) and (AGroupViewInfo.GetItemControlViewInfo(I - 1).GetRealPositionInButtonGroup in [bgrpFinish, bgrpSingle]) then + Inc(ARowX, AGroupViewInfo.GetOffsetsInfo.ButtonGroupOffset); + end; + AItemControlViewInfo.SetBounds(Rect(ARowX, ARow * GroupRowHeight, ARowX + AItemControlWidth, (ARow + 1) * GroupRowHeight)); + Inc(ARowX, AItemControlWidth); + if ARowX > AMaxRowX then + AMaxRowX := ARowX; + end; + AlignOneRowHeightItemControls(AGroupViewInfo, AColumnFirstItemControlIntex, AMaxRowX - X); + X := AMaxRowX; + if ADistributeOnGroupHeight then + DistributeOneRowHeightItemControlsOnGroupHeight(AGroupViewInfo, AFirstIndex, ALastIndex); +end; + +procedure TdxRibbonGroupLayoutCalculator.PlaceSeparator( + AGroupViewInfo: IdxRibbonGroupViewInfo; AItemControlIndex: Integer); +var + ASeparatorInfo: TdxBarItemSeparatorInfo; +begin + ASeparatorInfo.Bounds := Rect(X, dxRibbonItemSeparatorTopOffset, + X + dxRibbonItemSeparatorAreaWidth, + GetGroupHeight - dxRibbonItemSeparatorBottomOffset); + ASeparatorInfo.Kind := skVertical; + AGroupViewInfo.AddSeparator(ASeparatorInfo); + Inc(X, dxRibbonItemSeparatorAreaWidth); + FItemControlSeparators[AItemControlIndex] := AGroupViewInfo.GetSeparatorCount - 1; +end; + +procedure TdxRibbonGroupLayoutCalculator.PlaceWholeGroupHeightItemControl( + AGroupViewInfo: IdxRibbonGroupViewInfo; AIndex: Integer); +var + AItemControlViewInfo: IdxBarItemControlViewInfo; + AItemControlWidth: Integer; +begin + AItemControlViewInfo := AGroupViewInfo.GetItemControlViewInfo(AIndex); + if AItemControlViewInfo.HasSeparator then + PlaceSeparator(AGroupViewInfo, AIndex); + AItemControlWidth := GetItemControlCurrentWidth(AItemControlViewInfo); + AItemControlViewInfo.SetBounds(Rect(X, 0, X + AItemControlWidth, GetGroupHeight)); + FItemControlColumns[AIndex] := FColumnCount; + AItemControlViewInfo.SetRow(0); // ??? + Inc(X, AItemControlWidth); +end; + +function TdxRibbonGroupLayoutCalculator.ReduceOneRowHeightItemControlsWithText( + AGroupViewInfo: IdxRibbonGroupViewInfo; AUpToViewLevel: TdxBarItemRealViewLevel): Boolean; + + function CanReduce(AItemControlIndex: Integer): Boolean; + var + AItemControlViewInfo: IdxBarItemControlViewInfo; + begin + AItemControlViewInfo := AGroupViewInfo.GetItemControlViewInfo(AItemControlIndex); + Result := (AItemControlViewInfo.GetViewLevel < AUpToViewLevel) and + (AUpToViewLevel in AItemControlViewInfo.GetAllowedViewLevels); + end; + +var + AColumn, AIndex, ARow, I: Integer; + AColumnWidthAfterReducing, AColumnWidthBeforeReducing, ARowWidthAfterReducing, ARowWidthBeforeReducing: Integer; + AItemControlsToBeReduced: TInterfaceList; + AItemControlViewInfo: IdxBarItemControlViewInfo; +begin + Result := False; + AIndex := FItemControlIndexForOneRowHeightReducing; + while (AIndex >= 0) and IsWholeGroupHeightItemControl(AGroupViewInfo, AIndex) do + Dec(AIndex); + FItemControlIndexForOneRowHeightReducing := AIndex; + if AIndex = -1 then + Exit; + AColumn := FItemControlColumns[AIndex]; + AColumnWidthBeforeReducing := 0; + AColumnWidthAfterReducing := 0; + AItemControlsToBeReduced := TInterfaceList.Create; + try + while (AIndex >= 0) and (FItemControlColumns[AIndex] = AColumn) do + begin + if IsPartOfHorizontalBox(AGroupViewInfo, AIndex) then + begin + AItemControlViewInfo := AGroupViewInfo.GetItemControlViewInfo(AIndex); + ARowWidthBeforeReducing := GetItemControlCurrentWidth(AItemControlViewInfo); + ARow := AItemControlViewInfo.GetRow; + Dec(AIndex); + while (AIndex >= 0) and (FItemControlColumns[AIndex] = AColumn) and + (AGroupViewInfo.GetItemControlViewInfo(AIndex).GetRow = ARow) do + begin + AItemControlViewInfo := AGroupViewInfo.GetItemControlViewInfo(AIndex); + Inc(ARowWidthBeforeReducing, GetItemControlCurrentWidth(AItemControlViewInfo)); + Dec(AIndex); + end; + ARowWidthAfterReducing := ARowWidthBeforeReducing; + end + else + begin + AItemControlViewInfo := AGroupViewInfo.GetItemControlViewInfo(AIndex); + ARowWidthBeforeReducing := GetItemControlCurrentWidth(AItemControlViewInfo); + if CanReduce(AIndex) then + begin + ARowWidthAfterReducing := AItemControlViewInfo.GetWidth(AUpToViewLevel); + AItemControlsToBeReduced.Add(AItemControlViewInfo); + end + else + ARowWidthAfterReducing := ARowWidthBeforeReducing; + Dec(AIndex); + end; + if ARowWidthBeforeReducing > AColumnWidthBeforeReducing then + AColumnWidthBeforeReducing := ARowWidthBeforeReducing; + if ARowWidthAfterReducing > AColumnWidthAfterReducing then + AColumnWidthAfterReducing := ARowWidthAfterReducing; + end; + for I := 0 to AItemControlsToBeReduced.Count - 1 do + begin + AItemControlViewInfo := IdxBarItemControlViewInfo(AItemControlsToBeReduced[I]); + if (AItemControlViewInfo.GetWidth(AUpToViewLevel) < AColumnWidthBeforeReducing) and + (GetItemControlCurrentWidth(AItemControlViewInfo) > AColumnWidthAfterReducing) then + begin + AItemControlViewInfo.SetViewLevel(AUpToViewLevel); + Result := True; + end; + end; + FItemControlIndexForOneRowHeightReducing := AIndex; + if not Result then + Result := ReduceOneRowHeightItemControlsWithText(AGroupViewInfo, AUpToViewLevel) + else + CalcLayout(AGroupViewInfo); + finally + AItemControlsToBeReduced.Free; + end; +end; + +function TdxRibbonGroupLayoutCalculator.ReduceSequenceForWholeGroupHeightReducing( + ASequenceIndex: Integer): Boolean; + + function GetFreeCellCount(AOneRowHeightItemControlCount: Integer): Integer; + begin + Result := (GroupRowCount - AOneRowHeightItemControlCount mod GroupRowCount) mod GroupRowCount; + end; + + function IsItemGoodForReducing(const AItem: TSequenceForWholeGroupHeightReducingItem): Boolean; + var + AFreeCellCountAfterReducing, AFreeCellCountBeforeReducing: Integer; + begin + AFreeCellCountBeforeReducing := GetFreeCellCount(AItem.OneRowHeightItemControlsBefore) + + GetFreeCellCount(AItem.OneRowHeightItemControlsAfter); + AFreeCellCountAfterReducing := GetFreeCellCount(AItem.OneRowHeightItemControlsBefore + 1 + AItem.OneRowHeightItemControlsAfter); + Result := AFreeCellCountAfterReducing <= AFreeCellCountBeforeReducing; + end; + +var + AItemControlViewInfo: IdxBarItemControlViewInfo; + APrevOneRowHeightItemControlsAfter: Integer; + ASequence: TSequenceForWholeGroupHeightReducing; +begin + Result := False; + ASequence := FSequencesForWholeGroupHeightReducing[ASequenceIndex]; + if Length(ASequence) = 0 then + Exit; + if Length(ASequence) = 1 then + begin + if IsItemGoodForReducing(ASequence[0]) then + begin + AItemControlViewInfo := ASequence[0].ItemControlViewInfo; + AItemControlViewInfo.SetViewLevel(GetNextViewLevel(AItemControlViewInfo.GetAllowedViewLevels, ivlLargeIconWithText)); + SetLength(FSequencesForWholeGroupHeightReducing[ASequenceIndex], 0); + Result := True; + end; + end + else + begin + AItemControlViewInfo := ASequence[Length(ASequence) - 1].ItemControlViewInfo; + AItemControlViewInfo.SetViewLevel(GetNextViewLevel(AItemControlViewInfo.GetAllowedViewLevels, ivlLargeIconWithText)); + APrevOneRowHeightItemControlsAfter := ASequence[Length(ASequence) - 2].OneRowHeightItemControlsAfter; + Inc(ASequence[Length(ASequence) - 2].OneRowHeightItemControlsAfter, ASequence[Length(ASequence) - 1].OneRowHeightItemControlsAfter + 1); + SetLength(FSequencesForWholeGroupHeightReducing[ASequenceIndex], Length(ASequence) - 1); + Result := True; + repeat + ASequence := FSequencesForWholeGroupHeightReducing[ASequenceIndex]; + if APrevOneRowHeightItemControlsAfter <> 0 then + Break; + if not IsItemGoodForReducing(ASequence[Length(ASequence) - 1]) then + Break; + AItemControlViewInfo := ASequence[Length(ASequence) - 1].ItemControlViewInfo; + AItemControlViewInfo.SetViewLevel(GetNextViewLevel(AItemControlViewInfo.GetAllowedViewLevels, ivlLargeIconWithText)); + if Length(ASequence) > 1 then + begin + APrevOneRowHeightItemControlsAfter := ASequence[Length(ASequence) - 2].OneRowHeightItemControlsAfter; + Inc(ASequence[Length(ASequence) - 2].OneRowHeightItemControlsAfter, ASequence[Length(ASequence) - 1].OneRowHeightItemControlsAfter + 1); + end; + SetLength(FSequencesForWholeGroupHeightReducing[ASequenceIndex], Length(ASequence) - 1); + until Length(FSequencesForWholeGroupHeightReducing[ASequenceIndex]) = 0; + end; +end; + +function TdxRibbonGroupLayoutCalculator.ReduceWholeGroupHeightItemControls( + AGroupViewInfo: IdxRibbonGroupViewInfo): Boolean; +begin + Result := False; + while not Result and (FLastSequenceForWholeGroupHeightReducing >= 0) do + begin + Result := ReduceSequenceForWholeGroupHeightReducing(FLastSequenceForWholeGroupHeightReducing); + if not Result then + begin + SetLength(FSequencesForWholeGroupHeightReducing, FLastSequenceForWholeGroupHeightReducing); + Dec(FLastSequenceForWholeGroupHeightReducing); + end + else + CalcLayout(AGroupViewInfo); + end; +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxRibbonReg.dcr b/official/x.35/ExpressBars 6/Sources/dxRibbonReg.dcr new file mode 100644 index 00000000..5b006c55 Binary files /dev/null and b/official/x.35/ExpressBars 6/Sources/dxRibbonReg.dcr differ diff --git a/official/x.35/ExpressBars 6/Sources/dxRibbonReg.pas b/official/x.35/ExpressBars 6/Sources/dxRibbonReg.pas new file mode 100644 index 00000000..156a4bdc --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxRibbonReg.pas @@ -0,0 +1,315 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars components } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxRibbonReg; + +{$I cxVer.inc} + +interface + +procedure Register; + +implementation + +uses + ColnEdit, +{$IFDEF DELPHI6} + DesignEditors, DesignIntf, +{$ELSE} + DsgnIntf, +{$ENDIF} + Classes, Graphics, cxLibraryReg, dxBarReg, dxRibbon, ComCtrls, cxClasses, + cxDesignWindows, dxBarSkin, dxRibbonSkins, dxStatusBar, dxRibbonStatusBar, + TypInfo, dxBar, cxComponentCollectionEditor, cxPropEditors; + +type + { TdxRibbonDesignEditor } + + TdxRibbonDesignEditor = class(TdxBarComponentEditor) + private + function GetRibbon: TdxCustomRibbon; + protected + function InternalGetVerb(AIndex: Integer): string; override; + function InternalGetVerbCount: Integer; override; + procedure InternalExecuteVerb(AIndex: Integer); override; + public + property Ribbon: TdxCustomRibbon read GetRibbon; + end; + + { TdxRibbonColorSchemeNameProperty } + + TdxRibbonColorSchemeNameProperty = class(TStringProperty) + protected + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + { TdxRibbonQuickAccessGroupButtonToolbarProperty } + + TdxRibbonQuickAccessGroupButtonToolbarProperty = class(TComponentProperty) + private + function GetRibbon: TdxCustomRibbon; + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + end; + + { TdxRibbonStatusBarEditor } + + TdxRibbonStatusBarEditor = class(TdxBarComponentEditor) + protected + function InternalGetVerb(AIndex: Integer): string; override; + function InternalGetVerbCount: Integer; override; + procedure InternalExecuteVerb(AIndex: Integer); override; + end; + +{$IFDEF DELPHI6} + TdxRibbonStatusBarSelectionEditor = class(TSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; +{$ENDIF} + + { TdxBarProperty } + + TdxBarProperty = class(TComponentProperty) + private + FProc: TGetPropProc; + procedure GetPropProc({$IFNDEF DELPHI6}Prop: TPropertyEditor{$ELSE}const Prop: IProperty{$ENDIF}); + public + procedure GetProperties(Proc: TGetPropProc); override; + end; + + { TdxExtraPaneEventEditor } + + TdxExtraPaneEventEditor = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + public + function GetName: string; override; + end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterComponents('ExpressBars', [TdxRibbon, TdxRibbonPopupMenu, TdxBarApplicationMenu, TdxRibbonStatusBar]); + RegisterNoIcon([TdxRibbonGroupsDockControl, TdxRibbonQuickAccessGroupButton, TdxRibbonTab]); + RegisterComponentEditor(TdxCustomRibbon, TdxRibbonDesignEditor); + RegisterComponentEditor(TdxRibbonStatusBar, TdxRibbonStatusBarEditor); + RegisterPropertyEditor(TypeInfo(string), TdxCustomRibbon, 'ColorSchemeName', + TdxRibbonColorSchemeNameProperty); + RegisterPropertyEditor(TypeInfo(TdxBar), TdxRibbonQuickAccessGroupButton, 'Toolbar', + TdxRibbonQuickAccessGroupButtonToolbarProperty); + RegisterPropertyEditor(TypeInfo(TBitmap), TdxRibbonApplicationButton, 'Glyph', TcxBitmapProperty); + RegisterPropertyEditor(TypeInfo(TdxBar), nil, '', TdxBarProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TdxBarApplicationMenu, 'ExtraPaneEvents', TdxExtraPaneEventEditor); + + // ExtraPane + HideClassProperties(TdxBarApplicationMenu, ['ExtraPaneWidthRatio', + 'ExtraPaneSize', 'ExtraPaneItems', 'ExtraPaneHeader', 'OnExtraPaneItemClick']); + + HideClassProperties(TdxRibbonQuickAccessGroupButton, ['Action', 'Align', + 'Caption', 'Category', 'Description', 'Hint', 'MergeKind', 'MergeOrder', + 'Style']); +end; + +{ TdxRibbonColorSchemeNameProperty } + +function TdxRibbonColorSchemeNameProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [{paReadOnly,} paValueList, paRevertable] + -[paReadOnly]; +end; + +procedure TdxRibbonColorSchemeNameProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to SkinManager.SkinCount - 1 do + if SkinManager[I] is TdxCustomRibbonSkin then + Proc(SkinManager[I].Name); +end; + +procedure TdxRibbonColorSchemeNameProperty.SetValue(const Value: string); +var + I: Integer; +begin + for I := 0 to PropCount - 1 do + begin + TdxCustomRibbon(GetComponent(I)).ColorSchemeName := Value; + end; +end; + +{ TdxRibbonDesignEditor } + +function TdxRibbonDesignEditor.InternalGetVerb(AIndex: Integer): string; +begin + Result := 'Tabs Editor...';; +end; + +function TdxRibbonDesignEditor.InternalGetVerbCount: Integer; +begin + Result := 1; +end; + +procedure TdxRibbonDesignEditor.InternalExecuteVerb(AIndex: Integer); +begin + ShowFormEditorClass(Designer, Component, Ribbon.Tabs, 'Tabs', TfrmComponentCollectionEditor); +end; + +function TdxRibbonDesignEditor.GetRibbon: TdxCustomRibbon; +begin + Result := Component as TdxCustomRibbon; +end; + +{ TdxRibbonQuickAccessGroupButtonToolbarProperty } + +function TdxRibbonQuickAccessGroupButtonToolbarProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes - [paMultiSelect]; +end; + +procedure TdxRibbonQuickAccessGroupButtonToolbarProperty.GetValues(Proc: TGetStrProc); +var + AGroupButton: TdxRibbonQuickAccessGroupButton; + AList: TStringList; + ARibbon: TdxCustomRibbon; + AToolbar: TdxBar; + I, J: Integer; +begin + ARibbon := GetRibbon; + if ARibbon = nil then + Exit; + AGroupButton := TdxRibbonQuickAccessGroupButton(GetComponent(0)); + AList := TStringList.Create; + try + for I := 0 to ARibbon.TabCount - 1 do + for J := 0 to ARibbon.Tabs[I].Groups.Count - 1 do + begin + AToolbar := ARibbon.Tabs[I].Groups[J].Toolbar; + if (AToolbar <> nil) and (AList.IndexOf(AToolbar.Name) = -1) and AGroupButton.IsToolbarAcceptable(AToolbar) then + AList.Add(AToolbar.Name); + end; + if (AGroupButton.Toolbar <> nil) and (AList.IndexOf(AGroupButton.Toolbar.Name) = -1) then + AList.Add(AGroupButton.Toolbar.Name); + for I := 0 to AList.Count - 1 do + Proc(AList[I]); + finally + AList.Free; + end; +end; + +function TdxRibbonQuickAccessGroupButtonToolbarProperty.GetRibbon: TdxCustomRibbon; +var + AGroupButton: TdxRibbonQuickAccessGroupButton; +begin + AGroupButton := TdxRibbonQuickAccessGroupButton(GetComponent(0)); + if AGroupButton.LinkCount = 0 then + Result := nil + else + Result := TdxRibbonQuickAccessBarControl(AGroupButton.Links[0].BarControl).Ribbon; +end; + +{ TdxRibbonStatusBarEditor } + +function TdxRibbonStatusBarEditor.InternalGetVerb(AIndex: Integer): string; +begin + Result := 'Panels Editor...'; +end; + +function TdxRibbonStatusBarEditor.InternalGetVerbCount: Integer; +begin + Result := 1; +end; + +procedure TdxRibbonStatusBarEditor.InternalExecuteVerb(AIndex: Integer); +begin + ShowCollectionEditor(Designer, Component, (Component as TdxRibbonStatusBar).Panels, 'Panels'); +end; + +{$IFDEF DELPHI6} +procedure TdxRibbonStatusBarSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + Proc('cxGraphics'); + Proc('dxRibbon'); +end; +{$ENDIF} + +{ TdxBarProperty } + +procedure TdxBarProperty.GetProperties(Proc: TGetPropProc); +begin + FProc := Proc; + inherited GetProperties(GetPropProc); +end; + +procedure TdxBarProperty.GetPropProc( + {$IFNDEF DELPHI6}Prop: TPropertyEditor{$ELSE}const Prop: IProperty{$ENDIF}); +const + PropertiesToHide = + ' AllowClose AllowCustomizing AllowQuickCustomizing AllowReset ' + + 'BorderStyle Color DockControl DockedDockControl DockedDockingStyle ' + + 'DockedLeft DockedTop DockingStyle FloatLeft FloatTop FloatClientWidth ' + + 'FloatClientHeight Font Hidden IsMainMenu MultiLine NotDocking OldName ' + + 'OneOnRow RotateWhenVertical Row ShowMark SizeGrip UseOwnFont ' + + 'UseRecentItems UseRestSpace WholeRow BackgroundBitmap AlphaBlendValue '; +var + I: Integer; +begin + if (GetComponent(0) is TdxRibbonQuickAccessToolbar) or + (GetComponent(0) is TdxStatusBarToolbarPanelStyle) or + (GetComponent(0) is TdxRibbonTabGroup) then + begin + for I := 0 to PropCount - 1 do + if Pos(' ' + Prop.GetName + ' ', PropertiesToHide) > 0 then Exit; + end; + FProc(Prop); +end; + +{ TdxExtraPaneEventEditor } + +function TdxExtraPaneEventEditor.GetName: string; +begin + Result := 'ExtraPane'; +end; + +function TdxExtraPaneEventEditor.GetInstance: TPersistent; +begin + Result := TdxBarApplicationMenu(GetComponent(0)).ExtraPane; +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxRibbonSkins.pas b/official/x.35/ExpressBars 6/Sources/dxRibbonSkins.pas new file mode 100644 index 00000000..b81c7b37 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxRibbonSkins.pas @@ -0,0 +1,2660 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressBars components } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxRibbonSkins; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ImgList, ExtCtrls, cxClasses, cxGraphics, dxBarSkin, dxBar, + dxBarSkinConsts, dxGDIPlusAPI, cxLookAndFeelPainters; + +const + //ribbon's form consts + rfspActiveCaption = 10000; //don't change order + rfspInactiveCaption = 10001; + rfspActiveCaptionZoomed = 10002; + rfspInactiveCaptionZoomed = 10003; + rfspActiveCaptionLeftBorder = 10004; + rfspInactiveCaptionLeftBorder = 10005; + rfspActiveCaptionRightBorder = 10006; + rfspInactiveCaptionRightBorder = 10007; + rfspActiveLeftBorder = 10008; + rfspInactiveLeftBorder = 10009; + rfspActiveRightBorder = 10010; + rfspInactiveRightBorder = 10011; + rfspActiveBottomBorder1 = 10012; + rfspInactiveBottomBorder1 = 10013; + rfspActiveBottomBorder2 = 10014; + rfspInactiveBottomBorder2 = 10015; + rfspActiveBottomBorder3 = 10016; + rfspInactiveBottomBorder3 = 10017; + rfspRibbonForm = 10018; + + //border icons + rfspBorderIconHot = 10020; + rfspBorderIconPressed = 10021; + rfspBorderIconInactiveHot = 10022; + rfspMinimizeNormalIconGlyph = 10023; + rfspMinimizeHotIconGlyph = 10024; + rfspMinimizePressedIconGlyph = 10025; + rfspMinimizeInactiveIconGlyph = 10026; + rfspMaximizeNormalIconGlyph = 10027; + rfspMaximizeHotIconGlyph = 10028; + rfspMaximizePressedIconGlyph = 10029; + rfspMaximizeInactiveIconGlyph = 10030; + rfspCloseNormalIconGlyph = 10031; + rfspCloseHotIconGlyph = 10032; + rfspClosePressedIconGlyph = 10033; + rfspCloseInactiveIconGlyph = 10034; + rfspRestoreNormalIconGlyph = 10035; + rfspRestoreHotIconGlyph = 10036; + rfspRestorePressedIconGlyph = 10037; + rfspRestoreInactiveIconGlyph = 10038; + rfspHelpNormalIconGlyph = 10039; + rfspHelpHotIconGlyph = 10040; + rfspHelpPressedIconGlyph = 10041; + rfspHelpInactiveIconGlyph = 10042; + + //ribbon skin consts + rspTabNormal = 10043; + rspTabHot = 10044; + rspTabActive = 10045; + rspTabActiveHot = 10046; + rspTabFocused = 10047; + rspTabGroupsArea = 10048; + rspTabSeparator = 10049; + + rspQATDefaultGlyph = 10052; + rspQATAtBottom = 10053; + rspRibbonClientTopArea = 10054; + + rspQATNonClientLeft1Vista = 10055; + rspQATNonClientLeft2Vista = 10056; + rspQATNonClientRightVista = 10057; + rspQATPopup = 10058; + + rspQATNonClientLeft1Active = 10059; + rspQATNonClientLeft1Inactive = 10060; + rspQATNonClientLeft2Active = 10061; + rspQATNonClientLeft2Inactive = 10062; + rspQATNonClientRightActive = 10063; + rspQATNonClientRightInactive = 10064; + + rspRibbonBackground = 10065; + rspRibbonBottomEdge = 10066; + + rspApplicationButtonNormal = 10067; + rspApplicationButtonHot = 10068; + rspApplicationButtonPressed = 10069; + + rspApplicationMenuBorder = 10070; + rspApplicationMenuContentHeader= 10071; + rspApplicationMenuContentFooter= 10072; + rspDropDownBorder = 10073; + rspMenuContent = 10074; + rspMenuGlyph = 10075; + rspMenuMark = 10076; + rspMenuSeparatorHorz = 10077; + rspMenuSeparatorVert = 10078; + rspMenuArrowDown = 10079; + rspMenuArrowRight = 10080; + rspProgressSolidBand = 10081; + rspProgressDiscreteBand = 10082; + rspProgressSubstrate = 10083; + rspButtonGroupBorderLeft = 10084; + rspButtonGroupBorderRight = 10085; + rspScrollArrow = 10086; + rspScreenTip = 10087; + rspHelpButton = 10088; + rspApplicationMenuButton = 10089; + + rspStatusBar = 10090; + rspStatusBarPanel = 10091; + rspStatusBarPanelLowered = 10092; + rspStatusBarPanelRaised = 10093; + rspStatusBarPanelSeparator = 10094; + rspStatusBarGripBackground = 10095; + rspStatusBarToolbarSeparator = 10096; + rspStatusBarSizeGripColor1 = 10098; + rspStatusBarSizeGripColor2 = 10099; + rspStatusBarFormLeftPart = 10100; + rspStatusBarFormRightPart = 10104; + rspStatusBarFormLeftPartDialog = 10108; + rspStatusBarFormRightPartDialog= 10112; + + rspDropDownGalleryTopSizingBand = 10120; + rspDropDownGalleryBottomSizingBand = 10121; + rspDropDownGalleryTopSizeGrip = 10122; + rspDropDownGalleryBottomSizeGrip = 10123; + rspDropDownGalleryVerticalSizeGrip = 10124; + rspGalleryFilterBand = 10125; + rspGalleryGroupHeader = 10126; + + //ribbon font colors + rspFormCaptionText = 10130; + rspDocumentNameText = 10131; + rspTabHeaderText = 10132; + rspTabGroupText = 10133; + rspTabGroupHeaderText = 10134; + rspStatusBarText = 10138; + + //state's groups const + rspQATGroupButtonActive = 10200; + rspQATGroupButtonInactive = rspQATGroupButtonActive + DXBAR_STATESCOUNT; + rspArrowDownNormal = rspQATGroupButtonInactive + DXBAR_STATESCOUNT; + rspMenuDetachCaptionNormal = rspArrowDownNormal + DXBAR_STATESCOUNT; + rspMenuCheckNormal = rspMenuDetachCaptionNormal + DXBAR_STATESCOUNT; + rspMenuCheckMarkNormal = rspMenuCheckNormal + DXBAR_STATESCOUNT; + rspMenuScrollAreaNormal = rspMenuCheckMarkNormal + DXBAR_STATESCOUNT; + + rspCollapsedToolbarNormal = rspMenuScrollAreaNormal + DXBAR_STATESCOUNT; + rspCollapsedToolbarGlyphBackgroundNormal = rspCollapsedToolbarNormal + DXBAR_STATESCOUNT; + + rspEditButtonNormal = rspCollapsedToolbarGlyphBackgroundNormal + DXBAR_STATESCOUNT; + + rspSmallButtonNormal = rspEditButtonNormal + DXBAR_STATESCOUNT; + rspSmallButtonGlyphBackgroundNormal = rspSmallButtonNormal + DXBAR_STATESCOUNT; + rspSmallButtonDropButtonNormal = rspSmallButtonGlyphBackgroundNormal + DXBAR_STATESCOUNT; + + rspLargeButtonNormal = rspSmallButtonDropButtonNormal + DXBAR_STATESCOUNT; + rspLargeButtonGlyphBackgroundNormal = rspLargeButtonNormal + DXBAR_STATESCOUNT; + rspLargeButtonDropButtonNormal = rspLargeButtonGlyphBackgroundNormal + DXBAR_STATESCOUNT; + + rspButtonGroupNormal = rspLargeButtonDropButtonNormal + DXBAR_STATESCOUNT; + rspButtonGroupBorderMiddleNormal = rspButtonGroupNormal + DXBAR_STATESCOUNT; + rspButtonGroupSplitButtonSeparatorNormal = rspButtonGroupBorderMiddleNormal + DXBAR_STATESCOUNT; + + rspToolbarNormal = rspButtonGroupSplitButtonSeparatorNormal + DXBAR_STATESCOUNT; + rspToolbarHeaderNormal = rspToolbarNormal + DXBAR_STATESCOUNT; + + rspMarkArrowNormal = rspToolbarHeaderNormal + DXBAR_STATESCOUNT; + rspMarkTruncatedNormal = rspMarkArrowNormal + DXBAR_STATESCOUNT; + rspLaunchButtonBackgroundNormal= rspMarkTruncatedNormal + DXBAR_STATESCOUNT; + rspLaunchButtonDefaultGlyphNormal = rspLaunchButtonBackgroundNormal + DXBAR_STATESCOUNT; + + rspTabScrollLeftButtonNormal = rspLaunchButtonDefaultGlyphNormal + DXBAR_STATESCOUNT; + rspTabScrollRightButtonNormal = rspTabScrollLeftButtonNormal + DXBAR_STATESCOUNT; + rspGroupScrollLeftButtonNormal = rspTabScrollRightButtonNormal + DXBAR_STATESCOUNT; + rspGroupScrollRightButtonNormal= rspGroupScrollLeftButtonNormal + DXBAR_STATESCOUNT; + + rspInRibbonGalleryScrollBarLineUpButtonNormal = rspGroupScrollRightButtonNormal + DXBAR_STATESCOUNT; + rspInRibbonGalleryScrollBarLineDownButtonNormal = rspInRibbonGalleryScrollBarLineUpButtonNormal + DXBAR_STATESCOUNT; + rspInRibbonGalleryScrollBarDropDownButtonNormal = rspInRibbonGalleryScrollBarLineDownButtonNormal + DXBAR_STATESCOUNT; + + //next = rspGroupScrollRightButtonNormal + DXBAR_STATESCOUNT; + +type + TdxApplicationButtonState = (absNormal, absHot, absPressed); + TdxBorderDrawIcon = (bdiMinimize, bdiMaximize, bdiRestore, bdiClose, bdiHelp); + TdxBorderIconState = (bisNormal, bisHot, bisPressed, bisInactive, bisHotInactive); + TdxInRibbonGalleryScrollBarButtonKind = (gsbkLineUp, gsbkLineDown, gsbkDropDown); + TdxRibbonTabState = (rtsNormal, rtsHot, rtsActive, rtsActiveHot, rtsFocused); + + TdxRibbonFormData = packed record + Active: Boolean; + Bounds: TRect; + Border: TBorderStyle; + Handle: HWND; + State: TWindowState; + Style: TFormStyle; + DontUseAero: Boolean; + end; + + TTwoStateArray = array[Boolean] of Integer; + TThreeStateArray = array[0..2] of Integer; + TFourStateArray = array[0..3] of Integer; + TStatesArray = array[0..DXBAR_STATESCOUNT-1] of Integer; + + TdxCustomRibbonSkin = class(TdxCustomBarSkin) + private + // form + FCaption: TTwoStateArray; + FCaptionZoomed: TTwoStateArray; + FCaptionLeftBorder: TTwoStateArray; + FCaptionRightBorder: TTwoStateArray; + FLeftBorder: TTwoStateArray; + FRightBorder: TTwoStateArray; + FBottomBorderThin: TTwoStateArray; + FBottomBorderThick: array[Boolean] of TTwoStateArray; + FBorderIconGlyph: array[TdxBorderDrawIcon] of TFourStateArray; + FBorderIcons: TThreeStateArray; + FFormStatusBarLeftParts: array[Boolean] of TFourStateArray; + FFormStatusBarRightParts: array[Boolean] of TFourStateArray; + //quick access toolbar + FQATAtTopLeft: array[Boolean] of TTwoStateArray; + FQATAtTopRight: TTwoStateArray; + FQATGlassAtTopLeft: array[Boolean] of Integer; + FQATGlassAtTopRight: Integer; + FQATAtBottom: Integer; + FQATPopup: Integer; + FQATDefaultGlyph: Integer; + FRibbonTopArea: Integer; + // + FApplicationButton: TThreeStateArray; + FApplicationMenuButton: Integer; + FApplicationMenuBorder: Integer; + FApplicationMenuContentHeader: Integer; + FApplicationMenuContentFooter: Integer; + FArrowsDown: TStatesArray; + FMenuArrowRight: Integer; + FMenuArrowDown: Integer; + FEditButtons: TStatesArray; + FCollapsedToolbars: TStatesArray; + FCollapsedToolbarGlyphBackgrounds: TStatesArray; + FDropDownGalleryBottomSizeGrip: Integer; + FDropDownGalleryBottomSizingBand: Integer; + FDropDownGalleryTopSizeGrip: Integer; + FDropDownGalleryTopSizingBand: Integer; + FDropDownGalleryVerticalSizeGrip: Integer; + FGalleryFilterBand: Integer; + FGalleryGroupHeader: Integer; + FInRibbonGalleryScrollBarDropDownButton: TStatesArray; + FInRibbonGalleryScrollBarLineDownButton: TStatesArray; + FInRibbonGalleryScrollBarLineUpButton: TStatesArray; + FMenuCheck: TStatesArray; + FMenuCheckMark: TStatesArray; + FMenuDetachCaption: TStatesArray; + FMenuContent: Integer; + FMenuGlyph: Integer; + FMenuMark: Integer; + FMenuSeparatorHorz: Integer; + FMenuSeparatorVert: Integer; + FMenuScrollArea: TStatesArray; + FDropDownBorder: Integer; + FLargeButtons: TStatesArray; + FSmallButtons: TStatesArray; + FLargeButtonGlyphBackgrounds: TStatesArray; + FSmallButtonGlyphBackgrounds: TStatesArray; + FLargeButtonDropButtons: TStatesArray; + FSmallButtonDropButtons: TStatesArray; + FButtonGroup: TStatesArray; + FButtonGroupBorderLeft: Integer; + FButtonGroupBorderMiddle: TStatesArray; + FButtonGroupBorderRight: Integer; + FButtonGroupSplitButtonSeparator: TStatesArray; + FLaunchButtonBackgrounds: TStatesArray; + FLaunchButtonDefaultGlyphs: TStatesArray; + FProgressSolidBand: Integer; + FProgressDiscreteBand: Integer; + FProgressSubstrate: Integer; + FScrollArrow: Integer; + FToolbar: TStatesArray; + FToolbarHeader: TStatesArray; + + FMarkArrow: TStatesArray; + FMarkTruncated: TStatesArray; + + FTabScrollButtons: array[Boolean] of TThreeStateArray; + FGroupScrollButtons: array[Boolean] of TThreeStateArray; + FQATGroupButtonActive: TStatesArray; + FQATGroupButtonInactive: TStatesArray; + FHelpButton: Integer; + + FStatusBar: Integer; + FStatusBarGripBackground: Integer; + FStatusBarPanel: Integer; + FStatusBarPanelLowered: Integer; + FStatusBarPanelRaised: Integer; + FStatusBarPanelSeparator: Integer; + FStatusBarToolbarSeparator: Integer; + FScreenTip: Integer; + + FTabIndex: array[TdxRibbonTabState] of Integer; + FTabSeparator: Integer; + FTabGroupsArea: Integer; + + FLowColors: Boolean; + procedure InternalDrawPart(const AParts: TStatesArray; DC: HDC; const R: TRect; AState: Integer); + procedure LoadThreeStateArray(ABitmap: GpBitmap; R: TRect; const Fixed: TRect; + var AStateArray: TThreeStateArray; AStartID: Integer; + AInterpolationMode: Integer = InterpolationModeDefault); + procedure LoadCommonButtonParts(ABitmap: GpBitmap); + procedure LoadCommonMenuParts(ABitmap: GpBitmap); + procedure LoadCommonProgressParts(ABitmap: GpBitmap); + procedure LoadInRibbonGalleryScrollBarParts(ABitmap: GpBitmap); + protected + function GetName: string; virtual; abstract; + + procedure DrawApplicationButtonLC(DC: HDC; const R: TRect; + AState: TdxApplicationButtonState); virtual; + procedure DrawApplicationMenuBorderLC(DC: HDC; const R: TRect); virtual; + procedure DrawBlackArrow(DC: HDC; const R: TRect; AArrowDirection: TcxArrowDirection); + procedure DrawFormBordersLC(DC: HDC; const ABordersWidth: TRect; + ACaptionHeight: Integer; const AData: TdxRibbonFormData); virtual; + procedure DrawFormBorderIconLC(DC: HDC; const R: TRect; + AIcon: TdxBorderDrawIcon; AState: TdxBorderIconState); virtual; + procedure DrawFormCaptionLC(DC: HDC; const R: TRect; + const AData: TdxRibbonFormData); virtual; + + procedure DrawDropDownGalleryVerticalSizeGrip(DC: HDC; const R: TRect); + + procedure LoadFormSkin; + procedure LoadRibbonSkin; + + procedure LoadCommonRibbonSkinBitmap(out ABitmap: GpBitmap); virtual; + procedure LoadCustomRibbonSkinBitmap(out ABitmap: GpBitmap); virtual; abstract; + procedure LoadFormSkinBitmap(out ABitmap: GpBitmap); virtual; abstract; + + procedure LoadCommonControlSkinFromBitmap(ABitmap: GpBitmap); virtual; + procedure LoadCustomControlSkinFromBitmap(ABitmap: GpBitmap); virtual; + procedure LoadFormSkinFromBitmap(ABitmap: GpBitmap); virtual; + + procedure LoadApplicationButton(ABitmap: GpBitmap); virtual; + procedure LoadBorderIcons(ABitmap: GpBitmap); virtual; + procedure LoadCustomButtonParts(ABitmap: GpBitmap); virtual; + procedure LoadCustomGroup(ABitmap: GpBitmap); virtual; + procedure LoadCustomMenuParts(ABitmap: GpBitmap); virtual; + procedure LoadCustomProgressParts(ABitmap: GpBitmap); virtual; + procedure LoadCustomScrollArrow(ABitmap: GpBitmap); virtual; + procedure LoadCustomScreenTip(ABitmap: GpBitmap); virtual; + procedure LoadGallery(ABitmap: GpBitmap); virtual; + procedure LoadTab(ABitmap: GpBitmap); + procedure LoadScrollButtons(ABitmap: GpBitmap); + procedure LoadCollapsedToolbar(ABitmap: GpBitmap); + procedure LoadQAT(ABitmap: GpBitmap); + procedure LoadStatusBar(ABitmap: GpBitmap); + + property LowColors: Boolean read FLowColors write FLowColors; + public + constructor Create; + + procedure LoadElementParts(ABitmap: GpBitmap; + var AParts; const R: TRect; AID: Integer; const AFixedSize: TRect; + const AImageIndexes: array of Byte; const APossibleStates: TdxByteSet = []; + AIsTopDown: Boolean = True; AInterpolationMode: Integer = InterpolationModeDefault); + + procedure LoadBitmapFromStream(const AResName: string; out ABitmap: GpBitmap); + procedure LoadElementPartsFromFile(const AFileName: string; + var AParts; AID: Integer; const AFixedSize: TRect; + const AImageIndexes: array of Byte; const APossibleStates: TdxByteSet = []); + + procedure DrawApplicationButton(DC: HDC; const R: TRect; AState: TdxApplicationButtonState); virtual; + procedure DrawApplicationMenuButton(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawApplicationMenuBorder(DC: HDC; const R: TRect); virtual; + procedure DrawApplicationMenuContentHeader(DC: HDC; const R: TRect); virtual; + procedure DrawApplicationMenuContentFooter(DC: HDC; const R: TRect); virtual; + procedure DrawArrowDown(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawMenuArrowDown(DC: HDC; const R: TRect); virtual; + procedure DrawMenuArrowRight(DC: HDC; const R: TRect); virtual; + procedure DrawButtonGroup(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawButtonGroupBorderLeft(DC: HDC; const R: TRect); virtual; + procedure DrawButtonGroupBorderMiddle(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawButtonGroupBorderRight(DC: HDC; const R: TRect); virtual; + procedure DrawButtonGroupSplitButtonSeparator(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawCollapsedToolbarBackground(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawCollapsedToolbarGlyphBackground(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawDropDownBorder(DC: HDC; const R: TRect); virtual; + procedure DrawDropDownGalleryBackground(DC: HDC; const R: TRect); virtual; + procedure DrawDropDownGalleryBottomSizeGrip(DC: HDC; const R: TRect); virtual; + procedure DrawDropDownGalleryBottomSizingBand(DC: HDC; const R: TRect); virtual; + procedure DrawDropDownGalleryBottomVerticalSizeGrip(DC: HDC; const R: TRect); virtual; + procedure DrawDropDownGalleryTopSizeGrip(DC: HDC; const R: TRect); virtual; + procedure DrawDropDownGalleryTopSizingBand(DC: HDC; const R: TRect); virtual; + procedure DrawDropDownGalleryTopVerticalSizeGrip(DC: HDC; const R: TRect); virtual; + procedure DrawEditArrowButton(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawEditButton(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawEditEllipsisButton(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawEditSpinDownButton(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawEditSpinUpButton(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawFormBorders(DC: HDC; const ABordersWidth: TRect; + ACaptionHeight: Integer; const AData: TdxRibbonFormData); virtual; + procedure DrawFormBorderIcon(DC: HDC; const R: TRect; AIcon: TdxBorderDrawIcon; AState: TdxBorderIconState); virtual; + procedure DrawFormCaption(DC: HDC; const R: TRect; const AData: TdxRibbonFormData); virtual; + procedure DrawFormStatusBarPart(DC: HDC; const R: TRect; AIsLeft, AIsActive, AIsRaised, AIsRectangular: Boolean); virtual; + procedure DrawHelpButton(DC: HDC; const R: TRect; AState: TdxBorderIconState); virtual; + procedure DrawHelpButtonGlyph(DC: HDC; const R: TRect; AGlyph: TBitmap); virtual; + procedure DrawGalleryFilterBandBackground(DC: HDC; const R: TRect); virtual; + procedure DrawGalleryGroupHeaderBackground(DC: HDC; const R: TRect); virtual; + procedure DrawGroupScrollButton(DC: HDC; const R: TRect; ALeft: Boolean; AState: Integer); virtual; + procedure DrawInRibbonGalleryBackground(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawInRibbonGalleryScrollBarButton(DC: HDC; const R: TRect; + AButtonKind: TdxInRibbonGalleryScrollBarButtonKind; AState: Integer); virtual; + procedure DrawLargeButton(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawLargeButtonGlyphBackground(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawLargeButtonDropButton(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawLaunchButtonBackground(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawLaunchButtonDefaultGlyph(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawMDIButton(DC: HDC; const R: TRect; AButton: TdxBarMDIButton; AState: TdxBorderIconState); virtual; + procedure DrawMenuCheck(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawMenuCheckMark(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawMenuContent(DC: HDC; const R: TRect); virtual; + procedure DrawMenuDetachCaption(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawMenuGlyph(DC: HDC; const R: TRect); virtual; + procedure DrawMenuMark(DC: HDC; const R: TRect); virtual; + procedure DrawMenuSeparatorHorz(DC: HDC; const R: TRect); virtual; + procedure DrawMenuSeparatorVert(DC: HDC; const R: TRect); virtual; + procedure DrawMenuScrollArea(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawProgressSolidBand(DC: HDC; const R: TRect); virtual; + procedure DrawProgressSubstrate(DC: HDC; const R: TRect); virtual; + procedure DrawProgressDiscreteBand(DC: HDC; const R: TRect); virtual; + procedure DrawRibbonBackground(DC: HDC; const R: TRect); virtual; + procedure DrawRibbonBottomBorder(DC: HDC; const R: TRect); virtual; + procedure DrawRibbonClientTopArea(DC: HDC; const R: TRect); virtual; + procedure DrawSmallButton(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawSmallButtonGlyphBackground(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawSmallButtonDropButton(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawScrollArrow(DC: HDC; const R: TRect); virtual; + procedure DrawScreenTip(DC: HDC; const R: TRect); virtual; + procedure DrawTab(DC: HDC; const R: TRect; AState: TdxRibbonTabState); virtual; + procedure DrawTabGroupBackground(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawTabGroupHeaderBackground(DC: HDC; const R: TRect; AState: Integer); virtual; + + procedure DrawMarkArrow(DC: HDC; const R: TRect; AState: Integer); virtual; + procedure DrawMarkTruncated(DC: HDC; const R: TRect; AState: Integer); virtual; + + procedure DrawTabGroupsArea(DC: HDC; const R: TRect); virtual; + procedure DrawTabScrollButton(DC: HDC; const R: TRect; ALeft: Boolean; AState: Integer); virtual; + procedure DrawTabSeparator(DC: HDC; const R: TRect; Alpha: Byte); virtual; + procedure DrawQuickAccessToolbar(DC: HDC; const R: TRect; + ABellow, ANonClientDraw, AHasApplicationButton, AIsActive, ADontUseAero: Boolean); virtual; + procedure DrawQuickAccessToolbarDefaultGlyph(DC: HDC; const R: TRect); virtual; + procedure DrawQuickAccessToolbarGroupButton(DC: HDC; const R: TRect; + ABellow, ANonClientDraw, AIsActive: Boolean; AState: Integer); virtual; + procedure DrawQuickAccessToolbarPopup(DC: HDC; const R: TRect); virtual; + + procedure DrawStatusBar(DC: HDC; const R: TRect); virtual; + procedure DrawStatusBarGripBackground(DC: HDC; const R: TRect); virtual; + procedure DrawStatusBarPanel(DC: HDC; const R: TRect; AIsLowered: Boolean); virtual; + procedure DrawStatusBarPanelSeparator(DC: HDC; const R: TRect); virtual; + procedure DrawStatusBarSizeGrip(DC: HDC; const R: TRect); virtual; + procedure DrawStatusBarToolbarSeparator(DC: HDC; const R: TRect); virtual; + + function GetApplicationMenuGlyphSize: TSize; virtual; + function GetCaptionFontSize(ACurrentFontSize: Integer): Integer; virtual; + function GetMenuSeparatorSize: Integer; virtual; + function GetPartColor(APart: Integer; AState: Integer = 0): TColor; virtual; + function GetPartContentOffsets(APart: Integer): TRect; virtual; + function GetSkinName: string; virtual; + function GetQuickAccessToolbarLeftIndent(AHasApplicationButton: Boolean; + AUseAeroGlass: Boolean): Integer; virtual; + function GetQuickAccessToolbarMarkButtonOffset(AHasApplicationButton: Boolean; + ABelow: Boolean): Integer; virtual; + function GetQuickAccessToolbarOverrideWidth(AHasApplicationButton: Boolean; + AUseAeroGlass: Boolean): Integer; virtual; + function GetQuickAccessToolbarRightIndent(AHasApplicationButton: Boolean): Integer; virtual; + function GetWindowBordersWidth(AHasStatusBar: Boolean): TRect; virtual; + function HasGroupTransparency: Boolean; virtual; + function NeedDrawGroupScrollArrow: Boolean; virtual; + // + procedure UpdateBitsPerPixel; + end; + + TdxBlueRibbonSkin = class(TdxCustomRibbonSkin) + protected + function GetName: string; override; + procedure LoadCustomRibbonSkinBitmap(out ABitmap: GpBitmap); override; + procedure LoadFormSkinBitmap(out ABitmap: GpBitmap); override; + public + procedure DrawRibbonBottomBorder(DC: HDC; const R: TRect); override; + function GetPartColor(APart: Integer; AState: Integer = 0): TColor; override; + end; + + { TdxBlackRibbonSkin } + + TdxBlackRibbonSkin = class(TdxCustomRibbonSkin) + protected + function GetName: string; override; + procedure LoadCustomRibbonSkinBitmap(out ABitmap: GpBitmap); override; + procedure LoadFormSkinBitmap(out ABitmap: GpBitmap); override; + public + procedure DrawRibbonBottomBorder(DC: HDC; const R: TRect); override; + function GetPartColor(APart: Integer; AState: Integer = 0): TColor; override; + end; + + { TdxSilverRibbonSkin } + + TdxSilverRibbonSkin = class(TdxBlackRibbonSkin) + protected + function GetName: string; override; + procedure LoadCustomRibbonSkinBitmap(out ABitmap: GpBitmap); override; + procedure LoadFormSkinBitmap(out ABitmap: GpBitmap); override; + public + procedure DrawRibbonBottomBorder(DC: HDC; const R: TRect); override; + function GetPartColor(APart: Integer; AState: Integer = 0): TColor; override; + end; + +function IsRectangularFormBottom(const AData: TdxRibbonFormData): Boolean; {$IFDEF DELPHI9} inline; {$ENDIF} + +implementation + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + cxGeometry, dxOffice11, Math, cxDWMApi; + +{$R 'skins.res' 'skins.rc'} + +const + DropDownGalleryVerticalSizeGripBitmapSize: TSize = (cx: 18; cy: 7); + +function IsRectangularFormBottom(const AData: TdxRibbonFormData): Boolean; +begin + Result := (AData.Border in [bsDialog, bsSingle, bsToolWindow]) or (AData.Style = fsMDIChild); +end; + +procedure ExcludeClipRect(DC: HDC; const R: TRect); +begin + Windows.ExcludeClipRect(DC, R.Left, R.Top, R.Right, R.Bottom); +end; + +procedure DrawFrame(DC: HDC; const R: TRect; AColor, ABorderColor: TColor; + const ABorders: TcxBorders = cxBordersAll; ABorderWidth: Integer = 1); +var + ABrush: HBRUSH; + ABounds, ABorderBounds: TRect; + ABorder: TcxBorder; + + function GetBorderBounds: TRect; + begin + Result := R; + with Result do + case ABorder of + bLeft: + begin + Right := Left + ABorderWidth; + Inc(ABounds.Left, ABorderWidth); + end; + bTop: + begin + Bottom := Top + ABorderWidth; + Inc(ABounds.Top, ABorderWidth); + end; + bRight: + begin + Left := Right - ABorderWidth; + Dec(ABounds.Right, ABorderWidth); + end; + bBottom: + begin + Top := Bottom - ABorderWidth; + Dec(ABounds.Bottom, ABorderWidth); + end; + end; + end; + +begin + if cxRectIsEmpty(R) then Exit; + ABounds := R; + if ABorders <> [] then + begin + ABrush := CreateSolidBrush(ColorToRGB(ABorderColor)); + for ABorder := Low(ABorder) to High(ABorder) do + if ABorder in ABorders then + begin + ABorderBounds := GetBorderBounds; + if not cxRectIsEmpty(ABorderBounds) then + FillRect(DC, ABorderBounds, ABrush); + end; + DeleteObject(ABrush); + end; + if AColor <> clNone then + FillRectByColor(DC, ABounds, AColor); +end; + +procedure OutError; +begin + raise Exception.Create(''); +end; + +{ TdxCustomRibbonSkin } + +constructor TdxCustomRibbonSkin.Create; +begin + inherited Create(GetName); + LoadFormSkin; + LoadRibbonSkin; + UpdateBitsPerPixel; +end; + +procedure TdxCustomRibbonSkin.LoadBitmapFromStream(const AResName: string; + out ABitmap: GpBitmap); +var + S: TStream; +begin + S := TResourceStream.Create(HInstance, AResName, RT_RCDATA); + try + ABitmap := GetImageFromStream(S); + finally + S.Free; + end; +end; + +procedure TdxCustomRibbonSkin.LoadElementParts(ABitmap: GpBitmap; + var AParts; const R: TRect; AID: Integer; const AFixedSize: TRect; + const AImageIndexes: array of Byte; const APossibleStates: TdxByteSet = []; + AIsTopDown: Boolean = True; AInterpolationMode: Integer = InterpolationModeDefault); +var + I, J, AImageIndex: Integer; + AOffsetSize: TSize; + ALoadRect: TRect; +begin + J := 0; + if AIsTopDown then + begin + AOffsetSize.cx := 0; + AOffsetSize.cy := cxRectHeight(R); + end + else + begin + AOffsetSize.cx := cxRectWidth(R); + AOffsetSize.cy := 0; + end; + for I := Low(TStatesArray) to High(TStatesArray) do + begin + if (APossibleStates = []) or (I in APossibleStates) then + begin + if Length(AImageIndexes) = 0 then + AImageIndex := J + else + if J < Length(AImageIndexes) then + AImageIndex := AImageIndexes[J] + else + AImageIndex := 0; + ALoadRect := cxRectOffset(R, AOffsetSize.cx * AImageIndex, AOffsetSize.cy * AImageIndex); + Inc(J); + if cxRectIsEqual(cxEmptyRect, AFixedSize) then + TStatesArray(AParts)[I] := AddPart1x1(ABitmap, ALoadRect, AID, '', AInterpolationMode) + else + TStatesArray(AParts)[I] := AddPart3x3(ABitmap, ALoadRect, AFixedSize, AID, '', AInterpolationMode); + end; + Inc(AID); + end; +end; + +procedure TdxCustomRibbonSkin.LoadElementPartsFromFile(const AFileName: string; + var AParts; AID: Integer; const AFixedSize: TRect; + const AImageIndexes: array of Byte; const APossibleStates: TdxByteSet = []); +var + ABitmap: GpGraphics; + AImageRect: TRect; +begin + if not CheckGdiPlus then Exit; + GdipCheck(GdipLoadImageFromFile(PWideChar(WideString(AFileName)), ABitmap)); + AImageRect.Left := 0; + AImageRect.Top := 0; + GdipCheck(GdipGetImageWidth(ABitmap, AImageRect.Right)); + GdipCheck(GdipGetImageHeight(ABitmap, AImageRect.Bottom)); + LoadElementParts(ABitmap, AParts, AImageRect, AID, AFixedSize, AImageIndexes, + APossibleStates); + GdipDisposeImage(ABitmap); +end; + +// DRAWING + +procedure TdxCustomRibbonSkin.DrawApplicationButton(DC: HDC; const R: TRect; + AState: TdxApplicationButtonState); +begin + if LowColors then + DrawApplicationButtonLC(DC, R, AState) + else + Parts[FApplicationButton[Ord(AState)]].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawApplicationMenuButton(DC: HDC; const R: TRect; AState: Integer); +begin + if AState = DXBAR_HOT then + InternalDrawPart(FSmallButtons, DC, R, AState) + else + Parts[FApplicationMenuButton].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawApplicationMenuBorder(DC: HDC; const R: TRect); +begin + if LowColors then + DrawApplicationMenuBorderLC(DC, R) + else + Parts[FApplicationMenuBorder].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawApplicationMenuContentHeader(DC: HDC; const R: TRect); +begin + if LowColors then + FillRectByColor(DC, R, clMenu) + else + Parts[FApplicationMenuContentHeader].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawApplicationMenuContentFooter(DC: HDC; const R: TRect); +begin + if LowColors then + FillRectByColor(DC, R, clMenu) + else + Parts[FApplicationMenuContentFooter].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawArrowDown(DC: HDC; const R: TRect; AState: Integer); +begin + if FLowColors then + DrawBlackArrow(DC, R, adDown) + else + InternalDrawPart(FArrowsDown, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawMenuArrowDown(DC: HDC; const R: TRect); +begin + if FLowColors then + DrawBlackArrow(DC, R, adDown) + else + Parts[FMenuArrowDown].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawMenuArrowRight(DC: HDC; const R: TRect); +begin + if FLowColors then + DrawBlackArrow(DC, R, adRight) + else + Parts[FMenuArrowRight].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawButtonGroup(DC: HDC; const R: TRect; AState: Integer); +begin + InternalDrawPart(FButtonGroup, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawButtonGroupBorderLeft(DC: HDC; const R: TRect); +begin + if not LowColors then + Parts[FButtonGroupBorderLeft].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawButtonGroupBorderMiddle(DC: HDC; const R: TRect; AState: Integer); +begin + if not LowColors then + InternalDrawPart(FButtonGroupBorderMiddle, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawButtonGroupBorderRight(DC: HDC; const R: TRect); +begin + if not LowColors then + Parts[FButtonGroupBorderRight].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawButtonGroupSplitButtonSeparator(DC: HDC; const R: TRect; AState: Integer); +begin + if not LowColors then + InternalDrawPart(FButtonGroupSplitButtonSeparator, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawCollapsedToolbarBackground(DC: HDC; + const R: TRect; AState: Integer); +begin + if LowColors then + InternalDrawPart(FCollapsedToolbars, DC, R, AState) + else + case AState of + 0, 2, 3, 4: Parts[FCollapsedToolbars[AState]].Draw(DC, R); + else + Parts[FCollapsedToolbars[0]].Draw(DC, R); + end; +end; + +procedure TdxCustomRibbonSkin.DrawCollapsedToolbarGlyphBackground(DC: HDC; + const R: TRect; AState: Integer); +begin + InternalDrawPart(FCollapsedToolbarGlyphBackgrounds, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawDropDownBorder(DC: HDC; const R: TRect); +begin + Parts[FDropDownBorder].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawDropDownGalleryBackground(DC: HDC; const R: TRect); +begin + FillRectByColor(DC, R, GetPartColor(DXBAR_DROPDOWNGALLERY, DXBAR_NORMAL)); +end; + +procedure TdxCustomRibbonSkin.DrawDropDownGalleryBottomSizeGrip(DC: HDC; + const R: TRect); +var + ARect: TRect; +begin + ARect := cxRectInflate(R, 0, -3, -2, -1); + ARect.Left := ARect.Right - cxRectHeight(ARect); + Parts[FDropDownGalleryBottomSizeGrip].Draw(DC, ARect); +end; + +procedure TdxCustomRibbonSkin.DrawDropDownGalleryBottomSizingBand(DC: HDC; + const R: TRect); +begin + Parts[FDropDownGalleryBottomSizingBand].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawDropDownGalleryBottomVerticalSizeGrip(DC: HDC; + const R: TRect); +begin + DrawDropDownGalleryVerticalSizeGrip(DC, Rect(R.Left, R.Top + 1, R.Right, R.Bottom)); +end; + +procedure TdxCustomRibbonSkin.DrawDropDownGalleryTopSizeGrip(DC: HDC; + const R: TRect); +var + ARect: TRect; +begin + ARect := cxRectInflate(R, 0, -1, -2, -3); + ARect.Left := ARect.Right - cxRectHeight(ARect); + Parts[FDropDownGalleryTopSizeGrip].Draw(DC, ARect); +end; + +procedure TdxCustomRibbonSkin.DrawDropDownGalleryTopSizingBand(DC: HDC; + const R: TRect); +begin + Parts[FDropDownGalleryTopSizingBand].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawDropDownGalleryTopVerticalSizeGrip(DC: HDC; + const R: TRect); +begin + DrawDropDownGalleryVerticalSizeGrip(DC, Rect(R.Left, R.Top, R.Right, R.Bottom - 1)); +end; + +procedure TdxCustomRibbonSkin.DrawEditArrowButton(DC: HDC; const R: TRect; AState: Integer); +begin + // do nothing +end; + +procedure TdxCustomRibbonSkin.DrawEditButton(DC: HDC; const R: TRect; AState: Integer); +begin + InternalDrawPart(FEditButtons, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawEditEllipsisButton(DC: HDC; const R: TRect; AState: Integer); +begin + // do nothing +end; + +procedure TdxCustomRibbonSkin.DrawEditSpinDownButton(DC: HDC; const R: TRect; AState: Integer); +begin + // do nothing +end; + +procedure TdxCustomRibbonSkin.DrawEditSpinUpButton(DC: HDC; const R: TRect; AState: Integer); +begin + // do nothing +end; + +procedure TdxCustomRibbonSkin.DrawFormBorders(DC: HDC; + const ABordersWidth: TRect; ACaptionHeight: Integer; + const AData: TdxRibbonFormData); +var + R: TRect; + ARectangularBottom: Boolean; +begin + if LowColors then + DrawFormBordersLC(DC, ABordersWidth, ACaptionHeight, AData) + else + begin + //catpion borders + if ACaptionHeight > 0 then + begin + R := AData.Bounds; + R.Bottom := ACaptionHeight; + R.Right := R.Left + ABordersWidth.Left; + Parts[FCaptionLeftBorder[not AData.Active]].Draw(DC, R); + R.Right := AData.Bounds.Right; + R.Left := R.Right - ABordersWidth.Right; + Parts[FCaptionRightBorder[not AData.Active]].Draw(DC, R) + end; + ARectangularBottom := IsRectangularFormBottom(AData); + if ABordersWidth.Bottom > 1 then + begin + R := AData.Bounds; + R.Top := R.Bottom - ABordersWidth.Bottom; + Parts[FBottomBorderThick[ARectangularBottom][not AData.Active]].Draw(DC, R); + ExcludeClipRect(DC, R); + end + else + begin + R := AData.Bounds; + R.Top := R.Bottom - ABordersWidth.Bottom; + Inc(R.Left, ABordersWidth.Left); + Dec(R.Right, ABordersWidth.Right); + Parts[FBottomBorderThin[not AData.Active]].Draw(DC, R); + end; + R := AData.Bounds; + if not ARectangularBottom then + Dec(R.Bottom); + R.Top := ACaptionHeight + ABordersWidth.Top; + R.Right := R.Left + ABordersWidth.Left; + Parts[FLeftBorder[not AData.Active]].Draw(DC, R); + R.Right := AData.Bounds.Right; + R.Left := R.Right - ABordersWidth.Right; + Parts[FRightBorder[not AData.Active]].Draw(DC, R); + end; +end; + +procedure TdxCustomRibbonSkin.DrawFormBorderIcon(DC: HDC; const R: TRect; + AIcon: TdxBorderDrawIcon; AState: TdxBorderIconState); +var + APart: Integer; + GR: TRect; +begin + if LowColors then + DrawFormBorderIconLC(DC, R, AIcon, AState) + else + begin + case AState of + bisHot: APart := 0; + bisPressed: APart := 1; + bisHotInactive: APart := 2; + else + APart := -1; + end; + if APart >= 0 then + Parts[FBorderIcons[APart]].Draw(DC, R); + GR := cxRectBounds(R.Left, R.Top, 9, 9); + OffsetRect(GR, (R.Right - R.Left - 9) div 2, (R.Bottom - R.Top - 9) div 2 + 1); + + case AState of + bisHot: APart := 1; + bisPressed: APart := 2; + bisInactive: APart := 3; + bisHotInactive: APart := 3; + else + APart := 0; + end; + Parts[FBorderIconGlyph[AIcon][APart]].Draw(DC, GR); + end; +end; + +procedure TdxCustomRibbonSkin.DrawFormCaption(DC: HDC; const R: TRect; + const AData: TdxRibbonFormData); +var + ARect: TRect; +begin + if LowColors then + DrawFormCaptionLC(DC, R, AData) + else + begin + if AData.State = wsMaximized then + Parts[FCaptionZoomed[not AData.Active]].Draw(DC, R) + else if AData.State = wsMinimized then + begin + ARect := R; + Dec(ARect.Bottom, 1); + Parts[FCaption[not AData.Active]].Draw(DC, ARect); + ARect := R; + ARect.Top := ARect.Bottom - 1; + Parts[FBottomBorderThin[not AData.Active]].Draw(DC, ARect); + end + else + Parts[FCaption[not AData.Active]].Draw(DC, R); + end; +end; + +procedure TdxCustomRibbonSkin.DrawFormStatusBarPart(DC: HDC; const R: TRect; + AIsLeft, AIsActive, AIsRaised, AIsRectangular: Boolean); +var + APart: Integer; +begin + if LowColors then + FillRectByColor(DC, R, clBtnFace) + else + begin + APart := 0; + Inc(APart, Ord(AIsRaised)); + Inc(APart, Ord(not AIsActive) * 2); + if AIsLeft then + Parts[FFormStatusBarLeftParts[AIsRectangular][APart]].Draw(DC, R) + else + Parts[FFormStatusBarRightParts[AIsRectangular][APart]].Draw(DC, R); + end; +end; + +procedure TdxCustomRibbonSkin.DrawHelpButton(DC: HDC; const R: TRect; + AState: TdxBorderIconState); +var + APart: Integer; +begin + case AState of + bisHot: APart := DXBAR_HOT; + bisPressed: APart := DXBAR_PRESSED; + else + APart := DXBAR_NORMAL; + end; + if APart = DXBAR_NORMAL then + FillRectByColor(DC, R, GetPartColor(rspRibbonBackground)) + else + DrawSmallButton(DC, R, APart); +end; + +procedure TdxCustomRibbonSkin.DrawHelpButtonGlyph(DC: HDC; const R: TRect; + AGlyph: TBitmap); +var + GR: TRect; +begin + GR := cxRectBounds(R.Left, R.Top, 16, 16); + OffsetRect(GR, (R.Right - R.Left - 16) div 2, (R.Bottom - R.Top - 16) div 2); + Parts[FHelpButton].Draw(DC, GR); +end; + +procedure TdxCustomRibbonSkin.DrawGalleryFilterBandBackground(DC: HDC; + const R: TRect); +begin + Parts[FGalleryFilterBand].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawGalleryGroupHeaderBackground(DC: HDC; const R: TRect); +begin + Parts[FGalleryGroupHeader].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawGroupScrollButton(DC: HDC; const R: TRect; ALeft: Boolean; AState: Integer); +var + I: Integer; +begin + case AState of + DXBAR_HOT: I := 1; + DXBAR_PRESSED: I := 2; + else + I := 0; + end; + Parts[FGroupScrollButtons[ALeft][I]].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawInRibbonGalleryBackground(DC: HDC; + const R: TRect; AState: Integer); +begin + DrawFrame(DC, R, GetPartColor(DXBAR_INRIBBONGALLERY_BACKGROUND, AState), + GetPartColor(DXBAR_INRIBBONGALLERY_BORDER, AState)); +end; + +procedure TdxCustomRibbonSkin.DrawInRibbonGalleryScrollBarButton(DC: HDC; + const R: TRect; AButtonKind: TdxInRibbonGalleryScrollBarButtonKind; + AState: Integer); +begin + case AButtonKind of + gsbkLineUp: + InternalDrawPart(FInRibbonGalleryScrollBarLineUpButton, DC, R, AState); + gsbkLineDown: + InternalDrawPart(FInRibbonGalleryScrollBarLineDownButton, DC, R, AState); + gsbkDropDown: + InternalDrawPart(FInRibbonGalleryScrollBarDropDownButton, DC, R, AState); + end; +end; + +procedure TdxCustomRibbonSkin.DrawLargeButton(DC: HDC; const R: TRect; AState: Integer); +begin + InternalDrawPart(FLargeButtons, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawLargeButtonGlyphBackground(DC: HDC; const R: TRect; AState: Integer); +begin + InternalDrawPart(FLargeButtonGlyphBackgrounds, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawLargeButtonDropButton(DC: HDC; const R: TRect; AState: Integer); +begin + InternalDrawPart(FLargeButtonDropButtons, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawLaunchButtonBackground(DC: HDC; const R: TRect; AState: Integer); +begin + InternalDrawPart(FLaunchButtonBackgrounds, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawLaunchButtonDefaultGlyph(DC: HDC; const R: TRect; AState: Integer); +begin + InternalDrawPart(FLaunchButtonDefaultGlyphs, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawMDIButton(DC: HDC; const R: TRect; + AButton: TdxBarMDIButton; AState: TdxBorderIconState); +var + APart: Integer; + GR: TRect; + AIcon: TdxBorderDrawIcon; +begin + case AState of + bisHot: APart := DXBAR_HOT; + bisPressed: APart := DXBAR_PRESSED; + else + APart := DXBAR_NORMAL; + end; + if APart = DXBAR_NORMAL then + FillRectByColor(DC, R, GetPartColor(rspRibbonBackground)) + else + DrawSmallButton(DC, R, APart); + GR := cxRectBounds(R.Left, R.Top, 9, 9); + OffsetRect(GR, (R.Right - R.Left - 9) div 2, (R.Bottom - R.Top - 9) div 2 + 1); + case AButton of + mdibMinimize: AIcon := bdiMinimize; + mdibRestore: AIcon := bdiRestore; + else + AIcon := bdiClose; + end; + case AState of + bisHot: APart := 1; + bisPressed: APart := 2; + bisInactive: APart := 3; + else + APart := 0; + end; + Parts[FBorderIconGlyph[AIcon][APart]].Draw(DC, GR); +end; + +procedure TdxCustomRibbonSkin.DrawMenuCheck(DC: HDC; const R: TRect; AState: Integer); +begin + InternalDrawPart(FMenuCheck, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawMenuCheckMark(DC: HDC; const R: TRect; AState: Integer); +begin + InternalDrawPart(FMenuCheckMark, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawMenuContent(DC: HDC; const R: TRect); +begin + Parts[FMenuContent].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawMenuDetachCaption(DC: HDC; const R: TRect; AState: Integer); +begin + InternalDrawPart(FMenuDetachCaption, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawMenuGlyph(DC: HDC; const R: TRect); +begin + Parts[FMenuGlyph].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawMenuMark(DC: HDC; const R: TRect); +begin + Parts[FMenuMark].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawMenuSeparatorHorz(DC: HDC; const R: TRect); +begin + Parts[FMenuSeparatorHorz].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawMenuSeparatorVert(DC: HDC; const R: TRect); +begin + Parts[FMenuSeparatorVert].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawMenuScrollArea(DC: HDC; const R: TRect; AState: Integer); +begin + InternalDrawPart(FMenuScrollArea, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawProgressSolidBand(DC: HDC; const R: TRect); +begin + Parts[FProgressSolidBand].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawProgressSubstrate(DC: HDC; const R: TRect); +begin + Parts[FProgressSubstrate].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawProgressDiscreteBand(DC: HDC; const R: TRect); +begin + Parts[FProgressDiscreteBand].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawRibbonBackground(DC: HDC; const R: TRect); +begin + FillRectByColor(DC, R, GetPartColor(rspRibbonBackground)); +end; + +procedure TdxCustomRibbonSkin.DrawRibbonBottomBorder(DC: HDC; const R: TRect); +begin +end; + +procedure TdxCustomRibbonSkin.DrawRibbonClientTopArea(DC: HDC; const R: TRect); +begin + Parts[FRibbonTopArea].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawSmallButton(DC: HDC; const R: TRect; AState: Integer); +begin + InternalDrawPart(FSmallButtons, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawSmallButtonGlyphBackground(DC: HDC; const R: TRect; AState: Integer); +begin + InternalDrawPart(FSmallButtonGlyphBackgrounds, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawSmallButtonDropButton(DC: HDC; const R: TRect; AState: Integer); +begin + InternalDrawPart(FSmallButtonDropButtons, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawScrollArrow(DC: HDC; const R: TRect); +begin + Parts[FScrollArrow].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawScreenTip(DC: HDC; const R: TRect); +begin + Parts[FScreenTip].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawTab(DC: HDC; const R: TRect; AState: TdxRibbonTabState); +begin + if LowColors then + begin + case AState of + rtsNormal: FillRectByColor(DC, R, clBtnFace); + rtsActive: DrawFrame(DC, R, clHighlight, clWhite, [bLeft, bTop, bRight]); + else + DrawFrame(DC, R, clHighlight, clBtnFace, [bTop]); + end; + end + else + Parts[FTabIndex[AState]].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawTabGroupBackground(DC: HDC; const R: TRect; AState: Integer); +begin + if LowColors then + DrawFrame(DC, R, clBtnFace, clBtnShadow, [bTop, bLeft, bRight]) + else + InternalDrawPart(FToolbar, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawTabGroupHeaderBackground(DC: HDC; const R: TRect; AState: Integer); +var + R1: TRect; +begin + if LowColors then + begin + R1 := cxRect(R.Left + 4, R.Top, R.Right - 4, R.Top + 1); + FillRectByColor(DC, R1, clBtnShadow); + ExcludeClipRect(DC, R1); + DrawFrame(DC, R, clBtnFace, clBtnShadow, [bBottom, bLeft, bRight]); + end + else + InternalDrawPart(FToolbarHeader, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawMarkArrow(DC: HDC; const R: TRect; AState: Integer); +var + H: Integer; +begin + H := (R.Bottom - R.Top) div 7; + InternalDrawPart(FMarkArrow, DC, + cxRect(R.Left + 3, R.Top + H * 3, R.Right - 3, R.Bottom - H * 2), AState); +end; + +procedure TdxCustomRibbonSkin.DrawMarkTruncated(DC: HDC; const R: TRect; AState: Integer); +var + H: Integer; +begin + H := (R.Bottom - R.Top) div 7; + InternalDrawPart(FMarkTruncated, DC, + cxRect(R.Left + H + 1, R.Top + H * 3, R.Right - H + 1, R.Bottom - H * 2), AState); +end; + +procedure TdxCustomRibbonSkin.DrawTabGroupsArea(DC: HDC; const R: TRect); +begin + if LowColors then + DrawFrame(DC, R, clBtnFace, clBtnShadow) + else + Parts[FTabGroupsArea].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawTabScrollButton(DC: HDC; const R: TRect; + ALeft: Boolean; AState: Integer); +var + I: Integer; +begin + case AState of + DXBAR_HOT: I := 1; + DXBAR_PRESSED: I := 2; + else + I := 0; + end; + Parts[FTabScrollButtons[ALeft][I]].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawTabSeparator(DC: HDC; const R: TRect; Alpha: Byte); +begin + Parts[FTabSeparator].Draw(DC, R, Alpha); +end; + +procedure TdxCustomRibbonSkin.DrawQuickAccessToolbar(DC: HDC; + const R: TRect; ABellow, ANonClientDraw, AHasApplicationButton, AIsActive, ADontUseAero: Boolean); +var + W, ALeftPart, ARightPart: Integer; + R1: TRect; + AInactive: Boolean; +begin + if not ABellow then + begin + AInactive := ANonClientDraw and not AIsActive; + W := (R.Bottom - R.Top) div 2; + if R.Right - W - R.Left < W then Exit; + R1 := cxRectInflate(R, 0, -3, 0, -4); + if AHasApplicationButton then + R1.Right := R1.Left + 15 + else + R1.Right := R1.Left + 7; + ALeftPart := FQATAtTopLeft[AHasApplicationButton][AInactive]; + ARightPart := FQATAtTopRight[AInactive]; + if ANonClientDraw then + begin + if IsCompositionEnabled and not ADontUseAero then + begin + ALeftPart := FQATGlassAtTopLeft[AHasApplicationButton]; + ARightPart := FQATGlassAtTopRight; + end; + OffsetRect(R1, 0, 1); + end; + Parts[ALeftPart].Draw(DC, R1); + R1.Left := R1.Right; + R1.Right := R.Right - W; + Parts[ARightPart].Draw(DC, R1); + end + else + Parts[FQATAtBottom].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawQuickAccessToolbarDefaultGlyph(DC: HDC; + const R: TRect); +begin + if FLowColors then + begin + FillRectByColor(DC, R, clBtnFace); + end + else + Parts[FQATDefaultGlyph].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawQuickAccessToolbarGroupButton(DC: HDC; + const R: TRect; ABellow, ANonClientDraw, AIsActive: Boolean; AState: Integer); +begin + if ABellow or ANonClientDraw and not AIsActive then + InternalDrawPart(FQATGroupButtonInactive, DC, R, AState) + else + InternalDrawPart(FQATGroupButtonActive, DC, R, AState); +end; + +procedure TdxCustomRibbonSkin.DrawQuickAccessToolbarPopup(DC: HDC; const R: TRect); +begin + if FLowColors then + FillRectByColor(DC, R, clBtnFace) + else + Parts[FQATPopup].Draw(DC, R) +end; + +procedure TdxCustomRibbonSkin.DrawStatusBar(DC: HDC; const R: TRect); +begin + if FLowColors then + FillRectByColor(DC, R, clBtnFace) + else + Parts[FStatusBar].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawStatusBarGripBackground(DC: HDC; const R: TRect); +begin + if FLowColors then + FillRectByColor(DC, R, clBtnFace) + else + Parts[FStatusBarGripBackground].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawStatusBarPanel(DC: HDC; const R: TRect; + AIsLowered: Boolean); +begin + if FLowColors then + FillRectByColor(DC, R, clBtnFace) + else + begin + //todo: + if AIsLowered then + Parts[FStatusBarPanelLowered].Draw(DC, R) + else + Parts[FStatusBarPanelRaised].Draw(DC, R); + end; +end; + +procedure TdxCustomRibbonSkin.DrawStatusBarPanelSeparator(DC: HDC; + const R: TRect); +begin + if FLowColors then + begin + FillRectByColor(DC, R, clBtnFace); + FillRectByColor(DC, cxRect(R.Left, R.Top + 1, R.Left + 1, R.Bottom - 1), clBtnShadow); + end + else + Parts[FStatusBarPanelSeparator].Draw(DC, R); +end; + +procedure TdxCustomRibbonSkin.DrawStatusBarSizeGrip(DC: HDC; const R: TRect); +begin + Office11DrawSizeGrip(DC, R, GetPartColor(rspStatusBarSizeGripColor1), + GetPartColor(rspStatusBarSizeGripColor2)); +end; + +procedure TdxCustomRibbonSkin.DrawStatusBarToolbarSeparator(DC: HDC; const R: TRect); +begin + if FLowColors then + begin + FillRectByColor(DC, R, clBtnFace); + FillRectByColor(DC, cxRect(R.Left, R.Top, R.Left + 1, R.Bottom - 1), clBtnShadow); + end + else + Parts[FStatusBarToolbarSeparator].Draw(DC, R); +end; + +function TdxCustomRibbonSkin.GetApplicationMenuGlyphSize: TSize; +begin + Result := cxSize(42, 42); +end; + +function TdxCustomRibbonSkin.GetSkinName: string; +begin + Result := ''; +end; + +function TdxCustomRibbonSkin.GetCaptionFontSize(ACurrentFontSize: Integer): Integer; +begin + Result := ACurrentFontSize; +end; + +function TdxCustomRibbonSkin.GetMenuSeparatorSize: Integer; +begin + Result := 2; +end; + +function TdxCustomRibbonSkin.GetPartColor(APart: Integer; AState: Integer = 0): TColor; +begin + Result := clDefault; + if LowColors then + begin + case APart of + //!!!TODO: + DXBAR_APPLICATIONMENUCONTENTSIDES: Result := $EDD3BE; + DXBAR_APPLICATIONMENUCONTENTOUTERBORDER: Result := clWhite; + DXBAR_APPLICATIONMENUCONTENTINNERBORDER: Result := $CAAF9B; + DXBAR_MENUEDITSEPARATOR: + case AState of + DXBAR_ACTIVE: Result := $85B6CA; + DXBAR_ACTIVEDISABLED: Result := $CDCDCD; + end; + DXBAR_SCREENTIP_FOOTERLINE: + Result := $DDBB9E; + DXBAR_DATENAVIGATOR_HEADER: + Result := $DAD5D2; + DXBAR_SEPARATOR_BACKGROUND: + Result := $EFE7DE; + rspRibbonBottomEdge: + Result := $F3E2D5; + DXBAR_EDIT_BORDER, DXBAR_EDIT_BUTTON_BORDER: + case AState of + DXBAR_NORMAL, DXBAR_DISABLED: Result := clBtnShadow; + else + Result := clWhite; + end; + DXBAR_EDIT_BACKGROUND: + Result := clBtnFace; + rspFormCaptionText, rspDocumentNameText: + if AState = DXBAR_NORMAL then + Result := clCaptionText + else + Result := clInactiveCaptionText; + rspTabHeaderText: + if AState = DXBAR_NORMAL then + Result := clWindowText + else + Result := clHighlightText; + rspTabGroupHeaderText: + Result := clWindowText; + DXBAR_ITEMTEXT, rspTabGroupText, rspStatusBarText: + case AState of + DXBAR_NORMAL: + Result := clWindowText; + DXBAR_DISABLED: + Result := clGrayText; + else + Result := clHighlightText; + end; + DXBAR_MENUITEMTEXT, DXBAR_GALLERYGROUPHEADERTEXT: + case AState of + DXBAR_NORMAL: + Result := clMenuText; + DXBAR_DISABLED: + Result := clGrayText; + else + Result := clHighlightText; + end; + DXBAR_GALLERYGROUPITEM_OUTERBORDER, DXBAR_GALLERYGROUPITEM_INNERBORDER: + Result := clHighlight; + rfspRibbonForm: + Result := clBtnShadow; + else + Result := clBtnFace; + end; + Result := ColorToRGB(Result); + end + else + case APart of + DXBAR_GALLERYGROUPHEADERTEXT: Result := GetPartColor(DXBAR_MENUITEMTEXT); + DXBAR_MENUEXTRAPANE: Result := $EEEAE9; + DXBAR_MENUARROWSEPARATOR: Result := $BDB6A5; + DXBAR_MENUDETACHCAPTIONAREA: Result := $F7F7F7; + DXBAR_MENUITEMTEXT: + if AState in [DXBAR_DISABLED, DXBAR_ACTIVEDISABLED] then + Result := $A7A7A7; + DXBAR_ITEMTEXT: + case AState of + DXBAR_DISABLED, DXBAR_ACTIVEDISABLED: Result := $8D8D8D; + else + Result := GetPartColor(rspTabGroupText); + end; + DXBAR_DROPDOWNGALLERY: Result := $FAFAFA; + DXBAR_DROPDOWNBORDER_INNERLINE: Result := $F5F5F5; + DXBAR_GALLERYGROUPITEM_OUTERBORDER: + case AState of + DXBAR_HOT: Result := $3694F2; + DXBAR_CHECKED: Result := $1048EF; + DXBAR_HOTCHECK: Result := $3695F2; + end; + DXBAR_GALLERYGROUPITEM_INNERBORDER: + case AState of + DXBAR_HOT: Result := $94E2FF; + DXBAR_CHECKED: Result := $94E2FF; + DXBAR_HOTCHECK: Result := $95E3FF; + end; + end; +end; + +function TdxCustomRibbonSkin.GetPartContentOffsets(APart: Integer): TRect; +begin + Result := cxNullRect; +end; + +function TdxCustomRibbonSkin.GetQuickAccessToolbarMarkButtonOffset( + AHasApplicationButton: Boolean; ABelow: Boolean): Integer; +begin + if ABelow then + Result := 5 + else + Result := 12; +end; + +function TdxCustomRibbonSkin.GetQuickAccessToolbarOverrideWidth( + AHasApplicationButton: Boolean; AUseAeroGlass: Boolean): Integer; +begin + if AHasApplicationButton then + Result := 14 + else + Result := 0; +end; + +function TdxCustomRibbonSkin.GetQuickAccessToolbarLeftIndent( + AHasApplicationButton: Boolean; AUseAeroGlass: Boolean): Integer; +begin + Result := 0; +end; + +function TdxCustomRibbonSkin.GetQuickAccessToolbarRightIndent( + AHasApplicationButton: Boolean): Integer; +begin + Result := 0; +end; + +function TdxCustomRibbonSkin.GetWindowBordersWidth(AHasStatusBar: Boolean): TRect; +begin + Result := cxRect(4, 0, 4, 4); + if AHasStatusBar then + Result.Bottom := 1; +end; + +function TdxCustomRibbonSkin.HasGroupTransparency: Boolean; +begin + Result := False; +end; + +function TdxCustomRibbonSkin.NeedDrawGroupScrollArrow: Boolean; +begin + Result := True; +end; + +procedure TdxCustomRibbonSkin.UpdateBitsPerPixel; +var + DC: HDC; +begin + DC := GetDC(0); + FLowColors := GetDeviceCaps(DC, BITSPIXEL) <= 8; + ReleaseDC(0, DC); +end; + +procedure TdxCustomRibbonSkin.LoadCommonControlSkinFromBitmap(ABitmap: GpBitmap); + + procedure AddElement(var AParts; const R, F: TRect; ID: Integer; + AInterpolationMode: Integer = InterpolationModeNearestNeighbor); + begin + LoadElementParts(ABitmap, AParts, R, ID, F, [0], [0]); + Parts[Integer(AParts)].InterpolationMode := AInterpolationMode; + end; + +begin + AddElement(FQATGlassAtTopLeft[True], cxRectBounds(0, 353, 16, 26), cxRect(0, 2, 2, 2), + rspQATNonClientLeft1Vista, InterpolationModeHighQualityBicubic); + AddElement(FQATGlassAtTopLeft[False], cxRectBounds(34, 353, 4, 26), cxRect(2, 2, 0, 2), + rspQATNonClientLeft2Vista, InterpolationModeHighQualityBicubic); + AddElement(FQATGlassAtTopRight, cxRectBounds(16, 353, 18, 26), cxRect(0, 7, 15, 7), + rspQATNonClientRightVista, InterpolationModeHighQualityBicubic); + LoadCommonButtonParts(ABitmap); + LoadCommonMenuParts(ABitmap); + LoadCommonProgressParts(ABitmap); + FHelpButton := AddPart1x1(ABitmap, cxRectBounds(42, 353, 16, 16), rspHelpButton, '', 7); +end; + +procedure TdxCustomRibbonSkin.LoadCustomControlSkinFromBitmap(ABitmap: GpBitmap); +begin + LoadTab(ABitmap); + LoadScrollButtons(ABitmap); + LoadCustomGroup(ABitmap); + LoadCollapsedToolbar(ABitmap); + LoadCustomButtonParts(ABitmap); + LoadCustomMenuParts(ABitmap); + LoadCustomProgressParts(ABitmap); + LoadCustomScrollArrow(ABitmap); + LoadCustomScreenTip(ABitmap); + LoadQAT(ABitmap); + LoadStatusBar(ABitmap); + LoadGallery(ABitmap); +end; + +procedure TdxCustomRibbonSkin.LoadFormSkinFromBitmap(ABitmap: GpBitmap); + + procedure AddElement(var AParts; const R, F: TRect; ID: Integer; + AInterpolationMode: Integer = InterpolationModeNearestNeighbor); + begin + LoadElementParts(ABitmap, AParts, R, ID, F, [0, 1], [0, 1]); + Parts[TTwoStateArray(AParts)[False]].InterpolationMode := AInterpolationMode; + Parts[TTwoStateArray(AParts)[True]].InterpolationMode := AInterpolationMode; + end; + +var + R, Fixed: TRect; +begin + //caption + AddElement(FCaption, cxRectBounds(0, 37, 14, 31), cxRect(6, 10, 6, 5), rfspActiveCaption); + AddElement(FCaptionZoomed, cxRectBounds(6, 37, 2, 31), cxRect(0, 10, 0, 5), rfspActiveCaptionZoomed); + //caption borders + R := cxRectBounds(0, 37, 4, 31); + Fixed := cxRect(0, 9, 0, 2); + AddElement(FCaptionLeftBorder, R, Fixed, rfspActiveCaptionLeftBorder); + OffsetRect(R, 10, 0); + AddElement(FCaptionRightBorder, R, Fixed, rfspActiveCaptionRightBorder); + //active border + R := cxRectBounds(15, 37, 4, 6); + Fixed := cxRect(0, 0, 0, 5); + AddElement(FLeftBorder, R, Fixed, rfspActiveLeftBorder); + OffsetRect(R, 5, 0); + AddElement(FRightBorder, R, Fixed, rfspActiveRightBorder); + //bottom border + AddElement(FBottomBorderThin, cxRectBounds(15, 50, 2, 2), cxEmptyRect, rfspActiveBottomBorder1); + AddElement(FBottomBorderThick[False], cxRectBounds(40, 113, 10, 4), cxRect(4, 0, 4, 0), rfspActiveBottomBorder2); + AddElement(FBottomBorderThick[True], cxRectBounds(40, 121, 10, 4), cxRect(4, 0, 4, 0), rfspActiveBottomBorder3); + LoadBorderIcons(ABitmap); + //QuickAccessToolbar non-client + AddElement(FQATAtTopLeft[True], cxRectBounds(0, 113, 15, 26), cxRect(13, 5, 0, 5), + rspQATNonClientLeft1Active); + AddElement(FQATAtTopLeft[False], cxRectBounds(32, 113, 7, 26), cxRect(2, 5, 0, 5), + rspQATNonClientLeft2Active); + AddElement(FQATAtTopRight, cxRectBounds(13, 113, 18, 26), cxRect(0, 5, 13, 5), + rspQATNonClientRightActive); + + FRibbonTopArea := AddPart3x3(ABitmap, cxRectBounds(6, 38, 2, 30), cxRect(0, 9, 0, 5), rspRibbonClientTopArea); + LoadApplicationButton(ABitmap); +end; + +procedure TdxCustomRibbonSkin.DrawApplicationButtonLC(DC: HDC; const R: TRect; + AState: TdxApplicationButtonState); +var + ARect: TRect; + AIndex: Integer; + APen: HPEN; + ABrush: HBRUSH; + AColor: TColor; + B: TLogBrush; +begin + AIndex := SaveDC(DC); + if AState <> absPressed then + AColor := ColorToRgb(clWhite) + else + AColor := ColorToRgb(clBtnShadow); + APen := CreatePen(PS_SOLID, 3, AColor); + if AState = absNormal then + AColor := ColorToRgb(clBtnFace) + else + AColor := ColorToRgb(clHighlight); + ABrush := CreateSolidBrush(AColor); + ARect := cxRectInflate(R, -1, -1); + Dec(ARect.Right); + Dec(ARect.Bottom); + SelectObject(DC, APen); + SelectObject(DC, ABrush); + Ellipse(DC, ARect.Left, ARect.Top, ARect.Right, ARect.Bottom); + DeleteObject(ABrush); + DeleteObject(APen); + APen := CreatePen(PS_SOLID, 1, 0); + B.lbStyle := BS_NULL; + B.lbColor := 0; + B.lbHatch := 0; + ABrush := CreateBrushIndirect(B); + SelectObject(DC, APen); + SelectObject(DC, ABrush); + Ellipse(DC, ARect.Left, ARect.Top, ARect.Right, ARect.Bottom); + DeleteObject(ABrush); + DeleteObject(APen); + RestoreDC(DC, AIndex); +end; + +procedure TdxCustomRibbonSkin.DrawApplicationMenuBorderLC(DC: HDC; + const R: TRect); +begin + DrawFrame(DC, R, clMenu, clBlack); +end; + +procedure TdxCustomRibbonSkin.DrawBlackArrow(DC: HDC; const R: TRect; AArrowDirection: TcxArrowDirection); +var + APoints: TcxArrowPoints; + ARgn: HRGN; +begin + TcxCustomLookAndFeelPainter.CalculateArrowPoints(R, APoints, AArrowDirection, False, 4); + case AArrowDirection of + adDown: + begin + Dec(APoints[0].X); + Dec(APoints[1].X); + end; + end; + ARgn := CreatePolygonRgn(APoints, 3, WINDING); + FillRgn(DC, ARgn, GetStockObject(BLACK_BRUSH)); + DeleteObject(ARgn); +end; + +procedure TdxCustomRibbonSkin.DrawFormBordersLC(DC: HDC; + const ABordersWidth: TRect; ACaptionHeight: Integer; + const AData: TdxRibbonFormData); +var + R: TRect; +begin + R := AData.Bounds; + //R.Top := ACaptionHeight + ABordersWidth.Top; + R.Right := R.Left + 2; + FillRectByColor(DC, R, clBtnHighlight); + R.Right := R.Left + ABordersWidth.Left; + Inc(R.Left, 2); + FillRectByColor(DC, R, clBtnFace); + + R.Right := AData.Bounds.Right; + R.Left := R.Right - 1; + FillRectByColor(DC, R, cl3DDkShadow); + OffsetRect(R, -1, 0); + FillRectByColor(DC, R, clBtnShadow); + R.Right := AData.Bounds.Right - 2; + R.Left := R.Right - (ABordersWidth.Right - 2); + FillRectByColor(DC, R, clBtnFace); + + R := AData.Bounds; + R.Top := R.Bottom - 1; + FillRectByColor(DC, R, cl3DDkShadow); +end; + +procedure TdxCustomRibbonSkin.DrawFormBorderIconLC(DC: HDC; const R: TRect; + AIcon: TdxBorderDrawIcon; AState: TdxBorderIconState); +const + Pushes: array[Boolean] of Integer = (0, DFCS_PUSHED); + Buttons: array[TdxBorderDrawIcon] of Integer = ( + DFCS_CAPTIONMIN, DFCS_CAPTIONMAX, DFCS_CAPTIONRESTORE, + DFCS_CAPTIONCLOSE, DFCS_CAPTIONHELP); +begin + DrawFrameControl(DC, cxRect(R.Left + 1, R.Top + 2, R.Right - 1, R.Bottom), + DFC_CAPTION, Buttons[AIcon] or Pushes[AState = bisPressed]); +end; + +procedure TdxCustomRibbonSkin.DrawFormCaptionLC(DC: HDC; const R: TRect; + const AData: TdxRibbonFormData); +var + ARect: TRect; +begin + if AData.State <> wsMaximized then + begin + ARect := R; + ARect.Bottom := ARect.Top + 1; + FillRectByColor(DC, ARect, clBtnHighlight); + ExcludeClipRect(DC, ARect); + OffsetRect(ARect, 0, 1); + FillRectByColor(DC, ARect, clBtnFace); + ExcludeClipRect(DC, ARect); + end; + if AData.Active then + FillRectByColor(DC, R, clActiveCaption) + else + FillRectByColor(DC, R, clInactiveCaption); +end; + +procedure TdxCustomRibbonSkin.DrawDropDownGalleryVerticalSizeGrip(DC: HDC; + const R: TRect); +var + ARect: TRect; +begin + ARect := Rect(0, R.Top, 0, R.Bottom); + ARect.Right := DropDownGalleryVerticalSizeGripBitmapSize.cx * + cxRectHeight(ARect) div DropDownGalleryVerticalSizeGripBitmapSize.cy; + OffsetRect(ARect, (cxRectWidth(R) - cxRectWidth(ARect)) div 2, 0); + Parts[FDropDownGalleryVerticalSizeGrip].Draw(DC, ARect); +end; + +procedure TdxCustomRibbonSkin.LoadFormSkin; +var + ABitmap: GpBitmap; +begin + LoadFormSkinBitmap(ABitmap); + LoadFormSkinFromBitmap(ABitmap); + GdipDisposeImage(ABitmap); +end; + +procedure TdxCustomRibbonSkin.LoadRibbonSkin; +var + ABitmap: GpBitmap; +begin + LoadCommonRibbonSkinBitmap(ABitmap); + LoadCommonControlSkinFromBitmap(ABitmap); + GdipDisposeImage(ABitmap); + //custom skin + LoadCustomRibbonSkinBitmap(ABitmap); + LoadCustomControlSkinFromBitmap(ABitmap); + GdipDisposeImage(ABitmap); +end; + +procedure TdxCustomRibbonSkin.LoadCommonRibbonSkinBitmap(out ABitmap: GpBitmap); +begin + LoadBitmapFromStream('RIBBONCOMMON', ABitmap); +end; + +procedure TdxCustomRibbonSkin.LoadApplicationButton(ABitmap: GpBitmap); +begin + LoadThreeStateArray(ABitmap, cxRectBounds(0, 166, 42, 42), cxEmptyRect, + FApplicationButton, rspApplicationButtonNormal, InterpolationModeHighQualityBicubic); +end; + +const + DefaultFixedSize: TRect = (Left: 2; Top: 2; Right: 2; Bottom: 2); + +procedure TdxCustomRibbonSkin.LoadBorderIcons(ABitmap: GpBitmap); +const + IconWidth = 25; + IconHeight = 25; + IconGlyphWidth = 9; + IconGlyphHeight = 9; +var + I: TdxBorderDrawIcon; + X, Y, ID: Integer; + R: TRect; +begin + X := 0; + Y := 0; + ID := rfspMinimizeNormalIconGlyph; + for I := Low(TdxBorderDrawIcon) to High(TdxBorderDrawIcon) do + begin + R := cxRectBounds(X, Y, IconGlyphWidth, IconGlyphHeight); + LoadElementParts(ABitmap, FBorderIconGlyph[I], R, ID, DefaultFixedSize, + [0, 1, 2, 3], [0, 1, 2, 3], True, InterpolationModeNearestNeighbor); + Inc(X, IconGlyphWidth + 1); + Inc(ID, 4); + end; + R := cxRectBounds(25, 37, IconWidth, IconHeight); + LoadElementParts(ABitmap, FBorderIcons, R, rfspBorderIconHot, + DefaultFixedSize, [0,1,2], [0,1,2], True, InterpolationModeNearestNeighbor); +end; + +procedure TdxCustomRibbonSkin.LoadCustomButtonParts(ABitmap: GpBitmap); +const + ArrowDownWidth = 5; + ArrowDownHeight = 4; + MenuArrowDownWidth = 7; + MenuArrowDownHeight = 4; + EditButtonWidth = 12; + EditButtonHeight = 20; + + ApplicationMenuButtonWidth = 6; + ApplicationMenuButtonHeight = 22; + + ButtonGroupWidth = 3; + ButtonGroupHeight = 22; + ButtonGroupBorderWidth = 2; + ButtonGroupMiddleBorderWidth = 1; + + LaunchButtonGlyphSize = 12; +begin + LoadElementParts(ABitmap, FArrowsDown, + cxRectBounds(0, 237, ArrowDownWidth, ArrowDownHeight), + rspArrowDownNormal, cxEmptyRect, [0, 1, 2, 2, 2, 2, 0, 0, 1]); + LoadElementParts(ABitmap, FEditButtons, + cxRectBounds(0, 116, EditButtonWidth, EditButtonHeight), + rspEditButtonNormal, DefaultFixedSize, [0, 1, 2, 3, 4, 5, 1], + [DXBAR_NORMAL..DXBAR_DROPPEDDOWN, DXBAR_ACTIVEDISABLED]); + FMenuArrowDown := AddPart1x1(ABitmap, cxRectBounds(6, 245, MenuArrowDownWidth, MenuArrowDownHeight), rspMenuArrowDown); + FMenuArrowRight := AddPart1x1(ABitmap, cxRectBounds(6, 237, MenuArrowDownHeight, MenuArrowDownWidth), rspMenuArrowRight); + + FApplicationMenuButton := AddPart3x3(ABitmap, cxRectBounds(0, 250, ApplicationMenuButtonWidth, ApplicationMenuButtonHeight), DefaultFixedSize, rspApplicationMenuButton); + + LoadElementParts(ABitmap, FButtonGroup, + cxRectBounds(73, 0, ButtonGroupWidth, ButtonGroupHeight), + rspButtonGroupNormal, Rect(1, 2, 1, 2), []); + + FButtonGroupBorderLeft := AddPart3x3(ABitmap, cxRectBounds(37, 197, ButtonGroupBorderWidth, ButtonGroupHeight), + Rect(0, 2, 0, 2), rspButtonGroupBorderLeft); + FButtonGroupBorderRight := AddPart3x3(ABitmap, cxRectBounds(38, 197, ButtonGroupBorderWidth, ButtonGroupHeight), + Rect(0, 2, 0, 2), rspButtonGroupBorderRight); + LoadElementParts(ABitmap, FButtonGroupBorderMiddle, + cxRectBounds(40, 86, ButtonGroupMiddleBorderWidth, ButtonGroupHeight), + rspButtonGroupBorderMiddleNormal, Rect(0, 2, 0, 2), [0, 1, 2, 2, 2, 2, 2, 2, 3]); + LoadElementParts(ABitmap, FButtonGroupSplitButtonSeparator, + cxRectBounds(37, 86, ButtonGroupBorderWidth, ButtonGroupHeight), + rspButtonGroupSplitButtonSeparatorNormal, Rect(0, 2, 0, 2), [0, 1, 2, 2, 3, 2, 2, 2, 4]); + + LoadElementParts(ABitmap, FLaunchButtonDefaultGlyphs, + cxRectBounds(34, 249, LaunchButtonGlyphSize, LaunchButtonGlyphSize), + rspLaunchButtonDefaultGlyphNormal, cxNullRect, [0, 1, 0, 0, 0], + [DXBAR_NORMAL, DXBAR_DISABLED, DXBAR_HOT, DXBAR_ACTIVE, DXBAR_PRESSED], True, 5); +end; + +procedure TdxCustomRibbonSkin.LoadCustomGroup(ABitmap: GpBitmap); +var + R1, R2: TRect; +begin + R1 := cxRectBounds(13, 116, 11, 92); + R2 := cxRect(5, 17, 5, 7); + FTabGroupsArea := AddPart3x3(ABitmap, R1, R2, rspTabGroupsArea); + R1 := cxRectBounds(66, 350, 8, 68); + R2 := cxRect(3, 14, 3, 0); + LoadElementParts(ABitmap, FToolbar, R1, rspToolbarNormal, R2, [], + [DXBAR_NORMAL, DXBAR_HOT], False); + R1 := cxRectBounds(66, 418, 8, 17); + R2 := cxRect(3, 0, 3, 3); + LoadElementParts(ABitmap, FToolbarHeader, R1, rspToolbarHeaderNormal, R2, [], + [DXBAR_NORMAL, DXBAR_HOT], False); + + R1 := cxRectBounds(36, 220, 7, 7); + LoadElementParts(ABitmap, FMarkArrow, R1, rspMarkArrowNormal, cxEmptyRect, + [0, 0, 1], [DXBAR_NORMAL, DXBAR_HOT, DXBAR_PRESSED], True); + R1 := cxRectBounds(37, 234, 7, 7); + LoadElementParts(ABitmap, FMarkTruncated, R1, rspMarkTruncatedNormal, cxEmptyRect, + [0, 0, 1], [DXBAR_NORMAL, DXBAR_HOT, DXBAR_PRESSED], True); +end; + +procedure TdxCustomRibbonSkin.LoadCustomMenuParts(ABitmap: GpBitmap); +begin + FApplicationMenuBorder := AddPart3x3(ABitmap, cxRectBounds(48, 321, 8, 8), Rect(3, 3, 3, 3), rspApplicationMenuBorder); + FApplicationMenuContentHeader := AddPart1x1(ABitmap, cxRectBounds(57, 325, 2, 14), rspApplicationMenuContentHeader); + FApplicationMenuContentFooter := AddPart1x1(ABitmap, cxRectBounds(62, 323, 2, 25), rspApplicationMenuContentFooter); + FMenuMark := AddPart1x1(ABitmap, cxRectBounds(49, 277, 16, 16), rspMenuMark); + FMenuScrollArea[DXBAR_NORMAL] := AddPart3x3(ABitmap, cxRectBounds(20, 237, 4, 12), Rect(1, 1, 1, 1), rspMenuScrollAreaNormal); +end; + +procedure TdxCustomRibbonSkin.LoadCustomProgressParts(ABitmap: GpBitmap); +begin + FProgressSubstrate := AddPart3x3(ABitmap, cxRectBounds(11, 237, 7, 7), DefaultFixedSize, rspProgressSubstrate); +end; + +procedure TdxCustomRibbonSkin.LoadCustomScrollArrow(ABitmap: GpBitmap); +begin + FScrollArrow := AddPart1x1(ABitmap, cxRectBounds(14, 245, 5, 3), rspScrollArrow); +end; + +procedure TdxCustomRibbonSkin.LoadCustomScreenTip(ABitmap: GpBitmap); +begin + FScreenTip := AddPart3x3(ABitmap, cxRectBounds(66, 0, 6, 165), DefaultFixedSize, rspScreenTip); +end; + +procedure TdxCustomRibbonSkin.LoadGallery(ABitmap: GpBitmap); +begin + LoadInRibbonGalleryScrollBarParts(ABitmap); + FGalleryFilterBand := AddPart3x3(ABitmap, cxRectBounds(7, 250, 4, 13), + cxRectBounds(1, 1, 1, 0), rspGalleryFilterBand); + FGalleryGroupHeader := AddPart3x3(ABitmap, cxRectBounds(0, 273, 4, 4), + cxRectBounds(0, 0, 0, 2), rspGalleryGroupHeader); + FDropDownGalleryTopSizingBand := AddPart3x3(ABitmap, cxRectBounds(38, 29, 4, 11), + cxRectBounds(1, 1, 1, 1), rspDropDownGalleryTopSizingBand); + FDropDownGalleryBottomSizingBand := AddPart3x3(ABitmap, cxRectBounds(33, 29, 4, 11), + cxRectBounds(1, 1, 1, 1), rspDropDownGalleryBottomSizingBand); + FDropDownGalleryTopSizeGrip := AddPart3x3(ABitmap, cxRectBounds(54, 423, 7, 7), + cxEmptyRect, rspDropDownGalleryTopSizeGrip, '', InterpolationModeNearestNeighbor); + FDropDownGalleryBottomSizeGrip := AddPart3x3(ABitmap, cxRectBounds(46, 423, 7, 7), + cxEmptyRect, rspDropDownGalleryBottomSizeGrip, '', InterpolationModeNearestNeighbor); + FDropDownGalleryVerticalSizeGrip := AddPart3x3(ABitmap, cxRectBounds(46, 431, + DropDownGalleryVerticalSizeGripBitmapSize.cx, DropDownGalleryVerticalSizeGripBitmapSize.cy), + cxEmptyRect, rspDropDownGalleryVerticalSizeGrip); +end; + +procedure TdxCustomRibbonSkin.LoadTab(ABitmap: GpBitmap); +begin + LoadElementParts(ABitmap, FTabIndex, cxRectBounds(0, 0, 24, 23), rspTabNormal, + cxRect(4, 4, 4, 4), [0,1,2,3,4], [0,1,2,3,4]); + FTabSeparator := AddPart1x1(ABitmap, cxRectBounds(42, 86, 1, 22), rspTabSeparator); +end; + +procedure TdxCustomRibbonSkin.LoadScrollButtons(ABitmap: GpBitmap); +var + R, FR: TRect; +begin + FR := cxRect(3, 4, 3, 5); + R := cxRectBounds(46, 350, 9, 24); + LoadThreeStateArray(ABitmap, R, FR, FTabScrollButtons[True], rspTabScrollLeftButtonNormal); + R := cxRectBounds(56, 350, 9, 24); + LoadThreeStateArray(ABitmap, R, FR, FTabScrollButtons[False], rspTabScrollRightButtonNormal); + R := cxRectBounds(48, 0, 8, 92); + LoadThreeStateArray(ABitmap, R, cxRect(4, 4, 2, 4), FGroupScrollButtons[True], rspGroupScrollLeftButtonNormal); + R := cxRectBounds(57, 0, 8, 92); + LoadThreeStateArray(ABitmap, R, cxRect(2, 4, 4, 4), FGroupScrollButtons[False], rspGroupScrollRightButtonNormal); +end; + +procedure TdxCustomRibbonSkin.LoadQAT(ABitmap: GpBitmap); + + procedure LoadGroupButton(R: TRect; AStartID: Integer; var AStates: TFourStateArray); + var + I: Integer; + begin + for I := 0 to 3 do + begin + AStates[I] := AddPart3x3(ABitmap, R, cxRect(2, 2, 2, 2), AStartID + I); + OffsetRect(R, 0, cxRectHeight(R)); + end; + end; + +begin + FQATAtBottom := AddPart3x3(ABitmap, cxRectBounds(13, 209, 10, 26), + cxRect(3, 3, 3, 3), rspQATAtBottom); + FQATPopup := AddPart3x3(ABitmap, cxRectBounds(33, 0, 6, 28), + cxRect(2, 2, 2, 2), rspQATPopup); + + LoadElementParts(ABitmap, FQATGroupButtonActive, cxRectBounds(0, 350, 22, 22), + rspQATGroupButtonActive, DefaultFixedSize, [0, 3, 1, 1, 2, 2, 1], + [DXBAR_NORMAL, DXBAR_DISABLED, DXBAR_HOT, DXBAR_ACTIVE, DXBAR_PRESSED, DXBAR_DROPPEDDOWN, DXBAR_ACTIVEDISABLED]); + LoadElementParts(ABitmap, FQATGroupButtonInactive, cxRectBounds(23, 350, 22, 22), + rspQATGroupButtonInactive, DefaultFixedSize, [0, 3, 1, 1, 2, 2, 1], + [DXBAR_NORMAL, DXBAR_DISABLED, DXBAR_HOT, DXBAR_ACTIVE, DXBAR_PRESSED, DXBAR_DROPPEDDOWN, DXBAR_ACTIVEDISABLED]); +end; + +procedure TdxCustomRibbonSkin.LoadStatusBar(ABitmap: GpBitmap); +begin + FStatusBar := AddPart1x3(ABitmap, cxRectBounds(42, 138, 2, 22), 2, 3, rspStatusBar); + FStatusBarPanel := FStatusBar; + FStatusBarPanelLowered := FStatusBar; + FStatusBarPanelRaised := AddPart1x3(ABitmap, cxRectBounds(42, 160, 2, 22), 2, 3, rspStatusBarPanelRaised); + + FStatusBarPanelSeparator := AddPart1x3(ABitmap, cxRectBounds(42, 183, 3, 22), 2, 3, rspStatusBarPanelSeparator); + FStatusBarToolbarSeparator := AddPart1x3(ABitmap, cxRectBounds(45, 138, 2, 22), 2, 3, rspStatusBarToolbarSeparator); + FStatusBarGripBackground := AddPart3x3(ABitmap, cxRectBounds(42, 183, 5, 22), + cxRect(3, 2, 0, 3), rspStatusBarGripBackground); + + LoadElementParts(ABitmap, FFormStatusBarLeftParts[False], cxRectBounds(77, 241, 4, 22), rspStatusBarFormLeftPart, + cxRect(0, 2, 0, 3), [0, 1, 2, 3], [0, 1, 2, 3]); + LoadElementParts(ABitmap, FFormStatusBarLeftParts[True], cxRectBounds(85, 241, 4, 22), rspStatusBarFormLeftPartDialog, + cxRect(0, 2, 0, 3), [0, 1, 2, 3], [0, 1, 2, 3]); + LoadElementParts(ABitmap, FFormStatusBarRightParts[False], cxRectBounds(81, 241, 4, 22), rspStatusBarFormRightPart, + cxRect(0, 2, 0, 3), [0, 1, 2, 3], [0, 1, 2, 3]); + LoadElementParts(ABitmap, FFormStatusBarRightParts[True], cxRectBounds(89, 241, 4, 22), rspStatusBarFormRightPartDialog, + cxRect(0, 2, 0, 3), [0, 1, 2, 3], [0, 1, 2, 3]); +end; + +procedure TdxCustomRibbonSkin.LoadCollapsedToolbar(ABitmap: GpBitmap); +const + CollapsedToolbarWidth = 7; + CollapsedToolbarHeight = 85; + CollapsedToolbarFixedSize: TRect = (Left: 3; Top: 15; Right: 3; Bottom: 3); + CollapsedToolbarGlyphBackgroundWidth = 10; + CollapsedToolbarGlyphBackgroundHeight = 31; + CollapsedToolbarGlyphBackgroundFixedSize: TRect = (Left: 4; Top: 9; Right: 4; Bottom: 8); +begin + LoadElementParts(ABitmap, FCollapsedToolbars, + cxRectBounds(25, 0, CollapsedToolbarWidth, CollapsedToolbarHeight), + rspCollapsedToolbarNormal, CollapsedToolbarFixedSize, [0,1,3,2], + [DXBAR_NORMAL, DXBAR_HOT, DXBAR_ACTIVE, DXBAR_PRESSED]); + LoadElementParts(ABitmap, FCollapsedToolbarGlyphBackgrounds, + cxRectBounds(66, 199, CollapsedToolbarGlyphBackgroundWidth, + CollapsedToolbarGlyphBackgroundHeight), + rspCollapsedToolbarGlyphBackgroundNormal, + CollapsedToolbarGlyphBackgroundFixedSize, [0,1,3,2], + [DXBAR_NORMAL, DXBAR_HOT, DXBAR_ACTIVE, DXBAR_PRESSED]); +end; + +procedure TdxCustomRibbonSkin.InternalDrawPart(const AParts: TStatesArray; + DC: HDC; const R: TRect; AState: Integer); +begin + if AParts[AState] <> 0 then + begin + if LowColors then + begin + if AState in [DXBAR_HOT, DXBAR_CHECKED, DXBAR_HOTCHECK] then + DrawFrame(DC, R, clHighlight, clWhite) + else if AState = DXBAR_PRESSED then + DrawFrame(DC, R, clHighlight, clBtnShadow) + else + DrawFrame(DC, R, clBtnFace, clBtnShadow); + end + else + Parts[AParts[AState]].Draw(DC, R); + end; +end; + +procedure TdxCustomRibbonSkin.LoadThreeStateArray(ABitmap: GpBitmap; R: TRect; + const Fixed: TRect; var AStateArray: TThreeStateArray; AStartID: Integer; + AInterpolationMode: Integer = InterpolationModeDefault); +var + I: Integer; +begin + for I := 0 to 2 do + begin + AStateArray[I] := AddPart3x3(ABitmap, R, Fixed, AStartID, '', AInterpolationMode); + OffsetRect(R, 0, R.Bottom - R.Top); + Inc(AStartID); + end; +end; + +procedure TdxCustomRibbonSkin.LoadCommonButtonParts(ABitmap: GpBitmap); +const + SmallButtonSize = 22; + SmallButtonGlyphBackgroundWidth = 29; + SmallButtonDropButtonWidth = 12; + + LargeButtonWidth = 42; + LargeButtonHeight = 66; + LargeButtonGlyphBackgroundWidth = 42; + LargeButtonGlyphBackgroundHeight = 39; + LargeButtonDropButtonWidth = 42; + LargeButtonDropButtonHeight = 27; + + LaunchButtonWidth = 15; + LaunchButtonHeight = 14; +begin + LoadElementParts(ABitmap, FSmallButtons, + cxRectBounds(99, 155, SmallButtonSize, SmallButtonSize), + rspSmallButtonNormal, DefaultFixedSize, [0, 0, 1, 2, 2, 3, 4], DXBAR_BTN_STATES); + LoadElementParts(ABitmap, FSmallButtonGlyphBackgrounds, + cxRectBounds(86, 0, SmallButtonGlyphBackgroundWidth, SmallButtonSize), + rspSmallButtonGlyphBackgroundNormal, DefaultFixedSize, [], DXBAR_BTN_STATES); + LoadElementParts(ABitmap, FSmallButtonDropButtons, + cxRectBounds(86, 155, SmallButtonDropButtonWidth, SmallButtonSize), + rspSmallButtonDropButtonNormal, DefaultFixedSize, [], DXBAR_BTN_STATES); + + LoadElementParts(ABitmap, FLargeButtons, + cxRectBounds(0, 0, LargeButtonWidth, LargeButtonHeight), + rspLargeButtonNormal, DefaultFixedSize, [0, 0, 1, 2, 2, 3, 4], DXBAR_BTN_STATES); + LoadElementParts(ABitmap, FLargeButtonGlyphBackgrounds, + cxRectBounds(43, 0, LargeButtonGlyphBackgroundWidth, LargeButtonGlyphBackgroundHeight), + rspLargeButtonGlyphBackgroundNormal, DefaultFixedSize, [0, 1, 2, 1, 3, 4], DXBAR_BTN_STATES); + LoadElementParts(ABitmap, FLargeButtonDropButtons, + cxRectBounds(43, 235, LargeButtonDropButtonWidth, LargeButtonDropButtonHeight), + rspLargeButtonDropButtonNormal, DefaultFixedSize, [0, 1, 1, 2, 2, 0, 3], DXBAR_BTN_STATES); + + LoadElementParts(ABitmap, FLaunchButtonBackgrounds, + cxRectBounds(101, 350, LaunchButtonWidth, LaunchButtonHeight), + rspLaunchButtonBackgroundNormal, DefaultFixedSize, [0, 0, 1], + [DXBAR_HOT, DXBAR_ACTIVE, DXBAR_PRESSED]); +end; + +procedure TdxCustomRibbonSkin.LoadCommonMenuParts(ABitmap: GpBitmap); +const + MenuCheckSize = 6; + MenuCheckMarkSize = 20; + MenuDetachCaptionSize = 5; + MenuSeparatorSize = 2; // same as dxBar +begin + LoadElementParts(ABitmap, FMenuDetachCaption, + cxRectBounds(1, 331, MenuDetachCaptionSize, MenuDetachCaptionSize), + rspMenuDetachCaptionNormal, DefaultFixedSize, [], [DXBAR_NORMAL, DXBAR_HOT]); + LoadElementParts(ABitmap, FMenuCheck, + cxRectBounds(99, 310, MenuCheckSize, MenuCheckSize), + rspMenuCheckNormal, DefaultFixedSize, [], [DXBAR_NORMAL, DXBAR_DISABLED]); + LoadElementParts(ABitmap, FMenuCheckMark, + cxRectBounds(99, 266, MenuCheckMarkSize, MenuCheckMarkSize), + rspMenuCheckMarkNormal, DefaultFixedSize, [], [DXBAR_NORMAL, DXBAR_DISABLED]); + + FMenuGlyph := AddPart3x3(ABitmap, cxRectBounds(14, 331, 3, 4), Rect(1, 1, 0, 1), rspMenuGlyph); + FMenuContent := AddPart3x3(ABitmap, cxRectBounds(18, 331, 3, 4), Rect(0, 1, 1, 1), rspMenuContent); + FMenuSeparatorHorz := AddPart1x1(ABitmap, cxRectBounds(17, 337, MenuSeparatorSize, MenuSeparatorSize), rspMenuSeparatorHorz); + FMenuSeparatorVert := AddPart1x1(ABitmap, cxRectBounds(14, 336, MenuSeparatorSize, MenuSeparatorSize), rspMenuSeparatorVert); + FDropDownBorder := AddPart3x3(ABitmap, cxRectBounds(28, 331, 8, 8), Rect(3, 3, 3, 3), rspDropDownBorder); + + LoadElementParts(ABitmap, FMenuScrollArea, + cxRectBounds(86, 310, 6, 12), + rspMenuScrollAreaNormal, DefaultFixedSize, [], [DXBAR_HOT, DXBAR_PRESSED]); + FQATDefaultGlyph := AddPart1x1(ABitmap, cxRectBounds(100, 330, 16, 16), rspQATDefaultGlyph); +end; + +procedure TdxCustomRibbonSkin.LoadCommonProgressParts(ABitmap: GpBitmap); +begin + FProgressSolidBand := AddPart3x3(ABitmap, cxRectBounds(6, 344, 86, 8), DefaultFixedSize, rspProgressSolidband); + FProgressDiscreteBand := AddPart3x3(ABitmap, cxRectBounds(0, 344, 5, 8), DefaultFixedSize, rspProgressDiscreteBand); +end; + +procedure TdxCustomRibbonSkin.LoadInRibbonGalleryScrollBarParts( + ABitmap: GpBitmap); +const + ScrollBarButtonWidth = 15; + ScrollBarButtonHeight = 20; +begin + LoadElementParts(ABitmap, FInRibbonGalleryScrollBarLineUpButton, + cxRectBounds(78, 0, ScrollBarButtonWidth, ScrollBarButtonHeight), + rspInRibbonGalleryScrollBarLineUpButtonNormal, DefaultFixedSize, + [0, 3, 1, 2], [DXBAR_NORMAL, DXBAR_DISABLED, DXBAR_HOT, DXBAR_PRESSED]); + LoadElementParts(ABitmap, FInRibbonGalleryScrollBarLineDownButton, + cxRectBounds(78, 80, ScrollBarButtonWidth, ScrollBarButtonHeight), + rspInRibbonGalleryScrollBarLineDownButtonNormal, DefaultFixedSize, + [0, 3, 1, 2], [DXBAR_NORMAL, DXBAR_DISABLED, DXBAR_HOT, DXBAR_PRESSED]); + LoadElementParts(ABitmap, FInRibbonGalleryScrollBarDropDownButton, + cxRectBounds(78, 160, ScrollBarButtonWidth, ScrollBarButtonHeight), + rspInRibbonGalleryScrollBarDropDownButtonNormal, DefaultFixedSize, + [0, 3, 1, 2], [DXBAR_NORMAL, DXBAR_DISABLED, DXBAR_HOT, DXBAR_PRESSED]); +end; + +{ TdxBlueRibbonSkin } + +procedure TdxBlueRibbonSkin.DrawRibbonBottomBorder(DC: HDC; const R: TRect); +var + R1: TRect; +begin + R1 := R; + Dec(R1.Bottom); + FillRectByColor(DC, R1, $EBC3A4); + OffsetRect(R1, 0, 1); + FillRectByColor(DC, R1, $F3E2D5); +end; + +function TdxBlueRibbonSkin.GetPartColor(APart: Integer; AState: Integer = 0): TColor; +const + RibbonEditHotBackgroundColor = clWhite; + RibbonEditNormalBorderColor = $DEC1AB; + RibbonEditHotBorderColor = $E1C7B3; + RibbonEditDisabledBorderColor = $C6BBB1; +begin + Result := inherited GetPartColor(APart, AState); + if LowColors then Exit; + case APart of + DXBAR_APPLICATIONMENUCONTENTSIDES: Result := $EDD3BE; + DXBAR_APPLICATIONMENUCONTENTOUTERBORDER: Result := clWhite; + DXBAR_APPLICATIONMENUCONTENTINNERBORDER: Result := $CAAF9B; + DXBAR_MENUEDITSEPARATOR: + case AState of + DXBAR_ACTIVE: Result := $85B6CA; + DXBAR_ACTIVEDISABLED: Result := $CDCDCD; + end; + DXBAR_MENUITEMTEXT: + if not (AState in [DXBAR_DISABLED, DXBAR_ACTIVEDISABLED]) then + Result := $6E1500; + DXBAR_EDIT_BORDER: + case AState of + DXBAR_NORMAL: Result := RibbonEditNormalBorderColor; + DXBAR_HOT, DXBAR_ACTIVE, DXBAR_ACTIVEDISABLED: Result := RibbonEditHotBorderColor; + DXBAR_DISABLED: Result := RibbonEditDisabledBorderColor; + DXBAR_FOCUSED, DXBAR_DROPPEDDOWN: Result := RibbonEditHotBorderColor; + end; + DXBAR_EDIT_BACKGROUND: + case AState of + DXBAR_NORMAL: Result := $FBF2EA; + DXBAR_HOT, DXBAR_ACTIVE, DXBAR_ACTIVEDISABLED: Result := RibbonEditHotBackgroundColor; + DXBAR_DISABLED: Result := $EFEFEF; + DXBAR_FOCUSED, DXBAR_DROPPEDDOWN: Result := RibbonEditHotBackgroundColor; + end; + DXBAR_EDIT_BUTTON_BORDER: + case AState of + DXBAR_NORMAL: Result := RibbonEditNormalBorderColor; + DXBAR_ACTIVE: Result := $DEC7AD; + DXBAR_HOT: Result := $99CEDB; + DXBAR_PRESSED: Result := $45667B; + DXBAR_DISABLED, DXBAR_ACTIVEDISABLED: Result := RibbonEditDisabledBorderColor; + DXBAR_DROPPEDDOWN: Result := $6B99A5; + end; + DXBAR_SCREENTIP_FOOTERLINE: + Result := $DDBB9E; + DXBAR_DATENAVIGATOR_HEADER: + Result := $DAD5D2; + DXBAR_SEPARATOR_BACKGROUND: + Result := $EFE7DE; + DXBAR_INRIBBONGALLERY_BACKGROUND: + if AState in [DXBAR_ACTIVE, DXBAR_HOT] then + Result := $FBF3EC + else + Result := $F8E6D4; + DXBAR_INRIBBONGALLERY_BORDER: + Result := $EDD0B9; + DXBAR_GALLERYFILTERBANDTEXT: + if AState = DXBAR_NORMAL then + Result := $6E1500 + else if AState = DXBAR_HOT then + Result := $FF6600 + else + OutError; + rspRibbonBackground: + Result := $FFDBBF; + rspRibbonBottomEdge: + Result := $F3E2D5; + rfspRibbonForm: + Result := $EBC3A4; + rspFormCaptionText: + if AState = DXBAR_NORMAL then + Result := $AA6A3E + else + Result := $A0A0A0; + rspDocumentNameText: + if AState = DXBAR_NORMAL then + Result := $797069 + else + Result := $A0A0A0; + rspTabHeaderText, rspTabGroupText: + Result := $8B4215; + rspTabGroupHeaderText: + Result := $AA6A3E; + rspStatusBarText: + if AState in [DXBAR_NORMAL, DXBAR_HOT] then + Result := $8B4215 + else + Result := $8D8D8D; + rspStatusBarSizeGripColor1: + Result := $805D45; + rspStatusBarSizeGripColor2: + Result := $E8C9B1; + end; +end; + +function TdxBlueRibbonSkin.GetName: string; +begin + Result := 'Blue'; +end; + +procedure TdxBlueRibbonSkin.LoadCustomRibbonSkinBitmap(out ABitmap: GpBitmap); +begin + LoadBitmapFromStream('RIBBONBLUE', ABitmap); +end; + +procedure TdxBlueRibbonSkin.LoadFormSkinBitmap(out ABitmap: GpBitmap); +begin + LoadBitmapFromStream('FORMBLUE', ABitmap); +end; + +{ TdxBlackRibbonSkin } + +procedure TdxBlackRibbonSkin.DrawRibbonBottomBorder(DC: HDC; const R: TRect); +var + R1: TRect; +begin + R1 := R; + Dec(R1.Bottom); + FillRectByColor(DC, R1, $4F4F4F); + OffsetRect(R1, 0, 1); + FillRectByColor(DC, R1, $626262); +end; + +function TdxBlackRibbonSkin.GetPartColor(APart: Integer; AState: Integer = 0): TColor; +const + RibbonEditHotBackgroundColor = clWhite; + RibbonEditNormalBorderColor = $898989; + RibbonEditHotBorderColor = $898989; + RibbonEditDisabledBorderColor = $CCCCCC; + RibbonItemText = $464646; +begin + Result := inherited GetPartColor(APart, AState); + if LowColors then Exit; + case APart of + DXBAR_APPLICATIONMENUCONTENTSIDES: Result := $504F4F; + DXBAR_APPLICATIONMENUCONTENTOUTERBORDER: Result := $716C6B; + DXBAR_APPLICATIONMENUCONTENTINNERBORDER: Result := $414243; + DXBAR_MENUEDITSEPARATOR: + case AState of + DXBAR_ACTIVE: Result := $85B6CA; + DXBAR_ACTIVEDISABLED: Result := $CDCDCD; + end; + DXBAR_MENUITEMTEXT: + if not (AState in [DXBAR_DISABLED, DXBAR_ACTIVEDISABLED]) then + Result := RibbonItemText; + DXBAR_EDIT_BORDER: + case AState of + DXBAR_NORMAL: Result := RibbonEditNormalBorderColor; + DXBAR_HOT, DXBAR_ACTIVE, DXBAR_ACTIVEDISABLED: Result := RibbonEditHotBorderColor; + DXBAR_DISABLED: Result := RibbonEditDisabledBorderColor; + DXBAR_FOCUSED, DXBAR_DROPPEDDOWN: Result := RibbonEditHotBorderColor; + end; + DXBAR_EDIT_BACKGROUND: + case AState of + DXBAR_NORMAL: Result := $E8E8E8; + DXBAR_HOT, DXBAR_ACTIVE, DXBAR_ACTIVEDISABLED: Result := RibbonEditHotBackgroundColor; + DXBAR_DISABLED: Result := $EFEFEF; + DXBAR_FOCUSED, DXBAR_DROPPEDDOWN: Result := RibbonEditHotBackgroundColor; + end; + DXBAR_EDIT_BUTTON_BORDER: + case AState of + DXBAR_NORMAL: Result := RibbonEditNormalBorderColor; + DXBAR_ACTIVE: Result := $B7B7B7; + DXBAR_HOT: Result := $99CEDB; + DXBAR_PRESSED: Result := $45667B; + DXBAR_DISABLED, DXBAR_ACTIVEDISABLED: Result := RibbonEditDisabledBorderColor; + DXBAR_DROPPEDDOWN: Result := $6B99A5; + end; + DXBAR_DATENAVIGATOR_HEADER: + Result := $DAD5D2; + DXBAR_SEPARATOR_BACKGROUND: + Result := $EFEBEF; + DXBAR_SCREENTIP_FOOTERLINE: + Result := $A49991; + DXBAR_INRIBBONGALLERY_BACKGROUND: + if AState in [DXBAR_ACTIVE, DXBAR_HOT] then + Result := $F7F7F7 + else + Result := $E2E2DA; + DXBAR_INRIBBONGALLERY_BORDER: + Result := $ACACAC; + DXBAR_GALLERYFILTERBANDTEXT: + if AState = DXBAR_NORMAL then + Result := $FFFFFF + else if AState = DXBAR_HOT then + Result := $32D2FF + else + OutError; + rspRibbonBackground: + Result := $535353; + rspRibbonBottomEdge: + Result := $626262; + rfspRibbonForm: + Result := $696969; + rspFormCaptionText: + if AState = DXBAR_NORMAL then + Result := $FFD1AE + else + Result := $E1E1E1; + rspDocumentNameText: + if AState = DXBAR_NORMAL then + Result := $FFFFFF + else + Result := $E1E1E1; + rspTabHeaderText: + if AState = DXBAR_ACTIVE then + Result := clBlack + else + Result := $FFFFFF; + rspTabGroupText: + Result := RibbonItemText; + rspTabGroupHeaderText: + Result := $FFFFFF; + rspStatusBarText: + case AState of + DXBAR_NORMAL: + Result := $FFFFFF; + DXBAR_HOT: + Result := clBlack; + else + Result := $C2C2C2; + end; + rspStatusBarSizeGripColor1: + Result := $252525; + rspStatusBarSizeGripColor2: + Result := $CCCCCC; + end; +end; + +function TdxBlackRibbonSkin.GetName: string; +begin + Result := 'Black'; +end; + +procedure TdxBlackRibbonSkin.LoadCustomRibbonSkinBitmap(out ABitmap: GpBitmap); +begin + LoadBitmapFromStream('RIBBONBLACK', ABitmap); +end; + +procedure TdxBlackRibbonSkin.LoadFormSkinBitmap(out ABitmap: GpBitmap); +begin + LoadBitmapFromStream('FORMBLACK', ABitmap); +end; + +{ TdxSilverRibbonSkin } + +procedure TdxSilverRibbonSkin.DrawRibbonBottomBorder(DC: HDC; const R: TRect); +var + R1: TRect; +begin + R1 := R; + Dec(R1.Bottom); + FillRectByColor(DC, R1, $808080); + OffsetRect(R1, 0, 1); + FillRectByColor(DC, R1, $DCE1EB); +end; + +function TdxSilverRibbonSkin.GetName: string; +begin + Result := 'Silver'; +end; + +function TdxSilverRibbonSkin.GetPartColor(APart, AState: Integer): TColor; +const + RibbonItemText = $5C534C; +begin + Result := inherited GetPartColor(APart, AState); + if LowColors then Exit; + case APart of + DXBAR_APPLICATIONMENUCONTENTSIDES: Result := $D8D2CD; + DXBAR_APPLICATIONMENUCONTENTOUTERBORDER: Result := $FAFAFA; + DXBAR_APPLICATIONMENUCONTENTINNERBORDER: Result := $B4AEA9; + DXBAR_MENUITEMTEXT: + if not (AState in [DXBAR_DISABLED, DXBAR_ACTIVEDISABLED]) then + Result := RibbonItemText; + DXBAR_INRIBBONGALLERY_BACKGROUND: + if AState in [DXBAR_ACTIVE, DXBAR_HOT] then + Result := $F2F1F0 + else + Result := $ECEAE8; + DXBAR_INRIBBONGALLERY_BORDER: + if AState in [DXBAR_ACTIVE, DXBAR_HOT] then + Result := $A4A4A4 + else + Result := $B8B1A9; + DXBAR_GALLERYFILTERBANDTEXT: + if AState = DXBAR_NORMAL then + Result := $FFFFFF + else if AState = DXBAR_HOT then + Result := $32D2FF + else + OutError; + rspRibbonBackground: + Result := $DDD4D0; + rspRibbonBottomEdge: + Result := $808080; + rfspRibbonForm: + Result := $B5AEAA; + rspFormCaptionText: + if AState = DXBAR_NORMAL then + Result := $AA6E35 + else + Result := $8A8A8A; + rspDocumentNameText: + if AState = DXBAR_NORMAL then + Result := $6A625C + else + Result := $8A8A8A; + rspTabHeaderText: + Result := $595453; + rspTabGroupText, rspTabGroupHeaderText: + Result := RibbonItemText; + rspStatusBarText: + if AState in [DXBAR_NORMAL, DXBAR_HOT] then + Result := $595453 + else + Result := $8D8D8D; + rspStatusBarSizeGripColor1: + Result := $7E77670; + rspStatusBarSizeGripColor2: + Result := $D9D0CD; + end; +end; + +procedure TdxSilverRibbonSkin.LoadCustomRibbonSkinBitmap(out ABitmap: GpBitmap); +begin + LoadBitmapFromStream('RIBBONSILVER', ABitmap); +end; + +procedure TdxSilverRibbonSkin.LoadFormSkinBitmap(out ABitmap: GpBitmap); +begin + LoadBitmapFromStream('FORMSILVER', ABitmap); +end; + +procedure CreateSkins; +begin + if not CheckGdiPlus then Exit; + SkinManager.AddSkin(TdxBlueRibbonSkin.Create); + SkinManager.AddSkin(TdxBlackRibbonSkin.Create); + SkinManager.AddSkin(TdxSilverRibbonSkin.Create); +end; + +procedure DestroySkins; +var + I: Integer; +begin + for I := SkinManager.SkinCount - 1 downto 0 do + if SkinManager[I] is TdxCustomRibbonSkin then + SkinManager.RemoveSkin(SkinManager[I]); +end; + +initialization + dxUnitsLoader.AddUnit(@CreateSkins, @DestroySkins); + +finalization + dxUnitsLoader.RemoveUnit(@DestroySkins); + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxRibbonStatusBar.pas b/official/x.35/ExpressBars 6/Sources/dxRibbonStatusBar.pas new file mode 100644 index 00000000..510d8c9c --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxRibbonStatusBar.pas @@ -0,0 +1,1289 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressStatusBar } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSTATUSBAR AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxRibbonStatusBar; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Controls, Graphics, ImgList, Forms, + ExtCtrls, dxThemeManager, cxClasses, cxGraphics, cxControls, cxLookAndFeels, + dxBar, dxStatusBar, dxRibbonSkins, dxRibbon; + +type + TdxRibbonStatusBar = class; + TdxStatusBarToolbarPanelStyle = class; + + { TdxRibbonStatusBarBarControlPainter } + + TdxRibbonStatusBarBarControlPainter = class(TdxBarSkinnedPainter) + protected + procedure DrawToolbarContentPart(ABarControl: TdxBarControl; ACanvas: TcxCanvas); override; + procedure DrawToolbarNonContentPart(ABarControl: TdxBarControl; DC: HDC); override; + public + function BarBeginGroupSize: Integer; override; + procedure BarDrawBeginGroup(ABarControl: TCustomdxBarControl; DC: HDC; + ABeginGroupRect: TRect; AToolbarBrush: HBRUSH; AHorz: Boolean); override; + function GetButtonBorderHeight: Integer; override; + function GetEnabledTextColor(ABarItemControl: TdxBarItemControl; + ASelected, AFlat: Boolean): TColor; override; + procedure GetDisabledTextColors(ABarItemControl: TdxBarItemControl; + ASelected, AFlat: Boolean; var AColor1, AColor2: TColor); override; + function GetToolbarContentOffsets(ABar: TdxBar; + ADockingStyle: TdxBarDockingStyle; AHasSizeGrip: Boolean): TRect; override; + function MarkButtonOffset: Integer; virtual; + function MarkSizeX(ABarControl: TdxBarControl): Integer; override; + + function GetColorScheme(ABarControl: TCustomdxBarControl): TdxCustomRibbonSkin; + end; + + { TdxDefaultRibbonStatusBarBarControlPainter } + + TdxDefaultRibbonStatusBarBarControlPainter = class(TdxBarFlatPainter) + public + function GetButtonBorderHeight: Integer; override; + function GetToolbarContentOffsets(ABar: TdxBar; + ADockingStyle: TdxBarDockingStyle; AHasSizeGrip: Boolean): TRect; override; + function MarkButtonOffset: Integer; virtual; + function MarkSizeX(ABarControl: TdxBarControl): Integer; override; + end; + + { TdxRibbonStatusBarBarControlViewInfo } + + TdxRibbonStatusBarBarControlViewInfo = class(TdxRibbonQuickAccessBarControlViewInfo) + protected + function CanShowButtonGroups: Boolean; override; + function CanShowSeparators: Boolean; override; + end; + + { TdxRibbonStatusBarBarControl } + + TdxRibbonStatusBarBarControl = class(TdxRibbonQuickAccessBarControl) + private + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; + function GetStatusBar: TdxRibbonStatusBar; + protected + function CanShowPopupMenuOnMouseClick(AMousePressed: Boolean): Boolean; override; + function GetDefaultItemGlyph: TBitmap; override; + function GetItemControlDefaultViewLevel( + AItemControl: TdxBarItemControl): TdxBarItemViewLevel; override; + function GetMinHeight(AStyle: TdxBarDockingStyle): Integer; override; + function GetRibbon: TdxCustomRibbon; override; + function GetViewInfoClass: TCustomdxBarControlViewInfoClass; override; + procedure InitCustomizationPopup(AItemLinks: TdxBarItemLinks); override; + function IsValid: Boolean; + function MarkExists: Boolean; override; + procedure UpdateDoubleBuffered; override; + + property StatusBar: TdxRibbonStatusBar read GetStatusBar; + end; + + { TdxRibbonStatusBarBarControlDesignHelper } + + TdxRibbonStatusBarBarControlDesignHelper = class(TCustomdxBarControlDesignHelper) + public + class function GetForbiddenActions: TdxBarCustomizationActions; override; + end; + + { TdxRibbonStatusBarDockControl } + + TdxRibbonStatusBarDockControl = class(TdxCustomRibbonDockControl) + private + FStatusBar: TdxRibbonStatusBar; + FPainter: TdxBarPainter; + FPanel: TdxStatusBarPanel; + function GetBarControl: TdxRibbonStatusBarBarControl; + function GetColorScheme: TdxCustomRibbonSkin; + function GetRibbon: TdxCustomRibbon; + protected + procedure CalcLayout; override; + procedure UpdateDoubleBuffered; override; + procedure FillBackground(DC: HDC; const ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); override; + function GetDockedBarControlClass: TdxBarControlClass; override; + function GetOwner: TPersistent; override; + function GetPainter: TdxBarPainter; override; + procedure ShowCustomizePopup; override; + procedure VisibleChanged; override; + + property BarControl: TdxRibbonStatusBarBarControl read GetBarControl; + public + constructor Create(AOwner: TdxStatusBarToolbarPanelStyle); reintroduce; virtual; + destructor Destroy; override; + + property ColorScheme: TdxCustomRibbonSkin read GetColorScheme; + property Panel: TdxStatusBarPanel read FPanel; + property Ribbon: TdxCustomRibbon read GetRibbon; + property StatusBar: TdxRibbonStatusBar read FStatusBar; + end; + + { TdxStatusBarToolbarPanelStyle } + + TdxStatusBarToolbarPanelStyle = class(TdxStatusBarPanelStyle) + private + FDockControl: TdxRibbonStatusBarDockControl; + FLoadedToolbarName: string; + FToolbar: TdxBar; + function GetToolbar: TdxBar; + procedure ReadToolbarName(AReader: TReader); + procedure SetToolbar(Value: TdxBar); + procedure UpdateToolbarValue; + procedure WriteToolbarName(AWriter: TWriter); + protected + function CanDelete: Boolean; override; + function CanSizing: Boolean; override; + procedure DefineProperties(Filer: TFiler); override; + procedure DrawContent(ACanvas: TcxCanvas; R: TRect; APainter: TdxStatusBarPainterClass); override; + function GetMinWidth: Integer; override; + class function GetVersion: Integer; override; + procedure Loaded; override; + procedure PanelVisibleChanged; override; + + function FindBarManager: TdxBarManager; + procedure UpdateByRibbon(ARibbon: TdxCustomRibbon); virtual; + public + constructor Create(AOwner: TdxStatusBarPanel); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + property DockControl: TdxRibbonStatusBarDockControl read FDockControl; + published + property Toolbar: TdxBar read GetToolbar write SetToolbar stored False; + end; + + { TdxRibbonStatusBarPainter } + + TdxRibbonStatusBarPainter = class(TdxStatusBarPainter) + public + // calc + class function BorderSizes(AStatusBar: TdxCustomStatusBar): TRect; override; + class function GripAreaSize: TSize; override; + class function SeparatorSize: Integer; override; + // draw + class procedure DrawBorder(AStatusBar: TdxCustomStatusBar; ACanvas: TcxCanvas; + var R: TRect); override; + class procedure DrawPanelBorder(AStatusBar: TdxCustomStatusBar; ABevel: TdxStatusBarPanelBevel; + ACanvas: TcxCanvas; var R: TRect); override; + class procedure DrawPanelSeparator(AStatusBar: TdxCustomStatusBar; ACanvas: TcxCanvas; + const R: TRect); override; + class procedure DrawSizeGrip(AStatusBar: TdxCustomStatusBar; ACanvas: TcxCanvas; + R: TRect; AOverlapped: Boolean); override; + class function GetPanelBevel(APanel: TdxStatusBarPanel): TdxStatusBarPanelBevel; override; + class function TopBorderSize: Integer; override; + end; + + { TdxRibbonStatusBarViewInfo } + + TdxRibbonStatusBarViewInfo = class(TdxStatusBarViewInfo) + private + function GetStatusBar: TdxRibbonStatusBar; + protected + procedure UpdateDockControls(const ABounds: TRect); + public + procedure Calculate(const ABounds: TRect); override; + property StatusBar: TdxRibbonStatusBar read GetStatusBar; + end; + + { TdxRibbonStatusBar } + + TdxRibbonStatusBar = class( + TdxCustomStatusBar, + IdxRibbonFormStatusBarDraw) + private + FColor: TColor; + FCreating: Boolean; + FDefaultBarPainter: TdxBarPainter; + FRibbon: TdxCustomRibbon; + procedure CheckAssignRibbon; + procedure CheckRemoveToolbar(ABar: TdxBar); + procedure SetColor(const Value: TColor); + procedure SetRibbon(const Value: TdxCustomRibbon); + procedure UpdateToolbars; + procedure WMWindowPosChanged(var Message: TWMWindowPosChanged); message WM_WINDOWPOSCHANGED; + protected + FNeedSizeGripSeparator: Boolean; + FRisedSideStates: array[Boolean] of Boolean; + //IdxRibbonFormStatusBarDraw + function IdxRibbonFormStatusBarDraw.GetActive = FormDrawGetActive; + function IdxRibbonFormStatusBarDraw.GetHeight = FormDrawGetHeight; + function IdxRibbonFormStatusBarDraw.GetIsRaised = FormDrawGetIsRaised; + function FormDrawGetActive(AForm: TCustomForm): Boolean; + function FormDrawGetHeight: Integer; + function FormDrawGetIsRaised(ALeft: Boolean): Boolean; + + procedure AdjustTextColor(var AColor: TColor; Active: Boolean); override; + procedure Calculate; override; + procedure CalculateFormSidesAndSizeGrip; + procedure ColorSchemeChanged(Sender: TObject; const AEventArgs); virtual; + function CreateViewInfo: TdxStatusBarViewInfo; override; + function GetPainterClass: TdxStatusBarPainterClass; override; + function GetPaintStyle: TdxStatusBarPaintStyle; override; + function IsRibbonValid: Boolean; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure PaintStyleChanged; override; + procedure SetParent(AParent: TWinControl); override; + procedure VisibleChanged; override; + procedure UpdatePanels; override; + + property DefaultBarPainter: TdxBarPainter read FDefaultBarPainter; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function CanAcceptPanelStyle(Value: TdxStatusBarPanelStyleClass): Boolean; override; + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; + published + property Images; + property Panels; + property Ribbon: TdxCustomRibbon read FRibbon write SetRibbon; + property SizeGrip; + property LookAndFeel; + property OnHint; + property BorderWidth; + { TcxControl properties} + property Anchors; + property BiDiMode; + property Color: TColor read FColor write SetColor default clDefault; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property Font; + property Constraints; + property ShowHint; + property ParentBiDiMode; + property ParentFont default False; + property ParentShowHint; + property PopupMenu; + property Visible; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnClick; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnResize; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +uses + dxThemeConsts, dxUxTheme, dxOffice11, ActnList, StdActns, cxGeometry, Math, + dxBarStrs, cxDWMApi, dxBarSkinConsts; + +resourcestring + cxSToolbarPanelStyle = 'Toolbar Panel'; + +const + GRIP_AREA_SIZE = 19; + GRIP_SIZE = 12; + +{ TdxRibbonStatusBarBarControlPainter } + +function TdxRibbonStatusBarBarControlPainter.BarBeginGroupSize: Integer; +begin + Result := 2; +end; + +procedure TdxRibbonStatusBarBarControlPainter.BarDrawBeginGroup( + ABarControl: TCustomdxBarControl; DC: HDC; ABeginGroupRect: TRect; + AToolbarBrush: HBRUSH; AHorz: Boolean); +var + AColorScheme: TdxCustomRibbonSkin; +begin + AColorScheme := TdxRibbonStatusBarDockControl(TdxBarControl(ABarControl).DockControl).ColorScheme; + if AColorScheme <> nil then + begin + Dec(ABeginGroupRect.Top, GetToolbarContentOffsets(nil, dsTop, False).Top); + AColorScheme.DrawStatusBarToolbarSeparator(DC, ABeginGroupRect); + end; +end; + +procedure TdxRibbonStatusBarBarControlPainter.DrawToolbarContentPart( + ABarControl: TdxBarControl; ACanvas: TcxCanvas); +var + AColorScheme: TdxCustomRibbonSkin; + ADockControl: TdxRibbonStatusBarDockControl; + R, AOffs: TRect; +begin + ADockControl := TdxRibbonStatusBarDockControl(ABarControl.DockControl); + R := ABarControl.ClientRect; + AOffs := GetToolbarContentOffsets(ABarControl.Bar, dsTop, False); + Dec(R.Top, AOffs.Top); + R.Bottom := R.Top + ADockControl.StatusBar.Height; + AColorScheme := ADockControl.ColorScheme; + if AColorScheme <> nil then + AColorScheme.DrawStatusBarPanel(ACanvas.Handle, R, ADockControl.Panel.Bevel <> dxpbRaised) +end; + +procedure TdxRibbonStatusBarBarControlPainter.DrawToolbarNonContentPart( + ABarControl: TdxBarControl; DC: HDC); +var + AColorScheme: TdxCustomRibbonSkin; + ADockControl: TdxRibbonStatusBarDockControl; + ASaveIndex: Integer; + R: TRect; +begin + ASaveIndex := SaveDC(DC); + with ABarControl.ClientBounds do + ExcludeClipRect(DC, Left, Top, Right, Bottom); + ADockControl := TdxRibbonStatusBarDockControl(ABarControl.DockControl); + R := cxRectBounds(0, 0, ABarControl.Width, ADockControl.StatusBar.Height); + AColorScheme := ADockControl.ColorScheme; + if AColorScheme <> nil then + AColorScheme.DrawStatusBarPanel(DC, R, ADockControl.Panel.Bevel <> dxpbRaised); + RestoreDC(DC, ASaveIndex); +end; + +function TdxRibbonStatusBarBarControlPainter.GetButtonBorderHeight: Integer; +begin + Result := 4; + if IsCompositionEnabled then + Dec(Result, 2); +end; + +procedure TdxRibbonStatusBarBarControlPainter.GetDisabledTextColors( + ABarItemControl: TdxBarItemControl; ASelected, AFlat: Boolean; var AColor1, + AColor2: TColor); +var + ADockControl: TdxRibbonStatusBarDockControl; +begin + ADockControl := TdxRibbonStatusBarDockControl(TdxBarControl(ABarItemControl.Parent).DockControl); + if (ADockControl <> nil) and (ADockControl.ColorScheme <> nil) then + begin + AColor1 := ADockControl.ColorScheme.GetPartColor(rspStatusBarText, DXBAR_DISABLED); + AColor2 := AColor1; + end + else + inherited; +end; + +function TdxRibbonStatusBarBarControlPainter.GetEnabledTextColor( + ABarItemControl: TdxBarItemControl; ASelected, AFlat: Boolean): TColor; +const + States: array[Boolean] of Integer = (DXBAR_NORMAL, DXBAR_HOT); +var + ADockControl: TdxRibbonStatusBarDockControl; +begin + ADockControl := TdxRibbonStatusBarDockControl(TdxBarControl(ABarItemControl.Parent).DockControl); + if (ADockControl <> nil) and (ADockControl.ColorScheme <> nil) then + Result := ADockControl.ColorScheme.GetPartColor(rspStatusBarText, States[ASelected]) + else + Result := inherited GetEnabledTextColor(ABarItemControl, ASelected, AFlat); +end; + +function TdxRibbonStatusBarBarControlPainter.GetToolbarContentOffsets( + ABar: TdxBar; ADockingStyle: TdxBarDockingStyle; + AHasSizeGrip: Boolean): TRect; +begin + Result := cxRect(2, 2, 2, 1); +end; + +function TdxRibbonStatusBarBarControlPainter.MarkButtonOffset: Integer; +begin + Result := 0; +end; + +function TdxRibbonStatusBarBarControlPainter.MarkSizeX(ABarControl: TdxBarControl): Integer; +begin + Result := 0; +end; + +function TdxRibbonStatusBarBarControlPainter.GetColorScheme( + ABarControl: TCustomdxBarControl): TdxCustomRibbonSkin; +var + ADockControl: TdxRibbonStatusBarDockControl; +begin + ADockControl := TdxRibbonStatusBarDockControl(TdxBarControl(ABarControl).DockControl); + Result := ADockControl.ColorScheme; +end; + +{ TdxDefaultRibbonStatusBarBarControlPainter } + +function TdxDefaultRibbonStatusBarBarControlPainter.GetButtonBorderHeight: Integer; +begin + Result := 4; + if IsCompositionEnabled then + Dec(Result, 2); +end; + +function TdxDefaultRibbonStatusBarBarControlPainter.GetToolbarContentOffsets( + ABar: TdxBar; ADockingStyle: TdxBarDockingStyle; + AHasSizeGrip: Boolean): TRect; +begin + Result := cxRect(2, 2, 2, 1); +end; + +function TdxDefaultRibbonStatusBarBarControlPainter.MarkButtonOffset: Integer; +begin + Result := 0; +end; + +function TdxDefaultRibbonStatusBarBarControlPainter.MarkSizeX(ABarControl: TdxBarControl): Integer; +begin + Result := 0; +end; + +{ TdxRibbonStatusBarBarControlViewInfo } + +function TdxRibbonStatusBarBarControlViewInfo.CanShowButtonGroups: Boolean; +begin + Result := True; +end; + +function TdxRibbonStatusBarBarControlViewInfo.CanShowSeparators: Boolean; +begin + Result := True; +end; + +{ TdxRibbonStatusBarBarControl } + +function TdxRibbonStatusBarBarControl.CanShowPopupMenuOnMouseClick( + AMousePressed: Boolean): Boolean; +begin + Result := inherited CanShowPopupMenuOnMouseClick(AMousePressed) and + ((csDesigning in ComponentState) or Bar.AllowQuickCustomizing); +end; + +function TdxRibbonStatusBarBarControl.GetDefaultItemGlyph: TBitmap; +begin + Result := nil; +end; + +function TdxRibbonStatusBarBarControl.GetItemControlDefaultViewLevel( + AItemControl: TdxBarItemControl): TdxBarItemViewLevel; +begin + Result := IdxBarItemControlViewInfo(AItemControl.ViewInfo).GetViewLevelForButtonGroup; +end; + +function TdxRibbonStatusBarBarControl.GetMinHeight( + AStyle: TdxBarDockingStyle): Integer; +begin + if (Ribbon <> nil) and IsValid then + Result := Painter.GetButtonHeight(BarManager.ImageOptions.GlyphSize, TextSize) + else + Result := 18; +end; + +function TdxRibbonStatusBarBarControl.GetRibbon: TdxCustomRibbon; +var + ADockControl: TdxRibbonStatusBarDockControl; +begin + ADockControl := TdxRibbonStatusBarDockControl(DockControl); + if (ADockControl = nil) or (ADockControl.StatusBar = nil) then + Result := nil + else + Result := ADockControl.StatusBar.Ribbon; +end; + +function TdxRibbonStatusBarBarControl.GetViewInfoClass: TCustomdxBarControlViewInfoClass; +begin + Result := TdxRibbonStatusBarBarControlViewInfo; +end; + +procedure TdxRibbonStatusBarBarControl.InitCustomizationPopup(AItemLinks: TdxBarItemLinks); +var + I: Integer; + AItemLink: TdxBarItemLink; + ASubItemButton: TdxRibbonQuickAccessPopupSubItemButton; +begin + while AItemLinks.Count > 0 do + AItemLinks.Items[0].Item.Free; + for I := 0 to ItemLinks.AvailableItemCount - 1 do + begin + AItemLink := ItemLinks.AvailableItems[I]; + ASubItemButton := TdxRibbonQuickAccessPopupSubItemButton(AItemLinks.AddItem(TdxRibbonQuickAccessPopupSubItemButton).Item); + ASubItemButton.Tag := Integer(AItemLink); + ASubItemButton.ButtonStyle := bsChecked; + ASubItemButton.Down := AItemLink.Visible; + ASubItemButton.Caption := AItemLink.Caption; + BarDesignController.AddInternalItem(ASubItemButton); + end; +end; + +function TdxRibbonStatusBarBarControl.IsValid: Boolean; +begin + Result := HandleAllocated and (BarManager <> nil) and + (BarManager.ComponentState * [csDestroying, csLoading] = []); +end; + +function TdxRibbonStatusBarBarControl.MarkExists: Boolean; +begin + Result := False; +end; + +procedure TdxRibbonStatusBarBarControl.UpdateDoubleBuffered; +begin + DoubleBuffered := True; +end; + +procedure TdxRibbonStatusBarBarControl.CMFontChanged(var Message: TMessage); +begin + inherited; + if (StatusBar <> nil) and StatusBar.IsRibbonValid then + StatusBar.Invalidate; +end; + +function TdxRibbonStatusBarBarControl.GetStatusBar: TdxRibbonStatusBar; +var + ADockControl: TdxRibbonStatusBarDockControl; +begin + ADockControl := TdxRibbonStatusBarDockControl(DockControl); + if ADockControl = nil then + Result := nil + else + Result := ADockControl.StatusBar; +end; + +{ TdxRibbonStatusBarBarControlDesignHelper } + +class function TdxRibbonStatusBarBarControlDesignHelper.GetForbiddenActions: TdxBarCustomizationActions; +begin + Result := inherited GetForbiddenActions - [caChangeViewLevels, caChangeButtonGroup]; +end; + +{ TdxRibbonStatusBarDockControl } + +constructor TdxRibbonStatusBarDockControl.Create(AOwner: TdxStatusBarToolbarPanelStyle); +begin + inherited Create(AOwner.StatusBarControl); + FStatusBar := TdxRibbonStatusBar(AOwner.StatusBarControl); + FPanel := AOwner.Owner; + Parent := FStatusBar; + AllowDocking := False; + Align := dalNone; + ControlStyle := ControlStyle + [csNoDesignVisible]; +end; + +destructor TdxRibbonStatusBarDockControl.Destroy; +begin + FPainter.Free; + inherited Destroy; +end; + +procedure TdxRibbonStatusBarDockControl.CalcLayout; +begin + inherited CalcLayout; + StatusBar.Recalculate; + StatusBar.Invalidate; +end; + +procedure TdxRibbonStatusBarDockControl.UpdateDoubleBuffered; +begin + DoubleBuffered := True; +end; + +procedure TdxRibbonStatusBarDockControl.FillBackground(DC: HDC; const ADestR, + ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); +var + R: TRect; +begin + R := ClientRect; + R.Bottom := StatusBar.Height; + if ColorScheme <> nil then + ColorScheme.DrawStatusBarPanel(DC, R, Panel.Bevel <> dxpbRaised) + else + FillRectByColor(DC, ClientRect, clBtnFace); +end; + +function TdxRibbonStatusBarDockControl.GetDockedBarControlClass: TdxBarControlClass; +begin + Result := TdxRibbonStatusBarBarControl; +end; + +function TdxRibbonStatusBarDockControl.GetOwner: TPersistent; +begin + Result := nil; +end; + +function TdxRibbonStatusBarDockControl.GetPainter: TdxBarPainter; +begin + if Ribbon <> nil then + begin + if FPainter = nil then + FPainter := TdxRibbonStatusBarBarControlPainter.Create(Integer(Ribbon)); + end + else + FreeAndNil(FPainter); + if FPainter = nil then + Result := StatusBar.DefaultBarPainter + else + Result := FPainter; +end; + +procedure TdxRibbonStatusBarDockControl.ShowCustomizePopup; +var + ABarControl: TdxRibbonStatusBarBarControl; +begin + ABarControl := BarControl; + if (ABarControl <> nil) and ABarControl.CanShowPopupMenuOnMouseClick(False) then + ABarControl.ShowPopup(nil); +end; + +procedure TdxRibbonStatusBarDockControl.VisibleChanged; +begin + Changed; +end; + +function TdxRibbonStatusBarDockControl.GetBarControl: TdxRibbonStatusBarBarControl; +begin + if (RowCount > 0) and (Rows[0].ColCount > 0) then + Result := TdxRibbonStatusBarBarControl(Rows[0].Cols[0].BarControl) + else + Result := nil; +end; + +function TdxRibbonStatusBarDockControl.GetColorScheme: TdxCustomRibbonSkin; +begin + if Ribbon <> nil then + Result := Ribbon.ColorScheme + else + Result := nil; +end; + +function TdxRibbonStatusBarDockControl.GetRibbon: TdxCustomRibbon; +begin + if StatusBar.IsRibbonValid then + Result := StatusBar.Ribbon + else + Result := nil; +end; + +{ TdxStatusBarToolbarPanelStyle } + +constructor TdxStatusBarToolbarPanelStyle.Create(AOwner: TdxStatusBarPanel); +begin + inherited Create(AOwner); + FDockControl := TdxRibbonStatusBarDockControl.Create(Self); +end; + +destructor TdxStatusBarToolbarPanelStyle.Destroy; +begin + Toolbar := nil; + FreeAndNil(FDockControl); + inherited Destroy; +end; + +procedure TdxStatusBarToolbarPanelStyle.Assign(Source: TPersistent); + + function IsInheritanceUpdating: Boolean; + begin + Result := (Owner.Collection <> nil) and (csUpdating in StatusBarControl.ComponentState); + end; + +begin + BeginUpdate; + try + inherited Assign(Source); + if Source is TdxStatusBarToolbarPanelStyle then + begin + if (TdxStatusBarToolbarPanelStyle(Source).Toolbar <> nil) and IsInheritanceUpdating then + ToolBar := FindBarManager.BarByComponentName(TdxStatusBarToolbarPanelStyle(Source).Toolbar.Name) + else + Toolbar := TdxStatusBarToolbarPanelStyle(Source).Toolbar; + end; + finally + EndUpdate; + end; +end; + +function TdxStatusBarToolbarPanelStyle.CanDelete: Boolean; +begin + Result := (Toolbar = nil) or not (csAncestor in Toolbar.ComponentState); +end; + +function TdxStatusBarToolbarPanelStyle.CanSizing: Boolean; +begin + Result := not GetPanelFixed; +end; + +procedure TdxStatusBarToolbarPanelStyle.DefineProperties(Filer: TFiler); + + function NeedWriteToolbarName: Boolean; + var + AAncestorToolbar: TdxBar; + begin + if Filer.Ancestor <> nil then + begin + AAncestorToolbar := TdxStatusBarToolbarPanelStyle(Filer.Ancestor).ToolBar; + Result := (AAncestorToolbar = nil) and (Toolbar <> nil) or + (AAncestorToolbar <> nil) and (ToolBar = nil) or + (AAncestorToolbar <> nil) and (AAncestorToolbar.Name <> Toolbar.Name); + end + else + Result := ToolBar <> nil; + end; + +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('ToolbarName', ReadToolbarName, WriteToolbarName, NeedWriteToolbarName); +end; + +procedure TdxStatusBarToolbarPanelStyle.DrawContent(ACanvas: TcxCanvas; + R: TRect; APainter: TdxStatusBarPainterClass); +begin +end; + +function TdxStatusBarToolbarPanelStyle.GetMinWidth: Integer; +begin + if Owner.Fixed and (Toolbar <> nil) and (Toolbar.Control is TdxRibbonStatusBarBarControl) then + Result := TdxRibbonStatusBarBarControl(Toolbar.Control).GetSize(MaxInt).cx + 2 + else + Result := 50; +end; + +class function TdxStatusBarToolbarPanelStyle.GetVersion: Integer; +begin + Result := 1; +end; + +procedure TdxStatusBarToolbarPanelStyle.Loaded; +begin + inherited Loaded; + UpdateToolbarValue; +end; + +procedure TdxStatusBarToolbarPanelStyle.PanelVisibleChanged; +begin + DockControl.Visible := Owner.Visible; +end; + +function TdxStatusBarToolbarPanelStyle.FindBarManager: TdxBarManager; +begin + Result := nil; + if (Owner.Collection <> nil) and (StatusBarControl.Owner is TCustomForm) then + Result := GetBarManagerByForm(TCustomForm(StatusBarControl.Owner)); + if Result = nil then + raise Exception.Create(cxGetResourceString(@dxSBAR_CANTFINDBARMANAGERFORSTATUSBAR)); +end; + +procedure TdxStatusBarToolbarPanelStyle.UpdateByRibbon(ARibbon: TdxCustomRibbon); +begin + DockControl.UpdateDock; + DockControl.RepaintBarControls; +end; + +function TdxStatusBarToolbarPanelStyle.GetToolbar: TdxBar; +begin + if (FLoadedToolbarName <> '') and (Owner.Collection <> nil) and + IsAncestorComponentDifferencesDetection(StatusBarControl) then + Result := FindBarManager.BarByComponentName(FLoadedToolbarName) + else + Result := FToolbar; +end; + +procedure TdxStatusBarToolbarPanelStyle.ReadToolbarName(AReader: TReader); +begin + FLoadedToolbarName := AReader.ReadString; +end; + +procedure TdxStatusBarToolbarPanelStyle.SetToolbar(Value: TdxBar); +begin + if FToolBar <> Value then + begin + if (FToolbar <> nil) and not (csDestroying in FToolbar.ComponentState) then + begin + FToolbar.RemoveFreeNotification(StatusBarControl); + RibbonUndockToolBar(FToolbar); + end; + FToolbar := Value; + if FToolbar <> nil then + begin + FToolbar.FreeNotification(StatusBarControl); + DockControl.BarManager := FToolbar.BarManager; + RibbonDockToolBar(FToolbar, DockControl); + end + else + DockControl.BarManager := nil; + if not (csDestroying in StatusBarControl.ComponentState) then + begin + TdxRibbonStatusBar(StatusBarControl).Recalculate; + StatusBarControl.Invalidate; + end; + end; +end; + +procedure TdxStatusBarToolbarPanelStyle.UpdateToolbarValue; +begin + if FLoadedToolbarName <> '' then + begin + ToolBar := FindBarManager.BarByComponentName(FLoadedToolbarName); + FLoadedToolbarName := ''; + end; +end; + +procedure TdxStatusBarToolbarPanelStyle.WriteToolbarName(AWriter: TWriter); +begin + if ToolBar <> nil then + AWriter.WriteString(ToolBar.Name) + else + AWriter.WriteString(''); +end; + +{ TdxRibbonStatusBarPainter } + +class function TdxRibbonStatusBarPainter.BorderSizes(AStatusBar: TdxCustomStatusBar): TRect; +begin + Result := Rect(1, 1, 1, 0); //!!!todo: check bottom +end; + +class function TdxRibbonStatusBarPainter.GripAreaSize: TSize; +begin + Result.cx := GRIP_AREA_SIZE; + Result.cy := GRIP_AREA_SIZE; +end; + +class function TdxRibbonStatusBarPainter.SeparatorSize: Integer; +begin + Result := 3; +end; + +class procedure TdxRibbonStatusBarPainter.DrawBorder(AStatusBar: TdxCustomStatusBar; + ACanvas: TcxCanvas; var R: TRect); +begin + if TdxRibbonStatusBar(AStatusBar).IsRibbonValid then + TdxRibbonStatusBar(AStatusBar).Ribbon.ColorScheme.DrawStatusBar(ACanvas.Handle, R) + else + begin + ACanvas.FrameRect(R, clBtnShadow); + InflateRect(R, -1, -1); + FillRectByColor(ACanvas.Handle, R, clBtnFace); + end; +end; + +class procedure TdxRibbonStatusBarPainter.DrawPanelBorder(AStatusBar: TdxCustomStatusBar; + ABevel: TdxStatusBarPanelBevel; ACanvas: TcxCanvas; var R: TRect); +begin + if TdxRibbonStatusBar(AStatusBar).IsRibbonValid then + TdxRibbonStatusBar(AStatusBar).Ribbon.ColorScheme.DrawStatusBarPanel(ACanvas.Handle, R, ABevel <> dxpbRaised) + else + inherited; +end; + +class procedure TdxRibbonStatusBarPainter.DrawPanelSeparator(AStatusBar: TdxCustomStatusBar; + ACanvas: TcxCanvas; const R: TRect); +begin + if TdxRibbonStatusBar(AStatusBar).IsRibbonValid then + TdxRibbonStatusBar(AStatusBar).Ribbon.ColorScheme.DrawStatusBarPanelSeparator(ACanvas.Handle, R) + else + FillRectByColor(ACanvas.Handle, R, clBtnShadow); +end; + +class procedure TdxRibbonStatusBarPainter.DrawSizeGrip(AStatusBar: TdxCustomStatusBar; + ACanvas: TcxCanvas; R: TRect; AOverlapped: Boolean); +var + ARect, AGripRect: TRect; + ARibbonStatusBar: TdxRibbonStatusBar; +begin + ARibbonStatusBar := TdxRibbonStatusBar(AStatusBar); + if ARibbonStatusBar.IsRibbonValid then + begin + ARect := Rect(R.Right - GripAreaSize.cx, R.Top, R.Right, R.Bottom); + ARibbonStatusBar.Ribbon.ColorScheme.DrawStatusBarGripBackground(ACanvas.Handle, ARect); + AGripRect := cxRectInflate(ARect, 0, 0, 1, -3); + if AOverlapped then Inc(AGripRect.Right, 1); + ARibbonStatusBar.Ribbon.ColorScheme.DrawStatusBarSizeGrip(ACanvas.Handle, AGripRect); + if not ARibbonStatusBar.FNeedSizeGripSeparator then + Dec(ARect.Left, -3); + ACanvas.ExcludeClipRect(ARect); + end + else + begin + InflateRect(R, -1, -1); + ARect := Rect(R.Right - GripAreaSize.cx, R.Bottom - GripAreaSize.cy, R.Right, R.Bottom); + AGripRect := ARect; + if AOverlapped then Inc(AGripRect.Right, 1); + ACanvas.Brush.Color := clBtnFace; + ACanvas.FillRect(AGripRect); + BarDrawSizeGrip(ACanvas.Handle, ARect); + ACanvas.ExcludeClipRect(AGripRect); + end; +end; + +class function TdxRibbonStatusBarPainter.GetPanelBevel( + APanel: TdxStatusBarPanel): TdxStatusBarPanelBevel; +begin + if APanel <> nil then + Result := APanel.Bevel + else + Result := dxpbNone; +end; + +class function TdxRibbonStatusBarPainter.TopBorderSize: Integer; +begin + Result := 0; +end; + +{ TdxRibbonStatusBarViewInfo } + +procedure TdxRibbonStatusBarViewInfo.Calculate(const ABounds: TRect); +var + F: TCustomForm; +begin + inherited Calculate(ABounds); + F := TCustomForm(StatusBar.Owner); + if (F <> nil) and (F.FormState = []) then + UpdateDockControls(ABounds); +end; + +procedure TdxRibbonStatusBarViewInfo.UpdateDockControls(const ABounds: TRect); +var + ARect, R: TRect; + I, J, ACount: Integer; +begin + ACount := PanelCount; + J := 0; + ARect := ABounds; + for I := 0 to ACount - 1 do + begin + // Panel + ARect.Right := ARect.Left + Widths[J]; + if Panels[I].PanelStyle is TdxStatusBarToolbarPanelStyle then + with TdxStatusBarToolbarPanelStyle(Panels[I].PanelStyle) do + begin + R := ARect; + R.Bottom := R.Top + DockControl.Height; + if StatusBar.SizeGripAllocated then + R.Right := Max(2, Min(R.Right, ABounds.Right - GRIP_AREA_SIZE)); + DockControl.BoundsRect := R; + end; + Inc(J); + // Separator + if I < (ACount - 1) then + begin + ARect.Left := ARect.Right; + ARect.Right := ARect.Left + Widths[J]; + Inc(J); + end; + ARect.Left := ARect.Right; + end; +end; + +function TdxRibbonStatusBarViewInfo.GetStatusBar: TdxRibbonStatusBar; +begin + Result := TdxRibbonStatusBar(inherited StatusBar); +end; + +{ TdxRibbonStatusBar } + +constructor TdxRibbonStatusBar.Create(AOwner: TComponent); +begin + FCreating := True; + RibbonCheckCreateComponent(AOwner, ClassType); + FCreating := False; + inherited Create(AOwner); + FDefaultBarPainter := TdxDefaultRibbonStatusBarBarControlPainter.Create(0); + Font.Color := clDefault; + Color := clDefault; + Height := 23; + CheckAssignRibbon; +end; + +destructor TdxRibbonStatusBar.Destroy; +begin + if FCreating then Exit; + if IsRibbonValid then + Ribbon.ColorSchemeHandlers.Remove(ColorSchemeChanged); + FreeAndNil(FDefaultBarPainter); + inherited Destroy; +end; + +function TdxRibbonStatusBar.CanAcceptPanelStyle(Value: TdxStatusBarPanelStyleClass): Boolean; +begin + Result := True; +end; + +procedure TdxRibbonStatusBar.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); +var + I, H: Integer; + ABarControl: TdxRibbonStatusBarBarControl; +begin + if HandleAllocated and (([csDestroying, csLoading] * ComponentState) = []) then + begin + for I := 0 to Panels.Count - 1 do + if Panels[I].PanelStyle is TdxStatusBarToolbarPanelStyle then + begin + ABarControl := TdxStatusBarToolbarPanelStyle(Panels[I].PanelStyle).DockControl.BarControl; + if (ABarControl <> nil) and ABarControl.IsValid then + begin + with ABarControl.Painter.GetToolbarContentOffsets(ABarControl.Bar, dsNone, False) do + H := Top + Bottom; + Inc(H, ABarControl.GetSize(Panels[I].Width).cy); + AHeight := Max(AHeight, H); + end; + end; + end; + inherited SetBounds(ALeft, ATop, AWidth, AHeight); + Recalculate; +end; + +function TdxRibbonStatusBar.FormDrawGetActive(AForm: TCustomForm): Boolean; +begin + Result := Visible and (Owner = AForm); +end; + +function TdxRibbonStatusBar.FormDrawGetHeight: Integer; +begin + Result := Height; +end; + +function TdxRibbonStatusBar.FormDrawGetIsRaised(ALeft: Boolean): Boolean; +begin + Result := FRisedSideStates[ALeft]; +end; + +procedure TdxRibbonStatusBar.AdjustTextColor(var AColor: TColor; Active: Boolean); +begin + if IsRibbonValid then + AColor := Ribbon.ColorScheme.GetPartColor(rspStatusBarText, Ord(not Active)) + else + AColor := Font.Color; +end; + +procedure TdxRibbonStatusBar.Calculate; +begin + inherited Calculate; + CalculateFormSidesAndSizeGrip; +end; + +procedure TdxRibbonStatusBar.CalculateFormSidesAndSizeGrip; +var + I: Integer; +begin + FNeedSizeGripSeparator := Panels.Count = 0; + FRisedSideStates[True] := False; + for I := 0 to Panels.Count - 1 do + with Panels[I] do + if Visible then + begin + FRisedSideStates[True] := Bevel = dxpbRaised; + Break; + end; + FRisedSideStates[False] := SizeGripAllocated; + for I := Panels.Count - 1 downto 0 do + with Panels[I] do + if Visible then + begin + FNeedSizeGripSeparator := Bevel <> dxpbRaised; + Break; + end; +end; + +procedure TdxRibbonStatusBar.ColorSchemeChanged(Sender: TObject; const AEventArgs); +begin + PaintStyleChanged; +end; + +function TdxRibbonStatusBar.CreateViewInfo: TdxStatusBarViewInfo; +begin + Result := TdxRibbonStatusBarViewInfo.Create(Self); +end; + +function TdxRibbonStatusBar.GetPainterClass: TdxStatusBarPainterClass; +begin + Result := TdxRibbonStatusBarPainter +end; + +function TdxRibbonStatusBar.GetPaintStyle: TdxStatusBarPaintStyle; +begin + Result := stpsOffice11; +end; + +function TdxRibbonStatusBar.IsRibbonValid: Boolean; +begin + Result := (Ribbon <> nil) and not Ribbon.IsDestroying; +end; + +procedure TdxRibbonStatusBar.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if Operation = opRemove then + begin + if AComponent = Ribbon then + Ribbon := nil + else + if AComponent is TdxBar then + CheckRemoveToolbar(TdxBar(AComponent)); + end; +end; + +procedure TdxRibbonStatusBar.PaintStyleChanged; +begin + if IsRibbonValid and (Color = clDefault) then + inherited Color := Ribbon.ColorScheme.GetPartColor(rfspRibbonForm); + inherited PaintStyleChanged; +end; + +procedure TdxRibbonStatusBar.SetParent(AParent: TWinControl); +begin + if Assigned(AParent) then + begin + AParent := GetParentForm(AParent{$IFDEF DELPHI9}, not (csDesigning in ComponentState){$ENDIF}); + if Assigned(AParent) and not (AParent is TCustomForm) then + raise Exception.CreateFmt(cxGetResourceString(@dxSBAR_RIBBONBADPARENT), [ClassName]); + end; + inherited SetParent(AParent); + Top := 32000; +end; + +procedure TdxRibbonStatusBar.VisibleChanged; +var + AForm: TCustomForm; +begin + inherited VisibleChanged; + if IsRibbonValid then + begin + AForm := TCustomForm(Owner); + if (AForm <> nil) and AForm.HandleAllocated and AForm.Visible then + SetWindowPos(AForm.Handle, 0, 0, 0, AForm.Width, AForm.Height, SWP_NOZORDER or SWP_NOACTIVATE or + SWP_NOMOVE or SWP_FRAMECHANGED); + end; +end; + +procedure TdxRibbonStatusBar.UpdatePanels; +begin + Recalculate; + UpdateToolbars; + Invalidate; +end; + +procedure TdxRibbonStatusBar.CheckAssignRibbon; +var + AForm: TCustomForm; + I: Integer; +begin + if not IsDesigning then Exit; + AForm := TCustomForm(Owner); + if AForm <> nil then + begin + for I := 0 to AForm.ComponentCount - 1 do + if AForm.Components[I] is TdxCustomRibbon then + begin + Ribbon := TdxCustomRibbon(AForm.Components[I]); + Break; + end; + end; +end; + +procedure TdxRibbonStatusBar.CheckRemoveToolbar(ABar: TdxBar); +var + I: Integer; + APanelStyle: TdxStatusBarToolbarPanelStyle; +begin + //if csDestroying in ComponentState then Exit; + for I := 0 to Panels.Count - 1 do + if Panels[I].PanelStyle is TdxStatusBarToolbarPanelStyle then + begin + APanelStyle := TdxStatusBarToolbarPanelStyle(Panels[I].PanelStyle); + if APanelStyle.Toolbar = ABar then + APanelStyle.Toolbar := nil; + end; +end; + +procedure TdxRibbonStatusBar.SetColor(const Value: TColor); +begin + if FColor <> Value then + begin + FColor := Value; + if Value <> clDefault then + inherited Color := Value; + PaintStyleChanged; + end; +end; + +procedure TdxRibbonStatusBar.SetRibbon(const Value: TdxCustomRibbon); +var + AIntf: IdxRibbonFormNonClientDraw; +begin + if FRibbon <> Value then + begin + if (FRibbon <> nil) and not FRibbon.IsDestroying then + begin + FRibbon.RemoveFreeNotification(Self); + FRibbon.ColorSchemeHandlers.Remove(ColorSchemeChanged); + if Supports(TObject(FRibbon), IdxRibbonFormNonClientDraw, AIntf) then + AIntf.Remove(Self); + end; + FRibbon := Value; + if FRibbon <> nil then + begin + FRibbon.FreeNotification(Self); + FRibbon.ColorSchemeHandlers.Add(ColorSchemeChanged); + if Supports(TObject(FRibbon), IdxRibbonFormNonClientDraw, AIntf) then + AIntf.Add(Self); + end; + PaintStyleChanged; + end; +end; + +procedure TdxRibbonStatusBar.UpdateToolbars; +var + I: Integer; +begin + if HandleAllocated and (([csDestroying] * ComponentState) = []) then + begin + for I := 0 to Panels.Count - 1 do + if Panels[I].PanelStyle is TdxStatusBarToolbarPanelStyle then + TdxStatusBarToolbarPanelStyle(Panels[I].PanelStyle).UpdateByRibbon(Ribbon); + end; +end; + +procedure TdxRibbonStatusBar.WMWindowPosChanged(var Message: TWMWindowPosChanged); +begin + inherited; + if (Message.WindowPos <> nil) and (Message.WindowPos.flags and SWP_NOSIZE <> 0) then + UpdateToolbars; +end; + +initialization + RegisterClasses([TdxRibbonStatusBar, TdxStatusBarContainerControl]); + GetRegisteredStatusBarPanelStyles.Register(TdxStatusBarToolbarPanelStyle, cxSToolbarPanelStyle); + BarDesignController.RegisterBarControlDesignHelper( + TdxRibbonStatusBarBarControl, TdxRibbonStatusBarBarControlDesignHelper); + +finalization + BarDesignController.UnregisterBarControlDesignHelper( + TdxRibbonStatusBarBarControl, TdxRibbonStatusBarBarControlDesignHelper); + GetRegisteredStatusBarPanelStyles.Unregister(TdxStatusBarToolbarPanelStyle); + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxStatusBar.pas b/official/x.35/ExpressBars 6/Sources/dxStatusBar.pas new file mode 100644 index 00000000..590a904a --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxStatusBar.pas @@ -0,0 +1,3215 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressStatusBar } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSTATUSBAR AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxStatusBar; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Controls, Graphics, ImgList, Forms, + ExtCtrls, dxThemeManager, cxClasses, cxGraphics, cxControls, cxLookAndFeels; + +type + TdxStatusBarPainterClass = class of TdxStatusBarPainter; + TdxCustomStatusBar = class; + TdxStatusBarPanel = class; + TdxStatusBarPanels = class; + TdxStatusBarPanelStyle = class; + TdxStatusBarPanelClass = class of TdxStatusBarPanel; + + { TdxStatusBarPanelStyle } + + TdxStatusBarPanelStyle = class(TPersistent) + private + FAlignment: TAlignment; + FColor: TColor; + FFont: TFont; + FIsColorAssigned: Boolean; + FOwner: TdxStatusBarPanel; + FParentFont: Boolean; + procedure FontChanged(Sender: TObject); + function GetColor: TColor; + function GetStatusBarControl: TdxCustomStatusBar; + function IsColorStored: Boolean; + function IsFontStored: Boolean; + procedure SetAlignment(Value: TAlignment); + procedure SetColor(Value: TColor); + procedure SetFont(Value: TFont); + procedure SetParentFont(Value: Boolean); + protected + procedure AdjustTextColor(var AColor: TColor; Active: Boolean); virtual; + function CanDelete: Boolean; virtual; + function CanSizing: Boolean; virtual; + procedure Changed; virtual; + procedure CheckSizeGripRect(var R: TRect); virtual; + function DefaultColor: TColor; virtual; + procedure DoAssign(ASource: TPersistent); virtual; + procedure DrawContent(ACanvas: TcxCanvas; R: TRect; APainter: TdxStatusBarPainterClass); virtual; + function GetMinWidth: Integer; virtual; + function GetPanelFixed: Boolean; + class function GetVersion: Integer; virtual; + function InternalBevel: Boolean; virtual; + procedure Loaded; virtual; + procedure PanelVisibleChanged; virtual; + procedure ParentFontChanged; virtual; + public + constructor Create(AOwner: TdxStatusBarPanel); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure BeginUpdate; + procedure EndUpdate; + procedure RestoreDefaults; virtual; + property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify; + property Color: TColor read GetColor write SetColor stored IsColorStored; + property Font: TFont read FFont write SetFont stored IsFontStored; + property Owner: TdxStatusBarPanel read FOwner; + property ParentFont: Boolean read FParentFont write SetParentFont default True; + property StatusBarControl: TdxCustomStatusBar read GetStatusBarControl; + end; + + TdxStatusBarPanelStyleClass = class of TdxStatusBarPanelStyle; + + { TdxStatusBarTextPanelStyle } + + TdxStatusBarEllipsisType = (dxetNone, dxetTruncate, dxetSmartPath); + TdxStatusBarEllipsisTypes = set of TdxStatusBarEllipsisType; + + TdxStatusBarTextEvent = procedure(Sender: TObject; const R: TRect; var AText: string) of object; + + TdxStatusBarTextPanelStyle = class(TdxStatusBarPanelStyle) + private + FAutoHint: Boolean; + FEllipsisType: TdxStatusBarEllipsisType; + FImageIndex: TImageIndex; + FOnGetText: TdxStatusBarTextEvent; + procedure SetAutoHint(Value: Boolean); + procedure SetEllipsisType(Value: TdxStatusBarEllipsisType); + procedure SetImageIndex(Value: TImageIndex); + protected + procedure DoAssign(ASource: TPersistent); override; + procedure DrawContent(ACanvas: TcxCanvas; R: TRect; APainter: TdxStatusBarPainterClass); override; + public + constructor Create(AOwner: TdxStatusBarPanel); override; + procedure RestoreDefaults; override; + published + property Alignment; + property AutoHint: Boolean read FAutoHint write SetAutoHint default False; + property Color; + property ImageIndex: TImageIndex read FImageIndex write SetImageIndex default -1; + property EllipsisType: TdxStatusBarEllipsisType read FEllipsisType write SetEllipsisType default dxetNone; + property Font; + property ParentFont; + property OnGetText: TdxStatusBarTextEvent read FOnGetText write FOnGetText; + end; + + { TdxStatusBarStateIndicatorPanelStyle } + + TdxStatusBarStateIndicatorType = (sitOff, sitYellow, sitBlue, sitGreen, sitRed, + sitTeal, sitPurple); + + TdxStatusBarStateIndicatorItem = class(TCollectionItem) + private + FIndicatorBitmap: TBitmap; + FIndicatorType: TdxStatusBarStateIndicatorType; + FVisible: Boolean; + procedure SetIndicatorType(Value: TdxStatusBarStateIndicatorType); + procedure SetVisible(Value: Boolean); + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + published + property IndicatorType: TdxStatusBarStateIndicatorType read FIndicatorType write SetIndicatorType default sitOff; + property Visible: Boolean read FVisible write SetVisible default True; + end; + + TdxStatusBarStateIndicators = class(TCollection) + private + FOnChange: TNotifyEvent; + function GetItem(Index: Integer): TdxStatusBarStateIndicatorItem; + procedure SetItem(Index: Integer; Value: TdxStatusBarStateIndicatorItem); + protected + procedure Update(Item: TCollectionItem); override; + public + constructor Create; + function Add: TdxStatusBarStateIndicatorItem; + function Insert(Index: Integer): TdxStatusBarStateIndicatorItem; + property Items[Index: Integer]: TdxStatusBarStateIndicatorItem read GetItem write SetItem; default; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + end; + + TdxStatusBarStateIndicatorPanelStyle = class(TdxStatusBarPanelStyle) + private + FSpacing: Integer; + FIndicators: TdxStatusBarStateIndicators; + function GetIndicators: TdxStatusBarStateIndicators; + procedure IndicatorChangeHandler(Sender: TObject); + procedure SetIndicators(Value: TdxStatusBarStateIndicators); + procedure SetSpacing(Value: Integer); + protected + function CanSizing: Boolean; override; + procedure DoAssign(ASource: TPersistent); override; + procedure DrawContent(ACanvas: TcxCanvas; R: TRect; APainter: TdxStatusBarPainterClass); override; + function GetMinWidth: Integer; override; + public + constructor Create(AOwner: TdxStatusBarPanel); override; + destructor Destroy; override; + procedure RestoreDefaults; override; + published + property Color; + property Indicators: TdxStatusBarStateIndicators read GetIndicators write SetIndicators; + property Spacing: Integer read FSpacing write SetSpacing default 4; + end; + + { TdxStatusBarKeyboardStatePanelStyle } + + TdxStatusBarKeyboardStateWatchedKey = class + private + FKeyCode: Integer; + FKeyState: Integer; + procedure SetKeyState(Value: Integer); + public + constructor Create(AKeyCode: Integer); + function GetCurrentState: Integer; + property KeyCode: Integer read FKeyCode; + property KeyState: Integer read FKeyState write SetKeyState; + end; + + TdxStatusBarKeyboardStateNotifier = class + private + FKeys: array of TdxStatusBarKeyboardStateWatchedKey; + FStatusBar: TdxCustomStatusBar; + FTimer: TTimer; + protected + procedure Execute(Sender: TObject); + public + constructor Create(AStatusBar: TdxCustomStatusBar); + destructor Destroy; override; + procedure SubScribeKey(AKeyCode: Integer); + procedure UnSubScribeKey(AKeyCode: Integer); + end; + + TdxStatusBarKeyboardState = (dxksCapsLock, dxksNumLock, dxksScrollLock, dxksInsert); + TdxStatusBarKeyboardStates = set of TdxStatusBarKeyboardState; + + TdxStatusBarKeyStateAppearance = class(TPersistent) + private + FId: TdxStatusBarKeyboardState; + FCode: Integer; + FActiveFontColor: TColor; + FInactiveFontColor: TColor; + FActiveCaption: string; + FInactiveCaption: string; + FOnChange: TNotifyEvent; + procedure SetActiveFontColor(Value: TColor); + procedure SetInactiveFontColor(Value: TColor); + procedure SetActiveCaption(const Value: string); + procedure SetInactiveCaption(const Value: string); + protected + procedure Changed; virtual; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + public + constructor Create(AId: TdxStatusBarKeyboardState; ACode: Integer; + const AActiveCaption: string; AActiveFontColor: TColor; + const AInactiveCaption: string; AInactiveFontColor: TColor; + AChangeHandler: TNotifyEvent); + procedure Assign(Source: TPersistent); override; + function GetRectWidth(ACanvas: TcxCanvas): Integer; + property Code: Integer read FCode; + property Id: TdxStatusBarKeyboardState read FId; + published + property ActiveFontColor: TColor read FActiveFontColor write SetActiveFontColor default clWindowText; + property InactiveFontColor: TColor read FInactiveFontColor write SetInactiveFontColor default clBtnShadow; + property ActiveCaption: string read FActiveCaption write SetActiveCaption; + property InactiveCaption: string read FInactiveCaption write SetInactiveCaption; + end; + + TdxStatusBarKeyboardStatePanelStyle = class(TdxStatusBarPanelStyle) + private + FFullRect: Boolean; + FKeyboardStates: TdxStatusBarKeyboardStates; + FKeyInfos: array[0..3] of TdxStatusBarKeyStateAppearance; + FNotifier: TdxStatusBarKeyboardStateNotifier; + function GetCapsLockAppearance: TdxStatusBarKeyStateAppearance; + function GetInsertAppearance: TdxStatusBarKeyStateAppearance; + function GetNumLockAppearance: TdxStatusBarKeyStateAppearance; + function GetScrollLockAppearance: TdxStatusBarKeyStateAppearance; + procedure NamesChangeHandler(Sender: TObject); + procedure SetCapsLockAppearance(Value: TdxStatusBarKeyStateAppearance); + procedure SetFullRect(Value: Boolean); + procedure SetInsertAppearance(Value: TdxStatusBarKeyStateAppearance); + procedure SetKeyboardStates(Value: TdxStatusBarKeyboardStates); + procedure SetNumLockAppearance(Value: TdxStatusBarKeyStateAppearance); + procedure SetScrollLockAppearance(Value: TdxStatusBarKeyStateAppearance); + protected + function CanSizing: Boolean; override; + procedure DoAssign(ASource: TPersistent); override; + procedure DrawContent(ACanvas: TcxCanvas; R: TRect; APainter: TdxStatusBarPainterClass); override; + function GetMinWidth: Integer; override; + function InternalBevel: Boolean; override; + public + constructor Create(AOwner: TdxStatusBarPanel); override; + destructor Destroy; override; + procedure RestoreDefaults; override; + published + property Color; + property Font; + property KeyboardStates: TdxStatusBarKeyboardStates read FKeyboardStates write SetKeyboardStates + default [dxksCapsLock, dxksNumLock, dxksScrollLock, dxksInsert]; + property FullRect: Boolean read FFullRect write SetFullRect default False; + property CapsLockKeyAppearance: TdxStatusBarKeyStateAppearance read GetCapsLockAppearance write SetCapsLockAppearance; + property NumLockKeyAppearance: TdxStatusBarKeyStateAppearance read GetNumLockAppearance write SetNumLockAppearance; + property ScrollLockKeyAppearance: TdxStatusBarKeyStateAppearance read GetScrollLockAppearance write SetScrollLockAppearance; + property InsertKeyAppearance: TdxStatusBarKeyStateAppearance read GetInsertAppearance write SetInsertAppearance; + property ParentFont; + end; + + { TdxStatusBarContainerPanelStyle } + + TdxStatusBarContainerPanelStyle = class; + + TdxStatusBarContainerControl = class(TcxControl) + private + FPanelStyle: TdxStatusBarContainerPanelStyle; + protected + procedure Paint; override; + function MayFocus: Boolean; override; + function NeedsScrollBars: Boolean; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + end; + + TdxStatusBarContainerPanelStyle = class(TdxStatusBarPanelStyle) + private + FAlignControl: Boolean; + FContainer: TdxStatusBarContainerControl; + procedure SetContainer(Value: TdxStatusBarContainerControl); + protected + function CanDelete: Boolean; override; + procedure DoAssign(ASource: TPersistent); override; + procedure DrawContent(ACanvas: TcxCanvas; R: TRect; APainter: TdxStatusBarPainterClass); override; + procedure PanelVisibleChanged; override; + public + constructor Create(AOwner: TdxStatusBarPanel); override; + destructor Destroy; override; + procedure RestoreDefaults; override; + published + property AlignControl: Boolean read FAlignControl write FAlignControl default True; + property Container: TdxStatusBarContainerControl read FContainer write SetContainer; + end; + + { TdxStatusBarPanel } + + TdxStatusBarPanelBevel = (dxpbNone, dxpbLowered, dxpbRaised); + TdxStatusBarDrawPanelEvent = procedure(Sender: TdxStatusBarPanel; ACanvas: TcxCanvas; + const ARect: TRect; var ADone: Boolean) of object; + + TdxStatusBarPanel = class(TCollectionItem) + private + FBevel: TdxStatusBarPanelBevel; + FBiDiMode: TBiDiMode; + FFixed: Boolean; + FIsMinWidthAssigned: Boolean; + FIsWidthAssigned: Boolean; + FMinWidth: Integer; + FPanelStyle: TdxStatusBarPanelStyle; + FPanelStyleClass: TdxStatusBarPanelStyleClass; + FPanelStyleEvents: TNotifyEvent; + FParentBiDiMode: Boolean; + FText: string; + FVisible: Boolean; + FWidth: Integer; + FOnClick: TNotifyEvent; + FOnDblClick: TNotifyEvent; + FOnDrawPanel: TdxStatusBarDrawPanelEvent; + + function GetFixed: Boolean; + function GetLookAndFeel: TcxLookAndFeel; + function GetMinWidth: Integer; + function GetPanelStyleClassName: string; + function GetStatusBarControl: TdxCustomStatusBar; + function GetWidth: Integer; + function IsBiDiModeStored: Boolean; + function IsMinWidthStored: Boolean; + function IsWidthStored: Boolean; + procedure SetBevel(Value: TdxStatusBarPanelBevel); + procedure SetBiDiMode(Value: TBiDiMode); + procedure SetFixed(Value: Boolean); + procedure SetMinWidth(Value: Integer); + procedure SetPanelStyle(Value: TdxStatusBarPanelStyle); + procedure SetPanelStyleClass(const Value: TdxStatusBarPanelStyleClass); + procedure SetPanelStyleClassName(Value: string); + procedure SetParentBiDiMode(Value: Boolean); + procedure SetText(const Value: string); + procedure SetVisible(Value: Boolean); + procedure SetWidth(Value: Integer); + protected + procedure Click; virtual; + procedure CreatePanelStyle; virtual; + procedure DblClick; virtual; + function DefaultMinWidth: Integer; virtual; + function DefaultWidth: Integer; virtual; + procedure DestroyPanelStyle; virtual; + function GetDisplayName: string; override; + procedure Loaded; + function PaintMinWidth: Integer; virtual; + function PaintWidth: Integer; virtual; + procedure PreparePaintWidth(var AWidth: Integer); virtual; + procedure StatusBarPanelStyleChanged; virtual; + property LookAndFeel: TcxLookAndFeel read GetLookAndFeel; + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; virtual; + + procedure ParentBiDiModeChanged; + function UseRightToLeftAlignment: Boolean; + function UseRightToLeftReading: Boolean; + + property PanelStyleClass: TdxStatusBarPanelStyleClass read FPanelStyleClass write SetPanelStyleClass; + property StatusBarControl: TdxCustomStatusBar read GetStatusBarControl; + published + property PanelStyleClassName: string read GetPanelStyleClassName write SetPanelStyleClassName; + property PanelStyle: TdxStatusBarPanelStyle read FPanelStyle write SetPanelStyle; + property PanelStyleEvents: TNotifyEvent read FPanelStyleEvents write FPanelStyleEvents; + + property Bevel: TdxStatusBarPanelBevel read FBevel write SetBevel default dxpbLowered; + property BiDiMode: TBiDiMode read FBiDiMode write SetBiDiMode stored IsBiDiModeStored; + property Fixed: Boolean read GetFixed write SetFixed default True; + property MinWidth: Integer read GetMinWidth write SetMinWidth stored IsMinWidthStored; + property ParentBiDiMode: Boolean read FParentBiDiMode write SetParentBiDiMode default True; + property Text: string read FText write SetText; + property Visible: Boolean read FVisible write SetVisible default True; + property Width: Integer read GetWidth write SetWidth stored IsWidthStored; + property OnClick: TNotifyEvent read FOnClick write FOnClick; + property OnDblClick: TNotifyEvent read FOnDblClick write FOnDblClick; + property OnDrawPanel: TdxStatusBarDrawPanelEvent read FOnDrawPanel write FOnDrawPanel; + end; + + { TdxStatusBarPanels } + + TdxStatusBarPanels = class(TCollection) + private + FStatusBarControl: TdxCustomStatusBar; + function GetItem(Index: Integer): TdxStatusBarPanel; + procedure SetItem(Index: Integer; Value: TdxStatusBarPanel); + protected + function GetOwner: TPersistent; override; + procedure Loaded; + procedure Update(Item: TCollectionItem); override; + public + constructor Create(AStatusBarControl: TdxCustomStatusBar); + function Add: TdxStatusBarPanel; + function Insert(Index: Integer): TdxStatusBarPanel; + property Items[Index: Integer]: TdxStatusBarPanel read GetItem write SetItem; default; + end; + + { Painters } + + TdxStatusBarPaintStyle = (stpsStandard, stpsFlat, stpsXP, stpsOffice11, stpsUseLookAndFeel); + + TdxStatusBarPainter = class + public + // calc + class procedure AdjustTextColor(AStatusBar: TdxCustomStatusBar; var AColor: TColor; + Active: Boolean); virtual; + class function BorderSizes(AStatusBar: TdxCustomStatusBar): TRect; virtual; + class function DrawSizeGripFirst: Boolean; virtual; + class function GripAreaSize: TSize; virtual; + class function GripSize: TSize; virtual; + class function IsNativeBackground: Boolean; virtual; + class function SeparatorSize: Integer; virtual; + class function TopBorderSize: Integer; virtual; + // draw + class procedure DrawBorder(AStatusBar: TdxCustomStatusBar; ACanvas: TcxCanvas; + var R: TRect); virtual; + class procedure DrawEmptyPanel(AStatusBar: TdxCustomStatusBar; ACanvas: TcxCanvas; + R: TRect); virtual; + class procedure DrawPanel(AStatusBar: TdxCustomStatusBar; APanel: TdxStatusBarPanel; + ACanvas: TcxCanvas; R: TRect); virtual; + class procedure DrawPanelBorder(AStatusBar: TdxCustomStatusBar; ABevel: TdxStatusBarPanelBevel; + ACanvas: TcxCanvas; var R: TRect); virtual; + class procedure DrawPanelSeparator(AStatusBar: TdxCustomStatusBar; ACanvas: TcxCanvas; + const R: TRect); virtual; + class procedure DrawSizeGrip(AStatusBar: TdxCustomStatusBar; ACanvas: TcxCanvas; + R: TRect; AOverlapped: Boolean); virtual; + class procedure DrawTopBorder(AStatusBar: TdxCustomStatusBar; ACanvas: TcxCanvas; + const R: TRect); virtual; + class procedure FillBackground(AStatusBar: TdxCustomStatusBar; APanel: TdxStatusBarPanel; + ACanvas: TcxCanvas; const R: TRect); virtual; + class function GetPanelBevel(APanel: TdxStatusBarPanel): TdxStatusBarPanelBevel; virtual; + class function GetPanelColor(AStatusBar: TdxCustomStatusBar; APanel: TdxStatusBarPanel): TColor; virtual; + class function ValidatePanelTextRect(AStatusBar: TdxCustomStatusBar; + APanel: TdxStatusBarPanel; const R: TRect): TRect; virtual; + end; + + TdxStatusBarStandardPainter = class(TdxStatusBarPainter) + public + class procedure DrawPanelBorder(AStatusBar: TdxCustomStatusBar; ABevel: TdxStatusBarPanelBevel; + ACanvas: TcxCanvas; var R: TRect); override; + class procedure DrawPanelSeparator(AStatusBar: TdxCustomStatusBar; ACanvas: TcxCanvas; + const R: TRect); override; + class procedure FillBackground(AStatusBar: TdxCustomStatusBar; APanel: TdxStatusBarPanel; + ACanvas: TcxCanvas; const R: TRect); override; + end; + + TdxStatusBarFlatPainter = class(TdxStatusBarStandardPainter) + public + class procedure DrawPanelBorder(AStatusBar: TdxCustomStatusBar; ABevel: TdxStatusBarPanelBevel; + ACanvas: TcxCanvas; var R: TRect); override; + end; + + TdxStatusBarOffice11Painter = class(TdxStatusBarPainter) + public + // calc + class function BorderSizes(AStatusBar: TdxCustomStatusBar): TRect; override; + // draw + class procedure DrawBorder(AStatusBar: TdxCustomStatusBar; ACanvas: TcxCanvas; + var R: TRect); override; + class procedure DrawPanelBorder(AStatusBar: TdxCustomStatusBar; ABevel: TdxStatusBarPanelBevel; + ACanvas: TcxCanvas; var R: TRect); override; + class procedure DrawPanelSeparator(AStatusBar: TdxCustomStatusBar; ACanvas: TcxCanvas; + const R: TRect); override; + class procedure DrawSizeGrip(AStatusBar: TdxCustomStatusBar; ACanvas: TcxCanvas; + R: TRect; AOverlapped: Boolean); override; + end; + + TdxStatusBarXPPainter = class(TdxStatusBarPainter) + public + // calc + class function BorderSizes(AStatusBar: TdxCustomStatusBar): TRect; override; + class function GripAreaSize: TSize; override; + class function SeparatorSize: Integer; override; + // draw + class procedure DrawBorder(AStatusBar: TdxCustomStatusBar; ACanvas: TcxCanvas; + var R: TRect); override; + class procedure DrawPanelSeparator(AStatusBar: TdxCustomStatusBar; ACanvas: TcxCanvas; + const R: TRect); override; + class procedure DrawSizeGrip(AStatusBar: TdxCustomStatusBar; ACanvas: TcxCanvas; + R: TRect; AOverlapped: Boolean); override; + end; + + { TdxStatusBarViewInfo } + + TdxStatusBarViewInfo = class + private + FPanels: TList; + FWidths: TList; + FSizeGripOvelapped: Boolean; + FStatusBar: TdxCustomStatusBar; + function GetWidth(Index: Integer): Integer; + function GetPanel(Index: Integer): TdxStatusBarPanel; + function GetPanelCount: Integer; + protected + procedure AddCalculatedItems(AAutoWidthObject: TcxAutoWidthObject); + function GetCalculatedItemCount: Integer; + function GetPanelAt(const APanelsBounds: TRect; X, Y: Integer): TdxStatusBarPanel; + procedure UpdatePanels; + public + constructor Create(AOwner: TdxCustomStatusBar); virtual; + destructor Destroy; override; + procedure Calculate(const ABounds: TRect); virtual; + + property PanelCount: Integer read GetPanelCount; + property Panels[Index: Integer]: TdxStatusBarPanel read GetPanel; + property Widths[Index: Integer]: Integer read GetWidth; default; + property SizeGripOvelapped: Boolean read FSizeGripOvelapped; + property StatusBar: TdxCustomStatusBar read FStatusBar; + end; + + { TdxCustomStatusBar } + + TdxStatusBarPanelCreateClassEvent = procedure(Sender: TdxCustomStatusBar; + var AStatusPanelClass: TdxStatusBarPanelClass) of object; + + TdxCustomStatusBar = class(TcxControl, IdxSkinSupport) + private + FBorderWidth: Integer; + FImages: TCustomImageList; + FImageChangeLink: TChangeLink; + FLookAndFeel: TcxLookAndFeel; + FPainter: TdxStatusBarPainterClass; + FPaintStyle: TdxStatusBarPaintStyle; + FPanels: TdxStatusBarPanels; + FSizeGrip: Boolean; + FThemeAvailable: Boolean; + FThemeChangedNotificator: TdxThemeChangedNotificator; + FViewInfo: TdxStatusBarViewInfo; + FOnHint: TNotifyEvent; + + function GetPanelsBounds: TRect; + procedure ImageListChange(Sender: TObject); + procedure LookAndFeelChangeHandler(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); + procedure SetBorderWidth(Value: Integer); + procedure SetImages(const Value: TCustomImageList); + procedure SetLookAndFeel(Value: TcxLookAndFeel); + procedure SetPanels(Value: TdxStatusBarPanels); + procedure SetPaintStyle(Value: TdxStatusBarPaintStyle); + procedure SetSizeGrip(Value: Boolean); + procedure CMBiDiModeChanged(var Message: TMessage); message CM_BIDIMODECHANGED; + procedure CMColorChanged(var Message: TMessage); message CM_COLORCHANGED; + procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED; + procedure CMParentFontChanged(var Message: TMessage); message CM_PARENTFONTCHANGED; + procedure CMSysColorChange(var Message: TMessage); message CM_SYSCOLORCHANGE; + procedure CMWinIniChange(var Message: TMessage); message CM_WININICHANGE; + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + protected + procedure AdjustTextColor(var AColor: TColor; Active: Boolean); virtual; + function CreateViewInfo: TdxStatusBarViewInfo; virtual; + procedure FontChanged; override; + function HasBackground: Boolean; override; + procedure Loaded; override; + function MayFocus: Boolean; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + function NeedsScrollBars: Boolean; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure Paint; override; + procedure Resize; override; + + procedure Calculate; virtual; + function ContainerByName(const AName: string): TdxStatusBarContainerControl; + function CreatePanel: TdxStatusBarPanel; virtual; + function CreatePanels: TdxStatusBarPanels; virtual; + function DoHint: Boolean; virtual; + class function GetDeafultPanelStyleClass: TdxStatusBarPanelStyleClass; virtual; + function GetPainterClass: TdxStatusBarPainterClass; virtual; + function GetPaintStyle: TdxStatusBarPaintStyle; virtual; + class function GetStatusPanelClass: TdxStatusBarPanelClass; virtual; + procedure InitPainterClass; virtual; + procedure PaintStyleChanged; virtual; + procedure Recalculate; + function SizeGripAllocated: Boolean; virtual; + procedure ThemeChanged; virtual; + procedure UpdatePanels; virtual; + + property Panels: TdxStatusBarPanels read FPanels write SetPanels; + property SizeGrip: Boolean read FSizeGrip write SetSizeGrip default True; + property LookAndFeel: TcxLookAndFeel read FLookAndFeel write SetLookAndFeel; + property Painter: TdxStatusBarPainterClass read FPainter; + property PaintStyle: TdxStatusBarPaintStyle read FPaintStyle write SetPaintStyle default stpsStandard; + property BorderWidth: Integer read FBorderWidth write SetBorderWidth default 0; + property ViewInfo: TdxStatusBarViewInfo read FViewInfo; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + {$IFNDEF DELPHI10} + function ClientToParent(const Point: TPoint; AParent: TWinControl = nil): TPoint; + {$ENDIF} + function ExecuteAction(Action: TBasicAction): Boolean; override; + function CanAcceptPanelStyle(Value: TdxStatusBarPanelStyleClass): Boolean; virtual; + function GetPanelAt(X, Y: Integer): TdxStatusBarPanel; virtual; + property OnHint: TNotifyEvent read FOnHint write FOnHint; + published + property Images: TCustomImageList read FImages write SetImages; + end; + + { TdxStatusBar } + + TdxStatusBar = class(TdxCustomStatusBar) + published + property Images; + property Panels; + property PaintStyle; + property SizeGrip; + property LookAndFeel; + property OnHint; + property BorderWidth; + { TcxControl properties} + property Anchors; + property BiDiMode; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property Font; + property Color default clBtnFace; + property Constraints; + property ShowHint; + property ParentBiDiMode; + property ParentFont default False; + property ParentShowHint; + property PopupMenu; + property Visible; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnClick; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnResize; + property OnStartDock; + property OnStartDrag; + end; + +var + dxStatusBarSkinPainterClass: TdxStatusBarPainterClass = nil; + +function GetRegisteredStatusBarPanelStyles: TcxRegisteredClasses; +procedure LoadIndicatorBitmap(ABitmap: TBitmap; AIndicatorType: TdxStatusBarStateIndicatorType); + +implementation + +{$R dxStatusBar.res} + +uses + dxThemeConsts, dxUxTheme, dxOffice11, ActnList, StdActns; + +const + GRIP_AREA_SIZE = 16; + GRIP_SIZE = 12; + PANELSEPARATORWIDTH = 2; + +resourcestring + cxSTextPanelStyle = 'Text Panel'; + cxSContainerPanelStyle = 'Container Panel'; + cxSKeyboardStatePanelStyle = 'Keyboard State Panel'; + cxSStateIndicatorPanelStyle = 'State Indicator Panel'; + // design-time + cxSCantDeleteAncestor = 'Selection contains a component introduced in an ancestor form which cannot be deleted'; + +var + FRegisteredStatusBarPanelStyles: TcxRegisteredClasses; + +function GetRegisteredStatusBarPanelStyles: TcxRegisteredClasses; +begin + if FRegisteredStatusBarPanelStyles = nil then + FRegisteredStatusBarPanelStyles := TcxRegisteredClasses.Create; + Result := FRegisteredStatusBarPanelStyles; +end; + +procedure LoadIndicatorBitmap(ABitmap: TBitmap; AIndicatorType: TdxStatusBarStateIndicatorType); +begin + case AIndicatorType of + sitOff: ABitmap.LoadFromResourceName(HInstance, 'DXSTATUSBAR_GRAY'); + sitYellow: ABitmap.LoadFromResourceName(HInstance, 'DXSTATUSBAR_YELLOW'); + sitBlue: ABitmap.LoadFromResourceName(HInstance, 'DXSTATUSBAR_BLUE'); + sitGreen: ABitmap.LoadFromResourceName(HInstance, 'DXSTATUSBAR_GREEN'); + sitRed: ABitmap.LoadFromResourceName(HInstance, 'DXSTATUSBAR_RED'); + sitTeal: ABitmap.LoadFromResourceName(HInstance, 'DXSTATUSBAR_TEAL'); + sitPurple: ABitmap.LoadFromResourceName(HInstance, 'DXSTATUSBAR_PURPLE'); + end; +end; + +procedure DrawSizeGrip(DC: HDC; R: TRect); // dxBar +const + ROP_DSPDxax = $00E20746; +var + APrevBitmap, ATempBitmap, AMaskBitmap: HBITMAP; + TempDC, MDC, MaskDC: HDC; + W, H: Integer; + APrevBkColor: COLORREF; +begin + W := R.Right - R.Left; + H := R.Bottom - R.Top; + TempDC := CreateCompatibleDC(DC); + ATempBitmap := SelectObject(TempDC, CreateCompatibleBitmap(DC, W, H)); + try + BitBlt(TempDC, 0, 0, W, H, DC, R.Left, R.Top, SRCCOPY); // 1 + MDC := CreateCompatibleDC(DC); + APrevBitmap := SelectObject(MDC, CreateCompatibleBitmap(DC, W, H)); + DrawFrameControl(MDC, Rect(0, 0, W, H), DFC_SCROLL, DFCS_SCROLLSIZEGRIP); // 2 + + MaskDC := CreateCompatibleDC(DC); + AMaskBitmap := SelectObject(MaskDC, CreateBitmap(W, H, 1, 1, nil)); + try + APrevBkColor := SetBkColor(MDC, ColorToRGB(clBtnFace)); //! + BitBlt(MaskDC, 0, 0, W, H, MDC, 0, 0, SRCCOPY); + SetBkColor(MDC, APrevBkColor); + + BitBlt(TempDC, 0, 0, W, H, MaskDC, 0, 0, MERGEPAINT); + BitBlt(MDC, 0, 0, W, H, MaskDC, 0, 0, SRCPAINT); + BitBlt(TempDC, 0, 0, W, H, MDC, 0, 0, SRCAND); + finally + DeleteObject(SelectObject(MaskDC, AMaskBitmap)); + DeleteDC(MaskDC); + end; + + DeleteObject(SelectObject(MDC, APrevBitmap)); + DeleteDC(MDC); + + BitBlt(DC, R.Left, R.Top, W, H, TempDC, 0, 0, SRCCOPY); + finally + DeleteObject(SelectObject(TempDC, ATempBitmap)); + DeleteDC(TempDC); + end; +end; + +procedure GenContainerName(APanel: TdxStatusBarPanel; AContainer: TdxStatusBarContainerControl); +var + I: Integer; +begin + I := APanel.ID; + while I <> -1 do + try + AContainer.Name := APanel.StatusBarControl.Name + 'Container' + IntTostr(I); + I := -1; + except + on EComponentError do //Ignore rename errors + Inc(I); + end; +end; + +{ TdxStatusBarPanelStyle } + +constructor TdxStatusBarPanelStyle.Create(AOwner: TdxStatusBarPanel); +begin + inherited Create; + FOwner := AOwner; + FFont := TFont.Create; + FFont.OnChange := FontChanged; + ParentFont := True; +end; + +destructor TdxStatusBarPanelStyle.Destroy; +begin + FOwner := nil; + FreeAndNil(FFont); + inherited; +end; + +procedure TdxStatusBarPanelStyle.Assign(Source: TPersistent); +begin + if Source is TdxStatusBarPanelStyle then + begin + BeginUpdate; + try + DoAssign(Source); + finally + EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +procedure TdxStatusBarPanelStyle.BeginUpdate; +begin + if Assigned(Owner) and Assigned(Owner.Collection) then + Owner.Collection.BeginUpdate; +end; + +procedure TdxStatusBarPanelStyle.EndUpdate; +begin + if Assigned(Owner) and Assigned(Owner.Collection) then + Owner.Collection.EndUpdate; +end; + +procedure TdxStatusBarPanelStyle.RestoreDefaults; +begin + FAlignment := taLeftJustify; + FIsColorAssigned := False; + ParentFont := True; + Owner.Changed(False); +end; + +procedure TdxStatusBarPanelStyle.AdjustTextColor(var AColor: TColor; + Active: Boolean); +begin + if AColor = clDefault then + StatusBarControl.AdjustTextColor(AColor, Active); +end; + +function TdxStatusBarPanelStyle.CanDelete: Boolean; +begin + Result := True; +end; + +function TdxStatusBarPanelStyle.CanSizing: Boolean; +begin + Result := True; +end; + +procedure TdxStatusBarPanelStyle.Changed; +begin + if Assigned(FOwner) then + FOwner.StatusBarPanelStyleChanged; +end; + +procedure TdxStatusBarPanelStyle.CheckSizeGripRect(var R: TRect); +begin + if (Owner.Index = (StatusBarControl.Panels.Count - 1)) and StatusBarControl.SizeGripAllocated then + Dec(R.Right, StatusBarControl.Painter.GripAreaSize.cx); +end; + +function TdxStatusBarPanelStyle.DefaultColor: TColor; +begin + Result := StatusBarControl.Color; +end; + +procedure TdxStatusBarPanelStyle.DoAssign(ASource: TPersistent); +var + AStyle: TdxStatusBarPanelStyle; +begin + AStyle := TdxStatusBarPanelStyle(ASource); + RestoreDefaults; + Alignment := AStyle.Alignment; + if AStyle.IsColorStored then + Color := AStyle.Color; + if AStyle.IsFontStored then + Font.Assign(AStyle.Font) + else + ParentFontChanged; +end; + +procedure TdxStatusBarPanelStyle.DrawContent(ACanvas: TcxCanvas; R: TRect; + APainter: TdxStatusBarPainterClass); +begin + APainter.FillBackground(Self.StatusBarControl, Owner, ACanvas, R); +end; + +function TdxStatusBarPanelStyle.GetMinWidth: Integer; +begin + Result := 20; +end; + +function TdxStatusBarPanelStyle.GetPanelFixed: Boolean; +begin + Result := Owner.FFixed; +end; + +class function TdxStatusBarPanelStyle.GetVersion: Integer; +begin + Result := 0; +end; + +function TdxStatusBarPanelStyle.InternalBevel: Boolean; +begin + Result := False; +end; + +procedure TdxStatusBarPanelStyle.Loaded; +begin +end; + +procedure TdxStatusBarPanelStyle.PanelVisibleChanged; +begin +end; + +procedure TdxStatusBarPanelStyle.ParentFontChanged; +begin + if ParentFont then + begin + Font.Assign(StatusBarControl.Font); + FParentFont := True; + end; +end; + +procedure TdxStatusBarPanelStyle.FontChanged(Sender: TObject); +begin + FParentFont := False; + Owner.Changed(False); +end; + +function TdxStatusBarPanelStyle.GetColor: TColor; +begin + if FIsColorAssigned then + Result := FColor + else + Result := DefaultColor; +end; + +function TdxStatusBarPanelStyle.GetStatusBarControl: TdxCustomStatusBar; +begin + Result := TdxStatusBarPanels(Owner.Collection).FStatusBarControl; +end; + +function TdxStatusBarPanelStyle.IsColorStored: Boolean; +begin + Result := FIsColorAssigned; +end; + +function TdxStatusBarPanelStyle.IsFontStored: Boolean; +begin + Result := not ParentFont; +end; + +procedure TdxStatusBarPanelStyle.SetAlignment(Value: TAlignment); +begin + if FAlignment <> Value then + begin + FAlignment := Value; + Owner.Changed(False); + end; +end; + +procedure TdxStatusBarPanelStyle.SetColor(Value: TColor); +begin + if FColor <> Value then + begin + FColor := Value; + FIsColorAssigned := True; + Owner.Changed(False); + end; +end; + +procedure TdxStatusBarPanelStyle.SetFont(Value: TFont); +begin + FFont.Assign(Value); +end; + +procedure TdxStatusBarPanelStyle.SetParentFont(Value: Boolean); +begin + if FParentFont <> Value then + begin + FParentFont := Value; + ParentFontChanged; + end; +end; + +{ TdxStatusBarTextPanelStyle } + +constructor TdxStatusBarTextPanelStyle.Create(AOwner: TdxStatusBarPanel); +begin + inherited Create(AOwner); + FImageIndex := -1; +end; + +procedure TdxStatusBarTextPanelStyle.RestoreDefaults; +begin + FAutoHint := False; + FImageIndex := -1; + FEllipsisType := dxetNone; + inherited RestoreDefaults; +end; + +procedure TdxStatusBarTextPanelStyle.DoAssign(ASource: TPersistent); +var + AStyle: TdxStatusBarTextPanelStyle; +begin + inherited; + if ASource is TdxStatusBarTextPanelStyle then + begin + AStyle := TdxStatusBarTextPanelStyle(ASource); + AutoHint := AStyle.AutoHint; + ImageIndex := AStyle.ImageIndex; + EllipsisType := AStyle.EllipsisType; + end; +end; + +procedure TdxStatusBarTextPanelStyle.DrawContent(ACanvas: TcxCanvas; + R: TRect; APainter: TdxStatusBarPainterClass); +const + AShowEndEllipsis: array[TdxStatusBarEllipsisType] of Integer = (0, cxShowEndEllipsis, + cxShowPathEllipsis); +var + ALeft, ATop: Integer; + ATextColor: TColor; + S: string; +begin + inherited; + if Assigned(StatusBarControl.Images) and + (0 <= ImageIndex) and (ImageIndex < StatusBarControl.Images.Count) then + begin + ALeft := R.Left + 1; + ATop := ((R.Top + R.Bottom) div 2) - (StatusBarControl.Images.Height div 2); + R.Left := ALeft + StatusBarControl.Images.Width + 1; + StatusBarControl.Images.Draw(ACanvas.Canvas, ALeft, ATop, + ImageIndex, StatusBarControl.Enabled); + end; + ACanvas.Brush.Style := bsClear; + ATextColor := Font.Color; + APainter.AdjustTextColor(Owner.GetStatusBarControl, ATextColor, True); + AdjustTextColor(ATextColor, True); + ACanvas.Font.Assign(Font); + ACanvas.Font.Color := ATextColor; + InflateRect(R, -2, 0); + S := Owner.Text; + R := APainter.ValidatePanelTextRect(StatusBarControl, Owner, R); + if Assigned(FOnGetText) then + FOnGetText(Self, R, S); + ACanvas.DrawText(S, R, cxSingleLine or cxAlignVCenter or cxAlignmentsHorz[Alignment] or + AShowEndEllipsis[EllipsisType], StatusBarControl.Enabled); + ACanvas.Brush.Style := bsSolid; +end; + +procedure TdxStatusBarTextPanelStyle.SetAutoHint(Value: Boolean); +var + I: Integer; +begin + if FAutoHint <> Value then + begin + for I := 0 to StatusBarControl.Panels.Count - 1 do + if StatusBarControl.Panels[I].PanelStyle is TdxStatusBarTextPanelStyle then + TdxStatusBarTextPanelStyle(StatusBarControl.Panels[I].PanelStyle).FAutoHint := False; + FAutoHint := Value; + end; +end; + +procedure TdxStatusBarTextPanelStyle.SetEllipsisType(Value: TdxStatusBarEllipsisType); +begin + if FEllipsisType <> Value then + begin + FEllipsisType := Value; + Owner.Changed(False); + end; +end; + +procedure TdxStatusBarTextPanelStyle.SetImageIndex(Value: TImageIndex); +begin + if FImageIndex <> Value then + begin + FImageIndex := Value; + Owner.Changed(False); + end; +end; + +{ TdxStatusBarStateIndicatorItem } + +constructor TdxStatusBarStateIndicatorItem.Create(Collection: TCollection); +begin + inherited Create(Collection); + FVisible := True; + FIndicatorBitmap := TBitmap.Create; + FIndicatorBitmap.LoadFromResourceName(HInstance, 'DXSTATUSBAR_GRAY'); +end; + +destructor TdxStatusBarStateIndicatorItem.Destroy; +begin + FreeAndNil(FIndicatorBitmap); + inherited Destroy; +end; + +procedure TdxStatusBarStateIndicatorItem.Assign(Source: TPersistent); +begin + if Source is TdxStatusBarStateIndicatorItem then + begin + IndicatorType := TdxStatusBarStateIndicatorItem(Source).IndicatorType; + Visible := TdxStatusBarStateIndicatorItem(Source).Visible; + end + else + inherited Assign(Source); +end; + +procedure TdxStatusBarStateIndicatorItem.SetIndicatorType(Value: TdxStatusBarStateIndicatorType); +begin + if FIndicatorType <> Value then + begin + FIndicatorType := Value; + LoadIndicatorBitmap(FIndicatorBitmap, FIndicatorType); + Changed(False); + end; +end; + +procedure TdxStatusBarStateIndicatorItem.SetVisible(Value: Boolean); +begin + if FVisible <> Value then + begin + FVisible := Value; + Changed(False); + end; +end; + +{ TdxStatusBarStateIndicators } + +constructor TdxStatusBarStateIndicators.Create; +begin + inherited Create(TdxStatusBarStateIndicatorItem); +end; + +function TdxStatusBarStateIndicators.Add: TdxStatusBarStateIndicatorItem; +begin + Result := TdxStatusBarStateIndicatorItem.Create(Self); +end; + +function TdxStatusBarStateIndicators.Insert(Index: Integer): TdxStatusBarStateIndicatorItem; +begin + BeginUpdate; + try + if Index < 0 then Index := 0; + if Index > Count then Index := Count; + Result := Add; + Result.Index := Index; + finally + EndUpdate; + end; +end; + +procedure TdxStatusBarStateIndicators.Update(Item: TCollectionItem); +begin + if Assigned(OnChange) then + OnChange(Self); +end; + +function TdxStatusBarStateIndicators.GetItem(Index: Integer): TdxStatusBarStateIndicatorItem; +begin + Result := TdxStatusBarStateIndicatorItem(inherited GetItem(Index)); +end; + +procedure TdxStatusBarStateIndicators.SetItem(Index: Integer; Value: TdxStatusBarStateIndicatorItem); +begin + inherited SetItem(Index, Value); +end; + +{ TdxStatusBarStateIndicatorPanelStyle } + +constructor TdxStatusBarStateIndicatorPanelStyle.Create(AOwner: TdxStatusBarPanel); +begin + inherited Create(AOwner); + FSpacing := 4; + FIndicators := TdxStatusBarStateIndicators.Create; + FIndicators.OnChange := IndicatorChangeHandler; +end; + +destructor TdxStatusBarStateIndicatorPanelStyle.Destroy; +begin + FreeAndNil(FIndicators); + inherited; +end; + +procedure TdxStatusBarStateIndicatorPanelStyle.RestoreDefaults; +begin + FSpacing := 4; + inherited RestoreDefaults; +end; + +function TdxStatusBarStateIndicatorPanelStyle.CanSizing: Boolean; +begin + Result := False; +end; + +procedure TdxStatusBarStateIndicatorPanelStyle.DoAssign(ASource: TPersistent); +var + AStyle: TdxStatusBarStateIndicatorPanelStyle; +begin + inherited; + if ASource is TdxStatusBarStateIndicatorPanelStyle then + begin + AStyle := TdxStatusBarStateIndicatorPanelStyle(ASource); + Spacing := AStyle.Spacing; + Indicators := AStyle.Indicators; + end; +end; + +procedure TdxStatusBarStateIndicatorPanelStyle.DrawContent(ACanvas: TcxCanvas; + R: TRect; APainter: TdxStatusBarPainterClass); +var + I, ALeft, ATop: Integer; + ABitmap: TBitmap; +begin + inherited; + ALeft := R.Left + Spacing; + for I := 0 to Indicators.Count - 1 do + begin + ABitmap := Indicators[I].FIndicatorBitmap; + if Indicators[I].Visible and (ABitmap <> nil) and not ABitmap.Empty then + begin + ATop := ((R.Top + R.Bottom) div 2) - (ABitmap.Height div 2); + ACanvas.Draw(ALeft, ATop, ABitmap); + Inc(ALeft, ABitmap.Width + Spacing); + end; + end; +end; + +function TdxStatusBarStateIndicatorPanelStyle.GetMinWidth: Integer; +var + I: Integer; + ABitmap: TBitmap; +begin + // WARNING: sync with DrawContent + if Indicators.Count > 0 then + begin + Result := Spacing; + for I := 0 to Indicators.Count - 1 do + begin + ABitmap := Indicators[I].FIndicatorBitmap; + if Indicators[I].Visible and (ABitmap <> nil) and not ABitmap.Empty then + Inc(Result, ABitmap.Width + Spacing); + end; + end + else + Result := 20; +end; + +function TdxStatusBarStateIndicatorPanelStyle.GetIndicators: TdxStatusBarStateIndicators; +begin + Result := FIndicators; +end; + +procedure TdxStatusBarStateIndicatorPanelStyle.IndicatorChangeHandler(Sender: TObject); +begin + Owner.Changed(False); +end; + +procedure TdxStatusBarStateIndicatorPanelStyle.SetIndicators(Value: TdxStatusBarStateIndicators); +begin + FIndicators.Assign(Value); +end; + +procedure TdxStatusBarStateIndicatorPanelStyle.SetSpacing(Value: Integer); +begin + if FSpacing <> Value then + begin + FSpacing := Value; + Owner.Changed(False); + end; +end; + +{ TdxStatusBarKeyboardStateWatchedKey } + +constructor TdxStatusBarKeyboardStateWatchedKey.Create(AKeyCode: Integer); +begin + FKeyCode := AKeyCode; + FKeyState := Lo(GetKeyState(AKeyCode)); +end; + +function TdxStatusBarKeyboardStateWatchedKey.GetCurrentState: Integer; +begin + Result := Lo(GetKeyState(FKeyCode)); +end; + +procedure TdxStatusBarKeyboardStateWatchedKey.SetKeyState(Value: Integer); +begin + FKeyState := Value; +end; + +{ TdxStatusBarKeyboardStateNotifier } + +constructor TdxStatusBarKeyboardStateNotifier.Create(AStatusBar: TdxCustomStatusBar); +begin + inherited Create; + FStatusBar := AStatusBar; + FTimer := TTimer.Create(nil); + FTimer.Interval := 100; + FTimer.OnTimer := Execute; +end; + +destructor TdxStatusBarKeyboardStateNotifier.Destroy; +begin + FTimer.Free; + inherited Destroy; +end; + +procedure TdxStatusBarKeyboardStateNotifier.SubScribeKey(AKeyCode: Integer); +begin + UnSubscribeKey(AKeyCode); + + SetLength(FKeys, Length(FKeys) + 1); + FKeys[High(FKeys)] := TdxStatusBarKeyboardStateWatchedKey.Create(AKeyCode); +end; + +procedure TdxStatusBarKeyboardStateNotifier.UnSubScribeKey(AKeyCode: Integer); +var + I: Integer; +begin + for I := 0 to High(FKeys) do + if FKeys[I].KeyCode = AKeyCode then + begin + FreeAndNil(FKeys[I]); + SetLength(FKeys, Length(FKeys) - 1); + Break; + end; +end; + +procedure TdxStatusBarKeyboardStateNotifier.Execute(Sender: TObject); +var + I, ACurState: Integer; + AChanged: Boolean; +begin + AChanged := False; + for I := Low(FKeys) to High(FKeys) do + begin + ACurState := Lo(GetKeyState(FKeys[I].KeyCode)); + if ACurState <> FKeys[I].KeyState then + begin + FKeys[I].KeyState := ACurState; + AChanged := True; + end; + end; + if AChanged then + FStatusBar.UpdatePanels; +end; + +{ TdxStatusBarKeyStateAppearance } + +constructor TdxStatusBarKeyStateAppearance.Create(AId: TdxStatusBarKeyboardState; + ACode: Integer; const AActiveCaption: string; AActiveFontColor: TColor; + const AInactiveCaption: string; AInactiveFontColor: TColor; AChangeHandler: TNotifyEvent); +begin + inherited Create; + FId := AId; + FCode := ACode; + FOnChange := AChangeHandler; + FActiveFontColor := AActiveFontColor; + FInactiveFontColor := AInactiveFontColor; + FActiveCaption := AActiveCaption; + FInactiveCaption := AInactiveCaption; +end; + +procedure TdxStatusBarKeyStateAppearance.Assign(Source: TPersistent); +begin + if Source is TdxStatusBarKeyStateAppearance then + begin + ActiveFontColor := TdxStatusBarKeyStateAppearance(Source).ActiveFontColor; + InactiveFontColor := TdxStatusBarKeyStateAppearance(Source).InactiveFontColor; + ActiveCaption := TdxStatusBarKeyStateAppearance(Source).ActiveCaption; + InactiveCaption := TdxStatusBarKeyStateAppearance(Source).InactiveCaption; + end + else + inherited Assign(Source); +end; + +function TdxStatusBarKeyStateAppearance.GetRectWidth(ACanvas: TcxCanvas): Integer; +var + AW, IW: Integer; +begin + AW := ACanvas.TextWidth(FActiveCaption); + IW := ACanvas.TextWidth(FInactiveCaption); + if AW > IW then + Result := AW + else + Result := IW; + Inc(Result, 4); +end; + +procedure TdxStatusBarKeyStateAppearance.Changed; +begin + if Assigned(FOnChange) then FOnChange(Self); +end; + +procedure TdxStatusBarKeyStateAppearance.SetActiveFontColor(Value: TColor); +begin + FActiveFontColor := Value; + Changed; +end; + +procedure TdxStatusBarKeyStateAppearance.SetInactiveFontColor(Value: TColor); +begin + FInactiveFontColor := Value; + Changed; +end; + +procedure TdxStatusBarKeyStateAppearance.SetActiveCaption(const Value: string); +begin + FActiveCaption := Value; + Changed; +end; + +procedure TdxStatusBarKeyStateAppearance.SetInactiveCaption(const Value: string); +begin + FInactiveCaption := Value; + Changed; +end; + +{ TdxStatusBarKeyboardStatePanelStyle } + +constructor TdxStatusBarKeyboardStatePanelStyle.Create(AOwner: TdxStatusBarPanel); +var + I: Integer; +begin + inherited Create(AOwner); + FKeyInfos[0] := TdxStatusBarKeyStateAppearance.Create(dxksCapsLock, VK_CAPITAL, 'CAPS', + FFont.Color, 'CAPS', clBtnShadow, NamesChangeHandler); + FKeyInfos[1] := TdxStatusBarKeyStateAppearance.Create(dxksNumLock, VK_NUMLOCK, 'NUM', + FFont.Color, 'NUM', clBtnShadow, NamesChangeHandler); + FKeyInfos[2] := TdxStatusBarKeyStateAppearance.Create(dxksScrollLock, VK_SCROLL, 'SCRL', + FFont.Color, 'SCRL', clBtnShadow, NamesChangeHandler); + FKeyInfos[3] := TdxStatusBarKeyStateAppearance.Create(dxksInsert, VK_INSERT, 'OVR', + FFont.Color, 'INS', clBtnShadow, NamesChangeHandler); + FKeyboardStates := [FKeyInfos[0].Id, FKeyInfos[1].Id, FKeyInfos[2].Id, FKeyInfos[3].Id]; + FNotifier := TdxStatusBarKeyboardStateNotifier.Create(StatusBarControl); + for I := 0 to High(FKeyInfos) do + FNotifier.SubscribeKey(FKeyInfos[I].Code); +end; + +destructor TdxStatusBarKeyboardStatePanelStyle.Destroy; +var + I: Integer; +begin + for I := High(FKeyInfos) downto 0 do + if Assigned(FKeyInfos[I]) then + FNotifier.UnSubscribeKey(FKeyInfos[I].Code); + FNotifier.Free; + for I := High(FKeyInfos) downto 0 do + FreeAndNil(FKeyInfos[I]); + inherited; +end; + +procedure TdxStatusBarKeyboardStatePanelStyle.RestoreDefaults; +begin + FKeyboardStates := [FKeyInfos[0].Id, FKeyInfos[1].Id, FKeyInfos[2].Id, FKeyInfos[3].Id]; + inherited RestoreDefaults; +end; + +function TdxStatusBarKeyboardStatePanelStyle.CanSizing: Boolean; +begin + Result := False; +end; + +procedure TdxStatusBarKeyboardStatePanelStyle.DoAssign(ASource: TPersistent); +var + AStyle: TdxStatusBarKeyboardStatePanelStyle; +begin + inherited; + if ASource is TdxStatusBarKeyboardStatePanelStyle then + begin + AStyle := TdxStatusBarKeyboardStatePanelStyle(ASource); + KeyboardStates := AStyle.KeyboardStates; + FullRect := AStyle.FullRect; + CapsLockKeyAppearance := AStyle.CapsLockKeyAppearance; + NumLockKeyAppearance := AStyle.NumLockKeyAppearance; + ScrollLockKeyAppearance := AStyle.ScrollLockKeyAppearance; + InsertKeyAppearance := AStyle.InsertKeyAppearance; + end; +end; + +procedure TdxStatusBarKeyboardStatePanelStyle.DrawContent(ACanvas: TcxCanvas; + R: TRect; APainter: TdxStatusBarPainterClass); +var + I: Integer; + S: string; + Active: Boolean; + ARect: TRect; + ALastKeyIndex: Integer; + ATextColor: TColor; +begin + inherited; + ACanvas.Font.Assign(FFont); + ALastKeyIndex := -1; + for I := Low(FKeyInfos) to High(FKeyInfos) do + if FKeyInfos[I].Id in FKeyboardStates then + ALastKeyIndex := I; + for I := Low(FKeyInfos) to High(FKeyInfos) do + begin + if FKeyInfos[I].Id in FKeyboardStates then + begin + Active := not (csDesigning in StatusBarControl.ComponentState) and + (Lo(GetKeyState(FKeyInfos[I].Code)) = 1); + if Active then + begin + S := FKeyInfos[I].ActiveCaption; + ATextColor := FKeyInfos[I].FActiveFontColor; + end + else + begin + S := FKeyInfos[I].InactiveCaption; + ATextColor := FKeyInfos[I].FInactiveFontColor; + end; + APainter.AdjustTextColor(Owner.GetStatusBarControl, ATextColor, Active); + AdjustTextColor(ATextColor, Active); + ACanvas.Font.Color := ATextColor; + // key cell + R.Right := R.Left + FKeyInfos[I].GetRectWidth(ACanvas); + if not FullRect then + Inc(R.Right, 2); + ARect := R; + if not FullRect then + APainter.DrawPanelBorder(StatusBarControl, Owner.Bevel, ACanvas, ARect); + ACanvas.Brush.Style := bsClear; + ACanvas.DrawTexT(S, ARect, cxSingleLine or cxAlignVCenter or cxAlignHCenter, + StatusBarControl.Enabled); + ACanvas.Brush.Style := bsSolid; + // key separator + if I <> ALastKeyIndex then + R.Left := R.Right + APainter.SeparatorSize; + end; + end; +end; + +function TdxStatusBarKeyboardStatePanelStyle.GetMinWidth: Integer; +var + I: Integer; + ALastKeyIndex: Integer; +begin + // WARNING: sync with DrawContent + if FKeyboardStates <> [] then + begin + StatusBarControl.Canvas.Font.Assign(FFont); + Result := 0; + ALastKeyIndex := -1; + for I := Low(FKeyInfos) to High(FKeyInfos) do + if FKeyInfos[I].Id in FKeyboardStates then + ALastKeyIndex := I; + for I := Low(FKeyInfos) to High(FKeyInfos) do + begin + if FKeyInfos[I].Id in FKeyboardStates then + begin + Inc(Result, FKeyInfos[I].GetRectWidth(StatusBarControl.Canvas)); + if not FullRect then Inc(Result, 2); // bevel + // key separator + if I <> ALastKeyIndex then + Inc(Result, StatusBarControl.Painter.SeparatorSize); + end; + end; + end + else + Result := 50; +end; + +function TdxStatusBarKeyboardStatePanelStyle.InternalBevel: Boolean; +begin + Result := not FullRect; +end; + +function TdxStatusBarKeyboardStatePanelStyle.GetCapsLockAppearance: TdxStatusBarKeyStateAppearance; +begin + Result := FKeyInfos[0]; +end; + +function TdxStatusBarKeyboardStatePanelStyle.GetInsertAppearance: TdxStatusBarKeyStateAppearance; +begin + Result := FKeyInfos[3]; +end; + +function TdxStatusBarKeyboardStatePanelStyle.GetNumLockAppearance: TdxStatusBarKeyStateAppearance; +begin + Result := FKeyInfos[1]; +end; + +function TdxStatusBarKeyboardStatePanelStyle.GetScrollLockAppearance: TdxStatusBarKeyStateAppearance; +begin + Result := FKeyInfos[2]; +end; + +procedure TdxStatusBarKeyboardStatePanelStyle.NamesChangeHandler(Sender: TObject); +begin + Owner.Changed(False); +end; + +procedure TdxStatusBarKeyboardStatePanelStyle.SetCapsLockAppearance(Value: TdxStatusBarKeyStateAppearance); +begin + FKeyInfos[0].Assign(Value); +end; + +procedure TdxStatusBarKeyboardStatePanelStyle.SetFullRect(Value: Boolean); +begin + if FFullRect <> Value then + begin + FFullRect := Value; + Owner.Changed(True); + end; +end; + +procedure TdxStatusBarKeyboardStatePanelStyle.SetInsertAppearance(Value: TdxStatusBarKeyStateAppearance); +begin + FKeyInfos[3].Assign(Value); +end; + +procedure TdxStatusBarKeyboardStatePanelStyle.SetKeyboardStates(Value: TdxStatusBarKeyboardStates); +begin + if FKeyboardStates <> Value then + begin + FKeyboardStates := Value; + Owner.Changed(False); + end; +end; + +procedure TdxStatusBarKeyboardStatePanelStyle.SetNumLockAppearance(Value: TdxStatusBarKeyStateAppearance); +begin + FKeyInfos[1].Assign(Value); +end; + +procedure TdxStatusBarKeyboardStatePanelStyle.SetScrollLockAppearance(Value: TdxStatusBarKeyStateAppearance); +begin + FKeyInfos[2].Assign(Value); +end; + +{ TdxStatusBarContainerControl } + +constructor TdxStatusBarContainerControl.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := ControlStyle + [csAcceptsControls, csNoDesignVisible]; +end; + +destructor TdxStatusBarContainerControl.Destroy; +var + APanel: TdxStatusBarPanel; +begin + if FPanelStyle <> nil then + begin + APanel := FPanelStyle.Owner; + FPanelStyle.FContainer := nil; + FPanelStyle := nil; + APanel.PanelStyleClass := nil; + end; + inherited Destroy; +end; + +procedure TdxStatusBarContainerControl.Paint; +var + R, AParentRect: TRect; +begin + inherited; + R := ClientRect; + if FPanelStyle <> nil then + begin + AParentRect := FPanelStyle.StatusBarControl.ClientBounds; + OffsetRect(AParentRect, -Left, -Top); + FPanelStyle.StatusBarControl.Painter.DrawBorder(FPanelStyle.StatusBarControl, + Canvas, AParentRect); + FPanelStyle.StatusBarControl.Painter.FillBackground(FPanelStyle.StatusBarControl, + FPanelStyle.Owner, Canvas, R); + end + else + begin + Canvas.Brush.Color := clBtnFace; + Canvas.FillRect(R); + end; + if csDesigning in ComponentState then + begin + Canvas.Pen.Color := clBtnShadow; + Canvas.Brush.Color := clBtnShadow; + Canvas.Brush.Style := bsBDiagonal; +{$IFDEF DELPHI5} + Canvas.Canvas.Rectangle(R); +{$ELSE} + Canvas.Canvas.Rectangle(R.Left, R.Top, R.Right, R.Bottom); +{$ENDIF} + Canvas.Brush.Style := bsSolid; + end; +end; + +function TdxStatusBarContainerControl.MayFocus: Boolean; +begin + Result := False; +end; + +function TdxStatusBarContainerControl.NeedsScrollBars: Boolean; +begin + Result := False; +end; + +{ TdxStatusBarContainerPanelStyle } + +constructor TdxStatusBarContainerPanelStyle.Create(AOwner: TdxStatusBarPanel); +begin + inherited Create(AOwner); + FAlignControl := True; + if StatusBarControl.ComponentState * [csUpdating, csLoading, csReading] = [] then + begin + FContainer := TdxStatusBarContainerControl.Create(StatusBarControl.Owner); + FContainer.FPanelStyle := Self; + FContainer.Parent := StatusBarControl; + if csDesigning in StatusBarControl.ComponentState then + GenContainerName(AOwner, FContainer); + end; +end; + +destructor TdxStatusBarContainerPanelStyle.Destroy; +begin + Container := nil; + inherited; +end; + +procedure TdxStatusBarContainerPanelStyle.RestoreDefaults; +begin + FAlignControl := True; + inherited RestoreDefaults; +end; + +function TdxStatusBarContainerPanelStyle.CanDelete: Boolean; +begin + Result := (Container = nil) or not (csAncestor in Container.ComponentState); +end; + +procedure TdxStatusBarContainerPanelStyle.DoAssign(ASource: TPersistent); +var + AStyle: TdxStatusBarContainerPanelStyle; +begin + inherited; + if ASource is TdxStatusBarContainerPanelStyle then + begin + AStyle := TdxStatusBarContainerPanelStyle(ASource); + AlignControl := AStyle.AlignControl; + if AStyle.Container <> nil then + Container := StatusBarControl.ContainerByName(AStyle.Container.Name); + end; +end; + +procedure TdxStatusBarContainerPanelStyle.DrawContent(ACanvas: TcxCanvas; R: TRect; + APainter: TdxStatusBarPainterClass); +var + I: Integer; +begin + inherited; + if Container <> nil then + begin + CheckSizeGripRect(R); + Container.BoundsRect := R; + if AlignControl and not (csDesigning in StatusBarControl.ComponentState) then + begin + for I := 0 to Container.ControlCount - 1 do + Container.Controls[I].SetBounds(0, 0, Container.Width, Container.Height); + end; + end; +end; + +procedure TdxStatusBarContainerPanelStyle.PanelVisibleChanged; +begin + if Container <> nil then + Container.Visible := Owner.Visible; +end; + +procedure TdxStatusBarContainerPanelStyle.SetContainer(Value: TdxStatusBarContainerControl); +begin + if FContainer <> Value then + begin + if Value = nil then + begin + FContainer.FPanelStyle := nil; + if StatusBarControl.ComponentState * [csDestroying, csUpdating, csLoading, csReading] <> [] then + FContainer := nil + else + FreeAndNil(FContainer); + end + else + begin + FContainer := Value; + FContainer.FPanelStyle := Self; + end; + PanelVisibleChanged; + end; +end; + +{ TdxStatusBarPanel } + +constructor TdxStatusBarPanel.Create(Collection: TCollection); +begin + inherited Create(Collection); + FVisible := True; + FMinWidth := 20; + FWidth := 50; + FFixed := True; + FParentBiDiMode := True; + FBevel := dxpbLowered; + ParentBiDiModeChanged; + // auto create + if StatusBarControl.ComponentState * [csLoading, csReading] = [] then + PanelStyleClass := StatusBarControl.GetDeafultPanelStyleClass; +end; + +destructor TdxStatusBarPanel.Destroy; +begin + DestroyPanelStyle; + inherited Destroy; +end; + +procedure TdxStatusBarPanel.Assign(Source: TPersistent); +begin + if Source is TdxStatusBarPanel then + begin + if Assigned(Collection) then Collection.BeginUpdate; + try + RestoreDefaults; + + PanelStyleClassName := TdxStatusBarPanel(Source).PanelStyleClassName; + PanelStyle := TdxStatusBarPanel(Source).PanelStyle; + + Visible := TdxStatusBarPanel(Source).Visible; + Bevel := TdxStatusBarPanel(Source).Bevel; + BiDiMode := TdxStatusBarPanel(Source).BiDiMode; + Fixed := TdxStatusBarPanel(Source).Fixed; + if TdxStatusBarPanel(Source).IsMinWidthStored then + MinWidth := TdxStatusBarPanel(Source).MinWidth; + ParentBiDiMode := TdxStatusBarPanel(Source).ParentBiDiMode; + Text := TdxStatusBarPanel(Source).Text; + if TdxStatusBarPanel(Source).IsWidthStored then + Width := TdxStatusBarPanel(Source).Width; + + OnClick := TdxStatusBarPanel(Source).OnClick; + OnDblClick := TdxStatusBarPanel(Source).OnDblClick; + OnDrawPanel := TdxStatusBarPanel(Source).OnDrawPanel; + finally + if Assigned(Collection) then Collection.EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +procedure TdxStatusBarPanel.RestoreDefaults; +begin + FVisible := True; + FMinWidth := 20; + FWidth := 50; + FFixed := True; + FParentBiDiMode := True; + FBevel := dxpbLowered; + FIsMinWidthAssigned := False; + FIsWidthAssigned := False; + Changed(True); +end; + +procedure TdxStatusBarPanel.ParentBiDiModeChanged; +begin + if FParentBiDiMode then + begin + if GetOwner <> nil then + begin + BiDiMode := TdxStatusBarPanels(GetOwner).FStatusBarControl.BiDiMode; + FParentBiDiMode := True; + end; + end; +end; + +function TdxStatusBarPanel.UseRightToLeftReading: Boolean; +begin + Result := SysLocale.MiddleEast and (BiDiMode <> bdLeftToRight); +end; + +function TdxStatusBarPanel.UseRightToLeftAlignment: Boolean; +begin + Result := SysLocale.MiddleEast and (BiDiMode = bdRightToLeft); +end; + +procedure TdxStatusBarPanel.Click; +begin + if Assigned(FOnClick) then FOnClick(Self); +end; + +procedure TdxStatusBarPanel.CreatePanelStyle; +begin + if FPanelStyleClass <> nil then + FPanelStyle := FPanelStyleClass.Create(Self); + StatusBarControl.Invalidate; +end; + +procedure TdxStatusBarPanel.DblClick; +begin + if Assigned(FOnDblClick) then FOnDblClick(Self); +end; + +function TdxStatusBarPanel.DefaultMinWidth: Integer; +begin + if PanelStyle <> nil then + Result := PanelStyle.GetMinWidth + else + Result := 20; +end; + +function TdxStatusBarPanel.DefaultWidth: Integer; +begin + if (PanelStyle <> nil) and not PanelStyle.CanSizing then + Result := DefaultMinWidth + else + Result := 50; +end; + +procedure TdxStatusBarPanel.DestroyPanelStyle; +begin + if (StatusBarControl.ComponentState * [csDestroying, csUpdating, csLoading, csReading] = []) and + (PanelStyle <> nil) and not PanelStyle.CanDelete then + raise Exception.Create(cxSCantDeleteAncestor); + FreeAndNil(FPanelStyle); +end; + +function TdxStatusBarPanel.GetDisplayName: string; +begin + Result := Text; + if Result = '' then + Result := inherited GetDisplayName; +end; + +procedure TdxStatusBarPanel.Loaded; +begin + if PanelStyle <> nil then + PanelStyle.Loaded; +end; + +function TdxStatusBarPanel.PaintMinWidth: Integer; +begin + Result := MinWidth; + PreparePaintWidth(Result); +end; + +function TdxStatusBarPanel.PaintWidth: Integer; +begin + Result := Width; + PreparePaintWidth(Result); +end; + +procedure TdxStatusBarPanel.PreparePaintWidth(var AWidth: Integer); +begin + if PanelStyle <> nil then + begin + // bevel + if not PanelStyle.InternalBevel then + Inc(AWidth, 2); + // size grip + if (Index = (StatusBarControl.Panels.Count - 1)) and StatusBarControl.SizeGripAllocated then + Inc(AWidth, StatusBarControl.Painter.GripAreaSize.cx); + end; +end; + +procedure TdxStatusBarPanel.StatusBarPanelStyleChanged; +begin + Changed(False); +end; + +function TdxStatusBarPanel.GetFixed: Boolean; +begin + if (PanelStyle <> nil) and not PanelStyle.CanSizing then + Result := True + else + Result := FFixed; +end; + +function TdxStatusBarPanel.GetLookAndFeel: TcxLookAndFeel; +begin + Result := StatusBarControl.LookAndFeel; +end; + +function TdxStatusBarPanel.GetMinWidth: Integer; +begin + if not FIsMinWidthAssigned or + ((PanelStyle <> nil) and not PanelStyle.CanSizing) then + Result := DefaultMinWidth + else + Result := FMinWidth; +end; + +function TdxStatusBarPanel.GetPanelStyleClassName: string; +begin + if FPanelStyle = nil then + Result := '' + else + Result := FPanelStyle.ClassName; +end; + +function TdxStatusBarPanel.GetStatusBarControl: TdxCustomStatusBar; +begin + Result := TdxStatusBarPanels(Collection).FStatusBarControl; +end; + +function TdxStatusBarPanel.GetWidth: Integer; +begin + if not FIsWidthAssigned or + ((PanelStyle <> nil) and not PanelStyle.CanSizing) then + Result := DefaultWidth + else + Result := FWidth; +end; + +function TdxStatusBarPanel.IsBiDiModeStored: Boolean; +begin + Result := not FParentBiDiMode; +end; + +function TdxStatusBarPanel.IsMinWidthStored: Boolean; +begin + Result := FIsMinWidthAssigned; +end; + +function TdxStatusBarPanel.IsWidthStored: Boolean; +begin + Result := FIsWidthAssigned; +end; + +procedure TdxStatusBarPanel.SetBevel(Value: TdxStatusBarPanelBevel); +begin + if FBevel <> Value then + begin + FBevel := Value; + Changed(False); + end; +end; + +procedure TdxStatusBarPanel.SetBiDiMode(Value: TBiDiMode); +begin + if Value <> FBiDiMode then + begin + FBiDiMode := Value; + FParentBiDiMode := False; + Changed(False); + end; +end; + +procedure TdxStatusBarPanel.SetFixed(Value: Boolean); +begin + if FFixed <> Value then + begin + FFixed := Value; + Changed(False); + end; +end; + +procedure TdxStatusBarPanel.SetMinWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + FMinWidth := Value; + FIsMinWidthAssigned := True; + if Width < FMinWidth then Width := FMinWidth; + Changed(False); +end; + +procedure TdxStatusBarPanel.SetPanelStyle(Value: TdxStatusBarPanelStyle); +begin + if (FPanelStyle <> nil) and (Value <> nil) then + FPanelStyle.Assign(Value); +end; + +procedure TdxStatusBarPanel.SetPanelStyleClass(const Value: TdxStatusBarPanelStyleClass); +begin + if (FPanelStyleClass <> Value) and StatusBarControl.CanAcceptPanelStyle(Value) then + begin + DestroyPanelStyle; + FPanelStyleClass := Value; + CreatePanelStyle; + end; +end; + +procedure TdxStatusBarPanel.SetPanelStyleClassName(Value: string); +begin + PanelStyleClass := TdxStatusBarPanelStyleClass( + GetRegisteredStatusBarPanelStyles.FindByClassName(Value)); +end; + +procedure TdxStatusBarPanel.SetParentBiDiMode(Value: Boolean); +begin + if FParentBiDiMode <> Value then + begin + FParentBiDiMode := Value; + ParentBiDiModeChanged; + end; +end; + +procedure TdxStatusBarPanel.SetText(const Value: string); +begin + if FText <> Value then + begin + FText := Value; + Changed(False); + end; +end; + +procedure TdxStatusBarPanel.SetVisible(Value: Boolean); +begin + if FVisible <> Value then + begin + FVisible := Value; + if PanelStyle <> nil then + PanelStyle.PanelVisibleChanged; + Changed(False); + end; +end; + +procedure TdxStatusBarPanel.SetWidth(Value: Integer); +begin + if Value < FMinWidth then Value := FMinWidth; + FWidth := Value; + FIsWidthAssigned := True; + Changed(False); +end; + +{ TdxStatusBarPanels } + +constructor TdxStatusBarPanels.Create(AStatusBarControl: TdxCustomStatusBar); +begin + inherited Create(TdxStatusBarPanel); + FStatusBarControl := AStatusBarControl; +end; + +function TdxStatusBarPanels.Add: TdxStatusBarPanel; +begin + Result := TdxStatusBarPanel.Create(Self); +end; + +function TdxStatusBarPanels.Insert(Index: Integer): TdxStatusBarPanel; +begin + BeginUpdate; + try + if Index < 0 then Index := 0; + if Index > Count then Index := Count; + Result := Add; + Result.Index := Index; + finally + EndUpdate; + end; +end; + +function TdxStatusBarPanels.GetOwner: TPersistent; +begin + Result := FStatusBarControl; +end; + +procedure TdxStatusBarPanels.Loaded; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].Loaded; +end; + +procedure TdxStatusBarPanels.Update(Item: TCollectionItem); +begin + if FStatusBarControl <> nil then + FStatusBarControl.UpdatePanels; +end; + +function TdxStatusBarPanels.GetItem(Index: Integer): TdxStatusBarPanel; +begin + Result := TdxStatusBarPanel(inherited GetItem(Index)); +end; + +procedure TdxStatusBarPanels.SetItem(Index: Integer; Value: TdxStatusBarPanel); +begin + inherited SetItem(Index, Value); +end; + +{ TdxStatusBarViewInfo } + +constructor TdxStatusBarViewInfo.Create(AOwner: TdxCustomStatusBar); +begin + inherited Create; + FStatusBar := AOwner; + FWidths := TList.Create; + FPanels := TList.Create; +end; + +destructor TdxStatusBarViewInfo.Destroy; +begin + FPanels.Free; + FWidths.Free; + inherited Destroy; +end; + +procedure TdxStatusBarViewInfo.Calculate(const ABounds: TRect); +var + AAutoWidthObject: TcxAutoWidthObject; + ACount, I: Integer; +begin + UpdatePanels; + FWidths.Clear; + ACount := GetCalculatedItemCount; + if ACount > 0 then + begin + AAutoWidthObject := TcxAutoWidthObject.Create(ACount); + try + AddCalculatedItems(AAutoWidthObject); + AAutoWidthObject.AvailableWidth := ABounds.Right - ABounds.Left; + AAutoWidthObject.Calculate; + FSizeGripOvelapped := AAutoWidthObject.Width >= AAutoWidthObject.AvailableWidth; + for I := 0 to AAutoWidthObject.Count - 1 do + FWidths.Add(Pointer(AAutoWidthObject[I].AutoWidth)); + finally + AAutoWidthObject.Free; + end; + end; +end; + +procedure TdxStatusBarViewInfo.AddCalculatedItems(AAutoWidthObject: TcxAutoWidthObject); +var + I, ACount, ASeparatorSize: Integer; + ANonFixedExists: Boolean; +begin + ANonFixedExists := False; + ASeparatorSize := StatusBar.Painter.SeparatorSize; + ACount := PanelCount; + for I := 0 to ACount - 1 do + begin + with AAutoWidthObject.AddItem do + begin + MinWidth := Panels[I].PaintMinWidth; + Width := Panels[I].PaintWidth; + if not Panels[I].Fixed then + begin + Fixed := False; + ANonFixedExists := True; + end + else + begin + if (I = (ACount - 1)) and not ANonFixedExists then + Fixed := False + else + Fixed := True; + end; + end; + // Separator + if I < (ACount - 1) then + with AAutoWidthObject.AddItem do + begin + MinWidth := ASeparatorSize; + Width := ASeparatorSize; + Fixed := True; + end; + end; +end; + +procedure TdxStatusBarViewInfo.UpdatePanels; +var + I: Integer; +begin + FPanels.Clear; + for I := 0 to StatusBar.Panels.Count - 1 do + if StatusBar.Panels[I].Visible then + FPanels.Add(StatusBar.Panels[I]); +end; + +function TdxStatusBarViewInfo.GetCalculatedItemCount: Integer; +begin + Result := PanelCount; //visible panels + Inc(Result, Result - 1); //separators +end; + +function TdxStatusBarViewInfo.GetPanelAt(const APanelsBounds: TRect; + X, Y: Integer): TdxStatusBarPanel; +var + ARect: TRect; + I, J, ACount: Integer; +begin + Result := nil; + ACount := PanelCount; + if ACount = 0 then Exit; + // Calc Panel Rects + J := 0; + ARect := APanelsBounds; + for I := 0 to ACount - 1 do + begin + // Panel + ARect.Right := ARect.Left + Widths[J]; + if PtInRect(ARect, Point(X, Y)) then + begin + Result := Panels[I]; + Break; + end; + Inc(J); + // Separator + if I < (ACount - 1) then + begin + ARect.Left := ARect.Right; + ARect.Right := ARect.Left + Widths[J]; + Inc(J); + end; + ARect.Left := ARect.Right; + end; +end; + +function TdxStatusBarViewInfo.GetPanel(Index: Integer): TdxStatusBarPanel; +begin + Result := TdxStatusBarPanel(FPanels[Index]); +end; + +function TdxStatusBarViewInfo.GetPanelCount: Integer; +begin + Result := FPanels.Count; +end; + +function TdxStatusBarViewInfo.GetWidth(Index: Integer): Integer; +begin + if (Index >= 0) and (Index < FWidths.Count) then + Result := Integer(FWidths[Index]) + else + Result := 0; +end; + +{ TdxCustomStatusBar } + +constructor TdxCustomStatusBar.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FViewInfo := CreateViewInfo; + ControlStyle := ControlStyle - [csSetCaption] + + [csCaptureMouse, csClickEvents, csDoubleClicks, csOpaque]; + DoubleBuffered := True; + Color := clBtnFace; + Height := 20; + Align := alBottom; + ParentFont := False; + FSizeGrip := True; + FPanels := CreatePanels; + FImageChangeLink := TChangeLink.Create; + FImageChangeLink.OnChange := ImageListChange; + FThemeChangedNotificator := TdxThemeChangedNotificator.Create; + FThemeChangedNotificator.OnThemeChanged := ThemeChanged; + FLookAndFeel := TcxLookAndFeel.Create(Self); + FLookAndFeel.OnChanged := LookAndFeelChangeHandler; + PaintStyleChanged; + CreateOffice11Colors; +end; + +destructor TdxCustomStatusBar.Destroy; +begin + ReleaseOffice11Colors; + FreeAndNil(FLookAndFeel); + FreeAndNil(FThemeChangedNotificator); + FreeAndNil(FImageChangeLink); + FreeAndNil(FPanels); + FreeAndNil(FViewInfo); + inherited Destroy; +end; + +{$IFNDEF DELPHI10} +function TdxCustomStatusBar.ClientToParent(const Point: TPoint; AParent: TWinControl = nil): TPoint; +const + SParentRequired = 'Control ''%s'' has no parent window'; + SParentGivenNotAParent = 'Parent given is not a parent of ''%s'''; +var + LParent: TWinControl; +begin + if AParent = nil then + AParent := Parent; + if AParent = nil then + raise EInvalidOperation.CreateFmt(SParentRequired, [Name]); + Result := Point; + Inc(Result.X, Left); + Inc(Result.Y, Top); + LParent := Parent; + while (LParent <> nil) and (LParent <> AParent) do + begin + if LParent.Parent <> nil then + begin + Inc(Result.X, LParent.Left); + Inc(Result.Y, LParent.Top); + end; + if LParent = AParent then + Break + else + LParent := LParent.Parent; + end; + if LParent = nil then + raise EInvalidOperation.CreateFmt(SParentGivenNotAParent, [Name]); +end; +{$ENDIF} + +function TdxCustomStatusBar.ExecuteAction(Action: TBasicAction): Boolean; +var + I: Integer; + APanel: TdxStatusBarPanel; +begin + APanel := nil; + for I := 0 to Panels.Count - 1 do + if (Panels[I].PanelStyle is TdxStatusBarTextPanelStyle) and + TdxStatusBarTextPanelStyle(Panels[I].PanelStyle).AutoHint then + APanel := Panels[I]; + if not (csDesigning in ComponentState) and + (APanel <> nil) and (Action is THintAction) and not DoHint then + begin + APanel.Text := THintAction(Action).Hint; + Result := True; + end + else + Result := inherited ExecuteAction(Action); +end; + +function TdxCustomStatusBar.GetPanelAt(X, Y: Integer): TdxStatusBarPanel; +begin + Result := ViewInfo.GetPanelAt(GetPanelsBounds, X, Y); +end; + +procedure TdxCustomStatusBar.AdjustTextColor(var AColor: TColor; Active: Boolean); +begin +end; + +function TdxCustomStatusBar.CreateViewInfo: TdxStatusBarViewInfo; +begin + Result := TdxStatusBarViewInfo.Create(Self); +end; + +procedure TdxCustomStatusBar.FontChanged; +var + I: Integer; +begin + inherited; + for I := 0 to Panels.Count - 1 do + if Panels[I].PanelStyle <> nil then + Panels[I].PanelStyle.ParentFontChanged; +end; + +function TdxCustomStatusBar.HasBackground: Boolean; +begin + Result := False; +end; + +procedure TdxCustomStatusBar.Loaded; +begin + inherited Loaded; + Panels.Loaded; + Recalculate; +end; + +function TdxCustomStatusBar.MayFocus: Boolean; +begin + Result := False; +end; + +procedure TdxCustomStatusBar.MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +var + APanel: TdxStatusBarPanel; +begin + inherited; + if Button = mbLeft then + begin + APanel := GetPanelAt(X, Y); + if (APanel <> nil) and (ssDouble in Shift) then + APanel.DblClick; + end; +end; + +procedure TdxCustomStatusBar.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +var + APanel: TdxStatusBarPanel; +begin + inherited; + if Button = mbLeft then + begin + APanel := GetPanelAt(X, Y); + if APanel <> nil then + APanel.Click; + end; +end; + +function TdxCustomStatusBar.NeedsScrollBars: Boolean; +begin + Result := False; +end; + +procedure TdxCustomStatusBar.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (AComponent = Images) then + Images := nil; +end; + +procedure TdxCustomStatusBar.Paint; + + procedure DrawPanels(const R: TRect); + var + ARect: TRect; + I, J, ACount: Integer; + begin + ACount := ViewInfo.PanelCount; + J := 0; + ARect := R; + for I := 0 to ACount - 1 do + begin + // Panel + ARect.Right := ARect.Left + ViewInfo[J]; + Painter.DrawPanel(Self, ViewInfo.Panels[I], Canvas, ARect); + Inc(J); + // Separator + if I < (ACount - 1) then + begin + ARect.Left := ARect.Right; + ARect.Right := ARect.Left + ViewInfo[J]; + Painter.DrawPanelSeparator(Self, Canvas, ARect); + Inc(J); + end; + ARect.Left := ARect.Right; + end; + end; + + procedure DrawSizeGrip(R: TRect; AOverlapped: Boolean); + begin + if SizeGripAllocated then + Painter.DrawSizeGrip(Self, Canvas, R, AOverlapped); // <- ExcludeClipRect + end; + +var + R: TRect; + AOverlapped: Boolean; +begin + inherited Paint; + R := ClientBounds; + // Border + Painter.DrawBorder(Self, Canvas, R); + Canvas.IntersectClipRect(R); // !!! + + AOverlapped := (ViewInfo.PanelCount <> 0) and ViewInfo.SizeGripOvelapped; + if Painter.DrawSizeGripFirst then + DrawSizeGrip(R, AOverlapped); + + // Panels + if ViewInfo.PanelCount = 0 then + Painter.DrawEmptyPanel(Self, Canvas, R) + else + DrawPanels(R); + + if not Painter.DrawSizeGripFirst then + DrawSizeGrip(R, AOverlapped); +end; + +procedure TdxCustomStatusBar.Resize; +begin + inherited; + Recalculate; + Invalidate; +end; + +function TdxCustomStatusBar.CanAcceptPanelStyle(Value: TdxStatusBarPanelStyleClass): Boolean; +begin + Result := (Value = nil) or (Value.GetVersion = 0); +end; + +procedure TdxCustomStatusBar.Calculate; +begin + ViewInfo.Calculate(ClientBounds); +end; + +function TdxCustomStatusBar.ContainerByName(const AName: string): TdxStatusBarContainerControl; +var + I: Integer; +begin + Result := nil; + for I := 0 to ControlCount - 1 do + if (Controls[I] is TdxStatusBarContainerControl) and + (CompareText(TdxStatusBarContainerControl(Controls[I]).Name, AName) = 0) then + begin + Result := TdxStatusBarContainerControl(Controls[I]); + Break; + end; +end; + +function TdxCustomStatusBar.CreatePanel: TdxStatusBarPanel; +begin + Result := GetStatusPanelClass.Create(FPanels); +end; + +function TdxCustomStatusBar.CreatePanels: TdxStatusBarPanels; +begin + Result := TdxStatusBarPanels.Create(Self); +end; + +function TdxCustomStatusBar.DoHint: Boolean; +begin + if Assigned(FOnHint) then + begin + FOnHint(Self); + Result := True; + end + else + Result := False; +end; + +class function TdxCustomStatusBar.GetDeafultPanelStyleClass: TdxStatusBarPanelStyleClass; +begin + Result := TdxStatusBarTextPanelStyle; +end; + +function TdxCustomStatusBar.GetPainterClass: TdxStatusBarPainterClass; +begin + if (PaintStyle = stpsUseLookAndFeel) and Assigned(dxStatusBarSkinPainterClass) and + Assigned(LookAndFeel.SkinPainter) then + begin + Result := dxStatusBarSkinPainterClass; + end + else + case GetPaintStyle of + stpsStandard: + Result := TdxStatusBarStandardPainter; + stpsFlat: + Result := TdxStatusBarFlatPainter; + stpsXP: + begin + if FThemeAvailable then + Result := TdxStatusBarXPPainter + else + Result := TdxStatusBarStandardPainter; + end; + stpsOffice11: + Result := TdxStatusBarOffice11Painter; + else + Result := TdxStatusBarStandardPainter; + end; +end; + +function TdxCustomStatusBar.GetPaintStyle: TdxStatusBarPaintStyle; +const + AStyles: array[TcxLookAndFeelKind] of TdxStatusBarPaintStyle = ( + stpsStandard, stpsStandard, stpsFlat{$IFDEF DXVER500}, stpsOffice11{$ENDIF}); +begin + if PaintStyle = stpsUseLookAndFeel then + begin + if LookAndFeel.NativeStyle and FThemeAvailable then + Result := stpsXP + else + Result := AStyles[LookAndFeel.Kind]; + end + else + Result := PaintStyle; +end; + +class function TdxCustomStatusBar.GetStatusPanelClass: TdxStatusBarPanelClass; +begin + Result := TdxStatusBarPanel; +end; + +procedure TdxCustomStatusBar.InitPainterClass; +begin + FThemeAvailable := AreVisualStylesAvailable([totStatus]); + FPainter := GetPainterClass; +end; + +procedure TdxCustomStatusBar.PaintStyleChanged; +begin + InitPainterClass; + UpdatePanels; +end; + +procedure TdxCustomStatusBar.Recalculate; +begin + if not (csDestroying in ComponentState) and Assigned(Panels) then + Calculate; +end; + +function TdxCustomStatusBar.SizeGripAllocated: Boolean; +var + FParentForm: TCustomForm; + FPoint: TPoint; +begin + Result := False; + if FSizeGrip then + begin + FParentForm := GetParentForm(Self); + if Assigned(FParentForm) and (FParentForm.BorderStyle in [bsSizeable, bsSizeToolWin]) and + not (IsZoomed(FParentForm.Handle) or IsIconic(FParentForm.Handle)) then + begin + FPoint := ClientToParent(Point(Width, Height), FParentForm); + Result := (FPoint.X = FParentForm.ClientWidth) and (FPoint.Y = FParentForm.ClientHeight); + end; + end; +end; + +procedure TdxCustomStatusBar.ThemeChanged; +begin + PaintStyleChanged; +end; + +procedure TdxCustomStatusBar.UpdatePanels; +begin + Recalculate; + Invalidate; +end; + +function TdxCustomStatusBar.GetPanelsBounds: TRect; +var + BSR: TRect; +begin + // Calc Border + Result := ClientBounds; + BSR := Painter.BorderSizes(Self); + Inc(Result.Left, BSR.Left); + Inc(Result.Top, BSR.Top); + Dec(Result.Right, BSR.Right); + Dec(Result.Bottom, BSR.Bottom); +end; + +procedure TdxCustomStatusBar.ImageListChange(Sender: TObject); +begin + UpdatePanels; +end; + +procedure TdxCustomStatusBar.LookAndFeelChangeHandler(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + PaintStyleChanged; +end; + +procedure TdxCustomStatusBar.SetBorderWidth(Value: Integer); +begin + if FBorderWidth <> Value then + begin + if Value <= 0 then + FBorderWidth := 0 + else + FBorderWidth := Value; + UpdatePanels; + end; +end; + +procedure TdxCustomStatusBar.SetImages(const Value: TCustomImageList); +begin + if Images <> nil then + Images.UnRegisterChanges(FImageChangeLink); + FImages := Value; + if Images <> nil then + begin + Images.RegisterChanges(FImageChangeLink); + Images.FreeNotification(Self); + end; + UpdatePanels; +end; + +procedure TdxCustomStatusBar.SetLookAndFeel(Value: TcxLookAndFeel); +begin + FLookAndFeel.Assign(Value); + UpdatePanels; +end; + +procedure TdxCustomStatusBar.SetPanels(Value: TdxStatusBarPanels); +begin + FPanels.Assign(Value); +end; + +procedure TdxCustomStatusBar.SetPaintStyle(Value: TdxStatusBarPaintStyle); +begin + if FPaintStyle <> Value then + begin + FPaintStyle := Value; + PaintStyleChanged; + end; +end; + +procedure TdxCustomStatusBar.SetSizeGrip(Value: Boolean); +begin + if FSizeGrip <> Value then + begin + FSizeGrip := Value; + UpdatePanels; + end; +end; + +procedure TdxCustomStatusBar.CMBiDiModeChanged(var Message: TMessage); +var + I: Integer; +begin + inherited; + if HandleAllocated then + begin + for I := 0 to Panels.Count - 1 do + if Panels[I].ParentBiDiMode then + Panels[I].ParentBiDiModeChanged; + UpdatePanels; + end; +end; + +procedure TdxCustomStatusBar.CMColorChanged(var Message: TMessage); +begin + inherited; + UpdatePanels; +end; + +procedure TdxCustomStatusBar.CMEnabledChanged(var Message: TMessage); +begin + inherited; + Invalidate; +end; + +procedure TdxCustomStatusBar.CMParentFontChanged(var Message: TMessage); +begin + inherited; + UpdatePanels; +end; + +procedure TdxCustomStatusBar.CMSysColorChange(var Message: TMessage); +begin + inherited; + RefreshOffice11Colors; + UpdatePanels; +end; + +procedure TdxCustomStatusBar.CMWinIniChange(var Message: TMessage); +begin + inherited; + UpdatePanels; +end; + +procedure TdxCustomStatusBar.WMNCHitTest(var Message: TWMNCHitTest); +var + P: TPoint; + R: TRect; +begin + inherited; + if not (csDesigning in ComponentState) and SizeGripAllocated then + with TWMNCHitTest(Message) do + begin + P := ScreenToClient(Point(XPos, YPos)); + with ClientBounds do + R := Rect(Right - Painter.GripAreaSize.cx - 2, + Bottom - Painter.GripAreaSize.cy - 2, Right, Bottom); + if PtInRect(R, P) then + Result := HTBOTTOMRIGHT; + end; +end; + +{ TdxStatusBarPainter } + +class procedure TdxStatusBarPainter.AdjustTextColor(AStatusBar: TdxCustomStatusBar; + var AColor: TColor; Active: Boolean); +begin +end; + +class function TdxStatusBarPainter.BorderSizes(AStatusBar: TdxCustomStatusBar): TRect; +begin + Result := Rect(AStatusBar.BorderWidth, AStatusBar.BorderWidth + TopBorderSize, + AStatusBar.BorderWidth, AStatusBar.BorderWidth); +end; + +class function TdxStatusBarPainter.DrawSizeGripFirst: Boolean; +begin + Result := True; +end; + +class function TdxStatusBarPainter.GripAreaSize: TSize; +begin +// Result.cx := GetSystemMetrics(SM_CXHSCROLL); +// Result.cy := GetSystemMetrics(SM_CYHSCROLL); + Result.cx := GRIP_AREA_SIZE; + Result.cy := GRIP_AREA_SIZE; +end; + +class function TdxStatusBarPainter.GripSize: TSize; +begin + Result.cx := GRIP_SIZE; + Result.cy := GRIP_SIZE; +end; + +class function TdxStatusBarPainter.IsNativeBackground: Boolean; +begin + Result := False; +end; + +class function TdxStatusBarPainter.SeparatorSize: Integer; +begin + Result := PANELSEPARATORWIDTH; +end; + +class function TdxStatusBarPainter.TopBorderSize: Integer; +begin + Result := 2; +end; + +class procedure TdxStatusBarPainter.DrawBorder(AStatusBar: TdxCustomStatusBar; + ACanvas: TcxCanvas; var R: TRect); +begin + // top border + DrawTopBorder(AStatusBar, ACanvas, Rect(R.Left, R.Top, R.Right, R.Top + TopBorderSize)); + Inc(R.Top, TopBorderSize); + // border + if AStatusBar.BorderWidth > 0 then + begin + ACanvas.Brush.Color := AStatusBar.Color; + ACanvas.FillRect(Rect(R.Left, R.Top, R.Right, R.Top + AStatusBar.BorderWidth)); + Inc(R.Top, AStatusBar.BorderWidth); + ACanvas.FillRect(Rect(R.Left, R.Bottom - AStatusBar.BorderWidth, R.Right, R.Bottom)); + Dec(R.Bottom, AStatusBar.BorderWidth); + ACanvas.FillRect(Rect(R.Left, R.Top, R.Left + AStatusBar.BorderWidth, R.Bottom)); + Inc(R.Left, AStatusBar.BorderWidth); + ACanvas.FillRect(Rect(R.Right - AStatusBar.BorderWidth, R.Top, R.Right, R.Bottom)); + Dec(R.Right, AStatusBar.BorderWidth); + end; +end; + +class procedure TdxStatusBarPainter.DrawEmptyPanel(AStatusBar: TdxCustomStatusBar; + ACanvas: TcxCanvas; R: TRect); +begin + DrawPanelBorder(AStatusBar, dxpbLowered, ACanvas, R); + FillBackground(AStatusBar, nil, ACanvas, R); +end; + +class procedure TdxStatusBarPainter.DrawPanel(AStatusBar: TdxCustomStatusBar; + APanel: TdxStatusBarPanel; ACanvas: TcxCanvas; R: TRect); +var + ADone: Boolean; +begin + if APanel <> nil then + begin + if APanel.Visible then + begin + DrawPanelBorder(AStatusBar, GetPanelBevel(APanel), ACanvas, R); + ADone := False; + if Assigned(APanel.FOnDrawPanel) then + APanel.FOnDrawPanel(APanel, ACanvas, R, ADone); + if not ADone then + begin + if APanel.PanelStyle <> nil then + APanel.PanelStyle.DrawContent(ACanvas, R, Self) + else + FillBackground(AStatusBar, APanel, ACanvas, R); + end; + end + else + FillBackground(AStatusBar, nil, ACanvas, R); + end + else + begin + DrawPanelBorder(AStatusBar, dxpbLowered, ACanvas, R); + FillBackground(AStatusBar, nil, ACanvas, R); + end; +end; + +class procedure TdxStatusBarPainter.DrawPanelBorder(AStatusBar: TdxCustomStatusBar; + ABevel: TdxStatusBarPanelBevel; ACanvas: TcxCanvas; var R: TRect); +begin +end; + +class procedure TdxStatusBarPainter.DrawPanelSeparator(AStatusBar: TdxCustomStatusBar; + ACanvas: TcxCanvas; const R: TRect); +begin +end; + +class procedure TdxStatusBarPainter.DrawSizeGrip(AStatusBar: TdxCustomStatusBar; + ACanvas: TcxCanvas; R: TRect; AOverlapped: Boolean); +var + ARect, AGripRect, R1, R2: TRect; +begin + InflateRect(R, -1, -1); + ARect := Rect(R.Right - GripAreaSize.cx, R.Bottom - GripAreaSize.cy, R.Right, R.Bottom); + + AGripRect := ARect; + if AOverlapped then Inc(AGripRect.Right, 1); + ACanvas.Brush.Color := AStatusBar.Color; + ACanvas.FillRect(AGripRect); + + dxStatusBar.DrawSizeGrip(ACanvas.Handle, ARect); + ACanvas.Brush.Color := AStatusBar.Color; + R1 := Rect(R.Right - GripSize.cx, R.Bottom, R.Right + 1, R.Bottom + 1); + ACanvas.FillRect(R1); + R2 := Rect(R.Right, R.Bottom - GripSize.cy, R.Right + 1, R.Bottom); + ACanvas.FillRect(R2); + + ACanvas.ExcludeClipRect(AGripRect); + ACanvas.ExcludeClipRect(R1); + ACanvas.ExcludeClipRect(R2); +end; + +class procedure TdxStatusBarPainter.DrawTopBorder(AStatusBar: TdxCustomStatusBar; + ACanvas: TcxCanvas; const R: TRect); +begin + ACanvas.Brush.Color := AStatusBar.Color; + ACanvas.FillRect(R); +end; + +class procedure TdxStatusBarPainter.FillBackground(AStatusBar: TdxCustomStatusBar; + APanel: TdxStatusBarPanel; ACanvas: TcxCanvas; const R: TRect); +begin +end; + +class function TdxStatusBarPainter.GetPanelBevel(APanel: TdxStatusBarPanel): TdxStatusBarPanelBevel; +begin + if APanel <> nil then + begin + if (APanel.PanelStyle <> nil) and APanel.PanelStyle.InternalBevel then + Result := dxpbNone + else + Result := APanel.Bevel; + end + else + Result := dxpbLowered; +end; + +class function TdxStatusBarPainter.GetPanelColor(AStatusBar: TdxCustomStatusBar; + APanel: TdxStatusBarPanel): TColor; +begin + if (APanel <> nil) and (APanel.PanelStyle <> nil) then + Result := APanel.PanelStyle.Color + else + Result := AStatusBar.Color; +end; + +class function TdxStatusBarPainter.ValidatePanelTextRect(AStatusBar: TdxCustomStatusBar; + APanel: TdxStatusBarPanel; const R: TRect): TRect; +begin + Result := R; +end; + +{ TdxStatusBarStandardPainter } + +class procedure TdxStatusBarStandardPainter.DrawPanelBorder(AStatusBar: TdxCustomStatusBar; + ABevel: TdxStatusBarPanelBevel; ACanvas: TcxCanvas; var R: TRect); +const + ABorders: array [TdxStatusBarPanelBevel] of Integer = (0, BDR_SUNKENOUTER, BDR_RAISEDINNER); +begin + DrawEdge(ACanvas.Handle, R, ABorders[ABevel], BF_RECT or BF_ADJUST); +end; + +class procedure TdxStatusBarStandardPainter.DrawPanelSeparator(AStatusBar: TdxCustomStatusBar; + ACanvas: TcxCanvas; const R: TRect); +begin + ACanvas.Brush.Color := AStatusBar.Color; + ACanvas.FillRect(R); +end; + +class procedure TdxStatusBarStandardPainter.FillBackground(AStatusBar: TdxCustomStatusBar; + APanel: TdxStatusBarPanel; ACanvas: TcxCanvas; const R: TRect); +begin + ACanvas.Brush.Color := GetPanelColor(AStatusBar, APanel); + ACanvas.FillRect(R); +end; + +{ TdxStatusBarFlatPainter } + +class procedure TdxStatusBarFlatPainter.DrawPanelBorder(AStatusBar: TdxCustomStatusBar; + ABevel: TdxStatusBarPanelBevel; ACanvas: TcxCanvas; var R: TRect); +begin + if ABevel <> dxpbNone then + begin + ACanvas.Brush.Color := clBtnShadow; + ACanvas.FrameRect(R); + InflateRect(R, -1, -1); + end; +end; + +{ TdxStatusBarOffice11Painter } + +class function TdxStatusBarOffice11Painter.BorderSizes(AStatusBar: TdxCustomStatusBar): TRect; +begin + Result := Rect(1, 1, 1, 1); +end; + +class procedure TdxStatusBarOffice11Painter.DrawBorder(AStatusBar: TdxCustomStatusBar; + ACanvas: TcxCanvas; var R: TRect); +begin + FillTubeGradientRect(ACanvas.Handle, R, dxOffice11ToolbarsColor1, dxOffice11ToolbarsColor2, False); + InflateRect(R, -1, -1); +end; + +class procedure TdxStatusBarOffice11Painter.DrawPanelBorder(AStatusBar: TdxCustomStatusBar; + ABevel: TdxStatusBarPanelBevel; ACanvas: TcxCanvas; var R: TRect); +begin + if ABevel <> dxpbNone then + begin + ACanvas.Brush.Color := GetMiddleRGB(dxOffice11ToolbarsColor2, clBlack{clBtnShadow}, 90); + ACanvas.FrameRect(R); + InflateRect(R, -1, -1); + end; +end; + +class procedure TdxStatusBarOffice11Painter.DrawPanelSeparator(AStatusBar: TdxCustomStatusBar; + ACanvas: TcxCanvas; const R: TRect); +var + ARect: TRect; +begin +exit; + ARect := R; + InflateRect(ARect, 0, -2); + with ARect do + begin + FillRect(ACanvas.Handle, Rect(Left, Top, Left + 1, Bottom - 1), dxOffice11BarSeparatorBrush1); + FillRect(ACanvas.Handle, Rect(Left + 1, Top + 1, Left + 2, Bottom), dxOffice11BarSeparatorBrush2); + end; +end; + +class procedure TdxStatusBarOffice11Painter.DrawSizeGrip(AStatusBar: TdxCustomStatusBar; + ACanvas: TcxCanvas; R: TRect; AOverlapped: Boolean); +var + ARect, AGripRect: TRect; +begin + InflateRect(R, 0, -1); + ARect := Rect(R.Right - GripAreaSize.cx, R.Bottom - GripAreaSize.cy, R.Right, R.Bottom); + + AGripRect := ARect; + if not AOverlapped then Dec(AGripRect.Right, 1); + + Office11DrawSizeGrip(ACanvas.Handle, ARect); + + ACanvas.ExcludeClipRect(AGripRect); +end; + +{ TdxStatusBarXPPainter } + +class function TdxStatusBarXPPainter.BorderSizes(AStatusBar: TdxCustomStatusBar): TRect; +begin + Result := Rect(0, TopBorderSize, 0, 0); +end; + +class function TdxStatusBarXPPainter.GripAreaSize: TSize; +var + ATheme: TdxTheme; + DC: HDC; +begin + ATheme := OpenTheme(totStatus); + DC := GetDC(0); + GetThemePartSize(ATheme, DC, SP_GRIPPER, 0, nil, TS_TRUE, @Result); + ReleaseDC(0, DC); +end; + +class function TdxStatusBarXPPainter.SeparatorSize: Integer; +var + ATheme: TdxTheme; + DC: HDC; + ASize: TSize; +begin + ATheme := OpenTheme(totStatus); + DC := GetDC(0); + GetThemePartSize(ATheme, DC, SP_PANE, 0, nil, TS_TRUE, @ASize); + Result := ASize.cx; + ReleaseDC(0, DC); +end; + +class procedure TdxStatusBarXPPainter.DrawBorder(AStatusBar: TdxCustomStatusBar; + ACanvas: TcxCanvas; var R: TRect); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totStatus); + DrawThemeBackground(ATheme, ACanvas.Handle, 0, 0, @R); + Inc(R.Top, TopBorderSize); +end; + +class procedure TdxStatusBarXPPainter.DrawPanelSeparator(AStatusBar: TdxCustomStatusBar; + ACanvas: TcxCanvas; const R: TRect); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totStatus); + DrawThemeBackground(ATheme, ACanvas.Handle, SP_PANE, 0, @R); +end; + +class procedure TdxStatusBarXPPainter.DrawSizeGrip(AStatusBar: TdxCustomStatusBar; + ACanvas: TcxCanvas; R: TRect; AOverlapped: Boolean); +var + ATheme: TdxTheme; + ARect, AGripRect: TRect; +begin + ATheme := OpenTheme(totStatus); + InflateRect(R, -1, 0); + ARect := Rect(R.Right - GripAreaSize.cx, R.Bottom - GripAreaSize.cy, R.Right, R.Bottom); + + AGripRect := ARect; + if AOverlapped then Inc(AGripRect.Right, 1); + + DrawThemeBackground(ATheme, ACanvas.Handle, SP_GRIPPER, 0, @ARect); + + ACanvas.ExcludeClipRect(AGripRect); +end; + +initialization + GetRegisteredStatusBarPanelStyles.Register(TdxStatusBarTextPanelStyle, cxSTextPanelStyle); + GetRegisteredStatusBarPanelStyles.Register(TdxStatusBarContainerPanelStyle, cxSContainerPanelStyle); + GetRegisteredStatusBarPanelStyles.Register(TdxStatusBarKeyboardStatePanelStyle, cxSKeyboardStatePanelStyle); + GetRegisteredStatusBarPanelStyles.Register(TdxStatusBarStateIndicatorPanelStyle, cxSStateIndicatorPanelStyle); + RegisterClasses([TdxStatusBarContainerControl]); + +finalization + GetRegisteredStatusBarPanelStyles.Unregister(TdxStatusBarTextPanelStyle); + GetRegisteredStatusBarPanelStyles.Unregister(TdxStatusBarContainerPanelStyle); + GetRegisteredStatusBarPanelStyles.Unregister(TdxStatusBarKeyboardStatePanelStyle); + GetRegisteredStatusBarPanelStyles.Unregister(TdxStatusBarStateIndicatorPanelStyle); + FreeAndNil(FRegisteredStatusBarPanelStyles); + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxStatusBar.res b/official/x.35/ExpressBars 6/Sources/dxStatusBar.res new file mode 100644 index 00000000..d8d72d05 Binary files /dev/null and b/official/x.35/ExpressBars 6/Sources/dxStatusBar.res differ diff --git a/official/x.35/ExpressBars 6/Sources/dxStatusBarReg.pas b/official/x.35/ExpressBars 6/Sources/dxStatusBarReg.pas new file mode 100644 index 00000000..8fb4a179 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxStatusBarReg.pas @@ -0,0 +1,353 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressStatusBar } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSTATUSBAR AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxStatusBarReg; + +{$I cxVer.inc} + +interface + +procedure Register; + +implementation + +uses + ColnEdit, +{$IFDEF DELPHI6} + DesignIntf, DesignEditors, VCLEditors, Types, +{$ELSE} + DsgnIntf, +{$ENDIF} + Windows, SysUtils, Classes, Controls, Graphics, Forms, ImgList, + cxClasses, cxPropEditors, dxBarReg, + dxStatusBar, dxStatusIndicatorEditor; + +type + { TdxStatusBarEditor } + + TdxStatusBarEditor = class(TdxBarComponentEditor) + protected + function InternalGetVerb(AIndex: Integer): string; override; + function InternalGetVerbCount: Integer; override; + procedure InternalExecuteVerb(AIndex: Integer); override; + end; + +procedure TdxStatusBarEditor.InternalExecuteVerb(AIndex: Integer); +begin + ShowCollectionEditor(Designer, Component, (Component as TdxStatusBar).Panels, 'Panels'); +end; + +function TdxStatusBarEditor.InternalGetVerb(AIndex: Integer): string; +begin + Result := 'Panels Editor...'; +end; + +function TdxStatusBarEditor.InternalGetVerbCount: Integer; +begin + Result := 1; +end; + +{$IFDEF DELPHI6} +type + TdxStatusBarSelectionEditor = class(TSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + +procedure TdxStatusBarSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + Proc('cxGraphics'); +end; +{$ENDIF} + +type + { TdxStatusBarPanelStyleProperty } + + TdxStatusBarPanelStyleProperty = class(TClassProperty) + protected + function CanAcceptPanelStyle(AClass: TClass): Boolean; + function HasSubProperties: Boolean; + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + { TdxStatusBarPanelStyleEventsProperty } + + TdxStatusBarPanelStyleEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + + { TdxStatusBarStateIndicatorsProperty } + + TdxStatusBarStateIndicatorsProperty = class(TClassProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + +{$IFDEF DELPHI5} + { TdxStatusBarTextPanelImageIndexProperty } + + TdxStatusBarTextPanelImageIndexProperty = class(TIntegerProperty{$IFDEF DELPHI6}, ICustomPropertyListDrawing{$ENDIF}) + public + function GetImages: TImageList; virtual; + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + procedure ListMeasureHeight(const Value: string; ACanvas: TCanvas; + var AHeight: Integer); {$IFDEF DELPHI6}virtual{$ELSE}override{$ENDIF}; + procedure ListMeasureWidth(const Value: string; ACanvas: TCanvas; + var AWidth: Integer); {$IFDEF DELPHI6}virtual{$ELSE}override{$ENDIF}; + procedure ListDrawValue(const Value: string; ACanvas: TCanvas; + const ARect: TRect; ASelected: Boolean); {$IFDEF DELPHI6}virtual{$ELSE}override{$ENDIF}; + end; +{$ENDIF} + +{ TdxStatusBarPanelStyleProperty } + +function TdxStatusBarPanelStyleProperty.HasSubProperties: Boolean; +var + I: Integer; +begin + for I := 0 to PropCount - 1 do + begin + Result := TdxStatusBarPanel(GetComponent(I)).PanelStyle <> nil; + if not Result then Exit; + end; + Result := True; +end; + +function TdxStatusBarPanelStyleProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes; + if not HasSubProperties then + Exclude(Result, paSubProperties); + Result := Result - [paReadOnly] + + [paValueList, paSortList, paRevertable{$IFDEF DELPHI6}, paVolatileSubProperties{$ENDIF}]; +end; + +function TdxStatusBarPanelStyleProperty.GetValue: string; +begin + if HasSubProperties then + Result := GetRegisteredStatusBarPanelStyles.GetDescriptionByClass(TdxStatusBarPanelStyle(GetOrdValue).ClassType) + else + Result := ''; +end; + +procedure TdxStatusBarPanelStyleProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to GetRegisteredStatusBarPanelStyles.Count - 1 do + if CanAcceptPanelStyle(GetRegisteredStatusBarPanelStyles[I]) then + Proc(GetRegisteredStatusBarPanelStyles.Descriptions[I]); +end; + +procedure TdxStatusBarPanelStyleProperty.SetValue(const Value: string); +var + FPanelStyleStyleClass: TdxStatusBarPanelStyleClass; + I: Integer; +begin + FPanelStyleStyleClass := TdxStatusBarPanelStyleClass( + GetRegisteredStatusBarPanelStyles.FindByClassName(Value)); + if FPanelStyleStyleClass = nil then + FPanelStyleStyleClass := TdxStatusBarPanelStyleClass( + GetRegisteredStatusBarPanelStyles.FindByDescription(Value)); + + if CanAcceptPanelStyle(FPanelStyleStyleClass) then + begin + for I := 0 to PropCount - 1 do + TdxStatusBarPanel(GetComponent(I)).PanelStyleClass := FPanelStyleStyleClass; + Modified; + end; +end; + +function TdxStatusBarPanelStyleProperty.CanAcceptPanelStyle(AClass: TClass): Boolean; +begin + Result := TdxStatusBarPanel(GetComponent(0)).StatusBarControl.CanAcceptPanelStyle(TdxStatusBarPanelStyleClass(AClass)); +end; + +{ TdxStatusBarPanelStyleEventsProperty } + +function TdxStatusBarPanelStyleEventsProperty.GetInstance: TPersistent; +begin + Result := TdxStatusBarPanel(GetComponent(0)).PanelStyle; +end; + +{ TdxStatusBarStateIndicatorsProperty } + +function TdxStatusBarStateIndicatorsProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paDialog, paReadOnly]; +end; + +procedure TdxStatusBarStateIndicatorsProperty.Edit; +var + EditorForm: TdxStatusBarIndicatorEditor; +begin + EditorForm := TdxStatusBarIndicatorEditor.Create(Application); + try + EditorForm.Caption := + TdxStatusBarStateIndicatorPanelStyle(GetComponent(0)).StatusBarControl.Name + '.IndicatorPanelStyle'; + EditorForm.Indicators.Assign(TdxStatusBarStateIndicatorPanelStyle(GetComponent(0)).Indicators); + if EditorForm.ShowModal = mrOK then + begin + EditorForm.PrepareIndicators; + with TdxStatusBarStateIndicatorPanelStyle(GetComponent(0)) do + begin + Indicators.BeginUpdate; + try + Indicators.Clear; + Indicators.Assign(EditorForm.Indicators); + finally + Indicators.EndUpdate; + end; + end; + Modified; + end; + finally + FreeAndNil(EditorForm); + end; +end; + +{$IFDEF DELPHI5} + +{ TdxStatusBarTextPanelImageIndexProperty } + +function TdxStatusBarTextPanelImageIndexProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList, paRevertable]; +end; + +function TdxStatusBarTextPanelImageIndexProperty.GetValue: string; +begin + Result := IntToStr(GetOrdValue); +end; + +procedure TdxStatusBarTextPanelImageIndexProperty.GetValues(Proc: TGetStrProc); +var i: Integer; +begin + if GetImages <> nil then + for i := 0 to GetImages.Count-1 do Proc(IntToStr(i)); +end; + +procedure TdxStatusBarTextPanelImageIndexProperty.ListDrawValue(const Value: string; + ACanvas: TCanvas; const ARect: TRect; ASelected: Boolean); +var + AImageWidth: Integer; +begin + with ACanvas do + begin + Brush.Style := bsSolid; + if ASelected then Brush.Color := clHighlight else Brush.Color := clWindow; + FillRect(ARect); + if ASelected then DrawFocusRect(ARect); + if GetImages <> nil then + AImageWidth := GetImages.Width + else + AImageWidth := 0; + if GetImages <> nil then + GetImages.Draw(ACanvas, ARect.Left, ARect.Top, StrToInt(value)); + TextOut(ARect.Left + AImageWidth + 2, ARect.Top, Value); + end; +end; + +procedure TdxStatusBarTextPanelImageIndexProperty.ListMeasureHeight(const Value: string; + ACanvas: TCanvas; var AHeight: Integer); +var + AImageHeight, AStringHeight: Integer; +begin + AStringHeight := ACanvas.Textheight(Value); + if GetImages <> nil then + AImageHeight := GetImages.Height + else + AImageheight := 0; + if AStringHeight > AImageHeight then + AHeight := AStringHeight + 2 + else + AHeight := AImageHeight + 2; +end; + +procedure TdxStatusBarTextPanelImageIndexProperty.ListMeasureWidth(const Value: string; + ACanvas: TCanvas; var AWidth: Integer); +var + AImageWidth, AStringWidth: Integer; +begin + AStringWidth := ACanvas.TextWidth(Value); + if GetImages <> nil then + AImageWidth := GetImages.Width + else + AImageWidth := 0; + AWidth := AStringWidth + AImageWidth + 4; +end; + +procedure TdxStatusBarTextPanelImageIndexProperty.SetValue(const Value: string); +begin + SetOrdValue(StrToInt(Value)); +end; + +function TdxStatusBarTextPanelImageIndexProperty.GetImages: TImageList; +begin + Result := nil; + if GetComponent(0) is TdxStatusBarTextPanelStyle then + Result := TImageList(TdxStatusBarTextPanelStyle(GetComponent(0)).StatusBarControl.Images); +end; + +{$ENDIF} + +procedure Register; +begin + RegisterComponents('ExpressBars', [TdxStatusBar]); + RegisterComponentEditor(TdxStatusBar, TdxStatusBarEditor); + RegisterPropertyEditor(TypeInfo(TdxStatusBarPanelStyle), TdxStatusBarPanel, 'PanelStyle', TdxStatusBarPanelStyleProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TdxStatusBarPanel, 'PanelStyleEvents', TdxStatusBarPanelStyleEventsProperty); + RegisterPropertyEditor(TypeInfo(string), TdxStatusBarPanel, 'PanelStyleClassName', nil); + RegisterPropertyEditor(TypeInfo(TdxStatusBarContainerControl), TdxStatusBarContainerPanelStyle, 'Container', nil); + RegisterPropertyEditor(TypeInfo(TdxStatusBarStateIndicators), TdxStatusBarPanelStyle, '', + TdxStatusBarStateIndicatorsProperty); +{$IFDEF DELPHI5} + RegisterPropertyEditor(TypeInfo(TImageIndex), TdxStatusBarTextPanelStyle, 'ImageIndex', TdxStatusBarTextPanelImageIndexProperty); +{$ENDIF} +{$IFDEF DELPHI6} + RegisterSelectionEditor(TdxStatusBar, TdxStatusBarSelectionEditor); +{$ENDIF} +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/dxStatusIndicatorEditor.dfm b/official/x.35/ExpressBars 6/Sources/dxStatusIndicatorEditor.dfm new file mode 100644 index 00000000..18ce678a --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxStatusIndicatorEditor.dfm @@ -0,0 +1,113 @@ +object dxStatusBarIndicatorEditor: TdxStatusBarIndicatorEditor + Left = 624 + Top = 110 + BorderStyle = bsDialog + ClientHeight = 234 + ClientWidth = 279 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Bevel1: TBevel + Left = 8 + Top = 192 + Width = 337 + Height = 2 + end + object BtnOK: TButton + Left = 117 + Top = 202 + Width = 75 + Height = 25 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object BtnCancel: TButton + Left = 197 + Top = 202 + Width = 75 + Height = 25 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + object chlbIndicators: TCheckListBox + Left = 8 + Top = 8 + Width = 153 + Height = 149 + ItemHeight = 13 + TabOrder = 2 + OnClick = chlbIndicatorsClick + OnKeyDown = chlbIndicatorsKeyDown + end + object BtnAdd: TButton + Left = 175 + Top = 8 + Width = 92 + Height = 25 + Caption = '&Add' + TabOrder = 3 + OnClick = BtnAddClick + end + object BtnDelete: TButton + Left = 175 + Top = 40 + Width = 92 + Height = 25 + Caption = '&Delete' + TabOrder = 4 + OnClick = BtnDeleteClick + end + object BtnClear: TButton + Left = 175 + Top = 72 + Width = 92 + Height = 25 + Caption = '&Clear' + TabOrder = 5 + OnClick = BtnClearClick + end + object cbItemTypes: TComboBox + Left = 9 + Top = 164 + Width = 153 + Height = 21 + ItemHeight = 13 + Items.Strings = ( + 'sitOff' + 'sitYellow' + 'sitBlue' + 'sitGreen' + 'sitRed' + 'sitTeal' + 'sitPurple') + TabOrder = 6 + OnChange = cbItemTypesChange + end + object GroupBox1: TGroupBox + Left = 172 + Top = 130 + Width = 97 + Height = 56 + Caption = 'Example' + TabOrder = 7 + object imgExample: TImage + Left = 31 + Top = 26 + Width = 34 + Height = 15 + Center = True + end + end +end diff --git a/official/x.35/ExpressBars 6/Sources/dxStatusIndicatorEditor.pas b/official/x.35/ExpressBars 6/Sources/dxStatusIndicatorEditor.pas new file mode 100644 index 00000000..d03c1f4c --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/dxStatusIndicatorEditor.pas @@ -0,0 +1,239 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressStatusBar } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSTATUSBAR AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxStatusIndicatorEditor; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Classes, Controls, Forms, StdCtrls, ExtCtrls, CheckLst, + dxStatusBar; + +type + TdxStatusBarIndicatorEditor = class(TForm) + BtnOK: TButton; + BtnCancel: TButton; + chlbIndicators: TCheckListBox; + Bevel1: TBevel; + BtnAdd: TButton; + BtnDelete: TButton; + BtnClear: TButton; + cbItemTypes: TComboBox; + GroupBox1: TGroupBox; + imgExample: TImage; + procedure FormShow(Sender: TObject); + procedure BtnAddClick(Sender: TObject); + procedure BtnDeleteClick(Sender: TObject); + procedure BtnClearClick(Sender: TObject); + procedure chlbIndicatorsClick(Sender: TObject); + procedure chlbIndicatorsKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure cbItemTypesChange(Sender: TObject); + private + procedure IndicatorChangeHandler(Sender: TObject); + function IndicatorTypeToStr(const AIndicatorType: TdxStatusBarStateIndicatorType): string; + function StrToIndicatorType(const AStr: string): TdxStatusBarStateIndicatorType; + procedure SetControlsState; + procedure SetItemType; + public + Indicators: TdxStatusBarStateIndicators; + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure PrepareIndicators; + end; + +implementation + +uses + cxClasses; + +{$R *.dfm} + +constructor TdxStatusBarIndicatorEditor.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Indicators := TdxStatusBarStateIndicators.Create; + Indicators.OnChange := IndicatorChangeHandler; +end; + +destructor TdxStatusBarIndicatorEditor.Destroy; +begin + if Assigned(Indicators) then FreeAndNil(Indicators); + inherited; +end; + +procedure TdxStatusBarIndicatorEditor.IndicatorChangeHandler(Sender: TObject); +begin + {} +end; + +function TdxStatusBarIndicatorEditor.IndicatorTypeToStr( + const AIndicatorType: TdxStatusBarStateIndicatorType): string; +begin + case AIndicatorType of + sitYellow: Result := 'sitYellow'; + sitBlue: Result := 'sitBlue'; + sitGreen: Result := 'sitGreen'; + sitRed: Result := 'sitRed'; + sitTeal: Result := 'sitTeal'; + sitPurple: Result := 'sitPurple'; + else + Result := 'sitOff'; + end; +end; + +function TdxStatusBarIndicatorEditor.StrToIndicatorType( + const AStr: string): TdxStatusBarStateIndicatorType; +begin + if AStr = 'sitYellow' then + Result := sitYellow + else + if AStr = 'sitBlue' then + Result := sitBlue + else + if AStr = 'sitGreen' then + Result := sitGreen + else + if AStr = 'sitRed' then + Result := sitRed + else + if AStr = 'sitTeal' then + Result := sitTeal + else + if AStr = 'sitPurple' then + Result := sitPurple + else + Result := sitOff; +end; + +procedure TdxStatusBarIndicatorEditor.FormShow(Sender: TObject); +var + I: Integer; +begin + chlbIndicators.Clear; + for I := 0 to Indicators.Count - 1 do + begin + chlbIndicators.Items.Add(IndicatorTypeToStr(Indicators[I].IndicatorType)); + chlbIndicators.Checked[chlbIndicators.Items.Count-1] := Indicators[I].Visible; + end; + SetControlsState; +end; + +procedure TdxStatusBarIndicatorEditor.BtnAddClick(Sender: TObject); +begin + chlbIndicators.Items.Add('sitOff'); + chlbIndicators.Checked[chlbIndicators.Items.Count-1] := True; + SetControlsState; +end; + +procedure TdxStatusBarIndicatorEditor.SetControlsState; +begin + BtnDelete.Enabled := (chlbIndicators.Items.Count > 0); + BtnClear.Enabled := (chlbIndicators.Items.Count > 0); + cbItemTypes.Enabled := (chlbIndicators.Items.Count > 0) and + (chlbIndicators.ItemIndex <> -1); + imgExample.Visible := (chlbIndicators.Items.Count > 0) and + (chlbIndicators.ItemIndex <> -1); + SetItemType; +end; + +procedure TdxStatusBarIndicatorEditor.PrepareIndicators; +var + I: Integer; + FItem: TdxStatusBarStateIndicatorItem; +begin + Indicators.Clear; + for I := 0 to chlbIndicators.Items.Count - 1 do + begin + FItem := Indicators.Add; + FItem.Visible := chlbIndicators.Checked[I]; + FItem.IndicatorType := StrToIndicatorType(chlbIndicators.Items[I]); + end; +end; + +procedure TdxStatusBarIndicatorEditor.BtnDeleteClick(Sender: TObject); +begin + if (chlbIndicators.Items.Count > 0) and (chlbIndicators.ItemIndex <> -1) then + begin + chlbIndicators.Items.Delete(chlbIndicators.ItemIndex); + SetControlsState; + end; +end; + +procedure TdxStatusBarIndicatorEditor.BtnClearClick(Sender: TObject); +begin + chlbIndicators.Items.Clear; + SetControlsState; +end; + +procedure TdxStatusBarIndicatorEditor.SetItemType; +begin + if (chlbIndicators.Items.Count > 0) and (chlbIndicators.ItemIndex <> -1) then + begin + cbItemTypes.ItemIndex := cbItemTypes.Items.IndexOf(chlbIndicators.Items[chlbIndicators.ItemIndex]); + LoadIndicatorBitmap(imgExample.Picture.Bitmap, StrToIndicatorType(cbItemTypes.Text)); + end + else + cbItemTypes.Text := ''; +end; + +procedure TdxStatusBarIndicatorEditor.chlbIndicatorsClick(Sender: TObject); +begin + SetControlsState; +end; + +procedure TdxStatusBarIndicatorEditor.chlbIndicatorsKeyDown( + Sender: TObject; var Key: Word; Shift: TShiftState); +begin + SetControlsState; +end; + +procedure TdxStatusBarIndicatorEditor.cbItemTypesChange(Sender: TObject); +begin + if (chlbIndicators.Items.Count > 0) and (chlbIndicators.ItemIndex <> -1) then + chlbIndicators.Items[chlbIndicators.ItemIndex] := + cbItemTypes.Items[cbItemTypes.ItemIndex] + else + cbItemTypes.ItemIndex := -1; + SetItemType; +end; + +end. diff --git a/official/x.35/ExpressBars 6/Sources/form_black.png b/official/x.35/ExpressBars 6/Sources/form_black.png new file mode 100644 index 00000000..f5cd8046 Binary files /dev/null and b/official/x.35/ExpressBars 6/Sources/form_black.png differ diff --git a/official/x.35/ExpressBars 6/Sources/form_blue.png b/official/x.35/ExpressBars 6/Sources/form_blue.png new file mode 100644 index 00000000..ef425965 Binary files /dev/null and b/official/x.35/ExpressBars 6/Sources/form_blue.png differ diff --git a/official/x.35/ExpressBars 6/Sources/form_silver.png b/official/x.35/ExpressBars 6/Sources/form_silver.png new file mode 100644 index 00000000..e29082d4 Binary files /dev/null and b/official/x.35/ExpressBars 6/Sources/form_silver.png differ diff --git a/official/x.35/ExpressBars 6/Sources/ribbon_black.png b/official/x.35/ExpressBars 6/Sources/ribbon_black.png new file mode 100644 index 00000000..54dd0225 Binary files /dev/null and b/official/x.35/ExpressBars 6/Sources/ribbon_black.png differ diff --git a/official/x.35/ExpressBars 6/Sources/ribbon_blue.png b/official/x.35/ExpressBars 6/Sources/ribbon_blue.png new file mode 100644 index 00000000..51977fb9 Binary files /dev/null and b/official/x.35/ExpressBars 6/Sources/ribbon_blue.png differ diff --git a/official/x.35/ExpressBars 6/Sources/ribbon_common.png b/official/x.35/ExpressBars 6/Sources/ribbon_common.png new file mode 100644 index 00000000..3f6396cd Binary files /dev/null and b/official/x.35/ExpressBars 6/Sources/ribbon_common.png differ diff --git a/official/x.35/ExpressBars 6/Sources/ribbon_silver.png b/official/x.35/ExpressBars 6/Sources/ribbon_silver.png new file mode 100644 index 00000000..6f6e556a Binary files /dev/null and b/official/x.35/ExpressBars 6/Sources/ribbon_silver.png differ diff --git a/official/x.35/ExpressBars 6/Sources/skins.rc b/official/x.35/ExpressBars 6/Sources/skins.rc new file mode 100644 index 00000000..d42f15f3 --- /dev/null +++ b/official/x.35/ExpressBars 6/Sources/skins.rc @@ -0,0 +1,8 @@ +LANGUAGE 0, 0 +FORMBLACK RCDATA "form_black.png" +FORMBLUE RCDATA "form_blue.png" +FORMSILVER RCDATA "form_silver.png" +RIBBONCOMMON RCDATA "ribbon_common.png" +RIBBONBLACK RCDATA "ribbon_black.png" +RIBBONBLUE RCDATA "ribbon_blue.png" +RIBBONSILVER RCDATA "ribbon_silver.png" \ No newline at end of file diff --git a/official/x.35/ExpressBars 6/Sources/skins.res b/official/x.35/ExpressBars 6/Sources/skins.res new file mode 100644 index 00000000..c60baf63 Binary files /dev/null and b/official/x.35/ExpressBars 6/Sources/skins.res differ diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnC10.bpk b/official/x.35/ExpressCommon Library/Packages/dxComnC10.bpk new file mode 100644 index 00000000..cbeb0203 --- /dev/null +++ b/official/x.35/ExpressCommon Library/Packages/dxComnC10.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxComnC10.bpl +OBJFILES = dxrgkeya.obj dxreged.obj dxCommon.obj dxComnC10.obj +MAINSOURCE = dxComnC10.cpp +RESFILES = dxComnC10.res +RESDEPEN = $(RESFILES) dxrgkeya.dfm dxreged.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressCommonLibrary by Developer Express Inc." -aa -Tpp -x -Gn -Gpr -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnC10.cpp b/official/x.35/ExpressCommon Library/Packages/dxComnC10.cpp new file mode 100644 index 00000000..ea747e77 --- /dev/null +++ b/official/x.35/ExpressCommon Library/Packages/dxComnC10.cpp @@ -0,0 +1,18 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxComnC10.res"); +USEPACKAGE("vcl.bpi"); +USEFORMNS("dxrgkeya.pas", Dxrgkeya, frmdxAddNewRegKey); +USEFORMNS("dxreged.pas", Dxreged, frmdxLibREgPathEditor); +USEUNIT("dxCommon.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnC10.res b/official/x.35/ExpressCommon Library/Packages/dxComnC10.res new file mode 100644 index 00000000..3930f782 Binary files /dev/null and b/official/x.35/ExpressCommon Library/Packages/dxComnC10.res differ diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnC11.bpk b/official/x.35/ExpressCommon Library/Packages/dxComnC11.bpk new file mode 100644 index 00000000..b88d4926 --- /dev/null +++ b/official/x.35/ExpressCommon Library/Packages/dxComnC11.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxComnC11.bpl +OBJFILES = dxrgkeya.obj dxreged.obj dxCommon.obj dxComnC11.obj +MAINSOURCE = dxComnC11.cpp +RESFILES = dxComnC11.res +RESDEPEN = $(RESFILES) dxrgkeya.dfm dxreged.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressCommonLibrary by Developer Express Inc." -aa -Tpp -x -Gn -Gpr -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnC11.cpp b/official/x.35/ExpressCommon Library/Packages/dxComnC11.cpp new file mode 100644 index 00000000..66a959e7 --- /dev/null +++ b/official/x.35/ExpressCommon Library/Packages/dxComnC11.cpp @@ -0,0 +1,18 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxComnC11.res"); +USEPACKAGE("vcl.bpi"); +USEFORMNS("dxrgkeya.pas", Dxrgkeya, frmdxAddNewRegKey); +USEFORMNS("dxreged.pas", Dxreged, frmdxLibREgPathEditor); +USEUNIT("dxCommon.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnC11.res b/official/x.35/ExpressCommon Library/Packages/dxComnC11.res new file mode 100644 index 00000000..189b25c3 Binary files /dev/null and b/official/x.35/ExpressCommon Library/Packages/dxComnC11.res differ diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnC5.bpk b/official/x.35/ExpressCommon Library/Packages/dxComnC5.bpk new file mode 100644 index 00000000..8d2016ba --- /dev/null +++ b/official/x.35/ExpressCommon Library/Packages/dxComnC5.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxComnC5.bpl +OBJFILES = dxrgkeya.obj dxreged.obj dxCommon.obj dxComnC5.obj +RESFILES = dxComnC5.res +RESDEPEN = $(RESFILES) dxrgkeya.dfm dxreged.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = Vcl50.lib +PACKAGES = vcl50.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressCommonLibrary by Developer Express Inc." -aa -Tpp -x -Gn -Gpr -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnC5.cpp b/official/x.35/ExpressCommon Library/Packages/dxComnC5.cpp new file mode 100644 index 00000000..129fe729 --- /dev/null +++ b/official/x.35/ExpressCommon Library/Packages/dxComnC5.cpp @@ -0,0 +1,18 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxComnC5.res"); +USEPACKAGE("vcl50.bpi"); +USEFORMNS("dxrgkeya.pas", Dxrgkeya, frmdxAddNewRegKey); +USEFORMNS("dxreged.pas", Dxreged, frmdxLibREgPathEditor); +USEUNIT("dxCommon.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnC5.res b/official/x.35/ExpressCommon Library/Packages/dxComnC5.res new file mode 100644 index 00000000..57e3149d Binary files /dev/null and b/official/x.35/ExpressCommon Library/Packages/dxComnC5.res differ diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnC6.bpk b/official/x.35/ExpressCommon Library/Packages/dxComnC6.bpk new file mode 100644 index 00000000..30964c91 --- /dev/null +++ b/official/x.35/ExpressCommon Library/Packages/dxComnC6.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxComnC6.bpl +OBJFILES = dxrgkeya.obj dxreged.obj dxCommon.obj dxComnC6.obj +RESFILES = dxComnC6.res +RESDEPEN = $(RESFILES) dxrgkeya.dfm dxreged.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressCommonLibrary by Developer Express Inc." -aa -Tpp -x -Gn -Gpr -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnC6.cpp b/official/x.35/ExpressCommon Library/Packages/dxComnC6.cpp new file mode 100644 index 00000000..9f95fc44 --- /dev/null +++ b/official/x.35/ExpressCommon Library/Packages/dxComnC6.cpp @@ -0,0 +1,18 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxComnC6.res"); +USEPACKAGE("vcl.bpi"); +USEFORMNS("dxrgkeya.pas", Dxrgkeya, frmdxAddNewRegKey); +USEFORMNS("dxreged.pas", Dxreged, frmdxLibREgPathEditor); +USEUNIT("dxCommon.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnC6.res b/official/x.35/ExpressCommon Library/Packages/dxComnC6.res new file mode 100644 index 00000000..803a3d3f Binary files /dev/null and b/official/x.35/ExpressCommon Library/Packages/dxComnC6.res differ diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnD10.dpk b/official/x.35/ExpressCommon Library/Packages/dxComnD10.dpk new file mode 100644 index 00000000..e653ebdc --- /dev/null +++ b/official/x.35/ExpressCommon Library/Packages/dxComnD10.dpk @@ -0,0 +1,38 @@ +package dxComnD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressCommonLibrary by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl; + +contains + dxRgKeya, + dxRegEd, + dxCommon; + +end. diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnD10.res b/official/x.35/ExpressCommon Library/Packages/dxComnD10.res new file mode 100644 index 00000000..e2d7c599 Binary files /dev/null and b/official/x.35/ExpressCommon Library/Packages/dxComnD10.res differ diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnD10NET.dpk b/official/x.35/ExpressCommon Library/Packages/dxComnD10NET.dpk new file mode 100644 index 00000000..d6762d1f --- /dev/null +++ b/official/x.35/ExpressCommon Library/Packages/dxComnD10NET.dpk @@ -0,0 +1,92 @@ +package dxComnD10NET; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressCommonLibrary by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Vcl; + +contains + dxDateUtils; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnD10NET.res b/official/x.35/ExpressCommon Library/Packages/dxComnD10NET.res new file mode 100644 index 00000000..bbcd10c2 Binary files /dev/null and b/official/x.35/ExpressCommon Library/Packages/dxComnD10NET.res differ diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnD11.dpk b/official/x.35/ExpressCommon Library/Packages/dxComnD11.dpk new file mode 100644 index 00000000..601bb8c9 --- /dev/null +++ b/official/x.35/ExpressCommon Library/Packages/dxComnD11.dpk @@ -0,0 +1,38 @@ +package dxComnD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressCommonLibrary by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl; + +contains + dxRgKeya, + dxRegEd, + dxCommon; + +end. diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnD11.res b/official/x.35/ExpressCommon Library/Packages/dxComnD11.res new file mode 100644 index 00000000..8a20cad0 Binary files /dev/null and b/official/x.35/ExpressCommon Library/Packages/dxComnD11.res differ diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnD5.dpk b/official/x.35/ExpressCommon Library/Packages/dxComnD5.dpk new file mode 100644 index 00000000..f1a6bc1f --- /dev/null +++ b/official/x.35/ExpressCommon Library/Packages/dxComnD5.dpk @@ -0,0 +1,37 @@ +package dxcomnD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressCommonLibrary by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50; + +contains + dxCommon, + dxreged, + dxrgkeya; + +end. diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnD5.res b/official/x.35/ExpressCommon Library/Packages/dxComnD5.res new file mode 100644 index 00000000..d15c098e Binary files /dev/null and b/official/x.35/ExpressCommon Library/Packages/dxComnD5.res differ diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnD6.dpk b/official/x.35/ExpressCommon Library/Packages/dxComnD6.dpk new file mode 100644 index 00000000..fde19f08 --- /dev/null +++ b/official/x.35/ExpressCommon Library/Packages/dxComnD6.dpk @@ -0,0 +1,38 @@ +package dxcomnd6; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressCommonLibrary by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl; + +contains + dxCommon, + dxreged, + dxrgkeya; + +end. diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnD6.res b/official/x.35/ExpressCommon Library/Packages/dxComnD6.res new file mode 100644 index 00000000..61881694 Binary files /dev/null and b/official/x.35/ExpressCommon Library/Packages/dxComnD6.res differ diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnD7.dpk b/official/x.35/ExpressCommon Library/Packages/dxComnD7.dpk new file mode 100644 index 00000000..9a2e36a6 --- /dev/null +++ b/official/x.35/ExpressCommon Library/Packages/dxComnD7.dpk @@ -0,0 +1,38 @@ +package dxComnD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressCommonLibrary by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl; + +contains + dxRgKeya, + dxRegEd, + dxCommon; + +end. diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnD7.res b/official/x.35/ExpressCommon Library/Packages/dxComnD7.res new file mode 100644 index 00000000..e7fd978e Binary files /dev/null and b/official/x.35/ExpressCommon Library/Packages/dxComnD7.res differ diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnD8.dpk b/official/x.35/ExpressCommon Library/Packages/dxComnD8.dpk new file mode 100644 index 00000000..f54b42c8 --- /dev/null +++ b/official/x.35/ExpressCommon Library/Packages/dxComnD8.dpk @@ -0,0 +1,92 @@ +package dxComnD8; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressCommonLibrary by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Vcl; + +contains + dxDateUtils; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnD8.res b/official/x.35/ExpressCommon Library/Packages/dxComnD8.res new file mode 100644 index 00000000..f0f62202 Binary files /dev/null and b/official/x.35/ExpressCommon Library/Packages/dxComnD8.res differ diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnD9.dpk b/official/x.35/ExpressCommon Library/Packages/dxComnD9.dpk new file mode 100644 index 00000000..3ec99fe0 --- /dev/null +++ b/official/x.35/ExpressCommon Library/Packages/dxComnD9.dpk @@ -0,0 +1,38 @@ +package dxComnD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressCommonLibrary by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl; + +contains + dxRgKeya, + dxRegEd, + dxCommon; + +end. diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnD9.res b/official/x.35/ExpressCommon Library/Packages/dxComnD9.res new file mode 100644 index 00000000..51ff169a Binary files /dev/null and b/official/x.35/ExpressCommon Library/Packages/dxComnD9.res differ diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnD9NET.dpk b/official/x.35/ExpressCommon Library/Packages/dxComnD9NET.dpk new file mode 100644 index 00000000..4f72baeb --- /dev/null +++ b/official/x.35/ExpressCommon Library/Packages/dxComnD9NET.dpk @@ -0,0 +1,92 @@ +package dxComnD9NET; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressCommonLibrary by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Vcl; + +contains + dxDateUtils; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/ExpressCommon Library/Packages/dxComnD9NET.res b/official/x.35/ExpressCommon Library/Packages/dxComnD9NET.res new file mode 100644 index 00000000..92aaa1f8 Binary files /dev/null and b/official/x.35/ExpressCommon Library/Packages/dxComnD9NET.res differ diff --git a/official/x.35/ExpressCommon Library/Sources/cxVer.inc b/official/x.35/ExpressCommon Library/Sources/cxVer.inc new file mode 100644 index 00000000..a26364cc --- /dev/null +++ b/official/x.35/ExpressCommon Library/Sources/cxVer.inc @@ -0,0 +1,172 @@ +{$B-} { Complete Boolean Evaluation } +{$R-} { Range-Checking } +{$T-} { Typed @ operator } +{$X+} { Extended syntax } +{$P+} { Open string params } +{$J+} { Writeable structured consts } +{$H+} { Use long strings by default } +{$Q-} { Overflow checking } + +{$DEFINE DXVER500} + +{$IFNDEF CLR} + {$DEFINE OLEDRAGANDDROP} + {$IFNDEF DONTUSEJPEGIMAGE} + {$DEFINE USEJPEGIMAGE} + {$ENDIF} +{$ENDIF} + +{$DEFINE EXPRESSBARS5} + +{$DEFINE VCL} + +{$IFNDEF VER80} + {$IFNDEF VER90} + {$IFNDEF VER93} + {$DEFINE DELPHI3} { Borland Delphi 3.0 } + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER110} { Borland C++Builder 3.0 } + {$DEFINE CBUILDER3} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE DELPHI4} +{$ENDIF} + +{$IFDEF VER125} { Borland C++Builder 4.0 } + {$DEFINE CBUILDER3} + {$DEFINE DELPHI4} + {$DEFINE CBUILDER4} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$IFDEF BCB} { Borland C++Builder 5.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$IFDEF BCB} { Borland C++Builder 6.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} +{$ENDIF} + +{$IFNDEF DELPHI6} + {$DEFINE MSWINDOWS} +{$ENDIF} +{$IFDEF LINUX} + {$UNDEF MSWINDOWS} +{$ENDIF} + +{$IFDEF LINUX} + {$DEFINE KYLIX1} { Borland Kylix 1 } + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF CompilerVersion >= 14} + {$DEFINE KYLIX2} { Borland Kylix 2 } + {$IFEND} + {$IF CompilerVersion >= 14.50} + {$DEFINE KYLIX3} { Borland Kylix 3 } + {$IFEND} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} { Borland Delphi.Net } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} +{$ENDIF} + +{$IFDEF VER170} { Borland Delphi 9.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} +{$ENDIF} + +{$IFDEF VER180} { Borland Delphi 10 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$IFDEF BCB} { Borland C++Builder 10 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Borland Delphi 11 //CodeGear} + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$DEFINE DELPHI11} + {$IFDEF BCB} { Borland C++Builder 11 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$DEFINE CBUILDER11} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFNDEF CLR} + {$IFNDEF BCB} + {$IFDEF DELPHI6} + {$DEFINE REGISTERSHELLCTRLS} + {$ENDIF} + {$ENDIF} + {$IFDEF DELPHI7} + {$WARN UNSAFE_CAST OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_TYPE OFF} + {$ENDIF} +{$ENDIF} + +{$IFDEF REGISTERSHELLCTRLS} + {$DEFINE REGISTERCXSHELLCTRLS} +{$ENDIF} + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} diff --git a/official/x.35/ExpressCommon Library/Sources/dxCommon.pas b/official/x.35/ExpressCommon Library/Sources/dxCommon.pas new file mode 100644 index 00000000..302a78b9 --- /dev/null +++ b/official/x.35/ExpressCommon Library/Sources/dxCommon.pas @@ -0,0 +1,191 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressCommon routines } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxCommon; + +{$I cxVer.inc} + +interface + +uses + Windows; + +type + TdxCorner = (coTopLeft, coTopRight, coBottomLeft, coBottomRight); + +function dxDropDownNCHeight: Integer; +function GetCornerForRects(const EditRect, DropDownRect: TRect): TdxCorner; +function GetHitTestByCorner(ACorner: TdxCorner): Longint; + +procedure DrawCloseButton(DC: HDC; var ARect: TRect; Selected, Pressed: Boolean; + ACorner: TdxCorner); +procedure DrawSizeGrip(DC: HDC; var ARect: TRect; ACorner: TdxCorner); + +implementation + +uses + Classes; + +function dxDropDownNCHeight: Integer; +begin + Result := 2 + GetSystemMetrics(SM_CYHSCROLL); + if Result < GetSystemMetrics(SM_CYSIZE) then + Result := GetSystemMetrics(SM_CYSIZE); + Inc(Result); +end; + +function GetCornerForRects(const EditRect, DropDownRect: TRect): TdxCorner; +const + Corners: array[Boolean, Boolean] of TdxCorner = + ((coTopLeft, coBottomLeft), (coTopRight, coBottomRight)); +begin + Result := + Corners[EditRect.Left < DropDownRect.Right, EditRect.Bottom < DropDownRect.Bottom]; +end; + +function GetHitTestByCorner(ACorner: TdxCorner): Longint; +const + HitTests: array[TdxCorner] of Longint = + (HTTOPLEFT, HTTOPRIGHT, HTBOTTOMLEFT, HTBOTTOMRIGHT); +begin + Result := HitTests[ACorner]; +end; + +procedure DrawCloseButton(DC: HDC; var ARect: TRect; Selected, Pressed: Boolean; + ACorner: TdxCorner); +const + Borders: array[Boolean] of Longint = (BDR_RAISEDINNER, BDR_SUNKENOUTER); + States: array[Boolean] of Longint = (0, DFCS_PUSHED); +var + Delta, SX, SY: Integer; + Rgn1, Rgn2: HRGN; + ClipRgnExists: Boolean; +begin + SX := GetSystemMetrics(SM_CXSIZE); + Delta := 1;//Byte(SX = 18); + SY := GetSystemMetrics(SM_CXSIZE) + Delta; + with ARect do + begin + if ACorner in [coTopRight, coBottomRight] then + Right := Left + SX + else + Left := Right - SX; + Top := (Top + Bottom - SY) div 2; + if ACorner in [coBottomLeft, coBottomRight] then Inc(Top, Delta); + Bottom := Top + SY; + end; + InflateRect(ARect, -1, -2); + if Selected then + DrawEdge(DC, ARect, Borders[Pressed], BF_RECT) + else + FrameRect(DC, ARect, GetSysColorBrush(COLOR_BTNFACE)); + InflateRect(ARect, -1, -1); + FrameRect(DC, ARect, GetSysColorBrush(COLOR_BTNFACE)); + + Rgn1 := CreateRectRgn(0, 0, 0, 0); + ClipRgnExists := GetClipRgn(DC, Rgn1) = 1; + with ARect do + Rgn2 := CreateRectRgn(Left + 1, Top + 1, Right - 1, Bottom - 1); + SelectClipRgn(DC, Rgn2); + DeleteObject(Rgn2); + InflateRect(ARect, 1, 1); + if SX <> 22 then Inc(ARect.Top, Delta); + DrawFrameControl(DC, ARect, DFC_CAPTION, DFCS_CAPTIONCLOSE or DFCS_FLAT or States[Pressed]); + if SX <> 22 then Dec(ARect.Top, Delta); + if ClipRgnExists then + SelectClipRgn(DC, Rgn1) + else + SelectClipRgn(DC, 0); + DeleteObject(Rgn1); +end; + +procedure DrawSizeGrip(DC: HDC; var ARect: TRect; ACorner: TdxCorner); +const + Offset = 2; +var + MirrorX, MirrorY: Boolean; + R: TRect; + X, Y: Integer; + MDC: HDC; + PrevB: HBITMAP; +begin + with ARect do + begin + if ACorner in [coTopRight, coBottomRight] then + Left := Right - GetSystemMetrics(SM_CXVSCROLL) + else + Right := Left + GetSystemMetrics(SM_CXVSCROLL); + if ACorner in [coBottomLeft, coBottomRight] then + Top := Bottom - GetSystemMetrics(SM_CYHSCROLL) + else + Bottom := Top + GetSystemMetrics(SM_CYHSCROLL); + MirrorX := ACorner in [coTopLeft, coBottomLeft]; + MirrorY := ACorner in [coTopLeft, coTopRight]; + end; + R := ARect; + with R do + begin + if MirrorX then + begin + Inc(Left, Offset); + FillRect(DC, Rect(ARect.Left, Top, Left, Bottom), COLOR_BTNFACE + 1); + end + else + begin + Dec(Right, Offset); + FillRect(DC, Rect(Right, Top, ARect.Right, Bottom), COLOR_BTNFACE + 1); + end; + if MirrorY then + begin + Inc(Top, Offset); + FillRect(DC, Rect(Left, ARect.Top, Right, Top), COLOR_BTNFACE + 1); + end + else + begin + Dec(Bottom, Offset); + FillRect(DC, Rect(Left, Bottom, Right, ARect.Bottom), COLOR_BTNFACE + 1); + end; + X := Left; + Y := Top; + OffsetRect(R, -Left, -Top); + end; + + MDC := CreateCompatibleDC(DC); + PrevB := SelectObject(MDC, CreateCompatibleBitmap(DC, R.Right, R.Bottom)); + DrawFrameControl(MDC, R, DFC_SCROLL, DFCS_SCROLLSIZEGRIP); + with R do + StretchBlt(DC, X, Y, Right, Bottom, + MDC, Byte(MirrorX) * (Right - 1), Byte(MirrorY) * (Bottom - 1), + (2 * Byte(not MirrorX) - 1) * Right, + (2 * Byte(not MirrorY) - 1) * Bottom, SRCCOPY); + DeleteObject(SelectObject(MDC, PrevB)); + DeleteDC(MDC); +end; + +end. diff --git a/official/x.35/ExpressCommon Library/Sources/dxreged.dfm b/official/x.35/ExpressCommon Library/Sources/dxreged.dfm new file mode 100644 index 00000000..e8b25ddd --- /dev/null +++ b/official/x.35/ExpressCommon Library/Sources/dxreged.dfm @@ -0,0 +1,419 @@ +object frmdxLibREgPathEditor: TfrmdxLibREgPathEditor + Left = 225 + Top = 106 + Width = 395 + Height = 365 + ActiveControl = TreeView + BorderIcons = [biSystemMenu, biMaximize] + Caption = 'Developer Express Registry path property editor' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Icon.Data = { + 0000010001001010100000000000280100001600000028000000100000002000 + 00000100040000000000C0000000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000 + 0073701919190000073700000000000073700091910000073708000000000073 + 708077770000073700078888000073708077780880003708077780B080007000 + 78888888800008078800888070000078004000800000078078FF8F8F00000807 + 880000007000007888888807000007888888707000007000000007000000FC00 + 0000F8000000F0010000E0030000C00700008007000000030000000300000003 + 000000030000000300000007000000070000000F0000001F0000003F0000} + OldCreateOrder = True + Position = poScreenCenter + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object Panel: TPanel + Left = 0 + Top = 289 + Width = 387 + Height = 49 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + object lbRegistry: TLabel + Left = 4 + Top = 6 + Width = 5 + Height = 13 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object bOk: TButton + Left = 236 + Top = 25 + Width = 72 + Height = 22 + Caption = '&OK' + Default = True + ModalResult = 1 + TabOrder = 2 + end + object bCancel: TButton + Left = 312 + Top = 25 + Width = 72 + Height = 22 + Cancel = True + Caption = '&Cancel' + ModalResult = 2 + TabOrder = 3 + end + object bNew: TButton + Left = 3 + Top = 25 + Width = 72 + Height = 22 + Caption = '&New' + TabOrder = 0 + OnClick = bNewClick + end + object bDelete: TButton + Left = 80 + Top = 25 + Width = 72 + Height = 22 + Caption = '&Delete' + TabOrder = 1 + OnClick = bDeleteClick + end + end + object TreeView: TTreeView + Left = 0 + Top = 0 + Width = 387 + Height = 289 + Align = alClient + HideSelection = False + Images = ImageList + Indent = 21 + ReadOnly = True + TabOrder = 1 + OnChange = TreeViewChange + OnCollapsed = TreeViewCollapsed + OnExpanded = TreeViewExpanded + OnGetImageIndex = TreeViewGetImageIndex + OnGetSelectedIndex = TreeViewGetSelectedIndex + end + object ImageList: TImageList + Width = 18 + Left = 114 + Top = 50 + Bitmap = { + 494C010102000500040012001000FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000480000002000000001002000000000000024 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000808080000000000000FF + FF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FF + FF00C0C0C00000FFFF0080808000000000000000000000000000000000000000 + 000000000000808080000000000000FFFF00C0C0C00000FFFF00C0C0C00000FF + FF00C0C0C00000FFFF00C0C0C00000FFFF008080800000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000008080800000000000C0C0 + C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0 + C00000FFFF00C0C0C00080808000000000000000000000000000000000000000 + 0000808080000000000000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0 + C00000FFFF00C0C0C00000FFFF00C0C0C0000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000808080000000000000FF + FF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FF + FF00C0C0C00000FFFF0080808000000000000000000000000000000000000000 + 00008080800000000000C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FF + FF00C0C0C00000FFFF00C0C0C000808080000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000008080800000000000C0C0 + C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0 + C00000FFFF00C0C0C00080808000000000000000000000000000000000008080 + 800000000000C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0 + C00000FFFF00C0C0C00000FFFF00000000008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000808080000000000000FF + FF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FF + FF00C0C0C00000FFFF0080808000000000000000000000000000000000008080 + 8000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000008080800000000000C0C0C00080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000008080800000000000C0C0 + C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0 + C00000FFFF00C0C0C00080808000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 80008080800080808000808080008080800000FFFF0080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000808080000000000000FF + FF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FF + FF00C0C0C00000FFFF0080808000000000000000000000000000000000000000 + 00008080800000000000C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FF + FF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080808000000000000000000000000000000000000000 + 0000808080000000000000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0 + C000000000000000000000000000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000008080800000FFFF00C0C0 + C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF0080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 00008080800000000000C0C0C00000FFFF00C0C0C00000FFFF00C0C0C0000000 + 0000808080008080800080808000808080008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000008080800000FF + FF00C0C0C00000FFFF00C0C0C00000FFFF008080800000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000008080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080808000808080008080800080808000808080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000048000000200000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFF000000000000000FFFFFFFF + F000000000000000C000FC0010000000000000008000F8001000000000000000 + A000FA001000000000000000A000F4001000000000000000A000F40010000000 + 00000000A000E8001000000000000000A000EFFC1000000000000000A000E000 + 1000000000000000A000F4001000000000000000BFFCF40F9000000000000000 + 8001F4103000000000000000C07FFBEFF000000000000000E0FFFC1FF0000000 + 00000000FFFFFFFFF000000000000000} + end +end diff --git a/official/x.35/ExpressCommon Library/Sources/dxreged.pas b/official/x.35/ExpressCommon Library/Sources/dxreged.pas new file mode 100644 index 00000000..37f4a7ac --- /dev/null +++ b/official/x.35/ExpressCommon Library/Sources/dxreged.pas @@ -0,0 +1,271 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Registry path property editor } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxRegEd; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ComCtrls, ExtCtrls, Registry, ImgList; + +type + TfrmdxLibREgPathEditor = class(TForm) + Panel: TPanel; + TreeView: TTreeView; + bOk: TButton; + bCancel: TButton; + bNew: TButton; + ImageList: TImageList; + lbRegistry: TLabel; + bDelete: TButton; + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure TreeViewChange(Sender: TObject; Node: TTreeNode); + procedure bNewClick(Sender: TObject); + procedure TreeViewGetImageIndex(Sender: TObject; Node: TTreeNode); + procedure TreeViewGetSelectedIndex(Sender: TObject; Node: TTreeNode); + procedure TreeViewExpanded(Sender: TObject; Node: TTreeNode); + procedure TreeViewCollapsed(Sender: TObject; Node: TTreeNode); + procedure bDeleteClick(Sender: TObject); + private + reg : TRegistry; + function GetFullText(Node : TTreeNode) : String; + procedure WMGetMinMaxInfo(var Message : TWMGetMinMaxInfo); message WM_GETMINMAXINFO; + public + end; + +function dxGetRegistryPath(Var APath : String) : Boolean; + +implementation + +uses + dxrgkeya; + +var + ATempPath : String; + +function dxGetRegistryPath(Var APath : String) : Boolean; +var + AForm : TfrmdxLibREgPathEditor; +begin + if (APath <> '') and (APath[1] = '\') then + ATempPath := Copy(APath, 2, 1000) + else ATempPath := APath; + AForm := TfrmdxLibREgPathEditor.Create(Nil); + AForm.ShowModal; + Result := AForm.ModalResult = mrOk; + if (Result) then + APath := AForm.lbRegistry.Caption; + AForm.Free; +end; + +{$R *.DFM} +function TfrmdxLibREgPathEditor.GetFullText(Node : TTreeNode) : String; +begin + if(Node = nil) then + begin + Result := ''; + exit; + end; + Result := Node.Text; + while Node.Parent <> nil do + begin + Node := Node.Parent; + Result := Node.Text + '\' + Result; + end; + Result := '\' + Result; +end; + +procedure TfrmdxLibREgPathEditor.FormCreate(Sender: TObject); +var + Sts : TStrings; + i : Integer; + + procedure FillRegistry(Node : TTreeNode; APath, ASt : String); + var + ANode : TTreeNode; + i : Integer; + ASts : TStrings; + Areg : TRegistry; + begin + ASts := TStringList.Create; + try + AReg := TRegistry.Create; + try + APath := APath + '\' + ASt; + AReg.OpenKey(APath, False); + AReg.GetKeyNames(ASts); + ANode := TreeView.Items.AddChild(Node, ASt); + if CompareText(APath, ATempPath) = 0 then + ANode.Selected := True; + finally + AReg.Free; + end; + for i := 0 to ASts.Count - 1 do + FillRegistry(ANode, APath, ASts[i]); + finally + ASts.Free; + end; + end; + +var + ANode : TTreeNode; +begin +{$IFDEF DELPHI9} + PopupMode := pmAuto; +{$ENDIF} + reg := TRegistry.Create; + reg.OpenKey('Software', False); + Sts := TStringList.Create; + reg.GetKeyNames(Sts); + TreeView.Items.BeginUpdate; + try + TreeView.Items.Clear; + ANode := TreeView.Items.Add(nil, 'Software'); + for i := 0 to Sts.Count - 1 do + FillRegistry(ANode, 'Software', Sts[i]); + if TreeView.Selected = nil then + begin + TreeView.Items[0].Expand(False); + TreeView.Selected := TreeView.Items[0]; + end; + finally + TreeView.Items.EndUpdate; + TreeView.Selected.MakeVisible; + Sts.Free; + end; +end; + +procedure TfrmdxLibREgPathEditor.FormDestroy(Sender: TObject); +begin + reg.Free; +end; + +procedure TfrmdxLibREgPathEditor.TreeViewChange(Sender: TObject; + Node: TTreeNode); +begin + if (Node <> nil) then + lbRegistry.Caption := GetFulltext(Node) + else lbRegistry.Caption := ''; + bNew.Enabled := (TreeView.Selected <> nil); + bDelete.Enabled := (TreeView.Selected <> nil) and (TreeView.Selected.Parent <> nil); + bOk.Enabled := bDelete.Enabled; +end; + +procedure TfrmdxLibREgPathEditor.bNewClick(Sender: TObject); +var + AReg : TRegistry; + St : String; + Node : TTreeNode; +begin + if(TreeView.Selected = Nil) then exit; + AReg := TRegistry.Create; + AReg.OpenKey(GetFullText(TreeView.Selected), False); + St := dxGetNewRegistryKey; + if(St <> '') then + begin + if(AReg.CreateKey(St)) then + begin + Node := TreeView.Items.AddChild(TreeView.Selected, St); + Node.Selected := True; + Node.MakeVisible; + end; + end; + AReg.Free; +end; + +procedure TfrmdxLibREgPathEditor.TreeViewGetImageIndex(Sender: TObject; + Node: TTreeNode); +begin + if Node.HasChildren and Node.Expanded then + Node.ImageIndex := 1 + else Node.ImageIndex := 0; + Node.SelectedIndex := Node.ImageIndex; +end; + +procedure TfrmdxLibREgPathEditor.TreeViewGetSelectedIndex(Sender: TObject; + Node: TTreeNode); +begin + TreeViewGetImageIndex(Sender, Node); +end; + +procedure TfrmdxLibREgPathEditor.TreeViewExpanded(Sender: TObject; + Node: TTreeNode); +begin + TreeView.Refresh; +end; + +procedure TfrmdxLibREgPathEditor.TreeViewCollapsed(Sender: TObject; + Node: TTreeNode); +begin + TreeView.Refresh; +end; + +procedure TfrmdxLibREgPathEditor.bDeleteClick(Sender: TObject); + + function DeleteNode(ANode : TTreeNode) : Boolean; + var + AReg : TRegistry; + begin + Result := True; + while ANode.Count > 0 do + begin + Result := DeleteNode(ANode.Item[0]); + if not Result then + Break; + end; + if Result then + begin + AReg := TRegistry.Create; + Result := AReg.DeleteKey(GetFullText(ANode)); + if Result then + ANode.Free; + AReg.Free; + end; + end; + +begin + if(TreeView.Selected = Nil) or (TreeView.Selected.Parent = Nil) then exit; + if (MessageBox(self.Handle, 'Are you sure you want delete this key?', + 'Confirm Key Delete', MB_ICONWARNING or MB_YESNO) = IDYES) + and (DeleteNode(TreeView.Selected)) then + TreeViewChange(Sender, TreeView.Selected) + else FormCreate(nil); +end; + +procedure TfrmdxLibREgPathEditor.WMGetMinMaxInfo(var Message : TWMGetMinMaxInfo); +begin + Message.MinMaxInfo^.ptMinTrackSize := Point(395, 365); + inherited; +end; + +end. diff --git a/official/x.35/ExpressCommon Library/Sources/dxrgkeya.dfm b/official/x.35/ExpressCommon Library/Sources/dxrgkeya.dfm new file mode 100644 index 00000000..c7c3e22f --- /dev/null +++ b/official/x.35/ExpressCommon Library/Sources/dxrgkeya.dfm @@ -0,0 +1,55 @@ +object frmdxAddNewRegKey: TfrmdxAddNewRegKey + Left = 195 + Top = 106 + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'Add a new registry key' + ClientHeight = 84 + ClientWidth = 279 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -14 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 120 + TextHeight = 16 + object lblName: TLabel + Left = 2 + Top = 15 + Width = 37 + Height = 16 + Caption = 'Name' + end + object Edit: TEdit + Left = 66 + Top = 10 + Width = 210 + Height = 24 + TabOrder = 0 + OnChange = EditChange + end + object bOk: TButton + Left = 90 + Top = 49 + Width = 88 + Height = 27 + Caption = '&OK' + Default = True + Enabled = False + ModalResult = 1 + TabOrder = 1 + end + object bCancel: TButton + Left = 187 + Top = 49 + Width = 89 + Height = 27 + Cancel = True + Caption = '&Cancel' + ModalResult = 2 + TabOrder = 2 + end +end diff --git a/official/x.35/ExpressCommon Library/Sources/dxrgkeya.pas b/official/x.35/ExpressCommon Library/Sources/dxrgkeya.pas new file mode 100644 index 00000000..95a54920 --- /dev/null +++ b/official/x.35/ExpressCommon Library/Sources/dxrgkeya.pas @@ -0,0 +1,71 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Regisry path property editor } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxRgKeya; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls; + +type + TfrmdxAddNewRegKey = class(TForm) + Edit: TEdit; + lblName: TLabel; + bOk: TButton; + bCancel: TButton; + procedure EditChange(Sender: TObject); + private + public + end; + +function dxGetNewRegistryKey : String; + +implementation + +{$R *.DFM} +function dxGetNewRegistryKey : String; +var + AForm : TfrmdxAddNewRegKey; +begin + AForm := TfrmdxAddNewRegKey.Create(nil); + AForm.ShowModal; + if(AForm.ModalResult = mrOK) then + Result := AForm.Edit.Text + else Result := ''; + AForm.Free; +end; + +procedure TfrmdxAddNewRegKey.EditChange(Sender: TObject); +begin + bOk.Enabled := Edit.Text <> ''; +end; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Help/DBTree.cnt b/official/x.35/ExpressDBTree Suite/Help/DBTree.cnt new file mode 100644 index 00000000..e2add41f --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Help/DBTree.cnt @@ -0,0 +1,33 @@ +:Base DBTree.hlp +:Title ExpressDBTree Suite +:Index ExpressDBTree Suite=DBTree.hlp +1 ExpressDBTree Suite +2 ExpressTree Components +3 Unit dxtree=Unit_dxtree +3 Controls +4 TCustomdxTreeView=TCustomdxTreeView +4 TdxTreeView=TdxTreeView +2 ExpressDBTree Components +3 Self-Referenced Structures=Begin1 +3 The Powerful Smart Record Loading Feature=Begin2 +3 Unit dxdbtree=Unit_dxdbtree +3 Controls +4 TdxDBTreeView=TdxDBTreeView +3 Objects +4 TdxDBTreeNodes=TdxDBTreeNodes +4 TdxDBTreeNode=TdxDBTreeNode +2 ExpressDBTree Edit Components +3 Unit dxdbtrel=Unit_dxdbtrel +3 Controls +4 TCustomdxVTreeViewEdit=TCustomdxVTreeViewEdit +4 TCustomdxTreeViewEdit=TCustomdxTreeViewEdit +4 TdxTreeViewEdit=TdxTreeViewEdit +4 TdxDBTreeViewEdit=TdxDBTreeViewEdit +4 TCustomdxLookupTreeView=TCustomdxLookupTreeView +4 TdxDBLookupTreeView=TdxDBLookupTreeView +2 ExpressTreePrint Components +3 Unit dxtrprds=Unit_dxtrprds +3 Components +4 TdxDBTreePrintData=TdxDBTreePrintData +2 Frequently Asked Questions +3 ExpressDBTreeView=FAQ diff --git a/official/x.35/ExpressDBTree Suite/Help/DBTree.hlp b/official/x.35/ExpressDBTree Suite/Help/DBTree.hlp new file mode 100644 index 00000000..77835654 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Help/DBTree.hlp differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC10.bpk b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC10.bpk new file mode 100644 index 00000000..d152838e --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC10.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxdbtrC10.bpl +OBJFILES = dxdbtreg.obj dcldxdbtrC10.obj +MAINSOURCE = dcldxdbtrC10.cpp +RESFILES = dcldxdbtrC10.res dxdbtreg.dcr +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib vclx.lib +PACKAGES = vclx.bpi rtl.bpi vcl.bpi designide.bpi dbrtl.bpi vcldb.bpi dxdbtrC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressDBTree by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC10.cpp b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC10.cpp new file mode 100644 index 00000000..a84510b9 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC10.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxdbtrC10.res"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxdbtrC10.bpi"); +USEUNIT("dxdbtreg.pas"); +USERES("dxdbtreg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC10.res b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC10.res new file mode 100644 index 00000000..37cd9073 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC10.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC11.bpk b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC11.bpk new file mode 100644 index 00000000..a5438647 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC11.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxdbtrC11.bpl +OBJFILES = dxdbtreg.obj dcldxdbtrC11.obj +MAINSOURCE = dcldxdbtrC11.cpp +RESFILES = dcldxdbtrC11.res dxdbtreg.dcr +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib vclx.lib +PACKAGES = vclx.bpi rtl.bpi vcl.bpi designide.bpi dbrtl.bpi vcldb.bpi dxdbtrC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressDBTree by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC11.cpp b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC11.cpp new file mode 100644 index 00000000..54c7691a --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC11.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxdbtrC11.res"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxdbtrC11.bpi"); +USEUNIT("dxdbtreg.pas"); +USERES("dxdbtreg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC11.res b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC11.res new file mode 100644 index 00000000..6e079db8 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC11.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC6.bpk b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC6.bpk new file mode 100644 index 00000000..3cbc0828 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC6.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxdbtrC6.bpl +OBJFILES = dxdbtreg.obj dcldxdbtrC6.obj +RESFILES = dcldxdbtrC6.res dxdbtreg.dcr +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib vclx.lib +PACKAGES = vclx.bpi rtl.bpi vcl.bpi designide.bpi dbrtl.bpi vcldb.bpi dxdbtrC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressDBTree by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC6.cpp b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC6.cpp new file mode 100644 index 00000000..81d1b3fc --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC6.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxdbtrC6.res"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxdbtrC6.bpi"); +USEUNIT("dxdbtreg.pas"); +USERES("dxdbtreg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC6.res b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC6.res new file mode 100644 index 00000000..93babed0 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrC6.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD10.dpk b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD10.dpk new file mode 100644 index 00000000..e6b34f81 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD10.dpk @@ -0,0 +1,39 @@ +package dcldxdbtrD10; + +{$R *.res} +{$R dxdbtreg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressDBTree by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + designide, + dxdbtrD10; + +contains + dxdbtreg; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD10.res b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD10.res new file mode 100644 index 00000000..26b137a6 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD10.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD11.dpk b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD11.dpk new file mode 100644 index 00000000..d559cf47 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD11.dpk @@ -0,0 +1,39 @@ +package dcldxdbtrD11; + +{$R *.res} +{$R dxdbtreg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressDBTree by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + designide, + dxdbtrD11; + +contains + dxdbtreg; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD11.res b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD11.res new file mode 100644 index 00000000..09413f06 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD11.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD7.dpk b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD7.dpk new file mode 100644 index 00000000..ad28cfc0 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD7.dpk @@ -0,0 +1,39 @@ +package dcldxdbtrD7; + +{$R *.res} +{$R dxdbtreg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressDBTree by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + designide, + dxdbtrD7; + +contains + dxdbtreg; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD7.res b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD7.res new file mode 100644 index 00000000..e78818c1 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD7.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD9.dpk b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD9.dpk new file mode 100644 index 00000000..b1e0125d --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD9.dpk @@ -0,0 +1,39 @@ +package dcldxdbtrD9; + +{$R *.res} +{$R dxdbtreg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressDBTree by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + designide, + dxdbtrD9; + +contains + dxdbtreg; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD9.res b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD9.res new file mode 100644 index 00000000..adca3b30 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrD9.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrc5.bpk b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrc5.bpk new file mode 100644 index 00000000..0de93d32 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrc5.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dcldxdbtrc5.bpl +OBJFILES = dxdbtreg.obj dcldxdbtrc5.obj +RESFILES = dcldxdbtrc5.res dxdbtreg.dcr +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib vcldb50.lib vclx50.lib +PACKAGES = vclx50.bpi VCL50.bpi vcldb50.bpi dxdbtrc5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressDBTree by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrc5.cpp b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrc5.cpp new file mode 100644 index 00000000..0bbe51ce --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrc5.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxdbtrc5.res"); +USEPACKAGE("vclx50.bpi"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("dxdbtrc5.bpi"); +USEUNIT("dxdbtreg.pas"); +USERES("dxdbtreg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrc5.res b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrc5.res new file mode 100644 index 00000000..ca438df8 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrc5.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrd5.dpk b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrd5.dpk new file mode 100644 index 00000000..c60e5044 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrd5.dpk @@ -0,0 +1,38 @@ +package dcldxdbtrd5; + +{$R *.RES} +{$R dxdbtreg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressDBTree by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcldb50, + dxdbtrd5; + +contains + dxdbtreg; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrd5.res b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrd5.res new file mode 100644 index 00000000..56843508 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrd5.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrd6.dpk b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrd6.dpk new file mode 100644 index 00000000..804a40fc --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrd6.dpk @@ -0,0 +1,39 @@ +package dcldxdbtrD6; + +{$R *.RES} +{$R dxdbtreg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressDBTree by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + designide, + dxdbtrD6; + +contains + dxdbtreg; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrd6.res b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrd6.res new file mode 100644 index 00000000..b885dbfa Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dcldxdbtrd6.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC10.bpk b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC10.bpk new file mode 100644 index 00000000..ca1cc98a --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC10.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxtrmdC10.bpl +OBJFILES = dxtrpreg.obj dcldxtrmdC10.obj +MAINSOURCE = dcldxtrmdC10.cpp +RESFILES = dcldxtrmdC10.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dbrtl.bpi vcldb.bpi dxtrmdC10.bpi dxmdsC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressTreePrintedDataSet by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC10.cpp b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC10.cpp new file mode 100644 index 00000000..093564c7 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC10.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxtrmdC10.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxtrmdC10.bpi"); +USEPACKAGE("dxmdsC10.bpi"); +USEUNIT("dxtrpreg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC10.res b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC10.res new file mode 100644 index 00000000..3e23a5d8 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC10.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC11.bpk b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC11.bpk new file mode 100644 index 00000000..f002f710 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC11.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxtrmdC11.bpl +OBJFILES = dxtrpreg.obj dcldxtrmdC11.obj +MAINSOURCE = dcldxtrmdC11.cpp +RESFILES = dcldxtrmdC11.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dbrtl.bpi vcldb.bpi dxtrmdC11.bpi dxmdsC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressTreePrintedDataSet by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC11.cpp b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC11.cpp new file mode 100644 index 00000000..3aee8e1d --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC11.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxtrmdC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxtrmdC11.bpi"); +USEPACKAGE("dxmdsC11.bpi"); +USEUNIT("dxtrpreg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC11.res b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC11.res new file mode 100644 index 00000000..b1b24196 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC11.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC6.bpk b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC6.bpk new file mode 100644 index 00000000..90193f5d --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC6.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxtrmdC6.bpl +OBJFILES = dxtrpreg.obj dcldxtrmdC6.obj +RESFILES = dcldxtrmdC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dbrtl.bpi vcldb.bpi dxtrmdC6.bpi dxmdsC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressTreePrintedDataSet by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC6.cpp b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC6.cpp new file mode 100644 index 00000000..ca35e98f --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC6.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxtrmdC6.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxtrmdC6.bpi"); +USEPACKAGE("dxmdsC6.bpi"); +USEUNIT("dxtrpreg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC6.res b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC6.res new file mode 100644 index 00000000..3483bf63 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdC6.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD10.dpk b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD10.dpk new file mode 100644 index 00000000..0bea1427 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD10.dpk @@ -0,0 +1,39 @@ +package dcldxtrmdD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressTreePrintedDataSet by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + designide, + dxmdsD10, + dxtrmdD10; + +contains + dxtrpreg; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD10.res b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD10.res new file mode 100644 index 00000000..c8bb2c54 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD10.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD11.dpk b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD11.dpk new file mode 100644 index 00000000..19497987 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD11.dpk @@ -0,0 +1,39 @@ +package dcldxtrmdD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressTreePrintedDataSet by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + designide, + dxmdsD11, + dxtrmdD11; + +contains + dxtrpreg; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD11.res b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD11.res new file mode 100644 index 00000000..500d9783 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD11.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD7.dpk b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD7.dpk new file mode 100644 index 00000000..106ad445 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD7.dpk @@ -0,0 +1,39 @@ +package dcldxtrmdD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressTreePrintedDataSet by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + designide, + dxmdsD7, + dxtrmdD7; + +contains + dxtrpreg; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD7.res b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD7.res new file mode 100644 index 00000000..45c9f6cf Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD7.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD9.dpk b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD9.dpk new file mode 100644 index 00000000..cbd78ea7 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD9.dpk @@ -0,0 +1,39 @@ +package dcldxtrmdD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressTreePrintedDataSet by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + designide, + dxmdsD9, + dxtrmdD9; + +contains + dxtrpreg; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD9.res b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD9.res new file mode 100644 index 00000000..ba5f363c Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdD9.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdc5.bpk b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdc5.bpk new file mode 100644 index 00000000..f690f8fb --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdc5.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dcldxtrmdc5.bpl +OBJFILES = dxtrpreg.obj dcldxtrmdc5.obj +RESFILES = dcldxtrmdc5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib vcldb50.lib +PACKAGES = VCL50.bpi vcldb50.bpi dxtrmdc5.bpi dxmdsc5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressTreePrintedDataSet by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdc5.cpp b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdc5.cpp new file mode 100644 index 00000000..23978fce --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdc5.cpp @@ -0,0 +1,19 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxtrmdc5.res"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("dxtrmdc5.bpi"); +USEPACKAGE("dxmdsc5.bpi"); +USEUNIT("dxtrpreg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdc5.res b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdc5.res new file mode 100644 index 00000000..e00ca325 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdc5.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdd5.dpk b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdd5.dpk new file mode 100644 index 00000000..8bbf358c --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdd5.dpk @@ -0,0 +1,38 @@ +package dcldxtrmdd5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressTreePrintedDataSet by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcldb50, + dxmdsd5, + dxtrmdd5; + +contains + dxtrpreg; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdd5.res b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdd5.res new file mode 100644 index 00000000..6c92b6de Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdd5.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdd6.dpk b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdd6.dpk new file mode 100644 index 00000000..fe22320f --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdd6.dpk @@ -0,0 +1,39 @@ +package dcldxtrmdD6; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressTreePrintedDataSet by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + designide, + dxmdsD6, + dxtrmdD6; + +contains + dxtrpreg; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdd6.res b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdd6.res new file mode 100644 index 00000000..13c11114 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dcldxtrmdd6.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC10.bpk b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC10.bpk new file mode 100644 index 00000000..e9f258cc --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC10.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxdbtrC10.bpl +OBJFILES = dxdbtree.obj dxlocate.obj dxtree.obj dxdbtrel.obj dxdbtrC10.obj +MAINSOURCE = dxdbtrC10.cpp +RESFILES = dxdbtrC10.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib dxcomnC10.lib vclx.lib +PACKAGES = vclx.bpi rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi dxcomnC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressDBTree by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC10.cpp b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC10.cpp new file mode 100644 index 00000000..91d426b3 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC10.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxdbtrC10.res"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxcomnC10.bpi"); +USEUNIT("dxdbtree.pas"); +USEUNIT("dxlocate.pas"); +USEUNIT("dxtree.pas"); +USEUNIT("dxdbtrel.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC10.res b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC10.res new file mode 100644 index 00000000..05712271 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC10.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC11.bpk b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC11.bpk new file mode 100644 index 00000000..2b4f2e06 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC11.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxdbtrC11.bpl +OBJFILES = dxdbtree.obj dxlocate.obj dxtree.obj dxdbtrel.obj dxdbtrC11.obj +MAINSOURCE = dxdbtrC11.cpp +RESFILES = dxdbtrC11.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib dxcomnC11.lib vclx.lib +PACKAGES = vclx.bpi rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi dxcomnC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressDBTree by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC11.cpp b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC11.cpp new file mode 100644 index 00000000..4a39d1e5 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC11.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxdbtrC11.res"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxcomnC11.bpi"); +USEUNIT("dxdbtree.pas"); +USEUNIT("dxlocate.pas"); +USEUNIT("dxtree.pas"); +USEUNIT("dxdbtrel.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC11.res b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC11.res new file mode 100644 index 00000000..bf62027a Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC11.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC6.bpk b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC6.bpk new file mode 100644 index 00000000..c5983665 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC6.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxdbtrC6.bpl +OBJFILES = dxdbtree.obj dxlocate.obj dxtree.obj dxdbtrel.obj dxdbtrC6.obj +RESFILES = dxdbtrC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib dxcomnC6.lib vclx.lib +PACKAGES = vclx.bpi rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi dxcomnC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressDBTree by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC6.cpp b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC6.cpp new file mode 100644 index 00000000..a1fe4f9c --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC6.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxdbtrC6.res"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxcomnC6.bpi"); +USEUNIT("dxdbtree.pas"); +USEUNIT("dxlocate.pas"); +USEUNIT("dxtree.pas"); +USEUNIT("dxdbtrel.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC6.res b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC6.res new file mode 100644 index 00000000..92285462 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrC6.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD10.dpk b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD10.dpk new file mode 100644 index 00000000..a1af864b --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD10.dpk @@ -0,0 +1,41 @@ +package dxdbtrD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressDBTree by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + vcldb, + dxcomnD10; + +contains + dxtree, + dxdbtrel, + dxlocate, + dxdbtree; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD10.res b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD10.res new file mode 100644 index 00000000..63ae4743 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD10.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD11.dpk b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD11.dpk new file mode 100644 index 00000000..6921bdb1 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD11.dpk @@ -0,0 +1,41 @@ +package dxdbtrD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressDBTree by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + vcldb, + dxcomnD11; + +contains + dxtree, + dxdbtrel, + dxlocate, + dxdbtree; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD11.res b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD11.res new file mode 100644 index 00000000..2157ef5b Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD11.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD7.dpk b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD7.dpk new file mode 100644 index 00000000..b792b430 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD7.dpk @@ -0,0 +1,41 @@ +package dxdbtrD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressDBTree by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + vcldb, + dxcomnD7; + +contains + dxtree, + dxdbtrel, + dxlocate, + dxdbtree; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD7.res b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD7.res new file mode 100644 index 00000000..dbe46856 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD7.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD9.dpk b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD9.dpk new file mode 100644 index 00000000..c00957d6 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD9.dpk @@ -0,0 +1,41 @@ +package dxdbtrD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressDBTree by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + vcldb, + dxcomnD9; + +contains + dxtree, + dxdbtrel, + dxlocate, + dxdbtree; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD9.res b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD9.res new file mode 100644 index 00000000..6f6a93b8 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrD9.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrc5.bpk b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrc5.bpk new file mode 100644 index 00000000..c978197f --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrc5.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxdbtrc5.bpl +OBJFILES = dxdbtree.obj dxlocate.obj dxtree.obj dxdbtrel.obj dxdbtrc5.obj +RESFILES = dxdbtrc5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib vcldb50.lib dxcomnC5.lib vclx50.lib +PACKAGES = vclx50.bpi VCL50.bpi vcldb50.bpi dxcomnc5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressDBTree by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrc5.cpp b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrc5.cpp new file mode 100644 index 00000000..b7c9336c --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrc5.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxdbtrc5.res"); +USEPACKAGE("vclx50.bpi"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("dxcomnc5.bpi"); +USEUNIT("dxdbtree.pas"); +USEUNIT("dxlocate.pas"); +USEUNIT("dxtree.pas"); +USEUNIT("dxdbtrel.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrc5.res b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrc5.res new file mode 100644 index 00000000..e1178a39 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrc5.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrd5.dpk b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrd5.dpk new file mode 100644 index 00000000..2fa1b6ca --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrd5.dpk @@ -0,0 +1,40 @@ +package dxdbtrd5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressDBTree by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcldb50, + dxcomnd5; + +contains + dxdbtree, + dxlocate, + dxtree, + dxdbtrel; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrd5.res b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrd5.res new file mode 100644 index 00000000..e3112433 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrd5.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrd6.dpk b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrd6.dpk new file mode 100644 index 00000000..f90bc666 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrd6.dpk @@ -0,0 +1,41 @@ +package dxdbtrD6; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressDBTree by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + vcldb, + dxcomnD6; + +contains + dxdbtree, + dxlocate, + dxtree, + dxdbtrel; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxdbtrd6.res b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrd6.res new file mode 100644 index 00000000..a1fa3c4e Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dxdbtrd6.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC10.bpk b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC10.bpk new file mode 100644 index 00000000..167bf6dc --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC10.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxtrmdC10.bpl +OBJFILES = dxtrprds.obj dxtrmdC10.obj +MAINSOURCE = dxtrmdC10.cpp +RESFILES = dxtrmdC10.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib dxmdsC10.lib +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi dxdbtrC10.bpi dxmdsC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressTreePrintedDataSet by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC10.cpp b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC10.cpp new file mode 100644 index 00000000..fd78bbc1 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC10.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxtrmdC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxdbtrC10.bpi"); +USEPACKAGE("dxmdsC10.bpi"); +USEUNIT("dxtrprds.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC10.res b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC10.res new file mode 100644 index 00000000..3a6d9987 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC10.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC11.bpk b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC11.bpk new file mode 100644 index 00000000..a5bb402b --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC11.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxtrmdC11.bpl +OBJFILES = dxtrprds.obj dxtrmdC11.obj +MAINSOURCE = dxtrmdC11.cpp +RESFILES = dxtrmdC11.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib dxmdsC11.lib +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi dxdbtrC11.bpi dxmdsC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressTreePrintedDataSet by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC11.cpp b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC11.cpp new file mode 100644 index 00000000..baa6c445 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxtrmdC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxdbtrC11.bpi"); +USEPACKAGE("dxmdsC11.bpi"); +USEUNIT("dxtrprds.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC11.res b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC11.res new file mode 100644 index 00000000..df8b4ba8 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC11.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC6.bpk b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC6.bpk new file mode 100644 index 00000000..e59eacb4 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC6.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxtrmdC6.bpl +OBJFILES = dxtrprds.obj dxtrmdC6.obj +RESFILES = dxtrmdC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib dxmdsC6.lib +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi dxdbtrC6.bpi dxmdsC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressTreePrintedDataSet by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC6.cpp b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC6.cpp new file mode 100644 index 00000000..1355be2b --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC6.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxtrmdC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxdbtrC6.bpi"); +USEPACKAGE("dxmdsC6.bpi"); +USEUNIT("dxtrprds.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC6.res b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC6.res new file mode 100644 index 00000000..f7e2448f Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdC6.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD10.dpk b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD10.dpk new file mode 100644 index 00000000..7090bd9a --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD10.dpk @@ -0,0 +1,37 @@ +package dxtrmdD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressTreePrintedDataSet by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + dxmdsD10; + +contains + dxtrprds; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD10.res b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD10.res new file mode 100644 index 00000000..ca0aa5fc Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD10.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD11.dpk b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD11.dpk new file mode 100644 index 00000000..5835fc26 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD11.dpk @@ -0,0 +1,37 @@ +package dxtrmdD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressTreePrintedDataSet by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + dxmdsD11; + +contains + dxtrprds; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD11.res b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD11.res new file mode 100644 index 00000000..522569cd Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD11.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD7.dpk b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD7.dpk new file mode 100644 index 00000000..3db5ffce --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD7.dpk @@ -0,0 +1,37 @@ +package dxtrmdD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressTreePrintedDataSet by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + dxmdsD7; + +contains + dxtrprds; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD7.res b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD7.res new file mode 100644 index 00000000..2a577200 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD7.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD9.dpk b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD9.dpk new file mode 100644 index 00000000..4ce9f8dc --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD9.dpk @@ -0,0 +1,37 @@ +package dxtrmdD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressTreePrintedDataSet by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + dxmdsD9; + +contains + dxtrprds; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD9.res b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD9.res new file mode 100644 index 00000000..8be0e13c Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdD9.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdc5.bpk b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdc5.bpk new file mode 100644 index 00000000..54779255 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdc5.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxtrmdc5.bpl +OBJFILES = dxtrprds.obj dxtrmdc5.obj +RESFILES = dxtrmdc5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib vcldb50.lib dxmdsc5.lib +PACKAGES = VCL50.bpi vcldb50.bpi dxdbtrc5.bpi dxmdsc5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressTreePrintedDataSet by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdc5.cpp b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdc5.cpp new file mode 100644 index 00000000..b38d3cfc --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdc5.cpp @@ -0,0 +1,19 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxtrmdc5.res"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("dxdbtrc5.bpi"); +USEPACKAGE("dxmdsc5.bpi"); +USEUNIT("dxtrprds.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdc5.res b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdc5.res new file mode 100644 index 00000000..667092f6 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdc5.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdd5.dpk b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdd5.dpk new file mode 100644 index 00000000..ba655249 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdd5.dpk @@ -0,0 +1,37 @@ +package dxtrmdd5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressTreePrintedDataSet by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcldb50, + dxmdsd5; + +contains + dxtrprds; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdd5.res b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdd5.res new file mode 100644 index 00000000..a042d315 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdd5.res differ diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdd6.dpk b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdd6.dpk new file mode 100644 index 00000000..54c7132f --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdd6.dpk @@ -0,0 +1,37 @@ +package dxtrmdD6; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressTreePrintedDataSet by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + dxmdsD6; + +contains + dxtrprds; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Packages/dxtrmdd6.res b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdd6.res new file mode 100644 index 00000000..39a51e84 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Packages/dxtrmdd6.res differ diff --git a/official/x.35/ExpressDBTree Suite/Sources/cxVer.inc b/official/x.35/ExpressDBTree Suite/Sources/cxVer.inc new file mode 100644 index 00000000..a26364cc --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Sources/cxVer.inc @@ -0,0 +1,172 @@ +{$B-} { Complete Boolean Evaluation } +{$R-} { Range-Checking } +{$T-} { Typed @ operator } +{$X+} { Extended syntax } +{$P+} { Open string params } +{$J+} { Writeable structured consts } +{$H+} { Use long strings by default } +{$Q-} { Overflow checking } + +{$DEFINE DXVER500} + +{$IFNDEF CLR} + {$DEFINE OLEDRAGANDDROP} + {$IFNDEF DONTUSEJPEGIMAGE} + {$DEFINE USEJPEGIMAGE} + {$ENDIF} +{$ENDIF} + +{$DEFINE EXPRESSBARS5} + +{$DEFINE VCL} + +{$IFNDEF VER80} + {$IFNDEF VER90} + {$IFNDEF VER93} + {$DEFINE DELPHI3} { Borland Delphi 3.0 } + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER110} { Borland C++Builder 3.0 } + {$DEFINE CBUILDER3} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE DELPHI4} +{$ENDIF} + +{$IFDEF VER125} { Borland C++Builder 4.0 } + {$DEFINE CBUILDER3} + {$DEFINE DELPHI4} + {$DEFINE CBUILDER4} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$IFDEF BCB} { Borland C++Builder 5.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$IFDEF BCB} { Borland C++Builder 6.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} +{$ENDIF} + +{$IFNDEF DELPHI6} + {$DEFINE MSWINDOWS} +{$ENDIF} +{$IFDEF LINUX} + {$UNDEF MSWINDOWS} +{$ENDIF} + +{$IFDEF LINUX} + {$DEFINE KYLIX1} { Borland Kylix 1 } + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF CompilerVersion >= 14} + {$DEFINE KYLIX2} { Borland Kylix 2 } + {$IFEND} + {$IF CompilerVersion >= 14.50} + {$DEFINE KYLIX3} { Borland Kylix 3 } + {$IFEND} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} { Borland Delphi.Net } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} +{$ENDIF} + +{$IFDEF VER170} { Borland Delphi 9.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} +{$ENDIF} + +{$IFDEF VER180} { Borland Delphi 10 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$IFDEF BCB} { Borland C++Builder 10 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Borland Delphi 11 //CodeGear} + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$DEFINE DELPHI11} + {$IFDEF BCB} { Borland C++Builder 11 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$DEFINE CBUILDER11} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFNDEF CLR} + {$IFNDEF BCB} + {$IFDEF DELPHI6} + {$DEFINE REGISTERSHELLCTRLS} + {$ENDIF} + {$ENDIF} + {$IFDEF DELPHI7} + {$WARN UNSAFE_CAST OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_TYPE OFF} + {$ENDIF} +{$ENDIF} + +{$IFDEF REGISTERSHELLCTRLS} + {$DEFINE REGISTERCXSHELLCTRLS} +{$ENDIF} + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} diff --git a/official/x.35/ExpressDBTree Suite/Sources/dxcmctl.inc b/official/x.35/ExpressDBTree Suite/Sources/dxcmctl.inc new file mode 100644 index 00000000..2719f0a4 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Sources/dxcmctl.inc @@ -0,0 +1,82 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express custom draw servce declaration } +{ } +{ Copyright (c) 1998, 99 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSGRID AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +{Types and constants for custom draw service} + +const + {Custom draw constants} + NM_CUSTOMDRAW = NM_FIRST-12; + CDDS_PREPAINT = $00000001; + CDDS_POSTPAINT = $00000002; + CDDS_PREERASE = $00000003; + CDDS_POSTERASE = $00000004; + CDDS_ITEM = $00010000; + + CDDS_ITEMPREPAINT = CDDS_ITEM Or CDDS_PREPAINT; + CDDS_ITEMPOSTPAINT = CDDS_ITEM Or CDDS_POSTPAINT; + CDDS_ITEMPREERASE = CDDS_ITEM Or CDDS_PREERASE; + CDDS_ITEMPOSTERASE = CDDS_ITEM Or CDDS_POSTERASE; + + CDRF_DODEFAULT = $00000000; + CDRF_NEWFONT = $00000002; + CDRF_SKIPDEFAULT = $00000004; + CDRF_NOTIFYPOSTPAINT = $00000010; + CDRF_NOTIFYITEMDRAW = $00000020; + CDRF_NOTIFYPOSTERASE = $00000040; + CDRF_NOTIFYITEMERASE = $00000080; + + +type + {Custom draw types} + TNMCustomDraw = record + hdr : TNMHDR; + dwDrawStage : DWORD; // State of the Drawing + hdc : HDC; + rc : TRECT; + dwItemSpec : DWORD; + uItemState : UINT; + LItemlParam : LPARAM; + end; + + PNMCustomDraw = ^TNMCustomDraw; + + TNMLVCustomDraw = record + nmcd : TNMCustomDraw; + clrText : COLORREF; + clrTextBk : COLORREF; + end; + + PNMLVCustomDraw = ^TNMLVCustomDraw; + diff --git a/official/x.35/ExpressDBTree Suite/Sources/dxdbtree.pas b/official/x.35/ExpressDBTree Suite/Sources/dxdbtree.pas new file mode 100644 index 00000000..e5563aa4 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Sources/dxdbtree.pas @@ -0,0 +1,2260 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express data-aware tree view } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSGRID AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES or ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, or OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxdbtree; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + ComCtrls, CommCtrl, DB, dxtree; + +const + WM_DX = WM_APP + 100; + WM_UPDATEIMAGES = WM_DX + 1; + +type + EDBTreeViewError = class(Exception); + + TdxDBTreeView = class; + + TDataLinkTreeView = class(TDataLink) + private + FDBTreeView: TdxDBTreeView; + Filter: string; + Filtered: Boolean; + protected + procedure ActiveChanged; override; + procedure DataSetChanged; override; + procedure DataSetScrolled(Distance: Integer); override; + procedure RecordChanged(Field: TField); override; + public + constructor Create; + end; + + TdxDBTreeNodes = class; + + TdxDBTreeNode = class(TdxTreeNode) + private + IsInserting: Boolean; + Refreshed: Boolean; + protected + DBTreeNodes: TdxDBTreeNodes; + + FKeyFieldValue: Variant; + FParentFieldValue: Variant; + FChildLoaded: Boolean; + + FIndex: Integer; + FListText: string; + + FBkColor: TColor; + FColor: TColor; + FFontStyle: TFontStyles; + FFontName: TFontName; + FIsCustomDraw: Boolean; + + procedure SetChildLoaded(Value: Boolean); + procedure SetIsCustomDraw(Value: Boolean); + protected + procedure SetKeyFieldValue(Value: Variant); + procedure SetParentFieldValue(Value: Variant); + procedure UpdateImages; + public + constructor Create(AOwner: TdxDBTreeNodes; Value: Variant); + destructor Destroy; override; + procedure LoadChildren(Recurse: Boolean); + + property BkColor: TColor read FBkColor write FBkColor; + property Color: TColor read FColor write FColor; + property FontStyle: TFontStyles read FFontStyle write FFontStyle; + property FontName: TFontName read FFontName write FFontName; + property IsCustomDraw: Boolean read FIsCustomDraw write SetIsCustomDraw; + + property ChildLoaded: Boolean read FChildLoaded write SetChildLoaded; + property Index: Integer read FIndex; + property KeyFieldValue: Variant read FKeyFieldValue; + property ParentFieldValue: Variant read FParentFieldValue; + end; + + TdxDBTreeNodes = class + private + FDBTreeView: TdxDBTreeView; + FList: TList; + FCustomDrawCount: Integer; + Destroying: Boolean; + + function GetDBNodeFromIndex(Index: Integer): TdxDBTreeNode; + function GetMaxKeyFieldValue: Variant; + protected + procedure BeginRefreshRecord; + procedure EndRefreshRecord; + function FindNearest(Value: Variant; var Index: Integer): Boolean; + procedure Clear; + procedure Delete(ADBTreeNode: TdxDBTreeNode); + procedure NodeChangeParent(TreeNode: TTreeNode; Value: Variant); + function RefreshRecord: TdxDBTreeNode; + procedure RefreshParents; + public + constructor Create(ADBTreeView: TdxDBTreeView); + destructor Destroy; override; + function Count: Integer; + function GetKeyFieldValue(Value: TTreeNode): Variant; + function GetParentValue(Value: TTreeNode): Variant; + function GetDBTreeNode(Value: Variant): TdxDBTreeNode; + function GetTreeNode(Value: Variant): TTreeNode; + function IndexOf(Value: TTreeNode): Integer; + property Items[Index: Integer]: TdxDBTreeNode read GetDBNodeFromIndex; default; + property MaxKeyFieldValue: Variant read GetMaxKeyFieldValue; + end; + + TAddNewDBTreeNodeEvent = procedure(Sender: TObject; var DBTreeNode: TdxDBTreeNode) of Object; + TDBTreeRefreshNodeEvent = procedure(Sender: TObject; DBTreeNode: TdxDBTreeNode) of Object; + TCreateNewKeyValue = procedure(Sender: TObject; var NewKeyValue: Variant) of Object; + TSetDisplayItemText = procedure(Sender: TObject; var DisplayText: string) of Object; + TdxDBTreeViewOption = (trDBCanDelete, trDBConfirmDelete, trCanDBNavigate, + trSmartRecordLoad, trSmartRecordCopy, trCheckHasChildren); + TdxDBTreeViewOptions = set of TdxDBTreeViewOption; + + TdxDBTreeViewAction = (trDBInsert, trDBDelete, trDBChangeText, trDBChangeParent, trDBMove); + TdxDBTreeViewActionEvent = procedure(Sender: TObject; DBNode1, DBNode2: TdxDBTreeNode; + Action: TdxDBTreeViewAction; var Automatic: Boolean) of Object; + + TdxDBTreeView = class(TCustomdxTreeView) + private + DataChangedBusy: Boolean; + CNNotifyFlag: Boolean; + + FDataLink: TDataLinkTreeView; + FDBTreeNodes: TdxDBTreeNodes; + FAddNewItem: TAddNewDBTreeNodeEvent; + FCreateNewKeyValue: TCreateNewKeyValue; + FOnSetDisplayItemText: TSetDisplayItemText; + FOnInsertNodeError: TNotifyEvent; + FRaiseOnError: Boolean; + FOnDBAction: TdxDBTreeViewActionEvent; + FOnRefreshNode: TDBTreeRefreshNodeEvent; + + FKeyFieldName: string; + FListFieldName: string; + FParentFieldName: string; + FDisplayFieldName: string; + FImageIndexFieldName: string; + FStateIndexFieldName: string; + FRootValue: Variant; + FSeparatedSt: string; + FOptions: TdxDBTreeViewOptions; + + FImageIndexField: TField; + FKeyField: TField; + FListField: TField; + FDisplayFields: TList; + FParentField: TField; + FStateIndexField: TField; + + FEditInstance: Pointer; + FDefEditProc: Pointer; + FEditHandle: HWND; + + procedure AssignFields; + procedure DataLinkActiveChanged; + procedure DataLinkRecordChanged(Field: TField); + procedure DataChanged; + procedure RecordEdit(Field: TField); + procedure RecordInsert(Field: TField); + + function GetDataSource: TDataSource; + {$IFNDEF DELPHI6} + function GetRootValue: string; + {$ENDIF} + function GetSeletectedDBTreeNode: TdxDBTreeNode; + procedure Scroll; + procedure SetDataSource(Value: TDataSource); + procedure SetDisplayFieldName(const Value: string); + procedure SetImageIndexFieldName(const Value: string); + procedure SetKeyFieldName(const Value: string); + procedure SetListFieldName(const Value: string); + procedure SetRootValue(const Value: {$IFNDEF DELPHI6}string{$ELSE}Variant{$ENDIF}); + procedure SetStateIndexFieldName(const Value: string); + procedure SetOptions(const Value: TdxDBTreeViewOptions); + procedure SetParentFieldName(const Value: string); + procedure SetSeparatedSt(const Value: string); + + function GetDisplayText: string; + + procedure DoCNNotify(var Message: TWMNotify); + procedure DoWMPaint(var Message: TMessage); + procedure DoVMInsertItem(var Message: TMessage); + procedure DoVMSelectItem(var Message: TMessage); + procedure DoVMSetItem(var Message: TMessage); + procedure DoVMExpand(var Message: TMessage); + procedure CNNotify(var Message: TWMNotify); message CN_NOTIFY; + procedure VM_INSERTITEM(var Message: TMessage); message TVM_INSERTITEM; + procedure VM_SELECTITEM(var Message: TMessage); message TVM_SELECTITEM; + procedure VM_SETITEM(var Message: TMessage); message TVM_SETITEM; + procedure VM_EXPAND(var Message: TMessage); message TVM_EXPAND; + procedure WMPAINT(var Message: TMessage); message WM_PAINT; + procedure WMUpdateImages(var Message: TMessage); message WM_UPDATEIMAGES; + procedure EditWndProc(var Message: TMessage); + procedure FrameSelectedItem; + procedure DeleteDBNode(AKeyValue: Variant); + + procedure InsertTreeNode(Node, Parent: TdxDBTreeNode); + procedure SetNewTreeNodeParent(Node, NewParent: TdxDBTreeNode); + protected + function DoDBAction(DBNode1, DBNode2: TdxDBTreeNode; Action: TdxDBTreeViewAction): Boolean; dynamic; + + procedure CreateWnd; override; + procedure DestroyWnd; override; + + procedure CreateHandle; override; + procedure Change(Node: TTreeNode); override; + procedure DoCustomDraw(TreeNode: TTreeNode; AFont: TFont; + var AColor, ABkColor: TColor); override; + function GetListItemText(TreeNode: TTreeNode): string; override; + procedure Edit(const Item: TTVItem); override; + procedure InsertTreeNodeStructure(ListS, ListD: TList; Flag: Boolean); override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + function GetNextMaxKeyValue: Variant; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function CreateNode: TTreeNode; override; + + procedure GetNodeStructure(TreeNode: TTreeNode; List: TList); override; + + function GetImageIndexField: TField; + function GetKeyField: TField; + function GetListField: TField; + function GetParentField: TField; + function GetStateIndexField: TField; + + procedure GotoKeyFieldValue(Value: Variant); + function IsCustomDraw: Boolean; override; + procedure RefreshItems; + + property DBSelected: TdxDBTreeNode read GetSeletectedDBTreeNode; + property DBTreeNodes: TdxDBTreeNodes read FDBTreeNodes; + property Items; + property Selected; + published + property DataSource: TDataSource read GetDataSource write SetDataSource; + property DisplayField: string read FDisplayFieldName write SetDisplayFieldName; + property ImageIndexField: string read FImageIndexFieldName write SetImageIndexFieldName; + property KeyField: string read FKeyFieldName write SetKeyFieldName; + property ListField: string read FListFieldName write SetListFieldName; + property ParentField: string read FParentFieldName write SetParentFieldName; + {$IFNDEF DELPHI6} + property RootValue: string read GetRootValue write SetRootValue; + {$ELSE} + property RootValue: Variant read FRootValue write SetRootValue; + {$ENDIF} + property SeparatedSt: string read FSeparatedSt write SetSeparatedSt; + property StateIndexField: string read FStateIndexFieldName write SetStateIndexFieldName; + property RaiseOnError: Boolean read FRaiseOnError write FRaiseOnError; + property ShowButtons; + property BorderStyle; + property DragCursor; + property ShowLines; + property ShowRoot; + property ReadOnly; + property DragMode; + property HideSelection; + property Indent; + property OnEditing; + property OnEdited; + property OnExpanding; + property OnExpanded; + property OnCollapsing; + property OnCompare; + property OnCollapsed; + property OnChanging; + property OnChange; + property OnDeletion; + property OnGetImageIndex; + property OnGetSelectedIndex; + property Align; + property Enabled; + property Font; + property Color; + property ParentColor; + property ParentCtl3D; + property Ctl3D; + property Options: TdxDBTreeViewOptions read FOptions write SetOptions default []; + property SortType; + property SelectedIndex; + property TabOrder; + property TabStop default True; + property Visible; + property OnAddNewItem: TAddNewDBTreeNodeEvent read FAddNewItem write FAddNewItem; + property OnCreateNewKeyValue: TCreateNewKeyValue read FCreateNewKeyValue + write FCreateNewKeyValue; + property OnSetDisplayItemText: TSetDisplayItemText read FOnSetDisplayItemText + write FOnSetDisplayItemText; + property OnInsertNodeError: TNotifyEvent read FOnInsertNodeError write FOnInsertNodeError; + property OnDBAction: TdxDBTreeViewActionEvent read FOnDBAction write FOnDBAction; + property OnRefreshNode: TDBTreeRefreshNodeEvent read FOnRefreshNode write FOnRefreshNode; + property OnClick; + property OnEnter; + property OnExit; + property OnDragDrop; + property OnDragOver; + property OnStartDrag; + property OnEndDrag; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnDblClick; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property PopupMenu; + property ParentFont; + property ParentShowHint; + property ShowHint; + property Images; + property StateImages; + {$IFDEF DELPHI6} + property OnContextPopup; + {$ENDIF} +end; + +implementation +uses TypInfo {$IFNDEF DELPHI3}, DBTables {$ENDIF}, dxlocate + ; + +function VarEquals(const V1, V2: Variant): Boolean; +begin + try + Result := V1 = V2; + except + Result := False; + end; +end; + +function VarFirstMore(const V1, V2: Variant): Boolean; +begin + try + Result := V1 >= V2; + except + Result := False; + end; +end; + +function VarFirstMoreEx(const V1, V2: Variant): Boolean; +begin + try + Result := V1 > V2; + except + Result := False; + end; +end; + +{TDataLinkTreeView} +constructor TDataLinkTreeView.Create; +begin + inherited Create; + {$IFDEF DELPHI5} + VisualControl := True; + {$ENDIF} +end; + +procedure TDataLinkTreeView.ActiveChanged; +begin + if DataSet <> nil then + begin + Filter := DataSet.Filter; + Filtered := DataSet.Filtered; + end + else + begin + Filter := ''; + Filtered := False; + end; + if FDBTreeView <> nil then + FDBTreeView.DataLinkActiveChanged; +end; + +procedure TDataLinkTreeView.DataSetChanged; +begin + if (DataSet <> nil) and ((Filter <> DataSet.Filter) + or (Filtered <> DataSet.Filtered)) then + begin + Filter := DataSet.Filter; + Filtered := DataSet.Filtered; + FDBTreeView.DataLinkActiveChanged; + end + else + FDBTreeView.DataChanged; +end; + +procedure TDataLinkTreeView.DataSetScrolled(Distance: Integer); +begin + FDBTreeView.Scroll; +end; + +procedure TDataLinkTreeView.RecordChanged(Field: TField); +begin + FDBTreeView.DataLinkRecordChanged(Field); +end; + +{TdxDBTreeNode} +constructor TdxDBTreeNode.Create(AOwner: TdxDBTreeNodes; Value: Variant); +var + i: Integer; +begin + inherited Create(AOwner.FDBTreeView.Items); + DBTreeNodes := AOwner; + + FBkColor := clWindow; + FColor := DBTreeNodes.FDBTreeView.Font.Color; + FFontStyle := DBTreeNodes.FDBTreeView.Font.Style; + FFontName := DBTreeNodes.FDBTreeView.Font.Name; + FIsCustomDraw := False; + + FKeyFieldValue := Value; + DBTreeNodes.FindNearest(Value, findex); + if findex < 0 then + findex := 0; + for i := fIndex to DBTreeNodes.FList.Count - 1 do + Inc(DBTreeNodes[i].findex); + DBTreeNodes.FList.Insert(findex, Self); +end; + +destructor TdxDBTreeNode.Destroy; +var + AKeyValue: Variant; +begin + if not DBTreeNodes.Destroying and not (csDestroying in DBTreeNodes.FDBTreeView.ComponentState) then + begin + AKeyValue := FKeyFieldValue; + with DBTreeNodes.FDBTreeView do + if (FKeyField <> nil) and (FParentField <> nil) and not DataChangedBusy + and not CNNotifyFlag and not CopyTreeNodeStructFlag and HandleAllocated then + begin + if not DBTreeNodes.FDBTreeView.DoDBAction(Self, nil, trDBDelete) then + AKeyValue := Null; + if (trSmartRecordLoad in Options) then + Self.LoadChildren(True); + end; + DBTreeNodes.FList.Remove(Self); + end + else + AKeyValue := Null; + inherited Destroy; + if not VarIsNull(AKeyValue)then + DBTreeNodes.FDBTreeView.DeleteDBNode(AKeyValue); +end; + +procedure TdxDBTreeNode.SetKeyFieldValue(Value: Variant); +var + newind, i: Integer; +begin + if FKeyFieldValue <> Value then + begin + FKeyFieldValue := Value; + DBTreeNodes.FindNearest(Value, newind); + if newind <> fIndex then + begin + if newind > fIndex then + for i := fIndex + 1 to newind do + Inc(DBTreeNodes[i].findex) + else + for i := newind to fIndex - 1 do + Dec(DBTreeNodes[i].findex); + DBTreeNodes.FList.Delete(findex); + findex := newind; + DBTreeNodes.FList.Insert(findex, Self); + end; + end; +end; + +procedure TdxDBTreeNode.SetParentFieldValue(Value: Variant); +var + DBNode: TdxDBTreeNode; +begin + if FParentFieldValue <> Value then + begin + FParentFieldValue := Value; + DBNode := DBTreeNodes.GetDBTreeNode(Value); + Self.MoveTo(DBNode, naAddChild); + end; +end; + +procedure TdxDBTreeNode.UpdateImages; +begin + with DBTreeNodes.FDBTreeView do + begin + if FKeyFieldValue <> FKeyField.Value then Exit; + if FImageIndexField <> nil then + begin + ImageIndex := 0; + if not VarIsNull(FImageIndexField.Value) then + ImageIndex := FImageIndexField.AsInteger; + end; + if FStateIndexField <> nil then + begin + StateIndex := -1; + if not VarIsNull(FStateIndexField.Value) then + StateIndex := FStateIndexField.AsInteger; + end; + end; +end; + +procedure TdxDBTreeNode.LoadChildren(Recurse: Boolean); +var + DataSet: TDataSet; + Flag, FlagDis: Boolean; + bm: TBookMark; + ASortType: TSortType; +begin + Flag := DBTreeNodes.FDBTreeView.DataChangedBusy; + DBTreeNodes.FDBTreeView.DataChangedBusy := True; + DataSet := DBTreeNodes.FDBTreeView.FDataLink.DataSet; + FlagDis := DataSet.ControlsDisabled; + if not flagDis then + DataSet.DisableControls; + bm := DataSet.GetBookmark; + HasChildren := DBTrDataSetLocate(DataSet, DBTreeNodes.FDBTreeView.FParentFieldName, KeyFieldValue, []); + if HasChildren then + while not DataSet.EOF + and VarEquals(DBTreeNodes.FDBTreeView.FParentField.Value, KeyFieldValue) do + begin + if DBTreeNodes.GetDBTreeNode(DBTreeNodes.FDBTreeView.FKeyField.Value) = nil then + DBTreeNodes.RefreshRecord; + if Recurse then + DBTreeNodes.FDBTreeView.DBSelected.LoadChildren(True); + DataSet.Next; + end; + DataSet.GotoBookmark(bm); + DataSet.FreeBookmark(bm); + if not flagDis then + DataSet.EnableControls; + DBTreeNodes.FDBTreeView.DataChangedBusy := Flag; + ASortType := DBTreeNodes.FDBTreeView.SortType; + if ASortType in [stText, stData, stBoth] then + AlphaSort; +end; + +procedure TdxDBTreeNode.SetChildLoaded(Value: Boolean); +var + flag: Boolean; +begin + if Value <> FChildLoaded then + begin + FChildLoaded := Value; + if Value then + LoadChildren(False) + else + begin + flag := HasChildren; + DeleteChildren; + HasChildren := flag; + end; + end; +end; + +procedure TdxDBTreeNode.SetIsCustomDraw(Value: Boolean); +begin + if FIsCustomDraw <> Value then + begin + FIsCustomDraw := Value; + if Value then + Inc(DBTreeNodes.FCustomDrawCount) + else + Dec(DBTreeNodes.FCustomDrawCount); + end; +end; + +{TdxDBTreeNodes} +constructor TdxDBTreeNodes.Create(ADBTreeView: TdxDBTreeView); +begin + FDBTreeView := ADBTreeView; + FList := TList.Create; + FCustomDrawCount := 0; +end; + +destructor TdxDBTreeNodes.Destroy; +begin + Destroying := True; + Clear; + FList.Free; + inherited Destroy; +end; + +procedure TdxDBTreeNodes.BeginRefreshRecord; +Var + i: Integer; +begin + for i := 0 to Count - 1 do + Items[i].Refreshed := False; +end; + +procedure TdxDBTreeNodes.EndRefreshRecord; +Var + i: Integer; +begin + i := 0; + while i < Count do + if not Items[i].Refreshed then + begin + Delete(Items[i]); + i := 0; + end + else Inc(i); +end; + +function TdxDBTreeNodes.FindNearest(Value: Variant; var Index: Integer): Boolean; +var + Min, Max: LongInt; +begin + Index := -1; + Result := False; + if (FList.Count = 0) or VarIsNull(Value) + or VarFirstMoreEx(TdxDBTreeNode(FList.List[0]).FKeyFieldValue, Value) then + Exit; + + if VarFirstMoreEx(Value, MaxKeyFieldValue) then + begin + Index := FList.Count; + Exit; + end; + + Min := 0; + Max := FList.Count - 1; + + repeat + if Max - Min = 1 then + begin + if Min = Index then Min := Max; + if Max = Index then Max := Min; + end; + Index := Min + ((Max - Min) div 2); + if VarEquals(Value, TdxDBTreeNode(FList.List[Index]).FKeyFieldValue) then + Break; + if VarFirstMore(Value, TdxDBTreeNode(FList.List[Index]).FKeyFieldValue) then + Min := Index + else + Max := Index; + until Min = Max; + if VarEquals(Value, TdxDBTreeNode(FList.List[Index]).KeyFieldValue) then + Result := True + else + if (Index < FList.Count - 1) and VarFirstMore(Value, TdxDBTreeNode(FList.List[Index]).FKeyFieldValue) then + Inc(Index); +end; + +function TdxDBTreeNodes.RefreshRecord: TdxDBTreeNode; +var + DBParentNode: TdxDBTreeNode; + AText: string; + bm: TBookMark; + FlagDis: Boolean; + OldBusyFlag: Boolean; +begin + Result := nil; + if varIsNull(FDBTreeView.FKeyField.Value) then + Exit; + OldBusyFlag := FDBTreeView.DataChangedBusy; + FDBTreeView.DataChangedBusy := True; + + AText := FDBTreeView.GetDisplayText; + Result := GetDBTreeNode(FDBTreeView.FKeyField.Value); + DBParentNode := GetDBTreeNode(FDBTreeView.FParentField.Value); + if Result = nil then + begin + if DBParentNode = nil then + Result := TdxDBTreeNode(FDBTreeView.Items.Add(nil, AText)) + else + Result := TdxDBTreeNode(FDBTreeView.Items.AddChild(DBParentNode, AText)); + end + else + begin + if (Result.Parent <> DBParentNode) and (Result <> DBParentNode) and + (Result.Parent <> nil) then + begin + if DBParentNode <> nil then + begin + Result.MoveTo(DBParentNode, naAddChild); + DBParentNode.HasChildren := True; + end + else + Result.MoveTo(nil, naAdd); + end; + if Result.Text <> AText then + Result.Text := AText; + end; + + Result.FParentFieldValue := FDBTreeView.FParentField.Value; + + if trSmartRecordLoad in FDBTreeView.Options then + begin + if trCheckHasChildren in FDBTreeView.Options then + begin + FlagDis := FDBTreeView.FDataLink.DataSet.ControlsDisabled; + if not FlagDis then + FDBTreeView.FDataLink.DataSet.DisableControls; + bm := FDBTreeView.FDataLink.DataSet.GetBookmark; + Result.HasChildren := DBTrDataSetLocate(FDBTreeView.FDataLink.DataSet, + FDBTreeView.FParentFieldName, Result.FKeyFieldValue, []); + FDBTreeView.FDataLink.DataSet.GotoBookmark(bm); + FDBTreeView.FDataLink.DataSet.FreeBookmark(bm); + if not flagDis then + FDBTreeView.FDataLink.DataSet.EnableControls; + end + else + Result.HasChildren := True; + end; + + Result.FListText := FDBTreeView.FListField.Text; + Result.UpdateImages; + Result.Refreshed := True; + if Assigned(FDBTreeView.FOnRefreshNode) then + FDBTreeView.FOnRefreshNode(FDBTreeView, Result); + + if (Count < 100) and (Count > FDBTreeView.FDataLink.BufferCount) then + FDBTreeView.FDataLink.BufferCount := Count + else + FDBTreeView.FDataLink.BufferCount := 100; + + FDBTreeView.DataChangedBusy := OldBusyFlag; +end; + +procedure TdxDBTreeNodes.RefreshParents; +var + i: Integer; + ParentNode: TTreeNode; + Node: TTreeNode; + List: TList; +begin + List := TList.Create; + try + Node := FDBTreeView.Items.GetFirstNode; + while Node <> nil do + begin + List.Add(Node); + Node := Node.GetNextSibling; + end; + + for i := 0 to List.Count - 1 do + if TdxDBTreeNode(List[i]).Refreshed then + begin + ParentNode := GetTreeNode(TdxDBTreeNode(List[i]).ParentFieldValue); + if (ParentNode <> nil) and (ParentNode <> TdxDBTreeNode(List[i])) then + begin + ParentNode.HasChildren := True; + TdxDBTreeNode(List[i]).MoveTo(ParentNode, naAddChild); + end; + end; + finally + List.Free; + end; +end; + +procedure TdxDBTreeNodes.Clear; +begin + with FDBTreeView do + begin + if HandleAllocated then + Items.BeginUpdate; + try + Items.Clear; + finally + if HandleAllocated then + Items.EndUpdate; + end; + end; + FList.Clear; +end; + +procedure TdxDBTreeNodes.Delete(ADBTreeNode: TdxDBTreeNode); +begin + if ADBTreeNode <> nil then + ADBTreeNode.Free; +end; + +function TdxDBTreeNodes.Count: Integer; +begin + Result := FList.Count; +end; + +function TdxDBTreeNodes.GetDBNodeFromIndex(Index: Integer): TdxDBTreeNode; +begin + if (Index > - 1) and (Index < Count) then + Result := TdxDBTreeNode(FList[Index]) + else + Result := nil; +end; + +function TdxDBTreeNodes.GetMaxKeyFieldValue: Variant; +begin + Result := Null; + if FList.Count > 0 then + Result := Items[FList.Count - 1].KeyFieldValue; +end; + +function TdxDBTreeNodes.GetKeyFieldValue(Value: TTreeNode): Variant; +begin + if Value = nil then + Result := Null + else + Result := TdxDBTreeNode(Value).KeyFieldValue; +end; + +function TdxDBTreeNodes.GetParentValue(Value: TTreeNode): Variant; +begin + if Value = nil then + Result := Null + else + Result := TdxDBTreeNode(Value).ParentFieldValue; +end; + +function TdxDBTreeNodes.GetDBTreeNode(Value: Variant): TdxDBTreeNode; +var + i: Integer; +begin + if FindNearest(Value, i) then + Result := Items[i] + else + Result := nil; +end; + +function TdxDBTreeNodes.GetTreeNode(Value: Variant): TTreeNode; +begin + Result := GetDBTreeNode(Value); +end; + +function TdxDBTreeNodes.IndexOf(Value: TTreeNode): Integer; +var + i: Integer; +begin + Result := -1; + if Value <> nil then + for i := 0 to Count - 1 do + if Items[i] = Value then + begin + Result := i; + Break; + end; +end; + +procedure TdxDBTreeNodes.NodeChangeParent(TreeNode: TTreeNode; Value: Variant); +var + t: TTreeNode; + Flag: Boolean; + dbtr: TdxDBTreeNode; + St: string; +begin + dbtr := TdxDBTreeNode(TreeNode); + if dbtr = nil then + Exit; + if not VarEquals(dbtr.ParentFieldValue, Value) then + dbtr.FParentFieldValue := Value; + t := GetTreeNode(Value); + if t = TreeNode.Parent then + Exit; + + Flag := FDBTreeView.DataChangedBusy; + FDBTreeView.DataChangedBusy := True; + if (t <> nil) and (dbtr <> t) then + begin + TreeNode.Focused := False; + if trSmartRecordLoad in FDBTreeView.Options then + TdxDBTreeNode(t).ChildLoaded := True; + t.HasChildren := True; + TreeNode.MoveTo(t, naAddChild); + end + else + TreeNode.MoveTo(nil, naAdd); + St := fDBTreeView.GetDisplayText; + if TreeNode.Text <> St then + TreeNode.Text := St; + FDBTreeView.DataChangedBusy := Flag; + FDBTreeView.Repaint; +end; + +{TdxDBTreeView} +constructor TdxDBTreeView.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FRootValue := NULL; + FDataLink := TDataLinkTreeView.Create; + FDataLink.FDBTreeView := Self; + FDBTreeNodes := TdxDBTreeNodes.Create(Self); + {$IFDEF DELPHI6} + FEditInstance := Classes.MakeObjectInstance(EditWndProc); + {$ELSE} + FEditInstance := MakeObjectInstance(EditWndProc); + {$ENDIF} + CNNotifyFlag := False; + + FDisplayFields := TList.Create; + FSeparatedSt := ' - '; + Options := [trDBCanDelete, trDBConfirmDelete, trCanDBNavigate, + trSmartRecordCopy, trCheckHasChildren]; + FRaiseOnError := True; +end; + +destructor TdxDBTreeView.Destroy; +begin + {$IFDEF DELPHI6} + Classes.FreeObjectInstance(FEditInstance); + {$ELSE} + FreeObjectInstance(FEditInstance); + {$ENDIF} + FDisplayFields.Free; + FDBTreeNodes.Free; + FDataLink.FDBTreeView := nil; + FDataLink.Free; + FDataLink := nil; + inherited Destroy; +end; + +function TdxDBTreeView.DoDBAction(DBNode1, DBNode2: TdxDBTreeNode; Action: TdxDBTreeViewAction): Boolean; +begin + Result := True; + if Assigned(FOnDBAction) then + FOnDBAction(Self, DBNode1, DBNode2, Action, Result); +end; + +function TdxDBTreeView.GetImageIndexField: TField; +begin + Result := FImageIndexField; +end; + +function TdxDBTreeView.GetKeyField: TField; +begin + Result := FKeyField; +end; + +function TdxDBTreeView.GetListField: TField; +begin + Result := FListField; +end; + +function TdxDBTreeView.GetParentField: TField; +begin + Result := FParentField; +end; + +function TdxDBTreeView.GetStateIndexField: TField; +begin + Result := FStateIndexField; +end; + +procedure TdxDBTreeView.GotoKeyFieldValue(Value: Variant); +var + TreeNode: TTreeNode; + PValue: PVariant; + List: TList; + bm: TBookmark; + i: Integer; + FlagDis, FlagValueExist: Boolean; +begin + if VarIsNull(Value) then + Exit; + + TreeNode := FDBTreeNodes.GetTreeNode(Value); + if TreeNode <> nil then + begin + TreeNode.MakeVisible; + Selected := TreeNode; + end + else + if (trSmartRecordLoad in Options) and not DataChangedBusy then + begin + DataChangedBusy := True; + + if not (VarEquals(FKeyField.Value, Value)) then + FlagValueExist := DBTrDataSetLocate(FDataLink.DataSet, FKeyFieldName, Value, []) + else + FlagValueExist := True; + + if FlagValueExist then + begin + List := TList.Create; + bm := FDataLink.DataSet.GetBookmark; + FlagDis := FDataLink.DataSet.ControlsDisabled; + + if not flagDis then + FDataLink.DataSet.DisableControls; + + while (TreeNode = nil) do + if DBTrDataSetLocate(FDBTreeNodes.FDBTreeView.FDataLink.DataSet, FKeyFieldName, FParentField.Value, []) + and not (VarEquals(FKeyField.Value, FParentField.Value)) then + begin + New(PValue); + PValue^ := FKeyField.Value; + List.Add(PValue); + TreeNode := FDBTreeNodes.GetTreeNode(PValue^); + end + else + Break; + if TreeNode = nil then + begin + DBTreeNodes.RefreshRecord; + TreeNode := DBSelected; + DBSelected.ChildLoaded := True; + end; + if TreeNode <> nil then + for i := List.Count - 1 downto 0 do + begin + PValue := List[i]; + DBTrDataSetLocate(FDataLink.DataSet, FKeyFieldName, PValue^, []); + DBSelected.ChildLoaded := True; + end; + GotoKeyFieldValue(Value); + if not flagDis then + FDataLink.DataSet.EnableControls; + FDataLink.DataSet.GotoBookmark(bm); + FDataLink.DataSet.FreeBookmark(bm); + for i := 0 to List.Count - 1 do + Dispose(PVariant(List[i])); + List.Free; + end; + + DataChangedBusy := False; + end; +end; + +procedure TdxDBTreeView.CreateHandle; +var + Flag: Boolean; +begin + Flag := DataChangedBusy; + DataChangedBusy := True; + inherited CreateHandle; + DataChangedBusy := Flag; +end; + +procedure TdxDBTreeView.CreateWnd; +begin + inherited CreateWnd; + RefreshItems; +end; + +procedure TdxDBTreeView.DestroyWnd; +var + Flag: Boolean; +begin + Flag := DataChangedBusy; + DataChangedBusy := True; + DBTreeNodes.Clear; + inherited DestroyWnd; + DataChangedBusy := Flag; +end; + +procedure TdxDBTreeView.InsertTreeNode(Node, Parent: TdxDBTreeNode); +var + Flag, FlagDis: Boolean; + St: string; +begin + + PostMessage(Handle, WM_UPDATEIMAGES, Integer(Node), 0); + + Flag := DataChangedBusy; + DataChangedBusy := True; + Node.IsInserting := False; + if not DoDBAction(Node, Parent, trDBInsert) then + begin + DataChangedBusy := flag; + Exit; + end; + + FlagDis := FDataLink.DataSet.ControlsDisabled; + + if not flagDis then + FdataLink.DataSet.DisableControls; + + try + if Parent <> nil then + begin + if trSmartRecordLoad in FOptions then + Parent.ChildLoaded := True; + Node.FParentFieldValue := Parent.KeyFieldValue; + end + else + begin + if not VarIsNull(FRootValue) then + Node.FParentFieldValue := FRootValue + else + Node.FParentFieldValue := Node.FKeyFieldValue; + end; + FdataLink.DataSet.Append; + FParentField.Value := node.FParentFieldValue; + if (FListField <> FKeyField) and (FListField <> FParentField) then + FListField.Text := Node.Text; + if FListField.IsNull then + FListField.Text := ' '; + if not (FKeyField is TAutoIncField) then + begin + if VarIsNull(FKeyField.Value) then + FKeyField.Value := Node.FKeyFieldValue + else + Node.SetKeyFieldValue(FKeyField.Value); + end; + FDataLink.DataSet.Post; + if FKeyField is TAutoIncField then + Node.SetKeyFieldValue(FKeyField.Value); + St := GetDisplayText; + if Node.Text <> St then + Node.Text := St; + + if Assigned(FAddNewItem) then + FAddNewItem(nil, Node); + if not flagDis then + FDataLink.DataSet.EnableControls; + DataChangedBusy := Flag; + Selected := Node; + Node.MakeVisible; + except + DataChangedBusy := True; + {$IFNDEF DELPHI5} + TreeView_DeleteItem(Handle, Node.ItemId); + DataChangedBusy := Flag; + {$ENDIF} + if not flagDis then + FDataLink.DataSet.EnableControls; + {$IFDEF DELPHI5} + DataChangedBusy := Flag; + {$ENDIF} + if Assigned(FOnInsertNodeError) then + FOnInsertNodeError(Self) + else + if FRaiseOnError then + raise; + end; +end; + +procedure TdxDBTreeView.SetNewTreeNodeParent(Node, NewParent: TdxDBTreeNode); +var + Flag, FlagDis: Boolean; + KeyValue: Variant; + St: string; +begin + Flag := DataChangedBusy; + DataChangedBusy := True; + + if not DoDBAction(Node, NewParent, trDBChangeParent) then + begin + DataChangedBusy := flag; + Exit; + end; + + FlagDis := FDataLink.DataSet.ControlsDisabled; + if not flagDis then + FdataLink.DataSet.DisableControls; + if NewParent <> nil then + node.FParentFieldValue := NewParent.FKeyFieldValue + else + begin + if (trSmartRecordLoad in FOptions) and not VarIsNull(FRootValue) then + Node.FParentFieldValue := FRootValue + else + Node.FParentFieldValue := Node.FKeyFieldValue; + end; + if not VarEquals(FKeyField.Value, Node.FKeyFieldValue) then + begin + KeyValue := FKeyField.Value; + DBTrDataSetLocate(FDataLink.DataSet, FKeyFieldName, Node.FKeyFieldValue, []); + end + else + KeyValue := NULL; + FDataLink.DataSet.Edit; + FParentField.Value := Node.FParentFieldValue; + FdataLink.DataSet.Post; + + St := GetDisplayText; + if Node.Text <> St then + Node.Text := St; + + if not VarIsNULL(KeyValue) then + DBTrDataSetLocate(FDataLink.DataSet, FKeyFieldName, KeyValue, []); + if not flagDis then + FDataLink.DataSet.EnableControls; + DataChangedBusy := Flag; +end; + +function TdxDBTreeView.CreateNode: TTreeNode; +begin + if (FKeyField <> nil) and (FParentField <> nil) then + begin + if DataChangedBusy then + Result := TdxDBTreeNode.Create(FDBTreeNodes, FKeyField.Value) + else + begin + Result := TdxDBTreeNode.Create(FDBTreeNodes, GetNextMaxKeyValue); + TdxDBTreeNode(Result).IsInserting := True; + end; + if (Result <> nil) and (SelectedIndex <> -1) then + Result.SelectedIndex := SelectedIndex; + end + else + Result := nil; +end; + +procedure TdxDBTreeView.Change(Node: TTreeNode); +var + V: Variant; + tr, tr1: TTreenode; + Flag: Boolean; +begin + if Node = nil then + Exit; + if DataChangedBusy then + begin + inherited; + Exit; + end; + DataChangedBusy := True; + if FKeyField <> nil then + begin + V := FDBTreeNodes.GetKeyFieldValue(Node); + if not VarIsNull(V) and (VarType(V) <> varEmpty) + and not VarEquals(FKeyField.Value, V) + and (dsInsert <> FKeyField.DataSet.State) + and not ((FdataLink.DataSet.EOF) and (FdataLink.DataSet.BOF)) then + begin + Flag := FDataLink.DataSet.State = dsEdit; + tr1 := nil; + if Flag then + begin + tr := DBTreeNodes.GetTreeNode(FKeyField.Value); + if tr <> Selected then + begin + SendMessage(Handle, WM_SETREDRAW, Integer(False), 0); + tr1 := Selected; + Selected := tr; + end + else + Flag := False; + end; + try + DBTrDataSetLocate(FdataLink.DataSet, FKeyFieldName, V, []); + except + end; + if Flag then + begin + Selected := tr1; + SendMessage(Handle, WM_SETREDRAW, Integer(True), 0); + end; + end; + end; + DataChangedBusy := False; + inherited; +end; + +procedure TdxDBTreeView.Edit(const Item: TTVItem); +var + Flag: Boolean; +begin + inherited; + if (FListField <> nil) and (FDisplayFields.Count > 0) then + begin + Flag := DataChangedBusy; + DataChangedBusy := True; + if (not ReadOnly) and (FListField.DataSet <> nil) and (Selected <> nil) + and ((FListField.DataSet.State = dsEdit) or (FListField.DataSet.State = dsInsert)) and + (FListField.Text <> Selected.Text) then + FListField.Text := Selected.Text + else + if Selected.Text <> FListField.Text then + Selected.Text := FListField.Text; + if (Selected <> nil) and (Selected.Text <> GetDisplayText) then + Selected.Text := GetDisplayText; + DataChangedBusy := Flag; + end; +end; + +procedure TdxDBTreeView.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (FDataLink <> nil) and (AComponent = DataSource) then + DataSource := nil; +end; + +procedure TdxDBTreeView.RefreshItems; +var + bm: TBookMark; + i: Integer; + FlagDis: Boolean; + OldSortType: TSortType; +begin + DataChangedBusy := True; + + if (FKeyField <> nil) and (FListField <> nil) and (FParentField <> nil) then + begin + Items.BeginUpdate; + DBTreeNodes.BeginRefreshRecord; + OldSortType := SortType; + SortType := stNone; + FlagDis := FDataLink.DataSet.ControlsDisabled; + if not flagDis then + FDataLink.DataSet.DisableControls; + bm := FDataLink.DataSet.GetBookmark; + if not (trSmartRecordLoad in Options) then + begin + i := mrNo; + if (csDesigning in ComponentState) and (FDataLink.DataSet.RecordCount > 999) then + i := MessageDlg(dxDBTreeViewSmartLoadS, mtConfirmation, [mbYes, mbNo], 0); + if i = mrNo then + begin + FDataLink.DataSet.First; + while not FDataLink.DataSet.EOF do + begin + FDBTreeNodes.RefreshRecord; + FDataLink.DataSet.Next; + end; + end; + end + else + begin + if FDBTreeNodes.Count > 0 then + begin + for i := 0 to FDBTreeNodes.Count - 1 do + begin + FDBTreeNodes[i].FChildLoaded := False; + if not (VarEquals(FKeyField.Value, FDBTreeNodes[i].FKeyFieldValue)) then + DBTrDataSetLocate(FDataLink.DataSet, FKeyFieldName, FDBTreeNodes[i].FKeyFieldValue, []); + FDBTreeNodes.RefreshRecord; + FDataLink.DataSet.Next; + end; + end + else + FDataLink.DataSet.First; + if DBTrDataSetLocate(FDataLink.DataSet, FParentFieldName, FRootValue, []) then + while (not FDataLink.DataSet.EOF) and VarEquals(FParentField.Value, FRootValue) do begin + FDBTreeNodes.RefreshRecord; + FDataLink.DataSet.Next; + end; + end; + FDataLink.DataSet.GotoBookmark(bm); + FDataLink.DataSet.FreeBookmark(bm); + if not flagDis then + FDataLink.DataSet.EnableControls; + FDBTreeNodes.RefreshParents; + DBTreeNodes.EndRefreshRecord; + Items.EndUpdate; + SortType := OldSortType; + end + else + DBTreeNodes.Clear; + + Scroll; + DataChangedBusy := False; +end; + +procedure TdxDBTreeView.AssignFields; + + function IsIntegerField(AField: TField): Boolean; + begin + Result := AField.DataType in [ftSmallint, ftInteger, ftWord, ftFloat, ftCurrency, ftAutoInc]; + end; + +begin + FDisplayFields.Clear; + if FDataLink.Active then + begin + if FKeyFieldName <> '' then + FKeyField := FDataLink.DataSet.FieldByName(FKeyFieldName); + if FListFieldName <> '' then + FListField := FDataLink.DataSet.FieldByName(FListFieldName); + if FParentFieldName <> '' then + FParentField := FDataLink.DataSet.FieldByName(FParentFieldName); + if FImageIndexFieldName <> '' then + begin + FImageIndexField := FDataLink.DataSet.FieldByName(FImageIndexFieldName); + if (FImageIndexField <> nil) and not IsIntegerField(FImageIndexField) then + FImageIndexField := nil; + end; + if FStateIndexFieldName <> '' then + begin + FStateIndexField := FDataLink.DataSet.FieldByName(FStateIndexFieldName); + if (FStateIndexField <> nil) and not IsIntegerField(FStateIndexField) then + FStateIndexField := nil; + end; + + FDataLink.DataSet.GetFieldList(FDisplayFields, FDisplayFieldName); + end; +end; + +procedure TdxDBTreeView.DataLinkActiveChanged; +begin + FKeyField := nil; + FListField := nil; + FParentField := nil; + FImageIndexField := nil; + FStateIndexField := nil; + + FDisplayFields.Clear; + AssignFields; + if (FKeyField <> nil) and not VarIsNull(FRootValue) then + case FKeyField.DataType of + ftSmallint: VarCast(FRootValue, FRootValue, varSmallint); + ftInteger, ftWord, ftAutoInc: VarCast(FRootValue, FRootValue, varInteger); + ftFloat, ftCurrency: VarCast(FRootValue, FRootValue, varDouble); + else + VarCast(FRootValue, FRootValue, varString); + end; + + if HandleAllocated then + RefreshItems; +end; + +procedure TdxDBTreeView.DataLinkRecordChanged(Field: TField); +begin + if (Field <> nil) and (Field.DataSet <> nil) then + case Field.DataSet.State of + dsEdit: RecordEdit(Field); + dsInsert: RecordInsert(Field); + end; +end; + +function TdxDBTreeView.GetDataSource: TDataSource; +begin + Result := FDataLink.DataSource; +end; + +{$IFNDEF DELPHI6} +function TdxDBTreeView.GetRootValue: string; +begin + if VarIsNull(FRootValue) then + Result := '' + else + Result := string(FRootValue); +end; +{$ENDIF} + +function TdxDBTreeView.GetSeletectedDBTreeNode: TdxDBTreeNode; +begin + Result := nil; + if (FKeyField <> nil) and (FKeyField.Value <> NULL) then + Result := FDBTreeNodes.GetDBTreeNode(FKeyField.Value); +end; + +procedure TdxDBTreeView.Scroll; +begin + if not (trCanDBNavigate in Options) then + Exit; + if FKeyField <> nil then + GotoKeyFieldValue(FKeyField.Value); +end; + +procedure TdxDBTreeView.SetDataSource(Value: TDataSource); +begin + FDataLink.DataSource := Value; + if Value <> nil then + Value.FreeNotification(Self); +end; + +procedure TdxDBTreeView.SetDisplayFieldName(const Value: string); +begin + if FDisplayFieldName <> Value then + begin + FDisplayFieldName := Value; + DataLinkActiveChanged; + end; +end; + +procedure TdxDBTreeView.SetImageIndexFieldName(const Value: string); +begin + if FImageIndexFieldName <> Value then + begin + FImageIndexFieldName := Value; + DataLinkActiveChanged; + end; +end; + +procedure TdxDBTreeView.SetKeyFieldName(const Value: string); +begin + if FKeyFieldName <> Value then + begin + FKeyFieldName := Value; + DataLinkActiveChanged; + end; +end; + +procedure TdxDBTreeView.SetListFieldName(const Value: string); +begin + if FListFieldName <> Value then + begin + FListFieldName := Value; + DataLinkActiveChanged; + end; +end; + +procedure TdxDBTreeView.SetStateIndexFieldName(const Value: string); +begin + if FStateIndexFieldName <> Value then + begin + FStateIndexFieldName := Value; + DataLinkActiveChanged; + end; +end; + +procedure TdxDBTreeView.SetOptions(const Value: TdxDBTreeViewOptions); +begin + if Value <> FOptions then + begin + FOptions := Value; + inherited Options := []; + if trDBCanDelete in FOptions then + inherited Options := inherited Options + [trCanDelete]; + if trDBConfirmDelete in FOptions then + inherited Options := inherited Options + [trConfirmDelete]; + RefreshItems; + end; +end; + +procedure TdxDBTreeView.SetParentFieldName(const Value: string); +begin + if FParentFieldName <> Value then + begin + FParentFieldName := Value; + DataLinkActiveChanged; + end; +end; + +procedure TdxDBTreeView.SetRootValue(const Value: {$IFNDEF DELPHI6}string{$ELSE}Variant{$ENDIF}); +var +{$IFNDEF DELPHI6} + V: Variant; +{$ENDIF} + OldFlag: Boolean; +begin +{$IFNDEF DELPHI6} + V := Value; + if not VarIsNull(FRootValue) then + try + FRootValue := VarAsType(V, VarType(FRootValue)) + except + FRootValue := Null; + end + else + FRootValue := V; +{$ELSE} + FRootValue := Value; +{$ENDIF} + if trSmartRecordLoad in FOptions then + begin + OldFlag := DataChangedBusy; + DataChangedBusy := True; + Items.Clear; + DataLinkActiveChanged; + DataChangedBusy := OldFlag; + end; +end; + +procedure TdxDBTreeView.SetSeparatedSt(const Value: string); +begin + if FSeparatedSt <> Value then + begin + FSeparatedSt := Value; + if FDisplayFields.Count > 0 then + DataLinkActiveChanged; + end; +end; + +procedure TdxDBTreeView.DataChanged; +begin + if DataChangedBusy or not HandleAllocated or (FDataLink.DataSet.State = dsInsert) + or (FDataLink.DataSet.State = dsEdit) then + Exit; + if IsEditing and (Selected <> nil) then + Selected.EndEdit(True); + AssignFields; + RefreshItems; + Scroll; +end; + +function TdxDBTreeView.GetDisplayText: string; +var + i: Integer; +begin + Result := ''; + if FDisplayFields.Count > 0 then + begin + for i := 0 to FDisplayFields.Count - 1 do + begin + if i > 0 then + Result := Result + FSeparatedSt; + Result := Result + TField(FDisplayFields[i]).Text; + end; + end + else + if FListField <> nil then + Result := FListField.Text; + if Assigned(FOnSetDisplayItemText) then + FOnSetDisplayItemText(Self, Result); +end; + +var + RecordEditFlag: Boolean; + +procedure TdxDBTreeView.RecordEdit(Field: TField); +var + TreeNode: TTreeNode; + V: Variant; + flag: Boolean; + + procedure RepaintNode(ANode: TTreeNode); + var + R: TRect; + begin + if HandleAllocated and (ANode <> nil) and ANode.IsVisible then + begin + R := ANode.DisplayRect(False); + InvalidateRect(Handle, @R, False); + end; + end; + +begin + if RecordEditFlag then Exit; + if FKeyField <> nil then + begin + TreeNode := Selected; + if TreeNode = nil then + Exit; + + if (Field = FListField) and (TreeNode.Text <> Field.Text ) then + TreeNode.Text := Field.Text; + + if FImageIndexField = Field then + begin + if not VarIsNull(FImageIndexField.Value) then + TreeNode.ImageIndex := FImageIndexField.AsInteger + else + TreeNode.ImageIndex := -1; + RepaintNode(TreeNode); + end; + + if FStateIndexField = Field then + begin + if not VarIsNull(FStateIndexField.Value) then + TreeNode.StateIndex := FStateIndexField.AsInteger + else + TreeNode.StateIndex := -1; + RepaintNode(TreeNode); + end; + + if Field = FParentField then + begin + V := FDBTreeNodes.GetParentValue(TreeNode); + if not VarIsNull(Field.Value) and not VarIsNull(V) and + not VarEquals(Field.Value, V) then + begin + try + if trSmartRecordLoad in FOptions then + begin + RecordEditFlag := True; + flag := DataChangedBusy; + DataChangedBusy := True; + FDataLink.DataSet.Post; + DataChangedBusy := flag; + end; + FDBTreeNodes.NodeChangeParent(TreeNode, Field.Value); + except + Field.Value := V; + end; + RecordEditFlag := False; + end; + end; + end; +end; + +procedure TdxDBTreeView.RecordInsert(Field: TField); +var + DBTreeNode: TdxDBTreeNode; +begin + if (FKeyField <> nil) and (FKeyField.Value <> NULL) then + begin + if not DataChangedBusy then + FDBTreeNodes.RefreshRecord; + DBTreeNode := DBSelected; + if DBTreeNode <> nil then + begin + Selected := DBTreeNode; + if Selected <> nil then + Selected.MakeVisible; + end; + if (DBTreeNode <> nil) and (DBTreeNode.ParentFieldValue <> NULL) and + Assigned(FAddNewItem) then + FAddNewItem(nil, DBTreeNode); + end; +end; + +procedure TdxDBTreeView.FrameSelectedItem; +var + Rect: TRect; + DC: HDC; + wnd: HWND; + C1, C2, OldColor: TColor; + AHandle: HFont; + ASize: TSize; +const + TextOffset = 2; +begin + if not Focused and not DataChangedBusy and (Selected <> nil) then + begin + if HandleAllocated then + DoCustomDraw(Selected, Font, C1, C2); + TreeView_GetItemRect(Selected.Handle, Selected.ItemId, Rect, true); + Wnd := handle; + DC := GetDeviceContext(Wnd); + AHandle := SelectObject(DC, Font.Handle); + GetTextExtentPoint(DC, PChar(Selected.Text), Length(Selected.Text), ASize); + SelectObject(DC, AHandle); + Rect.Right := Rect.Left + ASize.cx + TextOffset * 2; + OldColor := Brush.Color; + Brush.Color := Font.Color; + FrameRect(DC, Rect, Brush.Handle); + Brush.Color := OldColor; + ReleaseDC(Wnd, DC); + end; +end; + +procedure TdxDBTreeView.DeleteDBNode(AKeyValue: Variant); +var + flag, FlagDis: Boolean; +begin + if (FKeyField = nil) or (FParentField = nil) or DataChangedBusy or CNNotifyFlag + or CopyTreeNodeStructFlag or not HandleAllocated then + Exit; + + FlagDis := FDataLink.DataSet.ControlsDisabled; + if not flagDis then + FDataLink.DataSet.DisableControls; + if not (FDataLink.DataSet.EOF and FDataLink.DataSet.BOF) then + begin + try + flag := DBTrDataSetLocate(FdataLink.DataSet, FKeyFieldName, AKeyValue, []); + except + flag := False; + end; + if flag and VarEquals(AKeyValue, FKeyField.Value) then + FDataLink.DataSet.Delete; + end; + + DataChangedBusy := True; + if not flagDis then + FDataLink.DataSet.EnableControls; + DataChangedBusy := False; + Change(Selected); +end; + +procedure TdxDBTreeView.DoCustomDraw(TreeNode: TTreeNode; AFont: TFont; + var AColor, ABkColor: TColor); +begin + if Assigned(OnCustomDraw) then + inherited DoCustomDraw(TreeNode, AFont, AColor, ABkColor) + else + begin + if TdxDBTreeNode(TreeNode).IsCustomDraw then + with TdxDBTreeNode(TreeNode) do + begin + AFont.Style := FontStyle; + AFont.Name := FontName; + AColor := Color; + ABkColor := BkColor; + end; + end; +end; + +procedure TdxDBTreeView.GetNodeStructure(TreeNode: TTreeNode; List: TList); +begin + if (trSmartRecordLoad in FOptions) and CopyTreeNodeStructFlag then + TdxDBTreeNode(TreeNode).LoadChildren(True); + inherited GetNodeStructure(TreeNode, List); +end; + +type + TInsertFieldStruct = class + private + Buffer: Pointer; + {$IFNDEF DELPHI3} + Stream: TBlobStream; + {$ELSE} + Stream: TStream; + {$ENDIF} + FieldName: string; + public + constructor Create(Size: Integer); + destructor Destroy; override; + end; + +constructor TInsertFieldStruct.Create(Size: Integer); +begin + inherited Create; + GetMem(Buffer, Size); +end; + +destructor TInsertFieldStruct.Destroy; +begin + FreeMem(Buffer); + if Stream <> nil then + Stream.Free; + inherited Destroy; +end; + +function TdxDBTreeView.GetNextMaxKeyValue: Variant; +begin + Result := DBTreeNodes.MaxKeyFieldValue; + if Assigned(FCreateNewKeyValue) then + FCreateNewKeyValue(nil, Result) + else + try + if not VarIsNULL(Result) then + Result := Result + 1 + else + Result := 0; + except + end; +end; + +procedure TdxDBTreeView.InsertTreeNodeStructure(ListS, ListD: TList; Flag: Boolean); +var + i, index: Integer; + MaxKeyFieldValue: Variant; + tr, tr1: TTreeNode; + dbtr, dbtr1: TdxDBTreeNode; + ifs: TInsertFieldStruct; + List: TList; + FlagBuzy, FlagDis: Boolean; + sDBTreeView: TdxDBTreeView; + sDBTreeKeyValue: Variant; + FCopiedFields: TList; + {$IFDEF DELPHI3} + AStream: TStream; + {$ENDIF} + + function IsBlobField(AField: TField): Boolean; + begin + Result := AField is TBlobField; + end; + +begin + if (ListS.Count > 0) and (TTreeNode(ListS[0]).TreeView is TdxDBTreeView) then + sDBTreeView := TdxDBTreeView(TTreeNode(ListS[0]).TreeView) + else + sDBTreeView := nil; + FlagBuzy := DataChangedBusy; + DataChangedBusy := True; + + if not DoDBAction(TdxDBTreeNode(ListS[0]), TdxDBTreeNode(ListD[0]), trDBMove) then + begin + DataChangedBusy := FlagBuzy; + Exit; + end; + + FlagDis := FDataLink.DataSet.ControlsDisabled; + if not flagDis then + FdataLink.DataSet.DisableControls; + if (ListD.Count > 0) and (trSmartRecordLoad in FOptions) then + begin + tr := TTreeNode(ListD[0]); + if (tr <> nil) and (tr.Parent <> nil) then + TdxDBTreeNode(tr.Parent).ChildLoaded := True; + end; + sDBTreeKeyValue := varNull; + FCopiedFields := TList.Create; + if Flag and (trSmartRecordCopy in FOptions) and (ListS.Count > 0) and (sDBTreeView <> nil) then + begin + sDBTreeKeyValue := sDBTreeView.FKeyField.Value; + for index := 0 to sDBTreeView.FDataLink.DataSet.FieldCount - 1 do + if (CompareText(sDBTreeView.FDataLink.DataSet.Fields[index].FieldName, FKeyFieldName) <> 0) + and (CompareText(sDBTreeView.FDataLink.DataSet.Fields[index].FieldName, FParentFieldName) <> 0) + and (FDataLink.DataSet.FindField(sDBTreeView.FDataLink.DataSet.Fields[index].FieldName) <> nil) then + FCopiedFields.Add(sDBTreeView.FDataLink.DataSet.Fields[index]); + end; + + MaxKeyFieldValue := DBTreeNodes.MaxKeyFieldValue; + for i := 0 to ListD.Count - 1 do + begin + tr := TTreeNode(ListD[i]); + dbtr := TdxDBTreeNode(TTreeNode(ListD[i])); + if tr.Parent <> nil then + dbtr.FParentFieldValue := DBTreeNodes.GetKeyFieldValue(tr.Parent) + else + if not VarIsNull(FRootValue) or (trSmartRecordLoad in FOptions) then + dbtr.FParentFieldValue := FRootValue + else + dbtr.FParentFieldValue := dbtr.FKeyFieldValue; + dbtr := TdxDBTreeNode(tr); + if (FDisplayFields.Count > 0) and (sDBTreeView = Self) then + begin + tr1 := TTreeNode(ListS[i]); + if tr1 <> nil then + begin + DBTrDataSetLocate(FDataLink.DataSet, FKeyFieldName, TdxDBTreeNode(tr1).FKeyFieldValue, []); + tr.Text := FListField.Text; + end; + end; + FDataLink.DataSet.Append; + FParentField.Value := dbtr.FParentFieldValue; + if (FListField <> FKeyField) and (FListField <> FParentField) then + FListField.Value := tr.Text; + + if FKeyField.DataType <> ftAutoInc then + FKeyField.Value := dbtr.FKeyFieldValue; + FDataLink.DataSet.Post; + if (FKeyField.DataType = ftAutoInc) and not FKeyField.IsNull then + dbtr.FKeyFieldValue := FKeyField.Value; + + if FCopiedFields.Count > 0 then + begin + tr1 := TTreeNode(ListS[i]); + List := TList.Create; + if tr1 <> nil then + begin + dbtr1 := TdxDBTreeNode(tr1); + if sDBTreeView <> Self then + sDBTreeView.DataChangedBusy := True; + DBTrDataSetLocate(sDBTreeView.FDataLink.DataSet, sDBTreeView.FKeyFieldName, + dbtr1.FKeyFieldValue, []); + if sDBTreeView <> Self then + sDBTreeView.DataChangedBusy := False; + for index := 0 to FCopiedFields.Count - 1 do + begin + ifs := TInsertFieldStruct.Create(TField(FCopiedFields[Index]).DataSize + 1); + try + ifs.Stream := nil; + if IsBlobField(TField(FCopiedFields[Index])) then + begin + {$IFNDEF DELPHI3} + ifs.Stream := TBlobStream.Create(TBlobField(FCopiedFields[Index]), bmRead); + {$ELSE} + AStream := sDBTreeView.FDataLink.DataSet.CreateBlobStream(TField(FCopiedFields[Index]), bmRead); + ifs.Stream := TMemoryStream.Create; + ifs.Stream.CopyFrom(AStream, AStream.Size); + AStream.Free; + {$ENDIF} + ifs.FieldName := TField(FCopiedFields[Index]).FieldName; + List.Add(ifs); + end + else + if TField(FCopiedFields[Index]).GetData(ifs.Buffer) then + begin + ifs.FieldName := TField(FCopiedFields[Index]).FieldName; + List.Add(ifs) + end + else + ifs.Free; + except + ifs.Free; + end; + end; + end; + + if List.Count > 0 then + try + DBTrDataSetLocate(FDataLink.DataSet, FKeyFieldName, dbtr.FKeyFieldValue, []); + FDataLink.DataSet.Edit; + for index := 0 to List.Count - 1 do + begin + ifs := TInsertFieldStruct(List[index]); + try + if ifs.Stream <> nil then + {$IFNDEF DELPHI3} + TBlobField(FDataLink.DataSet.FindField(ifs.FieldName)).LoadFromStream(ifs.Stream) + {$ELSE} + begin + AStream := FDataLink.DataSet.CreateBlobStream(FDataLink.DataSet.FindField(ifs.FieldName), bmWrite); + ifs.Stream.Position := 0; + AStream.CopyFrom(ifs.Stream, ifs.Stream.Size); + AStream.Free; + end + {$ENDIF} + else FDataLink.DataSet.FindField(ifs.FieldName).SetData(ifs.Buffer); + except + end; + end; + FDataLink.DataSet.Post; + except + end; + while List.Count > 0 do + begin + ifs := TInsertFieldStruct(List[0]); + List.Remove(ifs); + ifs.Free; + end; + List.Free; + end; + + tr.Text := GetDisplayText; + if Assigned(FAddNewItem) then + FAddNewItem(nil, dbtr); + end; + tr := TTreeNode(ListD[0]); + if (tr <> nil) and (tr.Parent <> nil) then + DBTrDataSetLocate(FDataLink.DataSet, FKeyFieldName, + TdxDBTreeNode(tr.Parent).FKeyFieldValue, []); + + if (sDBTreeView <> nil) and (sDBTreeView <> Self) then + begin + sDBTreeView.DataChangedBusy := True; + DBTrDataSetLocate(sDBTreeView.FDataLink.DataSet, sDBTreeView.FKeyFieldName, + sDBTreeKeyValue, []); + sDBTreeView.DataChangedBusy := False; + end; + + FCopiedFields.Free; + + if not flagDis then + FdataLink.DataSet.EnableControls; + DataChangedBusy := FlagBuzy; +end; + +function TdxDBTreeView.IsCustomDraw: Boolean; +begin + Result := (inherited IsCustomDraw) or (DBTreeNodes.FCustomDrawCount > 0); +end; + +function TdxDBTreeView.GetListItemText(TreeNode: TTreeNode): string; +begin + if FDisplayFields.Count > 0 then + Result := TdxDBTreeNode(TreeNode).FListText + else + Result := inherited GetListItemText(TreeNode); +end; + +procedure TdxDBTreeView.DoCNNotify(var Message: TWMNotify); +var + TreeNode: TTreeNode; + dbtr: TdxDBTreeNode; + OldCNNotifyFlag: Boolean; +begin + if trSmartRecordLoad in FOptions then + with Message.NMHdr^, PNMTreeView(Pointer(Message.NMHdr))^do + begin + if (code = TVN_ITEMEXPANDING) and (Action = TVE_EXPAND) then + begin + dbtr := TdxDBTreeNode(GetNodeFromItem(ItemNew)); + if dbtr <> nil then + begin + if CanExpand(dbtr) then + dbtr.ChildLoaded := True + else + Message.Result := 1; + end; + Exit; + end; + if (code = TVN_ITEMEXPANDED) and (action = TVE_COLLAPSE) then + begin + inherited; + dbtr := TdxDBTreeNode(GetNodeFromItem(ItemNew)); + if dbtr <> nil then + begin + OldCNNotifyFlag := CNNotifyFlag; + CNNotifyFlag := True; + dbtr.ChildLoaded := False; + CNNotifyFlag := OldCNNotifyFlag; + end; + Exit; + end; + end; + + with Message.NMHdr^ do + begin + if (code = TVN_BEGINLABELEDIT) and (FListField <> nil) then + begin + with PTVDispInfo(Pointer(Message.NMHdr))^do + TreeNode := GetNodeFromItem(item); + if TreeNode.Text <> FListField.Text then + begin + TreeNode.Text := FListField.Text; + SendMessage(TreeView_GetEditControl(handle), WM_SETTEXT, 0, Integer(PChar(TreeNode.Text))); + end; + if FDataLink.DataSet.CanModify then + FDataLink.Edit; + FEditHandle := TreeView_GetEditControl(Handle); + SendMessage(FEditHandle, EM_SETLIMITTEXT, FListField.DisplayWidth, 0); + FDefEditProc := Pointer(GetWindowLong(FEditHandle, GWL_WNDPROC)); + SetWindowLong(FEditHandle, GWL_WNDPROC, Integer(FEditInstance)); + end; + end; +end; + +procedure TdxDBTreeView.DoVMInsertItem(var Message: TMessage); +var + tn, oldtnp, newtnp: TTreeNode; + str: TTVInsertStruct; +begin + if not DataChangedBusy then + begin + tn := Items.GetNode(HTreeItem(Message.Result)); + if tn <> nil then + begin + str := PTVInsertStruct(Message.lParam)^; + newtnp := Items.GetNode(str.hparent); + if TdxDBTreeNode(tn).IsInserting then + begin + if not CopyTreeNodeStructFlag then + InsertTreeNode(TdxDBTreeNode(tn), TdxDBTreeNode(newtnp)); + TdxDBTreeNode(tn).IsInserting := False; + end + else + begin + oldtnp := DBTreeNodes.GetTreeNode(TdxDBTreeNode(tn).FParentFieldValue); + if newtnp <> oldtnp then + SetNewTreeNodeParent(TdxDBTreeNode(tn), TdxDBTreeNode(newtnp)); + end; + end; + end; +end; + +procedure TdxDBTreeView.DoVMSelectItem(var Message: TMessage); +begin + FrameSelectedItem; +end; + +procedure TdxDBTreeView.DoVMSetItem(var Message: TMessage); +var + tr: TTreeNode; + FlagDis: Boolean; +begin + if not DataChangedBusy and not CopyTreeNodeStructFlag and not IsEditing + and (PTVITEM(Message.lparam)^.mask and TVIF_TEXT = 1) + and (PTVITEM(Message.lparam)^.hItem <> nil) + and (not ReadOnly) and (FListField <> nil) and (FDisplayFields.Count = 0) + and (FDataLink.DataSet.CanModify) and not FListField.ReadOnly then + begin + DataChangedBusy := True; + FlagDis := FDataLink.DataSet.ControlsDisabled; + if not FlagDis then + FDataLink.DataSet.DisableControls; + SendMessage(Handle, WM_SETREDRAW, Integer(False), 0); + DataChangedBusy := False; + tr := Selected; + TreeView_SelectItem(Handle, PTVITEM(Message.lparam)^.hItem); + DataChangedBusy := True; + if (FListField.Text <> Selected.Text) + and DoDBAction(TdxDBTreeNode(selected), nil, trDBChangeText) then + begin + FDataLink.DataSet.Edit; + FListField.Text := Selected.Text; + FDataLink.DataSet.Post; + end; + Selected := tr; + SendMessage(Handle, WM_SETREDRAW, Integer(True), 0); + if not FlagDis then + FDataLink.DataSet.EnableControls; + DataChangedBusy := False; + end; +end; + +procedure TdxDBTreeView.DoVMExpand(var Message: TMessage); +begin + if (Message.wParam = TVE_COLLAPSE) and (Selected <> nil) then + Change(Selected); +end; + +procedure TdxDBTreeView.DoWMPaint(var Message: TMessage); +begin + if not Focused and (Selected <> nil) and (Selected.IsVisible) and not IsEditing then + FrameSelectedItem; +end; + +procedure TdxDBTreeView.CNNotify(var Message: TWMNotify); +begin + DoCNNotify(Message); + inherited; +end; + +procedure TdxDBTreeView.VM_INSERTITEM(var Message: TMessage); +begin + inherited; + DoVMInsertItem(Message); +end; + +procedure TdxDBTreeView.VM_SELECTITEM(var Message: TMessage); +begin + inherited; + DoVMSelectItem(Message); +end; + +procedure TdxDBTreeView.VM_SETITEM(var Message: TMessage); +begin + inherited; + DoVMSetItem(Message); +end; + +procedure TdxDBTreeView.VM_EXPAND(var Message: TMessage); +begin + inherited; + DoVMExpand(Message); +end; + +procedure TdxDBTreeView.WMPaint(var Message: TMessage); +begin + inherited; + DoWMPaint(Message); +end; + +procedure TdxDBTreeView.WMUpdateImages(var Message: TMessage); +var + ANode: TdxDBTreeNode; +begin + ANode := TdxDBTreeNode(Message.WParam); + if ANode is TdxDBTreeNode then + ANode.UpdateImages; +end; + +procedure TdxDBTreeView.EditWndProc(var Message: TMessage); +begin + with Message do + begin + case Msg of + WM_CHAR: + if not (FDataLink.DataSet.CanModify) or FListField.ReadOnly then + Exit + else + if not FListField.IsValidChar(Char(wParam)) then + begin + MessageBeep(0); + Exit; + end; + end; + Result := CallWindowProc(FDefEditProc, FEditHandle, Msg, WParam, LParam); + end; +end; + +end. + diff --git a/official/x.35/ExpressDBTree Suite/Sources/dxdbtreg.dcr b/official/x.35/ExpressDBTree Suite/Sources/dxdbtreg.dcr new file mode 100644 index 00000000..fa752c73 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Sources/dxdbtreg.dcr differ diff --git a/official/x.35/ExpressDBTree Suite/Sources/dxdbtreg.pas b/official/x.35/ExpressDBTree Suite/Sources/dxdbtreg.pas new file mode 100644 index 00000000..e82b8cc1 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Sources/dxdbtreg.pas @@ -0,0 +1,172 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express data-aware tree view registration } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSGRID AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxdbtreg; + +{$I cxVer.inc} +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + + {$IFDEF DELPHI6} + DesignIntf, + DesignEditors, + {$ELSE} + DsgnIntf, + {$ENDIF} DBConsts, DB; + +procedure Register; + +implementation + +uses dxtree, dxDBTree, dxDBTrel, ShellAPI; + +const + dxdbtVersion = '1.35'; + +type + TdxDBTreeViewEditor = class(TComponentEditor) + procedure ExecuteVerb(Index: Integer); override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + end; + +procedure TdxDBTreeViewEditor.ExecuteVerb(Index: Integer); +begin + case Index of + 1: ShellExecute(0, PChar('OPEN'), PChar('http://www.devexpress.com'), Nil, Nil, SW_SHOWMAXIMIZED); + end; +end; + +function TdxDBTreeViewEditor.GetVerb(Index: Integer): string; +begin + case Index of + 0: Result := 'ExpressDBTreeView ' + dxdbtVersion; + 1: Result := 'http://www.devexpress.com'; + 2: Result := 'Developer Express Inc.'; + end; +end; + +function TdxDBTreeViewEditor.GetVerbCount: Integer; +begin + Result := 3; +end; + +type + TCustomDBTreeViewFieldProperty = class(TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValueList(List: TStrings); virtual; + procedure GetValues(Proc: TGetStrProc); override; + end; + +function TCustomDBTreeViewFieldProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList, paSortList, paMultiSelect]; +end; + +procedure TCustomDBTreeViewFieldProperty.GetValueList(List: TStrings); +begin +end; + +procedure TCustomDBTreeViewFieldProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; + Values: TStringList; +begin + Values := TStringList.Create; + try + GetValueList(Values); + for I := 0 to Values.Count - 1 do Proc(Values[I]); + finally + Values.Free; + end; +end; + +type + TDBTreeViewFieldProperty = class(TCustomDBTreeViewFieldProperty) + public + procedure GetValueList(List: TStrings); override; + end; + +procedure TDBTreeViewFieldProperty.GetValueList(List: TStrings); +var + DBTreeView : TdxDBTreeView; +begin + DBTreeView := GetComponent(0) as TdxDBTreeView; + if(DBTreeView.DataSource <> nil) And (DBTreeView.DataSource.DataSet <> nil)then + DBTreeView.DataSource.DataSet.GetFieldNames(List); +end; + +type + TLookUpTreeViewFieldProperty = class(TCustomDBTreeViewFieldProperty) + public + procedure GetValueList(List: TStrings); override; + end; + +procedure TLookUpTreeViewFieldProperty.GetValueList(List: TStrings); +var + CustomLookUpTreeView : TCustomdxLookUpTreeView; +begin + CustomLookUpTreeView := GetComponent(0) as TCustomdxLookUpTreeView; + if(CustomLookUpTreeView.ListSource <> nil) + And (CustomLookUpTreeView.ListSource.DataSet <> nil)then + CustomLookUpTreeView.ListSource.DataSet.GetFieldNames(List); +end; + +procedure Register; +begin + RegisterComponents('ExpressDBTree', [TdxTreeView, TdxDBTreeView, TdxTreeViewEdit, TdxDBTreeViewEdit, + TdxLookUpTreeView, TdxDBLookUpTreeView]); + + RegisterComponentEditor(TdxDBTreeView, TdxDBTreeViewEditor); + + RegisterPropertyEditor(TypeInfo(string), TdxDBTreeView, 'ImageIndexField', TDBTreeViewFieldProperty); + RegisterPropertyEditor(TypeInfo(string), TdxDBTreeView, 'KeyField', TDBTreeViewFieldProperty); + RegisterPropertyEditor(TypeInfo(string), TdxDBTreeView, 'ListField', TDBTreeViewFieldProperty); + RegisterPropertyEditor(TypeInfo(string), TdxDBTreeView, 'ParentField', TDBTreeViewFieldProperty); + RegisterPropertyEditor(TypeInfo(string), TdxDBTreeView, 'DisplayField', TDBTreeViewFieldProperty); + RegisterPropertyEditor(TypeInfo(string), TdxDBTreeView, 'StateIndexField', TDBTreeViewFieldProperty); + RegisterPropertyEditor(TypeInfo(string), TCustomdxLookUpTreeView, 'KeyField', TLookUpTreeViewFieldProperty); + RegisterPropertyEditor(TypeInfo(string), TCustomdxLookUpTreeView, 'ListField', TLookUpTreeViewFieldProperty); + RegisterPropertyEditor(TypeInfo(string), TCustomdxLookUpTreeView, 'DisplayField', TLookUpTreeViewFieldProperty); + RegisterPropertyEditor(TypeInfo(string), TCustomdxLookUpTreeView, 'ParentField', TLookUpTreeViewFieldProperty); + RegisterPropertyEditor(TypeInfo(string), TCustomdxLookUpTreeView, 'ImageIndexField', TLookUpTreeViewFieldProperty); + RegisterPropertyEditor(TypeInfo(string), TCustomdxLookUpTreeView, 'StateIndexField', TLookUpTreeViewFieldProperty); + RegisterPropertyEditor(TypeInfo(string), TdxDBLookUpTreeView, 'AssignField', TLookUpTreeViewFieldProperty); +end; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Sources/dxdbtrel.pas b/official/x.35/ExpressDBTree Suite/Sources/dxdbtrel.pas new file mode 100644 index 00000000..d4c11d9d --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Sources/dxdbtrel.pas @@ -0,0 +1,2326 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express data-aware tree view edit controls } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE and ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL and PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSGRID and ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE and ALL RELATED } +{ FILES or ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, or OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ and PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxdbtrel; + +interface +{$I cxVer.inc} +uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + dxdbtree, DB, StdCtrls, ExtCtrls, ComCtrls, Menus {$IFNDEF DELPHI3}, DBTables {$ENDIF}, + dxtree, dbctrls {$IFDEF DELPHI4}, ImgList{$ENDIF}, + dxCommon {$IFDEF DELPHI6}, Variants, Types {$ENDIF}; + +type + TTVTextStyle = (tvtsShort, tvtsFull); + + TdxTreeViewCloseUp = procedure (Sender: TObject; Accept: Boolean) of object; + + TCustomdxVTreeViewEdit = class(TCustomControl) + private + FCanSelectParents: Boolean; + FAlignment: TAlignment; + FFocused: Boolean; + FButtonWidth: Integer; + FDividedChar: Char; + FDropDownRows: Integer; + FListVisible: Boolean; + FOnDropDown: TNotifyEvent; + FOnCloseUp: TdxTreeViewCloseUp; + FText: string; + FTextStyle: TTVTextStyle; + FOnGetSelectedIndex: TTVExpandedEvent; + FOnGetImageIndex: TTVExpandedEvent; + FDropDownWidth: Integer; + FPressed: Boolean; + FOldParentForm: {$IFDEF DELPHI3}TCustomForm{$ELSE}TForm{$ENDIF}; + + procedure SetDividedChar(Value: Char); + procedure SetText(Value: string); + + function CanSelectTreeNode(ANode: TTreeNode): Boolean; + function GetCustomDraw: TTreeViewCustomDraw; + function GetTreeViewColor: TColor; + function GetTreeViewCursor: TCursor; + function GetTreeViewFont: TFont; + function GetTreeViewHint: string; + function GetTreeViewImages: {$IFDEF DELPHI4}TCustomImageList{$ELSE}TImageList{$ENDIF}; + function GetTreeViewIndent: Integer; + function GetTreeViewPopupMenu: TPopupMenu; + function GetTreeViewReadOnly: Boolean; + function GetSelectedTreeNode: TTreeNode; + function GetTreeViewShowButtons: Boolean; + function GetTreeViewShowHint: Boolean; + function GetTreeViewShowLines: Boolean; + function GetTreeViewShowRoot: Boolean; + function GetTreeViewSortType: TSortType; + function GetTreeViewStateImages: {$IFDEF DELPHI4}TCustomImageList{$ELSE}TImageList{$ENDIF}; + + procedure SetCustomDraw(Value: TTreeViewCustomDraw); + procedure SetTreeViewColor(Value: TColor); + procedure SetTreeViewCursor(Value: TCursor); + procedure SetTreeViewFont(Value: TFont); + procedure SetTreeViewHint(Value: string); + procedure SetTreeViewImages(Value: {$IFDEF DELPHI4}TCustomImageList{$ELSE}TImageList{$ENDIF}); + procedure SetTreeViewIndent(Value: Integer); + procedure SetTreeViewPopupMenu(Value: TPopupMenu); + procedure SetTreeViewReadOnly(Value: Boolean); + procedure SetTreeViewShowButtons(Value: Boolean); + procedure SetTreeViewShowHint(Value: Boolean); + procedure SetTreeViewShowLines(Value: Boolean); + procedure SetTreeViewShowRoot(Value: Boolean); + procedure SetTreeViewSortType(Value: TSortType); + procedure SetTreeViewStateImages(Value: {$IFDEF DELPHI4}TCustomImageList{$ELSE}TImageList{$ENDIF}); + + procedure CMCtl3DChanged(var Message: TMessage); message CM_CTL3DCHANGED; + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; + procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + procedure WMKillFocus(var Message: TWMKillFocus); message WM_KILLFOCUS; + procedure WMSetFocus(var Message: TWMSetFocus); message WM_SETFOCUS; + + function GetBorderSize: Integer; + function GetTextHeight: Integer; + procedure AllowChangeTreeNode(Sender: TObject; Node: TTreeNode; var AllowChange: Boolean); + procedure ClickTreeView(Sender: TObject); + procedure DblClickTreeView(Sender: TObject); + protected + function VirtualTreeView: TCustomdxTreeView; virtual; abstract; + + function IsReadOnly: Boolean; virtual; + + procedure CreateParams(var Params: TCreateParams); override; + procedure Paint; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure DropDownOk; virtual; + procedure CreateVirtualTreeView; virtual; + procedure PrepareDropDown; virtual; + function GetPaintedText: string; virtual; + + property Alignment: TAlignment read FAlignment write FAlignment; + property DividedChar: Char read FDividedChar write SetDividedChar; + property TextStyle: TTVTextStyle read FTextStyle write FTextStyle; + + property Selected: TTreeNode read GetSelectedTreeNode; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; + procedure CloseUp(Accept: Boolean); virtual; + procedure DropDown; virtual; + published + property CanSelectParents: Boolean read FCanSelectParents write FCanSelectParents; + property Color; + property Ctl3D; + property DragCursor; + property DragMode; + property DropDownRows: Integer read FDropDownRows write FDropDownRows default 7; + property DropDownWidth: Integer read FDropDownWidth write FDropDownWidth default 0; + property Enabled; + property Font; + property ParentColor; + property ParentCtl3D; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property ShowHint; + property TabOrder; + property TabStop; + property Text: string read FText write SetText; + property TreeViewColor: TColor read GetTreeViewColor write SetTreeViewColor; + property TreeViewCursor: TCursor read GetTreeViewCursor write SetTreeViewCursor; + property TreeViewFont: TFont read GetTreeViewFont write SetTreeViewFont; + property TreeViewHint: string read GetTreeViewHint write SetTreeViewHint; + property TreeViewImages: {$IFDEF DELPHI4}TCustomImageList{$ELSE}TImageList{$ENDIF} read GetTreeViewImages write SetTreeViewImages; + property TreeViewIndent: Integer read GetTreeViewIndent write SetTreeViewIndent; + property TreeViewPopupMenu: TPopupMenu read GetTreeViewPopupMenu write SetTreeViewPopupMenu; + property TreeViewReadOnly: Boolean read GetTreeViewReadOnly write SetTreeViewReadOnly; + property TreeViewShowButtons: Boolean read GetTreeViewShowButtons write SetTreeViewShowButtons; + property TreeViewShowHint: Boolean read GetTreeViewShowHint write SetTreeViewShowHint; + property TreeViewShowLines: Boolean read GetTreeViewShowLines write SetTreeViewShowLines; + property TreeViewShowRoot: Boolean read GetTreeViewShowRoot write SetTreeViewShowRoot; + property TreeViewSortType: TSortType read GetTreeViewSortType write SetTreeViewSortType; + property TreeViewStateImages: {$IFDEF DELPHI4}TCustomImageList{$ELSE}TImageList{$ENDIF} read GetTreeViewStateImages write SetTreeViewStateImages; + property Visible; + property OnCloseUp: TdxTreeViewCloseUp read FOnCloseUp write FOnCloseUp; + property OnClick; + property OnCustomDraw: TTreeViewCustomDraw read GetCustomDraw write SetCustomDraw; + property OnDragDrop; + property OnDragOver; + property OnDropDown: TNotifyEvent read FOnDropDown write FOnDropDown; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnGetSelectedIndex: TTVExpandedEvent read FOnGetSelectedIndex write FOnGetSelectedIndex; + property OnGetImageIndex: TTVExpandedEvent read FOnGetImageIndex write FOnGetImageIndex; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDrag; + {$IFDEF DELPHI4} + property Anchors; + property Constraints; + property OnStartDock; + property OnEndDock; + {$ENDIF} + end; + + TCustomdxTreeViewEdit = class(TCustomdxVTreeViewEdit) + private + FMemStream: TMemoryStream; + FImagesStream: TMemoryStream; + FOldSelected: TTreeNode; + FTreeView: TdxTreeView; + + function GetItems: TTreeNodes; + procedure SetItems(Value: TTreeNodes); + procedure SaveNodesToStream; + protected + procedure Loaded; override; + function VirtualTreeView: TCustomdxTreeView; override; + procedure CreateWnd; override; + procedure DestroyWnd; override; + procedure DestroyWindowHandle; override; + + procedure PrepareDropDown; override; + procedure SearchTreeNode; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure CloseUp(Accept: Boolean); override; + procedure DropDown; override; + function GetTreeNodeByText(ParentTreeNode: TTreeNode; Text: string; flag: Boolean): TTreeNode; + + property Selected; + published + property DividedChar; + property Items: TTreeNodes read GetItems write SetItems; + property TextStyle; + end; + + TdxTreeViewEdit = class(TCustomdxTreeViewEdit) + published + property Alignment; + end; + + TdxDBTreeViewEdit = class(TCustomdxTreeViewEdit) + private + FDataLink: TFieldDataLink; + FCanvas: TControlCanvas; + + procedure DataChange(Sender: TObject); + function GetDataField: string; + function GetDataSource: TDataSource; + function GetField: TField; + function GetReadOnly: Boolean; + procedure SetDataField(const Value: string); + procedure SetDataSource(Value: TDataSource); + procedure SetReadOnly(Value: Boolean); + procedure UpdateData(Sender: TObject); + procedure CMExit(var Message: TCMExit); message CM_EXIT; + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + procedure DropDownOk; override; + function GetPaintedText: string; override; + + function IsReadOnly: Boolean; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure DropDown; override; + + property Field: TField read GetField; + property Text; + published + property DataField: string read GetDataField write SetDataField; + property DataSource: TDataSource read GetDataSource write SetDataSource; + property ReadOnly: Boolean read GetReadOnly write SetReadOnly default False; + end; + + TCustomdxLookupTreeView = class; + + TDataLinkLookupTreeView = class(TDataLink) + private + LookupTreeView: TCustomdxLookupTreeView; + protected + procedure ActiveChanged; override; + end; + + TCustomdxLookupTreeView = class(TCustomdxVTreeViewEdit) + private + DBTreeView: TdxDBTreeView; + ListLink: TDataLinkLookupTreeView; + FKeyFieldValue: Variant; + FAssignFieldName: string; + FKeyFieldName: string; + FParentFieldName: string; + FListFieldName: string; + FDisplayFieldName: string; + FImageIndexFieldName: string; + FStateIndexFieldName: string; + FDropDownKeyValue: Variant; + + FOnSetDisplayItemText: TSetDisplayItemText; + + function GetAddNewItem: TAddNewDBTreeNodeEvent; + function GetListSource: TDataSource; + function GetOptions: TdxDBTreeViewOptions; + function GetRootValue: {$IFNDEF DELPHI6}string{$ELSE}Variant{$ENDIF}; + procedure SetAddNewItem(Value: TAddNewDBTreeNodeEvent); + procedure SetAssignField(Value: string); + procedure SetKeyField(Value: string); + procedure SetListField(Value: string); + procedure SetOptions(Value: TdxDBTreeViewOptions); + procedure SetParentField(Value: string); + procedure SetRootValue(Value: {$IFNDEF DELPHI6}string{$ELSE}Variant{$ENDIF}); + procedure SetListSource(Value: TDataSource); + protected + FAssignField: TField; + FKeyField: TField; + FListField: TField; + FParentField: TField; + + function VirtualTreeView: TCustomdxTreeView; override; + procedure DropDownOk; override; + procedure DataLinkActiveChanged; virtual; + procedure ResetDropDown; virtual; + + property AssignField: string read FAssignFieldName write SetAssignField; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure DropDown; override; + procedure CloseUp(Accept: Boolean); override; + published + property DisplayField: string read FDisplayFieldName write FDisplayFieldName; + property DividedChar; + property ImageIndexField: string read FImageIndexFieldName write FImageIndexFieldName; + property ListSource: TDataSource read GetListSource write SetListSource; + property KeyField: string read FKeyFieldName write SetKeyField; + property ListField: string read FListFieldName write SetListField; + property Options: TdxDBTreeViewOptions read GetOptions write SetOptions default []; + property ParentField: string read FParentFieldName write SetParentField; + property RootValue: {$IFNDEF DELPHI6}string{$ELSE}Variant{$ENDIF} read GetRootValue write SetRootValue; + property StateIndexField: string read FStateIndexFieldName write FStateIndexFieldName; + property TextStyle; + property OnAddNewItem: TAddNewDBTreeNodeEvent read GetAddNewItem write SetAddNewItem; + property OnSetDisplayItemText: TSetDisplayItemText read FOnSetDisplayItemText + write FOnSetDisplayItemText; + end; + + TdxLookupTreeView = class(TCustomdxLookupTreeView) + published + property Alignment; + end; + + TdxDBLookupTreeView = class(TCustomdxLookupTreeView) + private + FDataLink: TFieldDataLink; + FCanvas: TControlCanvas; + FCloseUpFlag: Boolean; + FUpdateDataFlag: Boolean; + + procedure ActiveChange(Sender: TObject); + procedure DataChange(Sender: TObject); + function GetDataField: string; + function GetDataSource: TDataSource; + function GetField: TField; + function GetReadOnly: Boolean; + procedure SetDataField(const Value: string); + procedure SetDataSource(Value: TDataSource); + procedure SetReadOnly(Value: Boolean); + procedure UpdateData(Sender: TObject); + procedure CMExit(var Message: TCMExit); message CM_EXIT; + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + + procedure CheckNotCircular; + protected + procedure DataLinkActiveChanged; override; + procedure DropDownOk; override; + function GetPaintedText: string; override; + function IsReadOnly: Boolean; override; + function GetDisplayText: string; + function GetLookupValue: Variant; + procedure Notification(AComponent: TComponent; + Operation: TOperation); override; + procedure PrepareDropDown; override; + procedure SearchTreeNode; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure DropDown; override; + procedure CloseUp(Accept: Boolean); override; + + property Field: TField read GetField; + property Text; + published + property AssignField; + property DataField: string read GetDataField write SetDataField; + property DataSource: TDataSource read GetDataSource write SetDataSource; + property ReadOnly: Boolean read GetReadOnly write SetReadOnly default False; + end; + +implementation +uses dxlocate, commctrl, DBConsts + ; + +const + TreeBorderHeight = 19; + +var + FUser32DLL: HMODULE; + +function GetWorkArea(const P: TPoint): TRect; +const + MONITOR_DEFAULTTONEAREST = $2; +type + HMONITOR = Integer; + PMonitorInfo = ^TMonitorInfo; + TMonitorInfo = record + cbSize: DWORD; + rcMonitor: TRect; + rcWork: TRect; + dwFalgs: DWORD; + end; +var + Info: TMonitorInfo; + GetMonitorInfo: function(hMonitor: HMONITOR; lpMonitorInfo: PMonitorInfo): Boolean; stdcall; + MonitorFromPoint: function(ptScreenCoords: TPoint; dwFlags: DWORD): HMONITOR; stdcall; +begin + if FUser32DLL > 32 then + begin + GetMonitorInfo := GetProcAddress(FUser32DLL, 'GetMonitorInfoA'); + MonitorFromPoint := GetProcAddress(FUser32DLL, 'MonitorFromPoint'); + end + else + begin + GetMonitorInfo := nil; + MonitorFromPoint := nil; + end; + + if @GetMonitorInfo = nil then + SystemParametersInfo(SPI_GETWORKAREA, 0, @Result, 0) + else + begin + Info.cbSize := SizeOf(Info); + GetMonitorInfo(MonitorFromPoint(P, MONITOR_DEFAULTTONEAREST), @Info); + Result := Info.rcWork; + end; +end; + +function VarEquals(const V1, V2: Variant): Boolean; +begin + Result := False; + try + Result := V1 = V2; + except + end; +end; + +function GetFullTreeNodeName(TreeNode: TTreeNode; DividedChar: Char): string; +var + tr: TTreeNode; +begin + Result := ''; + tr := TreeNode; + while tr <> nil do begin + if (Length(Result) > 0 ) and (Length(tr.Text) > 0 ) then + Result := DividedChar + Result; + Result := tr.Text + Result; + tr := tr.Parent; + end; +end; + +function GetRealParentForm(AControl: TWinControl): {$IFDEF DELPHI3}TCustomForm{$ELSE}TForm{$ENDIF}; +var + AForm: {$IFDEF DELPHI3}TCustomForm{$ELSE}TForm{$ENDIF}; +begin + Result := GetParentForm(AControl); + if Result <> nil then + begin + AForm := GetParentForm(Result); + while (AForm <> nil) and (AForm <> Result) do + begin + Result := AForm; + AForm := GetParentForm(AForm); + end; + end; +end; + +function GetParentWinControl(AControl: TWinControl): TWinControl; +begin + Result := GetParentForm(AControl); + {$IFDEF DELPHI5} + if Result = nil then + begin + Result := AControl; + while Result.Parent <> nil do + Result := Result.Parent; + end; + {$ENDIF} +end; + +{TPopupTreeView} +type +TPopupTreeView = class(TdxTreeView) +private + FHScrollWidth: Integer; + FVScrollWidth: Integer; + FCloseButtonRect, FGripRect: TRect; + FCloseButtonIsTracking: Boolean; + FMouseAboveCloseButton: Boolean; + FCorner: TdxCorner; + IsDestroying: Boolean; + + procedure WMActivate(var Message: TWMActivate); message WM_ACTIVATE; + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + procedure WMMouseActivate(var Message: TWMMouseActivate); message WM_MOUSEACTIVATE; + + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); message WM_GETMINMAXINFO; + procedure WMCaptureChanged(var Message: TMessage); message WM_CAPTURECHANGED; + + procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; + procedure WMNCLButtonDown(var Message: TWMNCLButtonDown); message WM_NCLBUTTONDOWN; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; +protected + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; +public + constructor Create(AOwner: TComponent); override; + procedure WndProc(var Message: TMessage); override; +end; + +constructor TPopupTreeView.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := ControlStyle + [csNoDesignVisible, csReplicatable]; + DragMode := dmManual; +end; + +procedure TPopupTreeView.WMActivate(var Message: TWMActivate); +begin + inherited; + if (Message.Active = WA_INACTIVE) and + TCustomdxVTreeViewEdit(Owner).FListVisible then + TCustomdxVTreeViewEdit(Owner).CloseUp(False); +end; + +procedure TPopupTreeView.WMGetDlgCode(var Message: TWMGetDlgCode); +begin + inherited; + Message.Result := Message.Result + DLGC_WANTALLKEYS; +end; + +procedure TPopupTreeView.WMMouseActivate(var Message: TWMMouseActivate); +begin + inherited; + Message.Result := MA_NOACTIVATE; +end; + +procedure TPopupTreeView.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + begin + Style := Style and not WS_CHILD or WS_POPUP or WS_BORDER ; + ExStyle := ExStyle and not WS_EX_CLIENTEDGE; + + WindowClass.Style := WindowClass.Style or CS_SAVEBITS; + WndParent := GetParentWinControl(TWinControl(Owner)).Handle; + end; +end; + +procedure TPopupTreeView.WndProc(var Message: TMessage); +begin + with Message do + if (Msg = WM_KEYDOWN) and ((wParam = VK_ESCAPE) or (wParam = VK_RETURN)) then + TCustomdxVTreeViewEdit(Owner).CloseUp(wParam = VK_RETURN) + else + begin + if (Msg = WM_DESTROY) and (Owner <> nil) and not IsDestroying then + TCustomdxTreeViewEdit(Owner).SaveNodesToStream; + inherited WndProc(Message); + end; +end; + +procedure TPopupTreeView.CreateWnd; +begin + inherited; + FHScrollWidth := GetSystemMetrics(SM_CYHSCROLL); + FVScrollWidth := GetSystemMetrics(SM_CXVSCROLL); +end; + +procedure TPopupTreeView.WMCaptureChanged(var Message: TMessage); +begin + inherited; + if FCloseButtonIsTracking then + begin + FCloseButtonIsTracking := False; + FMouseAboveCloseButton := False; + SendMessage(Handle, WM_NCPAINT, 0, 0); + end; +end; + +procedure TPopupTreeView.WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); +begin + inherited; + Message.MinMaxInfo^.ptMinTrackSize := Point(100, 100); +end; + +procedure TPopupTreeView.WMNCCalcSize(var Message: TWMNCCalcSize); +var + R: TRect; + AControl: TWinControl; +begin + inherited; + if TCustomdxVTreeViewEdit(Owner).FListVisible then + begin + GetWindowRect(Handle, R); + AControl := TWinControl(Owner); + MapWindowPoints(0, AControl.Handle, R, 2); + FCorner := GetCornerForRects(AControl.ClientRect, R); + with Message.CalcSize_Params^ do + if FCorner in [coBottomLeft, coBottomRight] then + Dec(rgrc[0].Bottom, dxDropDownNCHeight) + else + Inc(rgrc[0].Top, dxDropDownNCHeight); + end; +end; + +procedure TPopupTreeView.WMNCHitTest(var Message: TWMNCHitTest); +var + PrevMouseAboveCloseButton: Boolean; +begin + inherited; + with Message do + if PtInRect(FGripRect, SmallPointToPoint(Pos)) then + Result := GetHitTestByCorner(FCorner) + else + begin + PrevMouseAboveCloseButton := FMouseAboveCloseButton; + FMouseAboveCloseButton := PtInRect(FCloseButtonRect, SmallPointToPoint(Pos)); + if FMouseAboveCloseButton then Result := HTBORDER; + if PrevMouseAboveCloseButton <> FMouseAboveCloseButton then + SendMessage(Handle, WM_NCPAINT, 0, 0); + end; +end; + +procedure TPopupTreeView.WMNCPaint(var Message: TWMNCPaint); +var + R, R1, CR: TRect; + B: Integer; + DC: HDC; + AStyle: Longint; +begin + inherited; + if not TCustomdxVTreeViewEdit(Owner).FListVisible then + Exit; + + GetWindowRect(Handle, R); + FCloseButtonRect := R; + FGripRect := R; + Windows.GetClientRect(Handle, CR); + MapWindowPoints(0, Handle, R, 2); + B := -R.Left; + OffsetRect(CR, -R.Left, -R.Top); + OffsetRect(R, -R.Left, -R.Top); + InflateRect(R, -B, -B); + + DC := GetWindowDC(Handle); + + if FCorner in [coBottomLeft, coBottomRight] then + begin + R.Top := R.Bottom - dxDropDownNCHeight + 1; + SetRect(R1, R.Left, R.Top - 1, R.Right, R.Top); + FillRect(DC, R1, GetSysColorBrush(COLOR_WINDOWFRAME)); + end + else + begin + R.Bottom := R.Top + dxDropDownNCHeight - 1; + SetRect(R1, R.Left, R.Bottom, R.Right, R.Bottom + 1); + FillRect(DC, R1, GetSysColorBrush(COLOR_WINDOWFRAME)); + end; + + CR := R; + DrawSizeGrip(DC, CR, FCorner); + with CR do + ExcludeClipRect(DC, Left, Top, Right, Bottom); + InflateRect(CR, 2, 2); + if CR.Top < R.Top then CR.Top := R.Top; + if CR.Bottom > R.Bottom then CR.Bottom := R.Bottom; + OffsetRect(CR, FGripRect.Left, FGripRect.Top); + FGripRect := CR; + + CR := R; + DrawCloseButton(DC, CR, FMouseAboveCloseButton or FCloseButtonIsTracking, + FMouseAboveCloseButton and FCloseButtonIsTracking, FCorner); + with CR do + ExcludeClipRect(DC, Left, Top, Right, Bottom); + with FCloseButtonRect do OffsetRect(CR, Left, Top); + FCloseButtonRect := CR; + + FillRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + if FCorner in [coBottomLeft, coBottomRight] then + begin + AStyle := GetWindowLong(Handle, GWL_STYLE); + if (AStyle and WS_HSCROLL <> 0) and (AStyle and WS_VSCROLL <> 0) then + with R do + begin + Left := Right - GetSystemMetrics(SM_CXVSCROLL); + Bottom := Top - 1; + Top := Bottom - GetSystemMetrics(SM_CYHSCROLL); + FillRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + end; + end; + + ReleaseDC(Handle, DC); +end; + +procedure TPopupTreeView.CMMouseLeave(var Message: TMessage); +begin + inherited; + if FMouseAboveCloseButton then + begin + FMouseAboveCloseButton := False; + SendMessage(Handle, WM_NCPAINT, 0, 0); + end; +end; + +procedure TPopupTreeView.WMLButtonUp(var Message: TWMLButtonUp); +begin + inherited; + if FCloseButtonIsTracking then + begin + FCloseButtonIsTracking := False; + ReleaseCapture; + if FMouseAboveCloseButton then + TCustomdxVTreeViewEdit(Owner).CloseUp(False) + else + SendMessage(Handle, WM_NCPAINT, 0, 0); + end; +end; + +procedure TPopupTreeView.WMNCLButtonDown(var Message: TWMNCLButtonDown); +begin + inherited; + if FMouseAboveCloseButton then + begin + FCloseButtonIsTracking := True; + SetCapture(Handle); + SendMessage(Handle, WM_NCPAINT, 0, 0); + end; +end; + +{ TPopupDBTreeView } + +type +TPopupDBTreeView = class(TdxDBTreeView) +private + FHScrollWidth: Integer; + FVScrollWidth: Integer; + FCloseButtonRect, FGripRect: TRect; + FCloseButtonIsTracking: Boolean; + FMouseAboveCloseButton: Boolean; + FCorner: TdxCorner; + + procedure WMActivate(var Message: TWMActivate); message WM_ACTIVATE; + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + procedure WMMouseActivate(var Message: TWMMouseActivate); message WM_MOUSEACTIVATE; + + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); message WM_GETMINMAXINFO; + procedure WMCaptureChanged(var Message: TMessage); message WM_CAPTURECHANGED; + + procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; + procedure WMNCLButtonDown(var Message: TWMNCLButtonDown); message WM_NCLBUTTONDOWN; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; +protected + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; +public + constructor Create(AOwner: TComponent); override; + procedure WndProc(var Message: TMessage); override; +end; + +constructor TPopupDBTreeView.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := ControlStyle + [csNoDesignVisible, csReplicatable]; + DragMode := dmManual; +end; + +procedure TPopupDBTreeView.WMActivate(var Message: TWMActivate); +begin + inherited; + if (Message.Active = WA_INACTIVE) and + TCustomdxVTreeViewEdit(Owner).FListVisible then + TCustomdxVTreeViewEdit(Owner).CloseUp(False); +end; + +procedure TPopupDBTreeView.WMGetDlgCode(var Message: TWMGetDlgCode); +begin + inherited; + Message.Result := Message.Result + DLGC_WANTALLKEYS; +end; + +procedure TPopupDBTreeView.WMMouseActivate(var Message: TWMMouseActivate); +begin + inherited; + Message.Result := MA_NOACTIVATE; +end; + +procedure TPopupDBTreeView.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + begin + Style := Style and not WS_CHILD or WS_POPUP or WS_BORDER ; + ExStyle := ExStyle and not WS_EX_CLIENTEDGE; + + WindowClass.Style := WindowClass.Style or CS_SAVEBITS; + WndParent := GetParentWinControl(TWinControl(Owner)).Handle; + end; +end; + +procedure TPopupDBTreeView.WndProc(var Message: TMessage); +begin + with Message do + if (Msg = WM_KEYDOWN) and ((wParam = VK_ESCAPE) or (wParam = VK_RETURN)) then + TCustomdxVTreeViewEdit(Owner).CloseUp(wParam = VK_RETURN) + else + inherited WndProc(Message); +end; + +procedure TPopupDBTreeView.CreateWnd; +begin + inherited; + + FHScrollWidth := GetSystemMetrics(SM_CYHSCROLL); + FVScrollWidth := GetSystemMetrics(SM_CXVSCROLL); +end; + +procedure TPopupDBTreeView.WMCaptureChanged(var Message: TMessage); +begin + inherited; + if FCloseButtonIsTracking then + begin + FCloseButtonIsTracking := False; + FMouseAboveCloseButton := False; + SendMessage(Handle, WM_NCPAINT, 0, 0); + end; +end; + +procedure TPopupDBTreeView.WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); +begin + inherited; + Message.MinMaxInfo^.ptMinTrackSize := Point(100, 100); +end; + +procedure TPopupDBTreeView.WMNCCalcSize(var Message: TWMNCCalcSize); +var + R: TRect; + AControl: TWinControl; +begin + inherited; + if TCustomdxVTreeViewEdit(Owner).FListVisible then + begin + GetWindowRect(Handle, R); + AControl := TWinControl(Owner); + MapWindowPoints(0, AControl.Handle, R, 2); + FCorner := GetCornerForRects(AControl.ClientRect, R); + with Message.CalcSize_Params^.rgrc[0] do + if FCorner in [coBottomLeft, coBottomRight] then + Dec(Bottom, dxDropDownNCHeight) + else + Inc(Top, dxDropDownNCHeight); + end; +end; + +procedure TPopupDBTreeView.WMNCHitTest(var Message: TWMNCHitTest); +var + PrevMouseAboveCloseButton: Boolean; +begin + inherited; + with Message do + if PtInRect(FGripRect, SmallPointToPoint(Pos)) then + Result := GetHitTestByCorner(FCorner) + else + begin + PrevMouseAboveCloseButton := FMouseAboveCloseButton; + FMouseAboveCloseButton := PtInRect(FCloseButtonRect, SmallPointToPoint(Pos)); + if FMouseAboveCloseButton then Result := HTBORDER; + if PrevMouseAboveCloseButton <> FMouseAboveCloseButton then + SendMessage(Handle, WM_NCPAINT, 0, 0); + end; +end; + +procedure TPopupDBTreeView.WMNCPaint(var Message: TWMNCPaint); +var + R, R1, CR: TRect; + B: Integer; + DC: HDC; + AStyle: Longint; +begin + inherited; + if not TCustomdxVTreeViewEdit(Owner).FListVisible then Exit; + + GetWindowRect(Handle, R); + FCloseButtonRect := R; + FGripRect := R; + Windows.GetClientRect(Handle, CR); + MapWindowPoints(0, Handle, R, 2); + B := -R.Left; + OffsetRect(CR, -R.Left, -R.Top); + OffsetRect(R, -R.Left, -R.Top); + InflateRect(R, -B, -B); + + DC := GetWindowDC(Handle); + + if FCorner in [coBottomLeft, coBottomRight] then + begin + R.Top := R.Bottom - dxDropDownNCHeight + 1; + SetRect(R1, R.Left, R.Top - 1, R.Right, R.Top); + FillRect(DC, R1, GetSysColorBrush(COLOR_WINDOWFRAME)); + end + else + begin + R.Bottom := R.Top + dxDropDownNCHeight - 1; + SetRect(R1, R.Left, R.Bottom, R.Right, R.Bottom + 1); + FillRect(DC, R1, GetSysColorBrush(COLOR_WINDOWFRAME)); + end; + + CR := R; + DrawSizeGrip(DC, CR, FCorner); + with CR do + ExcludeClipRect(DC, Left, Top, Right, Bottom); + InflateRect(CR, 2, 2); + if CR.Top < R.Top then CR.Top := R.Top; + if CR.Bottom > R.Bottom then CR.Bottom := R.Bottom; + OffsetRect(CR, FGripRect.Left, FGripRect.Top); + FGripRect := CR; + + CR := R; + DrawCloseButton(DC, CR, FMouseAboveCloseButton or FCloseButtonIsTracking, + FMouseAboveCloseButton and FCloseButtonIsTracking, FCorner); + with CR do + ExcludeClipRect(DC, Left, Top, Right, Bottom); + with FCloseButtonRect do OffsetRect(CR, Left, Top); + FCloseButtonRect := CR; + + FillRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + if FCorner in [coBottomLeft, coBottomRight] then + begin + AStyle := GetWindowLong(Handle, GWL_STYLE); + if (AStyle and WS_HSCROLL <> 0) and (AStyle and WS_VSCROLL <> 0) then + with R do + begin + Left := Right - GetSystemMetrics(SM_CXVSCROLL); + Bottom := Top - 1; + Top := Bottom - GetSystemMetrics(SM_CYHSCROLL); + FillRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + end; + end; + + ReleaseDC(Handle, DC); +end; + +procedure TPopupDBTreeView.CMMouseLeave(var Message: TMessage); +begin + inherited; + if FMouseAboveCloseButton then + begin + FMouseAboveCloseButton := False; + SendMessage(Handle, WM_NCPAINT, 0, 0); + end; +end; + +procedure TPopupDBTreeView.WMLButtonUp(var Message: TWMLButtonUp); +begin + inherited; + if FCloseButtonIsTracking then + begin + FCloseButtonIsTracking := False; + ReleaseCapture; + if FMouseAboveCloseButton then + TCustomdxVTreeViewEdit(Owner).CloseUp(False) + else + SendMessage(Handle, WM_NCPAINT, 0, 0); + end; +end; + +procedure TPopupDBTreeView.WMNCLButtonDown(var Message: TWMNCLButtonDown); +begin + inherited; + if FMouseAboveCloseButton then + begin + FCloseButtonIsTracking := True; + SetCapture(Handle); + SendMessage(Handle, WM_NCPAINT, 0, 0); + end; +end; + +{TCustomdxTreeViewEdit} + +constructor TCustomdxVTreeViewEdit.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := [csOpaque, csReplicatable]; + if not NewStyleControls then + ControlStyle := ControlStyle + [csFramed]; + ParentColor := False; + TabStop := True; + FCanSelectParents := True; + + Width := 145; + Height := 0; + FButtonWidth := GetSystemMetrics(SM_CXVSCROLL); + FDropDownWidth := 0; + FDividedChar := '.'; + FDropDownRows := 7; + FOldParentForm := GetRealParentForm(Self); +end; + +procedure TCustomdxVTreeViewEdit.CreateVirtualTreeView; +begin + if VirtualTreeView <> nil then + begin + VirtualTreeView.Visible := False; + VirtualTreeView.ShowNodeHint := False; + VirtualTreeView.OnChanging := AllowChangeTreeNode; + VirtualTreeView.OnDblClick := DblClickTreeView; + VirtualTreeView.OnClick := ClickTreeView; + end; +end; + +destructor TCustomdxVTreeViewEdit.Destroy; +begin + VirtualTreeView.Free; + inherited; +end; + +function TCustomdxVTreeViewEdit.GetBorderSize: Integer; +var + Params: TCreateParams; + R: TRect; +begin + CreateParams(Params); + SetRect(R, 0, 0, 0, 0); + AdjustWindowRectEx(R, Params.Style, False, Params.ExStyle); + Result := R.Bottom - R.Top; +end; + +procedure TCustomdxVTreeViewEdit.AllowChangeTreeNode(Sender: TObject; Node: TTreeNode; + var AllowChange: Boolean); +begin + AllowChange := CanSelectTreeNode(Node); +end; + +procedure TCustomdxVTreeViewEdit.ClickTreeView(Sender: TObject); +begin + Click; +end; + +procedure TCustomdxVTreeViewEdit.DblClickTreeView(Sender: TObject); +var + p: TPoint; +begin + if (VirtualTreeView.Selected <> nil) + and CanSelectTreeNode(VirtualTreeView.Selected) then + begin + GetCursorPos(p); + Windows.ScreenToClient(VirtualTreeView.Handle, p); + if ((VirtualTreeView.GetHitTestInfoAt(p.X, p.Y) * [htOnItem, htOnIcon, htOnLabel, htOnStateIcon] <> []) + and (VirtualTreeView.GetNodeAt(p.X, p.Y) = VirtualTreeView.Selected)) then + CloseUp(True); + end; +end; + +procedure TCustomdxVTreeViewEdit.CloseUp(Accept: Boolean); +begin + if FListVisible then + begin + FDropDownWidth := VirtualTreeView.Width; + FDropDownRows := (VirtualTreeView.Height - 7 - TreeBorderHeight) div GetTextHeight; + if FDropDownRows < 2 then + FDropDownRows := 2; + + if GetCapture = VirtualTreeView.Handle then ReleaseCapture; + FListVisible := False; + if IsWindowVisible(VirtualTreeView.Handle) then + begin + SetWindowPos(VirtualTreeView.Handle, 0, 0, 0, 0, 0, + SWP_NOZORDER or SWP_NOMOVE or SWP_NOSIZE or SWP_HIDEWINDOW); + Windows.SetFocus(GetParentWinControl(Self).Handle); + end; + + Invalidate; + + if Accept and not IsReadOnly then DropDownOk; + if Assigned(FOnCloseUp) then FOnCloseUp(Self, Accept); + if Self is TCustomdxLookupTreeView then + TdxDBTreeView(VirtualTreeView).DataSource := nil; + end; +end; + +function TCustomdxVTreeViewEdit.IsReadOnly: Boolean; +begin + Result := False; +end; + +procedure TCustomdxVTreeViewEdit.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + if NewStyleControls and Ctl3D then + ExStyle := ExStyle or WS_EX_CLIENTEDGE + else + Style := Style or WS_BORDER; +end; + +procedure TCustomdxVTreeViewEdit.DropDown; +var + P: TPoint; + AWidth, AHeight: Integer; + AWorkArea: TRect; +begin + if not FListVisible then + begin + if Assigned(FOnDropDown) then FOnDropDown(Self); + PrepareDropDown; + + P := Parent.ClientToScreen(Point(Left, Top)); + Inc(P.Y , Height); + + AHeight := FDropDownRows * GetTextHeight + 7 + TreeBorderHeight; + if FDropDownWidth > 0 then + AWidth := FDropDownWidth + else + AWidth := Width; + AWorkArea := GetWorkArea(P); + + if P.X < AWorkArea.Left then P.X := AWorkArea.Left; + if P.X + AWidth > AWorkArea.Right then Dec(P.X, P.X + AWidth - AWorkArea.Right); + if P.Y < AWorkArea.Top then P.Y := AWorkArea.Top; + if P.Y + AHeight > AWorkArea.Bottom then Dec(P.Y, Height + AHeight); + + VirtualTreeView.SetBounds(P.X, P.Y, AWidth, AHeight); + FListVisible := True; + SetWindowPos(VirtualTreeView.Handle, 0, 0, 0, 0, 0, SWP_NOZORDER or SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE or SWP_FRAMECHANGED); + + ShowWindow(VirtualTreeView.Handle, SW_SHOWNORMAL); + Windows.SetFocus(VirtualTreeView.Handle); + SendMessage(GetParentWinControl(TWinControl(Owner)).Handle, WM_NCACTIVATE, Longint(True), 0); + Repaint; + end; +end; + +function TCustomdxVTreeViewEdit.GetTextHeight: Integer; +var + DC: HDC; + SaveFont: HFont; + Metrics: TTextMetric; +begin + DC := GetDC(0); + SaveFont := SelectObject(DC, Font.Handle); + GetTextMetrics(DC, Metrics); + SelectObject(DC, SaveFont); + ReleaseDC(0, DC); + Result := Metrics.tmHeight; +end; + +procedure TCustomdxVTreeViewEdit.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited KeyDown(Key, Shift); + if (Key = VK_DOWN) and (ssAlt in Shift) then + DropDown; +end; + +procedure TCustomdxVTreeViewEdit.MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +var + pt, ListPos: TPoint; + MousePos: TSmallPoint; + r: TRect; +begin + if (Button = mbLeft) and Enabled then + begin + SetFocus; + if not FListVisible then + begin + SetRect(r, ClientWidth - FButtonWidth, 0, ClientWidth, ClientHeight); + pt.X := X; pt.Y := Y; + FPressed := PtInRect(r, pt); + DropDown; + end + else + begin + pt.X := X; pt.Y := Y; + ListPos := VirtualTreeView.ScreenToClient(ClientToScreen(pt)); + with VirtualTreeView do + SetRect(r, 0, 0, Width, Height); + if PtInRect(r, ListPos) then + begin + MousePos := PointToSmallPoint(ListPos); + SendMessage(VirtualTreeView.Handle, WM_LBUTTONDOWN, 0, Integer(MousePos)); + end + else + CloseUp(False); + end; + end; + inherited MouseDown(Button, Shift, X, Y); +end; + +procedure TCustomdxVTreeViewEdit.MouseMove(Shift: TShiftState; X, Y: Integer); +var + R: TRect; + pt: TPoint; +begin + R := ClientRect; + R.Left := R.Right - FButtonWidth; + pt.X := X; pt.Y := Y; + if FPressed and not PtInRect(R, pt) then + begin + FPressed := False; + InvalidateRect(Handle, @R, True); + end; + inherited; +end; + +procedure TCustomdxVTreeViewEdit.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + if FPressed then + begin + FPressed := False; + Repaint; + end; + inherited MouseUp(Button, Shift, X, Y); +end; + +procedure TCustomdxVTreeViewEdit.Paint; +var + W, X, Flags: Integer; + Selected: Boolean; + R: TRect; + AText: string; +begin + Canvas.Font := Font; + Canvas.Brush.Color := Color; + Selected := FFocused and not FListVisible and not (csPaintCopy in ControlState); + if Selected then + begin + Canvas.Font.Color := clHighlightText; + Canvas.Brush.Color := clHighlight; + end; + if not Enabled then + Canvas.Font.Color := clGrayText; + + AText := GetPaintedText; + W := ClientWidth - FButtonWidth; + X := 2; + case FAlignment of + taRightJustify: X := W - Canvas.TextWidth(AText) - 3; + taCenter: X := (W - Canvas.TextWidth(AText)) div 2; + end; + SetRect(R , 1, 1, W - 1, ClientHeight - 1); + Canvas.TextRect(R, X, 2, AText); + if Selected then + Canvas.DrawFocusRect(R); + SetRect(R, W , 0, ClientWidth, ClientHeight); + Flags := DFCS_SCROLLCOMBOBOX; + if FPressed then + Flags := Flags or DFCS_FLAT or DFCS_PUSHED; + if not Enabled then + Flags := Flags or DFCS_INACTIVE; + DrawFrameControl(Canvas.Handle, R, DFC_SCROLL, Flags); +end; + +function TCustomdxVTreeViewEdit.GetPaintedText: string; +begin + Result := FText; +end; + +procedure TCustomdxVTreeViewEdit.DropDownOk; +begin + if (VirtualTreeView <> nil) and (VirtualTreeView.Selected <> nil) then + begin + if (FTextStyle = tvtsFull) then + Text := GetFullTreeNodeName(VirtualTreeView.Selected, FDividedChar) + else + Text := VirtualTreeView.Selected.Text; + end; +end; + +procedure TCustomdxVTreeViewEdit.PrepareDropDown; +var + Style: Integer; +begin + if VirtualTreeView <> nil then + with VirtualTreeView do + begin + VirtualTreeView.OnGetImageIndex := FOnGetImageIndex; + VirtualTreeView.OnGetSelectedIndex := FOnGetSelectedIndex; + Style := GetWindowLong(Handle, GWL_STYLE); + Style := Style or TVS_HASBUTTONS or TVS_HASLINES or TVS_LINESATROOT; + SetWindowLong(Handle, GWL_STYLE, Style); + if not TreeViewShowButtons then + Style := Style and not TVS_HASBUTTONS; + if not TreeViewShowLines then + Style := Style and not TVS_HASLINES; + if not TreeViewShowRoot then + Style := Style and not TVS_LINESATROOT; + SetWindowLong(Handle, GWL_STYLE, Style); + end; +end; + +procedure TCustomdxVTreeViewEdit.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); +begin + inherited SetBounds(ALeft, ATop, AWidth, GetTextHeight + GetBorderSize + 4); +end; + +procedure TCustomdxVTreeViewEdit.CMCtl3DChanged(var Message: TMessage); +begin + if NewStyleControls then + begin + RecreateWnd; + Height := 0; + end; + inherited; +end; + +procedure TCustomdxVTreeViewEdit.CMFontChanged(var Message: TMessage); +begin + inherited; + Height := 0; +end; + +procedure TCustomdxVTreeViewEdit.CMEnabledChanged(var Message: TMessage); +begin + Invalidate; + inherited; +end; + +procedure TCustomdxVTreeViewEdit.CMMouseLeave(var Message: TMessage); +begin + if FPressed then + begin + FPressed := False; + Invalidate; + end; + inherited; +end; + +procedure TCustomdxVTreeViewEdit.WMGetDlgCode(var Message: TWMGetDlgCode); +begin + Message.Result := DLGC_WANTARROWS; +end; + +procedure TCustomdxVTreeViewEdit.WMKillFocus(var Message: TWMKillFocus); +begin + inherited; + FFocused := False; + Invalidate; +end; + +procedure TCustomdxVTreeViewEdit.WMSetFocus(var Message: TWMSetFocus); +begin + inherited; + FFocused := True; + Invalidate; +end; + +procedure TCustomdxVTreeViewEdit.SetText(Value: string); +begin + FText := Value; + Invalidate; +end; + +procedure TCustomdxVTreeViewEdit.SetDividedChar(Value: Char); +begin + FDividedChar := Value; + if (VirtualTreeView <> nil) and (VirtualTreeView.Selected <> nil) then + GetFullTreeNodeName(VirtualTreeView.Selected, FDividedChar); + Invalidate; +end; + +function TCustomdxVTreeViewEdit.CanSelectTreeNode(ANode: TTreeNode): Boolean; +begin + Result := (ANode <> nil) and (not ANode.HasChildren or CanSelectParents); +end; + +function TCustomdxVTreeViewEdit.GetCustomDraw: TTreeViewCustomDraw; +begin + if VirtualTreeView <> nil then + Result := VirtualTreeView.OnCustomDraw + else + Result := nil; +end; + +function TCustomdxVTreeViewEdit.GetTreeViewColor: TColor; +begin + if VirtualTreeView <> nil then + Result := VirtualTreeView.Color + else + Result := clNone; +end; + +function TCustomdxVTreeViewEdit.GetTreeViewCursor: TCursor; +begin + if VirtualTreeView <> nil then + Result := VirtualTreeView.Cursor + else + Result := crNone; +end; + +function TCustomdxVTreeViewEdit.GetTreeViewFont: TFont; +begin + if VirtualTreeView <> nil then + Result := VirtualTreeView.Font + else + Result := nil; +end; + +function TCustomdxVTreeViewEdit.GetTreeViewHint: string; +begin + if VirtualTreeView <> nil then + Result := VirtualTreeView.Hint; +end; + +function TCustomdxVTreeViewEdit.GetTreeViewImages: {$IFDEF DELPHI4}TCustomImageList{$ELSE}TImageList{$ENDIF}; +begin + if VirtualTreeView <> nil then + Result := VirtualTreeView.Images + else Result := nil; +end; + +function TCustomdxVTreeViewEdit.GetTreeViewIndent: Integer; +begin + if VirtualTreeView <> nil then + Result := VirtualTreeView.Indent + else Result := -1; +end; + +function TCustomdxVTreeViewEdit.GetTreeViewPopupMenu: TPopupMenu; +begin + if VirtualTreeView <> nil then + Result := VirtualTreeView.PopupMenu + else Result := nil; +end; + +function TCustomdxVTreeViewEdit.GetTreeViewReadOnly: Boolean; +begin + if VirtualTreeView <> nil then + Result := VirtualTreeView.ReadOnly + else Result := False; +end; + +function TCustomdxVTreeViewEdit.GetSelectedTreeNode: TTreeNode; +begin + if VirtualTreeView <> nil then + Result := VirtualTreeView.Selected + else Result := nil; +end; + +function TCustomdxVTreeViewEdit.GetTreeViewShowButtons: Boolean; +begin + if VirtualTreeView <> nil then + Result := VirtualTreeView.ShowButtons + else Result := False; +end; + +function TCustomdxVTreeViewEdit.GetTreeViewShowHint: Boolean; +begin + if VirtualTreeView <> nil then + Result := VirtualTreeView.ShowHint + else Result := False; +end; + +function TCustomdxVTreeViewEdit.GetTreeViewShowLines: Boolean; +begin + if VirtualTreeView <> nil then + Result := VirtualTreeView.ShowLines + else Result := False; +end; + +function TCustomdxVTreeViewEdit.GetTreeViewShowRoot: Boolean; +begin + if VirtualTreeView <> nil then + Result := VirtualTreeView.ShowRoot + else Result := False; +end; + +function TCustomdxVTreeViewEdit.GetTreeViewSortType: TSortType; +begin + if VirtualTreeView <> nil then + Result := VirtualTreeView.SortType + else Result := stNone; +end; + +function TCustomdxVTreeViewEdit.GetTreeViewStateImages: {$IFDEF DELPHI4}TCustomImageList{$ELSE}TImageList{$ENDIF}; +begin + if VirtualTreeView <> nil then + Result := VirtualTreeView.StateImages + else Result := nil; +end; + +procedure TCustomdxVTreeViewEdit.SetCustomDraw(Value: TTreeViewCustomDraw); +begin + if VirtualTreeView <> nil then + VirtualTreeView.OnCustomDraw := Value; +end; + +procedure TCustomdxVTreeViewEdit.SetTreeViewColor(Value: TColor); +begin + if VirtualTreeView <> nil then + VirtualTreeView.Color := Value; +end; + +procedure TCustomdxVTreeViewEdit.SetTreeViewCursor(Value: TCursor); +begin + if VirtualTreeView <> nil then + VirtualTreeView.Cursor := Value; +end; + +procedure TCustomdxVTreeViewEdit.SetTreeViewFont(Value: TFont); +begin + if VirtualTreeView <> nil then + VirtualTreeView.Font := Value; +end; + +procedure TCustomdxVTreeViewEdit.SetTreeViewHint(Value: string); +begin + if VirtualTreeView <> nil then + VirtualTreeView.Hint := Value; +end; + +procedure TCustomdxVTreeViewEdit.SetTreeViewImages(Value: {$IFDEF DELPHI4}TCustomImageList{$ELSE}TImageList{$ENDIF}); +begin + if VirtualTreeView <> nil then + VirtualTreeView.Images := Value; +end; + +procedure TCustomdxVTreeViewEdit.SetTreeViewIndent(Value: Integer); +begin + if VirtualTreeView <> nil then + VirtualTreeView.Indent := Value; +end; + +procedure TCustomdxVTreeViewEdit.SetTreeViewPopupMenu(Value: TPopupMenu); +begin + if VirtualTreeView <> nil then + VirtualTreeView.PopupMenu := Value; +end; + +procedure TCustomdxVTreeViewEdit.SetTreeViewReadOnly(Value: Boolean); +begin + if VirtualTreeView <> nil then + VirtualTreeView.ReadOnly := Value; +end; + +procedure TCustomdxVTreeViewEdit.SetTreeViewShowButtons(Value: Boolean); +begin + if VirtualTreeView <> nil then + VirtualTreeView.ShowButtons := Value; +end; + +procedure TCustomdxVTreeViewEdit.SetTreeViewShowHint(Value: Boolean); +begin + if VirtualTreeView <> nil then + VirtualTreeView.ShowHint := Value; +end; + +procedure TCustomdxVTreeViewEdit.SetTreeViewShowLines(Value: Boolean); +begin + if VirtualTreeView <> nil then + VirtualTreeView.ShowLines := Value; +end; + +procedure TCustomdxVTreeViewEdit.SetTreeViewShowRoot(Value: Boolean); +begin + if VirtualTreeView <> nil then + VirtualTreeView.ShowRoot := Value; +end; + +procedure TCustomdxVTreeViewEdit.SetTreeViewSortType(Value: TSortType); +begin + if VirtualTreeView <> nil then + VirtualTreeView.SortType := Value; +end; + +procedure TCustomdxVTreeViewEdit.SetTreeViewStateImages(Value: {$IFDEF DELPHI4}TCustomImageList{$ELSE}TImageList{$ENDIF}); +begin + if VirtualTreeView <> nil then + VirtualTreeView.StateImages := Value; +end; + +{TdxTreeViewEdit} + +constructor TCustomdxTreeViewEdit.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FTreeView := TPopupTreeView.Create(Self); + CreateVirtualTreeView; +end; + +destructor TCustomdxTreeViewEdit.Destroy; +begin + if VirtualTreeView <> nil then + TPopupTreeView(VirtualTreeView).IsDestroying := True; + FMemStream.Free; + FImagesStream.Free; + inherited Destroy; +end; + +function TCustomdxTreeViewEdit.VirtualTreeView: TCustomdxTreeView; +begin + Result := FTreeView; +end; + +procedure TCustomdxTreeViewEdit.Loaded; +begin + inherited Loaded; +end; + +procedure TCustomdxTreeViewEdit.CreateWnd; +var + ANode: TTreeNode; + Index: Integer; +begin + inherited CreateWnd; + if FMemStream <> nil then + begin + if VirtualTreeView <> nil then + begin + VirtualTreeView.LoadFromStream(FMemStream); + ANode := VirtualTreeView.Items[0]; + while ANode <> nil do + begin + FImagesStream.Read(Index, SizeOf(Integer)); + ANode.ImageIndex := Index; + FImagesStream.Read(Index, SizeOf(Integer)); + ANode.SelectedIndex := Index; + FImagesStream.Read(Index, SizeOf(Integer)); + ANode.StateIndex := Index; + ANode := ANode.GetNext; + end; + end; + FMemStream.Free; + FMemStream := nil; + FImagesStream.Free; + FImagesStream := nil; + end; +end; + +procedure TCustomdxTreeViewEdit.DestroyWnd; +begin + SaveNodesToStream; + inherited DestroyWnd; +end; + +procedure TCustomdxTreeViewEdit.DestroyWindowHandle; +begin + SaveNodesToStream; + inherited DestroyWindowHandle; +end; + +procedure TCustomdxTreeViewEdit.SaveNodesToStream; +var + ANode: TTreeNode; +begin + if not (csDestroying in ComponentState) and (VirtualTreeView <> nil) and (VirtualTreeView.Items.Count > 0) and (FMemStream = nil) then + begin + FMemStream := TMemoryStream.Create; + VirtualTreeView.SaveToStream(FMemStream); + FMemStream.Position := 0; + FImagesStream := TMemoryStream.Create; + ANode := VirtualTreeView.Items[0]; + while ANode <> nil do + begin + FImagesStream.Write(ANode.ImageIndex, SizeOf(Integer)); + FImagesStream.Write(ANode.SelectedIndex, SizeOf(Integer)); + FImagesStream.Write(ANode.StateIndex, SizeOf(Integer)); + ANode := ANode.GetNext; + end; + FImagesStream.Position := 0; + end; +end; + +procedure TCustomdxTreeViewEdit.PrepareDropDown; +begin + inherited; + SearchTreeNode; +end; + +procedure TCustomdxTreeViewEdit.DropDown; +begin + if GetRealParentForm(Self) <> FOldParentForm then + begin + FOldParentForm := GetRealParentForm(Self); + TPopupTreeView(VirtualTreeView).RecreateWnd; + end; + FOldSelected := Selected; + inherited; +end; + +procedure TCustomdxTreeViewEdit.CloseUp(Accept: Boolean); +begin + if FListVisible and not Accept and (VirtualTreeView <> nil) then + VirtualTreeView.Selected := FOldSelected; + inherited CloseUp(Accept); +end; + +procedure TCustomdxTreeViewEdit.SearchTreeNode; +var + i: Integer; + St: string; +begin + if Length(FText) = 0 then + Exit; + if TextStyle = tvtsShort then + begin + for i := 0 to VirtualTreeView.Items.Count - 1 do + if FText = VirtualTreeView.Items[i].Text then + begin + VirtualTreeView.Selected := VirtualTreeView.Items[i]; + VirtualTreeView.Selected.MakeVisible; + Break; + end; + end + else + for i := 0 to VirtualTreeView.Items.Count - 1 do + begin + St := GetFullTreeNodeName(VirtualTreeView.Items[i], FDividedChar); + if FText = St then + begin + VirtualTreeView.Selected := VirtualTreeView.Items[i]; + VirtualTreeView.Selected.MakeVisible; + Break; + end; + end; +end; + +function TCustomdxTreeViewEdit.GetTreeNodeByText(ParentTreeNode: TTreeNode; + Text: string; flag: Boolean): TTreeNode; +var + tmp: TTreeNode; +begin + Result := nil; + if ParentTreeNode = nil then + begin + tmp := VirtualTreeView.Items.GetFirstNode; + while (tmp <> nil) and (Result = nil) do + if tmp.Text = Text then + Result := tmp + else + tmp := tmp.GetNext; + end + else + begin + tmp := ParentTreeNode.GetFirstChild; + while (tmp <> nil) and (Result = nil) do + if tmp.Text = Text then + Result := tmp + else + begin + if flag and tmp.HasChildren then + Result := GetTreeNodeByText(tmp, Text, flag); + if Result = nil then + tmp := ParentTreeNode.GetNextChild(tmp); + end; + end; +end; + +function TCustomdxTreeViewEdit.GetItems: TTreeNodes; +begin + Result := VirtualTreeView.Items; +end; + +procedure TCustomdxTreeViewEdit.SetItems(Value: TTreeNodes); +begin + VirtualTreeView.Items := Value; +end; + +{ TdxDBTreeViewEdit } + +constructor TdxDBTreeViewEdit.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := ControlStyle + [csReplicatable]; + + FDataLink := TFieldDataLink.Create; + FDataLink.Control := Self; + FDataLink.OnDataChange := DataChange; + FDataLink.OnUpdateData := UpdateData; +end; + +destructor TdxDBTreeViewEdit.Destroy; +begin + FDataLink.Free; + FDataLink := nil; + FCanvas.Free; + inherited Destroy; +end; + +procedure TdxDBTreeViewEdit.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (FDataLink <> nil) and (AComponent = DataSource) then + DataSource := nil; +end; + +procedure TdxDBTreeViewEdit.DataChange(Sender: TObject); +begin + if FDataLink.Field <> nil then + begin + if FAlignment <> FDataLink.Field.Alignment then + FAlignment := FDataLink.Field.Alignment; + Text := FDataLink.Field.Text + end + else + if csDesigning in ComponentState then + Text := Name + else + Text := ''; +end; + +procedure TdxDBTreeViewEdit.UpdateData(Sender: TObject); +begin + if (FDataLink.Field <> nil) and FDataLink.Edit then + FDataLink.Field.Text := Text + else + Text := ''; +end; + +procedure TdxDBTreeViewEdit.DropDown; +begin + inherited DropDown; + FDataLink.Modified; +end; + +procedure TdxDBTreeViewEdit.DropDownOk; +var + AStoredText: string; +begin + inherited DropDownOk; + AStoredText := FText; + if (FDataLink.Field <> nil) and (FDataLink.Edit) then + FDataLink.Field.Text := AStoredText + else Text := ''; +end; + +function TdxDBTreeViewEdit.GetPaintedText: string; +begin + if FDataLink.Field <> nil then + Result := FDataLink.Field.Text + else Result := ''; +end; + +function TdxDBTreeViewEdit.IsReadOnly: Boolean; +begin + Result := ReadOnly; +end; + +function TdxDBTreeViewEdit.GetDataSource: TDataSource; +begin + Result := FDataLink.DataSource; +end; + +procedure TdxDBTreeViewEdit.SetDataSource(Value: TDataSource); +begin + FDataLink.DataSource := Value; + if Value <> nil then + Value.FreeNotification(Self); +end; + +function TdxDBTreeViewEdit.GetDataField: string; +begin + Result := FDataLink.FieldName; +end; + +procedure TdxDBTreeViewEdit.SetDataField(const Value: string); +begin + FDataLink.FieldName := Value; +end; + +function TdxDBTreeViewEdit.GetReadOnly: Boolean; +begin + Result := FDataLink.ReadOnly; +end; + +procedure TdxDBTreeViewEdit.SetReadOnly(Value: Boolean); +begin + FDataLink.ReadOnly := Value; +end; + +function TdxDBTreeViewEdit.GetField: TField; +begin + Result := FDataLink.Field; +end; + +procedure TdxDBTreeViewEdit.CMExit(var Message: TCMExit); +begin + try + FDataLink.UpdateRecord; + except + SetFocus; + raise; + end; + inherited; +end; + +procedure TdxDBTreeViewEdit.CMGetDatalink(var Message: TMessage); +begin + Message.Result := Integer(FDataLink); +end; + +{ TDataLinkLookupTreeView } + +procedure TDataLinkLookupTreeView.ActiveChanged; +begin + if LookupTreeView <> nil then + LookupTreeView.DataLinkActiveChanged; +end; + +{ TCustomdxLookupTreeView } +constructor TCustomdxLookupTreeView.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ListLink := TDataLinkLookupTreeView.Create; + ListLink.LookupTreeView := Self; + FKeyFieldValue := Null; + DBTreeView := TPopupDBTreeView.Create(Self); + CreateVirtualTreeView; +end; + +destructor TCustomdxLookupTreeView.Destroy; +begin + ListLink.LookupTreeView := nil; + ListLink.Free; + inherited Destroy; +end; + +function TCustomdxLookupTreeView.VirtualTreeView: TCustomdxTreeView; +begin + Result := DBTreeView; +end; + +procedure TCustomdxLookupTreeView.DropDown; +begin + with DBTreeView do + begin + if GetRealParentForm(Self) <> FOldParentForm then + begin + FOldParentForm := GetRealParentForm(Self); + TPopupDBTreeView(DBTreeView).RecreateWnd; + end; + KeyField := FKeyFieldName; + ParentField := FParentFieldName; + ListField := FListFieldName; + DisplayField := FDisplayFieldName; + OnSetDisplayItemText := FOnSetDisplayItemText; + ImageIndexField := FImageIndexFieldName; + StateIndexField := FStateIndexFieldName; + DataSource := ListSource; + end; + if not VarIsNull(FKeyFieldValue) then + DBTreeView.GotoKeyFieldValue(FKeyFieldValue); + if FAssignField <> nil then + FDropDownKeyValue := FAssignField.Value + else + if FKeyField <> nil then + FDropDownKeyValue := FKeyField.Value; + inherited; +end; + +procedure TCustomdxLookupTreeView.CloseUp(Accept: Boolean); +begin + inherited CloseUp(Accept); + if not Accept then + ResetDropDown; +end; + +procedure TCustomdxLookupTreeView.DropDownOk; +begin + inherited; + FKeyFieldValue := Null; + if FKeyField <> nil then + FKeyFieldValue := FKeyField.Value; + if (FTextStyle <> tvtsFull) and (FListField <> nil) then + Text := FListField.DisplayText; +end; + +function TCustomdxLookupTreeView.GetListSource: TDataSource; +begin + Result := ListLink.DataSource; +end; + +function TCustomdxLookupTreeView.GetAddNewItem: TAddNewDBTreeNodeEvent; +begin + Result := DBTreeView.onAddNewItem; +end; + +function TCustomdxLookupTreeView.GetOptions: TdxDBTreeViewOptions; +begin + Result := DBTreeView.Options; +end; + +function TCustomdxLookupTreeView.GetRootValue: {$IFNDEF DELPHI6}string{$ELSE}Variant{$ENDIF}; +begin + Result := DBTreeView.RootValue; +end; + +procedure TCustomdxLookupTreeView.SetAddNewItem(Value: TAddNewDBTreeNodeEvent); +begin + DBTreeView.OnAddNewItem := Value; +end; + +procedure TCustomdxLookupTreeView.SetKeyField(Value: string); +begin + if Value <> FKeyFieldName then + begin + FKeyFieldName := Value; + DataLinkActiveChanged; + end; +end; + +procedure TCustomdxLookupTreeView.SetListField(Value: string); +begin + if Value <> FListFieldName then + begin + FListFieldName := Value; + DataLinkActiveChanged; + end; +end; + +procedure TCustomdxLookupTreeView.SetOptions(Value: TdxDBTreeViewOptions); +begin + DBTreeView.Options := Value; +end; + +procedure TCustomdxLookupTreeView.SetRootValue(Value: {$IFNDEF DELPHI6}string{$ELSE}Variant{$ENDIF}); +begin + DBTreeView.RootValue := Value; +end; + +procedure TCustomdxLookupTreeView.SetParentField(Value: string); +begin + if Value <> FParentFieldName then + begin + FParentFieldName := Value; + DataLinkActiveChanged; + end; +end; + +procedure TCustomdxLookupTreeView.SetListSource(Value: TDataSource); +begin + if Value <> ListLink.DataSource then + ListLink.DataSource := Value; +end; + +procedure TCustomdxLookupTreeView.SetAssignField(Value: string); +begin + if Value <> FAssignFieldName then + begin + FAssignFieldName := Value; + DataLinkActiveChanged; + end; +end; + +procedure TCustomdxLookupTreeView.DataLinkActiveChanged; +begin + FKeyField := nil; + FListField := nil; + FAssignField := nil; + FParentField := nil; + if ListLink.Active then + begin + if FKeyFieldName <> '' then + FKeyField := ListLink.DataSet.FieldByName(FKeyFieldName); + if FListFieldName <> '' then + FListField := ListLink.DataSet.FieldByName(FListFieldName); + if FAssignFieldName <> '' then + FAssignField := ListLink.DataSet.FieldByName(FAssignFieldName); + if FParentFieldName <> '' then + FParentField := ListLink.DataSet.FieldByName(FParentFieldName); + if FKeyField <> nil then + FKeyFieldValue := FKeyField.Value; + if FListField <> nil then + Text := FListField.DisplayText; + end; +end; + +procedure TCustomdxLookupTreeView.ResetDropDown; +begin + if FAssignField <> nil then + DBTrDataSetLocate(ListLink.DataSet, FAssignFieldName, FDropDownKeyValue, []) + else + if FKeyField <> nil then + DBTrDataSetLocate(ListLink.DataSet, FKeyFieldName, FDropDownKeyValue, []); +end; + +{ TdxDBLookupTreeView } + +constructor TdxDBLookupTreeView.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := ControlStyle + [csReplicatable]; + FDataLink := TFieldDataLink.Create; + FDataLink.Control := Self; + FDataLink.OnDataChange := DataChange; + FDataLink.OnActiveChange := ActiveChange; + FDataLink.OnUpdateData := UpdateData; + FCloseUpFlag := False; +end; + +destructor TdxDBLookupTreeView.Destroy; +begin + FDataLink.Free; + FDataLink := nil; + FCanvas.Free; + inherited Destroy; +end; + +procedure TdxDBLookupTreeView.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (FDataLink <> nil) and (AComponent = DataSource) then + DataSource := nil; +end; + +procedure TdxDBLookupTreeView.SearchTreeNode; +begin + if (FDataLink.Field <> nil) and (DBTreeView <> nil) then + DBTreeView.GotoKeyFieldValue(FDataLink.Field.Value); +end; + +procedure TdxDBLookupTreeView.PrepareDropDown; +begin + inherited; + SearchTreeNode; +end; + +procedure TdxDBLookupTreeView.ActiveChange(Sender: TObject); +begin + CheckNotCircular; +end; + +procedure TdxDBLookupTreeView.DataChange(Sender: TObject); +begin + if FUpdateDataFlag then Exit; + + if (FListField <> nil) and (FAlignment <> FListField.Alignment) then + FAlignment := FListField.Alignment; + if FDataLink.Field <> nil then + Text := GetDisplayText + else + if csDesigning in ComponentState then + Text := Name + else + Text := ''; +end; + +procedure TdxDBLookupTreeView.UpdateData(Sender: TObject); +begin + FUpdateDataFlag := True; + if FDataLink.Active then + begin + if not FDataLink.Editing then + FDataLink.Edit; + if (FDataLink.DataSet.State = dsInsert) or (FDataLink.dataSet.State = dsEdit) then + FDataLink.Field.Value := GetLookupValue; + end; + FUpdateDataFlag := False; +end; + +procedure TdxDBLookupTreeView.DropDown; +begin + inherited DropDown; + FDataLink.Modified; +end; + +procedure TdxDBLookupTreeView.DataLinkActiveChanged; +begin + CheckNotCircular; + inherited DataLinkActiveChanged; + DataChange(nil); +end; + +procedure TdxDBLookupTreeView.DropDownOk; +begin + inherited DropDownOk; + UpdateData(Self); +end; + +function TdxDBLookupTreeView.GetPaintedText: string; +begin + Result := GetDisplayText; +end; + +function TdxDBLookupTreeView.IsReadOnly: Boolean; +begin + Result := ReadOnly; +end; + +procedure TdxDBLookupTreeView.CloseUp(Accept: Boolean); +begin + if FCloseUpFlag then Exit; + FCloseUpFlag := True; + inherited CloseUp(Accept); + FCloseUpFlag := False; +end; + +function TdxDBLookupTreeView.GetDisplayText: string; +var + b: Boolean; + AKeyValue: Variant; +begin + Result := ''; + if (FDataLink.Field = nil) or (FKeyField = nil) or (FListField = nil) or (FParentField = nil) then + Exit; + if ListLink.Active then + begin + ListLink.DataSet.DisableControls; + if FAssignField <> nil then + b:= DBTrDataSetLocate(ListLink.DataSet, FAssignFieldName, FDataLink.Field.Value, []) + else + b := DBTrDataSetLocate(ListLink.DataSet, FKeyFieldName, FDataLink.Field.Value, []); + if b then + begin + Result := FListField.Text; + if FTextStyle = tvtsFull then + begin + AKeyValue := FKeyField.Value; + while DBTrDataSetLocate(ListLink.DataSet, FKeyFieldName, FParentField.Value, []) + and not VarEquals(FParentField.Value, FKeyField.Value) do + Result := FListField.Text + FDividedChar + Result; + DBTrDataSetLocate(ListLink.DataSet, FKeyFieldName, AKeyValue, []); + end; + end; + ListLink.DataSet.EnableControls; + end; +end; + +function TdxDBLookupTreeView.GetLookupValue: Variant; +begin + if not ListLink.Active then + Result := Null + else + if FAssignField <> nil then + Result := FAssignField.Value + else + Result := FKeyField.Value; +end; + +function TdxDBLookupTreeView.GetDataSource: TDataSource; +begin + Result := FDataLink.DataSource; +end; + +procedure TdxDBLookupTreeView.SetDataSource(Value: TDataSource); +begin + FDataLink.DataSource := Value; + if Value <> nil then + Value.FreeNotification(Self); +end; + +function TdxDBLookupTreeView.GetDataField: string; +begin + Result := FDataLink.FieldName; +end; + +procedure TdxDBLookupTreeView.SetDataField(const Value: string); +begin + FDataLink.FieldName := Value; +end; + +function TdxDBLookupTreeView.GetReadOnly: Boolean; +begin + Result := FDataLink.ReadOnly; +end; + +procedure TdxDBLookupTreeView.SetReadOnly(Value: Boolean); +begin + FDataLink.ReadOnly := Value; +end; + +function TdxDBLookupTreeView.GetField: TField; +begin + Result := FDataLink.Field; +end; + +procedure TdxDBLookupTreeView.CMExit(var Message: TCMExit); +begin + try + FDataLink.UpdateRecord; + except + SetFocus; + raise; + end; + inherited; +end; + +procedure TdxDBLookupTreeView.CMGetDatalink(var Message: TMessage); +begin + Message.Result := Integer(FDataLink); +end; + +procedure TdxDBLookupTreeView.CheckNotCircular; +begin + {$IFDEF DELPHI3} + if FDataLink.Active and ListLink.Active and (FDataLink.DataSet.IsLinkedTo(ListSource) + or ListLink.DataSet.IsLinkedTo(DataSource)) then + DatabaseError(SCircularDataLink); + {$ENDIF} +end; + +initialization + FUser32DLL := LoadLibrary('USER32'); + +end. diff --git a/official/x.35/ExpressDBTree Suite/Sources/dxlocate.pas b/official/x.35/ExpressDBTree Suite/Sources/dxlocate.pas new file mode 100644 index 00000000..2d19b68e --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Sources/dxlocate.pas @@ -0,0 +1,16 @@ +unit dxlocate; + +interface +{$I cxVer.inc} +uses DB{$IFDEF DELPHI6}, Variants{$ENDIF}; + +function DBTrDataSetLocate(DataSet: TDataSet; AFieldName: string; AValue: Variant; AOptions: TLocateOptions): Boolean; + +implementation + +function DBTrDataSetLocate(DataSet: TDataSet; AFieldName: string; AValue: Variant; AOptions: TLocateOptions): Boolean; +begin + Result := DataSet.Locate(AFieldName, AValue, AOptions); +end; + +end. diff --git a/official/x.35/ExpressDBTree Suite/Sources/dxtree.pas b/official/x.35/ExpressDBTree Suite/Sources/dxtree.pas new file mode 100644 index 00000000..bc6cae71 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Sources/dxtree.pas @@ -0,0 +1,839 @@ +unit dxtree; +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express tree view control } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSGRID AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +{$I cxVer.inc} + +interface + +uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + ComCtrls, CommCtrl, ExtCtrls ; + +type + TdxTreeViewOption = (trCanDelete, trConfirmDelete); + TdxTreeViewOptions = set of TdxTreeViewOption; + + TDragDropTreeNode = procedure(Destination, Source: TTreeNode; + var Accept: Boolean) of object; + TEndDragTreeNode = procedure(Destination, Source: TTreeNode; + var AttachMode: TNodeAttachMode) of object; + TDragDropIsCopy = procedure(Destination, Source: TTreeNode; + var IsCopy: Boolean) of object; + TTreeViewCustomDraw = procedure(Sender: TObject; TreeNode: TTreeNode; + AFont: TFont; var AColor, ABkColor: TColor) of object; + + // Avoid MoveTo bug in D4. + TdxTreeNode = class(TTreeNode) + {$IFDEF DELPHI4} + procedure MoveTo(Destination: TTreeNode; Mode: TNodeAttachMode); override; + {$ENDIF} + end; + + TCustomdxTreeView = class(TCustomTreeView) + private + FOptions: TdxTreeViewOptions; + FSelectedIndex: Integer; + FDragDropProcessingFlag: Boolean; + FDragObject: TDragObject; + FDeletingConfirmationMessage: string; + FIsConfirmationAssigned: Boolean; + FScrollTimerID: Integer; + fntcd: TFont; + FCanvas: TControlCanvas; + FOnDragDropTreeNode: TDragDropTreeNode; + FOnEndDragTreeNode: TEndDragTreeNode; + FOnDragDropIsCopy: TDragDropIsCopy; + FOnCustomDraw: TTreeViewCustomDraw; + FOnSetEditText: TTVEditedEvent; + FShowNodeHint: Boolean; + FInternalDragObject: TDragObject; + + function GetDragSourceTreeNode: TTreeNode; + function GetDeletingConfirmationMessage: string; + procedure SetSelectedIndex(Value: Integer); + procedure SetDeletingConfirmationMessage(const AValue: string); + procedure CMDrag(var Message: TCMDrag); message CM_DRAG; + function DoCNNotify(var Message: TWMNotify): Boolean; + function DoWMNotify(var Message: TWMNotify): Boolean; + procedure CNNotify(var Message: TWMNotify); message CN_NOTIFY; + procedure WMNotify(var Message: TWMNotify); message WM_NOTIFY; + procedure ReadIsAssigned(AReader: TReader); + procedure WriteIsAssigned(AWriter: TWriter); + protected + CopyTreeNodeStructFlag: Boolean; + + procedure DefineProperties(AFiler: TFiler); override; + + procedure DoCustomDraw(TreeNode: TTreeNode; AFont: TFont; + var AColor, ABkColor: TColor); virtual; + procedure DoStartDrag(var DragObject: TDragObject); override; + procedure DoEndDrag(Target: TObject; X, Y: Integer); override; + function GetNodeFromItem(const Item: TTVItem): TTreeNode; + function GetListItemText(TreeNode: TTreeNode): String; virtual; + procedure InsertTreeNodeStructure(ListS, ListD: TList; Flag: Boolean); virtual; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure DoDragDropTreeNode(Destination, Source: TTreeNode; var Accept: Boolean); virtual; + procedure DoDragDropIsCopy(Destination, Source: TTreeNode; var IsCopy: Boolean); virtual; + + property Options: TdxTreeViewOptions read FOptions write FOptions + default [trCanDelete, trConfirmDelete]; + property SelectedIndex: Integer read FSelectedIndex write SetSelectedIndex; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + function CreateNode: TTreeNode; override; + procedure SetFocus; override; + + procedure GetNodeStructure(TreeNode: TTreeNode; List: TList); virtual; + function IsCustomDraw: Boolean; virtual; + function MoveTreeNodeStructure(Source, Destination: TTreeNode; IsCopy: Boolean): TTreeNode; + + property DragSourceTreeNode: TTreeNode read GetDragSourceTreeNode; + property IsConfirmationAssigned: Boolean read FIsConfirmationAssigned write FIsConfirmationAssigned; + property OnSetEditText: TTVEditedEvent read FOnSetEditText write FOnSetEditText; + + property Color; + property DragCursor; + property Font; + property Images; + property Items; + property Indent; + property PopupMenu; + property ReadOnly; + property ShowButtons; + property ShowLines; + property ShowRoot; + property SortType; + property StateImages; + + property OnClick; + property OnChanging; + property OnDblClick; + property OnGetImageIndex; + property OnGetSelectedIndex; + published + {$IFDEF DELPHI3} + property ImeMode; + property ImeName; + property RightClickSelect; + {$ENDIF} + property ShowNodeHint: Boolean read FShowNodeHint write FShowNodeHint; + property OnCustomDraw: TTreeViewCustomDraw read FOnCustomDraw write FOnCustomDraw; + property OnDragDropIsCopy: TDragDropIsCopy read FOnDragDropIsCopy write FOnDragDropIsCopy; + property OnDragDropTreeNode: TDragDropTreeNode read FOnDragDropTreeNode + write FOnDragDropTreeNode; + property OnEndDragTreeNode: TEndDragTreeNode read FOnEndDragTreeNode + write FOnEndDragTreeNode; + + {$IFDEF DELPHI4} + property Anchors; + property AutoExpand; + property BiDiMode; + property Constraints; + property DeletingConfirmationMessage: string read GetDeletingConfirmationMessage write SetDeletingConfirmationMessage stored FIsConfirmationAssigned; + property DragKind; + property HotTrack; + property ParentBiDiMode; + property RowSelect; + property ToolTips; + property OnCustomDrawItem; + property OnEndDock; + property OnStartDock; + {$ENDIF} + {$IFDEF DELPHI5} + property OnAdvancedCustomDraw; + {$ENDIF} + end; + + TdxTreeView = class(TCustomdxTreeView) + published + property ShowButtons; + property BorderStyle; + property DragCursor; + property ShowLines; + property ShowRoot; + property ReadOnly; + property DragMode; + property HideSelection; + property Indent; + property Items; + property OnEditing; + property OnEdited; + property OnExpanding; + property OnExpanded; + property OnCollapsing; + property OnCompare; + property OnCollapsed; + property OnChanging; + property OnChange; + property OnDeletion; + property OnGetImageIndex; + property OnGetSelectedIndex; + property Align; + property Enabled; + property Font; + property Color; + property ParentColor; + property ParentCtl3D; + property Ctl3D; + property Options; + property SelectedIndex; + property SortType; + property TabOrder; + property TabStop default True; + property Visible; + property OnClick; + property OnEnter; + property OnExit; + property OnDragDrop; + property OnDragOver; + property OnStartDrag; + property OnEndDrag; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnDblClick; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property PopupMenu; + property ParentFont; + property ParentShowHint; + property ShowHint; + property Images; + property StateImages; + end; + +resourcestring + dxTreeViewDelConfirm = 'Do you want to delete the item "%s"'; + dxDBTreeViewSmartLoadS = 'Set trSmartRecordLoad in the Options property to decrease the loading time. Do you want to do it now?'; + +implementation + +uses ImgList ; + +{$I dxcmctl.inc} +{$R dxtree.res} + +const + crdxTreeDrag = -1011; + +var +{$IFDEF DELPHI4} + dxTreeViewDragImages: TDragImageList; +{$ELSE} + dxTreeViewDragImages: TCustomImageList; +{$ENDIF} + DropSourceTreeNode: TTreeNode; + OldDragOverTreeNode: TTreeNode; + +type + TDummyControl = class(TWinControl) + public + function GetDragImages: {$IFDEF DELPHI4}TDragImageList{$ELSE}TCustomImageList{$ENDIF}; override; + end; + +function TDummyControl.GetDragImages: {$IFDEF DELPHI4}TDragImageList{$ELSE}TCustomImageList{$ENDIF}; +begin + Result := inherited GetDragImages; +end; + +{TdxTreeNode} +{$IFDEF DELPHI4} +//Avoid MoveTo bug in D4. +procedure TdxTreeNode.MoveTo(Destination: TTreeNode; Mode: TNodeAttachMode); +var + Dummy: TTreeNode; +begin + if Mode in [naAddChild, naAddChildFirst] then + begin + TCustomdxTreeView(TreeView).CopyTreeNodeStructFlag := True; + if Mode = naAddChildFirst then + Dummy := TTreeView(Destination.TreeView).Items.AddChildFirst(Destination, '') + else + Dummy := TTreeView(Destination.TreeView).Items.AddChild(Destination, ''); + TCustomdxTreeView(TreeView).CopyTreeNodeStructFlag := False; + inherited MoveTo(Dummy, naInsert); + TCustomdxTreeView(TreeView).CopyTreeNodeStructFlag := True; + Dummy.Free; + TCustomdxTreeView(TreeView).CopyTreeNodeStructFlag := False; + end + else + inherited MoveTo(Destination, Mode); +end; +{$ENDIF} + +{TCustomdxTreeView} +constructor TCustomdxTreeView.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FScrollTimerID := -1; + FSelectedIndex := -1; + FOptions := [trCanDelete, trConfirmDelete]; + FDragDropProcessingFlag := False; + fntcd := TFont.Create; + FCanvas := TControlCanvas.Create; + FShowNodeHint := True; +end; + +destructor TCustomdxTreeView.Destroy; +begin + fntcd.Free; + FCanvas.Free; + inherited; +end; + +type + TtmpDragObject = class(TDragControlObject) + protected + function GetDragCursor(Accepted: Boolean; X, Y: Integer): TCursor; override; + end; + +function TtmpDragObject.GetDragCursor(Accepted: Boolean; X, Y: Integer): TCursor; +begin + if not Accepted then + Result := crNoDrop + else + if not (GetKeyState(VK_CONTROL) < 0) then + Result := TCustomdxTreeView(Control).DragCursor + else + Result := crdxTreeDrag; +end; + +procedure TCustomdxTreeView.DoStartDrag(var DragObject: TDragObject); +begin + DragObject := TtmpDragObject.Create(Self); + FInternalDragObject := DragObject; + inherited; + dxTreeViewDragImages := GetDragImages; + if Self.Focused then + DropSourceTreeNode := Selected + else + DropSourceTreeNode := nil; +end; + +procedure TCustomdxTreeView.DoEndDrag(Target: TObject; X, Y: Integer); +begin + inherited DoEndDrag(Target, X, Y); + FInternalDragObject.Free; + DropSourceTreeNode := nil; +end; + +procedure TCustomdxTreeView.DoDragDropTreeNode(Destination, Source: TTreeNode; + var Accept: Boolean); +begin + if Assigned(FOnDragDropTreeNode) then + FOnDragDropTreeNode(Destination, Source, Accept); +end; + +procedure TCustomdxTreeView.DoDragDropIsCopy(Destination, Source: TTreeNode; var IsCopy: Boolean); +begin + if Assigned(FOnDragDropIsCopy) then + FOnDragDropIsCopy(Destination, Source, IsCopy); +end; + +procedure TCustomdxTreeView.GetNodeStructure(TreeNode: TTreeNode; List: TList); + + procedure GetNodeStructure_(TreeNode: TTreeNode; List: TList); + var + tn: TTreeNode; + begin + if (TreeNode <> nil) and TreeNode.HasChildren then + begin + tn := TreeNode.GetFirstChild; + while tn <> nil do + begin + List.Add(tn); + if tn.HasChildren then + GetNodeStructure_(tn, List); + tn := TreeNode.GetNextChild (tn); + end; + end; + end; + +begin + List.Add(TreeNode); + GetNodeStructure_(TreeNode, List); +end; + +procedure TCustomdxTreeView.InsertTreeNodeStructure(ListS, ListD: TList; Flag: Boolean); +begin +end; + +function TCustomdxTreeView.GetDragSourceTreeNode: TTreeNode; +begin + if (DropSourceTreeNode <> nil) and (DropSourceTreeNode.TreeView = Self) then + Result := DropSourceTreeNode + else + Result := nil; +end; + +function TCustomdxTreeView.GetDeletingConfirmationMessage: string; +begin + Result := FDeletingConfirmationMessage; + if not FIsConfirmationAssigned then + Result := dxTreeViewDelConfirm; +end; + +procedure TCustomdxTreeView.SetSelectedIndex(Value: Integer); +var + i: Integer; +begin + if Value <> FSelectedIndex then + begin + FSelectedIndex := Value; + for i := 0 to Items.Count - 1 do + Items[i].SelectedIndex := FSelectedIndex; + end; +end; + +procedure TCustomdxTreeView.SetDeletingConfirmationMessage(const AValue: string); +begin + FDeletingConfirmationMessage := AValue; + IsConfirmationAssigned := True; +end; + +function TCustomdxTreeView.CreateNode: TTreeNode; +begin + Result := TdxTreeNode.Create(Items); + if (Result <> nil) and (FSelectedIndex <> -1) then + Result.SelectedIndex := FSelectedIndex +end; + +procedure TCustomdxTreeView.ReadIsAssigned(AReader: TReader); +begin + FIsConfirmationAssigned := AReader.ReadBoolean; +end; + +procedure TCustomdxTreeView.WriteIsAssigned(AWriter: TWriter); +begin + AWriter.WriteBoolean(FIsConfirmationAssigned); +end; + +procedure TCustomdxTreeView.SetFocus; +begin + if (GetParentForm(Self) <> nil) or (ParentWindow <> 0) then + inherited SetFocus; +end; + +procedure TCustomdxTreeView.KeyDown(var Key: Word; Shift: TShiftState); +var + St: string; +begin + if (Key = VK_DELETE) and (trCanDelete in Options) + and not ReadOnly and (Selected <> nil) and not IsEditing then + begin + if IsConfirmationAssigned then + St := Format(DeletingConfirmationMessage, [Selected.Text]) + else + St := Format(dxTreeViewDelConfirm, [Selected.Text]); + if not (trConfirmDelete in Options) or + (MessageDlg(St, mtConfirmation, mbOKCancel, 0) <> idCancel) then + Items.Delete(Selected); + end; + inherited; +end; + +procedure TCustomdxTreeView.CMDrag(var Message: TCMDrag); +var + lpht: TTVHitTestInfo; + TreeNode: TTreeNode; + + procedure HideDragImage; + begin + if dxTreeViewDragImages <> nil then + dxTreeViewDragImages.HideDragImage + else + if FDragObject <> nil then + FDragObject.HideDragImage; + end; + + procedure ShowDragImage; + begin + if dxTreeViewDragImages <> nil then + dxTreeViewDragImages.ShowDragImage + else + if FDragObject <> nil then + FDragObject.ShowDragImage; + end; + + function IsNodeVisible(TreeNode: TTreeNode): Boolean; + var + Rect: TRect; + begin + Result := TreeView_GetItemRect(Handle, TreeNode.ItemId, Rect, False); + Result := Result and (Rect.Top < ClientHeight); + end; + +var + CorrectDragFlag, IsCopyFlag: Boolean; +begin + CorrectDragFlag := False; + with Message, DragRec^ do + begin + case DragMessage of + dmDragEnter: + begin + FDragDropProcessingFlag := True; + OldDragOverTreeNode := nil; + FDragObject := Source; + end; + dmDragMove: + begin + lpht.pt := ScreenToClient(Point(Pos.X, Pos.Y)); + lpht.flags := TVHT_ONITEM; + TreeNode := Items.GetNode(TreeView_HitTest(Handle, lpht)); + + if TreeNode <> nil then + begin + if (OldDragOverTreeNode <> nil) and (OldDragOverTreeNode = TreeNode) then + begin + if (TreeNode = TopItem) or + ((TreeNode.GetPrevVisible <> nil) and (TreeNode.GetPrevVisible = TopItem)) + and (TopItem.GetPrevVisible <> nil) then + TopItem := TopItem.GetPrevVisible + else + if ((TreeNode.GetNextVisible <> nil) and not IsNodeVisible(TreeNode.GetNextVisible) + or ((TreeNode.GetNextVisible <> nil) and (TreeNode.GetNextVisible.GetNextVisible <> nil) + and not IsNodeVisible(TreeNode.GetNextVisible.GetNextVisible))) then + TopItem := TopItem.GetNextVisible; + end; + if OldDragOverTreeNode <> TreeNode then + begin + OldDragOverTreeNode := TreeNode; + HideDragImage; + TreeView_SelectDropTarget(Handle, OldDragOverTreeNode.ItemId); + ShowDragImage; + end; + end + else + begin + OldDragOverTreeNode := nil; + HideDragImage; + TreeView_SelectDropTarget(Handle, nil); + ShowDragImage; + end; + end; + dmDragLeave: + begin + if DropSourceTreeNode <> nil then + begin + HideDragImage; + TreeView_SelectDropTarget(Handle, nil); + DropSourceTreeNode.Selected := True; + ShowDragImage; + end; + FDragObject := nil; + end; + dmDragCancel: + begin + FDragObject := nil; + FDragDropProcessingFlag := False; + OldDragOverTreeNode := nil; + Invalidate; + end; + dmDragDrop: + begin + FDragObject := nil; + IsCopyFlag := GetKeyState(VK_CONTROL) < 0; + if OldDragOverTreeNode <> nil then + begin + TreeView_SelectDropTarget(Handle, nil); + OldDragOverTreeNode.Selected := True; + Invalidate; + if (DropSourceTreeNode <> nil) and not OldDragOverTreeNode.HasAsParent(DropSourceTreeNode) + and (OldDragOverTreeNode <> DropSourceTreeNode) then + begin + DoDragDropIsCopy(DropSourceTreeNode, OldDragOverTreeNode, IsCopyFlag); + if ((OldDragOverTreeNode <> DropSourceTreeNode.Parent) + or IsCopyFlag or Assigned(FOnEndDragTreeNode)) then + begin + CorrectDragFlag := True; + DoDragDropTreeNode(OldDragOverTreeNode, DropSourceTreeNode, CorrectDragFlag); + end; + end; + end + else + if DropSourceTreeNode <> nil then + begin + DoDragDropIsCopy(DropSourceTreeNode, OldDragOverTreeNode, IsCopyFlag); + DoDragDropTreeNode(OldDragOverTreeNode, DropSourceTreeNode, CorrectDragFlag); + end; + if CorrectDragFlag then + begin + TreeNode := MoveTreeNodeStructure(DropSourceTreeNode, OldDragOverTreeNode, IsCopyFlag); + if TreeNode <> nil then + begin + TreeNode.MakeVisible; + Selected := TreeNode; + end; + Message.DragMessage := dmDragDrop; + DropTarget := OldDragOverTreeNode; + end; + FDragDropProcessingFlag := False; + OldDragOverTreeNode := nil; + Invalidate; + end; // dmDragDrop: + end; // case + end; // with + + if (DropSourceTreeNode <> nil) and (Message.DragMessage <> dmDragDrop) + and (Message.DragMessage <> dmDragCancel) + and (OldDragOverTreeNode <> DropSourceTreeNode) then + begin + if OldDragOverTreeNode <> nil then + begin + CorrectDragFlag := (not DropSourceTreeNode.HasChildren + or not OldDragOverTreeNode.HasAsParent(DropSourceTreeNode)) + and not Assigned(OnDragOver); + if CorrectDragFlag then + DoDragDropTreeNode(OldDragOverTreeNode, DropSourceTreeNode, CorrectDragFlag); + end + else + DoDragDropTreeNode(OldDragOverTreeNode, DropSourceTreeNode, CorrectDragFlag); + end; + + inherited; + + if (Message.DragMessage = dmDragDrop) or (Message.DragMessage = dmDragCancel) then + begin + DropSourceTreeNode := nil; + dxTreeViewDragImages := nil; + DropTarget := nil; + end; + + if ((Message.DragMessage = dmDragMove) or (Message.DragMessage = dmDragLeave)) + and CorrectDragFlag and (Message.Result = 0) then + Message.Result := 1; +end; + +function TCustomdxTreeView.MoveTreeNodeStructure(Source, Destination: TTreeNode; IsCopy: Boolean): TTreeNode; +var + i, ind: Integer; + ListS, ListD: TList; + tr: TTreeNode; + AStyle: TNodeAttachMode; +begin + Result := nil; + ListS := TList.Create; + ListD := TList.Create; + CopyTreeNodeStructFlag := IsCopy or (Self <> Source.TreeView); + GetNodeStructure(Source, ListS); + CopyTreeNodeStructFlag := False; + if Destination <> nil then + AStyle := naAddChild + else + AStyle := naAdd; + + if Assigned(FOnEndDragTreeNode) then + FOnEndDragTreeNode(Destination, Source, AStyle); + + if (AStyle = naAddChild) or (AStyle = naAddChildFirst) then + Destination.HasChildren := True; + if (Self <> Source.TreeView) or IsCopy then + begin + CopyTreeNodeStructFlag := True; + tr := nil; + for i := 0 to ListS.Count - 1 do + begin + if i = 0 then + case AStyle of + naAdd: tr := Items.Add(Destination, GetListItemText(TTreeNode(ListS.List[i]))); + naAddFirst: tr := Items.AddFirst(Destination, GetListItemText(TTreeNode(ListS.List[i]))); + naAddChild: tr := Items.AddChild(Destination, GetListItemText(TTreeNode(ListS.List[i]))); + naAddChildFirst: tr := Items.AddChildFirst(Destination, GetListItemText(TTreeNode(ListS.List[i]))); + naInsert: tr := Items.Insert(Destination, GetListItemText(TTreeNode(ListS.List[i]))); + end + else + begin + ind := ListS.IndexOf(TTreeNode(ListS.List[i]).Parent); + tr := Items.AddChild(TTreeNode(ListD.List[ind]), GetListItemText(TTreeNode(ListS.List[i]))) + end; + if tr <> nil then + ListD.Add(tr); + end; + InsertTreeNodeStructure(ListS, ListD, True); + CopyTreeNodeStructFlag := False; + if ListD.Count > 0 then + begin + Result := TTreeNode(ListD[0]); + Destination.HasChildren := True; + end; + end; + if (Self = Source.TreeView) and not IsCopy then + begin + CopyTreeNodeStructFlag := True; + Source.MoveTo(Destination, AStyle); + CopyTreeNodeStructFlag := False; + Result := Source; + end; + ListS.Free; + ListD.Free; + if (Source <> nil) and not TdxTreeView(Source.TreeView).ReadOnly + and (Self <> Source.TreeView) and not IsCopy then + Source.Free; +end; + +function TCustomdxTreeView.GetNodeFromItem(const Item: TTVItem): TTreeNode; +begin + with Item do + if (state and TVIF_PARAM) <> 0 then + begin + Result := TTreeNode(lParam); + end else Result := Items.GetNode(hItem); +end; + +function TCustomdxTreeView.GetListItemText(TreeNode: TTreeNode): String; +begin + if TreeNode <> nil then + Result := TreeNode.Text; +end; + +function TCustomdxTreeView.IsCustomDraw: Boolean; +begin + Result := Assigned(FOnCustomDraw); +end; + +procedure TCustomdxTreeView.DefineProperties(AFiler: TFiler); +begin + inherited DefineProperties(AFiler); + AFiler.DefineProperty('IsConfirmationAssigned', ReadIsAssigned, + WriteIsAssigned, IsConfirmationAssigned); +end; + +procedure TCustomdxTreeView.DoCustomDraw(TreeNode: TTreeNode; AFont: TFont; + var AColor, ABkColor: TColor); +begin + if Assigned(FOnCustomDraw) then + FOnCustomDraw(Self, TreeNode, AFont, AColor, ABkColor); +end; + +function TCustomdxTreeView.DoCNNotify(var Message: TWMNotify): Boolean; +var + pnmlv: PNMTVCustomDraw; + tr: TTreeNode; + htr: HTReeItem; + Color, BkColor: TColor; + St: String; +begin + if (Message.nmhdr^.code = NM_CUSTOMDRAW) {$IFDEF DELPHI5}and not (Assigned(OnAdvancedCustomDraw) + or Assigned(OnAdvancedCustomDrawItem)){$ENDIF} then + begin + Result := False; + pnmlv := PNMTVCustomDraw(TMessage(Message).lParam); + if pnmlv^.nmcd.dwDrawStage = CDDS_PREPAINT then + begin + if IsCustomDraw then + Message.Result := CDRF_NOTIFYITEMDRAW + else + Message.Result := CDRF_DODEFAULT; + end; + if pnmlv^.nmcd.dwDrawStage = CDDS_ITEMPREPAINT then + begin + htr := Pointer(pnmlv^.nmcd.dwItemSpec); + tr := Items.GetNode(htr); + fntcd.Assign(Font); + Color := Font.Color; + BkColor := clWindow; + DoCustomDraw( tr, fntcd, Color, BkColor); + if ((pnmlv^.nmcd.uItemState and TVGN_CARET = 0) + and (pnmlv^.nmcd.uItemState and TVGN_DROPHILITE = 0) + and (OldDragOverTreeNode <> tr)) or not Focused then + begin + pnmlv^.clrText := ColorToRGB(Color); + pnmlv^.clrTextBk := ColorToRGB(bkColor); + end; + + SelectObject(pnmlv^.nmcd.hdc, fntcd.Handle); + Message.Result := CDRF_NEWFONT; + end; + end + else Result := True; + + with Message.NMHdr^ do + if code = TVN_BEGINLABELEDIT then + begin + SetImeMode(TreeView_GetEditControl(handle), ImeMode); + if Assigned(FOnSetEditText) then + with PTVDispInfo(Pointer(Message.NMHdr))^ do + begin + tr := GetNodeFromItem(item); + St := tr.Text; + FOnSetEditText(Self, tr, St); + SendMessage(TreeView_GetEditControl(handle), WM_SETTEXT, 0, Integer(PChar(St))); + end; + end; +end; + +procedure TCustomdxTreeView.CNNotify(var Message: TWMNotify); +begin + if DoCNNotify(Message) then + inherited; +end; + +type + PAToolTipText = ^TAToolTipText; + TAToolTipText = packed record + hdr: TNMHDR; + lpszText: PAnsiChar; + szText: array[0..79] of Char; + hinst: THandle; + uFlags: UINT; + end; + +function TCustomdxTreeView.DoWMNotify(var Message: TWMNotify): Boolean; +begin + if ((Message.nmhdr^.code = TTN_NEEDTEXTA) or (Message.nmhdr^.code = TTN_NEEDTEXTW)) + and not FShowNodeHint then + begin + PAToolTipText(TMessage(Message).lparam).lpszText := PChar(''); + TMessage(Message).Result := 0; + Result := False; + end else Result := True; +end; + +procedure TCustomdxTreeView.WMNotify(var Message: TWMNotify); +begin + if DoWMNotify(Message) then + inherited; +end; + +initialization + OldDragOverTreeNode := nil; + dxTreeViewDragImages := nil; + Screen.Cursors[crdxTreeDrag] := LoadCursor(HInstance, 'DXTREEDRAGCOPY'); + +end. + diff --git a/official/x.35/ExpressDBTree Suite/Sources/dxtree.res b/official/x.35/ExpressDBTree Suite/Sources/dxtree.res new file mode 100644 index 00000000..98c75a99 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Sources/dxtree.res differ diff --git a/official/x.35/ExpressDBTree Suite/Sources/dxtrprds.pas b/official/x.35/ExpressDBTree Suite/Sources/dxtrprds.pas new file mode 100644 index 00000000..fcc661f5 --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Sources/dxtrprds.pas @@ -0,0 +1,713 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express tree view printed dataset } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSGRID AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxtrprds; + +{$I cxVer.inc} + +interface + +uses Classes, SysUtils, dxmdaset, Windows, DB {$IFDEF DELPHI6}, Variants {$ENDIF}; + +type + +TdxDBTreePrintData = class; + +TdxDBTreePrintDataLink = class(TDataLink) +private + FPrintData : TdxDBTreePrintData; +protected + procedure ActiveChanged; override; +end; + +TdxDBTreePrintData = class(TdxMemData) +private + FDataLink : TdxDBTreePrintDataLink; + FKeyFieldName : String; + FParentFieldName : String; + FLevelCount : Integer; + FRootValue : Variant; + FRootStrValue : String; + FMaxLevelCount : Integer; + + function GetTreeDataSource : TDataSource; + procedure SetTreeDataSource(Value : TDataSource); + procedure SetKeyFieldName(Value : String); + procedure SetLevelCount(Value : Integer); + procedure SetParentFieldName(Value : String); + procedure SetRootStrValue(Value : String); + + procedure RefreshStructure; +protected + procedure CopyStructure(ASource: TDataSet); + procedure DoAfterOpen; override; + + property DataLink : TdxDBTreePrintDataLink read FDataLink; +public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Loaded; override; + + property MaxLevelCount : Integer read FMaxLevelCount; +published + property DataSource read GetTreeDataSource write SetTreeDataSource; + property KeyField : String read FKeyFieldName write SetKeyFieldName; + property LevelCount : Integer read FLevelCount write SetLevelCount; + property ParentField : String read FParentFieldName write SetParentFieldName; + property RootValue : String read FRootStrValue write SetRootStrValue; +end; + +procedure FillDBTreePrintedDataSet(ds1 : TdxDBTreePrintData; ds2 : TDataSet); + +const + cDBTreeLevelFieldName = 'dx$level'; + cDBTreeRecNoFieldName = 'dx$recno'; + cDBTreeHasChildrenFieldName = 'dx$haschildren'; + +implementation + +procedure TdxDBTreePrintDataLink.ActiveChanged; +begin + if FPrintData <> nil then + FPrintData.RefreshStructure; +end; + +constructor TdxDBTreePrintData.Create(AOwner : TComponent); +begin + inherited Create(AOwner); + FDataLink := TdxDBTreePrintDataLink.Create; + FDataLink.FPrintData := self; + FLevelCount := 0; + FRootValue := NULL; + FRootStrValue := ''; + FMaxLevelCount := 0; + +end; + +destructor TdxDBTreePrintData.Destroy; +begin + FDataLink.Free; + inherited Destroy; +end; + +procedure TdxDBTreePrintData.Loaded; +begin + inherited Loaded; + RefreshStructure; +end; + +function TdxDBTreePrintData.GetTreeDataSource : TDataSource; +begin + Result := FDataLink.DataSource; +end; + +procedure TdxDBTreePrintData.DoAfterOpen; +begin + inherited DoAfterOpen; + FMaxLevelCount := 0; + FillDBTreePrintedDataSet(self, FDataLink.DataSet); +end; + +procedure TdxDBTreePrintData.SetTreeDataSource(Value : TDataSource); +begin + if(Value <> FDataLink.DataSource) then begin + FDataLink.DataSource := Value; + RefreshStructure; + end; +end; + +procedure TdxDBTreePrintData.SetKeyFieldName(Value : String); +begin + if(FKeyFieldName <> Value) then begin + FKeyFieldName := Value; + RefreshStructure; + end; +end; + +procedure TdxDBTreePrintData.SetLevelCount(Value : Integer); +begin + if(Value < 0) then Value := 0; + if(FLevelCount <> Value) then begin + FLevelCount := Value; + if Not(csLoading in ComponentState) And Active then begin + Close; + Open; + end; + end; +end; + +procedure TdxDBTreePrintData.SetParentFieldName(Value : String); +begin + if(FParentFieldName <> Value) then begin + FParentFieldName := Value; + RefreshStructure; + end; +end; + +procedure TdxDBTreePrintData.SetRootStrValue(Value : String); +begin + if(FRootStrValue <> Value) then begin + FRootStrValue := Value; + if(FRootStrValue = '') then + FRootValue := NULL + else FRootValue := FRootStrValue; + if Not(csLoading in ComponentState) And Active then begin + Close; + Open; + end; + end; +end; + +procedure TdxDBTreePrintData.CopyStructure(ASource: TDataSet); +var + i: Integer; +begin + CheckInactive; + for i := FieldCount - 1 downto 0 do + if Fields[i] <> RecIdField then + Fields[i].Free; + + if (ASource = nil) then Exit; + + FieldDefs := ASource.FieldDefs; + + for i := 0 to FieldDefs.Count - 1 do begin + if SupportedFieldType(FieldDefs.Items[i].DataType) then + FieldDefs.Items[i].CreateField(Self); + end; + + for i := 0 to FieldCount - 1 do + Fields[i].Required := False; + + FieldDefs.Add(cDBTreeLevelFieldName, ftInteger, 0, False); + FieldDefs.Items[FieldDefs.Count - 1].CreateField(self); + FieldDefs.Add(cDBTreeRecNoFieldName, ftInteger, 0, False); + FieldDefs.Items[FieldDefs.Count - 1].CreateField(self); + FieldDefs.Add(cDBTreeHasChildrenFieldName, ftBoolean, 0, False); + FieldDefs.Items[FieldDefs.Count - 1].CreateField(self); +end; + +procedure TdxDBTreePrintData.RefreshStructure; +begin + if (csLoading in ComponentState) then exit; + if Active then + Close; + if(FDataLink.DataSet <> Nil) and FDataLink.DataSet.Active + And (FDataLink.DataSet.FindField(FKeyFieldName) <> Nil) + And (FDataLink.DataSet.FindField(FParentFieldName) <> Nil) then + CopyStructure(FDataLink.DataSet); +end; + +type +TDBTreePrintedNodes = class; + +TDBTreePrintedNode = class +private + Destroying : Boolean; + Owner : TDBTreePrintedNodes; + KeyValue : Variant; + ParentValue : Variant; + Level : Integer; + Parent : TDBTreePrintedNode; + RecNumber : Integer; + ChildList : TList; + + procedure SetChild(Value : TDBTreePrintedNode); + procedure SetLevel(Value : Integer); +public + constructor Create(AOwner : TDBTreePrintedNodes; AKeyValue, AParentValue : Variant); + destructor Destroy; override; + function HasAsParent(prNode : TDBTreePrintedNode) : Boolean; +end; + +TDBTreePrintedNodes = class +private + PrintedDS : TdxDBTreePrintData; + SourceDS : TDataSet; + List : TList; + RootList : TList; + SortedList : TList; +protected + function IndexOf(Value : Variant) : Integer; + procedure DestroyItems; + function FindNearest(Value : Variant; Var Index : Integer) : Boolean; + function GetMaxKeyValue : Variant; + procedure SortNodes(List : TList); + procedure UpdateNodes; +public + constructor Create(APrintedDS : TdxDBTreePrintData; ASourceDS : TDataSet); + destructor Destroy; override; + + procedure CreateStructure; +end; + +// Internal methods +function VarEquals(const V1, V2: Variant): Boolean; +begin + Result := False; + try + Result := V1 = V2; + except + end; +end; + +function VarFirstMore(const V1, V2: Variant): Boolean; +begin + Result := False; + try + Result := V1 >= V2; + except + end; +end; + +function VarFirstMoreEx(const V1, V2: Variant): Boolean; +begin + Result := False; + try + Result := V1 > V2; + except + end; +end; + +{TDBTreePrintedNode} +constructor TDBTreePrintedNode.Create(AOwner : TDBTreePrintedNodes; AKeyValue, AParentValue : Variant); +Var + Index : Integer; +begin + Owner := AOwner; + KeyValue := AKeyValue; + ParentValue := AParentValue; + ChildList := Nil; + RecNumber := Owner.List.Count; + Owner.FindNearest(KeyValue, Index); + if(Index < 0) then Index := 0; + Owner.List.Insert(Index, self); + Index := Owner.IndexOf(ParentValue); + Level := 0; + if(Index > -1) And (TDBTreePrintedNode(Owner.List[Index]) <> self) then + TDBTreePrintedNode(Owner.List[Index]).SetChild(self) + else begin + Parent := Nil; + Owner.RootList.Add(self); + end; + Owner.SortedList.Add(self); +end; + +destructor TDBTreePrintedNode.Destroy; +var + i : Integer; +begin + Destroying := True; + if(ChildList <> Nil) then + begin + for i := 0 to ChildList.Count - 1 do + TDBTreePrintedNode(ChildList[i]).Parent := Nil; + ChildList.Free; + ChildList := nil; + end; + if(Parent <> nil) and not Parent.Destroying and (Parent.ChildList <> nil) then + begin + Parent.ChildList.Remove(self); + if(Parent.ChildList.Count = 0) then + begin + Parent.ChildList.Free; + Parent.ChildList := Nil; + end; + end; + + inherited Destroy; +end; + +procedure TDBTreePrintedNode.SetChild(Value : TDBTreePrintedNode); +begin + if(Value = self) then exit; + if(ChildList = Nil) then + ChildList := TList.Create; + ChildList.Add(Value); + Value.Parent := self; + Owner.RootList.Remove(Value); + Value.SetLevel(Level + 1); +end; + +procedure TDBTreePrintedNode.SetLevel(Value : Integer); +Var + i : Integer; +begin + Level := Value; + if(ChildList <> Nil) then + for i := 0 to ChildList.Count - 1 do + TDBTreePrintedNode(ChildList[i]).SetLevel(Level + 1); +end; + +function TDBTreePrintedNode.HasAsParent(prNode : TDBTreePrintedNode) : Boolean; +Var + Node : TDBTreePrintedNode; +begin + Result := False; + Node := Parent; + while Node <> Nil do begin + if(Node = prNode) then begin + Result := True; + break; + end; + Node := Node.Parent; + end; +end; + +{TDBTreePrintedNodes} +constructor TDBTreePrintedNodes.Create(APrintedDS : TdxDBTreePrintData; ASourceDS : TDataSet); +begin + PrintedDS := APrintedDS; + SourceDS := ASourceDS; + List := TList.Create; + RootList := TList.Create; + SortedList := TList.Create; +end; + +destructor TDBTreePrintedNodes.Destroy; +begin + DestroyItems; + List.Free; + RootList.Free; + SortedList.Free; +end; + +procedure TDBTreePrintedNodes.DestroyItems; +Var + item : TDBTreePrintedNode; +begin + while List.Count > 0 do begin + item := TDBTreePrintedNode(List.Last); + List.Delete(List.Count - 1); + item.Free; + end; + RootList.Clear; +end; + +procedure TDBTreePrintedNodes.CreateStructure; +Var + bm : TBookMark; + i, FRecNumber, NewRecNo : Integer; + KeyField, ParentField : TField; + FieldType : TFieldType; + FieldDes, FieldSrs : TField; + ListD, ListS : TList; +begin + DestroyItems; + if(PrintedDS <> NIl) And (SourceDS <> NIl) then begin + KeyField := SourceDS.FindField(PrintedDS.FKeyFieldName); + ParentField := SourceDS.FindField(PrintedDS.FParentFieldName); + if (KeyField = Nil) Or (ParentField = Nil) then exit; + + FieldType := KeyField.DataType; + with PrintedDS do begin + if Not VarIsNull(FRootValue) then + case FieldType of + ftSmallint: VarCast(FRootValue, FRootValue, varSmallint); + ftInteger, ftWord, ftAutoInc: VarCast(FRootValue, FRootValue, varInteger); + ftFloat, ftCurrency: VarCast(FRootValue, FRootValue, varDouble); + else VarCast(FRootValue, FRootValue, varString); + end; + DisableControls; + end; + + with SourceDS do begin + DisableControls; + bm := GetBookMark; + First; + while Not EOF do begin + TDBTreePrintedNode.Create(self, KeyField.Value, ParentField.Value); + Next; + end; + UpdateNodes; + First; + FRecNumber := 1; + for i := 0 to List.Count - 1 do begin + PrintedDS.Append; + PrintedDS.Post; + end; + ListD := TList.Create; + ListS := TList.Create; + for i := 0 to PrintedDS.FieldCount - 4 do + begin + FieldDes := FindField(PrintedDS.Fields[i].FieldName); + FieldSrs := PrintedDS.FindField(PrintedDS.Fields[i].FieldName); + if (FieldDes <> nil) and (FieldSrs <> nil) then + begin + ListD.Add(FieldDes); + ListS.Add(FieldSrs); + end; + end; + + while Not EOF do begin + if (SortedList[FRecNumber - 1] <> Nil) then begin + NewRecNo := TDBTreePrintedNode(SortedList[FRecNumber - 1]).RecNumber; + PrintedDS.RecNo := NewRecNo; + PrintedDS.Edit; + for i := 0 to ListD.Count - 1 do + TField(ListS[i]).Assign(TField(ListD[i])); + PrintedDS.FindField(cDBTreeLevelFieldName).AsInteger := TDBTreePrintedNode(SortedList[FRecNumber - 1]).Level; + PrintedDS.FindField(cDBTreeRecNoFieldName).AsInteger := TDBTreePrintedNode(SortedList[FRecNumber - 1]).RecNumber; + if(PrintedDS.FMaxLevelCount < TDBTreePrintedNode(SortedList[FRecNumber - 1]).Level) then + PrintedDS.FMaxLevelCount := TDBTreePrintedNode(SortedList[FRecNumber - 1]).Level; + PrintedDS.FindField(cDBTreeHasChildrenFieldName).AsBoolean := TDBTreePrintedNode(SortedList[FRecNumber - 1]).ChildList <> Nil; + PrintedDS.Post; + end; + Next; + Inc(FRecNumber); + end; + GotoBookMark(bm); + FreeBookMark(bm); + EnableControls; + end; + ListD.Free; + ListS.Free; + PrintedDS.First; + PrintedDS.EnableControls; + end; +end; + +function TDBTreePrintedNodes.IndexOf(Value : Variant) : Integer; +Var + i : Integer; +begin + if(FindNearest(Value, i)) then + Result := i + else Result := -1; +end; + +function TDBTreePrintedNodes.FindNearest(Value : Variant; Var Index : Integer) : Boolean; +var + Min, Max : LongInt; +begin + Result := False; + if (List.Count = 0) Or VarIsNull(Value) + Or VarFirstMoreEx( TDBTreePrintedNode(List[0]).KeyValue, Value) then begin + Index := -1; + exit; + end; + + if VarFirstMoreEx(Value, GetMaxKeyValue) then begin + Index := List.Count; + Exit; + end; + + Min := 0; + Max := List.Count - 1; + + repeat + if ((Max - Min) = 1) then begin + if(Min = Index) then Min := Max; + if(Max = Index) then Max := Min; + end; + Index := Min + ((Max - Min) div 2); + if VarEquals(Value, TDBTreePrintedNode(List[Index]).KeyValue) then break; + if VarFirstMore(Value, TDBTreePrintedNode(List[Index]).KeyValue) then + Min := Index + else Max := Index; + until (Min = Max); + if Not VarEquals(Value, TDBTreePrintedNode(List[Index]).KeyValue) then begin + if (Index < List.Count - 1) And VarFirstMore(Value, TDBTreePrintedNode(List[Index]).KeyValue) then + Inc(Index); + end else Result := True; +end; + +function TDBTreePrintedNodes.GetMaxKeyValue : Variant; +begin + Result := NULL; + if(List.Count > 0) then begin + Result := TDBTreePrintedNode(List[List.Count - 1]).KeyValue; + end; +end; + +procedure TDBTreePrintedNodes.UpdateNodes; +Var + i, Index, NextValue, OldCount : Integer; + RootNode, prNode : TDBTreePrintedNode; + + procedure MakeSortNodes(Node : TDBTreePrintedNode); + Var + ii : Integer; + begin + if(Node.ChildList <> Nil) then begin + SortNodes(Node.ChildList); + for ii := 0 to Node.ChildList.Count - 1 do + MakeSortNodes(TDBTreePrintedNode(Node.ChildList[ii])); + end; + end; + + procedure SetRecNumber(Node : TDBTreePrintedNode); + Var + ii : Integer; + begin + if(Node.ChildList <> Nil) then begin + for ii := 0 to Node.ChildList.Count - 1 do begin + TDBTreePrintedNode(Node.ChildList[ii]).RecNumber := NextValue; + Inc(NextValue); + SetRecNumber(TDBTreePrintedNode(Node.ChildList[ii])); + end; + end; + end; + + procedure RemoveFromList(Node : TDBTreePrintedNode); + var + flag : Integer; + begin + if(Node.ChildList <> nil) then + begin + flag := 0; + while (Node.ChildList <> nil) and (Node.ChildList.Count > flag) do + if(RootNode <> TDBTreePrintedNode(Node.ChildList[flag])) then + RemoveFromList(TDBTreePrintedNode(Node.ChildList[flag])) + else Inc(flag); + end; + List.Remove(Node); + SortedList[Node.RecNumber] := Nil; + Node.Free; + end; + + procedure SetParentToNil(AList: TList); + var + I: Integer; + begin + for I := 0 to AList.Count - 1 do + TDBTreePrintedNode(AList[I]).Parent := nil; + end; + +begin + i := 0; + while i < RootList.Count do begin + Index := IndexOf(TDBTreePrintedNode(RootList[i]).ParentValue); + OldCount := RootList.Count; + if(Index > -1)then + TDBTreePrintedNode(List[Index]).SetChild(TDBTreePrintedNode(RootList[i])); + if (i < RootList.Count) And (OldCount = RootList.Count) + And (TDBTreePrintedNode(RootList[i]).Parent = Nil) then + Inc(i); + end; + + if Not VarIsNull(PrintedDS.FRootValue) + And FindNearest(PrintedDS.FRootValue, Index) then begin + RootNode := TDBTreePrintedNode(List[Index]); + RootList.Clear; + i := 0; + while (i < List.Count) do begin + prNode := TDBTreePrintedNode(List[i]); + if (RootNode <> prNode) And Not (prNode.HasAsParent(RootNode)) then + RemoveFromList(prNode) + else Inc(i); + end; + RootList.Add(RootNode); + RootNode.SetLevel(0); + end; + + if (PrintedDS.FLevelCount > 0) then begin + i := 0; + Index := PrintedDS.FLevelCount - 1; + while (i < List.Count) do begin + if(TDBTreePrintedNode(List[i]).Level >= Index) then begin + prNode := TDBTreePrintedNode(List[i]); + if (prNode.ChildList <> Nil)then begin + SetParentToNil(prNode.ChildList); + prNode.ChildList.Free; + prNode.ChildList := Nil; + end; + if(prNode.Level = Index) then + Inc(i) + else begin + List.Delete(i); + SortedList[prNode.RecNumber] := Nil; + prNode.Free; + end; + end else Inc(i); + end; + end; + + SortNodes(RootList); + for i := 0 to RootList.Count - 1 do + MakeSortNodes(TDBTreePrintedNode(RootList[i])); + + NextValue := 1; + for i := 0 to RootList.Count - 1 do begin + TDBTreePrintedNode(RootList[i]).RecNumber := NextValue; + Inc(NextValue); + SetRecNumber(TDBTreePrintedNode(RootList[i])); + end; + +end; + +procedure TDBTreePrintedNodes.SortNodes(List : TList); + + function GetValue(i : Integer) : Integer; + begin + Result := TDBTreePrintedNode(List[i]).RecNumber; + end; + + procedure Sort(iLo, iHi: Integer); + var + Lo, Hi, Mid: Integer; + begin + Lo := iLo; + Hi := iHi; + Mid := GetValue((Lo + Hi) div 2); + repeat + while GetValue(Lo) < Mid do Inc(Lo); + while GetValue(Hi) > Mid do Dec(Hi); + if Lo <= Hi then begin + List.Exchange(Lo, Hi); + Inc(Lo); + Dec(Hi); + end; + until Lo > Hi; + if Hi > iLo then Sort(iLo, Hi); + if Lo < iHi then Sort(Lo, iHi); + end; + +begin + if List.Count > 0 then + Sort(0, List.Count - 1); +end; + +procedure FillDBTreePrintedDataSet(ds1 : TdxDBTreePrintData; ds2 : TDataSet); +Var + st : TDBTreePrintedNodes; +begin + st := TDBTreePrintedNodes.Create(ds1, ds2); + st.CreateStructure; + st.Free; +end; + +end. + diff --git a/official/x.35/ExpressDBTree Suite/Sources/dxtrpreg.dcr b/official/x.35/ExpressDBTree Suite/Sources/dxtrpreg.dcr new file mode 100644 index 00000000..4b2aac68 Binary files /dev/null and b/official/x.35/ExpressDBTree Suite/Sources/dxtrpreg.dcr differ diff --git a/official/x.35/ExpressDBTree Suite/Sources/dxtrpreg.pas b/official/x.35/ExpressDBTree Suite/Sources/dxtrpreg.pas new file mode 100644 index 00000000..d077bdce --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/Sources/dxtrpreg.pas @@ -0,0 +1,104 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express tree view printed dataset } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSGRID AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxtrpreg; +{$I cxVer.inc} +interface + +uses Classes, SysUtils, dxmdaset, Windows, DB; + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI6}DesignIntf, DesignEditors{$ELSE}DsgnIntf{$ENDIF}, dxtrprds; + +type + TCustomDBTreeViewFieldProperty = class(TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValueList(List: TStrings); virtual; + procedure GetValues(Proc: TGetStrProc); override; + end; + +function TCustomDBTreeViewFieldProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList, paSortList, paMultiSelect]; +end; + +procedure TCustomDBTreeViewFieldProperty.GetValueList(List: TStrings); +begin +end; + +procedure TCustomDBTreeViewFieldProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; + Values: TStringList; +begin + Values := TStringList.Create; + try + GetValueList(Values); + for I := 0 to Values.Count - 1 do Proc(Values[I]); + finally + Values.Free; + end; +end; + +type + TDBTreePrnDataFieldProperty = class(TCustomDBTreeViewFieldProperty) + public + procedure GetValueList(List: TStrings); override; + end; + +procedure TDBTreePrnDataFieldProperty.GetValueList(List: TStrings); +var + DataSet : TDataSet; +begin + DataSet := nil; + if ((GetComponent(0) as TdxDBTreePrintData).DataSource <> nil) then + DataSet := (GetComponent(0) as TdxDBTreePrintData).DataSource.DataSet; + if(DataSet <> nil) then + DataSet.GetFieldNames(List); +end; + +procedure Register; +begin + RegisterComponents('ExpressDBTree', [TdxDBTreePrintData]); + RegisterPropertyEditor(TypeInfo(string), TdxDBTreePrintData, 'KeyField', TDBTreePrnDataFieldProperty); + RegisterPropertyEditor(TypeInfo(string), TdxDBTreePrintData, 'ParentField', TDBTreePrnDataFieldProperty); +end; + +end. diff --git a/official/x.35/ExpressDBTree Suite/eula.txt b/official/x.35/ExpressDBTree Suite/eula.txt new file mode 100644 index 00000000..4b432d7b --- /dev/null +++ b/official/x.35/ExpressDBTree Suite/eula.txt @@ -0,0 +1,119 @@ +DEVELOPER EXPRESS INC +ExpressDBTree(tm) COMPONENT SUITE +Copyright (C) 1999-2008 Developer Express Inc. + +END-USER LICENSE AGREEMENT +FOR ALL SOFTWARE COMPONENT PRODUCT(S) + +IMPORTANT- READ CAREFULLY: This DEVELOPER EXPRESS INC ("DEVEXPRESS") End-User License Agreement ("EULA") is a legal agreement between you, a developer of software applications, ("Developer End User") and DEVEXPRESS for all DEVEXPRESS products, controls, source code, demos, intermediate files, media, printed materials, and "online" or electronic documentation ("SOFTWARE COMPONENT PRODUCT(S)") contained in this installation file. + +DEVEXPRESS grants to you as an individual, a personal, nonexclusive license to install and use the SOFTWARE COMPONENT PRODUCT(S) for the sole purposes of designing, developing, testing, and deploying application programs which you create. By installing, copying, or otherwise using the SOFTWARE COMPONENT PRODUCT(S), you agree to be bound by the terms of this EULA. If you do not agree to any part of the terms of this EULA, DO NOT INSTALL, USE, EVALUATE, OR REPLICATE IN ANY MANNER, ANY PART, FILE OR PORTION OF THE SOFTWARE COMPONENT PRODUCT(S). + +All SOFTWARE COMPONENT PRODUCT(S) is licensed, not sold. If you are an individual, you must acquire an individual license for the SOFTWARE COMPONENT PRODUCT(S) from DEVEXPRESS or its authorized resellers. If you are an entity, you must acquire and assign an individual license for each Developer End User within your organization using and or developing with the SOFTWARE COMPONENT PRODUCT(S) from DEVEXPRESS or its authorized resellers. + +If the SOFTWARE COMPONENT PRODUCT(S) you have obtained is marked as a "TRIAL" or "EVALUATION," you may install one copy of the SOFTWARE COMPONENT PRODUCT(S) for testing purposes for a period of 30 calendar days from the date of installation ("Evaluation Period"). Upon expiration of the Evaluation Period, the SOFTWARE COMPONENT PRODUCT(S) must be uninstalled and all copies destroyed. + +RIGOROUS ENFORCEMENT OF INTELLECTUAL PROPERTY RIGHTS. If the licensed right of use for this SOFTWARE COMPONENT PRODUCT(S) is purchased by you with any intent to reverse engineer, decompile, create derivative works, and the exploitation or unauthorized transfer of, any DEVEXPRESS intellectual property and trade secrets, to include any exposed methods or source code where provided, no licensed right of use shall exist, and any PRODUCT(s) created as a result shall be judged illegal by definition of all applicable law. Any sale or resale of intellectual property or created derivatives so obtained will be prosecuted to the fullest extent of all local, federal and international law. + +1. GRANT OF LICENSE. + +This EULA, if legally executed as defined herein, licenses and so grants the single individual Developer End User the following rights: + +SOFTWARE COMPONENT PRODUCT(S) - Developer End User may install and use the SOFTWARE COMPONENT PRODUCT(S) on a single computer. Developer End User may also install and use the SOFTWARE COMPONENT PRODUCT(S) on a portable computer. + +2. LIMITATIONS ON REVERSE ENGINEERING, DECOMPILATION, AND DISASSEMBLY. + +You may not reverse engineer, decompile, create derivative works, translate, or disassemble the SOFTWARE COMPONENT PRODUCT(S), and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation. You agree to take all reasonable, legal and appropriate measures to prohibit the illegal dissemination of the SOFTWARE COMPONENT PRODUCT(S) or any of its constituent parts and redistributables to the fullest extent of all applicable local, US Codes and International Laws and Treaties regarding anti-circumvention, including but not limited to, the Geneva and Berne World Intellectual Property Organization (WIPO) Diplomatic Conferences. + +3. SEPARATION OF COMPONENTS. + +The SOFTWARE COMPONENT PRODUCT(S) is licensed as a single PRODUCT(s). The SOFTWARE COMPONENT PRODUCT(S) and its constituent parts and any provided redistributables may not be reverse engineered, decompiled, disassembled or separated for use on more than one computer, nor placed for distribution, sale, or resale as individual creations by Developer End User. The provision of source code, if included with the SOFTWARE COMPONENT PRODUCT(S), does not constitute transfer of any legal rights to such code, and resale or distribution of all or any portion of all source code and intellectual property will be prosecuted to the fullest extent of all applicable local, federal and international laws. All DEVEXPRESS libraries, source code, redistributables and other files remain DEVEXPRESS's exclusive property. You may not distribute any files, except those that DEVEXPRESS has expressly designated as Redistributable. + +4. RENTAL. + +You may not rent, lease, or lend the SOFTWARE COMPONENT PRODUCT(S). + +5. TRANSFER. + +You may NOT permanently or temporarily transfer ANY of your rights under this EULA to any individual or entity without prior written approval from DEVEXPRESS. Regardless of any modifications which you make and regardless of how you might compile, link, and/or package your programs, under no circumstances may the libraries, Redistributables, and/or other files of the SOFTWARE COMPONENT PRODUCT(S) (including any portions thereof) be used for developing programs by anyone other than you. Only you as the licensed Developer End User have the right to use the libraries, redistributables, or other files of the SOFTWARE COMPONENT PRODUCT(S) (or any portions thereof) for developing programs created with the SOFTWARE COMPONENT PRODUCT(S). In particular, you may not share copies of the Redistributables with other co-developers. You may not reproduce or distribute any DEVEXPRESS documentation without DEVEXPRESS's explicit permission. + +If you are an entity (Company), you must acquire and assign a license to each Developer End User within your organization using and or developing with the SOFTWARE COMPONENT PRODUCT(S). With written notification to DEVEXPRESS, Company may transfer the license obtained for a Developer End User to another Developer End User employed or otherwise engaged by Company if the initial Developer End User is no longer employed or engaged by Company or is reassigned to another function within Company and no longer develops software applications using the SOFTWARE COMPONENT PRODUCT(S). In addition, with written notification to DEVEXPRESS, Company may transfer its license of the SOFTWARE COMPONENT PRODUCT(S) to a successor Company. + +6. ROYALTY FREE REDISTRIBUTION. + +DEVEXPRESS PRODUCT(s) may include certain files ("Redistributable(s)") intended for distribution by you to the users of software applications which you create. Redistributables include, for example, those files identified in printed or on-line documentation as redistributable files, or those files preselected for deployment by an install utility provided with the SOFTWARE COMPONENT PRODUCT(S) (if any). In all circumstances, the Redistributables for the SOFTWARE COMPONENT PRODUCT(S) are only those files specifically designated as such by DEVEXPRESS. + +Subject to all of the terms and conditions in this EULA, you may reproduce and distribute copies of the Redistributables, provided that such copies are made from the original copy of the Redistributables included with the SOFTWARE COMPONENT PRODUCT(S) or modified versions of the Redistributables which are provided to you by DEVEXPRESS or those which you create. Copies of Redistributables may only be distributed with and for the sole purpose of executing application programs permitted under this EULA that you have created using the SOFTWARE COMPONENT PRODUCT(S). + +REDISTRIBUTABLES. To obtain a list of redistributables that apply under this EULA, contact support@devexpress.com + +AT NO TIME MAY DEVELOPER END USER CREATE ANY TOOL, REDISTRIBUTABLE, OR SOFTWARE COMPONENT PRODUCT(S) THAT DIRECTLY OR INDIRECTLY COMPETES WITH DEVEXPRESS SOFTWARE COMPONENT PRODUCT(S) WHICH UTILIZES ALL OR ANY PORTION OF THE SOFTWARE COMPONENT PRODUCT(S) contained within this installation. + +Distribution by the Developer End User of any design-time tools (EXE's OCX's or DLL's), executables, and source code distributed to Developer End User by DEVEXPRESS as part of this SOFTWARE COMPONENT PRODUCT(S) and not explicitly identified as a redistributable file is strictly prohibited. The Developer End User shall not develop software applications that provide an application programming interface to the SOFTWARE COMPONENT PRODUCT(S) or the SOFTWARE COMPONENT PRODUCT(S) as modified. + +The Developer End User may NOT distribute the SOFTWARE COMPONENT PRODUCT(S), in any format, to other users for development or application compilation purposes. Specifically, if Developer End User creates a control using the SOFTWARE COMPONENT PRODUCT(S) as a constituent control, Developer End User may NOT distribute the control created with the SOFTWARE COMPONENT PRODUCT(S) (in any format) to users to be used used at design time and or for ANY development purposes. + +Developer End User MAY NOT REDISTRIBUTE any SOFTWARE COMPONENT PRODUCT(s) files if using an evaluation, trial, Not for Resale, or demo version of the SOFTWARE COMPONENT PRODUCT(s). + +7. UPGRADES. + +If the SOFTWARE COMPONENT PRODUCT(S) is labeled as an upgrade, you must be properly licensed to use the SOFTWARE COMPONENT PRODUCT(S) identified by DEVEXPRESS as being eligible for the upgrade in order to use the SOFTWARE COMPONENT PRODUCT(S). A SOFTWARE COMPONENT PRODUCT(S) labeled as an upgrade replaces and/or supplements the SOFTWARE COMPONENT PRODUCT(S) that formed the basis for your eligibility for the upgrade, and together constitutes a single PRODUCT(S). You may use the resulting upgraded PRODUCT(S) only in accordance with all the terms of this EULA. + +8. COPYRIGHT. + +All title and copyrights in and to the SOFTWARE COMPONENT PRODUCT(S) (including but not limited to any copywritten images, demos, source code, intermediate files, packages, photographs, redistributables, animations, video, audio, music, text, and "applets" incorporated into the SOFTWARE COMPONENT PRODUCT(S) the accompanying printed materials, and any copies of the SOFTWARE COMPONENT PRODUCT(S)) are owned by DEVEXPRESS or its subsidiaries. The SOFTWARE COMPONENT PRODUCT(S) is protected by copyright laws and international treaty provisions and therefore, you must treat the SOFTWARE COMPONENT PRODUCT(S) like any other copyrighted material except that you may install the SOFTWARE COMPONENT PRODUCT(S) as described in this EULA. + +9. DUAL-MEDIA SOFTWARE COMPONENT PRODUCT(S). + +You may receive the SOFTWARE COMPONENT PRODUCT(S) in more than one medium. Regardless of the medium, you may use only one medium that is appropriate for your single computer. You may not loan, sell, rent, lease, or otherwise transfer in any manner the other medium to another user or entity. + +10. U.S. GOVERNMENT RESTRICTED RIGHTS. + +The Licensed Software is Commercial Computer Software provided with RESTRICTED RIGHTS under Federal Acquisition Regulations and agency supplements to them. Use, duplication or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFAR 255.227-7013 et. seq. or 252.211-7015, or subparagraphs (a) through (d) of the Commercial Computer Software Restricted Rights at FAR 52.227-19, as applicable, or similar clauses in the NASA FAR Supplement. Contractor-manufacturer is Developer Express Inc. / 6375 S. Pecos Rd Suite 118, Las Vegas NV 89120. + +11. EXPORT RESTRICTIONS. + +DEVEXPRESS expressly complies with all export restrictions imposed by the government of the United States of America. You, as Developer End User, must agree not to export or re-export the SOFTWARE COMPONENT PRODUCT(S) within any created application to any country, person, entity or end user subject to U.S.A. export restrictions. Restricted countries currently include, but are not necessarily limited to Cuba, Iran, Iraq, Libya, North Korea, Sudan, and Syria. You warrant and represent that neither the U.S.A. Bureau of Export Administration nor any other federal agency has suspended, revoked or denied your export privileges. + +12. NOTE ON JAVA SUPPORT. + +Certain SOFTWARE COMPONENT PRODUCT(S) may contain support for programs written in Java. Java technology is not fault tolerant and is not designed, manufactured, or intended for use or resale as on-line control equipment in hazardous environments requiring fail-safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines, or weapons systems, in which the failure of Java technology could lead directly to death, personal injury, or severe physical or environmental damage. + +13. DISCLAIMER OF WARRANTY. + +DEVEXPRESS expressly disclaims any warranty for the SOFTWARE COMPONENT PRODUCT(S). THE SOFTWARE COMPONENT PRODUCT(S) AND ANY RELATED DOCUMENTATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. DEVEXPRESS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY REPRESENTATIONS REGARDING THE USE, OR THE RESULTS OF THE USE, OF THE SOFTWARE COMPONENT PRODUCT(S) IN TERMS OF CORRECTNESS, ACCURACY, RELIABILITY, OR OTHERWISE. THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE COMPONENT PRODUCT(S) REMAINS WITH YOU. No oral or written information or advice given by DEVEXPRESS or its employees shall create a warranty or in any way increase the scope of this warranty. + +14. LIMITATIONS ON LIABILITY. + +To the maximum extent permitted by applicable law, in no event shall DEVEXPRESS be liable for any special, incidental, indirect, or consequential damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use the SOFTWARE COMPONENT PRODUCT(S) or the provision of or failure to provide Support Services, even if DEVEXPRESS has been advised of the possibility of such damages. + +Developer End User understands that the SOFTWARE COMPONENT PRODUCT(S) may produce inaccurate results because of a failure or fault within the SOFTWARE COMPONENT PRODUCT(S) or failure by Developer End User to properly use and or deploy the SOFTWARE COMPONENT PRODUCT(S). Developer End User assumes full and sole responsibility for any use of the SOFTWARE COMPONENT PRODUCT(S), and bears the entire risk for failures or faults within the SOFTWARE COMPONENT PRODUCT(S). You agree that regardless of the cause of failure or fault or the form of any claim, YOUR SOLE REMEDY AND DEVEXPRESS'S SOLE OBLIGATION SHALL BE GOVERNED BY THIS AGREEMENT AND IN NO EVENT SHALL DEVEXPRESS'S LIABILITY EXCEED THE PRICE PAID TO DEVEXPRESS FOR THE SOFTWARE COMPONENT PRODUCT(S). This Limited Warranty is void if failure of the SOFTWARE COMPONENT PRODUCT(S) has resulted from accident, abuse, alteration, unauthorized use or misapplication of the SOFTWARE COMPONENT PRODUCT(S). + +15. INDEMNIFICATION. + +You hereby agree to indemnify DEVEXPRESS and its officers, directors, employees, agents, and representatives from each and every demand, claim, loss, liability, or damage of any kind, including actual attorneys fees, whether in tort or contract, that it or any of them may incur by reason of, or arising out of, any claim which is made by any third party with respect to any breach or violation of this Agreement by you or any claims based on the Applications and the SOFTWARE COMPONENT PRODUCT(S) included herein. + +16. SUPPORT SERVICES. + +DEVEXPRESS may provide you with support services related to the SOFTWARE COMPONENT PRODUCT(S) ("Support Services"). Use of Support Services is governed by DEVEXPRESS policies and programs described in the user manual, in "on line" documentation and/or other DEVEXPRESS provided materials. Any supplemental SOFTWARE COMPONENT PRODUCT(S) provided to you as part of the Support Services shall be considered part of the SOFTWARE COMPONENT PRODUCT(S) and subject to the terms and conditions of this EULA. With respect to technical information you provide to DEVEXPRESS as part of the Support Services, DEVEXPRESS may use such information for its business purposes, including for SOFTWARE COMPONENT PRODUCT(s) support and development. DEVEXPRESS will not utilize such technical information in a form that personally identifies you. + +17. TERMINATION. + +Without prejudice to any other rights or remedies, DEVEXPRESS will terminate this EULA upon your failure to comply with all the terms and conditions of this EULA. In such events, you must destroy all copies of the SOFTWARE COMPONENT PRODUCT(S) and all of its component parts including any related documentation, and must remove ANY and ALL use of such technology immediately from any applications using technology contained in the SOFTWARE COMPONENT PRODUCT(S) developed by you, whether in native, altered or compiled state. + +18. TAX. + +DEVEXPRESS delivers its software electronically and does not collect sales or use tax for residents of US states in which it operates. You should confirm that your local, state, or federal government does not impose any sales or use tax on electronically delivered software. You are entirely liable for any such sales or use tax. + +19. MISCELLANEOUS. + +This EULA shall be construed, interpreted and governed by the laws of the State of Nevada, U.S.A. This EULA gives you specific legal rights; you may have others that vary from state to state and from country to country. + +This EULA may only be modified in writing signed by you and an authorized officer of DEVELOPER EXPRESS INC. If any provision of this EULA is found void or unenforceable, the remainder will remain valid and enforceable according to its terms. If any remedy provided is determined to have failed for its essential purpose, all limitations of liability and exclusions of damages set forth in the Limited Warranty shall remain in effect. + +DEVEXPRESS reserves all rights not specifically granted in this EULA. + +ACKNOWLEDGEMENTS. Developer End User acknowledges that he or she has read this Agreement, understands it, and agrees to be bound by its terms and conditions. + +Should you have any questions concerning this EULA, or if you desire to contact DEVEXPRESS for any reason, please contact us directly at us in the United States of America at 702-262-0609, or write: Developer Express Inc. Legal department / 6330 McLeod Dr Suite 1, Las Vegas NV 89120. + diff --git a/official/x.35/ExpressDataController/Help/cxData.cnt b/official/x.35/ExpressDataController/Help/cxData.cnt new file mode 100644 index 00000000..4707fbe4 --- /dev/null +++ b/official/x.35/ExpressDataController/Help/cxData.cnt @@ -0,0 +1,43 @@ +:Base cxData.hlp +:Title ExpressDataController +:Index ExpressDataController=cxData.hlp +1 ExpressDataController +2 Data Controllers +3 TcxCustomDataController=IDH_Class_TcxCustomDataController +3 TcxDataController=IDH_Class_TcxDataController +3 TcxCustomDataSource=IDH_Class_TcxCustomDataSource +3 TcxDataControllerGroups=IDH_Class_TcxDataControllerGroups +3 TcxDBDataController=IDH_Class_TcxDBDataController +3 TcxDBDataModeController=IDH_Class_TcxDBDataModeController +2 Filter Controls +3 TcxCustomFilterControl=IDH_Class_TcxCustomFilterControl +3 TcxDBFilterControl=IDH_Class_TcxDBFilterControl +3 TcxDBFilterOptions=IDH_Class_TcxDBFilterOptions +3 TcxFilterControl=IDH_Class_TcxFilterControl +3 TcxFilterCriteria=IDH_Class_TcxFilterCriteria +3 TcxFilterCriteriaItem=IDH_Class_TcxFilterCriteriaItem +3 TcxFilterCriteriaItemList=IDH_Class_TcxFilterCriteriaItemList +3 TcxFilterItem=IDH_Class_TcxFilterItem +3 TcxFilterItemCollection=IDH_Class_TcxFilterItemCollection +3 TcxFilterValueList=IDH_Class_TcxFilterValueList +2 Summaries +3 TcxCustomDataSummaryItem=IDH_Class_TcxCustomDataSummaryItem +3 TcxCustomFilterCriteriaItem=IDH_Class_TcxCustomFilterCriteriaItem +3 TcxDataFooterSummaryItems=IDH_Class_TcxDataFooterSummaryItems +3 TcxDataGroupSummaryItems=IDH_Class_TcxDataGroupSummaryItems +3 TcxDataSummary=IDH_Class_TcxDataSummary +3 TcxDataSummaryGroup=IDH_Class_TcxDataSummaryGroup +3 TcxDataSummaryGroupItemLink=IDH_Class_TcxDataSummaryGroupItemLink +3 TcxDataSummaryGroupItemLinks=IDH_Class_TcxDataSummaryGroupItemLinks +3 TcxDataSummaryGroups=IDH_Class_TcxDataSummaryGroups +3 TcxDataSummaryItem=IDH_Class_TcxDataSummaryItem +3 TcxDataSummaryItems=IDH_Class_TcxDataSummaryItems +3 TcxDBDataSummaryItem=IDH_Class_TcxDBDataSummaryItem +2 Other Classes +3 TcxDataFilterCriteria=IDH_Class_TcxDataFilterCriteria +3 TcxDataFilterValueList=IDH_Class_TcxDataFilterValueList +3 TcxDBDataFilterCriteria=IDH_Class_TcxDBDataFilterCriteria +2 Resource Strings +3 Resource Strings=IDH_CD_list_of_resource_strings +3 ExpressDataController: Resource Strings=IDH_CD_Express_DataController_Resource_Strings +3 TcxFilterControl: Resource Strings=IDH_Unit_cxFilterControlStrs>Main diff --git a/official/x.35/ExpressDataController/Help/cxData.hlp b/official/x.35/ExpressDataController/Help/cxData.hlp new file mode 100644 index 00000000..bdcd393b Binary files /dev/null and b/official/x.35/ExpressDataController/Help/cxData.hlp differ diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersC10.bpk b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC10.bpk new file mode 100644 index 00000000..8f0480a8 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC10.bpk @@ -0,0 +1,194 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = cxADOAdaptersC10.bpl +OBJFILES = cxADOAdaptersC10.obj cxADOAdapters.obj +RESFILES = cxADOAdaptersC10.res +MAINSOURCE = cxADOAdaptersC10.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi dbrtl.bpi adortl.bpi cxDataC10.bpi +SPARELIBS = rtl.lib dbrtl.lib adortl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ADO Adapters for ExpressDataController by Developer Express Inc." -aa -Tpp -Gpr -x -Gn \ + -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersC10.cpp b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC10.cpp new file mode 100644 index 00000000..894ddd15 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC10.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxADOAdaptersC10.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("adortl.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEUNIT("cxADOAdapters.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersC10.res b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC10.res new file mode 100644 index 00000000..b7f58515 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC10.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersC11.bpk b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC11.bpk new file mode 100644 index 00000000..950571e4 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC11.bpk @@ -0,0 +1,194 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = cxADOAdaptersC11.bpl +OBJFILES = cxADOAdaptersC11.obj cxADOAdapters.obj +RESFILES = cxADOAdaptersC11.res +MAINSOURCE = cxADOAdaptersC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi dbrtl.bpi adortl.bpi cxDataC11.bpi +SPARELIBS = rtl.lib dbrtl.lib adortl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ADO Adapters for ExpressDataController by Developer Express Inc." -aa -Tpp -Gpr -x -Gn \ + -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersC11.cpp b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC11.cpp new file mode 100644 index 00000000..becbd1c6 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC11.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxADOAdaptersC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("adortl.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEUNIT("cxADOAdapters.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersC11.res b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC11.res new file mode 100644 index 00000000..47281bfd Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC11.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersC5.bpk b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC5.bpk new file mode 100644 index 00000000..ad038589 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC5.bpk @@ -0,0 +1,194 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = cxADOAdaptersC5.bpl +OBJFILES = cxADOAdaptersC5.obj cxADOAdapters.obj +RESFILES = cxADOAdaptersC5.res +MAINSOURCE = cxADOAdaptersC5.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = vcl50.bpi vcldb50.bpi vclado50.bpi cxDataC5.bpi +SPARELIBS = vcl50.lib vcldb50.lib vclado50.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ADO Adapters for ExpressDataController by Developer Express Inc." -aa -Tpp -Gpr -x -Gn \ + -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersC5.cpp b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC5.cpp new file mode 100644 index 00000000..d0e038e7 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC5.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxADOAdaptersC5.res"); +USEPACKAGE("Vcldb50.bpi"); +USEPACKAGE("Vclado50.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEUNIT("cxADOAdapters.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersC5.res b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC5.res new file mode 100644 index 00000000..e62913e2 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC5.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersC6.bpk b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC6.bpk new file mode 100644 index 00000000..d4e07e74 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC6.bpk @@ -0,0 +1,194 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = cxADOAdaptersC6.bpl +OBJFILES = cxADOAdaptersC6.obj cxADOAdapters.obj +RESFILES = cxADOAdaptersC6.res +MAINSOURCE = cxADOAdaptersC6.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi dbrtl.bpi adortl.bpi cxDataC6.bpi +SPARELIBS = rtl.lib dbrtl.lib adortl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ADO Adapters for ExpressDataController by Developer Express Inc." -aa -Tpp -Gpr -x -Gn \ + -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersC6.cpp b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC6.cpp new file mode 100644 index 00000000..a0034ef7 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC6.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxADOAdaptersC6.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("adortl.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEUNIT("cxADOAdapters.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersC6.res b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC6.res new file mode 100644 index 00000000..81db349a Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxADOAdaptersC6.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersD10.dpk b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD10.dpk new file mode 100644 index 00000000..d5730fab --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD10.dpk @@ -0,0 +1,38 @@ +package cxADOAdaptersD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ADO Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + adortl, + cxDataD10; + +contains + cxADOAdapters; + +end. diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersD10.res b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD10.res new file mode 100644 index 00000000..d1ff964a Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD10.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersD11.dpk b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD11.dpk new file mode 100644 index 00000000..2720ff09 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD11.dpk @@ -0,0 +1,38 @@ +package cxADOAdaptersD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ADO Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + adortl, + cxDataD11; + +contains + cxADOAdapters; + +end. diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersD11.res b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD11.res new file mode 100644 index 00000000..351cb844 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD11.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersD5.dpk b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD5.dpk new file mode 100644 index 00000000..676ad1e3 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD5.dpk @@ -0,0 +1,38 @@ +package cxADOAdaptersD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ADO Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcldb50, + vclado50, + cxDataD5; + +contains + cxADOAdapters; + +end. diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersD5.res b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD5.res new file mode 100644 index 00000000..39fe259c Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD5.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersD6.dpk b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD6.dpk new file mode 100644 index 00000000..a60af386 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD6.dpk @@ -0,0 +1,38 @@ +package cxADOAdaptersD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ADO Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + adortl, + cxDataD6; + +contains + cxADOAdapters; + +end. diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersD6.res b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD6.res new file mode 100644 index 00000000..44828fbc Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD6.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersD7.dpk b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD7.dpk new file mode 100644 index 00000000..bd683aec --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD7.dpk @@ -0,0 +1,38 @@ +package cxADOAdaptersD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ADO Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + adortl, + cxDataD7; + +contains + cxADOAdapters; + +end. diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersD7.res b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD7.res new file mode 100644 index 00000000..9cb050ac Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD7.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersD9.dpk b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD9.dpk new file mode 100644 index 00000000..db2dfc3d --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD9.dpk @@ -0,0 +1,38 @@ +package cxADOAdaptersD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ADO Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + adortl, + cxDataD9; + +contains + cxADOAdapters; + +end. diff --git a/official/x.35/ExpressDataController/Packages/cxADOAdaptersD9.res b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD9.res new file mode 100644 index 00000000..2bcce853 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxADOAdaptersD9.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC10.bpk b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC10.bpk new file mode 100644 index 00000000..c0926b7b --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC10.bpk @@ -0,0 +1,194 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = cxBDEAdaptersC10.bpl +OBJFILES = cxBDEAdaptersC10.obj cxBDEAdapters.obj +RESFILES = cxBDEAdaptersC10.res +MAINSOURCE = cxBDEAdaptersC10.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi dbrtl.bpi bdertl.bpi cxDataC10.bpi +SPARELIBS = rtl.lib dbrtl.lib bdertl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"BDE Adapters for ExpressDataController by Developer Express Inc." -aa -Tpp -Gpr -x -Gn \ + -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC10.cpp b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC10.cpp new file mode 100644 index 00000000..82bba1e3 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC10.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxBDEAdaptersC10.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("BDErtl.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEUNIT("cxBDEAdapters.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC10.res b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC10.res new file mode 100644 index 00000000..1d381802 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC10.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC11.bpk b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC11.bpk new file mode 100644 index 00000000..b430cdce --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC11.bpk @@ -0,0 +1,194 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = cxBDEAdaptersC11.bpl +OBJFILES = cxBDEAdaptersC11.obj cxBDEAdapters.obj +RESFILES = cxBDEAdaptersC11.res +MAINSOURCE = cxBDEAdaptersC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi dbrtl.bpi bdertl.bpi cxDataC11.bpi +SPARELIBS = rtl.lib dbrtl.lib bdertl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"BDE Adapters for ExpressDataController by Developer Express Inc." -aa -Tpp -Gpr -x -Gn \ + -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC11.cpp b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC11.cpp new file mode 100644 index 00000000..5525c403 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC11.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxBDEAdaptersC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("BDErtl.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEUNIT("cxBDEAdapters.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC11.res b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC11.res new file mode 100644 index 00000000..8131060d Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC11.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC5.bpk b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC5.bpk new file mode 100644 index 00000000..24377991 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC5.bpk @@ -0,0 +1,194 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = cxBDEAdaptersC5.bpl +OBJFILES = cxBDEAdaptersC5.obj cxBDEAdapters.obj +RESFILES = cxBDEAdaptersC5.res +MAINSOURCE = cxBDEAdaptersC5.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = vcl50.bpi vcldb50.bpi vclbde50.bpi cxDataC5.bpi +SPARELIBS = vcl50.lib vcldb50.lib vclbde50.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"BDE Adapters for ExpressDataController by Developer Express Inc." -aa -Tpp -Gpr -x -Gn \ + -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC5.cpp b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC5.cpp new file mode 100644 index 00000000..994a0657 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC5.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxBDEAdaptersC5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("Vcldb50.bpi"); +USEPACKAGE("VCLBDE50.bpi"); +USEPACKAGE("vclib50"); +USEPACKAGE("cxDataC5.bpi"); +USEUNIT("cxBDEAdapters.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC5.res b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC5.res new file mode 100644 index 00000000..e146bfce Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC5.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC6.bpk b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC6.bpk new file mode 100644 index 00000000..18f8b1b3 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC6.bpk @@ -0,0 +1,194 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = cxBDEAdaptersC6.bpl +OBJFILES = cxBDEAdaptersC6.obj cxBDEAdapters.obj +RESFILES = cxBDEAdaptersC6.res +MAINSOURCE = cxBDEAdaptersC6.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi dbrtl.bpi bdertl.bpi cxDataC6.bpi +SPARELIBS = rtl.lib dbrtl.lib bdertl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"BDE Adapters for ExpressDataController by Developer Express Inc." -aa -Tpp -Gpr -x -Gn \ + -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC6.cpp b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC6.cpp new file mode 100644 index 00000000..5d46b89f --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC6.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxBDEAdaptersC6.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("BDErtl.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEUNIT("cxBDEAdapters.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC6.res b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC6.res new file mode 100644 index 00000000..2ac4a571 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersC6.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD10.dpk b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD10.dpk new file mode 100644 index 00000000..4753ffcc --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD10.dpk @@ -0,0 +1,38 @@ +package cxBDEAdaptersD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'BDE Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + bdertl, + cxDataD10; + +contains + cxBDEAdapters; + +end. diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD10.res b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD10.res new file mode 100644 index 00000000..59d988e0 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD10.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD10NET.dpk b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD10NET.dpk new file mode 100644 index 00000000..740ccca8 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD10NET.dpk @@ -0,0 +1,95 @@ +package cxBDEAdaptersD10NET; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'BDE Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + cxDataD10NET, + Borland.VclBdeRtl, + System.Drawing; + +contains + cxBDEAdapters; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD10NET.res b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD10NET.res new file mode 100644 index 00000000..cc29d9e9 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD10NET.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD11.dpk b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD11.dpk new file mode 100644 index 00000000..ad409b7e --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD11.dpk @@ -0,0 +1,38 @@ +package cxBDEAdaptersD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'BDE Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + bdertl, + cxDataD11; + +contains + cxBDEAdapters; + +end. diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD11.res b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD11.res new file mode 100644 index 00000000..42c948f6 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD11.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD5.dpk b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD5.dpk new file mode 100644 index 00000000..6016f0e8 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD5.dpk @@ -0,0 +1,38 @@ +package cxBDEAdaptersD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'BDE Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcldb50, + Vclbde50, + cxDataD5; + +contains + cxBDEAdapters; + +end. diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD5.res b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD5.res new file mode 100644 index 00000000..ab40ac74 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD5.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD6.dpk b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD6.dpk new file mode 100644 index 00000000..a74bfeb1 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD6.dpk @@ -0,0 +1,38 @@ +package cxBDEAdaptersD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'BDE Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + bdertl, + cxDataD6; + +contains + cxBDEAdapters; + +end. diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD6.res b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD6.res new file mode 100644 index 00000000..1af2bbf8 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD6.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD7.dpk b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD7.dpk new file mode 100644 index 00000000..dd92c4b4 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD7.dpk @@ -0,0 +1,38 @@ +package cxBDEAdaptersD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'BDE Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + bdertl, + cxDataD7; + +contains + cxBDEAdapters; + +end. diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD7.res b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD7.res new file mode 100644 index 00000000..e0369e91 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD7.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD8.dpk b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD8.dpk new file mode 100644 index 00000000..01aab3f1 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD8.dpk @@ -0,0 +1,95 @@ +package cxBDEAdaptersD8; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'BDE Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + cxDataD8, + Borland.VclBdeRtl, + System.Drawing; + +contains + cxBDEAdapters; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD8.res b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD8.res new file mode 100644 index 00000000..204f4a05 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD8.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD9.dpk b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD9.dpk new file mode 100644 index 00000000..cdd1a6ac --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD9.dpk @@ -0,0 +1,38 @@ +package cxBDEAdaptersD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'BDE Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + bdertl, + cxDataD9; + +contains + cxBDEAdapters; + +end. diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD9.res b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD9.res new file mode 100644 index 00000000..2499da3f Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD9.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD9NET.dpk b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD9NET.dpk new file mode 100644 index 00000000..0e338355 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD9NET.dpk @@ -0,0 +1,95 @@ +package cxBDEAdaptersD9NET; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'BDE Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + cxDataD9NET, + Borland.VclBdeRtl, + System.Drawing; + +contains + cxBDEAdapters; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD9NET.res b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD9NET.res new file mode 100644 index 00000000..80c3584b Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxBDEAdaptersD9NET.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxDataC10.bpk b/official/x.35/ExpressDataController/Packages/cxDataC10.bpk new file mode 100644 index 00000000..25d36524 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxDataC10.bpk @@ -0,0 +1,199 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = cxDataC10.bpl +OBJFILES = cxDataC10.obj cxVariants.obj \ + cxCustomData.obj cxData.obj \ + cxDataConsts.obj cxDataStorage.obj \ + cxDataUtils.obj cxDB.obj \ + cxDBData.obj cxFilter.obj cxDBFilter.obj \ + cxFilterConsts.obj cxLike.obj +RESFILES = cxDataC10.res +MAINSOURCE = cxDataC10.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressDataController by Developer Express Inc." -aa -Tpp -Gpr -x -Gn \ + -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressDataController/Packages/cxDataC10.cpp b/official/x.35/ExpressDataController/Packages/cxDataC10.cpp new file mode 100644 index 00000000..05c81b09 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxDataC10.cpp @@ -0,0 +1,34 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxDataC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("Vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEUNIT("cxVariants.pas"); +USEUNIT("cxCustomData.pas"); +USEUNIT("cxData.pas"); +USEUNIT("cxDataConsts.pas"); +USEUNIT("cxDataStorage.pas"); +USEUNIT("cxDataUtils.pas"); +USEUNIT("cxDB.pas"); +USEUNIT("cxDBData.pas"); +USEUNIT("cxFilter.pas"); +USEUNIT("cxDBFilter.pas"); +USEUNIT("cxFilterConsts.pas"); +USEUNIT("cxLike.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDataController/Packages/cxDataC10.res b/official/x.35/ExpressDataController/Packages/cxDataC10.res new file mode 100644 index 00000000..84023c7b Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxDataC10.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxDataC11.bpk b/official/x.35/ExpressDataController/Packages/cxDataC11.bpk new file mode 100644 index 00000000..0ea96971 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxDataC11.bpk @@ -0,0 +1,199 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = cxDataC11.bpl +OBJFILES = cxDataC11.obj cxVariants.obj \ + cxCustomData.obj cxData.obj \ + cxDataConsts.obj cxDataStorage.obj \ + cxDataUtils.obj cxDB.obj \ + cxDBData.obj cxFilter.obj cxDBFilter.obj \ + cxFilterConsts.obj cxLike.obj +RESFILES = cxDataC11.res +MAINSOURCE = cxDataC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressDataController by Developer Express Inc." -aa -Tpp -Gpr -x -Gn \ + -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressDataController/Packages/cxDataC11.cpp b/official/x.35/ExpressDataController/Packages/cxDataC11.cpp new file mode 100644 index 00000000..df41e484 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxDataC11.cpp @@ -0,0 +1,34 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxDataC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("Vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEUNIT("cxVariants.pas"); +USEUNIT("cxCustomData.pas"); +USEUNIT("cxData.pas"); +USEUNIT("cxDataConsts.pas"); +USEUNIT("cxDataStorage.pas"); +USEUNIT("cxDataUtils.pas"); +USEUNIT("cxDB.pas"); +USEUNIT("cxDBData.pas"); +USEUNIT("cxFilter.pas"); +USEUNIT("cxDBFilter.pas"); +USEUNIT("cxFilterConsts.pas"); +USEUNIT("cxLike.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDataController/Packages/cxDataC11.res b/official/x.35/ExpressDataController/Packages/cxDataC11.res new file mode 100644 index 00000000..97aa050c Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxDataC11.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxDataC5.bpk b/official/x.35/ExpressDataController/Packages/cxDataC5.bpk new file mode 100644 index 00000000..8da3d019 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxDataC5.bpk @@ -0,0 +1,199 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = cxDataC5.bpl +OBJFILES = cxDataC5.obj cxVariants.obj \ + cxCustomData.obj cxData.obj \ + cxDataConsts.obj cxDataStorage.obj \ + cxDataUtils.obj cxDB.obj \ + cxDBData.obj cxFilter.obj cxDBFilter.obj \ + cxFilterConsts.obj cxLike.obj +RESFILES = cxDataC5.res +MAINSOURCE = cxDataC5.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = vcl50.bpi vcldb50.bpi +SPARELIBS = vcl50.lib vcldb50.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressDataController by Developer Express Inc." -aa -Tpp -Gpr -x -Gn \ + -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressDataController/Packages/cxDataC5.cpp b/official/x.35/ExpressDataController/Packages/cxDataC5.cpp new file mode 100644 index 00000000..820d63fe --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxDataC5.cpp @@ -0,0 +1,32 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxDataC5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("Vcldb50.bpi"); +USEUNIT("cxVariants.pas"); +USEUNIT("cxCustomData.pas"); +USEUNIT("cxData.pas"); +USEUNIT("cxDataConsts.pas"); +USEUNIT("cxDataStorage.pas"); +USEUNIT("cxDataUtils.pas"); +USEUNIT("cxDB.pas"); +USEUNIT("cxDBData.pas"); +USEUNIT("cxFilter.pas"); +USEUNIT("cxDBFilter.pas"); +USEUNIT("cxFilterConsts.pas"); +USEUNIT("cxLike.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDataController/Packages/cxDataC5.res b/official/x.35/ExpressDataController/Packages/cxDataC5.res new file mode 100644 index 00000000..0b5100f4 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxDataC5.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxDataC6.bpk b/official/x.35/ExpressDataController/Packages/cxDataC6.bpk new file mode 100644 index 00000000..960b2481 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxDataC6.bpk @@ -0,0 +1,199 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = cxDataC6.bpl +OBJFILES = cxDataC6.obj cxVariants.obj \ + cxCustomData.obj cxData.obj \ + cxDataConsts.obj cxDataStorage.obj \ + cxDataUtils.obj cxDB.obj \ + cxDBData.obj cxFilter.obj cxDBFilter.obj \ + cxFilterConsts.obj cxLike.obj +RESFILES = cxDataC6.res +MAINSOURCE = cxDataC6.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressDataController by Developer Express Inc." -aa -Tpp -Gpr -x -Gn \ + -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressDataController/Packages/cxDataC6.cpp b/official/x.35/ExpressDataController/Packages/cxDataC6.cpp new file mode 100644 index 00000000..0ea58e38 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxDataC6.cpp @@ -0,0 +1,34 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxDataC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("Vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEUNIT("cxVariants.pas"); +USEUNIT("cxCustomData.pas"); +USEUNIT("cxData.pas"); +USEUNIT("cxDataConsts.pas"); +USEUNIT("cxDataStorage.pas"); +USEUNIT("cxDataUtils.pas"); +USEUNIT("cxDB.pas"); +USEUNIT("cxDBData.pas"); +USEUNIT("cxFilter.pas"); +USEUNIT("cxDBFilter.pas"); +USEUNIT("cxFilterConsts.pas"); +USEUNIT("cxLike.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDataController/Packages/cxDataC6.res b/official/x.35/ExpressDataController/Packages/cxDataC6.res new file mode 100644 index 00000000..94a5b98d Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxDataC6.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxDataD10.dpk b/official/x.35/ExpressDataController/Packages/cxDataD10.dpk new file mode 100644 index 00000000..57884b10 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxDataD10.dpk @@ -0,0 +1,46 @@ +package cxDataD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl; + +contains + cxCustomData , + cxData , + cxDataConsts , + cxDataStorage , + cxDataUtils , + cxDB , + cxDBData , + cxFilter , + cxDBFilter, + cxFilterConsts, + cxLike , + cxVariants ; +end. diff --git a/official/x.35/ExpressDataController/Packages/cxDataD10.res b/official/x.35/ExpressDataController/Packages/cxDataD10.res new file mode 100644 index 00000000..d7e00c15 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxDataD10.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxDataD10NET.dpk b/official/x.35/ExpressDataController/Packages/cxDataD10NET.dpk new file mode 100644 index 00000000..57b1e2eb --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxDataD10NET.dpk @@ -0,0 +1,104 @@ +package cxDataD10NET; + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + Borland.VclDbRtl, + System.Drawing; + +contains + cxVariants, + cxCustomData, + cxData, + cxDataConsts, + cxDataUtils, + cxDB, + cxDBData, + cxDBFilter, + cxFilter, + cxFilterConsts, + cxLike, + cxDataStorage; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/ExpressDataController/Packages/cxDataD10NET.res b/official/x.35/ExpressDataController/Packages/cxDataD10NET.res new file mode 100644 index 00000000..100fde96 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxDataD10NET.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxDataD11.dpk b/official/x.35/ExpressDataController/Packages/cxDataD11.dpk new file mode 100644 index 00000000..d878e7cb --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxDataD11.dpk @@ -0,0 +1,46 @@ +package cxDataD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl; + +contains + cxCustomData , + cxData , + cxDataConsts , + cxDataStorage , + cxDataUtils , + cxDB , + cxDBData , + cxFilter , + cxDBFilter, + cxFilterConsts, + cxLike , + cxVariants ; +end. diff --git a/official/x.35/ExpressDataController/Packages/cxDataD11.res b/official/x.35/ExpressDataController/Packages/cxDataD11.res new file mode 100644 index 00000000..b79b7de3 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxDataD11.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxDataD5.dpk b/official/x.35/ExpressDataController/Packages/cxDataD5.dpk new file mode 100644 index 00000000..bd09032e --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxDataD5.dpk @@ -0,0 +1,47 @@ +package cxDataD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcldb50; + +contains + cxCustomData, + cxData, + cxDataConsts, + cxDataStorage, + cxDataUtils, + cxDB, + cxDBData, + cxFilter, + cxDBFilter, + cxFilterConsts, + cxLike, + cxVariants; + +end. diff --git a/official/x.35/ExpressDataController/Packages/cxDataD5.res b/official/x.35/ExpressDataController/Packages/cxDataD5.res new file mode 100644 index 00000000..00dbb552 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxDataD5.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxDataD6.dpk b/official/x.35/ExpressDataController/Packages/cxDataD6.dpk new file mode 100644 index 00000000..b37ccb2a --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxDataD6.dpk @@ -0,0 +1,46 @@ +package cxDataD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl; + +contains + cxCustomData , + cxData , + cxDataConsts , + cxDataStorage , + cxDataUtils , + cxDB , + cxDBData , + cxFilter , + cxDBFilter, + cxFilterConsts, + cxLike , + cxVariants ; +end. diff --git a/official/x.35/ExpressDataController/Packages/cxDataD6.res b/official/x.35/ExpressDataController/Packages/cxDataD6.res new file mode 100644 index 00000000..e69e8031 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxDataD6.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxDataD7.dpk b/official/x.35/ExpressDataController/Packages/cxDataD7.dpk new file mode 100644 index 00000000..e2489394 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxDataD7.dpk @@ -0,0 +1,46 @@ +package cxDataD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl; + +contains + cxCustomData , + cxData , + cxDataConsts , + cxDataStorage , + cxDataUtils , + cxDB , + cxDBData , + cxFilter , + cxDBFilter, + cxFilterConsts, + cxLike , + cxVariants ; +end. diff --git a/official/x.35/ExpressDataController/Packages/cxDataD7.res b/official/x.35/ExpressDataController/Packages/cxDataD7.res new file mode 100644 index 00000000..25f50b05 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxDataD7.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxDataD8.dpk b/official/x.35/ExpressDataController/Packages/cxDataD8.dpk new file mode 100644 index 00000000..aecfe9bb --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxDataD8.dpk @@ -0,0 +1,104 @@ +package cxDataD8; + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + Borland.VclDbRtl, + System.Drawing; + +contains + cxVariants, + cxCustomData, + cxData, + cxDataConsts, + cxDataUtils, + cxDB, + cxDBData, + cxDBFilter, + cxFilter, + cxFilterConsts, + cxLike, + cxDataStorage; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/ExpressDataController/Packages/cxDataD8.res b/official/x.35/ExpressDataController/Packages/cxDataD8.res new file mode 100644 index 00000000..bb30ee96 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxDataD8.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxDataD9.dpk b/official/x.35/ExpressDataController/Packages/cxDataD9.dpk new file mode 100644 index 00000000..28f653cf --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxDataD9.dpk @@ -0,0 +1,46 @@ +package cxDataD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl; + +contains + cxCustomData , + cxData , + cxDataConsts , + cxDataStorage , + cxDataUtils , + cxDB , + cxDBData , + cxFilter , + cxDBFilter, + cxFilterConsts, + cxLike , + cxVariants ; +end. diff --git a/official/x.35/ExpressDataController/Packages/cxDataD9.res b/official/x.35/ExpressDataController/Packages/cxDataD9.res new file mode 100644 index 00000000..8c68f538 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxDataD9.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxDataD9NET.dpk b/official/x.35/ExpressDataController/Packages/cxDataD9NET.dpk new file mode 100644 index 00000000..96b44bc2 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxDataD9NET.dpk @@ -0,0 +1,104 @@ +package cxDataD9NET; + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + Borland.VclDbRtl, + System.Drawing; + +contains + cxVariants, + cxCustomData, + cxData, + cxDataConsts, + cxDataUtils, + cxDB, + cxDBData, + cxDBFilter, + cxFilter, + cxFilterConsts, + cxLike, + cxDataStorage; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/ExpressDataController/Packages/cxDataD9NET.res b/official/x.35/ExpressDataController/Packages/cxDataD9NET.res new file mode 100644 index 00000000..a714cb7e Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxDataD9NET.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC10.bpk b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC10.bpk new file mode 100644 index 00000000..72979b2a --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC10.bpk @@ -0,0 +1,194 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = cxIBXAdaptersC10.bpl +OBJFILES = cxIBXAdaptersC10.obj cxIBXAdapters.obj +RESFILES = cxIBXAdaptersC10.res +MAINSOURCE = cxIBXAdaptersC10.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi dbrtl.bpi ibxpress.bpi cxDataC10.bpi +SPARELIBS = rtl.lib dbrtl.lib ibxpress.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Interbase Express Adapters for ExpressDataController by Developer Express Inc." -aa -Tpp -Gpr -x -Gn \ + -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC10.cpp b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC10.cpp new file mode 100644 index 00000000..e6275b7d --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC10.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxIBXAdaptersC10.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("ibxpress.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEUNIT("cxIBXAdapters.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC10.res b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC10.res new file mode 100644 index 00000000..b5c68d9e Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC10.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC11.bpk b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC11.bpk new file mode 100644 index 00000000..6e305cb4 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC11.bpk @@ -0,0 +1,194 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = cxIBXAdaptersC11.bpl +OBJFILES = cxIBXAdaptersC11.obj cxIBXAdapters.obj +RESFILES = cxIBXAdaptersC11.res +MAINSOURCE = cxIBXAdaptersC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi dbrtl.bpi ibxpress.bpi cxDataC11.bpi +SPARELIBS = rtl.lib dbrtl.lib ibxpress.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Interbase Express Adapters for ExpressDataController by Developer Express Inc." -aa -Tpp -Gpr -x -Gn \ + -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC11.cpp b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC11.cpp new file mode 100644 index 00000000..48b60786 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC11.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxIBXAdaptersC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("ibxpress.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEUNIT("cxIBXAdapters.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC11.res b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC11.res new file mode 100644 index 00000000..c52b3b85 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC11.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC5.bpk b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC5.bpk new file mode 100644 index 00000000..542a0c1a --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC5.bpk @@ -0,0 +1,194 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = cxIBXAdaptersC5.bpl +OBJFILES = cxIBXAdaptersC5.obj cxIBXAdapters.obj +RESFILES = cxIBXAdaptersC5.res +MAINSOURCE = cxIBXAdaptersC5.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = vcl50.bpi vcldb50.bpi vclib50.bpi cxDataC5.bpi +SPARELIBS = vcl50.lib vcldb50.lib vclib50.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Interbase Express Adapters for ExpressDataController by Developer Express Inc." -aa -Tpp -Gpr -x -Gn \ + -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC5.cpp b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC5.cpp new file mode 100644 index 00000000..f27bd6a7 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC5.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxIBXAdaptersC5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("Vcldb50.bpi"); +USEPACKAGE("vclib50.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEUNIT("cxIBXAdapters.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC5.res b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC5.res new file mode 100644 index 00000000..fb96e7d7 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC5.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC6.bpk b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC6.bpk new file mode 100644 index 00000000..6cf7957d --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC6.bpk @@ -0,0 +1,194 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = cxIBXAdaptersC6.bpl +OBJFILES = cxIBXAdaptersC6.obj cxIBXAdapters.obj +RESFILES = cxIBXAdaptersC6.res +MAINSOURCE = cxIBXAdaptersC6.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi dbrtl.bpi ibxpress.bpi cxDataC6.bpi +SPARELIBS = rtl.lib dbrtl.lib ibxpress.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Interbase Express Adapters for ExpressDataController by Developer Express Inc." -aa -Tpp -Gpr -x -Gn \ + -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC6.cpp b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC6.cpp new file mode 100644 index 00000000..9f63cd51 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC6.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxIBXAdaptersC6.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("ibxpress.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEUNIT("cxIBXAdapters.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC6.res b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC6.res new file mode 100644 index 00000000..7096ae94 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersC6.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD10.dpk b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD10.dpk new file mode 100644 index 00000000..6ac4f4a6 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD10.dpk @@ -0,0 +1,38 @@ +package cxIBXAdaptersD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Interbase Express Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + ibxpress, + cxDataD10; + +contains + cxIBXAdapters; + +end. diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD10.res b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD10.res new file mode 100644 index 00000000..338fbca6 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD10.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD10NET.dpk b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD10NET.dpk new file mode 100644 index 00000000..81ef5bbe --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD10NET.dpk @@ -0,0 +1,95 @@ +package cxIBXAdaptersD10NET; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Interbase Express Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + cxDataD10NET, + Borland.VclIBXpress, + System.Drawing; + +contains + cxIBXAdapters; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD10NET.res b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD10NET.res new file mode 100644 index 00000000..3c40e32f Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD10NET.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD11.dpk b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD11.dpk new file mode 100644 index 00000000..bd850424 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD11.dpk @@ -0,0 +1,38 @@ +package cxIBXAdaptersD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Interbase Express Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + ibxpress, + cxDataD11; + +contains + cxIBXAdapters; + +end. diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD11.res b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD11.res new file mode 100644 index 00000000..aa68f033 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD11.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD5.dpk b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD5.dpk new file mode 100644 index 00000000..9e1ac1f5 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD5.dpk @@ -0,0 +1,38 @@ +package cxIBXAdaptersD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Interbase Express Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcldb50, + vclib50, + cxDataD5; + +contains + cxIBXAdapters; + +end. diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD5.res b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD5.res new file mode 100644 index 00000000..fb316f24 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD5.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD6.dpk b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD6.dpk new file mode 100644 index 00000000..a3a513a4 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD6.dpk @@ -0,0 +1,38 @@ +package cxIBXAdaptersD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Interbase Express Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + ibxpress, + cxDataD6; + +contains + cxIBXAdapters; + +end. diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD6.res b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD6.res new file mode 100644 index 00000000..54dd4896 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD6.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD7.dpk b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD7.dpk new file mode 100644 index 00000000..54503d64 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD7.dpk @@ -0,0 +1,38 @@ +package cxIBXAdaptersD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Interbase Express Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + ibxpress, + cxDataD7; + +contains + cxIBXAdapters; + +end. diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD7.res b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD7.res new file mode 100644 index 00000000..4703e1c4 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD7.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD8.dpk b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD8.dpk new file mode 100644 index 00000000..38bd7c08 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD8.dpk @@ -0,0 +1,95 @@ +package cxIBXAdaptersD8; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Interbase Express Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + cxDataD8, + Borland.VclIBXpress, + System.Drawing; + +contains + cxIBXAdapters; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD8.res b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD8.res new file mode 100644 index 00000000..aeee9952 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD8.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD9.dpk b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD9.dpk new file mode 100644 index 00000000..898393d3 --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD9.dpk @@ -0,0 +1,38 @@ +package cxIBXAdaptersD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Interbase Express Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + ibxpress, + cxDataD9; + +contains + cxIBXAdapters; + +end. diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD9.res b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD9.res new file mode 100644 index 00000000..e5d35671 Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD9.res differ diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD9NET.dpk b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD9NET.dpk new file mode 100644 index 00000000..1ab4c28d --- /dev/null +++ b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD9NET.dpk @@ -0,0 +1,95 @@ +package cxIBXAdaptersD9NET; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Interbase Express Adapters for ExpressDataController by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + cxDataD9NET, + Borland.VclIBXpress, + System.Drawing; + +contains + cxIBXAdapters; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD9NET.res b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD9NET.res new file mode 100644 index 00000000..b1267e6e Binary files /dev/null and b/official/x.35/ExpressDataController/Packages/cxIBXAdaptersD9NET.res differ diff --git a/official/x.35/ExpressDataController/Sources/cxADOAdapters.pas b/official/x.35/ExpressDataController/Sources/cxADOAdapters.pas new file mode 100644 index 00000000..69427246 --- /dev/null +++ b/official/x.35/ExpressDataController/Sources/cxADOAdapters.pas @@ -0,0 +1,141 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDataController } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDATACONTROLLER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxADOAdapters; + +{$I cxVer.inc} + +interface + +uses + DB, cxDBData, cxFilter, cxDBFilter; + +type + { TcxADOProviderDetailFilterAdapter } + + TcxADOProviderDetailFilterAdapter = class(TcxDBProviderDetailFilterAdapter) + public + function IsCurrentQuery(ADataSet: TDataSet; const AParamNames: string; const AParamValues: Variant): Boolean; override; + procedure ReopenSQL(ADataSet: TDataSet; const AParamNames: string; const AParamValues: Variant; var AReopened: Boolean); override; + end; + + { TcxADOFilterOperatorAdapter } + + TcxADOFilterOperatorAdapter = class(TcxDBFilterOperatorAdapter) + public + procedure PrepareOperatorClass(ASender: TObject; ADataSet: TDataSet; + var AOperatorClass: TcxFilterOperatorClass); override; + end; + +implementation + +uses + TypInfo, ADODB, cxVariants; + +{ TcxADOProviderDetailFilterAdapter } + +function TcxADOProviderDetailFilterAdapter.IsCurrentQuery(ADataSet: TDataSet; + const AParamNames: string; const AParamValues: Variant): Boolean; +var + AParameters: TParameters; +begin + Result := False; + if IsPublishedProp(ADataSet, 'Parameters') then + begin + AParameters := GetObjectProp(ADataSet, 'Parameters') as TParameters; + if AParameters <> nil then + begin + if VarEquals(AParameters.ParamValues[AParamNames], AParamValues) then + Result := True; + end; + end; +end; + +procedure TcxADOProviderDetailFilterAdapter.ReopenSQL(ADataSet: TDataSet; + const AParamNames: string; const AParamValues: Variant; var AReopened: Boolean); +var + AParameters: TParameters; +begin + if IsPublishedProp(ADataSet, 'Parameters') then + begin + AParameters := GetObjectProp(ADataSet, 'Parameters') as TParameters; + if AParameters <> nil then + begin + if VarEquals(AParameters.ParamValues[AParamNames], AParamValues) then + ADataSet.First + else + begin + ADataSet.DisableControls; + try + ADataSet.Active := False; + AParameters.ParamValues[AParamNames] := AParamValues; + ADataSet.Active := True; + finally + ADataSet.EnableControls; + end; + AReopened := True; // set Flag if Query reopened + end; + end; + end; +end; + +{ TcxADOFilterOperatorAdapter } + +procedure TcxADOFilterOperatorAdapter.PrepareOperatorClass(ASender: TObject; + ADataSet: TDataSet; var AOperatorClass: TcxFilterOperatorClass); +begin + {if AOperatorClass.InheritsFrom(TcxFilterNullOperator) or + AOperatorClass.InheritsFrom(TcxFilterNotNullOperator) then + begin + if (ADataSet is TADOQuery) or + ((ADataSet is TADODataSet) and (TADODataSet(ADataSet).CommandType = cmdText)) then + begin + if AOperatorClass.InheritsFrom(TcxFilterNotNullOperator) then + AOperatorClass := TcxFilterSQLNotNullOperator + else + AOperatorClass := TcxFilterSQLNullOperator; + end; + end;} +end; + +initialization + cxDetailFilterControllers.RegisterAdapter(TCustomADODataSet, TcxADOProviderDetailFilterAdapter); + cxFilterOperatorAdapters.RegisterAdapter(TCustomADODataSet, TcxADOFilterOperatorAdapter); + +finalization + cxDetailFilterControllers.UnregisterAdapter(TCustomADODataSet, TcxADOProviderDetailFilterAdapter); + cxFilterOperatorAdapters.UnregisterAdapter(TCustomADODataSet, TcxADOFilterOperatorAdapter); + +end. diff --git a/official/x.35/ExpressDataController/Sources/cxBDEAdapters.pas b/official/x.35/ExpressDataController/Sources/cxBDEAdapters.pas new file mode 100644 index 00000000..d41ed56a --- /dev/null +++ b/official/x.35/ExpressDataController/Sources/cxBDEAdapters.pas @@ -0,0 +1,83 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDataController } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDATACONTROLLER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxBDEAdapters; + +{$I cxVer.inc} + +interface + +uses + DB, cxDBData, cxFilter, cxDBFilter; + +type + { TcxBDEFilterOperatorAdapter } + + TcxBDEFilterOperatorAdapter = class(TcxDBFilterOperatorAdapter) + public + procedure PrepareOperatorClass(ASender: TObject; ADataSet: TDataSet; + var AOperatorClass: TcxFilterOperatorClass); override; + end; + +implementation + +uses + TypInfo, DBTables, cxVariants; + +{ TcxBDEFilterOperatorAdapter } + +procedure TcxBDEFilterOperatorAdapter.PrepareOperatorClass(ASender: TObject; + ADataSet: TDataSet; var AOperatorClass: TcxFilterOperatorClass); +begin + if AOperatorClass.InheritsFrom(TcxFilterNullOperator) or + AOperatorClass.InheritsFrom(TcxFilterNotNullOperator) then + begin + if ADataSet is TQuery then + begin + if AOperatorClass.InheritsFrom(TcxFilterNotNullOperator) then + AOperatorClass := TcxFilterSQLNotNullOperator + else + AOperatorClass := TcxFilterSQLNullOperator; + end; + end; +end; + +initialization + cxFilterOperatorAdapters.RegisterAdapter(TQuery, TcxBDEFilterOperatorAdapter); + +finalization + cxFilterOperatorAdapters.UnregisterAdapter(TQuery, TcxBDEFilterOperatorAdapter); + +end. diff --git a/official/x.35/ExpressDataController/Sources/cxCustomData.pas b/official/x.35/ExpressDataController/Sources/cxCustomData.pas new file mode 100644 index 00000000..e1556bd4 --- /dev/null +++ b/official/x.35/ExpressDataController/Sources/cxCustomData.pas @@ -0,0 +1,13578 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDataController } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDATACONTROLLER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxCustomData; + +{$I cxVer.inc} + +interface + +uses + SysUtils, Classes, {$IFDEF DELPHI6}Variants, {$ENDIF}cxVariants, + cxDataUtils, cxDataStorage, cxFilter; + +const + cxNullEditingRecordIndex = -MaxInt; + +type + TcxCustomDataControllerInfo = class; + TcxCustomDataController = class; + TcxCustomDataProvider = class; + TcxCustomDataField = class; + TcxCustomDataFieldList = class; + TcxCustomDataRelationList = class; + TcxDataSummaryItem = class; + TcxDataSummaryItems = class; + TcxDataSummaryGroup = class; + TcxDataSummaryGroups = class; + TcxDataSummaryGroupItemLinks = class; + TcxDataSummary = class; + + EcxInvalidDataControllerOperation = class(Exception); + + { TcxCustomDataSource } + + TcxDataRecordHandle = Pointer; + TcxDataItemHandle = Pointer; + + TcxCustomDataSource = class + private + FCurrentProvider: TcxCustomDataProvider; + FProvider: TcxCustomDataProvider; + FProviders: TList; + function GetDataController: TcxCustomDataController; + function GetProvider: TcxCustomDataProvider; + procedure AddProvider(AProvider: TcxCustomDataProvider); + procedure RemoveProvider(AProvider: TcxCustomDataProvider); + procedure RemoveFromProviders; + protected + function AppendRecord: TcxDataRecordHandle; virtual; // * + procedure CustomSort; virtual; // when IsCustomSorting = True + procedure DeleteRecord(ARecordHandle: TcxDataRecordHandle); virtual; // * + function GetDefaultItemID(AItemIndex: Integer): Integer; virtual; + function GetDetailHasChildren(ARecordIndex, ARelationIndex: Integer): Boolean; virtual; + function GetDisplayText(ARecordHandle: TcxDataRecordHandle; AItemHandle: TcxDataItemHandle): string; virtual; + function GetInfoForCompare(ARecordHandle: TcxDataRecordHandle; AItemHandle: TcxDataItemHandle; var PValueBuffer: PChar): Boolean; virtual; + function GetItemHandle(AItemIndex: Integer): TcxDataItemHandle; virtual; + function GetRecordCount: Integer; virtual; // * + function GetRecordId(ARecordHandle: TcxDataRecordHandle): Variant; virtual; // Save Keys Required + function GetRecordHandle(ARecordIndex: Integer): TcxDataRecordHandle; virtual; + function GetValue(ARecordHandle: TcxDataRecordHandle; AItemHandle: TcxDataItemHandle): Variant; virtual; // * + function InsertRecord(ARecordHandle: TcxDataRecordHandle): TcxDataRecordHandle; virtual; // * + function IsCustomSorting: Boolean; virtual; + function IsNativeCompare: Boolean; virtual; + function IsNativeCompareFunc: Boolean; virtual; + function IsRecordIdSupported: Boolean; virtual; // Save Keys Required + procedure LoadRecordHandles; virtual; + function NativeCompareFunc(ARecordHandle1, ARecordHandle2: TcxDataRecordHandle; AItemHandle: TcxDataItemHandle): Integer; virtual; + procedure SetRecordCount(ARecordCount: Integer); virtual; + procedure SetValue(ARecordHandle: TcxDataRecordHandle; AItemHandle: TcxDataItemHandle; const AValue: Variant); virtual; // * + property CurrentProvider: TcxCustomDataProvider read FCurrentProvider write FCurrentProvider; + // tree + function AddRecordHandle(ARecordHandle: TcxDataRecordHandle): Integer; + public + destructor Destroy; override; + procedure DataChanged; virtual; + function GetRecordHandleByIndex(ARecordIndex: Integer): TcxDataRecordHandle; + function GetRecordIndexByHandle(ARecordHandle: TcxDataRecordHandle): Integer; + property DataController: TcxCustomDataController read GetDataController; + property Provider: TcxCustomDataProvider read GetProvider; + end; + + TcxCustomDataSourceClass = class of TcxCustomDataSource; + + { TcxCustomDataProvider } + + TcxDataChange = (dcField, dcRecord, dcNew, dcDeleted, dcTotal); + TcxDataChangeInfo = record + Kind: TcxDataChange; + ItemIndex: Integer; + RecordIndex: Integer; + end; + + TcxDataLayoutChange = (lcStructure, lcData); + TcxDataLayoutChanges = set of TcxDataLayoutChange; + + TcxDataSummaryCountValues = array of Integer; + TcxDataSummaryValues = array of Variant; + + TcxCustomDataProvider = class + private + FActiveChanging: Boolean; + FChanging: Boolean; + FCustomDataSource: TcxCustomDataSource; + FDataChangedLocked: Boolean; + FDataController: TcxCustomDataController; + FEditingRecordIndex: Integer; + FEditingRecordIndex1: Integer; // After + FEditingRecordIndex2: Integer; // Before + FInsertedRecordIndex: Integer; + FInUpdateData: Boolean; + FLocateCount: Integer; + FLockCount: Integer; + FModified: Boolean; + FRecreatedFieldsAfterFirst: Boolean; + FSavedRecordIndex: Integer; + procedure SetCustomDataSource(Value: TcxCustomDataSource); + protected + FInInserting: Boolean; + FInserting: Boolean; + FLoadAllNeeded: Boolean; + // Mode + procedure CustomSort; virtual; // when IsCustomSorting = True + function IsCustomDataSourceSupported: Boolean; virtual; + function IsCustomSorting: Boolean; virtual; + function IsGridMode: Boolean; virtual; + function IsDataSource: Boolean; virtual; + function IsOtherInsert: Boolean; virtual; + function IsRecordIdSupported: Boolean; virtual; + function IsSyncMode: Boolean; virtual; + // State + function IsActive: Boolean; virtual; + function IsActiveDataSet: Boolean; virtual; + function IsBOF: Boolean; virtual; + function IsChanging: Boolean; virtual; + function IsEditing: Boolean; virtual; + function IsEOF: Boolean; virtual; + function IsGridModeUpdating: Boolean; virtual; + function IsInserting: Boolean; virtual; + function IsModified: Boolean; virtual; + function IsUnboundColumnMode: Boolean; virtual; + // Navigation + procedure CorrectRecordIndex(ARecordIndex: Integer); virtual; + procedure First; virtual; + procedure Prev; virtual; + procedure Next; virtual; + procedure Last; virtual; + procedure MoveBy(ADistance: Integer); virtual; + procedure Scroll(ADistance: Integer); virtual; + procedure SavePos; virtual; + procedure RestorePos; virtual; + // Editing + function CanAppend: Boolean; virtual; + function CanDelete: Boolean; virtual; + function CanInitEditing(ARecordIndex: Integer): Boolean; virtual; + function CanInsert: Boolean; virtual; + function CanModify: Boolean; virtual; + + procedure Append; virtual; + procedure Cancel; virtual; + procedure DoUpdateData; virtual; + procedure Delete; virtual; + procedure DeleteRecords(AList: TList); virtual; + procedure DeleteSelection; virtual; + procedure Edit; virtual; + function GetEditValue(ARecordIndex: Integer; AField: TcxCustomDataField; AEditValueSource: TcxDataEditValueSource): Variant; virtual; + procedure Insert; virtual; + procedure Post; virtual; + procedure PostEditingData; virtual; + function SetEditValue(ARecordIndex: Integer; AField: TcxCustomDataField; const AValue: Variant; AEditValueSource: TcxDataEditValueSource): Boolean; virtual; + + procedure BeginDeleting; virtual; + procedure EndDeleting; virtual; + + procedure AssignItemValue(ARecordIndex: Integer; AField: TcxCustomDataField; const AValue: Variant); virtual; + procedure ClearSavedRecord; + procedure CreateSavedRecord(ARecordIndex: Integer); + procedure DoInitInsertingRecord(AInsertingRecordIndex: Integer; const AGroupValues: TcxDataSummaryValues); virtual; + procedure EditingRecord; virtual; + procedure InsertingRecord(AIsAppending: Boolean); virtual; + procedure ResetChanging; virtual; + procedure ResetEditing; virtual; + procedure ResetModified; virtual; + procedure SetChanging; virtual; + procedure SetEditing; virtual; + procedure SetModified; virtual; + // Lock Notify + procedure BeginLocate; virtual; + procedure EndLocate; virtual; + procedure Freeze; virtual; + procedure Unfreeze; virtual; + // Data + function AddRecordHandle(AData: Pointer): Integer; + function AppendRecord: Integer; virtual; + procedure DeleteRecord(ARecordIndex: Integer); virtual; + function GetDetailHasChildren(ARecordIndex, ARelationIndex: Integer): Boolean; virtual; + function GetDisplayText(ARecordIndex: Integer; AField: TcxCustomDataField): string; virtual; +// function GetRecordCount: Integer; virtual; + function GetExternalDataDisplayText(ARecordIndex: Integer; AField: TcxCustomDataField): string; virtual; + function GetExternalDataValue(ARecordIndex: Integer; AField: TcxCustomDataField): Variant; virtual; + function GetRecordId(ARecordIndex: Integer): Variant; virtual; + function GetRecordIndex: Integer; virtual; + function GetValue(ARecordIndex: Integer; AField: TcxCustomDataField): Variant; virtual; + function GetValueDefReaderClass: TcxValueDefReaderClass; virtual; + function InsertRecord(ARecordIndex: Integer): Integer; virtual; + procedure LoadDataBuffer; virtual; + procedure LoadRecordHandles; + function NativeCompare(ARecordIndex1, ARecordIndex2: Integer; AField: TcxCustomDataField): Integer; virtual; + function NativeCompareFunc(ARecordIndex1, ARecordIndex2: Integer; AField: TcxCustomDataField): Integer; virtual; + procedure SetDisplayText(ARecordIndex: Integer; AField: TcxCustomDataField; const Value: string); virtual; + procedure SetRecordCount(ARecordCount: Integer); virtual; + procedure SetValue(ARecordIndex: Integer; AField: TcxCustomDataField; const Value: Variant); virtual; + // Notification + procedure ActiveChanged(AActive: Boolean); virtual; + procedure DataChanged(ADataChange: TcxDataChange; AItemIndex, ARecordIndex: Integer); virtual; + procedure DataScrolled(ADistance: Integer); virtual; + procedure LayoutChanged(ADataLayoutChanges: TcxDataLayoutChanges); virtual; + + property ActiveChanging: Boolean read FActiveChanging write FActiveChanging; + property CustomDataSource: TcxCustomDataSource read FCustomDataSource write SetCustomDataSource; + property DataController: TcxCustomDataController read FDataController; + property EditingRecordIndex: Integer read FEditingRecordIndex; + property InsertedRecordIndex: Integer read FInsertedRecordIndex; + property LocateCount: Integer read FLocateCount; + property LockCount: Integer read FLockCount; + property RecreatedFieldsAfterFirst: Boolean read FRecreatedFieldsAfterFirst write FRecreatedFieldsAfterFirst; + public + constructor Create(ADataController: TcxCustomDataController); virtual; + destructor Destroy; override; + end; + + TcxCustomDataProviderClass = class of TcxCustomDataProvider; + + { TcxCustomDataField } + + TcxCustomDataField = class + private + FFieldList: TcxCustomDataFieldList; + FIsInternal: Boolean; + FItem: TObject; + FLockRecreateData: Integer; + FNeedConversion: Boolean; + FNeedConversionFlag: Integer; // 0 - undefined; -1 - not needed; 1 - needed; 2 - SortByDisplayText + FPrepared: Boolean; + FReferenceField: TcxCustomDataField; + FTextStored: Boolean; + FValueDef: TcxValueDef; + FValueTypeClass: TcxValueTypeClass; + function GetDataController: TcxCustomDataController; + function GetIndex: Integer; + function GetNotifier: TComponent; + function GetTextStored: Boolean; + function GetValueDef: TcxValueDef; + function GetValueTypeClass: TcxValueTypeClass; + procedure SetIndex(Value: Integer); + procedure SetIsInternal(Value: Boolean); + procedure SetReferenceField(Value: TcxCustomDataField); + procedure SetTextStored(Value: Boolean); + procedure SetValueTypeClass(Value: TcxValueTypeClass); + protected + procedure BeginRecreateData; + procedure Changed; + procedure ClearData; + procedure CreateData; + procedure EndRecreateData; + procedure Reassign(ASource: TcxCustomDataField); virtual; + procedure RemoveNotification(AComponent: TComponent); virtual; + property FieldList: TcxCustomDataFieldList read FFieldList; + property NeedConversion: Boolean read FNeedConversion write FNeedConversion; + property Notifier: TComponent read GetNotifier; + property TextStored: Boolean read GetTextStored write SetTextStored; + property ValueDef: TcxValueDef read GetValueDef; + public + constructor Create(AFieldList: TcxCustomDataFieldList); virtual; + destructor Destroy; override; + function CanModify(AEditValueSource: TcxDataEditValueSource): Boolean; virtual; + function IsUnbound: Boolean; virtual; + function IsValueDefInternal: Boolean; virtual; + property DataController: TcxCustomDataController read GetDataController; + property Index: Integer read GetIndex write SetIndex; + property IsInternal: Boolean read FIsInternal write SetIsInternal; + property Item: TObject read FItem write FItem; + property ReferenceField: TcxCustomDataField read FReferenceField write SetReferenceField; + property ValueTypeClass: TcxValueTypeClass read GetValueTypeClass write SetValueTypeClass; + end; + + TcxCustomDataFieldClass = class of TcxCustomDataField; + + { TcxCustomDataFieldList } + + TcxCustomDataFieldList = class + private + FDataController: TcxCustomDataController; + FFieldDestroyed: Boolean; + FInternalCount: Integer; + FItems: TList; + function GetCount: Integer; + function GetItem(Index: Integer): TcxCustomDataField; + function GetItemCount: Integer; + protected + procedure Add(AField: TcxCustomDataField); + procedure Clear; + procedure RemoveField(AField: TcxCustomDataField); + procedure RemoveNotification(AComponent: TComponent); virtual; + procedure Update; + public + constructor Create(ADataController: TcxCustomDataController); virtual; + destructor Destroy; override; + function FieldByItem(AItem: TObject): TcxCustomDataField; + procedure ReassignFields(ADestroyedField: TcxCustomDataField); + property Count: Integer read GetCount; + property DataController: TcxCustomDataController read FDataController; + property ItemCount: Integer read GetItemCount; + property Items[Index: Integer]: TcxCustomDataField read GetItem; default; + end; + + { Master-Detail } + + TcxDetailInfoObject = class + LinkObject: TObject; + HasChildren: Boolean; + HasChildrenAssigned: Boolean; + public + destructor Destroy; override; + end; + + TcxDetailObject = class + private + FActiveRelationIndex: Integer; + FInfoObjects: TList; + FExpanded: Boolean; + function GetInfoObject(Index: Integer): TcxDetailInfoObject; + function GetInfoObjectCount: Integer; + function GetIsEmpty: Boolean; + function GetLinkObject(Index: Integer): TObject; + function GetLinkObjectCount: Integer; + procedure SetInfoObject(Index: Integer; Value: TcxDetailInfoObject); + procedure SetLinkObject(Index: Integer; Value: TObject); + protected + procedure CorrectCount(ARelations: TcxCustomDataRelationList); + public + constructor Create; + destructor Destroy; override; + procedure Clear; + function ClearHasChildrenFlag: Boolean; + procedure ClearInfoObject(AIndex: Integer); + property ActiveRelationIndex: Integer read FActiveRelationIndex write FActiveRelationIndex; + property Expanded: Boolean read FExpanded write FExpanded; + property InfoObjectCount: Integer read GetInfoObjectCount; + property InfoObjects[Index: Integer]: TcxDetailInfoObject read GetInfoObject write SetInfoObject; + property IsEmpty: Boolean read GetIsEmpty; + property LinkObjectCount: Integer read GetLinkObjectCount; + property LinkObjects[Index: Integer]: TObject read GetLinkObject write SetLinkObject; + end; + + { TcxCustomDataRelation } + + TcxCustomDataRelation = class + private + FDetailDataController: TcxCustomDataController; + FItem: TObject; + FRelationList: TcxCustomDataRelationList; + function GetDataController: TcxCustomDataController; + function GetIndex: Integer; + protected + procedure Changed; + procedure RemoveDataField(ADataField: TcxCustomDataField); virtual; + public + constructor Create(ARelationList: TcxCustomDataRelationList; AItem: TObject); virtual; + destructor Destroy; override; + procedure Assign(ASource: TcxCustomDataRelation); virtual; + property DataController: TcxCustomDataController read GetDataController; + property DetailDataController: TcxCustomDataController read FDetailDataController; + property Index: Integer read GetIndex; + property Item: TObject read FItem; + property RelationList: TcxCustomDataRelationList read FRelationList; + end; + + TcxCustomDataRelationClass = class of TcxCustomDataRelation; + + { TcxCustomDataRelationList } + + TcxCustomDataRelationList = class + private + FDataController: TcxCustomDataController; + FDataField: TcxCustomDataField; + FItems: TList; + FLockCount: Integer; + procedure AddItem(AItem: TcxCustomDataRelation); + function GetCount: Integer; + function GetItem(Index: Integer): TcxCustomDataRelation; + procedure RemoveItem(AItem: TcxCustomDataRelation); + protected + procedure Changed(ARelation: TcxCustomDataRelation); + function GetValueAsDetailObject(ARecordIndex: Integer): TcxDetailObject; + procedure RemoveDataField(ADataField: TcxCustomDataField); + procedure Update(ARelation: TcxCustomDataRelation); + + property DataController: TcxCustomDataController read FDataController; + property LockCount: Integer read FLockCount; + public + constructor Create(ADataController: TcxCustomDataController); + destructor Destroy; override; + function Add(AItem: TObject): TcxCustomDataRelation; + procedure Assign(ASource: TcxCustomDataRelationList); + procedure BeginUpdate; + procedure Clear; + function ClearDetailObject(ARecordIndex, ARelationIndex: Integer): Boolean; + procedure EndUpdate; + function FindByItem(AItem: TObject): TcxCustomDataRelation; + function GetDetailObject(ARecordIndex: Integer): TcxDetailObject; + function IsDetailObjectExist(ARecordIndex, ARelationIndex: Integer): Boolean; + function IsEmpty: Boolean; + procedure Move(ACurIndex, ANewIndex: Integer); + procedure RemoveByItem(AItem: TObject); + + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxCustomDataRelation read GetItem; default; + end; + + { TcxCustomDataController } + + { TcxSortingFieldList } + + TcxDataSortOrder = (soNone, soAscending, soDescending); + + TcxDataSortInfo = record + Field: TcxCustomDataField; + SortOrder: TcxDataSortOrder; + end; + PcxDataSortInfo = ^TcxDataSortInfo; + + TcxNoParamsEvent = procedure of object; + + TcxSortingFieldList = class + private + FItems: TList; + FOnChanged: TcxNoParamsEvent; + function GetCount: Integer; + function GetItem(Index: Integer): TcxDataSortInfo; + protected + procedure Add(AField: TcxCustomDataField; ASortOrder: TcxDataSortOrder); + procedure Changed; + procedure Delete(Index: Integer); + function Find(AField: TcxCustomDataField): Integer; + procedure Insert(Index: Integer; AField: TcxCustomDataField; ASortOrder: TcxDataSortOrder); + procedure Move(ACurIndex, ANewIndex: Integer); + procedure Remove(AField: TcxCustomDataField); + procedure SetSortOrder(Index: Integer; ASortOrder: TcxDataSortOrder); + public + constructor Create; + destructor Destroy; override; + procedure AppendFrom(AList: TcxSortingFieldList); + procedure ChangeSorting(AField: TcxCustomDataField; ASortOrder: TcxDataSortOrder); virtual; + procedure CheckField(AField: TcxCustomDataField); + procedure Clear; + function SortIndexByField(AField: TcxCustomDataField): Integer; + function SortOrderByField(AField: TcxCustomDataField): TcxDataSortOrder; + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxDataSortInfo read GetItem; default; + property OnChanged: TcxNoParamsEvent read FOnChanged write FOnChanged; + end; + + TcxGroupingFieldList = class(TcxSortingFieldList) + public + procedure ChangeGrouping(AField: TcxCustomDataField; AGroupIndex: Integer); + procedure ChangeSorting(AField: TcxCustomDataField; ASortOrder: TcxDataSortOrder); override; + function GroupIndexByField(AField: TcxCustomDataField): Integer; + procedure UpdateSorting(ASortingFieldList: TcxSortingFieldList); + end; + + { TcxDataGroups } + + TcxDataGroupInfo = class + RowIndex: Integer; + Expanded: Boolean; + Level: Integer; + BeginRecordListIndex: Integer; + EndRecordListIndex: Integer; + SummaryValues: Variant; + end; + + TcxGroupsRowInfo = record + Expanded: Boolean; + Level: Integer; + RecordListIndex: Integer; + end; + + TcxDataGroups = class + private + FFields: TList; + FItems: TList; + + function GetField(Index: Integer): TcxCustomDataField; + function GetFieldCount: Integer; + function GetItem(Index: Integer): TcxDataGroupInfo; + function GetItemCount: Integer; + function GetRowCount: Integer; + function GetRowInfo(ARowIndex: Integer): TcxGroupsRowInfo; + function GetTopVisibleItem(ARowIndex: Integer; var ACurIndex: Integer): TcxDataGroupInfo; + protected + procedure Add(const ADataGroupInfo: TcxDataGroupInfo); + procedure AddField(AField: TcxCustomDataField); + function AddEmpty: TcxDataGroupInfo; + procedure Clear; + function Find(ARowIndex: Integer; var AItem: TcxDataGroupInfo): Integer; + function FindByIndex(ARecordListIndex, ALevel: Integer): Integer; + function IsVisible(AIndex: Integer): Boolean; + function MakeVisible(AIndex: Integer; AExpand: Boolean): Boolean; + + property FieldCount: Integer read GetFieldCount; + property Fields[Index: Integer]: TcxCustomDataField read GetField; + public + constructor Create; + destructor Destroy; override; + procedure ChangeExpanding(ARowIndex: Integer; AExpanded, ARecursive: Boolean); + procedure FullExpanding(AExpanded: Boolean); + function GetChildCount(AIndex: Integer): Integer; + function GetChildIndex(AParentIndex, AIndex: Integer): Integer; + function GetChildRecordListIndex(AParentIndex, AIndex: Integer): Integer; + function GetDataRecordListIndex(AInfo: TcxDataGroupInfo): Integer; + function GetFirstLevelCount: Integer; + function GetFirstLevelIndex(AIndex: Integer): Integer; + function GetIndexByRowIndex(ARowIndex: Integer): Integer; + function GetIndexByRowIndexLevel(ARowIndex, ALevel: Integer): Integer; + function GetLevel(AIndex: Integer): Integer; + function GetParentIndex(AChildIndex: Integer): Integer; + procedure Rebuild; + procedure SetItem(AIndex: Integer; AItem: TcxDataGroupInfo); + + property Count: Integer read GetItemCount; + property Items[Index: Integer]: TcxDataGroupInfo read GetItem; default; + property LevelCount: Integer read GetFieldCount; + property RowInfo[RowIndex: Integer]: TcxGroupsRowInfo read GetRowInfo; + property RowCount: Integer read GetRowCount; + end; + + { TcxCustomDataControllerInfo } + + TcxDataControllerInfoChange = (dcicLoad, dcicGrouping, dcicSorting, + dcicFocusedRow, dcicView, dcicExpanding, dcicResetFocusedRow, dcicSelection, + dcicSummary, dcicFocusedRecord); + TcxDataControllerInfoChanges = set of TcxDataControllerInfoChange; + + TcxRowInfo = record + Expanded: Boolean; + Level: Integer; + RecordIndex: Integer; + end; + + TcxDataFocusingInfo = class + private + FChangedFlag: Boolean; + FDataControllerInfo: TcxCustomDataControllerInfo; + FLevel: Integer; + FPrevNewItemRowFocused: Boolean; + FPrevRecordIndex: Integer; + FRecordIndex: Integer; + FRowIndex: Integer; + protected + procedure Assign(AFocusingInfo: TcxDataFocusingInfo); + procedure Clear; + function IsEqual(AFocusingInfo: TcxDataFocusingInfo): Boolean; + procedure ResetPos; + procedure SavePos; + property Level: Integer read FLevel write FLevel; + property RecordIndex: Integer read FRecordIndex write FRecordIndex; + property RowIndex: Integer read FRowIndex write FRowIndex; + public + constructor Create(ADataControllerInfo: TcxCustomDataControllerInfo); + end; + + TcxDataExpandingInfoState = (eisExpanded, eisSelected); + TcxDataExpandingInfoStateSet = set of TcxDataExpandingInfoState; + + TcxDataExpandingInfo = record + Level: Integer; + Value: Variant; + State: TcxDataExpandingInfoStateSet; + end; + PcxDataExpandingInfo = ^TcxDataExpandingInfo; + + TcxDataExpandingInfos = class + private + FFields: TList; + FItems: TList; + FSaveStates: TcxDataExpandingInfoStateSet; + function Find(AField: TcxCustomDataField): Integer; + function GetCount: Integer; + function GetEmpty: Boolean; + function GetField(Index: Integer): TcxCustomDataField; + function GetFieldCount: Integer; + function GetItem(Index: Integer): PcxDataExpandingInfo; + protected + procedure AddField(AField: TcxCustomDataField); + procedure AddItem(ALevel: Integer; const AValue: Variant; AState: TcxDataExpandingInfoStateSet); + procedure CheckField(AField: TcxCustomDataField); + procedure Clear; + procedure ClearFields; + procedure ClearValues; + public + constructor Create; + destructor Destroy; override; + property Count: Integer read GetCount; + property Empty: Boolean read GetEmpty; + property FieldCount: Integer read GetFieldCount; + property Fields[Index: Integer]: TcxCustomDataField read GetField; + property Items[Index: Integer]: PcxDataExpandingInfo read GetItem; default; + property SaveStates: TcxDataExpandingInfoStateSet read FSaveStates write FSaveStates; + end; + + TcxDataSelectionInfo = record + Level: Integer; + RecordIndex: Integer; // if Level = -1 then RecordIndex is GroupIndex (in DataGroups) + RowIndex: Integer; + end; + PcxDataSelectionInfo = ^TcxDataSelectionInfo; + + TcxDataSelection = class + private + FAnchorRowIndex: Integer; + FDataController: TcxCustomDataController; + FItems: TList; + FFields: TList; + FOnChanged: TcxNoParamsEvent; + function GetCount: Integer; + function GetField(Index: Integer): TcxCustomDataField; + function GetFieldCount: Integer; + function GetItem(Index: Integer): PcxDataSelectionInfo; + protected + procedure Changed; + procedure CheckAfterFiltering; + procedure ClearAnchor; virtual; + procedure InternalAdd(AIndex, ARowIndex, ARecordIndex, ALevel: Integer); virtual; + procedure InternalClear; virtual; + procedure InternalDelete(AIndex: Integer); virtual; + procedure SetInternalCount(ACount: Integer); virtual; + public + constructor Create(ADataController: TcxCustomDataController); virtual; + destructor Destroy; override; + procedure Add(AIndex, ARowIndex, ARecordIndex, ALevel: Integer); virtual; + procedure AddField(AField: TcxCustomDataField); + procedure Clear; + procedure ClearAll; + procedure ClearFields; + procedure Delete(AIndex: Integer); + function FindByGroupIndex(AGroupIndex: Integer): Integer; + function FindByRecordIndex(ARecordIndex: Integer): Integer; + function FindByRowIndex(ARowIndex: Integer; var AIndex: Integer): Boolean; virtual; + function IsRecordSelected(ARecordIndex: Integer): Boolean; + function IsRowSelected(ARowIndex: Integer): Boolean; + procedure Sort; + property Count: Integer read GetCount; + property DataController: TcxCustomDataController read FDataController; + property FieldCount: Integer read GetFieldCount; + property Fields[Index: Integer]: TcxCustomDataField read GetField; + property Items[Index: Integer]: PcxDataSelectionInfo read GetItem; default; + property AnchorRowIndex: Integer read FAnchorRowIndex; + property OnChanged: TcxNoParamsEvent read FOnChanged write FOnChanged; + end; + + TcxDataSelectionClass = class of TcxDataSelection; + + TcxCustomDataControllerInfo = class + private + FChanges: TcxDataControllerInfoChanges; + FDataController: TcxCustomDataController; + FDataGroups: TcxDataGroups; + FExpandingInfo: TcxDataExpandingInfos; + FExpandingFlag: Boolean; + FFocusingFlag: Boolean; + FFocusingInfo: TcxDataFocusingInfo; + FGroupingFieldList: TcxGroupingFieldList; + FInCanFocusedRowChanging: Boolean; + FInfoCalculation: Boolean; + FLockCount: Integer; + FPrevFocusingInfo: TcxDataFocusingInfo; + FRecordList: TList; + FSelection: TcxDataSelection; + FSortingFieldList: TcxSortingFieldList; + FTotalSortingFieldList: TcxSortingFieldList; + procedure CheckAfterCollapsing; + procedure CheckExpanding; + procedure CheckFocusing; + procedure CheckFocusingAfterFilter; + procedure CheckInfo; + procedure ClearInfo; + function CompareRecords(ARecord1, ARecord2: Pointer): Integer; + function GetFocusedRecordIndex: Integer; + function GetFocusedRowIndex: Integer; + function GetNewItemRowFocusingChanged: Boolean; + function GetPrevFocusedRecordIndex: Integer; + function GetPrevFocusedRowIndex: Integer; + procedure SaveInfo; + procedure SetFocusedRowIndex(Value: Integer); + protected + function CanFocusedRowChanging(ARowIndex: Integer): Boolean; + procedure CorrectFocusedRow(ARowIndex: Integer); + procedure DoChangeFocusedRow(AValue: Integer; AIsInternal: Boolean); + procedure DoFilter; + procedure DoGrouping; + procedure DoLoad; + procedure DoSort; + procedure DoBeginSummary; + procedure DoEndSummary; + function FindDataGroup(ARecordListIndex: Integer): Integer; + function FindFocusedRow(ANearest: Boolean): Integer; + procedure ForwardChanges; + function GetInternalRecordCount: Integer; + function GetInternalRecordListIndex(ARecordIndex: Integer): Integer; + function IsAlwaysExpanded: Boolean; + function IsGrouped: Boolean; + function IsSummaryForSelectedRecords: Boolean; + function LocateGroupByLevel(AGroupIndex, ALevel: Integer): Integer; + function LocateDetail(AGroupIndex, ARecordListIndex: Integer; AMakeVisible: Boolean): Integer; + procedure PrepareSorting; + procedure RecalcSelection; + procedure ResetFocusing; + procedure SaveExpanding(ASaveStates: TcxDataExpandingInfoStateSet); + procedure TruncateSelection; virtual; + procedure UnprepareSorting; + procedure Update; virtual; + // Sorting By Summary + procedure DoSortBySummary; + function IsSortingBySummary: Boolean; + + property SortingFieldList: TcxSortingFieldList read FSortingFieldList; + property TotalSortingFieldList: TcxSortingFieldList read FTotalSortingFieldList; + public + constructor Create(ADataController: TcxCustomDataController); virtual; + destructor Destroy; override; + procedure BeginUpdate; + procedure EndUpdate; + procedure CheckChanges; + procedure CheckRowIndex(ARowIndex: Integer); + function GetInternalRecordIndex(ARecordListIndex: Integer): Integer; + procedure Refresh; + procedure RefreshFocused; + procedure RefreshSummary(ARedrawOnly: Boolean); + // Notify + procedure ExpandingChanged; + procedure FocusedRecordChanged(AChangedFlag: Boolean); + procedure GroupingChanged; + procedure SelectionChanged; + procedure SortingChanged; + // Structure + procedure RemoveField(AField: TcxCustomDataField); + procedure UpdateField(AField: TcxCustomDataField); + // Sorting + procedure ChangeSortIndex(AField: TcxCustomDataField; ASortIndex: Integer); + procedure ChangeSorting(AField: TcxCustomDataField; ASortOrder: TcxDataSortOrder); + procedure ClearSorting(AKeepGroupedItems: Boolean); + // Grouping + procedure ChangeExpanding(ARowIndex: Integer; AExpanded, ARecursive: Boolean); + procedure ChangeGrouping(AField: TcxCustomDataField; AGroupIndex: Integer); + procedure ClearGrouping; + function CompareGroupRecords(ARecordIndex1, ARecordIndex2, AIndex: Integer): Integer; + procedure FullCollapse; + procedure FullExpand; + property DataGroups: TcxDataGroups read FDataGroups; + property GroupingFieldList: TcxGroupingFieldList read FGroupingFieldList; + // View Data + function GetNearestRowIndex(ARowIndex: Integer): Integer; + function GetRowCount: Integer; + function GetRowIndexByRecordIndex(ARecordIndex: Integer; AMakeVisible: Boolean): Integer; + function GetRowInfo(ARowIndex: Integer): TcxRowInfo; + // Selection + procedure ChangeRowSelection(ARowIndex: Integer; ASelection: Boolean); + procedure ClearSelection; + procedure ClearSelectionAnchor; + function GetSelectedCount: Integer; + function GetSelectedRowIndex(Index: Integer): Integer; + function IsRowSelected(ARowIndex: Integer): Boolean; + property Selection: TcxDataSelection read FSelection; + // Navigation + property FocusedRecordIndex: Integer read GetFocusedRecordIndex; + property FocusedRowIndex: Integer read GetFocusedRowIndex write SetFocusedRowIndex; + property NewItemRowFocusingChanged: Boolean read GetNewItemRowFocusingChanged; + property PrevFocusedRecordIndex: Integer read GetPrevFocusedRecordIndex; + property PrevFocusedRowIndex: Integer read GetPrevFocusedRowIndex; + + property DataController: TcxCustomDataController read FDataController; + property LockCount: Integer read FLockCount; + end; + + { Filter } + + TcxDataFilterCriteriaItem = class(TcxFilterCriteriaItem) + private + function GetDataController: TcxCustomDataController; + function GetField: TcxCustomDataField; + protected + function GetDataValue(AData: TObject): Variant; override; + function GetFieldCaption: string; override; + function GetFieldName: string; override; + function GetItemLink: TObject; override; + procedure SetItemLink(Value: TObject); override; + public + property DataController: TcxCustomDataController read GetDataController; + property Field: TcxCustomDataField read GetField; + end; + + TcxDataFilterValueList = class(TcxFilterValueList) + private + function GetDataController: TcxCustomDataController; + public + procedure Load(AItemIndex: Integer; AInitSortByDisplayText: Boolean = True; + AUseFilteredValues: Boolean = False); virtual; + property DataController: TcxCustomDataController read GetDataController; + end; + + TcxDataFilterGetValueListEvent = procedure(Sender: TcxFilterCriteria; + AItemIndex: Integer; AValueList: TcxDataFilterValueList) of object; + + TcxDataFilterCriteria = class(TcxFilterCriteria) + private + FActive: Boolean; + FDataController: TcxCustomDataController; + FDestroying: Boolean; + FOnGetValueList: TcxDataFilterGetValueListEvent; + procedure SetActive(Value: Boolean); + protected + procedure DefineProperties(Filer: TFiler); override; + function DoFilterRecord(ARecordIndex: Integer): Boolean; + function GetIDByItemLink(AItemLink: TObject): Integer; override; + function GetNameByItemLink(AItemLink: TObject): string; override; + function GetItemClass: TcxFilterCriteriaItemClass; override; + function GetItemLinkByID(AID: Integer): TObject; override; + function GetItemLinkByName(const AName: string): TObject; override; + function GetValueListClass: TcxFilterValueListClass; override; + function IsDestroying: Boolean; + function IsInternal: Boolean; + function IsLoading: Boolean; + procedure Update; override; + property Destroying: Boolean read FDestroying; + public + constructor Create(ADataController: TcxCustomDataController); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent; AIgnoreItemNames: Boolean = False); override; + procedure AssignEvents(Source: TPersistent); override; + function CreateValueList: TcxDataFilterValueList; virtual; + function FindItemByItemLink(AItemLink: TObject): TcxFilterCriteriaItem; override; + function IsFiltering: Boolean; virtual; + procedure RemoveItemByField(AField: TcxCustomDataField); + property DataController: TcxCustomDataController read FDataController; + published + property Active: Boolean read FActive write SetActive default False; + property OnGetValueList: TcxDataFilterGetValueListEvent read FOnGetValueList write FOnGetValueList; + end; + + TcxDataFilterCriteriaClass = class of TcxDataFilterCriteria; + + { Filters } + + TcxDataFilterList = class(TList) + private + function GetItem(Index: Integer): TcxDataFilterCriteria; + protected + procedure RemoveItemByField(AField: TcxCustomDataField); + public + procedure Clear; override; + property Items[Index: Integer]: TcxDataFilterCriteria read GetItem; default; + end; + + { Groups } + + TcxDataGroupIndex = Integer; + + TcxDataControllerGroups = class + private + FDataController: TcxCustomDataController; + function GetChildCount(DataGroupIndex: TcxDataGroupIndex): Integer; + function GetChildDataGroupIndex(ParentDataGroupIndex: TcxDataGroupIndex; ChildIndex: Integer): TcxDataGroupIndex; + function GetChildRecordIndex(ParentDataGroupIndex: TcxDataGroupIndex; ChildIndex: Integer): Integer; + function GetDataControllerInfo: TcxCustomDataControllerInfo; + function GetDataGroupIndexByRowIndex(RowIndex: Integer): TcxDataGroupIndex; + function GetDataGroups: TcxDataGroups; + function GetFieldGroupIndex(AField: TcxCustomDataField): Integer; + function GetGroupingItemCount: Integer; + function GetGroupingItemIndex(Index: Integer): Integer; + function GetGroupDisplayText(ADataGroupIndex: TcxDataGroupIndex): string; + function GetGroupValue(ADataGroupIndex: TcxDataGroupIndex): Variant; + function GetItemGroupIndex(AItemIndex: Integer): Integer; + function GetLevel(ADataGroupIndex: TcxDataGroupIndex): Integer; + function GetParentDataGroupIndex(ChildDataGroupIndex: TcxDataGroupIndex): TcxDataGroupIndex; + protected + function GetGroupRecordIndex(ADataGroupIndex: TcxDataGroupIndex): Integer; + property DataControllerInfo: TcxCustomDataControllerInfo read GetDataControllerInfo; + property DataGroups: TcxDataGroups read GetDataGroups; + property LevelCount: Integer read GetGroupingItemCount; + public + constructor Create(ADataController: TcxCustomDataController); + procedure ChangeExpanding(ARowIndex: Integer; AExpanded, ARecursive: Boolean); + procedure ChangeGrouping(AItemIndex, AGroupIndex: Integer); + procedure ClearGrouping; + procedure FullCollapse; + procedure FullExpand; + function GetDataGroupIndexByGroupValue(AParentDataGroupIndex: TcxDataGroupIndex; + const AGroupValue: Variant): TcxDataGroupIndex; + function HasAsParent(ARowIndex, AParentRowIndex: Integer): Boolean; + procedure LoadRecordIndexes(AList: TList; ADataGroupIndex: TcxDataGroupIndex); + procedure LoadRecordIndexesByRowIndex(AList: TList; ARowIndex: Integer); + + property DataController: TcxCustomDataController read FDataController; + // Grouping + property FieldGroupIndex[AField: TcxCustomDataField]: Integer read GetFieldGroupIndex; + property GroupingItemCount: Integer read GetGroupingItemCount; + property GroupingItemIndex[Index: Integer]: Integer read GetGroupingItemIndex; + property ItemGroupIndex[ItemIndex: Integer]: Integer read GetItemGroupIndex; + // Navigation + property DataGroupIndexByRowIndex[RowIndex: Integer]: TcxDataGroupIndex read GetDataGroupIndexByRowIndex; + property Level[ADataGroupIndex: TcxDataGroupIndex]: Integer read GetLevel; + property ChildCount[DataGroupIndex: TcxDataGroupIndex]: Integer read GetChildCount; // for Level = 0 DataGroupIndex = -1 + property ChildDataGroupIndex[ParentDataGroupIndex: TcxDataGroupIndex; ChildIndex: Integer]: TcxDataGroupIndex read GetChildDataGroupIndex; + property ChildRecordIndex[ParentDataGroupIndex: TcxDataGroupIndex; ChildIndex: Integer]: Integer read GetChildRecordIndex; + property ParentDataGroupIndex[ChildDataGroupIndex: TcxDataGroupIndex]: TcxDataGroupIndex read GetParentDataGroupIndex; + // Values + property GroupDisplayTexts[ADataGroupIndex: TcxDataGroupIndex]: string read GetGroupDisplayText; + property GroupValues[ADataGroupIndex: TcxDataGroupIndex]: Variant read GetGroupValue; + end; + + { Summary } + + TcxCustomDataSummaryItem = class(TCollectionItem) + private + FField: TcxCustomDataField; + function GetItemLink: TObject; + procedure SetItemLink(Value: TObject); + protected + function GetDataController: TcxCustomDataController; virtual; abstract; + procedure ItemLinkChanging(AField: TcxCustomDataField); virtual; + public + procedure Assign(Source: TPersistent); override; + procedure BeginUpdate; + procedure EndUpdate; + property DataController: TcxCustomDataController read GetDataController; + property ItemLink: TObject read GetItemLink write SetItemLink; + property Field: TcxCustomDataField read FField; + end; + + TcxSummaryKind = (skNone, skSum, skMin, skMax, skCount, skAverage); + TcxSummaryOption = (soNullIgnore, soSelectedRecords, soMultipleSelectedRecords); + TcxSummaryOptions = set of TcxSummaryOption; + TcxSummaryPosition = (spGroup, spFooter); + + TcxSummaryProperty = (spFormat, spKind, spSorted); + TcxSummaryProperties = set of TcxSummaryProperty; + + TcxSummaryValueType = (svtFloat, svtCurrency, svtDate); + + TcxDataSummaryItemGetTextEvent = procedure(Sender: TcxDataSummaryItem; + const AValue: Variant; AIsFooter: Boolean; var AText: string) of object; + + TcxDataSummaryItem = class(TcxCustomDataSummaryItem) + private + FFormat: string; + FKind: TcxSummaryKind; + FSorted: Boolean; + FOnGetText: TcxDataSummaryItemGetTextEvent; + function GetPosition: TcxSummaryPosition; + function GetSummaryItems: TcxDataSummaryItems; + procedure SetFormat(const Value: string); + procedure SetKind(Value: TcxSummaryKind); + procedure SetPosition(Value: TcxSummaryPosition); + procedure SetSorted(Value: Boolean); + protected + FPosition: TcxSummaryPosition; + function GetDataController: TcxCustomDataController; override; + function GetValueType(AVarType: TVarType): TcxSummaryValueType; + function IsCurrency(AVarType: TVarType): Boolean; virtual; + function IsDataBinded: Boolean; virtual; + function IsPositionStored: Boolean; virtual; + public + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function DataField: TcxCustomDataField; virtual; + function FormatValue(const AValue: Variant; AIsFooter: Boolean): string; virtual; + property DataController: TcxCustomDataController read GetDataController; + property SummaryItems: TcxDataSummaryItems read GetSummaryItems; + property Sorted: Boolean read FSorted write SetSorted default False; + published + property Format: string read FFormat write SetFormat; + property Kind: TcxSummaryKind read FKind write SetKind default skNone; + property Position: TcxSummaryPosition read GetPosition write SetPosition stored IsPositionStored; + property OnGetText: TcxDataSummaryItemGetTextEvent read FOnGetText write FOnGetText; + end; + + TcxDataSummaryItemClass = class of TcxDataSummaryItem; + + TcxSummaryEventArguments = record + RecordIndex: Integer; + SummaryItem: TcxDataSummaryItem; + end; + + TcxSummaryEventOutArguments = record + Value: Variant; + SummaryValue: Variant; + CountValue: Integer; + Done: Boolean; + end; + + TcxSummaryEvent = procedure(ASender: TcxDataSummaryItems; + Arguments: TcxSummaryEventArguments; + var OutArguments: TcxSummaryEventOutArguments) of object; + + TcxDataSummaryItems = class(TcxCollection) + private + FSummary: TcxDataSummary; + FOnSummary: TcxSummaryEvent; + function GetDataController: TcxCustomDataController; + function GetItem(Index: Integer): TcxDataSummaryItem; + procedure SetItem(Index: Integer; Value: TcxDataSummaryItem); + protected + procedure BeforeSortingChange(AItem: TcxDataSummaryItem; AValue: Boolean); virtual; + procedure ChangedView; + function GetItemPosition(AItem: TcxDataSummaryItem): TcxSummaryPosition; virtual; + function GetOwner: TPersistent; override; + function IndexOfField(AField: TcxCustomDataField): Integer; + function IsPositionStored(AItem: TcxDataSummaryItem): Boolean; virtual; + function ItemOfField(AField: TcxCustomDataField): TcxDataSummaryItem; + procedure Update(Item: TCollectionItem); override; + // simple summary routines + function AddDataItem(AItemIndex: Integer; APosition: TcxSummaryPosition): TcxDataSummaryItem; + procedure CheckItemEmpty(AItem: TcxDataSummaryItem); + procedure GetDataItemProperties(AItemIndex: Integer; APosition: TcxSummaryPosition; + AProperties: TcxSummaryProperties; var AFormat: string; var AKind: TcxSummaryKind; + var ASorted: Boolean); + function IsPropertiesEmpty(AProperties: TcxSummaryProperties; const AFormat: string; + AKind: TcxSummaryKind; ASorted: Boolean): Boolean; virtual; + procedure SetDataItemProperties(AItemIndex: Integer; APosition: TcxSummaryPosition; + AProperties: TcxSummaryProperties; const AFormat: string; AKind: TcxSummaryKind; + ASorted: Boolean); + procedure SetItemProperties(AItem: TcxDataSummaryItem; APosition: TcxSummaryPosition; + AProperties: TcxSummaryProperties; const AFormat: string; AKind: TcxSummaryKind; + ASorted: Boolean); + public + constructor Create(ASummary: TcxDataSummary; AItemClass: TcxDataSummaryItemClass); virtual; + function Add: TcxDataSummaryItem; overload; + function Add(AItemLink: TObject; APosition: TcxSummaryPosition; + AKind: TcxSummaryKind; const AFormat: string = ''): TcxDataSummaryItem; overload; + procedure Assign(Source: TPersistent); override; + procedure AssignEvents(Source: TPersistent); virtual; + function DefaultFormat(AValueType: TcxSummaryValueType; ASummaryKind: TcxSummaryKind; AIsFooter: Boolean): string; virtual; + procedure DeleteItems(AItemLink: TObject; APosition: TcxSummaryPosition); + function GetGroupText(const ASummaryValues: Variant): string; virtual; + function IndexOf(AItem: TcxDataSummaryItem): Integer; + function IndexOfItemLink(AItemLink: TObject): Integer; + function ItemOfItemLink(AItemLink: TObject): TcxDataSummaryItem; + // simple summary + function GetDataItem(AItemIndex: Integer; APosition: TcxSummaryPosition; + ACheckKind: Boolean = False; AKind: TcxSummaryKind = skNone): TcxDataSummaryItem; virtual; + function GetDataItemFormat(AItemIndex: Integer; APosition: TcxSummaryPosition): string; + function GetDataItemKind(AItemIndex: Integer; APosition: TcxSummaryPosition): TcxSummaryKind; + function GetDataItemSorted(AItemIndex: Integer; APosition: TcxSummaryPosition): Boolean; + procedure SetDataItemFormat(AItemIndex: Integer; APosition: TcxSummaryPosition; const Value: string); + procedure SetDataItemKind(AItemIndex: Integer; APosition: TcxSummaryPosition; Value: TcxSummaryKind); + procedure SetDataItemSorted(AItemIndex: Integer; APosition: TcxSummaryPosition; Value: Boolean); + + property DataController: TcxCustomDataController read GetDataController; + property Items[Index: Integer]: TcxDataSummaryItem read GetItem write SetItem; default; + property Summary: TcxDataSummary read FSummary; + published + property OnSummary: TcxSummaryEvent read FOnSummary write FOnSummary; + end; + + TcxDataFooterSummaryItems = class(TcxDataSummaryItems) + protected + function GetItemPosition(AItem: TcxDataSummaryItem): TcxSummaryPosition; override; + function IsPositionStored(AItem: TcxDataSummaryItem): Boolean; override; + end; + + TcxDataGroupSummaryItems = class(TcxDataSummaryItems) + private + FBeginText: string; + FEndText: string; + FSeparator: string; + FOwner: TPersistent; + function IsBeginTextStored: Boolean; + function IsEndTextStored: Boolean; + function IsSeparatorStored: Boolean; + procedure SetBeginText(const Value: string); + procedure SetEndText(const Value: string); + procedure SetSeparator(const Value: string); + protected + procedure BeforeSortingChange(AItem: TcxDataSummaryItem; AValue: Boolean); override; + function GetOwner: TPersistent; override; + public + constructor Create(ASummary: TcxDataSummary; AItemClass: TcxDataSummaryItemClass); override; + procedure Assign(Source: TPersistent); override; + function GetGroupText(const ASummaryValues: Variant): string; override; + function SortedSummaryItem: TcxDataSummaryItem; + published + property BeginText: string read FBeginText write SetBeginText stored IsBeginTextStored; + property EndText: string read FEndText write SetEndText stored IsEndTextStored; + property Separator: string read FSeparator write SetSeparator stored IsSeparatorStored; + end; + + TcxDataSummaryGroupItemLink = class(TcxCustomDataSummaryItem) + private + function GetSummaryGroupItemLinks: TcxDataSummaryGroupItemLinks; + protected + function GetDataController: TcxCustomDataController; override; + procedure ItemLinkChanging(AField: TcxCustomDataField); override; + public + property SummaryGroupItemLinks: TcxDataSummaryGroupItemLinks read GetSummaryGroupItemLinks; + end; + + TcxDataSummaryGroupItemLinkClass = class of TcxDataSummaryGroupItemLink; + + TcxDataSummaryGroupItemLinks = class(TcxCollection) + private + FSummaryGroup: TcxDataSummaryGroup; + function GetItem(Index: Integer): TcxDataSummaryGroupItemLink; + procedure SetItem(Index: Integer; Value: TcxDataSummaryGroupItemLink); + protected + function GetOwner: TPersistent; override; + function IndexOfField(AField: TcxCustomDataField): Integer; + function ItemOfField(AField: TcxCustomDataField): TcxDataSummaryGroupItemLink; + procedure Update(Item: TCollectionItem); override; + public + constructor Create(ASummaryGroup: TcxDataSummaryGroup; AItemClass: TcxDataSummaryGroupItemLinkClass); virtual; + function Add: TcxDataSummaryGroupItemLink; + function IndexOfItemLink(AItemLink: TObject): Integer; + function ItemOfItemLink(AItemLink: TObject): TcxDataSummaryGroupItemLink; + property Items[Index: Integer]: TcxDataSummaryGroupItemLink read GetItem write SetItem; default; + property SummaryGroup: TcxDataSummaryGroup read FSummaryGroup; + end; + + TcxDataSummaryGroup = class(TCollectionItem) + private + FItemLinks: TcxDataSummaryGroupItemLinks; + FSummaryItems: TcxDataGroupSummaryItems; + function GetItemLinks: TcxDataSummaryGroupItemLinks; + function GetSummaryGroups: TcxDataSummaryGroups; + procedure SetItemLinks(Value: TcxDataSummaryGroupItemLinks); + procedure SetSummaryItems(Value: TcxDataGroupSummaryItems); + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + property SummaryGroups: TcxDataSummaryGroups read GetSummaryGroups; + published + property Links: TcxDataSummaryGroupItemLinks read GetItemLinks write SetItemLinks; + property SummaryItems: TcxDataGroupSummaryItems read FSummaryItems write SetSummaryItems; + end; + + TcxDataSummaryGroups = class(TcxCollection) + private + FSummary: TcxDataSummary; + function GetItem(Index: Integer): TcxDataSummaryGroup; + procedure SetItem(Index: Integer; Value: TcxDataSummaryGroup); + protected + function GetOwner: TPersistent; override; + procedure Update(Item: TCollectionItem); override; + public + constructor Create(ASummary: TcxDataSummary); + function Add: TcxDataSummaryGroup; + function FindByItemLink(AItemLink: TObject): TcxDataSummaryGroup; + property Summary: TcxDataSummary read FSummary; + property Items[Index: Integer]: TcxDataSummaryGroup read GetItem write SetItem; default; + end; + + TcxAfterSummaryEvent = procedure(ASender: TcxDataSummary) of object; + + TcxDataSummary = class(TPersistent) + private + FDataController: TcxCustomDataController; + FDefaultGroupSummaryItems: TcxDataGroupSummaryItems; + FDestroying: Boolean; + FFooterSummaryItems: TcxDataFooterSummaryItems; + FFooterSummaryValues: Variant; // array of Variant + FInAfterSummary: Boolean; + FLockCount: Integer; + FOptions: TcxSummaryOptions; + FSetCustomSummary: Boolean; + FSummaryGroups: TcxDataSummaryGroups; + FOnAfterSummary: TcxAfterSummaryEvent; + function GetFooterSummaryValue(Index: Integer): Variant; + function GetFooterSummaryText(Index: Integer): string; + function GetGroupSummaryItems(Level: Integer): TcxDataGroupSummaryItems; + function GetGroupSummaryText(RowIndex: Integer): string; + function GetGroupSummaryDisplayValue(RowIndex, Level, Index: Integer): Variant; + function GetGroupSummaryValue(DataGroupIndex: TcxDataGroupIndex; Index: Integer): Variant; + function GetGroupFooterIndexOfItemLink(Level: Integer; ItemLink: TObject): Integer; + function GetGroupFooterSummaryText(RowIndex, Level, Index: Integer): string; + function GetOptions: TcxSummaryOptions; + procedure SetDefaultGroupSummaryItems(Value: TcxDataGroupSummaryItems); + procedure SetFooterSummaryItems(Value: TcxDataFooterSummaryItems); + procedure SetFooterSummaryValue(Index: Integer; Value: Variant); + procedure SetGroupSummaryDisplayValue(RowIndex, Level, Index: Integer; const Value: Variant); + procedure SetGroupSummaryValue(DataGroupIndex: TcxDataGroupIndex; Index: Integer; const Value: Variant); + procedure SetOptions(Value: TcxSummaryOptions); + procedure SetSummaryGroups(Value: TcxDataSummaryGroups); + protected + procedure BeginCalculateSummary(ASummaryItems: TcxDataSummaryItems; + var ACountValues: TcxDataSummaryCountValues; var ASummaryValues: TcxDataSummaryValues); virtual; + procedure CalculateSummary(ASummaryItems: TcxDataSummaryItems; + ABeginIndex, AEndIndex: Integer; var ACountValues: TcxDataSummaryCountValues; + var ASummaryValues: TcxDataSummaryValues; var SummaryValues: Variant); virtual; + procedure Changed(ARedrawOnly: Boolean); virtual; + procedure DoAfterSummary; virtual; + procedure DoFinishSummaryValue(ASummaryItem: TcxDataSummaryItem; + var SummaryValue: Variant; var CountValue: Integer); virtual; + procedure DoSummaryValue(ASummaryItem: TcxDataSummaryItem; ARecordIndex: Integer; + var SummaryValue: Variant; var CountValue: Integer); virtual; + procedure EndCalculateSummary(ASummaryItems: TcxDataSummaryItems; + var ACountValues: TcxDataSummaryCountValues; var ASummaryValues: TcxDataSummaryValues; + var SummaryValues: Variant); virtual; + function GetGroupSummaryValues(ADataGroupIndex: TcxDataGroupIndex): PVariant; + function GetOwner: TPersistent; override; + function GetRecordIndex(ARecordListIndex: Integer): Integer; virtual; + function GetSummaryGroupItemLinkClass: TcxDataSummaryGroupItemLinkClass; virtual; + function GetSummaryItemClass: TcxDataSummaryItemClass; virtual; + function IsValidSummaryValuesIndex(const ASummaryValues: Variant; AIndex: Integer): Boolean; virtual; + procedure Update(ARedrawOnly: Boolean); virtual; + property Destroying: Boolean read FDestroying; + property LockCount: Integer read FLockCount; + public + constructor Create(ADataController: TcxCustomDataController); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure AssignEvents(Source: TPersistent); virtual; + procedure BeginUpdate; + procedure BeginCalculate; virtual; + procedure EndCalculate; virtual; + procedure Calculate; virtual; + procedure CalculateFooterSummary; virtual; + procedure CalculateGroupSummary; virtual; + procedure CancelUpdate; + procedure EndUpdate; + function GetGroupSummaryInfo(ARowIndex: Integer; var ASummaryItems: TcxDataSummaryItems; + var ASummaryValues: PVariant): Boolean; + function GetPatternSummaryItems(APatternSummary: TcxDataSummary; ASummaryItems: TcxDataSummaryItems): TcxDataSummaryItems; + procedure Recalculate; + procedure RemoveItemByField(AField: TcxCustomDataField); + + property DataController: TcxCustomDataController read FDataController; + property FooterSummaryValues[Index: Integer]: Variant read GetFooterSummaryValue write SetFooterSummaryValue; + property FooterSummaryTexts[Index: Integer]: string read GetFooterSummaryText; + property GroupFooterIndexOfItemLink[Level: Integer; ItemLink: TObject]: Integer read GetGroupFooterIndexOfItemLink; + property GroupSummaryItems[Level: Integer]: TcxDataGroupSummaryItems read GetGroupSummaryItems; + // only for View + property GroupFooterSummaryTexts[RowIndex, Level, Index: Integer]: string read GetGroupFooterSummaryText; + property GroupSummaryText[RowIndex: Integer]: string read GetGroupSummaryText; + property GroupSummaryDisplayValues[RowIndex, Level, Index: Integer]: Variant read GetGroupSummaryDisplayValue write SetGroupSummaryDisplayValue; + // summary group values + property GroupSummaryValues[DataGroupIndex: TcxDataGroupIndex; Index: Integer]: Variant read GetGroupSummaryValue write SetGroupSummaryValue; + published + property DefaultGroupSummaryItems: TcxDataGroupSummaryItems read FDefaultGroupSummaryItems write SetDefaultGroupSummaryItems; + property FooterSummaryItems: TcxDataFooterSummaryItems read FFooterSummaryItems write SetFooterSummaryItems; + property SummaryGroups: TcxDataSummaryGroups read FSummaryGroups write SetSummaryGroups; + property Options: TcxSummaryOptions read GetOptions write SetOptions default []; + property OnAfterSummary: TcxAfterSummaryEvent read FOnAfterSummary write FOnAfterSummary; + end; + + TcxDataSummaryClass = class of TcxDataSummary; + + { Incremental Search } + + TcxDataControllerSearch = class + private + FDataController: TcxCustomDataController; + FLocked: Boolean; + function GetItemIndex: Integer; + function GetSearching: Boolean; + function GetSearchText: string; + procedure SetItemIndex(const Value: Integer); + protected + procedure DoFocusedRecord(AFilteredRecordIndex: Integer); virtual; + function DoSearch(AStartFilteredRecordIndex, AEndFilteredRecordIndex: Integer; + const ASubText: string; AForward: Boolean): Integer; virtual; + public + constructor Create(ADataController: TcxCustomDataController); virtual; + procedure Cancel; + function Locate(AItemIndex: Integer; const ASubText: string): Boolean; virtual; + function LocateNext(AForward: Boolean): Boolean; virtual; + procedure Lock; virtual; + procedure Unlock; virtual; + property DataController: TcxCustomDataController read FDataController; + property ItemIndex: Integer read GetItemIndex write SetItemIndex; + property Locked: Boolean read FLocked; + property Searching: Boolean read GetSearching; + property SearchText: string read GetSearchText; + end; + + TcxDataControllerSearchClass = class of TcxDataControllerSearch; + + { TcxCustomDataController } + // Changing Notification + + TcxDataControllerChange = (dccLayout, dccData, dccFocus, dccSelection, + dccDetail, dccSummary, dccSearch, dccSorting, dccGrouping, dccSyncMasterPos, + dccBookmark, dccUpdateRecord); + TcxDataControllerChanges = set of TcxDataControllerChange; + + TcxUpdateControlInfo = class + end; + + TcxUpdateControlInfoClass = class of TcxUpdateControlInfo; + + TcxFocusedRecordChangedInfo = class(TcxUpdateControlInfo) + private + FFocusedRecordIndex: Integer; + FPrevFocusedRecordIndex: Integer; + FFocusedRowIndex: Integer; + FPrevFocusedRowIndex: Integer; + FNewItemRowFocusingChanged: Boolean; + public + constructor Create(APrevFocusedRecordIndex, AFocusedRecordIndex, APrevFocusedRowIndex, AFocusedRowIndex: Integer; + ANewItemRowFocusingChanged: Boolean); + property FocusedRecordIndex: Integer read FFocusedRecordIndex; + property PrevFocusedRecordIndex: Integer read FPrevFocusedRecordIndex; + property FocusedRowIndex: Integer read FFocusedRowIndex; + property PrevFocusedRowIndex: Integer read FPrevFocusedRowIndex; + property NewItemRowFocusingChanged: Boolean read FNewItemRowFocusingChanged; + end; + + TcxFocusedRowChangedInfo = class(TcxUpdateControlInfo) + private + FFocusedRowIndex: Integer; + FPrevFocusedRowIndex: Integer; + public + constructor Create(APrevFocusedRowIndex, AFocusedRowIndex: Integer); + property FocusedRowIndex: Integer read FFocusedRowIndex; + property PrevFocusedRowIndex: Integer read FPrevFocusedRowIndex; + end; + + TcxGroupingChangingInfo = class(TcxUpdateControlInfo); + + TcxLayoutChangedInfo = class(TcxUpdateControlInfo) + { RowCount has not been changed } + end; + + TcxUpdateRecordInfo = class(TcxUpdateControlInfo) { Record is changed } + private + FRecordIndex: Integer; + public + constructor Create(ARecordIndex: Integer); + property RecordIndex: Integer read FRecordIndex; + end; + + TcxDataChangedInfo = class(TcxUpdateControlInfo) + { RowCount has been changed; Grouping/Expanding changed } + Kind: TcxDataChange; + ItemIndex: Integer; // Kind = dcField + RecordIndex: Integer; // Kind = dcRecord + end; + + TcxBookmarkChangedInfo = class(TcxUpdateControlInfo) + end; + + TcxSelectionChangedInfo = class(TcxUpdateControlInfo) + private + FRowIndexes: TList; + function GetCount: Integer; + function GetRowIndex(Index: Integer): Integer; + public + constructor Create; + constructor CreateEx(ARowIndex1, ARowIndex2: Integer); + destructor Destroy; override; + property Count: Integer read GetCount; + property RowIndexes[Index: Integer]: Integer read GetRowIndex; + end; + + TcxSearchChangedInfo = class(TcxUpdateControlInfo) + end; + + TcxDataSelectionChangedInfo = record + SelectedCount: Integer; + RowIndex: Integer; + end; + + TcxUpdateControlEvent = procedure(AInfo: TcxUpdateControlInfo) of object; + + TcxDataControllerLocateObject = class + private + FDataController: TcxCustomDataController; + FInternalRecordIndex: Integer; + protected + property DataController: TcxCustomDataController read FDataController; + property InternalRecordIndex: Integer read FInternalRecordIndex; + public + constructor Create(ADataController: TcxCustomDataController); virtual; + destructor Destroy; override; + procedure Clear; virtual; + function FindRecordIndex: Integer; virtual; abstract; + procedure ReadData(AValueDefReader: TcxValueDefReader); + end; + + TcxDataControllerKeyLocateObject = class(TcxDataControllerLocateObject) + private + FFields: TList; + public + constructor Create(ADataController: TcxCustomDataController); override; + destructor Destroy; override; + procedure AddField(AField: TcxCustomDataField); + procedure ClearFields; + function FindRecordIndex: Integer; override; + property FieldList: TList read FFields; + end; + + TcxDataControllerGroupLocateObject = class(TcxDataControllerLocateObject) + private + FFields: TList; + FFindFields: TList; + FFindGroupRecordEnabled: Boolean; + FLevel: Integer; + procedure CorrectFindFields; + procedure SetLevel(Value: Integer); + public + constructor Create(ADataController: TcxCustomDataController); override; + destructor Destroy; override; + function FindRecordIndex: Integer; override; + property Level: Integer read FLevel write SetLevel; + end; + + TcxValueDefUnboundReader = class(TcxValueDefReader) + private + FItems: TList; + FValues: TList; + public + constructor Create; override; + destructor Destroy; override; + procedure Clear; + function GetValue(AValueDef: TcxValueDef): Variant; override; + function IsInternal(AValueDef: TcxValueDef): Boolean; override; + procedure SetValue(AValueDef: TcxValueDef; const AValue: Variant); + procedure Truncate(AItemCount: Integer); + end; + + TcxValueDefRecordReader = class(TcxValueDefReader) + private + FDataController: TcxCustomDataController; + FRecordIndex: Integer; + public + constructor Create(ADataController: TcxCustomDataController; ARecordIndex: Integer); reintroduce; + function GetDisplayText(AValueDef: TcxValueDef): string; override; + function GetValue(AValueDef: TcxValueDef): Variant; override; + function IsInternal(AValueDef: TcxValueDef): Boolean; override; + end; + + TcxDataControllerComparisonMode = (dccmSorting, dccmGrouping, dccmOther); + + // Detail Mode + TcxDataControllerDetailMode = (dcdmNone, dcdmPattern, dcdmClone); + + TcxDataControllerEachDetailProc = procedure(ADataController: TcxCustomDataController) of object; + TcxDataControllerEachRowProc = procedure(ARowIndex: Integer; ARowInfo: TcxRowInfo) of object; + + TcxDataControllerNotifier = class(TComponent) // because TcxCustomDataController is TPersistent + private + FDataController: TcxCustomDataController; + protected + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + public + constructor Create(AOwner: TComponent; ADataController: TcxCustomDataController); reintroduce; + property DataController: TcxCustomDataController read FDataController; + end; + + TcxSortingBySummaryEngineClass = class of TcxSortingBySummaryEngine; + + TcxSortingBySummaryEngine = class + private + FDataControllerInfo: TcxCustomDataControllerInfo; + function GetDataController: TcxCustomDataController; + protected + property DataController: TcxCustomDataController read GetDataController; + public + constructor Create(ADataControllerInfo: TcxCustomDataControllerInfo); virtual; + procedure Sort; virtual; abstract; + property DataControllerInfo: TcxCustomDataControllerInfo read FDataControllerInfo; + end; + + TcxDataControllerCompareEvent = procedure(ADataController: TcxCustomDataController; + ARecordIndex1, ARecordIndex2, AItemIndex: Integer; const V1, V2: Variant; + var Compare: Integer) of object; + + TcxDataRecordChangedEvent = procedure(ADataController: TcxCustomDataController; + ARecordIndex, AItemIndex: Integer) of object; + TcxDataControllerNotifyEvent = procedure(ADataController: TcxCustomDataController) of object; + + TcxDataDetailExpandingEvent = procedure(ADataController: TcxCustomDataController; + ARecordIndex: Integer; var AAllow: Boolean) of object; + TcxDataDetailExpandedEvent = procedure(ADataController: TcxCustomDataController; + ARecordIndex: Integer) of object; + TcxDataRecordNotifyEvent = TcxDataDetailExpandedEvent; + + TcxDataControllerOption = (dcoAnsiSort, dcoCaseInsensitive, dcoAssignGroupingValues, + dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoSortByDisplayText, + dcoFocusTopRowAfterSorting, dcoGroupsAlwaysExpanded, dcoImmediatePost, + dcoInsertOnNewItemRowFocusing); + TcxDataControllerOptions = set of TcxDataControllerOption; + + TcxDataControllerEditKind = (dceInsert, dceEdit, dceChanging, dceModified); + TcxDataControllerEditState = set of TcxDataControllerEditKind; + + TcxDataControllerEditOperation = (dceoAppend, dceoDelete, dceoEdit, dceoInsert, + dceoShowEdit); + TcxDataControllerEditOperations = set of TcxDataControllerEditOperation; + + TcxDataListenerLink = class + Ref: TcxCustomDataController; + end; + + TcxDataFilterRecordEvent = procedure(ADataController: TcxCustomDataController; + ARecordIndex: Integer; var Accept: Boolean) of object; + + TcxCustomDataController = class(TPersistent, IUnknown) + private + FActive: Boolean; + FAfterSummaryFlag: Boolean; + FBookmarkRecordIndex: Integer; + FDataChangedFlag: Boolean; + FDataChangedLockCount: Integer; +// FDataChangeInfo: TcxDataChangeInfo; + FChanges: TcxDataControllerChanges; + FCheckFocusingAfterFilterNeeded: Boolean; + FCreatingDataController: TcxCustomDataController; + FCreatingLinkObject: Boolean; + FDataChangedListeners: TList; + FDataChangeRefCount: Integer; + FDataControllerInfo: TcxCustomDataControllerInfo; + FDataStorage: TcxDataStorage; + FDestroying: Boolean; + FGroupingChanged: Boolean; + FLoadedStorage: Boolean; + FGroups: TcxDataControllerGroups; + FFields: TcxCustomDataFieldList; + FFilter: TcxDataFilterCriteria; + FFilterChanged: Boolean; + FFilters: TcxDataFilterList; + FFocusedSelected: Boolean; + FIncrementalFilterField: TcxCustomDataField; + FIncrementalFilterText: string; + FIncrementalSearchField: TcxCustomDataField; + FIncrementalSearching: Boolean; + FIncrementalSearchText: string; + FInCancel: Boolean; + FInLoadStorage: Boolean; + FInNotifyControl: Boolean; + FInOnSortingChanged: Boolean; + FInternalFindRecord: Boolean; + FIsDetailExpanding: Boolean; + FIsPattern: Boolean; + FIsPatternSave: Boolean; + FInSetCustomDataSource: Boolean; + FInSmartLoad: Boolean; + FListenerLinks: TList; + FLockGridModeNotifyCount: Integer; + FLockUpdateFieldsCount: Integer; + FUpdateFieldsFlag: Boolean; + FNewItemRecordIndex: Integer; + FNewItemRowFocused: Boolean; + FMasterRecordIndex: Integer; + FMasterRelation: TcxCustomDataRelation; + FMultiSelect: Boolean; + FNotifier: TcxDataControllerNotifier; + FOptions: TcxDataControllerOptions; + FOwner: TComponent; + FPrevSelectionChangedInfo: TcxDataSelectionChangedInfo; + FProvider: TcxCustomDataProvider; + FRecordHandlesField: TcxCustomDataField; + FRecreatingLinkObject: Boolean; + FRelations: TcxCustomDataRelationList; + FSaveObject: TObject; + FSaveObjectLockCount: Integer; + FSearch: TcxDataControllerSearch; + FSelectionChangedInfo: TcxDataSelectionChangedInfo; + FSortingBySummaryChanged: Boolean; + FSortingBySummaryDataItemField: TcxCustomDataField; + FSortingChanged: Boolean; + FStructureChanged: Boolean; + FStructureRecreated: Boolean; + FSummary: TcxDataSummary; + FUpdateItems: Boolean; + FUseNewItemRowForEditing: Boolean; + FOnAfterCancel: TcxDataControllerNotifyEvent; + FOnAfterDelete: TcxDataControllerNotifyEvent; + FOnAfterInsert: TcxDataControllerNotifyEvent; + FOnAfterPost: TcxDataControllerNotifyEvent; + FOnBeforeCancel: TcxDataControllerNotifyEvent; + FOnBeforeDelete: TcxDataRecordNotifyEvent; + FOnBeforeInsert: TcxDataControllerNotifyEvent; + FOnBeforePost: TcxDataControllerNotifyEvent; + FOnFilterRecord: TcxDataFilterRecordEvent; + FOnNewRecord: TcxDataRecordNotifyEvent; + FOnCompare: TcxDataControllerCompareEvent; + FOnDataChanged: TNotifyEvent; + FOnDetailCollapsing: TcxDataDetailExpandingEvent; + FOnDetailCollapsed: TcxDataDetailExpandedEvent; + FOnDetailExpanding: TcxDataDetailExpandingEvent; + FOnDetailExpanded: TcxDataDetailExpandedEvent; + FOnGroupingChanged: TNotifyEvent; + FOnRecordChanged: TcxDataRecordChangedEvent; + FOnSortingChanged: TNotifyEvent; + FOnUpdateControl: TcxUpdateControlEvent; + function GetCustomDataSource: TcxCustomDataSource; + function GetDetailMode: TcxDataControllerDetailMode; + function GetFilteredIndexByRecordIndex(Index: Integer): Integer; + function GetFilteredRecordCount: Integer; + function GetFilteredRecordIndex(Index: Integer): Integer; + function GetIsEditing: Boolean; + function GetIsPattern: Boolean; + function GetIsRowInfoValid: Boolean; + function GetLockCount: Integer; + function GetNewItemRowFocused: Boolean; + function GetOptions: TcxDataControllerOptions; + function GetRelations: TcxCustomDataRelationList; + function GetSortingBySummaryDataItemIndex: Integer; + procedure SetCustomDataSource(Value: TcxCustomDataSource); + procedure SetIsPattern(Value: Boolean); + procedure SetFilter(Value: TcxDataFilterCriteria); + procedure SetFocusedRowIndex(Value: Integer); + procedure SetMultiSelect(Value: Boolean); + procedure SetNewItemRowFocused(Value: Boolean); + procedure SetOnFilterRecord(Value: TcxDataFilterRecordEvent); + procedure SetOptions(Value: TcxDataControllerOptions); + procedure SetSummary(Value: TcxDataSummary); + procedure SetUseNewItemRowForEditing(Value: Boolean); + procedure SetSortingBySummaryDataItemIndex(Value: Integer); + + procedure Update; + // Notify + procedure BeforeGroupingNotification; + procedure BookmarkNotification; + procedure DataNotification; + procedure DoGroupingChanged; + procedure DoSortingBySummaryChanged; + procedure DoSortingChanged; + procedure FocusedNotification; + procedure LayoutNotification; + procedure UpdateRecordNotification; + procedure SearchNotification; + procedure SelectionNotification; + procedure NotifyControl(AUpdateControlInfo: TcxUpdateControlInfo); + procedure NotifyListenerLinks; + procedure ResetDataChangeInfo; + protected + FDataChangeInfo: TcxDataChangeInfo; + FInDeleteSelection: Boolean; + FInFocusDetails: Boolean; + FNearestRecordIndex: Integer; + // IUnknown + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + // Based + function AddInternalField: TcxCustomDataField; virtual; + function AddField: TcxCustomDataField; virtual; + function AppendInSmartLoad: Integer; virtual; + procedure BeforeSorting; virtual; + function CalcEditingRecordIndex: Integer; virtual; + function CanChangeDetailExpanding(ARecordIndex: Integer; AExpanded: Boolean): Boolean; virtual; + function CanFocusRecord(ARecordIndex: Integer): Boolean; virtual; + function CanSelectRow(ARowIndex: Integer): Boolean; virtual; + procedure CheckChanges; + procedure Change(AChanges: TcxDataControllerChanges); + procedure CheckBookmarkValid(ADeletedRecordIndex: Integer); virtual; + procedure CheckDataSetCurrent; virtual; + procedure CheckEditingRecordIndex(ARecordIndex: Integer); virtual; + procedure CheckInternalRecordRange(ARecordIndex: Integer); + procedure CheckItemRange(AItemIndex: Integer); + function CheckDetailsBrowseMode: Boolean; virtual; + function CheckMasterBrowseMode: Boolean; virtual; + procedure CheckMode; + procedure CheckNearestFocusRow; + procedure CheckRange(ARecordIndex, AItemIndex: Integer); + procedure CheckRecordRange(ARecordIndex: Integer); + procedure CheckSelectedCount(ADeletedRecordIndex: Integer); // TODO: rename CheckRecordsAfterDelete + procedure ClearDataChangedListeners; + procedure ClearDetailsMasterRelation(ARelation: TcxCustomDataRelation); + procedure CopyRecord(AFromRecordIndex, AToRecordIndex: Integer); virtual; + procedure CorrectAfterInsert(ARecordIndex: Integer); virtual; + procedure CorrectAfterDelete(ARecordIndex: Integer); virtual; + procedure CorrectPrevSelectionChangedInfo; + procedure DeleteInSmartLoad(ARecordIndex: Integer); virtual; + procedure Unlocked; virtual; + + procedure DoAfterCancel; virtual; + procedure DoAfterDelete; virtual; + procedure DoAfterInsert; virtual; + procedure DoAfterPost; virtual; + procedure DoBeforeCancel; virtual; + procedure DoBeforeDelete(ARecordIndex: Integer); virtual; + procedure DoBeforeInsert; virtual; + procedure DoBeforePost; virtual; + function DoFilterRecord(ARecordIndex: Integer): Boolean; virtual; + function IsFilterRecord: Boolean; virtual; + procedure DoNewRecord(ARecordIndex: Integer); virtual; + + procedure DoDataChanged; virtual; + procedure DoDetailExpanding(ARecordIndex: Integer; var AAllow: Boolean); virtual; + procedure DoDetailExpanded(ARecordIndex: Integer); virtual; + procedure DoDetailCollapsing(ARecordIndex: Integer; var AAllow: Boolean); virtual; + procedure DoDetailCollapsed(ARecordIndex: Integer); virtual; + function DoIncrementalFilterRecord(ARecordIndex: Integer): Boolean; virtual; + procedure DoReadRecord(ARecordIndex: Integer); virtual; + function DoSearchInGridMode(const ASubText: string; AForward, ANext: Boolean): Boolean; virtual; + function FindItemByInternalID(AID: Integer): TObject; virtual; + function FindItemByName(const AName: string): TObject; virtual; + function FindProperItemLink(AItemLink: TObject): TObject; virtual; + function GetActiveRecordIndex: Integer; virtual; // GridMode + function GetDataProviderClass: TcxCustomDataProviderClass; virtual; + function GetDataSelectionClass: TcxDataSelectionClass; virtual; + function GetEditOperations: TcxDataControllerEditOperations; virtual; + function GetEditState: TcxDataControllerEditState; virtual; + function GetDefaultActiveRelationIndex: Integer; virtual; + function GetFieldClass: TcxCustomDataFieldClass; virtual; + function GetFilterCriteriaClass: TcxDataFilterCriteriaClass; virtual; + function GetInternalDisplayText(ARecordIndex: Integer; AField: TcxCustomDataField): string; virtual; + function GetItemID(AItem: TObject): Integer; virtual; + function GetItemName(AItem: TObject): string; virtual; + function GetInternalRecordId(ARecordIndex: Integer; AFieldList: TList): Variant; virtual; + function GetInternalValue(ARecordIndex: Integer; AField: TcxCustomDataField): Variant; virtual; + procedure GetKeyFields(AList: TList); virtual; + function GetLastRecordIndex: Integer; + function GetRecordIndex: Integer; virtual; + function GetRelationClass: TcxCustomDataRelationClass; virtual; + function GetSearchClass: TcxDataControllerSearchClass; virtual; + function GetStoredDisplayText(ARecordIndex: Integer; AField: TcxCustomDataField): string; + function GetStoredValue(ARecordIndex: Integer; AField: TcxCustomDataField): Variant; + function GetSummaryClass: TcxDataSummaryClass; virtual; + function GetSummaryItemClass: TcxDataSummaryItemClass; virtual; + function GetSummaryGroupItemLinkClass: TcxDataSummaryGroupItemLinkClass; virtual; + function InternalCheckBookmark(ADeletedRecordIndex: Integer): Boolean; virtual; + procedure InternalClearBookmark; virtual; + procedure InternalGotoBookmark; virtual; + function InternalSaveBookmark: Boolean; virtual; + function IsDataBound: Boolean; + function IsDataChangedListenersExist: Boolean; + function IsDataField(AField: TcxCustomDataField): Boolean; virtual; + function IsDestroying: Boolean; virtual; + function IsFocusedSelectedMode: Boolean; virtual; + function IsImmediatePost: Boolean; virtual; + function IsKeyNavigation: Boolean; virtual; + function IsLoading: Boolean; virtual; + function IsProviderDataSource: Boolean; virtual; // Data Aware / Unbound + function IsProviderMode: Boolean; virtual; + function IsRecordID: Boolean; + function IsSmartLoad: Boolean; virtual; + function IsSmartRefresh: Boolean; virtual; + function IsUnboundMode: Boolean; virtual; + procedure LoadStorage; virtual; + function IsNewItemRecordIndex(ARecordIndex: Integer): Boolean; + function LockOnAfterSummary: Boolean; virtual; + procedure NotifyDataChangedListeners; + procedure NotifyDataControllers; virtual; + procedure PrepareField(AField: TcxCustomDataField); virtual; + procedure ProviderValueDefSetProc(AValueDef: TcxValueDef; AFromRecordIndex, AToRecordIndex: Integer; AValueDefReader: TcxValueDefReader); virtual; + procedure RemoveNotification(AComponent: TComponent); virtual; + procedure ResetMasterHasChildrenFlag; + procedure ResetNewItemRowFocused; + procedure RestructData; virtual; + procedure SetStoredValue(ARecordIndex: Integer; AField: TcxCustomDataField; const Value: Variant); + function SyncDetailsFocusWithMaster: Boolean; virtual; + procedure SyncMasterPos; virtual; + procedure UpdateFields; virtual; + procedure UpdateFocused; virtual; + procedure UpdateRelations(ARelation: TcxCustomDataRelation); virtual; + procedure UpdateUseRecordIDState; + procedure UpdateStorage(AUpdateFields: Boolean); + function UseRecordID: Boolean; virtual; + // Notification for Self + class function AddListenerLink(ADataController: TcxCustomDataController): TcxDataListenerLink; + class procedure RemoveListenerLink(ALink: TcxDataListenerLink); + // Notification from DataStorage + procedure DataStorageClearInternalRecords(Sender: TObject); virtual; + // Notification from Fields + procedure RemoveField(ADataField: TcxCustomDataField); virtual; + // Notification from Filter + procedure FilterChanged; virtual; + procedure SummaryChanged(ARedrawOnly: Boolean); virtual; + // Notification from Provider + procedure ActiveChanged(AActive: Boolean); virtual; + procedure DataChanged(ADataChange: TcxDataChange; AItemIndex, ARecordIndex: Integer); virtual; + procedure DataScrolled(ADistance: Integer); virtual; + procedure LayoutChanged(ADataLayoutChanges: TcxDataLayoutChanges); virtual; + // Notification for Grid + procedure DoBeforeFocusedRowChange(ARowIndex: Integer); virtual; + procedure DoValueTypeClassChanged(AItemIndex: Integer); virtual; + procedure UpdateControl(AInfo: TcxUpdateControlInfo); virtual; + // methods for Grid +// function GetDisplayText(ARecordIndex, AItemIndex: Integer): string; virtual; + function GetIncrementalSearchText(ARecordIndex, AItemIndex: Integer): string; virtual; + function GetFilterDisplayText(ARecordIndex, AItemIndex: Integer): string; virtual; + // Compare + function CompareByField(ARecordIndex1, ARecordIndex2: Integer; + AField: TcxCustomDataField; AMode: TcxDataControllerComparisonMode): Integer; virtual; + function CompareEqualRecords(ARecordIndex1, ARecordIndex2: Integer): Integer; virtual; + function CompareRecords(ARecordIndex1, ARecordIndex2: Integer; + ASortInfo: TcxDataSortInfo; AMode: TcxDataControllerComparisonMode = dccmOther): Integer; virtual; + function FindGroupRecord(ABufferRecordIndex: Integer; AGroupItemCount: Integer): Integer; + function FindRecordByFields(ABufferRecordIndex: Integer; AFields: TList): Integer; + function GetComparedValue(ARecordIndex: Integer; AField: TcxCustomDataField): Variant; virtual; + function IsConversionNeededForCompare(AField: TcxCustomDataField): Boolean; virtual; + function IsFilterItemSortByDisplayText(AItemIndex: Integer): Boolean; virtual; + function IsStringConversionNeeded(AField: TcxCustomDataField): Boolean; virtual; + function IsSortByDisplayTextNeeded(AField: TcxCustomDataField): Boolean; virtual; + function NativeCompare(ARecordIndex1, ARecordIndex2: Integer; AField: TcxCustomDataField): Integer; + // Internal Data + procedure DeleteFocusedRecord; + procedure DeleteRecords(AList: TList); + // Smart Load + procedure BeginSmartLoad; virtual; + procedure EndSmartLoad; virtual; + function LoadRecord(AData: Pointer): Integer; virtual; + // Locate + procedure BeginReadRecord; virtual; + procedure EndReadRecord; virtual; + // Sorting By Summary + function GetSortingBySummaryEngineClass: TcxSortingBySummaryEngineClass; virtual; + + property DataStorage: TcxDataStorage read FDataStorage; + property Fields: TcxCustomDataFieldList read FFields; + property Notifier: TcxDataControllerNotifier read FNotifier; + property Provider: TcxCustomDataProvider read FProvider; + property LockUpdateFieldsCount: Integer read FLockUpdateFieldsCount; + public + constructor Create(AOwner: TComponent); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure BeforeDestruction; override; + procedure Destroying; // for CLR + function GetOwner: TPersistent; override; + procedure BeginUpdate; + procedure EndUpdate; + procedure BeginFullUpdate; virtual; + procedure EndFullUpdate; virtual; + procedure BeginUpdateFields; + procedure EndUpdateFields; + procedure SaveKeys; + procedure RestoreKeys; + // internal for Grid + function CreateFilter: TcxDataFilterCriteria; virtual; + // Notification from Grid + function AddItem(AItem: TObject): TcxCustomDataField; virtual; + function ItemPropertiesChanged(AItemIndex: Integer): Boolean; virtual; + procedure Loaded; virtual; + procedure RemoveItem(AItem: TObject); virtual; + procedure UpdateItemIndexes; virtual; + procedure UpdateItems(AUpdateFields: Boolean); + function ExecuteAction(Action: TBasicAction): Boolean; virtual; + function UpdateAction(Action: TBasicAction): Boolean; virtual; + // Data Changed notify + procedure AddDataChangedListener(AInstance: TObject; ADataChangedEvent: TNotifyEvent); + procedure RemoveDataChangedListener(AInstance: TObject; ADataChangedEvent: TNotifyEvent); + procedure AddDataChangeRefCount; + procedure RemoveDataChangeRefCount; + function DataChangedNotifyLocked: Boolean; virtual; + function IsDataLoading: Boolean; + procedure LockDataChangedNotify; + procedure UnlockDataChangedNotify; + procedure LockGridModeNotify; + procedure UnlockGridModeNotify; + // Structure + procedure ChangeNeedConversion(AItemIndex: Integer; ANeedConversion: Boolean); virtual; + procedure ChangeTextStored(AItemIndex: Integer; ATextStored: Boolean); virtual; + procedure ChangeValueTypeClass(AItemIndex: Integer; AValueTypeClass: TcxValueTypeClass); virtual; + function GetItem(Index: Integer): TObject; virtual; abstract; + function GetItemCount: Integer; virtual; + function GetItemNeedConversion(AItemIndex: Integer): Boolean; virtual; + function GetItemTextStored(AItemIndex: Integer): Boolean; virtual; + function GetItemValueTypeClass(AItemIndex: Integer): TcxValueTypeClass; + function IsDisplayFormatDefined(AItemIndex: Integer; AIgnoreSimpleCurrency: Boolean): Boolean; virtual; + // Data + function AppendRecord: Integer; + procedure DeleteRecord(ARecordIndex: Integer); + function GetGroupValue(ARecordIndex: Integer; AField: TcxCustomDataField): Variant; virtual; + procedure GetGroupValues(ARecordIndex: Integer; var AValues: TcxDataSummaryValues); virtual; + function GetDisplayText(ARecordIndex, AItemIndex: Integer): string; virtual; + function GetRecordCount: Integer; virtual; + function GetRecordId(ARecordIndex: Integer): Variant; virtual; + function GetValue(ARecordIndex, AItemIndex: Integer): Variant; virtual; + function InsertRecord(ARecordIndex: Integer): Integer; + procedure Refresh; virtual; + procedure SetDisplayText(ARecordIndex, AItemIndex: Integer; const Value: string); virtual; + procedure SetRecordCount(Value: Integer); virtual; + procedure SetValue(ARecordIndex, AItemIndex: Integer; const Value: Variant); virtual; + procedure SortByDisplayTextChanged; + // Data Editing + procedure Append; virtual; + procedure Cancel; virtual; + function CanInitEditing(AItemIndex: Integer): Boolean; virtual; + procedure CheckBrowseMode; virtual; + procedure DeleteFocused; virtual; + procedure DeleteSelection; virtual; + procedure Edit; virtual; + procedure FocusControl(AItemIndex: Integer; var Done: Boolean); virtual; + function GetEditValue(AItemIndex: Integer; AEditValueSource: TcxDataEditValueSource): Variant; virtual; + function GetItemValueSource(AItemIndex: Integer): TcxDataEditValueSource; virtual; + procedure Insert; virtual; + procedure Post; virtual; + procedure PostEditingData; virtual; + procedure RefreshExternalData; virtual; + function SetEditValue(AItemIndex: Integer; const AValue: Variant; AEditValueSource: TcxDataEditValueSource): Boolean; virtual; + procedure UpdateData; virtual; + // Data New Item Row + function GetEditingRecordIndex: Integer; virtual; + function GetNewItemRecordIndex: Integer; virtual; + // Data Save/Load + procedure LoadFromStream(AStream: TStream); + procedure SaveToStream(AStream: TStream); + // Master-Detail: Relations + function GetMasterDataController: TcxCustomDataController; virtual; + function GetMasterRecordIndex: Integer; virtual; + function GetMasterRelation: TcxCustomDataRelation; virtual; + function GetPatternDataController: TcxCustomDataController; + function GetRootDataController: TcxCustomDataController; + function IsDetailMode: Boolean; virtual; + // Master-Detail: Grid override + function CreateDetailLinkObject(ARelation: TcxCustomDataRelation; ARecordIndex: Integer): TObject; virtual; + procedure FocusDetails(ARecordIndex: Integer); + function GetDetailDataControllerByLinkObject(ALinkObject: TObject): TcxCustomDataController; virtual; + // Master-Detail: Grid Notifications + procedure ResetRelationByItem(AItem: TObject); virtual; + procedure SetMasterMode(AMasterRelation: TcxCustomDataRelation; AIsPattern: Boolean); + procedure SetMasterRelation(AMasterRelation: TcxCustomDataRelation; AMasterRecordIndex: Integer); virtual; + // Master-Detail: View Data + procedure ChangeDetailActiveRelationIndex(ARecordIndex: Integer; ARelationIndex: Integer); + function ChangeDetailExpanding(ARecordIndex: Integer; AExpanded: Boolean): Boolean; + procedure ClearDetailLinkObject(ARecordIndex: Integer; ARelationIndex: Integer); + procedure ClearDetails; + procedure CollapseDetails; + procedure ForEachDetail(AMasterRelation: TcxCustomDataRelation; AProc: TcxDataControllerEachDetailProc); + function GetDetailActiveRelationIndex(ARecordIndex: Integer): Integer; + function GetDetailDataController(ARecordIndex: Integer; ARelationIndex: Integer): TcxCustomDataController; + function GetDetailExpanding(ARecordIndex: Integer): Boolean; + function GetDetailHasChildren(ARecordIndex, ARelationIndex: Integer): Boolean; + function GetDetailLinkObject(ARecordIndex: Integer; ARelationIndex: Integer): TObject; + function IsDetailDataControllerExist(ARecordIndex: Integer; ARelationIndex: Integer): Boolean; + procedure ResetHasChildrenFlag; + // View Data + procedure ForEachRow(ASelectedRows: Boolean; AProc: TcxDataControllerEachRowProc); virtual; + function GetNearestRowIndex(ARowIndex: Integer): Integer; + function GetRowCount: Integer; + function GetRowIndexByRecordIndex(ARecordIndex: Integer; AMakeVisible: Boolean): Integer; + function GetRowInfo(ARowIndex: Integer): TcxRowInfo; + function GetRowDisplayText(const ARowInfo: TcxRowInfo; var AItemIndex: Integer): string; + function GetRowValue(const ARowInfo: TcxRowInfo; AItemIndex: Integer): Variant; + procedure MakeRecordVisible(ARecordIndex: Integer); + // Export in GridMode + function FocusSelectedRow(ASelectedIndex: Integer): Boolean; virtual; + procedure RestoreDataSetPos; virtual; + procedure SaveDataSetPos; virtual; + // Navigation + procedure ChangeFocusedRecordIndex(ARecordIndex: Integer); + function ChangeFocusedRowIndex(ARowIndex: Integer): Boolean; + procedure CheckFocusedRow; + function GetFocusedRecordIndex: Integer; + function GetFocusedRowIndex: Integer; + procedure GotoFirst; + procedure GotoLast; + procedure GotoNext; + procedure GotoPrev; + function IsBOF: Boolean; + function IsEOF: Boolean; + function IsGridMode: Boolean; + procedure MoveBy(ADistance: Integer); + procedure Scroll(ADistance: Integer); + procedure SetFocus; virtual; + // Bookmark + procedure ClearBookmark; + procedure GotoBookmark; + function IsBookmarkAvailable: Boolean; virtual; + function IsBookmarkRow(ARowIndex: Integer): Boolean; virtual; + procedure SaveBookmark; + // Filtering + function GetFilterDataValue(ARecordIndex: Integer; AField: TcxCustomDataField): Variant; virtual; + function GetFilterItemFieldCaption(AItem: TObject): string; virtual; + function GetFilterItemFieldName(AItem: TObject): string; virtual; + // Search + function ChangeIncrementalFilterText(const AText: string): Boolean; + function FindRecordIndexByText(AStartRecordIndex, AItemIndex: Integer; + const AText: string; APartialCompare, ACircular, AForward: Boolean): Integer; virtual; + function GetIncrementalFilterText: string; virtual; + function IsIncrementalFilter: Boolean; virtual; + procedure ResetIncrementalFilter; virtual; + function SetIncrementalFilter(AItemIndex: Integer; const AText: string): Integer; virtual; + // Sorting + procedure ChangeItemSortingIndex(AItemIndex: Integer; ASortingIndex: Integer); + procedure ChangeSorting(AItemIndex: Integer; ASortOrder: TcxDataSortOrder); + procedure ClearSorting(AKeepGroupedItems: Boolean); + function GetItemSortByDisplayText(AItemIndex: Integer; ASortByDisplayText: Boolean): Boolean; virtual; + function GetItemSortOrder(AItemIndex: Integer): TcxDataSortOrder; + function GetItemSortingIndex(AItemIndex: Integer): Integer; + function GetSortingItemCount: Integer; + function GetSortingItemIndex(Index: Integer): Integer; + // MultiSelect + procedure ChangeRowSelection(ARowIndex: Integer; ASelection: Boolean); virtual; + procedure CheckFocusedSelected; + procedure ClearSelection; + procedure ClearSelectionAnchor; virtual; + function GetRowId(ARowIndex: Integer): Variant; virtual; + function GetSelectedCount: Integer; + function GetSelectedRowIndex(Index: Integer): Integer; virtual; // Visible Order + function GetSelectionAnchorRowIndex: Integer; virtual; + function IsRowSelected(ARowIndex: Integer): Boolean; + function IsSelectionAnchorExist: Boolean; virtual; + procedure SelectAll; virtual; + procedure SelectFromAnchor(ARowIndex: Integer; AKeepSelection: Boolean); virtual; + procedure SelectRows(AStartRowIndex, AEndRowIndex: Integer); + procedure SetSelectionAnchor(ARowIndex: Integer); virtual; + procedure SyncSelected(ASelected: Boolean); // not MultiSelect only + procedure SyncSelectionFocusedRecord; virtual; + + property Active: Boolean read FActive; + property CustomDataSource: TcxCustomDataSource read GetCustomDataSource write SetCustomDataSource; + property DataControllerInfo: TcxCustomDataControllerInfo read FDataControllerInfo; + property DetailMode: TcxDataControllerDetailMode read GetDetailMode; + property DisplayTexts[RecordIndex, ItemIndex: Integer]: string read GetDisplayText write SetDisplayText; + property Groups: TcxDataControllerGroups read FGroups; + property EditingRecordIndex: Integer read GetEditingRecordIndex; + property EditOperations: TcxDataControllerEditOperations read GetEditOperations; + property EditState: TcxDataControllerEditState read GetEditState; + property Filter: TcxDataFilterCriteria read FFilter write SetFilter; + property FilteredIndexByRecordIndex[Index: Integer]: Integer read GetFilteredIndexByRecordIndex; + property FilteredRecordCount: Integer read GetFilteredRecordCount; + property FilteredRecordIndex[Index: Integer]: Integer read GetFilteredRecordIndex; + property FocusedRecordIndex: Integer read GetFocusedRecordIndex write ChangeFocusedRecordIndex; + property FocusedRowIndex: Integer read GetFocusedRowIndex write SetFocusedRowIndex; + property IsCreatingLinkObject: Boolean read FCreatingLinkObject; + property IsDetailExpanding: Boolean read FIsDetailExpanding; + property IsEditing: Boolean read GetIsEditing; + property IsPattern: Boolean read GetIsPattern write SetIsPattern; + property IsRowInfoValid: Boolean read GetIsRowInfoValid; + property IsUpdatingItems: Boolean read FUpdateItems; + property ItemCount: Integer read GetItemCount; + property LockCount: Integer read GetLockCount; + property LockGridModeNotifyCount: Integer read FLockGridModeNotifyCount; + property MultiSelect: Boolean read FMultiSelect write SetMultiSelect; + property NewItemRecordIndex: Integer read GetNewItemRecordIndex; + property NewItemRowFocused: Boolean read GetNewItemRowFocused write SetNewItemRowFocused; + property Options: TcxDataControllerOptions read GetOptions write SetOptions default [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding]; + property RecordCount: Integer read GetRecordCount write SetRecordCount; + property Relations: TcxCustomDataRelationList read GetRelations; + property RowCount: Integer read GetRowCount; + property Search: TcxDataControllerSearch read FSearch; + property Summary: TcxDataSummary read FSummary write SetSummary; + property UseNewItemRowForEditing: Boolean read FUseNewItemRowForEditing write SetUseNewItemRowForEditing; + property Values[RecordIndex, ItemIndex: Integer]: Variant read GetValue write SetValue; + // Sorting By Summary + property SortingBySummaryDataItemIndex: Integer read GetSortingBySummaryDataItemIndex write SetSortingBySummaryDataItemIndex; + + property OnAfterCancel: TcxDataControllerNotifyEvent read FOnAfterCancel write FOnAfterCancel; + property OnAfterDelete: TcxDataControllerNotifyEvent read FOnAfterDelete write FOnAfterDelete; + property OnAfterInsert: TcxDataControllerNotifyEvent read FOnAfterInsert write FOnAfterInsert; + property OnAfterPost: TcxDataControllerNotifyEvent read FOnAfterPost write FOnAfterPost; + property OnBeforeCancel: TcxDataControllerNotifyEvent read FOnBeforeCancel write FOnBeforeCancel; + property OnBeforeDelete: TcxDataRecordNotifyEvent read FOnBeforeDelete write FOnBeforeDelete; + property OnBeforeInsert: TcxDataControllerNotifyEvent read FOnBeforeInsert write FOnBeforeInsert; + property OnBeforePost: TcxDataControllerNotifyEvent read FOnBeforePost write FOnBeforePost; + property OnFilterRecord: TcxDataFilterRecordEvent read FOnFilterRecord write SetOnFilterRecord; + property OnNewRecord: TcxDataRecordNotifyEvent read FOnNewRecord write FOnNewRecord; + + property OnCompare: TcxDataControllerCompareEvent read FOnCompare write FOnCompare; + property OnDataChanged: TNotifyEvent read FOnDataChanged write FOnDataChanged; + property OnDetailCollapsing: TcxDataDetailExpandingEvent read FOnDetailCollapsing write FOnDetailCollapsing; + property OnDetailCollapsed: TcxDataDetailExpandedEvent read FOnDetailCollapsed write FOnDetailCollapsed; + property OnDetailExpanding: TcxDataDetailExpandingEvent read FOnDetailExpanding write FOnDetailExpanding; + property OnDetailExpanded: TcxDataDetailExpandedEvent read FOnDetailExpanded write FOnDetailExpanded; + property OnGroupingChanged: TNotifyEvent read FOnGroupingChanged write FOnGroupingChanged; + property OnRecordChanged: TcxDataRecordChangedEvent read FOnRecordChanged write FOnRecordChanged; + property OnSortingChanged: TNotifyEvent read FOnSortingChanged write FOnSortingChanged; + property OnUpdateControl: TcxUpdateControlEvent read FOnUpdateControl write FOnUpdateControl; + end; + + TcxCustomDataControllerClass = class of TcxCustomDataController; + + TCompareItems = function (AItem1, AItem2: Pointer): Integer of object; + +procedure QuickSortList(ASortList: PPointerList; + L, R: Integer; ACompareFunc: TCompareItems); + +procedure InvalidOperation(const S: string); + +const + cxDataFilterVersion: Byte = 3; + +implementation + +uses +{$IFDEF DELPHI9} + Windows, +{$ENDIF} + cxDataConsts, cxFilterConsts; + +const + stDataControllerSignature = 'DataController1'; + stBeginText = '('; + stEndText = ')'; + stSeparator = ','; + NullRecordHandle: TcxDataRecordHandle = TcxDataRecordHandle(-1); + + {$IFNDEF DELPHI6} + // HRESULT value definitions from windows.pas + // Success codes + S_OK = $00000000; + S_FALSE = $00000001; + // No such interface supported + E_NOINTERFACE = HRESULT($80004002); + {$ENDIF} + +type + TNotifyEventItem = class + Instance: TObject; + Event: TNotifyEvent; + end; + + { Keys Storage } + + TcxSaveObject = class; + + TcxKeyInfo = class + Key: Variant; + end; + + TcxSelectedKeyInfo = class(TcxKeyInfo) + SelectedIndex: Integer; + end; + + TcxDetailKeyInfo = class(TcxKeyInfo) + ActiveRelationIndex: Integer; + SubDetail: TcxSaveObject; + end; + + TcxKeys = class + private + FDataController: TcxCustomDataController; + FKeyFields: TList; + FKeys: TList; + procedure SetDataController(Value: TcxCustomDataController); + protected + procedure DoRestore; virtual; + procedure DoSave; virtual; + function Find(ARecordIndex: Integer; var AIndex: Integer): Boolean; + procedure FreeKeyInfo(AKeyInfo: TObject); virtual; + property DataController: TcxCustomDataController read FDataController write SetDataController; + property Keys: TList read FKeys; + public + constructor Create; + destructor Destroy; override; + procedure Clear; virtual; + procedure Delete(AIndex: Integer); + procedure Restore(ADataController: TcxCustomDataController); + procedure Save(ADataController: TcxCustomDataController); + end; + + TcxDetailKeys = class(TcxKeys) + protected + procedure DoRestore; override; + procedure DoSave; override; + procedure FreeKeyInfo(AKeyInfo: TObject); override; + end; + + TcxSelectedKeys = class(TcxKeys) + protected + procedure DoRestore; override; + procedure DoSave; override; + procedure FreeKeyInfo(AKeyInfo: TObject); override; + end; + + TcxSaveObject = class + private + FDetailKeys: TcxDetailKeys; + FSelectedKeys: TcxSelectedKeys; + public + constructor Create; + destructor Destroy; override; + procedure Restore(ADataController: TcxCustomDataController); + procedure Save(ADataController: TcxCustomDataController); + end; + +function CompareByLinkObject(AItem1, AItem2: Pointer): Integer; +begin + Result := TcxCustomDataField(TcxValueDef(AItem1).LinkObject).Index - + TcxCustomDataField(TcxValueDef(AItem2).LinkObject).Index; +end; + +procedure InvalidOperation(const S: string); +begin + raise EcxInvalidDataControllerOperation.Create(S); +end; + +function CompareSelectionList(AItem1, AItem2: Pointer): Integer; +begin + Result := PcxDataSelectionInfo(AItem1).RowIndex - PcxDataSelectionInfo(AItem2).RowIndex; +end; + +function CompareIntegers(AItem1, AItem2: Pointer): Integer; +begin + Result := Integer(AItem1) - Integer(AItem2); +end; + +function CompareByKey(AItem1, AItem2: Pointer): Integer; +begin + Result := VarCompare(TcxKeyInfo(AItem1).Key, TcxKeyInfo(AItem2).Key); +end; + +procedure QuickSortList(ASortList: PPointerList; + L, R: Integer; ACompareFunc: TCompareItems); +var + I, J: Integer; + P, T: Pointer; +begin + repeat + I := L; + J := R; + P := ASortList[(L + R) shr 1]; + repeat + while ACompareFunc(ASortList[I], P) < 0 do + Inc(I); + while ACompareFunc(ASortList[J], P) > 0 do + Dec(J); + if I <= J then + begin + T := ASortList[I]; + ASortList[I] := ASortList[J]; + ASortList[J] := T; + Inc(I); + Dec(J); + end; + until I > J; + if L < J then + QuickSortList(ASortList, L, J, ACompareFunc); + L := I; + until I >= R; +end; + +function IsValueDefInternal(AValueDef: TcxValueDef): Boolean; +begin + Result := (AValueDef.LinkObject is TcxCustomDataField) and + TcxCustomDataField(AValueDef.LinkObject).IsValueDefInternal; +end; + +procedure ListSetCount(AList: TList; ANewCount: Integer); +begin + AList.Count := ANewCount; +end; + +{ TcxKeys } + +constructor TcxKeys.Create; +begin + inherited Create; + FKeyFields := TList.Create; + FKeys := TList.Create; +end; + +destructor TcxKeys.Destroy; +begin + Clear; + FKeyFields.Free; + FKeys.Free; + inherited Destroy; +end; + +procedure TcxKeys.Clear; +var + I: Integer; +begin + for I := 0 to Keys.Count - 1 do + FreeKeyInfo(Keys[I]); + Keys.Clear; +end; + +procedure TcxKeys.Delete(AIndex: Integer); +begin + FreeKeyInfo(Keys[AIndex]); + Keys.Delete(AIndex); +end; + +procedure TcxKeys.Restore(ADataController: TcxCustomDataController); +begin + DataController := ADataController; + if Keys.Count > 0 then // !!! TODO + begin + DoRestore; + Clear; + end; +end; + +procedure TcxKeys.Save(ADataController: TcxCustomDataController); +begin + Clear; + DataController := ADataController; + DoSave; + Keys.Sort(CompareByKey); +end; + +procedure TcxKeys.DoRestore; +begin +end; + +procedure TcxKeys.DoSave; +begin +end; + +function TcxKeys.Find(ARecordIndex: Integer; var AIndex: Integer): Boolean; +var + I: Integer; + AKeyInfo: TcxKeyInfo; +begin + Result := False; + for I := 0 to Keys.Count - 1 do + begin + AKeyInfo := TcxKeyInfo(Keys[I]); + if VarEquals(DataController.GetInternalRecordId(ARecordIndex, FKeyFields), AKeyInfo.Key) then + begin + AIndex := I; + Result := True; + Break; + end; + end; +end; + +procedure TcxKeys.FreeKeyInfo(AKeyInfo: TObject); +begin + AKeyInfo.Free; +end; + +procedure TcxKeys.SetDataController(Value: TcxCustomDataController); +begin + FDataController := Value; + FKeyFields.Clear; + DataController.GetKeyFields(FKeyFields); +end; + +{ TcxDetailKeys } + +procedure TcxDetailKeys.DoRestore; +var + I, J: Integer; + ADetailKeyInfo: TcxDetailKeyInfo; + ADetailLinkObject: TObject; + ADataController: TcxCustomDataController; +begin + for I := 0 to DataController.RecordCount - 1 do + begin + if Find(I, J) then + begin + ADetailKeyInfo := TcxDetailKeyInfo(Keys[J]); + DataController.ChangeDetailExpanding(I, True); + DataController.ChangeDetailActiveRelationIndex(I, ADetailKeyInfo.ActiveRelationIndex); + if ADetailKeyInfo.SubDetail <> nil then + begin + if DataController.GetDetailExpanding(I) and + (DataController.GetDetailActiveRelationIndex(I) = ADetailKeyInfo.ActiveRelationIndex) then + begin + // WARNING: GetDetailDataController->nil ! + ADetailLinkObject := DataController.GetDetailLinkObject(I, ADetailKeyInfo.ActiveRelationIndex); + if ADetailLinkObject <> nil then + begin + ADataController := DataController.GetDetailDataControllerByLinkObject(ADetailLinkObject); + if ADataController.InheritsFrom(DataController.ClassType) then //if ADataController is TcxDBDataController then + ADetailKeyInfo.SubDetail.Restore(ADataController); + end; + end; + end; + end; + end; +end; + +procedure TcxDetailKeys.DoSave; +var + I: Integer; + ADetailKeyInfo: TcxDetailKeyInfo; + ADetailLinkObject: TObject; + ADataController: TcxCustomDataController; +begin + for I := 0 to DataController.RecordCount - 1 do + begin + if DataController.GetDetailExpanding(I) then + begin + ADetailKeyInfo := TcxDetailKeyInfo.Create; + Keys.Add(ADetailKeyInfo); + ADetailKeyInfo.Key := DataController.GetInternalRecordId(I, FKeyFields); + ADetailKeyInfo.ActiveRelationIndex := DataController.GetDetailActiveRelationIndex(I); + ADetailKeyInfo.SubDetail := TcxSaveObject.Create; + // WARNING: GetDetailDataController->nil ! + ADetailLinkObject := DataController.GetDetailLinkObject(I, ADetailKeyInfo.ActiveRelationIndex); + if ADetailLinkObject <> nil then + begin + ADataController := DataController.GetDetailDataControllerByLinkObject(ADetailLinkObject); + if ADataController.InheritsFrom(DataController.ClassType) then //if ADataController is TcxDBDataController then + ADetailKeyInfo.SubDetail.Save(ADataController); + end; + end; + end; +end; + +procedure TcxDetailKeys.FreeKeyInfo(AKeyInfo: TObject); +begin + if TcxDetailKeyInfo(AKeyInfo).SubDetail <> nil then + TcxDetailKeyInfo(AKeyInfo).SubDetail.Free; + AKeyInfo.Free; +end; + +{ TcxSelectedKeys } + +procedure TcxSelectedKeys.DoRestore; +var + I, J: Integer; + ASelection: TcxDataSelection; + ASelectedKeyInfo: TcxSelectedKeyInfo; +begin + ASelection := DataController.DataControllerInfo.Selection; + if ASelection.Count = 0 then Exit; + // TODO: Level check <> -1 + for I := 0 to DataController.RecordCount - 1 do + begin + if Find(I, J) then + begin + ASelectedKeyInfo := TcxSelectedKeyInfo(Keys[J]); + if ASelectedKeyInfo.SelectedIndex < ASelection.Count then + ASelection[ASelectedKeyInfo.SelectedIndex].RecordIndex := I; + Delete(J); + end; + end; + + for I := 0 to Keys.Count - 1 do + begin + ASelectedKeyInfo := TcxSelectedKeyInfo(Keys[I]); + if (0 <= ASelectedKeyInfo.SelectedIndex) and (ASelectedKeyInfo.SelectedIndex < ASelection.Count) then + ASelection[ASelectedKeyInfo.SelectedIndex].RecordIndex := -1; + end; + + for I := ASelection.Count - 1 downto 0 do + if ASelection[I].RecordIndex = -1 then + ASelection.Delete(I); + + DataController.DataControllerInfo.ExpandingChanged; +end; + +procedure TcxSelectedKeys.DoSave; +var + ASelection: TcxDataSelection; + I: Integer; + PSelectionInfo: PcxDataSelectionInfo; + ASelectedKeyInfo: TcxSelectedKeyInfo; +begin + ASelection := DataController.DataControllerInfo.Selection; + for I := 0 to ASelection.Count - 1 do + begin + PSelectionInfo := ASelection[I]; + if (PSelectionInfo.Level <> -1) and + (PSelectionInfo.RecordIndex < DataController.RecordCount) then + begin + ASelectedKeyInfo := TcxSelectedKeyInfo.Create; + Keys.Add(ASelectedKeyInfo); + ASelectedKeyInfo.SelectedIndex := I; + ASelectedKeyInfo.Key := DataController.GetInternalRecordId(PSelectionInfo.RecordIndex, FKeyFields); + end; + end; + DataController.DataControllerInfo.SaveExpanding([eisExpanded, eisSelected]); +end; + +procedure TcxSelectedKeys.FreeKeyInfo(AKeyInfo: TObject); +begin + AKeyInfo.Free; +end; + +{ TcxSaveObject } + +constructor TcxSaveObject.Create; +begin + inherited Create; + FDetailKeys := TcxDetailKeys.Create; + FSelectedKeys := TcxSelectedKeys.Create; +end; + +destructor TcxSaveObject.Destroy; +begin + FSelectedKeys.Free; + FDetailKeys.Free; + inherited Destroy; +end; + +procedure TcxSaveObject.Restore(ADataController: TcxCustomDataController); +begin + if ADataController.IsCreatingLinkObject then Exit; + if ADataController.IsKeyNavigation then + begin + FDetailKeys.Restore(ADataController); + FSelectedKeys.Restore(ADataController); + end + else + ADataController.CheckSelectedCount(-1); +end; + +procedure TcxSaveObject.Save(ADataController: TcxCustomDataController); +begin + if ADataController.IsCreatingLinkObject or + ADataController.IsDestroying then Exit; + if ADataController.IsKeyNavigation then + begin + FDetailKeys.Save(ADataController); + FSelectedKeys.Save(ADataController); + end; +end; + +{ TcxCustomDataSource } + +destructor TcxCustomDataSource.Destroy; +begin + RemoveFromProviders; + FProviders.Free; + FProviders := nil; +// if Assigned(FProvider) then +// FProvider.CustomDataSource := nil; + inherited Destroy; +end; + +procedure TcxCustomDataSource.DataChanged; +begin + if Provider = nil then Exit; + Provider.DataController.BeginFullUpdate; + try + Provider.DataChanged(dcTotal, -1, -1); + finally + Provider.DataController.EndFullUpdate; + end; +end; + +function TcxCustomDataSource.GetRecordHandleByIndex(ARecordIndex: Integer): TcxDataRecordHandle; +begin + Result := TcxDataRecordHandle(Integer(DataController.GetInternalValue(ARecordIndex, DataController.FRecordHandlesField))); +end; + +function TcxCustomDataSource.GetRecordIndexByHandle(ARecordHandle: TcxDataRecordHandle): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to DataController.RecordCount - 1 do + if GetRecordHandleByIndex(I) = ARecordHandle then + begin + Result := I; + Break; + end; +end; + +procedure TcxCustomDataSource.CustomSort; +begin +end; + +function TcxCustomDataSource.AppendRecord: TcxDataRecordHandle; +begin + Result := NullRecordHandle; + // IMPL: Add + Data Notify +end; + +procedure TcxCustomDataSource.DeleteRecord(ARecordHandle: TcxDataRecordHandle); +begin + // IMPL: Delete + Data Notify +end; + +function TcxCustomDataSource.GetDefaultItemID(AItemIndex: Integer): Integer; +begin + Result := DataController.GetItemID(DataController.GetItem(AItemIndex)); +end; + +function TcxCustomDataSource.GetDetailHasChildren(ARecordIndex, ARelationIndex: Integer): Boolean; +begin + Result := False; +end; + +function TcxCustomDataSource.GetDisplayText(ARecordHandle: TcxDataRecordHandle; AItemHandle: TcxDataItemHandle): string; +begin + try + Result := VarToStr(GetValue(ARecordHandle, AItemHandle)); + except + on EVariantError do + Result := ''; + end; +end; + +function TcxCustomDataSource.GetInfoForCompare(ARecordHandle: TcxDataRecordHandle; + AItemHandle: TcxDataItemHandle; var PValueBuffer: PChar): Boolean; +begin + InvalidOperation(cxSDataCustomDataSourceInvalidCompare); + Result := False; // i.e. IS NULL +end; + +function TcxCustomDataSource.GetItemHandle(AItemIndex: Integer): TcxDataItemHandle; +begin + Result := TcxDataItemHandle(AItemIndex); +end; + +function TcxCustomDataSource.GetRecordCount: Integer; +begin + Result := 0; +end; + +function TcxCustomDataSource.GetRecordId(ARecordHandle: TcxDataRecordHandle): Variant; +begin + Result := Null; +end; + +function TcxCustomDataSource.GetRecordHandle(ARecordIndex: Integer): TcxDataRecordHandle; +begin + Result := TcxDataRecordHandle(ARecordIndex); +end; + +function TcxCustomDataSource.GetValue(ARecordHandle: TcxDataRecordHandle; AItemHandle: TcxDataItemHandle): Variant; +begin + Result := Null; +end; + +function TcxCustomDataSource.InsertRecord(ARecordHandle: TcxDataRecordHandle): TcxDataRecordHandle; +begin + // IMPL: Insert + Data Notify + Result := AppendRecord; +end; + +function TcxCustomDataSource.IsCustomSorting: Boolean; +begin + Result := False; +end; + +function TcxCustomDataSource.IsNativeCompare: Boolean; +begin + Result := False; +end; + +function TcxCustomDataSource.IsNativeCompareFunc: Boolean; +begin + Result := False; +end; + +function TcxCustomDataSource.IsRecordIdSupported: Boolean; +begin + Result := False; +end; + +procedure TcxCustomDataSource.LoadRecordHandles; +var + I: Integer; +begin + DataController.DataStorage.Clear(Provider.FDataChangedLocked); + DataController.DataStorage.RecordCount := GetRecordCount; + for I := 0 to DataController.{DataStorage.}RecordCount - 1 do + DataController.SetStoredValue(I, DataController.FRecordHandlesField, Integer(GetRecordHandle(I))); +end; + +function TcxCustomDataSource.NativeCompareFunc(ARecordHandle1, ARecordHandle2: TcxDataRecordHandle; + AItemHandle: TcxDataItemHandle): Integer; +begin + Result := 0; +end; + +procedure TcxCustomDataSource.SetRecordCount(ARecordCount: Integer); +begin + // IMPL: change record count + Data Notify +end; + +procedure TcxCustomDataSource.SetValue(ARecordHandle: TcxDataRecordHandle; + AItemHandle: TcxDataItemHandle; const AValue: Variant); +begin + // IMPL: change Value + Data Notify +end; + +function TcxCustomDataSource.AddRecordHandle(ARecordHandle: TcxDataRecordHandle): Integer; +begin + Result := DataController.DataStorage.AppendRecord; + DataController.SetStoredValue(Result, DataController.FRecordHandlesField, Integer(ARecordHandle)); +end; + +function TcxCustomDataSource.GetDataController: TcxCustomDataController; +begin + Result := Provider.DataController; +end; + +function TcxCustomDataSource.GetProvider: TcxCustomDataProvider; +begin + if FCurrentProvider <> nil then + Result := FCurrentProvider + else + Result := FProvider; +end; + +procedure TcxCustomDataSource.AddProvider(AProvider: TcxCustomDataProvider); +begin + if FProviders = nil then + FProviders := TList.Create; + FProviders.Add(AProvider); +end; + +procedure TcxCustomDataSource.RemoveProvider(AProvider: TcxCustomDataProvider); +begin + if FProviders = nil then Exit; + FProviders.Remove(AProvider); + if CurrentProvider = AProvider then + CurrentProvider := nil; +end; + +procedure TcxCustomDataSource.RemoveFromProviders; +var + I: Integer; +begin + if FProviders = nil then Exit; + for I := FProviders.Count - 1 downto 0 do + if TcxCustomDataProvider(FProviders[I]).CustomDataSource = Self then + TcxCustomDataProvider(FProviders[I]).CustomDataSource := nil; +end; + +{ TcxCustomDataProvider } + +constructor TcxCustomDataProvider.Create(ADataController: TcxCustomDataController); +begin + inherited Create; + FDataController := ADataController; + FEditingRecordIndex := cxNullEditingRecordIndex; + FEditingRecordIndex1 := cxNullEditingRecordIndex; + FEditingRecordIndex2 := cxNullEditingRecordIndex; + FInsertedRecordIndex := -1; +end; + +destructor TcxCustomDataProvider.Destroy; +begin + ClearSavedRecord; + CustomDataSource := nil; + inherited Destroy; +end; + +// Mode + +procedure TcxCustomDataProvider.CustomSort; +begin + if CustomDataSource <> nil then + begin + CustomDataSource.CurrentProvider := Self; + CustomDataSource.CustomSort; + end; +end; + +function TcxCustomDataProvider.IsCustomDataSourceSupported: Boolean; +begin + Result := True; +end; + +function TcxCustomDataProvider.IsCustomSorting: Boolean; +begin + if CustomDataSource <> nil then + begin + CustomDataSource.CurrentProvider := Self; + Result := CustomDataSource.IsCustomSorting; + end + else + Result := False; +end; + +function TcxCustomDataProvider.IsGridMode: Boolean; +begin + Result := False; +end; + +function TcxCustomDataProvider.IsDataSource: Boolean; +begin + Result := False; +end; + +function TcxCustomDataProvider.IsOtherInsert: Boolean; +begin + Result := False; +end; + +function TcxCustomDataProvider.IsRecordIdSupported: Boolean; +begin + if CustomDataSource <> nil then + begin + CustomDataSource.CurrentProvider := Self; + Result := CustomDataSource.IsRecordIdSupported; + end + else + Result := False; +end; + +function TcxCustomDataProvider.IsSyncMode: Boolean; +begin + Result := False; +end; + +// State + +function TcxCustomDataProvider.IsActive: Boolean; +begin + Result := CustomDataSource <> nil; +end; + +function TcxCustomDataProvider.IsActiveDataSet: Boolean; +begin + Result := False; +end; + +function TcxCustomDataProvider.IsBOF: Boolean; +begin + Result := True; +end; + +function TcxCustomDataProvider.IsChanging: Boolean; +begin + Result := FChanging; +end; + +function TcxCustomDataProvider.IsEditing: Boolean; +begin + Result := FEditingRecordIndex <> cxNullEditingRecordIndex; +end; + +function TcxCustomDataProvider.IsEOF: Boolean; +begin + Result := True; +end; + +function TcxCustomDataProvider.IsGridModeUpdating: Boolean; +begin + Result := False; +end; + +function TcxCustomDataProvider.IsInserting: Boolean; +begin + Result := IsEditing and FInserting; +end; + +function TcxCustomDataProvider.IsModified: Boolean; +begin + Result := FModified; +end; + +function TcxCustomDataProvider.IsUnboundColumnMode: Boolean; +begin + Result := not CanModify; // !!! +end; + +// Navigation + +procedure TcxCustomDataProvider.CorrectRecordIndex(ARecordIndex: Integer); +begin +end; + +procedure TcxCustomDataProvider.First; +begin + FRecreatedFieldsAfterFirst := False; +end; + +procedure TcxCustomDataProvider.Prev; +begin +end; + +procedure TcxCustomDataProvider.Next; +begin +end; + +procedure TcxCustomDataProvider.Last; +begin +end; + +procedure TcxCustomDataProvider.MoveBy(ADistance: Integer); +begin +end; + +procedure TcxCustomDataProvider.Scroll(ADistance: Integer); +begin +end; + +procedure TcxCustomDataProvider.SavePos; +begin +end; + +procedure TcxCustomDataProvider.RestorePos; +begin +end; + +// Editing + +function TcxCustomDataProvider.CanAppend: Boolean; +begin + Result := CanModify; +end; + +function TcxCustomDataProvider.CanInsert: Boolean; +begin + Result := CanModify; +end; + +function TcxCustomDataProvider.CanDelete: Boolean; +begin + Result := DataController.RecordCount > 0; +end; + +function TcxCustomDataProvider.CanInitEditing(ARecordIndex: Integer): Boolean; +begin + DataController.CheckRecordRange(ARecordIndex); + if not IsEditing then + SetEditing; + if IsEditing then + SetChanging; + Result := True; +end; + +function TcxCustomDataProvider.CanModify: Boolean; +begin + Result := True; +end; + +procedure TcxCustomDataProvider.Append; +begin + InsertingRecord(True); +end; + +procedure TcxCustomDataProvider.Cancel; +var + ARecordIndex: Integer; +begin + DataController.DoBeforeCancel; + DataController.BeginUpdate; + try + if (FEditingRecordIndex <> cxNullEditingRecordIndex) and + ((FEditingRecordIndex < DataController.RecordCount) or + (FEditingRecordIndex = DataController.FNewItemRecordIndex)) then + begin + if IsInserting then + begin + DataController.FInSmartLoad := DataController.IsSmartLoad; + try + ARecordIndex := DataController.GetFocusedRecordIndex; + DataController.DeleteRecord(FEditingRecordIndex); + if not DataController.FInCancel and + (ARecordIndex >= DataController.RecordCount) then + DataController.ChangeFocusedRecordIndex(ARecordIndex - 1); + finally + DataController.FInSmartLoad := False; + end; + end + else + if FSavedRecordIndex < 0 then + begin + DataController.CopyRecord(FSavedRecordIndex, FEditingRecordIndex); + end; + end; + ResetEditing; + finally + DataController.EndUpdate; + end; + DataController.DoAfterCancel; +end; + +procedure TcxCustomDataProvider.DoUpdateData; +begin + if FInUpdateData then Exit; + FInUpdateData := True; + try + if IsChanging then + DataController.UpdateData; + finally + FInUpdateData := False; + end; +end; + +procedure TcxCustomDataProvider.Delete; +var + ARecordIndex: Integer; +begin + ARecordIndex := DataController.DataControllerInfo.FocusedRecordIndex; + if ARecordIndex <> -1 then + begin + DataController.DoBeforeDelete(ARecordIndex); + if DataController.IsProviderMode then + DataController.SaveKeys; + try + DataController.DeleteRecord(ARecordIndex); + DataController.CheckNearestFocusRow; + finally + if DataController.IsProviderMode then + DataController.RestoreKeys; + end; + DataController.DoAfterDelete; + end; +end; + +procedure TcxCustomDataProvider.DeleteRecords(AList: TList); +var + I, ARecordIndex: Integer; +begin + if DataController.IsProviderMode then + DataController.SaveKeys; + try + DataController.BeginFullUpdate; + try + for I := AList.Count - 1 downto 0 do + begin + ARecordIndex := Integer(AList[I]); + DataController.DoBeforeDelete(ARecordIndex); + DataController.DeleteRecord(ARecordIndex); + DataController.DoAfterDelete; + end; + if DataController.FInDeleteSelection then + DataController.ClearSelection; + finally + DataController.EndFullUpdate; + end; +// if DataController.LockCount = 0 then + DataController.CheckNearestFocusRow; + finally + if DataController.IsProviderMode then + DataController.RestoreKeys; + end; +end; + +procedure TcxCustomDataProvider.DeleteSelection; +var + AList: TList; + I, ARowIndex: Integer; + ARowInfo: TcxRowInfo; +begin + AList := TList.Create; + try + for I := 0 to DataController.GetSelectedCount - 1 do + begin + ARowIndex := DataController.GetSelectedRowIndex(I); + ARowInfo := DataController.GetRowInfo(ARowIndex); + if ARowInfo.Level < DataController.Groups.LevelCount then // It's Group Row + DataController.Groups.LoadRecordIndexesByRowIndex(AList, ARowIndex) + else + AList.Add(Pointer(ARowInfo.RecordIndex)); + end; + // Delete Records + DataController.FInDeleteSelection := True; + try + DataController.DeleteRecords(AList); + finally + DataController.FInDeleteSelection := False; + end; +// DataController.ClearSelection; + finally + AList.Free; + end; +end; + +procedure TcxCustomDataProvider.Edit; +begin + SetEditing; +end; + +function TcxCustomDataProvider.GetEditValue(ARecordIndex: Integer; AField: TcxCustomDataField; + AEditValueSource: TcxDataEditValueSource): Variant; +begin + if ARecordIndex <> cxNullEditingRecordIndex then + Result := DataController.GetInternalValue(ARecordIndex, AField) + else + begin + Result := Null; + InvalidOperation(cxSDataRecordIndexError); + end; +end; + +procedure TcxCustomDataProvider.Insert; +begin + InsertingRecord(False); +end; + +procedure TcxCustomDataProvider.Post; +var + ARecordIndex: Integer; + APostFlag: Boolean; +begin + DataController.BeginFullUpdate; + try + ARecordIndex := -1; + APostFlag := False; + DoUpdateData; + if IsInserting and not IsModified then + Cancel + else + begin + APostFlag := True; + DataController.DoBeforePost; + ARecordIndex := FEditingRecordIndex; + if IsInserting and DataController.UseNewItemRowForEditing and + (FEditingRecordIndex <> cxNullEditingRecordIndex) then + begin + FDataChangedLocked := CustomDataSource <> nil; + try + FInsertedRecordIndex := DataController.AppendRecord; + ARecordIndex := FInsertedRecordIndex; + finally + FDataChangedLocked := False; + end; + DataController.CopyRecord(FEditingRecordIndex, FInsertedRecordIndex); + end; + ResetEditing; + end; + DataController.DataChanged(dcRecord, -1, ARecordIndex); + if APostFlag then + DataController.DoAfterPost; + finally + DataController.EndFullUpdate; + end; +end; + +procedure TcxCustomDataProvider.PostEditingData; +begin + DoUpdateData; + ResetChanging; +end; + +function TcxCustomDataProvider.SetEditValue(ARecordIndex: Integer; AField: TcxCustomDataField; + const AValue: Variant; AEditValueSource: TcxDataEditValueSource): Boolean; +begin + if (AEditValueSource = evsText) and (VarToStr(AValue) = '') then + DataController.SetValue(ARecordIndex, AField.Index, Null) + else + DataController.SetValue(ARecordIndex, AField.Index, AValue); + SetModified; + Result := True; +end; + +procedure TcxCustomDataProvider.BeginDeleting; +var + ARowIndex: Integer; +begin + if not IsGridMode and (DataController.FocusedRowIndex <> -1) then + begin + ARowIndex := DataController.FocusedRowIndex; + if not DataController.MultiSelect or + (DataController.IsRowSelected(ARowIndex) or (DataController.GetSelectedCount = 0)) then + ARowIndex := DataController.GetNearestRowIndex(ARowIndex); + if ARowIndex <> -1 then + DataController.FNearestRecordIndex := DataController.GetRowInfo(ARowIndex).RecordIndex; + end; +end; + +procedure TcxCustomDataProvider.EndDeleting; +begin + DataController.FNearestRecordIndex := -1; +end; + +procedure TcxCustomDataProvider.AssignItemValue(ARecordIndex: Integer; + AField: TcxCustomDataField; const AValue: Variant); +begin + DataController.Values[ARecordIndex, AField.Index] := AValue; +end; + +procedure TcxCustomDataProvider.ClearSavedRecord; +begin + if FSavedRecordIndex < 0 then + begin + FDataController.DataStorage.DeleteRecord(FSavedRecordIndex); + FSavedRecordIndex := 0; + end; +end; + +procedure TcxCustomDataProvider.CreateSavedRecord(ARecordIndex: Integer); +begin + if FSavedRecordIndex = 0 then + FSavedRecordIndex := FDataController.DataStorage.AddInternalRecord; + FDataController.CopyRecord(ARecordIndex, FSavedRecordIndex); +end; + +procedure TcxCustomDataProvider.DoInitInsertingRecord(AInsertingRecordIndex: Integer; const AGroupValues: TcxDataSummaryValues); +var + I: Integer; +begin + if (DataController.Groups.GroupingItemCount > 0) and + (dcoAssignGroupingValues in DataController.Options) then + begin + for I := 0 to DataController.Groups.GroupingItemCount - 1 do + AssignItemValue(AInsertingRecordIndex, + DataController.Fields[DataController.Groups.GroupingItemIndex[I]], + AGroupValues[I]); + end; + DataController.DoNewRecord(AInsertingRecordIndex); +end; + +procedure TcxCustomDataProvider.EditingRecord; +var + ARowIndex: Integer; +begin + if DataController.UseNewItemRowForEditing and DataController.NewItemRowFocused and + not IsInserting then + begin + Insert; + Exit; + end; + FEditingRecordIndex := DataController.CalcEditingRecordIndex; + + if FEditingRecordIndex >= 0 then + begin + FEditingRecordIndex1 := cxNullEditingRecordIndex; + FEditingRecordIndex2 := cxNullEditingRecordIndex; + ARowIndex := DataController.GetFocusedRowIndex; + if ARowIndex <> -1 then + begin + if ARowIndex < (DataController.GetRowCount - 1) then + begin + ARowIndex := ARowIndex + 1; + FEditingRecordIndex2 := DataController.GetRowInfo(ARowIndex).RecordIndex; + end + else + begin + ARowIndex := ARowIndex - 1; + if 0 <= ARowIndex then + FEditingRecordIndex1 := DataController.GetRowInfo(ARowIndex).RecordIndex + else + FEditingRecordIndex1 := DataController.GetRowInfo(DataController.GetFocusedRowIndex).RecordIndex; + end; + end; + end; + + if FEditingRecordIndex = cxNullEditingRecordIndex then Exit; + if (not IsDataSource or DataController.IsSmartRefresh) and not IsInserting then // !!! + CreateSavedRecord(FEditingRecordIndex); + DataController.Change([dccUpdateRecord]); +end; + +procedure TcxCustomDataProvider.InsertingRecord(AIsAppending: Boolean); +var + ARowIndex, ARecordIndex: Integer; + AGroupValues: TcxDataSummaryValues; +begin + // TODO: proc + if not IsDataSource and IsInserting and not IsChanging and not IsModified then Exit; + if IsEditing and (IsChanging or IsModified) and not IsDataSource then + begin + if IsChanging then + PostEditingData; + Post; + end; + // + DataController.DoBeforeInsert; + DataController.BeginUpdate; + try + if DataController.UseNewItemRowForEditing then + begin + ARecordIndex := DataController.GetFocusedRecordIndex; + if (ARecordIndex < 0) and (DataController.GetRowCount > 0) then + ARecordIndex := DataController.GetRowInfo(0).RecordIndex; + FEditingRecordIndex := DataController.NewItemRecordIndex; + DataController.NewItemRowFocused := True; + DataController.GetGroupValues(ARecordIndex, AGroupValues); + end + else + begin + if not AIsAppending then + DataController.ClearSelection; // TODO: ? + if IsGridMode then + begin + ARecordIndex := DataController.GetActiveRecordIndex; //DataController.GetFocusedRecordIndex; + DataController.GetGroupValues(ARecordIndex, AGroupValues); + FEditingRecordIndex := ARecordIndex; + end + else + begin + if AIsAppending then + begin + ARecordIndex := DataController.GetLastRecordIndex; + DataController.GetGroupValues(ARecordIndex, AGroupValues); + FEditingRecordIndex := DataController.AppendRecord; + FEditingRecordIndex1 := ARecordIndex; + end + else + begin + ARowIndex := DataController.GetFocusedRowIndex; + if ARowIndex <> -1 then + ARecordIndex := DataController.GetRowInfo(ARowIndex).RecordIndex + else + ARecordIndex := 0; + DataController.GetGroupValues(ARecordIndex, AGroupValues); + FEditingRecordIndex := DataController.InsertRecord(ARecordIndex); + FEditingRecordIndex2 := ARecordIndex; + if FEditingRecordIndex <= ARecordIndex then + Inc(FEditingRecordIndex2); + end; + end; + end; + DoInitInsertingRecord(FEditingRecordIndex, AGroupValues); + ResetChanging; + FInserting := True; + finally + DataController.EndUpdate; + end; + DataController.ChangeFocusedRecordIndex(FEditingRecordIndex); + DataController.DoAfterInsert; +end; + +procedure TcxCustomDataProvider.ResetChanging; +begin + FChanging := False; +end; + +procedure TcxCustomDataProvider.ResetEditing; +begin + if (FEditingRecordIndex <> cxNullEditingRecordIndex) and + (FEditingRecordIndex = DataController.FNewItemRecordIndex) and + (DataController.FNewItemRecordIndex < 0{is real new item row}) then + FDataController.DataStorage.DeleteRecord(FEditingRecordIndex); + FEditingRecordIndex := cxNullEditingRecordIndex; + FEditingRecordIndex1 := cxNullEditingRecordIndex; + FEditingRecordIndex2 := cxNullEditingRecordIndex; + FInserting := False; + ResetChanging; + ResetModified; + ClearSavedRecord; +end; + +procedure TcxCustomDataProvider.ResetModified; +begin + FModified := False; +end; + +procedure TcxCustomDataProvider.SetChanging; +begin + FChanging := True; +end; + +procedure TcxCustomDataProvider.SetEditing; +begin + EditingRecord; +end; + +procedure TcxCustomDataProvider.SetModified; +begin + FModified := True; +end; + +// Lock Notify + +procedure TcxCustomDataProvider.BeginLocate; +begin + Inc(FLocateCount); +end; + +procedure TcxCustomDataProvider.EndLocate; +begin + Dec(FLocateCount); +end; + +procedure TcxCustomDataProvider.Freeze; +begin + Inc(FLockCount); +end; + +procedure TcxCustomDataProvider.Unfreeze; +begin + Dec(FLockCount); +end; + +// Data + +function TcxCustomDataProvider.AddRecordHandle(AData: Pointer): Integer; +begin + Result := -1; + if CustomDataSource <> nil then + begin + CustomDataSource.CurrentProvider := Self; + Result := CustomDataSource.AddRecordHandle(AData); + end; +end; + +function TcxCustomDataProvider.AppendRecord: Integer; +begin + if CustomDataSource <> nil then + begin + CustomDataSource.CurrentProvider := Self; + Result := CustomDataSource.GetRecordIndexByHandle(CustomDataSource.AppendRecord); + end + else + Result := -1; +end; + +procedure TcxCustomDataProvider.DeleteRecord(ARecordIndex: Integer); +begin + if CustomDataSource <> nil then + begin + CustomDataSource.CurrentProvider := Self; + CustomDataSource.DeleteRecord(CustomDataSource.GetRecordHandleByIndex(ARecordIndex)); + end; +end; + +function TcxCustomDataProvider.GetDetailHasChildren(ARecordIndex, ARelationIndex: Integer): Boolean; +begin + Result := False; + if CustomDataSource <> nil then + begin + CustomDataSource.CurrentProvider := Self; + Result := CustomDataSource.GetDetailHasChildren(ARecordIndex, ARelationIndex); + end; +end; + +function TcxCustomDataProvider.GetDisplayText(ARecordIndex: Integer; AField: TcxCustomDataField): string; +var + ARecordHandle: TcxDataRecordHandle; + AItemHandle: TcxDataItemHandle; +begin + if CustomDataSource <> nil then + begin + CustomDataSource.CurrentProvider := Self; + ARecordHandle := CustomDataSource.GetRecordHandleByIndex(ARecordIndex); + AItemHandle := CustomDataSource.GetItemHandle(AField.Index); + Result := CustomDataSource.GetDisplayText(ARecordHandle, AItemHandle); + end + else + Result := ''; +end; + +{function TcxCustomDataProvider.GetRecordCount: Integer; +begin + if CustomDataSource <> nil then + begin + CustomDataSource.CurrentProvider := Self; + Result := CustomDataSource.GetRecordCount; + end + else + Result := 0; +end;} + +function TcxCustomDataProvider.GetExternalDataDisplayText(ARecordIndex: Integer; + AField: TcxCustomDataField): string; +begin + Result := ''; +end; + +function TcxCustomDataProvider.GetExternalDataValue(ARecordIndex: Integer; + AField: TcxCustomDataField): Variant; +begin + Result := Null; +end; + +function TcxCustomDataProvider.GetRecordId(ARecordIndex: Integer): Variant; +var + ARecordHandle: TcxDataRecordHandle; +begin + if CustomDataSource <> nil then + begin + CustomDataSource.CurrentProvider := Self; + ARecordHandle := CustomDataSource.GetRecordHandleByIndex(ARecordIndex); + Result := CustomDataSource.GetRecordId(ARecordHandle); + end + else + Result := Null; +end; + +function TcxCustomDataProvider.GetRecordIndex: Integer; +begin + Result := -1; +end; + +function TcxCustomDataProvider.GetValue(ARecordIndex: Integer; AField: TcxCustomDataField): Variant; +var + ARecordHandle: TcxDataRecordHandle; + AItemHandle: TcxDataItemHandle; +begin + if CustomDataSource <> nil then + begin + CustomDataSource.CurrentProvider := Self; + ARecordHandle := CustomDataSource.GetRecordHandleByIndex(ARecordIndex); + AItemHandle := CustomDataSource.GetItemHandle(AField.Index); + Result := CustomDataSource.GetValue(ARecordHandle, AItemHandle); + end + else + Result := Null; +end; + +function TcxCustomDataProvider.GetValueDefReaderClass: TcxValueDefReaderClass; +begin + Result := TcxValueDefReader; +end; + +function TcxCustomDataProvider.InsertRecord(ARecordIndex: Integer): Integer; +var + ARecordHandle: TcxDataRecordHandle; +begin + Result := -1; + if CustomDataSource <> nil then + begin + CustomDataSource.CurrentProvider := Self; + if CustomDataSource.GetRecordCount = 0 then + ARecordHandle := CustomDataSource.AppendRecord + else + ARecordHandle := CustomDataSource.InsertRecord(CustomDataSource.GetRecordHandleByIndex(ARecordIndex)); + Result := CustomDataSource.GetRecordIndexByHandle(ARecordHandle); + end; +end; + +procedure TcxCustomDataProvider.LoadDataBuffer; +begin +end; + +procedure TcxCustomDataProvider.LoadRecordHandles; +begin + if CustomDataSource <> nil then + begin + CustomDataSource.CurrentProvider := Self; + CustomDataSource.LoadRecordHandles; + end; +end; + +function TcxCustomDataProvider.NativeCompare(ARecordIndex1, ARecordIndex2: Integer; + AField: TcxCustomDataField): Integer; + + procedure GetCompareInfo(ARecordIndex: Integer; var IsNull: Boolean; var P: PChar); + var + ARecordHandle: TcxDataRecordHandle; + AItemHandle: TcxDataItemHandle; + begin + if ARecordIndex <= -1 then // internal record + IsNull := DataController.DataStorage.GetCompareInfo(ARecordIndex, AField.ValueDef, P) + else + begin + ARecordHandle := CustomDataSource.GetRecordHandleByIndex(ARecordIndex); + AItemHandle := CustomDataSource.GetItemHandle(AField.Index); + IsNull := not CustomDataSource.GetInfoForCompare(ARecordHandle, AItemHandle, P); + end; + end; + +var + AIsNull1, AIsNull2: Boolean; + P1, P2: PChar; +begin + if (ARecordIndex1 <= -1) and (ARecordIndex2 <= -1) then + Result := DataController.DataStorage.CompareRecords(ARecordIndex1, ARecordIndex2, AField.ValueDef) + else + begin + CustomDataSource.CurrentProvider := Self; + GetCompareInfo(ARecordIndex1, AIsNull1, P1); + GetCompareInfo(ARecordIndex2, AIsNull2, P2); + Result := AField.ValueDef.CompareValues(AIsNull1, AIsNull2, P1, P2); + end; +end; + +function TcxCustomDataProvider.NativeCompareFunc(ARecordIndex1, ARecordIndex2: Integer; + AField: TcxCustomDataField): Integer; +begin + CustomDataSource.CurrentProvider := Self; + with CustomDataSource do + Result := NativeCompareFunc(GetRecordHandleByIndex(ARecordIndex1), + GetRecordHandleByIndex(ARecordIndex2), GetItemHandle(AField.Index)); +end; + +procedure TcxCustomDataProvider.SetDisplayText(ARecordIndex: Integer; + AField: TcxCustomDataField; const Value: string); +begin +end; + +procedure TcxCustomDataProvider.SetRecordCount(ARecordCount: Integer); +begin + if CustomDataSource <> nil then + begin + CustomDataSource.CurrentProvider := Self; + CustomDataSource.SetRecordCount(ARecordCount); + end; +end; + +procedure TcxCustomDataProvider.SetValue(ARecordIndex: Integer; + AField: TcxCustomDataField; const Value: Variant); +var + ARecordHandle: TcxDataRecordHandle; + AItemHandle: TcxDataItemHandle; +begin + if CustomDataSource <> nil then + begin + CustomDataSource.CurrentProvider := Self; + ARecordHandle := CustomDataSource.GetRecordHandleByIndex(ARecordIndex); + AItemHandle := CustomDataSource.GetItemHandle(AField.Index); + CustomDataSource.SetValue(ARecordHandle, AItemHandle, Value); + end; +end; + +// Notification + +procedure TcxCustomDataProvider.ActiveChanged(AActive: Boolean); +begin + DataController.ActiveChanged(AActive); + ResetEditing; +end; + +procedure TcxCustomDataProvider.DataChanged(ADataChange: TcxDataChange; + AItemIndex, ARecordIndex: Integer); +begin + if (LockCount = 0) {and (LocateCount = 0) }then + DataController.DataChanged(ADataChange, AItemIndex, ARecordIndex); + if FDataChangedLocked then + ResetChanging + else + ResetEditing; +end; + +procedure TcxCustomDataProvider.DataScrolled(ADistance: Integer); +begin + DataController.DataScrolled(ADistance); + ResetChanging; +end; + +procedure TcxCustomDataProvider.LayoutChanged(ADataLayoutChanges: TcxDataLayoutChanges); +begin + DataController.LayoutChanged(ADataLayoutChanges); +end; + +procedure TcxCustomDataProvider.SetCustomDataSource(Value: TcxCustomDataSource); +begin + if not IsCustomDataSourceSupported then Exit; + if FCustomDataSource <> Value then + begin + if FCustomDataSource <> nil then + FCustomDataSource.RemoveProvider(Self); + FCustomDataSource := Value; + if FCustomDataSource <> nil then + FCustomDataSource.AddProvider(Self); + + DataController.FInSetCustomDataSource := True; + try + if not DataController.FDestroying then + DataController.RestructData; + finally + DataController.FInSetCustomDataSource := False; + end; + end; +end; + +{ TcxCustomDataField } + +constructor TcxCustomDataField.Create(AFieldList: TcxCustomDataFieldList); +begin + inherited Create; + FFieldList := AFieldList; +end; + +destructor TcxCustomDataField.Destroy; +begin + FieldList.RemoveField(Self); + ClearData; + inherited Destroy; +end; + +function TcxCustomDataField.CanModify(AEditValueSource: TcxDataEditValueSource): Boolean; +begin + Result := Assigned(ValueDef) + or DataController.IsProviderMode {don't support cancel for ValueDef = nil}; +end; + +function TcxCustomDataField.IsUnbound: Boolean; +begin + Result := False; +end; + +function TcxCustomDataField.IsValueDefInternal: Boolean; +begin + Result := IsInternal; +end; + +procedure TcxCustomDataField.BeginRecreateData; +begin + if FLockRecreateData = 0 then + ClearData; + Inc(FLockRecreateData); +end; + +procedure TcxCustomDataField.Changed; +begin + if (FieldList.DataController.Provider.LockCount = 0) then + FieldList.DataController.Provider.LayoutChanged([lcStructure]); +end; + +procedure TcxCustomDataField.ClearData; +begin + if Assigned(FReferenceField) then Exit; + if Assigned(FValueDef) then + begin + FValueDef.Free; + FValueDef := nil; + end; +end; + +procedure TcxCustomDataField.CreateData; +var + ADataStorage: TcxDataStorage; +begin + if Assigned(FReferenceField) or (FValueTypeClass = nil) then Exit; + ClearData; + ADataStorage := FieldList.DataController.DataStorage; + FValueDef := ADataStorage.ValueDefs.Add(FValueTypeClass, IsInternal, TextStored, Self); +end; + +procedure TcxCustomDataField.EndRecreateData; +begin + Dec(FLockRecreateData); + if FLockRecreateData = 0 then + CreateData; +end; + +procedure TcxCustomDataField.Reassign(ASource: TcxCustomDataField); +begin + FReferenceField := nil; + FValueDef := ASource.FValueDef; + if FValueDef <> nil then + FValueDef.LinkObject := Self; + FValueTypeClass := ASource.FValueTypeClass; + ASource.FValueDef := nil; + ASource.FValueTypeClass := nil; +end; + +procedure TcxCustomDataField.RemoveNotification(AComponent: TComponent); +begin +end; + +function TcxCustomDataField.GetDataController: TcxCustomDataController; +begin + Result := FieldList.DataController; +end; + +function TcxCustomDataField.GetIndex: Integer; +begin + Result := FieldList.FItems.IndexOf(Self); +end; + +function TcxCustomDataField.GetNotifier: TComponent; +begin + Result := FieldList.DataController.Notifier; +end; + +function TcxCustomDataField.GetTextStored: Boolean; +begin + if Assigned(FReferenceField) then + Result := FReferenceField.TextStored + else + Result := FTextStored; +end; + +function TcxCustomDataField.GetValueDef: TcxValueDef; +begin + if Assigned(FReferenceField) then + Result := FReferenceField.ValueDef + else + Result := FValueDef; +end; + +function TcxCustomDataField.GetValueTypeClass: TcxValueTypeClass; +begin + if Assigned(FReferenceField) then + Result := FReferenceField.ValueTypeClass + else + Result := FValueTypeClass; +end; + +procedure TcxCustomDataField.SetIndex(Value: Integer); +var + ACurIndex: Integer; +begin + ACurIndex := Index; + if ACurIndex <> Value then + FieldList.FItems.Move(ACurIndex, Value); +end; + +procedure TcxCustomDataField.SetIsInternal(Value: Boolean); +begin + if FIsInternal <> Value then + begin + FIsInternal := Value; + FieldList.Update; + end; +end; + +procedure TcxCustomDataField.SetReferenceField(Value: TcxCustomDataField); +begin + if FReferenceField <> Value then + begin + if Value <> nil then + begin + while Value.FReferenceField <> nil do + Value := Value.FReferenceField; + end; + if Value <> Self then + begin + if FReferenceField = nil then + ValueTypeClass := nil; + FReferenceField := Value; + end; + end; +end; + +procedure TcxCustomDataField.SetTextStored(Value: Boolean); +begin + if Assigned(FReferenceField) then Exit; + if FTextStored <> Value then + begin + BeginRecreateData; + try + FTextStored := Value; + finally + EndRecreateData; + end; + end; +end; + +procedure TcxCustomDataField.SetValueTypeClass(Value: TcxValueTypeClass); +begin + if Assigned(FReferenceField) then Exit; + if FValueTypeClass <> Value then + begin + BeginRecreateData; + try + FValueTypeClass := Value; + finally + EndRecreateData; + end; + end; +end; + +{ TcxCustomDataFieldList } + +constructor TcxCustomDataFieldList.Create(ADataController: TcxCustomDataController); +begin + inherited Create; + FItems := TList.Create; + FDataController := ADataController; +end; + +destructor TcxCustomDataFieldList.Destroy; +begin + Clear; + FItems.Free; + inherited Destroy; +end; + +function TcxCustomDataFieldList.FieldByItem(AItem: TObject): TcxCustomDataField; +var + I: Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + if Items[I].Item = AItem then + begin + Result := Items[I]; + Break; + end; +end; + +procedure TcxCustomDataFieldList.ReassignFields(ADestroyedField: TcxCustomDataField); +var + I: Integer; + ACurrentField, ANewReferenceField: TcxCustomDataField; +begin + ANewReferenceField := nil; + for I := 0 to Count - 1 do + begin + ACurrentField := Items[I]; + if ACurrentField.ReferenceField = ADestroyedField then + begin + if ANewReferenceField = nil then + begin + ANewReferenceField := ACurrentField; + ACurrentField.Reassign(ADestroyedField); + end + else + ACurrentField.ReferenceField := ANewReferenceField; + end; + end; +end; + +procedure TcxCustomDataFieldList.Add(AField: TcxCustomDataField); +begin + if not AField.IsInternal then + FItems.Insert(ItemCount, AField) // Before Internal Fields + else + FItems.Add(AField); + Update; +end; + +procedure TcxCustomDataFieldList.Clear; +begin + while FItems.Count > 0 do + TcxCustomDataField(FItems.Last).Free; +end; + +procedure TcxCustomDataFieldList.RemoveField(AField: TcxCustomDataField); +var + ASavedField: TcxCustomDataField; +begin + FFieldDestroyed := True; + ASavedField := AField; +// DataController.RemoveField(AField); + ReassignFields(AField); + FItems.Remove(AField); + DataController.RemoveField(ASavedField); + Update; +end; + +procedure TcxCustomDataFieldList.RemoveNotification(AComponent: TComponent); +var + I: Integer; +begin + I := 0; + while I < Count do + begin + Items[I].RemoveNotification(AComponent); + Inc(I); + end; +end; + +procedure TcxCustomDataFieldList.Update; +var + I: Integer; +begin + FInternalCount := 0; + for I := 0 to Count - 1 do + if Items[I].IsInternal then + Inc(FInternalCount); +end; + +function TcxCustomDataFieldList.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxCustomDataFieldList.GetItem(Index: Integer): TcxCustomDataField; +begin + Result := TcxCustomDataField(FItems[Index]); +end; + +function TcxCustomDataFieldList.GetItemCount: Integer; +begin + Result := FItems.Count - FInternalCount; +end; + +{ TcxDetailInfoObject } + +destructor TcxDetailInfoObject.Destroy; +begin + LinkObject.Free; + inherited Destroy;; +end; + +{ TcxDetailObject } + +constructor TcxDetailObject.Create; +begin + inherited Create; + FActiveRelationIndex := -1; + FInfoObjects := TList.Create; +end; + +destructor TcxDetailObject.Destroy; +begin + Clear; + FInfoObjects.Free; + inherited Destroy; +end; + +procedure TcxDetailObject.Clear; +var + I: Integer; + AObject: TObject; +begin + for I := 0 to FInfoObjects.Count - 1 do + begin + AObject := TObject(FInfoObjects[I]); + FInfoObjects[I] := nil; + AObject.Free; + end; + FInfoObjects.Clear; +end; + +function TcxDetailObject.ClearHasChildrenFlag: Boolean; +var + I: Integer; + AInfoObject: TcxDetailInfoObject; +begin + Result := False; + for I := 0 to FInfoObjects.Count - 1 do + begin + AInfoObject := TcxDetailInfoObject(FInfoObjects[I]); + if AInfoObject <> nil then + begin + if not Result and AInfoObject.HasChildrenAssigned then + Result := True; + AInfoObject.HasChildrenAssigned := False; + end; + end; +end; + +procedure TcxDetailObject.ClearInfoObject(AIndex: Integer); +begin + TObject(FInfoObjects[AIndex]).Free; + FInfoObjects[AIndex] := nil; +end; + +procedure TcxDetailObject.CorrectCount(ARelations: TcxCustomDataRelationList); +var + I: Integer; +begin + if FInfoObjects.Count < ARelations.Count then + ListSetCount(FInfoObjects, ARelations.Count); + if FInfoObjects.Count > 0 then + begin + if FActiveRelationIndex < 0 then + FActiveRelationIndex := 0; + if FActiveRelationIndex >= ARelations.Count then // !!! + FActiveRelationIndex := ARelations.Count - 1; + // Check Hidden Levels + if ARelations[FActiveRelationIndex].DetailDataController = nil then + for I := 0 to ARelations.Count - 1 do + if ARelations[I].DetailDataController <> nil then + begin + FActiveRelationIndex := I; + Break; + end; + end + else + FActiveRelationIndex := -1; +end; + +function TcxDetailObject.GetInfoObject(Index: Integer): TcxDetailInfoObject; +begin + if (0 <= Index) and (Index < FInfoObjects.Count) then + Result := TcxDetailInfoObject(FInfoObjects[Index]) + else + Result := nil; +end; + +function TcxDetailObject.GetInfoObjectCount: Integer; +begin + if FInfoObjects <> nil then + Result := FInfoObjects.Count + else + Result := 0; +end; + +function TcxDetailObject.GetIsEmpty: Boolean; +var + I: Integer; +begin + Result := True; + for I := 0 to LinkObjectCount - 1 do + if LinkObjects[I] <> nil then + begin + Result := False; + Break; + end; +end; + +function TcxDetailObject.GetLinkObject(Index: Integer): TObject; +var + AInfoObject: TcxDetailInfoObject; +begin + Result := nil; + if (0 <= Index) and (Index < InfoObjectCount) then + begin + AInfoObject := InfoObjects[Index]; + if AInfoObject <> nil then + Result := AInfoObject.LinkObject; + end; +end; + +function TcxDetailObject.GetLinkObjectCount: Integer; +begin + Result := InfoObjectCount; +end; + +procedure TcxDetailObject.SetInfoObject(Index: Integer; Value: TcxDetailInfoObject); +begin + if Index >= FInfoObjects.Count then + ListSetCount(FInfoObjects, Index + 1); + FInfoObjects[Index] := Value; +end; + +procedure TcxDetailObject.SetLinkObject(Index: Integer; Value: TObject); +begin + if Index >= FInfoObjects.Count then + ListSetCount(FInfoObjects, Index + 1); + if FInfoObjects[Index] = nil then + FInfoObjects[Index] := TcxDetailInfoObject.Create; + TcxDetailInfoObject(FInfoObjects[Index]).LinkObject := Value; +end; + +{ TcxCustomDataRelation } + +constructor TcxCustomDataRelation.Create(ARelationList: TcxCustomDataRelationList; + AItem: TObject); +begin + inherited Create; + FItem := AItem; + ARelationList.AddItem(Self); +end; + +destructor TcxCustomDataRelation.Destroy; +begin + if FDetailDataController <> nil then + begin + FDetailDataController.SetMasterMode(nil, FDetailDataController.IsPattern); + FDetailDataController := nil; + end; + FRelationList.RemoveItem(Self); + inherited Destroy; +end; + +procedure TcxCustomDataRelation.Assign(ASource: TcxCustomDataRelation); +begin +end; + +procedure TcxCustomDataRelation.Changed; +begin + FRelationList.Changed(Self); +end; + +procedure TcxCustomDataRelation.RemoveDataField(ADataField: TcxCustomDataField); +begin +end; + +function TcxCustomDataRelation.GetDataController: TcxCustomDataController; +begin + Result := FRelationList.DataController; +end; + +function TcxCustomDataRelation.GetIndex: Integer; +begin + Result := FRelationList.FItems.IndexOf(Self); +end; + +{ TcxCustomDataRelationList } + +constructor TcxCustomDataRelationList.Create(ADataController: TcxCustomDataController); +begin + inherited Create; + FItems := TList.Create; + FDataController := ADataController; +end; + +destructor TcxCustomDataRelationList.Destroy; +begin + Clear; + FItems.Free; + inherited Destroy; +end; + +function TcxCustomDataRelationList.Add(AItem: TObject): TcxCustomDataRelation; +begin + Result := DataController.GetRelationClass.Create(Self, AItem); +end; + +procedure TcxCustomDataRelationList.Assign(ASource: TcxCustomDataRelationList); +var + I: Integer; +begin + BeginUpdate; + try + Clear; + for I := 0 to ASource.Count - 1 do + Add(ASource[I].Item).Assign(ASource[I]); + finally + EndUpdate; + end; +end; + +procedure TcxCustomDataRelationList.BeginUpdate; +begin + Inc(FLockCount); +end; + +procedure TcxCustomDataRelationList.Clear; +var + I: Integer; +begin + BeginUpdate; + try + for I := Count - 1 downto 0 do + Items[I].Free; + finally + EndUpdate; + end; +end; + +function TcxCustomDataRelationList.ClearDetailObject(ARecordIndex, ARelationIndex: Integer): Boolean; +var + ADetailObject: TcxDetailObject; +begin + Result := False; + DataController.CheckRecordRange(ARecordIndex); + if Assigned(FDataField) then + begin + ADetailObject := GetValueAsDetailObject(ARecordIndex); + if Assigned(ADetailObject) then + begin + if ARelationIndex = -1 then + ADetailObject.Clear + else + ADetailObject.ClearInfoObject(ARelationIndex); + Result := True; + end; + end; +end; + +procedure TcxCustomDataRelationList.EndUpdate; +begin + Dec(FLockCount); + Changed(nil); +end; + +function TcxCustomDataRelationList.FindByItem(AItem: TObject): TcxCustomDataRelation; +var + I: Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + begin + if Items[I].Item = AItem then + begin + Result := Items[I]; + Break; + end; + end; +end; + +function TcxCustomDataRelationList.GetDetailObject(ARecordIndex: Integer): TcxDetailObject; + + procedure ResetMasterRelations(ADetailObject: TcxDetailObject); + var + I: Integer; + ADetailLinkObject: TObject; + begin + for I := 0 to ADetailObject.LinkObjectCount - 1 do + begin + ADetailLinkObject := ADetailObject.LinkObjects[I]; + if ADetailLinkObject <> nil then + DataController.GetDetailDataControllerByLinkObject(ADetailLinkObject).FMasterRelation := nil; + end; + end; + +begin + DataController.CheckRecordRange(ARecordIndex); + if Assigned(FDataField) then + begin + Result := GetValueAsDetailObject(ARecordIndex); + if IsEmpty then + begin + if Result <> nil then + begin + ResetMasterRelations(Result); + Result.Free; + Result := nil; + DataController.SetStoredValue(ARecordIndex, FDataField, + Integer(Result)); + end; + Exit; + end; + if Result = nil then + begin + Result := TcxDetailObject.Create; + Result.ActiveRelationIndex := DataController.GetDefaultActiveRelationIndex; + DataController.SetStoredValue(ARecordIndex, FDataField, + Integer(Result)); + end; + Result.CorrectCount(Self); + end + else + Result := nil; +end; + +function TcxCustomDataRelationList.IsDetailObjectExist(ARecordIndex, ARelationIndex: Integer): Boolean; +var + ADetailObject: TcxDetailObject; +begin + DataController.CheckRecordRange(ARecordIndex); + Result := False; + if Assigned(FDataField) then + begin + ADetailObject := GetValueAsDetailObject(ARecordIndex); + Result := Assigned(ADetailObject) and + (((ARelationIndex = -1) and not ADetailObject.IsEmpty) or + ((ARelationIndex <> -1) and (ADetailObject.LinkObjects[ARelationIndex] <> nil))); + end; +end; + +function TcxCustomDataRelationList.IsEmpty: Boolean; +var + APatternRelations: TcxCustomDataRelationList; + I: Integer; +begin + Result := True; + if DataController.GetPatternDataController <> nil then + begin + APatternRelations := DataController.GetPatternDataController.Relations; + for I := 0 to APatternRelations.Count - 1 do + if APatternRelations[I].DetailDataController <> nil then + begin + Result := False; + Break; + end; + end; +end; + +procedure TcxCustomDataRelationList.Move(ACurIndex, ANewIndex: Integer); +var + ARelation: TcxCustomDataRelation; +begin + if ACurIndex <> ANewIndex then + begin + ARelation := TcxCustomDataRelation(FItems[ACurIndex]); + FItems.Delete(ACurIndex); + FItems.Insert(ANewIndex, ARelation); + Changed(nil); + end; +end; + +procedure TcxCustomDataRelationList.RemoveByItem(AItem: TObject); +var + ARelation: TcxCustomDataRelation; +begin + ARelation := FindByItem(AItem); + if ARelation <> nil then + ARelation.Free; +end; + +procedure TcxCustomDataRelationList.Changed(ARelation: TcxCustomDataRelation); +begin + if LockCount = 0 then + Update(ARelation); +end; + +function TcxCustomDataRelationList.GetValueAsDetailObject(ARecordIndex: Integer): TcxDetailObject; +var + AValue: Variant; +begin + AValue := DataController.GetInternalValue(ARecordIndex, FDataField); + if VarIsNull(AValue) then + Result := nil + else + Result := TcxDetailObject(Integer(AValue)); +end; + +procedure TcxCustomDataRelationList.RemoveDataField(ADataField: TcxCustomDataField); +var + I: Integer; +begin + if ADataField = FDataField then + FDataField := nil; + for I := 0 to Count - 1 do + Items[I].RemoveDataField(ADataField); +end; + +procedure TcxCustomDataRelationList.Update(ARelation: TcxCustomDataRelation); +begin + DataController.BeginUpdate; + try + if Count = 0 then + FDataField.Free // FDataField <- nil (in RemoveDataField method) + else + if FDataField <> nil then + begin + DataController.ClearDetails; + end + else + begin + FDataField := DataController.AddInternalField; + FDataField.ValueTypeClass := TcxObjectValueType; + end; + DataController.UpdateRelations(ARelation); + finally + DataController.EndUpdate; + end; +end; + +procedure TcxCustomDataRelationList.AddItem(AItem: TcxCustomDataRelation); +begin + FItems.Add(AItem); + AItem.FRelationList := Self; + Changed(AItem); +end; + +function TcxCustomDataRelationList.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxCustomDataRelationList.GetItem(Index: Integer): TcxCustomDataRelation; +begin + Result := TcxCustomDataRelation(FItems[Index]); +end; + +procedure TcxCustomDataRelationList.RemoveItem(AItem: TcxCustomDataRelation); +begin + DataController.ClearDetailsMasterRelation(AItem); + FItems.Remove(AItem); + AItem.FRelationList := nil; + Changed(AItem); +end; + +{ TcxSortingFieldList } + +constructor TcxSortingFieldList.Create; +begin + inherited Create; + FItems := TList.Create; +end; + +destructor TcxSortingFieldList.Destroy; +begin + Clear; + FItems.Free; + inherited Destroy; +end; + +procedure TcxSortingFieldList.AppendFrom(AList: TcxSortingFieldList); +var + I: Integer; +begin + for I := 0 to AList.Count - 1 do + if Find(AList[I].Field) = -1 then + Add(AList[I].Field, AList[I].SortOrder); +end; + +procedure TcxSortingFieldList.ChangeSorting(AField: TcxCustomDataField; ASortOrder: TcxDataSortOrder); +var + AIndex: Integer; +begin + AIndex := Find(AField); + if AIndex = -1 then + begin + if ASortOrder <> soNone then + Add(AField, ASortOrder); + end + else + if ASortOrder = soNone then + Delete(AIndex) + else + SetSortOrder(AIndex, ASortOrder); +end; + +procedure TcxSortingFieldList.CheckField(AField: TcxCustomDataField); +begin + if Find(AField) <> -1 then + Changed; +end; + +procedure TcxSortingFieldList.Clear; +begin + while Count > 0 do + Delete(0); +end; + +function TcxSortingFieldList.SortIndexByField(AField: TcxCustomDataField): Integer; +begin + Result := Find(AField); +end; + +function TcxSortingFieldList.SortOrderByField(AField: TcxCustomDataField): TcxDataSortOrder; +var + AIndex: Integer; +begin + AIndex := SortIndexByField(AField); + if AIndex <> -1 then + Result := Items[AIndex].SortOrder + else + Result := soNone; +end; + +procedure TcxSortingFieldList.Add(AField: TcxCustomDataField; ASortOrder: TcxDataSortOrder); +var + PInfo: PcxDataSortInfo; +begin + New(PInfo); + PInfo.Field := AField; + PInfo.SortOrder := ASortOrder; + FItems.Add(PInfo); + Changed; +end; + +procedure TcxSortingFieldList.Changed; +begin + if Assigned(FOnChanged) then FOnChanged; +end; + +procedure TcxSortingFieldList.Delete(Index: Integer); +begin + Dispose(PcxDataSortInfo(FItems[Index])); + FItems.Delete(Index); + Changed; +end; + +function TcxSortingFieldList.Find(AField: TcxCustomDataField): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Count - 1 do + if Items[I].Field = AField then + begin + Result := I; + Break; + end; +end; + +procedure TcxSortingFieldList.Insert(Index: Integer; AField: TcxCustomDataField; + ASortOrder: TcxDataSortOrder); +var + PInfo: PcxDataSortInfo; +begin + New(PInfo); + PInfo.Field := AField; + PInfo.SortOrder := ASortOrder; + FItems.Insert(Index, PInfo); + Changed; +end; + +procedure TcxSortingFieldList.Move(ACurIndex, ANewIndex: Integer); +begin + if ACurIndex <> ANewIndex then + begin + FItems.Move(ACurIndex, ANewIndex); + Changed; + end; +end; + +procedure TcxSortingFieldList.Remove(AField: TcxCustomDataField); +var + AIndex: Integer; +begin + AIndex := Find(AField); + if AIndex <> -1 then + Delete(AIndex); +end; + +procedure TcxSortingFieldList.SetSortOrder(Index: Integer; ASortOrder: TcxDataSortOrder); +begin + if PcxDataSortInfo(FItems[Index]).SortOrder <> ASortOrder then + begin + PcxDataSortInfo(FItems[Index]).SortOrder := ASortOrder; + Changed; + end; +end; + +function TcxSortingFieldList.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxSortingFieldList.GetItem(Index: Integer): TcxDataSortInfo; +begin + Result := PcxDataSortInfo(FItems[Index])^; +end; + +{ TcxGroupingFieldList } + +procedure TcxGroupingFieldList.ChangeGrouping(AField: TcxCustomDataField; AGroupIndex: Integer); +var + AIndex, ANewIndex: Integer; +begin + if AGroupIndex < 0 then + Remove(AField) + else + begin + ANewIndex := AGroupIndex; + AIndex := Find(AField); + if AIndex = -1 then + begin + if ANewIndex > Count then + ANewIndex := Count; + Insert(ANewIndex, AField, soAscending); + end + else + begin + if ANewIndex > (Count - 1) then + ANewIndex := Count - 1; + Move(AIndex, ANewIndex); + end; + end; +end; + +procedure TcxGroupingFieldList.ChangeSorting(AField: TcxCustomDataField; ASortOrder: TcxDataSortOrder); +begin + if ASortOrder = soNone then + ASortOrder := soAscending; + inherited ChangeSorting(AField, ASortOrder); +end; + +function TcxGroupingFieldList.GroupIndexByField(AField: TcxCustomDataField): Integer; +begin + Result := Find(AField); +end; + +procedure TcxGroupingFieldList.UpdateSorting(ASortingFieldList: TcxSortingFieldList); +var + I, AIndex: Integer; +begin + for I := 0 to Count - 1 do + begin + AIndex := ASortingFieldList.Find(Items[I].Field); + if AIndex <> -1 then + SetSortOrder(I, ASortingFieldList[AIndex].SortOrder) + else + SetSortOrder(I, soAscending); + end; +end; + +{ TcxDataGroups } + +constructor TcxDataGroups.Create; +begin + inherited Create; + FFields := TList.Create; + FItems := TList.Create; +end; + +destructor TcxDataGroups.Destroy; +begin + Clear; + FFields.Free; + FItems.Free; + inherited Destroy; +end; + +procedure TcxDataGroups.ChangeExpanding(ARowIndex: Integer; AExpanded, ARecursive: Boolean); +var + AItem: TcxDataGroupInfo; + I: Integer; +begin + if (Find(ARowIndex, AItem) <> -1) and Assigned(AItem) then + begin + AItem.Expanded := AExpanded; + if ARecursive and (AItem.Level < (LevelCount - 1)) then + begin + for I := AItem.BeginRecordListIndex to Count - 1 do + if Items[I].Level > AItem.Level then + Items[I].Expanded := AExpanded + else + Break; + end; + Rebuild; + end; +end; + +procedure TcxDataGroups.FullExpanding(AExpanded: Boolean); +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].Expanded := AExpanded; + Rebuild; +end; + +function TcxDataGroups.GetChildCount(AIndex: Integer): Integer; +var + I, L: Integer; +begin + if AIndex = -1 then + Result := GetFirstLevelCount + else + begin + Result := 0; + if (0 <= AIndex) and (AIndex < Count) then + begin + L := Items[AIndex].Level + 1; + if L = LevelCount then + Result := Items[AIndex].EndRecordListIndex - Items[AIndex].BeginRecordListIndex + 1 + else + for I := Items[AIndex].BeginRecordListIndex to Items[AIndex].EndRecordListIndex do + if Items[I].Level = L then + Inc(Result); + end; + end; +end; + +function TcxDataGroups.GetChildIndex(AParentIndex, AIndex: Integer): Integer; +var + I, J, L: Integer; +begin + if AParentIndex = -1 then + Result := GetFirstLevelIndex(AIndex) + else + begin + Result := -1; + if (0 <= AParentIndex) and (AParentIndex < Count) and + (Items[AParentIndex].Level < (LevelCount - 1)) and + (0 <= AIndex) and (AIndex <= (Items[AParentIndex].EndRecordListIndex - Items[AParentIndex].BeginRecordListIndex)) then +// (Items[AParentIndex].BeginRecordListIndex <= AIndex) and +// (AIndex <= Items[AParentIndex].EndRecordListIndex) then + begin + L := Items[AParentIndex].Level + 1; + J := -1; + for I := Items[AParentIndex].BeginRecordListIndex to Items[AParentIndex].EndRecordListIndex do + if Items[I].Level = L then + begin + Inc(J); + if J = AIndex then + begin + Result := I; + Break; + end; + end; + end; + end; +end; + +function TcxDataGroups.GetChildRecordListIndex(AParentIndex, AIndex: Integer): Integer; +begin + Result := -1; + if (0 <= AParentIndex) and (AParentIndex < Count) and + (Items[AParentIndex].Level = (LevelCount - 1)) and + (0 <= AIndex) and (AIndex <= (Items[AParentIndex].EndRecordListIndex - Items[AParentIndex].BeginRecordListIndex)) then + begin + Result := Items[AParentIndex].BeginRecordListIndex + AIndex; + end; +end; + +function TcxDataGroups.GetDataRecordListIndex(AInfo: TcxDataGroupInfo): Integer; +begin + while AInfo.Level < LevelCount - 1 do + AInfo := Items[AInfo.BeginRecordListIndex]; + Result := AInfo.BeginRecordListIndex; +end; + +function TcxDataGroups.GetFirstLevelCount: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + if Items[I].Level = 0 then + Inc(Result); +end; + +function TcxDataGroups.GetFirstLevelIndex(AIndex: Integer): Integer; +var + I, J: Integer; +begin + Result := -1; + J := -1; + for I := 0 to Count - 1 do + if Items[I].Level = 0 then + begin + Inc(J); + if J = AIndex then + begin + Result := I; + Break; + end; + end; +end; + +function TcxDataGroups.GetIndexByRowIndex(ARowIndex: Integer): Integer; +begin + Result := GetIndexByRowIndexLevel(ARowIndex, -1); +end; + +function TcxDataGroups.GetIndexByRowIndexLevel(ARowIndex, ALevel: Integer): Integer; +var + AIndex: Integer; + AItem: TcxDataGroupInfo; +begin + Result := Find(ARowIndex, AItem); + if (Result = -1) and (AItem <> nil) then // if it is a data row, go to the nearest top group row + begin + ARowIndex := AItem.RowIndex; + Result := Find(ARowIndex, AItem); + end; + if (Result <> -1) and (ALevel <> -1) then + begin + AIndex := Result; + Result := -1; + if Items[AIndex].Level < ALevel then + begin + while AIndex < Count do + begin + AItem := Items[AIndex]; + if AItem.Level = ALevel then + begin + Result := AIndex; + Break; + end; + Inc(AIndex); + end; + end + else + begin + while AIndex >= 0 do + begin + AItem := Items[AIndex]; + if AItem.Level = ALevel then + begin + Result := AIndex; + Break; + end; + Dec(AIndex); + end; + end; + end; +end; + +function TcxDataGroups.GetLevel(AIndex: Integer): Integer; +begin + if (0 <= AIndex) and (AIndex < Count) then + Result := Items[AIndex].Level + else + Result := -1; +end; + +function TcxDataGroups.GetParentIndex(AChildIndex: Integer): Integer; +var + ALevel: Integer; +begin + Result := -1; + if (0 <= AChildIndex) and (AChildIndex < Count) then + begin + ALevel := Items[AChildIndex].Level; + while AChildIndex >= 0 do + begin + if Items[AChildIndex].Level < ALevel then + begin + Result := AChildIndex; + Break; + end + else + if ALevel = 0 then + Break; + Dec(AChildIndex); + end; + end; +end; + +procedure TcxDataGroups.Add(const ADataGroupInfo: TcxDataGroupInfo); +begin + with AddEmpty do + begin + RowIndex := ADataGroupInfo.RowIndex; + Expanded := ADataGroupInfo.Expanded; + Level := ADataGroupInfo.Level; + BeginRecordListIndex := ADataGroupInfo.BeginRecordListIndex; + EndRecordListIndex := ADataGroupInfo.EndRecordListIndex; + SummaryValues := ADataGroupInfo.SummaryValues; + end; +end; + +procedure TcxDataGroups.AddField(AField: TcxCustomDataField); +begin + FFields.Add(AField); +end; + +function TcxDataGroups.AddEmpty: TcxDataGroupInfo; +begin + Result := TcxDataGroupInfo.Create; + FItems.Add(Result); +end; + +procedure TcxDataGroups.Clear; +var + I: Integer; + AInfo: TcxDataGroupInfo; +begin + FFields.Clear; + for I := 0 to FItems.Count - 1 do + begin + AInfo := TcxDataGroupInfo(FItems[I]); + AInfo.Free; + end; + FItems.Clear; +end; + +function TcxDataGroups.Find(ARowIndex: Integer; var AItem: TcxDataGroupInfo): Integer; +var + L, H, I, C: Integer; +begin + AItem := nil; + Result := -1; + L := 0; + H := Count - 1; + if L <= H then + repeat + I := (L + H) div 2; + AItem := Items[I]; + C := AItem.RowIndex - ARowIndex; + if C = 0 then // It's Group + begin + AItem := GetTopVisibleItem(ARowIndex, I); + Result := I; + Break; + end + else + if C < 0 then + L := I + 1 + else + H := I - 1; + if L > H then + begin + AItem := Items[L - 1]; + Break; + end; + until False; +end; + +function TcxDataGroups.FindByIndex(ARecordListIndex, ALevel: Integer): Integer; +var + I, ALastLevel, AAnchor: Integer; + AItem: TcxDataGroupInfo; +begin + Result := -1; + AAnchor := -1; + ALastLevel := LevelCount - 1; + for I := 0 to Count - 1 do + begin + AItem := Items[I]; + if AItem.Level = ALevel then + AAnchor := I; + if (AItem.Level = ALastLevel) and + (AItem.BeginRecordListIndex <= ARecordListIndex) and + (ARecordListIndex <= AItem.EndRecordListIndex) then // only for Data rows + begin + Result := AAnchor; + Break; + end; + end; +end; + +function TcxDataGroups.IsVisible(AIndex: Integer): Boolean; +var + I: Integer; +begin + I := AIndex; + GetTopVisibleItem(Items[AIndex].RowIndex, I); + Result := I = AIndex; +end; + +function TcxDataGroups.MakeVisible(AIndex: Integer; AExpand: Boolean): Boolean; + + procedure ExpandItem(AItem: TcxDataGroupInfo); + begin + if not AItem.Expanded then + begin + AItem.Expanded := True; + Result := True; + end; + end; + +var + I, ALevel: Integer; + AItem: TcxDataGroupInfo; +begin + Result := False; + I := AIndex; + repeat + AItem := Items[I]; + if AExpand then + ExpandItem(AItem); + AExpand := True; + ALevel := AItem.Level; + if ALevel = 0 then + Break + else + while I > 0 do + begin + Dec(I); + if Items[I].Level < ALevel then + Break; + end; + until False; + if Result then + Rebuild; +end; + +function TcxDataGroups.GetField(Index: Integer): TcxCustomDataField; +begin + Result := TcxCustomDataField(FFields[Index]); +end; + +function TcxDataGroups.GetFieldCount: Integer; +begin + Result := FFields.Count; +end; + +function TcxDataGroups.GetItem(Index: Integer): TcxDataGroupInfo; +begin + Result := TcxDataGroupInfo(FItems[Index]); +end; + +function TcxDataGroups.GetItemCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxDataGroups.GetRowCount: Integer; +var + AItem: TcxDataGroupInfo; + I, ARowIndex: Integer; +begin + if Count > 0 then + begin + I := Count - 1; + AItem := Items[I]; + ARowIndex := AItem.RowIndex; + Result := ARowIndex + 1; + AItem := GetTopVisibleItem(ARowIndex, I); + if AItem.Expanded then + Inc(Result, AItem.EndRecordListIndex - AItem.BeginRecordListIndex + 1); // only for Data rows + end + else + Result := 0; +end; + +function TcxDataGroups.GetRowInfo(ARowIndex: Integer): TcxGroupsRowInfo; +var + AItem: TcxDataGroupInfo; +begin + Result.Expanded := False; + Result.Level := 0; + Result.RecordListIndex := 0; + if Find(ARowIndex, AItem) <> -1 then // Group + begin + Result.Level := AItem.Level; + Result.Expanded := AItem.Expanded; + Result.RecordListIndex := GetDataRecordListIndex(AItem); + end + else + if AItem <> nil then + begin + Result.Level := LevelCount; + Result.Expanded := False; + Result.RecordListIndex := AItem.BeginRecordListIndex + (ARowIndex - AItem.RowIndex - 1); + end; +end; + +function TcxDataGroups.GetTopVisibleItem(ARowIndex: Integer; var ACurIndex: Integer): TcxDataGroupInfo; +var + I, J: Integer; + AMaxLevel: Integer; + AItem: TcxDataGroupInfo; +begin + I := ACurIndex; + J := I; + AMaxLevel := Items[I].Level; + repeat + AItem := Items[I]; + if AItem.RowIndex <> ARowIndex then + Break; + // check level + if AItem.Level < AMaxLevel then + begin + AMaxLevel := AItem.Level; + if not AItem.Expanded then + J := I; + end; + if AItem.Level = 0 then + Break; + Dec(I); + until False; + Result := Items[J]; + ACurIndex := J; +end; + +procedure TcxDataGroups.Rebuild; +var + ACurIndex, ARowIndex: Integer; + + procedure SubItems(ALevel: Integer; AVisible: Boolean); + var + AItem: TcxDataGroupInfo; + begin + Inc(ACurIndex); + while ACurIndex < Count do + begin + AItem := Items[ACurIndex]; + if AItem.Level = ALevel then + begin + AItem.RowIndex := ARowIndex; + if AVisible and AItem.Expanded and (AItem.Level = (LevelCount - 1)) then + Inc(ARowIndex, AItem.EndRecordListIndex - AItem.BeginRecordListIndex + 1) + else + begin + if AVisible and AItem.Expanded then + Inc(ARowIndex); + SubItems(AItem.Level + 1, AVisible and AItem.Expanded); + end; + end + else + begin + if AVisible then Dec(ARowIndex); + Dec(ACurIndex); + Break; + end; + Inc(ACurIndex); + if AVisible then Inc(ARowIndex); + end; + end; + +begin + ACurIndex := -1; + ARowIndex := 0; + SubItems(0, True); +end; + +procedure TcxDataGroups.SetItem(AIndex: Integer; AItem: TcxDataGroupInfo); +begin + FItems[AIndex] := AItem; +end; + +{ TcxDataFocusingInfo } + +constructor TcxDataFocusingInfo.Create(ADataControllerInfo: TcxCustomDataControllerInfo); +begin + inherited Create; + FDataControllerInfo := ADataControllerInfo; + FLevel := -1; + FPrevRecordIndex := -1; + FRecordIndex := -1; + FRowIndex := -1; +end; + +procedure TcxDataFocusingInfo.Assign(AFocusingInfo: TcxDataFocusingInfo); +begin + FLevel := AFocusingInfo.Level; + FPrevRecordIndex := AFocusingInfo.FPrevRecordIndex; + FRecordIndex := AFocusingInfo.RecordIndex; + FRowIndex := AFocusingInfo.RowIndex; + FChangedFlag := False; + FPrevNewItemRowFocused := False; +end; + +procedure TcxDataFocusingInfo.Clear; +begin + FLevel := -1; + FRecordIndex := -1; + FRowIndex := -1; +end; + +function TcxDataFocusingInfo.IsEqual(AFocusingInfo: TcxDataFocusingInfo): Boolean; +begin + Result := (Self.RecordIndex = AFocusingInfo.RecordIndex) and + (Self.Level = AFocusingInfo.Level) {and + (Self.RowIndex = AFocusingInfo.RowIndex)}; + if Result and (dcicSorting in FDataControllerInfo.FChanges) and + (Self.RowIndex <> AFocusingInfo.RowIndex) then + Result := False; +end; + +procedure TcxDataFocusingInfo.ResetPos; +begin + FLevel := -1; + FRecordIndex := FDataControllerInfo.DataController.GetRecordIndex; +end; + +procedure TcxDataFocusingInfo.SavePos; +begin + if RowIndex <> -1 then + begin + Level := FDataControllerInfo.GetRowInfo(RowIndex).Level; + RecordIndex := FDataControllerInfo.DataController.GetRecordIndex; + end + else + begin + Level := -1; + RecordIndex := -1; + end; + FPrevRecordIndex := FRecordIndex; +end; + +{ TcxDataExpandingInfos } + +constructor TcxDataExpandingInfos.Create; +begin + inherited Create; + FFields := TList.Create; + FItems := TList.Create; +end; + +destructor TcxDataExpandingInfos.Destroy; +begin + Clear; + FItems.Free; + FFields.Free; + inherited Destroy; +end; + +procedure TcxDataExpandingInfos.AddField(AField: TcxCustomDataField); +begin + if Find(AField) = -1 then + begin + FFields.Add(AField); + ClearValues; + end + else + InvalidOperation(cxSDataItemExistError); +end; + +procedure TcxDataExpandingInfos.AddItem(ALevel: Integer; const AValue: Variant; + AState: TcxDataExpandingInfoStateSet); +var + P: PcxDataExpandingInfo; +begin + New(P); + FItems.Add(P); + P.Level := ALevel; + P.Value := AValue; + P.State := AState; +end; + +procedure TcxDataExpandingInfos.CheckField(AField: TcxCustomDataField); +var + I: Integer; +begin + for I := 0 to FieldCount - 1 do + if Fields[I] = AField then + begin + Clear; + Exit; + end; +end; + +procedure TcxDataExpandingInfos.Clear; +begin + ClearFields; + ClearValues; + FSaveStates := []; +end; + +procedure TcxDataExpandingInfos.ClearFields; +begin + FFields.Clear; +end; + +procedure TcxDataExpandingInfos.ClearValues; +var + I: Integer; +begin + for I := 0 to FItems.Count - 1 do + Dispose(PcxDataExpandingInfo(FItems[I])); + FItems.Clear; +end; + +function TcxDataExpandingInfos.Find(AField: TcxCustomDataField): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to FieldCount - 1 do + if Fields[I] = AField then + begin + Result := I; + Break; + end; +end; + +function TcxDataExpandingInfos.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxDataExpandingInfos.GetEmpty: Boolean; +begin + Result := (Count = 0) or (FieldCount = 0); +end; + +function TcxDataExpandingInfos.GetFieldCount: Integer; +begin + Result := FFields.Count; +end; + +function TcxDataExpandingInfos.GetField(Index: Integer): TcxCustomDataField; +begin + Result := TcxCustomDataField(FFields[Index]); +end; + +function TcxDataExpandingInfos.GetItem(Index: Integer): PcxDataExpandingInfo; +begin + Result := PcxDataExpandingInfo(FItems[Index]); +end; + +{ TcxDataSelection } + +constructor TcxDataSelection.Create(ADataController: TcxCustomDataController); +begin + inherited Create; + FDataController := ADataController; + FFields := TList.Create; + FItems := TList.Create; + FAnchorRowIndex := -1; +end; + +destructor TcxDataSelection.Destroy; +begin + Clear; + FItems.Free; + FFields.Free; + inherited Destroy; +end; + +procedure TcxDataSelection.Add(AIndex, ARowIndex, ARecordIndex, ALevel: Integer); +begin + InternalAdd(AIndex, ARowIndex, ARecordIndex, ALevel); + Changed; +end; + +procedure TcxDataSelection.AddField(AField: TcxCustomDataField); +begin + FFields.Add(AField); +end; + +procedure TcxDataSelection.Clear; +begin + InternalClear; + Changed; +end; + +procedure TcxDataSelection.ClearAll; +begin + ClearAnchor; + InternalClear; + Changed; +end; + +procedure TcxDataSelection.ClearFields; +begin + FFields.Clear; +end; + +procedure TcxDataSelection.Delete(AIndex: Integer); +begin + InternalDelete(AIndex); + Changed; +end; + +function TcxDataSelection.FindByGroupIndex(AGroupIndex: Integer): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Count - 1 do + if (Items[I].Level = -1) {It's Group} and + (Items[I].RecordIndex = AGroupIndex) then + begin + Result := I; + Break; + end; +end; + +function TcxDataSelection.FindByRecordIndex(ARecordIndex: Integer): Integer; +var + I: Integer; +begin + // TODO: to optimize + Result := -1; + for I := 0 to Count - 1 do + if (Items[I].Level <> -1) {It's Detail} and + (Items[I].RecordIndex = ARecordIndex) then + begin + Result := I; + Break; + end; +end; + +function TcxDataSelection.FindByRowIndex(ARowIndex: Integer; var AIndex: Integer): Boolean; +var + L, H, I, C: Integer; +begin + AIndex := 0; + Result := False; + L := 0; + H := Count - 1; + if L <= H then + repeat + I := (L + H) div 2; + C := Items[I].RowIndex - ARowIndex; + if C = 0 then + begin + AIndex := I; + Result := True; + Break; + end + else + if C < 0 then + L := I + 1 + else + H := I - 1; + if L > H then + begin + AIndex := L; + Break; + end; + until False; +end; + +function TcxDataSelection.IsRecordSelected(ARecordIndex: Integer): Boolean; +begin + Result := FindByRecordIndex(ARecordIndex) <> -1; +end; + +function TcxDataSelection.IsRowSelected(ARowIndex: Integer): Boolean; +var + I: Integer; +begin + Result := FindByRowIndex(ARowIndex, I); +end; + +procedure TcxDataSelection.Sort; +begin + FItems.Sort(CompareSelectionList); +end; + +procedure TcxDataSelection.Changed; +begin + if Assigned(FOnChanged) then FOnChanged; +end; + +procedure TcxDataSelection.CheckAfterFiltering; +var + I: Integer; +begin + // TODO: opt + for I := Count - 1 downto 0 do + if Items[I].Level <> -1 then + if DataController.DataControllerInfo.GetInternalRecordListIndex(Items[I].RecordIndex) = -1 then + Delete(I); +end; + +procedure TcxDataSelection.ClearAnchor; +begin + FAnchorRowIndex := -1; +end; + +procedure TcxDataSelection.InternalAdd(AIndex, ARowIndex, ARecordIndex, ALevel: Integer); +var + P: PcxDataSelectionInfo; +begin + New(P); + P.Level := ALevel; + P.RecordIndex := ARecordIndex; + P.RowIndex := ARowIndex; + if AIndex = -1 then + FItems.Add(P) + else + FItems.Insert(AIndex, P); +end; + +procedure TcxDataSelection.InternalClear; +var + I: Integer; +begin + ClearFields; + for I := 0 to FItems.Count - 1 do + Dispose(PcxDataSelectioninfo(FItems[I])); + FItems.Clear; +end; + +procedure TcxDataSelection.InternalDelete(AIndex: Integer); +var + PInfo: PcxDataSelectioninfo; +begin + PInfo := PcxDataSelectioninfo(FItems[AIndex]); + if PInfo.RowIndex = FAnchorRowIndex then + ClearAnchor; + Dispose(PInfo); + FItems.Delete(AIndex); +end; + +procedure TcxDataSelection.SetInternalCount(ACount: Integer); +var + I: Integer; +begin + if ACount < Count then + begin + for I := Count - 1 downto ACount do + InternalDelete(I); + end + else + if ACount > Count then + begin + for I := Count to ACount - 1 do + InternalAdd(-1, I, I, 0); + end; +end; + +function TcxDataSelection.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxDataSelection.GetField(Index: Integer): TcxCustomDataField; +begin + Result := TcxCustomDataField(FFields[Index]); +end; + +function TcxDataSelection.GetFieldCount: Integer; +begin + Result := FFields.Count; +end; + +function TcxDataSelection.GetItem(Index: Integer): PcxDataSelectionInfo; +begin + Result := PcxDataSelectionInfo(FItems[Index]); +end; + +{ TcxCustomDataControllerInfo } + +constructor TcxCustomDataControllerInfo.Create(ADataController: TcxCustomDataController); +begin + inherited Create; + FDataController := ADataController; + FRecordList := TList.Create; + FGroupingFieldList := TcxGroupingFieldList.Create; + FGroupingFieldList.OnChanged := GroupingChanged; + FSortingFieldList := TcxSortingFieldList.Create; + FSortingFieldList.OnChanged := SortingChanged; + FTotalSortingFieldList := TcxSortingFieldList.Create; + FDataGroups := TcxDataGroups.Create; + FExpandingInfo := TcxDataExpandingInfos.Create; + FFocusingInfo := TcxDataFocusingInfo.Create(Self); + FPrevFocusingInfo := TcxDataFocusingInfo.Create(Self); + FSelection := DataController.GetDataSelectionClass.Create(DataController); + FSelection.OnChanged := SelectionChanged; +end; + +destructor TcxCustomDataControllerInfo.Destroy; +begin + FDataGroups.Free; + FTotalSortingFieldList.Free; + FSortingFieldList.Free; + FGroupingFieldList.Free; + FRecordList.Free; + FFocusingInfo.Free; + FPrevFocusingInfo.Free; + FExpandingInfo.Free; + FSelection.Free; + inherited Destroy; +end; + +procedure TcxCustomDataControllerInfo.BeginUpdate; +begin + Inc(FLockCount); +end; + +procedure TcxCustomDataControllerInfo.EndUpdate; +begin + Dec(FLockCount); + CheckChanges; +end; + +procedure TcxCustomDataControllerInfo.CheckChanges; +begin + if (FChanges <> []) and (LockCount = 0) then + Update; +end; + +procedure TcxCustomDataControllerInfo.CheckRowIndex(ARowIndex: Integer); +begin + if not ((0 <= ARowIndex) and (ARowIndex < GetRowCount)) then + InvalidOperation(cxSDataRowIndexError); +end; + +procedure TcxCustomDataControllerInfo.Refresh; +begin + FChanges := FChanges + [dcicLoad]; + if not DataController.LockOnAfterSummary then + FChanges := FChanges + [dcicSummary]; + if SortingFieldList.Count <> 0 then + FChanges := FChanges + [dcicSorting]; + if GroupingFieldList.Count <> 0 then + FChanges := FChanges + [dcicGrouping]; + CheckChanges; +end; + +procedure TcxCustomDataControllerInfo.RefreshFocused; +begin + FChanges := FChanges + [dcicResetFocusedRow]; + FFocusingInfo.ResetPos; + CheckChanges; +end; + +procedure TcxCustomDataControllerInfo.RefreshSummary(ARedrawOnly: Boolean); +begin + if ARedrawOnly and not IsSortingBySummary then + FChanges := FChanges + [dcicView] + else + FChanges := FChanges + [dcicSummary]; + if IsSortingBySummary then + FChanges := FChanges + [dcicGrouping]; +{ if IsSortBySummary <> FIsSortBySummary then + begin + FIsSortBySummary := IsSortBySummary; + DataController.DoSortBySummaryChanged; + //FChanges := FChanges + [dcicGrouping]; + end;} + CheckChanges; +end; + +// Notify + +procedure TcxCustomDataControllerInfo.ExpandingChanged; +begin + FChanges := FChanges + [dcicExpanding]; + FExpandingFlag := True; +end; + +procedure TcxCustomDataControllerInfo.FocusedRecordChanged(AChangedFlag: Boolean); +begin + FChanges := FChanges + [dcicFocusedRecord]; //? + if AChangedFlag then + FPrevFocusingInfo.FChangedFlag := True; +end; + +procedure TcxCustomDataControllerInfo.GroupingChanged; +begin + FChanges := FChanges + [dcicSorting, dcicGrouping, dcicSummary]; +end; + +procedure TcxCustomDataControllerInfo.SelectionChanged; +begin + FChanges := FChanges + [dcicSelection]; + if [soSelectedRecords, soMultipleSelectedRecords] * DataController.Summary.Options <> [] then + FChanges := FChanges + [dcicSummary]; +end; + +procedure TcxCustomDataControllerInfo.SortingChanged; +begin + FChanges := FChanges + [dcicSorting]; +end; + +// Structure + +procedure TcxCustomDataControllerInfo.RemoveField(AField: TcxCustomDataField); +begin + FSortingFieldList.ChangeSorting(AField, soNone); + if FGroupingFieldList.Find(AField) <> -1 then FSelection.ClearAll; + FGroupingFieldList.ChangeGrouping(AField, -1); + FGroupingFieldList.UpdateSorting(FSortingFieldList); + FExpandingInfo.CheckField(AField); + CheckChanges; +end; + +procedure TcxCustomDataControllerInfo.UpdateField(AField: TcxCustomDataField); +begin + FChanges := FChanges + [dcicView]; + FSortingFieldList.CheckField(AField); + if FGroupingFieldList.Find(AField) <> -1 then FSelection.ClearAll; + FGroupingFieldList.CheckField(AField); + FExpandingInfo.CheckField(AField); + CheckChanges; +end; + +// Sorting + +procedure TcxCustomDataControllerInfo.ChangeSortIndex(AField: TcxCustomDataField; ASortIndex: Integer); +var + ACurIndex: Integer; +begin + ACurIndex := FSortingFieldList.Find(AField); + if ASortIndex < 0 then ASortIndex := 0; + if ASortIndex >= FSortingFieldList.Count then + ASortIndex := FSortingFieldList.Count - 1; + if ACurIndex <> ASortIndex then + begin + FSortingFieldList.Move(ACurIndex, ASortIndex); + DataController.BeforeSorting; + DataController.FSortingChanged := True; + CheckChanges; + end; +end; + +procedure TcxCustomDataControllerInfo.ChangeSorting(AField: TcxCustomDataField; + ASortOrder: TcxDataSortOrder); +begin + FSortingFieldList.ChangeSorting(AField, ASortOrder); + FGroupingFieldList.UpdateSorting(FSortingFieldList); + CheckChanges; +end; + +procedure TcxCustomDataControllerInfo.ClearSorting(AKeepGroupedItems: Boolean); +var + I, APrevCount: Integer; +begin + APrevCount := FSortingFieldList.Count; + if AKeepGroupedItems then + begin + for I := FSortingFieldList.Count - 1 downto 0 do + if FGroupingFieldList.Find(FSortingFieldList[I].Field) = -1 then + FSortingFieldList.Delete(I); + end + else + begin + FSortingFieldList.Clear; + FGroupingFieldList.UpdateSorting(FSortingFieldList); + end; + if FSortingFieldList.Count <> APrevCount then + begin + DataController.BeforeSorting; + DataController.FSortingChanged := True; + end; + CheckChanges; +end; + +// Grouping + +procedure TcxCustomDataControllerInfo.ChangeExpanding(ARowIndex: Integer; + AExpanded, ARecursive: Boolean); +begin + CheckRowIndex(ARowIndex); + if IsGrouped and not IsAlwaysExpanded then + begin + // TODO: CheckBrowseMode; if needed + if not AExpanded and (FocusedRowIndex <> -1) and + DataController.Groups.HasAsParent(FocusedRowIndex, ARowIndex) then + DataController.CheckBrowseMode; + DataGroups.ChangeExpanding(ARowIndex, AExpanded, ARecursive); + ExpandingChanged; + BeginUpdate; + try + if not AExpanded then + CheckAfterCollapsing; + finally + EndUpdate; + end; + end; +end; + +procedure TcxCustomDataControllerInfo.ChangeGrouping(AField: TcxCustomDataField; + AGroupIndex: Integer); +begin + FGroupingFieldList.ChangeGrouping(AField, AGroupIndex); + FGroupingFieldList.UpdateSorting(FSortingFieldList); + CheckChanges; +end; + +procedure TcxCustomDataControllerInfo.ClearGrouping; +begin + FGroupingFieldList.Clear; + CheckChanges; +end; + +procedure TcxCustomDataControllerInfo.FullCollapse; +begin + if IsGrouped and not IsAlwaysExpanded then + begin + DataGroups.FullExpanding(False); + ExpandingChanged; + BeginUpdate; + try + CheckAfterCollapsing; + finally + EndUpdate; + end; + end; +end; + +procedure TcxCustomDataControllerInfo.FullExpand; +begin + if IsGrouped and not IsAlwaysExpanded then + begin + DataGroups.FullExpanding(True); + ExpandingChanged; + CheckChanges; + end; +end; + +// View Data + +function TcxCustomDataControllerInfo.GetNearestRowIndex(ARowIndex: Integer): Integer; +begin + // TODO: ADeleteSelection + CheckRowIndex(ARowIndex); + if not IsGrouped then + begin + if (ARowIndex + 1) > (GetRowCount - 1) then // is last + Result := ARowIndex - 1 + else + Result := ARowIndex + 1; + end + else + begin + if ((ARowIndex + 1) <= (GetRowCount - 1)) and + (GetRowInfo(ARowIndex + 1).Level = GetRowInfo(ARowIndex).Level) then + Result := ARowIndex + 1 + else + begin + if ((ARowIndex - 1) >= 0) and + (GetRowInfo(ARowIndex - 1).Level = GetRowInfo(ARowIndex).Level) then + Result := ARowIndex - 1 + else + if (ARowIndex + 1) <= (GetRowCount - 1) then + Result := ARowIndex + 1 + else + if (ARowIndex - 1) >= 0 then + Result := ARowIndex - 1 + else + Result := ARowIndex; + end; + end; +end; + +function TcxCustomDataControllerInfo.GetRowCount: Integer; +begin + if IsGrouped then + Result := DataGroups.RowCount + else + Result := FRecordList.Count; +end; + +function TcxCustomDataControllerInfo.GetRowIndexByRecordIndex(ARecordIndex: Integer; + AMakeVisible: Boolean): Integer; +var + ARecordListIndex, AGroupIndex: Integer; +begin + Result := -1; + ARecordListIndex := GetInternalRecordListIndex(ARecordIndex); + if IsGrouped then + begin + AGroupIndex := DataGroups.FindByIndex(ARecordListIndex, DataGroups.LevelCount - 1); + if AGroupIndex <> -1 then + Result := LocateDetail(AGroupIndex, ARecordListIndex, AMakeVisible); + end + else + Result := ARecordListIndex; + if FExpandingFlag and AMakeVisible then + CheckChanges; +end; + +function TcxCustomDataControllerInfo.GetRowInfo(ARowIndex: Integer): TcxRowInfo; +var + AGroupsRowInfo: TcxGroupsRowInfo; +begin + CheckRowIndex(ARowIndex); + if IsGrouped then + AGroupsRowInfo := DataGroups.RowInfo[ARowIndex] + else + begin + AGroupsRowInfo.Level := 0; + AGroupsRowInfo.Expanded := False; + AGroupsRowInfo.RecordListIndex := ARowIndex; + end; + Result.Expanded := AGroupsRowInfo.Expanded; + Result.Level := AGroupsRowInfo.Level; + Result.RecordIndex := GetInternalRecordIndex(AGroupsRowInfo.RecordListIndex); +end; + +// Selection + +procedure TcxCustomDataControllerInfo.ChangeRowSelection(ARowIndex: Integer; ASelection: Boolean); +var + AIndex, AGroupIndex: Integer; + ARowInfo: TcxRowInfo; + AItem: TcxDataGroupInfo; +begin + CheckRowIndex(ARowIndex); + if Selection.FindByRowIndex(ARowIndex, AIndex) then + begin + if not ASelection then + Selection.Delete(AIndex); + end + else + begin + if ASelection and DataController.CanSelectRow(ARowIndex) then + begin + AGroupIndex := DataGroups.Find(ARowIndex, AItem); + if AGroupIndex <> -1 then // It's Group + Selection.Add(AIndex, ARowIndex, AGroupIndex, -1) + else + begin + ARowInfo := GetRowInfo(ARowIndex); + Selection.Add(AIndex, ARowIndex, ARowInfo.RecordIndex, ARowInfo.Level); + end; + end; + end; + CheckChanges; +end; + +procedure TcxCustomDataControllerInfo.ClearSelection; +begin + Selection.Clear; + CheckChanges; +end; + +procedure TcxCustomDataControllerInfo.ClearSelectionAnchor; +begin + Selection.ClearAnchor; +end; + +function TcxCustomDataControllerInfo.GetSelectedCount: Integer; +begin + Result := FSelection.Count; +end; + +function TcxCustomDataControllerInfo.GetSelectedRowIndex(Index: Integer): Integer; +begin + Result := Selection[Index].RowIndex; +end; + +function TcxCustomDataControllerInfo.IsRowSelected(ARowIndex: Integer): Boolean; +begin + CheckRowIndex(ARowIndex); + Result := Selection.IsRowSelected(ARowIndex); +end; + +function TcxCustomDataControllerInfo.CanFocusedRowChanging(ARowIndex: Integer): Boolean; +begin + FInCanFocusedRowChanging := True; + try + if ARowIndex <> -1 then + Result := DataController.CanFocusRecord(GetRowInfo(ARowIndex).RecordIndex) + else + Result := DataController.CanFocusRecord(-1); + finally + FInCanFocusedRowChanging := False; + end; +end; + +procedure TcxCustomDataControllerInfo.CorrectFocusedRow(ARowIndex: Integer); +begin + FFocusingInfo.Clear; + DoChangeFocusedRow(ARowIndex, False); +end; + +procedure TcxCustomDataControllerInfo.DoChangeFocusedRow(AValue: Integer; AIsInternal: Boolean); + + procedure CheckFocusedRanges(AFocusingInfo: TcxDataFocusingInfo); + begin + if AFocusingInfo.FRowIndex > (GetRowCount - 1) then + AFocusingInfo.FRowIndex := -1; + end; + + procedure SaveFocusedPos; + begin + FFocusingInfo.SavePos; + if (FFocusingInfo.RowIndex <> -1) and + (GetRowInfo(FFocusingInfo.RowIndex).RecordIndex <> FFocusingInfo.RecordIndex) then + begin + { error locate - Tried to set focus on a row, but it turned out, + that another row was focused (it is possible for DB, for example: + the key field is incorrect) } + FFocusingInfo.FRowIndex := FindFocusedRow(False); + CheckFocusedRanges(FFocusingInfo); + end; + end; + +var + AAllowChangeFocusedRow: Boolean; +begin + if AValue < -1 then AValue := -1; + if AValue > (GetRowCount - 1) then AValue := GetRowCount - 1; + if FFocusingInfo.RowIndex <> AValue then + begin + FFocusingFlag := True; + AAllowChangeFocusedRow := False; + try + if not (dcicFocusedRow in FChanges) then + FPrevFocusingInfo.Assign(FFocusingInfo); + AAllowChangeFocusedRow := AIsInternal or CanFocusedRowChanging(AValue); + if AAllowChangeFocusedRow then + begin + DataController.DoBeforeFocusedRowChange(AValue); + FFocusingInfo.FRowIndex := AValue; + end; + finally + CheckFocusedRanges(FPrevFocusingInfo); + CheckFocusedRanges(FFocusingInfo); + if (FPrevFocusingInfo.FRowIndex <> -1) or AAllowChangeFocusedRow then + SaveFocusedPos; + if not FFocusingInfo.IsEqual(FPrevFocusingInfo) then + begin + FChanges := FChanges + [dcicFocusedRecord, dcicFocusedRow]; + if DataController.IsFocusedSelectedMode and + (soSelectedRecords in DataController.Summary.Options) then + FChanges := FChanges + [dcicSummary]; + DataController.ResetNewItemRowFocused; + DataController.CheckDataSetCurrent; + DataController.SyncSelected(True); + end; + FFocusingFlag := False; + end; + end; +end; + +procedure TcxCustomDataControllerInfo.DoFilter; +var + I, APrevRecordCount: Integer; + AIsIncrementalFilter, AIsFiltering, AIsOnFilterRecord: Boolean; +begin + AIsIncrementalFilter := DataController.IsIncrementalFilter; + AIsFiltering := DataController.Filter.IsFiltering; + AIsOnFilterRecord := not DataController.IsGridMode and DataController.IsFilterRecord; + if not (AIsIncrementalFilter or AIsFiltering or AIsOnFilterRecord) then Exit; + APrevRecordCount := FRecordList.Count; + for I := FRecordList.Count - 1 downto 0 do + if I <> DataController.Provider.FEditingRecordIndex then // TODO: + begin + if AIsOnFilterRecord and + not DataController.DoFilterRecord(I) then + begin + FRecordList.Delete(I); + Continue; + end; + if AIsIncrementalFilter and + not DataController.DoIncrementalFilterRecord(I) then + begin + FRecordList.Delete(I); + Continue; + end; + if AIsFiltering and + not DataController.Filter.DoFilterRecord(I) then + begin + FRecordList.Delete(I); + Continue; + end; + end; + if FRecordList.Count <> APrevRecordCount then + begin + FSelection.CheckAfterFiltering; + if DataController.FCheckFocusingAfterFilterNeeded then + begin + DataController.FCheckFocusingAfterFilterNeeded := False; + DataController.FFilterChanged := True; + end; + end; +end; + +type + TcxDataGroupCompareInfo = record + Info: TcxDataGroupInfo; + RecordIndex: Integer; + end; + PcxDataGroupCompareInfo = ^TcxDataGroupCompareInfo; + +procedure TcxCustomDataControllerInfo.DoGrouping; +var + ACurLevels: TList; + ARowIndex: Integer; + ARecordIndex: Integer; + I, J: Integer; + + procedure BeginBuilding; + var + I: Integer; + ARecordIndex: Integer; + PCompareInfo: PcxDataGroupCompareInfo; + begin + ACurLevels := TList.Create; + ARecordIndex := GetInternalRecordIndex(0); + for I := 0 to FDataGroups.LevelCount - 1 do + begin + New(PCompareInfo); + PCompareInfo.RecordIndex := ARecordIndex; + PCompareInfo.Info := DataGroups.AddEmpty; + PCompareInfo.Info.RowIndex := ARowIndex; + PCompareInfo.Info.Expanded := False; + PCompareInfo.Info.Level := I; + if I < (FDataGroups.LevelCount - 1) then + PCompareInfo.Info.BeginRecordListIndex := I + 1 + else + PCompareInfo.Info.BeginRecordListIndex := 0; + ACurLevels.Add(PCompareInfo); + end; + end; + + procedure CloseGroups(ARecordListIndex, ALevelIndex: Integer); + begin + if ALevelIndex >= (FDataGroups.LevelCount - 1) then + begin + PcxDataGroupCompareInfo(ACurLevels[ALevelIndex]).Info.EndRecordListIndex := ARecordListIndex - 1; + + PcxDataGroupCompareInfo(ACurLevels[ALevelIndex]).Info := DataGroups.AddEmpty; + PcxDataGroupCompareInfo(ACurLevels[ALevelIndex]).Info.RowIndex := ARowIndex; + PcxDataGroupCompareInfo(ACurLevels[ALevelIndex]).Info.Expanded := False; + PcxDataGroupCompareInfo(ACurLevels[ALevelIndex]).Info.Level := ALevelIndex; + PcxDataGroupCompareInfo(ACurLevels[ALevelIndex]).Info.BeginRecordListIndex := ARecordListIndex; + PcxDataGroupCompareInfo(ACurLevels[ALevelIndex]).RecordIndex := ARecordIndex; + end + else + begin + PcxDataGroupCompareInfo(ACurLevels[ALevelIndex]).Info.EndRecordListIndex := DataGroups.Count - 1; + + PcxDataGroupCompareInfo(ACurLevels[ALevelIndex]).Info := DataGroups.AddEmpty; + PcxDataGroupCompareInfo(ACurLevels[ALevelIndex]).Info.RowIndex := ARowIndex; + PcxDataGroupCompareInfo(ACurLevels[ALevelIndex]).Info.Expanded := False; + PcxDataGroupCompareInfo(ACurLevels[ALevelIndex]).Info.Level := ALevelIndex; + PcxDataGroupCompareInfo(ACurLevels[ALevelIndex]).Info.BeginRecordListIndex := DataGroups.Count; + PcxDataGroupCompareInfo(ACurLevels[ALevelIndex]).RecordIndex := ARecordIndex; + CloseGroups(ARecordListIndex, ALevelIndex + 1); + end; + end; + + procedure CloseBuilding; + var + I, AEndRecordListIndex: Integer; + begin + AEndRecordListIndex := FRecordList.Count - 1; + for I := FDataGroups.LevelCount - 1 downto 0 do + begin + PcxDataGroupCompareInfo(ACurLevels[I]).Info.EndRecordListIndex := AEndRecordListIndex; + if I = (FDataGroups.LevelCount - 1) then + AEndRecordListIndex := DataGroups.Count - 1 + else + AEndRecordListIndex := PcxDataGroupCompareInfo(ACurLevels[I]).Info.BeginRecordListIndex - 1; + end; + end; + + procedure EndBuilding; + var + I: Integer; + begin + for I := 0 to ACurLevels.Count - 1 do + Dispose(PcxDataGroupCompareInfo(ACurLevels[I])); + ACurLevels.Free; + end; + +begin + FDataGroups.Clear; + for I := 0 to GroupingFieldList.Count - 1 do + FDataGroups.AddField(GroupingFieldList[I].Field); + if (FRecordList.Count > 0) and (FDataGroups.LevelCount > 0) then + begin + ARowIndex := 0; + BeginBuilding; + try + PrepareSorting; + try + for I := 1 to FRecordList.Count - 1 do + begin + ARecordIndex := GetInternalRecordIndex(I); + for J := 0 to FDataGroups.LevelCount - 1 do + begin + if CompareGroupRecords(PcxDataGroupCompareInfo(ACurLevels[J]).RecordIndex, ARecordIndex, J) <> 0 then + begin + if J = 0 then Inc(ARowIndex); + CloseGroups(I, J); + Break; + end; + end; + end; + finally + UnprepareSorting; + end; + CloseBuilding; + finally + EndBuilding; + end; + end; +end; + +procedure TcxCustomDataControllerInfo.DoLoad; +var + I: Integer; +begin + ListSetCount(FRecordList, DataController.RecordCount); + for I := 0 to FRecordList.Count - 1 do + FRecordList[I] := Pointer(I); +end; + +procedure TcxCustomDataControllerInfo.DoSort; +begin + FTotalSortingFieldList.Clear; + FTotalSortingFieldList.AppendFrom(GroupingFieldList); + FTotalSortingFieldList.AppendFrom(SortingFieldList); + if not DataController.IsGridMode and (FRecordList.Count > 0) then + begin + PrepareSorting; + try + if DataController.IsProviderMode and + DataController.Provider.IsCustomSorting then + DataController.Provider.CustomSort + else + QuickSortList(FRecordList.List, 0, FRecordList.Count - 1, CompareRecords); + finally + UnprepareSorting; + end; + end; +end; + +procedure TcxCustomDataControllerInfo.DoBeginSummary; +begin + // Footer Summary can be calculated before DoSort if soSelectedRecords=False + if not IsSummaryForSelectedRecords then + DataController.Summary.BeginCalculate; +end; + +procedure TcxCustomDataControllerInfo.DoEndSummary; +begin + if not IsSummaryForSelectedRecords then + DataController.Summary.EndCalculate + else + DataController.Summary.Calculate; +end; + +function TcxCustomDataControllerInfo.FindDataGroup(ARecordListIndex: Integer): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to DataGroups.Count - 1 do + if (DataGroups[I].Level = (DataGroups.LevelCount - 1)) and + (DataGroups[I].BeginRecordListIndex <= ARecordListIndex) and + (ARecordListIndex <= DataGroups[I].EndRecordListIndex) then + begin + Result := I; + Break; + end; +end; + +function TcxCustomDataControllerInfo.FindFocusedRow(ANearest: Boolean): Integer; + + function FindFocused(ARecordListIndex, AGroupIndex: Integer): Integer; + begin + if FFocusingInfo.Level = -1 then + begin + if DataGroups[AGroupIndex].BeginRecordListIndex <> ARecordListIndex then // Seek Detail + Result := LocateDetail(AGroupIndex, ARecordListIndex, True) + else + Result := LocateGroupByLevel(AGroupIndex, -1); + end + else + begin + if FFocusingInfo.Level = DataGroups.LevelCount then // Seek Detail + Result := LocateDetail(AGroupIndex, ARecordListIndex, True) + else + begin + if DataGroups[AGroupIndex].BeginRecordListIndex = ARecordListIndex then + Result := LocateGroupByLevel(AGroupIndex, FFocusingInfo.Level) + else + Result := LocateDetail(AGroupIndex, ARecordListIndex, True) + end; + end; + end; + + function FindParentGroup(AIndex, ALevel: Integer): Integer; + var + I: Integer; + begin + Result := -1; + for I := AIndex downto 0 do + if DataGroups[I].Level = ALevel then + begin + Result := I; + Break; + end; + end; + + function FindNearest(ARecordListIndex, AGroupIndex: Integer): Integer; + var + I, ALevel: Integer; + AItem: TcxDataGroupInfo; + begin + if AGroupIndex <> -1 then + begin + I := AGroupIndex; + AItem := DataGroups.GetTopVisibleItem(DataGroups[AGroupIndex].RowIndex, I); + ALevel := FFocusingInfo.Level; + if ALevel = DataGroups.LevelCount then // Detail + begin + if (AGroupIndex = I) and DataGroups[AGroupIndex].Expanded then + begin + Result := AItem.RowIndex; + Inc(Result, ARecordListIndex - AItem.BeginRecordListIndex + 1); + Exit; + end + else + Dec(ALevel); + end; + if (ALevel < 0) and (AGroupIndex = I) then + begin + Result := AItem.RowIndex; + Exit; + end; + AGroupIndex := FindParentGroup(AGroupIndex, ALevel); + if AGroupIndex <> -1 then + Result := DataGroups[AGroupIndex].RowIndex + else + Result := -1; + end + else + Result := -1; + end; + +var + I: Integer; + ARecordListIndex, AGroupIndex: Integer; +begin + Result := -1; + if FFocusingInfo.RecordIndex < 0 then Exit; + ARecordListIndex := -1; + for I := 0 to FRecordList.Count - 1 do + if GetInternalRecordIndex(I) = FFocusingInfo.RecordIndex then + begin + ARecordListIndex := I; + Break; + end; + if ARecordListIndex <> -1 then + if IsGrouped then + begin + AGroupIndex := FindDataGroup(ARecordListIndex); // LastLevel Group + if ANearest then + Result := FindNearest(ARecordListIndex, AGroupIndex) + else + Result := FindFocused(ARecordListIndex, AGroupIndex); + end + else + Result := ARecordListIndex; +end; + +procedure TcxCustomDataControllerInfo.ForwardChanges; +var + ADataControllerChanges: TcxDataControllerChanges; +begin + ADataControllerChanges := []; + if [dcicSorting, dcicView] * FChanges <> [] then + ADataControllerChanges := [dccLayout]; + if [dcicLoad, dcicGrouping, dcicExpanding] * FChanges <> [] then + ADataControllerChanges := ADataControllerChanges + [dccData]; + if [dcicFocusedRow, dcicResetFocusedRow, dcicFocusedRecord] * FChanges <> [] then + ADataControllerChanges := ADataControllerChanges + [dccFocus]; + if dcicSelection in FChanges then + ADataControllerChanges := ADataControllerChanges + [dccSelection]; + if dcicSummary in FChanges then + ADataControllerChanges := ADataControllerChanges + [dccSummary]; + if DataController.FGroupingChanged then + ADataControllerChanges := ADataControllerChanges + [dccGrouping]; + if DataController.FSortingChanged then + ADataControllerChanges := ADataControllerChanges + [dccSorting]; + FChanges := []; + DataController.FGroupingChanged := False; + DataController.FSortingChanged := False; + DataController.FFilterChanged := False; + DataController.FSortingBySummaryChanged := False; + DataController.Change(ADataControllerChanges); + DataController.FLoadedStorage := False; +end; + +function TcxCustomDataControllerInfo.GetInternalRecordCount: Integer; +begin + Result := FRecordList.Count; +end; + +function TcxCustomDataControllerInfo.GetInternalRecordIndex(ARecordListIndex: Integer): Integer; +begin + Result := Integer(FRecordList[ARecordListIndex]); +end; + +function TcxCustomDataControllerInfo.GetInternalRecordListIndex(ARecordIndex: Integer): Integer; +begin + Result := FRecordList.IndexOf(Pointer(ARecordIndex)); +end; + +function TcxCustomDataControllerInfo.IsAlwaysExpanded: Boolean; +begin + Result := dcoGroupsAlwaysExpanded in DataController.Options; +end; + +function TcxCustomDataControllerInfo.IsGrouped: Boolean; +begin + Result := FDataGroups.Count > 0; +end; + +function TcxCustomDataControllerInfo.IsSummaryForSelectedRecords: Boolean; +begin + Result := (soSelectedRecords in DataController.Summary.Options) or + ((soMultipleSelectedRecords in DataController.Summary.Options) and (GetSelectedCount > 1)) +end; + +function TcxCustomDataControllerInfo.LocateGroupByLevel(AGroupIndex, ALevel: Integer): Integer; + + function FindParentGroup(AIndex: Integer): Integer; + var + I, ALevel: Integer; + begin + Result := -1; + ALevel := DataGroups[AIndex].Level - 1; + for I := AIndex downto 0 do + if DataGroups[I].Level = ALevel then + begin + Result := I; + Break; + end; + end; + +var + AParentGroupIndex: Integer; +begin + repeat + if DataGroups[AGroupIndex].Level = ALevel then + Break; + AParentGroupIndex := FindParentGroup(AGroupIndex); + if (AParentGroupIndex <> -1) and (DataGroups[AParentGroupIndex].BeginRecordListIndex = AGroupIndex) then + AGroupIndex := AParentGroupIndex + else + Break; + until False; + if DataGroups.MakeVisible(AGroupIndex, False) then + ExpandingChanged; + Result := DataGroups[AGroupIndex].RowIndex; +end; + +function TcxCustomDataControllerInfo.LocateDetail(AGroupIndex, ARecordListIndex: Integer; + AMakeVisible: Boolean): Integer; +begin + if not AMakeVisible and + not (DataGroups.IsVisible(AGroupIndex) and DataGroups[AGroupIndex].Expanded) then + Result := -1 + else + begin + if AMakeVisible and DataGroups.MakeVisible(AGroupIndex, True) then + ExpandingChanged; + Result := DataGroups[AGroupIndex].RowIndex + + ARecordListIndex - DataGroups[AGroupIndex].BeginRecordListIndex + 1; + end; +end; + +procedure TcxCustomDataControllerInfo.PrepareSorting; +var + I: Integer; +begin + for I := 0 to FTotalSortingFieldList.Count - 1 do + if DataController.IsConversionNeededForCompare(FTotalSortingFieldList[I].Field) then + begin + if DataController.IsSortByDisplayTextNeeded(FTotalSortingFieldList[I].Field) then + FTotalSortingFieldList[I].Field.FNeedConversionFlag := 2 + else + FTotalSortingFieldList[I].Field.FNeedConversionFlag := 1; + end + else + FTotalSortingFieldList[I].Field.FNeedConversionFlag := -1; +end; + +procedure TcxCustomDataControllerInfo.RecalcSelection; +var + I: Integer; +begin + for I := 0 to Selection.Count - 1 do + begin + if Selection[I].Level = -1 then // It's Group + Selection[I].RowIndex := DataGroups[Selection[I].RecordIndex].RowIndex + else + Selection[I].RowIndex := GetRowIndexByRecordIndex(Selection[I].RecordIndex, False); + end; +end; + +procedure TcxCustomDataControllerInfo.ResetFocusing; +begin + if DataController.FInNotifyControl then Exit; + if (dcoFocusTopRowAfterSorting in DataController.Options) and + (DataController.FGroupingChanged or DataController.FSortingChanged or + DataController.FLoadedStorage) then + begin + DataController.FLoadedStorage := False; + FFocusingInfo.Clear; + DoChangeFocusedRow(0, False); + if Selection.Count > 0 then + Selection.ClearAll; + end; +end; + +procedure TcxCustomDataControllerInfo.SaveExpanding(ASaveStates: TcxDataExpandingInfoStateSet); + + function IsValidInfo: Boolean; + var + I: Integer; + begin + Result := (DataGroups.FieldCount = GroupingFieldList.Count) and + (DataController.RecordCount > 0); + if Result then + for I := 0 to GroupingFieldList.Count - 1 do + if DataGroups.Fields[I] <> GroupingFieldList[I].Field then + begin + Result := False; + Break; + end; + end; + + procedure AddGroup(ADataGroupInfo: TcxDataGroupInfo; AGroupIndex: Integer; AExpanded: Boolean); + var + ARecordIndex: Integer; + AInfo: TcxDataGroupInfo; + AStateSet: TcxDataExpandingInfoStateSet; + begin + // begin proc + AInfo := ADataGroupInfo; + while AInfo.Level < (DataGroups.LevelCount - 1) do + AInfo := DataGroups[AInfo.BeginRecordListIndex]; + ARecordIndex := GetInternalRecordIndex(AInfo.BeginRecordListIndex); +// if DataController.Provider.IsInserting then // !!! +// begin +// if ARecordIndex >= DataController.Provider.FEditingRecordIndex then +// Inc(ARecordIndex); +// end; +// if ARecordIndex >= DataController.FDeletingRecordIndex then +// Dec(ARecordIndex); // !!! + // end proc + if ARecordIndex < DataController.RecordCount then + begin + AStateSet := []; + if AExpanded and ((Selection.Count > 0) or not IsAlwaysExpanded) then + AStateSet := AStateSet + [eisExpanded]; + if (eisSelected in FExpandingInfo.SaveStates) and + (Selection.FindByGroupIndex(AGroupIndex) <> -1) then + AStateSet := AStateSet + [eisSelected]; + if AStateSet <> [] then + FExpandingInfo.AddItem(ADataGroupInfo.Level, + DataController.GetComparedValue(ARecordIndex, GroupingFieldList[ADataGroupInfo.Level].Field), + AStateSet); + end; + end; + + procedure AddGroups; + var + I, AVisibleLevel: Integer; + ADataGroupInfo: TcxDataGroupInfo; + begin + I := 0; + AVisibleLevel := 0; + while I < DataGroups.Count do + begin + ADataGroupInfo := DataGroups[I]; + if ADataGroupInfo.Level <= AVisibleLevel then + begin + if ADataGroupInfo.Expanded then + begin + AddGroup(ADataGroupInfo, I, True); + AVisibleLevel := ADataGroupInfo.Level + 1; + end + else + begin + if eisSelected in FExpandingInfo.SaveStates then + AddGroup(ADataGroupInfo, I, False); + AVisibleLevel := ADataGroupInfo.Level; + end; + end; + Inc(I); + end; + end; + +var + I: Integer; +begin + if FExpandingInfo.SaveStates <> ASaveStates then + begin + if (ASaveStates <> []) and IsValidInfo then + begin + FExpandingInfo.SaveStates := ASaveStates; + FExpandingInfo.ClearFields; + for I := 0 to DataGroups.FieldCount - 1 do + FExpandingInfo.AddField(DataGroups.Fields[I]); + if IsGrouped then + AddGroups; + end + else + begin + FExpandingInfo.Clear; + FExpandingInfo.SaveStates := ASaveStates; + end; + end; +end; + +procedure TcxCustomDataControllerInfo.TruncateSelection; +var + I, ARecordCount: Integer; +begin + if FSelection.Count = 0 then Exit; + ARecordCount := DataController.RecordCount; + if ARecordCount = 0 then + FSelection.ClearAll + else + if (not DataController.FInDeleteSelection or DataController.FInLoadStorage) and + (not DataController.IsKeyNavigation or DataController.IsSmartRefresh) then + begin + for I := FSelection.Count - 1 downto 0 do + if FSelection[I].RecordIndex >= ARecordCount then + FSelection.Delete(I); + end; +end; + +procedure TcxCustomDataControllerInfo.UnprepareSorting; +var + I: Integer; +begin + for I := 0 to FTotalSortingFieldList.Count - 1 do + FTotalSortingFieldList[I].Field.FNeedConversionFlag := 0; +end; + +procedure TcxCustomDataControllerInfo.Update; +var + ASummaryChanged: Boolean; +begin + FInfoCalculation := True; + DataController.CheckMode; + if DataController.FSortingBySummaryChanged then + begin + FChanges := FChanges + [dcicSorting{, dcicGrouping, dcicSummary}]; + if not IsSortingBySummary then + FChanges := FChanges + [dcicGrouping, dcicSummary]; + end; + ASummaryChanged := ((dcicSummary in FChanges) {or SortBySummaryChanged}) and + ([csDestroying, csReading] * DataController.FOwner.ComponentState = []); + FExpandingFlag := False; + SaveInfo; + try + if dcicLoad in FChanges then + begin + DoLoad; + DoFilter; + end; + if ASummaryChanged then + DoBeginSummary; + if ([dcicSorting, dcicGrouping] * FChanges <> []) then + DoSort; + if dcicGrouping in FChanges then + begin + DataController.BeforeGroupingNotification; + DoGrouping; + end; + if ([dcicSorting, dcicGrouping] * FChanges <> []) then + ResetFocusing; + + CheckInfo; // AB7162 + if ASummaryChanged then + DoEndSummary; + if (([dcicSorting, dcicGrouping] * FChanges <> []) or ASummaryChanged) and + IsSortingBySummary then + begin + DoSortBySummary; + CheckInfo; // AB7162 + end; + + //CheckInfo; AB7162 + finally + ClearInfo; + if FExpandingFlag then + RecalcSelection; + if [dcicSorting, dcicExpanding] * FChanges <> [] then + DataController.CorrectPrevSelectionChangedInfo; + FInfoCalculation := False; + ForwardChanges; + end; +end; + +procedure TcxCustomDataControllerInfo.DoSortBySummary; +var + AEngine: TcxSortingBySummaryEngine; +begin + if DataController.GetSortingBySummaryEngineClass = nil then Exit; + AEngine := DataController.GetSortingBySummaryEngineClass.Create(Self); + try + AEngine.Sort; + finally + AEngine.Free; + end; +end; + +function TcxCustomDataControllerInfo.IsSortingBySummary: Boolean; +var + I: Integer; +begin + Result := False; + if DataController.Summary.Options * [soSelectedRecords, soMultipleSelectedRecords] <> [] then + Exit; + for I := 0 to GroupingFieldList.Count - 1 do + if DataController.Summary.GroupSummaryItems[I].SortedSummaryItem <> nil then + begin + Result := True; + Break; + end; +end; + +procedure TcxCustomDataControllerInfo.CheckAfterCollapsing; +var + ANewFocusedRowIndex: Integer; +begin + ANewFocusedRowIndex := FindFocusedRow(True); + if FFocusingInfo.RowIndex <> ANewFocusedRowIndex then + begin + if DataController.IsSmartRefresh then + CorrectFocusedRow(ANewFocusedRowIndex) + else + DoChangeFocusedRow(ANewFocusedRowIndex, False); + end; +// RecalcSelection; // TODO: check selection +end; + +procedure TcxCustomDataControllerInfo.CheckExpanding; +var + ASelectionCount, ACurIndex: Integer; + + function IsEqualFields: Boolean; + var + I: Integer; + begin + Result := FExpandingInfo.FieldCount = DataGroups.FieldCount; + if Result then + for I := 0 to DataGroups.FieldCount - 1 do + if FExpandingInfo.Fields[I] <> DataGroups.Fields[I] then + begin + Result := False; + Break; + end; + end; + + procedure PrepareSelection; + var + I, ALevel, ALevelCount: Integer; + begin + // Clear Groups + ALevelCount := DataGroups.LevelCount; + for I := Selection.Count - 1 downto 0 do + begin + ALevel := Selection[I].Level; + if (ALevel = -1) or (ALevel <> ALevelCount) then + Selection.Delete(I); + end; + end; + + function GroupNeedsRestoration(AExpandingInfo: PcxDataExpandingInfo): Boolean; + begin + Result := + (eisExpanded in AExpandingInfo.State) and (eisExpanded in FExpandingInfo.SaveStates) or + (eisSelected in AExpandingInfo.State); + end; + + procedure ExpandGroup(ARecordIndex, ALevel: Integer; AStateSet: TcxDataExpandingInfoStateSet); + var + I, ARecordListIndex: Integer; + begin + // begin proc + ARecordListIndex := GetInternalRecordListIndex(ARecordIndex); + I := DataGroups.FindByIndex(ARecordListIndex, ALevel); + // end proc + if I <> -1 then + begin + if (eisExpanded in AStateSet) and (eisExpanded in FExpandingInfo.SaveStates) then + DataGroups[I].Expanded := True; + if eisSelected in AStateSet then + Selection.Add(-1, -1, I, -1); + end; + end; + + procedure ExpandGroups; + var + ALocateObject: TcxDataControllerGroupLocateObject; + AValueDefReader: TcxValueDefUnboundReader; + I, ARecordIndex: Integer; + PExpandingInfo: PcxDataExpandingInfo; + begin + ALocateObject := TcxDataControllerGroupLocateObject.Create(DataController); + try + AValueDefReader := TcxValueDefUnboundReader.Create; + try + ALocateObject.Level := 0; + for I := 0 to FExpandingInfo.Count - 1 do + begin + PExpandingInfo := FExpandingInfo[I]; + if PExpandingInfo.Level < ALocateObject.Level then + AValueDefReader.Truncate(PExpandingInfo.Level); + AValueDefReader.SetValue(FExpandingInfo.Fields[PExpandingInfo.Level].ValueDef, + PExpandingInfo.Value); + if GroupNeedsRestoration(PExpandingInfo) then + begin + ALocateObject.Level := PExpandingInfo.Level; + ALocateObject.ReadData(AValueDefReader); + ARecordIndex := ALocateObject.FindRecordIndex; + if ARecordIndex <> -1 then + ExpandGroup(ARecordIndex, ALocateObject.Level, PExpandingInfo.State); + end; + end; + finally + AValueDefReader.Free; + end; + finally + ALocateObject.Free; + end; + end; + + procedure RebuildSelection; + + procedure CheckGroup(ADataGroupInfo: TcxDataGroupInfo); + begin + if (ADataGroupInfo.Level = (DataGroups.LevelCount - 1)) then + begin + // Delete Hidden + while (ACurIndex < ASelectionCount) and + (Selection[ACurIndex].RowIndex < ADataGroupInfo.BeginRecordListIndex) do + begin + Selection.Delete(ACurIndex); + Dec(ASelectionCount); + end; + // Skip Visible + if ADataGroupInfo.Expanded then + while (ACurIndex < ASelectionCount) and + (ADataGroupInfo.BeginRecordListIndex <= Selection[ACurIndex].RowIndex) and + (Selection[ACurIndex].RowIndex <= ADataGroupInfo.EndRecordListIndex) do + begin + Selection[ACurIndex].RowIndex := ADataGroupInfo.RowIndex + + (Selection[ACurIndex].RowIndex - ADataGroupInfo.BeginRecordListIndex + 1); + Inc(ACurIndex); + end; + end; + end; + + var + I, AVisibleLevel, AStartIndex: Integer; + ADataGroupInfo: TcxDataGroupInfo; + begin + if Selection.Count = 0 then Exit; + { + 1 - first is groups (with RowIndex = -1), second - Data Rows (with RowIndex = RecordListIndex) + 2 - locate begin of Data Rows + 3 - process Data Rows + if visible then correct RowIndex + else delete + 4 - fill RowIndex for Groups (Level = -1) + sort by RowIndex + } + // 1 - Sort Selection By : write RecordListIndex -> RowIndex (temporal) + for I := 0 to Selection.Count - 1 do + if Selection[I].Level <> -1 then + Selection[I].RowIndex := GetInternalRecordListIndex(Selection[I].RecordIndex) + else + Selection[I].RowIndex := -1; + Selection.Sort; + // 2 - + ASelectionCount := Selection.Count; + AStartIndex := ASelectionCount; + for I := 0 to ASelectionCount - 1 do + if Selection[I].RowIndex > -1 then + begin + AStartIndex := I; + Break; + end; + // 3 - + I := 0; + ACurIndex := AStartIndex; + AVisibleLevel := 0; + while (I < DataGroups.Count) and (ACurIndex < ASelectionCount) do + begin + ADataGroupInfo := DataGroups[I]; + if ADataGroupInfo.Level <= AVisibleLevel then + begin + CheckGroup(ADataGroupInfo); + if ADataGroupInfo.Expanded then + AVisibleLevel := ADataGroupInfo.Level + 1 + else + AVisibleLevel := ADataGroupInfo.Level; + end; + Inc(I); + end; + // Clear Hidden + for I := ACurIndex to ASelectionCount - 1 do + begin + Selection.Delete(ACurIndex); + Dec(ASelectionCount); + end; + // 4 - + for I := 0 to AStartIndex - 1 do // for Group's + Selection[I].RowIndex := DataGroups[Selection[I].RecordIndex].RowIndex; + Selection.Sort; + end; + + procedure RestoreRowsSelection; + var + I: Integer; + begin + if DataController.IsGridMode then Exit; + for I := 0 to Selection.Count - 1 do + Selection[I].RowIndex := GetInternalRecordListIndex(Selection[I].RecordIndex); + Selection.Sort; + end; + +var + ATempIndex: Integer; +begin + if IsGrouped and IsAlwaysExpanded then + DataGroups.FullExpanding(True); + if FExpandingInfo.SaveStates <> [] then + begin + if IsEqualFields then + begin + PrepareSelection; + if IsGrouped then + begin + try +// if not IsAlwaysExpanded then + ExpandGroups; + finally + if not IsAlwaysExpanded and (eisExpanded in FExpandingInfo.SaveStates) then + DataGroups.Rebuild; + RebuildSelection; + end; + end + else + if eisSelected in FExpandingInfo.SaveStates then + RestoreRowsSelection; + // check Selection Anchor + if (Selection.AnchorRowIndex <> -1) and + not Selection.FindByRowIndex(Selection.AnchorRowIndex, ATempIndex) then + Selection.ClearAnchor; + end + else + begin + if eisSelected in FExpandingInfo.SaveStates then + Selection.ClearAll; + end; + end; +end; + +procedure TcxCustomDataControllerInfo.CheckFocusing; +var + ANewFocusedRowIndex: Integer; +begin + ANewFocusedRowIndex := FindFocusedRow(False); + if FFocusingInfo.RowIndex <> ANewFocusedRowIndex then + begin + // check old row index + if (0 <= FFocusingInfo.RowIndex) and (FFocusingInfo.RowIndex < GetRowCount) and + (FFocusingInfo.RecordIndex = GetRowInfo(FFocusingInfo.RowIndex).RecordIndex) then + // do nothing + else + DoChangeFocusedRow(ANewFocusedRowIndex, True); + end; + if (dcicFocusedRow in FChanges) and (FPrevFocusingInfo.RowIndex >= GetRowCount) then + FPrevFocusingInfo.RowIndex := -1; + + if DataController.FFilterChanged then + CheckFocusingAfterFilter; +end; + +procedure TcxCustomDataControllerInfo.CheckFocusingAfterFilter; +begin + if (FocusedRowIndex = -1) and not DataController.NewItemRowFocused then + begin + DataController.FFilterChanged := False; + if {DataController.IsSmartRefresh and} (DataController.Provider.LocateCount = 0) then + CorrectFocusedRow(0); + end; +end; + +procedure TcxCustomDataControllerInfo.CheckInfo; +begin + CheckExpanding; + CheckFocusing; + DataController.CheckBookmarkValid(-1); +end; + +procedure TcxCustomDataControllerInfo.ClearInfo; +begin + FExpandingInfo.Clear; +end; + +function TcxCustomDataControllerInfo.CompareGroupRecords(ARecordIndex1, ARecordIndex2, AIndex: Integer): Integer; +var + AI, A1, A2: Integer; +begin + Result := 0; + if ARecordIndex1 = ARecordIndex2 then + Exit; + + if DataController.Provider.FSavedRecordIndex <> 0 then + begin + if ARecordIndex1 = DataController.Provider.FEditingRecordIndex then + ARecordIndex1 := DataController.Provider.FSavedRecordIndex + else + if ARecordIndex2 = DataController.Provider.FEditingRecordIndex then + ARecordIndex2 := DataController.Provider.FSavedRecordIndex; + end + else + begin + // check Inserting - see CompareRecords + A1 := DataController.Provider.FEditingRecordIndex1; + A2 := DataController.Provider.FEditingRecordIndex2; + if (A1 <> cxNullEditingRecordIndex) or (A2 <> cxNullEditingRecordIndex) then + begin + AI := DataController.Provider.FEditingRecordIndex; + if ARecordIndex1 = AI then + begin + if A1 <> cxNullEditingRecordIndex then // appending + begin + Result := 0; // !!! + Exit; + end + else // inserting + if ARecordIndex2 = A2 then + begin + Result := 0; // !!! + Exit; + end + else + ARecordIndex1 := A2; + end + else + if ARecordIndex2 = AI then + begin + if A1 <> cxNullEditingRecordIndex then // appending + begin + Result := 0; // !!! + Exit; + end + else // inserting + if ARecordIndex1 = A2 then + begin + Result := 0; // !!! + Exit; + end + else + ARecordIndex2 := A2; + end; + end; + end; + // compare + Result := DataController.CompareRecords(ARecordIndex1, ARecordIndex2, + FTotalSortingFieldList[AIndex], dccmGrouping); +end; + +function TcxCustomDataControllerInfo.CompareRecords(ARecord1, ARecord2: Pointer): Integer; +var + I, AI, A1, A2: Integer; +begin + Result := 0; + if ARecord1 = ARecord2 then + Exit; + + // check Inserting + A1 := DataController.Provider.FEditingRecordIndex1; + A2 := DataController.Provider.FEditingRecordIndex2; + if (A1 <> cxNullEditingRecordIndex) or (A2 <> cxNullEditingRecordIndex) then + begin + AI := DataController.Provider.FEditingRecordIndex; + if Integer(ARecord1) = AI then + begin + if A1 <> cxNullEditingRecordIndex then // appending + begin + Result := 1; + Exit; + end + else // inserting + if Integer(ARecord2) = A2 then + begin + Result := -1; + Exit; + end + else + Integer(ARecord1) := A2; + end + else + if Integer(ARecord2) = AI then + begin + if A1 <> cxNullEditingRecordIndex then // appending + begin + Result := -1; + Exit; + end + else // inserting + if Integer(ARecord1) = A2 then + begin + Result := 1; + Exit; + end + else + Integer(ARecord2) := A2; + end; + end; + + // compare + for I := 0 to FTotalSortingFieldList.Count - 1 do + begin + Result := DataController.CompareRecords(Integer(ARecord1), Integer(ARecord2), + FTotalSortingFieldList[I], dccmSorting); + if Result <> 0 then Exit; + end; + if Result = 0 then + Result := DataController.CompareEqualRecords(Integer(ARecord1), Integer(ARecord2)); +end; + +function TcxCustomDataControllerInfo.GetFocusedRecordIndex: Integer; +begin + if FFocusingInfo.RowIndex <> -1 then + Result := GetRowInfo(FFocusingInfo.RowIndex).RecordIndex + else + Result := -1; +end; + +function TcxCustomDataControllerInfo.GetFocusedRowIndex: Integer; +begin + Result := FFocusingInfo.RowIndex; +end; + +function TcxCustomDataControllerInfo.GetNewItemRowFocusingChanged: Boolean; +begin + Result := FPrevFocusingInfo.FChangedFlag; +end; + +function TcxCustomDataControllerInfo.GetPrevFocusedRecordIndex: Integer; +begin + Result := FPrevFocusingInfo.FPrevRecordIndex; +end; + +function TcxCustomDataControllerInfo.GetPrevFocusedRowIndex: Integer; +begin + Result := FPrevFocusingInfo.RowIndex; +end; + +procedure TcxCustomDataControllerInfo.SaveInfo; +var + ASaveStates: TcxDataExpandingInfoStateSet; +begin + ASaveStates := []; + if (dcoSaveExpanding in DataController.Options) or (Selection.Count > 0) then + begin + if (dcoSaveExpanding in DataController.Options) and + ([dcicLoad, dcicGrouping] * FChanges <> []) then + ASaveStates := ASaveStates + [eisExpanded]; + if (Selection.Count > 0) and + ([dcicLoad, dcicGrouping, dcicSorting, dcicExpanding] * FChanges <> []) then + ASaveStates := ASaveStates + [eisSelected]; + end; + SaveExpanding(ASaveStates); +end; + +procedure TcxCustomDataControllerInfo.SetFocusedRowIndex(Value: Integer); +begin + DataController.BeginFullUpdate; + //BeginUpdate; + try + DoChangeFocusedRow(Value, False); + finally +// EndUpdate; + DataController.EndFullUpdate; + end; +end; + +{ TcxDataFilterCriteriaItem } + +function TcxDataFilterCriteriaItem.GetDataValue(AData: TObject): Variant; +begin + if Assigned(Field) then + Result := DataController.GetFilterDataValue(Integer(AData), Field) + else + Result := Null; +end; + +function TcxDataFilterCriteriaItem.GetFieldCaption: string; +begin + if Assigned(Field) and (Field.Item <> nil) then + Result := DataController.GetFilterItemFieldCaption(Field.Item) + else + Result := ''; +end; + +function TcxDataFilterCriteriaItem.GetFieldName: string; +begin + if Assigned(Field) and (Field.Item <> nil) then + Result := DataController.GetFilterItemFieldName(Field.Item) + else + Result := ''; +end; + +function TcxDataFilterCriteriaItem.GetItemLink: TObject; +begin + if Assigned(Field) then + Result := Field.Item + else + Result := nil; // !!! +end; + +procedure TcxDataFilterCriteriaItem.SetItemLink(Value: TObject); +begin + if not (Value is TcxCustomDataField) then + Value := DataController.Fields.FieldByItem(Value); + inherited; +end; + +function TcxDataFilterCriteriaItem.GetDataController: TcxCustomDataController; +begin + Result := (Criteria as TcxDataFilterCriteria).DataController; +end; + +function TcxDataFilterCriteriaItem.GetField: TcxCustomDataField; +begin + Result := inherited GetItemLink as TcxCustomDataField; +end; + +{ TcxDataFilterValueList } + +procedure TcxDataFilterValueList.Load(AItemIndex: Integer; AInitSortByDisplayText: Boolean = True; + AUseFilteredValues: Boolean = False); + + procedure LoadRecords(var AUseFilteredRecords: Boolean; out ANullExists: Boolean); + var + AField: TcxCustomDataField; + I, ARecordIndex: Integer; + V: Variant; + begin + ANullExists := False; + AField := DataController.Fields[AItemIndex]; + if AUseFilteredRecords and (DataController.FilteredRecordCount <> 0) then + I := DataController.FilteredRecordCount + else + begin + AUseFilteredRecords := False; + I := DataController.RecordCount; + end; + for I := 0 to I - 1 do + begin + // TODO: ignore editing record + if AUseFilteredRecords then + ARecordIndex := DataController.FilteredRecordIndex[I] + else + ARecordIndex := I; + V := DataController.GetFilterDataValue(ARecordIndex, AField); + if Criteria.ValueIsNull(V) then + ANullExists := True + else + Add(fviValue, V, DataController.GetFilterDisplayText(ARecordIndex, AItemIndex), False); + end; + end; + + function NonBlanksFilterApplied: Boolean; + var + ACriteriaItem: TcxFilterCriteriaItem; + begin + ACriteriaItem := Criteria.FindItemByItemLink(DataController.GetItem(AItemIndex)); + Result := (ACriteriaItem <> nil) and (ACriteriaItem.Operator is TcxFilterNotNullOperator); + end; + +var + ANullExists: Boolean; +begin + Clear; + if AInitSortByDisplayText then + // SortByDisplayText := DataController.GetItemValueSource(AItemIndex) <> evsText; // TODO: Text for Lookup Field!!! + SortByDisplayText := DataController.IsFilterItemSortByDisplayText(AItemIndex); + Add(fviAll, Null, cxSFilterString(@cxSFilterBoxAllCaption), False); + Add(fviCustom, Null, cxSFilterString(@cxSFilterBoxCustomCaption), False); + if DataController.IsGridMode then + ANullExists := True // custom loading + else + LoadRecords(AUseFilteredValues, ANullExists); + if ANullExists then + Add(fviBlanks, Null, cxSFilterString(@cxSFilterBoxBlanksCaption), False); + if ANullExists or AUseFilteredValues and NonBlanksFilterApplied then + Add(fviNonBlanks, Null, cxSFilterString(@cxSFilterBoxNonBlanksCaption), False); + if Assigned((Criteria as TcxDataFilterCriteria).FOnGetValueList) then + (Criteria as TcxDataFilterCriteria).FOnGetValueList(Criteria, AItemIndex, Self); +end; + +function TcxDataFilterValueList.GetDataController: TcxCustomDataController; +begin + Result := (Criteria as TcxDataFilterCriteria).DataController; +end; + +{ TcxDataFilterCriteria } + +constructor TcxDataFilterCriteria.Create(ADataController: TcxCustomDataController); +begin + inherited Create; + FDataController := ADataController; + Version := cxDataFilterVersion; +end; + +destructor TcxDataFilterCriteria.Destroy; +begin + FDestroying := True; + if (FDataController <> nil) and (FDataController.FFilters <> nil) then + FDataController.FFilters.Remove(Self); + Active := False; + inherited Destroy; +end; + +procedure TcxDataFilterCriteria.Assign(Source: TPersistent; AIgnoreItemNames: Boolean = False); +begin + if Source is TcxDataFilterCriteria then + begin + BeginUpdate; + try + inherited; + Active := TcxDataFilterCriteria(Source).Active; + finally + EndUpdate; + end; + end + else + inherited; +end; + +procedure TcxDataFilterCriteria.AssignEvents(Source: TPersistent); +begin + inherited AssignEvents(Source); + if Source is TcxDataFilterCriteria then + OnGetValueList := TcxDataFilterCriteria(Source).OnGetValueList; +end; + +function TcxDataFilterCriteria.CreateValueList: TcxDataFilterValueList; +begin + Result := GetValueListClass.Create(Self) as TcxDataFilterValueList; +end; + +function TcxDataFilterCriteria.FindItemByItemLink(AItemLink: TObject): TcxFilterCriteriaItem; +begin + if not (AItemLink is TcxCustomDataField) then + AItemLink := DataController.Fields.FieldByItem(AItemLink); + Result := inherited FindItemByItemLink(AItemLink); +end; + +function TcxDataFilterCriteria.IsFiltering: Boolean; +begin + Result := Active and not IsEmpty and not DataController.IsGridMode; +end; + +procedure TcxDataFilterCriteria.RemoveItemByField(AField: TcxCustomDataField); +begin + RemoveItemByItemLink(AField); +end; + +procedure TcxDataFilterCriteria.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineBinaryProperty('Criteria', ReadData, WriteData, IsStore); +end; + +function TcxDataFilterCriteria.DoFilterRecord(ARecordIndex: Integer): Boolean; +begin + Result := DoFilterData(TObject(ARecordIndex)); +end; + +function TcxDataFilterCriteria.GetIDByItemLink(AItemLink: TObject): Integer; +begin + Result := DataController.GetItemID(AItemLink); +end; + +function TcxDataFilterCriteria.GetNameByItemLink(AItemLink: TObject): string; +begin + Result := DataController.GetItemName(AItemLink); +end; + +function TcxDataFilterCriteria.GetItemClass: TcxFilterCriteriaItemClass; +begin + Result := TcxDataFilterCriteriaItem; +end; + +function TcxDataFilterCriteria.GetItemLinkByID(AID: Integer): TObject; +begin + Result := DataController.FindItemByInternalID(AID); +end; + +function TcxDataFilterCriteria.GetItemLinkByName(const AName: string): TObject; +begin + Result := DataController.FindItemByName(AName); +end; + +function TcxDataFilterCriteria.GetValueListClass: TcxFilterValueListClass; +begin + Result := TcxDataFilterValueList; +end; + +function TcxDataFilterCriteria.IsDestroying: Boolean; +begin + Result := Destroying or DataController.IsDestroying; +end; + +function TcxDataFilterCriteria.IsInternal: Boolean; +begin + Result := (DataController <> nil) and (DataController.FFilters.IndexOf(Self) <> -1); +end; + +function TcxDataFilterCriteria.IsLoading: Boolean; +begin + Result := DataController.IsLoading; +end; + +procedure TcxDataFilterCriteria.Update; +begin + if not (IsInternal or IsDestroying or IsLoading) then + begin + if not DataController.Provider.IsDataSource then + DataController.Post; + DataController.FilterChanged; + if Assigned(OnChanged) then + OnChanged(Self); + end; +end; + +procedure TcxDataFilterCriteria.SetActive(Value: Boolean); +begin + if FActive <> Value then + begin + FActive := Value; + Changed; + end; +end; + +{ TcxDataFilterList } + +procedure TcxDataFilterList.Clear; +begin + while Count > 0 do + Items[Count - 1].Free; + inherited Clear; +end; + +procedure TcxDataFilterList.RemoveItemByField(AField: TcxCustomDataField); +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].RemoveItemByField(AField); +end; + +function TcxDataFilterList.GetItem(Index: Integer): TcxDataFilterCriteria; +begin + Result := TcxDataFilterCriteria(inherited Items[Index]); +end; + +{ TcxDataControllerGroups } + +constructor TcxDataControllerGroups.Create(ADataController: TcxCustomDataController); +begin + inherited Create; + FDataController := ADataController; +end; + +procedure TcxDataControllerGroups.ChangeExpanding(ARowIndex: Integer; + AExpanded, ARecursive: Boolean); +begin + DataControllerInfo.ChangeExpanding(ARowIndex, AExpanded, ARecursive); +end; + +procedure TcxDataControllerGroups.ChangeGrouping(AItemIndex, AGroupIndex: Integer); +begin + DataController.CheckItemRange(AItemIndex); + if GetItemGroupIndex(AItemIndex) <> AGroupIndex then + begin + DataController.BeforeSorting; + DataController.FGroupingChanged := True; + DataControllerInfo.ChangeGrouping(DataController.Fields[AItemIndex], AGroupIndex); + end; +end; + +procedure TcxDataControllerGroups.ClearGrouping; +begin + if GetGroupingItemCount > 0 then + begin + DataController.BeforeSorting; + DataController.FGroupingChanged := True; + end; + DataControllerInfo.ClearGrouping; +end; + +procedure TcxDataControllerGroups.FullCollapse; +begin + DataControllerInfo.FullCollapse; +end; + +procedure TcxDataControllerGroups.FullExpand; +begin + DataControllerInfo.FullExpand; +end; + +function TcxDataControllerGroups.GetDataGroupIndexByGroupValue(AParentDataGroupIndex: TcxDataGroupIndex; + const AGroupValue: Variant): TcxDataGroupIndex; +var + I: Integer; + AChildDataGroupIndex: TcxDataGroupIndex; +begin + Result := -1; +{ if (DataControllerInfo.LockCount > 0) and (DataControllerInfo.FChanges <> []) then + Exit; // !!!} + + DataControllerInfo.PrepareSorting; + try + for I := 0 to ChildCount[AParentDataGroupIndex] - 1 do + begin + AChildDataGroupIndex := ChildDataGroupIndex[AParentDataGroupIndex, I]; + if VarEquals(GroupValues[AChildDataGroupIndex] , AGroupValue) then + begin + Result := AChildDataGroupIndex; + Break; + end; + end; + finally + DataControllerInfo.UnprepareSorting; + end; +end; + +function TcxDataControllerGroups.HasAsParent(ARowIndex, AParentRowIndex: Integer): Boolean; +var + AIndex, AParentIndex: TcxDataGroupIndex; +begin + if LevelCount = 0 then + begin + Result := False; + Exit; + end; + AParentIndex := DataGroupIndexByRowIndex[AParentRowIndex]; + AIndex := DataGroupIndexByRowIndex[ARowIndex]; + Result := (AParentIndex = AIndex) or + ((Level[AParentIndex] < Level[AIndex]) and + (DataGroups[AParentIndex].BeginRecordListIndex <= AIndex) and + (AIndex <= DataGroups[AParentIndex].EndRecordListIndex)); +end; + +procedure TcxDataControllerGroups.LoadRecordIndexes(AList: TList; ADataGroupIndex: TcxDataGroupIndex); +var + I, AChildCount: Integer; +begin + AChildCount := ChildCount[ADataGroupIndex]; + if Level[ADataGroupIndex] < LevelCount - 1 then // It's Sub Groups + begin + for I := 0 to AChildCount - 1 do + LoadRecordIndexes(AList, ChildDataGroupIndex[ADataGroupIndex, I]); + end + else + for I := 0 to AChildCount - 1 do + AList.Add(Pointer(ChildRecordIndex[ADataGroupIndex, I])); +end; + +procedure TcxDataControllerGroups.LoadRecordIndexesByRowIndex(AList: TList; ARowIndex: Integer); +begin + LoadRecordIndexes(AList, DataGroupIndexByRowIndex[ARowIndex]); +end; + +function TcxDataControllerGroups.GetGroupRecordIndex(ADataGroupIndex: TcxDataGroupIndex): Integer; +var + ARecordDataGroupIndex: TcxDataGroupIndex; +begin + ARecordDataGroupIndex := ADataGroupIndex; + while Level[ARecordDataGroupIndex] < LevelCount - 1 do // It's Sub Groups + ARecordDataGroupIndex := ChildDataGroupIndex[ARecordDataGroupIndex, 0]; + Result := ChildRecordIndex[ARecordDataGroupIndex, 0]; +end; + +function TcxDataControllerGroups.GetChildCount(DataGroupIndex: TcxDataGroupIndex): Integer; +begin + Result := DataControllerInfo.DataGroups.GetChildCount(DataGroupIndex); +end; + +function TcxDataControllerGroups.GetChildDataGroupIndex(ParentDataGroupIndex: TcxDataGroupIndex; ChildIndex: Integer): TcxDataGroupIndex; +begin + Result := DataControllerInfo.DataGroups.GetChildIndex(ParentDataGroupIndex, ChildIndex); +end; + +function TcxDataControllerGroups.GetChildRecordIndex(ParentDataGroupIndex: TcxDataGroupIndex; + ChildIndex: Integer): Integer; +var + I: Integer; +begin + I := DataControllerInfo.DataGroups.GetChildRecordListIndex(ParentDataGroupIndex, ChildIndex); + if I <> -1 then + Result := DataControllerInfo.GetInternalRecordIndex(I) + else + Result := -1; +end; + +function TcxDataControllerGroups.GetDataControllerInfo: TcxCustomDataControllerInfo; +begin + Result := DataController.DataControllerInfo; +end; + +function TcxDataControllerGroups.GetDataGroupIndexByRowIndex(RowIndex: Integer): TcxDataGroupIndex; +begin + Result := DataControllerInfo.DataGroups.GetIndexByRowIndex(RowIndex); +end; + +function TcxDataControllerGroups.GetDataGroups: TcxDataGroups; +begin + Result := DataControllerInfo.DataGroups; +end; + +function TcxDataControllerGroups.GetFieldGroupIndex(AField: TcxCustomDataField): Integer; +begin + Result := DataControllerInfo.GroupingFieldList.GroupIndexByField(AField); +end; + +function TcxDataControllerGroups.GetGroupingItemCount: Integer; +begin + Result := DataControllerInfo.GroupingFieldList.Count; +end; + +function TcxDataControllerGroups.GetGroupingItemIndex(Index: Integer): Integer; +begin + Result := DataControllerInfo.GroupingFieldList[Index].Field.Index; +end; + +function TcxDataControllerGroups.GetGroupDisplayText(ADataGroupIndex: TcxDataGroupIndex): string; +var + ARecordIndex, ALevel: Integer; + AField: TcxCustomDataField; +begin + ARecordIndex := GetGroupRecordIndex(ADataGroupIndex); + ALevel := Level[ADataGroupIndex]; + AField := DataControllerInfo.GroupingFieldList[ALevel].Field; + + Result := DataController.GetDisplayText(ARecordIndex, AField.Index); +end; + +function TcxDataControllerGroups.GetGroupValue(ADataGroupIndex: TcxDataGroupIndex): Variant; +var + ARecordIndex, ALevel: Integer; + AField: TcxCustomDataField; +begin + ARecordIndex := GetGroupRecordIndex(ADataGroupIndex); + ALevel := Level[ADataGroupIndex]; + AField := DataControllerInfo.GroupingFieldList[ALevel].Field; + + Result := DataController.GetComparedValue(ARecordIndex, AField); +end; + +function TcxDataControllerGroups.GetItemGroupIndex(AItemIndex: Integer): Integer; +begin + DataController.CheckItemRange(AItemIndex); + Result := FieldGroupIndex[DataController.Fields[AItemIndex]]; +end; + +function TcxDataControllerGroups.GetLevel(ADataGroupIndex: TcxDataGroupIndex): Integer; +begin + Result := DataControllerInfo.DataGroups.GetLevel(ADataGroupIndex); +end; + +function TcxDataControllerGroups.GetParentDataGroupIndex(ChildDataGroupIndex: TcxDataGroupIndex): TcxDataGroupIndex; +begin + Result := DataControllerInfo.DataGroups.GetParentIndex(ChildDataGroupIndex); +end; + +{ TcxCustomDataSummaryItem } + +procedure TcxCustomDataSummaryItem.Assign(Source: TPersistent); +begin + if Source is TcxCustomDataSummaryItem then + begin + ItemLink := DataController.FindProperItemLink(TcxCustomDataSummaryItem(Source).ItemLink); + end + else + inherited Assign(Source); +end; + +procedure TcxCustomDataSummaryItem.BeginUpdate; +begin + if Assigned(Collection) then Collection.BeginUpdate; +end; + +procedure TcxCustomDataSummaryItem.EndUpdate; +begin + if Assigned(Collection) then Collection.EndUpdate; +end; + +procedure TcxCustomDataSummaryItem.ItemLinkChanging(AField: TcxCustomDataField); +begin +end; + +function TcxCustomDataSummaryItem.GetItemLink: TObject; +begin + if Assigned(Field) then + Result := Field.Item + else + Result := nil; +end; + +procedure TcxCustomDataSummaryItem.SetItemLink(Value: TObject); +var + AField: TcxCustomDataField; +begin + if ItemLink <> Value then + begin + AField := DataController.Fields.FieldByItem(Value); + BeginUpdate; + try + ItemLinkChanging(AField); + FField := AField; + Changed(True); + finally + EndUpdate; + end; + end; +end; + +{ TcxDataSummaryItem } + +destructor TcxDataSummaryItem.Destroy; +begin + Sorted := False; + inherited Destroy; +end; + +procedure TcxDataSummaryItem.Assign(Source: TPersistent); +begin + if Source is TcxDataSummaryItem then + begin + BeginUpdate; + try + inherited Assign(Source); + Format := TcxDataSummaryItem(Source).Format; + Kind := TcxDataSummaryItem(Source).Kind; + Position := TcxDataSummaryItem(Source).Position; + Sorted := TcxDataSummaryItem(Source).Sorted; + OnGetText := TcxDataSummaryItem(Source).OnGetText; + finally + EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +function TcxDataSummaryItem.DataField: TcxCustomDataField; +begin + Result := Field; +end; + +function TcxDataSummaryItem.FormatValue(const AValue: Variant; AIsFooter: Boolean): string; +var + S: string; +begin + if not VarIsNull(AValue) then + begin + if Kind <> skNone then + begin + S := Format; + if Format = '' then + S := SummaryItems.DefaultFormat(GetValueType(VarType(AValue)), Kind, AIsFooter); + if (VarType(AValue) = varDate) and (Kind <> skCount) then + begin + if TimeOf(AValue) = 0 then + Result := DateToStr(AValue) + else + if DateOf(AValue) = 0 then + Result := TimeToStr(AValue) + else + Result := DateTimeToStr(AValue); + Result := S + Result; + end + else + Result := FormatFloat(S, AValue); + end + else + Result := VarToStr(AValue); + end + else + Result := ''; + if Assigned(FOnGetText) then + FOnGetText(Self, AValue, AIsFooter, Result); +end; + +function TcxDataSummaryItem.GetDataController: TcxCustomDataController; +begin + Result := SummaryItems.DataController; +end; + +function TcxDataSummaryItem.GetValueType(AVarType: TVarType): TcxSummaryValueType; +begin + if IsCurrency(AVarType) then + Result := svtCurrency + else + begin + case AVarType of + varDate: + Result := svtDate; + else + Result := svtFloat; + end; + end; +end; + +function TcxDataSummaryItem.IsCurrency(AVarType: TVarType): Boolean; +begin + Result := VarTypeIsCurrency(AVarType); +end; + +function TcxDataSummaryItem.IsDataBinded: Boolean; +begin + Result := (DataField <> nil) or ((Kind = skCount) and (Position = spGroup)); +end; + +function TcxDataSummaryItem.IsPositionStored: Boolean; +begin + Result := SummaryItems.IsPositionStored(Self); +end; + +function TcxDataSummaryItem.GetPosition: TcxSummaryPosition; +begin + Result := SummaryItems.GetItemPosition(Self); +end; + +function TcxDataSummaryItem.GetSummaryItems: TcxDataSummaryItems; +begin + if Assigned(Collection) and (Collection is TcxDataSummaryItems) then + Result := TcxDataSummaryItems(Collection) + else + Result := nil; +end; + +procedure TcxDataSummaryItem.SetFormat(const Value: string); +begin + if FFormat <> Value then + begin + FFormat := Value; + Changed(False); + end; +end; + +procedure TcxDataSummaryItem.SetKind(Value: TcxSummaryKind); +begin + if FKind <> Value then + begin + FKind := Value; + Changed(True); + end; +end; + +procedure TcxDataSummaryItem.SetPosition(Value: TcxSummaryPosition); +begin + if Position <> Value then + begin + FPosition := Value; + Changed(False); + end; +end; + +procedure TcxDataSummaryItem.SetSorted(Value: Boolean); +begin + if DataController.SortingBySummaryDataItemIndex <> -1 then Exit; + if FSorted <> Value then + begin + BeginUpdate; + try + SummaryItems.BeforeSortingChange(Self, Value); + FSorted := Value; + DataController.DoSortingBySummaryChanged; + Changed(True); + finally + EndUpdate; + end; + end; +end; + +{ TcxDataSummaryItems } + +constructor TcxDataSummaryItems.Create(ASummary: TcxDataSummary; AItemClass: TcxDataSummaryItemClass); +begin + inherited Create(AItemClass); + FSummary := ASummary; +end; + +function TcxDataSummaryItems.Add: TcxDataSummaryItem; +begin + Result := TcxDataSummaryItem(inherited Add); +end; + +function TcxDataSummaryItems.Add(AItemLink: TObject; APosition: TcxSummaryPosition; + AKind: TcxSummaryKind; const AFormat: string = ''): TcxDataSummaryItem; +begin + BeginUpdate; + try + Result := Add; + Result.ItemLink := AItemLink; + Result.Position := APosition; + Result.Kind := AKind; + Result.Format := AFormat; + finally + EndUpdate; + end; +end; + +procedure TcxDataSummaryItems.Assign(Source: TPersistent); +begin + inherited Assign(Source); + AssignEvents(Source); +end; + +procedure TcxDataSummaryItems.AssignEvents(Source: TPersistent); +begin + if Source is TcxDataSummaryItems then + OnSummary := TcxDataSummaryItems(Source).OnSummary; +end; + +function TcxDataSummaryItems.DefaultFormat(AValueType: TcxSummaryValueType; + ASummaryKind: TcxSummaryKind; AIsFooter: Boolean): string; +const + ACurrencyFormats: array [Boolean, skSum..skAverage] of string = ( + ('SUM=%s;SUM=-%s', 'MIN=%s;MIN=-%s', 'MAX=%s;MAX=-%s', 'COUNT=0', 'AVG=%s;AVG=-%s'), + ('%s;-%s', 'MIN=%s;MIN=-%s', 'MAX=%s;MAX=-%s', '0', 'AVG=%s;AVG=-%s')); + ADateFormats: array [Boolean, skSum..skAverage] of string = ( + ('SUM=', 'MIN=', 'MAX=', 'COUNT=0', 'AVG='), + ('', 'MIN=', 'MAX=', '0', 'AVG=')); + AFloatFormats: array [Boolean, skSum..skAverage] of string = ( + ('SUM=0.00;SUM=-0.00', 'MIN=0.00;MIN=-0.00', 'MAX=0.00;MAX=-0.00', 'COUNT=0', 'AVG=0.00;AVG=-0.00'), + ('0.00;-0.00', 'MIN=0.00;MIN=-0.00', 'MAX=0.00;MAX=-0.00', '0', 'AVG=0.00;AVG=-0.00')); +var + S: string; +begin + Result := ''; + if ASummaryKind = skNone then Exit; + case AValueType of + svtCurrency: + begin + S := DefaultCurrencyDisplayFormat; + Result := Format(ACurrencyFormats[AIsFooter, ASummaryKind], [S, S]); + end; + svtDate: + Result := ADateFormats[AIsFooter, ASummaryKind]; + else + Result := AFloatFormats[AIsFooter, ASummaryKind]; + end; +end; + +procedure TcxDataSummaryItems.DeleteItems(AItemLink: TObject; APosition: TcxSummaryPosition); +var + I: Integer; + AItem: TcxDataSummaryItem; +begin + BeginUpdate; + try + for I := Count - 1 downto 0 do + begin + AItem := Items[I]; + if (AItem.ItemLink = AItemLink) and (AItem.Position = APosition) then + AItem.Free; + end; + finally + EndUpdate; + end; +end; + +function TcxDataSummaryItems.GetGroupText(const ASummaryValues: Variant): string; +begin + Result := ''; +end; + +function TcxDataSummaryItems.IndexOf(AItem: TcxDataSummaryItem): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Count - 1 do + if Items[I] = AItem then + begin + Result := I; + Break; + end; +end; + +function TcxDataSummaryItems.IndexOfItemLink(AItemLink: TObject): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Count - 1 do + if Items[I].ItemLink = AItemLink then + begin + Result := I; + Break; + end; +end; + +function TcxDataSummaryItems.ItemOfItemLink(AItemLink: TObject): TcxDataSummaryItem; +var + AIndex: Integer; +begin + AIndex := IndexOfItemLink(AItemLink); + if AIndex <> -1 then + Result := Items[AIndex] + else + Result := nil; +end; + +function TcxDataSummaryItems.GetDataItem(AItemIndex: Integer; APosition: TcxSummaryPosition; + ACheckKind: Boolean = False; AKind: TcxSummaryKind = skNone): TcxDataSummaryItem; +var + I: Integer; + AField: TcxCustomDataField; +begin + DataController.CheckItemRange(AItemIndex); + Result := nil; + AField := DataController.Fields[AItemIndex]; + for I := 0 to Count - 1 do + if (Items[I].Field = AField) and (Items[I].Position = APosition) and + (not ACheckKind or (Items[I].Kind = AKind)) then + begin + Result := Items[I]; + Break; + end; +end; + +function TcxDataSummaryItems.GetDataItemFormat(AItemIndex: Integer; + APosition: TcxSummaryPosition): string; +var + AKind: TcxSummaryKind; + ASorted: Boolean; +begin + GetDataItemProperties(AItemIndex, APosition, [spFormat], Result, AKind, ASorted); +end; + +function TcxDataSummaryItems.GetDataItemKind(AItemIndex: Integer; + APosition: TcxSummaryPosition): TcxSummaryKind; +var + AFormat: string; + ASorted: Boolean; +begin + GetDataItemProperties(AItemIndex, APosition, [spKind], AFormat, Result, ASorted); +end; + +function TcxDataSummaryItems.GetDataItemSorted(AItemIndex: Integer; + APosition: TcxSummaryPosition): Boolean; +var + AFormat: string; + AKind: TcxSummaryKind; +begin + GetDataItemProperties(AItemIndex, APosition, [spSorted], AFormat, AKind, Result); +end; + +procedure TcxDataSummaryItems.SetDataItemFormat(AItemIndex: Integer; + APosition: TcxSummaryPosition; const Value: string); +begin + SetDataItemProperties(AItemIndex, APosition, [spFormat], Value, skNone, False); +end; + +procedure TcxDataSummaryItems.SetDataItemKind(AItemIndex: Integer; + APosition: TcxSummaryPosition; Value: TcxSummaryKind); +begin + SetDataItemProperties(AItemIndex, APosition, [spKind], '', Value, False); +end; + +procedure TcxDataSummaryItems.SetDataItemSorted(AItemIndex: Integer; + APosition: TcxSummaryPosition; Value: Boolean); +begin + SetDataItemProperties(AItemIndex, APosition, [spSorted], '', skNone, Value); +end; + +procedure TcxDataSummaryItems.BeforeSortingChange(AItem: TcxDataSummaryItem; AValue: Boolean); +begin +end; + +procedure TcxDataSummaryItems.ChangedView; +begin + if Count > 0 then + Update(Items[0]); +// Items[0].Changed(False); +end; + +function TcxDataSummaryItems.GetItemPosition(AItem: TcxDataSummaryItem): TcxSummaryPosition; +begin + Result := AItem.FPosition; +end; + +function TcxDataSummaryItems.IsPositionStored(AItem: TcxDataSummaryItem): Boolean; +begin + Result := AItem.Position <> TcxSummaryPosition(0); +end; + +function TcxDataSummaryItems.GetOwner: TPersistent; +begin + Result := FSummary; +end; + +function TcxDataSummaryItems.IndexOfField(AField: TcxCustomDataField): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Count - 1 do + if Items[I].Field = AField then + begin + Result := I; + Break; + end; +end; + +function TcxDataSummaryItems.ItemOfField(AField: TcxCustomDataField): TcxDataSummaryItem; +var + AIndex: Integer; +begin + AIndex := IndexOfField(AField); + if AIndex <> -1 then + Result := Items[AIndex] + else + Result := nil; +end; + +procedure TcxDataSummaryItems.Update(Item: TCollectionItem); +begin + FSummary.Changed(Item <> nil); +end; + +function TcxDataSummaryItems.AddDataItem(AItemIndex: Integer; + APosition: TcxSummaryPosition): TcxDataSummaryItem; +begin + Result := Add(DataController.GetItem(AItemIndex), APosition, skNone); +end; + +procedure TcxDataSummaryItems.CheckItemEmpty(AItem: TcxDataSummaryItem); +begin + if IsPropertiesEmpty([spFormat, spKind, spSorted], AItem.Format, AItem.Kind, AItem.Sorted) then + AItem.Free; + // TODO: Modified +end; + +procedure TcxDataSummaryItems.GetDataItemProperties(AItemIndex: Integer; + APosition: TcxSummaryPosition; AProperties: TcxSummaryProperties; + var AFormat: string; var AKind: TcxSummaryKind; var ASorted: Boolean); +var + AItem: TcxDataSummaryItem; +begin + AItem := GetDataItem(AItemIndex, APosition); + if AItem <> nil then + begin + if spFormat in AProperties then AFormat := AItem.Format; + if spKind in AProperties then AKind := AItem.Kind; + if spSorted in AProperties then ASorted := AItem.Sorted; + end + else + begin + AFormat := ''; + AKind := skNone; + ASorted := False; + end; +end; + +function TcxDataSummaryItems.IsPropertiesEmpty(AProperties: TcxSummaryProperties; + const AFormat: string; AKind: TcxSummaryKind; ASorted: Boolean): Boolean; +begin + Result := True; + if (spFormat in AProperties) and (AFormat <> '') then + Result := False; + if (spKind in AProperties) and (AKind <> skNone) then + Result := False; + if (spSorted in AProperties) and ASorted then + Result := False; +end; + +procedure TcxDataSummaryItems.SetDataItemProperties(AItemIndex: Integer; + APosition: TcxSummaryPosition; AProperties: TcxSummaryProperties; + const AFormat: string; AKind: TcxSummaryKind; ASorted: Boolean); +var + AItem: TcxDataSummaryItem; +begin + AItem := GetDataItem(AItemIndex, APosition); + if AItem <> nil then + begin + SetItemProperties(AItem, APosition, AProperties, AFormat, AKind, ASorted); + CheckItemEmpty(AItem); + end + else + if not IsPropertiesEmpty(AProperties, AFormat, AKind, ASorted) then + begin + AItem := AddDataItem(AItemIndex, APosition); + SetItemProperties(AItem, APosition, AProperties, AFormat, AKind, ASorted); + end; + // TODO: Modified +end; + +procedure TcxDataSummaryItems.SetItemProperties(AItem: TcxDataSummaryItem; + APosition: TcxSummaryPosition; AProperties: TcxSummaryProperties; + const AFormat: string; AKind: TcxSummaryKind; ASorted: Boolean); +begin + if spFormat in AProperties then AItem.Format := AFormat; + if spKind in AProperties then AItem.Kind := AKind; + if spSorted in AProperties then AItem.Sorted := ASorted; +end; + +function TcxDataSummaryItems.GetDataController: TcxCustomDataController; +begin + Result := Summary.DataController; +end; + +function TcxDataSummaryItems.GetItem(Index: Integer): TcxDataSummaryItem; +begin + Result := TcxDataSummaryItem(inherited GetItem(Index)); +end; + +procedure TcxDataSummaryItems.SetItem(Index: Integer; Value: TcxDataSummaryItem); +begin + inherited SetItem(Index, Value); +end; + +{ TcxDataFooterSummaryItems } + +function TcxDataFooterSummaryItems.GetItemPosition(AItem: TcxDataSummaryItem): TcxSummaryPosition; +begin + Result := spFooter; +end; + +function TcxDataFooterSummaryItems.IsPositionStored(AItem: TcxDataSummaryItem): Boolean; +begin + Result := False; +end; + +{ TcxDataGroupSummaryItems } + +constructor TcxDataGroupSummaryItems.Create(ASummary: TcxDataSummary; + AItemClass: TcxDataSummaryItemClass); +begin + inherited Create(ASummary, AItemClass); + FBeginText := stBeginText; + FEndText := stEndText; + FSeparator := stSeparator; +end; + +procedure TcxDataGroupSummaryItems.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxDataGroupSummaryItems then + with TcxDataGroupSummaryItems(Source) do + begin + Self.BeginText := BeginText; + Self.EndText := EndText; + Self.Separator := Separator; + end; +end; + +function TcxDataGroupSummaryItems.GetGroupText(const ASummaryValues: Variant): string; +var + I: Integer; + S: string; +begin + Result := ''; + for I := 0 to Count - 1 do + if Items[I].Position = spGroup then + begin + S := Items[I].FormatValue(ASummaryValues[I], False); + if Result = '' then + Result := S + else + Result := Result + Separator + ' ' + S; + end; + if Result <> '' then + begin + if FBeginText <> '' then + Result := FBeginText + Result; + if FEndText <> '' then + Result := Result + FEndText; + end; +end; + +function TcxDataGroupSummaryItems.SortedSummaryItem: TcxDataSummaryItem; +var + I, ASortingBySummaryDataItemIndex: Integer; +begin + Result := nil; + ASortingBySummaryDataItemIndex := DataController.SortingBySummaryDataItemIndex; + if ASortingBySummaryDataItemIndex <> -1 then + Result := ItemOfItemLink(DataController.GetItem(ASortingBySummaryDataItemIndex)) + else + for I := 0 to Count - 1 do + if Items[I].Sorted then + begin + Result := Items[I]; + Break; + end; +end; + +procedure TcxDataGroupSummaryItems.BeforeSortingChange(AItem: TcxDataSummaryItem; + AValue: Boolean); +begin + inherited; + if AValue and (SortedSummaryItem <> nil) then + SortedSummaryItem.Sorted := False; +end; + +function TcxDataGroupSummaryItems.GetOwner: TPersistent; +begin + if FOwner <> nil then + Result := FOwner + else + Result := inherited GetOwner; +end; + +function TcxDataGroupSummaryItems.IsBeginTextStored: Boolean; +begin + Result := FBeginText <> stBeginText; +end; + +function TcxDataGroupSummaryItems.IsEndTextStored: Boolean; +begin + Result := FEndText <> stEndText; +end; + +function TcxDataGroupSummaryItems.IsSeparatorStored: Boolean; +begin + Result := FSeparator <> stSeparator; +end; + +procedure TcxDataGroupSummaryItems.SetBeginText(const Value: string); +begin + if FBeginText <> Value then + begin + FBeginText := Value; + ChangedView; + end; +end; + +procedure TcxDataGroupSummaryItems.SetEndText(const Value: string); +begin + if FEndText <> Value then + begin + FEndText := Value; + ChangedView; + end; +end; + +procedure TcxDataGroupSummaryItems.SetSeparator(const Value: string); +begin + if FSeparator <> Value then + begin + FSeparator := Value; + ChangedView; + end; +end; + +{ TcxDataSummaryGroupItemLink } + +function TcxDataSummaryGroupItemLink.GetSummaryGroupItemLinks: TcxDataSummaryGroupItemLinks; +begin + if Assigned(Collection) and (Collection is TcxDataSummaryGroupItemLinks) then + Result := TcxDataSummaryGroupItemLinks(Collection) + else + Result := nil; +end; + +function TcxDataSummaryGroupItemLink.GetDataController: TcxCustomDataController; +begin + Result := SummaryGroupItemLinks.SummaryGroup.SummaryGroups.Summary.DataController; +end; + +procedure TcxDataSummaryGroupItemLink.ItemLinkChanging(AField: TcxCustomDataField); +var + I: Integer; + ASummaryGroups: TcxDataSummaryGroups; + ASummaryGroup: TcxDataSummaryGroup; + AItem: TcxDataSummaryGroupItemLink; +begin + BeginUpdate; + try + ASummaryGroups := SummaryGroupItemLinks.SummaryGroup.SummaryGroups; + for I := 0 to ASummaryGroups.Count - 1 do + begin + ASummaryGroup := ASummaryGroups[I]; + AItem := ASummaryGroup.Links.ItemOfField(AField); + if AItem <> nil then + AItem.ItemLink := nil; + end; + finally + EndUpdate; + end; +end; + +{ TcxDataSummaryGroupItemLinks } + +constructor TcxDataSummaryGroupItemLinks.Create(ASummaryGroup: TcxDataSummaryGroup; + AItemClass: TcxDataSummaryGroupItemLinkClass); +begin + inherited Create(AItemClass); + FSummaryGroup := ASummaryGroup; +end; + +function TcxDataSummaryGroupItemLinks.Add: TcxDataSummaryGroupItemLink; +begin + Result := TcxDataSummaryGroupItemLink(inherited Add); +end; + +function TcxDataSummaryGroupItemLinks.IndexOfItemLink(AItemLink: TObject): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Count - 1 do + if Items[I].ItemLink = AItemLink then + begin + Result := I; + Break; + end; +end; + +function TcxDataSummaryGroupItemLinks.ItemOfItemLink(AItemLink: TObject): TcxDataSummaryGroupItemLink; +var + AIndex: Integer; +begin + AIndex := IndexOfItemLink(AItemLink); + if AIndex <> -1 then + Result := Items[AIndex] + else + Result := nil; +end; + +function TcxDataSummaryGroupItemLinks.GetOwner: TPersistent; +begin + Result := FSummaryGroup; +end; + +function TcxDataSummaryGroupItemLinks.IndexOfField(AField: TcxCustomDataField): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Count - 1 do + if Items[I].Field = AField then + begin + Result := I; + Break; + end; +end; + +function TcxDataSummaryGroupItemLinks.ItemOfField(AField: TcxCustomDataField): TcxDataSummaryGroupItemLink; +var + AIndex: Integer; +begin + AIndex := IndexOfField(AField); + if AIndex <> -1 then + Result := Items[AIndex] + else + Result := nil; +end; + +procedure TcxDataSummaryGroupItemLinks.Update(Item: TCollectionItem); +begin +// FSummaryGroup.Changed(Item <> nil); + FSummaryGroup.SummaryGroups.Update(nil); +end; + +function TcxDataSummaryGroupItemLinks.GetItem(Index: Integer): TcxDataSummaryGroupItemLink; +begin + Result := TcxDataSummaryGroupItemLink(inherited GetItem(Index)); +end; + +procedure TcxDataSummaryGroupItemLinks.SetItem(Index: Integer; Value: TcxDataSummaryGroupItemLink); +begin + inherited SetItem(Index, Value); +end; + +{ TcxDataSummaryGroup } + +constructor TcxDataSummaryGroup.Create(Collection: TCollection); +begin + FSummaryItems := TcxDataGroupSummaryItems.Create({SummaryGroups}(Collection as TcxDataSummaryGroups).Summary, + {SummaryGroups}(Collection as TcxDataSummaryGroups).Summary.GetSummaryItemClass); + FSummaryItems.FOwner := Self; + inherited Create(Collection); +end; + +destructor TcxDataSummaryGroup.Destroy; +begin + FSummaryItems.Free; + FSummaryItems := nil; + FItemLinks.Free; + FItemLinks := nil; + inherited Destroy; +end; + +procedure TcxDataSummaryGroup.Assign(Source: TPersistent); +begin + if Source is TcxDataSummaryGroup then + begin + Links := TcxDataSummaryGroup(Source).Links; + SummaryItems := TcxDataSummaryGroup(Source).SummaryItems; + end + else + inherited Assign(Source); +end; + +function TcxDataSummaryGroup.GetItemLinks: TcxDataSummaryGroupItemLinks; +begin + if not Assigned(FItemLinks) then + FItemLinks := TcxDataSummaryGroupItemLinks.Create(Self, + {SummaryGroups}(Collection as TcxDataSummaryGroups).Summary.GetSummaryGroupItemLinkClass); + Result := FItemLinks; +end; + +function TcxDataSummaryGroup.GetSummaryGroups: TcxDataSummaryGroups; +begin + if Assigned(Collection) and (Collection is TcxDataSummaryGroups) then + Result := TcxDataSummaryGroups(Collection) + else + Result := nil; +end; + +procedure TcxDataSummaryGroup.SetItemLinks(Value: TcxDataSummaryGroupItemLinks); +begin + Links.Assign(Value); +end; + +procedure TcxDataSummaryGroup.SetSummaryItems(Value: TcxDataGroupSummaryItems); +begin + SummaryItems.Assign(Value); +end; + +{ TcxDataSummaryGroups } + +constructor TcxDataSummaryGroups.Create(ASummary: TcxDataSummary); +begin + inherited Create(TcxDataSummaryGroup); + FSummary := ASummary; +end; + +function TcxDataSummaryGroups.Add: TcxDataSummaryGroup; +begin + Result := TcxDataSummaryGroup(inherited Add); +end; + +function TcxDataSummaryGroups.FindByItemLink(AItemLink: TObject): TcxDataSummaryGroup; +var + I: Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + if Items[I].Links.IndexOfItemLink(AItemLink) <> -1 then + begin + Result := Items[I]; + Break; + end; +end; + +function TcxDataSummaryGroups.GetOwner: TPersistent; +begin + Result := FSummary; +end; + +procedure TcxDataSummaryGroups.Update(Item: TCollectionItem); +begin + Summary.Changed(False); +end; + +function TcxDataSummaryGroups.GetItem(Index: Integer): TcxDataSummaryGroup; +begin + Result := TcxDataSummaryGroup(inherited GetItem(Index)); +end; + +procedure TcxDataSummaryGroups.SetItem(Index: Integer; Value: TcxDataSummaryGroup); +begin + inherited SetItem(Index, Value); +end; + +{ TcxDataSummary } + +constructor TcxDataSummary.Create(ADataController: TcxCustomDataController); +begin + inherited Create; + FDataController := ADataController; + FDefaultGroupSummaryItems := TcxDataGroupSummaryItems.Create(Self, GetSummaryItemClass); + FFooterSummaryItems := TcxDataFooterSummaryItems.Create(Self, GetSummaryItemClass); + FSummaryGroups := TcxDataSummaryGroups.Create(Self); +end; + +destructor TcxDataSummary.Destroy; +begin + FDestroying := True; + FDefaultGroupSummaryItems.Free; + FDefaultGroupSummaryItems := nil; + FFooterSummaryItems.Free; + FFooterSummaryItems := nil; + FSummaryGroups.Free; + FSummaryGroups := nil; + inherited Destroy; +end; + +procedure TcxDataSummary.Assign(Source: TPersistent); +begin + if Source is TcxDataSummary then + begin + BeginUpdate; + try + DefaultGroupSummaryItems := TcxDataSummary(Source).DefaultGroupSummaryItems; + FooterSummaryItems := TcxDataSummary(Source).FooterSummaryItems; + SummaryGroups := TcxDataSummary(Source).SummaryGroups; + Options := TcxDataSummary(Source).Options; + AssignEvents(Source); // TODO: option? + finally + EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxDataSummary.AssignEvents(Source: TPersistent); +begin + if Source is TcxDataSummary then + OnAfterSummary := TcxDataSummary(Source).OnAfterSummary; +end; + +procedure TcxDataSummary.BeginUpdate; +begin + DataController.BeginUpdate; + Inc(FLockCount); +end; + +procedure TcxDataSummary.BeginCalculate; +begin + if FSetCustomSummary then Exit; + CalculateFooterSummary; +end; + +procedure TcxDataSummary.EndCalculate; +begin + if FSetCustomSummary then Exit; + CalculateGroupSummary; + DoAfterSummary; +end; + +procedure TcxDataSummary.Calculate; +begin + BeginCalculate; + EndCalculate; +end; + +procedure TcxDataSummary.CalculateFooterSummary; +var + ACountValues: TcxDataSummaryCountValues; + ASummaryValues: TcxDataSummaryValues; +begin + BeginCalculateSummary(FooterSummaryItems, ACountValues, ASummaryValues); + if not DataController.IsGridMode then + CalculateSummary(FooterSummaryItems, 0, DataController.DataControllerInfo.GetInternalRecordCount - 1, + ACountValues, ASummaryValues, FFooterSummaryValues); + EndCalculateSummary(FooterSummaryItems, ACountValues, ASummaryValues, FFooterSummaryValues); +end; + +procedure TcxDataSummary.CalculateGroupSummary; + + procedure CalcLevel(ADataGroups: TcxDataGroups; ALevel: Integer); + var + ASummaryItems: TcxDataSummaryItems; + ACurIndex, AGroupIndex: Integer; + ACountValues: TcxDataSummaryCountValues; + ASummaryValues: TcxDataSummaryValues; + SV: Variant; + begin + ASummaryItems := GroupSummaryItems[ALevel]; + ACurIndex := 0; + AGroupIndex := -1; + while ACurIndex < ADataGroups.Count do + begin + if ADataGroups[ACurIndex].Level = ALevel then + begin + if AGroupIndex <> -1 then // close summary + begin + SV := ADataGroups[AGroupIndex].SummaryValues; + EndCalculateSummary(ASummaryItems, ACountValues, ASummaryValues, SV); + ADataGroups[AGroupIndex].SummaryValues := SV; + end; + AGroupIndex := ACurIndex; + BeginCalculateSummary(ASummaryItems, ACountValues, ASummaryValues); + end; + if ADataGroups[ACurIndex].Level = (ADataGroups.LevelCount - 1) then + begin + SV := ADataGroups[ACurIndex].SummaryValues; + CalculateSummary(ASummaryItems, ADataGroups[ACurIndex].BeginRecordListIndex, + ADataGroups[ACurIndex].EndRecordListIndex, ACountValues, ASummaryValues, + SV); + ADataGroups[ACurIndex].SummaryValues := SV; + end; + Inc(ACurIndex); + end; + if AGroupIndex <> -1 then // close summary + begin + SV := ADataGroups[AGroupIndex].SummaryValues; + EndCalculateSummary(ASummaryItems, ACountValues, ASummaryValues, SV); + ADataGroups[AGroupIndex].SummaryValues := SV; + end; + end; + +var + I: Integer; +begin + for I := 0 to DataController.DataControllerInfo.GroupingFieldList.Count - 1 do + CalcLevel(DataController.DataControllerInfo.DataGroups, I); +end; + +procedure TcxDataSummary.CancelUpdate; +begin + DataController.EndUpdate; //? + Dec(FLockCount); +end; + +procedure TcxDataSummary.EndUpdate; +begin + Dec(FLockCount); + Changed(False); + DataController.EndUpdate; +end; + +function TcxDataSummary.GetGroupSummaryInfo(ARowIndex: Integer; var ASummaryItems: TcxDataSummaryItems; + var ASummaryValues: PVariant): Boolean; +var + ADataGroupIndex, ALevel: Integer; +begin + ADataGroupIndex := DataController.DataControllerInfo.DataGroups.GetIndexByRowIndex(ARowIndex); + Result := ADataGroupIndex <> -1; + if Result then + begin + ALevel := DataController.DataControllerInfo.DataGroups[ADataGroupIndex].Level; + ASummaryItems := GroupSummaryItems[ALevel]; + ASummaryValues := GetGroupSummaryValues(ADataGroupIndex); + Result := (ASummaryItems <> nil) and (ASummaryValues <> nil) and + not VarIsEmpty(ASummaryValues^); + end; +end; + +function TcxDataSummary.GetPatternSummaryItems(APatternSummary: TcxDataSummary; + ASummaryItems: TcxDataSummaryItems): TcxDataSummaryItems; +begin + if ASummaryItems = FooterSummaryItems then + Result := APatternSummary.FooterSummaryItems + else + if ASummaryItems = DefaultGroupSummaryItems then + Result := APatternSummary.DefaultGroupSummaryItems + else + Result := APatternSummary.SummaryGroups[(ASummaryItems.Owner as TcxDataSummaryGroup).Index].SummaryItems; +end; + +procedure TcxDataSummary.Recalculate; +begin + Changed(False); +// BeginUpdate; +// EndUpdate; +end; + +procedure TcxDataSummary.RemoveItemByField(AField: TcxCustomDataField); + + function RemoveInSummaryItems(ASummaryItems: TcxDataSummaryItems): Boolean; + var + AItem: TcxDataSummaryItem; + begin + Result := False; + repeat + AItem := ASummaryItems.ItemOfField(AField); + if AItem <> nil then + begin + //AItem.Free; + AItem.FField := nil; + Result := True; + end; + until AItem = nil; + end; + + function RemoveInLinks(ALinks: TcxDataSummaryGroupItemLinks): Boolean; + var + AItem: TcxDataSummaryGroupItemLink; + begin + Result := False; + repeat + AItem := ALinks.ItemOfField(AField); + if AItem <> nil then + begin + //AItem.Free; + AItem.FField := nil; + Result := True; + end; + until AItem = nil; + end; + + function RemoveInSummaryGroup(ASummaryGroup: TcxDataSummaryGroup): Boolean; + begin + Result := False; + if RemoveInSummaryItems(ASummaryGroup.SummaryItems) then + Result := True; + if RemoveInLinks(ASummaryGroup.Links) then + Result := True; + end; + + function RemoveInSummaryGroups: Boolean; + var + I: Integer; + begin + Result := False; + for I := 0 to SummaryGroups.Count - 1 do + if RemoveInSummaryGroup(SummaryGroups[I]) then + Result := True; + end; + +var + AChanged: Boolean; +begin + BeginUpdate; + AChanged := False; + try + if RemoveInSummaryItems(FooterSummaryItems) then + AChanged := True; + if RemoveInSummaryItems(DefaultGroupSummaryItems) then + AChanged := True; + if RemoveInSummaryGroups then + AChanged := True; + finally + if AChanged then + EndUpdate + else + CancelUpdate; + end; +end; + +procedure TcxDataSummary.BeginCalculateSummary(ASummaryItems: TcxDataSummaryItems; + var ACountValues: TcxDataSummaryCountValues; var ASummaryValues: TcxDataSummaryValues); +var + I: Integer; +begin + SetLength(ASummaryValues, 0); // Clear + SetLength(ACountValues, 0); // Clear + SetLength(ASummaryValues, ASummaryItems.Count); + SetLength(ACountValues, ASummaryItems.Count); // for Average + for I := 0 to ASummaryItems.Count - 1 do + ACountValues[I] := 0; +end; + +procedure TcxDataSummary.CalculateSummary(ASummaryItems: TcxDataSummaryItems; + ABeginIndex, AEndIndex: Integer; var ACountValues: TcxDataSummaryCountValues; + var ASummaryValues: TcxDataSummaryValues; var SummaryValues: Variant); +var + I, J, ARecordIndex: Integer; +begin + for I := ABeginIndex to AEndIndex do + begin + ARecordIndex := GetRecordIndex(I); + if ARecordIndex <> -1 then + for J := 0 to ASummaryItems.Count - 1 do + DoSummaryValue(ASummaryItems[J], ARecordIndex, ASummaryValues[J], ACountValues[J]); + end; +end; + +procedure TcxDataSummary.Changed(ARedrawOnly: Boolean); +begin + if FInAfterSummary then Exit; + if LockCount = 0 then + Update(ARedrawOnly); +end; + +procedure TcxDataSummary.DoAfterSummary; +begin + if Assigned(FOnAfterSummary) then + begin + if DataController.IsLoading then + DataController.FAfterSummaryFlag := True + else + begin + DataController.FAfterSummaryFlag := False; + FInAfterSummary := True; + try + if not DataController.IsPattern and not DataController.LockOnAfterSummary then + FOnAfterSummary(Self); + finally + FInAfterSummary := False; + end; + end; + end; +end; + +procedure TcxDataSummary.DoFinishSummaryValue(ASummaryItem: TcxDataSummaryItem; + var SummaryValue: Variant; var CountValue: Integer); +var + AVarIsDate: Boolean; +begin + if not ASummaryItem.IsDataBinded then Exit; + if VarIsEmpty(SummaryValue) then + SummaryValue := Null; + case ASummaryItem.Kind of + skCount: + SummaryValue := CountValue; + skAverage: + if (CountValue > 0) and not VarIsEmpty(SummaryValue) then + begin + AVarIsDate := VarIsDate(SummaryValue); + SummaryValue := SummaryValue / CountValue; + if AVarIsDate then + VarCast(SummaryValue, SummaryValue, varDate); // WORKAROUND + end; + end; +end; + +procedure TcxDataSummary.DoSummaryValue(ASummaryItem: TcxDataSummaryItem; + ARecordIndex: Integer; var SummaryValue: Variant; var CountValue: Integer); +var + AArguments: TcxSummaryEventArguments; + AOutArguments: TcxSummaryEventOutArguments; +begin + if not ASummaryItem.IsDataBinded then Exit; + if ASummaryItem.DataField <> nil then + AOutArguments.Value := DataController.GetInternalValue(ARecordIndex, ASummaryItem.DataField) + else + AOutArguments.Value := Null; + AOutArguments.Done := False; + if Assigned(ASummaryItem.SummaryItems.FOnSummary) then + begin + AArguments.RecordIndex := ARecordIndex; + AArguments.SummaryItem := ASummaryItem; + AOutArguments.SummaryValue := SummaryValue; + AOutArguments.CountValue := CountValue; + ASummaryItem.SummaryItems.FOnSummary(ASummaryItem.SummaryItems, + AArguments, AOutArguments); + SummaryValue := AOutArguments.SummaryValue; + CountValue := AOutArguments.CountValue; + end; + if not AOutArguments.Done and (ASummaryItem.Kind <> skNone) and + not ((soNullIgnore in Options) and VarIsNull(AOutArguments.Value)) then + begin + if VarIsEmpty(SummaryValue) then + begin + if ASummaryItem.Kind <> skCount then + begin + if not (VarIsNull(AOutArguments.Value) and (ASummaryItem.Kind in [skMin, skMax])) then + begin + SummaryValue := AOutArguments.Value; + if VarIsNull(SummaryValue) and (ASummaryItem.Kind in [skSum, skAverage]) then + SummaryValue := 0; + end; + end; + end + else + if not VarIsNull(AOutArguments.Value) and not VarIsNull(SummaryValue) then + begin + case ASummaryItem.Kind of + skSum, skAverage: + SummaryValue := SummaryValue + AOutArguments.Value; + skMin: + if AOutArguments.Value < SummaryValue then + SummaryValue := AOutArguments.Value; + skMax: + if AOutArguments.Value > SummaryValue then + SummaryValue := AOutArguments.Value; + end; + end; + Inc(CountValue); + end; +end; + +procedure TcxDataSummary.EndCalculateSummary(ASummaryItems: TcxDataSummaryItems; + var ACountValues: TcxDataSummaryCountValues; var ASummaryValues: TcxDataSummaryValues; + var SummaryValues: Variant); +var + J: Integer; +begin + for J := 0 to ASummaryItems.Count - 1 do + DoFinishSummaryValue(ASummaryItems[J], ASummaryValues[J], ACountValues[J]); +// {$IFDEF DELPHI5} +// SummaryValues := Variant(ASummaryValues); +// {$ELSE} + if Length(ASummaryValues) = 0 then + SummaryValues := Null + else + SummaryValues := Variant(ASummaryValues); +// {$ENDIF} +end; + +function TcxDataSummary.GetGroupSummaryValues(ADataGroupIndex: TcxDataGroupIndex): PVariant; +begin + if ADataGroupIndex <> -1 then + Result := @DataController.DataControllerInfo.DataGroups[ADataGroupIndex].SummaryValues + else + Result := nil; +end; + +function TcxDataSummary.GetOwner: TPersistent; +begin + Result := FDataController; +end; + +function TcxDataSummary.GetRecordIndex(ARecordListIndex: Integer): Integer; +begin + Result := DataController.DataControllerInfo.GetInternalRecordIndex(ARecordListIndex); + if DataController.DataControllerInfo.IsSummaryForSelectedRecords then + begin + if DataController.IsFocusedSelectedMode then + begin + if Result <> DataController.DataControllerInfo.FocusedRecordIndex then + Result := -1; + end + else + if not DataController.DataControllerInfo.Selection.IsRecordSelected(Result) then + Result := -1; + end; +end; + +function TcxDataSummary.GetSummaryItemClass: TcxDataSummaryItemClass; +begin + Result := DataController.GetSummaryItemClass; +end; + +function TcxDataSummary.GetSummaryGroupItemLinkClass: TcxDataSummaryGroupItemLinkClass; +begin + Result := DataController.GetSummaryGroupItemLinkClass; +end; + +function TcxDataSummary.IsValidSummaryValuesIndex(const ASummaryValues: Variant; + AIndex: Integer): Boolean; +begin + Result := VarIsArray(ASummaryValues) and + (VarArrayLowBound(ASummaryValues, 1) <= AIndex) and + (AIndex <= VarArrayHighBound(ASummaryValues, 1)); +end; + +procedure TcxDataSummary.Update(ARedrawOnly: Boolean); +begin + if not FDestroying then + DataController.SummaryChanged(ARedrawOnly); +end; + +function TcxDataSummary.GetFooterSummaryValue(Index: Integer): Variant; +begin + Result := Null; + if IsValidSummaryValuesIndex(FFooterSummaryValues, Index) then + Result := FFooterSummaryValues[Index]; +end; + +function TcxDataSummary.GetFooterSummaryText(Index: Integer): string; +begin + Result := FooterSummaryItems[Index].FormatValue(FooterSummaryValues[Index], True); +end; + +function TcxDataSummary.GetGroupSummaryItems(Level: Integer): TcxDataGroupSummaryItems; +var + ASummaryGroup: TcxDataSummaryGroup; +begin + if (0 <= Level) and (Level < DataController.DataControllerInfo.GroupingFieldList.Count) then + begin + ASummaryGroup := SummaryGroups.FindByItemLink(DataController.DataControllerInfo.GroupingFieldList[Level].Field.Item); +// ASummaryGroup := SummaryGroups.FindByItemLink(DataController.DataControllerInfo.DataGroups.Fields[Level].Item); + if ASummaryGroup <> nil then + Result := ASummaryGroup.SummaryItems + else + Result := DefaultGroupSummaryItems; + end + else + Result := nil; +end; + +function TcxDataSummary.GetGroupSummaryText(RowIndex: Integer): string; +var + ASummaryItems: TcxDataSummaryItems; + PSummaryValues: PVariant; +begin + if GetGroupSummaryInfo(RowIndex, ASummaryItems, PSummaryValues) then + Result := ASummaryItems.GetGroupText(PSummaryValues^) + else + Result := ''; +end; + +function TcxDataSummary.GetGroupSummaryDisplayValue(RowIndex, Level, Index: Integer): Variant; +var + ADataGroupIndex: Integer; +begin + ADataGroupIndex := DataController.DataControllerInfo.DataGroups.GetIndexByRowIndexLevel(RowIndex, Level); + Result := GroupSummaryValues[ADataGroupIndex, Index]; +end; + +function TcxDataSummary.GetGroupSummaryValue(DataGroupIndex: TcxDataGroupIndex; + Index: Integer): Variant; +var + PSummaryValues: PVariant; +begin + PSummaryValues := GetGroupSummaryValues(DataGroupIndex); + if (PSummaryValues <> nil) and IsValidSummaryValuesIndex(PSummaryValues^, Index) then + Result := PSummaryValues^[Index] + else + Result := Null; +end; + +function TcxDataSummary.GetGroupFooterIndexOfItemLink(Level: Integer; ItemLink: TObject): Integer; +var + ASummaryItems: TcxDataSummaryItems; + I: Integer; +begin + Result := -1; + ASummaryItems := GroupSummaryItems[Level]; + if ASummaryItems <> nil then + for I := 0 to ASummaryItems.Count - 1 do + if (ASummaryItems[I].Position = spFooter) and (ASummaryItems[I].ItemLink = ItemLink) then + begin + Result := I; + Break; + end; +end; + +function TcxDataSummary.GetGroupFooterSummaryText(RowIndex, Level, Index: Integer): string; +var + ADataGroupIndex: Integer; + ASummaryItems: TcxDataSummaryItems; + PSummaryValues: PVariant; +begin + Result := ''; + ADataGroupIndex := DataController.DataControllerInfo.DataGroups.GetIndexByRowIndexLevel(RowIndex, Level); + if ADataGroupIndex <> -1 then + begin + ASummaryItems := GroupSummaryItems[Level]; + PSummaryValues := GetGroupSummaryValues(ADataGroupIndex); + if (ASummaryItems <> nil) and (PSummaryValues <> nil) and + IsValidSummaryValuesIndex(PSummaryValues^, Index) then + Result := ASummaryItems[Index].FormatValue(PSummaryValues^[Index], True); + end; +end; + +function TcxDataSummary.GetOptions: TcxSummaryOptions; +begin + Result := FOptions; +end; + +procedure TcxDataSummary.SetDefaultGroupSummaryItems(Value: TcxDataGroupSummaryItems); +begin + FDefaultGroupSummaryItems.Assign(Value); +end; + +procedure TcxDataSummary.SetFooterSummaryItems(Value: TcxDataFooterSummaryItems); +begin + FFooterSummaryItems.Assign(Value); +end; + +procedure TcxDataSummary.SetFooterSummaryValue(Index: Integer; Value: Variant); +begin + if FooterSummaryValues[Index] <> Value then + begin + if IsValidSummaryValuesIndex(FFooterSummaryValues, Index) then + begin + FSetCustomSummary := True; + try + FFooterSummaryValues[Index] := Value; + Changed(True); + finally + FSetCustomSummary := False; + end; + end; + end; +end; + +procedure TcxDataSummary.SetGroupSummaryDisplayValue(RowIndex, Level, Index: Integer; const Value: Variant); +var + ADataGroupIndex: Integer; +begin + ADataGroupIndex := DataController.DataControllerInfo.DataGroups.GetIndexByRowIndexLevel(RowIndex, Level); + GroupSummaryValues[ADataGroupIndex, Index] := Value; +end; + +procedure TcxDataSummary.SetGroupSummaryValue(DataGroupIndex: TcxDataGroupIndex; + Index: Integer; const Value: Variant); +var + PSummaryValues: PVariant; +begin + if GetGroupSummaryValue(DataGroupIndex, Index) <> Value then + begin + PSummaryValues := GetGroupSummaryValues(DataGroupIndex); + if (PSummaryValues <> nil) and IsValidSummaryValuesIndex(PSummaryValues^, Index) then + begin + FSetCustomSummary := True; + try + PSummaryValues^[Index] := Value; + Changed(True); + finally + FSetCustomSummary := False; + end; + end; + end; +end; + +procedure TcxDataSummary.SetOptions(Value: TcxSummaryOptions); +begin + if FOptions <> Value then + begin + // only one: soSelectedRecords or soSelections + if Value * [soSelectedRecords, soMultipleSelectedRecords] = [soSelectedRecords, soMultipleSelectedRecords] then + begin + if soMultipleSelectedRecords in FOptions then + Value := Value - [soMultipleSelectedRecords] + else + Value := Value - [soSelectedRecords]; + end; + FOptions := Value; + Changed(False); + end; +end; + +procedure TcxDataSummary.SetSummaryGroups(Value: TcxDataSummaryGroups); +begin + SummaryGroups.Assign(Value); +end; + +{ TcxDataControllerSearch } + +constructor TcxDataControllerSearch.Create(ADataController: TcxCustomDataController); +begin + inherited Create; + FDataController := ADataController; +end; + +procedure TcxDataControllerSearch.Cancel; +begin + if Locked then Exit; + if DataController.FIncrementalSearching then + begin + DataController.FIncrementalSearchText := ''; + DataController.FIncrementalSearching := False; + DataController.Change([dccSearch]); + end; +end; + +function TcxDataControllerSearch.Locate(AItemIndex: Integer; const ASubText: string): Boolean; +var + AFilteredRecordIndex, AStartFilteredRecordIndex, AEndFilteredRecordIndex, AFocusedRecordIndex: Integer; +begin + Result := False; + if (ASubText = '') or (DataController.FilteredRecordCount = 0) then Exit; + ItemIndex := AItemIndex; + if DataController.IsGridMode then + Result := DataController.DoSearchInGridMode(ASubText, True, False) + else + begin + AFocusedRecordIndex := DataController.GetFocusedRecordIndex; + if AFocusedRecordIndex < 0 then + AStartFilteredRecordIndex := 0 + else + AStartFilteredRecordIndex := DataController.FilteredIndexByRecordIndex[AFocusedRecordIndex]; + AFilteredRecordIndex := DoSearch(AStartFilteredRecordIndex, -1, ASubText, True); + if AFilteredRecordIndex = -1 then + begin + AEndFilteredRecordIndex := AStartFilteredRecordIndex - 1; + AStartFilteredRecordIndex := 0; + AFilteredRecordIndex := DoSearch(AStartFilteredRecordIndex, AEndFilteredRecordIndex, ASubText, True); + end; + if AFilteredRecordIndex <> -1 then + begin + DoFocusedRecord(AFilteredRecordIndex); + Result := True; + end; + end; + if Result then + begin + DataController.FIncrementalSearching := True; + DataController.FIncrementalSearchText := ASubText; + DataController.Change([dccSearch]); + DataController.CheckFocusedSelected; + end; +end; + +function TcxDataControllerSearch.LocateNext(AForward: Boolean): Boolean; +var + AFilteredRecordIndex, AFocusedRecordIndex: Integer; +begin + Result := False; + if not Searching or (SearchText = '') or (ItemIndex = -1) or + (DataController.FilteredRecordCount = 0) then Exit; + if DataController.IsGridMode then + Result := DataController.DoSearchInGridMode(SearchText, AForward, True) + else + begin + AFocusedRecordIndex := DataController.GetFocusedRecordIndex; + if AFocusedRecordIndex < 0 then Exit; + if AForward then + begin + AFilteredRecordIndex := DataController.FilteredIndexByRecordIndex[AFocusedRecordIndex] + 1; + if AFilteredRecordIndex >= DataController.FilteredRecordCount then Exit; + end + else + begin + AFilteredRecordIndex := DataController.FilteredIndexByRecordIndex[AFocusedRecordIndex] - 1; + if AFilteredRecordIndex < 0 then Exit; + end; + AFilteredRecordIndex := DoSearch(AFilteredRecordIndex, -1, SearchText, AForward); + if AFilteredRecordIndex <> -1 then + begin + DoFocusedRecord(AFilteredRecordIndex); + Result := True; + end; + end; + if Result then + DataController.CheckFocusedSelected; +end; + +procedure TcxDataControllerSearch.Lock; +begin + FLocked := True; +end; + +procedure TcxDataControllerSearch.Unlock; +begin + FLocked := False; +end; + +procedure TcxDataControllerSearch.DoFocusedRecord(AFilteredRecordIndex: Integer); +var + AFocusedRecordIndex: Integer; +begin + AFocusedRecordIndex := DataController.FilteredRecordIndex[AFilteredRecordIndex]; + Lock; + try + DataController.ChangeFocusedRecordIndex(AFocusedRecordIndex); + DataController.SyncSelectionFocusedRecord; + finally + Unlock; + end; +end; + +function TcxDataControllerSearch.DoSearch(AStartFilteredRecordIndex, AEndFilteredRecordIndex: Integer; + const ASubText: string; AForward: Boolean): Integer; +var + I, ARecordIndex, AFieldIndex: Integer; + S: string; +begin + Result := -1; + if AEndFilteredRecordIndex = -1 then // auto + begin + if AForward then + AEndFilteredRecordIndex := DataController.FilteredRecordCount - 1 + else + AEndFilteredRecordIndex := 0; + end; + AFieldIndex := DataController.FIncrementalSearchField.Index; + I := AStartFilteredRecordIndex; + while (AForward and (I <= AEndFilteredRecordIndex)) or + (not AForward and (I >= AEndFilteredRecordIndex)) do + begin + ARecordIndex := DataController.FilteredRecordIndex[I]; + S := DataController.GetIncrementalSearchText(ARecordIndex, AFieldIndex); + if DataCompareText(S, ASubText, True) then + begin + Result := I; + Break; + end; + if AForward then + Inc(I) + else + Dec(I); + end; +end; + +function TcxDataControllerSearch.GetItemIndex: Integer; +begin + if DataController.FIncrementalSearchField <> nil then + Result := DataController.FIncrementalSearchField.Index + else + Result := -1; +end; + +function TcxDataControllerSearch.GetSearching: Boolean; +begin + Result := DataController.FIncrementalSearching; +end; + +function TcxDataControllerSearch.GetSearchText: string; +begin + Result := DataController.FIncrementalSearchText; +end; + +procedure TcxDataControllerSearch.SetItemIndex(const Value: Integer); +begin + DataController.CheckItemRange(Value); + DataController.FIncrementalSearchField := DataController.Fields[Value]; +end; + +{ TcxFocusedRecordChangedInfo } + +constructor TcxFocusedRecordChangedInfo.Create(APrevFocusedRecordIndex, AFocusedRecordIndex, + APrevFocusedRowIndex, AFocusedRowIndex: Integer; ANewItemRowFocusingChanged: Boolean); +begin + inherited Create; + FFocusedRecordIndex := APrevFocusedRecordIndex; + FPrevFocusedRecordIndex := AFocusedRecordIndex; + FPrevFocusedRowIndex := APrevFocusedRowIndex; + FFocusedRowIndex := AFocusedRowIndex; + FNewItemRowFocusingChanged := ANewItemRowFocusingChanged; +end; + +{ TcxFocusedRowChangedInfo } + +constructor TcxFocusedRowChangedInfo.Create(APrevFocusedRowIndex, AFocusedRowIndex: Integer); +begin + inherited Create; + FFocusedRowIndex := AFocusedRowIndex; + FPrevFocusedRowIndex := APrevFocusedRowIndex; +end; + +{ TcxUpdateRecordInfo } + +constructor TcxUpdateRecordInfo.Create(ARecordIndex: Integer); +begin + inherited Create; + FRecordIndex := ARecordIndex; +end; + +{ TcxSelectionChangedInfo } + +constructor TcxSelectionChangedInfo.Create; +begin + inherited Create; + FRowIndexes := TList.Create; +end; + +constructor TcxSelectionChangedInfo.CreateEx(ARowIndex1, ARowIndex2: Integer); +begin + Create; + if ARowIndex1 <> -1 then + FRowIndexes.Add(Pointer(ARowIndex1)); + if (ARowIndex2 <> -1) and (ARowIndex2 <> ARowIndex1) then + FRowIndexes.Add(Pointer(ARowIndex2)); +end; + +destructor TcxSelectionChangedInfo.Destroy; +begin + FRowIndexes.Free; + inherited Destroy; +end; + +function TcxSelectionChangedInfo.GetCount: Integer; +begin + Result := FRowIndexes.Count; +end; + +function TcxSelectionChangedInfo.GetRowIndex(Index: Integer): Integer; +begin + Result := Integer(FRowIndexes[Index]); +end; + +{ TcxDataControllerLocateObject } + +constructor TcxDataControllerLocateObject.Create(ADataController: TcxCustomDataController); +begin + inherited Create; + FDataController := ADataController; +end; + +destructor TcxDataControllerLocateObject.Destroy; +begin + Clear; + inherited Destroy; +end; + +procedure TcxDataControllerLocateObject.Clear; +begin + if FInternalRecordIndex < 0 then + begin + FDataController.DataStorage.DeleteRecord(FInternalRecordIndex); + FInternalRecordIndex := 0; + end; +end; + +procedure TcxDataControllerLocateObject.ReadData(AValueDefReader: TcxValueDefReader); +begin + if FInternalRecordIndex = 0 then + FInternalRecordIndex := FDataController.DataStorage.AddInternalRecord; + FDataController.BeginReadRecord; + try + FDataController.DataStorage.ReadRecord(FInternalRecordIndex, AValueDefReader); + finally + FDataController.EndReadRecord; + end; +end; + +{ TcxDataControllerKeyLocateObject } + +constructor TcxDataControllerKeyLocateObject.Create(ADataController: TcxCustomDataController); +begin + inherited Create(ADataController); + FFields := TList.Create; +end; + +destructor TcxDataControllerKeyLocateObject.Destroy; +begin + Clear; + FFields.Free; + inherited Destroy; +end; + +procedure TcxDataControllerKeyLocateObject.AddField(AField: TcxCustomDataField); +begin + FFields.Add(AField); +end; + +procedure TcxDataControllerKeyLocateObject.ClearFields; +begin + FFields.Clear; +end; + +function TcxDataControllerKeyLocateObject.FindRecordIndex: Integer; +begin + if InternalRecordIndex < 0 then + Result := FDataController.FindRecordByFields(InternalRecordIndex, FFields) + else + Result := -1; +end; + +{ TcxDataControllerGroupLocateObject } + +constructor TcxDataControllerGroupLocateObject.Create(ADataController: TcxCustomDataController); +var + I: Integer; + AField: TcxCustomDataField; +begin + inherited Create(ADataController); + FFields := TList.Create; + FFindGroupRecordEnabled := True; + for I := 0 to DataController.Groups.GroupingItemCount - 1 do + begin + AField := DataController.Fields[DataController.Groups.GroupingItemIndex[I]]; + FFields.Add(AField); + if DataController.IsSortByDisplayTextNeeded(AField) then + FFindGroupRecordEnabled := False; + end; + FFindFields := TList.Create; + CorrectFindFields; +end; + +destructor TcxDataControllerGroupLocateObject.Destroy; +begin + FFindFields.Free; + FFields.Free; + inherited Destroy; +end; + +function TcxDataControllerGroupLocateObject.FindRecordIndex: Integer; +begin + if InternalRecordIndex < 0 then + begin + if FFindGroupRecordEnabled then + Result := FDataController.FindGroupRecord(InternalRecordIndex, Level + 1) + else + begin + FDataController.FInternalFindRecord := True; + try + Result := FDataController.FindRecordByFields(InternalRecordIndex, FFindFields); + finally + FDataController.FInternalFindRecord := False; + end; + end; + end + else + Result := -1; +end; + +procedure TcxDataControllerGroupLocateObject.CorrectFindFields; +var + I: Integer; +begin + if not FFindGroupRecordEnabled then + begin + ListSetCount(FFindFields, Level + 1); + for I := 0 to FFindFields.Count - 1 do + FFindFields[I] := FFields[I]; + end; +end; + +procedure TcxDataControllerGroupLocateObject.SetLevel(Value: Integer); +begin + if FLevel <> Value then + begin + FLevel := Value; + CorrectFindFields; + end; +end; + +{ TcxValueDefUnboundReader } + +constructor TcxValueDefUnboundReader.Create; +begin + inherited Create; + FItems := TList.Create; + FValues := TList.Create; +end; + +destructor TcxValueDefUnboundReader.Destroy; +begin + Clear; + FValues.Free; + FItems.Free; + inherited Destroy; +end; + +procedure TcxValueDefUnboundReader.Clear; +begin + Truncate(0); +end; + +function TcxValueDefUnboundReader.GetValue(AValueDef: TcxValueDef): Variant; +var + I: Integer; + P: PVariant; +begin + if AValueDef is TcxInternalValueDef then + AValueDef := TcxInternalValueDef(AValueDef).GetValueDef; + I := FItems.IndexOf(AValueDef); + if I <> -1 then + begin + P := PVariant(FValues[I]); + if P <> nil then + Result := P^ + else + Result := Null; + end + else + Result := Null; +end; + +function TcxValueDefUnboundReader.IsInternal(AValueDef: TcxValueDef): Boolean; +begin + Result := IsValueDefInternal(AValueDef); +end; + +procedure TcxValueDefUnboundReader.SetValue(AValueDef: TcxValueDef; const AValue: Variant); +var + I: Integer; + P: PVariant; +begin + I := FItems.IndexOf(AValueDef); + if I = -1 then + I := FItems.Add(AValueDef); + while FValues.Count < FItems.Count do + FValues.Add(nil); + P := PVariant(FValues[I]); + if P = nil then + begin + New(P); + FValues[I] := P; + end; + P^ := AValue; +end; + +procedure TcxValueDefUnboundReader.Truncate(AItemCount: Integer); +var + I: Integer; +begin + for I := FValues.Count - 1 downto AItemCount do + begin + if PVariant(FValues[I]) <> nil then + Dispose(PVariant(FValues[I])); + FValues.Delete(I); + end; +end; + +{ TcxValueDefRecordReader } + +constructor TcxValueDefRecordReader.Create(ADataController: TcxCustomDataController; + ARecordIndex: Integer); +begin + inherited Create; + FDataController := ADataController; + FRecordIndex := ARecordIndex; +end; + +function TcxValueDefRecordReader.GetDisplayText(AValueDef: TcxValueDef): string; +var + AField: TcxCustomDataField; +begin + AField := AValueDef.LinkObject as TcxCustomDataField; + if not AField.IsInternal then + Result := FDataController.GetInternalDisplayText(FRecordIndex, AField) + else + Result := ''; +end; + +function TcxValueDefRecordReader.GetValue(AValueDef: TcxValueDef): Variant; +var + AField: TcxCustomDataField; +begin + AField := AValueDef.LinkObject as TcxCustomDataField; +// if not AField.IsInternal then +// Result := FDataController.GetInternalValue(FRecordIndex, AField) +// else +// Result := Null; + Result := FDataController.GetInternalValue(FRecordIndex, AField); +end; + +function TcxValueDefRecordReader.IsInternal(AValueDef: TcxValueDef): Boolean; +begin + Result := IsValueDefInternal(AValueDef); +end; + +{ TcxDataControllerNotifier } + +constructor TcxDataControllerNotifier.Create(AOwner: TComponent; ADataController: TcxCustomDataController); +begin + inherited Create(AOwner); + FDataController := ADataController; +end; + +procedure TcxDataControllerNotifier.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and + not ((AComponent = Self) and (csDestroying in ComponentState)) then + DataController.RemoveNotification(AComponent); +end; + +{ TcxSortingBySummaryEngine } + +constructor TcxSortingBySummaryEngine.Create(ADataControllerInfo: TcxCustomDataControllerInfo); +begin + inherited Create; + FDataControllerInfo := ADataControllerInfo; +end; + +function TcxSortingBySummaryEngine.GetDataController: TcxCustomDataController; +begin + Result := FDataControllerInfo.DataController; +end; + +{ TcxCustomDataController } + +constructor TcxCustomDataController.Create(AOwner: TComponent); +begin + inherited Create; + FOwner := AOwner; + FFocusedSelected := True; + FOptions := [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding]; + FDataChangedListeners := TList.Create; + FDataStorage := TcxDataStorage.Create; + FGroups := TcxDataControllerGroups.Create(Self); + FFields := TcxCustomDataFieldList.Create(Self); + FFilters := TcxDataFilterList.Create; + FFilter := GetFilterCriteriaClass.Create(Self); + FSearch := GetSearchClass.Create(Self); + FSummary := GetSummaryClass.Create(Self); + FProvider := GetDataProviderClass.Create(Self); + FDataControllerInfo := TcxCustomDataControllerInfo.Create(Self); + FMasterRecordIndex := -1; + FBookmarkRecordIndex := -1; + FNearestRecordIndex := -1; + ResetDataChangeInfo; + FNotifier := TcxDataControllerNotifier.Create(nil, Self); + FDataStorage.OnClearInternalRecords := DataStorageClearInternalRecords; + UpdateUseRecordIDState; + FListenerLinks := TList.Create; +end; + +destructor TcxCustomDataController.Destroy; +begin + Destroying; // for CLR + FNotifier.Free; + FNotifier := nil; + FRelations.Free; + FRelations := nil; + FDataControllerInfo.Free; + FSummary.Free; + FSummary := nil; + FFilter.Free; + FFilter := nil; + FFilters.Free; + FFilters := nil; + FDataStorage.Clear(False); + FGroups.Free; + FFields.Free; + FDataStorage.Free; + FProvider.Free; + FSearch.Free; + ClearDataChangedListeners; + FDataChangedListeners.Free; + NotifyListenerLinks; + FListenerLinks.Free; + FListenerLinks := nil; + inherited Destroy; +end; + +procedure TcxCustomDataController.Assign(Source: TPersistent); +begin + if Source is TcxCustomDataController then + begin + Options := TcxCustomDataController(Source).Options; + Filter := TcxCustomDataController(Source).Filter; + Summary := TcxCustomDataController(Source).Summary; + + OnAfterCancel := TcxCustomDataController(Source).OnAfterCancel; + OnAfterDelete := TcxCustomDataController(Source).OnAfterDelete; + OnAfterInsert := TcxCustomDataController(Source).OnAfterInsert; + OnAfterPost := TcxCustomDataController(Source).OnAfterPost; + OnBeforeCancel := TcxCustomDataController(Source).OnBeforeCancel; + OnBeforeDelete := TcxCustomDataController(Source).OnBeforeDelete; + OnBeforeInsert := TcxCustomDataController(Source).OnBeforeInsert; + OnBeforePost := TcxCustomDataController(Source).OnBeforePost; + OnFilterRecord := TcxCustomDataController(Source).OnFilterRecord; + OnNewRecord := TcxCustomDataController(Source).OnNewRecord; + + OnCompare := TcxCustomDataController(Source).OnCompare; + OnDataChanged := TcxCustomDataController(Source).OnDataChanged; + OnDetailCollapsing := TcxCustomDataController(Source).OnDetailCollapsing; + OnDetailCollapsed := TcxCustomDataController(Source).OnDetailCollapsed; + OnDetailExpanding := TcxCustomDataController(Source).OnDetailExpanding; + OnDetailExpanded := TcxCustomDataController(Source).OnDetailExpanded; + OnGroupingChanged := TcxCustomDataController(Source).OnGroupingChanged; + OnRecordChanged := TcxCustomDataController(Source).OnRecordChanged; + OnSortingChanged := TcxCustomDataController(Source).OnSortingChanged; + end + else + inherited Assign(Source); +end; + +procedure TcxCustomDataController.BeforeDestruction; +begin + inherited BeforeDestruction; + FDestroying := True; +end; + +procedure TcxCustomDataController.Destroying; +begin +end; + +function TcxCustomDataController.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +procedure TcxCustomDataController.BeginUpdate; +begin + DataControllerInfo.BeginUpdate; +end; + +procedure TcxCustomDataController.EndUpdate; +begin + DataControllerInfo.EndUpdate; + CheckChanges; +end; + +procedure TcxCustomDataController.BeginFullUpdate; +begin + BeginUpdate; +end; + +procedure TcxCustomDataController.EndFullUpdate; +begin + EndUpdate; +end; + +procedure TcxCustomDataController.BeginUpdateFields; +begin + Inc(FLockUpdateFieldsCount); +end; + +procedure TcxCustomDataController.EndUpdateFields; +begin + Dec(FLockUpdateFieldsCount); + if (FLockUpdateFieldsCount = 0) and FUpdateFieldsFlag then + begin + FUpdateFieldsFlag := False; + LayoutChanged([lcStructure]); + end; +end; + +procedure TcxCustomDataController.SaveKeys; +begin + if FSaveObjectLockCount = 0 then + begin + BeginFullUpdate; + FSaveObject := TcxSaveObject.Create; + TcxSaveObject(FSaveObject).Save(Self); + end; + Inc(FSaveObjectLockCount); +end; + +procedure TcxCustomDataController.RestoreKeys; +begin + Dec(FSaveObjectLockCount); + if FSaveObjectLockCount = 0 then + begin + try + TcxSaveObject(FSaveObject).Restore(Self); + FSaveObject.Free; + FSaveObject := nil; + finally + EndFullUpdate; + end; + end; +end; + +function TcxCustomDataController.CreateFilter: TcxDataFilterCriteria; +begin + Result := GetFilterCriteriaClass.Create(Self); + FFilters.Add(Result); +end; + +function TcxCustomDataController.AddItem(AItem: TObject): TcxCustomDataField; +begin + if (AItem <> nil) and (Fields.FieldByItem(AItem) <> nil) then + InvalidOperation(cxSDataItemExistError); + Result := AddField; + Result.Item := AItem; +end; + +function TcxCustomDataController.ItemPropertiesChanged(AItemIndex: Integer): Boolean; +begin + Result := (AItemIndex = -1) or (GetItemSortOrder(AItemIndex) <> soNone); + if Result then + Refresh; +end; + +procedure TcxCustomDataController.Loaded; +begin + if FDataChangedFlag then + DoDataChanged; + if FAfterSummaryFlag then + Summary.DoAfterSummary; +end; + +procedure TcxCustomDataController.RemoveItem(AItem: TObject); +var + AField: TcxCustomDataField; +begin + AField := Fields.FieldByItem(AItem); + if AField <> nil then + begin + BeginUpdate; + try + DataControllerInfo.RemoveField(AField); + AField.Free; + finally + EndUpdate; + end; + end; +end; + +procedure TcxCustomDataController.UpdateItemIndexes; +var + I: Integer; + AField: TcxCustomDataField; +begin + for I := 0 to ItemCount - 1 do + begin + AField := Fields.FieldByItem(GetItem(I)); + AField.Index := I; + end; + Change([dccLayout]); +end; + +procedure TcxCustomDataController.UpdateItems(AUpdateFields: Boolean); +begin + if FUpdateItems then Exit; + FUpdateItems := True; + try + if LockCount <> 0 then + FStructureChanged := True; + if IsProviderDataSource then + UpdateStorage(AUpdateFields); + finally + FUpdateItems := False; + end; +end; + +function TcxCustomDataController.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := False; +end; + +function TcxCustomDataController.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := False; +end; + +// Data Changed notify + +procedure TcxCustomDataController.AddDataChangedListener(AInstance: TObject; + ADataChangedEvent: TNotifyEvent); +var + E: TNotifyEventItem; +begin + E := TNotifyEventItem.Create; + E.Instance := AInstance; + E.Event := ADataChangedEvent; + FDataChangedListeners.Add(E); +end; + +procedure TcxCustomDataController.RemoveDataChangedListener(AInstance: TObject; + ADataChangedEvent: TNotifyEvent); +var + I: Integer; + E: TNotifyEventItem; +begin + for I := 0 to FDataChangedListeners.Count - 1 do + begin + E := TNotifyEventItem(FDataChangedListeners[I]); + if (E.Instance = AInstance) and (@E.Event = @ADataChangedEvent) then + begin + E.Free; + FDataChangedListeners.Delete(I); + Break; + end; + end; +end; + +procedure TcxCustomDataController.AddDataChangeRefCount; +begin + Inc(FDataChangeRefCount); + IsPattern := FIsPatternSave; +end; + +procedure TcxCustomDataController.RemoveDataChangeRefCount; +begin + Dec(FDataChangeRefCount); + IsPattern := FIsPatternSave; +end; + +function TcxCustomDataController.DataChangedNotifyLocked: Boolean; +begin + Result := FDataChangedLockCount <> 0; +end; + +function TcxCustomDataController.IsDataLoading: Boolean; +begin + Result := (Provider <> nil) and (Provider.LockCount <> 0); +end; + +procedure TcxCustomDataController.LockDataChangedNotify; +begin + Inc(FDataChangedLockCount); +end; + +procedure TcxCustomDataController.UnlockDataChangedNotify; +begin + Dec(FDataChangedLockCount); +end; + +procedure TcxCustomDataController.LockGridModeNotify; +begin + Inc(FLockGridModeNotifyCount); + Provider.BeginLocate; +end; + +procedure TcxCustomDataController.UnlockGridModeNotify; +begin + Provider.EndLocate; + Dec(FLockGridModeNotifyCount); +end; + +// Structure + +procedure TcxCustomDataController.ChangeNeedConversion(AItemIndex: Integer; + ANeedConversion: Boolean); +begin + CheckItemRange(AItemIndex); + if GetItemNeedConversion(AItemIndex) <> ANeedConversion then + begin + Fields[AItemIndex].NeedConversion := ANeedConversion; + DataControllerInfo.UpdateField(Fields[AItemIndex]); + end; +end; + +procedure TcxCustomDataController.ChangeTextStored(AItemIndex: Integer; + ATextStored: Boolean); +begin + CheckItemRange(AItemIndex); + if GetItemTextStored(AItemIndex) <> ATextStored then + begin + Fields[AItemIndex].TextStored := ATextStored; + DataControllerInfo.UpdateField(Fields[AItemIndex]); + end; +end; + +procedure TcxCustomDataController.ChangeValueTypeClass(AItemIndex: Integer; + AValueTypeClass: TcxValueTypeClass); +begin + CheckItemRange(AItemIndex); + if GetItemValueTypeClass(AItemIndex) <> AValueTypeClass then + begin + Fields[AItemIndex].ValueTypeClass := AValueTypeClass; + if IsProviderMode then + RestructData; + DataControllerInfo.UpdateField(Fields[AItemIndex]); + DoValueTypeClassChanged(AItemIndex); + end; +end; + +function TcxCustomDataController.GetItemCount: Integer; +begin + Result := Fields.ItemCount; +end; + +function TcxCustomDataController.GetItemNeedConversion(AItemIndex: Integer): Boolean; +begin + Result := False; +end; + +function TcxCustomDataController.GetItemTextStored(AItemIndex: Integer): Boolean; +begin + CheckItemRange(AItemIndex); + Result := Fields[AItemIndex].TextStored; +end; + +function TcxCustomDataController.GetItemValueTypeClass(AItemIndex: Integer): TcxValueTypeClass; +begin + CheckItemRange(AItemIndex); + Result := Fields[AItemIndex].ValueTypeClass; +end; + +function TcxCustomDataController.IsDisplayFormatDefined(AItemIndex: Integer; + AIgnoreSimpleCurrency: Boolean): Boolean; +begin + Result := GetItemTextStored(AItemIndex); +end; + +// Data + +function TcxCustomDataController.AppendRecord: Integer; + + function DataStorageAppendRecord: Integer; + begin + Result := DataStorage.AppendRecord; + DataChanged(dcNew, -1, -1); + end; + +begin + if IsSmartLoad then + Result := AppendInSmartLoad + else + if IsProviderMode then + Result := Provider.AppendRecord + else + Result := DataStorageAppendRecord; +end; + +procedure TcxCustomDataController.DeleteRecord(ARecordIndex: Integer); + + procedure DataStorageDeleteRecord(ARecordIndex: Integer); + begin + DataStorage.DeleteRecord(ARecordIndex); + CorrectAfterDelete(ARecordIndex); + CheckSelectedCount(ARecordIndex); + CheckInternalRecordRange(ARecordIndex); + DataChanged(dcDeleted, -1, -1); + end; + +begin + CheckRecordRange(ARecordIndex); + if IsSmartLoad and FInSmartLoad then + DeleteInSmartLoad(ARecordIndex) + else + begin + if Provider.EditingRecordIndex = ARecordIndex then + Provider.FEditingRecordIndex := cxNullEditingRecordIndex; + if IsProviderMode and (ARecordIndex >= 0) then + Provider.DeleteRecord(ARecordIndex) + else + DataStorageDeleteRecord(ARecordIndex); + end; +end; + +function TcxCustomDataController.GetGroupValue(ARecordIndex: Integer; AField: TcxCustomDataField): Variant; +begin + Result := GetInternalValue(ARecordIndex, AField); +end; + +procedure TcxCustomDataController.GetGroupValues(ARecordIndex: Integer; var AValues: TcxDataSummaryValues); +var + I: Integer; +begin + // Clear + SetLength(AValues, 0); + SetLength(AValues, Groups.GroupingItemCount); + for I := 0 to Groups.GroupingItemCount - 1 do + AValues[I] := Null; + // Load Values + if (0 <= ARecordIndex) and (ARecordIndex < RecordCount) then + for I := 0 to Groups.GroupingItemCount - 1 do + AValues[I] := GetGroupValue(ARecordIndex, Fields[Groups.GroupingItemIndex[I]]); +end; + +function TcxCustomDataController.GetDisplayText(ARecordIndex, AItemIndex: Integer): string; +begin + CheckRange(ARecordIndex, AItemIndex); + Result := GetInternalDisplayText(ARecordIndex, Fields[AItemIndex]); +end; + +function TcxCustomDataController.GetRecordCount: Integer; +begin +{ if IsProviderMode then + Result := Provider.GetRecordCount + else} + Result := DataStorage.RecordCount; +end; + +function TcxCustomDataController.GetRecordId(ARecordIndex: Integer): Variant; +begin + if not ((0 <= ARecordIndex) and (ARecordIndex < RecordCount)) then + InvalidOperation(cxSDataRecordIndexError); + if IsRecordID then + Result := DataStorage.GetRecordID(ARecordIndex) + else + begin + if IsProviderMode and Provider.IsRecordIdSupported then + Result := Provider.GetRecordId(ARecordIndex) + else + Result := Null; + end; +end; + +function TcxCustomDataController.GetValue(ARecordIndex, AItemIndex: Integer): Variant; +begin + CheckRange(ARecordIndex, AItemIndex); + Result := GetInternalValue(ARecordIndex, Fields[AItemIndex]); +end; + +function TcxCustomDataController.InsertRecord(ARecordIndex: Integer): Integer; + + function DataStorageInsertRecord(ARecordIndex: Integer): Integer; + begin + Result := ARecordIndex; + DataStorage.InsertRecord(ARecordIndex); + CorrectAfterInsert(ARecordIndex); + DataChanged(dcNew, -1, -1); + end; + +begin + if (ARecordIndex < 0) or (ARecordIndex > RecordCount) then + InvalidOperation(cxSDataRecordIndexError); + if IsSmartLoad then + Result := AppendInSmartLoad + else + if IsProviderMode then + Result := Provider.InsertRecord(ARecordIndex) + else + Result := DataStorageInsertRecord(ARecordIndex); +end; + +procedure TcxCustomDataController.Refresh; +begin + BeginUpdate; + try + DataControllerInfo.Refresh; + finally + EndUpdate; + end; +end; + +procedure TcxCustomDataController.SetDisplayText(ARecordIndex, AItemIndex: Integer; + const Value: string); +begin + if IsGridMode then Exit; + CheckRange(ARecordIndex, AItemIndex); + if IsProviderMode and (ARecordIndex >= 0) then + begin + Provider.SetDisplayText(ARecordIndex, Fields[AItemIndex], Value); + DataChanged(dcField, AItemIndex, ARecordIndex); + end + else + begin + if Fields[AItemIndex].ValueDef <> nil then + begin + DataStorage.SetDisplayText(ARecordIndex, Fields[AItemIndex].ValueDef, Value); + DataChanged(dcField, AItemIndex, ARecordIndex); + end; + end; +end; + +procedure TcxCustomDataController.SetRecordCount(Value: Integer); + + procedure SetDataStorageRecordCount; + const + DataChangeA: array[Boolean] of TcxDataChange = (dcDeleted , dcNew); + var + PrevRecordCount, RealRecordCount: Integer; + begin + PrevRecordCount := DataStorage.RecordCount; + DataStorage.RecordCount := Value; + RealRecordCount := DataStorage.RecordCount; + if RealRecordCount <> PrevRecordCount then + begin + CheckSelectedCount(-1); + CheckEditingRecordIndex(-1); + DataChanged(DataChangeA[RealRecordCount > PrevRecordCount], -1, -1); + end; + end; + +begin + if IsGridMode then Exit; + if Value < 0 then Value := 0; + if RecordCount <> Value then + begin + if IsProviderMode then + Provider.SetRecordCount(Value) + else + SetDataStorageRecordCount; + end; +end; + +procedure TcxCustomDataController.SetValue(ARecordIndex, AItemIndex: Integer; const Value: Variant); +begin + if IsGridMode then Exit; + CheckRange(ARecordIndex, AItemIndex); + if IsProviderMode and (ARecordIndex >= 0) then + begin + Provider.SetValue(ARecordIndex, Fields[AItemIndex], Value); + DataChanged(dcField, AItemIndex, ARecordIndex); + end + else + begin + if Fields[AItemIndex].ValueDef <> nil then + begin + SetStoredValue(ARecordIndex, Fields[AItemIndex], Value); +// DataStorage.SetValue(ARecordIndex, Fields[AItemIndex].ValueDef, Value); + DataChanged(dcField, AItemIndex, ARecordIndex); + end; + end; +end; + +procedure TcxCustomDataController.SortByDisplayTextChanged; +begin +// if dcoSortByDisplayText in Options then + Refresh; +end; + +// Data Editing + +procedure TcxCustomDataController.Append; +begin + if Provider.CanAppend then + Provider.Append; +end; + +procedure TcxCustomDataController.Cancel; +var + APrevRowIndex: Integer; +begin + if FInCancel then Exit; + FInCancel := True; + try + APrevRowIndex := FocusedRowIndex; + if Provider.IsEditing then + Provider.Cancel; + if APrevRowIndex > (GetRowCount - 1) then + APrevRowIndex := (GetRowCount - 1); + if not DataControllerInfo.FInCanFocusedRowChanging then + FocusedRowIndex := APrevRowIndex; + finally + FInCancel := False; + end; +end; + +function TcxCustomDataController.CanInitEditing(AItemIndex: Integer): Boolean; +begin + Result := False; + CheckItemRange(AItemIndex); + if (Provider.CanModify or Fields[AItemIndex].IsUnbound) and + Fields[AItemIndex].CanModify(GetItemValueSource(AItemIndex)) then + Result := Provider.CanInitEditing(EditingRecordIndex); +end; + +procedure TcxCustomDataController.CheckBrowseMode; +begin +end; + +procedure TcxCustomDataController.DeleteFocused; +var + AList: TList; + ARowIndex: Integer; +begin + ARowIndex := GetFocusedRowIndex; + if (ARowIndex <> -1) and Provider.CanDelete then + begin + Provider.BeginDeleting; + try + if GetRowInfo(ARowIndex).Level < Groups.LevelCount then // It's Group Row + begin + AList := TList.Create; + try + Groups.LoadRecordIndexesByRowIndex(AList, ARowIndex); + DeleteRecords(AList); + finally + AList.Free; + end; + end + else + DeleteFocusedRecord; + ClearSelection; // !!! + finally + Provider.EndDeleting; + end; + end; +end; + +procedure TcxCustomDataController.DeleteSelection; +begin + if (GetSelectedCount > 0) and Provider.CanDelete then + begin + Provider.BeginDeleting; + try + if IsFocusedSelectedMode then + DeleteFocusedRecord + else + Provider.DeleteSelection; + finally + Provider.EndDeleting; + end; + end; +end; + +procedure TcxCustomDataController.Edit; +begin + if Provider.CanModify then + Provider.Edit; +end; + +procedure TcxCustomDataController.FocusControl(AItemIndex: Integer; var Done: Boolean); +begin + Done := False; +end; + +function TcxCustomDataController.GetEditValue(AItemIndex: Integer; + AEditValueSource: TcxDataEditValueSource): Variant; +begin + CheckItemRange(AItemIndex); + if UseNewItemRowForEditing and NewItemRowFocused and not Provider.IsEditing then + Result := Null + else + Result := Provider.GetEditValue(EditingRecordIndex, Fields[AItemIndex], AEditValueSource); +end; + +function TcxCustomDataController.GetItemValueSource(AItemIndex: Integer): TcxDataEditValueSource; +begin + Result := evsText; +end; + +procedure TcxCustomDataController.Insert; +begin + if Provider.CanInsert then + Provider.Insert; +end; + +procedure TcxCustomDataController.Post; +var + ALink: TcxDataListenerLink; +begin + ALink := AddListenerLink(Self); + try + FCheckFocusingAfterFilterNeeded := True; + if Provider.IsEditing then + Provider.Post; + finally + if ALink.Ref <> nil then + Provider.FInsertedRecordIndex := -1; + RemoveListenerLink(ALink); + end; +end; + +procedure TcxCustomDataController.PostEditingData; +begin + Provider.PostEditingData; +end; + +procedure TcxCustomDataController.RefreshExternalData; +begin +end; + +function TcxCustomDataController.SetEditValue(AItemIndex: Integer; + const AValue: Variant; AEditValueSource: TcxDataEditValueSource): Boolean; +begin + if CanInitEditing(AItemIndex) then + Result := Provider.SetEditValue(EditingRecordIndex, Fields[AItemIndex], AValue, AEditValueSource) + else + Result := False; + // Immediate Post + if Result and IsImmediatePost then + Post; +end; + +procedure TcxCustomDataController.UpdateData; +begin +end; + +// New Item Row + +function TcxCustomDataController.GetEditingRecordIndex: Integer; +begin + if Provider.FEditingRecordIndex <> cxNullEditingRecordIndex then + Result := Provider.FEditingRecordIndex + else + Result := CalcEditingRecordIndex; +end; + +function TcxCustomDataController.GetNewItemRecordIndex: Integer; +begin + if FNewItemRecordIndex = 0 then + FNewItemRecordIndex := DataStorage.AddInternalRecord; + Result := FNewItemRecordIndex; +end; + +// Data Save/Load + +procedure TcxCustomDataController.LoadFromStream(AStream: TStream); +var + S: string; + I, AValueCount, ADataValueCount: Integer; + AValueDef: TcxValueDef; + AReader: TcxReader; +begin + if IsProviderMode then + InvalidOperation(cxSDataProviderModeError); + AReader := TcxReader.Create(AStream); + try + S := AReader.ReadString; + if S <> stDataControllerSignature then + InvalidOperation(cxSDataInvalidStreamFormat); + // ValueCount + AValueCount := AReader.ReadInteger; + // ValueDefs +// if AValueCount > 0 then + begin + ADataValueCount := 0; + for I := 0 to DataStorage.ValueDefs.Count - 1 do + begin + AValueDef := DataStorage.ValueDefs[I]; + AValueDef.StreamStored := not IsValueDefInternal(AValueDef); + if AValueDef.StreamStored then + Inc(ADataValueCount); + end; + if ADataValueCount <> AValueCount then + InvalidOperation(cxSDataInvalidStreamFormat); + + DataStorage.BeginStreaming(CompareByLinkObject); + try + // ValueDefs + for I := 0 to DataStorage.ValueDefs.Count - 1 do + begin + AValueDef := DataStorage.ValueDefs[I]; + if AValueDef.StreamStored then + begin + ReadStringProc(AStream, S); + if AValueDef.ValueTypeClass.ClassName <> S then + InvalidOperation(cxSDataInvalidStreamFormat); + end; + end; + BeginUpdate; + try + ClearSelection; + // RecordCount + RecordCount := AReader.ReadInteger; + // Records + for I := 0 to RecordCount - 1 do + DataStorage.ReadData(I, AStream); + DataControllerInfo.Refresh; + finally + EndUpdate; + end; + finally + DataStorage.EndStreaming; + end; + end; + finally + AReader.Free; + end; +end; + +procedure TcxCustomDataController.SaveToStream(AStream: TStream); +var + I, AValueCount: Integer; + AValueDef: TcxValueDef; + AWriter: TcxWriter; +begin + AWriter := TcxWriter.Create(AStream); + try + AWriter.WriteString(stDataControllerSignature); + // ValueCount + AValueCount := 0; + if not IsProviderMode then + begin + for I := 0 to DataStorage.ValueDefs.Count - 1 do + begin + AValueDef := DataStorage.ValueDefs[I]; + AValueDef.StreamStored := not IsValueDefInternal(AValueDef); + if AValueDef.StreamStored then + Inc(AValueCount); + end; + end; + AWriter.WriteInteger(AValueCount); +// if AValueCount > 0 then + begin + DataStorage.BeginStreaming(CompareByLinkObject); + try + // ValueDefs + for I := 0 to DataStorage.ValueDefs.Count - 1 do + begin + AValueDef := DataStorage.ValueDefs[I]; + if AValueDef.StreamStored then + AWriter.WriteString(AValueDef.ValueTypeClass.ClassName); + end; + // RecordCount + AWriter.WriteInteger(RecordCount); + // Records + for I := 0 to RecordCount - 1 do + DataStorage.WriteData(I, AStream); + finally + DataStorage.EndStreaming; + end; + end; + finally + AWriter.Free; + end; +end; + +// Master-Detail: Relations + +function TcxCustomDataController.GetMasterDataController: TcxCustomDataController; +var + AMasterRelation: TcxCustomDataRelation; +begin + AMasterRelation := GetMasterRelation; + if AMasterRelation <> nil then + Result := AMasterRelation.DataController + else + Result := nil; +end; + +function TcxCustomDataController.GetMasterRecordIndex: Integer; +begin + Result := FMasterRecordIndex; +end; + +function TcxCustomDataController.GetMasterRelation: TcxCustomDataRelation; +begin + Result := FMasterRelation; +end; + +function TcxCustomDataController.GetPatternDataController: TcxCustomDataController; + + function FindByItem(ADataController: TcxCustomDataController; AItem: TObject): TcxCustomDataController; + var + I: Integer; + ARelation: TcxCustomDataRelation; + begin + ARelation := ADataController.Relations.FindByItem(AItem); + if ARelation <> nil then + Result := ARelation.DetailDataController + else + begin + Result := nil; + for I := 0 to ADataController.Relations.Count - 1 do + if ADataController.Relations[I].DetailDataController <> nil then + begin + Result := FindByItem(ADataController.Relations[I].DetailDataController, AItem); + if Result <> nil then + Break; + end; + end; + end; + +begin + if FMasterRelation <> nil then + Result := FindByItem(GetRootDataController, FMasterRelation.Item) + else + Result := Self; +end; + +function TcxCustomDataController.GetRootDataController: TcxCustomDataController; +begin + Result := Self; + while Result.FMasterRelation <> nil do + Result := Result.FMasterRelation.DataController; +end; + +function TcxCustomDataController.IsDetailMode: Boolean; +begin + Result := (FMasterRelation <> nil); +end; + +function TcxCustomDataController.CreateDetailLinkObject(ARelation: TcxCustomDataRelation; ARecordIndex: Integer): TObject; +begin + Result := nil; +end; + +procedure TcxCustomDataController.FocusDetails(ARecordIndex: Integer); +var + I: Integer; + ADataController: TcxCustomDataController; +begin + for I := 0 to Relations.Count - 1 do + if IsDetailDataControllerExist(ARecordIndex, I) and + (GetDetailActiveRelationIndex(ARecordIndex) = I) then + begin + ADataController := GetDetailDataController(ARecordIndex, I); + ADataController.CheckFocusedRow; + Break; + end; +end; + +function TcxCustomDataController.GetDetailDataControllerByLinkObject(ALinkObject: TObject): TcxCustomDataController; +begin + Result := nil; +end; + +// Master-Detail: Grid Notifications + +procedure TcxCustomDataController.ResetRelationByItem(AItem: TObject); + + procedure FindAndReset(ADataController: TcxCustomDataController); // TODO: ref FindAndReset + FindAndRemove + var + I, J: Integer; + ARelation: TcxCustomDataRelation; + begin + with ADataController do + begin + ARelation := Relations.FindByItem(AItem); + if ARelation <> nil then + ClearDetails + else + begin + for I := 0 to DataStorage.RecordCount - 1 do + for J := 0 to Relations.Count - 1 do + begin + if IsDetailDataControllerExist(I, J) then + FindAndReset(GetDetailDataController(I, J)); + end; + end; + end; + end; + +begin + FindAndReset(Self); +end; + +procedure TcxCustomDataController.SetMasterMode(AMasterRelation: TcxCustomDataRelation; AIsPattern: Boolean); +begin + BeginFullUpdate; + try + SetMasterRelation(AMasterRelation, -1); + IsPattern := AIsPattern; + finally + EndFullUpdate; + end; +end; + +procedure TcxCustomDataController.SetMasterRelation(AMasterRelation: TcxCustomDataRelation; + AMasterRecordIndex: Integer); +begin + if (AMasterRelation = nil) and (FMasterRelation = nil) and + (AMasterRecordIndex = -1) and (FMasterRecordIndex = -1) then + Exit; + BeginUpdate; + try + if FMasterRelation <> nil then + begin + if (FMasterRelation.FDetailDataController = Self) and (AMasterRecordIndex = -1) then // It's Pattern + FMasterRelation.FDetailDataController := nil + else + CustomDataSource := nil; + if (FMasterRelation <> nil) and (FMasterRelation.DataController <> nil) and + (FMasterRelation.DataController.FCreatingDataController = Self) then + FMasterRelation.DataController.FCreatingDataController := nil; + Relations.Changed(nil); // Reset Details + end; + FMasterRelation := AMasterRelation; + if (FMasterRelation <> nil) and (AMasterRecordIndex = -1) then // It's Pattern + begin + FMasterRelation.FDetailDataController := Self; + FMasterRelation.Changed; + end; + if (FMasterRelation <> nil) and (AMasterRecordIndex <> -1) then // Isn't Pattern + begin + CustomDataSource := GetPatternDataController.CustomDataSource; + if (FMasterRelation <> nil) and (FMasterRelation.DataController <> nil) then + FMasterRelation.DataController.FCreatingDataController := Self; + end; + FMasterRecordIndex := AMasterRecordIndex; + LayoutChanged([lcData]); + finally + EndUpdate; + end; +end; + +// Master-Detail: View Data + +procedure TcxCustomDataController.ChangeDetailActiveRelationIndex(ARecordIndex: Integer; ARelationIndex: Integer); +var + ADetailObject: TcxDetailObject; +begin + if GetDetailActiveRelationIndex(ARecordIndex) <> ARelationIndex then + begin + CheckBrowseMode; + ADetailObject := Relations.GetDetailObject(ARecordIndex); + if Assigned(ADetailObject) then + begin + ADetailObject.ActiveRelationIndex := ARelationIndex; + Change([dccDetail]); + end; + end; +end; + +function TcxCustomDataController.ChangeDetailExpanding(ARecordIndex: Integer; + AExpanded: Boolean): Boolean; +var + ADetailObject: TcxDetailObject; +begin + if GetDetailExpanding(ARecordIndex) <> AExpanded then + begin + Result := False; + FIsDetailExpanding := True; + try + CheckBrowseMode; + if (0 <= ARecordIndex) and (ARecordIndex < RecordCount) then + begin + ADetailObject := Relations.GetDetailObject(ARecordIndex); + if Assigned(ADetailObject) and CanChangeDetailExpanding(ARecordIndex, AExpanded) then + begin + ADetailObject.Expanded := AExpanded; + Result := True; + if (GetMasterDataController = nil) or (GetMasterDataController.LockCount = 0) then + Change([dccDetail]); + if AExpanded then + DoDetailExpanded(ARecordIndex) + else + DoDetailCollapsed(ARecordIndex); + end; + end; + finally + FIsDetailExpanding := False; + end; + end + else + Result := True; +end; + +procedure TcxCustomDataController.ClearDetailLinkObject(ARecordIndex: Integer; ARelationIndex: Integer); +begin + if Relations.ClearDetailObject(ARecordIndex, ARelationIndex) then + Change([dccDetail]); +end; + +procedure TcxCustomDataController.ClearDetails; +var + I: Integer; +begin + BeginUpdate; + try + for I := 0 to DataStorage.RecordCount - 1 do + ClearDetailLinkObject(I, -1); + finally + EndUpdate; + end; +end; + +procedure TcxCustomDataController.CollapseDetails; +var + I: Integer; + ADetailObject: TcxDetailObject; +begin + CheckBrowseMode; + BeginUpdate; + try + for I := 0 to DataStorage.RecordCount - 1 do + begin + ClearDetailLinkObject(I, -1); + ADetailObject := Relations.GetDetailObject(I); + if Assigned(ADetailObject) then + begin + ADetailObject.Expanded := False; + Change([dccDetail]); + end; + end; + finally + EndUpdate; + end; +end; + +procedure TcxCustomDataController.ForEachDetail(AMasterRelation: TcxCustomDataRelation; + AProc: TcxDataControllerEachDetailProc); +var + ARelationIndexes: TList; + + procedure ForEach(ADataController: TcxCustomDataController; AIndex: Integer); + var + ARelationIndex, I: Integer; + ADetailDataController: TcxCustomDataController; + begin + ARelationIndex := Integer(ARelationIndexes[AIndex]); + with ADataController do + begin + for I := 0 to DataStorage.RecordCount - 1 do + begin + if IsDetailDataControllerExist(I, ARelationIndex) then + ADetailDataController := GetDetailDataController(I, ARelationIndex) + else + if FCreatingDataController <> nil then + ADetailDataController := FCreatingDataController + else + ADetailDataController := nil; + if ADetailDataController <> nil then + begin + if AIndex = (ARelationIndexes.Count - 1) then + AProc(ADetailDataController) + else + ForEach(ADetailDataController, AIndex + 1); + end; + end; + end; + end; + +var + ARootDataController: TcxCustomDataController; +begin + ARelationIndexes := TList.Create; + try + ARootDataController := nil; + while AMasterRelation <> nil do + begin + ARootDataController := AMasterRelation.DataController; + ARelationIndexes.Insert(0, Pointer(AMasterRelation.Index)); + AMasterRelation := ARootDataController.FMasterRelation; + end; + if ARootDataController <> nil then + ForEach(ARootDataController, 0); + finally + ARelationIndexes.Free; + end; +end; + +function TcxCustomDataController.GetDetailActiveRelationIndex(ARecordIndex: Integer): Integer; +var + ADetailObject: TcxDetailObject; +begin + Result := -1; + if Relations.IsEmpty then Exit; + ADetailObject := Relations.GetDetailObject(ARecordIndex); + if Assigned(ADetailObject) then + Result := ADetailObject.ActiveRelationIndex; +end; + +function TcxCustomDataController.GetDetailDataController(ARecordIndex: Integer; ARelationIndex: Integer): TcxCustomDataController; +begin + Result := GetDetailDataControllerByLinkObject(GetDetailLinkObject(ARecordIndex, ARelationIndex)); +end; + +function TcxCustomDataController.GetDetailExpanding(ARecordIndex: Integer): Boolean; +var + ADetailObject: TcxDetailObject; +begin + ADetailObject := Relations.GetDetailObject(ARecordIndex); + if Assigned(ADetailObject) then + Result := ADetailObject.Expanded + else + Result := False; +{ +if Result then + if (Relations.Count > 0) and (Relations[0].DataController.GetPatternDataController.Relations[0].FDetailDataController = nil) then + begin + Result := False; + Exit; + end; + } +end; + +function TcxCustomDataController.GetDetailHasChildren(ARecordIndex, ARelationIndex: Integer): Boolean; +var + AIsBound: Boolean; + ADetailObject: TcxDetailObject; + AInfoObject: TcxDetailInfoObject; +begin + // TODO: DB!!! + AIsBound := IsDataBound; + if IsDetailDataControllerExist(ARecordIndex, ARelationIndex) then + Result := GetDetailDataController(ARecordIndex, ARelationIndex).RecordCount <> 0 + else + begin + Result := AIsBound; + if AIsBound then + begin + ADetailObject := Relations.GetDetailObject(ARecordIndex); + if Assigned(ADetailObject) then + begin + AInfoObject := ADetailObject.InfoObjects[ARelationIndex]; + if AInfoObject = nil then + begin + AInfoObject := TcxDetailInfoObject.Create; + ADetailObject.InfoObjects[ARelationIndex] := AInfoObject; + end; + if not AInfoObject.HasChildrenAssigned then + begin + AInfoObject.HasChildren := Provider.GetDetailHasChildren(ARecordIndex, ARelationIndex); + AInfoObject.HasChildrenAssigned := True; + end; + Result := AInfoObject.HasChildren; + end; + end; + end; +end; + +function TcxCustomDataController.GetDetailLinkObject(ARecordIndex: Integer; ARelationIndex: Integer): TObject; + + function IsDetailObjectDestroyed(ADetailObject: TcxDetailObject): Boolean; + begin + // dataset in edit mode + Result := not ((0 <= ARecordIndex) and (ARecordIndex < RecordCount) and + (ADetailObject = Relations.GetDetailObject(ARecordIndex))); + end; + +var + ADetailObject: TcxDetailObject; +begin + ADetailObject := Relations.GetDetailObject(ARecordIndex); + if Assigned(ADetailObject) then + begin + Result := ADetailObject.LinkObjects[ARelationIndex]; + if Result = nil then + begin + if FCreatingLinkObject then Exit; + FCreatingLinkObject := True; + if GetPatternDataController <> nil then + GetPatternDataController.FCreatingLinkObject := True; + try + Result := CreateDetailLinkObject(Relations[ARelationIndex], ARecordIndex); + FCreatingDataController := nil; // !!! + if IsDetailObjectDestroyed(ADetailObject) then + begin + Result.Free; + Result := nil; + // DataNotify + end + else + ADetailObject.LinkObjects[ARelationIndex] := Result; + finally + if GetPatternDataController <> nil then + GetPatternDataController.FCreatingLinkObject := False; + FCreatingLinkObject := False; + end; + end; + if (Result = nil) and not FRecreatingLinkObject then // recreate DetailObject + begin + FRecreatingLinkObject := True; + try + Result := GetDetailLinkObject(ARecordIndex, ARelationIndex); + finally + FRecreatingLinkObject := False; + end; + end; + end + else + Result := nil; +end; + +function TcxCustomDataController.IsDetailDataControllerExist(ARecordIndex: Integer; ARelationIndex: Integer): Boolean; +begin + Result := Relations.IsDetailObjectExist(ARecordIndex, ARelationIndex); +end; + +procedure TcxCustomDataController.ResetHasChildrenFlag; +var + I: Integer; + ADetailObject: TcxDetailObject; + AChanged: Boolean; +begin + AChanged := False; + for I := 0 to RecordCount - 1 do + begin + ADetailObject := Relations.GetDetailObject(I); + if Assigned(ADetailObject) then + begin + if ADetailObject.ClearHasChildrenFlag then + AChanged := True; + end; + end; + if AChanged then + Change([dccLayout]); +end; + +// View Data + +procedure TcxCustomDataController.ForEachRow(ASelectedRows: Boolean; AProc: TcxDataControllerEachRowProc); +var + I, J: Integer; +begin + if ASelectedRows then + begin + for I := 0 to GetSelectedCount - 1 do + begin + J := GetSelectedRowIndex(I); + AProc(J, GetRowInfo(J)); + end; + end + else + begin + for I := 0 to GetRowCount - 1 do + AProc(I, GetRowInfo(I)); + end; +end; + +function TcxCustomDataController.GetNearestRowIndex(ARowIndex: Integer): Integer; +begin + Result := DataControllerInfo.GetNearestRowIndex(ARowIndex); +end; + +function TcxCustomDataController.GetRowCount: Integer; +begin + Result := DataControllerInfo.GetRowCount; +end; + +function TcxCustomDataController.GetRowIndexByRecordIndex(ARecordIndex: Integer; + AMakeVisible: Boolean): Integer; +begin + CheckRecordRange(ARecordIndex); + Result := DataControllerInfo.GetRowIndexByRecordIndex(ARecordIndex, AMakeVisible); +end; + +function TcxCustomDataController.GetRowInfo(ARowIndex: Integer): TcxRowInfo; +begin + Result := DataControllerInfo.GetRowInfo(ARowIndex); +end; + +function TcxCustomDataController.GetRowDisplayText(const ARowInfo: TcxRowInfo; + var AItemIndex: Integer): string; +begin + if (ARowInfo.RecordIndex <> NewItemRecordIndex) and (ARowInfo.Level < Groups.GetGroupingItemCount) then + AItemIndex := Groups.GetGroupingItemIndex(ARowInfo.Level); + Result := GetDisplayText(ARowInfo.RecordIndex, AItemIndex); +end; + +function TcxCustomDataController.GetRowValue(const ARowInfo: TcxRowInfo; AItemIndex: Integer): Variant; +begin + if (ARowInfo.RecordIndex <> NewItemRecordIndex) and (ARowInfo.Level < Groups.GetGroupingItemCount) then + AItemIndex := Groups.GetGroupingItemIndex(ARowInfo.Level); + Result := GetValue(ARowInfo.RecordIndex, AItemIndex); +end; + +procedure TcxCustomDataController.MakeRecordVisible(ARecordIndex: Integer); +begin + GetRowIndexByRecordIndex(ARecordIndex, True); +end; + +function TcxCustomDataController.FocusSelectedRow(ASelectedIndex: Integer): Boolean; +var + ARowIndex: Integer; +begin + ARowIndex := GetSelectedRowIndex(ASelectedIndex); + FocusedRowIndex := ARowIndex; + Result := FocusedRowIndex = ARowIndex; +end; + +procedure TcxCustomDataController.RestoreDataSetPos; +begin + Provider.RestorePos; +end; + +procedure TcxCustomDataController.SaveDataSetPos; +begin + Provider.SavePos; +end; + +// Navigation + +procedure TcxCustomDataController.ChangeFocusedRecordIndex(ARecordIndex: Integer); +var + ARowIndex: Integer; +begin + ARowIndex := GetRowIndexByRecordIndex(ARecordIndex, True); + ChangeFocusedRowIndex(ARowIndex); +end; + +function TcxCustomDataController.ChangeFocusedRowIndex(ARowIndex: Integer): Boolean; +begin + Result := False; + if Provider.IsSyncMode and not Provider.FInInserting and + (DataControllerInfo.FocusedRowIndex <> ARowIndex) and not CheckMasterBrowseMode then + Exit; + if DataControllerInfo.FocusedRowIndex <> ARowIndex then + CheckDetailsBrowseMode; + + DataControllerInfo.FocusedRowIndex := ARowIndex; + // TODO: check + if Provider.IsSyncMode and SyncDetailsFocusWithMaster and + (FocusedRecordIndex <> -1) then + begin + FInFocusDetails := True; + try + FocusDetails(FocusedRecordIndex); + finally + FInFocusDetails := False; + end; + end; + Result := True; +end; + +procedure TcxCustomDataController.CheckFocusedRow; +begin + if (FocusedRowIndex = -1) and not NewItemRowFocused then + FocusedRowIndex := 0; +end; + +function TcxCustomDataController.GetFocusedRecordIndex: Integer; +begin + Result := DataControllerInfo.FocusedRecordIndex; +end; + +function TcxCustomDataController.GetFocusedRowIndex: Integer; +begin + Result := DataControllerInfo.FocusedRowIndex; +end; + +procedure TcxCustomDataController.GotoFirst; +begin + if IsGridMode then + Provider.First + else + ChangeFocusedRowIndex(0); +end; + +procedure TcxCustomDataController.GotoLast; +begin + if IsGridMode then + Provider.Last + else + ChangeFocusedRowIndex(GetRowCount - 1); +end; + +procedure TcxCustomDataController.GotoNext; +var + AFocusedRowIndex: Integer; +begin + if IsGridMode then + Provider.Next + else + begin + AFocusedRowIndex := GetFocusedRowIndex + 1; + ChangeFocusedRowIndex(AFocusedRowIndex); + end; +end; + +procedure TcxCustomDataController.GotoPrev; +var + AFocusedRowIndex: Integer; +begin + if IsGridMode then + Provider.Prev + else + begin + AFocusedRowIndex := GetFocusedRowIndex - 1; + if AFocusedRowIndex < 0 then AFocusedRowIndex := 0; + ChangeFocusedRowIndex(AFocusedRowIndex); + end; +end; + +function TcxCustomDataController.IsBOF: Boolean; +begin + if IsGridMode {and not Provider.IsInserting} then + Result := Provider.IsBOF + else + Result := (GetFocusedRowIndex = 0) or (GetRowCount = 0); +end; + +function TcxCustomDataController.IsEOF: Boolean; +var + ARowCount: Integer; +begin + if IsGridMode then + Result := Provider.IsEOF + else + begin + ARowCount := GetRowCount; + Result := (ARowCount = 0) or + ({(ARowCount > 1) and} (GetFocusedRowIndex = (ARowCount - 1))); + end; +end; + +function TcxCustomDataController.IsGridMode: Boolean; +begin + Result := Provider.IsGridMode; +end; + +procedure TcxCustomDataController.MoveBy(ADistance: Integer); +var + ARowIndex: Integer; +begin + if IsGridMode then + Provider.MoveBy(ADistance) + else + begin + ARowIndex := GetFocusedRowIndex + ADistance; + if ARowIndex < 0 then ARowIndex := 0; + ChangeFocusedRowIndex(ARowIndex); + end; +end; + +procedure TcxCustomDataController.Scroll(ADistance: Integer); +begin + if IsGridMode then + Provider.Scroll(ADistance); +end; + +procedure TcxCustomDataController.SetFocus; +begin +end; + +procedure TcxCustomDataController.ClearBookmark; +var + APrevBookmarkAvailable: Boolean; +begin + APrevBookmarkAvailable := IsBookmarkAvailable; + InternalClearBookmark; + if IsBookmarkAvailable <> APrevBookmarkAvailable then + Change([dccBookmark]); +end; + +procedure TcxCustomDataController.GotoBookmark; +begin + if IsBookmarkAvailable then + InternalGotoBookmark; +end; + +function TcxCustomDataController.IsBookmarkAvailable: Boolean; +begin + Result := FBookmarkRecordIndex <> -1; +end; + +function TcxCustomDataController.IsBookmarkRow(ARowIndex: Integer): Boolean; +begin + Result := IsBookmarkAvailable and + (GetRowInfo(ARowIndex).RecordIndex = FBookmarkRecordIndex); +end; + +procedure TcxCustomDataController.SaveBookmark; +begin + if InternalSaveBookmark then + Change([dccBookmark]); +end; + +// Filtering + +function TcxCustomDataController.GetFilterDataValue(ARecordIndex: Integer; AField: TcxCustomDataField): Variant; +begin + Result := GetInternalValue(ARecordIndex, AField); +end; + +function TcxCustomDataController.GetFilterItemFieldCaption(AItem: TObject): string; +begin + Result := ''; +end; + +function TcxCustomDataController.GetFilterItemFieldName(AItem: TObject): string; +begin + Result := GetFilterItemFieldCaption(AItem); +end; + +// Search + +function TcxCustomDataController.ChangeIncrementalFilterText(const AText: string): Boolean; +begin + Result := Assigned(FIncrementalFilterField) and (FIncrementalFilterText <> AText); + if Result then + SetIncrementalFilter(FIncrementalFilterField.Index, AText); +end; + +function TcxCustomDataController.FindRecordIndexByText(AStartRecordIndex, AItemIndex: Integer; + const AText: string; APartialCompare, ACircular, AForward: Boolean): Integer; +var + AField: TcxCustomDataField; + ARecordCount: Integer; + + function Find(AStartIndex, AEndIndex: Integer): Integer; + var + I: Integer; + S: string; + ARecordIndex: Integer; + begin + Result := -1; + I := AStartIndex; + while (AForward and (I <= AEndIndex)) or + (not AForward and (I >= AEndIndex)) do + begin + ARecordIndex := FilteredRecordIndex[I]; + S := GetInternalDisplayText(ARecordIndex, AField); + if DataCompareText(S, AText, APartialCompare) then + begin + Result := ARecordIndex; + Break; + end; + if AForward then + Inc(I) + else + Dec(I); + end; + end; + +begin + CheckItemRange(AItemIndex); + AField := Fields[AItemIndex]; + ARecordCount := FilteredRecordCount; + Result := -1; + if (AStartRecordIndex < 0) or (AStartRecordIndex >= ARecordCount) then Exit; + if AForward then + begin + Result := Find(AStartRecordIndex, ARecordCount - 1); + if (Result = -1) and (AStartRecordIndex <> 0) and ACircular then + Result := Find(0, AStartRecordIndex - 1); + end + else + begin + Result := Find(AStartRecordIndex, 0); + if (Result = -1) and (AStartRecordIndex <> 0) and ACircular then + Result := Find(ARecordCount - 1, AStartRecordIndex + 1); + end; +end; + +function TcxCustomDataController.GetIncrementalFilterText: string; +begin + Result := FIncrementalFilterText; +end; + +function TcxCustomDataController.IsIncrementalFilter: Boolean; +begin + Result := Assigned(FIncrementalFilterField) and (FIncrementalFilterText <> ''); +end; + +procedure TcxCustomDataController.ResetIncrementalFilter; +var + AIsIncrementalFilter: Boolean; +begin + AIsIncrementalFilter := IsIncrementalFilter; + FIncrementalFilterField := nil; + FIncrementalFilterText := ''; + if AIsIncrementalFilter and not (csDestroying in FOwner.ComponentState) then + Refresh; +end; + +function TcxCustomDataController.SetIncrementalFilter(AItemIndex: Integer; + const AText: string): Integer; +begin + CheckItemRange(AItemIndex); + FIncrementalFilterField := Fields[AItemIndex]; + FIncrementalFilterText := AText; + Refresh; + if FilteredRecordCount > 0 then + Result := FilteredRecordIndex[0] + else + Result := -1; +end; + +// Sorting + +procedure TcxCustomDataController.ChangeItemSortingIndex(AItemIndex: Integer; ASortingIndex: Integer); +begin + CheckItemRange(AItemIndex); + if GetItemSortingIndex(AItemIndex) <> ASortingIndex then + begin + BeginUpdate; + try + if (Groups.ItemGroupIndex[AItemIndex] <> -1) and + (GetItemSortOrder(AItemIndex) = soAscending) and + (ASortingIndex = -1) then + ChangeSorting(AItemIndex, soNone) + else + begin + if GetItemSortingIndex(AItemIndex) = -1 then // grouped + ChangeSorting(AItemIndex, GetItemSortOrder(AItemIndex)); + if GetItemSortOrder(AItemIndex) <> soNone then + DataControllerInfo.ChangeSortIndex(Fields[AItemIndex], ASortingIndex); + end; + finally + EndUpdate; + end; + end; +end; + +procedure TcxCustomDataController.ChangeSorting(AItemIndex: Integer; ASortOrder: TcxDataSortOrder); +begin + CheckItemRange(AItemIndex); +// if GetItemSortOrder(AItemIndex) <> ASortOrder then + if DataControllerInfo.SortingFieldList.SortOrderByField(Fields[AItemIndex]) <> ASortOrder then + begin + BeforeSorting; + FSortingChanged := True; + DataControllerInfo.ChangeSorting(Fields[AItemIndex], ASortOrder); + end; +end; + +procedure TcxCustomDataController.ClearSorting(AKeepGroupedItems: Boolean); +begin + DataControllerInfo.ClearSorting(AKeepGroupedItems); +end; + +function TcxCustomDataController.GetItemSortByDisplayText(AItemIndex: Integer; + ASortByDisplayText: Boolean): Boolean; +begin + Result := False; +end; + +function TcxCustomDataController.GetItemSortOrder(AItemIndex: Integer): TcxDataSortOrder; +var + I: Integer; +begin + CheckItemRange(AItemIndex); + I := DataControllerInfo.SortingFieldList.SortIndexByField(Fields[AItemIndex]); + if I <> -1 then + Result := DataControllerInfo.SortingFieldList[I].SortOrder + else + begin + I := DataControllerInfo.GroupingFieldList.SortIndexByField(Fields[AItemIndex]); + if I <> -1 then + Result := DataControllerInfo.GroupingFieldList[I].SortOrder + else + Result := soNone; + end; +// Result := DataControllerInfo.TotalSortingFieldList.SortOrderByField(Fields[AItemIndex]); +end; + +function TcxCustomDataController.GetItemSortingIndex(AItemIndex: Integer): Integer; +begin + CheckItemRange(AItemIndex); + Result := DataControllerInfo.SortingFieldList.SortIndexByField(Fields[AItemIndex]); +end; + +function TcxCustomDataController.GetSortingItemCount: Integer; +begin + Result := DataControllerInfo.SortingFieldList.Count; +end; + +function TcxCustomDataController.GetSortingItemIndex(Index: Integer): Integer; +begin + Result := DataControllerInfo.SortingFieldList[Index].Field.Index; +end; + +// MultiSelect + +procedure TcxCustomDataController.ChangeRowSelection(ARowIndex: Integer; ASelection: Boolean); +begin + if not MultiSelect then Exit; + DataControllerInfo.ChangeRowSelection(ARowIndex, ASelection); +end; + +procedure TcxCustomDataController.CheckFocusedSelected; +var + ARowIndex: Integer; +begin + if not MultiSelect then Exit; + BeginUpdate; + try + ClearSelection; + ARowIndex := GetFocusedRowIndex; + if ARowIndex <> -1 then + ChangeRowSelection(ARowIndex, True); + finally + EndUpdate; + end; +end; + +procedure TcxCustomDataController.ClearSelection; +begin + DataControllerInfo.ClearSelection; +end; + +procedure TcxCustomDataController.ClearSelectionAnchor; +begin + DataControllerInfo.ClearSelectionAnchor; +end; + +function TcxCustomDataController.GetRowId(ARowIndex: Integer): Variant; +begin + Result := ARowIndex; +end; + +function TcxCustomDataController.GetSelectedCount: Integer; +begin + if IsFocusedSelectedMode then + begin + if FFocusedSelected and (GetFocusedRowIndex <> -1) then + Result := 1 + else + Result := 0; + end + else + Result := DataControllerInfo.GetSelectedCount; +end; + +function TcxCustomDataController.GetSelectedRowIndex(Index: Integer): Integer; +begin + if IsFocusedSelectedMode then + begin + if FFocusedSelected and (Index = 0) then + Result := GetFocusedRowIndex + else + Result := -1; + end + else + Result := DataControllerInfo.GetSelectedRowIndex(Index); +end; + +function TcxCustomDataController.GetSelectionAnchorRowIndex: Integer; +begin + Result := DataControllerInfo.Selection.AnchorRowIndex; +end; + +function TcxCustomDataController.IsRowSelected(ARowIndex: Integer): Boolean; +begin + if IsFocusedSelectedMode then + Result := FFocusedSelected and (GetFocusedRowIndex = ARowIndex) + else + Result := DataControllerInfo.IsRowSelected(ARowIndex); +end; + +function TcxCustomDataController.IsSelectionAnchorExist: Boolean; +begin + Result := GetSelectionAnchorRowIndex <> -1; +end; + +procedure TcxCustomDataController.SelectAll; +var + ARowCount: Integer; +begin + ARowCount := GetRowCount; + if ARowCount > 0 then + SelectRows(0, ARowCount - 1); +end; + +procedure TcxCustomDataController.SelectRows(AStartRowIndex, AEndRowIndex: Integer); +var + I: Integer; +begin + if not MultiSelect then Exit; + if AStartRowIndex > AEndRowIndex then + begin + I := AEndRowIndex; + AEndRowIndex := AStartRowIndex; + AStartRowIndex := I; + end; + BeginUpdate; + try + for I := AStartRowIndex to AEndRowIndex do + ChangeRowSelection(I, True); + finally + EndUpdate; + end; +end; + +procedure TcxCustomDataController.SelectFromAnchor(ARowIndex: Integer; AKeepSelection: Boolean); +var + ASelectionAnchorRowIndex: Integer; +begin + ASelectionAnchorRowIndex := GetSelectionAnchorRowIndex; + if ASelectionAnchorRowIndex <> -1 then + begin + BeginUpdate; + try + if not AKeepSelection then + ClearSelection; + SelectRows(ASelectionAnchorRowIndex, ARowIndex); + finally + EndUpdate; + end; + end; +end; + +procedure TcxCustomDataController.SetSelectionAnchor(ARowIndex: Integer); +begin + // TODO: check? + DataControllerInfo.CheckRowIndex(ARowIndex); + DataControllerInfo.Selection.FAnchorRowIndex := ARowIndex; +end; + +procedure TcxCustomDataController.SyncSelected(ASelected: Boolean); +var + AFocusedRowIndex: Integer; +begin + if not IsFocusedSelectedMode then Exit; + if FFocusedSelected <> ASelected then + begin + FFocusedSelected := ASelected; + AFocusedRowIndex := GetFocusedRowIndex; + if AFocusedRowIndex <> -1 then + begin + FPrevSelectionChangedInfo.SelectedCount := 1; + FPrevSelectionChangedInfo.RowIndex := AFocusedRowIndex; + Change([dccSelection]); + end; + end; +end; + +procedure TcxCustomDataController.SyncSelectionFocusedRecord; +var + AFocusedRowIndex: Integer; +begin + AFocusedRowIndex := GetFocusedRowIndex; + if AFocusedRowIndex = -1 then + ClearSelection + else + begin + SetSelectionAnchor(AFocusedRowIndex); + SelectFromAnchor(AFocusedRowIndex, False); + end; +end; + +// IUnknown + +function TcxCustomDataController.QueryInterface(const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then + Result := S_OK + else + Result := E_NOINTERFACE; +end; + +function TcxCustomDataController._AddRef: Integer; +begin + Result := -1; // -1 indicates no reference counting is taking Position +end; + +function TcxCustomDataController._Release: Integer; +begin + Result := -1; // -1 indicates no reference counting is taking Position +end; + +// Based + +function TcxCustomDataController.AddInternalField: TcxCustomDataField; +begin + Result := GetFieldClass.Create(Fields); + Result.IsInternal := True; + Fields.Add(Result); +end; + +function TcxCustomDataController.AddField: TcxCustomDataField; +begin + Result := GetFieldClass.Create(Fields); + Fields.Add(Result); +end; + +function TcxCustomDataController.AppendInSmartLoad: Integer; +var + AValueDefReader: TcxValueDefReader; +begin + FInSmartLoad := True; + try + if IsProviderMode then + Result := LoadRecord(CustomDataSource.AppendRecord) + else + begin + AValueDefReader := Provider.GetValueDefReaderClass.Create; + try + Result := LoadRecord(AValueDefReader); + DataChanged(dcNew, -1, -1); + finally + AValueDefReader.Free; + end; + end; + finally + FInSmartLoad := False; + end; +end; + +procedure TcxCustomDataController.BeforeSorting; +begin + if IsEditing then + Post; // ! +end; + +function TcxCustomDataController.CalcEditingRecordIndex: Integer; +begin + if NewItemRowFocused then + Result := NewItemRecordIndex + else + if GetFocusedRowIndex <> -1 then + Result := GetRowInfo(GetFocusedRowIndex).RecordIndex + else + Result := cxNullEditingRecordIndex; +end; + +function TcxCustomDataController.CanChangeDetailExpanding(ARecordIndex: Integer; + AExpanded: Boolean): Boolean; +begin + Result := True; + if AExpanded then + DoDetailExpanding(ARecordIndex, Result) + else + DoDetailCollapsing(ARecordIndex, Result); +end; + +function TcxCustomDataController.CanFocusRecord(ARecordIndex: Integer): Boolean; +begin + if not Provider.IsDataSource and (Provider.EditingRecordIndex <> ARecordIndex) then + Post; + Result := True; +end; + +function TcxCustomDataController.CanSelectRow(ARowIndex: Integer): Boolean; +begin + Result := True; // override in grid for Event +end; + +procedure TcxCustomDataController.CheckChanges; +begin + if LockCount = 0 then + begin + Unlocked; + if FChanges <> [] then + begin + if FStructureChanged then + begin + FStructureChanged := False; + LayoutChanged([lcStructure]); + end; + Update; + end; + end; +end; + +procedure TcxCustomDataController.Change(AChanges: TcxDataControllerChanges); +begin + FChanges := FChanges + AChanges; + CheckChanges; +end; + +procedure TcxCustomDataController.CheckBookmarkValid(ADeletedRecordIndex: Integer); +begin + if not IsBookmarkAvailable then Exit; + if InternalCheckBookmark(ADeletedRecordIndex) then + begin + InternalClearBookmark; + Change([dccBookmark]); + end; +end; + +procedure TcxCustomDataController.CheckDataSetCurrent; +begin +end; + +procedure TcxCustomDataController.CheckEditingRecordIndex(ARecordIndex: Integer); +begin + if ((ARecordIndex >= 0) and (ARecordIndex <= Provider.EditingRecordIndex)) or + (RecordCount <= Provider.EditingRecordIndex) then + Provider.ResetEditing; +end; + +procedure TcxCustomDataController.CheckInternalRecordRange(ARecordIndex: Integer); +begin + if FNewItemRecordIndex = ARecordIndex then + FNewItemRecordIndex := 0; +end; + +procedure TcxCustomDataController.CheckItemRange(AItemIndex: Integer); +begin + if not ((0 <= AItemIndex) and (AItemIndex < ItemCount)) then + InvalidOperation(cxSDataItemIndexError); +end; + +function TcxCustomDataController.CheckDetailsBrowseMode: Boolean; +var + I, J: Integer; + ADataController: TcxCustomDataController; +begin + for I := 0 to RecordCount - 1 do + for J := 0 to Relations.Count - 1 do + begin + if IsDetailDataControllerExist(I, J) then + begin + ADataController := GetDetailDataController(I, J); + ADataController.CheckBrowseMode; + end; + end; + Result := True; +end; + +function TcxCustomDataController.CheckMasterBrowseMode: Boolean; +begin + Result := True; +end; + +procedure TcxCustomDataController.CheckMode; +var + APrevGridMode: Boolean; +begin + APrevGridMode := IsGridMode; + Provider.FLoadAllNeeded := Groups.GroupingItemCount > 0; + if APrevGridMode <> Provider.IsGridMode then + RestructData; +end; + +procedure TcxCustomDataController.CheckNearestFocusRow; +var + ARecordIndex: Integer; +begin + if FNearestRecordIndex <> -1 then // !!! + begin + if FNearestRecordIndex < RecordCount then + ChangeFocusedRecordIndex(FNearestRecordIndex); + Exit; + end; + + if (LockCount = 0) and (GetFocusedRecordIndex = -1) then + begin + ARecordIndex := GetLastRecordIndex; + ChangeFocusedRecordIndex(ARecordIndex); + end; +end; + +procedure TcxCustomDataController.CheckRange(ARecordIndex, AItemIndex: Integer); +begin + CheckRecordRange(ARecordIndex); + CheckItemRange(AItemIndex); +end; + +procedure TcxCustomDataController.CheckRecordRange(ARecordIndex: Integer); +begin + NewItemRecordIndex; + if not (((0 <= ARecordIndex) and (ARecordIndex < RecordCount)) or + (ARecordIndex = FNewItemRecordIndex) or (ARecordIndex = Provider.FSavedRecordIndex)) then + InvalidOperation(cxSDataRecordIndexError); +end; + +procedure TcxCustomDataController.CheckSelectedCount(ADeletedRecordIndex: Integer); +begin + DataControllerInfo.TruncateSelection; + CheckBookmarkValid(ADeletedRecordIndex); +end; + +procedure TcxCustomDataController.ClearDataChangedListeners; +var + I: Integer; +begin + // TODO: TcxEventList? + for I := 0 to FDataChangedListeners.Count - 1 do + TNotifyEventItem(FDataChangedListeners[I]).Free; + FDataChangedListeners.Clear; +end; + +procedure TcxCustomDataController.ClearDetailsMasterRelation(ARelation: TcxCustomDataRelation); +var + ARelationIndex, I: Integer; + ADetailLinkObject: TObject; +begin + // Relation Destroying + ARelationIndex := ARelation.Index; + for I := 0 to DataStorage.RecordCount - 1 do + if IsDetailDataControllerExist(I, ARelationIndex) then + begin + ADetailLinkObject := GetDetailLinkObject(I, ARelationIndex); + if ADetailLinkObject <> nil then + GetDetailDataControllerByLinkObject(ADetailLinkObject).FMasterRelation := nil; + end; +end; + +procedure TcxCustomDataController.ProviderValueDefSetProc(AValueDef: TcxValueDef; + AFromRecordIndex, AToRecordIndex: Integer; AValueDefReader: TcxValueDefReader); +var + AField: TcxCustomDataField; +begin + AField := TcxCustomDataField(AValueDef.LinkObject); + if AField.IsValueDefInternal then Exit; + Provider.SetValue(AToRecordIndex, AField, DataStorage.GetValue(AFromRecordIndex, AValueDef)); + if AValueDef.TextStored then + Provider.SetDisplayText(AToRecordIndex, AField, DataStorage.GetDisplayText(AFromRecordIndex, AValueDef)); +end; + +procedure TcxCustomDataController.CopyRecord(AFromRecordIndex, AToRecordIndex: Integer); +var + AValueDefReader: TcxValueDefRecordReader; +begin + AValueDefReader := TcxValueDefRecordReader.Create(Self, AFromRecordIndex); + try + if IsProviderMode and (AToRecordIndex >= 0) then + DataStorage.ReadRecordFrom(AFromRecordIndex, AToRecordIndex, AValueDefReader, ProviderValueDefSetProc) + else + DataStorage.ReadRecord(AToRecordIndex, AValueDefReader); + finally + AValueDefReader.Free; + end; + if AToRecordIndex >= 0 then // not internal + DataChanged(dcRecord, -1, -1); +end; + +procedure TcxCustomDataController.CorrectAfterInsert(ARecordIndex: Integer); +var + I, J: Integer; +begin + for I := ARecordIndex + 1 to DataStorage.RecordCount - 1 do + for J := 0 to Relations.Count - 1 do + if IsDetailDataControllerExist(I, J) then + Inc(GetDetailDataController(I, J).FMasterRecordIndex); +end; + +procedure TcxCustomDataController.CorrectAfterDelete(ARecordIndex: Integer); +var + I, J: Integer; +begin + if ARecordIndex < 0 then Exit; + CheckEditingRecordIndex(ARecordIndex); + if Relations.Count > 0 then + begin + for I := ARecordIndex {+ 1} to DataStorage.RecordCount - 1 do + for J := 0 to Relations.Count - 1 do + if IsDetailDataControllerExist(I, J) then + Dec(GetDetailDataController(I, J).FMasterRecordIndex); + end; +end; + +procedure TcxCustomDataController.CorrectPrevSelectionChangedInfo; +begin + if FPrevSelectionChangedInfo.SelectedCount = 1 then + begin + FPrevSelectionChangedInfo.SelectedCount := GetSelectedCount; + if FPrevSelectionChangedInfo.SelectedCount = 1 then + FPrevSelectionChangedInfo.RowIndex := GetSelectedRowIndex(0) + else + FPrevSelectionChangedInfo.RowIndex := -1; + // TODO: flag reset? + end; +end; + +procedure TcxCustomDataController.DeleteInSmartLoad(ARecordIndex: Integer); +begin + if IsProviderMode then + Provider.DeleteRecord(ARecordIndex); + DataStorage.DeleteRecord(ARecordIndex); +end; + +procedure TcxCustomDataController.Unlocked; +begin +end; + +procedure TcxCustomDataController.DoAfterCancel; +begin + if Assigned(FOnAfterCancel) then + FOnAfterCancel(Self); +end; + +procedure TcxCustomDataController.DoAfterDelete; +begin + if Assigned(FOnAfterDelete) then + FOnAfterDelete(Self); +end; + +procedure TcxCustomDataController.DoAfterInsert; +begin + if Assigned(FOnAfterInsert) then + FOnAfterInsert(Self); +end; + +procedure TcxCustomDataController.DoAfterPost; +begin + if Assigned(FOnAfterPost) then + FOnAfterPost(Self); +end; + +procedure TcxCustomDataController.DoBeforeCancel; +begin + if Assigned(FOnBeforeCancel) then + FOnBeforeCancel(Self); +end; + +procedure TcxCustomDataController.DoBeforeDelete(ARecordIndex: Integer); +begin + if Assigned(FOnBeforeDelete) then + FOnBeforeDelete(Self, ARecordIndex); +end; + +procedure TcxCustomDataController.DoBeforeInsert; +begin + if Assigned(FOnBeforeInsert) then + FOnBeforeInsert(Self); +end; + +procedure TcxCustomDataController.DoBeforePost; +begin + if Assigned(FOnBeforePost) then + FOnBeforePost(Self); +end; + +function TcxCustomDataController.DoFilterRecord(ARecordIndex: Integer): Boolean; +begin + Result := True; + if Assigned(FOnFilterRecord) then + FOnFilterRecord(Self, ARecordIndex, Result); +end; + +function TcxCustomDataController.IsFilterRecord: Boolean; +begin + Result := Assigned(FOnFilterRecord); +end; + +procedure TcxCustomDataController.DoNewRecord(ARecordIndex: Integer); +begin + if Assigned(FOnNewRecord) then + FOnNewRecord(Self, ARecordIndex); +end; + +procedure TcxCustomDataController.DoDataChanged; +begin + if not (csDestroying in FOwner.ComponentState) and IsDataChangedListenersExist then + begin + if IsLoading then + FDataChangedFlag := True + else + begin + FDataChangedFlag := False; + NotifyDataChangedListeners; + end; + end; +end; + +procedure TcxCustomDataController.DoDetailExpanding(ARecordIndex: Integer; var AAllow: Boolean); +begin + if Assigned(FOnDetailExpanding) then + FOnDetailExpanding(Self, ARecordIndex, AAllow); +end; + +procedure TcxCustomDataController.DoDetailExpanded(ARecordIndex: Integer); +begin + if Assigned(FOnDetailExpanded) then + FOnDetailExpanded(Self, ARecordIndex); +end; + +procedure TcxCustomDataController.DoDetailCollapsing(ARecordIndex: Integer; var AAllow: Boolean); +begin + if Assigned(FOnDetailCollapsing) then + FOnDetailCollapsing(Self, ARecordIndex, AAllow); +end; + +procedure TcxCustomDataController.DoDetailCollapsed(ARecordIndex: Integer); +begin + if Assigned(FOnDetailCollapsed) then + FOnDetailCollapsed(Self, ARecordIndex); +end; + +function TcxCustomDataController.DoIncrementalFilterRecord(ARecordIndex: Integer): Boolean; +var + S: string; +begin + S := GetInternalDisplayText(ARecordIndex, FIncrementalFilterField); + Result := DataCompareText(S, FIncrementalFilterText, True); +end; + +procedure TcxCustomDataController.DoReadRecord(ARecordIndex: Integer); +begin + Provider.CorrectRecordIndex(ARecordIndex); +end; + +function TcxCustomDataController.DoSearchInGridMode(const ASubText: string; + AForward, ANext: Boolean): Boolean; +begin + Result := False; +end; + +function TcxCustomDataController.FindItemByInternalID(AID: Integer): TObject; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + begin + Result := GetItem(I); + if GetItemID(Result) = AID then + Exit; + end; + Result := nil; +end; + +function TcxCustomDataController.FindItemByName(const AName: string): TObject; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + begin + Result := GetItem(I); + if SameText(GetItemName(Result), AName) then + Exit; + end; + Result := nil; +end; + +function TcxCustomDataController.FindProperItemLink(AItemLink: TObject): TObject; +begin + Result := FindItemByInternalID(GetItemID(AItemLink)); +end; + +function TcxCustomDataController.GetActiveRecordIndex: Integer; +begin + Result := GetFocusedRecordIndex; +end; + +function TcxCustomDataController.GetDataProviderClass: TcxCustomDataProviderClass; +begin + Result := TcxCustomDataProvider; +end; + +function TcxCustomDataController.GetDataSelectionClass: TcxDataSelectionClass; +begin + Result := TcxDataSelection; +end; + +function TcxCustomDataController.GetEditOperations: TcxDataControllerEditOperations; +begin + Result := []; + if Provider.CanAppend then + Result := Result + [dceoAppend]; + if Provider.CanDelete then + Result := Result + [dceoDelete]; + if Provider.CanModify then + Result := Result + [dceoEdit]; + if Provider.CanInsert then + Result := Result + [dceoInsert]; + if not Provider.IsDataSource or Provider.IsSyncMode then + Result := Result + [dceoShowEdit]; +end; + +function TcxCustomDataController.GetEditState: TcxDataControllerEditState; +begin + Result := []; + if Provider.IsInserting then + Result := Result + [dceInsert] + else + if Provider.IsEditing then + Result := Result + [dceEdit]; + if (Result <> []) and Provider.IsChanging then + Result := Result + [dceChanging]; + if (Result <> []) and Provider.IsModified then + Result := Result + [dceModified]; +end; + +function TcxCustomDataController.GetDefaultActiveRelationIndex: Integer; +begin + Result := 0; +end; + +function TcxCustomDataController.GetFieldClass: TcxCustomDataFieldClass; +begin + Result := TcxCustomDataField; +end; + +function TcxCustomDataController.GetFilterCriteriaClass: TcxDataFilterCriteriaClass; +begin + Result := TcxDataFilterCriteria; +end; + +function TcxCustomDataController.GetInternalDisplayText(ARecordIndex: Integer; + AField: TcxCustomDataField): string; +begin + if (ARecordIndex >= 0) and IsProviderMode and IsDataField(AField) then + Result := Provider.GetDisplayText(ARecordIndex, AField) + else + Result := GetStoredDisplayText(ARecordIndex, AField); +end; + +function TcxCustomDataController.GetItemID(AItem: TObject): Integer; +begin + Result := -1; +end; + +function TcxCustomDataController.GetItemName(AItem: TObject): string; +begin + if AItem is TComponent then + Result := TComponent(AItem).Name + else + Result := ''; +end; + +function TcxCustomDataController.GetInternalRecordId(ARecordIndex: Integer; + AFieldList: TList): Variant; +var + I: Integer; +begin + if AFieldList.Count > 0 then + begin + if AFieldList.Count > 1 then + begin + Result := VarArrayCreate([0, AFieldList.Count - 1], varVariant); + for I := 0 to AFieldList.Count - 1 do + Result[I] := GetInternalValue(ARecordIndex, TcxCustomDataField(AFieldList[I])); + end + else + Result := GetInternalValue(ARecordIndex, TcxCustomDataField(AFieldList[0])); + end + else + begin + if IsProviderMode then + Result := Provider.GetRecordId(ARecordIndex) + else + Result := Null; + end; +end; + +function TcxCustomDataController.GetInternalValue(ARecordIndex: Integer; AField: TcxCustomDataField): Variant; +begin + if (ARecordIndex >= 0) and IsProviderMode and IsDataField(AField) then + Result := Provider.GetValue(ARecordIndex, AField) + else + Result := GetStoredValue(ARecordIndex, AField); +end; + +procedure TcxCustomDataController.GetKeyFields(AList: TList); +begin +end; + +function TcxCustomDataController.GetLastRecordIndex: Integer; +var + ARowIndex: Integer; +begin + Result := -1; + ARowIndex := GetRowCount - 1; + if ARowIndex <> -1 then + Result := GetRowInfo(ARowIndex).RecordIndex; +end; + +function TcxCustomDataController.GetRecordIndex: Integer; +begin + if Provider.IsDataSource and Provider.IsSyncMode then + Result := Provider.GetRecordIndex + else + Result := DataControllerInfo.FocusedRecordIndex; +end; + +function TcxCustomDataController.GetRelationClass: TcxCustomDataRelationClass; +begin + Result := TcxCustomDataRelation; +end; + +function TcxCustomDataController.GetSearchClass: TcxDataControllerSearchClass; +begin + Result := TcxDataControllerSearch; +end; + +function TcxCustomDataController.GetStoredDisplayText(ARecordIndex: Integer; + AField: TcxCustomDataField): string; +begin +// if not AField.IsInternal and IsGridMode then + if IsDataField(AField) and IsGridMode then + Result := Provider.GetExternalDataDisplayText(ARecordIndex, AField) + else + if AField.ValueDef <> nil then + Result := DataStorage.GetDisplayText(ARecordIndex, AField.ValueDef) + else + Result := ''; +end; + +function TcxCustomDataController.GetStoredValue(ARecordIndex: Integer; + AField: TcxCustomDataField): Variant; +begin +// if not AField.IsInternal and IsGridMode then + if IsDataField(AField) and IsGridMode then + Result := Provider.GetExternalDataValue(ARecordIndex, AField) + else + if AField.ValueDef <> nil then + Result := DataStorage.GetValue(ARecordIndex, AField.ValueDef) + else + Result := Null; +end; + +function TcxCustomDataController.GetSummaryClass: TcxDataSummaryClass; +begin + Result := TcxDataSummary; +end; + +function TcxCustomDataController.GetSummaryItemClass: TcxDataSummaryItemClass; +begin + Result := TcxDataSummaryItem; +end; + +function TcxCustomDataController.GetSummaryGroupItemLinkClass: TcxDataSummaryGroupItemLinkClass; +begin + Result := TcxDataSummaryGroupItemLink; +end; + +function TcxCustomDataController.InternalCheckBookmark(ADeletedRecordIndex: Integer): Boolean; +begin + if (ADeletedRecordIndex <> -1) and (FBookmarkRecordIndex = ADeletedRecordIndex) then + Result := True + else + Result := GetFilteredIndexByRecordIndex(FBookmarkRecordIndex) = -1; +end; + +procedure TcxCustomDataController.InternalClearBookmark; +begin + FBookmarkRecordIndex := -1; +end; + +procedure TcxCustomDataController.InternalGotoBookmark; +begin + FocusedRecordIndex := FBookmarkRecordIndex; +end; + +function TcxCustomDataController.InternalSaveBookmark: Boolean; +var + ARecordIndex: Integer; +begin + Result := False; + ARecordIndex := FocusedRecordIndex; + if FBookmarkRecordIndex <> ARecordIndex then + begin + FBookmarkRecordIndex := ARecordIndex; + Result := True; + end; +end; + +function TcxCustomDataController.IsDataBound: Boolean; +begin + Result := IsProviderMode or Provider.IsDataSource; +end; + +function TcxCustomDataController.IsDataChangedListenersExist: Boolean; +begin + Result := Assigned(FOnDataChanged) or Assigned(FOnRecordChanged) or + (FDataChangedListeners.Count > 0); +end; + +function TcxCustomDataController.IsDataField(AField: TcxCustomDataField): Boolean; +begin + Result := not AField.IsInternal or + (Assigned(AField.FReferenceField) and not AField.FReferenceField.IsInternal); +end; + +function TcxCustomDataController.IsDestroying: Boolean; +begin + Result := csDestroying in FOwner.ComponentState; +end; + +function TcxCustomDataController.IsFocusedSelectedMode: Boolean; +begin + Result := not MultiSelect{ and FFocusedSelected}; // TODO:? +end; + +function TcxCustomDataController.IsImmediatePost: Boolean; +begin + Result := (dcoImmediatePost in Options) or Provider.IsUnboundColumnMode; +end; + +function TcxCustomDataController.IsKeyNavigation: Boolean; +begin + if IsProviderMode then + Result := Provider.IsRecordIdSupported + else + Result := False; +end; + +function TcxCustomDataController.IsLoading: Boolean; +begin + Result := csLoading in FOwner.ComponentState; +end; + +function TcxCustomDataController.IsProviderDataSource: Boolean; +begin + Result := IsProviderMode or FStructureRecreated; +end; + +function TcxCustomDataController.IsProviderMode: Boolean; +begin + Result := Provider.CustomDataSource <> nil; +end; + +function TcxCustomDataController.IsRecordID: Boolean; +begin + Result := IsUnboundMode and UseRecordID; +end; + +function TcxCustomDataController.IsSmartLoad: Boolean; +begin + Result := False; +end; + +function TcxCustomDataController.IsSmartRefresh: Boolean; +begin + Result := False; +end; + +function TcxCustomDataController.IsUnboundMode: Boolean; +begin + Result := Provider.IsCustomDataSourceSupported and not IsProviderMode; // ? +end; + +procedure TcxCustomDataController.LoadStorage; + + procedure LoadData; + var + AValueDefReader: TcxValueDefReader; + ARecordIndex: Integer; + begin + with Provider do + begin + if IsGridMode then + begin + DataStorage.BeginLoad; + try + LoadDataBuffer; + finally + DataStorage.EndLoad; + end; + end + else + begin + Freeze; + try + SavePos; + First; // possible to recreate Fields in dbX and Query Reopen + if RecreatedFieldsAfterFirst then + UpdateFields; + DataStorage.BeginLoad; + try + if IsProviderMode then + LoadRecordHandles + else + begin + AValueDefReader := GetValueDefReaderClass.Create; + try + while not IsEOF do + begin + ARecordIndex := DataStorage.AppendRecord; + DataStorage.ReadRecord(ARecordIndex, AValueDefReader); + Self.DoReadRecord(ARecordIndex); + Next; + end; + finally + AValueDefReader.Free; + end; + end; + finally + DataStorage.EndLoad; + end; + FLoadedStorage := Provider.ActiveChanging; + RestorePos; + finally + Unfreeze; + end; + end; + end; + end; + + procedure CheckAfterLoad; + begin + FInLoadStorage := True; + try + CheckSelectedCount(-1); + finally + FInLoadStorage := False; + end; + UpdateFocused; + end; + +begin + if not (IsSmartLoad and FInSmartLoad) then + DataStorage.Clear(Provider.FDataChangedLocked); + if Provider.IsActive and not IsSmartLoad then + begin + if DetailMode <> dcdmPattern then + LoadData; + CheckAfterLoad; + end; + Change([dccData]); + SyncMasterPos; +end; + +function TcxCustomDataController.IsNewItemRecordIndex(ARecordIndex: Integer): Boolean; +begin + Result := UseNewItemRowForEditing and (ARecordIndex = NewItemRecordIndex); +end; + +function TcxCustomDataController.LockOnAfterSummary: Boolean; +begin + Result := IsGridMode and FStructureChanged; +end; + +procedure TcxCustomDataController.NotifyDataChangedListeners; +var + I: Integer; + E: TNotifyEventItem; +begin + if not IsPattern then + begin + if (FDataChangeInfo.Kind in [dcField, dcRecord]) and + ((FDataChangeInfo.RecordIndex <> -1) or IsNewItemRecordIndex(FDataChangeInfo.RecordIndex)) then + begin + if Assigned(FOnRecordChanged) then + FOnRecordChanged(Self, FDataChangeInfo.RecordIndex, FDataChangeInfo.ItemIndex); + end; + if Assigned(FOnDataChanged) then + FOnDataChanged(Self); + end; + + if IsGridMode and (Provider.LocateCount <> 0) then Exit; // TODO: !!! + for I := 0 to FDataChangedListeners.Count - 1 do + begin + E := TNotifyEventItem(FDataChangedListeners[I]); + E.Event(Self); + end; +end; + +procedure TcxCustomDataController.NotifyDataControllers; +begin +end; + +procedure TcxCustomDataController.PrepareField(AField: TcxCustomDataField); +begin +end; + +procedure TcxCustomDataController.RemoveNotification(AComponent: TComponent); +begin + Fields.RemoveNotification(AComponent); +end; + +procedure TcxCustomDataController.ResetMasterHasChildrenFlag; +var + AMasterDataController: TcxCustomDataController; +begin + if IsDataBound then + begin + AMasterDataController := GetMasterDataController; + if (AMasterDataController <> nil) and (EditState * [dceInsert, dceEdit] = []) then + AMasterDataController.ResetHasChildrenFlag; + end; +end; + +procedure TcxCustomDataController.ResetNewItemRowFocused; +begin + if FNewItemRowFocused then + DataControllerInfo.FPrevFocusingInfo.FChangedFlag := True; + FNewItemRowFocused := False; +end; + +procedure TcxCustomDataController.RestructData; +begin + //BeginUpdate; + BeginFullUpdate; + try + Provider.ResetEditing; +// if not IsUnboundMode then + if not IsUnboundMode or (FInSetCustomDataSource and (CustomDataSource = nil)) then + DataStorage.Clear(False); + InternalClearBookmark; + CheckSelectedCount(-1); // <- Clear Selection + DataStorage.StoredValuesOnly := IsProviderMode or IsGridMode; + UpdateUseRecordIDState; + if CustomDataSource <> nil then + begin + if FRecordHandlesField = nil then + begin + FRecordHandlesField := AddInternalField; + FRecordHandlesField.ValueTypeClass := TcxIntegerValueType; + end; + end + else + begin + FRecordHandlesField.Free; // FRecordHandlesField <- nil (in RemoveDataField method) + end; + FStructureRecreated := True; + LayoutChanged([lcData]); + finally + EndFullUpdate; + //EndUpdate; + end; +end; + +procedure TcxCustomDataController.SetStoredValue(ARecordIndex: Integer; + AField: TcxCustomDataField; const Value: Variant); +begin + if AField.ValueDef <> nil then + DataStorage.SetValue(ARecordIndex, AField.ValueDef, Value); +end; + +function TcxCustomDataController.SyncDetailsFocusWithMaster: Boolean; +begin + Result := False; +end; + +procedure TcxCustomDataController.SyncMasterPos; +begin + if DetailMode = dcdmClone then + Change([dccSyncMasterPos]); + NotifyDataControllers; +end; + +procedure TcxCustomDataController.UpdateFields; +var + I: Integer; + AField: TcxCustomDataField; + APreparedAll: Boolean; +begin + for I := 0 to Fields.Count - 1 do + Fields[I].FPrepared := False; + repeat + Fields.FFieldDestroyed := False; + for I := 0 to Fields.Count - 1 do + begin + AField := Fields[I]; + if AField.FPrepared then Continue; + PrepareField(AField); + AField.FPrepared := True; + if Fields.FFieldDestroyed then Break; + end; + // check Finish + APreparedAll := True; + for I := 0 to Fields.Count - 1 do + if not Fields[I].FPrepared then + begin + APreparedAll := False; + Break; + end; + until APreparedAll; +// for I := 0 to Fields.Count - 1 do +// PrepareField(Fields[I]); +end; + +procedure TcxCustomDataController.UpdateFocused; +begin + if (Provider.LocateCount = 0) or not DataControllerInfo.FFocusingFlag then + DataControllerInfo.RefreshFocused; +end; + +procedure TcxCustomDataController.UpdateRelations(ARelation: TcxCustomDataRelation); +var + ARootDataController: TcxCustomDataController; +begin + if FDestroying then Exit; + if DetailMode = dcdmPattern then + begin + ARootDataController := GetRootDataController; + if FMasterRelation <> nil then + ARootDataController.ResetRelationByItem(FMasterRelation.Item); + end + else + Change([dccData{dccDetail}]); +end; + +procedure TcxCustomDataController.UpdateUseRecordIDState; +begin + DataStorage.UseRecordID := IsRecordID; +end; + +procedure TcxCustomDataController.UpdateStorage(AUpdateFields: Boolean); +begin + BeginFullUpdate; // !!! see also 22299 + try + if IsProviderDataSource then + begin + if AUpdateFields or Provider.IsActiveDataSet then + begin + if LockUpdateFieldsCount <> 0 then + FUpdateFieldsFlag := True + else + begin + if Provider.IsGridModeUpdating and + ((EditState * [dceInsert] <> []) or // appending record + FFields.FFieldDestroyed) then // Filter.OnBeforeChange + // do nothing + else + UpdateFields; + end; + end; + if not FStructureChanged then + LoadStorage; + end; + DataControllerInfo.Refresh; + FUpdateItems := False; + FStructureRecreated := False; + finally + EndFullUpdate; + end; +end; + +function TcxCustomDataController.UseRecordID: Boolean; +begin + Result := False; +end; + +class function TcxCustomDataController.AddListenerLink(ADataController: TcxCustomDataController): TcxDataListenerLink; +begin + Result := TcxDataListenerLink.Create; + Result.Ref := ADataController; + ADataController.FListenerLinks.Add(Result); +end; + +class procedure TcxCustomDataController.RemoveListenerLink(ALink: TcxDataListenerLink); +begin + if ALink.Ref <> nil then + ALink.Ref.FListenerLinks.Remove(ALink); + ALink.Free; +end; + +procedure TcxCustomDataController.DataStorageClearInternalRecords(Sender: TObject); +begin + Provider.FSavedRecordIndex := 0; + FNewItemRecordIndex := 0; +end; + +procedure TcxCustomDataController.RemoveField(ADataField: TcxCustomDataField); +begin + if FRecordHandlesField = ADataField then + FRecordHandlesField := nil; + if Assigned(FRelations) then + Relations.RemoveDataField(ADataField); + if Assigned(FFilters) then + FFilters.RemoveItemByField(ADataField); + if Assigned(FFilter) then + Filter.RemoveItemByField(ADataField); + if Assigned(FSummary) then + Summary.RemoveItemByField(ADataField); + if FIncrementalFilterField = ADataField then + ResetIncrementalFilter; + if FSortingBySummaryDataItemField = ADataField then + SortingBySummaryDataItemIndex := -1; + if FIncrementalSearchField = ADataField then + begin + Search.Cancel; + FIncrementalSearchField := nil; + end; +end; + +procedure TcxCustomDataController.FilterChanged; +begin +// !!! filter custom! + FCheckFocusingAfterFilterNeeded := True; + Cancel; + Refresh; + CheckBookmarkValid(-1); + CorrectPrevSelectionChangedInfo; +end; + +procedure TcxCustomDataController.SummaryChanged(ARedrawOnly: Boolean); +begin + DataControllerInfo.RefreshSummary(ARedrawOnly); +end; + +procedure TcxCustomDataController.ActiveChanged(AActive: Boolean); +begin + FActive := AActive; + UpdateItems(Provider.IsActive); + ResetMasterHasChildrenFlag; +end; + +procedure TcxCustomDataController.DataChanged(ADataChange: TcxDataChange; + AItemIndex, ARecordIndex: Integer); +begin + if ((FDataChangeInfo.RecordIndex <> -1) or IsNewItemRecordIndex(FDataChangeInfo.RecordIndex)) and + (FDataChangeInfo.RecordIndex <> ARecordIndex) then + FDataChangeInfo.Kind := dcTotal + else + if (ADataChange = dcField) and (FDataChangeInfo.ItemIndex <> -1) and + (FDataChangeInfo.ItemIndex <> AItemIndex) then + begin + FDataChangeInfo.Kind := dcRecord; + AItemIndex := -1; + end + else + FDataChangeInfo.Kind := ADataChange; + FDataChangeInfo.ItemIndex := AItemIndex; + FDataChangeInfo.RecordIndex := ARecordIndex; + if (ADataChange = dcTotal) then + UpdateStorage(False) + else + begin + if ADataChange in [dcNew, dcDeleted] then + DataControllerInfo.FocusedRecordChanged(False); + DataControllerInfo.Refresh; + end; + ResetMasterHasChildrenFlag; +end; + +procedure TcxCustomDataController.DataScrolled(ADistance: Integer); +begin + UpdateFocused; +end; + +procedure TcxCustomDataController.LayoutChanged(ADataLayoutChanges: TcxDataLayoutChanges); +begin + UpdateItems(Provider.IsActive); +end; + +procedure TcxCustomDataController.DoBeforeFocusedRowChange(ARowIndex: Integer); +begin +end; + +procedure TcxCustomDataController.DoValueTypeClassChanged(AItemIndex: Integer); +begin +end; + +procedure TcxCustomDataController.UpdateControl(AInfo: TcxUpdateControlInfo); +begin + if Assigned(FOnUpdateControl) then FOnUpdateControl(AInfo); +end; + +function TcxCustomDataController.GetIncrementalSearchText(ARecordIndex, AItemIndex: Integer): string; +begin + Result := GetDisplayText(ARecordIndex, AItemIndex); +end; + +function TcxCustomDataController.GetFilterDisplayText(ARecordIndex, AItemIndex: Integer): string; +begin + Result := GetDisplayText(ARecordIndex, AItemIndex); +end; + +// Compare + +function TcxCustomDataController.CompareByField(ARecordIndex1, ARecordIndex2: Integer; + AField: TcxCustomDataField; AMode: TcxDataControllerComparisonMode): Integer; + +{ function CompareStrEx(const S1, S2: string): Integer; + begin + if S1 = S2 then + Result := 0 + else + if S1 < S2 then + Result := -1 + else + Result := 1; + end;} + + function StringCompare(const V1, V2: Variant): Integer; + begin + if dcoAnsiSort in Options then + begin + if dcoCaseInsensitive in Options then + Result := AnsiCompareText(V1, V2) + else + Result := AnsiCompareStr(V1, V2); + end + else + begin + if dcoCaseInsensitive in Options then + //TODO: Option -> CompareText(V1, V2); +// Result := CompareText(AnsiUpperCase(V1), AnsiUpperCase(V2)) + Result := CompareStr(AnsiUpperCase(V1), AnsiUpperCase(V2)) +// Result := CompareStrEx(AnsiUpperCase(V1), AnsiUpperCase(V2)) + else + Result := VarCompare(V1, V2); + end; + end; + +var + V1, V2: Variant; +begin + if (Assigned(FOnCompare) and not AField.IsInternal) or IsConversionNeededForCompare(AField) then + begin + if not Assigned(FOnCompare) and IsProviderMode and + Provider.CustomDataSource.IsNativeCompareFunc and + (ARecordIndex1 >= 0) and (ARecordIndex2 >= 0) then + begin + Result := Provider.NativeCompareFunc(ARecordIndex1, ARecordIndex2, AField); + end + else + begin + V1 := GetComparedValue(ARecordIndex1, AField); + V2 := GetComparedValue(ARecordIndex2, AField); + if Assigned(FOnCompare) then + begin + Result := 0; + FOnCompare(Self, ARecordIndex1, ARecordIndex2, AField.Index, V1, V2, Result); + end + else + begin + if VarIsStr(V1) and VarIsStr(V2) then + Result := StringCompare(VarToStr(V1), VarToStr(V2)) + else + Result := VarCompare(V1, V2); + // 2 Result := StringCompare(VarToStr(V1), VarToStr(V2)); + { 1 + if IsStringConversionNeeded(AField) then + Result := StringCompare(VarToStr(V1), VarToStr(V2)) + else + Result := VarCompare(V1, V2); + } + end; + end; + end + else + Result := NativeCompare(ARecordIndex1, ARecordIndex2, AField); +end; + +function TcxCustomDataController.CompareEqualRecords(ARecordIndex1, ARecordIndex2: Integer): Integer; +begin + Result := ARecordIndex1 - ARecordIndex2; +end; + +function TcxCustomDataController.CompareRecords(ARecordIndex1, ARecordIndex2: Integer; + ASortInfo: TcxDataSortInfo; AMode: TcxDataControllerComparisonMode = dccmOther): Integer; +begin + Result := CompareByField(ARecordIndex1, ARecordIndex2, ASortInfo.Field, AMode); + if ASortInfo.SortOrder = soDescending then + Result := -Result; +end; + +function TcxCustomDataController.FindGroupRecord(ABufferRecordIndex: Integer; + AGroupItemCount: Integer): Integer; + + function Compare(ARecordIndex, AItemIndex: Integer): Integer; + begin + Result := DataControllerInfo.CompareGroupRecords(ARecordIndex, ABufferRecordIndex, AItemIndex); + end; + +var + L, H, I, C: Integer; + J, JLast: Integer; +begin + Result := -1; + L := 0; + H := DataControllerInfo.GetInternalRecordCount - 1; + JLast := AGroupItemCount - 1; + if L <= H then + repeat + I := (L + H) div 2; + for J := 0 to AGroupItemCount - 1 do + begin + C := Compare(DataControllerInfo.GetInternalRecordIndex(I), J); + if C = 0 then + begin + if J = JLast then + begin + Result := DataControllerInfo.GetInternalRecordIndex(I); + Exit; + end; + end + else + begin + if C < 0 then + L := I + 1 + else + H := I - 1; + Break; + end; + end; + if L > H then + Break; + until False; +end; + +function TcxCustomDataController.FindRecordByFields(ABufferRecordIndex: Integer; + AFields: TList): Integer; + + function IsEqual(ARecordIndex: Integer): Boolean; + var + I: Integer; + begin + Result := AFields.Count > 0; + for I := 0 to AFields.Count - 1 do + if CompareByField(ARecordIndex, ABufferRecordIndex, TcxCustomDataField(AFields[I]), dccmOther) <> 0 then + begin + Result := False; + Break; + end; + end; + +var + I: Integer; +begin + Result := -1; + DataControllerInfo.PrepareSorting; + try + for I := 0 to RecordCount - 1 do + if IsEqual(I) then + begin + Result := I; + Break; + end; + finally + DataControllerInfo.UnprepareSorting; + end; +end; + +function TcxCustomDataController.GetComparedValue(ARecordIndex: Integer; + AField: TcxCustomDataField): Variant; +begin + if (AField.FNeedConversionFlag = 2) then + Result := GetDisplayText(ARecordIndex, AField.Index) + else + Result := GetInternalValue(ARecordIndex, AField); +end; + +function TcxCustomDataController.IsConversionNeededForCompare(AField: TcxCustomDataField): Boolean; +begin + if AField.FNeedConversionFlag <> 0 then + begin + Result := AField.FNeedConversionFlag >= 1; + Exit; + end; + Result := AField.NeedConversion or IsStringConversionNeeded(AField) or + IsSortByDisplayTextNeeded(AField); + if not Result and IsProviderMode then + Result := not Provider.CustomDataSource.IsNativeCompare; +end; + +function TcxCustomDataController.IsFilterItemSortByDisplayText(AItemIndex: Integer): Boolean; +var + AField: TcxCustomDataField; +begin + Result := GetItemSortByDisplayText(AItemIndex, True); + if not Result and (Options * [dcoAnsiSort] <> []) then + begin + AField := Fields[AItemIndex]; + Result := Assigned(AField.ValueDef) and AField.ValueDef.IsNeedConversion; + end; +end; + +function TcxCustomDataController.IsStringConversionNeeded(AField: TcxCustomDataField): Boolean; +begin + Result := (Options * [dcoAnsiSort, dcoCaseInsensitive] <> []) and + Assigned(AField.ValueDef) and AField.ValueDef.IsNeedConversion; +end; + +function TcxCustomDataController.IsSortByDisplayTextNeeded(AField: TcxCustomDataField): Boolean; +begin + Result := not FInternalFindRecord and not AField.IsInternal and + GetItemSortByDisplayText(AField.Index, dcoSortByDisplayText in Options); +end; + +function TcxCustomDataController.NativeCompare(ARecordIndex1, ARecordIndex2: Integer; + AField: TcxCustomDataField): Integer; +begin + if Assigned(AField.ValueDef) then + begin + if not IsProviderMode then + Result := DataStorage.CompareRecords(ARecordIndex1, ARecordIndex2, AField.ValueDef) + else + Result := Provider.NativeCompare(ARecordIndex1, ARecordIndex2, AField); + end + else + Result := 0; +end; + +procedure TcxCustomDataController.DeleteFocusedRecord; +begin + if FNearestRecordIndex >= FocusedRecordIndex then + Dec(FNearestRecordIndex); + try + Provider.Delete; + except + FNearestRecordIndex := FocusedRecordIndex; + raise; + end; +end; + +procedure TcxCustomDataController.DeleteRecords(AList: TList); +var + I, J, AOldNearestRecordIndex: Integer; +begin + // Prepare List - sort and delete duplicates + AList.Sort(CompareIntegers); + for I := AList.Count - 2 downto 0 do + begin + J := I + 1; + if AList[I] = AList[J] then + AList.Delete(J); + end; + + AOldNearestRecordIndex := FNearestRecordIndex; + if AOldNearestRecordIndex <> -1 then + begin + for I := 0 to AList.Count - 1 do + begin + if AOldNearestRecordIndex >= Integer(AList[I]) then + Dec(FNearestRecordIndex); + end; + end; + + try + Provider.DeleteRecords(AList); + except + FNearestRecordIndex := FocusedRecordIndex; + raise; + end; +end; + +procedure TcxCustomDataController.BeginSmartLoad; +begin + with Provider do + begin + Freeze; + SavePos; + DataStorage.BeginLoad; + end; +end; + +procedure TcxCustomDataController.EndSmartLoad; +begin + with Provider do + begin + DataStorage.EndLoad; + RestorePos; + Unfreeze; + end; + UpdateFocused; + DataControllerInfo.Refresh; +end; + +function TcxCustomDataController.LoadRecord(AData: Pointer): Integer; +begin + if IsProviderMode then + Result := Provider.AddRecordHandle(AData) + else + begin + Result := DataStorage.AppendRecord; + DataStorage.ReadRecord(Result, TcxValueDefReader(AData)); + DoReadRecord(Result); + end; +end; + +procedure TcxCustomDataController.BeginReadRecord; +begin +end; + +procedure TcxCustomDataController.EndReadRecord; +begin +end; + +function TcxCustomDataController.GetSortingBySummaryEngineClass: TcxSortingBySummaryEngineClass; +begin + Result := nil; +end; + +function TcxCustomDataController.GetCustomDataSource: TcxCustomDataSource; +begin + Result := Provider.CustomDataSource; +end; + +function TcxCustomDataController.GetDetailMode: TcxDataControllerDetailMode; +begin + if FMasterRelation <> nil then + begin + if FMasterRecordIndex <> -1 then + Result := dcdmClone + else + Result := dcdmPattern; + end + else + if FIsPattern then + Result := dcdmPattern + else + Result := dcdmNone; +end; + +function TcxCustomDataController.GetFilteredIndexByRecordIndex(Index: Integer): Integer; +begin + Result := DataControllerInfo.GetInternalRecordListIndex(Index); +end; + +function TcxCustomDataController.GetFilteredRecordCount: Integer; +begin + Result := DataControllerInfo.GetInternalRecordCount; +end; + +function TcxCustomDataController.GetFilteredRecordIndex(Index: Integer): Integer; +begin + Result := DataControllerInfo.GetInternalRecordIndex(Index); +end; + +function TcxCustomDataController.GetIsEditing: Boolean; +begin + Result := EditState * [dceInsert, dceEdit] <> []; + Result := Result and (Provider.FEditingRecordIndex <> cxNullEditingRecordIndex); +end; + +function TcxCustomDataController.GetIsPattern: Boolean; +begin + Result := DetailMode = dcdmPattern; +end; + +function TcxCustomDataController.GetIsRowInfoValid: Boolean; +begin + Result := not DataControllerInfo.FInfoCalculation; +end; + +function TcxCustomDataController.GetLockCount: Integer; +begin + Result := DataControllerInfo.LockCount; +end; + +function TcxCustomDataController.GetNewItemRowFocused: Boolean; +begin + Result := FNewItemRowFocused and UseNewItemRowForEditing and + (DataControllerInfo.FocusedRecordIndex = -1); +end; + +function TcxCustomDataController.GetOptions: TcxDataControllerOptions; +begin + Result := FOptions; +end; + +function TcxCustomDataController.GetRelations: TcxCustomDataRelationList; +begin + if FRelations = nil then + FRelations := TcxCustomDataRelationList.Create(Self); + Result := FRelations; +end; + +function TcxCustomDataController.GetSortingBySummaryDataItemIndex: Integer; +begin + if FSortingBySummaryDataItemField <> nil then + Result := FSortingBySummaryDataItemField.Index + else + Result := -1; +end; + +procedure TcxCustomDataController.SetCustomDataSource(Value: TcxCustomDataSource); +begin + Provider.CustomDataSource := Value; +end; + +procedure TcxCustomDataController.SetIsPattern(Value: Boolean); +var + APrevIsPattern: Boolean; +begin + if Value and (FDataChangeRefCount <> 0) and (FMasterRelation <> nil) then + raise Exception.Create('!'); + APrevIsPattern := IsPattern; + FIsPatternSave := Value; + FIsPattern := FIsPatternSave and (FDataChangeRefCount = 0); + if IsPattern <> APrevIsPattern then + if not (csDestroying in FOwner.ComponentState) then + RestructData; +end; + +procedure TcxCustomDataController.SetFilter(Value: TcxDataFilterCriteria); +begin + FFilter.Assign(Value); +end; + +procedure TcxCustomDataController.SetFocusedRowIndex(Value: Integer); +begin + ChangeFocusedRowIndex(Value); +end; + +procedure TcxCustomDataController.SetMultiSelect(Value: Boolean); +begin + if FMultiSelect <> Value then + begin + FMultiSelect := Value; + FFocusedSelected := True; // reset + BeginUpdate; + try + if not Value then + ClearSelection + else + if FocusedRowIndex <> -1 then + ChangeRowSelection(FocusedRowIndex, True); + if [soSelectedRecords, soMultipleSelectedRecords] * Summary.Options <> [] then + Summary.Changed(False); + finally + EndUpdate; + end; + end; +end; + +procedure TcxCustomDataController.SetNewItemRowFocused(Value: Boolean); +begin + if FNewItemRowFocused <> Value then + begin + BeginUpdate; + try + if FNewItemRowFocused then + begin + if not (csDestroying in FOwner.ComponentState) then + Post; + end + else + ChangeFocusedRowIndex(-1); + DataControllerInfo.FocusedRecordChanged(True); //? + FNewItemRowFocused := Value; // Notification + finally + EndUpdate; + end; + if (dcoInsertOnNewItemRowFocusing in Options) and + NewItemRowFocused and not Provider.IsInserting then + Insert; + end; +end; + +procedure TcxCustomDataController.SetOnFilterRecord(Value: TcxDataFilterRecordEvent); +begin + if @FOnFilterRecord <> @Value then + begin + FOnFilterRecord := Value; + Filter.Changed; + end; +end; + +procedure TcxCustomDataController.SetOptions(Value: TcxDataControllerOptions); +begin + if FOptions <> Value then + begin + FOptions := Value; + Refresh; + end; +end; + +procedure TcxCustomDataController.SetSummary(Value: TcxDataSummary); +begin + FSummary.Assign(Value); +end; + +procedure TcxCustomDataController.SetUseNewItemRowForEditing(Value: Boolean); +begin + if FUseNewItemRowForEditing <> Value then + begin + Cancel; + ClearSelection; + FUseNewItemRowForEditing := Value; + Change([dccData]); + end; +end; + +procedure TcxCustomDataController.SetSortingBySummaryDataItemIndex(Value: Integer); +begin + if GetSortingBySummaryDataItemIndex <> Value then + begin + if Value = -1 then + FSortingBySummaryDataItemField := nil + else + begin + CheckItemRange(Value); + FSortingBySummaryDataItemField := Fields[Value]; + end; + DoSortingBySummaryChanged; + end; +end; + +procedure TcxCustomDataController.Update; +var + AChanges: TcxDataControllerChanges; +begin + AChanges := FChanges; + FChanges := []; + if dccData in AChanges then + DataNotification + else + if AChanges * [dccLayout, dccDetail, dccSummary] <> [] then + LayoutNotification + else + if dccUpdateRecord in AChanges then + UpdateRecordNotification; + if dccFocus in AChanges then + FocusedNotification; + if dccSelection in AChanges then + SelectionNotification; + if dccSearch in AChanges then + SearchNotification; + if dccBookmark in AChanges then + BookmarkNotification; + // events + if dccGrouping in AChanges then + DoGroupingChanged; + if dccSorting in AChanges then + DoSortingChanged; + // master-detail sync + if dccSyncMasterPos in AChanges then + begin + if DetailMode = dcdmClone then + GetPatternDataController.UpdateFocused; + end; +end; + +procedure TcxCustomDataController.BeforeGroupingNotification; +begin + NotifyControl(TcxGroupingChangingInfo.Create); +end; + +procedure TcxCustomDataController.BookmarkNotification; +begin + NotifyControl(TcxBookmarkChangedInfo.Create); +end; + +procedure TcxCustomDataController.DataNotification; +var + ADataChangedInfo: TcxDataChangedInfo; +begin + try + ADataChangedInfo := TcxDataChangedInfo.Create; + if (FDataChangeInfo.Kind = dcField) and (FDataChangeInfo.ItemIndex = -1) then + FDataChangeInfo.Kind := dcRecord; + if (FDataChangeInfo.Kind in [dcField, dcRecord]) and + ((FDataChangeInfo.RecordIndex = -1) and not IsNewItemRecordIndex(FDataChangeInfo.RecordIndex)) then + FDataChangeInfo.Kind := dcTotal; + ADataChangedInfo.Kind := FDataChangeInfo.Kind; + ADataChangedInfo.ItemIndex := FDataChangeInfo.ItemIndex; + ADataChangedInfo.RecordIndex := FDataChangeInfo.RecordIndex; + NotifyControl(ADataChangedInfo); + DoDataChanged; + finally + ResetDataChangeInfo; + end; +end; + +procedure TcxCustomDataController.DoGroupingChanged; +begin + if [csReading{csLoading}] * FOwner.ComponentState <> [] then Exit; // TODO: collection -> lookup grid // // TODO: method IsLoading/Destroying + if Assigned(FOnGroupingChanged) then FOnGroupingChanged(Self); +end; + +procedure TcxCustomDataController.DoSortingBySummaryChanged; +begin + if IsDestroying then + Exit; + FSortingBySummaryChanged := True; + Change([dccSorting{dccGrouping}]); +end; + +procedure TcxCustomDataController.DoSortingChanged; +begin + if [csReading{csLoading}] * FOwner.ComponentState <> [] then Exit; // TODO: collection -> lookup grid // // TODO: method IsLoading/Destroying + if FInOnSortingChanged then Exit; + FInOnSortingChanged := True; + try + if Assigned(FOnSortingChanged) then FOnSortingChanged(Self); + finally + FInOnSortingChanged := False; + end; +end; + +procedure TcxCustomDataController.FocusedNotification; +begin + if DataControllerInfo.PrevFocusedRowIndex <> DataControllerInfo.FocusedRowIndex then + NotifyControl(TcxFocusedRowChangedInfo.Create(DataControllerInfo.PrevFocusedRowIndex, + DataControllerInfo.FocusedRowIndex)); + if (DataControllerInfo.PrevFocusedRecordIndex >= 0) or + (DataControllerInfo.FocusedRecordIndex >= 0) or + DataControllerInfo.FPrevFocusingInfo.FChangedFlag then + begin +// !!! +// if (DataControllerInfo.PrevFocusedRecordIndex <> DataControllerInfo.FocusedRecordIndex) and +// not DataControllerInfo.FPrevFocusingInfo.FChangedFlag then + NotifyControl(TcxFocusedRecordChangedInfo.Create(DataControllerInfo.PrevFocusedRecordIndex, + DataControllerInfo.FocusedRecordIndex, DataControllerInfo.PrevFocusedRowIndex, + DataControllerInfo.FocusedRowIndex, DataControllerInfo.NewItemRowFocusingChanged)); + Search.Cancel; + end; + DataControllerInfo.FPrevFocusingInfo.Assign(DataControllerInfo.FFocusingInfo); +end; + +procedure TcxCustomDataController.LayoutNotification; +begin + NotifyControl(TcxLayoutChangedInfo.Create); +end; + +procedure TcxCustomDataController.UpdateRecordNotification; +begin + NotifyControl(TcxUpdateRecordInfo.Create(FocusedRecordIndex)); + Search.Cancel; +end; + +procedure TcxCustomDataController.SearchNotification; +begin + NotifyControl(TcxSearchChangedInfo.Create); +end; + +procedure TcxCustomDataController.SelectionNotification; +var + AInfo: TcxSelectionChangedInfo; + ARowIndex1, ARowIndex2: Integer; +begin + ARowIndex1 := -1; + ARowIndex2 := -1; + FSelectionChangedInfo.SelectedCount := GetSelectedCount; + if FSelectionChangedInfo.SelectedCount <= 1 then + begin + if FSelectionChangedInfo.SelectedCount = 1 then + FSelectionChangedInfo.RowIndex := GetSelectedRowIndex(0) + else + FSelectionChangedInfo.RowIndex := -1; + if FPrevSelectionChangedInfo.SelectedCount <= 1 then + begin + if FPrevSelectionChangedInfo.SelectedCount = 1 then + ARowIndex1 := FPrevSelectionChangedInfo.RowIndex + else + ARowIndex1 := -1; + ARowIndex2 := FSelectionChangedInfo.RowIndex; + end; + end; + AInfo := TcxSelectionChangedInfo.CreateEx(ARowIndex1, ARowIndex2); + NotifyControl(AInfo); + FPrevSelectionChangedInfo := FSelectionChangedInfo; +end; + +procedure TcxCustomDataController.NotifyControl(AUpdateControlInfo: TcxUpdateControlInfo); +begin + FInNotifyControl := True; + try + UpdateControl(AUpdateControlInfo); + finally + AUpdateControlInfo.Free; + FInNotifyControl := False; + end; +end; + +procedure TcxCustomDataController.NotifyListenerLinks; +var + I: Integer; + ALink: TcxDataListenerLink; +begin + for I := FListenerLinks.Count - 1 downto 0 do + begin + ALink := TcxDataListenerLink(FListenerLinks[I]); + ALink.Ref := nil; + FListenerLinks.Delete(I); + end; +end; + +procedure TcxCustomDataController.ResetDataChangeInfo; +begin + FDataChangeInfo.Kind := dcTotal; + FDataChangeInfo.ItemIndex := -1; + FDataChangeInfo.RecordIndex := -1; +end; + +end. diff --git a/official/x.35/ExpressDataController/Sources/cxDB.pas b/official/x.35/ExpressDataController/Sources/cxDB.pas new file mode 100644 index 00000000..dfc64389 --- /dev/null +++ b/official/x.35/ExpressDataController/Sources/cxDB.pas @@ -0,0 +1,873 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDataController } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDATACONTROLLER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDB; + +{$I cxVer.inc} + +interface + +uses + Classes, SysUtils, {$IFDEF DELPHI6}Variants, {$ENDIF} DB, + cxDataUtils; + +type + { TcxDBAdapterList } + + TDataSetClass = class of TDataSet; + + TcxDBAdapterItem = class + private + FDataSetClass: TDataSetClass; + public + constructor Create(ADataSetClass: TDataSetClass); virtual; + property DataSetClass: TDataSetClass read FDataSetClass; + end; + + TcxDBAdapterItemClass = class of TcxDBAdapterItem; + + TcxDBAdapterList = class + private + FItems: TList; + function GetItem(Index: Integer): TcxDBAdapterItem; + function GetItemCount: Integer; + public + constructor Create; + destructor Destroy; override; + procedure Clear; + function FindAdapter(ADataSetClass: TDataSetClass; var AIndex: Integer): Boolean; virtual; + procedure RegisterAdapter(ADataSetClass: TDataSetClass; AItemClass: TcxDBAdapterItemClass); virtual; + procedure UnregisterAdapter(ADataSetClass: TDataSetClass; AItemClass: TcxDBAdapterItemClass); virtual; + property ItemCount: Integer read GetItemCount; + property Items[Index: Integer]: TcxDBAdapterItem read GetItem; default; + end; + + { TcxCustomFieldDataLink } + + TcxCustomDBDataBinding = class; + + TcxCustomFieldDataLink = class(TDataLink) + private + FField: TField; + FFieldName: string; + FEditing: Boolean; + FModified: Boolean; + function GetCanModify: Boolean; + function GetDataComponent: TComponent; + procedure SetEditing(Value: Boolean); + procedure SetField(Value: TField); + procedure SetFieldName(const Value: string); + procedure UpdateField; + protected + FDataBinding: TcxCustomDBDataBinding; + procedure ActiveChanged; override; + procedure DataEvent(Event: TDataEvent; Info: Longint); override; + procedure EditingChanged; override; + procedure LayoutChanged; override; + procedure RecordChanged(Field: TField); override; + procedure UpdateData; override; + procedure DataComponentChanged; virtual; + procedure UpdateRightToLeft; virtual; + procedure VisualControlChanged; virtual; + property DataBinding: TcxCustomDBDataBinding read FDataBinding; + property DataComponent: TComponent read GetDataComponent; + public + constructor Create(ADataBinding: TcxCustomDBDataBinding); virtual; + function Edit: Boolean; + procedure Modified; + procedure Reset; + property CanModify: Boolean read GetCanModify; + property Editing: Boolean read FEditing; + property Field: TField read FField; + property FieldName: string read FFieldName write SetFieldName; + end; + + TcxCustomFieldDataLinkClass = class of TcxCustomFieldDataLink; + + { TcxCustomDBDataBinding } + + TcxCustomDBDataBinding = class(TcxCustomDataBinding) + private + FRefreshCount: Integer; + function GetDataField: string; + function GetDataSource: TDataSource; + function GetField: TField; + procedure InternalDataChange; + procedure SetDataField(const Value: string); + procedure SetDataSource(Value: TDataSource); + protected + FDataLink: TcxCustomFieldDataLink; + function GetModified: Boolean; override; + function GetReadOnly: Boolean; override; + procedure SetReadOnly(Value: Boolean); override; + procedure VisualControlChanged; override; + procedure DisableRefresh; + procedure EnableRefresh; + function GetDataLinkClass: TcxCustomFieldDataLinkClass; virtual; + function IsRefreshDisabled: Boolean; + public + constructor Create(AOwner, ADataComponent: TComponent); override; + destructor Destroy; override; + function CanModify: Boolean; override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + function GetStoredValue(AValueSource: TcxDataEditValueSource; AFocused: Boolean): Variant; override; + function IsControlReadOnly: Boolean; override; + function IsDataSourceLive: Boolean; override; + function IsDataStorage: Boolean; override; + procedure Reset; override; + function SetEditMode: Boolean; override; + procedure SetStoredValue(AValueSource: TcxDataEditValueSource; const Value: Variant); override; + function UpdateAction(Action: TBasicAction): Boolean; override; + procedure UpdateDataSource; override; + property Field: TField read GetField; + property DataSource: TDataSource read GetDataSource write SetDataSource; + property DataField: string read GetDataField write SetDataField; + property DataLink: TcxCustomFieldDataLink read FDataLink; + end; + +function CanModifyLookupField(AField: TField): Boolean; +procedure CheckFilterFieldName(var AFieldName: string); +function GetDataSetValues(ADataSet: TDataSet; AFields: TList): Variant; +function GetFilterFieldName(AField: TField; AIgnoreOrigin: Boolean): string; +function IsEqualFieldNames(const AFieldName1, AFieldName2: string): Boolean; +function IsFieldCanModify(AField: TField; AIsValueSource: Boolean): Boolean; +function IsFieldFormatted(AField: TField; AIsTextEdit: Boolean): Boolean; +function IsMultipleFieldNames(const AFieldNames: string): Boolean; +function IsSimpleCurrencyField(AField: TField): Boolean; +function GetFieldNamesCount(const AFieldNames: string): Integer; +procedure GetFieldNames(const AFieldNames: string; AList: TStrings); +function GetFieldValue(AField: TField): Variant; +procedure SetDataSetValues(ADataSet: TDataSet; AFields: TList; const AValues: Variant); +procedure SetFieldValue(AField: TField; const AValue: Variant); + +implementation + +uses + cxVariants; + +function CanModifyLookupField(AField: TField): Boolean; +var + AMasterFields: TList; + I: Integer; +begin + Result := False; + if Assigned(AField.DataSet) then + begin + AMasterFields := TList.Create; + try + AField.DataSet.GetFieldList(AMasterFields, AField.KeyFields); + Result := AMasterFields.Count > 0; + for I := 0 to AMasterFields.Count - 1 do + Result := Result and TField(AMasterFields[I]).CanModify; + finally + AMasterFields.Free; + end; + end; +end; + +procedure CheckFilterFieldName(var AFieldName: string); +begin + if not IsValidIdent(AFieldName) then + AFieldName := '[' + AFieldName + ']'; +end; + +function GetDataSetValues(ADataSet: TDataSet; AFields: TList): Variant; +var + I: Integer; +begin + if AFields.Count > 0 then + begin + if AFields.Count > 1 then + begin + Result := VarArrayCreate([0, AFields.Count - 1], varVariant); + for I := 0 to AFields.Count - 1 do + Result[I] := TField(AFields[I]).Value; + end + else + Result := TField(AFields[0]).Value; + end + else + Result := Null; +end; + +function GetFilterFieldName(AField: TField; AIgnoreOrigin: Boolean): string; +begin + Result := ''; + if Assigned(AField) then + begin + if not AIgnoreOrigin then + Result := AField.Origin; + if Result = '' then + begin + Result := AField.FieldName; + CheckFilterFieldName(Result); + end; + end; +end; + +function IsEqualFieldNames(const AFieldName1, AFieldName2: string): Boolean; +begin + Result := AnsiUpperCase(AFieldName1) = AnsiUpperCase(AFieldName2); +end; + +function IsFieldCanModify(AField: TField; AIsValueSource: Boolean): Boolean; +begin + Result := AField.CanModify and + (AIsValueSource or not (AField.DataType in ftNonTextTypes) or Assigned(AField.OnSetText)); +end; + +function IsFieldFormatted(AField: TField; AIsTextEdit: Boolean): Boolean; +begin + Result := Assigned(AField.OnGetText) or (AField.EditMask <> ''); + if not Result then + begin + if AField.DataType in ftNonTextTypes then + Result := AIsTextEdit // Field.DisplayText! + else + if AField is TBooleanField then + Result := AIsTextEdit // TODO: compare DisplayValues + else + if AField is TNumericField then + begin + Result := ((AField as TNumericField).DisplayFormat <> '') or + ((AField as TNumericField).EditFormat <> ''); + if not Result then + begin + if AField is TFloatField then + Result := (AField as TFloatField).Currency + else + if AField is TBCDField then + Result := (AField as TBCDField).Currency + {$IFDEF DELPHI6} + else + if AField is TFMTBCDField then + Result := (AField as TFMTBCDField).Currency + {$ENDIF} + end; + end + else + if AField is TDateTimeField then + Result := (AField as TDateTimeField).DisplayFormat <> '' + else + {$IFDEF DELPHI5} + if AField is TAggregateField then + Result := ((AField as TAggregateField).DisplayFormat <> '') or + (AField as TAggregateField).Currency + else + {$IFDEF DELPHI6} + if AField is TSQLTimeStampField then + Result := (AField as TSQLTimeStampField).DisplayFormat <> ''; + {$ENDIF} + {$ENDIF} + end; +end; + +function IsMultipleFieldNames(const AFieldNames: string): Boolean; +var + APos: Integer; +begin + APos := 1; +{$WARNINGS OFF} + ExtractFieldName(AFieldNames, APos); +{$WARNINGS ON} + Result := APos <= Length(AFieldNames); +end; + +function IsSimpleCurrencyField(AField: TField): Boolean; +begin + Result := False; + if AField is TNumericField then + begin + if AField is TFloatField then + Result := (AField as TFloatField).Currency + else + begin + if AField is TBCDField then + Result := (AField as TBCDField).Currency + {$IFDEF DELPHI6} + else + if AField is TFMTBCDField then + Result := (AField as TFMTBCDField).Currency; + {$ENDIF} + end; + if Result then + begin + if ((AField as TNumericField).DisplayFormat <> '') or Assigned(AField.OnGetText) then + Result := False; + end; + end; +end; + +function GetFieldNamesCount(const AFieldNames: string): Integer; +var + APos: Integer; +begin + Result := 0; // TODO: use GetFieldNames? + APos := 1; + while APos <= Length(AFieldNames) do + begin + Inc(Result); + {$WARNINGS OFF} + ExtractFieldName(AFieldNames, APos); + {$WARNINGS ON} + end; +end; + +procedure GetFieldNames(const AFieldNames: string; AList: TStrings); +var + APos: Integer; +begin + AList.Clear; + APos := 1; + while APos <= Length(AFieldNames) do + {$WARNINGS OFF} + AList.Add(ExtractFieldName(AFieldNames, APos)) + {$WARNINGS ON} +end; + +function GetFieldValue(AField: TField): Variant; +begin + if AField is TAggregateField then // bug in Delphi (IsNull = True!) + Result := AField.Value + else + if AField.IsNull then + Result := Null + else + begin + {$IFDEF DELPHI5} + if AField is TWideStringField then // bug in Delphi + Result := TWideStringField(AField).Value + else + {$ENDIF} + Result := AField.Value; + end; +end; + +procedure SetDataSetValues(ADataSet: TDataSet; AFields: TList; + const AValues: Variant); +var + I: Integer; +begin + if AFields.Count > 0 then + begin + if AFields.Count > 1 then + begin + for I := 0 to AFields.Count - 1 do + TField(AFields[I]).Value := AValues[I]; + end + else + TField(AFields[0]).Value := AValues; + end; +end; + +procedure SetFieldValue(AField: TField; const AValue: Variant); +begin + if (AField is TDateTimeField) and (VarType(AValue) = varDouble) then // bug in Delphi + TDateTimeField(AField).Value := AValue + else + AField.Value := AValue; +end; + +{ TcxDBAdapterItem } + +constructor TcxDBAdapterItem.Create(ADataSetClass: TDataSetClass); +begin + inherited Create; + FDataSetClass := ADataSetClass; +end; + +{ TcxDBAdapterList } + +constructor TcxDBAdapterList.Create; +begin + inherited Create; + FItems := TList.Create; +end; + +destructor TcxDBAdapterList.Destroy; +begin + Clear; + FItems.Free; + FItems := nil; + inherited Destroy; +end; + +procedure TcxDBAdapterList.Clear; +var + I: Integer; +begin + for I := 0 to FItems.Count - 1 do + TObject(FItems[I]).Free; + FItems.Clear; +end; + +function TcxDBAdapterList.FindAdapter(ADataSetClass: TDataSetClass; + var AIndex: Integer): Boolean; +var + I: Integer; + AItem: TcxDBAdapterItem; +begin + Result := False; + for I := FItems.Count - 1 downto 0 do + begin + AItem := TcxDBAdapterItem(FItems[I]); + if ADataSetClass.InheritsFrom(AItem.DataSetClass) then + begin + AIndex := I; + Result := True; + Break; + end + else + if AItem.DataSetClass.InheritsFrom(ADataSetClass) then + AIndex := I; + end; +end; + +procedure TcxDBAdapterList.RegisterAdapter(ADataSetClass: TDataSetClass; + AItemClass: TcxDBAdapterItemClass); +var + AIndex: Integer; +begin + AIndex := -1; + if FindAdapter(ADataSetClass, AIndex) then + FItems.Insert(AIndex + 1, AItemClass.Create(ADataSetClass)) + else + if AIndex <> -1 then + FItems.Insert(AIndex, AItemClass.Create(ADataSetClass)) + else + FItems.Add(AItemClass.Create(ADataSetClass)); +end; + +procedure TcxDBAdapterList.UnregisterAdapter(ADataSetClass: TDataSetClass; + AItemClass: TcxDBAdapterItemClass); +var + I: Integer; + AItem: TcxDBAdapterItem; +begin + for I := FItems.Count - 1 downto 0 do + begin + AItem := TcxDBAdapterItem(FItems[I]); + if (AItem.DataSetClass = ADataSetClass) and (AItem.ClassType = AItemClass) then + begin + AItem.Free; + FItems.Delete(I); + end; + end; +end; + +function TcxDBAdapterList.GetItem(Index: Integer): TcxDBAdapterItem; +begin + Result := TcxDBAdapterItem(FItems[Index]); +end; + +function TcxDBAdapterList.GetItemCount: Integer; +begin + Result := FItems.Count; +end; + +{ TcxCustomFieldDataLink } + +constructor TcxCustomFieldDataLink.Create(ADataBinding: TcxCustomDBDataBinding); +begin + inherited Create; + VisualControl := False; + FDataBinding := ADataBinding; +end; + +function TcxCustomFieldDataLink.Edit: Boolean; +begin + if CanModify then + inherited Edit; + Result := FEditing; +end; + +procedure TcxCustomFieldDataLink.Modified; +begin + FModified := True; +end; + +procedure TcxCustomFieldDataLink.Reset; +begin + RecordChanged(nil); +end; + +procedure TcxCustomFieldDataLink.ActiveChanged; +begin + UpdateField; + FDataBinding.DataSetChange; +end; + +procedure TcxCustomFieldDataLink.DataEvent(Event: TDataEvent; + Info: Longint); +begin + if Event = deDataSetChange then + UpdateField; + inherited DataEvent(Event, Info); + if Event = deDataSetChange then + FDataBinding.DataSetChange; +end; + +procedure TcxCustomFieldDataLink.EditingChanged; +begin + SetEditing(inherited Editing and CanModify); +end; + +(*procedure TcxCustomFieldDataLink.FocusControl(Field: TFieldRef); +begin + if (Field^ <> nil) and (Field^ = FField) and (FDataComponent is TWinControl) then + if TWinControl(FDataComponent).CanFocus then + begin + Field^ := nil; + TWinControl(FDataComponent).SetFocus; + end; +end;*) + +procedure TcxCustomFieldDataLink.LayoutChanged; +begin + UpdateField; +end; + +procedure TcxCustomFieldDataLink.RecordChanged(Field: TField); +begin + if (Field = nil) or (Field = FField) then + begin + FDataBinding.InternalDataChange; + if not FDataBinding.IsRefreshDisabled then + FModified := False; + end; +end; + +procedure TcxCustomFieldDataLink.UpdateData; +begin + if FModified then + begin + if Field <> nil then + FDataBinding.UpdateData; + if not FDataBinding.IsRefreshDisabled then + FModified := False; + end; +end; + +procedure TcxCustomFieldDataLink.DataComponentChanged; +begin +end; + +procedure TcxCustomFieldDataLink.UpdateRightToLeft; +begin +end; + +procedure TcxCustomFieldDataLink.VisualControlChanged; +begin +end; + +function TcxCustomFieldDataLink.GetCanModify: Boolean; +begin + Result := not ReadOnly and (Field <> nil) and (Field.CanModify or + (Field.Lookup and CanModifyLookupField(Field))); +end; + +function TcxCustomFieldDataLink.GetDataComponent: TComponent; +begin + Result := FDataBinding.DataComponent; +end; + +procedure TcxCustomFieldDataLink.SetEditing(Value: Boolean); +begin + if FEditing <> Value then + begin + FEditing := Value; + if not FDataBinding.IsRefreshDisabled then + FModified := False; + end; +end; + +procedure TcxCustomFieldDataLink.SetField(Value: TField); +begin + if FField <> Value then + begin + FField := Value; + FDataBinding.DataSetChange; + EditingChanged; + RecordChanged(nil); + UpdateRightToLeft; + end; +end; + +procedure TcxCustomFieldDataLink.SetFieldName(const Value: string); +begin + if FFieldName <> Value then + begin + FFieldName := Value; + UpdateField; + end; +end; + +procedure TcxCustomFieldDataLink.UpdateField; +begin + if Active and (FFieldName <> '') then + begin + FField := nil; + if Assigned(DataComponent) then + SetField(GetFieldProperty(DataSource.DataSet, DataComponent, FFieldName)) + else + SetField(DataSource.DataSet.FieldByName(FFieldName)); + end + else + SetField(nil); +end; + +{ TcxCustomDBDataBinding } + +constructor TcxCustomDBDataBinding.Create(AOwner, ADataComponent: TComponent); +begin + inherited Create(AOwner, ADataComponent); + FDataLink := GetDataLinkClass.Create(Self); +// TODO SetReplicatable +end; + +destructor TcxCustomDBDataBinding.Destroy; +begin + FDataLink.Free; + inherited Destroy; +end; + +function TcxCustomDBDataBinding.CanModify: Boolean; +begin + Result := IsDataSourceLive and not Field.ReadOnly; + Result := Result and (Field.CanModify or (Field.Lookup and CanModifyLookupField(Field))); +end; + +function TcxCustomDBDataBinding.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := FDataLink.ExecuteAction(Action); +end; + +function TcxCustomDBDataBinding.IsControlReadOnly: Boolean; +begin + Result := ReadOnly; + if not Result and IsDataSourceLive then + Result := Field.ReadOnly; +end; + +function TcxCustomDBDataBinding.IsDataSourceLive: Boolean; +begin + Result := (FDataLink.FField <> nil) and (FDataLink.FField <> nil) and + (FDataLink.FField.DataSet.State <> dsInactive); +end; + +function TcxCustomDBDataBinding.IsDataStorage: Boolean; +begin + Result := True; +end; + +procedure TcxCustomDBDataBinding.Reset; +begin + FDataLink.Reset; +end; + +function TcxCustomDBDataBinding.SetEditMode: Boolean; +begin + Result := inherited SetEditMode; + if not Result then + Exit; + + DisableRefresh; + try + FDatalink.Edit; + Result := FDatalink.Editing; + if Result then + FDatalink.Modified; + finally + EnableRefresh; + end; +end; + +procedure TcxCustomDBDataBinding.UpdateDataSource; +begin + FDataLink.UpdateRecord; +end; + +function TcxCustomDBDataBinding.GetModified: Boolean; +begin + Result := IsDataSourceLive and FDataLink.Editing and FDataLink.FModified; +end; + +function TcxCustomDBDataBinding.GetReadOnly: Boolean; +begin + Result := FDataLink.ReadOnly; +end; + +function TcxCustomDBDataBinding.GetStoredValue(AValueSource: TcxDataEditValueSource; + AFocused: Boolean): Variant; +begin + if not IsDataSourceLive or (Field.IsNull and (AValueSource <> evsText)) then + Result := Null + else + case AValueSource of + evsKey: + if Field.KeyFields <> '' then + Result := Field.DataSet.FieldValues[Field.KeyFields] + else + Result := Field.Value; + evsText: + if AFocused and FDataLink.CanModify then + Result := Field.Text + else + Result := Field.DisplayText; + else {evsValue:} + Result := Field.Value; + end; +end; + +procedure TcxCustomDBDataBinding.SetReadOnly(Value: Boolean); +begin + if Value <> ReadOnly then + begin + FDataLink.ReadOnly := Value; + DataSetChange; + end; +end; + +procedure TcxCustomDBDataBinding.VisualControlChanged; +begin + FDataLink.VisualControlChanged; +end; + +procedure TcxCustomDBDataBinding.SetStoredValue(AValueSource: TcxDataEditValueSource; + const Value: Variant); + + procedure SetFieldValueEx(AField: TField; const AValue: Variant); + begin + if VarIsStr(Value) and (Value = '') and not(Field.DataType in [ftString{$IFDEF DELPHI4}, ftWideString{$ENDIF}]) then + AField.Value := Null + else + AField.Value := Value; + end; + +var + AFieldList: TList; + I: Integer; +begin + if IsDataSourceLive then + begin + DisableRefresh; + try + if FDataLink.Edit then + begin + if (*(*)AValueSource = evsText(*) or Assigned(Field.OnSetText)*) then + Field.Text := VarToStr(Value) + else + if (AValueSource = evsKey) and (Field.KeyFields <> '') then + if Pos(';', Field.KeyFields) = 0 then + SetFieldValueEx(Field.DataSet.FieldByName(Field.KeyFields), Value) + else + begin + AFieldList := TList.Create; + try + Field.DataSet.GetFieldList(AFieldList, Field.KeyFields); + for I := 0 to AFieldList.Count - 1 do + SetFieldValueEx(TField(AFieldList[I]), Value[I]); + finally + AFieldList.Free; + end; + Field.DataSet.FieldValues[Field.KeyFields] := Value; + end + else + SetFieldValueEx(Field, Value); + end; + finally + EnableRefresh; + end; + end; +end; + +function TcxCustomDBDataBinding.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := FDataLink.UpdateAction(Action); +end; + +procedure TcxCustomDBDataBinding.DisableRefresh; +begin + Inc(FRefreshCount); +end; + +procedure TcxCustomDBDataBinding.EnableRefresh; +begin + if FRefreshCount > 0 then + Dec(FRefreshCount); +end; + +function TcxCustomDBDataBinding.GetDataLinkClass: TcxCustomFieldDataLinkClass; +begin + Result := TcxCustomFieldDataLink; +end; + +function TcxCustomDBDataBinding.IsRefreshDisabled: Boolean; +begin + Result := FRefreshCount > 0; +end; + +function TcxCustomDBDataBinding.GetDataField: string; +begin + Result := FDataLink.FieldName; +end; + +function TcxCustomDBDataBinding.GetDataSource: TDataSource; +begin + Result := FDataLink.DataSource; +end; + +function TcxCustomDBDataBinding.GetField: TField; +begin + Result := FDataLink.Field; +end; + +procedure TcxCustomDBDataBinding.InternalDataChange; +begin + if not IsRefreshDisabled then + DataChange; +end; + +procedure TcxCustomDBDataBinding.SetDataField(const Value: string); +begin + FDataLink.FieldName := Value; +end; + +procedure TcxCustomDBDataBinding.SetDataSource(Value: TDataSource); +begin + FDataLink.DataSource := Value; +end; + +end. diff --git a/official/x.35/ExpressDataController/Sources/cxDBData.pas b/official/x.35/ExpressDataController/Sources/cxDBData.pas new file mode 100644 index 00000000..e49acb6b --- /dev/null +++ b/official/x.35/ExpressDataController/Sources/cxDBData.pas @@ -0,0 +1,5298 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDataController } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDATACONTROLLER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDBData; + +{$I cxVer.inc} + +interface + +uses + SysUtils, Classes, {$IFDEF DELPHI6}Variants, {$ENDIF} DB, cxDataUtils, + cxCustomData, cxDataStorage, cxVariants, cxFilter, cxDBFilter, cxDB; + +type + TcxDBDataController = class; + TcxDBDataProvider = class; + TcxDBDataModeController = class; + TcxDBDataFilterCriteria = class; + TGetListProc = procedure(AList: TList) of object; + + { TcxDBProviderDetailFilterAdapter } + + TcxDBProviderDetailFilterAdapter = class(TcxDBAdapterItem) + public + function IsCurrentQuery(ADataSet: TDataSet; const AParamNames: string; const AParamValues: Variant): Boolean; virtual; + procedure ReopenSQL(ADataSet: TDataSet; const AParamNames: string; const AParamValues: Variant; var AReopened: Boolean); virtual; + procedure SetFilter(ADataSet: TDataSet; const AMasterDetailKeyFieldNames: string; + const AMasterDetailKeyValues: Variant; AIsSQLMode: Boolean; var AReopened: Boolean); virtual; + end; + + { TcxDBDataLink } + + TcxDBDataLink = class(TDataLink) + private + {$IFDEF DELPHI7} + FLayoutChangedFlag: Boolean; + FPreventLayoutChanged: Boolean; + {$ENDIF} + FProvider: TcxDBDataProvider; + procedure DoInsertingRecord; + protected + procedure ActiveChanged; override; + {$IFDEF DELPHI7} + procedure DataEvent(Event: TDataEvent; Info: Integer); override; + {$ENDIF} + procedure DataSetChanged; override; + procedure DataSetScrolled(Distance: Integer); override; + procedure EditingChanged; override; + procedure FocusControl(Field: TFieldRef); override; + procedure LayoutChanged; override; + procedure RecordChanged(Field: TField); override; + procedure UpdateData; override; + property Provider: TcxDBDataProvider read FProvider; + public + constructor Create(AProvider: TcxDBDataProvider); + end; + + { TcxDBDataProvider } + + TcxDBDataProviderSavePosInfo = record + Bookmark: TBookmarkStr; + Bof: Boolean; // conflicts with C++ macro + Eof: Boolean; // conflicts with C++ macro + ActiveRecord: Integer; + end; + + TcxDBDataAssignedFields = class + private + FFields: TList; + public + constructor Create; + destructor Destroy; override; + procedure AddField(AField: TField); + procedure AddFieldsByFieldList(AFieldList: TList); + procedure AddFieldsByFieldNames(ADataSet: TDataSet; const AFieldNames: string); + procedure Clear; + function IsEmpty: Boolean; + function IsFieldExists(AField: TField): Boolean; + end; + + TcxDBDataProvider = class(TcxCustomDataProvider) + private + FAssignedFields: TcxDBDataAssignedFields; + FDataLink: TcxDBDataLink; + FInCanInitEditing: Boolean; + FInSetDataSource: Boolean; + FIncrementalSearching: Boolean; + FInFirst: Boolean; + FInInsert: Boolean; + FInsertOperation: Boolean; + FInUpdateGridMode: Boolean; + FIsDataSetCurrent: Boolean; + FInNotify: Boolean; + FListeners: TList; + FPostLocateFlag: Boolean; + FRecordIndex: Integer; +// FNearestRecordID: Variant; + FSavePosInfo: TcxDBDataProviderSavePosInfo; + FUpdatingPrevFocusedRecordIndex: Integer; + FUpdatingRecordIndex: Integer; + FUpdatingRecordIsInserting: Boolean; + FUpdatingNewRecordIndex: Integer; + procedure AddNewRecord(AOperation: TDataOperation); + function GetDataController: TcxDBDataController; + function GetDataSet: TDataSet; + function GetDataSource: TDataSource; + function GetIsDataSetCurrent: Boolean; + function GetIsSmartRefresh: Boolean; + procedure RemoveFromListeners; + procedure SetDataSource(Value: TDataSource); + procedure SetIsDataSetCurrent(Value: Boolean); + protected + function IsCustomDataSourceSupported: Boolean; override; + function IsGridMode: Boolean; override; + function IsDataSource: Boolean; override; + function IsKeyNavigation: Boolean; + function IsOtherInsert: Boolean; override; + function IsSyncInsert: Boolean; + function IsSyncMode: Boolean; override; + // DataSet + function DataSet_ActiveRecord: Integer; + function DataSet_BookmarkAvailable: Boolean; + function DataSet_BufferCount: Integer; + // State + function IsActive: Boolean; override; + function IsActiveDataSet: Boolean; override; + function IsBOF: Boolean; override; + function IsChanging: Boolean; override; + function IsEditing: Boolean; override; + function IsEOF: Boolean; override; + function IsGridModeUpdating: Boolean; override; + function IsInserting: Boolean; override; + function IsModified: Boolean; override; + function IsDataSetModified: Boolean; virtual; + // Navigation + function BookmarkValid(const ABookmark: TBookmarkStr): Boolean; virtual; + function CompareBookmarks(const AItem1, AItem2: TBookmarkStr): Integer; virtual; + procedure CorrectRecordIndex(ARecordIndex: Integer); override; + procedure First; override; + procedure Prev; override; + procedure Next; override; + procedure Last; override; + procedure MoveBy(ADistance: Integer); override; + procedure Scroll(ADistance: Integer); override; + procedure SavePos; override; + procedure RestorePos; override; + // Editing + function CanDelete: Boolean; override; + function CanInitEditing(ARecordIndex: Integer): Boolean; override; + function CanModify: Boolean; override; + + procedure Append; override; + procedure InternalCancel; virtual; + procedure Cancel; override; + procedure Delete; override; + procedure DeleteRecords(AList: TList); override; + procedure DeleteSelection; override; + procedure Edit; override; + function GetEditValue(ARecordIndex: Integer; AField: TcxCustomDataField; + AEditValueSource: TcxDataEditValueSource): Variant; override; + procedure Insert; override; + procedure Post; override; + procedure PostEditingData; override; + function SetEditValue(ARecordIndex: Integer; AField: TcxCustomDataField; const AValue: Variant; AEditValueSource: TcxDataEditValueSource): Boolean; override; + + procedure BeginDeleting; override; + procedure EndDeleting; override; + + procedure AssignItemValue(ARecordIndex: Integer; AField: TcxCustomDataField; const AValue: Variant); override; + procedure DoInitInsertingRecord(AInsertingRecordIndex: Integer; const AGroupValues: TcxDataSummaryValues); override; + // Notification + procedure ActiveChanged(AActive: Boolean); override; + procedure AddListener(AProvider: TcxDBDataProvider); + procedure BeginLocate; override; + procedure DataScrolled(ADistance: Integer); override; + procedure Freeze; override; + procedure LayoutChanged(ADataLayoutChanges: TcxDataLayoutChanges); override; + procedure RecordChanged(Field: TField); virtual; + procedure ResetPostLocateFlag; + procedure ResetSmartRefresh; + procedure SetPostLocateFlag; + procedure Unfreeze; override; + // Smart Refesh + procedure SmartDataChanged; + // GridMode + procedure CheckExpandedDetails; + function DoLocate(const ASubText: string; AForward, ANext: Boolean): Boolean; + function GetDataBufferCount: Integer; + function GetDataRecordCount: Integer; + function GetExternalDataDisplayText(ARecordIndex: Integer; AField: TcxCustomDataField): string; override; + function GetExternalDataValue(ARecordIndex: Integer; AField: TcxCustomDataField): Variant; override; + procedure LoadDataBuffer; override; + procedure UpdateGridMode; + // Master Detail + function GetDetailHasChildren(ARecordIndex: Integer; ARelationIndex: Integer): Boolean; override; + // Structure + function GetRecordIndex: Integer; override; + function GetValueDefReaderClass: TcxValueDefReaderClass; override; + property DataController: TcxDBDataController read GetDataController; + property DataLink: TcxDBDataLink read FDataLink; + property UpdatingRecordIndex: Integer read FUpdatingRecordIndex; + public + constructor Create(ADataController: TcxCustomDataController); override; + destructor Destroy; override; + function IsCanInitEditingBusy: Boolean; + function IsDataSetBusy: Boolean; + function IsDetailDataSetBusy: Boolean; + function IsOtherDataControllerUpdating: Boolean; + function IsOtherDetailDataSetInInsert: Boolean; + function IsOtherDetailChanged: Boolean; + function IsUniDirectional: Boolean; + property DataSet: TDataSet read GetDataSet; + property DataSource: TDataSource read GetDataSource write SetDataSource; + property IsDataSetCurrent: Boolean read GetIsDataSetCurrent write SetIsDataSetCurrent; + property IsSmartRefresh: Boolean read GetIsSmartRefresh; + end; + + TcxValueDefDBReader = class(TcxValueDefReader) + public + function GetDisplayText(AValueDef: TcxValueDef): string; override; + function GetValue(AValueDef: TcxValueDef): Variant; override; + function IsInternal(AValueDef: TcxValueDef): Boolean; override; + end; + + { TcxDBDataField } + + TcxDBDataField = class(TcxCustomDataField) + private + FField: TField; + FFieldName: string; + FFields: TList; + FIsCurrency: Boolean; + FParentField: TcxDBDataField; + function GetDataController: TcxDBDataController; + function GetField: TField; + function GetFieldItem(Index: Integer): TcxDBDataField; + function GetFieldCount: Integer; + function GetIsLookup: Boolean; + function GetProvider: TcxDBDataProvider; + procedure SetField(Value: TField); + protected + procedure AddField(ADataField: TcxDBDataField); + procedure ClearFields; + procedure DoPropertiesChanged; + procedure Reassign(ASource: TcxCustomDataField); override; + procedure RemoveField(ADataField: TcxDBDataField); + procedure RemoveNotification(AComponent: TComponent); override; + procedure SetPropertiesByField(AField: TField; AFieldChanged: Boolean); + property DataController: TcxDBDataController read GetDataController; + property Field: TField read GetField write SetField; + property FieldCount: Integer read GetFieldCount; + property FieldName: string read FFieldName write FFieldName; + property Fields[Index: Integer]: TcxDBDataField read GetFieldItem; default; + property IsCurrency: Boolean read FIsCurrency; + property IsLookup: Boolean read GetIsLookup; + property ParentField: TcxDBDataField read FParentField; + property Provider: TcxDBDataProvider read GetProvider; + public + destructor Destroy; override; + function CanModify(AEditValueSource: TcxDataEditValueSource): Boolean; override; + function IsUnbound: Boolean; override; + function IsValueDefInternal: Boolean; override; + end; + + { TcxDBDataRelation } + + TcxDBDataRelation = class(TcxCustomDataRelation) + private + FMasterKeyField: TcxDBDataField; + function GetDataController: TcxDBDataController; + function GetDetailKeyFieldNames: string; + function GetMasterKeyFieldNames: string; + protected + procedure GetMasterKeyFields(AList: TList); + function IsLinked: Boolean; virtual; + procedure RemoveDataField(ADataField: TcxCustomDataField); override; + procedure RemoveMasterKeyField; + procedure UpdateMasterDetailKeyFieldNames; + public + destructor Destroy; override; + function GetMasterRecordID(ARecordIndex: Integer): Variant; + property DataController: TcxDBDataController read GetDataController; + property DetailKeyFieldNames: string read GetDetailKeyFieldNames; + property MasterKeyFieldNames: string read GetMasterKeyFieldNames; + end; + + { DB Filter } + + TcxDBDataFilterCriteriaItem = class(TcxDataFilterCriteriaItem) + private + function GetDataController: TcxDBDataController; + function GetDBField: TcxDBDataField; + protected + function GetFilterOperatorClass: TcxFilterOperatorClass; override; + public + property DataController: TcxDBDataController read GetDataController; + property DBField: TcxDBDataField read GetDBField; + end; + + TcxDBDataFilterBeforeChangeEvent = procedure(Sender: TcxDBDataFilterCriteria; + ADataSet: TDataSet; const AFilterText: string) of object; + TcxDBDataFilterFormatFilterTextValueEvent = procedure(Sender: TcxDBDataFilterCriteria; + const AValue: Variant; var ADisplayValue: string) of object; + + TcxDBDataFilterCriteria = class(TcxDataFilterCriteria) + private + FAutoDataSetFilter: Boolean; + FIgnoreOrigin: Boolean; + FOnBeforeChange: TcxDBDataFilterBeforeChangeEvent; + FOnFormatFilterTextValue: TcxDBDataFilterFormatFilterTextValueEvent; + function GetDataController: TcxDBDataController; + procedure SetAutoDataSetFilter(Value: Boolean); + procedure SetIgnoreOrigin(Value: Boolean); + protected + procedure FormatFilterTextValue(AItem: TcxFilterCriteriaItem; const AValue: Variant; + var ADisplayValue: string); override; + function GetItemClass: TcxFilterCriteriaItemClass; override; + procedure Update; override; + public + constructor Create(ADataController: TcxCustomDataController); override; + procedure Assign(Source: TPersistent; AIgnoreItemNames: Boolean = False); override; + procedure AssignEvents(Source: TPersistent); override; + function IsAutoDataSetFilter: Boolean; + function IsFiltering: Boolean; override; + procedure RestoreDefaults; override; + property DataController: TcxDBDataController read GetDataController; + published + // TODO: add property CustomFiltering -> IsFiltering = False! + property AutoDataSetFilter: Boolean read FAutoDataSetFilter write SetAutoDataSetFilter default False; + property DateTimeFormat; + property IgnoreOrigin: Boolean read FIgnoreOrigin write SetIgnoreOrigin default True; + property TranslateBetween; + property TranslateIn; + property TranslateLike; + property SupportedLike; + property OnBeforeChange: TcxDBDataFilterBeforeChangeEvent read FOnBeforeChange write FOnBeforeChange; + property OnFormatFilterTextValue: TcxDBDataFilterFormatFilterTextValueEvent read FOnFormatFilterTextValue write FOnFormatFilterTextValue; + end; + + { DB Summary } + + TcxDBDataSummaryItem = class(TcxDataSummaryItem) + private + FDataField: TcxDBDataField; + FFieldName: string; + function GetDBDataController: TcxDBDataController; + procedure SetFieldName(const Value: string); + protected + function IsCurrency(AVarType: TVarType): Boolean; override; + public + procedure Assign(Source: TPersistent); override; + property DataController: TcxDBDataController read GetDBDataController; + function DataField: TcxCustomDataField; override; + published + property FieldName: string read FFieldName write SetFieldName; + end; + + { TcxDBDataModeController } + + TcxDBDataModeControllerDetailIsCurrentQueryEvent = function(Sender: TcxDBDataModeController; + ADataSet: TDataSet; const AMasterDetailKeyFieldNames: string; + const AMasterDetailKeyValues: Variant): Boolean of object; + + TcxDBDataModeControllerDetailFirstEvent = procedure(Sender: TcxDBDataModeController; + ADataSet: TDataSet; const AMasterDetailKeyFieldNames: string; + const AMasterDetailKeyValues: Variant; var AReopened: Boolean) of object; + + TcxDBDataModeController = class(TPersistent) + private + FDataController: TcxDBDataController; + FDetailInSQLMode: Boolean; + FDetailInSyncMode: Boolean; + FGridMode: Boolean; + FGridModeBufferCount: Integer; + FSmartRefresh: Boolean; + FSyncInsert: Boolean; + FSyncMode: Boolean; + FOnDetailFirst: TcxDBDataModeControllerDetailFirstEvent; + FOnDetailIsCurrentQuery: TcxDBDataModeControllerDetailIsCurrentQueryEvent; + procedure SetGridMode(Value: Boolean); + procedure SetGridModeBufferCount(Value: Integer); + procedure SetSmartRefresh(Value: Boolean); + procedure SetSyncMode(Value: Boolean); + protected + function DetailIsCurrentQuery(const AMasterDetailKeyFieldNames: string; const AMasterDetailKeyValues: Variant): Boolean; virtual; + procedure DoDetailFirst(const AMasterDetailKeyFieldNames: string; const AMasterDetailKeyValues: Variant; var AReopened: Boolean); virtual; + property DetailInSyncMode: Boolean read FDetailInSyncMode write FDetailInSyncMode default True; + public + constructor Create(ADataController: TcxDBDataController); + procedure Assign(Source: TPersistent); override; + property DataController: TcxDBDataController read FDataController; + property SyncInsert: Boolean read FSyncInsert write FSyncInsert default True; + published + property DetailInSQLMode: Boolean read FDetailInSQLMode write FDetailInSQLMode default False; + property GridMode: Boolean read FGridMode write SetGridMode default False; + property GridModeBufferCount: Integer read FGridModeBufferCount write SetGridModeBufferCount default 0; + property SmartRefresh: Boolean read FSmartRefresh write SetSmartRefresh default False; + property SyncMode: Boolean read FSyncMode write SetSyncMode default True; + property OnDetailFirst: TcxDBDataModeControllerDetailFirstEvent read FOnDetailFirst write FOnDetailFirst; + property OnDetailIsCurrentQuery: TcxDBDataModeControllerDetailIsCurrentQueryEvent read FOnDetailIsCurrentQuery write FOnDetailIsCurrentQuery; + end; + + { TcxDBDataSelection } + + TcxDBDataSelection = class(TcxDataSelection) + private + FAnchorBookmark: TBookmarkStr; + FBookmarks: TStrings; + FInSelectAll: Boolean; + function GetDataController: TcxDBDataController; + protected + procedure ClearAnchor; override; + function CompareBookmarks(const AItem1, AItem2: TBookmarkStr): Integer; + procedure InternalAdd(AIndex, ARowIndex, ARecordIndex, ALevel: Integer); override; + procedure InternalClear; override; + procedure InternalDelete(AIndex: Integer); override; + function FindBookmark(const ABookmark: TBookmarkStr; var AIndex: Integer): Boolean; + function GetRowBookmark(ARowIndex: Integer): TBookmarkStr; + function RefreshBookmarks: Boolean; + procedure SyncCount; + public + constructor Create(ADataController: TcxCustomDataController); override; + destructor Destroy; override; + function FindByRowIndex(ARowIndex: Integer; var AIndex: Integer): Boolean; override; + procedure SelectAll; + procedure SelectFromAnchor(AToBookmark: TBookmarkStr; AKeepSelection: Boolean); + property DataController: TcxDBDataController read GetDataController; + end; + + { TcxDBDataController } + + TcxDBDataDetailHasChildrenEvent = procedure(Sender: TcxDBDataController; + ARecordIndex, ARelationIndex: Integer; const AMasterDetailKeyFieldNames: string; + const AMasterDetailKeyValues: Variant; var HasChildren: Boolean) of object; + + TcxDBDataController = class(TcxCustomDataController) + private + FBookmark: TBookmarkStr; + FCreatedDataController: TcxCustomDataController; + FDataModeController: TcxDBDataModeController; + FDetailKeyFieldNames: string; + FInCheckBrowseMode: Boolean; + FInCheckCurrentQuery: Boolean; + FInResetDataSetCurrent: Boolean; + FInUnboundCopy: Boolean; + FInUpdateGridModeBufferCount: Boolean; + FKeyField: TcxDBDataField; + FKeyFieldNames: string; + FLoaded: Boolean; + FMasterDetailKeyFields: TList; + FMasterDetailKeyValues: Variant; + FMasterKeyFieldNames: string; + FResetDBFields: Boolean; + FUpdateDataSetPos: Boolean; + FOnDetailHasChildren: TcxDBDataDetailHasChildrenEvent; + function AddInternalDBField: TcxDBDataField; + function GetDataSet: TDataSet; + function GetDataSetRecordCount: Integer; + function GetDataSource: TDataSource; + function GetDBField(Index: Integer): TcxDBDataField; + function GetDBSelection: TcxDBDataSelection; + function GetFilter: TcxDBDataFilterCriteria; + function GetMasterDetailKeyFieldNames: string; + function GetMasterDetailKeyFields: TList; + function GetProvider: TcxDBDataProvider; + function GetRecNo: Integer; + procedure MasterDetailKeyFieldsRemoveNotification(AComponent: TComponent); + procedure RemoveKeyField; + procedure SetDataModeController(Value: TcxDBDataModeController); + procedure SetDataSource(Value: TDataSource); + procedure SetDetailKeyFieldNames(const Value: string); + procedure SetFilter(Value: TcxDBDataFilterCriteria); + procedure SetKeyFieldNames(const Value: string); + procedure SetMasterKeyFieldNames(const Value: string); + procedure SetRecNo(Value: Integer); + procedure SyncDataSetPos; + function SyncMasterDetail: TcxCustomDataController; + procedure SyncMasterDetailDataSetPos; + procedure UpdateRelationFields; + protected + function CanChangeDetailExpanding(ARecordIndex: Integer; AExpanded: Boolean): Boolean; override; + function CanFocusRecord(ARecordIndex: Integer): Boolean; override; + procedure CheckDataSetCurrent; override; + function CheckMasterBrowseMode: Boolean; override; + procedure ClearMasterDetailKeyFields; + procedure CorrectAfterDelete(ARecordIndex: Integer); override; + procedure DoDataSetCurrentChanged(AIsCurrent: Boolean); virtual; + procedure DoDataSourceChanged; virtual; + procedure DoInitInsertingRecord(AInsertingRecordIndex: Integer); virtual; + function DoSearchInGridMode(const ASubText: string; AForward, ANext: Boolean): Boolean; override; + function FindRecordIndexInGridMode(const AKeyFieldValues: Variant): Integer; + function GetActiveRecordIndex: Integer; override; + function GetDataProviderClass: TcxCustomDataProviderClass; override; + function GetDataSelectionClass: TcxDataSelectionClass; override; + function GetDefaultGridModeBufferCount: Integer; virtual; + function GetFieldClass: TcxCustomDataFieldClass; override; + function GetFilterCriteriaClass: TcxDataFilterCriteriaClass; override; + procedure GetKeyFields(AList: TList); override; + function GetRelationClass: TcxCustomDataRelationClass; override; + function GetSummaryItemClass: TcxDataSummaryItemClass; override; + function InternalCheckBookmark(ADeletedRecordIndex: Integer): Boolean; override; + procedure InternalClearBookmark; override; + procedure InternalGotoBookmark; override; + function InternalSaveBookmark: Boolean; override; + procedure InvalidateDataBuffer; virtual; + function IsDataField(AField: TcxCustomDataField): Boolean; override; + function IsKeyNavigation: Boolean; override; + function IsOtherDetailChanged: Boolean; + function IsOtherDetailCreating: Boolean; + function IsProviderDataSource: Boolean; override; + function IsSmartRefresh: Boolean; override; + procedure LoadStorage; override; + function LocateRecordIndex(AGetFieldsProc: TGetListProc): Integer; virtual; + function LockOnAfterSummary: Boolean; override; + procedure NotifyDataControllers; override; + procedure NotifyDetailAfterFieldsRecreating(ADataController: TcxCustomDataController); + procedure NotifyDetailsAfterFieldsRecreating(ACreatingLinkObject: Boolean); + procedure PrepareField(AField: TcxCustomDataField); override; + procedure RemoveNotification(AComponent: TComponent); override; + procedure ResetDataSetCurrent(ADataController: TcxCustomDataController); + procedure ResetDBFields; + procedure RestructData; override; + procedure ResyncDBFields; + procedure RetrieveField(ADataField: TcxDBDataField; AIsLookupKeyOnly: Boolean); + function TryFocusRecord(ARecordIndex: Integer): Boolean; virtual; + procedure UpdateEditingRecord; + procedure UpdateField(ADataField: TcxDBDataField; const AFieldNames: string; AIsLookup: Boolean); + procedure UpdateFields; override; + procedure UpdateFocused; override; + procedure UpdateInternalKeyFields(const AFieldNames: string; var AField: TcxDBDataField); + procedure UpdateLookupFields; + procedure UpdateRelations(ARelation: TcxCustomDataRelation); override; + procedure UpdateScrollBars; virtual; + // Locate + procedure BeginReadRecord; override; + procedure EndReadRecord; override; + + property DBFields[Index: Integer]: TcxDBDataField read GetDBField; + property DBSelection: TcxDBDataSelection read GetDBSelection; + property KeyField: TcxDBDataField read FKeyField; + property MasterDetailKeyFieldNames: string read GetMasterDetailKeyFieldNames; + property MasterDetailKeyFields: TList read GetMasterDetailKeyFields; + property MasterDetailKeyValues: Variant read FMasterDetailKeyValues; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + // Actions + function ExecuteAction(Action: TBasicAction): Boolean; override; + function UpdateAction(Action: TBasicAction): Boolean; override; + // Structure + procedure ChangeFieldName(AItemIndex: Integer; const AFieldName: string); + procedure ChangeValueTypeClass(AItemIndex: Integer; AValueTypeClass: TcxValueTypeClass); override; + function GetItemByFieldName(const AFieldName: string): TObject; + function GetItemField(AItemIndex: Integer): TField; + function GetItemFieldName(AItemIndex: Integer): string; + function IsDisplayFormatDefined(AItemIndex: Integer; AIgnoreSimpleCurrency: Boolean): Boolean; override; + procedure Loaded; override; + // Data + procedure BeginLocate; + procedure EndLocate; + procedure DoUpdateRecord(ARecordIndex: Integer); + function GetGroupValue(ARecordIndex: Integer; AField: TcxCustomDataField): Variant; override; + procedure GetKeyDBFields(AList: TList); + function GetKeyFieldsValues: Variant; + function GetRecordId(ARecordIndex: Integer): Variant; override; + procedure UpdateGridModeBufferCount; + // Data Editing + procedure CheckBrowseMode; override; + function DataChangedNotifyLocked: Boolean; override; + procedure RefreshExternalData; override; + // Navigation + procedure SetFocus; override; + // Bookmark + function IsBookmarkAvailable: Boolean; override; + function IsBookmarkRow(ARowIndex: Integer): Boolean; override; + // Filter + function GetFilterDataValue(ARecordIndex: Integer; AField: TcxCustomDataField): Variant; override; + function GetFilterItemFieldName(AItem: TObject): string; override; + // Search + function FindRecordIndexByKey(const AKeyFieldValues: Variant): Integer; + function LocateByKey(const AKeyFieldValues: Variant): Boolean; + // Master-Detail + procedure CheckCurrentQuery; + function GetDetailFilterAdapter: TcxDBProviderDetailFilterAdapter; virtual; + procedure SetMasterRelation(AMasterRelation: TcxCustomDataRelation; AMasterRecordIndex: Integer); override; + // MultiSelect in GridMode + function GetRowId(ARowIndex: Integer): Variant; override; + function GetSelectedBookmark(Index: Integer): TBookmarkStr; + function GetSelectedRowIndex(Index: Integer): Integer; override; + function GetSelectionAnchorBookmark: TBookmarkStr; + function GetSelectionAnchorRowIndex: Integer; override; + function IsSelectionAnchorExist: Boolean; override; + procedure SelectAll; override; + procedure SelectFromAnchor(ARowIndex: Integer; AKeepSelection: Boolean); override; + procedure SetSelectionAnchor(ARowIndex: Integer); override; + // Export + function FocusSelectedRow(ASelectedIndex: Integer): Boolean; override; + // View Data + procedure ForEachRow(ASelectedRows: Boolean; AProc: TcxDataControllerEachRowProc); override; + function IsSequenced: Boolean; + + property DataModeController: TcxDBDataModeController read FDataModeController write SetDataModeController; + property DataSet: TDataSet read GetDataSet; + property DataSource: TDataSource read GetDataSource write SetDataSource; + property DetailKeyFieldNames: string read FDetailKeyFieldNames write SetDetailKeyFieldNames; + property Filter: TcxDBDataFilterCriteria read GetFilter write SetFilter; + property KeyFieldNames: string read FKeyFieldNames write SetKeyFieldNames; + property MasterKeyFieldNames: string read FMasterKeyFieldNames write SetMasterKeyFieldNames; + property Provider: TcxDBDataProvider read GetProvider; + property RecNo: Integer read GetRecNo write SetRecNo; // Sequenced + property DataSetRecordCount: Integer read GetDataSetRecordCount; // Sequenced + property OnDetailHasChildren: TcxDBDataDetailHasChildrenEvent read FOnDetailHasChildren write FOnDetailHasChildren; + end; + +var + cxDetailFilterControllers: TcxDBAdapterList; + +function CanCallDataSetLocate(ADataSet: TDataSet; const AKeyFieldNames: string; + const AValue: Variant): Boolean; +function GetValueTypeClassByField(AField: TField): TcxValueTypeClass; + +implementation + +uses + {$IFDEF DELPHI9}Windows, {$ENDIF} + TypInfo, Contnrs, cxDataConsts + ; + +type + TDataSetAccess = class(TDataSet); + +var + DBDataProviders: TList; + +procedure GetInternalKeyFields(ADataField: TcxDBDataField; AList: TList); +var + I: Integer; +begin + if Assigned(ADataField) then + begin + if ADataField.FieldCount = 0 then + AList.Add(ADataField) + else + for I := 0 to ADataField.FieldCount - 1 do + AList.Add(ADataField.Fields[I]); + end; +end; + +function CanCallDataSetLocate(ADataSet: TDataSet; const AKeyFieldNames: string; + const AValue: Variant): Boolean; + + function TryGetFieldList(ADataSet: TDataSet; + const AFieldNames: WideString; AList: TList): Boolean; + var + AField: TField; + APos: Integer; + begin + Result := True; + APos := 1; + while APos <= Length(AFieldNames) do + begin + AField := ADataSet.FindField(ExtractFieldName(AFieldNames, APos)); + Result := AField <> nil; + if not Result then + Break; + AList.Add(AField); + end; + end; + + function IsNullValidToLocate(AField: TField): Boolean; + begin + Result := not (AField is TAutoIncField); + end; + +var + AArrayLowBound, I: Integer; + AField: TField; + AFieldList: TObjectList; +begin + if VarIsArray(AValue) then + begin + AFieldList := TObjectList.Create(False); + try + AArrayLowBound := VarArrayLowBound(AValue, 1); + Result := TryGetFieldList(ADataSet, AKeyFieldNames, AFieldList) and + (AFieldList.Count = VarArrayHighBound(AValue, 1) - AArrayLowBound + 1); + if Result then + for I := 0 to AFieldList.Count - 1 do + begin + Result := not VarIsNull(AValue[I + AArrayLowBound]) or + IsNullValidToLocate(TField(AFieldList[I])); + if not Result then + Break; + end; + finally + AFieldList.Free; + end; + end + else + begin + AField := nil; + if Pos(';', AKeyFieldNames) = 0 then + AField := ADataSet.FindField(AKeyFieldNames); + Result := (AField <> nil) and (not VarIsNull(AValue) or + IsNullValidToLocate(AField)); + end; +end; + +function GetValueTypeClassByField(AField: TField): TcxValueTypeClass; +begin + if AField = nil then + Result := TcxStringValueType + else + begin + case AField.DataType of + ftString: + Result := TcxStringValueType; + ftWideString: + Result := TcxWideStringValueType; + ftSmallint: + Result := TcxSmallintValueType; + ftInteger, ftAutoInc: + Result := TcxIntegerValueType; + ftWord: + Result := TcxWordValueType; + ftBoolean: + Result := TcxBooleanValueType; + ftCurrency, ftFloat: + Result := TcxFloatValueType; + {ftCurrency, }ftBCD: + Result := TcxCurrencyValueType; + ftDate, ftTime, ftDateTime: + Result := TcxDateTimeValueType; + {$IFDEF DELPHI6} + ftFMTBcd: + Result := TcxFMTBcdValueType; + ftLargeint: + Result := TcxLargeIntValueType; + ftTimeStamp: + Result := TcxSQLTimeStampValueType; + {$ENDIF} + else + Result := TcxVariantValueType; + end; + end; +end; + +{$IFNDEF DELPHI5} + +function IsPublishedProp(Instance: TObject; const PropName: string): Boolean; +begin + Result := GetPropInfo(Instance.ClassInfo, PropName) <> nil; +end; + +function GetObjectProp(Instance: TObject; const PropName: string): TObject; +var + PropInfo: PPropInfo; +begin + Result := nil; + PropInfo := TypInfo.GetPropInfo(Instance.ClassInfo, PropName); + if (PropInfo <> nil) and (PropInfo^.PropType^.Kind = tkClass) then + Result := TObject(GetOrdProp(Instance, PropInfo)); +end; + +{$ENDIF} + +{ TcxDBProviderDetailFilterAdapter } + +function TcxDBProviderDetailFilterAdapter.IsCurrentQuery(ADataSet: TDataSet; + const AParamNames: string; const AParamValues: Variant): Boolean; +var + AParams: TParams; +begin + Result := False; + if IsPublishedProp(ADataSet, 'Params') then + begin + AParams := GetObjectProp(ADataSet, 'Params') as TParams; + if AParams <> nil then + begin + if VarEquals(AParams.ParamValues[AParamNames], AParamValues) then + Result := True; + end; + end; +end; + +procedure TcxDBProviderDetailFilterAdapter.ReopenSQL(ADataSet: TDataSet; + const AParamNames: string; const AParamValues: Variant; var AReopened: Boolean); +var + AParams: TParams; +begin + if IsPublishedProp(ADataSet, 'Params') then + begin + AParams := GetObjectProp(ADataSet, 'Params') as TParams; + if AParams <> nil then + begin + if VarEquals(AParams.ParamValues[AParamNames], AParamValues) then + ADataSet.First // TODO: Update method - for Query with Post + else + begin + ADataSet.DisableControls; + try + ADataSet.Active := False; + AParams.ParamValues[AParamNames] := AParamValues; + ADataSet.Active := True; + finally + ADataSet.EnableControls; + end; + AReopened := True; // set Flag if Query reopened + end; + end; + end; +end; + +procedure TcxDBProviderDetailFilterAdapter.SetFilter(ADataSet: TDataSet; + const AMasterDetailKeyFieldNames: string; const AMasterDetailKeyValues: Variant; + AIsSQLMode: Boolean; var AReopened: Boolean); +begin + if AIsSQLMode then + ReopenSQL(ADataSet, AMasterDetailKeyFieldNames, AMasterDetailKeyValues, AReopened) + else + ADataSet.Locate(AMasterDetailKeyFieldNames, AMasterDetailKeyValues, []); // must be sort by Detail Keys +end; + +{ TcxDBDataModeController } + +constructor TcxDBDataModeController.Create(ADataController: TcxDBDataController); +begin + inherited Create; + FDetailInSyncMode := True; + FDataController := ADataController; + FGridModeBufferCount := 0; + FSyncInsert := True; + FSyncMode := True; +end; + +procedure TcxDBDataModeController.Assign(Source: TPersistent); +begin + if Source is TcxDBDataModeController then + begin + DetailInSQLMode := TcxDBDataModeController(Source).DetailInSQLMode; + DetailInSyncMode := TcxDBDataModeController(Source).DetailInSyncMode; + GridMode := TcxDBDataModeController(Source).GridMode; + GridModeBufferCount := TcxDBDataModeController(Source).GridModeBufferCount; + SmartRefresh := TcxDBDataModeController(Source).SmartRefresh; + SyncInsert := TcxDBDataModeController(Source).SyncInsert; + SyncMode := TcxDBDataModeController(Source).SyncMode; + OnDetailFirst := TcxDBDataModeController(Source).OnDetailFirst; + OnDetailIsCurrentQuery := TcxDBDataModeController(Source).OnDetailIsCurrentQuery; + end + else + inherited Assign(Source); +end; + +function TcxDBDataModeController.DetailIsCurrentQuery(const AMasterDetailKeyFieldNames: string; + const AMasterDetailKeyValues: Variant): Boolean; +var + ADetailFilterAdapter: TcxDBProviderDetailFilterAdapter; +begin + if Assigned(FOnDetailIsCurrentQuery) then + Result := FOnDetailIsCurrentQuery(Self, DataController.DataSet, + AMasterDetailKeyFieldNames, AMasterDetailKeyValues) + else + begin + ADetailFilterAdapter := DataController.GetDetailFilterAdapter; + Result := ADetailFilterAdapter.IsCurrentQuery(DataController.DataSet, + AMasterDetailKeyFieldNames, AMasterDetailKeyValues); + end; +end; + +procedure TcxDBDataModeController.DoDetailFirst(const AMasterDetailKeyFieldNames: string; + const AMasterDetailKeyValues: Variant; var AReopened: Boolean); +var + ADetailFilterAdapter: TcxDBProviderDetailFilterAdapter; +begin + AReopened := False; + if Assigned(FOnDetailFirst) then + FOnDetailFirst(Self, DataController.DataSet, AMasterDetailKeyFieldNames, + AMasterDetailKeyValues, AReopened) + else + begin + ADetailFilterAdapter := DataController.GetDetailFilterAdapter; + ADetailFilterAdapter.SetFilter(DataController.DataSet, AMasterDetailKeyFieldNames, + AMasterDetailKeyValues, DetailInSQLMode, AReopened); + end; +end; + +procedure TcxDBDataModeController.SetGridMode(Value: Boolean); +var + APrevGridMode: Boolean; +begin + APrevGridMode := DataController.IsGridMode; + if FGridMode <> Value then + begin + FGridMode := Value; + if DataController.IsGridMode <> APrevGridMode then + DataController.RestructData; + end; +end; + +procedure TcxDBDataModeController.SetGridModeBufferCount(Value: Integer); +begin + if Value < 0 then Value := 0; + if FGridModeBufferCount <> Value then + begin + FGridModeBufferCount := Value; + DataController.UpdateGridModeBufferCount; + end; +end; + +procedure TcxDBDataModeController.SetSmartRefresh(Value: Boolean); +begin + if FSmartRefresh <> Value then + begin + FSmartRefresh := Value; + if not DataController.Provider.IsGridMode then + DataController.Provider.DataScrolled(0); + end; +end; + +procedure TcxDBDataModeController.SetSyncMode(Value: Boolean); +begin + if FSyncMode <> Value then + begin + FSyncMode := Value; + if DataController.Provider.IsActive then + DataController.Provider.DataScrolled(0); + end; +end; + +{ TcxDBDataSelection } + +constructor TcxDBDataSelection.Create(ADataController: TcxCustomDataController); +begin + inherited Create(ADataController); + FBookmarks := TStringList.Create; +end; + +destructor TcxDBDataSelection.Destroy; +begin + FBookmarks.Free; + FBookmarks := nil; + inherited Destroy; +end; + +function TcxDBDataSelection.FindByRowIndex(ARowIndex: Integer; var AIndex: Integer): Boolean; +begin + if DataController.IsGridMode then + Result := FindBookmark(GetRowBookmark(ARowIndex), AIndex) + else + Result := inherited FindByRowIndex(ARowIndex, AIndex); +end; + +procedure TcxDBDataSelection.SelectAll; +begin + if DataController.IsGridMode and Assigned(DataController.DataSet) then + begin + with DataController.Provider do + begin + Freeze; + try + SavePos; + First; + InternalClear; + try + while not IsEOF do + begin + if DataController.CanSelectRow(-1) then + FBookmarks.Add(DataSet.Bookmark); + Next; + end; + SyncCount; + except + FBookmarks.Clear; + SyncCount; + raise; + end; + RestorePos; + finally + Unfreeze; + Changed; + DataController.DataControllerInfo.CheckChanges; + DataController.SyncMasterPos; + end; + end; + end; +end; + +procedure TcxDBDataSelection.SelectFromAnchor(AToBookmark: TBookmarkStr; AKeepSelection: Boolean); + + function CheckBookmarks(const ABkm1, ABkm2: TBookmarkStr; ADirectionDown: Boolean): Boolean; + begin + Result := False; + if AKeepSelection or (FBookmarks.Count = 0) then Exit; + with DataController.Provider do + begin + if CompareBookmarks(ABkm1, ABkm2) = 0 then + begin + FBookmarks.Clear; + if DataController.CanSelectRow(-1) then + FBookmarks.Add(ABkm1); + Result := True; + end + else + if ADirectionDown then + begin + if (FBookmarks.Count > 1) and + (CompareBookmarks(FBookmarks[FBookmarks.Count - 2], ABkm2) = 0) then // dec last + begin + if CompareBookmarks(FBookmarks[0], ABkm1) = 0 then + begin + FBookmarks.Delete(FBookmarks.Count - 1); + Result := True; + end; + end + else + begin + DataSet.Bookmark := ABkm2; + DataSet.Prior; + if CompareBookmarks(FBookmarks[FBookmarks.Count - 1], DataSet.Bookmark) = 0 then // inc + begin + if CompareBookmarks(FBookmarks[0], ABkm1) = 0 then + begin + DataSet.Bookmark := ABkm2; // for OnCanSelectRow event + if DataController.CanSelectRow(-1) then + FBookmarks.Add(ABkm2); + Result := True; + end; + end; + end; + end + else + begin + if (FBookmarks.Count > 1) and + (CompareBookmarks(FBookmarks[1], ABkm1) = 0) then // dec top + begin + if CompareBookmarks(FBookmarks[FBookmarks.Count - 1], ABkm2) = 0 then + begin + FBookmarks.Delete(0); + Result := True; + end; + end + else + begin + DataSet.Bookmark := ABkm1; + DataSet.Next; + if CompareBookmarks(FBookmarks[0], DataSet.Bookmark) = 0 then // inc + begin + if CompareBookmarks(FBookmarks[FBookmarks.Count - 1], ABkm2) = 0 then + begin + DataSet.Bookmark := ABkm1; // for OnCanSelectRow event + if DataController.CanSelectRow(-1) then + FBookmarks.Insert(0, ABkm1); + Result := True; + end; + end; + end; + end; + end; + end; + + procedure LoadBookmarks(const ABkm1, ABkm2: TBookmarkStr); + var + ABkm: TBookmarkStr; + ACheckNeeded, AFound: Boolean; + I, C, AIndex1, AIndex2: Integer; + begin + with DataController.Provider do + begin + if not AKeepSelection then + FBookmarks.Clear; + try + ACheckNeeded := FBookmarks.Count > 0; + if ACheckNeeded then + begin + FindBookmark(ABkm1, AIndex1); + FindBookmark(ABkm2, AIndex2); + if AIndex1 = FBookmarks.Count then + ACheckNeeded := False; + end; + DataSet.Bookmark := ABkm1; + while not IsEOF do + begin + ABkm := DataSet.Bookmark; + if ACheckNeeded then + begin + AFound := False; + for I := AIndex1 to AIndex2 do + begin + if I >= FBookmarks.Count then + Break; + C := CompareBookmarks(ABkm, FBookmarks[I]); + if C < 0 then + begin + if DataController.CanSelectRow(-1) then + FBookmarks.Insert(I, ABkm); + Inc(AIndex1); + Inc(AIndex2); + AFound := True; + Break; + end + else + if C = 0 then + begin + Inc(AIndex1); + AFound := True; + Break; + end; + end; + if not AFound then + begin + if DataController.CanSelectRow(-1) then + FBookmarks.Add(ABkm); + end; + end + else + begin + if DataController.CanSelectRow(-1) then + FBookmarks.Add(ABkm); + end; + if CompareBookmarks(ABkm, ABkm2) = 0 then + Break; + Next; + end; + except + FBookmarks.Clear; + SyncCount; + raise; + end; + end; + end; + +var + ABkm1, ABkm2: TBookmarkStr; + ADirectionDown: Boolean; +begin + // TODO: optimize - Do Selection (up/down) + if DataController.IsGridMode and Assigned(DataController.DataSet) then + begin + with DataController.Provider do + begin + if (DataSet.State = dsInsert) and DataSet.Eof then + Exit; + Freeze; + try + SavePos; + ABkm1 := FAnchorBookmark; + ABkm2 := AToBookmark; + ADirectionDown := CompareBookmarks(ABkm1, ABkm2) < 0; + if not ADirectionDown then + begin + ABkm2 := FAnchorBookmark; + ABkm1 := AToBookmark; + end; + // check - select shift + up/down + if not CheckBookmarks(ABkm1, ABkm2, ADirectionDown) then + LoadBookmarks(ABkm1, ABkm2); + SyncCount; + RestorePos; + finally + Unfreeze; + Changed; + DataController.DataControllerInfo.CheckChanges; + DataController.SyncMasterPos; + end; + end; + end; +end; + +procedure TcxDBDataSelection.ClearAnchor; +begin + inherited ClearAnchor; + FAnchorBookmark := ''; +end; + +function TcxDBDataSelection.CompareBookmarks(const AItem1, AItem2: TBookmarkStr): Integer; +begin + Result := DataController.Provider.CompareBookmarks(AItem1, AItem2); +end; + +procedure TcxDBDataSelection.InternalAdd(AIndex, ARowIndex, ARecordIndex, ALevel: Integer); +begin + inherited InternalAdd(AIndex, ARowIndex, ARecordIndex, ALevel); + if not DataController.IsGridMode or FInSelectAll then Exit; + FBookmarks.Insert(AIndex, GetRowBookmark(ARowIndex)); +end; + +procedure TcxDBDataSelection.InternalClear; +begin + inherited InternalClear; + if FBookmarks <> nil then + FBookmarks.Clear; +end; + +procedure TcxDBDataSelection.InternalDelete(AIndex: Integer); +begin + inherited InternalDelete(AIndex); + if not DataController.IsGridMode or FInSelectAll then Exit; + if CompareBookmarks(FBookmarks[AIndex], FAnchorBookmark) = 0 then + ClearAnchor; + FBookmarks.Delete(AIndex); +end; + +function TcxDBDataSelection.FindBookmark(const ABookmark: TBookmarkStr; var AIndex: Integer): Boolean; +var + L, H, I, C: Integer; +begin + AIndex := 0; + Result := False; + L := 0; + H := FBookmarks.Count - 1; + if L <= H then + repeat + I := (L + H) div 2; + C := CompareBookmarks(FBookmarks[I], ABookmark); + if C = 0 then + begin + AIndex := I; + Result := True; + Break; + end + else + if C < 0 then + L := I + 1 + else + H := I - 1; + if L > H then + begin + AIndex := L; + Break; + end; + until False; +end; + +function TcxDBDataSelection.GetRowBookmark(ARowIndex: Integer): TBookmarkStr; +var + APrevActiveRecord: Integer; +begin + Result := ''; + if not DataController.IsGridMode then Exit; + APrevActiveRecord := DataController.Provider.DataLink.ActiveRecord; + try + DataController.Provider.DataLink.ActiveRecord := ARowIndex; + Result := DataController.DataSet.Bookmark; + finally + DataController.Provider.DataLink.ActiveRecord := APrevActiveRecord; + end; +end; + +function TcxDBDataSelection.RefreshBookmarks: Boolean; +var + I: Integer; + ADataSet: TDataSet; +begin + Result := False; + if not DataController.IsGridMode then Exit; + ADataSet := DataController.DataSet; + if Assigned(ADataSet) then + for I := Count - 1 downto 0 do + begin + if (FBookmarks[I] = '') or + not DataController.Provider.BookmarkValid(FBookmarks[I]) then + begin + Result := True; + Delete(I); + end; + end; +end; + +procedure TcxDBDataSelection.SyncCount; +begin + FInSelectAll := True; + try + SetInternalCount(FBookmarks.Count); + finally + FInSelectAll := False; + end; +end; + +function TcxDBDataSelection.GetDataController: TcxDBDataController; +begin + Result := inherited DataController as TcxDBDataController; +end; + +{ TcxDBDataLink } + +constructor TcxDBDataLink.Create(AProvider: TcxDBDataProvider); +begin + inherited Create; + FProvider := AProvider; + VisualControl := True; +end; + +procedure TcxDBDataLink.ActiveChanged; +begin + Provider.ActiveChanging := True; + try + Provider.ActiveChanged(Active); + if Provider.DataController.IsLoading then + Provider.DataController.FLoaded := True; + finally + Provider.ActiveChanging := False; + end; + Provider.FInSetDataSource := Assigned(DataSet) and (DataSet.State = dsInsert); +{$IFDEF DELPHI7} + if not Active then + FLayoutChangedFlag := False; +{$ENDIF} +end; + +{$IFDEF DELPHI7} +procedure TcxDBDataLink.DataEvent(Event: TDataEvent; + Info: Integer); +begin + inherited DataEvent(Event, Info); + if (Event = deDisabledStateChange) and not Boolean(Info) then + FLayoutChangedFlag := True; +end; +{$ENDIF} + +procedure TcxDBDataLink.DataSetChanged; +begin + {$IFDEF DELPHI7} + if FLayoutChangedFlag then + begin + LayoutChanged; + Exit; + end; + {$ENDIF} + if Provider.IsOtherDataControllerUpdating then Exit; + if Provider.IsOtherDetailChanged then Exit; +{ + if Provider.IsGridMode and Provider.DataController.IsDetailMode and + not VarEquals(GetDataSetValues(DataSet, Provider.DataController.MasterDetailKeyFields), + Provider.DataController.MasterDetailKeyValues) then + Exit; +} + if Provider.IsDataSetBusy then + DataSetScrolled(0) + else + begin + if Provider.IsGridMode then + begin + Provider.FInUpdateGridMode := True; + try + Provider.DataController.BeginFullUpdate; + try + Provider.UpdateGridMode; + if Provider.DataController.MultiSelect then + Provider.DataController.DBSelection.RefreshBookmarks; + Provider.DataController.CheckBookmarkValid(-1); + if DataSet.State = dsInsert then + DoInsertingRecord; + finally + Provider.DataController.EndFullUpdate; + end; + Provider.CheckExpandedDetails; + finally + Provider.FInUpdateGridMode := False; + end; +// if DataSet.State = dsInsert then +// Provider.InsertingRecord(Provider.IsEOF); + end + else + begin + if not (DataSet.State in dsEditModes) then + begin + if Provider.IsSmartRefresh then + begin + Provider.SmartDataChanged; + DataSetScrolled(0); + end + else + begin + Provider.DataChanged(dcTotal, -1, -1); + DataSetScrolled(0); // AB16340 (alternative: Provider.DataController.UpdateFocused;) + end; + Provider.ResetSmartRefresh; + end + else + if (DataSet.State = dsInsert) and not Provider.FInserting then + begin + if (not Provider.DataController.IsDetailMode or Provider.IsDataSetCurrent) and + Provider.IsSyncInsert and not Provider.FInInserting then + DoInsertingRecord; + end; + end; + end; +end; + +procedure TcxDBDataLink.DataSetScrolled(Distance: Integer); +begin + Provider.DataScrolled(Distance); +end; + +procedure TcxDBDataLink.EditingChanged; +begin + if not Provider.IsSyncMode then Exit; + if not Active or not (DataSet.State in dsEditModes) then + begin + if {not Provider.IsGridMode and} Provider.IsSmartRefresh and + (Provider.EditingRecordIndex <> cxNullEditingRecordIndex) and + (Provider.EditingRecordIndex = Provider.DataController.NewItemRecordIndex) then + begin + if Provider.FUpdatingRecordIsInserting then + begin + Provider.DataController.FInUnboundCopy := True; // !!! + try + Provider.FUpdatingNewRecordIndex := Provider.DataController.AppendRecord; + Provider.DataController.CopyRecord(Provider.DataController.NewItemRecordIndex, + Provider.FUpdatingNewRecordIndex); + finally + Provider.DataController.FInUnboundCopy := False; + end; + end; + end; + Provider.ResetEditing; + end + else + begin + if DataSet.State = dsEdit then + begin + Provider.DataController.FInUnboundCopy := TRue; + try + Provider.EditingRecord; + finally + Provider.DataController.FInUnboundCopy := False; + end; + end + else + if (DataSet.State = dsInsert) and not DataSet.ControlsDisabled and + (Provider.FInSetDataSource or Provider.DataController.FInUpdateGridModeBufferCount) then + begin + if Provider.IsGridMode and not Provider.FInInsert then + DoInsertingRecord; + end; + end; + Provider.FInSetDataSource := False; +end; + +procedure TcxDBDataLink.FocusControl(Field: TFieldRef); + + function FindItemIndex(AField: TField): Integer; + var + I: Integer; + ADataField: TcxDBDataField; + begin + Result := -1; + for I := 0 to Provider.DataController.Fields.Count - 1 do + begin + ADataField := Provider.DataController.DBFields[I]; + if not ADataField.IsInternal and (ADataField.Field = AField) then + begin + Result := I; + Break; + end; + end; + end; + +var + ADone: Boolean; + AItemIndex: Integer; +begin + if Assigned(Field) and Assigned(Field^) then + begin + ADone := False; + AItemIndex := FindItemIndex(Field^); + if (AItemIndex <> -1) and (AItemIndex < Provider.DataController.GetItemCount) then + begin + Provider.DataController.FocusControl(AItemIndex, ADone); + if ADone then + Field^ := nil; + end; + end; +end; + +procedure TcxDBDataLink.LayoutChanged; +begin + {$IFDEF DELPHI7} // bug in Delphi 7 with update pack 1 + if (DataSet.State = dsInsert) or + (Provider.IsSmartRefresh and FPreventLayoutChanged) then + begin + DataSetChanged; + Exit; + end; + {$ENDIF} + Provider.LayoutChanged([lcStructure, lcData]); + {$IFDEF DELPHI7} + FLayoutChangedFlag := False; + {$ENDIF} +end; + +procedure TcxDBDataLink.RecordChanged(Field: TField); +begin + Provider.RecordChanged(Field); +end; + +procedure TcxDBDataLink.UpdateData; +begin + Provider.DoUpdateData; + // A2136!!! +// if Provider.IsSmartRefresh then + RecordChanged(nil); + Provider.ResetChanging; +end; + +procedure TcxDBDataLink.DoInsertingRecord; +begin + Provider.FInInserting := True; + try + Provider.InsertingRecord(Provider.IsEOF and not Provider.FInsertOperation); + finally + Provider.FInInserting := False; + end; +end; + +{ TcxDBDataAssignedFieldNames } + +constructor TcxDBDataAssignedFields.Create; +begin + inherited; + FFields := TList.Create; +end; + +destructor TcxDBDataAssignedFields.Destroy; +begin + FFields.Free; + FFields := nil; + inherited Destroy; +end; + +procedure TcxDBDataAssignedFields.AddField(AField: TField); +begin + if FFields.IndexOf(AField) = -1 then + FFields.Add(AField); +end; + +procedure TcxDBDataAssignedFields.AddFieldsByFieldList(AFieldList: TList); +var + I: Integer; +begin + for I := 0 to AFieldList.Count - 1 do + if AFieldList[I] <> nil then + FFields.Add(AFieldList[I]); +end; + +procedure TcxDBDataAssignedFields.AddFieldsByFieldNames(ADataSet: TDataSet; const AFieldNames: string); +begin + ADataSet.GetFieldList(FFields, AFieldNames); +end; + +procedure TcxDBDataAssignedFields.Clear; +begin + FFields.Clear; +end; + +function TcxDBDataAssignedFields.IsEmpty: Boolean; +begin + Result := FFields.Count = 0; +end; + +function TcxDBDataAssignedFields.IsFieldExists(AField: TField): Boolean; +begin + Result := FFields.IndexOf(AField) <> -1; +end; + +{ TcxDBDataProvider } + +constructor TcxDBDataProvider.Create(ADataController: TcxCustomDataController); +begin + inherited Create(ADataController); + FAssignedFields := TcxDBDataAssignedFields.Create; + if DBDataProviders = nil then + DBDataProviders := TList.Create; + DBDataProviders.Add(Self); + FDataLink := TcxDBDataLink.Create(Self); + FUpdatingRecordIndex := cxNullEditingRecordIndex; + FUpdatingNewRecordIndex := -1; + FListeners := TList.Create; +end; + +destructor TcxDBDataProvider.Destroy; +begin + RemoveFromListeners; + FListeners.Free; + FListeners := nil; + FDataLink.Free; + FDataLink := nil; + DBDataProviders.Remove(Self); + if DBDataProviders.Count = 0 then + begin + DBDataProviders.Free; + DBDataProviders := nil; + end; + FAssignedFields.Free; + FAssignedFields := nil; + inherited Destroy; +end; + +function TcxDBDataProvider.IsCanInitEditingBusy: Boolean; +var + I: Integer; + ADBDataProvider: TcxDBDataProvider; +begin + Result := False; + for I := 0 to DBDataProviders.Count - 1 do + begin + ADBDataProvider := TcxDBDataProvider(DBDataProviders[I]); + if (ADBDataProvider.DataSet = Self.DataSet) and + ADBDataProvider.FInCanInitEditing then + begin + Result := True; + Break; + end; + end; +end; + +function TcxDBDataProvider.IsDataSetBusy: Boolean; +var + I: Integer; + ADBDataProvider: TcxDBDataProvider; +begin + Result := False; + for I := 0 to DBDataProviders.Count - 1 do + begin + ADBDataProvider := TcxDBDataProvider(DBDataProviders[I]); + if {(ADBDataProvider <> Self) and} + (ADBDataProvider.DataSet = Self.DataSet) and + ((ADBDataProvider.LockCount <> 0) or ADBDataProvider.FInNotify or + ((Self.IsKeyNavigation or Self.DataController.IsGridMode) and (ADBDataProvider.LocateCount <> 0))) then + begin + if ADBDataProvider.FInNotify then + begin + if not FPostLocateFlag then + Result := True; + end + else + if not FPostLocateFlag then + begin + Result := True; + if Self.DataController.IsGridMode and (Self.DataController.LockGridModeNotifyCount <> 0) then + Result := False; + end; + Break; + end; + end; +end; + +function TcxDBDataProvider.IsDetailDataSetBusy: Boolean; +var + I: Integer; + ADBDataProvider: TcxDBDataProvider; +begin + Result := False; + for I := 0 to DBDataProviders.Count - 1 do + begin + ADBDataProvider := TcxDBDataProvider(DBDataProviders[I]); + if (ADBDataProvider.DataSet = Self.DataSet) and + ((ADBDataProvider.LockCount <> 0){ or ADBDataProvider.FInFirst}) and + ADBDataProvider.DataController.IsDetailMode {ADBDataProvider.FInFirst} then + begin + Result := True; + Break; + end; + end; +end; + +function TcxDBDataProvider.IsOtherDataControllerUpdating: Boolean; +var + I: Integer; + ADBDataProvider: TcxDBDataProvider; +begin + Result := False; + for I := 0 to DBDataProviders.Count - 1 do + begin + ADBDataProvider := TcxDBDataProvider(DBDataProviders[I]); + if (ADBDataProvider <> Self) and + (ADBDataProvider.DataSet = Self.DataSet) and + ((ADBDataProvider.LockCount <> 0) or + (Self.IsKeyNavigation and (ADBDataProvider.LocateCount <> 0))) then + begin + if ADBDataProvider.DataController.LockGridModeNotifyCount = 0 then + ADBDataProvider.AddListener(Self); + Result := True; + Break; + end; + end; +end; + +function TcxDBDataProvider.IsOtherDetailDataSetInInsert: Boolean; +var + I: Integer; + ADBDataProvider: TcxDBDataProvider; +begin + Result := False; + for I := 0 to DBDataProviders.Count - 1 do + begin + ADBDataProvider := TcxDBDataProvider(DBDataProviders[I]); + if (ADBDataProvider <> Self) and (ADBDataProvider.DataSet = Self.DataSet) and + ADBDataProvider.FInInsert then + begin + Result := True; + Break; + end; + end; +end; + +function TcxDBDataProvider.IsOtherDetailChanged: Boolean; +begin + Result := DataController.IsOtherDetailChanged; +end; + +function TcxDBDataProvider.IsUniDirectional: Boolean; +begin + {$IFDEF DELPHI6} + if Assigned(DataSet) and DataSet.IsUniDirectional then + Result := True + else + {$ENDIF} + Result := False; +end; + +function TcxDBDataProvider.IsCustomDataSourceSupported: Boolean; +begin + Result := False; +end; + +function TcxDBDataProvider.IsGridMode: Boolean; +begin + Result := DataController.DataModeController.GridMode and + not IsUniDirectional and not FLoadAllNeeded and + {not DataController.IsDetailMode} + (DataController.DetailMode <> dcdmPattern); +end; + +function TcxDBDataProvider.IsDataSource: Boolean; +begin + Result := (DataSet <> nil) and (DataSet.State <> dsInactive); +end; + +function TcxDBDataProvider.IsKeyNavigation: Boolean; +begin + Result := DataController.IsKeyNavigation; +end; + +function TcxDBDataProvider.IsOtherInsert: Boolean; +var + I: Integer; + ADBDataProvider: TcxDBDataProvider; +begin + Result := False; + for I := 0 to DBDataProviders.Count - 1 do + begin + ADBDataProvider := TcxDBDataProvider(DBDataProviders[I]); + if (ADBDataProvider <> Self) and + (ADBDataProvider.DataSet = Self.DataSet) and ADBDataProvider.FInInsert then + begin + Result := True; + Break; + end; + end; +end; + +function TcxDBDataProvider.IsSyncInsert: Boolean; +begin + Result := not DataController.IsPattern and + DataController.DataModeController.SyncInsert and + IsSyncMode; +end; + +function TcxDBDataProvider.IsSyncMode: Boolean; +begin + Result := Assigned(DataSet) and DataSet.Active and + (IsGridMode or DataController.DataModeController.SyncMode) and + not IsUniDirectional; + if DataController.IsDetailMode then + begin + if not DataController.DataModeController.DetailInSyncMode then + Result := False + else + if DataController.DataModeController.DetailInSQLMode then + begin + if not IsDataSetCurrent then + Result := False; + end + else + if not (IsKeyNavigation or IsGridMode) then + Result := False; + end; +end; + +function TcxDBDataProvider.DataSet_ActiveRecord: Integer; +begin + Result := TDataSetAccess(DataSet).ActiveRecord; +end; + +function TcxDBDataProvider.DataSet_BookmarkAvailable: Boolean; +begin + Result := TDataSetAccess(DataSet).BookmarkAvailable; +end; + +function TcxDBDataProvider.DataSet_BufferCount: Integer; +begin + Result := TDataSetAccess(DataSet).BufferCount; +end; + +function TcxDBDataProvider.IsActive: Boolean; +begin + Result := Assigned(DataSet) and DataSet.Active; // WARNING: DataLink.Active <> DataSet.Active! + Result := Result and not DataSet.ControlsDisabled; +end; + +function TcxDBDataProvider.IsActiveDataSet: Boolean; +begin + Result := Assigned(DataSet) and (DataSet.FieldCount > 0) and + (DataSet.Active or not DataSet.DefaultFields); +end; + +function TcxDBDataProvider.IsBOF: Boolean; +begin + if Assigned(DataSet) then + Result := DataSet.BOF or not DataLink.Active + else + Result := inherited IsBOF; +end; + +function TcxDBDataProvider.IsChanging: Boolean; +begin + Result := inherited IsChanging; +end; + +function TcxDBDataProvider.IsEditing: Boolean; +begin + if IsUnboundColumnMode then + Result := inherited IsEditing + else + Result := Assigned(DataSet) and (DataSet.State in dsEditModes); +end; + +function TcxDBDataProvider.IsEOF: Boolean; +begin + if Assigned(DataSet) then + begin + with DataController do + begin + if IsDetailMode and not IsGridMode then + begin + if not VarIsEmpty(MasterDetailKeyValues) then + Result := DataSet.EOF or + (not (DataSet.State in dsEditModes) and + not VarEquals(GetDataSetValues(DataSet, MasterDetailKeyFields), MasterDetailKeyValues)) + else + Result := True; + end + else + Result := DataSet.EOF or not DataLink.Active; + end; + end + else + Result := inherited IsEOF; +end; + +function TcxDBDataProvider.IsGridModeUpdating: Boolean; +begin + Result := IsGridMode and FInUpdateGridMode; +end; + +function TcxDBDataProvider.IsInserting: Boolean; +begin + Result := Assigned(DataSet) and (DataSet.State = dsInsert); +end; + +function TcxDBDataProvider.IsModified: Boolean; +begin + Result := inherited IsModified {for Unbound column} or + IsDataSetModified; +end; + +function TcxDBDataProvider.IsDataSetModified: Boolean; +var + I: Integer; +begin + Result := Assigned(DataSet) and DataSet.Modified; + if Result and not FAssignedFields.IsEmpty then // check Null values + begin + Result := False; + for I := 0 to DataSet.FieldCount - 1 do + if not FAssignedFields.IsFieldExists(DataSet.Fields[I]) and + not VarIsNull(GetFieldValue(DataSet.Fields[I])) then + begin + Result := True; + Break; + end; + end; + // check unbound column + if not Result and (inherited IsModified) then + begin + for I := 0 to DataController.ItemCount - 1 do + if DataController.Fields[I].IsUnbound and + not VarIsNull(DataController.GetEditValue(I, evsValue)) then + begin + Result := True; + Break; + end; + end; +end; + +function TcxDBDataProvider.BookmarkValid(const ABookmark: TBookmarkStr): Boolean; +begin + Result := Dataset.BookmarkValid(TBookmark(ABookmark)); +end; + +function TcxDBDataProvider.CompareBookmarks(const AItem1, AItem2: TBookmarkStr): Integer; +begin + if not DataLink.Active then + Result := -1 + else + Result := Dataset.CompareBookmarks(TBookmark(AItem1), TBookmark(AItem2)); +end; + +procedure TcxDBDataProvider.CorrectRecordIndex(ARecordIndex: Integer); +begin + if Assigned(DataSet) then + begin + if not IsKeyNavigation and (FSavePosInfo.Bookmark <> '') and + (CompareBookmarks(FSavePosInfo.Bookmark, DataSet.Bookmark) = 0) then + FRecordIndex := ARecordIndex; + end; +end; + +procedure TcxDBDataProvider.First; +var + AReopened: Boolean; +begin + FInFirst := True; + try + inherited First; + if Assigned(DataSet) then + with DataController do + if IsDetailMode and not IsGridMode then + begin + if not VarIsEmpty(MasterDetailKeyValues) then + begin + DataModeController.DoDetailFirst(MasterDetailKeyFieldNames, + MasterDetailKeyValues, AReopened); + if AReopened then + SavePos; + IsDataSetCurrent := True; + if RecreatedFieldsAfterFirst then + NotifyDetailsAfterFieldsRecreating(not DataController.FInCheckCurrentQuery); + end; + end + else + if DataSet.Active then + DataSet.First; + finally + FInFirst := False; + end; +end; + +procedure TcxDBDataProvider.Prev; +begin + if Assigned(DataSet) then + DataSet.Prior; +end; + +procedure TcxDBDataProvider.Next; +begin + if Assigned(DataSet) then + DataSet.Next; +end; + +procedure TcxDBDataProvider.Last; +begin + if Assigned(DataSet) and DataSet.Active then + DataSet.Last; +end; + +procedure TcxDBDataProvider.MoveBy(ADistance: Integer); +begin + if Assigned(DataSet) then + DataSet.MoveBy(ADistance); +end; + +procedure TcxDBDataProvider.Scroll(ADistance: Integer); +var + ARecordIndex: Integer; +begin + if not IsGridMode or (ADistance = 0) or not IsActive then Exit; + if ADistance < 0 then + begin + ARecordIndex := (ADistance - DataLink.ActiveRecord); + DataSet.MoveBy(ARecordIndex); + end + else + begin + ARecordIndex := DataLink.RecordCount - DataLink.ActiveRecord - 1 + ADistance; + DataSet.MoveBy(ARecordIndex); + end; + DataController.CorrectPrevSelectionChangedInfo; + DataController.SyncSelected(True); +end; + +procedure TcxDBDataProvider.SavePos; +begin + if Assigned(DataSet) then + with DataSet do + begin + if DataSet_BookmarkAvailable then + FSavePosInfo.Bookmark := Bookmark + else + FSavePosInfo.Bookmark := ''; + FSavePosInfo.ActiveRecord := DataSet_ActiveRecord; // save offset in DataSet buffer + FSavePosInfo.BOF := BOF; + FSavePosInfo.EOF := EOF; + end; +end; + +procedure TcxDBDataProvider.RestorePos; +begin + if Assigned(DataSet) then + with DataSet do + begin + if (FSavePosInfo.Bookmark <> '') and + Self.BookmarkValid(FSavePosInfo.Bookmark) then + begin + try + Bookmark := FSavePosInfo.Bookmark; + // restore offset in DataSet buffer + if DataSet_ActiveRecord > FSavePosInfo.ActiveRecord then + begin + MoveBy(DataSet_BufferCount - DataSet_ActiveRecord - 1 + DataSet_ActiveRecord - FSavePosInfo.ActiveRecord); + MoveBy(FSavePosInfo.ActiveRecord - DataSet_BufferCount + 1); + end + else + if DataSet_ActiveRecord < FSavePosInfo.ActiveRecord then + begin + MoveBy(-DataSet_ActiveRecord + DataSet_ActiveRecord - FSavePosInfo.ActiveRecord); + MoveBy(FSavePosInfo.ActiveRecord); + end; + // BOF and EOF + if FSavePosInfo.BOF and not BOF then Prior; + if FSavePosInfo.EOF and not EOF then Next; + except + on EDatabaseError do; + end; + end; + end; +end; + +function TcxDBDataProvider.CanDelete: Boolean; +begin + Result := CanModify and not DataSet.IsEmpty; +end; + +function TcxDBDataProvider.CanInitEditing(ARecordIndex: Integer): Boolean; +begin + if IsUnboundColumnMode then + Result := inherited CanInitEditing(ARecordIndex) + else + begin + FInCanInitEditing := True; + try + // bug in Delphi 7 with update pack 1 + if DataController.UseNewItemRowForEditing and DataController.NewItemRowFocused and + not IsInserting then + begin + Insert; + Result := True; + end + else + Result := DataLink.Edit; + if Result then + begin + SetChanging; + // Update Navigator + if DataController.UseNewItemRowForEditing and DataController.NewItemRowFocused then + DataController.Change([dccUpdateRecord]); + end; + finally + FInCanInitEditing := False; + end; + end; +end; + +function TcxDBDataProvider.CanModify: Boolean; +begin + Result := Assigned(DataSet) and DataSet.Active and DataSet.CanModify and IsSyncMode; +end; + +procedure TcxDBDataProvider.Append; +begin + if Assigned(DataSet) then + AddNewRecord(DataSet.Append); +end; + +procedure TcxDBDataProvider.InternalCancel; +var + ARecordIndex: Integer; + ARecordId: Variant; +begin + if not Assigned(DataSet) then Exit; + if DataController.IsDetailMode and IsEOF then // Appending in M-D + begin + DataSet.DisableControls; + try + if (DataController.GetRowCount - 2) >= 0 then + begin + ARecordIndex := DataController.GetRowInfo(DataController.GetRowCount - 2).RecordIndex; + ARecordId := DataController.GetRecordId(ARecordIndex); + end + else + ARecordIndex := -1; + DataSet.Cancel; + if ARecordIndex <> -1 then + DataSet.Locate(DataController.KeyFieldNames, ARecordId, []); + finally + DataSet.EnableControls; + end; + end + else + DataSet.Cancel; +end; + +procedure TcxDBDataProvider.Cancel; +begin + if IsUnboundColumnMode then + inherited Cancel + else + begin + if DataController.IsSmartRefresh then // !!! + begin + DataController.FInUnboundCopy := True; + try + inherited Cancel; + finally + DataController.FInUnboundCopy := False; + end; + end; + InternalCancel; + end; +end; + +procedure TcxDBDataProvider.Delete; +begin + if Assigned(DataSet) then + begin + if DataController.GetFocusedRecordIndex <> -1 then + begin + if IsSmartRefresh then + FUpdatingPrevFocusedRecordIndex := DataController.GetFocusedRecordIndex; + + DataSet.DisableControls; + try + DataSet.Delete; + {$IFDEF DELPHI7} // bug in Delphi 7 with update pack 1 + DataLink.FPreventLayoutChanged := True; + {$ENDIF} + if DataController.FNearestRecordIndex <> -1 then + DataController.TryFocusRecord(DataController.FNearestRecordIndex); + finally + DataSet.EnableControls; + {$IFDEF DELPHI7} // bug in Delphi 7 with update pack 1 + DataLink.FPreventLayoutChanged := False; + {$ENDIF} + end; + + if IsSmartRefresh then + begin + if FUpdatingPrevFocusedRecordIndex < DataController.RecordCount then + DataController.DeleteRecord(FUpdatingPrevFocusedRecordIndex); + DataController.UpdateFocused; + end; + end; + end; +end; + +procedure TcxDBDataProvider.DeleteRecords(AList: TList); + + procedure InternalDelete(AUpdateFocused: Boolean); + var + ARecordIndex: Integer; + begin + if IsSmartRefresh then + begin + ARecordIndex := DataController.LocateRecordIndex(DataController.GetKeyFields); + if ARecordIndex <> -1 then + begin + DataSet.Delete; + DataController.DeleteRecord(ARecordIndex); + end; + end + else + DataSet.Delete; + end; + + procedure DeleteWithLocate; + var + AKeyList: TList; + AFieldList: TList; + I: Integer; + P: PVariant; + begin + AKeyList := TList.Create; + AFieldList := TList.Create; + try + DataController.GetKeyFields(AFieldList); + for I := 0 to AList.Count - 1 do + begin + New(P); + P^ := DataController.GetInternalRecordId(Integer(AList[I]), AFieldList); + AKeyList.Add(P); + end; + for I := AKeyList.Count - 1 downto 0 do + begin + P := PVariant(AKeyList[I]); + if DataSet.Locate(DataController.KeyFieldNames, P^, []) then + InternalDelete(False); + end; + if IsSmartRefresh then + DataController.UpdateFocused; + finally + for I := 0 to AKeyList.Count - 1 do + begin + P := AKeyList[I]; + Dispose(P); + end; + AKeyList.Free; + AFieldList.Free; + end; + end; + + procedure DeleteWithMoveBy; + var + I, AAnchorRecordIndex, J, ARecordCount: Integer; + begin + AAnchorRecordIndex := Integer(AList[AList.Count - 1]); + ARecordCount := DataController.RecordCount; + J := 0; + if DataController.CanFocusRecord(AAnchorRecordIndex) then + for I := AList.Count - 1 downto 0 do + begin + DataSet.MoveBy(Integer(AList[I]) - AAnchorRecordIndex + J); + DataSet.Delete; + AAnchorRecordIndex := Integer(AList[I]); + if AAnchorRecordIndex = (ARecordCount - 1) then + J := 1 + else + J := 0; + Dec(ARecordCount); + end; + end; + +begin + if Assigned(DataSet) then + begin + DataSet.DisableControls; + try + if DataController.IsSmartRefresh then + DataController.BeginFullUpdate; + try + if IsKeyNavigation then + DeleteWithLocate + else + DeleteWithMoveBy; + finally + if DataController.IsSmartRefresh then + begin + if DataController.FInDeleteSelection then + DataController.ClearSelection; + DataController.EndFullUpdate; + end + else + if not DataController.IsKeyNavigation then + DataController.ClearSelection; + end; + finally + DataSet.EnableControls; + end; + end; +end; + +procedure TcxDBDataProvider.DeleteSelection; +var + I: Integer; + ASelection: TcxDBDataSelection; +begin + if IsGridMode then + begin + if Assigned(DataSet) then + begin + ASelection := DataController.DBSelection; + DataSet.DisableControls; + try + for I := ASelection.Count - 1 downto 0 do + begin + DataSet.Bookmark := ASelection.FBookmarks[I]; + DataSet.Delete; + ASelection.Delete(I); + end; + finally + DataSet.EnableControls; + end; + end; + end + else + inherited DeleteSelection; +end; + +procedure TcxDBDataProvider.Edit; +begin + if IsUnboundColumnMode then + inherited Edit + else + if Assigned(DataSet) then + DataSet.Edit; +end; + +function TcxDBDataProvider.GetEditValue(ARecordIndex: Integer; AField: TcxCustomDataField; + AEditValueSource: TcxDataEditValueSource): Variant; +var + ADataSetField: TField; +begin + Result := Null; + ADataSetField := TcxDBDataField(AField).Field; + if Assigned(ADataSetField) then + begin + if AEditValueSource = evsText then + begin + if ADataSetField.IsNull and not Assigned(ADataSetField.OnGetText) then + Result := Null + else + Result := ADataSetField.Text; + end + else + if (AEditValueSource = evsKey) and (ADataSetField.KeyFields <> '') then + Result := ADataSetField.DataSet.FieldValues[ADataSetField.KeyFields] + else + if not ADataSetField.IsNull then + Result := ADataSetField.Value; // evsValue + end + else + if AField.IsUnbound then + Result := inherited GetEditValue(ARecordIndex, AField, AEditValueSource); +end; + +procedure TcxDBDataProvider.Insert; +begin + if Assigned(DataSet) then + begin + FInsertOperation := True; + try + AddNewRecord(DataSet.Insert); + finally + FInsertOperation := False; + end; + end; +end; + +procedure TcxDBDataProvider.Post; +var + ALock: Boolean; +begin + if IsUnboundColumnMode then + inherited Post + else + if Assigned(DataSet) then + begin + ALock := not IsSmartRefresh; + if ALock then + DataController.BeginFullUpdate; + try + DataSet.CheckBrowseMode; // DataSet.Post; + finally + if ALock then + DataController.EndFullUpdate; + end; + end; +end; + +procedure TcxDBDataProvider.PostEditingData; +begin + if DataLink.Active then + DataLink.UpdateData; +end; + +procedure TcxDBDataProvider.AssignItemValue(ARecordIndex: Integer; AField: TcxCustomDataField; + const AValue: Variant); +var + ADBField: TcxDBDataField; + ADataSetField: TField; +begin + ADBField := AField as TcxDBDataField; + ADataSetField := ADBField.Field; + if Assigned(ADataSetField) then + begin + if ADBField.IsLookup and (ADataSetField.KeyFields <> '') then + begin + ADataSetField.DataSet.FieldValues[ADataSetField.KeyFields] := AValue; + FAssignedFields.AddFieldsByFieldNames(ADataSetField.DataSet, ADataSetField.KeyFields); + end + else + begin + ADataSetField.Value := AValue; // SetFieldValue(ADataSetField, AValue);? + FAssignedFields.AddField(ADataSetField); + end; + end; +end; + +procedure TcxDBDataProvider.DoInitInsertingRecord(AInsertingRecordIndex: Integer; + const AGroupValues: TcxDataSummaryValues); +begin + if not (FInInsert or FInCanInitEditing or IsOtherInsert) then + begin + DataController.UpdateEditingRecord; + Exit; + end; + FAssignedFields.Clear; // reset assigned field names + inherited DoInitInsertingRecord(AInsertingRecordIndex, AGroupValues); + if (dcoAssignMasterDetailKeys in DataController.Options) and DataController.IsDetailMode then + begin + SetDataSetValues(DataSet, DataController.MasterDetailKeyFields, DataController.MasterDetailKeyValues); + FAssignedFields.AddFieldsByFieldList(DataController.MasterDetailKeyFields); + end; + DataController.DoInitInsertingRecord(AInsertingRecordIndex); + DataController.UpdateEditingRecord; +end; + +function TcxDBDataProvider.SetEditValue(ARecordIndex: Integer; AField: TcxCustomDataField; + const AValue: Variant; AEditValueSource: TcxDataEditValueSource): Boolean; +var + ADataSetField: TField; +begin + Result := False; + ADataSetField := TcxDBDataField(AField).Field; + if Assigned(ADataSetField) then + begin + if (AEditValueSource = evsText) or Assigned(ADataSetField.OnSetText) then + ADataSetField.Text := VarToStr(AValue) + else + if (AEditValueSource = evsKey) and (ADataSetField.KeyFields <> '') then + ADataSetField.DataSet.FieldValues[ADataSetField.KeyFields] := AValue + else + SetFieldValue(ADataSetField, AValue); + Result := True; + end + else + if AField.IsUnbound then + Result := inherited SetEditValue(ARecordIndex, AField, AValue, AEditValueSource); +end; + +procedure TcxDBDataProvider.BeginDeleting; +//var +// ARowIndex: Integer; +begin + inherited; +{ + if IsKeyNavigation and (DataController.FocusedRowIndex <> -1) then + begin + ARowIndex := DataController.GetNearestRowIndex(DataController.FocusedRowIndex, ASelection); + if ARowIndex <> -1 then + begin + DataController.FDeletingRecordIndex := DataController.GetRowInfo(ARowIndex).RecordIndex; + FNearestRecordID := DataController.GetRecordId(DataController.FDeletingRecordIndex); + end; + end; + } +end; + +procedure TcxDBDataProvider.EndDeleting; +begin + try + if DataController.FNearestRecordIndex <> -1 then + begin + if DataController.FNearestRecordIndex < DataController.RecordCount then + DataController.ChangeFocusedRecordIndex(DataController.FNearestRecordIndex); + end; + finally + inherited; + end; + +{ + DataController.FDeletingRecordIndex := -1; + FNearestRecordID := Unassigned; +} +end; + +procedure TcxDBDataProvider.ActiveChanged(AActive: Boolean); +begin + inherited ActiveChanged(AActive); + if Assigned(DataSet) and not DataSet.Active and DataSet.DefaultFields then + DataController.ResetDBFields; +end; + +procedure TcxDBDataProvider.AddListener(AProvider: TcxDBDataProvider); +begin + if FListeners.IndexOf(AProvider) = -1 then + FListeners.Add(AProvider); +end; + +procedure TcxDBDataProvider.BeginLocate; +begin + inherited BeginLocate; + if Assigned(DataSet) and (DataSet.State in dsEditModes) then + SetPostLocateFlag; +end; + +procedure TcxDBDataProvider.DataScrolled(ADistance: Integer); +begin + if IsGridMode then + begin + FRecordIndex := DataLink.ActiveRecord; + DataController.BeginUpdate; + try + if ADistance <> 0 then + DataController.InvalidateDataBuffer; + if not DataController.Relations.IsEmpty then + DataController.CollapseDetails; + finally + DataController.EndUpdate; + end; + end + else + Inc(FRecordIndex, ADistance); + inherited DataScrolled(ADistance); + if IsGridMode and DataController.IsSequenced then + DataController.UpdateScrollBars; +end; + +procedure TcxDBDataProvider.Freeze; +begin + inherited Freeze; + if Assigned(DataSet) then + begin + DataSet.DisableControls; + if DataSet.Active and (DataSet.State in dsEditModes) then + begin + SetPostLocateFlag; + DataSet.Cancel; + end; + end; +end; + +procedure TcxDBDataProvider.LayoutChanged(ADataLayoutChanges: TcxDataLayoutChanges); +begin + if IsDetailDataSetBusy then + begin + if IsActive then + DataController.ResyncDBFields; + Exit; + end; + inherited LayoutChanged(ADataLayoutChanges); +end; + +procedure TcxDBDataProvider.RecordChanged(Field: TField); +var + AIsDataSetCurrent: Boolean; +begin + if DataController.IsDetailMode and DataController.DataModeController.DetailInSyncMode and + not IsDataSetCurrent then + AIsDataSetCurrent := False + else + AIsDataSetCurrent := True; + if IsEditing and AIsDataSetCurrent then + DataController.UpdateEditingRecord; + ResetChanging; +end; + +procedure TcxDBDataProvider.ResetPostLocateFlag; +begin + FPostLocateFlag := False; +end; + +procedure TcxDBDataProvider.ResetSmartRefresh; +begin + FUpdatingRecordIndex := cxNullEditingRecordIndex; + FUpdatingNewRecordIndex := -1; + FUpdatingRecordIsInserting := False; +end; + +procedure TcxDBDataProvider.SetPostLocateFlag; +var + I: Integer; + ADBDataProvider: TcxDBDataProvider; +begin + for I := 0 to DBDataProviders.Count - 1 do + begin + ADBDataProvider := TcxDBDataProvider(DBDataProviders[I]); + if (ADBDataProvider.DataSet = Self.DataSet) and + (ADBDataProvider.DataController.DetailMode <> dcdmPattern) then + ADBDataProvider.FPostLocateFlag := True; + end; +end; + +procedure TcxDBDataProvider.Unfreeze; +begin + if Assigned(DataSet) then + DataSet.EnableControls; + inherited Unfreeze; +end; + +procedure TcxDBDataProvider.SmartDataChanged; + + function IsKeyFieldAutoInc: Boolean; + var + AKeyFields: TList; + begin + Result := False; + AKeyFields := TList.Create; + try + DataController.GetKeyDBFields(AKeyFields); + if (AKeyFields.Count = 1) and (TField(AKeyFields[0]).DataType = ftAutoInc) then + Result := True; + finally + AKeyFields.Free; + end; + end; + + function IsNewRecordInserted(const AFocusedRecordValues, AKeyFieldsValues: Variant): Boolean; + begin + Result := False; + if not FUpdatingRecordIsInserting then Exit; + // check auto inc + if VarEquals(AFocusedRecordValues, Null) and IsKeyFieldAutoInc then + begin + if DataController.FindRecordIndexByKey(AKeyFieldsValues) = -1 then + Result := True; + end; + // new item ? + end; + +var + AFocusedRecordIndex, ARecordIndex: Integer; + AFocusedRecordValues, AKeyFieldsValues: Variant; + ADataChangeInfo: TcxDataChangeInfo; +begin + if FUpdatingRecordIndex <> cxNullEditingRecordIndex then + begin + AFocusedRecordIndex := DataController.GetFocusedRecordIndex; + if AFocusedRecordIndex = FUpdatingRecordIndex then + begin + if (AFocusedRecordIndex < 0) and (FUpdatingNewRecordIndex <> -1) then + AFocusedRecordIndex := FUpdatingNewRecordIndex; + AFocusedRecordValues := DataController.GetRecordId(AFocusedRecordIndex); + AKeyFieldsValues := DataController.GetKeyFieldsValues; + if not VarEquals(AFocusedRecordValues, AKeyFieldsValues) then + begin + if IsNewRecordInserted(AFocusedRecordValues, AKeyFieldsValues) then + begin + if DataController.NewItemRowFocused then + begin + if FUpdatingNewRecordIndex <> -1 then + AFocusedRecordIndex := FUpdatingNewRecordIndex + else + begin + AFocusedRecordIndex := DataController.AppendRecord; + DataController.CopyRecord(DataController.NewItemRecordIndex, AFocusedRecordIndex); + end; + end; + DataController.DoUpdateRecord(AFocusedRecordIndex); + end + else + begin + ARecordIndex := DataController.FindRecordIndexByKey(AFocusedRecordValues); + if (ARecordIndex = -1) or (ARecordIndex = AFocusedRecordIndex) then + begin + if AFocusedRecordIndex <> -1 then + DataController.DeleteRecord(AFocusedRecordIndex); + DataController.UpdateFocused; + end; + end; + end + else + DataController.DoUpdateRecord(AFocusedRecordIndex); + end; + // record changed notify + if AFocusedRecordIndex <> -1 then + begin + ADataChangeInfo := DataController.FDataChangeInfo; + ADataChangeInfo.Kind := dcRecord; + ADataChangeInfo.RecordIndex := AFocusedRecordIndex; + DataController.FDataChangeInfo := ADataChangeInfo; + end; + end; + DataController.FilterChanged; + DataController.SummaryChanged(False); + ResetPostLocateFlag; // ? +end; + +procedure TcxDBDataProvider.CheckExpandedDetails; +var + I, AFocusedRecordIndex: Integer; +begin + AFocusedRecordIndex := DataController.FocusedRecordIndex; + for I := 0 to DataController.RecordCount - 1 do + if (I <> AFocusedRecordIndex) and DataController.IsDetailDataControllerExist(I, -1) then + begin + DataController.CollapseDetails; + Break; + end; +end; + +function TcxDBDataProvider.DoLocate(const ASubText: string; AForward, ANext: Boolean): Boolean; +var + ASearchItemIndex: Integer; + AStartPos: TBookmarkStr; + AExit, AStartEOF: Boolean; + + function IsCurrentEqual: Boolean; + var + S: string; + begin + FIncrementalSearching := True; + try + S := DataController.GetIncrementalSearchText(-1{set FIncrementalSearching flag!}, ASearchItemIndex); + Result := DataCompareText(S, ASubText, True); + finally + FIncrementalSearching := False; + end; + end; + + procedure CalcNextRecord; + begin + with DataSet do + if not AForward then + begin + Prior; + if BOF then + begin + if not ANext then + Last + else + AExit := True; + AStartPos := FSavePosInfo.Bookmark; + end; + end + else + begin + Next; + if EOF then + begin + if not ANext then + First + else + AExit := True; + AStartPos := FSavePosInfo.Bookmark; + end; + end; + end; + +begin + Result := False; + if not Assigned(DataSet) or IsEditing then Exit; + with DataSet do + begin + if Active and not (BOF and EOF) then + begin + ASearchItemIndex := DataController.Search.ItemIndex; + Result := not ANext and IsCurrentEqual; + if Result then + DataController.UpdateFocused + else + begin + Freeze; + try + SavePos; + AStartPos := ''; + AExit := False; + AStartEOF := False; + if ANext then + CalcNextRecord + else + if EOF then + AStartEOF := True; + while (not EOF or ANext or AStartEOF) and + ((AStartPos = '') or (Self.CompareBookmarks(Bookmark, AStartPos) <> 0)) do + begin + AStartEOF := False; + if IsCurrentEqual then + begin + Result := True; + Break; + end; + CalcNextRecord; + if AExit then Break; + end; + if not Result then + RestorePos; + finally + Unfreeze; // Invalidate disabled + end; + if Result then + begin + DataController.CorrectPrevSelectionChangedInfo; + DataController.Change([dccLayout]); // Invalidate + end; + DataController.SyncMasterPos; + end; + end; + end; +end; + +function TcxDBDataProvider.GetDataBufferCount: Integer; +begin + if DataController.DataModeController.GridModeBufferCount = 0 then + Result := DataController.GetDefaultGridModeBufferCount + else + Result := DataController.DataModeController.GridModeBufferCount; +end; + +function TcxDBDataProvider.GetDataRecordCount: Integer; +begin + Result := DataLink.RecordCount; +end; + +function TcxDBDataProvider.GetExternalDataDisplayText(ARecordIndex: Integer; + AField: TcxCustomDataField): string; +var + ADataSetField: TField; + APrevActiveRecord: Integer; +begin + ADataSetField := TcxDBDataField(AField).Field; + if Assigned(ADataSetField) then + begin + if (0 <= ARecordIndex) and (ARecordIndex < DataLink.RecordCount) then + begin + APrevActiveRecord := DataLink.ActiveRecord; + try + DataLink.ActiveRecord := ARecordIndex; + Result := ADataSetField.DisplayText; + finally + DataLink.ActiveRecord := APrevActiveRecord; + end; + end + else + if IsInserting or FIncrementalSearching then + Result := ADataSetField.DisplayText + else + Result := ''; + end + else + Result := inherited GetExternalDataDisplayText(ARecordIndex, AField); +end; + +function TcxDBDataProvider.GetExternalDataValue(ARecordIndex: Integer; + AField: TcxCustomDataField): Variant; + + function GetFieldValue(AField: TField): Variant; + begin + if AField.IsNull then + Result := Null + else + Result := AField.Value; + end; + +var + ADataSetField: TField; + APrevActiveRecord: Integer; +begin + ADataSetField := TcxDBDataField(AField).Field; + if Assigned(ADataSetField) then + begin + if (0 <= ARecordIndex) and (ARecordIndex < DataLink.RecordCount) then + begin + APrevActiveRecord := DataLink.ActiveRecord; + try + DataLink.ActiveRecord := ARecordIndex; + Result := GetFieldValue(ADataSetField); + finally + DataLink.ActiveRecord := APrevActiveRecord; + end; + end + else + if IsInserting or FIncrementalSearching then + Result := GetFieldValue(ADataSetField) + else + Result := Null; + end + else + Result := inherited GetExternalDataValue(ARecordIndex, AField); +end; + +procedure TcxDBDataProvider.LoadDataBuffer; +begin + if DataLink.Active and IsGridMode then + begin + DataLink.BufferCount := GetDataBufferCount; + DataController.DataStorage.Clear(False); + DataController.DataStorage.RecordCount := GetDataRecordCount; + FRecordIndex := DataLink.ActiveRecord; + end; + inherited LoadDataBuffer; +end; + +procedure TcxDBDataProvider.UpdateGridMode; +var + APrevRecordCount: Integer; +begin + if DataLink.Active and IsGridMode then + begin + APrevRecordCount := DataController.RecordCount; + DataLink.BufferCount := GetDataBufferCount; + FRecordIndex := DataLink.ActiveRecord; + if ((APrevRecordCount <> GetDataRecordCount) or IsInserting) {and + not DataController.FInUpdateGridModeBufferCount} then // !!! + begin + DataChanged(dcTotal, -1, -1); + if DataController.FInUpdateGridModeBufferCount and + (DataSet.State in dsEditModes) and not DataLink.ReadOnly then + DataLink.EditingChanged; + end + else + begin + if not IsEditing then + DataChanged(dcRecord, -1, -1); + DataController.UpdateFocused; + end; + end; +end; + +function TcxDBDataProvider.GetDetailHasChildren(ARecordIndex: Integer; ARelationIndex: Integer): Boolean; +var + ARelation: TcxDBDataRelation; + APatternDataController, ADetailDataController: TcxCustomDataController; + ADataController: TcxDBDataController; + AMasterDetailKeyValues: Variant; +begin + APatternDataController := DataController.GetPatternDataController; + if APatternDataController <> nil then + ADetailDataController := APatternDataController.Relations[ARelationIndex].DetailDataController + else + ADetailDataController := nil; //!!! + if ADetailDataController is TcxDBDataController then + begin + Result := True; + ADataController := TcxDBDataController(ADetailDataController); + ARelation := TcxDBDataRelation(DataController.Relations[ARelationIndex]); + // event + AMasterDetailKeyValues := ARelation.GetMasterRecordID(ARecordIndex); + if Assigned(DataController.FOnDetailHasChildren) then + DataController.FOnDetailHasChildren(DataController, ARecordIndex, ARelationIndex, + ADataController.MasterDetailKeyFieldNames, AMasterDetailKeyValues, Result) + else + if not (ADataController.IsGridMode or ADataController.DataModeController.DetailInSQLMode) then + begin + if Assigned(ADataController.DataSet) and ADataController.DataSet.Active then + begin + ADataController.Provider.Freeze; + try + ADataController.Provider.SavePos; + try + Result := ADataController.DataSet.Locate(ADataController.MasterDetailKeyFieldNames, + AMasterDetailKeyValues, []); // must be sort by Detail Keys + finally + ADataController.Provider.RestorePos; + end; + finally + ADataController.Provider.Unfreeze; + ADataController.SyncMasterPos; + end; + end + else + Result := False; + end; + end + else + Result := inherited GetDetailHasChildren(ARecordIndex, ARelationIndex); +end; + +function TcxDBDataProvider.GetRecordIndex: Integer; +begin + if not FInUpdateGridMode and IsInserting then + Result := EditingRecordIndex + else + if FInUpdateGridMode and IsInserting and DataController.NewItemRowFocused then + Result := DataController.NewItemRecordIndex + else + Result := FRecordIndex; +end; + +function TcxDBDataProvider.GetValueDefReaderClass: TcxValueDefReaderClass; +begin + Result := TcxValueDefDBReader; +end; + +procedure TcxDBDataProvider.AddNewRecord(AOperation: TDataOperation); + + procedure CheckDataSetBrowseMode; + begin + DataSet.CheckBrowseMode; + SmartDataChanged; + ResetSmartRefresh; + ResetEditing; + end; + +begin + if Assigned(DataSet) then + begin + FInInsert := True; + try + if DataSet.State in dsEditModes then + begin + if not IsSmartRefresh and (DataSet.State = dsInsert) then + DataController.CheckBrowseMode; + + if DataSet.State in dsEditModes then + DataLink.UpdateRecord; + + if IsSmartRefresh then + DataSet.DisableControls; + try + if IsSmartRefresh then + CheckDataSetBrowseMode; + AOperation; + finally + if IsSmartRefresh then + DataSet.EnableControls; + end; + end + else + AOperation; + finally + FInInsert := False; + end; + end; +end; + +function TcxDBDataProvider.GetDataController: TcxDBDataController; +begin + Result := inherited DataController as TcxDBDataController; +end; + +function TcxDBDataProvider.GetDataSet: TDataSet; +begin + if Assigned(DataLink) then + Result := DataLink.DataSet + else + Result := nil; +end; + +function TcxDBDataProvider.GetDataSource: TDataSource; +begin + if Assigned(DataLink) then + Result := DataLink.DataSource + else + Result := nil; +end; + +function TcxDBDataProvider.GetIsDataSetCurrent: Boolean; +begin + if DataController.IsDetailMode and not DataController.DataModeController.DetailInSQLMode and IsSyncMode then + Result := FInCanInitEditing or + ((FInInsert or + (((DataController.GetFocusedRowIndex <> -1) or FIsDataSetCurrent) and not IsOtherDetailDataSetInInsert) or + (DataController.UseNewItemRowForEditing and DataController.NewItemRowFocused and IsInserting)) and + not IsCanInitEditingBusy + ) + else + Result := FIsDataSetCurrent; +end; + +function TcxDBDataProvider.GetIsSmartRefresh: Boolean; +begin + Result := IsKeyNavigation and not IsGridMode and + DataController.DataModeController.SmartRefresh; +end; + +procedure TcxDBDataProvider.RemoveFromListeners; +var + I: Integer; + ADBDataProvider: TcxDBDataProvider; +begin + if DataSet = nil then Exit; + for I := 0 to DBDataProviders.Count - 1 do + begin + ADBDataProvider := TcxDBDataProvider(DBDataProviders[I]); + if (ADBDataProvider <> Self) and + (ADBDataProvider.DataSet = Self.DataSet) then + ADBDataProvider.FListeners.Remove(Self); + end; +end; + +procedure TcxDBDataProvider.SetDataSource(Value: TDataSource); +var + APrevDataLinkActive: Boolean; +begin + if Assigned(DataLink) and (DataLink.DataSource <> Value) then + begin +// FInSetDataSource := True; + try + APrevDataLinkActive := DataLink.Active; + DataLink.DataSource := Value; + if DataLink.Active = APrevDataLinkActive then + DataController.UpdateFields; + finally +// FInSetDataSource := False; + end; + end; +end; + +procedure TcxDBDataProvider.SetIsDataSetCurrent(Value: Boolean); +begin + if FIsDataSetCurrent <> Value then + begin + if Value then + DataController.ForEachDetail(DataController.GetMasterRelation, + DataController.ResetDataSetCurrent); + FIsDataSetCurrent := Value; + // Reopen? + DataController.DoDataSetCurrentChanged(Value); + end; +end; + +{ TcxValueDefDBReader } + +function TcxValueDefDBReader.GetDisplayText(AValueDef: TcxValueDef): string; +var + AField: TField; +begin + AField := TcxDBDataField(AValueDef.LinkObject).Field; + if Assigned(AField) then + Result := AField.DisplayText + else + Result := inherited GetDisplayText(AValueDef); +end; + +function TcxValueDefDBReader.GetValue(AValueDef: TcxValueDef): Variant; +var + AField: TField; +begin + AField := TcxDBDataField(AValueDef.LinkObject).Field; + if Assigned(AField) then + Result := GetFieldValue(AField) + else + Result := inherited GetValue(AValueDef); +end; + +function TcxValueDefDBReader.IsInternal(AValueDef: TcxValueDef): Boolean; +begin + Result := TcxDBDataField(AValueDef.LinkObject).IsValueDefInternal; +end; + +{ TcxDBDataField } + +destructor TcxDBDataField.Destroy; +begin + if Assigned(ParentField) then + ParentField.RemoveField(Self); + ClearFields; + inherited Destroy; +end; + +function TcxDBDataField.CanModify(AEditValueSource: TcxDataEditValueSource): Boolean; + + function IsLookupCanModify: Boolean; + var + I: Integer; + begin + Result := True; + for I := 0 to FieldCount - 1 do + if not Fields[I].CanModify(evsValue) then + begin + Result := False; + Break; + end; + end; + +begin + Result := inherited CanModify(AEditValueSource); + if not IsUnbound then + begin +// Result := inherited CanModify(AEditValueSource) and Assigned(Field); + Result := Result and Assigned(Field); + if Result then + begin + if IsLookup then + Result := (AEditValueSource = evsKey) and IsLookupCanModify + else + Result := IsFieldCanModify(Field, AEditValueSource = evsValue); + end; + end; +end; + +function TcxDBDataField.IsUnbound: Boolean; +begin + Result := not IsInternal and (FieldName = '') and + (Field = nil) and (ValueDef <> nil); +end; + +function TcxDBDataField.IsValueDefInternal: Boolean; +begin + Result := ((Field = nil) or DataController.IsGridMode) and + (not (IsUnbound and DataController.FInUnboundCopy)); +end; + +procedure TcxDBDataField.AddField(ADataField: TcxDBDataField); +begin + if FFields = nil then + FFields := TList.Create; + if FFields.IndexOf(ADataField) = -1 then + begin + if ADataField.FParentField <> nil then + InvalidOperation('ADataField.FParentField <> nil'); + FFields.Add(ADataField); + ADataField.FParentField := Self; + end; +end; + +procedure TcxDBDataField.ClearFields; +var + I: Integer; +begin + if FFields <> nil then + begin + for I := FFields.Count - 1 downto 0 do + TcxDBDataField(FFields[I]).Free; + FFields.Free; + FFields := nil; + end; +end; + +procedure TcxDBDataField.DoPropertiesChanged; + + procedure NotifyReferenceFields; + var + I: Integer; + begin + for I := 0 to FieldList.Count - 1 do + if (FieldList[I].ReferenceField = Self) and not FieldList[I].IsInternal then + DataController.DoValueTypeClassChanged(I); + end; + +begin + if not IsInternal then + DataController.DoValueTypeClassChanged(Index); + NotifyReferenceFields; +end; + +procedure TcxDBDataField.Reassign(ASource: TcxCustomDataField); +begin + inherited Reassign(ASource); + if ASource is TcxDBDataField then + begin + FField := TcxDBDataField(ASource).FField; + FFields := TcxDBDataField(ASource).FFields; + TcxDBDataField(ASource).FField := nil; + TcxDBDataField(ASource).FFields := nil; + end; +end; + +procedure TcxDBDataField.RemoveField(ADataField: TcxDBDataField); +begin + if FFields <> nil then + FFields.Remove(ADataField); + ADataField.FParentField := nil; +end; + +procedure TcxDBDataField.RemoveNotification(AComponent: TComponent); +begin + if Assigned(ReferenceField) then Exit; + inherited RemoveNotification(AComponent); + if Field = AComponent then + begin + if Provider.FInFirst and Provider.DataLink.Active and + not Provider.DataSet.Active then + Provider.RecreatedFieldsAfterFirst := True; + Field := nil; + Changed; + end; +end; + +procedure TcxDBDataField.SetPropertiesByField(AField: TField; AFieldChanged: Boolean); +var + ATextStored, AIsCurrency, AValueTypeClassChanged: Boolean; + AValueTypeClass: TcxValueTypeClass; + AChanged: Boolean; +begin + if Assigned(ReferenceField) then Exit; + repeat + if not IsInternal then + ATextStored := IsFieldFormatted(AField, DataController.GetItemValueSource(Index) = evsText) + else + ATextStored := IsFieldFormatted(AField, False); + AValueTypeClass := GetValueTypeClassByField(AField); + AIsCurrency := IsSimpleCurrencyField(AField); + AValueTypeClassChanged := (ValueTypeClass <> AValueTypeClass) or (IsCurrency <> AIsCurrency); + AChanged := AValueTypeClassChanged or (TextStored <> ATextStored); + if AChanged then + begin + BeginRecreateData; + try + TextStored := ATextStored; + ValueTypeClass := AValueTypeClass; + FIsCurrency := AIsCurrency; + finally + EndRecreateData; + end; + if AValueTypeClassChanged then + begin + DoPropertiesChanged; + AFieldChanged := False; + end; + end + else + if AFieldChanged then + DoPropertiesChanged; + until not AChanged; +end; + +function TcxDBDataField.GetDataController: TcxDBDataController; +begin + Result := inherited DataController as TcxDBDataController; +end; + +function TcxDBDataField.GetField: TField; +begin + if Assigned(ReferenceField) then + Result := (ReferenceField as TcxDBDataField).Field + else + Result := FField; +end; + +function TcxDBDataField.GetFieldItem(Index: Integer): TcxDBDataField; +begin + if Assigned(ReferenceField) then + Result := (ReferenceField as TcxDBDataField).Fields[Index] + else + Result := TcxDBDataField(FFields[Index]); +end; + +function TcxDBDataField.GetFieldCount: Integer; +begin + if Assigned(ReferenceField) then + Result := (ReferenceField as TcxDBDataField).FieldCount + else + if FFields <> nil then + Result := FFields.Count + else + Result := 0; +end; + +function TcxDBDataField.GetIsLookup: Boolean; +begin + Result := Assigned(Field) and Field.Lookup; +end; + +function TcxDBDataField.GetProvider: TcxDBDataProvider; +begin + Result := DataController.Provider; +end; + +procedure TcxDBDataField.SetField(Value: TField); +begin + if Assigned(ReferenceField) then Exit; + if (Value <> nil) and (csDestroying in Value.ComponentState) then + Value := nil; + if FField <> Value then + begin + FField := Value; + if Assigned(Value) then + Value.FreeNotification(Notifier); + ClearFields; + end; +end; + +{ TcxDBDataRelation } + +destructor TcxDBDataRelation.Destroy; +begin + RemoveMasterKeyField; + inherited Destroy; +end; + +function TcxDBDataRelation.GetMasterRecordID(ARecordIndex: Integer): Variant; +var + AList: TList; +begin + DataController.CheckRecordRange(ARecordIndex); + Result := Unassigned; + if IsLinked then + begin + AList := TList.Create; + try + GetMasterKeyFields(AList); + Result := DataController.GetInternalRecordId(ARecordIndex, AList); + finally + AList.Free; + end; + end; +end; + +procedure TcxDBDataRelation.GetMasterKeyFields(AList: TList); +begin + GetInternalKeyFields(FMasterKeyField, AList); +end; + +function TcxDBDataRelation.IsLinked: Boolean; +begin + Result := Assigned(FMasterKeyField) and (DetailKeyFieldNames <> ''); +end; + +procedure TcxDBDataRelation.RemoveDataField(ADataField: TcxCustomDataField); +begin + inherited RemoveDataField(ADataField); + if FMasterKeyField = ADataField then + FMasterKeyField := nil; +end; + +procedure TcxDBDataRelation.RemoveMasterKeyField; +begin + FMasterKeyField.Free; + FMasterKeyField := nil; +end; + +procedure TcxDBDataRelation.UpdateMasterDetailKeyFieldNames; +begin + if DataController.DetailMode = dcdmClone then Exit; + Changed; +end; + +function TcxDBDataRelation.GetDataController: TcxDBDataController; +begin + Result := inherited DataController as TcxDBDataController; +end; + +function TcxDBDataRelation.GetDetailKeyFieldNames: string; +var + ADataController: TcxCustomDataController; +begin + ADataController := DataController.GetPatternDataController; + if ADataController <> nil then + ADataController := ADataController.Relations[Self.Index].DetailDataController; + if (ADataController <> nil) and (ADataController is TcxDBDataController) then + Result := (ADataController as TcxDBDataController).DetailKeyFieldNames + else + Result := ''; +end; + +function TcxDBDataRelation.GetMasterKeyFieldNames: string; +var + ADataController: TcxCustomDataController; +begin + ADataController := DataController.GetPatternDataController; + if ADataController <> nil then + ADataController := ADataController.Relations[Self.Index].DetailDataController; + if (ADataController <> nil) and (ADataController is TcxDBDataController) then + Result := (ADataController as TcxDBDataController).MasterKeyFieldNames + else + Result := ''; +end; + +{ TcxDBDataFilterCriteriaItem } + +function TcxDBDataFilterCriteriaItem.GetFilterOperatorClass: TcxFilterOperatorClass; +var + ADataSet: TDataSet; + AOperatorAdapter: TcxDBFilterOperatorAdapter; +begin + Result := inherited GetFilterOperatorClass; + ADataSet := DataController.Provider.DataSet; + AOperatorAdapter := cxGetFilterOperatorAdapter(ADataSet); + if Assigned(AOperatorAdapter) then + AOperatorAdapter.PrepareOperatorClass(Self, ADataSet, Result); +end; + +function TcxDBDataFilterCriteriaItem.GetDataController: TcxDBDataController; +begin + Result := inherited DataController as TcxDBDataController; +end; + +function TcxDBDataFilterCriteriaItem.GetDBField: TcxDBDataField; +begin + Result := Field as TcxDBDataField; +end; + +{ TcxDBDataFilterCriteria } + +constructor TcxDBDataFilterCriteria.Create(ADataController: TcxCustomDataController); +begin + inherited Create(ADataController); + FIgnoreOrigin := True; +end; + +procedure TcxDBDataFilterCriteria.Assign(Source: TPersistent; AIgnoreItemNames: Boolean = False); +begin + if Source is TcxDBDataFilterCriteria then + begin + BeginUpdate; + try + inherited; + AutoDataSetFilter := TcxDBDataFilterCriteria(Source).AutoDataSetFilter; + IgnoreOrigin := TcxDBDataFilterCriteria(Source).IgnoreOrigin; + finally + EndUpdate; + end; + end + else + inherited; +end; + +procedure TcxDBDataFilterCriteria.AssignEvents(Source: TPersistent); +begin + inherited AssignEvents(Source); + if Source is TcxDBDataFilterCriteria then + begin + OnBeforeChange := TcxDBDataFilterCriteria(Source).OnBeforeChange; + OnFormatFilterTextValue := TcxDBDataFilterCriteria(Source).OnFormatFilterTextValue; + end; +end; + +function TcxDBDataFilterCriteria.IsAutoDataSetFilter: Boolean; +begin + Result := AutoDataSetFilter and not DataController.Provider.IsSmartRefresh; +end; + +function TcxDBDataFilterCriteria.IsFiltering: Boolean; +begin + Result := inherited IsFiltering and + not (Assigned(FOnBeforeChange) or IsAutoDataSetFilter); +end; + +procedure TcxDBDataFilterCriteria.RestoreDefaults; +begin + BeginUpdate; + try + inherited RestoreDefaults; + AutoDataSetFilter := False; + IgnoreOrigin := True; + finally + EndUpdate; + end; +end; + +procedure TcxDBDataFilterCriteria.FormatFilterTextValue(AItem: TcxFilterCriteriaItem; + const AValue: Variant; var ADisplayValue: string); +begin + if Assigned(FOnFormatFilterTextValue) then + FOnFormatFilterTextValue(Self, AValue, ADisplayValue); +end; + +function TcxDBDataFilterCriteria.GetItemClass: TcxFilterCriteriaItemClass; +begin + Result := TcxDBDataFilterCriteriaItem; +end; + +procedure TcxDBDataFilterCriteria.Update; +var + ADataSet: TDataSet; + AFilterText: string; + AFilterOptions: TFilterOptions; + AFilterActive: Boolean; +begin + if IsInternal then Exit; + if not IsDestroying then + begin + ADataSet := DataController.Provider.DataSet; + if Assigned(ADataSet) and (ADataSet.State in dsEditModes) then + try + DataController.CheckBrowseMode; + except + Active := False; + raise; + end; + if {Active and }Assigned(FOnBeforeChange) and not IsLoading then + FOnBeforeChange(Self, ADataSet, FilterText); + + if IsAutoDataSetFilter and Assigned(ADataSet) then + begin + AFilterText := FilterText; + AFilterOptions := []; + if fcoCaseInsensitive in Options then + AFilterOptions := AFilterOptions + [foCaseInsensitive] + else + AFilterOptions := AFilterOptions - [foCaseInsensitive]; + AFilterActive := Active and (AFilterText <> ''); + + if (ADataSet.Filter <> AFilterText) or (ADataSet.FilterOptions <> AFilterOptions) or + (ADataSet.Filtered <> AFilterActive) then + begin + ADataSet.DisableControls; + try + ADataSet.Filter := AFilterText; + ADataSet.FilterOptions := AFilterOptions; + ADataSet.Filtered := AFilterActive; + finally + ADataSet.EnableControls; + end; + end; + end; + end; + + inherited Update; + if not IsDestroying and DataController.Provider.IsSyncMode then + DataController.CheckFocusedRow; +end; + +function TcxDBDataFilterCriteria.GetDataController: TcxDBDataController; +begin + Result := inherited DataController as TcxDBDataController; +end; + +procedure TcxDBDataFilterCriteria.SetAutoDataSetFilter(Value: Boolean); +begin + if FAutoDataSetFilter <> Value then + begin + FAutoDataSetFilter := Value; + Changed; + end; +end; + +procedure TcxDBDataFilterCriteria.SetIgnoreOrigin(Value: Boolean); +begin + if FIgnoreOrigin <> Value then + begin + FIgnoreOrigin := Value; + Changed; + end; +end; + +{ TcxDBDataSummaryItem } + +procedure TcxDBDataSummaryItem.Assign(Source: TPersistent); +begin + if Source is TcxDBDataSummaryItem then + begin + BeginUpdate; + try + inherited Assign(Source); + FieldName := TcxDBDataSummaryItem(Source).FieldName; + finally + EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +function TcxDBDataSummaryItem.DataField: TcxCustomDataField; +begin + if Assigned(FDataField) then + Result := FDataField + else + Result := inherited DataField; +end; + +function TcxDBDataSummaryItem.IsCurrency(AVarType: TVarType): Boolean; +begin + Result := inherited IsCurrency(AVarType); + if (DataField <> nil) and + (DataController.DBFields[DataField.Index].Field <> nil) then + Result := DataController.DBFields[DataField.Index].IsCurrency; +end; + +function TcxDBDataSummaryItem.GetDBDataController: TcxDBDataController; +begin + Result := inherited DataController as TcxDBDataController; +end; + +procedure TcxDBDataSummaryItem.SetFieldName(const Value: string); +begin + if FFieldName <> Value then + begin + FFieldName := Value; + DataController.UpdateInternalKeyFields(FFieldName, FDataField); + end; +end; + +{ TcxDBDataController } + +constructor TcxDBDataController.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FDataModeController := TcxDBDataModeController.Create(Self); +end; + +destructor TcxDBDataController.Destroy; +begin + Destroying; // for CLR + ClearMasterDetailKeyFields; + RemoveKeyField; + FDataModeController.Free; + FDataModeController := nil; + inherited Destroy; +end; + +procedure TcxDBDataController.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxDBDataController then + begin + DataModeController := TcxDBDataController(Source).DataModeController; + DataSource := TcxDBDataController(Source).DataSource; + KeyFieldNames := TcxDBDataController(Source).KeyFieldNames; + DetailKeyFieldNames := TcxDBDataController(Source).DetailKeyFieldNames; + MasterKeyFieldNames := TcxDBDataController(Source).MasterKeyFieldNames; + OnDetailHasChildren := TcxDBDataController(Source).OnDetailHasChildren; + end; +end; + +function TcxDBDataController.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action) or Provider.DataLink.ExecuteAction(Action); +end; + +function TcxDBDataController.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action) or Provider.DataLink.UpdateAction(Action); +end; + +function TcxDBDataController.CanChangeDetailExpanding(ARecordIndex: Integer; + AExpanded: Boolean): Boolean; +begin + if IsGridMode and AExpanded then + begin + ChangeFocusedRecordIndex(ARecordIndex); + if FocusedRecordIndex <> ARecordIndex then // scroll by + begin + ChangeFocusedRecordIndex(ARecordIndex); + if FocusedRecordIndex <> ARecordIndex then + begin + Result := False; + Exit; + end; + end; + end; + Result := inherited CanChangeDetailExpanding(ARecordIndex, AExpanded); +end; + +function TcxDBDataController.CanFocusRecord(ARecordIndex: Integer): Boolean; +var + AInResetDataSetCurrent: Boolean; +begin + if (Provider.IsInserting and (ARecordIndex = Provider.EditingRecordIndex)) or + (UseNewItemRowForEditing and (ARecordIndex < 0)) then + begin + if not Provider.IsInserting and (ARecordIndex < 0) then + Post; + Result := True; + Exit; + end; + Provider.BeginLocate; + try + AInResetDataSetCurrent := False; + if IsDetailMode and DataModeController.DetailInSyncMode then + begin + if FInResetDataSetCurrent then + AInResetDataSetCurrent := True + else + CheckCurrentQuery; + end; + if not AInResetDataSetCurrent and Provider.IsSyncMode then + Result := TryFocusRecord(ARecordIndex) + else + Result := inherited CanFocusRecord(ARecordIndex); + finally + Provider.EndLocate; + end; + SyncMasterPos; +end; + +procedure TcxDBDataController.CheckDataSetCurrent; +begin + if FocusedRecordIndex <> -1 then + begin + FInResetDataSetCurrent := True; + try + Provider.IsDataSetCurrent := True; + finally + FInResetDataSetCurrent := False; + end; + end; +end; + +function TcxDBDataController.CheckMasterBrowseMode: Boolean; +var + AMasterRelation: TcxDBDataRelation; + AMasterDataController: TcxDBDataController; + ADataController: TcxDBDataController; + ALink, AMasterLink: TcxDataListenerLink; +begin + if FInResetDataSetCurrent then + begin + Result := True; + Exit; + end; + AMasterRelation := GetMasterRelation as TcxDBDataRelation; + if AMasterRelation <> nil then + begin + Result := False; + AMasterDataController := AMasterRelation.DataController; + if AMasterDataController.CheckMasterBrowseMode then + begin + ADataController := Self; + ALink := AddListenerLink(ADataController); + AMasterLink := AddListenerLink(AMasterDataController); + try + AMasterDataController.CheckBrowseMode; + if ALink.Ref <> nil then + begin + ADataController.CheckBrowseMode; + if (ALink.Ref <> nil) and (AMasterLink.Ref <> nil) then + Result := True; + end; + finally + RemoveListenerLink(AMasterLink); + RemoveListenerLink(ALink); + end; + end; + end + else + Result := True; +end; + +procedure TcxDBDataController.ClearMasterDetailKeyFields; +begin + FMasterDetailKeyFields.Free; + FMasterDetailKeyFields := nil; +end; + +procedure TcxDBDataController.CorrectAfterDelete(ARecordIndex: Integer); +begin + inherited CorrectAfterDelete(ARecordIndex); + if Provider.FUpdatingRecordIndex = ARecordIndex then + Provider.ResetSmartRefresh; + if Provider.FUpdatingPrevFocusedRecordIndex = ARecordIndex then + Provider.FUpdatingPrevFocusedRecordIndex := -1; +end; + +procedure TcxDBDataController.DoDataSetCurrentChanged(AIsCurrent: Boolean); +begin +end; + +procedure TcxDBDataController.DoDataSourceChanged; +begin +end; + +procedure TcxDBDataController.DoInitInsertingRecord(AInsertingRecordIndex: Integer); +begin +end; + +function TcxDBDataController.DoSearchInGridMode(const ASubText: string; + AForward, ANext: Boolean): Boolean; +begin + Search.Lock; + try + Result := Provider.DoLocate(ASubText, AForward, ANext); + finally + Search.Unlock; + end; +end; + +function TcxDBDataController.FindRecordIndexInGridMode(const AKeyFieldValues: Variant): Integer; +var + AFieldList: TList; + I: Integer; +begin + Result := -1; + AFieldList := TList.Create; + try + GetKeyFields(AFieldList); + for I := 0 to RecordCount - 1 do + begin + if VarEquals(GetInternalRecordId(I, AFieldList), AKeyFieldValues) then + begin + Result := I; + Break; + end; + end; + finally + AFieldList.Free; + end; +end; + +procedure TcxDBDataController.DoUpdateRecord(ARecordIndex: Integer); +var + AValueDefReader: TcxValueDefReader; +begin + AValueDefReader := Provider.GetValueDefReaderClass.Create; + try + DataStorage.ReadRecord(ARecordIndex, AValueDefReader); + DoReadRecord(ARecordIndex); + finally + AValueDefReader.Free; + end; + if not Provider.FInCanInitEditing then + Change([dccUpdateRecord]); +end; + +function TcxDBDataController.GetActiveRecordIndex: Integer; +begin + if IsGridMode then + Result := Provider.DataLink.ActiveRecord + else + Result := inherited GetActiveRecordIndex; +end; + +function TcxDBDataController.GetDataProviderClass: TcxCustomDataProviderClass; +begin + Result := TcxDBDataProvider; +end; + +function TcxDBDataController.GetDataSelectionClass: TcxDataSelectionClass; +begin + Result := TcxDBDataSelection; +end; + +function TcxDBDataController.GetDefaultGridModeBufferCount: Integer; +begin + Result := 100; +end; + +function TcxDBDataController.GetFieldClass: TcxCustomDataFieldClass; +begin + Result := TcxDBDataField; +end; + +function TcxDBDataController.GetFilterCriteriaClass: TcxDataFilterCriteriaClass; +begin + Result := TcxDBDataFilterCriteria; +end; + +procedure TcxDBDataController.UpdateEditingRecord; +begin + if Provider.EditingRecordIndex = cxNullEditingRecordIndex then Exit; + Provider.FUpdatingRecordIndex := Provider.EditingRecordIndex; + Provider.FUpdatingRecordIsInserting := Provider.IsInserting; + DoUpdateRecord(Provider.EditingRecordIndex); +end; + +procedure TcxDBDataController.UpdateField(ADataField: TcxDBDataField; const AFieldNames: string; AIsLookup: Boolean); + + function CheckExistField(const AFieldName: string): Boolean; + var + I: Integer; + ACurrentField: TcxDBDataField; + APrevValueTypeClass: TcxValueTypeClass; + begin + APrevValueTypeClass := ADataField.ValueTypeClass; + ADataField.ReferenceField := nil; + Result := False; + if ADataField.FieldName = '' then + ADataField.ValueTypeClass := nil + else + begin + for I := 0 to Fields.Count - 1 do + begin + ACurrentField := DBFields[I]; + if ACurrentField <> ADataField then + begin + if IsEqualFieldNames(ACurrentField.FieldName, ADataField.FieldName) then + begin + ADataField.ReferenceField := ACurrentField; + Result := True; + Break; + end; + end; + end; + end; + if (ADataField.ValueTypeClass <> APrevValueTypeClass) and not ADataField.IsInternal then + DoValueTypeClassChanged(ADataField.Index); + end; + +var + APos: Integer; + ASubDataField: TcxDBDataField; +begin + ADataField.ClearFields; + if not AIsLookup then + begin + if ADataField.FieldName <> AFieldNames then + Fields.ReassignFields(ADataField); + ADataField.FieldName := AFieldNames; + end; + if AIsLookup or IsMultipleFieldNames(AFieldNames) then + begin + BeginUpdate; + try + ADataField.ReferenceField := nil; + APos := 1; + while APos <= Length(AFieldNames) do + begin + ASubDataField := AddInternalDBField; + ADataField.AddField(ASubDataField); + {$WARNINGS OFF} + UpdateField(ASubDataField, ExtractFieldName(AFieldNames, APos), False); + {$WARNINGS ON} + end; + finally + EndUpdate; + end; + end + else + begin + if CheckExistField(AFieldNames) then + Change([dccData]) + else + LayoutChanged([lcStructure]); + end; +end; + +procedure TcxDBDataController.ChangeFieldName(AItemIndex: Integer; const AFieldName: string); +begin + CheckItemRange(AItemIndex); + if GetItemFieldName(AItemIndex) <> AFieldName then + UpdateField(DBFields[AItemIndex], AFieldName, False); +end; + +function TcxDBDataController.GetItemByFieldName(const AFieldName: string): TObject; +var + I: Integer; +begin + Result := nil; + for I := 0 to ItemCount - 1 do + if AnsiCompareText(GetItemFieldName(I), AFieldName) = 0 then + begin + Result := GetItem(I); + Break; + end; +end; + +function TcxDBDataController.GetItemField(AItemIndex: Integer): TField; +begin + CheckItemRange(AItemIndex); + Result := DBFields[AItemIndex].Field; +end; + +function TcxDBDataController.GetItemFieldName(AItemIndex: Integer): string; +begin + CheckItemRange(AItemIndex); + Result := DBFields[AItemIndex].FieldName; +end; + +function TcxDBDataController.IsDisplayFormatDefined(AItemIndex: Integer; + AIgnoreSimpleCurrency: Boolean): Boolean; +begin + Result := inherited IsDisplayFormatDefined(AItemIndex, AIgnoreSimpleCurrency); + if Result and AIgnoreSimpleCurrency and (GetItemField(AItemIndex) <> nil) and + IsSimpleCurrencyField(GetItemField(AItemIndex)) then + Result := False; +end; + +procedure TcxDBDataController.Loaded; +begin + if not FLoaded and Provider.IsActiveDataSet then + LayoutChanged([lcStructure]); + inherited; + FLoaded := True; +end; + +procedure TcxDBDataController.BeginLocate; +begin + Provider.BeginLocate; +end; + +procedure TcxDBDataController.EndLocate; +begin + Provider.EndLocate; +end; + +function TcxDBDataController.GetGroupValue(ARecordIndex: Integer; AField: TcxCustomDataField): Variant; +var + ADBField: TcxDBDataField; + I: Integer; + V: array of Variant; +begin + ADBField := AField as TcxDBDataField; + if ADBField.IsLookup then + begin + if ADBField.FieldCount = 1 then + Result := inherited GetGroupValue(ARecordIndex, ADBField[0]) + else + begin + SetLength(V, ADBField.FieldCount); + for I := 0 to ADBField.FieldCount - 1 do + V[I] := inherited GetGroupValue(ARecordIndex, ADBField[I]); + Result := V; + end; + end + else + Result := inherited GetGroupValue(ARecordIndex, AField); +end; + +procedure TcxDBDataController.GetKeyDBFields(AList: TList); +var + I: Integer; +begin + GetKeyFields(AList); + for I := 0 to AList.Count - 1 do + begin + AList[I] := TcxDBDataField(AList[I]).Field; + if AList[I] = nil then + InvalidOperation(cxSDBKeyFieldNotFound); + end; +end; + +function TcxDBDataController.GetKeyFieldsValues: Variant; +var + AKeyFields: TList; +begin + AKeyFields := TList.Create; + try + GetKeyDBFields(AKeyFields); + Result := GetDataSetValues(DataSet, AKeyFields); + finally + AKeyFields.Free; + end; +end; + +function TcxDBDataController.GetRecordId(ARecordIndex: Integer): Variant; +var + AList: TList; +begin + CheckRecordRange(ARecordIndex); + AList := TList.Create; + try + GetKeyFields(AList); + Result := GetInternalRecordId(ARecordIndex, AList); + finally + AList.Free; + end; +end; + +procedure TcxDBDataController.UpdateGridModeBufferCount; +begin + if IsGridMode then + begin + FInUpdateGridModeBufferCount := True; + try + Provider.UpdateGridMode; + finally + FInUpdateGridModeBufferCount := False; + end; + end; +end; + +procedure TcxDBDataController.CheckBrowseMode; +begin + FInCheckBrowseMode := True; + try + if Assigned(DataSet) then + begin +// if IsSmartRefresh or IsDetaimMOde then // !!! + if True then // !!! + begin + if DataSet.State <> dsInactive then + TDataSetAccess(DataSet).DataEvent(deCheckBrowseMode, 0); + if DataSet.State in [dsEdit, dsInsert] then + begin + DataSet.UpdateRecord; + if Provider.IsDataSetModified {DataSet.Modified} then + begin + if not IsSmartRefresh and not IsGridMode then + DataSet.DisableControls; // support AfterPost Requery + try + DataSet.Post; + finally + if not IsSmartRefresh and not IsGridMode then + DataSet.EnableControls; + end; + end + else + Cancel; + end; + end + else + DataSet.CheckBrowseMode; + end; + CheckDetailsBrowseMode; + finally + FInCheckBrowseMode := False; + end; +end; + +function TcxDBDataController.DataChangedNotifyLocked: Boolean; +begin + Result := inherited DataChangedNotifyLocked; + if not Result and IsGridMode and Assigned(DataSet) and + (DataSet.State = dsInsert) then + Result := True; +end; + +procedure TcxDBDataController.RefreshExternalData; +begin + if Assigned(DataSet) then + DataSet.Refresh; +end; + +procedure TcxDBDataController.SetFocus; +begin + if IsDetailMode and DataModeController.DetailInSyncMode then + CheckCurrentQuery; +end; + +function TcxDBDataController.IsBookmarkAvailable: Boolean; +begin + if IsGridMode then + Result := FBookmark <> '' + else + Result := inherited IsBookmarkAvailable; +end; + +function TcxDBDataController.IsBookmarkRow(ARowIndex: Integer): Boolean; +var + ABookmark: TBookmarkStr; +begin + if IsGridMode then + begin + Result := False; + if IsBookmarkAvailable and Assigned(DataSet) then + begin + ABookmark := DBSelection.GetRowBookmark(ARowIndex); + if Provider.CompareBookmarks(FBookmark, ABookmark) = 0 then + Result := True; + end; + end + else + Result := inherited IsBookmarkRow(ARowIndex); +end; + +function TcxDBDataController.GetFilterDataValue(ARecordIndex: Integer; AField: TcxCustomDataField): Variant; +var + ADBField: TcxDBDataField; + I, AFieldCount: Integer; +begin + ADBField := AField as TcxDBDataField; + if Assigned(ADBField) and ADBField.IsLookup then + begin + AFieldCount := ADBField.FieldCount; + if AFieldCount > 0 then + begin + if AFieldCount = 1 then + Result := GetFilterDataValue(ARecordIndex, ADBField[0]) + else + begin + // Multiply Lookup Keys + Result := VarArrayCreate([0, AFieldCount - 1], varVariant); + for I := 0 to AFieldCount - 1 do + Result[I] := GetFilterDataValue(ARecordIndex, ADBField[I]); + end; + end + else + Result := Null; + end + else + Result := inherited GetFilterDataValue(ARecordIndex, AField); +end; + +function TcxDBDataController.GetFilterItemFieldName(AItem: TObject): string; +var + ADBField: TcxDBDataField; + I, AFieldCount: Integer; +begin + Result := ''; + ADBField := Fields.FieldByItem(AItem) as TcxDBDataField; + if Assigned(ADBField) then + if Assigned(ADBField.Field) then + if ADBField.IsLookup then + begin + AFieldCount := ADBField.FieldCount; + if ADBField.FieldCount > 0 then + if AFieldCount = 1 then + Result := GetFilterFieldName(ADBField[0].Field, Filter.IgnoreOrigin) + else + begin + // Multiply Lookup Keys + Result := GetFilterFieldName(ADBField[0].Field, Filter.IgnoreOrigin); + for I := 1 to AFieldCount - 1 do + Result := Result + ';' + GetFilterFieldName(ADBField[I].Field, Filter.IgnoreOrigin); + end + else + Result := ''; + end + else + Result := GetFilterFieldName(ADBField.Field, Filter.IgnoreOrigin) + else + Result := ADBField.FieldName; +end; + +function TcxDBDataController.FindRecordIndexByKey(const AKeyFieldValues: Variant): Integer; + + function GetVarArrayElementCount(const AVarArray: Variant): Integer; + begin + Result := VarArrayHighBound(AVarArray, 1) - VarArrayLowBound(AVarArray, 1) + 1; + end; + +var + ALocateObject: TcxDataControllerKeyLocateObject; + AValueDefReader: TcxValueDefUnboundReader; + I: Integer; +begin + if IsGridMode then + Result := FindRecordIndexInGridMode(AKeyFieldValues) + else + begin + ALocateObject := TcxDataControllerKeyLocateObject.Create(Self); + try + AValueDefReader := TcxValueDefUnboundReader.Create; + try + GetKeyFields(ALocateObject.FieldList); + if (ALocateObject.FieldList.Count = 1) and VarIsArray(AKeyFieldValues) or + (ALocateObject.FieldList.Count <> 1) and (not VarIsArray(AKeyFieldValues) or (GetVarArrayElementCount(AKeyFieldValues) < ALocateObject.FieldList.Count)) then + begin + Result := -1; + Exit; + end; + if ALocateObject.FieldList.Count = 1 then + AValueDefReader.SetValue(TcxDBDataField(ALocateObject.FieldList[0]).ValueDef, AKeyFieldValues) + else + begin + for I := 0 to ALocateObject.FieldList.Count - 1 do + AValueDefReader.SetValue(TcxDBDataField(ALocateObject.FieldList[I]).ValueDef, AKeyFieldValues[I]); + end; + ALocateObject.ReadData(AValueDefReader); + Result := ALocateObject.FindRecordIndex; + finally + AValueDefReader.Free; + end; + finally + ALocateObject.Free; + end; + end; +end; + +function TcxDBDataController.LocateByKey(const AKeyFieldValues: Variant): Boolean; + + function TryLocateInGridMode: Boolean; + begin + Result := False; + BeginLocate; + try + if DataSet <> nil then + Result := CanCallDataSetLocate(DataSet, KeyFieldNames, AKeyFieldValues) and + DataSet.Locate(KeyFieldNames, AKeyFieldValues, []); + finally + EndLocate; + end; + end; + +var + ARecordIndex, ARowIndex: Integer; +begin + ARecordIndex := FindRecordIndexByKey(AKeyFieldValues); + if (ARecordIndex = -1) and IsGridMode then + begin + Result := TryLocateInGridMode; + if Result then + SyncSelected(True); + Exit; + end; + ARowIndex := -1; + if ARecordIndex <> -1 then + ARowIndex := GetRowIndexByRecordIndex(ARecordIndex, True); + ChangeFocusedRowIndex(ARowIndex); + Result := ARowIndex <> -1; +end; + +procedure TcxDBDataController.CheckCurrentQuery; +begin + if DataModeController.DetailInSQLMode and + not DataModeController.DetailIsCurrentQuery(MasterDetailKeyFieldNames, + MasterDetailKeyValues) then + with Provider do + begin + Freeze; + FInCheckCurrentQuery := True; + try + First; + SavePos; + RestorePos; + FRecordIndex := 0; + finally + Unfreeze; + FInCheckCurrentQuery := False; + end; + end; +end; + +function TcxDBDataController.GetDetailFilterAdapter: TcxDBProviderDetailFilterAdapter; +var + AIndex: Integer; +begin + if cxDetailFilterControllers.FindAdapter(TDataSetClass(DataSet.ClassType), AIndex) then + Result := cxDetailFilterControllers[AIndex] as TcxDBProviderDetailFilterAdapter + else + begin + Result := nil; + InvalidOperation(cxSDBDetailFilterControllerNotFound); + end; +end; + +procedure TcxDBDataController.SetMasterRelation(AMasterRelation: TcxCustomDataRelation; + AMasterRecordIndex: Integer); +var + ARelation: TcxDBDataRelation; +begin + BeginUpdate; + try + inherited SetMasterRelation(AMasterRelation, AMasterRecordIndex); + if (AMasterRelation <> nil) and (AMasterRecordIndex <> -1) and + (AMasterRelation is TcxDBDataRelation) then + begin + ARelation := AMasterRelation as TcxDBDataRelation; + FMasterDetailKeyValues := ARelation.GetMasterRecordID(AMasterRecordIndex); + LayoutChanged([lcData]); + end; + finally + EndUpdate; + end; +end; + +function TcxDBDataController.GetRowId(ARowIndex: Integer): Variant; +begin + if not IsGridMode or (ARowIndex < 0) then + Result := inherited GetRowId(ARowIndex) + else + Result := DBSelection.GetRowBookmark(ARowIndex) +end; + +function TcxDBDataController.GetSelectedBookmark(Index: Integer): TBookmarkStr; +begin + if not IsGridMode then InvalidOperation(cxSDBNotInGridMode); + if IsFocusedSelectedMode then + Result := DBSelection.GetRowBookmark(FocusedRowIndex) + else + Result := DBSelection.FBookmarks[Index]; +end; + +function TcxDBDataController.GetSelectedRowIndex(Index: Integer): Integer; +var + ASelection: TcxDBDataSelection; + I, ARowCount: Integer; + ABookmark: TBookmarkStr; +begin + if not IsGridMode or IsFocusedSelectedMode then + Result := inherited GetSelectedRowIndex(Index) + else + begin + Result := -1; + ASelection := DBSelection; + ARowCount := GetRowCount; + ABookmark := ASelection.FBookmarks[Index]; +// bug in BDEDataSet.CachedUpdates mode + if (ASelection.CompareBookmarks(ASelection.GetRowBookmark(0), ABookmark) <= 0) and + (ASelection.CompareBookmarks(ABookmark, ASelection.GetRowBookmark(ARowCount - 1)) <= 0) then + begin + for I := 0 to ARowCount - 1 do + if ASelection.CompareBookmarks(ASelection.GetRowBookmark(I), ABookmark) = 0 then + begin + Result := I; + Break; + end; + end; + end; +end; + +function TcxDBDataController.GetSelectionAnchorBookmark: TBookmarkStr; +begin + if not IsGridMode then InvalidOperation(cxSDBNotInGridMode); + Result := DBSelection.FAnchorBookmark; +end; + +function TcxDBDataController.GetSelectionAnchorRowIndex: Integer; +begin + if not IsGridMode then + Result := inherited GetSelectionAnchorRowIndex + else + Result := -1; +end; + +function TcxDBDataController.IsSelectionAnchorExist: Boolean; +begin + if not IsGridMode then + Result := inherited IsSelectionAnchorExist + else + Result := GetSelectionAnchorBookmark <> ''; +end; + +procedure TcxDBDataController.SelectAll; +begin + if not IsGridMode then + inherited SelectAll + else + DBSelection.SelectAll; +end; + +procedure TcxDBDataController.SelectFromAnchor(ARowIndex: Integer; AKeepSelection: Boolean); +var + ASelectionAnchorBookmark: TBookmarkStr; + ASelection: TcxDBDataSelection; +begin + if not IsGridMode then + inherited SelectFromAnchor(ARowIndex, AKeepSelection) + else + begin + DataControllerInfo.CheckRowIndex(ARowIndex); + ASelectionAnchorBookmark := GetSelectionAnchorBookmark; + if ASelectionAnchorBookmark <> '' then + begin + ASelection := DBSelection; + ASelection.SelectFromAnchor(ASelection.GetRowBookmark(ARowIndex), AKeepSelection); + end; + end; +end; + +procedure TcxDBDataController.SetSelectionAnchor(ARowIndex: Integer); +var + ASelection: TcxDBDataSelection; +begin + if not IsGridMode then + inherited SetSelectionAnchor(ARowIndex) + else + begin + DataControllerInfo.CheckRowIndex(ARowIndex); + ASelection := DBSelection; + ASelection.FAnchorBookmark := ASelection.GetRowBookmark(ARowIndex); + end; +end; + +function TcxDBDataController.FocusSelectedRow(ASelectedIndex: Integer): Boolean; +begin + Result := False; + if Assigned(DataSet) then // DataSet_BookmarkAvailable + begin + DataSet.Bookmark := GetSelectedBookmark(ASelectedIndex); + Result := True; + end; +end; + +procedure TcxDBDataController.ForEachRow(ASelectedRows: Boolean; AProc: TcxDataControllerEachRowProc); + + procedure DoProc; + var + ARowIndex: Integer; + begin + ARowIndex := GetFocusedRowIndex; + AProc(ARowIndex, GetRowInfo(ARowIndex)); + end; + +var + I: Integer; +begin + if not IsGridMode then + inherited ForEachRow(ASelectedRows, AProc) + else + if DataSet <> nil then + begin + if ASelectedRows then + begin + if IsFocusedSelectedMode then + DoProc + else + for I := 0 to GetSelectedCount - 1 do + begin + DataSet.Bookmark := GetSelectedBookmark(I); + DoProc; + end; + end + else + begin + DataSet.First; + while not DataSet.EOF do + begin + DoProc; + DataSet.Next; + end; + end; + end; +end; + +function TcxDBDataController.IsSequenced: Boolean; +begin + Result := Assigned(DataSet) and DataSet.IsSequenced; +end; + +procedure TcxDBDataController.ChangeValueTypeClass(AItemIndex: Integer; + AValueTypeClass: TcxValueTypeClass); +begin + CheckItemRange(AItemIndex); + if not Assigned(DBFields[AItemIndex].Field) then + inherited ChangeValueTypeClass(AItemIndex, AValueTypeClass); +end; + +procedure TcxDBDataController.GetKeyFields(AList: TList); +begin + GetInternalKeyFields(FKeyField, AList); +end; + +function TcxDBDataController.GetRelationClass: TcxCustomDataRelationClass; +begin + Result := TcxDBDataRelation; +end; + +function TcxDBDataController.GetSummaryItemClass: TcxDataSummaryItemClass; +begin + Result := TcxDBDataSummaryItem; +end; + +procedure TcxDBDataController.InvalidateDataBuffer; +begin + Change([dccLayout]); +end; + +function TcxDBDataController.InternalCheckBookmark(ADeletedRecordIndex: Integer): Boolean; +begin + if IsGridMode then + Result := not (Assigned(DataSet) and Provider.BookmarkValid(FBookmark)) + else + Result := inherited InternalCheckBookmark(ADeletedRecordIndex); +end; + +procedure TcxDBDataController.InternalClearBookmark; +begin + FBookmark := ''; + inherited InternalClearBookmark; +end; + +procedure TcxDBDataController.InternalGotoBookmark; +begin + if IsGridMode then + begin + if Assigned(DataSet) then + begin + DataSet.Bookmark := FBookmark; + CorrectPrevSelectionChangedInfo; + end; + end + else + inherited InternalGotoBookmark; +end; + +function TcxDBDataController.InternalSaveBookmark: Boolean; +var + ABookmark: TBookmarkStr; +begin + if IsGridMode then + begin + Result := False; + if Assigned(DataSet) then + begin + ABookmark := DataSet.Bookmark; + if (FBookmark = '') or + (Provider.CompareBookmarks(FBookmark, ABookmark) <> 0) then + FBookmark := ABookmark; + end; + end + else + Result := inherited InternalSaveBookmark; +end; + +function TcxDBDataController.IsDataField(AField: TcxCustomDataField): Boolean; +begin + Result := inherited IsDataField(AField) or + (TcxDBDataField(AField).Field <> nil); +end; + +function TcxDBDataController.IsKeyNavigation: Boolean; +begin + Result := (FKeyField <> nil) and not IsGridMode; +end; + +function TcxDBDataController.LocateRecordIndex(AGetFieldsProc: TGetListProc): Integer; +var + ALocateObject: TcxDataControllerKeyLocateObject; + AValueDefReader: TcxValueDefReader; +begin + ALocateObject := TcxDataControllerKeyLocateObject.Create(Self); + try + AGetFieldsProc(ALocateObject.FieldList); + AValueDefReader := Provider.GetValueDefReaderClass.Create; + try + ALocateObject.ReadData(AValueDefReader); + finally + AValueDefReader.Free; + end; + Result := ALocateObject.FindRecordIndex; + finally + ALocateObject.Free; + end; +end; + +function TcxDBDataController.LockOnAfterSummary: Boolean; +begin + Result := inherited LockOnAfterSummary or FInUpdateGridModeBufferCount or + ((DataSet <> nil) and not DataSet.Active and DataSet.DefaultFields and + ((Provider.ActiveChanging and FResetDBFields) or DataSet.ControlsDisabled)); + { + if not Result and IsGridMode and IsDetailMode and not IsPattern and + DataSet.Active then + begin + if not VarEquals(GetDataSetValues(DataSet, MasterDetailKeyFields), MasterDetailKeyValues) then + Result := True; + end; + } +end; + +procedure TcxDBDataController.NotifyDataControllers; +var + I: Integer; +begin + if Provider.FInNotify then Exit; + Provider.FInNotify := True; + try + for I := Provider.FListeners.Count - 1 downto 0 do + begin + TcxDBDataProvider(Provider.FListeners[I]).DataLink.DataSetChanged; + Provider.FListeners.Delete(I); + end; + finally + Provider.FInNotify := False; + end; +end; + +procedure TcxDBDataController.NotifyDetailAfterFieldsRecreating(ADataController: TcxCustomDataController); +var + ADBDataController: TcxDBDataController; +begin + if ADataController = FCreatedDataController then Exit; + ADBDataController := ADataController as TcxDBDataController; + ADBDataController.UpdateFields; + ADBDataController.Change([dccData]); // for Grid +end; + +procedure TcxDBDataController.NotifyDetailsAfterFieldsRecreating(ACreatingLinkObject: Boolean); +begin + if ACreatingLinkObject then + FCreatedDataController := Self + else + FCreatedDataController := nil; + ForEachDetail(GetMasterRelation, NotifyDetailAfterFieldsRecreating); +end; + +procedure TcxDBDataController.PrepareField(AField: TcxCustomDataField); +begin + inherited PrepareField(AField); + RetrieveField(AField as TcxDBDataField, False); +end; + +procedure TcxDBDataController.RemoveNotification(AComponent: TComponent); +begin + inherited RemoveNotification(AComponent); + MasterDetailKeyFieldsRemoveNotification(AComponent); +end; + +procedure TcxDBDataController.ResetDataSetCurrent(ADataController: TcxCustomDataController); +var + ADBDataController: TcxDBDataController; +begin + ADBDataController := ADataController as TcxDBDataController; + if ADBDataController.FInResetDataSetCurrent then Exit; + ADBDataController.FInResetDataSetCurrent := True; + try + ADBDataController.Provider.IsDataSetCurrent := False; + ADBDataController.ChangeFocusedRecordIndex(-1); + finally + ADBDataController.FInResetDataSetCurrent := False; + end; +end; + +procedure TcxDBDataController.ResetDBFields; +begin + FResetDBFields := True; + try + UpdateFields; + finally + FResetDBFields := False; + end; +end; + +procedure TcxDBDataController.RestructData; +begin + if not IsGridMode then + Provider.DataLink.BufferCount := 1; + inherited RestructData; +end; + +procedure TcxDBDataController.ResyncDBFields; +begin + UpdateFields; +end; + +function TcxDBDataController.IsOtherDetailChanged: Boolean; +begin + Result := IsDetailMode and DataModeController.DetailInSQLMode and + (not DataModeController.DetailInSyncMode or + (not Provider.IsDataSetCurrent and not VarIsEmpty(MasterDetailKeyValues) and + not VarEquals(GetDataSetValues(DataSet, MasterDetailKeyFields), MasterDetailKeyValues)) + ); +end; + +function TcxDBDataController.IsOtherDetailCreating: Boolean; +var + I: Integer; + ADBDataProvider: TcxDBDataProvider; +begin + Result := False; + for I := 0 to DBDataProviders.Count - 1 do + begin + ADBDataProvider := TcxDBDataProvider(DBDataProviders[I]); + if {(ADBDataProvider <> Provider) and} + (ADBDataProvider.DataSet = Provider.DataSet) then + begin + if ADBDataProvider.DataController.FInCheckCurrentQuery or + ((ADBDataProvider.DataController.GetMasterDataController <> nil) and + ADBDataProvider.DataController.GetMasterDataController.IsCreatingLinkObject) then + begin + Result := True; + Break; + end; + end; + end; +end; + +function TcxDBDataController.IsProviderDataSource: Boolean; +begin + Result := True; +end; + +function TcxDBDataController.IsSmartRefresh: Boolean; +begin + Result := Provider.IsSmartRefresh; +end; + +procedure TcxDBDataController.LoadStorage; +begin + SaveKeys; + try + inherited LoadStorage; + Provider.ResetPostLocateFlag; + finally + RestoreKeys; + end; +end; + +procedure TcxDBDataController.RetrieveField(ADataField: TcxDBDataField; AIsLookupKeyOnly: Boolean); + + function IsLookupKeyField(ADataField: TcxDBDataField): Boolean; + begin + Result := Assigned(ADataField.ParentField) and Assigned(ADataField.ParentField.Field) and + ADataField.ParentField.Field.Lookup; + end; + +var + APrevField: TField; +begin + if Assigned(ADataField.ReferenceField) then Exit; + if AIsLookupKeyOnly and not IsLookupKeyField(ADataField) then Exit; + if Assigned(Provider.DataSet) then + begin + APrevField := ADataField.Field; + if not FResetDBFields then + begin + ADataField.Field := Provider.DataSet.Fields.FindField(ADataField.FieldName); + if ADataField.Field = nil then + ADataField.Field := Provider.DataSet.AggFields.FindField(ADataField.FieldName); + end + else + ADataField.Field := nil; + if Assigned(ADataField.Field) then + begin + if (ADataField.Field = APrevField) and IsOtherDetailCreating then + Exit; + ADataField.SetPropertiesByField(ADataField.Field, ADataField.Field <> APrevField); + if ADataField.Field.Lookup then + UpdateField(ADataField, ADataField.Field.KeyFields, True); + end + else + ADataField.DoPropertiesChanged; + end; +end; + +function TcxDBDataController.TryFocusRecord(ARecordIndex: Integer): Boolean; +var + ARecordId: Variant; +begin + if ARecordIndex < 0 then + Result := False + else + begin + if IsKeyNavigation then + begin + // check Equals before Locate + ARecordId := GetRecordId(ARecordIndex); + if VarEquals(ARecordId, GetKeyFieldsValues) and + (Provider.FRecordIndex = ARecordIndex) then + begin + CheckBrowseMode; // !!!!! + Result := True; + end + else + begin + CheckBrowseMode; // !!!!! + Result := Provider.DataSet.Locate(KeyFieldNames, ARecordId, []); + end; +// Result := (VarEquals(ARecordId, GetKeyFieldsValues) and (Provider.FRecordIndex = ARecordIndex)) or +// Provider.DataSet.Locate(KeyFieldNames, GetRecordId(ARecordIndex), []); + end + else + begin + CheckBrowseMode; // !!!!! + Provider.MoveBy(ARecordIndex - Provider.FRecordIndex); + Result := True; + end; + end; +end; + +function TcxDBDataController.AddInternalDBField: TcxDBDataField; +begin + Result := AddInternalField as TcxDBDataField; +end; + +procedure TcxDBDataController.UpdateFields; +begin + inherited UpdateFields; + UpdateLookupFields; +end; + +procedure TcxDBDataController.UpdateFocused; +begin + BeginUpdate; + try + inherited UpdateFocused; + if Provider.IsSyncMode then + SyncDataSetPos; + finally + EndUpdate; + end; +end; + +procedure TcxDBDataController.UpdateInternalKeyFields(const AFieldNames: string; + var AField: TcxDBDataField); +begin + if AFieldNames = '' then + begin + AField.Free; + AField := nil; + Change([dccData]); + end + else + begin + if AField = nil then + AField := AddInternalDBField; + UpdateField(AField, AFieldNames, False); + end; +end; + +procedure TcxDBDataController.UpdateLookupFields; +var + I: Integer; +begin + for I := 0 to Fields.Count - 1 do + RetrieveField(DBFields[I], True); +end; + +procedure TcxDBDataController.UpdateRelations(ARelation: TcxCustomDataRelation); +begin + inherited UpdateRelations(ARelation); + UpdateRelationFields; +end; + +procedure TcxDBDataController.UpdateScrollBars; +begin +end; + +procedure TcxDBDataController.BeginReadRecord; +begin + FInUnboundCopy := True; +end; + +procedure TcxDBDataController.EndReadRecord; +begin + FInUnboundCopy := False; +end; + +function TcxDBDataController.GetDataSet: TDataSet; +begin + Result := Provider.DataSet; +end; + +function TcxDBDataController.GetDataSetRecordCount: Integer; +begin + if Assigned(DataSet) and DataSet.Active then + Result := DataSet.RecordCount + else + Result := 0; +end; + +function TcxDBDataController.GetDataSource: TDataSource; +begin + Result := Provider.DataSource; +end; + +function TcxDBDataController.GetDBField(Index: Integer): TcxDBDataField; +begin + Result := Fields[Index] as TcxDBDataField; +end; + +function TcxDBDataController.GetDBSelection: TcxDBDataSelection; +begin + Result := DataControllerInfo.Selection as TcxDBDataSelection; +end; + +function TcxDBDataController.GetFilter: TcxDBDataFilterCriteria; +begin + Result := inherited Filter as TcxDBDataFilterCriteria; +end; + +function TcxDBDataController.GetMasterDetailKeyFieldNames: string; +begin + if MasterKeyFieldNames <> '' then + Result := DetailKeyFieldNames + else + Result := ''; +end; + +function TcxDBDataController.GetMasterDetailKeyFields: TList; +var + I: Integer; +begin + if FMasterDetailKeyFields = nil then + begin + FMasterDetailKeyFields := TList.Create; + if Assigned(Provider.DataSet) then + begin + Provider.DataSet.GetFieldList(FMasterDetailKeyFields, MasterDetailKeyFieldNames); + for I := 0 to FMasterDetailKeyFields.Count - 1 do + if FMasterDetailKeyFields[I] <> nil then + TField(FMasterDetailKeyFields[I]).FreeNotification(Notifier); + end; + end; + Result := FMasterDetailKeyFields; +end; + +function TcxDBDataController.GetProvider: TcxDBDataProvider; +begin + Result := inherited Provider as TcxDBDataProvider; +end; + +function TcxDBDataController.GetRecNo: Integer; +begin + if DataSet.Active then + Result := DataSet.RecNo + else + Result := -1; +end; + +procedure TcxDBDataController.MasterDetailKeyFieldsRemoveNotification(AComponent: TComponent); +begin + if Assigned(FMasterDetailKeyFields) and + (FMasterDetailKeyFields.IndexOf(AComponent) <> -1) then + ClearMasterDetailKeyFields; +end; + +procedure TcxDBDataController.RemoveKeyField; +begin + FKeyField.Free; + FKeyField := nil; +end; + +procedure TcxDBDataController.SetDataModeController(Value: TcxDBDataModeController); +begin + FDataModeController.Assign(Value); +end; + +procedure TcxDBDataController.SetDataSource(Value: TDataSource); +var + APrevDataSource: TDataSource; +begin + APrevDataSource := DataSource; + Provider.DataSource := Value; + if DataSource <> APrevDataSource then + DoDataSourceChanged; +end; + +procedure TcxDBDataController.SetDetailKeyFieldNames(const Value: string); +begin + if FDetailKeyFieldNames <> Value then + begin + FDetailKeyFieldNames := Value; + if GetMasterRelation <> nil then + (GetMasterRelation as TcxDBDataRelation).UpdateMasterDetailKeyFieldNames; + end; +end; + +procedure TcxDBDataController.SetFilter(Value: TcxDBDataFilterCriteria); +begin + inherited Filter := Value; +end; + +procedure TcxDBDataController.SetKeyFieldNames(const Value: string); +begin + if FKeyFieldNames <> Value then + begin + FKeyFieldNames := Value; + UpdateInternalKeyFields(FKeyFieldNames, FKeyField); + end; +end; + +procedure TcxDBDataController.SetMasterKeyFieldNames(const Value: string); +begin + if FMasterKeyFieldNames <> Value then + begin + FMasterKeyFieldNames := Value; + if GetMasterRelation <> nil then + (GetMasterRelation as TcxDBDataRelation).UpdateMasterDetailKeyFieldNames; + end; +end; + +procedure TcxDBDataController.SetRecNo(Value: Integer); +begin + DataSet.RecNo := Value; +end; + +procedure TcxDBDataController.SyncDataSetPos; +var + APrevRecordIndex: Integer; +begin + if DetailMode = dcdmPattern then + begin + if not IsLoading and not Provider.ActiveChanging and not Provider.IsDataSetBusy then // !!! + SyncMasterDetailDataSetPos; + end + else + if IsKeyNavigation then + begin + APrevRecordIndex := Provider.FRecordIndex; + Provider.FRecordIndex := LocateRecordIndex(GetKeyFields); + if APrevRecordIndex <> Provider.FRecordIndex then + UpdateFocused; + end; +end; + +function TcxDBDataController.SyncMasterDetail: TcxCustomDataController; + + function ExpandDetails(ADataController: TcxCustomDataController; + ARelationIndex: Integer; const AMasterKeyValues: Variant): TcxCustomDataController; + var + ARowIndex, ARecordIndex, ACurRelationIndex: Integer; + ACurDetailDataController: TcxDBDataController; + ACurMasterRelation: TcxDBDataRelation; + ACurMasterDetailKeyValues: Variant; + begin + Result := nil; + ARowIndex := ADataController.GetFocusedRowIndex; + if ARowIndex <> -1 then + begin + ARecordIndex := ADataController.GetRowInfo(ARowIndex).RecordIndex; + ADataController.ChangeDetailExpanding(ARecordIndex, True); + if ADataController.GetDetailExpanding(ARecordIndex) then + begin + // Check current detail + ACurRelationIndex := ADataController.GetDetailActiveRelationIndex(ARecordIndex); + if ARelationIndex <> ACurRelationIndex then + begin + ACurDetailDataController := ADataController.GetDetailDataController(ARecordIndex, ACurRelationIndex) as TcxDBDataController; + ACurMasterRelation := ACurDetailDataController.GetMasterRelation as TcxDBDataRelation; + ACurMasterDetailKeyValues := ACurDetailDataController.Provider.DataSet.FieldValues[ACurMasterRelation.DetailKeyFieldNames]; + if VarEquals(AMasterKeyValues, ACurMasterDetailKeyValues) then + begin + Result := ACurDetailDataController; + Exit; + end; + end; + ADataController.ChangeDetailActiveRelationIndex(ARecordIndex, ARelationIndex); + Result := ADataController.GetDetailDataController(ARecordIndex, ARelationIndex) + end; + end; + end; + + function IsMastersInSyncMode(AMasterDataController: TcxDBDataController): Boolean; + var + AMasterRelation: TcxDBDataRelation; + begin + Result := AMasterDataController.Provider.IsSyncMode and + AMasterDataController.IsKeyNavigation and + not AMasterDataController.Provider.IsEditing; + if Result then + begin + AMasterRelation := AMasterDataController.GetMasterRelation as TcxDBDataRelation; + if AMasterRelation <> nil then + Result := IsMastersInSyncMode(AMasterRelation.DataController); + end; + end; + +var + AMasterRelation: TcxDBDataRelation; + AMasterDetailKeyValues, AMasterKeyValues: Variant; + AMasterDataController: TcxDBDataController; + ADataController: TcxCustomDataController; + AEqualFlag: Boolean; +begin + if (GetMasterRelation <> nil) and (MasterDetailKeyFieldNames <> '') then + begin + Result := nil; + if not (GetMasterRelation is TcxDBDataRelation) then Exit; + + AMasterRelation := GetMasterRelation as TcxDBDataRelation; + AMasterDataController := AMasterRelation.DataController; + + if Provider.IsSyncMode and IsMastersInSyncMode(AMasterDataController) and + not AMasterDataController.IsCreatingLinkObject then + begin + AMasterDataController.FUpdateDataSetPos := True; + try + AMasterDetailKeyValues := Provider.DataSet.FieldValues[AMasterRelation.DetailKeyFieldNames]; + AMasterKeyValues := AMasterDataController.Provider.DataSet.FieldValues[AMasterRelation.MasterKeyFieldNames]; + AEqualFlag := VarEquals(AMasterKeyValues, AMasterDetailKeyValues); + if not (AEqualFlag and AMasterDataController.FInFocusDetails) then // !!! + begin + if not AEqualFlag then + begin + AMasterDataController.Provider.BeginLocate; + try + AEqualFlag := AMasterDataController.Provider.DataSet.Locate(AMasterRelation.MasterKeyFieldNames, + AMasterDetailKeyValues, []); + finally + AMasterDataController.Provider.EndLocate; + end; + end; + if AEqualFlag then + begin + ADataController := AMasterDataController.SyncMasterDetail; + if ADataController <> nil then + Result := ExpandDetails(ADataController, AMasterRelation.Index, AMasterKeyValues); + SyncMasterPos; + end; + end; + finally + AMasterDataController.FUpdateDataSetPos := False; + end; + end; + end + else + Result := Self; +end; + +procedure TcxDBDataController.SyncMasterDetailDataSetPos; +begin + if FUpdateDataSetPos or FInCheckBrowseMode then Exit; + SyncMasterDetail; +end; + +procedure TcxDBDataController.UpdateRelationFields; +var + I: Integer; + AMasterKeyFieldNames: string; + AMasterKeyField: TcxDBDataField; +begin + for I := 0 to Relations.Count - 1 do + if Relations[I] is TcxDBDataRelation then + begin + AMasterKeyFieldNames := (Relations[I] as TcxDBDataRelation).MasterKeyFieldNames; + AMasterKeyField := (Relations[I] as TcxDBDataRelation).FMasterKeyField; + UpdateInternalKeyFields(AMasterKeyFieldNames, AMasterKeyField); + (Relations[I] as TcxDBDataRelation).FMasterKeyField := AMasterKeyField; + end; +end; + +initialization + cxDetailFilterControllers := TcxDBAdapterList.Create; + cxDetailFilterControllers.RegisterAdapter(TDataSet, TcxDBProviderDetailFilterAdapter); + +finalization + cxDetailFilterControllers.Free; + cxDetailFilterControllers := nil; + +end. diff --git a/official/x.35/ExpressDataController/Sources/cxDBFilter.pas b/official/x.35/ExpressDataController/Sources/cxDBFilter.pas new file mode 100644 index 00000000..a27572d8 --- /dev/null +++ b/official/x.35/ExpressDataController/Sources/cxDBFilter.pas @@ -0,0 +1,126 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDataController } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDATACONTROLLER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDBFilter; + +{$I cxVer.inc} + +interface + +uses + DB, cxFilter, cxDB; + +type + { TcxFilterSQLNullOperator } + + TcxFilterSQLNullOperator = class(TcxFilterNullOperator) + public + function FilterText: string; override; + end; + + { TcxFilterSQLNotNullOperator } + + TcxFilterSQLNotNullOperator = class(TcxFilterNotNullOperator) + public + function FilterText: string; override; + end; + + { TcxDBFilterOperatorAdapter } + + TcxDBFilterOperatorAdapter = class(TcxDBAdapterItem) + public + procedure PrepareOperatorClass(ASender: TObject; ADataSet: TDataSet; + var AOperatorClass: TcxFilterOperatorClass); virtual; + end; + +function cxGetFilterOperatorAdapter(ADataSet: TDataSet): TcxDBFilterOperatorAdapter; + +var + cxFilterOperatorAdapters: TcxDBAdapterList; + +implementation + +uses + SysUtils; + +function cxGetFilterOperatorAdapter(ADataSet: TDataSet): TcxDBFilterOperatorAdapter; +var + AIndex: Integer; +begin + if Assigned(ADataSet) and cxFilterOperatorAdapters.FindAdapter(TDataSetClass(ADataSet.ClassType), AIndex) then + Result := cxFilterOperatorAdapters[AIndex] as TcxDBFilterOperatorAdapter + else + Result := nil; +end; + +{ TcxFilterSQLNullOperator } + +function TcxFilterSQLNullOperator.FilterText: string; +begin + Result := 'IS'; +end; + +{ TcxFilterSQLNotNullOperator } + +function TcxFilterSQLNotNullOperator.FilterText: string; +begin + Result := 'IS NOT'; +end; + +{ TcxDBFilterOperatorAdapter } + +procedure TcxDBFilterOperatorAdapter.PrepareOperatorClass(ASender: TObject; + ADataSet: TDataSet; var AOperatorClass: TcxFilterOperatorClass); +begin + if AOperatorClass.InheritsFrom(TcxFilterNullOperator) or + AOperatorClass.InheritsFrom(TcxFilterNotNullOperator) then + begin + if Pos(AnsiUpperCase('Query'), AnsiUpperCase(ADataSet.ClassName)) <> 0 then + if AOperatorClass.InheritsFrom(TcxFilterNotNullOperator) then + AOperatorClass := TcxFilterSQLNotNullOperator + else + AOperatorClass := TcxFilterSQLNullOperator; + end; +end; + +initialization + cxFilterOperatorAdapters := TcxDBAdapterList.Create; + cxFilterOperatorAdapters.RegisterAdapter(TDataSet, TcxDBFilterOperatorAdapter); + +finalization + cxFilterOperatorAdapters.Free; + cxFilterOperatorAdapters := nil; + +end. diff --git a/official/x.35/ExpressDataController/Sources/cxData.pas b/official/x.35/ExpressDataController/Sources/cxData.pas new file mode 100644 index 00000000..fecc84f1 --- /dev/null +++ b/official/x.35/ExpressDataController/Sources/cxData.pas @@ -0,0 +1,70 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDataController } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDATACONTROLLER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxData; + +{$I cxVer.inc} + +interface + +uses + Classes, cxCustomData; + +type + { TcxDataController } + + TcxDataController = class(TcxCustomDataController) + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + end; + +implementation + +{ TcxDataController } + +constructor TcxDataController.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ActiveChanged(True); +end; + +destructor TcxDataController.Destroy; +begin +// ActiveChanged(False); + inherited Destroy; +end; + +end. diff --git a/official/x.35/ExpressDataController/Sources/cxDataConsts.pas b/official/x.35/ExpressDataController/Sources/cxDataConsts.pas new file mode 100644 index 00000000..02e4dd5c --- /dev/null +++ b/official/x.35/ExpressDataController/Sources/cxDataConsts.pas @@ -0,0 +1,64 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDataController } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDATACONTROLLER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDataConsts; + +{$I cxVer.inc} + +interface + +resourcestring + // Data + cxSDataReadError = 'Stream read error'; + cxSDataWriteError = 'Stream write error'; + cxSDataItemExistError = 'Item already exists'; + cxSDataRecordIndexError = 'RecordIndex out of range'; + cxSDataItemIndexError = 'ItemIndex out of range'; + cxSDataProviderModeError = 'This operation is not supported in provider mode'; + cxSDataInvalidStreamFormat = 'Invalid stream format'; + cxSDataRowIndexError = 'RowIndex out of range'; +// cxSDataRelationItemExistError = 'Relation Item already exists'; +// cxSDataRelationCircularReference = 'Circular Reference on Detail DataController'; +// cxSDataRelationMultiReferenceError = 'Reference on Detail DataController already exists'; + cxSDataCustomDataSourceInvalidCompare = 'GetInfoForCompare not implemented'; + // DB +// cxSDBDataSetNil = 'DataSet is nil'; + cxSDBDetailFilterControllerNotFound = 'DetailFilterController not found'; + cxSDBNotInGridMode = 'DataController not in GridMode'; + cxSDBKeyFieldNotFound = 'Key Field not found'; + +implementation + +end. diff --git a/official/x.35/ExpressDataController/Sources/cxDataStorage.pas b/official/x.35/ExpressDataController/Sources/cxDataStorage.pas new file mode 100644 index 00000000..83d509dc --- /dev/null +++ b/official/x.35/ExpressDataController/Sources/cxDataStorage.pas @@ -0,0 +1,2642 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDataController } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDATACONTROLLER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDataStorage; + +{$I cxVer.inc} + +interface + +uses + SysUtils, Classes{$IFDEF DELPHI6},Variants + {$IFNDEF NONDB},FMTBcd, SqlTimSt{$ENDIF}{$ENDIF}; + +type +{$IFNDEF DELPHI6} + PPointer = ^Pointer; + PSmallInt = ^SmallInt; + PInteger = ^Integer; + PWord = ^Word; + PBoolean = ^Boolean; + PDouble =^Double; + PByte = ^Byte; +{$ELSE} + LargeInt = Int64; + PLargeInt = ^LargeInt; +{$ENDIF} + + { Value Types } + + + PStringValue = PString; + PWideStringValue = PWideString; + + TcxValueType = class + protected + class function Compare(P1, P2: Pointer): Integer; virtual; + class procedure FreeBuffer(PBuffer: PChar); virtual; + class procedure FreeTextBuffer(PBuffer: PChar); virtual; + class function GetDataSize: Integer; virtual; + class function GetDataValue(PBuffer: PChar): Variant; virtual; + class function GetDefaultDisplayText(PBuffer: PChar): string; virtual; + class function GetDisplayText(PBuffer: PChar): string; virtual; + class procedure ReadDataValue(PBuffer: PChar; AStream: TStream); virtual; + class procedure ReadDisplayText(PBuffer: PChar; AStream: TStream); virtual; + class procedure SetDataValue(PBuffer: PChar; const Value: Variant); virtual; + class procedure SetDisplayText(PBuffer: PChar; const DisplayText: string); virtual; + class procedure WriteDataValue(PBuffer: PChar; AStream: TStream); virtual; + class procedure WriteDisplayText(PBuffer: PChar; AStream: TStream); virtual; + public + class function Caption: string; virtual; + class function CompareValues(P1, P2: Pointer): Integer; virtual; + class function GetValue(PBuffer: PChar): Variant; virtual; + class function GetVarType: Integer; virtual; + class function IsValueValid(var{const }Value: Variant): Boolean; virtual; + class function IsString: Boolean; virtual; + class procedure PrepareValueBuffer(var PBuffer: PChar); virtual; + end; + + TcxValueTypeClass = class of TcxValueType; + + TcxStringValueType = class(TcxValueType) + protected + class function Compare(P1, P2: Pointer): Integer; override; + class procedure FreeBuffer(PBuffer: PChar); override; + class function GetDataSize: Integer; override; + class function GetDataValue(PBuffer: PChar): Variant; override; + class procedure ReadDataValue(PBuffer: PChar; AStream: TStream); override; + class procedure SetDataValue(PBuffer: PChar; const Value: Variant); override; + class procedure WriteDataValue(PBuffer: PChar; AStream: TStream); override; + public + class function CompareValues(P1, P2: Pointer): Integer; override; + class function GetValue(PBuffer: PChar): Variant; override; + class function GetVarType: Integer; override; + class function IsString: Boolean; override; + class procedure PrepareValueBuffer(var PBuffer: PChar); override; + end; + + TcxWideStringValueType = class(TcxStringValueType) + protected + class function Compare(P1, P2: Pointer): Integer; override; + class procedure FreeBuffer(PBuffer: PChar); override; + class function GetDataSize: Integer; override; + class function GetDataValue(PBuffer: PChar): Variant; override; + class procedure ReadDataValue(PBuffer: PChar; AStream: TStream); override; + class procedure SetDataValue(PBuffer: PChar; const Value: Variant); override; + class procedure WriteDataValue(PBuffer: PChar; AStream: TStream); override; + public + class function CompareValues(P1, P2: Pointer): Integer; override; + class function GetValue(PBuffer: PChar): Variant; override; + class function GetVarType: Integer; override; + class function IsString: Boolean; override; + class procedure PrepareValueBuffer(var PBuffer: PChar); override; + end; + + TcxSmallintValueType = class(TcxValueType) + protected + class function GetDataSize: Integer; override; + class function GetDataValue(PBuffer: PChar): Variant; override; + class procedure ReadDataValue(PBuffer: PChar; AStream: TStream); override; + class procedure SetDataValue(PBuffer: PChar; const Value: Variant); override; + class procedure WriteDataValue(PBuffer: PChar; AStream: TStream); override; + public + class function CompareValues(P1, P2: Pointer): Integer; override; + class function GetVarType: Integer; override; + end; + + TcxIntegerValueType = class(TcxValueType) + protected + class function GetDataSize: Integer; override; + class function GetDataValue(PBuffer: PChar): Variant; override; + class procedure ReadDataValue(PBuffer: PChar; AStream: TStream); override; + class procedure SetDataValue(PBuffer: PChar; const Value: Variant); override; + class procedure WriteDataValue(PBuffer: PChar; AStream: TStream); override; + public + class function CompareValues(P1, P2: Pointer): Integer; override; + class function GetVarType: Integer; override; + end; + + TcxWordValueType = class(TcxValueType) + protected + class function GetDataSize: Integer; override; + class function GetDataValue(PBuffer: PChar): Variant; override; + class procedure ReadDataValue(PBuffer: PChar; AStream: TStream); override; + class procedure SetDataValue(PBuffer: PChar; const Value: Variant); override; + class procedure WriteDataValue(PBuffer: PChar; AStream: TStream); override; + public + class function CompareValues(P1, P2: Pointer): Integer; override; + class function GetVarType: Integer; override; + end; + + TcxBooleanValueType = class(TcxValueType) + protected + class function GetDataSize: Integer; override; + class function GetDataValue(PBuffer: PChar): Variant; override; + class function GetDefaultDisplayText(PBuffer: PChar): string; override; + class procedure ReadDataValue(PBuffer: PChar; AStream: TStream); override; + class procedure SetDataValue(PBuffer: PChar; const Value: Variant); override; + class procedure WriteDataValue(PBuffer: PChar; AStream: TStream); override; + public + class function CompareValues(P1, P2: Pointer): Integer; override; + class function GetVarType: Integer; override; + end; + + TcxFloatValueType = class(TcxValueType) // TODO: Double or Extended? + protected + class function GetDataSize: Integer; override; + class function GetDataValue(PBuffer: PChar): Variant; override; + class procedure ReadDataValue(PBuffer: PChar; AStream: TStream); override; + class procedure SetDataValue(PBuffer: PChar; const Value: Variant); override; + class procedure WriteDataValue(PBuffer: PChar; AStream: TStream); override; + public + class function CompareValues(P1, P2: Pointer): Integer; override; + class function GetVarType: Integer; override; + end; + + TcxCurrencyValueType = class(TcxValueType) + protected + class function GetDataSize: Integer; override; + class function GetDataValue(PBuffer: PChar): Variant; override; + class procedure ReadDataValue(PBuffer: PChar; AStream: TStream); override; + class procedure SetDataValue(PBuffer: PChar; const Value: Variant); override; + class procedure WriteDataValue(PBuffer: PChar; AStream: TStream); override; + public + class function CompareValues(P1, P2: Pointer): Integer; override; + class function GetVarType: Integer; override; + end; + + TcxDateTimeValueType = class(TcxValueType) + private + class function GetDateTime(PBuffer: PChar): TDateTime; + protected + class function GetDataSize: Integer; override; + class function GetDataValue(PBuffer: PChar): Variant; override; + class function GetDefaultDisplayText(PBuffer: PChar): string; override; + class procedure ReadDataValue(PBuffer: PChar; AStream: TStream); override; + class procedure SetDataValue(PBuffer: PChar; const Value: Variant); override; + class procedure WriteDataValue(PBuffer: PChar; AStream: TStream); override; + public + class function CompareValues(P1, P2: Pointer): Integer; override; + class function GetVarType: Integer; override; + end; + +{$IFDEF DELPHI6} + TcxLargeIntValueType = class(TcxValueType) + protected + class function GetDataSize: Integer; override; + class function GetDataValue(PBuffer: PChar): Variant; override; + class procedure ReadDataValue(PBuffer: PChar; AStream: TStream); override; + class procedure SetDataValue(PBuffer: PChar; const Value: Variant); override; + class procedure WriteDataValue(PBuffer: PChar; AStream: TStream); override; + public + class function CompareValues(P1, P2: Pointer): Integer; override; + class function GetVarType: Integer; override; + end; + + {$IFNDEF NONDB} + TcxFMTBcdValueType = class(TcxValueType) + protected + class function GetDataSize: Integer; override; + class function GetDataValue(PBuffer: PChar): Variant; override; + class function GetDefaultDisplayText(PBuffer: PChar): string; override; + class procedure SetDataValue(PBuffer: PChar; const Value: Variant); override; + public + class function CompareValues(P1, P2: Pointer): Integer; override; + class function GetVarType: Integer; override; + end; + + TcxSQLTimeStampValueType = class(TcxValueType) + protected + class function GetDataSize: Integer; override; + class function GetDataValue(PBuffer: PChar): Variant; override; + class procedure SetDataValue(PBuffer: PChar; const Value: Variant); override; + public + class function CompareValues(P1, P2: Pointer): Integer; override; + class function GetVarType: Integer; override; + end; + {$ENDIF} + {$ENDIF} + + TcxVariantValueType = class(TcxValueType) + protected + class function Compare(P1, P2: Pointer): Integer; override; + class procedure FreeBuffer(PBuffer: PChar); override; + class function GetDataSize: Integer; override; + class function GetDataValue(PBuffer: PChar): Variant; override; + class procedure SetDataValue(PBuffer: PChar; const Value: Variant); override; + public + class function CompareValues(P1, P2: Pointer): Integer; override; + class function GetValue(PBuffer: PChar): Variant; override; + class procedure PrepareValueBuffer(var PBuffer: PChar); override; + end; + + TcxObjectValueType = class(TcxIntegerValueType) + protected + class procedure FreeBuffer(PBuffer: PChar); override; + class procedure ReadDataValue(PBuffer: PChar; AStream: TStream); override; + class procedure SetDataValue(PBuffer: PChar; const Value: Variant); override; + class procedure WriteDataValue(PBuffer: PChar; AStream: TStream); override; + end; + + { TcxDataStorage } + + TcxDataStorage = class; + TcxValueDefs = class; + + TcxValueDef = class + private + FBufferSize: Integer; + FDataSize: Integer; + FStored: Boolean; + FLinkObject: TObject; + FOffset: Integer; + FStreamStored: Boolean; + FTextStored: Boolean; + FValueDefs: TcxValueDefs; + FValueTypeClass: TcxValueTypeClass; + function GetIsNeedConversion: Boolean; + function GetTextStored: Boolean; + procedure SetStored(Value: Boolean); + procedure SetTextStored(Value: Boolean); + procedure SetValueTypeClass(Value: TcxValueTypeClass); + protected + procedure Changed(AResyncNeeded: Boolean); + function Compare(P1, P2: PChar): Integer; + procedure FreeBuffer(PBuffer: PChar); + procedure FreeTextBuffer(PBuffer: PChar); + function GetDataValue(PBuffer: PChar): Variant; + function GetDisplayText(PBuffer: PChar): string; + function GetLinkObject: TObject; virtual; + function GetStored: Boolean; virtual; + procedure Init(var AOffset: Integer); + function IsNullValue(PBuffer: PChar): Boolean; + function IsNullValueEx(PBuffer: PChar; AOffset: Integer): Boolean; + procedure ReadDataValue(PBuffer: PChar; AStream: TStream); + procedure ReadDisplayText(PBuffer: PChar; AStream: TStream); + procedure SetDataValue(PBuffer: PChar; const Value: Variant); + procedure SetDisplayText(PBuffer: PChar; const DisplayText: string); + procedure SetLinkObject(Value: TObject); virtual; + procedure SetNull(PBuffer: PChar; IsNull: Boolean); + procedure WriteDataValue(PBuffer: PChar; AStream: TStream); + procedure WriteDisplayText(PBuffer: PChar; AStream: TStream); + property BufferSize: Integer read FBufferSize; + property DataSize: Integer read FDataSize; + property Offset: Integer read FOffset; + property ValueDefs: TcxValueDefs read FValueDefs; + public + constructor Create(AValueDefs: TcxValueDefs; AValueTypeClass: TcxValueTypeClass); virtual; + destructor Destroy; override; + procedure Assign(ASource: TcxValueDef); virtual; + function CompareValues(AIsNull1, AIsNull2: Boolean; P1, P2: PChar): Integer; + property IsNeedConversion: Boolean read GetIsNeedConversion; + property LinkObject: TObject read GetLinkObject write SetLinkObject; + property Stored: Boolean read GetStored write SetStored default True; + property TextStored: Boolean read GetTextStored write SetTextStored default False; + property ValueTypeClass: TcxValueTypeClass read FValueTypeClass write SetValueTypeClass; + property StreamStored: Boolean read FStreamStored write FStreamStored default True; + end; + + TcxValueDefClass = class of TcxValueDef; + + TcxValueDefs = class + private + FDataStorage: TcxDataStorage; + FItems: TList; + FRecordOffset: Integer; + FRecordSize: Integer; + function GetStoredCount: Integer; + function GetCount: Integer; + function GetItem(Index: Integer): TcxValueDef; + protected + procedure Changed(AValueDef: TcxValueDef; AResyncNeeded: Boolean); virtual; + function GetValueDefClass: TcxValueDefClass; virtual; + procedure Prepare(AStartOffset: Integer); virtual; + procedure Remove(AItem: TcxValueDef); + property DataStorage: TcxDataStorage read FDataStorage; + public + constructor Create(ADataStorage: TcxDataStorage); virtual; + destructor Destroy; override; + function Add(AValueTypeClass: TcxValueTypeClass; AStored, ATextStored: Boolean; ALinkObject: TObject): TcxValueDef; + procedure Clear; + property StoredCount: Integer read GetStoredCount; + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxValueDef read GetItem; default; + property RecordSize: Integer read FRecordSize; + end; + + { internal value defs } + + TcxInternalValueDef = class(TcxValueDef) + protected + function GetLinkObject: TObject; override; + function GetStored: Boolean; override; + public + function GetValueDef: TcxValueDef; + end; + + TcxInternalValueDefs = class(TcxValueDefs) + protected + function GetValueDefClass: TcxValueDefClass; override; + public + function FindByLinkObject(ALinkObject: TObject): TcxValueDef; + procedure RemoveByLinkObject(ALinkObject: TObject); + end; + + TcxValueDefReader = class + public + constructor Create; virtual; + function GetDisplayText(AValueDef: TcxValueDef): string; virtual; + function GetValue(AValueDef: TcxValueDef): Variant; virtual; + function IsInternal(AValueDef: TcxValueDef): Boolean; virtual; + end; + + TcxValueDefReaderClass = class of TcxValueDefReader; + + TcxValueDefSetProc = procedure (AValueDef: TcxValueDef; AFromRecordIndex, AToRecordIndex: Integer; + AValueDefReader: TcxValueDefReader) of object; + + TcxDataStorage = class + private + FDestroying: Boolean; + FInternalRecordBuffers: TList; + FInternalValueDefs: TcxInternalValueDefs; + FStoredValuesOnly: Boolean; + FRecordBuffers: TList; + FRecordIDCounter: Integer; + FUseRecordID: Boolean; + FValueDefs: TcxValueDefs; + FValueDefsList: TList; +// FValueDefsChanged: Boolean; + FOnClearInternalRecords: TNotifyEvent; + function GetRecordBuffer(Index: Integer): PChar; + function GetRecordCount: Integer; + procedure SetStoredValuesOnly(Value: Boolean); + procedure SetRecordBuffer(Index: Integer; Value: PChar); + procedure SetRecordCount(Value: Integer); + procedure SetUseRecordID(Value: Boolean); + protected + function AllocRecordBuffer(Index: Integer): PChar; + function CalcRecordOffset: Integer; + procedure ChangeRecordFlag(PBuffer: PChar; AFlag: Byte; ATurnOn: Boolean); + procedure CheckRecordID(ARecordIndex: Integer); + procedure CheckRecordIDCounter; + procedure CheckRecordIDCounterAfterLoad(ALoadedID: Integer); + function CheckValueDef(ARecordIndex: Integer; var AValueDef: TcxValueDef): Boolean; + procedure DeleteInternalRecord(ARecordIndex: Integer); + procedure FreeAndNilRecordBuffer(AIndex: Integer); + procedure InitStructure(AValueDefs: TcxValueDefs); virtual; + procedure InsertValueDef(AIndex: Integer; AValueDef: TcxValueDef); + function IsRecordFlag(PBuffer: PChar; AFlag: Byte): Boolean; + procedure RemoveValueDef(AValueDef: TcxValueDef); + procedure ValueDefsChanged(AValueDef: TcxValueDef; AResyncNeeded: Boolean); virtual; + function ValueDefsByRecordIndex(Index: Integer): TcxValueDefs; virtual; + property InternalValueDefs: TcxInternalValueDefs read FInternalValueDefs; + public + constructor Create; virtual; + destructor Destroy; override; + function AddInternalRecord: Integer; + function AppendRecord: Integer; + procedure BeforeDestruction; override; + procedure BeginLoad; + procedure CheckStructure; + procedure Clear(AWithoutInternal: Boolean); + procedure ClearInternalRecords; + procedure ClearRecords(AClearList: Boolean); + function CompareRecords(ARecordIndex1, ARecordIndex2: Integer; AValueDef: TcxValueDef): Integer; + procedure DeleteRecord(ARecordIndex: Integer); + procedure EndLoad; + function GetDisplayText(ARecordIndex: Integer; AValueDef: TcxValueDef): string; + function GetCompareInfo(ARecordIndex: Integer; AValueDef: TcxValueDef; var P: PChar): Boolean; + function GetRecordID(ARecordIndex: Integer): Integer; + function GetValue(ARecordIndex: Integer; AValueDef: TcxValueDef): Variant; + procedure InsertRecord(ARecordIndex: Integer); + procedure ReadData(ARecordIndex: Integer; AStream: TStream); + procedure ReadRecord(ARecordIndex: Integer; AValueDefReader: TcxValueDefReader); + procedure ReadRecordFrom(AFromRecordIndex, AToRecordIndex: Integer; AValueDefReader: TcxValueDefReader; ASetProc: TcxValueDefSetProc); + procedure SetDisplayText(ARecordIndex: Integer; AValueDef: TcxValueDef; const Value: string); + procedure SetRecordID(ARecordIndex, AID: Integer); + procedure SetValue(ARecordIndex: Integer; AValueDef: TcxValueDef; const Value: Variant); + procedure WriteData(ARecordIndex: Integer; AStream: TStream); + + procedure BeginStreaming(ACompare: TListSortCompare); + procedure EndStreaming; + + property StoredValuesOnly: Boolean read FStoredValuesOnly write SetStoredValuesOnly; + property UseRecordID: Boolean read FUseRecordID write SetUseRecordID; + property RecordBuffers[Index: Integer]: PChar read GetRecordBuffer write SetRecordBuffer; + property RecordCount: Integer read GetRecordCount write SetRecordCount; + property ValueDefs: TcxValueDefs read FValueDefs; + property OnClearInternalRecords: TNotifyEvent read FOnClearInternalRecords write FOnClearInternalRecords; + end; + + { TcxLookupList } + + TcxLookupListItem = record + KeyValue: Variant; + DisplayText: string; + end; + PcxLookupListItem = ^TcxLookupListItem; + + TcxLookupList = class + private + FItems: TList; + function GetCount: Integer; + function GetItem(Index: Integer): PcxLookupListItem; + public + constructor Create; + destructor Destroy; override; + procedure Clear; + function Find(const AKeyValue: Variant; var AIndex: Integer): Boolean; + procedure Insert(AIndex: Integer; const AKeyValue: Variant; const ADisplayText: string); + property Count: Integer read GetCount; + property Items[Index: Integer]: PcxLookupListItem read GetItem; default; + end; + + { TcxValueTypeClassList } + + TcxValueTypeClassList = class + private + FItems: TList; + function GetCount: Integer; + function GetItem(Index: Integer): TcxValueTypeClass; + public + constructor Create; + destructor Destroy; override; + function ItemByCaption(const ACaption: string): TcxValueTypeClass; + procedure RegisterItem(AValueTypeClass: TcxValueTypeClass); + procedure UnregisterItem(AValueTypeClass: TcxValueTypeClass); + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxValueTypeClass read GetItem; default; + end; + +function cxValueTypeClassList: TcxValueTypeClassList; + +function IsDateTimeValueTypeClass(AValueTypeClass: TcxValueTypeClass): Boolean; + +implementation + +uses + cxVariants; + +const + RecordFlagSize = SizeOf(Byte); + ValueFlagSize = SizeOf(Byte); + PointerSize = SizeOf(Pointer); + RecordIDSize = SizeOf(Integer); + // RecordFlag Bit Masks + RecordFlag_Busy = $01; + +var + FValueTypeClassList: TcxValueTypeClassList; + +function cxValueTypeClassList: TcxValueTypeClassList; +begin + if FValueTypeClassList = nil then + FValueTypeClassList := TcxValueTypeClassList.Create; + Result := FValueTypeClassList; +end; + +function IsDateTimeValueTypeClass(AValueTypeClass: TcxValueTypeClass): Boolean; +begin + Result := (AValueTypeClass = TcxDateTimeValueType) + {$IFDEF DELPHI6}{$IFNDEF NONDB} or (AValueTypeClass = TcxSQLTimeStampValueType){$ENDIF}{$ENDIF}; +end; + +function IncPChar(P: PChar; AOffset: Integer): PChar; +begin + Result := P + AOffset; +end; + +{ TcxValueType } + +class function TcxValueType.Caption: string; +var + I: Integer; +begin + Result := ClassName; + if Result <> '' then + begin + if Copy(Result, 1, 3) = 'Tcx' then + Delete(Result, 1, 3); + I := Pos('ValueType', Result); + if I <> 0 then + Delete(Result, I, Length('ValueType')); + end; +end; + +class function TcxValueType.CompareValues(P1, P2: Pointer): Integer; +begin + Result := VarCompare(GetDataValue(P1), GetDataValue(P2)); +end; + +class function TcxValueType.GetValue(PBuffer: PChar): Variant; +begin + Result := GetDataValue(PBuffer); +end; + +class function TcxValueType.GetVarType: Integer; +begin + Result := varVariant; +end; + +class function TcxValueType.IsValueValid(var Value: Variant): Boolean; +var + V: Variant; +begin + if VarIsNull(Value) or (GetVarType = varVariant) then // not Empty? + Result := True + else + begin + Result := False; + try + //!!! B92835 - Bug in TFMTBcdVariantType.Cast: dest (string variant for example) is not cleared before usage + VarCast({Value}V, Value, GetVarType); + Value := V; + Result := True; + except + on E: EVariantError do; + end; + end; +end; + +class function TcxValueType.IsString: Boolean; +begin + Result := False; +end; + +class procedure TcxValueType.PrepareValueBuffer(var PBuffer: PChar); +begin +end; + +class function TcxValueType.Compare(P1, P2: Pointer): Integer; +begin + Result := CompareValues(P1, P2); +end; + +class procedure TcxValueType.FreeBuffer(PBuffer: PChar); +begin +end; + +class procedure TcxValueType.FreeTextBuffer(PBuffer: PChar); +var + P: PStringValue; +begin + P := PPointer(PBuffer)^; + if P <> nil then + Dispose(P); +end; + +class function TcxValueType.GetDataSize: Integer; +begin + Result := 0; +end; + +class function TcxValueType.GetDataValue(PBuffer: PChar): Variant; +begin + Result := Null; +end; + +class function TcxValueType.GetDefaultDisplayText(PBuffer: PChar): string; +begin + try + Result := VarToStr(GetDataValue(PBuffer)); + except + on EVariantError do + Result := ''; + end; +end; + +class function TcxValueType.GetDisplayText(PBuffer: PChar): string; +var + P: PStringValue; +begin + P := PPointer(PBuffer)^; + if P <> nil then + Result := P^ + else + Result := ''; +end; + +class procedure TcxValueType.ReadDataValue(PBuffer: PChar; AStream: TStream); +begin + SetDataValue(PBuffer, ReadVariantFunc(AStream)); +end; + +class procedure TcxValueType.ReadDisplayText(PBuffer: PChar; AStream: TStream); +begin + SetDisplayText(PBuffer, ReadStringFunc(AStream)); +end; + +class procedure TcxValueType.SetDataValue(PBuffer: PChar; const Value: Variant); +begin +end; + +class procedure TcxValueType.SetDisplayText(PBuffer: PChar; const DisplayText: string); +var + P: PStringValue; +begin + P := PPointer(PBuffer)^; + if P = nil then + begin + New(P); + PPointer(PBuffer)^ := P; + end; + P^ := DisplayText; +end; + +class procedure TcxValueType.WriteDataValue(PBuffer: PChar; AStream: TStream); +begin + WriteVariantProc(AStream, GetDataValue(PBuffer)); +end; + +class procedure TcxValueType.WriteDisplayText(PBuffer: PChar; AStream: TStream); +begin + WriteStringProc(AStream, GetDisplayText(PBuffer)); +end; + +{ TcxStringValueType } + +class function TcxStringValueType.CompareValues(P1, P2: Pointer): Integer; +var + S1, S2: string; +begin + if Assigned(P1) then + begin + if Assigned(P2) then + begin + S1 := PStringValue(P1)^; + S2 := PStringValue(P2)^; + if S1 = S2 then + Result := 0 + else + if S1 < S2 then + Result := -1 + else + Result := 1; + end + else + Result := 1; + end + else + begin + if Assigned(P2) then + Result := -1 + else + Result := 0; + end; +end; + +class function TcxStringValueType.GetValue(PBuffer: PChar): Variant; +begin + Result := GetDataValue(@PBuffer); +end; + +class function TcxStringValueType.GetVarType: Integer; +begin + Result := varString; +end; + +class function TcxStringValueType.IsString: Boolean; +begin + Result := True; +end; + +class procedure TcxStringValueType.PrepareValueBuffer(var PBuffer: PChar); +begin + PBuffer := PPointer(PBuffer)^; +end; + +class function TcxStringValueType.Compare(P1, P2: Pointer): Integer; +begin + Result := CompareValues(PPointer(P1)^, PPointer(P2)^); +end; + +class procedure TcxStringValueType.FreeBuffer(PBuffer: PChar); +begin + Dispose(PStringValue(PPointer(PBuffer)^)); +end; + +class function TcxStringValueType.GetDataSize: Integer; +begin + Result := SizeOf(PStringValue); +end; + +class function TcxStringValueType.GetDataValue(PBuffer: PChar): Variant; +var + P: PStringValue; +begin + P := PPointer(PBuffer)^; + if P <> nil then + Result := P^ + else + Result := inherited GetDataValue(PBuffer); +end; + +class procedure TcxStringValueType.ReadDataValue(PBuffer: PChar; AStream: TStream); +begin + SetDataValue(PBuffer, ReadStringFunc(AStream)); +end; + +class procedure TcxStringValueType.SetDataValue(PBuffer: PChar; const Value: Variant); +begin + SetDisplayText(PBuffer, Value); +end; + +class procedure TcxStringValueType.WriteDataValue(PBuffer: PChar; AStream: TStream); +begin + WriteStringProc(AStream, GetDisplayText(PBuffer)); +end; + +{ TcxWideStringValueType } + +class function TcxWideStringValueType.CompareValues(P1, P2: Pointer): Integer; +var + WS1, WS2: WideString; +begin + if Assigned(P1) then + begin + if Assigned(P2) then + begin + WS1 := PWideStringValue(P1)^; + WS2 := PWideStringValue(P2)^; + if WS1 = WS2 then + Result := 0 + else + if WS1 < WS2 then + Result := -1 + else + Result := 1; + end + else + Result := 1; + end + else + begin + if Assigned(P2) then + Result := -1 + else + Result := 0; + end; +end; + +class function TcxWideStringValueType.GetValue(PBuffer: PChar): Variant; +begin + Result := GetDataValue(@PBuffer); +end; + +class function TcxWideStringValueType.GetVarType: Integer; +begin + Result := varOleStr; +end; + +class function TcxWideStringValueType.IsString: Boolean; +begin + Result := True; +end; + +class procedure TcxWideStringValueType.PrepareValueBuffer(var PBuffer: PChar); +begin + PBuffer := PPointer(PBuffer)^; +end; + +class function TcxWideStringValueType.Compare(P1, P2: Pointer): Integer; +begin + Result := CompareValues(PPointer(P1)^, PPointer(P2)^); +end; + +class procedure TcxWideStringValueType.FreeBuffer(PBuffer: PChar); +begin + Dispose(PWideStringValue(PPointer(PBuffer)^)); +end; + +class function TcxWideStringValueType.GetDataSize: Integer; +begin + Result := SizeOf(PWideStringValue); +end; + +class function TcxWideStringValueType.GetDataValue(PBuffer: PChar): Variant; +var + P: PWideStringValue; +begin + P := PPointer(PBuffer)^; + if P <> nil then + Result := P^ + else + Result := inherited GetDataValue(PBuffer); +end; + +class procedure TcxWideStringValueType.ReadDataValue(PBuffer: PChar; AStream: TStream); +begin + SetDataValue(PBuffer, ReadWideStringFunc(AStream)); +end; + +class procedure TcxWideStringValueType.SetDataValue(PBuffer: PChar; const Value: Variant); +var + P: PWideStringValue; +begin + P := PPointer(PBuffer)^; + if P = nil then + begin + New(P); + PPointer(PBuffer)^ := P; + end; + P^ := Value; +end; + +class procedure TcxWideStringValueType.WriteDataValue(PBuffer: PChar; AStream: TStream); +begin + WriteWideStringProc(AStream, VarToStr(GetDataValue(PBuffer))); +end; + +{ TcxSmallintValueType } + +class function TcxSmallintValueType.CompareValues(P1, P2: Pointer): Integer; +begin + Result := PSmallInt(P1)^ - PSmallInt(P2)^; +end; + +class function TcxSmallintValueType.GetVarType: Integer; +begin + Result := varSmallint; +end; + +class function TcxSmallintValueType.GetDataSize: Integer; +begin + Result := SizeOf(SmallInt); +end; + +class function TcxSmallintValueType.GetDataValue(PBuffer: PChar): Variant; +begin + Result := PSmallInt(PBuffer)^; +end; + +class procedure TcxSmallintValueType.ReadDataValue(PBuffer: PChar; AStream: TStream); +begin + SetDataValue(PBuffer, ReadSmallIntFunc(AStream)); +end; + +class procedure TcxSmallintValueType.SetDataValue(PBuffer: PChar; const Value: Variant); +begin + PSmallInt(PBuffer)^ := Value; +end; + +class procedure TcxSmallintValueType.WriteDataValue(PBuffer: PChar; AStream: TStream); +begin + WriteSmallIntProc(AStream, SmallInt(GetDataValue(PBuffer))); +end; + +{ TcxIntegerValueType } + +class function TcxIntegerValueType.CompareValues(P1, P2: Pointer): Integer; +begin + Result := PInteger(P1)^ - PInteger(P2)^; +end; + +class function TcxIntegerValueType.GetVarType: Integer; +begin + Result := varInteger; +end; + +class function TcxIntegerValueType.GetDataSize: Integer; +begin + Result := SizeOf(Integer); +end; + +class function TcxIntegerValueType.GetDataValue(PBuffer: PChar): Variant; +begin + Result := PInteger(PBuffer)^; +end; + +class procedure TcxIntegerValueType.ReadDataValue(PBuffer: PChar; AStream: TStream); +begin + SetDataValue(PBuffer, ReadIntegerFunc(AStream)); +end; + +class procedure TcxIntegerValueType.SetDataValue(PBuffer: PChar; const Value: Variant); +begin + PInteger(PBuffer)^ := Value; +end; + +class procedure TcxIntegerValueType.WriteDataValue(PBuffer: PChar; AStream: TStream); +begin + WriteIntegerProc(AStream, Integer(GetDataValue(PBuffer))); +end; + +{ TcxWordValueType } + +class function TcxWordValueType.CompareValues(P1, P2: Pointer): Integer; +begin + Result := PWord(P1)^ - PWord(P2)^; +end; + +class function TcxWordValueType.GetVarType: Integer; +begin + Result := {$IFDEF DELPHI6}varWord{$ELSE}$0012{$ENDIF}; +end; + +class function TcxWordValueType.GetDataSize: Integer; +begin + Result := SizeOf(Word); +end; + +class function TcxWordValueType.GetDataValue(PBuffer: PChar): Variant; +begin + Result := PWord(PBuffer)^; +end; + +class procedure TcxWordValueType.ReadDataValue(PBuffer: PChar; AStream: TStream); +begin + SetDataValue(PBuffer, ReadWordFunc(AStream)); +end; + +class procedure TcxWordValueType.SetDataValue(PBuffer: PChar; const Value: Variant); +begin + PWord(PBuffer)^ := Value; +end; + +class procedure TcxWordValueType.WriteDataValue(PBuffer: PChar; AStream: TStream); +begin + WriteWordProc(AStream, Word(GetDataValue(PBuffer))); +end; + +{ TcxBooleanValueType } + +class function TcxBooleanValueType.CompareValues(P1, P2: Pointer): Integer; +begin + Result := Integer(PBoolean(P1)^) - Integer(PBoolean(P2)^); +end; + +class function TcxBooleanValueType.GetVarType: Integer; +begin + Result := varBoolean; +end; + +class function TcxBooleanValueType.GetDataSize: Integer; +begin + Result := SizeOf(Boolean); +end; + +class function TcxBooleanValueType.GetDataValue(PBuffer: PChar): Variant; +begin + Result := PBoolean(PBuffer)^; +end; + +class function TcxBooleanValueType.GetDefaultDisplayText(PBuffer: PChar): string; +begin + try + {$IFDEF DELPHI6} + Result := BoolToStr(GetDataValue(PBuffer), True); + {$ELSE} + Result := GetDataValue(PBuffer); + {$ENDIF} + except + on EVariantError do + Result := ''; + end; +end; + +class procedure TcxBooleanValueType.ReadDataValue(PBuffer: PChar; AStream: TStream); +begin + SetDataValue(PBuffer, ReadBooleanFunc(AStream)); +end; + +class procedure TcxBooleanValueType.SetDataValue(PBuffer: PChar; const Value: Variant); +begin + PBoolean(PBuffer)^ := Value; +end; + +class procedure TcxBooleanValueType.WriteDataValue(PBuffer: PChar; AStream: TStream); +begin + WriteBooleanProc(AStream, Boolean(GetDataValue(PBuffer))); +end; + +{ TcxFloatValueType } + +class function TcxFloatValueType.CompareValues(P1, P2: Pointer): Integer; +var + D1, D2: Double; +begin + D1 := PDouble(P1)^; + D2 := PDouble(P2)^; + if D1 = D2 then + Result := 0 + else + if D1 < D2 then + Result := -1 + else + Result := 1; +end; + +class function TcxFloatValueType.GetVarType: Integer; +begin + Result := varDouble; +end; + +class function TcxFloatValueType.GetDataSize: Integer; +begin + Result := SizeOf(Double); +end; + +class function TcxFloatValueType.GetDataValue(PBuffer: PChar): Variant; +begin + Result := PDouble(PBuffer)^; +end; + +class procedure TcxFloatValueType.ReadDataValue(PBuffer: PChar; AStream: TStream); +var + E: Extended; +begin + ReadFloatProc(AStream, E); + PDouble(PBuffer)^ := E; +end; + +class procedure TcxFloatValueType.SetDataValue(PBuffer: PChar; const Value: Variant); +begin + PDouble(PBuffer)^ := Value; +end; + +class procedure TcxFloatValueType.WriteDataValue(PBuffer: PChar; AStream: TStream); +begin + WriteFloatProc(AStream, Double(GetDataValue(PBuffer))); +end; + +{ TcxCurrencyValueType } + +class function TcxCurrencyValueType.CompareValues(P1, P2: Pointer): Integer; +var + C1, C2: Currency; +begin + C1 := PCurrency(P1)^; + C2 := PCurrency(P2)^; + if C1 = C2 then + Result := 0 + else + if C1 < C2 then + Result := -1 + else + Result := 1; +end; + +class function TcxCurrencyValueType.GetVarType: Integer; +begin + Result := varCurrency; +end; + +class function TcxCurrencyValueType.GetDataSize: Integer; +begin + Result := SizeOf(Currency); +end; + +class function TcxCurrencyValueType.GetDataValue(PBuffer: PChar): Variant; +begin + Result := PCurrency(PBuffer)^; +end; + +class procedure TcxCurrencyValueType.ReadDataValue(PBuffer: PChar; AStream: TStream); +begin + SetDataValue(PBuffer, ReadCurrencyFunc(AStream)); +end; + +class procedure TcxCurrencyValueType.SetDataValue(PBuffer: PChar; const Value: Variant); +begin + PCurrency(PBuffer)^ := Value; +end; + +class procedure TcxCurrencyValueType.WriteDataValue(PBuffer: PChar; AStream: TStream); +begin + WriteCurrencyProc(AStream, Currency(GetDataValue(PBuffer))); +end; + +{ TcxDateTimeValueType } + +class function TcxDateTimeValueType.CompareValues(P1, P2: Pointer): Integer; +var + D1, D2: Double; +begin + D1 := PDateTime(P1)^; + D2 := PDateTime(P2)^; + if D1 = D2 then + Result := 0 + else + if D1 < D2 then + Result := -1 + else + Result := 1; +end; + +class function TcxDateTimeValueType.GetVarType: Integer; +begin + Result := varDate; +end; + +class function TcxDateTimeValueType.GetDataSize: Integer; +begin + Result := SizeOf(TDateTime); +end; + +class function TcxDateTimeValueType.GetDataValue(PBuffer: PChar): Variant; +begin + Result := GetDateTime(PBuffer); +end; + +class function TcxDateTimeValueType.GetDefaultDisplayText(PBuffer: PChar): string; +var + DT: TDateTime; +begin + DT := GetDateTime(PBuffer); + try + Result := VarToStr(DT); + except + on EVariantError do + Result := DateTimeToStr(DT); + end; +end; + +class procedure TcxDateTimeValueType.ReadDataValue(PBuffer: PChar; AStream: TStream); +begin + SetDataValue(PBuffer, ReadDateTimeFunc(AStream)); +end; + +class procedure TcxDateTimeValueType.SetDataValue(PBuffer: PChar; const Value: Variant); +begin + PDateTime(PBuffer)^ := VarToDateTime(Value); +end; + +class procedure TcxDateTimeValueType.WriteDataValue(PBuffer: PChar; AStream: TStream); +begin + WriteDateTimeProc(AStream, TDateTime(GetDataValue(PBuffer))); +end; + +class function TcxDateTimeValueType.GetDateTime(PBuffer: PChar): TDateTime; +begin + Result := PDateTime(PBuffer)^; +end; + +{$IFDEF DELPHI6} + +{ TcxLargeIntValueType } + +class function TcxLargeIntValueType.CompareValues(P1, P2: Pointer): Integer; +var + L1, L2: LargeInt; +begin + L1 := PLargeInt(P1)^; + L2 := PLargeInt(P2)^; + if L1 = L2 then + Result := 0 + else + if L1 < L2 then + Result := -1 + else + Result := 1; +end; + +class function TcxLargeIntValueType.GetVarType: Integer; +begin + Result := varInt64; +end; + +class function TcxLargeIntValueType.GetDataSize: Integer; +begin + Result := SizeOf(LargeInt); +end; + +class function TcxLargeIntValueType.GetDataValue(PBuffer: PChar): Variant; +begin + Result := PLargeInt(PBuffer)^; +end; + +class procedure TcxLargeIntValueType.ReadDataValue(PBuffer: PChar; AStream: TStream); +begin + SetDataValue(PBuffer, ReadLargeIntFunc(AStream)); +end; + +class procedure TcxLargeIntValueType.SetDataValue(PBuffer: PChar; const Value: Variant); +begin + PLargeInt(PBuffer)^ := Value; +end; + +class procedure TcxLargeIntValueType.WriteDataValue(PBuffer: PChar; AStream: TStream); +begin + WriteLargeIntProc(AStream, PLargeInt(PBuffer)^); +end; + +{$IFNDEF NONDB} +{ TcxFMTBcdValueType } + +class function TcxFMTBcdValueType.CompareValues(P1, P2: Pointer): Integer; +var + B1, B2: TBcd; +begin + B1 := PBcd(P1)^; + B2 := PBcd(P2)^; + Result := BcdCompare(B1, B2); +end; + +class function TcxFMTBcdValueType.GetVarType: Integer; +begin + Result := VarFMTBcd; +end; + +class function TcxFMTBcdValueType.GetDataSize: Integer; +begin + Result := SizeOf(TBcd); +end; + +class function TcxFMTBcdValueType.GetDataValue(PBuffer: PChar): Variant; +begin + Result := VarFMTBcdCreate(PBcd(PBuffer)^); +// Result := BcdToDouble(PBcd(PBuffer)^); +end; + +class function TcxFMTBcdValueType.GetDefaultDisplayText(PBuffer: PChar): string; +var + Bcd: TBcd; +begin + Bcd := PBcd(PBuffer)^; + Result := BcdToStrF(Bcd, ffGeneral, 0, 0); // P, D - ignored in BcdToStrF +end; + +class procedure TcxFMTBcdValueType.SetDataValue(PBuffer: PChar; const Value: Variant); +begin + PBcd(PBuffer)^ := VarToBcd(Value); +end; + +{ TcxSQLTimeStampValueType } + +class function TcxSQLTimeStampValueType.CompareValues(P1, P2: Pointer): Integer; +var + T1, T2: TSQLTimeStamp; +begin + T1 := PSQLTimeStamp(P1)^; + T2 := PSQLTimeStamp(P2)^; + Result := T1.Year - T2.Year; + if Result = 0 then + begin + Result := T1.Month - T2.Month; + if Result = 0 then + begin + Result := T1.Day - T2.Day; + if Result = 0 then + begin + Result := T1.Hour - T2.Hour; + if Result = 0 then + begin + Result := T1.Minute - T2.Minute; + if Result = 0 then + begin + Result := T1.Second - T2.Second; + if Result = 0 then + Result := T1.Fractions - T2.Fractions; + end; + end; + end; + end; + end; +end; + +class function TcxSQLTimeStampValueType.GetVarType: Integer; +begin + Result := VarSQLTimeStamp; +end; + +class function TcxSQLTimeStampValueType.GetDataSize: Integer; +begin + Result := SizeOf(TSQLTimeStamp); +end; + +class function TcxSQLTimeStampValueType.GetDataValue(PBuffer: PChar): Variant; +begin + Result := SQLTimeStampToDateTime(PSQLTimeStamp(PBuffer)^); +end; + +class procedure TcxSQLTimeStampValueType.SetDataValue(PBuffer: PChar; const Value: Variant); +begin + PSQLTimeStamp(PBuffer)^ := VarToSQLTimeStamp(Value); +end; +{$ENDIF} +{$ENDIF} + +{ TcxVariantValueType } + +class function TcxVariantValueType.CompareValues(P1, P2: Pointer): Integer; +begin + if Assigned(P1) then + begin + if Assigned(P2) then + begin + Result := VarCompare(PVariant(P1)^, PVariant(P2)^); + end + else + Result := 1; + end + else + begin + if Assigned(P2) then + Result := -1 + else + Result := 0; + end; +end; + +class function TcxVariantValueType.GetValue(PBuffer: PChar): Variant; +begin + Result := GetDataValue(@PBuffer); +end; + +class procedure TcxVariantValueType.PrepareValueBuffer(var PBuffer: PChar); +begin + PBuffer := PPointer(PBuffer)^; +end; + +class function TcxVariantValueType.Compare(P1, P2: Pointer): Integer; +begin + Result := CompareValues(PPointer(P1)^, PPointer(P2)^); +end; + +class procedure TcxVariantValueType.FreeBuffer(PBuffer: PChar); +begin + Dispose(PVariant(PPointer(PBuffer)^)); +end; + +class function TcxVariantValueType.GetDataSize: Integer; +begin + Result := SizeOf(PVariant); +end; + +class function TcxVariantValueType.GetDataValue(PBuffer: PChar): Variant; +begin + Result := PVariant(PPointer(PBuffer)^)^; +end; + +class procedure TcxVariantValueType.SetDataValue(PBuffer: PChar; const Value: Variant); +var + P: PVariant; +begin + P := PPointer(PBuffer)^; + if P = nil then + begin + New(P); + PPointer(PBuffer)^ := P; + end; + P^ := Value; +end; + +{ TcxObjectValueType } + +class procedure TcxObjectValueType.FreeBuffer(PBuffer: PChar); +begin + TObject(PPointer(PBuffer)^).Free; +end; + +class procedure TcxObjectValueType.ReadDataValue(PBuffer: PChar; AStream: TStream); +begin + // not supported +end; + +class procedure TcxObjectValueType.SetDataValue(PBuffer: PChar; const Value: Variant); +begin + // TODO: if PInteger(PBuffer)^ <> 0 then FreeBuffer(PBuffer); + inherited SetDataValue(PBuffer, Value); +end; + +class procedure TcxObjectValueType.WriteDataValue(PBuffer: PChar; AStream: TStream); +begin + // not supported +end; + +{ TcxValueDef } + +constructor TcxValueDef.Create(AValueDefs: TcxValueDefs; AValueTypeClass: TcxValueTypeClass); +begin + inherited Create; + FValueDefs := AValueDefs; + FValueTypeClass := AValueTypeClass; + FStored := True; + FTextStored := False; + FStreamStored := True; +end; + +destructor TcxValueDef.Destroy; +begin + FValueDefs.Remove(Self); + inherited Destroy; +end; + +procedure TcxValueDef.Assign(ASource: TcxValueDef); +begin + Stored := ASource.Stored; + TextStored := ASource.TextStored; +end; + +function TcxValueDef.CompareValues(AIsNull1, AIsNull2: Boolean; P1, P2: PChar): Integer; +begin + if AIsNull1 then + begin + if AIsNull2 then + Result := 0 + else + Result := -1 + end + else + begin + if AIsNull2 then + Result := 1 + else + Result := ValueTypeClass.CompareValues(P1, P2); + end; +end; + +procedure TcxValueDef.Changed(AResyncNeeded: Boolean); +begin + if Assigned(ValueDefs) then + ValueDefs.Changed(Self, AResyncNeeded); +end; + +function TcxValueDef.Compare(P1, P2: PChar): Integer; +begin + if IsNullValueEx(P1, Offset) then + begin + if IsNullValueEx(P2, Offset) then + Result := 0 + else + Result := -1 + end + else + begin + if IsNullValueEx(P2, Offset) then + Result := 1 + else + Result := ValueTypeClass.Compare(IncPChar(P1, Offset + ValueFlagSize), + IncPChar(P2, Offset + ValueFlagSize)); + end; +end; + +procedure TcxValueDef.FreeBuffer(PBuffer: PChar); +var + PCurrent: PChar; +begin + if not Stored then Exit; + PCurrent := IncPChar(PBuffer, Offset); + if not IsNullValue(PCurrent) then + ValueTypeClass.FreeBuffer(IncPChar(PCurrent, ValueFlagSize)); + if TextStored then + FreeTextBuffer(IncPChar(PCurrent, ValueFlagSize + DataSize)); +end; + +procedure TcxValueDef.FreeTextBuffer(PBuffer: PChar); +begin + TcxValueType.FreeTextBuffer(PBuffer); +end; + +function TcxValueDef.GetDataValue(PBuffer: PChar): Variant; +begin + if IsNullValue(IncPChar(PBuffer, Offset)) then + Result := Null + else + Result := ValueTypeClass.GetDataValue(IncPChar(PBuffer, Offset + ValueFlagSize)); +end; + +function TcxValueDef.GetDisplayText(PBuffer: PChar): string; +begin + if TextStored then + Result := ValueTypeClass.GetDisplayText( + IncPChar(PBuffer, Offset + ValueFlagSize + DataSize)) + else + begin + if IsNullValue(IncPChar(PBuffer, Offset)) then + Result := '' + else + Result := ValueTypeClass.GetDefaultDisplayText( + IncPChar(PBuffer, Offset + ValueFlagSize)); + end; +end; + +function TcxValueDef.GetLinkObject: TObject; +begin + Result := FLinkObject; +end; + +function TcxValueDef.GetStored: Boolean; +begin + Result := FStored or not ValueDefs.DataStorage.StoredValuesOnly; +end; + +procedure TcxValueDef.Init(var AOffset: Integer); +begin + FDataSize := ValueTypeClass.GetDataSize; + FOffset := AOffset; + if Stored then + begin + Inc(AOffset, ValueFlagSize); + Inc(AOffset, DataSize); + if TextStored then + Inc(AOffset, PointerSize); + FBufferSize := AOffset - FOffset; + end + else + FBufferSize := 0; +end; + +function TcxValueDef.IsNullValue(PBuffer: PChar): Boolean; +begin + Result := PByte(PBuffer)^ = 0; +end; + +function TcxValueDef.IsNullValueEx(PBuffer: PChar; AOffset: Integer): Boolean; +begin + Result := (PBuffer = nil) or IsNullValue(IncPChar(PBuffer, AOffset)); +end; + +procedure TcxValueDef.ReadDataValue(PBuffer: PChar; AStream: TStream); + + function ReadNullFlag: Boolean; + begin + Result := ReadBooleanFunc(AStream); + end; + +begin + if ReadNullFlag then + SetNull(IncPChar(PBuffer, Offset), True) + else + begin + SetNull(IncPChar(PBuffer, Offset), False); + ValueTypeClass.ReadDataValue( + IncPChar(PBuffer, Offset + ValueFlagSize), AStream); + end; +end; + +procedure TcxValueDef.ReadDisplayText(PBuffer: PChar; AStream: TStream); +begin + if TextStored then + ValueTypeClass.ReadDisplayText(IncPChar(PBuffer, Offset + ValueFlagSize + DataSize), AStream); +end; + +procedure TcxValueDef.SetDataValue(PBuffer: PChar; const Value: Variant); +begin + if VarIsNull(Value) then + SetNull(IncPChar(PBuffer, Offset), True) + else + begin + SetNull(IncPChar(PBuffer, Offset), False); + ValueTypeClass.SetDataValue(IncPChar(PBuffer, Offset + ValueFlagSize), Value); + end; +end; + +procedure TcxValueDef.SetDisplayText(PBuffer: PChar; const DisplayText: string); +begin + if TextStored then + ValueTypeClass.SetDisplayText( + IncPChar(PBuffer, Offset + ValueFlagSize + DataSize), DisplayText); +end; + +procedure TcxValueDef.SetLinkObject(Value: TObject); +begin + FLinkObject := Value; +end; + +procedure TcxValueDef.SetNull(PBuffer: PChar; IsNull: Boolean); +begin + if IsNull then + begin + if not IsNullValue(PBuffer) then + begin + ValueTypeClass.FreeBuffer(IncPChar(PBuffer, ValueFlagSize)); + FillChar((PBuffer + ValueFlagSize)^, DataSize, 0); + end; + PByte(PBuffer)^ := 0 // see also IsNullValue + end + else + PByte(PBuffer)^ := 1; +end; + +procedure TcxValueDef.WriteDataValue(PBuffer: PChar; AStream: TStream); + + procedure WriteNullFlag(ANull: Boolean); + begin + WriteBooleanProc(AStream, ANull); + end; + +begin + if IsNullValue(IncPChar(PBuffer, Offset)) then + WriteNullFlag(True) + else + begin + WriteNullFlag(False); + ValueTypeClass.WriteDataValue( + IncPChar(PBuffer, Offset + ValueFlagSize), AStream); + end; +end; + +procedure TcxValueDef.WriteDisplayText(PBuffer: PChar; AStream: TStream); +begin + if TextStored then + ValueTypeClass.WriteDisplayText( + IncPChar(PBuffer, Offset + ValueFlagSize + DataSize), AStream); +end; + +function TcxValueDef.GetIsNeedConversion: Boolean; +begin + Result := ValueTypeClass.IsString; +end; + +function TcxValueDef.GetTextStored: Boolean; +begin + if not Stored then + Result := False + else + Result := FTextStored; +end; + +procedure TcxValueDef.SetStored(Value: Boolean); +begin + if FStored <> Value then + begin + FStored := Value; + Changed(False); + end; +end; + +procedure TcxValueDef.SetTextStored(Value: Boolean); +begin + if FTextStored <> Value then + begin + FTextStored := Value; + Changed(True); + end; +end; + +procedure TcxValueDef.SetValueTypeClass(Value: TcxValueTypeClass); +begin + if FValueTypeClass <> Value then + begin + FValueTypeClass := Value; // TODO: clear? + Changed(True); + end; +end; + +{ TcxValueDefs } + +constructor TcxValueDefs.Create(ADataStorage: TcxDataStorage); +begin + inherited Create; + FDataStorage := ADataStorage; + FItems := TList.Create; + DataStorage.InitStructure(Self); +end; + +destructor TcxValueDefs.Destroy; +begin + Clear; + FItems.Free; + inherited Destroy; +end; + +function TcxValueDefs.Add(AValueTypeClass: TcxValueTypeClass; AStored, ATextStored: Boolean; ALinkObject: TObject): TcxValueDef; +var + I: Integer; +begin + Result := GetValueDefClass.Create(Self, AValueTypeClass); + Result.LinkObject := ALinkObject; + Result.Stored := AStored; + Result.TextStored := ATextStored; + I := 0; + Result.Init(I); + DataStorage.InsertValueDef(FItems.Count, Result); + FItems.Add(Result); + DataStorage.InitStructure(Self); +end; + +procedure TcxValueDefs.Clear; +begin + while FItems.Count > 0 do + TcxValueDef(FItems.Last).Free; +end; + +procedure TcxValueDefs.Changed(AValueDef: TcxValueDef; AResyncNeeded: Boolean); +begin + DataStorage.ValueDefsChanged(AValueDef, AResyncNeeded); +end; + +function TcxValueDefs.GetValueDefClass: TcxValueDefClass; +begin + Result := TcxValueDef; +end; + +procedure TcxValueDefs.Prepare(AStartOffset: Integer); +var + I, AOffset: Integer; +begin + FRecordOffset := AStartOffset; + AOffset := FRecordOffset; + for I := 0 to Count - 1 do + Items[I].Init(AOffset); + FRecordSize := AOffset; +end; + +procedure TcxValueDefs.Remove(AItem: TcxValueDef); +begin + DataStorage.RemoveValueDef(AItem); + FItems.Remove(AItem); + DataStorage.InitStructure(Self); +end; + +function TcxValueDefs.GetStoredCount: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + if Items[I].Stored then + Inc(Result); +end; + +function TcxValueDefs.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxValueDefs.GetItem(Index: Integer): TcxValueDef; +begin + if DataStorage.FValueDefsList <> nil then + Result := TcxValueDef(DataStorage.FValueDefsList[Index]) + else + Result := TcxValueDef(FItems[Index]); +end; + +{ TcxInternalValueDef } + +function TcxInternalValueDef.GetLinkObject: TObject; +begin + if Assigned(FLinkObject) then + Result := TcxValueDef(FLinkObject).LinkObject + else + Result := nil; +end; + +function TcxInternalValueDef.GetStored: Boolean; +begin + Result := True; +end; + +function TcxInternalValueDef.GetValueDef: TcxValueDef; +begin + Result := TcxValueDef(FLinkObject); +end; + +{ TcxInternalValueDefs } + +function TcxInternalValueDefs.FindByLinkObject(ALinkObject: TObject): TcxValueDef; +var + I: Integer; +begin + Result := nil; + for I := Count - 1 downto 0 do + if Items[I].FLinkObject = ALinkObject then + begin + Result := Items[I] as TcxValueDef; + Break; + end; +end; + +procedure TcxInternalValueDefs.RemoveByLinkObject(ALinkObject: TObject); +var + AItem: TcxValueDef; +begin + AItem := FindByLinkObject(ALinkObject); + if AItem <> nil then + AItem.Free; +end; + +function TcxInternalValueDefs.GetValueDefClass: TcxValueDefClass; +begin + Result := TcxInternalValueDef; +end; + +{ TcxValueDefReader } + +constructor TcxValueDefReader.Create; +begin + inherited Create; +end; + +function TcxValueDefReader.GetDisplayText(AValueDef: TcxValueDef): string; +begin + Result := ''; +end; + +function TcxValueDefReader.GetValue(AValueDef: TcxValueDef): Variant; +begin + Result := Null; +end; + +function TcxValueDefReader.IsInternal(AValueDef: TcxValueDef): Boolean; +begin + Result := False; +end; + +{ TcxDataStorage } + +constructor TcxDataStorage.Create; +begin + inherited Create; + FRecordIDCounter := 1; // TODO: reset + FInternalValueDefs := TcxInternalValueDefs.Create(Self); + FValueDefs := TcxValueDefs.Create(Self); + FInternalRecordBuffers := TList.Create; + FRecordBuffers := TList.Create; +end; + +destructor TcxDataStorage.Destroy; +begin + Clear(False); + FValueDefs.Free; + FInternalValueDefs.Free; + FRecordBuffers.Free; + FInternalRecordBuffers.Free; + inherited Destroy; +end; + +function TcxDataStorage.AddInternalRecord: Integer; +var + I: Integer; + P: PChar; +begin + Result := 0; + for I := -1 downto -FInternalRecordBuffers.Count do + begin + if not IsRecordFlag(RecordBuffers[I], RecordFlag_Busy) then + begin + Result := I; + Break; + end; + end; + if Result = 0 then + Result := -FInternalRecordBuffers.Add(nil) - 1; + P := AllocRecordBuffer(Result); + ChangeRecordFlag(P, RecordFlag_Busy, True); +end; + +function TcxDataStorage.AppendRecord: Integer; +begin + Result := FRecordBuffers.Add(nil); + CheckRecordID(Result); +end; + +procedure TcxDataStorage.BeforeDestruction; +begin + FDestroying := True; + inherited BeforeDestruction; +end; + +procedure TcxDataStorage.BeginLoad; +begin + CheckStructure; +end; + +procedure TcxDataStorage.CheckStructure; +begin +(* + if FValueDefsChanged then + begin + InitStructure(ValueDefs); + // ! + ClearInternalRecords; + InitStructure(InternalValueDefs); + // ! + FValueDefsChanged := False; + end; + *) +end; + +procedure TcxDataStorage.Clear(AWithoutInternal: Boolean); +begin + if not AWithoutInternal then + ClearInternalRecords; + ClearRecords(True); +end; + +procedure TcxDataStorage.ClearInternalRecords; +var + I: Integer; +begin + for I := -FInternalRecordBuffers.Count to -1 do + FreeAndNilRecordBuffer(I); + FInternalRecordBuffers.Clear; + if Assigned(FOnClearInternalRecords) then + FOnClearInternalRecords(Self); +end; + +procedure TcxDataStorage.ClearRecords(AClearList: Boolean); +var + I: Integer; +begin + for I := 0 to FRecordBuffers.Count - 1 do + FreeAndNilRecordBuffer(I); + if AClearList then + FRecordBuffers.Clear; + CheckRecordIDCounter; + CheckRecordID(-1); // all +end; + +function TcxDataStorage.CompareRecords(ARecordIndex1, ARecordIndex2: Integer; + AValueDef: TcxValueDef): Integer; +var + P1, P2: PChar; +begin + P1 := RecordBuffers[ARecordIndex1]; + P2 := RecordBuffers[ARecordIndex2]; + Result := AValueDef.Compare(P1, P2); +end; + +procedure TcxDataStorage.DeleteRecord(ARecordIndex: Integer); +begin + if ARecordIndex < 0 then + DeleteInternalRecord(ARecordIndex) + else + begin + FreeAndNilRecordBuffer(ARecordIndex); + FRecordBuffers.Delete(ARecordIndex); + CheckRecordIDCounter; + end; +end; + +procedure TcxDataStorage.EndLoad; +begin +end; + +function TcxDataStorage.GetDisplayText(ARecordIndex: Integer; AValueDef: TcxValueDef): string; +var + P: PChar; +begin + Result := ''; + P := RecordBuffers[ARecordIndex]; + if (P <> nil) and CheckValueDef(ARecordIndex, AValueDef) then + Result := AValueDef.GetDisplayText(P); +end; + +function TcxDataStorage.GetCompareInfo(ARecordIndex: Integer; AValueDef: TcxValueDef; + var P: PChar): Boolean; +begin + P := RecordBuffers[ARecordIndex]; + IncPChar(P, AValueDef.Offset); + Result := AValueDef.IsNullValue(P); + if not Result then + begin + IncPChar(P, ValueFlagSize); + AValueDef.ValueTypeClass.PrepareValueBuffer(P); + end; +end; + +function TcxDataStorage.GetRecordID(ARecordIndex: Integer): Integer; +var + P: PChar; +begin + P := AllocRecordBuffer(ARecordIndex); + P := IncPChar(P, RecordFlagSize); + Result := PInteger(P)^; +end; + +function TcxDataStorage.GetValue(ARecordIndex: Integer; AValueDef: TcxValueDef): Variant; +var + P: PChar; +begin + Result := Null; + P := RecordBuffers[ARecordIndex]; + if (P <> nil) and CheckValueDef(ARecordIndex, AValueDef) then + Result := AValueDef.GetDataValue(P); +end; + +procedure TcxDataStorage.InsertRecord(ARecordIndex: Integer); +begin + FRecordBuffers.Insert(ARecordIndex, nil); + CheckRecordID(ARecordIndex); +end; + +procedure TcxDataStorage.ReadData(ARecordIndex: Integer; AStream: TStream); + + function ReadNilFlag: Boolean; + begin + Result := ReadBooleanFunc(AStream); + end; + +var + P: PChar; + I, AID: Integer; + AValueDef: TcxValueDef; +begin + if ReadNilFlag then + FreeAndNilRecordBuffer(ARecordIndex) + else + begin + P := AllocRecordBuffer(ARecordIndex); + if UseRecordID then + begin + AID := ReadIntegerFunc(AStream); + SetRecordID(ARecordIndex, AID); + CheckRecordIDCounterAfterLoad(AID); + end; + for I := 0 to ValueDefs.Count - 1 do + begin + AValueDef := ValueDefs[I]; + if AValueDef.StreamStored then + begin + AValueDef.ReadDataValue(P, AStream); + if AValueDef.TextStored then + AValueDef.ReadDisplayText(P, AStream); + end; + end; + end; +end; + +procedure TcxDataStorage.ReadRecord(ARecordIndex: Integer; AValueDefReader: TcxValueDefReader); +var + P: PChar; + I: Integer; + AValueDef: TcxValueDef; + AValueDefs: TcxValueDefs; +begin + P := AllocRecordBuffer(ARecordIndex); + AValueDefs := ValueDefsByRecordIndex(ARecordIndex); + for I := 0 to AValueDefs.Count - 1 do + begin + AValueDef := AValueDefs[I]; + if not AValueDefReader.IsInternal(AValueDef) then + begin + AValueDef.SetDataValue(P, AValueDefReader.GetValue(AValueDef)); + if AValueDef.TextStored then + AValueDef.SetDisplayText(P, AValueDefReader.GetDisplayText(AValueDef)); + end; + end; +end; + +procedure TcxDataStorage.ReadRecordFrom(AFromRecordIndex, AToRecordIndex: Integer; + AValueDefReader: TcxValueDefReader; ASetProc: TcxValueDefSetProc); +var + I: Integer; + AValueDefs: TcxValueDefs; +begin + AValueDefs := ValueDefsByRecordIndex(AFromRecordIndex); + for I := 0 to AValueDefs.Count - 1 do + ASetProc(AValueDefs[I], AFromRecordIndex, AToRecordIndex, AValueDefReader); +end; + +procedure TcxDataStorage.SetDisplayText(ARecordIndex: Integer; AValueDef: TcxValueDef; + const Value: string); +var + P: PChar; +begin + P := AllocRecordBuffer(ARecordIndex); + if CheckValueDef(ARecordIndex, AValueDef) and AValueDef.TextStored then + AValueDef.SetDisplayText(P, Value); +end; + +procedure TcxDataStorage.SetRecordID(ARecordIndex, AID: Integer); +var + P: PChar; +begin + P := AllocRecordBuffer(ARecordIndex); + P := IncPChar(P, RecordFlagSize); + PInteger(P)^ := AID; +end; + +procedure TcxDataStorage.SetValue(ARecordIndex: Integer; AValueDef: TcxValueDef; + const Value: Variant); +var + P: PChar; +begin + P := AllocRecordBuffer(ARecordIndex); + if CheckValueDef(ARecordIndex, AValueDef) then + AValueDef.SetDataValue(P, Value); +end; + +procedure TcxDataStorage.WriteData(ARecordIndex: Integer; AStream: TStream); + + procedure WriteRecordInfo(PBuffer: PChar); + var + AID: Integer; + begin + WriteBooleanProc(AStream, PBuffer = nil); + if (PBuffer <> nil) and UseRecordID then + begin + AID := 0; + if PBuffer <> nil then + begin + PBuffer := IncPChar(PBuffer, RecordFlagSize); + AID := PInteger(PBuffer)^; + end; + WriteIntegerProc(AStream, AID); + end; + end; + +var + P: PChar; + I: Integer; + AValueDef: TcxValueDef; +begin + P := PChar(FRecordBuffers[ARecordIndex]); + WriteRecordInfo(P); + if P <> nil then + for I := 0 to ValueDefs.Count - 1 do + begin + AValueDef := ValueDefs[I]; + if AValueDef.StreamStored then + begin + AValueDef.WriteDataValue(P, AStream); + if AValueDef.TextStored then + AValueDef.WriteDisplayText(P, AStream); + end; + end; +end; + +procedure TcxDataStorage.BeginStreaming(ACompare: TListSortCompare); +var + I: Integer; + AList: TList; +begin + AList := TList.Create; + for I := 0 to ValueDefs.Count - 1 do + AList.Add(ValueDefs[I]); + AList.Sort(ACompare); + FValueDefsList := AList; +end; + +procedure TcxDataStorage.EndStreaming; +begin + FValueDefsList.Free; + FValueDefsList := nil; +end; + +function TcxDataStorage.AllocRecordBuffer(Index: Integer): PChar; +var + AValueDefs: TcxValueDefs; +begin + Result := RecordBuffers[Index]; + if Result = nil then + begin + AValueDefs := ValueDefsByRecordIndex(Index); + Result := AllocMem(AValueDefs.RecordSize); + RecordBuffers[Index] := Result; + end; +end; + +function TcxDataStorage.CalcRecordOffset: Integer; +begin + Result := RecordFlagSize; + if UseRecordID then + Inc(Result, RecordIDSize); +end; + +procedure TcxDataStorage.ChangeRecordFlag(PBuffer: PChar; AFlag: Byte; ATurnOn: Boolean); +begin + if PBuffer <> nil then + if ATurnOn then + PByte(PBuffer)^ := PByte(PBuffer)^ or AFlag + else + PByte(PBuffer)^ := PByte(PBuffer)^ and not AFlag; +end; + +procedure TcxDataStorage.CheckRecordID(ARecordIndex: Integer); + + procedure CheckID(AIndex: Integer); + begin + if GetRecordID(AIndex) = 0 then + begin + SetRecordID(AIndex, FRecordIDCounter); + Inc(FRecordIDCounter); + end; + end; + +var + I: Integer; +begin + if not UseRecordID then Exit; + if ARecordIndex <> -1 then + CheckID(ARecordIndex) + else + for I := 0 to RecordCount - 1 do + CheckID(I); +end; + +procedure TcxDataStorage.CheckRecordIDCounter; +begin + if FRecordBuffers.Count = 0 then FRecordIDCounter := 1; // TODO: reset +end; + +procedure TcxDataStorage.CheckRecordIDCounterAfterLoad(ALoadedID: Integer); +begin + if FRecordIDCounter <= ALoadedID then + FRecordIDCounter := ALoadedID + 1; +end; + +function TcxDataStorage.CheckValueDef(ARecordIndex: Integer; var AValueDef: TcxValueDef): Boolean; +begin + if not (AValueDef is TcxInternalValueDef) and + (ValueDefsByRecordIndex(ARecordIndex) = InternalValueDefs) then + AValueDef := InternalValueDefs.FindByLinkObject(AValueDef); + Result := AValueDef <> nil; +end; + +procedure TcxDataStorage.DeleteInternalRecord(ARecordIndex: Integer); +//var +// P: PChar; +begin + if ARecordIndex >= 0 then Exit; +// P := RecordBuffers[ARecordIndex]; +// ChangeRecordFlag(P, RecordFlag_Busy, False); + FreeAndNilRecordBuffer(ARecordIndex); +end; + +procedure TcxDataStorage.FreeAndNilRecordBuffer(AIndex: Integer); +var + P: PChar; + I: Integer; + AValueDefs: TcxValueDefs; +begin + P := RecordBuffers[AIndex]; + if P <> nil then + begin + AValueDefs := ValueDefsByRecordIndex(AIndex); + RecordBuffers[AIndex] := nil; + for I := 0 to AValueDefs.Count - 1 do + AValueDefs[I].FreeBuffer(P); + FreeMem(P); + end; +end; + +procedure TcxDataStorage.InitStructure(AValueDefs: TcxValueDefs); +begin + AValueDefs.Prepare(CalcRecordOffset); +end; + +procedure TcxDataStorage.InsertValueDef(AIndex: Integer; AValueDef: TcxValueDef); +var + I, AStartIndex, AEndIndex: Integer; + PBuffer, PSource, PDest: PChar; + AValueDefs: TcxValueDefs; +begin + AValueDefs := AValueDef.ValueDefs; + if AValueDefs = ValueDefs then + begin + InternalValueDefs.Add(AValueDef.ValueTypeClass, True, AValueDef.FTextStored, AValueDef); + AStartIndex := 0; + AEndIndex := FRecordBuffers.Count - 1; + end + else + begin + AStartIndex := -FInternalRecordBuffers.Count; + AEndIndex := -1; + end; + for I := AStartIndex to AEndIndex do + begin + PBuffer := RecordBuffers[I]; + if PBuffer <> nil then + begin + ReallocMem(PBuffer, AValueDefs.RecordSize + AValueDef.BufferSize); + RecordBuffers[I] := PBuffer; + if AIndex < AValueDefs.Count then + begin + PSource := IncPChar(PBuffer, AValueDefs[AIndex].Offset); + PDest := IncPChar(PSource, AValueDef.BufferSize); + System.Move(PSource^, PDest^, AValueDefs.RecordSize - (PSource - PBuffer)); + end + else + begin + PSource := PBuffer; + if AValueDefs.Count > 0 then + PSource := IncPChar(PSource, AValueDefs[AValueDefs.Count - 1].Offset + + AValueDefs[AValueDefs.Count - 1].BufferSize) + else + PSource := IncPChar(PSource, AValueDefs.RecordSize); + end; + FillChar(PSource^, AValueDef.BufferSize, 0); + end; + end; +end; + +function TcxDataStorage.IsRecordFlag(PBuffer: PChar; AFlag: Byte): Boolean; +begin + Result := (PBuffer <> nil) and ((PByte(PBuffer)^ and AFlag) = AFlag); +end; + +procedure TcxDataStorage.RemoveValueDef(AValueDef: TcxValueDef); +var + I, AStartIndex, AEndIndex: Integer; + PBuffer, PSource, PDest: PChar; + AValueDefs: TcxValueDefs; + AFreeAndNil: Boolean; +begin + AValueDefs := AValueDef.ValueDefs; + if AValueDefs = ValueDefs then + begin + InternalValueDefs.RemoveByLinkObject(AValueDef); + AStartIndex := 0; + AEndIndex := FRecordBuffers.Count - 1; + end + else + begin + AStartIndex := -FInternalRecordBuffers.Count; + AEndIndex := -1; + end; + AFreeAndNil := AValueDef.Stored and (AValueDefs.StoredCount <= 1); + for I := AStartIndex to AEndIndex do + begin + PBuffer := RecordBuffers[I]; + if PBuffer <> nil then + if AFreeAndNil then + FreeAndNilRecordBuffer(I) + else + if AValueDef.Stored then + begin + AValueDef.FreeBuffer(PBuffer); + PDest := IncPChar(PBuffer, AValueDef.Offset); + PSource := IncPChar(PDest, AValueDef.BufferSize); + System.Move(PSource^, PDest^, AValueDefs.RecordSize - (PSource - PBuffer)); + ReallocMem(PBuffer, AValueDefs.RecordSize - AValueDef.BufferSize); // existing data in the block is not affected! + RecordBuffers[I] := PBuffer; + end; + end; +end; + +procedure TcxDataStorage.ValueDefsChanged(AValueDef: TcxValueDef; AResyncNeeded: Boolean); +//var +// AInternalValueDef: TcxValueDef; +begin + (* + if FDestroying then Exit; + if not FValueDefsChanged then + begin + ClearRecords(False); + FValueDefsChanged := True; + if AResyncNeeded and (AValueDef.ValueDefs = ValueDefs) then + begin + AInternalValueDef := InternalValueDefs.FindByLinkObject(AValueDef); + if AInternalValueDef <> nil then + AInternalValueDef.Assign(AValueDef); + end; + end; + *) +end; + +function TcxDataStorage.ValueDefsByRecordIndex(Index: Integer): TcxValueDefs; +begin + if Index < 0 then + Result := FInternalValueDefs + else + Result := FValueDefs; +end; + +function TcxDataStorage.GetRecordBuffer(Index: Integer): PChar; +begin + if Index >= 0 then + Result := PChar(FRecordBuffers[Index]) + else + Result := PChar(FInternalRecordBuffers[-Index - 1]); +end; + +function TcxDataStorage.GetRecordCount: Integer; +begin + Result := FRecordBuffers.Count; +end; + +procedure TcxDataStorage.SetStoredValuesOnly(Value: Boolean); +begin + if FStoredValuesOnly <> Value then + begin + ClearRecords(False); + FStoredValuesOnly := Value; + InitStructure(ValueDefs); + end; +end; + +procedure TcxDataStorage.SetRecordBuffer(Index: Integer; Value: PChar); +begin + if Index >= 0 then + FRecordBuffers[Index] := Value + else + FInternalRecordBuffers[-Index - 1] := Value; +end; + +procedure TcxDataStorage.SetRecordCount(Value: Integer); +begin + if Value < 0 then Value := 0; + if RecordCount <> Value then + begin + // TODO: Capacity + while RecordCount < Value do + AppendRecord; + while RecordCount > Value do + DeleteRecord(RecordCount - 1); + end; +end; + +procedure TcxDataStorage.SetUseRecordID(Value: Boolean); +begin + if FUseRecordID <> Value then + begin + ClearRecords(False); + FUseRecordID := Value; + InitStructure(ValueDefs); + end; +end; + +{ TcxLookupList } + +constructor TcxLookupList.Create; +begin + inherited Create; + FItems := TList.Create; +end; + +destructor TcxLookupList.Destroy; +begin + Clear; + FItems.Free; + inherited Destroy; +end; + +procedure TcxLookupList.Clear; +var + I: Integer; +begin + for I := 0 to FItems.Count - 1 do + Dispose(PcxLookupListItem(FItems[I])); + FItems.Clear; +end; + +function TcxLookupList.Find(const AKeyValue: Variant; var AIndex: Integer): Boolean; +var + L, H, I, C: Integer; +begin + AIndex := 0; + Result := False; + L := 0; + H := FItems.Count - 1; + if L <= H then + repeat + I := (L + H) div 2; + C := VarCompare(PcxLookupListItem(FItems[I]).KeyValue, AKeyValue); + if C = 0 then + begin + AIndex := I; + Result := True; + Break; + end + else + if C < 0 then + L := I + 1 + else + H := I - 1; + if L > H then + begin + AIndex := L; + Break; + end; + until False; +end; + +procedure TcxLookupList.Insert(AIndex: Integer; const AKeyValue: Variant; + const ADisplayText: string); +var + P: PcxLookupListItem; +begin + New(P); + P.KeyValue := AKeyValue; + P.DisplayText := ADisplayText; + FItems.Insert(AIndex, P); +end; + +function TcxLookupList.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxLookupList.GetItem(Index: Integer): PcxLookupListItem; +begin + Result := PcxLookupListItem(FItems[Index]); +end; + +{ TcxValueTypeClassList } + +constructor TcxValueTypeClassList.Create; +begin + inherited Create; + FItems := TList.Create; +end; + +destructor TcxValueTypeClassList.Destroy; +begin + FItems.Free; + inherited Destroy; +end; + +function TcxValueTypeClassList.ItemByCaption(const ACaption: string): TcxValueTypeClass; +var + I: Integer; +begin + Result := nil; + for I := 0 to FItems.Count - 1 do + if TcxValueTypeClass(FItems[I]).Caption = ACaption then + begin + Result := TcxValueTypeClass(FItems[I]); + Break; + end; +end; + +procedure TcxValueTypeClassList.RegisterItem(AValueTypeClass: TcxValueTypeClass); +begin + if FItems.IndexOf(TObject(AValueTypeClass)) = -1 then + FItems.Add(TObject(AValueTypeClass)); +end; + +procedure TcxValueTypeClassList.UnregisterItem(AValueTypeClass: TcxValueTypeClass); +begin + FItems.Remove(TObject(AValueTypeClass)); +end; + +function TcxValueTypeClassList.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxValueTypeClassList.GetItem(Index: Integer): TcxValueTypeClass; +begin + Result := TcxValueTypeClass(FItems[Index]); +end; + +initialization + cxValueTypeClassList.RegisterItem(TcxStringValueType); + cxValueTypeClassList.RegisterItem(TcxWideStringValueType); + cxValueTypeClassList.RegisterItem(TcxSmallintValueType); + cxValueTypeClassList.RegisterItem(TcxIntegerValueType); + cxValueTypeClassList.RegisterItem(TcxWordValueType); + cxValueTypeClassList.RegisterItem(TcxBooleanValueType); + cxValueTypeClassList.RegisterItem(TcxFloatValueType); + cxValueTypeClassList.RegisterItem(TcxCurrencyValueType); + cxValueTypeClassList.RegisterItem(TcxDateTimeValueType); + {$IFDEF DELPHI6} + cxValueTypeClassList.RegisterItem(TcxLargeIntValueType); + {$IFNDEF NONDB} + cxValueTypeClassList.RegisterItem(TcxFMTBcdValueType); + cxValueTypeClassList.RegisterItem(TcxSQLTimeStampValueType); + {$ENDIF} + {$ENDIF} + cxValueTypeClassList.RegisterItem(TcxVariantValueType); + cxValueTypeClassList.RegisterItem(TcxObjectValueType); + +finalization + cxValueTypeClassList.UnregisterItem(TcxObjectValueType); + cxValueTypeClassList.UnregisterItem(TcxVariantValueType); + {$IFDEF DELPHI6} + {$IFNDEF NONDB} + cxValueTypeClassList.UnregisterItem(TcxSQLTimeStampValueType); + cxValueTypeClassList.UnregisterItem(TcxFMTBcdValueType); + {$ENDIF} + cxValueTypeClassList.UnregisterItem(TcxLargeIntValueType); + {$ENDIF} + cxValueTypeClassList.UnregisterItem(TcxDateTimeValueType); + cxValueTypeClassList.UnregisterItem(TcxCurrencyValueType); + cxValueTypeClassList.UnregisterItem(TcxFloatValueType); + cxValueTypeClassList.UnregisterItem(TcxBooleanValueType); + cxValueTypeClassList.UnregisterItem(TcxWordValueType); + cxValueTypeClassList.UnregisterItem(TcxIntegerValueType); + cxValueTypeClassList.UnregisterItem(TcxSmallintValueType); + cxValueTypeClassList.UnregisterItem(TcxWideStringValueType); + cxValueTypeClassList.UnregisterItem(TcxStringValueType); + + FValueTypeClassList.Free; + FValueTypeClassList := nil; + +end. diff --git a/official/x.35/ExpressDataController/Sources/cxDataUtils.pas b/official/x.35/ExpressDataController/Sources/cxDataUtils.pas new file mode 100644 index 00000000..ecf7c49e --- /dev/null +++ b/official/x.35/ExpressDataController/Sources/cxDataUtils.pas @@ -0,0 +1,386 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDataController } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDATACONTROLLER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDataUtils; + +{$I cxVer.inc} + +interface + +uses + Windows, +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Classes, SysUtils; + +type + TcxDataEditValueSource = (evsValue, evsText, evsKey); + + { TcxCustomDataBinding } + + TcxDataBindingNotifyEvent = procedure of object; + + TcxCustomDataBinding = class(TPersistent) + private + FDataComponent: TComponent; + FOwner: TComponent; + FReadOnly: Boolean; + FVisualControl: TComponent; + FOnDataChange: TcxDataBindingNotifyEvent; + FOnDataSetChange: TcxDataBindingNotifyEvent; + FOnUpdateData: TcxDataBindingNotifyEvent; + procedure SetVisualControl(Value: TComponent); + protected + function GetOwner: TPersistent; override; + procedure DataChange; virtual; + procedure DataSetChange; virtual; + function GetModified: Boolean; virtual; + function GetReadOnly: Boolean; virtual; + procedure SetReadOnly(Value: Boolean); virtual; + procedure UpdateData; virtual; + procedure VisualControlChanged; virtual; + property DataComponent: TComponent read FDataComponent; + public + constructor Create(AOwner, ADataComponent: TComponent); virtual; + function CanModify: Boolean; virtual; + function ExecuteAction(Action: TBasicAction): Boolean; virtual; + function GetStoredValue(AValueSource: TcxDataEditValueSource; AFocused: Boolean): Variant; virtual; + function IsControlReadOnly: Boolean; virtual; + function IsDataSourceLive: Boolean; virtual; + function IsDataStorage: Boolean; virtual; + procedure Reset; virtual; + function SetEditMode: Boolean; virtual; + procedure SetStoredValue(AValueSource: TcxDataEditValueSource; const Value: Variant); virtual; + function UpdateAction(Action: TBasicAction): Boolean; virtual; + procedure UpdateDataSource; virtual; + property Modified: Boolean read GetModified; + property ReadOnly: Boolean read GetReadOnly write SetReadOnly default False; + property VisualControl: TComponent read FVisualControl write SetVisualControl; + property OnDataChange: TcxDataBindingNotifyEvent read FOnDataChange write FOnDataChange; + property OnDataSetChange: TcxDataBindingNotifyEvent read FOnDataSetChange write FOnDataSetChange; + property OnUpdateData: TcxDataBindingNotifyEvent read FOnUpdateData write FOnUpdateData; + end; + + TcxCustomDataBindingClass = class of TcxCustomDataBinding; + + { TcxCollection } + + TcxCollection = class(TCollection) // copy from cxClasses + public + procedure Assign(Source: TPersistent); override; + {$IFNDEF DELPHI6} + function Owner: TPersistent; + {$ENDIF} + end; + +function DefaultCurrencyDisplayFormat: string; + +function DateOf(const AValue: TDateTime): TDateTime; +function TimeOf(const AValue: TDateTime): TDateTime; +function GetStartDateOfWeek(const AValue: TDateTime): TDateTime; + +// StartOfWeek: 0..6 - 0 = Sunday, 6 = Saturday + +const + cxDataUnassignedStartOfWeek = 10; + +function GetStartOfWeek: Word; +procedure SetStartOfWeek(Value: Word); + +function DataCompareText(const S1, S2: string; APartialCompare: Boolean): Boolean; + +implementation + +function DefaultCurrencyDisplayFormat: string; +var + ACurrStr: string; + I: Integer; + C: Char; +begin + if CurrencyDecimals > 0 then + begin + SetLength(Result, CurrencyDecimals); + FillChar(Result[1], Length(Result), '0'); + end + else + Result := ''; + Result := ',0.' + Result; + ACurrStr := ''; + for I := 1 to Length(CurrencyString) do + begin + C := CurrencyString[I]; + if C in [',', '.'] then + ACurrStr := ACurrStr + '''' + C + '''' + else + ACurrStr := ACurrStr + C; + end; + if Length(ACurrStr) > 0 then + case CurrencyFormat of + 0: Result := ACurrStr + Result; { '$1' } + 1: Result := Result + ACurrStr; { '1$' } + 2: Result := ACurrStr + ' ' + Result; { '$ 1' } + 3: Result := Result + ' ' + ACurrStr; { '1 $' } + end; +end; + +function DateOf(const AValue: TDateTime): TDateTime; +begin + Result := Trunc(AValue); +end; + +function TimeOf(const AValue: TDateTime): TDateTime; +begin + Result := Frac(AValue); +end; + +function GetStartDateOfWeek(const AValue: TDateTime): TDateTime; +var + AStartOfWeek, ADayOfWeek: Integer; +begin + AStartOfWeek := GetStartOfWeek; + ADayOfWeek := DayOfWeek(AValue) - 1; + if ADayOfWeek < AStartOfWeek then + Result := DateOf(AValue) - 7 + (AStartOfWeek - ADayOfWeek) + else + Result := DateOf(AValue) - (ADayOfWeek - AStartOfWeek); +end; + +var + FStartOfWeek: Word = cxDataUnassignedStartOfWeek; + +function GetStartOfWeek: Word; +var + Buffer: array[0..1] of Char; +begin + if FStartOfWeek = cxDataUnassignedStartOfWeek then + begin + {$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$ENDIF} + if GetLocaleInfo(GetThreadLocale, LOCALE_IFIRSTDAYOFWEEK, Buffer, + SizeOf(Buffer)) > 0 then + Result := StrToInt(Buffer[0]) + else + Result := 0; + {$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM ON} + {$ENDIF} + Inc(Result); + if Result > 6 then Result := 0; + end + else + Result := FStartOfWeek; +end; + +procedure SetStartOfWeek(Value: Word); +begin + if Value in [0..6, cxDataUnassignedStartOfWeek] then + FStartOfWeek := Value; +end; + +function DataCompareText(const S1, S2: string; APartialCompare: Boolean): Boolean; +var + AText1, AText2: string; + L2: Integer; +begin + AText1 := AnsiUpperCase(S1); + AText2 := AnsiUpperCase(S2); + L2 := Length(AText2); + if L2 = 0 then + Result := Length(AText1) = 0 + else + if not APartialCompare then + Result := AText1 = AText2 + else + Result := (Length(AText1) >= L2) and (Copy(AText1, 1, L2) = AText2); +end; + +{ TcxCustomDataBinding } + +constructor TcxCustomDataBinding.Create(AOwner, ADataComponent: TComponent); +begin + inherited Create; + FDataComponent := ADataComponent; + FOwner := AOwner; +end; + +function TcxCustomDataBinding.CanModify: Boolean; +begin + Result := not ReadOnly; +end; + +function TcxCustomDataBinding.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := False; +end; + +function TcxCustomDataBinding.GetStoredValue(AValueSource: TcxDataEditValueSource; + AFocused: Boolean): Variant; +begin + Result := Null; +end; + +function TcxCustomDataBinding.IsControlReadOnly: Boolean; +begin + Result := ReadOnly; +end; + +function TcxCustomDataBinding.IsDataSourceLive: Boolean; +begin + Result := True; +end; + +function TcxCustomDataBinding.IsDataStorage: Boolean; +begin + Result := False; +end; + +procedure TcxCustomDataBinding.Reset; +begin +end; + +function TcxCustomDataBinding.SetEditMode: Boolean; +begin + Result := CanModify; +end; + +procedure TcxCustomDataBinding.SetStoredValue(AValueSource: TcxDataEditValueSource; + const Value: Variant); +begin +end; + +function TcxCustomDataBinding.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := False; +end; + +procedure TcxCustomDataBinding.UpdateDataSource; +begin +end; + +function TcxCustomDataBinding.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +procedure TcxCustomDataBinding.DataChange; +begin + if Assigned(FOnDataChange) then + FOnDataChange; +end; + +procedure TcxCustomDataBinding.DataSetChange; +begin + if Assigned(FOnDataSetChange) then + FOnDataSetChange; +end; + +function TcxCustomDataBinding.GetModified: Boolean; +begin + Result := False; +end; + +function TcxCustomDataBinding.GetReadOnly: Boolean; +begin + Result := FReadOnly; +end; + +procedure TcxCustomDataBinding.SetReadOnly(Value: Boolean); +begin + if Value <> FReadOnly then + begin + FReadOnly := Value; + DataSetChange; + end; +end; + +procedure TcxCustomDataBinding.UpdateData; +begin + if Assigned(FOnUpdateData) then + FOnUpdateData; +end; + +procedure TcxCustomDataBinding.VisualControlChanged; +begin +end; + +procedure TcxCustomDataBinding.SetVisualControl(Value: TComponent); +begin + if Value <> FVisualControl then + begin + FVisualControl := Value; + VisualControlChanged; + end; +end; + +{ TcxCollection } + +procedure TcxCollection.Assign(Source: TPersistent); +var + I: Integer; + AItem: TCollectionItem; +begin + if Source is TCollection then + begin + if (Count = 0) and (TCollection(Source).Count = 0) then Exit; + BeginUpdate; + try + for I := 0 to TCollection(Source).Count - 1 do + begin + if I > Count - 1 then + AItem := Add + else + AItem := Items[I]; + AItem.Assign(TCollection(Source).Items[I]); + end; + for I := Count - 1 downto TCollection(Source).Count do + Delete(I); + finally + EndUpdate; + end; + end + else + inherited; +end; + +{$IFNDEF DELPHI6} +function TcxCollection.Owner: TPersistent; +begin + Result := GetOwner; +end; +{$ENDIF} + +end. diff --git a/official/x.35/ExpressDataController/Sources/cxFilter.pas b/official/x.35/ExpressDataController/Sources/cxFilter.pas new file mode 100644 index 00000000..e5c49e89 --- /dev/null +++ b/official/x.35/ExpressDataController/Sources/cxFilter.pas @@ -0,0 +1,3027 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDataController } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDATACONTROLLER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxFilter; + +{$I cxVer.inc} + +interface + +uses + Classes{$IFDEF DELPHI6}, Variants{$ENDIF}; + +type + TcxFilterOperatorKind = (foEqual, foNotEqual, foLess, foLessEqual, + foGreater, foGreaterEqual, foLike, foNotLike, foBetween, foNotBetween, + foInList, foNotInList, + foYesterday, foToday, foTomorrow, + foLast7Days, foLastWeek, foLast14Days, foLastTwoWeeks, foLast30Days, foLastMonth, foLastYear, foInPast, + foThisWeek, foThisMonth, foThisYear, + foNext7Days, foNextWeek, foNext14Days, foNextTwoWeeks, foNext30Days, foNextMonth, foNextYear, foInFuture); + TcxFilterOperatorKinds = set of TcxFilterOperatorKind; + TcxFilterBoolOperatorKind = (fboAnd, fboOr, fboNotAnd, fboNotOr); + + TcxFilterCriteriaItemList = class; + TcxFilterCriteriaItem = class; + TcxFilterCriteria = class; + + { TcxFilterOperator + CompareValues(): Value1 is Data Value, Value2 is CompareItem's Value } + + TcxFilterOperator = class + private + FCriteriaItem: TcxFilterCriteriaItem; + protected + function GetExpressionFilterText(const AValue: Variant): string; virtual; + function GetExpressionValue(const AValue: Variant): string; virtual; + procedure PrepareDisplayValue(var DisplayValue: string); virtual; + procedure Prepare; virtual; + function PrepareExpressionValue(const AValue: Variant; var DisplayValue: string): Boolean; virtual; + public + constructor Create(ACriteriaItem: TcxFilterCriteriaItem); virtual; + function CompareValues(const AValue1, AValue2: Variant): Boolean; virtual; abstract; + function DisplayText: string; virtual; + function FilterText: string; virtual; abstract; + function IsDescription: Boolean; virtual; + function IsExpression: Boolean; virtual; + function IsNullOperator: Boolean; virtual; + property CriteriaItem: TcxFilterCriteriaItem read FCriteriaItem; + end; + + TcxFilterOperatorClass = class of TcxFilterOperator; + + { TcxFilterEqualOperator } + + TcxFilterEqualOperator = class(TcxFilterOperator) + protected + function GetExpressionFilterText(const AValue: Variant): string; override; + public + function CompareValues(const AValue1, AValue2: Variant): Boolean; override; + function DisplayText: string; override; + function FilterText: string; override; + function IsExpression: Boolean; override; + end; + + { TcxFilterNotEqualOperator } + + TcxFilterNotEqualOperator = class(TcxFilterEqualOperator) + protected + function GetExpressionFilterText(const AValue: Variant): string; override; + public + function CompareValues(const AValue1, AValue2: Variant): Boolean; override; + function DisplayText: string; override; + function FilterText: string; override; + end; + + { TcxFilterLessOperator } + + TcxFilterLessOperator = class(TcxFilterOperator) + public + function CompareValues(const AValue1, AValue2: Variant): Boolean; override; + function DisplayText: string; override; + function FilterText: string; override; + end; + + { TcxFilterLessEqualOperator } + + TcxFilterLessEqualOperator = class(TcxFilterOperator) + public + function CompareValues(const AValue1, AValue2: Variant): Boolean; override; + function DisplayText: string; override; + function FilterText: string; override; + end; + + { TcxFilterGreaterOperator } + + TcxFilterGreaterOperator = class(TcxFilterOperator) + public + function CompareValues(const AValue1, AValue2: Variant): Boolean; override; + function DisplayText: string; override; + function FilterText: string; override; + end; + + { TcxFilterGreaterEqualOperator } + + TcxFilterGreaterEqualOperator = class(TcxFilterOperator) + public + function CompareValues(const AValue1, AValue2: Variant): Boolean; override; + function DisplayText: string; override; + function FilterText: string; override; + end; + + { TcxFilterLikeOperator } + + TcxFilterLikeOperator = class(TcxFilterOperator) + protected + procedure PrepareDisplayValue(var DisplayValue: string); override; + public + function CompareValues(const AValue1, AValue2: Variant): Boolean; override; + function DisplayText: string; override; + function FilterText: string; override; + end; + + { TcxFilterNotLikeOperator } + + TcxFilterNotLikeOperator = class(TcxFilterLikeOperator) + protected + function GetExpressionFilterText(const AValue: Variant): string; override; + public + function CompareValues(const AValue1, AValue2: Variant): Boolean; override; + function DisplayText: string; override; + function FilterText: string; override; + function IsExpression: Boolean; override; + end; + + { TcxFilterBetweenOperator } + + TcxFilterBetweenOperator = class(TcxFilterOperator) + protected + function GetExpressionFilterText(const AValue: Variant): string; override; + procedure PrepareDisplayValue(var DisplayValue: string); override; + function PrepareExpressionValue(const AValue: Variant; var DisplayValue: string): Boolean; override; + public + function CompareValues(const AValue1, AValue2: Variant): Boolean; override; + function DisplayText: string; override; + function FilterText: string; override; + function IsDescription: Boolean; override; + function IsExpression: Boolean; override; + end; + + { TcxFilterNotBetweenOperator } + + TcxFilterNotBetweenOperator = class(TcxFilterBetweenOperator) + protected + function GetExpressionFilterText(const AValue: Variant): string; override; + public + function CompareValues(const AValue1, AValue2: Variant): Boolean; override; + function DisplayText: string; override; + function FilterText: string; override; + end; + + { TcxFilterInListOperator } + + TcxFilterInListOperator = class(TcxFilterOperator) + protected + function GetExpressionFilterText(const AValue: Variant): string; override; + procedure PrepareDisplayValue(var DisplayValue: string); override; + function PrepareExpressionValue(const AValue: Variant; var DisplayValue: string): Boolean; override; + public + function CompareValues(const AValue1, AValue2: Variant): Boolean; override; + function DisplayText: string; override; + function FilterText: string; override; + function IsDescription: Boolean; override; + function IsExpression: Boolean; override; + end; + + { TcxFilterNotInListOperator } + + TcxFilterNotInListOperator = class(TcxFilterInListOperator) + protected + function GetExpressionFilterText(const AValue: Variant): string; override; + public + function CompareValues(const AValue1, AValue2: Variant): Boolean; override; + function DisplayText: string; override; + function FilterText: string; override; + end; + + { TcxFilterNullOperator } + + TcxFilterNullOperator = class(TcxFilterEqualOperator) + protected + procedure PrepareDisplayValue(var DisplayValue: string); override; + public + function CompareValues(const AValue1, AValue2: Variant): Boolean; override; + function DisplayText: string; override; + function IsNullOperator: Boolean; override; + end; + + { TcxFilterNotNullOperator } + + TcxFilterNotNullOperator = class(TcxFilterNullOperator) + public + function CompareValues(const AValue1, AValue2: Variant): Boolean; override; + function DisplayText: string; override; + function FilterText: string; override; + end; + + { TcxFilterDateOperator } + + TcxFilterDateOperator = class(TcxFilterOperator) + private + FDate1: TDateTime; + FDate2: TDateTime; + protected + procedure PrepareDisplayValue(var DisplayValue: string); override; + function GetExpressionFilterText(const AValue: Variant): string; override; + public + function CompareValues(const AValue1, AValue2: Variant): Boolean; override; + function FilterText: string; override; + function IsExpression: Boolean; override; + property Date1: TDateTime read FDate1 write FDate1; + property Date2: TDateTime read FDate2 write FDate2; + end; + + { Yesterday } + + TcxFilterYesterdayOperator = class(TcxFilterDateOperator) + protected + procedure Prepare; override; + public + function DisplayText: string; override; + end; + + { Today } + + TcxFilterTodayOperator = class(TcxFilterDateOperator) + protected + procedure Prepare; override; + public + function DisplayText: string; override; + end; + + { Tomorrow } + + TcxFilterTomorrowOperator = class(TcxFilterDateOperator) + protected + procedure Prepare; override; + public + function DisplayText: string; override; + end; + + { LastNDays } + + TcxFilterLastNDaysOperator = class(TcxFilterDateOperator) + protected + function DayCount: Integer; virtual; abstract; + procedure Prepare; override; + end; + + { Last7Days } + + TcxFilterLast7DaysOperator = class(TcxFilterLastNDaysOperator) + protected + function DayCount: Integer; override; + public + function DisplayText: string; override; + end; + + { LastWeek } + + TcxFilterLastWeekOperator = class(TcxFilterDateOperator) + protected + procedure Prepare; override; + public + function DisplayText: string; override; + end; + + { Last14Days } + + TcxFilterLast14DaysOperator = class(TcxFilterLastNDaysOperator) + protected + function DayCount: Integer; override; + public + function DisplayText: string; override; + end; + + { LastTwoWeeks } + + TcxFilterLastTwoWeeksOperator = class(TcxFilterDateOperator) + protected + procedure Prepare; override; + public + function DisplayText: string; override; + end; + + { Last30Days } + + TcxFilterLast30DaysOperator = class(TcxFilterLastNDaysOperator) + protected + function DayCount: Integer; override; + public + function DisplayText: string; override; + end; + + { LastMonth } + + TcxFilterLastMonthOperator = class(TcxFilterDateOperator) + protected + procedure Prepare; override; + public + function DisplayText: string; override; + end; + + { LastYear } + + TcxFilterLastYearOperator = class(TcxFilterDateOperator) + protected + procedure Prepare; override; + public + function DisplayText: string; override; + end; + + { InPast } + + TcxFilterInPastOperator = class(TcxFilterDateOperator) + protected + procedure Prepare; override; + public + function DisplayText: string; override; + end; + + { ThisWeek } + + TcxFilterThisWeekOperator = class(TcxFilterDateOperator) + protected + procedure Prepare; override; + public + function DisplayText: string; override; + end; + + { ThisMonth } + + TcxFilterThisMonthOperator = class(TcxFilterDateOperator) + protected + procedure Prepare; override; + public + function DisplayText: string; override; + end; + + { ThisYear } + + TcxFilterThisYearOperator = class(TcxFilterDateOperator) + protected + procedure Prepare; override; + public + function DisplayText: string; override; + end; + + { NextNDays } + + TcxFilterNextNDaysOperator = class(TcxFilterDateOperator) + protected + function DayCount: Integer; virtual; abstract; + procedure Prepare; override; + end; + + { Next7Days } + + TcxFilterNext7DaysOperator = class(TcxFilterNextNDaysOperator) + protected + function DayCount: Integer; override; + public + function DisplayText: string; override; + end; + + { NextWeek } + + TcxFilterNextWeekOperator = class(TcxFilterDateOperator) + protected + procedure Prepare; override; + public + function DisplayText: string; override; + end; + + { Next14Days } + + TcxFilterNext14DaysOperator = class(TcxFilterNextNDaysOperator) + protected + function DayCount: Integer; override; + public + function DisplayText: string; override; + end; + + { NextTwoWeeks } + + TcxFilterNextTwoWeeksOperator = class(TcxFilterDateOperator) + protected + procedure Prepare; override; + public + function DisplayText: string; override; + end; + + { Next30Days } + + TcxFilterNext30DaysOperator = class(TcxFilterNextNDaysOperator) + protected + function DayCount: Integer; override; + public + function DisplayText: string; override; + end; + + { NextMonth } + + TcxFilterNextMonthOperator = class(TcxFilterDateOperator) + protected + procedure Prepare; override; + public + function DisplayText: string; override; + end; + + { NextYear } + + TcxFilterNextYearOperator = class(TcxFilterDateOperator) + protected + procedure Prepare; override; + public + function DisplayText: string; override; + end; + + { InFuture } + + TcxFilterInFutureOperator = class(TcxFilterDateOperator) + protected + procedure Prepare; override; + public + function DisplayText: string; override; + end; + + { TcxCustomFilterCriteriaItem } + + TcxCustomFilterCriteriaItem = class + private + FParent: TcxFilterCriteriaItemList; + protected + procedure Changed; virtual; + function GetCriteria: TcxFilterCriteria; virtual; + function GetIsItemList: Boolean; virtual; abstract; + procedure ReadData(AStream: TStream); virtual; + procedure WriteData(AStream: TStream); virtual; + public + constructor Create(AOwner: TcxFilterCriteriaItemList); + destructor Destroy; override; + function IsEmpty: Boolean; virtual; abstract; + property IsItemList: Boolean read GetIsItemList; + property Criteria: TcxFilterCriteria read GetCriteria; + property Parent: TcxFilterCriteriaItemList read FParent; + end; + + { TcxFilterCriteriaItemList } + + TcxFilterCriteriaItemListClass = class of TcxFilterCriteriaItemList; + + TcxFilterCriteriaItemList = class(TcxCustomFilterCriteriaItem) + private + FBoolOperatorKind: TcxFilterBoolOperatorKind; + FCriteria: TcxFilterCriteria; + FItems: TList; + function GetCount: Integer; + function GetItem(Index: Integer): TcxCustomFilterCriteriaItem; + procedure SetBoolOperatorKind(Value: TcxFilterBoolOperatorKind); + protected + function GetCriteria: TcxFilterCriteria; override; + function GetIsItemList: Boolean; override; + procedure RemoveItem(AItem: TcxCustomFilterCriteriaItem); virtual; + procedure ReadData(AStream: TStream); override; + procedure WriteData(AStream: TStream); override; + function ReadItem(AStream: TStream): TcxCustomFilterCriteriaItem; + procedure WriteItem(AStream: TStream; AItem: TcxCustomFilterCriteriaItem); + public + constructor Create(AOwner: TcxFilterCriteriaItemList; ABoolOperatorKind: TcxFilterBoolOperatorKind); virtual; + destructor Destroy; override; + function AddItem(AItemLink: TObject; AOperatorKind: TcxFilterOperatorKind; + const AValue: Variant; const ADisplayValue: string): TcxFilterCriteriaItem; + function AddItemList(ABoolOperatorKind: TcxFilterBoolOperatorKind): TcxFilterCriteriaItemList; + procedure Clear; + function IsEmpty: Boolean; override; + property BoolOperatorKind: TcxFilterBoolOperatorKind read FBoolOperatorKind write SetBoolOperatorKind default fboAnd; + property Count: Integer read GetCount; + property Criteria: TcxFilterCriteria read GetCriteria; + property Items[Index: Integer]: TcxCustomFilterCriteriaItem read GetItem; default; + end; + + { TcxFilterCriteriaItem } + + TcxFilterCriteriaItem = class(TcxCustomFilterCriteriaItem) + private + FDisplayValue: string; + FItemLink: TObject; + FOperator: TcxFilterOperator; + FOperatorKind: TcxFilterOperatorKind; + FValue: Variant; + procedure SetDisplayValue(const Value: string); + procedure SetOperatorKind(Value: TcxFilterOperatorKind); + procedure SetValue(const Value: Variant); + protected + procedure CheckDisplayValue; + function GetDataValue(AData: TObject): Variant; virtual; abstract; + function GetDisplayValue: string; virtual; + function GetExpressionValue(AIsCaption: Boolean): string; virtual; + function GetFieldCaption: string; virtual; abstract; + function GetFieldName: string; virtual; abstract; + function GetFilterOperatorClass: TcxFilterOperatorClass; virtual; + function GetItemLink: TObject; virtual; + procedure SetItemLink(Value: TObject); virtual; + function GetIsItemList: Boolean; override; + procedure RecreateOperator; virtual; + procedure ReadData(AStream: TStream); override; + procedure WriteData(AStream: TStream); override; + public + constructor Create(AOwner: TcxFilterCriteriaItemList; AItemLink: TObject; + AOperatorKind: TcxFilterOperatorKind; const AValue: Variant; + const ADisplayValue: string); virtual; + destructor Destroy; override; + function IsEmpty: Boolean; override; + function ValueIsNull(const AValue: Variant): Boolean; virtual; + property DisplayValue: string read FDisplayValue write SetDisplayValue; + property ItemLink: TObject read GetItemLink; + property Operator: TcxFilterOperator read FOperator; + property OperatorKind: TcxFilterOperatorKind read FOperatorKind write SetOperatorKind; + property Value: Variant read FValue write SetValue; + end; + + TcxFilterCriteriaItemClass = class of TcxFilterCriteriaItem; + + { TcxFilterValueList } + + TcxFilterValueItemKind = (fviAll, fviCustom, fviBlanks, fviNonBlanks, fviUser, + fviValue, fviMRU, fviMRUSeparator, fviSpecial); + + TcxFilterValueItem = record + Kind: TcxFilterValueItemKind; + Value: Variant; + DisplayText: string; + end; + PcxFilterValueItem = ^TcxFilterValueItem; + + TcxFilterValueList = class + private + FCriteria: TcxFilterCriteria; + FItems: TList; + FSortByDisplayText: Boolean; + function GetCount: Integer; + function GetItem(Index: Integer): PcxFilterValueItem; + function GetMaxCount: Integer; + protected + function CompareItem(AIndex: Integer; const AValue: Variant; const ADisplayText: string): Integer; virtual; + function GetMRUSeparatorIndex: Integer; + function GetStartValueIndex: Integer; + public + constructor Create(ACriteria: TcxFilterCriteria); virtual; + destructor Destroy; override; + procedure Add(AKind: TcxFilterValueItemKind; const AValue: Variant; const ADisplayText: string; ANoSorting: Boolean); virtual; + procedure Clear; virtual; + procedure Delete(AIndex: Integer); + function Find(const AValue: Variant; const ADisplayText: string; var AIndex: Integer): Boolean; virtual; + function FindItemByKind(AKind: TcxFilterValueItemKind): Integer; overload; + function FindItemByKind(AKind: TcxFilterValueItemKind; const AValue: Variant): Integer; overload; + function FindItemByValue(const AValue: Variant): Integer; + function GetIndexByCriteriaItem(ACriteriaItem: TcxFilterCriteriaItem): Integer; virtual; + property Count: Integer read GetCount; + property Criteria: TcxFilterCriteria read FCriteria; + property Items[Index: Integer]: PcxFilterValueItem read GetItem; default; + property ItemsList: TList read FItems; + property MaxCount: Integer read GetMaxCount; + property SortByDisplayText: Boolean read FSortByDisplayText write FSortByDisplayText; + end; + + TcxFilterValueListClass = class of TcxFilterValueList; + + { TcxFilterCriteria } + + TcxFilterCriteriaOption = (fcoCaseInsensitive, fcoShowOperatorDescription, + fcoSoftNull, fcoSoftCompare, fcoIgnoreNull); + TcxFilterCriteriaOptions = set of TcxFilterCriteriaOption; + + TcxFilterCriteria = class(TPersistent) + private + FChanged: Boolean; + FDateTimeFormat: string; + FLoadedVersion: Byte; + FLockCount: Integer; + FMaxValueListCount: Integer; + FOptions: TcxFilterCriteriaOptions; + FPercentWildcard: Char; + FRoot: TcxFilterCriteriaItemList; + FSavedVersion: Byte; + FSavingToStream: Boolean; + FSupportedLike: Boolean; + FTranslateBetween: Boolean; + FTranslateLike: Boolean; + FTranslateIn: Boolean; + FUnderscoreWildcard: Char; + FVersion: Byte; + FOnChanged: TNotifyEvent; + function GetOptions: TcxFilterCriteriaOptions; + function GetStoreItemLinkNames: Boolean; + procedure SetDateTimeFormat(const Value: string); + procedure SetOptions(Value: TcxFilterCriteriaOptions); + procedure SetPercentWildcard(Value: Char); + procedure SetStoreItemLinkNames(Value: Boolean); + procedure SetUnderscoreWildcard(Value: Char); + protected + procedure CheckChanges; virtual; + function ConvertBoolToStr(const AValue: Variant): string; virtual; + function ConvertDateToStr(const AValue: Variant): string; virtual; + function DoFilterData(AData: TObject): Boolean; + procedure FormatFilterTextValue(AItem: TcxFilterCriteriaItem; const AValue: Variant; + var ADisplayValue: string); virtual; + function GetFilterCaption: string; virtual; + function GetFilterExpression(AIsCaption: Boolean): string; virtual; + function GetFilterText: string; virtual; + function GetIDByItemLink(AItemLink: TObject): Integer; virtual; abstract; + function GetNameByItemLink(AItemLink: TObject): string; virtual; abstract; + function GetItemClass: TcxFilterCriteriaItemClass; virtual; + function GetItemListClass: TcxFilterCriteriaItemListClass; virtual; + function GetItemExpression(AItem: TcxFilterCriteriaItem; AIsCaption: Boolean): string; virtual; + function GetItemExpressionFieldName(AItem: TcxFilterCriteriaItem; AIsCaption: Boolean): string; virtual; + function GetItemExpressionOperator(AItem: TcxFilterCriteriaItem; AIsCaption: Boolean): string; virtual; + function GetItemExpressionValue(AItem: TcxFilterCriteriaItem; AIsCaption: Boolean): string; virtual; + function GetItemLinkByID(AID: Integer): TObject; virtual; abstract; + function GetItemLinkByName(const AName: string): TObject; virtual; abstract; + function GetValueListClass: TcxFilterValueListClass; virtual; + function IsStore: Boolean; + procedure Prepare; virtual; + function PrepareValue(AValue: Variant): Variant; virtual; + procedure SetFilterText(const Value: string); virtual; + procedure Update; virtual; + + property LoadedVersion: Byte read FLoadedVersion; + property LockCount: Integer read FLockCount; + property SavedVersion: Byte read FSavedVersion; + property Version: Byte read FVersion write FVersion; + public + constructor Create; + destructor Destroy; override; + procedure Assign(Source: TPersistent; AIgnoreItemNames: Boolean = False); reintroduce; virtual; + procedure AssignEvents(Source: TPersistent); virtual; + procedure AssignItems(ASource: TcxFilterCriteria; AIgnoreItemNames: Boolean = False); virtual; + function AddItem(AParent: TcxFilterCriteriaItemList; AItemLink: TObject; + AOperatorKind: TcxFilterOperatorKind; const AValue: Variant; + const ADisplayValue: string): TcxFilterCriteriaItem; virtual; + procedure BeginUpdate; + procedure CancelUpdate; + procedure Clear; + procedure Changed; virtual; + procedure EndUpdate; + function EqualItems(AFilterCriteria: TcxFilterCriteria): Boolean; + function FindItemByItemLink(AItemLink: TObject): TcxFilterCriteriaItem; virtual; + function IsEmpty: Boolean; virtual; + procedure LoadFromStream(AStream: TStream); virtual; + procedure Refresh; + procedure RemoveItemByItemLink(AItemLink: TObject); + procedure RestoreDefaults; virtual; + procedure SaveToStream(AStream: TStream); virtual; + function ValueIsNull(const AValue: Variant): Boolean; virtual; + // internal + procedure ReadData(AStream: TStream); virtual; + procedure WriteData(AStream: TStream); overload; + procedure WriteData(AStream: TStream; AVersion: Byte); overload; virtual; + + property DateTimeFormat: string read FDateTimeFormat write SetDateTimeFormat; + property FilterCaption: string read GetFilterCaption; + property FilterText: string read GetFilterText write SetFilterText; + property Root: TcxFilterCriteriaItemList read FRoot; + property StoreItemLinkNames: Boolean read GetStoreItemLinkNames write SetStoreItemLinkNames; + property SupportedLike: Boolean read FSupportedLike write FSupportedLike default True; + property TranslateBetween: Boolean read FTranslateBetween write FTranslateBetween default False; + property TranslateIn: Boolean read FTranslateIn write FTranslateIn default False; + property TranslateLike: Boolean read FTranslateLike write FTranslateLike default False; + published + property MaxValueListCount: Integer read FMaxValueListCount write FMaxValueListCount default 0; + property Options: TcxFilterCriteriaOptions read GetOptions write SetOptions default []; + property PercentWildcard: Char read FPercentWildcard write SetPercentWildcard default '%'; + property UnderscoreWildcard: Char read FUnderscoreWildcard write SetUnderscoreWildcard default '_'; + property OnChanged: TNotifyEvent read FOnChanged write FOnChanged; + end; + +function ExtractFilterDisplayValue(const AValues: string; var Pos: Integer): string; + +//function StrToVarBetweenArray(const AValue: string): Variant; +//function StrToVarListArray(const AValue: string): Variant; + +function VarBetweenArrayToStr(const AValue: Variant): string; +function VarListArrayToStr(const AValue: Variant): string; + +var + cxFilterIncludeTodayInLastNextDaysList: Boolean = True; + +implementation + +uses + {$IFDEF DELPHI9}Windows, {$ENDIF} + SysUtils, Math, + {$IFDEF DELPHI6}RTLConsts, SqlTimSt,{$ENDIF} + cxVariants, cxLike, cxFilterConsts, cxDataUtils; + +const + cxFilterNullDate = 0; // it is safe because we do not use such past dates for the property values + +type + TFilterWrapper = class(TComponent) + private + FFilter: TcxFilterCriteria; + published + property Filter: TcxFilterCriteria read FFilter write FFilter; + end; + +function FilterVarToStr(const AValue: Variant): string; +begin + if VarIsNull(AValue) then + Result := cxSFilterString(@cxSFilterBlankCaption) + else + Result := VarToStr(AValue); +end; + +function ExtractFilterDisplayValue(const AValues: string; var Pos: Integer): string; +var + I: Integer; +begin + I := Pos; + while (I <= Length(AValues)) and (AValues[I] <> ';') do Inc(I); + Result := Trim(Copy(AValues, Pos, I - Pos)); + if (I <= Length(AValues)) and (AValues[I] = ';') then Inc(I); + Pos := I; +end; + +function StrToVarBetweenArray(const AValue: string): Variant; +var + APos: Integer; + S1, S2: string; +begin + S1 := ''; + S2 := ''; + APos := 1; + S1 := ExtractFilterDisplayValue(AValue, APos); + if APos <= Length(AValue) then + S2 := ExtractFilterDisplayValue(AValue, APos); + Result := VarBetweenArrayCreate(S1, S2); +end; + +function StrToVarListArray(const AValue: string): Variant; +var + AEmpty: Boolean; + APos: Integer; + S: string; +begin + AEmpty := True; + Result := ''; + APos := 1; + while APos <= Length(AValue) do + begin + S := ExtractFilterDisplayValue(AValue, APos); + if AEmpty then + begin + Result := VarListArrayCreate(S); + AEmpty := False; + end + else + VarListArrayAddValue(Result, S); + end; +end; + +function StreamsEqual(AStream1, AStream2: TMemoryStream): Boolean; +begin + Result := (AStream1.Size = AStream2.Size) and + CompareMem(AStream1.Memory, AStream2.Memory, AStream1.Size); +end; + +function VarBetweenArrayToStr(const AValue: Variant): string; +begin + Result := FilterVarToStr(AValue[0]) + ' ' + + cxSFilterString(@cxSFilterAndCaption) + ' ' + FilterVarToStr(AValue[1]); +end; + +function VarListArrayToStr(const AValue: Variant): string; +var + I: Integer; +begin + Result := '(' + FilterVarToStr(AValue[0]); + for I := VarArrayLowBound(AValue, 1) + 1 to VarArrayHighBound(AValue, 1) do + Result := Result + ', ' + FilterVarToStr(AValue[I]); + Result := Result + ')'; +end; + +{ TcxFilterOperator } + +constructor TcxFilterOperator.Create(ACriteriaItem: TcxFilterCriteriaItem); +begin + inherited Create; + FCriteriaItem := ACriteriaItem; +end; + +function TcxFilterOperator.DisplayText: string; +begin + Result := FilterText; +end; + +function TcxFilterOperator.IsDescription: Boolean; +begin + Result := False; +end; + +function TcxFilterOperator.IsExpression: Boolean; +begin + Result := False; +end; + +function TcxFilterOperator.IsNullOperator: Boolean; +begin + Result := False; +end; + +function TcxFilterOperator.GetExpressionFilterText(const AValue: Variant): string; +begin + Result := GetExpressionValue(AValue); +end; + +function TcxFilterOperator.GetExpressionValue(const AValue: Variant): string; +var + AVarType: Integer; +begin + if not PrepareExpressionValue(AValue, Result) then + begin + AVarType := VarType(AValue); + if (AVarType = varString) or (AVarType = varOleStr) then // <- VarTypeIsStr() + Result := QuotedStr(VarToStr(AValue)) + else + if (AVarType = varDate) {$IFDEF DELPHI6} or (AVarType = VarSQLTimeStamp) {$ENDIF} then + Result := '''' + CriteriaItem.Criteria.ConvertDateToStr(AValue) + '''' + else + if AVarType = varBoolean then + Result := CriteriaItem.Criteria.ConvertBoolToStr(AValue) + else + if AVarType = varNull then + Result := 'NULL' + else + Result := VarToStr(AValue); + CriteriaItem.Criteria.FormatFilterTextValue(CriteriaItem, AValue, Result); + end; +end; + +procedure TcxFilterOperator.PrepareDisplayValue(var DisplayValue: string); +begin +end; + +procedure TcxFilterOperator.Prepare; +begin +end; + +function TcxFilterOperator.PrepareExpressionValue(const AValue: Variant; var DisplayValue: string): Boolean; +begin + Result := False; +end; + +{ TcxFilterEqualOperator } + +function TcxFilterEqualOperator.CompareValues(const AValue1, AValue2: Variant): Boolean; +begin + Result := VarCompare(AValue1, AValue2) = 0; +end; + +function TcxFilterEqualOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorEqual); +end; + +function TcxFilterEqualOperator.FilterText: string; +begin + Result := '='; +end; + +function TcxFilterEqualOperator.IsExpression: Boolean; +begin + Result := VarIsArray(CriteriaItem.Value); +end; + +function TcxFilterEqualOperator.GetExpressionFilterText(const AValue: Variant): string; + + function ExtractFieldName(const Fields: string; var Pos: Integer): string; + var + I: Integer; + begin + I := Pos; + while (I <= Length(Fields)) and (Fields[I] <> ';') do Inc(I); + Result := Trim(Copy(Fields, Pos, I - Pos)); + if (I <= Length(Fields)) and (Fields[I] = ';') then Inc(I); + Pos := I; + end; + +var + AFieldNames: string; + I, APos: Integer; +begin + AFieldNames := CriteriaItem.GetFieldName; + APos := 1; + Result := '(' + ExtractFieldName(AFieldNames, APos) + ' = ' + GetExpressionValue(AValue[0]) + ')'; + for I := VarArrayLowBound(AValue, 1) + 1 to VarArrayHighBound(AValue, 1) do + Result := Result + ' AND ' + + '(' + ExtractFieldName(AFieldNames, APos) + ' = ' + GetExpressionValue(AValue[I]) + ')'; +end; + +{ TcxFilterNotEqualOperator } + +function TcxFilterNotEqualOperator.CompareValues(const AValue1, AValue2: Variant): Boolean; +begin + Result := not inherited CompareValues(AValue1, AValue2); +end; + +function TcxFilterNotEqualOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorNotEqual); +end; + +function TcxFilterNotEqualOperator.FilterText: string; +begin + Result := '<>'; +end; + +function TcxFilterNotEqualOperator.GetExpressionFilterText(const AValue: Variant): string; +begin + Result := 'NOT (' + inherited GetExpressionFilterText(AValue) + ')'; +end; + +{ TcxFilterLessOperator } + +function TcxFilterLessOperator.CompareValues(const AValue1, AValue2: Variant): Boolean; +begin + {$IFNDEF DELPHI6} + Result := (AValue1 < AValue2); + {$ELSE} + Result := VarCompare(AValue1, AValue2) < 0; + {$ENDIF} +end; + +function TcxFilterLessOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorLess); +end; + +function TcxFilterLessOperator.FilterText: string; +begin + Result := '<'; +end; + +{ TcxFilterLessEqualOperator } + +function TcxFilterLessEqualOperator.CompareValues(const AValue1, AValue2: Variant): Boolean; +begin + {$IFNDEF DELPHI6} + Result := (AValue1 <= AValue2); + {$ELSE} + Result := VarCompare(AValue1, AValue2) <= 0; + {$ENDIF} +end; + +function TcxFilterLessEqualOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorLessEqual); +end; + +function TcxFilterLessEqualOperator.FilterText: string; +begin + Result := '<='; +end; + +{ TcxFilterGreaterOperator } + +function TcxFilterGreaterOperator.CompareValues(const AValue1, AValue2: Variant): Boolean; +begin + {$IFNDEF DELPHI6} + Result := (AValue1 > AValue2); + {$ELSE} + Result := VarCompare(AValue1, AValue2) > 0; + {$ENDIF} +end; + +function TcxFilterGreaterOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorGreater); +end; + +function TcxFilterGreaterOperator.FilterText: string; +begin + Result := '>'; +end; + +{ TcxFilterGreaterEqualOperator } + +function TcxFilterGreaterEqualOperator.CompareValues(const AValue1, AValue2: Variant): Boolean; +begin + {$IFNDEF DELPHI6} + Result := (AValue1 >= AValue2); + {$ELSE} + Result := VarCompare(AValue1, AValue2) >= 0; + {$ENDIF} +end; + +function TcxFilterGreaterEqualOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorGreaterEqual); +end; + +function TcxFilterGreaterEqualOperator.FilterText: string; +begin + Result := '>='; +end; + +{ TcxFilterLikeOperator } + +function TcxFilterLikeOperator.CompareValues(const AValue1, AValue2: Variant): Boolean; +begin + Result := LikeStr(VarToStr(AValue1), AValue2, + CriteriaItem.Criteria.PercentWildcard, CriteriaItem.Criteria.UnderscoreWildcard); +end; + +function TcxFilterLikeOperator.DisplayText: string; +var + S: string; +begin + S := CriteriaItem.Value; + case LikeOperatorByPattern(S, CriteriaItem.Criteria.PercentWildcard) of + floBeginsWith: + Result := cxSFilterString(@cxSFilterOperatorBeginsWith); + floEndsWith: + Result := cxSFilterString(@cxSFilterOperatorEndsWith); + floContains: + Result := cxSFilterString(@cxSFilterOperatorContains); + else + Result := cxSFilterString(@cxSFilterOperatorLike); + end; +end; + +function TcxFilterLikeOperator.FilterText: string; +begin + Result := 'LIKE'; +end; + +procedure TcxFilterLikeOperator.PrepareDisplayValue(var DisplayValue: string); +begin + if fcoShowOperatorDescription in CriteriaItem.Criteria.Options then + LikeOperatorByPattern(DisplayValue, CriteriaItem.Criteria.PercentWildcard); +end; + +{ TcxFilterNotLikeOperator } + +function TcxFilterNotLikeOperator.CompareValues(const AValue1, AValue2: Variant): Boolean; +begin + Result := not inherited CompareValues(AValue1, AValue2); +end; + +function TcxFilterNotLikeOperator.DisplayText: string; +var + S: string; +begin + S := CriteriaItem.Value; + case LikeOperatorByPattern(S, CriteriaItem.Criteria.PercentWildcard) of + floBeginsWith: + Result := cxSFilterString(@cxSFilterOperatorDoesNotBeginWith); + floEndsWith: + Result := cxSFilterString(@cxSFilterOperatorDoesNotEndWith); + floContains: + Result := cxSFilterString(@cxSFilterOperatorDoesNotContain); + else + Result := cxSFilterString(@cxSFilterOperatorNotLike); + end; +end; + +function TcxFilterNotLikeOperator.FilterText: string; +begin + Result := 'NOT LIKE'; +end; + +function TcxFilterNotLikeOperator.IsExpression: Boolean; +begin + Result := CriteriaItem.Criteria.TranslateLike; +end; + +function TcxFilterNotLikeOperator.GetExpressionFilterText(const AValue: Variant): string; +begin + Result := ' NOT (' + CriteriaItem.GetFieldName + ' LIKE ' + GetExpressionValue(AValue) + ')'; +end; + +{ TcxFilterBetweenOperator } + +function TcxFilterBetweenOperator.CompareValues(const AValue1, AValue2: Variant): Boolean; +begin + {$IFNDEF DELPHI6} + Result := (AValue2[0] <= AValue1) and (AValue1 <= AValue2[1]); + {$ELSE} + Result := (VarCompare(AValue2[0], AValue1) <= 0) and (VarCompare(AValue1, AValue2[1]) <= 0); + {$ENDIF} +end; + +function TcxFilterBetweenOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorBetween); +end; + +function TcxFilterBetweenOperator.FilterText: string; +begin + Result := 'BETWEEN'; +end; + +function TcxFilterBetweenOperator.IsDescription: Boolean; +begin + Result := True; +end; + +function TcxFilterBetweenOperator.IsExpression: Boolean; +begin + Result := CriteriaItem.Criteria.TranslateBetween; +end; + +function TcxFilterBetweenOperator.GetExpressionFilterText(const AValue: Variant): string; +var + AFieldName: string; +begin + AFieldName := CriteriaItem.GetFieldName; + Result := '(' + AFieldName + ' >= ' + GetExpressionValue(AValue[0]) + ') AND (' + + AFieldName + ' <= ' + GetExpressionValue(AValue[1]) + ')'; +end; + +procedure TcxFilterBetweenOperator.PrepareDisplayValue(var DisplayValue: string); +var + S: string; +begin + S := DisplayValue; + DisplayValue := VarBetweenArrayToStr(StrToVarBetweenArray(S)); +end; + +function TcxFilterBetweenOperator.PrepareExpressionValue(const AValue: Variant; + var DisplayValue: string): Boolean; +begin + Result := VarIsArray(AValue); + if Result then + DisplayValue := GetExpressionValue(AValue[0]) + ' AND ' + GetExpressionValue(AValue[1]); +end; + +{ TcxFilterNotBetweenOperator } + +function TcxFilterNotBetweenOperator.CompareValues(const AValue1, AValue2: Variant): Boolean; +begin + Result := not inherited CompareValues(AValue1, AValue2); +end; + +function TcxFilterNotBetweenOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorNotBetween); +end; + +function TcxFilterNotBetweenOperator.FilterText: string; +begin + Result := 'NOT BETWEEN'; +end; + +function TcxFilterNotBetweenOperator.GetExpressionFilterText(const AValue: Variant): string; +begin + Result := 'NOT (' + inherited GetExpressionFilterText(AValue) + ')'; +end; + +{ TcxFilterInListOperator } + +function TcxFilterInListOperator.CompareValues(const AValue1, AValue2: Variant): Boolean; +var + I: Integer; +begin + Result := False; + for I := VarArrayLowBound(AValue2, 1) to VarArrayHighBound(AValue2, 1) do + if AValue1 = AValue2[I] then + begin + Result := True; + Break; + end; +end; + +function TcxFilterInListOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorInList); +end; + +function TcxFilterInListOperator.FilterText: string; +begin + Result := 'IN'; +end; + +function TcxFilterInListOperator.IsDescription: Boolean; +begin + Result := True; +end; + +function TcxFilterInListOperator.IsExpression: Boolean; +begin + Result := CriteriaItem.Criteria.TranslateIn; +end; + +function TcxFilterInListOperator.GetExpressionFilterText(const AValue: Variant): string; +var + AFieldName: string; + I: Integer; +begin + AFieldName := CriteriaItem.GetFieldName; + Result := '(' + AFieldName + ' = ' + GetExpressionValue(AValue[0]) + ')'; + for I := VarArrayLowBound(AValue, 1) + 1 to VarArrayHighBound(AValue, 1) do + Result := Result + ' OR ' + '(' + AFieldName + ' = ' + GetExpressionValue(AValue[I]) + ')'; +end; + +procedure TcxFilterInListOperator.PrepareDisplayValue(var DisplayValue: string); +var + S: string; +begin + S := DisplayValue; + DisplayValue := VarListArrayToStr(StrToVarListArray(S)); +end; + +function TcxFilterInListOperator.PrepareExpressionValue(const AValue: Variant; + var DisplayValue: string): Boolean; +var + I: Integer; +begin + Result := VarIsArray(AValue); + if Result then + begin + DisplayValue := '(' + GetExpressionValue(AValue[0]); + for I := VarArrayLowBound(AValue, 1) + 1 to VarArrayHighBound(AValue, 1) do + DisplayValue := DisplayValue + ', ' + GetExpressionValue(AValue[I]); + DisplayValue := DisplayValue + ')'; + end; +end; + +{ TcxFilterNotInListOperator } + +function TcxFilterNotInListOperator.CompareValues(const AValue1, AValue2: Variant): Boolean; +begin + Result := not inherited CompareValues(AValue1, AValue2); +end; + +function TcxFilterNotInListOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorNotInList); +end; + +function TcxFilterNotInListOperator.FilterText: string; +begin + Result := 'NOT IN'; +end; + +function TcxFilterNotInListOperator.GetExpressionFilterText(const AValue: Variant): string; +begin + Result := 'NOT (' + inherited GetExpressionFilterText(AValue) + ')'; +end; + +{ TcxFilterNullOperator } + +function TcxFilterNullOperator.CompareValues(const AValue1, AValue2: Variant): Boolean; +begin + Result := CriteriaItem.ValueIsNull(AValue1); +end; + +function TcxFilterNullOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorIsNull); +end; + +function TcxFilterNullOperator.IsNullOperator: Boolean; +begin + Result := True; +end; + +procedure TcxFilterNullOperator.PrepareDisplayValue(var DisplayValue: string); +begin + if fcoShowOperatorDescription in CriteriaItem.Criteria.Options then + DisplayValue := ''; +end; + +{ TcxFilterNotNullOperator } + +function TcxFilterNotNullOperator.CompareValues(const AValue1, AValue2: Variant): Boolean; +begin + Result := not inherited CompareValues(AValue1, AValue2); +end; + +function TcxFilterNotNullOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorIsNotNull); +end; + +function TcxFilterNotNullOperator.FilterText: string; +begin + Result := '<>'; +end; + +{ TcxFilterDateOperator } + +function TcxFilterDateOperator.CompareValues(const AValue1, AValue2: Variant): Boolean; +begin + if CriteriaItem.ValueIsNull(AValue1) then + Result := False + else + Result := + ((Date1 = cxFilterNullDate) or (Date1 <= AValue1)) and + ((Date2 = cxFilterNullDate) or (AValue1 < Date2)); +end; + +function TcxFilterDateOperator.FilterText: string; +begin + Result := DisplayText; +end; + +function TcxFilterDateOperator.IsExpression: Boolean; +begin + Result := True; +end; + +function TcxFilterDateOperator.GetExpressionFilterText(const AValue: Variant): string; +var + AFieldName: string; +begin + AFieldName := CriteriaItem.GetFieldName; + if Date1 <> cxFilterNullDate then + Result := '(' + AFieldName + ' >= ' + GetExpressionValue(Date1) + ')' + else + Result := ''; + if Date2 <> cxFilterNullDate then + begin + if Result <> '' then + Result := Result + ' AND '; + Result := Result + '(' + AFieldName + ' < ' + GetExpressionValue(Date2) + ')'; + end; +end; + +procedure TcxFilterDateOperator.PrepareDisplayValue(var DisplayValue: string); +begin + DisplayValue := ''; +end; + +{ Yesterday } + +procedure TcxFilterYesterdayOperator.Prepare; +var + ANowDate: TDateTime; +begin + ANowDate := Date; + Date1 := ANowDate - 1; + Date2 := ANowDate; +end; + +function TcxFilterYesterdayOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorYesterday); +end; + +{ Today } + +procedure TcxFilterTodayOperator.Prepare; +var + ANowDate: TDateTime; +begin + ANowDate := Date; + Date1 := ANowDate; + Date2 := ANowDate + 1; +end; + +function TcxFilterTodayOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorToday); +end; + +{ Tomorrow } + +procedure TcxFilterTomorrowOperator.Prepare; +var + ANowDate: TDateTime; +begin + ANowDate := Date; + Date1 := ANowDate + 1; + Date2 := ANowDate + 2; +end; + +function TcxFilterTomorrowOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorTomorrow); +end; + +{ LastNDays } + +procedure TcxFilterLastNDaysOperator.Prepare; +begin + Date2 := Date; + if cxFilterIncludeTodayInLastNextDaysList then + Date2 := Date2 + 1; + Date1 := Date2 - DayCount; +end; + +{ Last7Days } + +function TcxFilterLast7DaysOperator.DayCount: Integer; +begin + Result := 7; +end; + +function TcxFilterLast7DaysOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorLast7Days); +end; + +{ LastWeek } + +procedure TcxFilterLastWeekOperator.Prepare; +var + ANowDate: TDateTime; +begin + ANowDate := Date; + Date1 := GetStartDateOfWeek(ANowDate) - 7; + Date2 := Date1 + 7; +end; + +function TcxFilterLastWeekOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorLastWeek); +end; + +{ Last14Days } + +function TcxFilterLast14DaysOperator.DayCount: Integer; +begin + Result := 14; +end; + +function TcxFilterLast14DaysOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorLast14Days); +end; + +{ LastTwoWeeks } + +procedure TcxFilterLastTwoWeeksOperator.Prepare; +begin + Date1 := GetStartDateOfWeek(Date) - 2 * 7; + Date2 := Date1 + 2 * 7; +end; + +function TcxFilterLastTwoWeeksOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorLastTwoWeeks); +end; + +{ Last30Days } + +function TcxFilterLast30DaysOperator.DayCount: Integer; +begin + Result := 30; +end; + +function TcxFilterLast30DaysOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorLast30Days); +end; + +{ LastMonth } + +procedure TcxFilterLastMonthOperator.Prepare; +var + ANowDate: TDateTime; + D, M, Y: Word; +begin + ANowDate := Date; + DecodeDate(ANowDate, Y, M, D); + if M > 1 then + begin + Date1 := EncodeDate(Y, M - 1, 1); + Date2 := EncodeDate(Y, M, 1); + end + else + begin + Date1 := EncodeDate(Y - 1, 12, 1); + Date2 := EncodeDate(Y, 1, 1); + end; +end; + +function TcxFilterLastMonthOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorLastMonth); +end; + +{ LastYear } + +procedure TcxFilterLastYearOperator.Prepare; +var + ANowDate: TDateTime; + D, M, Y: Word; +begin + ANowDate := Date; + DecodeDate(ANowDate, Y, M, D); + Date1 := EncodeDate(Y - 1, 1, 1); + Date2 := EncodeDate(Y, 1, 1); +end; + +function TcxFilterLastYearOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorLastYear); +end; + +{ InPast } + +procedure TcxFilterInPastOperator.Prepare; +begin + Date1 := cxFilterNullDate; + Date2 := Date; +end; + +function TcxFilterInPastOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorPast); +end; + +{ ThisWeek } + +procedure TcxFilterThisWeekOperator.Prepare; +var + ANowDate: TDateTime; +begin + ANowDate := Date; + Date1 := GetStartDateOfWeek(ANowDate); + Date2 := Date1 + 7; +end; + +function TcxFilterThisWeekOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorThisWeek); +end; + +{ ThisMonth } + +procedure TcxFilterThisMonthOperator.Prepare; +var + ANowDate: TDateTime; + D, M, Y: Word; +begin + ANowDate := Date; + DecodeDate(ANowDate, Y, M, D); + if M < 12 then + begin + Date1 := EncodeDate(Y, M, 1); + Date2 := EncodeDate(Y, M + 1, 1); + end + else + begin + Date1 := EncodeDate(Y, M, 1); + Date2 := EncodeDate(Y + 1, 1, 1); + end; +end; + +function TcxFilterThisMonthOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorThisMonth); +end; + +{ ThisYear } + +procedure TcxFilterThisYearOperator.Prepare; +var + ANowDate: TDateTime; + D, M, Y: Word; +begin + ANowDate := Date; + DecodeDate(ANowDate, Y, M, D); + Date1 := EncodeDate(Y, 1, 1); + Date2 := EncodeDate(Y + 1, 1, 1); +end; + +function TcxFilterThisYearOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorThisYear); +end; + +{ NextNDays } + +procedure TcxFilterNextNDaysOperator.Prepare; +begin + Date1 := Date; + if not cxFilterIncludeTodayInLastNextDaysList then + Date1 := Date1 + 1; + Date2 := Date1 + DayCount; +end; + +{ Next7Days } + +function TcxFilterNext7DaysOperator.DayCount: Integer; +begin + Result := 7; +end; + +function TcxFilterNext7DaysOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorNext7Days); +end; + +{ NextWeek } + +procedure TcxFilterNextWeekOperator.Prepare; +var + ANowDate: TDateTime; +begin + ANowDate := Date; + Date1 := GetStartDateOfWeek(ANowDate) + 7; + Date2 := Date1 + 7; +end; + +function TcxFilterNextWeekOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorNextWeek); +end; + +{ Next14Days } + +function TcxFilterNext14DaysOperator.DayCount: Integer; +begin + Result := 14; +end; + +function TcxFilterNext14DaysOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorNext14Days); +end; + +{ NextTwoWeeks } + +procedure TcxFilterNextTwoWeeksOperator.Prepare; +begin + Date1 := GetStartDateOfWeek(Date) + 7; + Date2 := Date1 + 2 * 7; +end; + +function TcxFilterNextTwoWeeksOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorNextTwoWeeks); +end; + +{ Next30Days } + +function TcxFilterNext30DaysOperator.DayCount: Integer; +begin + Result := 30; +end; + +function TcxFilterNext30DaysOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorNext30Days); +end; + +{ NextMonth } + +procedure TcxFilterNextMonthOperator.Prepare; +var + ANowDate: TDateTime; + D, M, Y: Word; +begin + ANowDate := Date; + DecodeDate(ANowDate, Y, M, D); + if M < 11 then + begin + Date1 := EncodeDate(Y, M + 1, 1); + Date2 := EncodeDate(Y, M + 2, 1); + end + else + if M = 11 then + begin + Date1 := EncodeDate(Y, 12, 1); + Date2 := EncodeDate(Y + 1, 1, 1); + end + else + if M = 12 then + begin + Date1 := EncodeDate(Y + 1, 1, 1); + Date2 := EncodeDate(Y + 1, 2, 1); + end; +end; + +function TcxFilterNextMonthOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorNextMonth); +end; + +{ NextYear } + +procedure TcxFilterNextYearOperator.Prepare; +var + ANowDate: TDateTime; + D, M, Y: Word; +begin + ANowDate := Date; + DecodeDate(ANowDate, Y, M, D); + Date1 := EncodeDate(Y + 1, 1, 1); + Date2 := EncodeDate(Y + 2, 1, 1); +end; + +function TcxFilterNextYearOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorNextYear); +end; + +{ InFuture } + +procedure TcxFilterInFutureOperator.Prepare; +begin + Date1 := Date + 1; + Date2 := cxFilterNullDate; +end; + +function TcxFilterInFutureOperator.DisplayText: string; +begin + Result := cxSFilterString(@cxSFilterOperatorFuture); +end; + +{ TcxCustomFilterCriteriaItem } + +constructor TcxCustomFilterCriteriaItem.Create(AOwner: TcxFilterCriteriaItemList); +begin + inherited Create; + FParent := AOwner; +end; + +destructor TcxCustomFilterCriteriaItem.Destroy; +begin + if FParent <> nil then + FParent.RemoveItem(Self); + inherited Destroy; +end; + +procedure TcxCustomFilterCriteriaItem.Changed; +begin + Criteria.Changed; +end; + +function TcxCustomFilterCriteriaItem.GetCriteria: TcxFilterCriteria; +begin + Result := Parent.Criteria; +end; + +procedure TcxCustomFilterCriteriaItem.ReadData(AStream: TStream); +begin +end; + +procedure TcxCustomFilterCriteriaItem.WriteData(AStream: TStream); +begin +end; + +{ TcxFilterCriteriaItemList } + +constructor TcxFilterCriteriaItemList.Create(AOwner: TcxFilterCriteriaItemList; + ABoolOperatorKind: TcxFilterBoolOperatorKind); +begin + inherited Create(AOwner); + FBoolOperatorKind := ABoolOperatorKind; + FItems := TList.Create; +end; + +destructor TcxFilterCriteriaItemList.Destroy; +begin + Clear; + FItems.Free; + inherited Destroy; +end; + +function TcxFilterCriteriaItemList.AddItem(AItemLink: TObject; AOperatorKind: TcxFilterOperatorKind; + const AValue: Variant; const ADisplayValue: string): TcxFilterCriteriaItem; +begin + Result := Criteria.GetItemClass.Create(Self, AItemLink, AOperatorKind, AValue, ADisplayValue); + FItems.Add(Result); + Changed; +end; + +function TcxFilterCriteriaItemList.AddItemList(ABoolOperatorKind: TcxFilterBoolOperatorKind): TcxFilterCriteriaItemList; +begin + Result := Criteria.GetItemListClass.Create(Self, ABoolOperatorKind); + FItems.Add(Result); + Changed; +end; + +procedure TcxFilterCriteriaItemList.Clear; +var + I: Integer; +begin + Criteria.BeginUpdate; + try + for I := Count - 1 downto 0 do + Items[I].Free; + finally + Criteria.EndUpdate; + end; +end; + +function TcxFilterCriteriaItemList.IsEmpty: Boolean; +begin + Result := Count = 0; +end; + +function TcxFilterCriteriaItemList.GetCriteria: TcxFilterCriteria; +begin + if FCriteria <> nil then + Result := FCriteria + else + Result := inherited GetCriteria; +end; + +function TcxFilterCriteriaItemList.GetIsItemList: Boolean; +begin + Result := True; +end; + +procedure TcxFilterCriteriaItemList.RemoveItem(AItem: TcxCustomFilterCriteriaItem); +begin + if FItems.Remove(AItem) <> -1 then + Changed; +end; + +procedure TcxFilterCriteriaItemList.ReadData(AStream: TStream); +var + ACount, I: Integer; +begin + inherited; + BoolOperatorKind := TcxFilterBoolOperatorKind(ReadByteFunc(AStream)); + ACount := ReadIntegerFunc(AStream); + for I := 0 to ACount - 1 do + ReadItem(AStream); +end; + +procedure TcxFilterCriteriaItemList.WriteData(AStream: TStream); +var + I: Integer; +begin + inherited; + WriteByteProc(AStream, Byte(BoolOperatorKind)); + WriteIntegerProc(AStream, Count); + for I := 0 to Count - 1 do + WriteItem(AStream, Items[I]); +end; + +function TcxFilterCriteriaItemList.ReadItem(AStream: TStream): TcxCustomFilterCriteriaItem; +var + AIsItemList: Boolean; +begin + AIsItemList := ReadBooleanFunc(AStream); + if AIsItemList then + Result := AddItemList(fboAnd) + else + Result := AddItem(nil, foEqual, Unassigned, ''); + Result.ReadData(AStream); + if Result.IsEmpty then + FreeAndNil(Result); +end; + +procedure TcxFilterCriteriaItemList.WriteItem(AStream: TStream; + AItem: TcxCustomFilterCriteriaItem); +begin + WriteBooleanProc(AStream, AItem.IsItemList); + AItem.WriteData(AStream); +end; + +function TcxFilterCriteriaItemList.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxFilterCriteriaItemList.GetItem(Index: Integer): TcxCustomFilterCriteriaItem; +begin + if (0 <= Index) and (Index < Count) then + Result := TcxCustomFilterCriteriaItem(FItems[Index]) + else + Result := nil; +end; + +procedure TcxFilterCriteriaItemList.SetBoolOperatorKind(Value: TcxFilterBoolOperatorKind); +begin + if FBoolOperatorKind <> Value then + begin + FBoolOperatorKind := Value; + Changed; + end; +end; + +{ TcxFilterCriteriaItem } + +constructor TcxFilterCriteriaItem.Create(AOwner: TcxFilterCriteriaItemList; + AItemLink: TObject; AOperatorKind: TcxFilterOperatorKind; const AValue: Variant; + const ADisplayValue: string); +begin + inherited Create(AOwner); + SetItemLink(AItemLink); + FDisplayValue := ADisplayValue; + FOperatorKind := AOperatorKind; + FValue := AValue; + RecreateOperator; + CheckDisplayValue; +end; + +destructor TcxFilterCriteriaItem.Destroy; +begin + FOperator.Free; + FOperator := nil; + inherited Destroy; +end; + +function TcxFilterCriteriaItem.IsEmpty: Boolean; +begin + Result := ItemLink = nil; +end; + +function TcxFilterCriteriaItem.ValueIsNull(const AValue: Variant): Boolean; +begin + Result := Criteria.ValueIsNull(AValue); +end; + +procedure TcxFilterCriteriaItem.CheckDisplayValue; +begin + if ((FOperator is TcxFilterNullOperator) or (FOperator is TcxFilterNotNullOperator)) and + (FDisplayValue = '') then + FDisplayValue := cxSFilterString(@cxSFilterBlankCaption); +end; + +function TcxFilterCriteriaItem.GetDisplayValue: string; +begin + Result := DisplayValue; + Operator.PrepareDisplayValue(Result); +end; + +function TcxFilterCriteriaItem.GetExpressionValue(AIsCaption: Boolean): string; +begin + if AIsCaption then + Result := GetDisplayValue + else + Result := Operator.GetExpressionValue(Value); +end; + +function TcxFilterCriteriaItem.GetFilterOperatorClass: TcxFilterOperatorClass; +const + AOperatorClasses: array[TcxFilterOperatorKind] of TcxFilterOperatorClass = ( + TcxFilterEqualOperator, TcxFilterNotEqualOperator, + TcxFilterLessOperator, TcxFilterLessEqualOperator, + TcxFilterGreaterOperator, TcxFilterGreaterEqualOperator, + TcxFilterLikeOperator, TcxFilterNotLikeOperator, + TcxFilterBetweenOperator, TcxFilterNotBetweenOperator, + TcxFilterInListOperator, TcxFilterNotInListOperator, + TcxFilterYesterdayOperator, TcxFilterTodayOperator, TcxFilterTomorrowOperator, + TcxFilterLast7DaysOperator, TcxFilterLastWeekOperator, TcxFilterLast14DaysOperator, TcxFilterLastTwoWeeksOperator, + TcxFilterLast30DaysOperator, TcxFilterLastMonthOperator, TcxFilterLastYearOperator, TcxFilterInPastOperator, + TcxFilterThisWeekOperator, TcxFilterThisMonthOperator, TcxFilterThisYearOperator, + TcxFilterNext7DaysOperator, TcxFilterNextWeekOperator, TcxFilterNext14DaysOperator, TcxFilterNextTwoWeeksOperator, + TcxFilterNext30DaysOperator, TcxFilterNextMonthOperator, TcxFilterNextYearOperator, TcxFilterInFutureOperator); + ANullOperatorClasses: array[Boolean] of TcxFilterOperatorClass = ( + TcxFilterNullOperator, TcxFilterNotNullOperator); +begin + if (OperatorKind in [foEqual, foNotEqual, foLike, foNotLike]) and (ValueIsNull(Value)) then + Result := ANullOperatorClasses[OperatorKind in [foNotEqual, foNotLike]] + else + Result := AOperatorClasses[OperatorKind]; +end; + +function TcxFilterCriteriaItem.GetItemLink: TObject; +begin + Result := FItemLink; +end; + +procedure TcxFilterCriteriaItem.SetItemLink(Value: TObject); +begin + FItemLink := Value; +end; + +function TcxFilterCriteriaItem.GetIsItemList: Boolean; +begin + Result := False; +end; + +procedure TcxFilterCriteriaItem.RecreateOperator; +var + AIsConstruction: Boolean; +begin + AIsConstruction := FOperator = nil; + FOperator.Free; + FOperator := GetFilterOperatorClass.Create(Self); + if not AIsConstruction then + Changed; +end; + +procedure TcxFilterCriteriaItem.ReadData(AStream: TStream); + + function FindItemLink(const AName: string; AID: Integer): TObject; + begin + if AName = '' then + Result := Criteria.GetItemLinkByID(AID) + else + begin + Result := Criteria.GetItemLinkByName(AName); + if Result = nil then + begin + Result := Criteria.GetItemLinkByID(AID); + if (Result <> nil) and (Criteria.GetNameByItemLink(Result) <> '') then + Result := nil; + end; + end; + end; + +var + AItemLinkID: Integer; + AItemLinkName: string; +begin + inherited; + OperatorKind := TcxFilterOperatorKind(ReadByteFunc(AStream)); + DisplayValue := ReadStringFunc(AStream); + + AItemLinkID := ReadIntegerFunc(AStream); + if Criteria.LoadedVersion >= 3 then + AItemLinkName := ReadStringFunc(AStream) + else + AItemLinkName := ''; + + Value := ReadVariantFunc(AStream); + + SetItemLink(FindItemLink(AItemLinkName, AItemLinkID)); + CheckDisplayValue; +end; + +procedure TcxFilterCriteriaItem.WriteData(AStream: TStream); +begin + inherited WriteData(AStream); + WriteByteProc(AStream, Byte(OperatorKind)); + WriteStringProc(AStream, DisplayValue); + + WriteIntegerProc(AStream, Criteria.GetIDByItemLink(ItemLink)); + if Criteria.SavedVersion >= 3 then + WriteStringProc(AStream, Criteria.GetNameByItemLink(ItemLink)); + + WriteVariantProc(AStream, Value); +end; + +procedure TcxFilterCriteriaItem.SetOperatorKind(Value: TcxFilterOperatorKind); +begin + if FOperatorKind <> Value then + begin + FOperatorKind := Value; + RecreateOperator; + end; +end; + +procedure TcxFilterCriteriaItem.SetDisplayValue(const Value: string); +begin + if FDisplayValue <> Value then + begin + FDisplayValue := Value; + Changed; + end; +end; + +procedure TcxFilterCriteriaItem.SetValue(const Value: Variant); +begin + if VarCompare(FValue, Value) <> 0 then + begin + FValue := Value; + RecreateOperator; + end; +end; + +{ TcxFilterValueList } + +constructor TcxFilterValueList.Create(ACriteria: TcxFilterCriteria); +begin + inherited Create; + FCriteria := ACriteria; + FItems := TList.Create; +end; + +destructor TcxFilterValueList.Destroy; +begin + Clear; + FItems.Free; + inherited Destroy; +end; + +procedure TcxFilterValueList.Add(AKind: TcxFilterValueItemKind; const AValue: Variant; + const ADisplayText: string; ANoSorting: Boolean); +var + AIndex: Integer; + PItem: PcxFilterValueItem; +begin + AIndex := -1; + if AKind = fviMRU then + begin + AIndex := GetMRUSeparatorIndex; + if AIndex = -1 then // first MRU item + begin + AIndex := 0; + // add MRU Separator + New(PItem); + PItem.Kind := fviMRUSeparator; + PItem.Value := Null; + PItem.DisplayText := ''; + FItems.Insert(AIndex, PItem); + end; + end + else + if AKind <> fviValue then + AIndex := GetStartValueIndex + else + if ANoSorting then + AIndex := Count + else + if ((MaxCount = 0) or (Count < MaxCount)) then + if Find(AValue, ADisplayText, AIndex) then + AIndex := -1; + if AIndex <> -1 then + begin + New(PItem); + PItem.Kind := AKind; + PItem.Value := AValue; + PItem.DisplayText := ADisplayText; + FItems.Insert(AIndex, PItem); + end; +end; + +procedure TcxFilterValueList.Clear; +var + I: Integer; +begin + for I := 0 to FItems.Count - 1 do + Dispose(PcxFilterValueItem(FItems[I])); + FItems.Clear; +end; + +procedure TcxFilterValueList.Delete(AIndex: Integer); +begin + Dispose(PcxFilterValueItem(FItems[AIndex])); + FItems.Delete(AIndex); +end; + +function TcxFilterValueList.Find(const AValue: Variant; const ADisplayText: string; + var AIndex: Integer): Boolean; +var + L, H, I, C: Integer; + AMRUSeparatorIndex: Integer; +begin + Result := False; + // MRU + AMRUSeparatorIndex := GetMRUSeparatorIndex; + if AMRUSeparatorIndex <> -1 then + for I := 0 to AMRUSeparatorIndex - 1 do + if CompareItem(I, AValue, ADisplayText) = 0 then + begin + AIndex := I; + Result := True; + Exit; + end; + // Values + L := GetStartValueIndex; + H := Count - 1; + while L <= H do + begin + I := (L + H) shr 1; + C := CompareItem(I, AValue, ADisplayText); + if C < 0 then + L := I + 1 + else + begin + if C = 0 then + begin + Result := True; + L := I; + end; + H := I - 1; + end; + end; + AIndex := L; +end; + +function TcxFilterValueList.FindItemByKind(AKind: TcxFilterValueItemKind): Integer; +begin + Result := FindItemByKind(AKind, Null); +end; + +function TcxFilterValueList.FindItemByKind(AKind: TcxFilterValueItemKind; + const AValue: Variant): Integer; +begin + for Result := 0 to Count - 1 do + if (Items[Result].Kind = AKind) and + (VarIsNull(AValue) or VarEquals(Items[Result].Value, AValue)) then + Exit; + Result := -1; +end; + +function TcxFilterValueList.FindItemByValue(const AValue: Variant): Integer; +begin + if not Find(AValue, AValue, Result) then + Result := -1; +end; + +function TcxFilterValueList.GetIndexByCriteriaItem(ACriteriaItem: TcxFilterCriteriaItem): Integer; +begin + if ACriteriaItem = nil then + Result := FindItemByKind(fviAll) + else + if ACriteriaItem.ValueIsNull(ACriteriaItem.Value) and + (ACriteriaItem.OperatorKind in [foEqual, foNotEqual]) then + if ACriteriaItem.OperatorKind = foEqual then + Result := FindItemByKind(fviBlanks) + else + Result := FindItemByKind(fviNonBlanks) + else + if not ({(ACriteriaItem.Parent = Criteria.Root) and }(ACriteriaItem.OperatorKind = foEqual) and + Find(ACriteriaItem.Value, ACriteriaItem.DisplayValue, Result)) then + Result := FindItemByKind(fviCustom); +end; + +function TcxFilterValueList.CompareItem(AIndex: Integer; const AValue: Variant; + const ADisplayText: string): Integer; +var + V1, V2: Variant; + S1, S2: string; +begin + if SortByDisplayText then + begin + S1 := Items[AIndex].DisplayText; + S2 := ADisplayText; + if fcoCaseInsensitive in Criteria.Options then + begin + S1 := AnsiUpperCase(S1); + S2 := AnsiUpperCase(S2); + end; + Result := AnsiCompareStr(S1, S2); // TODO: !! + if Result <> 0 then Exit; + end; + + V1 := Criteria.PrepareValue(Items[AIndex].Value); + V2 := Criteria.PrepareValue(AValue); + Result := VarCompare(V1, V2); +end; + +function TcxFilterValueList.GetMRUSeparatorIndex: Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Count - 1 do + begin + if Items[I].Kind = fviMRUSeparator then + begin + Result := I; + Break; + end; + if Items[I].Kind <> fviMRU then + Break; + end; +end; + +function TcxFilterValueList.GetStartValueIndex: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to FItems.Count - 1 do + if Items[I].Kind <> fviValue then + Inc(Result) + else + Break; +end; + +function TcxFilterValueList.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxFilterValueList.GetItem(Index: Integer): PcxFilterValueItem; +begin + Result := PcxFilterValueItem(FItems[Index]); +end; + +function TcxFilterValueList.GetMaxCount: Integer; +begin + Result := Criteria.MaxValueListCount; +end; + +{ TcxFilterCriteria } + +constructor TcxFilterCriteria.Create; +begin + inherited Create; + FRoot := TcxFilterCriteriaItemList.Create(nil, fboAnd); + FRoot.FCriteria := Self; + FPercentWildcard := '%'; + FSupportedLike := True; + FUnderscoreWildcard := '_'; + FVersion := 2; +end; + +destructor TcxFilterCriteria.Destroy; +begin + FRoot.Free; + FRoot := nil; + inherited Destroy; +end; + +procedure TcxFilterCriteria.Assign(Source: TPersistent; AIgnoreItemNames: Boolean = False); +begin + if Source is TcxFilterCriteria then + begin + BeginUpdate; + try + DateTimeFormat := TcxFilterCriteria(Source).DateTimeFormat; + MaxValueListCount := TcxFilterCriteria(Source).MaxValueListCount; + Options := TcxFilterCriteria(Source).Options; + PercentWildcard := TcxFilterCriteria(Source).PercentWildcard; + TranslateBetween := TcxFilterCriteria(Source).TranslateBetween; + TranslateLike := TcxFilterCriteria(Source).TranslateLike; + TranslateIn := TcxFilterCriteria(Source).TranslateIn; + SupportedLike := TcxFilterCriteria(Source).SupportedLike; + UnderscoreWildcard := TcxFilterCriteria(Source).UnderscoreWildcard; + AssignItems(TcxFilterCriteria(Source), AIgnoreItemNames); + AssignEvents(Source); // TODO: option? + finally + EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxFilterCriteria.AssignEvents(Source: TPersistent); +begin + if Source is TcxFilterCriteria then + OnChanged := TcxFilterCriteria(Source).OnChanged; +end; + +procedure TcxFilterCriteria.AssignItems(ASource: TcxFilterCriteria; + AIgnoreItemNames: Boolean = False); +var + AStream: TMemoryStream; + ASourceVersion: Byte; +begin + if EqualItems(ASource) then Exit; + BeginUpdate; + try + Clear; + AStream := TMemoryStream.Create; + try + ASourceVersion := ASource.Version; + if AIgnoreItemNames then + ASource.Version := Min(ASource.Version, 2); + ASource.WriteData(AStream, Version); + ASource.Version := ASourceVersion; + AStream.Position := 0; + ReadData(AStream); + finally + AStream.Free; + end; + finally + EndUpdate; + end; +end; + +function TcxFilterCriteria.AddItem(AParent: TcxFilterCriteriaItemList; AItemLink: TObject; + AOperatorKind: TcxFilterOperatorKind; const AValue: Variant; + const ADisplayValue: string): TcxFilterCriteriaItem; +begin + if AParent = nil then + AParent := Root; + Result := AParent.AddItem(AItemLink, AOperatorKind, AValue, ADisplayValue); +end; + +procedure TcxFilterCriteria.BeginUpdate; +begin + Inc(FLockCount); +end; + +procedure TcxFilterCriteria.CancelUpdate; +begin + Dec(FLockCount); + // obsolete - use EndUpdate +end; + +procedure TcxFilterCriteria.Clear; +begin + BeginUpdate; + try + Root.Clear; + Root.BoolOperatorKind := fboAnd; + finally + EndUpdate; + end; +end; + +procedure TcxFilterCriteria.Changed; +begin + FChanged := True; + CheckChanges; +end; + +procedure TcxFilterCriteria.EndUpdate; +begin + Dec(FLockCount); + CheckChanges; +end; + +function TcxFilterCriteria.EqualItems(AFilterCriteria: TcxFilterCriteria): Boolean; +var + AStream1, AStream2: TMemoryStream; +begin + AStream1 := TMemoryStream.Create; + AStream2 := TMemoryStream.Create; + try + WriteData(AStream1, AFilterCriteria.Version); + AFilterCriteria.WriteData(AStream2, Version); + Result := StreamsEqual(AStream1, AStream2); + finally + AStream2.Free; + AStream1.Free; + end; +end; + +function TcxFilterCriteria.FindItemByItemLink(AItemLink: TObject): TcxFilterCriteriaItem; + + procedure FindInBranch(ABranch: TcxFilterCriteriaItemList); + var + I: Integer; + begin + for I := 0 to ABranch.Count - 1 do + begin + if Result <> nil then + Break; + if TcxCustomFilterCriteriaItem(ABranch.Items[I]).IsItemList then + FindInBranch(TcxFilterCriteriaItemList(ABranch.Items[I])) + else + if TcxFilterCriteriaItem(ABranch.Items[I]).FItemLink = AItemLink then // TODO: !!!ItemLink + begin + Result := TcxFilterCriteriaItem(ABranch.Items[I]); + Break; + end; + end; + end; + +begin + Result := nil; + FindInBranch(Root); +end; + +function TcxFilterCriteria.IsEmpty: Boolean; +begin + Result := Root.IsEmpty; +end; + +procedure TcxFilterCriteria.LoadFromStream(AStream: TStream); +var + AWrapper: TFilterWrapper; +begin + BeginUpdate; + try + AWrapper := TFilterWrapper.Create(nil); + try + AWrapper.Filter := Self; + AStream.ReadComponent(AWrapper); + finally + AWrapper.Free; + end; + finally + EndUpdate; + end; +end; + +procedure TcxFilterCriteria.Refresh; + + procedure RecreateOperators(ABranch: TcxFilterCriteriaItemList); + var + I: Integer; + begin + for I := 0 to ABranch.Count - 1 do + if ABranch[I].IsItemList then + RecreateOperators(TcxFilterCriteriaItemList(ABranch[I])) + else + TcxFilterCriteriaItem(ABranch[I]).RecreateOperator; + end; + +begin + BeginUpdate; + try + RecreateOperators(Root); + finally + EndUpdate; + end; +end; + +procedure TcxFilterCriteria.RemoveItemByItemLink(AItemLink: TObject); + + procedure CheckEmptyParent(AParent: TcxFilterCriteriaItemList); + var + ANewParent: TcxFilterCriteriaItemList; + begin + if AParent = FRoot then Exit; + if AParent.IsEmpty then + begin + ANewParent := AParent.Parent; + AParent.Free; + CheckEmptyParent(ANewParent); + end; + end; + + procedure CheckEmptyList(AParent: TcxFilterCriteriaItemList); + var + ANewParent: TcxFilterCriteriaItemList; + AItem: TcxCustomFilterCriteriaItem; + begin + if AParent = FRoot then Exit; + if AParent.IsEmpty then + begin + ANewParent := AParent.Parent; + AParent.Free; + CheckEmptyParent(ANewParent); + end + else + if AParent.Count = 1 then + begin + ANewParent := AParent.Parent; + AItem := AParent.Items[0]; + ANewParent.FItems.Remove(AParent); + ANewParent.FItems.Add(AItem); + AItem.FParent := ANewParent; + AParent.FItems.Clear; + AParent.Free; + end; + end; + +var + AItem: TcxFilterCriteriaItem; + AParent: TcxFilterCriteriaItemList; + AChanged: Boolean; +begin + BeginUpdate; + AChanged := False; + try + AItem := FindItemByItemLink(AItemLink); + while AItem <> nil do + begin + AChanged := True; + AParent := AItem.Parent; + AItem.Free; + CheckEmptyList(AParent); + AItem := FindItemByItemLink(AItemLink); + end; + finally + if AChanged then + EndUpdate + else + CancelUpdate; + end; +end; + +procedure TcxFilterCriteria.RestoreDefaults; +begin + BeginUpdate; + try + Options := []; + PercentWildcard := '%'; + SupportedLike := True; + TranslateBetween := False; + TranslateLike := False; + TranslateIn := False; + UnderscoreWildcard := '_'; + finally + EndUpdate; + end; +end; + +procedure TcxFilterCriteria.SaveToStream(AStream: TStream); +var + AWrapper: TFilterWrapper; +begin + AWrapper := TFilterWrapper.Create(nil); + FSavingToStream := True; + try + AWrapper.Filter := Self; + AStream.WriteComponent(AWrapper); + finally + FSavingToStream := False; + AWrapper.Free; + end; +end; + +function GetFilterVersion(AVersionID: Integer): Byte; +begin + case AVersionID of + -1: Result := 2; + -2: Result := 3; + else + Result := 1; + end; +end; + +function GetFilterVersionID(AVersion: Byte): Integer; +begin + case AVersion of + 2: Result := -1; + 3: Result := -2; + else + Result := 0; // undefined + end; +end; + +procedure TcxFilterCriteria.ReadData(AStream: TStream); +var + AItemCount, I: Integer; +begin + BeginUpdate; + try + Clear; + AItemCount := ReadIntegerFunc(AStream); + FLoadedVersion := GetFilterVersion(AItemCount); + if LoadedVersion > 1 then // new format + Root.ReadData(AStream) + else + for I := 0 to AItemCount - 1 do + Root.ReadItem(AStream); + finally + EndUpdate; + end; +end; + +procedure TcxFilterCriteria.WriteData(AStream: TStream); +begin + WriteData(AStream, 0); +end; + +procedure TcxFilterCriteria.WriteData(AStream: TStream; AVersion: Byte); +begin + if AVersion = 0 then + FSavedVersion := Version + else + FSavedVersion := Min(Version, AVersion); + WriteIntegerProc(AStream, GetFilterVersionID(SavedVersion)); // new format + Root.WriteData(AStream); +end; + +function TcxFilterCriteria.ValueIsNull(const AValue: Variant): Boolean; +begin + if fcoSoftNull in Options then + Result := VarIsSoftNull(AValue) + else + Result := VarIsNull(AValue); +end; + +procedure TcxFilterCriteria.CheckChanges; +begin + if FChanged and (LockCount = 0) then + begin + FChanged := False; + Prepare; + Update; + end; +end; + +function TcxFilterCriteria.ConvertBoolToStr(const AValue: Variant): string; +const + BoolStrs: array[Boolean] of string = ('False', 'True'); +begin +{$IFNDEF DELPHI6} + Result := BoolStrs[AValue = True]; +{$ELSE} + Result := VarToStr(AValue); +{$ENDIF} +end; + +function TcxFilterCriteria.ConvertDateToStr(const AValue: Variant): string; +begin + if DateTimeFormat <> '' then + Result := FormatDateTime(DateTimeFormat, AValue) + else + Result := VarToStr(AValue) +end; + +function TcxFilterCriteria.DoFilterData(AData: TObject): Boolean; + + function Compare(AItem: TcxFilterCriteriaItem): Boolean; + var + V1, V2: Variant; + begin + try + V1 := PrepareValue(AItem.GetDataValue(AData)); + V2 := PrepareValue(AItem.Value); + // for Null special compare + if (fcoIgnoreNull in Options) and not AItem.Operator.IsNullOperator and AItem.ValueIsNull(V1) then + Result := False + else + Result := AItem.Operator.CompareValues(V1, V2); + except + on EVariantError do + if fcoSoftCompare in Options then + Result := False + else + raise; + end; + end; + + procedure CorrectResult(AItemResult: Boolean; ABoolOperatorKind: TcxFilterBoolOperatorKind; + var ACompared, AResult: Boolean); + begin + if not ACompared then + begin + AResult := AItemResult; + case ABoolOperatorKind of + fboAnd, fboOr: + AResult := AItemResult; + fboNotAnd, fboNotOr: + AResult := not AResult; + end; + ACompared := True; + end + else + begin + case ABoolOperatorKind of + fboAnd: + AResult := AResult and AItemResult; + fboOr: + AResult := AResult or AItemResult; + fboNotAnd: + AResult := AResult or not AItemResult; + fboNotOr: + AResult := AResult and not AItemResult; + end; + end; + end; + + function DoFilterBranch(ABranch: TcxFilterCriteriaItemList): Boolean; + var + I: Integer; + AItem: TcxFilterCriteriaItem; + AResult, ACompared: Boolean; + begin + Result := True; + ACompared := False; + for I := 0 to ABranch.Count - 1 do + if ABranch[I].IsItemList then + begin + AResult := DoFilterBranch(TcxFilterCriteriaItemList(ABranch[I])); + CorrectResult(AResult, ABranch.BoolOperatorKind, ACompared, Result); + end + else + begin + AItem := TcxFilterCriteriaItem(ABranch[I]); + AResult := Compare(AItem); + CorrectResult(AResult, ABranch.BoolOperatorKind, ACompared, Result); + end; + end; + +begin + Result := DoFilterBranch(Root); +end; + +procedure TcxFilterCriteria.FormatFilterTextValue(AItem: TcxFilterCriteriaItem; + const AValue: Variant; var ADisplayValue: string); +begin +end; + +function TcxFilterCriteria.GetFilterCaption: string; +begin + Result := GetFilterExpression(True); +end; + +function TcxFilterCriteria.GetFilterExpression(AIsCaption: Boolean): string; + + function GetOperatorText(AIsCaption: Boolean; + ABoolOperatorKind: TcxFilterBoolOperatorKind): string; + begin + case ABoolOperatorKind of + fboAnd, fboNotAnd: + begin + if AIsCaption then + Result := cxSFilterString(@cxSFilterAndCaption) + else + Result := 'AND'; + end; + fboOr, fboNotOr: + begin + if AIsCaption then + Result := cxSFilterString(@cxSFilterOrCaption) + else + Result := 'OR'; + end; + end; + end; + + function GetNotText(AIsCaption: Boolean): string; + begin + if AIsCaption then + Result := cxSFilterString(@cxSFilterNotCaption) + else + Result := 'NOT'; + end; + + function FilterSubString(ABranch: TcxFilterCriteriaItemList): string; + var + I: Integer; + begin + Result := ''; + for I := 0 to ABranch.Count - 1 do + begin + if ABranch[I].IsItemList then + Result := Result + '(' + FilterSubString(TcxFilterCriteriaItemList(ABranch[I])) + ')' + else + Result := Result + '(' + GetItemExpression(TcxFilterCriteriaItem(ABranch[I]), AIsCaption) + ')'; + if I < ABranch.Count - 1 then + Result := Result + ' ' + GetOperatorText(AIsCaption, ABranch.BoolOperatorKind) + ' '; + end; + if ABranch.BoolOperatorKind in [fboNotAnd, fboNotOr] then + Result := GetNotText(AIsCaption) + ' (' + Result + ')'; + end; + +begin + Result := FilterSubString(Root); +end; + +function TcxFilterCriteria.GetFilterText: string; +begin + Result := GetFilterExpression(False); +end; + +function TcxFilterCriteria.GetItemClass: TcxFilterCriteriaItemClass; +begin + Result := TcxFilterCriteriaItem; +end; + +function TcxFilterCriteria.GetItemListClass: TcxFilterCriteriaItemListClass; +begin + Result := TcxFilterCriteriaItemList; +end; + +function TcxFilterCriteria.GetItemExpression(AItem: TcxFilterCriteriaItem; + AIsCaption: Boolean): string; +var + S: string; +begin + if not AIsCaption and AItem.Operator.IsExpression then + Result := AItem.Operator.GetExpressionFilterText(AItem.Value) + else + begin + S := GetItemExpressionValue(AItem, AIsCaption); + Result := GetItemExpressionFieldName(AItem, AIsCaption) + ' ' + + GetItemExpressionOperator(AItem, AIsCaption); + if S <> '' then + Result := Result + ' ' + S; + end; +end; + +function TcxFilterCriteria.GetItemExpressionFieldName(AItem: TcxFilterCriteriaItem; + AIsCaption: Boolean): string; +begin + if AIsCaption then + Result := AItem.GetFieldCaption + else + Result := AItem.GetFieldName; +end; + +function TcxFilterCriteria.GetItemExpressionOperator(AItem: TcxFilterCriteriaItem; + AIsCaption: Boolean): string; +begin + if AIsCaption and (AItem.Operator.IsDescription or (fcoShowOperatorDescription in Options)) then + Result := AItem.Operator.DisplayText + else + Result := AItem.Operator.FilterText; +end; + +function TcxFilterCriteria.GetItemExpressionValue(AItem: TcxFilterCriteriaItem; + AIsCaption: Boolean): string; +begin + Result := AItem.GetExpressionValue(AIsCaption); +end; + +function TcxFilterCriteria.IsStore: Boolean; +begin + Result := FSavingToStream or (Root.BoolOperatorKind <> fboAnd) or not Root.IsEmpty; +end; + +procedure TcxFilterCriteria.Prepare; + + procedure PrepareOperators(ABranch: TcxFilterCriteriaItemList); + var + I: Integer; + begin + for I := 0 to ABranch.Count - 1 do + if ABranch[I].IsItemList then + PrepareOperators(TcxFilterCriteriaItemList(ABranch[I])) + else + TcxFilterCriteriaItem(ABranch[I]).Operator.Prepare; + end; + +begin + PrepareOperators(Root); +end; + +function TcxFilterCriteria.PrepareValue(AValue: Variant): Variant; +var + I: Integer; +begin + if VarType(AValue) = varCurrency then + Result := VarAsType(AValue, varDouble) // bug in Delphi + else + if VarIsStr(AValue) and (fcoCaseInsensitive in Options) then + Result := AnsiUpperCase(AValue) + else + begin + if VarIsArray(AValue) then + begin + for I := VarArrayLowBound(AValue, 1) to VarArrayHighBound(AValue, 1) do + AValue[I] := PrepareValue(AValue[I]); + Result := AValue; + end + else + Result := AValue; + end; +end; + +function TcxFilterCriteria.GetValueListClass: TcxFilterValueListClass; +begin + Result := TcxFilterValueList; +end; + +procedure TcxFilterCriteria.SetFilterText(const Value: string); +begin +end; + +procedure TcxFilterCriteria.Update; +begin + if Assigned(FOnChanged) then + FOnChanged(Self); +end; + +function TcxFilterCriteria.GetOptions: TcxFilterCriteriaOptions; +begin + Result := FOptions; +end; + +function TcxFilterCriteria.GetStoreItemLinkNames: Boolean; +begin + Result := Version >= 3; +end; + +procedure TcxFilterCriteria.SetDateTimeFormat(const Value: string); +begin + if FDateTimeFormat <> Value then + begin + FDateTimeFormat := Value; + Changed; + end; +end; + +procedure TcxFilterCriteria.SetOptions(Value: TcxFilterCriteriaOptions); +begin + if FOptions <> Value then + begin + FOptions := Value; + Changed; + end; +end; + +procedure TcxFilterCriteria.SetPercentWildcard(Value: Char); +begin + if FPercentWildcard <> Value then + begin + FPercentWildcard := Value; + Changed; + end; +end; + +procedure TcxFilterCriteria.SetStoreItemLinkNames(Value: Boolean); +begin + if StoreItemLinkNames <> Value then + if Value then + Version := 3 + else + Version := 2; +end; + +procedure TcxFilterCriteria.SetUnderscoreWildcard(Value: Char); +begin + if FUnderscoreWildcard <> Value then + begin + FUnderscoreWildcard := Value; + Changed; + end; +end; + +end. diff --git a/official/x.35/ExpressDataController/Sources/cxFilterConsts.pas b/official/x.35/ExpressDataController/Sources/cxFilterConsts.pas new file mode 100644 index 00000000..5b128cb8 --- /dev/null +++ b/official/x.35/ExpressDataController/Sources/cxFilterConsts.pas @@ -0,0 +1,123 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDataController } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDATACONTROLLER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxFilterConsts; + +{$I cxVer.inc} + +interface + +resourcestring + // base operators + cxSFilterOperatorEqual = 'equals'; + cxSFilterOperatorNotEqual = 'does not equal'; + cxSFilterOperatorLess = 'is less than'; + cxSFilterOperatorLessEqual = 'is less than or equal to'; + cxSFilterOperatorGreater = 'is greater than'; + cxSFilterOperatorGreaterEqual = 'is greater than or equal to'; + cxSFilterOperatorLike = 'like'; + cxSFilterOperatorNotLike = 'not like'; + cxSFilterOperatorBetween = 'between'; + cxSFilterOperatorNotBetween = 'not between'; + cxSFilterOperatorInList = 'in'; + cxSFilterOperatorNotInList = 'not in'; + + cxSFilterOperatorYesterday = 'is yesterday'; + cxSFilterOperatorToday = 'is today'; + cxSFilterOperatorTomorrow = 'is tomorrow'; + + cxSFilterOperatorLast7Days = 'is last 7 days'; + cxSFilterOperatorLastWeek = 'is last week'; + cxSFilterOperatorLast14Days = 'is last 14 days'; + cxSFilterOperatorLastTwoWeeks = 'is last two weeks'; + cxSFilterOperatorLast30Days = 'is last 30 days'; + cxSFilterOperatorLastMonth = 'is last month'; + cxSFilterOperatorLastYear = 'is last year'; + cxSFilterOperatorPast = 'is past'; + + cxSFilterOperatorThisWeek = 'is this week'; + cxSFilterOperatorThisMonth = 'is this month'; + cxSFilterOperatorThisYear = 'is this year'; + + cxSFilterOperatorNext7Days = 'is next 7 days'; + cxSFilterOperatorNextWeek = 'is next week'; + cxSFilterOperatorNext14Days = 'is next 14 days'; + cxSFilterOperatorNextTwoWeeks = 'is next two weeks'; + cxSFilterOperatorNext30Days = 'is next 30 days'; + cxSFilterOperatorNextMonth = 'is next month'; + cxSFilterOperatorNextYear = 'is next year'; + cxSFilterOperatorFuture = 'is future'; + + cxSFilterAndCaption = 'and'; + cxSFilterOrCaption = 'or'; + cxSFilterNotCaption = 'not'; + cxSFilterBlankCaption = 'blank'; + + // derived + cxSFilterOperatorIsNull = 'is blank'; + cxSFilterOperatorIsNotNull = 'is not blank'; + cxSFilterOperatorBeginsWith = 'begins with'; + cxSFilterOperatorDoesNotBeginWith = 'does not begin with'; + cxSFilterOperatorEndsWith = 'ends with'; + cxSFilterOperatorDoesNotEndWith = 'does not end with'; + cxSFilterOperatorContains = 'contains'; + cxSFilterOperatorDoesNotContain = 'does not contain'; + // filter listbox's values + cxSFilterBoxAllCaption = '(All)'; + cxSFilterBoxCustomCaption = '(Custom...)'; + cxSFilterBoxBlanksCaption = '(Blanks)'; + cxSFilterBoxNonBlanksCaption = '(NonBlanks)'; + +function cxSFilterString(AResString: Pointer): string; + +type + TcxFilterGetResourceStringFunc = function( + AResString: Pointer): string; + +var + cxFilterGetResourceStringFunc: TcxFilterGetResourceStringFunc; + +implementation + +function cxSFilterString( + AResString: Pointer): string; +begin + if Assigned(cxFilterGetResourceStringFunc) then + Result := cxFilterGetResourceStringFunc(AResString) + else + Result := LoadResString(AResString); +end; + +end. diff --git a/official/x.35/ExpressDataController/Sources/cxIBXAdapters.pas b/official/x.35/ExpressDataController/Sources/cxIBXAdapters.pas new file mode 100644 index 00000000..ba261643 --- /dev/null +++ b/official/x.35/ExpressDataController/Sources/cxIBXAdapters.pas @@ -0,0 +1,163 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDataController } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDATACONTROLLER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxIBXAdapters; + +{$I cxVer.inc} + +interface + +uses + {$IFDEF DELPHI6}Variants, {$ENDIF}DB, IBSQL, cxDBData, cxFilter, cxDBFilter; + +type + { TcxIBXProviderDetailFilterAdapter } + + TcxIBXProviderDetailFilterAdapter = class(TcxDBProviderDetailFilterAdapter) + protected + function GetParamValues(ASQLParams: TIBXSQLDA): Variant; + procedure SetParamValues(ASQLParams: TIBXSQLDA; const AValues: Variant); + public + function IsCurrentQuery(ADataSet: TDataSet; const AParamNames: string; const AParamValues: Variant): Boolean; override; + procedure ReopenSQL(ADataSet: TDataSet; const AParamNames: string; const AParamValues: Variant; var AReopened: Boolean); override; + end; + + { TcxIBXFilterOperatorAdapter } + + TcxIBXFilterOperatorAdapter = class(TcxDBFilterOperatorAdapter) + public + procedure PrepareOperatorClass(ASender: TObject; ADataSet: TDataSet; + var AOperatorClass: TcxFilterOperatorClass); override; + end; + +implementation + +uses + TypInfo, IBCustomDataSet, cxVariants; + +{ TcxIBXProviderDetailFilterAdapter } + +function TcxIBXProviderDetailFilterAdapter.IsCurrentQuery(ADataSet: TDataSet; + const AParamNames: string; const AParamValues: Variant): Boolean; +var + ASQLParams: TIBXSQLDA; +begin + Result := False; + if ADataSet is TIBDataSet then + begin + ASQLParams := TIBDataSet(ADataSet).Params; + if VarEquals(GetParamValues(ASQLParams), AParamValues) then + Result := True; + end; +end; + +procedure TcxIBXProviderDetailFilterAdapter.ReopenSQL(ADataSet: TDataSet; + const AParamNames: string; const AParamValues: Variant; var AReopened: Boolean); +var + ASQLParams: TIBXSQLDA; +begin + if ADataSet is TIBDataSet then + begin + ASQLParams := TIBDataSet(ADataSet).Params; + if VarEquals(GetParamValues(ASQLParams), AParamValues) then + ADataSet.First + else + begin + ADataSet.DisableControls; + try + ADataSet.Active := False; + SetParamValues(ASQLParams, AParamValues); + ADataSet.Active := True; + finally + ADataSet.EnableControls; + end; + AReopened := True; // set Flag if Query reopened + end; + end; +end; + +function TcxIBXProviderDetailFilterAdapter.GetParamValues(ASQLParams: TIBXSQLDA): Variant; +var + I: Integer; +begin + if ASQLParams.Count = 1 then + Result := Variant(ASQLParams[0].Value) + else + begin + Result := VarArrayCreate([0, ASQLParams.Count - 1], varVariant); + for I := 0 to ASQLParams.Count - 1 do + Result[I] := Variant(ASQLParams[I].Value); + end; +end; + +procedure TcxIBXProviderDetailFilterAdapter.SetParamValues(ASQLParams: TIBXSQLDA; + const AValues: Variant); +var + I: Integer; +begin + if ASQLParams.Count = 1 then + ASQLParams[0].Value := AValues + else + for I := 0 to ASQLParams.Count - 1 do + ASQLParams[I].Value := AValues[I]; +end; + +{ TcxIBXFilterOperatorAdapter } + +procedure TcxIBXFilterOperatorAdapter.PrepareOperatorClass(ASender: TObject; + ADataSet: TDataSet; var AOperatorClass: TcxFilterOperatorClass); +begin + if AOperatorClass.InheritsFrom(TcxFilterNullOperator) or + AOperatorClass.InheritsFrom(TcxFilterNotNullOperator) then + begin + if ADataSet is TIBDataSet then + begin + if AOperatorClass.InheritsFrom(TcxFilterNotNullOperator) then + AOperatorClass := TcxFilterSQLNotNullOperator + else + AOperatorClass := TcxFilterSQLNullOperator; + end; + end; +end; + +initialization + cxDetailFilterControllers.RegisterAdapter(TIBDataSet, TcxIBXProviderDetailFilterAdapter); + cxFilterOperatorAdapters.RegisterAdapter(TIBDataSet, TcxIBXFilterOperatorAdapter); + +finalization + cxDetailFilterControllers.UnregisterAdapter(TIBDataSet, TcxIBXProviderDetailFilterAdapter); + cxFilterOperatorAdapters.UnregisterAdapter(TIBDataSet, TcxIBXFilterOperatorAdapter); + +end. diff --git a/official/x.35/ExpressDataController/Sources/cxLike.pas b/official/x.35/ExpressDataController/Sources/cxLike.pas new file mode 100644 index 00000000..f604e006 --- /dev/null +++ b/official/x.35/ExpressDataController/Sources/cxLike.pas @@ -0,0 +1,157 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDataController } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDATACONTROLLER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxLike; + +{$I cxVer.inc} + +interface + +uses + SysUtils; + +type + TcxFilterLikeOperator = (floLike, floBeginsWith, floEndsWith, floContains); + +function LikeOperatorByPattern(var APatternStr: string; APercent: Char): TcxFilterLikeOperator; +function LikeStr(const AStr, APatternStr: string; APercent, AUnderline: Char): Boolean; + +implementation + +procedure PreparePatternStr(var PatternStr: string; APercent: Char); +var + I: Integer; + S: string; +begin + // delete '%%', because '%%' = '%' + S := APercent + APercent; + repeat + I := Pos(S, PatternStr); + if I > 0 then + PatternStr := Copy(PatternStr, 1, I - 1) + APercent + Copy(PatternStr, I + 2, MaxInt); + until I = 0; +end; + +function LikeOperatorByPattern(var APatternStr: string; APercent: Char): TcxFilterLikeOperator; +var + ABeginFlag, AEndFlag: Boolean; +begin + Result := floLike; + PreparePatternStr(APatternStr, APercent); + if Length(APatternStr) > 1 then + begin + ABeginFlag := APatternStr[1] = APercent; + AEndFlag := APatternStr[Length(APatternStr)] = APercent; + if ABeginFlag then + begin + Delete(APatternStr, 1, 1); + if AEndFlag then + begin + Result := floContains; + Delete(APatternStr, Length(APatternStr), 1); + end + else + Result := floEndsWith; + end + else + if AEndFlag then + begin + Result := floBeginsWith; + Delete(APatternStr, Length(APatternStr), 1); + end; + end; +end; + +function Like(p1: PChar; l1: Integer; p2: PChar; l2: Integer; + percent_char, underline_char, escape_char: Char): Boolean; +var + c: Char; + AEscapeFlag: Boolean; +begin + AEscapeFlag := False; + repeat + Dec(l2); + if l2 < 0 then Break; + c := p2^; + p2 := p2 + 1; + if (escape_char <> #0) and not AEscapeFlag and (c = escape_char) then + begin + AEscapeFlag := True; + Continue; + end; + if not AEscapeFlag and (c = percent_char) then + begin + if l2 = 0 then + begin + Result := True; + Exit; + end; + while l1 > 0 do + begin + if Like(p1, l1, p2, l2, percent_char, underline_char, escape_char) then + begin + Result := True; + Exit; + end; + p1 := p1 + 1; + Dec(l1); + end; + Result := False; + Exit; + end; + Dec(l1); + if l1 < 0 then + begin + Result := False; + Exit; + end; + if (AEscapeFlag or (c <> underline_char)) and (c <> p1^) then + begin + Result := False; + Exit; + end; + AEscapeFlag := False; + p1 := p1 + 1; + until False; + Result := l1 = 0; +end; + +function LikeStr(const AStr, APatternStr: string; APercent, AUnderline: Char): Boolean; +begin + Result := Like(PChar(AStr), Length(AStr), PChar(APatternStr), + Length(APatternStr), APercent, AUnderline, #0); +end; + +end. diff --git a/official/x.35/ExpressDataController/Sources/cxVariants.pas b/official/x.35/ExpressDataController/Sources/cxVariants.pas new file mode 100644 index 00000000..11d1c02e --- /dev/null +++ b/official/x.35/ExpressDataController/Sources/cxVariants.pas @@ -0,0 +1,1200 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDataController } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDATACONTROLLER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxVariants; + +{$I cxVer.inc} + +interface + +uses + SysUtils, Classes{$IFDEF DELPHI6}, Variants{$ENDIF}; + +type + LargeInt = Int64; + {$IFNDEF DELPHI6} + TVarType = Word; + {$ENDIF} + TVariantArray = array of Variant; + + { Read/Write } + + TcxFiler = class + private + FStream: TStream; + public + constructor Create(AStream: TStream); + property Stream: TStream read FStream; + end; + + TcxReader = class(TcxFiler) + public + function ReadBoolean: Boolean; + function ReadByte: Byte; + function ReadCardinal: Cardinal; + function ReadChar: Char; + function ReadCurrency: Currency; + function ReadDateTime: TDateTime; + function ReadFloat: Extended; + function ReadInteger: Integer; + function ReadLargeInt: LargeInt; + function ReadShortInt: ShortInt; + function ReadSingle: Single; + function ReadSmallInt: SmallInt; + function ReadString: string; + function ReadVariant: Variant; + function ReadWideString: WideString; + function ReadWord: Word; + end; + + TcxWriter = class(TcxFiler) + public + procedure WriteBoolean(AValue: Boolean); + procedure WriteByte(AValue: Byte); + procedure WriteCardinal(AValue: Cardinal); + procedure WriteChar(AValue: Char); + procedure WriteCurrency(AValue: Currency); + procedure WriteDateTime(AValue: TDateTime); + procedure WriteFloat(AValue: Extended); + procedure WriteInteger(AValue: Integer); + procedure WriteLargeInt(AValue: LargeInt); + procedure WriteShortInt(AValue: ShortInt); + procedure WriteSingle(AValue: Single); + procedure WriteSmallInt(AValue: SmallInt); + procedure WriteString(const S: string); + procedure WriteVariant(const AValue: Variant); + procedure WriteWideString(const S: WideString); + procedure WriteWord(AValue: Word); + end; + +function VarCompare(const V1, V2: Variant): Integer; +function VarEquals(const V1, V2: Variant): Boolean; +function VarEqualsExact(const V1, V2: Variant): Boolean; +function VarEqualsSoft(const V1, V2: Variant): Boolean; +function VarIndex(const AList: TVariantArray; const AValue: Variant): Integer; +function VarIsDate(const AValue: Variant): Boolean; +function VarIsNumericEx(const AValue: Variant): Boolean; +function VarIsSoftNull(const AValue: Variant): Boolean; +function VarToStrEx(const V: Variant): string; +function VarTypeIsCurrency(AVarType: TVarType): Boolean; +{$IFNDEF DELPHI6} +function FindVarData(const V: Variant): PVarData; +function VarIsFloat(const AValue: Variant): Boolean; +function VarIsNumeric(const AValue: Variant): Boolean; +function VarIsOrdinal(const AValue: Variant): Boolean; +function VarIsStr(const AValue: Variant): Boolean; +function VarIsType(const AValue: Variant; AVarType: TVarType): Boolean; +function VarSameValue(const V1, V2: Variant): Boolean; +{$ENDIF} +function VarBetweenArrayCreate(const AValue1, AValue2: Variant): Variant; +function VarListArrayCreate(const AValue: Variant): Variant; +procedure VarListArrayAddValue(var Value: Variant; const AValue: Variant); + +function ReadStringFunc(AStream: TStream): string; +procedure ReadStringProc(AStream: TStream; var S: string); +procedure WriteStringProc(AStream: TStream; const S: string); + +function ReadWideStringFunc(AStream: TStream): WideString; +procedure ReadWideStringProc(AStream: TStream; var S: WideString); +procedure WriteWideStringProc(AStream: TStream; const S: WideString); + +function ReadVariantFunc(AStream: TStream): Variant; +procedure ReadVariantProc(AStream: TStream; var Value: Variant); +procedure WriteVariantProc(AStream: TStream; const AValue: Variant); + +function ReadBooleanFunc(AStream: TStream): Boolean; +procedure ReadBooleanProc(AStream: TStream; var Value: Boolean); +procedure WriteBooleanProc(AStream: TStream; AValue: Boolean); + +function ReadCharFunc(AStream: TStream): Char; +procedure ReadCharProc(AStream: TStream; var Value: Char); +procedure WriteCharProc(AStream: TStream; AValue: Char); + +function ReadFloatFunc(AStream: TStream): Extended; +procedure ReadFloatProc(AStream: TStream; var Value: Extended); +procedure WriteFloatProc(AStream: TStream; AValue: Extended); + +function ReadSingleFunc(AStream: TStream): Single; +procedure ReadSingleProc(AStream: TStream; var Value: Single); +procedure WriteSingleProc(AStream: TStream; AValue: Single); + +function ReadCurrencyFunc(AStream: TStream): Currency; +procedure ReadCurrencyProc(AStream: TStream; var Value: Currency); +procedure WriteCurrencyProc(AStream: TStream; AValue: Currency); + +function ReadDateTimeFunc(AStream: TStream): TDateTime; +procedure ReadDateTimeProc(AStream: TStream; var Value: TDateTime); +procedure WriteDateTimeProc(AStream: TStream; AValue: TDateTime); + +function ReadIntegerFunc(AStream: TStream): Integer; +procedure ReadIntegerProc(AStream: TStream; var Value: Integer); +procedure WriteIntegerProc(AStream: TStream; AValue: Integer); + +function ReadLargeIntFunc(AStream: TStream): LargeInt; +procedure ReadLargeIntProc(AStream: TStream; var Value: LargeInt); +procedure WriteLargeIntProc(AStream: TStream; AValue: LargeInt); + +function ReadByteFunc(AStream: TStream): Byte; +procedure ReadByteProc(AStream: TStream; var Value: Byte); +procedure WriteByteProc(AStream: TStream; AValue: Byte); + +function ReadSmallIntFunc(AStream: TStream): SmallInt; +procedure ReadSmallIntProc(AStream: TStream; var Value: SmallInt); +procedure WriteSmallIntProc(AStream: TStream; AValue: SmallInt); + +function ReadCardinalFunc(AStream: TStream): Cardinal; +procedure ReadCardinalProc(AStream: TStream; var Value: Cardinal); +procedure WriteCardinalProc(AStream: TStream; AValue: Cardinal); + +function ReadShortIntFunc(AStream: TStream): ShortInt; +procedure ReadShortIntProc(AStream: TStream; var Value: ShortInt); +procedure WriteShortIntProc(AStream: TStream; AValue: ShortInt); + +function ReadWordFunc(AStream: TStream): Word; +procedure ReadWordProc(AStream: TStream; var Value: Word); +procedure WriteWordProc(AStream: TStream; AValue: Word); + +implementation + +uses +{$IFNDEF NONDB} + {$IFDEF DELPHI6} + FMTBcd, SqlTimSt, + {$ENDIF} +{$ENDIF} + Windows, cxDataConsts; + +function VarArrayCompare(const V1, V2: Variant): Integer; +var + I: Integer; +begin + if VarIsArray(V1) and VarIsArray(V2) then + begin + Result := VarArrayHighBound(V1, 1) - VarArrayHighBound(V2, 1); + if Result = 0 then + begin + for I := 0 to VarArrayHighBound(V1, 1) do + begin + Result := VarCompare(V1[I], V2[I]); + if Result <> 0 then + Break; + end; + end; + end + else + if VarIsArray(V1) then + Result := 1 + else + if VarIsArray(V2) then + Result := -1 + else + Result := VarCompare(V1, V2); +end; + +function VarCompare(const V1, V2: Variant): Integer; + + function CompareValues(const V1, V2: Variant): Integer; + begin + try + if VarIsEmpty(V1) then + if VarIsEmpty(V2) then + Result := 0 + else + Result := -1 + else + if VarIsEmpty(V2) then + Result := 1 + else + if V1 = V2 then + Result := 0 + else + {$IFDEF DELPHI6} + if VarIsNull(V1) then + Result := -1 + else + if VarIsNull(V2) then + Result := 1 + else + {$ENDIF} + if V1 < V2 then + Result := -1 + else + Result := 1; + except + on EVariantError do + Result := -1; + end; + end; + +begin +{$IFDEF DELPHI6} + {$IFNDEF DELPHI7} + if (VarType(V1) = varString) and (VarType(V2) = varString) then + Result := CompareStr(V1, V2) + else + if (VarType(V1) = varDate) and (VarType(V2) = varDate) then + Result := CompareValues(Double(V1), Double(V2)) + else + {$ENDIF} +{$ENDIF} + if VarIsArray(V1) or VarIsArray(V2) then + Result := VarArrayCompare(V1, V2) + else + Result := CompareValues(V1, V2); +end; + +function VarEquals(const V1, V2: Variant): Boolean; +begin + Result := VarCompare(V1, V2) = 0; +end; + +function VarEqualsExact(const V1, V2: Variant): Boolean; +var + AVarType1, AVarType2: Integer; + AValue1, AValue2: Variant; +begin + AVarType1 := VarType(V1); + AVarType2 := VarType(V2); + if (AVarType1 = varNull) or (AVarType2 = varNull) or + ((AVarType1 <> varBoolean) and (AVarType2 <> varBoolean)) then + Result := VarEquals(V1, V2) + else + try + VarCast(AValue1, V1, varString); + VarCast(AValue2, V2, varString); + Result := AValue1 = AValue2; + except + on EVariantError do + Result := False; + end; +end; + +function VarEqualsSoft(const V1, V2: Variant): Boolean; +begin + Result := VarEquals(V1, V2) or (VarIsSoftNull(V1) and VarIsSoftNull(V2)); +end; + +function VarIndex(const AList: TVariantArray; const AValue: Variant): Integer; +begin + for Result := 0 to Length(AList) - 1 do + if VarEquals(AList[Result], AValue) then Exit; + Result := -1; +end; + +{$IFNDEF DELPHI6} +function FindVarData(const V: Variant): PVarData; +begin + Result := @TVarData(V); + while Result.VType = varByRef or varVariant do + Result := PVarData(Result.VPointer); +end; +{$ENDIF} + +function VarIsDate(const AValue: Variant): Boolean; + + function VarTypeIsDate(const AVarType: TVarType): Boolean; + begin + Result := (AVarType = varDate) + {$IFNDEF NONDB}{$IFDEF DELPHI6} or (AVarType = VarSQLTimeStamp){$ENDIF}{$ENDIF}; + end; + +begin + Result := VarTypeIsDate(FindVarData(AValue)^.VType); +end; + +function VarIsNumericEx(const AValue: Variant): Boolean; +begin + Result := VarIsNumeric(AValue) + {$IFNDEF NONDB}{$IFDEF DELPHI6} or + (FindVarData(AValue)^.VType = VarFMTBcd) + {$ENDIF}{$ENDIF}; +end; + +{$IFNDEF DELPHI6} + +function VarIsType(const AValue: Variant; AVarType: TVarType): Boolean; +begin + Result := FindVarData(AValue)^.VType = AVarType; +end; + +function VarTypeIsOrdinal(const AVarType: TVarType): Boolean; +begin + Result := AVarType in [varSmallInt, varInteger, varBoolean, varByte]; +end; + +function VarIsOrdinal(const AValue: Variant): Boolean; +begin + Result := VarTypeIsOrdinal(FindVarData(AValue)^.VType); +end; + +function VarTypeIsFloat(const AVarType: TVarType): Boolean; +begin + Result := AVarType in [varSingle, varDouble, varCurrency]; +end; + +function VarIsFloat(const AValue: Variant): Boolean; +begin + Result := VarTypeIsFloat(FindVarData(AValue)^.VType); +end; + +function VarTypeIsNumeric(const AVarType: TVarType): Boolean; +begin + Result := VarTypeIsOrdinal(AVarType) or VarTypeIsFloat(AVarType); +end; + +function VarIsNumeric(const AValue: Variant): Boolean; +begin + Result := VarTypeIsNumeric(FindVarData(AValue)^.VType); +end; + +function VarTypeIsStr(const AVarType: TVarType): Boolean; +begin + Result := (AVarType = varString) or (AVarType = varOleStr); +end; + +function VarIsStr(const AValue: Variant): Boolean; +begin + Result := VarTypeIsStr(FindVarData(AValue)^.VType); +end; + +function VarSameValue(const V1, V2: Variant): Boolean; +var + D1, D2: TVarData; +begin + D1 := FindVarData(V1)^; + D2 := FindVarData(V2)^; + if D1.VType = varEmpty then + Result := D2.VType = varEmpty + else + if D1.VType = varNull then + Result := D2.VType = varNull + else + if D2.VType in [varEmpty, varNull] then + Result := False + else + Result := V1 = V2; +end; + +{$ENDIF} + +function VarIsSoftNull(const AValue: Variant): Boolean; +begin + Result := VarIsNull(AValue) or + ({(VarType(AValue) = varString)}VarIsStr(AValue) and (AValue = '')); +end; + +function VarToStrEx(const V: Variant): string; +begin + Result := VarToStr(V); +{$IFNDEF DELPHI6} + if VarType(V) = varDouble then + Result := StringReplace(Result, GetLocaleChar(GetThreadLocale, LOCALE_SDECIMAL, '.'), + DecimalSeparator, []); +{$ENDIF} +end; + +function VarTypeIsCurrency(AVarType: TVarType): Boolean; +begin + Result := (AVarType = varCurrency) + {$IFNDEF NONDB} + {$IFDEF DELPHI6} or (AVarType = VarFMTBcd){$ENDIF} + {$ENDIF}; +end; + +function VarBetweenArrayCreate(const AValue1, AValue2: Variant): Variant; +begin + Result := VarArrayCreate([0, 1], varVariant); + Result[0] := AValue1; + Result[1] := AValue2; +end; + +function VarListArrayCreate(const AValue: Variant): Variant; +begin + Result := VarArrayCreate([0, 0], varVariant); + Result[0] := AValue; +end; + +procedure VarListArrayAddValue(var Value: Variant; const AValue: Variant); +var + V: Variant; + I, C: Integer; +begin + C := VarArrayHighBound(Value, 1) - VarArrayLowBound(Value, 1) + 2; + V := VarArrayCreate([0, C - 1], varVariant); + for I := VarArrayLowBound(Value, 1) to VarArrayHighBound(Value, 1) do + V[I] := Value[I]; + V[C - 1] := AValue; + Value := V; +end; + +// Stream routines + +function ReadStringFunc(AStream: TStream): string; +begin + ReadStringProc(AStream, Result); +end; + +procedure ReadStringProc(AStream: TStream; var S: string); +var + L: Integer; +begin + AStream.ReadBuffer(L, SizeOf(L)); + SetLength(S, L); + AStream.ReadBuffer(Pointer(S)^, L); +end; + +procedure WriteStringProc(AStream: TStream; const S: string); +var + L: Integer; +begin + L := Length(S); + AStream.WriteBuffer(L, SizeOf(L)); + AStream.WriteBuffer(S[1], L); +end; + +function ReadWideStringFunc(AStream: TStream): WideString; +begin + ReadWideStringProc(AStream, Result); +end; + +procedure ReadWideStringProc(AStream: TStream; var S: WideString); +var + L: Integer; +begin + AStream.ReadBuffer(L, SizeOf(L)); + SetLength(S, L); + AStream.ReadBuffer(Pointer(S)^, L * 2); +end; + +procedure WriteWideStringProc(AStream: TStream; const S: WideString); +var + L: Integer; +begin + L := Length(S); + AStream.WriteBuffer(L, SizeOf(L)); + AStream.WriteBuffer(Pointer(S)^, L * 2); +end; + +function ReadVariantFunc(AStream: TStream): Variant; +begin + ReadVariantProc(AStream, Result); +end; + +procedure ReadVariantProc(AStream: TStream; var Value: Variant); +const + ValTtoVarT: array[TValueType] of Integer = (varNull, varError, + {$IFNDEF DELPHI6}varByte{$ELSE}varShortInt{$ENDIF}, + varSmallInt, varInteger, varDouble, varString, varError, varBoolean, + varBoolean, varError, varError, varString, varEmpty, varError, varSingle, + varCurrency, varDate, varOleStr, + {$IFDEF DELPHI6}varInt64{$ELSE}varError{$ENDIF} + {$IFDEF DELPHI6}, varError {$IFDEF DELPHI8}, varDouble{$ENDIF}{$ENDIF}); +var + ValType: TValueType; + + function ReadValue: TValueType; + var + B: Byte; + begin + AStream.ReadBuffer(B, SizeOf(Byte)); + Result := TValueType(B); + end; + + function ReadInteger: LargeInt; + var + SH: Shortint; + SM: Smallint; + I: Integer; + begin + case ValType of + vaInt8: + begin + AStream.ReadBuffer(SH, SizeOf(SH)); + Result := SH; + end; + vaInt16: + begin + AStream.ReadBuffer(SM, SizeOf(SM)); + Result := SM; + end; + {$IFDEF DELPHI6} + vaInt32: + {$ELSE} + else + {$ENDIF} + begin + AStream.ReadBuffer(I, SizeOf(I)); + Result := I; + end + {$IFDEF DELPHI6} + else // vaInt64 + AStream.ReadBuffer(Result, SizeOf(Result)); + {$ENDIF} + end; + end; + + function ReadFloat: Extended; + begin + AStream.ReadBuffer(Result, SizeOf(Result)); + end; + + function ReadSingle: Single; + begin + AStream.ReadBuffer(Result, SizeOf(Result)); + end; + + function ReadCurrency: Currency; + begin + ReadCurrencyProc(AStream, Result); + end; + + function ReadDate: TDateTime; + begin + ReadDateTimeProc(AStream, Result); + end; + + function ReadString: string; + var + L: Integer; + begin + L := 0; + case ValType of + vaString: + AStream.ReadBuffer(L, SizeOf(Byte)); + else {vaLString} + AStream.ReadBuffer(L, SizeOf(Integer)); + end; + SetString(Result, PChar(nil), L); + AStream.ReadBuffer(Pointer(Result)^, L); + end; + + function ReadWideString: WideString; + begin + ReadWideStringProc(AStream, Result); + end; + + procedure ReadArrayProc(var Value: Variant); + var + I, C: Integer; + V: Variant; + begin + // read size + ValType := ReadValue; // len + C := ReadInteger; + // read values + Value := VarArrayCreate([0, C - 1], varVariant); + for I := 0 to C - 1 do + begin + ReadVariantProc(AStream, V); + Value[I] := V; + end; + end; + +begin + ValType := ReadValue; + if ValType = vaList then + begin + ReadArrayProc(Value); + Exit; + end; + case ValType of + vaNil: + VarClear(Value); + vaNull: + Value := Null; + vaInt8: + {$IFNDEF DELPHI6} + TVarData(Value).VByte := Byte(ReadInteger); + {$ELSE} + TVarData(Value).VShortInt := ShortInt(ReadInteger); + {$ENDIF} + vaInt16: + TVarData(Value).VSmallint := Smallint(ReadInteger); + vaInt32: + TVarData(Value).VInteger := ReadInteger; + {$IFDEF DELPHI6} + vaInt64: + TVarData(Value).VInt64 := ReadInteger; + {$ENDIF} + vaExtended: + TVarData(Value).VDouble := ReadFloat; + vaString, vaLString: + Value := ReadString; + vaFalse, vaTrue: + TVarData(Value).VBoolean := ValType = vaTrue; + vaWString: + Value := ReadWideString; + vaSingle: + TVarData(Value).VSingle := ReadSingle; + vaCurrency: + TVarData(Value).VCurrency := ReadCurrency; + vaDate: + TVarData(Value).VDate := ReadDate; + else + raise EReadError.Create(cxSDataReadError); + end; + TVarData(Value).VType := ValTtoVarT[ValType]; +end; + +procedure WriteVariantProc(AStream: TStream; const AValue: Variant); + + procedure WriteValue(Value: TValueType); + begin + AStream.WriteBuffer(Byte(Value), SizeOf(Byte)); + end; + + procedure WriteInteger(Value: {$IFDEF DELPHI6}LargeInt{$ELSE}Integer{$ENDIF}); + var + SH: Shortint; + SM: Smallint; + I: Integer; + begin + if (Value >= Low(ShortInt)) and (Value <= High(ShortInt)) then + begin + WriteValue(vaInt8); + SH := Value; + AStream.WriteBuffer(SH, SizeOf(SH)); + end + else + if (Value >= Low(SmallInt)) and (Value <= High(SmallInt)) then + begin + WriteValue(vaInt16); + SM := Value; + AStream.WriteBuffer(SM, SizeOf(SM)); + end + else + {$IFDEF DELPHI6} + if (Value >= Low(Integer)) and (Value <= High(Integer)) then + {$ENDIF} + begin + WriteValue(vaInt32); + I := Value; + AStream.WriteBuffer(I, SizeOf(I)); + end + {$IFDEF DELPHI6} + else + begin + WriteValue(vaInt64); + AStream.WriteBuffer(Value, SizeOf(Value)); + end; + {$ENDIF} + end; + + procedure WriteString(const Value: string); + var + B: Byte; + L: Integer; + begin + L := Length(Value); + if L <= 255 then + begin + WriteValue(vaString); + B := L; + AStream.WriteBuffer(B, SizeOf(B)); + end + else + begin + WriteValue(vaLString); + AStream.WriteBuffer(L, SizeOf(L)); + end; + AStream.WriteBuffer(Pointer(Value)^, L); + end; + + procedure WriteFloat(const Value: Extended); + begin + WriteValue(vaExtended); + AStream.WriteBuffer(Value, SizeOf(Extended)); + end; + + procedure WriteSingle(const Value: Single); + begin + WriteValue(vaSingle); + AStream.WriteBuffer(Value, SizeOf(Single)); + end; + + procedure WriteCurrency(const Value: Currency); + begin + WriteValue(vaCurrency); + WriteCurrencyProc(AStream, Value); + end; + + procedure WriteDate(const Value: TDateTime); + begin + WriteValue(vaDate); + WriteDateTimeProc(AStream, Value); + end; + + procedure WriteWideString(const Value: WideString); + begin + WriteValue(vaWString); + WriteWideStringProc(AStream, Value); + end; + + procedure WriteArrayProc(const Value: Variant); + var + I, L, H: Integer; + begin + if VarArrayDimCount(Value) <> 1 then + raise EWriteError.Create(cxSDataWriteError); + L := VarArrayLowBound(Value, 1); + H := VarArrayHighBound(Value, 1); + WriteValue(vaList); + WriteInteger(H - L + 1); + for I := L to H do + WriteVariantProc(AStream, Value[I]); + end; + +var + VType: Integer; +begin + if VarIsArray(AValue) then + begin + WriteArrayProc(AValue); + Exit; + end; + VType := VarType(AValue); + case VType and varTypeMask of + varEmpty: + WriteValue(vaNil); + varNull: + WriteValue(vaNull); + varString: + WriteString(AValue); + {$IFDEF DELPHI6} + varShortInt, varWord, varLongWord, varInt64, + {$ENDIF} + varByte, varSmallInt, varInteger: + WriteInteger(AValue); + varDouble: + WriteFloat(AValue); + varBoolean: + if AValue then + WriteValue(vaTrue) + else + WriteValue(vaFalse); + {$IFDEF DELPHI4} + varOleStr: + WriteWideString(AValue); + varSingle: + WriteSingle(AValue); + varCurrency: + WriteCurrency(AValue); + varDate: + WriteDate(AValue); + {$ENDIF} + else +{$IFDEF DELPHI6} + {$IFNDEF NONDB} + if VType = VarSQLTimeStamp then + WriteVariantProc(AStream, TDateTime(AValue)) + else + {$ENDIF} +{$ENDIF} + try + WriteString(AValue); + except + raise EWriteError.Create(cxSDataWriteError); + end; + end; +end; + +function ReadBooleanFunc(AStream: TStream): Boolean; +begin + ReadBooleanProc(AStream, Result); +end; + +procedure ReadBooleanProc(AStream: TStream; var Value: Boolean); +begin + AStream.ReadBuffer(Value, SizeOf(Value)); +end; + +procedure WriteBooleanProc(AStream: TStream; AValue: Boolean); +begin + AStream.WriteBuffer(AValue, SizeOf(AValue)); +end; + +function ReadCharFunc(AStream: TStream): Char; +begin + ReadCharProc(AStream, Result); +end; + +procedure ReadCharProc(AStream: TStream; var Value: Char); +begin + AStream.ReadBuffer(Value, SizeOf(Value)); +end; + +procedure WriteCharProc(AStream: TStream; AValue: Char); +begin + AStream.WriteBuffer(AValue, SizeOf(AValue)); +end; + +function ReadFloatFunc(AStream: TStream): Extended; +begin + ReadFloatProc(AStream, Result); +end; + +procedure ReadFloatProc(AStream: TStream; var Value: Extended); +begin + AStream.ReadBuffer(Value, SizeOf(Value)); +end; + +procedure WriteFloatProc(AStream: TStream; AValue: Extended); +begin + AStream.WriteBuffer(AValue, SizeOf(AValue)); +end; + +function ReadSingleFunc(AStream: TStream): Single; +begin + ReadSingleProc(AStream, Result); +end; + +procedure ReadSingleProc(AStream: TStream; var Value: Single); +begin + AStream.ReadBuffer(Value, SizeOf(Value)); +end; + +procedure WriteSingleProc(AStream: TStream; AValue: Single); +begin + AStream.WriteBuffer(AValue, SizeOf(AValue)); +end; + +function ReadCurrencyFunc(AStream: TStream): Currency; +begin + ReadCurrencyProc(AStream, Result); +end; + +procedure ReadCurrencyProc(AStream: TStream; var Value: Currency); +begin + AStream.ReadBuffer(Value, SizeOf(Value)); +end; + +procedure WriteCurrencyProc(AStream: TStream; AValue: Currency); +begin + AStream.WriteBuffer(AValue, SizeOf(AValue)); +end; + +function ReadDateTimeFunc(AStream: TStream): TDateTime; +begin + ReadDateTimeProc(AStream, Result); +end; + +procedure ReadDateTimeProc(AStream: TStream; var Value: TDateTime); +begin + AStream.ReadBuffer(Value, SizeOf(Value)); +end; + +procedure WriteDateTimeProc(AStream: TStream; AValue: TDateTime); +begin + AStream.WriteBuffer(AValue, SizeOf(AValue)); +end; + +function ReadIntegerFunc(AStream: TStream): Integer; +begin + ReadIntegerProc(AStream, Result); +end; + +procedure ReadIntegerProc(AStream: TStream; var Value: Integer); +begin + AStream.ReadBuffer(Value, SizeOf(Value)); +end; + +procedure WriteIntegerProc(AStream: TStream; AValue: Integer); +begin + AStream.WriteBuffer(AValue, SizeOf(AValue)); +end; + +function ReadLargeIntFunc(AStream: TStream): LargeInt; +begin + ReadLargeIntProc(AStream, Result); +end; + +procedure ReadLargeIntProc(AStream: TStream; var Value: LargeInt); +begin + AStream.ReadBuffer(Value, SizeOf(Value)); +end; + +procedure WriteLargeIntProc(AStream: TStream; AValue: LargeInt); +begin + AStream.WriteBuffer(AValue, SizeOf(AValue)); +end; + +function ReadByteFunc(AStream: TStream): Byte; +begin + ReadByteProc(AStream, Result); +end; + +procedure ReadByteProc(AStream: TStream; var Value: Byte); +begin + AStream.ReadBuffer(Value, SizeOf(Value)); +end; + +procedure WriteByteProc(AStream: TStream; AValue: Byte); +begin + AStream.WriteBuffer(AValue, SizeOf(AValue)); +end; + +function ReadSmallIntFunc(AStream: TStream): SmallInt; +begin + ReadSmallIntProc(AStream, Result); +end; + +procedure ReadSmallIntProc(AStream: TStream; var Value: SmallInt); +begin + AStream.ReadBuffer(Value, SizeOf(Value)); +end; + +procedure WriteSmallIntProc(AStream: TStream; AValue: SmallInt); +begin + AStream.WriteBuffer(AValue, SizeOf(AValue)); +end; + +function ReadCardinalFunc(AStream: TStream): Cardinal; +begin + ReadCardinalProc(AStream, Result); +end; + +procedure ReadCardinalProc(AStream: TStream; var Value: Cardinal); +begin + Value := ReadIntegerFunc(AStream); +end; + +procedure WriteCardinalProc(AStream: TStream; AValue: Cardinal); +begin + WriteIntegerProc(AStream, AValue); +end; + +function ReadShortIntFunc(AStream: TStream): ShortInt; +begin + ReadShortIntProc(AStream, Result); +end; + +procedure ReadShortIntProc(AStream: TStream; var Value: ShortInt); +begin + Value := ReadByteFunc(AStream); +end; + +procedure WriteShortIntProc(AStream: TStream; AValue: ShortInt); +begin + WriteByteProc(AStream, AValue); +end; + +function ReadWordFunc(AStream: TStream): Word; +begin + ReadWordProc(AStream, Result); +end; + +procedure ReadWordProc(AStream: TStream; var Value: Word); +begin + Value := ReadSmallIntFunc(AStream); +end; + +procedure WriteWordProc(AStream: TStream; AValue: Word); +begin + WriteSmallIntProc(AStream, AValue); +end; + +{ TcxFiler } + +constructor TcxFiler.Create(AStream: TStream); +begin + inherited Create; + FStream := AStream; +end; + +{ TcxReader } + +function TcxReader.ReadBoolean: Boolean; +begin + ReadBooleanProc(Stream, Result); +end; + +function TcxReader.ReadByte: Byte; +begin + ReadByteProc(Stream, Result); +end; + +function TcxReader.ReadCardinal: Cardinal; +begin + ReadCardinalProc(Stream, Result); +end; + +function TcxReader.ReadChar: Char; +begin + ReadCharProc(Stream, Result); +end; + +function TcxReader.ReadCurrency: Currency; +begin + ReadCurrencyProc(Stream, Result); +end; + +function TcxReader.ReadDateTime: TDateTime; +begin + ReadDateTimeProc(Stream, Result); +end; + +function TcxReader.ReadFloat: Extended; +begin + ReadFloatProc(Stream, Result); +end; + +function TcxReader.ReadInteger: Integer; +begin + ReadIntegerProc(Stream, Result); +end; + +function TcxReader.ReadLargeInt: LargeInt; +begin + ReadLargeIntProc(Stream, Result); +end; + +function TcxReader.ReadShortInt: ShortInt; +begin + ReadShortIntProc(Stream, Result); +end; + +function TcxReader.ReadSingle: Single; +begin + ReadSingleProc(Stream, Result); +end; + +function TcxReader.ReadSmallInt: SmallInt; +begin + ReadSmallIntProc(Stream, Result); +end; + +function TcxReader.ReadString: string; +begin + ReadStringProc(Stream, Result); +end; + +function TcxReader.ReadVariant: Variant; +begin + ReadVariantProc(Stream, Result); +end; + +function TcxReader.ReadWideString: WideString; +begin + ReadWideStringProc(Stream, Result); +end; + +function TcxReader.ReadWord: Word; +begin + ReadWordProc(Stream, Result); +end; + +{ TcxWriter } + +procedure TcxWriter.WriteBoolean(AValue: Boolean); +begin + WriteBooleanProc(Stream, AValue); +end; + +procedure TcxWriter.WriteByte(AValue: Byte); +begin + WriteByteProc(Stream, AValue); +end; + +procedure TcxWriter.WriteCardinal(AValue: Cardinal); +begin + WriteCardinalProc(Stream, AValue); +end; + +procedure TcxWriter.WriteChar(AValue: Char); +begin + WriteCharProc(Stream, AValue); +end; + +procedure TcxWriter.WriteCurrency(AValue: Currency); +begin + WriteCurrencyProc(Stream, AValue); +end; + +procedure TcxWriter.WriteDateTime(AValue: TDateTime); +begin + WriteDateTimeProc(Stream, AValue); +end; + +procedure TcxWriter.WriteFloat(AValue: Extended); +begin + WriteFloatProc(Stream, AValue); +end; + +procedure TcxWriter.WriteInteger(AValue: Integer); +begin + WriteIntegerProc(Stream, AValue); +end; + +procedure TcxWriter.WriteLargeInt(AValue: LargeInt); +begin + WriteLargeIntProc(Stream, AValue); +end; + +procedure TcxWriter.WriteShortInt(AValue: ShortInt); +begin + WriteShortIntProc(Stream, AValue); +end; + +procedure TcxWriter.WriteSingle(AValue: Single); +begin + WriteSingleProc(Stream, AValue); +end; + +procedure TcxWriter.WriteSmallInt(AValue: SmallInt); +begin + WriteSmallIntProc(Stream, AValue); +end; + +procedure TcxWriter.WriteString(const S: string); +begin + WriteStringProc(Stream, S); +end; + +procedure TcxWriter.WriteVariant(const AValue: Variant); +begin + WriteVariantProc(Stream, AValue); +end; + +procedure TcxWriter.WriteWideString(const S: WideString); +begin + WriteWideStringProc(Stream, S); +end; + +procedure TcxWriter.WriteWord(AValue: Word); +begin + WriteWordProc(Stream, AValue); +end; + +end. diff --git a/official/x.35/ExpressDataController/Sources/cxVer.inc b/official/x.35/ExpressDataController/Sources/cxVer.inc new file mode 100644 index 00000000..a26364cc --- /dev/null +++ b/official/x.35/ExpressDataController/Sources/cxVer.inc @@ -0,0 +1,172 @@ +{$B-} { Complete Boolean Evaluation } +{$R-} { Range-Checking } +{$T-} { Typed @ operator } +{$X+} { Extended syntax } +{$P+} { Open string params } +{$J+} { Writeable structured consts } +{$H+} { Use long strings by default } +{$Q-} { Overflow checking } + +{$DEFINE DXVER500} + +{$IFNDEF CLR} + {$DEFINE OLEDRAGANDDROP} + {$IFNDEF DONTUSEJPEGIMAGE} + {$DEFINE USEJPEGIMAGE} + {$ENDIF} +{$ENDIF} + +{$DEFINE EXPRESSBARS5} + +{$DEFINE VCL} + +{$IFNDEF VER80} + {$IFNDEF VER90} + {$IFNDEF VER93} + {$DEFINE DELPHI3} { Borland Delphi 3.0 } + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER110} { Borland C++Builder 3.0 } + {$DEFINE CBUILDER3} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE DELPHI4} +{$ENDIF} + +{$IFDEF VER125} { Borland C++Builder 4.0 } + {$DEFINE CBUILDER3} + {$DEFINE DELPHI4} + {$DEFINE CBUILDER4} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$IFDEF BCB} { Borland C++Builder 5.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$IFDEF BCB} { Borland C++Builder 6.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} +{$ENDIF} + +{$IFNDEF DELPHI6} + {$DEFINE MSWINDOWS} +{$ENDIF} +{$IFDEF LINUX} + {$UNDEF MSWINDOWS} +{$ENDIF} + +{$IFDEF LINUX} + {$DEFINE KYLIX1} { Borland Kylix 1 } + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF CompilerVersion >= 14} + {$DEFINE KYLIX2} { Borland Kylix 2 } + {$IFEND} + {$IF CompilerVersion >= 14.50} + {$DEFINE KYLIX3} { Borland Kylix 3 } + {$IFEND} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} { Borland Delphi.Net } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} +{$ENDIF} + +{$IFDEF VER170} { Borland Delphi 9.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} +{$ENDIF} + +{$IFDEF VER180} { Borland Delphi 10 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$IFDEF BCB} { Borland C++Builder 10 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Borland Delphi 11 //CodeGear} + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$DEFINE DELPHI11} + {$IFDEF BCB} { Borland C++Builder 11 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$DEFINE CBUILDER11} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFNDEF CLR} + {$IFNDEF BCB} + {$IFDEF DELPHI6} + {$DEFINE REGISTERSHELLCTRLS} + {$ENDIF} + {$ENDIF} + {$IFDEF DELPHI7} + {$WARN UNSAFE_CAST OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_TYPE OFF} + {$ENDIF} +{$ENDIF} + +{$IFDEF REGISTERSHELLCTRLS} + {$DEFINE REGISTERCXSHELLCTRLS} +{$ENDIF} + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} diff --git a/official/x.35/ExpressDocking Library/Help/Docking.cnt b/official/x.35/ExpressDocking Library/Help/Docking.cnt new file mode 100644 index 00000000..73287bd4 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Help/Docking.cnt @@ -0,0 +1,93 @@ +:Base Docking.hlp +:Title ExpressDocking Library +:Index ExpressDocking Library=docking.hlp +1 ExpressDocking Library +2 Overview=IDH_Custom_Overview +2 Quick Start +3 Basics +4 Adding Components and Controls=IDH_QS_AddingComponentsControls +4 Customizing Dock Panels Appearance=IDH_QS_CustomizingDockPanelsAppearance +4 Docking Operations Basics=IDH_QS_DockingOperationsBasics +3 Building User Interfaces +4 Creating a Visual Studio .NET like Interface=IDH_QS_VisualStudioInferface +4 Using Dock Controls in MDI Applications=IDH_QS_UsingDockControlsMDI +3 Managing Dock Controls at Runtime +4 Understanding the Dock Control Internal Layout=IDH_QS_UnderstandingLayout +4 Docking Panels to Sites at Runtime=IDH_QS_DockingPanelsSitesRuntime +4 Creating and Managing Container Controls at Runtime=IDH_QS_ManagingContainerControlsRuntime +4 Creating, Destroying, Showing and Hiding Dock Controls=IDH_QS_CreatingDestroyingShowingHiding +2 Concepts +3 Common Features +4 Docking Operations=IDH_Concepts_DockingOperations +4 Resizing Operations=IDH_Concepts_ResizingOperations +4 Auto Hide Feature=IDH_Concepts_AutoHideFeature +4 Caption Buttons=IDH_Concepts_CaptionButtons +3 Dock Controls +4 Hierarchy=IDH_Concepts_DockControlsHierarchy +4 Dock Panels=IDH_Concepts_DockPanels +4 Dock Sites=IDH_Concepts_DockSites +4 Layout Sites=IDH_Custom_LayoutSites +4 Float Sites=IDH_Custom_FloatSites +4 Containers +5 Tab Container Sites=IDH_Concepts_TabContainerSites +5 Side Container Sites=IDH_Custom_SideContainerSites +3 Docking Manager +4 When to Use the Docking Manager=IDH_Concepts_WhenUseDockingManager +4 Docking Manager Features=IDH_Concepts_DockingManagerFeatures +3 Paint Styles and Custom Painting +4 Paint Styles=IDH_Concepts_PaintStyles +4 Docking Frame and Resizing Bar Custom Painting +5 Overview=IDH_Concepts_DockResizeCustomPainting +5 Docking Frame Custom Painting Sample=IDH_Concepts_DockingFrameCustomPaint +5 Resizing Bar Custom Painting Sample=IDH_Concepts_ResizingBarCustomPaint +3 Dock Zones and Resize Zones +4 Zones Overview=IDH_Concepts_ZonesOverview +4 Dock Zones=IDH_Concepts_DockZones +4 Resize Zones=IDH_Concepts_ResizeZones +3 Managing Dock Controls via Code +4 Performing Docking Operations=IDH_Concepts_DockingCode +4 Controlling Docking Operations=IDH_Concepts_ControllingDocking +4 Controlling Resizing Operations=IDH_Concepts_ControllingResizing +4 Persisting Settings of Controls Residing in Dock Panels=IDH_Concepts_PersistingSettings +2 Reference +3 Units +4 dxDockControl Unit=IDH_Unit_dxDockControl +4 dxDockPanel Unit=IDH_Unit_dxDockPanel +4 dxDockConsts Unit=IDH_Unit_dxDockConsts +3 Components & Controls +4 TdxDockPanel=IDH_Class_TdxDockPanel +4 TdxDockSite=IDH_Class_TdxDockSite +4 TdxDockingManager=IDH_Class_TdxDockingManager +3 Classes +4 Dock Controls +5 TdxCustomDockControl=IDH_Class_TdxCustomDockControl +5 TdxCustomDockSite=IDH_Class_TdxCustomDockSite +5 TdxContainerDockSite=IDH_Class_TdxContainerDockSite +5 TdxFloatDockSite=IDH_Class_TdxFloatDockSite +5 TdxLayoutDockSite=IDH_Class_TdxLayoutDockSite +5 TdxTabContainerDockSite=IDH_Class_TdxTabContainerDockSite +5 TdxSideContainerDockSite=IDH_Class_TdxSideContainerDockSite +5 TdxHorizContainerDockSite=IDH_Class_TdxHorizContainerDockSite +5 TdxVertContainerDockSite=IDH_Class_TdxVertContainerDockSite +4 Dock Controls Properties +5 TdxCustomDockControlProperties=IDH_Class_TdxCustomDockControlProperties +5 TdxFloatDockSiteProperties=IDH_Class_TdxFloatDockSiteProperties +5 TdxLayoutDockSiteProperties=IDH_Class_TdxLayoutDockSiteProperties +5 TdxTabContainerDockSiteProperties=IDH_Class_TdxTabContainerDockSiteProperties +5 TdxSideContainerDockSiteProperties=IDH_Class_TdxSideContainerDockSiteProperties +4 Other +5 TdxDockingController=IDH_Class_TdxDockingController +5 TdxFloatForm=IDH_Class_TdxFloatForm +5 TdxZone=IDH_Class_TdxZone +3 Global Functions +4 dxDockingController=IDH_dxDockControl_dxDockingController +3 Global Constants +4 dxAutoHideInterval=IDH_Const_dxAutoHideInterval +4 dxAutoHideMovingInterval=IDH_Const_dxAutoHideMovingInterval +4 dxAutoHideMovingSize=IDH_Const_dxAutoHideMovingSize +4 dxAutoShowInterval=IDH_Const_dxAutoShowInterval +4 dxDefaultImageHeight=IDH_Const_dxDefaultImageHeight +4 dxDefaultImageWidth=IDH_Const_dxDefaultImageWidth +4 dxDockZonesWidth=IDH_Const_dxDockZonesWidth +4 dxResizeZonesWidth=IDH_Const_dxResizeZonesWidth +4 dxSelectionFrameWidth=IDH_Const_dxSelectionFrameWidth diff --git a/official/x.35/ExpressDocking Library/Help/Docking.hlp b/official/x.35/ExpressDocking Library/Help/Docking.hlp new file mode 100644 index 00000000..40c9bf07 Binary files /dev/null and b/official/x.35/ExpressDocking Library/Help/Docking.hlp differ diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingC10.bpk b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC10.bpk new file mode 100644 index 00000000..53b55094 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC10.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxDockingC10.bpl +OBJFILES = dxDockReg.obj dcldxDockingC10.obj +MAINSOURCE = dcldxDockingC10.cpp +RESFILES = dcldxDockingC10.res dxDockReg.dcr +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dxDockingC10.bpi cxLibraryC10.bpi dclcxLibraryC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressDocking Library by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingC10.cpp b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC10.cpp new file mode 100644 index 00000000..811a9528 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC10.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxDockingC10.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxDockingC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("dclLibraryC10.bpi"); +USEUNIT("dxDockReg.pas"); +USERES("dxDockReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingC10.res b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC10.res new file mode 100644 index 00000000..293364cf Binary files /dev/null and b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC10.res differ diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingC11.bpk b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC11.bpk new file mode 100644 index 00000000..7a06fbef --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC11.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxDockingC11.bpl +OBJFILES = dxDockReg.obj dcldxDockingC11.obj +MAINSOURCE = dcldxDockingC11.cpp +RESFILES = dcldxDockingC11.res dxDockReg.dcr +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dxDockingC11.bpi cxLibraryC11.bpi dclcxLibraryC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressDocking Library by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingC11.cpp b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC11.cpp new file mode 100644 index 00000000..f5463cf1 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC11.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxDockingC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxDockingC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dclLibraryC11.bpi"); +USEUNIT("dxDockReg.pas"); +USERES("dxDockReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingC11.res b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC11.res new file mode 100644 index 00000000..b6e22ea9 Binary files /dev/null and b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC11.res differ diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingC5.bpk b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC5.bpk new file mode 100644 index 00000000..a65a769b --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC5.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dcldxDockingC5.bpl +OBJFILES = dxDockReg.obj dcldxDockingC5.obj +RESFILES = dcldxDockingC5.res dxDockReg.dcr +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib +PACKAGES = VCL50.bpi dxDockingC5.bpi cxLibraryVCLC5.bpi dclcxLibraryVCLC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressDocking Library by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingC5.cpp b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC5.cpp new file mode 100644 index 00000000..9fd975e5 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC5.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxDockingC5.res"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("dxDockingC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("dclcxLibraryVCLC5.bpi"); +USEUNIT("dxDockReg.pas"); +USERES("dxDockReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingC5.res b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC5.res new file mode 100644 index 00000000..90cfc2e0 Binary files /dev/null and b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC5.res differ diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingC6.bpk b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC6.bpk new file mode 100644 index 00000000..ccd49150 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC6.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxDockingC6.bpl +OBJFILES = dxDockReg.obj dcldxDockingC6.obj +RESFILES = dcldxDockingC6.res dxDockReg.dcr +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dxDockingC6.bpi cxLibraryVCLC6.bpi dclcxLibraryVCLC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressDocking Library by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingC6.cpp b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC6.cpp new file mode 100644 index 00000000..7c6fbfd9 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC6.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxDockingC6.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxDockingC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("dclcxLibraryVCLC6.bpi"); +USEUNIT("dxDockReg.pas"); +USERES("dxDockReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingC6.res b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC6.res new file mode 100644 index 00000000..78a18c1d Binary files /dev/null and b/official/x.35/ExpressDocking Library/Packages/dcldxDockingC6.res differ diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingD10.dpk b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD10.dpk new file mode 100644 index 00000000..4b68388b --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD10.dpk @@ -0,0 +1,39 @@ +package dcldxDockingD10; + +{$ALIGN ON} +{$R dxDockReg.dcr} +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressDocking Library by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxDockingD10, + dclcxLibraryD10; + +contains + dxDockReg; + +end. diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingD10.res b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD10.res new file mode 100644 index 00000000..09dfe733 Binary files /dev/null and b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD10.res differ diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingD11.dpk b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD11.dpk new file mode 100644 index 00000000..c613a4e2 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD11.dpk @@ -0,0 +1,39 @@ +package dcldxDockingD11; + +{$ALIGN ON} +{$R dxDockReg.dcr} +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressDocking Library by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxDockingD11, + dclcxLibraryD11; + +contains + dxDockReg; + +end. diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingD11.res b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD11.res new file mode 100644 index 00000000..eedf6c88 Binary files /dev/null and b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD11.res differ diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingD5.dpk b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD5.dpk new file mode 100644 index 00000000..27242e98 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD5.dpk @@ -0,0 +1,38 @@ +package dcldxDockingD5; + +{$ALIGN ON} +{$R dxDockReg.dcr} +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressDocking Library by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxDockingD5, + dclcxLibraryVCLD5; + +contains + dxDockReg; + +end. diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingD5.res b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD5.res new file mode 100644 index 00000000..b66d8dd8 Binary files /dev/null and b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD5.res differ diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingD6.dpk b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD6.dpk new file mode 100644 index 00000000..6367fff1 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD6.dpk @@ -0,0 +1,39 @@ +package dcldxDockingD6; + +{$ALIGN ON} +{$R dxDockReg.dcr} +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressDocking Library by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxDockingD6, + dclcxLibraryVCLD6; + +contains + dxDockReg; + +end. diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingD6.res b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD6.res new file mode 100644 index 00000000..52ee6f9d Binary files /dev/null and b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD6.res differ diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingD7.dpk b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD7.dpk new file mode 100644 index 00000000..c8ae1c5f --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD7.dpk @@ -0,0 +1,39 @@ +package dcldxDockingD7; + +{$ALIGN ON} +{$R dxDockReg.dcr} +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressDocking Library by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxDockingD7, + dclcxLibraryVCLD7; + +contains + dxDockReg; + +end. diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingD7.res b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD7.res new file mode 100644 index 00000000..1f19c4d0 Binary files /dev/null and b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD7.res differ diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingD9.dpk b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD9.dpk new file mode 100644 index 00000000..65b594a3 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD9.dpk @@ -0,0 +1,39 @@ +package dcldxDockingD9; + +{$ALIGN ON} +{$R dxDockReg.dcr} +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressDocking Library by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxDockingD9, + dclcxLibraryD9; + +contains + dxDockReg; + +end. diff --git a/official/x.35/ExpressDocking Library/Packages/dcldxDockingD9.res b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD9.res new file mode 100644 index 00000000..b2f82f4e Binary files /dev/null and b/official/x.35/ExpressDocking Library/Packages/dcldxDockingD9.res differ diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingC10.bpk b/official/x.35/ExpressDocking Library/Packages/dxDockingC10.bpk new file mode 100644 index 00000000..a13b1250 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dxDockingC10.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxDockingC10.bpl +OBJFILES = dxDockPanel.obj dxDockControl.obj dxDockConsts.obj dxDockControlNETView.obj \ + dxDockControlXPView.obj dxDockControlOfficeView.obj dxDockZones.obj dxDockingC10.obj +MAINSOURCE = dxDockingC10.cpp +RESFILES = dxDockingC10.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dxThemeC10.bpi cxLibraryC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressDocking Library by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingC10.cpp b/official/x.35/ExpressDocking Library/Packages/dxDockingC10.cpp new file mode 100644 index 00000000..3090da75 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dxDockingC10.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +//--------------------------------------------------------------------------- +USERES("dxDockingC10.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEUNIT("dxDockPanel.pas"); +USEUNIT("dxDockControl.pas"); +USEUNIT("dxDockConsts.pas"); +USEUNIT("dxDockControlNETView.pas"); +USEUNIT("dxDockControlXPView.pas"); +USEUNIT("dxDockZones.pas"); +USEUNIT("dxDockControlOfficeView.pas"); +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingC10.res b/official/x.35/ExpressDocking Library/Packages/dxDockingC10.res new file mode 100644 index 00000000..02a83837 Binary files /dev/null and b/official/x.35/ExpressDocking Library/Packages/dxDockingC10.res differ diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingC11.bpk b/official/x.35/ExpressDocking Library/Packages/dxDockingC11.bpk new file mode 100644 index 00000000..59ae8fd6 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dxDockingC11.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxDockingC11.bpl +OBJFILES = dxDockPanel.obj dxDockControl.obj dxDockConsts.obj dxDockControlNETView.obj \ + dxDockControlXPView.obj dxDockControlOfficeView.obj dxDockZones.obj dxDockingC11.obj +MAINSOURCE = dxDockingC11.cpp +RESFILES = dxDockingC11.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dxThemeC11.bpi cxLibraryC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressDocking Library by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingC11.cpp b/official/x.35/ExpressDocking Library/Packages/dxDockingC11.cpp new file mode 100644 index 00000000..10e7cb1b --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dxDockingC11.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +//--------------------------------------------------------------------------- +USERES("dxDockingC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEUNIT("dxDockPanel.pas"); +USEUNIT("dxDockControl.pas"); +USEUNIT("dxDockConsts.pas"); +USEUNIT("dxDockControlNETView.pas"); +USEUNIT("dxDockControlXPView.pas"); +USEUNIT("dxDockZones.pas"); +USEUNIT("dxDockControlOfficeView.pas"); +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingC11.res b/official/x.35/ExpressDocking Library/Packages/dxDockingC11.res new file mode 100644 index 00000000..32a831bd Binary files /dev/null and b/official/x.35/ExpressDocking Library/Packages/dxDockingC11.res differ diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingC5.bpk b/official/x.35/ExpressDocking Library/Packages/dxDockingC5.bpk new file mode 100644 index 00000000..d6b5289f --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dxDockingC5.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxDockingC5.bpl +OBJFILES = dxDockPanel.obj dxDockControl.obj dxDockConsts.obj dxDockControlNETView.obj \ + dxDockControlXPView.obj dxDockControlOfficeView.obj dxDockZones.obj dxDockingC5.obj +RESFILES = dxDockingC5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib +PACKAGES = VCL50.bpi dxThemeC5.bpi cxLibraryVCLC5.bpi + +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressDocking Library by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingC5.cpp b/official/x.35/ExpressDocking Library/Packages/dxDockingC5.cpp new file mode 100644 index 00000000..78e60cfd --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dxDockingC5.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxDockingC5.res"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEUNIT("dxDockPanel.pas"); +USEUNIT("dxDockControl.pas"); +USEUNIT("dxDockConsts.pas"); +USEUNIT("dxDockControlNETView.pas"); +USEUNIT("dxDockControlXPView.pas"); +USEUNIT("dxDockZones.pas"); +USEUNIT("dxDockControlOfficeView.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingC5.res b/official/x.35/ExpressDocking Library/Packages/dxDockingC5.res new file mode 100644 index 00000000..5d56c357 Binary files /dev/null and b/official/x.35/ExpressDocking Library/Packages/dxDockingC5.res differ diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingC6.bpk b/official/x.35/ExpressDocking Library/Packages/dxDockingC6.bpk new file mode 100644 index 00000000..23849d86 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dxDockingC6.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxDockingC6.bpl +OBJFILES = dxDockPanel.obj dxDockControl.obj dxDockConsts.obj dxDockControlNETView.obj \ + dxDockControlXPView.obj dxDockControlOfficeView.obj dxDockZones.obj dxDockingC6.obj +RESFILES = dxDockingC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dxThemeC6.bpi cxLibraryVCLC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressDocking Library by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingC6.cpp b/official/x.35/ExpressDocking Library/Packages/dxDockingC6.cpp new file mode 100644 index 00000000..01d05505 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dxDockingC6.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +//--------------------------------------------------------------------------- +USERES("dxDockingC6.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEUNIT("dxDockPanel.pas"); +USEUNIT("dxDockControl.pas"); +USEUNIT("dxDockConsts.pas"); +USEUNIT("dxDockControlNETView.pas"); +USEUNIT("dxDockControlXPView.pas"); +USEUNIT("dxDockZones.pas"); +USEUNIT("dxDockControlOfficeView.pas"); +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingC6.res b/official/x.35/ExpressDocking Library/Packages/dxDockingC6.res new file mode 100644 index 00000000..b81f9441 Binary files /dev/null and b/official/x.35/ExpressDocking Library/Packages/dxDockingC6.res differ diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingD10.dpk b/official/x.35/ExpressDocking Library/Packages/dxDockingD10.dpk new file mode 100644 index 00000000..49bdea01 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dxDockingD10.dpk @@ -0,0 +1,41 @@ +package dxDockingD10; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressDocking Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + cxLibraryD10; + +contains + dxDockPanel, + dxDockControl, + dxDockConsts, + dxDockControlNETView, + dxDockControlXPView, + dxDockControlOfficeView, + dxDockZones; + +end. diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingD10.res b/official/x.35/ExpressDocking Library/Packages/dxDockingD10.res new file mode 100644 index 00000000..51a94c96 Binary files /dev/null and b/official/x.35/ExpressDocking Library/Packages/dxDockingD10.res differ diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingD11.dpk b/official/x.35/ExpressDocking Library/Packages/dxDockingD11.dpk new file mode 100644 index 00000000..4418af52 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dxDockingD11.dpk @@ -0,0 +1,41 @@ +package dxDockingD11; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressDocking Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + cxLibraryD11; + +contains + dxDockPanel, + dxDockControl, + dxDockConsts, + dxDockControlNETView, + dxDockControlXPView, + dxDockControlOfficeView, + dxDockZones; + +end. diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingD11.res b/official/x.35/ExpressDocking Library/Packages/dxDockingD11.res new file mode 100644 index 00000000..1956ec34 Binary files /dev/null and b/official/x.35/ExpressDocking Library/Packages/dxDockingD11.res differ diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingD5.dpk b/official/x.35/ExpressDocking Library/Packages/dxDockingD5.dpk new file mode 100644 index 00000000..d811186b --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dxDockingD5.dpk @@ -0,0 +1,42 @@ +package dxDockingD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressDocking Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + cxLibraryVCLD5; + +contains + dxDockPanel, + dxDockControl, + dxDockConsts, + dxDockControlNETView, + dxDockControlXPView, + dxDockControlOfficeView, + dxDockZones; + +end. diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingD5.res b/official/x.35/ExpressDocking Library/Packages/dxDockingD5.res new file mode 100644 index 00000000..e9c6af18 Binary files /dev/null and b/official/x.35/ExpressDocking Library/Packages/dxDockingD5.res differ diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingD6.dpk b/official/x.35/ExpressDocking Library/Packages/dxDockingD6.dpk new file mode 100644 index 00000000..a5d8bc2f --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dxDockingD6.dpk @@ -0,0 +1,41 @@ +package dxDockingD6; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressDocking Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + cxLibraryVCLD6; + +contains + dxDockPanel, + dxDockControl, + dxDockConsts, + dxDockControlNETView, + dxDockControlXPView, + dxDockControlOfficeView, + dxDockZones; + +end. diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingD6.res b/official/x.35/ExpressDocking Library/Packages/dxDockingD6.res new file mode 100644 index 00000000..57f4a212 Binary files /dev/null and b/official/x.35/ExpressDocking Library/Packages/dxDockingD6.res differ diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingD7.dpk b/official/x.35/ExpressDocking Library/Packages/dxDockingD7.dpk new file mode 100644 index 00000000..e13b3e77 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dxDockingD7.dpk @@ -0,0 +1,41 @@ +package dxDockingD7; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressDocking Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + cxLibraryVCLD7; + +contains + dxDockPanel, + dxDockControl, + dxDockConsts, + dxDockControlNETView, + dxDockControlXPView, + dxDockControlOfficeView, + dxDockZones; + +end. diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingD7.res b/official/x.35/ExpressDocking Library/Packages/dxDockingD7.res new file mode 100644 index 00000000..75cf10a9 Binary files /dev/null and b/official/x.35/ExpressDocking Library/Packages/dxDockingD7.res differ diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingD9.dpk b/official/x.35/ExpressDocking Library/Packages/dxDockingD9.dpk new file mode 100644 index 00000000..91e6bed3 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Packages/dxDockingD9.dpk @@ -0,0 +1,41 @@ +package dxDockingD9; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressDocking Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + cxLibraryD9; + +contains + dxDockPanel, + dxDockControl, + dxDockConsts, + dxDockControlNETView, + dxDockControlXPView, + dxDockControlOfficeView, + dxDockZones; + +end. diff --git a/official/x.35/ExpressDocking Library/Packages/dxDockingD9.res b/official/x.35/ExpressDocking Library/Packages/dxDockingD9.res new file mode 100644 index 00000000..f165bd67 Binary files /dev/null and b/official/x.35/ExpressDocking Library/Packages/dxDockingD9.res differ diff --git a/official/x.35/ExpressDocking Library/Sources/cxVer.inc b/official/x.35/ExpressDocking Library/Sources/cxVer.inc new file mode 100644 index 00000000..a26364cc --- /dev/null +++ b/official/x.35/ExpressDocking Library/Sources/cxVer.inc @@ -0,0 +1,172 @@ +{$B-} { Complete Boolean Evaluation } +{$R-} { Range-Checking } +{$T-} { Typed @ operator } +{$X+} { Extended syntax } +{$P+} { Open string params } +{$J+} { Writeable structured consts } +{$H+} { Use long strings by default } +{$Q-} { Overflow checking } + +{$DEFINE DXVER500} + +{$IFNDEF CLR} + {$DEFINE OLEDRAGANDDROP} + {$IFNDEF DONTUSEJPEGIMAGE} + {$DEFINE USEJPEGIMAGE} + {$ENDIF} +{$ENDIF} + +{$DEFINE EXPRESSBARS5} + +{$DEFINE VCL} + +{$IFNDEF VER80} + {$IFNDEF VER90} + {$IFNDEF VER93} + {$DEFINE DELPHI3} { Borland Delphi 3.0 } + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER110} { Borland C++Builder 3.0 } + {$DEFINE CBUILDER3} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE DELPHI4} +{$ENDIF} + +{$IFDEF VER125} { Borland C++Builder 4.0 } + {$DEFINE CBUILDER3} + {$DEFINE DELPHI4} + {$DEFINE CBUILDER4} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$IFDEF BCB} { Borland C++Builder 5.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$IFDEF BCB} { Borland C++Builder 6.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} +{$ENDIF} + +{$IFNDEF DELPHI6} + {$DEFINE MSWINDOWS} +{$ENDIF} +{$IFDEF LINUX} + {$UNDEF MSWINDOWS} +{$ENDIF} + +{$IFDEF LINUX} + {$DEFINE KYLIX1} { Borland Kylix 1 } + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF CompilerVersion >= 14} + {$DEFINE KYLIX2} { Borland Kylix 2 } + {$IFEND} + {$IF CompilerVersion >= 14.50} + {$DEFINE KYLIX3} { Borland Kylix 3 } + {$IFEND} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} { Borland Delphi.Net } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} +{$ENDIF} + +{$IFDEF VER170} { Borland Delphi 9.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} +{$ENDIF} + +{$IFDEF VER180} { Borland Delphi 10 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$IFDEF BCB} { Borland C++Builder 10 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Borland Delphi 11 //CodeGear} + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$DEFINE DELPHI11} + {$IFDEF BCB} { Borland C++Builder 11 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$DEFINE CBUILDER11} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFNDEF CLR} + {$IFNDEF BCB} + {$IFDEF DELPHI6} + {$DEFINE REGISTERSHELLCTRLS} + {$ENDIF} + {$ENDIF} + {$IFDEF DELPHI7} + {$WARN UNSAFE_CAST OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_TYPE OFF} + {$ENDIF} +{$ENDIF} + +{$IFDEF REGISTERSHELLCTRLS} + {$DEFINE REGISTERCXSHELLCTRLS} +{$ENDIF} + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} diff --git a/official/x.35/ExpressDocking Library/Sources/dxDockConsts.pas b/official/x.35/ExpressDocking Library/Sources/dxDockConsts.pas new file mode 100644 index 00000000..023fdd4d --- /dev/null +++ b/official/x.35/ExpressDocking Library/Sources/dxDockConsts.pas @@ -0,0 +1,75 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDocking } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDOCKING AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxDockConsts; + +{$I cxVer.inc} + +interface + +const + dxDefaultImageHeight = 16; + dxDefaultImageWidth = 16; + dxDockZonesWidth = 20; + dxResizeZonesWidth = 3; + dxSelectionFrameWidth = 4; + dxAutoHideInterval = 500; + dxAutoHideMovingInterval = 1; + dxAutoHideMovingSize = 20; + dxAutoShowInterval = 300; + dxTabsScrollInterval = 300; + +resourcestring + sdxInvalidLayoutSiteDeleting = 'You cannot delete a TdxLayoutDockSite.'; + sdxInvalidFloatSiteDeleting = 'You cannot delete a TdxFloatDockSite.'; + sdxInvalidFloatingDeleting = 'You cannot delete a TdxCustomDockSite in floating mode.'; + sdxInvalidParentAssigning = 'You cannot set the parent for this component.'; + sdxInvalidOwner = 'The Owner of the TdxCustomDockControl must be TCustomForm.'; + sdxInvalidParent = 'The Parent of the %s must be TdxCustomDockControl.'; + sdxInvalidDockSiteParent = 'The Parent of the TdxDockSite cannot be TdxCustomDockControl.'; + sdxInvalidFloatSiteParent = 'The Parent of the TdxFloatDockSite can only be TdxFloatForm.'; + sdxInvalidPanelChild = 'You cannot insert a TdxCustomDockControl into TdxDockPanel (%s is being inserted).'; + sdxInvalidSiteChild = 'You can only insert a TdxCustomDockControl into TdxCustomDockSite (%s is being inserted).'; + sdxInvaldZoneOwner = 'You cannot create a TdxZone without the owning TdxCustomDockControl.'; + sdxInternalErrorAutoHide = 'Internal error while autohide controls.'; + sdxInternalErrorPainter = 'Internal error in the TdxCustomDockControl painter.'; + sdxInternalErrorLayout = 'Internal error in the %s object layout.'; + sdxInternalErrorCreateLayout = 'Internal error while creating a %s object layout.'; + sdxInternalErrorDestroyLayout = 'Internal error while destroying a %s object layout.'; + sdxManagerError = 'You cannot have more than one TdxDockingManager instance on a Form.'; + sdxAncestorError = 'Docking and auto hiding operations are not available for controls declared in an ancestor form.'; + +implementation + +end. diff --git a/official/x.35/ExpressDocking Library/Sources/dxDockControl.pas b/official/x.35/ExpressDocking Library/Sources/dxDockControl.pas new file mode 100644 index 00000000..f872f614 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Sources/dxDockControl.pas @@ -0,0 +1,12485 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDocking } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDOCKING AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxDockControl; + +{$I cxVer.inc} + +interface + +uses + Windows, Graphics, Classes, Controls, ExtCtrls, Messages, + Forms, Menus, ImgList, IniFiles, dxDockConsts, + cxClasses, cxLookAndFeels, cxControls, cxGraphics; + +type + TdxDockingState = (dsDestroyed, dsUndocked, dsHidden, dsDocked, dsFloating); + TdxDockingTypeEx = (dtNone, dtClient, dtLeft, dtTop, dtRight, dtBottom); + TdxDockingType = dtClient..dtBottom; + TdxDockingTypes = set of TdxDockingType; + TdxZoneDirection = (zdUndefined, zdVertical, zdHorizontal); + TdxZoneKind = (zkDocking, zkResizing); + TdxAutoHidePosition = (ahpLeft, ahpTop, ahpRight, ahpBottom, ahpUndefined); + TdxCaptionButton = (cbMaximize, cbHide, cbClose); + TdxCaptionButtons = set of TdxCaptionButton; + TdxTabContainerTabsPosition = (tctpTop, tctpBottom); + + TdxDockingOption = + (doActivateAfterDocking, doDblClickDocking, doFloatingOnTop, doFreeOnClose, doUndockOnClose, + doTabContainerHasCaption, doTabContainerCanClose, doTabContainerCanAutoHide, + doSideContainerHasCaption, doSideContainerCanClose, doSideContainerCanAutoHide, + doTabContainerCanInSideContainer, doSideContainerCanInTabContainer, doSideContainerCanInSideContainer, + doImmediatelyHideOnAutoHide, doHideAutoHideIfActive, + doRedrawOnResize, doFillDockingSelection, doUseCaptionAreaToClientDocking); + TdxDockingOptions = set of TdxDockingOption; + TdxDockingViewStyle = (vsStandard, vsNET, vsOffice11, vsXP, vsUseLookAndFeel); + +const + WM_DESTROYCONTROLS = WM_DX + 1; + WM_HIDEFORM = WM_DX + 2; + WM_SHOWFORM = WM_DX + 3; + dxDockingDefaultDockingTypes = [dtClient, dtLeft, dtTop, dtRight, dtBottom]; + dxDockinkDefaultCaptionButtons = [cbMaximize, cbHide, cbClose]; + dxDockingDefaultOptions = + [doActivateAfterDocking, doDblClickDocking, doFloatingOnTop, doTabContainerCanAutoHide, + doTabContainerHasCaption, doSideContainerCanClose, doSideContainerCanAutoHide, + doTabContainerCanInSideContainer, doRedrawOnResize]; + +type + TdxDockingManager = class; + TdxDockingController = class; + TdxCustomDockControl = class; + TdxCustomDockControlClass = class of TdxCustomDockControl; + TdxDockControlPainter = class; + TdxDockControlPainterClass = class of TdxDockControlPainter; + TdxLayoutDockSite = class; + TdxContainerDockSite = class; + TdxContainerDockSiteClass = class of TdxContainerDockSite; + TdxTabContainerDockSite = class; + TdxSideContainerDockSite = class; + TdxSideContainerDockSiteClass = class of TdxSideContainerDockSite; + TdxFloatDockSite = class; + TdxFloatForm = class; + TdxDockSite = class; + TdxDockSiteAutoHideContainer = class; + + TdxDockingDragImage = class(TcxSizeFrame); + + TdxZone = class + private + FKind: TdxZoneKind; + FOwner: TdxCustomDockControl; + FWidth: Integer; + protected + function GetDirection: TdxZoneDirection; virtual; abstract; + function GetDockIndex: Integer; virtual; + function GetDockType: TdxDockingType; virtual; abstract; + function GetRectangle: TRect; virtual; abstract; + function GetSelectionFrameWidth: Integer; virtual; + function GetWidth: Integer; virtual; + + function CanConstrainedResize(NewWidth, NewHeight: Integer): Boolean; virtual; + public + constructor Create(AOwner: TdxCustomDockControl; AWidth: Integer; AKind: TdxZoneKind); + + function CanDock(AControl: TdxCustomDockControl): Boolean; virtual; + function CanResize(StartPoint, EndPoint: TPoint): Boolean; virtual; + function GetDockingSelection(AControl: TdxCustomDockControl): TRect; virtual; + function GetResizingSelection(pt: TPoint): TRect; virtual; + function IsZonePoint(pt: TPoint): Boolean; virtual; + + procedure DoDock(AControl: TdxCustomDockControl); virtual; + procedure DoResize(StartPoint, EndPoint: TPoint); virtual; + procedure DrawDockingSelection(DC: HDC; AControl: TdxCustomDockControl; pt: TPoint); virtual; + procedure DrawResizingSelection(DC: HDC; pt: TPoint); virtual; + procedure PrepareSelectionRegion(ARegion: TcxRegion; AControl: TdxCustomDockControl; const ARect: TRect); virtual; + + class function ValidateDockZone(AOwner, AControl: TdxCustomDockControl): Boolean; virtual; + class function ValidateResizeZone(AOwner, AControl: TdxCustomDockControl): Boolean; virtual; + + property Direction: TdxZoneDirection read GetDirection; + property DockType: TdxDockingType read GetDockType; + property DockIndex: Integer read GetDockIndex; + property Kind: TdxZoneKind read FKind; + property Owner: TdxCustomDockControl read FOwner; + property Rectangle: TRect read GetRectangle; + property SelectionFrameWidth: Integer read GetSelectionFrameWidth; + property Width: Integer read GetWidth; + end; + + TdxDockPosition = record + DockIndex: Integer; + DockType: TdxDockingType; + OriginalHeight: Integer; + OriginalWidth: Integer; + Parent: TdxCustomDockControl; + SiblingAfter: TdxCustomDockControl; + SiblingBefore: TdxCustomDockControl; + end; + + TdxActivateEvent = procedure (Sender: TdxCustomDockControl; Active: Boolean) of object; + TdxCanDockingEvent = procedure (Sender, Source: TdxCustomDockControl; Zone: TdxZone; + X, Y: Integer; var Accept: Boolean) of object; + TdxCanResizeEvent = procedure(Sender: TdxCustomDockControl; NewWidth, NewHeight: Integer; + var Resize: Boolean) of object; + TdxCreateFloatSiteEvent = procedure (Sender: TdxCustomDockControl; + AFloatSite: TdxFloatDockSite) of object; + TdxCreateLayoutSiteEvent = procedure (Sender: TdxCustomDockControl; + ALayoutSite: TdxLayoutDockSite) of object; + TdxCreateSideContainerEvent = procedure (Sender: TdxCustomDockControl; + ASideContainer: TdxSideContainerDockSite) of object; + TdxCreateTabContainerEvent = procedure (Sender: TdxCustomDockControl; + ATabContainer: TdxTabContainerDockSite) of object; + TdxCustomDrawSelectionEvent = procedure (Sender: TdxCustomDockControl; DC: HDC; + Zone: TdxZone; ARect: TRect; Erasing: Boolean; var Handled: Boolean) of object; + TdxDockControlCloseQueryEvent = procedure (Sender: TdxCustomDockControl; + var CanClose: Boolean) of object; + TdxDockControlNotifyEvent = procedure (Sender: TdxCustomDockControl) of object; + TdxDockEvent = procedure (Sender, Site: TdxCustomDockControl; ADockType: TdxDockingType; + AIndex: Integer) of object; + TdxDockingEvent = procedure (Sender: TdxCustomDockControl; Zone: TdxZone; + X, Y: Integer; var Accept: Boolean) of object; + TdxEndDockingEvent = procedure (Sender: TdxCustomDockControl; Zone: TdxZone; + X, Y: Integer) of object; + TdxGetAutoHidePositionEvent = procedure (Sender: TdxCustomDockControl; + var APosition: TdxAutoHidePosition) of object; + TdxDockPositionEvent = procedure (Sender: TdxCustomDockControl; + var APosition: TdxDockPosition) of object; + TdxUpdateZonesEvent = procedure (Sender: TdxCustomDockControl; AZones: TList) of object; + + TdxMakeFloatingEvent = procedure (Sender: TdxCustomDockControl; X, Y: Integer) of object; + TdxResizingEvent = procedure (Sender: TdxCustomDockControl; Zone: TdxZone; X, Y: Integer) of object; + TdxStartDockingEvent = procedure (Sender: TdxCustomDockControl; X, Y: Integer) of object; + TdxUnDockEvent = procedure (Sender, Site: TdxCustomDockControl) of object; + TdxDockControlInternalState = (dcisCreating, dcisDestroying, dcisDestroyed, dcisInternalResizing, dcisFrameChanged, dcisLayoutLoading); + TdxDockControlInternalStates = set of TdxDockControlInternalState; + + TdxCustomDockControl = class(TCustomControl) + private + FAllowDock: TdxDockingTypes; + FAllowDockClients: TdxDockingTypes; + FAllowFloating: Boolean; + FAutoHide: Boolean; + FAutoHidePosition: TdxAutoHidePosition; + FCaptionButtons: TdxCaptionButtons; + FCursorPoint: TPoint; + FDockable: Boolean; + FDockControls: TList; + FDockingOrigin: TPoint; + FDockingPoint: TPoint; + FDockingTargetZone: TdxZone; + FDockType: TdxDockingTypeEx; + FDockZones: TList; + FImageIndex: Integer; + FInternalState: TdxDockControlInternalStates; + FManagerColor: Boolean; + FManagerFont: Boolean; + FOriginalHeight: Integer; + FOriginalWidth: Integer; + FPainter: TdxDockControlPainter; + FParentDockControl: TdxCustomDockControl; + FRecalculateNCNeeded: Boolean; + FResizeZones: TList; + FResizingOrigin: TPoint; + FResizingPoint: TPoint; + FResizingSourceZone: TdxZone; + FSavedCaptureControl: TControl; + FShowCaption: Boolean; + FSourcePoint: TPoint; + FUpdateLayoutLock: Integer; + FUpdateVisibilityLock: Integer; + + FCaptionIsDown: Boolean; + FCloseButtonIsDown: Boolean; + FCloseButtonIsHot: Boolean; + FHideButtonIsDown: Boolean; + FHideButtonIsHot: Boolean; + FMaximizeButtonIsDown: Boolean; + FMaximizeButtonIsHot: Boolean; + FCaptionRect: TRect; + FCaptionSeparatorRect: TRect; + FCaptionTextRect: TRect; + FCaptionCloseButtonRect: TRect; + FCaptionHideButtonRect: TRect; + FCaptionMaximizeButtonRect: TRect; + FSavedClientRect: TRect; + FStoredAutoHide: Boolean; + FStoredPosition: TdxDockPosition; + FUseDoubleBuffer: Boolean; + FWindowRect: TRect; + + FOnActivate: TdxActivateEvent; + FOnAutoHideChanging: TdxDockControlNotifyEvent; + FOnAutoHideChanged: TdxDockControlNotifyEvent; + FOnCanResize: TdxCanResizeEvent; + FOnClose: TdxDockControlNotifyEvent; + FOnCloseQuery: TdxDockControlCloseQueryEvent; + FOnCanDocking: TdxCanDockingEvent; + FOnCreateFloatSite: TdxCreateFloatSiteEvent; + FOnCreateLayoutSite: TdxCreateLayoutSiteEvent; + FOnCreateSideContainer: TdxCreateSideContainerEvent; + FOnCreateTabContainer: TdxCreateTabContainerEvent; + FOnCustomDrawDockingSelection: TdxCustomDrawSelectionEvent; + FOnCustomDrawResizingSelection: TdxCustomDrawSelectionEvent; + FOnDock: TdxDockEvent; + FOnDocking: TdxDockingEvent; + FOnEndDocking: TdxEndDockingEvent; + FOnEndResizing: TdxResizingEvent; + FOnGetAutoHidePosition: TdxGetAutoHidePositionEvent; + FOnLayoutChanged: TdxDockControlNotifyEvent; + FOnMakeFloating: TdxMakeFloatingEvent; + FOnParentChanged: TdxDockControlNotifyEvent; + FOnParentChanging: TdxDockControlNotifyEvent; + FOnResizing: TdxResizingEvent; + FOnRestoreDockPosition: TdxDockPositionEvent; + FOnStartDocking: TdxStartDockingEvent; + FOnStartResizing: TdxResizingEvent; + FOnStoreDockPosition: TdxDockPositionEvent; + FOnUnDock: TdxUnDockEvent; + FOnUpdateDockZones: TdxUpdateZonesEvent; + FOnUpdateResizeZones: TdxUpdateZonesEvent; + FOnVisibleChanged: TdxDockControlNotifyEvent; + FOnVisibleChanging: TdxDockControlNotifyEvent; + + procedure ClearDockType; + procedure ClearChildrenParentDockControl; + function IsColorStored: Boolean; + function IsFontStored: Boolean; + function IsInternalDestroying: Boolean; + function GetActive: Boolean; + function GetController: TdxDockingController; + function GetDockIndex: Integer; + function GetDockLevel: Integer; + function GetDockingRect: TRect; + function GetDockState: TdxDockingState; + function GetChild(Index: Integer): TdxCustomDockControl; + function GetChildCount: Integer; + function GetImages: TCustomImageList; + function GetPainter: TdxDockControlPainter; + function GetPopupParent: TCustomForm; + function GetTempCanvas: TCanvas; + function GetValidChildCount: Integer; + function GetValidChild(Index: Integer): TdxCustomDockControl; + procedure SetAllowDock(const Value: TdxDockingTypes); + procedure SetAllowDockClients(const Value: TdxDockingTypes); + procedure SetAllowFloating(const Value: Boolean); + procedure SetAutoHide(const Value: Boolean); + procedure SetCaptionButtons(Value: TdxCaptionButtons); + procedure SetDockable(const Value: Boolean); + procedure SetDockType(Value: TdxDockingType); + procedure SetDockingParams(ADockingTargetZone: TdxZone; const ADockingPoint: TPoint); + procedure SetImageIndex(const Value: Integer); + procedure SetManagerColor(const Value: Boolean); + procedure SetManagerFont(const Value: Boolean); + procedure SetParentDockControl(Value: TdxCustomDockControl); + procedure SetShowCaption(const Value: Boolean); + procedure SetUseDoubleBuffer(const Value: Boolean); + + procedure ReadAutoHidePosition(Reader: TReader); + procedure ReadDockType(Reader: TReader); + procedure ReadOriginalWidth(Reader: TReader); + procedure ReadOriginalHeight(Reader: TReader); + procedure WriteAutoHidePosition(Writer: TWriter); + procedure WriteDockType(Writer: TWriter); + procedure WriteOriginalWidth(Writer: TWriter); + procedure WriteOriginalHeight(Writer: TWriter); + + procedure AddDockControl(AControl: TdxCustomDockControl; AIndex: Integer); + procedure RemoveDockControl(AControl: TdxCustomDockControl); + function IndexOfControl(AControl: TdxCustomDockControl): Integer; + procedure ClearZones(AZones: TList); + + procedure CMDesignHitTest(var Message: TCMDesignHitTest); message CM_DESIGNHITTEST; + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; + procedure CMColorChanged(var Message: TMessage); message CM_COLORCHANGED; + procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED; + procedure CMVisibleChanged(var Message: TMessage); message CM_VISIBLECHANGED; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure CNKeyDown(var Message: TWMKeyDown); message CN_KEYDOWN; + procedure CNKeyUp(var Message: TWMKeyUp); message CN_KEYUP; + {$IFDEF DELPHI5} + procedure WMContextMenu(var Message: TWMContextMenu); message WM_CONTEXTMENU; + {$ENDIF} + procedure WMEraseBkgnd(var Message: TWmEraseBkgnd); message WM_ERASEBKGND; + procedure WMMouseActivate(var Message: TWMMouseActivate); message WM_MOUSEACTIVATE; + procedure WMMove(var Message: TWMMove); message WM_MOVE; + procedure WMMouseMove(var Message: TWMMouseMove); message WM_MOUSEMOVE; + procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; + procedure WMRButtonDown(var Message: TWMRButtonDown); message WM_RBUTTONDOWN; + procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; + procedure WMLButtonDblClk(var Message: TWMLButtonDblClk); message WM_LBUTTONDBLCLK; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure WMSetCursor(var Message: TWMSetCursor); message WM_SETCURSOR; + procedure WMSize(var Message: TWMSize); message WM_SIZE; + protected + FDesignHelper: IcxDesignHelper; + + procedure AlignControls(AControl: TControl; var Rect: TRect); override; + procedure CreateHandle; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure DefineProperties(Filer: TFiler); override; + procedure DoEnter; override; + procedure Loaded; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure ReadState(Reader: TReader); override; + procedure SetParent(AParent: TWinControl); override; + procedure VisibleChanging; override; + + function CanFocusEx: Boolean; virtual; + function IsDockPanel: Boolean; virtual; + + function IsAncestor: Boolean; + function IsDesigning: Boolean; + function IsDestroying: Boolean; + function IsLoading: Boolean; + procedure CaptureMouse; + procedure ReleaseMouse; + // Designer + function IsSelected: Boolean; + procedure Modified; + procedure NoSelection; + procedure SelectComponent(AComponent: TComponent); + function UniqueName: string; + // Resizing + function CanResizing(NewWidth, NewHeight: Integer): Boolean; virtual; + function CanResizeAtPos(pt: TPoint): Boolean; virtual; + procedure DoStartResize(pt: TPoint); + procedure DoEndResize(pt: TPoint); + procedure DoResizing(pt: TPoint); + + procedure DrawResizingSelection(AZone: TdxZone; pt: TPoint; Erasing: Boolean); + procedure StartResize(pt: TPoint); virtual; + procedure Resizing(pt: TPoint); virtual; + procedure EndResize(pt: TPoint; Cancel: Boolean); virtual; + // Resizing zones + procedure DoUpdateResizeZones; + procedure UpdateControlResizeZones(AControl: TdxCustomDockControl); virtual; + procedure UpdateResizeZones; + // Docking + function CanUndock(AControl: TdxCustomDockControl): Boolean; virtual; + function GetDockingTargetControlAtPos(pt: TPoint): TdxCustomDockControl; + function GetFloatDockRect(pt: TPoint): TRect; + procedure DoStartDocking(pt: TPoint); + procedure DoEndDocking(pt: TPoint); + procedure DoCanDocking(Source: TdxCustomDockControl; pt: TPoint; TargetZone: TdxZone; var Accept: Boolean); + procedure DoDocking(pt: TPoint; TargetZone: TdxZone; var Accept: Boolean); + + procedure DrawDockingSelection(AZone: TdxZone; const pt: TPoint; AErasing: Boolean); + procedure PrepareSelectionRegion(ARegion: TcxRegion; const ARect: TRect); + procedure StartDocking(pt: TPoint); virtual; + procedure Docking(pt: TPoint); virtual; + procedure EndDocking(pt: TPoint; Cancel: Boolean); virtual; + procedure CheckDockRules; virtual; + procedure CheckDockClientsRules; virtual; + // Docking zones + procedure DoUpdateDockZones; + procedure UpdateControlDockZones(AControl: TdxCustomDockControl; AZoneWidth: Integer); virtual; + procedure UpdateDockZones; + // Control layout + procedure DoParentChanged; + procedure DoParentChanging; + procedure UpdateState; virtual; + + procedure IncludeToDock(AControl: TdxCustomDockControl; AType: TdxDockingType; + Index: Integer); virtual; + procedure ExcludeFromDock; virtual; + procedure CreateLayout(AControl: TdxCustomDockControl; AType: TdxDockingType; + Index: Integer); virtual; + procedure DestroyChildLayout; virtual; + procedure DestroyLayout(AControl: TdxCustomDockControl); virtual; + procedure RemoveFromLayout; virtual; + procedure UpdateLayout; virtual; + procedure DoLayoutChanged; + procedure BeginUpdateLayout; + procedure EndUpdateLayout(AForceUpdate: Boolean = True); + function IsUpdateLayoutLocked: Boolean; + procedure LoadLayoutFromCustomIni(AIniFile: TCustomIniFile; AParentForm: TCustomForm; + AParentControl: TdxCustomDockControl; ASection: string); virtual; + procedure SaveLayoutToCustomIni(AIniFile: TCustomIniFile; ASection: string); virtual; + property UpdateLayoutLock: Integer read FUpdateLayoutLock; + + function HasAsParent(AControl: TdxCustomDockControl): Boolean; + function GetParentDockControl: TdxCustomDockControl; virtual; + function GetParentForm: TCustomForm; virtual; + function GetParentFormActive: Boolean; virtual; + function GetParentFormVisible: Boolean; virtual; + function GetTopMostDockControl: TdxCustomDockControl; virtual; + // Layout site + procedure AssignLayoutSiteProperties(ASite: TdxLayoutDockSite); virtual; + procedure DoCreateLayoutSite(ASite: TdxLayoutDockSite); + function GetLayoutDockSite: TdxLayoutDockSite; virtual; + // Container site + procedure CreateContainerLayout(AContainer: TdxContainerDockSite; + AControl: TdxCustomDockControl; AType: TdxDockingType; Index: Integer); + function GetContainer: TdxContainerDockSite; virtual; + // SideContainer site + procedure AssignSideContainerSiteProperties(ASite: TdxSideContainerDockSite); virtual; + function CanAcceptSideContainerItems(AContainer: TdxSideContainerDockSite): Boolean; virtual; + procedure DoCreateSideContainerSite(ASite: TdxSideContainerDockSite); + procedure CreateSideContainerLayout(AControl: TdxCustomDockControl; + AType: TdxDockingType; Index: Integer); virtual; + procedure DoMaximize; virtual; + function GetSideContainer: TdxSideContainerDockSite; virtual; + function GetSideContainerItem: TdxCustomDockControl; virtual; + function GetSideContainerIndex: Integer; virtual; + function GetMinimizedHeight: Integer; virtual; + function GetMinimizedWidth: Integer; virtual; + // TabContainer site + procedure AssignTabContainerSiteProperies(ASite: TdxTabContainerDockSite); virtual; + function CanAcceptTabContainerItems(AContainer: TdxTabContainerDockSite): Boolean; virtual; + procedure DoCreateTabContainerSite(ASite: TdxTabContainerDockSite); + procedure CreateTabContainerLayout(AControl: TdxCustomDockControl; + AType: TdxDockingType; Index: Integer); virtual; + function GetTabWidth(ACanvas: TCanvas): Integer; + function GetTabContainer: TdxTabContainerDockSite; virtual; + // AutoHide + procedure AutoHideChanged; virtual; + procedure DoAutoHideChanged; + procedure DoAutoHideChanging; + function GetControlAutoHidePosition(AControl: TdxCustomDockControl): TdxAutoHidePosition; virtual; + function GetAutoHideHostSite: TdxDockSite; virtual; + function GetAutoHideContainer: TdxDockSiteAutoHideContainer; virtual; + function GetAutoHideControl: TdxCustomDockControl; virtual; + function GetAutoHidePosition: TdxAutoHidePosition; + procedure ChangeAutoHide; virtual; + // AutoSize + function GetAutoSizeHostSite: TdxDockSite; virtual; + // Floating site + procedure AssignFloatSiteProperties(ASite: TdxFloatDockSite); virtual; + procedure DoCreateFloatSite(ASite: TdxFloatDockSite); + function GetFloatDockSite: TdxFloatDockSite; virtual; + function GetFloatForm: TdxFloatForm; virtual; + function GetFloatFormActive: Boolean; virtual; + function GetFloatFormVisible: Boolean; virtual; + procedure StoreDockPosition(pt: TPoint); virtual; + procedure RestoreDockPosition(pt: TPoint); virtual; + // Caption + procedure UpdateCaption; virtual; + // Control bounds + procedure AdjustControlBounds(AControl: TdxCustomDockControl); virtual; + procedure SetSize(AWidth, AHeight: Integer); + procedure UpdateControlOriginalSize(AControl: TdxCustomDockControl); virtual; + procedure UpdateOriginalSize; + // Activation + procedure CheckActiveDockControl; virtual; + procedure DoActiveChanged(AActive, ACallEvent: Boolean); virtual; + // Closing + procedure DoClose; virtual; + // Destroying + function CanDestroy: Boolean; virtual; + procedure DoDestroy; virtual; + // Control visibility + procedure ChildVisibilityChanged(Sender: TdxCustomDockControl); virtual; + procedure DoVisibleChanged; virtual; + procedure DoVisibleChanging; + procedure BeginUpdateVisibility; + procedure EndUpdateVisibility; + procedure SetVisibility(Value: Boolean); + procedure UpdateAutoHideControlsVisibility; virtual; + procedure UpdateAutoHideHostSiteVisibility; virtual; + procedure UpdateLayoutControlsVisibility; virtual; + procedure UpdateParentControlsVisibility; virtual; + procedure UpdateRelatedControlsVisibility; virtual; + property UpdateVisibilityLock: Integer read FUpdateVisibilityLock; + // Controller properties + function ControllerAutoHideInterval: Integer; + function ControllerAutoHideMovingInterval: Integer; + function ControllerAutoHideMovingSize: Integer; + function ControllerAutoShowInterval: Integer; + function ControllerColor: TColor; + function ControllerDockZonesWidth: Integer; + function ControllerFont: TFont; + function ControllerImages: TCustomImageList; + function ControllerOptions: TdxDockingOptions; + function ControllerViewStyle: TdxDockingViewStyle; + function ControllerResizeZonesWidth: Integer; + function ControllerSelectionFrameWidth: Integer; + function ControllerTabsScrollInterval: Integer; + + // Painting + procedure CheckTempCanvas(ARect: TRect); + function ClientToWindow(pt: TPoint): TPoint; + function ScreenToWindow(pt: TPoint): TPoint; + function WindowRectToClient(const R: TRect): TRect; + function WindowToClient(pt: TPoint): TPoint; + function WindowToScreen(pt: TPoint): TPoint; + procedure CalculateNC(var ARect: TRect); virtual; + procedure InvalidateCaptionArea; virtual; + procedure InvalidateNC(ANeedRecalculate: Boolean); + procedure NCChanged(AImmediately: Boolean = False); + procedure Recalculate; virtual; + procedure Redraw(AWithChildren: Boolean); + procedure BeginUpdateNC(ALockRedraw: Boolean = True); + procedure EndUpdateNC; + function CanUpdateNC: Boolean; + function CanCalculateNC: Boolean; + function HasBorder: Boolean; virtual; + function HasCaption: Boolean; virtual; + function HasCaptionCloseButton: Boolean; virtual; + function HasCaptionHideButton: Boolean; virtual; + function HasCaptionMaximizeButton: Boolean; virtual; + function HasTabs: Boolean; virtual; + function IsCaptionActive: Boolean; virtual; + function IsCaptionVertical: Boolean; virtual; + function IsCaptionPoint(pt: TPoint): Boolean; + function IsCaptionCloseButtonPoint(pt: TPoint): Boolean; + function IsCaptionHideButtonPoint(pt: TPoint): Boolean; + function IsCaptionMaximizeButtonPoint(pt: TPoint): Boolean; + procedure NCPaint(ACanvas: TCanvas); virtual; + procedure NCPaintCaption(ACanvas: TCanvas); virtual; + property Painter: TdxDockControlPainter read GetPainter; + // Rectangles + property CaptionRect: TRect read FCaptionRect; + property CaptionSeparatorRect: TRect read FCaptionSeparatorRect; + property CaptionTextRect: TRect read FCaptionTextRect; + property CaptionCloseButtonRect: TRect read FCaptionCloseButtonRect; + property CaptionHideButtonRect: TRect read FCaptionHideButtonRect; + property CaptionMaximizeButtonRect: TRect read FCaptionMaximizeButtonRect; + property WindowRect: TRect read FWindowRect; + + property CaptionIsDown: Boolean read FCaptionIsDown; + property CloseButtonIsDown: Boolean read FCloseButtonIsDown; + property CloseButtonIsHot: Boolean read FCloseButtonIsHot; + property HideButtonIsDown: Boolean read FHideButtonIsDown; + property HideButtonIsHot: Boolean read FHideButtonIsHot; + property MaximizeButtonIsDown: Boolean read FMaximizeButtonIsDown; + property MaximizeButtonIsHot: Boolean read FMaximizeButtonIsHot; + + property CursorPoint: TPoint read FCursorPoint write FCursorPoint; + property DockingOrigin: TPoint read FDockingOrigin; + property DockingPoint: TPoint read FDockingPoint; + property DockingRect: TRect read GetDockingRect; + property DockingTargetZone: TdxZone read FDockingTargetZone; + property ResizingOrigin: TPoint read FResizingOrigin; + property ResizingPoint: TPoint read FResizingPoint; + property ResizingSourceZone: TdxZone read FResizingSourceZone; + property SourcePoint: TPoint read FSourcePoint write FSourcePoint; + + property StoredAutoHide: Boolean read FStoredAutoHide; + property StoredPosition: TdxDockPosition read FStoredPosition; + + property TempCanvas: TCanvas read GetTempCanvas; + property PopupParent: TCustomForm read GetPopupParent; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure BeforeDestruction; override; + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; + + procedure Activate; virtual; + function CanActive: Boolean; virtual; + function CanAutoHide: Boolean; virtual; + function CanDock: Boolean; virtual; + function CanDockHost(AControl: TdxCustomDockControl; AType: TdxDockingType): Boolean; virtual; + function CanMaximize: Boolean; virtual; + function GetDockZoneAtPos(AControl: TdxCustomDockControl; pt: TPoint): TdxZone; virtual; + function GetResizeZoneAtPos(pt: TPoint): TdxZone; virtual; + function IsNeeded: Boolean; virtual; + function IsValidChild(AControl: TdxCustomDockControl): Boolean; virtual; + + procedure Close; + procedure MakeFloating; overload; virtual; + procedure MakeFloating(XPos, YPos: Integer); {$IFNDEF CBUILDER6} reintroduce; overload; {$ELSE} overload; virtual;{$ENDIF} + procedure DockTo(AControl: TdxCustomDockControl; AType: TdxDockingType; AIndex: Integer); + procedure UnDock; + + property Active: Boolean read GetActive; + property AllowDock: TdxDockingTypes read FAllowDock write SetAllowDock default dxDockingDefaultDockingTypes; + property AllowDockClients: TdxDockingTypes read FAllowDockClients write SetAllowDockClients default dxDockingDefaultDockingTypes; + property AllowFloating: Boolean read FAllowFloating write SetAllowFloating; + property AutoHide: Boolean read FAutoHide write SetAutoHide; + property AutoHideHostSite: TdxDockSite read GetAutoHideHostSite; + property AutoHideContainer: TdxDockSiteAutoHideContainer read GetAutoHideContainer; + property AutoHideControl: TdxCustomDockControl read GetAutoHideControl; + property AutoHidePosition: TdxAutoHidePosition read FAutoHidePosition; + property AutoSizeHostSite: TdxDockSite read GetAutoSizeHostSite; + property Caption; + property CaptionButtons: TdxCaptionButtons read FCaptionButtons write SetCaptionButtons default dxDockinkDefaultCaptionButtons; + property ChildCount: Integer read GetChildCount; + property Children[Index: Integer]: TdxCustomDockControl read GetChild; + property Container: TdxContainerDockSite read GetContainer; + property Controller: TdxDockingController read GetController; + property Dockable: Boolean read FDockable write SetDockable default True; + property DockIndex: Integer read GetDockIndex; + property DockLevel: Integer read GetDockLevel; + property DockState: TdxDockingState read GetDockState; + property DockType: TdxDockingTypeEx read FDockType; + property DockZones: TList read FDockZones; + property FloatForm: TdxFloatForm read GetFloatForm; + property FloatFormActive: Boolean read GetFloatFormActive; + property FloatFormVisible: Boolean read GetFloatFormVisible; + property FloatDockSite: TdxFloatDockSite read GetFloatDockSite; + property ImageIndex: Integer read FImageIndex write SetImageIndex default -1; + property Images: TCustomImageList read GetImages; + property LayoutDockSite: TdxLayoutDockSite read GetLayoutDockSite; + property OriginalHeight: Integer read FOriginalHeight; + property OriginalWidth: Integer read FOriginalWidth; + property ParentDockControl: TdxCustomDockControl read GetParentDockControl; + property ParentForm: TCustomForm read GetParentForm; + property ParentFormActive: Boolean read GetParentFormActive; + property ParentFormVisible: Boolean read GetParentFormVisible; + property ResizeZones: TList read FResizeZones write FResizeZones; + property ShowCaption: Boolean read FShowCaption write SetShowCaption default True; + property SideContainer: TdxSideContainerDockSite read GetSideContainer; + property SideContainerItem: TdxCustomDockControl read GetSideContainerItem; + property SideContainerIndex: Integer read GetSideContainerIndex; + property TabContainer: TdxTabContainerDockSite read GetTabContainer; + property TopMostDockControl: TdxCustomDockControl read GetTopMostDockControl; + property UseDoubleBuffer: Boolean read FUseDoubleBuffer write SetUseDoubleBuffer; + property ValidChildCount: Integer read GetValidChildCount; + property ValidChildren[Index: Integer]: TdxCustomDockControl read GetValidChild; + + property OnActivate: TdxActivateEvent read FOnActivate write FOnActivate; + property OnAutoHideChanged: TdxDockControlNotifyEvent read FOnAutoHideChanged + write FOnAutoHideChanged; + property OnAutoHideChanging: TdxDockControlNotifyEvent read FOnAutoHideChanging + write FOnAutoHideChanging; + property OnCanDocking: TdxCanDockingEvent read FOnCanDocking write FOnCanDocking; + property OnCanResize: TdxCanResizeEvent read FOnCanResize write FOnCanResize; + property OnClose: TdxDockControlNotifyEvent read FOnClose write FOnClose; + property OnCloseQuery: TdxDockControlCloseQueryEvent read FOnCloseQuery write FOnCloseQuery; + property OnCreateFloatSite: TdxCreateFloatSiteEvent read FOnCreateFloatSite + write FOnCreateFloatSite; + property OnCreateLayoutSite: TdxCreateLayoutSiteEvent read FOnCreateLayoutSite + write FOnCreateLayoutSite; + property OnCreateSideContainer: TdxCreateSideContainerEvent read FOnCreateSideContainer + write FOnCreateSideContainer; + property OnCreateTabContainer: TdxCreateTabContainerEvent read FOnCreateTabContainer + write FOnCreateTabContainer; + property OnCustomDrawDockingSelection: TdxCustomDrawSelectionEvent read FOnCustomDrawDockingSelection + write FOnCustomDrawDockingSelection; + property OnCustomDrawResizingSelection: TdxCustomDrawSelectionEvent read FOnCustomDrawResizingSelection + write FOnCustomDrawResizingSelection; + property OnDock: TdxDockEvent read FOnDock write FOnDock; + property OnDocking: TdxDockingEvent read FOnDocking write FOnDocking; + property OnEndDocking: TdxEndDockingEvent read FOnEndDocking write FOnEndDocking; + property OnEndResizing: TdxResizingEvent read FOnEndResizing write FOnEndResizing; + property OnGetAutoHidePosition: TdxGetAutoHidePositionEvent read FOnGetAutoHidePosition + write FOnGetAutoHidePosition; + property OnLayoutChanged: TdxDockControlNotifyEvent read FOnLayoutChanged + write FOnLayoutChanged; + property OnMakeFloating: TdxMakeFloatingEvent read FOnMakeFloating write FOnMakeFloating; + property OnResize; + property OnResizing: TdxResizingEvent read FOnResizing write FOnResizing; + property OnRestoreDockPosition: TdxDockPositionEvent read FOnRestoreDockPosition + write FOnRestoreDockPosition; + property OnStartDocking: TdxStartDockingEvent read FOnStartDocking write FOnStartDocking; + property OnStartResizing: TdxResizingEvent read FOnStartResizing write FOnStartResizing; + property OnStoreDockPosition: TdxDockPositionEvent read FOnStoreDockPosition + write FOnStoreDockPosition; + property OnUnDock: TdxUnDockEvent read FOnUnDock write FOnUnDock; + property OnUpdateDockZones: TdxUpdateZonesEvent read FOnUpdateDockZones + write FOnUpdateDockZones; + property OnUpdateResizeZones: TdxUpdateZonesEvent read FOnUpdateResizeZones + write FOnUpdateResizeZones; + published + property Color stored IsColorStored; + property Font stored IsFontStored; + property ManagerColor: Boolean read FManagerColor write SetManagerColor default True; + property ManagerFont: Boolean read FManagerFont write SetManagerFont default True; + property ParentColor default False; + property ParentFont default False; + property ParentShowHint; + property PopupMenu; + property ShowHint; + property Visible; + + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnParentChanged: TdxDockControlNotifyEvent read FOnParentChanged write FOnParentChanged; + property OnParentChanging: TdxDockControlNotifyEvent read FOnParentChanging write FOnParentChanging; + property OnVisibleChanged: TdxDockControlNotifyEvent read FOnVisibleChanged write FOnVisibleChanged; + property OnVisibleChanging: TdxDockControlNotifyEvent read FOnVisibleChanging write FOnVisibleChanging; + end; + + TdxCustomDockSite = class(TdxCustomDockControl) + protected + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + procedure ValidateInsert(AComponent: TComponent); override; + published + property AllowDockClients; + property OnCanDocking; + property OnLayoutChanged; + property OnUpdateDockZones; + property OnUpdateResizeZones; + end; + + TdxLayoutDockSite = class(TdxCustomDockSite) + private + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + protected + procedure SetParent(AParent: TWinControl); override; + // Docking zones + procedure UpdateControlDockZones(AControl: TdxCustomDockControl; AZoneWidth: Integer); override; + // Site layout + procedure CreateLayout(AControl: TdxCustomDockControl; AType: TdxDockingType; + Index: Integer); override; + procedure DestroyLayout(AControl: TdxCustomDockControl); override; + // Sibling control + function GetSiblingDockControl: TdxCustomDockControl; virtual; + // Destroying + function CanDestroy: Boolean; override; + public + constructor Create(AOwner: TComponent); override; + procedure BeforeDestruction; override; + function CanDockHost(AControl: TdxCustomDockControl; AType: TdxDockingType): Boolean; override; + + property SiblingDockControl: TdxCustomDockControl read GetSiblingDockControl; + published + property OnCreateLayoutSite; + end; + + TdxActiveChildChangeEvent = procedure (Sender: TdxContainerDockSite; Child: TdxCustomDockControl) of object; + + TdxContainerDockSite = class(TdxCustomDockSite) + private + FActiveChild: TdxCustomDockControl; + FActiveChildIndex: Integer; + FOnActiveChildChanged: TdxActiveChildChangeEvent; + + function GetActiveChildIndex: Integer; + procedure SetActiveChildByIndex(AIndex: Integer); + procedure SetActiveChild(Value: TdxCustomDockControl); + procedure SetActiveChildIndex(Value: Integer); + protected + procedure Loaded; override; + procedure SetParent(AParent: TWinControl); override; + // Site layout + procedure CreateLayout(AControl: TdxCustomDockControl; AType: TdxDockingType; + Index: Integer); override; + procedure DestroyChildLayout; override; + procedure DestroyLayout(AControl: TdxCustomDockControl); override; + procedure UpdateLayout; override; + procedure LoadLayoutFromCustomIni(AIniFile: TCustomIniFile; AParentForm: TCustomForm; + AParentControl: TdxCustomDockControl; ASection: string); override; + procedure SaveLayoutToCustomIni(AIniFile: TCustomIniFile; ASection: string); override; + // AutoHide + function GetControlAutoHidePosition(AControl: TdxCustomDockControl): TdxAutoHidePosition; override; + // Control visibility + procedure ChildVisibilityChanged(Sender: TdxCustomDockControl); override; + // Children layout + procedure BeginAdjustBounds; virtual; + procedure EndAdjustBounds; virtual; + procedure DoActiveChildChanged; virtual; + class function GetHeadDockType: TdxDockingType; virtual; + class function GetTailDockType: TdxDockingType; virtual; + function GetFirstValidChild: TdxCustomDockControl; + function GetFirstValidChildIndex: Integer; + function GetLastValidChild: TdxCustomDockControl; + function GetLastValidChildIndex: Integer; + function GetNextValidChild(AIndex: Integer): TdxCustomDockControl; + function GetNextValidChildIndex(AIndex: Integer): Integer; + function GetPrevValidChild(AIndex: Integer): TdxCustomDockControl; + function GetPrevValidChildIndex(AIndex: Integer): Integer; + function IsValidActiveChild(AControl: TdxCustomDockControl): Boolean; virtual; + procedure ValidateActiveChild(AIndex: Integer); virtual; + public + constructor Create(AOwner: TComponent); override; + + function CanContainerDockHost(AType: TdxDockingType): Boolean; virtual; + function CanDock: Boolean; override; + function CanDockHost(AControl: TdxCustomDockControl; AType: TdxDockingType): Boolean; override; + + property ActiveChild: TdxCustomDockControl read FActiveChild write SetActiveChild; + published + property ActiveChildIndex: Integer read GetActiveChildIndex write SetActiveChildIndex; + property AllowDock; + property AllowFloating; + + property OnActiveChildChanged: TdxActiveChildChangeEvent read FOnActiveChildChanged write FOnActiveChildChanged; + property OnCanResize; + property OnCreateFloatSite; + property OnCustomDrawDockingSelection; + property OnCustomDrawResizingSelection; + property OnEndResizing; + property OnResize; + property OnResizing; + property OnRestoreDockPosition; + property OnStartResizing; + property OnStoreDockPosition; + end; + + TdxTabContainerDockSite = class(TdxContainerDockSite) + private + FFirstVisibleTabIndex: Integer; + FPressedTabIndex: Integer; + FTabsPosition: TdxTabContainerTabsPosition; + FTabsRect: TRect; + FTabsRects: array of TRect; + FTabsNextTabButtonRect: TRect; + FTabsPrevTabButtonRect: TRect; + FTabsScroll: Boolean; + FTabsScrollTimerID: Integer; + + FTabsNextTabButtonIsDown: Boolean; + FTabsNextTabButtonIsEnabled: Boolean; + FTabsNextTabButtonIsHot: Boolean; + FTabsPrevTabButtonIsDown: Boolean; + FTabsPrevTabButtonIsEnabled: Boolean; + FTabsPrevTabButtonIsHot: Boolean; + + function GetLastVisibleTabIndex: Integer; + function GetTabRectCount: Integer; + function GetTabRect(Index: Integer): TRect; + function GetTabsButtonsVisible: Boolean; + procedure SetTabsPosition(const Value: TdxTabContainerTabsPosition); + procedure SetTabsScroll(const Value: Boolean); + + function DecFirstVisibleTabIndex: Boolean; + function IncFirstVisibleTabIndex: Boolean; + procedure UpdateButtonsState; + + procedure CMDesignHitTest(var Message: TCMDesignHitTest); message CM_DESIGNHITTEST; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; + procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; + procedure WMLButtonDblClk(var Message: TWMLButtonDblClk); message WM_LBUTTONDBLCLK; + procedure WMMouseMove(var Message: TWMMouseMove); message WM_MOUSEMOVE; + protected + // Resizing + function CanResizeAtPos(pt: TPoint): Boolean; override; + // Docking zones + procedure UpdateControlDockZones(AControl: TdxCustomDockControl; AZoneWidth: Integer); override; + // Site layout + procedure IncludeToDock(AControl: TdxCustomDockControl; AType: TdxDockingType; + Index: Integer); override; + procedure CreateLayout(AControl: TdxCustomDockControl; AType: TdxDockingType; + Index: Integer); override; + procedure DestroyLayout(AControl: TdxCustomDockControl); override; + procedure UpdateLayout; override; + procedure LoadLayoutFromCustomIni(AIniFile: TCustomIniFile; AParentForm: TCustomForm; + AParentControl: TdxCustomDockControl; ASection: string); override; + procedure SaveLayoutToCustomIni(AIniFile: TCustomIniFile; ASection: string); override; + // SideContainer site + function CanAcceptSideContainerItems(AContainer: TdxSideContainerDockSite): Boolean; override; + // TabContainer site + function CanAcceptTabContainerItems(AContainer: TdxTabContainerDockSite): Boolean; override; + // AutoHide + procedure ChangeAutoHide; override; + // Caption + procedure UpdateCaption; override; + // Closing + procedure DoClose; override; + // Control visibility + procedure ChildVisibilityChanged(Sender: TdxCustomDockControl); override; + // Children layout + procedure DoActiveChildChanged; override; + procedure UpdateActiveTab; + procedure UpdateChildrenState; + procedure ValidateActiveChild(AIndex: Integer); override; + procedure ValidateFirstVisibleIndex; + // Painting + procedure CalculateNC(var ARect: TRect); override; + procedure NCPaint(ACanvas: TCanvas); override; + function GetTabIndexAtPos(pt: TPoint): Integer; + function GetTabWidth(AControl: TdxCustomDockControl): Integer; + function HasBorder: Boolean; override; + function HasCaption: Boolean; override; + function HasTabs: Boolean; override; + function IsCaptionActive: Boolean; override; + function IsTabsPoint(pt: TPoint): Boolean; + function IsTabsNextTabButtonPoint(pt: TPoint): Boolean; + function IsTabsPrevTabButtonPoint(pt: TPoint): Boolean; + // Rectangles + property TabsNextTabButtonRect: TRect read FTabsNextTabButtonRect; + property TabsPrevTabButtonRect: TRect read FTabsPrevTabButtonRect; + property TabsRect: TRect read FTabsRect; + property TabRectCount: Integer read GetTabRectCount; + property TabsRects[Index: Integer]: TRect read GetTabRect; + // Tabs scrolling + procedure DoIncrementTabsScroll; + procedure DoDecrementTabsScroll; + procedure InitIncrementTabsScroll; + procedure InitDecrementTabsScroll; + property FirstVisibleTabIndex: Integer read FFirstVisibleTabIndex; + property LastVisibleTabIndex: Integer read GetLastVisibleTabIndex; + + property TabsButtonsVisible: Boolean read GetTabsButtonsVisible; + property TabsNextTabButtonIsDown: Boolean read FTabsNextTabButtonIsDown; + property TabsNextTabButtonIsEnabled: Boolean read FTabsNextTabButtonIsEnabled; + property TabsNextTabButtonIsHot: Boolean read FTabsNextTabButtonIsHot; + property TabsPrevTabButtonIsDown: Boolean read FTabsPrevTabButtonIsDown; + property TabsPrevTabButtonIsEnabled: Boolean read FTabsPrevTabButtonIsEnabled; + property TabsPrevTabButtonIsHot: Boolean read FTabsPrevTabButtonIsHot; + public + constructor Create(AOwner: TComponent); override; + procedure Assign(Source: TPersistent); override; + + function CanActive: Boolean; override; + function CanAutoHide: Boolean; override; + function CanDockHost(AControl: TdxCustomDockControl; AType: TdxDockingType): Boolean; override; + function CanMaximize: Boolean; override; + + procedure ActivateNextChild(AGoForward: Boolean; AGoOnCycle: Boolean = True); + published + property AutoHide; + property CaptionButtons; + property Dockable; + property ImageIndex; + property ShowCaption; + property TabsPosition: TdxTabContainerTabsPosition read FTabsPosition write SetTabsPosition default tctpBottom; + property TabsScroll: Boolean read FTabsScroll write SetTabsScroll default True; + + property OnActivate; + property OnAutoHideChanged; + property OnAutoHideChanging; + property OnClose; + property OnCloseQuery; + property OnCreateSideContainer; + property OnDock; + property OnDocking; + property OnEndDocking; + property OnGetAutoHidePosition; + property OnMakeFloating; + property OnStartDocking; + property OnUnDock; + end; + + TdxSideContainerDockSite = class(TdxContainerDockSite) + private + FAdjustBoundsLock: Integer; + protected + // Docking zones + procedure UpdateControlDockZones(AControl: TdxCustomDockControl; AZoneWidth: Integer); override; + // Site layout + procedure IncludeToDock(AControl: TdxCustomDockControl; AType: TdxDockingType; + Index: Integer); override; + procedure CreateLayout(AControl: TdxCustomDockControl; AType: TdxDockingType; + Index: Integer); override; + procedure UpdateLayout; override; + procedure LoadLayoutFromCustomIni(AIniFile: TCustomIniFile; AParentForm: TCustomForm; + AParentControl: TdxCustomDockControl; ASection: string); override; + // SideContainer site + function CanAcceptSideContainerItems(AContainer: TdxSideContainerDockSite): Boolean; override; + // TabContainer + function CanAcceptTabContainerItems(AContainer: TdxTabContainerDockSite): Boolean; override; + // Caption + procedure UpdateCaption; override; + // AutoHide + procedure ChangeAutoHide; override; + // Closing + procedure DoClose; override; + // Control visibility + procedure ChildVisibilityChanged(Sender: TdxCustomDockControl); override; + // Children layout + procedure DoActiveChildChanged; override; + function CanChildResize(AControl: TdxCustomDockControl; ADeltaSize: Integer): Boolean; + procedure DoChildResize(AControl: TdxCustomDockControl; ADeltaSize: Integer; AResizeNextControl: Boolean = True); + procedure BeginAdjustBounds; override; + procedure EndAdjustBounds; override; + function IsAdjustBoundsLocked: Boolean; + property AdjustBoundsLock: Integer read FAdjustBoundsLock; + procedure AdjustChildrenBounds(AControl: TdxCustomDockControl); + procedure NormalizeChildrenBounds(ADeltaSize: Integer); + procedure SetChildBounds(AControl: TdxCustomDockControl; var AWidth, AHeight: Integer); + function IsValidActiveChild(AControl: TdxCustomDockControl): Boolean; override; + procedure ValidateActiveChild(AIndex: Integer); override; + + function GetDifferentSize: Integer; + function GetContainerSize: Integer; virtual; abstract; + function GetDimension(AWidth, AHeight: Integer): Integer; virtual; abstract; + function GetMinSize(Index: Integer): Integer; virtual; abstract; + function GetOriginalSize(Index: Integer): Integer; virtual; abstract; + function GetSize(Index: Integer): Integer; virtual; abstract; + function GetPosition(Index: Integer): Integer; virtual; abstract; + procedure SetDimension(var AWidth, AHeight: Integer; AValue: Integer); virtual; abstract; + procedure SetOriginalSize(Index: Integer; const Value: Integer); virtual; abstract; + procedure SetSize(Index: Integer; const Value: Integer); virtual; abstract; + procedure SetPosition(Index: Integer; const Value: Integer); virtual; abstract; + + property MinSizes[Index: Integer]: Integer read GetMinSize; + property OriginalSizes[Index: Integer]: Integer read GetOriginalSize write SetOriginalSize; + property Sizes[Index: Integer]: Integer read GetSize write SetSize; + property Positions[Index: Integer]: Integer read GetPosition write SetPosition; + // Painting + function HasBorder: Boolean; override; + function HasCaption: Boolean; override; + public + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; + + function CanActive: Boolean; override; + function CanAutoHide: Boolean; override; + function CanDockHost(AControl: TdxCustomDockControl; AType: TdxDockingType): Boolean; override; + function CanMaximize: Boolean; override; + published + property AutoHide; + property CaptionButtons; + property Dockable; + property ImageIndex; + property ShowCaption; + + property OnActivate; + property OnAutoHideChanged; + property OnAutoHideChanging; + property OnClose; + property OnCloseQuery; + property OnDock; + property OnDocking; + property OnEndDocking; + property OnGetAutoHidePosition; + property OnMakeFloating; + property OnStartDocking; + property OnUnDock; + end; + + TdxHorizContainerDockSite = class(TdxSideContainerDockSite) + protected + // Resizing + procedure UpdateControlResizeZones(AControl: TdxCustomDockControl); override; + // SiteBounds + procedure UpdateControlOriginalSize(AControl: TdxCustomDockControl); override; + // Children layout + class function GetHeadDockType: TdxDockingType; override; + class function GetTailDockType: TdxDockingType; override; + function GetContainerSize: Integer; override; + function GetDimension(AWidth, AHeight: Integer): Integer; override; + function GetMinSize(Index: Integer): Integer; override; + function GetOriginalSize(Index: Integer): Integer; override; + function GetSize(Index: Integer): Integer; override; + function GetPosition(Index: Integer): Integer; override; + procedure SetDimension(var AWidth, AHeight: Integer; AValue: Integer); override; + procedure SetOriginalSize(Index: Integer; const Value: Integer); override; + procedure SetSize(Index: Integer; const Value: Integer); override; + procedure SetPosition(Index: Integer; const Value: Integer); override; + end; + + TdxVertContainerDockSite = class(TdxSideContainerDockSite) + protected + // Resizing + procedure UpdateControlResizeZones(AControl: TdxCustomDockControl); override; + // SiteBounds + procedure UpdateControlOriginalSize(AControl: TdxCustomDockControl); override; + // Children layout + class function GetHeadDockType: TdxDockingType; override; + class function GetTailDockType: TdxDockingType; override; + function GetContainerSize: Integer; override; + function GetDimension(AWidth, AHeight: Integer): Integer; override; + function GetMinSize(Index: Integer): Integer; override; + function GetOriginalSize(Index: Integer): Integer; override; + function GetSize(Index: Integer): Integer; override; + function GetPosition(Index: Integer): Integer; override; + procedure SetDimension(var AWidth, AHeight: Integer; AValue: Integer); override; + procedure SetOriginalSize(Index: Integer; const Value: Integer); override; + procedure SetSize(Index: Integer; const Value: Integer); override; + procedure SetPosition(Index: Integer; const Value: Integer); override; + end; + + TdxDockSiteAutoHideContainer = class(TWinControl) + private + procedure CMControlListChange(var Message: TMessage); message CM_CONTROLLISTCHANGE; + procedure WMEraseBkgnd(var Message: TWmEraseBkgnd); message WM_ERASEBKGND; + public + constructor Create(AOwner: TComponent); override; + end; + + TdxDockSiteHideBar = class + private + FDockControls: TList; + FRect: TRect; + FButtonsRects: array of TRect; + + FOwner: TdxDockSite; + function GetButtonRectCount: Integer; + function GetButtonRect(Index: Integer): TRect; + function GetDockControl(Index: Integer): TdxCustomDockControl; + function GetDockControlCount: Integer; + function GetPainter: TdxDockControlPainter; + function GetVisible: Boolean; + protected + procedure Calculate(R: TRect); virtual; abstract; + procedure CalculateButtons(R: TRect); virtual; abstract; + function GetContainersAnchors: TAnchors; virtual; abstract; + function GetControlsAlign: TAlign; virtual; abstract; + function GetPosition: TdxAutoHidePosition; virtual; abstract; + function GetButtonWidth(AControl: TdxCustomDockControl): Integer; virtual; + function GetDefaultImageSize: Integer; virtual; abstract; + function GetImageSize: Integer; virtual; abstract; + function CheckHidingFinish: Boolean; virtual; abstract; + function CheckShowingFinish: Boolean; virtual; abstract; + procedure SetFinalPosition(AControl: TdxCustomDockControl); virtual; abstract; + procedure SetInitialPosition(AControl: TdxCustomDockControl); virtual; abstract; + procedure UpdatePosition(ADelta: Integer); virtual; abstract; + procedure UpdateOwnerAutoSizeBounds(AControl: TdxCustomDockControl); virtual; abstract; + + function GetControlAtPos(pt: TPoint; var SubControl: TdxCustomDockControl): TdxCustomDockControl; virtual; + function GetTabContainerChildAtPos(pt: TPoint; TabContainer: TdxTabContainerDockSite): TdxCustomDockControl; virtual; + function IndexOfDockControl(AControl: TdxCustomDockControl): Integer; + procedure CreateAutoHideContainer(AControl: TdxCustomDockControl); virtual; + procedure DestroyAutoHideContainer(AControl: TdxCustomDockControl); virtual; + procedure RegisterDockControl(AControl: TdxCustomDockControl); + procedure UnregisterDockControl(AControl: TdxCustomDockControl); + // Rectangles + property ButtonRectCount: Integer read GetButtonRectCount; + property ButtonsRects[Index: Integer]: TRect read GetButtonRect; + property Painter: TdxDockControlPainter read GetPainter; + property Rect: TRect read FRect; + public + constructor Create(AOwner: TdxDockSite); + destructor Destroy; override; + + property DockControlCount: Integer read GetDockControlCount; + property DockControls[Index: Integer]: TdxCustomDockControl read GetDockControl; + property Owner: TdxDockSite read FOwner; + property Position: TdxAutoHidePosition read GetPosition; + property Visible: Boolean read GetVisible; + end; + + TdxDockSiteLeftHideBar = class(TdxDockSiteHideBar) + protected + procedure Calculate(R: TRect); override; + procedure CalculateButtons(R: TRect); override; + function GetDefaultImageSize: Integer; override; + function GetImageSize: Integer; override; + function GetContainersAnchors: TAnchors; override; + function GetControlsAlign: TAlign; override; + function GetPosition: TdxAutoHidePosition; override; + function CheckHidingFinish: Boolean; override; + function CheckShowingFinish: Boolean; override; + procedure SetFinalPosition(AControl: TdxCustomDockControl); override; + procedure SetInitialPosition(AControl: TdxCustomDockControl); override; + procedure UpdatePosition(ADelta: Integer); override; + procedure UpdateOwnerAutoSizeBounds(AControl: TdxCustomDockControl); override; + + function GetTabContainerChildAtPos(pt: TPoint; TabContainer: TdxTabContainerDockSite): TdxCustomDockControl; override; + end; + + TdxDockSiteTopHideBar = class(TdxDockSiteHideBar) + protected + procedure Calculate(R: TRect); override; + procedure CalculateButtons(R: TRect); override; + function GetDefaultImageSize: Integer; override; + function GetImageSize: Integer; override; + function GetContainersAnchors: TAnchors; override; + function GetControlsAlign: TAlign; override; + function GetPosition: TdxAutoHidePosition; override; + function CheckHidingFinish: Boolean; override; + function CheckShowingFinish: Boolean; override; + procedure SetFinalPosition(AControl: TdxCustomDockControl); override; + procedure SetInitialPosition(AControl: TdxCustomDockControl); override; + procedure UpdatePosition(ADelta: Integer); override; + procedure UpdateOwnerAutoSizeBounds(AControl: TdxCustomDockControl); override; + + function GetTabContainerChildAtPos(pt: TPoint; TabContainer: TdxTabContainerDockSite): TdxCustomDockControl; override; + end; + + TdxDockSiteRightHideBar = class(TdxDockSiteLeftHideBar) + protected + procedure Calculate(R: TRect); override; + function GetContainersAnchors: TAnchors; override; + function GetControlsAlign: TAlign; override; + function GetPosition: TdxAutoHidePosition; override; + procedure SetFinalPosition(AControl: TdxCustomDockControl); override; + procedure SetInitialPosition(AControl: TdxCustomDockControl); override; + procedure UpdatePosition(ADelta: Integer); override; + end; + + TdxDockSiteBottomHideBar = class(TdxDockSiteTopHideBar) + protected + procedure Calculate(R: TRect); override; + function GetContainersAnchors: TAnchors; override; + function GetControlsAlign: TAlign; override; + function GetPosition: TdxAutoHidePosition; override; + procedure SetFinalPosition(AControl: TdxCustomDockControl); override; + procedure SetInitialPosition(AControl: TdxCustomDockControl); override; + procedure UpdatePosition(ADelta: Integer); override; + end; + + TdxAutoHideControlEvent = procedure (Sender: TdxDockSite; AControl: TdxCustomDockControl) of object; + + TdxDockSite = class(TdxCustomDockSite) + private + FAutoSize: Boolean; + FAutoSizeHeight: Integer; + FAutoSizeWidth: Integer; + FHideBars: TList; + FHidingTimerID: Integer; + FMovingControl: TdxCustomDockControl; + FMovingControlHideBar: TdxDockSiteHideBar; + FMovingTimerID: Integer; + FShowingControl: TdxCustomDockControl; + FShowingControlCandidate: TdxCustomDockControl; + FShowingTimerID: Integer; + + FOnHideControl: TdxAutoHideControlEvent; + FOnShowControl: TdxAutoHideControlEvent; + + function GetHideBarCount: Integer; + function GetHideBar(Index: Integer): TdxDockSiteHideBar; + function GetMovingContainer: TdxDockSiteAutoHideContainer; + procedure SetShowingControl(Value: TdxCustomDockControl); + + procedure CMControlListChange(var Message: TMessage); message CM_CONTROLLISTCHANGE; + procedure CMDesignHitTest(var Message: TCMDesignHitTest); message CM_DESIGNHITTEST; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; + procedure WMMouseMove(var Message: TWMMouseMove); message WM_MOUSEMOVE; + protected + procedure Loaded; override; + procedure ReadState(Reader: TReader); override; + procedure SetAutoSize(Value: Boolean); {$IFDEF DELPHI6}override;{$ENDIF} + procedure SetParent(AParent: TWinControl); override; + procedure ValidateInsert(AComponent: TComponent); override; + // Resizing zones + procedure UpdateControlResizeZones(AControl: TdxCustomDockControl); override; + // Docking zones + procedure UpdateControlDockZones(AControl: TdxCustomDockControl; AZoneWidth: Integer); override; + // Control layout + procedure CreateLayout(AControl: TdxCustomDockControl; AType: TdxDockingType; + Index: Integer); override; + procedure DestroyLayout(AControl: TdxCustomDockControl); override; + procedure LoadLayoutFromCustomIni(AIniFile: TCustomIniFile; AParentForm: TCustomForm; + AParentControl: TdxCustomDockControl; ASection: string); override; + procedure SaveLayoutToCustomIni(AIniFile: TCustomIniFile; ASection: string); override; + // Control bounds + procedure UpdateControlOriginalSize(AControl: TdxCustomDockControl); override; + // Control visibility + procedure ChildVisibilityChanged(Sender: TdxCustomDockControl); override; + // Painting + procedure CalculateNC(var ARect: TRect); override; + procedure NCPaint(ACanvas: TCanvas); override; + procedure Recalculate; override; + // AutoHide controls + function GetControlAutoHidePosition(AControl: TdxCustomDockControl): TdxAutoHidePosition; override; + procedure RegisterAutoHideDockControl(AControl: TdxCustomDockControl; APosition: TdxAutoHidePosition); + procedure UnregisterAutoHideDockControl(AControl: TdxCustomDockControl); + // AutoSize + procedure AdjustAutoSizeBounds; virtual; + function CanAutoSizeChange: Boolean; virtual; + procedure CheckAutoSizeBounds; + function GetAutoSizeClientControl: TdxCustomDockControl; virtual; + procedure UpdateAutoSizeBounds(AWidth, AHeight: Integer); virtual; + // Hiding/Showing AutoHide controls + procedure DoHideControl(AControl: TdxCustomDockControl); + procedure DoShowControl(AControl: TdxCustomDockControl); + + procedure DoShowMovement; + procedure DoHideMovement; + procedure ImmediatelyHide(AFinalizing: Boolean = False); + procedure ImmediatelyShow(AControl: TdxCustomDockControl); + procedure InitializeHiding; + procedure InitializeShowing; + procedure FinalizeHiding; + procedure FinalizeShowing; + procedure SetFinalPosition(AControl: TdxCustomDockControl); + procedure SetInitialPosition(AControl: TdxCustomDockControl); + function GetClientLeft: Integer; + function GetClientTop: Integer; + function GetClientWidth: Integer; + function GetClientHeight: Integer; + // HideBars + function GetControlAtPos(pt: TPoint; var SubControl: TdxCustomDockControl): TdxCustomDockControl; + function GetHideBarAtPos(pt: TPoint): TdxDockSiteHideBar; + function GetHideBarByControl(AControl: TdxCustomDockControl): TdxDockSiteHideBar; + function GetHideBarByPosition(APosition: TdxAutoHidePosition): TdxDockSiteHideBar; + + procedure CreateHideBars; virtual; + procedure DestroyHideBars; virtual; + + property HideBarCount: Integer read GetHideBarCount; + property HideBars[Index: Integer]: TdxDockSiteHideBar read GetHideBar; + property BottomHideBar: TdxDockSiteHideBar index 1 read GetHideBar; + property LeftHideBar: TdxDockSiteHideBar index 2 read GetHideBar; + property RightHideBar: TdxDockSiteHideBar index 3 read GetHideBar; + property TopHideBar: TdxDockSiteHideBar index 0 read GetHideBar; + + property MovingContainer: TdxDockSiteAutoHideContainer read GetMovingContainer; + property MovingControl: TdxCustomDockControl read FMovingControl; + property MovingControlHideBar: TdxDockSiteHideBar read FMovingControlHideBar; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + function CanDockHost(AControl: TdxCustomDockControl; AType: TdxDockingType): Boolean; override; + function GetPositionByControl(AControl: TdxCustomDockControl): TdxAutoHidePosition; + function HasAutoHideControls: Boolean; + + property AutoSizeClientControl: TdxCustomDockControl read GetAutoSizeClientControl; + property ShowingControl: TdxCustomDockControl read FShowingControl write SetShowingControl; + published + property Align; + property Anchors; + property AutoSize: Boolean read FAutoSize write SetAutoSize default False; + property Visible; + + property OnCreateLayoutSite; + property OnHideControl: TdxAutoHideControlEvent read FOnHideControl write FOnHideControl; + property OnShowControl: TdxAutoHideControlEvent read FOnShowControl write FOnShowControl; + end; + + TdxSetFloatFormCaptionEvent = procedure (Sender: TdxCustomDockControl; AFloatForm: TdxFloatForm) of object; + TdxFloatDockSite = class(TdxCustomDockSite) + private + FFloatForm: TdxFloatForm; + FFloatLeft: Integer; + FFloatTop: Integer; + FFloatWidth: Integer; + FFloatHeight: Integer; + FOnSetFloatFormCaption: TdxSetFloatFormCaptionEvent; + + function GetChild: TdxCustomDockControl; + function GetFloatLeft: Integer; + function GetFloatTop: Integer; + function GetFloatWidth: Integer; + function GetFloatHeight: Integer; + procedure SetFloatLeft(const Value: Integer); + procedure SetFloatTop(const Value: Integer); + procedure SetFloatWidth(const Value: Integer); + procedure SetFloatHeight(const Value: Integer); + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + protected + procedure Loaded; override; + procedure SetParent(AParent: TWinControl); override; + function IsLoadingFromForm: Boolean; + // Docking + function CanUndock(AControl: TdxCustomDockControl): Boolean; override; + procedure StartDocking(pt: TPoint); override; + procedure CheckDockClientsRules; override; + // Dock zones + procedure UpdateControlDockZones(AControl: TdxCustomDockControl; AZoneWidth: Integer); override; + // Site layout + procedure CreateLayout(AControl: TdxCustomDockControl; AType: TdxDockingType; + Index: Integer); override; + procedure DestroyLayout(AControl: TdxCustomDockControl); override; + procedure LoadLayoutFromCustomIni(AIniFile: TCustomIniFile; AParentForm: TCustomForm; + AParentControl: TdxCustomDockControl; ASection: string); override; + procedure SaveLayoutToCustomIni(AIniFile: TCustomIniFile; ASection: string); override; + // Floating site + procedure DoSetFloatFormCaption; + function GetFloatForm: TdxFloatForm; override; + procedure RestoreDockPosition(pt: TPoint); override; + // Floating form + procedure CreateFloatForm; virtual; + procedure DestroyFloatForm; virtual; + procedure HideFloatForm; + procedure ShowFloatForm; + procedure SetFloatFormPosition(ALeft, ATop: Integer); + procedure SetFloatFormSize(AWidth, AHeight: Integer); + // Caption + procedure UpdateCaption; override; + // Site bounds + procedure AdjustControlBounds(AControl: TdxCustomDockControl); override; + procedure UpdateControlOriginalSize(AControl: TdxCustomDockControl); override; + procedure UpdateFloatPosition; virtual; + // Control visibility + procedure ChildVisibilityChanged(Sender: TdxCustomDockControl); override; + // Activation + // Closing + procedure DoClose; override; + // Destroying + function CanDestroy: Boolean; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure BeforeDestruction; override; + function HasParent: Boolean; override; + + procedure Activate; override; + function CanDockHost(AControl: TdxCustomDockControl; AType: TdxDockingType): Boolean; override; + function GetDockPanel: TdxCustomDockControl; + property Child: TdxCustomDockControl read GetChild; + published + property FloatLeft: Integer read GetFloatLeft write SetFloatLeft; + property FloatTop: Integer read GetFloatTop write SetFloatTop; + property FloatWidth: Integer read GetFloatWidth write SetFloatWidth stored False; + property FloatHeight: Integer read GetFloatHeight write SetFloatHeight stored False; + property OnSetFloatFormCaption: TdxSetFloatFormCaptionEvent read FOnSetFloatFormCaption + write FOnSetFloatFormCaption; + end; + + TdxFloatForm = class(TCustomForm) + private + FCanDesigning: Boolean; + FCaptionIsDown: Boolean; + FCaptionPoint: TPoint; + FClientHeight: Integer; + FClientWidth: Integer; + FDockSite: TdxFloatDockSite; + FOnTopMost: Boolean; + + function GetParentForm: TCustomForm; + + procedure WMHideForm(var Message: TWMClose); message WM_HIDEFORM; + procedure WMShowForm(var Message: TWMClose); message WM_SHOWFORM; + procedure WMClose(var Message: TWMClose); message WM_CLOSE; + procedure WMMove(var Message: TWMMove); message WM_MOVE; + procedure WMSize(var Message: TWMSize); message WM_SIZE; + procedure WMMouseActivate(var Message: TWMMouseActivate); message WM_MOUSEACTIVATE; + procedure WMNCLButtonDown(var Message: TWMNCLButtonDown); message WM_NCLBUTTONDOWN; + procedure WMNCLButtonUp(var Message: TWMNCLButtonUp); message WM_NCLBUTTONUP; + procedure WMNCLButtonDblClk(var Message: TWMNCMButtonDblClk); message WM_NCLBUTTONDBLCLK; + procedure WMNCMouseMove(var Message: TWMNCMouseMove); message WM_NCMOUSEMOVE; + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + {$IFDEF DELPHI6} + procedure WndProc(var Message: TMessage); override; + {$ENDIF} + function CanDesigning: Boolean; + function IsDesigning: Boolean; + function IsDestroying: Boolean; + // Dock site + procedure InsertDockSite(ADockSite: TdxFloatDockSite); + procedure RemoveDockSite; + // Form position + procedure SendOnTop; + procedure SendOnTopMost; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function IsShortCut(var Message: TWMKey): Boolean; override; + + property AutoScroll default False; + property BorderStyle default bsSizeToolWin; + property DockSite: TdxFloatDockSite read FDockSite; + property FormStyle; + property Icon; + property ParentForm: TCustomForm read GetParentForm; + end; + + TdxEdgePosition = (epLeft, epTop, epRight, epBottom, epTopLeft, epBottomRight, epRect); + TdxEdgePositions = set of TdxEdgePosition; + TdxEdgesType = (etStandard, etFlat, etRaisedInner, etRaisedOuter, etSunkenInner, etSunkenOuter); + + TdxDockControlPainter = class + private + FDockControl: TdxCustomDockControl; + protected + class procedure AssignDefaultColor(AManager: TdxDockingManager); virtual; + class procedure AssignDefaultFont(AManager: TdxDockingManager); virtual; + class procedure CreateColors; virtual; + class procedure RefreshColors; virtual; + class procedure ReleaseColors; virtual; + + class function LightColor(AColor: TColor): TColor; + class function LightLightColor(AColor: TColor): TColor; + class function DarkColor(AColor: TColor): TColor; + class function DarkDarkColor(AColor: TColor): TColor; + + class procedure DrawColorEdge(ACanvas: TCanvas; ARect: TRect; AColor: TColor; + AEdgesType: TdxEdgesType; AEdgePositios: TdxEdgePositions); + class procedure DrawImage(ACanvas: TCanvas; AImageList: TCustomImageList; + AImageIndex: Integer; R: TRect); + class function RectInRect(R1, R2: TRect): Boolean; + class procedure RotateBitmap(ABitmap: TBitmap; Angle: TcxRotationAngle); + + function GetCaptionRect(const ARect: TRect; AIsVertical: Boolean): TRect; virtual; + function GetColor: TColor; virtual; + function GetFont: TFont; virtual; + function GetBorderColor: TColor; virtual; + function GetCaptionColor(IsActive: Boolean): TColor; virtual; + function GetCaptionFont(IsActive: Boolean): TFont; virtual; + function GetCaptionFontColor(IsActive: Boolean): TColor; virtual; + function GetCaptionSignColor(IsActive, IsDown, IsHot: Boolean): TColor; virtual; + function GetTabsColor: TColor; virtual; + function GetTabColor(IsActive: Boolean): TColor; virtual; + function GetTabFont(IsActive: Boolean): TFont; virtual; + function GetTabFontColor(IsActive: Boolean): TColor; virtual; + function GetTabsScrollButtonsColor: TColor; virtual; + function GetTabsScrollButtonsSignColor(IsEnable: Boolean): TColor; virtual; + function GetHideBarColor: TColor; virtual; + function GetHideBarButtonColor: TColor; virtual; + function GetHideBarButtonFont: TFont; virtual; + function GetHideBarButtonFontColor: TColor; virtual; + + function DrawCaptionFirst: Boolean; virtual; + function NeedRedrawOnResize: Boolean; virtual; + public + constructor Create(ADockControl: TdxCustomDockControl); virtual; + // CustomDockControl + function CanVerticalCaption: Boolean; virtual; + function GetBorderWidth: Integer; virtual; + function GetCaptionButtonSize: Integer; virtual; + function GetCaptionHeight: Integer; virtual; + function GetCaptionHorizInterval: Integer; virtual; + function GetCaptionVertInterval: Integer; virtual; + function GetDefaultImageHeight: Integer; + function GetDefaultImageWidth: Integer; + function GetImageHeight: Integer; + function GetImageWidth: Integer; + function IsValidImageIndex(AIndex: Integer): Boolean; + + procedure DrawBorder(ACanvas: TCanvas; ARect: TRect); virtual; + procedure DrawCaption(ACanvas: TCanvas; ARect: TRect; IsActive: Boolean); virtual; + procedure DrawCaptionSeparator(ACanvas: TCanvas; ARect: TRect); virtual; + procedure DrawCaptionText(ACanvas: TCanvas; ARect: TRect; IsActive: Boolean); virtual; + procedure DrawCaptionButtonSelection(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot: Boolean); virtual; + procedure DrawCaptionCloseButton(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot, IsSwitched: Boolean); virtual; + procedure DrawCaptionHideButton(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot, IsSwitched: Boolean); virtual; + procedure DrawCaptionMaximizeButton(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot, IsSwitched: Boolean); virtual; + procedure DrawClient(ACanvas: TCanvas; ARect: TRect); virtual; + procedure DrawClientEx(ACanvas: TCanvas; AWindowRect, ARect: TRect); virtual; + // TabContainer + procedure CorrectTabRect(var ATab: TRect; APosition: TdxTabContainerTabsPosition; + AIsActive: Boolean); virtual; + function DrawActiveTabLast: Boolean; virtual; + function GetTabVertInterval: Integer; virtual; + function GetTabVertOffset: Integer; virtual; + function GetTabHorizInterval: Integer; virtual; + function GetTabHorizOffset: Integer; virtual; + function GetTabsButtonSize: Integer; virtual; + function GetTabsHeight: Integer; virtual; + + procedure DrawTabs(ACanvas: TCanvas; ARect, AActiveTabRect: TRect; + APosition: TdxTabContainerTabsPosition); virtual; + procedure DrawTab(ACanvas: TCanvas; AControl: TdxCustomDockControl; ARect: TRect; + IsActive: Boolean; APosition: TdxTabContainerTabsPosition); virtual; + procedure DrawTabContent(ACanvas: TCanvas; AControl: TdxCustomDockControl; + ARect: TRect; IsActive: Boolean; APosition: TdxTabContainerTabsPosition); virtual; + procedure DrawTabsNextTabButton(ACanvas: TCanvas; ARect: TRect; + IsDown, IsHot, IsEnable: Boolean; APosition: TdxTabContainerTabsPosition); virtual; + procedure DrawTabsPrevTabButton(ACanvas: TCanvas; ARect: TRect; + IsDown, IsHot, IsEnable: Boolean; APosition: TdxTabContainerTabsPosition); virtual; + procedure DrawTabsButtonSelection(ACanvas: TCanvas; ARect: TRect; + IsDown, IsHot, IsEnable: Boolean; APosition: TdxTabContainerTabsPosition); virtual; + // AutoHideHostSite + function GetHideBarHeight: Integer; virtual; + function GetHideBarWidth: Integer; virtual; + function GetHideBarVertInterval: Integer; virtual; + function GetHideBarHorizInterval: Integer; virtual; + + procedure DrawHideBar(ACanvas: TCanvas; ARect: TRect; APosition: TdxAutoHidePosition); virtual; + procedure DrawHideBarButton(ACanvas: TCanvas; AControl: TdxCustomDockControl; + ARect: TRect; APosition: TdxAutoHidePosition); virtual; + procedure DrawHideBarButtonContent(ACanvas: TCanvas; AControl: TdxCustomDockControl; + ARect: TRect; APosition: TdxAutoHidePosition); virtual; + procedure DrawHideBarButtonImage(ACanvas: TCanvas; AControl: TdxCustomDockControl; + ARect: TRect); virtual; + procedure DrawHideBarButtonText(ACanvas: TCanvas; AControl: TdxCustomDockControl; + ARect: TRect; APosition: TdxAutoHidePosition); virtual; + + property DockControl: TdxCustomDockControl read FDockControl; + end; + + TdxCustomDockControlProperties = class(TPersistent) + private + FOwner: TdxDockingManager; + FAllowDock: TdxDockingTypes; + FAllowDockClients: TdxDockingTypes; + FAllowFloating: Boolean; + FCaption: string; + FCaptionButtons: TdxCaptionButtons; + FDockable: Boolean; + FImageIndex: Integer; + FShowCaption: Boolean; + FColor: TColor; + FCursor: TCursor; + FFont: TFont; + FHint: string; + FManagerColor: Boolean; + FManagerFont: Boolean; + FPopupMenu: TPopupMenu; + FShowHint: Boolean; + FTag: Integer; + + function IsColorStored: Boolean; + function IsFontStored: Boolean; + procedure SetColor(const Value: TColor); + procedure SetFont(const Value: TFont); + procedure SetManagerColor(const Value: Boolean); + procedure SetManagerFont(const Value: Boolean); + protected + procedure AssignTo(Dest: TPersistent); override; + function GetOwner: TPersistent; override; + public + constructor Create(AOwner: TdxDockingManager); virtual; + destructor Destroy; override; + + property AllowDock: TdxDockingTypes read FAllowDock write FAllowDock default dxDockingDefaultDockingTypes; + property AllowDockClients: TdxDockingTypes read FAllowDockClients write FAllowDockClients default dxDockingDefaultDockingTypes; + property AllowFloating: Boolean read FAllowFloating write FAllowFloating default True; + property Caption: string read FCaption write FCaption; + property CaptionButtons: TdxCaptionButtons read FCaptionButtons write FCaptionButtons default dxDockinkDefaultCaptionButtons; + property Dockable: Boolean read FDockable write FDockable; + property ImageIndex: Integer read FImageIndex write FImageIndex; + property ShowCaption: Boolean read FShowCaption write FShowCaption default True; + published + property Color: TColor read FColor write SetColor stored IsColorStored default clBtnFace; + property Cursor: TCursor read FCursor write FCursor default crDefault; + property Font: TFont read FFont write SetFont stored IsFontStored; + property Hint: string read FHint write FHint; + property ManagerColor: Boolean read FManagerColor write SetManagerColor default True; + property ManagerFont: Boolean read FManagerFont write SetManagerFont default True; + property PopupMenu: TPopupMenu read FPopupMenu write FPopupMenu; + property ShowHint: Boolean read FShowHint write FShowHint default False; + property Tag: Integer read FTag write FTag default 0; + end; + + TdxLayoutDockSiteProperties = class(TdxCustomDockControlProperties) + published + property AllowDockClients; + end; + + TdxFloatDockSiteProperties = class(TdxCustomDockControlProperties) + published + property AllowDockClients; + end; + + TdxSideContainerDockSiteProperties = class(TdxCustomDockControlProperties) + published + property AllowDock; + property AllowDockClients; + property AllowFloating; + property CaptionButtons; + property Dockable; + property ImageIndex; + property ShowCaption; + end; + + TdxTabContainerDockSiteProperties = class(TdxCustomDockControlProperties) + private + FTabsPosition: TdxTabContainerTabsPosition; + FTabsScroll: Boolean; + protected + procedure AssignTo(Dest: TPersistent); override; + public + constructor Create(AOwner: TdxDockingManager); override; + published + property AllowDock; + property AllowDockClients; + property AllowFloating; + property CaptionButtons; + property Dockable; + property ImageIndex; + property ShowCaption; + property TabsPosition: TdxTabContainerTabsPosition read FTabsPosition write FTabsPosition default tctpBottom; + property TabsScroll: Boolean read FTabsScroll write FTabsScroll default True; + end; + + TdxDockingInternalState = (disManagerChanged, disContextMenu, disRedrawLocked); + TdxDockingInternalStates = set of TdxDockingInternalState; + + TdxDockingController = class(TcxMessageWindow) + private + FActivatingDockControl: TdxCustomDockControl; + FActiveDockControl: TdxCustomDockControl; + FActiveDockControlLockCount: Integer; + FCalculatingControl: TdxCustomDockControl; + FDestroyedDockControls: TList; + FDragImage: TdxDockingDragImage; + FLoadedForms: TList; + FDockControls: TList; + FDockManagers: TList; + FDockingDockControl: TdxCustomDockControl; + FFont: TFont; + FInternalState: TdxDockingInternalStates; + FInvalidNC: TList; + FInvalidNCBounds: TList; + FInvalidRedraw: TList; + FResizingDockControl: TdxCustomDockControl; + FSelectionBrush: TBrush; + FTempBitmap: TBitmap; + FUpdateNCLock: Integer; + + function GetDockControl(Index: Integer): TdxCustomDockControl; + function GetDockControlCount: Integer; + function GetDockManager(Index: Integer): TdxDockingManager; + function GetDockManagerCount: Integer; + function GetIsDocking: Boolean; + function GetIsResizing: Boolean; + procedure SetActiveDockControl(Value: TdxCustomDockControl); + procedure SetSelectionBrush(Value: TBrush); + + function ControlNeedUpdate(AControl: TdxCustomDockControl; AForm: TCustomForm): Boolean; + procedure DestroyControls; + procedure FinishDocking; + procedure FinishResizing; + procedure UpdateInvalidControlsNC; + procedure UpdateLayouts(AForm: TCustomForm); + protected + procedure WndProc(var Message: TMessage); override; + // Floating forms + procedure FloatFormsOnTop(AParentForm: TCustomForm); + procedure FloatFormsOnTopMost(AParentForm: TCustomForm); + procedure FloatFormsHide(AParentForm: TCustomForm); + procedure FloatFormsShow(AParentForm: TCustomForm); + function IsParentForFloatDockSite(AParentForm: TCustomForm; AFloatDockSite: TdxFloatDockSite): Boolean; + // Docking + procedure StartDocking(AControl: TdxCustomDockControl; const APoint: TPoint); + procedure Docking(AControl: TdxCustomDockControl; const APoint: TPoint); + procedure EndDocking(AControl: TdxCustomDockControl; const APoint: TPoint); + + // Docking controls + procedure DockControlLoaded(AControl: TdxCustomDockControl); + procedure DockManagerLoaded(AParentForm: TCustomForm); + function IndexOfDockControl(AControl: TdxCustomDockControl): Integer; + procedure RegisterDestroyedDockControl(AControl: TdxCustomDockControl); + procedure RegisterDockControl(AControl: TdxCustomDockControl); + procedure UnregisterDockControl(AControl: TdxCustomDockControl); + // Docking manager + function FindManager(AForm: TCustomForm): TdxDockingManager; + function FindFormManager(AForm: TCustomForm): TdxDockingManager; + procedure RegisterManager(AManager: TdxDockingManager); + procedure UnregisterManager(AManager: TdxDockingManager); + // Docking manager events + procedure DoActiveDockControlChanged(ASender: TdxCustomDockControl; ACallEvent: Boolean); + procedure DoCreateFloatSite(ASender: TdxCustomDockControl; ASite: TdxFloatDockSite); + procedure DoCreateLayoutSite(ASender: TdxCustomDockControl; ASite: TdxLayoutDockSite); + procedure DoCreateSideContainerSite(ASender: TdxCustomDockControl; ASite: TdxSideContainerDockSite); + procedure DoCreateTabContainerSite(ASender: TdxCustomDockControl; ASite: TdxTabContainerDockSite); + function DoCustomDrawResizingSelection(ASender: TdxCustomDockControl; DC: HDC; + AZone: TdxZone; pt: TPoint; Erasing: Boolean): Boolean; + function DoCustomDrawDockingSelection(ASender: TdxCustomDockControl; DC: HDC; + AZone: TdxZone; R: TRect; Erasing: Boolean): Boolean; + procedure DoSetFloatFormCaption(ASender: TdxCustomDockControl; AFloatForm: TdxFloatForm); + procedure DoLayoutChanged(ASender: TdxCustomDockControl); + procedure DoUpdateDockZones(ASender: TdxCustomDockControl); + procedure DoUpdateResizeZones(ASender: TdxCustomDockControl); + // Docking manager notifications + procedure DoColorChanged(AForm: TCustomForm); + procedure DoFontChanged(AForm: TCustomForm); + procedure DoImagesChanged(AForm: TCustomForm); + procedure DoLayoutLoaded(AForm: TCustomForm); + procedure DoManagerChanged(AForm: TCustomForm); + procedure DoOptionsChanged(AForm: TCustomForm); + procedure DoPainterChanged(AForm: TCustomForm; AssignDefaultStyle: Boolean); + procedure DoZonesWidthChanged(AForm: TCustomForm); + // Docking manager saving/loding + procedure ClearLayout(AForm: TCustomForm); + procedure LoadLayoutFromCustomIni(AIniFile: TCustomIniFile; AForm: TCustomForm); + procedure LoadControlFromCustomIni(AIniFile: TCustomIniFile; AParentForm: TCustomForm; + AParentControl: TdxCustomDockControl; ASection: string); + procedure SaveLayoutToCustomIni(AIniFile: TCustomIniFile; AForm: TCustomForm); + procedure SaveControlToCustomIni(AIniFile: TCustomIniFile; AControl: TdxCustomDockControl); + procedure UpdateLayout(AForm: TCustomForm); + // Painting + procedure BeginUpdateNC(ALockRedraw: Boolean = True); + procedure EndUpdateNC; + function CanUpdateNC(AControl: TdxCustomDockControl): Boolean; + function CanCalculateNC(AControl: TdxCustomDockControl): Boolean; + procedure DrawDockingSelection(ADockControl: TdxCustomDockControl; + AZone: TdxZone; const APoint: TPoint; AErasing: Boolean); + procedure DrawResizingSelection(ADockControl: TdxCustomDockControl; + AZone: TdxZone; const APoint: TPoint; AErasing: Boolean); + function PainterClass(AForm: TCustomForm): TdxDockControlPainterClass; + procedure CalculateControls(AForm: TCustomForm); + procedure InvalidateActiveDockControl; + procedure InvalidateControls(AForm: TCustomForm; ANeedRecalculate: Boolean); + procedure CreatePainterColors(AForm: TCustomForm); + procedure RefreshPainterColors(AForm: TCustomForm); + procedure ReleasePainterColors(AForm: TCustomForm); + + procedure CheckTempBitmap(ARect: TRect); + procedure ReleaseTempBitmap; + property TempBitmap: TBitmap read FTempBitmap; + public + constructor Create; override; + destructor Destroy; override; + // Lock updates + procedure BeginUpdate; + procedure EndUpdate; + // Find dock controls + function GetDockControlAtPos(const P: TPoint): TdxCustomDockControl; + function GetDockControlForWindow(AWnd: HWND; ADockWindow: HWND = 0): TdxCustomDockControl; + function GetFloatDockSiteAtPos(pt: TPoint): TdxCustomDockControl; + function GetNearestDockSiteAtPos(pt: TPoint): TdxCustomDockControl; + function IsDockControlFocusedEx(ADockControl: TdxCustomDockControl): Boolean; + // Default sites properties + function DefaultLayoutSiteProperties(AForm: TCustomForm): TdxLayoutDockSiteProperties; + function DefaultFloatSiteProperties(AForm: TCustomForm): TdxFloatDockSiteProperties; + function DefaultHorizContainerSiteProperties(AForm: TCustomForm): TdxSideContainerDockSiteProperties; + function DefaultVertContainerSiteProperties(AForm: TCustomForm): TdxSideContainerDockSiteProperties; + function DefaultTabContainerSiteProperties(AForm: TCustomForm): TdxTabContainerDockSiteProperties; + // Saving/Loading layout + procedure LoadLayoutFromIniFile(AFileName: string; AForm: TCustomForm = nil); + procedure LoadLayoutFromRegistry(ARegistryPath: string; AForm: TCustomForm = nil); + procedure LoadLayoutFromStream(AStream: TStream; AForm: TCustomForm = nil); + procedure SaveLayoutToIniFile(AFileName: string; AForm: TCustomForm = nil); + procedure SaveLayoutToRegistry(ARegistryPath: string; AForm: TCustomForm = nil); + procedure SaveLayoutToStream(AStream: TStream; AForm: TCustomForm = nil); + + function AutoHideInterval(AForm: TCustomForm): Integer; + function AutoHideMovingInterval(AForm: TCustomForm): Integer; + function AutoHideMovingSize(AForm: TCustomForm): Integer; + function AutoShowInterval(AForm: TCustomForm): Integer; + function Color(AForm: TCustomForm): TColor; + function DockZonesWidth(AForm: TCustomForm): Integer; + function Font(AForm: TCustomForm): TFont; + function Images(AForm: TCustomForm): TCustomImageList; + function Options(AForm: TCustomForm): TdxDockingOptions; + function ViewStyle(AForm: TCustomForm): TdxDockingViewStyle; + function ResizeZonesWidth(AForm: TCustomForm): Integer; + function SelectionFrameWidth(AForm: TCustomForm): Integer; + function TabsScrollInterval(AForm: TCustomForm): Integer; + + property ActiveDockControl: TdxCustomDockControl read FActiveDockControl write SetActiveDockControl; + property DockControlCount: Integer read GetDockControlCount; + property DockControls[Index: Integer]: TdxCustomDockControl read GetDockControl; + property DockManagerCount: Integer read GetDockManagerCount; + property DockManagers[Index: Integer]: TdxDockingManager read GetDockManager; + property DockingDockControl: TdxCustomDockControl read FDockingDockControl; + property IsDocking: Boolean read GetIsDocking; + property IsResizing: Boolean read GetIsResizing; + property ResizingDockControl: TdxCustomDockControl read FResizingDockControl; + property SelectionBrush: TBrush read FSelectionBrush write SetSelectionBrush; + end; + + TdxDockingManager = class(TComponent, IdxSkinSupport) + private + FAutoHideInterval: Integer; + FAutoHideMovingInterval: Integer; + FAutoHideMovingSize: Integer; + FAutoShowInterval: Integer; + FChangeLink: TChangeLink; + FColor: TColor; + FDefaultSitesPropertiesList: TList; + FDockZonesWidth: Integer; + FFont: TFont; + FImages: TCustomImageList; + FLookAndFeel: TcxLookAndFeel; + FOptions: TdxDockingOptions; + FResizeZonesWidth: Integer; + FPainterClass: TdxDockControlPainterClass; + FSelectionFrameWidth: Integer; + FTabsScrollInterval: Integer; + FUseDefaultSitesProperties: Boolean; + FViewStyle: TdxDockingViewStyle; + + FOnActiveDockControlChanged: TNotifyEvent; + FOnCreateFloatSite: TdxCreateFloatSiteEvent; + FOnCreateLayoutSite: TdxCreateLayoutSiteEvent; + FOnCreateSideContainer: TdxCreateSideContainerEvent; + FOnCreateTabContainer: TdxCreateTabContainerEvent; + FOnCustomDrawDockingSelection: TdxCustomDrawSelectionEvent; + FOnCustomDrawResizingSelection: TdxCustomDrawSelectionEvent; + FOnLayoutChanged: TdxDockControlNotifyEvent; + FOnSetFloatFormCaption: TdxSetFloatFormCaptionEvent; + FOnViewChanged: TNotifyEvent; + FOnUpdateDockZones: TdxUpdateZonesEvent; + FOnUpdateResizeZones: TdxUpdateZonesEvent; + + function IsDefaultSitePropertiesStored: Boolean; + function GetDefaultSiteProperties(Index: Integer): TdxCustomDockControlProperties; + function GetDefaultSitesPropertiesCount: Integer; + function GetDefaultLayoutSiteProperties: TdxLayoutDockSiteProperties; + function GetDefaultFloatSiteProperties: TdxFloatDockSiteProperties; + function GetDefaultHorizContainerSiteProperties: TdxSideContainerDockSiteProperties; + function GetDefaultVertContainerSiteProperties: TdxSideContainerDockSiteProperties; + function GetDefaultTabContainerSiteProperties: TdxTabContainerDockSiteProperties; + function GetParentForm: TCustomForm; + procedure SetColor(const Value: TColor); + procedure SetDefaultLayoutSiteProperties(Value: TdxLayoutDockSiteProperties); + procedure SetDefaultFloatSiteProperties(Value: TdxFloatDockSiteProperties); + procedure SetDefaultHorizContainerSiteProperties(Value: TdxSideContainerDockSiteProperties); + procedure SetDefaultVertContainerSiteProperties(Value: TdxSideContainerDockSiteProperties); + procedure SetDefaultTabContainerSiteProperties(Value: TdxTabContainerDockSiteProperties); + procedure SetDockZonesWidth(const Value: Integer); + procedure SetFont(const Value: TFont); + procedure SetImages(const Value: TCustomImageList); + procedure SetLookAndFeel(Value: TcxLookAndFeel); + procedure SetOptions(const Value: TdxDockingOptions); + procedure SetResizeZonesWidth(const Value: Integer); + procedure SetViewStyle(const Value: TdxDockingViewStyle); + + procedure DoOnImagesChanged(Sender: TObject); + procedure DoOnFontChanged(Sender: TObject); + procedure DoOnLFChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); + protected + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure Loaded; override; + function IsLoading: Boolean; + function IsDestroying: Boolean; + + procedure DoColorChanged; + procedure DoFontChanged; + procedure CreatePainterClass(AssignDefaultStyle: Boolean); virtual; + function GetPainterClass: TdxDockControlPainterClass; virtual; + procedure ReleasePainterClass; virtual; + + procedure CreateDefaultSitesProperties; virtual; + procedure DestroyDefaultSitesProperties; virtual; + procedure UpdateDefaultSitesPropertiesColor; + procedure UpdateDefaultSitesPropertiesFont; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + // Saving/Loading layout + procedure LoadLayoutFromIniFile(AFileName: string); + procedure LoadLayoutFromRegistry(ARegistryPath: string); + procedure LoadLayoutFromStream(AStream: TStream); + procedure SaveLayoutToIniFile(AFileName: string); + procedure SaveLayoutToRegistry(ARegistryPath: string); + procedure SaveLayoutToStream(AStream: TStream); + + property DefaultSitesProperties[Index: Integer]: TdxCustomDockControlProperties read GetDefaultSiteProperties; + property DefaultSitesPropertiesCount: Integer read GetDefaultSitesPropertiesCount; + property PainterClass: TdxDockControlPainterClass read GetPainterClass; + property ParentForm: TCustomForm read GetParentForm; + published + property AutoHideInterval: Integer read FAutoHideInterval write FAutoHideInterval default dxAutoHideInterval; + property AutoHideMovingInterval: Integer read FAutoHideMovingInterval write FAutoHideMovingInterval default dxAutoHideMovingInterval; + property AutoHideMovingSize: Integer read FAutoHideMovingSize write FAutoHideMovingSize default dxAutoHideMovingSize; + property AutoShowInterval: Integer read FAutoShowInterval write FAutoShowInterval default dxAutoShowInterval; + property Color: TColor read FColor write SetColor; + property DefaultLayoutSiteProperties: TdxLayoutDockSiteProperties read GetDefaultLayoutSiteProperties + write SetDefaultLayoutSiteProperties stored IsDefaultSitePropertiesStored; + property DefaultFloatSiteProperties: TdxFloatDockSiteProperties read GetDefaultFloatSiteProperties + write SetDefaultFloatSiteProperties stored IsDefaultSitePropertiesStored; + property DefaultHorizContainerSiteProperties: TdxSideContainerDockSiteProperties read GetDefaultHorizContainerSiteProperties + write SetDefaultHorizContainerSiteProperties stored IsDefaultSitePropertiesStored; + property DefaultVertContainerSiteProperties: TdxSideContainerDockSiteProperties read GetDefaultVertContainerSiteProperties + write SetDefaultVertContainerSiteProperties stored IsDefaultSitePropertiesStored; + property DefaultTabContainerSiteProperties: TdxTabContainerDockSiteProperties read GetDefaultTabContainerSiteProperties + write SetDefaultTabContainerSiteProperties stored IsDefaultSitePropertiesStored; + property DockZonesWidth: Integer read FDockZonesWidth write SetDockZonesWidth default dxDockZonesWidth; + property Font: TFont read FFont write SetFont; + property Images: TCustomImageList read FImages write SetImages; + property LookAndFeel: TcxLookAndFeel read FLookAndFeel write SetLookAndFeel; + property Options: TdxDockingOptions read FOptions write SetOptions default dxDockingDefaultOptions; + property ResizeZonesWidth: Integer read FResizeZonesWidth write SetResizeZonesWidth default dxResizeZonesWidth; + property SelectionFrameWidth: Integer read FSelectionFrameWidth write FSelectionFrameWidth default dxSelectionFrameWidth; + property TabsScrollInterval: Integer read FTabsScrollInterval write FTabsScrollInterval default dxTabsScrollInterval; + property UseDefaultSitesProperties: Boolean read FUseDefaultSitesProperties write FUseDefaultSitesProperties default True; + property ViewStyle: TdxDockingViewStyle read FViewStyle write SetViewStyle; + + property OnActiveDockControlChanged: TNotifyEvent read FOnActiveDockControlChanged + write FOnActiveDockControlChanged; + property OnCreateFloatSite: TdxCreateFloatSiteEvent read FOnCreateFloatSite + write FOnCreateFloatSite; + property OnCreateLayoutSite: TdxCreateLayoutSiteEvent read FOnCreateLayoutSite + write FOnCreateLayoutSite; + property OnCreateSideContainer: TdxCreateSideContainerEvent read FOnCreateSideContainer + write FOnCreateSideContainer; + property OnCreateTabContainer: TdxCreateTabContainerEvent read FOnCreateTabContainer + write FOnCreateTabContainer; + property OnCustomDrawDockingSelection: TdxCustomDrawSelectionEvent read FOnCustomDrawDockingSelection + write FOnCustomDrawDockingSelection; + property OnCustomDrawResizingSelection: TdxCustomDrawSelectionEvent read FOnCustomDrawResizingSelection + write FOnCustomDrawResizingSelection; + property OnLayoutChanged: TdxDockControlNotifyEvent read FOnLayoutChanged write FOnLayoutChanged; + property OnSetFloatFormCaption: TdxSetFloatFormCaptionEvent read FOnSetFloatFormCaption + write FOnSetFloatFormCaption; + property OnViewChanged: TNotifyEvent read FOnViewChanged write FOnViewChanged; + property OnUpdateDockZones: TdxUpdateZonesEvent read FOnUpdateDockZones + write FOnUpdateDockZones; + property OnUpdateResizeZones: TdxUpdateZonesEvent read FOnUpdateResizeZones + write FOnUpdateResizeZones; + end; + + function dxDockingController: TdxDockingController; + +var + CustomSkinPainterClass: TdxDockControlPainterClass; + FOnRegisterDockControl: TcxNotifyProcedure; + FOnUnregisterDockControl: TcxNotifyProcedure; + +implementation + +uses + TypInfo, SysUtils, CommCtrl, Registry, dxThemeManager, dxDockPanel, + dxDockZones, dxDockControlXPView, dxDockControlNETView, dxDockControlOfficeView, + Math, cxGeometry; + +const + dxDockingTypeAlign: array[TdxDockingType] of TAlign = + (alClient, alLeft, alTop, alRight, alBottom); + +var + FDockingController: TdxDockingController; + FWndProcHookHandle: HHOOK; + +function dxDockingController: TdxDockingController; +begin + if FDockingController = nil then + FDockingController := TdxDockingController.Create; + Result := FDockingController; +end; + +function GetParentFormForDocking(AControl: TControl): TCustomForm; +begin + Result := GetParentForm(AControl); + if Result is TdxFloatForm then + Result := TdxFloatForm(Result).ParentForm; +end; + +function ParentIsDockControl(AParent: TWinControl): Boolean; +begin + Result := False; + if AParent = nil then Exit; + repeat + if AParent is TdxCustomDockControl then + begin + Result := True; + Break; + end; + AParent := AParent.Parent; + until AParent = nil; +end; + +function IsControlContainsDockSite(AControl: TControl): Boolean; +var + I: Integer; +begin + Result := False; + if AControl is TWinControl then + begin + if AControl is TdxDockSite then + begin + Result := True; + Exit; + end; + for I := 0 to TWinControl(AControl).ControlCount - 1 do + begin + Result := IsControlContainsDockSite(TWinControl(AControl).Controls[I]); + if Result then + Break; + end; + end; +end; + +{ TdxZone } + +constructor TdxZone.Create(AOwner: TdxCustomDockControl; AWidth: Integer; + AKind: TdxZoneKind); +begin + Assert(AOwner <> nil, sdxInvaldZoneOwner); + FOwner := AOwner; + FWidth := AWidth; + FKind := AKind; +end; + +function TdxZone.IsZonePoint(pt: TPoint): Boolean; +begin + Result := PtInRect(Rectangle, Owner.ScreenToWindow(pt)); +end; + +class function TdxZone.ValidateDockZone(AOwner, AControl: TdxCustomDockControl): Boolean; +begin + Result := (AOwner = AControl); +end; + +class function TdxZone.ValidateResizeZone(AOwner, AControl: TdxCustomDockControl): Boolean; +begin + Result := False; +end; + +function TdxZone.GetDockingSelection(AControl: TdxCustomDockControl): TRect; +var + R: TRect; +begin + Result := Rectangle; + GetWindowRect(Owner.Handle, R); + OffsetRect(Result, R.Left, R.Top); +end; + +function TdxZone.GetResizingSelection(pt: TPoint): TRect; +begin + Result := Rect(0, 0, 0, 0); +end; + +function TdxZone.GetDockIndex: Integer; +begin + Result := -1; +end; + +function TdxZone.GetSelectionFrameWidth: Integer; +begin + Result := Owner.ControllerSelectionFrameWidth; +end; + +function TdxZone.GetWidth: Integer; +begin + if FWidth > 0 then + Result := FWidth + else + Result := dxDockZonesWidth; +end; + +function TdxZone.CanDock(AControl: TdxCustomDockControl): Boolean; +begin + Result := Owner.CanDockHost(AControl, DockType); +end; + +function TdxZone.CanResize(StartPoint, EndPoint: TPoint): Boolean; +begin + Result := False; +end; + +function TdxZone.CanConstrainedResize(NewWidth, NewHeight: Integer): Boolean; +begin + Result := ((Owner.Constraints.MinHeight <= 0) or (NewHeight > Owner.Constraints.MinHeight)) and + ((Owner.Constraints.MaxHeight <= 0) or (NewHeight < Owner.Constraints.MaxHeight)) and + ((Owner.Constraints.MinWidth <= 0) or (NewWidth > Owner.Constraints.MinWidth)) and + ((Owner.Constraints.MaxWidth <= 0) or (NewWidth < Owner.Constraints.MaxWidth)); +end; + +procedure TdxZone.DoDock(AControl: TdxCustomDockControl); +begin + AControl.DockTo(Owner, DockType, DockIndex); +end; + +procedure TdxZone.DoResize(StartPoint, EndPoint: TPoint); +begin +end; + +procedure TdxZone.DrawDockingSelection(DC: HDC; AControl: TdxCustomDockControl; pt: TPoint); +var + R: TRect; + PenSize: Integer; +begin + PenSize := SelectionFrameWidth; + R := GetDockingSelection(AControl); + with R do + begin + PatBlt(DC, Left + PenSize, Top, Right - Left - PenSize, PenSize, PATINVERT); + PatBlt(DC, Right - PenSize, Top + PenSize, PenSize, Bottom - Top - PenSize, PATINVERT); + PatBlt(DC, Left, Bottom - PenSize, Right - Left - PenSize, PenSize, PATINVERT); + PatBlt(DC, Left, Top, PenSize, Bottom - Top - PenSize, PATINVERT); + end; +end; + +procedure TdxZone.DrawResizingSelection(DC: HDC; pt: TPoint); +var + R: TRect; +begin + R := GetResizingSelection(pt); + with R do + PatBlt(DC, Left, Top, Right - Left, Bottom - Top, PATINVERT); +end; + +procedure TdxZone.PrepareSelectionRegion(ARegion: TcxRegion; AControl: TdxCustomDockControl; const ARect: TRect); +begin + AControl.PrepareSelectionRegion(ARegion, ARect); +end; + +{ TdxCustomDockControl } + +constructor TdxCustomDockControl.Create(AOwner: TComponent); +begin + Include(FInternalState, dcisCreating); + inherited Create(AOwner); + + if not (AOwner is TCustomForm) then + raise Exception.Create(sdxInvalidOwner); + Exclude(FInternalState, dcisCreating); + + Controller.RegisterDockControl(Self); + FAllowDock := dxDockingDefaultDockingTypes; + FAllowDockClients := dxDockingDefaultDockingTypes; + FAllowFloating := True; + FCaptionButtons := dxDockinkDefaultCaptionButtons; + FDockable := True; + FDockControls := TList.Create; + FDockType := dtNone; + FDockZones := TList.Create; + FDockingPoint := cxInvalidPoint; + FImageIndex := -1; + ManagerColor := True; + ManagerFont := True; + FResizeZones := TList.Create; + ParentColor := False; + ParentFont := False; + FAutoHidePosition := ahpUndefined; + FShowCaption := True; + FUseDoubleBuffer := False; + ControlStyle := [csAcceptsControls, csClickEvents, csDoubleClicks, csSetCaption]; + SetBounds(0, 0, 300, 200); +end; + +destructor TdxCustomDockControl.Destroy; +begin + if not (dcisCreating in FInternalState) then + begin + if IsSelected then + NoSelection; + RemoveFromLayout; + ClearZones(FResizeZones); + FResizeZones.Free; + ClearZones(FDockZones); + FDockZones.Free; + FDockControls.Free; + FPainter.Free; + FPainter := nil; + Controller.UnregisterDockControl(Self); + end; + inherited; +end; + +procedure TdxCustomDockControl.Assign(Source: TPersistent); +var + AControl: TdxCustomDockControl; +begin + if Source is TdxCustomDockControl then + begin + AControl := Source as TdxCustomDockControl; + AllowDock := AControl.AllowDock; + AllowDockClients := AControl.AllowDockClients; + AllowFloating := AControl.AllowFloating; + Caption := AControl.Caption; + CaptionButtons := AControl.CaptionButtons; + Dockable := AControl.Dockable; + ImageIndex := AControl.ImageIndex; + ShowCaption := AControl.ShowCaption; + Color := AControl.Color; + Cursor := AControl.Cursor; + Font := AControl.Font; + Hint := AControl.Hint; + ManagerColor := AControl.ManagerColor; + ManagerFont := AControl.ManagerFont; + PopupMenu := AControl.PopupMenu; + ShowHint := AControl.ShowHint; + Tag := AControl.Tag; + end + else inherited Assign(Source) +end; + +procedure TdxCustomDockControl.BeforeDestruction; +begin + if not CanDestroy then + raise Exception.Create(sdxInvalidFloatingDeleting); + inherited; +end; + +procedure TdxCustomDockControl.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); + + procedure DoSetBounds; + begin + inherited SetBounds(ALeft, ATop, AWidth, AHeight); + if not IsUpdateLayoutLocked then + UpdateOriginalSize; + end; + + procedure DoChildResize; + + function GetDeltaSize: Integer; + begin + Result := SideContainer.GetDimension(AWidth - Width, AHeight - Height); + end; + + function IsResizeNextControl: Boolean; + begin + Result := SideContainer.GetDimension(Left - ALeft, Top - ATop) = 0; + end; + + begin + SideContainer.DoChildResize(Self, GetDeltaSize, IsResizeNextControl); + end; + + function IsAlignDisabled: Boolean; + var + AControl: TWinControl; + begin + AControl := Self; + repeat + Result := AControl.AlignDisabled; + AControl := AControl.Parent; + until (AControl = nil) or Result; + end; + +begin + if (SideContainer <> nil) and (SideContainerItem = Self) and SideContainer.IsValidChild(Self) and + not (dcisInternalResizing in FInternalState) then + begin + Include(FInternalState, dcisInternalResizing); + try + if IsAlignDisabled or IsUpdateLayoutLocked or SideContainer.IsAdjustBoundsLocked or SideContainer.IsUpdateLayoutLocked then + begin + SideContainer.SetChildBounds(Self, AWidth, AHeight); + DoSetBounds; + end + else + DoChildResize; + finally + Exclude(FInternalState, dcisInternalResizing); + end; + end + else + DoSetBounds; +end; + +function TdxCustomDockControl.GetDockZoneAtPos(AControl: TdxCustomDockControl; pt: TPoint): TdxZone; +var + I: Integer; + AZone: TdxZone; +begin + Result := nil; + if AControl.Dockable then + for I := 0 to DockZones.Count - 1 do + begin + AZone := TdxZone(DockZones[I]); + if AZone.IsZonePoint(pt) and AZone.CanDock(AControl) then + begin + Result := AZone; + break; + end; + end; +end; + +function TdxCustomDockControl.GetResizeZoneAtPos(pt: TPoint): TdxZone; +var + I: Integer; + AZone: TdxZone; +begin + Result := nil; + if CanResizeAtPos(ScreenToClient(pt)) then + begin + for I := 0 to ResizeZones.Count - 1 do + begin + AZone := TdxZone(ResizeZones[I]); + if AZone.IsZonePoint(pt) then + begin + Result := AZone; + break; + end; + end; + if (Result = nil) and (ParentDockControl <> nil) then + Result := ParentDockControl.GetResizeZoneAtPos(pt); + end; +end; + +function TdxCustomDockControl.IsNeeded: Boolean; +begin + Result := ChildCount <> 1; +end; + +function TdxCustomDockControl.IsValidChild(AControl: TdxCustomDockControl): Boolean; +begin + Result := (AControl <> nil) and (AControl.ParentDockControl = Self) and + (0 <= AControl.DockIndex) and (AControl.DockIndex < ChildCount) and + AControl.Visible and not AControl.AutoHide; +end; + +procedure TdxCustomDockControl.DockTo(AControl: TdxCustomDockControl; AType: TdxDockingType; AIndex: Integer); + + procedure ValidateControl; + begin + if AControl = LayoutDockSite then + AControl := ParentDockControl + else + if (AControl = Container) and (Container.ChildCount = 2) and + not Container.CanContainerDockHost(AType) then + begin + if DockIndex = 0 then + AControl := Container.Children[1] + else + AControl := Container.Children[0]; + end; + end; + +begin + if not CanDock or not AControl.CanDockHost(Self, AType) then + Exit; + BeginUpdateNC; + try + if AControl <> nil then + begin + ValidateControl; + SelectComponent(AControl.TopMostDockControl); + AControl.BeginUpdateLayout; + try + if ParentDockControl <> nil then + if (AControl = Container) and Container.CanContainerDockHost(AType) then + ExcludeFromDock + else + UnDock; + AControl.CreateLayout(Self, AType, AIndex); + finally + AControl.EndUpdateLayout; + end; + if Assigned(FOnDock) then + FOnDock(Self, AControl, AType, AIndex); + Controller.DoLayoutChanged(Self); + SelectComponent(Self); + end; + if doActivateAfterDocking in ControllerOptions then + Activate; + finally + EndUpdateNC; + end; +end; + +procedure TdxCustomDockControl.Close; +begin + DoClose; +end; + +procedure TdxCustomDockControl.MakeFloating; +var + pt: TPoint; +begin + pt := Point(0, 0); + if HandleAllocated then pt := WindowToScreen(pt); + MakeFloating(pt.X, pt.Y); +end; + +procedure TdxCustomDockControl.MakeFloating(XPos, YPos: Integer); +var + ASite: TdxFloatDockSite; + AWidth, AHeight: Integer; +begin + if not CanDock then exit; + if not AllowFloating then exit; + BeginUpdateNC; + try + if FloatDockSite = nil then + begin + SelectComponent(TopMostDockControl); + StoreDockPosition(Point(XPos, YPos)); + AWidth := OriginalWidth; + AHeight := OriginalHeight; + UnDock; + ASite := TdxFloatDockSite.Create(Owner); + ASite.Name := ASite.UniqueName; + ASite.SetFloatFormPosition(XPos, YPos); + ASite.SetFloatFormSize(AWidth, AHeight); + ASite.CreateLayout(Self, dtClient, 0); + ASite.ShowFloatForm; + DoCreateFloatSite(ASite); + if Assigned(FOnMakeFloating) then + FOnMakeFloating(Self, XPos, YPos); + Controller.DoLayoutChanged(Self); + SelectComponent(Self); + if doActivateAfterDocking in ControllerOptions then + Activate; + end + else + FloatDockSite.SetFloatFormPosition(XPos, YPos); + finally + EndUpdateNC; + end; +end; + +procedure TdxCustomDockControl.UnDock; +var + AParentDockControl: TdxCustomDockControl; +begin + if not CanDock then exit; + BeginUpdateNC; + try + if AutoHide then AutoHide := False; + if ParentDockControl <> nil then + begin + AParentDockControl := ParentDockControl; + AParentDockControl.BeginUpdateLayout; + try + NoSelection; + if Assigned(FOnUnDock) then + FOnUnDock(Self, ParentDockControl); + if FloatDockSite <> nil then + FloatDockSite.HideFloatForm; + AParentDockControl.DestroyLayout(Self); + AParentDockControl.ChildVisibilityChanged(Self); + finally + AParentDockControl.EndUpdateLayout; + end; + Controller.DoLayoutChanged(Self); + end; + finally + EndUpdateNC; + end; +end; + +procedure TdxCustomDockControl.AddDockControl(AControl: TdxCustomDockControl; AIndex: Integer); +var + AOldIndex: Integer; +begin + AOldIndex := FDockControls.IndexOf(AControl); + if AOldIndex < 0 then + begin + if (0 <= AIndex) and (AIndex < FDockControls.Count) then + FDockControls.Insert(AIndex, AControl) + else FDockControls.Add(AControl) + end + else if AOldIndex <> AIndex then + begin + if (0 <= AIndex) and (AIndex < FDockControls.Count) then + FDockControls.Move(AOldIndex, AIndex) + else FDockControls.Move(AOldIndex, FDockControls.Count - 1); + end; +end; + +procedure TdxCustomDockControl.RemoveDockControl(AControl: TdxCustomDockControl); +begin + if IndexOfControl(AControl) > -1 then + FDockControls.Remove(AControl); +end; + +function TdxCustomDockControl.IndexOfControl(AControl: TdxCustomDockControl): Integer; +begin + Result := FDockControls.IndexOf(AControl); +end; + +procedure TdxCustomDockControl.CheckDockRules; +begin + if CanDock and (DockType <> dtNone) and not (DockType in AllowDock) then + begin + if AutoHide then AutoHide := False; + FAllowFloating := True; + MakeFloating; + end; +end; + +procedure TdxCustomDockControl.CheckDockClientsRules; +var + I: Integer; +begin + I := 0; + while I < ChildCount do + begin + if not (Children[I].DockType in AllowDockClients) and Children[I].CanDock then + begin + if Children[I].AutoHide then Children[I].AutoHide := False; + Children[I].FAllowFloating := True; + Children[I].MakeFloating(ClientOrigin.X, ClientOrigin.Y); + I := 0; + end + else Inc(I); + end; +end; + +procedure TdxCustomDockControl.ClearZones(AZones: TList); +var + I: Integer; +begin + if AZones = nil then exit; + for I := 0 to AZones.Count - 1 do + TdxZone(AZones[I]).Free; + AZones.Clear; +end; + +procedure TdxCustomDockControl.DrawDockingSelection(AZone: TdxZone; const pt: TPoint; AErasing: Boolean); +begin + Controller.DrawDockingSelection(Self, AZone, pt, AErasing); +end; + +procedure TdxCustomDockControl.PrepareSelectionRegion(ARegion: TcxRegion; const ARect: TRect); +begin + ARegion.Combine(TcxRegion.Create(ARect), roSet); +end; + +function TdxCustomDockControl.CanResizing(NewWidth, NewHeight: Integer): Boolean; +begin + Result := True; + if Assigned(FOnCanResize) then FOnCanResize(Self, NewWidth, NewHeight, Result); +end; + +function TdxCustomDockControl.CanResizeAtPos(pt: TPoint): Boolean; +begin + Result := not IsDesigning and not IsCaptionPoint(pt) and not IsCaptionCloseButtonPoint(pt) and + not IsCaptionHideButtonPoint(pt) and not IsCaptionMaximizeButtonPoint(pt); +end; + +procedure TdxCustomDockControl.DrawResizingSelection(AZone: TdxZone; pt: TPoint; Erasing: Boolean); +begin + Controller.DrawResizingSelection(Self, AZone, pt, Erasing); +end; + +function TdxCustomDockControl.GetFloatDockSite: TdxFloatDockSite; +begin + if ParentDockControl is TdxFloatDockSite then + Result := ParentDockControl as TdxFloatDockSite + else Result := nil; +end; + +function TdxCustomDockControl.GetFloatForm: TdxFloatForm; +begin + if TopMostDockControl is TdxFloatDockSite then + Result := (TopMostDockControl as TdxFloatDockSite).FloatForm + else Result := nil; +end; + +function TdxCustomDockControl.GetFloatFormActive: Boolean; +begin + Result := (FloatForm <> nil) and FloatForm.Active; +end; + +function TdxCustomDockControl.GetFloatFormVisible: Boolean; +begin + Result := (FloatForm <> nil) and FloatForm.HandleAllocated and + IsWindowVisible(FloatForm.Handle); +end; + +procedure TdxCustomDockControl.StoreDockPosition(pt: TPoint); +begin + FStoredPosition.DockIndex := DockIndex; + FStoredPosition.Parent := ParentDockControl; + if Container <> nil then + begin + if DockIndex < Container.ChildCount - 1 then + FStoredPosition.SiblingAfter := Container.Children[DockIndex + 1] + else + FStoredPosition.SiblingAfter := nil; + if DockIndex > 0 then + FStoredPosition.SiblingBefore := Container.Children[DockIndex - 1] + else + FStoredPosition.SiblingBefore := nil; + if DockType = Container.GetTailDockType then + FStoredPosition.DockType := Container.GetTailDockType + else + FStoredPosition.DockType := Container.GetHeadDockType; + end + else + FStoredPosition.DockType := DockType; + FStoredPosition.OriginalHeight := OriginalHeight; + FStoredPosition.OriginalWidth := OriginalWidth; + if Assigned(FOnStoreDockPosition) then + FOnStoreDockPosition(Self, FStoredPosition); +end; + +procedure TdxCustomDockControl.RestoreDockPosition(pt: TPoint); +var + AParentSite: TdxCustomDockControl; +begin + if Assigned(FOnRestoreDockPosition) then + FOnRestoreDockPosition(Self, FStoredPosition); + if (FStoredPosition.Parent <> nil) and (FStoredPosition.Parent.DockState in [dsDocked, dsFloating]) and + FStoredPosition.Parent.CanDockHost(Self, FStoredPosition.DockType) then + AParentSite := FStoredPosition.Parent + else + if (FStoredPosition.SiblingBefore <> nil) and (FStoredPosition.SiblingBefore.DockState in [dsDocked, dsFloating]) and + FStoredPosition.SiblingBefore.CanDockHost(Self, FStoredPosition.DockType) then + AParentSite := FStoredPosition.SiblingBefore + else + if (FStoredPosition.SiblingAfter <> nil) and (FStoredPosition.SiblingAfter.DockState in [dsDocked, dsFloating]) and + FStoredPosition.SiblingAfter.CanDockHost(Self, FStoredPosition.DockType) then + AParentSite := FStoredPosition.SiblingAfter + else + AParentSite := nil; + if AParentSite <> nil then + begin + FOriginalHeight := FStoredPosition.OriginalHeight; + FOriginalWidth := FStoredPosition.OriginalWidth; + DoStartDocking(pt); + DockTo(AParentSite, FStoredPosition.DockType, FStoredPosition.DockIndex); + DoEndDocking(pt); + FStoredPosition.Parent := nil; + FStoredPosition.SiblingAfter := nil; + FStoredPosition.SiblingBefore := nil; + end; +end; + +procedure TdxCustomDockControl.AssignLayoutSiteProperties(ASite: TdxLayoutDockSite); +var + AProperties: TdxCustomDockControlProperties; +begin + AProperties := Controller.DefaultLayoutSiteProperties(ParentForm); + if AProperties <> nil then + AProperties.AssignTo(ASite); +end; + +procedure TdxCustomDockControl.DoCreateLayoutSite(ASite: TdxLayoutDockSite); +begin + AssignLayoutSiteProperties(ASite); + if Assigned(FOnCreateLayoutSite) then + FOnCreateLayoutSite(Self, ASite); + Controller.DoCreateLayoutSite(Self, ASite); +end; + +function TdxCustomDockControl.GetLayoutDockSite: TdxLayoutDockSite; +begin + if (ParentDockControl <> nil) and (ParentDockControl.ChildCount = 2) then + begin + if ParentDockControl.Children[1 - DockIndex] is TdxLayoutDockSite then + Result := ParentDockControl.Children[1 - DockIndex] as TdxLayoutDockSite + else Result := nil + end + else Result := nil; +end; + +function TdxCustomDockControl.HasAsParent(AControl: TdxCustomDockControl): Boolean; +var + AParent: TdxCustomDockControl; +begin + Result := False; + AParent := Self; + while AParent <> nil do + begin + if AParent = AControl then + begin + Result := True; + Break; + end; + AParent := AParent.ParentDockControl; + end; +end; + +function TdxCustomDockControl.GetParentDockControl: TdxCustomDockControl; +begin + Result := FParentDockControl; +end; + +function TdxCustomDockControl.GetParentForm: TCustomForm; +begin + if Owner is TCustomForm then + Result := TCustomForm(Owner) + else + Result := nil; +end; + +type + TCustomFormAccess = class(TCustomForm); + +function TdxCustomDockControl.GetParentFormActive: Boolean; +begin + Result := (ParentForm <> nil) and + (((TCustomFormAccess(ParentForm).FormStyle <> fsMDIForm) and Forms.GetParentForm(ParentForm).Active) or + ((TCustomFormAccess(ParentForm).FormStyle = fsMDIForm) and Application.Active)); +end; + +function TdxCustomDockControl.GetParentFormVisible: Boolean; +begin + Result := (ParentForm <> nil) and (ParentForm.Visible or + (fsVisible in ParentForm.FormState)); +end; + +function TdxCustomDockControl.GetTopMostDockControl: TdxCustomDockControl; +begin + if ParentDockControl <> nil then + Result := ParentDockControl.TopMostDockControl + else + Result := Self; +end; + +procedure TdxCustomDockControl.ReadAutoHidePosition(Reader: TReader); +begin + FAutoHidePosition := TdxAutoHidePosition(Reader.ReadInteger) +end; + +procedure TdxCustomDockControl.ReadDockType(Reader: TReader); +begin + SetDockType(TdxDockingType(Reader.ReadInteger)); +end; + +procedure TdxCustomDockControl.ReadOriginalWidth(Reader: TReader); +begin + FOriginalWidth := Reader.ReadInteger; +end; + +procedure TdxCustomDockControl.ReadOriginalHeight(Reader: TReader); +begin + FOriginalHeight := Reader.ReadInteger; +end; + +procedure TdxCustomDockControl.WriteAutoHidePosition(Writer: TWriter); +begin + Writer.WriteInteger(Integer(FAutoHidePosition)); +end; + +procedure TdxCustomDockControl.WriteDockType(Writer: TWriter); +begin + Writer.WriteInteger(Integer(DockType)); +end; + +procedure TdxCustomDockControl.WriteOriginalWidth(Writer: TWriter); +begin + Writer.WriteInteger(OriginalWidth); +end; + +procedure TdxCustomDockControl.WriteOriginalHeight(Writer: TWriter); +begin + Writer.WriteInteger(OriginalHeight); +end; + +procedure TdxCustomDockControl.AlignControls(AControl: TControl; var Rect: TRect); +begin + BeginUpdateNC; + try + inherited AlignControls(AControl, Rect); + finally + EndUpdateNC; + end; +end; + +procedure TdxCustomDockControl.CreateHandle; +begin + inherited; + if ParentDockControl <> nil then + ParentDockControl.UpdateDockZones; +end; + +procedure TdxCustomDockControl.CreateParams(var Params: TCreateParams); +begin + inherited; + with Params.WindowClass do + style := style and not (CS_VREDRAW or CS_HREDRAW); +end; + +procedure TdxCustomDockControl.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('AutoHidePosition', ReadAutoHidePosition, WriteAutoHidePosition, AutoHide); + Filer.DefineProperty('DockType', ReadDockType, WriteDockType, True); + Filer.DefineProperty('OriginalWidth', ReadOriginalWidth, WriteOriginalWidth, True); + Filer.DefineProperty('OriginalHeight', ReadOriginalHeight, WriteOriginalHeight, True); +end; + +procedure TdxCustomDockControl.DoEnter; +begin + if (Controller.ActiveDockControl <> Self) and + not ((Controller.ActiveDockControl <> nil) and + Controller.ActiveDockControl.HasAsParent(Self)) then + Controller.ActiveDockControl := Self; + inherited; +end; + +procedure TdxCustomDockControl.Loaded; +var + APosition: TdxAutoHidePosition; +begin + inherited; + BeginUpdateNC; + try + if AutoHide and (AutoHideHostSite <> nil) then + begin + APosition := FAutoHidePosition; + if APosition = ahpUndefined then + APosition := GetAutoHidePosition; + AutoHideHostSite.RegisterAutoHideDockControl(Self, APosition); + end; + finally + EndUpdateNC; + end; + dxDockingController.DockControlLoaded(Self); +end; + +procedure TdxCustomDockControl.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if Operation = opRemove then + begin + if AComponent = FStoredPosition.Parent then FStoredPosition.Parent := nil; + if AComponent = FStoredPosition.SiblingAfter then FStoredPosition.SiblingAfter := nil; + if AComponent = FStoredPosition.SiblingBefore then FStoredPosition.SiblingBefore := nil; + end; +end; + +procedure TdxCustomDockControl.ReadState(Reader: TReader); +begin + inherited ReadState(Reader); + if (Reader.Parent is TdxCustomDockControl) and (DockType <> dtNone) then + IncludeToDock(Reader.Parent as TdxCustomDockControl, DockType, -1); +end; + +procedure TdxCustomDockControl.SetParent(AParent: TWinControl); +begin + DoParentChanging; + inherited SetParent(AParent); + DoParentChanged; +end; + +procedure TdxCustomDockControl.VisibleChanging; +begin + DoVisibleChanging; +end; + +function TdxCustomDockControl.CanFocusEx: Boolean; +var + AParentForm: TCustomForm; +begin + AParentForm := Forms.GetParentForm(Self); + Result := CanFocus and ((AParentForm = nil) or + AParentForm.CanFocus and AParentForm.Enabled and AParentForm.Visible); +end; + +function TdxCustomDockControl.IsDockPanel: Boolean; +begin + Result := False; +end; + +function TdxCustomDockControl.IsSelected: Boolean; +begin + Result := (FDesignHelper <> nil) and FDesignHelper.IsObjectSelected(ParentForm, Self); +end; + +procedure TdxCustomDockControl.Modified; +begin + DesignController.DesignerModified(ParentForm); +end; + +procedure TdxCustomDockControl.NoSelection; +begin + if FDesignHelper <> nil then + FDesignHelper.SelectObject(ParentForm, nil); +end; + +procedure TdxCustomDockControl.SelectComponent(AComponent: TComponent); +begin + if (FDesignHelper <> nil) and not (csDestroying in AComponent.ComponentState) then + {$IFNDEF DELPHI6} + if not (AComponent is TdxCustomDockSite) or (TdxCustomDockSite(AComponent).FloatForm = nil) then + {$ENDIF} + FDesignHelper.SelectObject(ParentForm, AComponent); +end; + +function TdxCustomDockControl.UniqueName: string; +begin + if FDesignHelper <> nil then + Result := FDesignHelper.UniqueName(ClassName) + else Result := ''; +end; + +function TdxCustomDockControl.IsAncestor: Boolean; +begin + Result := csAncestor in ComponentState; +end; + +function TdxCustomDockControl.IsDesigning: Boolean; +begin + Result := csDesigning in ComponentState; +end; + +function TdxCustomDockControl.IsDestroying: Boolean; +begin + Result := (csDestroying in (Application.ComponentState + ComponentState)) or (dcisDestroyed in FInternalState); +end; + +function TdxCustomDockControl.IsLoading: Boolean; +begin + Result := csLoading in ComponentState; +end; + +procedure TdxCustomDockControl.CaptureMouse; +begin + FSavedCaptureControl := GetCaptureControl; + SetCaptureControl(Self); +end; + +procedure TdxCustomDockControl.ReleaseMouse; +begin + SetCaptureControl(FSavedCaptureControl); + FSavedCaptureControl := nil; +end; + +procedure TdxCustomDockControl.Activate; +begin + Controller.ActiveDockControl := Self; +end; + +procedure TdxCustomDockControl.CheckActiveDockControl; +begin + if Active and not IsDesigning and IsDockPanel and CanFocusEx and + not dxDockingController.IsDockControlFocusedEx(Self) then + begin + SetFocus; + SelectFirst; + end; +end; + +procedure TdxCustomDockControl.DoActiveChanged(AActive, ACallEvent: Boolean); +begin + if TabContainer <> nil then + begin + if AActive then TabContainer.ActiveChild := Self; // !!! Flag + TabContainer.InvalidateNC(False); + end; + if AutoHide and not Visible and AActive then + Visible := True; + if AActive and not dxDockingController.IsDockControlFocusedEx(Self) then + begin + SetWindowPos(PopupParent.Handle, 0{HWND_TOP}, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_NOZORDER); + CheckActiveDockControl; + end; + InvalidateCaptionArea; + + if ACallEvent and Assigned(FOnActivate) then + FOnActivate(Self, AActive); +end; + +procedure TdxCustomDockControl.DoClose; +var + ACanClose: Boolean; +begin + ACanClose := True; + if Assigned(FOnCloseQuery) then + FOnCloseQuery(Self, ACanClose); + if ACanClose then + begin + if Active then Controller.ActiveDockControl := nil; + if Assigned(FOnClose) then FOnClose(Self); + if (doFreeOnClose in ControllerOptions) then + DoDestroy + else + if (doUndockOnClose in ControllerOptions) then + UnDock + else + Visible := False; + end; +end; + +function TdxCustomDockControl.CanDestroy: Boolean; +begin + Result := not IsDesigning or (FloatDockSite = nil) or FloatDockSite.IsDestroying; +end; + +procedure TdxCustomDockControl.DoDestroy; +begin + RemoveFromLayout; + Include(FInternalState, dcisDestroyed); + Controller.RegisterDestroyedDockControl(Self); +end; + +procedure TdxCustomDockControl.ChildVisibilityChanged(Sender: TdxCustomDockControl); +begin +end; + +procedure TdxCustomDockControl.DoVisibleChanged; +begin + if Assigned(FOnVisibleChanged) then FOnVisibleChanged(Self); +end; + +procedure TdxCustomDockControl.DoVisibleChanging; +begin + if Assigned(FOnVisibleChanging) then FOnVisibleChanging(Self); +end; + +procedure TdxCustomDockControl.SetVisibility(Value: Boolean); +begin + BeginUpdateVisibility; + try + Visible := Value; + finally + EndUpdateVisibility; + end; +end; + +procedure TdxCustomDockControl.UpdateAutoHideControlsVisibility; +begin + if UpdateVisibilityLock > 0 then exit; + if (ParentDockControl <> nil) and ParentDockControl.AutoHide and + (ParentDockControl.ValidChildCount = 0) then + ParentDockControl.UpdateAutoHideControlsVisibility; + BeginUpdateVisibility; + try + if not AutoHide and (AutoHideHostSite <> nil) and Visible and StoredAutoHide then + begin + FStoredAutoHide := False; + AutoHide := True; + AutoHideHostSite.ImmediatelyShow(Self); + end + else + if AutoHide and (AutoHideHostSite <> nil) then + begin + if not Visible then + begin + BeginUpdateNC; + try + AutoHideHostSite.NCChanged; + AutoHide := False; + FStoredAutoHide := True; + SetVisibility(False); + finally + EndUpdateNC; + end; + end + else + AutoHideHostSite.ShowingControl := Self; + end; + finally + EndUpdateVisibility; + end; +end; + +procedure TdxCustomDockControl.UpdateAutoHideHostSiteVisibility; +begin + if AutoHideHostSite = nil then exit; + BeginUpdateNC; + try + if (AutoHideControl <> nil) and (AutoHideControl <> Self) then + AutoHideHostSite.NCChanged; + finally + EndUpdateNC; + end; +end; + +procedure TdxCustomDockControl.UpdateLayoutControlsVisibility; +begin + if LayoutDockSite = nil then exit; + LayoutDockSite.BeginUpdateVisibility; + try + if (Visible and not AutoHide) or (LayoutDockSite.ChildCount > 0) then + LayoutDockSite.Visible := True + else if not Visible and (LayoutDockSite.ChildCount = 0) then + LayoutDockSite.Visible := False; + finally + LayoutDockSite.EndUpdateVisibility; + end; +end; + +procedure TdxCustomDockControl.UpdateParentControlsVisibility; +begin + if ParentDockControl = nil then exit; + BeginUpdateNC; + try + NCChanged; + if not AutoHide then + ParentDockControl.NCChanged; + ParentDockControl.ChildVisibilityChanged(Self); + if not AutoHide then + ParentDockControl.UpdateLayout; + finally + EndUpdateNC; + end; +end; + +procedure TdxCustomDockControl.UpdateRelatedControlsVisibility; +begin + BeginUpdateNC; + try + BeginUpdateVisibility; + try + UpdateAutoHideHostSiteVisibility; + UpdateParentControlsVisibility; + UpdateLayoutControlsVisibility; + finally + EndUpdateVisibility; + end; + finally + EndUpdateNC; + end; +end; + +procedure TdxCustomDockControl.BeginUpdateVisibility; +begin + Inc(FUpdateVisibilityLock); +end; + +procedure TdxCustomDockControl.EndUpdateVisibility; +begin + Dec(FUpdateVisibilityLock); +end; + +function TdxCustomDockControl.CanUndock(AControl: TdxCustomDockControl): Boolean; +begin + Result := (ValidChildCount > 1) or (ParentDockControl = nil) or ParentDockControl.CanUndock(Self); +end; + +function TdxCustomDockControl.GetDockingTargetControlAtPos(pt: TPoint): TdxCustomDockControl; +begin + Result := Controller.GetDockControlAtPos(pt); + if Result = nil then + Result := Controller.GetFloatDockSiteAtPos(pt); + if Result = nil then + Result := Controller.GetNearestDockSiteAtPos(pt); +end; + +function TdxCustomDockControl.GetFloatDockRect(pt: TPoint): TRect; +begin + Result := GetDockingRect; + OffsetRect(Result, pt.X - DockingOrigin.X, pt.Y - DockingOrigin.Y); +end; + +procedure TdxCustomDockControl.DoStartDocking(pt: TPoint); +begin + if Assigned(FOnStartDocking) then + FOnStartDocking(Self, pt.X, pt.Y); +end; + +procedure TdxCustomDockControl.StartDocking(pt: TPoint); +var + R: TRect; +begin + if IsAncestor then + raise Exception.Create(sdxAncestorError); + if not Dockable or (AutoHideControl <> nil) then exit; + + DoStartDocking(pt); + Controller.FDockingDockControl := Self; + if FloatDockSite <> nil then + begin + FDockingOrigin.X := pt.X - FloatDockSite.FloatForm.Left; + FDockingOrigin.Y := pt.Y - FloatDockSite.FloatForm.Top; + end + else + begin + GetWindowRect(Handle, R); + FDockingOrigin.X := pt.X - R.Left; + if (DockingRect.Left > DockingOrigin.X) or (DockingOrigin.X > DockingRect.Right) then + FDockingOrigin.X := (DockingRect.Right - DockingRect.Left) div 2; + FDockingOrigin.Y := pt.Y - R.Top; + if (DockingRect.Top > DockingOrigin.Y) or (DockingOrigin.Y > DockingRect.Bottom) then + FDockingOrigin.Y := (DockingRect.Bottom - DockingRect.Top) div 2; + end; + Controller.StartDocking(Self, pt); + SetDockingParams(nil, pt); + CaptureMouse; +end; + +procedure TdxCustomDockControl.DoCanDocking(Source: TdxCustomDockControl; pt: TPoint; + TargetZone: TdxZone; var Accept: Boolean); +begin + if Assigned(FOnCanDocking) then + FOnCanDocking(Self, Source, TargetZone, pt.X, pt.Y, Accept); +end; + +procedure TdxCustomDockControl.DoDocking(pt: TPoint; TargetZone: TdxZone; var Accept: Boolean); +begin + if Assigned(FOnDocking) then + FOnDocking(Self, TargetZone, pt.X, pt.Y, Accept); +end; + +procedure TdxCustomDockControl.Docking(pt: TPoint); +var + AAccept: Boolean; + ATargetControl: TdxCustomDockControl; + ATargetZone: TdxZone; +begin + ATargetControl := GetDockingTargetControlAtPos(pt); + if (ATargetControl <> nil) and not (GetKeyState(VK_CONTROL) < 0) then + begin + ATargetZone := ATargetControl.GetDockZoneAtPos(Self, pt); + AAccept := True; + DoDocking(pt, ATargetZone, AAccept); + if (ATargetZone <> nil) and (ATargetZone.Owner <> nil) then + ATargetZone.Owner.DoCanDocking(Self, pt, ATargetZone, AAccept); + if not AAccept then ATargetZone := nil; + end + else + ATargetZone := nil; + SetDockingParams(ATargetZone, pt); + Perform(WM_SETCURSOR, Handle, HTCLIENT); +end; + +procedure TdxCustomDockControl.DoEndDocking(pt: TPoint); +begin + if Assigned(FOnEndDocking) then + FOnEndDocking(Self, DockingTargetZone, pt.X, pt.Y); +end; + +procedure TdxCustomDockControl.EndDocking(pt: TPoint; Cancel: Boolean); +var + ATargetZone: TdxZone; +begin + try + ATargetZone := DockingTargetZone; + ReleaseMouse; + SetDockingParams(nil, cxInvalidPoint); + Controller.EndDocking(Self, pt); + + if not Cancel then + begin + if ATargetZone <> nil then + ATargetZone.DoDock(Self) + else + if AllowFloating then + MakeFloating(pt.X - DockingOrigin.X, pt.Y - DockingOrigin.Y); + end; + DoEndDocking(pt); + finally + Controller.FDockingDockControl := nil; + end; +end; + +procedure TdxCustomDockControl.DoStartResize(pt: TPoint); +begin + if Assigned(FOnStartResizing) then + FOnStartResizing(Self, ResizingSourceZone, pt.X, pt.Y); +end; + +procedure TdxCustomDockControl.StartResize(pt: TPoint); +begin + FResizingSourceZone := GetResizeZoneAtPos(pt); + if FResizingSourceZone = nil then exit; + + DoStartResize(pt); + Controller.FResizingDockControl := Self; + FResizingOrigin := pt; + FResizingPoint := pt; + DrawResizingSelection(ResizingSourceZone, ResizingPoint, False); + CaptureMouse; +end; + +procedure TdxCustomDockControl.DoResizing(pt: TPoint); +begin + if Assigned(FOnResizing) then + FOnResizing(Self, ResizingSourceZone, pt.X, pt.Y); +end; + +procedure TdxCustomDockControl.Resizing(pt: TPoint); +begin + if ResizingSourceZone = nil then exit; + if ResizingSourceZone.CanResize(ResizingOrigin, pt) then + begin + DoResizing(pt);; + DrawResizingSelection(ResizingSourceZone, ResizingPoint, True); + FResizingPoint := pt; + DrawResizingSelection(ResizingSourceZone, ResizingPoint, False); + end; +end; + +procedure TdxCustomDockControl.DoEndResize(pt: TPoint); +begin + if Assigned(FOnEndResizing) then + FOnEndResizing(Self, ResizingSourceZone, pt.X, pt.Y); +end; + +procedure TdxCustomDockControl.EndResize(pt: TPoint; Cancel: Boolean); +begin + ReleaseMouse; + if ResizingSourceZone = nil then exit; + + DrawResizingSelection(ResizingSourceZone, ResizingPoint, True); + try + if not Cancel and (ParentDockControl <> nil) then + begin + if ResizingSourceZone.Owner.AutoHide then + begin + ResizingSourceZone.DoResize(ResizingOrigin, ResizingPoint); + if ResizingSourceZone.Owner.AutoHideHostSite <> nil then + ResizingSourceZone.Owner.AutoHideHostSite.SetFinalPosition(ResizingSourceZone.Owner); + end + else + begin + BeginUpdateNC; + try + ParentDockControl.NCChanged; + ResizingSourceZone.DoResize(ResizingOrigin, ResizingPoint); + finally + EndUpdateNC; + end; + end; + end; + DoEndResize(pt); + finally + Controller.FResizingDockControl := nil; + Perform(WM_SETCURSOR, Handle, HTCLIENT); + end; +end; + +function TdxCustomDockControl.CanDock: Boolean; +begin + Result := False; +end; + +function TdxCustomDockControl.CanDockHost(AControl: TdxCustomDockControl; AType: TdxDockingType): Boolean; +begin + Result := (AControl.ParentForm = ParentForm) and not HasAsParent(AControl); + Result := Result and AControl.CanDock; + Result := Result and (AType in AControl.AllowDock); + Result := Result and (AType in AllowDockClients); + Result := Result and (AutoHideControl = nil); +end; + +function TdxCustomDockControl.CanMaximize: Boolean; +begin + Result := False; +end; + +procedure TdxCustomDockControl.CreateContainerLayout(AContainer: TdxContainerDockSite; + AControl: TdxCustomDockControl; AType: TdxDockingType; Index: Integer); +begin + if AContainer <> nil then + begin + AContainer.BeginUpdateLayout; + try + if AType = AContainer.GetTailDockType then Inc(Index); + AContainer.CreateLayout(AControl, AType, Index); + finally + AContainer.EndUpdateLayout; + end; + end; +end; + +function TdxCustomDockControl.GetContainer: TdxContainerDockSite; +begin + if ParentDockControl is TdxContainerDockSite then + Result := ParentDockControl as TdxContainerDockSite + else Result := nil; +end; + +procedure TdxCustomDockControl.AssignSideContainerSiteProperties(ASite: TdxSideContainerDockSite); +var + AProperties: TdxCustomDockControlProperties; +begin + AProperties := Controller.DefaultVertContainerSiteProperties(ParentForm); + if (ASite is TdxVertContainerDockSite) and (AProperties <> nil) then + AProperties.AssignTo(ASite); + AProperties := Controller.DefaultHorizContainerSiteProperties(ParentForm); + if (ASite is TdxHorizContainerDockSite) and (AProperties <> nil) then + AProperties.AssignTo(ASite); +end; + +function TdxCustomDockControl.CanAcceptSideContainerItems(AContainer: TdxSideContainerDockSite): Boolean; +begin + Result := False; +end; + +procedure TdxCustomDockControl.DoCreateSideContainerSite(ASite: TdxSideContainerDockSite); +begin + AssignSideContainerSiteProperties(ASite); + if Assigned(FOnCreateSideContainer) then + FOnCreateSideContainer(Self, ASite); + Controller.DoCreateSideContainerSite(Self, ASite); +end; + +procedure TdxCustomDockControl.CreateSideContainerLayout(AControl: TdxCustomDockControl; + AType: TdxDockingType; Index: Integer); +var + AIndex: Integer; + AContainerClass: TdxSideContainerDockSiteClass; + AContainerSite: TdxSideContainerDockSite; + AParentControl: TdxCustomDockControl; +begin + case AType of + dtleft, dtRight: AContainerClass := TdxHorizContainerDockSite; + dtTop, dtBottom: AContainerClass := TdxVertContainerDockSite; + else + AContainerClass := nil; + Assert(False, Format(sdxInternalErrorCreateLayout, [TdxSideContainerDockSite.ClassName])); + end; + AIndex := DockIndex; + AParentControl := ParentDockControl; + AParentControl.BeginUpdateLayout; + try + ExcludeFromDock; + AContainerSite := AContainerClass.Create(Owner); + AContainerSite.Name := AContainerSite.UniqueName; + AContainerSite.AdjustControlBounds(Self); + AContainerSite.BeginUpdateLayout; + try + AContainerSite.IncludeToDock(AParentControl, DockType, AIndex); + IncludeToDock(AContainerSite, dtTop, 0); + if Index = -1 then + begin + if AType = AContainerSite.GetHeadDockType then + AControl.IncludeToDock(AContainerSite, AContainerSite.GetHeadDockType, 0) + else AControl.IncludeToDock(AContainerSite, AContainerSite.GetTailDockType, 1); + end + else AControl.IncludeToDock(AContainerSite, AContainerSite.GetHeadDockType, Index); + AContainerSite.AdjustChildrenBounds(AControl); + finally + AContainerSite.EndUpdateLayout; + end; + finally + AParentControl.EndUpdateLayout; + end; + DoCreateSideContainerSite(AContainerSite); +end; + +procedure TdxCustomDockControl.DoMaximize; +begin + if SideContainer <> nil then + begin + if (SideContainer.ActiveChild <> nil) and + (SideContainer.ActiveChildIndex = SideContainerIndex) then + SideContainer.ActiveChild := nil + else SideContainer.ActiveChild := + SideContainer.Children[SideContainerIndex]; + end; +end; + +function TdxCustomDockControl.GetSideContainer: TdxSideContainerDockSite; +begin + if Container is TdxSideContainerDockSite then + Result := Container as TdxSideContainerDockSite + else + if TabContainer <> nil then + Result := TabContainer.GetSideContainer + else + Result := nil; +end; + +function TdxCustomDockControl.GetSideContainerItem: TdxCustomDockControl; +begin + if Container is TdxSideContainerDockSite then + Result := Self + else if (TabContainer <> nil) and (TabContainer.SideContainer <> nil) then + Result := TabContainer + else Result := nil; +end; + +function TdxCustomDockControl.GetSideContainerIndex: Integer; +begin + if SideContainerItem <> nil then + Result := SideContainerItem.DockIndex + else Result := -1; +end; + +procedure TdxCustomDockControl.AssignTabContainerSiteProperies(ASite: TdxTabContainerDockSite); +var + AProperties: TdxCustomDockControlProperties; +begin + AProperties := Controller.DefaultTabContainerSiteProperties(ParentForm); + if AProperties <> nil then + AProperties.AssignTo(ASite); +end; + +function TdxCustomDockControl.CanAcceptTabContainerItems(AContainer: TdxTabContainerDockSite): Boolean; +begin + Result := False; +end; + +procedure TdxCustomDockControl.DoCreateTabContainerSite(ASite: TdxTabContainerDockSite); +begin + AssignTabContainerSiteProperies(ASite); + if Assigned(FOnCreateTabContainer) then + FOnCreateTabContainer(Self, ASite); + Controller.DoCreateTabContainerSite(Self, ASite); +end; + +procedure TdxCustomDockControl.CreateTabContainerLayout(AControl: TdxCustomDockControl; + AType: TdxDockingType; Index: Integer); +var + AIndex: Integer; + AContainerSite: TdxTabContainerDockSite; + AParentControl: TdxCustomDockControl; +begin + AIndex := DockIndex; + AParentControl := ParentDockControl; + AParentControl.BeginUpdateLayout; + try + ExcludeFromDock; + AContainerSite := TdxTabContainerDockSite.Create(Owner); + AContainerSite.Name := AContainerSite.UniqueName; + AContainerSite.BeginUpdateLayout; + try + AContainerSite.AdjustControlBounds(Self); + AContainerSite.IncludeToDock(AParentControl, DockType, AIndex); + IncludeToDock(AContainerSite, dtClient, 0); + AControl.IncludeToDock(AContainerSite, dtClient, Index); + finally + AContainerSite.EndUpdateLayout; + end; + finally + AParentControl.EndUpdateLayout; + end; + DoCreateTabContainerSite(AContainerSite); +end; + +function TdxCustomDockControl.GetTabWidth(ACanvas: TCanvas): Integer; +var + ASize: TSize; +begin + cxGetTextExtentPoint32(ACanvas.Handle, Caption, ASize); + Result := Painter.GetTabHorizInterval + ASize.cx + Painter.GetTabHorizInterval; + if (Painter.GetImageWidth > 0) and Painter.IsValidImageIndex(ImageIndex) then + Result := Result + Painter.GetImageWidth + 2 * Painter.GetTabHorizInterval; +end; + +function TdxCustomDockControl.GetTabContainer: TdxTabContainerDockSite; +begin + if Container is TdxTabContainerDockSite then + Result := Container as TdxTabContainerDockSite + else Result := nil; +end; + +function TdxCustomDockControl.CanActive: Boolean; +begin + Result := False; +end; + +function TdxCustomDockControl.CanAutoHide: Boolean; +begin + Result := False; +end; + +procedure TdxCustomDockControl.ChangeAutoHide; +begin + if IsAncestor then + raise Exception.Create(sdxAncestorError); + AutoHide := not AutoHide; +end; + +function TdxCustomDockControl.GetAutoSizeHostSite: TdxDockSite; +begin + if (ParentDockControl is TdxDockSite) and (ParentDockControl as TdxDockSite).AutoSize then + Result := ParentDockControl as TdxDockSite + else + Result := nil; +end; + +procedure TdxCustomDockControl.DoAutoHideChanged; +begin + BeginUpdateNC; + try + if AutoHide and not (doImmediatelyHideOnAutoHide in ControllerOptions) then + AutoHideHostSite.ImmediatelyShow(Self); + if not Visible then + UpdateRelatedControlsVisibility; + finally + EndUpdateNC; + end; + if Assigned(FOnAutoHideChanged) then + FOnAutoHideChanged(Self); +end; + +procedure TdxCustomDockControl.DoAutoHideChanging; +begin + if Assigned(FOnAutoHideChanging) then + FOnAutoHideChanging(Self); +end; + +procedure TdxCustomDockControl.AutoHideChanged; +begin + if IsLoading or (AutoHideHostSite = nil) then exit; + + BeginUpdateNC; + try + DoAutoHideChanging; + AutoHideHostSite.NCChanged; + + ParentDockControl.BeginUpdateLayout; + try + if AutoHide then + begin + AutoHideHostSite.RegisterAutoHideDockControl(Self, GetAutoHidePosition); + Controller.ActiveDockControl := nil; + end + else + begin + AutoHideHostSite.UnregisterAutoHideDockControl(Self); + Activate; + end; + UpdateResizeZones; + UpdateDockZones; + finally + ParentDockControl.EndUpdateLayout; + end; + DoAutoHideChanged; + finally + EndUpdateNC; + end; +end; + +function TdxCustomDockControl.GetAutoHidePosition: TdxAutoHidePosition; +begin + if AutoSizeHostSite <> nil then + Result := AutoSizeHostSite.GetControlAutoHidePosition(Self) + else + if SideContainer <> nil then + Result := SideContainer.GetControlAutoHidePosition(Self) + else + if TabContainer <> nil then + Result := TabContainer.GetControlAutoHidePosition(Self) + else + Result := GetControlAutoHidePosition(Self); + if Assigned(FOnGetAutoHidePosition) then + FOnGetAutoHidePosition(Self, Result); +end; + +function TdxCustomDockControl.GetControlAutoHidePosition(AControl: TdxCustomDockControl): TdxAutoHidePosition; +var + ARect, AHostRect: TRect; +begin + if AutoSizeHostSite <> nil then + Result := AutoSizeHostSite.GetControlAutoHidePosition(AControl) + else + case AControl.DockType of + dtLeft: Result := ahpLeft; + dtTop: Result := ahpTop; + dtRight: Result := ahpRight; + dtBottom: Result := ahpBottom; + else + if AControl.HandleAllocated then + begin + GetWindowRect(AControl.Handle, ARect); + GetWindowRect(AutoHideHostSite.Handle, AHostRect); + if AControl.Width > AControl.Height then + begin + if ARect.Top - AHostRect.Top <= AHostRect.Bottom - ARect.Bottom then + Result := ahpTop + else + Result := ahpBottom; + end + else + begin + if ARect.Left - AHostRect.Left <= AHostRect.Right - ARect.Right then + Result := ahpLeft + else + Result := ahpRight; + end; + end + else + Result := ahpLeft; + end; +end; + +function TdxCustomDockControl.GetAutoHideHostSite: TdxDockSite; +begin + if TopMostDockControl is TdxDockSite then + Result := TopMostDockControl as TdxDockSite + else + Result := nil; +end; + +function TdxCustomDockControl.GetAutoHideContainer: TdxDockSiteAutoHideContainer; +begin + if Parent is TdxDockSiteAutoHideContainer then + Result := Parent as TdxDockSiteAutoHideContainer + else Result := nil; +end; + +function TdxCustomDockControl.GetAutoHideControl: TdxCustomDockControl; +var + AControl: TdxCustomDockControl; +begin + Result := nil; + AControl := Self; + while AControl <> nil do + begin + if AControl.AutoHide then + begin + Result := AControl; + Break; + end; + AControl := AControl.ParentDockControl; + end; +end; + +procedure TdxCustomDockControl.DoParentChanged; +begin + if not IsLoading and Assigned(FOnParentChanged) then + FOnParentChanged(Self); +end; + +procedure TdxCustomDockControl.DoParentChanging; +begin + if not IsLoading and Assigned(FOnParentChanging) then + FOnParentChanging(Self); +end; + +procedure TdxCustomDockControl.UpdateState; +begin + if ParentDockControl is TdxTabContainerDockSite then + begin + if (TdxTabContainerDockSite(ParentDockControl).ActiveChild = Self) or + AutoHide then + Enabled := True + else + Enabled := False; + end + else + Enabled := True; +end; + +procedure TdxCustomDockControl.IncludeToDock(AControl: TdxCustomDockControl; AType: TdxDockingType; + Index: Integer); +begin + if IsLoading then + begin + BeginUpdateLayout; + try + SetDockType(AType); + SetParentDockControl(AControl); + ParentDockControl.AddDockControl(Self, Index); + UpdateCaption; + finally + EndUpdateLayout(False); + end; + end + else + begin + BeginUpdateLayout; + try + AControl.NCChanged; + SetDockType(AType); + SetParentDockControl(AControl); + ParentDockControl.AddDockControl(Self, Index); + UpdateOriginalSize; + UpdateCaption; + AControl.DoLayoutChanged; + finally + EndUpdateLayout; + end; + end; +end; + +procedure TdxCustomDockControl.ExcludeFromDock; +var + AControl: TdxCustomDockControl; +begin + BeginUpdateLayout; + try + AControl := ParentDockControl; +// AControl.NCChanged; + SetParentDockControl(nil); + ClearDockType; + AControl.RemoveDockControl(Self); + if AControl.IsNeeded then + AControl.NCChanged; + + AdjustControlBounds(Self); + ClearZones(DockZones); + ClearZones(ResizeZones); + AControl.DoLayoutChanged; + finally + EndUpdateLayout; + end; +end; + +procedure TdxCustomDockControl.AdjustControlBounds(AControl: TdxCustomDockControl); +begin + Width := AControl.OriginalWidth; + Height := AControl.OriginalHeight; + FOriginalWidth := AControl.OriginalWidth; + FOriginalHeight := AControl.OriginalHeight; +end; + +procedure TdxCustomDockControl.SetSize(AWidth, AHeight: Integer); +begin + case Align of + alBottom: SetBounds(Left, Top - (AHeight - Height), AWidth, AHeight); + alRight: SetBounds(Left - (AWidth - Width), Top, AWidth, AHeight); + else + SetBounds(Left, Top, AWidth, AHeight); + end; +end; + +procedure TdxCustomDockControl.CreateLayout(AControl: TdxCustomDockControl; + AType: TdxDockingType; Index: Integer); +var + AParentSite, ASite1, ASite2: TdxCustomDockControl; +begin + case ChildCount of + 0: begin + ASite1 := TdxLayoutDockSite.Create(Owner); + ASite1.Name := ASite1.UniqueName; + ASite1.IncludeToDock(Self, dtClient, 0); + AControl.IncludeToDock(Self, AType, 1); + DoCreateLayoutSite(ASite1 as TdxLayoutDockSite); + end; + 2: begin + ASite1 := Children[0]; + ASite2 := Children[1]; + ASite1.ExcludeFromDock; + ASite2.ExcludeFromDock; + AParentSite := TdxLayoutDockSite.Create(Owner); + AParentSite.Name := AParentSite.UniqueName; + AParentSite.IncludeToDock(Self, dtClient, 0); + ASite1.IncludeToDock(AParentSite, ASite1.DockType, 0); + ASite2.IncludeToDock(AParentSite, ASite2.DockType, 1); + AControl.IncludeToDock(Self, AType, 1); + DoCreateLayoutSite(AParentSite as TdxLayoutDockSite); + end; + else + Assert(False, Format(sdxInternalErrorCreateLayout, [TdxCustomDockControl.ClassName])); + end; +end; + +procedure TdxCustomDockControl.DestroyChildLayout; +var + ADummySite: TdxCustomDockControl; + ASite1, ASite2: TdxCustomDockControl; +begin + ADummySite := Children[0]; + Include(ADummySite.FInternalState, dcisDestroying); + case ADummySite.ChildCount of + 0: ADummySite.ExcludeFromDock; + 2: begin + ASite1 := ADummySite.Children[0]; + ASite2 := ADummySite.Children[1]; + ASite1.ExcludeFromDock; + ASite2.ExcludeFromDock; + ADummySite.ExcludeFromDock; + ASite1.IncludeToDock(Self, ASite1.DockType, 0); + ASite2.IncludeToDock(Self, ASite2.DockType, 1); + end + else + Assert(False, Format(sdxInternalErrorDestroyLayout, [ClassName])); + end; + ADummySite.DoDestroy; +end; + +procedure TdxCustomDockControl.DestroyLayout(AControl: TdxCustomDockControl); +begin + AControl.ExcludeFromDock; + if ChildCount = 1 then + DestroyChildLayout; +end; + +procedure TdxCustomDockControl.RemoveFromLayout; +begin + if AutoHide and (AutoHideHostSite <> nil) and not AutoHideHostSite.IsDestroying then + AutoHide := False; + if ParentDockControl <> nil then + begin + if not ParentDockControl.IsDestroying then + UnDock + else + ParentDockControl.RemoveDockControl(Self); + end; + +// if (ParentDockControl <> nil) and not ParentDockControl.IsDestroying then +// UnDock; + ClearChildrenParentDockControl; +end; + +procedure TdxCustomDockControl.UpdateLayout; +begin + UpdateRelatedControlsVisibility; + UpdateDockZones; + UpdateResizeZones; + UpdateState; +end; + +function TdxCustomDockControl.GetMinimizedHeight: Integer; +begin + if not HasCaption then + Result := 28 + else if IsCaptionVertical then + Result := 2 * Painter.GetBorderWidth + 6 * Painter.GetCaptionHorizInterval + + 3 * Painter.GetCaptionButtonSize + else Result := Painter.GetCaptionHeight + 2 * Painter.GetBorderWidth; +end; + +function TdxCustomDockControl.GetMinimizedWidth: Integer; +begin + if not HasCaption then + Result := 58 + else if IsCaptionVertical then + Result := Painter.GetCaptionHeight + 2 * Painter.GetBorderWidth + else Result := 2 * Painter.GetBorderWidth + 6 * Painter.GetCaptionHorizInterval + + 3 * Painter.GetCaptionButtonSize; +end; + +procedure TdxCustomDockControl.UpdateControlOriginalSize(AControl: TdxCustomDockControl); +var + AHideBar: TdxDockSiteHideBar; +begin + if AControl.AutoHide and (AControl.AutoHideHostSite <> nil) {and + (AControl.AutoHideHostSite.ShowingControl = AControl) }then + begin + AHideBar := AutoHideHostSite.GetHideBarByControl(AControl); + if AHideBar <> nil then + case AHideBar.Position of + ahpLeft, ahpRight: AControl.FOriginalWidth := Width; + ahpTop, ahpBottom: AControl.FOriginalHeight := Height; + end; + end + else case DockType of + dtLeft, dtRight: + AControl.FOriginalWidth := Width; + dtTop, dtBottom: + AControl.FOriginalHeight := Height; + dtClient: ; + else + AControl.FOriginalWidth := Width; + AControl.FOriginalHeight := Height; + end; +end; + +procedure TdxCustomDockControl.UpdateOriginalSize; +begin + if IsLoading or not Visible then exit; + if FloatDockSite <> nil then + FloatDockSite.UpdateControlOriginalSize(Self) + else if AutoHideControl <> nil then + AutoHideControl.UpdateControlOriginalSize(Self) + else if AutoSizeHostSite <> nil then + AutoSizeHostSite.UpdateControlOriginalSize(Self) + else if SideContainer <> nil then + SideContainer.UpdateControlOriginalSize(Self) + else if TabContainer <> nil then + TabContainer.UpdateControlOriginalSize(Self) + else UpdateControlOriginalSize(Self); +end; + +procedure TdxCustomDockControl.DoUpdateDockZones; +begin + if Assigned(FOnUpdateDockZones) then + FOnUpdateDockZones(Self, DockZones); + Controller.DoUpdateDockZones(Self); +end; + +procedure TdxCustomDockControl.UpdateControlDockZones(AControl: TdxCustomDockControl; AZoneWidth: Integer); +begin + if TdxLeftZone.ValidateDockZone(Self, AControl) then + AControl.DockZones.Insert(0, TdxLeftZone.Create(Self, AZoneWidth, zkDocking)); + if TdxRightZone.ValidateDockZone(Self, AControl) then + AControl.DockZones.Insert(0, TdxRightZone.Create(Self, AZoneWidth, zkDocking)); + if TdxTopZone.ValidateDockZone(Self, AControl) then + AControl.DockZones.Insert(0, TdxTopZone.Create(Self, AZoneWidth, zkDocking)); + if TdxBottomZone.ValidateDockZone(Self, AControl) then + AControl.DockZones.Insert(0, TdxBottomZone.Create(Self, AZoneWidth, zkDocking)); +end; + +procedure TdxCustomDockControl.UpdateDockZones; +var + I: Integer; + AControl: TdxCustomDockControl; + AZoneLevel, AZoneWidth: Integer; +begin + if IsDestroying then exit; + ClearZones(DockZones); + AZoneLevel := DockLevel; + AZoneWidth := ControllerDockZonesWidth; + AControl := Self; + while True do + begin + AControl.UpdateControlDockZones(Self, AZoneWidth); + AControl := AControl.ParentDockControl; + if AControl = nil then break; + AZoneWidth := AZoneWidth - ControllerDockZonesWidth div AZoneLevel; + end; + DoUpdateDockZones; + for I := 0 to ChildCount - 1 do + Children[I].UpdateDockZones; +end; + +procedure TdxCustomDockControl.DoUpdateResizeZones; +begin + if Assigned(FOnUpdateResizeZones) then + FOnUpdateResizeZones(Self, FResizeZones); + Controller.DoUpdateResizeZones(Self); +end; + +procedure TdxCustomDockControl.UpdateControlResizeZones(AControl: TdxCustomDockControl); +begin + if AControl.AutoHide and (AControl.AutoHideHostSite <> nil) then + begin + if TdxAutoHideRightZone.ValidateResizeZone(Self, AControl) then + AControl.ResizeZones.Insert(0, TdxAutoHideRightZone.Create(Self, ControllerResizeZonesWidth, zkResizing)); + if TdxAutoHideLeftZone.ValidateResizeZone(Self, AControl) then + AControl.ResizeZones.Insert(0, TdxAutoHideLeftZone.Create(Self, ControllerResizeZonesWidth, zkResizing)); + if TdxAutoHideBottomZone.ValidateResizeZone(Self, AControl) then + AControl.ResizeZones.Insert(0, TdxAutoHideBottomZone.Create(Self, ControllerResizeZonesWidth, zkResizing)); + if TdxAutoHideTopZone.ValidateResizeZone(Self, AControl) then + AControl.ResizeZones.Insert(0, TdxAutoHideTopZone.Create(Self, ControllerResizeZonesWidth, zkResizing)); + end + else + begin + if TdxRightZone.ValidateResizeZone(Self, AControl) then + AControl.ResizeZones.Insert(0, TdxRightZone.Create(Self, ControllerResizeZonesWidth, zkResizing)); + if TdxLeftZone.ValidateResizeZone(Self, AControl) then + AControl.ResizeZones.Insert(0, TdxLeftZone.Create(Self, ControllerResizeZonesWidth, zkResizing)); + if TdxBottomZone.ValidateResizeZone(Self, AControl) then + AControl.ResizeZones.Insert(0, TdxBottomZone.Create(Self, ControllerResizeZonesWidth, zkResizing)); + if TdxTopZone.ValidateResizeZone(Self, AControl) then + AControl.ResizeZones.Insert(0, TdxTopZone.Create(Self, ControllerResizeZonesWidth, zkResizing)); + end; +end; + +procedure TdxCustomDockControl.UpdateResizeZones; +var + I: Integer; +begin + ClearZones(ResizeZones); + if AutoHideControl <> nil then + AutoHideControl.UpdateControlResizeZones(Self) + else if AutoSizeHostSite <> nil then + AutoSizeHostSite.UpdateControlResizeZones(Self) + else if SideContainer <> nil then + SideContainer.UpdateControlResizeZones(Self) + else if TabContainer <> nil then + TabContainer.UpdateControlResizeZones(Self) + else UpdateControlResizeZones(Self); + DoUpdateResizeZones; + for I := 0 to ChildCount - 1 do + Children[I].UpdateResizeZones; +end; + +procedure TdxCustomDockControl.AssignFloatSiteProperties(ASite: TdxFloatDockSite); +var + AProperties: TdxCustomDockControlProperties; +begin + AProperties := Controller.DefaultFloatSiteProperties(ParentForm); + if AProperties <> nil then + AProperties.AssignTo(ASite); +end; + +procedure TdxCustomDockControl.DoCreateFloatSite(ASite: TdxFloatDockSite); +begin + AssignFloatSiteProperties(ASite); + if Assigned(FOnCreateFloatSite) then + FOnCreateFloatSite(Self, ASite); + Controller.DoCreateFloatSite(Self, ASite); +end; + +procedure TdxCustomDockControl.UpdateCaption; +begin + if Container <> nil then + Container.UpdateCaption + else if FloatDockSite <> nil then + FloatDockSite.UpdateCaption; +end; + +function TdxCustomDockControl.ControllerAutoHideInterval: Integer; +begin + Result := Controller.AutoHideInterval(ParentForm); +end; + +function TdxCustomDockControl.ControllerAutoHideMovingInterval: Integer; +begin + Result := Controller.AutoHideMovingInterval(ParentForm); +end; + +function TdxCustomDockControl.ControllerAutoHideMovingSize: Integer; +begin + Result := Controller.AutoHideMovingSize(ParentForm); +end; + +function TdxCustomDockControl.ControllerAutoShowInterval: Integer; +begin + Result := Controller.AutoShowInterval(ParentForm); +end; + +function TdxCustomDockControl.ControllerColor: TColor; +begin + Result := Controller.Color(ParentForm); +end; + +function TdxCustomDockControl.ControllerDockZonesWidth: Integer; +begin + Result := Controller.DockZonesWidth(ParentForm); +end; + +function TdxCustomDockControl.ControllerFont: TFont; +begin + Result := Controller.Font(ParentForm); +end; + +function TdxCustomDockControl.ControllerImages: TCustomImageList; +begin + Result := Controller.Images(ParentForm); +end; + +function TdxCustomDockControl.ControllerOptions: TdxDockingOptions; +begin + Result := Controller.Options(ParentForm); +end; + +function TdxCustomDockControl.ControllerViewStyle: TdxDockingViewStyle; +begin + Result := Controller.ViewStyle(ParentForm); +end; + +function TdxCustomDockControl.ControllerResizeZonesWidth: Integer; +begin + Result := Controller.ResizeZonesWidth(ParentForm); +end; + +function TdxCustomDockControl.ControllerSelectionFrameWidth: Integer; +begin + Result := Controller.SelectionFrameWidth(ParentForm); +end; + +function TdxCustomDockControl.ControllerTabsScrollInterval: Integer; +begin + Result := Controller.TabsScrollInterval(ParentForm); +end; + +procedure TdxCustomDockControl.CheckTempCanvas(ARect: TRect); +begin + Controller.CheckTempBitmap(ARect); +end; + +function TdxCustomDockControl.ClientToWindow(pt: TPoint): TPoint; +var + Rect: TRect; +begin + pt := ClientToScreen(pt); + GetWindowRect(Handle, Rect); + Result.X := pt.X - Rect.Left; + Result.Y := pt.Y - Rect.Top; +end; + +function TdxCustomDockControl.ScreenToWindow(pt: TPoint): TPoint; +var + Rect: TRect; +begin + GetWindowRect(Handle, Rect); + Result.X := pt.X - Rect.Left; + Result.Y := pt.Y - Rect.Top; +end; + +function TdxCustomDockControl.WindowRectToClient(const R: TRect): TRect; +begin + Result := R; + with ClientToWindow(cxNullPoint) do + OffsetRect(Result, -X, -Y); +end; + +function TdxCustomDockControl.WindowToClient(pt: TPoint): TPoint; +var + Rect: TRect; +begin + GetWindowRect(Handle, Rect); + Result.X := Rect.Left + pt.X; + Result.Y := Rect.Top + pt.Y; + Result := ScreenToClient(Result); +end; + +function TdxCustomDockControl.WindowToScreen(pt: TPoint): TPoint; +var + Rect: TRect; +begin + GetWindowRect(Handle, Rect); + Result.X := pt.X + Rect.Left; + Result.Y := pt.Y + Rect.Top; +end; + +procedure TdxCustomDockControl.CalculateNC(var ARect: TRect); +var + APos, ACaptionSeparatorSize: Integer; +begin + if HasBorder then + InflateRect(ARect, -Painter.GetBorderWidth, -Painter.GetBorderWidth); + if HasCaption then + begin + SetRectEmpty(FCaptionSeparatorRect); + FCaptionRect := Painter.GetCaptionRect(ARect, IsCaptionVertical); + if IsCaptionVertical then + begin + APos := FCaptionRect.Top + 2 * Painter.GetCaptionHorizInterval; + if HasCaptionCloseButton then + begin + FCaptionCloseButtonRect.Left := FCaptionRect.Left + ((FCaptionRect.Right - FCaptionRect.Left) - + Painter.GetCaptionButtonSize) div 2; + FCaptionCloseButtonRect.Right := FCaptionCloseButtonRect.Left + Painter.GetCaptionButtonSize; + FCaptionCloseButtonRect.Top := APos; + FCaptionCloseButtonRect.Bottom := FCaptionCloseButtonRect.Top + Painter.GetCaptionButtonSize; + APos := FCaptionCloseButtonRect.Bottom + Painter.GetCaptionHorizInterval; + end; + if HasCaptionHideButton then + begin + FCaptionHideButtonRect.Left := FCaptionRect.Left + ((FCaptionRect.Right - FCaptionRect.Left) - + Painter.GetCaptionButtonSize) div 2; + FCaptionHideButtonRect.Right := FCaptionHideButtonRect.Left + Painter.GetCaptionButtonSize; + FCaptionHideButtonRect.Top := APos; + FCaptionHideButtonRect.Bottom := FCaptionHideButtonRect.Top + Painter.GetCaptionButtonSize; + APos := FCaptionHideButtonRect.Bottom + Painter.GetCaptionHorizInterval; + end; + if HasCaptionMaximizeButton then + begin + FCaptionMaximizeButtonRect.Left := FCaptionRect.Left + ((FCaptionRect.Right - FCaptionRect.Left) - + Painter.GetCaptionButtonSize) div 2; + FCaptionMaximizeButtonRect.Right := FCaptionMaximizeButtonRect.Left + Painter.GetCaptionButtonSize; + FCaptionMaximizeButtonRect.Top := APos; + FCaptionMaximizeButtonRect.Bottom := FCaptionMaximizeButtonRect.Top + Painter.GetCaptionButtonSize; + APos := FCaptionMaximizeButtonRect.Bottom + Painter.GetCaptionHorizInterval; + end; + FCaptionTextRect := FCaptionRect; + FCaptionTextRect.Bottom := FCaptionTextRect.Bottom - 2 * Painter.GetCaptionHorizInterval; + FCaptionTextRect.Top := APos; + + ARect.Left := FCaptionRect.Right; + ACaptionSeparatorSize := Min(ARect.Right - ARect.Left, Painter.GetBorderWidth); + FCaptionSeparatorRect := Rect(ARect.Left, ARect.Top, ARect.Left + ACaptionSeparatorSize, ARect.Bottom); + ARect.Left := FCaptionSeparatorRect.Right; + end + else + begin + APos := FCaptionRect.Right - 2 * Painter.GetCaptionHorizInterval; + if HasCaptionCloseButton then + begin + FCaptionCloseButtonRect.Top := FCaptionRect.Top + ((FCaptionRect.Bottom - FCaptionRect.Top) - + Painter.GetCaptionButtonSize) div 2; + FCaptionCloseButtonRect.Bottom := FCaptionCloseButtonRect.Top + Painter.GetCaptionButtonSize; + FCaptionCloseButtonRect.Right := APos; + FCaptionCloseButtonRect.Left := FCaptionCloseButtonRect.Right - Painter.GetCaptionButtonSize; + APos := FCaptionCloseButtonRect.Left - Painter.GetCaptionHorizInterval; + end; + if HasCaptionHideButton then + begin + FCaptionHideButtonRect.Top := FCaptionRect.Top + ((FCaptionRect.Bottom - FCaptionRect.Top) - + Painter.GetCaptionButtonSize) div 2; + FCaptionHideButtonRect.Bottom := FCaptionHideButtonRect.Top + Painter.GetCaptionButtonSize; + FCaptionHideButtonRect.Right := APos; + FCaptionHideButtonRect.Left := FCaptionHideButtonRect.Right - Painter.GetCaptionButtonSize; + APos := FCaptionHideButtonRect.Left - Painter.GetCaptionHorizInterval; + end; + if HasCaptionMaximizeButton then + begin + FCaptionMaximizeButtonRect.Top := FCaptionRect.Top + ((FCaptionRect.Bottom - FCaptionRect.Top) - + Painter.GetCaptionButtonSize) div 2; + FCaptionMaximizeButtonRect.Bottom := FCaptionMaximizeButtonRect.Top + Painter.GetCaptionButtonSize; + FCaptionMaximizeButtonRect.Right := APos; + FCaptionMaximizeButtonRect.Left := FCaptionMaximizeButtonRect.Right - Painter.GetCaptionButtonSize; + APos := FCaptionMaximizeButtonRect.Left - Painter.GetCaptionHorizInterval; + end; + FCaptionTextRect := FCaptionRect; + FCaptionTextRect.Left := FCaptionTextRect.Left + 2 * Painter.GetCaptionHorizInterval; + FCaptionTextRect.Right := APos; + + ARect.Top := FCaptionRect.Bottom; + ACaptionSeparatorSize := Min(ARect.Bottom - ARect.Top, Painter.GetBorderWidth); + FCaptionSeparatorRect := Rect(ARect.Left, ARect.Top, ARect.Right, ARect.Top + ACaptionSeparatorSize); + ARect.Top := FCaptionSeparatorRect.Bottom; + end; + end; +end; + +procedure TdxCustomDockControl.InvalidateCaptionArea; +var + DC: HDC; + ACanvas: TCanvas; +begin + if HandleAllocated and CanUpdateNC and not IsInternalDestroying then + begin + DC := GetWindowDC(Handle); + try + ACanvas := TCanvas.Create; + try + ACanvas.Handle := DC; + NCPaintCaption(ACanvas); + finally + ACanvas.Free; + end; + finally + ReleaseDC(Handle, DC); + end; + end + else + InvalidateNC(False); +end; + +procedure TdxCustomDockControl.InvalidateNC(ANeedRecalculate: Boolean); +var + R: TRect; +begin + if HandleAllocated and not IsInternalDestroying then + begin + if ANeedRecalculate then + begin + R := WindowRect; + CalculateNC(R); + end; + if CanUpdateNC then + Perform(WM_NCPAINT, 0, 0); + end; +end; + +procedure TdxCustomDockControl.NCChanged(AImmediately: Boolean = False); +begin + FRecalculateNCNeeded := AImmediately; + if HandleAllocated and not IsInternalDestroying and (FRecalculateNCNeeded or CanCalculateNC) then + begin + Include(FInternalState, dcisFrameChanged); + try + SetWindowPos(Handle, 0, 0, 0, 0, 0, SWP_NOZORDER or SWP_NOMOVE or SWP_NOSIZE or + SWP_NOACTIVATE or SWP_FRAMECHANGED); + finally + Exclude(FInternalState, dcisFrameChanged); + end; + end; +end; + +procedure TdxCustomDockControl.Recalculate; +begin + NCChanged; +end; + +procedure TdxCustomDockControl.Redraw(AWithChildren: Boolean); +const + AFlagMap: array [Boolean] of DWORD = (RDW_FRAME or RDW_INVALIDATE, RDW_FRAME or RDW_INVALIDATE or RDW_ALLCHILDREN or RDW_ERASE); +begin + if HandleAllocated and not IsInternalDestroying then + RedrawWindow(Handle, nil, 0, AFlagMap[AWithChildren]); +end; + +procedure TdxCustomDockControl.BeginUpdateNC(ALockRedraw: Boolean); +begin + Controller.BeginUpdateNC(ALockRedraw); +end; + +procedure TdxCustomDockControl.EndUpdateNC; +begin + Controller.EndUpdateNC; +end; + +function TdxCustomDockControl.CanUpdateNC: Boolean; +begin + Result := Controller.CanUpdateNC(Self); +end; + +function TdxCustomDockControl.CanCalculateNC: Boolean; +begin + Result := Controller.CanCalculateNC(Self) or (csAlignmentNeeded in ControlState); +end; + +function TdxCustomDockControl.HasBorder: Boolean; +begin + Result := False; +end; + +function TdxCustomDockControl.HasCaption: Boolean; +begin + Result := False; +end; + +function TdxCustomDockControl.HasCaptionCloseButton: Boolean; +begin + Result := HasCaption and (cbClose in CaptionButtons); +end; + +function TdxCustomDockControl.HasCaptionHideButton: Boolean; +begin + Result := HasCaption and (cbHide in CaptionButtons) and CanAutoHide; +end; + +function TdxCustomDockControl.HasCaptionMaximizeButton: Boolean; +begin + Result := HasCaption and (cbMaximize in CaptionButtons) and CanMaximize; +end; + +function TdxCustomDockControl.HasTabs: Boolean; +begin + Result := False; +end; + +function TdxCustomDockControl.IsCaptionActive: Boolean; +begin + Result := (Controller.ActiveDockControl = Self) and Application.Active; +end; + +function TdxCustomDockControl.IsCaptionVertical: Boolean; +var + ADockType: TdxDockingType; +begin + if SideContainer <> nil then + ADockType := SideContainer.DockType + else ADockType := DockType; + Result := Painter.CanVerticalCaption and (ADockType in [dtTop, dtBottom]); +end; + +function TdxCustomDockControl.IsCaptionPoint(pt: TPoint): Boolean; +begin + Result := HasCaption and PtInRect(CaptionRect, ClientToWindow(pt)); +end; + +function TdxCustomDockControl.IsCaptionCloseButtonPoint(pt: TPoint): Boolean; +begin + Result := HasCaptionCloseButton and PtInRect(CaptionCloseButtonRect, ClientToWindow(pt)); +end; + +function TdxCustomDockControl.IsCaptionHideButtonPoint(pt: TPoint): Boolean; +begin + Result := HasCaptionHideButton and PtInRect(CaptionHideButtonRect, ClientToWindow(pt)); +end; + +function TdxCustomDockControl.IsCaptionMaximizeButtonPoint(pt: TPoint): Boolean; +begin + Result := HasCaptionMaximizeButton and PtInRect(CaptionMaximizeButtonRect, ClientToWindow(pt)); +end; + +procedure TdxCustomDockControl.NCPaint(ACanvas: TCanvas); +var + ABorder: Integer; +begin + if Painter.DrawCaptionFirst then + NCPaintCaption(ACanvas); + if HasBorder then + begin + Painter.DrawBorder(ACanvas, WindowRect); + with WindowRect do + begin + ABorder := Painter.GetBorderWidth; + ExcludeClipRect(ACanvas.Handle, Left, Top, Left + ABorder, Bottom); + ExcludeClipRect(ACanvas.Handle, Left, Bottom - ABorder, Right, Bottom); + ExcludeClipRect(ACanvas.Handle, Right - ABorder, Top, Left + Right, Bottom); + ExcludeClipRect(ACanvas.Handle, Left, Top, Right, Top + ABorder); + end; + end; + if not Painter.DrawCaptionFirst then + NCPaintCaption(ACanvas); +end; + +procedure TdxCustomDockControl.NCPaintCaption(ACanvas: TCanvas); +begin + if HasCaption then + begin + Painter.DrawCaption(ACanvas, CaptionRect, IsCaptionActive); + Painter.DrawCaptionSeparator(ACanvas, CaptionSeparatorRect); + Painter.DrawCaptionText(ACanvas, CaptionTextRect, IsCaptionActive); + if HasCaptionCloseButton then + Painter.DrawCaptionCloseButton(ACanvas, CaptionCloseButtonRect, IsCaptionActive, CloseButtonIsDown, + CloseButtonIsHot, False); + if HasCaptionHideButton then + Painter.DrawCaptionHideButton(ACanvas, CaptionHideButtonRect, IsCaptionActive, HideButtonIsDown, + HideButtonIsHot, AutoHide); + if HasCaptionMaximizeButton then + Painter.DrawCaptionMaximizeButton(ACanvas, CaptionMaximizeButtonRect, IsCaptionActive, MaximizeButtonIsDown, + MaximizeButtonIsHot, (SideContainer <> nil) and (SideContainer.ActiveChild = Self)); + with CaptionRect do + ExcludeClipRect(ACanvas.Handle, Left, Top, Right, Bottom); + end; +end; + +procedure TdxCustomDockControl.DoLayoutChanged; +begin + if not IsUpdateLayoutLocked and not IsDestroying then + begin + UpdateLayout; + if Assigned(FOnLayoutChanged) then + FOnLayoutChanged(Self); + end; +end; + +procedure TdxCustomDockControl.BeginUpdateLayout; +begin + Inc(FUpdateLayoutLock); +end; + +procedure TdxCustomDockControl.EndUpdateLayout(AForceUpdate: Boolean = True); +begin + Dec(FUpdateLayoutLock); + if AForceUpdate then + DoLayoutChanged; +end; + +function TdxCustomDockControl.IsUpdateLayoutLocked: Boolean; +begin + Result := UpdateLayoutLock > 0; +end; + +procedure TdxCustomDockControl.LoadLayoutFromCustomIni(AIniFile: TCustomIniFile; + AParentForm: TCustomForm; AParentControl: TdxCustomDockControl; ASection: string); + + function ReadAllowDock: TdxDockingTypes; + begin + Result := []; + if AIniFile.ReadBool(ASection, 'AllowDockLeft', dtLeft in AllowDock) then + Result := Result + [dtLeft]; + if AIniFile.ReadBool(ASection, 'AllowDockTop', dtTop in AllowDock) then + Result := Result + [dtTop]; + if AIniFile.ReadBool(ASection, 'AllowDockRight', dtRight in AllowDock) then + Result := Result + [dtRight]; + if AIniFile.ReadBool(ASection, 'AllowDockBottom', dtBottom in AllowDock) then + Result := Result + [dtBottom]; + if AIniFile.ReadBool(ASection, 'AllowDockClient', dtClient in AllowDock) then + Result := Result + [dtClient]; + end; + + function ReadAllowDockClients: TdxDockingTypes; + begin + Result := []; + if AIniFile.ReadBool(ASection, 'AllowDockClientsLeft', dtLeft in AllowDockClients) then + Result := Result + [dtLeft]; + if AIniFile.ReadBool(ASection, 'AllowDockClientsTop', dtTop in AllowDockClients) then + Result := Result + [dtTop]; + if AIniFile.ReadBool(ASection, 'AllowDockClientsRight', dtRight in AllowDockClients) then + Result := Result + [dtRight]; + if AIniFile.ReadBool(ASection, 'AllowDockClientsBottom', dtBottom in AllowDockClients) then + Result := Result + [dtBottom]; + if AIniFile.ReadBool(ASection, 'AllowDockClientsClient', dtClient in AllowDockClients) then + Result := Result + [dtClient]; + end; + + function ReadCaptionButtons: TdxCaptionButtons; + begin + Result := []; + if AIniFile.ReadBool(ASection, 'CaptionButtonClose', cbClose in CaptionButtons) then + Result := Result + [cbClose]; + if AIniFile.ReadBool(ASection, 'CaptionButtonHide', cbHide in CaptionButtons) then + Result := Result + [cbHide]; + if AIniFile.ReadBool(ASection, 'CaptionButtonMaximize', cbMaximize in CaptionButtons) then + Result := Result + [cbMaximize]; + end; + +var + I, AChildCount: Integer; + AChildSection: string; + ADockType: TdxDockingType; +begin + BeginUpdateLayout; + try + Include(FInternalState, dcisLayoutLoading); + try + with AIniFile do + begin + ADockType := TdxDockingTypeEx(ReadInteger(ASection, 'DockType', 0)); + AllowDock := ReadAllowDock; + AllowDockClients := ReadAllowDockClients; + AllowFloating := ReadBool(ASection, 'AllowFloating', AllowFloating); + CaptionButtons := ReadCaptionButtons; + Dockable := ReadBool(ASection, 'Dockable', Dockable); + Width := ReadInteger(ASection, 'Width', Width); + Height := ReadInteger(ASection, 'Height', Height); + FOriginalWidth := ReadInteger(ASection, 'OriginalWidth', OriginalWidth); + FOriginalHeight := ReadInteger(ASection, 'OriginalHeight', OriginalHeight); + Visible := ReadBool(ASection, 'Visible', Visible); + if (AParentControl <> nil) then + IncludeToDock(AParentControl, ADockType, -1); + AChildCount := ReadInteger(ASection, 'ChildCount', 0); + for I := 0 to AChildCount - 1 do + begin + AChildSection := ReadString(ASection, 'Children' + IntToStr(I), ''); + Controller.LoadControlFromCustomIni(AIniFile, AParentForm, Self, AChildSection); + end; + FAutoHide := ReadBool(ASection, 'AutoHide', False); + FStoredAutoHide := ReadBool(ASection, 'StoredAutoHide', False); + if AutoHide and (AutoHideHostSite <> nil) then + begin + FAutoHidePosition := TdxAutoHidePosition(ReadInteger(ASection, 'AutoHidePosition', Integer(ahpUndefined))); + if FAutoHidePosition = ahpUndefined then + FAutoHidePosition := GetAutoHidePosition; + AutoHideHostSite.RegisterAutoHideDockControl(Self, FAutoHidePosition); + end; + end; + finally + Exclude(FInternalState, dcisLayoutLoading); + end; + finally + EndUpdateLayout; + end; +end; + +procedure TdxCustomDockControl.SaveLayoutToCustomIni(AIniFile: TCustomIniFile; ASection: string); +var + I: Integer; +begin + with AIniFile do + begin + WriteInteger(ASection, 'ChildCount', ChildCount); + for I := 0 to ChildCount - 1 do + WriteString(ASection, 'Children' + IntToStr(I), IntToStr(Controller.IndexOfDockControl(Children[I]))); + WriteInteger(ASection, 'DockType', Integer(DockType)); + WriteBool(ASection, 'AllowDockLeft', dtLeft in AllowDock); + WriteBool(ASection, 'AllowDockTop', dtTop in AllowDock); + WriteBool(ASection, 'AllowDockRight', dtRight in AllowDock); + WriteBool(ASection, 'AllowDockBottom', dtBottom in AllowDock); + WriteBool(ASection, 'AllowDockClient', dtClient in AllowDock); + WriteBool(ASection, 'AllowDockClientsLeft', dtLeft in AllowDockClients); + WriteBool(ASection, 'AllowDockClientsTop', dtTop in AllowDockClients); + WriteBool(ASection, 'AllowDockClientsRight', dtRight in AllowDockClients); + WriteBool(ASection, 'AllowDockClientsBottom', dtBottom in AllowDockClients); + WriteBool(ASection, 'AllowDockClientsClient', dtClient in AllowDockClients); + WriteBool(ASection, 'AllowFloating', AllowFloating); + WriteBool(ASection, 'CaptionButtonClose', cbClose in CaptionButtons); + WriteBool(ASection, 'CaptionButtonHide', cbHide in CaptionButtons); + WriteBool(ASection, 'CaptionButtonMaximize', cbMaximize in CaptionButtons); + WriteBool(ASection, 'Dockable', Dockable); + WriteInteger(ASection, 'Width', Width); + WriteInteger(ASection, 'Height', Height); + WriteInteger(ASection, 'OriginalWidth', OriginalWidth); + WriteInteger(ASection, 'OriginalHeight', OriginalHeight); + WriteBool(ASection, 'Visible', Visible); + WriteBool(ASection, 'AutoHide', AutoHide); + WriteBool(ASection, 'StoredAutoHide', StoredAutoHide); + if AutoHide then + WriteInteger(ASection, 'AutoHidePosition', Integer(FAutoHidePosition)); + end; + for I := 0 to ChildCount - 1 do + Controller.SaveControlToCustomIni(AIniFile, Children[I]); +end; + +function TdxCustomDockControl.GetDockIndex: Integer; +begin + if ParentDockControl <> nil then + Result := ParentDockControl.IndexOfControl(Self) + else Result := -1; +end; + +function TdxCustomDockControl.GetDockLevel: Integer; +var + AControl: TdxCustomDockControl; +begin + AControl := Self; + Result := 0; + while True do + begin + Inc(Result); + AControl := AControl.ParentDockControl; + if AControl = nil then break; + end; +end; + +function TdxCustomDockControl.GetDockingRect: TRect; +begin + if FloatDockSite <> nil then + begin + Result := FloatDockSite.FloatForm.BoundsRect; + OffsetRect(Result, - FloatDockSite.FloatForm.Left, - FloatDockSite.FloatForm.Top); + end + else + Result := Rect(0, 0, OriginalWidth, OriginalHeight); +end; + +function TdxCustomDockControl.GetDockState: TdxDockingState; +begin + if dcisDestroyed in FInternalState then + Result := dsDestroyed + else if (ParentDockControl = nil) and (Parent = nil) then + Result := dsUndocked + else if not Visible then + Result := dsHidden + else if FloatDockSite <> nil then + Result := dsFloating + else Result := dsDocked; +end; + +function TdxCustomDockControl.GetChild(Index: Integer): TdxCustomDockControl; +begin + Result := TdxCustomDockControl(FDockControls.Items[Index]); +end; + +function TdxCustomDockControl.GetChildCount: Integer; +begin + Result := FDockControls.Count; +end; + +function TdxCustomDockControl.GetImages: TCustomImageList; +begin + Result := ControllerImages; +end; + +procedure TdxCustomDockControl.ClearDockType; +begin + if not AutoHide then + Align := alNone; +end; + +procedure TdxCustomDockControl.ClearChildrenParentDockControl; +var + I: Integer; +begin + for I := 0 to ChildCount - 1 do + Children[I].FParentDockControl := nil; +end; + +function TdxCustomDockControl.IsColorStored: Boolean; +begin + Result := not ManagerColor and not ParentColor; +end; + +function TdxCustomDockControl.IsFontStored: Boolean; +begin + Result := not ManagerFont and not ParentFont; +end; + +function TdxCustomDockControl.IsInternalDestroying: Boolean; +begin + Result := IsDestroying or (dcisDestroying in FInternalState); +end; + +function TdxCustomDockControl.GetActive: Boolean; +begin + Result := Controller.ActiveDockControl = Self; +end; + +function TdxCustomDockControl.GetController: TdxDockingController; +begin + Result := dxDockingController; +end; + +function TdxCustomDockControl.GetPainter: TdxDockControlPainter; +begin + if FPainter = nil then + FPainter := Controller.PainterClass(ParentForm).Create(Self); + Result := FPainter; +end; + +function TdxCustomDockControl.GetPopupParent: TCustomForm; +begin + if FloatForm <> nil then + Result := FloatForm + else + Result := ParentForm; +end; + +function TdxCustomDockControl.GetTempCanvas: TCanvas; +begin + if Controller.TempBitmap <> nil then + Result := Controller.TempBitmap.Canvas + else + Result := nil; +end; + +function TdxCustomDockControl.GetValidChildCount: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to ChildCount - 1 do + if IsValidChild(Children[I]) then + Inc(Result); +end; + +function TdxCustomDockControl.GetValidChild(Index: Integer): TdxCustomDockControl; +var + I: Integer; +begin + Result := nil; + for I := 0 to ChildCount - 1 do + if IsValidChild(Children[I]) then + begin + if Index = 0 then + begin + Result := Children[I]; + break; + end + else Dec(Index); + end; +end; + +procedure TdxCustomDockControl.SetAllowDockClients(const Value: TdxDockingTypes); +begin + if FAllowDockClients <> Value then + begin + FAllowDockClients := Value; + if not IsLoading then + begin + CheckDockClientsRules; + UpdateDockZones; + end; + end; +end; + +procedure TdxCustomDockControl.SetAllowFloating(const Value: Boolean); +begin + if (FAllowFloating <> Value) and (DockState <> dsFloating) then + begin + FAllowFloating := Value; + end; +end; + +procedure TdxCustomDockControl.SetAllowDock(const Value: TdxDockingTypes); +begin + if FAllowDock <> Value then + begin + FAllowDock := Value; + if not (IsLoading or (dcisLayoutLoading in FInternalState)) then + begin + CheckDockRules; + UpdateDockZones; + end; + end; +end; + +procedure TdxCustomDockControl.SetAutoHide(const Value: Boolean); +begin + if (FAutoHide <> Value) and (CanAutoHide or not Value) then + begin + FAutoHide := Value; + AutoHideChanged; + UpdateState; + Modified; + end; +end; + +procedure TdxCustomDockControl.SetCaptionButtons(Value: TdxCaptionButtons); +begin + if FCaptionButtons <> Value then + begin + FCaptionButtons := Value; + InvalidateNC(True); + end; +end; + +procedure TdxCustomDockControl.SetDockable(const Value: Boolean); +begin + if FDockable <> Value then + begin + FDockable := Value; + end; +end; + +procedure TdxCustomDockControl.SetDockType(Value: TdxDockingType); +begin + if (Self is TdxFloatDockSite) and IsDesigning and IsLoading then Exit; // Anchors bug + FDockType := Value; + if (FDockType <> dtNone) and (not AutoHide or IsLoading) then + Align := dxDockingTypeAlign[Value]; +end; + +procedure TdxCustomDockControl.SetDockingParams(ADockingTargetZone: TdxZone; const ADockingPoint: TPoint); +begin + if (FDockingTargetZone <> ADockingTargetZone) or (ADockingTargetZone = nil) and not cxPointIsEqual(ADockingPoint, FDockingPoint) then + begin + if not cxPointIsEqual(FDockingPoint, cxInvalidPoint) then + DrawDockingSelection(DockingTargetZone, DockingPoint, True); + FDockingTargetZone := ADockingTargetZone; + FDockingPoint := ADockingPoint; + if not cxPointIsEqual(FDockingPoint, cxInvalidPoint) then + DrawDockingSelection(DockingTargetZone, DockingPoint, False); + end; +end; + +procedure TdxCustomDockControl.SetImageIndex(const Value: Integer); +begin + if FImageIndex <> Value then + begin + FImageIndex := Value; + if HasCaption then + NCChanged; + if (AutoHideControl <> nil) and (AutoHideHostSite <> nil) then + AutoHideHostSite.InvalidateNC(True); + if TabContainer <> nil then + TabContainer.InvalidateNC(True); + end; +end; + +procedure TdxCustomDockControl.SetManagerColor(const Value: Boolean); +begin + if FManagerColor <> Value then + begin + if Value and not IsLoading then + Color := ControllerColor; + FManagerColor := Value; + InvalidateNC(False); + end; +end; + +procedure TdxCustomDockControl.SetManagerFont(const Value: Boolean); +begin + if FManagerFont <> Value then + begin + if Value and not IsLoading then + Font := ControllerFont; + FManagerFont := Value; + NCChanged; + end; +end; + +procedure TdxCustomDockControl.SetParentDockControl(Value: TdxCustomDockControl); +begin + FParentDockControl := Value; + if not AutoHide then + begin + if (Value = nil) and IsInternalDestroying then + Visible := False + else + Parent := Value; + end; +end; + +procedure TdxCustomDockControl.SetShowCaption(const Value: Boolean); +begin + if FShowCaption <> Value then + begin + FShowCaption := Value; + NCChanged; + end; +end; + +procedure TdxCustomDockControl.SetUseDoubleBuffer(const Value: Boolean); +begin + if FUseDoubleBuffer <> Value then + begin + FUseDoubleBuffer := Value; + // TODO: Check? + end; +end; + +procedure TdxCustomDockControl.CMFontChanged(var Message: TMessage); +begin + inherited; + if not IsLoading then FManagerFont := False; + NCChanged; +end; + +procedure TdxCustomDockControl.CMColorChanged(var Message: TMessage); +begin + inherited; + if not IsLoading then FManagerColor := False; + InvalidateNC(False); +end; + +procedure TdxCustomDockControl.CMTextChanged(var Message: TMessage); +begin + inherited; + UpdateCaption; + if HasCaption then + InvalidateCaptionArea; + if (AutoHideControl <> nil) and (AutoHideHostSite <> nil) then + AutoHideHostSite.InvalidateNC(True); + if TabContainer <> nil then + TabContainer.InvalidateNC(True); + if SideContainer <> nil then + SideContainer.InvalidateNC(False); +end; + +procedure TdxCustomDockControl.CMVisibleChanged(var Message: TMessage); +begin + if not IsLoading and (ParentDockControl <> nil) then + begin + if Visible then HandleNeeded; // DB15673 + UpdateRelatedControlsVisibility; + UpdateCaption; + end; + inherited; + UpdateAutoHideControlsVisibility; + DoVisibleChanged; + if Visible then + CheckActiveDockControl; +end; + +procedure TdxCustomDockControl.CMMouseLeave(var Message: TMessage); +begin + inherited; + // TODO: IsActive + if AutoHide and (AutoHideHostSite <> nil) and (AutoHideHostSite.ShowingControl = Self) then + AutoHideHostSite.InitializeHiding; + + if FCloseButtonIsHot or FHideButtonIsHot or FMaximizeButtonIsHot then + begin + FCloseButtonIsHot := False; + FHideButtonIsHot := False; + FMaximizeButtonIsHot := False; + InvalidateCaptionArea; + end; +end; + +procedure TdxCustomDockControl.CMDesignHitTest(var Message: TCMDesignHitTest); +var + pt: TPoint; +begin + inherited; + pt := Point(Message.XPos, Message.YPos); + if (IsCaptionPoint(pt) and (Message.Keys = MK_LBUTTON)) or + Controller.IsDocking or Controller.IsResizing or + FCaptionIsDown or FCloseButtonIsDown or FHideButtonIsDown or FMaximizeButtonIsDown then + Message.Result := 1; +end; + +procedure TdxCustomDockControl.CNKeyDown(var Message: TWMKeyDown); +begin + case Message.CharCode of + VK_CONTROL: + if Controller.DockingDockControl = Self then + Docking(ClientToScreen(CursorPoint)); + VK_ESCAPE: + begin + if Controller.DockingDockControl = Self then + EndDocking(ClientToScreen(CursorPoint), True) + else + if Controller.ResizingDockControl = Self then + EndResize(ClientToScreen(CursorPoint), True); + end; + else + inherited; + end; +end; + +procedure TdxCustomDockControl.CNKeyUp(var Message: TWMKeyUp); +begin + if (Message.CharCode = VK_CONTROL) and (Controller.DockingDockControl = Self) then + Docking(ClientToScreen(CursorPoint)) + else inherited; +end; + +procedure TdxCustomDockControl.WMNCCalcSize(var Message: TWMNCCalcSize); +var + R: TRect; + OffsetX, OffsetY: Integer; +begin + if FRecalculateNCNeeded or CanCalculateNC then + begin + inherited; + R := Message.CalcSize_Params.rgrc[0]; + OffsetX := R.Left; + OffsetY := R.Top; + OffsetRect(R, -OffsetX, -OffsetY); + FWindowRect := R; + if UseDoubleBuffer then + CheckTempCanvas(FWindowRect); + Canvas.Font := Font; + CalculateNC(R); + OffsetRect(R, OffsetX, OffsetY); + if R.Left > R.Right then R.Left := R.Right; + if R.Top > R.Bottom then R.Top := R.Bottom; + Message.CalcSize_Params.rgrc[0] := R; + FSavedClientRect := R; + FRecalculateNCNeeded := False; + end + else + Message.CalcSize_Params.rgrc[0] := FSavedClientRect; +end; + +procedure TdxCustomDockControl.WMNCHitTest(var Message: TWMNCHitTest); +begin + if not Visible then + Message.Result := HTTRANSPARENT + else Message.Result := HTCLIENT; +end; + +procedure TdxCustomDockControl.WMNCPaint(var Message: TWMNCPaint); +var + DC: HDC; + ACanvas: TCanvas; + pt1, pt2: TPoint; + ASavedIndex: Integer; +begin + if not CanUpdateNC or IsInternalDestroying then exit; + DC := GetWindowDC(Handle); + try + ASavedIndex := SaveDC(DC); + try + pt1 := ClientToWindow(ClientRect.TopLeft); + pt2 := ClientToWindow(ClientRect.BottomRight); + ExcludeClipRect(DC, pt1.X, pt1.Y, pt2.X, pt2.Y); + if UseDoubleBuffer and (TempCanvas <> nil) then + begin + NCPaint(TempCanvas); + SelectClipRgn(TempCanvas.Handle, 0); + BitBlt(DC, 0, 0, WindowRect.Right, WindowRect.Bottom, + TempCanvas.Handle, 0, 0, SRCCOPY); + end + else + begin + ACanvas := TCanvas.Create; + try + ACanvas.Handle := DC; + NCPaint(ACanvas); + finally + ACanvas.Free; + end; + end; + finally + RestoreDC(DC, ASavedIndex); + end; + finally + ReleaseDC(Handle, DC); + end; +end; + +{$IFDEF DELPHI5} +procedure TdxCustomDockControl.WMContextMenu(var Message: TWMContextMenu); +var + Pt, Temp: TPoint; + AHandled: Boolean; + APopupMenu: TPopupMenu; +begin + Include(Controller.FInternalState, disContextMenu); + try + Pt := SmallPointToPoint(Message.Pos); + if (Pt.X < 0) or (Pt.Y < 0) then Temp := Pt + else Temp := ScreenToClient(Pt); + + AHandled := False; + DoContextPopup(Temp, AHandled); + Message.Result := Ord(AHandled); + if AHandled then Exit; + + APopupMenu := GetPopupMenu; + if (PopupMenu <> nil) and PopupMenu.AutoPopup then + begin + SendCancelMode(nil); + APopupMenu.PopupComponent := Self; + if (Pt.X < 0) or (Pt.Y < 0) then + Pt := ClientToScreen(Point(0, 0)); + APopupMenu.Popup(Pt.X, Pt.Y); + Message.Result := 1; + end; + if Message.Result = 0 then + inherited; + finally + Exclude(Controller.FInternalState, disContextMenu); + end; +end; +{$ENDIF} + +procedure TdxCustomDockControl.WMEraseBkgnd(var Message: TWmEraseBkgnd); +var + ACanvas: TCanvas; +begin + if not DoubleBuffered or (TMessage(Message).wParam = TMessage(Message).lParam) then + begin + ACanvas := TCanvas.Create; + try + ACanvas.Handle := Message.DC; + Painter.DrawClientEx(ACanvas, WindowRectToClient(WindowRect), ClientRect); + finally + ACanvas.Free; + end; + end; + Message.Result := 1; +end; + +procedure TdxCustomDockControl.WMMouseActivate(var Message: TWMMouseActivate); +begin + Activate; +end; + +procedure TdxCustomDockControl.WMMove(var Message: TWMMove); +begin + BeginUpdateNC; + try + inherited; + finally + EndUpdateNC; + end; +end; + +procedure TdxCustomDockControl.WMMouseMove(var Message: TWMMouseMove); +var + AIsButtonPoint: Boolean; +begin + inherited; + Message.Result := 0; + FCursorPoint := Point(Message.XPos, Message.YPos); + if Controller.DockingDockControl = Self then + begin + Docking(ClientToScreen(CursorPoint)); + Message.Result := 1; + end + else + if Controller.ResizingDockControl = Self then + begin + Resizing(ClientToScreen(CursorPoint)); + Message.Result := 1; + end + else + if FloatFormActive or ParentFormActive or IsDesigning then + begin + AIsButtonPoint := IsCaptionCloseButtonPoint(CursorPoint); + if AIsButtonPoint and not FCloseButtonIsHot then + begin + FCloseButtonIsHot := True; + InvalidateCaptionArea; + Message.Result := 1; + end + else + if not AIsButtonPoint and FCloseButtonIsHot then + begin + FCloseButtonIsHot := False; + InvalidateCaptionArea; + Message.Result := 1; + end; + + AIsButtonPoint := IsCaptionHideButtonPoint(CursorPoint); + if AIsButtonPoint and not FHideButtonIsHot then + begin + FHideButtonIsHot := True; + InvalidateCaptionArea; + Message.Result := 1; + end + else + if not AIsButtonPoint and FHideButtonIsHot then + begin + FHideButtonIsHot := False; + InvalidateCaptionArea; + Message.Result := 1; + end; + + AIsButtonPoint := IsCaptionMaximizeButtonPoint(CursorPoint); + if AIsButtonPoint and not FMaximizeButtonIsHot then + begin + FMaximizeButtonIsHot := True; + InvalidateCaptionArea; + Message.Result := 1; + end + else + if not AIsButtonPoint and FMaximizeButtonIsHot then + begin + FMaximizeButtonIsHot := False; + InvalidateCaptionArea; + Message.Result := 1; + end; + + if FCaptionIsDown and ((IsDesigning and + ((Abs(CursorPoint.X - SourcePoint.X) > 3) or + (Abs(CursorPoint.Y - SourcePoint.Y) > 3))) or + not IsCaptionPoint(CursorPoint)) then + begin + ReleaseMouse; + FCaptionIsDown := False; + StartDocking(ClientToScreen(SourcePoint)); + Message.Result := 1; + end; + end; +end; + +procedure TdxCustomDockControl.WMLButtonDown(var Message: TWMLButtonDown); +begin + inherited; + Message.Result := 0; + SourcePoint := Point(Message.XPos, Message.YPos); + if GetResizeZoneAtPos(ClientToScreen(SourcePoint)) <> nil then + begin + StartResize(ClientToScreen(SourcePoint)); + Message.Result := 1; + end + else + if IsCaptionCloseButtonPoint(SourcePoint) then + begin + FCloseButtonIsDown := True; + InvalidateCaptionArea; + CaptureMouse; + Message.Result := 1; + end + else + if IsCaptionHideButtonPoint(SourcePoint) then + begin + FHideButtonIsDown := True; + InvalidateCaptionArea; + CaptureMouse; + Message.Result := 1; + end + else + if IsCaptionMaximizeButtonPoint(SourcePoint) then + begin + FMaximizeButtonIsDown := True; + InvalidateCaptionArea; + CaptureMouse; + Message.Result := 1; + end + else + if IsCaptionPoint(SourcePoint) then + begin + FCaptionIsDown := True; + CaptureMouse; + Message.Result := 1; + end; +end; + +procedure TdxCustomDockControl.WMRButtonDown(var Message: TWMRButtonDown); +begin + Controller.FinishDocking; + Controller.FinishResizing; + inherited; +end; + +procedure TdxCustomDockControl.WMLButtonUp(var Message: TWMLButtonUp); +begin + inherited; + Message.Result := 0; + FCursorPoint := Point(Message.XPos, Message.YPos); + if Controller.DockingDockControl = Self then + begin + EndDocking(ClientToScreen(CursorPoint), False); + Message.Result := 1; + end + else if Controller.ResizingDockControl = Self then + begin + EndResize(ClientToScreen(CursorPoint), False); + Message.Result := 1; + end + else + if FCloseButtonIsDown then + begin + ReleaseMouse; + FCloseButtonIsDown := False; + if IsCaptionCloseButtonPoint(CursorPoint) and not IsDesigning then + DoClose; + InvalidateCaptionArea; + Message.Result := 1; + end + else + if FHideButtonIsDown then + begin + ReleaseMouse; + FHideButtonIsDown := False; + FHideButtonIsHot := False; + if IsCaptionHideButtonPoint(CursorPoint) then + ChangeAutoHide; + InvalidateCaptionArea; + Message.Result := 1; + end + else + if FMaximizeButtonIsDown then + begin + ReleaseMouse; + FMaximizeButtonIsDown := False; + if IsCaptionMaximizeButtonPoint(CursorPoint) then + DoMaximize; + InvalidateCaptionArea; + Message.Result := 1; + end + else + if FCaptionIsDown then + begin + ReleaseMouse; + FCaptionIsDown := False; + Message.Result := 1; + end; + // TODO: !!! + Controller.FActivatingDockControl := nil; +end; + +procedure TdxCustomDockControl.WMLButtonDblClk(var Message: TWMLButtonDblClk); +var + pt: TPoint; +begin + inherited; + Message.Result := 0; + if not IsDesigning and (doDblClickDocking in ControllerOptions) and not AutoHide and + Dockable and IsCaptionPoint(CursorPoint) and + not IsCaptionCloseButtonPoint(CursorPoint) and + not IsCaptionHideButtonPoint(CursorPoint) and + not (IsCaptionMaximizeButtonPoint(CursorPoint)) then + begin + pt := ClientToScreen(CursorPoint); + DoStartDocking(pt); + MakeFloating; + DoEndDocking(pt); + Message.Result := 1; + end; +end; + +procedure TdxCustomDockControl.WMSetCursor(var Message: TWMSetCursor); +var + pt: TPoint; + AZone: TdxZone; +begin + if Controller.IsDocking then + begin + if (Controller.DockingDockControl.DockingTargetZone = nil) and not AllowFloating then + SetCursor(Screen.Cursors[crNo]) + else inherited; + end + else + begin + GetCursorPos(pt); + AZone := GetResizeZoneAtPos(pt); + if AZone <> nil then + begin + if AZone.Direction = zdHorizontal then + SetCursor(Screen.Cursors[crVSplit]) + else if AZone.Direction = zdVertical then + SetCursor(Screen.Cursors[crHSplit]) + else inherited; + end + else inherited; + end; +end; + +procedure TdxCustomDockControl.WMSize(var Message: TWMSize); +begin + if dcisFrameChanged in FInternalState then + inherited + else + begin + BeginUpdateNC(False); + try + inherited; + if not (disRedrawLocked in Controller.FInternalState) and Painter.NeedRedrawOnResize then + if doRedrawOnResize in ControllerOptions then + Redraw(True) + else + Invalidate; + finally + EndUpdateNC; + end; + end; +end; + +{ TdxCustomDockSite } + +procedure TdxCustomDockSite.GetChildren(Proc: TGetChildProc; Root: TComponent); +var + I: Integer; +begin + for I := 0 to ChildCount - 1 do + if Children[I].Owner = Root then Proc(Children[I]); +end; + +procedure TdxCustomDockSite.ValidateInsert(AComponent: TComponent); +begin + if not (AComponent is TdxCustomDockControl) then + begin + if AComponent is TControl then + (AComponent as TControl).Parent := ParentForm; + raise Exception.CreateFmt(sdxInvalidSiteChild, [AComponent.ClassName]); + end; +end; + +{ TdxLayoutDockSite } + +constructor TdxLayoutDockSite.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := ControlStyle + [csDesignInteractive]; +end; + +procedure TdxLayoutDockSite.BeforeDestruction; +begin + if not CanDestroy then + raise Exception.Create(sdxInvalidLayoutSiteDeleting); + inherited; +end; + +function TdxLayoutDockSite.CanDockHost(AControl: TdxCustomDockControl; AType: TdxDockingType): Boolean; +begin + Result := inherited CanDockHost(AControl, AType); + Result := Result and ((AType in [dtLeft, dtRight, dtTop, dtBottom]) or + ((Atype in [dtClient]) and (ChildCount = 0))); +end; + +procedure TdxLayoutDockSite.SetParent(AParent: TWinControl); +begin + if not IsUpdateLayoutLocked and not IsDestroying and + ((AParent = nil) or not (csLoading in AParent.ComponentState)) then + raise Exception.Create(sdxInvalidParentAssigning) + else if (AParent <> nil) and not (AParent is TdxCustomDockControl) then + raise Exception.CreateFmt(sdxInvalidParent, [ClassName]) + else inherited SetParent(AParent); +end; + +procedure TdxLayoutDockSite.UpdateControlDockZones(AControl: TdxCustomDockControl; AZoneWidth: Integer); +begin + if (SiblingDockControl <> nil) and (SiblingDockControl.DockType = dtClient) then exit; + if TdxClientZone.ValidateDockZone(Self, AControl) then + AControl.DockZones.Insert(0, TdxClientZone.Create(Self, AZoneWidth)) + else if TdxInvisibleClientZone.ValidateDockZone(Self, AControl) then + AControl.DockZones.Insert(0, TdxInvisibleClientZone.Create(Self, AZoneWidth)); + inherited; +end; + +procedure TdxLayoutDockSite.CreateLayout(AControl: TdxCustomDockControl; AType: TdxDockingType; + Index: Integer); +begin + inherited; + if SiblingDockControl <> nil then + SiblingDockControl.UpdateRelatedControlsVisibility; +end; + +procedure TdxLayoutDockSite.DestroyLayout(AControl: TdxCustomDockControl); +begin + inherited; + if SiblingDockControl <> nil then + SiblingDockControl.UpdateRelatedControlsVisibility; +end; + +function TdxLayoutDockSite.GetSiblingDockControl: TdxCustomDockControl; +begin + if (ParentDockControl <> nil) and (ParentDockControl.ChildCount = 2) then + Result := ParentDockControl.Children[1 - DockIndex] + else Result := nil; +end; + +function TdxLayoutDockSite.CanDestroy: Boolean; +begin + Result := ((ParentDockControl = nil) or ParentDockControl.IsDestroying) or + ((ChildCount = 0) and (ParentDockControl.ChildCount = 1)); +end; + +procedure TdxLayoutDockSite.WMNCHitTest(var Message: TWMNCHitTest); +begin + if not Visible or (IsDesigning and not Controller.IsDocking) then + Message.Result := HTTRANSPARENT + else inherited; +end; + +{ TdxContainerDockSite } + +constructor TdxContainerDockSite.Create(AOwner: TComponent); +begin + inherited; + UseDoubleBuffer := True; +end; + +function TdxContainerDockSite.CanDock: Boolean; +begin + Result := True; +end; + +function TdxContainerDockSite.CanDockHost(AControl: TdxCustomDockControl; AType: TdxDockingType): Boolean; +begin + Result := inherited CanDockHost(AControl, AType); +end; + +function TdxContainerDockSite.CanContainerDockHost(AType: TdxDockingType): Boolean; +begin + Result := (AType = GetHeadDockType) or (AType = GetTailDockType); +end; + +function TdxContainerDockSite.GetControlAutoHidePosition(AControl: TdxCustomDockControl): TdxAutoHidePosition; +begin + Result := inherited GetControlAutoHidePosition(Self); +end; + +procedure TdxContainerDockSite.ChildVisibilityChanged(Sender: TdxCustomDockControl); +begin + if disManagerChanged in Controller.FInternalState then Exit; + Visible := (ValidChildCount > 0) and not (AutoHide and not Visible); +end; + +procedure TdxContainerDockSite.Loaded; +begin + inherited; + SetActiveChildByIndex(FActiveChildIndex) +end; + +procedure TdxContainerDockSite.SetParent(AParent: TWinControl); +begin + if not IsUpdateLayoutLocked and not IsDestroying and + ((AParent = nil) or not (csLoading in AParent.ComponentState)) then + raise Exception.Create(sdxInvalidParentAssigning) + else if (AParent <> nil) and not ((AParent is TdxCustomDockControl) or + (AutoHide and (AParent is TdxDockSiteAutoHideContainer))) then + raise Exception.CreateFmt(sdxInvalidParent, [ClassName]) + else inherited SetParent(AParent); +end; + +procedure TdxContainerDockSite.CreateLayout(AControl: TdxCustomDockControl; + AType: TdxDockingType; Index: Integer); +begin + if CanContainerDockHost(AType) then + AControl.IncludeToDock(Self, AType, Index) + else Assert(False, Format(sdxInternalErrorCreateLayout, [TdxContainerDockSite.ClassName])); +end; + +procedure TdxContainerDockSite.DestroyChildLayout; +var + ADockIndex: Integer; + AAutoHide, AActive: Boolean; + AParentControl, ASite: TdxCustomDockControl; +begin + Include(FInternalState, dcisDestroying); + ADockIndex := DockIndex; + AParentControl := ParentDockControl; + if AutoHide then + begin + AAutoHide := True; + AutoHide := False; + end + else + AAutoHide := False; + AActive := (Container <> nil) and (Container.ActiveChild = Self); + ASite := Children[0]; + ASite.ExcludeFromDock; + ExcludeFromDock; + ASite.SetDockType(dtClient); + ASite.AdjustControlBounds(Self); + ASite.IncludeToDock(AParentControl, DockType, ADockIndex); + if (ASite.Container <> nil) and AActive then + ASite.Container.ActiveChild := ASite; + if AAutoHide then + ASite.AutoHide := True; + DoDestroy; +end; + +procedure TdxContainerDockSite.DestroyLayout(AControl: TdxCustomDockControl); +var + AParentControl: TdxCustomDockControl; +begin + AParentControl := ParentDockControl; + AParentControl.BeginUpdateLayout; + try + AControl.ExcludeFromDock; + if ChildCount = 1 then // !!! + DestroyChildLayout + else + Assert(ChildCount > 0, Format(sdxInternalErrorDestroyLayout, [ClassName])); + finally + AParentControl.EndUpdateLayout; + end; +end; + +procedure TdxContainerDockSite.UpdateLayout; +begin + inherited; + ValidateActiveChild(-1); +end; + +procedure TdxContainerDockSite.LoadLayoutFromCustomIni(AIniFile: TCustomIniFile; + AParentForm: TCustomForm; AParentControl: TdxCustomDockControl; ASection: string); +begin + BeginAdjustBounds; + try + inherited; + ActiveChildIndex := AIniFile.ReadInteger(ASection, 'ActiveChildIndex', -1); + finally + EndAdjustBounds; + end; +end; + +procedure TdxContainerDockSite.SaveLayoutToCustomIni(AIniFile: TCustomIniFile; + ASection: string); +begin + inherited; + with AIniFile do + WriteInteger(ASection, 'ActiveChildIndex', ActiveChildIndex); +end; + +procedure TdxContainerDockSite.BeginAdjustBounds; +begin + DisableAlign; +end; + +procedure TdxContainerDockSite.EndAdjustBounds; +begin + EnableAlign; +end; + +procedure TdxContainerDockSite.DoActiveChildChanged; +begin + ValidateActiveChild(-1); + UpdateCaption; +end; + +class function TdxContainerDockSite.GetHeadDockType: TdxDockingType; +begin + Result := dtClient; +end; + +class function TdxContainerDockSite.GetTailDockType: TdxDockingType; +begin + Result := dtClient; +end; + +function TdxContainerDockSite.GetFirstValidChild: TdxCustomDockControl; +var + I: Integer; +begin + Result := nil; + for I := 0 to ChildCount - 1 do + if IsValidChild(Children[I]) then + begin + Result := Children[I]; + break; + end; +end; + +function TdxContainerDockSite.GetFirstValidChildIndex: Integer; +var + AControl: TdxCustomDockControl; +begin + AControl := GetFirstValidChild; + if AControl <> nil then + Result := AControl.DockIndex + else Result := -1; +end; + +function TdxContainerDockSite.GetLastValidChild: TdxCustomDockControl; +var + I: Integer; +begin + Result := nil; + for I := ChildCount - 1 downto 0 do + if IsValidChild(Children[I]) then + begin + Result := Children[I]; + break; + end; +end; + +function TdxContainerDockSite.GetLastValidChildIndex: Integer; +var + AControl: TdxCustomDockControl; +begin + AControl := GetLastValidChild; + if AControl <> nil then + Result := AControl.DockIndex + else Result := -1; +end; + +function TdxContainerDockSite.GetNextValidChild(AIndex: Integer): TdxCustomDockControl; +var + I: Integer; +begin + Result := nil; + for I := AIndex + 1 to ChildCount - 1 do + if IsValidChild(Children[I]) then + begin + Result := Children[I]; + break; + end; +end; + +function TdxContainerDockSite.GetNextValidChildIndex(AIndex: Integer): Integer; +var + AControl: TdxCustomDockControl; +begin + AControl := GetNextValidChild(AIndex); + if AControl <> nil then + Result := AControl.DockIndex + else Result := -1; +end; + +function TdxContainerDockSite.GetPrevValidChild(AIndex: Integer): TdxCustomDockControl; +var + I: Integer; +begin + Result := nil; + for I := AIndex - 1 downto 0 do + if IsValidChild(Children[I]) then + begin + Result := Children[I]; + break; + end; +end; + +function TdxContainerDockSite.GetPrevValidChildIndex(AIndex: Integer): Integer; +var + AControl: TdxCustomDockControl; +begin + AControl := GetPrevValidChild(AIndex); + if AControl <> nil then + Result := AControl.DockIndex + else Result := -1; +end; + +function TdxContainerDockSite.IsValidActiveChild(AControl: TdxCustomDockControl): Boolean; +begin + Result := IsValidChild(AControl); +end; + +procedure TdxContainerDockSite.ValidateActiveChild(AIndex: Integer); +begin +end; + +function TdxContainerDockSite.GetActiveChildIndex: Integer; +begin + if IsLoading then + Result := FActiveChildIndex + else + if ActiveChild <> nil then + Result := ActiveChild.DockIndex + else + Result := -1; +end; + +procedure TdxContainerDockSite.SetActiveChildByIndex(AIndex: Integer); +begin + if (0 <= AIndex) and (AIndex < ChildCount) then + ActiveChild := Children[AIndex] + else + ActiveChild := nil; +end; + +procedure TdxContainerDockSite.SetActiveChild(Value: TdxCustomDockControl); +var + APrevActiveControl: TdxCustomDockControl; +begin + if (FActiveChild <> Value) and + ((Value = nil) or IsValidActiveChild(Value)) then + begin + BeginUpdateNC; + try + // "CheckBrowseMode" + if not IsDesigning and (Value <> nil) and (FActiveChild <> nil) and + FActiveChild.CanFocusEx and FActiveChild.HandleAllocated then + begin + APrevActiveControl := Controller.FActiveDockControl; + Inc(Controller.FActiveDockControlLockCount); + try + FActiveChild.SetFocus; + finally + Dec(Controller.FActiveDockControlLockCount); + end; + Controller.FActiveDockControl := APrevActiveControl; + //if not FActiveChild.Focused then + if Forms.GetParentForm(FActiveChild).ActiveControl <> FActiveChild then + Exit; // !!! + end; + + FActiveChild := Value; + DoActiveChildChanged; + if Assigned(FOnActiveChildChanged) then + FOnActiveChildChanged(Self, FActiveChild); + + finally + EndUpdateNC; + end; + Modified; + end; +end; + +procedure TdxContainerDockSite.SetActiveChildIndex(Value: Integer); +begin + if IsLoading then + FActiveChildIndex := Value + else + SetActiveChildByIndex(Value); +end; + +{ TdxTabContainerDockSite } + +constructor TdxTabContainerDockSite.Create(AOwner: TComponent); +begin + inherited; + FFirstVisibleTabIndex := 0; + FPressedTabIndex := -1; + FTabsPosition := tctpBottom; + FTabsScroll := True; + FTabsScrollTimerID := -1; +end; + +procedure TdxTabContainerDockSite.Assign(Source: TPersistent); +var + AContainer: TdxTabContainerDockSite; +begin + if Source is TdxTabContainerDockSite then + begin + AContainer := Source as TdxTabContainerDockSite; + TabsPosition := AContainer.TabsPosition; + TabsScroll := AContainer.TabsScroll; + end; + inherited Assign(Source); +end; + +procedure TdxTabContainerDockSite.DoActiveChildChanged; +begin + inherited; + if ActiveChild <> nil then + ActiveChild.BringToFront; + if (AutoHideControl = Self) and (AutoHideHostSite <> nil) then + AutoHideHostSite.InvalidateNC(False); + InvalidateNC(False); + UpdateChildrenState; +end; + +procedure TdxTabContainerDockSite.UpdateActiveTab; +begin + if ActiveChild <> nil then + Controller.ActiveDockControl := ActiveChild; +end; + +procedure TdxTabContainerDockSite.UpdateChildrenState; +var + I: Integer; +begin + for I := 0 to ChildCount - 1 do + Children[I].UpdateState; +end; + +procedure TdxTabContainerDockSite.ValidateActiveChild(AIndex: Integer); +var + AActiveChild: TdxCustomDockControl; +begin + if not IsValidChild(ActiveChild) then + begin + if (ActiveChild <> nil) and IsValidChild(ActiveChild.Container) then + ActiveChild := ActiveChild.Container + else if AIndex = -1 then + ActiveChild := GetFirstValidChild + else + begin + if (0 <= AIndex) and (AIndex < ChildCount) then + AActiveChild := Children[AIndex] + else AActiveChild := nil; + if not IsValidChild(AActiveChild) then + begin + AActiveChild := GetNextValidChild(AIndex); + if AActiveChild = nil then + AActiveChild := GetPrevValidChild(AIndex); + end; + ActiveChild := AActiveChild; + end; + end; + ValidateFirstVisibleIndex; +end; + +procedure TdxTabContainerDockSite.ValidateFirstVisibleIndex; +begin + if IsLoading or (ActiveChildIndex < 0) then exit; + if (FirstVisibleTabIndex > ActiveChildIndex) or (ActiveChildIndex > LastVisibleTabIndex) then + begin + NCChanged(True); + if FirstVisibleTabIndex > ActiveChildIndex then + begin + while FirstVisibleTabIndex > ActiveChildIndex do + if not DecFirstVisibleTabIndex then + Break; + end + else + if ActiveChildIndex > LastVisibleTabIndex then + while ActiveChildIndex > LastVisibleTabIndex do + if not IncFirstVisibleTabIndex then + Break; + end; +end; + +procedure TdxTabContainerDockSite.CalculateNC(var ARect: TRect); +var + I, XPos: Integer; + AWidth, ATabWidth: Integer; +begin + inherited CalculateNC(ARect); + FTabsRect.Left := ARect.Left; + FTabsRect.Right := ARect.Right; + with Painter do + begin + if TabsPosition = tctpTop then + begin + FTabsRect.Top := ARect.Top; + FTabsRect.Bottom := FTabsRect.Top + GetTabsHeight + GetTabVertOffset; + if HasTabs then + ARect.Top := FTabsRect.Bottom; + end + else + begin + FTabsRect.Bottom := ARect.Bottom; + FTabsRect.Top := FTabsRect.Bottom - GetTabsHeight - GetTabVertOffset; + if FTabsRect.Top < ARect.Top then + begin + FTabsRect.Top := ARect.Top; + FTabsRect.Bottom := FTabsRect.Top + Painter.GetTabsHeight; + end; + if HasTabs then + ARect.Bottom := FTabsRect.Top; + end; + end; + + FTabsPrevTabButtonIsEnabled := False; + FTabsNextTabButtonIsEnabled := False; + if TabsScroll then + begin + FTabsNextTabButtonRect.Right := FTabsRect.Right - Painter.GetTabHorizInterval; + FTabsNextTabButtonRect.Left := FTabsNextTabButtonRect.Right - Painter.GetTabsButtonSize; + FTabsNextTabButtonRect.Top := FTabsRect.Top + Painter.GetTabVertInterval + + (FTabsRect.Bottom - FTabsRect.Top - Painter.GetTabVertInterval - + Painter.GetTabsButtonSize) div 2; + FTabsNextTabButtonRect.Bottom := FTabsNextTabButtonRect.Top + Painter.GetTabsButtonSize; + FTabsPrevTabButtonRect.Right := FTabsNextTabButtonRect.Left - 1; + FTabsPrevTabButtonRect.Left := FTabsPrevTabButtonRect.Right - Painter.GetTabsButtonSize; + FTabsPrevTabButtonRect.Top := FTabsRect.Top + Painter.GetTabVertInterval + + (FTabsRect.Bottom - FTabsRect.Top - Painter.GetTabVertInterval - + Painter.GetTabsButtonSize) div 2; + FTabsPrevTabButtonRect.Bottom := FTabsPrevTabButtonRect.Top + Painter.GetTabsButtonSize; + end; + + AWidth := 0; + if not TabsScroll then + for I := 0 to ChildCount - 1 do + if IsValidChild(Children[I]) then Inc(AWidth, GetTabWidth(Children[I])); + + SetLength(FTabsRects, ChildCount); + XPos := FTabsRect.Left + Painter.GetTabHorizOffset; + with Painter do + begin + for I := 0 to FirstVisibleTabIndex - 1 do + begin + if not IsValidChild(Children[I]) then continue; + if TabsScroll or (AWidth < (FTabsRect.Right - FTabsRect.Left) - 2 * GetTabHorizInterval) then + ATabWidth := GetTabWidth(Children[I]) + else + ATabWidth := ((FTabsRect.Right - FTabsRect.Left) - 2 * GetTabHorizInterval) div ValidChildCount; + FTabsRects[I].Right := XPos; + FTabsRects[I].Top := FTabsRect.Top + GetTabVertInterval; + + if TabsPosition = tctpBottom then + Inc(FTabsRects[I].Top, GetTabVertInterval) + else + Inc(FTabsRects[I].Top, GetTabVertOffset); + + FTabsRects[I].Left := XPos - ATabWidth; + FTabsRects[I].Bottom := FTabsRect.Bottom - GetTabVertInterval; + + if TabsPosition = tctpTop then + Dec(FTabsRects[I].Bottom, GetTabVertInterval) + else + Dec(FTabsRects[I].Bottom, GetTabVertOffset); + + FTabsRects[I] := FTabsRects[I]; + XPos := XPos - ATabWidth; + end; + XPos := FTabsRect.Left + Painter.GetTabHorizOffset; + for I := FirstVisibleTabIndex to ChildCount - 1 do + begin + if not IsValidChild(Children[I]) then continue; + if TabsScroll or (AWidth < (FTabsRect.Right - FTabsRect.Left) - 2 * GetTabHorizInterval) then + ATabWidth := GetTabWidth(Children[I]) + else + ATabWidth := ((FTabsRect.Right - FTabsRect.Left) - + 2 * GetTabHorizInterval ) div ValidChildCount; + FTabsRects[I].Left := XPos; + FTabsRects[I].Top := FTabsRect.Top + GetTabVertInterval; + if TabsPosition = tctpBottom then + Inc(FTabsRects[I].Top, GetTabVertInterval) + else + Inc(FTabsRects[I].Top, GetTabVertOffset); + FTabsRects[I].Right := XPos + ATabWidth; + FTabsRects[I].Bottom := FTabsRect.Bottom - GetTabVertInterval; + if TabsPosition = tctpTop then + Dec(FTabsRects[I].Bottom, GetTabVertInterval) + else + Dec(FTabsRects[I].Bottom, GetTabVertOffset); + XPos := XPos + ATabWidth; + end; + end; + UpdateButtonsState; +end; + +procedure TdxTabContainerDockSite.NCPaint(ACanvas: TCanvas); +var + I: Integer; + R: TRect; +begin + inherited; + if HasTabs then + begin + if TabRectCount > 0 then + begin + R := TabsRects[ActiveChildIndex]; + Painter.CorrectTabRect(R, TabsPosition, True); + Painter.DrawTabs(ACanvas, TabsRect, R, TabsPosition); + end; + if TabsButtonsVisible then + begin + Painter.DrawTabsNextTabButton(ACanvas, TabsNextTabButtonRect, TabsNextTabButtonIsDown, + TabsNextTabButtonIsHot, TabsNextTabButtonIsEnabled, TabsPosition); + Painter.DrawTabsPrevTabButton(ACanvas, TabsPrevTabButtonRect, TabsPrevTabButtonIsDown, + TabsPrevTabButtonIsHot, TabsPrevTabButtonIsEnabled, TabsPosition); + ExcludeClipRect(ACanvas.Handle, TabsPrevTabButtonRect.Left - Painter.GetTabHorizInterval, + TabsRect.Top, TabsRect.Right, TabsRect.Bottom); + end; + for I := 0 to TabRectCount - 1 do + if IsValidChild(Children[I]) then + if PtInRect(TabsRect, TabsRects[I].TopLeft) then + begin + if Painter.DrawActiveTabLast and (ActiveChildIndex = I) then Continue; + R := TabsRects[I]; + Painter.CorrectTabRect(R, TabsPosition, ActiveChildIndex = I); + Painter.DrawTab(ACanvas, Children[I], R, ActiveChildIndex = I, TabsPosition); + end; + if Painter.DrawActiveTabLast then + begin + R := TabsRects[ActiveChildIndex]; + Painter.CorrectTabRect(R, TabsPosition, True); + Painter.DrawTab(ACanvas, Children[ActiveChildIndex], R, True, TabsPosition); + end; + end; +end; + +function TdxTabContainerDockSite.GetTabIndexAtPos(pt: TPoint): Integer; +var + I: Integer; +begin + Result := -1; + if HasTabs then + begin + pt := ClientToWindow(pt); + for I := 0 to TabRectCount - 1 do + if IsValidChild(Children[I]) and PtInRect(FTabsRects[I], pt) then + begin + Result := I; + break; + end; + end; +end; + +function TdxTabContainerDockSite.GetTabWidth(AControl: TdxCustomDockControl): Integer; +begin + Result := AControl.GetTabWidth(Canvas); +end; + +function TdxTabContainerDockSite.HasBorder: Boolean; +begin + Result := (FloatDockSite = nil) and ((ValidChildCount > 1) or AutoHide); +end; + +function TdxTabContainerDockSite.HasCaption: Boolean; +begin + Result := (doTabContainerHasCaption in ControllerOptions) and + ShowCaption and HasBorder; +end; + +function TdxTabContainerDockSite.HasTabs: Boolean; +begin + Result := not AutoHide and (ValidChildCount > 1); +end; + +function TdxTabContainerDockSite.IsCaptionActive: Boolean; +begin + Result := inherited IsCaptionActive; + Result := Result or ((Controller.ActiveDockControl <> nil) and + (Controller.ActiveDockControl.Container = Self) and Application.Active); +end; + +function TdxTabContainerDockSite.IsTabsPoint(pt: TPoint): Boolean; +begin + Result := HasTabs and PtInRect(TabsRect, ClientToWindow(pt)); +end; + +function TdxTabContainerDockSite.IsTabsNextTabButtonPoint(pt: TPoint): Boolean; +begin + Result := TabsButtonsVisible and PtInRect(TabsNextTabButtonRect, ClientToWindow(pt)); +end; + +function TdxTabContainerDockSite.IsTabsPrevTabButtonPoint(pt: TPoint): Boolean; +begin + Result := TabsButtonsVisible and PtInRect(TabsPrevTabButtonRect, ClientToWindow(pt)); +end; + +procedure TdxTabContainerDockSite.DoIncrementTabsScroll; +begin + if FTabsNextTabButtonIsDown then + begin + if IsTabsNextTabButtonPoint(CursorPoint) then + IncFirstVisibleTabIndex; + end + else if FTabsScrollTimerID > -1 then + begin + KillTimer(Handle, FTabsScrollTimerID); + FTabsScrollTimerID := -1; + end; +end; + +procedure TdxTabContainerDockSite.DoDecrementTabsScroll; +begin + if FTabsPrevTabButtonIsDown then + begin + if IsTabsPrevTabButtonPoint(CursorPoint) then + DecFirstVisibleTabIndex; + end + else if FTabsScrollTimerID > -1 then + begin + KillTimer(Handle, FTabsScrollTimerID); + FTabsScrollTimerID := -1; + end; +end; + +procedure IncrementTabsScrollTimerProc(Wnd: HWnd; Msg, TimerID, SysTime: Longint); stdcall; +var + AControl: TdxTabContainerDockSite; +begin + AControl := TdxTabContainerDockSite(FindControl(Wnd)); + if AControl <> nil then + AControl.DoIncrementTabsScroll; +end; + +procedure TdxTabContainerDockSite.InitIncrementTabsScroll; +begin + if FTabsScrollTimerID > -1 then + begin + KillTimer(Handle, FTabsScrollTimerID); + FTabsScrollTimerID := -1; + end; + FTabsScrollTimerID := SetTimer(Handle, 1, ControllerTabsScrollInterval, @IncrementTabsScrollTimerProc); +end; + +procedure DecrementTabsScrollTimerProc(Wnd: HWnd; Msg, TimerID, SysTime: Longint); stdcall; +var + AControl: TdxTabContainerDockSite; +begin + AControl := TdxTabContainerDockSite(FindControl(Wnd)); + if AControl <> nil then + AControl.DoDecrementTabsScroll; +end; + +procedure TdxTabContainerDockSite.InitDecrementTabsScroll; +begin + if FTabsScrollTimerID > -1 then + begin + KillTimer(Handle, FTabsScrollTimerID); + FTabsScrollTimerID := -1; + end; + FTabsScrollTimerID := SetTimer(Handle, 1, ControllerTabsScrollInterval, @DecrementTabsScrollTimerProc); +end; + +function TdxTabContainerDockSite.CanActive: Boolean; +begin + Result := True; +end; + +function TdxTabContainerDockSite.CanAutoHide: Boolean; +begin + Result := IsLoading or ((AutoHideHostSite <> nil) and + ((AutoHideControl = nil) or (AutoHideControl = Self))); +end; + +function TdxTabContainerDockSite.CanDockHost(AControl: TdxCustomDockControl; AType: TdxDockingType): Boolean; +var + ACanDockHost: Boolean; +begin + ACanDockHost := CanContainerDockHost(AType); + if Container is TdxSideContainerDockSite then + begin + ACanDockHost := ACanDockHost or Container.CanContainerDockHost(AType); + if doSideContainerCanInSideContainer in ControllerOptions then + ACanDockHost := ACanDockHost or (AType in [dtLeft, dtRight, dtTop, dtBottom]); + end + else if doTabContainerCanInSideContainer in ControllerOptions then + ACanDockHost := ACanDockHost or (AType in [dtLeft, dtRight, dtTop, dtBottom]); + Result := inherited CanDockHost(AControl, AType) and ACanDockHost;; +end; + +function TdxTabContainerDockSite.CanMaximize: Boolean; +begin + Result := not AutoHide and (SideContainer <> nil) and (SideContainer.ValidChildCount > 1); +end; + +procedure TdxTabContainerDockSite.ActivateNextChild(AGoForward, AGoOnCycle: Boolean); +var + AIndex, AnActiveChildIndex: Integer; +begin + AnActiveChildIndex := ActiveChildIndex; + AIndex := AnActiveChildIndex; + if AIndex = -1 then + AIndex := 0 + else + repeat + if AGoForward then + begin + if AIndex < ChildCount - 1 then + Inc(AIndex) + else + AIndex := IfThen(AGoOnCycle, 0, AnActiveChildIndex); + end + else + begin + if AIndex > 0 then + Dec(AIndex) + else + AIndex := IfThen(AGoOnCycle, ChildCount - 1, AnActiveChildIndex); + end; + until IsValidChild(Children[AIndex]) or (AIndex = AnActiveChildIndex); + ActiveChildIndex := AIndex; +end; + +function TdxTabContainerDockSite.CanResizeAtPos(pt: TPoint): Boolean; +begin + Result := inherited CanResizeAtPos(pt); + Result := Result and (GetTabIndexAtPos(pt) = -1); +end; + +procedure TdxTabContainerDockSite.UpdateControlDockZones(AControl: TdxCustomDockControl; AZoneWidth: Integer); +var + I: Integer; +begin + if not (doUseCaptionAreaToClientDocking in ControllerOptions) then + begin + if TdxTabContainerZone.ValidateDockZone(Self, AControl) then + DockZones.Insert(0, TdxTabContainerZone.Create(Self)); + end; + inherited; + if TdxTabContainerTabZone.ValidateDockZone(Self, AControl) then + for I := 0 to ChildCount - 1 do + begin + if not IsValidChild(Children[I]) then continue; + DockZones.Insert(0, TdxTabContainerTabZone.Create(Self, I)); + end; + if doUseCaptionAreaToClientDocking in ControllerOptions then + begin + if TdxTabContainerCaptionZone.ValidateDockZone(Self, AControl) then + DockZones.Insert(0, TdxTabContainerCaptionZone.Create(Self)); + end; +end; + +procedure TdxTabContainerDockSite.CreateLayout(AControl: TdxCustomDockControl; + AType: TdxDockingType; Index: Integer); +begin + if CanContainerDockHost(AType) then + inherited CreateLayout(AControl, AType, Index) + else if (Container <> nil) and Container.CanContainerDockHost(AType) then + CreateContainerLayout(Container, AControl, AType, DockIndex) + else + case AType of + dtLeft, dtRight, + dtTop, dtBottom: + CreateSideContainerLayout(AControl, AType, Index); + else + Assert(False, Format(sdxInternalErrorCreateLayout, [TdxTabContainerDockSite.ClassName])); + end; +end; + +procedure TdxTabContainerDockSite.DestroyLayout(AControl: TdxCustomDockControl); +var + AActiveIndex: Integer; +begin + if ActiveChild <> nil then + AActiveIndex := ActiveChild.DockIndex + else AActiveIndex := -1; + inherited; + if (AControl = ActiveChild) and (ChildCount > 1) then + ValidateActiveChild(AActiveIndex); +end; + +procedure TdxTabContainerDockSite.IncludeToDock(AControl: TdxCustomDockControl; + AType: TdxDockingType; Index: Integer); +var + AChild: TdxCustomDockControl; +begin + if AControl.CanAcceptTabContainerItems(Self) and (ChildCount > 0) then + begin + Include(FInternalState, dcisDestroying); + while ChildCount > 0 do + begin + AChild := Children[ChildCount - 1]; + AChild.ExcludeFromDock; + AChild.IncludeToDock(AControl, AType, Index); + end; + DoDestroy; + end + else inherited; +end; + +procedure TdxTabContainerDockSite.UpdateLayout; +begin + inherited; + if ActiveChild <> nil then + ActiveChild.BringToFront; + NCChanged; +end; + +procedure TdxTabContainerDockSite.LoadLayoutFromCustomIni(AIniFile: TCustomIniFile; + AParentForm: TCustomForm; AParentControl: TdxCustomDockControl; ASection: string); +begin + inherited; + with AIniFile do + begin + ShowCaption := ReadBool(ASection, 'ShowCaption', ShowCaption); + TabsPosition := TdxTabContainerTabsPosition(ReadInteger(ASection, 'TabsPosition', 0)); + TabsScroll := ReadBool(ASection, 'TabsScroll', True); + end; +end; + +procedure TdxTabContainerDockSite.SaveLayoutToCustomIni(AIniFile: TCustomIniFile; + ASection: string); +begin + inherited; + with AIniFile do + begin + WriteBool(ASection, 'ShowCaption', ShowCaption); + WriteInteger(ASection, 'TabsPosition', Integer(TabsPosition)); + WriteBool(ASection, 'TabsScroll', TabsScroll); + end; +end; + +function TdxTabContainerDockSite.CanAcceptSideContainerItems(AContainer: TdxSideContainerDockSite): Boolean; +begin + if (doSideContainerCanInTabContainer in ControllerOptions) or IsLoading then + Result := False + else + Result := True; +end; + +function TdxTabContainerDockSite.CanAcceptTabContainerItems(AContainer: TdxTabContainerDockSite): Boolean; +begin + Result := True; +end; + +procedure TdxTabContainerDockSite.ChangeAutoHide; +begin + if AutoHide then + AutoHide := False + else if doTabContainerCanAutoHide in ControllerOptions then + inherited ChangeAutoHide + else if ActiveChild <> nil then + ActiveChild.ChangeAutoHide; +end; + +procedure TdxTabContainerDockSite.UpdateCaption; +var + ACaption: string; +begin + if ActiveChild <> nil then + ACaption := ActiveChild.Caption + else ACaption := ''; + if Caption <> ACaption then + Caption := ACaption; + inherited UpdateCaption; +end; + +procedure TdxTabContainerDockSite.DoClose; +var + I: Integer; +begin + if (doTabContainerCanClose in ControllerOptions) then + begin + BeginUpdateLayout; + try + for I := ChildCount - 1 downto 0 do + begin + if Children[I].Visible then + Children[I].DoClose; + end; + if (AutoHideControl = Self) and (AutoHideHostSite <> nil) then + AutoHideHostSite.InvalidateNC(True); + finally + EndUpdateLayout; + end; + end + else + if ActiveChild <> nil then + begin + ActiveChild.DoClose; + if (AutoHideControl = Self) and (AutoHideHostSite <> nil) then + AutoHideHostSite.InvalidateNC(True); + UpdateActiveTab; + end; +end; + +procedure TdxTabContainerDockSite.ChildVisibilityChanged(Sender: TdxCustomDockControl); +begin + inherited ChildVisibilityChanged(Sender); + if not IsValidChild(Sender) then + begin + if Sender = ActiveChild then + ValidateActiveChild(Sender.DockIndex); + if (FirstVisibleTabIndex <= Sender.DockIndex) and + (Sender.DockIndex <= LastVisibleTabIndex) then + DecFirstVisibleTabIndex; + end; +end; + +function TdxTabContainerDockSite.GetLastVisibleTabIndex: Integer; +begin + if not HandleAllocated and (TabRectCount = 0) then + begin + Result := ValidChildCount; + Exit; + end; + if ChildCount <> TabRectCount then InvalidateNC(True); + if ValidChildCount < 2 then + Result := FirstVisibleTabIndex + else + begin + if FFirstVisibleTabIndex >= TabRectCount then + Result := FFirstVisibleTabIndex + else + begin + for Result := FFirstVisibleTabIndex to TabRectCount - 1 do + begin + if (0 > Result) or (Result > ChildCount - 1) then continue; + if not IsValidChild(Children[Result]) then continue; + if (TabsButtonsVisible and (TabsRects[Result].Right > TabsPrevTabButtonRect.Left - Painter.GetTabHorizInterval)) or + (TabsRects[Result].Right > TabsRect.Right) then break; + end; + if Result > FFirstVisibleTabIndex then + Dec(Result); + end; + end; +end; + +function TdxTabContainerDockSite.GetTabRectCount: Integer; +begin + Result := Length(FTabsRects); +end; + +function TdxTabContainerDockSite.GetTabRect(Index: Integer): TRect; +begin + Result := FTabsRects[Index]; +end; + +function TdxTabContainerDockSite.GetTabsButtonsVisible: Boolean; +begin + Result := TabsScroll and (TabsPrevTabButtonIsEnabled or TabsNextTabButtonIsEnabled); +end; + +procedure TdxTabContainerDockSite.SetTabsPosition(const Value: TdxTabContainerTabsPosition); +begin + if FTabsPosition <> Value then + begin + FTabsPosition := Value; + NCChanged; + end; +end; + +procedure TdxTabContainerDockSite.SetTabsScroll(const Value: Boolean); +begin + if FTabsScroll <> Value then + begin + FTabsScroll := Value; + if not FTabsScroll then + FFirstVisibleTabIndex := 0; + InvalidateNC(True); + end; +end; + +function TdxTabContainerDockSite.DecFirstVisibleTabIndex: Boolean; +var + AIndex: Integer; +begin + if Width = 0 then + begin + Result := False; + Exit; + end; + AIndex := GetPrevValidChildIndex(FirstVisibleTabIndex); + Result := AIndex <> -1; + if Result then + begin + FFirstVisibleTabIndex := AIndex; + InvalidateNC(True); + end; +end; + +function TdxTabContainerDockSite.IncFirstVisibleTabIndex: Boolean; +var + AIndex: Integer; +begin + if Width = 0 then + begin + Result := False; + Exit; + end; + AIndex := GetNextValidChildIndex(FirstVisibleTabIndex); + Result := AIndex <> -1; + if Result then + begin + FFirstVisibleTabIndex := AIndex; + InvalidateNC(True); + end; +end; + +procedure TdxTabContainerDockSite.UpdateButtonsState; +begin + FTabsPrevTabButtonIsEnabled := GetPrevValidChild(FirstVisibleTabIndex) <> nil; + FTabsNextTabButtonIsEnabled := GetNextValidChild(LastVisibleTabIndex) <> nil; +end; + +procedure TdxTabContainerDockSite.CMDesignHitTest(var Message: TCMDesignHitTest); +var + pt: TPoint; +begin + inherited; + pt := Point(Message.XPos, Message.YPos); + if (IsTabsPoint(pt) and (Message.Keys = MK_LBUTTON)) or (FPressedTabIndex > -1) or + FTabsNextTabButtonIsDown or FTabsPrevTabButtonIsDown then + Message.Result := 1; +end; + +procedure TdxTabContainerDockSite.CMMouseLeave(var Message: TMessage); +begin + inherited; + if FTabsNextTabButtonIsHot or FTabsPrevTabButtonIsHot then + begin + FTabsNextTabButtonIsHot := False; + FTabsPrevTabButtonIsHot := False; + InvalidateNC(False); + end; +end; + +procedure TdxTabContainerDockSite.WMLButtonDown(var Message: TWMLButtonDown); +var + APressedTabIndex: Integer; +begin + inherited; + if Message.Result = 0 then + begin + if IsTabsNextTabButtonPoint(SourcePoint) then + begin + if TabsNextTabButtonIsEnabled then + begin + FTabsNextTabButtonIsDown := True; + InvalidateNC(False); + InitIncrementTabsScroll; + CaptureMouse; + end; + Message.Result := 1; + end + else if IsTabsPrevTabButtonPoint(SourcePoint) then + begin + if TabsPrevTabButtonIsEnabled then + begin + FTabsPrevTabButtonIsDown := True; + InvalidateNC(False); + InitDecrementTabsScroll; + CaptureMouse; + end; + Message.Result := 1; + end + else + begin + APressedTabIndex := GetTabIndexAtPos(SourcePoint); + if APressedTabIndex > -1 then + begin + CaptureMouse; + ActiveChild := Children[APressedTabIndex]; + if ActiveChild = Children[APressedTabIndex] then + begin + Controller.ActiveDockControl := Children[APressedTabIndex]; + FPressedTabIndex := APressedTabIndex; + Modified; + end; + end; + Message.Result := 1; + end; + end; +end; + +procedure TdxTabContainerDockSite.WMLButtonUp(var Message: TWMLButtonUp); +begin + inherited; + if Message.Result = 0 then + begin + if FTabsNextTabButtonIsDown then + begin + ReleaseMouse; + DoIncrementTabsScroll; + FTabsNextTabButtonIsDown := False; + InvalidateNC(False); + Message.Result := 1; + end + else if FTabsPrevTabButtonIsDown then + begin + ReleaseMouse; + DoDecrementTabsScroll; + FTabsPrevTabButtonIsDown := False; + InvalidateNC(False); + Message.Result := 1; + end + else if FPressedTabIndex > -1 then + begin + ReleaseMouse; + FPressedTabIndex := -1; + Message.Result := 1; + end; + end; +end; + +procedure TdxTabContainerDockSite.WMLButtonDblClk(var Message: TWMLButtonDblClk); +var + pt: TPoint; + ATabIndex: Integer; + AControl: TdxCustomDockControl; +begin + inherited; + if Message.Result = 0 then + begin + ATabIndex := GetTabIndexAtPos(CursorPoint); + if not IsDesigning and (doDblClickDocking in ControllerOptions) and + not AutoHide and (ATabIndex > -1) and + not IsTabsNextTabButtonPoint(CursorPoint) and + not IsTabsPrevTabButtonPoint(CursorPoint) then + begin + AControl := Children[ATabIndex]; + if (AControl <> nil) and AControl.Dockable then + begin + pt := ClientToScreen(CursorPoint); + DoStartDocking(pt); + AControl.MakeFloating; + DoEndDocking(pt); + Message.Result := 1; + end; + end; + end; +end; + +procedure TdxTabContainerDockSite.WMMouseMove(var Message: TWMMouseMove); +var + AIsButtonPoint: Boolean; +begin + inherited; + if (Message.Result = 0) and (FloatFormActive or ParentFormActive or IsDesigning) then + begin + AIsButtonPoint := IsTabsNextTabButtonPoint(CursorPoint); + if AIsButtonPoint and not FTabsNextTabButtonIsHot then + begin + FTabsPrevTabButtonIsHot := False; + FTabsNextTabButtonIsHot := True; + InvalidateNC(False); + Message.Result := 1; + end; + if not AIsButtonPoint and FTabsNextTabButtonIsHot then + begin + FTabsNextTabButtonIsHot := False; + InvalidateNC(False); + Message.Result := 1; + end; + AIsButtonPoint := IsTabsPrevTabButtonPoint(CursorPoint); + if AIsButtonPoint and not FTabsPrevTabButtonIsHot then + begin + FTabsNextTabButtonIsHot := False; + FTabsPrevTabButtonIsHot := True; + InvalidateNC(False); + Message.Result := 1; + end; + if not AIsButtonPoint and FTabsPrevTabButtonIsHot then + begin + FTabsPrevTabButtonIsHot := False; + InvalidateNC(False); + Message.Result := 1; + end; + if (FPressedTabIndex > -1) and ((IsDesigning and + ((Abs(CursorPoint.X - SourcePoint.X) > 3) or (Abs(CursorPoint.Y - SourcePoint.Y) > 3))) or + ((GetTabIndexAtPos(CursorPoint) <> FPressedTabIndex) and + ((Abs(CursorPoint.X - SourcePoint.X) > 0) or (Abs(CursorPoint.Y - SourcePoint.Y) > 0)))) then + begin + ReleaseMouse; + FPressedTabIndex := -1; + if ActiveChild <> nil then + ActiveChild.StartDocking(ClientToScreen(SourcePoint)); + Message.Result := 1; + end; + end; +end; + +{ TdxSideContainerDockSite } + +procedure TdxSideContainerDockSite.DoActiveChildChanged; +begin + inherited; + NCChanged; + AdjustChildrenBounds(nil); +end; + +function TdxSideContainerDockSite.CanChildResize(AControl: TdxCustomDockControl; ADeltaSize: Integer): Boolean; +var + AIndex, ANextIndex: Integer; +begin + AIndex := AControl.DockIndex; + ANextIndex := GetNextValidChildIndex(AIndex); + Result := (ANextIndex > -1) and (MinSizes[AIndex] < OriginalSizes[AIndex] + ADeltaSize) and + (MinSizes[ANextIndex] < OriginalSizes[ANextIndex] - ADeltaSize); +end; + +procedure TdxSideContainerDockSite.DoChildResize(AControl: TdxCustomDockControl; + ADeltaSize: Integer; AResizeNextControl: Boolean); +var + I, AIndex, ANextIndex: Integer; +begin + if ADeltaSize = 0 then + Exit; + AIndex := AControl.DockIndex; + if AResizeNextControl then + ANextIndex := GetNextValidChildIndex(AIndex) + else + ANextIndex := GetPrevValidChildIndex(AIndex); + + if (AIndex > -1) and (ANextIndex > -1) then + begin + BeginAdjustBounds; + try + if ActiveChild <> nil then + begin + for I := 0 to ChildCount - 1 do + OriginalSizes[I] := Sizes[I]; + ActiveChild := nil; + end; + OriginalSizes[AIndex] := OriginalSizes[AIndex] + ADeltaSize; + OriginalSizes[ANextIndex] := OriginalSizes[ANextIndex] - ADeltaSize; + if OriginalSizes[AIndex] < MinSizes[AIndex] then + begin + ADeltaSize := MinSizes[AIndex] - OriginalSizes[AIndex]; + OriginalSizes[AIndex] := OriginalSizes[AIndex] + ADeltaSize; + OriginalSizes[ANextIndex] := OriginalSizes[ANextIndex] - ADeltaSize; + end; + if OriginalSizes[ANextIndex] < MinSizes[ANextIndex] then + begin + ADeltaSize := MinSizes[ANextIndex] - OriginalSizes[ANextIndex]; + OriginalSizes[ANextIndex] := OriginalSizes[ANextIndex] + ADeltaSize; + OriginalSizes[AIndex] := OriginalSizes[AIndex] - ADeltaSize; + end; + Sizes[AIndex] := OriginalSizes[AIndex]; + Sizes[ANextIndex] := OriginalSizes[ANextIndex]; + finally + EndAdjustBounds; + end; + end; +end; + +procedure TdxSideContainerDockSite.BeginAdjustBounds; +begin + Inc(FAdjustBoundsLock); + inherited; +end; + +procedure TdxSideContainerDockSite.EndAdjustBounds; +begin + inherited; + Dec(FAdjustBoundsLock); +end; + +function TdxSideContainerDockSite.IsAdjustBoundsLocked: Boolean; +begin + Result := AdjustBoundsLock > 0; +end; + +procedure TdxSideContainerDockSite.AdjustChildrenBounds(AControl: TdxCustomDockControl); +var + I, ADeltaSize: Integer; + APrevIndex: Integer; +begin + if IsAdjustBoundsLocked or IsUpdateLayoutLocked and (AControl = nil) then exit; + BeginAdjustBounds; + try + if ActiveChild <> nil then + begin + for I := 0 to ActiveChildIndex - 1 do + begin + if not IsValidChild(Children[I]) then continue; + Children[I].SetDockType(GetHeadDockType); + Sizes[I] := MinSizes[I]; + end; + for I := ChildCount - 1 downto ActiveChildIndex + 1 do + begin + if not IsValidChild(Children[I]) then continue; + Children[I].SetDockType(GetTailDockType); + Sizes[I] := MinSizes[I]; + end; + if IsValidChild(ActiveChild) then ActiveChild.SetDockType(dtClient); + end + else if ValidChildCount > 1 then + begin + if AControl <> nil then + ADeltaSize := GetDifferentSize div (ValidChildCount - 1) + else ADeltaSize := GetDifferentSize div ValidChildCount; + for I := 0 to ChildCount - 1 do + begin + if Children[I] = AControl then continue; + if not IsValidChild(Children[I]) then continue; + OriginalSizes[I] := OriginalSizes[I] + ADeltaSize; + if OriginalSizes[I] < MinSizes[I] then + OriginalSizes[I] := MinSizes[I]; + end; + NormalizeChildrenBounds(GetDifferentSize); + for I := 0 to ChildCount - 1 do + begin + if not IsValidChild(Children[I]) then continue; + Children[I].SetDockType(GetHeadDockType); + APrevIndex := GetPrevValidChildIndex(I); + if APrevIndex > -1 then + Positions[I] := Positions[APrevIndex] + Sizes[APrevIndex]; + Sizes[I] := OriginalSizes[I]; + end; + end + else if ValidChildCount > 0 then + begin + for I := 0 to ChildCount - 1 do + begin + if not IsValidChild(Children[I]) then continue; + Children[I].SetDockType(dtClient); + end; + end; + finally + EndAdjustBounds; + end; +end; + +procedure TdxSideContainerDockSite.NormalizeChildrenBounds(ADeltaSize: Integer); +var + I: Integer; +begin + for I := 0 to ChildCount - 1 do + begin + if not IsValidChild(Children[I]) then continue; + if ADeltaSize = 0 then break; + if OriginalSizes[I] > MinSizes[I] then + if OriginalSizes[I] + ADeltaSize < MinSizes[I] then + begin + ADeltaSize := ADeltaSize + (OriginalSizes[I] - MinSizes[I]); + OriginalSizes[I] := MinSizes[I]; + end + else + begin + OriginalSizes[I] := OriginalSizes[I] + ADeltaSize; + ADeltaSize := 0; + end; + end; +end; + +procedure TdxSideContainerDockSite.SetChildBounds(AControl: TdxCustomDockControl; + var AWidth, AHeight: Integer); +begin + if (ActiveChild = nil) and not IsAdjustBoundsLocked then + begin + OriginalSizes[AControl.DockIndex] := GetDimension(AWidth, AHeight); + AdjustChildrenBounds(nil); + SetDimension(AWidth, AHeight, OriginalSizes[AControl.DockIndex]); + end; +end; + +function TdxSideContainerDockSite.IsValidActiveChild(AControl: TdxCustomDockControl): Boolean; +begin + Result := IsValidChild(AControl) or (AControl = nil); +end; + +procedure TdxSideContainerDockSite.ValidateActiveChild(AIndex: Integer); +begin + if not IsValidChild(ActiveChild) then + begin + if (ActiveChild <> nil) and IsValidChild(ActiveChild.Container) then + ActiveChild := ActiveChild.Container + else ActiveChild := nil; + end; +end; + +function TdxSideContainerDockSite.HasBorder: Boolean; +begin + Result := (doSideContainerHasCaption in ControllerOptions) and + ShowCaption and (FloatDockSite = nil) and (ValidChildCount > 1); +end; + +function TdxSideContainerDockSite.HasCaption: Boolean; +begin + Result := (doSideContainerHasCaption in ControllerOptions) and + ShowCaption and (FloatDockSite = nil) and ((ValidChildCount > 1) or AutoHide); +end; + +function TdxSideContainerDockSite.CanActive: Boolean; +begin + Result := True; +end; + +function TdxSideContainerDockSite.CanAutoHide: Boolean; +begin + Result := IsLoading or ((AutoHideHostSite <> nil) and + ((AutoHideControl = nil) or (AutoHideControl = Self))); +end; + +function TdxSideContainerDockSite.CanDockHost(AControl: TdxCustomDockControl; AType: TdxDockingType): Boolean; +var + ACanDockHost: Boolean; +begin + ACanDockHost := CanContainerDockHost(AType); + if doSideContainerCanInSideContainer in ControllerOptions then + ACanDockHost := ACanDockHost or (AType in [dtLeft, dtRight, dtTop, dtBottom]); + if doSideContainerCanInTabContainer in ControllerOptions then + ACanDockHost := ACanDockHost or (AType in [dtClient]); + Result := inherited CanDockHost(AControl, AType) and ACanDockHost;; +end; + +function TdxSideContainerDockSite.CanMaximize: Boolean; +begin + Result := not AutoHide and (SideContainer <> nil) and (SideContainer.ValidChildCount > 1); +end; + +procedure TdxSideContainerDockSite.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); +begin + inherited; + AdjustChildrenBounds(nil); +end; + +procedure TdxSideContainerDockSite.UpdateControlDockZones(AControl: TdxCustomDockControl; + AZoneWidth: Integer); +begin + if doSideContainerCanInSideContainer in ControllerOptions then + inherited; +end; + +procedure TdxSideContainerDockSite.IncludeToDock(AControl: TdxCustomDockControl; + AType: TdxDockingType; Index: Integer); +var + AChild: TdxCustomDockControl; +begin + if AControl.CanAcceptSideContainerItems(Self) and (ChildCount > 0) then + begin + Include(FInternalState, dcisDestroying); + while ChildCount > 0 do + begin + AChild := Children[ChildCount - 1]; + AChild.ExcludeFromDock; + AChild.IncludeToDock(AControl, AType, Index); + if AControl is TdxSideContainerDockSite then + (AControl as TdxSideContainerDockSite).AdjustChildrenBounds(AChild); + end; + DoDestroy; + end + else inherited; +end; + +procedure TdxSideContainerDockSite.CreateLayout(AControl: TdxCustomDockControl; + AType: TdxDockingType; Index: Integer); +begin + if CanContainerDockHost(AType) then + begin + AControl.IncludeToDock(Self, AType, Index); + AdjustChildrenBounds(AControl); + end + else if (Container <> nil) and Container.CanContainerDockHost(AType) then + CreateContainerLayout(Container, AControl, AType, DockIndex) + else + case AType of + dtLeft, dtRight, + dtTop, dtBottom: + CreateSideContainerLayout(AControl, AType, Index); + dtClient: + CreateTabContainerLayout(AControl, AType, Index); + else + Assert(False, Format(sdxInternalErrorCreateLayout, [TdxTabContainerDockSite.ClassName])); + end; +end; + +procedure TdxSideContainerDockSite.UpdateLayout; +begin + inherited; + AdjustChildrenBounds(nil); +end; + +procedure TdxSideContainerDockSite.LoadLayoutFromCustomIni(AIniFile: TCustomIniFile; + AParentForm: TCustomForm; AParentControl: TdxCustomDockControl; ASection: string); +begin + BeginAdjustBounds; + try + inherited; + finally + EndAdjustBounds; + end; +end; + +function TdxSideContainerDockSite.CanAcceptSideContainerItems(AContainer: TdxSideContainerDockSite): Boolean; +begin + if (doSideContainerCanInSideContainer in ControllerOptions) or IsLoading then + Result := AContainer.ClassType = ClassType + else + Result := True; +end; + +function TdxSideContainerDockSite.CanAcceptTabContainerItems(AContainer: TdxTabContainerDockSite): Boolean; +begin + if (doTabContainerCanInSideContainer in ControllerOptions) or IsLoading then + Result := False + else + Result := True; +end; + +procedure TdxSideContainerDockSite.UpdateCaption; +var + I: Integer; + ACaption: string; +begin + ACaption := ''; + for I := 0 to ChildCount - 1 do + begin + if not IsValidChild(Children[I]) then continue; + ACaption := ACaption + Children[I].Caption; + if GetNextValidChild(I) <> nil then + ACaption := ACaption + ', '; + end; + if Caption <> ACaption then + Caption := ACaption; + inherited UpdateCaption; +end; + +procedure TdxSideContainerDockSite.ChangeAutoHide; +begin + if AutoHide then + AutoHide := False + else if doSideContainerCanAutoHide in ControllerOptions then + inherited ChangeAutoHide + else if ActiveChild <> nil then + ActiveChild.ChangeAutoHide + else if GetFirstValidChild <> nil then + GetFirstValidChild.ChangeAutoHide +end; + +procedure TdxSideContainerDockSite.DoClose; +begin + if (doSideContainerCanClose in ControllerOptions) then + inherited DoClose + else if ActiveChild <> nil then + ActiveChild.DoClose + else if GetFirstValidChild <> nil then + GetFirstValidChild.DoClose; +end; + +procedure TdxSideContainerDockSite.ChildVisibilityChanged(Sender: TdxCustomDockControl); +begin + inherited; + if IsValidChild(Sender) then + AdjustChildrenBounds(Sender) + else if Sender = ActiveChild then + ValidateActiveChild(Sender.DockIndex); + NCChanged; +end; + +function TdxSideContainerDockSite.GetDifferentSize: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to ChildCount - 1 do + begin + if not IsValidChild(Children[I]) then continue; + Inc(Result, OriginalSizes[I]); + end; + Result := GetContainerSize - Result; +end; + +{ TdxHorizContainerDockSite } + +procedure TdxHorizContainerDockSite.UpdateControlResizeZones(AControl: TdxCustomDockControl); +begin + inherited; + if (AControl.SideContainerItem <> nil) and (AControl.SideContainer = Self) then + if GetNextValidChild(AControl.SideContainerIndex) <> nil then + AControl.ResizeZones.Insert(0, TdxHorizContainerZone.Create( + AControl.SideContainerItem, ControllerResizeZonesWidth, zkResizing)); +end; + +procedure TdxHorizContainerDockSite.UpdateControlOriginalSize(AControl: TdxCustomDockControl); +begin + if (AControl = Self) or (DockType in [dtTop, dtBottom]) then + inherited + else if (DockType = dtClient) and (FloatDockSite <> nil) then + AControl.FOriginalHeight := FloatDockSite.Height; +end; + +class function TdxHorizContainerDockSite.GetHeadDockType: TdxDockingType; +begin + Result := dtLeft; +end; + +class function TdxHorizContainerDockSite.GetTailDockType: TdxDockingType; +begin + Result := dtRight; +end; + +function TdxHorizContainerDockSite.GetContainerSize: Integer; +begin + if HandleAllocated and (ClientWidth > 0) then + Result := ClientWidth + else Result := Width; +end; + +function TdxHorizContainerDockSite.GetDimension(AWidth, AHeight: Integer): Integer; +begin + Result := AWidth; +end; + +function TdxHorizContainerDockSite.GetMinSize(Index: Integer): Integer; +begin + Result := Children[Index].GetMinimizedWidth; +end; + +function TdxHorizContainerDockSite.GetOriginalSize(Index: Integer): Integer; +begin + Result := Children[Index].OriginalWidth; +end; + +function TdxHorizContainerDockSite.GetSize(Index: Integer): Integer; +begin + Result := Children[Index].Width; +end; + +function TdxHorizContainerDockSite.GetPosition(Index: Integer): Integer; +begin + Result := Children[Index].Left; +end; + +procedure TdxHorizContainerDockSite.SetDimension(var AWidth, AHeight: Integer; AValue: Integer); +begin + AWidth := AValue; +end; + +procedure TdxHorizContainerDockSite.SetOriginalSize(Index: Integer; + const Value: Integer); +var + I: Integer; +begin + Children[Index].FOriginalWidth := Value; + if Children[Index] is TdxTabContainerDockSite then + for I := 0 to Children[Index].ChildCount - 1 do + Children[Index].Children[I].FOriginalWidth := Value; +end; + +procedure TdxHorizContainerDockSite.SetSize(Index: Integer; const Value: Integer); +begin + Children[Index].Width := Value; +end; + +procedure TdxHorizContainerDockSite.SetPosition(Index: Integer; const Value: Integer); +begin + Children[Index].Left := Value; +end; + +{ TdxVertContainerDockSite } + +procedure TdxVertContainerDockSite.UpdateControlResizeZones(AControl: TdxCustomDockControl); +begin + inherited; + if (AControl.SideContainerItem <> nil) and (AControl.SideContainer = Self) then + if GetNextValidChild(AControl.SideContainerIndex) <> nil then + AControl.ResizeZones.Insert(0, TdxVertContainerZone.Create( + AControl.SideContainerItem, ControllerResizeZonesWidth, zkResizing)); +end; + +procedure TdxVertContainerDockSite.UpdateControlOriginalSize(AControl: TdxCustomDockControl); +begin + if (AControl = Self) or (DockType in [dtLeft, dtRight]) then + inherited + else if (DockType = dtClient) and (FloatDockSite <> nil) then + AControl.FOriginalWidth := FloatDockSite.Width; +end; + +class function TdxVertContainerDockSite.GetHeadDockType: TdxDockingType; +begin + Result := dtTop; +end; + +class function TdxVertContainerDockSite.GetTailDockType: TdxDockingType; +begin + Result := dtBottom; +end; + +function TdxVertContainerDockSite.GetContainerSize: Integer; +begin + if HandleAllocated and (ClientHeight > 0) then + Result := ClientHeight + else Result := Height; +end; + +function TdxVertContainerDockSite.GetDimension(AWidth, AHeight: Integer): Integer; +begin + Result := AHeight; +end; + +function TdxVertContainerDockSite.GetMinSize(Index: Integer): Integer; +begin + Result := Children[Index].GetMinimizedHeight; +end; + +function TdxVertContainerDockSite.GetOriginalSize(Index: Integer): Integer; +begin + Result := Children[Index].OriginalHeight; +end; + +function TdxVertContainerDockSite.GetSize(Index: Integer): Integer; +begin + Result := Children[Index].Height; +end; + +function TdxVertContainerDockSite.GetPosition(Index: Integer): Integer; +begin + Result := Children[Index].Top; +end; + +procedure TdxVertContainerDockSite.SetDimension(var AWidth, AHeight: Integer; AValue: Integer); +begin + AHeight := AValue; +end; + +procedure TdxVertContainerDockSite.SetOriginalSize(Index: Integer; + const Value: Integer); +var + I: Integer; +begin + Children[Index].FOriginalHeight := Value; + if Children[Index] is TdxTabContainerDockSite then + for I := 0 to Children[Index].ChildCount - 1 do + Children[Index].Children[I].FOriginalHeight := Value; +end; + +procedure TdxVertContainerDockSite.SetSize(Index: Integer; const Value: Integer); +begin + Children[Index].Height := Value; +end; + +procedure TdxVertContainerDockSite.SetPosition(Index: Integer; const Value: Integer); +begin + Children[Index].Top := Value; +end; + +{ TdxDockSiteAutoHideContainer } + +constructor TdxDockSiteAutoHideContainer.Create(AOwner: TComponent); +begin + inherited; + Visible := False; + ControlStyle := [csNoDesignVisible]; +end; + +procedure TdxDockSiteAutoHideContainer.CMControlListChange(var Message: TMessage); +begin + if (csDesigning in ComponentState) and not (csLoading in ComponentState) and + Boolean(Message.LParam) {Inserting} and + IsControlContainsDockSite(TControl(Message.WParam)) then + raise Exception.Create(sdxInvalidDockSiteParent); + inherited; +end; + +procedure TdxDockSiteAutoHideContainer.WMEraseBkgnd(var Message: TWmEraseBkgnd); +begin + Message.Result := 1; +end; + +{ TdxDockSiteHideBar } + +constructor TdxDockSiteHideBar.Create(AOwner: TdxDockSite); +begin + FOwner := AOwner; + FDockControls := TList.Create; +end; + +destructor TdxDockSiteHideBar.Destroy; +begin + FDockControls.Free; + inherited; +end; + +function TdxDockSiteHideBar.IndexOfDockControl(AControl: TdxCustomDockControl): Integer; +begin + Result := FDockControls.IndexOf(AControl); +end; + +procedure TdxDockSiteHideBar.CreateAutoHideContainer(AControl: TdxCustomDockControl); +var + AContainer: TdxDockSiteAutoHideContainer; +begin + AContainer := TdxDockSiteAutoHideContainer.Create(Owner); + AContainer.Anchors := GetContainersAnchors; + AContainer.Parent := Owner.Parent; + AContainer.BringToFront; + AControl.BeginUpdateLayout; + try + AControl.Parent := AContainer; + AControl.Align := GetControlsAlign; + AControl.SetVisibility(False); + AControl.AdjustControlBounds(AControl); + finally + AControl.EndUpdateLayout; + end; +end; + +procedure TdxDockSiteHideBar.DestroyAutoHideContainer(AControl: TdxCustomDockControl); +var + AContainer: TdxDockSiteAutoHideContainer; +begin + AContainer := AControl.AutoHideContainer; + if AContainer <> nil then + begin + AControl.BeginUpdateLayout; + try + AContainer.Perform(WM_SETREDRAW, Integer(False), 0); +// SendMessage(AContainer.Handle, WM_SETREDRAW, Integer(False), 0); + AControl.SetVisibility(True); + AControl.SetParentDockControl(AControl.ParentDockControl); + AControl.SetDockType(AControl.DockType); + AControl.AdjustControlBounds(AControl); + finally + AControl.EndUpdateLayout; + end; + AContainer.Free; + end; +end; + +procedure TdxDockSiteHideBar.RegisterDockControl(AControl: TdxCustomDockControl); +begin + FDockControls.Add(AControl); + CreateAutoHideContainer(AControl); + if DockControlCount = 1 then + Owner.NCChanged(True); +end; + +procedure TdxDockSiteHideBar.UnregisterDockControl(AControl: TdxCustomDockControl); +begin + DestroyAutoHideContainer(AControl); + FDockControls.Remove(AControl); + if DockControlCount = 0 then + Owner.NCChanged(True); +end; + +function TdxDockSiteHideBar.GetButtonWidth(AControl: TdxCustomDockControl): Integer; +var + I: Integer; + ATabWidth, AMaxTabWidth: Integer; + AOffset: Integer; + ATabContainer: TdxTabContainerDockSite; +begin + AOffset := 2 * Painter.GetHideBarHorizInterval; + if AControl is TdxTabContainerDockSite then + begin + ATabContainer := AControl as TdxTabContainerDockSite; + AMaxTabWidth := 0; + for I := 0 to ATabContainer.ChildCount - 1 do + if ATabContainer.IsValidChild(ATabContainer.Children[I]) then + begin + ATabWidth := Owner.Canvas.TextWidth(ATabContainer.Children[I].Caption); + if Painter.IsValidImageIndex(ATabContainer.Children[I].ImageIndex) then + Inc(ATabWidth, GetDefaultImageSize + AOffset); + AMaxTabWidth := Max(AMaxTabWidth, ATabWidth); + end; + Result := AMaxTabWidth + AOffset + + (GetDefaultImageSize + AOffset) * ((AControl as TdxTabContainerDockSite).ValidChildCount - 1); + end + else + begin + Result := Owner.Canvas.TextWidth(AControl.Caption) + AOffset; + if GetImageSize > 0 then + Result := Result + GetImageSize + AOffset + else + Result := Result + Painter.GetHideBarHorizInterval; + end; +end; + +function TdxDockSiteHideBar.GetControlAtPos(pt: TPoint; var SubControl: TdxCustomDockControl): TdxCustomDockControl; +var + I: Integer; +begin + Result := nil; + for I := 0 to DockControlCount - 1 do + if PtInRect(ButtonsRects[I], pt) then + begin + Result := DockControls[I]; + if Result is TdxTabContainerDockSite then + SubControl := GetTabContainerChildAtPos(pt, DockControls[I] as TdxTabContainerDockSite) + else SubControl := nil; + break; + end; +end; + +function TdxDockSiteHideBar.GetTabContainerChildAtPos(pt: TPoint; + TabContainer: TdxTabContainerDockSite): TdxCustomDockControl; +begin + Result := nil; +end; + +function TdxDockSiteHideBar.GetButtonRectCount: Integer; +begin + Result := Length(FButtonsRects); +end; + +function TdxDockSiteHideBar.GetButtonRect(Index: Integer): TRect; +begin + Result := FButtonsRects[Index]; +end; + +function TdxDockSiteHideBar.GetDockControl(Index: Integer): TdxCustomDockControl; +begin + Result := TdxCustomDockControl(FDockControls.Items[Index]); +end; + +function TdxDockSiteHideBar.GetDockControlCount: Integer; +begin + Result := FDockControls.Count; +end; + +function TdxDockSiteHideBar.GetPainter: TdxDockControlPainter; +begin + Result := Owner.Painter; +end; + +function TdxDockSiteHideBar.GetVisible: Boolean; +begin + Result := DockControlCount > 0; +end; + +{ TdxDockSiteLeftHideBar } + +procedure TdxDockSiteLeftHideBar.Calculate(R: TRect); +begin + FRect.Left := R.Left; + FRect.Top := R.Top; + FRect.Bottom := R.Bottom; + SetLength(FButtonsRects, DockControlCount); + if Visible then + begin + FRect.Right := FRect.Left + Painter.GetHideBarWidth; + CalculateButtons(FRect); + end + else FRect.Right := FRect.Left; +end; + +procedure TdxDockSiteLeftHideBar.CalculateButtons(R: TRect); +var + I, APos: Integer; +begin + APos := R.Top + Painter.GetHideBarHorizInterval; + if Owner.TopHideBar.Visible then + Inc(APos, Painter.GetHideBarHeight); + for I := 0 to DockControlCount - 1 do + begin + FButtonsRects[I].Top := APos; + FButtonsRects[I].Bottom := FButtonsRects[I].Top + GetButtonWidth(DockControls[I]); + FButtonsRects[I].Left := R.Left + Painter.GetHideBarVertInterval; + FButtonsRects[I].Right := R.Right - Painter.GetHideBarVertInterval; + APos := FButtonsRects[I].Bottom + Painter.GetHideBarHorizInterval + end; +end; + +function TdxDockSiteLeftHideBar.GetDefaultImageSize: Integer; +begin + Result := Painter.GetDefaultImageHeight; +end; + +function TdxDockSiteLeftHideBar.GetImageSize: Integer; +begin + Result := Painter.GetImageHeight; +end; + +function TdxDockSiteLeftHideBar.GetContainersAnchors: TAnchors; +begin + Result := [akLeft, akTop, akBottom]; +end; + +function TdxDockSiteLeftHideBar.GetControlsAlign: TAlign; +begin + Result := alRight; +end; + +function TdxDockSiteLeftHideBar.GetPosition: TdxAutoHidePosition; +begin + Result := ahpLeft; +end; + +function TdxDockSiteLeftHideBar.CheckHidingFinish: Boolean; +begin + Result := Owner.MovingContainer.Width <= 0; +end; + +function TdxDockSiteLeftHideBar.CheckShowingFinish: Boolean; +begin + Result := Owner.MovingContainer.Width >= Owner.MovingControl.OriginalWidth; +end; + +procedure TdxDockSiteLeftHideBar.SetFinalPosition(AControl: TdxCustomDockControl); +begin + AControl.AutoHideContainer.SetBounds(Owner.GetClientLeft, Owner.GetClientTop, + AControl.OriginalWidth, Owner.GetClientHeight); +end; + +procedure TdxDockSiteLeftHideBar.SetInitialPosition(AControl: TdxCustomDockControl); +begin + AControl.AutoHideContainer.SetBounds(Owner.GetClientLeft, Owner.GetClientTop, + 0, Owner.GetClientHeight); +end; + +procedure TdxDockSiteLeftHideBar.UpdatePosition(ADelta: Integer); +begin + if (ADelta > 0) and (Owner.MovingContainer.Width + ADelta > Owner.MovingControl.OriginalWidth) then + SetFinalPosition(Owner.MovingControl) + else if (ADelta < 0) and (Owner.MovingContainer.Width + ADelta < 0) then + SetInitialPosition(Owner.MovingControl) + else Owner.MovingContainer.Width := Owner.MovingContainer.Width + ADelta; +end; + +procedure TdxDockSiteLeftHideBar.UpdateOwnerAutoSizeBounds(AControl: TdxCustomDockControl); +var + AWidth: Integer; +begin + AWidth := 0; + if Owner.HasAutoHideControls then + AWidth := Painter.GetHideBarWidth; + if not AControl.AutoHide and AControl.Visible then + AWidth := AControl.OriginalWidth; + Owner.UpdateAutoSizeBounds(AWidth, AControl.OriginalHeight); +end; + +function TdxDockSiteLeftHideBar.GetTabContainerChildAtPos(pt: TPoint; + TabContainer: TdxTabContainerDockSite): TdxCustomDockControl; +var + I, Index: Integer; + ARect, R: TRect; +begin + Result := nil; + Index := IndexOfDockControl(TabContainer); + ARect := ButtonsRects[Index]; + for I := 0 to TabContainer.ActiveChildIndex - 1 do + begin + if not TabContainer.IsValidChild(TabContainer.Children[I]) then continue; + R := ARect; + R.Bottom := R.Top + (Painter.GetDefaultImageHeight + 2 * Painter.GetHideBarHorizInterval); + if PtInRect(R, pt) then + begin + Result := TabContainer.Children[I]; + break; + end; + ARect.Top := R.Bottom; + end; + if Result = nil then + for I := TabContainer.ChildCount - 1 downto TabContainer.ActiveChildIndex + 1 do + begin + if not TabContainer.IsValidChild(TabContainer.Children[I]) then continue; + R := ARect; + R.Top := R.Bottom - (Painter.GetDefaultImageHeight + 2 * Painter.GetHideBarHorizInterval); + if PtInRect(R, pt) then + begin + Result := TabContainer.Children[I]; + break; + end; + ARect.Bottom := R.Top; + end; + if Result = nil then + Result := TabContainer.ActiveChild; +end; + +{ TdxDockSiteTopHideBar } + +procedure TdxDockSiteTopHideBar.Calculate(R: TRect); +begin + FRect.Left := R.Left; + FRect.Top := R.Top; + FRect.Right := R.Right; + SetLength(FButtonsRects, DockControlCount); + if Visible then + begin + FRect.Bottom := FRect.Top + Painter.GetHideBarHeight; + CalculateButtons(FRect); + end + else FRect.Bottom := FRect.Top; +end; + +procedure TdxDockSiteTopHideBar.CalculateButtons(R: TRect); +var + I, APos: Integer; +begin + APos := R.Left + Painter.GetHideBarHorizInterval; + if Owner.LeftHideBar.Visible then + Inc(APos, Painter.GetHideBarWidth); + for I := 0 to DockControlCount - 1 do + begin + FButtonsRects[I].Left := APos; + FButtonsRects[I].Right := FButtonsRects[I].Left + GetButtonWidth(DockControls[I]); + FButtonsRects[I].Top := R.Top + Painter.GetHideBarVertInterval; + FButtonsRects[I].Bottom := R.Bottom - Painter.GetHideBarVertInterval; + APos := FButtonsRects[I].Right + Painter.GetHideBarHorizInterval + end; +end; + +function TdxDockSiteTopHideBar.GetDefaultImageSize: Integer; +begin + Result := Painter.GetDefaultImageWidth; +end; + +function TdxDockSiteTopHideBar.GetImageSize: Integer; +begin + Result := Painter.GetImageWidth; +end; + +function TdxDockSiteTopHideBar.GetContainersAnchors: TAnchors; +begin + Result := [akTop, akLeft, akRight]; +end; + +function TdxDockSiteTopHideBar.GetControlsAlign: TAlign; +begin + Result := alBottom; +end; + +function TdxDockSiteTopHideBar.GetPosition: TdxAutoHidePosition; +begin + Result := ahpTop; +end; + +function TdxDockSiteTopHideBar.CheckHidingFinish: Boolean; +begin + Result := Owner.MovingContainer.Height <= 0; +end; + +function TdxDockSiteTopHideBar.CheckShowingFinish: Boolean; +begin + Result := (Owner.MovingContainer.Height >= Owner.MovingControl.OriginalHeight); +end; + +procedure TdxDockSiteTopHideBar.SetFinalPosition(AControl: TdxCustomDockControl); +begin + AControl.AutoHideContainer.SetBounds(Owner.GetClientLeft, Owner.GetClientTop, + Owner.GetClientWidth, AControl.OriginalHeight); +end; + +procedure TdxDockSiteTopHideBar.SetInitialPosition(AControl: TdxCustomDockControl); +begin + AControl.AutoHideContainer.SetBounds(Owner.GetClientLeft, Owner.GetClientTop, + Owner.GetClientWidth, 0); +end; + +procedure TdxDockSiteTopHideBar.UpdatePosition(ADelta: Integer); +begin + if (ADelta > 0) and (Owner.MovingContainer.Height + ADelta > Owner.MovingControl.OriginalHeight) then + SetFinalPosition(Owner.MovingControl) + else if (ADelta < 0) and (Owner.MovingContainer.Height + ADelta < 0) then + SetInitialPosition(Owner.MovingControl) + else Owner.MovingContainer.Height := Owner.MovingContainer.Height + ADelta; +end; + +procedure TdxDockSiteTopHideBar.UpdateOwnerAutoSizeBounds(AControl: TdxCustomDockControl); +var + AHeight: Integer; +begin + AHeight := 0; + if Owner.HasAutoHideControls then + AHeight := Painter.GetHideBarWidth; + if not AControl.AutoHide and AControl.Visible then + AHeight := AControl.OriginalHeight; + Owner.UpdateAutoSizeBounds(AControl.OriginalWidth, AHeight); +end; + +function TdxDockSiteTopHideBar.GetTabContainerChildAtPos(pt: TPoint; + TabContainer: TdxTabContainerDockSite): TdxCustomDockControl; +var + I, Index: Integer; + ARect, R: TRect; +begin + Result := nil; + Index := IndexOfDockControl(TabContainer); + ARect := ButtonsRects[Index]; + for I := 0 to TabContainer.ActiveChildIndex - 1 do + begin + if not TabContainer.IsValidChild(TabContainer.Children[I]) then continue; + R := ARect; + R.Right := R.Left + (Painter.GetDefaultImageWidth + 2 * Painter.GetHideBarHorizInterval); + if PtInRect(R, pt) then + begin + Result := TabContainer.Children[I]; + break; + end; + ARect.Left := R.Right; + end; + if Result = nil then + for I := TabContainer.ChildCount - 1 downto TabContainer.ActiveChildIndex + 1 do + begin + if not TabContainer.IsValidChild(TabContainer.Children[I]) then continue; + R := ARect; + R.Left := R.Right - (Painter.GetDefaultImageWidth + 2 * Painter.GetHideBarHorizInterval); + if PtInRect(R, pt) then + begin + Result := TabContainer.Children[I]; + break; + end; + ARect.Right := R.Left; + end; + if Result = nil then + Result := TabContainer.ActiveChild; +end; + +{ TdxDockSiteRightHideBar } + +procedure TdxDockSiteRightHideBar.Calculate(R: TRect); +begin + FRect.Right := R.Right; + FRect.Top := R.Top; + FRect.Bottom := R.Bottom; + SetLength(FButtonsRects, DockControlCount); + if Visible then + begin + FRect.Left := FRect.Right - Painter.GetHideBarWidth; + CalculateButtons(FRect); + end + else FRect.Left := FRect.Right; +end; + +function TdxDockSiteRightHideBar.GetContainersAnchors: TAnchors; +begin + Result := [akRight, akTop, akBottom]; +end; + +function TdxDockSiteRightHideBar.GetControlsAlign: TAlign; +begin + Result := alLeft; +end; + +function TdxDockSiteRightHideBar.GetPosition: TdxAutoHidePosition; +begin + Result := ahpRight; +end; + +procedure TdxDockSiteRightHideBar.SetFinalPosition(AControl: TdxCustomDockControl); +begin + AControl.AutoHideContainer.SetBounds(Owner.GetClientLeft + Owner.GetClientWidth - AControl.OriginalWidth, + Owner.GetClientTop, AControl.OriginalWidth, Owner.GetClientHeight); +end; + +procedure TdxDockSiteRightHideBar.SetInitialPosition(AControl: TdxCustomDockControl); +begin + AControl.AutoHideContainer.SetBounds(Owner.GetClientLeft + Owner.GetClientWidth, + Owner.GetClientTop, 0, Owner.GetClientHeight); +end; + +procedure TdxDockSiteRightHideBar.UpdatePosition(ADelta: Integer); +begin + if (ADelta > 0) and (Owner.MovingContainer.Width + ADelta > Owner.MovingControl.OriginalWidth) then + SetFinalPosition(Owner.MovingControl) + else if (ADelta < 0) and (Owner.MovingContainer.Width + ADelta < 0) then + SetInitialPosition(Owner.MovingControl) + else Owner.MovingContainer.SetBounds(Owner.MovingContainer.Left - ADelta, Owner.MovingContainer.Top, + Owner.MovingContainer.Width + ADelta, Owner.MovingContainer.Height); +end; + +{ TdxDockSiteBottomHideBar } + +procedure TdxDockSiteBottomHideBar.Calculate(R: TRect); +begin + FRect.Left := R.Left; + FRect.Bottom := R.Bottom; + FRect.Right := R.Right; + SetLength(FButtonsRects, DockControlCount); + if Visible then + begin + FRect.Top := FRect.Bottom - Painter.GetHideBarHeight; + CalculateButtons(FRect); + end + else FRect.Top := FRect.Bottom; +end; + +function TdxDockSiteBottomHideBar.GetContainersAnchors: TAnchors; +begin + Result := [akBottom, akLeft, akRight]; +end; + +function TdxDockSiteBottomHideBar.GetControlsAlign: TAlign; +begin + Result := alTop; +end; + +function TdxDockSiteBottomHideBar.GetPosition: TdxAutoHidePosition; +begin + Result := ahpBottom; +end; + +procedure TdxDockSiteBottomHideBar.SetFinalPosition(AControl: TdxCustomDockControl); +begin + AControl.AutoHideContainer.SetBounds(Owner.GetClientLeft, + Owner.GetClientTop + Owner.GetClientHeight - AControl.OriginalHeight, + Owner.GetClientWidth, AControl.OriginalHeight); +end; + +procedure TdxDockSiteBottomHideBar.SetInitialPosition(AControl: TdxCustomDockControl); +begin + AControl.AutoHideContainer.SetBounds(Owner.GetClientLeft, Owner.GetClientTop + Owner.GetClientHeight, + Owner.GetClientWidth, 0); +end; + +procedure TdxDockSiteBottomHideBar.UpdatePosition(ADelta: Integer); +begin + if (ADelta > 0) and (Owner.MovingContainer.Height + ADelta > Owner.MovingControl.OriginalHeight) then + SetFinalPosition(Owner.MovingControl) + else if (ADelta < 0) and (Owner.MovingContainer.Height + ADelta < 0) then + SetInitialPosition(Owner.MovingControl) + else Owner.MovingContainer.SetBounds(Owner.MovingContainer.Left, Owner.MovingContainer.Top - ADelta, + Owner.MovingContainer.Width, Owner.MovingContainer.Height + ADelta); +end; + +{ TdxDockSite } + +constructor TdxDockSite.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FHideBars := TList.Create; + CreateHideBars; + FHidingTimerID := -1; + FMovingTimerID := -1; + FShowingTimerID := -1; + UseDoubleBuffer := True; + UpdateDockZones; +end; + +destructor TdxDockSite.Destroy; +begin + DestroyHideBars; + FHideBars.Free; + inherited; +end; + +function TdxDockSite.GetHideBarByControl(AControl: TdxCustomDockControl): TdxDockSiteHideBar; +var + I: Integer; +begin + Result := nil; + for I := 0 to HideBarCount - 1 do + if (HideBars[I].IndexOfDockControl(AControl) > -1) then + begin + Result := HideBars[I]; + Break; + end; +end; + +function TdxDockSite.GetHideBarByPosition(APosition: TdxAutoHidePosition): TdxDockSiteHideBar; +var + I: Integer; +begin + Result := nil; + for I := 0 to HideBarCount - 1 do + if (HideBars[I].Position = APosition) then + begin + Result := HideBars[I]; + Break; + end; +end; + +procedure TdxDockSite.CreateHideBars; +begin + FHideBars.Add(TdxDockSiteTopHideBar.Create(Self)); + FHideBars.Add(TdxDockSiteBottomHideBar.Create(Self)); + FHideBars.Add(TdxDockSiteLeftHideBar.Create(Self)); + FHideBars.Add(TdxDockSiteRightHideBar.Create(Self)); +end; + +procedure TdxDockSite.DestroyHideBars; +var + I: Integer; + AHideBar: TdxDockSiteHideBar; +begin + if FHideBars = nil then exit; + for I := 0 to FHideBars.Count - 1 do + begin + AHideBar := TdxDockSiteHideBar(FHideBars[I]); + AHideBar.Free; + end; + FHideBars.Clear; +end; + +function TdxDockSite.CanDockHost(AControl: TdxCustomDockControl; AType: TdxDockingType): Boolean; +begin + Result := inherited CanDockHost(AControl, AType); + Result := Result and ((AType in [dtLeft, dtRight, dtTop, dtBottom]) or + ((Atype in [dtClient]) and (ChildCount = 0))); + Result := Result and (not AutoSize or ((AutoSizeClientControl = nil) and (AType = dtClient))); +end; + +function TdxDockSite.GetPositionByControl(AControl: TdxCustomDockControl): TdxAutoHidePosition; +var + AHideBar: TdxDockSiteHideBar; +begin + AHideBar := GetHideBarByControl(AControl); + if AHideBar <> nil then + Result := AHideBar.Position + else + Result := ahpLeft; +end; + +function TdxDockSite.HasAutoHideControls: Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to HideBarCount - 1 do + if HideBars[I].DockControlCount > 0 then + begin + Result := True; + Break; + end; +end; + +function TdxDockSite.GetControlAtPos(pt: TPoint; var SubControl: TdxCustomDockControl): TdxCustomDockControl; +var + I: Integer; +begin + Result := nil; + pt := ClientToWindow(pt); + for I := 0 to HideBarCount - 1 do + begin + Result := HideBars[I].GetControlAtPos(pt, SubControl); + if Result <> nil then + Break; + end; +end; + +function TdxDockSite.GetHideBarAtPos(pt: TPoint): TdxDockSiteHideBar; +var + I: Integer; +begin + Result := nil; + pt := ClientToWindow(pt); + for I := 0 to HideBarCount - 1 do + if HideBars[I].Visible and ptInRect(HideBars[I].Rect, pt) then + begin + Result := HideBars[I]; + Break; + end; +end; + +function TdxDockSite.GetControlAutoHidePosition(AControl: TdxCustomDockControl): TdxAutoHidePosition; +begin + if AutoSize then + begin + case Align of + alTop: Result := ahpTop; + alBottom: Result := ahpBottom; + alLeft: Result := ahpLeft; + alRight: Result := ahpRight; + else + if AControl.Width > AControl.Height then + Result := ahpTop + else + Result := ahpLeft; + end; + end + else + Result := inherited GetControlAutoHidePosition(AControl); +end; + +procedure TdxDockSite.RegisterAutoHideDockControl(AControl: TdxCustomDockControl; + APosition: TdxAutoHidePosition); +var + AHideBar: TdxDockSiteHideBar; +begin + NCChanged; + ImmediatelyHide; + AHideBar := GetHideBarByPosition(APosition); + if AHideBar <> nil then + begin + AControl.FAutoHidePosition := APosition; + FMovingControlHideBar := AHideBar; + FMovingControl := AControl; + try + AHideBar.RegisterDockControl(AControl); + if Controller.ActiveDockControl = AControl then + Controller.ActiveDockControl := nil; + finally + FMovingControl := nil; + FMovingControlHideBar := nil; + end; + end; +end; + +procedure TdxDockSite.UnregisterAutoHideDockControl(AControl: TdxCustomDockControl); +var + AHideBar: TdxDockSiteHideBar; +begin + NCChanged; + ImmediatelyHide(True); + AHideBar := GetHideBarByControl(AControl); + if AHideBar <> nil then + begin + FMovingControlHideBar := AHideBar; + FMovingControl := AControl; + Assert(MovingContainer <> nil, sdxInternalErrorAutoHide); + try + AHideBar.UnregisterDockControl(AControl); + finally + FMovingControl := nil; + FMovingControlHideBar := nil; + end; + AControl.FAutoHidePosition := ahpUndefined;; + end; +end; + +procedure TdxDockSite.AdjustAutoSizeBounds; +begin + if IsDestroying or not AutoSize or (Align = alClient) then exit; + if ChildCount > 0 then + SetSize(FAutoSizeWidth, FAutoSizeHeight) + else + SetSize(FOriginalWidth, FOriginalHeight); + BringToFront; +end; + +function TdxDockSite.CanAutoSizeChange: Boolean; +begin + Result := FAutoSize or (ChildCount = 0) or IsLoading; // childCount = 1 TODO: !!! +end; + +procedure TdxDockSite.CheckAutoSizeBounds; +var + AContainer: TdxContainerDockSite; +begin + // TODO: Is Simple + GetContainer + if AutoSize and (ChildCount = 2) and (ValidChildCount = 0) then + begin + if Children[0] is TdxContainerDockSite then + AContainer := Children[0] as TdxContainerDockSite + else + if Children[1] is TdxContainerDockSite then + AContainer := Children[1] as TdxContainerDockSite + else + AContainer := nil; // error! + ChildVisibilityChanged(AContainer); + end; +end; + +function TdxDockSite.GetAutoSizeClientControl: TdxCustomDockControl; +begin + if AutoSize and (ChildCount > 1) and Children[0].CanDock then + Result := Children[0] + else + if AutoSize and (ChildCount > 1) and Children[1].CanDock then + Result := Children[1] + else + Result := nil; +end; + +procedure TdxDockSite.UpdateAutoSizeBounds(AWidth, AHeight: Integer); +begin + if not AutoSize then Exit; + FAutoSizeHeight := AHeight; + FAutoSizeWidth := AWidth; +end; + +procedure TdxDockSite.DoHideControl(AControl: TdxCustomDockControl); +begin + if Assigned(FOnHideControl) then + FOnHideControl(Self, AControl); +end; + +procedure TdxDockSite.DoShowControl(AControl: TdxCustomDockControl); +begin + if Assigned(FOnShowControl) then + FOnShowControl(Self, AControl); +end; + +procedure ShowMovementTimerProc(Wnd: HWnd; Msg, TimerID, SysTime: Longint); stdcall; +var + AControl: TdxDockSite; +begin + AControl := TdxDockSite(FindControl(Wnd)); + if AControl <> nil then + AControl.DoShowMovement; +end; + +procedure TdxDockSite.DoShowMovement; +begin + MovingControlHideBar.UpdatePosition(ControllerAutoHideMovingSize); + if MovingControlHideBar.CheckShowingFinish then + begin + if FMovingTimerID > -1 then + begin + KillTimer(Handle, FMovingTimerID); + FMovingTimerID := -1; + end; + FMovingControlHideBar := nil; + FShowingControl := FMovingControl; + FMovingControl := nil; + InitializeHiding; + end + else + if FMovingTimerID < 0 then + FMovingTimerID := SetTimer(Handle, 1, ControllerAutoHideMovingInterval, @ShowMovementTimerProc); +end; + +procedure HideMovementTimerProc(Wnd: HWnd; Msg, TimerID, SysTime: Longint); stdcall; +var + AControl: TdxDockSite; +begin + AControl := TdxDockSite(FindControl(Wnd)); + if AControl <> nil then + AControl.DoHideMovement; +end; + +procedure TdxDockSite.DoHideMovement; +begin + MovingControlHideBar.UpdatePosition(-ControllerAutoHideMovingSize); + if MovingControlHideBar.CheckHidingFinish then + begin + DoHideControl(FMovingControl); + if FMovingTimerID > -1 then + begin + KillTimer(Handle, FMovingTimerID); + FMovingTimerID := -1; + end; + Assert(MovingContainer <> nil, sdxInternalErrorAutoHide); + MovingContainer.Visible := False; + MovingControl.SetVisibility(False); + FMovingControlHideBar := nil; + FMovingControl := nil; + FShowingControl := nil; + FinalizeHiding; + end + else + if FMovingTimerID < 0 then + FMovingTimerID := SetTimer(Handle, 1, ControllerAutoHideMovingInterval, @HideMovementTimerProc); +end; + +procedure TdxDockSite.ImmediatelyHide(AFinalizing: Boolean = False); +begin + if ShowingControl <> nil then + begin + DoHideControl(ShowingControl); + if not AFinalizing then + ShowingControl.AutoHideContainer.Visible := False; + ShowingControl.SetVisibility(False); + if (Controller.ActiveDockControl = ShowingControl) and + (Controller.ActiveDockControl <> Controller.FActivatingDockControl) then + Controller.ActiveDockControl := nil; + FShowingControl := nil; + FinalizeHiding; + end; + FMovingControl := nil; + FMovingControlHideBar := nil; + if FMovingTimerID > -1 then + begin + KillTimer(Handle, FMovingTimerID); + FMovingTimerID := -1; + end; +end; + +procedure TdxDockSite.ImmediatelyShow(AControl: TdxCustomDockControl); +var + AHideBar: TdxDockSiteHideBar; +begin + if MovingControl <> nil then exit; + if ShowingControl <> AControl then + begin + ImmediatelyHide; + AHideBar := GetHideBarByControl(AControl); + if AHideBar <> nil then + begin + FShowingControl := AControl; + AHideBar.SetFinalPosition(AControl); + AControl.AutoHideContainer.Visible := True; + AControl.SetVisibility(True); + AControl.AutoHideContainer.BringToFront; + DoShowControl(AControl); + InitializeHiding; + end; + end; +end; + +procedure AutoHideTimerProc(Wnd: HWnd; Msg, TimerID, SysTime: Longint); stdcall; +var + AControl: TdxDockSite; +begin + AControl := TdxDockSite(FindControl(Wnd)); + if (AControl <> nil) and (AControl.ShowingControl <> nil) then + AControl.FinalizeHiding + else + KillTimer(Wnd, TimerID); +end; + +procedure TdxDockSite.InitializeHiding; +begin + if FHidingTimerID > -1 then + begin + KillTimer(Handle, FHidingTimerID); + FHidingTimerID := -1; + end; + if not IsDestroying and (FHidingTimerID = -1) and (ShowingControl <> nil) then + FHidingTimerID := SetTimer(Handle, 2, ControllerAutoHideInterval, @AutoHideTimerProc) +end; + +procedure AutoShowTimerProc(Wnd: HWnd; Msg, TimerID, SysTime: Longint); stdcall; +var + AControl: TdxDockSite; +begin + AControl := TdxDockSite(FindControl(Wnd)); + if AControl <> nil then + AControl.FinalizeShowing + else + KillTimer(Wnd, TimerID); +end; + +procedure TdxDockSite.InitializeShowing; +begin + if not IsDestroying and (FShowingTimerID = -1) then + FShowingTimerID := SetTimer(Handle, 3, ControllerAutoShowInterval, @AutoShowTimerProc) +end; + +procedure TdxDockSite.FinalizeHiding; +var + pt: TPoint; + AControl: TdxCustomDockControl; +begin + if Controller.IsDocking or Controller.IsResizing then Exit; + if MovingControl <> nil then Exit; + if ShowingControl <> nil then + begin + GetCursorPos(pt); + AControl := Controller.GetDockControlAtPos(pt); + if + not (((AControl = Self) and (GetHideBarAtPos(ScreenToClient(pt)) <> nil)) or + ((AControl <> nil) and (AControl.AutoHideControl = ShowingControl)) or + (not (doHideAutoHideIfActive in ControllerOptions) and (Controller.ActiveDockControl <> nil) and + (Controller.ActiveDockControl.AutoHideControl = ShowingControl))) then + ShowingControl := nil; + end + else + if FHidingTimerID > -1 then + begin + KillTimer(Handle, FHidingTimerID); + FHidingTimerID := -1; + end; +end; + +procedure TdxDockSite.FinalizeShowing; +var + pt: TPoint; + AControl, ASubControl: TdxCustomDockControl; +begin + if FShowingTimerID > -1 then + begin + KillTimer(Handle, FShowingTimerID); + FShowingTimerID := -1; + end; + GetCursorPos(pt); + ASubControl := nil; + AControl := GetControlAtPos(ScreenToClient(pt), ASubControl); + if (FShowingControlCandidate <> nil) and (FShowingControlCandidate = AControl) and not (disContextMenu in Controller.FInternalState) then + begin + if (ASubControl <> nil) and (AControl is TdxTabContainerDockSite) then + begin + if ASubControl <> (AControl as TdxTabContainerDockSite).ActiveChild then + begin + ImmediatelyHide; + (AControl as TdxTabContainerDockSite).ActiveChild := ASubControl; + end; + ShowingControl := AControl; + end + else + if (AControl <> nil) then + ShowingControl := AControl; + end; +end; + +procedure TdxDockSite.SetFinalPosition(AControl: TdxCustomDockControl); +var + AHideBar: TdxDockSiteHideBar; +begin + AHideBar := GetHideBarByControl(AControl); + if AHideBar <> nil then + AHideBar.SetFinalPosition(AControl); +end; + +procedure TdxDockSite.SetInitialPosition(AControl: TdxCustomDockControl); +var + AHideBar: TdxDockSiteHideBar; +begin + AHideBar := GetHideBarByControl(AControl); + if AHideBar <> nil then + AHideBar.SetInitialPosition(AControl); +end; + +function TdxDockSite.GetClientLeft: Integer; +begin + Result := ClientOrigin.X - Parent.ClientOrigin.X; +end; + +function TdxDockSite.GetClientTop: Integer; +begin + Result := ClientOrigin.Y - Parent.ClientOrigin.Y; +end; + +function TdxDockSite.GetClientWidth: Integer; +begin + Result := ClientWidth; +end; + +function TdxDockSite.GetClientHeight: Integer; +begin + Result := ClientHeight; +end; + +procedure TdxDockSite.Loaded; +begin + inherited; + CheckAutoSizeBounds; + UpdateDockZones; +end; + +procedure TdxDockSite.ReadState(Reader: TReader); +begin + inherited; + UpdateLayout; +end; + +procedure TdxDockSite.SetAutoSize(Value: Boolean); +begin + if (FAutoSize <> Value) and CanAutoSizeChange then + begin + FAutoSize := Value; + if not IsLoading then + begin + AdjustAutoSizeBounds; + UpdateLayout; + end; + end; +end; + +procedure TdxDockSite.SetParent(AParent: TWinControl); +begin + if IsDesigning and not IsLoading and ParentIsDockControl(AParent) then + raise Exception.Create(sdxInvalidDockSiteParent) + else + inherited SetParent(AParent); +end; + +procedure TdxDockSite.ValidateInsert(AComponent: TComponent); +begin + if not ((AComponent is TdxCustomDockControl) or (AComponent is TdxDockSiteAutoHideContainer)) then + begin + if AComponent is TControl then + (AComponent as TControl).Parent := ParentForm; + raise Exception.CreateFmt(sdxInvalidSiteChild, [AComponent.ClassName]); + end; +end; + +procedure TdxDockSite.UpdateControlResizeZones(AControl: TdxCustomDockControl); +begin + if AutoSize and (AControl <> Self) then + begin + if TdxAutoSizeRightZone.ValidateResizeZone(Self, AControl) then + AControl.ResizeZones.Insert(0, TdxAutoSizeRightZone.Create(Self, ControllerResizeZonesWidth, zkResizing)); + if TdxAutoSizeLeftZone.ValidateResizeZone(Self, AControl) then + AControl.ResizeZones.Insert(0, TdxAutoSizeLeftZone.Create(Self, ControllerResizeZonesWidth, zkResizing)); + if TdxAutoSizeBottomZone.ValidateResizeZone(Self, AControl) then + AControl.ResizeZones.Insert(0, TdxAutoSizeBottomZone.Create(Self, ControllerResizeZonesWidth, zkResizing)); + if TdxAutoSizeTopZone.ValidateResizeZone(Self, AControl) then + AControl.ResizeZones.Insert(0, TdxAutoSizeTopZone.Create(Self, ControllerResizeZonesWidth, zkResizing)); + end + else + inherited UpdateControlResizeZones(AControl); +end; + +procedure TdxDockSite.UpdateControlDockZones(AControl: TdxCustomDockControl; AZoneWidth: Integer); +begin + if AutoSize then + begin + if TdxAutoSizeClientZone.ValidateDockZone(Self, AControl) then + AControl.DockZones.Insert(0, TdxAutoSizeClientZone.Create(Self, AZoneWidth)) + else + if TdxInvisibleAutoSizeClientZone.ValidateDockZone(Self, AControl) then + AControl.DockZones.Insert(0, TdxInvisibleAutoSizeClientZone.Create(Self, AZoneWidth)); + end + else + begin + if TdxClientZone.ValidateDockZone(Self, AControl) then + AControl.DockZones.Insert(0, TdxClientZone.Create(Self, AZoneWidth)) + else + if TdxInvisibleClientZone.ValidateDockZone(Self, AControl) then + AControl.DockZones.Insert(0, TdxInvisibleClientZone.Create(Self, AZoneWidth)); + inherited; + end; +end; + +procedure TdxDockSite.CreateLayout(AControl: TdxCustomDockControl; AType: TdxDockingType; + Index: Integer); +var + AWidth, AHeight: Integer; +begin + AWidth := AControl.OriginalWidth; + AHeight := AControl.OriginalHeight; + inherited; + UpdateAutoSizeBounds(AWidth, AHeight); + AdjustAutoSizeBounds; +end; + +procedure TdxDockSite.DestroyLayout(AControl: TdxCustomDockControl); +begin + inherited; + AdjustAutoSizeBounds; +end; + +procedure TdxDockSite.LoadLayoutFromCustomIni(AIniFile: TCustomIniFile; + AParentForm: TCustomForm; AParentControl: TdxCustomDockControl; ASection: string); +var + I, AChildCount: Integer; + AChildSection: string; + ADockTypes: TdxDockingTypes; +begin + BeginUpdateLayout; + try + with AIniFile do + begin + ADockTypes := []; + if ReadBool(ASection, 'AllowDockClientsLeft', dtLeft in AllowDockClients) then + ADockTypes := ADockTypes + [dtLeft]; + if ReadBool(ASection, 'AllowDockClientsTop', dtTop in AllowDockClients) then + ADockTypes := ADockTypes + [dtTop]; + if ReadBool(ASection, 'AllowDockClientsRight', dtRight in AllowDockClients) then + ADockTypes := ADockTypes + [dtRight]; + if ReadBool(ASection, 'AllowDockClientsBottom', dtBottom in AllowDockClients) then + ADockTypes := ADockTypes + [dtBottom]; + if ReadBool(ASection, 'AllowDockClientsClient', dtClient in AllowDockClients) then + ADockTypes := ADockTypes + [dtClient]; + AllowDockClients := ADockTypes; + Visible := ReadBool(ASection, 'Visible', Visible); + AChildCount := ReadInteger(ASection, 'ChildCount', 0); + for I := 0 to AChildCount - 1 do + begin + AChildSection := ReadString(ASection, 'Children' + IntToStr(I), ''); + Controller.LoadControlFromCustomIni(AIniFile, AParentForm, Self, AChildSection); + end; + Width := ReadInteger(ASection, 'Width', Width); + Height := ReadInteger(ASection, 'Height', Height); + FOriginalWidth := ReadInteger(ASection, 'OriginalWidth', OriginalWidth); + FOriginalHeight := ReadInteger(ASection, 'OriginalHeight', OriginalHeight); + FAutoSize := ReadBool(ASection, 'AutoSize', AutoSize); + // TODO: !!! + AdjustAutoSizeBounds; + end; + finally + EndUpdateLayout; + end; +end; + +procedure TdxDockSite.SaveLayoutToCustomIni(AIniFile: TCustomIniFile; ASection: string); +var + I: Integer; +begin + with AIniFile do + begin + WriteInteger(ASection, 'ChildCount', ChildCount); + for I := 0 to ChildCount - 1 do + WriteString(ASection, 'Children' + IntToStr(I), IntToStr(Controller.IndexOfDockControl(Children[I]))); + WriteBool(ASection, 'AllowDockClientsLeft', dtLeft in AllowDockClients); + WriteBool(ASection, 'AllowDockClientsTop', dtTop in AllowDockClients); + WriteBool(ASection, 'AllowDockClientsRight', dtRight in AllowDockClients); + WriteBool(ASection, 'AllowDockClientsBottom', dtBottom in AllowDockClients); + WriteBool(ASection, 'AllowDockClientsClient', dtClient in AllowDockClients); + WriteInteger(ASection, 'Width', Width); + WriteInteger(ASection, 'Height', Height); + WriteInteger(ASection, 'OriginalWidth', OriginalWidth); + WriteInteger(ASection, 'OriginalHeight', OriginalHeight); + WriteBool(ASection, 'Visible', Visible); + WriteBool(ASection, 'AutoSize', AutoSize); + end; + for I := 0 to ChildCount - 1 do + Controller.SaveControlToCustomIni(AIniFile, Children[I]); +end; + +procedure TdxDockSite.ChildVisibilityChanged(Sender: TdxCustomDockControl); +var + AHideBar: TdxDockSiteHideBar; +begin + // TODO: !!! + if AutoSize and (AutoSizeClientControl = Sender) then + begin + if Sender.Visible and not HasAutoHideControls then + UpdateAutoSizeBounds(Sender.OriginalWidth, Sender.OriginalHeight) + else + if not Sender.Visible and not HasAutoHideControls then + UpdateAutoSizeBounds(FOriginalWidth, FOriginalHeight) + else + if HasAutoHideControls then + begin + AHideBar := GetHideBarByPosition(GetControlAutoHidePosition(Sender)); + if AHideBar <> nil then + AHideBar.UpdateOwnerAutoSizeBounds(Sender); + end; + AdjustAutoSizeBounds; + end; +end; + +procedure TdxDockSite.UpdateControlOriginalSize(AControl: TdxCustomDockControl); +begin + if not AutoSize and (AControl <> Self) then + inherited + else + if (AControl <> Self) and (AControl.UpdateVisibilityLock = 0) and + not AControl.IsUpdateLayoutLocked then + begin + case Align of + alLeft, alRight: + AControl.FOriginalWidth := Width; + alTop, alBottom: + AControl.FOriginalHeight := Height; + end; + end + else + if not AutoSize or (ChildCount = 0) then + begin + AControl.FOriginalWidth := Width; + AControl.FOriginalHeight := Height; + end; +end; + +procedure TdxDockSite.CalculateNC(var ARect: TRect); +var + I: Integer; +begin + inherited; + for I := 0 to HideBarCount - 1 do + HideBars[I].Calculate(ARect); + + ARect.Left := ARect.Left + (LeftHideBar.Rect.Right - LeftHideBar.Rect.Left); + ARect.Right := ARect.Right - (RightHideBar.Rect.Right - RightHideBar.Rect.Left); + ARect.Top := ARect.Top + (TopHideBar.Rect.Bottom - TopHideBar.Rect.Top); + ARect.Bottom := ARect.Bottom - (BottomHideBar.Rect.Bottom - BottomHideBar.Rect.Top); +end; + +procedure TdxDockSite.NCPaint(ACanvas: TCanvas); +var + I, J: Integer; +begin + for I := 0 to HideBarCount - 1 do + if HideBars[I].Visible then + begin + Painter.DrawHideBar(ACanvas, HideBars[I].Rect, HideBars[I].Position); + for J := 0 to HideBars[I].ButtonRectCount - 1 do + Painter.DrawHideBarButton(ACanvas, HideBars[I].DockControls[J], + HideBars[I].ButtonsRects[J], HideBars[I].Position); + end; +end; + +procedure TdxDockSite.Recalculate; +begin + CheckAutoSizeBounds; + inherited; +end; + +function TdxDockSite.GetHideBarCount: Integer; +begin + Result := FHideBars.Count; +end; + +function TdxDockSite.GetHideBar(Index: Integer): TdxDockSiteHideBar; +begin + if (0 <= Index) and (Index < FHideBars.Count) then + Result := TdxDockSiteHideBar(FHideBars[Index]) + else + Result := nil; +end; + +function TdxDockSite.GetMovingContainer: TdxDockSiteAutoHideContainer; +begin + if FMovingControl <> nil then + Result := FMovingControl.AutoHideContainer + else + Result := nil; +end; + +procedure TdxDockSite.SetShowingControl(Value: TdxCustomDockControl); +var + AHideBar: TdxDockSiteHideBar; +begin + if (FShowingControl <> Value) and (MovingControl = nil) then + begin + if Value <> nil then + begin + ImmediatelyHide; + AHideBar := GetHideBarByControl(Value); + if AHideBar <> nil then + begin + FMovingControlHideBar := AHideBar; + FMovingControl := Value; + Assert(MovingContainer <> nil, sdxInternalErrorAutoHide); + MovingControlHideBar.SetInitialPosition(Value); + MovingContainer.Visible := True; + MovingControl.SetVisibility(True); + MovingContainer.BringToFront; + DoShowControl(Value); + DoShowMovement; + end; + end + else + begin + AHideBar := GetHideBarByControl(FShowingControl); + if AHideBar <> nil then + begin + FMovingControlHideBar := AHideBar; + FMovingControl := FShowingControl; + Assert(MovingContainer <> nil, sdxInternalErrorAutoHide); + DoHideMovement; + end; + end; + end; +end; + +procedure TdxDockSite.CMControlListChange(var Message: TMessage); +begin + if IsDesigning and not IsLoading and Boolean(Message.LParam) {Inserting} and + IsControlContainsDockSite(TControl(Message.WParam)) then + raise Exception.Create(sdxInvalidDockSiteParent); + inherited; +end; + +procedure TdxDockSite.CMDesignHitTest(var Message: TCMDesignHitTest); +var + pt: TPoint; +begin + inherited; + pt := Point(Message.XPos, Message.YPos); + if GetHideBarAtPos(pt) <> nil then + Message.Result := 1; +end; + +procedure TdxDockSite.CMMouseLeave(var Message: TMessage); +begin + inherited; + if ShowingControl <> nil then InitializeHiding; +end; + +procedure TdxDockSite.WMLButtonDown(var Message: TWMLButtonDown); +var + AControl, ASubControl: TdxCustomDockControl; +begin + inherited; + if Message.Result = 0 then + begin + AControl := GetControlAtPos(SourcePoint, ASubControl); + if AControl <> nil then + begin + Controller.ActiveDockControl := AControl; + Controller.FActivatingDockControl := AControl; + Message.Result := 1; + end; + end +end; + +procedure TdxDockSite.WMMouseMove(var Message: TWMMouseMove); +var + ASubControl: TdxCustomDockControl; +begin + inherited; + if (Message.Result = 0) and (ParentFormActive or IsDesigning) then + begin + FShowingControlCandidate := GetControlAtPos(CursorPoint, ASubControl); + if FShowingControlCandidate <> nil then + InitializeShowing; + Message.Result := 1; + end; +end; + +{ TdxFloatDockSite } + +constructor TdxFloatDockSite.Create(AOwner: TComponent); +begin + inherited; + CreateFloatForm; +end; + +destructor TdxFloatDockSite.Destroy; +begin + DestroyFloatForm; + inherited; +end; + +procedure TdxFloatDockSite.BeforeDestruction; +begin + if not CanDestroy then + raise Exception.Create(sdxInvalidFloatSiteDeleting); + inherited; +end; + +procedure TdxFloatDockSite.HideFloatForm; +begin + if FloatForm <> nil then + begin + FloatForm.Hide; + FloatForm.SetDesigning(False); + end; +end; + +procedure TdxFloatDockSite.ShowFloatForm; +begin + if (FloatForm <> nil) and Visible and (ParentFormVisible or IsDesigning) then + begin + FloatForm.Show; + FloatForm.SetDesigning(IsDesigning); + FFloatLeft := FloatForm.Left; + FFloatTop := FloatForm.Top; + end; +end; + +procedure TdxFloatDockSite.SetFloatFormPosition(ALeft, ATop: Integer); +var + R: TRect; +begin + if FloatForm = nil then Exit; + // check work area + R := GetDesktopWorkArea(Point(ALeft, ATop)); + if ALeft < R.Left then ALeft := R.Left; + if ALeft >= R.Right then ALeft := R.Right - FloatForm.Width; + if ATop < R.Top then ATop := R.Top; + if ATop >= R.Bottom then ATop := R.Bottom - FloatForm.Height; + FloatForm.SetBounds(ALeft, ATop, FloatForm.Width, FloatForm.Height); +end; + +procedure TdxFloatDockSite.SetFloatFormSize(AWidth, AHeight: Integer); +begin + if FloatForm = nil then exit; + if FloatForm.HandleAllocated then + begin + FloatForm.ClientWidth := AWidth; + FloatForm.ClientHeight := AHeight; + end + else + begin + FloatForm.FClientHeight := AHeight; + FloatForm.FClientWidth := AWidth; + end; +end; + +function TdxFloatDockSite.HasParent: Boolean; +begin + Result := False; +end; + +procedure TdxFloatDockSite.Loaded; +begin + inherited; + CreateFloatForm; + UpdateCaption; + ShowFloatForm; + + if IsDesigning and IsLoadingFromForm then // Anchors bug - see TdxFloatForm.InsertDockSite + SetDockType(dtClient); + + SetFloatFormSize(OriginalWidth, OriginalHeight); +end; + +procedure TdxFloatDockSite.SetParent(AParent: TWinControl); +begin + if not IsUpdateLayoutLocked and not IsDestroying and + ((AParent = nil) or not (csLoading in AParent.ComponentState)) then + raise Exception.Create(sdxInvalidParentAssigning) + else if (AParent <> nil) and not (AParent is TCustomForm) then + raise Exception.Create(sdxInvalidFloatSiteParent) + else inherited SetParent(AParent); +end; + +function TdxFloatDockSite.IsLoadingFromForm: Boolean; +begin + Result := csLoading in Owner.ComponentState; // Anchors bug - see TdxFloatForm.InsertDockSite +end; + +function TdxFloatDockSite.CanUndock(AControl: TdxCustomDockControl): Boolean; +begin + Result := ValidChildCount > 1; +end; + +procedure TdxFloatDockSite.StartDocking(pt: TPoint); +begin + if Child <> nil then + Child.StartDocking(pt); +end; + +procedure TdxFloatDockSite.CheckDockClientsRules; +begin +end; + +procedure TdxFloatDockSite.UpdateControlDockZones(AControl: TdxCustomDockControl; AZoneWidth: Integer); +begin + if doUseCaptionAreaToClientDocking in ControllerOptions then + if TdxFloatZone.ValidateDockZone(Self, AControl) then + AControl.DockZones.Insert(0, TdxFloatZone.Create(Self)); +end; + +procedure TdxFloatDockSite.AdjustControlBounds(AControl: TdxCustomDockControl); +begin + if FloatForm <> nil then + SetFloatFormSize(AControl.OriginalWidth, AControl.OriginalHeight) + else inherited; +end; + +procedure TdxFloatDockSite.UpdateControlOriginalSize(AControl: TdxCustomDockControl); +begin + if not FloatFormVisible then exit; + AControl.FOriginalHeight := Height; + AControl.FOriginalWidth := Width; +end; + +procedure TdxFloatDockSite.UpdateFloatPosition; +begin + if FloatFormVisible then + begin + FFloatLeft := FloatForm.Left; + FFloatTop := FloatForm.Top; + Modified; + end; +end; + +procedure TdxFloatDockSite.ChildVisibilityChanged(Sender: TdxCustomDockControl); +begin + if Sender = Child then + begin + Visible := Sender.Visible; + FloatForm.Visible := Sender.Visible and ParentFormVisible; + end; +end; + +procedure TdxFloatDockSite.Activate; +begin + if GetDockPanel <> nil then + GetDockPanel.Activate + else + begin // old code + if Child <> nil then + Child.Activate; + end; +end; + +procedure TdxFloatDockSite.DoClose; +begin + if Child <> nil then + Child.DoClose; +end; + +function TdxFloatDockSite.CanDestroy: Boolean; +begin + Result := (Child = nil) or Child.IsDestroying; +end; + +function TdxFloatDockSite.CanDockHost(AControl: TdxCustomDockControl; AType: TdxDockingType): Boolean; +begin + Result := False; +end; + +function TdxFloatDockSite.GetDockPanel: TdxCustomDockControl; +begin + Result := Child; + if not (Result is TdxDockPanel) then + begin + if Result is TdxSideContainerDockSite then + begin + if (Result as TdxSideContainerDockSite).ActiveChild <> nil then + Result := (Result as TdxSideContainerDockSite).ActiveChild + else + if (Result as TdxSideContainerDockSite).ValidChildCount > 0 then + Result := (Result as TdxSideContainerDockSite).ValidChildren[0] + else + Result := nil; + end + else + begin + if Result is TdxContainerDockSite then + Result := (Result as TdxContainerDockSite).ActiveChild + else + Result := nil; + end; + end; +end; + +procedure TdxFloatDockSite.CreateLayout(AControl: TdxCustomDockControl; + AType: TdxDockingType; Index: Integer); +begin + Assert(ChildCount = 0, Format(sdxInternalErrorCreateLayout, [ClassName])); + AControl.IncludeToDock(Self, AType, 0); +end; + +procedure TdxFloatDockSite.DestroyLayout(AControl: TdxCustomDockControl); +begin + Assert(ChildCount = 1, Format(sdxInternalErrorDestroyLayout, [ClassName])); + Include(FInternalState, dcisDestroying); + AControl.ExcludeFromDock; + if not IsDestroying then DoDestroy; +end; + +procedure TdxFloatDockSite.LoadLayoutFromCustomIni(AIniFile: TCustomIniFile; + AParentForm: TCustomForm; AParentControl: TdxCustomDockControl; ASection: string); +begin + inherited; + with AIniFile do + begin + FloatLeft := ReadInteger(ASection, 'FloatLeft', FloatLeft); + FloatTop := ReadInteger(ASection, 'FloatTop', FloatTop); + FOriginalWidth := ReadInteger(ASection, 'Width', Width); + FOriginalHeight := ReadInteger(ASection, 'Height', Height); + end; + CreateFloatForm; + UpdateCaption; + ShowFloatForm; + SetFloatFormSize(OriginalWidth, OriginalHeight); + // To fix bad layouts + if ChildCount <> 1 then DoDestroy; +end; + +procedure TdxFloatDockSite.SaveLayoutToCustomIni(AIniFile: TCustomIniFile; + ASection: string); +begin + inherited; + with AIniFile do + begin + WriteInteger(ASection, 'FloatLeft', FloatLeft); + WriteInteger(ASection, 'FloatTop', FloatTop); + end; +end; + +procedure TdxFloatDockSite.DoSetFloatFormCaption; +begin + if Assigned(FOnSetFloatFormCaption) then + FOnSetFloatFormCaption(Self, FloatForm); + Controller.DoSetFloatFormCaption(Self, FloatForm); +end; + +procedure TdxFloatDockSite.UpdateCaption; +begin + if (Child <> nil) and (FloatForm <> nil) then + FloatForm.Caption := Child.Caption; + DoSetFloatFormCaption; +end; + +function TdxFloatDockSite.GetFloatForm: TdxFloatForm; +begin + Result := FFloatForm; +end; + +procedure TdxFloatDockSite.RestoreDockPosition(pt: TPoint); +begin + if (Child <> nil) and Child.Dockable then + Child.RestoreDockPosition(pt); +end; + +procedure TdxFloatDockSite.CreateFloatForm; +var + AWidth, AHeight: Integer; +begin + BeginUpdateLayout; + try + AWidth := OriginalWidth; + AHeight := OriginalHeight; + if FFloatForm = nil then + FFloatForm := TdxFloatForm.Create(Application); + FFloatForm.InsertDockSite(Self); + SetFloatFormPosition(FloatLeft, FloatTop); + SetFloatFormSize(AWidth, AHeight); + if (doFloatingOnTop in ControllerOptions) or IsDesigning then + FFloatForm.SendOnTopMost; + finally + EndUpdateLayout; + end; +end; + +procedure TdxFloatDockSite.DestroyFloatForm; +begin + if FFloatForm = nil then exit; + BeginUpdateLayout; + try + if not FFloatForm.IsDestroying then + FFloatForm.Free; + finally + EndUpdateLayout; + end; +end; + +function TdxFloatDockSite.GetChild: TdxCustomDockControl; +begin + if ChildCount = 1 then + Result := Children[0] + else + Result := nil; +end; + +function TdxFloatDockSite.GetFloatLeft: Integer; +begin + if FloatForm <> nil then + Result := FloatForm.Left + else Result := FFloatLeft; +end; + +function TdxFloatDockSite.GetFloatTop: Integer; +begin + if FloatForm <> nil then + Result := FloatForm.Top + else Result := FFloatTop; +end; + +function TdxFloatDockSite.GetFloatWidth: Integer; +begin + if FloatForm <> nil then + begin + if FloatForm.HandleAllocated then + Result := FloatForm.ClientWidth + else Result := FloatForm.Width; + end + else Result := FFloatWidth; +end; + +function TdxFloatDockSite.GetFloatHeight: Integer; +begin + if FloatForm <> nil then + begin + if FloatForm.HandleAllocated then + Result := FloatForm.ClientHeight + else Result := FloatForm.Height; + end + else Result := FFloatHeight; +end; + +procedure TdxFloatDockSite.SetFloatLeft(const Value: Integer); +begin + FFloatLeft := Value; + if FloatForm <> nil then + FloatForm.Left := Value; +end; + +procedure TdxFloatDockSite.SetFloatTop(const Value: Integer); +begin + FFloatTop := Value; + if FloatForm <> nil then + FloatForm.Top := Value; +end; + +procedure TdxFloatDockSite.SetFloatWidth(const Value: Integer); +begin + FFloatWidth := Value; + if FloatForm <> nil then + begin + if FloatForm.HandleAllocated then + FloatForm.ClientWidth := Value + else FloatForm.Width := Value; + end; +end; + +procedure TdxFloatDockSite.SetFloatHeight(const Value: Integer); +begin + FFloatHeight := Value; + if FloatForm <> nil then + begin + if FloatForm.HandleAllocated then + FloatForm.ClientHeight := Value + else FloatForm.Height := Value; + end; +end; + +procedure TdxFloatDockSite.WMNCHitTest(var Message: TWMNCHitTest); +begin + Message.Result := HTTRANSPARENT; +end; + +{ TdxFloatForm } + +constructor TdxFloatForm.Create(AOwner: TComponent); +begin + CreateNew(AOwner); +{$IFDEF DELPHI9} + Position := poDesigned; + PopupMode := pmExplicit; +{$ENDIF} + FClientHeight := -1; + FClientWidth := -1; + AutoScroll := False; + BorderStyle := bsSizeToolWin; + DefaultMonitor := dmDesktop; + Visible := False; +end; + +destructor TdxFloatForm.Destroy; +begin + RemoveDockSite; + inherited; +end; + +procedure TdxFloatForm.InsertDockSite(ADockSite: TdxFloatDockSite); +begin + FDockSite := ADockSite; + if not (FDockSite.IsDesigning and FDockSite.IsLoadingFromForm) then // Anchors bug - see TdxFloatDockSite.Loaded + FDockSite.SetDockType(dtClient); + FDockSite.Parent := Self; + FCanDesigning := True; +end; + +procedure TdxFloatForm.RemoveDockSite; +begin + FCanDesigning := False; + if FDockSite <> nil then + begin + FDockSite.Parent := nil; + FDockSite.FFloatForm := nil; + FDockSite := nil; + end; +end; + +procedure TdxFloatForm.SendOnTop; +begin + FOnTopMost := False; + RecreateWnd; +end; + +procedure TdxFloatForm.SendOnTopMost; +begin + FOnTopMost := True; + RecreateWnd; +end; + +function TdxFloatForm.CanDesigning: Boolean; +begin + Result := FCanDesigning and IsDesigning and not IsDestroying and + (ParentForm <> nil) and (ParentForm.Designer <> nil) and + not dxDockingController.IsDocking; +end; + +function TdxFloatForm.IsDesigning: Boolean; +begin + Result := csDesigning in ComponentState; +end; + +function TdxFloatForm.IsDestroying: Boolean; +begin + Result := csDestroying in ComponentState; +end; + +procedure TdxFloatForm.CreateParams(var Params: TCreateParams); +begin +{$IFDEF DELPHI9} + PopupParent := ParentForm; +{$ENDIF} + inherited CreateParams(Params); + with Params do + if FOnTopMost then + begin + Style := Style or WS_POPUPWINDOW; + WndParent := ParentForm.Handle; + end + else + WndParent := Application.Handle; +end; + +procedure TdxFloatForm.CreateWnd; +begin + inherited; + if (FClientWidth <> -1) and (FClientHeight <> -1) then + begin + ClientWidth := FClientWidth; + ClientHeight := FClientHeight; + FClientWidth := -1; + FClientHeight := -1; + end; +end; + +function TdxFloatForm.IsShortCut(var Message: TWMKey): Boolean; +begin + Result := inherited IsShortCut(Message); + if not Result and (ParentForm <> nil) then + Result := ParentForm.IsShortCut(Message); +end; + +{$IFDEF DELPHI6} +procedure TdxFloatForm.WndProc(var Message: TMessage); +var + ADesigner: IDesignerHook; +begin + if IsDesigning then + begin + if Designer <> nil then + ADesigner := Designer + else if CanDesigning then + ADesigner := ParentForm.Designer + else ADesigner := nil; + if Designer <> nil then + Designer := nil; + inherited WndProc(Message); + if (ADesigner <> nil) and CanDesigning then + Designer := ADesigner; + end + else inherited WndProc(Message); +end; +{$ENDIF} + +function TdxFloatForm.GetParentForm: TCustomForm; +begin + if (FDockSite <> nil) and not FDockSite.IsDestroying then + Result := FDockSite.ParentForm + else Result := nil; +end; + +procedure TdxFloatForm.WMHideForm(var Message: TWMClose); +begin + Hide; +end; + +procedure TdxFloatForm.WMShowForm(var Message: TWMClose); +begin + Show; +end; + +procedure TdxFloatForm.WMClose(var Message: TWMClose); +begin + if (DockSite <> nil) and not DockSite.IsDesigning then + DockSite.DoClose; +end; + +procedure TdxFloatForm.WMMove(var Message: TWMMove); +begin + inherited; + if DockSite <> nil then + DockSite.UpdateFloatPosition; +end; + +procedure TdxFloatForm.WMSize(var Message: TWMSize); +begin + inherited; + if DockSite <> nil then + DockSite.Modified; +end; + +procedure TdxFloatForm.WMMouseActivate(var Message: TWMMouseActivate); +begin + inherited; + if DockSite <> nil then + DockSite.Activate; +end; + +procedure TdxFloatForm.WMNCLButtonDown(var Message: TWMNCLButtonDown); +begin + if (Message.HitTest = HTCAPTION) and not IsIconic(Handle) and (DockSite <> nil) then + begin + SendMessage(DockSite.Handle, WM_MOUSEACTIVATE, 0, 0); + SetWindowPos(Handle, 0, 0, 0, 0, 0, SWP_NOZORDER or SWP_NOMOVE or SWP_NOSIZE); + SendMessage(Handle, WM_NCLBUTTONUP, TMessage(Message).WParam, TMessage(Message).LParam); + FCaptionIsDown := True; + FCaptionPoint := Point(Message.XCursor, Message.YCursor); + end + else inherited; +end; + +procedure TdxFloatForm.WMNCLButtonUp(var Message: TWMNCLButtonUp); +begin + FCaptionIsDown := False; + inherited; +end; + +procedure TdxFloatForm.WMNCLButtonDblClk(var Message: TWMNCMButtonDblClk); +begin + if not IsDesigning and (Message.HitTest = HTCAPTION) and not IsIconic(Handle) and + (DockSite <> nil) then DockSite.RestoreDockPosition(Point(Message.XCursor, Message.YCursor)) + else + inherited; +end; + +procedure TdxFloatForm.WMNCMouseMove(var Message: TWMNCMouseMove); +begin + if FCaptionIsDown and ((FCaptionPoint.X <> Message.XCursor) or + (FCaptionPoint.Y <> Message.YCursor)) then + begin + FCaptionIsDown := False; + DockSite.StartDocking(Point(Message.XCursor, Message.YCursor)); + end + else inherited; +end; + +{ TdxDockControlPainter } + +constructor TdxDockControlPainter.Create(ADockControl: TdxCustomDockControl); +begin + FDockControl := ADockControl; +end; + +function TdxDockControlPainter.CanVerticalCaption: Boolean; +begin + Result := True; +end; + +procedure TdxDockControlPainter.CorrectTabRect(var ATab: TRect; + APosition: TdxTabContainerTabsPosition; AIsActive: Boolean); +begin +end; + +function TdxDockControlPainter.DrawActiveTabLast: Boolean; +begin + Result := False; +end; + +function TdxDockControlPainter.GetBorderWidth: Integer; +begin + Result := 2; +end; + +function TdxDockControlPainter.GetCaptionButtonSize: Integer; +begin + Result := 12; +end; + +function TdxDockControlPainter.GetCaptionHeight: Integer; +begin + Result := 16; +end; + +function TdxDockControlPainter.GetCaptionHorizInterval: Integer; +begin + Result := 2; +end; + +function TdxDockControlPainter.GetCaptionVertInterval: Integer; +begin + Result := 2; +end; + +function TdxDockControlPainter.GetDefaultImageHeight: Integer; +begin + if DockControl.Images <> nil then + Result := DockControl.Images.Height + else Result := dxDefaultImageHeight; +end; + +function TdxDockControlPainter.GetDefaultImageWidth: Integer; +begin + if DockControl.Images <> nil then + Result := DockControl.Images.Width + else Result := dxDefaultImageWidth; +end; + +function TdxDockControlPainter.GetImageHeight: Integer; +begin + if DockControl.Images <> nil then + Result := DockControl.Images.Height + else Result := 0; +end; + +function TdxDockControlPainter.GetImageWidth: Integer; +begin + if DockControl.Images <> nil then + Result := DockControl.Images.Width + else Result := 0; +end; + +function TdxDockControlPainter.IsValidImageIndex(AIndex: Integer): Boolean; +begin + Result := IsImageAssigned(DockControl.Images, AIndex); +end; + +function TdxDockControlPainter.GetHideBarHeight: Integer; +begin + Result := 10 + GetFont.Size + 10; + if Result < GetHideBarVertInterval + 2 + GetImageHeight + 2 + GetHideBarVertInterval then + Result := GetHideBarVertInterval + 2 + GetImageHeight + 2 + GetHideBarVertInterval; +end; + +function TdxDockControlPainter.GetHideBarWidth: Integer; +begin + Result := 10 + GetFont.Size + 10; + if Result < GetHideBarVertInterval + 2 + GetImageWidth + 2 + GetHideBarVertInterval then + Result := GetHideBarVertInterval + 2 + GetImageWidth + 2 + GetHideBarVertInterval; +end; + +function TdxDockControlPainter.GetHideBarVertInterval: Integer; +begin + Result := 2; +end; + +function TdxDockControlPainter.GetHideBarHorizInterval: Integer; +begin + Result := 4; +end; + +function TdxDockControlPainter.GetTabVertInterval: Integer; +begin + Result := 2; +end; + +function TdxDockControlPainter.GetTabVertOffset: Integer; +begin + Result := 0; +end; + +function TdxDockControlPainter.GetTabHorizInterval: Integer; +begin + Result := 4; +end; + +function TdxDockControlPainter.GetTabHorizOffset: Integer; +begin + Result := GetTabHorizInterval; +end; + +function TdxDockControlPainter.GetTabsButtonSize: Integer; +begin + Result := 16; +end; + +function TdxDockControlPainter.GetTabsHeight: Integer; +begin + Result := 10 + GetFont.Size + 12; + if Result < GetTabVertInterval + 4 + GetImageHeight + 4 + GetTabVertInterval then + Result := GetTabVertInterval + 4 + GetImageHeight + 4 + GetTabVertInterval; +end; + +procedure TdxDockControlPainter.DrawBorder(ACanvas: TCanvas; ARect: TRect); +begin + ACanvas.Brush.Color := ColorToRGB(GetBorderColor); + ACanvas.Brush.Style := bsSolid; + with ARect do + begin + ACanvas.FillRect(Rect(Left, Top, Left + GetBorderWidth, Bottom)); + ACanvas.FillRect(Rect(Left, Bottom - GetBorderWidth, Right, Bottom)); + ACanvas.FillRect(Rect(Right - GetBorderWidth, Top, Left + Right, Bottom)); + ACanvas.FillRect(Rect(Left, Top, Right, Top + GetBorderWidth)); + end; + DrawColorEdge(ACanvas, ARect, GetColor, etRaisedOuter, [epTopLeft]); + DrawColorEdge(ACanvas, ARect, GetColor, etRaisedInner, [epBottomRight]); +end; + +procedure TdxDockControlPainter.DrawHideBar(ACanvas: TCanvas; ARect: TRect; + APosition: TdxAutoHidePosition); +begin + ACanvas.Brush.Color := ColorToRGB(GetHideBarColor); + ACanvas.Brush.Style := bsSolid; + ACanvas.FillRect(ARect); +end; + +procedure TdxDockControlPainter.DrawCaption(ACanvas: TCanvas; ARect: TRect; IsActive: Boolean); +begin + ACanvas.Brush.Color := ColorToRGB(GetCaptionColor(IsActive)); + ACanvas.Brush.Style := bsSolid; + ACanvas.FillRect(ARect); +end; + +procedure TdxDockControlPainter.DrawCaptionSeparator(ACanvas: TCanvas; ARect: TRect); +begin + ACanvas.Brush.Style := bsSolid; + ACanvas.Brush.Color := ColorToRGB(GetBorderColor); + ACanvas.FillRect(ARect); +end; + +procedure TdxDockControlPainter.DrawCaptionText(ACanvas: TCanvas; ARect: TRect; IsActive: Boolean); +var + R: TRect; +begin + R := ARect; + if DockControl.IsCaptionVertical then + begin + if ARect.Top < ARect.Bottom then + begin + R.Right := ARect.Left + (ARect.Right - ARect.Left) div 2 - 1; + R.Left := R.Right - 3; + DrawColorEdge(ACanvas, R, GetCaptionColor(IsActive), etRaisedOuter, [epTopLeft]); + DrawColorEdge(ACanvas, R, GetCaptionColor(IsActive), etRaisedInner, [epBottomRight]); + R.Left := ARect.Left + (ARect.Right - ARect.Left) div 2; + R.Right := R.Left + 3; + DrawColorEdge(ACanvas, R, GetCaptionColor(IsActive), etRaisedOuter, [epTopLeft]); + DrawColorEdge(ACanvas, R, GetCaptionColor(IsActive), etRaisedInner, [epBottomRight]); + end; + end + else + begin + if ARect.Left < ARect.Right then + begin + R.Bottom := ARect.Top + (ARect.Bottom - ARect.Top) div 2 - 1; + R.Top := R.Bottom - 3; + DrawColorEdge(ACanvas, R, GetCaptionColor(IsActive), etRaisedOuter, [epTopLeft]); + DrawColorEdge(ACanvas, R, GetCaptionColor(IsActive), etRaisedInner, [epBottomRight]); + R.Top := ARect.Top + (ARect.Bottom - ARect.Top) div 2; + R.Bottom := R.Top + 3; + DrawColorEdge(ACanvas, R, GetCaptionColor(IsActive), etRaisedOuter, [epTopLeft]); + DrawColorEdge(ACanvas, R, GetCaptionColor(IsActive), etRaisedInner, [epBottomRight]); + end; + end; +end; + +procedure TdxDockControlPainter.DrawCaptionButtonSelection(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot: Boolean); +begin + if IsDown and IsHot then + begin + DrawColorEdge(ACanvas, ARect, GetCaptionColor(IsActive), etSunkenOuter, [epRect]); + InflateRect(ARect, -1, -1); + DrawColorEdge(ACanvas, ARect, GetCaptionColor(IsActive), etSunkenInner, [epTopLeft]); + end + else + begin + DrawColorEdge(ACanvas, ARect, GetCaptionColor(IsActive), etRaisedOuter, [epRect]); + InflateRect(ARect, -1, -1); + DrawColorEdge(ACanvas, ARect, GetCaptionColor(IsActive), etRaisedInner, [epBottomRight]); + end; +end; + +procedure TdxDockControlPainter.DrawCaptionCloseButton(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot, IsSwitched: Boolean); +begin + DrawCaptionButtonSelection(ACanvas, ARect, IsActive, IsDown, IsHot); + + if IsDown and IsHot then OffsetRect(ARect, 1, 1); + ACanvas.Pen.Style := psSolid; + ACanvas.Pen.Width := 1; + ACanvas.Pen.Color := ColorToRGB(GetCaptionSignColor(IsActive, IsDown, IsHot)); + ACanvas.MoveTo(ARect.Left + 2, ARect.Top + 2); + ACanvas.LineTo(ARect.Right - 3, ARect.Bottom - 3); + ACanvas.MoveTo(ARect.Right - 4, ARect.Top + 2); + ACanvas.LineTo(ARect.Left + 1, ARect.Bottom - 3); +end; + +procedure TdxDockControlPainter.DrawCaptionHideButton(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot, IsSwitched: Boolean); +begin + DrawCaptionButtonSelection(ACanvas, ARect, IsActive, IsDown, IsHot); + + if IsDown and IsHot then OffsetRect(ARect, 1, 1); + ACanvas.Pen.Style := psSolid; + ACanvas.Pen.Width := 1; + ACanvas.Pen.Color := ColorToRGB(GetCaptionSignColor(IsActive, IsDown, IsHot)); + if IsSwitched then + begin + ACanvas.Rectangle(ARect.Left + 4, ARect.Top + 3, ARect.Right - 3, ARect.Bottom - 4); + ACanvas.MoveTo(ARect.Left + 4, ARect.Top + 2); + ACanvas.LineTo(ARect.Left + 4, ARect.Bottom - 3); + ACanvas.MoveTo(ARect.Left + 4, ARect.Bottom - 6); + ACanvas.LineTo(ARect.Right - 3, ARect.Bottom - 6); + ACanvas.MoveTo(ARect.Left + 2, ARect.Top + 5); + ACanvas.LineTo(ARect.Left + 4, ARect.Top + 5); + end + else + begin + ACanvas.Rectangle(ARect.Left + 3, ARect.Top + 2, ARect.Right - 4, ARect.Bottom - 5); + ACanvas.MoveTo(ARect.Left + 2, ARect.Bottom - 6); + ACanvas.LineTo(ARect.Right - 3, ARect.Bottom - 6); + ACanvas.MoveTo(ARect.Right - 6, ARect.Top + 2); + ACanvas.LineTo(ARect.Right - 6, ARect.Bottom - 5); + ACanvas.MoveTo(ARect.Left + 5, ARect.Bottom - 5); + ACanvas.LineTo(ARect.Left + 5, ARect.Bottom - 3); + end; +end; + +procedure TdxDockControlPainter.DrawCaptionMaximizeButton(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot, IsSwitched: Boolean); +var + pts: array[0..2] of TPoint; +begin + DrawCaptionButtonSelection(ACanvas, ARect, IsActive, IsDown, IsHot); + + if IsDown and IsHot then OffsetRect(ARect, 1, 1); + ACanvas.Pen.Style := psSolid; + ACanvas.Pen.Width := 1; + ACanvas.Pen.Color := ColorToRGB(GetCaptionSignColor(IsActive, IsDown, IsHot)); + ACanvas.Brush.Style := bsSolid; + ACanvas.Brush.Color := ColorToRGB(GetCaptionSignColor(IsActive, IsDown, IsHot)); + if DockControl.SideContainer is TdxVertContainerDockSite then + if IsSwitched then + begin + pts[0] := Point(ARect.Right - 4, ARect.Top + 2); + pts[1] := Point(ARect.Left + 2, ARect.Top + 2); + end + else + begin + pts[0] := Point(ARect.Right - 4, ARect.Bottom - 4); + pts[1] := Point(ARect.Left + 2, ARect.Bottom - 4); + end + else + if IsSwitched then + begin + pts[0] := Point(ARect.Left + 2, ARect.Top + 2); + pts[1] := Point(ARect.Left + 2, ARect.Bottom - 4); + end + else + begin + pts[0] := Point(ARect.Right - 4, ARect.Top + 2); + pts[1] := Point(ARect.Right - 4, ARect.Bottom - 4); + end; + pts[2] := Point(ARect.Left + 5, ARect.Top + 5); + ACanvas.Polygon(pts); +end; + +procedure TdxDockControlPainter.DrawClient(ACanvas: TCanvas; ARect: TRect); +begin + ACanvas.Brush.Color := ColorToRGB(GetColor); + ACanvas.Brush.Style := bsSolid; + ACanvas.FillRect(ARect); +end; + +procedure TdxDockControlPainter.DrawClientEx(ACanvas: TCanvas; + AWindowRect, ARect: TRect); +begin + DrawClient(ACanvas, ARect); +end; + +procedure TdxDockControlPainter.DrawHideBarButtonContent(ACanvas: TCanvas; + AControl: TdxCustomDockControl; ARect: TRect; APosition: TdxAutoHidePosition); +var + I: Integer; + R: TRect; + AItemControl: TdxCustomDockControl; +const + SeparatorEdges: array[TdxAutoHidePosition] of TdxEdgePositions = ([epBottom], + [epRight], [epBottom], [epRight], []); +begin + if AControl is TdxTabContainerDockSite then + begin + for I := 0 to (AControl as TdxTabContainerDockSite).ActiveChildIndex - 1 do + begin + AItemControl := AControl.Children[I]; + if not (AControl as TdxTabContainerDockSite).IsValidChild(AItemControl) then continue; + R := ARect; + if not (APosition in [ahpLeft, ahpRight]) then + R.Right := R.Left + (GetDefaultImageWidth + 2 * GetHideBarHorizInterval) + else R.Bottom := R.Top + (GetDefaultImageHeight + 2 * GetHideBarHorizInterval); + if IsValidImageIndex(AItemControl.ImageIndex) then + DrawHideBarButtonImage(ACanvas, AItemControl, R) + else DrawHideBarButtonText(ACanvas, AItemControl, R, APosition); + if not (APosition in [ahpLeft, ahpRight]) then + ARect.Left := R.Right + else ARect.Top := R.Bottom; + if (AControl as TdxTabContainerDockSite).GetNextValidChild(AItemControl.DockIndex) <> nil then + DrawColorEdge(ACanvas, R, GetHideBarButtonColor, etRaisedInner, SeparatorEdges[APosition]); + end; + for I := AControl.ChildCount - 1 downto (AControl as TdxTabContainerDockSite).ActiveChildIndex + 1 do + begin + AItemControl := AControl.Children[I]; + if not (AControl as TdxTabContainerDockSite).IsValidChild(AItemControl) then continue; + R := ARect; + if not (APosition in [ahpLeft, ahpRight]) then + R.Left := R.Right - (GetDefaultImageWidth + 2 * GetHideBarHorizInterval) + else R.Top := R.Bottom - (GetDefaultImageHeight + 2 * GetHideBarHorizInterval); + if IsValidImageIndex(AItemControl.ImageIndex) then + DrawHideBarButtonImage(ACanvas, AItemControl, R) + else DrawHideBarButtonText(ACanvas, AItemControl, R, APosition); + if not (APosition in [ahpLeft, ahpRight]) then + ARect.Right := R.Left + else ARect.Bottom := R.Top; + if (AControl as TdxTabContainerDockSite).GetNextValidChild(AItemControl.DockIndex) <> nil then + DrawColorEdge(ACanvas, R, GetHideBarButtonColor, etRaisedInner, SeparatorEdges[APosition]); + end; + AItemControl := (AControl as TdxTabContainerDockSite).ActiveChild; + end + else AItemControl := AControl; + if IsValidImageIndex(AItemControl.ImageIndex) then + begin + R := ARect; + if not (APosition in [ahpLeft, ahpRight]) then + R.Right := R.Left + (GetDefaultImageWidth + 2 * GetHideBarHorizInterval) + else R.Bottom := R.Top + (GetDefaultImageHeight + 2 * GetHideBarHorizInterval); + DrawHideBarButtonImage(ACanvas, AItemControl, R); + if not (APosition in [ahpLeft, ahpRight]) then + ARect.Left := R.Right + else ARect.Top := R.Bottom; + end; + DrawHideBarButtonText(ACanvas, AItemControl, ARect, APosition); + if (AControl is TdxTabContainerDockSite) then + if (AControl as TdxTabContainerDockSite).GetNextValidChild(AItemControl.DockIndex) <> nil then + DrawColorEdge(ACanvas, ARect, GetHideBarButtonColor, etRaisedInner, SeparatorEdges[APosition]); +end; + +procedure TdxDockControlPainter.DrawHideBarButton(ACanvas: TCanvas; + AControl: TdxCustomDockControl; ARect: TRect; APosition: TdxAutoHidePosition); +const + TopEdges: array[TdxAutoHidePosition] of TdxEdgePositions = ([epTop], [epLeft], + [epTopLeft], [epTopLeft], []); + BottomEdges: array[TdxAutoHidePosition] of TdxEdgePositions = ([epBottomRight], + [epBottomRight], [epBottom], [epRight], []); +begin + DrawColorEdge(ACanvas, ARect, GetHideBarButtonColor, etRaisedOuter, TopEdges[APosition]); + DrawColorEdge(ACanvas, ARect, GetHideBarButtonColor, etRaisedInner, BottomEdges[APosition]); + DrawHideBarButtonContent(ACanvas, AControl, ARect, APosition); +end; + +procedure TdxDockControlPainter.DrawHideBarButtonImage(ACanvas: TCanvas; + AControl: TdxCustomDockControl; ARect: TRect); +var + R: TRect; +begin + if IsValidImageIndex(AControl.ImageIndex) then + begin + R.Left := ARect.Left + (ARect.Right - ARect.Left - GetImageWidth) div 2; + R.Top := ARect.Top + (ARect.Bottom - ARect.Top - GetImageHeight) div 2; + R.Right := R.Left + GetImageWidth; + R.Bottom := R.Top + GetImageHeight; + DrawImage(ACanvas, AControl.Images, AControl.ImageIndex, R); + end; +end; + +procedure TdxDockControlPainter.DrawHideBarButtonText(ACanvas: TCanvas; + AControl: TdxCustomDockControl; ARect: TRect; APosition: TdxAutoHidePosition); +var + R: TRect; + ABitmap: TBitmap; +begin + ACanvas.Brush.Style := bsClear; + ACanvas.Font := GetHideBarButtonFont; + ACanvas.Font.Color := ColorToRGB(GetHideBarButtonFontColor); + InflateRect(ARect, -2, -2); + case APosition of + ahpTop, ahpBottom: + cxDrawText(ACanvas.Handle, AControl.Caption, ARect, + DT_SINGLELINE or DT_LEFT or DT_VCENTER or DT_END_ELLIPSIS); + ahpLeft, ahpRight: + begin + R := ARect; + OffsetRect(R, - R.Left, -R.Top); + R.Right := (ARect.Bottom - ARect.Top); + R.Bottom := (ARect.Right - ARect.Left); + ABitmap := TBitmap.Create; + try + ABitmap.PixelFormat := pf32bit; + ABitmap.Transparent := True; + ABitmap.Width := R.Right - R.Left; + ABitmap.Height := R.Bottom - R.top; + ABitmap.Canvas.Brush.Style := bsClear; + ABitmap.Canvas.Brush.Color := GetHideBarButtonColor; + ABitmap.Canvas.FillRect(R); + + ABitmap.Canvas.Font := GetHideBarButtonFont; + ABitmap.Canvas.Font.Color := ColorToRGB(GetHideBarButtonFontColor); + cxDrawText(ABitmap.Canvas.Handle, AControl.Caption, R, + DT_SINGLELINE or DT_LEFT or DT_VCENTER or DT_END_ELLIPSIS); + RotateBitmap(ABitmap, raMinus90); + ACanvas.Draw(ARect.Left, ARect.Top, ABitmap); + finally + ABitmap.Free; + end; + end; + end; +end; + +procedure TdxDockControlPainter.DrawTabs(ACanvas: TCanvas; ARect, AActiveTabRect: TRect; + APosition: TdxTabContainerTabsPosition); +var + R: TRect; +begin + ACanvas.Brush.Style := bsSolid; + ACanvas.Brush.Color := ColorToRGB(GetTabsColor); + ACanvas.FillRect(ARect); + R := ARect; + if APosition = tctpTop then + begin + Dec(R.Bottom, 1); + DrawColorEdge(ACanvas, R, GetTabColor(True), etRaisedOuter, [epBottom]); + Dec(R.Bottom, 1); + DrawColorEdge(ACanvas, R, GetTabColor(True), etRaisedInner, [epBottom]); + R := ARect; + R.Bottom := AActiveTabRect.Bottom; + DrawColorEdge(ACanvas, R, GetTabColor(True), etSunkenOuter, [epBottom]); + end + else + begin + Inc(R.Top, 1); + DrawColorEdge(ACanvas, R, GetTabColor(True), etRaisedOuter, [epTop]); + R := ARect; + R.Top := AActiveTabRect.Top; + DrawColorEdge(ACanvas, R, GetTabColor(True), etSunkenOuter, [epTop]); + Inc(R.Top, 1); + DrawColorEdge(ACanvas, R, GetTabColor(True), etSunkenInner, [epTop]); + end; +end; + +procedure TdxDockControlPainter.DrawTab(ACanvas: TCanvas; AControl: TdxCustomDockControl; + ARect: TRect; IsActive: Boolean; APosition: TdxTabContainerTabsPosition); +var + pts: array[0..4] of TPoint; +begin + if IsActive then + begin + ACanvas.Brush.Color := ColorToRGB(GetTabColor(IsActive)); + ACanvas.Brush.Style := bsSolid; + ACanvas.FillRect(ARect); + end; + + ACanvas.Pen.Style := psSolid; + ACanvas.Pen.Width := 1; + if APosition = tctpTop then + begin + ACanvas.Pen.Color := LightLightColor(GetTabColor(True)); + pts[0] := Point(ARect.Left, ARect.Bottom - 1); + pts[1] := Point(ARect.Left, ARect.Top + 2); + pts[2] := Point(ARect.Left + 2, ARect.Top); + pts[3] := Point(ARect.Right - 3, ARect.Top); + pts[4] := Point(ARect.Right - 1, ARect.Top + 2); + ACanvas.Polyline(pts); + ACanvas.Pen.Color := DarkDarkColor(GetTabColor(True)); + ACanvas.MoveTo(ARect.Right - 1, ARect.Top + 2); + if IsActive then + ACanvas.LineTo(ARect.Right - 1, ARect.Bottom) + else ACanvas.LineTo(ARect.Right - 1, ARect.Bottom - 1); + ACanvas.Pen.Color := DarkColor(GetTabColor(True)); + ACanvas.MoveTo(ARect.Right - 2, ARect.Top + 1); + if IsActive then + ACanvas.LineTo(ARect.Right - 2, ARect.Bottom) + else ACanvas.LineTo(ARect.Right - 2, ARect.Bottom - 1); + end + else + begin + ACanvas.Pen.Color := LightLightColor(GetTabColor(True)); + if IsActive then + ACanvas.MoveTo(ARect.Left, ARect.Top) + else ACanvas.MoveTo(ARect.Left, ARect.Top + 2); + ACanvas.LineTo(ARect.Left, ARect.Bottom - 2); + ACanvas.Pen.Color := DarkDarkColor(GetTabColor(True)); + pts[0] := Point(ARect.Left, ARect.Bottom - 2); + pts[1] := Point(ARect.Left + 2, ARect.Bottom); + pts[2] := Point(ARect.Right - 3, ARect.Bottom); + pts[3] := Point(ARect.Right - 1, ARect.Bottom - 2); + if IsActive then + pts[4] := Point(ARect.Right - 1, ARect.Top - 1) + else pts[4] := Point(ARect.Right - 1, ARect.Top + 1); + ACanvas.Polyline(pts); + ACanvas.Pen.Color := DarkColor(GetTabColor(True)); + pts[0] := Point(ARect.Left + 1, ARect.Bottom - 2); + pts[1] := Point(ARect.Left + 2, ARect.Bottom - 1); + pts[2] := Point(ARect.Right - 3, ARect.Bottom - 1); + pts[3] := Point(ARect.Right - 2, ARect.Bottom - 2); + if IsActive then + pts[4] := Point(ARect.Right - 2, ARect.Top - 1) + else pts[4] := Point(ARect.Right - 2, ARect.Top + 1); + ACanvas.Polyline(pts); + end; + + DrawTabContent(ACanvas, AControl, ARect, IsActive, APosition); +end; + +procedure TdxDockControlPainter.DrawTabContent(ACanvas: TCanvas; AControl: TdxCustomDockControl; + ARect: TRect; IsActive: Boolean; APosition: TdxTabContainerTabsPosition); +var + R: TRect; +begin + ARect.Left := ARect.Left + GetTabHorizInterval; + if IsValidImageIndex(AControl.ImageIndex) then + begin + R.Left := ARect.Left; + R.Top := ARect.Top + (ARect.Bottom - ARect.Top - GetImageHeight) div 2; + R.Right := R.Left + GetImageWidth; + R.Bottom := R.Top + GetImageHeight; + if RectInRect(R, ARect) then + begin + DrawImage(ACanvas, AControl.Images, AControl.ImageIndex, R); + ARect.Left := R.Right + GetTabHorizInterval; + end; + end; + + ACanvas.Brush.Style := bsClear; + ACanvas.Font := GetTabFont(IsActive); + ACanvas.Font.Color := ColorToRGB(GetTabFontColor(IsActive)); + cxDrawText(ACanvas.Handle, AControl.Caption, ARect, + DT_SINGLELINE or DT_LEFT or DT_VCENTER or DT_END_ELLIPSIS); +end; + +procedure TdxDockControlPainter.DrawTabsNextTabButton(ACanvas: TCanvas; ARect: TRect; + IsDown, IsHot, IsEnable: Boolean; APosition: TdxTabContainerTabsPosition); +var + pts: array[0..2] of TPoint; +begin + DrawTabsButtonSelection(ACanvas, ARect, IsDown, IsHot, IsEnable, APosition); + + ACanvas.Brush.Color := GetTabsScrollButtonsSignColor(IsEnable); + ACanvas.Brush.Style := bsSolid; + ACanvas.Pen.Color := GetTabsScrollButtonsSignColor(IsEnable); + ACanvas.Pen.Style := psSolid; + ACanvas.Pen.Width := 1; + + InflateRect(ARect, -1, -1); + if IsDown and IsHot then OffsetRect(ARect, 1, 1); + pts[0] := Point(ARect.Left + 4, ARect.Top + 2); + pts[1] := Point(ARect.Left + 4, ARect.Bottom - 4); + pts[2] := Point(ARect.Right - 6, ARect.Top + 6); + ACanvas.Polygon(pts); +end; + +procedure TdxDockControlPainter.DrawTabsPrevTabButton(ACanvas: TCanvas; ARect: TRect; + IsDown, IsHot, IsEnable: Boolean; APosition: TdxTabContainerTabsPosition); +var + pts: array[0..2] of TPoint; +begin + DrawTabsButtonSelection(ACanvas, ARect, IsDown, IsHot, IsEnable, APosition); + + ACanvas.Brush.Color := GetTabsScrollButtonsSignColor(IsEnable); + ACanvas.Brush.Style := bsSolid; + ACanvas.Pen.Color := GetTabsScrollButtonsSignColor(IsEnable); + ACanvas.Pen.Style := psSolid; + ACanvas.Pen.Width := 1; + + InflateRect(ARect, -1, -1); + if IsDown and IsHot then OffsetRect(ARect, 1, 1); + pts[0] := Point(ARect.Right - 6, ARect.Top + 2); + pts[1] := Point(ARect.Right - 6, ARect.Bottom - 4); + pts[2] := Point(ARect.Left + 4, ARect.Top + 6); + ACanvas.Polygon(pts); +end; + +procedure TdxDockControlPainter.DrawTabsButtonSelection(ACanvas: TCanvas; ARect: TRect; + IsDown, IsHot, IsEnable: Boolean; APosition: TdxTabContainerTabsPosition); +begin + if IsDown and IsHot and IsEnable then + begin + DrawColorEdge(ACanvas, ARect, GetTabsScrollButtonsColor, etSunkenOuter, [epRect]); + InflateRect(ARect, -1, -1); + DrawColorEdge(ACanvas, ARect, GetTabsScrollButtonsColor, etSunkenInner, [epTopLeft]); + end + else + begin + DrawColorEdge(ACanvas, ARect, GetTabsScrollButtonsColor, etRaisedOuter, [epRect]); + InflateRect(ARect, -1, -1); + DrawColorEdge(ACanvas, ARect, GetTabsScrollButtonsColor, etRaisedInner, [epBottomRight]); + end; +end; + +class procedure TdxDockControlPainter.AssignDefaultColor(AManager: TdxDockingManager); +begin + AManager.Color := clBtnFace; +end; + +class procedure TdxDockControlPainter.AssignDefaultFont(AManager: TdxDockingManager); +begin + with AManager.Font do + begin + Charset := DEFAULT_CHARSET; + Color := clBlack; + Height := -11; + Name := 'MS Sans Serif'; + Pitch := fpDefault; + Size := 8; + Style := []; + end; +end; + +class procedure TdxDockControlPainter.CreateColors; +begin +end; + +class procedure TdxDockControlPainter.RefreshColors; +begin +end; + +class procedure TdxDockControlPainter.ReleaseColors; +begin +end; + +function Dark(Col: TColor; Percentage: Byte): TColor; +var + R, G, B: Integer; +begin + Col := ColorToRGB(Col); + R := GetRValue(Col); G := GetGValue(Col); B := GetBValue(Col); + R := Round(R * Percentage / 100); + G := Round(G * Percentage / 100); + B := Round(B * Percentage / 100); + Result := RGB(R, G, B); +end; + +function Light(Col: TColor; Percentage: Byte): TColor; +var + R, G, B: Integer; +begin + Col := ColorToRGB(Col); + R := GetRValue(Col); G := GetGValue(Col); B := GetBValue(Col); + R := Round(R * Percentage / 100) + Round(255 - Percentage / 100 * 255); + G := Round(G * Percentage / 100) + Round(255 - Percentage / 100 * 255); + B := Round(B * Percentage / 100) + Round(255 - Percentage / 100 * 255); + Result := RGB(R, G, B); +end; + +class function TdxDockControlPainter.LightColor(AColor: TColor): TColor; +begin + Result := Light(AColor, 60); +end; + +class function TdxDockControlPainter.LightLightColor(AColor: TColor): TColor; +begin + Result := Light(AColor, 20); +end; + +class function TdxDockControlPainter.DarkColor(AColor: TColor): TColor; +begin + Result := Dark(AColor, 60); +end; + +class function TdxDockControlPainter.DarkDarkColor(AColor: TColor): TColor; +begin + Result := Dark(AColor, 20); +end; + +class procedure TdxDockControlPainter.DrawColorEdge(ACanvas: TCanvas; ARect: TRect; + AColor: TColor; AEdgesType: TdxEdgesType; AEdgePositios: TdxEdgePositions); +var + LTCol, RBCol: TColor; +begin + case AEdgesType of + etFlat: begin + LTCol := DarkColor(AColor); + RBCol := DarkColor(AColor); + end; + etRaisedOuter: begin + LTCol := LightLightColor(AColor); + RBCol := DarkDarkColor(AColor); + end; + etRaisedInner: begin + LTCol := LightColor(AColor); + RBCol := DarkColor(AColor); + end; + etSunkenOuter: begin + LTCol := DarkDarkColor(AColor); + RBCol := LightLightColor(AColor); + end; + etSunkenInner: begin + LTCol := DarkColor(AColor); + RBCol := LightColor(AColor); + end; + else + LTCol := ColorToRGB(AColor); + RBCol := ColorToRGB(AColor); + end; + ACanvas.Pen.Style := psSolid; + ACanvas.Pen.Width := 1; + ACanvas.MoveTo(ARect.Left, ARect.Bottom - 1); + ACanvas.Pen.Color := LTCol; + if (epLeft in AEdgePositios) or (epTopLeft in AEdgePositios) or (epRect in AEdgePositios) then + ACanvas.LineTo(ARect.Left, ARect.Top - 1); + ACanvas.MoveTo(ARect.Left, ARect.Top); + if (epTop in AEdgePositios) or (epTopLeft in AEdgePositios) or (epRect in AEdgePositios) then + ACanvas.LineTo(ARect.Right, ARect.Top); + ACanvas.MoveTo(ARect.Right - 1, ARect.Top); + ACanvas.Pen.Color := RBCol; + if (epRight in AEdgePositios) or (epBottomRight in AEdgePositios) or (epRect in AEdgePositios) then + ACanvas.LineTo(ARect.Right - 1, ARect.Bottom); + ACanvas.MoveTo(ARect.Right - 1, ARect.Bottom - 1); + if (epBottom in AEdgePositios) or (epBottomRight in AEdgePositios) or (epRect in AEdgePositios) then + ACanvas.LineTo(ARect.Left - 1, ARect.Bottom - 1) +end; + +class procedure TdxDockControlPainter.DrawImage(ACanvas: TCanvas; AImageList: TCustomImageList; + AImageIndex: Integer; R: TRect); +begin + AImageList.Draw(ACanvas, R.Left, R.Top, AImageIndex); +end; + +class function TdxDockControlPainter.RectInRect(R1, R2: TRect): Boolean; +begin + Result := PtInRect(R2, R1.TopLeft) and PtInRect(R2, R1.BottomRight); +end; + +class procedure TdxDockControlPainter.RotateBitmap(ABitmap: TBitmap; Angle: TcxRotationAngle); +var + PDest, PDestStart: ^DWord; + PSource: ^DWord; + PBuffer: Pointer; + XSource, YSource: Integer; + LineCopyingDirection: Integer; + TempVar: Integer; +begin + case Angle of + ra180: + with ABitmap do + begin + GetMem(PBuffer, Width * 4); + PDestStart := ScanLine[Height - 1]; + PDest := PDestStart; + Integer(PSource) := Integer(PDest) + Height * Width * 4; + for YSource := 0 to Height div 2 - 1 do + begin + Move(PDest^, PBuffer^, Width * 4); + for XSource := 0 to Width - 1 do + begin + Dec(PSource); + PDest^ := PSource^; + Inc(PDest); + end; + + PDest := Pointer(PSource); + Integer(PSource) := Integer(PBuffer) + Width * 4; + for XSource := 0 to Width - 1 do + begin + Dec(PSource); + PDest^ := PSource^; + Inc(PDest); + end; + + Integer(PSource) := Integer(PDest) - Width * 4; + Inc(PDestStart, Width); + PDest := PDestStart; + end; + if Height mod 2 <> 0 then + for XSource := 0 to Width div 2 - 1 do + begin + Dec(PSource); + PDest^ := PSource^; + Inc(PDest); + end; + + Width := Width + 1; + Width := Width - 1; + FreeMem(PBuffer); + end; + raPlus90, raMinus90: + with ABitmap do + begin + GetMem(PBuffer, Width * Height * 4); + + LineCopyingDirection := 0; + PDestStart := PBuffer; + case Angle of + raPlus90: + begin + Inc(PDestStart, Height * (Width - 1)); + LineCopyingDirection := 1; + end; + raMinus90: + begin + Inc(PDestStart, Height - 1); + LineCopyingDirection := -1; + end; + end; + + PSource := ScanLine[0]; + for YSource := 0 to Height - 1 do + begin + PDest := PDestStart; + for XSource := 0 to Width - 1 do + begin + PDest^ := PSource^; + Dec(PDest, Height * LineCopyingDirection); + Inc(PSource); + end; + Inc(PDestStart, LineCopyingDirection); + Dec(PSource, Width * 2); + end; + + TempVar := Width; + Width := Height; + Height := TempVar; + if Width = Height then + begin + Width := Width + 1; + Width := Width - 1; + end; + + PSource := PBuffer; + PDest := ScanLine[0]; + for YSource := 0 to Height - 1 do + begin + Move(PSource^, PDest^, Width * 4); + Inc(PSource, Width); + Dec(PDest, Width); + end; + + FreeMem(PBuffer); + end; + end; +end; + +function TdxDockControlPainter.GetCaptionRect(const ARect: TRect; + AIsVertical: Boolean): TRect; +begin + with Result do + if AIsVertical then + begin + Left := ARect.Left; + Top := ARect.Top; + Right := Left + GetCaptionHeight; + Bottom := ARect.Bottom; + end + else + begin + Left := ARect.Left; + Top := ARect.Top; + Bottom := Top + GetCaptionHeight; + Right := ARect.Right; + end; +end; + +function TdxDockControlPainter.GetColor: TColor; +begin + Result := DockControl.Color; +end; + +function TdxDockControlPainter.GetFont: TFont; +begin + Result := DockControl.Font; +end; + +function TdxDockControlPainter.GetBorderColor: TColor; +begin + Result := GetColor; +end; + +function TdxDockControlPainter.GetCaptionColor(IsActive: Boolean): TColor; +begin + Result := GetColor; +end; + +function TdxDockControlPainter.GetCaptionFont(IsActive: Boolean): TFont; +begin + Result := GetFont; +end; + +function TdxDockControlPainter.GetCaptionFontColor(IsActive: Boolean): TColor; +begin + Result := GetCaptionFont(IsActive).Color; +end; + +function TdxDockControlPainter.GetCaptionSignColor(IsActive, IsDown, IsHot: Boolean): TColor; +begin + Result := GetCaptionFontColor(IsActive); +end; + +function TdxDockControlPainter.GetTabsColor: TColor; +begin + Result := GetColor; +end; + +function TdxDockControlPainter.GetTabColor(IsActive: Boolean): TColor; +begin + Result := GetColor; +end; + +function TdxDockControlPainter.GetTabFont(IsActive: Boolean): TFont; +begin + Result := GetFont; +end; + +function TdxDockControlPainter.GetTabFontColor(IsActive: Boolean): TColor; +begin + Result := GetTabFont(IsActive).Color; +end; + +function TdxDockControlPainter.GetTabsScrollButtonsColor: TColor; +begin + Result := GetColor; +end; + +function TdxDockControlPainter.GetTabsScrollButtonsSignColor(IsEnable: Boolean): TColor; +begin + if IsEnable then + Result := DarkDarkColor(GetColor) + else Result := DarkColor(GetTabColor(True)); +end; + +function TdxDockControlPainter.GetHideBarColor: TColor; +begin + Result := GetColor; +end; + +function TdxDockControlPainter.GetHideBarButtonColor: TColor; +begin + Result := GetColor; +end; + +function TdxDockControlPainter.GetHideBarButtonFont: TFont; +begin + Result := GetFont; +end; + +function TdxDockControlPainter.GetHideBarButtonFontColor: TColor; +begin + Result := GetHideBarButtonFont.Color; +end; + +function TdxDockControlPainter.DrawCaptionFirst: Boolean; +begin + Result := False; +end; + +function TdxDockControlPainter.NeedRedrawOnResize: Boolean; +begin + Result := False; +end; + +{ TdxDockingController } + +function dxDockingWndProcHook(Code: Integer; wParam: WParam; lParam: LParam): LRESULT; stdcall; +var + AControl: TWinControl; + AParentDockControl, AActiveDockControl: TdxCustomDockControl; +begin + Result := CallNextHookEx(FWndProcHookHandle, Code, wParam, lParam); + with PCWPStruct(lParam)^ do +// if Application.MainForm <> nil then + begin + AControl := FindControl(hwnd); + case message of + WM_ACTIVATEAPP: + begin + if (AControl is TCustomForm) and not (AControl is TdxFloatForm) and + (csDesigning in AControl.ComponentState) then + begin + if wParam = 0 then + dxDockingController.FloatFormsHide(nil) + else dxDockingController.FloatFormsShow(nil); + end; + if wParam = 0 then + begin + dxDockingController.FinishDocking; + dxDockingController.FinishResizing; + end; + dxDockingController.InvalidateActiveDockControl; + end; + WM_WINDOWPOSCHANGING: + begin + if (AControl is TCustomForm) and not (AControl is TdxFloatForm) then + begin + if PWindowPos(lParam)^.flags and SWP_HIDEWINDOW <> 0 then + dxDockingController.FloatFormsHide(AControl as TCustomForm); + if PWindowPos(lParam)^.flags and SWP_SHOWWINDOW <> 0 then + begin + dxDockingController.FloatFormsShow(AControl as TCustomForm); + dxDockingController.UpdateLayouts(AControl as TCustomForm); + end; + end; + end; + WM_SETFOCUS: + begin + if dxDockingController.FActiveDockControlLockCount = 0 then + begin + AActiveDockControl := dxDockingController.GetDockControlForWindow(hwnd); + if Application.Active and + (AActiveDockControl <> nil) and AActiveDockControl.HandleAllocated and + (AActiveDockControl <> dxDockingController.FActivatingDockControl) then + dxDockingController.ActiveDockControl := AActiveDockControl; + end; + end; + WM_KILLFOCUS: + begin + if dxDockingController.FActiveDockControlLockCount = 0 then + begin + AParentDockControl := dxDockingController.GetDockControlForWindow(hwnd); + if Application.Active and (AParentDockControl <> nil) and + (dxDockingController.ActiveDockControl = AParentDockControl) and + (AParentDockControl <> dxDockingController.FActivatingDockControl) then + begin + AActiveDockControl := dxDockingController.GetDockControlForWindow(wParam); // focused + if (AActiveDockControl = nil) or (AActiveDockControl <> AParentDockControl) then + dxDockingController.ActiveDockControl := nil; + end; + end; + end; + end; + end; +end; + +constructor TdxDockingController.Create; +begin + inherited; + FDestroyedDockControls := TList.Create; + FLoadedForms := TList.Create; + FDockControls := TList.Create; + FDockManagers := TList.Create; + FFont := TFont.Create; + FInvalidNC := TList.Create; + FInvalidNCBounds := TList.Create; + FInvalidRedraw := TList.Create; + FSelectionBrush := TBrush.Create; + FSelectionBrush.Bitmap := AllocPatternBitmap(clBlack, clWhite); + FWndProcHookHandle := SetWindowsHookEx(WH_CALLWNDPROC, dxDockingWndProcHook, 0, GetCurrentThreadId); + TdxDockControlPainter.CreateColors; +end; + +destructor TdxDockingController.Destroy; +begin + TdxDockControlPainter.ReleaseColors; + UnhookWindowsHookEx(FWndProcHookHandle); + FWndProcHookHandle := 0; + FSelectionBrush.Free; + FInvalidRedraw.Free; + FInvalidNCBounds.Free; + FInvalidNC.Free; + FFont.Free; + FDockManagers.Free; + FDockControls.Free; + FLoadedForms.Free; + FDestroyedDockControls.Free; + ReleaseTempBitmap; + inherited; +end; + +procedure TdxDockingController.BeginUpdate; +begin + BeginUpdateNC; +end; + +procedure TdxDockingController.EndUpdate; +begin + EndUpdateNC; +end; + +function TdxDockingController.GetDockControlAtPos(const P: TPoint): TdxCustomDockControl; +begin + Result := GetDockControlForWindow(WindowFromPoint(P)); +end; +{function TdxDockingController.GetDockControlAtPos(const P: TPoint): TdxCustomDockControl; +var + AControl: TControl; + AWnd: HWND; +begin + Result := nil; + AWnd := WindowFromPoint(P); + while AWnd <> 0 do + begin + AControl := FindControl(AWnd); + if AControl is TdxCustomDockControl then + begin + Result := AControl as TdxCustomDockControl; + Break; + end; + AWnd := GetParent(AWnd); + end; +end;} + +function TdxDockingController.GetDockControlForWindow(AWnd: HWND; ADockWindow: HWND = 0): TdxCustomDockControl; +var + AFloatForm: TdxFloatForm; +begin + Result := nil; + while AWnd <> 0 do + begin + if Assigned(cxControls.cxGetParentWndForDocking) then + AWnd := cxControls.cxGetParentWndForDocking(AWnd); + + if FindControl(AWnd) is TdxCustomDockControl then + begin + Result := TdxCustomDockControl(FindControl(AWnd)); + if (ADockWindow = 0) or (AWnd = ADockWindow) then + Break + else + Result := nil; + end; + + if FindControl(AWnd) is TdxFloatForm then + begin + AFloatForm := TdxFloatForm(FindControl(AWnd)); + if AFloatForm.DockSite <> nil then + Result := AFloatForm.DockSite.GetDockPanel + else + Result := nil; + if (Result <> nil) and (ADockWindow <> 0) and (Result.Handle <> ADockWindow) then + Result := nil; + Break; + end; + + AWnd := GetParent(AWnd); + end; +end; +{function TdxDockingController.GetDockControlForWindow(AWnd: HWND): TdxCustomDockControl; +var + AFloatForm: TdxFloatForm; +begin + Result := nil; + + while AWnd <> 0 do + begin + if Assigned(cxControls.cxGetParentWndForDocking) then + AWnd := cxControls.cxGetParentWndForDocking(AWnd); + + if FindControl(AWnd) is TdxCustomDockControl then + begin + Result := FindControl(AWnd) as TdxCustomDockControl; + Break; + end; + + if FindControl(AWnd) is TdxFloatForm then + begin + AFloatForm := FindControl(AWnd) as TdxFloatForm; + if AFloatForm.DockSite <> nil then + Result := AFloatForm.DockSite.GetDockPanel + else + Result := nil; + Break; + end; + + AWnd := GetParent(AWnd); + end; +end;} + +function TdxDockingController.GetFloatDockSiteAtPos(pt: TPoint): TdxCustomDockControl; +var + AControl: TWinControl; + Message: TMessage; +begin + Result := nil; + AControl := FindVCLWindow(pt); + if AControl is TdxFloatForm then + begin + Message.Msg := WM_NCHITTEST; + Message.LParamLo := pt.X; + Message.LParamHi := pt.Y; + Message.Result := 0; + AControl.WindowProc(Message); + if (Message.Result = HTCAPTION) then + Result := (AControl as TdxFloatForm).DockSite; + end; +end; + +function TdxDockingController.GetNearestDockSiteAtPos(pt: TPoint): TdxCustomDockControl; +var + I: Integer; + ADockSite: TdxDockSite; + R: TRect; +begin + Result := nil; + for I := 0 to DockControlCount - 1 do + if DockControls[I] is TdxDockSite then + begin + ADockSite := DockControls[I] as TdxDockSite; + if not ADockSite.AutoSize then continue; + if not (ADockSite.Align in [alLeft, alTop, alRight, alBottom]) then continue; + if (ADockSite.Align in [alLeft, alRight]) and (ADockSite.Width > ADockSite.ControllerDockZonesWidth) then continue; + if (ADockSite.Align in [alTop, alBottom]) and (ADockSite.Height > ADockSite.ControllerDockZonesWidth) then continue; + GetWindowRect(ADockSite.Handle, R); + case ADockSite.Align of + alLeft: R.Right := R.Left + ADockSite.ControllerDockZonesWidth; + alTop: R.Bottom := R.Top + ADockSite.ControllerDockZonesWidth; + alRight: R.Left := R.Right - ADockSite.ControllerDockZonesWidth; + alBottom: R.Top := R.Bottom - ADockSite.ControllerDockZonesWidth; + end; + if PtInRect(R, pt) then + begin + Result := ADockSite; + break; + end; + end; +end; + +function TdxDockingController.IsDockControlFocusedEx(ADockControl: TdxCustomDockControl): Boolean; +begin + Result := ADockControl.HandleAllocated and + (dxDockingController.GetDockControlForWindow(GetFocus, ADockControl.Handle) = ADockControl); +end; +{function TdxDockingController.IsDockControlFocusedEx(ADockControl: TdxCustomDockControl): Boolean; +var + AWnd: HWND; +begin + Result := False; + if not ADockControl.HandleAllocated then Exit; + AWnd := GetFocus; + while AWnd <> 0 do + begin + if ADockControl.Handle = AWnd then + begin + Result := True; + Break; + end; + AWnd := GetParent(AWnd); + end; +end;} + +function TdxDockingController.FindManager(AForm: TCustomForm): TdxDockingManager; +begin + Result := FindFormManager(AForm); + if (Result = nil) and (DockManagerCount > 0) then + Result := DockManagers[0]; +end; + +function TdxDockingController.FindFormManager(AForm: TCustomForm): TdxDockingManager; +var + I: Integer; + AManager: TdxDockingManager; +begin + Result := nil; + for I := 0 to FDockManagers.Count - 1 do + begin + AManager := TdxDockingManager(FDockManagers[I]); + if AManager.ParentForm = AForm then + begin + Result := AManager; + break; + end; + end; +end; + +procedure TdxDockingController.RegisterManager(AManager: TdxDockingManager); +var + AOldManager: TdxDockingManager; +begin + AOldManager := FindFormManager(AManager.ParentForm); + if (AOldManager <> nil) and (AOldManager <> AManager) then + raise Exception.Create(sdxManagerError); + if AOldManager = nil then + begin + FDockManagers.Add(AManager); + DoManagerChanged(AManager.ParentForm); + end; +end; + +procedure TdxDockingController.UnregisterManager(AManager: TdxDockingManager); +begin + if FindManager(AManager.ParentForm) <> nil then + begin + FDockManagers.Remove(AManager); + DoManagerChanged(nil); + end; +end; + +procedure TdxDockingController.DoActiveDockControlChanged(ASender: TdxCustomDockControl; + ACallEvent: Boolean); +var + AManager: TdxDockingManager; +begin + if ACallEvent and (ASender <> nil) then + begin + AManager := FindManager(ASender.ParentForm); + if (AManager <> nil) and Assigned(AManager.OnActiveDockControlChanged) then + AManager.OnActiveDockControlChanged(AManager); + end; +end; + +procedure TdxDockingController.DoCreateFloatSite(ASender: TdxCustomDockControl; ASite: TdxFloatDockSite); +var + AManager: TdxDockingManager; +begin + AManager := FindManager(ASender.ParentForm); + if (AManager <> nil) and Assigned(AManager.OnCreateFloatSite) then + AManager.OnCreateFloatSite(ASender, ASite); +end; + +procedure TdxDockingController.DoCreateLayoutSite(ASender: TdxCustomDockControl; ASite: TdxLayoutDockSite); +var + AManager: TdxDockingManager; +begin + AManager := FindManager(ASender.ParentForm); + if (AManager <> nil) and Assigned(AManager.OnCreateLayoutSite) then + AManager.OnCreateLayoutSite(ASender, ASite); +end; + +procedure TdxDockingController.DoCreateSideContainerSite(ASender: TdxCustomDockControl; + ASite: TdxSideContainerDockSite); +var + AManager: TdxDockingManager; +begin + AManager := FindManager(ASender.ParentForm); + if (AManager <> nil) and Assigned(AManager.OnCreateSideContainer) then + AManager.OnCreateSideContainer(ASender, ASite); +end; + +procedure TdxDockingController.DoCreateTabContainerSite(ASender: TdxCustomDockControl; + ASite: TdxTabContainerDockSite); +var + AManager: TdxDockingManager; +begin + AManager := FindManager(ASender.ParentForm); + if (AManager <> nil) and Assigned(AManager.OnCreateTabContainer) then + AManager.OnCreateTabContainer(ASender, ASite); +end; + +function TdxDockingController.DoCustomDrawResizingSelection(ASender: TdxCustomDockControl; + DC: HDC; AZone: TdxZone; pt: TPoint; Erasing: Boolean): Boolean; +var + AManager: TdxDockingManager; +begin + Result := False; + if Assigned(ASender.OnCustomDrawResizingSelection) then + ASender.OnCustomDrawResizingSelection(ASender, DC, AZone, AZone.GetResizingSelection(pt), Erasing, Result); + if not Result then + begin + AManager := FindManager(ASender.ParentForm); + if (AManager <> nil) and Assigned(AManager.OnCustomDrawResizingSelection) then + AManager.OnCustomDrawResizingSelection(ASender, DC, AZone, AZone.GetResizingSelection(pt), Erasing, Result); + end; +end; + +function TdxDockingController.DoCustomDrawDockingSelection(ASender: TdxCustomDockControl; + DC: HDC; AZone: TdxZone; R: TRect; Erasing: Boolean): Boolean; +var + AManager: TdxDockingManager; +begin + Result := False; + if Assigned(ASender.OnCustomDrawDockingSelection) then + ASender.OnCustomDrawDockingSelection(ASender, DC, AZone, R, Erasing, Result); + if not Result then + begin + AManager := FindManager(ASender.ParentForm); + if (AManager <> nil) and Assigned(AManager.OnCustomDrawDockingSelection) then + AManager.OnCustomDrawDockingSelection(ASender, DC, AZone, R, Erasing, Result); + end; +end; + +procedure TdxDockingController.DoSetFloatFormCaption(ASender: TdxCustomDockControl; + AFloatForm: TdxFloatForm); +var + AManager: TdxDockingManager; +begin + AManager := FindManager(ASender.ParentForm); + if (AManager <> nil) and Assigned(AManager.OnSetFloatFormCaption) then + AManager.OnSetFloatFormCaption(ASender, AFloatForm); +end; + +function TdxDockingController.DefaultLayoutSiteProperties(AForm: TCustomForm): TdxLayoutDockSiteProperties; +var + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if (AManager <> nil) and AManager.UseDefaultSitesProperties then + Result := AManager.DefaultLayoutSiteProperties + else Result := nil; +end; + +function TdxDockingController.DefaultFloatSiteProperties(AForm: TCustomForm): TdxFloatDockSiteProperties; +var + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if (AManager <> nil) and AManager.UseDefaultSitesProperties then + Result := AManager.DefaultFloatSiteProperties + else Result := nil; +end; + +function TdxDockingController.DefaultHorizContainerSiteProperties(AForm: TCustomForm): TdxSideContainerDockSiteProperties; +var + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if (AManager <> nil) and AManager.UseDefaultSitesProperties then + Result := AManager.DefaultHorizContainerSiteProperties + else Result := nil; +end; + +function TdxDockingController.DefaultVertContainerSiteProperties(AForm: TCustomForm): TdxSideContainerDockSiteProperties; +var + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if (AManager <> nil) and AManager.UseDefaultSitesProperties then + Result := AManager.DefaultVertContainerSiteProperties + else Result := nil; +end; + +function TdxDockingController.DefaultTabContainerSiteProperties(AForm: TCustomForm): TdxTabContainerDockSiteProperties; +var + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if (AManager <> nil) and AManager.UseDefaultSitesProperties then + Result := AManager.DefaultTabContainerSiteProperties + else Result := nil; +end; + +procedure TdxDockingController.LoadLayoutFromIniFile(AFileName: string; AForm: TCustomForm = nil); +var + AStream: TFileStream; +begin + if not FileExists(AFileName) then Exit; +{$IFDEF DELPHI6} + AStream := TFileStream.Create(AFileName, fmOpenRead, fmShareDenyWrite); +{$ELSE} + AStream := TFileStream.Create(AFileName, fmOpenRead or fmShareDenyWrite); +{$ENDIF} + try + LoadLayoutFromStream(AStream, AForm); + finally + AStream.Free; + end; +end; + +procedure TdxDockingController.LoadLayoutFromRegistry(ARegistryPath: string; AForm: TCustomForm = nil); +var + Storage: TRegistryIniFile; +begin + Storage := TRegistryIniFile.Create(ARegistryPath); + try + LoadLayoutFromCustomIni(Storage, AForm); + finally + Storage.Free; + end; +end; + +procedure TdxDockingController.LoadLayoutFromStream(AStream: TStream; AForm: TCustomForm = nil); +var + Storage: TMemIniFile; + AStrings: TStringList; +begin + Storage := TMemIniFile.Create(''); + AStrings := TStringList.Create; + try + AStrings.LoadFromStream(AStream); + Storage.SetStrings(AStrings); + LoadLayoutFromCustomIni(Storage, AForm); + finally + AStrings.Free; + Storage.Free; + end; +end; + +procedure TdxDockingController.SaveLayoutToIniFile(AFileName: string; AForm: TCustomForm = nil); +var + AStream: TFileStream; +begin + if AFileName = '' then exit; + if ExtractFileExt(AFileName) = '' then + AFileName := ChangeFileExt(AFileName, '.ini'); +{$IFDEF DELPHI6} + AStream := TFileStream.Create(AFileName, fmCreate, fmShareExclusive); +{$ELSE} + AStream := TFileStream.Create(AFileName, fmCreate or fmShareExclusive); +{$ENDIF} + try + SaveLayoutToStream(AStream, AForm); + finally + AStream.Free; + end; +end; + +procedure TdxDockingController.SaveLayoutToRegistry(ARegistryPath: string; AForm: TCustomForm = nil); +var + Storage: TRegistryIniFile; +begin + if ARegistryPath = '' then exit; + Storage := TRegistryIniFile.Create(ARegistryPath); + try + SaveLayoutToCustomIni(Storage, AForm); + finally + Storage.Free; + end; +end; + +procedure TdxDockingController.SaveLayoutToStream(AStream: TStream; AForm: TCustomForm = nil); +var + Storage: TMemIniFile; + AStrings: TStringList; +begin + Storage := TMemIniFile.Create(''); + AStrings := TStringList.Create; + try + SaveLayoutToCustomIni(Storage, AForm); + Storage.GetStrings(AStrings); + AStrings.SaveToStream(AStream); + finally + AStrings.Free; + Storage.Free; + end; +end; + +function TdxDockingController.AutoHideInterval(AForm: TCustomForm): Integer; +var + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if AManager <> nil then + Result := AManager.AutoHideInterval + else Result := dxAutoHideInterval; +end; + +function TdxDockingController.AutoHideMovingInterval(AForm: TCustomForm): Integer; +var + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if AManager <> nil then + Result := AManager.AutoHideMovingInterval + else Result := dxAutoHideMovingInterval; +end; + +function TdxDockingController.AutoHideMovingSize(AForm: TCustomForm): Integer; +var + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if AManager <> nil then + Result := AManager.AutoHideMovingSize + else Result := dxAutoHideMovingSize; +end; + +function TdxDockingController.AutoShowInterval(AForm: TCustomForm): Integer; +var + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if AManager <> nil then + Result := AManager.AutoShowInterval + else Result := dxAutoShowInterval; +end; + +function TdxDockingController.Color(AForm: TCustomForm): TColor; +var + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if AManager <> nil then + Result := AManager.Color + else Result := clBtnFace; +end; + +function TdxDockingController.DockZonesWidth(AForm: TCustomForm): Integer; +var + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if AManager <> nil then + Result := AManager.DockZonesWidth + else Result := dxDockZonesWidth; +end; + +function TdxDockingController.Font(AForm: TCustomForm): TFont; +var + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if AManager <> nil then + Result := AManager.Font + else Result := FFont; +end; + +function TdxDockingController.Images(AForm: TCustomForm): TCustomImageList; +var + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if AManager <> nil then + Result := AManager.Images + else Result := nil; +end; + +function TdxDockingController.Options(AForm: TCustomForm): TdxDockingOptions; +var + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if AManager <> nil then + Result := AManager.Options + else + Result := dxDockingDefaultOptions; +end; + +function TdxDockingController.ViewStyle(AForm: TCustomForm): TdxDockingViewStyle; +var + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if AManager <> nil then + Result := AManager.ViewStyle + else Result := vsStandard; +end; + +function TdxDockingController.ResizeZonesWidth(AForm: TCustomForm): Integer; +var + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if AManager <> nil then + Result := AManager.ResizeZonesWidth + else Result := dxResizeZonesWidth; +end; + +function TdxDockingController.SelectionFrameWidth(AForm: TCustomForm): Integer; +var + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if AManager <> nil then + Result := AManager.SelectionFrameWidth + else Result := dxSelectionFrameWidth; +end; + +function TdxDockingController.TabsScrollInterval(AForm: TCustomForm): Integer; +var + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if AManager <> nil then + Result := AManager.TabsScrollInterval + else Result := dxTabsScrollInterval; +end; + +procedure TdxDockingController.DoColorChanged(AForm: TCustomForm); +var + I: Integer; +begin + BeginUpdateNC; + try + for I := 0 to DockControlCount - 1 do + if ControlNeedUpdate(DockControls[I], AForm) and DockControls[I].ManagerColor then + begin + DockControls[I].Color := Color(DockControls[I].ParentForm); + DockControls[I].FManagerColor := True; + end; + InvalidateControls(AForm, False); + finally + EndUpdateNC; + end; +end; + +procedure TdxDockingController.DoImagesChanged(AForm: TCustomForm); +begin + CalculateControls(AForm); +end; + +procedure TdxDockingController.DoLayoutLoaded(AForm: TCustomForm); +var + I: Integer; + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if (AManager <> nil) then + begin + if Assigned(AManager.OnLayoutChanged) then + AManager.OnLayoutChanged(nil); + end + else for I := 0 to DockManagerCount - 1 do + begin + if Assigned(DockManagers[I].OnLayoutChanged) then + DockManagers[I].OnLayoutChanged(nil); + end; +end; + +procedure TdxDockingController.DoFontChanged(AForm: TCustomForm); +var + I: Integer; +begin + BeginUpdateNC; + try + for I := 0 to DockControlCount - 1 do + if ControlNeedUpdate(DockControls[I], AForm) and DockControls[I].ManagerFont then + begin + if not DockControls[I].IsDestroying then // !!! + begin + DockControls[I].Font := Font(DockControls[I].ParentForm); + DockControls[I].FManagerFont := True; + end; + end; + CalculateControls(AForm); + finally + EndUpdateNC; + end; +end; + +procedure TdxDockingController.DoLayoutChanged(ASender: TdxCustomDockControl); +var + AManager: TdxDockingManager; +begin + AManager := FindManager(ASender.ParentForm); + if (AManager <> nil) and Assigned(AManager.OnLayoutChanged) then + AManager.OnLayoutChanged(ASender); +end; + +procedure TdxDockingController.DoManagerChanged(AForm: TCustomForm); +begin + BeginUpdateNC; + Include(FInternalState, disManagerChanged); + try + DoColorChanged(AForm); + DoImagesChanged(AForm); + DoFontChanged(AForm); + DoOptionsChanged(AForm); + DoPainterChanged(AForm, False); + finally + Exclude(FInternalState, disManagerChanged); + EndUpdateNC; + end; +end; + +procedure TdxDockingController.DoOptionsChanged(AForm: TCustomForm); +begin + if doFloatingOnTop in Options(AForm) then + FloatFormsOnTopMost(nil) + else + FloatFormsOnTop(nil); + UpdateLayout(AForm); + CalculateControls(AForm); +end; + +procedure TdxDockingController.DoPainterChanged(AForm: TCustomForm; AssignDefaultStyle: Boolean); +var + I: Integer; + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + BeginUpdateNC; + try + if AManager <> nil then + AManager.ReleasePainterClass + else + for I := 0 to DockManagerCount - 1 do + DockManagers[I].ReleasePainterClass; + for I := 0 to DockControlCount - 1 do + begin + if ControlNeedUpdate(DockControls[I], AForm) then + begin + DockControls[I].FPainter.Free; + DockControls[I].FPainter := nil; + end; + end; + if AManager <> nil then + AManager.CreatePainterClass(AssignDefaultStyle) + else + for I := 0 to DockManagerCount - 1 do + DockManagers[I].CreatePainterClass(AssignDefaultStyle); + CalculateControls(AForm); + finally + EndUpdateNC; + end; +end; + +procedure TdxDockingController.DoZonesWidthChanged(AForm: TCustomForm); +begin + UpdateLayout(AForm); +end; + +procedure TdxDockingController.DoUpdateDockZones(ASender: TdxCustomDockControl); +var + AManager: TdxDockingManager; +begin + AManager := FindManager(ASender.ParentForm); + if (AManager <> nil) and Assigned(AManager.OnUpdateDockZones) then + AManager.OnUpdateDockZones(ASender, ASender.DockZones); +end; + +procedure TdxDockingController.DoUpdateResizeZones(ASender: TdxCustomDockControl); +var + AManager: TdxDockingManager; +begin + AManager := FindManager(ASender.ParentForm); + if (AManager <> nil) and Assigned(AManager.OnUpdateResizeZones) then + AManager.OnUpdateResizeZones(ASender, ASender.ResizeZones); +end; + +procedure TdxDockingController.ClearLayout(AForm: TCustomForm); +var + I: Integer; +begin + I := 0; + while I < DockControlCount do + begin + if ((DockControls[I].ParentForm = AForm) or (AForm = nil)) and + (DockControls[I] is TdxDockPanel) and (DockControls[I].ParentDockControl <> nil) then + begin + DockControls[I].UnDock; + I := 0; + end + else Inc(I); + end; + SendMessage(Handle, WM_DESTROYCONTROLS, 0, 0); +end; + +procedure TdxDockingController.LoadLayoutFromCustomIni(AIniFile: TCustomIniFile; AForm: TCustomForm); +var + I, ADockControlCount: Integer; + ASections: TStringList; + AControlClass: TdxCustomDockControlClass; + AParentForm: TCustomForm; + ASectionName: string; +begin + BeginUpdateNC; + try + ASections := TStringList.Create; + with AIniFile do + try + ReadSections(ASections); + ADockControlCount := ReadInteger('Root', 'DockControlCount', ASections.Count); + if ASections.Count > 0 then + ClearLayout(AForm); + for I := 0 to ADockControlCount - 1 do + begin + ASectionName := IntToStr(I); + if SectionExists(ASectionName) then + begin + AControlClass := TdxCustomDockControlClass(FindClass(ReadString(ASectionName, 'ClassName', ''))); + if (AControlClass = TdxDockSite) or (AControlClass = TdxFloatDockSite) then + begin + AParentForm := FindGlobalComponent(ReadString(ASectionName, 'ParentForm', '')) as TCustomForm; + if (AParentForm <> nil) and ((AParentForm = AForm) or (AForm = nil)) then + LoadControlFromCustomIni(AIniFile, AForm, nil, ASectionName); + end; + end; + end; + finally + ASections.Free; + end; + finally + EndUpdateNC; + end; + DoLayoutLoaded(nil); +end; + +procedure TdxDockingController.LoadControlFromCustomIni(AIniFile: TCustomIniFile; + AParentForm: TCustomForm; AParentControl: TdxCustomDockControl; ASection: string); +var + AControl: TdxCustomDockControl; + AControlClass: TdxCustomDockControlClass; +begin + with AIniFile do + begin + if AParentForm = nil then + AParentForm := FindGlobalComponent(ReadString(ASection, 'ParentForm', '')) as TCustomForm; + if AParentForm <> nil then + begin + AControl := AParentForm.FindComponent(ReadString(ASection, 'Name', '')) as TdxCustomDockControl; + if AControl = nil then + begin + AControlClass := TdxCustomDockControlClass(FindClass(ReadString(ASection, 'ClassName', ''))); + if (AControlClass <> nil) then + begin + AControl := AControlClass.Create(AParentForm); + AControl.Name := ReadString(ASection, 'Name', ''); + end; + end; + if AControl <> nil then + AControl.LoadLayoutFromCustomIni(AIniFile, AParentForm, AParentControl, ASection); + end; + end; +end; + +procedure TdxDockingController.SaveLayoutToCustomIni(AIniFile: TCustomIniFile; AForm: TCustomForm); +var + I, AOldCount: Integer; +begin + SendMessage(Handle, WM_DESTROYCONTROLS, 0, 0); + // Erase old section + AOldCount := AIniFile.ReadInteger('Root', 'DockControlCount', 0); + for I := AOldCount - 1 downto 0 do + AIniFile.EraseSection(IntToStr(I)); + AIniFile.WriteInteger('Root', 'DockControlCount', DockControlCount); + for I := 0 to DockControlCount - 1 do + begin + if DockControls[I].DockState = dsDestroyed then continue; + if ((DockControls[I].ParentForm = AForm) or (AForm = nil)) and + ((DockControls[I] is TdxDockSite) or (DockControls[I] is TdxFloatDockSite)) then + SaveControlToCustomIni(AIniFile, DockControls[I]); + end; +end; + +procedure TdxDockingController.SaveControlToCustomIni(AIniFile: TCustomIniFile; + AControl: TdxCustomDockControl); +var + ASection: string; +begin + with AIniFile do + begin + ASection := IntToStr(IndexOfDockControl(AControl)); + WriteString(ASection, 'ClassName', AControl.ClassName); + WriteString(ASection, 'Name', AControl.Name); + WriteString(ASection, 'ParentForm', AControl.ParentForm.Name); + AControl.SaveLayoutToCustomIni(AIniFile, ASection); + end; +end; + +procedure TdxDockingController.UpdateLayout(AForm: TCustomForm); +var + I: Integer; +begin + for I := 0 to DockControlCount - 1 do + begin + if DockControls[I].IsDestroying or DockControls[I].IsUpdateLayoutLocked then + continue; + if ControlNeedUpdate(DockControls[I], AForm) then + DockControls[I].UpdateLayout; + end; +end; + +procedure TdxDockingController.BeginUpdateNC(ALockRedraw: Boolean); +begin + if FCalculatingControl <> nil then exit; + if (FUpdateNCLock = 0) and ALockRedraw then + Include(FInternalState, disRedrawLocked); + Inc(FUpdateNCLock); +end; + +procedure TdxDockingController.EndUpdateNC; +begin + if FCalculatingControl <> nil then exit; + Dec(FUpdateNCLock); + if FUpdateNCLock = 0 then + begin + UpdateInvalidControlsNC; + Exclude(FInternalState, disRedrawLocked); + end; +end; + +function TdxDockingController.ControlNeedUpdate(AControl: TdxCustomDockControl; AForm: TCustomForm): Boolean; +var + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + Result := (AForm = nil) or (AManager = nil) or (AManager.ParentForm = nil) or + (AControl.ParentForm = AManager.ParentForm); +end; + +procedure TdxDockingController.DestroyControls; +var + AControl: TdxCustomDockControl; +begin + while FDestroyedDockControls.Count > 0 do + begin + AControl := TdxCustomDockControl(FDestroyedDockControls.Items[FDestroyedDockControls.Count - 1]); + FDestroyedDockControls.Remove(AControl); + if not (csDestroying in AControl.ComponentState) then AControl.Free; + end; +end; + +procedure TdxDockingController.FinishDocking; +begin + if DockingDockControl <> nil then + DockingDockControl.EndDocking(Point(0, 0), True); +end; + +procedure TdxDockingController.FinishResizing; +begin + if ResizingDockControl <> nil then + ResizingDockControl.EndResize(Point(0, 0), True); +end; + +function CompareDocks(Item1, Item2: Pointer): Integer; +var + AControl1, AControl2: TdxCustomDockControl; +begin + AControl1 := TdxCustomDockControl(Item1); + AControl2 := TdxCustomDockControl(Item2); + Result := AControl1.DockLevel - AControl2.DockLevel; + if Result = 0 then + Result := AControl1.DockIndex - AControl2.DockIndex; + if AControl2.AutoHide and not AControl1.AutoHide then + Result := -1 + else if AControl2.AutoHide and not AControl1.AutoHide then + Result := 1; +end; + +procedure TdxDockingController.UpdateInvalidControlsNC; +var + I: Integer; + AControl: TdxCustomDockControl; +begin + if FCalculatingControl <> nil then exit; + while FInvalidNCBounds.Count > 0 do + begin + FInvalidNCBounds.Sort(CompareDocks); + FCalculatingControl := TdxCustomDockControl(FInvalidNCBounds[0]); + try + FCalculatingControl.NCChanged; + FInvalidNCBounds.Remove(FCalculatingControl); + finally + FCalculatingControl := nil; + end; + end; + FInvalidNC.Sort(CompareDocks); + for I := 0 to FInvalidNC.Count - 1 do + begin + AControl := TdxCustomDockControl(FInvalidNC.Items[I]); + if not AControl.Visible then continue; + if FInvalidRedraw.IndexOf(AControl) > -1 then + begin + if disRedrawLocked in FInternalState then + begin + AControl.Perform(WM_SETREDRAW, Integer(True), 0); +// SendMessage(AControl.Handle, WM_SETREDRAW, Integer(True), 0); + AControl.Redraw(True); + end + else + AControl.Redraw(False); + if AControl.HandleAllocated and (AControl is TdxDockSite) and (AControl.Parent <> nil) then + RedrawWindow(AControl.Parent.Handle, nil, 0, RDW_INVALIDATE or RDW_ERASE or RDW_ALLCHILDREN); + end + else + AControl.InvalidateNC(True); + end; + FInvalidNC.Clear; + FInvalidRedraw.Clear; +end; + +procedure TdxDockingController.UpdateLayouts(AForm: TCustomForm); +var + I: Integer; +begin + I := FLoadedForms.IndexOf(AForm); + if I <> -1 then + begin + FLoadedForms.Delete(I); + dxDockingController.UpdateLayout(AForm); + end; +end; + +procedure TdxDockingController.WndProc(var Message: TMessage); +begin + case Message.Msg of + WM_DESTROYCONTROLS: DestroyControls; + WM_SYSCOLORCHANGE: DoPainterChanged(nil, True); + end; + inherited; +end; + +function TdxDockingController.CanUpdateNC(AControl: TdxCustomDockControl): Boolean; +begin + Result := (FUpdateNCLock = 0) and (FCalculatingControl = nil); + if not Result then + begin + if FInvalidNC.IndexOf(AControl) = -1 then + FInvalidNC.Add(AControl); + end; +end; + +function TdxDockingController.CanCalculateNC(AControl: TdxCustomDockControl): Boolean; +begin + Result := (FUpdateNCLock = 0); + if not Result then + begin + if FInvalidRedraw.IndexOf(AControl) = -1 then + begin + if disRedrawLocked in FInternalState then + AControl.Perform(WM_SETREDRAW, Integer(False), 0); +// SendMessage(AControl.Handle, WM_SETREDRAW, Integer(False), 0); + FInvalidRedraw.Add(AControl); + end; + if FInvalidNCBounds.IndexOf(AControl) = -1 then + FInvalidNCBounds.Add(AControl); + if FInvalidNC.IndexOf(AControl) = -1 then + FInvalidNC.Add(AControl); + end; +end; + +procedure TdxDockingController.DrawDockingSelection(ADockControl: TdxCustomDockControl; + AZone: TdxZone; const APoint: TPoint; AErasing: Boolean); +var + R, ARegionRect: TRect; + AHandled: Boolean; + ARegion: TcxRegion; +begin + if (AZone <> nil) or ADockControl.AllowFloating then + begin + if AZone <> nil then + R := AZone.GetDockingSelection(ADockControl) + else + R := ADockControl.GetFloatDockRect(APoint); + + AHandled := DoCustomDrawDockingSelection(ADockControl, cxScreenCanvas.Handle, AZone, R, AErasing); + + if not AHandled then + begin + ARegion := TcxRegion.Create; + try + ARegionRect := Rect(0, 0, cxRectWidth(R), cxRectHeight(R)); + if AZone <> nil then + AZone.PrepareSelectionRegion(ARegion, ADockControl, ARegionRect) + else + ADockControl.PrepareSelectionRegion(ARegion, ARegionRect); + FDragImage.DrawSizeFrame(R, ARegion); + finally + ARegion.Free; + end; + end; + end; +end; + +procedure TdxDockingController.DrawResizingSelection(ADockControl: TdxCustomDockControl; + AZone: TdxZone; const APoint: TPoint; AErasing: Boolean); +var + DesktopWindow: HWND; + DC: HDC; + OldBrush: HBrush; + AHandled: Boolean; +begin + DesktopWindow := GetDesktopWindow; + DC := GetDCEx(DesktopWindow, 0, DCX_CACHE or DCX_LOCKWINDOWUPDATE); + try + AHandled := DoCustomDrawResizingSelection(ADockControl, DC, AZone, APoint, AErasing); + if not AHandled then + begin + OldBrush := SelectObject(DC, SelectionBrush.Handle); + AZone.DrawResizingSelection(DC, APoint); + SelectObject(DC, OldBrush); + end; + finally + ReleaseDC(DesktopWindow, DC); + end; +end; + +function TdxDockingController.PainterClass(AForm: TCustomForm): TdxDockControlPainterClass; +var + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if AManager <> nil then + Result := AManager.PainterClass + else Result := TdxDockControlPainter; +end; + +procedure TdxDockingController.CalculateControls(AForm: TCustomForm); +var + I: Integer; +begin + BeginUpdateNC; + try + for I := 0 to DockControlCount - 1 do + if ControlNeedUpdate(DockControls[I], AForm) then + DockControls[I].Recalculate; + finally + EndUpdateNC; + end; +end; + +procedure TdxDockingController.InvalidateActiveDockControl; +begin + if ActiveDockControl <> nil then + begin + // InvalidateCaptionArea + ActiveDockControl.InvalidateCaptionArea; + if ActiveDockControl.Container <> nil then + ActiveDockControl.Container.InvalidateCaptionArea; + end; +end; + +procedure TdxDockingController.InvalidateControls(AForm: TCustomForm; ANeedRecalculate: Boolean); +var + I: Integer; +begin + BeginUpdateNC; + try + for I := 0 to DockControlCount - 1 do + if ControlNeedUpdate(DockControls[I], AForm) then + DockControls[I].InvalidateNC(ANeedRecalculate); + finally + EndUpdateNC; + end; +end; + +procedure TdxDockingController.CreatePainterColors(AForm: TCustomForm); +var + I: Integer; + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if AManager <> nil then + AManager.PainterClass.CreateColors + else for I := 0 to DockManagerCount - 1 do + DockManagers[I].PainterClass.CreateColors; +end; + +procedure TdxDockingController.RefreshPainterColors(AForm: TCustomForm); +var + I: Integer; + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if AManager <> nil then + begin + if AManager.FPainterClass <> nil then + AManager.FPainterClass.RefreshColors; + end + else for I := 0 to DockManagerCount - 1 do + if DockManagers[I].FPainterClass <> nil then + DockManagers[I].FPainterClass.RefreshColors; +end; + +procedure TdxDockingController.ReleasePainterColors(AForm: TCustomForm); +var + I: Integer; + AManager: TdxDockingManager; +begin + AManager := FindManager(AForm); + if AManager <> nil then + begin + if AManager.FPainterClass <> nil then + AManager.FPainterClass.ReleaseColors; + end + else for I := 0 to DockManagerCount - 1 do + if DockManagers[I].FPainterClass <> nil then + DockManagers[I].FPainterClass.ReleaseColors; +end; + +procedure TdxDockingController.CheckTempBitmap(ARect: TRect); +begin + if FTempBitmap = nil then + FTempBitmap := TBitmap.Create; + try + if FTempBitmap.Width < (ARect.Right - ARect.Left) then + FTempBitmap.Width := ARect.Right - ARect.Left + 100; + if FTempBitmap.Height < (ARect.Bottom - ARect.Top) then + FTempBitmap.Height := ARect.Bottom - ARect.Top + 100; + except + on E: EOutOfResources do + ReleaseTempBitmap; + end; +end; + +procedure TdxDockingController.ReleaseTempBitmap; +begin + FTempBitmap.Free; + FTempBitmap := nil; +end; + +function TdxDockingController.GetIsDocking: Boolean; +begin + Result := DockingDockControl <> nil; +end; + +function TdxDockingController.GetDockControl(Index: Integer): TdxCustomDockControl; +begin + Result := TdxCustomDockControl(FDockControls.Items[Index]); +end; + +function TdxDockingController.GetDockControlCount: Integer; +begin + Result := FDockControls.Count; +end; + +function TdxDockingController.GetDockManager(Index: Integer): TdxDockingManager; +begin + Result := TdxDockingManager(FDockManagers.Items[Index]); +end; + +function TdxDockingController.GetDockManagerCount: Integer; +begin + Result := FDockManagers.Count; +end; + +function TdxDockingController.GetIsResizing: Boolean; +begin + Result := ResizingDockControl <> nil; +end; + +procedure TdxDockingController.SetActiveDockControl(Value: TdxCustomDockControl); + + procedure ActivateParent(AControl: TdxCustomDockControl); + begin + // SetActiveDockControl call recursive + if (AControl <> nil) and not (AControl is TdxDockSite) then + ActiveDockControl := AControl; + end; + +var + AOldActiveSite: TdxCustomDockControl; + ACallEvent: Boolean; +begin + if FActiveDockControl <> Value then + begin + Inc(FActiveDockControlLockCount); + try + AOldActiveSite := FActiveDockControl; + + if Value <> nil then + ActivateParent(Value.ParentDockControl); + + if (Value = nil) or Value.CanActive then + begin + FActiveDockControl := Value; + + ACallEvent := FActiveDockControlLockCount = 1; + if AOldActiveSite <> nil then + AOldActiveSite.DoActiveChanged(False, ACallEvent); + if FActiveDockControl <> nil then + FActiveDockControl.DoActiveChanged(True, ACallEvent); + if AOldActiveSite <> FActiveDockControl then + DoActiveDockControlChanged(FActiveDockControl, ACallEvent); + end; + FActivatingDockControl := nil; + finally + Dec(FActiveDockControlLockCount); + end; + end; +end; + +procedure TdxDockingController.FloatFormsOnTop(AParentForm: TCustomForm); +var + I: Integer; + AControl: TdxFloatDockSite; +begin + for I := 0 to DockControlCount - 1 do + begin + if DockControls[I].IsDesigning then continue; + if DockControls[I].IsDestroying then continue; + if DockControls[I] is TdxFloatDockSite then + begin + AControl := DockControls[I] as TdxFloatDockSite; + if (AParentForm = nil) or (AParentForm = AControl.ParentForm) then + AControl.FloatForm.SendOnTop; + end; + end; +end; + +procedure TdxDockingController.FloatFormsOnTopMost(AParentForm: TCustomForm); +var + I: Integer; + AControl: TdxFloatDockSite; +begin + for I := 0 to DockControlCount - 1 do + begin + if DockControls[I].IsDesigning then continue; + if DockControls[I].IsDestroying then continue; + if DockControls[I] is TdxFloatDockSite then + begin + AControl := DockControls[I] as TdxFloatDockSite; + if (AParentForm = nil) or (AParentForm = AControl.ParentForm) then + AControl.FloatForm.SendOnTopMost; + end; + end; +end; + +procedure TdxDockingController.FloatFormsHide(AParentForm: TCustomForm); +var + I: Integer; + AControl: TdxFloatDockSite; +begin + for I := 0 to DockControlCount - 1 do + begin + if DockControls[I] is TdxFloatDockSite then + begin + AControl := DockControls[I] as TdxFloatDockSite; + if IsParentForFloatDockSite(AParentForm, AControl) and + (AControl.FloatForm <> nil) {bug in Delphi 2005} then + begin + if AControl.IsDesigning then + ShowWindow(AControl.FloatForm.Handle, SW_HIDE) + else + if AControl.FloatForm.HandleAllocated then + PostMessage(AControl.FloatForm.Handle, WM_HIDEFORM, 0, 0); + end; + end; + end; +end; + +procedure TdxDockingController.FloatFormsShow(AParentForm: TCustomForm); +var + I: Integer; + AControl: TdxFloatDockSite; +begin + for I := 0 to DockControlCount - 1 do + begin + if DockControls[I] is TdxFloatDockSite then + begin + AControl := DockControls[I] as TdxFloatDockSite; + if not AControl.Visible then continue; + if IsParentForFloatDockSite(AParentForm, AControl) then + begin + if AControl.IsDesigning then + ShowWindow(AControl.FloatForm.Handle, SW_SHOW) + else + AControl.FloatForm.Perform(WM_SHOWFORM, 0, 0); + end; + end; + end; +end; + +function TdxDockingController.IsParentForFloatDockSite(AParentForm: TCustomForm; + AFloatDockSite: TdxFloatDockSite): Boolean; +begin + Result := (AParentForm = nil) or (AParentForm = AFloatDockSite.ParentForm); + if not Result and (TCustomFormAccess(AParentForm).FormStyle = fsMDIForm) and + (AFloatDockSite.ParentForm <> nil) and + (TCustomFormAccess(AFloatDockSite.ParentForm).FormStyle = fsMDIChild) then + Result := True; +end; + +procedure TdxDockingController.StartDocking(AControl: TdxCustomDockControl; const APoint: TPoint); +begin + FDragImage := TdxDockingDragImage.Create(AControl.ControllerSelectionFrameWidth); + FDragImage.FillSelection := doFillDockingSelection in AControl.ControllerOptions; + FDragImage.PopupParent := AControl.PopupParent; + if doFillDockingSelection in AControl.ControllerOptions then + begin + FDragImage.AlphaBlend := True; + FDragImage.AlphaBlendValue := 100; + FDragImage.Canvas.Brush.Color := clHighlight + end + else + begin + FDragImage.AlphaBlend := False; + FDragImage.Canvas.Brush := SelectionBrush; + end; + FDragImage.Show; +end; + +procedure TdxDockingController.Docking(AControl: TdxCustomDockControl; const APoint: TPoint); +begin + +end; + +procedure TdxDockingController.EndDocking(AControl: TdxCustomDockControl; const APoint: TPoint); +begin + FreeAndNil(FDragImage); +end; + +procedure TdxDockingController.DockControlLoaded(AControl: TdxCustomDockControl); +begin + if FLoadedForms.IndexOf(AControl.ParentForm) = -1 then + FLoadedForms.Add(AControl.ParentForm); +end; + +procedure TdxDockingController.DockManagerLoaded(AParentForm: TCustomForm); +begin + FLoadedForms.Remove(AParentForm); +end; + +function TdxDockingController.IndexOfDockControl(AControl: TdxCustomDockControl): Integer; +begin + Result := FDockControls.IndexOf(AControl); +end; + +procedure TdxDockingController.RegisterDestroyedDockControl(AControl: TdxCustomDockControl); +begin + FDestroyedDockControls.Add(AControl); + PostMessage(Handle, WM_DESTROYCONTROLS, 0, 0); +end; + +procedure TdxDockingController.RegisterDockControl(AControl: TdxCustomDockControl); +begin + FDockControls.Add(AControl); + if Assigned(FOnRegisterDockControl) then + FOnRegisterDockControl(AControl); +end; + +procedure TdxDockingController.UnregisterDockControl(AControl: TdxCustomDockControl); +begin + if Assigned(FOnUnregisterDockControl) then + FOnUnregisterDockControl(AControl); + if AControl = FActivatingDockControl then + FActivatingDockControl := nil; + if AControl = FDockingDockControl then + FDockingDockControl := nil; + if AControl = FResizingDockControl then + FResizingDockControl := nil; + FDockControls.Remove(AControl); + FDestroyedDockControls.Remove(AControl); + FInvalidRedraw.Remove(AControl); + FInvalidNC.Remove(AControl); + FInvalidNCBounds.Remove(AControl); + if FActiveDockControl = AControl then + FActiveDockControl := nil; +end; + +procedure TdxDockingController.SetSelectionBrush(Value: TBrush); +begin + FSelectionBrush.Assign(Value); +end; + +{ TdxCustomDockControlProperties } + +constructor TdxCustomDockControlProperties.Create(AOwner: TdxDockingManager); +begin + FOwner := AOwner; + FAllowDock := dxDockingDefaultDockingTypes; + FAllowDockClients := dxDockingDefaultDockingTypes; + FAllowFloating := True; + FCaptionButtons := dxDockinkDefaultCaptionButtons; + FColor := clBtnFace; + FDockable := True; + FFont := TFont.Create; + FImageIndex := -1; + FManagerColor := True; + FManagerFont := True; + FShowCaption := True; + FShowHint := False; + FTag := 0; +end; + +destructor TdxCustomDockControlProperties.Destroy; +begin + FFont.Free; + inherited; +end; + +procedure TdxCustomDockControlProperties.AssignTo(Dest: TPersistent); +var + AControl: TdxCustomDockControl; + AControlProperties: TdxCustomDockControlProperties; +begin + if Dest is TdxCustomDockControl then + begin + AControl := Dest as TdxCustomDockControl; + AControl.AllowDock := FAllowDock; + AControl.AllowDockClients := FAllowDockClients; + AControl.AllowFloating := FAllowFloating; + AControl.Caption := FCaption; + AControl.CaptionButtons := FCaptionButtons; + AControl.Dockable := FDockable; + AControl.ImageIndex := FImageIndex; + AControl.ShowCaption := FShowCaption; + AControl.Color := FColor; + AControl.Cursor := FCursor; + AControl.Font := FFont; + AControl.Hint := FHint; + AControl.ManagerColor := FManagerColor; + AControl.ManagerFont := FManagerFont; + AControl.PopupMenu := FPopupMenu; + AControl.ShowHint := FShowHint; + AControl.Tag := FTag; + end + else if Dest is TdxCustomDockControlProperties then + begin + AControlProperties := Dest as TdxCustomDockControlProperties; + AControlProperties.AllowDock := FAllowDock; + AControlProperties.AllowDockClients := FAllowDockClients; + AControlProperties.AllowFloating := FAllowFloating; + AControlProperties.Caption := FCaption; + AControlProperties.CaptionButtons := FCaptionButtons; + AControlProperties.Dockable := FDockable; + AControlProperties.ImageIndex := FImageIndex; + AControlProperties.ShowCaption := FShowCaption; + AControlProperties.Color := FColor; + AControlProperties.Cursor := FCursor; + AControlProperties.Font := FFont; + AControlProperties.Hint := FHint; + AControlProperties.ManagerColor := FManagerColor; + AControlProperties.ManagerFont := FManagerFont; + AControlProperties.PopupMenu := FPopupMenu; + AControlProperties.ShowHint := FShowHint; + AControlProperties.Tag := FTag; + end + else inherited; +end; + +function TdxCustomDockControlProperties.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +function TdxCustomDockControlProperties.IsColorStored: Boolean; +begin + Result := not ManagerColor; +end; + +function TdxCustomDockControlProperties.IsFontStored: Boolean; +begin + Result := not ManagerFont; +end; + +procedure TdxCustomDockControlProperties.SetColor(const Value: TColor); +begin + if FColor <> Value then + begin + FColor := Value; + if not (csLoading in FOwner.ComponentState)then + FManagerColor := False; + end; +end; + +procedure TdxCustomDockControlProperties.SetFont(const Value: TFont); +begin + FFont.Assign(Value); + if not (csLoading in FOwner.ComponentState)then + FManagerFont := False; +end; + +procedure TdxCustomDockControlProperties.SetManagerColor(const Value: Boolean); +begin + if FManagerColor <> Value then + begin + if Value and not (csLoading in FOwner.ComponentState) then + FColor := FOwner.Color; + FManagerColor := Value; + end; +end; + +procedure TdxCustomDockControlProperties.SetManagerFont(const Value: Boolean); +begin + if FManagerFont <> Value then + begin + if Value and not (csLoading in FOwner.ComponentState) then + FFont.Assign(FOwner.Font); + FManagerFont := Value; + end; +end; + +{ TdxTabContainerDockSiteProperties } + +constructor TdxTabContainerDockSiteProperties.Create(AOwner: TdxDockingManager); +begin + inherited Create(AOwner); + FTabsPosition := tctpBottom; + FTabsScroll := True; +end; + +procedure TdxTabContainerDockSiteProperties.AssignTo(Dest: TPersistent); +var + AContainer: TdxTabContainerDockSite; + AContainerProperties: TdxTabContainerDockSiteProperties; +begin + if Dest is TdxTabContainerDockSite then + begin + AContainer := Dest as TdxTabContainerDockSite; + AContainer.TabsPosition := FTabsPosition; + AContainer.TabsScroll := FTabsScroll; + end + else if Dest is TdxTabContainerDockSiteProperties then + begin + AContainerProperties := Dest as TdxTabContainerDockSiteProperties; + AContainerProperties.TabsPosition := FTabsPosition; + AContainerProperties.TabsScroll := FTabsScroll; + end; + inherited; +end; + +{ TdxDockingManager } + +constructor TdxDockingManager.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FAutoHideInterval := dxAutoHideInterval; + FAutoHideMovingInterval := dxAutoHideMovingInterval; + FAutoHideMovingSize := dxAutoHideMovingSize; + FAutoShowInterval := dxAutoShowInterval; + FChangeLink := TChangeLink.Create; + FChangeLink.OnChange := DoOnImagesChanged; + FColor := clBtnFace; + FDefaultSitesPropertiesList := TList.Create; + FDockZonesWidth := dxDockZonesWidth; + CreateDefaultSitesProperties; + FFont := TFont.Create; + FFont.OnChange := DoOnFontChanged; + FLookAndFeel := TcxLookAndFeel.Create(Self); + FLookAndFeel.OnChanged := DoOnLFChanged; + FOptions := dxDockingDefaultOptions; + FResizeZonesWidth := dxResizeZonesWidth; + FSelectionFrameWidth := dxSelectionFrameWidth; + FTabsScrollInterval := dxTabsScrollInterval; + FUseDefaultSitesProperties := True; + FViewStyle := vsStandard; + dxDockingController.RegisterManager(Self); +end; + +destructor TdxDockingManager.Destroy; +begin + dxDockingController.UnregisterManager(Self); + FLookAndFeel.Free; + FFont.Free; + DestroyDefaultSitesProperties; + FDefaultSitesPropertiesList.Free; + FChangeLink.Free; + inherited; +end; + +procedure TdxDockingManager.LoadLayoutFromIniFile(AFileName: string); +begin + dxDockingController.LoadLayoutFromIniFile(AFileName, ParentForm); +end; + +procedure TdxDockingManager.LoadLayoutFromRegistry(ARegistryPath: string); +begin + dxDockingController.LoadLayoutFromRegistry(ARegistryPath, ParentForm); +end; + +procedure TdxDockingManager.LoadLayoutFromStream(AStream: TStream); +begin + dxDockingController.LoadLayoutFromStream(AStream, ParentForm); +end; + +procedure TdxDockingManager.SaveLayoutToIniFile(AFileName: string); +begin + dxDockingController.SaveLayoutToIniFile(AFileName, ParentForm); +end; + +procedure TdxDockingManager.SaveLayoutToRegistry(ARegistryPath: string); +begin + dxDockingController.SaveLayoutToRegistry(ARegistryPath, ParentForm); +end; + +procedure TdxDockingManager.SaveLayoutToStream(AStream: TStream); +begin + dxDockingController.SaveLayoutToStream(AStream, ParentForm); +end; + +procedure TdxDockingManager.Notification(AComponent: TComponent; Operation: TOperation); +var + I: Integer; +begin + inherited; + if (Operation = opRemove) and not IsDestroying then + begin + if AComponent = Images then + Images := nil; + for I := 0 to DefaultSitesPropertiesCount - 1 do + if AComponent = DefaultSitesProperties[I].PopupMenu then + DefaultSitesProperties[I].PopupMenu := nil; + end; +end; + +procedure TdxDockingManager.Loaded; +begin + inherited; + UpdateDefaultSitesPropertiesColor; + UpdateDefaultSitesPropertiesFont; + dxDockingController.DockManagerLoaded(ParentForm); + dxDockingController.DoManagerChanged(ParentForm); +end; + +function TdxDockingManager.IsLoading: Boolean; +begin + Result := csLoading in ComponentState; +end; + +function TdxDockingManager.IsDestroying: Boolean; +begin + Result := csDestroying in ComponentState; +end; + +procedure TdxDockingManager.DoColorChanged; +begin + UpdateDefaultSitesPropertiesColor; + dxDockingController.DoColorChanged(ParentForm); +end; + +procedure TdxDockingManager.DoFontChanged; +begin + UpdateDefaultSitesPropertiesFont; + dxDockingController.DoFontChanged(ParentForm); +end; + +procedure TdxDockingManager.CreatePainterClass(AssignDefaultStyle: Boolean); +begin + PainterClass.CreateColors; + if AssignDefaultStyle then + begin + PainterClass.AssignDefaultColor(Self); + PainterClass.AssignDefaultFont(Self); + end; +end; + +function TdxDockingManager.GetPainterClass: TdxDockControlPainterClass; +const + AStyles: array[TcxLookAndFeelKind] of TdxDockingViewStyle = ( + vsNET, vsStandard, vsNET{$IFDEF DXVER500}, vsOffice11{$ENDIF}); + APainterClasses: array[TdxDockingViewStyle] of TdxDockControlPainterClass = ( + TdxDockControlPainter, TdxDockControlNETPainter, TdxDockControlOfficePainter, + TdxDockControlXPPainter, TdxDockControlPainter); +var + AUseSkinPainter: Boolean; + AViewStyle: TdxDockingViewStyle; +begin + if FPainterClass = nil then + begin + AUseSkinPainter := False; + if ViewStyle = vsUseLookAndFeel then + begin + if LookAndFeel.NativeStyle and AreVisualStylesAvailable([]) then + AViewStyle := vsXP + else + AViewStyle := AStyles[LookAndFeel.Kind]; + AUseSkinPainter := LookAndFeel.SkinPainter <> nil; + end + else + AViewStyle := ViewStyle; + + if AUseSkinPainter and (CustomSkinPainterClass <> nil) then + FPainterClass := CustomSkinPainterClass + else + FPainterClass := APainterClasses[AViewStyle]; + end; + Result := FPainterClass; +end; + +procedure TdxDockingManager.ReleasePainterClass; +begin + if FPainterClass <> nil then + begin + FPainterClass.ReleaseColors; + FPainterClass := nil; + end; +end; + +procedure TdxDockingManager.CreateDefaultSitesProperties; +begin + if FDefaultSitesPropertiesList = nil then exit; + FDefaultSitesPropertiesList.Add(TdxLayoutDockSiteProperties.Create(Self)); + FDefaultSitesPropertiesList.Add(TdxFloatDockSiteProperties.Create(Self)); + FDefaultSitesPropertiesList.Add(TdxSideContainerDockSiteProperties.Create(Self)); + FDefaultSitesPropertiesList.Add(TdxSideContainerDockSiteProperties.Create(Self)); + FDefaultSitesPropertiesList.Add(TdxTabContainerDockSiteProperties.Create(Self)); +end; + +procedure TdxDockingManager.DestroyDefaultSitesProperties; +var + I: Integer; +begin + if FDefaultSitesPropertiesList = nil then exit; + for I := 0 to FDefaultSitesPropertiesList.Count - 1 do + TdxCustomDockControlProperties(FDefaultSitesPropertiesList[I]).Free; + FDefaultSitesPropertiesList.Clear; +end; + +procedure TdxDockingManager.UpdateDefaultSitesPropertiesColor; +var + I: Integer; +begin + for I := 0 to DefaultSitesPropertiesCount - 1 do + if DefaultSitesProperties[I].ManagerColor then + begin + DefaultSitesProperties[I].Color := Color; + DefaultSitesProperties[I].FManagerColor := True; + end; +end; + +procedure TdxDockingManager.UpdateDefaultSitesPropertiesFont; +var + I: Integer; +begin + for I := 0 to DefaultSitesPropertiesCount - 1 do + if DefaultSitesProperties[I].ManagerFont then + begin + DefaultSitesProperties[I].Font := Font; + DefaultSitesProperties[I].FManagerFont := True; + end; +end; + +procedure TdxDockingManager.DoOnImagesChanged(Sender: TObject); +begin + if not IsLoading then + dxDockingController.DoImagesChanged(ParentForm); +end; + +procedure TdxDockingManager.DoOnFontChanged(Sender: TObject); +begin + if not IsLoading then + DoFontChanged; +end; + +procedure TdxDockingManager.DoOnLFChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); +begin + if not IsLoading and (ViewStyle = vsUseLookAndFeel) then + dxDockingController.DoPainterChanged(ParentForm, True); +end; + +function TdxDockingManager.IsDefaultSitePropertiesStored: Boolean; +begin + Result := FUseDefaultSitesProperties; +end; + +function TdxDockingManager.GetDefaultSiteProperties(Index: Integer): TdxCustomDockControlProperties; +begin + if (0 <= Index) and (Index < FDefaultSitesPropertiesList.Count) then + Result := TdxCustomDockControlProperties(FDefaultSitesPropertiesList[Index]) + else Result := nil; +end; + +function TdxDockingManager.GetDefaultSitesPropertiesCount: Integer; +begin + Result := FDefaultSitesPropertiesList.Count; +end; + +function TdxDockingManager.GetDefaultLayoutSiteProperties: TdxLayoutDockSiteProperties; +begin + Result := DefaultSitesProperties[0] as TdxLayoutDockSiteProperties; +end; + +function TdxDockingManager.GetDefaultFloatSiteProperties: TdxFloatDockSiteProperties; +begin + Result := DefaultSitesProperties[1] as TdxFloatDockSiteProperties; +end; + +function TdxDockingManager.GetDefaultHorizContainerSiteProperties: TdxSideContainerDockSiteProperties; +begin + Result := DefaultSitesProperties[2] as TdxSideContainerDockSiteProperties; +end; + +function TdxDockingManager.GetDefaultVertContainerSiteProperties: TdxSideContainerDockSiteProperties; +begin + Result := DefaultSitesProperties[3] as TdxSideContainerDockSiteProperties; +end; + +function TdxDockingManager.GetDefaultTabContainerSiteProperties: TdxTabContainerDockSiteProperties; +begin + Result := DefaultSitesProperties[4] as TdxTabContainerDockSiteProperties; +end; + +function TdxDockingManager.GetParentForm: TCustomForm; +begin + if Owner is TCustomForm then + Result := Owner as TCustomForm + else + Result := nil; +end; + +procedure TdxDockingManager.SetColor(const Value: TColor); +begin + if FColor <> Value then + begin + FColor := Value; + if not IsLoading then + DoColorChanged; + end; +end; + +procedure TdxDockingManager.SetDefaultLayoutSiteProperties(Value: TdxLayoutDockSiteProperties); +begin + (DefaultSitesProperties[0] as TdxLayoutDockSiteProperties).Assign(Value); +end; + +procedure TdxDockingManager.SetDefaultFloatSiteProperties(Value: TdxFloatDockSiteProperties); +begin + (DefaultSitesProperties[1] as TdxFloatDockSiteProperties).Assign(Value); +end; + +procedure TdxDockingManager.SetDefaultHorizContainerSiteProperties(Value: TdxSideContainerDockSiteProperties); +begin + (DefaultSitesProperties[2] as TdxSideContainerDockSiteProperties).Assign(Value); +end; + +procedure TdxDockingManager.SetDefaultVertContainerSiteProperties(Value: TdxSideContainerDockSiteProperties); +begin + (DefaultSitesProperties[3] as TdxSideContainerDockSiteProperties).Assign(Value); +end; + +procedure TdxDockingManager.SetDefaultTabContainerSiteProperties(Value: TdxTabContainerDockSiteProperties); +begin + (DefaultSitesProperties[3] as TdxTabContainerDockSiteProperties).Assign(Value); +end; + +procedure TdxDockingManager.SetDockZonesWidth(const Value: Integer); +begin + if FDockZonesWidth <> Value then + begin + FDockZonesWidth := Value; + dxDockingController.DoZonesWidthChanged(ParentForm); + end; +end; + +procedure TdxDockingManager.SetFont(const Value: TFont); +begin + FFont.Assign(Value); +end; + +procedure TdxDockingManager.SetImages(const Value: TCustomImageList); +begin + cxSetImageList(Value, FImages, FChangeLink, Self); +end; + +procedure TdxDockingManager.SetLookAndFeel(Value: TcxLookAndFeel); +begin + FLookAndFeel.Assign(Value); +end; + +procedure TdxDockingManager.SetOptions(const Value: TdxDockingOptions); +begin + if FOptions <> Value then + begin + FOptions := Value; + if not IsLoading then + dxDockingController.DoOptionsChanged(ParentForm); + end; +end; + +procedure TdxDockingManager.SetResizeZonesWidth(const Value: Integer); +begin + if FResizeZonesWidth <> Value then + begin + FResizeZonesWidth := Value; + dxDockingController.DoZonesWidthChanged(ParentForm); + end; +end; + +procedure TdxDockingManager.SetViewStyle(const Value: TdxDockingViewStyle); +begin + if FViewStyle <> Value then + begin + FViewStyle := Value; + if not IsLoading then + begin + dxDockingController.DoPainterChanged(ParentForm, True); + if Assigned(FOnViewChanged) then + FOnViewChanged(Self); + end; + end; +end; + +initialization + RegisterClasses([TdxLayoutDockSite, TdxContainerDockSite, TdxTabContainerDockSite, + TdxSideContainerDockSite, TdxVertContainerDockSite, TdxHorizContainerDockSite, + TdxFloatDockSite, TdxDockSite, TdxDockingManager]); + cxControls.cxGetParentFormForDocking := GetParentFormForDocking; + +finalization + cxControls.cxGetParentFormForDocking := nil; + FDockingController.Free; + FDockingController := nil; + +end. diff --git a/official/x.35/ExpressDocking Library/Sources/dxDockControlNETView.pas b/official/x.35/ExpressDocking Library/Sources/dxDockControlNETView.pas new file mode 100644 index 00000000..7d4f37fa --- /dev/null +++ b/official/x.35/ExpressDocking Library/Sources/dxDockControlNETView.pas @@ -0,0 +1,501 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDocking } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDOCKING AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxDockControlNETView; + +{$I cxVer.inc} + +interface + +uses + Menus, Windows, Graphics, Classes, Controls, ExtCtrls, Messages, Forms, + dxDockControl, dxDockPanel; + +type + TdxDockControlNETPainter = class(TdxDockControlPainter) + protected + class procedure AssignDefaultFont(AManager: TdxDockingManager); override; + + function GetNETBackColor: TColor; virtual; + function GetCaptionColor(IsActive: Boolean): TColor; override; + function GetCaptionFontColor(IsActive: Boolean): TColor; override; + function GetTabsColor: TColor; override; + function GetTabColor(IsActive: Boolean): TColor; override; + function GetTabFontColor(IsActive: Boolean): TColor; override; + function GetTabsScrollButtonsSignColor(IsEnable: Boolean): TColor; override; + function GetHideBarColor: TColor; override; + public + // CustomDockControl + function CanVerticalCaption: Boolean; override; + function GetCaptionHeight: Integer; override; + function GetCaptionVertInterval: Integer; override; + + procedure DrawBorder(ACanvas: TCanvas; ARect: TRect); override; + procedure DrawCaption(ACanvas: TCanvas; ARect: TRect; IsActive: Boolean); override; + procedure DrawCaptionText(ACanvas: TCanvas; ARect: TRect; IsActive: Boolean); override; + procedure DrawCaptionButtonSelection(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot: Boolean); override; + procedure DrawCaptionCloseButton(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot, IsSwitched: Boolean); override; + procedure DrawCaptionHideButton(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot, IsSwitched: Boolean); override; + procedure DrawCaptionMaximizeButton(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot, IsSwitched: Boolean); override; + // TabContainer + function GetTabsHeight: Integer; override; + function GetTabVertInterval: Integer; override; + + procedure DrawTabs(ACanvas: TCanvas; ARect, AActiveTabRect: TRect; + APosition: TdxTabContainerTabsPosition); override; + procedure DrawTab(ACanvas: TCanvas; AControl: TdxCustomDockControl; + ARect: TRect; IsActive: Boolean; APosition: TdxTabContainerTabsPosition); override; + procedure DrawTabsNextTabButton(ACanvas: TCanvas; ARect: TRect; + IsDown, IsHot, IsEnable: Boolean; APosition: TdxTabContainerTabsPosition); override; + procedure DrawTabsPrevTabButton(ACanvas: TCanvas; ARect: TRect; + IsDown, IsHot, IsEnable: Boolean; APosition: TdxTabContainerTabsPosition); override; + procedure DrawTabsButtonSelection(ACanvas: TCanvas; ARect: TRect; + IsDown, IsHot, IsEnable: Boolean; APosition: TdxTabContainerTabsPosition); override; + // AutoHideContainer + function GetHideBarHeight: Integer; override; + function GetHideBarWidth: Integer; override; + + procedure DrawHideBar(ACanvas: TCanvas; ARect: TRect; APosition: TdxAutoHidePosition); override; + procedure DrawHideBarButton(ACanvas: TCanvas; AControl: TdxCustomDockControl; + ARect: TRect; APosition: TdxAutoHidePosition); override; + end; + +implementation + +uses Math, dxDockConsts, cxGraphics; + +{ TdxDockControlNETPainter } + +class procedure TdxDockControlNETPainter.AssignDefaultFont(AManager: TdxDockingManager); +begin + with AManager.Font do + begin + Charset := DEFAULT_CHARSET; + Color := clBlack; + Height := -11; + Name := 'Tahoma'; + Pitch := fpDefault; + Size := 8; + Style := []; + end; +end; + +function TdxDockControlNETPainter.GetNETBackColor: TColor; +var + r, g, b, m, d, md: Integer; +begin + Result := ColorToRGB(GetColor); + r := GetRValue(Result); + g := GetGValue(Result); + b := GetBValue(Result); + m := Max(Max(r, g), b); + d := $23; + md := (255 - (m + d)); + if md > 0 then md := 0; + Inc(r, d + md); + Inc(g, d + md); + Inc(b, d + md); + Result := RGB(r, g, b); +end; + +function TdxDockControlNETPainter.GetCaptionColor(IsActive: Boolean): TColor; +begin + if IsActive then + Result := clActiveCaption + else Result := GetColor; +end; + +function TdxDockControlNETPainter.GetCaptionFontColor(IsActive: Boolean): TColor; +begin + if IsActive then + Result := clCaptionText + else Result := clBlack; +end; + +function TdxDockControlNETPainter.GetTabsColor: TColor; +begin + Result := GetNETBackColor; +end; + +function TdxDockControlNETPainter.GetTabColor(IsActive: Boolean): TColor; +begin + if IsActive then + Result := GetColor + else Result := GetNETBackColor; +end; + +function TdxDockControlNETPainter.GetTabFontColor(IsActive: Boolean): TColor; +begin + if IsActive then + Result := GetFont.Color + else + begin + Result := GetFont.Color; + Result := LightColor(Result); + end; +end; + +function TdxDockControlNETPainter.GetTabsScrollButtonsSignColor(IsEnable: Boolean): TColor; +begin + Result := DarkColor(GetColor); +end; + +function TdxDockControlNETPainter.GetHideBarColor: TColor; +begin + Result := GetNETBackColor; +end; + +procedure TdxDockControlNETPainter.DrawBorder(ACanvas: TCanvas; ARect: TRect); +begin + ACanvas.Brush.Color := ColorToRGB(GetBorderColor); + ACanvas.Brush.Style := bsSolid; + with ARect do + begin + ACanvas.FillRect(Rect(Left, Top, Left + GetBorderWidth, Bottom)); + ACanvas.FillRect(Rect(Left, Bottom - GetBorderWidth, Right, Bottom)); + ACanvas.FillRect(Rect(Right - GetBorderWidth, Top, Left + Right, Bottom)); + ACanvas.FillRect(Rect(Left, Top, Right, Top + GetBorderWidth)); + end; + if DockControl.AutoHide then + begin + DrawColorEdge(ACanvas, ARect, GetColor, etSunkenInner, [epTopLeft]); + DrawColorEdge(ACanvas, ARect, GetColor, etRaisedInner, [epBottomRight]); + end; +end; + +procedure TdxDockControlNETPainter.DrawCaption(ACanvas: TCanvas; ARect: TRect; IsActive: Boolean); +begin + ACanvas.Brush.Style := bsSolid; + if IsActive then + begin + ACanvas.Pen.Color := ColorToRGB(GetCaptionColor(IsActive)); + ACanvas.Brush.Color := ColorToRGB(GetCaptionColor(IsActive)); + ACanvas.FillRect(ARect); + end + else + begin + ACanvas.Brush.Color := ColorToRGB(GetCaptionColor(IsActive)); + ACanvas.FillRect(ARect); + ACanvas.Brush.Style := bsClear; + ACanvas.Pen.Color := DarkColor(GetCaptionColor(IsActive)); + ACanvas.Pen.Style := psSolid; + ACanvas.Pen.Width := 1; + with ARect do + begin + ExcludeClipRect(ACanvas.Handle, Left, Top, Left + 1, Top + 1); + ExcludeClipRect(ACanvas.Handle, Right - 1, Top, Right, Top + 1); + ExcludeClipRect(ACanvas.Handle, Right - 1, Bottom - 1, Right, Bottom); + ExcludeClipRect(ACanvas.Handle, Left, Bottom - 1, Left + 1, Bottom); + ACanvas.Rectangle(Left, Top, Right, Bottom); + end; + end; +end; + +procedure TdxDockControlNETPainter.DrawCaptionButtonSelection(ACanvas: TCanvas; + ARect: TRect; IsActive, IsDown, IsHot: Boolean); +begin + if IsDown and IsHot then + begin + DrawColorEdge(ACanvas, ARect, GetCaptionColor(IsActive), etSunkenInner, [epTopLeft]); + DrawColorEdge(ACanvas, ARect, GetCaptionColor(IsActive), etSunkenOuter, [epBottomRight]); + end + else if IsHot then + begin + DrawColorEdge(ACanvas, ARect, GetCaptionColor(IsActive), etRaisedOuter, [epTopLeft]); + DrawColorEdge(ACanvas, ARect, GetCaptionColor(IsActive), etRaisedInner, [epBottomRight]); + end; +end; + +procedure TdxDockControlNETPainter.DrawCaptionCloseButton(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot, IsSwitched: Boolean); +begin + DrawCaptionButtonSelection(ACanvas, ARect, IsActive, IsDown, IsHot); + + ACanvas.Pen.Style := psSolid; + ACanvas.Pen.Width := 1; + ACanvas.Pen.Color := ColorToRGB(GetCaptionSignColor(IsActive, IsDown, IsHot)); + + ACanvas.MoveTo(ARect.Left + 3, ARect.Top + 3); + ACanvas.LineTo(ARect.Right - 3 + 1, ARect.Bottom - 3 + 1); + ACanvas.MoveTo(ARect.Right - 3, ARect.Top + 3); + ACanvas.LineTo(ARect.Left + 3 - 1, ARect.Bottom - 3 + 1); +end; + +procedure TdxDockControlNETPainter.DrawCaptionHideButton(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot, IsSwitched: Boolean); +begin + DrawCaptionButtonSelection(ACanvas, ARect, IsActive, IsDown, IsHot); + + ACanvas.Brush.Style := bsClear; + ACanvas.Pen.Style := psSolid; + ACanvas.Pen.Width := 1; + ACanvas.Pen.Color := ColorToRGB(GetCaptionSignColor(IsActive, IsDown, IsHot)); + if IsSwitched then + begin + ACanvas.Rectangle(ARect.Left + 3, ARect.Top + 3, ARect.Right - 2, ARect.Bottom - 4); + ACanvas.MoveTo(ARect.Left + 3, ARect.Top + 2); + ACanvas.LineTo(ARect.Left + 3, ARect.Bottom - 3); + ACanvas.MoveTo(ARect.Left + 3, ARect.Bottom - 6); + ACanvas.LineTo(ARect.Right - 3, ARect.Bottom - 6); + ACanvas.MoveTo(ARect.Left + 1, ARect.Top + 5); + ACanvas.LineTo(ARect.Left + 3, ARect.Top + 5); + end + else + begin + ACanvas.Rectangle(ARect.Left + 4, ARect.Top + 2, ARect.Right - 3, ARect.Bottom - 3); + ACanvas.MoveTo(ARect.Left + 3, ARect.Bottom - 4); + ACanvas.LineTo(ARect.Right - 2, ARect.Bottom - 4); + ACanvas.MoveTo(ARect.Right - 5, ARect.Top + 2); + ACanvas.LineTo(ARect.Right - 5, ARect.Bottom - 3); + ACanvas.MoveTo(ARect.Left + 6, ARect.Bottom - 3); + ACanvas.LineTo(ARect.Left + 6, ARect.Bottom - 1); + end; +end; + +procedure TdxDockControlNETPainter.DrawCaptionMaximizeButton(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot, IsSwitched: Boolean); +begin + DrawCaptionButtonSelection(ACanvas, ARect, IsActive, IsDown, IsHot); + + ACanvas.Brush.Style := bsClear; + ACanvas.Pen.Style := psSolid; + ACanvas.Pen.Width := (ARect.Right - ARect.Left) div 16 + 1; + ACanvas.Pen.Color := ColorToRGB(GetCaptionSignColor(IsActive, IsDown, IsHot)); + if IsSwitched then + begin + ACanvas.Rectangle(ARect.Left + 5, ARect.Top + 2, ARect.Right - 1, ARect.Bottom - 4); + ACanvas.Rectangle(ARect.Left + 2, ARect.Top + 5, ARect.Right - 4, ARect.Bottom - 1); + end + else ACanvas.Rectangle(ARect.Left + 3, ARect.Top + 3, ARect.Right - 2, ARect.Bottom - 2); +end; + +procedure TdxDockControlNETPainter.DrawCaptionText(ACanvas: TCanvas; ARect: TRect; IsActive: Boolean); +begin + ACanvas.Brush.Style := bsClear; + ACanvas.Font := GetFont; + ACanvas.Font.Color := ColorToRGB(GetCaptionFontColor(IsActive)); + cxDrawText(ACanvas.Handle, DockControl.Caption, ARect, + DT_SINGLELINE or DT_LEFT or DT_VCENTER or DT_END_ELLIPSIS); +end; + +procedure TdxDockControlNETPainter.DrawHideBar(ACanvas: TCanvas; ARect: TRect; + APosition: TdxAutoHidePosition); +begin + ACanvas.Brush.Style := bsSolid; + ACanvas.Brush.Color := GetHideBarColor; + ACanvas.FillRect(ARect); + ACanvas.Brush.Color := ColorToRGB(GetHideBarButtonColor); + case APosition of + ahpLeft: ARect.Right := ARect.Left + GetHideBarVertInterval; + ahpTop: ARect.Bottom := ARect.Top + GetHideBarVertInterval; + ahpRight: ARect.Left := ARect.Right - GetHideBarVertInterval; + ahpBottom: ARect.Top := ARect.Bottom - GetHideBarVertInterval; + end; + ACanvas.FillRect(ARect); + with ARect do ExcludeClipRect(ACanvas.Handle, Left, Top, Right, Bottom); +end; + +procedure TdxDockControlNETPainter.DrawHideBarButton(ACanvas: TCanvas; + AControl: TdxCustomDockControl; ARect: TRect; APosition: TdxAutoHidePosition); +const + Edges: array[TdxAutoHidePosition] of TdxEdgePositions = ([epTop, epBottomRight], + [epLeft, epBottomRight], [epTopLeft, epBottom], [epTopLeft, epRight], []); +begin + ACanvas.Brush.Style := bsSolid; + ACanvas.Brush.Color := ColorToRGB(GetHideBarButtonColor); + ACanvas.FillRect(ARect); + DrawColorEdge(ACanvas, ARect, GetHideBarButtonColor, etFlat, Edges[APosition]); + DrawHideBarButtonContent(ACanvas, AControl, ARect, APosition); +end; + +procedure TdxDockControlNETPainter.DrawTab(ACanvas: TCanvas; AControl: TdxCustomDockControl; + ARect: TRect; IsActive: Boolean; APosition: TdxTabContainerTabsPosition); +var + R: TRect; +begin + if IsActive then + begin + ACanvas.Brush.Style := bsSolid; + ACanvas.Brush.Color := ColorToRGB(GetColor); + ACanvas.FillRect(ARect); + if APosition = tctpTop then + DrawColorEdge(ACanvas, ARect, GetTabColor(IsActive), etRaisedOuter, [epTopLeft, epRight]) + else DrawColorEdge(ACanvas, ARect, GetTabColor(IsActive), etRaisedOuter, [epLeft, epBottomRight]); + end + else + begin + R := ARect; + InflateRect(R, 1, -3); + DrawColorEdge(ACanvas, R, GetTabColor(IsActive), etRaisedInner, [epRight]); + end; + DrawTabContent(ACanvas, AControl, ARect, IsActive, APosition); +end; + +procedure TdxDockControlNETPainter.DrawTabs(ACanvas: TCanvas; ARect, AActiveTabRect: TRect; + APosition: TdxTabContainerTabsPosition); +var + R: TRect; +begin + ACanvas.Brush.Style := bsSolid; + ACanvas.Brush.Color := ColorToRGB(GetTabsColor); + ACanvas.FillRect(ARect); + + R := ARect; + if APosition = tctpTop then + begin + R.Bottom := AActiveTabRect.Bottom; + DrawColorEdge(ACanvas, R, GetTabColor(True), etSunkenOuter, [epBottom]); + end + else + begin + R.Top := AActiveTabRect.Top; + DrawColorEdge(ACanvas, R, GetTabColor(True), etSunkenOuter, [epTop]); + end; + + if APosition = tctpTop then + ARect.Top := AActiveTabRect.Bottom + else ARect.Bottom := AActiveTabRect.Top; + ACanvas.Brush.Color := ColorToRGB(GetTabColor(True)); + ACanvas.FillRect(ARect); +end; + +procedure TdxDockControlNETPainter.DrawTabsNextTabButton(ACanvas: TCanvas; + ARect: TRect; IsDown, IsHot, IsEnable: Boolean; APosition: TdxTabContainerTabsPosition); +var + pts: array[0..2] of TPoint; +begin + DrawTabsButtonSelection(ACanvas, ARect, IsDown, IsHot, IsEnable, APosition); + + ACanvas.Pen.Style := psSolid; + ACanvas.Pen.Width := 1; + ACanvas.Pen.Color := GetTabsScrollButtonsSignColor(IsEnable); + if IsEnable then + begin + ACanvas.Brush.Style := bsSolid; + ACanvas.Brush.Color := GetTabsScrollButtonsSignColor(IsEnable); + end + else ACanvas.Brush.Style := bsClear; + + InflateRect(ARect, -1, -1); + pts[0] := Point(ARect.Left + 4, ARect.Top + 2); + pts[1] := Point(ARect.Left + 4, ARect.Bottom - 4); + pts[2] := Point(ARect.Right - 6, ARect.Top + 6); + ACanvas.Polygon(pts); +end; + +procedure TdxDockControlNETPainter.DrawTabsPrevTabButton(ACanvas: TCanvas; + ARect: TRect; IsDown, IsHot, IsEnable: Boolean; APosition: TdxTabContainerTabsPosition); +var + pts: array[0..2] of TPoint; +begin + DrawTabsButtonSelection(ACanvas, ARect, IsDown, IsHot, IsEnable, APosition); + + ACanvas.Pen.Style := psSolid; + ACanvas.Pen.Width := 1; + ACanvas.Pen.Color := GetTabsScrollButtonsSignColor(IsEnable); + if IsEnable then + begin + ACanvas.Brush.Style := bsSolid; + ACanvas.Brush.Color := GetTabsScrollButtonsSignColor(IsEnable); + end + else ACanvas.Brush.Style := bsClear; + + InflateRect(ARect, -1, -1); + pts[0] := Point(ARect.Right - 6, ARect.Top + 2); + pts[1] := Point(ARect.Right - 6, ARect.Bottom - 4); + pts[2] := Point(ARect.Left + 4, ARect.Top + 6); + ACanvas.Polygon(pts); +end; + +procedure TdxDockControlNETPainter.DrawTabsButtonSelection(ACanvas: TCanvas; ARect: TRect; + IsDown, IsHot, IsEnable: Boolean; APosition: TdxTabContainerTabsPosition); +begin + if IsDown and IsHot and IsEnable then + begin + DrawColorEdge(ACanvas, ARect, GetTabsScrollButtonsColor, etSunkenOuter, [epTopLeft]); + DrawColorEdge(ACanvas, ARect, GetTabsScrollButtonsColor, etSunkenOuter, [epBottomRight]); + end + else if IsHot and IsEnable then + begin + DrawColorEdge(ACanvas, ARect, GetTabsScrollButtonsColor, etRaisedOuter, [epTopLeft]); + DrawColorEdge(ACanvas, ARect, GetTabsScrollButtonsColor, etRaisedOuter, [epBottomRight]); + end; +end; + +function TdxDockControlNETPainter.CanVerticalCaption: Boolean; +begin + Result := False; +end; + +function TdxDockControlNETPainter.GetCaptionHeight: Integer; +begin + Result := 5 + GetFont.Size + 5; +end; + +function TdxDockControlNETPainter.GetCaptionVertInterval: Integer; +begin + Result := 4; +end; + +function TdxDockControlNETPainter.GetTabsHeight: Integer; +begin + Result := 8 + GetFont.Size + 8; + if Result < 2 * GetTabVertInterval + 2 + GetImageHeight + 2 + 2 * GetTabVertInterval then + Result := 2 * GetTabVertInterval + 2 + GetImageHeight + 2 + 2 * GetTabVertInterval; +end; + +function TdxDockControlNETPainter.GetTabVertInterval: Integer; +begin + Result := 1; +end; + +function TdxDockControlNETPainter.GetHideBarHeight: Integer; +begin + Result := 8 + GetFont.Size + 8; + if Result < GetHideBarVertInterval + 2 + GetImageHeight + 2 + GetHideBarVertInterval then + Result := GetHideBarVertInterval + 2 + GetImageHeight + 2 + GetHideBarVertInterval; +end; + +function TdxDockControlNETPainter.GetHideBarWidth: Integer; +begin + Result := 8 + GetFont.Size + 8; + if Result < GetHideBarVertInterval + 2 + GetImageWidth + 2 + GetHideBarVertInterval then + Result := GetHideBarVertInterval + 2 + GetImageWidth + 2 + GetHideBarVertInterval; +end; + +end. diff --git a/official/x.35/ExpressDocking Library/Sources/dxDockControlOfficeView.pas b/official/x.35/ExpressDocking Library/Sources/dxDockControlOfficeView.pas new file mode 100644 index 00000000..16da8cd1 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Sources/dxDockControlOfficeView.pas @@ -0,0 +1,351 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDocking } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDOCKING AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxDockControlOfficeView; + +{$I cxVer.inc} + +interface + +uses + Menus, Windows, Graphics, Classes, Controls, ExtCtrls, Messages, Forms, + dxDockControl, dxDockControlNETView; + +type + TdxDockControlOfficePainter = class(TdxDockControlNETPainter) + protected + class procedure CreateColors; override; + class procedure RefreshColors; override; + class procedure ReleaseColors; override; + + function GetBorderColor: TColor; override; + function GetCaptionColor(IsActive: Boolean): TColor; override; + function GetCaptionFontColor(IsActive: Boolean): TColor; override; + function GetCaptionSignColor(IsActive, IsDown, IsHot: Boolean): TColor; override; + function GetTabFontColor(IsActive: Boolean): TColor; override; + function GetTabsScrollButtonsColor: TColor; override; + function GetTabsScrollButtonsSignColor(IsEnable: Boolean): TColor; override; + + function NeedRedrawOnResize: Boolean; override; + public + // CustomDockControl + procedure DrawBorder(ACanvas: TCanvas; ARect: TRect); override; + procedure DrawCaptionButtonSelection(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot: Boolean); override; + procedure DrawCaptionMaximizeButton(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot, IsSwitched: Boolean); override; + procedure DrawClient(ACanvas: TCanvas; ARect: TRect); override; + // TabContainer + procedure DrawTabs(ACanvas: TCanvas; ARect, AActiveTabRect: TRect; + APosition: TdxTabContainerTabsPosition); override; + procedure DrawTab(ACanvas: TCanvas; AControl: TdxCustomDockControl; + ARect: TRect; IsActive: Boolean; APosition: TdxTabContainerTabsPosition); override; + // AutoHideContainer + procedure DrawHideBar(ACanvas: TCanvas; ARect: TRect; APosition: TdxAutoHidePosition); override; + procedure DrawHideBarButton(ACanvas: TCanvas; AControl: TdxCustomDockControl; + ARect: TRect; APosition: TdxAutoHidePosition); override; + end; + +implementation + +uses + dxDockConsts, dxOffice11; + +{ TdxDockControlOfficePainter } + +class procedure TdxDockControlOfficePainter.CreateColors; +begin +// CreateOffice11Colors; +// is calling indirectly in cxLookAndFeels +end; + +class procedure TdxDockControlOfficePainter.RefreshColors; +begin + RefreshOffice11Colors; +end; + +class procedure TdxDockControlOfficePainter.ReleaseColors; +begin +// ReleaseOffice11Colors; +// is calling indirectly in cxLookAndFeels +end; + +function TdxDockControlOfficePainter.GetBorderColor: TColor; +begin + Result := dxOffice11BarFloatingBorderColor2; +end; + +function TdxDockControlOfficePainter.GetCaptionColor(IsActive: Boolean): TColor; +begin + if IsActive then + Result := dxOffice11BarFloatingCaptionColor + else Result := dxOffice11BarFloatingBorderColor2; +end; + +function TdxDockControlOfficePainter.GetCaptionFontColor(IsActive: Boolean): TColor; +begin + if IsActive then + Result := dxOffice11BarFloatingCaptionTextColor1 + else Result := dxOffice11BarFloatingCaptionTextColor2; +end; + +function TdxDockControlOfficePainter.GetCaptionSignColor(IsActive, IsDown, IsHot: Boolean): TColor; +begin + Result := GetCaptionFontColor(IsActive and not (IsDown and IsHot) and not IsHot); +end; + +function TdxDockControlOfficePainter.GetTabFontColor(IsActive: Boolean): TColor; +begin + Result := GetFont.Color; +end; + +function TdxDockControlOfficePainter.GetTabsScrollButtonsColor: TColor; +begin + Result := dxOffice11ToolbarsColor2; +end; + +function TdxDockControlOfficePainter.GetTabsScrollButtonsSignColor(IsEnable: Boolean): TColor; +begin + Result := DarkColor(dxOffice11ToolbarsColor2); +end; + +function TdxDockControlOfficePainter.NeedRedrawOnResize: Boolean; +begin + Result := True; +end; + +procedure TdxDockControlOfficePainter.DrawBorder(ACanvas: TCanvas; ARect: TRect); +begin + ACanvas.Brush.Style := bsSolid; + with ARect do + begin + ACanvas.Brush.Color := dxOffice11BarFloatingBorderColor2; + ACanvas.FillRect(Rect(Left, Top, Right, Top + GetBorderWidth)); + ACanvas.Brush.Color := dxOffice11BarFloatingBorderColor1; + ACanvas.FillRect(Rect(Left, Bottom - GetBorderWidth, Right, Bottom)); + FillGradientRect(ACanvas.Handle, Rect(Left, Top, Left + GetBorderWidth, Bottom), + dxOffice11BarFloatingBorderColor2, dxOffice11BarFloatingBorderColor1, False); + FillGradientRect(ACanvas.Handle, Rect(Right - GetBorderWidth, Top, Left + Right, Bottom), + dxOffice11BarFloatingBorderColor2, dxOffice11BarFloatingBorderColor1, False); + end; + if DockControl.AutoHide then + DrawColorEdge(ACanvas, ARect, dxOffice11BarFloatingBorderColor1, etStandard, [epRect]); +end; + +procedure TdxDockControlOfficePainter.DrawCaptionButtonSelection( + ACanvas: TCanvas; ARect: TRect; IsActive, IsDown, IsHot: Boolean); +begin + if IsDown and IsHot then + FillGradientRect(ACanvas.Handle, ARect, dxOffice11SelectedDownColor1, dxOffice11SelectedDownColor2, False) + else if IsHot then + FillGradientRect(ACanvas.Handle, ARect, dxOffice11SelectedColor1, dxOffice11SelectedColor2, False); + if (IsDown and IsHot) or IsHot then + Office11FrameSelectedRect(ACanvas.Handle, ARect); +end; + +procedure TdxDockControlOfficePainter.DrawCaptionMaximizeButton(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot, IsSwitched: Boolean); +var + pts: array[0..2] of TPoint; +begin + DrawCaptionButtonSelection(ACanvas, ARect, IsActive, IsDown, IsHot); + + if IsDown and IsHot then OffsetRect(ARect, 1, 1); + ACanvas.Pen.Style := psSolid; + ACanvas.Pen.Width := 1; + ACanvas.Pen.Color := ColorToRGB(GetCaptionSignColor(IsActive, IsDown, IsHot)); + ACanvas.Brush.Style := bsSolid; + ACanvas.Brush.Color := ColorToRGB(GetCaptionSignColor(IsActive, IsDown, IsHot)); + if DockControl.SideContainer is TdxVertContainerDockSite then + if IsSwitched then + begin + pts[0] := Point(ARect.Right - 4, ARect.Top + 2); + pts[1] := Point(ARect.Left + 2, ARect.Top + 2); + end + else + begin + pts[0] := Point(ARect.Right - 4, ARect.Bottom - 4); + pts[1] := Point(ARect.Left + 2, ARect.Bottom - 4); + end + else + if IsSwitched then + begin + pts[0] := Point(ARect.Left + 2, ARect.Top + 2); + pts[1] := Point(ARect.Left + 2, ARect.Bottom - 4); + end + else + begin + pts[0] := Point(ARect.Right - 4, ARect.Top + 2); + pts[1] := Point(ARect.Right - 4, ARect.Bottom - 4); + end; + pts[2] := Point(ARect.Left + 5, ARect.Top + 5); + ACanvas.Polygon(pts); +end; + +procedure TdxDockControlOfficePainter.DrawClient(ACanvas: TCanvas; ARect: TRect); +begin + FillGradientRect(ACanvas.Handle, ARect, dxOffice11ToolbarsColor1, dxOffice11ToolbarsColor2, False); +end; + +procedure TdxDockControlOfficePainter.DrawTabs(ACanvas: TCanvas; ARect, + AActiveTabRect: TRect; APosition: TdxTabContainerTabsPosition); +var + R: TRect; + ABorders: TdxEdgePositions; +begin + FillGradientRect(ACanvas.Handle, ARect, dxOffice11ToolbarsColor1, dxOffice11ToolbarsColor2, False); + + R := ARect; + if APosition = tctpTop then + begin + R.Bottom := AActiveTabRect.Bottom; + ABorders := [epBottom]; + end + else + begin + R.Top := AActiveTabRect.Top; + ABorders := [epTop]; + end; + DrawColorEdge(ACanvas, R, dxOffice11SelectedBorderColor, etStandard, ABorders); + + if APosition = tctpTop then + begin + ARect.Top := AActiveTabRect.Bottom; + ACanvas.Brush.Color := dxOffice11SelectedColor2; + end + else + begin + ARect.Bottom := AActiveTabRect.Top; + ACanvas.Brush.Color := dxOffice11SelectedColor1; + end; + ACanvas.FillRect(ARect); +end; + +procedure TdxDockControlOfficePainter.DrawTab(ACanvas: TCanvas; AControl: TdxCustomDockControl; + ARect: TRect; IsActive: Boolean; APosition: TdxTabContainerTabsPosition); +const + TabBorders: array[TdxTabContainerTabsPosition] of TdxEdgePositions = + ([epTopLeft, epRight], [epLeft, epBottomRight]); +var + R: TRect; +begin + if IsActive then + begin + FillGradientRect(ACanvas.Handle, ARect, dxOffice11SelectedColor1, dxOffice11SelectedColor2, False); + DrawColorEdge(ACanvas, ARect, dxOffice11SelectedBorderColor, etStandard, TabBorders[APosition]); + end + else + begin + R := ARect; + InflateRect(R, 1, -3); + DrawColorEdge(ACanvas, R, dxOffice11BarSeparatorColor1, etStandard, [epRight]); + OffsetRect(R, 1, 1); + DrawColorEdge(ACanvas, R, dxOffice11BarSeparatorColor2, etStandard, [epRight]); + end; + DrawTabContent(ACanvas, AControl, ARect, IsActive, APosition); +end; + +procedure TdxDockControlOfficePainter.DrawHideBar(ACanvas: TCanvas; + ARect: TRect; APosition: TdxAutoHidePosition); +begin + case APosition of + ahpLeft: begin + FillGradientRect(ACanvas.Handle, ARect, dxOffice11ToolbarsColor2, dxOffice11ToolbarsColor2, True); + ARect.Right := ARect.Left + GetHideBarVertInterval; + FillGradientRect(ACanvas.Handle, ARect, dxOffice11DockColor1, dxOffice11DockColor1, True); + end; + ahpTop: begin + FillGradientRect(ACanvas.Handle, ARect, dxOffice11ToolbarsColor2, dxOffice11ToolbarsColor1, True); + ARect.Bottom := ARect.Top + GetHideBarVertInterval; + FillGradientRect(ACanvas.Handle, ARect, dxOffice11DockColor1, dxOffice11DockColor2, True); + end; + ahpRight: begin + FillGradientRect(ACanvas.Handle, ARect, dxOffice11ToolbarsColor1, dxOffice11ToolbarsColor1, True); + ARect.Left := ARect.Right - GetHideBarVertInterval; + FillGradientRect(ACanvas.Handle, ARect, dxOffice11DockColor2, dxOffice11DockColor2, True); + end; + ahpBottom: begin + FillGradientRect(ACanvas.Handle, ARect, dxOffice11ToolbarsColor2, dxOffice11ToolbarsColor1, True); + ARect.Top := ARect.Bottom - GetHideBarVertInterval; + FillGradientRect(ACanvas.Handle, ARect, dxOffice11DockColor1, dxOffice11DockColor2, True); + end; + end; + with ARect do ExcludeClipRect(ACanvas.Handle, Left, Top, Right, Bottom); +end; + +type + TdxTabContainerDockSiteAccess = class(TdxTabContainerDockSite); + +procedure TdxDockControlOfficePainter.DrawHideBarButton(ACanvas: TCanvas; + AControl: TdxCustomDockControl; ARect: TRect; APosition: TdxAutoHidePosition); +const + Edges: array[TdxAutoHidePosition] of TdxEdgePositions = ([epTop, epBottomRight], + [epLeft, epBottomRight], [epTopLeft, epBottom], [epTopLeft, epRight], []); +var + I: Integer; + R: TRect; +begin + R := ARect; + if AControl is TdxTabContainerDockSite then + begin + for I := 0 to TdxTabContainerDockSiteAccess(AControl).ActiveChildIndex - 1 do + begin + if not TdxTabContainerDockSiteAccess(AControl).IsValidChild(AControl.Children[I]) then continue; + if not (APosition in [ahpLeft, ahpRight]) then + R.Left := R.Left + (GetDefaultImageWidth + 2 * GetHideBarHorizInterval) + else R.Top := R.Top + (GetDefaultImageHeight + 2 * GetHideBarHorizInterval); + end; + for I := AControl.ChildCount - 1 downto TdxTabContainerDockSiteAccess(AControl).ActiveChildIndex + 1 do + begin + if not TdxTabContainerDockSiteAccess(AControl).IsValidChild(AControl.Children[I]) then continue; + if not (APosition in [ahpLeft, ahpRight]) then + R.Right := R.Right - (GetDefaultImageWidth + 2 * GetHideBarHorizInterval) + else R.Bottom := R.Bottom - (GetDefaultImageHeight + 2 * GetHideBarHorizInterval); + end; + end; + case APosition of + ahpLeft: + FillGradientRect(ACanvas.Handle, R, dxOffice11DownedSelectedColor, dxOffice11DownedColor, True); + ahpTop: + FillGradientRect(ACanvas.Handle, R, dxOffice11DownedSelectedColor, dxOffice11DownedColor, False); + ahpRight: + FillGradientRect(ACanvas.Handle, R, dxOffice11DownedColor, dxOffice11DownedSelectedColor, True); + ahpBottom: + FillGradientRect(ACanvas.Handle, R, dxOffice11DownedColor, dxOffice11DownedSelectedColor, False); + end; + DrawColorEdge(ACanvas, ARect, dxOffice11SelectedBorderColor, etStandard, Edges[APosition]); + DrawHideBarButtonContent(ACanvas, AControl, ARect, APosition); +end; + +end. diff --git a/official/x.35/ExpressDocking Library/Sources/dxDockControlXPView.pas b/official/x.35/ExpressDocking Library/Sources/dxDockControlXPView.pas new file mode 100644 index 00000000..a5445bbd --- /dev/null +++ b/official/x.35/ExpressDocking Library/Sources/dxDockControlXPView.pas @@ -0,0 +1,471 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDocking } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDOCKING AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxDockControlXPView; + +{$I cxVer.inc} + +interface + +uses + Menus, Windows, Graphics, Classes, Controls, ExtCtrls, Messages, Forms, + dxDockControl; + +type + TdxDockControlXPPainter = class(TdxDockControlPainter) + protected + function NeedRedrawOnResize: Boolean; override; + public + // CustomDockControl + function CanVerticalCaption: Boolean; override; + function GetCaptionButtonSize: Integer; override; + function GetCaptionHeight: Integer; override; + + procedure DrawBorder(ACanvas: TCanvas; ARect: TRect); override; + procedure DrawCaption(ACanvas: TCanvas; ARect: TRect; IsActive: Boolean); override; + procedure DrawCaptionSeparator(ACanvas: TCanvas; ARect: TRect); override; + procedure DrawCaptionText(ACanvas: TCanvas; ARect: TRect; IsActive: Boolean); override; + procedure DrawCaptionCloseButton(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot, IsSwitched: Boolean); override; + procedure DrawCaptionHideButton(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot, IsSwitched: Boolean); override; + procedure DrawCaptionMaximizeButton(ACanvas: TCanvas; ARect: TRect; + IsActive, IsDown, IsHot, IsSwitched: Boolean); override; + procedure DrawClient(ACanvas: TCanvas; ARect: TRect); override; + // TabContainer + procedure DrawTabs(ACanvas: TCanvas; ARect, AActiveTabRect: TRect; + APosition: TdxTabContainerTabsPosition); override; + procedure DrawTab(ACanvas: TCanvas; AControl: TdxCustomDockControl; + ARect: TRect; IsActive: Boolean; APosition: TdxTabContainerTabsPosition); override; + procedure DrawTabsNextTabButton(ACanvas: TCanvas; ARect: TRect; + IsDown, IsHot, IsEnable: Boolean; APosition: TdxTabContainerTabsPosition); override; + procedure DrawTabsPrevTabButton(ACanvas: TCanvas; ARect: TRect; + IsDown, IsHot, IsEnable: Boolean; APosition: TdxTabContainerTabsPosition); override; + // AutoHideContainer + procedure DrawHideBar(ACanvas: TCanvas; ARect: TRect; APosition: TdxAutoHidePosition); override; + procedure DrawHideBarButton(ACanvas: TCanvas; AControl: TdxCustomDockControl; + ARect: TRect; APosition: TdxAutoHidePosition); override; + end; + +implementation + +uses + dxUxTheme, dxThemeManager, dxThemeConsts, dxDockConsts, cxGraphics, cxGeometry; + +function TdxDockControlXPPainter.CanVerticalCaption: Boolean; +begin + if OpenTheme(totTab) <> 0 then Result := False + else Result := inherited CanVerticalCaption; +end; + +function TdxDockControlXPPainter.GetCaptionButtonSize: Integer; +begin + if OpenTheme(totTab) <> 0 then Result := 14 + else Result := inherited GetCaptionButtonSize; +end; + +function TdxDockControlXPPainter.GetCaptionHeight: Integer; +begin + if OpenTheme(totTab) <> 0 then + begin + Result := 7 + GetFont.Size + 7; + if Result < 2 + GetImageHeight + 2 then + Result := 2 + GetImageHeight + 2; + end + else Result := inherited GetCaptionHeight; +end; + +procedure TdxDockControlXPPainter.DrawBorder(ACanvas: TCanvas; + ARect: TRect); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totToolBar); + if ATheme <> 0 then + begin + if IsThemeBackgroundPartiallyTransparent(ATheme, TP_BUTTON, TS_HOT) then + cxDrawTransparentControlBackground(DockControl, ACanvas, ARect); + DrawThemeBackground(ATheme, ACanvas.Handle, TP_BUTTON, TS_HOT, ARect); + end + else inherited; +end; + +procedure TdxDockControlXPPainter.DrawCaption(ACanvas: TCanvas; ARect: TRect; IsActive: Boolean); +var + ATheme: TdxTheme; + AClipRgn: HRGN; + AClipRgnExists: Boolean; +begin + ATheme := OpenTheme(totTab); + if ATheme <> 0 then + begin + if IsActive then + begin + AClipRgn := CreateRectRgn(0, 0, 0, 0); + try + AClipRgnExists := GetClipRgn(ACanvas.Handle, AClipRgn) = 1; + with ARect do + begin + ExcludeClipRect(ACanvas.Handle, Left, Top, Left + 2, Top + 2); + ExcludeClipRect(ACanvas.Handle, Right - 2, Top, Right, Top + 2); + ExcludeClipRect(ACanvas.Handle, Right - 2, Bottom - 2, Right, Bottom); + ExcludeClipRect(ACanvas.Handle, Left, Bottom - 2, Left + 2, Bottom); + end; + DrawThemeBackground(OpenTheme(totExplorerBar), ACanvas.Handle, EBP_NORMALGROUPBACKGROUND, 0, ARect); + if AClipRgnExists then + SelectClipRgn(ACanvas.Handle, AClipRgn) + else + SelectClipRgn(ACanvas.Handle, 0); + finally + DeleteObject(AClipRgn); + end; + end + else + DrawThemeBackground(ATheme, ACanvas.Handle, TABP_BODY, 0, ARect); + DrawThemeBackground(OpenTheme(totButton), ACanvas.Handle, BP_GROUPBOX, 0, ARect); + end + else + inherited; +end; + +procedure TdxDockControlXPPainter.DrawCaptionSeparator(ACanvas: TCanvas; ARect: TRect); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totTab); + if ATheme <> 0 then + DrawThemeBackground(ATheme, ACanvas.Handle, TABP_BODY, 0, ARect) + else + inherited; +end; + +procedure TdxDockControlXPPainter.DrawCaptionCloseButton(ACanvas: TCanvas; + ARect: TRect; IsActive, IsDown, IsHot, IsSwitched: Boolean); +var + ATheme: TdxTheme; + AState: Integer; +begin + ATheme := OpenTheme(totWindow); + if ATheme <> 0 then + begin + if IsDown and IsHot then + AState := CBS_PUSHED + else if IsHot then + AState := CBS_HOT + else AState := CBS_NORMAL; + DrawThemeBackground(ATheme, ACanvas.Handle, WP_SMALLCLOSEBUTTON, AState, ARect) + end + else inherited; +end; + +procedure TdxDockControlXPPainter.DrawCaptionHideButton(ACanvas: TCanvas; + ARect: TRect; IsActive, IsDown, IsHot, IsSwitched: Boolean); +var + R, R1: TRect; + ABitmap, ARotatedBitmap: TBitmap; + ATheme: TdxTheme; + AState: Integer; +begin + ATheme := OpenTheme(totExplorerBar); + if ATheme <> 0 then + begin + if IsDown and IsHot then + AState := EBHP_PRESSED + else if IsHot then + AState := EBHP_HOT + else AState := EBHP_NORMAL; + ABitmap := TBitmap.Create; + try + ABitmap.PixelFormat := pf32bit; + R := Rect(0, 0, 16, 16); + ABitmap.Width := R.Right - R.Left; + ABitmap.Height := R.Bottom - R.Top; + R1 := R; + InflateRect(R1, 2, 2); + DrawThemeBackground(ATheme, ABitmap.Canvas.Handle, EBP_HEADERPIN, AState, R); + if not IsSwitched then RotateBitmap(ABitmap, raPlus90); + ARotatedBitmap := TBitmap.Create; + try + ARotatedBitmap.Width := ARect.Right - ARect.Left - 2; + ARotatedBitmap.Height := ARect.Bottom - ARect.Top - 2; + StretchBlt(ARotatedBitmap.Canvas.Handle, 0, 0, ARotatedBitmap.Width, ARotatedBitmap.Height, + ABitmap.Canvas.Handle, 0, 0, ABitmap.Width, ABitmap.Height, SRCCOPY); + ARotatedBitmap.PixelFormat := pf24bit; + ARotatedBitmap.Transparent := True; + ARotatedBitmap.TransparentColor := ARotatedBitmap.Canvas.Pixels[0, 0]; + ACanvas.Draw(ARect.Left + 1, ARect.Top + 1, ARotatedBitmap); + finally + ARotatedBitmap.Free + end; + finally + ABitmap.Free; + end; + end + else inherited; +end; + +procedure TdxDockControlXPPainter.DrawCaptionMaximizeButton(ACanvas: TCanvas; + ARect: TRect; IsActive, IsDown, IsHot, IsSwitched: Boolean); +var + ATheme: TdxTheme; + APart, AState: Integer; +begin + ATheme := OpenTheme(totWindow); + if ATheme <> 0 then + begin + if IsSwitched then + begin + APart := WP_RESTOREBUTTON; + if IsDown and IsHot then + AState := RBS_PUSHED + else if IsHot then + AState := RBS_HOT + else AState := RBS_NORMAL; + end + else + begin + APart := WP_MAXBUTTON; + if IsDown and IsHot then + AState := MAXBS_PUSHED + else if IsHot then + AState := MAXBS_HOT + else AState := MAXBS_NORMAL; + end; + DrawThemeBackground(ATheme, ACanvas.Handle, APart, AState, ARect) + end + else inherited; +end; + +procedure TdxDockControlXPPainter.DrawClient(ACanvas: TCanvas; ARect: TRect); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totTab); + if ATheme <> 0 then + DrawThemeBackground(ATheme, ACanvas.Handle, TABP_BODY, 0, ARect) + else inherited; +end; + +procedure TdxDockControlXPPainter.DrawCaptionText(ACanvas: TCanvas; + ARect: TRect; IsActive: Boolean); +var + R: TRect; +begin + if OpenTheme(totTab) <> 0 then + begin + if IsValidImageIndex(DockControl.ImageIndex) then + begin + R.Left := ARect.Left + 2 * GetCaptionHorizInterval; + R.Top := ARect.Top + (ARect.Bottom - ARect.Top - GetImageHeight) div 2; + R.Right := R.Left + GetImageWidth; + R.Bottom := R.Top + GetImageHeight; + if RectInRect(R, ARect) then + begin + DrawImage(ACanvas, DockControl.Images, DockControl.ImageIndex, R); + ARect.Left := R.Right + 2 * GetCaptionHorizInterval; + end; + end; + + ACanvas.Brush.Style := bsClear; + ACanvas.Font := GetFont; + ACanvas.Font.Color := GetCaptionFontColor(IsActive); + cxDrawText(ACanvas.Handle, DockControl.Caption, ARect, + DT_SINGLELINE or DT_LEFT or DT_VCENTER or DT_END_ELLIPSIS); + end + else inherited; +end; + +procedure TdxDockControlXPPainter.DrawHideBar(ACanvas: TCanvas; ARect: TRect; + APosition: TdxAutoHidePosition); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totTab); + if ATheme <> 0 then + DrawThemeBackground(ATheme, ACanvas.Handle, TABP_BODY, 0, ARect) + else inherited; +end; + +procedure TdxDockControlXPPainter.DrawHideBarButton(ACanvas: TCanvas; + AControl: TdxCustomDockControl; ARect: TRect; APosition: TdxAutoHidePosition); +var + R: TRect; + ABitmap: TBitmap; + ATheme: TdxTheme; + Temp: Integer; +begin + ATheme := OpenTheme(totTab); + if ATheme <> 0 then + begin + ABitmap := TBitmap.Create; + try + ABitmap.PixelFormat := pf32bit; + R := ARect; + OffsetRect(R, -R.Left, -R.Top); + if APosition in [ahpLeft, ahpRight] then + begin + Temp := R.Right; + R.Right := R.Left + (R.Bottom - R.Top); + R.Bottom := R.Top + (Temp - R.Left); + end; + ABitmap.Width := R.Right - R.Left; + ABitmap.Height := R.Bottom - R.Top; + DrawThemeBackground(ATheme, ABitmap.Canvas.Handle, TABP_TOPTABITEM, TTIS_NORMAL, R); + case APosition of + ahpTop: RotateBitmap(ABitmap, ra180); + ahpLeft: RotateBitmap(ABitmap, raMinus90); + ahpRight: RotateBitmap(ABitmap, raPlus90); + end; + cxBitBlt(ACanvas.Handle, ABitmap.Canvas.Handle, ARect, cxNullPoint, SRCCOPY); + finally + ABitmap.Free; + end; + DrawHideBarButtonContent(ACanvas, AControl, ARect, APosition); + end + else inherited; +end; + +procedure TdxDockControlXPPainter.DrawTab(ACanvas: TCanvas; AControl: TdxCustomDockControl; + ARect: TRect; IsActive: Boolean; APosition: TdxTabContainerTabsPosition); +var + R, R1: TRect; + ABitmap: TBitmap; + ATheme: TdxTheme; + AState: Integer; +begin + ATheme := OpenTheme(totTab); + if ATheme <> 0 then + begin + if IsActive then + AState := TTIS_SELECTED + else AState := TTIS_NORMAL; + ABitmap := TBitmap.Create; + try + ABitmap.PixelFormat := pf32bit; + R1 := ARect; + if not IsActive then + if APosition = tctpTop then + Dec(ARect.Bottom, 2) + else Inc(ARect.Top, 2); + R := ARect; + ABitmap.Width := R.Right - R.Left; + ABitmap.Height := R.Bottom - R.Top; + OffsetRect(R, -R.Left, -R.Top); + DrawThemeBackground(ATheme, ABitmap.Canvas.Handle, TABP_TOPTABITEM, AState, R); + if APosition = tctpBottom then + RotateBitmap(ABitmap, ra180); + cxBitBlt(ACanvas.Handle, ABitmap.Canvas.Handle, ARect, cxNullPoint, SRCCOPY); + finally + ABitmap.Free; + ARect := R1; + end; + + DrawTabContent(ACanvas, AControl, ARect, IsActive, APosition); + end + else inherited; +end; + +procedure TdxDockControlXPPainter.DrawTabs(ACanvas: TCanvas; ARect, AActiveTabRect: TRect; + APosition: TdxTabContainerTabsPosition); +var + R: TRect; + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totTab); + if ATheme <> 0 then + begin + DrawThemeBackground(ATheme, ACanvas.Handle, TABP_BODY, 0, ARect); + + R := ARect; + Inc(R.Right, 2); + if APosition = tctpTop then + R.Top := AActiveTabRect.Bottom - 2 + else R.Bottom := AActiveTabRect.Top + 4; + DrawThemeBackground(ATheme, ACanvas.Handle, TABP_PANE, 0, R); + if APosition = tctpTop then + R.Top := AActiveTabRect.Bottom + 1 + else R.Bottom := AActiveTabRect.Top - 1; + DrawThemeBackground(ATheme, ACanvas.Handle, TABP_BODY, 0, R); + end + else inherited; +end; + +procedure TdxDockControlXPPainter.DrawTabsNextTabButton(ACanvas: TCanvas; + ARect: TRect; IsDown, IsHot, IsEnable: Boolean; APosition: TdxTabContainerTabsPosition); +var + ATheme: TdxTheme; + AState: Integer; +begin + ATheme := OpenTheme(totScrollBar); + if ATheme <> 0 then + begin + if not IsEnable then + AState := ABS_RIGHTDISABLED + else if IsDown and IsHot then + AState := ABS_RIGHTPRESSED + else if IsHot then + AState := ABS_RIGHTHOT + else AState := ABS_RIGHTNORMAL; + DrawThemeBackground(ATheme, ACanvas.Handle, SBP_ARROWBTN, AState, ARect); + end + else inherited; +end; + +procedure TdxDockControlXPPainter.DrawTabsPrevTabButton(ACanvas: TCanvas; + ARect: TRect; IsDown, IsHot, IsEnable: Boolean; APosition: TdxTabContainerTabsPosition); +var + ATheme: TdxTheme; + AState: Integer; +begin + ATheme := OpenTheme(totScrollBar); + if ATheme <> 0 then + begin + if not IsEnable then + AState := ABS_LEFTDISABLED + else if IsDown and IsHot then + AState := ABS_LEFTPRESSED + else if IsHot then + AState := ABS_LEFTHOT + else AState := ABS_LEFTNORMAL; + DrawThemeBackground(ATheme, ACanvas.Handle, SBP_ARROWBTN, AState, ARect); + end + else inherited; +end; + +function TdxDockControlXPPainter.NeedRedrawOnResize: Boolean; +begin + Result := True; +end; + +end. diff --git a/official/x.35/ExpressDocking Library/Sources/dxDockPanel.pas b/official/x.35/ExpressDocking Library/Sources/dxDockPanel.pas new file mode 100644 index 00000000..baceb249 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Sources/dxDockPanel.pas @@ -0,0 +1,495 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDocking } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDOCKING AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxDockPanel; + +{$I cxVer.inc} + +interface + +uses + Menus, Windows, Graphics, Classes, Controls, ExtCtrls, Messages, Forms, + dxDockConsts, dxDockControl; + +type + TdxDockPanel = class(TdxCustomDockControl) + private + FShowSingleTab: Boolean; + FTabIsDown: Boolean; + FTabPosition: TdxTabContainerTabsPosition; + FTabsRect: TRect; + FTabRect: TRect; + + procedure SetShowSingleTab(const Value: Boolean); + procedure SetTabPosition(const Value: TdxTabContainerTabsPosition); + + procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; + procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; + procedure WMLButtonDblClk(var Message: TWMLButtonDblClk); message WM_LBUTTONDBLCLK; + procedure WMMouseMove(var Message: TWMMouseMove); message WM_MOUSEMOVE; + protected + procedure SetParent(AParent: TWinControl); override; + procedure ValidateInsert(AComponent: TComponent); override; + + function IsDockPanel: Boolean; override; + + // Docking + procedure UpdateControlDockZones(AControl: TdxCustomDockControl; AZoneWidth: Integer); override; + // Site layout + procedure CreateLayout(AControl: TdxCustomDockControl; AType: TdxDockingType; Index: Integer); override; + // SideContainer site + function CanAcceptSideContainerItems(AContainer: TdxSideContainerDockSite): Boolean; override; + // TabContainer site + procedure AssignTabContainerSiteProperies(ASite: TdxTabContainerDockSite); override; + function CanAcceptTabContainerItems(AContainer: TdxTabContainerDockSite): Boolean; override; + // Painting + procedure CalculateNC(var ARect: TRect); override; + procedure InvalidateCaptionArea; override; + procedure NCPaint(ACanvas: TCanvas); override; + function IsTabPoint(pt: TPoint): Boolean; + function GetTabPosition: TdxTabContainerTabsPosition; + function HasBorder: Boolean; override; + function HasCaption: Boolean; override; + function HasTabs: Boolean; override; + + property TabRect: TRect read FTabRect; + property TabsRect: TRect read FTabsRect; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + function CanActive: Boolean; override; + function CanAutoHide: Boolean; override; + function CanDock: Boolean; override; + function CanDockHost(AControl: TdxCustomDockControl; AType: TdxDockingType): Boolean; override; + function CanMaximize: Boolean; override; + published + property AllowDockClients; + property AllowFloating; + property AllowDock; + property AutoHide; + property Caption; + property CaptionButtons; + property Dockable; + property ImageIndex; + property ShowCaption; + property ShowSingleTab: Boolean read FShowSingleTab write SetShowSingleTab default False; + property TabPosition: TdxTabContainerTabsPosition read FTabPosition write SetTabPosition default tctpBottom; + + property OnActivate; + property OnAutoHideChanged; + property OnAutoHideChanging; + property OnCanResize; + property OnClose; + property OnCloseQuery; + property OnCreateFloatSite; + property OnCreateSideContainer; + property OnCreateTabContainer; + property OnCustomDrawDockingSelection; + property OnCustomDrawResizingSelection; + property OnDock; + property OnDocking; + property OnEndDocking; + property OnEndResizing; + property OnGetAutoHidePosition; + property OnLayoutChanged; + property OnMakeFloating; + property OnResize; + property OnResizing; + property OnRestoreDockPosition; + property OnStartDocking; + property OnStartResizing; + property OnStoreDockPosition; + property OnUnDock; + property OnUpdateDockZones; + property OnUpdateResizeZones; + end; + +implementation + +uses + SysUtils, dxDockZones, cxGraphics; + +type + TdxCustomDockControlAccess = class(TdxCustomDockControl); + +{ TdxDockPanel } + +constructor TdxDockPanel.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ShowSingleTab := False; + TabPosition := tctpBottom; + UseDoubleBuffer := True; + SetBounds(0, 0, 185, 140); +end; + +destructor TdxDockPanel.Destroy; +begin + inherited; +end; + +function TdxDockPanel.CanActive: Boolean; +begin + Result := True; +end; + +function TdxDockPanel.CanAutoHide: Boolean; +begin + Result := IsLoading or + ((AutoHideHostSite <> nil) and ((AutoHideControl = nil) or (AutoHideControl = Self))); +end; + +function TdxDockPanel.CanDock: Boolean; +begin + Result := True; +end; + +function TdxDockPanel.CanDockHost(AControl: TdxCustomDockControl; AType: TdxDockingType): Boolean; +var + ACanDockHost: Boolean; +begin + if Container <> nil then + begin + ACanDockHost := Container.CanContainerDockHost(AType); + if Container is TdxTabContainerDockSite then + begin + if doSideContainerCanInTabContainer in ControllerOptions then + ACanDockHost := ACanDockHost or (AType in [dtLeft, dtRight, dtTop, dtBottom]); + end; + if Container is TdxSideContainerDockSite then + begin + if doTabContainerCanInSideContainer in ControllerOptions then + ACanDockHost := ACanDockHost or (AType in [dtClient]); + if doSideContainerCanInSideContainer in ControllerOptions then + ACanDockHost := ACanDockHost or (AType in [dtLeft, dtRight, dtTop, dtBottom]); + end; + end + else + ACanDockHost := (AType in [dtClient, dtLeft, dtRight, dtTop, dtBottom]); + Result := inherited CanDockHost(AControl, AType) and ACanDockHost;; +end; + +function TdxDockPanel.CanMaximize: Boolean; +begin + Result := not AutoHide and (SideContainer <> nil) and (SideContainer.ValidChildCount > 1); +end; + +procedure TdxDockPanel.SetParent(AParent: TWinControl); +var + ALeft, ATop: Integer; + APrevParent: TWinControl; + I: TdxDockingType; +begin + if (UpdateLayoutLock = 0) and not IsDestroying and + ((AParent = nil) or not (csLoading in AParent.ComponentState)) then + begin + if IsDesigning and (AParent <> nil) then + ValidateContainer(AParent); + if AParent is TdxCustomDockControl then + for I := Low(TdxDockingType) to High(TdxDockingType) do + begin + if TdxCustomDockControl(AParent).CanDockHost(Self, I) then + begin + DockTo(AParent as TdxCustomDockControl, I, -1); + Exit; + end; + end; + // else Make Float + APrevParent := Parent; + ALeft := Left; + ATop := Top; + if AParent = nil then + AParent := APrevParent; + if AParent <> nil then + begin + ALeft := AParent.ClientOrigin.X + ALeft; + ATop := AParent.ClientOrigin.Y + ATop; + end; + MakeFloating(ALeft, ATop); + end + else + begin + if (AParent <> nil) and + not ((AParent is TdxCustomDockControl) or (AutoHide and (AParent is TdxDockSiteAutoHideContainer))) then + raise Exception.CreateFmt(sdxInvalidParent, [ClassName]) + else + inherited SetParent(AParent); + end +end; + +procedure TdxDockPanel.ValidateInsert(AComponent: TComponent); +begin + if AComponent is TdxCustomDockControl then + raise Exception.CreateFmt(sdxInvalidPanelChild, [AComponent.ClassName]); +end; + +function TdxDockPanel.IsDockPanel: Boolean; +begin + Result := True; +end; + +procedure TdxDockPanel.UpdateControlDockZones(AControl: TdxCustomDockControl; AZoneWidth: Integer); +begin + if not (doUseCaptionAreaToClientDocking in ControllerOptions) then + begin + if (TabContainer <> nil) and TdxTabContainerZone.ValidateDockZone(Self, AControl) then + DockZones.Insert(0, TdxTabContainerZone.Create(TabContainer)) + else + if TdxDockPanelClientZone.ValidateDockZone(Self, AControl) then + DockZones.Insert(0, TdxDockPanelClientZone.Create(Self)); + end; + inherited; + if doUseCaptionAreaToClientDocking in ControllerOptions then + begin + if (TabContainer <> nil) and TdxTabContainerCaptionZone.ValidateDockZone(Self, AControl) then + DockZones.Insert(0, TdxTabContainerCaptionZone.Create(TabContainer)) + else + if TdxDockPanelCaptionClientZone.ValidateDockZone(Self, AControl) then + DockZones.Insert(0, TdxDockPanelCaptionClientZone.Create(Self)); + end; +end; + +procedure TdxDockPanel.CreateLayout(AControl: TdxCustomDockControl; + AType: TdxDockingType; Index: Integer); +begin + if (Container <> nil) and Container.CanContainerDockHost(AType) then + CreateContainerLayout(Container, AControl, AType, DockIndex) + else + case AType of + dtClient: + CreateTabContainerLayout(AControl, AType, Index); + dtLeft, dtRight, dtTop, dtBottom: + CreateSideContainerLayout(AControl, AType, Index); + else + Assert(False, Format(sdxInternalErrorCreateLayout, [TdxContainerDockSite.ClassName])); + end; +end; + +function TdxDockPanel.CanAcceptSideContainerItems(AContainer: TdxSideContainerDockSite): Boolean; +begin + Result := True; +end; + +procedure TdxDockPanel.AssignTabContainerSiteProperies(ASite: TdxTabContainerDockSite); +begin + inherited; + if ShowSingleTab then + ASite.TabsPosition := TabPosition; +end; + +function TdxDockPanel.CanAcceptTabContainerItems(AContainer: TdxTabContainerDockSite): Boolean; +begin + Result := True; +end; + +procedure TdxDockPanel.CalculateNC(var ARect: TRect); +begin + inherited; + FTabsRect.Left := ARect.Left; + FTabsRect.Right := ARect.Right; + if GetTabPosition = tctpTop then + begin + FTabsRect.Top := ARect.Top; + FTabsRect.Bottom := FTabsRect.Top + Painter.GetTabsHeight; + if HasTabs then + ARect.Top := FTabsRect.Bottom; + end + else + begin + FTabsRect.Bottom := ARect.Bottom; + FTabsRect.Top := FTabsRect.Bottom - Painter.GetTabsHeight; + if FTabsRect.Top < ARect.Top then + begin + FTabsRect.Top := ARect.Top; + FTabsRect.Bottom := FTabsRect.Top + Painter.GetTabsHeight; + end; + if HasTabs then + ARect.Bottom := FTabsRect.Top; + end; + + FTabRect.Left := FTabsRect.Left + Painter.GetTabHorizInterval; + FTabRect.Top := FTabsRect.Top + Painter.GetTabVertInterval; + if GetTabPosition = tctpBottom then + Inc(FTabRect.Top, Painter.GetTabVertInterval); + FTabRect.Bottom := FTabsRect.Bottom - Painter.GetTabVertInterval; + if GetTabPosition = tctpTop then + Dec(FTabRect.Bottom, Painter.GetTabVertInterval); + FTabRect.Right := FTabRect.Left + GetTabWidth(Canvas); + if FTabRect.Right > FTabsRect.Right - Painter.GetTabHorizInterval then + FTabRect.Right := FTabsRect.Right - Painter.GetTabHorizInterval; +end; + +procedure TdxDockPanel.InvalidateCaptionArea; +begin + if HasTabs then + InvalidateNC(True) + else + inherited; +end; + +procedure TdxDockPanel.NCPaint(ACanvas: TCanvas); +begin + inherited; + if HasTabs then + begin + Painter.DrawTabs(ACanvas, TabsRect, TabRect, TabPosition); + Painter.DrawTab(ACanvas, Self, TabRect, True, TabPosition); + end; +end; + +function TdxDockPanel.IsTabPoint(pt: TPoint): Boolean; +begin + Result := HasTabs and PtInRect(TabRect, ClientToWindow(pt)); +end; + +function TdxDockPanel.GetTabPosition: TdxTabContainerTabsPosition; +begin + if ShowSingleTab then + Result := TabPosition + else + if Controller.DefaultTabContainerSiteProperties(ParentForm) <> nil then + Result := Controller.DefaultTabContainerSiteProperties(ParentForm).TabsPosition + else + Result := tctpBottom; +end; + +function TdxDockPanel.HasBorder: Boolean; +begin + Result := (FloatDockSite = nil) and + (AutoHide or + ((TabContainer = nil) or ((TabContainer.ValidChildCount < 2) and not TabContainer.AutoHide)) and + ((ParentDockControl = nil) or TdxCustomDockControlAccess(ParentDockControl).CanUndock(Self)) + ); +end; + +function TdxDockPanel.HasCaption: Boolean; +begin + Result := ShowCaption and HasBorder; +end; + +function TdxDockPanel.HasTabs: Boolean; +begin + Result := ShowSingleTab and ((TabContainer = nil) or (TabContainer.ValidChildCount = 1)); +end; + +procedure TdxDockPanel.SetShowSingleTab(const Value: Boolean); +begin + if FShowSingleTab <> Value then + begin + FShowSingleTab := Value; + NCChanged; + end; +end; + +procedure TdxDockPanel.SetTabPosition(const Value: TdxTabContainerTabsPosition); +begin + if FTabPosition <> Value then + begin + FTabPosition := Value; + NCChanged; + end; +end; + +procedure TdxDockPanel.WMLButtonDblClk(var Message: TWMLButtonDblClk); +var + pt: TPoint; +begin + inherited; + if Message.Result = 0 then + begin + if not IsDesigning and (doDblClickDocking in ControllerOptions) and + not AutoHide and IsTabPoint(CursorPoint) then + begin + pt := ClientToScreen(CursorPoint); + DoStartDocking(pt); + if FloatDockSite = nil then + MakeFloating + else + RestoreDockPosition(ClientToWindow(pt)); + DoEndDocking(pt); + Message.Result := 1; + end; + end; +end; + +procedure TdxDockPanel.WMLButtonDown(var Message: TWMLButtonDown); +begin + inherited; + if Message.Result = 0 then + begin + FTabIsDown := IsTabPoint(SourcePoint); + if FTabIsDown then + CaptureMouse; + Message.Result := 1; + end; +end; + +procedure TdxDockPanel.WMLButtonUp(var Message: TWMLButtonUp); +begin + inherited; + if Message.Result = 0 then + begin + if FTabIsDown then + begin + ReleaseMouse; + FTabIsDown := False; + Message.Result := 1; + end; + end; +end; + +procedure TdxDockPanel.WMMouseMove(var Message: TWMMouseMove); +begin + inherited; + if (Message.Result = 0) and (FloatFormActive or ParentFormActive or IsDesigning) then + begin + if FTabIsDown and ((IsDesigning and + ((Abs(CursorPoint.X - SourcePoint.X) > 3) or + (Abs(CursorPoint.Y - SourcePoint.Y) > 3))) or + not IsTabPoint(CursorPoint)) then + begin + ReleaseMouse; + FTabIsDown := False; + StartDocking(ClientToScreen(SourcePoint)); + Message.Result := 1; + end; + end; +end; + +initialization + RegisterClasses([TdxDockPanel]); + +end. diff --git a/official/x.35/ExpressDocking Library/Sources/dxDockReg.dcr b/official/x.35/ExpressDocking Library/Sources/dxDockReg.dcr new file mode 100644 index 00000000..f7559c0a Binary files /dev/null and b/official/x.35/ExpressDocking Library/Sources/dxDockReg.dcr differ diff --git a/official/x.35/ExpressDocking Library/Sources/dxDockReg.pas b/official/x.35/ExpressDocking Library/Sources/dxDockReg.pas new file mode 100644 index 00000000..c2457e14 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Sources/dxDockReg.pas @@ -0,0 +1,319 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDocking } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDOCKING AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxDockReg; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, Forms, Graphics, Controls, +{$IFDEF DELPHI6} + DesignIntf, ComponentDesigner, DesignEditors, VCLEditors; +{$ELSE} + DsgnIntf; +{$ENDIF} + +procedure Register; + +implementation + +uses + SysUtils, +{$IFDEF DELPHI5} + ImgList, +{$ENDIF} + dxDockControl, dxDockPanel, TypInfo, cxLibraryReg, cxPropEditors, cxDesignWindows; + +const + dxProductName = 'ExpressDocking Library'; +// dxDockVersion = '5.24'; + dxDockMajorVersion = '5'; + +type + {$IFDEF DELPHI6} + IDelphiDesigner = IDesigner; + {$ELSE} + IDelphiDesigner = IFormDesigner; + {$ENDIF} + + TdxDockingComponentEditor = class(TcxComponentEditor) + protected + function GetProductName: string; override; + function GetProductMajorVersion: string; override; + end; + + TdxDockingImageIndexProperty = class(TImageIndexProperty) + public + function GetImages: TCustomImageList; override; + end; + +{$IFDEF DELPHI9} + TdxSetElementProperty = class(TSetElementProperty) + private + FElement: Integer; + FBit: TBit; + protected + constructor Create(Parent: TPropertyEditor; AElement: Integer); reintroduce; + property Element: Integer read FElement; + function GetIsDefault: Boolean; override; + public + function AllEqual: Boolean; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + TdxSetProperty = class(TSetProperty) + public + procedure GetProperties(Proc: TGetPropProc); override; + function GetValue: string; override; + end; +{$ENDIF} + +{$IFDEF DELPHI10} + TdxDockPanelGuidelines = class(TWinControlGuidelines) + protected + function GetCount: Integer; override; + end; + + TdxFloatDockSiteGuidelines = class(TWinControlGuidelines) + protected + function GetCount: Integer; override; + end; +{$ENDIF} + +{ TdxDockingComponentEditor } + +function TdxDockingComponentEditor.GetProductName: string; +begin + Result := dxProductName; +end; + +function TdxDockingComponentEditor.GetProductMajorVersion: string; +begin + Result := dxDockMajorVersion; +end; + +{ TdxDockingImageIndexProperty } + +function TdxDockingImageIndexProperty.GetImages: TCustomImageList; +begin + Result := TdxCustomDockSite(GetComponent(0)).Images; +end; + +{$IFDEF DELPHI9} + +{ TdxSetElementProperty } + +constructor TdxSetElementProperty.Create(Parent: TPropertyEditor; AElement: Integer); +//var +// MinValue: integer; +begin + inherited Create(Parent, AElement); + FElement := AElement; +// MinValue := GetTypeData(GetTypeData(GetPropType).CompType^).MinValue; +// FBit := FElement - MinValue; + FBit := FElement; +end; + +function TdxSetElementProperty.AllEqual: Boolean; +var + I: Integer; + S: TIntegerSet; + V: Boolean; +begin + Result := False; + if PropCount > 1 then + begin + Integer(S) := GetOrdValue; + V := FElement in S; + for I := 1 to PropCount - 1 do + begin + Integer(S) := GetOrdValueAt(I); + if (FElement in S) <> V then Exit; + end; + end; + Result := True; +end; + +function TdxSetElementProperty.GetValue: string; +var + S: TIntegerSet; +begin + Integer(S) := GetOrdValue; + Result := BooleanIdents[FBit in S]; +end; + +procedure TdxSetElementProperty.GetValues(Proc: TGetStrProc); +begin + Proc(BooleanIdents[False]); + Proc(BooleanIdents[True]); +end; + +procedure TdxSetElementProperty.SetValue(const Value: string); +var + S: TIntegerSet; +begin + Integer(S) := GetOrdValue; + if CompareText(Value, BooleanIdents[True]) = 0 then + Include(S, FBit) + else + Exclude(S, FBit); + SetOrdValue(Integer(S)); +end; + +function TdxSetElementProperty.GetIsDefault: Boolean; +var + S: TIntegerSet; + ShouldBeInSet: Boolean; + HasStoredProc: Integer; + ProcAsInt: Integer; +begin + Result := False; // !!! + if not Result then + begin + ProcAsInt := Integer(PPropInfo(GetPropInfo)^.StoredProc); + HasStoredProc := ProcAsInt and $FFFFFF00; + if HasStoredProc = 0 then + begin + Integer(S) := PPropInfo(GetPropInfo)^.Default; + ShouldBeInSet := FBit in S; + Integer(S) := GetOrdValue; + if ShouldBeInSet then + Result := FBit in S + else + Result := not (FBit in S); + end; + end; +end; + +{ TdxSetProperty } + +procedure TdxSetProperty.GetProperties(Proc: TGetPropProc); +var + I: Integer; + E: IProperty; +begin + with GetTypeData(GetTypeData(GetPropType)^.CompType^)^ do + for I := MinValue to MaxValue do + begin + { Fix addref problems by referencing it here } + E := TdxSetElementProperty.Create(Self, I); + Proc(E); + E := nil; + end; +end; + +function TdxSetProperty.GetValue: string; +var + S: TIntegerSet; + TypeInfo: PTypeInfo; + I{, MinValue}: Integer; +begin + Integer(S) := GetOrdValue; + TypeInfo := GetTypeData(GetPropType)^.CompType^; +// MinValue := GetTypeData(TypeInfo).MinValue; + Result := '['; + for I := 0 to SizeOf(Integer) * 8 - 1 do + if I in S then + begin + if Length(Result) <> 1 then Result := Result + ','; + Result := Result + GetSetElementName(TypeInfo, I{ + MinValue}); + end; + Result := Result + ']'; +end; + +{$ENDIF} + +{$IFDEF DELPHI10} + +{ TdxDockPanelGuidelines } + +function TdxDockPanelGuidelines.GetCount: Integer; +begin + if TdxDockPanel(Component).FloatDockSite <> nil then + Result := 0 + else + Result := inherited GetCount; +end; + +{ TdxFloatDockSiteGuidelines } + +function TdxFloatDockSiteGuidelines.GetCount: Integer; +begin + Result := 0; +end; + +{$ENDIF} + +procedure Register; +begin + RegisterComponents('ExpressBars', [TdxDockingManager, TdxDockPanel, TdxDockSite]); +{$IFDEF DELPHI5} + RegisterPropertyEditor(TypeInfo(Integer), TdxCustomDockControl, 'ImageIndex', + TdxDockingImageIndexProperty); +{$ENDIF} + RegisterComponentEditor(TdxCustomDockControl, TdxDockingComponentEditor); + RegisterComponentEditor(TdxDockingManager, TdxDockingComponentEditor); +{$IFDEF DELPHI9} + // bug in Delphi 2005! + // bug in QC=13930 + RegisterPropertyEditor(TypeInfo(TdxDockingTypes), nil, '', TdxSetProperty); +{$ENDIF} +{$IFDEF DELPHI10} + RegisterComponentGuidelines(TdxDockPanel, TdxDockPanelGuidelines); + RegisterComponentGuidelines(TdxFloatDockSite, TdxFloatDockSiteGuidelines); +{$ENDIF} +end; + +type + TdxCustomDockControlAccess = class(TdxCustomDockControl); + +procedure RegisterDockControl(ASender: TObject); +begin + TdxCustomDockControlAccess(ASender).FDesignHelper := TcxDesignHelper.Create(TComponent(ASender)); +end; + +procedure UnregisterDockControl(ASender: TObject); +begin + TdxCustomDockControlAccess(ASender).FDesignHelper := nil; +end; + +initialization + FOnRegisterDockControl := RegisterDockControl; + FOnUnregisterDockControl := UnregisterDockControl; + +end. diff --git a/official/x.35/ExpressDocking Library/Sources/dxDockZones.pas b/official/x.35/ExpressDocking Library/Sources/dxDockZones.pas new file mode 100644 index 00000000..52504e59 --- /dev/null +++ b/official/x.35/ExpressDocking Library/Sources/dxDockZones.pas @@ -0,0 +1,1343 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDocking } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDOCKING AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxDockZones; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, cxGraphics, dxDockControl, dxDockPanel; + +type + TdxLeftZone = class(TdxZone) + protected + function GetDirection: TdxZoneDirection; override; + function GetDockType: TdxDockingType; override; + function GetRectangle: TRect; override; + + function CanConstrainedResize(NewWidth, NewHeight: Integer): Boolean; override; + public + function CanResize(StartPoint, EndPoint: TPoint): Boolean; override; + function GetDockingSelection(AControl: TdxCustomDockControl): TRect; override; + function GetResizingSelection(pt: TPoint): TRect; override; + procedure DoResize(StartPoint, EndPoint: TPoint); override; + class function ValidateDockZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + class function ValidateResizeZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + end; + + TdxRightZone = class(TdxZone) + protected + function GetDirection: TdxZoneDirection; override; + function GetDockType: TdxDockingType; override; + function GetRectangle: TRect; override; + + function CanConstrainedResize(NewWidth, NewHeight: Integer): Boolean; override; + public + function CanResize(StartPoint, EndPoint: TPoint): Boolean; override; + function GetDockingSelection(AControl: TdxCustomDockControl): TRect; override; + function GetResizingSelection(pt: TPoint): TRect; override; + procedure DoResize(StartPoint, EndPoint: TPoint); override; + class function ValidateDockZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + class function ValidateResizeZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + end; + + TdxTopZone = class(TdxZone) + protected + function GetDirection: TdxZoneDirection; override; + function GetDockType: TdxDockingType; override; + function GetRectangle: TRect; override; + + function CanConstrainedResize(NewWidth, NewHeight: Integer): Boolean; override; + public + function CanResize(StartPoint, EndPoint: TPoint): Boolean; override; + function GetDockingSelection(AControl: TdxCustomDockControl): TRect; override; + function GetResizingSelection(pt: TPoint): TRect; override; + procedure DoResize(StartPoint, EndPoint: TPoint); override; + class function ValidateDockZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + class function ValidateResizeZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + end; + + TdxBottomZone = class(TdxZone) + protected + function GetDirection: TdxZoneDirection; override; + function GetDockType: TdxDockingType; override; + function GetRectangle: TRect; override; + + function CanConstrainedResize(NewWidth, NewHeight: Integer): Boolean; override; + public + function CanResize(StartPoint, EndPoint: TPoint): Boolean; override; + function GetDockingSelection(AControl: TdxCustomDockControl): TRect; override; + function GetResizingSelection(pt: TPoint): TRect; override; + procedure DoResize(StartPoint, EndPoint: TPoint); override; + class function ValidateDockZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + class function ValidateResizeZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + end; + + TdxClientZone = class(TdxZone) + protected + function GetDirection: TdxZoneDirection; override; + function GetDockType: TdxDockingType; override; + function GetRectangle: TRect; override; + public + constructor Create(AOwner: TdxCustomDockControl; AWidth: Integer); + class function ValidateDockZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + end; + + TdxInvisibleClientZone = class(TdxClientZone) + protected + function FindTargetDockControlInControl(AControl: TdxCustomDockControl): TdxCustomDockControl; + function FindTargetDockControl: TdxCustomDockControl; + public + function CanDock(AControl: TdxCustomDockControl): Boolean; override; + procedure DoDock(AControl: TdxCustomDockControl); override; + class function ValidateDockZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + end; + + TdxFloatZone = class(TdxClientZone) + private + function GetFloatSite: TdxFloatDockSite; + protected + function FindTargetDockZone: TdxZone; + public + constructor Create(AControl: TdxFloatDockSite); + + function CanDock(AControl: TdxCustomDockControl): Boolean; override; + procedure DoDock(AControl: TdxCustomDockControl); override; + procedure DrawDockingSelection(DC: HDC; AControl: TdxCustomDockControl; pt: TPoint); override; + procedure PrepareSelectionRegion(ARegion: TcxRegion; AControl: TdxCustomDockControl; const ARect: TRect); override; + + function IsZonePoint(pt: TPoint): Boolean; override; + class function ValidateDockZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + + property FloatSite: TdxFloatDockSite read GetFloatSite; + end; + + TdxAutoHideLeftZone = class(TdxLeftZone) + public + function CanResize(StartPoint, EndPoint: TPoint): Boolean; override; + class function ValidateResizeZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + end; + + TdxAutoHideRightZone = class(TdxRightZone) + public + function CanResize(StartPoint, EndPoint: TPoint): Boolean; override; + class function ValidateResizeZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + end; + + TdxAutoHideTopZone = class(TdxTopZone) + public + function CanResize(StartPoint, EndPoint: TPoint): Boolean; override; + class function ValidateResizeZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + end; + + TdxAutoHideBottomZone = class(TdxBottomZone) + public + function CanResize(StartPoint, EndPoint: TPoint): Boolean; override; + class function ValidateResizeZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + end; + + TdxAutoSizeLeftZone = class(TdxLeftZone) + public + class function ValidateResizeZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + end; + + TdxAutoSizeRightZone = class(TdxRightZone) + public + class function ValidateResizeZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + end; + + TdxAutoSizeTopZone = class(TdxTopZone) + public + class function ValidateResizeZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + end; + + TdxAutoSizeBottomZone = class(TdxBottomZone) + public + class function ValidateResizeZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + end; + + TdxAutoSizeClientZone = class(TdxClientZone) + public + function GetDockingSelection(AControl: TdxCustomDockControl): TRect; override; + function IsZonePoint(pt: TPoint): Boolean; override; + end; + + TdxInvisibleAutoSizeClientZone = class(TdxInvisibleClientZone) + public + function GetDockingSelection(AControl: TdxCustomDockControl): TRect; override; + function IsZonePoint(pt: TPoint): Boolean; override; + end; + + TdxCustomTabContainerZone = class(TdxClientZone) + protected + procedure CorrectTabRects(var ATabsRect, ATabRect: TRect); virtual; + function GetTabPosition: TdxTabContainerTabsPosition; virtual; abstract; + function GetTabRect(AControl: TdxCustomDockControl): TRect; virtual; abstract; + function GetTabsRect: TRect; virtual; abstract; + public + procedure PrepareSelectionRegion(ARegion: TcxRegion; AControl: TdxCustomDockControl; const ARect: TRect); override; + end; + + TdxTabContainerZone = class(TdxCustomTabContainerZone) + private + function GetTabContainer: TdxTabContainerDockSite; + protected + procedure CorrectTabRects(var ATabsRect, ATabRect: TRect); override; + function GetDockIndex: Integer; override; + function GetTabPosition: TdxTabContainerTabsPosition; override; + function GetTabRect(AControl: TdxCustomDockControl): TRect; override; + function GetTabsRect: TRect; override; + public + constructor Create(AControl: TdxTabContainerDockSite); + procedure DrawDockingSelection(DC: HDC; AControl: TdxCustomDockControl; pt: TPoint); override; + class function ValidateDockZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + property TabContainer: TdxTabContainerDockSite read GetTabContainer; + end; + + TdxTabContainerCaptionZone = class(TdxTabContainerZone) + public + function IsZonePoint(pt: TPoint): Boolean; override; + end; + + TdxTabContainerTabZone = class(TdxTabContainerZone) + private + FDockIndex: Integer; + protected + function GetDockIndex: Integer; override; + public + constructor Create(AControl: TdxTabContainerDockSite; ADockIndex: Integer); + function IsZonePoint(pt: TPoint): Boolean; override; + class function ValidateDockZone(AOwner, AControl: TdxCustomDockControl): Boolean; override; + end; + + TdxHorizContainerZone = class(TdxRightZone) + public + function CanResize(StartPoint, EndPoint: TPoint): Boolean; override; + procedure DoResize(StartPoint, EndPoint: TPoint); override; + end; + + TdxVertContainerZone = class(TdxBottomZone) + public + function CanResize(StartPoint, EndPoint: TPoint): Boolean; override; + procedure DoResize(StartPoint, EndPoint: TPoint); override; + end; + + TdxDockPanelClientZone = class(TdxCustomTabContainerZone) + private + function GetDockPanel: TdxDockPanel; + protected + function GetTabPosition: TdxTabContainerTabsPosition; override; + function GetTabRect(AControl: TdxCustomDockControl): TRect; override; + function GetTabsRect: TRect; override; + public + constructor Create(AControl: TdxDockPanel); + procedure DrawDockingSelection(DC: HDC; AControl: TdxCustomDockControl; pt: TPoint); override; + property DockPanel: TdxDockPanel read GetDockPanel; + end; + + TdxDockPanelCaptionClientZone = class(TdxDockPanelClientZone) + public + function IsZonePoint(pt: TPoint): Boolean; override; + end; + +implementation + +uses + dxDockConsts, Forms, Controls, Types, Math, Graphics; + +type + TdxCustomDockControlAccess = class(TdxCustomDockControl); + TdxTabContainerDockSiteAccess = class(TdxTabContainerDockSite); + TdxSideContainerDockSiteAccess = class(TdxSideContainerDockSite); + TdxDockPanelAccess = class(TdxDockPanel); + +{ TdxLeftZone } + +function TdxLeftZone.GetDirection: TdxZoneDirection; +begin + Result := zdVertical; +end; + +function TdxLeftZone.GetDockType: TdxDockingType; +begin + Result := dtLeft; +end; + +function TdxLeftZone.CanResize(StartPoint, EndPoint: TPoint): Boolean; +var + NewWidth, NewHeight: Integer; +begin + NewWidth := Owner.Width + (StartPoint.X - EndPoint.X); + NewHeight := Owner.Height; + Result := (NewWidth > 0) and (NewWidth < Owner.Parent.ClientWidth) and + CanConstrainedResize(NewWidth, NewHeight); + Result := Result and TdxCustomDockControlAccess(Owner).CanResizing(NewWidth, NewHeight); +end; + +function TdxLeftZone.GetDockingSelection(AControl: TdxCustomDockControl): TRect; +var + R: TRect; +begin + Result := Rect(0, 0, Min(AControl.OriginalWidth, Owner.Width - 2 * SelectionFrameWidth), Owner.Height); + GetWindowRect(Owner.Handle, R); + OffsetRect(Result, R.Left, R.Top); +end; + +function TdxLeftZone.GetResizingSelection(pt: TPoint): TRect; +var + R: TRect; +begin + GetWindowRect(Owner.Handle, R); + Result.Left := pt.X; + Result.Right := Result.Left + SelectionFrameWidth; + Result.Top := R.Top; + Result.Bottom := R.Bottom; +end; + +function TdxLeftZone.GetRectangle: TRect; +var + AZoneOffset: Integer; +begin + if (Kind = zkDocking) and + (doUseCaptionAreaToClientDocking in TdxCustomDockControlAccess(Owner).ControllerOptions) and + TdxCustomDockControlAccess(Owner).HasCaption and + TdxCustomDockControlAccess(Owner).IsCaptionVertical then + begin + AZoneOffset := TdxCustomDockControlAccess(Owner).Painter.GetCaptionHeight; + if TdxCustomDockControlAccess(Owner).HasBorder then + Inc(AZoneOffset, TdxCustomDockControlAccess(Owner).Painter.GetBorderWidth); + end + else + AZoneOffset := 0; + Result := Rect(AZoneOffset, 0, Width + AZoneOffset, Owner.Height) +end; + +function TdxLeftZone.CanConstrainedResize(NewWidth, NewHeight: Integer): Boolean; +begin + Result := ((Owner.Constraints.MinWidth <= 0) or (NewWidth > Owner.Constraints.MinWidth)) and + ((Owner.Constraints.MaxWidth <= 0) or (NewWidth < Owner.Constraints.MaxWidth)); +end; + +procedure TdxLeftZone.DoResize(StartPoint, EndPoint: TPoint); +begin + Owner.Width := Owner.Width + (StartPoint.X - EndPoint.X); +end; + +class function TdxLeftZone.ValidateDockZone(AOwner, AControl: TdxCustomDockControl): Boolean; +var + I: Integer; + AZone: TdxZone; +begin + Result := dtLeft in AOwner.AllowDockClients; + if Result then + for I := 0 to AControl.DockZones.Count - 1 do + begin + AZone := TdxZone(AControl.DockZones.Items[I]); + if (AZone.DockType = dtLeft) and (AZone.Owner.Height = AOwner.Height) then + begin + Result := False; + Break; + end; + end; +end; + +class function TdxLeftZone.ValidateResizeZone(AOwner, AControl: TdxCustomDockControl): Boolean; +begin + Result := (AOwner.ParentDockControl <> nil) and (AOwner.DockType = dtRight); +end; + +{ TdxRightZone } + +function TdxRightZone.GetDirection: TdxZoneDirection; +begin + Result := zdVertical; +end; + +function TdxRightZone.GetDockType: TdxDockingType; +begin + Result := dtRight; +end; + +function TdxRightZone.CanResize(StartPoint, EndPoint: TPoint): Boolean; +var + NewWidth, NewHeight: Integer; +begin + NewWidth := Owner.Width - (StartPoint.X - EndPoint.X); + NewHeight := Owner.Height; + Result := (NewWidth > 0) and (Owner.Left + NewWidth < Owner.Parent.ClientWidth) and + CanConstrainedResize(NewWidth, NewHeight); + Result := Result and TdxCustomDockControlAccess(Owner).CanResizing(NewWidth, NewHeight); +end; + +function TdxRightZone.GetDockingSelection(AControl: TdxCustomDockControl): TRect; +var + R: TRect; +begin + if Owner.Width - AControl.OriginalWidth - 2 * SelectionFrameWidth > 0 then + Result := Rect(Owner.Width - AControl.OriginalWidth, 0, Owner.Width, Owner.Height) + else + Result := Rect(2 * SelectionFrameWidth, 0, Owner.Width, Owner.Height); + GetWindowRect(Owner.Handle, R); + OffsetRect(Result, R.Left, R.Top); +end; + +function TdxRightZone.GetResizingSelection(pt: TPoint): TRect; +var + R: TRect; +begin + GetWindowRect(Owner.Handle, R); + Result.Right := pt.X; + Result.Left := Result.Right - SelectionFrameWidth; + Result.Top := R.Top; + Result.Bottom := R.Bottom; +end; + +class function TdxRightZone.ValidateDockZone(AOwner, AControl: TdxCustomDockControl): Boolean; +var + I: Integer; + AZone: TdxZone; +begin + Result := dtRight in AOwner.AllowDockClients; + if Result then + for I := 0 to AControl.DockZones.Count - 1 do + begin + AZone := TdxZone(AControl.DockZones.Items[I]); + if (AZone.DockType = dtRight) and (AZone.Owner.Height = AOwner.Height) then + begin + Result := False; + Break; + end; + end; +end; + +class function TdxRightZone.ValidateResizeZone(AOwner, AControl: TdxCustomDockControl): Boolean; +begin + Result := (AOwner.ParentDockControl <> nil) and (AOwner.DockType = dtLeft); +end; + +function TdxRightZone.GetRectangle: TRect; +begin + Result := Rect(Owner.Width - Width, 0, Owner.Width, Owner.Height) +end; + +function TdxRightZone.CanConstrainedResize(NewWidth, NewHeight: Integer): Boolean; +begin + Result := ((Owner.Constraints.MinWidth <= 0) or (NewWidth > Owner.Constraints.MinWidth)) and + ((Owner.Constraints.MaxWidth <= 0) or (NewWidth < Owner.Constraints.MaxWidth)); +end; + +procedure TdxRightZone.DoResize(StartPoint, EndPoint: TPoint); +begin + Owner.Width := Owner.Width - (StartPoint.X - EndPoint.X); +end; + +{ TdxTopZone } + +function TdxTopZone.GetDirection: TdxZoneDirection; +begin + Result := zdHorizontal; +end; + +function TdxTopZone.GetDockType: TdxDockingType; +begin + Result := dtTop; +end; + +function TdxTopZone.CanResize(StartPoint, EndPoint: TPoint): Boolean; +var + NewWidth, NewHeight: Integer; +begin + NewHeight := Owner.Height + (StartPoint.Y - EndPoint.Y); + NewWidth := Owner.Width; + Result := (NewHeight > 0) and (NewHeight < Owner.Parent.ClientHeight) and + CanConstrainedResize(NewWidth, NewHeight); + Result := Result and TdxCustomDockControlAccess(Owner).CanResizing(NewWidth, NewHeight); +end; + +function TdxTopZone.GetDockingSelection(AControl: TdxCustomDockControl): TRect; +var + R: TRect; +begin + if AControl.OriginalHeight < Owner.Height - 2 * SelectionFrameWidth then + Result := Rect(0, 0, Owner.Width, AControl.OriginalHeight) + else + Result := Rect(0, 0, Owner.Width, Owner.Height - 2 * SelectionFrameWidth); + GetWindowRect(Owner.Handle, R); + OffsetRect(Result, R.Left, R.Top); +end; + +function TdxTopZone.GetResizingSelection(pt: TPoint): TRect; +var + R: TRect; +begin + GetWindowRect(Owner.Handle, R); + Result.Top := pt.Y; + Result.Bottom := Result.Top + SelectionFrameWidth; + Result.Left := R.Left; + Result.Right := R.Right; +end; + +function TdxTopZone.GetRectangle: TRect; +var + AZoneOffset: Integer; +begin + if (Kind = zkDocking) and + (doUseCaptionAreaToClientDocking in TdxCustomDockControlAccess(Owner).ControllerOptions) and + TdxCustomDockControlAccess(Owner).HasCaption and + not TdxCustomDockControlAccess(Owner).IsCaptionVertical then + begin + AZoneOffset := TdxCustomDockControlAccess(Owner).Painter.GetCaptionHeight; + if TdxCustomDockControlAccess(Owner).HasBorder then + Inc(AZoneOffset, TdxCustomDockControlAccess(Owner).Painter.GetBorderWidth); + end + else + AZoneOffset := 0; + Result := Rect(0, AZoneOffset, Owner.Width, Width + AZoneOffset); +end; + +function TdxTopZone.CanConstrainedResize(NewWidth, NewHeight: Integer): Boolean; +begin + Result := ((Owner.Constraints.MinHeight <= 0) or (NewHeight > Owner.Constraints.MinHeight)) and + ((Owner.Constraints.MaxHeight <= 0) or (NewHeight < Owner.Constraints.MaxHeight)); +end; + +procedure TdxTopZone.DoResize(StartPoint, EndPoint: TPoint); +begin + Owner.Height := Owner.Height + (StartPoint.Y - EndPoint.Y); +end; + +class function TdxTopZone.ValidateDockZone(AOwner, AControl: TdxCustomDockControl): Boolean; +var + I: Integer; + AZone: TdxZone; +begin + Result := dtTop in AOwner.AllowDockClients; + if Result then + for I := 0 to AControl.DockZones.Count - 1 do + begin + AZone := TdxZone(AControl.DockZones.Items[I]); + if (AZone.DockType = dtTop) and (AZone.Owner.Width = AOwner.Width) then + begin + Result := False; + Break; + end; + end; +end; + +class function TdxTopZone.ValidateResizeZone(AOwner, AControl: TdxCustomDockControl): Boolean; +begin + Result := (AOwner.ParentDockControl <> nil) and (AOwner.DockType = dtBottom); +end; + +{ TdxBottomZone } + +function TdxBottomZone.GetDirection: TdxZoneDirection; +begin + Result := zdHorizontal; +end; + +function TdxBottomZone.GetDockType: TdxDockingType; +begin + Result := dtBottom; +end; + +function TdxBottomZone.CanResize(StartPoint, EndPoint: TPoint): Boolean; +var + NewWidth, NewHeight: Integer; +begin + NewHeight := Owner.Height - (StartPoint.Y - EndPoint.Y); + NewWidth := Owner.Width; + Result := (NewHeight > 0) and (Owner.Top + NewHeight < Owner.Parent.ClientHeight) and + CanConstrainedResize(NewWidth, NewHeight); + Result := Result and TdxCustomDockControlAccess(Owner).CanResizing(NewWidth, NewHeight); +end; + +function TdxBottomZone.GetDockingSelection(AControl: TdxCustomDockControl): TRect; +var + R: TRect; +begin + if Owner.Height - AControl.OriginalHeight - 2 * SelectionFrameWidth > 0 then + Result := Rect(0, Owner.Height - AControl.OriginalHeight, Owner.Width, Owner.Height) + else + Result := Rect(0, 2 * SelectionFrameWidth, Owner.Width, Owner.Height); + GetWindowRect(Owner.Handle, R); + OffsetRect(Result, R.Left, R.Top); +end; + +function TdxBottomZone.GetResizingSelection(pt: TPoint): TRect; +var + R: TRect; +begin + GetWindowRect(Owner.Handle, R); + Result.Bottom := pt.Y; + Result.Top := Result.Bottom - SelectionFrameWidth; + Result.Left := R.Left; + Result.Right := R.Right; +end; + +function TdxBottomZone.GetRectangle: TRect; +begin + Result := Rect(0, Owner.Height - Width, Owner.Width, Owner.Height) +end; + +function TdxBottomZone.CanConstrainedResize(NewWidth, NewHeight: Integer): Boolean; +begin + Result := ((Owner.Constraints.MinHeight <= 0) or (NewHeight > Owner.Constraints.MinHeight)) and + ((Owner.Constraints.MaxHeight <= 0) or (NewHeight < Owner.Constraints.MaxHeight)); +end; + +procedure TdxBottomZone.DoResize(StartPoint, EndPoint: TPoint); +begin + Owner.Height := Owner.Height - (StartPoint.Y - EndPoint.Y); +end; + +class function TdxBottomZone.ValidateDockZone(AOwner, AControl: TdxCustomDockControl): Boolean; +var + I: Integer; + AZone: TdxZone; +begin + Result := dtBottom in AOwner.AllowDockClients; + if Result then + for I := 0 to AControl.DockZones.Count - 1 do + begin + AZone := TdxZone(AControl.DockZones.Items[I]); + if (AZone.DockType = dtBottom) and (AZone.Owner.Width = AOwner.Width) then + begin + Result := False; + Break; + end; + end; +end; + +class function TdxBottomZone.ValidateResizeZone(AOwner, AControl: TdxCustomDockControl): Boolean; +begin + Result := (AOwner.ParentDockControl <> nil) and (AOwner.DockType = dtTop); +end; + +{ TdxClientZone } + +constructor TdxClientZone.Create(AOwner: TdxCustomDockControl; AWidth: Integer); +begin + inherited Create(AOwner, AWidth, zkDocking); +end; + +function TdxClientZone.GetDirection: TdxZoneDirection; +begin + Result := zdUndefined; +end; + +function TdxClientZone.GetDockType: TdxDockingType; +begin + Result := dtClient; +end; + +function TdxClientZone.GetRectangle: TRect; +begin + Result := Rect(0, 0, Owner.Width, Owner.Height); +end; + +class function TdxClientZone.ValidateDockZone(AOwner, AControl: TdxCustomDockControl): Boolean; +begin + Result := dtClient in AOwner.AllowDockClients; + Result := Result and (AOwner = AControl) and (AOwner.ChildCount = 0); +end; + +{ TdxInvisibleClientZone } + +function TdxInvisibleClientZone.CanDock(AControl: TdxCustomDockControl): Boolean; +var + ATarget: TdxCustomDockControl; +begin + ATarget := FindTargetDockControl; + Result := (ATarget <> nil) and + (ATarget.CanDockHost(AControl, dtClient) or + ATarget.CanDockHost(AControl, dtRight) or + ATarget.CanDockHost(AControl, dtBottom)); +end; + +procedure TdxInvisibleClientZone.DoDock(AControl: TdxCustomDockControl); +var + ATarget: TdxCustomDockControl; +begin + ATarget := FindTargetDockControl; + if ATarget <> nil then + begin + if ATarget.CanDockHost(AControl, dtClient) then + AControl.DockTo(ATarget, dtClient, -1) + else + if ATarget.CanDockHost(AControl, dtRight) then + AControl.DockTo(ATarget, dtRight, -1) + else + if ATarget.CanDockHost(AControl, dtBottom) then + AControl.DockTo(ATarget, dtBottom, -1); + end +end; + +function TdxInvisibleClientZone.FindTargetDockControlInControl(AControl: TdxCustomDockControl): TdxCustomDockControl; +var + I: Integer; +begin + if AControl.ChildCount > 0 then + begin + Result := nil; + for I := 0 to AControl.ChildCount - 1 do + begin + if AControl.Children[I].DockType <> dtClient then Continue; + if (Result = nil) and (AControl.Children[I].CanDock or (AControl.Children[I].ChildCount = 0)) then + Result := AControl.Children[I] + else + if (Result <> nil) and AControl.Children[I].CanDock then + Result := AControl.Children[I]; + end; + if (Result <> nil) and not Result.CanDock then + Result := FindTargetDockControlInControl(Result); + end + else + Result := AControl; +end; + +function TdxInvisibleClientZone.FindTargetDockControl: TdxCustomDockControl; +begin + Result := FindTargetDockControlInControl(Owner); +end; + +class function TdxInvisibleClientZone.ValidateDockZone(AOwner, AControl: TdxCustomDockControl): Boolean; +begin + Result := dtClient in AOwner.AllowDockClients; + Result := Result and (AOwner = AControl) and (AOwner.ChildCount = 2) and + not AOwner.IsValidChild(AOwner.Children[0]) and + not AOwner.IsValidChild(AOwner.Children[1]); +end; + +{ TdxFloatZone } + +constructor TdxFloatZone.Create(AControl: TdxFloatDockSite); +begin + inherited Create(AControl, 0); +end; + +function TdxFloatZone.CanDock(AControl: TdxCustomDockControl): Boolean; +var + AZone: TdxZone; +begin + AZone := FindTargetDockZone; + if AZone <> nil then + Result := AZone.CanDock(AControl) + else + Result := False; +end; + +function TdxFloatZone.IsZonePoint(pt: TPoint): Boolean; +begin + Result := dxDockingController.GetFloatDockSiteAtPos(pt) = Owner; +end; + +function TdxFloatZone.FindTargetDockZone: TdxZone; +var + I: Integer; + AZone: TdxZone; +begin + Result := nil; + if FloatSite.Child <> nil then + begin + for I := 0 to FloatSite.Child.DockZones.Count - 1 do + begin + AZone := TdxZone(FloatSite.Child.DockZones[I]); + if (AZone.Owner = FloatSite.Child) and (AZone.DockType = dtClient) then + begin + Result := AZone; + Break; + end; + end; + end; +end; + +procedure TdxFloatZone.DoDock(AControl: TdxCustomDockControl); +var + AZone: TdxZone; +begin + AZone := FindTargetDockZone; + if AZone <> nil then + AZone.DoDock(AControl); +end; + +procedure TdxFloatZone.DrawDockingSelection(DC: HDC; AControl: TdxCustomDockControl; pt: TPoint); +var + AZone: TdxZone; +begin + AZone := FindTargetDockZone; + if AZone <> nil then + AZone.DrawDockingSelection(DC, AControl, pt); +end; + +procedure TdxFloatZone.PrepareSelectionRegion(ARegion: TcxRegion; AControl: TdxCustomDockControl; const ARect: TRect); +var + AZone: TdxZone; +begin + AZone := FindTargetDockZone; + if AZone <> nil then + AZone.PrepareSelectionRegion(ARegion, AControl, ARect); +end; + +class function TdxFloatZone.ValidateDockZone(AOwner, AControl: TdxCustomDockControl): Boolean; +begin + Result := (AOwner = AControl) and (AOwner is TdxFloatDockSite); +end; + +function TdxFloatZone.GetFloatSite: TdxFloatDockSite; +begin + Result := Owner as TdxFloatDockSite; +end; + +{ TdxAutoHideLeftZone } + +function TdxAutoHideLeftZone.CanResize(StartPoint, EndPoint: TPoint): Boolean; +var + NewWidth, NewHeight: Integer; +begin + NewWidth := Owner.Width + (StartPoint.X - EndPoint.X); + NewHeight := Owner.Height; + Result := (NewWidth > 0) and ((Owner.AutoHideHostSite.AutoSize and + (NewWidth < Owner.AutoHideContainer.Parent.ClientWidth - Owner.AutoHideHostSite.Width)) or + (not Owner.AutoHideHostSite.AutoSize and (NewWidth < Owner.AutoHideHostSite.ClientWidth))) and + CanConstrainedResize(NewWidth, NewHeight); + Result := Result and TdxCustomDockControlAccess(Owner).CanResizing(NewWidth, NewHeight); +end; + +class function TdxAutoHideLeftZone.ValidateResizeZone(AOwner, + AControl: TdxCustomDockControl): Boolean; +begin + Result := AOwner.AutoHide and (AOwner.AutoHideHostSite <> nil) and + (AOwner.AutoHideHostSite.GetPositionByControl(AOwner) = ahpRight); +end; + +{ TdxAutoHideRightZone } + +function TdxAutoHideRightZone.CanResize(StartPoint, EndPoint: TPoint): Boolean; +var + NewWidth, NewHeight: Integer; +begin + NewWidth := Owner.Width - (StartPoint.X - EndPoint.X); + NewHeight := Owner.Height; + Result := (NewWidth > 0) and ((Owner.AutoHideHostSite.AutoSize and + (NewWidth < Owner.AutoHideContainer.Parent.ClientWidth - Owner.AutoHideHostSite.Width)) or + (not Owner.AutoHideHostSite.AutoSize and (NewWidth < Owner.AutoHideHostSite.ClientWidth))) and + CanConstrainedResize(NewWidth, NewHeight); + Result := Result and TdxCustomDockControlAccess(Owner).CanResizing(NewWidth, NewHeight); +end; + +class function TdxAutoHideRightZone.ValidateResizeZone(AOwner, + AControl: TdxCustomDockControl): Boolean; +begin + Result := AOwner.AutoHide and (AOwner.AutoHideHostSite <> nil) and + (AOwner.AutoHideHostSite.GetPositionByControl(AOwner) = ahpLeft); +end; + +{ TdxAutoHideTopZone } + +function TdxAutoHideTopZone.CanResize(StartPoint, EndPoint: TPoint): Boolean; +var + NewWidth, NewHeight: Integer; +begin + NewHeight := Owner.Height + (StartPoint.Y - EndPoint.Y); + NewWidth := Owner.Width; + Result := (NewHeight > 0) and ((Owner.AutoHideHostSite.AutoSize and + (NewHeight < Owner.AutoHideContainer.Parent.ClientHeight - Owner.AutoHideHostSite.Height)) or + (not Owner.AutoHideHostSite.AutoSize and (NewHeight < Owner.AutoHideHostSite.ClientHeight))) and + CanConstrainedResize(NewWidth, NewHeight); + Result := Result and TdxCustomDockControlAccess(Owner).CanResizing(NewWidth, NewHeight); +end; + +class function TdxAutoHideTopZone.ValidateResizeZone(AOwner, + AControl: TdxCustomDockControl): Boolean; +begin + Result := AOwner.AutoHide and (AOwner.AutoHideHostSite <> nil) and + (AOwner.AutoHideHostSite.GetPositionByControl(AOwner) = ahpBottom); +end; + +{ TdxAutoHideBottomZone } + +function TdxAutoHideBottomZone.CanResize(StartPoint, EndPoint: TPoint): Boolean; +var + NewWidth, NewHeight: Integer; +begin + NewHeight := Owner.Height - (StartPoint.Y - EndPoint.Y); + NewWidth := Owner.Width; + Result := (NewHeight > 0) and ((Owner.AutoHideHostSite.AutoSize and + (NewHeight < Owner.AutoHideContainer.Parent.ClientHeight - Owner.AutoHideHostSite.Height)) or + (not Owner.AutoHideHostSite.AutoSize and (NewHeight < Owner.AutoHideHostSite.ClientHeight))) and + CanConstrainedResize(NewWidth, NewHeight); + Result := Result and TdxCustomDockControlAccess(Owner).CanResizing(NewWidth, NewHeight); +end; + +class function TdxAutoHideBottomZone.ValidateResizeZone(AOwner, + AControl: TdxCustomDockControl): Boolean; +begin + Result := AOwner.AutoHide and (AOwner.AutoHideHostSite <> nil) and + (AOwner.AutoHideHostSite.GetPositionByControl(AOwner) = ahpTop); +end; + +{ TdxAutoSizeLeftZone } + +class function TdxAutoSizeLeftZone.ValidateResizeZone(AOwner, + AControl: TdxCustomDockControl): Boolean; +begin + Result := (AOwner.Parent <> nil) and (AOwner.Align in [alRight]); +end; + +{ TdxAutoSizeRightZone } + +class function TdxAutoSizeRightZone.ValidateResizeZone(AOwner, + AControl: TdxCustomDockControl): Boolean; +begin + Result := (AOwner.Parent <> nil) and (AOwner.Align in [alLeft, alNone]); +end; + +{ TdxAutoSizeTopZone } + +class function TdxAutoSizeTopZone.ValidateResizeZone(AOwner, + AControl: TdxCustomDockControl): Boolean; +begin + Result := (AOwner.Parent <> nil) and (AOwner.Align in [alBottom]); +end; + +{ TdxAutoSizeBottomZone } + +class function TdxAutoSizeBottomZone.ValidateResizeZone(AOwner, + AControl: TdxCustomDockControl): Boolean; +begin + Result := (AOwner.Parent <> nil) and (AOwner.Align in [alTop, alNone]); +end; + +{ TdxAutoSizeClientZone } + +function TdxAutoSizeClientZone.GetDockingSelection(AControl: TdxCustomDockControl): TRect; +var + R: TRect; + AWidth, AHeight: Integer; +begin + GetWindowRect(Owner.Handle, R); + if Owner.Width < AControl.OriginalWidth then + AWidth := AControl.OriginalWidth + else + AWidth := Owner.Width; + if Owner.Height < AControl.OriginalHeight then + AHeight := AControl.OriginalHeight + else + AHeight := Owner.Height; + case Owner.Align of + alLeft: + begin + Result := Rect(0, 0, AWidth, Owner.Height); + OffsetRect(Result, R.Left, R.Top); + end; + alRight: + begin + Result := Rect(0, 0, AWidth, Owner.Height); + OffsetRect(Result, R.Right - AWidth, R.Top); + end; + alTop: + begin + Result := Rect(0, 0, Owner.Width, AHeight); + OffsetRect(Result, R.Left, R.Top); + end; + alBottom: + begin + Result := Rect(0, 0, Owner.Width, AHeight); + OffsetRect(Result, R.Left, R.Bottom - AHeight); + end; + alClient: + begin + Result := Rect(0, 0, Owner.Width, Owner.Height); + OffsetRect(Result, R.Left, R.Top); + end; + else + Result := Rect(0, 0, AWidth, AHeight); + OffsetRect(Result, R.Left, R.Top); + end; +end; + +function TdxAutoSizeClientZone.IsZonePoint(pt: TPoint): Boolean; +begin + Result := inherited IsZonePoint(pt) or + (dxDockingController.GetNearestDockSiteAtPos(pt) = Owner); +end; + +{ TdxInvisibleAutoSizeClientZone } + +function TdxInvisibleAutoSizeClientZone.GetDockingSelection(AControl: TdxCustomDockControl): TRect; +var + R: TRect; + AWidth, AHeight: Integer; +begin + GetWindowRect(Owner.Handle, R); + if Owner.Width < AControl.OriginalWidth then + AWidth := AControl.OriginalWidth + else + AWidth := Owner.Width; + if Owner.Height < AControl.OriginalHeight then + AHeight := AControl.OriginalHeight + else + AHeight := Owner.Height; + case Owner.Align of + alLeft: + begin + Result := Rect(0, 0, AWidth, Owner.Height); + OffsetRect(Result, R.Left, R.Top); + end; + alRight: + begin + Result := Rect(0, 0, AWidth, Owner.Height); + OffsetRect(Result, R.Right - AWidth, R.Top); + end; + alTop: + begin + Result := Rect(0, 0, Owner.Width, AHeight); + OffsetRect(Result, R.Left, R.Top); + end; + alBottom: + begin + Result := Rect(0, 0, Owner.Width, AHeight); + OffsetRect(Result, R.Left, R.Bottom - AHeight); + end; + alClient: + begin + Result := Rect(0, 0, Owner.Width, Owner.Height); + OffsetRect(Result, R.Left, R.Top); + end; + else + Result := Rect(0, 0, AWidth, AHeight); + OffsetRect(Result, R.Left, R.Top); + end; +end; + +function TdxInvisibleAutoSizeClientZone.IsZonePoint(pt: TPoint): Boolean; +begin + Result := dxDockingController.GetNearestDockSiteAtPos(pt) = Owner; +end; + +{ TdxCustomTabContainerZone } + +procedure TdxCustomTabContainerZone.PrepareSelectionRegion(ARegion: TcxRegion; AControl: TdxCustomDockControl; const ARect: TRect); +var + AContentRect, ATabsRect, ATabRect: TRect; +begin + ATabsRect := GetTabsRect; + ATabRect := GetTabRect(AControl); + + CorrectTabRects(ATabsRect, ATabRect); + + AContentRect := ARect; + if GetTabPosition = tctpTop then + begin + AContentRect.Top := ATabsRect.Bottom; + ATabRect.Bottom := AContentRect.Top; + end + else + begin + AContentRect.Bottom := ATabsRect.Top; + ATabRect.Top := AContentRect.Bottom; + end; + + ARegion.Combine(TcxRegion.Create(AContentRect), roSet); + ARegion.Combine(TcxRegion.Create(ATabRect), roAdd); +end; + +procedure TdxCustomTabContainerZone.CorrectTabRects(var ATabsRect, ATabRect: TRect); +begin +// do nothing +end; + +{ TdxTabContainerZone } + +constructor TdxTabContainerZone.Create(AControl: TdxTabContainerDockSite); +begin + inherited Create(AControl, 0); +end; + +procedure TdxTabContainerZone.CorrectTabRects(var ATabsRect, ATabRect: TRect); +const + AMinWidth = 10; +begin + if ATabRect.Left < ATabsRect.Left then + begin + ATabRect.Left := ATabsRect.Left; + ATabRect.Right := Max(ATabRect.Right, ATabRect.Left + AMinWidth); + end; + if ATabRect.Right > ATabsRect.Right then + begin + ATabRect.Right := ATabsRect.Right; + ATabRect.Left := Min(ATabRect.Left, ATabRect.Right - AMinWidth); + end; +end; + +function TdxTabContainerZone.GetDockIndex: Integer; +begin + Result := -1; +end; + +function TdxTabContainerZone.GetTabPosition: TdxTabContainerTabsPosition; +begin + Result := TabContainer.TabsPosition; +end; + +function TdxTabContainerZone.GetTabRect(AControl: TdxCustomDockControl): TRect; +var + AIndex: Integer; + ATextWidth: Integer; +begin + if (0 <= DockIndex) and (DockIndex < TdxTabContainerDockSiteAccess(TabContainer).TabRectCount) then + Result := TdxTabContainerDockSiteAccess(TabContainer).TabsRects[DockIndex] + else + begin + AIndex := TdxTabContainerDockSiteAccess(TabContainer).GetLastValidChildIndex; + if AIndex > -1 then + begin + Result := TdxTabContainerDockSiteAccess(TabContainer).TabsRects[AIndex]; + + ATextWidth := TdxTabContainerDockSiteAccess(TabContainer).Canvas.TextWidth(AControl.Caption); + if TdxTabContainerDockSiteAccess(TabContainer).Painter.GetImageWidth > 0 then + Inc(ATextWidth, TdxTabContainerDockSiteAccess(TabContainer).Painter.GetImageWidth); + Result.Left := Result.Right; + Result.Right := Result.Left + ATextWidth; + end + else + Result := Rectangle; + end; +end; + +function TdxTabContainerZone.GetTabsRect: TRect; +begin + Result := TdxTabContainerDockSiteAccess(TabContainer).TabsRect +end; + +procedure TdxTabContainerZone.DrawDockingSelection(DC: HDC; AControl: TdxCustomDockControl; pt: TPoint); +var + PenSize: Integer; + R, TabRect, TabsRect: TRect; +begin + PenSize := SelectionFrameWidth; + R := GetDockingSelection(AControl); + TabRect := GetTabRect(AControl); + TabsRect := GetTabsRect; + if TabRect.Left < TabsRect.Left then + begin + TabRect.Left := TabsRect.Left; + if TabRect.Right < TabsRect.Left + 3 * PenSize then + TabRect.Right := TabRect.Left + 3 * PenSize; + end; + if TabRect.Right > TabsRect.Right then + begin + TabRect.Right := TabsRect.Right; + if TabRect.Left > TabsRect.Right - 3 * PenSize then + TabRect.Left := TabRect.Right - 3 * PenSize; + end; + with R do + if TabContainer.TabsPosition = tctpTop then + begin + PatBlt(DC, Left + PenSize, Bottom - PenSize, Right - Left - PenSize, PenSize, PATINVERT); + PatBlt(DC, Left, Top + TabRect.Bottom, PenSize, Bottom - Top - TabRect.Bottom, PATINVERT); + PatBlt(DC, Left, Top + TabRect.Bottom - PenSize, TabRect.Left, PenSize, PATINVERT); + PatBlt(DC, Left + TabRect.Left, Top + TabRect.Top, PenSize, TabRect.Bottom - TabRect.Top, PATINVERT); + PatBlt(DC, Left + TabRect.Left, Top + TabRect.Top - PenSize, TabRect.Right - TabRect.Left - PenSize, PenSize, PATINVERT); + PatBlt(DC, Left + TabRect.Right - PenSize, Top + TabRect.Top - PenSize, PenSize, TabRect.Bottom - TabRect.Top + PenSize, PATINVERT); + PatBlt(DC, Left + TabRect.Right, Top + TabRect.Bottom - PenSize, Right - Left - TabRect.Right - PenSize, PenSize, PATINVERT); + PatBlt(DC, Right - PenSize, Top + TabRect.Bottom - PenSize, PenSize, Bottom - Top - TabRect.Bottom, PATINVERT); + end + else + begin + PatBlt(DC, Left + PenSize, Top, Right - Left - PenSize, PenSize, PATINVERT); + PatBlt(DC, Left, Top, PenSize, TabRect.Top - PenSize, PATINVERT); + PatBlt(DC, Left, Top + TabRect.Top - PenSize, TabRect.Left, PenSize, PATINVERT); + PatBlt(DC, Left + TabRect.Left, Top + TabRect.Top - PenSize, PenSize, TabRect.Bottom - TabRect.Top, PATINVERT); + PatBlt(DC, Left + TabRect.Left, Top + TabRect.Bottom - PenSize, TabRect.Right - TabRect.Left, PenSize, PATINVERT); + PatBlt(DC, Left + TabRect.Right - PenSize, Top + TabRect.Top - PenSize, PenSize, TabRect.Bottom - TabRect.Top, PATINVERT); + PatBlt(DC, Left + TabRect.Right, Top + TabRect.Top - PenSize, Right - Left - TabRect.Right - PenSize, PenSize, PATINVERT); + PatBlt(DC, Right - PenSize, Top + PenSize, PenSize, TabRect.Top - PenSize, PATINVERT); + end; +end; + +class function TdxTabContainerZone.ValidateDockZone(AOwner, AControl: TdxCustomDockControl): Boolean; +begin + Result := (AOwner = AControl) and (((AOwner is TdxTabContainerDockSite) and + ((AOwner as TdxTabContainerDockSite).ActiveChild <> nil)) or + ((AOwner.TabContainer <> nil) and (AOwner.TabContainer.ActiveChild <> nil))); +end; + +function TdxTabContainerZone.GetTabContainer: TdxTabContainerDockSite; +begin + Result := inherited Owner as TdxTabContainerDockSite; +end; + +{ TdxTabContainerCaptionZone } + +function TdxTabContainerCaptionZone.IsZonePoint(pt: TPoint): Boolean; +begin + pt := TabContainer.ScreenToClient(pt); + Result := TdxCustomDockControlAccess(TabContainer).IsCaptionPoint(pt); +end; + +{ TdxTabContainerTabZone } + +constructor TdxTabContainerTabZone.Create(AControl: TdxTabContainerDockSite; + ADockIndex: Integer); +begin + inherited Create(AControl); + FDockIndex := ADockIndex; +end; + +function TdxTabContainerTabZone.GetDockIndex: Integer; +begin + Result := FDockIndex; +end; + +function TdxTabContainerTabZone.IsZonePoint(pt: TPoint): Boolean; +begin + pt := TabContainer.ScreenToClient(pt); + Result := TdxTabContainerDockSiteAccess(TabContainer).GetTabIndexAtPos(pt) = DockIndex; +end; + +class function TdxTabContainerTabZone.ValidateDockZone(AOwner, AControl: TdxCustomDockControl): Boolean; +begin + Result := (AOwner = AControl) and (AOwner is TdxTabContainerDockSite) and + TdxTabContainerDockSiteAccess(AOwner).HasTabs; +end; + +{ TdxHorizContainerZone } + +function TdxHorizContainerZone.CanResize(StartPoint, EndPoint: TPoint): Boolean; +begin + Result := inherited CanResize(StartPoint, EndPoint); + if Owner.SideContainer <> nil then + Result := Result and TdxSideContainerDockSiteAccess(Owner.SideContainer).CanChildResize(Owner.SideContainerItem, + - (StartPoint.X - EndPoint.X)); +end; + +procedure TdxHorizContainerZone.DoResize(StartPoint, EndPoint: TPoint); +begin + if Owner.SideContainer <> nil then + TdxSideContainerDockSiteAccess(Owner.SideContainer).DoChildResize(Owner.SideContainerItem, + - (StartPoint.X - EndPoint.X)); +end; + +{ TdxVertContainerZone } + +function TdxVertContainerZone.CanResize(StartPoint, EndPoint: TPoint): Boolean; +begin + Result := inherited CanResize(StartPoint, EndPoint); + if Owner.SideContainer <> nil then + Result := Result and TdxSideContainerDockSiteAccess(Owner.SideContainer).CanChildResize(Owner.SideContainerItem, + - (StartPoint.Y - EndPoint.Y)); +end; + +procedure TdxVertContainerZone.DoResize(StartPoint, EndPoint: TPoint); +begin + if Owner.SideContainer <> nil then + TdxSideContainerDockSiteAccess(Owner.SideContainer).DoChildResize(Owner.SideContainerItem, + - (StartPoint.Y - EndPoint.Y)); +end; + +{ TdxDockPanelClientZone } + +constructor TdxDockPanelClientZone.Create(AControl: TdxDockPanel); +begin + inherited Create(AControl, 0); +end; + +procedure TdxDockPanelClientZone.DrawDockingSelection(DC: HDC; AControl: TdxCustomDockControl; pt: TPoint); +var + PenSize: Integer; + R: TRect; + TabRect: TRect; +begin + PenSize := SelectionFrameWidth; + R := GetDockingSelection(AControl); + TabRect := TdxDockPanelAccess(Owner).TabRect; + with R do + if TdxDockPanelAccess(Owner).GetTabPosition = tctpTop then + begin + PatBlt(DC, Left + PenSize, Bottom - PenSize, Right - Left - PenSize, PenSize, PATINVERT); + PatBlt(DC, Left, Top + TabRect.Bottom, PenSize, Bottom - Top - TabRect.Bottom, PATINVERT); + PatBlt(DC, Left, Top + TabRect.Bottom - PenSize, TabRect.Left, PenSize, PATINVERT); + PatBlt(DC, Left + TabRect.Left, Top + TabRect.Top, PenSize, TabRect.Bottom - TabRect.Top, PATINVERT); + PatBlt(DC, Left + TabRect.Left, Top + TabRect.Top - PenSize, TabRect.Right - TabRect.Left - PenSize, PenSize, PATINVERT); + PatBlt(DC, Left + TabRect.Right - PenSize, Top + TabRect.Top - PenSize, PenSize, TabRect.Bottom - TabRect.Top + PenSize, PATINVERT); + PatBlt(DC, Left + TabRect.Right, Top + TabRect.Bottom - PenSize, Right - Left - TabRect.Right - PenSize, PenSize, PATINVERT); + PatBlt(DC, Right - PenSize, Top + TabRect.Bottom - PenSize, PenSize, Bottom - Top - TabRect.Bottom, PATINVERT); + end + else + begin + PatBlt(DC, Left + PenSize, Top, Right - Left - PenSize, PenSize, PATINVERT); + PatBlt(DC, Left, Top, PenSize, TabRect.Top - PenSize, PATINVERT); + PatBlt(DC, Left, Top + TabRect.Top - PenSize, TabRect.Left, PenSize, PATINVERT); + PatBlt(DC, Left + TabRect.Left, Top + TabRect.Top - PenSize, PenSize, TabRect.Bottom - TabRect.Top, PATINVERT); + PatBlt(DC, Left + TabRect.Left, Top + TabRect.Bottom - PenSize, TabRect.Right - TabRect.Left, PenSize, PATINVERT); + PatBlt(DC, Left + TabRect.Right - PenSize, Top + TabRect.Top - PenSize, PenSize, TabRect.Bottom - TabRect.Top, PATINVERT); + PatBlt(DC, Left + TabRect.Right, Top + TabRect.Top - PenSize, Right - Left - TabRect.Right - PenSize, PenSize, PATINVERT); + PatBlt(DC, Right - PenSize, Top + PenSize, PenSize, TabRect.Top - PenSize, PATINVERT); + end; +end; + +function TdxDockPanelClientZone.GetTabPosition: TdxTabContainerTabsPosition; +begin + Result := TdxDockPanelAccess(Owner).GetTabPosition; +end; + +function TdxDockPanelClientZone.GetTabRect(AControl: TdxCustomDockControl): TRect; +begin + Result := TdxDockPanelAccess(Owner).TabRect; +end; + +function TdxDockPanelClientZone.GetTabsRect: TRect; +begin + Result := TdxDockPanelAccess(Owner).TabsRect; +end; + +function TdxDockPanelClientZone.GetDockPanel: TdxDockPanel; +begin + Result := inherited Owner as TdxDockPanel; +end; + +{ TdxDockPanelCaptionClientZone } + +function TdxDockPanelCaptionClientZone.IsZonePoint(pt: TPoint): Boolean; +begin + pt := DockPanel.ScreenToClient(pt); + Result := TdxCustomDockControlAccess(DockPanel).IsCaptionPoint(pt); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Help/ExpressEditors.cnt b/official/x.35/ExpressEditors Library 5/Help/ExpressEditors.cnt new file mode 100644 index 00000000..08691bd1 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Help/ExpressEditors.cnt @@ -0,0 +1,425 @@ +:Base ExpressEditors.hlp +:Title ExpressEditors 6 +:Index ExpressEditors 6=ExpressEditors.hlp +1 ExpressEditors 6 +2 Known Issues and Important Changes List=CD_Known_Issues_and_Important_Changes_List +2 Base Concepts +3 Edit Repository Items=IDH_bc_Edit_Repository_Items +3 Editor Properties=IDH_BC_Editor_Properties +3 Editor Style and StyleController=IDH_BC_Editor_Style_and_StyleController +3 Mask Editors +4 Using the MaskEdit=IDH_bc_Using_MaskEdit +4 Using Regular Expressions=IDH_bc_Using_Regular_Expressions +3 Rich Editors +4 OLE support with rich edit controls=CD_OLE_support_with_rich_edit_controls +3 TcxHintStyleController +4 Hints Time Intervals=IDH_Custom_HintsTimeIntervals +2 Resource Strings +3 Resource Strings=IDH_CD_list_of_resource_strings +3 Express Editors: Resource Strings=IDH_CD_Express_Editors_Resource_Strings +2 Task Based Help +3 Using Lookup Editors=IDH_tbh_Using_lookup_editors +3 Using the SmartTextToDate Function=IDH_tbh_Using_SmartTextToDate_Function +3 TcxColorComboBox +4 Creating Custom Color Editing Dialogs=IDH_Custom_CreatingCustomColorEditingDialogs +3 TcxMCListBox +4 Populating a Multi Column ListBox with Items=IDH_Custom_PopulatingMultiColumnListBoxItems +4 Working with Selections=Working_with_Selections +3 TcxSplitter +4 Using TcxSplitter=Using_TcxSplitter +4 Creating a Custom Hot Zone Style=IDH_Custom_CreatingCustomHotZoneStyle +3 TcxTreeView +4 Expanding and Collapsing Tree View Nodes=IDH_Custom_ExpandingCollapsingTreeViewNodes +4 Selecting Tree View Nodes=IDH_Custom_SelectingTreeViewNodes +4 Displaying Images within Tree View Nodes=IDH_Custom_DisplayingImagesWithinTreeViewNodes +4 Allowing End Users to Edit Tree Node Captions=IDH_Custom_AllowingEndUsersEditTreeNodeCaptions +4 Saving and Restoring Tree Nodes Structure=IDH_Custom_SavingRestoringTreeNodesStructure +2 Reference +3 Units +4 cxBlobEdit Unit Overview=IDH_Unit_cxBlobEdit +4 cxButtonEdit Unit Overview=IDH_Unit_cxButtonEdit +4 cxButtons Unit Overview=IDH_Unit_cxButtons +4 cxCalc Unit Overview=IDH_Unit_cxCalc +4 cxCalendar Unit Overview=IDH_Unit_cxCalendar +4 cxCheckBox Unit Overview=IDH_Unit_cxCheckBox +4 cxCheckComboBox Unit Overview=IDH_Unit_cxCheckComboBox +4 cxCheckGroup Unit Overview=IDH_Unit_cxCheckGroup +4 cxCheckListBox Unit Overview=IDH_Unit_cxCheckListBox +4 cxColorComboBox Unit Overview=IDH_Unit_cxColorComboBox +4 cxCurrencyEdit Unit Overview=IDH_Unit_cxCurrencyEdit +4 cxDateUtils Unit Overview=IDH_Unit_cxDateUtils +4 cxDBCheckComboBox Unit Overview=IDH_Unit_cxDBCheckComboBox +4 cxDBCheckListBox Unit Overview=IDH_Unit_cxDBCheckListBox +4 cxDBColorComboBox Unit Overview=IDH_Unit_cxDBColorComboBox +4 cxDBEdit Unit Overview=IDH_Unit_cxDBEdit +4 cxDBEditRepository Unit Overview=IDH_Unit_cxDBEditRepository +4 cxDBLookupComboBox Unit Overview=IDH_Unit_cxDBLookupComboBox +4 cxDBExtLookupComboBox Unit Overview=IDH_Unit_cxDBExtLookupComboBox +4 cxDBFontNameComboBox Unit Overview=IDH_Unit_cxDBFontNameComboBox +4 cxDBLabel Unit Overview=IDH_Unit_cxDBLabel +4 cxDBLookupEdit Unit Overview=IDH_Unit_cxDBLookupEdit +4 cxDBProgressBar Unit Overview=IDH_Unit_cxDBProgressBar +4 cxDBRichEdit Unit Overview=IDH_Unit_cxDBRichEdit +4 cxDBShellComboBox Unit Overview=IDH_Unit_cxDBShellComboBox +4 cxDBTrackBar Unit Overview=IDH_Unit_cxDBTrackBar +4 cxDropDownEdit Unit Overview=IDH_Unit_cxDropDownEdit +4 cxEdit Unit Overview=IDH_Unit_cxEdit +4 cxEditRepositoryItems Unit Overview=IDH_Unit_cxEditRepositoryItems +4 cxExtEditRepositoryItems Unit Overview=IDH_Unit_cxExtEditRepositoryItems +4 cxFontNameComboBox Unit Overview=IDH_Unit_cxFontNameComboBox +4 cxFormats Unit Overview=IDH_Unit_cxFormats +4 cxGroupBox Unit Overview=IDH_Unit_cxGroupBox +4 cxHeader Unit Overview=IDH_Unit_cxHeader +4 cxHint Unit Overview=IDH_Unit_cxHint +4 cxHyperLinkEdit Unit Overview=IDH_Unit_cxHyperLinkEdit +4 cxImage Unit Overview=IDH_Unit_cxImage +4 cxImageComboBox Unit Overview=IDH_Unit_cxImageComboBox +4 cxInplaceContainer Unit Overview=IDH_Unit_cxInplaceContainer +4 cxLabel Unit Overview=IDH_Unit_cxLabel +4 cxListBox Unit Overview=IDH_Unit_cxListBox +4 cxListView Unit Overview=IDH_Unit_cxListView +4 cxLookupDBGrid Unit Overview=IDH_Unit_cxLookupDBGrid +4 cxLookupEdit Unit Overview=IDH_Unit_cxLookupEdit +4 cxLookupGrid Unit Overview=IDH_Unit_cxLookupGrid +4 cxMaskEdit Unit Overview=IDH_Unit_cxMaskEdit +4 cxMCListBox Unit Overview=IDH_Unit_cxMCListBox +4 cxMemo Unit Overview=IDH_Unit_cxMemo +4 cxMRUEdit Unit Overview=IDH_Unit_cxMRUEdit +4 cxNavigator Unit Overview=IDH_Unit_cxNavigator +4 cxProgressBar Unit Overview=IDH_Unit_cxProgressBar +4 cxRadioGroup Unit Overview=IDH_Unit_cxRadioGroup +4 cxRichEdit Unit Overview=IDH_Unit_cxRichEdit +4 cxShellBrowserDialog Unit Overview=IDH_Unit_cxShellBrowserDialog +4 cxShellComboBox Unit Overview=IDH_Unit_cxShellComboBox +4 cxShellCommon Unit Overview=IDH_Unit_cxShellCommon +4 cxShellDlgs Unit Overview=IDH_Unit_cxShellDlgs +4 cxShellListView Unit Overview=IDH_Unit_cxShellListView +4 cxShellTreeView Unit Overview=IDH_Unit_cxShellTreeView +4 cxSpinButton Unit Overview=IDH_Unit_cxSpinButton +4 cxSpinEdit Unit Overview=IDH_Unit_cxSpinEdit +4 cxSplitter Unit Overview=IDH_Unit_cxSplitter +4 cxTextEdit Unit Overview=IDH_Unit_cxTextEdit +4 cxTimeEdit Unit Overview=IDH_Unit_cxTimeEdit +4 cxTrackBar Unit Overview=IDH_Unit_cxTrackBar +4 cxTreeView Unit Overview=IDH_Unit_cxTreeView +3 Editors +4 TcxBlobEdit=IDH_Class_TcxBlobEdit +4 TcxButton=IDH_Class_TcxButton +4 TcxButtonEdit=IDH_Class_TcxButtonEdit +4 TcxCalcEdit=IDH_Class_TcxCalcEdit +4 TcxCheckBox=IDH_Class_TcxCheckBox +4 TcxCheckComboBox=IDH_Class_TcxCheckComboBox +4 TcxCheckGroup=IDH_Class_TcxCheckGroup +4 TcxCheckListBox=IDH_Class_TcxCheckListBox +4 TcxColorComboBox=IDH_Class_TcxColorComboBox +4 TcxComboBox=IDH_Class_TcxComboBox +4 TcxCurrencyEdit=IDH_Class_TcxCurrencyEdit +4 TcxDateEdit=IDH_Class_TcxDateEdit +4 TcxExtLookupComboBox=IDH_Class_TcxExtLookupComboBox +4 TcxFontNameComboBox=IDH_Class_TcxFontNameComboBox +4 TcxGroupBox=IDH_Class_TcxGroupBox +4 TcxHyperLinkEdit=IDH_Class_TcxHyperLinkEdit +4 TcxImage=IDH_Class_TcxImage +4 TcxImageComboBox=IDH_Class_TcxImageComboBox +4 TcxLabel=IDH_Class_TcxLabel +4 TcxListBox=IDH_Class_TcxListBox +4 TcxLookupComboBox=IDH_Class_TcxLookupComboBox +4 TcxMaskEdit=IDH_Class_TcxMaskEdit +4 TcxMemo=IDH_Class_TcxMemo +4 TcxMRUEdit=IDH_Class_TcxMRUEdit +4 TcxNavigator=IDH_Class_TcxNavigator +4 TcxPopupEdit=IDH_Class_TcxPopupEdit +4 TcxProgressBar=IDH_Class_TcxProgressBar +4 TcxRadioButton=IDH_Class_TcxRadioButton +4 TcxRadioGroup=IDH_Class_TcxRadioGroup +4 TcxRichEdit=IDH_Class_TcxRichEdit +4 TcxShellComboBox=IDH_Class_TcxShellComboBox +4 TcxSpinEdit=IDH_Class_TcxSpinEdit +4 TcxTextEdit=IDH_Class_TcxTextEdit +4 TcxTimeEdit=IDH_Class_TcxTimeEdit +4 TcxTrackBar=IDH_Class_TcxTrackBar +3 Data-Aware Editors +4 TcxDBBlobEdit=IDH_Class_TcxDBBlobEdit +4 TcxDBButtonEdit=IDH_Class_TcxDBButtonEdit +4 TcxDBCalcEdit=IDH_Class_TcxDBCalcEdit +4 TcxDBCheckBox=IDH_Class_TcxDBCheckBox +4 TcxDBCheckComboBox=IDH_Class_TcxDBCheckComboBox +4 TcxDBCheckGroup=IDH_Class_TcxDBCheckGroup +4 TcxDBCheckListBox=IDH_Class_TcxDBCheckListBox +4 TcxDBColorComboBox=IDH_Class_TcxDBColorComboBox +4 TcxDBComboBox=IDH_Class_TcxDBComboBox +4 TcxDBCurrencyEdit=IDH_Class_TcxDBCurrencyEdit +4 TcxDBDateEdit=IDH_Class_TcxDBDateEdit +4 TcxDBExtLookupComboBox=IDH_Class_TcxDBExtLookupComboBox +4 TcxDBFontNameComboBox=IDH_Class_TcxDBFontNameComboBox +4 TcxDBHyperLinkEdit=IDH_Class_TcxDBHyperLinkEdit +4 TcxDBImage=IDH_Class_TcxDBImage +4 TcxDBImageComboBox=IDH_Class_TcxDBImageComboBox +4 TcxDBLabel=IDH_Class_TcxDBLabel +4 TcxDBListBox=IDH_Class_TcxDBListBox +4 TcxDBLookupComboBox=IDH_Class_TcxDBLookupComboBox +4 TcxDBMaskEdit=IDH_Class_TcxDBMaskEdit +4 TcxDBMemo=IDH_Class_TcxDBMemo +4 TcxDBMRUEdit=IDH_Class_TcxDBMRUEdit +4 TcxDBNavigator=IDH_Class_TcxDBNavigator +4 TcxDBPopupEdit=IDH_Class_TcxDBPopupEdit +4 TcxDBProgressBar=IDH_Class_TcxDBProgressBar +4 TcxDBRadioGroup=IDH_Class_TcxDBRadioGroup +4 TcxDBRichEdit=IDH_Class_TcxDBRichEdit +4 TcxDBShellComboBox=IDH_Class_TcxDBShellComboBox +4 TcxDBSpinEdit=IDH_Class_TcxDBSpinEdit +4 TcxDBTextEdit=IDH_Class_TcxDBTextEdit +4 TcxDBTimeEdit=IDH_Class_TcxDBTimeEdit +4 TcxDBTrackBar=IDH_Class_TcxDBTrackBar +3 Controls +4 TcxEditingControl=IDH_Class_TcxEditingControl +4 TcxExtEditingControl=IDH_Class_TcxExtEditingControl +4 TcxHeader=IDH_Class_TcxHeader +4 TcxListView=IDH_Class_TcxListView +4 TcxMCListBox=IDH_Class_TcxMCListBox +4 TcxShellListView=IDH_Class_TcxShellListView +4 TcxShellTreeView=IDH_Class_TcxShellTreeView +4 TcxSpinButton=IDH_Class_TcxSpinButton +4 TcxSplitter=IDH_Class_TcxSplitter +4 TcxTreeView=IDH_Class_TcxTreeView +3 Components +4 TcxCustomInplaceEditContainer=IDH_Class_TcxCustomInplaceEditContainer +4 TcxDefaultEditStyleController=IDH_Class_TcxDefaultEditStyleController +4 TcxEditStyleController=IDH_Class_TcxEditStyleController +4 TcxEditRepository=IDH_Class_TcxEditRepository +4 TcxHintStyleController=IDH_Class_TcxHintStyleController +4 TcxShellBrowserDialog=IDH_Class_TcxShellBrowserDialog +3 Custom Editors Classes +4 TcxCustomBlobEdit=IDH_Class_TcxCustomBlobEdit +4 TcxCustomButtonEdit=IDH_Class_TcxCustomButtonEdit +4 TcxCustomCalcEdit=IDH_Class_TcxCustomCalcEdit +4 TcxCustomCheckBox=IDH_Class_TcxCustomCheckBox +4 TcxCustomComboBox=IDH_Class_TcxCustomComboBox +4 TcxCustomCurrencyEdit=IDH_Class_TcxCustomCurrencyEdit +4 TcxCustomDateEdit=IDH_Class_TcxCustomDateEdit +4 TcxCustomDBLookupEdit=IDH_Class_TcxCustomDBLookupEdit +4 TcxCustomDBNavigator=IDH_Class_TcxCustomDBNavigator +4 TcxCustomDropDownEdit=IDH_Class_TcxCustomDropDownEdit +4 TcxCustomEdit=IDH_Class_TcxCustomEdit +4 TcxCustomExtLookupComboBox=IDH_Class_TcxCustomExtLookupComboBox +4 TcxCustomFontNameComboBox=IDH_Class_TcxCustomFontNameComboBox +4 TcxCustomGroupBox=IDH_Class_TcxCustomGroupBox +4 TcxCustomHyperLinkEdit=IDH_Class_TcxCustomHyperLinkEdit +4 TcxCustomImage=IDH_Class_TcxCustomImage +4 TcxCustomImageComboBox=IDH_Class_TcxCustomImageComboBox +4 TcxCustomLookupComboBox=IDH_Class_TcxCustomLookupComboBox +4 TcxCustomLookupEdit=IDH_Class_TcxCustomLookupEdit +4 TcxCustomMaskEdit=IDH_Class_TcxCustomMaskEdit +4 TcxCustomMemo=IDH_Class_TcxCustomMemo +4 TcxCustomMRUEdit=IDH_Class_TcxCustomMRUEdit +4 TcxCustomPopupEdit=IDH_Class_TcxCustomPopupEdit +4 TcxCustomProgressBar=IDH_Class_TcxCustomProgressBar +4 TcxCustomRadioGroup=IDH_Class_TcxCustomRadioGroup +4 TcxCustomRichEdit=IDH_Class_TcxCustomRichEdit +4 TcxCustomShellComboBox=IDH_Class_TcxCustomShellComboBox +4 TcxCustomShellTreeView=IDH_Class_TcxCustomShellTreeView +4 TcxCustomSpinEdit=IDH_Class_TcxCustomSpinEdit +4 TcxCustomTextEdit=IDH_Class_TcxCustomTextEdit +4 TcxCustomTimeEdit=IDH_Class_TcxCustomTimeEdit +4 TcxCustomTrackBar=IDH_Class_TcxCustomTrackBar +3 Styles +4 TcxCustomEditStyle=IDH_Class_TcxCustomEditStyle +4 TcxCustomHintStyle=IDH_Class_TcxCustomHintStyle +4 TcxEditContainerStyles=IDH_Class_TcxEditContainerStyles +4 TcxEditStyle=IDH_Class_TcxEditStyle +4 TcxEditStyleController=IDH_Class_TcxEditStyleController +4 TcxEditStyleEx=IDH_Class_TcxEditStyleEx +4 TcxHotZoneStyle=IDH_Class_TcxHotZoneStyle +4 TcxMediaPlayer8Style=IDH_Class_TcxMediaPlayer8Style +4 TcxMediaPlayer9Style=IDH_Class_TcxMediaPlayer9Style +4 TcxSimpleStyle=IDH_Class_TcxSimpleStyle +4 TcxXPTaskBarStyle=IDH_Class_TcxXPTaskBarStyle +3 Editors Repository +4 TcxEditRepository=IDH_Class_TcxEditRepository +4 TcxEditRepositoryBlobItem=IDH_Class_TcxEditRepositoryBlobItem +4 TcxEditRepositoryButtonItem=IDH_Class_TcxEditRepositoryButtonItem +4 TcxEditRepositoryCalcItem=IDH_Class_TcxEditRepositoryCalcItem +4 TcxEditRepositoryCheckBoxItem=IDH_Class_TcxEditRepositoryCheckBoxItem +4 TcxEditRepositoryCheckComboBox=IDH_Class_TcxEditRepositoryCheckComboBox +4 TcxEditRepositoryColorComboBox=IDH_Class_TcxEditRepositoryColorComboBox +4 TcxEditRepositoryComboBoxItem=IDH_Class_TcxEditRepositoryComboBoxItem +4 TcxEditRepositoryCurrencyItem=IDH_Class_TcxEditRepositoryCurrencyItem +4 TcxEditRepositoryExtLookupComboBoxItem=IDH_Class_TcxEditRepositoryExtLookupComboBoxItem +4 TcxEditRepositoryFontNameComboBox=IDH_Class_TcxEditRepositoryFontNameComboBox +4 TcxEditRepositoryDateItem=IDH_Class_TcxEditRepositoryDateItem +4 TcxEditRepositoryHyperLinkItem=IDH_Class_TcxEditRepositoryHyperLinkItem +4 TcxEditRepositoryImageComboBoxItem=IDH_Class_TcxEditRepositoryImageComboBoxItem +4 TcxEditRepositoryImageItem=IDH_Class_TcxEditRepositoryImageItem +4 TcxEditRepositoryItem=IDH_Class_TcxEditRepositoryItem +4 TcxEditRepositoryLabel=IDH_Class_TcxEditRepositoryLabel +4 TcxEditRepositoryLookupComboBoxItem=IDH_Class_TcxEditRepositoryLookupComboBoxItem +4 TcxEditRepositoryMaskItem=IDH_Class_TcxEditRepositoryMaskItem +4 TcxEditRepositoryMemoItem=IDH_Class_TcxEditRepositoryMemoItem +4 TcxEditRepositoryMRUItem=IDH_Class_TcxEditRepositoryMRUItem +4 TcxEditRepositoryPopupItem=IDH_Class_TcxEditRepositoryPopupItem +4 TcxEditRepositoryProgressBar=IDH_Class_TcxEditRepositoryProgressBar +4 TcxEditRepositoryRadioGroupItem=IDH_Class_TcxEditRepositoryRadioGroupItem +4 TcxEditRepositoryRichItem=IDH_Class_TcxEditRepositoryRichItem +4 TcxEditRepositorySpinButton=IDH_Class_TcxEditRepositorySpinButton +4 TcxEditRepositorySpinItem=IDH_Class_TcxEditRepositorySpinItem +4 TcxEditRepositoryTextItem=IDH_Class_TcxEditRepositoryTextItem +4 TcxEditRepositoryTimeItem=IDH_Class_TcxEditRepositoryTimeItem +4 TcxEditRepositoryTrackBar=IDH_Class_TcxEditRepositoryTrackBar +3 Types +4 TBeforeCloseHotZoneEvent=IDH_TcxCustomSplitter_OnBeforeClose +4 TBeforeOpenHotZoneEvent=IDH_TcxCustomSplitter_OnBeforeOpen +4 TCaptionChar=IDH_TcxCustomTextEditProperties_PasswordChar +4 TcxAlignment=IDH_TcxCustomGroupBox_Alignment +4 TcxBeforeNavigationEvent=IDH_TcxCustomShellListView_OnBeforeNavigation +4 TcxBlobEditKind=IDH_TcxCustomBlobEditProperties_BlobEditKind +4 TcxBlobPaintStyle=IDH_TcxCustomBlobEditProperties_BlobPaintStyle +4 TcxBorder=IDH_TcxCustomEditStyle_Edges +4 TcxBrowseFolder=IDH_Type_TcxBrowseFolder +4 TcxButtonDropDownMenuPopupEvent=IDH_TcxCustomButton_OnDropDownMenuPopup +4 TcxButtonKind=IDH_TcxCustomButton_Kind +4 TcxButtonAssignedColor=IDH_TcxButtonColors_AssignedColors +4 TcxButtonAssignedColors=IDH_TcxButtonColors_AssignedColors +4 TcxCalcButtonClick=IDH_TcxCustomCalculator_OnButtonClick +4 TcxCalcButtonKind=IDH_Type_TcxCalcButtonKind +4 TcxCalendarKind=IDH_TcxCustomDateEditProperties_Kind +4 TcxCallOutPosition=IDH_TcxCustomHintStyle_CallOutPosition +4 TcxCheckBoxNullValueShowingStyle=IDH_Type_TcxCheckBoxNullValueShowingStyle +4 TcxCheckStates=IDH_Type_TcxCheckStates +4 TcxCheckStatesToValueEvent=IDH_TcxCustomCheckComboBoxProperties_OnStatesToEditValue +4 TcxCheckStatesValueFormat=IDH_Type_TcxCheckStatesValueFormat +4 TcxClickCheckEvent=IDH_TcxCustomCheckListBox_OnClickCheck +4 TcxColorBoxAlign=IDH_TcxCustomColorComboBoxProperties_ColorBoxAlign +4 TcxColorComboStyle=IDH_TcxCustomColorComboBoxProperties_ColorComboStyle +4 TcxColorDialogType=IDH_TcxCustomColorComboBoxProperties_ColorDialogType +4 TcxColorNamingConvention=IDH_TcxCustomColorComboBoxProperties_NamingConvention +4 TcxColorPrepareList=IDH_TcxCustomColorComboBoxProperties_PrepareList +4 TcxColorValueFormat=IDH_TcxCustomColorComboBoxProperties_ColorValueFormat +4 TcxCurrentFolderChangedEvent=IDH_TcxCustomShellListView_OnCurrentFolderChanged +4 TcxCustomDrawSectionEvent=IDH_TcxCustomHeader_OnDrawSection +4 TcxCustomRadioGroupButtonClass=IDH_Type_TcxCustomRadioGroupButtonClass +4 TcxCustomSectionNotifyEvent=IDH_TcxCustomHeader_OnSectionClick +4 TcxDataSortOrder=IDH_TcxLookupGridColumn_SortOrder +4 TcxDateElement=IDH_Type_TcxDateElement +4 TcxDBRichEditDataBinding=IDH_TcxDBRichEdit_DataBinding +4 TcxDefaultColorStyle=IDH_TcxCustomColorComboBoxProperties_DefaultColorStyle +4 TcxDrawThumbEvent=IDH_TcxCustomTrackBarProperties_OnDrawThumb +4 TcxEditAlignment=IDH_Class_TcxEditAlignment +4 TcxEditBorderStyle=IDH_Type_TcxEditBorderStyle +4 TcxEditButtonKind=IDH_Type_TcxEditButtonKind +4 TcxEditButtonStyle=IDH_Type_TcxEditButtonStyle +4 TcxEditButtonsViewStyle=IDH_Type_TcxEditButtonsViewStyle +4 TcxEditButtonTransparency=IDH_Type_TcxEditButtonTransparency +4 TcxEditDrawItemEvent=IDH_TcxCustomComboBoxProperties_OnDrawItem +4 TcxEditDropDownListStyle=IDH_Type_TcxEditDropDownListStyle +4 TcxEditEchoMode=IDH_TcxCustomTextEditProperties_EchoMode +4 TcxEditButtonClickEvent=IDH_TcxCustomEditProperties_OnButtonClick +4 TcxEditEditingEvent=IDH_TcxCustomEdit_OnEditing +4 TcxEditHorzAlignment=IDH_Type_TcxEditHorzAlignment +4 TcxEditMask=IDH_Type_TcxEditMask +4 TcxEditMaskKind=IDH_Type_TcxEditMaskKind +4 TcxEditPopupBorderStyle=IDH_Type_TcxEditPopupBorderStyle +4 TcxEditRepositoryItemClass=IDH_Type_TcxEditRepositoryItemClass +4 TcxEditSizeProperties=IDH_Type_TcxEditSizeProperties +4 TcxEditStyleValue=IDH_Type_TcxEditStyleValue +4 TcxEditStyleValues=IDH_Type_TcxEditStyleValues +4 TcxEditValidateEvent=IDH_Type_TcxEditValidateEvent +4 TcxEditValue=IDH_Type_TcxEditValue +4 TcxEditVertAlignment=IDH_Type_TcxEditVertAlignment +4 TcxGetDefaultColorEvent=IDH_TcxCustomColorComboBoxProperties_OnGetDefaultColor +4 TcxFontButtonType=IDH_TcxFontPreview_OnButtonClick +4 TcxFontPreviewType=IDH_TcxFontPreview_PreviewType +4 TcxFontType=IDH_TcxCustomFontNameComboBoxProperties_FontTypes +4 TcxGetThumbRectEvent=IDH_TcxCustomTrackBarProperties_OnGetThumbRect +4 TcxGridLines=IDH_TcxLookupGridOptions_GridLines +4 TcxHeaderSortOrder=IDH_Type_TcxHeaderSortOrder +4 TcxHintAnimate=IDH_TcxCustomHintStyle_Animate +4 TcxHintAnimationDelay=IDH_TcxCustomHintStyle_AnimationDelay +4 TcxHintIconSize=IDH_TcxCustomHintStyle_IconSize +4 TcxHintIconType=IDH_TcxCustomHintStyle_IconType +4 TcxHintStyleChangedEvent=IDH_TcxCustomHintStyleController_OnHintStyleChanged +4 TcxHotZoneStyleClass=IDH_TcxCustomSplitter_HotZoneStyleClass +4 TcxImageAlign=IDH_TcxCustomImageComboBoxProperties_ImageAlign +4 TcxImageAssignPictureEvent=IDH_TcxCustomBlobEditProperties_OnAssignPicture +4 TcxImageEditGraphicClassEvent=IDH_TcxCustomBlobEdit_OnGetGraphicClass +4 TcxImageGraphicClassEvent=IDH_TcxCustomBlobEditProperties_OnGetGraphicClass +4 TcxImageTransparency=IDH_TcxCustomBlobEditProperties_PictureTransparency +4 TcxInputKind=IDH_TcxCustomDateEditProperties_InputKind +4 TcxLabelEffect=IDH_TcxCustomLabelProperties_LabelEffect +4 TcxLabelOrientation=IDH_TcxCustomLabelProperties_Orientation +4 TcxLabelStyle=IDH_TcxCustomLabelProperties_LabelStyle +4 TcxMouseButton=IDH_TcxCustomEdit_RefreshEdit +4 TcxNaturalNumber=IDH_TcxCustomProgressBarProperties_PeakSize +4 TcxNavigatorButtonClickEvent=IDH_TcxCustomNavigatorButtons_OnButtonClick +4 TcxOnNamingConventionEvent=IDH_TcxCustomColorComboBoxProperties_OnNamingConvention +4 TcxOnSelectCustomColorEvent=IDH_TcxCustomColorComboBoxProperties_OnSelectCustomColor +4 TcxPanelOffice11BackgroundKind=IDH_TcxPanelStyle_OfficeBackgroundKind>Main +4 TcxPanelStyle=IDH_Class_TcxPanelStyle>Main +4 TcxPopupMenuItem=IDH_TcxPopupMenuLayout_MenuItems +4 TcxPopupShellTreeViewOption=IDH_TcxCustomShellComboBoxProperties_TreeViewOptions +4 TcxPositionAfterOpen=IDH_TcxCustomSplitter_PositionAfterOpen +4 TcxProgressBarBarStyle=IDH_TcxCustomProgressBarProperties_BarStyle +4 TcxProgressBarBevelOuter=IDH_TcxCustomProgressBarProperties_BarBevelOuter +4 TcxProgressBarOrientation=IDH_TcxCustomProgressBarProperties_Orientation +4 TcxProgressBarTextStyle=IDH_TcxCustomProgressBarProperties_ShowTextStyle +4 TcxSectionChangedSortOrderEvent=IDH_TcxCustomHeader_OnSectionChangedSortOrder +4 TcxSectionChangingSortOrderEvent=IDH_TcxCustomHeader_OnSectionChangingSortOrder +4 TcxSectionDragEvent=IDH_TcxCustomHeader_OnSectionDrag +4 TcxSectionTrackState=IDH_TcxCustomHeader_OnSectionTrack +4 TcxShellComboBoxShowFullPath=IDH_TcxCustomShellComboBoxProperties_ShowFullPath +4 TcxShellComboBoxViewOption=IDH_TcxCustomShellComboBoxProperties_ViewOptions +4 TcxShellFolder=IDH_Class_TcxShellFolder +4 TcxShowFontIconType=IDH_TcxCustomFontNameComboBoxProperties_ShowFontTypeIcon +4 TcxSpinEditButtons=IDH_Class_TcxSpinEditButtons +4 TcxSpinEditGetValueEvent=IDH_TcxCustomSpinEditProperties_OnGetValue +4 TcxSpinEditValueType=IDH_Type_TcxSpinEditValueType +4 TcxSplitterAlign=IDH_TcxCustomSplitter_AlignSplitter +4 TcxSplitterDirection=IDH_TcxHotZoneStyle_SplitterDirection +4 TcxSplitterState=IDH_TcxCustomSplitter_State +4 TcxStyleChangedEvent=IDH_TcxEditStyleController_OnStyleChanged +4 TcxTextEditChars=IDH_TcxCustomTextEditProperties_ValidChars +4 TcxTextEditViewStyle=IDH_TcxCustomTextEditProperties_ViewStyle +4 TcxTimeEditTimeFormat=IDH_Type_TcxTimeEditTimeFormat +4 TcxTrackBarOrientation=IDH_TcxCustomTrackBarProperties_Orientation +4 TcxTrackBarTextOrientation=IDH_TcxCustomTrackBarProperties_TextOrientation +4 TcxTrackBarThumbType=IDH_TcxCustomTrackBarProperties_ThumbType +4 TcxTrackBarTickMarks=IDH_TcxCustomTrackBarProperties_TickMarks +4 TcxTrackBarTickType=IDH_TcxCustomTrackBarProperties_TickType +4 TcxValueToCheckStatesEvent=IDH_TcxCustomCheckComboBoxProperties_OnEditValueToStates +4 TDayOfWeek=IDH_TcxFormatController_StartOfWeek +3 Constants +4 BtnCaptions constant=IDH_Const_BtnCaptions +4 cxShellObjectInternalAbsoluteVirtualPathPrefix constant=IDH_Const_cxShellObjectInternalAbsoluteVirtualPathPrefix +4 cxShellObjectInternalRelativeVirtualPathPrefix constant=IDH_Const_cxShellObjectInternalRelativeVirtualPathPrefix +4 Express Editors: Resource Strings=IDH_CD_Express_Editors_Resource_Strings +4 imgBlobImages variable=IDH_Var_imgBlobImages +4 NullDate constant=IDH_Const_NullDate +4 SBlobButtonCancel variable=IDH_Var_SBlobButtonCancel +4 SBlobButtonClose variable=IDH_Var_SBlobButtonClose +4 SBlobButtonOK variable=IDH_Var_SBlobButtonOK +4 scxGridDatePopupClear constant=IDH_Const_scxGridDatePopupClear +4 scxGridDatePopupToday constant=IDH_Const_scxGridDatePopupToday +4 SmartTextToDateFunc constant=IDH_Const_SmartTextToDateFunc +3 Routines +4 CalculateCheckStates=IDH_CalculateCheckStates +4 CalculateCheckStatesValue=IDH_CalculateCheckStatesValue +4 ChangeMonth=IDH_cxDateUtils_ChangeMonth +4 CheckDay=IDH_cxDateUtils_CheckDay +4 cxFormatController=IDH_cxFormats_cxFormatController +4 DateOf=IDH_cxDateUtils_DateOf +4 DateTimeToText=IDH_cxDateUtils_DateTimeToText +4 DateTimeToTextEx=IDH_cxDateUtils_DateTimeToTextEx +4 DaysPerMonth=IDH_cxDateUtils_DaysPerMonth +4 DecMonth=IDH_cxDateUtils_DecMonth +4 GetDateElement=IDH_cxDateUtils_GetDateElement +4 GetDateRegularExpession=IDH_cxDateUtils_GetDateRegularExpession +4 GetGraphicClassByName=IDH_GetGraphicClassByName +4 GetRegisteredGraphicClasses=IDH_GetRegisteredGraphicClasses +4 GetPidlName=IDH_cxShellCommon_GetPidlName +4 IncMonth=IDH_cxDateUtils_IncMonth +4 IsLeapYear=IDH_cxDateUtils_IsLeapYear +4 RegisterGraphicClass=IDH_RegisterGraphicClass +4 SmartTextToDate=IDH_cxDateUtils_SmartTextToDate +4 StrToDateDef=IDH_cxDateUtils_StrToDateDef +4 TextToDateEx=IDH_cxDateUtils_TextToDateEx +4 TimeOf=IDH_cxDateUtils_TimeOf +4 UnRegisterGraphicClass=IDH_UnRegisterGraphicClass diff --git a/official/x.35/ExpressEditors Library 5/Help/ExpressEditors.hlp b/official/x.35/ExpressEditors Library 5/Help/ExpressEditors.hlp new file mode 100644 index 00000000..589d3e7a Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Help/ExpressEditors.hlp differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC10.bpk b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC10.bpk new file mode 100644 index 00000000..0d0f542a --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC10.bpk @@ -0,0 +1,219 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = cxEditorsC10.bpl +OBJFILES = cxEditorsC10.obj cxBlobEdit.obj \ + cxButtonEdit.obj cxButtons.obj \ + cxCalc.obj cxCalendar.obj \ + cxCheckBox.obj cxCurrencyEdit.obj \ + cxDBEdit.obj \ + cxDBEditRepository.obj cxDBLookupEdit.obj \ + cxDropDownEdit.obj cxEdit.obj \ + cxEditConsts.obj \ + cxEditDataRegisteredRepositoryItems.obj \ + cxEditDBRegisteredRepositoryItems.obj \ + cxEditPaintUtils.obj cxDBNavigator.obj cxDBFilterControl.obj \ + cxEditRepositoryItems.obj cxEditUtils.obj \ + cxHyperLinkEdit.obj \ + cxImage.obj cxImageComboBox.obj \ + cxLookupDBGrid.obj cxLookupEdit.obj \ + cxLookupGrid.obj cxMaskEdit.obj cxGroupBox.obj \ + cxMemo.obj cxMRUEdit.obj cxDBLookupComboBox.obj \ + cxRegExpr.obj cxSpinEdit.obj \ + cxStandardMask.obj cxTextEdit.obj \ + cxTimeEdit.obj cxEditMaskEditor.obj cxListBox.obj \ + cxEditRegisteredRepositoryItems.obj cxPropertiesConverters.obj \ + cxRadioGroup.obj cxFilterControlDialog.obj cxNavigator.obj \ + cxFilterControl.obj cxFilterControlUtils.obj cxFilterControlStrs.obj \ + cxInplaceContainer.obj +RESFILES = cxEditorsC10.res +MAINSOURCE = cxEditorsC10.cpp +RESDEPEN = $(RESFILES) cxEditMaskEditor.dfm cxFilterControlDialog.dfm cxEdit.res cxScrollCursors.res +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = cxLibraryC10.bpi cxDataC10.bpi dxGDIPlusC10.bpi dxThemeC10.bpi rtl.bpi vcl.bpi vcljpg.bpi \ + dbrtl.bpi vcldb.bpi +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib vcljpg.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressEditors Library 5 by Developer Express Inc." -aa \ + -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC10.cpp b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC10.cpp new file mode 100644 index 00000000..377e1294 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC10.cpp @@ -0,0 +1,74 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxEditorsC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEPACKAGE("dxGDIPlusC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEPACKAGE("vcljpg.bpi"); +USEPACKAGE("Vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEUNIT("cxBlobEdit.pas"); +USEUNIT("cxButtonEdit.pas"); +USEUNIT("cxButtons.pas"); +USEUNIT("cxCalc.pas"); +USEUNIT("cxCalendar.pas"); +USEUNIT("cxCheckBox.pas"); +USEUNIT("cxCurrencyEdit.pas"); +USEUNIT("cxDBEdit.pas"); +USEUNIT("cxDBEditRepository.pas"); +USEUNIT("cxDBLookupEdit.pas"); +USEUNIT("cxDropDownEdit.pas"); +USEUNIT("cxEdit.pas"); +USEUNIT("cxEditConsts.pas"); +USEUNIT("cxEditDataRegisteredRepositoryItems.pas"); +USEUNIT("cxEditDBRegisteredRepositoryItems.pas"); +USEUNIT("cxEditPaintUtils.pas"); +USEUNIT("cxEditRepositoryItems.pas"); +USEUNIT("cxEditUtils.pas"); +USEUNIT("cxHyperLinkEdit.pas"); +USEUNIT("cxImage.pas"); +USEUNIT("cxImageComboBox.pas"); +USEUNIT("cxLookupDBGrid.pas"); +USEUNIT("cxLookupEdit.pas"); +USEUNIT("cxLookupGrid.pas"); +USEUNIT("cxMaskEdit.pas"); +USEUNIT("cxMemo.pas"); +USEUNIT("cxMRUEdit.pas"); +USEUNIT("cxRegExpr.pas"); +USEUNIT("cxSpinEdit.pas"); +USEUNIT("cxStandardMask.pas"); +USEUNIT("cxTextEdit.pas"); +USEUNIT("cxTimeEdit.pas"); +USEUNIT("cxListBox.pas"); +USEUNIT("cxEditRegisteredRepositoryItems.pas"); +USEUNIT("cxDBLookupComboBox.pas"); +USEUNIT("cxRadioGroup.pas"); +USEUNIT("cxFilterControl.pas"); +USEUNIT("cxFilterControlUtils.pas"); +USEUNIT("cxFilterControlStrs.pas"); +USEUNIT("cxNavigator.pas"); +USEUNIT("cxDBNavigator.pas"); +USEUNIT("cxDBFilterControl.pas"); +USEUNIT("cxInplaceContainer.pas"); +USEFORMNS("cxFilterControlDialog.pas", fmfiltercontroldialog, fmFilterControlDialog); +USEFORMNS("cxEditMaskEditor.pas", Cxeditmaskeditor, cxEditMaskEditorDlg); +USEUNIT("cxPropertiesConverters.pas"); +USEUNIT("cxGroupBox.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC10.res b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC10.res new file mode 100644 index 00000000..37fd95ef Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC10.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC11.bpk b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC11.bpk new file mode 100644 index 00000000..f4581213 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC11.bpk @@ -0,0 +1,219 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = cxEditorsC11.bpl +OBJFILES = cxEditorsC11.obj cxBlobEdit.obj \ + cxButtonEdit.obj cxButtons.obj \ + cxCalc.obj cxCalendar.obj \ + cxCheckBox.obj cxCurrencyEdit.obj \ + cxDBEdit.obj \ + cxDBEditRepository.obj cxDBLookupEdit.obj \ + cxDropDownEdit.obj cxEdit.obj \ + cxEditConsts.obj \ + cxEditDataRegisteredRepositoryItems.obj \ + cxEditDBRegisteredRepositoryItems.obj \ + cxEditPaintUtils.obj cxDBNavigator.obj cxDBFilterControl.obj \ + cxEditRepositoryItems.obj cxEditUtils.obj \ + cxHyperLinkEdit.obj \ + cxImage.obj cxImageComboBox.obj \ + cxLookupDBGrid.obj cxLookupEdit.obj \ + cxLookupGrid.obj cxMaskEdit.obj cxGroupBox.obj \ + cxMemo.obj cxMRUEdit.obj cxDBLookupComboBox.obj \ + cxRegExpr.obj cxSpinEdit.obj \ + cxStandardMask.obj cxTextEdit.obj \ + cxTimeEdit.obj cxEditMaskEditor.obj cxListBox.obj \ + cxEditRegisteredRepositoryItems.obj cxPropertiesConverters.obj \ + cxRadioGroup.obj cxFilterControlDialog.obj cxNavigator.obj \ + cxFilterControl.obj cxFilterControlUtils.obj cxFilterControlStrs.obj \ + cxInplaceContainer.obj +RESFILES = cxEditorsC11.res +MAINSOURCE = cxEditorsC11.cpp +RESDEPEN = $(RESFILES) cxEditMaskEditor.dfm cxFilterControlDialog.dfm cxEdit.res cxScrollCursors.res +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = cxLibraryC11.bpi cxDataC11.bpi dxGDIPlusC11.bpi dxThemeC11.bpi rtl.bpi vcl.bpi vcljpg.bpi \ + dbrtl.bpi vcldb.bpi +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib vcljpg.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressEditors Library 5 by Developer Express Inc." -aa \ + -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC11.cpp b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC11.cpp new file mode 100644 index 00000000..6579f1eb --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC11.cpp @@ -0,0 +1,74 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxEditorsC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("vcljpg.bpi"); +USEPACKAGE("Vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEUNIT("cxBlobEdit.pas"); +USEUNIT("cxButtonEdit.pas"); +USEUNIT("cxButtons.pas"); +USEUNIT("cxCalc.pas"); +USEUNIT("cxCalendar.pas"); +USEUNIT("cxCheckBox.pas"); +USEUNIT("cxCurrencyEdit.pas"); +USEUNIT("cxDBEdit.pas"); +USEUNIT("cxDBEditRepository.pas"); +USEUNIT("cxDBLookupEdit.pas"); +USEUNIT("cxDropDownEdit.pas"); +USEUNIT("cxEdit.pas"); +USEUNIT("cxEditConsts.pas"); +USEUNIT("cxEditDataRegisteredRepositoryItems.pas"); +USEUNIT("cxEditDBRegisteredRepositoryItems.pas"); +USEUNIT("cxEditPaintUtils.pas"); +USEUNIT("cxEditRepositoryItems.pas"); +USEUNIT("cxEditUtils.pas"); +USEUNIT("cxHyperLinkEdit.pas"); +USEUNIT("cxImage.pas"); +USEUNIT("cxImageComboBox.pas"); +USEUNIT("cxLookupDBGrid.pas"); +USEUNIT("cxLookupEdit.pas"); +USEUNIT("cxLookupGrid.pas"); +USEUNIT("cxMaskEdit.pas"); +USEUNIT("cxMemo.pas"); +USEUNIT("cxMRUEdit.pas"); +USEUNIT("cxRegExpr.pas"); +USEUNIT("cxSpinEdit.pas"); +USEUNIT("cxStandardMask.pas"); +USEUNIT("cxTextEdit.pas"); +USEUNIT("cxTimeEdit.pas"); +USEUNIT("cxListBox.pas"); +USEUNIT("cxEditRegisteredRepositoryItems.pas"); +USEUNIT("cxDBLookupComboBox.pas"); +USEUNIT("cxRadioGroup.pas"); +USEUNIT("cxFilterControl.pas"); +USEUNIT("cxFilterControlUtils.pas"); +USEUNIT("cxFilterControlStrs.pas"); +USEUNIT("cxNavigator.pas"); +USEUNIT("cxDBNavigator.pas"); +USEUNIT("cxDBFilterControl.pas"); +USEUNIT("cxInplaceContainer.pas"); +USEFORMNS("cxFilterControlDialog.pas", fmfiltercontroldialog, fmFilterControlDialog); +USEFORMNS("cxEditMaskEditor.pas", Cxeditmaskeditor, cxEditMaskEditorDlg); +USEUNIT("cxPropertiesConverters.pas"); +USEUNIT("cxGroupBox.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC11.res b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC11.res new file mode 100644 index 00000000..a4e1bd50 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC11.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC5.bpk b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC5.bpk new file mode 100644 index 00000000..641cb1b8 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC5.bpk @@ -0,0 +1,219 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = cxEditorsC5.bpl +OBJFILES = cxEditorsC5.obj cxBlobEdit.obj \ + cxButtonEdit.obj cxButtons.obj \ + cxCheckBox.obj cxCurrencyEdit.obj \ + cxDBEdit.obj \ + cxCalc.obj cxCalendar.obj \ + cxDBEditRepository.obj cxDBLookupEdit.obj \ + cxDropDownEdit.obj cxEdit.obj \ + cxEditConsts.obj cxEditMaskEditor.obj \ + cxEditDataRegisteredRepositoryItems.obj \ + cxEditDBRegisteredRepositoryItems.obj \ + cxEditPaintUtils.obj \ + cxEditRepositoryItems.obj cxEditUtils.obj \ + cxHyperLinkEdit.obj \ + cxImage.obj cxImageComboBox.obj \ + cxLookupDBGrid.obj cxLookupEdit.obj \ + cxLookupGrid.obj cxMaskEdit.obj \ + cxMemo.obj cxMRUEdit.obj cxDBNavigator.obj cxDBFilterControl.obj \ + cxRegExpr.obj cxSpinEdit.obj cxGroupBox.obj \ + cxStandardMask.obj cxTextEdit.obj \ + cxTimeEdit.obj cxDBLookupComboBox.obj cxListBox.obj \ + cxEditRegisteredRepositoryItems.obj cxPropertiesConverters.obj \ + cxRadioGroup.obj cxFilterControlDialog.obj cxNavigator.obj \ + cxFilterControl.obj cxFilterControlUtils.obj cxFilterControlStrs.obj \ + cxInplaceContainer.obj +RESFILES = cxEditorsC5.res +MAINSOURCE = cxEditorsC5.cpp +RESDEPEN = $(RESFILES) cxEditMaskEditor.dfm cxFilterControlDialog.dfm cxEdit.res +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = cxLibraryVCLC5.bpi cxDataC5.bpi dxGDIPlusC5.bpi dxThemeC5.bpi vcl50.bpi vcljpg50.bpi \ + vcldb50.bpi +SPARELIBS = vcl50.lib vcldb50.lib vcljpg50.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressEditors Library 5 (VCL Edition) by Developer Express Inc." -aa \ + -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC5.cpp b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC5.cpp new file mode 100644 index 00000000..0343d901 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC5.cpp @@ -0,0 +1,72 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxEditorsC5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEPACKAGE("dxGDIPlusC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEPACKAGE("vcljpg50.bpi"); +USEPACKAGE("Vcldb50.bpi"); +USEUNIT("cxBlobEdit.pas"); +USEUNIT("cxButtonEdit.pas"); +USEUNIT("cxButtons.pas"); +USEUNIT("cxCalc.pas"); +USEUNIT("cxCalendar.pas"); +USEUNIT("cxCheckBox.pas"); +USEUNIT("cxCurrencyEdit.pas"); +USEUNIT("cxDBEdit.pas"); +USEUNIT("cxDBEditRepository.pas"); +USEUNIT("cxDBLookupEdit.pas"); +USEUNIT("cxDropDownEdit.pas"); +USEUNIT("cxEdit.pas"); +USEUNIT("cxEditConsts.pas"); +USEUNIT("cxListBox.pas"); +USEUNIT("cxEditDataRegisteredRepositoryItems.pas"); +USEUNIT("cxEditDBRegisteredRepositoryItems.pas"); +USEUNIT("cxEditPaintUtils.pas"); +USEUNIT("cxEditRepositoryItems.pas"); +USEUNIT("cxEditUtils.pas"); +USEUNIT("cxHyperLinkEdit.pas"); +USEUNIT("cxImage.pas"); +USEUNIT("cxImageComboBox.pas"); +USEUNIT("cxLookupDBGrid.pas"); +USEUNIT("cxLookupEdit.pas"); +USEUNIT("cxLookupGrid.pas"); +USEUNIT("cxMaskEdit.pas"); +USEUNIT("cxMemo.pas"); +USEUNIT("cxMRUEdit.pas"); +USEUNIT("cxRegExpr.pas"); +USEUNIT("cxSpinEdit.pas"); +USEUNIT("cxStandardMask.pas"); +USEUNIT("cxTextEdit.pas"); +USEUNIT("cxTimeEdit.pas"); +USEUNIT("cxDBLookupComboBox.pas"); +USEUNIT("cxRadioGroup.pas"); +USEUNIT("cxFilterControl.pas"); +USEUNIT("cxFilterControlUtils.pas"); +USEUNIT("cxNavigator.pas"); +USEUNIT("cxFilterControlStrs.pas"); +USEUNIT("cxDBNavigator.pas"); +USEUNIT("cxDBFilterControl.pas"); +USEUNIT("cxInplaceContainer.pas"); +USEFORMNS("cxEditMaskEditor.pas", Cxeditmaskeditor, cxEditMaskEditorDlg); +USEFORMNS("cxFilterControlDialog.pas", fmfiltercontroldialog, fmFilterControlDialog); +USEUNIT("cxEditRegisteredRepositoryItems.pas"); +USEUNIT("cxPropertiesConverters.pas"); +USEUNIT("cxGroupBox.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC5.res b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC5.res new file mode 100644 index 00000000..d7d3c0df Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsC5.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD10.dpk b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD10.dpk new file mode 100644 index 00000000..e904c999 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD10.dpk @@ -0,0 +1,88 @@ +package cxEditorsD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressEditors Library 5 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + vcl, + vcldb, + vcljpg, + dxThemeD10, + cxDataD10, + cxLibraryD10; + +contains + cxBlobEdit, + cxButtonEdit, + cxButtons, + cxCalc, + cxCalendar, + cxCheckBox, + cxCurrencyEdit, + cxDBEdit, + cxDBEditRepository, + cxDBLookupEdit, + cxEdit, + cxEditConsts, + cxEditDataRegisteredRepositoryItems, + cxEditDBRegisteredRepositoryItems, + cxEditRegisteredRepositoryItems, + cxEditUtils, + cxHyperLinkEdit, + cxImage, + cxImageComboBox, + cxLookupDBGrid, + cxLookupEdit, + cxLookupGrid, + cxMaskEdit, + cxNavigator, + cxMemo, + cxMRUEdit, + cxRegExpr, + cxSpinEdit, + cxTimeEdit, + cxDropDownEdit, + cxEditPaintUtils, + cxTextEdit, + cxStandardMask, + cxEditMaskEditor, + cxDBLookupComboBox, + cxRadioGroup, + cxListBox, + cxFilterControl, + cxFilterControlUtils, + cxFilterControlStrs, + cxFilterControlDialog, + cxEditRepositoryItems, + cxDBNavigator, + cxDBFilterControl, + cxPropertiesConverters, + cxGroupBox, + cxInplaceContainer; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD10.res b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD10.res new file mode 100644 index 00000000..da3bbe93 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD10.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD11.dpk b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD11.dpk new file mode 100644 index 00000000..33c18ed9 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD11.dpk @@ -0,0 +1,88 @@ +package cxEditorsD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressEditors Library 5 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + vcl, + vcldb, + vcljpg, + dxThemeD11, + cxDataD11, + cxLibraryD11; + +contains + cxBlobEdit, + cxButtonEdit, + cxButtons, + cxCalc, + cxCalendar, + cxCheckBox, + cxCurrencyEdit, + cxDBEdit, + cxDBEditRepository, + cxDBLookupEdit, + cxEdit, + cxEditConsts, + cxEditDataRegisteredRepositoryItems, + cxEditDBRegisteredRepositoryItems, + cxEditRegisteredRepositoryItems, + cxEditUtils, + cxHyperLinkEdit, + cxImage, + cxImageComboBox, + cxLookupDBGrid, + cxLookupEdit, + cxLookupGrid, + cxMaskEdit, + cxNavigator, + cxMemo, + cxMRUEdit, + cxRegExpr, + cxSpinEdit, + cxTimeEdit, + cxDropDownEdit, + cxEditPaintUtils, + cxTextEdit, + cxStandardMask, + cxEditMaskEditor, + cxDBLookupComboBox, + cxRadioGroup, + cxListBox, + cxFilterControl, + cxFilterControlUtils, + cxFilterControlStrs, + cxFilterControlDialog, + cxEditRepositoryItems, + cxDBNavigator, + cxDBFilterControl, + cxPropertiesConverters, + cxGroupBox, + cxInplaceContainer; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD11.res b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD11.res new file mode 100644 index 00000000..44fa4044 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD11.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD5.dpk b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD5.dpk new file mode 100644 index 00000000..e4d37443 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD5.dpk @@ -0,0 +1,86 @@ +package cxEditorsD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressEditors Library 5 (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcldb50, + vcljpg50, + dxThemeD5, + cxDataD5, + cxLibraryVCLD5; + +contains + cxBlobEdit, + cxButtonEdit, + cxButtons, + cxCalc, + cxCalendar, + cxCheckBox, + cxCurrencyEdit, + cxDBEdit, + cxDBEditRepository, + cxDBLookupEdit, + cxEdit, + cxEditConsts, + cxEditDataRegisteredRepositoryItems, + cxEditDBRegisteredRepositoryItems, + cxEditRegisteredRepositoryItems, + cxEditUtils, + cxNavigator, + cxHyperLinkEdit, + cxImage, + cxImageComboBox, + cxLookupDBGrid, + cxLookupEdit, + cxLookupGrid, + cxMaskEdit, + cxMemo, + cxMRUEdit, + cxRegExpr, + cxSpinEdit, + cxTimeEdit, + cxDropDownEdit, + cxEditPaintUtils, + cxTextEdit, + cxStandardMask, + cxEditMaskEditor, + cxDBLookupComboBox, + cxRadioGroup, + cxListBox, + cxFilterControl, + cxFilterControlUtils, + cxFilterControlStrs, + cxFilterControlDialog, + cxEditRepositoryItems, + cxDBNavigator, + cxDBFilterControl, + cxPropertiesConverters, + cxGroupBox, + cxInplaceContainer; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD5.res b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD5.res new file mode 100644 index 00000000..4d71b32c Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD5.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD9.dpk b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD9.dpk new file mode 100644 index 00000000..9691d7db --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD9.dpk @@ -0,0 +1,88 @@ +package cxEditorsD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressEditors Library 5 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + vcl, + vcldb, + vcljpg, + dxThemeD9, + cxDataD9, + cxLibraryD9; + +contains + cxBlobEdit, + cxButtonEdit, + cxButtons, + cxCalc, + cxCalendar, + cxCheckBox, + cxCurrencyEdit, + cxDBEdit, + cxDBEditRepository, + cxDBLookupEdit, + cxEdit, + cxEditConsts, + cxEditDataRegisteredRepositoryItems, + cxEditDBRegisteredRepositoryItems, + cxEditRegisteredRepositoryItems, + cxEditUtils, + cxHyperLinkEdit, + cxImage, + cxImageComboBox, + cxLookupDBGrid, + cxLookupEdit, + cxLookupGrid, + cxMaskEdit, + cxNavigator, + cxMemo, + cxMRUEdit, + cxRegExpr, + cxSpinEdit, + cxTimeEdit, + cxDropDownEdit, + cxEditPaintUtils, + cxTextEdit, + cxStandardMask, + cxEditMaskEditor, + cxDBLookupComboBox, + cxRadioGroup, + cxListBox, + cxFilterControl, + cxFilterControlUtils, + cxFilterControlStrs, + cxFilterControlDialog, + cxEditRepositoryItems, + cxDBNavigator, + cxDBFilterControl, + cxPropertiesConverters, + cxGroupBox, + cxInplaceContainer; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD9.res b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD9.res new file mode 100644 index 00000000..a0166068 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsD9.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLC6.bpk b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLC6.bpk new file mode 100644 index 00000000..b861e5e3 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLC6.bpk @@ -0,0 +1,219 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = cxEditorsVCLC6.bpl +OBJFILES = cxEditorsVCLC6.obj cxBlobEdit.obj \ + cxButtonEdit.obj cxButtons.obj \ + cxCalc.obj cxCalendar.obj \ + cxCheckBox.obj cxCurrencyEdit.obj \ + cxDBEdit.obj \ + cxDBEditRepository.obj cxDBLookupEdit.obj \ + cxDropDownEdit.obj cxEdit.obj \ + cxEditConsts.obj \ + cxEditDataRegisteredRepositoryItems.obj \ + cxEditDBRegisteredRepositoryItems.obj \ + cxEditPaintUtils.obj cxDBNavigator.obj cxDBFilterControl.obj \ + cxEditRepositoryItems.obj cxEditUtils.obj \ + cxHyperLinkEdit.obj \ + cxImage.obj cxImageComboBox.obj \ + cxLookupDBGrid.obj cxLookupEdit.obj \ + cxLookupGrid.obj cxMaskEdit.obj cxGroupBox.obj \ + cxMemo.obj cxMRUEdit.obj cxDBLookupComboBox.obj \ + cxRegExpr.obj cxSpinEdit.obj \ + cxStandardMask.obj cxTextEdit.obj \ + cxTimeEdit.obj cxEditMaskEditor.obj cxListBox.obj \ + cxEditRegisteredRepositoryItems.obj cxPropertiesConverters.obj \ + cxRadioGroup.obj cxFilterControlDialog.obj cxNavigator.obj \ + cxFilterControl.obj cxFilterControlUtils.obj cxFilterControlStrs.obj \ + cxInplaceContainer.obj +RESFILES = cxEditorsVCLC6.res +MAINSOURCE = cxEditorsVCLC6.cpp +RESDEPEN = $(RESFILES) cxEditMaskEditor.dfm cxFilterControlDialog.dfm cxEdit.res cxScrollCursors.res +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = cxLibraryVCLC6.bpi cxDataC6.bpi dxGDIPlusC6.bpi dxThemeC6.bpi rtl.bpi vcl.bpi vcljpg.bpi \ + dbrtl.bpi vcldb.bpi +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib vcljpg.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressEditors Library 5 (VCL Edition) by Developer Express Inc." -aa \ + -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLC6.cpp b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLC6.cpp new file mode 100644 index 00000000..f5178963 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLC6.cpp @@ -0,0 +1,74 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxEditorsVCLC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEPACKAGE("dxGDIPlusC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEPACKAGE("vcljpg.bpi"); +USEPACKAGE("Vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEUNIT("cxBlobEdit.pas"); +USEUNIT("cxButtonEdit.pas"); +USEUNIT("cxButtons.pas"); +USEUNIT("cxCalc.pas"); +USEUNIT("cxCalendar.pas"); +USEUNIT("cxCheckBox.pas"); +USEUNIT("cxCurrencyEdit.pas"); +USEUNIT("cxDBEdit.pas"); +USEUNIT("cxDBEditRepository.pas"); +USEUNIT("cxDBLookupEdit.pas"); +USEUNIT("cxDropDownEdit.pas"); +USEUNIT("cxEdit.pas"); +USEUNIT("cxEditConsts.pas"); +USEUNIT("cxEditDataRegisteredRepositoryItems.pas"); +USEUNIT("cxEditDBRegisteredRepositoryItems.pas"); +USEUNIT("cxEditPaintUtils.pas"); +USEUNIT("cxEditRepositoryItems.pas"); +USEUNIT("cxEditUtils.pas"); +USEUNIT("cxHyperLinkEdit.pas"); +USEUNIT("cxImage.pas"); +USEUNIT("cxImageComboBox.pas"); +USEUNIT("cxLookupDBGrid.pas"); +USEUNIT("cxLookupEdit.pas"); +USEUNIT("cxLookupGrid.pas"); +USEUNIT("cxMaskEdit.pas"); +USEUNIT("cxMemo.pas"); +USEUNIT("cxMRUEdit.pas"); +USEUNIT("cxRegExpr.pas"); +USEUNIT("cxSpinEdit.pas"); +USEUNIT("cxStandardMask.pas"); +USEUNIT("cxTextEdit.pas"); +USEUNIT("cxTimeEdit.pas"); +USEUNIT("cxListBox.pas"); +USEUNIT("cxEditRegisteredRepositoryItems.pas"); +USEUNIT("cxDBLookupComboBox.pas"); +USEUNIT("cxRadioGroup.pas"); +USEUNIT("cxFilterControl.pas"); +USEUNIT("cxFilterControlUtils.pas"); +USEUNIT("cxFilterControlStrs.pas"); +USEUNIT("cxNavigator.pas"); +USEUNIT("cxDBNavigator.pas"); +USEUNIT("cxDBFilterControl.pas"); +USEUNIT("cxInplaceContainer.pas"); +USEFORMNS("cxFilterControlDialog.pas", fmfiltercontroldialog, fmFilterControlDialog); +USEFORMNS("cxEditMaskEditor.pas", Cxeditmaskeditor, cxEditMaskEditorDlg); +USEUNIT("cxPropertiesConverters.pas"); +USEUNIT("cxGroupBox.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLC6.res b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLC6.res new file mode 100644 index 00000000..d4275bb4 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLC6.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLD6.dpk b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLD6.dpk new file mode 100644 index 00000000..c476b0d7 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLD6.dpk @@ -0,0 +1,88 @@ +package cxEditorsVCLD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressEditors Library 5 (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + vcl, + vcldb, + vcljpg, + dxThemeD6, + cxDataD6, + cxLibraryVCLD6; + +contains + cxBlobEdit, + cxButtonEdit, + cxButtons, + cxCalc, + cxCalendar, + cxCheckBox, + cxCurrencyEdit, + cxDBEdit, + cxDBEditRepository, + cxDBLookupEdit, + cxEdit, + cxEditConsts, + cxEditDataRegisteredRepositoryItems, + cxEditDBRegisteredRepositoryItems, + cxEditRegisteredRepositoryItems, + cxEditUtils, + cxHyperLinkEdit, + cxImage, + cxImageComboBox, + cxLookupDBGrid, + cxLookupEdit, + cxLookupGrid, + cxMaskEdit, + cxMemo, + cxNavigator, + cxMRUEdit, + cxRegExpr, + cxSpinEdit, + cxTimeEdit, + cxDropDownEdit, + cxEditPaintUtils, + cxTextEdit, + cxStandardMask, + cxEditMaskEditor, + cxDBLookupComboBox, + cxRadioGroup, + cxListBox, + cxFilterControl, + cxFilterControlUtils, + cxFilterControlStrs, + cxFilterControlDialog, + cxEditRepositoryItems, + cxDBNavigator, + cxDBFilterControl, + cxPropertiesConverters, + cxGroupBox, + cxInplaceContainer; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLD6.res b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLD6.res new file mode 100644 index 00000000..ca8dc605 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLD6.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLD7.dpk b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLD7.dpk new file mode 100644 index 00000000..138c3667 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLD7.dpk @@ -0,0 +1,88 @@ +package cxEditorsVCLD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressEditors Library 5 (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + vcl, + vcldb, + vcljpg, + dxThemeD7, + cxDataD7, + cxLibraryVCLD7; + +contains + cxBlobEdit, + cxButtonEdit, + cxButtons, + cxCalc, + cxCalendar, + cxCheckBox, + cxCurrencyEdit, + cxDBEdit, + cxDBEditRepository, + cxDBLookupEdit, + cxEdit, + cxEditConsts, + cxEditDataRegisteredRepositoryItems, + cxEditDBRegisteredRepositoryItems, + cxEditRegisteredRepositoryItems, + cxEditUtils, + cxHyperLinkEdit, + cxImage, + cxImageComboBox, + cxLookupDBGrid, + cxLookupEdit, + cxLookupGrid, + cxMaskEdit, + cxNavigator, + cxMemo, + cxMRUEdit, + cxRegExpr, + cxSpinEdit, + cxTimeEdit, + cxDropDownEdit, + cxEditPaintUtils, + cxTextEdit, + cxStandardMask, + cxEditMaskEditor, + cxDBLookupComboBox, + cxRadioGroup, + cxListBox, + cxFilterControl, + cxFilterControlUtils, + cxFilterControlStrs, + cxFilterControlDialog, + cxEditRepositoryItems, + cxDBNavigator, + cxDBFilterControl, + cxPropertiesConverters, + cxGroupBox, + cxInplaceContainer; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLD7.res b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLD7.res new file mode 100644 index 00000000..c792e909 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/cxEditorsVCLD7.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC10.bpk b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC10.bpk new file mode 100644 index 00000000..4b1dbc18 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC10.bpk @@ -0,0 +1,234 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = cxExtEditorsC10.bpl +OBJFILES = cxExtEditorsC10.obj \ + cxCheckComboBox.obj \ + cxCheckListBox.obj \ + cxColorComboBox.obj \ + cxDBCheckComboBox.obj \ + cxDBCheckListBox.obj \ + cxDBColorComboBox.obj \ + cxDBFontNameComboBox.obj \ + cxDBLabel.obj \ + cxDBProgressBar.obj \ + cxDBShellComboBox.obj \ + cxDBTrackBar.obj \ + cxExtEditConsts.obj \ + cxExtEditUtils.obj \ + cxFontNameComboBox.obj \ + cxHeader.obj \ + cxHint.obj \ + cxLabel.obj \ + cxListView.obj \ + cxMCListBox.obj \ + cxProgressBar.obj \ + cxShellComboBox.obj \ + cxShellCommon.obj \ + cxShellControls.obj \ + cxShellListView.obj \ + cxShellTreeView.obj \ + cxSpinButton.obj \ + cxSplitter.obj \ + cxTrackBar.obj \ + cxTreeView.obj \ + cxShellEditRepositoryItems.obj \ + cxExtEditRepositoryItems.obj \ + cxShellDlgs.obj \ + cxShellBrowser.obj \ + cxShellBrowserDialog.obj \ + cxRichEdit.obj \ + cxDBRichEdit.obj \ + cxCheckGroup.obj \ + cxDBCheckGroup.obj +RESFILES = cxExtEditorsC10.res +MAINSOURCE = cxExtEditorsC10.cpp +RESDEPEN = $(RESFILES) cxFontNameComboBox.res cxShellBrowser.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = cxLibraryC10.bpi cxDataC10.bpi cxEditorsC10.bpi dxThemeC10.bpi rtl.bpi vcl.bpi vcljpg.bpi \ + dbrtl.bpi vcldb.bpi vclx.bpi +SPARELIBS = vcl.lib vcldb.lib vcljpg.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -DBCB -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressExtendedEditors Library 5 by Developer Express Inc." -aa \ + -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC10.cpp b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC10.cpp new file mode 100644 index 00000000..0abdb581 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC10.cpp @@ -0,0 +1,67 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxExtEditorsC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEPACKAGE("vcljpg.bpi"); +USEPACKAGE("Vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEUNIT("cxCheckComboBox.pas"); +USEUNIT("cxCheckListBox.pas"); +USEUNIT("cxColorComboBox.pas"); +USEUNIT("cxDBCheckComboBox.pas"); +USEUNIT("cxDBCheckListBox.pas"); +USEUNIT("cxDBColorComboBox.pas"); +USEUNIT("cxDBFontNameComboBox.pas"); +USEUNIT("cxDBLabel.pas"); +USEUNIT("cxDBProgressBar.pas"); +USEUNIT("cxDBShellComboBox.pas"); +USEUNIT("cxDBTrackBar.pas"); +USEUNIT("cxExtEditConsts.pas"); +USEUNIT("cxExtEditUtils.pas"); +USEUNIT("cxFontNameComboBox.pas"); +USEUNIT("cxHeader.pas"); +USEUNIT("cxHint.pas"); +USEUNIT("cxLabel.pas"); +USEUNIT("cxListView.pas"); +USEUNIT("cxMCListBox.pas"); +USEUNIT("cxProgressBar.pas"); +USEUNIT("cxShellComboBox.pas"); +USEUNIT("cxShellCommon.pas"); +USEUNIT("cxShellControls.pas"); +USEUNIT("cxShellListView.pas"); +USEUNIT("cxShellTreeView.pas"); +USEUNIT("cxSpinButton.pas"); +USEUNIT("cxSplitter.pas"); +USEUNIT("cxTrackBar.pas"); +USEUNIT("cxTreeView.pas"); +USEUNIT("cxShellEditRepositoryItems.pas"); +USEUNIT("cxExtEditRepositoryItems.pas"); +USEUNIT("cxShellDlgs.pas"); +USEUNIT("cxRichEdit.pas"); +USEUNIT("cxDBRichEdit.pas"); +USEUNIT("cxCheckGroup.pas"); +USEUNIT("cxDBCheckGroup.pas"); +USEFORMNS("cxShellBrowser.pas", Cxshellbrowser, cxShellBrowserDlg); +USEUNIT("cxShellBrowserDialog.pas"); + +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC10.res b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC10.res new file mode 100644 index 00000000..69e12674 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC10.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC11.bpk b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC11.bpk new file mode 100644 index 00000000..6e69a9b4 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC11.bpk @@ -0,0 +1,234 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = cxExtEditorsC11.bpl +OBJFILES = cxExtEditorsC11.obj \ + cxCheckComboBox.obj \ + cxCheckListBox.obj \ + cxColorComboBox.obj \ + cxDBCheckComboBox.obj \ + cxDBCheckListBox.obj \ + cxDBColorComboBox.obj \ + cxDBFontNameComboBox.obj \ + cxDBLabel.obj \ + cxDBProgressBar.obj \ + cxDBShellComboBox.obj \ + cxDBTrackBar.obj \ + cxExtEditConsts.obj \ + cxExtEditUtils.obj \ + cxFontNameComboBox.obj \ + cxHeader.obj \ + cxHint.obj \ + cxLabel.obj \ + cxListView.obj \ + cxMCListBox.obj \ + cxProgressBar.obj \ + cxShellComboBox.obj \ + cxShellCommon.obj \ + cxShellControls.obj \ + cxShellListView.obj \ + cxShellTreeView.obj \ + cxSpinButton.obj \ + cxSplitter.obj \ + cxTrackBar.obj \ + cxTreeView.obj \ + cxShellEditRepositoryItems.obj \ + cxExtEditRepositoryItems.obj \ + cxShellDlgs.obj \ + cxShellBrowser.obj \ + cxShellBrowserDialog.obj \ + cxRichEdit.obj \ + cxDBRichEdit.obj \ + cxCheckGroup.obj \ + cxDBCheckGroup.obj +RESFILES = cxExtEditorsC11.res +MAINSOURCE = cxExtEditorsC11.cpp +RESDEPEN = $(RESFILES) cxFontNameComboBox.res cxShellBrowser.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = cxLibraryC11.bpi cxDataC11.bpi cxEditorsC11.bpi dxThemeC11.bpi rtl.bpi vcl.bpi vcljpg.bpi \ + dbrtl.bpi vcldb.bpi vclx.bpi +SPARELIBS = vcl.lib vcldb.lib vcljpg.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -DBCB -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressExtendedEditors Library 5 by Developer Express Inc." -aa \ + -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC11.cpp b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC11.cpp new file mode 100644 index 00000000..5fc6e478 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC11.cpp @@ -0,0 +1,67 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxExtEditorsC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("vcljpg.bpi"); +USEPACKAGE("Vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEUNIT("cxCheckComboBox.pas"); +USEUNIT("cxCheckListBox.pas"); +USEUNIT("cxColorComboBox.pas"); +USEUNIT("cxDBCheckComboBox.pas"); +USEUNIT("cxDBCheckListBox.pas"); +USEUNIT("cxDBColorComboBox.pas"); +USEUNIT("cxDBFontNameComboBox.pas"); +USEUNIT("cxDBLabel.pas"); +USEUNIT("cxDBProgressBar.pas"); +USEUNIT("cxDBShellComboBox.pas"); +USEUNIT("cxDBTrackBar.pas"); +USEUNIT("cxExtEditConsts.pas"); +USEUNIT("cxExtEditUtils.pas"); +USEUNIT("cxFontNameComboBox.pas"); +USEUNIT("cxHeader.pas"); +USEUNIT("cxHint.pas"); +USEUNIT("cxLabel.pas"); +USEUNIT("cxListView.pas"); +USEUNIT("cxMCListBox.pas"); +USEUNIT("cxProgressBar.pas"); +USEUNIT("cxShellComboBox.pas"); +USEUNIT("cxShellCommon.pas"); +USEUNIT("cxShellControls.pas"); +USEUNIT("cxShellListView.pas"); +USEUNIT("cxShellTreeView.pas"); +USEUNIT("cxSpinButton.pas"); +USEUNIT("cxSplitter.pas"); +USEUNIT("cxTrackBar.pas"); +USEUNIT("cxTreeView.pas"); +USEUNIT("cxShellEditRepositoryItems.pas"); +USEUNIT("cxExtEditRepositoryItems.pas"); +USEUNIT("cxShellDlgs.pas"); +USEUNIT("cxRichEdit.pas"); +USEUNIT("cxDBRichEdit.pas"); +USEUNIT("cxCheckGroup.pas"); +USEUNIT("cxDBCheckGroup.pas"); +USEFORMNS("cxShellBrowser.pas", Cxshellbrowser, cxShellBrowserDlg); +USEUNIT("cxShellBrowserDialog.pas"); + +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC11.res b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC11.res new file mode 100644 index 00000000..1efad27d Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC11.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC5.bpk b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC5.bpk new file mode 100644 index 00000000..906224c7 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC5.bpk @@ -0,0 +1,235 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = cxExtEditorsC5.bpl +PROJECT = cxExtEditorsC5.bpl +OBJFILES = cxExtEditorsC5.obj \ + cxCheckComboBox.obj \ + cxCheckListBox.obj \ + cxColorComboBox.obj \ + cxDBCheckComboBox.obj \ + cxDBCheckListBox.obj \ + cxDBColorComboBox.obj \ + cxDBFontNameComboBox.obj \ + cxDBLabel.obj \ + cxDBProgressBar.obj \ + cxDBShellComboBox.obj \ + cxDBTrackBar.obj \ + cxExtEditConsts.obj \ + cxExtEditUtils.obj \ + cxFontNameComboBox.obj \ + cxHeader.obj \ + cxHint.obj \ + cxLabel.obj \ + cxListView.obj \ + cxMCListBox.obj \ + cxProgressBar.obj \ + cxShellComboBox.obj \ + cxShellCommon.obj \ + cxShellControls.obj \ + cxShellListView.obj \ + cxShellTreeView.obj \ + cxSpinButton.obj \ + cxSplitter.obj \ + cxTrackBar.obj \ + cxTreeView.obj \ + cxShellEditRepositoryItems.obj \ + cxExtEditRepositoryItems.obj \ + cxShellDlgs.obj \ + cxShellBrowser.obj \ + cxShellBrowserDialog.obj \ + cxRichEdit.obj \ + cxDBRichEdit.obj \ + cxCheckGroup.obj \ + cxDBCheckGroup.obj +RESFILES = cxExtEditorsC5.res +MAINSOURCE = cxExtEditorsC5.cpp +RESDEPEN = $(RESFILES) cxFontNameComboBox.res cxShellBrowser.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = cxLibraryVCLC5.bpi cxDataC5.bpi dxThemeC5.bpi vcl50.bpi vcljpg50.bpi \ + Vclx50.bpi vcldb50.bpi cxEditorsC5.bpi +SPARELIBS = vcl50.lib vcldb50.lib vcljpg50.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -DBCB -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressExtendedEditors Library 5 (VCL Edition) by Developer Express Inc." -aa \ + -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC5.cpp b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC5.cpp new file mode 100644 index 00000000..8fb75ff3 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC5.cpp @@ -0,0 +1,65 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxExtEditorsC5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEPACKAGE("vcljpg50.bpi"); +USEPACKAGE("Vcldb50.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("Vclx50.bpi"); +USEUNIT("cxCheckComboBox.pas"); +USEUNIT("cxCheckListBox.pas"); +USEUNIT("cxColorComboBox.pas"); +USEUNIT("cxDBCheckComboBox.pas"); +USEUNIT("cxDBCheckListBox.pas"); +USEUNIT("cxDBColorComboBox.pas"); +USEUNIT("cxDBFontNameComboBox.pas"); +USEUNIT("cxDBLabel.pas"); +USEUNIT("cxDBProgressBar.pas"); +USEUNIT("cxDBShellComboBox.pas"); +USEUNIT("cxDBTrackBar.pas"); +USEUNIT("cxExtEditConsts.pas"); +USEUNIT("cxExtEditUtils.pas"); +USEUNIT("cxFontNameComboBox.pas"); +USEUNIT("cxHeader.pas"); +USEUNIT("cxHint.pas"); +USEUNIT("cxLabel.pas"); +USEUNIT("cxListView.pas"); +USEUNIT("cxMCListBox.pas"); +USEUNIT("cxProgressBar.pas"); +USEUNIT("cxShellComboBox.pas"); +USEUNIT("cxShellCommon.pas"); +USEUNIT("cxShellControls.pas"); +USEUNIT("cxShellListView.pas"); +USEUNIT("cxShellTreeView.pas"); +USEUNIT("cxSpinButton.pas"); +USEUNIT("cxSplitter.pas"); +USEUNIT("cxTrackBar.pas"); +USEUNIT("cxTreeView.pas"); +USEUNIT("cxShellEditRepositoryItems.pas"); +USEUNIT("cxExtEditRepositoryItems.pas"); +USEUNIT("cxShellDlgs.pas"); +USEUNIT("cxRichEdit.pas"); +USEUNIT("cxDBRichEdit.pas"); +USEUNIT("cxCheckGroup.pas"); +USEUNIT("cxDBCheckGroup.pas"); +USEFORMNS("cxShellBrowser.pas", Cxshellbrowser, cxShellBrowserDlg); +USEUNIT("cxShellBrowserDialog.pas"); + +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC5.res b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC5.res new file mode 100644 index 00000000..083e0982 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsC5.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD10.dpk b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD10.dpk new file mode 100644 index 00000000..1a7993a0 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD10.dpk @@ -0,0 +1,81 @@ +package cxExtEditorsD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressExtendedEditors Library 5 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + vclx, + dbrtl, + vcljpg, + vcldb, + cxLibraryD10, + dxThemeD10, + cxEditorsD10, + cxDataD10; + +contains + cxCheckListBox, + cxProgressBar, + cxLabel, + cxTrackBar, + cxFontNameComboBox, + cxColorComboBox, + cxExtEditUtils, + cxCheckComboBox, + cxTreeView, + cxSplitter, + cxDBColorComboBox, + cxDBProgressBar, + cxDBLabel, + cxDBTrackBar, + cxHint, + cxMCListBox, + cxListView, + cxHeader, + cxDBCheckListBox, + cxDBCheckComboBox, + cxExtEditConsts, + cxSpinButton, + cxDBFontNameComboBox, + cxShellComboBox, + cxShellCommon, + cxShellControls, + cxShellListView, + cxShellTreeView, + cxDBShellComboBox, + cxShellBrowser, + cxShellBrowserDialog, + cxShellDlgs, + cxExtEditRepositoryItems, + cxShellEditRepositoryItems, + cxCheckGroup, + cxDBCheckGroup, + cxRichEdit, + cxDBRichEdit; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD10.res b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD10.res new file mode 100644 index 00000000..4213e1fd Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD10.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD11.dpk b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD11.dpk new file mode 100644 index 00000000..61dc0063 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD11.dpk @@ -0,0 +1,81 @@ +package cxExtEditorsD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressExtendedEditors Library 5 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + vclx, + dbrtl, + vcljpg, + vcldb, + cxLibraryD11, + dxThemeD11, + cxEditorsD11, + cxDataD11; + +contains + cxCheckListBox, + cxProgressBar, + cxLabel, + cxTrackBar, + cxFontNameComboBox, + cxColorComboBox, + cxExtEditUtils, + cxCheckComboBox, + cxTreeView, + cxSplitter, + cxDBColorComboBox, + cxDBProgressBar, + cxDBLabel, + cxDBTrackBar, + cxHint, + cxMCListBox, + cxListView, + cxHeader, + cxDBCheckListBox, + cxDBCheckComboBox, + cxExtEditConsts, + cxSpinButton, + cxDBFontNameComboBox, + cxShellComboBox, + cxShellCommon, + cxShellControls, + cxShellListView, + cxShellTreeView, + cxDBShellComboBox, + cxShellBrowser, + cxShellBrowserDialog, + cxShellDlgs, + cxExtEditRepositoryItems, + cxShellEditRepositoryItems, + cxCheckGroup, + cxDBCheckGroup, + cxRichEdit, + cxDBRichEdit; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD11.res b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD11.res new file mode 100644 index 00000000..a2c9d41a Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD11.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD5.dpk b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD5.dpk new file mode 100644 index 00000000..5745c157 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD5.dpk @@ -0,0 +1,79 @@ +package cxExtEditorsD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressExtendedEditors Library 5 (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vclx50, + vcljpg50, + vcldb50, + cxLibraryVCLD5, + dxThemeD5, + cxEditorsD5, + cxDataD5; + +contains + cxCheckListBox, + cxProgressBar, + cxLabel, + cxTrackBar, + cxFontNameComboBox, + cxColorComboBox, + cxExtEditUtils, + cxCheckComboBox, + cxTreeView, + cxSplitter, + cxDBColorComboBox, + cxDBProgressBar, + cxDBLabel, + cxDBTrackBar, + cxHint, + cxMCListBox, + cxListView, + cxHeader, + cxDBCheckListBox, + cxDBCheckComboBox, + cxExtEditConsts, + cxSpinButton, + cxDBFontNameComboBox, + cxShellComboBox, + cxShellCommon, + cxShellControls, + cxShellListView, + cxShellTreeView, + cxDBShellComboBox, + cxShellBrowser, + cxShellBrowserDialog, + cxShellDlgs, + cxExtEditRepositoryItems, + cxShellEditRepositoryItems, + cxRichEdit, + cxDBRichEdit, + cxCheckGroup, + cxDBCheckGroup; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD5.res b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD5.res new file mode 100644 index 00000000..0c81e073 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD5.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD9.dpk b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD9.dpk new file mode 100644 index 00000000..7d638e43 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD9.dpk @@ -0,0 +1,81 @@ +package cxExtEditorsD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressExtendedEditors Library 5 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + vclx, + dbrtl, + vcljpg, + vcldb, + cxLibraryD9, + dxThemeD9, + cxEditorsD9, + cxDataD9; + +contains + cxCheckListBox, + cxProgressBar, + cxLabel, + cxTrackBar, + cxFontNameComboBox, + cxColorComboBox, + cxExtEditUtils, + cxCheckComboBox, + cxTreeView, + cxSplitter, + cxDBColorComboBox, + cxDBProgressBar, + cxDBLabel, + cxDBTrackBar, + cxHint, + cxMCListBox, + cxListView, + cxHeader, + cxDBCheckListBox, + cxDBCheckComboBox, + cxExtEditConsts, + cxSpinButton, + cxDBFontNameComboBox, + cxShellComboBox, + cxShellCommon, + cxShellControls, + cxShellListView, + cxShellTreeView, + cxDBShellComboBox, + cxShellBrowser, + cxShellBrowserDialog, + cxShellDlgs, + cxExtEditRepositoryItems, + cxShellEditRepositoryItems, + cxCheckGroup, + cxDBCheckGroup, + cxRichEdit, + cxDBRichEdit; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD9.res b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD9.res new file mode 100644 index 00000000..0f78302f Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsD9.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLC6.bpk b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLC6.bpk new file mode 100644 index 00000000..ee5452fa --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLC6.bpk @@ -0,0 +1,234 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = cxExtEditorsVCLC6.bpl +OBJFILES = cxExtEditorsVCLC6.obj \ + cxCheckComboBox.obj \ + cxCheckListBox.obj \ + cxColorComboBox.obj \ + cxDBCheckComboBox.obj \ + cxDBCheckListBox.obj \ + cxDBColorComboBox.obj \ + cxDBFontNameComboBox.obj \ + cxDBLabel.obj \ + cxDBProgressBar.obj \ + cxDBShellComboBox.obj \ + cxDBTrackBar.obj \ + cxExtEditConsts.obj \ + cxExtEditUtils.obj \ + cxFontNameComboBox.obj \ + cxHeader.obj \ + cxHint.obj \ + cxLabel.obj \ + cxListView.obj \ + cxMCListBox.obj \ + cxProgressBar.obj \ + cxShellComboBox.obj \ + cxShellCommon.obj \ + cxShellControls.obj \ + cxShellListView.obj \ + cxShellTreeView.obj \ + cxSpinButton.obj \ + cxSplitter.obj \ + cxTrackBar.obj \ + cxTreeView.obj \ + cxShellEditRepositoryItems.obj \ + cxExtEditRepositoryItems.obj \ + cxShellDlgs.obj \ + cxShellBrowser.obj \ + cxShellBrowserDialog.obj \ + cxRichEdit.obj \ + cxDBRichEdit.obj \ + cxCheckGroup.obj \ + cxDBCheckGroup.obj +RESFILES = cxExtEditorsVCLC6.res +MAINSOURCE = cxExtEditorsVCLC6.cpp +RESDEPEN = $(RESFILES) cxFontNameComboBox.res cxShellBrowser.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = cxLibraryVCLC6.bpi cxDataC6.bpi cxEditorsVCLC6.bpi dxThemeC6.bpi rtl.bpi vcl.bpi vcljpg.bpi \ + dbrtl.bpi vcldb.bpi vclx.bpi +SPARELIBS = vcl.lib vcldb.lib vcljpg.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -DBCB -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressExtendedEditors Library 5 (VCL Edition) by Developer Express Inc." -aa \ + -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLC6.cpp b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLC6.cpp new file mode 100644 index 00000000..17cca70e --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLC6.cpp @@ -0,0 +1,67 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxExtEditorsVCLC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEPACKAGE("vcljpg.bpi"); +USEPACKAGE("Vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEUNIT("cxCheckComboBox.pas"); +USEUNIT("cxCheckListBox.pas"); +USEUNIT("cxColorComboBox.pas"); +USEUNIT("cxDBCheckComboBox.pas"); +USEUNIT("cxDBCheckListBox.pas"); +USEUNIT("cxDBColorComboBox.pas"); +USEUNIT("cxDBFontNameComboBox.pas"); +USEUNIT("cxDBLabel.pas"); +USEUNIT("cxDBProgressBar.pas"); +USEUNIT("cxDBShellComboBox.pas"); +USEUNIT("cxDBTrackBar.pas"); +USEUNIT("cxExtEditConsts.pas"); +USEUNIT("cxExtEditUtils.pas"); +USEUNIT("cxFontNameComboBox.pas"); +USEUNIT("cxHeader.pas"); +USEUNIT("cxHint.pas"); +USEUNIT("cxLabel.pas"); +USEUNIT("cxListView.pas"); +USEUNIT("cxMCListBox.pas"); +USEUNIT("cxProgressBar.pas"); +USEUNIT("cxShellComboBox.pas"); +USEUNIT("cxShellCommon.pas"); +USEUNIT("cxShellControls.pas"); +USEUNIT("cxShellListView.pas"); +USEUNIT("cxShellTreeView.pas"); +USEUNIT("cxSpinButton.pas"); +USEUNIT("cxSplitter.pas"); +USEUNIT("cxTrackBar.pas"); +USEUNIT("cxTreeView.pas"); +USEUNIT("cxShellEditRepositoryItems.pas"); +USEUNIT("cxExtEditRepositoryItems.pas"); +USEUNIT("cxShellDlgs.pas"); +USEUNIT("cxRichEdit.pas"); +USEUNIT("cxDBRichEdit.pas"); +USEUNIT("cxCheckGroup.pas"); +USEUNIT("cxDBCheckGroup.pas"); +USEFORMNS("cxShellBrowser.pas", Cxshellbrowser, cxShellBrowserDlg); +USEUNIT("cxShellBrowserDialog.pas"); + +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLC6.res b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLC6.res new file mode 100644 index 00000000..c3613576 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLC6.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLD6.dpk b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLD6.dpk new file mode 100644 index 00000000..838b1f7d --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLD6.dpk @@ -0,0 +1,81 @@ +package cxExtEditorsVCLD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressExtendedEditors Library 5 (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + vclx, + dbrtl, + vcljpg, + vcldb, + cxLibraryVCLD6, + dxThemeD6, + cxEditorsVCLD6, + cxDataD6; + +contains + cxCheckListBox, + cxProgressBar, + cxLabel, + cxTrackBar, + cxFontNameComboBox, + cxColorComboBox, + cxExtEditUtils, + cxCheckComboBox, + cxTreeView, + cxSplitter, + cxDBColorComboBox, + cxDBProgressBar, + cxDBLabel, + cxDBTrackBar, + cxHint, + cxMCListBox, + cxListView, + cxHeader, + cxDBCheckListBox, + cxDBCheckComboBox, + cxExtEditConsts, + cxSpinButton, + cxDBFontNameComboBox, + cxShellComboBox, + cxShellCommon, + cxShellControls, + cxShellListView, + cxShellTreeView, + cxDBShellComboBox, + cxShellBrowser, + cxShellBrowserDialog, + cxShellDlgs, + cxExtEditRepositoryItems, + cxShellEditRepositoryItems, + cxRichEdit, + cxDBRichEdit, + cxCheckGroup, + cxDBCheckGroup; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLD6.res b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLD6.res new file mode 100644 index 00000000..cd45b1b5 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLD6.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLD7.dpk b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLD7.dpk new file mode 100644 index 00000000..19b67093 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLD7.dpk @@ -0,0 +1,81 @@ +package cxExtEditorsVCLD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressExtendedEditors Library 5 (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + vclx, + dbrtl, + vcljpg, + vcldb, + cxLibraryVCLD7, + dxThemeD7, + cxEditorsVCLD7, + cxDataD7; + +contains + cxCheckListBox, + cxProgressBar, + cxLabel, + cxTrackBar, + cxFontNameComboBox, + cxColorComboBox, + cxExtEditUtils, + cxCheckComboBox, + cxTreeView, + cxSplitter, + cxDBColorComboBox, + cxDBProgressBar, + cxDBLabel, + cxDBTrackBar, + cxHint, + cxMCListBox, + cxListView, + cxHeader, + cxDBCheckListBox, + cxDBCheckComboBox, + cxExtEditConsts, + cxSpinButton, + cxDBFontNameComboBox, + cxShellComboBox, + cxShellCommon, + cxShellControls, + cxShellListView, + cxShellTreeView, + cxDBShellComboBox, + cxShellBrowser, + cxShellBrowserDialog, + cxShellDlgs, + cxExtEditRepositoryItems, + cxShellEditRepositoryItems, + cxCheckGroup, + cxDBCheckGroup, + cxRichEdit, + cxDBRichEdit; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLD7.res b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLD7.res new file mode 100644 index 00000000..f7069a64 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/cxExtEditorsVCLD7.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC10.bpk b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC10.bpk new file mode 100644 index 00000000..2ab0fe07 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC10.bpk @@ -0,0 +1,205 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxEditorsC10.bpl +OBJFILES = dclcxEditorsC10.obj \ + cxEditPropEditors.obj cxEditReg.obj \ + cxMaskEditTextEditor.obj \ + cxSelectEditRepositoryItem.obj \ + cxEditRepositoryEditor.obj cxFilterControlReg.obj \ + cxInplaceContainerReg.obj +RESFILES = dclcxEditorsC10.res cxEditReg.dcr cxFilterControlReg.dcr +MAINSOURCE = dclcxEditorsC10.cpp +RESDEPEN = $(RESFILES) cxEditMaskEditor.dfm \ + cxMaskEditTextEditor.dfm \ + cxSelectEditRepositoryItem.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = designide.bpi dclcxLibraryC10.bpi cxEditorsC10.bpi dxThemeC10.bpi \ + cxLibraryC10.bpi cxDataC10.bpi rtl.bpi vcl.bpi dbrtl.bpi \ + vcldb.bpi vclx.bpi +SPARELIBS = rtl.lib vcl.lib CXLIBRARYC10.lib cxEditorsC10.lib \ + dclcxLibraryC10.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressEditors Library 5 by Developer Express Inc." -aa \ + -Tpp -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC10.cpp b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC10.cpp new file mode 100644 index 00000000..6e535468 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC10.cpp @@ -0,0 +1,38 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxEditorsC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dclcxLibraryC10.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEUNIT("cxEditPropEditors.pas"); +USEUNIT("cxEditReg.pas"); +USERES("cxEditReg.dcr"); +USEFORMNS("cxMaskEditTextEditor.pas", Cxmaskedittexteditor, cxMaskEditTextEditorDlg); +USEFORMNS("cxSelectEditRepositoryItem.pas", Cxselecteditrepositoryitem, cxSelectRepositoryItem); +USEUNIT("cxEditRepositoryEditor.pas"); +USEUNIT("cxFilterControlReg.pas"); +USEUNIT("cxInplaceContainerReg.pas"); +USERES("cxFilterControlReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC10.res b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC10.res new file mode 100644 index 00000000..b013603c Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC10.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC11.bpk b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC11.bpk new file mode 100644 index 00000000..ec805db1 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC11.bpk @@ -0,0 +1,205 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxEditorsC11.bpl +OBJFILES = dclcxEditorsC11.obj \ + cxEditPropEditors.obj cxEditReg.obj \ + cxMaskEditTextEditor.obj \ + cxSelectEditRepositoryItem.obj \ + cxEditRepositoryEditor.obj cxFilterControlReg.obj \ + cxInplaceContainerReg.obj +RESFILES = dclcxEditorsC11.res cxEditReg.dcr cxFilterControlReg.dcr +MAINSOURCE = dclcxEditorsC11.cpp +RESDEPEN = $(RESFILES) cxEditMaskEditor.dfm \ + cxMaskEditTextEditor.dfm \ + cxSelectEditRepositoryItem.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = designide.bpi dclcxLibraryC11.bpi cxEditorsC11.bpi dxThemeC11.bpi \ + cxLibraryC11.bpi cxDataC11.bpi rtl.bpi vcl.bpi dbrtl.bpi \ + vcldb.bpi vclx.bpi +SPARELIBS = rtl.lib vcl.lib CXLIBRARYC11.lib cxEditorsC11.lib \ + dclcxLibraryC11.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressEditors Library 5 by Developer Express Inc." -aa \ + -Tpp -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC11.cpp b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC11.cpp new file mode 100644 index 00000000..ef87c63a --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC11.cpp @@ -0,0 +1,38 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxEditorsC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEUNIT("cxEditPropEditors.pas"); +USEUNIT("cxEditReg.pas"); +USERES("cxEditReg.dcr"); +USEFORMNS("cxMaskEditTextEditor.pas", Cxmaskedittexteditor, cxMaskEditTextEditorDlg); +USEFORMNS("cxSelectEditRepositoryItem.pas", Cxselecteditrepositoryitem, cxSelectRepositoryItem); +USEUNIT("cxEditRepositoryEditor.pas"); +USEUNIT("cxFilterControlReg.pas"); +USEUNIT("cxInplaceContainerReg.pas"); +USERES("cxFilterControlReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC11.res b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC11.res new file mode 100644 index 00000000..4fc678e0 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC11.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC5.bpk b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC5.bpk new file mode 100644 index 00000000..8e66f113 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC5.bpk @@ -0,0 +1,203 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxEditorsC5.bpl +OBJFILES = dclcxEditorsC5.obj \ + cxEditPropEditors.obj cxEditReg.obj \ + cxMaskEditTextEditor.obj \ + cxSelectEditRepositoryItem.obj \ + cxEditRepositoryEditor.obj cxFilterControlReg.obj \ + cxInplaceContainerReg.obj +RESFILES = dclcxEditorsC5.res cxEditReg.dcr cxFilterControlReg.dcr +MAINSOURCE = dclcxEditorsVCLC5.cpp +RESDEPEN = $(RESFILES) cxMaskEditTextEditor.dfm \ + cxSelectEditRepositoryItem.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = dsnide50.bpi dclcxLibraryVCLC5.bpi cxEditorsC5.bpi dxThemeC5.bpi \ + cxLibraryVCLC5.bpi cxDataC5.bpi vcl50.bpi dcldb50.bpi vcldb50.bpi vclx50.bpi +SPARELIBS = vcl50.lib CXLIBRARYVCLC5.lib cxEditorsC5.lib dcldb50.lib \ + dclcxLibraryVCLC5.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M -LUdclstd50 -LUdcldb50 +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressEditors Library 5 (VCL Edition) by Developer Express Inc." -aa \ + -Tpp -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC5.cpp b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC5.cpp new file mode 100644 index 00000000..eb40227e --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC5.cpp @@ -0,0 +1,36 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxEditorsC5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("dcldb50.bpi"); +USEPACKAGE("dsnide50.bpi"); +USEUNIT("cxEditPropEditors.pas"); +USEUNIT("cxEditReg.pas"); +USEUNIT("cxInplaceContainerReg.pas"); +USERES("cxEditReg.dcr"); +USEFORMNS("cxSelectEditRepositoryItem.pas", Cxselecteditrepositoryitem, cxSelectRepositoryItem); +USEUNIT("cxEditRepositoryEditor.pas"); +USEPACKAGE("dclcxLibraryVCLC5.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("vclx50.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEUNIT("cxFilterControlReg.pas"); +USERES("cxFilterControlReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC5.res b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC5.res new file mode 100644 index 00000000..b9272ea3 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsC5.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD10.dpk b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD10.dpk new file mode 100644 index 00000000..0b4b0c99 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD10.dpk @@ -0,0 +1,49 @@ +package dclcxEditorsD10; + +{$R *.res} +{$R cxEditReg.dcr} +{$R cxFilterControlReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressEditors Library 5 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + vcldb, + cxEditorsD10, + designide, + dcldb, + dclcxLibraryD10; + +contains + cxEditReg, + cxEditRepositoryEditor, + cxMaskEditTextEditor, + cxSelectEditRepositoryItem, + cxFilterControlReg, + cxEditPropEditors, + cxInplaceContainerReg; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD10.res b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD10.res new file mode 100644 index 00000000..d6094b98 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD10.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD11.dpk b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD11.dpk new file mode 100644 index 00000000..75ab1c4b --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD11.dpk @@ -0,0 +1,49 @@ +package dclcxEditorsD11; + +{$R *.res} +{$R cxEditReg.dcr} +{$R cxFilterControlReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressEditors Library 5 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + vcldb, + cxEditorsD11, + designide, + dcldb, + dclcxLibraryD11; + +contains + cxEditReg, + cxEditRepositoryEditor, + cxMaskEditTextEditor, + cxSelectEditRepositoryItem, + cxFilterControlReg, + cxEditPropEditors, + cxInplaceContainerReg; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD11.res b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD11.res new file mode 100644 index 00000000..e31f4565 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD11.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD5.dpk b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD5.dpk new file mode 100644 index 00000000..1a5b92ce --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD5.dpk @@ -0,0 +1,48 @@ +package dclcxEditorsD5; + +{$R *.RES} +{$R cxEditReg.dcr} +{$R cxFilterControlReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressEditors Library 5 (VCL Edition) by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcldb50, + cxEditorsD5, + dsnide50, + dclcxLibraryVCLD5, + dcldb50; + +contains + cxEditReg, + cxEditRepositoryEditor, + cxMaskEditTextEditor, + cxSelectEditRepositoryItem, + cxFilterControlReg, + cxEditPropEditors, + cxInplaceContainerReg; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD5.res b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD5.res new file mode 100644 index 00000000..24cd266a Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD5.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD9.dpk b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD9.dpk new file mode 100644 index 00000000..2d025b34 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD9.dpk @@ -0,0 +1,49 @@ +package dclcxEditorsD9; + +{$R *.res} +{$R cxEditReg.dcr} +{$R cxFilterControlReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressEditors Library 5 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + vcldb, + cxEditorsD9, + designide, + dcldb, + dclcxLibraryD9; + +contains + cxEditReg, + cxEditRepositoryEditor, + cxMaskEditTextEditor, + cxSelectEditRepositoryItem, + cxFilterControlReg, + cxEditPropEditors, + cxInplaceContainerReg; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD9.res b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD9.res new file mode 100644 index 00000000..6b059f63 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsD9.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLC6.bpk b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLC6.bpk new file mode 100644 index 00000000..e8d4f6d7 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLC6.bpk @@ -0,0 +1,205 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxEditorsVCLC6.bpl +OBJFILES = dclcxEditorsVCLC6.obj \ + cxEditPropEditors.obj cxEditReg.obj \ + cxMaskEditTextEditor.obj \ + cxSelectEditRepositoryItem.obj \ + cxEditRepositoryEditor.obj cxFilterControlReg.obj \ + cxInplaceContainerReg.obj +RESFILES = dclcxEditorsVCLC6.res cxEditReg.dcr cxFilterControlReg.dcr +MAINSOURCE = dclcxEditorsVCLC6.cpp +RESDEPEN = $(RESFILES) cxEditMaskEditor.dfm \ + cxMaskEditTextEditor.dfm \ + cxSelectEditRepositoryItem.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = designide.bpi dclcxLibraryVCLC6.bpi cxEditorsVCLC6.bpi dxThemeC6.bpi \ + cxLibraryVCLC6.bpi cxDataC6.bpi rtl.bpi vcl.bpi dcldb.bpi dbrtl.bpi \ + vcldb.bpi vclx.bpi +SPARELIBS = rtl.lib vcl.lib CXLIBRARYVCLC6.lib cxEditorsVCLC6.lib dcldb.lib \ + dclcxLibraryVCLC6.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressEditors Library 5 (VCL Edition) by Developer Express Inc." -aa \ + -Tpp -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLC6.cpp b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLC6.cpp new file mode 100644 index 00000000..686fe279 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLC6.cpp @@ -0,0 +1,39 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxEditorsVCLC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("dcldb.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dclcxLibraryVCLC6.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEUNIT("cxEditPropEditors.pas"); +USEUNIT("cxEditReg.pas"); +USERES("cxEditReg.dcr"); +USEFORMNS("cxMaskEditTextEditor.pas", Cxmaskedittexteditor, cxMaskEditTextEditorDlg); +USEFORMNS("cxSelectEditRepositoryItem.pas", Cxselecteditrepositoryitem, cxSelectRepositoryItem); +USEUNIT("cxEditRepositoryEditor.pas"); +USEUNIT("cxFilterControlReg.pas"); +USEUNIT("cxInplaceContainerReg.pas"); +USERES("cxFilterControlReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLC6.res b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLC6.res new file mode 100644 index 00000000..8f35f4b9 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLC6.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLD6.dpk b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLD6.dpk new file mode 100644 index 00000000..bccd170b --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLD6.dpk @@ -0,0 +1,49 @@ +package dclcxEditorsVCLD6; + +{$R *.res} +{$R cxEditReg.dcr} +{$R cxFilterControlReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressEditors Library 5 (VCL Edition) by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + vcldb, + cxEditorsVCLD6, + designide, + dcldb, + dclcxLibraryVCLD6; + +contains + cxEditReg, + cxEditRepositoryEditor, + cxMaskEditTextEditor, + cxSelectEditRepositoryItem, + cxFilterControlReg, + cxEditPropEditors, + cxInplaceContainerReg; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLD6.res b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLD6.res new file mode 100644 index 00000000..0094c518 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLD6.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLD7.dpk b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLD7.dpk new file mode 100644 index 00000000..335bb383 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLD7.dpk @@ -0,0 +1,49 @@ +package dclcxEditorsVCLD7; + +{$R *.res} +{$R cxEditReg.dcr} +{$R cxFilterControlReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressEditors Library 5 (VCL Edition) by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + vcldb, + cxEditorsVCLD7, + designide, + dcldb, + dclcxLibraryVCLD7; + +contains + cxEditReg, + cxEditRepositoryEditor, + cxMaskEditTextEditor, + cxSelectEditRepositoryItem, + cxFilterControlReg, + cxEditPropEditors, + cxInplaceContainerReg; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLD7.res b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLD7.res new file mode 100644 index 00000000..c85bce91 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/dclcxEditorsVCLD7.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC10.bpk b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC10.bpk new file mode 100644 index 00000000..0fc0c6d3 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC10.bpk @@ -0,0 +1,203 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxExtEditorsC10.bpl +OBJFILES = dclcxExtEditorsC10.obj \ + cxExtEditReg.obj \ + cxHintEditor.obj \ + cxShellEditorsReg.obj \ + cxSplitterEditor.obj cxCheckGroupStatesEditor.obj +RESFILES = dclcxExtEditorsC10.res cxExtEditReg.dcr +MAINSOURCE = dclcxExtEditorsC10.cpp +RESDEPEN = $(RESFILES) cxHintEditor.dfm \ + cxSplitterEditor.dfm cxCheckGroupStatesEditor.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = designide.bpi dclcxLibraryC10.bpi dclcxEditorsC10.bpi dxThemeC10.bpi \ + cxLibraryC10.bpi cxDataC10.bpi rtl.bpi vcl.bpi dbrtl.bpi \ + vcldb.bpi vclx.bpi cxEditorsC10.bpi cxExtEditorsC10.bpi +SPARELIBS = vcl.lib CXLIBRARYC10.lib cxEditorsC10.lib \ + dclcxLibraryC10.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -DBCB -$Y- -$L- -$D- -$A8 -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressExtendedEditors Library 5 by Developer Express Inc." -aa \ + -Tpp -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC10.cpp b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC10.cpp new file mode 100644 index 00000000..2fd88a87 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC10.cpp @@ -0,0 +1,37 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxExtEditorsC10.res"); +USERES("cxExtEditReg.dcr"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dclcxLibraryC10.bpi"); +USEPACKAGE("dclcxEditorsC10.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEPACKAGE("cxExtEditorsC10.bpi"); +USEUNIT("cxExtEditReg.pas"); +USEUNIT("cxShellEditorsReg.pas"); +USEFORMNS("cxHintEditor.pas", Cxhinteditor, cxHintStyleEditor); +USEFORMNS("cxSplitterEditor.pas", Cxsplittereditor, cxSplitEditor); +USEFORMNS("cxCheckGroupStatesEditor.pas", Cxcheckgroupstateseditor, cxCheckGroupStatesEditorDlg); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC10.res b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC10.res new file mode 100644 index 00000000..329289a7 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC10.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC11.bpk b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC11.bpk new file mode 100644 index 00000000..5f5e166c --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC11.bpk @@ -0,0 +1,203 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxExtEditorsC11.bpl +OBJFILES = dclcxExtEditorsC11.obj \ + cxExtEditReg.obj \ + cxHintEditor.obj \ + cxShellEditorsReg.obj \ + cxSplitterEditor.obj cxCheckGroupStatesEditor.obj +RESFILES = dclcxExtEditorsC11.res cxExtEditReg.dcr +MAINSOURCE = dclcxExtEditorsC11.cpp +RESDEPEN = $(RESFILES) cxHintEditor.dfm \ + cxSplitterEditor.dfm cxCheckGroupStatesEditor.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = designide.bpi dclcxLibraryC11.bpi dclcxEditorsC11.bpi dxThemeC11.bpi \ + cxLibraryC11.bpi cxDataC11.bpi rtl.bpi vcl.bpi dbrtl.bpi \ + vcldb.bpi vclx.bpi cxEditorsC11.bpi cxExtEditorsC11.bpi +SPARELIBS = vcl.lib CXLIBRARYC11.lib cxEditorsC11.lib \ + dclcxLibraryC11.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -DBCB -$Y- -$L- -$D- -$A8 -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressExtendedEditors Library 5 by Developer Express Inc." -aa \ + -Tpp -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC11.cpp b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC11.cpp new file mode 100644 index 00000000..21f8b186 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC11.cpp @@ -0,0 +1,37 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxExtEditorsC11.res"); +USERES("cxExtEditReg.dcr"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEPACKAGE("dclcxEditorsC11.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("cxExtEditorsC11.bpi"); +USEUNIT("cxExtEditReg.pas"); +USEUNIT("cxShellEditorsReg.pas"); +USEFORMNS("cxHintEditor.pas", Cxhinteditor, cxHintStyleEditor); +USEFORMNS("cxSplitterEditor.pas", Cxsplittereditor, cxSplitEditor); +USEFORMNS("cxCheckGroupStatesEditor.pas", Cxcheckgroupstateseditor, cxCheckGroupStatesEditorDlg); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC11.res b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC11.res new file mode 100644 index 00000000..00ef18ae Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC11.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC5.bpk b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC5.bpk new file mode 100644 index 00000000..d183d654 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC5.bpk @@ -0,0 +1,202 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxExtEditorsC5.bpl +OBJFILES = dclcxExtEditorsC5.obj \ + cxExtEditReg.obj \ + cxHintEditor.obj \ + cxShellEditorsReg.obj \ + cxSplitterEditor.obj cxCheckGroupStatesEditor.obj +RESFILES = dclcxExtEditorsC5.res cxExtEditReg.dcr +MAINSOURCE = dclcxExtEditorsC5.cpp +RESDEPEN = $(RESFILES) cxHintEditor.dfm \ + cxSplitterEditor.dfm cxCheckGroupStatesEditor.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = dclcxLibraryVCLC5.bpi cxEditorsC5.bpi dclcxEditorsC5.bpi \ + cxExtEditorsC5.bpi dxThemeC5.bpi cxLibraryVCLC5.bpi cxDataC5.bpi \ + vcl50.bpi vcldb50.bpi vclx50.bpi dcldb50.bpi +SPARELIBS = vcl50.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -DBCB -$Y- -$L- -$D- -$A8 -v -JPHNE -M -LUdclstd50 -LUdcldb50 +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressExtendedEditors Library 5 (VCL Edition) by Developer Express Inc." -aa \ + -Tpp -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC5.cpp b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC5.cpp new file mode 100644 index 00000000..5c015de8 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC5.cpp @@ -0,0 +1,35 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxExtEditorsC5.res"); +USERES("cxExtEditReg.dcr"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("dclcxLibraryVCLC5.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("cxExtEditorsC5.bpi"); +USEPACKAGE("dclcxEditorsC5.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("dcldb50.bpi"); +USEPACKAGE("vclx50.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEUNIT("cxExtEditReg.pas"); +USEUNIT("cxShellEditorsReg.pas"); +USEFORMNS("cxHintEditor.pas", Cxhinteditor, cxHintStyleEditor); +USEFORMNS("cxSplitterEditor.pas", Cxsplittereditor, cxSplitEditor); +USEFORMNS("cxCheckGroupStatesEditor.pas", Cxcheckgroupstateseditor, cxCheckGroupStatesEditorDlg); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC5.res b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC5.res new file mode 100644 index 00000000..cb393352 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsC5.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD10.dpk b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD10.dpk new file mode 100644 index 00000000..36ab500f --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD10.dpk @@ -0,0 +1,51 @@ +package dclcxExtEditorsD10; + +{$R *.res} +{$R cxExtEditReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressExtendedEditors Library 5 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dbrtl, + vcljpg, + vcldb, + cxLibraryD10, + dxThemeD10, + cxEditorsD10, + cxDataD10, + cxExtEditorsD10, + dclcxEditorsD10; + +contains + cxExtEditReg, + cxShellEditorsReg, + cxHintEditor, + cxCheckGroupStatesEditor, + cxSplitterEditor; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD10.res b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD10.res new file mode 100644 index 00000000..2a55a61d Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD10.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD11.dpk b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD11.dpk new file mode 100644 index 00000000..43f18ac8 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD11.dpk @@ -0,0 +1,51 @@ +package dclcxExtEditorsD11; + +{$R *.res} +{$R cxExtEditReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressExtendedEditors Library 5 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dbrtl, + vcljpg, + vcldb, + cxLibraryD11, + dxThemeD11, + cxEditorsD11, + cxDataD11, + cxExtEditorsD11, + dclcxEditorsD11; + +contains + cxExtEditReg, + cxShellEditorsReg, + cxHintEditor, + cxCheckGroupStatesEditor, + cxSplitterEditor; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD11.res b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD11.res new file mode 100644 index 00000000..735f9a7b Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD11.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD5.dpk b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD5.dpk new file mode 100644 index 00000000..4eed89d5 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD5.dpk @@ -0,0 +1,48 @@ +package dclcxExtEditorsD5; + +{$R *.res} +{$R cxExtEditReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressExtendedEditors Library 5 (VCL Edition) by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcljpg50, + vcldb50, + cxLibraryVCLD5, + dxThemeD5, + cxEditorsD5, + cxDataD5, + cxExtEditorsD5, + dclcxEditorsD5; + +contains + cxExtEditReg, + cxShellEditorsReg, + cxHintEditor, + cxCheckGroupStatesEditor, + cxSplitterEditor; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD5.res b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD5.res new file mode 100644 index 00000000..c5a29fac Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD5.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD9.dpk b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD9.dpk new file mode 100644 index 00000000..32ee2ad3 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD9.dpk @@ -0,0 +1,51 @@ +package dclcxExtEditorsD9; + +{$R *.res} +{$R cxExtEditReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressExtendedEditors Library 5 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dbrtl, + vcljpg, + vcldb, + cxLibraryD9, + dxThemeD9, + cxEditorsD9, + cxDataD9, + cxExtEditorsD9, + dclcxEditorsD9; + +contains + cxExtEditReg, + cxShellEditorsReg, + cxHintEditor, + cxCheckGroupStatesEditor, + cxSplitterEditor; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD9.res b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD9.res new file mode 100644 index 00000000..c56b6876 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsD9.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLC6.bpk b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLC6.bpk new file mode 100644 index 00000000..503e7a2c --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLC6.bpk @@ -0,0 +1,203 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxExtEditorsVCLC6.bpl +OBJFILES = dclcxExtEditorsVCLC6.obj \ + cxExtEditReg.obj \ + cxHintEditor.obj \ + cxShellEditorsReg.obj \ + cxSplitterEditor.obj cxCheckGroupStatesEditor.obj +RESFILES = dclcxExtEditorsVCLC6.res cxExtEditReg.dcr +MAINSOURCE = dclcxExtEditorsVCLC6.cpp +RESDEPEN = $(RESFILES) cxHintEditor.dfm \ + cxSplitterEditor.dfm cxCheckGroupStatesEditor.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = designide.bpi dclcxLibraryVCLC6.bpi dclcxEditorsVCLC6.bpi dxThemeC6.bpi \ + cxLibraryVCLC6.bpi cxDataC6.bpi rtl.bpi vcl.bpi dcldb.bpi dbrtl.bpi \ + vcldb.bpi vclx.bpi cxEditorsVCLC6.bpi cxExtEditorsVCLC6.bpi +SPARELIBS = vcl.lib CXLIBRARYVCLC6.lib cxEditorsVCLC6.lib \ + dclcxLibraryVCLC6.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -DBCB -$Y- -$L- -$D- -$A8 -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressExtendedEditors Library 5 (VCL Edition) by Developer Express Inc." -aa \ + -Tpp -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLC6.cpp b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLC6.cpp new file mode 100644 index 00000000..901ad1a1 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLC6.cpp @@ -0,0 +1,38 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxExtEditorsVCLC6.res"); +USERES("cxExtEditReg.dcr"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("dcldb.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dclcxLibraryVCLC6.bpi"); +USEPACKAGE("dclcxEditorsVCLC6.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("cxExtEditorsVCLC6.bpi"); +USEUNIT("cxExtEditReg.pas"); +USEUNIT("cxShellEditorsReg.pas"); +USEFORMNS("cxHintEditor.pas", Cxhinteditor, cxHintStyleEditor); +USEFORMNS("cxSplitterEditor.pas", Cxsplittereditor, cxSplitEditor); +USEFORMNS("cxCheckGroupStatesEditor.pas", Cxcheckgroupstateseditor, cxCheckGroupStatesEditorDlg); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLC6.res b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLC6.res new file mode 100644 index 00000000..59f92a6b Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLC6.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLD6.dpk b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLD6.dpk new file mode 100644 index 00000000..cba43151 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLD6.dpk @@ -0,0 +1,51 @@ +package dclcxExtEditorsVCLD6; + +{$R *.res} +{$R cxExtEditReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressExtendedEditors Library 5 (VCL Edition) by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dbrtl, + vcljpg, + vcldb, + cxLibraryVCLD6, + dxThemeD6, + cxEditorsVCLD6, + cxDataD6, + cxExtEditorsVCLD6, + dclcxEditorsVCLD6; + +contains + cxExtEditReg, + cxShellEditorsReg, + cxHintEditor, + cxCheckGroupStatesEditor, + cxSplitterEditor; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLD6.res b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLD6.res new file mode 100644 index 00000000..7e7fe2fc Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLD6.res differ diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLD7.dpk b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLD7.dpk new file mode 100644 index 00000000..a19ad0f7 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLD7.dpk @@ -0,0 +1,51 @@ +package dclcxExtEditorsVCLD7; + +{$R *.res} +{$R cxExtEditReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressExtendedEditors Library 5 (VCL Edition) by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dbrtl, + vcljpg, + vcldb, + cxLibraryVCLD7, + dxThemeD7, + cxEditorsVCLD7, + cxDataD7, + cxExtEditorsVCLD7, + dclcxEditorsVCLD7; + +contains + cxExtEditReg, + cxShellEditorsReg, + cxHintEditor, + cxCheckGroupStatesEditor, + cxSplitterEditor; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLD7.res b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLD7.res new file mode 100644 index 00000000..0b6405f8 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Packages/dclcxExtEditorsVCLD7.res differ diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxBlobEdit.pas b/official/x.35/ExpressEditors Library 5/Sources/cxBlobEdit.pas new file mode 100644 index 00000000..8d426583 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxBlobEdit.pas @@ -0,0 +1,1535 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxBlobEdit; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, ExtDlgs, +{$IFDEF DELPHI6} + Types, +{$ENDIF} + SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls, + Dialogs, StdCtrls, ImgList, Clipbrd, + cxClasses, cxControls, cxContainer, cxGraphics, cxDataStorage, cxDataUtils, + cxEdit, cxDropDownEdit, cxEditConsts, cxTextEdit, cxButtons, cxImage, cxMemo, + cxFilterControlUtils; + +type + TcxBlobPaintStyle = (bpsDefault, bpsIcon, bpsText); + TcxBlobEditKind = (bekAuto, bekMemo, bekPict, bekOle, bekBlob); + + { TcxBlobEditViewData } + + TcxBlobEditViewData = class(TcxCustomDropDownEditViewData) + protected + function InternalGetEditConstantPartSize(ACanvas: TcxCanvas; AIsInplace: Boolean; + AEditSizeProperties: TcxEditSizeProperties; var MinContentSize: TSize; + AViewInfo: TcxCustomEditViewInfo): TSize; override; + function InternalEditValueToDisplayText(AEditValue: TcxEditValue): string; override; + procedure PrepareDrawTextFlags(ACanvas: TcxCanvas; + AViewInfo: TcxCustomEditViewInfo); override; + public + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; + AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); override; + procedure EditValueToDrawValue(ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + AViewInfo: TcxCustomEditViewInfo); override; + end; + + { TcxBlobEditViewInfo } + + TcxBlobEditViewInfo = class(TcxCustomTextEditViewInfo) + protected + procedure InternalPaint(ACanvas: TcxCanvas); override; + public + IconRect: TRect; + ImageIndex: TImageIndex; + function NeedShowHint(ACanvas: TcxCanvas; const P: TPoint; out AText: TCaption; + out AIsMultiLine: Boolean; out ATextRect: TRect): Boolean; override; + procedure Offset(DX, DY: Integer); override; + end; + + { TcxCustomBlobEditProperties } + + TcxCustomBlobEditProperties = class(TcxCustomPopupEditProperties) + private + // common + FAlwaysSaveData: Boolean; + FBlobEditKind: TcxBlobEditKind; + FBlobPaintStyle: TcxBlobPaintStyle; + // memo + FMemoAutoReplace: Boolean; + FMemoWantReturns: Boolean; + FMemoWantTabs: Boolean; + FMemoOEMConvert: Boolean; + FMemoWordWrap: Boolean; + FMemoMaxLength: Integer; + FMemoCharCase: TEditCharCase; + FMemoScrollBars: TScrollStyle; + // picture + FPictureAutoSize: Boolean; + FPictureClipboardFormat: Word; + FPictureFilter: string; + FPictureGraphicClass: TGraphicClass; + FPictureTransparency: TcxImageTransparency; + FShowExPopupItems: Boolean; + FShowPicturePopup: Boolean; + + FOnAssignPicture: TcxImageAssignPictureEvent; + FOnGetGraphicClass: TcxImageGraphicClassEvent; + function GetPictureGraphicClassName: string; + function IsPictureGraphicClassNameStored: Boolean; + procedure ReadIsPictureGraphicClassNameEmpty(Reader: TReader); + procedure SetBlobEditKind(const Value: TcxBlobEditKind); + procedure SetBlobPaintStyle(const Value: TcxBlobPaintStyle); + procedure SetPictureGraphicClass(Value: TGraphicClass); + procedure SetPictureGraphicClassName(const Value: string); + procedure WriteIsPictureGraphicClassNameEmpty(Writer: TWriter); + protected + function CanValidate: Boolean; override; + procedure DefineProperties(Filer: TFiler); override; + function DropDownOnClick: Boolean; override; + function GetDisplayFormatOptions: TcxEditDisplayFormatOptions; override; + class function GetPopupWindowClass: TcxCustomEditPopupWindowClass; override; + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + function HasDisplayValue: Boolean; override; + procedure CorrectBlobEditKind; + function GetDefaultPictureGraphicClass: TGraphicClass; virtual; + function GetPictureGraphicClass(AItem: TObject; ARecordIndex: Integer; + APastingFromClipboard: Boolean = False): TGraphicClass; + // Picture + property PictureClipboardFormat: Word + read FPictureClipboardFormat write FPictureClipboardFormat; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + function CompareDisplayValues( + const AEditValue1, AEditValue2: TcxEditValue): Boolean; override; + class function GetContainerClass: TcxContainerClass; override; + function GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; override; + function GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; override; + function GetSpecialFeatures: TcxEditSpecialFeatures; override; + function GetSupportedOperations: TcxEditSupportedOperations; override; + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + function IsEditValueValid(var AEditValue: TcxEditValue; AEditFocused: Boolean): Boolean; override; + property PictureGraphicClass: TGraphicClass + read FPictureGraphicClass write SetPictureGraphicClass; + // !!! + // Common + property AlwaysSaveData: Boolean + read FAlwaysSaveData write FAlwaysSaveData default True; + property BlobEditKind: TcxBlobEditKind + read FBlobEditKind write SetBlobEditKind default bekAuto; + property BlobPaintStyle: TcxBlobPaintStyle + read FBlobPaintStyle write SetBlobPaintStyle default bpsIcon; + property ImmediatePopup default True; + // Memo + property MemoAutoReplace: Boolean + read FMemoAutoReplace write FMemoAutoReplace default False; + property MemoCharCase: TEditCharCase + read FMemoCharCase write FMemoCharCase default ecNormal; + property MemoMaxLength: Integer + read FMemoMaxLength write FMemoMaxLength default 0; + property MemoOEMConvert: Boolean + read FMemoOEMConvert write FMemoOEMConvert default False; + property MemoScrollBars: TScrollStyle + read FMemoScrollBars write FMemoScrollBars default ssNone; + property MemoWantReturns: Boolean + read FMemoWantReturns write FMemoWantReturns default True; + property MemoWantTabs: Boolean + read FMemoWantTabs write FMemoWantTabs default True; + property MemoWordWrap: Boolean + read FMemoWordWrap write FMemoWordWrap default True; + // Picture + property PictureAutoSize: Boolean + read FPictureAutoSize write FPictureAutoSize default True; + property PictureFilter: string + read FPictureFilter write FPictureFilter; + property PictureGraphicClassName: string + read GetPictureGraphicClassName write SetPictureGraphicClassName + stored IsPictureGraphicClassNameStored; + property PictureTransparency: TcxImageTransparency + read FPictureTransparency write FPictureTransparency default gtDefault; + property ShowExPopupItems: Boolean + read FShowExPopupItems write FShowExPopupItems default True; + property ShowPicturePopup: Boolean + read FShowPicturePopup write FShowPicturePopup default True; + property OnAssignPicture: TcxImageAssignPictureEvent + read FOnAssignPicture write FOnAssignPicture; + property OnGetGraphicClass: TcxImageGraphicClassEvent + read FOnGetGraphicClass write FOnGetGraphicClass; + end; + + { TcxBlobEditProperties } + + TcxBlobEditProperties = class(TcxCustomBlobEditProperties) + published + property AlwaysSaveData; + property AssignedValues; + property BlobEditKind; + property BlobPaintStyle; + property ClearKey; + property ImeMode; + property ImeName; + property ImmediatePopup; + property ImmediatePost; + property MemoAutoReplace; + property MemoCharCase; + property MemoMaxLength; + property MemoOEMConvert; + property MemoScrollBars; + property MemoWantReturns; + property MemoWantTabs; + property MemoWordWrap; + property PictureAutoSize; + property PictureFilter; + property PictureGraphicClassName; + property PictureTransparency; + property PopupHeight; + property PopupWidth; + property ReadOnly; + property ShowExPopupItems; + property ShowPicturePopup; + property OnAssignPicture; + property OnButtonClick; + property OnChange; + property OnCloseQuery; + property OnCloseUp; + property OnEditValueChanged; + property OnGetGraphicClass; + property OnInitPopup; + property OnPopup; + property OnValidate; + end; + + { TcxCustomBlobEdit } + + TcxCustomBlobEdit = class(TcxCustomPopupEdit) + private + FButtonWidth: Integer; + FCancelButton: TcxButton; + FGraphicClass: TGraphicClass; + FOkButton: TcxButton; + FStorage: TcxCustomEdit; + FOnGetGraphicClass: TcxImageEditGraphicClassEvent; + procedure DoPopupImageGetGraphicClass(Sender: TObject; + APastingFromClipboard: Boolean; var AGraphicClass: TGraphicClass); + procedure DoPopupImagePropertiesGetGraphicClass(AItem: TObject; + ARecordIndex: Integer; APastingFromClipboard: Boolean; + var AGraphicClass: TGraphicClass); + function GetActiveProperties: TcxCustomBlobEditProperties; + function GetProperties: TcxCustomBlobEditProperties; + procedure InternalChanged(Sender: TObject); + procedure PictureClosePopup(Sender: TcxControl; AReason: TcxEditCloseUpReason); + procedure SaveStorage; + procedure SetProperties(Value: TcxCustomBlobEditProperties); + protected + procedure ColorChanged; override; + procedure CreatePopupControls; virtual; + procedure DoAssignPicture; + procedure DoEditKeyPress(var Key: Char); override; + procedure DoOnAssignPicture(APicture: TPicture); + procedure FontChanged; override; + function GetDisplayValue: string; override; + function GetEditingValue: TcxEditValue; override; + function GetPopupFocusedControl: TWinControl; override; + function GetPopupWindowClientPreferredSize: TSize; override; + procedure InternalValidateDisplayValue(const ADisplayValue: TcxEditValue); override; + + procedure DestroyPopupControls; virtual; + procedure DoInitPopup; override; + function GetPictureGraphicClass(APastingFromClipboard: Boolean = False): TGraphicClass; + procedure Initialize; override; + function InternalGetText: string; override; + function InternalSetText(const Value: string): Boolean; override; + procedure PopupWindowClosed(Sender: TObject); override; + procedure PropertiesChanged(Sender: TObject); override; + procedure SetEditingText(const Value: TCaption); override; + procedure SetupPopupWindow; override; + procedure StorageEditingHandler(Sender: TObject; var CanEdit: Boolean); virtual; + procedure SynchronizeDisplayValue; override; + procedure SynchronizeEditValue; override; + property TabStop default True; + property OnGetGraphicClass: TcxImageEditGraphicClassEvent + read FOnGetGraphicClass write FOnGetGraphicClass; + public + destructor Destroy; override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + function IsEditClass: Boolean; override; + property ActiveProperties: TcxCustomBlobEditProperties + read GetActiveProperties; + property Properties: TcxCustomBlobEditProperties read GetProperties + write SetProperties; + end; + + { TcxBlobEdit } + + TcxBlobEdit = class(TcxCustomBlobEdit) + private + function GetActiveProperties: TcxBlobEditProperties; + function GetProperties: TcxBlobEditProperties; + procedure SetProperties(Value: TcxBlobEditProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxBlobEditProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxBlobEditProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Text; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDrag; + property BiDiMode; + property ParentBiDiMode; + property OnEndDock; + property OnStartDock; + end; + + { TcxFilterBlobEditHelper } + + TcxFilterBlobEditHelper = class(TcxFilterTextEditHelper) + public + class function GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; override; + end; + + { TcxBlobEditPopupWindow } + + TcxBlobEditPopupWindow = class(TcxPopupEditPopupWindow) + protected + procedure DoPopupControlKey(Key: Char); override; + end; + +function GetBlobText(const Value: TcxEditValue; + AProperties: TcxCustomBlobEditProperties; AFullText: Boolean): WideString; + +var + imgBlobImages: TImageList = nil; + +implementation + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Math, cxDrawTextUtils, cxEditUtils, cxGeometry, cxVariants; + +const + cxbmBlobNull = 'CXBMBLOB_BLOB_NULL'; + cxbmBlob = 'CXBMBLOB_BLOB'; + cxbmMemoNull = 'CXBMBLOB_MEMO_NULL'; + cxbmMemo = 'CXBMBLOB_MEMO'; + cxbmPictNull = 'CXBMBLOB_PICT_NULL'; + cxbmPict = 'CXBMBLOB_PICT'; + cxbmOleNull = 'CXBMBLOB_OLE_NULL'; + cxbmOle = 'CXBMBLOB_OLE'; + +type + TcxEditStyleAccess = class(TcxEditStyle); + TcxMemoAccess = class(TcxMemo); + + { TcxPopupMemo } + + TcxPopupMemo = class(TcxMemo) + private + FBlobEdit: TcxCustomBlobEdit; + protected + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + end; + + { TcxPopupImage } + + TcxPopupImage = class(TcxImage) + private + FBlobEdit: TcxCustomBlobEdit; + protected + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + end; + +function GetBlobText(const Value: TcxEditValue; + AProperties: TcxCustomBlobEditProperties; AFullText: Boolean): WideString; +begin + Result := ''; + if AFullText and (AProperties.BlobEditKind = bekMemo) and VarIsStr(Value) then + Result := Value + else + if AProperties.BlobPaintStyle = bpsDefault then + begin + case AProperties.BlobEditKind of + bekMemo: + if not VarIsNull(Value) then + Result := cxGetResourceString(@cxSBlobMemo) + else + Result := cxGetResourceString(@cxSBlobMemoEmpty); + bekPict: + if not VarIsNull(Value) then + Result := cxGetResourceString(@cxSBlobPicture) + else + Result := cxGetResourceString(@cxSBlobPictureEmpty); + end; + end + else + if (AProperties.BlobPaintStyle = bpsText) and + (AProperties.BlobEditKind = bekMemo) and VarIsStr(Value) then + begin + Result := Value; + ExtractFirstLine(Result); + end; +end; + +{ TcxBlobEditViewData } + +procedure TcxBlobEditViewData.Calculate(ACanvas: TcxCanvas; + const ABounds: TRect; const P: TPoint; Button: TcxMouseButton; + Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); + + function GetIconRect: TRect; + var + AIconSize: TSize; + begin + if imgBlobImages <> nil then + AIconSize := cxSize(imgBlobImages.Width, imgBlobImages.Height) + else + AIconSize := cxNullSize; + with AViewInfo.ClientRect do + begin + Result.Left := Left + (Right - Left - AIconSize.cx) div 2; + Result.Top := Top + (Bottom - Top - AIconSize.cy) div 2; + end; + Result.Right := Result.Left + AIconSize.cx; + Result.Bottom := Result.Top + AIconSize.cy; + end; + +begin + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, + AIsMouseEvent); + TcxBlobEditViewInfo(AViewInfo).IconRect := GetIconRect; + if Edit <> nil then + EditValueToDrawValue(ACanvas, Edit.EditValue, AViewInfo); + PrepareDrawTextFlags(ACanvas, AViewInfo); +end; + +procedure TcxBlobEditViewData.EditValueToDrawValue(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; AViewInfo: TcxCustomEditViewInfo); +begin + with TcxCustomBlobEditProperties(Properties) do + begin + CorrectBlobEditKind; + if BlobPaintStyle = bpsIcon then + begin + TcxBlobEditViewInfo(AViewInfo).Text := ''; + case BlobEditKind of + bekMemo: + TcxBlobEditViewInfo(AViewInfo).ImageIndex := 2; + bekPict: + TcxBlobEditViewInfo(AViewInfo).ImageIndex := 4; + bekOle: + TcxBlobEditViewInfo(AViewInfo).ImageIndex := 6; + bekBlob: + TcxBlobEditViewInfo(AViewInfo).ImageIndex := 0; + end; + if not VarIsSoftNull(AEditValue) then + Inc(TcxBlobEditViewInfo(AViewInfo).ImageIndex); + end + else + begin + inherited EditValueToDrawValue(ACanvas, AEditValue, AViewInfo); + TcxBlobEditViewInfo(AViewInfo).ImageIndex := -1; + end; + end; +end; + +function TcxBlobEditViewData.InternalGetEditConstantPartSize(ACanvas: TcxCanvas; AIsInplace: Boolean; + AEditSizeProperties: TcxEditSizeProperties; var MinContentSize: TSize; + AViewInfo: TcxCustomEditViewInfo): TSize; +begin + Result := inherited InternalGetEditConstantPartSize(ACanvas, AIsInplace, + AEditSizeProperties, MinContentSize, AViewInfo); + if (TcxCustomBlobEditProperties(Properties).BlobPaintStyle = bpsIcon) and (imgBlobImages <> nil) then + Result.cx := Result.cx + imgBlobImages.Width; +end; + +function TcxBlobEditViewData.InternalEditValueToDisplayText( + AEditValue: TcxEditValue): string; +begin + Result := GetBlobText(AEditValue, TcxCustomBlobEditProperties(Properties), False); +end; + +procedure TcxBlobEditViewData.PrepareDrawTextFlags(ACanvas: TcxCanvas; + AViewInfo: TcxCustomEditViewInfo); +var + AEditViewInfo: TcxBlobEditViewInfo; +begin + AEditViewInfo := TcxBlobEditViewInfo(AViewInfo); + AEditViewInfo.DrawTextFlags := CXTO_CENTER_VERTICALLY or CXTO_SINGLELINE; + if not IsInplace or (epoShowEndEllipsis in PaintOptions) then + AEditViewInfo.DrawTextFlags := AEditViewInfo.DrawTextFlags or CXTO_END_ELLIPSIS; +end; + +{ TcxBlobEditViewInfo } + +function TcxBlobEditViewInfo.NeedShowHint(ACanvas: TcxCanvas; const P: TPoint; + out AText: TCaption; out AIsMultiLine: Boolean; out ATextRect: TRect): Boolean; +begin + Result := False; +end; + +procedure TcxBlobEditViewInfo.Offset(DX, DY: Integer); +begin + inherited Offset(DX, DY); + OffsetRect(IconRect, DX, DY); +end; + +procedure TcxBlobEditViewInfo.InternalPaint(ACanvas: TcxCanvas); +var + AClipRgn, APrevClipRgn: TcxRegion; + R: TRect; +begin + if not RectVisible(ACanvas.Handle, Bounds) then + Exit; + + with ACanvas do + begin + if (ImageIndex = -1) and (Text <> '') then + begin + DrawCustomEdit(ACanvas, Self, True, bpsComboListEdit); + Brush.Style := bsClear; + Font := Self.Font; + Font.Color := TextColor; + cxTextOut(Canvas, PcxCaptionChar(Text), TextRect, DrawTextFlags); + Brush.Style := bsSolid; + end + else + begin + if Assigned(imgBlobImages) and (ImageIndex <> -1) then + begin + APrevClipRgn := ACanvas.GetClipRegion; + IntersectRect(R, IconRect, ClientRect); + AClipRgn := TcxRegion.Create(R); + ACanvas.SetClipRegion(AClipRgn, roIntersect); + try + if Transparent then + imgBlobImages.Draw(Canvas, IconRect.Left, IconRect.Top, ImageIndex, + Enabled) + else + cxEditUtils.DrawGlyph(ACanvas, + imgBlobImages, ImageIndex, IconRect, BackgroundColor, Enabled); + finally + ACanvas.SetClipRegion(APrevClipRgn, roSet); + end; + if not Transparent then + ACanvas.ExcludeClipRect(R); + end; + DrawCustomEdit(ACanvas, Self, True, bpsComboListEdit); + end; + if Focused and not IsInplace and not HasPopupWindow then + begin + R := ClientRect; + InflateRect(R, -1, -1); + Font.Color := clWhite; + Brush.Color := clBlack; + DrawFocusRect(R); + end; + end; +end; + +{ TcxCustomBlobEditProperties } + +constructor TcxCustomBlobEditProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + ImmediatePopup := True; + PopupMinWidth := 160; + PopupMinHeight := 140; + FAlwaysSaveData := True; + FBlobEditKind := bekAuto; + FBlobPaintStyle := bpsIcon; + // Memo + FMemoCharCase := ecNormal; + FMemoMaxLength := 0; + FMemoOEMConvert := False; + FMemoScrollBars := ssNone; + FMemoWantReturns := True; + FMemoWantTabs := True; + FMemoWordWrap := True; + // Picture + FPictureAutoSize := True; + FPictureGraphicClass := GetDefaultPictureGraphicClass; + FPictureTransparency := gtDefault; + FShowExPopupItems := True; + FShowPicturePopup := True; +end; + +function TcxCustomBlobEditProperties.GetPictureGraphicClassName: string; +begin + if FPictureGraphicClass = nil then + Result := '' + else + Result := FPictureGraphicClass.ClassName; +end; + +function TcxCustomBlobEditProperties.IsPictureGraphicClassNameStored: Boolean; +begin + Result := PictureGraphicClass <> GetDefaultPictureGraphicClass; +end; + +procedure TcxCustomBlobEditProperties.ReadIsPictureGraphicClassNameEmpty(Reader: TReader); +begin + Reader.ReadBoolean; + PictureGraphicClassName := ''; +end; + +procedure TcxCustomBlobEditProperties.SetBlobEditKind( + const Value: TcxBlobEditKind); +begin + if FBlobEditKind <> Value then + begin + FBlobEditKind := Value; + if Value in [bekPict, bekMemo] then + Buttons[0].Kind := bkDown + else + Buttons[0].Kind := bkEllipsis; + Changed; + end; +end; + +procedure TcxCustomBlobEditProperties.SetBlobPaintStyle( + const Value: TcxBlobPaintStyle); +begin + if FBlobPaintStyle <> Value then + begin + FBlobPaintStyle := Value; + Changed; + end; +end; + +procedure TcxCustomBlobEditProperties.SetPictureGraphicClass(Value: TGraphicClass); +begin + if FPictureGraphicClass <> Value then + begin + FPictureGraphicClass := Value; + Changed; + end; +end; + +procedure TcxCustomBlobEditProperties.SetPictureGraphicClassName(const Value: string); +var + APictureGraphicClass: TGraphicClass; +begin + if Value = '' then + PictureGraphicClass := nil + else + begin + APictureGraphicClass := GetGraphicClassByName(Value); + if APictureGraphicClass <> nil then + PictureGraphicClass := APictureGraphicClass; + end; +end; + +procedure TcxCustomBlobEditProperties.WriteIsPictureGraphicClassNameEmpty(Writer: TWriter); +begin + Writer.WriteBoolean(True); +end; + +function TcxCustomBlobEditProperties.CanValidate: Boolean; +begin + Result := BlobEditKind = bekMemo; +end; + +procedure TcxCustomBlobEditProperties.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('IsPictureGraphicClassNameEmpty', ReadIsPictureGraphicClassNameEmpty, + WriteIsPictureGraphicClassNameEmpty, PictureGraphicClassName = ''); +end; + +function TcxCustomBlobEditProperties.DropDownOnClick: Boolean; +begin + Result := True; +end; + +function TcxCustomBlobEditProperties.GetDisplayFormatOptions: TcxEditDisplayFormatOptions; +begin + Result := []; +end; + +class function TcxCustomBlobEditProperties.GetPopupWindowClass: TcxCustomEditPopupWindowClass; +begin + Result := TcxBlobEditPopupWindow; +end; + +class function TcxCustomBlobEditProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxBlobEditViewData; +end; + +function TcxCustomBlobEditProperties.HasDisplayValue: Boolean; +begin + Result := False; +end; + +procedure TcxCustomBlobEditProperties.CorrectBlobEditKind; +const + ABlobEditKindCorrectionA: array[TcxBlobKind] of TcxBlobEditKind = + (bekBlob, bekBlob, bekPict, bekMemo, bekOle); +begin + if (BlobEditKind = bekAuto) and + not((IDefaultValuesProvider <> nil) and not IDefaultValuesProvider.IsDataAvailable) then + begin + LockUpdate(True); + try + if IDefaultValuesProvider <> nil then + BlobEditKind := ABlobEditKindCorrectionA[IDefaultValuesProvider.DefaultBlobKind] + else + BlobEditKind := bekBlob; + finally + LockUpdate(False); + end; + end; +end; + +function TcxCustomBlobEditProperties.GetDefaultPictureGraphicClass: TGraphicClass; +begin + if GetRegisteredGraphicClasses.Count > 0 then + Result := TGraphicClass(GetRegisteredGraphicClasses[0]) + else + Result := nil; +end; + +function TcxCustomBlobEditProperties.GetPictureGraphicClass(AItem: TObject; + ARecordIndex: Integer; APastingFromClipboard: Boolean = False): TGraphicClass; +begin + Result := FPictureGraphicClass; + if Result = nil then + begin + if APastingFromClipboard then + Result := TBitmap; + if Assigned(FOnGetGraphicClass) then + FOnGetGraphicClass(AItem, ARecordIndex, + APastingFromClipboard, Result); + end; +end; + +procedure TcxCustomBlobEditProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomBlobEditProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with TcxCustomBlobEditProperties(Source) do + begin + // Common + Self.AlwaysSaveData := AlwaysSaveData; + Self.BlobEditKind := BlobEditKind; + Self.BlobPaintStyle := BlobPaintStyle; + // Memo + Self.MemoAutoReplace := MemoAutoReplace; + Self.MemoCharCase := MemoCharCase; + Self.MemoMaxLength := MemoMaxLength; + Self.MemoOEMConvert := MemoOEMConvert; + Self.MemoScrollBars := MemoScrollBars; + Self.MemoWantReturns := MemoWantReturns; + Self.MemoWantTabs := MemoWantTabs; + Self.MemoWordWrap := MemoWordWrap; + // Picture + Self.PictureAutoSize := PictureAutoSize; + Self.PictureFilter := PictureFilter; + Self.PictureGraphicClass := PictureGraphicClass; + Self.PictureTransparency := PictureTransparency; + Self.ShowExPopupItems := ShowExPopupItems; + Self.ShowPicturePopup := ShowPicturePopup; + Self.OnAssignPicture := OnAssignPicture; + Self.OnGetGraphicClass := OnGetGraphicClass; + end; + finally + EndUpdate + end + end + else + inherited Assign(Source); +end; + +function TcxCustomBlobEditProperties.CompareDisplayValues( + const AEditValue1, AEditValue2: TcxEditValue): Boolean; +begin + CorrectBlobEditKind; + Result := (BlobPaintStyle = bpsText) and (BlobEditKind = bekMemo) and + VarIsStr(AEditValue1) and VarIsStr(AEditValue2) and + InternalCompareString(AEditValue1, AEditValue2, True); +end; + +class function TcxCustomBlobEditProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxBlobEdit; +end; + +function TcxCustomBlobEditProperties.GetDisplayText( + const AEditValue: TcxEditValue; AFullText: Boolean = False; + AIsInplace: Boolean = True): WideString; +begin + Result := ''; + if not VarIsNull(AEditValue) then + case BlobEditKind of + bekMemo: + Result := GetBlobText(AEditValue, Self, AFullText); + bekPict: + Result := cxGetResourceString(@cxSBlobPicture); + bekOle: + Result := 'OLE'; + bekBlob: + Result := 'BLOB'; + end; +end; + +function TcxCustomBlobEditProperties.GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; +begin + CorrectBlobEditKind; + if BlobEditKind = bekMemo then + if (IDefaultValuesProvider <> nil) and IDefaultValuesProvider.IsBlob then + Result := evsValue + else + Result := evsText + else + Result := evsValue; +end; + +function TcxCustomBlobEditProperties.GetSpecialFeatures: TcxEditSpecialFeatures; +begin + Result := inherited GetSpecialFeatures; + if BlobEditKind = bekPict then + Include(Result, esfBlobEditValue); +end; + +function TcxCustomBlobEditProperties.GetSupportedOperations: TcxEditSupportedOperations; +begin + Result := [esoEditing]; + if Buttons.Count > 0 then + Include(Result, esoHotTrack); +end; + +class function TcxCustomBlobEditProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxBlobEditViewInfo; +end; + +function TcxCustomBlobEditProperties.IsEditValueValid( + var AEditValue: TcxEditValue; AEditFocused: Boolean): Boolean; +begin + Result := True; +end; + +function KeyDownToModalResult(var Key: Word; Shift: TShiftState; + AReturnClosed, AAlwaysSaveData: Boolean): TModalResult; +begin + Result := mrNone; + if ((Key = VK_F4) and not (ssAlt in Shift)) or (Key = VK_ESCAPE) or + ((Key in [VK_UP, VK_DOWN]) and (ssAlt in Shift)) then + begin + if AAlwaysSaveData and not (Key = VK_ESCAPE) then + Result := mrOk + else + Result := mrCancel + end + else + if (TranslateKey(Key) = VK_RETURN) and (AReturnClosed or (ssCtrl in Shift)) then + Result := mrOk; + if Result <> mrNone then + Key := 0; +end; + +{ TcxPopupMemo } + +procedure TcxPopupMemo.KeyDown(var Key: Word; Shift: TShiftState); +begin + TcxCustomEditPopupWindow(Parent).ModalResult := + KeyDownToModalResult(Key, Shift, not ActiveProperties.WantReturns, + FBlobEdit.ActiveProperties.AlwaysSaveData); + if Key = 0 then + KillMessages(InnerControl.Handle, WM_CHAR, WM_CHAR) // to block Ctrl+Enter + else + inherited KeyDown(Key, Shift); +end; + +{ TcxPopupImage } + +procedure TcxPopupImage.KeyDown(var Key: Word; Shift: TShiftState); +begin + TcxCustomEditPopupWindow(Parent).ModalResult := + KeyDownToModalResult(Key, Shift, True, + FBlobEdit.ActiveProperties.AlwaysSaveData); + inherited KeyDown(Key, Shift); +end; + +{ TcxCustomBlobEdit } + +destructor TcxCustomBlobEdit.Destroy; +begin + DestroyPopupControls; + inherited Destroy; +end; + +procedure TcxCustomBlobEdit.DoPopupImageGetGraphicClass(Sender: TObject; + APastingFromClipboard: Boolean; var AGraphicClass: TGraphicClass); +begin + AGraphicClass := GetPictureGraphicClass(APastingFromClipboard); +end; + +procedure TcxCustomBlobEdit.DoPopupImagePropertiesGetGraphicClass( + AItem: TObject; ARecordIndex: Integer; APastingFromClipboard: Boolean; + var AGraphicClass: TGraphicClass); +begin + DoPopupImageGetGraphicClass(nil, APastingFromClipboard, AGraphicClass); +end; + +function TcxCustomBlobEdit.GetActiveProperties: TcxCustomBlobEditProperties; +begin + Result := TcxCustomBlobEditProperties(InternalGetActiveProperties); +end; + +function TcxCustomBlobEdit.GetProperties: TcxCustomBlobEditProperties; +begin + Result := TcxCustomBlobEditProperties(FProperties); +end; + +procedure TcxCustomBlobEdit.InternalChanged(Sender: TObject); +begin + if FOkButton <> nil then + begin + FOkButton.Enabled := True(*FStorage.ModifiedAfterEnter*); + FOkButton.Default := FOkButton.Enabled; + end; +end; + +procedure TcxCustomBlobEdit.PictureClosePopup(Sender: TcxControl; AReason: TcxEditCloseUpReason); +begin + if not HasPopupWindow then + begin + if AReason = crEnter then + SaveStorage; + DoClosePopup(AReason); + end; +end; + +procedure TcxCustomBlobEdit.SaveStorage; + + function NeedSaveStorage: Boolean; + begin + Result := FStorage.EditModified and ((PopupWindow.ModalResult = mrOk) or + ((PopupWindow.ModalResult <> mrCancel) and ActiveProperties.AlwaysSaveData)) and + DoEditing; + end; + +begin + if NeedSaveStorage then + begin + if FStorage is TcxMemo then + InternalEditValue := TcxMemo(FStorage).Lines.Text + else + begin + if FStorage is TcxImage then + with TcxImage(FStorage).Picture do + if Graphic = nil then + FGraphicClass := nil + else + FGraphicClass := TGraphicClass(Graphic.ClassType); + InternalEditValue := FStorage.EditValue; + end; + ModifiedAfterEnter := True; + + DoAssignPicture; + if ActiveProperties.ImmediatePost and CanPostEditValue and ValidateEdit(True) then + InternalPostEditValue; + end; +end; + +procedure TcxCustomBlobEdit.SetProperties(Value: TcxCustomBlobEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomBlobEdit.ColorChanged; +begin + inherited ColorChanged; + if not IsDestroying and HasPopupWindow and (FStorage is TcxPopupMemo) then + TcxPopupMemo(FStorage).Style.Color := ActiveStyle.Color; +end; + +procedure TcxCustomBlobEdit.CreatePopupControls; + + procedure InitStorage(AStorageClass: TcxCustomEditClass); + begin + if (FStorage <> nil) and (AStorageClass <> FStorage.ClassType) then + DestroyPopupControls; + if FStorage = nil then + begin + FStorage := AStorageClass.Create(nil); + FStorage.OnEditing := StorageEditingHandler; + FStorage.Style.BorderStyle := ebsNone; + FStorage.ActiveProperties.OnChange := InternalChanged; + end; + FStorage.ActiveProperties.ReadOnly := not CanModify; + ActiveProperties.PopupControl := FStorage; + ActiveProperties.PopupSysPanelStyle := True; + FStorage.Parent := PopupWindow; + end; + + procedure InitButton(var AButton: TcxButton; const ACaption: string; AHeight, AWidth: Integer); + begin + if AButton = nil then + begin + AButton := TcxButton.Create(nil); + AButton.UseSystemPaint := False; + end; + AButton.Caption := ACaption; + AButton.Font.Assign(ActiveStyle.GetVisibleFont); + AButton.LookAndFeel.MasterLookAndFeel := PopupControlsLookAndFeel; + AButton.LookAndFeel.SkinPainter := ViewInfo.Painter; + AButton.Height := AHeight; + AButton.Width := AWidth; + AButton.Parent := PopupWindow; + end; + + procedure InitControls; + var + ACancelCaption, AOkCaption: string; + ATempWidth, AButtonHeight: Integer; + AFont: TFont; + begin + if ActiveProperties.ReadOnly or not DataBinding.IsDataAvailable then + ACancelCaption := cxGetResourceString(@cxSBlobButtonClose) + else + ACancelCaption := cxGetResourceString(@cxSBlobButtonCancel); + AOkCaption := cxGetResourceString(@cxSBlobButtonOK); + + AFont := ActiveStyle.GetVisibleFont; + FButtonWidth := Max(cxTextWidth(AFont, ACancelCaption + '00'), cxTextWidth(AFont, AOkCaption + '00')); + AButtonHeight := MulDiv(cxTextHeight(AFont), 20, 13); + + InitButton(FCancelButton, ACancelCaption, AButtonHeight, FButtonWidth); + FCancelButton.Cancel := True; + FCancelButton.ModalResult := mrCancel; + + if (not ActiveProperties.ReadOnly) and DataBinding.IsDataAvailable then + begin + InitButton(FOkButton, AOkCaption, AButtonHeight, FButtonWidth); + FOkButton.Enabled := FStorage.EditModified; + FOkButton.ModalResult := mrOk; + end + else + FreeAndNil(FOkButton); + + PopupWindow.MinSysPanelHeight := AButtonHeight + (AButtonHeight div 3); + ATempWidth := (AButtonHeight div 3) + FButtonWidth; + if FOkButton <> nil then ATempWidth := ATempWidth * 2; + ActiveProperties.PopupMinWidth := ATempWidth + GetSystemMetrics(SM_CXVSCROLL) + + AButtonHeight div 2; + end; + +begin + case ActiveProperties.BlobEditKind of + bekPict: + begin + InitStorage(TcxPopupImage); + with TcxPopupImage(FStorage) do + begin + FBlobEdit := Self; + ActiveProperties.ShowFocusRect := False; + ActiveProperties.Stretch := True; + ActiveProperties.CustomFilter := Self.ActiveProperties.PictureFilter; + ActiveProperties.GraphicTransparency := Self.ActiveProperties.PictureTransparency; + ActiveProperties.OnClosePopup := PictureClosePopup; + if not Self.ActiveProperties.ShowPicturePopup then + ActiveProperties.PopupMenuLayout.MenuItems := [] + else + if not Self.ActiveProperties.ShowExPopupItems then + ActiveProperties.PopupMenuLayout.MenuItems := + ActiveProperties.PopupMenuLayout.MenuItems - [pmiSave, pmiLoad]; + + ActiveProperties.GraphicClass := Self.ActiveProperties.PictureGraphicClass; + //OnAssignPicture := Self.ActiveProperties.OnAssignPicture; + //OnGetGraphicClass := Self.ActiveProperties.OnGetGraphicClass; + OnGetGraphicClass := Self.DoPopupImageGetGraphicClass; + ActiveProperties.OnGetGraphicClass := Self.DoPopupImagePropertiesGetGraphicClass; + LoadPicture(Picture, Self.GetPictureGraphicClass, Self.EditValue); + EditModified := False; + Style.LookAndFeel.MasterLookAndFeel := Self.PopupControlsLookAndFeel; + end; + ActiveProperties.PopupAutoSize := ActiveProperties.PictureAutoSize; + InitControls; + end; + bekMemo: + begin + InitStorage(TcxPopupMemo); + with TcxPopupMemo(FStorage) do + begin + FBlobEdit := Self; + ActiveProperties.CharCase := Self.ActiveProperties.MemoCharCase; + ActiveProperties.ImeMode := Self.ActiveProperties.ImeMode; + ActiveProperties.ImeName := Self.ActiveProperties.ImeName; + ActiveProperties.MaxLength := Self.ActiveProperties.MemoMaxLength; + ActiveProperties.OEMConvert := Self.ActiveProperties.MemoOEMConvert; + ActiveProperties.ScrollBars := Self.ActiveProperties.MemoScrollBars; + ActiveProperties.WantReturns := Self.ActiveProperties.MemoWantReturns; + ActiveProperties.WantTabs := Self.ActiveProperties.MemoWantTabs; + ActiveProperties.WordWrap := Self.ActiveProperties.MemoWordWrap; + Self.ActiveProperties.PopupAutoSize := False; + EditValue := Self.EditValue; + Style.LookAndFeel.MasterLookAndFeel := Self.PopupControlsLookAndFeel; + Style.Font.Assign(Self.ActiveStyle.GetVisibleFont); + Style.Color := Self.ActiveStyle.Color; + end; + InitControls; + end; + end; +end; + +procedure TcxCustomBlobEdit.DoAssignPicture; +begin + if FStorage is TcxPopupImage then + begin + LockEditValueChanging(True); + try + DoOnAssignPicture(TcxPopupImage(FStorage).Picture); + SaveModified; + try + EditModified := False; + DoEditing; + finally + RestoreModified; + end; + finally + LockEditValueChanging(False); + end; + end; +end; + +procedure TcxCustomBlobEdit.DoEditKeyPress(var Key: Char); +begin +// if (Key >= #32) and (Key <= #255) and ActiveProperties.ImmediateDropDown and +// not ActiveProperties.ReadOnly and not HasPopupWindow then +// FSaveKey := Key; + inherited DoEditKeyPress(Key); +end; + +procedure TcxCustomBlobEdit.DoOnAssignPicture(APicture: TPicture); +begin + with Properties do + if Assigned(OnAssignPicture) then + OnAssignPicture(Self, APicture); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnAssignPicture) then + OnAssignPicture(Self, APicture); +end; + +procedure TcxCustomBlobEdit.FontChanged; +begin + inherited FontChanged; + if not IsDestroying and HasPopupWindow then + begin + if FStorage is TcxPopupMemo then + TcxPopupMemo(FStorage).Style.Font.Assign(ActiveStyle.GetVisibleFont); + if FOkButton <> nil then + FOkButton.Font.Assign(ActiveStyle.GetVisibleFont); + if FCancelButton <> nil then + FCancelButton.Font.Assign(ActiveStyle.GetVisibleFont); + end; +end; + +function TcxCustomBlobEdit.GetDisplayValue: string; +begin + if (ActiveProperties.BlobEditKind = bekMemo) and (FStorage <> nil) then + Result := TcxPopupMemo(FStorage).Text + else + Result := inherited GetDisplayValue; +end; + +function TcxCustomBlobEdit.GetEditingValue: TcxEditValue; +begin + if HasPopupWindow and (ActiveProperties.BlobEditKind in [bekMemo, bekPict]) then + if ActiveProperties.BlobEditKind = bekMemo then + Result := TcxPopupMemo(FStorage).Text + else + Result := TcxPopupImage(FStorage).EditValue + else + Result := EditValue; +end; + +function TcxCustomBlobEdit.GetPopupFocusedControl: TWinControl; +begin + if FStorage <> nil then + Result := FStorage + else + Result := inherited GetPopupFocusedControl; +end; + +function TcxCustomBlobEdit.GetPopupWindowClientPreferredSize: TSize; +begin + with ActiveProperties do + if (BlobEditKind = bekPict) and PictureAutoSize then + begin + with TcxPopupImage(FStorage).Picture do + Result := Size(Width + 4, Height + 4); + end + else + Result := inherited GetPopupWindowClientPreferredSize; +end; + +procedure TcxCustomBlobEdit.InternalValidateDisplayValue(const ADisplayValue: TcxEditValue); +begin + if (ActiveProperties.BlobEditKind = bekMemo) and (FStorage <> nil) then + TcxPopupMemo(FStorage).Text := ADisplayValue; + inherited InternalValidateDisplayValue(ADisplayValue); +end; + +procedure TcxCustomBlobEdit.DestroyPopupControls; +begin + ActiveProperties.PopupControl := nil; + FreeAndNil(FOkButton); + FreeAndNil(FCancelButton); + FreeAndNil(FStorage); +end; + +procedure TcxCustomBlobEdit.DoInitPopup; +begin + inherited DoInitPopup; + CreatePopupControls; +end; + +function TcxCustomBlobEdit.GetPictureGraphicClass( + APastingFromClipboard: Boolean = False): TGraphicClass; +begin + if IsInplace then + with InplaceParams do + Result := ActiveProperties.GetPictureGraphicClass(Position.Item, + Position.RecordIndex, APastingFromClipboard) + else + begin + Result := ActiveProperties.PictureGraphicClass; + if Result = nil then + begin + if APastingFromClipboard then + Result := TBitmap; + if Assigned(FOnGetGraphicClass) then + FOnGetGraphicClass(Self, APastingFromClipboard, Result); + end; + end; +end; + +procedure TcxCustomBlobEdit.Initialize; +begin + inherited Initialize; + ControlStyle := ControlStyle - [csSetCaption]; + TabStop := True; +end; + +function TcxCustomBlobEdit.InternalGetText: string; +begin + if IsDesigning then + begin + Result := VarToStr(EditValue); + Exit; + end; + Result := ''; + if ActiveProperties.BlobEditKind = bekMemo then + if HasPopupWindow then + Result := TcxPopupMemo(FStorage).Text + else + if VarIsStr(EditValue) then + Result := VarToStr(EditValue); +end; + +function TcxCustomBlobEdit.InternalSetText(const Value: string): Boolean; +begin + if IsDesigning then + begin + EditValue := Value; + Result := True; + Exit; + end; + Result := ActiveProperties.BlobEditKind = bekMemo; + if not Result then + Exit; + if HasPopupWindow then + TcxPopupMemo(FStorage).EditingText := Value + else + EditValue := Value; +end; + +procedure TcxCustomBlobEdit.PopupWindowClosed(Sender: TObject); +begin + LockChangeEvents(True); + try + SaveStorage; + inherited PopupWindowClosed(Sender); + ShortRefreshContainer(False); + finally + LockChangeEvents(False); + end; +end; + +procedure TcxCustomBlobEdit.PropertiesChanged(Sender: TObject); +begin + if IsDestroying then + Exit; + inherited PropertiesChanged(Sender); + ShortRefreshContainer(False); + if HasPopupWindow and (FStorage is TcxPopupImage) then + TcxPopupImage(FStorage).ActiveProperties.GraphicClass := + ActiveProperties.PictureGraphicClass; + if HasPopupWindow and (FStorage is TcxPopupMemo) then + begin + TcxPopupMemo(FStorage).ActiveProperties.ImeMode := ActiveProperties.ImeMode; + TcxPopupMemo(FStorage).ActiveProperties.ImeName := ActiveProperties.ImeName; + end; +end; + +procedure TcxCustomBlobEdit.SetEditingText(const Value: TCaption); +begin + if ActiveProperties.BlobEditKind = bekMemo then + if HasPopupWindow then + Text := Value + else + inherited SetEditingText(Value); +end; + +procedure TcxCustomBlobEdit.SetupPopupWindow; +var + AHeight, ADelta: Integer; + R: TRect; +begin + if FCancelButton = nil then + begin + inherited SetupPopupWindow; + Exit; + end; + TcxEditStyleAccess(Style).PopupCloseButton := False; + inherited SetupPopupWindow; + AHeight := FCancelButton.Height; + ADelta := FButtonWidth + AHeight div 6; + + R := PopupWindow.ViewInfo.SizeGripRect; + if PopupWindow.ViewInfo.SizeGripCorner in [ecoTopRight, ecoBottomRight] then + Inc(ADelta, PopupWindow.Width - R.Left) + else + begin + Inc(ADelta, AHeight div 6); + if ADelta - FButtonWidth < R.Left then + ADelta := R.Left + FButtonWidth; + end; + if PopupWindow.ViewInfo.SizeGripCorner in [ecoTopLeft, ecoTopRight] then + begin + FCancelButton.SetBounds(PopupWindow.Width - ADelta, + R.Top + (PopupWindow.MinSysPanelHeight - AHeight) div 2 - 2, FButtonWidth, AHeight); + FCancelButton.Anchors := [akTop, akRight]; + end + else + begin + FCancelButton.SetBounds(PopupWindow.Width - ADelta, + R.Bottom - (AHeight + (PopupWindow.MinSysPanelHeight - AHeight) div 2 - 2), + FButtonWidth, AHeight); + FCancelButton.Anchors := [akBottom, akRight]; + end; + + if FOkButton <> nil then + begin + FOkButton.SetBounds(FCancelButton.Left - (FButtonWidth + (AHeight div 3)), + FCancelButton.Top, FButtonWidth, AHeight); + FOkButton.Anchors := FCancelButton.Anchors; + end; +end; + +procedure TcxCustomBlobEdit.StorageEditingHandler(Sender: TObject; + var CanEdit: Boolean); +begin + CanEdit := CanModify; +end; + +procedure TcxCustomBlobEdit.SynchronizeDisplayValue; +begin + ShortRefreshContainer(False); +end; + +procedure TcxCustomBlobEdit.SynchronizeEditValue; +begin + if (ActiveProperties.BlobEditKind = bekMemo) and (FStorage <> nil) then + inherited SynchronizeEditValue; +end; + +class function TcxCustomBlobEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomBlobEditProperties; +end; + +function TcxCustomBlobEdit.IsEditClass: Boolean; +begin + Result := False; +end; + +{ TcxBlobEdit } + +class function TcxBlobEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxBlobEditProperties; +end; + +function TcxBlobEdit.GetActiveProperties: TcxBlobEditProperties; +begin + Result := TcxBlobEditProperties(InternalGetActiveProperties); +end; + +function TcxBlobEdit.GetProperties: TcxBlobEditProperties; +begin + Result := TcxBlobEditProperties(FProperties); +end; + +procedure TcxBlobEdit.SetProperties(Value: TcxBlobEditProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxFilterBlobEditHelper } + +class function TcxFilterBlobEditHelper.GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; +begin + Result := [fcoBlanks, fcoNonBlanks]; + if (AProperties is TcxBlobEditProperties) and + (TcxBlobEditProperties(AProperties).BlobEditKind = bekMemo) then + Result := Result + [fcoLike, fcoNotLike]; +end; + +{ TcxBlobEditPopupWindow } + +procedure TcxBlobEditPopupWindow.DoPopupControlKey(Key: Char); +var + AStorage: TcxCustomEdit; +begin + AStorage := TcxCustomBlobEdit(Edit).FStorage; + if AStorage is TcxMemo then + if not TcxMemo(AStorage).ActiveProperties.ReadOnly then + if TcxCustomBlobEdit(Edit).ActiveProperties.MemoAutoReplace then + begin + TcxMemoAccess(AStorage).InnerEdit.EditValue := Key; + TcxMemo(AStorage).SelStart := 1; + TcxMemo(AStorage).ModifiedAfterEnter := True; + end + else + inherited DoPopupControlKey(Key); +end; + +procedure LoadBlobImages; +var + Bmp: TBitmap; +begin + Bmp := TBitmap.Create; + try + Bmp.LoadFromResourceName(HInstance, cxbmBlobNull); + imgBlobImages := TImageList.CreateSize(Bmp.Width, Bmp.Height); + imgBlobImages.AddMasked(Bmp, clOlive); + Bmp.LoadFromResourceName(HInstance, cxbmBlob); + imgBlobImages.AddMasked(Bmp, clOlive); + Bmp.LoadFromResourceName(HInstance, cxbmMemoNull); + imgBlobImages.AddMasked(Bmp, clOlive); + Bmp.LoadFromResourceName(HInstance, cxbmMemo); + imgBlobImages.AddMasked(Bmp, clOlive); + Bmp.LoadFromResourceName(HInstance, cxbmPictNull); + imgBlobImages.AddMasked(Bmp, clOlive); + Bmp.LoadFromResourceName(HInstance, cxbmPict); + imgBlobImages.AddMasked(Bmp, clOlive); + Bmp.LoadFromResourceName(HInstance, cxbmOleNull); + imgBlobImages.AddMasked(Bmp, clOlive); + Bmp.LoadFromResourceName(HInstance, cxbmOle); + imgBlobImages.AddMasked(Bmp, clOlive); + finally + Bmp.Free; + end; +end; + +initialization + LoadBlobImages; + GetRegisteredEditProperties.Register(TcxBlobEditProperties, scxSEditRepositoryBlobItem); + +finalization + FreeAndNil(imgBlobImages); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxButtonEdit.pas b/official/x.35/ExpressEditors Library 5/Sources/cxButtonEdit.pas new file mode 100644 index 00000000..b8d38ed7 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxButtonEdit.pas @@ -0,0 +1,257 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxButtonEdit; + +{$I cxVer.inc} + +interface + +uses + Classes, cxContainer, cxEdit, cxMaskEdit; + +type + { TcxCustomButtonEditProperties } + + TcxCustomButtonEditProperties = class(TcxCustomMaskEditProperties) + public + constructor Create(AOwner: TPersistent); override; + class function GetContainerClass: TcxContainerClass; override; + end; + + { TcxButtonEditProperties } + + TcxButtonEditProperties = class(TcxCustomButtonEditProperties) + published + property Alignment; + property AssignedValues; + property AutoSelect; + property BeepOnError; + property Buttons; + property CaseInsensitive; + property CharCase; + property ClearKey; + property ClickKey; + property EchoMode; + // deprecated + property HideCursor; + property HideSelection; + property IgnoreMaskBlank; + property ImeMode; + property ImeName; + property IncrementalSearch; + property LookupItems; + property LookupItemsSorted; + property MaskKind; + property EditMask; + property MaxLength; + property OEMConvert; + property PasswordChar; + property ReadOnly; + property UseLeftAlignmentOnEditing; + property ValidateOnEnter; + property ViewStyle; + property OnButtonClick; + property OnChange; + property OnEditValueChanged; + property OnNewLookupDisplayText; + property OnValidate; + end; + + { TcxCustomButtonEdit } + + TcxCustomButtonEdit = class(TcxCustomMaskEdit) + private + function GetProperties: TcxCustomButtonEditProperties; + function GetActiveProperties: TcxCustomButtonEditProperties; + procedure SetProperties(Value: TcxCustomButtonEditProperties); + protected + function InternalGetNotPublishedStyleValues: TcxEditStyleValues; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxCustomButtonEditProperties + read GetActiveProperties; + property Properties: TcxCustomButtonEditProperties read GetProperties + write SetProperties; + end; + + { TcxButtonEdit } + + TcxButtonEdit = class(TcxCustomButtonEdit) + private + FAreButtonsLoaded: Boolean; + function GetActiveProperties: TcxButtonEditProperties; + function GetProperties: TcxButtonEditProperties; + procedure SetProperties(Value: TcxButtonEditProperties); + protected + procedure ReadState(Reader: TReader); override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxButtonEditProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DragMode; + property Enabled; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxButtonEditProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Text; + property Visible; + property DragCursor; + property DragKind; + property ImeMode; + property ImeName; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDrag; + property OnEndDock; + property OnStartDock; + end; + +implementation + +uses + cxEditConsts; + +{ TcxCustomButtonEditProperties } + +constructor TcxCustomButtonEditProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + Buttons.Add; + Buttons[0].Kind := bkEllipsis; + Buttons[0].Default := True; +end; + +class function TcxCustomButtonEditProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxButtonEdit; +end; + +{ TcxCustomButtonEdit } + +class function TcxCustomButtonEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomButtonEditProperties; +end; + +function TcxCustomButtonEdit.InternalGetNotPublishedStyleValues: TcxEditStyleValues; +begin + Result := inherited InternalGetNotPublishedStyleValues - + [svButtonStyle, svButtonTransparency, svGradientButtons]; +end; + +function TcxCustomButtonEdit.GetProperties: TcxCustomButtonEditProperties; +begin + Result := TcxCustomButtonEditProperties(FProperties); +end; + +function TcxCustomButtonEdit.GetActiveProperties: TcxCustomButtonEditProperties; +begin + Result := TcxCustomButtonEditProperties(InternalGetActiveProperties); +end; + +procedure TcxCustomButtonEdit.SetProperties(Value: TcxCustomButtonEditProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxButtonEdit } + +class function TcxButtonEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxButtonEditProperties; +end; + +procedure TcxButtonEdit.ReadState(Reader: TReader); +begin + if not FAreButtonsLoaded then + begin + Properties.Buttons.Clear; + ActiveProperties.Buttons.Clear; + FAreButtonsLoaded := True; + end; + inherited ReadState(Reader); +end; + +function TcxButtonEdit.GetActiveProperties: TcxButtonEditProperties; +begin + Result := TcxButtonEditProperties(InternalGetActiveProperties); +end; + +function TcxButtonEdit.GetProperties: TcxButtonEditProperties; +begin + Result := TcxButtonEditProperties(FProperties); +end; + +procedure TcxButtonEdit.SetProperties(Value: TcxButtonEditProperties); +begin + FProperties.Assign(Value); +end; + +initialization + GetRegisteredEditProperties.Register(TcxButtonEditProperties, scxSEditRepositoryButtonItem); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxButtons.pas b/official/x.35/ExpressEditors Library 5/Sources/cxButtons.pas new file mode 100644 index 00000000..553ab82d --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxButtons.pas @@ -0,0 +1,2157 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxButtons; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, dxThemeManager, + Types, Classes, Controls, Graphics, StdCtrls, Forms, Menus, ImgList, + cxGraphics, cxLookAndFeels, cxLookAndFeelPainters, Buttons, cxControls, + cxContainer, cxClasses; + +const + CM_DROPDOWNPOPUPMENU = WM_DX + 1; + CM_CLOSEUPPOPUPMENU = WM_DX + 2; + cxDropDownButtonWidth = 15; + +type + TcxCustomButton = class; + TcxButtonKind = (cxbkStandard, cxbkDropDown, cxbkDropDownButton); + TcxButtonAssignedColor = (cxbcDefault, cxbcDefaultText, cxbcDisabled, cxbcDisabledText, + cxbcHot, cxbcHotText, cxbcNormal, cxbcNormalText, cxbcPressed, cxbcPressedText); + TcxButtonAssignedColors = set of TcxButtonAssignedColor; + TcxButtonGetDrawParamsEvent = procedure(Sender: TcxCustomButton; + AState: TcxButtonState; var AColor: TColor; AFont: TFont) of object; + + { TcxButtonColors } + + TcxButtonColors = class(TPersistent) + private + FButton: TcxCustomButton; + FAssignedColors: TcxButtonAssignedColors; + FColors: array[TcxButtonAssignedColor] of TColor; + function GetColor(const Index: Integer): TColor; + function IsColorStored(const Index: Integer): Boolean; + procedure SetAssignedColors(Value: TcxButtonAssignedColors); + procedure SetColor(const Index: Integer; const Value: TColor); + function TcxButtonState2TcxButtonAssignedColor(AState: TcxButtonState; ATextColor: Boolean): TcxButtonAssignedColor; + protected + function GetColorByState(const AState: TcxButtonState): TColor; + function GetTextColorByState(const AState: TcxButtonState): TColor; + public + constructor Create(AOwner: TcxCustomButton); + procedure Assign(Source: TPersistent); override; + published + property AssignedColors: TcxButtonAssignedColors read FAssignedColors write SetAssignedColors stored False; + property Default: TColor index Ord(cxbcDefault) read GetColor write SetColor stored IsColorStored; + property DefaultText: TColor index Ord(cxbcDefaultText) read GetColor write SetColor stored IsColorStored; + property Normal: TColor index Ord(cxbcNormal) read GetColor write SetColor stored IsColorStored; + property NormalText: TColor index Ord(cxbcNormalText) read GetColor write SetColor stored IsColorStored; + property Hot: TColor index Ord(cxbcHot) read GetColor write SetColor stored IsColorStored; + property HotText: TColor index Ord(cxbcHotText) read GetColor write SetColor stored IsColorStored; + property Pressed: TColor index Ord(cxbcPressed) read GetColor write SetColor stored IsColorStored; + property PressedText: TColor index Ord(cxbcPressedText) read GetColor write SetColor stored IsColorStored; + property Disabled: TColor index Ord(cxbcDisabled) read GetColor write SetColor stored IsColorStored; + property DisabledText: TColor index Ord(cxbcDisabledText) read GetColor write SetColor stored IsColorStored; + end; + + { TcxGlyphList } + + TcxGlyphList = class(TcxImageList) + private + FUsed: TBits; + FCount: Integer; + function AllocateIndex(ABitmap: TBitmap): Integer; + public + constructor CreateSize(AWidth, AHeight: Integer); + destructor Destroy; override; + function Add(AImage, AMask: TBitmap): Integer; reintroduce; + function AddMasked(AImage: TBitmap; AMaskColor: TColor): Integer; reintroduce; + procedure Delete(AIndex: Integer); + property Count: Integer read FCount; + end; + + TcxImageInfo = class + private + FGlyph: TBitmap; + FImages: TCustomImageList; + FImageIndex: Integer; + function GetOnChange: TNotifyEvent; + procedure SetGlyph(Value: TBitmap); + procedure SetImages(Value: TCustomImageList); + procedure SetImageIndex(Value: Integer); + procedure SetOnChange(Value: TNotifyEvent); + protected + function GetImageSize: TSize; + function IsImageAssigned: Boolean; + procedure GlyphChanged; + property Glyph: TBitmap read FGlyph write SetGlyph; + property Images: TCustomImageList read FImages write SetImages; + property ImageIndex: Integer read FImageIndex write SetImageIndex; + public + constructor Create; + destructor Destroy; override; + property OnChange: TNotifyEvent read GetOnChange write SetOnChange; + end; + + { TcxButtonGlyph } + + TcxButtonGlyph = class + private + FGlyphList: TcxGlyphList; + FIndexs: array[TButtonState] of Integer; + FNumGlyphs: TNumGlyphs; + FOnChange: TNotifyEvent; + + FImageInfo: TcxImageInfo; + + function GetGlyph: TBitmap; + function GetImageList: TCustomImageList; + function GetImageIndex: Integer; + procedure SetGlyph(Value: TBitmap); + procedure SetImageList(Value: TCustomImageList); + procedure SetImageIndex(Value: Integer); + + function GetImageSize: TSize; + function GetTransparentColor: TColor; + procedure GlyphChanged(Sender: TObject); + procedure SetNumGlyphs(Value: TNumGlyphs); + procedure Invalidate; + function CreateButtonGlyph(AState: TcxButtonState): Integer; virtual; + procedure DrawButtonGlyph(ACanvas: TCanvas; const AGlyphPos: TPoint; + AState: TcxButtonState); + procedure DrawButtonText(ACanvas: TCanvas; const ACaption: TCaption; + ATextBounds: TRect; AState: TcxButtonState; ABiDiFlags: LongInt; + ANativeStyle: Boolean{$IFDEF DELPHI7}; AWordWrap: Boolean{$ENDIF}); + procedure CalcButtonLayout(ACanvas: TCanvas; const AClient: TRect; + const AOffset: TPoint; const ACaption: TCaption; ALayout: TButtonLayout; + AMargin, ASpacing: Integer; var GlyphPos: TPoint; var TextBounds: TRect; + ABiDiFlags: LongInt{$IFDEF DELPHI7}; AWordWrap: Boolean{$ENDIF}); + protected + function CanWordWrapText{$IFDEF DELPHI7}(AWordWrap: Boolean){$ENDIF}: Boolean; + function GetTextOffsets(ALayout: TButtonLayout): TRect; virtual; + public + constructor Create; virtual; + destructor Destroy; override; + procedure Draw(ACanvas: TCanvas; const AClient: TRect; const AOffset: TPoint; + const ACaption: TCaption; ALayout: TButtonLayout; AMargin, ASpacing: Integer; + AState: TcxButtonState ; ABiDiFlags: LongInt; + ANativeStyle: Boolean{$IFDEF DELPHI7}; AWordWrap: Boolean{$ENDIF}); + + property ImageInfo: TcxImageInfo read FImageInfo; + property Glyph: TBitmap read GetGlyph write SetGlyph; + property ImageList: TCustomImageList read GetImageList write SetImageList; + property ImageIndex: Integer read GetImageIndex write SetImageIndex; + + property NumGlyphs: TNumGlyphs read FNumGlyphs write SetNumGlyphs; + property TransparentColor: TColor read GetTransparentColor; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + end; + + TcxButtonGlyphClass = class of TcxButtonGlyph; + + { TcxButtonActionLink } + + TcxButtonActionLink = class(TButtonActionLink) + private + function GetClient: TcxCustomButton; + property Client: TcxCustomButton read GetClient; + protected + procedure SetImageIndex(Value: Integer); override; + public + destructor Destroy; override; + end; + + { TcxCustomButton } + + TcxButtonDropDownMenuPopupEvent = procedure(Sender: TObject; + var APopupMenu: TPopupMenu; var AHandled: Boolean) of object; + + TcxButton = class; + + TcxCustomButton = class(TButton, + IdxSkinSupport, + IcxMouseTrackingCaller, + IcxLookAndFeelContainer) + private + FAutoSize: Boolean; + FIsPressed, FIsDefault: Boolean; + FCanvas: TcxCanvas; + FColors: TcxButtonColors; + FControlCanvas: TControlCanvas; + FLockDown: Boolean; + FDoPopup: Boolean; + FDropDownMenu: TPopupMenu; + FIsFocused: Boolean; + FIsMouseClick: Boolean; + FKind: TcxButtonKind; + FLookAndFeel: TcxLookAndFeel; + FPopupAlignment: TPopupAlignment; + FPopupMenu: TComponent; + FUseSystemPaint: Boolean; // deprecated + + // speed button support + FAllowAllUp: Boolean; + FCanBeFocused: Boolean; + FDown: Boolean; + FGroupIndex: Integer; + + // glyph support + FGlyph: TcxButtonGlyph; + FLayout: TButtonLayout; + FMargin: Integer; + FMenuVisible: Boolean; + FMouseInControl: Boolean; + FSpacing: Integer; + + // events + FOnDropDownMenuPopup: TcxButtonDropDownMenuPopupEvent; + FOnGetDrawParams: TcxButtonGetDrawParamsEvent; + + procedure InitializeCanvasColors(out AState: TcxButtonState; out AColor: TColor); + // glyph support + procedure SetGlyph(Value: TBitmap); + function GetGlyph: TBitmap; + function GetNumGlyphs: TNumGlyphs; + procedure SetNumGlyphs(Value: TNumGlyphs); + procedure GlyphChanged(Sender: TObject); + procedure SetLayout(Value: TButtonLayout); + procedure SetSpacing(Value: Integer); + procedure SetMargin(Value: Integer); + procedure DrawItem(const DrawItemStruct: TDrawItemStruct); + procedure UpdateImageInfo; + + procedure WMCaptureChanged(var Message: TMessage); message WM_CAPTURECHANGED; + procedure WMContextMenu(var Message: TWMContextMenu); message WM_CONTEXTMENU; + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND; + procedure WMLButtonDblClk(var Message: TWMLButtonDblClk); message WM_LBUTTONDBLCLK; + procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; + procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; + procedure CMCloseupPopupMenu(var Message: TMessage); message CM_CLOSEUPPOPUPMENU; + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + procedure CMDropDownPopupMenu(var Message: TMessage); message CM_DROPDOWNPOPUPMENU; + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; + procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED; + procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED; + procedure CNDrawItem(var Message: TWMDrawItem); message CN_DRAWITEM; + procedure CNKeyDown(var Message: TWMKeyDown); message CN_KEYDOWN; + procedure CNMeasureItem(var Message: TWMMeasureItem); message CN_MEASUREITEM; + procedure CNSysKeyDown(var Message: TWMSysKeyDown); message CN_SYSKEYDOWN; + procedure CMButtonPressed(var Message: TMessage); message CM_BUTTONPRESSED; + + procedure ExcludeDropDownButtonRect(var R: TRect); + procedure DoDropDownMenu; + function GetBorderRect(AState: TcxButtonState): TRect; + function GetContentRect: TRect; + function GetDropDownMenuAlignment(APopupPoint: TPoint; + AEstimatedAlignment: TPopupAlignment): TPopupAlignment; + function GetDropDownMenuPopupPoint(ADropDownMenu: TPopupMenu): TPoint; + procedure InternalPaint; + procedure InternalRecreateWindow; + function IsColorsStored: Boolean; + function IsHotTrack: Boolean; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); + procedure SetButtonAutoSize(Value: Boolean); + procedure SetColors(const Value: TcxButtonColors); + procedure SetKind(const Value: TcxButtonKind); + procedure SetLookAndFeel(Value: TcxLookAndFeel); + procedure SetPopupMenu(Value: TComponent); + + // speed button support + procedure CheckShowMenu(const P: TPoint); + function GetButtonState: TcxButtonState; + function GetMenuButtonBounds: TRect; + function GetSpeedButtonMode: Boolean; + procedure SetAllowAllUp(AValue: Boolean); + procedure SetCanBeFocused(AValue: Boolean); + procedure SetDown(AValue: Boolean); + procedure SetGroupIndex(AValue: Integer); + procedure UpdateGroup; + protected + procedure WndProc(var Message: TMessage); override; + procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override; + function CanResize(var NewWidth, NewHeight: Integer): Boolean; override; + function GetActionLinkClass: TControlActionLinkClass; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure Notification(AComponent: TComponent; + Operation: TOperation); override; + procedure CreateHandle; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure DestroyWindowHandle; override; + function GetPalette: HPALETTE; override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure SetButtonStyle(ADefault: Boolean); override; + procedure DoContextPopup(MousePos: TPoint; + var Handled: Boolean); override; + function DoOnDropDownMenuPopup(var APopupMenu: TPopupMenu): Boolean; virtual; + function DoShowPopupMenu(APopupMenu: TComponent; + X, Y: Integer): Boolean; virtual; + function GetGlyphClass: TcxButtonGlyphClass; virtual; + function GetPainterClass: TcxCustomLookAndFeelPainterClass; virtual; + function StandardButton: Boolean; virtual; + procedure UpdateSize; + + //IcxMouseTrackingCaller + procedure IcxMouseTrackingCaller.MouseLeave = ButtonMouseLeave; + procedure ButtonMouseLeave; + + // IcxLookAndFeelContainer + function GetLookAndFeel: TcxLookAndFeel; + + property AutoSize: Boolean read FAutoSize write SetButtonAutoSize default False; + property Colors: TcxButtonColors read FColors write SetColors stored IsColorsStored; + property DropDownMenu: TPopupMenu read FDropDownMenu write FDropDownMenu; + property Glyph: TBitmap read GetGlyph write SetGlyph; + property Kind: TcxButtonKind read FKind write SetKind default cxbkStandard; + property Layout: TButtonLayout read FLayout write SetLayout default blGlyphLeft; + property Margin: Integer read FMargin write SetMargin default -1; + property NumGlyphs: TNumGlyphs read GetNumGlyphs write SetNumGlyphs default 1; + property PopupAlignment: TPopupAlignment read FPopupAlignment + write FPopupAlignment default paLeft; + property Spacing: Integer read FSpacing write SetSpacing default 4; + property UseSystemPaint: Boolean read FUseSystemPaint + write FUseSystemPaint default False; // deprecated + property OnDropDownMenuPopup: TcxButtonDropDownMenuPopupEvent + read FOnDropDownMenuPopup write FOnDropDownMenuPopup; + property OnGetDrawParams: TcxButtonGetDrawParamsEvent + read FOnGetDrawParams write FOnGetDrawParams; + + // speed button support + property AllowAllUp: Boolean read FAllowAllUp write SetAllowAllUp default False; + property CanBeFocused: Boolean read FCanBeFocused write SetCanBeFocused default True; + property Down: Boolean read FDown write SetDown default False; + property GroupIndex: Integer read FGroupIndex write SetGroupIndex default 0; + property SpeedButtonMode: Boolean read GetSpeedButtonMode; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Click; override; + function CanFocus: Boolean; override; + function GetOptimalSize: TSize; virtual; + function UpdateAction(Action: TBasicAction): Boolean; override; + property LookAndFeel: TcxLookAndFeel read FLookAndFeel write SetLookAndFeel; + published + property PopupMenu: TComponent read FPopupMenu write SetPopupMenu; + end; + + { TcxButton } + + TcxButton = class(TcxCustomButton) + published +// property AutoSize; + property CanBeFocused; + property GroupIndex; + property Down; + property AllowAllUp; + property Action; + property Anchors; + property BiDiMode; + property Cancel; + property Caption; + property Colors; + property Constraints; + property Default; + property DropDownMenu; + property Enabled; + property Glyph; + property Kind; + property Layout; + property LookAndFeel; + property Margin; + property ModalResult; + property NumGlyphs; + property ParentBiDiMode; + property ParentShowHint; + property PopupAlignment; + property ShowHint; + property Spacing; + property TabOrder; + property TabStop; + property UseSystemPaint; // deprecated + property Visible; + property OnDropDownMenuPopup; + property OnEnter; + property OnExit; + property OnGetDrawParams; + end; + +function GetButtonPainterClass(ALookAndFeel: TcxLookAndFeel): TcxCustomLookAndFeelPainterClass; + +implementation + +uses + dxUxTheme, CommCtrl, dxThemeConsts, + cxGeometry, SysUtils, Consts, Dialogs, ActnList, Math; + +const + cxBtnStdVertTextOffsetCorrection = -1; + TextRectCorrection: TRect = (Left: 1; Top: 0; Right: 2; Bottom: 0); + +function GetButtonPainterClass(ALookAndFeel: TcxLookAndFeel): TcxCustomLookAndFeelPainterClass; +begin + if ALookAndFeel.SkinPainter <> nil then + Result := ALookAndFeel.SkinPainter + else + begin + Result := ALookAndFeel.Painter; + if Result.LookAndFeelStyle = lfsOffice11 then + if AreVisualStylesAvailable(totButton) then + Result := TcxWinXPLookAndFeelPainter + else + Result := TcxStandardLookAndFeelPainter; + end; +end; + +{ TcxButtonColors } + +constructor TcxButtonColors.Create(AOwner: TcxCustomButton); +var + AState: TcxButtonAssignedColor; +begin + inherited Create; + FButton := AOwner; + for AState := Low(AState) to High(AState) do + FColors[AState] := clDefault; +end; + +function TcxButtonColors.GetColor(const Index: Integer): TColor; +begin + Result := FColors[TcxButtonAssignedColor(Index)]; +end; + +function TcxButtonColors.IsColorStored(const Index: Integer): Boolean; +begin + Result := TcxButtonAssignedColor(Index) in FAssignedColors; +end; + +procedure TcxButtonColors.SetAssignedColors( + Value: TcxButtonAssignedColors); +var + AState: TcxButtonAssignedColor; +begin + if (FAssignedColors <> Value) and (csDesigning in FButton.ComponentState) then + begin + for AState := Low(AState) to High(AState) do + if not (AState in Value) then + FColors[AState] := clDefault + else + if FColors[AState] = clDefault then Exclude(Value, AState); + FAssignedColors := Value; + FButton.Invalidate; + end; +end; + +procedure TcxButtonColors.SetColor(const Index: Integer; + const Value: TColor); +begin + if (Value = clNone) or (Value = clDefault) then + begin + FColors[TcxButtonAssignedColor(Index)] := clDefault; + Exclude(FAssignedColors, TcxButtonAssignedColor(Index)); + FButton.Invalidate; + end + else if GetColor(Index) <> Value then + begin + FColors[TcxButtonAssignedColor(Index)] := Value; + Include(FAssignedColors, TcxButtonAssignedColor(Index)); + FButton.Invalidate; + end; +end; + +function TcxButtonColors.TcxButtonState2TcxButtonAssignedColor(AState: TcxButtonState; ATextColor: Boolean): TcxButtonAssignedColor; +begin + if ATextColor then + Result := cxbcNormalText + else + Result := cxbcNormal; + case AState of + cxbsDefault: + if ATextColor then + Result := cxbcDefaultText + else + Result := cxbcDefault; + cxbsHot: + if ATextColor then + Result := cxbcHotText + else + Result := cxbcHot; + cxbsPressed: + if ATextColor then + Result := cxbcPressedText + else + Result := cxbcPressed; + cxbsDisabled: + if ATextColor then + Result := cxbcDisabledText + else + Result := cxbcDisabled; + end; +end; + +function TcxButtonColors.GetColorByState(const AState: TcxButtonState): TColor; +var + AButtonColor: TcxButtonAssignedColor; +begin + AButtonColor := TcxButtonState2TcxButtonAssignedColor(AState, False); + if AButtonColor in AssignedColors then + Result := FColors[AButtonColor] + else + if AButtonColor = cxbcNormal then + Result := FColors[cxbcDefault] + else + Result := FColors[cxbcNormal]; +end; + +function TcxButtonColors.GetTextColorByState(const AState: TcxButtonState): TColor; +var + AButtonColor: TcxButtonAssignedColor; +begin + AButtonColor := TcxButtonState2TcxButtonAssignedColor(AState, True); + if AButtonColor in AssignedColors then + Result := FColors[AButtonColor] + else + Result := clDefault; +end; + +procedure TcxButtonColors.Assign(Source: TPersistent); +begin + if Source is TcxButtonColors then + with TcxButtonColors(Source) do + begin + Self.FColors := FColors; + Self.FAssignedColors := FAssignedColors; + Self.FButton.Invalidate; + end + else + inherited Assign(Source); +end; + +{ TcxGlyphList } + +constructor TcxGlyphList.CreateSize(AWidth, AHeight: Integer); +begin + inherited CreateSize(AWidth, AHeight); + FUsed := TBits.Create; +end; + +destructor TcxGlyphList.Destroy; +begin + FreeAndNil(FUsed); + inherited Destroy; +end; + +function TcxGlyphList.AllocateIndex(ABitmap: TBitmap): Integer; +begin + Result := FUsed.OpenBit; + if Result >= FUsed.Size then + begin + Result := inherited Add(ABitmap, nil); + FUsed.Size := Result + 1; + end; + FUsed[Result] := True; +end; + +function TcxGlyphList.Add(AImage, AMask: TBitmap): Integer; +begin + Result := AllocateIndex(AImage); + Replace(Result, AImage, AMask); + Inc(FCount); +end; + +function TcxGlyphList.AddMasked(AImage: TBitmap; AMaskColor: TColor): Integer; +begin + Result := AllocateIndex(AImage); + ReplaceMasked(Result, AImage, AMaskColor); + Inc(FCount); +end; + +procedure TcxGlyphList.Delete(AIndex: Integer); +begin + if FUsed[AIndex] then + begin + Dec(FCount); + FUsed[AIndex] := False; + end; +end; + +type + { TcxGlyphCache } + + TcxGlyphCache = class + private + FGlyphLists: TList; + public + constructor Create; + destructor Destroy; override; + function GetList(AWidth, AHeight: Integer): TcxGlyphList; + procedure ReturnList(AList: TcxGlyphList); + function Empty: Boolean; + end; + +{ TcxGlyphCache } + +constructor TcxGlyphCache.Create; +begin + inherited Create; + FGlyphLists := TList.Create; +end; + +destructor TcxGlyphCache.Destroy; +begin + FreeAndNil(FGlyphLists); + inherited Destroy; +end; + +function TcxGlyphCache.GetList(AWidth, AHeight: Integer): TcxGlyphList; +var + I: Integer; +begin + for I := FGlyphLists.Count - 1 downto 0 do + begin + Result := TcxGlyphList(FGlyphLists[I]); + with Result do + if (AWidth = Width) and (AHeight = Height) then Exit; + end; + Result := TcxGlyphList.CreateSize(AWidth, AHeight); + FGlyphLists.Add(Result); +end; + +procedure TcxGlyphCache.ReturnList(AList: TcxGlyphList); +begin + if AList = nil then Exit; + if AList.Count = 0 then + begin + FGlyphLists.Remove(AList); + AList.Free; + end; +end; + +function TcxGlyphCache.Empty: Boolean; +begin + Result := FGlyphLists.Count = 0; +end; + +var + GlyphCache: TcxGlyphCache = nil; + +{ TcxImageInfo } + +constructor TcxImageInfo.Create; +begin + inherited Create; + FGlyph := TBitmap.Create; + FGlyph.OnChange := OnChange; + FImageIndex := -1; +end; + +destructor TcxImageInfo.Destroy; +begin + FreeAndNil(FGlyph); + inherited; +end; + +function TcxImageInfo.GetImageSize: TSize; +begin + if not IsImageAssigned then + Result := cxNullSize + else + if IsGlyphAssigned(Glyph) then + begin + if (Glyph.Width = 0) or (Glyph.Height = 0) then + Glyph.Handle; //HandleNeeded + Result := Size(Glyph.Width, Glyph.Height) + end + else + Result := Size(Images.Width, Images.Height); +end; + +function TcxImageInfo.IsImageAssigned: Boolean; +begin + Result := IsGlyphAssigned(Glyph) or cxGraphics.IsImageAssigned(Images, ImageIndex); +end; + +procedure TcxImageInfo.GlyphChanged; +begin + CallNotify(OnChange, nil); +end; + +function TcxImageInfo.GetOnChange: TNotifyEvent; +begin + Result := FGlyph.OnChange; +end; + +procedure TcxImageInfo.SetGlyph(Value: TBitmap); +begin + FGlyph.Assign(Value); +end; + +procedure TcxImageInfo.SetImages(Value: TCustomImageList); +begin + if Images <> Value then + begin + FImages := Value; + if not IsGlyphAssigned(Glyph) and (ImageIndex <> -1) then + GlyphChanged; + end; +end; + +procedure TcxImageInfo.SetImageIndex(Value: Integer); +begin + if ImageIndex <> Value then + begin + FImageIndex := Value; + if not IsGlyphAssigned(Glyph) and (Images <> nil) then + GlyphChanged; + end; +end; + +procedure TcxImageInfo.SetOnChange(Value: TNotifyEvent); +begin + FGlyph.OnChange := Value; +end; + +{ TcxButtonGlyph } + +constructor TcxButtonGlyph.Create; +var + I: TButtonState; +begin + inherited Create; + FImageInfo := TcxImageInfo.Create; + FImageInfo.OnChange := GlyphChanged; + FNumGlyphs := 1; + for I := Low(I) to High(I) do + FIndexs[I] := -1; + if GlyphCache = nil then GlyphCache := TcxGlyphCache.Create; +end; + +destructor TcxButtonGlyph.Destroy; +begin + FreeAndNil(FImageInfo); + Invalidate; + if Assigned(GlyphCache) and GlyphCache.Empty then + FreeAndNil(GlyphCache); + inherited Destroy; +end; + +procedure TcxButtonGlyph.Invalidate; +var + I: TButtonState; +begin + for I := Low(I) to High(I) do + begin + if FIndexs[I] <> -1 then FGlyphList.Delete(FIndexs[I]); + FIndexs[I] := -1; + end; + GlyphCache.ReturnList(FGlyphList); + FGlyphList := nil; +end; + +function TcxButtonGlyph.GetImageSize: TSize; +begin + Result := ImageInfo.GetImageSize; + Result.cx := Result.cx div FNumGlyphs; +end; + +function TcxButtonGlyph.GetTransparentColor: TColor; +begin + Result := Glyph.TransparentColor; +end; + +procedure TcxButtonGlyph.GlyphChanged(Sender: TObject); +begin + Invalidate; + if Assigned(FOnChange) then FOnChange(Self); +end; + +function TcxButtonGlyph.GetGlyph: TBitmap; +begin + Result := ImageInfo.Glyph; +end; + +function TcxButtonGlyph.GetImageList: TCustomImageList; +begin + Result := ImageInfo.Images; +end; + +function TcxButtonGlyph.GetImageIndex: Integer; +begin + Result := ImageInfo.ImageIndex; +end; + +procedure TcxButtonGlyph.SetGlyph(Value: TBitmap); +var + ANumGlyphs: Integer; +begin + ANumGlyphs := 1; + ImageInfo.Glyph := Value; + if (Value <> nil) and (Value.Height > 0) then + begin + if Value.Width mod Value.Height = 0 then + begin + ANumGlyphs := Value.Width div Value.Height; + if ANumGlyphs > 4 then ANumGlyphs := 1; + end; + end; + NumGlyphs := ANumGlyphs; +end; + +procedure TcxButtonGlyph.SetImageList(Value: TCustomImageList); +begin + ImageInfo.Images := Value; +end; + +procedure TcxButtonGlyph.SetImageIndex(Value: Integer); +begin + ImageInfo.ImageIndex := Value; +end; + +procedure TcxButtonGlyph.SetNumGlyphs(Value: TNumGlyphs); +begin + Value := Min(Max(Value, 1), 4); + if Value <> FNumGlyphs then + begin + FNumGlyphs := Value; + GlyphChanged(Glyph); + end; +end; + +function TcxButtonGlyph.CreateButtonGlyph(AState: TcxButtonState): Integer; + + function GetStandardButtonState(AState: TcxButtonState): TButtonState; + const + States: array[TcxButtonState] of TButtonState = + //cxbsDefault, cxbsNormal, cxbsHot, cxbsPressed, cxbsDisabled; + (bsUp, bsUp, bsUp, bsDown, bsDisabled); + begin + Result := States[AState]; + if (Result = bsDown) and (NumGlyphs < 3) then + Result := bsUp; + end; + + function GetGlyphList(AWidth, AHeight: Integer): TcxGlyphList; + begin + if FGlyphList = nil then + begin + if GlyphCache = nil then + GlyphCache := TcxGlyphCache.Create; + FGlyphList := GlyphCache.GetList(AWidth, AHeight); + end; + Result := FGlyphList; + end; + + procedure InternalMakeImagesFromGlyph(AStandardButtonState: TButtonState; AImage, AMask: TBitmap; const AImageBounds: TRect); + var + ASrcRect: TRect; + AOffset: Integer; + begin + AOffset := Ord(AStandardButtonState); + if AOffset >= NumGlyphs then + AOffset := 0; + ASrcRect := cxRectOffset(AImageBounds, AOffset * cxRectWidth(AImageBounds), 0); + + if (AStandardButtonState = bsDisabled) and (NumGlyphs = 1) then + cxDrawImage(AImage.Canvas.Handle, AImageBounds, AImageBounds, Glyph, nil, -1, idmDisabled, False, 0, TransparentColor, False) + else + AImage.Canvas.CopyRect(AImageBounds, Glyph.Canvas, ASrcRect); + if (NumGlyphs <> 1) or (AStandardButtonState <> bsDisabled) then + AImage.TransparentColor := Glyph.TransparentColor; + cxMakeMaskBitmap(AImage, AMask); + Glyph.Dormant; + end; + + procedure InternalMakeImagesFromImageList(AStandardButtonState: TButtonState; AImage, AMask: TBitmap; const AImageBounds: TRect); + begin + if AStandardButtonState = bsDisabled then + begin + cxDrawImage(AImage.Canvas.Handle, AImageBounds, AImageBounds, nil, ImageList, ImageIndex, idmDisabled); + cxMakeMaskBitmap(AImage, AMask); + end + else + TcxImageList.GetImageInfo(ImageList.Handle, ImageIndex, AImage, AMask); + end; + + function InternalCreateButtonGlyph(AStandardButtonState: TButtonState; const AImageSize: TSize): Integer; + var + AImage, AMask: TBitmap; + AImageBounds: TRect; + begin + AImage := TcxBitmap.CreateSize(AImageSize.cx, AImageSize.cy); + AMask := cxCreateBitmap(AImageSize, pf1bit); + try + AImageBounds := cxRect(0, 0, AImageSize.cx, AImageSize.cy); + if IsGlyphAssigned(Glyph) then + InternalMakeImagesFromGlyph(AStandardButtonState, AImage, AMask, AImageBounds) + else + InternalMakeImagesFromImageList(AStandardButtonState, AImage, AMask, AImageBounds); + FIndexs[AStandardButtonState] := GetGlyphList(AImageSize.cx, AImageSize.cy).Add(AImage, AMask); + Result := FIndexs[AStandardButtonState]; + finally + AMask.Free; + AImage.Free; + end; + end; + + function GetGlyphIndex(AStandardButtonState: TButtonState): Integer; + begin + Result := FIndexs[AStandardButtonState]; + if (Result = -1) and ImageInfo.IsImageAssigned then + Result := InternalCreateButtonGlyph(AStandardButtonState, GetImageSize) + end; + +begin + Result := GetGlyphIndex(GetStandardButtonState(AState)); +end; + +procedure TcxButtonGlyph.DrawButtonGlyph(ACanvas: TCanvas; const AGlyphPos: TPoint; + AState: TcxButtonState); +begin + if not ImageInfo.IsImageAssigned then + Exit; + FGlyphList.Draw(ACanvas, AGlyphPos.X, AGlyphPos.Y, CreateButtonGlyph(AState)); +end; + +procedure TcxButtonGlyph.DrawButtonText(ACanvas: TCanvas; const ACaption: TCaption; + ATextBounds: TRect; AState: TcxButtonState ; ABiDiFlags: LongInt; + ANativeStyle: Boolean{$IFDEF DELPHI7}; AWordWrap: Boolean{$ENDIF}); + + procedure InternalDrawButtonText; + var + ADrawTextFlags: Integer; + begin + ADrawTextFlags := DT_CENTER or DT_VCENTER or ABiDiFlags; + if CanWordWrapText{$IFDEF DELPHI7}(AWordWrap){$ENDIF} then + ADrawTextFlags := ADrawTextFlags or DT_WORDBREAK; + cxDrawText(ACanvas.Handle, ACaption, ATextBounds, ADrawTextFlags); + end; + +var + ABrushStyle: TBrushStyle; + AFontColor: TColor; +begin + if Length(ACaption) = 0 then Exit; + ABrushStyle := ACanvas.Brush.Style; + try + ACanvas.Brush.Style := bsClear; + if AState = cxbsDisabled then + begin + OffsetRect(ATextBounds, 1, 1); + AFontColor := ACanvas.Font.Color; + ACanvas.Font.Color := clBtnHighlight; + InternalDrawButtonText; + OffsetRect(ATextBounds, -1, -1); + ACanvas.Font.Color := AFontColor; + end; + InternalDrawButtonText; + finally + ACanvas.Brush.Style := ABrushStyle; + end; +end; + +procedure TcxButtonGlyph.CalcButtonLayout(ACanvas: TCanvas; const AClient: TRect; + const AOffset: TPoint; const ACaption: TCaption; ALayout: TButtonLayout; + AMargin, ASpacing: Integer; var GlyphPos: TPoint; var TextBounds: TRect; + ABiDiFlags: LongInt{$IFDEF DELPHI7}; AWordWrap: Boolean{$ENDIF}); + + procedure CheckLayout; + begin + if ABiDiFlags and DT_RIGHT = DT_RIGHT then + begin + if ALayout = blGlyphLeft then + ALayout := blGlyphRight + else + if ALayout = blGlyphRight then + ALayout := blGlyphLeft; + end; + end; + + function GetCaptionSize: TPoint; + var + ADrawTextFlags: Integer; + ATextOffsets: TRect; + begin + if Length(ACaption) = 0 then + begin + TextBounds := cxNullRect; + Result := cxNullPoint; + end + else + begin + TextBounds := Rect(0, 0, AClient.Right - AClient.Left, 0); + ATextOffsets := GetTextOffsets(ALayout); + ExtendRect(TextBounds, ATextOffsets); + ADrawTextFlags := DT_CALCRECT or ABiDiFlags; + if CanWordWrapText{$IFDEF DELPHI7}(AWordWrap){$ENDIF} then + ADrawTextFlags := ADrawTextFlags or DT_WORDBREAK; + cxDrawText(ACanvas.Handle, ACaption, TextBounds, ADrawTextFlags); + with TextBounds do + Result := Point(Right - Left, Bottom - Top); + Inc(Result.X, ATextOffsets.Left + ATextOffsets.Right); + Inc(Result.Y, ATextOffsets.Top + ATextOffsets.Bottom); + end; + end; + +var + ATextPos: TPoint; + AGlyphSize: TSize; + AClientSize, ATextSize: TPoint; + ATotalSize: TPoint; +begin + CheckLayout; + ATextSize := GetCaptionSize; + with AClient do + AClientSize := Point(Right - Left, Bottom - Top); + +(* if FOriginal.Empty then + begin + GlyphPos := EmptyPoint; + ATextPos.X := (AClientSize.X - ATextSize.X) div 2; + ATextPos.Y := (AClientSize.Y - ATextSize.Y - 1) div 2; + OffsetRect(TextBounds, ATextPos.X + AOffset.X, ATextPos.Y + AOffset.Y); + Exit; + end;*) + + AGlyphSize := GetImageSize; + if ALayout in [blGlyphLeft, blGlyphRight] then + begin + GlyphPos.Y := (AClientSize.Y - AGlyphSize.cy) div 2; + ATextPos.Y := (AClientSize.Y - ATextSize.Y + + cxBtnStdVertTextOffsetCorrection) div 2; + end + else + begin + GlyphPos.X := (AClientSize.X - AGlyphSize.cx) div 2; + ATextPos.X := (AClientSize.X - ATextSize.X) div 2; + end; + + if (ATextSize.X = 0) or (AGlyphSize.cx = 0) then ASpacing := 0; + + if AMargin = -1 then + begin + if ASpacing = -1 then + begin + ATotalSize := Point(AGlyphSize.cx + ATextSize.X, AGlyphSize.cy + ATextSize.Y); + if ALayout in [blGlyphLeft, blGlyphRight] then + AMargin := (AClientSize.X - ATotalSize.X) div 3 + else + AMargin := (AClientSize.Y - ATotalSize.Y) div 3; + ASpacing := AMargin; + end + else + begin + ATotalSize := Point(AGlyphSize.cx + ASpacing + ATextSize.X, AGlyphSize.cy + + ASpacing + ATextSize.Y); + if ALayout in [blGlyphLeft, blGlyphRight] then + AMargin := (AClientSize.X - ATotalSize.X) div 2 + else + AMargin := (AClientSize.Y - ATotalSize.Y) div 2; + end; + end + else + begin + if ASpacing = -1 then + begin + ATotalSize := Point(AClientSize.X - (AMargin + AGlyphSize.cx), + AClientSize.Y - (AMargin + AGlyphSize.cy)); + if ALayout in [blGlyphLeft, blGlyphRight] then + ASpacing := (ATotalSize.X - ATextSize.X) div 2 + else + ASpacing := (ATotalSize.Y - ATextSize.Y) div 2; + end; + end; + case ALayout of + blGlyphLeft: + begin + GlyphPos.X := AMargin; + ATextPos.X := GlyphPos.X + AGlyphSize.cx + ASpacing; + end; + blGlyphRight: + begin + GlyphPos.X := AClientSize.X - AMargin - AGlyphSize.cx; + ATextPos.X := GlyphPos.X - ASpacing - ATextSize.X; + end; + blGlyphTop: + begin + GlyphPos.Y := AMargin; + ATextPos.Y := GlyphPos.Y + AGlyphSize.cy + ASpacing; + end; + blGlyphBottom: + begin + GlyphPos.Y := AClientSize.Y - AMargin - AGlyphSize.cy; + ATextPos.Y := GlyphPos.Y - ASpacing - ATextSize.Y; + end; + end; + with GlyphPos do + begin + Inc(X, AClient.Left + AOffset.X); + Inc(Y, AClient.Top + AOffset.Y); + end; + OffsetRect(TextBounds, AClient.Left + ATextPos.X + AOffset.X, AClient.Top + ATextPos.Y + AOffset.X); +end; + +procedure TcxButtonGlyph.Draw(ACanvas: TCanvas; const AClient: TRect; + const AOffset: TPoint; const ACaption: TCaption; ALayout: TButtonLayout; + AMargin, ASpacing: Integer; AState: TcxButtonState; + ABiDiFlags: LongInt; ANativeStyle: Boolean{$IFDEF DELPHI7}; AWordWrap: Boolean{$ENDIF}); +var + AGlyphPos: TPoint; + ATextRect: TRect; +begin + CalcButtonLayout(ACanvas, AClient, AOffset, ACaption, ALayout, AMargin, + ASpacing, AGlyphPos, ATextRect, ABiDiFlags{$IFDEF DELPHI7}, AWordWrap{$ENDIF}); + DrawButtonGlyph(ACanvas, AGlyphPos, AState); + DrawButtonText(ACanvas, ACaption, ATextRect, AState, ABiDiFlags, + ANativeStyle{$IFDEF DELPHI7}, AWordWrap{$ENDIF}); +end; + +function TcxButtonGlyph.CanWordWrapText{$IFDEF DELPHI7}(AWordWrap: Boolean){$ENDIF}: Boolean; +begin +{$IFDEF DELPHI7} + Result := AWordWrap and not ImageInfo.IsImageAssigned; +{$ELSE} + Result := False; +{$ENDIF} +end; + +function TcxButtonGlyph.GetTextOffsets(ALayout: TButtonLayout): TRect; +begin + if ImageInfo.IsImageAssigned then + Result := cxNullRect + else + Result := TextRectCorrection; +end; + +{ TcxButtonActionLink } + +destructor TcxButtonActionLink.Destroy; +begin + if not (csDestroying in Client.ComponentState) then + begin + Client.FGlyph.ImageList := nil; + Client.FGlyph.ImageIndex := -1; + end; + inherited; +end; + +procedure TcxButtonActionLink.SetImageIndex(Value: Integer); +begin + inherited; + Client.FGlyph.ImageIndex := Value; +end; + +function TcxButtonActionLink.GetClient: TcxCustomButton; +begin + Result := TcxButton(FClient); +end; + +{ TcxCustomButton } + +constructor TcxCustomButton.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FGlyph := GetGlyphClass.Create; + FGlyph.OnChange := GlyphChanged; + FColors := TcxButtonColors.Create(Self); + FControlCanvas := TControlCanvas.Create; + FControlCanvas.Control := Self; + FCanvas := TcxCanvas.Create(TCanvas(FControlCanvas)); + FLookAndFeel := TcxLookAndFeel.Create(Self); + FLookAndFeel.OnChanged := LookAndFeelChanged; + FDoPopup := True; + FKind := cxbkStandard; + FLayout := blGlyphLeft; + FPopupAlignment := paLeft; + FSpacing := 4; + FMargin := -1; + DoubleBuffered := True; + ControlStyle := ControlStyle + [csReflector, csOpaque]; + CanBeFocused := True; + GroupIndex := 0; + AllowAllUp := False; + Down := False; +end; + +destructor TcxCustomButton.Destroy; +begin + EndMouseTracking(Self); + FreeAndNil(FLookAndFeel); + FreeAndNil(FColors); + FreeAndNil(FGlyph); + FreeAndNil(FCanvas); + FreeAndNil(FControlCanvas); + inherited Destroy; +end; + +procedure TcxCustomButton.InitializeCanvasColors(out AState: TcxButtonState; out AColor: TColor); +begin + AState := GetButtonState; + FCanvas.Font.Assign(Font); + AColor := FColors.GetColorByState(AState); + + if FColors.GetTextColorByState(AState) = clDefault then + FCanvas.Font.Color := GetPainterClass.ButtonSymbolColor(AState, FCanvas.Font.Color) + else + FCanvas.Font.Color := FColors.GetTextColorByState(AState); +end; + +procedure TcxCustomButton.SetGlyph(Value: TBitmap); +begin + FGlyph.Glyph := Value; +end; + +function TcxCustomButton.GetGlyph: TBitmap; +begin + Result := FGlyph.Glyph; +end; + +procedure TcxCustomButton.GlyphChanged(Sender: TObject); +begin + Invalidate; +end; + +procedure TcxCustomButton.SetLayout(Value: TButtonLayout); +begin + if FLayout <> Value then + begin + FLayout := Value; + Invalidate; + end; +end; + +function TcxCustomButton.GetNumGlyphs: TNumGlyphs; +begin + Result := FGlyph.NumGlyphs; +end; + +procedure TcxCustomButton.SetNumGlyphs(Value: TNumGlyphs); +begin + FGlyph.NumGlyphs := Value; +end; + +procedure TcxCustomButton.SetSpacing(Value: Integer); +begin + if FSpacing <> Value then + begin + FSpacing := Value; + Invalidate; + end; +end; + +procedure TcxCustomButton.SetMargin(Value: Integer); +begin + if (Value <> FMargin) and (Value >= - 1) then + begin + FMargin := Value; + Invalidate; + end; +end; + +procedure TcxCustomButton.DoContextPopup(MousePos: TPoint; + var Handled: Boolean); +var + P: TPoint; +begin + inherited DoContextPopup(MousePos, Handled); + if not Handled then + begin + if (MousePos.X = -1) and (MousePos.Y = -1) then + P := ClientToScreen(Point(0, 0)) + else + P := ClientToScreen(MousePos); + Handled := DoShowPopupMenu(PopupMenu, P.X, P.Y); + end; +end; + +function TcxCustomButton.DoOnDropDownMenuPopup(var APopupMenu: TPopupMenu): Boolean; +begin + Result := False; + if Assigned(FOnDropDownMenuPopup) then + FOnDropDownMenuPopup(Self, APopupMenu, Result); +end; + +function TcxCustomButton.DoShowPopupMenu(APopupMenu: TComponent; + X, Y: Integer): Boolean; +begin + Result := ShowPopupMenu(Self, APopupMenu, X, Y); +end; + +function TcxCustomButton.GetGlyphClass: TcxButtonGlyphClass; +begin + Result := TcxButtonGlyph; +end; + +function TcxCustomButton.GetPainterClass: TcxCustomLookAndFeelPainterClass; +begin + Result := GetButtonPainterClass(LookAndFeel); +end; + +function TcxCustomButton.StandardButton: Boolean; +begin + Result := False; +end; + +procedure TcxCustomButton.UpdateSize; +var + ASize: TSize; +begin + if AutoSize then + begin + if csLoading in ComponentState then + ASize := GetOptimalSize + else + ASize := Size(0, 0); + SetBounds(Self.Left, Self.Top, ASize.cx, ASize.cy); + end; +end; + +//IcxMouseTrackingCaller +procedure TcxCustomButton.ButtonMouseLeave; +begin + Perform(CM_MOUSELEAVE, 0, 0); +end; + +// IcxLookAndFeelContainer +function TcxCustomButton.GetLookAndFeel: TcxLookAndFeel; +begin + Result := LookAndFeel; +end; + +procedure TcxCustomButton.Click; +begin + if FKind = cxbkStandard then + inherited Click + else + begin + if (FKind = cxbkDropDown) and not FMenuVisible then + begin + if not FIsMouseClick then DoDropDownMenu; + FIsMouseClick := False; + end + else + if FIsMouseClick then FIsMouseClick := False else inherited Click; + end; +end; + +function TcxCustomButton.CanFocus: Boolean; +var + Control: TWinControl; + Form: TCustomForm; +begin + Result := False; + Form := GetParentForm(Self); + if Form <> nil then + begin + Control := Self; + while Control <> Form do + begin + if not (Control.Visible and Control.Enabled) then Exit; + Control := Control.Parent; + end; + Result := FCanBeFocused or + (csDesigning in ComponentState); + end; +end; + +function TcxCustomButton.GetOptimalSize: TSize; +var + ACanvas: TcxScreenCanvas; + ACaption: TCaption; +begin + ACanvas := TcxScreenCanvas.Create; + try + ACanvas.Font := Font; + ACaption := RemoveAccelChars(Caption); + if ACaption = '' then + ACaption := ' '; + Result.cx := ACanvas.TextWidth(ACaption) + ACanvas.TextWidth('R') * 3; + Result.cy := MulDiv(ACanvas.TextHeight('Wg'), 14, 8); + finally + ACanvas.Free; + end; +end; + +function TcxCustomButton.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action); + UpdateImageInfo; +end; + +procedure TcxCustomButton.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + if UseSystemPaint then + InternalRecreateWindow + else + Invalidate; +end; + +procedure TcxCustomButton.SetButtonAutoSize(Value: Boolean); +begin + if Value <> FAutoSize then + begin + FAutoSize := Value; + UpdateSize; + end; +end; + +procedure TcxCustomButton.SetColors(const Value: TcxButtonColors); +begin + FColors.Assign(Value); +end; + +procedure TcxCustomButton.SetKind(const Value: TcxButtonKind); +begin + if FKind <> Value then + begin + FKind := Value; + InternalRecreateWindow; + end +end; + +procedure TcxCustomButton.SetLookAndFeel(Value: TcxLookAndFeel); +begin + FLookAndFeel.Assign(Value); +end; + +procedure TcxCustomButton.SetPopupMenu(Value: TComponent); +var + AIPopupMenu: IcxPopupMenu; +begin + if (Value <> nil) and not((Value is TPopupMenu) or + Supports(Value, IcxPopupMenu, AIPopupMenu)) then + Value := nil; + if FPopupMenu <> Value then + begin + if FPopupMenu <> nil then + FPopupMenu.RemoveFreeNotification(Self); + FPopupMenu := Value; + if FPopupMenu <> nil then + FPopupMenu.FreeNotification(Self); + end; +end; + +procedure TcxCustomButton.CheckShowMenu(const P: TPoint); +begin + if FKind = cxbkDropDownButton then + begin + if PtInRect(GetMenuButtonBounds, P) then DoDropDownMenu + end + else + DoDropDownMenu; +end; + +function TcxCustomButton.GetButtonState: TcxButtonState; +begin + if not Enabled then Result := cxbsDisabled + else if FIsPressed or (FMenuVisible and (Kind = cxbkDropDown)) or + (FDown and SpeedButtonMode) then Result := cxbsPressed + else if FMouseInControl then Result := cxbsHot + else if (FIsDefault or FIsFocused) and not SpeedButtonMode then Result := cxbsDefault + else Result := cxbsNormal; +end; + +function TcxCustomButton.GetMenuButtonBounds: TRect; +begin + Result := cxNullRect; + if Kind = cxbkStandard then Exit; + Result := ClientRect; + if Kind = cxbkDropDownButton then + Result.Left := Result.Right - cxDropDownButtonWidth; +end; + +function TcxCustomButton.GetSpeedButtonMode: Boolean; +begin + Result := not FCanBeFocused or (FGroupIndex <> 0); +end; + +procedure TcxCustomButton.SetAllowAllUp(AValue: Boolean); +begin + if AValue <> FAllowAllUp then + begin + FAllowAllUp := AValue; + UpdateGroup; + end; +end; + +procedure TcxCustomButton.SetCanBeFocused(AValue: Boolean); +begin + if AValue <> FCanBeFocused then + begin + FCanBeFocused := AValue; + UpdateGroup; + end; +end; + +procedure TcxCustomButton.SetDown(AValue: Boolean); +begin + if FGroupIndex = 0 then AValue := False; + if AValue <> FDown then + begin + if FDown and (not FAllowAllUp and (FGroupIndex <> 0)) then Exit; + FDown := AValue; + FIsPressed := FDown; + if AValue then UpdateGroup; + Invalidate; + end; +end; + +procedure TcxCustomButton.SetGroupIndex(AValue: Integer); +begin + if AValue <> FGroupIndex then + begin + FGroupIndex := AValue; + if FGroupIndex = 0 then + Down := False + else + UpdateGroup; + end; +end; + +procedure TcxCustomButton.UpdateGroup; +var + AMsg: TMessage; +begin + if (FGroupIndex <> 0) and (Parent <> nil) then + begin + AMsg.Msg := CM_BUTTONPRESSED; + AMsg.WParam := FGroupIndex; + AMsg.LParam := Longint(Self); + AMsg.Result := 0; + Parent.Broadcast(AMsg); + end; +end; + +procedure TcxCustomButton.WndProc(var Message: TMessage); +var + P: TPoint; +begin + if SpeedButtonMode and not (csDesigning in ComponentState) then + begin + case Message.Msg of + WM_LBUTTONDOWN: + begin + FLockDown := True; + Invalidate; + P.X := Message.LParamLo; + P.Y := Message.LParamHi; + if Kind <> cxbkStandard then + CheckShowMenu(P); + FIsPressed := not PtInRect(GetMenuButtonBounds, P); + if CanFocus then + SetFocus; + Exit; + end; + WM_LBUTTONUP: + begin + if FGroupIndex = 0 then + begin + FLockDown := False; + FIsPressed := False; + end + else + SetDown(not FDown); + Click; + Invalidate; + Exit; + end; + WM_LBUTTONDBLCLK: + begin + DblClick; + Invalidate; + Exit; + end; + WM_KEYUP: + begin + if (csDesigning in ComponentState) then + Exit; + if Message.WParam = VK_SPACE then + SetDown(not FDown); + end; + end; + end; + inherited WndProc(Message); +end; + +procedure TcxCustomButton.ExcludeDropDownButtonRect(var R: TRect); +begin + if Kind = cxbkDropDownButton then + R.Right := R.Right - cxDropDownButtonWidth + 2; +end; + +procedure TcxCustomButton.CMTextChanged(var Message: TMessage); +begin + inherited; + UpdateSize; +end; + +procedure TcxCustomButton.DoDropDownMenu; +begin + PostMessage(Handle, CM_DROPDOWNPOPUPMENU, 0, 0); +end; + +function TcxCustomButton.GetBorderRect(AState: TcxButtonState): TRect; +var + ABorderSize: Integer; +begin + Result := ClientRect; + ABorderSize := GetPainterClass.ButtonBorderSize(AState); + InflateRect(Result, -ABorderSize, -ABorderSize); + ExcludeDropDownButtonRect(Result); +end; + +function TcxCustomButton.GetContentRect: TRect; +begin + Result := GetBorderRect(cxbsDefault) +end; + +function TcxCustomButton.GetDropDownMenuAlignment(APopupPoint: TPoint; + AEstimatedAlignment: TPopupAlignment): TPopupAlignment; +var + ADesktopWorkArea: TRect; +begin + Result := AEstimatedAlignment; + ADesktopWorkArea := GetDesktopWorkArea(APopupPoint); + if APopupPoint.X <= ADesktopWorkArea.Left then + Result := paRight + else + if APopupPoint.X >= ADesktopWorkArea.Right then + Result := paLeft; +end; + +function TcxCustomButton.GetDropDownMenuPopupPoint(ADropDownMenu: TPopupMenu): TPoint; +var + H: Integer; +begin + Result := Point(0, Height); + case FPopupAlignment of + paLeft: + Result.X := 0; + paRight: + Result.X := Width; + paCenter: + Result.X := Width shr 1; + end; + Result := ClientToScreen(Result); + H := GetPopupMenuHeight(ADropDownMenu); + if Result.Y + H > GetDesktopWorkArea(Result).Bottom then + Dec(Result.Y, Height + H + 2); +end; + +procedure TcxCustomButton.InternalPaint; +var + AColor: TColor; + AOffset: TPoint; + AShift: Integer; + AState: TcxButtonState; + AButtonMenuState: TcxButtonState; + ATempRect, R: TRect; + ATheme: TdxTheme; +begin + if StandardButton then + Exit; + R := ClientRect; + if GetPainterClass = TcxWinXPLookAndFeelPainter then + begin + ATheme := OpenTheme(totButton); + if (ATheme <> TC_NONE) and IsThemeBackgroundPartiallyTransparent(ATheme, BP_PUSHBUTTON, PBS_NORMAL) then + cxDrawThemeParentBackground(Self, FCanvas, R); + end + else + if LookAndFeel.SkinPainter <> nil then + cxDrawTransparentControlBackground(Self, FCanvas, R); + + case FKind of + cxbkDropDown: + FIsPressed := FMenuVisible; + cxbkDropDownButton: + begin + ATempRect := Rect(R.Right - cxDropDownButtonWidth, R.Top, R.Right, R.Bottom); + ExcludeDropDownButtonRect(R); + end; + end; + + InitializeCanvasColors(AState, AColor); + + if Assigned(FOnGetDrawParams) then + FOnGetDrawParams(Self, AState, AColor, FCanvas.Font); + + GetPainterClass.DrawButton(FCanvas, R, '', AState, True, AColor, FCanvas.Font.Color); + + AShift := GetPainterClass.ButtonTextShift; + if (AState = cxbsPressed) and (AShift <> 0) then + AOffset := Point(AShift, AShift) + else + AOffset := cxNullPoint; + + FCanvas.SaveClipRegion; + try + FCanvas.SetClipRegion(TcxRegion.Create(GetBorderRect(AState)), roSet); + UpdateImageInfo; + FGlyph.Draw(FControlCanvas, GetContentRect, AOffset, Caption, FLayout, + FMargin, FSpacing, AState, DrawTextBiDiModeFlags(0), + GetPainterClass = TcxWinXPLookAndFeelPainter{$IFDEF DELPHI7}, WordWrap{$ENDIF}); + finally + FCanvas.RestoreClipRegion; + end; + + if FKind = cxbkDropDownButton then + begin + AButtonMenuState := AState; + if FMenuVisible then + AButtonMenuState := cxbsPressed + else + if (AButtonMenuState = cxbsPressed) then + if FIsFocused then + AButtonMenuState := cxbsHot + else + AButtonMenuState := cxbsNormal; + GetPainterClass.DrawButton(FCanvas, ATempRect, '', AButtonMenuState, True, AColor, FCanvas.Font.Color); + GetPainterClass.DrawScrollBarArrow(FCanvas, ATempRect, AButtonMenuState, adDown); + end; + + if CanFocus then + if Focused and not FMenuVisible then + FCanvas.DrawFocusRect(GetPainterClass.ButtonFocusRect(FCanvas, R)); +end; + +procedure TcxCustomButton.InternalRecreateWindow; +begin + RecreateWnd; +end; + +function TcxCustomButton.IsColorsStored: Boolean; +begin + Result := FColors.AssignedColors <> []; +end; + +function TcxCustomButton.IsHotTrack: Boolean; +begin + Result := not StandardButton and GetPainterClass.IsButtonHotTrack and Enabled; +end; + +procedure TcxCustomButton.ActionChange(Sender: TObject; CheckDefaults: Boolean); +begin + inherited ActionChange(Sender, CheckDefaults); + UpdateImageInfo; +end; + +function TcxCustomButton.CanResize(var NewWidth, NewHeight: Integer): Boolean; +begin + if AutoSize then + with GetOptimalSize do + begin + NewWidth := cx; + NewHeight := cy; + end; + Result := inherited CanResize(NewWidth, NewHeight); +end; + +function TcxCustomButton.GetActionLinkClass: TControlActionLinkClass; +begin + Result := TcxButtonActionLink; +end; + +procedure TcxCustomButton.KeyDown(var Key: Word; Shift: TShiftState); +begin + if FKind = cxbkDropDownButton then + if (Key in [VK_UP, VK_DOWN]) and + ((ssAlt in Shift) or (ssShift in Shift)) then + begin + if not FMenuVisible then DoDropDownMenu; + Key := 0; + Exit + end; + inherited; +end; + +procedure TcxCustomButton.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + if (Button = mbLeft) and (Kind <> cxbkStandard) then + begin + if not FMenuVisible then + CheckShowMenu(Point(X, Y)) + else + begin + FIsMouseClick := True; + FMenuVisible := False; + FIsPressed := False; + Repaint; + end; + end; + inherited; +end; + +procedure TcxCustomButton.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if Operation = opRemove then + begin + if AComponent = FDropDownMenu then + FDropDownMenu := nil + else + if AComponent = PopupMenu then + PopupMenu := nil; + end; +end; + +procedure TcxCustomButton.DrawItem(const DrawItemStruct: TDrawItemStruct); +begin + FCanvas.Canvas.Handle := DrawItemStruct.hDC; + with DrawItemStruct do + begin + if not FLockDown then + FIsPressed := itemState and ODS_SELECTED <> 0 + else + FIsPressed := SpeedButtonMode and FIsPressed; + FIsDefault := (itemState and ODS_FOCUS <> 0) or + (Default and (csDesigning in ComponentState)); + end; + InternalPaint; + FCanvas.Canvas.Handle := 0; +end; + +procedure TcxCustomButton.UpdateImageInfo; + + function GetImageList: TCustomImageList; + begin + if (Action is TCustomAction) and (TCustomAction(Action).ActionList <> nil) then + Result := TCustomAction(Action).ActionList.Images + else + Result := nil; + end; + + function GetImageIndex: Integer; + begin + if Action is TCustomAction then + Result := TCustomAction(Action).ImageIndex + else + Result := -1; + end; + +begin + FGlyph.ImageList := GetImageList; + FGlyph.ImageIndex := GetImageIndex; +end; + +procedure TcxCustomButton.WMCaptureChanged(var Message: TMessage); +var + P: TPoint; +begin + inherited; + if csDesigning in ComponentState then Exit; + GetCursorPos(P); + FMouseInControl := IsHotTrack and (WindowFromPoint(P) = Handle); +end; + +procedure TcxCustomButton.WMContextMenu(var Message: TWMContextMenu); +var + AHandled: Boolean; + P, P1: TPoint; +begin + if Message.Result <> 0 then + Exit; + if csDesigning in ComponentState then + begin + inherited; + Exit; + end; + + P := SmallPointToPoint(Message.Pos); + if (P.X = -1) and (P.Y = -1) then + P1 := P + else + begin + P1 := ScreenToClient(P); + if not PtInRect(ClientRect, P1) then + begin + inherited; + Exit; + end; + end; + + AHandled := False; + DoContextPopup(P1, AHandled); + Message.Result := Ord(AHandled); + if not AHandled then + inherited; +end; + +procedure TcxCustomButton.WMEraseBkgnd(var Message: TWMEraseBkgnd); +begin +{$IFNDEF DELPHI7} + if (csDestroying in ComponentState) or StandardButton or + (GetPainterClass = TcxWinXPLookAndFeelPainter) then + inherited + else +{$ENDIF} + Message.Result := 1; +end; + +procedure TcxCustomButton.WMLButtonDblClk(var Message: TWMLButtonDblClk); +begin + Perform(WM_LBUTTONDOWN, Message.Keys, + LPARAM(Word(Message.XPos) or (Word(Message.YPos) shr 16))); +end; + +procedure TcxCustomButton.WMLButtonDown(var Message: TWMLButtonDown); +var + R: TRect; +begin + if FKind = cxbkDropDownButton then + begin + R := ClientRect; + R.Left := R.Right - cxDropDownButtonWidth; + if PtInRect(R, Point(Message.XPos, Message.YPos)) then + FLockDown := True; + end; + inherited; +end; + +procedure TcxCustomButton.WMLButtonUp(var Message: TWMLButtonUp); +begin + FLockDown := False; + inherited; +end; + +procedure TcxCustomButton.CMCloseupPopupMenu(var Message: TMessage); +var + P: TPoint; +begin + GetCursorPos(P); + FMouseInControl := IsHotTrack and (WindowFromPoint(P) = Handle); + FMenuVisible := False; + Repaint; + if not SpeedButtonMode then + FLockDown := False; +end; + +procedure TcxCustomButton.CMDialogChar(var Message: TCMDialogChar); +begin + with Message do + if IsAccel(CharCode, Caption) then + begin + SetDown(not FDown); + Click; + Result := 1; + end; +end; + +procedure TcxCustomButton.CMDropDownPopupMenu(var Message: TMessage); +var + P: TPoint; + APopupAlignment: TPopupAlignment; + APopupMenu: TPopupMenu; +begin + if (Kind <> cxbkStandard) then + begin + APopupMenu := FDropDownMenu; + if DoOnDropDownMenuPopup(APopupMenu) or (APopupMenu = nil) then + Exit; + FMenuVisible := True; + Repaint; + P := GetDropDownMenuPopupPoint(APopupMenu); + APopupAlignment := APopupMenu.Alignment; + try + APopupMenu.Alignment := GetDropDownMenuAlignment(P, FPopupAlignment); + APopupMenu.PopupComponent := Self; + APopupMenu.Popup(P.X, P.Y); + finally + APopupMenu.Alignment := APopupAlignment; + end; + PostMessage(Handle, CM_CLOSEUPPOPUPMENU, 0, 0); + end; +end; + +procedure TcxCustomButton.CMFontChanged(var Message: TMessage); +begin + inherited; + UpdateSize; + Invalidate; +end; + +procedure TcxCustomButton.CMEnabledChanged(var Message: TMessage); +begin + inherited; + if not Enabled then FMouseInControl := False; + Invalidate; +end; + +procedure TcxCustomButton.CMMouseEnter(var Message: TMessage); +begin + inherited; +{$IFDEF DELPHI7} + if csDesigning in ComponentState then Exit; +{$ENDIF} + if not FMouseInControl and IsHotTrack and (GetCapture = 0) then + begin + BeginMouseTracking(Self, Rect(0, 0, Width, Height), Self); + FMouseInControl := True; + Repaint; + end; +end; + +procedure TcxCustomButton.CMMouseLeave(var Message: TMessage); +begin + inherited; +{$IFDEF DELPHI7} + if csDesigning in ComponentState then Exit; +{$ENDIF} + EndMouseTracking(Self); + FLockDown := FMenuVisible; + if FMouseInControl and IsHotTrack then + begin + FMouseInControl := False; + Invalidate; + end; +end; + +procedure TcxCustomButton.CNDrawItem(var Message: TWMDrawItem); +begin + if not(csDestroying in ComponentState) then + DrawItem(Message.DrawItemStruct^); +end; + +procedure TcxCustomButton.CNKeyDown(var Message: TWMKeyDown); +begin + if IsPopupMenuShortCut(PopupMenu, Message) then + Message.Result := 1 + else + inherited; +end; + +procedure TcxCustomButton.CNMeasureItem(var Message: TWMMeasureItem); +var + ATempVar: TMeasureItemStruct; +begin + ATempVar := Message.MeasureItemStruct^; + ATempVar.itemWidth := Width; + ATempVar.itemHeight := Height; + Message.MeasureItemStruct^ := ATempVar; +end; + +procedure TcxCustomButton.CNSysKeyDown(var Message: TWMSysKeyDown); +begin + if IsPopupMenuShortCut(PopupMenu, Message) then + Message.Result := 1 + else + inherited; +end; + +procedure TcxCustomButton.CMButtonPressed(var Message: TMessage); +var + ASender: TcxButton; +begin + if SpeedButtonMode then + begin + if (Message.WParam = FGroupIndex) and (FGroupIndex <> 0) then + begin + ASender := TcxButton(Message.LParam); + if ASender <> Self then + begin + FAllowAllUp := ASender.AllowAllUp; + FCanBeFocused := ASender.CanBeFocused; + if ASender.Down and FDown then + begin + FDown := False; + if (Action is TCustomAction) then + TCustomAction(Action).Checked := False; + Invalidate; + end; + end; + end; + end; +end; + +procedure TcxCustomButton.CreateHandle; +var + AState: TcxButtonState; +begin + if Enabled then + AState := cxbsNormal + else + AState := cxbsDisabled; + inherited CreateHandle; + FGlyph.CreateButtonGlyph(AState); +end; + +procedure TcxCustomButton.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + if not StandardButton then + with Params do Style := Style or BS_OWNERDRAW; +end; + +procedure TcxCustomButton.DestroyWindowHandle; +begin + if FMenuVisible then + SendMessage(Handle, CM_CLOSEUPPOPUPMENU, 0, 0); + inherited DestroyWindowHandle; +end; + +function TcxCustomButton.GetPalette: HPALETTE; +begin + Result := Glyph.Palette; +end; + +procedure TcxCustomButton.SetButtonStyle(ADefault: Boolean); +begin + if StandardButton then + inherited SetButtonStyle(ADefault) + else + if ADefault <> FIsFocused then + begin + FIsFocused := ADefault; + Refresh; + end; +end; + +procedure TcxCustomButton.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + if not FMouseInControl and IsHotTrack and PtInRect(ClientRect, Point(X, Y)) and + (GetCapture = 0) then + Perform(CM_MOUSEENTER, 0, 0); +end; + +end. + diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxCalc.pas b/official/x.35/ExpressEditors Library 5/Sources/cxCalc.pas new file mode 100644 index 00000000..b8a3d467 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxCalc.pas @@ -0,0 +1,1898 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxCalc; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, + SysUtils, Classes, Graphics, Controls, Forms, StdCtrls, Clipbrd, + cxClasses, cxControls, cxContainer, cxGraphics, cxDataStorage, cxDataUtils, + cxButtons, cxEdit, cxDropDownEdit, cxEditConsts, cxFormats, cxLookAndFeelPainters, + cxTextEdit, cxFilterControlUtils; + +const + cxMaxCalcPrecision = cxEditDefaultPrecision; + cxDefCalcPrecision = cxMaxCalcPrecision; + // Size + cxMinCalcFontSize = 8; + cxCalcMinBoldFontSize = 10; + cxMinCalcBtnWidth = 28; + cxMinCalcBtnHeight = 22; + cxMinCalcLargeBtnWidth = Integer(Trunc(1.7*cxMinCalcBtnWidth)); + cxMinCalcXOfs = 3; + cxMinCalcYOfs = 3; + cxMinCalcWidth = (cxMinCalcXOfs+cxMinCalcBtnWidth)*6+cxMinCalcXOfs*3+3; + cxMinCalcHeight = (cxMinCalcYOfs+cxMinCalcBtnHeight)*5+cxMinCalcYOfs+3; + +type + TcxCalcState = (csFirst, csValid, csError); + + TcxCalcButtonKind = + (cbBack, cbCancel, cbClear, + cbMC, cbMR, cbMS, cbMP, + cbNum0, cbNum1, cbNum2, cbNum3, cbNum4, cbNum5, cbNum6, cbNum7, cbNum8, cbNum9, + cbSign, cbDecimal, + cbDiv, cbMul, cbSub, cbAdd, + cbSqrt, cbPercent, cbRev, cbEqual, cbNone); + +const + BtnCaptions : array [cbBack..cbEqual] of string[4] = ('Back', 'CE', 'C', + 'MC', 'MR', 'MS', 'M+', + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + '+/-', ',', '/', '*', '-', '+', 'sqrt', '%', '1/x', '='); + +type + TcxButtonInfo = record + Kind : TcxCalcButtonKind; + Text : String[4]; + FontColor : TColor; + BtnRect : TRect; + Down : Boolean; + Grayed : Boolean; + end; + + TCalcButtons = array [TcxCalcButtonKind] of TcxButtonInfo; + + { TcxCustomCalculator } + + TcxCalcButtonClick = procedure(Sender: TObject; var ButtonKind : TcxCalcButtonKind) of object; + TcxCalcGetEditValue = procedure(Sender: TObject; var Value : String) of object; + TcxCalcSetEditValue = procedure(Sender: TObject; const Value : String) of object; + + TcxCustomCalculator = class(TcxControl) + private + {calc style} + FAutoFontSize : Boolean; + FBeepOnError: Boolean; + FBorderStyle : TBorderStyle; + FFocusRectVisible : Boolean; + {calc size} + FCalcFontSize : Integer; + FCalcBtnWidth : Integer; + FCalcBtnHeight : Integer; + FCalcLargeBtnWidth : Integer; + FCalcXOfs : Integer; + FCalcYOfs : Integer; + FCalcWidth : Integer; + FCalcHeight : Integer; + {math} + FMemory : Extended; + FOperator: TcxCalcButtonKind; + FOperand: Extended; + FPrecision: Byte; + FStatus: TcxCalcState; + {control} + FButtons : TCalcButtons; + FActiveButton : TcxCalcButtonKind; + FDownButton : TcxCalcButtonKind; + FPressedButton : TcxCalcButtonKind; + FTracking: Boolean; + // events + FOnDisplayChange: TNotifyEvent; + FOnButtonClick: TcxCalcButtonClick; + FOnResult: TNotifyEvent; + FOnHidePopup: TcxEditClosePopupEvent; + + function GetDisplay: Extended; + procedure SetDisplay(Value: Extended); + function GetMemory: Extended; + + procedure SetAutoFontSize(Value : Boolean); + procedure SetBorderStyle(Value: TBorderStyle); + procedure SetFocusRectVisible(Value : Boolean); + + procedure StopTracking; + procedure TrackButton(X,Y: Integer); + procedure InvalidateButton(ButtonKind : TcxCalcButtonKind); + procedure DoButtonDown(ButtonKind : TcxCalcButtonKind); + procedure DoButtonUp(ButtonKind : TcxCalcButtonKind); + procedure Error; + procedure CheckFirst; + procedure Clear; + procedure CalcSize(AWidth, AHeight : Integer); + procedure UpdateMemoryButtons; + procedure InvalidateMemoryButtons; + procedure ResetOperands; + protected + IsPopupControl : Boolean; + function GetPainter: TcxCustomLookAndFeelPainterClass; virtual; + procedure Paint; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure FontChanged; override; + procedure FocusChanged; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseLeave(AControl: TControl); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + procedure Resize; override; + procedure SetEnabled( Value: Boolean); override; + procedure CreateLayout; + procedure ButtonClick(ButtonKind : TcxCalcButtonKind); + // for link with EditControl + function GetEditorValue: String; virtual; + procedure SetEditorValue(const Value: String); virtual; + procedure HidePopup(Sender: TcxControl; AReason: TcxEditCloseUpReason); virtual; + + property Color default clBtnFace; + property ParentColor default False; + property BorderStyle: TBorderStyle read FBorderStyle write SetBorderStyle + default bsNone; + + property AutoFontSize : Boolean read FAutoFontSize write SetAutoFontSize + default True; + property BeepOnError: Boolean read FBeepOnError write FBeepOnError + default True; + property ShowFocusRect : Boolean + read FFocusRectVisible write SetFocusRectVisible default True; + + property Precision: Byte read FPrecision write FPrecision + default cxDefCalcPrecision; + property EditorValue : string read GetEditorValue write SetEditorValue; + + property OnHidePopup: TcxEditClosePopupEvent read FOnHidePopup write FOnHidePopup; + property OnDisplayChange: TNotifyEvent + read FOnDisplayChange write FOnDisplayChange; + property OnButtonClick: TcxCalcButtonClick + read FOnButtonClick write FOnButtonClick; + property OnResult: TNotifyEvent read FOnResult write FOnResult; + public + constructor Create(AOwner: TComponent); override; + function GetButtonKindAt(X, Y : Integer) : TcxCalcButtonKind; + function GetButtonKindChar(Ch : Char) : TcxCalcbuttonKind; + function GetButtonKindKey(Key: Word; Shift: TShiftState) : TcxCalcbuttonKind; + procedure CopyToClipboard; + procedure PasteFromClipboard; + property Memory: Extended read GetMemory; + property Value: Extended read GetDisplay write SetDisplay; + published + property TabStop default True; + end; + + { TcxPopupCalculator } + + TcxCustomCalcEdit = class; + + TcxPopupCalculator = class(TcxCustomCalculator) + private + FEdit: TcxCustomCalcEdit; + protected + function GetEditorValue: string; override; + function GetPainter: TcxCustomLookAndFeelPainterClass; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure SetEditorValue(const Value: string); override; + property Edit: TcxCustomCalcEdit read FEdit write FEdit; + public + constructor Create(AOwner: TComponent); override; + procedure Init; virtual; + end; + + { TcxCalcEditPropertiesValues } + + TcxCalcEditPropertiesValues = class(TcxTextEditPropertiesValues) + private + FPrecision: Boolean; + procedure SetPrecision(Value: Boolean); + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property Precision: Boolean read FPrecision write SetPrecision stored False; + end; + + { TcxCustomCalcEditProperties } + + TcxCustomCalcEditProperties = class(TcxCustomPopupEditProperties) + private + FBeepOnError: Boolean; + FPrecision: Byte; + FQuickClose: Boolean; + FScientificFormat: Boolean; + FUseThousandSeparator: Boolean; + function GetAssignedValues: TcxCalcEditPropertiesValues; + function GetPrecision: Byte; + function IsPrecisionStored: Boolean; + procedure SetAssignedValues(Value: TcxCalcEditPropertiesValues); + procedure SetBeepOnError(Value: Boolean); + procedure SetPrecision(Value: Byte); + procedure SetQuickClose(Value: Boolean); + procedure SetScientificFormat(Value: Boolean); + procedure SetUseThousandSeparator(Value: Boolean); + protected + function GetAlwaysPostEditValue: Boolean; override; + class function GetAssignedValuesClass: TcxCustomEditPropertiesValuesClass; override; + function HasDigitGrouping(AIsDisplayValueSynchronizing: Boolean): Boolean; override; + function PopupWindowAcceptsAnySize: Boolean; override; + function StrToFloatEx(S: string; var Value: Extended): Boolean; + property AssignedValues: TcxCalcEditPropertiesValues read GetAssignedValues + write SetAssignedValues; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + class function GetContainerClass: TcxContainerClass; override; + function GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; override; + function IsDisplayValueValid(var DisplayValue: TcxEditValue; + AEditFocused: Boolean): Boolean; override; + function IsEditValueValid(var EditValue: TcxEditValue; + AEditFocused: Boolean): Boolean; override; + procedure PrepareDisplayValue(const AEditValue: TcxEditValue; + var DisplayValue: TcxEditValue; AEditFocused: Boolean); override; + procedure ValidateDisplayValue(var ADisplayValue: TcxEditValue; + var AErrorText: TCaption; var Error: Boolean; AEdit: TcxCustomEdit); override; + // !!! + property BeepOnError: Boolean read FBeepOnError write SetBeepOnError + default True; + property ImmediateDropDown default False; + property Precision: Byte read GetPrecision write SetPrecision + stored IsPrecisionStored; + property QuickClose: Boolean read FQuickClose write SetQuickClose + default False; + property ScientificFormat: Boolean read FScientificFormat + write SetScientificFormat default False; + property UseThousandSeparator: Boolean read FUseThousandSeparator + write SetUseThousandSeparator default False; + end; + + { TcxCalcEditProperties } + + TcxCalcEditProperties = class(TcxCustomCalcEditProperties) + published + property Alignment; + property AssignedValues; + property AutoSelect; + property BeepOnError; + property ButtonGlyph; + property ClearKey; + property DisplayFormat; + property ImeMode; + property ImeName; + property ImmediatePost; + property Precision; + property ReadOnly; + property QuickClose; + property ScientificFormat; + property UseLeftAlignmentOnEditing; + property UseThousandSeparator; + property ValidateOnEnter; + property OnChange; + property OnCloseUp; + property OnEditValueChanged; + property OnInitPopup; + property OnPopup; + property OnValidate; + end; + + { TcxCustomCalcEdit } + + TcxCustomCalcEdit = class(TcxCustomPopupEdit) + private + FCalculator: TcxPopupCalculator; + function GetProperties: TcxCustomCalcEditProperties; + function GetActiveProperties: TcxCustomCalcEditProperties; + function GetValue: Extended; + procedure SetProperties(Value: TcxCustomCalcEditProperties); + procedure SetValue(const Value: Extended); + protected + // IcxFormatControllerListener + procedure FormatChanged; override; + + function CanDropDown: Boolean; override; + procedure CreatePopupWindow; override; + procedure DoEnter; override; + procedure DoExit; override; + procedure DoInitPopup; override; + procedure Initialize; override; + procedure InitializePopupWindow; override; + function InternalGetEditingValue: TcxEditValue; override; + function IsValidChar(Key: Char): Boolean; override; + procedure KeyPress(var Key: Char); override; + procedure PopupWindowClosed(Sender: TObject); override; + procedure PopupWindowShowed(Sender: TObject); override; + procedure PropertiesChanged(Sender: TObject); override; + function InternalPrepareEditValue(const ADisplayValue: string; + out EditValue: TcxEditValue): Boolean; + property Calculator: TcxPopupCalculator read FCalculator; + public + destructor Destroy; override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + procedure PasteFromClipboard; override; + procedure PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); override; + property ActiveProperties: TcxCustomCalcEditProperties + read GetActiveProperties; + property Properties: TcxCustomCalcEditProperties read GetProperties + write SetProperties; + property Value: Extended read GetValue write SetValue stored False; + end; + + { TcxCalcEdit } + + TcxCalcEdit = class(TcxCustomCalcEdit) + private + function GetActiveProperties: TcxCalcEditProperties; + function GetProperties: TcxCalcEditProperties; + procedure SetProperties(Value: TcxCalcEditProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxCalcEditProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property EditValue; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxCalcEditProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop default True; + property Value; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDrag; + property BiDiMode; + property ParentBiDiMode; + property OnEndDock; + property OnStartDock; + end; + + { TcxFilterCalcEditHelper } + + TcxFilterCalcEditHelper = class(TcxFilterDropDownEditHelper) + public + class function GetFilterEditClass: TcxCustomEditClass; override; + class function GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; override; + class procedure InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); override; + end; + +implementation + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Math, cxLookAndFeels, cxVariants, dxThemeManager, dxUxTheme; + +const + ResultButtons = [cbEqual, cbPercent]; + RepeatButtons = [cbBack]; + OperationButtons = [cbAdd, cbSub, cbMul, cbDiv]; + BorderWidth = 4; + +{TcxCustomCalculator} + +constructor TcxCustomCalculator.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + {init size variables} + FCalcFontSize := cxMinCalcFontSize; + FCalcBtnWidth := cxMinCalcBtnWidth; + FCalcBtnHeight := cxMinCalcBtnHeight; + FCalcLargeBtnWidth := cxMinCalcLargeBtnWidth; + FCalcXOfs := cxMinCalcXOfs; + FCalcYOfs := cxMinCalcYOfs; + FCalcWidth := cxMinCalcWidth; + FCalcHeight := cxMinCalcHeight; + {default size} + Width := FCalcWidth; + Height := FCalcHeight; + {style} + ControlStyle := [csCaptureMouse, csOpaque]; + Color := clBtnFace; + ParentColor := False; + TabStop := True; + FAutoFontSize := True; + FBorderStyle := bsNone; + FBeepOnError := True; + FDownButton := cbNone; + FActiveButton := cbNone; + FPressedButton := cbNone; + FFocusRectVisible := True; + FOperator := cbEqual; + FPrecision := cxDefCalcPrecision; + Keys := [kAll, kArrows, kChars, kTab]; + CreateLayout; +end; + +function TcxCustomCalculator.GetButtonKindAt(X, Y : Integer) : TcxCalcButtonKind; +var i : TcxCalcButtonKind; +begin + Result := cbNone; + for i := cbBack to cbEqual do + if PtInRect(FButtons[i].BtnRect, Point(X, Y)) then + begin + Result := i; + Exit; + end; +end; + +function TcxCustomCalculator.GetPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := TcxStandardLookAndFeelPainter; +end; + +procedure TcxCustomCalculator.Paint; +var + i : TcxCalcButtonKind; + State: TcxButtonState; +begin + if not HandleAllocated then Exit; + with Canvas do + begin + {Fill Background} + Brush.Color := Self.Color; + if IsPopupControl then + GetPainter.DrawWindowContent(Self.Canvas, ClientRect) + else + GetPainter.DrawWindowContent(Self.Canvas, BoundsRect); + {Draw buttons} + Font := Self.Font; + if AutoFontSize then + begin + Font.Size := FCalcFontSize; + if Font.Size >= cxCalcMinBoldFontSize then + Font.Style := [fsBold] + else + Font.Style := []; + end; + Brush.Color := Self.Color; + end; + + for i := cbBack to cbEqual do + with FButtons[i] do + if RectVisible(Canvas.Handle, BtnRect) then + begin + if Grayed or not Enabled then State := cxbsDisabled + else if Down then State := cxbsPressed + else if (FActiveButton = i) and (FDownButton <> i) then State := cxbsHot + else if IsFocused and (i = cbEqual) then State := cxbsDefault + else State := cxbsNormal; + with GetPainter, Canvas do + begin + DrawButton(Self.Canvas, BtnRect, '', State); + Font.Color := FontColor; + Brush.Style := bsClear; + if State = cxbsPressed then + begin + OffsetRect(BtnRect, ButtonTextShift, ButtonTextShift); + DrawText(Text, BtnRect, cxAlignHCenter or cxAlignVCenter or cxSingleLine or + cxShowPrefix, State <> cxbsDisabled); + OffsetRect(BtnRect, -ButtonTextShift, -ButtonTextShift); + end + else + DrawText(Text, BtnRect, cxAlignHCenter or cxAlignVCenter or cxSingleLine or + cxShowPrefix, State <> cxbsDisabled); + Brush.Style := bsSolid; + end; + if FFocusRectVisible and IsFocused and (i = cbEqual) then + begin + InflateRect(BtnRect, -3, -3); + Canvas.DrawFocusRect(BtnRect); + InflateRect(BtnRect, 3, 3); + end; + end; +end; + +procedure TcxCustomCalculator.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + begin + Style := Style or WS_TABSTOP or WS_CLIPCHILDREN; + WindowClass.Style := WindowClass.Style and not CS_DBLCLKS; + if IsPopupControl then + Style := Style and not WS_BORDER + else + if FBorderStyle = bsSingle then + if NewStyleControls and Ctl3D then + begin + Style := Style and not WS_BORDER; + ExStyle := ExStyle or WS_EX_CLIENTEDGE; + end + else + Style := Style or WS_BORDER; + end; +end; + +procedure TcxCustomCalculator.MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +var ButtonKind : TcxCalcButtonkind; +begin + if not (csDesigning in ComponentState) and + (CanFocus or (GetParentForm(Self) = nil)) and not IsPopupControl then + SetFocus; + + ButtonKind := GetButtonKindAt(X, Y); + if (Button = mbLeft) and (ButtonKind <> cbNone) and not FButtons[ButtonKind].Grayed then + begin + MouseCapture := True; + FTracking := True; + FDownButton := ButtonKind; + TrackButton(X, Y); + end; + inherited MouseDown(Button, Shift, X, Y); +end; + +procedure TcxCustomCalculator.MouseMove(Shift: TShiftState; X, Y: Integer); +var OldButton : TcxCalcButtonKind; +begin + if FTracking then + TrackButton(X, Y) + else + if GetPainter.IsButtonHotTrack and Enabled and not Dragging then + begin + OldButton := FActiveButton; + FActiveButton := GetButtonKindAt(X, Y); + if FActiveButton <> OldButton then + begin + if not FButtons[OldButton].Grayed then + InvalidateButton(OldButton); + if not FButtons[FActiveButton].Grayed then + InvalidateButton(FActiveButton); + end; + end; + inherited MouseMove(Shift, X, Y); +end; + +procedure TcxCustomCalculator.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +var + WasPressed: Boolean; +begin + WasPressed := (FDownButton <> cbNone) and FButtons[FDownButton].Down; + StopTracking; + if (Button = mbLeft) and WasPressed then + ButtonClick(FDownButton); + FDownButton := cbNone; + inherited MouseUp(Button, Shift, X, Y); +end; + +procedure TcxCustomCalculator.KeyDown(var Key: Word; Shift: TShiftState); +var + NewButton, OldButton : TcxCalcButtonKind; +begin + inherited KeyDown(Key, Shift); + OldButton := FPressedButton; + NewButton := GetButtonKindKey(Key, Shift); + if (NewButton <> cbNone) and (OldButton <> NewButton) then + begin + DoButtonUp(OldButton); + FPressedButton := NewButton; + DoButtonDown(FPressedButton); + end; +end; + +procedure TcxCustomCalculator.KeyPress(var Key: Char); +var + NewButton, OldButton : TcxCalcButtonKind; +begin + inherited KeyPress(Key); + if (Key = ^V) then + PasteFromClipboard + else + if (Key = ^C) then CopyToClipboard; + + OldButton := FPressedButton; + NewButton := GetButtonKindChar(Key); + if (NewButton <> cbNone) and (OldButton <> NewButton) then + begin + DoButtonUp(OldButton); + FPressedButton := NewButton; + DoButtonDown(FPressedButton); + end; + if FPressedButton in RepeatButtons {cbBack} then ButtonClick(FPressedButton); +end; + +procedure TcxCustomCalculator.KeyUp(var Key: Word; Shift: TShiftState); +begin + inherited KeyUp(Key, Shift); + DoButtonUp(FPressedButton); +end; + +procedure TcxCustomCalculator.Resize; +begin + CalcSize(ClientWidth, ClientHeight); + ClientWidth := FCalcWidth; + ClientHeight := FCalcHeight; + inherited; +end; + +procedure TcxCustomCalculator.DoButtonDown(ButtonKind : TcxCalcButtonKind); +begin + if ButtonKind <> cbNone then + begin + FButtons[ButtonKind].Down := True; + InvalidateButton(ButtonKind); + Update; + if not (ButtonKind in RepeatButtons) {cbBack} then ButtonClick(ButtonKind); + end; +end; + +procedure TcxCustomCalculator.DoButtonUp(ButtonKind : TcxCalcButtonKind); +begin + if ButtonKind <> cbNone then + begin + FButtons[ButtonKind].Down := False; + InvalidateButton(ButtonKind); + FPressedButton := cbNone; + Update; + end; +end; + +function TcxCustomCalculator.GetEditorValue: String; +begin + Result := ''; +end; + +procedure TcxCustomCalculator.SetEditorValue(const Value: String); +begin +end; + +procedure TcxCustomCalculator.CreateLayout; +const + BtnColors : array [cbBack..cbEqual] of TColor = (clMaroon, clMaroon, clMaroon, + clRed, clRed, clRed, clRed, + clBlue, clBlue, clBlue, clBlue, clBlue, clBlue, clBlue, clBlue, clBlue, clBlue, + clBlue, clBlue, + clRed, clRed, clRed, clRed, + clNavy, clNavy, clNavy, clRed); +var i : TcxCalcButtonKind; + X : Integer; +begin + for i := cbBack to cbEqual do + begin + FButtons[i].Kind := i; + FButtons[i].Text := BtnCaptions[i]; + if i = cbDecimal then FButtons[i].Text := SysUtils.DecimalSeparator + else FButtons[i].Text := BtnCaptions[i]; + FButtons[i].FontColor := BtnColors[i]; + FButtons[i].BtnRect := cxEmptyRect; + FButtons[i].Down := False; + FButtons[i].Grayed := False; + end; + {coord buttons} + FButtons[cbMC].BtnRect := Rect(FCalcXOfs, + (FCalcYOfs+FCalcBtnHeight)+FCalcYOfs, + FCalcXOfs+FCalcBtnWidth, + (FCalcYOfs+FCalcBtnHeight)*2); + FButtons[cbMR].BtnRect := Rect(FCalcXOfs, + (FCalcYOfs+FCalcBtnHeight)*2+FCalcYOfs, + FCalcXOfs+FCalcBtnWidth, + (FCalcYOfs+FCalcBtnHeight)*3); + FButtons[cbMS].BtnRect := Rect(FCalcXOfs, + (FCalcYOfs+FCalcBtnHeight)*3+FCalcYOfs, + FCalcXOfs+FCalcBtnWidth, + (FCalcYOfs+FCalcBtnHeight)*4); + FButtons[cbMP].BtnRect := Rect(FCalcXOfs, + (FCalcYOfs+FCalcBtnHeight)*4+FCalcYOfs, + FCalcXOfs+FCalcBtnWidth, + (FCalcYOfs+FCalcBtnHeight)*5); + X := FCalcXOfs+FCalcBtnWidth + FCalcXOfs + 4; + {7, 8, 9, /, sqrt} + FButtons[cbNum7].BtnRect := Rect(X+FCalcXOfs, + (FCalcYOfs+FCalcBtnHeight)+FCalcYOfs, + X+FCalcXOfs+FCalcBtnWidth, + (FCalcYOfs+FCalcBtnHeight)*2); + FButtons[cbNum8].BtnRect := Rect(X+FCalcXOfs+(FCalcXOfs+FCalcBtnWidth), + (FCalcYOfs+FCalcBtnHeight)+FCalcYOfs, + X+(FCalcXOfs+FCalcBtnWidth)*2, + (FCalcYOfs+FCalcBtnHeight)*2); + FButtons[cbNum9].BtnRect := Rect(X+FCalcXOfs+(FCalcXOfs+FCalcBtnWidth)*2, + (FCalcYOfs+FCalcBtnHeight)+FCalcYOfs, + X+(FCalcXOfs+FCalcBtnWidth)*3, + (FCalcYOfs+FCalcBtnHeight)*2); + FButtons[cbDiv].BtnRect := Rect(X+FCalcXOfs+(FCalcXOfs+FCalcBtnWidth)*3, + (FCalcYOfs+FCalcBtnHeight)+FCalcYOfs, + X+(FCalcXOfs+FCalcBtnWidth)*4, + (FCalcYOfs+FCalcBtnHeight)*2); + FButtons[cbSqrt].BtnRect := Rect(X+FCalcXOfs+(FCalcXOfs+FCalcBtnWidth)*4, + (FCalcYOfs+FCalcBtnHeight)+FCalcYOfs, + X+(FCalcXOfs+FCalcBtnWidth)*5, + (FCalcYOfs+FCalcBtnHeight)*2); + + {4, 5, 6, *, %} + FButtons[cbNum4].BtnRect := Rect(X+FCalcXOfs, + (FCalcYOfs+FCalcBtnHeight)*2+FCalcYOfs, + X+FCalcXOfs+FCalcBtnWidth, + (FCalcYOfs+FCalcBtnHeight)*3); + FButtons[cbNum5].BtnRect := Rect(X+FCalcXOfs+(FCalcXOfs+FCalcBtnWidth), + (FCalcYOfs+FCalcBtnHeight)*2+FCalcYOfs, + X+(FCalcXOfs+FCalcBtnWidth)*2, + (FCalcYOfs+FCalcBtnHeight)*3); + FButtons[cbNum6].BtnRect := Rect(X+FCalcXOfs+(FCalcXOfs+FCalcBtnWidth)*2, + (FCalcYOfs+FCalcBtnHeight)*2+FCalcYOfs, + X+(FCalcXOfs+FCalcBtnWidth)*3, + (FCalcYOfs+FCalcBtnHeight)*3); + FButtons[cbMul].BtnRect := Rect(X+FCalcXOfs+(FCalcXOfs+FCalcBtnWidth)*3, + (FCalcYOfs+FCalcBtnHeight)*2+FCalcYOfs, + X+(FCalcXOfs+FCalcBtnWidth)*4, + (FCalcYOfs+FCalcBtnHeight)*3); + FButtons[cbPercent].BtnRect := Rect(X+FCalcXOfs+(FCalcXOfs+FCalcBtnWidth)*4, + (FCalcYOfs+FCalcBtnHeight)*2+FCalcYOfs, + X+(FCalcXOfs+FCalcBtnWidth)*5, + (FCalcYOfs+FCalcBtnHeight)*3); + + {1, 2, 3, -, 1/x} + FButtons[cbNum1].BtnRect := Rect(X+FCalcXOfs, + (FCalcYOfs+FCalcBtnHeight)*3+FCalcYOfs, + X+FCalcXOfs+FCalcBtnWidth, + (FCalcYOfs+FCalcBtnHeight)*4); + FButtons[cbNum2].BtnRect := Rect(X+FCalcXOfs+(FCalcXOfs+FCalcBtnWidth), + (FCalcYOfs+FCalcBtnHeight)*3+FCalcYOfs, + X+(FCalcXOfs+FCalcBtnWidth)*2, + (FCalcYOfs+FCalcBtnHeight)*4); + FButtons[cbNum3].BtnRect := Rect(X+FCalcXOfs+(FCalcXOfs+FCalcBtnWidth)*2, + (FCalcYOfs+FCalcBtnHeight)*3+FCalcYOfs, + X+(FCalcXOfs+FCalcBtnWidth)*3, + (FCalcYOfs+FCalcBtnHeight)*4); + FButtons[cbSub].BtnRect := Rect(X+FCalcXOfs+(FCalcXOfs+FCalcBtnWidth)*3, + (FCalcYOfs+FCalcBtnHeight)*3+FCalcYOfs, + X+(FCalcXOfs+FCalcBtnWidth)*4, + (FCalcYOfs+FCalcBtnHeight)*4); + FButtons[cbRev].BtnRect := Rect(X+FCalcXOfs+(FCalcXOfs+FCalcBtnWidth)*4, + (FCalcYOfs+FCalcBtnHeight)*3+FCalcYOfs, + X+(FCalcXOfs+FCalcBtnWidth)*5, + (FCalcYOfs+FCalcBtnHeight)*4); + + {0, +/-, ., +, =} + FButtons[cbNum0].BtnRect := Rect(X+FCalcXOfs, + (FCalcYOfs+FCalcBtnHeight)*4+FCalcYOfs, + X+FCalcXOfs+FCalcBtnWidth, + (FCalcYOfs+FCalcBtnHeight)*5); + FButtons[cbSign].BtnRect := Rect(X+FCalcXOfs+(FCalcXOfs+FCalcBtnWidth), + (FCalcYOfs+FCalcBtnHeight)*4+FCalcYOfs, + X+(FCalcXOfs+FCalcBtnWidth)*2, + (FCalcYOfs+FCalcBtnHeight)*5); + FButtons[cbDecimal].BtnRect := Rect(X+FCalcXOfs+(FCalcXOfs+FCalcBtnWidth)*2, + (FCalcYOfs+FCalcBtnHeight)*4+FCalcYOfs, + X+(FCalcXOfs+FCalcBtnWidth)*3, + (FCalcYOfs+FCalcBtnHeight)*5); + FButtons[cbAdd].BtnRect := Rect(X+FCalcXOfs+(FCalcXOfs+FCalcBtnWidth)*3, + (FCalcYOfs+FCalcBtnHeight)*4+FCalcYOfs, + X+(FCalcXOfs+FCalcBtnWidth)*4, + (FCalcYOfs+FCalcBtnHeight)*5); + FButtons[cbEqual].BtnRect := Rect(X+FCalcXOfs+(FCalcXOfs+FCalcBtnWidth)*4, + (FCalcYOfs+FCalcBtnHeight)*4+FCalcYOfs, + X+(FCalcXOfs+FCalcBtnWidth)*5, + (FCalcYOfs+FCalcBtnHeight)*5); + {C} + FButtons[cbClear].BtnRect := FButtons[cbEqual].BtnRect; + FButtons[cbClear].BtnRect.Left := FButtons[cbClear].BtnRect.Right - FCalcLargeBtnWidth; + FButtons[cbClear].BtnRect.Top := FCalcYOfs; + FButtons[cbClear].BtnRect.Bottom := FCalcYOfs + FCalcBtnHeight; + {CE} + FButtons[cbCancel].BtnRect := FButtons[cbClear].BtnRect; + FButtons[cbCancel].BtnRect.Right := FButtons[cbClear].BtnRect.Left - FCalcYOfs; + FButtons[cbCancel].BtnRect.Left := FButtons[cbCancel].BtnRect.Right - FCalcLargeBtnWidth; + {Back} + FButtons[cbBack].BtnRect := FButtons[cbCancel].BtnRect; + FButtons[cbBack].BtnRect.Right := FButtons[cbBack].BtnRect.Left - FCalcYOfs; + FButtons[cbBack].BtnRect.Left := FButtons[cbBack].BtnRect.Right - FCalcLargeBtnWidth; + // ResetOperands; + ResetOperands; + // Update Memory display + UpdateMemoryButtons; +end; + +procedure TcxCustomCalculator.ResetOperands; +begin + FOperator := cbEqual; + FStatus := csFirst; + FMemory := 0.0; +end; + +procedure TcxCustomCalculator.SetBorderStyle(Value: TBorderStyle); +begin + if FBorderStyle <> Value then + begin + FBorderStyle := Value; + RecreateWnd; + end; +end; + +procedure TcxCustomCalculator.SetFocusRectVisible(Value : Boolean); +begin + if FFocusRectVisible <> Value then + begin + FFocusRectVisible := Value; + Invalidate; + end; +end; + +procedure TcxCustomCalculator.CalcSize(AWidth, AHeight : Integer); +var + h, NearHeight, d, dMin : Integer; + + function CalcHeight(ABtnHeight:Integer):Integer; + var FYOfs : Integer; + begin + FYOfs := MulDiv(ABtnHeight, cxMinCalcYOfs, cxMinCalcBtnHeight); + Result := (FYOfs + ABtnHeight) * 5 + FYOfs; + end; + +begin + if AutoFontSize then + begin + h := MulDiv(AWidth, cxMinCalcHeight, cxMinCalcWidth); + if AHeight > h then AHeight := h; + {Calculate nearest FCalcHeight } + h := cxMinCalcBtnHeight; + NearHeight := h; + dMin := AHeight; + while True do + begin + d := abs(CalcHeight(h) - AHeight); + if d < dMin then + begin + dMin := d; + NearHeight := h; + end + else + Break; + inc(h); + end; + end + else + NearHeight := Canvas.FontHeight(Font) * 2; + FCalcBtnHeight := NearHeight; + FCalcBtnWidth := MulDiv(FCalcBtnHeight, cxMinCalcBtnWidth, cxMinCalcBtnHeight); + FCalcYOfs := MulDiv(FCalcBtnHeight, cxMinCalcYOfs, cxMinCalcBtnHeight); + FCalcXOfs := FCalcYOfs; + FCalcLargeBtnWidth := MulDiv(FCalcBtnWidth, 17, 10); + FCalcFontSize := MulDiv(FCalcBtnHeight, cxMinCalcFontSize, cxMinCalcBtnHeight); + FCalcHeight := (FCalcYOfs+FCalcBtnHeight)*5+FCalcYOfs; + FCalcWidth := (FCalcXOfs+FCalcBtnWidth)*6+FCalcXOfs*2+4; + // reCalc rect buttons + CreateLayout; +end; + +procedure TcxCustomCalculator.FontChanged; +begin + if not (csLoading in ComponentState) then ParentFont := False; + inherited FontChanged; +end; + +procedure TcxCustomCalculator.FocusChanged; +begin + inherited FocusChanged; + InvalidateButton(cbEqual); +end; + +procedure TcxCustomCalculator.SetEnabled( Value: Boolean); +begin + inherited; + Invalidate; +end; + +procedure TcxCustomCalculator.StopTracking; +begin + if FTracking then + begin + TrackButton(-1, -1); + FTracking := False; + MouseCapture := False; + if FDownButton <> cbNone then + FButtons[FDownButton].Down := False; + end; +end; + +procedure TcxCustomCalculator.TrackButton(X,Y: Integer); +var + FlagRepaint : Boolean; +begin + if FDownButton <> cbNone then + begin + FlagRepaint := (GetButtonKindAt(X, Y) = FDownButton) <> FButtons[FDownButton].Down; + FButtons[FDownButton].Down := (GetButtonKindAt(X, Y) = FDownButton); + if FlagRepaint then + InvalidateButton(FDownButton); + end; +end; + +procedure TcxCustomCalculator.InvalidateButton(ButtonKind : TcxCalcButtonKind); +var + R: TRect; +begin + if ButtonKind <> cbNone then + begin + R := FButtons[ButtonKind].BtnRect; + InvalidateRect(R, False); + end; +end; + +procedure TcxCustomCalculator.MouseLeave(AControl: TControl); +begin + inherited; + if GetPainter.IsButtonHotTrack and Enabled and + not Dragging and (FActiveButton <> cbNone) then + begin + InvalidateButton(FActiveButton); + FActiveButton := cbNone; + end; +end; + +function TcxCustomCalculator.GetButtonKindChar(Ch : Char) : TcxCalcbuttonKind; +begin + case Ch of + '0'..'9' : Result := TcxCalcbuttonKind(Ord(cbNum0)+Ord(Ch)-Ord('0')); + '+' : Result := cbAdd; + '-' : Result := cbSub; + '*' : Result := cbMul; + '/' : Result := cbDiv; + '%' : Result := cbPercent; + '=' : Result := cbEqual; + #8 : Result := cbBack; + '@' : Result := cbSqrt; + '.', ',': Result := cbDecimal; + else + Result := cbNone; + end; +end; + +function TcxCustomCalculator.GetButtonKindKey(Key: Word; Shift: TShiftState) : TcxCalcbuttonKind; +begin + Result := cbNone; + case Key of + VK_RETURN : Result := cbEqual; + VK_ESCAPE : Result := cbClear; + VK_F9 : Result := cbSign; + VK_DELETE : Result := cbCancel; + Ord('C'){VK_C} : if not (ssCtrl in Shift) then Result := cbClear; + Ord('P'){VK_P} : if ssCtrl in Shift then Result := cbMP; + Ord('L'){VK_L} : if ssCtrl in Shift then Result := cbMC; + Ord('R'){VK_R} : if ssCtrl in Shift then Result := cbMR + else Result := cbRev; + Ord('M'){VK_M} : if ssCtrl in Shift then Result := cbMS; + end; +end; + +procedure TcxCustomCalculator.CopyToClipboard; +begin + Clipboard.AsText := GetEditorValue; +end; + +procedure TcxCustomCalculator.PasteFromClipboard; +var + S, S1 : String; + i : Integer; +begin + if Clipboard.HasFormat(CF_TEXT) then + try + S := Clipboard.AsText; + S1 := ''; + repeat + i := Pos(CurrencyString, S); + if i > 0 then + begin + S1 := S1 + Copy(S, 1, i - 1); + S := Copy(S, i + Length(CurrencyString), MaxInt); + end + else + S1 := S1 + S; + until i <= 0; + SetDisplay(StrToFloat(Trim(S1))); + FStatus := csValid; + except + SetDisplay(0.0); + end; +end; + +procedure TcxCustomCalculator.SetAutoFontSize(Value : Boolean); +begin + if AutoFontSize <> Value then + begin + FAutoFontSize := Value; + Font.OnChange(nil); + end; +end; + +// math routines +procedure TcxCustomCalculator.Error; +begin + FStatus := csError; + SetEditorValue(cxGetResourceString(@scxSCalcError)); + if FBeepOnError then MessageBeep(0); +// if Assigned(FOnError) then FOnError(Self); +end; + +procedure TcxCustomCalculator.CheckFirst; +begin + if FStatus = csFirst then + begin + FStatus := csValid; + SetEditorValue('0'); + end; +end; + +procedure TcxCustomCalculator.Clear; +begin + FStatus := csFirst; + SetDisplay(0.0); + FOperator := cbEqual; +end; + +procedure TcxCustomCalculator.ButtonClick(ButtonKind : TcxCalcButtonKind); +var Value : Extended; +begin + if Assigned(FOnButtonClick) then FOnButtonClick(Self, ButtonKind); + if (FStatus = csError) and not (ButtonKind in [cbClear, cbCancel]) then + begin + Error; + Exit; + end; + if ButtonKind = cbDecimal then + begin + CheckFirst; + if Pos(DecimalSeparator, EditorValue) = 0 then + SetEditorValue(EditorValue + DecimalSeparator); + Exit; + end; + case ButtonKind of + cbRev: + if FStatus in [csValid, csFirst] then + begin + FStatus := csFirst; + if FOperator in OperationButtons then + FStatus := csValid; + if GetDisplay = 0 then Error else SetDisplay(1.0 / GetDisplay); + end; + cbSqrt: + if FStatus in [csValid, csFirst] then + begin + FStatus := csFirst; + if FOperator in OperationButtons then + FStatus := csValid; + if GetDisplay < 0 then Error else SetDisplay(Sqrt(GetDisplay)); + end; + cbNum0..cbNum9: + begin + CheckFirst; + if EditorValue = '0' then SetEditorValue(''); + if Length(EditorValue) < Max(2, FPrecision) + Ord(Boolean(Pos('-', EditorValue))) then + SetEditorValue(EditorValue + Char(Ord('0')+Byte(ButtonKind)-Byte(cbNum0))) + else + if FBeepOnError then MessageBeep(0); + end; + cbBack: + begin + CheckFirst; + if (Length(EditorValue) = 1) or ((Length(EditorValue) = 2) and (EditorValue[1] = '-')) then + SetEditorValue('0') + else + SetEditorValue(Copy(EditorValue, 1, Length(EditorValue) - 1)); + end; + cbSign: SetDisplay(-GetDisplay); + cbAdd, cbSub, cbMul, cbDiv, cbEqual, cbPercent : + begin + if FStatus = csValid then + begin + FStatus := csFirst; + Value := GetDisplay; + if ButtonKind = cbPercent then + case FOperator of + cbAdd, cbSub : Value := FOperand * Value / 100.0; + cbMul, cbDiv : Value := Value / 100.0; + end; + case FOperator of + cbAdd : SetDisplay(FOperand + Value); + cbSub : SetDisplay(FOperand - Value); + cbMul : SetDisplay(FOperand * Value); + cbDiv : if Value = 0 then Error else SetDisplay(FOperand / Value); + end; + end; + FOperator := ButtonKind; + FOperand := GetDisplay; + if (ButtonKind in ResultButtons) and Assigned(FOnResult) then FOnResult(Self); + end; + cbClear, cbCancel: Clear; + cbMP: + if FStatus in [csValid, csFirst] then + begin + FStatus := csFirst; + FMemory := FMemory + GetDisplay; + UpdateMemoryButtons; + InvalidateMemoryButtons; + end; + cbMS: + if FStatus in [csValid, csFirst] then + begin + FStatus := csFirst; + FMemory := GetDisplay; + UpdateMemoryButtons; + InvalidateMemoryButtons; + end; + cbMR: + if FStatus in [csValid, csFirst] then + begin + FStatus := csFirst; + CheckFirst; + SetDisplay(FMemory); + end; + cbMC: + begin + FMemory := 0.0; + UpdateMemoryButtons; + InvalidateMemoryButtons; + end; + end; +end; + +procedure TcxCustomCalculator.UpdateMemoryButtons; +begin + // Disable buttons + if FMemory <> 0.0 then + begin + FButtons[cbMC].Grayed := False; + FButtons[cbMR].Grayed := False; + end + else + begin + FButtons[cbMC].Grayed := True; + FButtons[cbMR].Grayed := True; + end; +end; + +procedure TcxCustomCalculator.InvalidateMemoryButtons; +begin + InvalidateButton(cbMC); + InvalidateButton(cbMR); +end; + +function TcxCustomCalculator.GetDisplay: Extended; +var + S: string; +begin + if FStatus = csError then + Result := 0.0 + else + begin + S := Trim(GetEditorValue); + if S = '' then S := '0'; + RemoveThousandSeparator(S); + Result := StrToFloat(S); + end; +end; + +procedure TcxCustomCalculator.SetDisplay(Value: Extended); +var + S: string; +begin + S := FloatToStrF(Value, ffGeneral, Max(2, FPrecision), 0); + if GetEditorValue <> S then + begin + SetEditorValue(S); + if Assigned(FOnDisplayChange) then FOnDisplayChange(Self); + end; +end; + +function TcxCustomCalculator.GetMemory: Extended; +begin + Result := FMemory; +end; + +procedure TcxCustomCalculator.HidePopup(Sender: TcxControl; AReason: TcxEditCloseUpReason); +begin + if Assigned(FOnHidePopup) then FOnHidePopup(Self, AReason); +end; + +{ TcxPopupCalculator } + +constructor TcxPopupCalculator.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + IsPopupControl := True; +end; + +procedure TcxPopupCalculator.Init; +begin + FPressedButton := cbNone; +end; + +function TcxPopupCalculator.GetEditorValue: string; +begin + Result := Edit.Text; +end; + +function TcxPopupCalculator.GetPainter: TcxCustomLookAndFeelPainterClass; +begin + if Edit.ViewInfo.Painter <> nil then + Result := Edit.ViewInfo.Painter + else + Result := GetButtonPainterClass(Edit.PopupControlsLookAndFeel); +end; + +procedure TcxPopupCalculator.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited KeyDown(Key, Shift); + case Key of + VK_ESCAPE: HidePopup(Self, crCancel); + VK_INSERT: + if (Shift = [ssShift]) then + PasteFromClipboard + else + if (Shift = [ssCtrl]) then + CopyToClipboard; + VK_F4: + if not (ssAlt in Shift) then + HidePopup(Self, crClose); + VK_UP, VK_DOWN: + if Shift = [ssAlt] then + HidePopup(Self, crClose); + VK_TAB: + Edit.DoEditKeyDown(Key, Shift); + VK_RETURN: + HidePopup(Self, crEnter); + end; +end; + +procedure TcxPopupCalculator.KeyPress(var Key: Char); +begin + inherited KeyPress(Key); + if (Key = '=') and FEdit.ActiveProperties.QuickClose then + HidePopup(Self, crEnter); +end; + +procedure TcxPopupCalculator.SetEditorValue(const Value: string); +begin + if Edit.DoEditing then + begin + Edit.InnerEdit.EditValue := Value; + Edit.ModifiedAfterEnter := True; + end; +end; + +{ TcxCalcEditPropertiesValues } + +procedure TcxCalcEditPropertiesValues.Assign(Source: TPersistent); +begin + if Source is TcxCalcEditPropertiesValues then + begin + BeginUpdate; + try + inherited Assign(Source); + Precision := TcxCalcEditPropertiesValues(Source).Precision; + finally + EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxCalcEditPropertiesValues.RestoreDefaults; +begin + BeginUpdate; + try + inherited RestoreDefaults; + Precision := False; + finally + EndUpdate; + end; +end; + +procedure TcxCalcEditPropertiesValues.SetPrecision(Value: Boolean); +begin + if Value <> FPrecision then + begin + FPrecision := Value; + Changed; + end; +end; + +{ TcxCustomCalcEditProperties } + +constructor TcxCustomCalcEditProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FBeepOnError := True; + FPrecision := cxDefCalcPrecision; +// MaxLength := cxDefCalcPrecision + 2; + FQuickClose := False; + PopupSizeable := False; + ImmediateDropDown := False; +end; + +function TcxCustomCalcEditProperties.GetAssignedValues: TcxCalcEditPropertiesValues; +begin + Result := TcxCalcEditPropertiesValues(FAssignedValues); +end; + +function TcxCustomCalcEditProperties.GetPrecision: Byte; +begin + if AssignedValues.Precision then + Result := FPrecision + else + if IDefaultValuesProvider <> nil then + Result := IDefaultValuesProvider.DefaultPrecision + else + Result := cxDefCalcPrecision; + if Result > cxMaxCalcPrecision then + Result := cxMaxCalcPrecision; +end; + +function TcxCustomCalcEditProperties.IsPrecisionStored: Boolean; +begin + Result := AssignedValues.Precision; +end; + +procedure TcxCustomCalcEditProperties.SetAssignedValues( + Value: TcxCalcEditPropertiesValues); +begin + FAssignedValues.Assign(Value); +end; + +procedure TcxCustomCalcEditProperties.SetBeepOnError(Value: Boolean); +begin + if Value <> FBeepOnError then + begin + FBeepOnError := Value; + Changed; + end; +end; + +procedure TcxCustomCalcEditProperties.SetPrecision(Value: Byte); +begin + if AssignedValues.Precision and (Value = FPrecision) then + Exit; + + AssignedValues.FPrecision := True; + FPrecision := Value; + Changed; +end; + +procedure TcxCustomCalcEditProperties.SetQuickClose(Value: Boolean); +begin + if Value <> FQuickClose then + begin + FQuickClose := Value; + Changed; + end; +end; + +procedure TcxCustomCalcEditProperties.SetScientificFormat(Value: Boolean); +begin + if Value <> FScientificFormat then + begin + FScientificFormat := Value; + Changed; + end; +end; + +procedure TcxCustomCalcEditProperties.SetUseThousandSeparator(Value: Boolean); +begin + if Value <> FUseThousandSeparator then + begin + FUseThousandSeparator := Value; + Changed; + end; +end; + +function TcxCustomCalcEditProperties.GetAlwaysPostEditValue: Boolean; +begin + Result := True; +end; + +class function TcxCustomCalcEditProperties.GetAssignedValuesClass: TcxCustomEditPropertiesValuesClass; +begin + Result := TcxCalcEditPropertiesValues; +end; + +function TcxCustomCalcEditProperties.HasDigitGrouping( + AIsDisplayValueSynchronizing: Boolean): Boolean; +begin + Result := not ScientificFormat and UseThousandSeparator; +end; + +function TcxCustomCalcEditProperties.PopupWindowAcceptsAnySize: Boolean; +begin + Result := False; +end; + +function TcxCustomCalcEditProperties.StrToFloatEx(S: string; + var Value: Extended): Boolean; +var + E: Extended; + I: Integer; +begin + // Ignore Thousand Separators + for I := Length(S) downto 1 do + if S[I] = ThousandSeparator then + Delete(S, I, 1); + if not TextToFloat(PChar(S), E, fvExtended) or + ((E <> 0) and ((Abs(E) < MinDouble) or (Abs(E) > MaxDouble))) then + begin + Value := 0; + Result := False; + end + else + begin + Value := E; + Result := True; + end; +end; + +procedure TcxCustomCalcEditProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomCalcEditProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with TcxCustomCalcEditProperties(Source) do + begin + Self.BeepOnError := BeepOnError; + + Self.AssignedValues.Precision := False; + if AssignedValues.Precision then + Self.Precision := Precision; + + Self.QuickClose := QuickClose; + Self.ScientificFormat := ScientificFormat; + Self.UseThousandSeparator := UseThousandSeparator; + end; + finally + EndUpdate + end + end + else + inherited Assign(Source); +end; + +class function TcxCustomCalcEditProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxCalcEdit; +end; + +function TcxCustomCalcEditProperties.GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; +begin + if not AEditFocused and not AssignedValues.DisplayFormat and + (IDefaultValuesProvider <> nil) and + IDefaultValuesProvider.IsDisplayFormatDefined(True) then + Result := evsText + else + Result := evsValue; +end; + +function TcxCustomCalcEditProperties.IsDisplayValueValid( + var DisplayValue: TcxEditValue; AEditFocused: Boolean): Boolean; +begin +// if AEditFocused + + Result := True; +end; + +function TcxCustomCalcEditProperties.IsEditValueValid(var EditValue: TcxEditValue; + AEditFocused: Boolean): Boolean; +var + AValue: Extended; +begin + Result := VarIsNumericEx(EditValue) or VarIsSoftNull(EditValue); + if not Result then + Result := VarIsStr(EditValue) and + TextToFloat(PChar(VarToStr(EditValue)), AValue, fvExtended); +end; + +procedure TcxCustomCalcEditProperties.PrepareDisplayValue( + const AEditValue: TcxEditValue; var DisplayValue: TcxEditValue; + AEditFocused: Boolean); + + procedure RemoveInsignificantZeros(var S: string); + var + AExponentialPart: string; + I: Integer; + begin + if Pos(DecimalSeparator, S) = 0 then + Exit; + AExponentialPart := RemoveExponentialPart(S); + I := Length(S); + while S[I] = '0' do + Dec(I); + Delete(S, I + 1, Length(S) - I); + if S[Length(S)] = DecimalSeparator then + Delete(S, Length(S), 1); + S := S + AExponentialPart; + end; + +var + AFormat: TFloatFormat; + APrecision: Byte; + S: string; +begin + if VarIsSoftNull(AEditValue) then + S := '' + else + if not AEditFocused and AssignedValues.DisplayFormat then + S := FormatFloat(DisplayFormat, AEditValue) + else + begin + if ScientificFormat then + AFormat := ffExponent + else + AFormat := ffGeneral; + APrecision := Precision; + if APrecision = 0 then + APrecision := cxDefCalcPrecision; + + S := FloatToStrF(AEditValue, AFormat, APrecision, 0); + if UseThousandSeparator and not ScientificFormat then + InsertThousandSeparator(S); + if ScientificFormat then + RemoveInsignificantZeros(S); + end; + DisplayValue := S; +end; + +procedure TcxCustomCalcEditProperties.ValidateDisplayValue( + var ADisplayValue: TcxEditValue; var AErrorText: TCaption; + var Error: Boolean; AEdit: TcxCustomEdit); +begin + Error := False; + inherited ValidateDisplayValue(ADisplayValue, AErrorText, Error, AEdit); +end; + +{ TcxCustomCalcEdit } + +destructor TcxCustomCalcEdit.Destroy; +begin + FreeAndNil(FCalculator); + inherited Destroy; +end; + +function TcxCustomCalcEdit.GetProperties: TcxCustomCalcEditProperties; +begin + Result := TcxCustomCalcEditProperties(FProperties); +end; + +function TcxCustomCalcEdit.GetActiveProperties: TcxCustomCalcEditProperties; +begin + Result := TcxCustomCalcEditProperties(InternalGetActiveProperties); +end; + +function TcxCustomCalcEdit.GetValue: Extended; +begin + if VarIsNull(EditValue) or (VarIsStr(EditValue) and (EditValue = '')) then + Result := 0 + else + Result := EditValue; +end; + +procedure TcxCustomCalcEdit.SetProperties(Value: TcxCustomCalcEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomCalcEdit.SetValue(const Value: Extended); +begin + InternalEditValue := Value; +end; + +procedure TcxCustomCalcEdit.FormatChanged; +begin + DataBinding.UpdateDisplayValue; +end; + +function TcxCustomCalcEdit.CanDropDown: Boolean; +begin + Result := (not ActiveProperties.ReadOnly) and DataBinding.IsDataAvailable; +end; + +procedure TcxCustomCalcEdit.CreatePopupWindow; +begin + inherited CreatePopupWindow; + PopupWindow.ModalMode := False; +end; + +procedure TcxCustomCalcEdit.DoEnter; +begin + SynchronizeDisplayValue; + inherited; +end; + +procedure TcxCustomCalcEdit.DoExit; +begin + inherited; + DataBinding.UpdateDisplayValue; +end; + +procedure TcxCustomCalcEdit.DoInitPopup; +begin + inherited DoInitPopup; + ActiveProperties.PopupControl := FCalculator; +end; + +procedure TcxCustomCalcEdit.Initialize; +begin + inherited Initialize; + Value := 0; + FCalculator := TcxPopupCalculator.Create(Self); + FCalculator.Parent := PopupWindow; + FCalculator.Edit := Self; + FCalculator.AutoFontSize := False; + FCalculator.OnHidePopup := HidePopup; + ActiveProperties.PopupControl := FCalculator; +end; + +procedure TcxCustomCalcEdit.InitializePopupWindow; +begin + inherited InitializePopupWindow; + with Calculator do + begin + HandleNeeded; + Font.Assign(Self.ActiveStyle.GetVisibleFont); + FontChanged; + Resize; + end; +end; + +function TcxCustomCalcEdit.InternalGetEditingValue: TcxEditValue; +begin + PrepareEditValue(Text, Result, True); +end; + +function TcxCustomCalcEdit.IsValidChar(Key: Char): Boolean; + + function NumDigits(const S: string): Byte; + var + I: Integer; + begin + Result := 0; + for I := 1 to Length(S) do + if (S[I] = 'e') or (S[I] = 'E') then + Break + else + if S[I] in ['0'..'9'] then + Inc(Result); + end; + +var + S: string; + V: Extended; + StartPos, StopPos: Integer; +begin + Result := False; + if not IsNumericChar(Key, ntExponent) then + Exit; + S := Text; + StartPos := SelStart; + StopPos := SelStart + SelLength; + Delete(S, SelStart + 1, StopPos - StartPos); + if (Key = '-') and (S = '') then + begin + Result := True; + Exit; + end; + Insert(Key, S, StartPos + 1); + Result := ActiveProperties.StrToFloatEx(S, V); +end; + +procedure TcxCustomCalcEdit.KeyPress(var Key: Char); +begin + if (Key = '.') or (Key = ',') then + Key := DecimalSeparator; + if IsTextChar(Key) and not IsValidChar(Key) then + begin + Key := #0; + if ActiveProperties.BeepOnError then Beep; + end; + inherited KeyPress(Key); +end; + +procedure TcxCustomCalcEdit.PopupWindowClosed(Sender: TObject); +begin + if Text = cxGetResourceString(@scxSCalcError) then InternalEditValue := 0; + if ActiveProperties.AutoSelect then SelectAll else SelStart := Length(Text); + inherited PopupWindowClosed(Sender); +end; + +procedure TcxCustomCalcEdit.PopupWindowShowed(Sender: TObject); +begin + inherited PopupWindowShowed(Sender); + FCalculator.Init; +end; + +procedure TcxCustomCalcEdit.PropertiesChanged(Sender: TObject); +begin + if (Sender <> nil) and ActiveProperties.FormatChanging then + Exit; + inherited PropertiesChanged(Sender); + if not PropertiesChangeLocked then + begin + FCalculator.BeepOnError := ActiveProperties.BeepOnError; + FCalculator.Precision := ActiveProperties.Precision; + ActiveProperties.FChangedLocked := True; + ActiveProperties.PopupControl := FCalculator; + ActiveProperties.FChangedLocked := False; + end; +end; + +function TcxCustomCalcEdit.InternalPrepareEditValue(const ADisplayValue: string; + out EditValue: TcxEditValue): Boolean; +var + AValue: Extended; + S: string; +begin + Result := True; + S := VarToStr(ADisplayValue); + if not ActiveProperties.ScientificFormat and ActiveProperties.UseThousandSeparator then + RemoveThousandSeparator(S); + if Trim(S) = '' then + EditValue := Null + else + begin + Result := TextToFloat(PChar(S), AValue, fvExtended); + if Result then + EditValue := AValue + else + EditValue := Null; + end; +end; + +class function TcxCustomCalcEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomCalcEditProperties; +end; + +procedure TcxCustomCalcEdit.PasteFromClipboard; +begin + if DoEditing then + Calculator.PasteFromClipboard; +end; + +procedure TcxCustomCalcEdit.PrepareEditValue( + const ADisplayValue: TcxEditValue; out EditValue: TcxEditValue; + AEditFocused: Boolean); +begin + InternalPrepareEditValue(ADisplayValue, EditValue); +end; + +{ TcxCalcEdit } + +class function TcxCalcEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCalcEditProperties; +end; + +function TcxCalcEdit.GetActiveProperties: TcxCalcEditProperties; +begin + Result := TcxCalcEditProperties(InternalGetActiveProperties); +end; + +function TcxCalcEdit.GetProperties: TcxCalcEditProperties; +begin + Result := TcxCalcEditProperties(FProperties); +end; + +procedure TcxCalcEdit.SetProperties(Value: TcxCalcEditProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxFilterCalcEditHelper } + +class function TcxFilterCalcEditHelper.GetFilterEditClass: TcxCustomEditClass; +begin + Result := TcxCalcEdit; +end; + +class function TcxFilterCalcEditHelper.GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; +begin + Result := [fcoEqual, fcoNotEqual, fcoLess, fcoLessEqual, fcoGreater, + fcoGreaterEqual, fcoBlanks, fcoNonBlanks]; + if AExtendedSet then + Result := Result + [fcoBetween, fcoNotBetween, fcoInList, fcoNotInList]; +end; + +class procedure TcxFilterCalcEditHelper.InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); +begin + inherited InitializeProperties(AProperties, AEditProperties, AHasButtons); + with TcxCustomCalcEditProperties(AProperties) do + QuickClose := True; +end; + +initialization + GetRegisteredEditProperties.Register(TcxCalcEditProperties, scxSEditRepositoryCalcItem); + FilterEditsController.Register(TcxCalcEditProperties, TcxFilterCalcEditHelper); + +finalization + FilterEditsController.Unregister(TcxCalcEditProperties, TcxFilterCalcEditHelper); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxCalendar.pas b/official/x.35/ExpressEditors Library 5/Sources/cxCalendar.pas new file mode 100644 index 00000000..4a6894f6 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxCalendar.pas @@ -0,0 +1,3753 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxCalendar; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, ComCtrls, +{$IFDEF DELPHI6} + Types, Variants, DateUtils, +{$ENDIF} + SysUtils, Classes, Graphics, Controls, Forms, StdCtrls, Clipbrd, + cxClasses, cxGraphics, cxControls, cxContainer, cxDataStorage, cxDataUtils, + cxEdit, cxDropDownEdit, cxTextEdit, cxMaskEdit, cxButtons, cxDateUtils, + cxEditConsts, cxFormats, cxTimeEdit, cxFilterControlUtils; + +type + TCalendarButton = (btnClear, btnNow, btnToday, btnOk); + TDateButton = btnClear..btnToday; + TDateButtons = set of TDateButton; + + TcxCalendarArrow = (caPrevMonth, caNextMonth, caPrevYear, caNextYear); + TcxCalendarHotTrackRegion = (chrNone, chrMonth, chrYear); + TcxCalendarKind = (ckDate, ckDateTime); + TcxCustomCalendar = class; + + { TcxClock } + + TcxClock = class(TcxControl) + private + FMinuteDotColor: TColor; + FTime: TTime; + procedure SetMinuteDotColor(Value: TColor); + procedure SetTime(Value: TTime); + protected + procedure Paint; override; + public + constructor Create(AOwner: TComponent); override; + published + property Color; + property MinuteDotColor: TColor read FMinuteDotColor write SetMinuteDotColor + default clWindow; + property Time: TTime read FTime write SetTime; + end; + +{ TcxMonthListBox - Bug in Delphi5: Must be in the interface part } + + TcxMonthListBox = class(TcxCustomPopupWindow) + private + FCurrentDate: TcxDateTime; + FOrigin: TPoint; + FTopMonthDelta: Integer; + FItemHeight: Integer; + FItemIndex: Integer; + FItemCount: Integer; + FTimer: TcxTimer; + FSign: Integer; + procedure DoTimer(Sender: TObject); + function GetCalendar: TcxCustomCalendar; + function GetCalendarTable: TcxCustomCalendarTable; + function GetDate: TDateTime; + function GetShowYears: Boolean; + procedure SetItemIndex(Value: Integer); + procedure SetTopMonthDelta(Value: Integer); + protected + function CalculatePosition: TPoint; override; + procedure Click; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure DoShowed; override; + procedure FontChanged; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure Paint; override; + property Calendar: TcxCustomCalendar read GetCalendar; + property CalendarTable: TcxCustomCalendarTable read GetCalendarTable; + property ItemHeight: Integer read FItemHeight; + property ItemIndex: Integer read FItemIndex write SetItemIndex; + property ShowYears: Boolean read GetShowYears; + property TopMonthDelta: Integer read FTopMonthDelta write SetTopMonthDelta; + public + constructor Create(AOwnerControl: TWinControl); override; + destructor Destroy; override; + procedure CloseUp; override; + procedure Popup(AFocusedControl: TWinControl); override; + property Date: TDateTime read GetDate; + end; + + { TcxCustomCalendar } + + TcxCalendarViewInfo = record + ArrowRects: array[TcxCalendarArrow] of TRect; + CalendarRect: TRect; + CurrentDateRegion: TRect; + HeaderRegion: TRect; + LastVisibleArrow: TcxCalendarArrow; + MonthRegion: TRect; + YearRegion: TRect; + end; + + TcxCustomCalendar = class(TcxControl, IcxMouseTrackingCaller) + private + FArrowsForYear: Boolean; + FButtonsHeight: Integer; + FButtonsOffset: Integer; + FButtonsRegionHeight: Integer; + FButtonWidth: Integer; + FCalendarButtons: TDateButtons; + FCalendarTable: TcxCustomCalendarTable; + FClearButton: TcxButton; + FClock: TcxClock; + FClockSize: Integer; + FColWidth: Integer; + FDateRegionWidth: Integer; + FDaysOfWeekHeight: Integer; + FFirstDate: Double; + FFlat: Boolean; + FHeaderHeight: Integer; + FHotTrackRegion: TcxCalendarHotTrackRegion; + FKind: TcxCalendarKind; + FMonthListBox: TcxMonthListBox; + FNowButton: TcxButton; + FOKButton: TcxButton; + FPrevCursor: TCursor; + FRowHeight: Integer; + FSelectDate: Double; + FSideWidth: Integer; + FTimeEdit: TcxTimeEdit; + FTimer: TcxTimer; + FTodayButton: TcxButton; + FViewInfo: TcxCalendarViewInfo; + FWeekNumbers: Boolean; + FWeekNumberWidth: Integer; + FYearsInMonthList: Boolean; + FOnDateTimeChanged: TNotifyEvent; + procedure AdjustCalendarControlsPosition; + procedure ButtonClick(Sender: TObject); + procedure CalculateViewInfo; + procedure CreateButtons; + procedure CorrectHeaderTextRect(var R: TRect); + procedure DoDateTimeChanged; + procedure DoScrollArrow(Sender: TObject); + procedure DrawHeader; + function GetDateHeaderFrameColor: TColor; + function GetDateFromCell(X, Y: Integer): Double; + function GetDateTimeHeaderFrameColor: TColor; + function GetHeaderColor: TColor; + function GetHeaderOffset: TRect; + function GetShowButtonsRegion: Boolean; + function GetTimeEditWidth: Integer; + function GetTimeFormat: TcxTimeEditTimeFormat; + function GetUse24HourFormat: Boolean; + function GetWeekNumbersRegionWidth: Integer; + procedure GetVisibleButtonList(AList: TList); + procedure SetArrowsForYear(Value: Boolean); + procedure SetCalendarButtons(Value: TDateButtons); + procedure SetFlat(Value: Boolean); + procedure SetHotTrackRegion(Value: TcxCalendarHotTrackRegion); + procedure SetKind(Value: TcxCalendarKind); + procedure SetTimeFormat(Value: TcxTimeEditTimeFormat); + procedure SetUse24HourFormat(Value: Boolean); + procedure SetWeekNumbers(Value: Boolean); + procedure TimeChanged(Sender: TObject); + protected + procedure DblClick; override; + function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; override; + procedure FontChanged; override; + function HasBackground: Boolean; override; + procedure InitControl; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseEnter(AControl: TControl); override; + procedure MouseLeave(AControl: TControl); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure Paint; override; + procedure Calculate; virtual; + function CanResize(var NewWidth, NewHeight: Integer): Boolean; + override; + procedure CheckHotTrack; virtual; + procedure DoStep(AArrow: TcxCalendarArrow); + function GetButtonsRegionOffset: Integer; virtual; + function GetLastDate: Double; virtual; + function GetMonthCalendarOffset: TPoint; virtual; + function GetRealFirstDate: Double; virtual; + function GetRealLastDate: Double; virtual; + function GetSize: TSize; virtual; + procedure HidePopup(Sender: TcxControl; AReason: TcxEditCloseUpReason); virtual; + procedure InternalSetSelectDate(Value: Double; ARepositionVisibleDates: Boolean); + function PosToDateTime(P: TPoint): Double; virtual; + procedure SetFirstDate(Value: Double); virtual; + procedure SetSelectDate(Value: Double); virtual; + procedure SetSize; + procedure StepToFuture; + procedure StepToPast; + + // IcxMouseTrackingCaller + procedure MouseTrackingMouseLeave; + procedure IcxMouseTrackingCaller.MouseLeave = MouseTrackingMouseLeave; + + property CalendarTable: TcxCustomCalendarTable read FCalendarTable; + property HotTrackRegion: TcxCalendarHotTrackRegion read FHotTrackRegion + write SetHotTrackRegion; + property ShowButtonsRegion: Boolean read GetShowButtonsRegion; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property ArrowsForYear: Boolean read FArrowsForYear write SetArrowsForYear + default True; + property CalendarButtons: TDateButtons + read FCalendarButtons write SetCalendarButtons; + property FirstDate: Double read FFirstDate write SetFirstDate; + property Flat: Boolean read FFlat write SetFlat default True; + property Font; + property Kind: TcxCalendarKind read FKind write SetKind default ckDate; + property SelectDate: Double read FSelectDate write SetSelectDate; + property TimeFormat: TcxTimeEditTimeFormat read GetTimeFormat + write SetTimeFormat default tfHourMinSec; + property Use24HourFormat: Boolean read GetUse24HourFormat + write SetUse24HourFormat default True; + property WeekNumbers: Boolean read FWeekNumbers write SetWeekNumbers + default False; + property YearsInMonthList: Boolean read FYearsInMonthList + write FYearsInMonthList default True; + property OnDateTimeChanged: TNotifyEvent read FOnDateTimeChanged + write FOnDateTimeChanged; + end; + + { TcxPopupCalendar } + + TcxCustomDateEdit = class; + + TcxPopupCalendar = class(TcxCustomCalendar) + private + FEdit: TcxCustomDateEdit; + FOnHidePopup: TcxEditClosePopupEvent; + protected + procedure CheckHotTrack; override; + procedure HidePopup(Sender: TcxControl; AReason: TcxEditCloseUpReason); override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + public + property Edit: TcxCustomDateEdit read FEdit write FEdit; + property OnHidePopup: TcxEditClosePopupEvent read FOnHidePopup write FOnHidePopup; + end; + + TcxPopupCalendarClass = class of TcxPopupCalendar; + + { TcxDateEditPropertiesValues } + + TcxDateEditPropertiesValues = class(TcxTextEditPropertiesValues) + private + FDateButtons: Boolean; + FInputKind: Boolean; + function GetMaxDate: Boolean; + function GetMinDate: Boolean; + function IsMaxDateStored: Boolean; + function IsMinDateStored: Boolean; + procedure SetDateButtons(Value: Boolean); + procedure SetInputKind(Value: Boolean); + procedure SetMaxDate(Value: Boolean); + procedure SetMinDate(Value: Boolean); + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property DateButtons: Boolean read FDateButtons write SetDateButtons + stored False; + property InputKind: Boolean read FInputKind write SetInputKind stored False; + property MaxDate: Boolean read GetMaxDate write SetMaxDate stored IsMaxDateStored; + property MinDate: Boolean read GetMinDate write SetMinDate stored IsMinDateStored; + end; + + { TcxCustomDateEditProperties } + + TDateOnError = (deNoChange, deToday, deNull); + TcxInputKind = (ikStandard, ikMask, ikRegExpr); + + TcxCustomDateEditProperties = class(TcxCustomPopupEditProperties) + private + FArrowsForYear: Boolean; + FDateButtons: TDateButtons; + FDateOnError: TDateOnError; + FInputKind: TcxInputKind; + FKind: TcxCalendarKind; + FSaveTime: Boolean; + FShowTime: Boolean; + FWeekNumbers: Boolean; + FYearsInMonthList: Boolean; + procedure BuildEditMask; + function GetAssignedValues: TcxDateEditPropertiesValues; + function GetDateButtons: TDateButtons; + function GetDefaultDateButtons: TDateButtons; + function GetDefaultInputKind: TcxInputKind; + function GetInputKind: TcxInputKind; + function GetMaxDate: TDateTime; + function GetMinDate: TDateTime; + function IsDateButtonsStored: Boolean; + function IsInputKindStored: Boolean; + function NeedShowTime(ADate: TDateTime; AIsFocused: Boolean): Boolean; + procedure SetArrowsForYear(Value: Boolean); + procedure SetAssignedValues(Value: TcxDateEditPropertiesValues); + procedure SetDateButtons(Value: TDateButtons); + procedure SetDateOnError(Value: TDateOnError); + procedure SetInputKind(Value: TcxInputKind); + procedure SetKind(Value: TcxCalendarKind); + procedure SetMaxDate(Value: TDateTime); + procedure SetMinDate(Value: TDateTime); + procedure SetSaveTime(Value: Boolean); + procedure SetShowTime(Value: Boolean); + procedure SetWeekNumbers(Value: Boolean); + procedure SetYearsInMonthList(Value: Boolean); + protected + function GetAlwaysPostEditValue: Boolean; override; + class function GetAssignedValuesClass: TcxCustomEditPropertiesValuesClass; override; + function GetDisplayFormatOptions: TcxEditDisplayFormatOptions; override; + function GetModeClass(AMaskKind: TcxEditMaskKind): TcxMaskEditCustomModeClass; override; + class function GetPopupWindowClass: TcxCustomEditPopupWindowClass; override; + function IsEditValueNumeric: Boolean; override; + function IsValueBoundDefined(ABound: TcxEditValueBound): Boolean; override; + function IsValueBoundsDefined: Boolean; override; + function PopupWindowAcceptsAnySize: Boolean; override; + function GetEmptyDisplayValue(AEditFocused: Boolean): string; + function GetStandardMaskBlank(APos: Integer): Char; virtual; + function GetTimeZoneInfo(APos: Integer; + out AInfo: TcxTimeEditZoneInfo): Boolean; virtual; + procedure InternalPrepareEditValue(ADisplayValue: string; + out EditValue: TcxEditValue); + property AssignedValues: TcxDateEditPropertiesValues read GetAssignedValues + write SetAssignedValues; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + procedure Changed; override; + class function GetContainerClass: TcxContainerClass; override; + function GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; override; + function IsDisplayValueValid(var DisplayValue: TcxEditValue; + AEditFocused: Boolean): Boolean; override; + function IsEditValueValid(var EditValue: TcxEditValue; + AEditFocused: Boolean): Boolean; override; + procedure PrepareDisplayValue(const AEditValue: TcxEditValue; + var DisplayValue: TcxEditValue; AEditFocused: Boolean); override; + procedure ValidateDisplayValue(var ADisplayValue: TcxEditValue; + var AErrorText: TCaption; var AError: Boolean; + AEdit: TcxCustomEdit); override; + // !!! + property ArrowsForYear: Boolean read FArrowsForYear + write SetArrowsForYear default True; + property DateButtons: TDateButtons read GetDateButtons write SetDateButtons + stored IsDateButtonsStored; + property DateOnError: TDateOnError read FDateOnError write SetDateOnError + default deNoChange; + property ImmediateDropDown default False; + property InputKind: TcxInputKind read GetInputKind write SetInputKind + stored IsInputKindStored; + property Kind: TcxCalendarKind read FKind write SetKind default ckDate; + property MaxDate: TDateTime read GetMaxDate write SetMaxDate; + property MinDate: TDateTime read GetMinDate write SetMinDate; + property SaveTime: Boolean read FSaveTime write SetSaveTime default True; + property ShowTime: Boolean read FShowTime write SetShowTime default True; + property WeekNumbers: Boolean read FWeekNumbers write SetWeekNumbers + default False; + property YearsInMonthList: Boolean read FYearsInMonthList + write SetYearsInMonthList default True; + end; + + { TcxDateEditProperties } + + TcxDateEditProperties = class(TcxCustomDateEditProperties) + published + property Alignment; + property ArrowsForYear; + property AssignedValues; + property AutoSelect; + property ButtonGlyph; + property ClearKey; + property DateButtons; + property DateOnError; + property ImeMode; + property ImeName; + property ImmediatePost; + property InputKind; + property Kind; + property MaxDate; + property MinDate; + property PostPopupValueOnTab; + property ReadOnly; + property SaveTime; + property ShowTime; + property UseLeftAlignmentOnEditing; + property ValidateOnEnter; + property WeekNumbers; + property YearsInMonthList; + property OnChange; + property OnCloseUp; + property OnEditValueChanged; + property OnInitPopup; + property OnPopup; + property OnValidate; + end; + + { TcxDateEditPopupWindow } + + TcxDateEditPopupWindow = class(TcxPopupEditPopupWindow) + protected + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + function IsPopupCalendarKey(Key: Word; Shift: TShiftState): Boolean; virtual; + public + constructor Create(AOwnerControl: TWinControl); override; + end; + + { TcxDateEditMaskStandardMode } + + TcxDateEditMaskStandardMode = class(TcxMaskEditStandardMode) + protected + function GetBlank(APos: Integer): Char; override; + end; + + { TcxCustomDateEdit } + + TcxCustomDateEdit = class(TcxCustomPopupEdit) + private + FDateDropDown: TDateTime; + FSavedTime: TDateTime; + procedure DateChange(Sender: TObject); + function GetActiveProperties: TcxCustomDateEditProperties; + function GetCurrentDate: TDateTime; + function GetProperties: TcxCustomDateEditProperties; + function GetRecognizableDisplayValue(ADate: TDateTime): TcxEditValue; + procedure SetProperties(Value: TcxCustomDateEditProperties); + protected + FCalendar: TcxPopupCalendar; + function CanSynchronizeModeText: Boolean; override; + procedure CheckEditorValueBounds; override; + procedure CreatePopupWindow; override; +// procedure DoEditKeyDown(var Key: Word; Shift: TShiftState); override; + procedure DropDown; override; + procedure Initialize; override; + procedure InitializePopupWindow; override; + function InternalGetEditingValue: TcxEditValue; override; + function InternalGetText: string; override; + procedure InternalSetEditValue(const Value: TcxEditValue; + AValidateEditValue: Boolean); override; + function InternalSetText(const Value: string): Boolean; override; + procedure InternalValidateDisplayValue(const ADisplayValue: TcxEditValue); override; + function IsCharValidForPos(var AChar: Char; APos: Integer): Boolean; override; + procedure PopupWindowClosed(Sender: TObject); override; + procedure PopupWindowShowed(Sender: TObject); override; + procedure UpdateTextFormatting; override; + procedure CreateCalendar; virtual; + function GetCalendarClass: TcxPopupCalendarClass; virtual; + function GetDate: TDateTime; virtual; + function GetDateFromStr(const S: string): TDateTime; + procedure SetDate(Value: TDateTime); virtual; + procedure SetupPopupWindow; override; + property Calendar: TcxPopupCalendar read FCalendar; + public + destructor Destroy; override; + procedure Clear; override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + procedure PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); override; + property ActiveProperties: TcxCustomDateEditProperties read GetActiveProperties; + property CurrentDate: TDateTime read GetCurrentDate; + property Date: TDateTime read GetDate write SetDate stored False; + property Properties: TcxCustomDateEditProperties read GetProperties + write SetProperties; + end; + + { TcxDateEdit } + + TcxDateEdit = class(TcxCustomDateEdit) + private + function GetActiveProperties: TcxDateEditProperties; + function GetProperties: TcxDateEditProperties; + procedure SetProperties(Value: TcxDateEditProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxDateEditProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property BiDiMode; + property Constraints; + property DragCursor; + property DragKind; + property Date; + property DragMode; + property EditValue; + property Enabled; + property ImeMode; + property ImeName; + property ParentBiDiMode; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxDateEditProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop default True; + property Visible; + property OnClick; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDrag; + property OnStartDock; + end; + + { TcxFilterDateEditHelper } + + TcxFilterDateEditHelper = class(TcxFilterDropDownEditHelper) + public + class function GetFilterEditClass: TcxCustomEditClass; override; + class function GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; override; + class procedure InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); override; + end; + +function cxEditIsDateValid(ADate: Double): Boolean; +function VarIsNullDate(const AValue: Variant): Boolean; + +implementation + +uses + Math, + dxOffice11, dxThemeConsts, dxThemeManager, dxUxTheme, + cxEditPaintUtils, cxEditUtils, cxLookAndFeelPainters, + cxLookAndFeels, cxSpinEdit, cxVariants; + +type + TDelimiterOffset = record + Left, Right: Integer; + end; + +const + cxEditTimeFormatA: array [TcxTimeEditTimeFormat, Boolean] of string = ( + ('hh:nn:ss ampm', 'hh:nn:ss'), + ('hh:nn ampm', 'hh:nn'), + ('hh ampm', 'hh') + ); + DateNavigatorTime = 200; + Office11HeaderOffset = 2; + + WeekNumbersDelimiterOffset: TDelimiterOffset = (Left: 3; Right: 1); + WeekNumbersDelimiterWidth = 1; + +function cxEditIsDateValid(ADate: Double): Boolean; +begin + Result := (ADate = NullDate) or + ((ADate >= cxMinDateTime) and (ADate <= cxMaxDateTime)); +end; + +function VarIsNullDate(const AValue: Variant): Boolean; +begin + Result := (VarIsDate(AValue) or VarIsNumericEx(AValue)) and (AValue = NullDate); +end; + +function cxEncodeDate(AYear, AMonth, ADay: Word): Double; +begin + if (AYear < MinYear) or (AYear > MaxYear) or + (AMonth < 1) or (AMonth > 12) or + (ADay < 1) or (ADay > DaysInAMonth(AYear, AMonth)) then + Result := InvalidDate + else + Result := EncodeDate(AYear, AMonth, ADay); +end; + +procedure GetTimeFormat(const ADateTimeFormatInfo: TcxDateTimeFormatInfo; + out ATimeFormat: TcxTimeEditTimeFormat; out AUse24HourFormat: Boolean); + + function GetFormatInfoItemIndex( + AItemKind: TcxDateTimeFormatItemKind): Integer; + var + I: Integer; + begin + Result := -1; + for I := 0 to Length(ADateTimeFormatInfo.Items) - 1 do + if ADateTimeFormatInfo.Items[I].Kind = AItemKind then + begin + Result := I; + Break; + end; + end; + +var + AFormatInfoItemIndex: Integer; +begin + if GetFormatInfoItemIndex(dtikSec) <> -1 then + ATimeFormat := tfHourMinSec + else if GetFormatInfoItemIndex(dtikMin) <> -1 then + ATimeFormat := tfHourMin + else if GetFormatInfoItemIndex(dtikHour) <> -1 then + ATimeFormat := tfHour + else + ATimeFormat := tfHourMinSec; + + AFormatInfoItemIndex := GetFormatInfoItemIndex(dtikHour); + if AFormatInfoItemIndex <> -1 then + AUse24HourFormat := Copy(ADateTimeFormatInfo.Items[AFormatInfoItemIndex].Data, 1, 2) = '24' + else + AUse24HourFormat := False; +end; + +procedure TrueTextRect(ACanvas: TCanvas; R: TRect; X, Y: Integer; + const Text: WideString); +begin + ACanvas.TextRect(R, X, Y, Text); +end; + +{ TcxClock } + +constructor TcxClock.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FMinuteDotColor := clWindow; +end; + +procedure TcxClock.Paint; +begin + LookAndFeel.Painter.DrawClock(Canvas, ClientRect, TDateTime(FTime), Color); +end; + +procedure TcxClock.SetMinuteDotColor(Value: TColor); +begin + if Value <> FMinuteDotColor then + begin + FMinuteDotColor := Value; + Invalidate; + end; +end; + +procedure TcxClock.SetTime(Value: TTime); +begin + Value := Frac(Value); + if Value <> FTime then + begin + FTime := Value; + Invalidate; + end; +end; + +{ TcxMonthListBox } + +constructor TcxMonthListBox.Create(AOwnerControl: TWinControl); +begin + inherited Create(AOwnerControl); + ControlStyle := [csCaptureMouse, csOpaque]; + if not ShowYears then + ControlStyle := ControlStyle + [csClickEvents]; + FTimer := TcxTimer.Create(nil); + FTimer.Enabled := False; + FTimer.Interval := 200; + FTimer.OnTimer := DoTimer; + Adjustable := False; + BorderStyle := pbsFlat; +end; + +destructor TcxMonthListBox.Destroy; +begin + FreeAndNil(FTimer); + inherited Destroy; +end; + +procedure TcxMonthListBox.CloseUp; +var + ADate: TDateTime; +begin + if GetCaptureControl = Self then + SetCaptureControl(nil); + if not Visible then + Exit; + inherited CloseUp; + FTimer.Enabled := False; + if ShowYears then + begin + ADate := GetDate; + if ADate <> NullDate then + Calendar.SetFirstDate(ADate); + end; +end; + +procedure TcxMonthListBox.Popup(AFocusedControl: TWinControl); +var + R: TRect; +begin + FCurrentDate := CalendarTable.FromDateTime(Calendar.FirstDate); + if ShowYears then + FItemCount := 7 + else + FItemCount := CalendarTable.GetMonthsInYear(FCurrentDate.Year); + Font := Calendar.Font; + FontChanged; + if ShowYears then + TopMonthDelta := -3 + else + TopMonthDelta := 1 - FCurrentDate.Month; + R := Calendar.FViewInfo.MonthRegion; + R.TopLeft := Calendar.ClientToScreen(R.TopLeft); + R.BottomRight := Calendar.ClientToScreen(R.BottomRight); + FOrigin.X := R.Left + (R.Right - R.Left - Self.Width) div 2; + FOrigin.Y := (R.Top + R.Bottom) div 2 - Self.Height div 2; + FItemIndex := -1; + inherited Popup(AFocusedControl); +end; + +procedure TcxMonthListBox.DoTimer(Sender: TObject); +begin + TopMonthDelta := TopMonthDelta + FSign; +end; + +function TcxMonthListBox.GetCalendar: TcxCustomCalendar; +begin + Result := TcxCustomCalendar(OwnerControl); +end; + +function TcxMonthListBox.GetCalendarTable: TcxCustomCalendarTable; +begin + Result := TcxCustomCalendar(OwnerControl).CalendarTable; +end; + +function TcxMonthListBox.GetDate: TDateTime; +var + ADate: TcxDateTime; +begin + if ItemIndex = -1 then Result := NullDate + else + with CalendarTable do + begin + ADate := FromDateTime(AddMonths(FCurrentDate, TopMonthDelta + ItemIndex)); + ADate.Day := 1; + Result := ToDateTime(ADate); + end; +end; + +function TcxMonthListBox.GetShowYears: Boolean; +begin + Result := not Calendar.ArrowsForYear or Calendar.YearsInMonthList; +end; + +procedure TcxMonthListBox.SetItemIndex(Value: Integer); + + procedure InvalidateItemRect(AIndex: Integer); + var + R: TRect; + begin + if AIndex <> -1 then + begin + R.Left := BorderWidths[bLeft]; + R.Top := AIndex * ItemHeight + BorderWidths[bTop]; + R.Right := Width - BorderWidths[bRight]; + R.Bottom := R.Top + ItemHeight; + cxInvalidateRect(Handle, R, False); + end; + end; + +var + APrevItemIndex: Integer; +begin + if not HandleAllocated then Exit; + if FItemIndex <> Value then + begin + if FItemIndex <> Value then + begin + begin + APrevItemIndex := FItemIndex; + FItemIndex := Value; + InvalidateItemRect(APrevItemIndex); + InvalidateItemRect(FItemIndex); + end + end; + end; +end; + +procedure TcxMonthListBox.SetTopMonthDelta(Value: Integer); +begin + if FTopMonthDelta <> Value then + begin + FTopMonthDelta := Value; + Repaint; + end; +end; + +function TcxMonthListBox.CalculatePosition: TPoint; +begin + Result := FOrigin; +end; + +procedure TcxMonthListBox.Click; +var + ADate: TcxDateTime; +begin + inherited Click; + CloseUp; + ADate := CalendarTable.FromDateTime(CalendarTable.AddMonths(FCurrentDate, -FCurrentDate.Month)); + ADate.Day := 1; + if ItemIndex <> -1 then + Calendar.SetFirstDate(CalendarTable.AddMonths(CalendarTable.ToDateTime(ADate), + ItemIndex)); +end; + +procedure TcxMonthListBox.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + WindowClass.Style := WindowClass.Style or CS_SAVEBITS; +end; + +procedure TcxMonthListBox.DoShowed; +begin + if ShowYears then + SetCaptureControl(Self) + else + SetCaptureControl(nil); +end; + +procedure TcxMonthListBox.FontChanged; +begin + Canvas.Font := Font; + with Calendar do + begin + FItemHeight := FHeaderHeight - 2; + Self.Width := 6 * FColWidth + 2; + Self.Height := FItemCount * FItemHeight + 2; + end; +end; + +procedure TcxMonthListBox.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + if ShowYears then + CloseUp; +end; + +procedure TcxMonthListBox.MouseMove(Shift: TShiftState; X, Y: Integer); +const + Times: array[0..3] of UINT = (500, 250, 100, 50); +var + Delta: Integer; + Interval: Integer; +begin + if PtInRect(ClientRect, Point(X, Y)) then + begin + FTimer.Enabled := False; + ItemIndex := Y div ItemHeight; + end + else + begin + ItemIndex := -1; + if Y < 0 then Delta := Y + else + if Y >= ClientHeight then + Delta := 1 + Y - ClientHeight + else + begin + FTimer.Enabled := False; + Exit; + end; + FSign := Delta div Abs(Delta); + Interval := Abs(Delta) div ItemHeight; + if Interval > 3 then Interval := 3; + if not FTimer.Enabled or (Times[Interval] <> FTimer.Interval) then + begin + FTimer.Interval := Times[Interval]; + FTimer.Enabled := True; + end; + end; +end; + +procedure TcxMonthListBox.Paint; + + function GetItemColor(ASelected: Boolean): TColor; + begin + if ASelected then + Result := clWindowText + else + Result := Calendar.Color; + end; + +var + ASelected: Boolean; + R: TRect; + I: Integer; + S: string; + ADate: TcxDateTime; + AConvertDate: TDateTime; +begin + Canvas.FrameRect(GetControlRect(Self), clBlack); + R := Rect(1, 1, Width - 1, ItemHeight + 1); + ADate := CalendarTable.FromDateTime(CalendarTable.AddMonths(FCurrentDate, TopMonthDelta)); + for I := 0 to FItemCount - 1 do + begin + ASelected := I = ItemIndex; + Canvas.Font.Color := GetItemColor(not ASelected); + Canvas.Brush.Color := GetItemColor(ASelected); + Canvas.FillRect(R); + if CalendarTable.IsValidYear(ADate.Era, ADate.Year) then + begin + AConvertDate := CalendarTable.ToDateTime(ADate); + if ShowYears then + S := cxGetLocalMonthYear(AConvertDate, CalendarTable) + else + S := cxGetLocalMonthName(CalendarTable.ToDateTime(ADate), CalendarTable); + Canvas.DrawText(S, R, cxAlignCenter or cxSingleLine, True); + end; + ADate := CalendarTable.FromDateTime(CalendarTable.AddMonths(ADate, 1)); + OffsetRect(R, 0, ItemHeight); + end; +end; + +{ TcxCustomCalendar } + +constructor TcxCustomCalendar.Create(AOwner: TComponent); +var + ADate: TcxDateTime; +begin + inherited Create(AOwner); + ControlStyle := [csCaptureMouse, csOpaque]; + FArrowsForYear := True; + FHotTrackRegion := chrNone; + FSelectDate := Date; + FCalendarTable := cxGetLocalCalendar; + ADate := FCalendarTable.FromDateTime(FSelectDate); + ADate.Day := 1; + FFirstDate := FCalendarTable.ToDateTime(ADate); + Width := 20; + Height := 20; + FTimer := TcxTimer.Create(nil); + with FTimer do + begin + Enabled := False; + Interval := DateNavigatorTime; + OnTimer := DoScrollArrow; + end; + FMonthListBox := TcxMonthListBox.Create(Self); + FMonthListBox.CaptureFocus := False; + FMonthListBox.IsTopMost := True; + FMonthListBox.OwnerParent := Self; + Keys := [kAll, kArrows, kChars, kTab]; + CreateButtons; + FKind := ckDate; + SetCalendarButtons([btnClear, btnToday]); + FFlat := True; + FYearsInMonthList := True; +end; + +destructor TcxCustomCalendar.Destroy; +begin + FreeAndNil(FTimer); + EndMouseTracking(Self); + FreeAndNil(FMonthListBox); + FreeAndNil(FCalendarTable); + inherited Destroy; +end; + +procedure TcxCustomCalendar.AdjustCalendarControlsPosition; + + function GetTodayButtonRect: TRect; + begin + Result := + {$IFDEF DELPHI6} + Types.Bounds( + {$ELSE} + Classes.Bounds( + {$ENDIF} + (FDateRegionWidth - FButtonWidth - Byte(FClearButton.Visible) * FButtonWidth) div + (3 - Byte(not FClearButton.Visible)), + ClientHeight - FButtonsRegionHeight + FButtonsOffset, + FButtonWidth + 1, FButtonsHeight); + end; + + function GetClearButtonRect: TRect; + begin + Result := + {$IFDEF DELPHI6} + Types.Bounds( + {$ELSE} + Classes.Bounds( + {$ENDIF} + FDateRegionWidth - FButtonWidth - + (FDateRegionWidth - Byte(FTodayButton.Visible) * FButtonWidth - FButtonWidth) div + (3 - Byte(not FTodayButton.Visible)), + ClientHeight - FButtonsRegionHeight + FButtonsOffset, + FButtonWidth + 1, FButtonsHeight); + end; + + procedure SetButtonsPosition; + var + AButtonLeft, AButtonsOffset, AButtonsTop, I: Integer; + AList: TList; + begin + AList := TList.Create; + try + GetVisibleButtonList(AList); + + AButtonsTop := Height - FButtonsRegionHeight + 1 + + (FButtonsRegionHeight - 1 - FButtonsHeight) div 2; + AButtonsOffset := MulDiv(Font.Size, 5, 4); + + TButton(AList[AList.Count - 1]).SetBounds(Width - AButtonsOffset - + FButtonWidth - 1, AButtonsTop, FButtonWidth + 1, FButtonsHeight); + if AList.Count > 1 then + if AList.Count = 2 then + TButton(AList[0]).SetBounds(TButton(AList[1]).Left - AButtonsOffset - + FButtonWidth - 1, AButtonsTop, FButtonWidth + 1, FButtonsHeight) + else + begin + AButtonLeft := AButtonsOffset; + for I := 0 to AList.Count - 2 do + begin + TButton(AList[I]).SetBounds(AButtonLeft, AButtonsTop, + FButtonWidth + 1, FButtonsHeight); + Inc(AButtonLeft, AButtonsOffset + FButtonWidth + 1); + end; + end; + finally + AList.Free; + end; + end; + +var + R: TRect; + AButtonVOffset: Integer; +begin + if not HandleAllocated then + Exit; + + FClearButton.Visible := btnClear in CalendarButtons; + FNowButton.Visible := (Kind = ckDateTime) and (btnNow in CalendarButtons); + FOKButton.Visible := Kind = ckDateTime; + FTodayButton.Visible := btnToday in CalendarButtons; + + FClock.Visible := FOKButton.Visible; + FTimeEdit.Visible := FOKButton.Visible; + + if Kind = ckDate then + begin + R := GetTodayButtonRect; + FTodayButton.SetBounds(R.Left, R.Top, R.Right - R.Left, R.Bottom - R.Top); + R := GetClearButtonRect; + FClearButton.SetBounds(R.Left, R.Top, R.Right - R.Left, R.Bottom - R.Top); + end + else + begin + SetButtonsPosition; + + AButtonVOffset := (FButtonsRegionHeight - 1 - FButtonsHeight) div 2; + FTimeEdit.Top := (Height - FButtonsRegionHeight - FTimeEdit.Height) - + AButtonVOffset; + FTimeEdit.Width := GetTimeEditWidth; + FTimeEdit.Left := (Width - GetMonthCalendarOffset.X - FClockSize - AButtonVOffset * 2) + ((FClockSize + AButtonVOffset * 2 - FTimeEdit.Width) div 2); + FTimeEdit.SelStart := 0; // refit text + FClock.SetBounds(Width - GetMonthCalendarOffset.X - AButtonVOffset - FClockSize, + FHeaderHeight + GetMonthCalendarOffset.Y + AButtonVOffset, FClockSize, + FClockSize); + end; +end; + +procedure TcxCustomCalendar.ButtonClick(Sender: TObject); +var + ADate: TDateTime; +begin + case TCalendarButton(Integer(TcxButton(Sender).Tag)) of + btnNow: ADate := Now; + btnToday: ADate := Date + cxSign(Date) * FClock.Time; + btnClear: ADate := NullDate; + else + ADate := SelectDate + cxSign(SelectDate) * FClock.Time; + end; + FClock.Time := TTime(TimeOf(ADate)); + FTimeEdit.Time := FClock.Time; + SelectDate := ADate; + DoDateTimeChanged; + HidePopup(Self, crEnter); +end; + +procedure TcxCustomCalendar.CalculateViewInfo; + + function GetCurrentDateRegion: TRect; + begin + Result := Rect(0, 0, Width, FHeaderHeight); + if FOKButton.LookAndFeel.Painter = TcxOffice11LookAndFeelPainter then + begin + Inc(Result.Left, Office11HeaderOffset); + Inc(Result.Top, Office11HeaderOffset); + Dec(Result.Right, Office11HeaderOffset); + end; + end; + + function GetMonthCalendarPosition: TPoint; + begin + if Kind = ckDateTime then + begin + Result := GetMonthCalendarOffset; + Inc(Result.Y, FViewInfo.CurrentDateRegion.Bottom); + end + else + Result := Point(0, 0); + end; + + procedure OffsetMonthCalendar; + var + AArrow: TcxCalendarArrow; + AOffset: TPoint; + begin + AOffset := GetMonthCalendarPosition; + with FViewInfo do + begin + for AArrow := Low(TcxCalendarArrow) to LastVisibleArrow do + OffsetRect(ArrowRects[AArrow], AOffset.X, AOffset.Y); + OffsetRect(CalendarRect, AOffset.X, AOffset.Y); + OffsetRect(HeaderRegion, AOffset.X, AOffset.Y); + OffsetRect(MonthRegion, AOffset.X, AOffset.Y); + OffsetRect(YearRegion, AOffset.X, AOffset.Y); + end; + end; + + function GetHeaderBorderWidth: Integer; + begin + if Kind = ckDateTime then + Result := 1 + else + Result := Integer(not FFlat); + end; + + procedure CalculateTwoArrowsViewInfo; + var + ABorderWidth: Integer; + AHeaderOffset: TRect; + begin + ABorderWidth := GetHeaderBorderWidth; + AHeaderOffset := GetHeaderOffset; + with FViewInfo do + begin + ArrowRects[caPrevMonth] := Rect(AHeaderOffset.Left + ABorderWidth, + AHeaderOffset.Top + ABorderWidth, + AHeaderOffset.Left + ABorderWidth + FColWidth - 2, AHeaderOffset.Top + FHeaderHeight - 1); + ArrowRects[caNextMonth] := Rect(FDateRegionWidth - FColWidth + 2 - ABorderWidth - AHeaderOffset.Right, + AHeaderOffset.Top + ABorderWidth, FDateRegionWidth - ABorderWidth - AHeaderOffset.Right, + AHeaderOffset.Top + FHeaderHeight - 1); + MonthRegion := Rect(ArrowRects[caPrevMonth].Right, AHeaderOffset.Top, + ArrowRects[caNextMonth].Left, AHeaderOffset.Top + FHeaderHeight); + end; + end; + + procedure CalculateFourArrowsViewInfo; + var + ABorderWidth: Integer; + AHeaderOffset: TRect; + AMaxMonthNameWidth, AMonthNameWidth, ASpaceWidth: Integer; + AYearTextWidth, AMaxYearTextWidth, I: Integer; + AMonthRegionWidth: Integer; + AConvertDate: TcxDateTime; + begin + ABorderWidth := GetHeaderBorderWidth; + AHeaderOffset := GetHeaderOffset; + AMaxMonthNameWidth := 0; + Canvas.Font := Font; + AMaxYearTextWidth := 0; + AConvertDate := CalendarTable.FromDateTime(FirstDate); + for I := 1 to CalendarTable.GetMonthsInYear(AConvertDate.Era, AConvertDate.Year) do + begin + AMonthNameWidth := Canvas.TextWidth( + cxGetLocalMonthName(CalendarTable.AddMonths(FirstDate, I), CalendarTable)); + if AMonthNameWidth > AMaxMonthNameWidth then + AMaxMonthNameWidth := AMonthNameWidth; + AYearTextWidth := Canvas.TextWidth( + cxGetLocalYear(CalendarTable.AddYears(FirstDate, I), CalendarTable)); + AMaxYearTextWidth := Max(AMaxYearTextWidth, AYearTextWidth); + end; + + ASpaceWidth := FDateRegionWidth - ABorderWidth * 2 - AHeaderOffset.Left - + AHeaderOffset.Right - AMaxMonthNameWidth - AMaxYearTextWidth - 4 * (FColWidth - 2); + with FViewInfo do + begin + ArrowRects[caPrevMonth] := Rect(AHeaderOffset.Left + ABorderWidth, + AHeaderOffset.Top + ABorderWidth, + AHeaderOffset.Left + ABorderWidth + FColWidth - 2, AHeaderOffset.Top + FHeaderHeight - 1); + ArrowRects[caNextYear] := Rect(FDateRegionWidth - FColWidth + 2 - ABorderWidth - AHeaderOffset.Right, + AHeaderOffset.Top + ABorderWidth, FDateRegionWidth - ABorderWidth - AHeaderOffset.Right, + AHeaderOffset.Top + FHeaderHeight - 1); + end; + AMonthRegionWidth := AMaxMonthNameWidth + ASpaceWidth * AMaxMonthNameWidth div + (AMaxMonthNameWidth + AMaxYearTextWidth); + with FViewInfo.ArrowRects[caNextMonth] do + begin + Left := FViewInfo.ArrowRects[caPrevMonth].Right + AMonthRegionWidth; + Top := FViewInfo.ArrowRects[caPrevMonth].Top; + Right := Left + FColWidth - 2; + Bottom := FViewInfo.ArrowRects[caPrevMonth].Bottom; + end; + with FViewInfo do + begin + ArrowRects[caPrevYear] := ArrowRects[caNextMonth]; + OffsetRect(ArrowRects[caPrevYear], FColWidth - 2, 0); + + MonthRegion := Rect(ArrowRects[caPrevMonth].Right, AHeaderOffset.Top, + ArrowRects[caNextMonth].Left, AHeaderOffset.Top + FHeaderHeight); + YearRegion := Rect(ArrowRects[caPrevYear].Right, AHeaderOffset.Top, + ArrowRects[caNextYear].Left, AHeaderOffset.Top + FHeaderHeight); + end; + end; + + function GetCalendarRect: TRect; + begin + with Result do + begin + Left := 0; + Top := FViewInfo.MonthRegion.Bottom + 1; + Right := FDateRegionWidth; + Bottom := Top + FDaysOfWeekHeight + 6 * FRowHeight + 1; + end; + end; + +begin + if Kind = ckDateTime then + FViewInfo.CurrentDateRegion := GetCurrentDateRegion; + if ArrowsForYear then + begin + FViewInfo.LastVisibleArrow := caNextYear; + CalculateFourArrowsViewInfo; + end + else + begin + FViewInfo.LastVisibleArrow := caNextMonth; + CalculateTwoArrowsViewInfo; + end; + with FViewInfo do + HeaderRegion := Rect(0, MonthRegion.Top, FDateRegionWidth, + MonthRegion.Bottom); + FViewInfo.CalendarRect := GetCalendarRect; + OffsetMonthCalendar; +end; + +procedure TcxCustomCalendar.CreateButtons; + + function CreateButton(ACaption: TcxResourceStringID; ATabOrder: Integer; + ATag: TCalendarButton; ADefault: Boolean = False): TcxButton; + begin + Result := TcxButton.Create(Self); + Result.TabOrder := ATabOrder; + Result.UseSystemPaint := False; + Result.Caption := cxGetResourceString(ACaption); + Result.OnClick := ButtonClick; + Result.Tag := Integer(ATag); + Result.Default := ADefault; + end; + +begin + FTodayButton := CreateButton(@cxSDatePopupToday, 1, btnToday); + FNowButton := CreateButton(@cxSDatePopupNow, 2, btnNow); + FClearButton := CreateButton(@cxSDatePopupClear, 3, btnClear); + FOKButton := CreateButton(@cxSDatePopupOK, 4, btnOk, True); + + FTimeEdit := TcxTimeEdit.Create(Self); + with FTimeEdit do + begin + ActiveProperties.Circular := True; + ActiveProperties.OnChange := TimeChanged; + TabOrder := 0; + end; + + FClock := TcxClock.Create(Self); + FClock.TabStop := False; + FClock.LookAndFeel.MasterLookAndFeel := FOKButton.LookAndFeel; +end; + +procedure TcxCustomCalendar.CorrectHeaderTextRect(var R: TRect); +begin + if Kind = ckDateTime then + Inc(R.Top) + else + Inc(R.Top, Integer(not Flat)); + Dec(R.Bottom); +end; + +procedure TcxCustomCalendar.DoDateTimeChanged; +begin + if Assigned(FOnDateTimeChanged) then FOnDateTimeChanged(Self); +end; + +procedure TcxCustomCalendar.DoScrollArrow(Sender: TObject); +var + AArrow: TcxCalendarArrow; + P: TPoint; +begin + P := ScreenToClient(InternalGetCursorPos); + for AArrow := caPrevMonth to FViewInfo.LastVisibleArrow do + if PtInRect(FViewInfo.ArrowRects[AArrow], P) then + DoStep(AArrow); +end; + +procedure TcxCustomCalendar.DrawHeader; +const + HeaderBorders: array[Boolean] of TcxBorders = ([bBottom], cxBordersAll); +var + ADate: TcxDateTime; + AHeaderRect: TRect; + AIsTransparent: Boolean; + ASkinPainter: TcxCustomLookAndFeelPainterClass; + + procedure DrawArrows; + const + AArrowDirectionMap: array[TcxCalendarArrow] of TcxArrowDirection = + (adLeft, adRight, adLeft, adRight); + var + AArrow: TcxCalendarArrow; + P: TcxArrowPoints; + R: TRect; + begin + for AArrow := caPrevMonth to FViewInfo.LastVisibleArrow do + begin + R := FViewInfo.ArrowRects[AArrow]; + if not AIsTransparent then + begin + if FFlat and (Kind = ckDate) then + InternalPolyLine(Canvas, [Point(R.Left, R.Top), Point(R.Right - 1, R.Top)], + GetHeaderColor, True); + InternalPolyLine(Canvas, [Point(R.Left, R.Bottom - 1), + Point(R.Right - 1, R.Bottom - 1)], GetHeaderColor, True); + if FFlat and (Kind = ckDate) and (FOKButton.LookAndFeel.Painter <> TcxOffice11LookAndFeelPainter) then + Inc(R.Top); + Dec(R.Bottom); + end; + + if not AIsTransparent then + cxEditFillRect(Canvas.Handle, R, GetSolidBrush(GetHeaderColor)); + TcxUltraFlatLookAndFeelPainter.CalculateArrowPoints(R, P, AArrowDirectionMap[AArrow], False); + Canvas.Brush.Color := clBtnText; + Canvas.Pen.Color := clBtnText; + Canvas.Polygon(P); + + Canvas.ExcludeClipRect(FViewInfo.ArrowRects[AArrow]); + end; + end; + + procedure DrawHeaderText(const S: string; R: TRect; AIsHighlighted: Boolean); + var + ATextSize: TSize; + begin + if AIsHighlighted then + Canvas.Font.Color := GetHotTrackColor + else + Canvas.Font.Color := clBtnText; + CorrectHeaderTextRect(R); + ATextSize := Canvas.TextExtent(S); + with R do + TrueTextRect(Canvas.Canvas, R, Left + (Right - Left - ATextSize.cx) div 2, + Top + (Bottom - Top - ATextSize.cy) div 2, S); + end; + +begin + ASkinPainter := FOkButton.LookAndFeel.SkinPainter; + AIsTransparent := (ASkinPainter <> nil) or (FOKButton.LookAndFeel.Painter = TcxWinXPLookAndFeelPainter); + if ASkinPainter <> nil then + begin + ASkinPainter.DrawHeader(Canvas, FViewInfo.HeaderRegion, cxEmptyRect, [], + HeaderBorders[Kind = ckDateTime], cxbsNormal, taCenter, vaCenter, False, + False, '', Font, 0, 0); + end else + if FOKButton.LookAndFeel.Painter = TcxWinXPLookAndFeelPainter then + DrawThemeBackground(OpenTheme(totHeader), Canvas.Handle, HP_HEADERITEMLEFT, + HIS_NORMAL, FViewInfo.HeaderRegion); + DrawArrows; + + ADate := CalendarTable.FromDateTime(FirstDate); + Canvas.Font.Color := clBtnText; + Canvas.Brush.Color := GetHeaderColor; + + if AIsTransparent then + Canvas.Brush.Style := bsClear; + if ArrowsForYear then + begin + DrawHeaderText(cxGetLocalMonthName(FirstDate, CalendarTable), FViewInfo.MonthRegion, HotTrackRegion = chrMonth); + DrawHeaderText(cxGetLocalYear(FirstDate, CalendarTable), FViewInfo.YearRegion, HotTrackRegion = chrYear); + end else + DrawHeaderText(cxGetLocalMonthYear(FirstDate, CalendarTable), + FViewInfo.MonthRegion, HotTrackRegion = chrMonth); + Canvas.Brush.Style := bsSolid; + + AHeaderRect := FViewInfo.HeaderRegion; + if not AIsTransparent then + if not FFlat then + Canvas.DrawEdge(AHeaderRect, False, False, cxBordersAll) + else + if Kind = ckDateTime then + Canvas.FrameRect(AHeaderRect, GetDateTimeHeaderFrameColor) + else + if FOKButton.LookAndFeel.Painter = TcxOffice11LookAndFeelPainter then + Canvas.FrameRect(Rect(AHeaderRect.Left, AHeaderRect.Top - Office11HeaderOffset, AHeaderRect.Right, AHeaderRect.Bottom + Office11HeaderOffset - 1), Color, Office11HeaderOffset) + else + InternalPolyLine(Canvas, [Point(AHeaderRect.Left, AHeaderRect.Bottom - 1), Point(AHeaderRect.Right - 1, AHeaderRect.Bottom - 1)], GetDateHeaderFrameColor, True); + + Canvas.ExcludeClipRect(AHeaderRect); +end; + +function TcxCustomCalendar.GetDateHeaderFrameColor: TColor; +begin + if FOKButton.LookAndFeel.Painter = TcxOffice11LookAndFeelPainter then + Result := Color + else + Result := clBtnText; +end; + +function TcxCustomCalendar.GetDateFromCell(X, Y: Integer): Double; +begin + Result := FirstDate - DayOfWeekOffset(FirstDate) + Y * 7 + X; + if (DayOfWeekOffset(FirstDate) = 0) and (FirstDate > cxMinDateTime) then + Result := Result - 7; +end; + +function TcxCustomCalendar.GetDateTimeHeaderFrameColor: TColor; +begin + if FOKButton.LookAndFeel.Painter = TcxOffice11LookAndFeelPainter then + Result := Color + else + Result := clBtnShadow; +end; + +function TcxCustomCalendar.GetHeaderColor: TColor; +begin + if FOKButton.LookAndFeel.Painter = TcxOffice11LookAndFeelPainter then + Result := TcxOffice11LookAndFeelPainter.DefaultDateNavigatorHeaderColor + else + Result := clBtnFace; +end; + +function TcxCustomCalendar.GetHeaderOffset: TRect; +begin + if (Kind = ckDate) and (FOKButton.LookAndFeel.Painter = TcxOffice11LookAndFeelPainter) then + Result := Rect(Office11HeaderOffset, Office11HeaderOffset, Office11HeaderOffset, 0) + else + Result := cxEmptyRect; +end; + +function TcxCustomCalendar.GetShowButtonsRegion: Boolean; +begin + Result := (Kind = ckDateTime) or FTodayButton.Visible + or FClearButton.Visible; +end; + +function TcxCustomCalendar.GetTimeEditWidth: Integer; +var + AEditSizeProperties: TcxEditSizeProperties; +begin + AEditSizeProperties := DefaultcxEditSizeProperties; + AEditSizeProperties.MaxLineCount := 1; + Result := FTimeEdit.ActiveProperties.GetEditSize(Canvas, FTimeEdit.Style, + True, 0, AEditSizeProperties).cx + Canvas.TextWidth('0'); +end; + +function TcxCustomCalendar.GetTimeFormat: TcxTimeEditTimeFormat; +begin + Result := FTimeEdit.ActiveProperties.TimeFormat; +end; + +function TcxCustomCalendar.GetUse24HourFormat: Boolean; +begin + Result := FTimeEdit.ActiveProperties.Use24HourFormat; +end; + +function TcxCustomCalendar.GetWeekNumbersRegionWidth: Integer; +begin + if WeekNumbers then + Result := FWeekNumberWidth + WeekNumbersDelimiterOffset.Left + + WeekNumbersDelimiterWidth + WeekNumbersDelimiterOffset.Right + else + Result := 0; +end; + +procedure TcxCustomCalendar.GetVisibleButtonList(AList: TList); +begin + if btnToday in CalendarButtons then + AList.Add(FTodayButton); + if (Kind = ckDateTime) and (btnNow in CalendarButtons) then + AList.Add(FNowButton); + if btnClear in CalendarButtons then + AList.Add(FClearButton); + if Kind = ckDateTime then + AList.Add(FOKButton); +end; + +procedure TcxCustomCalendar.SetArrowsForYear(Value: Boolean); +begin + if Value <> FArrowsForYear then + begin + FArrowsForYear := Value; + Calculate; + end; +end; + +procedure TcxCustomCalendar.SetCalendarButtons(Value: TDateButtons); +begin + if Value <> FCalendarButtons then + begin + FCalendarButtons := Value; + FClearButton.Visible := btnClear in Value; + FNowButton.Visible := btnNow in Value; + FTodayButton.Visible := btnToday in Value; + Calculate; + end; +end; + +procedure TcxCustomCalendar.SetFlat(Value: Boolean); +begin + if FFlat <> Value then + begin + FFlat := Value; + Calculate; + end; +end; + +procedure TcxCustomCalendar.SetHotTrackRegion(Value: TcxCalendarHotTrackRegion); + + function GetHotTrackRegion(AHotTrackRegion: TcxCalendarHotTrackRegion): TRect; + begin + if AHotTrackRegion = chrMonth then + Result := FViewInfo.MonthRegion + else + Result := FViewInfo.YearRegion; + end; + +begin + if Value <> FHotTrackRegion then + begin + if FHotTrackRegion <> chrNone then + InvalidateRect(GetHotTrackRegion(FHotTrackRegion), False); + FHotTrackRegion := Value; + if FHotTrackRegion <> chrNone then + InvalidateRect(GetHotTrackRegion(FHotTrackRegion), False); + + if Value = chrNone then + Screen.Cursor := FPrevCursor + else + begin + FPrevCursor := Screen.Cursor; +// Screen.Cursor := crcxEditMouseWheel; + end; + end; +end; + +procedure TcxCustomCalendar.SetKind(Value: TcxCalendarKind); +begin + if Value <> FKind then + begin + FKind := Value; + Calculate; + if Value = ckDate then + ControlStyle := ControlStyle - [csDoubleClicks, csClickEvents] + else + ControlStyle := ControlStyle + [csDoubleClicks, csClickEvents]; + end; +end; + +procedure TcxCustomCalendar.SetTimeFormat(Value: TcxTimeEditTimeFormat); +begin + if Value <> TimeFormat then + begin + FTimeEdit.ActiveProperties.TimeFormat := Value; + Calculate; + end; +end; + +procedure TcxCustomCalendar.SetUse24HourFormat(Value: Boolean); +begin + if Value <> Use24HourFormat then + begin + FTimeEdit.ActiveProperties.Use24HourFormat := Value; + Calculate; + end; +end; + +procedure TcxCustomCalendar.SetWeekNumbers(Value: Boolean); +begin + if Value <> FWeekNumbers then + begin + FWeekNumbers := Value; + Calculate; + end; +end; + +procedure TcxCustomCalendar.TimeChanged(Sender: TObject); +var + R: TRect; +begin + FClock.Time := FTimeEdit.Time; + R := Rect(0, 0, Width, FHeaderHeight - 1); + if not FFlat then + InflateRect(R, -1, -1); + InvalidateRect(R, False); +end; + +procedure TcxCustomCalendar.FontChanged; +begin + inherited FontChanged; + Calculate; +end; + +procedure TcxCustomCalendar.DblClick; +var + ADate: TDateTime; +begin + inherited DblClick; + if Kind = ckDateTime then + begin + ADate := PosToDateTime(ScreenToClient(InternalGetCursorPos)); + if ADate <> NullDate then + begin + SelectDate := ADate; + HidePopup(Self, crEnter); + DoDateTimeChanged; + end; + end; +end; + +function TcxCustomCalendar.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; +const + AArrowMap: array[Boolean, Boolean] of TcxCalendarArrow = + ((caPrevMonth, caNextMonth), (caPrevYear, caNextYear)); +begin + Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos); + MousePos := ScreenToClient(MousePos); + if not Result and not FMonthListBox.IsVisible and (PtInRect(FViewInfo.MonthRegion, MousePos) or + PtInRect(FViewInfo.YearRegion, MousePos)) then + begin + Result := True; + DoStep(AArrowMap[PtInRect(FViewInfo.YearRegion, MousePos), WheelDelta < 0]); + end; +end; + +function TcxCustomCalendar.HasBackground: Boolean; +begin + // for correctly work with manifest + Result := FTodayButton.LookAndFeel.NativeStyle and AreVisualStylesAvailable; +end; + +procedure TcxCustomCalendar.InitControl; +begin + inherited InitControl; + FClearButton.Parent := Self; + FOKButton.Parent := Self; + FNowButton.Parent := Self; + FTodayButton.Parent := Self; + FClock.Parent := Self; + FTimeEdit.Parent := Self; + FontChanged; +end; + +procedure TcxCustomCalendar.KeyDown(var Key: Word; Shift: TShiftState); +var + ADate: TcxDateTime; + + procedure MoveByMonth(AForward: Boolean); + begin + ADate := CalendarTable.FromDateTime(SelectDate); + if AForward then + SelectDate := CalendarTable.AddMonths(SelectDate, 1) + else + SelectDate := CalendarTable.AddMonths(SelectDate, -1); + end; + +begin + ADate := CalendarTable.FromDateTime(SelectDate); + case Key of + VK_LEFT: + SelectDate := SelectDate - 1; + VK_RIGHT: SelectDate := SelectDate + 1; + VK_UP: + if not (Shift = [ssAlt]) then SelectDate := SelectDate - 7; + VK_DOWN: + if not (Shift = [ssAlt]) then SelectDate := SelectDate + 7; + VK_HOME: + if Shift = [ssCtrl] then + begin + ADate.Day := 1; + SelectDate := CalendarTable.ToDateTime(ADate); + end + else + SelectDate := SelectDate - DayOfWeekOffset(SelectDate); + VK_END: + if Shift = [ssCtrl] then + begin + ADate.Day := CalendarTable.GetDaysInMonth(ADate.Era, ADate.Year, ADate.Month); + SelectDate := CalendarTable.ToDateTime(ADate); + end + else SelectDate := SelectDate + (6 - DayOfWeekOffset(SelectDate)); + VK_PRIOR: MoveByMonth(False); + VK_NEXT: MoveByMonth(True) + end; + inherited KeyDown(Key, Shift); +end; + +procedure TcxCustomCalendar.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + + function GetMonthPopupRect: TRect; + begin + Result := FViewInfo.MonthRegion; + CorrectHeaderTextRect(Result); + end; + +var + ADate: Double; + AArrow: TcxCalendarArrow; + P: TPoint; +begin + inherited MouseDown(Button, Shift, X, Y); + CheckHotTrack; + if Button <> mbLeft then + Exit; + P := Point(X, Y); + ADate := PosToDateTime(P); + if ADate <> NullDate then + InternalSetSelectDate(ADate, False) + else + begin + for AArrow := caPrevMonth to FViewInfo.LastVisibleArrow do + if PtInRect(FViewInfo.ArrowRects[AArrow], P) then + begin + DoStep(AArrow); + FTimer.Enabled := True; + Exit; + end; + if PtInRect(GetMonthPopupRect, P) then + FMonthListBox.Popup(Self); + end; +end; + +procedure TcxCustomCalendar.MouseEnter(AControl: TControl); +begin + inherited MouseEnter(AControl); + CheckHotTrack; + BeginMouseTracking(Self, GetControlRect(Self), Self); +end; + +procedure TcxCustomCalendar.MouseLeave(AControl: TControl); +begin + inherited MouseLeave(AControl); + CheckHotTrack; + EndMouseTracking(Self); +end; + +procedure TcxCustomCalendar.MouseMove(Shift: TShiftState; X, Y: Integer); +var + ADate: Double; +begin + CheckHotTrack; + BeginMouseTracking(Self, GetControlRect(Self), Self); + if FTimer.Enabled then + Exit; + ADate := NullDate; + if ssLeft in Shift then + ADate := PosToDateTime(Point(X, Y)); + inherited MouseMove(Shift, X, Y); + if (ssLeft in Shift) and (ADate <> NullDate) then + InternalSetSelectDate(ADate, False); +end; + +procedure TcxCustomCalendar.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); + + function GetMonthRegion: TRect; + begin + Result := FViewInfo.MonthRegion; + CorrectHeaderTextRect(Result); + end; + + function GetYearRegion: TRect; + begin + Result := FViewInfo.YearRegion; + CorrectHeaderTextRect(Result); + end; + +var + P: TPoint; +begin + inherited MouseUp(Button, Shift, X, Y); + CheckHotTrack; + if FTimer.Enabled then + begin + FTimer.Enabled := False; + Exit; + end; + P := Point(X, Y); + if (Kind = ckDate) and PtInRect(ClientRect, P) and + not PtInRect(GetMonthRegion, P) and not PtInRect(GetYearRegion, P) then + begin + HidePopup(Self, crEnter); + if PosToDateTime(P) <> NullDate then + DoDateTimeChanged; + end; + if (Kind = ckDateTime) and (SelectDate <> NullDate) then + FirstDate := DateOf(SelectDate); +end; + +procedure TcxCustomCalendar.Paint; + + procedure DrawCurrentDateRegion; + var + ATextSize: TSize; + R: TRect; + S: string; + begin + R := FViewInfo.CurrentDateRegion; + if FOKButton.LookAndFeel.SkinPainter <> nil then + begin + InflateRect(R, 1, 0); + FOKButton.LookAndFeel.SkinPainter.DrawHeader(Canvas, R, cxEmptyRect, [], + [], cxbsNormal, taCenter, vaCenter, False, False, '', Font, 0, 0) + end + else + if FOKButton.LookAndFeel.Painter = TcxWinXPLookAndFeelPainter then + DrawThemeBackground(OpenTheme(totHeader), Canvas.Handle, + HP_HEADERITEMLEFT, HIS_NORMAL, R) + else + if FOKButton.LookAndFeel.Painter <> TcxOffice11LookAndFeelPainter then + begin + if FFlat then + begin + with R do + InternalPolyLine(Canvas, [Point(Left, Bottom - 1), + Point(Right - 1, Bottom - 1)], clBtnText, True); + Dec(R.Bottom); + end else + begin + Canvas.DrawEdge(R, False, False, cxBordersAll); + InflateRect(R, -1, -1); + end; + end; + S := cxDateToLocalFormatStr(SelectDate + cxSign(SelectDate) * FTimeEdit.Time); + Canvas.Font := Font; + Canvas.Font.Color := clBtnText; + Canvas.Brush.Color := GetHeaderColor; + ATextSize := Canvas.TextExtent(S); + if (FOKButton.LookAndFeel.SkinPainter <> nil) or + (FOKButton.LookAndFeel.Painter = TcxWinXPLookAndFeelPainter) + then + Canvas.Brush.Style := bsClear; + TrueTextRect(Canvas.Canvas, R, R.Left + (R.Right - R.Left - ATextSize.cx) div 2, + R.Top + (R.Bottom - R.Top - ATextSize.cy) div 2, S); + Canvas.Brush.Style := bsSolid; + Canvas.ExcludeClipRect(FViewInfo.CurrentDateRegion); + end; + + procedure DrawWeekNumbers; + var + I: Integer; + R: TRect; + begin + if not WeekNumbers then + Exit; + Canvas.Brush.Color := Color; + Canvas.Font := Font; + Canvas.Font.Size := MulDiv(Canvas.Font.Size, 2, 3); + for I := 0 to 5 do + begin + if not cxEditIsDateValid(GetDateFromCell(0, I)) then + Continue; + R.Left := FViewInfo.CalendarRect.Left + FSideWidth; + R.Top := FViewInfo.CalendarRect.Top + FDaysOfWeekHeight + FRowHeight * I; + R.Right := R.Left + FWeekNumberWidth; + R.Bottom := R.Top + FRowHeight; + + Canvas.DrawTexT(IntToStr(CalendarTable.GetWeekNumber(GetDateFromCell(0, I), + TDay(cxFormatController.StartOfWeek), cxFormatController.FirstWeekOfYear)), + R, cxAlignRight or cxAlignVCenter); + end; + Canvas.Font := Font; + end; + + procedure DrawMonth; + var + ACurDate, ADate, ALastDate: Double; + ASelected: Boolean; + ASideRect, ATextRect, R: TRect; + ASize: TSize; + AWeekNumbersDelimiterPos, I, J: Integer; + S: string; + begin + ACurDate := Date; + ALastDate := GetLastDate; + with Canvas do + begin + // write first letters of day's names + Brush.Color := Self.Color; + R := FViewInfo.CalendarRect; + with ATextRect do + begin + Left := R.Left + FSideWidth + GetWeekNumbersRegionWidth; + Right := R.Right - FSideWidth; + Top := R.Top; + Bottom := Top + FDaysOfWeekHeight - 2; + FillRect(Rect(Left - 8, Top, Left, Bottom + 2)); + FillRect(Rect(Right, Top, Right + 8, Bottom + 2)); + + InternalPolyLine(Self.Canvas, [Point(Left, Bottom), + Point(Right - 1, Bottom)], clBtnShadow, True); + InternalPolyLine(Self.Canvas, [Point(Left, Bottom + 1), + Point(Right - 1, Bottom + 1)], clWindow, True); + if (Kind = ckDate) and ShowButtonsRegion then + InternalPolyLine(Self.Canvas, [Point(Left, ClientHeight - FButtonsRegionHeight - 1), + Point(Right - 1, ClientHeight - FButtonsRegionHeight - 1)], clBtnShadow, True); + if WeekNumbers then + begin + AWeekNumbersDelimiterPos := R.Left + FSideWidth + FWeekNumberWidth + WeekNumbersDelimiterOffset.Left; + Brush.Color := Self.Color; + FillRect(Rect(R.Left, Top, AWeekNumbersDelimiterPos, R.Bottom)); + InternalPolyLine(Self.Canvas, [Point(AWeekNumbersDelimiterPos, R.Top), + Point(AWeekNumbersDelimiterPos, Bottom - 1)], Self.Color, True); + if (Kind = ckDate) and ShowButtonsRegion then + begin + InternalPolyLine(Self.Canvas, [Point(AWeekNumbersDelimiterPos, Bottom), + Point(AWeekNumbersDelimiterPos, ClientHeight - FButtonsRegionHeight - 1)], clBtnShadow, True); + InternalPolyLine(Self.Canvas, [Point(AWeekNumbersDelimiterPos + 1, ClientHeight - FButtonsRegionHeight - 1), + Point(AWeekNumbersDelimiterPos + 1, ClientHeight - FButtonsRegionHeight - 1)], clBtnShadow, True); + end + else + begin + InternalPolyLine(Self.Canvas, [Point(AWeekNumbersDelimiterPos, Bottom), + Point(AWeekNumbersDelimiterPos, R.Bottom - 3)], clBtnShadow, True); + InternalPolyLine(Self.Canvas, [Point(AWeekNumbersDelimiterPos, R.Bottom - 2), + Point(AWeekNumbersDelimiterPos, R.Bottom - 2)], Self.Color, True); + end; + InternalPolyLine(Self.Canvas, [Point(AWeekNumbersDelimiterPos + 1, Bottom), + Point(AWeekNumbersDelimiterPos + 1, Bottom)], clBtnShadow, True); + InternalPolyLine(Self.Canvas, [Point(AWeekNumbersDelimiterPos + 1, Bottom + 1), + Point(AWeekNumbersDelimiterPos + 1, Bottom + 1)], clWindow, True); + InternalPolyLine(Self.Canvas, [Point(AWeekNumbersDelimiterPos + 1, Bottom + 2), + Point(AWeekNumbersDelimiterPos + 1, R.Bottom - 2)], Self.Color, True); + end; + + Right := Left; + end; + Font.Color := clBtnText; + for I := cxFormatController.StartOfWeek to cxFormatController.StartOfWeek + 6 do + begin + ATextRect.Left := ATextRect.Right; + ATextRect.Right := ATextRect.Left + FColWidth; + J := I; + if J > 7 then + Dec(J, 7) + else + if J <= 0 then + Inc(J, 7); + S := cxGetDayOfWeekName(J, Font.Charset); + ASize := TextExtent(S); + TrueTextRect(Canvas, ATextRect, ATextRect.Right - 3 - ASize.cx, (ATextRect.Top + ATextRect.Bottom - ASize.cy) div 2, S); + end; + // write numbers of days + for I := 0 to 6 do + for J := 0 to 5 do + begin + ATextRect.Left := R.Left + FSideWidth + GetWeekNumbersRegionWidth + I * FColWidth; + ATextRect.Top := R.Top + FDaysOfWeekHeight + J * FRowHeight; + ATextRect.Right := ATextRect.Left + FColWidth; + ATextRect.Bottom := ATextRect.Top + FRowHeight; + ADate := GetDateFromCell(I, J); + ASelected := (ADate = FSelectDate) or + ((FSelectDate = NullDate) and (ADate = ACurDate)); + ASideRect := ATextRect; + // draw frame around current date + if (ADate = ACurDate) or (ACurDate = NullDate) then + begin + FrameRect(ATextRect, clMaroon); + InflateRect(ATextRect, -1, -1); + end; + if ASelected then + Brush.Color := FOKButton.LookAndFeel.Painter.DefaultDateNavigatorSelectionColor + else + Brush.Color := Self.Color; + // draw text of day's number + if not ASelected and ((ADate < FirstDate) or (ADate > ALastDate)) then + Font.Color := clGrayText + else + if ASelected then + Font.Color := FOKButton.LookAndFeel.Painter.DefaultDateNavigatorSelectionTextColor + else + Font.Color := clWindowText; + if CalendarTable.IsValidDate(ADate) then + S := cxDayNumberToLocalFormatStr(ADate) + else + S := ''; + ASize := TextExtent(S); + TrueTextRect(Canvas, ATextRect, ASideRect.Right - 3 - ASize.cx, (ASideRect.Top + ASideRect.Bottom - ASize.cy) div 2, S); + end; + + DrawWeekNumbers; + + ExcludeClipRect(Rect(R.Left + FSideWidth, R.Top, R.Right - FSideWidth, R.Bottom - 1)); + end; + end; + + procedure DrawButtonsRegion; + var + R, R1: TRect; + ABorderColor: TColor; + begin + R := Rect(0, Height - FButtonsRegionHeight, Width, Height); + R1 := R; + ABorderColor := FOKButton.LookAndFeel.Painter.GetContainerBorderColor(False); + if ABorderColor = clDefault then + ABorderColor := clBtnText; + with R1 do + InternalPolyLine(Canvas, [Point(Left, Top), Point(Right - 1, Top)], + ABorderColor, True); + Inc(R1.Top); + if not FFlat then + begin + Canvas.DrawEdge(R1, False, False, cxBordersAll); + InflateRect(R1, -1, -1); + end; + cxEditFillRect(Canvas.Handle, R1, GetSolidBrush(Color)); + Canvas.ExcludeClipRect(R); + end; + + procedure DrawDateTimeRegionsDelimiter; + var + X: Integer; + begin + X := FViewInfo.CalendarRect.Right + FColWidth div 2; + InternalPolyLine(Canvas, [Point(X, FViewInfo.CalendarRect.Top), Point(X, FTimeEdit.Top + FTimeEdit.Height - 1)], clBtnShadow, True); + end; + +var + R: TRect; +begin + with Canvas do + begin + if Kind = ckDateTime then + DrawCurrentDateRegion; + DrawHeader; + DrawMonth; + if (Kind = ckDate) and ShowButtonsRegion then + begin + R := Rect(FSideWidth, ClientHeight - FButtonsRegionHeight - 1, + FDateRegionWidth - FSideWidth, ClientHeight - FButtonsRegionHeight); + ExcludeClipRect(R); + end; + if Kind = ckDateTime then + DrawButtonsRegion; + Brush.Color := Self.Color; + FillRect(ClientRect); + if Kind = ckDateTime then + DrawDateTimeRegionsDelimiter; + end; +{$IFDEF DELPHI7} + Canvas.SetClipRegion(TcxRegion.Create(GetControlRect(Self)), roSet); +{$ENDIF} +end; + +procedure TcxCustomCalendar.Calculate; + + procedure AdjustCalendarControls; + var + AHasKeyboardNavigation: Boolean; + begin + AHasKeyboardNavigation := Kind = ckDateTime; + + FTodayButton.TabStop := AHasKeyboardNavigation; + FTodayButton.TabOrder := 1; + + FNowButton.TabStop := AHasKeyboardNavigation; + FNowButton.TabOrder := 2; + + FClearButton.TabStop := AHasKeyboardNavigation; + FClearButton.TabOrder := 3; + + FOKButton.TabStop := AHasKeyboardNavigation; + FOKButton.TabOrder := 4; + + FTimeEdit.TabStop := AHasKeyboardNavigation; + FTimeEdit.TabOrder := 0; + if AHasKeyboardNavigation then + Keys := Keys - [kTab] + else + Keys := Keys + [kTab]; + end; + + procedure CalculateButtonWidth; + var + AVisibleButtonList: TList; + I: Integer; + begin + AVisibleButtonList := TList.Create; + try + GetVisibleButtonList(AVisibleButtonList); + FButtonWidth := 0; + for I := 0 to AVisibleButtonList.Count - 1 do + FButtonWidth := Max(FButtonWidth, + Canvas.TextWidth(TcxButton(AVisibleButtonList[I]).Caption)); + Inc(FButtonWidth, FColWidth); + finally + AVisibleButtonList.Free; + end; + end; + +begin + if not HandleAllocated then + Exit; + + AdjustCalendarControls; + + Canvas.Font := Font; + Canvas.Font.Size := MulDiv(Canvas.Font.Size, 2, 3); + FWeekNumberWidth := Canvas.TextWidth('99'); + Canvas.Font := Font; + + FColWidth := 3 * Canvas.TextWidth('0'); + FSideWidth := 2 * Canvas.TextWidth('0'); + FRowHeight := Canvas.TextHeight('0') + 2; + FHeaderHeight := FRowHeight + 3; + if (Kind = ckDate) and (FOKButton.LookAndFeel.Painter = TcxOffice11LookAndFeelPainter) then + Dec(FHeaderHeight); + FDaysOfWeekHeight := FRowHeight + 1; + + CalculateButtonWidth; + + FButtonsOffset := Font.Size div 2; + FButtonsHeight := MulDiv(Canvas.TextHeight('Wg'), 20, 13) + 1; + if Kind = ckDateTime then + begin + FButtonsRegionHeight := MulDiv(Font.Size, 5, 4) + 1; + if not Odd(FButtonsRegionHeight) then + Inc(FButtonsRegionHeight); + Inc(FButtonsRegionHeight, FButtonsHeight); + end + else + FButtonsRegionHeight := FButtonsOffset + (FButtonsHeight - 1) + + MulDiv(Font.Size, 3, 4); + + SetSize; + CalculateViewInfo; + Invalidate; +end; + +function TcxCustomCalendar.CanResize(var NewWidth, NewHeight: Integer): Boolean; +var + ASize: TSize; +begin + ASize := GetSize; + NewWidth := ASize.cx; + NewHeight := ASize.cy; + Result := True; +end; + +procedure TcxCustomCalendar.CheckHotTrack; +var + P: TPoint; +begin + if FMonthListBox.IsVisible then + HotTrackRegion := chrNone + else + if GetCaptureControl = nil then + begin + P := ScreenToClient(InternalGetCursorPos); + if PtInRect(FViewInfo.MonthRegion, P) then + HotTrackRegion := chrMonth + else + if PtInRect(FViewInfo.YearRegion, P) then + HotTrackRegion := chrYear + else + HotTrackRegion := chrNone + end + else + HotTrackRegion := chrNone; +end; + +procedure TcxCustomCalendar.DoStep(AArrow: TcxCalendarArrow); +begin + FirstDate := InvalidDate; + case AArrow of + caPrevMonth: + FirstDate := CalendarTable.AddMonths(FirstDate, -1); + caNextMonth: + FirstDate := CalendarTable.AddMonths(FirstDate, 1); + caPrevYear: + FirstDate := CalendarTable.AddYears(FirstDate, -1); + caNextYear: + FirstDate := CalendarTable.AddYears(FirstDate, 1); + end; +end; + +function TcxCustomCalendar.GetButtonsRegionOffset: Integer; +begin + Result := Font.Size div 2; +end; + +function TcxCustomCalendar.GetLastDate: Double; +var + ADate: TcxDateTime; +begin + ADate := CalendarTable.FromDateTime(FirstDate); + ADate.Day := CalendarTable.GetDaysInMonth(ADate.Year, ADate.Month); + Result := CalendarTable.ToDateTime(ADate); +end; + +function TcxCustomCalendar.GetMonthCalendarOffset: TPoint; +begin + Result.X := MulDiv(Font.Size, 3, 4); + Result.Y := Result.X; +end; + +function TcxCustomCalendar.GetRealFirstDate: Double; +var + ACol: Integer; +begin + Result := FirstDate; + ACol := DayOfWeekOffset(FirstDate); + if ACol = 0 then + Result := Result - 7 + else + Result := Result - ACol; +end; + +function TcxCustomCalendar.GetRealLastDate: Double; +var + Year, Month, Day: Word; + ACol: Integer; +begin + Result := GetLastDate; + DecodeDate(Result, Year, Month, Day); + ACol := DayOfWeekOffset(EncodeDate(Year, Month, 1)); + Result := Result + 6 * 7 - DaysPerMonth(Year, Month) - ACol; + if ACol = 0 then Result := Result - 7; +end; + +function TcxCustomCalendar.GetSize: TSize; + + function GetTimeRegionWidth: Integer; + var + AButtonVOffset, ATimeEditWidth: Integer; + begin + AButtonVOffset := (FButtonsRegionHeight - 1 - FButtonsHeight) div 2; + + FClockSize := Height - FHeaderHeight - GetMonthCalendarOffset.Y - + FButtonsRegionHeight - FTimeEdit.Height - AButtonVOffset * 3; + Result := FClockSize; + ATimeEditWidth := GetTimeEditWidth; + if Result < ATimeEditWidth then + Result := ATimeEditWidth; + Inc(Result, AButtonVOffset * 2); + end; + +begin + Result.cy := (FHeaderHeight + 1) + (FDaysOfWeekHeight + 6 * FRowHeight); + if ShowButtonsRegion then + Result.cy := Result.cy + FButtonsRegionHeight; + if Kind = ckDateTime then + Result.cy := Result.cy + FHeaderHeight + GetMonthCalendarOffset.Y + + GetButtonsRegionOffset + else + Result.cy := Result.cy + 1; + Result.cy := Result.cy + GetHeaderOffset.Top; + + FDateRegionWidth := 2 * FSideWidth + 7 * FColWidth + GetWeekNumbersRegionWidth; + Result.cx := FDateRegionWidth; + if Kind = ckDateTime then + Result.cx := Result.cx + GetMonthCalendarOffset.X * 2 + FColWidth + + GetTimeRegionWidth; +end; + +procedure TcxCustomCalendar.HidePopup(Sender: TcxControl; AReason: TcxEditCloseUpReason); +begin + FTimer.Enabled := False; + FMonthListBox.FTimer.Enabled := False; + if FMonthListBox.Showing then FMonthListBox.CloseUp; +end; + +procedure TcxCustomCalendar.InternalSetSelectDate(Value: Double; + ARepositionVisibleDates: Boolean); +var + R: TRect; +begin + if (FSelectDate <> Value) and cxEditIsDateValid(Value) then + begin + FSelectDate := Value; + if ARepositionVisibleDates and (Value <> NullDate) then + FirstDate := DateOf(FSelectDate); + if ARepositionVisibleDates or (Kind = ckDateTime) then + Repaint + else + begin + R := FViewInfo.CalendarRect; + Inc(R.Top, FDaysOfWeekHeight); + InvalidateRect(R, False); + end; + end; +end; + +function TcxCustomCalendar.PosToDateTime(P: TPoint): Double; +var + X, Y: Integer; + R: TRect; +begin + if PtInRect(ClientRect, P) then + begin + R := FViewInfo.CalendarRect; + with R do + begin + Inc(Top, FDaysOfWeekHeight); + Inc(Left, FSideWidth + GetWeekNumbersRegionWidth); + Dec(Right, FSideWidth); + Bottom := Top + 6 * FRowHeight; + if PtInRect(R, P) then + begin + Dec(P.X, Left); + Dec(P.Y, Top); + X := P.X div FColWidth; + Y := P.Y div FRowHeight; + Result := GetDateFromCell(X, Y); + end + else Result := NullDate; + end; + end + else Result := NullDate; +end; + +procedure TcxCustomCalendar.SetFirstDate(Value: Double); +var + ADate: TcxDateTime; +begin + if not cxEditIsDateValid(Value) then + Exit; + ADate := CalendarTable.FromDateTime(Value); + ADate.Day := 1; + Value := CalendarTable.ToDateTime(ADate); + if FFirstDate <> Value then + begin + FFirstDate := Value; + Repaint; + end; +end; + +procedure TcxCustomCalendar.SetSelectDate(Value: Double); +begin + InternalSetSelectDate(Value, True); +end; + +procedure TcxCustomCalendar.SetSize; +var + ASize: TSize; +begin + ASize := GetSize; + SetBounds(Left, Top, ASize.cx, ASize.cy); + AdjustCalendarControlsPosition; +end; + +procedure TcxCustomCalendar.StepToFuture; +var + Year, Month, Day: Word; +begin + DecodeDate(FirstDate, Year, Month, Day); + IncMonth(Year, Month); + FirstDate := EncodeDate(Year, Month, 1); +end; + +procedure TcxCustomCalendar.StepToPast; +var + Year, Month, Day: Word; +begin + DecodeDate(FirstDate, Year, Month, Day); + DecMonth(Year, Month); + FirstDate := EncodeDate(Year, Month, 1); +end; + +// IcxMouseTrackingCaller +procedure TcxCustomCalendar.MouseTrackingMouseLeave; +begin + CheckHotTrack; + EndMouseTracking(Self); +end; + +{ TcxPopupCalendar } + +procedure TcxPopupCalendar.CheckHotTrack; +begin + if not Edit.HasPopupWindow then + HotTrackRegion := chrNone + else + inherited CheckHotTrack; +end; + +procedure TcxPopupCalendar.HidePopup(Sender: TcxControl; AReason: TcxEditCloseUpReason); +begin + inherited HidePopup(Sender, AReason); + if Assigned(FOnHidePopup) then FOnHidePopup(Self, AReason); +end; + +procedure TcxPopupCalendar.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited KeyDown(Key, Shift); + case Key of + VK_ESCAPE: + if not FMonthListBox.ShowYears and FMonthListBox.IsVisible then + FMonthListBox.CloseUp + else + HidePopup(Self, crCancel); + VK_F4: + if not (ssAlt in Shift) then + HidePopup(Self, crClose); + VK_UP, VK_DOWN: + if Shift = [ssAlt] then + HidePopup(Self, crClose); + VK_RETURN: + if not FMonthListBox.Showing then + begin + HidePopup(Self, crEnter); + DoDateTimeChanged; + end; + VK_TAB: + if TcxCustomDateEditProperties(Edit.Properties).Kind = ckDate then + begin + if Edit.ActiveProperties.PostPopupValueOnTab then + DoDateTimeChanged; + Edit.DoEditKeyDown(Key, Shift); + end; + end; +end; + +procedure TcxPopupCalendar.MouseMove(Shift: TShiftState; X, Y: Integer); +var + R: TRect; +begin + inherited MouseMove(Shift, X, Y); + if FTimer.Enabled then Exit; + if (ssLeft in Shift) and not PtInRect(ClientRect, Point(X, Y)) then + begin + FSelectDate := TcxCustomDateEdit(Edit).Date; + R := FViewInfo.CalendarRect; + Inc(R.Top, FDaysOfWeekHeight); + InvalidateRect(R, False); + end; +end; + +{ TcxDateEditPropertiesValues } + +procedure TcxDateEditPropertiesValues.Assign(Source: TPersistent); +begin + if Source is TcxDateEditPropertiesValues then + begin + BeginUpdate; + try + inherited Assign(Source); + with TcxDateEditPropertiesValues(Source) do + begin + Self.DateButtons := DateButtons; + Self.InputKind := InputKind; + end; + finally + EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxDateEditPropertiesValues.RestoreDefaults; +begin + BeginUpdate; + try + inherited RestoreDefaults; + DateButtons := False; + InputKind := False; + finally + EndUpdate; + end; +end; + +function TcxDateEditPropertiesValues.GetMaxDate: Boolean; +begin + Result := MaxValue; +end; + +function TcxDateEditPropertiesValues.GetMinDate: Boolean; +begin + Result := MinValue; +end; + +function TcxDateEditPropertiesValues.IsMaxDateStored: Boolean; +begin + Result := IsMaxValueStored; +end; + +function TcxDateEditPropertiesValues.IsMinDateStored: Boolean; +begin + Result := IsMinValueStored; +end; + +procedure TcxDateEditPropertiesValues.SetDateButtons(Value: Boolean); +begin + if Value <> FDateButtons then + begin + FDateButtons := Value; + Changed; + end; +end; + +procedure TcxDateEditPropertiesValues.SetInputKind(Value: Boolean); +begin + if Value <> FInputKind then + begin + FInputKind := Value; + Changed; + end; +end; + +procedure TcxDateEditPropertiesValues.SetMaxDate(Value: Boolean); +begin + MaxValue := Value; +end; + +procedure TcxDateEditPropertiesValues.SetMinDate(Value: Boolean); +begin + MinValue := Value; +end; + +{ TcxCustomDateEditProperties } + +constructor TcxCustomDateEditProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FArrowsForYear := True; + FDateOnError := deNoChange; + CaseInsensitive := True; + FKind := ckDate; + FSaveTime := True; + FShowTime := True; + FYearsInMonthList := True; + ImmediateDropDown := False; + PopupSizeable := False; + BuildEditMask; +end; + +procedure TcxCustomDateEditProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomDateEditProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with TcxCustomDateEditProperties(Source) do + begin + Self.ArrowsForYear := ArrowsForYear; + + Self.AssignedValues.DateButtons := False; + if AssignedValues.DateButtons then + Self.DateButtons := DateButtons; + + Self.DateOnError := DateOnError; + + Self.AssignedValues.InputKind := False; + if AssignedValues.InputKind then + Self.InputKind := InputKind; + + Self.Kind := Kind; + Self.SaveTime := SaveTime; + Self.ShowTime := ShowTime; + Self.WeekNumbers := WeekNumbers; + Self.YearsInMonthList := YearsInMonthList; + end; + finally + EndUpdate + end + end + else + inherited Assign(Source); +end; + +procedure TcxCustomDateEditProperties.Changed; +begin + if not ChangedLocked then + begin + BeginUpdate; + try + BuildEditMask; + finally + EndUpdate(False); + end; + end; + inherited Changed; +end; + +procedure TcxCustomDateEditProperties.BuildEditMask; +begin + LockUpdate(True); + try + case InputKind of + ikMask: + begin + MaskKind := emkStandard; + if Kind = ckDateTime then + EditMask := cxFormatController.StandardDateTimeEditMask + else + EditMask := cxFormatController.StandardDateEditMask; + end; + ikRegExpr: + begin + MaskKind := emkRegExprEx; + if Kind = ckDateTime then + EditMask := cxFormatController.RegExprDateTimeEditMask + else + EditMask := cxFormatController.RegExprDateEditMask; + end; + else + EditMask := ''; + end; + finally + LockUpdate(False); + end; +end; + +function TcxCustomDateEditProperties.GetAssignedValues: TcxDateEditPropertiesValues; +begin + Result := TcxDateEditPropertiesValues(FAssignedValues); +end; + +function TcxCustomDateEditProperties.GetDateButtons: TDateButtons; +begin + if AssignedValues.DateButtons then + Result := FDateButtons + else + Result := GetDefaultDateButtons; +end; + +function TcxCustomDateEditProperties.GetDefaultDateButtons: TDateButtons; +begin + if Kind = ckDate then + Result := [btnClear, btnToday] + else + Result := [btnClear, btnNow]; +end; + +function TcxCustomDateEditProperties.GetDefaultInputKind: TcxInputKind; +begin + if Kind = ckDate then + Result := ikRegExpr + else + Result := ikMask; +end; + +function TcxCustomDateEditProperties.GetInputKind: TcxInputKind; +begin + if not cxIsGregorianCalendar then + begin + Result := ikStandard; + Exit; + end; + if AssignedValues.InputKind then + Result := FInputKind + else + Result := GetDefaultInputKind; +end; + +function TcxCustomDateEditProperties.GetMaxDate: TDateTime; +begin + Result := inherited MaxValue; +end; + +function TcxCustomDateEditProperties.GetMinDate: TDateTime; +begin + Result := inherited MinValue; +end; + +function TcxCustomDateEditProperties.IsDateButtonsStored: Boolean; +begin + Result := AssignedValues.DateButtons; +end; + +function TcxCustomDateEditProperties.IsInputKindStored: Boolean; +begin + Result := AssignedValues.InputKind; +end; + +function TcxCustomDateEditProperties.NeedShowTime(ADate: TDateTime; + AIsFocused: Boolean): Boolean; +begin + if AIsFocused then + begin + if Kind = ckDateTime then + Result := not((TimeOf(ADate) = 0) and (InputKind <> ikMask)) + else + Result := ShowTime and (TimeOf(ADate) <> 0) and (InputKind = ikStandard); + end + else + Result := not((Kind = ckDate) and not ShowTime); +end; + +procedure TcxCustomDateEditProperties.SetArrowsForYear(Value: Boolean); +begin + if Value <> FArrowsForYear then + begin + FArrowsForYear := Value; + Changed; + end; +end; + +procedure TcxCustomDateEditProperties.SetAssignedValues( + Value: TcxDateEditPropertiesValues); +begin + FAssignedValues.Assign(Value); +end; + +procedure TcxCustomDateEditProperties.SetDateButtons(Value: TDateButtons); +begin + if AssignedValues.DateButtons and (Value = FDateButtons) then + Exit; + + AssignedValues.FDateButtons := True; + FDateButtons := Value; + Changed; +end; + +procedure TcxCustomDateEditProperties.SetDateOnError(Value: TDateOnError); +begin + if Value <> FDateOnError then + begin + FDateOnError := Value; + Changed; + end; +end; + +procedure TcxCustomDateEditProperties.SetInputKind(Value: TcxInputKind); +begin + if AssignedValues.InputKind and (Value = FInputKind) then + Exit; + AssignedValues.FInputKind := True; + FInputKind := Value; + Changed; +end; + +procedure TcxCustomDateEditProperties.SetKind(Value: TcxCalendarKind); +begin + if Value <> FKind then + begin + FKind := Value; + Changed; + end; +end; + +procedure TcxCustomDateEditProperties.SetMaxDate(Value: TDateTime); +begin + inherited MaxValue := Value; +end; + +procedure TcxCustomDateEditProperties.SetMinDate(Value: TDateTime); +begin + inherited MinValue := Value; +end; + +procedure TcxCustomDateEditProperties.SetSaveTime(Value: Boolean); +begin + if Value <> FSaveTime then + begin + FSaveTime := Value; + Changed; + end; +end; + +procedure TcxCustomDateEditProperties.SetShowTime(Value: Boolean); +begin + if Value <> FShowTime then + begin + FShowTime := Value; + Changed; + end; +end; + +procedure TcxCustomDateEditProperties.SetWeekNumbers(Value: Boolean); +begin + if Value <> FWeekNumbers then + begin + FWeekNumbers := Value; + Changed; + end; +end; + +procedure TcxCustomDateEditProperties.SetYearsInMonthList(Value: Boolean); +begin + if Value <> FYearsInMonthList then + begin + FYearsInMonthList := Value; + Changed; + end; +end; + +function TcxCustomDateEditProperties.GetAlwaysPostEditValue: Boolean; +begin + Result := True; +end; + +class function TcxCustomDateEditProperties.GetAssignedValuesClass: TcxCustomEditPropertiesValuesClass; +begin + Result := TcxDateEditPropertiesValues; +end; + +function TcxCustomDateEditProperties.GetDisplayFormatOptions: TcxEditDisplayFormatOptions; +begin + Result := [dfoSupports, dfoNoCurrencyValue]; +end; + +function TcxCustomDateEditProperties.GetModeClass( + AMaskKind: TcxEditMaskKind): TcxMaskEditCustomModeClass; +begin + if AMaskKind = emkStandard then + Result := TcxDateEditMaskStandardMode + else + Result := inherited GetModeClass(AMaskKind); +end; + +class function TcxCustomDateEditProperties.GetPopupWindowClass: TcxCustomEditPopupWindowClass; +begin + Result := TcxDateEditPopupWindow; +end; + +function TcxCustomDateEditProperties.IsEditValueNumeric: Boolean; +begin + Result := True; +end; + +function TcxCustomDateEditProperties.IsValueBoundDefined( + ABound: TcxEditValueBound): Boolean; +begin + if (MinValue <> 0) and (MaxValue <> 0) then + Result := MinValue < MaxValue + else + if ABound = evbMin then + Result := MinValue <> 0 + else + Result := MaxValue <> 0; +end; + +function TcxCustomDateEditProperties.IsValueBoundsDefined: Boolean; +begin + if (MinValue <> 0) and (MaxValue <> 0) then + Result := MinValue < MaxValue + else + Result := (MinValue <> 0) or (MaxValue <> 0); +end; + +function TcxCustomDateEditProperties.PopupWindowAcceptsAnySize: Boolean; +begin + Result := False; +end; + +function TcxCustomDateEditProperties.GetEmptyDisplayValue( + AEditFocused: Boolean): string; +var + ATimeStringLength: Integer; + S: string; +begin + Result := GetEmptyString; + if AEditFocused and (Kind = ckDateTime) and (InputKind = ikMask) and + not cxFormatController.AssignedStandardDateTimeEditMask then + begin + S := DateTimeToTextEx(0, True, True); + ATimeStringLength := cxFormatController.GetDateTimeStandardMaskStringLength( + cxFormatController.TimeFormatInfo); + Delete(Result, Length(Result) - ATimeStringLength + 1, ATimeStringLength); + Result := Result + Copy(S, Length(S) - ATimeStringLength + 1, ATimeStringLength); + end; +end; + +function TcxCustomDateEditProperties.GetStandardMaskBlank(APos: Integer): Char; +var + ATimeZoneInfo: TcxTimeEditZoneInfo; +begin + if not GetTimeZoneInfo(APos, ATimeZoneInfo) then + Result := ' ' + else + if ATimeZoneInfo.Kind = tzTimeSuffix then + Result := #0 + else + Result := '0'; +end; + +function TcxCustomDateEditProperties.GetTimeZoneInfo(APos: Integer; + out AInfo: TcxTimeEditZoneInfo): Boolean; +const + ATimeZoneKindMap: array[TcxDateTimeFormatItemKind] of TcxTimeEditZoneKind = + (tzHour, tzHour, tzHour, tzHour, tzHour, tzMin, tzSec, tzHour, tzTimeSuffix, + tzHour, tzHour); +var + AItemInfo: TcxDateTimeFormatItemInfo; +begin + Result := False; + if (Kind <> ckDateTime) or (InputKind <> ikMask) or + cxFormatController.AssignedStandardDateTimeEditMask then + Exit; + Result := cxFormatController.GetDateTimeFormatItemStandardMaskInfo( + cxFormatController.DateTimeFormatInfo, APos, AItemInfo); + Result := Result and (AItemInfo.Kind in [dtikHour, dtikMin, dtikSec, dtikTimeSuffix]); + if Result then + begin + AInfo.Kind := ATimeZoneKindMap[AItemInfo.Kind]; + AInfo.Start := AItemInfo.ItemZoneStart; + AInfo.Length := AItemInfo.ItemZoneLength; + AInfo.TimeSuffixKind := AItemInfo.TimeSuffixKind; + AInfo.Use24HourFormat := not cxFormatController.DateTimeFormatInfo.DefinedItems[dtikTimeSuffix]; + end; +end; + +procedure TcxCustomDateEditProperties.InternalPrepareEditValue( + ADisplayValue: string; out EditValue: TcxEditValue); +var + ADate: TDateTime; +begin + EditValue := Null; + if not InternalCompareString(ADisplayValue, GetEmptyString, True) and + not InternalCompareString(ADisplayValue, GetEmptyDisplayValue(True), True) then + begin +// TODO +// if (TimeFormat = tfHour) and Use24HourFormat then +// ADisplayValue := ADisplayValue + ':00'; + cxStrToDateTime(ADisplayValue, not cxFormatController.UseDelphiDateTimeFormats, + ADate); + if ADate <> NullDate then + EditValue := ADate + else + if DateOnError = deToday then + if Kind = ckDate then + EditValue := SysUtils.Date + else + EditValue := SysUtils.Now; + end; +end; + +class function TcxCustomDateEditProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxDateEdit; +end; + +function TcxCustomDateEditProperties.GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; +begin + Result := GetValueEditorEditValueSource(AEditFocused); +end; + +function TcxCustomDateEditProperties.IsDisplayValueValid(var DisplayValue: TcxEditValue; + AEditFocused: Boolean): Boolean; +var + ADate: TDateTime; +begin + // TODO optional symbols + if InputKind = ikStandard then + begin + cxStrToDateTime(VarToStr(DisplayValue), + not cxFormatController.UseDelphiDateTimeFormats, ADate); + Result := ADate <> NullDate; + end + else + Result := inherited IsDisplayValueValid(DisplayValue, AEditFocused); +end; + +function TcxCustomDateEditProperties.IsEditValueValid( + var EditValue: TcxEditValue; AEditFocused: Boolean): Boolean; +var + AValue: TcxEditValue; +begin + if VarIsStr(EditValue) then + begin + try + InternalPrepareEditValue(EditValue, AValue); + Result := not VarIsNull(AValue) and not VarIsNullDate(AValue); + except + Result := False; + end + end + else + Result := VarIsSoftNull(EditValue) or VarIsDate(EditValue) or + VarIsNumericEx(EditValue); +end; + +procedure TcxCustomDateEditProperties.PrepareDisplayValue( + const AEditValue: TcxEditValue; var DisplayValue: TcxEditValue; + AEditFocused: Boolean); + + function GetDisplayValue: string; + var + AValue: TcxEditValue; + begin + if VarIsSoftNull(AEditValue) or VarIsNullDate(AEditValue) then + Result := GetEmptyDisplayValue(AEditFocused) + else + if not(VarIsStr(AEditValue) or VarIsDate(AEditValue) or VarIsNumericEx(AEditValue)) then + raise EConvertError.CreateFmt(cxGetResourceString(@cxSEditDateConvertError), []) + else + begin + if VarIsStr(AEditValue) then + begin + InternalPrepareEditValue(AEditValue, AValue); + if VarIsNull(AValue) or VarIsNullDate(AValue) then + raise EConvertError.CreateFmt(cxGetResourceString(@cxSEditDateConvertError), []) + end + else + AValue := AEditValue; + if not NeedShowTime(AValue, AEditFocused) then + AValue := DateOf(AValue); + if AEditFocused then + Result := DateTimeToTextEx(AValue, InputKind = ikMask, Kind = ckDateTime) + else + Result := DateTimeToTextEx(AValue, False); + Result := TrimRight(Result); + end; + end; + +begin + DisplayValue := GetDisplayValue; + if AEditFocused and IsMasked then + inherited PrepareDisplayValue(DisplayValue, DisplayValue, AEditFocused); +end; + +procedure TcxCustomDateEditProperties.ValidateDisplayValue( + var ADisplayValue: TcxEditValue; var AErrorText: TCaption; + var AError: Boolean; AEdit: TcxCustomEdit); + + function DateToDisplayValue(var ADate: TDateTime): TcxEditValue; + begin + Result := DateTimeToTextEx(ADate, InputKind = ikMask, Kind = ckDateTime); + Result := TrimRight(Result); + end; + + procedure ConvertToDate(const ADisplayValue: TcxEditValue; + out ADate: TDateTime; out AError: Boolean); + begin + AError := not TextToDateEx(ADisplayValue, ADate); + end; + + procedure CorrectError(var ADate: TDateTime; var AError: Boolean); + begin + if DateOnError = deNoChange then + Exit; + case DateOnError of + deToday: + if Kind = ckDate then + ADate := SysUtils.Date + else + ADate := SysUtils.Now; + deNull: + ADate := NullDate; + end; + AError := False; + end; + + function GetDate(var ADisplayValue: TcxEditValue; out AError: Boolean; + out AErrorText: TCaption): TDateTime; + // AError + // NullDate - from CorrectError + // ADisplayValue = GetEmptyString + // Result + var + AIsUserErrorDisplayValue: Boolean; + begin + AError := False; + AErrorText := cxGetResourceString(@cxSDateError); + AIsUserErrorDisplayValue := False; + try + try + if ADisplayValue <> GetEmptyDisplayValue(True) then + ConvertToDate(ADisplayValue, Result, AError); + if TcxCustomDateEdit(AEdit).IsOnValidateEventAssigned then + begin + if (ADisplayValue <> GetEmptyDisplayValue(True)) and not AError then + ADisplayValue := DateToDisplayValue(Result(*, False*)); + DoValidate(ADisplayValue, AErrorText, AError, AEdit, + AIsUserErrorDisplayValue); + if not AError and (ADisplayValue <> GetEmptyDisplayValue(True)) then + ConvertToDate(ADisplayValue, Result, AError); + end + else + if AError then + CorrectError(Result, AError); + except + AError := True; + end; + finally + if AError and not AIsUserErrorDisplayValue then + ADisplayValue := TcxCustomDateEdit(AEdit).DisplayValue; + end; + end; + + procedure ValidateEmptyDisplayValue(AIsNullDate: Boolean); + + function SaveSavedTime: Boolean; + begin + Result := not AIsNullDate and (Kind = ckDate) and + (TcxCustomDateEdit(AEdit).FSavedTime <> 0) and SaveTime; + end; + + var + ADateEdit: TcxCustomDateEdit; + AEditValueChanged: Boolean; + begin + ADateEdit := TcxCustomDateEdit(AEdit); + if SaveSavedTime then + begin + AEditValueChanged := not InternalVarEqualsExact( + ADateEdit.FEditValue, ADateEdit.FSavedTime); + ADateEdit.FEditValue := ADateEdit.FSavedTime; + ADisplayValue := DateToDisplayValue(ADateEdit.FSavedTime); + end + else + begin + AEditValueChanged := not VarIsNull(ADateEdit.FEditValue); + ADateEdit.FEditValue := Null; + ADateEdit.FSavedTime := 0; + ADisplayValue := GetEmptyDisplayValue(True); + end; + if AEditValueChanged then + ADateEdit.DoEditValueChanged; + end; + + procedure CheckDate(ADate: TDateTime; var AErrorText: TCaption; + var AError: Boolean); + var + ATempValue: TcxEditValue; + begin + if IsValueBoundsDefined then + begin + ATempValue := ADate; + CheckEditorValueBounds(ATempValue, AErrorText, AError, AEdit); + end; + end; + +var + ADate: TDateTime; + ADateEdit: TcxCustomDateEdit; +begin +// TODO +// if (TimeFormat = tfHour) and Use24HourFormat then +// ADisplayValue := ADisplayValue + ':00'; + ADate := GetDate(ADisplayValue, AError, AErrorText); + if AError then + Exit; + + ADateEdit := TcxCustomDateEdit(AEdit); + try + try + if (ADate = NullDate) or (ADisplayValue = GetEmptyDisplayValue(True)) then + ValidateEmptyDisplayValue(ADate = NullDate) + else + begin + CheckDate(ADate, AErrorText, AError); + if AError then + Exit; + // support for time in the SmartInput + + if Kind = ckDate then + if TimeOf(ADate) <> 0 then + ADateEdit.FSavedTime := TimeOf(ADate) + else + if SaveTime then + begin + if ADate >= 0 then + ADate := ADate + ADateEdit.FSavedTime + else + ADate := ADate - ADateEdit.FSavedTime; + end + else + ADateEdit.FSavedTime := 0; + ADisplayValue := DateToDisplayValue(ADate); + end; + except + AError := True; + end; + finally + if AError then + ADisplayValue := TcxCustomDateEdit(AEdit).DisplayValue; + end; +end; + +{ TcxDateEditPopupWindow } + +constructor TcxDateEditPopupWindow.Create(AOwnerControl: TWinControl); +begin + inherited Create(AOwnerControl); + KeyPreview := True; +end; + +procedure TcxDateEditPopupWindow.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited KeyDown(Key, Shift); + if IsPopupCalendarKey(Key, Shift) then + TcxCustomDateEdit(Edit).Calendar.KeyDown(Key, Shift); +end; + +function TcxDateEditPopupWindow.IsPopupCalendarKey(Key: Word; + Shift: TShiftState): Boolean; + + function CanEscape: Boolean; + var + AContainer: TcxContainer; + begin + Result := ActiveControl is TcxButton; + if not Result then + begin + AContainer := GetcxContainer(ActiveControl); + Result := (AContainer is TcxTimeEdit) and not TcxTimeEdit(AContainer).ModifiedAfterEnter; + end; + end; + +begin + Result := (Key = VK_ESCAPE) and CanEscape or + ((Key = VK_UP) or (Key = VK_DOWN)) and (ssAlt in Shift) or + (Key = VK_F4) and not (ssAlt in Shift); +end; + +{ TcxDateEditMaskStandardMode } + +function TcxDateEditMaskStandardMode.GetBlank(APos: Integer): Char; +begin + Result := TcxCustomDateEditProperties(Properties).GetStandardMaskBlank(APos); +end; + +{ TcxCustomDateEdit } + +destructor TcxCustomDateEdit.Destroy; +begin + FreeAndNil(FCalendar); + inherited Destroy; +end; + +procedure TcxCustomDateEdit.Clear; +begin + Date := NullDate; +end; + +procedure TcxCustomDateEdit.DateChange(Sender: TObject); +var + ADate: Double; + ADisplayValue: TcxEditValue; +begin + ADate := Calendar.SelectDate; + if ActiveProperties.Kind = ckDateTime then + ADate := DateOf(ADate) + cxSign(ADate) * TimeOf(TDateTime(Calendar.FTimeEdit.Time)) + else + if ActiveProperties.SaveTime and (ADate <> NullDate) then + if ADate >= 0 then + ADate := ADate + TimeOf(FDateDropDown) + else + ADate := ADate - TimeOf(FDateDropDown); + ADisplayValue := GetRecognizableDisplayValue(ADate); + if ((Date <> ADate) or not InternalCompareString(DisplayValue, VarToStr(ADisplayValue), True)) and + DoEditing then + begin + LockChangeEvents(True); + try + Date := ADate; + ModifiedAfterEnter := True; + SetInternalDisplayValue(ADisplayValue); + SelectAll; + finally + LockChangeEvents(False); + end; + end; +end; + +function TcxCustomDateEdit.GetActiveProperties: TcxCustomDateEditProperties; +begin + Result := TcxCustomDateEditProperties(InternalGetActiveProperties); +end; + +function TcxCustomDateEdit.GetCurrentDate: TDateTime; +begin + if Focused and not IsEditValidated and ModifiedAfterEnter then + Result := GetDateFromStr(DisplayValue) + else + Result := Date; +end; + +function TcxCustomDateEdit.GetProperties: TcxCustomDateEditProperties; +begin + Result := TcxCustomDateEditProperties(FProperties); +end; + +function TcxCustomDateEdit.GetRecognizableDisplayValue( + ADate: TDateTime): TcxEditValue; + + function NeedDisplayValueCorrection(ADate: TDateTime): Boolean; + var + ADisplayValue, AEditValue: TcxEditValue; + begin + Result := False; + if (ActiveProperties.InputKind = ikStandard) and (ADate <> NullDate) then + begin + PrepareDisplayValue(ADate, ADisplayValue, True); + PrepareEditValue(ADisplayValue, AEditValue, True); + Result := DateOf(ADate) <> DateOf(AEditValue); + end; + end; + +begin + if NeedDisplayValueCorrection(ADate) then + begin + if not ActiveProperties.NeedShowTime(ADate, True) then + ADate := DateOf(ADate); + Result := DateTimeToTextEx(ADate, False, ActiveProperties.Kind = ckDateTime, True); + Result := TrimRight(Result); + end + else + PrepareDisplayValue(ADate, Result, True); +end; + +procedure TcxCustomDateEdit.SetProperties(Value: TcxCustomDateEditProperties); +begin + FProperties.Assign(Value); +end; + +function TcxCustomDateEdit.CanSynchronizeModeText: Boolean; +begin + Result := Focused or IsEditValidating; +end; + +procedure TcxCustomDateEdit.CheckEditorValueBounds; +begin + if Date = NullDate then + Exit; + KeyboardAction := ModifiedAfterEnter; + try + if ActiveProperties.IsValueBoundDefined(evbMin) and + (Date < ActiveProperties.MinValue) then + Date := ActiveProperties.MinValue + else + if ActiveProperties.IsValueBoundDefined(evbMax) and + (Date > ActiveProperties.MaxValue) then + Date := ActiveProperties.MaxValue; + finally + KeyboardAction := False; + end; +end; + +procedure TcxCustomDateEdit.CreatePopupWindow; +begin + inherited; + PopupWindow.ModalMode := False; +end; + +(*procedure TcxCustomDateEdit.DoEditKeyDown(var Key: Word; Shift: TShiftState); + + function IsArrowIncrementPosition: Boolean; + begin + Result := False; + if (ActiveProperties.Kind <> ckDateTime) or (ActiveProperties.InputKind <> ikMask) then + Exit; + Result := SelStart + SelLength >= 11; + end; + + procedure Increment(AButton: TcxSpinEditButton); + var + ATimeZone: TcxTimeEditZone; + begin + ATimeZone := GetTimeZone; + end; + +var + AButton: TcxSpinEditButton; +begin + if ((Key = VK_UP) or (Key = VK_DOWN) or (Key = VK_NEXT) or (Key = VK_PRIOR)){ and + not (ActiveProperties.UseCtrlIncrement and not (ssCtrl in Shift))} and + IsArrowIncrementPosition then + begin + if not DataBinding.Modified and not DoEditing then + Exit; + case Key of + VK_UP: + AButton := sebForward; + VK_DOWN: + AButton := sebBackward; + VK_PRIOR: + AButton := sebFastForward; + else + AButton := sebFastBackward; + end; + Increment(AButton); + DoAfterKeyDown(Key, Shift); + Key := 0; + end; + if Key <> 0 then + inherited DoEditKeyDown(Key, Shift); +end;*) + +procedure TcxCustomDateEdit.DropDown; +begin + if Calendar = nil then + CreateCalendar; + ActiveProperties.PopupControl := Calendar; + inherited DropDown; +end; + +procedure TcxCustomDateEdit.Initialize; +begin + inherited Initialize; + ControlStyle := ControlStyle - [csSetCaption]; + FDateDropDown := NullDate; +end; + +procedure TcxCustomDateEdit.InitializePopupWindow; +var + ADate: TDateTime; + ATimeFormat: TcxTimeEditTimeFormat; + AUse24HourFormat: Boolean; +begin + inherited InitializePopupWindow; + with Calendar do + begin + HandleNeeded; + Color := Self.ActiveStyle.Color; + Flat := Self.PopupControlsLookAndFeel.Kind in [lfFlat, + lfUltraFlat, lfOffice11]; + CalendarButtons := ActiveProperties.DateButtons; + OnDateTimeChanged := nil; + FDateDropDown := Self.CurrentDate; + if FDateDropDown = NullDate then + ADate := SysUtils.Date + else + ADate := FDateDropDown; + if ActiveProperties.Kind = ckDateTime then + FTimeEdit.Time := TTime(TimeOf(ADate)); + ADate := DateOf(ADate); + FirstDate := ADate; + SelectDate := ADate; + Font.Assign(Self.ActiveStyle.GetVisibleFont); + Font.Color := clBtnText; + SetSize; // force recalculate size + OnDateTimeChanged := DateChange; + ArrowsForYear := ActiveProperties.ArrowsForYear; + Kind := ActiveProperties.Kind; + + cxCalendar.GetTimeFormat(cxFormatController.DateTimeFormatInfo, ATimeFormat, + AUse24HourFormat); + TimeFormat := ATimeFormat; + Use24HourFormat := AUse24HourFormat; + + WeekNumbers := ActiveProperties.WeekNumbers; + YearsInMonthList := ActiveProperties.YearsInMonthList; + end; +end; + +function TcxCustomDateEdit.InternalGetEditingValue: TcxEditValue; +begin + PrepareEditValue(Text, Result, True); +end; + +function TcxCustomDateEdit.InternalGetText: string; +begin + Result := DisplayValue; +end; + +procedure TcxCustomDateEdit.InternalSetEditValue(const Value: TcxEditValue; + AValidateEditValue: Boolean); + + procedure SaveTime; + var + ADate: TDateTime; + begin + if not ActiveProperties.SaveTime or not(VarIsStr(Value) or VarIsNumericEx(Value) or VarIsDate(Value)) then + FSavedTime := 0 + else + if VarIsStr(Value) then + begin + cxStrToDateTime(Value, not cxFormatController.UseDelphiDateTimeFormats, ADate); + if ADate = NullDate then + FSavedTime := 0 + else + FSavedTime := TimeOf(ADate); + end + else + FSavedTime := TimeOf(Value); + end; + +begin + if IsDestroying then + Exit; + if ActiveProperties.Kind = ckDate then + SaveTime; + inherited InternalSetEditValue(Value, AValidateEditValue); +end; + +function TcxCustomDateEdit.InternalSetText(const Value: string): Boolean; +begin + Result := SetDisplayText(Value); +end; + +procedure TcxCustomDateEdit.InternalValidateDisplayValue( + const ADisplayValue: TcxEditValue); +begin + if VarIsStr(ADisplayValue) then + inherited InternalValidateDisplayValue(ADisplayValue) + else + begin + SaveModified; + try + InternalEditValue := ADisplayValue; + finally + RestoreModified; + end; + end; +end; + +function TcxCustomDateEdit.IsCharValidForPos(var AChar: Char; + APos: Integer): Boolean; +var + ATimeZoneInfo: TcxTimeEditZoneInfo; +begin + if not ActiveProperties.GetTimeZoneInfo(APos, ATimeZoneInfo) then + Result := True + else + Result := IsCharValidForTimeEdit(Self, AChar, APos, ATimeZoneInfo); +end; + +procedure TcxCustomDateEdit.PopupWindowClosed(Sender: TObject); +begin + inherited PopupWindowClosed(Sender); + if Calendar <> nil then + Calendar.CheckHotTrack; +end; + +procedure TcxCustomDateEdit.PopupWindowShowed(Sender: TObject); +begin + inherited PopupWindowShowed(Sender); + Calendar.Calculate; + Calendar.CheckHotTrack; +end; + +procedure TcxCustomDateEdit.UpdateTextFormatting; +begin +end; + +procedure TcxCustomDateEdit.CreateCalendar; +begin + FCalendar := GetCalendarClass.Create(Self); + FCalendar.FEdit := Self; + FCalendar.Parent := PopupWindow; + FCalendar.OnHidePopup := HidePopup; + FCalendar.FClearButton.LookAndFeel.MasterLookAndFeel := PopupControlsLookAndFeel; + FCalendar.FOKButton.LookAndFeel.MasterLookAndFeel := PopupControlsLookAndFeel; + FCalendar.FNowButton.LookAndFeel.MasterLookAndFeel := PopupControlsLookAndFeel; + FCalendar.FTodayButton.LookAndFeel.MasterLookAndFeel := PopupControlsLookAndFeel; + FCalendar.FTimeEdit.Style.LookAndFeel.MasterLookAndFeel := PopupControlsLookAndFeel; +end; + +function TcxCustomDateEdit.GetCalendarClass: TcxPopupCalendarClass; +begin + Result := TcxPopupCalendar; +end; + +function TcxCustomDateEdit.GetDate: TDateTime; +begin + if VarIsNull(EditValue) then + Result := NullDate + else if VarIsNumericEx(EditValue) or VarIsDate(EditValue) then + Result := EditValue + else if VarIsStr(EditValue) then + Result := GetDateFromStr(EditValue) + else + Result := NullDate; +end; + +function TcxCustomDateEdit.GetDateFromStr(const S: string): TDateTime; +var + AValue: TcxEditValue; +begin + PrepareEditValue(S, AValue, Focused); + if VarIsNull(AValue) then + Result := NullDate + else + Result := AValue; +end; + +procedure TcxCustomDateEdit.SetDate(Value: TDateTime); +begin + if Value = NullDate then + InternalEditValue := Null + else + begin + if ActiveProperties.Kind = ckDate then + if TimeOf(Value) = 0 then + if ActiveProperties.SaveTime then + Value := Int(Value) + cxSign(Value) * FSavedTime + else + Value := Int(Value); + InternalEditValue := Value; + end; +end; + +procedure TcxCustomDateEdit.SetupPopupWindow; +begin + inherited SetupPopupWindow; + with Calendar, ViewInfo do + begin + FClearButton.LookAndFeel.SkinPainter := Painter; + FOKButton.LookAndFeel.SkinPainter := Painter; + FNowButton.LookAndFeel.SkinPainter := Painter; + FTodayButton.LookAndFeel.SkinPainter := Painter; + FTimeEdit.Style.LookAndFeel.SkinPainter := Painter; + end; +end; + +class function TcxCustomDateEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomDateEditProperties; +end; + +procedure TcxCustomDateEdit.PrepareEditValue( + const ADisplayValue: TcxEditValue; out EditValue: TcxEditValue; + AEditFocused: Boolean); +begin + try + ActiveProperties.InternalPrepareEditValue(ADisplayValue, EditValue); + finally + if not VarIsNull(EditValue) then + begin + if not VarIsNullDate(EditValue) and + (ActiveProperties.Kind = ckDate) and ActiveProperties.SaveTime then + EditValue := Int(EditValue) + cxSign(EditValue) * FSavedTime; + if not cxFormatController.UseDelphiDateTimeFormats then + try + EditValue := VarAsType(EditValue, varDate); + except + on EVariantError do + ; + end; + end; + end; +end; + +{ TcxDateEdit } + +class function TcxDateEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxDateEditProperties; +end; + +function TcxDateEdit.GetActiveProperties: TcxDateEditProperties; +begin + Result := TcxDateEditProperties(InternalGetActiveProperties); +end; + +function TcxDateEdit.GetProperties: TcxDateEditProperties; +begin + Result := TcxDateEditProperties(FProperties); +end; + +procedure TcxDateEdit.SetProperties(Value: TcxDateEditProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxFilterDateEditHelper } + +class function TcxFilterDateEditHelper.GetFilterEditClass: TcxCustomEditClass; +begin + Result := TcxDateEdit; +end; + +class function TcxFilterDateEditHelper.GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; +begin + Result := [fcoEqual, fcoNotEqual, fcoLess, fcoLessEqual, fcoGreater, + fcoGreaterEqual, fcoBlanks, fcoNonBlanks]; + if AExtendedSet then + Result := Result + [fcoBetween, fcoNotBetween, fcoInList, fcoNotInList, + fcoYesterday, fcoToday, fcoTomorrow, + fcoLast7Days, fcoLastWeek, fcoLast14Days, fcoLastTwoWeeks, fcoLast30Days, fcoLastMonth, fcoLastYear, fcoInPast, + fcoThisWeek, fcoThisMonth, fcoThisYear, + fcoNext7Days, fcoNextWeek, fcoNext14Days, fcoNextTwoWeeks, fcoNext30Days, fcoNextMonth, fcoNextYear, fcoInFuture]; +end; + +class procedure TcxFilterDateEditHelper.InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); +begin + inherited InitializeProperties(AProperties, AEditProperties, AHasButtons); + with TcxCustomDateEditProperties(AProperties) do + begin + DateButtons := [btnToday, btnClear]; + DateOnError := deNull; + InputKind := ikRegExpr; + SaveTime := True; + end; +end; + +initialization + GetRegisteredEditProperties.Register(TcxDateEditProperties, scxSEditRepositoryDateItem); + FilterEditsController.Register(TcxDateEditProperties, TcxFilterDateEditHelper); + +finalization + FilterEditsController.Unregister(TcxDateEditProperties, TcxFilterDateEditHelper); + +end. + diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxCheckBox.pas b/official/x.35/ExpressEditors Library 5/Sources/cxCheckBox.pas new file mode 100644 index 00000000..50237b38 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxCheckBox.pas @@ -0,0 +1,2516 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxCheckBox; + +{$I cxVer.inc} + +interface + +uses + Messages, Windows, +{$IFDEF DELPHI6} + Types, Variants, +{$ENDIF} + Classes, Controls, Forms, Graphics, SysUtils, cxClasses, cxContainer, cxControls, + cxCustomData, cxDataStorage, cxEdit, cxGraphics, cxLookAndFeels, cxTextEdit, + cxDropDownEdit, cxVariants, cxFilterControlUtils, cxLookAndFeelPainters; + +const + cxEditCheckBoxSingleBorderDefaultColor = clBtnShadow; + +type + TcxCheckBoxNullValueShowingStyle = (nssUnchecked, nssInactive, nssGrayedChecked); + TcxCheckStatesValueFormat = (cvfCaptions, cvfIndices, cvfInteger, + cvfStatesString); + TcxCheckStates = array of TcxCheckBoxState; + TcxEditCheckBoxBorderStyle = TcxEditBorderStyle; + TcxEditCheckState = (ecsNormal, ecsHot, ecsPressed, ecsDisabled); + + TcxCheckStatesToValueEvent = procedure(Sender: TObject; + const ACheckStates: TcxCheckStates; out AValue: TcxEditValue) of object; + TcxValueToCheckStatesEvent = procedure(Sender: TObject; + const AValue: TcxEditValue; var ACheckStates: TcxCheckStates) of object; + + { IcxCheckItems } + + IcxCheckItems = interface + ['{5BF13228-CF05-4741-9833-F2B8FBFD57ED}'] + function GetCaption(Index: Integer): string; + function GetCount: Integer; + property Captions[Index: Integer]: string read GetCaption; + property Count: Integer read GetCount; + end; + + { TcxCustomCheckBoxViewInfo } + + TcxCustomCheckBox = class; + + TcxCustomCheckBoxViewInfo = class(TcxCustomTextEditViewInfo) + private + function GetEdit: TcxCustomCheckBox; + protected + function IsTextEnabled: Boolean; + procedure InternalPaint(ACanvas: TcxCanvas); override; + public + Alignment: TAlignment; + CheckBorderOffset: Integer; + CheckBoxBorderStyle: TcxEditCheckBoxBorderStyle; + CheckBoxGlyph: TBitmap; + CheckBoxGlyphCount: Integer; + CheckBoxRect: TRect; + CheckBoxState: TcxEditCheckState; + DrawCaptionFlags: Integer; + FocusRect: TRect; + HasGlyph: Boolean; + IsTextColorAssigned: Boolean; + NullValueShowingStyle: TcxCheckBoxNullValueShowingStyle; + State: TcxCheckBoxState; + procedure Assign(Source: TObject); override; + procedure DrawText(ACanvas: TcxCanvas); override; + function GetUpdateRegion(AViewInfo: TcxContainerViewInfo): TcxRegion; override; + function IsHotTrack: Boolean; override; + function IsHotTrack(P: TPoint): Boolean; override; + function NeedShowHint(ACanvas: TcxCanvas; const P: TPoint; out AText: TCaption; + out AIsMultiLine: Boolean; out ATextRect: TRect): Boolean; override; + procedure Offset(DX, DY: Integer); override; + function Repaint(AControl: TWinControl; const AInnerEditRect: TRect; + AViewInfo: TcxContainerViewInfo = nil): Boolean; override; + property Edit: TcxCustomCheckBox read GetEdit; + end; + + { TcxCustomCheckBoxViewData } + + TcxCustomCheckBoxProperties = class; + + TcxCustomCheckBoxViewData = class(TcxCustomEditViewData) + private + function GetProperties: TcxCustomCheckBoxProperties; + protected + function InternalGetEditConstantPartSize(ACanvas: TcxCanvas; AIsInplace: Boolean; + AEditSizeProperties: TcxEditSizeProperties; + var MinContentSize: TSize; AViewInfo: TcxCustomEditViewInfo): TSize; override; + function GetDrawTextFlags: Integer; virtual; + function GetIsEditClass: Boolean; + function IsCheckPressed: Boolean; + public + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); override; + procedure EditValueToDrawValue(ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + AViewInfo: TcxCustomEditViewInfo); override; + function GetBorderStyle: TcxEditBorderStyle; override; + property Properties: TcxCustomCheckBoxProperties read GetProperties; + end; + + { TcxCheckBoxStyle } + + TcxCheckBoxStyle = class(TcxEditStyle) + public + function HasBorder: Boolean; override; + end; + + { TcxCustomCheckBoxProperties } + + TcxCustomCheckBoxProperties = class(TcxCustomEditProperties) + private + FAllowGrayed: Boolean; + FCaption: TCaption; // obsolete + FDisplayChecked: WideString; + FDisplayGrayed: WideString; + FDisplayUnchecked: WideString; + FFullFocusRect: Boolean; + FGlyph: TBitmap; + FGlyphCount: Integer; + FIsCaptionAssigned: Boolean; // obsolete + FMultiLine: Boolean; + FNullStyle: TcxCheckBoxNullValueShowingStyle; + FUseAlignmentWhenInplace: Boolean; + FValueChecked: TcxEditValue; + FValueGrayed: TcxEditValue; + FValueUnchecked: TcxEditValue; + function GetAlignment: TAlignment; + function GetGlyph: TBitmap; + function GetInternalAlignment: TcxEditAlignment; + procedure GlyphChanged(Sender: TObject); + function IsAlignmentStored: Boolean; + function IsDisplayCheckedStored: Boolean; + function IsDisplayGrayedStored: Boolean; + function IsDisplayUncheckedStored: Boolean; + function IsLoading: Boolean; + function IsValueCheckedStored: Boolean; + function IsValueGrayedStored: Boolean; + function IsValueUncheckedStored: Boolean; + procedure ReadCaption(Reader: TReader); // obsolete + procedure SetAlignment(Value: TAlignment); + procedure SetCaption(const Value: TCaption); // obsolete + procedure SetFullFocusRect(Value: Boolean); + procedure SetGlyph(Value: TBitmap); + procedure SetGlyphCount(Value: Integer); + procedure SetMultiLine(Value: Boolean); + procedure SetNullStyle(Value: TcxCheckBoxNullValueShowingStyle); + procedure SetStateValues(const AValueChecked, AValueGrayed, AValueUnchecked: TcxEditValue); + procedure SetUseAlignmentWhenInplace(Value: Boolean); + procedure SetValueChecked(const Value: TcxEditValue); + procedure SetValueGrayed(const Value: TcxEditValue); + procedure SetValueUnchecked(const Value: TcxEditValue); + protected + function CanValidate: Boolean; override; + procedure DefineProperties(Filer: TFiler); override; + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + function HasDisplayValue: Boolean; override; + function CheckValue(const AValue: TcxEditValue): Boolean; + function GetState(const AEditValue: TcxEditValue): TcxCheckBoxState; + function InternalGetGlyph: TBitmap; virtual; + function IsEmbeddedEdit: Boolean; virtual; + property InternalAlignment: TcxEditAlignment read GetInternalAlignment; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function CanCompareEditValue: Boolean; override; + function CompareDisplayValues( + const AEditValue1, AEditValue2: TcxEditValue): Boolean; override; + class function GetContainerClass: TcxContainerClass; override; + function GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; override; + class function GetStyleClass: TcxCustomEditStyleClass; override; + function GetSpecialFeatures: TcxEditSpecialFeatures; override; + function GetSupportedOperations: TcxEditSupportedOperations; override; + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + function IsActivationKey(AKey: Char): Boolean; override; + function IsEditValueValid(var EditValue: TcxEditValue; AEditFocused: Boolean): Boolean; override; + function IsResetEditClass: Boolean; override; + procedure PrepareDisplayValue(const AEditValue: TcxEditValue; + var DisplayValue: TcxEditValue; AEditFocused: Boolean); override; + // !!! + property Alignment: TAlignment read GetAlignment write SetAlignment + stored IsAlignmentStored; +// property AlignmentVert: TcxAlignmentVert read GetAlignmentVert +// write SetAlignmentVert stored IsAlignmentVertStored; + property AllowGrayed: Boolean read FAllowGrayed write FAllowGrayed default False; + property Caption: TCaption read FCaption write SetCaption stored False; // obsolete + property DisplayChecked: WideString read FDisplayChecked write FDisplayChecked + stored IsDisplayCheckedStored; + property DisplayGrayed: WideString read FDisplayGrayed write FDisplayGrayed + stored IsDisplayGrayedStored; + property DisplayUnchecked: WideString read FDisplayUnchecked write FDisplayUnchecked + stored IsDisplayUncheckedStored; + property FullFocusRect: Boolean read FFullFocusRect write SetFullFocusRect default False; + property Glyph: TBitmap read GetGlyph write SetGlyph; + property GlyphCount: Integer read FGlyphCount write SetGlyphCount default 6; + property MultiLine: Boolean read FMultiLine write SetMultiLine default False; + property NullStyle: TcxCheckBoxNullValueShowingStyle read FNullStyle write + SetNullStyle default nssGrayedChecked; + property UseAlignmentWhenInplace: Boolean read FUseAlignmentWhenInplace + write SetUseAlignmentWhenInplace default False; + property ValueChecked: TcxEditValue read FValueChecked write SetValueChecked + stored IsValueCheckedStored; + property ValueGrayed: TcxEditValue read FValueGrayed write SetValueGrayed + stored IsValueGrayedStored; + property ValueUnchecked: TcxEditValue read FValueUnchecked write SetValueUnchecked + stored IsValueUncheckedStored; + end; + + { TcxCheckBoxProperties } + + TcxCheckBoxProperties = class(TcxCustomCheckBoxProperties) + published + property Alignment; + property AllowGrayed; + property AssignedValues; + property Caption; // obsolete + property ClearKey; + property DisplayChecked; + property DisplayUnchecked; + property DisplayGrayed; + property FullFocusRect; + property Glyph; + property GlyphCount; + property ImmediatePost; + property MultiLine; + property NullStyle; + property ReadOnly; + property UseAlignmentWhenInplace; + property ValueChecked; + property ValueGrayed; + property ValueUnchecked; + property OnChange; + property OnEditValueChanged; + property OnValidate; + end; + + { TcxCustomCheckBox } + + TcxCustomCheckBox = class(TcxCustomEdit) + private + FIsCheckPressed: Boolean; + FIsLoaded: Boolean; + FIsLoadingStateAssigned: Boolean; + FLoadingState: TcxCheckBoxState; + function GetChecked: Boolean; + function GetProperties: TcxCustomCheckBoxProperties; + function GetActiveProperties: TcxCustomCheckBoxProperties; + function GetState: TcxCheckBoxState; + function GetStyle: TcxCheckBoxStyle; + function GetViewInfo: TcxCustomCheckBoxViewInfo; + function IsStateStored: Boolean; + procedure SetChecked(Value: Boolean); + procedure SetProperties(Value: TcxCustomCheckBoxProperties); + procedure SetState(Value: TcxCheckBoxState); + procedure SetStyle(Value: TcxCheckBoxStyle); + procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + procedure CMParentColorChanged(var Message: TMessage); message CM_PARENTCOLORCHANGED; + protected + procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override; + function CanHaveTransparentBorder: Boolean; override; + function DefaultParentColor: Boolean; override; + procedure DoEditKeyDown(var Key: Word; Shift: TShiftState); override; + procedure DoEditKeyPress(var Key: Char); override; + procedure DoEditKeyUp(var Key: Word; Shift: TShiftState); override; + procedure DoExit; override; + procedure FillSizeProperties(var AEditSizeProperties: TcxEditSizeProperties); override; + function GetActionLinkClass: TControlActionLinkClass; override; + function GetShadowBounds: TRect; override; + procedure Initialize; override; + function InternalGetNotPublishedStyleValues: TcxEditStyleValues; override; + procedure InternalSetEditValue(const Value: TcxEditValue; + AValidateEditValue: Boolean); override; + function IsClickEnabledDuringLoading: Boolean; override; + function IsNativeBackground: Boolean; override; + procedure Loaded; override; + procedure ProcessViewInfoChanges(APrevViewInfo: TcxCustomEditViewInfo; + AIsMouseDownUpEvent: Boolean); override; + procedure PropertiesChanged(Sender: TObject); override; + procedure TextChanged; override; + procedure InvalidateCheckRect; + procedure Toggle; virtual; + property Caption; + property Checked: Boolean read GetChecked write SetChecked stored False; + property ViewInfo: TcxCustomCheckBoxViewInfo read GetViewInfo; + public + procedure Clear; override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + procedure PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); override; + property ActiveProperties: TcxCustomCheckBoxProperties read GetActiveProperties; + property Properties: TcxCustomCheckBoxProperties read GetProperties + write SetProperties; + property State: TcxCheckBoxState read GetState write SetState + stored IsStateStored default cbsUnchecked; + property Style: TcxCheckBoxStyle read GetStyle write SetStyle; + property Transparent; + end; + + { TcxCheckBox } + + TcxCheckBox = class(TcxCustomCheckBox) + private + function GetActiveProperties: TcxCheckBoxProperties; + function GetProperties: TcxCheckBoxProperties; + procedure SetProperties(Value: TcxCheckBoxProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxCheckBoxProperties read GetActiveProperties; + published + property Action; + property Align; + property Anchors; + property AutoSize; + property Caption; + property Checked; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ParentBackground; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxCheckBoxProperties read GetProperties + write SetProperties; + property ShowHint; + property State; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Transparent; + property Visible; + property OnClick; + property OnContextPopup; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + + { TcxFilterCheckBoxHelper } + + TcxFilterCheckBoxHelper = class(TcxFilterComboBoxHelper) + public + class procedure GetFilterValue(AEdit: TcxCustomEdit; + AEditProperties: TcxCustomEditProperties; var V: Variant; var S: TCaption); override; + class function GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; override; + class procedure InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); override; + class procedure SetFilterValue(AEdit: TcxCustomEdit; AEditProperties: TcxCustomEditProperties; + AValue: Variant); override; + class function UseDisplayValue: Boolean; override; + end; + + { TcxCheckBoxActionLink } + + TcxCheckBoxActionLink = class(TWinControlActionLink) + protected + FClient: TcxCustomCheckBox; + procedure AssignClient(AClient: TObject); override; + function IsCheckedLinked: Boolean; override; + procedure SetChecked(Value: Boolean); override; + procedure InternalSetChecked(Value: Boolean); + end; + +var + CheckStates: TcxCheckStates = nil; + +function CalculateCheckStatesValue(const ACheckStates: TcxCheckStates; + AItems: IcxCheckItems; AValueFormat: TcxCheckStatesValueFormat): TcxEditValue; +function CalculateCheckStates(const AValue: TcxEditValue; + AItems: IcxCheckItems; AValueFormat: TcxCheckStatesValueFormat; + var ACheckStates: TcxCheckStates): Boolean; +procedure DrawEditCheck(ACanvas: TcxCanvas; const ACheckRect: TRect; + AState: TcxCheckBoxState; ACheckState: TcxEditCheckState; AGlyph: TBitmap; + AGlyphCount: Integer; ABorderStyle: TcxEditCheckBoxBorderStyle; + ANativeStyle: Boolean; ABorderColor: TColor; ABackgroundColor: TColor; + ADrawBackground, AIsDesigning, AFocused, ASupportGrayed: Boolean; + APainter: TcxCustomLookAndFeelPainterClass; + AGrayedShowingStyle: TcxCheckBoxNullValueShowingStyle = nssGrayedChecked); +function GetEditCheckBorderOffset(ACheckBorderStyle: TcxContainerBorderStyle; + ANativeStyle, AHasGlyph: Boolean; APainter: TcxCustomLookAndFeelPainterClass): Integer; overload; +function GetEditCheckBorderOffset(ACheckBorderStyle: TcxEditBorderStyle; + ANativeStyle, AHasGlyph: Boolean; APainter: TcxCustomLookAndFeelPainterClass): Integer; overload; +function GetEditCheckBorderOffset(ALookAndFeelKind: TcxLookAndFeelKind; + ANativeStyle, AHasGlyph: Boolean; APainter: TcxCustomLookAndFeelPainterClass): Integer; overload; +function GetEditCheckGlyphIndex(AState: TcxCheckBoxState; + ACheckState: TcxEditCheckState; ASupportGrayed: Boolean; + AGlyphCount: Integer): Integer; +function GetEditCheckSize(ACanvas: TcxCanvas; ANativeStyle: Boolean; + AGlyph: TBitmap; AGlyphCount: Integer; APainter: TcxCustomLookAndFeelPainterClass): TSize; + +procedure DrawCheckBoxText(ACanvas: TcxCanvas; AText: string; AFont: TFont; + ATextColor: TColor; ATextRect: TRect; ADrawTextFlags: Integer; AEnabled: Boolean); + +implementation + +uses + ActnList, dxThemeConsts, dxThemeManager, dxUxTheme, cxEditConsts, + cxEditPaintUtils, cxDrawTextUtils, cxEditUtils; + +var + FCheckMask: TBitmap; + +procedure PrepareCheckMask; + + procedure InternalPrepareCheckMask(AButtonsBitmap: HBITMAP); + var + AMemDC: HDC; + APrevBitmap: HBITMAP; + I, J: Integer; + begin + FCheckMask := TBitmap.Create; + with TcxCustomLookAndFeelPainter do + begin + FCheckMask.Width := CheckButtonSize.cx; + FCheckMask.Height := CheckButtonSize.cy; + end; + + AMemDC := CreateCompatibleDC(0); + APrevBitmap := 0; + try + APrevBitmap := SelectObject(AMemDC, AButtonsBitmap); + with FCheckMask.Canvas do + for I := 0 to FCheckMask.Height - 1 do + for J := 0 to FCheckMask.Width - 1 do + if Windows.GetPixel(AMemDC, J, I) = Windows.GetPixel(AMemDC, J + FCheckMask.Width, I) then + Pixels[J, I] := clWhite + else + Pixels[J, I] := 0; + finally + if APrevBitmap <> 0 then + SelectObject(AMemDC, APrevBitmap); + DeleteDC(AMemDC); + end; + end; + +var + AButtonsBitmap: HBITMAP; +begin + AButtonsBitmap := LoadBitmap(0, PChar(OBM_CHECKBOXES)); + try + InternalPrepareCheckMask(AButtonsBitmap); + finally + DeleteObject(AButtonsBitmap); + end; +end; + +procedure CalculateCheckBoxViewInfo(AViewData: TcxCustomCheckBoxViewData; AViewInfo: + TcxCustomCheckBoxViewInfo; AIsMouseEvent: Boolean); +begin + with AViewInfo do + begin + AViewData.CalculateViewInfo(AViewInfo, AIsMouseEvent); + TextRect := ClientRect; + ExtendRect(TextRect, GetTextEditDrawTextOffset(AViewData)); + end; +end; + +function CalculateCheckStatesValue(const ACheckStates: TcxCheckStates; + AItems: IcxCheckItems; AValueFormat: TcxCheckStatesValueFormat): TcxEditValue; + + function CalculateCaptionsValue: TcxEditValue; + var + ACheckedCaptions, AGrayedCaptions: string; + I: Integer; + begin + ACheckedCaptions := ''; + AGrayedCaptions := ''; + for I := 0 to Length(ACheckStates) - 1 do + begin + if ACheckStates[I] <> cbsUnchecked then + if ACheckStates[I] = cbsGrayed then + AGrayedCaptions := AGrayedCaptions + + IntToStr(Length(AItems.Captions[I])) + ':' + AItems.Captions[I] + else + ACheckedCaptions := ACheckedCaptions + + IntToStr(Length(AItems.Captions[I])) + ':' + AItems.Captions[I]; + end; + Result := AGrayedCaptions; + if Length(ACheckedCaptions) > 0 then + Result := Result + ';' + ACheckedCaptions; + end; + + function CalculateIndicesValue: TcxEditValue; + var + ACheckedCaptions, AGrayedCaptions: string; + I: Integer; + begin + ACheckedCaptions := ''; + AGrayedCaptions := ''; + for I := 0 to Length(ACheckStates) - 1 do + if ACheckStates[I] <> cbsUnchecked then + if ACheckStates[I] = cbsGrayed then + begin + if AGrayedCaptions <> '' then + AGrayedCaptions := AGrayedCaptions + ','; + AGrayedCaptions := AGrayedCaptions + IntToStr(I); + end + else + begin + if ACheckedCaptions <> '' then + ACheckedCaptions := ACheckedCaptions + ','; + ACheckedCaptions := ACheckedCaptions + IntToStr(I); + end; + Result := AGrayedCaptions; + if Length(ACheckedCaptions) > 0 then + Result := Result + ';' + ACheckedCaptions; + end; + + function CalculateStatesIntegerValue: TcxEditValue; + var + V: {$IFDEF DELPHI6}Int64{$ELSE}Integer{$ENDIF}; + I, L: Integer; + begin + V := 0; + L := Length(ACheckStates); + if L > SizeOf({$IFDEF DELPHI6}Int64{$ELSE}Integer{$ENDIF}) * 8 then + L := SizeOf({$IFDEF DELPHI6}Int64{$ELSE}Integer{$ENDIF}) * 8; + for I := L - 1 downto 0 do + begin + V := V shl 1; + V := V + {$IFDEF DELPHI6}Int64{$ELSE}Integer{$ENDIF}(ACheckStates[I] = cbsChecked); + end; + Result := V; + VarCast(Result, Result, {$IFDEF DELPHI6}varInt64{$ELSE}varInteger{$ENDIF}); + end; + + function CalculateStatesStringValue: TcxEditValue; + var + I: Integer; + S: string; + begin + SetLength(S, Length(ACheckStates)); + for I := 0 to High(ACheckStates) do + S[I + 1] := Char(Integer(ACheckStates[I]) + Ord('0')); + Result := S; + end; + +begin + Result := Null; + case AValueFormat of + cvfCaptions: + Result := CalculateCaptionsValue; + cvfIndices: + Result := CalculateIndicesValue; + cvfInteger: + Result := CalculateStatesIntegerValue; + cvfStatesString: + Result := CalculateStatesStringValue; + end; +end; + +function CalculateCheckStates(const AValue: TcxEditValue; + AItems: IcxCheckItems; AValueFormat: TcxCheckStatesValueFormat; + var ACheckStates: TcxCheckStates): Boolean; + + function GetNumber(var ANumber, AIndex: Integer; + const S: string): Boolean; + + function IsDigit(C: Char): Boolean; + begin + Result := (C >= '0') and (C <= '9'); + end; + + const + AMaxLength = MaxInt div 10; + AMaxIntLastDigit = MaxInt mod 10; + var + L: Integer; + D: Integer; + begin + Result := False; + L := Length(S); + if (AIndex > L) or not IsDigit(S[AIndex]) then + Exit; + + ANumber := 0; + repeat + D := StrToInt(S[AIndex]); + if (ANumber > AMaxLength) or + ((ANumber = AMaxLength) and (D > AMaxIntLastDigit)) then + Exit; + ANumber := ANumber * 10 + D; + Inc(AIndex); + until (AIndex > L) or not IsDigit(S[AIndex]); + Result := True; + end; + + function CalculateItemsByCaptionsValue: Boolean; + + function GetCaptions(ACaptions: TStringList): Boolean; + var + S: string; + ACaptionLength, AIndex, AValueLength: Integer; + AChecked: Boolean; + begin + S := VarToStr(AValue); + Result := S = ''; + if Result then + Exit; + + Result := False; + AChecked := False; + AValueLength := Length(S); + AIndex := 1; + repeat + if (S[AIndex] = ';') and not AChecked then + begin + AChecked := True; + Inc(AIndex); + end; + if not GetNumber(ACaptionLength, AIndex, S) then + Exit; + if (AIndex > AValueLength) or (S[AIndex] <> ':') then + Exit; + Inc(AIndex); + if AIndex + ACaptionLength - 1 > AValueLength then + Exit; + ACaptions.AddObject(Copy(S, AIndex, ACaptionLength), + Pointer(AChecked)); + Inc(AIndex, ACaptionLength); + if AIndex > AValueLength then + Break; + until (AIndex > AValueLength); + Result := True; + end; + + function CalculateStates(ACaptions: TStringList): Boolean; + var + AIndex, I: Integer; + begin + for I := 0 to AItems.Count - 1 do + begin + AIndex := ACaptions.IndexOf(AItems.Captions[I]); + if AIndex = -1 then + ACheckStates[I] := cbsUnchecked + else + begin + if Boolean(ACaptions.Objects[AIndex]) then + ACheckStates[I] := cbsChecked + else + ACheckStates[I] := cbsGrayed; + ACaptions.Delete(AIndex); + end; + end; + Result := ACaptions.Count = 0; + end; + + var + ACaptions: TStringList; + begin + if not(VarIsNull(AValue) or VarIsStr(AValue)) then + begin + Result := False; + Exit; + end; + ACaptions := TStringList.Create; + try + Result := GetCaptions(ACaptions); + if not Result then + Exit; + ACaptions.Sort; + Result := CalculateStates(ACaptions); + finally + FreeAndNil(ACaptions); + end; + end; + + procedure SetStatesToUnchecked; + var + I: Integer; + begin + for I := 0 to AItems.Count - 1 do + ACheckStates[I] := cbsUnchecked; + end; + + function CalculateItemsByIndicesValue: Boolean; + var + AChecked: Boolean; + AIndex, AItemIndex, L: Integer; + S: string; + begin + Result := VarIsNull(AValue) or VarIsStr(AValue); + if not Result then + Exit; + + S := VarToStr(AValue); + SetStatesToUnchecked; + if S = '' then + Exit; + + Result := False; + AIndex := 1; + L := Length(S); + AChecked := False; + repeat + if (S[AIndex] = ';') and not AChecked then + begin + AChecked := True; + Inc(AIndex); + end; + if not GetNumber(AItemIndex, AIndex, S) or (AItemIndex >= AItems.Count) then + Exit; + if AChecked then + ACheckStates[AItemIndex] := cbsChecked + else + ACheckStates[AItemIndex] := cbsGrayed; + if AIndex > L then + Break; + if S[AIndex] = ',' then + Inc(AIndex); + until AIndex > L; + Result := True; + end; + + function CalculateItemsByStatesIntegerValue: Boolean; + var + V: {$IFDEF DELPHI6}Int64{$ELSE}Integer{$ENDIF}; + I, ACode: Integer; + begin + Result := VarIsNumericEx(AValue) or VarIsStr(AValue) or VarIsDate(AValue) or + VarIsNull(AValue); + if Result then + begin + if VarIsNull(AValue) then + V := 0 + else + if VarIsStr(AValue) then + begin + Val(AValue, V, ACode); + Result := ACode = 0; + if not Result then + Exit; + end + else + V := VarAsType(AValue, {$IFDEF DELPHI6}varInt64{$ELSE}varInteger{$ENDIF}); + for I := 0 to AItems.Count - 1 do + begin + if V and 1 = 0 then + ACheckStates[I] := cbsUnchecked + else + ACheckStates[I] := cbsChecked; + V := V shr 1; + end; + end + end; + + function CalculateItemsByStatesStringValue: Boolean; + var + AItemCount, I: Integer; + S: string; + begin + Result := VarIsNull(AValue) or VarIsStr(AValue); + if not Result then + Exit; + + Result := False; + S := VarToStr(AValue); + AItemCount := Length(S); + if AItemCount > AItems.Count then + AItemCount := AItems.Count; + for I := 1 to AItemCount do + if (S[I] < '0') or (S[I] > '2') then + Exit + else + ACheckStates[I - 1] := TcxCheckBoxState(Ord(S[I]) - Ord('0')); + if AItemCount < AItems.Count then + for I := AItemCount to AItems.Count - 1 do + ACheckStates[I] := cbsUnchecked; + Result := True; + end; + +var + I: Integer; +begin + SetLength(ACheckStates, AItems.Count); + + case AValueFormat of + cvfCaptions: + Result := CalculateItemsByCaptionsValue; + cvfIndices: + Result := CalculateItemsByIndicesValue; + cvfInteger: + Result := CalculateItemsByStatesIntegerValue; + cvfStatesString: + Result := CalculateItemsByStatesStringValue; + else + Result := False; + end; + + if not Result then + for I := 0 to AItems.Count - 1 do + ACheckStates[I] := cbsUnchecked; +end; + +procedure CalculateCustomCheckBoxViewInfo(ACanvas: TcxCanvas; AViewData: TcxCustomCheckBoxViewData; + AViewInfo: TcxCustomCheckBoxViewInfo); + + procedure CheckFocusRectBounds; + var + AMaxRect: TRect; + begin + with AViewInfo do + begin + if Alignment = taCenter then + AMaxRect := Rect(FocusRect.Left, ClientRect.Top, FocusRect.Right, ClientRect.Bottom) + else + begin + AMaxRect := Rect(TextRect.Left - 1, TextRect.Top - 1 + 2 * Integer(IsInplace), + TextRect.Right + 1, TextRect.Bottom + 1 - 2 * Integer(IsInplace)); + if AMaxRect.Right > BorderRect.Right - 1 then + AMaxRect.Right := BorderRect.Right - 1; + end; + + if FocusRect.Left < AMaxRect.Left then + FocusRect.Left := AMaxRect.Left; + if FocusRect.Top < AMaxRect.Top then + FocusRect.Top := AMaxRect.Top; + if FocusRect.Right > AMaxRect.Right then + FocusRect.Right := AMaxRect.Right; + if FocusRect.Bottom > AMaxRect.Bottom then + FocusRect.Bottom := AMaxRect.Bottom; + end; + end; + +begin + with AViewInfo do + begin + BackgroundColor := AViewData.Style.Color; + + if Focused and ((not IsInplace or AViewData.Properties.IsEmbeddedEdit) and (Alignment <> taCenter) or + IsInplace and (Alignment = taCenter) and (epoShowFocusRectWhenInplace in PaintOptions)) then + begin + if Alignment = taCenter then + begin + FocusRect := ClientRect; + InflateRect(FocusRect, -1, -1); + end + else + if Length(Text) <> 0 then + begin + FocusRect := TextRect; + if not AViewData.Properties.FullFocusRect then + begin + ACanvas.Font := Font; + ACanvas.TextExtent(Text, FocusRect, DrawTextFlags); + end; + InflateRect(FocusRect, 1, 1); + end + else + FocusRect := cxEmptyRect; + end + else + FocusRect := cxEmptyRect; + if not IsRectEmpty(FocusRect) then + CheckFocusRectBounds; + end; +end; + +procedure DrawCheckBoxText(ACanvas: TcxCanvas; AText: string; AFont: TFont; + ATextColor: TColor; ATextRect: TRect; ADrawTextFlags: Integer; AEnabled: Boolean); +begin + ACanvas.Font := AFont; + ACanvas.Font.Color := ATextColor; + ACanvas.Brush.Style := bsClear; + ACanvas.DrawText(AText, ATextRect, ADrawTextFlags, AEnabled); + ACanvas.Brush.Style := bsSolid; +end; + +function IsGlyphValid(AGlyph: TBitmap; AGlyphCount: Integer): Boolean; +begin + Result := (AGlyphCount > 0) and VerifyBitmap(AGlyph); +end; + +function GetCheckNativeState(AState: TcxCheckBoxState; ACheckState: TcxEditCheckState): Integer; +const + ANativeCheckStateMap: array[TcxCheckBoxState, TcxEditCheckState] of Integer = ( + (CBS_UNCHECKEDNORMAL, CBS_UNCHECKEDHOT, CBS_UNCHECKEDPRESSED, CBS_UNCHECKEDDISABLED), + (CBS_CHECKEDNORMAL, CBS_CHECKEDHOT, CBS_CHECKEDPRESSED, CBS_CHECKEDDISABLED), + (CBS_MIXEDNORMAL, CBS_MIXEDHOT, CBS_MIXEDPRESSED, CBS_MIXEDDISABLED) + ); +begin + Result := ANativeCheckStateMap[AState, ACheckState]; +end; + +procedure DrawCustomCheckBox(ACanvas: TcxCanvas; AViewInfo: TcxCustomCheckBoxViewInfo); overload; +var + AIsBackgroundTransparent: Boolean; + ACheckRect: TRect; + ACheckTransparent: Boolean; +begin + AIsBackgroundTransparent := AViewInfo.IsBackgroundTransparent; + +// ACanvas.Brush.Color := AViewInfo.BackgroundColor; // to fix problem with DC color after RestoreDC + + ACheckRect := AViewInfo.CheckBoxRect; + InflateRect(ACheckRect, -AViewInfo.CheckBorderOffset, -AViewInfo.CheckBorderOffset); + + ACheckTransparent := AIsBackgroundTransparent and + (Assigned(AViewInfo.Painter) or AViewInfo.HasGlyph or + AViewInfo.NativeStyle and IsThemeBackgroundPartiallyTransparent( + OpenTheme(totButton), BP_CHECKBOX, GetCheckNativeState(AViewInfo.State, AViewInfo.CheckBoxState))); + + AViewInfo.DrawEditBackground(ACanvas, AViewInfo.Bounds, ACheckRect, ACheckTransparent); + + DrawEditCheck(ACanvas, AViewInfo.CheckBoxRect, AViewInfo.State, AViewInfo.CheckBoxState, + AViewInfo.CheckBoxGlyph, AViewInfo.CheckBoxGlyphCount, + AViewInfo.CheckBoxBorderStyle, AViewInfo.NativeStyle, + AViewInfo.BorderColor, AViewInfo.BackgroundColor, not AIsBackgroundTransparent, + AViewInfo.IsDesigning, AViewInfo.Focused, True, AViewInfo.Painter, + AViewInfo.NullValueShowingStyle); + + if AViewInfo.Alignment <> taCenter then + DrawCheckBoxText(ACanvas, AViewInfo.Text, AViewInfo.Font, AViewInfo.TextColor, + AViewInfo.TextRect, AViewInfo.DrawTextFlags, AViewInfo.IsTextEnabled); + if not IsRectEmpty(AViewInfo.FocusRect) then + ACanvas.DrawFocusRect(AViewInfo.FocusRect); +end; + +procedure DrawEditCheck(ACanvas: TcxCanvas; const ACheckRect: TRect; + AState: TcxCheckBoxState; ACheckState: TcxEditCheckState; AGlyph: TBitmap; + AGlyphCount: Integer; ABorderStyle: TcxEditCheckBoxBorderStyle; + ANativeStyle: Boolean; ABorderColor: TColor; ABackgroundColor: TColor; + ADrawBackground, AIsDesigning, AFocused, ASupportGrayed: Boolean; + APainter: TcxCustomLookAndFeelPainterClass; + AGrayedShowingStyle: TcxCheckBoxNullValueShowingStyle = nssGrayedChecked); +const + CheckState2ButtonState: array[TcxEditCheckState] of TcxButtonState = + (cxbsNormal, cxbsHot, cxbsPressed, cxbsDisabled); + + procedure DrawCheckBoxGlyph; + var + ABitmap: TBitmap; + AGlyphIndex: Integer; + R: TRect; + begin + AGlyphIndex := GetEditCheckGlyphIndex(AState, ACheckState, ASupportGrayed, + AGlyphCount); + ABitmap := TBitmap.Create; + try + ABitmap.Assign(AGlyph); + ABitmap.Height := ACheckRect.Bottom - ACheckRect.Top; + ABitmap.Width := ACheckRect.Right - ACheckRect.Left; + + R.Left := (AGlyph.Width div AGlyphCount) * AGlyphIndex; + R.Right := R.Left + ABitmap.Width; + R.Top := (AGlyph.Height - ABitmap.Height) div 2; + R.Bottom := R.Top + ABitmap.Height; + + ABitmap.Canvas.CopyRect(Rect(0, 0, ABitmap.Width, ABitmap.Height), + AGlyph.Canvas, R); + DrawGlyph(ACanvas, ACheckRect.Left, ACheckRect.Top, ABitmap, + ACheckState <> ecsDisabled, ColorToRGB(ABackgroundColor)); + finally + ABitmap.Free; + end; + end; + + procedure DrawCheckBoxBorder; + const + ACheckBoxStateToButtonStateMap: array [TcxEditCheckState] of TcxButtonState = + (cxbsNormal, cxbsHot, cxbsPressed, cxbsDisabled); + var + ACheckBorderOffset: Integer; + R: TRect; + begin + if ANativeStyle then + begin + DrawThemeBackground(OpenTheme(totButton), ACanvas.Handle, BP_CHECKBOX, + GetCheckNativeState(AState, ACheckState), ACheckRect); + Exit; + end; + + R := ACheckRect; + ACheckBorderOffset := GetEditCheckBorderOffset(ABorderStyle, False, False, APainter); + + if ADrawBackground and (ACheckBorderOffset > 0) then + ACanvas.FrameRect(R, ABackgroundColor, ACheckBorderOffset); + InflateRect(R, -ACheckBorderOffset, -ACheckBorderOffset); + with ACanvas do + begin + case ABorderStyle of + ebsSingle: + FrameRect(R, ABorderColor); + ebsThick: + FrameRect(R, ABorderColor, 2); + ebsFlat: + begin + DrawEdge(R, True, True, cxBordersAll); + InflateRect(R, -1, -1); + FrameRect(R, clBtnFace); + end; + ebs3D: + begin + DrawEdge(R, True, True, cxBordersAll); + InflateRect(R, -1, -1); + DrawComplexFrame(R, cl3DDkShadow, cl3DLight, cxBordersAll); + end; + ebsUltraFlat, ebsOffice11: + begin + if (ABorderStyle = ebsOffice11) and (ACheckState = ecsNormal) and + not AIsDesigning and not AFocused then + ABorderColor := clBtnText + else + if (ACheckState in [ecsHot, ecsPressed]) or + AIsDesigning and (ACheckState <> ecsDisabled) or + (ACheckState = ecsNormal) and AFocused then + ABorderColor := GetEditBorderHighlightColor( + ABorderStyle = ebsOffice11) + else + ABorderColor := clBtnShadow; + FrameRect(R, ABorderColor); + end; + end; + end; + end; + + procedure DrawCheck(R: TRect; AColor: TColor); + const + ROP_PSDPxax = $B8074A; + var + APrevClipRgn: TcxRegion; + begin + APrevClipRgn := ACanvas.GetClipRegion; + try + ACanvas.SetClipRegion(TcxRegion.Create(R), roIntersect); + InflateRect(R, cxEditMaxCheckBoxBorderWidth, cxEditMaxCheckBoxBorderWidth); + ACanvas.Brush.Color := AColor; + BitBlt(ACanvas.Handle, R.Left, R.Top, FCheckMask.Width, FCheckMask.Height, + FCheckMask.Canvas.Handle, 0, 0, ROP_PSDPxax); + finally + ACanvas.SetClipRegion(APrevClipRgn, roSet); + end; + end; + + function GetCheckBoxContentColor: TColor; + const + AColors: array[TcxEditCheckState] of TColor = + (clWindow, clWindow, clBtnFace, clBtnFace); + begin + if ABorderStyle in [ebsUltraFlat, ebsOffice11] then + case ACheckState of + ecsNormal: + if (AState = cbsGrayed) and (AGrayedShowingStyle = nssInactive) then + Result := clBtnFace + else + Result := clWindow; + ecsHot, ecsPressed: + Result := GetEditButtonHighlightColor( + ACheckState = ecsPressed, + ABorderStyle = ebsOffice11); + else + Result := clBtnFace; + end + else + if (AState = cbsGrayed) and (AGrayedShowingStyle = nssInactive) then + Result := clBtnFace + else + Result := AColors[ACheckState]; + end; + + procedure InternalDrawCheckBoxContent(AContentRect: TRect); + const + AButtonStateMap: array [TcxEditCheckState] of TcxButtonState = + (cxbsNormal, cxbsHot, cxbsPressed, cxbsDisabled); + var + ACheckColor: TColor; + begin + cxEditFillRect(ACanvas.Handle, AContentRect, + GetSolidBrush(GetCheckBoxContentColor)); + if (AState = cbsUnchecked) or + (AState = cbsGrayed) and (AGrayedShowingStyle <> nssGrayedChecked) then + Exit; + if (ACheckState = ecsDisabled) or (AState = cbsGrayed) then + ACheckColor := clBtnShadow + else + ACheckColor := clBtnText; + DrawCheck(AContentRect, ACheckColor); + end; + + procedure DrawWindowsCheckBoxContent(AContentRect: TRect); + const + ABorder3DStyleMap: array [Boolean] of Integer = (DFCS_FLAT, 0); + AGrayedShowingStyleMap: array [TcxCheckBoxNullValueShowingStyle] of Integer = + (0, DFCS_INACTIVE, DFCS_CHECKED); + var + AClipRgnExists: Boolean; + AFlags: Integer; + APrevClipRgn: HRGN; + begin + if ACheckState = ecsDisabled then + begin + AFlags := DFCS_BUTTON3STATE or DFCS_PUSHED; + if (AState = cbsUnchecked) or ((AState = cbsGrayed) and (AGrayedShowingStyle <> nssGrayedChecked)) then + AFlags := AFlags or DFCS_INACTIVE + else + AFlags := AFlags or DFCS_CHECKED; + end + else + begin + AFlags := 0; + case AState of + cbsGrayed: + AFlags := DFCS_BUTTON3STATE or + AGrayedShowingStyleMap[AGrayedShowingStyle]; + cbsChecked: + AFlags := DFCS_CHECKED; + end; + if ACheckState = ecsPressed then + AFlags := AFlags or DFCS_PUSHED; + end; + + APrevClipRgn := CreateRectRgn(0, 0, 0, 0); + AClipRgnExists := GetClipRgn(ACanvas.Handle, APrevClipRgn) = 1; + with AContentRect do + IntersectClipRect(ACanvas.Handle, Left, Top, Right, Bottom); + InflateRect(AContentRect, cxEditMaxCheckBoxBorderWidth, cxEditMaxCheckBoxBorderWidth); + + DrawFrameControl(ACanvas.Handle, AContentRect, DFC_BUTTON, DFCS_BUTTONCHECK or AFlags or ABorder3DStyleMap[ABorderStyle = ebs3D]); + + if AClipRgnExists then + SelectClipRgn(ACanvas.Handle, APrevClipRgn) + else + SelectClipRgn(ACanvas.Handle, 0); + DeleteObject(APrevClipRgn); + end; + + procedure DrawCheckBoxContent; + var + ACheckBoxBorderWidth: Integer; + R: TRect; + begin + if ANativeStyle then + Exit; + + ACheckBoxBorderWidth := cxEditMaxCheckBoxBorderWidth; + R := ACheckRect; + InflateRect(R, -ACheckBoxBorderWidth, -ACheckBoxBorderWidth); + + if ABorderStyle in [ebsUltraFlat, ebsOffice11] then + InternalDrawCheckBoxContent(R) + else + DrawWindowsCheckBoxContent(R); + end; + +begin + if not ADrawBackground then + ABackgroundColor := clNone; + if (AState = cbsGrayed) and (AGrayedShowingStyle = nssUnchecked) then + AState := cbsUnchecked; + + if IsGlyphValid(AGlyph, AGlyphCount) then + DrawCheckBoxGlyph + else + begin + if APainter <> nil then + begin + if ADrawBackground then + ACanvas.FillRect(ACheckRect, ABackgroundColor); + APainter.DrawCheckButton(ACanvas, ACheckRect, + CheckState2ButtonState[ACheckState], AState); + end + else + begin + DrawCheckBoxBorder; + DrawCheckBoxContent; + end; + end; +end; + +function GetEditCheckBorderOffset(ACheckBorderStyle: TcxContainerBorderStyle; + ANativeStyle, AHasGlyph: Boolean; APainter: TcxCustomLookAndFeelPainterClass): Integer; +begin + if ANativeStyle or AHasGlyph or (APainter <> nil) then + Result := 0 + else + Result := cxContainerMaxBorderWidth - GetContainerBorderWidth(ACheckBorderStyle); +end; + +function GetEditCheckBorderOffset(ACheckBorderStyle: TcxEditBorderStyle; + ANativeStyle, AHasGlyph: Boolean; APainter: TcxCustomLookAndFeelPainterClass): Integer; overload; +begin + Result := GetEditCheckBorderOffset( + TcxContainerBorderStyle(ACheckBorderStyle), ANativeStyle, AHasGlyph, APainter); +end; + +function GetEditCheckBorderOffset(ALookAndFeelKind: TcxLookAndFeelKind; + ANativeStyle, AHasGlyph: Boolean; APainter: TcxCustomLookAndFeelPainterClass): Integer; +begin + if ANativeStyle or AHasGlyph or (APainter <> nil) then + Result := 0 + else + Result := cxContainerMaxBorderWidth - GetContainerBorderWidth(ALookAndFeelKind); +end; + +function GetEditCheckGlyphIndex(AState: TcxCheckBoxState; + ACheckState: TcxEditCheckState; ASupportGrayed: Boolean; + AGlyphCount: Integer): Integer; +var + AStateCount: Integer; +begin + AStateCount := Integer(High(TcxCheckBoxState)) - + Integer(Low(TcxCheckBoxState)) + 1; + if not ASupportGrayed and (AGlyphCount mod 3 <> 0) and (AGlyphCount mod 2 = 0) then + Dec(AStateCount); + case AState of + cbsUnchecked: + Result := 0; + cbsChecked: + Result := 1; + else + Result := 2; + end; + if ACheckState = ecsPressed then + Inc(Result, AStateCount); + if (Result >= AGlyphCount) and (Result > AStateCount - 1) then + Result := Result mod AStateCount; +end; + +function GetEditCheckSize(ACanvas: TcxCanvas; ANativeStyle: Boolean; + AGlyph: TBitmap; AGlyphCount: Integer; APainter: TcxCustomLookAndFeelPainterClass): TSize; +var + AHasGlyph: Boolean; +begin + AHasGlyph := IsGlyphValid(AGlyph, AGlyphCount); + if AHasGlyph then + begin + Result.cx := AGlyph.Width div AGlyphCount; + Result.cy := AGlyph.Height; + end + else + if APainter <> nil then + Result := APainter.CheckButtonSize + else + if AreVisualStylesMustBeUsed(ANativeStyle, totButton) then + with TcxWinXPLookAndFeelPainter do + Result := CheckButtonSize + else + with TcxCustomLookAndFeelPainter do + Result := CheckButtonSize; +end; + +{ TcxCustomCheckBoxViewInfo } + +procedure TcxCustomCheckBoxViewInfo.Assign(Source: TObject); +begin + if Source is TcxCustomCheckBoxViewInfo then + with Source as TcxCustomCheckBoxViewInfo do + begin + Self.CheckBoxState := CheckBoxState; + Self.State := State; + end; + inherited Assign(Source); +end; + +procedure TcxCustomCheckBoxViewInfo.DrawText(ACanvas: TcxCanvas); +begin + DrawCheckBoxText(ACanvas, Text, Font, TextColor, TextRect, DrawTextFlags, IsTextEnabled); +end; + +function TcxCustomCheckBoxViewInfo.GetUpdateRegion(AViewInfo: TcxContainerViewInfo): TcxRegion; +var + AEquals: Boolean; + ATempRgn: TcxRegion; +begin + Result := inherited GetUpdateRegion(AViewInfo); + if not(AViewInfo is TcxCustomCheckBoxViewInfo) then + Exit; + with TcxCustomCheckBoxViewInfo(AViewInfo) do + AEquals := (Self.CheckBoxState = CheckBoxState) and (Self.State = State); + if not AEquals then + begin + ATempRgn := TcxRegion.Create(CheckBoxRect); + UniteRegions(Result, ATempRgn); + ATempRgn.Free; + end; +end; + +function TcxCustomCheckBoxViewInfo.IsHotTrack: Boolean; +begin + Result := True; +end; + +function TcxCustomCheckBoxViewInfo.IsHotTrack(P: TPoint): Boolean; +begin + Result := IsHotTrack; +end; + +function TcxCustomCheckBoxViewInfo.NeedShowHint(ACanvas: TcxCanvas; + const P: TPoint; out AText: TCaption; out AIsMultiLine: Boolean; + out ATextRect: TRect): Boolean; +begin + Result := False; +end; + +procedure TcxCustomCheckBoxViewInfo.Offset(DX, DY: Integer); +begin + inherited Offset(DX, DY); + OffsetRect(CheckBoxRect, DX, DY); + OffsetRect(FocusRect, DX, DY); +end; + +function TcxCustomCheckBoxViewInfo.Repaint(AControl: TWinControl; + const AInnerEditRect: TRect; AViewInfo: TcxContainerViewInfo = nil): Boolean; +var + R: TRect; +begin + Result := AControl.HandleAllocated; + if not Result then + Exit; + + Result := inherited Repaint(AControl, AInnerEditRect, AViewInfo); + with TcxCustomCheckBoxViewInfo(AViewInfo) do + begin + Result := Result or (AViewInfo <> nil) and + ((Self.CheckBoxState <> CheckBoxState) or (Self.State <> State)); + if (AViewInfo = nil) or (Self.CheckBoxState <> CheckBoxState) or (Self.State <> State) then + begin + R := Self.CheckBoxRect; + OffsetRect(R, Self.Left, Self.Top); + InternalInvalidate(AControl.Handle, R, cxEmptyRect, False); + end; + end; +end; + +function TcxCustomCheckBoxViewInfo.IsTextEnabled: Boolean; +begin + Result := IsContainerInnerControl or Enabled or IsTextColorAssigned or NativeStyle +end; + +procedure TcxCustomCheckBoxViewInfo.InternalPaint(ACanvas: TcxCanvas); +begin + DrawCustomCheckBox(ACanvas, Self); +end; + +function TcxCustomCheckBoxViewInfo.GetEdit: TcxCustomCheckBox; +begin + Result := TcxCustomCheckBox(FEdit); +end; + +{ TcxCustomCheckBoxViewData } + +procedure TcxCustomCheckBoxViewData.Calculate(ACanvas: TcxCanvas; const ABounds: TRect; + const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); + + procedure CalculateCheckRects(const ACheckSize: TSize); + var + ACaptionRect, ACheckBoxRect: TRect; + AAlignment: TAlignment; + begin + AAlignment := TcxCustomCheckBoxViewInfo(AViewInfo).Alignment; + ACheckBoxRect := AViewInfo.ClientRect; + ACaptionRect := ACheckBoxRect; + + if IsInplace then + begin + if AAlignment = taLeftJustify then + begin + Dec(ACaptionRect.Right, 2); + if not Properties.IsEmbeddedEdit then + Inc(ACheckBoxRect.Left, 2); + end + else + if AAlignment = taRightJustify then + begin + Inc(ACaptionRect.Left, 2); + if not Properties.IsEmbeddedEdit then + Dec(ACheckBoxRect.Right, 2); + end; + Inc(ACaptionRect.Top, EditContentParams.Offsets.Top); + Dec(ACaptionRect.Bottom, EditContentParams.Offsets.Bottom); + end + else + begin + InflateRect(ACaptionRect, -2, -2); + if not Properties.IsEmbeddedEdit and (not EmulateStandardControlDrawing or + not AreVisualStylesMustBeUsed(AViewInfo.NativeStyle, totButton) and (Style.LookAndFeel.SkinPainter = nil)) then + Dec(ACaptionRect.Top); + end; + if not (IsInplace or AreVisualStylesMustBeUsed(AViewInfo.NativeStyle, totButton) and Properties.IsEmbeddedEdit) then + InflateRect(ACheckBoxRect, -2, -2); + + if ACheckBoxRect.Bottom - ACheckBoxRect.Top > ACheckSize.cy then + begin + Inc(ACheckBoxRect.Top, (ACheckBoxRect.Bottom - ACheckBoxRect.Top - ACheckSize.cy) div 2); + ACheckBoxRect.Bottom := ACheckBoxRect.Top + ACheckSize.cy; + end; + if ACheckBoxRect.Right - ACheckBoxRect.Left > ACheckSize.cx then + if AAlignment = taCenter then + begin + Inc(ACheckBoxRect.Left, (ACheckBoxRect.Right - ACheckBoxRect.Left - ACheckSize.cx) div 2); + ACheckBoxRect.Right := ACheckBoxRect.Left + ACheckSize.cx; + end + else + if AAlignment = taLeftJustify then + begin + ACheckBoxRect.Right := ACheckBoxRect.Left + ACheckSize.cx; + ACaptionRect.Left := ACheckBoxRect.Right + 3; + end + else + begin + ACheckBoxRect.Left := ACheckBoxRect.Right - ACheckSize.cx; + ACaptionRect.Right := ACheckBoxRect.Left - 3 + Integer(IsInplace and Properties.IsEmbeddedEdit); + end + else + ACaptionRect.Right := ACaptionRect.Left; + if IsRectEmpty(ACheckBoxRect) then + ACheckBoxRect := cxEmptyRect; + + if not Enabled and not IsNativeStyle(Style.LookAndFeel) and + (Style.LookAndFeel.SkinPainter = nil) + then + begin + Inc(ACaptionRect.Right); + Inc(ACaptionRect.Bottom); + end; + + TcxCustomCheckBoxViewInfo(AViewInfo).TextRect := ACaptionRect; + TcxCustomCheckBoxViewInfo(AViewInfo).CheckBoxRect := ACheckBoxRect; + end; + + function GetCheckBoxBorderStyle(AEditHotState: TcxContainerHotState): TcxEditBorderStyle; + const + ABorderStyles: array[TcxContainerHotState, TcxEditBorderStyle] of TcxEditBorderStyle = ( + (ebsNone, ebsSingle, ebsThick, ebsFlat, ebs3D, ebsUltraFlat, ebsOffice11), + (ebsNone, ebsSingle, ebsThick, ebsFlat, ebs3D, ebsUltraFlat, ebsOffice11), + (ebsFlat, ebsThick, ebsThick, ebs3D, ebs3D, ebsUltraFlat, ebsOffice11) + ); + begin + Result := ABorderStyles[AEditHotState, Style.BorderStyle]; + end; + +var + ACheckBoxViewInfo: TcxCustomCheckBoxViewInfo; +begin + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, AIsMouseEvent); + + ACheckBoxViewInfo := TcxCustomCheckBoxViewInfo(AViewInfo); + ACheckBoxViewInfo.IsEditClass := GetIsEditClass; + ACheckBoxViewInfo.DrawSelectionBar := False; + ACheckBoxViewInfo.HasPopupWindow := False; + ACheckBoxViewInfo.DrawTextFlags := GetDrawTextFlags; + CalculateCheckBoxViewInfo(Self, ACheckBoxViewInfo, AIsMouseEvent); + if Edit <> nil then +// ACheckBoxViewInfo.Text := '' +// else + ACheckBoxViewInfo.Text := TcxCustomCheckBox(Edit).Caption; + if IsInplace and not (Properties.IsEmbeddedEdit or + Properties.UseAlignmentWhenInplace or (ACheckBoxViewInfo.Text <> '')) then + ACheckBoxViewInfo.Alignment := taCenter + else + ACheckBoxViewInfo.Alignment := Properties.Alignment; + ACheckBoxViewInfo.CheckBoxBorderStyle := GetCheckBoxBorderStyle(AViewInfo.HotState); + ACheckBoxViewInfo.CheckBoxGlyph := Properties.Glyph; + ACheckBoxViewInfo.CheckBoxGlyphCount := Properties.GlyphCount; + ACheckBoxViewInfo.NullValueShowingStyle := Properties.NullStyle; + ACheckBoxViewInfo.HasGlyph := IsGlyphValid(Properties.Glyph, Properties.GlyphCount); + ACheckBoxViewInfo.CheckBorderOffset := + GetEditCheckBorderOffset(ACheckBoxViewInfo.CheckBoxBorderStyle, NativeStyle, + ACheckBoxViewInfo.HasGlyph, ACheckBoxViewInfo.Painter); + CalculateCheckRects(GetEditCheckSize(ACanvas, NativeStyle, Properties.Glyph, + Properties.GlyphCount, AViewInfo.Painter)); + if not Enabled then + ACheckBoxViewInfo.CheckBoxState := ecsDisabled + else + if IsCheckPressed then + ACheckBoxViewInfo.CheckBoxState := ecsPressed + else + if not IsDesigning and PtInRect(ACheckBoxViewInfo.BorderRect, P) then + if Shift = [] then + ACheckBoxViewInfo.CheckBoxState := ecsHot + else if (Shift = [ssLeft]) and ((Button = cxmbLeft) or (ACheckBoxViewInfo.CheckBoxState = ecsPressed)) then + ACheckBoxViewInfo.CheckBoxState := ecsPressed + else + ACheckBoxViewInfo.CheckBoxState := ecsNormal + else + ACheckBoxViewInfo.CheckBoxState := ecsNormal; + + CalculateCustomCheckBoxViewInfo(ACanvas, Self, ACheckBoxViewInfo); + + if IsInplace and (ACheckBoxViewInfo.CheckBoxBorderStyle = ebsSingle) then + if (ACheckBoxViewInfo.CheckBoxState = ecsHot) or (IsDesigning and (ACheckBoxViewInfo.CheckBoxState <> ecsDisabled)) then + ACheckBoxViewInfo.BorderColor := clHighlight + else + ACheckBoxViewInfo.BorderColor := clBtnShadow; + + ACheckBoxViewInfo.IsTextColorAssigned := Style.IsValueAssigned(svTextColor) or + ((ACheckBoxViewInfo.Painter <> nil) and + (ACheckBoxViewInfo.Painter.DefaultEditorTextColor(True) <> clDefault)); +end; + +procedure TcxCustomCheckBoxViewData.EditValueToDrawValue(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; AViewInfo: TcxCustomEditViewInfo); +begin + if PreviewMode then + TcxCustomCheckBoxViewInfo(AViewInfo).State := cbsChecked + else + TcxCustomCheckBoxViewInfo(AViewInfo).State := Properties.GetState(AEditValue); + if IsInplace and not Properties.IsEmbeddedEdit then + TcxCustomCheckBoxViewInfo(AViewInfo).Text := ''; + CalculateCustomCheckBoxViewInfo(ACanvas, Self, TcxCustomCheckBoxViewInfo(AViewInfo)); +end; + +function TcxCustomCheckBoxViewData.GetBorderStyle: TcxEditBorderStyle; +begin + Result := ebsNone; +end; + +function TcxCustomCheckBoxViewData.InternalGetEditConstantPartSize(ACanvas: TcxCanvas; + AIsInplace: Boolean; AEditSizeProperties: TcxEditSizeProperties; + var MinContentSize: TSize; AViewInfo: TcxCustomEditViewInfo): TSize; +var + ACheckBoxViewInfo: TcxCustomCheckBoxViewInfo; + ASize1, ASize2: TSize; + AText: string; +begin + Result := inherited InternalGetEditConstantPartSize(ACanvas, AIsInplace, + AEditSizeProperties, MinContentSize, AViewInfo); + ACheckBoxViewInfo := TcxCustomCheckBoxViewInfo(AViewInfo); + with ACheckBoxViewInfo.CheckBoxRect do + ASize1 := Size(Right - Left, Bottom - Top); + + if IsInplace then + if (ACheckBoxViewInfo.Alignment <> taCenter) and (ACheckBoxViewInfo.Text <> '') then + begin + ACanvas.Font := Style.GetVisibleFont; + ASize1.cx := ACheckBoxViewInfo.TextRect.Left - ACheckBoxViewInfo.Bounds.Left + + ACanvas.TextWidth(RemoveAccelChars(ACheckBoxViewInfo.Text)) + + (ACheckBoxViewInfo.Bounds.Right - ACheckBoxViewInfo.TextRect.Right); + end + else + ASize1.cx := ASize1.cx + 2 * 2; + + if IsInplace then + ASize1.cy := ASize1.cy + (1 - ACheckBoxViewInfo.CheckBorderOffset) * 2 + else + ASize1.cy := ASize1.cy + 2 * 2; + if (Properties.Alignment = taCenter) or IsInplace then + AText := 'Gg' + else + AText := RemoveAccelChars(TcxCustomCheckBox(Edit).Caption); + if not Enabled and not IsNativeStyle(Style.LookAndFeel) then + Dec(AEditSizeProperties.Width); + ASize2 := GetTextEditContentSize(ACanvas, Self, AText, + DrawTextFlagsTocxTextOutFlags(GetDrawTextFlags) or CXTO_SINGLELINE or CXTO_CHARBREAK, + AEditSizeProperties, 0, False); + if ASize1.cy < ASize2.cy then + ASize1.cy := ASize2.cy; + + Result.cx := Result.cx + ASize1.cx; + Result.cy := Result.cy + ASize1.cy; +end; + +function TcxCustomCheckBoxViewData.GetDrawTextFlags: Integer; +const + AHorzAlignmentFlags: array [TcxEditHorzAlignment] of Integer = ( + cxAlignLeft, cxAlignLeft, cxAlignHCenter + ); +begin + with Properties.InternalAlignment do + begin + Result := AHorzAlignmentFlags[Horz]; + Result := Result or cxSingleLine; + end; + Result := Result or cxShowPrefix; + if Properties.MultiLine then + begin + Result := Result and (not cxSingleLine); + Result := Result or cxDontClip; + Result := Result or cxWordBreak; + end; + + if IsInplace or not Properties.MultiLine then + Result := Result or cxAlignVCenter + else + Result := Result or cxAlignTop; +end; + +function TcxCustomCheckBoxViewData.GetIsEditClass: Boolean; +begin + Result := True; +end; + +function TcxCustomCheckBoxViewData.IsCheckPressed: Boolean; +begin + Result := (Edit <> nil) and TcxCustomCheckBox(Edit).FIsCheckPressed; +end; + +function TcxCustomCheckBoxViewData.GetProperties: TcxCustomCheckBoxProperties; +begin + Result := TcxCustomCheckBoxProperties(FProperties); +end; + +{ TcxCheckBoxStyle } + +function TcxCheckBoxStyle.HasBorder: Boolean; +begin + Result := False; +end; + +{ TcxCustomCheckBoxProperties } + +constructor TcxCustomCheckBoxProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FDisplayChecked := cxGetResourceString(@cxSEditCheckBoxChecked); + FDisplayUnchecked := cxGetResourceString(@cxSEditCheckBoxUnchecked); + FDisplayGrayed := cxGetResourceString(@cxSEditCheckBoxGrayed); + + FGlyphCount := 6; + FNullStyle := nssGrayedChecked; + FValueChecked := True; + FValueGrayed := Null; + FValueUnchecked := False; +end; + +destructor TcxCustomCheckBoxProperties.Destroy; +begin + if FGlyph <> nil then + FreeAndNil(FGlyph); + inherited Destroy; +end; + +procedure TcxCustomCheckBoxProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomCheckBoxProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with Source as TcxCustomCheckBoxProperties do + begin + Self.AllowGrayed := AllowGrayed; + Self.DisplayChecked := DisplayChecked; + Self.DisplayGrayed := DisplayGrayed; + Self.DisplayUnchecked := DisplayUnchecked; + Self.FullFocusRect := FullFocusRect; + Self.Glyph := Glyph; + Self.GlyphCount := GlyphCount; + Self.MultiLine := MultiLine; + Self.NullStyle := NullStyle; + Self.UseAlignmentWhenInplace := UseAlignmentWhenInplace; + Self.SetStateValues(ValueChecked, ValueGrayed, ValueUnchecked); + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +function TcxCustomCheckBoxProperties.CanCompareEditValue: Boolean; +begin + Result := True; +end; + +function TcxCustomCheckBoxProperties.CompareDisplayValues( + const AEditValue1, AEditValue2: TcxEditValue): Boolean; +begin + Result := GetState(AEditValue1) = GetState(AEditValue2); +end; + +class function TcxCustomCheckBoxProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxCheckBox; +end; + +function TcxCustomCheckBoxProperties.GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; +begin + case GetState(AEditValue) of + cbsChecked: + Result := FDisplayChecked; + cbsUnchecked: + Result := FDisplayUnchecked; + cbsGrayed: + Result := FDisplayGrayed; + end; +end; + +class function TcxCustomCheckBoxProperties.GetStyleClass: TcxCustomEditStyleClass; +begin + Result := TcxCheckBoxStyle; +end; + +function TcxCustomCheckBoxProperties.GetSpecialFeatures: TcxEditSpecialFeatures; +begin + Result := inherited GetSpecialFeatures + [esfNoContentPart]; +end; + +function TcxCustomCheckBoxProperties.GetSupportedOperations: TcxEditSupportedOperations; +begin + Result := [esoAlwaysHotTrack, esoEditing, esoFiltering, esoHotTrack, + esoShowingCaption, esoSorting, esoTransparency]; +end; + +class function TcxCustomCheckBoxProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxCustomCheckBoxViewInfo; +end; + +function TcxCustomCheckBoxProperties.IsActivationKey(AKey: Char): Boolean; +begin + Result := AKey = ' '; +end; + +function TcxCustomCheckBoxProperties.IsEditValueValid(var EditValue: TcxEditValue; AEditFocused: Boolean): Boolean; +begin + Result := inherited IsEditValueValid(EditValue, AEditFocused); + if Result then + Result := not CheckValue(EditValue); +end; + +function TcxCustomCheckBoxProperties.IsResetEditClass: Boolean; +begin + Result := True; +end; + +procedure TcxCustomCheckBoxProperties.PrepareDisplayValue(const AEditValue: + TcxEditValue; var DisplayValue: TcxEditValue; AEditFocused: Boolean); +begin + if VarEqualsExact(AEditValue, FValueChecked) then + DisplayValue := Integer(cbsChecked) + else + if VarEqualsExact(AEditValue, FValueUnchecked) then + DisplayValue := Integer(cbsUnchecked) + else + DisplayValue := Integer(cbsGrayed); +end; + +function TcxCustomCheckBoxProperties.CanValidate: Boolean; +begin + Result := True; +end; + +procedure TcxCustomCheckBoxProperties.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('Caption', ReadCaption, nil, False); +end; + +class function TcxCustomCheckBoxProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxCustomCheckBoxViewData; +end; + +function TcxCustomCheckBoxProperties.HasDisplayValue: Boolean; +begin + Result := True; +end; + +function TcxCustomCheckBoxProperties.CheckValue(const AValue: TcxEditValue): Boolean; +begin + Result := not(InternalVarEqualsExact(AValue, FValueChecked) or InternalVarEqualsExact(AValue, + FValueGrayed) or InternalVarEqualsExact(AValue, FValueUnchecked)); +end; + +function TcxCustomCheckBoxProperties.GetState( + const AEditValue: TcxEditValue): TcxCheckBoxState; +var + ADisplayValue: TcxEditValue; +begin + PrepareDisplayValue(AEditValue, ADisplayValue, False); + Result := TcxCheckBoxState(Integer(ADisplayValue)); +end; + +function TcxCustomCheckBoxProperties.InternalGetGlyph: TBitmap; +begin + if FGlyph = nil then + begin + FGlyph := TBitmap.Create; + FGlyph.OnChange := GlyphChanged; + end; + Result := FGlyph; +end; + +function TcxCustomCheckBoxProperties.IsEmbeddedEdit: Boolean; +begin + Result := False; +end; + +function TcxCustomCheckBoxProperties.GetAlignment: TAlignment; +begin + Result := inherited Alignment.Horz; +end; + +function TcxCustomCheckBoxProperties.GetGlyph: TBitmap; +begin + Result := InternalGetGlyph; +end; + +function TcxCustomCheckBoxProperties.GetInternalAlignment: TcxEditAlignment; +begin + Result := inherited Alignment; +end; + +procedure TcxCustomCheckBoxProperties.GlyphChanged(Sender: TObject); +begin + Changed; +end; + +function TcxCustomCheckBoxProperties.IsAlignmentStored: Boolean; +begin + Result := inherited Alignment.IsHorzStored; +end; + +function TcxCustomCheckBoxProperties.IsDisplayCheckedStored: Boolean; +begin + Result := not InternalCompareString(FDisplayChecked, + cxGetResourceString(@cxSEditCheckBoxChecked), True); +end; + +function TcxCustomCheckBoxProperties.IsDisplayGrayedStored: Boolean; +begin + Result := not InternalCompareString(FDisplayGrayed, + cxGetResourceString(@cxSEditCheckBoxGrayed), True); +end; + +function TcxCustomCheckBoxProperties.IsDisplayUncheckedStored: Boolean; +begin + Result := not InternalCompareString(FDisplayUnchecked, + cxGetResourceString(@cxSEditCheckBoxUnchecked), True); +end; + +function TcxCustomCheckBoxProperties.IsLoading: Boolean; +begin + Result := (GetOwnerComponent(Self) <> nil) and (csLoading in GetOwnerComponent(Self).ComponentState); +end; + +function TcxCustomCheckBoxProperties.IsValueCheckedStored: Boolean; +begin + Result := not InternalVarEqualsExact(FValueChecked, True); +end; + +function TcxCustomCheckBoxProperties.IsValueGrayedStored: Boolean; +begin + Result := not VarIsNull(FValueGrayed); +end; + +function TcxCustomCheckBoxProperties.IsValueUncheckedStored: Boolean; +begin + Result := not InternalVarEqualsExact(FValueUnchecked, False); +end; + +// obsolete +procedure TcxCustomCheckBoxProperties.ReadCaption(Reader: TReader); +begin + Caption := Reader.ReadString; +end; + +procedure TcxCustomCheckBoxProperties.SetAlignment(Value: TAlignment); +begin + inherited Alignment.Horz := Value; +end; + +// obsolete +procedure TcxCustomCheckBoxProperties.SetCaption(const Value: TCaption); +begin + FIsCaptionAssigned := True; + if not InternalCompareString(Value, FCaption, True) then + begin + FCaption := Value; + Changed; + end; +end; + +procedure TcxCustomCheckBoxProperties.SetFullFocusRect(Value: Boolean); +begin + if Value <> FFullFocusRect then + begin + FFullFocusRect := Value; + Changed; + end; +end; + +procedure TcxCustomCheckBoxProperties.SetGlyph(Value: TBitmap); +begin + if Value = nil then + FreeAndNil(FGlyph) + else + Glyph.Assign(Value); + Changed; +end; + +procedure TcxCustomCheckBoxProperties.SetGlyphCount(Value: Integer); +begin + if FGlyphCount <> Value then + begin + FGlyphCount := Value; + if FGlyph <> nil then + Changed; + end; +end; + +procedure TcxCustomCheckBoxProperties.SetMultiLine(Value: Boolean); +begin + if Value <> FMultiLine then + begin + FMultiLine := Value; + Changed; + end; +end; + +procedure TcxCustomCheckBoxProperties.SetNullStyle(Value: TcxCheckBoxNullValueShowingStyle); +begin + if Value <> FNullStyle then + begin + FNullStyle := Value; + Changed; + end; +end; + +procedure TcxCustomCheckBoxProperties.SetStateValues(const AValueChecked, AValueGrayed, AValueUnchecked: TcxEditValue); +var + AIsValuesValid: Boolean; +begin + AIsValuesValid := not(InternalVarEqualsExact(AValueChecked, AValueGrayed) or + InternalVarEqualsExact(AValueGrayed, AValueUnchecked) or + InternalVarEqualsExact(AValueChecked, AValueUnchecked) or + VarIsNull(AValueChecked) or VarIsNull(AValueUnchecked)); + if AIsValuesValid then + begin + FValueChecked := AValueChecked; + FValueGrayed := AValueGrayed; + FValueUnchecked := AValueUnchecked; + Changed; + end; +end; + +procedure TcxCustomCheckBoxProperties.SetUseAlignmentWhenInplace(Value: Boolean); +begin + if Value <> FUseAlignmentWhenInplace then + begin + FUseAlignmentWhenInplace := Value; + Changed; + end; +end; + +procedure TcxCustomCheckBoxProperties.SetValueChecked(const Value: TcxEditValue); +begin + if IsLoading or CheckValue(Value) and not VarIsNull(Value) then + begin + FValueChecked := Value; + Changed; + end; +end; + +procedure TcxCustomCheckBoxProperties.SetValueGrayed(const Value: TcxEditValue); +begin + if IsLoading or CheckValue(Value) then + begin + FValueGrayed := Value; + Changed; + end; +end; + +procedure TcxCustomCheckBoxProperties.SetValueUnchecked(const Value: TcxEditValue); +begin + if IsLoading or CheckValue(Value) and not VarIsNull(Value) then + begin + FValueUnchecked := Value; + Changed; + end; +end; + +{ TcxCustomCheckBox } + +procedure TcxCustomCheckBox.Clear; +begin + Checked := False; +end; + +class function TcxCustomCheckBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomCheckBoxProperties; +end; + +procedure TcxCustomCheckBox.PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); +begin + case TcxCheckBoxState(Integer(ADisplayValue)) of + cbsUnchecked: + EditValue := ActiveProperties.FValueUnchecked; + cbsChecked: + EditValue := ActiveProperties.FValueChecked; + cbsGrayed: + EditValue := ActiveProperties.FValueGrayed; + end; +end; + +procedure TcxCustomCheckBox.ActionChange(Sender: TObject; CheckDefaults: Boolean); +begin + inherited ActionChange(Sender, CheckDefaults); + if (IsLoading or FIsLoaded) and FIsLoadingStateAssigned or not(Sender is TCustomAction) then + Exit; + if not CheckDefaults or (Checked = False) then + TcxCheckBoxActionLink(ActionLink).InternalSetChecked(TCustomAction(Sender).Checked); +end; + +function TcxCustomCheckBox.CanHaveTransparentBorder: Boolean; +begin + Result := not IsInplace and not ActiveProperties.IsEmbeddedEdit or + inherited CanHaveTransparentBorder; +end; + +function TcxCustomCheckBox.DefaultParentColor: Boolean; +begin + Result := True; +end; + +procedure TcxCustomCheckBox.DoEditKeyDown(var Key: Word; Shift: TShiftState); +begin + inherited DoEditKeyDown(Key, Shift); + if Key = 0 then + Exit; + + case Key of + VK_SPACE: + begin + with ViewInfo do + if CheckBoxState in [ecsNormal, ecsHot] then + begin + FIsCheckPressed := True; + CheckBoxState := ecsPressed; + ShortRefreshContainer(False); + Key := 0; + end; + end; + end; +end; + +procedure TcxCustomCheckBox.DoEditKeyPress(var Key: Char); +begin + inherited DoEditKeyPress(Key); + if Key = #0 then + Exit; + + if IsInplace and (Key = #32) and (ViewInfo.CheckBoxState = ecsNormal) then + begin + Toggle; + Key := #0; + end; +end; + +procedure TcxCustomCheckBox.DoEditKeyUp(var Key: Word; Shift: TShiftState); +begin + inherited DoEditKeyUp(Key, Shift); + if Key = 0 then + Exit; + + case Key of + VK_SPACE: + begin + if ViewInfo.CheckBoxState = ecsPressed then + begin + FIsCheckPressed := False; + ViewInfo.CheckBoxState := ecsNormal; + InvalidateCheckRect; + Toggle; + end; + end; + end; +end; + +procedure TcxCustomCheckBox.DoExit; +begin + FIsCheckPressed := False; + inherited DoExit; +end; + +procedure TcxCustomCheckBox.FillSizeProperties(var AEditSizeProperties: TcxEditSizeProperties); +begin + AEditSizeProperties := DefaultcxEditSizeProperties; + if not ActiveProperties.MultiLine then + AEditSizeProperties.MaxLineCount := 1; + AEditSizeProperties.Width := ViewInfo.TextRect.Right - ViewInfo.TextRect.Left; +end; + +function TcxCustomCheckBox.GetActionLinkClass: TControlActionLinkClass; +begin + Result := TcxCheckBoxActionLink; +end; + +function TcxCustomCheckBox.GetShadowBounds: TRect; +begin + if not IsInplace and not ActiveProperties.IsEmbeddedEdit and + ViewInfo.NativeStyle and Style.TransparentBorder then + begin + Result := GetControlRect(Self); + InflateRect(Result, -cxContainerMaxBorderWidth, -cxContainerMaxBorderWidth); + end + else + Result := inherited GetShadowBounds; +end; + +procedure TcxCustomCheckBox.Initialize; +begin + inherited Initialize; + ControlStyle := ControlStyle - [csDoubleClicks]; + Width := 121; + PrepareEditValue(Integer(cbsUnchecked), FEditValue, False); +end; + +function TcxCustomCheckBox.InternalGetNotPublishedStyleValues: TcxEditStyleValues; +begin + Result := inherited InternalGetNotPublishedStyleValues; + Include(Result, svEdges); +end; + +procedure TcxCustomCheckBox.InternalSetEditValue(const Value: TcxEditValue; + AValidateEditValue: Boolean); +var + APrevState: TcxCheckBoxState; +begin + APrevState := State; + inherited InternalSetEditValue(Value, AValidateEditValue); + if APrevState <> State then + begin + ViewInfo.State := State; + Click; + DoChange; + end; + ShortRefreshContainer(False); +end; + +function TcxCustomCheckBox.IsClickEnabledDuringLoading: Boolean; +begin + Result := IsDBEdit; +end; + +function TcxCustomCheckBox.IsNativeBackground: Boolean; +begin + Result := IsNativeStyle and ParentBackground and not IsInplace and + not Transparent; +end; + +procedure TcxCustomCheckBox.Loaded; +begin + FIsLoaded := True; + LockChangeEvents(True); + LockClick(True); + try + inherited Loaded; + if FIsLoadingStateAssigned then + State := FLoadingState + else + if not IsDBEdit then + State := cbsUnchecked; + finally + LockClick(False); + LockChangeEvents(False, False); + FIsLoaded := False; + end; +end; + +procedure TcxCustomCheckBox.ProcessViewInfoChanges(APrevViewInfo: TcxCustomEditViewInfo; + AIsMouseDownUpEvent: Boolean); +begin + if (TcxCustomCheckBoxViewInfo(APrevViewInfo).CheckBoxState = ecsPressed) and + (ViewInfo.CheckBoxState = ecsHot) then + Toggle; +end; + +procedure TcxCustomCheckBox.PropertiesChanged(Sender: TObject); +begin + if ActiveProperties.FIsCaptionAssigned then + begin + Caption := ActiveProperties.Caption; + ActiveProperties.FIsCaptionAssigned := False; + end; + + if ViewInfo.State <> State then + begin + ViewInfo.State := State; + InvalidateCheckRect; + if not AreChangeEventsLocked then + begin + Click; + DoChange; + end; + end; + inherited PropertiesChanged(Sender); +end; + +procedure TcxCustomCheckBox.TextChanged; +begin + inherited TextChanged; + ViewInfo.Text := Caption; + Invalidate; +end; + +procedure TcxCustomCheckBox.InvalidateCheckRect; +begin + InvalidateRect(ViewInfo.CheckBoxRect, False); +end; + +procedure TcxCustomCheckBox.Toggle; +begin + LockChangeEvents(True); + try + KeyboardAction := True; + try + begin + case State of + cbsUnchecked: + if ActiveProperties.AllowGrayed then + State := cbsGrayed + else + State := cbsChecked; + cbsChecked: + State := cbsUnchecked; + cbsGrayed: + State := cbsChecked; + end; + end; + finally + KeyboardAction := False; + end; + if ActiveProperties.ImmediatePost and CanPostEditValue and ValidateEdit(True) then + InternalPostEditValue; + finally + LockChangeEvents(False); + end; +end; + +function TcxCustomCheckBox.GetChecked: Boolean; +begin + Result := State = cbsChecked; +end; + +function TcxCustomCheckBox.GetProperties: TcxCustomCheckBoxProperties; +begin + Result := TcxCustomCheckBoxProperties(FProperties); +end; + +function TcxCustomCheckBox.GetActiveProperties: TcxCustomCheckBoxProperties; +begin + Result := TcxCustomCheckBoxProperties(InternalGetActiveProperties); +end; + +function TcxCustomCheckBox.GetState: TcxCheckBoxState; +begin + Result := ActiveProperties.GetState(EditValue); +end; + +function TcxCustomCheckBox.GetStyle: TcxCheckBoxStyle; +begin + Result := TcxCheckBoxStyle(FStyles.Style); +end; + +function TcxCustomCheckBox.GetViewInfo: TcxCustomCheckBoxViewInfo; +begin + Result := TcxCustomCheckBoxViewInfo(FViewInfo); +end; + +function TcxCustomCheckBox.IsStateStored: Boolean; +const + AStates: array[Boolean] of TcxCheckBoxState = (cbsUnchecked, cbsChecked); +begin + Result := not (Action is TCustomAction) or + (State <> AStates[TCustomAction(Action).Checked]); +end; + +procedure TcxCustomCheckBox.SetChecked(Value: Boolean); +begin + if Value then + State := cbsChecked + else + State := cbsUnchecked; +end; + +procedure TcxCustomCheckBox.SetProperties(Value: TcxCustomCheckBoxProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomCheckBox.SetState(Value: TcxCheckBoxState); +var + AEditValue: TcxEditValue; +begin + if IsLoading then + begin + FLoadingState := Value; + FIsLoadingStateAssigned := True; + end + else + if Value <> State then + begin + PrepareEditValue(Integer(Value), AEditValue, InternalFocused); + InternalEditValue := AEditValue; + end; +end; + +procedure TcxCustomCheckBox.SetStyle(Value: TcxCheckBoxStyle); +begin + FStyles.Style := Value; +end; + +procedure TcxCustomCheckBox.WMLButtonUp(var Message: TWMLButtonUp); +begin + ControlState := ControlState - [csClicked]; + inherited; +end; + +procedure TcxCustomCheckBox.CMDialogChar(var Message: TCMDialogChar); +begin + with Message do + if IsAccel(CharCode, Caption) {D3 - bug "&&"} and CanFocus then + begin + SetFocus; + if Focused then + Toggle; + Result := 1; + end + else + inherited; +end; + +procedure TcxCustomCheckBox.CMParentColorChanged(var Message: TMessage); +begin + inherited; + if ViewInfo.NativeStyle and ParentBackground then + Invalidate; +end; + +{ TcxCheckBox } + +class function TcxCheckBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCheckBoxProperties; +end; + +function TcxCheckBox.GetActiveProperties: TcxCheckBoxProperties; +begin + Result := TcxCheckBoxProperties(InternalGetActiveProperties); +end; + +function TcxCheckBox.GetProperties: TcxCheckBoxProperties; +begin + Result := TcxCheckBoxProperties(FProperties); +end; + +procedure TcxCheckBox.SetProperties(Value: TcxCheckBoxProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxFilterCheckBoxHelper } + +class procedure TcxFilterCheckBoxHelper.GetFilterValue(AEdit: TcxCustomEdit; + AEditProperties: TcxCustomEditProperties; var V: Variant; var S: TCaption); +begin + with TcxComboBox(AEdit) do + begin + case ItemIndex of + -1: + V := Null; + 0: + V := TcxCustomCheckBoxProperties(AEditProperties).ValueChecked; + 1: + V := TcxCustomCheckBoxProperties(AEditProperties).ValueUnchecked; + end; + if ItemIndex = -1 then + S := '' + else + S := TcxCustomCheckBoxProperties(AEditProperties).GetDisplayText(V); + end; +end; + +class function TcxFilterCheckBoxHelper.GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; +begin + Result := [fcoEqual, fcoNotEqual, fcoBlanks, fcoNonBlanks]; +end; + +class procedure TcxFilterCheckBoxHelper.InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); +var + ACheckBoxProperties: TcxCustomCheckBoxProperties; +begin + ACheckBoxProperties := TcxCustomCheckBoxProperties(AEditProperties); + with TcxComboBoxProperties(AProperties).Items do + begin + Clear; + Add(ACheckBoxProperties.GetDisplayText(ACheckBoxProperties.ValueChecked)); + Add(ACheckBoxProperties.GetDisplayText(ACheckBoxProperties.ValueUnchecked)); + end; + TcxComboBoxProperties(AProperties).DropDownListStyle := lsFixedList; + TcxComboBoxProperties(AProperties).IDefaultValuesProvider := nil; + ClearPropertiesEvents(AProperties); +end; + +class procedure TcxFilterCheckBoxHelper.SetFilterValue(AEdit: TcxCustomEdit; + AEditProperties: TcxCustomEditProperties; AValue: Variant); +const + AItemIndexMap: array [TcxCheckBoxState] of Integer = (1, 0, -1); +var + V: TcxEditValue; +begin + AEditProperties.PrepareDisplayValue(AValue, V, AEdit.Focused); + TcxComboBox(AEdit).ItemIndex := AItemIndexMap[TcxCheckBoxState((V))]; +end; + +class function TcxFilterCheckBoxHelper.UseDisplayValue: Boolean; +begin + Result := True; +end; + +{ TcxCheckBoxActionLink } + +procedure TcxCheckBoxActionLink.AssignClient(AClient: TObject); +begin + inherited AssignClient(AClient); + FClient := AClient as TcxCustomCheckBox; +end; + +function TcxCheckBoxActionLink.IsCheckedLinked: Boolean; +begin + Result := inherited IsCheckedLinked and (FClient.State <> cbsGrayed) and + (FClient.Checked = TCustomAction(Action).Checked); +end; + +procedure TcxCheckBoxActionLink.SetChecked(Value: Boolean); +begin + if IsCheckedLinked then + InternalSetChecked(Value); +end; + +procedure TcxCheckBoxActionLink.InternalSetChecked(Value: Boolean); +begin + FClient.LockClick(True); + FClient.LockChangeEvents(True); + try + FClient.Checked := Value; + finally + FClient.LockChangeEvents(False, False); + FClient.LockClick(False); + end; +end; + +initialization + GetRegisteredEditProperties.Register(TcxCheckBoxProperties, scxSEditRepositoryCheckBoxItem); + FilterEditsController.Register(TcxCheckBoxProperties, TcxFilterCheckBoxHelper); + PrepareCheckMask; + +finalization + FilterEditsController.Unregister(TcxCheckBoxProperties, TcxFilterCheckBoxHelper); + FreeAndNil(FCheckMask); + +end. + diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxCheckComboBox.pas b/official/x.35/ExpressEditors Library 5/Sources/cxCheckComboBox.pas new file mode 100644 index 00000000..ab832e28 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxCheckComboBox.pas @@ -0,0 +1,1556 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxCheckComboBox; + +interface + +{$I cxVer.inc} + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Messages, SysUtils, Classes, Controls, Graphics, StdCtrls, + Forms, Math, cxClasses, cxControls, cxContainer, cxGraphics, + cxDataStorage, cxDataUtils, cxVariants, cxEdit, cxEditUtils, + cxTextEdit, cxMaskEdit, cxDropDownEdit, cxImageComboBox, + cxExtEditUtils, cxCheckBox, cxLookAndFeels, cxExtEditConsts, + cxGroupBox, cxFilterControlUtils, cxLookAndFeelPainters; + +type + { TcxCheckComboBoxItem } + + TcxCheckComboBoxItem = class(TcxButtonGroupItem) + private + FShortDescription: TCaption; + function GetDescription: TCaption; + procedure SetDescription(const Value: TCaption); + procedure SetShortDescription(const Value: TCaption); + protected + function GetDisplayDescription: string; virtual; + public + procedure Assign(Source: TPersistent); override; + published + property Description: TCaption read GetDescription write SetDescription; + property Enabled; + property ShortDescription: TCaption read FShortDescription + write SetShortDescription; + property Tag; + end; + + { TcxCheckComboBoxItems } + + TcxCheckComboBoxItems = class(TcxButtonGroupItems) + private + function GetItems(Index: Integer): TcxCheckComboBoxItem; + procedure SetItems(Index: Integer; const Value: TcxCheckComboBoxItem); + public + function Add: TcxCheckComboBoxItem; + function AddCheckItem(const ADescription: TCaption; + const AShortDescription: TCaption = ''): TcxCheckComboBoxItem; + property Items[Index: Integer]: TcxCheckComboBoxItem read GetItems write SetItems; default; + end; + + { TcxCustomCheckComboBoxViewData } + + TcxCustomCheckComboBoxProperties = class; + + TcxCustomCheckComboBoxViewData = class(TcxCustomDropDownEditViewData) + protected + function GetProperties: TcxCustomCheckComboBoxProperties; + function InternalEditValueToDisplayText(AEditValue: TcxEditValue): string; override; + function IsComboBoxStyle: Boolean; override; + public + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; + const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); override; + property Properties: TcxCustomCheckComboBoxProperties read GetProperties; + end; + + { TcxCheckComboBoxListBox } + + TcxCustomCheckComboBox = class; + + TcxCustomCheckComboBoxListBox = class(TcxCustomComboBoxListBox, + IUnknown, IcxMouseTrackingCaller) + private + FCapturedCheckIndex: Integer; + FCheckBorderOffset: Integer; + FCheckSize: TSize; + FHotCheckIndex: Integer; + FInternalUpdate: Boolean; + FPressedCheckIndex: Integer; + function GetEdit: TcxCustomCheckComboBox; + procedure LBGetTextLen(var Message: TMessage); message LB_GETTEXTLEN; + procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + protected + // IcxMouseTrackingCaller + procedure IcxMouseTrackingCaller.MouseLeave = MouseTrackingMouseLeave; + procedure MouseTrackingMouseLeave; + + procedure CheckHotTrack; + function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; override; + procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); override; + procedure FullRepaint; + function GetCheckAt(X, Y: Integer): Integer; + function GetCheckRect(const R: TRect; AReturnFullRect: Boolean): TRect; + procedure InternalMouseMove(Shift: TShiftState; X, Y: Integer); + procedure InvalidateCheck(Index: Integer); + procedure KeyPress(var Key: Char); override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure RecreateWindow; override; + procedure SetItemIndex(const Value: Integer); override; + procedure SynchronizeCheckStates(ANewHotCheckIndex, ANewPressedIndex: Integer); + procedure UpdateItemState(const AIndex: Integer); virtual; + property Edit: TcxCustomCheckComboBox read GetEdit; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function GetItemHeight(AIndex: Integer = -1): Integer; override; + function GetItemWidth(AIndex: Integer): Integer; override; + end; + + { TcxCheckComboBoxLookupData } + + TcxCheckComboBoxLookupData = class(TcxComboBoxLookupData) + protected + function GetListBoxClass: TcxCustomEditListBoxClass; override; + function GetItem(Index: Integer): string; override; + function GetItemCount: Integer; override; + public + procedure TextChanged; override; + end; + + { TcxCheckPaintHelper } + + TcxCheckPaintHelper = class(TcxOwnedPersistent) + private + FStyle: TcxCustomEditStyle; + FGlyph: TBitmap; + FGlyphCount: Integer; + procedure SetStyle(Value: TcxCustomEditStyle); + protected + function GetNextState(Value: TcxCheckBoxState): TcxCheckBoxState; virtual; + property Style: TcxCustomEditStyle read FStyle write SetStyle; + property Glyph: TBitmap read FGlyph write FGlyph; + property GlyphCount: Integer read FGlyphCount write FGlyphCount; + function CalcTextRect(const ARect: TRect; const ACheckState: TcxCheckBoxState): TRect; virtual; + function CalcCheckPoint(const ARect: TRect; const ACheckState: TcxCheckBoxState): TPoint; virtual; + function IsClickInCheck(const AItemRect: TRect; const ACheckState: TcxCheckBoxState; + X, Y: Integer; const AUseRightToLeftAlignment: Boolean = False): Boolean; + function GetCheckWidth: Integer; virtual; + public + constructor Create(AOwner : TPersistent); override; + destructor Destroy; override; + end; + + { TcxCustomCheckComboBoxProperties } + + TcxCheckComboClickCheckEvent = procedure(Sender: TObject; ItemIndex: Integer; + var AllowToggle: Boolean) of object; + + TcxCustomCheckComboBoxProperties = class(TcxCustomComboBoxProperties) + private + FAllowGrayed: Boolean; // deprecated + FCheckPaintHelper : TcxCheckPaintHelper; + FDelimiter: string; + FEditValueFormat: TcxCheckStatesValueFormat; + FEmptySelectionText: string; + FGlyph: TBitmap; + FGlyphCount: Integer; + FItems : TcxCheckComboBoxItems; + FShowEmptyText: Boolean; + FOnClickCheck: TcxCheckComboClickCheckEvent; + FOnEditValueToStates: TcxValueToCheckStatesEvent; + FOnStatesToEditValue: TcxCheckStatesToValueEvent; + function GetGlyph: TBitmap; + procedure GlyphChanged(Sender: TObject); + function IsDelimiterStored: Boolean; + function IsEmptySelectionTextStored: Boolean; + procedure SetGlyph(Value: TBitmap); + procedure SetGlyphCount(Value: Integer); + procedure SetDelimiter(Value: string); + procedure SetEditValueFormat(Value: TcxCheckStatesValueFormat); + procedure SetEmptySelectionText(Value: string); + procedure SetShowEmptyText(Value: Boolean); + procedure SetItems(const Value: TcxCheckComboBoxItems); + protected + class function GetLookupDataClass: TcxInterfacedPersistentClass; override; + class function GetPopupWindowClass: TcxCustomEditPopupWindowClass; override; + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + function HasDisplayValue: Boolean; override; + procedure CalculateCheckStatesByEditValue(Sender: TObject; + const AEditValue: TcxEditValue; var ACheckStates: TcxCheckStates); virtual; + function CalculateDisplayValueByCheckStates( + const ACheckStates: TcxCheckStates): string; virtual; + function CalculateEditValueByCheckStates(Sender: TObject; + const ACheckStates: TcxCheckStates): TcxEditValue; virtual; + property AllowGrayed: Boolean read FAllowGrayed write FAllowGrayed + stored False; // deprecated + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + class function GetContainerClass: TcxContainerClass; override; + function GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; override; + function GetSupportedOperations: TcxEditSupportedOperations; override; + procedure PrepareDisplayValue(const AEditValue: TcxEditValue; + var DisplayValue: TcxEditValue; AEditFocused: Boolean); override; + function IsEditValueValid(var EditValue: TcxEditValue; AEditFocused: Boolean): Boolean; override; + // !!! + property EditValueFormat: TcxCheckStatesValueFormat + read FEditValueFormat write SetEditValueFormat default cvfInteger; + property Glyph: TBitmap read GetGlyph write SetGlyph; + property GlyphCount: Integer read FGlyphCount write SetGlyphCount default 6; + property Delimiter: string read FDelimiter write SetDelimiter + stored IsDelimiterStored; + property EmptySelectionText : string read FEmptySelectionText + write SetEmptySelectionText stored IsEmptySelectionTextStored; + property Items: TcxCheckComboBoxItems read FItems write SetItems; + property ShowEmptyText: Boolean read FShowEmptyText write SetShowEmptyText default True; + property OnClickCheck: TcxCheckComboClickCheckEvent read FOnClickCheck + write FOnClickCheck; + property OnEditValueToStates: TcxValueToCheckStatesEvent + read FOnEditValueToStates write FOnEditValueToStates; + property OnStatesToEditValue: TcxCheckStatesToValueEvent + read FOnStatesToEditValue write FOnStatesToEditValue; + end; + + { TcxCheckComboBoxProperties } + + TcxCheckComboBoxProperties = class(TcxCustomCheckComboBoxProperties) + published + property AllowGrayed; // deprecated + property AssignedValues; + property Delimiter; + property EmptySelectionText; + property ShowEmptyText; + property Alignment; + property BeepOnError; + property ButtonGlyph; + property CharCase; + property ClearKey; + property DropDownAutoWidth; + property DropDownRows; + property DropDownSizeable; + property DropDownWidth; + property EditValueFormat; + property Glyph; + property GlyphCount; + property ImeMode; + property ImeName; + property ImmediateDropDown; + property ImmediatePopup; + property ImmediatePost; + property Items; + property PopupAlignment; + property ReadOnly; + property ValidateOnEnter; + property OnChange; + property OnClickCheck; + property OnCloseUp; + property OnEditValueChanged; + property OnEditValueToStates; + property OnInitPopup; + property OnPopup; + property OnStatesToEditValue; + end; + + { TcxCheckComboBoxPopupWindow } + + TcxCheckComboBoxPopupWindow = class(TcxComboBoxPopupWindow) + public + property ViewInfo; + property SysPanelStyle; + end; + + { TcxCustomCheckComboBox } + + TcxCustomCheckComboBox = class(TcxCustomComboBox) + private + FCheckBorderStyle: TcxEditCheckBoxBorderStyle; + FNativeStyle: Boolean; + FStates: TcxCheckStates; + FStatesItems: Boolean; + function GetActiveProperties: TcxCustomCheckComboBoxProperties; + function GetLookupData: TcxCheckComboBoxLookupData; + function GetProperties: TcxCustomCheckComboBoxProperties; + procedure SetProperties(Value: TcxCustomCheckComboBoxProperties); + protected + procedure CalculateDrawCheckParams; + function GetValue: Variant; virtual; // deprecated + procedure PopupControlsLookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); override; + procedure PopupWindowShowed(Sender: TObject); override; + procedure PropertiesChanged(Sender: TObject); override; + function RefreshContainer(const P: TPoint; Button: TcxMouseButton; + Shift: TShiftState; AIsMouseEvent: Boolean): Boolean; override; + procedure SetItemIndex(Value: Integer); override; + procedure SetValue(const AValue: Variant); virtual; // deprecated + procedure SynchronizeDisplayValue; override; + procedure SynchronizeEditValue; override; + procedure UpdateDrawValue; override; + function ClickCheck(AItemIndex: Integer): Boolean; virtual; + function DoClickCheck(AItemIndex: Integer): Boolean; + function GetEditingValue: TcxEditValue; override; + procedure HandleSelectItem(Sender: TObject); override; + procedure Initialize; override; + procedure InitializePopupWindow; override; + function InternalGetText: string; override; + function InternalSetText(const Value: string): Boolean; override; + procedure InternalValidateDisplayValue(const ADisplayValue: TcxEditValue); override; + function IsEditValueStored: Boolean; override; + procedure KeyPress(var Key: Char); override; + property LookupData: TcxCheckComboBoxLookupData read GetLookupData; + property Value: Variant read GetValue write SetValue stored False; // deprecated + procedure CloseUp(AReason: TcxEditCloseUpReason); override; + property StatesItems: Boolean read FStatesItems write FStatesItems stored False; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + function GetItemState(AIndex: Integer): TcxCheckBoxState; // deprecated + procedure SetItemState(AIndex: Integer; AState: TcxCheckBoxState); // deprecated + property ActiveProperties: TcxCustomCheckComboBoxProperties + read GetActiveProperties; + property Properties: TcxCustomCheckComboBoxProperties read GetProperties + write SetProperties; + property States[AIndex: Integer]: TcxCheckBoxState read GetItemState + write SetItemState; + end; + + { TcxCheckComboBox } + + TcxCheckComboBox = class(TcxCustomCheckComboBox) + private + function GetActiveProperties: TcxCheckComboBoxProperties; + function GetProperties: TcxCheckComboBoxProperties; + procedure SetProperties(Value: TcxCheckComboBoxProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxCheckComboBoxProperties + read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property EditValue; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxCheckComboBoxProperties read GetProperties + write SetProperties; + property ShowHint; + property StatesItems; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Value; // deprecated + property Visible; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + + { TcxFilterChecksHelper } + + TcxFilterChecksHelper = class(TcxFilterComboBoxHelper) + protected + class function GetEditValueFormat( + AEditProperties: TcxCustomEditProperties): TcxCheckStatesValueFormat; virtual; + class function GetItems( + AEditProperties: TcxCustomEditProperties): IcxCheckItems; virtual; + class procedure InitializeItems(AProperties, + AEditProperties: TcxCustomEditProperties); virtual; + public + class function GetFilterEditClass: TcxCustomEditClass; override; + class function GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; override; + class procedure InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); override; + end; + + { TcxFilterCheckComboBoxHelper } + + TcxFilterCheckComboBoxHelper = class(TcxFilterChecksHelper) + protected + class function GetEditValueFormat( + AEditProperties: TcxCustomEditProperties): TcxCheckStatesValueFormat; override; + class function GetItems( + AEditProperties: TcxCustomEditProperties): IcxCheckItems; override; + end; + +const + cxCheckComboValuesDelimiter = ';'; + +implementation + +uses + dxThemeManager; + +{ TcxCheckComboBoxItem } + +procedure TcxCheckComboBoxItem.Assign(Source: TPersistent); +begin + if Source is TcxCheckComboBoxItem then + ShortDescription := TcxCheckComboBoxItem(Source).ShortDescription; + inherited Assign(Source); +end; + +function TcxCheckComboBoxItem.GetDisplayDescription: string; +begin + if ShortDescription <> '' then + Result := ShortDescription + else + Result := Description; +end; + +function TcxCheckComboBoxItem.GetDescription: TCaption; +begin + Result := Caption; +end; + +procedure TcxCheckComboBoxItem.SetDescription(const Value: TCaption); +begin + Caption := Value; +end; + +procedure TcxCheckComboBoxItem.SetShortDescription(const Value: TCaption); +begin + if Value <> FShortDescription then + begin + FShortDescription := Value; + DoChanged(Collection, copChanged); + end; +end; + +{ TcxCheckComboBoxItems } + +function TcxCheckComboBoxItems.GetItems(Index: Integer): TcxCheckComboBoxItem; +begin + Result := TcxCheckComboBoxItem(inherited Items[Index]); +end; + +procedure TcxCheckComboBoxItems.SetItems(Index: Integer;const Value: TcxCheckComboBoxItem); +begin + inherited Items[Index] := Value; +end; + +function TcxCheckComboBoxItems.Add: TcxCheckComboBoxItem; +begin + Result := TcxCheckComboBoxItem(inherited Add); +end; + +function TcxCheckComboBoxItems.AddCheckItem(const ADescription: TCaption; + const AShortDescription: TCaption = ''): TcxCheckComboBoxItem; +begin + Result := Add; + Result.Description := ADescription; + Result.ShortDescription := AShortDescription; +end; + +{ TcxCustomCheckComboBoxViewData } + +procedure TcxCustomCheckComboBoxViewData.Calculate(ACanvas: TcxCanvas; + const ABounds: TRect; const P: TPoint; Button: TcxMouseButton; + Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); +begin + if IsRectEmpty(ABounds) then + begin + inherited; + Exit; + end; + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, AIsMouseEvent); + if (ABounds.Right = MaxInt) or (ABounds.Bottom = MaxInt) then Exit; +end; + +function TcxCustomCheckComboBoxViewData.GetProperties: TcxCustomCheckComboBoxProperties; +begin + Result := TcxCustomCheckComboBoxProperties(FProperties); +end; + +function TcxCustomCheckComboBoxViewData.InternalEditValueToDisplayText( + AEditValue: TcxEditValue): string; +var + ASender: TObject; +begin + if IsInplace then + ASender := nil + else + ASender := Edit; + Properties.CalculateCheckStatesByEditValue(ASender, AEditValue, CheckStates); + Result := Properties.CalculateDisplayValueByCheckStates(CheckStates); + Properties.DisplayValueToDisplayText(Result); +end; + +function TcxCustomCheckComboBoxViewData.IsComboBoxStyle: Boolean; +begin + Result := True; +end; + +{ TcxCustomCheckComboBoxListBox } + +constructor TcxCustomCheckComboBoxListBox.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FCapturedCheckIndex := -1; + FHotCheckIndex := -1; + FInternalUpdate := False; + FPressedCheckIndex := -1; + Style := lbOwnerDrawFixed; +end; + +destructor TcxCustomCheckComboBoxListBox.Destroy; +begin + EndMouseTracking(Self); + inherited Destroy; +end; + +function TcxCustomCheckComboBoxListBox.GetItemHeight(AIndex: Integer = -1): Integer; +begin + if Edit.ActiveProperties.ItemHeight > 0 then + Result := Edit.ActiveProperties.ItemHeight + else + Result := inherited GetItemHeight(AIndex); + if Result < FCheckSize.cy + 2 then + Result := FCheckSize.cy + 2; +end; + +function TcxCustomCheckComboBoxListBox.GetItemWidth(AIndex: Integer): Integer; +begin + Result := inherited GetItemWidth(AIndex); + Inc(Result, ItemHeight); +end; + +procedure TcxCustomCheckComboBoxListBox.MouseTrackingMouseLeave; +begin + InternalMouseMove([], -1, -1); + EndMouseTracking(Self); +end; + +procedure TcxCustomCheckComboBoxListBox.CheckHotTrack; +var + P: TPoint; +begin + P := ScreenToClient(InternalGetCursorPos); + InternalMouseMove(InternalGetShiftState, P.X, P.Y); +end; + +function TcxCustomCheckComboBoxListBox.DoMouseWheel(Shift: TShiftState; + WheelDelta: Integer; MousePos: TPoint): Boolean; +begin + Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos); + CheckHotTrack; +end; + +procedure TcxCustomCheckComboBoxListBox.DrawItem(Index: Integer; Rect: TRect; + State: TOwnerDrawState); + + function GetCheckState(AIsItemEnabled: Boolean): TcxEditCheckState; + begin + if not AIsItemEnabled then + Result := ecsDisabled + else + if FHotCheckIndex = Index then + Result := ecsHot + else + if FPressedCheckIndex = Index then + Result := ecsPressed + else + Result := ecsNormal; + end; + + function GetCheckBorderStyle(ACheckState: TcxEditCheckState): TcxEditCheckBoxBorderStyle; + begin + if not Edit.FNativeStyle and (Edit.FCheckBorderStyle = ebsFlat) and + (ACheckState in [ecsHot, ecsPressed]) then + Result := ebs3D + else + Result := Edit.FCheckBorderStyle; + end; + +var + ACheckState: TcxEditCheckState; + AFlags: Longint; + AText: string; + ATextRect : TRect; +begin + if DoDrawItem(Index, Rect, State) then + Exit; + with Edit.ActiveProperties do + begin + Canvas.FillRect(Rect); + FCheckPaintHelper.Glyph := Glyph; + FCheckPaintHelper.GlyphCount := GlyphCount; + ATextRect := FCheckPaintHelper.CalcTextRect(Rect, Edit.FStates[Index]); + AText := GetItem(Index); + AFlags := DrawTextBiDiModeFlags(DT_SINGLELINE or DT_LEFT or DT_VCENTER or DT_NOPREFIX); + if not Items[Index].Enabled then + Canvas.Font.Color := Edit.StyleDisabled.TextColor; + cxDrawText(Canvas.Handle, AText, ATextRect, AFlags); + if Rect.Top >= 0 then + begin + ACheckState := GetCheckState(Items[Index].Enabled); + SaveCanvasParametersForFocusRect; + DrawEditCheck(Canvas, GetCheckRect(Rect, True), Edit.FStates[Index], + ACheckState, Glyph, GlyphCount, GetCheckBorderStyle(ACheckState), + Edit.FNativeStyle, clBtnText, Color, False, False, False, False, + Edit.Style.LookAndFeel.SkinPainter); + RestoreCanvasParametersForFocusRect; + end; + end; +end; + +procedure TcxCustomCheckComboBoxListBox.FullRepaint; +var + R: TRect; +begin + if HandleAllocated then + begin + R := GetControlRect(Self); + InvalidateRect(Handle, @R, True); + end; +end; + +function TcxCustomCheckComboBoxListBox.GetCheckAt(X, Y: Integer): Integer; +begin + Result := ItemAtPos(Point(X, Y), True); +end; + +function TcxCustomCheckComboBoxListBox.GetCheckRect(const R: TRect; AReturnFullRect: Boolean): TRect; +begin +// ToDo RightToLeftAlignment + with R do + begin + Result.Top := (Bottom - Top - FCheckSize.cy) div 2; + Result.Left := Result.Top; + Inc(Result.Top, Top); + Result.Bottom := Result.Top + FCheckSize.cy; + if Result.Left < 1 then + Result.Left := 1; + Result.Right := Result.Left + FCheckSize.cx; + end; + if AReturnFullRect then + InflateRect(Result, FCheckBorderOffset, FCheckBorderOffset); +end; + +procedure TcxCustomCheckComboBoxListBox.InternalMouseMove(Shift: TShiftState; X, Y: Integer); +var + ANewHotCheckIndex, ANewPressedCheckIndex: Integer; +begin + ANewHotCheckIndex := FHotCheckIndex; + ANewPressedCheckIndex := FPressedCheckIndex; + if FCapturedCheckIndex <> -1 then + begin + ANewHotCheckIndex := -1; + if GetCheckAt(X, Y) = FCapturedCheckIndex then + ANewPressedCheckIndex := FCapturedCheckIndex + else + ANewPressedCheckIndex := -1; + end; + if (GetCaptureControl <> Self) and (Shift = []) then + ANewHotCheckIndex := GetCheckAt(X, Y); + SynchronizeCheckStates(ANewHotCheckIndex, ANewPressedCheckIndex); +end; + +procedure TcxCustomCheckComboBoxListBox.InvalidateCheck(Index: Integer); +var + R: TRect; +begin + R := ItemRect(Index); + R := GetCheckRect(R, False); + InvalidateRect(Handle, @R, False); +end; + +procedure TcxCustomCheckComboBoxListBox.KeyPress(var Key: Char); +begin + if (ItemIndex <> -1) and Assigned(Edit) then + begin + if (Key = Char(VK_SPACE)) then + begin + if not (Edit.ActiveProperties.Items[ItemIndex].Enabled) then Exit; + FInternalUpdate := True; + UpdateItemState(ItemIndex); + FInternalUpdate := False; + Key := #0; + end; + end + else + inherited KeyPress(Key); +end; + +procedure TcxCustomCheckComboBoxListBox.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + inherited LookAndFeelChanged(Sender, AChangedValues); + RecreateWindow; +end; + +procedure TcxCustomCheckComboBoxListBox.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +var + ANewPressedCheckIndex: Integer; +begin + inherited MouseDown(Button, Shift, X, Y); + if Button = mbLeft then + begin + ANewPressedCheckIndex := GetCheckAt(X, Y); + FCapturedCheckIndex := ANewPressedCheckIndex; + end + else + ANewPressedCheckIndex := -1; + SynchronizeCheckStates(-1, ANewPressedCheckIndex); +end; + +procedure TcxCustomCheckComboBoxListBox.MouseMove(Shift: TShiftState; X, Y: Integer); +var + APopupMouseMoveLocked: Boolean; +begin + APopupMouseMoveLocked := Edit.PopupMouseMoveLocked; + inherited MouseMove(Shift, X, Y); + if not APopupMouseMoveLocked then + begin + InternalMouseMove(Shift, X, Y); + BeginMouseTracking(Self, GetControlRect(Self), Self); + end; +end; + +procedure TcxCustomCheckComboBoxListBox.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + AItemIndex: Integer; + ANewHotCheckIndex, ANewPressedCheckIndex: Integer; +begin + inherited MouseUp(Button, Shift, X, Y); + ANewPressedCheckIndex := FPressedCheckIndex; + if Button = mbLeft then + begin + SetCaptureControl(nil); + AItemIndex := ItemAtPos(Point(X, Y), True); + if (AItemIndex <> -1) and Edit.ActiveProperties.Items[ItemIndex].Enabled then + begin + Edit.LookupData.InternalSetCurrentKey(AItemIndex); + if AItemIndex = FPressedCheckIndex then + UpdateItemState(AItemIndex); + end; + ANewPressedCheckIndex := -1; + end; + if Shift = [] then + ANewHotCheckIndex := GetCheckAt(X, Y) + else + ANewHotCheckIndex := -1; + SynchronizeCheckStates(ANewHotCheckIndex, ANewPressedCheckIndex); +end; + +procedure TcxCustomCheckComboBoxListBox.RecreateWindow; +begin + with Edit do + begin + FCheckSize := GetEditCheckSize(Self.Canvas, PopupControlsLookAndFeel.NativeStyle, + ActiveProperties.Glyph, ActiveProperties.GlyphCount, PopupControlsLookAndFeel.SkinPainter); + FCheckBorderOffset := GetEditCheckBorderOffset(TcxContainerBorderStyle(FCheckBorderStyle), + FNativeStyle, VerifyBitmap(ActiveProperties.Glyph) and (ActiveProperties.GlyphCount > 0), + LookAndFeel.SkinPainter); + end; + FCheckSize.cx := FCheckSize.cx - FCheckBorderOffset * 2; + FCheckSize.cy := FCheckSize.cy - FCheckBorderOffset * 2; + + ItemHeight := GetItemHeight; + if Edit.IsOnMeasureItemEventAssigned then + Style := lbOwnerDrawVariable + else + Style := lbOwnerDrawFixed; +end; + +procedure TcxCustomCheckComboBoxListBox.SetItemIndex(const Value: Integer); +begin + if not FInternalUpdate then + inherited SetItemIndex(Value); +end; + +procedure TcxCustomCheckComboBoxListBox.SynchronizeCheckStates(ANewHotCheckIndex, + ANewPressedIndex: Integer); +begin + if ANewHotCheckIndex <> FHotCheckIndex then + begin + InvalidateCheck(FHotCheckIndex); + FHotCheckIndex := ANewHotCheckIndex; + InvalidateCheck(FHotCheckIndex); + end; + if ANewPressedIndex <> FPressedCheckIndex then + begin + InvalidateCheck(FPressedCheckIndex); + FPressedCheckIndex := ANewPressedIndex; + InvalidateCheck(FPressedCheckIndex); + end; +end; + +procedure TcxCustomCheckComboBoxListBox.UpdateItemState(const AIndex: Integer); +var + ACurrentState: TcxCheckBoxState; +begin + if Edit.ClickCheck(AIndex) then + begin + with Edit.ActiveProperties do + begin + ACurrentState := Edit.FStates[AIndex]; + Edit.FStates[AIndex] := + FCheckPaintHelper.GetNextState(ACurrentState); + Edit.SynchronizeEditValue; + Edit.ModifiedAfterEnter := True; + end; + if Edit.ActiveProperties.ImmediatePost and Edit.CanPostEditValue then + Edit.InternalPostEditValue; + InvalidateCheck(AIndex); + end; +end; + +function TcxCustomCheckComboBoxListBox.GetEdit: TcxCustomCheckComboBox; +begin + Result := TcxCustomCheckComboBox(inherited Edit); +end; + +procedure TcxCustomCheckComboBoxListBox.LBGetTextLen(var Message: TMessage); +begin + Message.Result := 0; +end; + +procedure TcxCustomCheckComboBoxListBox.CMMouseEnter(var Message: TMessage); +begin + inherited; + BeginMouseTracking(Self, GetControlRect(Self), Self); +end; + +procedure TcxCustomCheckComboBoxListBox.CMMouseLeave(var Message: TMessage); +begin + inherited; + InternalMouseMove([], -1, -1); + EndMouseTracking(Self); +end; + +{ TcxCheckComboBoxLookupData } + +procedure TcxCheckComboBoxLookupData.TextChanged; +begin +end; + +function TcxCheckComboBoxLookupData.GetListBoxClass: TcxCustomEditListBoxClass; +begin + Result := TcxCustomCheckComboBoxListBox; +end; + +function TcxCheckComboBoxLookupData.GetItem(Index: Integer): string; +begin + with TcxCustomCheckComboBox(Edit).ActiveProperties do + if (Index > -1) and (Index < Items.Count) then + Result := Items[Index].Description + else + Result := '' +end; + +function TcxCheckComboBoxLookupData.GetItemCount: Integer; +begin + Result := TcxCustomCheckComboBox(Edit).ActiveProperties.Items.Count; +end; + +{ TcxCheckComboBox } + +class function TcxCheckComboBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCheckComboBoxProperties; +end; + +function TcxCheckComboBox.GetActiveProperties: TcxCheckComboBoxProperties; +begin + Result := TcxCheckComboBoxProperties(InternalGetActiveProperties); +end; + +function TcxCheckComboBox.GetProperties: TcxCheckComboBoxProperties; +begin + Result := TcxCheckComboBoxProperties(FProperties); +end; + +procedure TcxCheckComboBox.SetProperties(Value: TcxCheckComboBoxProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxCheckPaintHelper } + +constructor TcxCheckPaintHelper.Create(AOwner : TPersistent); +begin + inherited; + FStyle := TcxCustomEditStyle.Create(Self, False); +end; + +destructor TcxCheckPaintHelper.Destroy; +begin + FreeAndNil(FStyle); + inherited Destroy; +end; + +procedure TcxCheckPaintHelper.SetStyle(Value: TcxCustomEditStyle); +begin + FStyle.Assign(Value); +end; + +function TcxCheckPaintHelper.GetNextState(Value: TcxCheckBoxState): TcxCheckBoxState; +begin + case Value of + cbsChecked: + Result := cbsUnchecked; + cbsGrayed: + Result := cbsUnchecked; + else + Result := cbsChecked; + end; +end; + +function TcxCheckPaintHelper.GetCheckWidth: Integer; +begin + Result := 13; +end; + +function TcxCheckPaintHelper.CalcTextRect(const ARect: TRect; + const ACheckState: TcxCheckBoxState): TRect; +begin + Result := ARect; + Inc(Result.Left, RectHeight(ARect) + 2); +end; + +function TcxCheckPaintHelper.CalcCheckPoint(const ARect: TRect; + const ACheckState: TcxCheckBoxState): TPoint; +var + FCenterPos : Integer; +begin + FCenterPos := CalcCenterPosHeight(ARect, GetCheckWidth); + Result.X := ARect.Left + FCenterPos; + Result.Y := ARect.Top + FCenterPos; +end; + +function TcxCheckPaintHelper.IsClickInCheck(const AItemRect: TRect; + const ACheckState: TcxCheckBoxState; X, Y: Integer; + const AUseRightToLeftAlignment: Boolean = False): Boolean; +var + FCheckRect : TRect; + FCenterPos : Integer; +begin + FCenterPos := CalcCenterPosHeight(AItemRect, GetCheckWidth); + if not AUseRightToLeftAlignment then + FCheckRect := Bounds(AItemRect.Left + FCenterPos, AItemRect.Top + FCenterPos, + GetCheckWidth, GetCheckWidth) + else + FCheckRect := Bounds(AItemRect.Right - (FCenterPos * 3), AItemRect.Top + FCenterPos, + GetCheckWidth, GetCheckWidth); + Result := (X >= FCheckRect.Left) and (X <= FCheckRect.Right) and + (Y >= FCheckRect.Top) and (Y <= FCheckRect.Bottom); +end; + +{ TcxCustomCheckComboBoxProperties } + +constructor TcxCustomCheckComboBoxProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + DropDownListStyle := lsFixedList; + FDelimiter := cxCheckComboValuesDelimiter; + FEditValueFormat := cvfInteger; + FShowEmptyText := True; + FEmptySelectionText := cxGetResourceString(@cxSCheckComboBoxEmptySelectionText); + FCheckPaintHelper := TcxCheckPaintHelper.Create(nil); + FItems := TcxCheckComboBoxItems.Create(Self, TcxCheckComboBoxItem); + FGlyphCount := 6; +end; + +destructor TcxCustomCheckComboBoxProperties.Destroy; +begin + FreeAndNil(FItems); + FreeAndNil(FCheckPaintHelper); + if Assigned(FGlyph) then FreeAndNil(FGlyph); + inherited; +end; + +function TcxCustomCheckComboBoxProperties.GetGlyph: TBitmap; +begin + if FGlyph = nil then + begin + FGlyph := TBitmap.Create; + FGlyph.OnChange := GlyphChanged; + end; + Result := FGlyph; +end; + +procedure TcxCustomCheckComboBoxProperties.GlyphChanged(Sender: TObject); +begin + Changed; +end; + +function TcxCustomCheckComboBoxProperties.IsDelimiterStored: Boolean; +begin + Result := FDelimiter <> cxCheckComboValuesDelimiter; +end; + +function TcxCustomCheckComboBoxProperties.IsEmptySelectionTextStored: Boolean; +begin + Result := FEmptySelectionText <> + cxGetResourceString(@cxSCheckComboBoxEmptySelectionText); +end; + +procedure TcxCustomCheckComboBoxProperties.SetGlyph(Value: TBitmap); +begin + if Value = nil then + FreeAndNil(FGlyph) + else + Glyph.Assign(Value); + Changed; +end; + +procedure TcxCustomCheckComboBoxProperties.SetGlyphCount(Value: Integer); +begin + if FGlyphCount <> Value then + begin + FGlyphCount := Value; + if FGlyph <> nil then + Changed; + end; +end; + +procedure TcxCustomCheckComboBoxProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomCheckComboBoxProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with TcxCustomCheckComboBoxProperties(Source) do + begin + Self.Delimiter := Delimiter; + Self.EditValueFormat := EditValueFormat; + Self.Glyph := Glyph; + Self.GlyphCount := GlyphCount; + Self.ShowEmptyText := ShowEmptyText; + Self.EmptySelectionText := EmptySelectionText; + Self.Items.Assign(Items); + Self.OnClickCheck := OnClickCheck; + Self.OnEditValueToStates := OnEditValueToStates; + Self.OnStatesToEditValue := OnStatesToEditValue; + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +class function TcxCustomCheckComboBoxProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxCheckComboBox; +end; + +function TcxCustomCheckComboBoxProperties.GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; +begin + Result := evsValue; +end; + +function TcxCustomCheckComboBoxProperties.GetSupportedOperations: TcxEditSupportedOperations; +begin + Result := inherited GetSupportedOperations; + Include(Result, esoSortingByDisplayText); +end; + +class function TcxCustomCheckComboBoxProperties.GetLookupDataClass: TcxInterfacedPersistentClass; +begin + Result := TcxCheckComboBoxLookupData; +end; + +class function TcxCustomCheckComboBoxProperties.GetPopupWindowClass: TcxCustomEditPopupWindowClass; +begin + Result := TcxCheckComboBoxPopupWindow; +end; + +class function TcxCustomCheckComboBoxProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxCustomCheckComboBoxViewData; +end; + +function TcxCustomCheckComboBoxProperties.HasDisplayValue: Boolean; +begin + Result := False; +end; + +procedure TcxCustomCheckComboBoxProperties.SetDelimiter(Value: string); +begin + if FDelimiter <> Value then + begin + FDelimiter := Value; + Changed; + end; +end; + +procedure TcxCustomCheckComboBoxProperties.SetEditValueFormat(Value: TcxCheckStatesValueFormat); +begin + if Value <> FEditValueFormat then + begin + FEditValueFormat := Value; + Items.InternalNotify(nil, -1, copChanged); + end; +end; + +procedure TcxCustomCheckComboBoxProperties.SetEmptySelectionText(Value: string); +begin + if FEmptySelectionText <> Value then + begin + FEmptySelectionText := Value; + Changed; + end; +end; + +procedure TcxCustomCheckComboBoxProperties.SetShowEmptyText(Value: Boolean); +begin + if FShowEmptyText <> Value then + begin + FShowEmptyText := Value; + Changed; + end; +end; + +procedure TcxCustomCheckComboBoxProperties.SetItems(const Value: TcxCheckComboBoxItems); +begin + FItems.Assign(Value); + Changed; +end; + +procedure TcxCustomCheckComboBoxProperties.CalculateCheckStatesByEditValue( + Sender: TObject; const AEditValue: TcxEditValue; var ACheckStates: TcxCheckStates); +begin + if Assigned(OnEditValueToStates) then + begin + SetLength(ACheckStates, Items.Count); + OnEditValueToStates(Sender, AEditValue, ACheckStates) + end + else + cxCheckBox.CalculateCheckStates(AEditValue, Items, EditValueFormat, + ACheckStates); +end; + +function TcxCustomCheckComboBoxProperties.CalculateDisplayValueByCheckStates( + const ACheckStates: TcxCheckStates): string; +var + I: Integer; +begin + Result := ''; + for I := 0 to Items.Count - 1 do + begin + if ACheckStates[I] <> cbsChecked then + Continue; + if Result <> '' then + Result := Result + FDelimiter; + Result := Result + Items[I].GetDisplayDescription; + end; + if (Result = '') and ShowEmptyText then + Result := EmptySelectionText; +end; + +function TcxCustomCheckComboBoxProperties.CalculateEditValueByCheckStates( + Sender: TObject; const ACheckStates: TcxCheckStates): TcxEditValue; +begin + if Assigned(OnStatesToEditValue) then + OnStatesToEditValue(Sender, ACheckStates, Result) + else + Result := cxCheckBox.CalculateCheckStatesValue(ACheckStates, Items, + EditValueFormat); +end; + +function TcxCustomCheckComboBoxProperties.IsEditValueValid(var EditValue: TcxEditValue; + AEditFocused: Boolean): Boolean; +begin + Result := True; +end; + +procedure TcxCustomCheckComboBoxProperties.PrepareDisplayValue( + const AEditValue: TcxEditValue; var DisplayValue: TcxEditValue; AEditFocused: Boolean); +begin + CalculateCheckStatesByEditValue(nil, AEditValue, CheckStates); + DisplayValue := CalculateDisplayValueByCheckStates(CheckStates); +end; + +{ TcxCustomCheckComboBox } + +class function TcxCustomCheckComboBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomCheckComboBoxProperties; +end; + +function TcxCustomCheckComboBox.GetItemState(AIndex: Integer): TcxCheckBoxState; +begin + Result := FStates[AIndex]; +end; + +procedure TcxCustomCheckComboBox.SetItemState(AIndex: Integer; AState: TcxCheckBoxState); +begin + if AState = cbsGrayed then Exit; + if FStates[AIndex] <> AState then + begin + FStates[AIndex] := AState; + SynchronizeEditValue; + end; +end; + +function TcxCustomCheckComboBox.ClickCheck(AItemIndex: Integer): Boolean; +begin + Result := CanModify and DoClickCheck(AItemIndex) and DoEditing; +end; + +function TcxCustomCheckComboBox.DoClickCheck(AItemIndex: Integer): Boolean; + + function InternalDoClickCheck(AProperties: TcxCustomCheckComboBoxProperties; + AItemIndex: Integer): Boolean; + begin + Result := True; + if Assigned(AProperties.OnClickCheck) then + AProperties.OnClickCheck(Self, AItemIndex, Result); + end; + +var + AAllowToggle1, AAllowToggle2: Boolean; +begin + AAllowToggle1 := InternalDoClickCheck(Properties, AItemIndex); + if RepositoryItem <> nil then + AAllowToggle2 := InternalDoClickCheck( + TcxCustomCheckComboBoxProperties(RepositoryItem.Properties), AItemIndex) + else + AAllowToggle2 := True; + Result := AAllowToggle1 and AAllowToggle2; +end; + +function TcxCustomCheckComboBox.GetEditingValue: TcxEditValue; +begin + Result := EditValue; +end; + +procedure TcxCustomCheckComboBox.HandleSelectItem(Sender: TObject); +begin +end; + +procedure TcxCustomCheckComboBox.Initialize; +begin + inherited Initialize; + FEditValue := 0; + ControlStyle := ControlStyle - [csClickEvents]; + CalculateDrawCheckParams; +end; + +procedure TcxCustomCheckComboBox.InitializePopupWindow; +begin + inherited InitializePopupWindow; + (PopupWindow as TcxCheckComboBoxPopupWindow).SysPanelStyle := ActiveProperties.PopupSizeable; +end; + +function TcxCustomCheckComboBox.InternalGetText: string; +begin + if IsDestroying then + Result := '' + else + Result := ViewInfo.Text; +end; + +function TcxCustomCheckComboBox.InternalSetText(const Value: string): Boolean; +begin + Result := False; +end; + +procedure TcxCustomCheckComboBox.InternalValidateDisplayValue(const ADisplayValue: TcxEditValue); +begin +end; + +function TcxCustomCheckComboBox.IsEditValueStored: Boolean; +begin + Result := (ActiveProperties.EditValueFormat = cvfInteger) and (EditValue <> 0) or + (ActiveProperties.EditValueFormat <> cvfInteger) and (VarToStr(EditValue) <> ''); +end; + +procedure TcxCustomCheckComboBox.KeyPress(var Key: Char); +begin + if (Key = Char(VK_SPACE)) and HasPopupWindow then + begin + if Assigned(OnKeyPress) then + OnKeyPress(Self, Key); + (LookupData.ActiveControl as TcxCustomCheckComboBoxListBox).KeyPress(Key) + end + else + inherited KeyPress(Key); +end; + +procedure TcxCustomCheckComboBox.CloseUp(AReason: TcxEditCloseUpReason); +begin + if HasPopupWindow then + begin + FCloseUpReason := AReason; + PopupWindow.CloseUp; + if not ActiveProperties.AlwaysPostEditValue and ActiveProperties.ImmediatePost and + CanPostEditValue and ValidateEdit(True) then + InternalPostEditValue; + end; +end; + +function TcxCustomCheckComboBox.GetProperties: TcxCustomCheckComboBoxProperties; +begin + Result := TcxCustomCheckComboBoxProperties(FProperties); +end; + +function TcxCustomCheckComboBox.GetActiveProperties: TcxCustomCheckComboBoxProperties; +begin + Result := TcxCustomCheckComboBoxProperties(InternalGetActiveProperties); +end; + +function TcxCustomCheckComboBox.GetLookupData: TcxCheckComboBoxLookupData; +begin + Result := TcxCheckComboBoxLookupData(FLookupData); +end; + +procedure TcxCustomCheckComboBox.SetProperties(Value: TcxCustomCheckComboBoxProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomCheckComboBox.CalculateDrawCheckParams; +const + ABorderStyleMap: array[TcxLookAndFeelKind] of TcxEditCheckBoxBorderStyle = + (ebsFlat, ebs3D, ebsUltraFlat, ebsOffice11); +begin + with PopupControlsLookAndFeel do + begin + FNativeStyle := NativeStyle and AreVisualStylesAvailable([totButton, totComboBox]); + if not FNativeStyle then + FCheckBorderStyle := ABorderStyleMap[Kind]; + end; +end; + +function TcxCustomCheckComboBox.GetValue: Variant; +begin + Result := EditValue; +end; + +procedure TcxCustomCheckComboBox.PopupControlsLookAndFeelChanged( + Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); +begin + inherited PopupControlsLookAndFeelChanged(Sender, AChangedValues); + if not IsDestroying then + CalculateDrawCheckParams; +end; + +procedure TcxCustomCheckComboBox.PopupWindowShowed(Sender: TObject); +begin + inherited PopupWindowShowed(Sender); + TcxCustomCheckComboBoxListBox(ILookupData.ActiveControl).CheckHotTrack; +end; + +procedure TcxCustomCheckComboBox.PropertiesChanged(Sender: TObject); +begin + with ActiveProperties.Items do + if ItemChanged and (ChangedItemOperation = copDelete) and (ChangedItemIndex < Length(FStates) - 1) then + Move(FStates[ChangedItemIndex + 1], FStates[ChangedItemIndex], + (ActiveProperties.Items.Count - 1 - ChangedItemIndex) * SizeOf(TcxCheckBoxState)); + SetLength(FStates, ActiveProperties.Items.Count); + + inherited PropertiesChanged(Sender); + + if ModifiedAfterEnter then + UpdateDrawValue + else + if IsDBEdit then + SynchronizeDisplayValue + else + EditValue := ActiveProperties.CalculateEditValueByCheckStates( + GetStandaloneEventSender(Self), FStates); +end; + +function TcxCustomCheckComboBox.RefreshContainer(const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AIsMouseEvent: Boolean): Boolean; +begin + Result := inherited RefreshContainer(P, Button, Shift, AIsMouseEvent); + ActiveProperties.FCheckPaintHelper.Style.Assign(ActiveStyle); +end; + +procedure TcxCustomCheckComboBox.SetItemIndex(Value: Integer); +begin + LookupData.InternalSetCurrentKey(Value); +end; + +procedure TcxCustomCheckComboBox.SetValue(const AValue: Variant); +begin + InternalEditValue := AValue; +end; + +procedure TcxCustomCheckComboBox.SynchronizeDisplayValue; +begin + ActiveProperties.CalculateCheckStatesByEditValue( + GetStandaloneEventSender(Self), EditValue, FStates); + UpdateDrawValue; +end; + +procedure TcxCustomCheckComboBox.SynchronizeEditValue; +begin + InternalEditValue := ActiveProperties.CalculateEditValueByCheckStates( + GetStandaloneEventSender(Self), FStates); +end; + +procedure TcxCustomCheckComboBox.UpdateDrawValue; +begin + TcxCustomTextEditViewInfo(ViewInfo).SelLength := 0; + TcxCustomTextEditViewInfo(ViewInfo).Text := + ActiveProperties.CalculateDisplayValueByCheckStates(FStates); + with TcxCustomTextEditViewInfo(ViewInfo) do + Self.ActiveProperties.DisplayValueToDisplayText(Text); + with TcxCustomTextEditViewInfo(ViewInfo) do + TextOutData.Initialized := False; + InvalidateRect(TcxCustomTextEditViewInfo(ViewInfo).ClientRect, False); +end; + +{ TcxFilterChecksHelper } + +class function TcxFilterChecksHelper.GetFilterEditClass: TcxCustomEditClass; +begin + Result := TcxCheckComboBox; +end; + +class function TcxFilterChecksHelper.GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; +begin + Result := [fcoEqual, fcoNotEqual, fcoBlanks, fcoNonBlanks]; + if AExtendedSet then + Result := Result + [fcoInList, fcoNotInList]; +end; + +class procedure TcxFilterChecksHelper.InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); +begin + inherited InitializeProperties(AProperties, AEditProperties, AHasButtons); + TcxCustomCheckComboBoxProperties(AProperties).EditValueFormat := + GetEditValueFormat(AEditProperties); + with TcxCustomCheckComboBoxProperties(AProperties) do + begin + Items.Clear; + Buttons.Clear; + Buttons.Add; + Buttons[0].Kind := bkDown; + DropDownListStyle := lsFixedList; + end; + InitializeItems(AProperties, AEditProperties); +end; + +class function TcxFilterChecksHelper.GetEditValueFormat( + AEditProperties: TcxCustomEditProperties): TcxCheckStatesValueFormat; +begin + Result := cvfCaptions; +end; + +class function TcxFilterChecksHelper.GetItems( + AEditProperties: TcxCustomEditProperties): IcxCheckItems; +begin + Result := nil; +end; + +class procedure TcxFilterChecksHelper.InitializeItems(AProperties, + AEditProperties: TcxCustomEditProperties); +var + AItems: IcxCheckItems; + I: Integer; +begin + AItems := GetItems(AEditProperties); + if AItems = nil then + Exit; + for I := 0 to AItems.Count - 1 do + TcxCustomCheckComboBoxProperties(AProperties).Items.Add.Description := + AItems.Captions[I]; +end; + +{ TcxFilterCheckComboBoxHelper } + +class function TcxFilterCheckComboBoxHelper.GetEditValueFormat( + AEditProperties: TcxCustomEditProperties): TcxCheckStatesValueFormat; +begin + Result := TcxCustomCheckComboBoxProperties(AEditProperties).EditValueFormat +end; + +class function TcxFilterCheckComboBoxHelper.GetItems( + AEditProperties: TcxCustomEditProperties): IcxCheckItems; +begin + Result := TcxCustomCheckComboBoxProperties(AEditProperties).Items; +end; + +initialization + GetRegisteredEditProperties.Register(TcxCheckComboBoxProperties, scxSEditRepositoryCheckComboBox); + FilterEditsController.Register(TcxCheckComboBoxProperties, TcxFilterCheckComboBoxHelper); + +finalization + FilterEditsController.Unregister(TcxCheckComboBoxProperties, TcxFilterCheckComboBoxHelper); + GetRegisteredEditProperties.Unregister(TcxCheckComboBoxProperties); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxCheckGroup.pas b/official/x.35/ExpressEditors Library 5/Sources/cxCheckGroup.pas new file mode 100644 index 00000000..83fb4d05 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxCheckGroup.pas @@ -0,0 +1,1284 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxCheckGroup; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, cxContainer, cxEdit, cxGroupBox, Controls, cxCheckBox, cxGraphics, + Graphics, Messages, cxFilterControlUtils, cxCheckComboBox, cxLookAndFeels, + cxLookAndFeelPainters; + +type + { TcxCheckGroupItem } + + TcxCheckGroupItem = class(TcxButtonGroupItem) + published + property Caption; + property Enabled; + property Tag; + end; + + { TcxCheckGroupItems } + + TcxCheckGroupItems = class(TcxButtonGroupItems) + private + function GetItem(Index: Integer): TcxCheckGroupItem; + procedure SetItem(Index: Integer; Value: TcxCheckGroupItem); + public + function Add: TcxCheckGroupItem; + property Items[Index: Integer]: TcxCheckGroupItem + read GetItem write SetItem; default; + end; + + { TcxCheckGroupButtonViewInfo } + + TcxCheckGroupButtonViewInfo = class(TcxGroupBoxButtonViewInfo) + public + State: TcxCheckBoxState; + function GetGlyphRect(ACanvas: TcxCanvas; AGlyphSize: TSize; AAlignment: TLeftRight; AIsPaintCopy: Boolean): TRect; override; + end; + + TcxCustomCheckGroup = class; + + { TcxCheckGroupViewInfo } + + TcxCheckGroupViewInfo = class(TcxButtonGroupViewInfo) + private + function GetEdit: TcxCustomCheckGroup; + protected + procedure DrawButtonCaption(ACanvas: TcxCanvas; + AButtonViewInfo: TcxGroupBoxButtonViewInfo; const AGlyphRect: TRect); override; + procedure DrawButtonGlyph(ACanvas: TcxCanvas; + AButtonViewInfo: TcxGroupBoxButtonViewInfo; const AGlyphRect: TRect); override; + function GetButtonViewInfoClass: TcxEditButtonViewInfoClass; override; + function IsButtonGlypthTransparent(AButtonViewInfo: TcxGroupBoxButtonViewInfo): Boolean; override; + + procedure SetOnDrawBackground(AValue: TcxEditDrawBackgroundEvent); override; + public + CheckBorderStyle: TcxEditCheckBoxBorderStyle; + property Edit: TcxCustomCheckGroup read GetEdit; + end; + + { TcxCheckGroupViewData } + + TcxCheckGroupViewData = class(TcxButtonGroupViewData) + protected + procedure CalculateButtonNativeState(AViewInfo: TcxCustomEditViewInfo; + AButtonViewInfo: TcxGroupBoxButtonViewInfo); override; + function GetCaptionRectExtent: TRect; override; + procedure GetEditMetrics(AAutoHeight: Boolean; ACanvas: TcxCanvas; + out AMetrics: TcxEditMetrics); override; + public + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); override; + procedure EditValueToDrawValue(ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + AViewInfo: TcxCustomEditViewInfo); override; + end; + + { TcxCustomCheckGroupProperties } + + TcxCustomCheckGroupProperties = class(TcxCustomButtonGroupProperties) + private + FAllowGrayed: Boolean; + FEditValueFormat: TcxCheckStatesValueFormat; + FGlyph: TBitmap; + FGlyphCount: Integer; + FItemAlignment: TLeftRight; + FOnEditValueToStates: TcxValueToCheckStatesEvent; + FOnStatesToEditValue: TcxCheckStatesToValueEvent; + function GetGlyph: TBitmap; + function GetItems: TcxCheckGroupItems; + procedure GlyphChanged(Sender: TObject); + procedure SetAllowGrayed(Value: Boolean); + procedure SetEditValueFormat(Value: TcxCheckStatesValueFormat); + procedure SetGlyph(Value: TBitmap); + procedure SetGlyphCount(Value: Integer); + procedure SetItemAlignment(Value: TLeftRight); + procedure SetItems(Value: TcxCheckGroupItems); + protected + function CreateItems: TcxButtonGroupItems; override; + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + function HasDisplayValue: Boolean; override; + procedure CalculateCheckStatesByEditValue(Sender: TObject; + const AEditValue: TcxEditValue); virtual; + procedure CalculateEditValueByCheckStates(Sender: TObject; + out AEditValue: TcxEditValue); virtual; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function CompareDisplayValues( + const AEditValue1, AEditValue2: TcxEditValue): Boolean; override; + class function GetContainerClass: TcxContainerClass; override; + function GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; override; + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + // !!! + property AllowGrayed: Boolean read FAllowGrayed write SetAllowGrayed + default False; + property EditValueFormat: TcxCheckStatesValueFormat read FEditValueFormat + write SetEditValueFormat default cvfIndices; + property Glyph: TBitmap read GetGlyph write SetGlyph; + property GlyphCount: Integer read FGlyphCount write SetGlyphCount default 6; + property ItemAlignment: TLeftRight read FItemAlignment + write SetItemAlignment default taLeftJustify; + property Items: TcxCheckGroupItems read GetItems write SetItems; + property OnEditValueToStates: TcxValueToCheckStatesEvent + read FOnEditValueToStates write FOnEditValueToStates; + property OnStatesToEditValue: TcxCheckStatesToValueEvent + read FOnStatesToEditValue write FOnStatesToEditValue; + end; + + { TcxCheckGroupProperties } + + TcxCheckGroupProperties = class(TcxCustomCheckGroupProperties) + published + property AllowGrayed; + property AssignedValues; + property ClearKey; + property Columns; + property EditValueFormat; + property Glyph; + property GlyphCount; + property ImmediatePost; + property ItemAlignment; + property Items; + property ReadOnly; + property WordWrap; + property OnChange; + property OnEditValueChanged; + property OnEditValueToStates; + property OnStatesToEditValue; + end; + + { TcxCheckGroupCheckButtonViewInfo } + + TcxCheckGroupCheckButtonViewInfo = class(TcxCustomCheckBoxViewInfo) + protected + procedure InternalPaint(ACanvas: TcxCanvas); override; + end; + + { TcxCheckGroupButtonProperties } + + TcxCheckGroupButtonProperties = class(TcxCheckBoxProperties) + protected + function InternalGetGlyph: TBitmap; override; + function IsEmbeddedEdit: Boolean; override; + public + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + end; + + { TcxCheckGroupButton } + + TcxCheckGroupButton = class(TcxCheckBox, IcxContainerInnerControl) + private + FColumn: Integer; + FRow: Integer; + function GetCheckGroup: TcxCustomCheckGroup; + protected + function CanAutoSize: Boolean; override; + procedure DoExit; override; + procedure Initialize; override; + function IsNativeBackground: Boolean; override; + function IsNativeStyle: Boolean; override; + function IsTransparent: Boolean; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); override; + procedure WndProc(var Message: TMessage); override; + + // IcxContainerInnerControl + function GetControl: TWinControl; + function GetControlContainer: TcxContainer; + + procedure CheckTransparentBorder; + property CheckGroup: TcxCustomCheckGroup read GetCheckGroup; + public + destructor Destroy; override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + function UpdateAction(Action: TBasicAction): Boolean; override; + end; + + { TcxCustomCheckGroup } + + TcxCustomCheckGroup = class(TcxCustomButtonGroup) + private + FButtonStatesChanging: Boolean; + FFocusedItemIndex: Integer; + FStatesItems: Boolean; + procedure DoButtonChange(Sender: TObject); + procedure DoButtonEditing(Sender: TObject; var CanEdit: Boolean); + procedure DoButtonFocusChanged(Sender: TObject); + function GetActiveProperties: TcxCustomCheckGroupProperties; + function GetButton(Index: Integer): TcxCheckGroupButton; + function GetProperties: TcxCustomCheckGroupProperties; + function GetState(Index: Integer): TcxCheckBoxState; + procedure SetProperties(Value: TcxCustomCheckGroupProperties); + procedure SetState(Index: Integer; Value: TcxCheckBoxState); + protected + procedure ArrangeButtons; override; + function GetButtonDC(AButtonIndex: Integer): THandle; override; + function GetButtonInstance: TWinControl; override; + procedure Initialize; override; + procedure InternalValidateDisplayValue(const ADisplayValue: TcxEditValue); override; + function IsEditValueStored: Boolean; override; + procedure ParentBackgroundChanged; override; + procedure PropertiesChanged(Sender: TObject); override; + procedure SynchronizeButtonsStyle; override; + procedure SynchronizeDisplayValue; override; + procedure UpdateButtons; override; + function WantNavigationKeys: Boolean; override; + function GetFirstEnabledItemIndex(AStartIndex: Integer): Integer; + property Buttons[Index: Integer]: TcxCheckGroupButton read GetButton; + property InternalButtons; + property StatesItems: Boolean read FStatesItems write FStatesItems stored False; + public + procedure Activate(var AEditData: TcxCustomEditData); override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + procedure GetTabOrderList(List: TList); override; + procedure SetFocus; override; + property ActiveProperties: TcxCustomCheckGroupProperties + read GetActiveProperties; + property Properties: TcxCustomCheckGroupProperties read GetProperties + write SetProperties; + property States[Index: Integer]: TcxCheckBoxState read GetState + write SetState; default; + property Transparent; + end; + + { TcxCheckGroup } + + TcxCheckGroup = class(TcxCustomCheckGroup) + private + function GetActiveProperties: TcxCheckGroupProperties; + function GetProperties: TcxCheckGroupProperties; + procedure SetProperties(Value: TcxCheckGroupProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxCheckGroupProperties read GetActiveProperties; + published + property Align; + property Alignment; + property Anchors; + property Caption; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property EditValue; + property Enabled; + property ParentBackground; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxCheckGroupProperties read GetProperties + write SetProperties; + property ShowHint; + property StatesItems; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Transparent; + property Visible; + property OnClick; + property OnContextPopup; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnFocusChanged; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + + { TcxFilterCheckGroupHelper } + + TcxFilterCheckGroupHelper = class(TcxFilterChecksHelper) + protected + class function GetEditValueFormat( + AEditProperties: TcxCustomEditProperties): TcxCheckStatesValueFormat; override; + class function GetItems( + AEditProperties: TcxCustomEditProperties): IcxCheckItems; override; + class procedure InitializeItems(AProperties, + AEditProperties: TcxCustomEditProperties); override; + end; + +implementation + +uses +{$IFDEF DELPHI6} + Variants, + Types, +{$ENDIF} + SysUtils, cxClasses, cxControls, cxVariants, cxExtEditConsts, cxEditUtils, + dxThemeManager, cxEditPaintUtils; + +{ TcxCheckGroupItems } + +function TcxCheckGroupItems.Add: TcxCheckGroupItem; +begin + Result := TcxCheckGroupItem(inherited Add); +end; + +function TcxCheckGroupItems.GetItem(Index: Integer): TcxCheckGroupItem; +begin + Result := TcxCheckGroupItem(inherited Items[Index]); +end; + +procedure TcxCheckGroupItems.SetItem(Index: Integer; Value: TcxCheckGroupItem); +begin + inherited Items[Index] := Value; +end; + +{ TcxCheckGroupButtonViewInfo } + +function TcxCheckGroupButtonViewInfo.GetGlyphRect(ACanvas: TcxCanvas; + AGlyphSize: TSize; AAlignment: TLeftRight; AIsPaintCopy: Boolean): TRect; + + procedure CorrectCheckRect(var ACheckRect: TRect); + begin + if AIsPaintCopy then + if AAlignment = taRightJustify then + OffsetRect(ACheckRect, 2, 0) + else + OffsetRect(ACheckRect, -2, 0); + end; + +begin + case AAlignment of + taLeftJustify: AAlignment := taRightJustify; + taRightJustify: AAlignment := taLeftJustify; + end; + Result := inherited GetGlyphRect(ACanvas, AGlyphSize, AAlignment, AIsPaintCopy); + CorrectCheckRect(Result); +end; + +{ TcxCheckGroupViewInfo } + +procedure TcxCheckGroupViewInfo.DrawButtonCaption(ACanvas: TcxCanvas; + AButtonViewInfo: TcxGroupBoxButtonViewInfo; const AGlyphRect: TRect); + + function GetCaptionRect(const ACheckRect: TRect): TRect; + begin + Result := AButtonViewInfo.Bounds; + if Alignment = taLeftJustify then + begin + Result.Left := ACheckRect.Right + CaptionExtent.Left; + Dec(Result.Right, CaptionExtent.Right); + end + else + begin + Result.Right := ACheckRect.Left - CaptionExtent.Right; + Inc(Result.Left, CaptionExtent.Left); + end; + end; + +begin + DrawCheckBoxText(ACanvas, AButtonViewInfo.Caption, Font, TextColor, + GetCaptionRect(AGlyphRect), DrawTextFlags, Enabled); +end; + +procedure TcxCheckGroupViewInfo.DrawButtonGlyph(ACanvas: TcxCanvas; + AButtonViewInfo: TcxGroupBoxButtonViewInfo; const AGlyphRect: TRect); +const + ACheckStateByButtonState: array[TcxEditButtonState] of TcxEditCheckState = + (ecsDisabled, ecsNormal, ecsPressed, ecsHot); +var + ACheckBorderStyle: TcxEditBorderStyle; + AEditProperties: TcxCustomCheckGroupProperties; +begin + if (CheckBorderStyle = ebsFlat) and (AButtonViewInfo.Data.State = ebsSelected) then + ACheckBorderStyle := ebs3D + else + ACheckBorderStyle := CheckBorderStyle; + AEditProperties := TcxCustomCheckGroupProperties(EditProperties); + + DrawEditCheck(ACanvas, AGlyphRect, TcxCheckGroupButtonViewInfo(AButtonViewInfo).State, + ACheckStateByButtonState[AButtonViewInfo.Data.State], AEditProperties.Glyph, + AEditProperties.GlyphCount, ACheckBorderStyle, AButtonViewInfo.Data.NativeStyle, + clBtnText, BackgroundColor, not IsBackgroundTransparent, IsDesigning, False, True, + Painter); +end; + +function TcxCheckGroupViewInfo.GetButtonViewInfoClass: TcxEditButtonViewInfoClass; +begin + Result := TcxCheckGroupButtonViewInfo; +end; + +function TcxCheckGroupViewInfo.IsButtonGlypthTransparent(AButtonViewInfo: TcxGroupBoxButtonViewInfo): Boolean; +begin + Result := IsBackgroundTransparent; +end; + +procedure TcxCheckGroupViewInfo.SetOnDrawBackground(AValue: TcxEditDrawBackgroundEvent); +var + I: Integer; +begin + inherited SetOnDrawBackground(AValue); + if Edit <> nil then + for I := 0 to Edit.InternalButtons.Count - 1 do + TcxCheckGroupButton(Edit.InternalButtons[I]).ViewInfo.OnDrawBackground := AValue; +end; + +function TcxCheckGroupViewInfo.GetEdit: TcxCustomCheckGroup; +begin + Result := TcxCustomCheckGroup(FEdit); +end; + +{ TcxCheckGroupViewData } + +procedure TcxCheckGroupViewData.Calculate(ACanvas: TcxCanvas; + const ABounds: TRect; const P: TPoint; Button: TcxMouseButton; + Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); +const + ABorderStyle: array[TcxLookAndFeelKind] of TcxEditCheckBoxBorderStyle = + (ebsFlat, ebs3D, ebsUltraFlat, ebsOffice11); +begin + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, + AIsMouseEvent); + with TcxCustomCheckGroupProperties(Properties) do + begin + TcxCheckGroupViewInfo(AViewInfo).GlyphSize := + GetEditCheckSize(ACanvas, IsButtonNativeStyle(Style.LookAndFeel), Glyph, + GlyphCount, AViewInfo.Painter); + TcxCheckGroupViewInfo(AViewInfo).Alignment := ItemAlignment; + end; + TcxCheckGroupViewInfo(AViewInfo).CheckBorderStyle := + ABorderStyle[Style.LookAndFeel.Kind]; + AViewInfo.BackgroundColor := Style.Color; +end; + +procedure TcxCheckGroupViewData.EditValueToDrawValue(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; AViewInfo: TcxCustomEditViewInfo); +var + ASender: TObject; + I: Integer; +begin + with TcxCustomCheckGroupProperties(Properties) do + begin + if IsInplace then + ASender := nil + else + ASender := Edit; + TcxCheckGroupViewInfo(AViewInfo).SetButtonCount(Items.Count); + if PreviewMode then + TcxCheckGroupButtonViewInfo(AViewInfo.ButtonsInfo[0]).State := cbsChecked + else + begin + CalculateCheckStatesByEditValue(ASender, AEditValue); + for I := 0 to Items.Count - 1 do + TcxCheckGroupButtonViewInfo(AViewInfo.ButtonsInfo[I]).State := CheckStates[I]; + end; + end; + if epoAutoHeight in PaintOptions then + Include(AViewInfo.PaintOptions, epoAutoHeight); +end; + +procedure TcxCheckGroupViewData.CalculateButtonNativeState(AViewInfo: TcxCustomEditViewInfo; + AButtonViewInfo: TcxGroupBoxButtonViewInfo); +begin +end; + +function TcxCheckGroupViewData.GetCaptionRectExtent: TRect; +begin + Result.Top := 0; + Result.Bottom := 0; + if TcxCustomCheckGroupProperties(Properties).ItemAlignment = taLeftJustify then + begin + Result.Left := 3; + Result.Right := 2; + end + else + begin + Result.Right := 2; + Result.Left := 2; + end; +end; + +procedure TcxCheckGroupViewData.GetEditMetrics(AAutoHeight: Boolean; + ACanvas: TcxCanvas; out AMetrics: TcxEditMetrics); +begin + AMetrics.ClientLeftBoundCorrection := 6 - (5 + + Integer(TcxCustomCheckGroupProperties(Properties).ItemAlignment = + taRightJustify)) * Integer(IsInplace); + AMetrics.ClientWidthCorrection := 5 * Integer(IsInplace) - 6; + AMetrics.ColumnOffset := 6; + if ACanvas = nil then + Exit; + + AMetrics.ButtonSize := GetEditCheckSize(ACanvas, + IsButtonNativeStyle(Style.LookAndFeel), + TcxCustomCheckGroupProperties(Properties).FGlyph, + TcxCustomCheckGroupProperties(Properties).GlyphCount, + Style.LookAndFeel.Painter); + with GetCaptionRectExtent do + AMetrics.AutoHeightColumnWidthCorrection := Left + Right; + AMetrics.ColumnWidthCorrection := AMetrics.AutoHeightColumnWidthCorrection; + AMetrics.WidthCorrection := 6 - 5 * Integer(IsInplace); + AMetrics.AutoHeightWidthCorrection := AMetrics.ClientWidthCorrection; +end; + +{ TcxCustomCheckGroupProperties } + +constructor TcxCustomCheckGroupProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FEditValueFormat := cvfIndices; + FItemAlignment := taLeftJustify; + FGlyphCount := 6; +end; + +destructor TcxCustomCheckGroupProperties.Destroy; +begin + if FGlyph <> nil then + FreeAndNil(FGlyph); + inherited Destroy; +end; + +procedure TcxCustomCheckGroupProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomCheckGroupProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with TcxCustomCheckGroupProperties(Source) do + begin + Self.AllowGrayed := AllowGrayed; + Self.ItemAlignment := ItemAlignment; + Self.WordWrap := WordWrap; + Self.Glyph := Glyph; + Self.GlyphCount := GlyphCount; + Self.EditValueFormat := EditValueFormat; + Self.OnEditValueToStates := OnEditValueToStates; + Self.OnStatesToEditValue := OnStatesToEditValue; + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +function TcxCustomCheckGroupProperties.CompareDisplayValues( + const AEditValue1, AEditValue2: TcxEditValue): Boolean; +var + ACheckStates: TcxCheckStates; +begin + CalculateCheckStatesByEditValue(nil, AEditValue1); + ACheckStates := Copy(CheckStates); + CalculateCheckStatesByEditValue(nil, AEditValue2); + Result := CompareMem(@ACheckStates[0], @CheckStates[0], + SizeOf(TcxCheckBoxState) * Length(CheckStates)); +end; + +class function TcxCustomCheckGroupProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxCheckGroup; +end; + +function TcxCustomCheckGroupProperties.GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; +var + ACheckStateNames: array[TcxCheckBoxState] of WideString; + + procedure InitCheckStateNames; + begin + ACheckStateNames[cbsUnchecked] := + cxGetResourceString(@cxSEditCheckGroupUnchecked); + ACheckStateNames[cbsChecked] := + cxGetResourceString(@cxSEditCheckGroupChecked); + ACheckStateNames[cbsGrayed] := + cxGetResourceString(@cxSEditCheckGroupGrayed); + end; + +var + I: Integer; +begin + CalculateCheckStatesByEditValue(nil, AEditValue); + InitCheckStateNames; + + Result := ''; + for I := 0 to Items.Count - 1 do + begin + Result := Result + Items[I].Caption + + cxGetResourceString(@cxSEditCheckGroupCaptionStateDelimiter) + + ACheckStateNames[CheckStates[I]]; + if I < Items.Count - 1 then + Result := Result + cxGetResourceString(@cxSEditCheckGroupFilterColumnSeparator); + end; +end; + +class function TcxCustomCheckGroupProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxCheckGroupViewInfo; +end; + +function TcxCustomCheckGroupProperties.CreateItems: TcxButtonGroupItems; +begin + Result := TcxCheckGroupItems.Create(Self, TcxCheckGroupItem); +end; + +class function TcxCustomCheckGroupProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxCheckGroupViewData; +end; + +function TcxCustomCheckGroupProperties.HasDisplayValue: Boolean; +begin + Result := True; +end; + +procedure TcxCustomCheckGroupProperties.CalculateCheckStatesByEditValue( + Sender: TObject; const AEditValue: TcxEditValue); +begin + if Assigned(OnEditValueToStates) then + begin + SetLength(CheckStates, Items.Count); + OnEditValueToStates(Sender, AEditValue, CheckStates); + end + else + cxCheckBox.CalculateCheckStates(AEditValue, Items, EditValueFormat, CheckStates); +end; + +procedure TcxCustomCheckGroupProperties.CalculateEditValueByCheckStates( + Sender: TObject; out AEditValue: TcxEditValue); +begin + if Assigned(OnStatesToEditValue) then + OnStatesToEditValue(Sender, CheckStates, AEditValue) + else + AEditValue := cxCheckBox.CalculateCheckStatesValue(CheckStates, Items, EditValueFormat); +end; + +function TcxCustomCheckGroupProperties.GetGlyph: TBitmap; +begin + if FGlyph = nil then + begin + FGlyph := TBitmap.Create; + FGlyph.OnChange := GlyphChanged; + end; + Result := FGlyph; +end; + +function TcxCustomCheckGroupProperties.GetItems: TcxCheckGroupItems; +begin + Result := TcxCheckGroupItems(inherited Items); +end; + +procedure TcxCustomCheckGroupProperties.GlyphChanged(Sender: TObject); +begin + Changed; +end; + +procedure TcxCustomCheckGroupProperties.SetAllowGrayed(Value: Boolean); +begin + if Value <> FAllowGrayed then + begin + FAllowGrayed := Value; + Changed; + end; +end; + +procedure TcxCustomCheckGroupProperties.SetEditValueFormat(Value: TcxCheckStatesValueFormat); +begin + if Value <> FEditValueFormat then + begin + FEditValueFormat := Value; + Changed; + end; +end; + +procedure TcxCustomCheckGroupProperties.SetGlyph(Value: TBitmap); +begin + if Value = nil then + FreeAndNil(FGlyph) + else + Glyph.Assign(Value); + Changed; +end; + +procedure TcxCustomCheckGroupProperties.SetGlyphCount(Value: Integer); +begin + if FGlyphCount <> Value then + begin + FGlyphCount := Value; + if FGlyph <> nil then + Changed; + end; +end; + +procedure TcxCustomCheckGroupProperties.SetItemAlignment(Value: TLeftRight); +begin + if Value <> FItemAlignment then + begin + FItemAlignment := Value; + Changed; + end; +end; + +procedure TcxCustomCheckGroupProperties.SetItems(Value: TcxCheckGroupItems); +begin + inherited Items.Assign(Value); +end; + +{ TcxCheckGroupCheckButtonViewInfo } + +procedure TcxCheckGroupCheckButtonViewInfo.InternalPaint(ACanvas: TcxCanvas); +var + ARect: TRect; + ABitmap: TBitmap; + ABitmapCanvas: TcxCanvas; +begin + if Painter <> nil then + begin + ARect := ClientRect; + ABitmap := cxCreateBitmap(ARect, pf32bit); + ABitmapCanvas := TcxCanvas.Create(ABitmap.Canvas); + try + Painter.DrawGroupBoxBackground(ABitmapCanvas, ARect, + Rect(0, 0, ABitmap.Width, ABitmap.Height)); + inherited InternalPaint(ABitmapCanvas); + ACanvas.Draw(0, 0, ABitmap); + finally + ABitmapCanvas.Free; + ABitmap.Free; + end; + end + else + inherited InternalPaint(ACanvas); +end; + +{ TcxCheckGroupButtonProperties } + +function TcxCheckGroupButtonProperties.InternalGetGlyph: TBitmap; +begin + Result := + (TcxCheckGroupButton(Owner).Owner as TcxCustomCheckGroup).ActiveProperties.Glyph; +end; + +function TcxCheckGroupButtonProperties.IsEmbeddedEdit: Boolean; +begin + Result := True; +end; + +class function TcxCheckGroupButtonProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxCheckGroupCheckButtonViewInfo; +end; + +{ TcxCheckGroupButton } + +destructor TcxCheckGroupButton.Destroy; +begin + TcxCustomCheckGroup(GetOwner).InternalButtons.Remove(Self); + inherited Destroy; +end; + +function TcxCheckGroupButton.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action) or + CheckGroup.DataBinding.ExecuteAction(Action); +end; + +class function TcxCheckGroupButton.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCheckGroupButtonProperties; +end; + +function TcxCheckGroupButton.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action) or + CheckGroup.DataBinding.UpdateAction(Action); +end; + +function TcxCheckGroupButton.CanAutoSize: Boolean; +begin + Result := False; +end; + +procedure TcxCheckGroupButton.DoExit; +begin + inherited DoExit; + CheckGroup.FFocusedItemIndex := CheckGroup.InternalButtons.IndexOf(Self); +end; + +procedure TcxCheckGroupButton.Initialize; +begin + inherited Initialize; + CheckGroup.InternalButtons.Add(Self); + Style.LookAndFeel.MasterLookAndFeel := CheckGroup.LookAndFeel; + Keys := Keys + [kArrows]; + CheckTransparentBorder; +end; + +function TcxCheckGroupButton.IsNativeBackground: Boolean; +begin + Result := CheckGroup.IsNativeBackground; +end; + +function TcxCheckGroupButton.IsNativeStyle: Boolean; +begin + Result := CheckGroup.IsButtonNativeStyle; +end; + +function TcxCheckGroupButton.IsTransparent: Boolean; +begin + Result := CheckGroup.IsTransparent; +end; + +procedure TcxCheckGroupButton.KeyDown(var Key: Word; Shift: TShiftState); + + procedure FocusNearestItem(ADown: Boolean); + var + AIndex, I, ADelta: Integer; + begin + with CheckGroup do + begin + AIndex := InternalButtons.IndexOf(Self); + ADelta := Integer(ADown) - Integer(not ADown); + I := AIndex; + repeat + I := I + ADelta; + if I = InternalButtons.Count then + I := 0 + else + if I < 0 then + I := InternalButtons.Count - 1; + if Buttons[I].Enabled then + Break; + until I = AIndex; + if I <> AIndex then + Buttons[I].SetFocus; + end; + end; +var + APrevKeyDownEvent: TKeyEvent; +begin + _TcxContainerAccess.KeyDown(CheckGroup, Key, Shift); + if Key = 0 then + Exit; + if not CheckGroup.IsInplace then + if Key in [VK_UP, VK_LEFT] then + FocusNearestItem(False) + else + if Key in [VK_DOWN, VK_RIGHT] then + FocusNearestItem(True); + APrevKeyDownEvent := OnKeyDown; + OnKeyDown := nil; + inherited KeyDown(Key, Shift); + OnKeyDown := APrevKeyDownEvent; +end; + +procedure TcxCheckGroupButton.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + inherited LookAndFeelChanged(Sender, AChangedValues); + if not IsDestroying then + CheckTransparentBorder; +end; + +procedure TcxCheckGroupButton.WndProc(var Message: TMessage); +begin + with Message do + if ((Msg = WM_LBUTTONDOWN) or (Msg = WM_LBUTTONDBLCLK)) and + (CheckGroup.DragMode = dmAutomatic) and not(csDesigning in CheckGroup.ComponentState) then + begin + _TcxContainerAccess.BeginAutoDrag(CheckGroup); + Exit; + end; + inherited WndProc(Message); +end; + +function TcxCheckGroupButton.GetControl: TWinControl; +begin + Result := Self; +end; + +function TcxCheckGroupButton.GetControlContainer: TcxContainer; +begin + Result := CheckGroup; +end; + +procedure TcxCheckGroupButton.CheckTransparentBorder; +begin + if Style.LookAndFeel.SkinPainter <> nil then + ViewInfo.Transparent := True; + if not CheckGroup.IsInplace then + Style.TransparentBorder := IsNativeStyle; +end; + +function TcxCheckGroupButton.GetCheckGroup: TcxCustomCheckGroup; +begin + Result := TcxCustomCheckGroup(Owner); +end; + +{ TcxCustomCheckGroup } + +procedure TcxCustomCheckGroup.Activate(var AEditData: TcxCustomEditData); +begin + FFocusedItemIndex := 0; + inherited Activate(AEditData); +end; + +class function TcxCustomCheckGroup.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomCheckGroupProperties; +end; + +procedure TcxCustomCheckGroup.GetTabOrderList(List: TList); +var + AFocusedItemIndex: Integer; +begin + inherited GetTabOrderList(List); + List.Remove(Self); + if Focused then + AFocusedItemIndex := GetFocusedButtonIndex + else + AFocusedItemIndex := GetFirstEnabledItemIndex(FFocusedItemIndex); + if (AFocusedItemIndex <> -1) and TabStop then + List.Add(InternalButtons[AFocusedItemIndex]); +end; + +procedure TcxCustomCheckGroup.SetFocus; +begin + inherited SetFocus; + FFocusedItemIndex := GetFirstEnabledItemIndex(FFocusedItemIndex); + if FFocusedItemIndex <> -1 then + TWinControl(InternalButtons[FFocusedItemIndex]).SetFocus; +end; + +procedure TcxCustomCheckGroup.ArrangeButtons; +var + AButtonViewInfo: TcxGroupBoxButtonViewInfo; + I: Integer; +begin + inherited ArrangeButtons; + for I := 0 to InternalButtons.Count - 1 do + with Buttons[I] do + begin + AButtonViewInfo := TcxGroupBoxButtonViewInfo(Self.ViewInfo.ButtonsInfo[I]); + FColumn := AButtonViewInfo.Column; + FRow := AButtonViewInfo.Row; + end; +end; + +function TcxCustomCheckGroup.GetButtonDC(AButtonIndex: Integer): THandle; +begin + Result := Buttons[AButtonIndex].Canvas.Handle; +end; + +function TcxCustomCheckGroup.GetButtonInstance: TWinControl; +begin + Result := TcxCheckGroupButton.Create(Self, IsInplace); +end; + +procedure TcxCustomCheckGroup.Initialize; +begin + inherited Initialize; + ControlStyle := ControlStyle - [csAcceptsControls]; + FFocusedItemIndex := -1; + InternalEditValue := 0; +end; + +procedure TcxCustomCheckGroup.InternalValidateDisplayValue(const ADisplayValue: TcxEditValue); +var + APrevEditValue: TcxEditValue; + I: Integer; +begin + APrevEditValue := FEditValue; + SetLength(CheckStates, InternalButtons.Count); + for I := 0 to High(CheckStates) do + CheckStates[I] := Buttons[I].State; + with ActiveProperties do + CalculateEditValueByCheckStates(GetStandaloneEventSender(Self), FEditValue); + if not InternalVarEqualsExact(APrevEditValue, FEditValue) then + DoEditValueChanged; +end; + +function TcxCustomCheckGroup.IsEditValueStored: Boolean; +begin + Result := (ActiveProperties.EditValueFormat = cvfInteger) and (EditValue <> 0) or + (ActiveProperties.EditValueFormat <> cvfInteger) and (VarToStr(EditValue) <> ''); +end; + +procedure TcxCustomCheckGroup.ParentBackgroundChanged; +var + I: Integer; +begin + for I := 0 to InternalButtons.Count - 1 do + Buttons[I].ParentBackground := ParentBackground; +end; + +procedure TcxCustomCheckGroup.PropertiesChanged(Sender: TObject); +begin + inherited PropertiesChanged(Sender); + InternalValidateDisplayValue(Null); + DataBinding.UpdateDisplayValue; +end; + +procedure TcxCustomCheckGroup.SynchronizeButtonsStyle; +var + AButton: TcxCheckGroupButton; + ADisabledTextColor: TColor; + I: Integer; +begin + inherited SynchronizeButtonsStyle; + ADisabledTextColor := LookAndFeelPainter.DefaultEditorTextColor(True); + if ADisabledTextColor = clDefault then + ADisabledTextColor := StyleDisabled.GetVisibleFont.Color; + for I := 0 to InternalButtons.Count - 1 do + begin + AButton := Buttons[I]; + AButton.Style.BorderStyle := ActiveStyle.BorderStyle; + if not AButton.Enabled then + begin + AButton.StyleDisabled.Color := ActiveStyle.Color; + AButton.StyleDisabled.TextColor := ADisabledTextColor; + end; + AButton.Transparent := Transparent; // to repaint button + end; +end; + +procedure TcxCustomCheckGroup.SynchronizeDisplayValue; +var + I: Integer; +begin + if ActiveProperties.Items.ItemChanged then + Exit; + with ActiveProperties do + CalculateCheckStatesByEditValue(GetStandaloneEventSender(Self), EditValue); + if not ActiveProperties.AllowGrayed and Focused then + for I := 0 to High(CheckStates) do + if CheckStates[I] = cbsGrayed then + CheckStates[I] := cbsUnchecked; + + FButtonStatesChanging := True; + try + for I := 0 to InternalButtons.Count - 1 do + Buttons[I].State := CheckStates[I]; + finally + FButtonStatesChanging := False; + end; +end; + +procedure TcxCustomCheckGroup.UpdateButtons; +const + ALookAndFeelKindMap: array [TcxEditButtonStyle] of TcxLookAndFeelKind = + (lfStandard, lfStandard, lfFlat, lfStandard, lfStandard, + lfUltraFlat, lfOffice11); +var + AButton: TcxCheckGroupButton; + I: Integer; +begin + inherited UpdateButtons; + if FFocusedItemIndex >= InternalButtons.Count then + FFocusedItemIndex := -1; + for I := 0 to InternalButtons.Count - 1 do + begin + AButton := Buttons[I]; + AButton.Properties.BeginUpdate; + try + AButton.Properties.Alignment := ActiveProperties.ItemAlignment; + AButton.Properties.AllowGrayed := ActiveProperties.AllowGrayed; + AButton.Caption := ActiveProperties.Items[I].Caption; + AButton.Properties.MultiLine := ActiveProperties.WordWrap; + AButton.Properties.GlyphCount := ActiveProperties.GlyphCount; + AButton.Properties.ReadOnly := ActiveProperties.ReadOnly and + DataBinding.IsDataAvailable; + if Length(ViewInfo.ButtonsInfo) > 0 then + AButton.LookAndFeel.Kind := ALookAndFeelKindMap[ViewInfo.ButtonsInfo[0].Data.Style]; + finally + AButton.Properties.EndUpdate; + AButton.OnEditing := DoButtonEditing; + AButton.OnFocusChanged := DoButtonFocusChanged; + AButton.Properties.OnChange := DoButtonChange; + end; + end; +// SynchronizeDisplayValue; +end; + +function TcxCustomCheckGroup.WantNavigationKeys: Boolean; +begin + Result := not IsInplace; +end; + +function TcxCustomCheckGroup.GetFirstEnabledItemIndex(AStartIndex: Integer): Integer; +var + I: Integer; +begin + Result := -1; + if AStartIndex = -1 then + AStartIndex := 0; + for I := 0 to InternalButtons.Count - 1 do + if TWinControl(InternalButtons[(I + AStartIndex) mod InternalButtons.Count]).CanFocus then + begin + Result := (I + AStartIndex) mod InternalButtons.Count; + Break; + end; +end; + +procedure TcxCustomCheckGroup.DoButtonChange(Sender: TObject); +begin + if FButtonStatesChanging then + Exit; + LockChangeEvents(True); + try + InternalValidateDisplayValue(Null); + ChangeHandler(Self); + if ActiveProperties.ImmediatePost and CanPostEditValue and ValidateEdit(True) then + InternalPostEditValue; + finally + LockChangeEvents(False); + end; +end; + +procedure TcxCustomCheckGroup.DoButtonEditing(Sender: TObject; var CanEdit: Boolean); +begin + CanEdit := DoEditing; +end; + +procedure TcxCustomCheckGroup.DoButtonFocusChanged(Sender: TObject); +begin + FocusChanged; +end; + +function TcxCustomCheckGroup.GetActiveProperties: TcxCustomCheckGroupProperties; +begin + Result := TcxCustomCheckGroupProperties(InternalGetActiveProperties); +end; + +function TcxCustomCheckGroup.GetButton(Index: Integer): TcxCheckGroupButton; +begin + Result := TcxCheckGroupButton(InternalButtons[Index]); +end; + +function TcxCustomCheckGroup.GetProperties: TcxCustomCheckGroupProperties; +begin + Result := TcxCustomCheckGroupProperties(FProperties); +end; + +function TcxCustomCheckGroup.GetState(Index: Integer): TcxCheckBoxState; +begin + Result := Buttons[Index].State; +end; + +procedure TcxCustomCheckGroup.SetProperties(Value: TcxCustomCheckGroupProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomCheckGroup.SetState(Index: Integer; Value: TcxCheckBoxState); +begin + Buttons[Index].State := Value; +end; + +{ TcxCheckGroup } + +class function TcxCheckGroup.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCheckGroupProperties; +end; + +function TcxCheckGroup.GetActiveProperties: TcxCheckGroupProperties; +begin + Result := TcxCheckGroupProperties(InternalGetActiveProperties); +end; + +function TcxCheckGroup.GetProperties: TcxCheckGroupProperties; +begin + Result := TcxCheckGroupProperties(FProperties); +end; + +procedure TcxCheckGroup.SetProperties(Value: TcxCheckGroupProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxFilterCheckGroupHelper } + +class function TcxFilterCheckGroupHelper.GetEditValueFormat( + AEditProperties: TcxCustomEditProperties): TcxCheckStatesValueFormat; +begin + Result := TcxCustomCheckGroupProperties(AEditProperties).EditValueFormat; +end; + +class function TcxFilterCheckGroupHelper.GetItems( + AEditProperties: TcxCustomEditProperties): IcxCheckItems; +begin + Result := TcxCustomCheckGroupProperties(AEditProperties).Items; +end; + +class procedure TcxFilterCheckGroupHelper.InitializeItems(AProperties, + AEditProperties: TcxCustomEditProperties); +begin + inherited InitializeItems(AProperties, AEditProperties); + TcxCustomCheckComboBoxProperties(AProperties).Glyph := + TcxCustomCheckGroupProperties(AEditProperties).Glyph; + TcxCustomCheckComboBoxProperties(AProperties).GlyphCount := + TcxCustomCheckGroupProperties(AEditProperties).GlyphCount; +end; + +initialization + GetRegisteredEditProperties.Register(TcxCheckGroupProperties, + scxSEditRepositoryCheckGroupItem); + FilterEditsController.Register(TcxCheckGroupProperties, + TcxFilterCheckGroupHelper); + +finalization + FilterEditsController.Unregister(TcxCheckGroupProperties, + TcxFilterCheckGroupHelper); + GetRegisteredEditProperties.Unregister(TcxCheckGroupProperties); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxCheckGroupStatesEditor.dfm b/official/x.35/ExpressEditors Library 5/Sources/cxCheckGroupStatesEditor.dfm new file mode 100644 index 00000000..42daa26b --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxCheckGroupStatesEditor.dfm @@ -0,0 +1,69 @@ +object cxCheckGroupStatesEditorDlg: TcxCheckGroupStatesEditorDlg + Left = 260 + Top = 283 + BorderStyle = bsDialog + Caption = 'cxCheckGroup - CheckStates editor' + ClientHeight = 238 + ClientWidth = 436 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnShow = FormShow + PixelsPerInch = 96 + Position = poScreenCenter + TextHeight = 13 + object clbStates: TcxCheckListBox + Left = 0 + Top = 0 + Width = 346 + Height = 238 + Align = alClient + Columns = 0 + EditValue = 0 + EditValueFormat = cvfCaptions + Items = <> + ParentColor = False + ScrollWidth = 0 + Style.LookAndFeel.Kind = lfUltraFlat + Style.LookAndFeel.NativeStyle = True + TabOrder = 0 + TabWidth = 0 + end + object Panel1: TPanel + Left = 346 + Top = 0 + Width = 90 + Height = 238 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object btnOK: TcxButton + Left = 8 + Top = 8 + Width = 75 + Height = 25 + Caption = 'OK' + ModalResult = 1 + TabOrder = 0 + LookAndFeel.Kind = lfUltraFlat + LookAndFeel.NativeStyle = True + UseSystemPaint = False + end + object btnCancel: TcxButton + Left = 8 + Top = 40 + Width = 75 + Height = 25 + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + LookAndFeel.Kind = lfUltraFlat + LookAndFeel.NativeStyle = True + UseSystemPaint = False + end + end +end diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxCheckGroupStatesEditor.pas b/official/x.35/ExpressEditors Library 5/Sources/cxCheckGroupStatesEditor.pas new file mode 100644 index 00000000..1c0f0d45 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxCheckGroupStatesEditor.pas @@ -0,0 +1,80 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxCheckGroupStatesEditor; + +interface + +{$I cxVer.inc} + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Classes, Controls, Dialogs, ExtCtrls, Forms, Graphics, Messages, + StdCtrls, SysUtils, cxButtons, cxCheckListBox, cxContainer, cxControls, + cxLookAndFeelPainters; + +type + TcxCheckGroupStatesEditorDlg = class(TForm) + clbStates: TcxCheckListBox; + Panel1: TPanel; + btnOK: TcxButton; + btnCancel: TcxButton; + procedure FormShow(Sender: TObject); + end; + +var + cxCheckGroupStatesEditorDlg: TcxCheckGroupStatesEditorDlg; + +implementation + +{$R *.dfm} + +procedure TcxCheckGroupStatesEditorDlg.FormShow(Sender: TObject); +var + AItemWidth, AMaxItemWidth, I: Integer; +begin + AMaxItemWidth := 0; + clbStates.Canvas.Font := clbStates.Style.Font; + for I := 0 to clbStates.Items.Count - 1 do + begin + AItemWidth := clbStates.Canvas.TextWidth(clbStates.Items[I].Text); + if AMaxItemWidth < AItemWidth then + AMaxItemWidth := AItemWidth; + end; + clbStates.ScrollWidth := AMaxItemWidth + 25; +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxCheckListBox.pas b/official/x.35/ExpressEditors Library 5/Sources/cxCheckListBox.pas new file mode 100644 index 00000000..81b425b7 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxCheckListBox.pas @@ -0,0 +1,2248 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxCheckListBox; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, +{$IFDEF DELPHI6} + Types, Variants, +{$ENDIF} + SysUtils, Classes, Controls, Graphics, StdCtrls, Forms, Math, cxClasses, + cxControls, cxContainer, cxListBox, cxCheckBox, cxEdit, cxGraphics, + cxExtEditConsts, cxExtEditUtils, cxVariants, cxDataUtils, cxScrollBar, + cxLookAndFeels, ImgList, cxLookAndFeelPainters; + +type + TcxCustomCheckListBox = class; + TcxCustomInnerCheckListBox = class; + + TcxCheckListBoxImageLayout = (ilBeforeChecks, ilAfterChecks); + + TcxClickCheckEvent = procedure(Sender: TObject; AIndex: Integer; + APrevState, ANewState: TcxCheckBoxState) of object; + + TcxCheckStatesToEditValueEvent = procedure(Sender: TObject; + const ACheckStates: TcxCheckStates; out AEditValue: TcxEditValue) of object; + TcxEditValueToCheckStatesEvent = procedure(Sender: TObject; + const AEditValue: TcxEditValue; var ACheckStates: TcxCheckStates) of object; + + { TcxCheckListBoxItem } + + TcxCheckListBoxItem = class(TCollectionItem) + private + FEnabled: Boolean; + FImageIndex: TImageIndex; + FItemObject: TObject; + FState: TcxCheckBoxState; + FTag: TcxTag; + FText: TCaption; + function GetChecked: Boolean; + function IsTagStored: Boolean; + procedure SetText(const Value: TCaption); + procedure SetEnabled(Value: Boolean); + procedure SetImageIndex(Value: TImageIndex); + procedure SetState(Value: TcxCheckBoxState); + procedure SetChecked(Value: Boolean); + protected + function GetDisplayName: string; override; + public + constructor Create(Collection: TCollection); override; + procedure Assign(Source: TPersistent); override; + property Checked: Boolean read GetChecked write SetChecked; + property ItemObject: TObject read FItemObject write FItemObject; + published + property Enabled: Boolean read FEnabled write SetEnabled default True; + property ImageIndex: TImageIndex read FImageIndex write SetImageIndex default -1; + property State: TcxCheckBoxState read FState write SetState default cbsUnchecked; + property Tag: TcxTag read FTag write FTag stored IsTagStored; + property Text: TCaption read FText write SetText; + end; + + { TcxCheckListBoxItems } + + TcxCheckListBoxItems = class(TOwnedCollection, IUnknown, + IcxCheckItems) + private + FChangedLockCount: Integer; + FCheckListBox: TcxCustomInnerCheckListBox; + function GetItems(Index: Integer): TcxCheckListBoxItem; + function GetObjects(Index: Integer): TObject; + procedure SetItems(Index: Integer; const Value: TcxCheckListBoxItem); + procedure SetObjects(Index: Integer; Value: TObject); + + // IUnknown + function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + + // IcxCheckItems + function IcxCheckItems.GetCaption = CheckItemsGetCaption; + function IcxCheckItems.GetCount = CheckItemsGetCount; + function CheckItemsGetCaption(Index: Integer): string; + function CheckItemsGetCount: Integer; + + protected + procedure Update(Item: TCollectionItem); override; + function IsChangedLocked: Boolean; + procedure LockChanged(ALock: Boolean; AInvokeChangedOnUnlock: Boolean = True); + public + constructor Create(AOwner: TcxCustomInnerCheckListBox; + ItemClass: TCollectionItemClass); + destructor Destroy; override; + property CheckListBox: TcxCustomInnerCheckListBox read FCheckListBox; + property Items[Index: Integer]: TcxCheckListBoxItem read GetItems write SetItems; default; + function Add: TcxCheckListBoxItem; + procedure Delete(Index: Integer); + function IndexOf(const S: TCaption): Integer; + function IndexOfObject(AObject: TObject): Integer; + procedure LoadStrings(AStrings: TStrings); + property Objects[Index: Integer]: TObject read GetObjects write SetObjects; + end; + + { TcxCustomInnerCheckListBox } + + TcxCheckListBoxMetrics = record + CheckFrameWidth: Integer; + ContentOffset: Integer; + ImageFrameWidth: Integer; + TextAreaOffset: Integer; + TextOffset: Integer; + TextWidthCorrection: Integer; + end; + + TcxCustomInnerCheckListBox = class(TcxCustomInnerListBox, + IUnknown, IcxMouseTrackingCaller) + private + FAllowGrayed: Boolean; + FAllowDblClickToggle: Boolean; + FCapturedCheckIndex: Integer; + FCheckItems: TcxCheckListBoxItems; + FGlyph: TBitmap; + FGlyphCount: Integer; + FHotCheckIndex: Integer; + FMetrics: TcxCheckListBoxMetrics; + FNewPressedCheckIndex: Integer; + FNewPressedCheckItemFullyVisible: Boolean; + FPressedCheckIndex: Integer; + FOnClickCheck: TcxClickCheckEvent; + function GetContainer: TcxCustomCheckListBox; + procedure DrawCheck(R: TRect; AState: TcxCheckBoxState; + ACheckState: TcxEditCheckState); + function GetGlyph: TBitmap; + procedure GlyphChanged(Sender: TObject); + procedure SetGlyph(Value: TBitmap); + procedure SetGlyphCount(Value: Integer); + procedure ToggleClickCheck(Index: Integer); + procedure InvalidateCheck(Index: Integer); + procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; + procedure CNDrawItem(var Message: TWMDrawItem); message CN_DRAWITEM; + procedure CNMeasureItem(var Message: TWMMeasureItem); message CN_MEASUREITEM; + procedure CMColorChanged(var Message: TMessage); message CM_COLORCHANGED; + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; + procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + protected + // IcxMouseTrackingCaller + procedure IcxMouseTrackingCaller.MouseLeave = MouseTrackingMouseLeave; + procedure MouseTrackingMouseLeave; + + procedure AdjustItemHeight; + procedure CheckHotTrack; + procedure Click; override; + function GetCheckAt(X, Y: Integer): Integer; + procedure GetCheckMetrics(out ACheckSize: TSize; + out ACheckBorderOffset: Integer); + function GetCheckRect(const R: TRect; AReturnFullRect: Boolean): TRect; + function GetCheckRegionWidth: Integer; virtual; + function GetMetrics: TcxCheckListBoxMetrics; virtual; + function GetStandardItemHeight: Integer; virtual; + procedure InternalMouseMove(Shift: TShiftState; X, Y: Integer); + procedure FullRepaint; virtual; + procedure InvalidateItem(Index: Integer); virtual; + procedure SynchronizeCheckStates(ANewHotCheckIndex, ANewPressedCheckIndex: Integer); + procedure UpdateCheckStates; + procedure UpdateEditValue; + procedure WndProc(var Message: TMessage); override; + procedure KeyPress(var Key: Char); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; override; + procedure DoClickCheck(const AIndex: Integer; + const OldState, NewState: TcxCheckBoxState); virtual; + procedure CreateParams(var Params: TCreateParams); override; + procedure DblClick; override; + property AllowDblClickToggle: Boolean read FAllowDblClickToggle + write FAllowDblClickToggle default True; + property AllowGrayed: Boolean read FAllowGrayed write FAllowGrayed default False; + property CheckItems: TcxCheckListBoxItems read FCheckItems write FCheckItems; + property Glyph: TBitmap read GetGlyph write SetGlyph; + property GlyphCount: Integer read FGlyphCount write SetGlyphCount default 6; + property Metrics: TcxCheckListBoxMetrics read FMetrics; + property OnClickCheck: TcxClickCheckEvent read FOnClickCheck write FOnClickCheck; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + function UpdateAction(Action: TBasicAction): Boolean; override; + property Container: TcxCustomCheckListBox read GetContainer; + published + { Published declarations } + end; + + TcxCustomInnerCheckListBoxClass = class of TcxCustomInnerCheckListBox; + + { TcxCustomCheckListBox } + + TcxCustomCheckListBox = class(TcxContainer) + private + FCheckBorderStyle: TcxEditCheckBoxBorderStyle; + FEditValue: TcxEditValue; + FEditValueFormat: TcxCheckStatesValueFormat; + FImages: TCustomImageList; + FImagesChangeLink: TChangeLink; + FImageLayout: TcxCheckListBoxImageLayout; + FInnerCheckListBox: TcxCustomInnerCheckListBox; + FIntegralHeight: Boolean; + FIsExitProcessing: Boolean; + FIsModified: Boolean; + FItemTextList: TStringList; + FListStyle: TListBoxStyle; + FNativeStyle: Boolean; + FShowChecks: Boolean; + FSorted: Boolean; + FOnCheckStatesToEditValue: TcxCheckStatesToEditValueEvent; + FOnDrawItem: TDrawItemEvent; + FOnEditValueChanged: TNotifyEvent; + FOnEditValueToCheckStates: TcxEditValueToCheckStatesEvent; + FOnMeasureItem: TMeasureItemEvent; + function GetOnClickCheck: TcxClickCheckEvent; + function GetAllowGrayed: Boolean; + function GetAllowDblClickToggle: Boolean; + function GetAutoComplete: Boolean; + function GetAutoCompleteDelay: Cardinal; + function GetGlyph: TBitmap; + function GetGlyphCount: Integer; + function GetItemHeight: Integer; + function GetItems: TcxCheckListBoxItems; + function GetColumns: Integer; + function GetCount: Integer; + function GetItemIndex: Integer; + function GetScrollWidth: Integer; + function GetSelected(Index: Integer): Boolean; + function GetTabWidth: Integer; + function GetTopIndex: Integer; + procedure ImagesChanged(Sender: TObject); + function IsItemHeightStored: Boolean; + procedure SetOnClickCheck(Value: TcxClickCheckEvent); + procedure SetAllowGrayed(Value: Boolean); + procedure SetAllowDblClickToggle(Value: Boolean); + procedure SetAutoComplete(Value: Boolean); + procedure SetAutoCompleteDelay(Value: Cardinal); + procedure SetDataBinding(Value: TcxCustomDataBinding); + procedure SetEditValueFormat(Value: TcxCheckStatesValueFormat); + procedure SetGlyph(Value: TBitmap); + procedure SetGlyphCount(Value: Integer); + procedure SetItemHeight(Value: Integer); + procedure SetItems(Value: TcxCheckListBoxItems); + procedure SetColumns(Value: Integer); + procedure SetImageLayout(Value: TcxCheckListBoxImageLayout); + procedure SetIntegralHeight(Value: Boolean); + procedure SetItemIndex(Value: Integer); + procedure SetListStyle(Value: TListBoxStyle); + procedure SetImages(Value: TCustomImageList); + procedure SetScrollWidth(Value: Integer); + procedure SetSelected(Index: Integer; Value: Boolean); + procedure SetShowChecks(Value: Boolean); + procedure SetSorted(Value: Boolean); + procedure SetTabWidth(Value: Integer); + procedure SetTopIndex(Value: Integer); +{$IFDEF DELPHI6} + procedure SetCount(Value: Integer); +{$ENDIF} + function GetReadOnly: Boolean; + procedure SetReadOnly(Value: Boolean); + protected + FDataBinding: TcxCustomDataBinding; + procedure CalculateDrawCheckParams; + procedure DoExit; override; + function IsReadOnly: Boolean; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure Loaded; override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); override; + procedure Notification(AComponent: TComponent; + Operation: TOperation); override; + function CanResize(var NewWidth, NewHeight: Integer): Boolean; override; + procedure FontChanged; override; + procedure GetOptimalHeight(var ANewHeight: Integer); + function IsInternalControl(AControl: TControl): Boolean; override; + procedure SetSize; override; + + class function GetDataBindingClass: TcxCustomDataBindingClass; virtual; + procedure DataChange; override; + procedure UpdateData; override; + procedure WndProc(var Message: TMessage); override; + procedure DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); + procedure DoEditValueChanged; virtual; + function GetInnerCheckListBoxClass: TcxCustomInnerCheckListBoxClass; virtual; + procedure SetEditValue(const Value: TcxEditValue); virtual; + function IsValueValid(const AValue: TcxEditValue; + AAllowEmpty: Boolean): Boolean; virtual; + property AllowDblClickToggle: Boolean read GetAllowDblClickToggle + write SetAllowDblClickToggle default True; + property AllowGrayed: Boolean read GetAllowGrayed write SetAllowGrayed default False; + property AutoComplete: Boolean read GetAutoComplete write SetAutoComplete + default True; + property AutoCompleteDelay: Cardinal read GetAutoCompleteDelay + write SetAutoCompleteDelay default cxDefaultAutoCompleteDelay; + property Columns: Integer read GetColumns write SetColumns default 0; + property DataBinding: TcxCustomDataBinding read FDataBinding write SetDataBinding; + property EditValue: TcxEditValue read FEditValue write SetEditValue + stored False; + property EditValueFormat: TcxCheckStatesValueFormat read FEditValueFormat + write SetEditValueFormat default cvfInteger; + property Glyph: TBitmap read GetGlyph write SetGlyph; + property GlyphCount: Integer read GetGlyphCount write SetGlyphCount default 6; + property ImageLayout: TcxCheckListBoxImageLayout read FImageLayout + write SetImageLayout default ilBeforeChecks; + property IntegralHeight: Boolean read FIntegralHeight write SetIntegralHeight + default False; + property ItemHeight: Integer read GetItemHeight write SetItemHeight + stored IsItemHeightStored; + property ListStyle: TListBoxStyle read FListStyle write SetListStyle + default lbStandard; + property ReadOnly: Boolean read GetReadOnly write SetReadOnly default False; + property ScrollWidth: Integer read GetScrollWidth write SetScrollWidth + default 0; + property ShowChecks: Boolean read FShowChecks write SetShowChecks + default True; + property Sorted: Boolean read FSorted write SetSorted default False; + property TabWidth: Integer read GetTabWidth write SetTabWidth default 0; + property OnCheckStatesToEditValue: TcxCheckStatesToEditValueEvent + read FOnCheckStatesToEditValue write FOnCheckStatesToEditValue; + property OnClickCheck: TcxClickCheckEvent read GetOnClickCheck write SetOnClickCheck; + property OnDrawItem: TDrawItemEvent read FOnDrawItem write FOnDrawItem; + property OnEditValueChanged: TNotifyEvent read FOnEditValueChanged + write FOnEditValueChanged; + property OnEditValueToCheckStates: TcxEditValueToCheckStatesEvent + read FOnEditValueToCheckStates write FOnEditValueToCheckStates; + property OnMeasureItem: TMeasureItemEvent read FOnMeasureItem write FOnMeasureItem; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + function UpdateAction(Action: TBasicAction): Boolean; override; + function CheckAtPos(const APos: TPoint): Integer; + procedure Clear; + function GetBestFitWidth: Integer; + function GetHeight(ARowCount: Integer): Integer; virtual; + function GetItemWidth(AIndex: Integer): Integer; virtual; + function ItemAtPos(const APos: TPoint; AExisting: Boolean): Integer; + function ItemRect(Index: Integer): TRect; + procedure Sort; +{$IFDEF DELPHI6} + procedure AddItem(AItem: string); + procedure CopySelection(ADestination: TcxCustomCheckListBox); + procedure DeleteSelected; + procedure MoveSelection(ADestination: TcxCustomCheckListBox); +{$ENDIF} + property InnerCheckListBox: TcxCustomInnerCheckListBox read FInnerCheckListBox write FInnerCheckListBox; + { cxListBox properties } + property Count: Integer read GetCount{$IFDEF DELPHI6} write SetCount{$ENDIF}; + property IsModified: Boolean read FIsModified write FIsModified; + property ItemIndex: Integer read GetItemIndex write SetItemIndex; + property Selected[Index: Integer]: Boolean read GetSelected write SetSelected; + property TopIndex: Integer read GetTopIndex write SetTopIndex; +// !!! + property Images: TCustomImageList read FImages write SetImages; + property Items: TcxCheckListBoxItems read GetItems write SetItems; + property LookAndFeel; + end; + + { TcxCheckListBox } + + TcxCheckListBox = class(TcxCustomCheckListBox) + published + property Align; + property AllowDblClickToggle; + property AllowGrayed; + property Anchors; + property AutoComplete; + property AutoCompleteDelay; + property BiDiMode; + property Columns; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property EditValue; + property EditValueFormat; + property Enabled; + property Glyph; + property GlyphCount; + property Images; + property ImageLayout; + property ImeMode; + property ImeName; + property IntegralHeight; + property Items; + property ParentBiDiMode; + property ParentColor default False; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property ReadOnly; + property ScrollWidth; + property ShowChecks; + property ShowHint; + property Sorted; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property TabWidth; + property Visible; + property OnCheckStatesToEditValue; + property OnClick; + property OnClickCheck; + property OnContextPopup; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnDrawItem; + property OnEditValueChanged; + property OnEditValueToCheckStates; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMeasureItem; // deprecated + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +uses +{$IFDEF DELPHI6} + RTLConsts, +{$ENDIF} + Consts, cxEditPaintUtils, cxEditUtils, dxThemeManager; + +const + cxCheckListBoxCheckFrameWidth = 1; + cxCheckListBoxContentOffset = 0; + cxCheckListBoxImageFrameWidth = 1; + cxCheckListBoxTextAreaOffset = 1; + cxCheckListBoxTextOffset = 2; + cxCheckListBoxTextWidthCorrection = 3; + +{ TcxCheckListBoxItem } + +constructor TcxCheckListBoxItem.Create(Collection: TCollection); +begin + inherited Create(Collection); + FEnabled := True; + FImageIndex := -1; + FState := cbsUnchecked; + FText := ''; +end; + +procedure TcxCheckListBoxItem.Assign(Source: TPersistent); +begin + if Source is TcxCheckListBoxItem then + begin + Text := TcxCheckListBoxItem(Source).Text; + Enabled := TcxCheckListBoxItem(Source).Enabled; + ImageIndex := TcxCheckListBoxItem(Source).ImageIndex; + ItemObject := TcxCheckListBoxItem(Source).ItemObject; + State := TcxCheckListBoxItem(Source).State; + Tag := TcxCheckListBoxItem(Source).Tag; + end + else + inherited Assign(Source); +end; + +function TcxCheckListBoxItem.GetDisplayName: string; +begin + Result := Text; + if Result = '' then + Result := inherited GetDisplayName; +end; + +function TcxCheckListBoxItem.GetChecked: Boolean; +begin + Result := (State = cbsChecked); +end; + +function TcxCheckListBoxItem.IsTagStored: Boolean; +begin + Result := FTag <> 0; +end; + +procedure TcxCheckListBoxItem.SetText(const Value: TCaption); +begin + if InternalCompareString(Value, FText, True) then + Exit; + FText := Value; + if Assigned(Collection) and (TcxCheckListBoxItems(Collection).UpdateCount = 0) and + (TcxCheckListBoxItems(Collection).CheckListBox <> nil) then + begin + TcxCheckListBoxItems(Collection).CheckListBox.Items[Index] := Value; + with TcxCheckListBoxItems(Collection).CheckListBox.Container do + if Sorted then + Sort; + Changed(False); + end; +end; + +procedure TcxCheckListBoxItem.SetEnabled(Value: Boolean); +begin + if FEnabled <> Value then + begin + FEnabled := Value; + Changed(False); + end; +end; + +procedure TcxCheckListBoxItem.SetImageIndex(Value: TImageIndex); +begin + if FImageIndex <> Value then + begin + FImageIndex := Value; + Changed(False); + end; +end; + +procedure TcxCheckListBoxItem.SetState(Value: TcxCheckBoxState); +var + ACheckListBox: TcxCustomInnerCheckListBox; +begin + if Assigned(Collection) and Assigned(TcxCheckListBoxItems(Collection).CheckListBox) then + ACheckListBox := TcxCheckListBoxItems(Collection).CheckListBox + else + ACheckListBox := nil; + + if (Value = cbsGrayed) and (ACheckListBox <> nil) then + if ACheckListBox.Container.EditValueFormat = cvfInteger then + Value := cbsUnchecked; + + if FState = Value then + Exit; + FState := Value; + if ACheckListBox <> nil then + begin + ACheckListBox.InvalidateCheck(Self.Index); + if not TcxCheckListBoxItems(Collection).IsChangedLocked then + ACheckListBox.UpdateEditValue; + end; +end; + +procedure TcxCheckListBoxItem.SetChecked(Value: Boolean); +begin + if Value then + State := cbsChecked + else + State := cbsUnchecked; +end; + +{ TcxCheckListBoxItems } + +constructor TcxCheckListBoxItems.Create(AOwner: TcxCustomInnerCheckListBox; + ItemClass: TCollectionItemClass); +begin + inherited Create(AOwner, ItemClass); + FCheckListBox := AOwner; +end; + +destructor TcxCheckListBoxItems.Destroy; +begin + FCheckListBox := nil; + inherited; +end; + +function TcxCheckListBoxItems.GetItems(Index: Integer): TcxCheckListBoxItem; +begin + Result := TcxCheckListBoxItem(inherited Items[Index]); +end; + +function TcxCheckListBoxItems.GetObjects(Index: Integer): TObject; +begin + Result := Items[Index].ItemObject; +end; + +procedure TcxCheckListBoxItems.SetItems(Index: Integer;const Value: TcxCheckListBoxItem); +begin + inherited Items[Index] := Value; + if Assigned(CheckListBox) then + CheckListBox.Items[Index] := Value.Text; +end; + +procedure TcxCheckListBoxItems.SetObjects(Index: Integer; Value: TObject); +begin + Items[Index].ItemObject := Value; +end; + +// IUnknown +function TcxCheckListBoxItems.QueryInterface(const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then + Result := S_OK + else + Result := E_NOINTERFACE; +end; + +function TcxCheckListBoxItems._AddRef: Integer; +begin + Result := -1; +end; + +function TcxCheckListBoxItems._Release: Integer; +begin + Result := -1; +end; + +// IcxCheckItems +function TcxCheckListBoxItems.CheckItemsGetCaption(Index: Integer): string; +begin + Result := Items[Index].Text; +end; + +function TcxCheckListBoxItems.CheckItemsGetCount: Integer; +begin + Result := Count; +end; + +procedure TcxCheckListBoxItems.Update(Item: TCollectionItem); + + procedure SynchronizeInnerListBoxItems; + var + AItemCount, I, ATopIndex: Integer; + begin + AItemCount := CheckListBox.Items.Count; + if not ((AItemCount <> Count) or (Item = nil)) then + Exit; + + CheckListBox.Items.BeginUpdate; + try + if Item = nil then + begin + // we need to restore the TopIndex because + // if TopIndex = ItemIndex then TopIndex will be decremented by 1 + ATopIndex := CheckListBox.TopIndex; + CheckListBox.Items.Clear; + for I := 0 to Count - 1 do + CheckListBox.Items.Add(Items[I].Text); + CheckListBox.TopIndex := ATopIndex; + end + else + if AItemCount <> Count then + if AItemCount < Count then + for I := 1 to Count - AItemCount do + CheckListBox.Items.Add('') + else + for I := 1 to AItemCount - Count do + CheckListBox.Items.Delete(CheckListBox.Items.Count - 1); + finally + CheckListBox.Items.EndUpdate; + end; + end; + +begin + if not Assigned(CheckListBox) then + Exit; + + SynchronizeInnerListBoxItems; + if Assigned(Item) then + CheckListBox.InvalidateItem(Item.Index) + else + begin + if CheckListBox.Container.Sorted then + CheckListBox.Container.Sort; + CheckListBox.Invalidate; + end; + + if CheckListBox.Container.IsModified then + CheckListBox.UpdateEditValue + else + CheckListBox.UpdateCheckStates; +end; + +function TcxCheckListBoxItems.IsChangedLocked: Boolean; +begin + Result := FChangedLockCount > 0; +end; + +procedure TcxCheckListBoxItems.LockChanged(ALock: Boolean; + AInvokeChangedOnUnlock: Boolean = True); +begin + if ALock then + Inc(FChangedLockCount) + else + if FChangedLockCount > 0 then + begin + Dec(FChangedLockCount); + if AInvokeChangedOnUnlock and (FChangedLockCount = 0) then + Changed; + end; +end; + +function TcxCheckListBoxItems.Add: TcxCheckListBoxItem; +begin + Result := TcxCheckListBoxItem(inherited Add); +end; + +procedure TcxCheckListBoxItems.Delete(Index: Integer); +begin +{$IFDEF DELPHI5} + inherited Delete(Index); +{$ELSE} + TcxCheckListBoxItem(Items[Index]).Free; +{$ENDIF} +end; + +function TcxCheckListBoxItems.IndexOf(const S: TCaption): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Count - 1 do + if InternalCompareString(Items[I].Text, S, False) then + begin + Result := I; + Break; + end; +end; + +function TcxCheckListBoxItems.IndexOfObject(AObject: TObject): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Count - 1 do + if Objects[I] = AObject then + begin + Result := I; + Break; + end; +end; + +procedure TcxCheckListBoxItems.LoadStrings(AStrings: TStrings); +var + I: Integer; +begin + AStrings.Clear; + for I := 0 to Count - 1 do + AStrings.Add(Items[I].Text); +end; + +{ TcxCustomInnerCheckListBox } + +constructor TcxCustomInnerCheckListBox.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FContainer := TcxCustomCheckListBox(AOwner); + FAllowGrayed := False; + FAllowDblClickToggle := True; + FCapturedCheckIndex := -1; + FCheckItems := TcxCheckListBoxItems.Create(Self, TcxCheckListBoxItem); + FGlyphCount := 6; + FHotCheckIndex := -1; + FPressedCheckIndex := -1; + FMetrics := GetMetrics; +end; + +destructor TcxCustomInnerCheckListBox.Destroy; +begin + EndMouseTracking(Self); + if Assigned(FGlyph) then FreeAndNil(FGlyph); + FreeAndNil(FCheckItems); + inherited Destroy; +end; + +procedure TcxCustomInnerCheckListBox.CreateParams(var Params: TCreateParams); +begin + inherited; + with Params do + if Style and (LBS_OWNERDRAWFIXED or LBS_OWNERDRAWVARIABLE) = 0 then + Style := Style or LBS_OWNERDRAWFIXED; +end; + +procedure TcxCustomInnerCheckListBox.MouseTrackingMouseLeave; +begin + InternalMouseMove([], -1, -1); + EndMouseTracking(Self); +end; + +procedure TcxCustomInnerCheckListBox.AdjustItemHeight; +begin + if HandleAllocated then + begin + if Container.FListStyle = lbStandard then + Perform(LB_SETITEMHEIGHT, 0, GetStandardItemHeight); + SetExternalScrollBarsParameters; + FullRepaint; + end; +end; + +procedure TcxCustomInnerCheckListBox.CheckHotTrack; +var + P: TPoint; +begin + P := ScreenToClient(InternalGetCursorPos); + InternalMouseMove(InternalGetShiftState, P.X, P.Y); +end; + +procedure TcxCustomInnerCheckListBox.Click; +begin + if Container.ShowChecks or Container.DataBinding.SetEditMode then + inherited Click; +end; + +function TcxCustomInnerCheckListBox.GetCheckAt(X, Y: Integer): Integer; +var + P: TPoint; +begin + P := Point(X, Y); + Result := ItemAtPos(P, True); + if Result <> -1 then + if not PtInRect(GetCheckRect(ItemRect(Result), False), P) then + Result := -1; +end; + +procedure TcxCustomInnerCheckListBox.GetCheckMetrics(out ACheckSize: TSize; + out ACheckBorderOffset: Integer); +begin + with Container do + begin + ACheckSize := GetEditCheckSize(Self.Canvas, Style.LookAndFeel.NativeStyle, + Glyph, GlyphCount, Style.LookAndFeel.SkinPainter); + ACheckBorderOffset := GetEditCheckBorderOffset(Style.LookAndFeel.Kind, + FNativeStyle, VerifyBitmap(Glyph) and (GlyphCount > 0), + LookAndFeel.SkinPainter); + end; +end; + +function TcxCustomInnerCheckListBox.GetCheckRect(const R: TRect; + AReturnFullRect: Boolean): TRect; +var + ACheckBorderOffset, ACheckOffset: Integer; + ACheckSize: TSize; +begin + if not Container.ShowChecks then + begin + Result := cxEmptyRect; + Exit; + end; + + GetCheckMetrics(ACheckSize, ACheckBorderOffset); + ACheckSize.cx := ACheckSize.cx - ACheckBorderOffset * 2; + ACheckSize.cy := ACheckSize.cy - ACheckBorderOffset * 2; + + ACheckOffset := Metrics.ContentOffset + Metrics.CheckFrameWidth; + if (Container.ImageLayout = ilBeforeChecks) and VerifyImages(Container.Images) then + Inc(ACheckOffset, Container.Images.Width + Metrics.ImageFrameWidth * 2); + + with R do + begin + Result.Top := Top + (Bottom - Top - ACheckSize.cy) div 2; + Result.Bottom := Result.Top + ACheckSize.cy; + if UseRightToLeftAlignment then + begin + Result.Right := Right - ACheckOffset; + Result.Left := Result.Right - ACheckSize.cx; + end + else + begin + Result.Left := Left + ACheckOffset; + Result.Right := Result.Left + ACheckSize.cx; + end; + end; + if AReturnFullRect then + InflateRect(Result, ACheckBorderOffset, ACheckBorderOffset); +end; + +function TcxCustomInnerCheckListBox.GetCheckRegionWidth: Integer; +var + ACheckBorderOffset: Integer; + ACheckSize: TSize; +begin + with Container do + begin + Result := Metrics.ContentOffset; + if ShowChecks or VerifyImages(Images) then + Inc(Result, Metrics.TextAreaOffset); + if ShowChecks then + begin + GetCheckMetrics(ACheckSize, ACheckBorderOffset); + ACheckSize.cx := ACheckSize.cx - ACheckBorderOffset * 2; + Inc(Result, ACheckSize.cx + Metrics.CheckFrameWidth * 2); + end; + if VerifyImages(Images) then + Inc(Result, Images.Width + Metrics.ImageFrameWidth * 2); + end; +end; + +function TcxCustomInnerCheckListBox.GetMetrics: TcxCheckListBoxMetrics; +begin + Result.CheckFrameWidth := cxCheckListBoxCheckFrameWidth; + Result.ContentOffset := cxCheckListBoxContentOffset; + Result.ImageFrameWidth := cxCheckListBoxImageFrameWidth; + Result.TextAreaOffset := cxCheckListBoxTextAreaOffset; + Result.TextOffset := cxCheckListBoxTextOffset; + Result.TextWidthCorrection := cxCheckListBoxTextWidthCorrection; +end; + +function TcxCustomInnerCheckListBox.GetStandardItemHeight: Integer; +var + ACheckBorderOffset: Integer; + ACheckSize: TSize; +begin + Canvas.Font := Font; + Result := Canvas.TextHeight('Zg'); + with Container do + begin + if ShowChecks then + begin + GetCheckMetrics(ACheckSize, ACheckBorderOffset); + ACheckSize.cy := ACheckSize.cy - ACheckBorderOffset * 2; + if Result < ACheckSize.cy + Metrics.CheckFrameWidth * 2 then + Result := ACheckSize.cy + Metrics.CheckFrameWidth * 2; + end; + if VerifyImages(Images) and (Result < Images.Height + Metrics.ImageFrameWidth * 2) then + Result := Images.Height + Metrics.ImageFrameWidth * 2; + end; +end; + +procedure TcxCustomInnerCheckListBox.InternalMouseMove(Shift: TShiftState; + X, Y: Integer); +var + ANewHotCheckIndex, ANewPressedCheckIndex: Integer; +begin + if FCapturedCheckIndex = -1 then + begin + if Shift = [] then + ANewHotCheckIndex := GetCheckAt(X, Y) + else + ANewHotCheckIndex := FHotCheckIndex; + ANewPressedCheckIndex := FPressedCheckIndex; + end + else + begin + ANewHotCheckIndex := -1; + if GetCheckAt(X, Y) = FCapturedCheckIndex then + ANewPressedCheckIndex := FCapturedCheckIndex + else + ANewPressedCheckIndex := -1; + end; + SynchronizeCheckStates(ANewHotCheckIndex, ANewPressedCheckIndex); +end; + +procedure TcxCustomInnerCheckListBox.DblClick; +var + P: TPoint; +begin + inherited DblClick; + if (ItemIndex <> -1) and CheckItems[ItemIndex].Enabled then + begin + P := ScreenToClient(InternalGetCursorPos); + if (GetCheckAt(P.X, P.Y) <> -1) or AllowDblClickToggle then + ToggleClickCheck(ItemIndex); + end; +end; + +function TcxCustomInnerCheckListBox.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action) or + Container.FDataBinding.ExecuteAction(Action); +end; + +function TcxCustomInnerCheckListBox.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action) or + Container.FDataBinding.UpdateAction(Action); +end; + +procedure TcxCustomInnerCheckListBox.CMFontChanged(var Message: TMessage); +begin + inherited; + AdjustItemHeight; +end; + +procedure TcxCustomInnerCheckListBox.CMMouseEnter(var Message: TMessage); +begin + inherited; + BeginMouseTracking(Self, GetControlRect(Self), Self); +end; + +procedure TcxCustomInnerCheckListBox.CMMouseLeave(var Message: TMessage); +begin + inherited; + InternalMouseMove([], -1, -1); + EndMouseTracking(Self); +end; + +function TcxCustomInnerCheckListBox.GetContainer: TcxCustomCheckListBox; +begin + Result := TcxCustomCheckListBox(Owner); +end; + +procedure TcxCustomInnerCheckListBox.FullRepaint; +var + R: TRect; +begin + if HandleAllocated then + begin + R := GetControlRect(Self); + InvalidateRect(Handle, @R, True); + end; +end; + +procedure TcxCustomInnerCheckListBox.WMLButtonDown(var Message: TWMLButtonDown); +var + R: TRect; +begin + if Container.ShowChecks or Container.DataBinding.SetEditMode then + begin + FNewPressedCheckIndex := GetCheckAt(Message.XPos, Message.YPos); + try + if FNewPressedCheckIndex <> -1 then + begin + R := ItemRect(FNewPressedCheckIndex); + FNewPressedCheckItemFullyVisible := R.Bottom <= ClientHeight; + DragMode := dmManual; + end; + inherited; + finally + FNewPressedCheckIndex := -1; + DragMode := Container.DragMode; + end; + end + else + begin + SetFocus; + with Message do + MouseDown(mbLeft, KeysToShiftState(Keys), XPos, YPos); + end; +end; + +procedure TcxCustomInnerCheckListBox.CNDrawItem(var Message: TWMDrawItem); +var + ADrawItemStruct: PDrawItemStruct; +begin + if Items.Count = 0 then + Exit; + ADrawItemStruct := Message.DrawItemStruct; + with ADrawItemStruct^ do + if not UseRightToLeftAlignment then + rcItem.Left := rcItem.Left + GetCheckRegionWidth + else + rcItem.Right := rcItem.Right - GetCheckRegionWidth; + inherited; +end; + +procedure TcxCustomInnerCheckListBox.CNMeasureItem(var Message: TWMMeasureItem); +begin + if Container.FListStyle = lbStandard then + Message.MeasureItemStruct.itemHeight := GetStandardItemHeight + else + inherited; +end; + +procedure TcxCustomInnerCheckListBox.CMColorChanged(var Message: TMessage); +begin + inherited; + FullRepaint; +end; + +procedure TcxCustomInnerCheckListBox.DrawCheck(R: TRect; + AState: TcxCheckBoxState; ACheckState: TcxEditCheckState); + + function GetCheckBorderStyle: TcxEditCheckBoxBorderStyle; + begin + with Container do + if not FNativeStyle and (FCheckBorderStyle = ebsFlat) and + (ACheckState in [ecsHot, ecsPressed]) then + Result := ebs3D + else + Result := FCheckBorderStyle; + end; + +begin + if R.Top < 0 then + Exit; + + DrawEditCheck(Canvas, GetCheckRect(R, True), AState, ACheckState, Glyph, + GlyphCount, GetCheckBorderStyle, Container.FNativeStyle, clBtnText, Color, + True, Container.IsDesigning, False, True, LookAndFeel.SkinPainter); +end; + +procedure TcxCustomInnerCheckListBox.InvalidateItem(Index: Integer); +var + R: TRect; +begin + R := ItemRect(Index); + InvalidateRect(Handle, @R, True); +end; + +procedure TcxCustomInnerCheckListBox.SynchronizeCheckStates(ANewHotCheckIndex, + ANewPressedCheckIndex: Integer); +begin + if ANewHotCheckIndex <> FHotCheckIndex then + begin + InvalidateCheck(FHotCheckIndex); + FHotCheckIndex := ANewHotCheckIndex; + InvalidateCheck(FHotCheckIndex); + end; + if ANewPressedCheckIndex <> FPressedCheckIndex then + begin + InvalidateCheck(FPressedCheckIndex); + FPressedCheckIndex := ANewPressedCheckIndex; + InvalidateCheck(FPressedCheckIndex); + end; +end; + +procedure TcxCustomInnerCheckListBox.UpdateCheckStates; +var + I: Integer; +begin + if Assigned(Container.FOnEditValueToCheckStates) then + begin + SetLength(CheckStates, Container.Items.Count); + Container.FOnEditValueToCheckStates(Container, Container.EditValue, + CheckStates); + end + else + CalculateCheckStates(Container.EditValue, CheckItems, + Container.EditValueFormat, CheckStates); + CheckItems.LockChanged(True); + try + for I := 0 to CheckItems.Count - 1 do + CheckItems[I].State := CheckStates[I]; + finally + CheckItems.LockChanged(False, False); + end; +end; + +procedure TcxCustomInnerCheckListBox.UpdateEditValue; +var + ANewEditValue: TcxEditValue; + AEditValueChanged: Boolean; + I: Integer; +begin + SetLength(CheckStates, CheckItems.Count); + for I := 0 to CheckItems.Count - 1 do + CheckStates[I] := CheckItems[I].State; + if Assigned(Container.FOnCheckStatesToEditValue) then + Container.FOnCheckStatesToEditValue(Container, CheckStates, ANewEditValue) + else + ANewEditValue := CalculateCheckStatesValue(CheckStates, CheckItems, + Container.EditValueFormat); + + if Assigned(Container.OnEditValueChanged) then + AEditValueChanged := not InternalVarEqualsExact(Container.FEditValue, ANewEditValue) + else + AEditValueChanged := False; + + Container.FEditValue := ANewEditValue; + Container.IsModified := True; + + if AEditValueChanged then + Container.DoEditValueChanged; +end; + +procedure TcxCustomInnerCheckListBox.WndProc(var Message: TMessage); +begin + inherited WndProc(Message); + case Message.Msg of + WM_HSCROLL, + WM_MOUSEWHEEL, + WM_VSCROLL: + CheckHotTrack; + end; +end; + +procedure TcxCustomInnerCheckListBox.InvalidateCheck(Index: Integer); +var + R: TRect; +begin + if not HandleAllocated then + Exit; + R := ItemRect(Index); + R := GetCheckRect(R, False); + InvalidateRect(Handle, @R, False); +end; + +function TcxCustomInnerCheckListBox.GetGlyph: TBitmap; +begin + if FGlyph = nil then + begin + FGlyph := TBitmap.Create; + FGlyph.OnChange := GlyphChanged; + end; + Result := FGlyph; +end; + +procedure TcxCustomInnerCheckListBox.GlyphChanged(Sender: TObject); +begin + AdjustItemHeight; +end; + +procedure TcxCustomInnerCheckListBox.SetGlyph(Value: TBitmap); +begin + if Value = nil then + begin + FreeAndNil(FGlyph); + AdjustItemHeight; + end + else + Glyph.Assign(Value); +end; + +procedure TcxCustomInnerCheckListBox.SetGlyphCount(Value: Integer); +begin + if FGlyphCount <> Value then + begin + FGlyphCount := Value; + if FGlyph <> nil then + AdjustItemHeight; + end; +end; + +procedure TcxCustomInnerCheckListBox.KeyPress(var Key: Char); +begin + if (Key = ' ') then + ToggleClickCheck(ItemIndex); + inherited KeyPress(Key); +end; + +procedure TcxCustomInnerCheckListBox.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +var + ANewHotCheckIndex, ANewPressedCheckIndex: Integer; +begin + inherited MouseDown(Button, Shift, X, Y); + if Button = mbLeft then + begin + ANewPressedCheckIndex := FNewPressedCheckIndex; + if (ANewPressedCheckIndex <> -1) and + ((Container.DragMode = dmAutomatic) or not FNewPressedCheckItemFullyVisible) and + CheckItems[ANewPressedCheckIndex].Enabled then + begin + ToggleClickCheck(ANewPressedCheckIndex); + ANewPressedCheckIndex := -1; + end; + end + else + ANewPressedCheckIndex := -1; + FCapturedCheckIndex := ANewPressedCheckIndex; + ANewHotCheckIndex := -1; + SynchronizeCheckStates(ANewHotCheckIndex, ANewPressedCheckIndex); +end; + +procedure TcxCustomInnerCheckListBox.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + if (Container.DragMode = dmAutomatic) and (GetCaptureControl <> Self) then + begin + FCapturedCheckIndex := -1; + SynchronizeCheckStates(FHotCheckIndex, -1); + end; + InternalMouseMove(Shift, X, Y); + BeginMouseTracking(Self, GetControlRect(Self), Self); +end; + +procedure TcxCustomInnerCheckListBox.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +var + ACheckIndex: Integer; + ANewHotCheckIndex, ANewPressedCheckIndex: Integer; +begin + inherited MouseUp(Button, Shift, X, Y); + if (Button = mbLeft) and (Container.DragMode <> dmAutomatic) then + begin + ACheckIndex := GetCheckAt(X, Y); + if (ACheckIndex = FPressedCheckIndex) and (ACheckIndex <> -1) and + CheckItems[ACheckIndex].Enabled then + ToggleClickCheck(ACheckIndex); + end; + FCapturedCheckIndex := -1; + ANewPressedCheckIndex := -1; + if Shift = [] then + ANewHotCheckIndex := GetCheckAt(X, Y) + else + ANewHotCheckIndex := -1; + SynchronizeCheckStates(ANewHotCheckIndex, ANewPressedCheckIndex); +end; + +function TcxCustomInnerCheckListBox.DoMouseWheel(Shift: TShiftState; + WheelDelta: Integer; MousePos: TPoint): Boolean; +begin + Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos); + CheckHotTrack; +end; + +procedure TcxCustomInnerCheckListBox.ToggleClickCheck(Index: Integer); +var + ANewState, APrevState: TcxCheckBoxState; +begin + if (Index < 0) or (Index >= CheckItems.Count) or + not CheckItems[Index].Enabled then + Exit; + if Container.Focused and not Container.DataBinding.SetEditMode then + Exit; + + APrevState := CheckItems[Index].State; + case APrevState of + cbsUnchecked: + if AllowGrayed and (Container.EditValueFormat <> cvfInteger) then + ANewState := cbsGrayed + else + ANewState := cbsChecked; + cbsGrayed: ANewState := cbsChecked; + else + ANewState := cbsUnchecked; + end; + CheckItems[Index].State := ANewState; + DoClickCheck(Index, APrevState, ANewState); +end; + +procedure TcxCustomInnerCheckListBox.DoClickCheck(const AIndex: Integer; + const OldState, NewState: TcxCheckBoxState); +begin + if Assigned(FOnClickCheck) then + FOnClickCheck(Container, AIndex, OldState, NewState); +end; + +{ TcxCustomCheckListBox } + +constructor TcxCustomCheckListBox.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FEditValue := VarAsType(0, {$IFDEF DELPHI6}varInt64{$ELSE}varInteger{$ENDIF}); + FEditValueFormat := cvfInteger; + + FDataBinding := GetDataBindingClass.Create(Self, Self); + FDataBinding.OnDataChange := Self.DataChange; + FDataBinding.OnDataSetChange := Self.DataSetChange; + FDataBinding.OnUpdateData := Self.UpdateData; + + FInnerCheckListBox := GetInnerCheckListBoxClass.Create(Self); + FInnerCheckListBox.AutoSize := False; + FInnerCheckListBox.BorderStyle := bsNone; + FInnerCheckListBox.OnDrawItem := DrawItem; + FInnerCheckListBox.Parent := Self; + FInnerCheckListBox.LookAndFeel.MasterLookAndFeel := Style.LookAndFeel; + + InnerControl := FInnerCheckListBox; + DataBinding.VisualControl := FInnerCheckListBox; + Width := 121; + Height := 97; + + FImageLayout := ilBeforeChecks; + FIntegralHeight := False; + FListStyle := lbStandard; + FInnerCheckListBox.Style := lbOwnerDrawFixed; + FShowChecks := True; + CalculateDrawCheckParams; + + FImagesChangeLink := TChangeLink.Create; + FImagesChangeLink.OnChange := ImagesChanged; + FItemTextList := TStringList.Create; +end; + +destructor TcxCustomCheckListBox.Destroy; +begin + FreeAndNil(FItemTextList); + FreeAndNil(FImagesChangeLink); + FreeAndNil(FInnerCheckListBox); + FreeAndNil(FDataBinding); + inherited Destroy; +end; + +function TcxCustomCheckListBox.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action) or + FDataBinding.ExecuteAction(Action); +end; + +function TcxCustomCheckListBox.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action) or FDataBinding.UpdateAction(Action); +end; + +function TcxCustomCheckListBox.CheckAtPos(const APos: TPoint): Integer; +begin + Result := FInnerCheckListBox.GetCheckAt(APos.X - FInnerCheckListBox.Left, + APos.Y - FInnerCheckListBox.Top); +end; + +procedure TcxCustomCheckListBox.Clear; +begin + Items.Clear; +end; + +function TcxCustomCheckListBox.GetBestFitWidth: Integer; +var + AItemTextWidth, AMaxItemTextWidth: Integer; + I: Integer; +begin + with GetBorderExtent do + Result := Left + Right; + Inc(Result, FInnerCheckListBox.GetCheckRegionWidth + + FInnerCheckListBox.Metrics.TextWidthCorrection); + AMaxItemTextWidth := 0; + for I := 0 to Items.Count - 1 do + begin + AItemTextWidth := Canvas.TextWidth(Items[I].Text); + if AItemTextWidth > AMaxItemTextWidth then + AMaxItemTextWidth := AItemTextWidth; + end; + Inc(Result, AMaxItemTextWidth); +end; + +function TcxCustomCheckListBox.GetHeight(ARowCount: Integer): Integer; +begin + with GetBorderExtent do + Result := FInnerCheckListBox.GetStandardItemHeight * ARowCount + Top + Bottom; +end; + +function TcxCustomCheckListBox.GetItemWidth(AIndex: Integer): Integer; +begin + with GetBorderExtent do + Result := Left + Right; + Inc(Result, FInnerCheckListBox.GetCheckRegionWidth + + Canvas.TextWidth(Items[AIndex].Text) + FInnerCheckListBox.Metrics.TextWidthCorrection); +end; + +function TcxCustomCheckListBox.ItemAtPos(const APos: TPoint; AExisting: Boolean): Integer; +begin + Result := FInnerCheckListBox.ItemAtPos( + Point(APos.X - FInnerCheckListBox.Left, APos.Y - FInnerCheckListBox.Top), + AExisting); +end; + +function TcxCustomCheckListBox.ItemRect(Index: Integer): TRect; +begin + Result := FInnerCheckListBox.ItemRect(Index); + OffsetRect(Result, FInnerCheckListBox.Left, FInnerCheckListBox.Top); +end; + +procedure TcxCustomCheckListBox.Sort; + + procedure FillItemTextList; + var + ACount, I: Integer; + begin + ACount := FItemTextList.Count; + if ACount > Items.Count then + ACount := Items.Count; + + for I := 0 to ACount - 1 do + begin + FItemTextList[I] := Items[I].Text; + FItemTextList.Objects[I] := Items[I]; + end; + + if ACount < Items.Count then + for I := ACount to Items.Count - 1 do + FItemTextList.AddObject(Items[I].Text, Items[I]) + else + if ACount < FItemTextList.Count then + for I := 1 to FItemTextList.Count - ACount do + FItemTextList.Delete(FItemTextList.Count - 1); + end; + +var + APrevSorted: Boolean; + I: Integer; +begin + APrevSorted := Sorted; + FSorted := False; + try + FillItemTextList; + FItemTextList.Sort; + + Items.BeginUpdate; + try + for I := 0 to FItemTextList.Count - 1 do + TcxCheckListBoxItem(FItemTextList.Objects[I]).Index := I; + finally + Items.EndUpdate; + end; + finally + FSorted := APrevSorted; + end; + InnerCheckListBox.FullRepaint; +end; + +{$IFDEF DELPHI6} +procedure TcxCustomCheckListBox.AddItem(AItem: string); +var + Item: TcxCheckListBoxItem; +begin + Item := Items.Add; + Item.Text := AItem; +end; + +procedure TcxCustomCheckListBox.CopySelection(ADestination: TcxCustomCheckListBox); +begin + if ItemIndex <> -1 then + ADestination.AddItem(Items[ItemIndex].Text); +end; + +procedure TcxCustomCheckListBox.DeleteSelected; +begin + if ItemIndex <> -1 then + Items.Delete(ItemIndex); +end; + +procedure TcxCustomCheckListBox.MoveSelection(ADestination: TcxCustomCheckListBox); +begin + CopySelection(ADestination); + DeleteSelected; +end; + +{$ENDIF} + +procedure TcxCustomCheckListBox.CalculateDrawCheckParams; +const + ABorderStyleMap: array[TcxLookAndFeelKind] of TcxEditCheckBoxBorderStyle = + (ebsFlat, ebs3D, ebsUltraFlat, ebsOffice11); +begin + with Style.LookAndFeel do + begin + FNativeStyle := NativeStyle and AreVisualStylesAvailable([totButton, totComboBox]); + if not FNativeStyle then + FCheckBorderStyle := ABorderStyleMap[Kind]; + end; +end; + +procedure TcxCustomCheckListBox.DoExit; +begin + if IsDestroying or FIsExitProcessing then + Exit; + FIsExitProcessing := True; + try + try + DataBinding.UpdateDataSource; + except + SetFocus; + raise; + end; + inherited DoExit; + finally + FIsExitProcessing := False; + end; +end; + +function TcxCustomCheckListBox.IsReadOnly: Boolean; +begin + Result := DataBinding.IsControlReadOnly; +end; + +procedure TcxCustomCheckListBox.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited KeyDown(Key, Shift); + if not ShowChecks then + case Key of + VK_PRIOR, VK_NEXT, VK_END, VK_HOME, VK_LEFT, VK_UP, VK_RIGHT, VK_DOWN: + if not DataBinding.SetEditMode then + Key := 0; + end; +end; + +procedure TcxCustomCheckListBox.KeyPress(var Key: Char); +begin + inherited KeyPress(Key); + case Key of + #27: + DataBinding.Reset; + #32..#255: + if not ShowChecks and not DataBinding.SetEditMode then + Key := #0; + end; +end; + +procedure TcxCustomCheckListBox.Loaded; +begin + inherited Loaded; + DataBinding.Reset; + _TWinControlAccess._RecreateWnd(InnerCheckListBox); +end; + +procedure TcxCustomCheckListBox.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + if not IsDestroying then + CalculateDrawCheckParams; + inherited LookAndFeelChanged(Sender, AChangedValues); + if FInnerCheckListBox <> nil then + FInnerCheckListBox.AdjustItemHeight; +end; + +procedure TcxCustomCheckListBox.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (AComponent = FImages) then + Images := nil; +end; + +function TcxCustomCheckListBox.GetReadOnly: Boolean; +begin + Result := DataBinding.ReadOnly; +end; + +procedure TcxCustomCheckListBox.SetReadOnly(Value: Boolean); +begin + DataBinding.ReadOnly := Value; +end; + +function TcxCustomCheckListBox.CanResize(var NewWidth, NewHeight: Integer): Boolean; +begin + Result := inherited CanResize(NewWidth, NewHeight); + if not Result or not IntegralHeight or IsLoading then + Exit; + if Align in [alLeft, alRight, alClient] then + Exit; + GetOptimalHeight(NewHeight); + if NewHeight<20 then Exit; +end; + +procedure TcxCustomCheckListBox.FontChanged; +begin + inherited FontChanged; + SetSize; +end; + +procedure TcxCustomCheckListBox.DrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + + procedure PrepareColors(AIsItemEnabled: Boolean); + begin + if (odSelected in State) and not IsDesigning then + begin + FInnerCheckListBox.Canvas.Font.Color := clHighlightText; + FInnerCheckListBox.Canvas.Brush.Color := clHighlight; + end + else + begin + FInnerCheckListBox.Canvas.Brush.Color := ViewInfo.BackgroundColor; + FInnerCheckListBox.Canvas.Font.Color := ActiveStyle.GetVisibleFont.Color; + end; + if (not AIsItemEnabled) and not(odSelected in State) then + FInnerCheckListBox.Canvas.Font.Color := StyleDisabled.TextColor; + end; + + function GetCheckState(AIsItemEnabled: Boolean): TcxEditCheckState; + begin + if not AIsItemEnabled then + Result := ecsDisabled + else + if FInnerCheckListBox.FHotCheckIndex = Index then + Result := ecsHot + else + if FInnerCheckListBox.FPressedCheckIndex = Index then + Result := ecsPressed + else + Result := ecsNormal; + end; + + procedure DrawCheckRegion(const ACheckRegion: TRect; AIsItemEnabled: Boolean); + + function GetGlyphRect: TRect; + var + ACheckBorderOffset, AGlyphOffset: Integer; + ACheckSize: TSize; + begin + AGlyphOffset := FInnerCheckListBox.Metrics.ContentOffset + + FInnerCheckListBox.Metrics.ImageFrameWidth; + if ShowChecks and (ImageLayout = ilAfterChecks) then + begin + FInnerCheckListBox.GetCheckMetrics(ACheckSize, ACheckBorderOffset); + ACheckSize.cx := ACheckSize.cx - ACheckBorderOffset * 2; + Inc(AGlyphOffset, ACheckSize.cx + FInnerCheckListBox.Metrics.CheckFrameWidth * 2); + end; + + with ACheckRegion do + begin + Result.Top := Top + (Bottom - Top - Images.Height) div 2; + Result.Bottom := Result.Top + Images.Height; + if UseRightToLeftAlignment then + begin + Result.Right := Right - AGlyphOffset; + Result.Left := Result.Right - Images.Width; + end + else + begin + Result.Left := Left + AGlyphOffset; + Result.Right := Result.Left + Images.Width; + end; + end; + end; + + var + AImageIndex: Integer; + begin + if ShowChecks then + FInnerCheckListBox.DrawCheck(ACheckRegion, Items[Index].State, + GetCheckState(AIsItemEnabled)); + AImageIndex := Items[Index].ImageIndex; + if VerifyImages(Images) and (AImageIndex <> -1) and (AImageIndex < Images.Count) then + DrawGlyph(FInnerCheckListBox.Canvas, Images, Items[Index].ImageIndex, + GetGlyphRect, Color, AIsItemEnabled); + end; + +const + ADrawTextAlignmentFlags: array[Boolean] of LongWord = (DT_LEFT, DT_RIGHT); +var + ABaseTestFlag: LongWord; + ACheckRegion, ATextRect, ADrawEventRect: TRect; + ADrawTextParams: DrawTextParams; + AEnabled: Boolean; + FText: string; +begin + if Index < Items.Count then + begin + FInnerCheckListBox.Canvas.Font.Assign(ActiveStyle.GetVisibleFont); + ACheckRegion := Rect; + ATextRect := Rect; + AEnabled := Enabled and Items[Index].Enabled; + if not UseRightToLeftAlignment then + begin + Dec(ACheckRegion.Left, FInnerCheckListBox.GetCheckRegionWidth); + Inc(ATextRect.Left, FInnerCheckListBox.Metrics.TextOffset); + end + else + begin + Inc(ACheckRegion.Right, FInnerCheckListBox.GetCheckRegionWidth); + Dec(ATextRect.Right, FInnerCheckListBox.Metrics.TextOffset); + end; + DrawCheckRegion(ACheckRegion, AEnabled); + PrepareColors(AEnabled); + FInnerCheckListBox.Canvas.FillRect(Rect); + FText := Items[Index].Text; + SetBkMode(FInnerCheckListBox.Canvas.Handle, TRANSPARENT); + PrepareColors(AEnabled); + ABaseTestFlag := DT_NOPREFIX or DT_VCENTER or DT_SINGLELINE or + ADrawTextAlignmentFlags[UseRightToLeftAlignment]; + if FInnerCheckListBox.TabWidth > 0 then + ABaseTestFlag := ABaseTestFlag or DT_EXPANDTABS or DT_TABSTOP; + with ADrawTextParams do + begin + cbSize := SizeOf(ADrawTextParams); + iTabLength := FInnerCheckListBox.TabWidth; + iLeftMargin := 0; + iRightMargin := 0; + end; + Windows.DrawTextEx(FInnerCheckListBox.Canvas.Handle, + PChar(FText), Length(FText), ATextRect, + ABaseTestFlag, @ADrawTextParams); + if odFocused in State then + FInnerCheckListBox.Canvas.DrawFocusRect(Rect); + end; + ADrawEventRect := Rect; + if Assigned(FOnDrawItem) then + FOnDrawItem(Self, Index, ADrawEventRect, State); +end; + +procedure TcxCustomCheckListBox.GetOptimalHeight(var ANewHeight: Integer); + + function GetItemHeight(AIndex: Integer): Integer; + begin + Result := FInnerCheckListBox.GetStandardItemHeight; + end; + +var + I: Integer; + ABorderExtent: TRect; + AItemHeight: Integer; + AListClientSize, AListSize, AScrollBarSize: TSize; + AScrollWidth: Integer; + AVScrollBar: Boolean; +begin + ABorderExtent := GetBorderExtent; + AListClientSize.cy := ABorderExtent.Top + ABorderExtent.Bottom; + AScrollBarSize := GetScrollBarSize; + AScrollWidth := ScrollWidth; + if AScrollWidth > 0 then + Inc(AScrollWidth, 4); + I := 0; + repeat + AItemHeight := GetItemHeight(I); + AListClientSize.cy := AListClientSize.cy + AItemHeight; + AListSize.cy := AListClientSize.cy; + AListClientSize.cx := Width - (ABorderExtent.Left + ABorderExtent.Right); + AVScrollBar := I + 1 < Count; + if AVScrollBar then + AListClientSize.cx := AListClientSize.cx - AScrollBarSize.cx; + if AListClientSize.cx < AScrollWidth then + AListSize.cy := AListSize.cy + AScrollBarSize.cy; + if AListSize.cy = ANewHeight then + Break; + if AListSize.cy > ANewHeight then + begin + if I > 0 then + begin + AListClientSize.cy := AListClientSize.cy - AItemHeight; + AListSize.cy := AListClientSize.cy; + AListClientSize.cx := Width - (ABorderExtent.Left + ABorderExtent.Right); + AVScrollBar := I < Count; + if AVScrollBar then + AListClientSize.cx := AListClientSize.cx - AScrollBarSize.cx; + if AListClientSize.cx < AScrollWidth then + AListSize.cy := AListSize.cy + AScrollBarSize.cy; + end; + Break; + end; + Inc(I); + until False; + ANewHeight := AListSize.cy; +end; + +function TcxCustomCheckListBox.IsInternalControl(AControl: TControl): Boolean; +begin + Result := (AControl = FInnerCheckListBox.HScrollBar) or (AControl = FInnerCheckListBox.VScrollBar) or + inherited IsInternalControl(AControl); +end; + +class function TcxCustomCheckListBox.GetDataBindingClass: TcxCustomDataBindingClass; +begin + Result := TcxCustomDataBinding; +end; + +procedure TcxCustomCheckListBox.DataChange; +begin + if ShowChecks then + EditValue := DataBinding.GetStoredValue(evsValue, Focused) + else + if DataBinding.IsDataSourceLive then + ItemIndex := Items.IndexOf(VarToStr(DataBinding.GetStoredValue(evsText, Focused))) + else + ItemIndex := -1; +end; + +procedure TcxCustomCheckListBox.UpdateData; +begin + if ShowChecks then + DataBinding.SetStoredValue(evsValue, EditValue) + else + if ItemIndex >= 0 then + DataBinding.SetStoredValue(evsText, Items[ItemIndex].Text) + else + DataBinding.SetStoredValue(evsText, ''); +end; + +procedure TcxCustomCheckListBox.SetSize; +var + ANewHeight: Integer; +begin + if IsLoading then + Exit; +// TODO +// try + if not IntegralHeight or (Align in [alLeft, alRight, alClient]) then + begin + inherited SetSize; + Exit; + end; + ANewHeight := Height; + GetOptimalHeight(ANewHeight); + Height := ANewHeight; + inherited SetSize; +// finally +// if FInnerCheckListBox.HandleAllocated then +// KillMouseMoveMessages; +// end; +end; + +procedure TcxCustomCheckListBox.WndProc(var Message: TMessage); +begin + if FInnerCheckListBox <> nil then + case Message.Msg of + LB_ADDSTRING .. LB_MSGMAX: + begin + with Message do + Result := SendMessage(FInnerCheckListBox.Handle, Msg, WParam, LParam); + Exit; + end; + end; + inherited WndProc(Message); + if (FInnerCheckListBox <> nil) and (Message.Msg = WM_COMMAND) and (Message.WParamHi = LBN_SELCHANGE) then + FInnerCheckListBox.SetExternalScrollBarsParameters; +end; + +function TcxCustomCheckListBox.GetOnClickCheck : TcxClickCheckEvent; +begin + Result := FInnerCheckListBox.FOnClickCheck; +end; + +function TcxCustomCheckListBox.GetAllowGrayed : Boolean; +begin + Result := FInnerCheckListBox.FAllowGrayed; +end; + +function TcxCustomCheckListBox.GetAllowDblClickToggle: Boolean; +begin + Result := FInnerCheckListBox.AllowDblClickToggle; +end; + +function TcxCustomCheckListBox.GetAutoComplete: Boolean; +begin + Result := FInnerCheckListBox.AutoComplete; +end; + +function TcxCustomCheckListBox.GetAutoCompleteDelay: Cardinal; +begin + Result := FInnerCheckListBox.AutoCompleteDelay; +end; + +function TcxCustomCheckListBox.GetGlyph: TBitmap; +begin + Result := FInnerCheckListBox.Glyph; +end; + +function TcxCustomCheckListBox.GetGlyphCount: Integer; +begin + Result := FInnerCheckListBox.GlyphCount; +end; + +function TcxCustomCheckListBox.GetItemHeight: Integer; +begin + Result := FInnerCheckListBox.ItemHeight; +end; + +function TcxCustomCheckListBox.GetItems: TcxCheckListBoxItems; +begin + Result := FInnerCheckListBox.CheckItems; +end; + +function TcxCustomCheckListBox.GetColumns: Integer; +begin + Result := FInnerCheckListBox.Columns; +end; + +function TcxCustomCheckListBox.GetCount: Integer; +begin + Result := FInnerCheckListBox.Items.Count; +end; + +function TcxCustomCheckListBox.GetItemIndex: Integer; +begin + Result := FInnerCheckListBox.ItemIndex; +end; + +function TcxCustomCheckListBox.GetScrollWidth: Integer; +begin + Result := FInnerCheckListBox.ScrollWidth; +end; + +function TcxCustomCheckListBox.GetSelected(Index: Integer): Boolean; +begin + Result := FInnerCheckListBox.Selected[Index]; +end; + +function TcxCustomCheckListBox.GetTabWidth: Integer; +begin + Result := FInnerCheckListBox.TabWidth; +end; + +function TcxCustomCheckListBox.GetTopIndex: Integer; +begin + Result := FInnerCheckListBox.TopIndex; +end; + +procedure TcxCustomCheckListBox.ImagesChanged(Sender: TObject); +begin + if FInnerCheckListBox <> nil then + FInnerCheckListBox.AdjustItemHeight; +end; + +function TcxCustomCheckListBox.IsItemHeightStored: Boolean; +begin + Result := FListStyle <> lbStandard; +end; + +procedure TcxCustomCheckListBox.SetOnClickCheck(Value: TcxClickCheckEvent); +begin + FInnerCheckListBox.FOnClickCheck := Value; +end; + +procedure TcxCustomCheckListBox.SetAllowGrayed(Value: Boolean); +begin + FInnerCheckListBox.FAllowGrayed := Value; +end; + +procedure TcxCustomCheckListBox.SetAllowDblClickToggle(Value: Boolean); +begin + FInnerCheckListBox.AllowDblClickToggle := Value; +end; + +procedure TcxCustomCheckListBox.SetAutoComplete(Value: Boolean); +begin + FInnerCheckListBox.AutoComplete := Value; +end; + +procedure TcxCustomCheckListBox.SetAutoCompleteDelay(Value: Cardinal); +begin + FInnerCheckListBox.AutoCompleteDelay := Value; +end; + +procedure TcxCustomCheckListBox.SetDataBinding(Value: TcxCustomDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxCustomCheckListBox.SetEditValueFormat(Value: TcxCheckStatesValueFormat); + + procedure ResetGrayedStates; + var + I: Integer; + begin + Items.LockChanged(True); + try + for I := 0 to Items.Count - 1 do + if Items[I].State = cbsGrayed then + Items[I].State := cbsUnchecked; + finally + Items.LockChanged(False, False); + end; + end; + +begin + if Value <> FEditValueFormat then + begin + FEditValueFormat := Value; + if IsModified then + begin + if Value = cvfInteger then + ResetGrayedStates; + InnerCheckListBox.UpdateEditValue; + end + else + InnerCheckListBox.UpdateCheckStates; + end; +end; + +procedure TcxCustomCheckListBox.SetGlyph(Value: TBitmap); +begin + FInnerCheckListBox.SetGlyph(Value); +end; + +procedure TcxCustomCheckListBox.SetGlyphCount(Value: Integer); +begin + FInnerCheckListBox.SetGlyphCount(Value); +end; + +procedure TcxCustomCheckListBox.SetItemHeight(Value: Integer); +begin + if FListStyle <> lbStandard then + FInnerCheckListBox.ItemHeight := Value; +end; + +procedure TcxCustomCheckListBox.SetItems(Value: TcxCheckListBoxItems); +begin + FInnerCheckListBox.CheckItems.Assign(Value); + DataChange; +end; + +procedure TcxCustomCheckListBox.SetColumns(Value: Integer); +begin + FInnerCheckListBox.Columns := Value; +{$IFDEF DELPHI5} + //FInnerCheckListBox.SetExternalScrollBarsParameters; {<- Release 4.2.1} +{$ENDIF} +end; + +procedure TcxCustomCheckListBox.SetImageLayout(Value: TcxCheckListBoxImageLayout); +begin + if Value <> FImageLayout then + begin + FImageLayout := Value; + FInnerCheckListBox.FullRepaint; + end; +end; + +procedure TcxCustomCheckListBox.SetIntegralHeight(Value: Boolean); +begin + if Value <> FIntegralHeight then + begin + FIntegralHeight := Value; + SetSize; + end; +end; + +procedure TcxCustomCheckListBox.SetItemIndex(Value: Integer); +begin + FInnerCheckListBox.ItemIndex := Value; +end; + +procedure TcxCustomCheckListBox.SetListStyle(Value: TListBoxStyle); +begin + if Value <> FListStyle then + begin + FListStyle := Value; + if Value = lbStandard then + Value := lbOwnerDrawFixed; + with FInnerCheckListBox do + if Style = Value then + RecreateWnd + else + Style := Value; + end; +end; + +procedure TcxCustomCheckListBox.SetImages(Value: TCustomImageList); +begin + cxSetImageList(Value, FImages, FImagesChangeLink, Self); +end; + +procedure TcxCustomCheckListBox.SetScrollWidth(Value: Integer); +begin + FInnerCheckListBox.ScrollWidth := Value; +end; + +procedure TcxCustomCheckListBox.SetSelected(Index: Integer; Value: Boolean); +begin +{$IFNDEF DELPHI6} + if not InnerCheckListBox.MultiSelect then + begin + if Selected[Index] <> Value then + if Value then + ItemIndex := Index + else + ItemIndex := -1; + end + else +{$ENDIF} + InnerCheckListBox.Selected[Index] := Value; +end; + +procedure TcxCustomCheckListBox.SetShowChecks(Value: Boolean); +begin + if Value <> FShowChecks then + begin + FShowChecks := Value; + FInnerCheckListBox.AdjustItemHeight; + DataBinding.Reset; + end; +end; + +procedure TcxCustomCheckListBox.SetSorted(Value: Boolean); +begin + if Value <> FSorted then + begin + FSorted := Value; + if Value then + Sort; + end; +end; + +procedure TcxCustomCheckListBox.SetTabWidth(Value: Integer); +begin + FInnerCheckListBox.TabWidth := Value; +end; + +procedure TcxCustomCheckListBox.SetTopIndex(Value: Integer); +begin + FInnerCheckListBox.TopIndex := Value; +end; + +{$IFDEF DELPHI6} +procedure TcxCustomCheckListBox.SetCount(Value: Integer); +begin + FInnerCheckListBox.Count := Value; +end; +{$ENDIF} + +procedure TcxCustomCheckListBox.DoEditValueChanged; +begin + if Assigned(FOnEditValueChanged) then + FOnEditValueChanged(Self); +end; + +function TcxCustomCheckListBox.GetInnerCheckListBoxClass: TcxCustomInnerCheckListBoxClass; +begin + Result := TcxCustomInnerCheckListBox; +end; + +function TcxCustomCheckListBox.IsValueValid(const AValue: Variant; + AAllowEmpty: Boolean): Boolean; +begin + Result := False; + if (IsVarEmpty(AValue) and AAllowEmpty) or VarIsNumericEx(AValue) then + Result := True + else + if VarIsStr(AValue) then + Result := IsValidStringForInt(VarToStr(AValue)) or + IsValidStringForDouble(VarToStr(AValue)); +end; + +procedure TcxCustomCheckListBox.SetEditValue(const Value: TcxEditValue); +var + AEditValueChanged: Boolean; +begin + IsModified := False; + + if Assigned(FOnEditValueChanged) then + AEditValueChanged := not InternalVarEqualsExact(Value, FEditValue) + else + AEditValueChanged := False; + + FEditValue := Value; + InnerCheckListBox.UpdateCheckStates; + + if AEditValueChanged then + FOnEditValueChanged(Self); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxColorComboBox.pas b/official/x.35/ExpressEditors Library 5/Sources/cxColorComboBox.pas new file mode 100644 index 00000000..f3c953c3 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxColorComboBox.pas @@ -0,0 +1,2272 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxColorComboBox; + +interface + +{$I cxVer.inc} + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Messages, TypInfo, SysUtils, Classes, Controls, Graphics, StdCtrls, + Forms, Dialogs, cxClasses, cxControls, cxContainer, cxGraphics, + cxCustomData, cxDataStorage, cxDataUtils, cxVariants, + cxEdit, cxTextEdit, cxEditUtils, cxMaskEdit, cxDropDownEdit, cxImageComboBox, + cxExtEditConsts, cxFilterControlUtils; + +type + TcxColorBoxAlign = (cbaLeft, cbaRight); + TcxColorNamingConvention = (cxncNone, cxncDelphi, cxncHTML4, cxncX11); + TcxColorPrepareList = (cxplNone, cxplDelphi, cxplHTML4, cxplX11, cxplX11Ordered); + TcxColorValueFormat = (cxcvRGB, cxcvHexadecimal, cxcvInteger); + TcxDefaultColorStyle = (cxdcClear, cxdcColor, cxdcHatched, cxdcText, cxdcCustom); + TcxMRUColorAction = (mcaNone, mcaMoved, mcaAdded, mcaDeleted); + +type + { TcxColorComboBoxItem } + + TcxColorComboBoxItem = class(TCollectionItem) + private + FColor: TColor; + FDescription: TCaption; + FIsCustomColor: Boolean; + FTag: TcxTag; + function GetDescription: TCaption; + function IsTagStored: Boolean; + procedure SetColor(const Value: TColor); + procedure SetDescription(const Value: TCaption); + public + constructor Create(Collection: TCollection); override; + procedure Assign(Source: TPersistent); override; + property IsCustomColor: Boolean read FIsCustomColor; + published + property Color: TColor read FColor write SetColor; + property Description: TCaption read GetDescription write SetDescription; + property Tag: TcxTag read FTag write FTag stored IsTagStored; + end; + + { TcxColorComboBoxItems } + + TcxCustomColorComboBoxProperties = class; + + TcxColorComboBoxItems = class(TOwnedCollection) + private + FOnUpdate: TNotifyEvent; + function GetItems(Index: Integer): TcxColorComboBoxItem; + procedure SetItems(Index: Integer; const Value: TcxColorComboBoxItem); + protected + procedure Update(Item: TCollectionItem); override; + property OnUpdate: TNotifyEvent read FOnUpdate write FOnUpdate; + public + function Owner: TcxCustomColorComboBoxProperties; + property Items[Index: Integer]: TcxColorComboBoxItem read GetItems write SetItems; default; + function FindColorItem(const AColor: TColor): TcxColorComboBoxItem; virtual; + function GetIndexByColor(AColor: TColor): Integer; + function GetColorByIndex(AIndex: Integer; ADefaultColor: TColor): TColor; + function AddColor(const AColor: TColor; + const ADescription: string): TcxColorComboBoxItem; virtual; + function InsertColor(Index: Integer; const AColor: TColor; + const ADescription: string): TcxColorComboBoxItem; virtual; + function Add: TcxColorComboBoxItem; + function Insert(Index: Integer): TcxColorComboBoxItem; + procedure Move(CurIndex, NewIndex: Integer); virtual; + procedure ClearCustom; virtual; + procedure ClearNonCustom; virtual; + end; + + { TcxCustomColorComboBoxViewInfo } + + TcxCustomColorComboBoxViewInfo = class(TcxCustomTextEditViewInfo) + private + FBkColor: TColor; + FColorBoxWidth: Integer; + FColorBoxAlign: TcxColorBoxAlign; + FColorBoxRect: TRect; + FColorBoxFrameColor: TColor; + FColorBoxColor: TColor; + FShowDescriptions: Boolean; + FDefaultColorStyle: TcxDefaultColorStyle; + FFoundItem: Boolean; + public + property BkColor: TColor read FBkColor write FBkColor; + property ColorBoxWidth: Integer read FColorBoxWidth write FColorBoxWidth; + property ColorBoxAlign: TcxColorBoxAlign read FColorBoxAlign write FColorBoxAlign; + property ColorBoxFrameColor: TColor read FColorBoxFrameColor write FColorBoxFrameColor; + property ColorBoxColor: TColor read FColorBoxColor write FColorBoxColor; + property ColorBoxRect: TRect read FColorBoxRect write FColorBoxRect; + property DefaultColorStyle: TcxDefaultColorStyle read FDefaultColorStyle write FDefaultColorStyle; + property ShowDescriptions: Boolean read FShowDescriptions write FShowDescriptions; + property FoundItem: Boolean read FFoundItem write FFoundItem; + procedure Paint(ACanvas: TcxCanvas); override; + procedure Offset(DX, DY: Integer); override; + end; + + { TcxCustomColorComboBoxViewData } + + TcxCustomColorComboBoxViewData = class(TcxCustomDropDownEditViewData) + private + function GetProperties: TcxCustomColorComboBoxProperties; + protected + procedure CalculateViewInfoProperties(AViewInfo: TcxCustomEditViewInfo); virtual; + function InternalEditValueToDisplayText(AEditValue: TcxEditValue): string; override; + function InternalGetEditConstantPartSize(ACanvas: TcxCanvas; AIsInplace: Boolean; + AEditSizeProperties: TcxEditSizeProperties; var MinContentSize: TSize; + AViewInfo: TcxCustomEditViewInfo): TSize; override; + function IsComboBoxStyle: Boolean; override; + public + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; + const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); override; + procedure DisplayValueToDrawValue(const ADisplayValue: TcxEditValue; + AViewInfo: TcxCustomEditViewInfo); override; + procedure EditValueToDrawValue(ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + AViewInfo: TcxCustomEditViewInfo); override; + property Properties: TcxCustomColorComboBoxProperties read GetProperties; + end; + + { TcxColorComboBoxListBox } + + TcxCustomColorComboBox = class; + + TcxCustomColorComboBoxListBox = class(TcxCustomComboBoxListBox) + private + function GetEdit: TcxCustomColorComboBox; + protected + procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + public + function GetItemHeight(AIndex: Integer = -1): Integer; override; + property Edit: TcxCustomColorComboBox read GetEdit; + end; + + { TcxColorComboBoxLookupData } + + TcxColorComboBoxLookupData = class(TcxComboBoxLookupData) + protected + function GetListBoxClass: TcxCustomEditListBoxClass; override; + function GetItem(Index: Integer): string; override; + function GetItemCount: Integer; override; + function InternalChangeCurrentMRUColorPosition(const AColor: TColor): Integer; virtual; + public + function GetVisualAreaPreferredSize(AMaxHeight: Integer; + AWidth: Integer = 0): TSize; override; + procedure TextChanged; override; + end; + + TcxColorComboStyle = (cxccsComboList, cxccsComboEdit); + TcxColorDialogType = (cxcdtDefault, cxcdtCustom); + TcxSelectCustomColorEvent = procedure(Sender: TObject; var AColor: TColor; + var AColorDescription: string; var AddToList: Boolean) of object; + TcxNamingConventionEvent = procedure(Sender: TObject; const AColor: TColor; + var AColorDescription: string) of object; + TcxChangeItemIndexEvent = procedure(Sender: TObject; const AIndex: Integer) of object; + TcxGetDefaultColorEvent = procedure(Sender: TObject; var AColor: TColor) of object; + + { TcxCustomColorComboBoxProperties } + + TcxCustomColorComboBoxProperties = class(TcxCustomComboBoxProperties) + private + FAllowSelectColor: Boolean; + FColorComboStyle: TcxColorComboStyle; + FColorBoxAlign: TcxColorBoxAlign; + FColorBoxFrameColor: TColor; + FColorBoxWidth: Integer; + FColorDialogType: TcxColorDialogType; + FColorValueFormat: TcxColorValueFormat; + FDefaultColor: TColor; + FDefaultDescription: string; + FDefaultColorStyle: TcxDefaultColorStyle; + + FItems: TcxColorComboBoxItems; + FCustomColors: TcxColorComboBoxItems; + FMRUColors: TcxColorComboBoxItems; + + FMaxMRUColors: Byte; + FNamingConvention: TcxColorNamingConvention; + FShowDescriptions: Boolean; + FOnNamingConvention: TcxNamingConventionEvent; + FOnSelectCustomColor: TcxSelectCustomColorEvent; + FOnAddedMRUColor: TNotifyEvent; + FOnDeletedMRUColor: TNotifyEvent; + FOnGetDefaultColor: TcxGetDefaultColorEvent; + FOnLoadColorList: TNotifyEvent; + FInternalUpdate: Boolean; + FPrepareList: TcxColorPrepareList; + function ColorItemByIndex(AIndex: Integer): TcxColorComboBoxItem; + procedure DeleteOverMRUColors; + function DoConvertNaming(AIndex: Integer): string; + function GetItems: TcxColorComboBoxItems; + procedure InternalGetColorComboBoxDisplayValue(AItemIndex: Integer; + const AEditValue: TcxEditValue; out AColor: TColor; + out ADescription: string; out AColorFound: Boolean); + procedure InternalPrepareColorList(APrepareList: TcxColorPrepareList); overload; + procedure InternalPrepareColorList(AColorValues: array of TColor; + AColorNames: array of string); overload; + function IsDefaultDescriptionStored: Boolean; + procedure ReadCustomColors(Reader: TReader); + procedure ReadPrepareInfo(Reader: TReader); + procedure SetAllowSelectColor(Value: Boolean); + procedure SetColorBoxAlign(Value: TcxColorBoxAlign); + procedure SetColorBoxFrameColor(Value: TColor); + procedure SetColorBoxWidth(Value: Integer); + procedure SetColorComboStyle(Value: TcxColorComboStyle); + procedure SetColorValueFormat(Value: TcxColorValueFormat); + procedure SetDefaultColor(Value: TColor); + procedure SetDefaultDescription(Value: string); + procedure SetDefaultColorStyle(Value: TcxDefaultColorStyle); + + procedure SetCustomColors(Value: TcxColorComboBoxItems); + procedure SetItems(const Value: TcxColorComboBoxItems); + procedure SetMaxMRUColors(Value: Byte); + + procedure SetNamingConvention(Value: TcxColorNamingConvention); + procedure SetPrepareList(Value: TcxColorPrepareList); + procedure SetShowDescriptions(const Value: Boolean); + procedure SynchronizeCustomColors; + procedure CustomColorChanged(ASender: TObject); + procedure ValidateMRUColors; + protected + procedure DefineProperties(Filer: TFiler); override; + function ShowColorBox(AColorFound: Boolean): Boolean; + class function GetLookupDataClass: TcxInterfacedPersistentClass; override; + class function GetPopupWindowClass: TcxCustomEditPopupWindowClass; override; + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + function HasDisplayValue: Boolean; override; + function IsEditValueNumeric: Boolean; override; + + function GetColorByIndex(AIndex: Integer): TColor; + function GetIndexByColor(AColor: TColor): Integer; + function GetDescriptionByIndex(AIndex: Integer): string; + function IndexByValue(const AValue: TcxEditValue): Integer; + function IsDisplayValueNumeric: Boolean; virtual; + + function AddMRUColor(const AColor: TColor): TcxMRUColorAction; virtual; + function DelMRUColor(const AColor: TColor): TcxMRUColorAction; virtual; + procedure ClearMRUColors; virtual; + procedure DoGetDefaultColor(var AColor: TColor); virtual; + procedure TranslateValues(const AEditValue: TcxEditValue; + var AColor: TColor; var ADescription: string; ANeedDescription: Boolean = False); + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure Changed; override; + function CompareDisplayValues(const AEditValue1, AEditValue2: TcxEditValue): Boolean; override; + class function GetContainerClass: TcxContainerClass; override; + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + function GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; override; + function IsDisplayValueValid(var DisplayValue: TcxEditValue; AEditFocused: Boolean): Boolean; override; + procedure PrepareDisplayValue(const AEditValue: TcxEditValue; + var DisplayValue: TcxEditValue; AEditFocused: Boolean); override; + function GetSupportedOperations: TcxEditSupportedOperations; override; + function GetDisplayText(const AEditValue: TcxEditValue; AFullText: + Boolean = False; AIsInplace: Boolean = True): WideString; override; + procedure Update(AProperties: TcxCustomEditProperties); override; + procedure GetColorComboBoxDisplayValue(const AEditValue: TcxEditValue; + out AColor: TColor; out ADescription: string; out AColorFound: Boolean); + + procedure PrepareColorList(APrepareList: TcxColorPrepareList; ASaveCustom, ASaveMRU: Boolean); + procedure PrepareDelphiColorList(const ASaveCustom, ASaveMRU: Boolean); + procedure PrepareHTML4ColorList(const ASaveCustom, ASaveMRU: Boolean); + procedure PrepareX11ColorList(const ASaveCustom, ASaveMRU: Boolean); + procedure PrepareX11OrderedColorList(const ASaveCustom, ASaveMRU: Boolean); + // !!! + property AllowSelectColor: Boolean read FAllowSelectColor + write SetAllowSelectColor default False; + property ColorBoxAlign: TcxColorBoxAlign read FColorBoxAlign + write SetColorBoxAlign default cbaLeft; + property ColorBoxFrameColor: TColor read FColorBoxFrameColor + write SetColorBoxFrameColor default clBtnShadow; + property ColorBoxWidth: Integer read FColorBoxWidth write SetColorBoxWidth + default 30; + property ColorComboStyle: TcxColorComboStyle read FColorComboStyle + write SetColorComboStyle default cxccsComboEdit; + property ColorDialogType: TcxColorDialogType read FColorDialogType + write FColorDialogType default cxcdtDefault; + property ColorValueFormat: TcxColorValueFormat read FColorValueFormat + write SetColorValueFormat default cxcvRGB; + property DefaultColor: TColor read FDefaultColor write SetDefaultColor + default clWindow; + property DefaultColorStyle: TcxDefaultColorStyle read FDefaultColorStyle + write SetDefaultColorStyle default cxdcColor; + property DefaultDescription: string read FDefaultDescription + write SetDefaultDescription stored IsDefaultDescriptionStored; + + property CustomColors: TcxColorComboBoxItems read FCustomColors write SetCustomColors; + property Items: TcxColorComboBoxItems read GetItems write SetItems; + property MaxMRUColors: Byte read FMaxMRUColors write SetMaxMRUColors + default 10; + property MRUColors: TcxColorComboBoxItems read FMRUColors write FMRUColors; + + property NamingConvention: TcxColorNamingConvention read FNamingConvention + write SetNamingConvention default cxncDelphi; + property PrepareList: TcxColorPrepareList read FPrepareList + write SetPrepareList default cxplDelphi; + property ShowDescriptions: Boolean read FShowDescriptions + write SetShowDescriptions default True; + property OnAddedMRUColor: TNotifyEvent read FOnAddedMRUColor + write FOnAddedMRUColor; + property OnDeletedMRUColor: TNotifyEvent read FOnDeletedMRUColor + write FOnDeletedMRUColor; + property OnGetDefaultColor: TcxGetDefaultColorEvent read FOnGetDefaultColor + write FOnGetDefaultColor; + property OnNamingConvention: TcxNamingConventionEvent + read FOnNamingConvention write FOnNamingConvention; + property OnSelectCustomColor: TcxSelectCustomColorEvent + read FOnSelectCustomColor write FOnSelectCustomColor; + end; + + { TcxColorComboBoxProperties } + + TcxColorComboBoxProperties = class(TcxCustomColorComboBoxProperties) + published + property Alignment; + property AllowSelectColor; + property AssignedValues; + property BeepOnError; + property ButtonGlyph; + property CharCase; + property ClearKey; + property ColorBoxAlign; + property ColorBoxFrameColor; + property ColorBoxWidth; + property ColorComboStyle; + property ColorDialogType; + property ColorValueFormat; + property CustomColors; + property DefaultColor; + property DefaultColorStyle; + property DefaultDescription; + property DropDownAutoWidth; + property DropDownRows; + property DropDownSizeable; + property DropDownWidth; + property ImeMode; + property ImeName; + property ImmediateDropDown; + property ImmediatePost; + property ImmediateUpdateText; + property MaxMRUColors; + property NamingConvention; + property OEMConvert; + property PopupAlignment; + property PostPopupValueOnTab; + property PrepareList; + property ReadOnly; + property Revertable; + property ShowDescriptions; + property ValidateOnEnter; + property OnAddedMRUColor; + property OnChange; + property OnCloseUp; + property OnDeletedMRUColor; + property OnEditValueChanged; + property OnGetDefaultColor; + property OnInitPopup; + property OnNamingConvention; + property OnNewLookupDisplayText; + property OnPopup; + property OnSelectCustomColor; + end; + + { TcxCustomColorComboBoxInnerEdit } + + TcxCustomColorComboBoxInnerEdit = class(TcxCustomComboBoxInnerEdit); + + { TcxColorComboBoxPopupWindow } + + TcxColorComboBoxPopupWindow = class(TcxComboBoxPopupWindow) + public + property ViewInfo; + property SysPanelStyle; + end; + + { TcxCustomColorComboBox } + + TcxCustomColorComboBox = class(TcxCustomComboBox) + private + FColorDialog: TColorDialog; + FDontCheckModifiedWhenUpdatingMRUList: Boolean; + FIsDialogShowed: Boolean; + FNeedsUpdateMRUList: Boolean; + FPropertiesUpdate: Boolean; + function GetColorDialog: TColorDialog; + function GetColorValue: TColor; + function IsColorValueStored: Boolean; + procedure SetColorValue(Value: TColor); + function GetLookupData: TcxColorComboBoxLookupData; + function GetProperties: TcxCustomColorComboBoxProperties; + function GetActiveProperties: TcxCustomColorComboBoxProperties; + procedure SetProperties(Value: TcxCustomColorComboBoxProperties); + procedure PropertiesLoadColorListHandler(Sender: TObject); + procedure UpdateMRUList; + procedure FlushEditValue; + protected + procedure AfterPosting; override; + procedure ContainerStyleChanged(Sender: TObject); override; + procedure PropertiesChanged(Sender: TObject); override; + procedure DblClick; override; + procedure DoButtonClick(AButtonVisibleIndex: Integer); override; + function GetDisplayValue: string; override; + function GetEditingValue: TcxEditValue; override; + function GetInnerEditClass: TControlClass; override; + procedure Initialize; override; + procedure InitializePopupWindow; override; + function IsValidChar(AChar: Char): Boolean; override; + procedure DoEditKeyDown(var Key: Word; Shift: TShiftState); override; + function LookupKeyToEditValue(const AKey: TcxEditValue): TcxEditValue; override; + procedure InternalSetEditValue(const Value: TcxEditValue; + AValidateEditValue: Boolean); override; + procedure SynchronizeDisplayValue; override; + procedure CloseUp(AReason: TcxEditCloseUpReason); override; + procedure DoSelectCustomColor(Sender: TObject); virtual; + procedure FixMRUPosition(AColor: TColor); virtual; + procedure ClearEditValue; virtual; + procedure DoOnSelectCustomColor(var AColor: TColor; + var AColorDescription: string; var AddToList: Boolean); + property ColorValue: TColor read GetColorValue write SetColorValue + stored IsColorValueStored; + property ColorDialog: TColorDialog read GetColorDialog; + property LookupData: TcxColorComboBoxLookupData read GetLookupData; + public + destructor Destroy; override; + + function Deactivate: Boolean; override; + function Focused: Boolean; override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + function IsChildWindow(AWnd: THandle): Boolean; override; + procedure PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); override; + + function AddMRUColor(const AColor: TColor): TcxMRUColorAction; + function DelMRUColor(const AColor: TColor): TcxMRUColorAction; + + procedure PrepareColorList(APrepareList: TcxColorPrepareList; ASaveCustom, ASaveMRU: Boolean); + procedure PrepareDelphiColorList(const ASaveCustom, ASaveMRU: Boolean); + procedure PrepareHTML4ColorList(const ASaveCustom, ASaveMRU: Boolean); + procedure PrepareX11ColorList(const ASaveCustom, ASaveMRU: Boolean); + procedure PrepareX11OrderedColorList(const ASaveCustom, ASaveMRU: Boolean); + + property ActiveProperties: TcxCustomColorComboBoxProperties + read GetActiveProperties; + property Properties: TcxCustomColorComboBoxProperties read GetProperties + write SetProperties; + end; + + { TcxColorComboBox } + + TcxColorComboBox = class(TcxCustomColorComboBox) + private + function GetActiveProperties: TcxColorComboBoxProperties; + function GetProperties: TcxColorComboBoxProperties; + procedure SetProperties(Value: TcxColorComboBoxProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxColorComboBoxProperties + read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property ColorValue; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxColorComboBoxProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + + { TcxFilterColorComboBoxHelper } + + TcxFilterColorComboBoxHelper = class(TcxFilterComboBoxHelper) + public + class function GetFilterEditClass: TcxCustomEditClass; override; + class function GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; override; + class procedure InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); override; + end; + +implementation + +uses + cxExtEditUtils, dxThemeConsts, dxThemeManager, dxUxTheme; + +type + TCanvasAccess = class(TCanvas); + +function ConvertColorName(AColor: TColor; ADescription: string; + const ANamingConvention: TcxColorNamingConvention; + const AColorValueFormat: TcxColorValueFormat): string; + + function ConvertUnknowColor: string; + var + RGB: Cardinal; + begin + RGB := ColorToRGB(AColor); + case AColorValueFormat of + cxcvRGB: + Result := Format('%d.%d.%d', [GetRValue(RGB), GetGValue(RGB), GetBValue(RGB)]); + cxcvHexadecimal: + Result := Format('%s%.2x%.2x%.2x', [HexDisplayPrefix, GetRValue(RGB), GetGValue(RGB), GetBValue(RGB)]); + else + Result := IntToStr(AColor); + end; + end; + + function GetColorName(AColorValues: array of TColor; AColorNames: array of string): string; + var + I: Integer; + begin + for I := Low(AColorValues) to High(AColorValues) do + if AColorValues[I] = AColor then + begin + Result := AColorNames[I]; + Exit; + end; + Result := ConvertUnknowColor; + end; + +begin + case ANamingConvention of + cxncNone: Result := ADescription; + cxncDelphi: Result := GetColorName(cxDelphiColorValues, cxDelphiColorNames); + cxncHTML4: Result := GetColorName(cxHTML4ColorValues, cxHTML4ColorNames); + cxncX11: Result := GetColorName(cxX11ColorValues, cxX11ColorNames); + end; +end; + +procedure DrawColorBox(ACanvas: TcxCanvas;ARect: TRect; const AFrameColor, + ABoxColor, ABkColor: TColor; const DefaultColorStyle: TcxDefaultColorStyle); +var + FRectangle: TRect; +begin + if (ARect.Left <> ARect.Right) and (ARect.Bottom <> ARect.Top) then + begin + ACanvas.Brush.Style := bsSolid; + ACanvas.Brush.Color := ABkColor; + ACanvas.FrameRect(ARect); + InflateRect(ARect, -1, -1); + ACanvas.Brush.Color := AFrameColor; + ACanvas.FrameRect(ARect); + InflateRect(ARect, -1, -1); + case DefaultColorStyle of + cxdcClear: + begin + ACanvas.Brush.Color := ABkColor; + ACanvas.FillRect(ARect); + end; + cxdcColor, cxdcCustom, cxdcText: + begin + ACanvas.Brush.Color := ABoxColor; + ACanvas.FillRect(ARect); + end; + cxdcHatched: begin + ACanvas.Brush.Color := ABkColor; + ACanvas.FillRect(ARect); + ACanvas.Pen.Color := ABkColor; + ACanvas.Brush.Color := ABoxColor; + ACanvas.Brush.Style := bsDiagCross; + FRectangle := ARect; + InflateRect(FRectangle, 1, 1); +{$IFDEF DELPHI5} + ACanvas.Canvas.Rectangle(FRectangle); +{$ELSE} + ACanvas.Canvas.Rectangle(FRectangle.Left, FRectangle.Top, FRectangle.Right, FRectangle.Bottom); +{$ENDIF} + ACanvas.Pen.Color := AFrameColor; + ACanvas.Polyline([Point(ARect.Left -1 , ARect.Top - 1), Point(ARect.Right, ARect.Top - 1), + Point(ARect.Right, ARect.Bottom), Point(ARect.Left - 1, ARect.Bottom), + Point(ARect.Left - 1, ARect.Top - 1)]); + end; + end; + ACanvas.Brush.Style := bsSolid; + end; +end; + +{ TcxColorComboBoxItem } + +constructor TcxColorComboBoxItem.Create(Collection: TCollection); +begin + inherited Create(Collection); + FIsCustomColor := True; + FDescription := ''; +end; + +procedure TcxColorComboBoxItem.Assign(Source: TPersistent); +begin + if Source is TcxColorComboBoxItem then + with TcxColorComboBoxItem(Source) do + begin + Self.Color := Color; + Self.Description := Description; + Self.FIsCustomColor := IsCustomColor; + Self.Tag := Tag; + end + else + inherited Assign(Source); +end; + +procedure TcxColorComboBoxItem.SetDescription(const Value: TCaption); +begin + if FDescription <> Value then + begin + FDescription := Value; + Changed(False); + end; +end; + +function TcxColorComboBoxItem.GetDescription: TCaption; +begin + Result := FDescription; +end; + +function TcxColorComboBoxItem.IsTagStored: Boolean; +begin + Result := FTag <> 0; +end; + +procedure TcxColorComboBoxItem.SetColor(const Value: TColor); +begin + if FColor <> Value then + begin + FColor := Value; + Changed(False); + end; +end; + +{ TcxColorComboBoxItems } + +function TcxColorComboBoxItems.GetItems(Index: Integer): TcxColorComboBoxItem; +begin + Result := TcxColorComboBoxItem(inherited Items[Index]); +end; + +procedure TcxColorComboBoxItems.SetItems(Index: Integer;const Value: TcxColorComboBoxItem); +begin + inherited Items[Index] := Value; +end; + +procedure TcxColorComboBoxItems.Update(Item: TCollectionItem); +begin + if Assigned(OnUpdate) then + OnUpdate(Item); + if Owner <> nil then + Owner.Changed; +end; + +function TcxColorComboBoxItems.Owner: TcxCustomColorComboBoxProperties; +begin + if GetOwner is TcxCustomColorComboBoxProperties then + Result := TcxCustomColorComboBoxProperties(GetOwner) + else + Result := nil; +end; + +function TcxColorComboBoxItems.FindColorItem(const AColor: TColor): TcxColorComboBoxItem; +var + I: Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + begin + if Items[I].Color = AColor then + begin + Result := Items[I]; + Break; + end; + end; +end; + +function TcxColorComboBoxItems.GetIndexByColor(AColor: TColor): Integer; +var + I : Integer; +begin + Result := -1; + for I := 0 to Count - 1 do + begin + if Items[I].Color = AColor then + begin + Result := I; + Break; + end; + end; +end; + +function TcxColorComboBoxItems.GetColorByIndex(AIndex: Integer; + ADefaultColor: TColor): TColor; +begin + Result := ADefaultColor; + if (AIndex >= 0) and (AIndex <= (Count - 1)) then + Result := Items[AIndex].Color; +end; + +function TcxColorComboBoxItems.Add: TcxColorComboBoxItem; +begin + Result := TcxColorComboBoxItem(inherited Add); +end; + +function TcxColorComboBoxItems.Insert(Index: Integer): TcxColorComboBoxItem; +begin + Result := TcxColorComboBoxItem(inherited Insert(Index)); +end; + +function TcxColorComboBoxItems.AddColor(const AColor: TColor; + const ADescription: string): TcxColorComboBoxItem; +begin + Result := nil; + if (FindColorItem(AColor) <> nil) then Exit; + Result := Add; + Result.Color := AColor; + Result.Description := ADescription; +end; + +function TcxColorComboBoxItems.InsertColor(Index: Integer; const AColor: TColor; + const ADescription: string): TcxColorComboBoxItem; +begin + Result := nil; + if (FindColorItem(AColor) <> nil) then Exit; + Result := Insert(Index); + Result.Color := AColor; + Result.Description := ADescription; +end; + +procedure TcxColorComboBoxItems.Move(CurIndex, NewIndex: Integer); +var + FNewColorItem, FOldColorItem: TcxColorComboBoxItem; +begin + if CurIndex = NewIndex then Exit; + FOldColorItem := Items[CurIndex]; + FNewColorItem := Insert(NewIndex); + FNewColorItem.Assign(FOldColorItem); + FOldColorItem.Free; +end; + +procedure TcxColorComboBoxItems.ClearCustom; +var + I: Integer; +begin + for I := Count - 1 downto 0 do + if Items[I].IsCustomColor then + Delete(I); +end; + +procedure TcxColorComboBoxItems.ClearNonCustom; +var + I: Integer; +begin + for I := (Count - 1) downto 0 do + if not Items[I].IsCustomColor then + Delete(I); +end; + +{ TcxCustomColorComboBoxViewInfo } + +procedure TcxCustomColorComboBoxViewInfo.Paint(ACanvas: TcxCanvas); +var + FRealDefaultColorStyle: TcxDefaultColorStyle; +begin + inherited Paint(ACanvas); + if not FoundItem and (DefaultColorStyle = cxdcText) then + Exit; + + FRealDefaultColorStyle := DefaultColorStyle; + if (DefaultColorStyle <> cxdcText) and FoundItem then + FRealDefaultColorStyle := cxdcColor; + DrawColorBox(ACanvas, ColorBoxRect, ColorBoxFrameColor, ColorBoxColor, + BkColor, FRealDefaultColorStyle); + + if not IsInplace and not ShowDescriptions and Focused and not HasPopupWindow then + begin + ACanvas.Font.Color := clBtnText; + ACanvas.Brush.Color := BackgroundColor; + TCanvasAccess(ACanvas.Canvas).RequiredState([csFontValid]); + ACanvas.Canvas.DrawFocusRect(ClientRect); + end; +end; + +procedure TcxCustomColorComboBoxViewInfo.Offset(DX, DY: Integer); +begin + inherited Offset(DX, DY); + OffsetRect(FColorBoxRect, DX, DY); +end; + +{ TcxCustomColorComboBoxViewData } + +procedure TcxCustomColorComboBoxViewData.Calculate(ACanvas: TcxCanvas; + const ABounds: TRect; const P: TPoint; Button: TcxMouseButton; + Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); +var + R: TRect; + FViewInfo: TcxCustomColorComboBoxViewInfo; +begin + if IsRectEmpty(ABounds) then begin + inherited; + Exit; + end; + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, AIsMouseEvent); + if (ABounds.Right = MaxInt) or (ABounds.Bottom = MaxInt) then Exit; + + FViewInfo := TcxCustomColorComboBoxViewInfo(AViewInfo); + CalculateViewInfoProperties(FViewInfo); + R := FViewInfo.ClientRect; + FViewInfo.FColorBoxRect := R; + if (FViewInfo.DefaultColorStyle = cxdcText) and not FViewInfo.FoundItem then + FViewInfo.FColorBoxRect.Right := FViewInfo.FColorBoxRect.Left + else + begin + if FViewInfo.ShowDescriptions then + begin + if FViewInfo.ColorBoxAlign = cbaLeft then + begin + FViewInfo.FColorBoxRect.Right := FViewInfo.FColorBoxRect.Left + FViewInfo.ColorBoxWidth ; + R.Left := FViewInfo.FColorBoxRect.Right; + end + else + begin + FViewInfo.FColorBoxRect.Left := FViewInfo.FColorBoxRect.Right - FViewInfo.ColorBoxWidth ; + R.Right := FViewInfo.FColorBoxRect.Left; + end; + end; + end; + FViewInfo.ClientRect := R; + if not IsInplace then + InflateRect(R, -2, -2) + else + InflateRect(R, -2, -1); + FViewInfo.TextRect := R; + if not FViewInfo.ShowDescriptions then FViewInfo.Text := ''; + if not IsInplace then FViewInfo.DrawSelectionBar := False; +end; + +procedure TcxCustomColorComboBoxViewData.CalculateViewInfoProperties(AViewInfo: TcxCustomEditViewInfo); +var + AProperties: TcxCustomColorComboBoxProperties; +begin + AProperties := TcxCustomColorComboBoxProperties(Properties); + with TcxCustomColorComboBoxViewInfo(AViewInfo) do + begin + BkColor := BackgroundColor; + ColorBoxAlign := AProperties.ColorBoxAlign; + ColorBoxWidth := AProperties.ColorBoxWidth; + ColorBoxFrameColor := AProperties.ColorBoxFrameColor; + ShowDescriptions := AProperties.ShowDescriptions; + DefaultColorStyle := AProperties.DefaultColorStyle; + if (DefaultColorStyle = cxdcCustom) and (not FoundItem) then + AProperties.DoGetDefaultColor(FColorBoxColor); + end; +end; + +function TcxCustomColorComboBoxViewData.InternalEditValueToDisplayText( + AEditValue: TcxEditValue): string; +var + AColor: TColor; + AColorFound: Boolean; + ADisplayText: string; +begin + Properties.GetColorComboBoxDisplayValue(AEditValue, AColor, ADisplayText, + AColorFound); + Result := ADisplayText; +end; + +function TcxCustomColorComboBoxViewData.InternalGetEditConstantPartSize(ACanvas: TcxCanvas; AIsInplace: Boolean; + AEditSizeProperties: TcxEditSizeProperties; var MinContentSize: TSize; + AViewInfo: TcxCustomEditViewInfo): TSize; +begin + Result := inherited InternalGetEditConstantPartSize(ACanvas, AIsInplace, + AEditSizeProperties, MinContentSize, AViewInfo); + if TcxCustomColorComboBoxProperties(Properties).ShowDescriptions then + Result.cx := Result.cx + TcxCustomColorComboBoxProperties(Properties).ColorBoxWidth + 6; +end; + +function TcxCustomColorComboBoxViewData.IsComboBoxStyle: Boolean; +begin + Result := True; +end; + +function TcxCustomColorComboBoxViewData.GetProperties: TcxCustomColorComboBoxProperties; +begin + Result := TcxCustomColorComboBoxProperties(FProperties); +end; + +procedure TcxCustomColorComboBoxViewData.DisplayValueToDrawValue(const ADisplayValue: TcxEditValue; + AViewInfo: TcxCustomEditViewInfo); +var + AViewInfoAccess: TcxCustomColorComboBoxViewInfo; +begin + if (Edit = nil) or IsVarEmpty(ADisplayValue) then + Exit; + AViewInfoAccess := TcxCustomColorComboBoxViewInfo(AViewInfo); + Properties.InternalGetColorComboBoxDisplayValue( + TcxCustomColorComboBox(Edit).ILookupData.CurrentKey, Edit.EditValue, + AViewInfoAccess.FColorBoxColor, AViewInfoAccess.Text, + AViewInfoAccess.FFoundItem); +end; + +procedure TcxCustomColorComboBoxViewData.EditValueToDrawValue(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; AViewInfo: TcxCustomEditViewInfo); +var + AColorComboViewInfo: TcxCustomColorComboBoxViewInfo; +begin + AColorComboViewInfo := TcxCustomColorComboBoxViewInfo(AViewInfo); + Properties.GetColorComboBoxDisplayValue(AEditValue, + AColorComboViewInfo.FColorBoxColor, AColorComboViewInfo.Text, + AColorComboViewInfo.FFoundItem); + if PreviewMode then + AColorComboViewInfo.Text := ''; + DoOnGetDisplayText(string(AColorComboViewInfo.Text)); +end; + +{ TcxCustomColorComboBoxListBox } + +function TcxCustomColorComboBoxListBox.GetItemHeight(AIndex: Integer = -1): Integer; +begin + with Edit.ActiveProperties do + begin + if ItemHeight > 0 then + Result := ItemHeight + else + begin + Result := inherited GetItemHeight; + if Result < 16 then + Result := 16; + end; + if (AIndex >= 0) and Edit.IsOnMeasureItemEventAssigned then + Edit.DoOnMeasureItem(AIndex, Canvas, Result); + if AIndex = FMRUColors.Count - 1 then + Inc(Result, MRUDelimiterWidth); + end; +end; + +procedure TcxCustomColorComboBoxListBox.DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); +var + AColorBoxRect, ATextRect: TRect; + AFlags: Longint; +begin + SaveCanvasParametersForFocusRect; + try + if DoDrawItem(Index, Rect, State) then + Exit; + + Canvas.FillRect(Rect); + AColorBoxRect := Rect; + if Index = Edit.ActiveProperties.MRUColors.Count - 1 then + Dec(AColorBoxRect.Bottom, MRUDelimiterWidth); + ATextRect := AColorBoxRect; + if Edit.ActiveProperties.ShowDescriptions then + begin + AFlags := DrawTextBiDiModeFlags(DT_SINGLELINE or DT_LEFT or DT_NOPREFIX); + if Edit.ActiveProperties.ColorBoxAlign = cbaRight then + begin + Dec(ATextRect.Right, Edit.ActiveProperties.ColorBoxWidth); + AColorBoxRect.Left := ATextRect.Right; + end + else + begin + Inc(ATextRect.Left, Edit.ActiveProperties.ColorBoxWidth); + AColorBoxRect.Right := ATextRect.Left; + end; + Canvas.DrawText(GetItem(Index), ATextRect, AFlags); + end + else + ATextRect.Left := AColorBoxRect.Right; + DrawColorBox(Canvas, AColorBoxRect, Edit.ActiveProperties.ColorBoxFrameColor, + Edit.ActiveProperties.GetColorByIndex(Index), Canvas.Brush.Color, cxdcColor); + if Index = Edit.ActiveProperties.FMRUColors.Count - 1 then + DrawMRUDelimiter(Canvas.Canvas, Rect, odSelected in State); + finally + RestoreCanvasParametersForFocusRect; + end; +end; + +procedure TcxCustomColorComboBoxListBox.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + if Button <> mbLeft then Exit; + SetCaptureControl(nil); + Edit.CloseUp(crEnter); +end; + +function TcxCustomColorComboBoxListBox.GetEdit: TcxCustomColorComboBox; +begin + Result := TcxCustomColorComboBox(inherited Edit); +end; + +{ TcxColorComboBoxLookupData } + +function TcxColorComboBoxLookupData.GetListBoxClass: TcxCustomEditListBoxClass; +begin + Result := TcxCustomColorComboBoxListBox; +end; + +function TcxColorComboBoxLookupData.GetItem(Index: Integer): string; +begin + with TcxCustomColorComboBoxProperties(ActiveProperties) do + Result := GetDescriptionByIndex(Index); +end; + +function TcxColorComboBoxLookupData.GetItemCount: Integer; +begin + with TcxCustomColorComboBoxProperties(ActiveProperties) do + Result := MRUColors.Count + Items.Count; +end; + +function TcxColorComboBoxLookupData.GetVisualAreaPreferredSize( + AMaxHeight: Integer; AWidth: Integer = 0): TSize; +var + AScrollWidth: Integer; +begin + Result := inherited GetVisualAreaPreferredSize(AMaxHeight, AWidth); + Result.cx := Result.cx + + TcxCustomColorComboBoxProperties(ActiveProperties).ColorBoxWidth; + AScrollWidth := List.ScrollWidth; + Inc(AScrollWidth, + TcxCustomColorComboBoxProperties(ActiveProperties).ColorBoxWidth); + List.ScrollWidth := 0; + List.ScrollWidth := AScrollWidth; +end; + +procedure TcxColorComboBoxLookupData.TextChanged; +begin + if not TcxCustomColorComboBox(Edit).EditModeSetting then + with TcxCustomColorComboBoxProperties(ActiveProperties) do + InternalSetCurrentKey(IndexByValue(Edit.EditValue)); +end; + +function TcxColorComboBoxLookupData.InternalChangeCurrentMRUColorPosition( + const AColor: TColor): Integer; +var + FIndex: Integer; +begin + Result := ItemIndex; + with TcxCustomColorComboBoxProperties(ActiveProperties) do + if ItemIndex >= (FMRUColors.Count - 1) then + begin + FIndex := FMRUColors.GetIndexByColor(AColor); + if FIndex >= 0 then + begin + Result := FIndex; + InternalSetCurrentKey(FIndex); + end; + end; +end; +{ TcxColorComboBoxLookupData } + +{ TcxCustomColorComboBoxProperties } + +constructor TcxCustomColorComboBoxProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FItems := TcxColorComboBoxItems.Create(Self, TcxColorComboBoxItem); + FCustomColors := TcxColorComboBoxItems.Create(Self, TcxColorComboBoxItem); + FCustomColors.OnUpdate := CustomColorChanged; + FMRUColors := TcxColorComboBoxItems.Create(Self, TcxColorComboBoxItem); + + DropDownListStyle := lsFixedList; + FInternalUpdate := False; + FColorBoxAlign := cbaLeft; + FColorBoxWidth := 30; + FColorBoxFrameColor := clBtnShadow; + FColorDialogType := cxcdtDefault; + FShowDescriptions := True; + FDefaultColor := clWindow; + FDefaultDescription := cxGetResourceString(@cxSColorComboBoxDefaultDescription); + FDefaultColorStyle := cxdcColor; + FAllowSelectColor := False; + FColorComboStyle := cxccsComboEdit; + FNamingConvention := cxncDelphi; + FColorValueFormat := cxcvRGB; + FMaxMRUColors := 10; + PrepareList := cxplDelphi; + Buttons.Add; + GlyphButtonIndex := 1; + Buttons[1].Kind := bkEllipsis; + Buttons[1].Default := False; + Buttons[1].Visible := False; +end; + +destructor TcxCustomColorComboBoxProperties.Destroy; +begin + FreeAndNil(FMRUColors); + FreeAndNil(FCustomColors); + FreeAndNil(FItems); + inherited; +end; + +procedure TcxCustomColorComboBoxProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomColorComboBoxProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with Source as TcxCustomColorComboBoxProperties do + begin + Self.ColorBoxWidth := ColorBoxWidth; + Self.ColorBoxAlign := ColorBoxAlign; + Self.ColorBoxFrameColor := ColorBoxFrameColor; + Self.ColorDialogType := ColorDialogType; + Self.DefaultColor := DefaultColor; + Self.DefaultDescription := DefaultDescription; + Self.DefaultColorStyle := DefaultColorStyle; + Self.ShowDescriptions := ShowDescriptions; + Self.AllowSelectColor := AllowSelectColor; + Self.ColorComboStyle := ColorComboStyle; + Self.MaxMRUColors := MaxMRUColors; + Self.NamingConvention := NamingConvention; + Self.PrepareList := PrepareList; + Self.ColorValueFormat := ColorValueFormat; + Self.OnSelectCustomColor := OnSelectCustomColor; + Self.OnNamingConvention := OnNamingConvention; + Self.OnGetDefaultColor := OnGetDefaultColor; + Self.OnAddedMRUColor := OnAddedMRUColor; + Self.OnDeletedMRUColor := OnDeletedMRUColor; + Self.Items.Assign(Items); + Self.MRUColors.Assign(MRUColors); + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +procedure TcxCustomColorComboBoxProperties.Changed; +begin + if FInternalUpdate then Exit; + inherited; +end; + +function TcxCustomColorComboBoxProperties.CompareDisplayValues( + const AEditValue1, AEditValue2: TcxEditValue): Boolean; +var + AColor1, AColor2: TColor; + AColorFound1, AColorFound2: Boolean; + ADescription1, ADescription2: string; +begin + GetColorComboBoxDisplayValue(AEditValue1, AColor1, ADescription1, AColorFound1); + GetColorComboBoxDisplayValue(AEditValue2, AColor2, ADescription2, AColorFound2); + + Result := ShowColorBox(AColorFound1) = ShowColorBox(AColorFound2); + if Result then + if ShowColorBox(AColorFound1) then + Result := (AColor1 = AColor2) and (not ShowDescriptions or InternalCompareString(ADescription1, ADescription2, True)) + else + Result := not ShowDescriptions or InternalCompareString(ADescription1, ADescription2, True); +// Result := (AColorFound1 = AColorFound2) and (not AColorFound1 or +// (AColor1 = AColor2) and (not ShowDescriptions or InternalCompareString(ADescription1, ADescription2, True))); +end; + +class function TcxCustomColorComboBoxProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxColorComboBox; +end; + +class function TcxCustomColorComboBoxProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxCustomColorComboBoxViewInfo; +end; + +function TcxCustomColorComboBoxProperties.GetEditValueSource(AEditFocused: Boolean): + TcxDataEditValueSource; +begin + Result := evsValue; +end; + +function TcxCustomColorComboBoxProperties.IsDisplayValueValid( + var DisplayValue: TcxEditValue; AEditFocused: Boolean): Boolean; +begin + Result := True; +end; + +procedure TcxCustomColorComboBoxProperties.PrepareDisplayValue( + const AEditValue: TcxEditValue; var DisplayValue: TcxEditValue; AEditFocused: Boolean); +var + FValue: TColor; + FValueText: string; +begin + TranslateValues(AEditValue, FValue, FValueText); + DisplayValue := FValueText; +end; + +function TcxCustomColorComboBoxProperties.GetSupportedOperations: TcxEditSupportedOperations; +begin + Result := [esoEditing, esoFiltering, esoHorzAlignment, esoSorting, + esoSortingByDisplayText]; + if Buttons.Count > 0 then + Include(Result, esoHotTrack); + if ShowDescriptions then + Include(Result, esoIncSearch); +end; + +function TcxCustomColorComboBoxProperties.GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; +var + AColor: TColor; + ADescription: string; +begin + TranslateValues(AEditValue, AColor, ADescription, True); + Result := ADescription; +end; + +procedure TcxCustomColorComboBoxProperties.Update(AProperties: TcxCustomEditProperties); +begin + if AProperties is TcxCustomColorComboBoxProperties then + with TcxCustomColorComboBoxProperties(AProperties) do + begin + Items.Assign(Self.Items); + MRUColors.Assign(Self.MRUColors); + end; +end; + +procedure TcxCustomColorComboBoxProperties.GetColorComboBoxDisplayValue( + const AEditValue: TcxEditValue; out AColor: TColor; + out ADescription: string; out AColorFound: Boolean); +begin + InternalGetColorComboBoxDisplayValue(IndexByValue(AEditValue), AEditValue, + AColor, ADescription, AColorFound); +end; + +procedure TcxCustomColorComboBoxProperties.PrepareColorList( + APrepareList: TcxColorPrepareList; ASaveCustom, ASaveMRU: Boolean); +begin + LockUpdate(True); + try + if not ASaveCustom then + Items.Clear + else + Items.ClearNonCustom; + if not ASaveMRU then + ClearMRUColors; + InternalPrepareColorList(APrepareList); + if ASaveMRU then + ValidateMRUColors; + SynchronizeCustomColors; + if Assigned(FOnLoadColorList) then + FOnLoadColorList(Self); + finally + LockUpdate(False); + end; +end; + +procedure TcxCustomColorComboBoxProperties.PrepareDelphiColorList( + const ASaveCustom, ASaveMRU: Boolean); +begin + PrepareColorList(cxplDelphi, ASaveCustom, ASaveMRU); +end; + +procedure TcxCustomColorComboBoxProperties.PrepareHTML4ColorList( + const ASaveCustom, ASaveMRU: Boolean); +begin + PrepareColorList(cxplHTML4, ASaveCustom, ASaveMRU); +end; + +procedure TcxCustomColorComboBoxProperties.PrepareX11ColorList( + const ASaveCustom, ASaveMRU: Boolean); +begin + PrepareColorList(cxplX11, ASaveCustom, ASaveMRU); +end; + +procedure TcxCustomColorComboBoxProperties.PrepareX11OrderedColorList( + const ASaveCustom, ASaveMRU: Boolean); +begin + PrepareColorList(cxplX11Ordered, ASaveCustom, ASaveMRU); +end; + +procedure TcxCustomColorComboBoxProperties.DefineProperties(Filer: TFiler); +begin + Filer.DefineProperty('Items', ReadCustomColors, nil, False); + Filer.DefineProperty('PrepareInfo', ReadPrepareInfo, nil, False); +end; + +function TcxCustomColorComboBoxProperties.ShowColorBox(AColorFound: Boolean): Boolean; +begin + Result := not (not AColorFound and (DefaultColorStyle = cxdcText)); +end; + +class function TcxCustomColorComboBoxProperties.GetLookupDataClass: TcxInterfacedPersistentClass; +begin + Result := TcxColorComboBoxLookupData; +end; + +class function TcxCustomColorComboBoxProperties.GetPopupWindowClass: TcxCustomEditPopupWindowClass; +begin + Result := TcxColorComboBoxPopupWindow; +end; + +class function TcxCustomColorComboBoxProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxCustomColorComboBoxViewData; +end; + +function TcxCustomColorComboBoxProperties.HasDisplayValue: Boolean; +begin + Result := False; +end; + +function TcxCustomColorComboBoxProperties.IsEditValueNumeric: Boolean; +begin + Result := True; +end; + +function TcxCustomColorComboBoxProperties.GetColorByIndex(AIndex: Integer): TColor; +begin + if AIndex <= (MRUColors.Count - 1) then + Result := MRUColors.GetColorByIndex(AIndex, DefaultColor) + else + Result := Items.GetColorByIndex(AIndex - MRUColors.Count, DefaultColor); +end; + +function TcxCustomColorComboBoxProperties.GetIndexByColor(AColor: TColor): Integer; +begin + Result := MRUColors.GetIndexByColor(AColor); + if Result = -1 then + begin + Result := Items.GetIndexByColor(AColor); + if Result <> -1 then + Result := Result + MRUColors.Count; + end; +end; + +function TcxCustomColorComboBoxProperties.GetDescriptionByIndex(AIndex: Integer): string; +begin + if not ShowDescriptions then + Result := '' + else + begin + if AIndex = -1 then + Result := DefaultDescription + else + Result := DoConvertNaming(AIndex); + end; +end; + +function TcxCustomColorComboBoxProperties.IndexByValue(const AValue: TcxEditValue): Integer; +var + AColor: TColor; + AIsValueValid: Boolean; + I: Integer; +begin + Result := -1; + if IsVarEmpty(AValue) then + Exit; + AIsValueValid := cxStrToColor(VarToStr(AValue), AColor); + if not AIsValueValid then + Exit; + for I := 0 to MRUColors.Count - 1 do + if AColor = MRUColors[I].Color then + begin + Result := I; + Break; + end; + if Result = -1 then + for I := 0 to Items.Count - 1 do + if AColor = Items[I].Color then + begin + Result := I + MRUColors.Count; + Break; + end; +end; + +function TcxCustomColorComboBoxProperties.IsDisplayValueNumeric: Boolean; +begin + Result := False; +end; + +function TcxCustomColorComboBoxProperties.AddMRUColor(const AColor: TColor): TcxMRUColorAction; +var + FIndex: Integer; +begin + Result := mcaNone; + if MaxMRUColors = 0 then Exit; + FIndex := FMRUColors.GetIndexByColor(AColor); + if FIndex <> -1 then + begin + if (FIndex > 0) and (FIndex < FMRUColors.Count) then + begin + Result := mcaMoved; + FMRUColors.Move(FIndex, 0); + if Assigned(FOnAddedMRUColor) then FOnAddedMRUColor(Self); + end + else + Result := mcaNone; + end + else + Result := mcaAdded; + if Result = mcaAdded then + begin + FIndex := Items.GetIndexByColor(AColor); + if FIndex > -1 then + begin + FInternalUpdate := True; + try + FMRUColors.InsertColor(0, AColor, Items[FIndex].Description); + DeleteOverMRUColors; + finally + FInternalUpdate := False; + end; + if Assigned(FOnAddedMRUColor) then FOnAddedMRUColor(Self); + end + else + Result := mcaNone; + end; +end; + +function TcxCustomColorComboBoxProperties.DelMRUColor(const AColor: TColor): TcxMRUColorAction; +var + FIndex: Integer; +begin + Result := mcaNone; + {Check for right Color} + FIndex := Items.GetIndexByColor(AColor); + if FIndex < 0 then Exit; + if FMRUColors.FindColorItem(AColor) <> nil then + begin +{$IFDEF DELPHI5} + FMRUColors.Delete(FIndex); +{$ELSE} + TcxColorComboBoxItem(FMRUColors.Items[FIndex]).Free; +{$ENDIF} + Result := mcaDeleted; + if Assigned(FOnDeletedMRUColor) then FOnDeletedMRUColor(Self); + end; +end; + +procedure TcxCustomColorComboBoxProperties.ClearMRUColors; +begin + FMRUColors.Clear; + Changed; +end; + +procedure TcxCustomColorComboBoxProperties.DoGetDefaultColor(var AColor: TColor); +begin + if Assigned(FOnGetDefaultColor) then FOnGetDefaultColor(Self, AColor); +end; + +procedure TcxCustomColorComboBoxProperties.TranslateValues(const AEditValue: TcxEditValue; + var AColor: TColor; var ADescription: string; ANeedDescription: Boolean = False); +var + FFoundIndex: Integer; + FValid: Boolean; + S: string; +begin + FFoundIndex := IndexByValue(AEditValue); + if ((FFoundIndex <> -1) and (not ANeedDescription or ShowDescriptions) or + ((FFoundIndex = -1) and (ColorComboStyle = cxccsComboList))) and + not IsVarEmpty(AEditValue) then + ADescription := GetDescriptionByIndex(FFoundIndex) + else + begin + FValid := cxStrToColor(VarToStr(AEditValue), AColor); + if FValid then + begin + S := ConvertColorName(AColor, '', NamingConvention, ColorValueFormat); + if Assigned(OnNamingConvention) then + OnNamingConvention(Self, AColor, S); + ADescription := S; + end + else + begin + AColor := DefaultColor; + ADescription := DefaultDescription; + end; + end; +end; + +function TcxCustomColorComboBoxProperties.ColorItemByIndex(AIndex: Integer): TcxColorComboBoxItem; +begin + if AIndex = -1 then + Result := nil + else + begin + if AIndex <= (MRUColors.Count - 1) then + Result := MRUColors.Items[AIndex] + else + Result := Items[AIndex - MRUColors.Count]; + end; +end; + +procedure TcxCustomColorComboBoxProperties.DeleteOverMRUColors; +var + I: Integer; +begin + BeginUpdate; + try + for I := FMRUColors.Count - 1 downto 0 do + begin + if I >= FMaxMRUColors then + begin + FMRUColors.Delete(I); + if Assigned(FOnDeletedMRUColor) then FOnDeletedMRUColor(Self); + end + else + Break; + end; + finally + EndUpdate; + end; +end; + +function TcxCustomColorComboBoxProperties.DoConvertNaming(AIndex: Integer): string; +var + FItem: TcxColorComboBoxItem; +begin + FItem := ColorItemByIndex(AIndex); + if FItem = nil then + Result := '' + else + Result := ConvertColorName(FItem.Color, FItem.Description, + NamingConvention, ColorValueFormat); + if Assigned(OnNamingConvention) then + begin + if FItem = nil then + OnNamingConvention(Self, DefaultColor, Result) + else + OnNamingConvention(Self, FItem.Color, Result); + end; +end; + +function TcxCustomColorComboBoxProperties.GetItems: TcxColorComboBoxItems; +begin + Result := FItems; +end; + +procedure TcxCustomColorComboBoxProperties.InternalGetColorComboBoxDisplayValue( + AItemIndex: Integer; const AEditValue: TcxEditValue; out AColor: TColor; + out ADescription: string; out AColorFound: Boolean); +begin + AColorFound := AItemIndex <> -1; + ADescription := GetDescriptionByIndex(AItemIndex); + if not AColorFound and (ColorComboStyle = cxccsComboList) and + not IsVarEmpty(AEditValue) then + AColor := DefaultColor + else + begin + if AItemIndex <> -1 then + AColor := GetColorByIndex(AItemIndex) + else + TranslateValues(AEditValue, AColor, ADescription); + end; +end; + +procedure TcxCustomColorComboBoxProperties.InternalPrepareColorList(APrepareList: TcxColorPrepareList); +begin + case APrepareList of + cxplDelphi: InternalPrepareColorList(cxDelphiColorValues, cxDelphiColorNames); + cxplHTML4: InternalPrepareColorList(cxHTML4ColorValues, cxHTML4ColorNames); + cxplX11: InternalPrepareColorList(cxX11ColorValues, cxX11ColorNames); + cxplX11Ordered: InternalPrepareColorList(cxX11OrderedColorValues, cxX11OrderedColorNames); + end; +end; + +procedure TcxCustomColorComboBoxProperties.InternalPrepareColorList( + AColorValues: array of TColor; AColorNames: array of string); +var + I: Integer; + AItem: TcxColorComboBoxItem; +begin + Items.BeginUpdate; + try + for I:= Low(AColorValues) to High(AColorValues) do + begin + AItem := Items.AddColor(AColorValues[I], AColorNames[I]); + if AItem <> nil then + AItem.FIsCustomColor := False; + end; + finally + Items.EndUpdate; + end; +end; + +function TcxCustomColorComboBoxProperties.IsDefaultDescriptionStored: Boolean; +begin + Result := DefaultDescription <> + cxGetResourceString(@cxSColorComboBoxDefaultDescription); +end; + +procedure TcxCustomColorComboBoxProperties.ReadCustomColors(Reader: TReader); +begin + Reader.ReadValue; + Reader.ReadCollection(FCustomColors); +end; + +procedure TcxCustomColorComboBoxProperties.ReadPrepareInfo(Reader: TReader); +begin + Reader.ReadString; +end; + +procedure TcxCustomColorComboBoxProperties.SetAllowSelectColor(Value: Boolean); +begin + if FAllowSelectColor <> Value then + try + FAllowSelectColor := Value; + BeginUpdate; + Buttons[1].Visible := Value; + if Value then + GlyphButtonIndex := 1 + else + GlyphButtonIndex := 0; + finally + EndUpdate; + end; +end; + +procedure TcxCustomColorComboBoxProperties.SetColorBoxAlign(Value : TcxColorBoxAlign); +begin + if FColorBoxAlign <> Value then + begin + FColorBoxAlign := Value; + Changed; + end; +end; + +procedure TcxCustomColorComboBoxProperties.SetColorBoxFrameColor(Value: TColor); +begin + if FColorBoxFrameColor <> Value then + begin + FColorBoxFrameColor := Value; + Changed; + end; +end; + +procedure TcxCustomColorComboBoxProperties.SetColorBoxWidth(Value: Integer); +begin + if FColorBoxWidth <> Value then + begin + if Value < 0 then Value := 0; + FColorBoxWidth := Value; + Changed; + end; +end; + +procedure TcxCustomColorComboBoxProperties.SetColorComboStyle(Value: TcxColorComboStyle); +begin + if FColorComboStyle <> Value then + begin + FColorComboStyle := Value; + Changed; + end; +end; + +procedure TcxCustomColorComboBoxProperties.SetColorValueFormat(Value: TcxColorValueFormat); +begin + if FColorValueFormat <> Value then + begin + FColorValueFormat := Value; + Changed; + end; +end; + +procedure TcxCustomColorComboBoxProperties.SetDefaultColor(Value: TColor); +begin + if FDefaultColor <> Value then + begin + FDefaultColor := Value; + Changed; + end; +end; + +procedure TcxCustomColorComboBoxProperties.SetDefaultDescription(Value: string); +begin + if FDefaultDescription <> Value then + begin + FDefaultDescription := Value; + Changed; + end; +end; + +procedure TcxCustomColorComboBoxProperties.SetDefaultColorStyle(Value: TcxDefaultColorStyle); +begin + if FDefaultColorStyle <> Value then + begin + FDefaultColorStyle := Value; + Changed; + end; +end; + +procedure TcxCustomColorComboBoxProperties.SetCustomColors(Value: TcxColorComboBoxItems); +begin + FCustomColors.Assign(Value); +end; + +procedure TcxCustomColorComboBoxProperties.SetItems(const Value: TcxColorComboBoxItems); +begin + FItems.Assign(Value); +end; + +procedure TcxCustomColorComboBoxProperties.SetMaxMRUColors(Value: Byte); +var + FOldMaxMRUColors: Byte; +begin + if FMaxMRUColors <> Value then + begin + FOldMaxMRUColors := FMaxMRUColors; + FMaxMRUColors := Value; + if FOldMaxMRUColors > Value then + DeleteOverMRUColors; + end; +end; + +procedure TcxCustomColorComboBoxProperties.SetNamingConvention(Value: TcxColorNamingConvention); +begin + if FNamingConvention <> Value then + begin + FNamingConvention := Value; + Changed; + end; +end; + +procedure TcxCustomColorComboBoxProperties.SetPrepareList(Value: TcxColorPrepareList); +begin + if FPrepareList <> Value then + begin + FPrepareList := Value; + PrepareColorList(FPrepareList, True, True); + end; +end; + +procedure TcxCustomColorComboBoxProperties.SetShowDescriptions(const Value: Boolean); +begin + if FShowDescriptions <> Value then + begin + FShowDescriptions := Value; + Changed; + end; +end; + +procedure TcxCustomColorComboBoxProperties.SynchronizeCustomColors; +var + I: Integer; +begin + Items.BeginUpdate; + try + Items.ClearCustom; + for I := CustomColors.Count - 1 downto 0 do + Items.InsertColor(0, CustomColors[I].Color, CustomColors[I].Description); + finally + Items.EndUpdate; + end; +end; + +procedure TcxCustomColorComboBoxProperties.CustomColorChanged(ASender: TObject); +begin + SynchronizeCustomColors; +end; + +procedure TcxCustomColorComboBoxProperties.ValidateMRUColors; +var + I: Integer; +begin + for I := (MRUColors.Count - 1) downto 0 do + if Items.GetIndexByColor(MRUColors[I].Color) = -1 then + MRUColors.Delete(I); +end; + +{ TcxCustomColorComboBox } + +destructor TcxCustomColorComboBox.Destroy; +begin + FreeAndNil(FColorDialog); + inherited Destroy; +end; + +function TcxCustomColorComboBox.Deactivate: Boolean; +begin + Result := inherited Deactivate; + UpdateMRUList; +end; + +function TcxCustomColorComboBox.Focused: Boolean; +begin + Result := FIsDialogShowed or inherited Focused; +end; + +class function TcxCustomColorComboBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomColorComboBoxProperties; +end; + +function TcxCustomColorComboBox.IsChildWindow(AWnd: THandle): Boolean; +begin + Result := inherited IsChildWindow(AWnd) or + (FIsDialogShowed and ((ColorDialog.Handle = HWND(AWnd)) or (IsChild(ColorDialog.Handle, AWnd)))); +end; + +procedure TcxCustomColorComboBox.PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); +begin + EditValue := LookupKeyToEditValue(ILookupData.CurrentKey); +end; + +procedure TcxCustomColorComboBox.AfterPosting; +begin + inherited AfterPosting; + if IsInplace and FNeedsUpdateMRUList then + FDontCheckModifiedWhenUpdatingMRUList := True; +end; + +procedure TcxCustomColorComboBox.ContainerStyleChanged(Sender: TObject); +begin + inherited ContainerStyleChanged(Sender); +end; + +procedure TcxCustomColorComboBox.PropertiesChanged(Sender: TObject); +begin + if FPropertiesUpdate then Exit; + FPropertiesUpdate := True; + try + with ActiveProperties do + if AllowSelectColor then + if ButtonGlyph.Empty then + Buttons[1].Kind := bkEllipsis + else + Buttons[1].Kind := bkGlyph + else + if ButtonGlyph.Empty then + Buttons[0].Kind := bkDown + else + Buttons[0].Kind := bkGlyph; + inherited PropertiesChanged(Sender); + finally + FPropertiesUpdate := False; + end; +end; + +function TcxCustomColorComboBox.GetColorDialog: TColorDialog; +begin + if FColorDialog = nil then + FColorDialog := TColorDialog.Create(Self); + Result := FColorDialog; +end; + +function TcxCustomColorComboBox.GetColorValue: TColor; +begin + Result := TcxCustomColorComboBoxViewInfo(ViewInfo).ColorBoxColor; +end; + +function TcxCustomColorComboBox.IsColorValueStored: Boolean; +begin + Result := ColorValue <> ActiveProperties.DefaultColor; +end; + +procedure TcxCustomColorComboBox.SetColorValue(Value: TColor); +begin + if ColorValue <> Value then + begin + LockClick(True); + try + InternalEditValue := Value; + finally + LockClick(False); + end; + end; +end; + +procedure TcxCustomColorComboBox.DblClick; +begin + inherited DblClick; +end; + +procedure TcxCustomColorComboBox.DoButtonClick(AButtonVisibleIndex: Integer); +begin + if AButtonVisibleIndex = 1 then + DoSelectCustomColor(Self); +end; + +procedure TcxCustomColorComboBox.DoSelectCustomColor(Sender: TObject); +var + AColorProvided: TColor; + AColorDescription: string; + AAddToList: Boolean; + AIndex: Integer; +begin + AColorProvided := clNone; + AColorDescription := ''; + AAddToList := True; + + if ActiveProperties.ColorDialogType = cxcdtDefault then + begin + try + FIsDialogShowed := True; + ColorDialog.Color := ColorValue; + if ColorDialog.Execute then + AColorProvided := ColorDialog.Color + else + begin + DoClosePopup(crCancel); + Exit; + end; + finally + FIsDialogShowed := False; + end; + end; + + DoOnSelectCustomColor(AColorProvided, AColorDescription, AAddToList); + + AIndex := ActiveProperties.GetIndexByColor(AColorProvided); + if AAddToList and (AIndex = -1) then + begin + ActiveProperties.CustomColors.AddColor(AColorProvided, AColorDescription); + ActiveProperties.AddMRUColor(AColorProvided); + end + else + ItemIndex := AIndex; + + FixMRUPosition(AColorProvided); + + if DoEditing and AAddToList then + begin + ColorValue := AColorProvided; + if ActiveProperties.MRUColors.Count > 0 then + ItemIndex := ActiveProperties.MRUColors.GetIndexByColor(AColorProvided); + ModifiedAfterEnter := True; + InternalPostEditValue; + end; + DoClosePopup(crEnter); +end; + +function TcxCustomColorComboBox.GetDisplayValue: string; +begin + if IsDestroying then + Result := '' + else + Result := ViewInfo.Text; +end; + +function TcxCustomColorComboBox.GetEditingValue: TcxEditValue; +begin + Result := EditValue; +end; + +function TcxCustomColorComboBox.GetInnerEditClass: TControlClass; +begin + Result := TcxCustomColorComboBoxInnerEdit; +end; + +procedure TcxCustomColorComboBox.Initialize; +begin + inherited Initialize; + FIsDialogShowed := False; + FPropertiesUpdate := False; + ControlStyle := ControlStyle - [csClickEvents]; + ActiveProperties.FOnLoadColorList := PropertiesLoadColorListHandler; +end; + +procedure TcxCustomColorComboBox.InitializePopupWindow; +begin + inherited InitializePopupWindow; + TcxColorComboBoxPopupWindow(PopupWindow).SysPanelStyle := + ActiveProperties.PopupSizeable; +end; + +procedure TcxCustomColorComboBox.ClearEditValue; +begin + InternalEditValue := Null; + ModifiedAfterEnter := True; + SynchronizeDisplayValue; + if ActiveProperties.ImmediatePost and CanPostEditValue then + InternalPostEditValue; +end; + +procedure TcxCustomColorComboBox.DoOnSelectCustomColor(var AColor: TColor; + var AColorDescription: string; var AddToList: Boolean); +begin + with Properties do + if Assigned(OnSelectCustomColor) then + OnSelectCustomColor(Self, AColor, AColorDescription, AddToList); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnSelectCustomColor) then + OnSelectCustomColor(Self, AColor, AColorDescription, AddToList); +end; + +procedure TcxCustomColorComboBox.DoEditKeyDown(var Key: Word; Shift: TShiftState); +var + AKey: Word; +begin + AKey := TranslateKey(Key); + if (AKey = VK_DELETE) and DoEditing then + ClearEditValue + else + inherited DoEditKeyDown(Key, Shift); +end; + +function TcxCustomColorComboBox.IsValidChar(AChar: Char): Boolean; +begin + Result := IsTextChar(AChar); +end; + +function TcxCustomColorComboBox.GetProperties: TcxCustomColorComboBoxProperties; +begin + Result := TcxCustomColorComboBoxProperties(FProperties); +end; + +function TcxCustomColorComboBox.GetActiveProperties: TcxCustomColorComboBoxProperties; +begin + Result := TcxCustomColorComboBoxProperties(InternalGetActiveProperties); +end; + +function TcxCustomColorComboBox.GetLookupData: TcxColorComboBoxLookupData; +begin + Result := TcxColorComboBoxLookupData(FLookupData); +end; + +procedure TcxCustomColorComboBox.SetProperties( + Value: TcxCustomColorComboBoxProperties); +begin + FProperties.Assign(Value); +end; + +function TcxCustomColorComboBox.AddMRUColor(const AColor: TColor): TcxMRUColorAction; +begin + Result := ActiveProperties.AddMRUColor(AColor); +end; + +function TcxCustomColorComboBox.DelMRUColor(const AColor: TColor): TcxMRUColorAction; +begin + Result := ActiveProperties.DelMRUColor(AColor); +end; + +function TcxCustomColorComboBox.LookupKeyToEditValue(const AKey: TcxEditValue): TcxEditValue; +begin + if not VarEqualsExact(AKey, -1) then + Result := ActiveProperties.GetColorByIndex(AKey) + else + Result := Null; +end; + +procedure TcxCustomColorComboBox.SynchronizeDisplayValue; +begin + inherited; + ILookupData.TextChanged; + ResetOnNewDisplayValue; + UpdateDrawValue; +end; + +procedure TcxCustomColorComboBox.CloseUp(AReason: TcxEditCloseUpReason); +begin + FNeedsUpdateMRUList := FNeedsUpdateMRUList or (AReason in [crTab, crEnter, crClose]); + try + inherited CloseUp(AReason); + finally + UpdateMRUList; + end; +end; + +procedure TcxCustomColorComboBox.FixMRUPosition(AColor: TColor); +var + FMRUColorAction: TcxMRUColorAction; +begin + FMRUColorAction := AddMRUColor(AColor); + if (FMRUColorAction = mcaAdded) or + (FMRUColorAction = mcaMoved) then + ItemIndex := LookupData.InternalChangeCurrentMRUColorPosition(AColor); +end; + +procedure TcxCustomColorComboBox.InternalSetEditValue(const Value: TcxEditValue; + AValidateEditValue: Boolean); +begin + if IsDestroying then Exit; + inherited InternalSetEditValue(Value, AValidateEditValue); +end; + +procedure TcxCustomColorComboBox.PropertiesLoadColorListHandler(Sender: TObject); +begin + if not IsLoading then + FlushEditValue; +end; + +procedure TcxCustomColorComboBox.UpdateMRUList; +begin + try + if FNeedsUpdateMRUList and (FDontCheckModifiedWhenUpdatingMRUList or ModifiedAfterEnter) then + FixMRUPosition(ActiveProperties.GetColorByIndex(ILookupData.CurrentKey)); + finally + FDontCheckModifiedWhenUpdatingMRUList := False; + FNeedsUpdateMRUList := False; + end; +end; + +procedure TcxCustomColorComboBox.FlushEditValue; +begin + ItemIndex := -1; + if DoEditing then + ClearEditValue; + InternalPostEditValue; +end; + +procedure TcxCustomColorComboBox.PrepareColorList( + APrepareList: TcxColorPrepareList; ASaveCustom, ASaveMRU: Boolean); +var + FBeforeLoadColor: TColor; + FNewIndex: Integer; +begin + FBeforeLoadColor := ColorValue; + + ActiveProperties.FOnLoadColorList := nil; + ActiveProperties.PrepareColorList(APrepareList, ASaveCustom, ASaveMRU); + ActiveProperties.FOnLoadColorList := PropertiesLoadColorListHandler; + FNewIndex := ActiveProperties.Items.GetIndexByColor(FBeforeLoadColor); + if FNewIndex = -1 then + FlushEditValue + else + begin + FEditValue := FBeforeLoadColor; + InternalSetEditValue(FBeforeLoadColor, False); + end; +end; + +procedure TcxCustomColorComboBox.PrepareDelphiColorList( + const ASaveCustom, ASaveMRU: Boolean); +begin + PrepareColorList(cxplDelphi, ASaveCustom, ASaveMRU); +end; + +procedure TcxCustomColorComboBox.PrepareHTML4ColorList(const ASaveCustom, + ASaveMRU: Boolean); +begin + PrepareColorList(cxplHTML4, ASaveCustom, ASaveMRU); +end; + +procedure TcxCustomColorComboBox.PrepareX11ColorList(const ASaveCustom, + ASaveMRU: Boolean); +begin + PrepareColorList(cxplX11, ASaveCustom, ASaveMRU); +end; + +procedure TcxCustomColorComboBox.PrepareX11OrderedColorList(const ASaveCustom, + ASaveMRU: Boolean); +begin + PrepareColorList(cxplX11Ordered, ASaveCustom, ASaveMRU); +end; + +{ TcxColorComboBox } + +class function TcxColorComboBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxColorComboBoxProperties; +end; + +function TcxColorComboBox.GetActiveProperties: TcxColorComboBoxProperties; +begin + Result := TcxColorComboBoxProperties(InternalGetActiveProperties); +end; + +function TcxColorComboBox.GetProperties: TcxColorComboBoxProperties; +begin + Result := TcxColorComboBoxProperties(FProperties); +end; + +procedure TcxColorComboBox.SetProperties(Value: TcxColorComboBoxProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxFilterColorComboBoxHelper } + +class function TcxFilterColorComboBoxHelper.GetFilterEditClass: TcxCustomEditClass; +begin + Result := TcxColorComboBox; +end; + +class function TcxFilterColorComboBoxHelper.GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; +begin + Result := [fcoEqual, fcoNotEqual, fcoBlanks, fcoNonBlanks]; + if AExtendedSet then + Result := Result + [fcoInList, fcoNotInList]; +end; + +class procedure TcxFilterColorComboBoxHelper.InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); +begin + inherited InitializeProperties(AProperties, AEditProperties, AHasButtons); + TcxCustomColorComboBoxProperties(AProperties).DropDownListStyle := lsFixedList; +end; + +initialization + GetRegisteredEditProperties.Register(TcxColorComboBoxProperties, + scxSEditRepositoryColorComboBoxItem); + FilterEditsController.Register(TcxColorComboBoxProperties, + TcxFilterColorComboBoxHelper); + +finalization + FilterEditsController.Unregister(TcxColorComboBoxProperties, + TcxFilterColorComboBoxHelper); + GetRegisteredEditProperties.Unregister(TcxColorComboBoxProperties); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxCurrencyEdit.pas b/official/x.35/ExpressEditors Library 5/Sources/cxCurrencyEdit.pas new file mode 100644 index 00000000..26c9863e --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxCurrencyEdit.pas @@ -0,0 +1,746 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxCurrencyEdit; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, +{$IFDEF DELPHI6} + Types, +{$ENDIF} + SysUtils, Classes, Controls, Clipbrd, cxContainer, cxDataStorage, cxDataUtils, + cxEdit, cxTextEdit, cxFilterControlUtils; + +type + { TcxCurrencyEditPropertiesValues } + + TcxCurrencyEditPropertiesValues = class(TcxTextEditPropertiesValues) + private + FDecimalPlaces: Boolean; + procedure SetDecimalPlaces(Value: Boolean); + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property DecimalPlaces: Boolean read FDecimalPlaces write SetDecimalPlaces + stored False; + end; + + { TcxCustomCurrencyEditProperties } + + TcxCustomCurrencyEditProperties = class(TcxCustomTextEditProperties) + private + FDecimalPlaces: Integer; + FFormatChanging: Boolean; + FNullable: Boolean; + FNullString: string; + FUseThousandSeparator: Boolean; + function GetAssignedValues: TcxCurrencyEditPropertiesValues; + function GetDecimalPlaces: Integer; + function IsDecimalPlacesStored: Boolean; + procedure SetAssignedValues(Value: TcxCurrencyEditPropertiesValues); + procedure SetDecimalPlaces(Value: Integer); + procedure SetNullable(const Value: Boolean); + procedure SetNullString(const Value: string); + procedure SetUseThousandSeparator(const Value: Boolean); + protected + class function GetAssignedValuesClass: TcxCustomEditPropertiesValuesClass; override; + function GetDefaultDisplayFormat: string; override; + function GetDisplayFormatOptions: TcxEditDisplayFormatOptions; override; + function HasDigitGrouping(AIsDisplayValueSynchronizing: Boolean): Boolean; override; + function InternalGetEditFormat(out AIsCurrency, AIsOnGetTextAssigned: Boolean; + AEdit: TcxCustomTextEdit = nil): string; override; //for VCL .Net + function IsEditValueNumeric: Boolean; override; + function StrToFloatEx(S: string; var Value: Double): Boolean; + property AssignedValues: TcxCurrencyEditPropertiesValues read GetAssignedValues + write SetAssignedValues; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + class function GetContainerClass: TcxContainerClass; override; + function GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; override; + function IsDisplayValueValid(var DisplayValue: TcxEditValue; AEditFocused: Boolean): Boolean; override; + procedure PrepareDisplayValue(const AEditValue: TcxEditValue; + var DisplayValue: TcxEditValue; AEditFocused: Boolean); override; + procedure ValidateDisplayValue(var ADisplayValue: TcxEditValue; + var AErrorText: TCaption; var AError: Boolean; + AEdit: TcxCustomEdit); override; + // !!! + property DecimalPlaces: Integer read GetDecimalPlaces write SetDecimalPlaces + stored IsDecimalPlacesStored; + property Nullable: Boolean read FNullable write SetNullable default True; + property NullString: string read FNullString write SetNullString; + property ValidateOnEnter default True; + property UseThousandSeparator: Boolean read FUseThousandSeparator + write SetUseThousandSeparator default False; + end; + + { TcxCurrencyEditProperties } + + TcxCurrencyEditProperties = class(TcxCustomCurrencyEditProperties) + published + property Alignment; + property AssignedValues; + property AutoSelect; + property ClearKey; + property DecimalPlaces; + property DisplayFormat; + property EchoMode; + property EditFormat; + property HideSelection; + property ImeMode; + property ImeName; + property MaxLength; + property MaxValue; + property MinValue; + property Nullable; + property NullString; + property PasswordChar; + property ReadOnly; + property UseDisplayFormatWhenEditing; + property UseLeftAlignmentOnEditing; + property UseThousandSeparator; + property ValidateOnEnter; + property OnChange; + property OnEditValueChanged; + property OnValidate; + end; + + { TcxCustomCurrencyEdit } + + TcxCustomCurrencyEdit = class(TcxCustomTextEdit) + private + function GetProperties: TcxCustomCurrencyEditProperties; + function GetActiveProperties: TcxCustomCurrencyEditProperties; + function GetValue: Double; + procedure SetProperties(Value: TcxCustomCurrencyEditProperties); + procedure SetValue(Value: Double); + protected + procedure CheckEditorValueBounds; override; + procedure Initialize; override; + function InternalGetEditingValue: TcxEditValue; override; + function IsValidChar(Key: Char): Boolean; override; + procedure KeyPress(var Key: Char); override; + procedure PropertiesChanged(Sender: TObject); override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + procedure PasteFromClipboard; override; + procedure PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); override; + property ActiveProperties: TcxCustomCurrencyEditProperties read GetActiveProperties; + property Properties: TcxCustomCurrencyEditProperties read GetProperties + write SetProperties; + property Value: Double read GetValue write SetValue stored False; + end; + + { TcxCurrencyEdit } + + TcxCurrencyEdit = class(TcxCustomCurrencyEdit) + private + function GetActiveProperties: TcxCurrencyEditProperties; + function GetProperties: TcxCurrencyEditProperties; + procedure SetProperties(Value: TcxCurrencyEditProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxCurrencyEditProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property EditValue; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxCurrencyEditProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Value; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnEditing; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property BiDiMode; + property ParentBiDiMode; + property OnEndDock; + property OnStartDock; + end; + + { TcxFilterCurrencyEditHelper } + + TcxFilterCurrencyEditHelper = class(TcxFilterTextEditHelper) + public + class function GetFilterEditClass: TcxCustomEditClass; override; + class function GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; override; + class procedure InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); override; + end; + +implementation + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + cxEditConsts, cxFormats, cxVariants, cxControls; + +{$IFNDEF DELPHI6} +function StrToCurrDef(const S: string; const Default: Currency): Currency; +begin + if not TextToFloat(PChar(S), Result, fvCurrency) then + Result := Default; +end; +{$ENDIF} + +{ TcxCurrencyEditPropertiesValues } + +procedure TcxCurrencyEditPropertiesValues.Assign(Source: TPersistent); +begin + if Source is TcxCurrencyEditPropertiesValues then + begin + BeginUpdate; + try + inherited Assign(Source); + DecimalPlaces := TcxCurrencyEditPropertiesValues(Source).DecimalPlaces; + finally + EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxCurrencyEditPropertiesValues.RestoreDefaults; +begin + BeginUpdate; + try + inherited RestoreDefaults; + DecimalPlaces := False; + finally + EndUpdate; + end; +end; + +procedure TcxCurrencyEditPropertiesValues.SetDecimalPlaces(Value: Boolean); +begin + if Value <> FDecimalPlaces then + begin + FDecimalPlaces := Value; + Changed; + end; +end; + +{ TcxCustomCurrencyEditProperties } + +constructor TcxCustomCurrencyEditProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FNullable := True; + ValidateOnEnter := True; +end; + +function TcxCustomCurrencyEditProperties.GetAssignedValues: TcxCurrencyEditPropertiesValues; +begin + Result := TcxCurrencyEditPropertiesValues(FAssignedValues); +end; + +function TcxCustomCurrencyEditProperties.GetDecimalPlaces: Integer; +begin + if AssignedValues.DecimalPlaces then + Result := FDecimalPlaces + else + Result := CurrencyDecimals; +end; + +function TcxCustomCurrencyEditProperties.IsDecimalPlacesStored: Boolean; +begin + Result := AssignedValues.DecimalPlaces; +end; + +procedure TcxCustomCurrencyEditProperties.SetAssignedValues( + Value: TcxCurrencyEditPropertiesValues); +begin + FAssignedValues.Assign(Value); +end; + +procedure TcxCustomCurrencyEditProperties.SetDecimalPlaces(Value: Integer); +begin + if AssignedValues.DecimalPlaces and (Value = FDecimalPlaces) then + Exit; + AssignedValues.FDecimalPlaces := True; + FDecimalPlaces := Value; + Changed; +end; + +procedure TcxCustomCurrencyEditProperties.SetNullable( + const Value: Boolean); +begin + if FNullable <> Value then + begin + FNullable := Value; + Changed; + end; +end; + +procedure TcxCustomCurrencyEditProperties.SetNullString( + const Value: string); +begin + if FNullString <> Value then + begin + FNullString := Value; + Changed; + end; +end; + +procedure TcxCustomCurrencyEditProperties.SetUseThousandSeparator( + const Value: Boolean); +begin + if FUseThousandSeparator <> Value then + begin + FUseThousandSeparator := Value; + Changed; + end; +end; + +class function TcxCustomCurrencyEditProperties.GetAssignedValuesClass: TcxCustomEditPropertiesValuesClass; +begin + Result := TcxCurrencyEditPropertiesValues; +end; + +function TcxCustomCurrencyEditProperties.GetDefaultDisplayFormat: string; +begin + Result := cxFormatController.CurrencyFormat; +end; + +function TcxCustomCurrencyEditProperties.GetDisplayFormatOptions: TcxEditDisplayFormatOptions; +begin + Result := [dfoSupports, dfoNoCurrencyValue]; +end; + +function TcxCustomCurrencyEditProperties.HasDigitGrouping( + AIsDisplayValueSynchronizing: Boolean): Boolean; +begin + Result := not AIsDisplayValueSynchronizing and UseThousandSeparator; +end; + +function TcxCustomCurrencyEditProperties.InternalGetEditFormat(out AIsCurrency, + AIsOnGetTextAssigned: Boolean; AEdit: TcxCustomTextEdit = nil): string; //for VCL .Net +begin + Result := + inherited InternalGetEditFormat(AIsCurrency, AIsOnGetTextAssigned, AEdit); +end; + +function TcxCustomCurrencyEditProperties.IsEditValueNumeric: Boolean; +begin + Result := True; +end; + +function TcxCustomCurrencyEditProperties.StrToFloatEx(S: string; + var Value: Double): Boolean; +const + MinDouble = 5.0e-324; + MaxDouble = 1.7e+308; +var + E: Extended; + I: Integer; +begin + for I := Length(S) downto 1 do + if S[I] = ThousandSeparator then + Delete(S, I, 1); + if not TextToFloat(PChar(S), E, fvExtended) or + ((E <> 0) and ((Abs(E) < MinDouble) or (Abs(E) > MaxDouble))) then + begin + Value := 0; + Result := S = ''; + end + else + begin + Value := E; + Result := True; + end; +end; + +procedure TcxCustomCurrencyEditProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomCurrencyEditProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with TcxCustomCurrencyEditProperties(Source) do + begin + Self.AssignedValues.DecimalPlaces := False; + if AssignedValues.DecimalPlaces then + Self.DecimalPlaces := DecimalPlaces; + Self.Nullable := Nullable; + Self.NullString := NullString; + Self.UseThousandSeparator := UseThousandSeparator; + end; + finally + EndUpdate + end + end + else + inherited Assign(Source); +end; + +class function TcxCustomCurrencyEditProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxCurrencyEdit; +end; + +function TcxCustomCurrencyEditProperties.GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; +begin + Result := evsValue; + if not AEditFocused and (IDefaultValuesProvider <> nil) and + IDefaultValuesProvider.IsOnGetTextAssigned then + Result := evsText; +end; + +function TcxCustomCurrencyEditProperties.IsDisplayValueValid( + var DisplayValue: TcxEditValue; AEditFocused: Boolean): Boolean; +var + C, AIsOnGetTextAssigned: Boolean; + D: Double; + S: string; +begin + Result := not AEditFocused or + (InternalGetEditFormat(C, AIsOnGetTextAssigned) <> '') or + AIsOnGetTextAssigned; + if not Result then + begin + S := Trim(VarToStr(DisplayValue)); + Result := StrToFloatEx(S, D); + if Result then + DisplayValue := S; + end; +end; + +procedure TcxCustomCurrencyEditProperties.PrepareDisplayValue( + const AEditValue: TcxEditValue; var DisplayValue: TcxEditValue; + AEditFocused: Boolean); +begin + if VarIsSoftNull(AEditValue) then + if AEditFocused then + DisplayValue := '' + else + if Nullable then + DisplayValue := NullString + else + inherited PrepareDisplayValue(0, DisplayValue, AEditFocused)//DisplayValue := '0' + else + try + inherited PrepareDisplayValue(AEditValue, DisplayValue, AEditFocused); + except + on EConvertError do + if AEditFocused then + DisplayValue := '' + else + DisplayValue := AEditValue; + on EVariantError do + if AEditFocused then + DisplayValue := '' + else + DisplayValue := AEditValue; + end; +end; + +procedure TcxCustomCurrencyEditProperties.ValidateDisplayValue( + var ADisplayValue: TcxEditValue; var AErrorText: TCaption; + var AError: Boolean; AEdit: TcxCustomEdit); +var + AValue: Double; +begin + AError := not StrToFloatEx(VarToStr(ADisplayValue), AValue); + inherited ValidateDisplayValue(ADisplayValue, AErrorText, AError, AEdit); +end; + +{ TcxCustomCurrencyEdit } + +function TcxCustomCurrencyEdit.GetProperties: TcxCustomCurrencyEditProperties; +begin + Result := TcxCustomCurrencyEditProperties(FProperties); +end; + +function TcxCustomCurrencyEdit.GetActiveProperties: TcxCustomCurrencyEditProperties; +begin + Result := TcxCustomCurrencyEditProperties(InternalGetActiveProperties); +end; + +function TcxCustomCurrencyEdit.GetValue: Double; +var + V: Variant; +begin + if Focused and not IsEditValidated and ModifiedAfterEnter then + begin + V := InternalGetEditingValue; + if VarIsNumericEx(V) then + Result := V + else + Result := 0.0; + end + else + if VarIsNull(EditValue) or (VarIsStr(EditValue) and (StrToCurrDef(EditValue, 0) = 0)) then + Result := 0.00 + else + Result := EditValue; +end; + +procedure TcxCustomCurrencyEdit.SetProperties( + Value: TcxCustomCurrencyEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomCurrencyEdit.SetValue(Value: Double); +begin + with ActiveProperties do + if IsValueBoundDefined(evbMin) and (Value < MinValue) then + Value := MinValue + else + if IsValueBoundDefined(evbMax) and (Value > MaxValue) then + Value := MaxValue; + InternalEditValue := Value; +end; + +procedure TcxCustomCurrencyEdit.CheckEditorValueBounds; +begin + KeyboardAction := ModifiedAfterEnter; + try + with ActiveProperties do + if IsValueBoundDefined(evbMin) and (Value < MinValue) then + Value := MinValue + else + if IsValueBoundDefined(evbMax) and (Value > MaxValue) then + Value := MaxValue; + finally + KeyboardAction := False; + end; +end; + +procedure TcxCustomCurrencyEdit.Initialize; +begin + inherited Initialize; + ControlStyle := ControlStyle - [csSetCaption]; +end; + +function TcxCustomCurrencyEdit.InternalGetEditingValue: TcxEditValue; +begin + PrepareEditValue(Text, Result, True); +end; + +function TcxCustomCurrencyEdit.IsValidChar(Key: Char): Boolean; + + function IsValidNumber(const S: string): Boolean; + var + ADecPos, AStartPos: Integer; + V: Double; + begin + Result := False; + ADecPos := Pos(DecimalSeparator, S); + if ADecPos > 0 then + begin + AStartPos := Pos('E', UpperCase(S)); + if AStartPos > ADecPos then + ADecPos := AStartPos - ADecPos - 1 + else + ADecPos := Length(S) - ADecPos; + if ADecPos > ActiveProperties.DecimalPlaces then + Exit; + end; + Result := ActiveProperties.StrToFloatEx(S, V); + end; + +var + AEndPos, AStartPos: Integer; + AIsCurrency, AIsOnGetTextAssigned: Boolean; + S: string; +begin + Result := False; + if not IsNumericChar(Key, ntExponent) and + not (ActiveProperties.UseThousandSeparator and (Key = ThousandSeparator)) then + Exit; + if ((ActiveProperties.InternalGetEditFormat(AIsCurrency, AIsOnGetTextAssigned, Self) <> '') or + AIsOnGetTextAssigned) and not IsValidNumber(Text) then + begin + Result := True; + Exit; + end; + S := Text; + AStartPos := SelStart; + AEndPos := SelStart + SelLength; + Delete(S, SelStart + 1, AEndPos - AStartPos); + if (Key = '-') and (S = '') then + begin + Result := True; + Exit; + end; + Insert(Key, S, AStartPos + 1); + Result := IsValidNumber(S); +end; + +procedure TcxCustomCurrencyEdit.KeyPress(var Key: Char); +begin + if not (ActiveProperties.UseThousandSeparator and (Key = ThousandSeparator)) and + (Key in ['.', ',']) then + Key := DecimalSeparator; + inherited KeyPress(Key); +end; + +procedure TcxCustomCurrencyEdit.PropertiesChanged(Sender: TObject); +begin + if (Sender <> nil) and ActiveProperties.FFormatChanging then + Exit; + if not Focused then + DataBinding.UpdateDisplayValue; + inherited PropertiesChanged(Sender); +end; + +class function TcxCustomCurrencyEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomCurrencyEditProperties; +end; + +procedure TcxCustomCurrencyEdit.PasteFromClipboard; +begin + if CanModify then + inherited; +end; + +procedure TcxCustomCurrencyEdit.PrepareEditValue( + const ADisplayValue: TcxEditValue; out EditValue: TcxEditValue; + AEditFocused: Boolean); +var + V: Double; +begin + if (ADisplayValue = '') or (CompareStr(ADisplayValue, ActiveProperties.NullString) = 0) or + not ActiveProperties.StrToFloatEx(ADisplayValue, V) then + if ActiveProperties.Nullable then EditValue := Null else EditValue := 0.00 + else + EditValue := V +end; + +{ TcxCurrencyEdit } + +class function TcxCurrencyEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCurrencyEditProperties; +end; + +function TcxCurrencyEdit.GetActiveProperties: TcxCurrencyEditProperties; +begin + Result := TcxCurrencyEditProperties(InternalGetActiveProperties); +end; + +function TcxCurrencyEdit.GetProperties: TcxCurrencyEditProperties; +begin + Result := TcxCurrencyEditProperties(FProperties); +end; + +procedure TcxCurrencyEdit.SetProperties(Value: TcxCurrencyEditProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxFilterCurrencyEditHelper } + +class function TcxFilterCurrencyEditHelper.GetFilterEditClass: TcxCustomEditClass; +begin + Result := TcxCurrencyEdit; +end; + +class function TcxFilterCurrencyEditHelper.GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; +begin + Result := [fcoEqual, fcoNotEqual, fcoLess, fcoLessEqual, fcoGreater, + fcoGreaterEqual, fcoBlanks, fcoNonBlanks]; + if AExtendedSet then + Result := Result + [fcoBetween, fcoNotBetween, fcoInList, fcoNotInList]; +end; + +class procedure TcxFilterCurrencyEditHelper.InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); +begin + inherited InitializeProperties(AProperties, AEditProperties, AHasButtons); + with TcxCustomCurrencyEditProperties(AProperties) do + begin + MinValue := 0; + MaxValue := 0; + Nullable := True; + NullString := ''; + end; +end; + +initialization + GetRegisteredEditProperties.Register(TcxCurrencyEditProperties, scxSEditRepositoryCurrencyItem); + FilterEditsController.Register(TcxCurrencyEditProperties, TcxFilterCurrencyEditHelper); + +finalization + FilterEditsController.Unregister(TcxCurrencyEditProperties, TcxFilterCurrencyEditHelper); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxDBCheckComboBox.pas b/official/x.35/ExpressEditors Library 5/Sources/cxDBCheckComboBox.pas new file mode 100644 index 00000000..59e98863 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxDBCheckComboBox.pas @@ -0,0 +1,160 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDBCheckComboBox; + +interface + +{$I cxVer.inc} + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Classes, Controls, Dialogs, Forms, Graphics, Messages, StdCtrls, + SysUtils, cxCheckComboBox, cxControls, cxDBEdit, cxEdit; + +type + { TcxDBCheckComboBox } + + TcxDBCheckComboBox = class(TcxCustomCheckComboBox) + private + function GetActiveProperties: TcxCheckComboBoxProperties; + function GetDataBinding: TcxDBTextEditDataBinding; + function GetProperties: TcxCheckComboBoxProperties; + procedure SetDataBinding(Value: TcxDBTextEditDataBinding); + procedure SetProperties(Value: TcxCheckComboBoxProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxCheckComboBoxProperties + read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DataBinding: TcxDBTextEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxCheckComboBoxProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Text; + property Visible; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +{ TcxDBCheckComboBox } + +class function TcxDBCheckComboBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCheckComboBoxProperties; +end; + +class function TcxDBCheckComboBox.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBTextEditDataBinding; +end; + +function TcxDBCheckComboBox.GetActiveProperties: TcxCheckComboBoxProperties; +begin + Result := TcxCheckComboBoxProperties(InternalGetActiveProperties); +end; + +function TcxDBCheckComboBox.GetDataBinding: TcxDBTextEditDataBinding; +begin + Result := TcxDBTextEditDataBinding(FDataBinding); +end; + +function TcxDBCheckComboBox.GetProperties: TcxCheckComboBoxProperties; +begin + Result := TcxCheckComboBoxProperties(FProperties); +end; + +procedure TcxDBCheckComboBox.SetDataBinding(Value: TcxDBTextEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBCheckComboBox.SetProperties(Value: TcxCheckComboBoxProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBCheckComboBox.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxDBCheckGroup.pas b/official/x.35/ExpressEditors Library 5/Sources/cxDBCheckGroup.pas new file mode 100644 index 00000000..2d769d5c --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxDBCheckGroup.pas @@ -0,0 +1,183 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDBCheckGroup; + +{$I cxVer.inc} + +interface + +uses + Classes, Controls, Messages, cxCheckGroup, cxDBEdit, cxEdit; + +type + { TcxDBCheckGroupButton } + + TcxDBCheckGroupButton = class(TcxCheckGroupButton) + private + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + public + constructor Create(AOwner: TComponent); override; + end; + + { TcxDBCheckGroup } + + TcxDBCheckGroup = class(TcxCheckGroup) + private + function GetActiveProperties: TcxCheckGroupProperties; + function GetDataBinding: TcxDBEditDataBinding; + function GetProperties: TcxCheckGroupProperties; + procedure SetDataBinding(const Value: TcxDBEditDataBinding); + procedure SetProperties(Value: TcxCheckGroupProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + function GetButtonInstance: TWinControl; override; + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxCheckGroupProperties read GetActiveProperties; + published + property Align; + property Alignment; + property Anchors; + property Caption; + property Constraints; + property DataBinding: TcxDBEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property EditValue; + property Enabled; + property ParentBackground; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxCheckGroupProperties read GetProperties + write SetProperties; + property ShowHint; + property StatesItems; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Transparent; + property Visible; + property OnClick; + property OnContextPopup; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnFocusChanged; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +{ TcxDBCheckGroupButton } + +constructor TcxDBCheckGroupButton.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := ControlStyle + [csReplicatable]; +end; + +procedure TcxDBCheckGroupButton.CMGetDataLink(var Message: TMessage); +begin + CheckGroup.Perform(Message.Msg, Message.WParam, Message.LParam); +end; + +{ TcxDBCheckGroup } + +class function TcxDBCheckGroup.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCheckGroupProperties; +end; + +function TcxDBCheckGroup.GetButtonInstance: TWinControl; +begin + Result := TcxDBCheckGroupButton.Create(Self, IsInplace); +end; + +class function TcxDBCheckGroup.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBEditDataBinding; +end; + +function TcxDBCheckGroup.GetActiveProperties: TcxCheckGroupProperties; +begin + Result := TcxCheckGroupProperties(InternalGetActiveProperties); +end; + +function TcxDBCheckGroup.GetDataBinding: TcxDBEditDataBinding; +begin + Result := TcxDBEditDataBinding(FDataBinding); +end; + +function TcxDBCheckGroup.GetProperties: TcxCheckGroupProperties; +begin + Result := TcxCheckGroupProperties(FProperties); +end; + +procedure TcxDBCheckGroup.SetDataBinding(const Value: TcxDBEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBCheckGroup.SetProperties(Value: TcxCheckGroupProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBCheckGroup.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxDBCheckListBox.pas b/official/x.35/ExpressEditors Library 5/Sources/cxDBCheckListBox.pas new file mode 100644 index 00000000..df52da65 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxDBCheckListBox.pas @@ -0,0 +1,144 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDBCheckListBox; + +interface + +{$I cxVer.inc} + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Classes, Controls, Forms, Graphics, Messages, StdCtrls, SysUtils, + cxCheckListBox, cxDataUtils, cxDB, cxDBEdit, cxEdit, cxVariants; + +type + { TcxDBCheckListBox } + + TcxDBCheckListBox = class(TcxCustomCheckListBox) + private + function GetDataBinding: TcxDBDataBinding; + procedure SetDataBinding(Value: TcxDBDataBinding); + protected + class function GetDataBindingClass: TcxCustomDataBindingClass; override; + published + property Align; + property AllowDblClickToggle; + property AllowGrayed; + property Anchors; + property AutoComplete; + property AutoCompleteDelay; + property BiDiMode; + property Columns; + property Constraints; + property DataBinding: TcxDBDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property EditValueFormat; + property Enabled; + property Glyph; + property GlyphCount; + property Images; + property ImageLayout; + property ImeMode; + property ImeName; + property IntegralHeight; + property Items; + property ParentBiDiMode; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property ReadOnly; + property ScrollWidth; + property ShowChecks; + property ShowHint; + property Sorted; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property TabWidth; + property Visible; + property OnCheckStatesToEditValue; + property OnClick; + property OnClickCheck; + property OnContextPopup; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnDrawItem; + property OnEditValueToCheckStates; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMeasureItem; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +{ TcxDBCheckListBox } + +function TcxDBCheckListBox.GetDataBinding: TcxDBDataBinding; +begin + Result := TcxDBDataBinding(FDataBinding); +end; + +procedure TcxDBCheckListBox.SetDataBinding(Value: TcxDBDataBinding); +begin + FDataBinding.Assign(Value); +end; + +class function TcxDBCheckListBox.GetDataBindingClass: TcxCustomDataBindingClass; +begin + Result := TcxDBDataBinding; +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxDBColorComboBox.pas b/official/x.35/ExpressEditors Library 5/Sources/cxDBColorComboBox.pas new file mode 100644 index 00000000..b4471a68 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxDBColorComboBox.pas @@ -0,0 +1,159 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDBColorComboBox; + +interface + +{$I cxVer.inc} + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Classes, Controls, Dialogs, Forms, Graphics, Messages, StdCtrls, + SysUtils, cxColorComboBox, cxControls, cxDBEdit, cxEdit; + +type + { TcxDBColorComboBox } + + TcxDBColorComboBox = class(TcxCustomColorComboBox) + private + function GetActiveProperties: TcxColorComboBoxProperties; + function GetDataBinding: TcxDBEditDataBinding; + function GetProperties: TcxColorComboBoxProperties; + procedure SetDataBinding(const Value: TcxDBEditDataBinding); + procedure SetProperties(Value: TcxColorComboBoxProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxColorComboBoxProperties + read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DataBinding: TcxDBEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxColorComboBoxProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +{ TcxDBColorComboBox } + +class function TcxDBColorComboBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxColorComboBoxProperties; +end; + +class function TcxDBColorComboBox.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBEditDataBinding; +end; + +function TcxDBColorComboBox.GetActiveProperties: TcxColorComboBoxProperties; +begin + Result := TcxColorComboBoxProperties(InternalGetActiveProperties); +end; + +function TcxDBColorComboBox.GetDataBinding: TcxDBEditDataBinding; +begin + Result := TcxDBEditDataBinding(FDataBinding); +end; + +function TcxDBColorComboBox.GetProperties: TcxColorComboBoxProperties; +begin + Result := TcxColorComboBoxProperties(FProperties); +end; + +procedure TcxDBColorComboBox.SetDataBinding(const Value: TcxDBEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBColorComboBox.SetProperties(Value: TcxColorComboBoxProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBColorComboBox.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxDBEdit.pas b/official/x.35/ExpressEditors Library 5/Sources/cxDBEdit.pas new file mode 100644 index 00000000..5ba5612f --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxDBEdit.pas @@ -0,0 +1,3075 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDBEdit; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Messages, + Classes, Controls, DB, DBCtrls, SysUtils, cxBlobEdit, cxButtonEdit, cxCalc, + cxCalendar, cxCheckBox, cxClasses, cxContainer, cxCurrencyEdit, cxCustomData, + cxDataUtils, cxDB, cxDropDownEdit, cxEdit, cxHyperLinkEdit, cxImage, + cxImageComboBox, cxListBox, cxMaskEdit, cxMemo, cxMRUEdit, cxRadioGroup, + cxSpinEdit, cxTextEdit, cxTimeEdit; + +type + TcxDBTextEdit = class; + + { TcxCustomDBEditDefaultValuesProvider } + + TcxCustomDBEditDefaultValuesProvider = class(TcxCustomEditDefaultValuesProvider) + private + FDataSource: TDataSource; + FField: TField; + FFreeNotifier: TcxFreeNotificator; + procedure FieldFreeNotification(Sender: TComponent); + procedure SetDataSource(Value: TDataSource); + procedure SetField(Value: TField); + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + function CanSetEditMode: Boolean; override; + function DefaultAlignment: TAlignment; override; + function DefaultBlobKind: TcxBlobKind; override; + function DefaultCanModify: Boolean; override; + function DefaultDisplayFormat: string; override; + function DefaultEditFormat: string; override; + function DefaultEditMask: string; override; + function DefaultIsFloatValue: Boolean; override; + function DefaultMaxLength: Integer; override; + function DefaultMaxValue: Double; override; + function DefaultMinValue: Double; override; + function DefaultPrecision: Integer; override; + function DefaultReadOnly: Boolean; override; + function DefaultRequired: Boolean; override; + function IsBlob: Boolean; override; + function IsCurrency: Boolean; override; + function IsDataAvailable: Boolean; override; + function IsDataStorage: Boolean; override; + function IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean; override; + function IsOnGetTextAssigned: Boolean; override; + function IsOnSetTextAssigned: Boolean; override; + function IsValidChar(AChar: Char): Boolean; override; + property DataSource: TDataSource read FDataSource write SetDataSource; + property Field: TField read FField write SetField; + end; + + { TcxDBFieldDataLink } + + TcxDBFieldDataLink = class(TcxCustomFieldDataLink) + protected + procedure FocusControl(Field: TFieldRef); override; + procedure VisualControlChanged; override; + procedure UpdateRightToLeft; override; + end; + + { TcxDBDataBinding } + + TcxDBDataBinding = class(TcxCustomDBDataBinding) + protected + function GetDataLinkClass: TcxCustomFieldDataLinkClass; override; + published + property DataSource; + property DataField; + end; + + { TcxEditFieldDataLink } + + TcxDBEditDataBinding = class; + + TcxEditFieldDataLink = class(TDataLink) + private + FControl: TComponent; + FDataBinding: TcxDBEditDataBinding; + FEditing: Boolean; + FField: TField; + FFieldName: string; + FFreeNotifier: TcxFreeNotificator; + FMasterField: TField; + FModified: Boolean; + procedure FieldFreeNotification(Sender: TComponent); + function GetCanModify: Boolean; + procedure InternalSetField(Value: TField); + procedure SetEditing(Value: Boolean); + procedure SetField(Value: TField); + procedure SetFieldName(const Value: string); + procedure UpdateField; + procedure UpdateMasterField; + procedure UpdateRightToLeft; + protected + procedure ActiveChanged; override; + procedure DataEvent(Event: TDataEvent; + Info: Longint); override; + procedure EditingChanged; override; + procedure FocusControl(Field: TFieldRef); override; + procedure LayoutChanged; override; + procedure RecordChanged(Field: TField); override; + procedure UpdateData; override; + procedure ResetModified; + public + constructor Create(ADataBinding: TcxDBEditDataBinding); + destructor Destroy; override; + function Edit: Boolean; + procedure Modified; + procedure Reset; + property CanModify: Boolean read GetCanModify; + property Control: TComponent read FControl write FControl; + property Editing: Boolean read FEditing; + property Field: TField read FField; + property FieldName: string read FFieldName write SetFieldName; + end; + + { TcxDBEditDataBinding } + + TcxDBEditDataBinding = class(TcxEditDataBinding) + private + FDataLink: TcxEditFieldDataLink; + FRefreshCount: Integer; + function GetDataField: string; + function GetDataSource: TDataSource; + function GetDefaultValuesProvider: TcxCustomDBEditDefaultValuesProvider; + function GetField: TField; + procedure SetDataField(const Value: string); + procedure SetDataSource(Value: TDataSource); + protected + procedure DefaultValuesChanged; override; + procedure DisableRefresh; + procedure EnableRefresh; + function GetEditing: Boolean; override; + function GetModified: Boolean; override; + function GetStoredValue: TcxEditValue; override; + function IsRefreshDisabled: Boolean; + procedure Reset; override; + procedure SetDisplayValue(const Value: TcxEditValue); override; + function SetEditMode: Boolean; override; + procedure SetStoredValue(const Value: TcxEditValue); override; + procedure DataChanged; virtual; + procedure DataSetChange; virtual; + procedure EditingChanged; virtual; + function IsLookupControl: Boolean; virtual; + procedure UpdateData; virtual; + property DefaultValuesProvider: TcxCustomDBEditDefaultValuesProvider read GetDefaultValuesProvider; + public + constructor Create(AEdit: TcxCustomEdit); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function CanCheckEditorValue: Boolean; override; + function CanPostEditorValue: Boolean; override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + class function GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; override; + procedure SetModified; override; + function UpdateAction(Action: TBasicAction): Boolean; override; + procedure UpdateDisplayValue; override; + procedure UpdateNotConnectedDBEditDisplayValue; override; + property DataLink: TcxEditFieldDataLink read FDataLink; + property Field: TField read GetField; + published + property DataField: string read GetDataField write SetDataField; + property DataSource: TDataSource read GetDataSource write SetDataSource; + end; + + { TcxDBTextEditDataBinding } + + TcxDBTextEditDataBinding = class(TcxDBEditDataBinding) + protected + procedure SetDisplayValue(const Value: TcxEditValue); override; + public + procedure UpdateNotConnectedDBEditDisplayValue; override; + end; + + { TcxDBTextEdit } + + TcxDBTextEdit = class(TcxCustomTextEdit) + private + function GetActiveProperties: TcxTextEditProperties; + function GetDataBinding: TcxDBTextEditDataBinding; + function GetProperties: TcxTextEditProperties; + procedure SetDataBinding(Value: TcxDBTextEditDataBinding); + procedure SetProperties(Value: TcxTextEditProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxTextEditProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DataBinding: TcxDBTextEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxTextEditProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDrag; + property OnEndDock; + property OnStartDock; + end; + + { TcxDBMemo } + + TcxDBMemo = class(TcxCustomMemo) + private + function GetActiveProperties: TcxMemoProperties; + function GetDataBinding: TcxDBTextEditDataBinding; + function GetProperties: TcxMemoProperties; + procedure SetDataBinding(Value: TcxDBTextEditDataBinding); + procedure SetProperties(Value: TcxMemoProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxMemoProperties read GetActiveProperties; + published + property Align; + property Anchors; + property Constraints; + property DataBinding: TcxDBTextEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxMemoProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + + { TcxDBMaskEdit } + + TcxDBMaskEdit = class(TcxCustomMaskEdit) + private + function GetActiveProperties: TcxMaskEditProperties; + function GetDataBinding: TcxDBTextEditDataBinding; + function GetProperties: TcxMaskEditProperties; + procedure SetDataBinding(Value: TcxDBTextEditDataBinding); + procedure SetProperties(Value: TcxMaskEditProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxMaskEditProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DataBinding: TcxDBTextEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxMaskEditProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDrag; + property OnEndDock; + property OnStartDock; + end; + + { TcxDBButtonEdit } + + TcxDBButtonEdit = class(TcxCustomButtonEdit) + private + function GetActiveProperties: TcxButtonEditProperties; + function GetDataBinding: TcxDBTextEditDataBinding; + function GetProperties: TcxButtonEditProperties; + procedure SetDataBinding(Value: TcxDBTextEditDataBinding); + procedure SetProperties(Value: TcxButtonEditProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxButtonEditProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DataBinding: TcxDBTextEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxButtonEditProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDrag; + property OnEndDock; + property OnStartDock; + end; + + { TcxDBCheckBox } + + TcxDBCheckBox = class(TcxCustomCheckBox) + private + function GetActiveProperties: TcxCheckBoxProperties; + function GetDataBinding: TcxDBEditDataBinding; + function GetProperties: TcxCheckBoxProperties; + procedure SetDataBinding(Value: TcxDBEditDataBinding); + procedure SetProperties(Value: TcxCheckBoxProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxCheckBoxProperties read GetActiveProperties; + property Checked; + published + property Action; + property Align; + property Anchors; + property AutoSize; + property Caption; + property Constraints; + property DataBinding: TcxDBEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ParentBackground; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxCheckBoxProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Transparent; + property Visible; + property OnClick; + property OnContextPopup; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDrag; + property OnEndDock; + property OnStartDock; + end; + + { TcxDBComboBox } + + TcxDBComboBox = class(TcxCustomComboBox) + private + function GetActiveProperties: TcxComboBoxProperties; + function GetDataBinding: TcxDBTextEditDataBinding; + function GetProperties: TcxComboBoxProperties; + procedure SetDataBinding(Value: TcxDBTextEditDataBinding); + procedure SetProperties(Value: TcxComboBoxProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxComboBoxProperties read GetActiveProperties; + property ItemIndex; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DataBinding: TcxDBTextEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxComboBoxProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDrag; + property OnEndDock; + property OnStartDock; + end; + + { TcxDBPopupEdit } + + TcxDBPopupEdit = class(TcxCustomPopupEdit) + private + function GetActiveProperties: TcxPopupEditProperties; + function GetDataBinding: TcxDBTextEditDataBinding; + function GetProperties: TcxPopupEditProperties; + procedure SetDataBinding(Value: TcxDBTextEditDataBinding); + procedure SetProperties(Value: TcxPopupEditProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxPopupEditProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DataBinding: TcxDBTextEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxPopupEditProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDrag; + property OnEndDock; + property OnStartDock; + end; + + { TcxDBSpinEdit } + + TcxDBSpinEdit = class(TcxCustomSpinEdit) + private + function GetActiveProperties: TcxSpinEditProperties; + function GetDataBinding: TcxDBTextEditDataBinding; + function GetProperties: TcxSpinEditProperties; + procedure SetDataBinding(Value: TcxDBTextEditDataBinding); + procedure SetProperties(Value: TcxSpinEditProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxSpinEditProperties read GetActiveProperties; + property Value; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DataBinding: TcxDBTextEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxSpinEditProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + + { TcxDBTimeEdit } + + TcxDBTimeEdit = class(TcxCustomTimeEdit) + private + function GetActiveProperties: TcxTimeEditProperties; + function GetDataBinding: TcxDBTextEditDataBinding; + function GetProperties: TcxTimeEditProperties; + procedure SetDataBinding(Value: TcxDBTextEditDataBinding); + procedure SetProperties(Value: TcxTimeEditProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxTimeEditProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DataBinding: TcxDBTextEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxTimeEditProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + + { TcxDBBlobEdit } + + TcxDBBlobEdit = class(TcxCustomBlobEdit) + private + function GetActiveProperties: TcxBlobEditProperties; + function GetDataBinding: TcxDBEditDataBinding; + function GetProperties: TcxBlobEditProperties; + procedure SetDataBinding(Value: TcxDBEditDataBinding); + procedure SetProperties(Value: TcxBlobEditProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxBlobEditProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DataBinding: TcxDBEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxBlobEditProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnGetGraphicClass; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + + { TcxDBCalcEdit } + + TcxDBCalcEdit = class(TcxCustomCalcEdit) + private + function GetActiveProperties: TcxCalcEditProperties; + function GetDataBinding: TcxDBTextEditDataBinding; + function GetProperties: TcxCalcEditProperties; + procedure SetDataBinding(Value: TcxDBTextEditDataBinding); + procedure SetProperties(Value: TcxCalcEditProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxCalcEditProperties read GetActiveProperties; + property Value; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DataBinding: TcxDBTextEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxCalcEditProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop default True; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + + { TcxDBDateEdit } + + TcxDBDateEdit = class(TcxCustomDateEdit) + private + function GetActiveProperties: TcxDateEditProperties; + function GetDataBinding: TcxDBTextEditDataBinding; + function GetProperties: TcxDateEditProperties; + procedure SetDataBinding(Value: TcxDBTextEditDataBinding); + procedure SetProperties(Value: TcxDateEditProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxDateEditProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DataBinding: TcxDBTextEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxDateEditProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop default True; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + + { TcxDBCurrencyEdit } + + TcxDBCurrencyEdit = class(TcxCustomCurrencyEdit) + private + function GetActiveProperties: TcxCurrencyEditProperties; + function GetDataBinding: TcxDBTextEditDataBinding; + function GetProperties: TcxCurrencyEditProperties; + procedure SetDataBinding(Value: TcxDBTextEditDataBinding); + procedure SetProperties(Value: TcxCurrencyEditProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxCurrencyEditProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DataBinding: TcxDBTextEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxCurrencyEditProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnEditing; + property OnEndDock; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + end; + + { TcxDBHyperLinkEdit } + + TcxDBHyperLinkEdit = class(TcxCustomHyperLinkEdit) + private + function GetActiveProperties: TcxHyperLinkEditProperties; + function GetDataBinding: TcxDBTextEditDataBinding; + function GetProperties: TcxHyperLinkEditProperties; + procedure SetDataBinding(Value: TcxDBTextEditDataBinding); + procedure SetProperties(Value: TcxHyperLinkEditProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxHyperLinkEditProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DataBinding: TcxDBTextEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxHyperLinkEditProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnEditing; + property OnEndDock; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + end; + + { TcxDBImage } + + TcxDBImage = class(TcxCustomImage) + private + function GetActiveProperties: TcxImageProperties; + function GetDataBinding: TcxDBEditDataBinding; + function GetProperties: TcxImageProperties; + procedure SetDataBinding(Value: TcxDBEditDataBinding); + procedure SetProperties(Value: TcxImageProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxImageProperties read GetActiveProperties; + published + property Align; + property Anchors; + property AutoSize; + property Constraints; + property DataBinding: TcxDBEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ParentColor; + property PopupMenu; + property Properties: TcxImageProperties read GetProperties + write SetProperties; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnGetGraphicClass; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + + { TcxDBImageComboBox } + + TcxDBImageComboBox = class(TcxCustomImageComboBox) + private + function GetActiveProperties: TcxImageComboBoxProperties; + function GetDataBinding: TcxDBTextEditDataBinding; + function GetProperties: TcxImageComboBoxProperties; + procedure SetDataBinding(Value: TcxDBTextEditDataBinding); + procedure SetProperties(Value: TcxImageComboBoxProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxImageComboBoxProperties read GetActiveProperties; + property ItemIndex; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DataBinding: TcxDBTextEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxImageComboBoxProperties read GetProperties write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnEditing; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + end; + + { TcxDBMRUEdit } + + TcxDBMRUEdit = class(TcxCustomMRUEdit) + private + function GetActiveProperties: TcxMRUEditProperties; + function GetDataBinding: TcxDBTextEditDataBinding; + function GetProperties: TcxMRUEditProperties; + procedure SetDataBinding(Value: TcxDBTextEditDataBinding); + procedure SetProperties(Value: TcxMRUEditProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxMRUEditProperties read GetActiveProperties; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DataBinding: TcxDBTextEditDataBinding + read GetDataBinding write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxMRUEditProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnEditing; + property OnEndDock; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + end; + + { TcxDBRadioGroupButton } + + TcxDBRadioGroupButton = class(TcxCustomRadioGroupButton) + private + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + public + constructor Create(AOwner: TComponent); override; + end; + + { TcxDBRadioGroup } + + TcxDBRadioGroup = class(TcxCustomRadioGroup) + private + function GetActiveProperties: TcxRadioGroupProperties; + function GetDataBinding: TcxDBEditDataBinding; + function GetProperties: TcxRadioGroupProperties; + procedure SetDataBinding(Value: TcxDBEditDataBinding); + procedure SetProperties(Value: TcxRadioGroupProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxRadioGroupProperties read GetActiveProperties; + protected + function GetButtonInstance: TWinControl; override; + class function GetDataBindingClass: TcxEditDataBindingClass; override; + published + property Align; + property Alignment; + property Anchors; + property Caption; + property Constraints; + property Ctl3D; + property DataBinding: TcxDBEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ParentBackground; + property ParentColor; + property ParentCtl3D; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxRadioGroupProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Transparent; + property Visible; + property OnClick; + property OnContextPopup; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnStartDock; + property OnStartDrag; + end; + + { TcxDBListBox } + + TcxDBListBox = class(TcxListBox) + private + function GetDataBinding: TcxDBDataBinding; + procedure SetDataBinding(Value: TcxDBDataBinding); + protected + function GetDataBindingClass: TcxCustomDataBindingClass; override; + published + property DataBinding: TcxDBDataBinding read GetDataBinding write SetDataBinding; + end; + +function GetcxDBEditDataLink(AEdit: TcxCustomEdit): TDataLink; + +implementation + +uses + cxVariants, StdCtrls; + +type + TcxCustomEditAccess = class(TcxCustomEdit); + +function GetcxDBEditDataLink(AEdit: TcxCustomEdit): TDataLink; +begin + if TcxCustomEditAccess(AEdit).DataBinding is TcxDBEditDataBinding then + Result := TcxDBEditDataBinding(TcxCustomEditAccess(AEdit).DataBinding).DataLink + else + Result := nil; +end; + +{ TcxCustomDBEditDefaultValuesProvider } + +constructor TcxCustomDBEditDefaultValuesProvider.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FFreeNotifier := TcxFreeNotificator.Create(nil); + FFreeNotifier.OnFreeNotification := FieldFreeNotification; +end; + +destructor TcxCustomDBEditDefaultValuesProvider.Destroy; +begin + FreeAndNil(FFreeNotifier); + inherited Destroy; +end; + +function TcxCustomDBEditDefaultValuesProvider.CanSetEditMode: Boolean; +begin + Result := (DataSource <> nil) and (DataSource.AutoEdit or + (DataSource.State in [dsEdit, dsInsert])); +end; + +function TcxCustomDBEditDefaultValuesProvider.DefaultAlignment: TAlignment; +begin + if IsDataAvailable then + Result := Field.Alignment + else + Result := inherited DefaultAlignment; +end; + +function TcxCustomDBEditDefaultValuesProvider.DefaultBlobKind: TcxBlobKind; +begin + if IsDataAvailable then + case Field.DataType of + ftMemo, ftFmtMemo: + Result := bkMemo; + ftGraphic: + Result := bkGraphic; + ftParadoxOle, ftDBaseOle: + Result := bkOle; + else + Result := bkNone; + end + else + Result := bkNone; +end; + +function TcxCustomDBEditDefaultValuesProvider.DefaultCanModify: Boolean; +begin + Result := not DefaultReadOnly and IsDataAvailable; + Result := Result and (Field.CanModify or (Field.Lookup and CanModifyLookupField(Field))); +end; + +function TcxCustomDBEditDefaultValuesProvider.DefaultDisplayFormat: string; +begin + if IsDataAvailable and (Field is TNumericField) then + Result := TNumericField(Field).DisplayFormat + else + Result := inherited DefaultDisplayFormat; +end; + +function TcxCustomDBEditDefaultValuesProvider.DefaultEditFormat: string; +begin + if IsDataAvailable and (Field is TNumericField) then + Result := TNumericField(Field).EditFormat + else + Result := inherited DefaultEditFormat; +end; + +function TcxCustomDBEditDefaultValuesProvider.DefaultEditMask: string; +begin + if IsDataAvailable then + Result := Field.EditMask + else + Result := inherited DefaultEditMask; +end; + +function TcxCustomDBEditDefaultValuesProvider.DefaultIsFloatValue: Boolean; +begin + if IsDataAvailable then + Result := Field.DataType in [ftFloat, ftCurrency, ftBCD] + else + Result := inherited DefaultIsFloatValue; +end; + +function TcxCustomDBEditDefaultValuesProvider.DefaultMaxLength: Integer; +begin + if IsDataAvailable and (Field.DataType in [ftString{$IFDEF DELPHI4}, ftWideString{$ENDIF}]) then + Result := Field.Size + else + Result := inherited DefaultMaxLength; +end; + +function TcxCustomDBEditDefaultValuesProvider.DefaultMaxValue: Double; +begin + Result := inherited DefaultMaxValue; + if IsDataAvailable then + begin + if Field is TIntegerField then + Result := TIntegerField(Field).MaxValue + else + if Field is TFloatField then + begin + Result := StrToFloat(FloatToStrF(TFloatField(Field).MaxValue, ffGeneral, + TFloatField(Field).Precision, TFloatField(Field).Precision)); + end + else + if Field is TBCDField then + Result := TBCDField(Field).MaxValue; + end; +end; + +function TcxCustomDBEditDefaultValuesProvider.DefaultMinValue: Double; +begin + Result := inherited DefaultMinValue; + if IsDataAvailable then + begin + if Field is TIntegerField then + Result := TIntegerField(Field).MinValue + else + if Field is TFloatField then + begin + Result := StrToFloat(FloatToStrF(TFloatField(Field).MinValue, ffGeneral, + TFloatField(Field).Precision, TFloatField(Field).Precision)); + end + else + if Field is TBCDField then + Result := TBCDField(Field).MinValue; + end; +end; + +function TcxCustomDBEditDefaultValuesProvider.DefaultPrecision: Integer; +begin + if Field is TFloatField then + Result := TFloatField(Field).Precision + else if Field is TBCDField then + Result := TBCDField(Field).Precision +{$IFDEF DELPHI5} + else if Field is TAggregateField then + Result := TAggregateField(Field).Precision +{$ENDIF} +{$IFDEF DELPHI6} + else if Field is TFMTBCDField then + Result := TFMTBCDField(Field).Precision +{$ENDIF} + else + Result := inherited DefaultPrecision; +end; + +function TcxCustomDBEditDefaultValuesProvider.DefaultReadOnly: Boolean; +begin + if IsDataAvailable then + Result := Field.ReadOnly + else + Result := inherited DefaultReadOnly; +end; + +function TcxCustomDBEditDefaultValuesProvider.DefaultRequired: Boolean; +begin + if IsDataAvailable then + Result := Field.Required + else + Result := inherited DefaultRequired; +end; + +function TcxCustomDBEditDefaultValuesProvider.IsBlob: Boolean; +begin + Result := IsDataAvailable and Field.IsBlob; +end; + +function TcxCustomDBEditDefaultValuesProvider.IsCurrency: Boolean; +begin + Result := inherited IsCurrency; + if IsDataAvailable then + if Field is TFloatField then + Result := TFloatField(Field).Currency + else if Field is TBCDField then + Result := TBCDField(Field).Currency +{$IFDEF DELPHI5} + else if Field is TAggregateField then + Result := TAggregateField(Field).Currency +{$ENDIF} +{$IFDEF DELPHI6} + else if Field is TFMTBCDField then + Result := TFMTBCDField(Field).Currency +{$ENDIF} +end; + +function TcxCustomDBEditDefaultValuesProvider.IsDataAvailable: Boolean; +begin + Result := (FField <> nil) and (FField.DataSet <> nil) and + (FField.DataSet.State <> dsInactive); +end; + +function TcxCustomDBEditDefaultValuesProvider.IsDataStorage: Boolean; +begin + Result := True; +end; + +function TcxCustomDBEditDefaultValuesProvider.IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean; +begin + Result := IsDataAvailable; + if Result and not Assigned(Field.OnGetText) then + begin + Result := False; + if Field is TFloatField then + Result := Result or TFloatField(Field).Currency and AIsCurrencyValueAccepted; + if Field is TBCDField then + Result := Result or TBCDField(Field).Currency and AIsCurrencyValueAccepted; + if Field is TDateTimeField then + Result := Result or (TDateTimeField(Field).DisplayFormat <> ''); +{$IFDEF DELPHI5} + if Field is TAggregateField then + with TAggregateField(Field) do + Result := Result or (DisplayFormat <> '') or Currency and AIsCurrencyValueAccepted; +{$ENDIF} +{$IFDEF DELPHI6} + if Field is TFMTBCDField then + Result := Result or TFMTBCDField(Field).Currency and AIsCurrencyValueAccepted; + if Field is TSQLTimeStampField then + Result := Result or (TSQLTimeStampField(Field).DisplayFormat <> ''); +{$ENDIF} + if Field is TNumericField then + Result := Result or (TNumericField(Field).DisplayFormat <> ''); + end; +end; + +function TcxCustomDBEditDefaultValuesProvider.IsOnGetTextAssigned: Boolean; +begin + Result := IsDisplayFormatDefined(False) and (DefaultDisplayFormat = ''); +end; + +function TcxCustomDBEditDefaultValuesProvider.IsOnSetTextAssigned: Boolean; +begin + Result := IsDataAvailable and Assigned(Field.OnSetText); +end; + +function TcxCustomDBEditDefaultValuesProvider.IsValidChar(AChar: Char): Boolean; +begin + if IsDataAvailable then + Result := Field.IsValidChar(AChar) + else + Result := inherited IsValidChar(AChar); +end; + +procedure TcxCustomDBEditDefaultValuesProvider.FieldFreeNotification(Sender: TComponent); +begin + if Sender = DataSource then + DataSource := nil + else + Field := nil; +end; + +procedure TcxCustomDBEditDefaultValuesProvider.SetDataSource(Value: TDataSource); +begin + if Value <> FDataSource then + begin + if FDataSource <> nil then + FFreeNotifier.RemoveSender(FDataSource); + FDataSource := Value; + if FDataSource <> nil then + FFreeNotifier.AddSender(FDataSource); + end; +end; + +procedure TcxCustomDBEditDefaultValuesProvider.SetField(Value: TField); +begin + if Value <> FField then + begin + if FField <> nil then + FFreeNotifier.RemoveSender(FField); + FField := Value; + if FField <> nil then + FFreeNotifier.AddSender(FField); + end; +end; + +{ TcxDBFieldDataLink } + +procedure TcxDBFieldDataLink.FocusControl(Field: TFieldRef); +var + AVisualControl: TWinControl; +begin + if not(DataBinding.VisualControl is TWinControl) then + Exit; + AVisualControl := TWinControl(DataBinding.VisualControl); + if (Field^ <> nil) and (Field^ = Self.Field) and AVisualControl.CanFocus then + begin + Field^ := nil; + AVisualControl.SetFocus; + end; +end; + +procedure TcxDBFieldDataLink.VisualControlChanged; +begin + VisualControl := DataBinding.VisualControl is TWinControl; +end; + +procedure TcxDBFieldDataLink.UpdateRightToLeft; +var + AIsRightAligned: Boolean; + AUseRightToLeftAlignment: Boolean; + AVisualControl: TWinControl; +begin + if DataBinding.VisualControl is TWinControl then + begin + AVisualControl := TWinControl(DataBinding.VisualControl); + if AVisualControl.IsRightToLeft then + begin + AIsRightAligned := + (GetWindowLong(AVisualControl.Handle, GWL_EXSTYLE) and WS_EX_RIGHT) = WS_EX_RIGHT; + AUseRightToLeftAlignment := DBUseRightToLeftAlignment(AVisualControl, Field); + if AIsRightAligned and not AUseRightToLeftAlignment or + not AIsRightAligned and AUseRightToLeftAlignment then + AVisualControl.Perform(CM_RECREATEWND, 0, 0); + end; + end; +end; + +{ TcxDBDataBinding } + +function TcxDBDataBinding.GetDataLinkClass: TcxCustomFieldDataLinkClass; +begin + Result := TcxDBFieldDataLink; +end; + +{ TcxEditFieldDataLink } + +constructor TcxEditFieldDataLink.Create(ADataBinding: TcxDBEditDataBinding); +begin + inherited Create; + VisualControl := True; + FDataBinding := ADataBinding; + FFreeNotifier := TcxFreeNotificator.Create(nil); + FFreeNotifier.OnFreeNotification := FieldFreeNotification; +end; + +destructor TcxEditFieldDataLink.Destroy; +begin + InternalSetField(nil); + FreeAndNil(FFreeNotifier); + inherited Destroy; +end; + +function TcxEditFieldDataLink.Edit: Boolean; +begin + if CanModify then + inherited Edit; + Result := FEditing; +end; + +procedure TcxEditFieldDataLink.Modified; +begin + FModified := True; +end; + +procedure TcxEditFieldDataLink.Reset; +begin + RecordChanged(nil); +end; + +procedure TcxEditFieldDataLink.ActiveChanged; +begin + FDataBinding.DefaultValuesProvider.DataSource := DataSource; + FDataBinding.DisableRefresh; + try + UpdateField; + FDataBinding.DataSetChange; + finally + FDataBinding.EnableRefresh; + FModified := False; + FDataBinding.DataChanged; + end; +end; + +procedure TcxEditFieldDataLink.DataEvent(Event: TDataEvent; + Info: Longint); +begin + inherited DataEvent(Event, Info); + if Event = deDataSetChange then + begin + FDataBinding.DisableRefresh; + try + FDataBinding.DataSetChange; + finally + FDataBinding.EnableRefresh; + FModified := False; + end; + end; +end; + +procedure TcxEditFieldDataLink.EditingChanged; +begin + SetEditing(inherited Editing and CanModify); + FDataBinding.EditingChanged; +end; + +procedure TcxEditFieldDataLink.FocusControl(Field: TFieldRef); +begin + if (Field^ <> nil) and (Field^ = FField) and (FControl is TWinControl) then + if TWinControl(FControl).CanFocus then + begin + Field^ := nil; + TWinControl(FControl).SetFocus; + end; +end; + +procedure TcxEditFieldDataLink.LayoutChanged; +begin + UpdateField; +end; + +procedure TcxEditFieldDataLink.RecordChanged(Field: TField); +begin + if (Field = nil) or (Field = FMasterField) then + begin + FDataBinding.DataChanged; + if not FDataBinding.IsRefreshDisabled then + FModified := False; + end; +end; + +procedure TcxEditFieldDataLink.UpdateData; +begin + if FModified then + begin + if Field <> nil then + FDataBinding.UpdateData; + if not FDataBinding.IsRefreshDisabled then + FModified := False; + end; +end; + +procedure TcxEditFieldDataLink.ResetModified; +begin + FModified := False; +end; + +procedure TcxEditFieldDataLink.FieldFreeNotification(Sender: TComponent); +begin + InternalSetField(nil); +end; + +function TcxEditFieldDataLink.GetCanModify: Boolean; +begin + Result := not ReadOnly and (Field <> nil) and (Field.CanModify or + (Field.Lookup and CanModifyLookupField(Field))); +end; + +procedure TcxEditFieldDataLink.InternalSetField(Value: TField); +begin + if Value <> FField then + begin + if FField <> nil then + FFreeNotifier.RemoveSender(FField); + FField := Value; + if FField <> nil then + FFreeNotifier.AddSender(FField); + UpdateMasterField; + end; +end; + +procedure TcxEditFieldDataLink.SetEditing(Value: Boolean); +begin + if FEditing <> Value then + begin + FEditing := Value; + if not FDataBinding.IsRefreshDisabled then + FModified := False; + end; +end; + +procedure TcxEditFieldDataLink.SetField(Value: TField); +begin + if FField <> Value then + begin + InternalSetField(Value); + FDataBinding.DefaultValuesChanged; + EditingChanged; + RecordChanged(nil); + UpdateRightToLeft; + end; +end; + +procedure TcxEditFieldDataLink.SetFieldName(const Value: string); +begin + if FFieldName <> Value then + begin + FFieldName := Value; + UpdateField; + end; +end; + +procedure TcxEditFieldDataLink.UpdateField; +begin + if Active and (FFieldName <> '') then + begin + InternalSetField(nil); + if Assigned(FControl) then + SetField(GetFieldProperty(DataSource.DataSet, FControl, FFieldName)) + else + SetField(DataSource.DataSet.FieldByName(FFieldName)); + end + else + SetField(nil); +end; + +procedure TcxEditFieldDataLink.UpdateMasterField; +begin + if FField = nil then + FMasterField := nil + else + if not FDataBinding.IsLookupControl or (FField.FieldKind <> fkLookup) or + (Pos(';', FField.KeyFields) > 0) then + FMasterField := FField + else + if Assigned(FControl) then + FMasterField := GetFieldProperty(DataSource.DataSet, FControl, + FField.KeyFields) + else + FMasterField := DataSource.DataSet.FieldByName(FField.KeyFields); +end; + +procedure TcxEditFieldDataLink.UpdateRightToLeft; +var + AIsRightAligned: Boolean; + AUseRightToLeftAlignment: Boolean; +begin + if Assigned(FControl) and (FControl is TWinControl) and + TWinControl(FControl).IsRightToLeft then + begin + AIsRightAligned := + (GetWindowLong(TWinControl(FControl).Handle, GWL_EXSTYLE) and WS_EX_RIGHT) = WS_EX_RIGHT; + AUseRightToLeftAlignment := + DBUseRightToLeftAlignment(TControl(FControl), Field); + if (AIsRightAligned and (not AUseRightToLeftAlignment)) or + ((not AIsRightAligned) and AUseRightToLeftAlignment) then + TWinControl(FControl).Perform(CM_RECREATEWND, 0, 0); + end; +end; + +{ TcxDBEditDataBinding } + +constructor TcxDBEditDataBinding.Create(AEdit: TcxCustomEdit); +begin + inherited Create(AEdit); + FDataLink := TcxEditFieldDataLink.Create(Self); + if AEdit.InnerControl <> nil then + FDataLink.Control := AEdit.InnerControl + else + FDataLink.Control := AEdit; +end; + +destructor TcxDBEditDataBinding.Destroy; +begin + FreeAndNil(FDataLink); + inherited Destroy; +end; + +procedure TcxDBEditDataBinding.Assign(Source: TPersistent); +begin + if Source is TcxDBTextEditDataBinding then + begin + DataField := TcxDBTextEditDataBinding(Source).DataField; + DataSource := TcxDBTextEditDataBinding(Source).DataSource; + DataChanged; + end; + inherited Assign(Source); +end; + +function TcxDBEditDataBinding.CanCheckEditorValue: Boolean; +begin + Result := False; +end; + +function TcxDBEditDataBinding.CanPostEditorValue: Boolean; +begin + Result := Editing and DataLink.FModified; +end; + +function TcxDBEditDataBinding.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := FDataLink.ExecuteAction(Action); +end; + +class function TcxDBEditDataBinding.GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; +begin + Result := TcxCustomDBEditDefaultValuesProvider; +end; + +procedure TcxDBEditDataBinding.SetModified; +begin + if Editing then + DataLink.Modified; +end; + +function TcxDBEditDataBinding.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := FDataLink.UpdateAction(Action); +end; + +procedure TcxDBEditDataBinding.UpdateDisplayValue; +begin + Edit.LockClick(True); + try + if IsDataAvailable then + FDataLink.Reset + else + inherited UpdateDisplayValue; + finally + Edit.LockClick(False); + end; +end; + +procedure TcxDBEditDataBinding.DefaultValuesChanged; +begin + DefaultValuesProvider.Field := Field; + inherited DefaultValuesChanged; +end; + +procedure TcxDBEditDataBinding.DisableRefresh; +begin + Inc(FRefreshCount); +end; + +procedure TcxDBEditDataBinding.EnableRefresh; +begin + if FRefreshCount > 0 then + Dec(FRefreshCount); +end; + +function TcxDBEditDataBinding.GetEditing: Boolean; +begin + Result := IsDataAvailable and FDataLink.Editing; +end; + +function TcxDBEditDataBinding.GetModified: Boolean; +begin + Result := GetEditing and FDataLink.FModified; +end; + +function TcxDBEditDataBinding.GetStoredValue: TcxEditValue; +var + AEditValueSource: TcxDataEditValueSource; +begin + AEditValueSource := Edit.ActiveProperties.GetEditValueSource(Edit.InternalFocused); + if not IsDataAvailable or (Field.IsNull and + ((AEditValueSource <> evsText) or not Assigned(Field.OnGetText))) then + Result := Null + else + begin + Result := Null; + case AEditValueSource of + evsKey: + if Field.KeyFields <> '' then + Result := Field.DataSet.FieldValues[Field.KeyFields] + else + Result := Field.Value; + evsText: + if Edit.Focused and FDataLink.CanModify then + Result := Field.Text + else + if Field.IsBlob then + Result := Field.AsString + else + Result := Field.DisplayText; + evsValue: + Result := Field.Value; + end; + end; +end; + +function TcxDBEditDataBinding.IsRefreshDisabled: Boolean; +begin + Result := FRefreshCount > 0; +end; + +procedure TcxDBEditDataBinding.Reset; +begin + if IsDataAvailable then + begin + FDataLink.Reset; + Edit.SelectAll; + end; +end; + +procedure TcxDBEditDataBinding.SetDisplayValue(const Value: TcxEditValue); +begin + if IsDataAvailable then + SetInternalDisplayValue(Value) + else + SetInternalDisplayValue(''); +end; + +function TcxDBEditDataBinding.SetEditMode: Boolean; +begin + Result := IDefaultValuesProvider.DefaultCanModify; + if not Result then + Exit; + + DisableRefresh; + try + FDatalink.Edit; + Result := FDatalink.Editing; + if Result then + FDatalink.Modified; + finally + EnableRefresh; + end; +end; + +procedure TcxDBEditDataBinding.SetStoredValue(const Value: TcxEditValue); + + procedure SetFieldValue(AField: TField; const AValue: TcxEditValue); + begin + if VarIsStr(AValue) and (AValue = '') and + not (Field.DataType in [ftString{$IFDEF DELPHI4}, ftWideString{$ENDIF}]) then + AField.Value := Null + {$IFDEF DELPHI6} + else + if (Field is TFMTBCDField) and VarIsType(AValue, varDouble) then + AField.Value := FloatToStrF(AValue, ffFixed, 15, 18) // bug in VarToBcd when the type AValue is double: VarToStr(0.000012) returns 1.2E-05 which is incorrect for StrToBcd + {$ENDIF} + else + AField.Value := AValue; + end; + +var + AEditValueSource: TcxDataEditValueSource; + AFieldList: TList; + I: Integer; +begin + if IsDataAvailable then + begin + DisableRefresh; + try + if FDataLink.Edit then + begin + AEditValueSource := Edit.ActiveProperties.GetEditValueSource(True(*Edit.InternalFocused*)); + if (*(*)AEditValueSource = evsText(*) or Assigned(Field.OnSetText)*) then + Field.Text := VarToStr(Value) + else + if (AEditValueSource = evsKey) and (Field.KeyFields <> '') then + if Pos(';', Field.KeyFields) = 0 then + SetFieldValue(Field.DataSet.FieldByName(Field.KeyFields), Value) + else + begin + AFieldList := TList.Create; + try + Field.DataSet.GetFieldList(AFieldList, Field.KeyFields); + for I := 0 to AFieldList.Count - 1 do + SetFieldValue(TField(AFieldList[I]), Value[I]); + finally + AFieldList.Free; + end; + Field.DataSet.FieldValues[Field.KeyFields] := Value; + end + else + SetFieldValue(Field, Value); + FDataLink.ResetModified; + end; + finally + EnableRefresh; + end; + end; +end; + +procedure TcxDBEditDataBinding.UpdateNotConnectedDBEditDisplayValue; +begin + if not IsDataAvailable then + Edit.EditValue := Null; +end; + +procedure TcxDBEditDataBinding.DataChanged; +begin + if IsRefreshDisabled then + Exit; + if Edit.IsDesigning and not IsDataAvailable then + UpdateNotConnectedDBEditDisplayValue + else + begin + if not TcxCustomEditAccess(Edit).Focused and + Edit.ActiveProperties.IsValueEditorWithValueFormatting then + begin + if not IsDataAvailable or Field.IsNull then + TcxCustomEditAccess(Edit).FEditValue := Null + else + TcxCustomEditAccess(Edit).FEditValue := Field.Value; + Edit.LockClick(True); + try + SetInternalDisplayValue(StoredValue); + finally + Edit.LockClick(False); + end; + end + else + Edit.EditValue := StoredValue; + end; +end; + +procedure TcxDBEditDataBinding.DataSetChange; +begin + DefaultValuesChanged; +end; + +procedure TcxDBEditDataBinding.EditingChanged; +begin + TcxCustomEditAccess(Edit).EditingChanged; +end; + +function TcxDBEditDataBinding.IsLookupControl: Boolean; +begin + Result := False; +end; + +procedure TcxDBEditDataBinding.UpdateData; +begin + if IsDataAvailable then + begin + if Edit.ValidateEdit(True) then + StoredValue := Edit.EditValue; + end; +end; + +function TcxDBEditDataBinding.GetDataField: string; +begin + Result := FDataLink.FieldName; +end; + +function TcxDBEditDataBinding.GetDataSource: TDataSource; +begin + Result := FDataLink.DataSource; +end; + +function TcxDBEditDataBinding.GetDefaultValuesProvider: TcxCustomDBEditDefaultValuesProvider; +begin + Result := TcxCustomDBEditDefaultValuesProvider(IDefaultValuesProvider.GetInstance); +end; + +function TcxDBEditDataBinding.GetField: TField; +begin + Result := FDataLink.Field; +end; + +procedure TcxDBEditDataBinding.SetDataField(const Value: string); +begin + FDataLink.FieldName := Value; +end; + +procedure TcxDBEditDataBinding.SetDataSource(Value: TDataSource); +begin + if not (FDataLink.DataSourceFixed and Edit.IsLoading) then + begin + FDataLink.DataSource := Value; + DefaultValuesProvider.DataSource := Value; + end; +end; + +{ TcxDBTextEditDataBinding } + +procedure TcxDBTextEditDataBinding.UpdateNotConnectedDBEditDisplayValue; +begin + if not IsDataAvailable then + begin + Edit.LockClick(True); + try + DisplayValue := ''; + finally + Edit.LockClick(False); + end; + end; +end; + +procedure TcxDBTextEditDataBinding.SetDisplayValue(const Value: TcxEditValue); +begin + if IsDataAvailable then + SetInternalDisplayValue(Value) + else + if Edit.IsDesigning then + SetInternalDisplayValue(Edit.Name) + else + SetInternalDisplayValue(''); +end; + +{ TcxDBTextEdit } + +class function TcxDBTextEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxTextEditProperties; +end; + +class function TcxDBTextEdit.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBTextEditDataBinding; +end; + +function TcxDBTextEdit.GetActiveProperties: TcxTextEditProperties; +begin + Result := TcxTextEditProperties(InternalGetActiveProperties); +end; + +function TcxDBTextEdit.GetDataBinding: TcxDBTextEditDataBinding; +begin + Result := FDataBinding as TcxDBTextEditDataBinding; +end; + +function TcxDBTextEdit.GetProperties: TcxTextEditProperties; +begin + Result := TcxTextEditProperties(FProperties); +end; + +procedure TcxDBTextEdit.SetDataBinding(Value: TcxDBTextEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBTextEdit.SetProperties(Value: TcxTextEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBTextEdit.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxDBMemo } + +class function TcxDBMemo.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxMemoProperties; +end; + +class function TcxDBMemo.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBTextEditDataBinding; +end; + +function TcxDBMemo.GetActiveProperties: TcxMemoProperties; +begin + Result := TcxMemoProperties(InternalGetActiveProperties); +end; + +function TcxDBMemo.GetDataBinding: TcxDBTextEditDataBinding; +begin + Result := TcxDBTextEditDataBinding(FDataBinding); +end; + +function TcxDBMemo.GetProperties: TcxMemoProperties; +begin + Result := TcxMemoProperties(FProperties); +end; + +procedure TcxDBMemo.SetDataBinding(Value: TcxDBTextEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBMemo.SetProperties(Value: TcxMemoProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBMemo.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxDBMaskEdit } + +class function TcxDBMaskEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxMaskEditProperties; +end; + +class function TcxDBMaskEdit.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBTextEditDataBinding; +end; + +function TcxDBMaskEdit.GetActiveProperties: TcxMaskEditProperties; +begin + Result := TcxMaskEditProperties(InternalGetActiveProperties); +end; + +function TcxDBMaskEdit.GetDataBinding: TcxDBTextEditDataBinding; +begin + Result := FDataBinding as TcxDBTextEditDataBinding; +end; + +function TcxDBMaskEdit.GetProperties: TcxMaskEditProperties; +begin + Result := TcxMaskEditProperties(FProperties); +end; + +procedure TcxDBMaskEdit.SetDataBinding(Value: TcxDBTextEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBMaskEdit.SetProperties(Value: TcxMaskEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBMaskEdit.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxDBButtonEdit } + +class function TcxDBButtonEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxButtonEditProperties; +end; + +class function TcxDBButtonEdit.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBTextEditDataBinding; +end; + +function TcxDBButtonEdit.GetActiveProperties: TcxButtonEditProperties; +begin + Result := TcxButtonEditProperties(InternalGetActiveProperties); +end; + +function TcxDBButtonEdit.GetDataBinding: TcxDBTextEditDataBinding; +begin + Result := FDataBinding as TcxDBTextEditDataBinding; +end; + +function TcxDBButtonEdit.GetProperties: TcxButtonEditProperties; +begin + Result := TcxButtonEditProperties(FProperties); +end; + +procedure TcxDBButtonEdit.SetDataBinding(Value: TcxDBTextEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBButtonEdit.SetProperties(Value: TcxButtonEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBButtonEdit.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxDBCheckBox } + +class function TcxDBCheckBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCheckBoxProperties; +end; + +class function TcxDBCheckBox.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBEditDataBinding; +end; + +function TcxDBCheckBox.GetActiveProperties: TcxCheckBoxProperties; +begin + Result := TcxCheckBoxProperties(InternalGetActiveProperties); +end; + +function TcxDBCheckBox.GetDataBinding: TcxDBEditDataBinding; +begin + Result := TcxDBEditDataBinding(FDataBinding); +end; + +function TcxDBCheckBox.GetProperties: TcxCheckBoxProperties; +begin + Result := TcxCheckBoxProperties(FProperties); +end; + +procedure TcxDBCheckBox.SetDataBinding(Value: TcxDBEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBCheckBox.SetProperties(Value: TcxCheckBoxProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBCheckBox.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxDBComboBox } + +class function TcxDBComboBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxComboBoxProperties; +end; + +class function TcxDBComboBox.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBTextEditDataBinding; +end; + +function TcxDBComboBox.GetActiveProperties: TcxComboBoxProperties; +begin + Result := TcxComboBoxProperties(InternalGetActiveProperties); +end; + +function TcxDBComboBox.GetDataBinding: TcxDBTextEditDataBinding; +begin + Result := TcxDBTextEditDataBinding(FDataBinding); +end; + +function TcxDBComboBox.GetProperties: TcxComboBoxProperties; +begin + Result := TcxComboBoxProperties(FProperties); +end; + +procedure TcxDBComboBox.SetDataBinding(Value: TcxDBTextEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBComboBox.SetProperties(Value: TcxComboBoxProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBComboBox.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxDBPopupEdit } + +class function TcxDBPopupEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxPopupEditProperties; +end; + +class function TcxDBPopupEdit.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBTextEditDataBinding; +end; + +function TcxDBPopupEdit.GetActiveProperties: TcxPopupEditProperties; +begin + Result := TcxPopupEditProperties(InternalGetActiveProperties); +end; + +function TcxDBPopupEdit.GetDataBinding: TcxDBTextEditDataBinding; +begin + Result := TcxDBTextEditDataBinding(FDataBinding); +end; + +function TcxDBPopupEdit.GetProperties: TcxPopupEditProperties; +begin + Result := TcxPopupEditProperties(FProperties); +end; + +procedure TcxDBPopupEdit.SetDataBinding(Value: TcxDBTextEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBPopupEdit.SetProperties(Value: TcxPopupEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBPopupEdit.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxDBSpinEdit } + +class function TcxDBSpinEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxSpinEditProperties; +end; + +class function TcxDBSpinEdit.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBTextEditDataBinding; +end; + +function TcxDBSpinEdit.GetActiveProperties: TcxSpinEditProperties; +begin + Result := TcxSpinEditProperties(InternalGetActiveProperties); +end; + +function TcxDBSpinEdit.GetDataBinding: TcxDBTextEditDataBinding; +begin + Result := TcxDBTextEditDataBinding(FDataBinding); +end; + +function TcxDBSpinEdit.GetProperties: TcxSpinEditProperties; +begin + Result := TcxSpinEditProperties(FProperties); +end; + +procedure TcxDBSpinEdit.SetDataBinding(Value: TcxDBTextEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBSpinEdit.SetProperties(Value: TcxSpinEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBSpinEdit.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxDBTimeEdit } + +class function TcxDBTimeEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxTimeEditProperties; +end; + +class function TcxDBTimeEdit.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBTextEditDataBinding; +end; + +function TcxDBTimeEdit.GetActiveProperties: TcxTimeEditProperties; +begin + Result := TcxTimeEditProperties(InternalGetActiveProperties); +end; + +function TcxDBTimeEdit.GetDataBinding: TcxDBTextEditDataBinding; +begin + Result := TcxDBTextEditDataBinding(FDataBinding); +end; + +function TcxDBTimeEdit.GetProperties: TcxTimeEditProperties; +begin + Result := TcxTimeEditProperties(FProperties); +end; + +procedure TcxDBTimeEdit.SetDataBinding(Value: TcxDBTextEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBTimeEdit.SetProperties(Value: TcxTimeEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBTimeEdit.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxDBBlobEdit } + +class function TcxDBBlobEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxBlobEditProperties; +end; + +class function TcxDBBlobEdit.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBEditDataBinding; +end; + +function TcxDBBlobEdit.GetActiveProperties: TcxBlobEditProperties; +begin + Result := TcxBlobEditProperties(InternalGetActiveProperties); +end; + +function TcxDBBlobEdit.GetDataBinding: TcxDBEditDataBinding; +begin + Result := TcxDBEditDataBinding(FDataBinding); +end; + +function TcxDBBlobEdit.GetProperties: TcxBlobEditProperties; +begin + Result := TcxBlobEditProperties(FProperties); +end; + +procedure TcxDBBlobEdit.SetDataBinding(Value: TcxDBEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBBlobEdit.SetProperties(Value: TcxBlobEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBBlobEdit.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxDBCalcEdit } + +class function TcxDBCalcEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCalcEditProperties; +end; + +class function TcxDBCalcEdit.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBTextEditDataBinding; +end; + +function TcxDBCalcEdit.GetActiveProperties: TcxCalcEditProperties; +begin + Result := TcxCalcEditProperties(InternalGetActiveProperties); +end; + +function TcxDBCalcEdit.GetDataBinding: TcxDBTextEditDataBinding; +begin + Result := TcxDBTextEditDataBinding(FDataBinding); +end; + +function TcxDBCalcEdit.GetProperties: TcxCalcEditProperties; +begin + Result := TcxCalcEditProperties(FProperties); +end; + +procedure TcxDBCalcEdit.SetDataBinding(Value: TcxDBTextEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBCalcEdit.SetProperties(Value: TcxCalcEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBCalcEdit.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxDBDateEdit } + +class function TcxDBDateEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxDateEditProperties; +end; + +class function TcxDBDateEdit.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBTextEditDataBinding; +end; + +function TcxDBDateEdit.GetActiveProperties: TcxDateEditProperties; +begin + Result := TcxDateEditProperties(InternalGetActiveProperties); +end; + +function TcxDBDateEdit.GetDataBinding: TcxDBTextEditDataBinding; +begin + Result := TcxDBTextEditDataBinding(FDataBinding); +end; + +function TcxDBDateEdit.GetProperties: TcxDateEditProperties; +begin + Result := TcxDateEditProperties(FProperties); +end; + +procedure TcxDBDateEdit.SetDataBinding(Value: TcxDBTextEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBDateEdit.SetProperties(Value: TcxDateEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBDateEdit.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxDBCurrencyEdit } + +class function TcxDBCurrencyEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCurrencyEditProperties; +end; + +class function TcxDBCurrencyEdit.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBTextEditDataBinding; +end; + +function TcxDBCurrencyEdit.GetActiveProperties: TcxCurrencyEditProperties; +begin + Result := TcxCurrencyEditProperties(InternalGetActiveProperties); +end; + +function TcxDBCurrencyEdit.GetDataBinding: TcxDBTextEditDataBinding; +begin + Result := TcxDBTextEditDataBinding(FDataBinding); +end; + +function TcxDBCurrencyEdit.GetProperties: TcxCurrencyEditProperties; +begin + Result := TcxCurrencyEditProperties(FProperties); +end; + +procedure TcxDBCurrencyEdit.SetDataBinding(Value: TcxDBTextEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBCurrencyEdit.SetProperties(Value: TcxCurrencyEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBCurrencyEdit.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxDBHyperLinkEdit } + +class function TcxDBHyperLinkEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxHyperLinkEditProperties; +end; + +class function TcxDBHyperLinkEdit.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBTextEditDataBinding; +end; + +function TcxDBHyperLinkEdit.GetActiveProperties: TcxHyperLinkEditProperties; +begin + Result := TcxHyperLinkEditProperties(InternalGetActiveProperties); +end; + +function TcxDBHyperLinkEdit.GetDataBinding: TcxDBTextEditDataBinding; +begin + Result := TcxDBTextEditDataBinding(FDataBinding); +end; + +function TcxDBHyperLinkEdit.GetProperties: TcxHyperLinkEditProperties; +begin + Result := TcxHyperLinkEditProperties(FProperties); +end; + +procedure TcxDBHyperLinkEdit.SetDataBinding(Value: TcxDBTextEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBHyperLinkEdit.SetProperties(Value: TcxHyperLinkEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBHyperLinkEdit.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxDBImage } + +class function TcxDBImage.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxImageProperties; +end; + +class function TcxDBImage.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBEditDataBinding; +end; + +function TcxDBImage.GetActiveProperties: TcxImageProperties; +begin + Result := TcxImageProperties(InternalGetActiveProperties); +end; + +function TcxDBImage.GetDataBinding: TcxDBEditDataBinding; +begin + Result := TcxDBEditDataBinding(FDataBinding); +end; + +function TcxDBImage.GetProperties: TcxImageProperties; +begin + Result := TcxImageProperties(FProperties); +end; + +procedure TcxDBImage.SetDataBinding(Value: TcxDBEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBImage.SetProperties(Value: TcxImageProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBImage.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxDBImageComboBox } + +class function TcxDBImageComboBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxImageComboBoxProperties; +end; + +class function TcxDBImageComboBox.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBTextEditDataBinding; +end; + +function TcxDBImageComboBox.GetActiveProperties: TcxImageComboBoxProperties; +begin + Result := TcxImageComboBoxProperties(InternalGetActiveProperties); +end; + +function TcxDBImageComboBox.GetDataBinding: TcxDBTextEditDataBinding; +begin + Result := TcxDBTextEditDataBinding(FDataBinding); +end; + +function TcxDBImageComboBox.GetProperties: TcxImageComboBoxProperties; +begin + Result := TcxImageComboBoxProperties(FProperties); +end; + +procedure TcxDBImageComboBox.SetDataBinding(Value: TcxDBTextEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBImageComboBox.SetProperties(Value: TcxImageComboBoxProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBImageComboBox.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxDBMRUEdit } + +class function TcxDBMRUEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxMRUEditProperties; +end; + +class function TcxDBMRUEdit.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBTextEditDataBinding; +end; + +function TcxDBMRUEdit.GetActiveProperties: TcxMRUEditProperties; +begin + Result := TcxMRUEditProperties(InternalGetActiveProperties); +end; + +function TcxDBMRUEdit.GetDataBinding: TcxDBTextEditDataBinding; +begin + Result := TcxDBTextEditDataBinding(FDataBinding); +end; + +function TcxDBMRUEdit.GetProperties: TcxMRUEditProperties; +begin + Result := TcxMRUEditProperties(FProperties); +end; + +procedure TcxDBMRUEdit.SetDataBinding(Value: TcxDBTextEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBMRUEdit.SetProperties(Value: TcxMRUEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBMRUEdit.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxDBRadioGroupButton } + +constructor TcxDBRadioGroupButton.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := ControlStyle + [csReplicatable]; +end; + +procedure TcxDBRadioGroupButton.CMGetDataLink(var Message: TMessage); +begin + RadioGroup.Perform(Message.Msg, Message.WParam, Message.LParam); +end; + +{ TcxDBRadioGroup } + +class function TcxDBRadioGroup.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxRadioGroupProperties; +end; + +function TcxDBRadioGroup.GetButtonInstance: TWinControl; +begin + Result := TcxDBRadioGroupButton.Create(Self); +end; + +class function TcxDBRadioGroup.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBEditDataBinding; +end; + +function TcxDBRadioGroup.GetActiveProperties: TcxRadioGroupProperties; +begin + Result := TcxRadioGroupProperties(InternalGetActiveProperties); +end; + +function TcxDBRadioGroup.GetDataBinding: TcxDBEditDataBinding; +begin + Result := TcxDBEditDataBinding(FDataBinding); +end; + +function TcxDBRadioGroup.GetProperties: TcxRadioGroupProperties; +begin + Result := TcxRadioGroupProperties(FProperties); +end; + +procedure TcxDBRadioGroup.SetDataBinding(Value: TcxDBEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBRadioGroup.SetProperties(Value: TcxRadioGroupProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBRadioGroup.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxDBListBox } + +function TcxDBListBox.GetDataBindingClass: TcxCustomDataBindingClass; +begin + Result := TcxDBDataBinding; +end; + +function TcxDBListBox.GetDataBinding: TcxDBDataBinding; +begin + Result := TcxDBDataBinding(FDataBinding); +end; + +procedure TcxDBListBox.SetDataBinding(Value: TcxDBDataBinding); +begin + FDataBinding.Assign(Value); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxDBEditRepository.pas b/official/x.35/ExpressEditors Library 5/Sources/cxDBEditRepository.pas new file mode 100644 index 00000000..d23f15d0 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxDBEditRepository.pas @@ -0,0 +1,81 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDBEditRepository; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, ComCtrls, Classes, SysUtils, Graphics, Controls, StdCtrls, + Forms, cxEdit, cxDBLookupComboBox; + +type + { TcxEditRepositoryLookupComboBoxItem } + + TcxEditRepositoryLookupComboBoxItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxLookupComboBoxProperties; + procedure SetProperties(Value: TcxLookupComboBoxProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxLookupComboBoxProperties read GetProperties write SetProperties; + end; + +implementation + +{ TcxEditRepositoryLookupComboBoxItem } + +class function TcxEditRepositoryLookupComboBoxItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxLookupComboBoxProperties; +end; + +function TcxEditRepositoryLookupComboBoxItem.GetProperties: TcxLookupComboBoxProperties; +begin + Result := inherited Properties as TcxLookupComboBoxProperties; +end; + +procedure TcxEditRepositoryLookupComboBoxItem.SetProperties(Value: TcxLookupComboBoxProperties); +begin + inherited Properties := Value; +end; + +initialization + RegisterClasses([TcxEditRepositoryLookupComboBoxItem]); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxDBFilterControl.pas b/official/x.35/ExpressEditors Library 5/Sources/cxDBFilterControl.pas new file mode 100644 index 00000000..8db1f6f0 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxDBFilterControl.pas @@ -0,0 +1,953 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressFilterControl } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxDBFilterControl; + +{$I cxVer.inc} + +interface + +uses + Classes, Graphics, cxEdit, cxFilter, cxDataStorage, cxLookAndFeels, + cxFilterControl, cxFilterControlUtils, DB; + +type + TcxDBFilterControl = class; + + { TcxFilterItem } + + TcxFilterItem = class(TCollectionItem, IUnknown, IcxEditRepositoryItemListener) + private + FOwnerInterface: IUnknown; + FFilterControl: TcxDBFilterControl; + FCaption: string; + FFieldName: string; + FProperties: TcxCustomEditProperties; + FRepositoryItem: TcxEditRepositoryItem; + FPropertiesClass: TcxCustomEditPropertiesClass; + procedure DoPropertiesChanged(Sender: TObject); + function GetPropertiesClassName: string; + function IsCaptionStored: Boolean; + procedure RecreateProperties; + procedure SetCaption(const Value: string); + procedure SetFieldName(const Value: string); + procedure SetProperties(const Value: TcxCustomEditProperties); + procedure SetPropertiesClass(const Value: TcxCustomEditPropertiesClass); + procedure SetPropertiesClassName(const Value: string); + procedure SetRepositoryItem(const Value: TcxEditRepositoryItem); + protected + // IUnknown + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall; + // IcxEditRepositoryItemListener + procedure ItemRemoved(Sender: TcxEditRepositoryItem); + procedure PropertiesChanged(Sender: TcxEditRepositoryItem); + // overrided methods + function GetDisplayName: string; override; + procedure CreateProperties; virtual; + procedure DestroyProperties; virtual; + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure AfterConstruction; override; + function GetProperties: TcxCustomEditProperties; + + property FilterControl: TcxDBFilterControl read FFilterControl; + property PropertiesClass: TcxCustomEditPropertiesClass read FPropertiesClass write SetPropertiesClass; + published + property Caption: string read FCaption write SetCaption stored IsCaptionStored; + property FieldName: string read FFieldName write SetFieldName; + property PropertiesClassName: string read GetPropertiesClassName write SetPropertiesClassName; + property Properties: TcxCustomEditProperties read FProperties write SetProperties; + property RepositoryItem: TcxEditRepositoryItem read FRepositoryItem write SetRepositoryItem; + end; + + { TcxFilterPropertiesList } + + TcxFilterPropertiesList = class(TList) + public + procedure Clear; override; + function GetProperties(AClass: TcxCustomEditPropertiesClass): TcxCustomEditProperties; + end; + + { TcxFilterItemCollection } + + TcxFilterItemCollection = class(TOwnedCollection) + private + function GetControl: TcxDBFilterControl; + function GetItems(Index: Integer): TcxFilterItem; + procedure SetItems(Index: Integer; const Value: TcxFilterItem); + protected + procedure Update(Item: TCollectionItem); override; + public + property Control: TcxDBFilterControl read GetControl; + property Items[Index: Integer]: TcxFilterItem read GetItems write SetItems; default; + end; + + { TcxDBFilterOptions } + + TcxDBFilterOptions = class(TPersistent) + private + FFilterControl: TcxDBFilterControl; + FSupportedBetween: Boolean; + FSupportedIn: Boolean; + FSupportedLike: Boolean; + function GetDateTimeFormat: string; + function GetPercentWildcard: Char; + function GetSoftNull: Boolean; + function GetTranslateBetween: Boolean; + function GetTranslateIn: Boolean; + function GetTranslateLike: Boolean; + function GetUnderscoreWildcard: Char; + procedure SetDateTimeFormat(const Value: string); + procedure SetPercentWildcard(Value: Char); + procedure SetSoftNull(Value: Boolean); + procedure SetTranslateBetween(Value: Boolean); + procedure SetTranslateIn(Value: Boolean); + procedure SetTranslateLike(Value: Boolean); + procedure SetUnderscoreWildcard(Value: Char); + protected + function GetOwner: TPersistent; override; + public + constructor Create(AFilterControl: TcxDBFilterControl); virtual; + procedure Assign(Source: TPersistent); override; + procedure ProcessFilterOperators(var SupportedOperations: TcxFilterControlOperators); + published + property DateTimeFormat: string read GetDateTimeFormat write SetDateTimeFormat; + property PercentWildcard: Char read GetPercentWildcard write SetPercentWildcard default '%'; + property SoftNull: Boolean read GetSoftNull write SetSoftNull default False; + property SupportedBetween: Boolean read FSupportedBetween write FSupportedBetween default True; + property SupportedIn: Boolean read FSupportedIn write FSupportedIn default True; + property SupportedLike: Boolean read FSupportedLike write FSupportedLike default True; + property TranslateBetween: Boolean read GetTranslateBetween write SetTranslateBetween default False; + property TranslateIn: Boolean read GetTranslateIn write SetTranslateIn default False; + property TranslateLike: Boolean read GetTranslateLike write SetTranslateLike default False; + property UnderscoreWildcard: Char read GetUnderscoreWildcard write SetUnderscoreWildcard default '_'; + end; + + { TcxDBFilterControl } + + TcxDBFilterControl = class(TcxCustomFilterControl, IcxFilterControl, + IcxFilterControlDialog) + private + FApplyingFilter: Boolean; + FDataSource: TDataSource; + FDataSet: TDataSet; + FFieldNamePostfix: string; + FFieldNamePrefix: string; + FFieldsProperties: TcxFilterPropertiesList; + FFilterOptions: TcxDBFilterOptions; + FItems: TcxFilterItemCollection; + {$IFDEF CBUILDER6} + function GetDataSet: TDataSet; + function GetItems: TcxFilterItemCollection; + {$ENDIF} + function GetField(AIndex: Integer): TField; + function GetFilterOptions: TcxDBFilterOptions; + procedure DataSetStateChange(Sender: TObject); + procedure SetDataSet(const Value: TDataSet); + procedure SetFilterOptions(Value: TcxDBFilterOptions); + procedure SetItems(Value: TcxFilterItemCollection); + protected + // IcxFilterControl + function GetCaption(Index: Integer): string; + function GetCount: Integer; + function GetCriteria: TcxFilterCriteria; + function GetItemLink(Index: Integer): TObject; + function GetItemLinkID(Index: Integer): Integer; + function GetItemLinkName(Index: Integer): string; + function GetFieldName(Index: Integer): string; + function GetProperties(Index: Integer): TcxCustomEditProperties; + function GetValueType(Index: Integer): TcxValueTypeClass; + //IcxFilterControlDialog + procedure SetDialogLinkComponent(ALink: TComponent); + // overrided VCL + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + // overrided TcxCustomFilterControl + procedure CorrectOperatorClass(var AOperatorClass: TcxFilterOperatorClass); override; + procedure DoApplyFilter; override; + procedure ValidateConditions(var SupportedOperations: TcxFilterControlOperators); override; + function GetFilterLink: IcxFilterControl; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure BuildFromCriteria; override; + procedure Clear; override; + function GetFilterTextEx(const AFieldNamePrefix, AFieldNamePostfix: string): string; + function GetPropertiesClassFromFieldType(AFieldType: TFieldType): TcxCustomEditPropertiesClass; virtual; + + property Criteria; + property DataSource: TDataSource read FDataSource; + published + property Align; + property Anchors; + property Color; + {$IFDEF CBUILDER6} + property DataSet: TDataSet read GetDataSet write SetDataSet; + property Items: TcxFilterItemCollection read GetItems write SetItems; + {$ELSE} + property DataSet: TDataSet read FDataSet write SetDataSet; + property Items: TcxFilterItemCollection read FItems write SetItems; + {$ENDIF} + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property FilterOptions: TcxDBFilterOptions read GetFilterOptions write SetFilterOptions; + property Font; + property FontBoolOperator; + property FontCondition; + property FontItem; + property FontValue; + property HelpContext; + {$IFDEF DELPHI6} + property HelpKeyword; + property HelpType; + {$ENDIF} + property Hint; + property HotTrackOnUnfocused; + property LookAndFeel; + property NullString; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property ShowHint; + property ShowLevelLines; + property SortItems; + property TabOrder; + property TabStop; + property Visible; + property WantTabs; + property OnApplyFilter; + property OnClick; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +function ExecuteDBFilterControlDialog(ADataSet: TDataSet; + ALookAndFeel: TcxLookAndFeel; AOnApplyProc: TNotifyEvent = nil; + AOnShowDialog: TNotifyEvent = nil; AColor: TColor = clDefault; + const AInitialDir: string = ''): Boolean; + +implementation + +uses + SysUtils, cxDBFilter, cxDBData, cxCalc, cxCalendar, cxTextEdit, +{$IFNDEF DELPHI5} + cxClasses, +{$ENDIF} + cxSpinEdit, cxCheckBox, cxCurrencyEdit, cxTimeEdit, cxFilterControlDialog; + +function ExecuteDBFilterControlDialog(ADataSet: TDataSet; + ALookAndFeel: TcxLookAndFeel; AOnApplyProc: TNotifyEvent = nil; + AOnShowDialog: TNotifyEvent = nil; AColor: TColor = clDefault; + const AInitialDir: string = ''): Boolean; +begin + Result := cxInternalExecuteFilterControlDialog(TcxDBFilterControl, ADataSet, + ALookAndFeel, AOnApplyProc, AOnShowDialog, AColor, AInitialDir); +end; + +{ TcxFilterItem } + +constructor TcxFilterItem.Create(Collection: TCollection); +begin + inherited Create(Collection); + FFilterControl := TcxFilterItemCollection(Collection).Control; +end; + +destructor TcxFilterItem.Destroy; +begin + RepositoryItem := nil; + DestroyProperties; + inherited Destroy; +end; + +procedure TcxFilterItem.AfterConstruction; +begin + inherited; + if GetOwner <> nil then + GetOwner.GetInterface(IUnknown, FOwnerInterface); +end; + +function TcxFilterItem.GetProperties: TcxCustomEditProperties; +begin + if FRepositoryItem = nil then + Result := FProperties + else + Result := FRepositoryItem.Properties; +end; + +function TcxFilterItem._AddRef: Integer; +begin + if FOwnerInterface <> nil then + Result := FOwnerInterface._AddRef + else + Result := -1; +end; + +function TcxFilterItem._Release: Integer; +begin + if FOwnerInterface <> nil then + Result := FOwnerInterface._Release + else + Result := -1; +end; + +function TcxFilterItem.QueryInterface(const IID: TGUID; out Obj): HResult; +const + E_NOINTERFACE = HResult($80004002); +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +procedure TcxFilterItem.ItemRemoved(Sender: TcxEditRepositoryItem); +begin + RepositoryItem := nil; + PropertiesChanged(Sender); +end; + +procedure TcxFilterItem.PropertiesChanged(Sender: TcxEditRepositoryItem); +begin + with FilterControl do + if (ComponentState * [csLoading, csDestroying, csDesigning]) = [] then + RefreshProperties; +end; + +function TcxFilterItem.GetDisplayName: string; +begin + if FCaption <> '' then + Result := FCaption + else + if FieldName <> '' then + Result := FieldName + else + if GetProperties <> nil then + Result := GetProperties.ClassName + else + Result := ClassName +end; + +procedure TcxFilterItem.CreateProperties; +begin + if FPropertiesClass <> nil then + begin + FProperties := FPropertiesClass.Create(Self); + FProperties.OnPropertiesChanged := DoPropertiesChanged; + end; +end; + +procedure TcxFilterItem.DestroyProperties; +begin + FreeAndNil(FProperties); +end; + +procedure TcxFilterItem.DoPropertiesChanged(Sender: TObject); +begin + PropertiesChanged(nil); +end; + +function TcxFilterItem.GetPropertiesClassName: string; +begin + if FProperties = nil then + Result := '' + else + Result := FProperties.ClassName; +end; + +function TcxFilterItem.IsCaptionStored: Boolean; +begin + Result := (FCaption <> '') and (FCaption <> FFieldName); +end; + +procedure TcxFilterItem.RecreateProperties; +begin + DestroyProperties; + CreateProperties; +end; + +procedure TcxFilterItem.SetCaption(const Value: string); +begin + if FCaption <> Value then + begin + FCaption := Value; + Changed(False); + end; +end; + +procedure TcxFilterItem.SetFieldName(const Value: string); +begin + if FFieldName <> Value then + begin + if FFieldName = FCaption then + FCaption := Value; + FFieldName := Value; + Changed(False); + end; +end; + +procedure TcxFilterItem.SetProperties(const Value: TcxCustomEditProperties); +begin + if (Value <> nil) and (esoFiltering in Value.GetSupportedOperations) then + FProperties.Assign(Value); +end; + +procedure TcxFilterItem.SetPropertiesClass( + const Value: TcxCustomEditPropertiesClass); +begin + if (FPropertiesClass <> Value) and ((Value = nil) or IsSupportFiltering(Value)) then + begin + FPropertiesClass := Value; + RecreateProperties; + PropertiesChanged(nil); + end; +end; + +procedure TcxFilterItem.SetPropertiesClassName(const Value: string); +var + APropertiesClass: TcxCustomEditPropertiesClass; +begin + APropertiesClass := + TcxCustomEditPropertiesClass(GetRegisteredEditProperties.FindByClassName(Value)); + if (APropertiesClass = nil) or IsSupportFiltering(APropertiesClass) then + PropertiesClass := APropertiesClass; +end; + +procedure TcxFilterItem.SetRepositoryItem( + const Value: TcxEditRepositoryItem); +begin + if FRepositoryItem <> Value then + begin + if (Value <> nil) and + not (esoFiltering in Value.Properties.GetSupportedOperations) then Exit; + if FRepositoryItem <> nil then + FRepositoryItem.RemoveListener(Self); + FRepositoryItem := Value; + if FRepositoryItem <> nil then + FRepositoryItem.AddListener(Self); + PropertiesChanged(nil); + end; +end; + +{ TcxFilterItemCollection } + +procedure TcxFilterItemCollection.Update(Item: TCollectionItem); +begin + if (UpdateCount = 0) and (Control.ComponentState * [csDestroying, csLoading] = []) then + Control.LayoutChanged; +end; + +function TcxFilterItemCollection.GetControl: TcxDBFilterControl; +begin + if GetOwner is TcxDBFilterControl then + Result := TcxDBFilterControl(GetOwner) + else + Result := nil; +end; + +function TcxFilterItemCollection.GetItems(Index: Integer): TcxFilterItem; +begin + Result := TcxFilterItem(inherited Items[Index]) +end; + +procedure TcxFilterItemCollection.SetItems(Index: Integer; + const Value: TcxFilterItem); +begin + inherited Items[Index] := Value; +end; + +{ TcxFilterPropertiesList } + +procedure TcxFilterPropertiesList.Clear; +var + I: Integer; +begin + for I := 0 to Count - 1 do + TcxCustomEditProperties(Items[I]).Free; + inherited Clear; +end; + +function TcxFilterPropertiesList.GetProperties( + AClass: TcxCustomEditPropertiesClass): TcxCustomEditProperties; +var + I: Integer; +begin + Result := nil; + if AClass = nil then Exit; + for I := 0 to Count - 1 do + if TcxCustomEditProperties(Items[I]).ClassType = AClass then + begin + Result := TcxCustomEditProperties(Items[I]); + break + end; + if Result = nil then + begin + Result := AClass.Create(nil); + Add(Result); + end; +end; + +{ TcxDBFilterOptions } + +constructor TcxDBFilterOptions.Create(AFilterControl: TcxDBFilterControl); +begin + FFilterControl := AFilterControl; + FSupportedBetween := True; + FSupportedIn := True; + FSupportedLike := True; +end; + +procedure TcxDBFilterOptions.Assign(Source: TPersistent); +begin + if Source is TcxDBFilterOptions then + with TcxDBFilterOptions(Source) do + begin + Self.DateTimeFormat := DateTimeFormat; + Self.PercentWildcard := PercentWildcard; + Self.SoftNull := SoftNull; + Self.SupportedBetween := SupportedBetween; + Self.SupportedIn := SupportedIn; + Self.SupportedLike := SupportedLike; + Self.TranslateBetween := TranslateBetween; + Self.TranslateIn := TranslateIn; + Self.TranslateLike := TranslateLike; + Self.UnderscoreWildcard := UnderscoreWildcard; + end; +end; + +procedure TcxDBFilterOptions.ProcessFilterOperators( + var SupportedOperations: TcxFilterControlOperators); +begin + if not SupportedBetween then + SupportedOperations := SupportedOperations - [fcoBetween, fcoNotBetween]; + if not SupportedIn then + SupportedOperations := SupportedOperations - [fcoInList, fcoNotInList]; + if not SupportedLike then + SupportedOperations := SupportedOperations - [fcoLike, fcoNotLike]; +end; + +function TcxDBFilterOptions.GetOwner: TPersistent; +begin + Result := FFilterControl; +end; + +function TcxDBFilterOptions.GetDateTimeFormat: string; +begin + Result := FFilterControl.Criteria.DateTimeFormat; +end; + +function TcxDBFilterOptions.GetPercentWildcard: Char; +begin + Result := FFilterControl.Criteria.PercentWildcard; +end; + +function TcxDBFilterOptions.GetSoftNull: Boolean; +begin + Result := fcoSoftNull in FFilterControl.Criteria.Options; +end; + +function TcxDBFilterOptions.GetTranslateBetween: Boolean; +begin + Result := FFilterControl.Criteria.TranslateBetween; +end; + +function TcxDBFilterOptions.GetTranslateIn: Boolean; +begin + Result := FFilterControl.Criteria.TranslateIn; +end; + +function TcxDBFilterOptions.GetTranslateLike: Boolean; +begin + Result := FFilterControl.Criteria.TranslateLike; +end; + +function TcxDBFilterOptions.GetUnderscoreWildcard: Char; +begin + Result := FFilterControl.Criteria.UnderscoreWildcard; +end; + +procedure TcxDBFilterOptions.SetDateTimeFormat(const Value: string); +begin + FFilterControl.Criteria.DateTimeFormat := Value; +end; + +procedure TcxDBFilterOptions.SetPercentWildcard(Value: Char); +begin + FFilterControl.Criteria.PercentWildcard := Value; +end; + +procedure TcxDBFilterOptions.SetSoftNull(Value: Boolean); +begin + with FFilterControl.Criteria do + if Value then + Options := Options + [fcoSoftNull] + else + Options := Options - [fcoSoftNull]; +end; + +procedure TcxDBFilterOptions.SetTranslateBetween(Value: Boolean); +begin + FFilterControl.Criteria.TranslateBetween := Value; +end; + +procedure TcxDBFilterOptions.SetTranslateIn(Value: Boolean); +begin + FFilterControl.Criteria.TranslateIn := Value; +end; + +procedure TcxDBFilterOptions.SetTranslateLike(Value: Boolean); +begin + FFilterControl.Criteria.TranslateLike := Value; +end; + +procedure TcxDBFilterOptions.SetUnderscoreWildcard(Value: Char); +begin + FFilterControl.Criteria.UnderscoreWildcard := Value; +end; + +{ TcxDBFilterControl } + +constructor TcxDBFilterControl.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FFilterOptions := TcxDBFilterOptions.Create(Self); + FItems := TcxFilterItemCollection.Create(Self, TcxFilterItem); + FDataSource := TDataSource.Create(Self); + FDataSource.OnStateChange := DataSetStateChange; + FFieldsProperties := TcxFilterPropertiesList.Create; +end; + +destructor TcxDBFilterControl.Destroy; +begin + FreeAndNil(FDataSource); + FreeAndNil(FItems); + FreeAndNil(FFieldsProperties); + FreeAndNil(FFilterOptions); + inherited Destroy; +end; + +procedure TcxDBFilterControl.BuildFromCriteria; +begin + inherited; +end; + +procedure TcxDBFilterControl.Clear; +begin + inherited Clear; + FFieldsProperties.Clear; +end; + +function TcxDBFilterControl.GetFilterTextEx( + const AFieldNamePrefix, AFieldNamePostfix: string): string; +begin + FFieldNamePrefix := AFieldNamePrefix; + FFieldNamePostfix := AFieldNamePostfix; + try + Result := GetFilterText; + finally + FFieldNamePrefix := ''; + FFieldNamePostfix := ''; + end; +end; + +function TcxDBFilterControl.GetPropertiesClassFromFieldType( + AFieldType: TFieldType): TcxCustomEditPropertiesClass; +begin + case AFieldType of + ftString, ftWideString: + Result := TcxTextEditProperties; + ftSmallint, ftInteger, ftWord, ftAutoInc {$IFDEF DELPHI6}, ftLargeint {$ENDIF}: + Result := TcxSpinEditProperties; + ftBoolean: + Result := TcxCheckBoxProperties; + ftFloat: + Result := TcxCalcEditProperties; + ftCurrency, ftBCD: + Result := TcxCurrencyEditProperties; + ftDate, ftDateTime {$IFDEF DELPHI6}, ftTimeStamp {$ENDIF}: + Result := TcxDateEditProperties; + ftTime: + Result := TcxTimeEditProperties; + else + Result := nil; + end; +end; + +function TcxDBFilterControl.GetCaption(Index: Integer): string; +begin + if (Index > -1) and (Index < GetCount) then + if FItems.Count > 0 then + Result := FItems[Index].Caption + else + Result := GetField(Index).DisplayName + else + Result := ''; +end; + +function TcxDBFilterControl.GetCount: Integer; +var + I: Integer; +begin + if (FItems <> nil) and (FItems.Count > 0) then + Result := FItems.Count + else + if (FDataSet <> nil) and not (FDataSet.DefaultFields and (FDataSource.State = dsInactive)) then + begin + Result := 0; + with FDataSet do + for I := 0 to Fields.Count - 1 do + if Fields[I].Visible then Inc(Result); + end + else + Result := 0; +end; + +function TcxDBFilterControl.GetCriteria: TcxFilterCriteria; +begin + Result := inherited Criteria; +end; + +function TcxDBFilterControl.GetItemLink(Index: Integer): TObject; +begin + if (Index > -1) and (Index < GetCount) then + if FItems.Count > 0 then + Result := FItems[Index] + else + Result := GetField(Index) + else + Result := nil; +end; + +function TcxDBFilterControl.GetItemLinkID(Index: Integer): Integer; +begin + Result := Index; +end; + +function TcxDBFilterControl.GetItemLinkName(Index: Integer): string; +begin + Result := GetFieldName(Index); +end; + +function TcxDBFilterControl.GetFieldName(Index: Integer): string; +var + AField: TField; +begin + if (Index > -1) and (Index < GetCount) then + if FItems.Count > 0 then + Result := FItems[Index].FieldName + else + begin + AField := GetField(Index); + if AField.Origin <> '' then + Result := FFieldNamePrefix + AField.Origin + FFieldNamePostfix + else + Result := FFieldNamePrefix + AField.FieldName + FFieldNamePostfix; + end + else + Result := ''; +end; + +function TcxDBFilterControl.GetProperties(Index: Integer): TcxCustomEditProperties; +begin + if (Index > -1) and (Index < GetCount) then + if FItems.Count > 0 then + Result := FItems[Index].GetProperties + else + Result := FFieldsProperties.GetProperties( + GetPropertiesClassFromFieldType(GetField(Index).DataType)) + else + Result := nil; + if Result = nil then Result := GetDefaultProperties; +end; + +function TcxDBFilterControl.GetValueType(Index: Integer): TcxValueTypeClass; + + function TrimFieldName(const AFieldName: string): string; + begin + Result := AFieldName; + while (Length(Result) > 0) and + (AnsiChar(Result[1]) in [#0..' ', '"', '''', '[']) do + Delete(Result, 1, 1); + while (Length(Result) > 0) and + (AnsiChar(Result[Length(Result)]) in [#0..' ', '"', '''', ']']) do + Delete(Result, Length(Result), 1); + end; + +var + AField: TField; +begin + if (Index > -1) and (Index < GetCount) then + if FItems.Count > 0 then + begin + if (FDataSet <> nil) then + AField := FDataSet.FindField(TrimFieldName(FItems[Index].FieldName)) + else + AField := nil; + Result := GetValueTypeClassByField(AField); + end + else + Result := GetValueTypeClassByField(GetField(Index)) + else + Result := nil; +end; + +procedure TcxDBFilterControl.SetFilterOptions(Value: TcxDBFilterOptions); +begin + FFilterOptions.Assign(Value); +end; + +procedure TcxDBFilterControl.SetItems(Value: TcxFilterItemCollection); +begin + FItems.Assign(Value); +end; + +procedure TcxDBFilterControl.SetDialogLinkComponent(ALink: TComponent); +begin + if ALink = nil then + DataSet := nil + else + if ALink is TDataSet then DataSet := TDataSet(ALink); +end; + +procedure TcxDBFilterControl.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (AComponent = FDataSet) then + DataSet := nil; +end; + +procedure TcxDBFilterControl.CorrectOperatorClass( + var AOperatorClass: TcxFilterOperatorClass); +var + AOperatorAdapter: TcxDBFilterOperatorAdapter; +begin + AOperatorAdapter := cxGetFilterOperatorAdapter(FDataSet); + if Assigned(AOperatorAdapter) then + AOperatorAdapter.PrepareOperatorClass(nil, FDataSet, AOperatorClass); +end; + +procedure TcxDBFilterControl.DoApplyFilter; +begin + FApplyingFilter := True; + try + inherited DoApplyFilter; + finally + FApplyingFilter := False; + end; +end; + +procedure TcxDBFilterControl.ValidateConditions( + var SupportedOperations: TcxFilterControlOperators); +begin + FilterOptions.ProcessFilterOperators(SupportedOperations); +end; + +function TcxDBFilterControl.GetFilterLink: IcxFilterControl; +begin + QueryInterface(IcxFilterControl, Result); +end; + +{$IFDEF CBUILDER6} +function TcxDBFilterControl.GetDataSet: TDataSet; +begin + Result := FDataSet; +end; + +function TcxDBFilterControl.GetItems: TcxFilterItemCollection; +begin + Result := FItems; +end; +{$ENDIF} + +function TcxDBFilterControl.GetField(AIndex: Integer): TField; +var + I, ATest: Integer; +begin + ATest := 0; + Result := nil; + with FDataSet do + for I := 0 to Fields.Count - 1 do + if Fields[I].Visible then + begin + if ATest = AIndex then + begin + Result := Fields[I]; + Exit; + end; + Inc(ATest); + end; +end; + +function TcxDBFilterControl.GetFilterOptions: TcxDBFilterOptions; +begin + Result := FFilterOptions; +end; + +procedure TcxDBFilterControl.DataSetStateChange(Sender: TObject); +begin + if not FApplyingFilter and (FDataSource.State in [dsInactive, dsBrowse]) then + LayoutChanged; +end; + +procedure TcxDBFilterControl.SetDataSet(const Value: TDataSet); +begin + if FDataSet <> Value then + begin + FDataSet := Value; + FDataSource.DataSet := Value; + Clear; + if Value <> nil then Value.FreeNotification(Self); + end; +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxDBFontNameComboBox.pas b/official/x.35/ExpressEditors Library 5/Sources/cxDBFontNameComboBox.pas new file mode 100644 index 00000000..174fa833 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxDBFontNameComboBox.pas @@ -0,0 +1,160 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDBFontNameComboBox; + +interface + +{$I cxVer.inc} + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Classes, Controls, Dialogs, Forms, Graphics, Messages, StdCtrls, + SysUtils, cxControls, cxDBEdit, cxEdit, cxFontNameComboBox; + +type + { TcxDBFontNameComboBox } + + TcxDBFontNameComboBox = class(TcxCustomFontNameComboBox) + private + function GetActiveProperties: TcxFontNameComboBoxProperties; + function GetDataBinding: TcxDBTextEditDataBinding; + function GetProperties: TcxFontNameComboBoxProperties; + procedure SetDataBinding(Value: TcxDBTextEditDataBinding); + procedure SetProperties(Value: TcxFontNameComboBoxProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxFontNameComboBoxProperties + read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DataBinding: TcxDBTextEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxFontNameComboBoxProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +{ TcxDBFontNameComboBox } + +class function TcxDBFontNameComboBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxFontNameComboBoxProperties; +end; + +class function TcxDBFontNameComboBox.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBTextEditDataBinding; +end; + +function TcxDBFontNameComboBox.GetActiveProperties: TcxFontNameComboBoxProperties; +begin + Result := TcxFontNameComboBoxProperties(InternalGetActiveProperties); +end; + +function TcxDBFontNameComboBox.GetDataBinding: TcxDBTextEditDataBinding; +begin + Result := TcxDBTextEditDataBinding(FDataBinding); +end; + +function TcxDBFontNameComboBox.GetProperties: TcxFontNameComboBoxProperties; +begin + Result := TcxFontNameComboBoxProperties(FProperties); +end; + +procedure TcxDBFontNameComboBox.SetDataBinding(Value: TcxDBTextEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBFontNameComboBox.SetProperties( + Value: TcxFontNameComboBoxProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBFontNameComboBox.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxDBLabel.pas b/official/x.35/ExpressEditors Library 5/Sources/cxDBLabel.pas new file mode 100644 index 00000000..1726b375 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxDBLabel.pas @@ -0,0 +1,180 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDBLabel; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Classes, Controls, DB, Dialogs, Forms, Graphics, Messages, StdCtrls, + SysUtils, cxControls, cxDBEdit, cxEdit, cxLabel; + +type + { TcxDBLabel } + + TcxDBLabel = class(TcxCustomLabel) + private + function GetActiveProperties: TcxLabelProperties; + function GetDataBinding: TcxDBTextEditDataBinding; + function GetProperties: TcxLabelProperties; + procedure SetDataBinding(Value: TcxDBTextEditDataBinding); + procedure SetProperties(Value: TcxLabelProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + procedure Initialize; override; + procedure SetEditAutoSize(Value: Boolean); override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxLabelProperties read GetActiveProperties; + published + property Align; + property Anchors; + property AutoSize default False; + property Constraints; + property DataBinding: TcxDBTextEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxLabelProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Transparent; + property Visible; + property OnClick; + property OnContextPopup; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +uses +{$IFDEF DELPHI6} + VDBConsts; +{$ELSE} + DBConsts; +{$ENDIF} + +{ TcxDBLabel } + +class function TcxDBLabel.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxLabelProperties; +end; + +class function TcxDBLabel.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBTextEditDataBinding; +end; + +procedure TcxDBLabel.Initialize; +begin + inherited Initialize; + AutoSize := False; +end; + +procedure TcxDBLabel.SetEditAutoSize(Value: Boolean); +begin + if Value and Assigned(DataBinding) and Assigned(DataBinding.DataLink) and + DataBinding.DataLink.DataSourceFixed then + DatabaseError(SDataSourceFixed); + inherited SetEditAutoSize(Value); +end; + +function TcxDBLabel.GetActiveProperties: TcxLabelProperties; +begin + Result := TcxLabelProperties(InternalGetActiveProperties); +end; + +function TcxDBLabel.GetDataBinding: TcxDBTextEditDataBinding; +begin + Result := TcxDBTextEditDataBinding(FDataBinding); +end; + +function TcxDBLabel.GetProperties: TcxLabelProperties; +begin + Result := TcxLabelProperties(FProperties); +end; + +procedure TcxDBLabel.SetDataBinding(Value: TcxDBTextEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBLabel.SetProperties(Value: TcxLabelProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBLabel.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxDBLookupComboBox.pas b/official/x.35/ExpressEditors Library 5/Sources/cxDBLookupComboBox.pas new file mode 100644 index 00000000..35fea086 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxDBLookupComboBox.pas @@ -0,0 +1,653 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDBLookupComboBox; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Messages, SysUtils, Classes, Controls, Graphics, DB, DBCtrls, + cxClasses, cxContainer, cxCustomData, cxDataStorage, cxDB, cxDBData, + cxLookAndFeels, cxEdit, cxDBEdit, cxEditConsts, cxDropDownEdit, + cxLookupEdit, cxDBLookupEdit, cxLookupGrid, cxLookupDBGrid, + cxFilterControlUtils; + +type + { TcxLookupComboBoxProperties } + + TcxLookupComboBoxProperties = class(TcxCustomDBLookupEditProperties) + private + FGrid: TcxCustomLookupDBGrid; + function GetGrid: TcxCustomLookupDBGrid; + function GetGridMode: Boolean; + function GetListColumns: TcxLookupDBGridColumns; + function GetListOptions: TcxLookupDBGridOptions; + function GetListSource: TDataSource; + function GetOnSortingChanged: TNotifyEvent; + procedure SetGridMode(Value: Boolean); + procedure SetListColumns(Value: TcxLookupDBGridColumns); + procedure SetListOptions(Value: TcxLookupDBGridOptions); + procedure SetListSource(Value: TDataSource); + procedure SetOnSortingChanged(Value: TNotifyEvent); + protected + function GetLookupGridClass: TcxCustomLookupDBGridClass; virtual; + procedure ListOptionsChanged(Sender: TObject); virtual; + // LookupGrid methods + function GetLookupGridColumnCount: Integer; override; + function GetLookupGridControl: TWinControl; override; + function GetLookupGridDataController: TcxCustomDataController; override; + function GetLookupGridVisualAreaPreferredWidth: Integer; override; + function GetLookupGridNearestPopupHeight(AHeight: Integer): Integer; override; + function GetLookupGridPopupHeight(ADropDownRowCount: Integer): Integer; override; + function IsLookupGridMouseOverList(const P: TPoint): Boolean; override; + procedure LookupGridInitEvents(AOnClick, AOnFocusedRowChanged: TNotifyEvent; + AOnCloseUp: cxLookupEdit.TcxLookupGridCloseUpEvent); override; + procedure LookupGridInitLookAndFeel(ALookAndFeel: TcxLookAndFeel; AColor: TColor; AFont: TFont); override; + procedure LookupGridLockMouseMove; override; + procedure LookupGridMakeFocusedRowVisible; override; + procedure LookupGridUnlockMouseMove; override; + // DBLookupGrid methods + procedure DBLookupGridBeginUpdate; override; + procedure DBLookupGridCheckColumnByFieldName(const AFieldName: string); override; + procedure DBLookupGridCreateColumnsByFieldNames(const AFieldNames: string); override; + procedure DBLookupGridEndUpdate; override; + function GetDBLookupGridColumnField(AIndex: Integer): TField; override; + function GetDBLookupGridColumnFieldName(AIndex: Integer): string; override; + function GetDBLookupGridColumnIndexByFieldName(const AFieldName: string): Integer; override; + function GetDBLookupGridDataController: TcxDBDataController; override; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + class function GetContainerClass: TcxContainerClass; override; + property Grid: TcxCustomLookupDBGrid read GetGrid; + published + property Alignment; + property AutoSelect; + property AssignedValues; + property ButtonGlyph; + property CaseSensitiveSearch; + property CharCase; + property ClearKey; + property DropDownAutoSize; + property DropDownHeight; + property DropDownListStyle; + property DropDownRows; + property DropDownSizeable; + property DropDownWidth; + property GridMode: Boolean read GetGridMode write SetGridMode default False; + property HideSelection; + property ImeMode; + property ImeName; + property ImmediateDropDown; + property ImmediatePost; + property IncrementalFiltering; + property KeyFieldNames; + property ListColumns: TcxLookupDBGridColumns read GetListColumns write SetListColumns; + property ListFieldNames; + property ListFieldIndex; + property ListOptions: TcxLookupDBGridOptions read GetListOptions write SetListOptions; + property ListSource: TDataSource read GetListSource write SetListSource; + property MaxLength; + property OEMConvert; + property PopupAlignment; + property PostPopupValueOnTab; + property ReadOnly; + property Revertable; + property UseLeftAlignmentOnEditing; + property ValidateOnEnter; + property OnChange; + property OnCloseUp; + property OnEditValueChanged; + property OnInitPopup; + property OnNewLookupDisplayText; + property OnPopup; + property OnSortingChanged: TNotifyEvent read GetOnSortingChanged write SetOnSortingChanged; + property OnValidate; + end; + + { TcxCustomLookupComboBox } + + TcxCustomLookupComboBox = class(TcxCustomDBLookupEdit) + private + function GetProperties: TcxLookupComboBoxProperties; + function GetActiveProperties: TcxLookupComboBoxProperties; + procedure SetProperties(Value: TcxLookupComboBoxProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxLookupComboBoxProperties + read GetActiveProperties; + property EditValue; + property Properties: TcxLookupComboBoxProperties read GetProperties + write SetProperties; + property Text; + end; + + { TcxLookupComboBox } + + TcxLookupComboBox = class(TcxCustomLookupComboBox) + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties; + property EditValue; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnEditing; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + end; + + { TcxDBLookupComboBox } + + TcxDBLookupComboBox = class(TcxCustomLookupComboBox) + private + function GetDataBinding: TcxDBTextEditDataBinding; + procedure SetDataBinding(Value: TcxDBTextEditDataBinding); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DragCursor; + property DragKind; + property DataBinding: TcxDBTextEditDataBinding read GetDataBinding + write SetDataBinding; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnEditing; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + end; + + { TcxFilterLookupComboBoxHelper } + + TcxFilterLookupComboBoxHelper = class(TcxFilterComboBoxHelper) + protected + class function IsIDefaultValuesProviderNeeded( + AEditProperties: TcxCustomEditProperties): Boolean; override; + public + class function GetFilterEditClass: TcxCustomEditClass; override; + class procedure GetFilterValue(AEdit: TcxCustomEdit; AEditProperties: TcxCustomEditProperties; + var V: Variant; var S: TCaption); override; + class function GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; override; + class procedure InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); override; + class function IsValueValid(AValueTypeClass: TcxValueTypeClass; + var Value: Variant): Boolean; override; + end; + +implementation + +uses +{$IFDEF DELPHI6} + VDBConsts, +{$ENDIF} + DBConsts, cxTextEdit; + +type + TControlAccess = class(TControl); + +{ TcxLookupComboBoxProperties } + +constructor TcxLookupComboBoxProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FGrid := GetLookupGridClass.Create(nil); + FGrid.IsPopupControl := True; + FGrid.Options.OnChanged := ListOptionsChanged; + InitializeDataController; +end; + +destructor TcxLookupComboBoxProperties.Destroy; +begin + DeinitializeDataController; + FGrid.Free; + FGrid := nil; + inherited Destroy; +end; + +procedure TcxLookupComboBoxProperties.Assign(Source: TPersistent); +begin + if Source is TcxLookupComboBoxProperties then + begin + BeginUpdate; + try + GridMode := TcxLookupComboBoxProperties(Source).GridMode; + ListOptions := TcxLookupComboBoxProperties(Source).ListOptions; + if not IsDefinedByLookup then + begin + ListSource := TcxLookupComboBoxProperties(Source).ListSource; + ListColumns := TcxLookupComboBoxProperties(Source).ListColumns; + end; + OnSortingChanged := TcxLookupComboBoxProperties(Source).OnSortingChanged; + inherited Assign(Source); + if IsDefinedByLookup then + ListColumns := TcxLookupComboBoxProperties(Source).ListColumns; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +class function TcxLookupComboBoxProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxLookupComboBox; +end; + +function TcxLookupComboBoxProperties.GetLookupGridClass: TcxCustomLookupDBGridClass; +begin + Result := TcxCustomLookupDBGrid; +end; + +procedure TcxLookupComboBoxProperties.ListOptionsChanged(Sender: TObject); +begin + Changed; +end; + +// LookupGrid + +function TcxLookupComboBoxProperties.GetLookupGridColumnCount: Integer; +begin + Result := ListColumns.Count; +end; + +function TcxLookupComboBoxProperties.GetLookupGridControl: TWinControl; +begin + Result := Grid; +end; + +function TcxLookupComboBoxProperties.GetLookupGridDataController: TcxCustomDataController; +begin + Result := Grid.DataController; +end; + +function TcxLookupComboBoxProperties.GetLookupGridVisualAreaPreferredWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to ListColumns.Count - 1 do + Inc(Result, ListColumns[I].Width); +end; + +function TcxLookupComboBoxProperties.GetLookupGridNearestPopupHeight( + AHeight: Integer): Integer; +begin + Result := Grid.GetNearestPopupHeight(AHeight); +end; + +function TcxLookupComboBoxProperties.GetLookupGridPopupHeight(ADropDownRowCount: Integer): Integer; +begin + Result := Grid.GetPopupHeight(ADropDownRowCount); +end; + +function TcxLookupComboBoxProperties.IsLookupGridMouseOverList(const P: TPoint): Boolean; +begin + Result := Grid.IsMouseOverList(P); +end; + +procedure TcxLookupComboBoxProperties.LookupGridInitEvents(AOnClick, AOnFocusedRowChanged: TNotifyEvent; + AOnCloseUp: cxLookupEdit.TcxLookupGridCloseUpEvent); +begin + Grid.OnClick := AOnClick; + Grid.OnFocusedRowChanged := AOnFocusedRowChanged; + Grid.OnCloseUp := AOnCloseUp; +end; + +procedure TcxLookupComboBoxProperties.LookupGridInitLookAndFeel(ALookAndFeel: TcxLookAndFeel; + AColor: TColor; AFont: TFont); +begin + Grid.LookAndFeel.MasterLookAndFeel := ALookAndFeel; + Grid.Color := AColor; + Grid.Font := AFont; +end; + +procedure TcxLookupComboBoxProperties.LookupGridLockMouseMove; +begin + Grid.LockPopupMouseMove; +end; + +procedure TcxLookupComboBoxProperties.LookupGridMakeFocusedRowVisible; +begin + Grid.MakeFocusedRowVisible; +end; + +procedure TcxLookupComboBoxProperties.LookupGridUnlockMouseMove; +begin + TControlAccess(Grid).MouseCapture := False; +end; + +// DBLookupGrid + +procedure TcxLookupComboBoxProperties.DBLookupGridBeginUpdate; +begin + Grid.BeginUpdate; +end; + +procedure TcxLookupComboBoxProperties.DBLookupGridCheckColumnByFieldName(const AFieldName: string); +begin + if (AFieldName <> '') and (ListColumns.ColumnByFieldName(AFieldName) = nil) then + with ListColumns.Add do + begin + FieldName := AFieldName; + Index := 0; + end; +end; + +procedure TcxLookupComboBoxProperties.DBLookupGridCreateColumnsByFieldNames(const AFieldNames: string); +begin + Grid.CreateColumnsByFieldNames(AFieldNames); +end; + +procedure TcxLookupComboBoxProperties.DBLookupGridEndUpdate; +begin + Grid.EndUpdate; +end; + +function TcxLookupComboBoxProperties.GetDBLookupGridColumnField(AIndex: Integer): TField; +begin + Result := ListColumns[AIndex].Field; +end; + +function TcxLookupComboBoxProperties.GetDBLookupGridColumnFieldName(AIndex: Integer): string; +begin + Result := ListColumns[AIndex].FieldName; +end; + +function TcxLookupComboBoxProperties.GetDBLookupGridColumnIndexByFieldName(const AFieldName: string): Integer; +var + AColumn: TcxLookupDBGridColumn; +begin + AColumn := ListColumns.ColumnByFieldName(AFieldName); + if AColumn <> nil then + Result := AColumn.Index + else + Result := -1; +end; + +function TcxLookupComboBoxProperties.GetDBLookupGridDataController: TcxDBDataController; +begin + if Grid <> nil then + Result := Grid.DataController + else + Result := nil; +end; + +function TcxLookupComboBoxProperties.GetGrid: TcxCustomLookupDBGrid; +begin + Result := FGrid; +end; + +function TcxLookupComboBoxProperties.GetGridMode: Boolean; +begin + Result := inherited IsUseLookupList; +end; + +function TcxLookupComboBoxProperties.GetListColumns: TcxLookupDBGridColumns; +begin + Result := Grid.Columns; +end; + +function TcxLookupComboBoxProperties.GetListOptions: TcxLookupDBGridOptions; +begin + Result := Grid.Options; +end; + +function TcxLookupComboBoxProperties.GetListSource: TDataSource; +begin + if IsDefinedByLookup then + Result := nil + else + Result := Grid.DataSource; +end; + +function TcxLookupComboBoxProperties.GetOnSortingChanged: TNotifyEvent; +begin + Result := Grid.DataController.OnSortingChanged; +end; + +procedure TcxLookupComboBoxProperties.SetGridMode(Value: Boolean); +begin + inherited IsUseLookupList := Value; +end; + +procedure TcxLookupComboBoxProperties.SetListColumns(Value: TcxLookupDBGridColumns); +begin + Grid.Columns := Value; // TODO: recreate? + CheckLookupColumn; + CheckDisplayColumnIndex; +end; + +procedure TcxLookupComboBoxProperties.SetListOptions(Value: TcxLookupDBGridOptions); +begin + Grid.Options := Value; +end; + +procedure TcxLookupComboBoxProperties.SetListSource(Value: TDataSource); + + procedure CheckListSource(ADataSource: TDataSource); + var + AField: TField; + begin + AField := GetDataField; + if Assigned(AField) and Assigned(ADataSource) and +// AField.DataSet.IsLinkedTo(ADataSource) then + IsLinkedToDataSet(ADataSource, AField.DataSet) then + DatabaseError(SCircularDataLink); + end; + +begin + if IsDefinedByLookup and not InSyncLookup then + DefineByLookupError; + if Value <> nil then + CheckListSource(Value); + Grid.DataSource := Value; + Changed; +end; + +procedure TcxLookupComboBoxProperties.SetOnSortingChanged(Value: TNotifyEvent); +begin + Grid.DataController.OnSortingChanged := Value; +end; + +{ TcxCustomLookupComboBox } + +class function TcxCustomLookupComboBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxLookupComboBoxProperties; +end; + +function TcxCustomLookupComboBox.GetProperties: TcxLookupComboBoxProperties; +begin + Result := TcxLookupComboBoxProperties(FProperties); +end; + +function TcxCustomLookupComboBox.GetActiveProperties: TcxLookupComboBoxProperties; +begin + Result := TcxLookupComboBoxProperties(InternalGetActiveProperties); +end; + +procedure TcxCustomLookupComboBox.SetProperties(Value: TcxLookupComboBoxProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxDBLookupComboBox } + +class function TcxDBLookupComboBox.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBLookupEditDataBinding; +end; + +function TcxDBLookupComboBox.GetDataBinding: TcxDBTextEditDataBinding; +begin + Result := TcxDBTextEditDataBinding(FDataBinding); +end; + +procedure TcxDBLookupComboBox.SetDataBinding(Value: TcxDBTextEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBLookupComboBox.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxFilterLookupComboBoxHelper } + +class function TcxFilterLookupComboBoxHelper.GetFilterEditClass: TcxCustomEditClass; +begin + Result := TcxLookupComboBox; +end; + +class procedure TcxFilterLookupComboBoxHelper.GetFilterValue(AEdit: TcxCustomEdit; + AEditProperties: TcxCustomEditProperties; var V: Variant; var S: TCaption); +begin + V := AEdit.EditValue; + S := TcxCustomTextEdit(AEdit).ILookupData.GetDisplayText(V); +end; + +class function TcxFilterLookupComboBoxHelper.GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; +begin + Result := [fcoEqual, fcoNotEqual, fcoBlanks, fcoNonBlanks]; +end; + +class procedure TcxFilterLookupComboBoxHelper.InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); +begin + inherited InitializeProperties(AProperties, AEditProperties, AHasButtons); + with TcxCustomLookupEditProperties(AProperties) do + begin + DropDownAutoSize := True; + DropDownListStyle := lsFixedList; + DropDownSizeable := True; + IncrementalFiltering := True; + end; +end; + +class function TcxFilterLookupComboBoxHelper.IsValueValid(AValueTypeClass: TcxValueTypeClass; + var Value: Variant): Boolean; +begin + Result := True; +end; + +class function TcxFilterLookupComboBoxHelper.IsIDefaultValuesProviderNeeded( + AEditProperties: TcxCustomEditProperties): Boolean; +begin + Result := TcxCustomDBLookupEditProperties(AEditProperties).IsDefinedByLookup; +end; + +initialization + GetRegisteredEditProperties.Register(TcxLookupComboBoxProperties, scxSEditRepositoryLookupComboBoxItem); + FilterEditsController.Register(TcxLookupComboBoxProperties, TcxFilterLookupComboBoxHelper); + +finalization + FilterEditsController.Unregister(TcxLookupComboBoxProperties, TcxFilterLookupComboBoxHelper); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxDBLookupEdit.pas b/official/x.35/ExpressEditors Library 5/Sources/cxDBLookupEdit.pas new file mode 100644 index 00000000..8cfad00d --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxDBLookupEdit.pas @@ -0,0 +1,865 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDBLookupEdit; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Messages, Controls, + SysUtils, Classes, DB, + cxClasses, cxContainer, cxEdit, cxDBEdit, cxEditConsts, + cxDB, cxDataUtils, cxDataStorage, cxCustomData, cxDBData, cxDropDownEdit, cxLookupEdit; + +type + TcxCustomDBLookupEditProperties = class; + + { TcxCustomDBLookupEditLookupData } + + TcxCustomDBLookupEditLookupData = class(TcxCustomLookupEditLookupData) + private + function GetDataController: TcxDBDataController; + function GetProperties: TcxCustomDBLookupEditProperties; + protected + procedure DoSetCurrentKey(ARecordIndex: Integer); override; + procedure DoSyncGrid; override; + property DataController: TcxDBDataController read GetDataController; + property Properties: TcxCustomDBLookupEditProperties read GetProperties; + end; + + { TcxCustomDBLookupEditProperties } + + TcxCustomDBLookupEditProperties = class(TcxCustomLookupEditProperties) + private + FCaseSensitiveSearch: Boolean; + FLockGridModeCount: Integer; + FLookupField: TField; + FLookupList: TcxLookupList; + FLookupSource: TDataSource; + FLookupSourceFreeNotificator: TcxFreeNotificator; + FSyncLookup: Boolean; + function GetIsUseLookupList: Boolean; + function GetKeyFieldNames: string; + function GetListField: TField; + function GetListFieldIndex: Integer; + function GetListFieldNames: string; + procedure SetIsUseLookupList(Value: Boolean); + procedure SetKeyFieldNames(const Value: string); + procedure SetListFieldIndex(Value: Integer); + procedure SetListFieldNames(const Value: string); + protected + // DBLookupGrid methods + procedure DBLookupGridBeginUpdate; virtual; + procedure DBLookupGridCheckColumnByFieldName(const AFieldName: string); virtual; // if a column does not exist, then create it with zero index + procedure DBLookupGridCreateColumnsByFieldNames(const AFieldNames: string); virtual; + procedure DBLookupGridEndUpdate; virtual; + function GetDBLookupGridColumnField(AIndex: Integer): TField; virtual; + function GetDBLookupGridColumnFieldName(AIndex: Integer): string; virtual; + function GetDBLookupGridColumnIndexByFieldName(const AFieldName: string): Integer; virtual; + function GetDBLookupGridDataController: TcxDBDataController; virtual; + + function CanDisplayArbitraryEditValue: Boolean; + procedure CheckLookup; virtual; + procedure CheckLookupColumn; virtual; + procedure CheckLookupList; + procedure DefaultValuesProviderDestroyed; override; + procedure DefineByLookupError; + function FindByText(AItemIndex: Integer; const AText: string; APartialCompare: Boolean): Integer; override; + function GetDisplayColumnIndex: Integer; override; + function GetDisplayLookupText(const AKey: TcxEditValue): string; override; + function GetDefaultHorzAlignment: TAlignment; override; + function GetDefaultMaxLength: Integer; override; + function GetIncrementalFiltering: Boolean; override; + function GetKeyByRecordIndex(ARecordIndex: Integer): Variant; + class function GetLookupDataClass: TcxInterfacedPersistentClass; override; + function GetLookupResultFieldName: string; + function GetNullKey: Variant; override; + function GetRecordIndexByKey(const AKey: Variant): Integer; + function IsPickMode: Boolean; override; + procedure LockDataChanged; override; + procedure LookupSourceFreeNotification(Sender: TComponent); virtual; + procedure SetDisplayColumnIndex(Value: Integer); override; + procedure SetLookupField(ALookupField: TField); + procedure UnlockDataChanged; override; + property InSyncLookup: Boolean read FSyncLookup; + property IsUseLookupList: Boolean read GetIsUseLookupList write SetIsUseLookupList; + public + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure Changed; override; + class function GetContainerClass: TcxContainerClass; override; + function GetDataField: TField; + function GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; override; + function GetLookupField: TField; + function IsLookupField: Boolean; override; + procedure PrepareDisplayValue(const AEditValue: TcxEditValue; + var DisplayValue: TcxEditValue; AEditFocused: Boolean); override; + property CaseSensitiveSearch: Boolean read FCaseSensitiveSearch + write FCaseSensitiveSearch default False; + property DataController: TcxDBDataController read GetDBLookupGridDataController; + property KeyFieldNames: string read GetKeyFieldNames write SetKeyFieldNames; + property ListField: TField read GetListField; + property ListFieldNames: string read GetListFieldNames write SetListFieldNames stored False; + property ListFieldIndex: Integer read GetListFieldIndex write SetListFieldIndex default 0; + end; + + { TcxCustomDBLookupEdit } + + TcxCustomDBLookupEdit = class(TcxCustomLookupEdit) + private + function GetProperties: TcxCustomDBLookupEditProperties; + function GetActiveProperties: TcxCustomDBLookupEditProperties; + procedure SetProperties(Value: TcxCustomDBLookupEditProperties); + protected + function GetClearValue: TcxEditValue; override; + function IsValidChar(AChar: Char): Boolean; override; + function ItemIndexToLookupKey(AItemIndex: Integer): TcxEditValue; override; + function LookupKeyToEditValue(const AKey: TcxEditValue): TcxEditValue; override; + function LookupKeyToItemIndex(const AKey: TcxEditValue): Integer; override; + procedure PopupWindowClosed(Sender: TObject); override; + procedure PrepareDisplayValue(const AEditValue: TcxEditValue; + var DisplayValue: TcxEditValue; AEditFocused: Boolean); override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxCustomDBLookupEditProperties + read GetActiveProperties; + property Properties: TcxCustomDBLookupEditProperties read GetProperties + write SetProperties; + end; + + { TcxDBLookupEditDataBinding } + + TcxDBLookupEditDataBinding = class(TcxDBTextEditDataBinding) + protected + function IsLookupControl: Boolean; override; + end; + +function IsLinkedToDataSet(ADataSource: TDataSource{list}; ADataSet: TDataSet{data binding}): Boolean; + +implementation + +uses +{$IFDEF DELPHI6} + VDBConsts, +{$ENDIF} + Contnrs, DBConsts; + +function IsLinkedToDataSet(ADataSource: TDataSource{list}; ADataSet: TDataSet{data binding}): Boolean; +var + AListDataSet: TDataSet; +begin + AListDataSet := ADataSource.DataSet; + Result := True; + while ADataSet <> nil do + begin + if ADataSet = AListDataSet then Exit; + if (ADataSet.DataSetField <> nil) and + (ADataSet.DataSetField.DataSet = AListDataSet) then Exit; + if ADataSet.DataSource = nil then + Break + else + ADataSet := ADataSet.DataSource.DataSet; + end; + Result := False; +end; + +{ TcxCustomDBLookupEditLookupData } + +procedure TcxCustomDBLookupEditLookupData.DoSetCurrentKey(ARecordIndex: Integer); +begin + FCurrentKey := Properties.GetKeyByRecordIndex(ARecordIndex); +end; + +procedure TcxCustomDBLookupEditLookupData.DoSyncGrid; +begin + if DataController <> nil then + try + Properties.LockDataChanged; + try + DataController.LocateByKey(GetCurrentKey); + finally + Properties.UnlockDataChanged; + end; + except + on EVariantError do; + on EDatabaseError do; + end; +end; + +function TcxCustomDBLookupEditLookupData.GetDataController: TcxDBDataController; +begin + Result := Properties.DataController; +end; + +function TcxCustomDBLookupEditLookupData.GetProperties: TcxCustomDBLookupEditProperties; +begin + Result := TcxCustomDBLookupEditProperties(inherited Properties); +end; + +{ TcxCustomDBLookupEditProperties } + +destructor TcxCustomDBLookupEditProperties.Destroy; +begin + SetLookupField(nil); + FreeAndNil(FLookupSourceFreeNotificator); + FLookupList.Free; + FLookupList := nil; + inherited Destroy; +end; + +procedure TcxCustomDBLookupEditProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomDBLookupEditProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + CaseSensitiveSearch := TcxCustomDBLookupEditProperties(Source).CaseSensitiveSearch; + if not IsDefinedByLookup then + KeyFieldNames := TcxCustomDBLookupEditProperties(Source).KeyFieldNames; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +procedure TcxCustomDBLookupEditProperties.Changed; +begin + CheckLookupList; + CheckLookup; + CheckLookupColumn; + inherited Changed; +end; + +class function TcxCustomDBLookupEditProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxCustomDBLookupEdit; +end; + +function TcxCustomDBLookupEditProperties.GetDataField: TField; +var + ADefaultValuesProvider: TcxCustomEditDefaultValuesProvider; +begin + Result := nil; + if IDefaultValuesProvider <> nil then + begin + ADefaultValuesProvider := TcxCustomEditDefaultValuesProvider(IDefaultValuesProvider.GetInstance); + if ADefaultValuesProvider is TcxCustomDBEditDefaultValuesProvider then + Result := TcxCustomDBEditDefaultValuesProvider(ADefaultValuesProvider).Field; + end; +end; + +function TcxCustomDBLookupEditProperties.GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; +begin + if GetLookupField <> nil then + begin + if AEditFocused then + Result := evsKey + else + Result := evsText; + end + else + Result := inherited GetEditValueSource(AEditFocused); +end; + +function TcxCustomDBLookupEditProperties.GetLookupField: TField; +begin + Result := GetDataField; + if (Result <> nil) and (not Result.Lookup or (csDestroying in Result.ComponentState)) then + Result := nil; +end; + +function TcxCustomDBLookupEditProperties.IsLookupField: Boolean; +begin + Result := GetLookupField <> nil; +end; + +procedure TcxCustomDBLookupEditProperties.PrepareDisplayValue( + const AEditValue: TcxEditValue; var DisplayValue: TcxEditValue; + AEditFocused: Boolean); +begin + if CanDisplayArbitraryEditValue and (DropDownListStyle <> lsEditList) and + not AEditFocused then + DisplayValue := VarToStr(AEditValue) + else + inherited PrepareDisplayValue(AEditValue, DisplayValue, AEditFocused); +end; + +procedure TcxCustomDBLookupEditProperties.DBLookupGridBeginUpdate; +begin +end; + +procedure TcxCustomDBLookupEditProperties.DBLookupGridCheckColumnByFieldName(const AFieldName: string); +begin +end; + +procedure TcxCustomDBLookupEditProperties.DBLookupGridCreateColumnsByFieldNames(const AFieldNames: string); +begin +end; + +procedure TcxCustomDBLookupEditProperties.DBLookupGridEndUpdate; +begin +end; + +function TcxCustomDBLookupEditProperties.GetDBLookupGridColumnField(AIndex: Integer): TField; +begin + Result := nil; +end; + +function TcxCustomDBLookupEditProperties.GetDBLookupGridColumnFieldName(AIndex: Integer): string; +begin + Result := ''; +end; + +function TcxCustomDBLookupEditProperties.GetDBLookupGridColumnIndexByFieldName(const AFieldName: string): Integer; +begin + Result := -1; +end; + +function TcxCustomDBLookupEditProperties.GetDBLookupGridDataController: TcxDBDataController; +begin + Result := nil; +end; + +function TcxCustomDBLookupEditProperties.CanDisplayArbitraryEditValue: Boolean; +var + AKeyField: TField; +begin + Result := False; // TODO: method in DataController? + if (KeyFieldNames <> '') and not IsMultipleFieldNames(KeyFieldNames) and + (DataController <> nil) and (DataController.DataSet <> nil) then + begin + AKeyField := DataController.DataSet.FindField(KeyFieldNames); + if AKeyField <> nil then + Result := (AKeyField = GetListField) and + ((DropDownListStyle = lsEditList) or (AKeyField is TStringField)); + end; +end; + +procedure TcxCustomDBLookupEditProperties.CheckLookup; + + procedure CheckListSource; + var + AField: TField; + begin + AField := GetDataField; + if Assigned(AField) and Assigned(DataController) and Assigned(DataController.DataSource) and +// AField.DataSet.IsLinkedTo(DataController.DataSource) then + IsLinkedToDataSet(DataController.DataSource, AField.DataSet) then + DatabaseError(SCircularDataLink); + end; + +begin + SetLookupField(GetLookupField); + CheckListSource; +end; + +procedure TcxCustomDBLookupEditProperties.CheckLookupColumn; +var + AFieldName: string; +begin + AFieldName := GetLookupResultFieldName; + if AFieldName <> '' then + DBLookupGridCheckColumnByFieldName(AFieldName); +end; + +procedure TcxCustomDBLookupEditProperties.CheckLookupList; +begin + if FLookupList <> nil then + FLookupList.Clear; + if (DataController <> nil) then + DataController.DataModeController.GridMode := IsUseLookupList; +end; + +procedure TcxCustomDBLookupEditProperties.DefaultValuesProviderDestroyed; +begin + inherited DefaultValuesProviderDestroyed; + BeginUpdate; + try + Changed; + finally + EndUpdate(False); + end; +end; + +procedure TcxCustomDBLookupEditProperties.DefineByLookupError; +begin + DatabaseError(SPropDefByLookup); +end; + +function TcxCustomDBLookupEditProperties.IsPickMode: Boolean; +begin + Result := (DropDownListStyle = lsEditList) and CanDisplayArbitraryEditValue; +end; + +procedure TcxCustomDBLookupEditProperties.LockDataChanged; +begin + inherited LockDataChanged; + // TODO: if GridMode + if (DataController <> nil) and DataController.IsGridMode then + Inc(FLockGridModeCount); + if FLockGridModeCount <> 0 then + DataController.LockGridModeNotify; +end; + +procedure TcxCustomDBLookupEditProperties.LookupSourceFreeNotification(Sender: TComponent); +begin + CheckLookup; +end; + +procedure TcxCustomDBLookupEditProperties.SetDisplayColumnIndex(Value: Integer); +begin + if IsDefinedByLookup and not FSyncLookup then + DefineByLookupError; + inherited SetDisplayColumnIndex(Value); +end; + +procedure TcxCustomDBLookupEditProperties.SetLookupField(ALookupField: TField); +begin + if FLookupField <> ALookupField then + begin + FLookupField := ALookupField; + if FLookupField <> nil then + begin + // Lookup Source + if FLookupSource = nil then + FLookupSource := TDataSource.Create(nil); + + FreeAndNil(FLookupSourceFreeNotificator); + FLookupSourceFreeNotificator := TcxFreeNotificator.Create(nil); + FLookupSourceFreeNotificator.OnFreeNotification := LookupSourceFreeNotification; + FLookupSourceFreeNotificator.AddSender(FLookupField); + + FLookupSource.DataSet := FLookupField.LookupDataSet; + // Sync Lookup Data + if DataController <> nil then + begin + FSyncLookup := True; + try +// if DataController.DataSet <> FLookupSource.DataSet then // SC DB11573 + DataController.DataSource := FLookupSource; + if GetDBLookupGridColumnIndexByFieldName(FLookupField.LookupResultField) = -1 then + ListFieldNames := FLookupField.LookupResultField; + KeyFieldNames := FLookupField.LookupKeyFields; + ListFieldIndex := 0; + finally + FSyncLookup := False; + end; + end; + end + else + begin + FreeAndNil(FLookupSourceFreeNotificator); + FreeAndNil(FLookupSource); + end; + end; +end; + +procedure TcxCustomDBLookupEditProperties.UnlockDataChanged; +begin + if FLockGridModeCount <> 0 then + begin + if DataController <> nil then + DataController.UnlockGridModeNotify; + Dec(FLockGridModeCount); + end; + inherited UnlockDataChanged; +end; + +function TcxCustomDBLookupEditProperties.FindByText(AItemIndex: Integer; + const AText: string; APartialCompare: Boolean): Integer; + + function GetLocateOptions: TLocateOptions; + begin + Result := []; + if not CaseSensitiveSearch then + Include(Result, loCaseInsensitive); + if APartialCompare then + Result := Result + [loPartialKey]; + end; + + function GetLocateValue: Variant; + begin + Result := AText; + // TDataSet.Locate does not work with empty strings passed as key values for numeric fields + if (AText = '') and not (DataController.GetItemField(AItemIndex) is TStringField) then + Result := Null; + end; + +var + ADataSet: TDataSet; + AListFieldName: string; +begin + if not IsUseLookupList then + begin + Result := inherited FindByText(AItemIndex, AText, APartialCompare); + Exit; + end; + + Result := -1; + LockDataChanged; + try + ADataSet := DataController.DataSet; + AListFieldName := DataController.GetItemFieldName(AItemIndex); + try + if (ADataSet <> nil) and ADataSet.Active and (AItemIndex <> -1) and + ADataSet.Locate(AListFieldName, GetLocateValue, GetLocateOptions) then + Result := DataController.GetFocusedRecordIndex; + except + on EDatabaseError do; + on EVariantError do; + end; + finally + UnlockDataChanged; + end; +end; + +function TcxCustomDBLookupEditProperties.GetDisplayColumnIndex: Integer; +var + AFieldName: string; +begin + AFieldName := GetLookupResultFieldName; + if AFieldName <> '' then + Result := GetDBLookupGridColumnIndexByFieldName(AFieldName) + else + Result := inherited GetDisplayColumnIndex; +end; + +function TcxCustomDBLookupEditProperties.GetDisplayLookupText(const AKey: TcxEditValue): string; +var + ARecordIndex: Integer; + AItemIndex: Integer; + ADataSet: TDataSet; +begin + Result := ''; + AItemIndex := GetListIndex; + if (AItemIndex <> -1) and (DataController <> nil) then + begin + if IsUseLookupList then + begin + + // TODO: proc? + if FLookupList.Find(AKey, ARecordIndex) then + Result := FLookupList[ARecordIndex]^.DisplayText + else + begin + ADataSet := DataController.DataSet; + LockDataChanged; + try + if (ADataSet <> nil) and ADataSet.Active and (ListField <> nil) and + CanCallDataSetLocate(DataController.DataSet, KeyFieldNames, AKey) and + ADataSet.Locate(KeyFieldNames, AKey, []) then + Result := ListField.AsString {ListField.DisplayText} + else + Result := ''; + finally + UnlockDataChanged; + end; + FLookupList.Insert(ARecordIndex, AKey, Result); + end; + + end + else + begin + ARecordIndex := GetRecordIndexByKey(AKey); + if ARecordIndex <> -1 then + Result := DataController.DisplayTexts[ARecordIndex, AItemIndex]; + end; + end; +end; + +function TcxCustomDBLookupEditProperties.GetDefaultHorzAlignment: TAlignment; +begin + if ListField <> nil then + Result := ListField.Alignment + else + Result := inherited GetDefaultHorzAlignment; +end; + +function TcxCustomDBLookupEditProperties.GetDefaultMaxLength: Integer; +begin + if ListField <> nil then + Result := ListField.Size + else + Result := inherited GetDefaultMaxLength; +end; + +function TcxCustomDBLookupEditProperties.GetIncrementalFiltering: Boolean; +begin + if IsUseLookupList then + Result := False + else + Result := inherited GetIncrementalFiltering; +end; + +function TcxCustomDBLookupEditProperties.GetKeyByRecordIndex(ARecordIndex: Integer): Variant; +begin + if (ARecordIndex <> -1) and (DataController <> nil) then + Result := DataController.GetRecordId(ARecordIndex) + else + Result := Null; +end; + +class function TcxCustomDBLookupEditProperties.GetLookupDataClass: TcxInterfacedPersistentClass; +begin + Result := TcxCustomDBLookupEditLookupData; +end; + +function TcxCustomDBLookupEditProperties.GetLookupResultFieldName: string; +begin + if GetLookupField <> nil then + Result := GetLookupField.LookupResultField + else + Result := ''; +end; + +function TcxCustomDBLookupEditProperties.GetNullKey: Variant; +var + I, C: Integer; +begin + if IsMultipleFieldNames(KeyFieldNames) then + begin + C := GetFieldNamesCount(KeyFieldNames); + Result := VarArrayCreate([0, C - 1], varVariant); + for I := 0 to C - 1 do + Result[I] := Null; + end + else + Result := Null; +end; + +function TcxCustomDBLookupEditProperties.GetRecordIndexByKey(const AKey: Variant): Integer; +begin + try + Result := DataController.FindRecordIndexByKey(AKey); + except + on EVariantError do + Result := -1; + end; +end; + +function TcxCustomDBLookupEditProperties.GetIsUseLookupList: Boolean; +begin + Result := FLookupList <> nil; +end; + +function TcxCustomDBLookupEditProperties.GetKeyFieldNames: string; +begin + if DataController <> nil then + Result := DataController.KeyFieldNames + else + Result := ''; +end; + +function TcxCustomDBLookupEditProperties.GetListField: TField; +var + AListIndex: Integer; +begin + AListIndex := GetListIndex; + if AListIndex <> -1 then + Result := GetDBLookupGridColumnField(AListIndex) + else + Result := nil; +end; + +function TcxCustomDBLookupEditProperties.GetListFieldIndex: Integer; +begin + Result := inherited DisplayColumnIndex; +end; + +function TcxCustomDBLookupEditProperties.GetListFieldNames: string; +var + I: Integer; +begin + Result := ''; + if GetLookupGridColumnCount > 0 then + begin + Result := GetDBLookupGridColumnFieldName(0); + for I := 1 to GetLookupGridColumnCount - 1 do + Result := Result + ';' + GetDBLookupGridColumnFieldName(I); + end; +end; + +procedure TcxCustomDBLookupEditProperties.SetIsUseLookupList(Value: Boolean); +begin + if (FLookupList <> nil) <> Value then + begin + if Value then + begin + FLookupList := TcxLookupList.Create; + end + else + begin + FLookupList.Free; + FLookupList := nil; + end; + Changed; + end; +end; + +procedure TcxCustomDBLookupEditProperties.SetKeyFieldNames(const Value: string); +begin + if IsDefinedByLookup and not FSyncLookup then + DefineByLookupError; + if DataController <> nil then + DataController.KeyFieldNames := Value; +end; + +procedure TcxCustomDBLookupEditProperties.SetListFieldIndex(Value: Integer); +begin + inherited DisplayColumnIndex := Value; +end; + +procedure TcxCustomDBLookupEditProperties.SetListFieldNames(const Value: string); +var + AChanged: Boolean; +begin + AChanged := ListFieldNames <> Value; + DBLookupGridBeginUpdate; + try + DBLookupGridCreateColumnsByFieldNames(Value); + CheckLookupColumn; + CheckDisplayColumnIndex; + finally + DBLookupGridEndUpdate; + end; + if AChanged then + Changed; +end; + +{ TcxCustomDBLookupEdit } + +class function TcxCustomDBLookupEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomDBLookupEditProperties; +end; + +function TcxCustomDBLookupEdit.GetClearValue: TcxEditValue; + + function GetNullArray: Variant; + var + AFieldList: TObjectList; + I: Integer; + begin + AFieldList := TObjectList.Create(False); + try + ActiveProperties.FLookupSource.DataSet.GetFieldList(AFieldList, ActiveProperties.KeyFieldNames); + Result := VarArrayCreate([0, AFieldList.Count - 1], varVariant); + for I := 0 to AFieldList.Count - 1 do + Result[I] := Null; + finally + AFieldList.Free; + end; + end; + +begin + if (ActiveProperties.GetEditValueSource(InternalFocused) = evsKey) and + (Pos(';', ActiveProperties.KeyFieldNames) <> 0) then + Result := GetNullArray + else + Result := inherited GetClearValue; +end; + +function TcxCustomDBLookupEdit.IsValidChar(AChar: Char): Boolean; +begin + if ActiveProperties.ListField <> nil then + Result := ActiveProperties.ListField.IsValidChar(AChar) + else + Result := True; +end; + +function TcxCustomDBLookupEdit.ItemIndexToLookupKey(AItemIndex: Integer): TcxEditValue; +begin + Result := ActiveProperties.GetKeyByRecordIndex(AItemIndex); +end; + +function TcxCustomDBLookupEdit.LookupKeyToEditValue(const AKey: TcxEditValue): TcxEditValue; +begin + Result := AKey; +end; + +function TcxCustomDBLookupEdit.LookupKeyToItemIndex(const AKey: TcxEditValue): Integer; +begin + Result := ActiveProperties.GetRecordIndexByKey(AKey); +end; + +procedure TcxCustomDBLookupEdit.PopupWindowClosed(Sender: TObject); +begin + inherited PopupWindowClosed(Sender); + if ActiveProperties.DataController.DataModeController.SyncMode then + ILookupData.CurrentKey := EditValue; +end; + +procedure TcxCustomDBLookupEdit.PrepareDisplayValue( + const AEditValue: TcxEditValue; var DisplayValue: TcxEditValue; + AEditFocused: Boolean); +begin + if (ActiveProperties.DropDownListStyle <> lsEditList) and not Focused and + ActiveProperties.CanDisplayArbitraryEditValue then + DisplayValue := VarToStr(AEditValue) + else + ActiveProperties.PrepareDisplayValue(AEditValue, DisplayValue, AEditFocused); +end; + +function TcxCustomDBLookupEdit.GetProperties: TcxCustomDBLookupEditProperties; +begin + Result := TcxCustomDBLookupEditProperties(FProperties); +end; + +function TcxCustomDBLookupEdit.GetActiveProperties: TcxCustomDBLookupEditProperties; +begin + Result := TcxCustomDBLookupEditProperties(InternalGetActiveProperties); +end; + +procedure TcxCustomDBLookupEdit.SetProperties(Value: TcxCustomDBLookupEditProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxDBLookupEditDataBinding } + +function TcxDBLookupEditDataBinding.IsLookupControl: Boolean; +begin + Result := True; +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxDBNavigator.pas b/official/x.35/ExpressEditors Library 5/Sources/cxDBNavigator.pas new file mode 100644 index 00000000..6594529b --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxDBNavigator.pas @@ -0,0 +1,541 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxDBNavigator; + +{$I cxVer.inc} + +interface + +uses + Classes, DB, cxDBFilterControl, cxNavigator; + +type + TcxCustomDBNavigator = class; + + TcxDBNavigatorDataLink = class(TDataLink) + private + FNavigator: TcxCustomDBNavigator; + protected + procedure EditingChanged; override; + procedure DataSetChanged; override; + procedure ActiveChanged; override; + public + constructor Create(ANavigator: TcxCustomDBNavigator); + destructor Destroy; override; + end; + + TcxDBNavigatorButtonsFilterEvent = procedure(Sender: TObject; + AFilterControl: TcxDBFilterControl) of object; + TcxDBNavigatorButtonsGetDataLink = function: TDataLink of object; + + TcxDBNavigatorButtons = class(TcxCustomNavigatorButtons) + private + FBookmark: TBookmark; + FFilterCriteria: TMemoryStream; + FFilterSetting: Boolean; + FPageSize: Integer; + FOnApplyFilter: TcxDBNavigatorButtonsFilterEvent; + FOnGetDataLink: TcxDBNavigatorButtonsGetDataLink; + FOnShowFilterDialog: TcxDBNavigatorButtonsFilterEvent; + + procedure DoApplyFilter(Sender: TObject); + procedure DoShowFilterDialog(Sender: TObject); + function GetDataLink: TDataLink; + function GetDataSet: TDataSet; + function GetInternalPageSize: Integer; + procedure SetBookmark(Value: TBookmark); + procedure SetPageSize(Value: Integer); + procedure ShowFilter; + protected + procedure DoButtonClick(ADefaultIndex: Integer); override; + function GetButtonEnabled(ADefaultIndex: Integer): Boolean; override; + procedure CheckBookmark; + procedure ClearFilterCriteria; + property Bookmark: TBookmark read FBookmark write SetBookmark; + property DataLink: TDataLink read GetDataLink; + property DataSet: TDataSet read GetDataSet; + property InternalPageSize: Integer read GetInternalPageSize; + property OnGetDataLink: TcxDBNavigatorButtonsGetDataLink + read FOnGetDataLink write FOnGetDataLink; + public + constructor Create(ANavigator: IcxNavigatorOwner); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure ReleaseBookmark; override; + published + property ConfirmDelete; + property Images; + property PageSize: Integer read FPageSize write SetPageSize default 0; + property OnShowFilterDialog: TcxDBNavigatorButtonsFilterEvent + read FOnShowFilterDialog write FOnShowFilterDialog; + property OnApplyFilter: TcxDBNavigatorButtonsFilterEvent + read FOnApplyFilter write FOnApplyFilter; + property First; + property PriorPage; + property Prior; + property Next; + property NextPage; + property Last; + property Insert; + property Append; + property Delete; + property Edit; + property Post; + property Cancel; + property Refresh; + property SaveBookmark; + property GotoBookmark; + property Filter; + end; + + TcxDBNavigatorFilterEvent = procedure(ANavigator: TcxCustomDBNavigator; + AFilterControl: TcxDBFilterControl) of object; + + TcxCustomDBNavigator = class(TcxCustomNavigator) + private + FDataLink: TcxDBNavigatorDataLink; + FOnApplyFilter: TcxDBNavigatorFilterEvent; + FOnShowFilterDialog: TcxDBNavigatorFilterEvent; + + procedure DoApplyFilter(Sender: TObject; AFilterControl: TcxDBFilterControl); + procedure DoShowFilterDialog(Sender: TObject; AFilterControl: TcxDBFilterControl); + function GetButtons: TcxDBNavigatorButtons; + function GetDataLink: TDataLink; + function GetDataSource: TDataSource; + function GetDataSet: TDataSet; + procedure SetButtons(Value: TcxDBNavigatorButtons); + procedure SetDataSource(Value: TDataSource); + procedure SetOnApplyFilter(Value: TcxDBNavigatorFilterEvent); + procedure SetOnShowFilterDialog(Value: TcxDBNavigatorFilterEvent); + protected + function CreateButtons: TcxCustomNavigatorButtons; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + + procedure DataSetActiveChanged; virtual; + procedure DataSetDataChanged; virtual; + + property Buttons: TcxDBNavigatorButtons read GetButtons write SetButtons; + property DataLink: TcxDBNavigatorDataLink read FDataLink; + property DataSource: TDataSource read GetDataSource write SetDataSource; + property OnApplyFilter: TcxDBNavigatorFilterEvent read FOnApplyFilter + write SetOnApplyFilter; + property OnShowFilterDialog: TcxDBNavigatorFilterEvent read FOnShowFilterDialog + write SetOnShowFilterDialog; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property DataSet: TDataSet read GetDataSet; + end; + + TcxDBNavigator = class(TcxCustomDBNavigator) + published + property Buttons; + property DataSource; + property LookAndFeel; + property OnApplyFilter; + property OnShowFilterDialog; + property Align; + property Anchors; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property Ctl3D; + property ParentCtl3D; + property ParentShowHint; + property PopupMenu; + property ShowHint; + property TabOrder; + property TabStop; + property Visible; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnResize; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +uses + Windows, SysUtils, Controls, DBCtrls, Dialogs, cxClasses, + cxFilterControlDialog, cxEditConsts; + +type + TDataSetAccess = class(TDataSet); + +{ TcxDBNavigatorDataLink } + +constructor TcxDBNavigatorDataLink.Create(ANavigator: TcxCustomDBNavigator); +begin + inherited Create; + FNavigator := ANavigator; + VisualControl := True; +end; + +destructor TcxDBNavigatorDataLink.Destroy; +begin + FNavigator := nil; + inherited Destroy; +end; + +procedure TcxDBNavigatorDataLink.EditingChanged; +begin + if FNavigator <> nil then + FNavigator.NavigatorButtonsStateChanged; +end; + +procedure TcxDBNavigatorDataLink.DataSetChanged; +begin + if FNavigator <> nil then + begin + FNavigator.DataSetDataChanged; + FNavigator.NavigatorButtonsStateChanged; + end; +end; + +procedure TcxDBNavigatorDataLink.ActiveChanged; +begin + if FNavigator <> nil then + begin + FNavigator.DataSetActiveChanged; + FNavigator.NavigatorButtonsStateChanged; + end; +end; + +{ TcxDBNavigatorButtons } + +constructor TcxDBNavigatorButtons.Create(ANavigator: IcxNavigatorOwner); +begin + inherited Create(ANavigator); + FPageSize := 0; + FFilterCriteria := TMemoryStream.Create; +end; + +destructor TcxDBNavigatorButtons.Destroy; +begin + FreeAndNil(FFilterCriteria); + inherited Destroy; +end; + +procedure TcxDBNavigatorButtons.Assign(Source: TPersistent); +begin + if Source is TcxDBNavigatorButtons then + with TcxDBNavigatorButtons(Source) do + begin + Self.PageSize := PageSize; + Self.OnApplyFilter := OnApplyFilter; + Self.OnShowFilterDialog := OnShowFilterDialog; + end + else + inherited Assign(Source); +end; + +procedure TcxDBNavigatorButtons.ReleaseBookmark; +begin + Bookmark := nil; +end; + +procedure TcxDBNavigatorButtons.DoApplyFilter(Sender: TObject); +begin + ClearFilterCriteria; + TcxDBFilterControl(Sender).SaveToStream(FFilterCriteria); + FFilterSetting := True; + try + if Assigned(FOnApplyFilter) then + FOnApplyFilter(Self, TcxDBFilterControl(Sender)) + else + begin + DataSet.Filter := TcxDBFilterControl(Sender).GetFilterTextEx('[', ']'); + DataSet.Filtered := True; + end; + finally + FFilterSetting := False; + end; +end; + +procedure TcxDBNavigatorButtons.DoShowFilterDialog(Sender: TObject); +var + AFilterControl: TcxDBFilterControl; +begin + AFilterControl := TfmFilterControlDialog(Sender).FilterControl as TcxDBFilterControl; + if FFilterCriteria.Size > 0 then + begin + FFilterCriteria.Position := 0; + AFilterControl.LoadFromStream(FFilterCriteria); + end; + if Assigned(OnShowFilterDialog) then + OnShowFilterDialog(Self, AFilterControl); + if not Assigned(FOnApplyFilter) then + with AFilterControl.FilterOptions do + begin + SupportedBetween := False; + SupportedIn := False; + SupportedLike := False; + end; +end; + +function TcxDBNavigatorButtons.GetDataLink: TDataLink; +begin + if Assigned(FOnGetDataLink) then + Result := FOnGetDataLink + else Result := nil; +end; + +function TcxDBNavigatorButtons.GetDataSet: TDataSet; +begin + if DataLink <> nil then + Result := DataLink.DataSet + else Result := nil; +end; + +function TcxDBNavigatorButtons.GetInternalPageSize: Integer; +begin + if PageSize > 0 then + Result := PageSize + else + if (DataSet <> nil) then + Result := TDataSetAccess(DataSet).BufferCount + else + Result := 0; +end; + +procedure TcxDBNavigatorButtons.SetBookmark(Value: TBookmark); +begin + if Value <> FBookmark then + begin + if FBookmark <> nil then + if DataSet = nil then + FreeMem(FBookmark) + else + DataSet.FreeBookmark(FBookmark); + FBookmark := Value; + Navigator.NavigatorButtonsStateChanged; + end; +end; + +procedure TcxDBNavigatorButtons.SetPageSize(Value: Integer); +begin + if Value > - 1 then + FPageSize := Value; +end; + +procedure TcxDBNavigatorButtons.ShowFilter; +var + AShowFilterEvent: TNotifyEvent; +begin + AShowFilterEvent := DoShowFilterDialog; + ExecuteDBFilterControlDialog(DataSet, Navigator.GetNavigatorLookAndFeel, + DoApplyFilter, AShowFilterEvent); +end; + +procedure TcxDBNavigatorButtons.DoButtonClick(ADefaultIndex: Integer); +begin + if (DataLink = nil) or not DataLink.Active then + Exit; + case ADefaultIndex of + NBDI_FIRST: DataSet.First; + NBDI_PRIORPAGE: DataSet.MoveBy(-InternalPageSize); + NBDI_PRIOR: DataSet.Prior; + NBDI_LAST: DataSet.Last; + NBDI_NEXTPAGE: DataSet.MoveBy(InternalPageSize); + NBDI_NEXT: DataSet.Next; + NBDI_INSERT: DataSet.Insert; + NBDI_APPEND: DataSet.Append; + NBDI_DELETE: + if not ConfirmDelete or + (MessageDlg(cxGetResourceString(@cxNavigator_DeleteRecordQuestion), + mtConfirmation, mbOKCancel, 0) = ID_OK) then + DataSet.Delete; + NBDI_EDIT: DataSet.Edit; + NBDI_POST: DataSet.Post; + NBDI_CANCEL: DataSet.Cancel; + NBDI_SAVEBOOKMARK: Bookmark := DataSet.GetBookmark; + NBDI_GOTOBOOKMARK: DataSet.GotoBookmark(Bookmark); + NBDI_REFRESH: DataSet.Refresh; + NBDI_FILTER: ShowFilter; + end; +end; + +function TcxDBNavigatorButtons.GetButtonEnabled(ADefaultIndex: Integer): Boolean; +begin + Result := IsNavigatorEnabled and (DataLink <> nil) and DataLink.Active; + if Result then + begin + case ADefaultIndex of + NBDI_FIRST, NBDI_PRIOR, NBDI_PRIORPAGE: Result := not DataSet.Bof; + NBDI_LAST, NBDI_NEXT, NBDI_NEXTPAGE: Result := not DataSet.Eof; + NBDI_INSERT, NBDI_APPEND: Result := DataSet.CanModify; + NBDI_DELETE: Result := DataSet.CanModify and + not (DataSet.BOF and DataSet.EOF); + NBDI_EDIT: Result := DataSet.CanModify and not DataLink.Editing; + NBDI_POST, NBDI_CANCEL: Result := DataSet.CanModify and DataLink.Editing; + NBDI_GOTOBOOKMARK: Result := Bookmark <> nil; + end; + end; +end; + +procedure TcxDBNavigatorButtons.CheckBookmark; +begin + if (Bookmark <> nil) and not DataSet.BookmarkValid(Bookmark) then + ReleaseBookmark; +end; + +procedure TcxDBNavigatorButtons.ClearFilterCriteria; +begin + if not FFilterSetting then + FFilterCriteria.Clear; +end; + +{ TcxCustomDBNavigator } + +constructor TcxCustomDBNavigator.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FDataLink := TcxDBNavigatorDataLink.Create(Self); +end; + +destructor TcxCustomDBNavigator.Destroy; +begin + FreeAndNil(FDataLink); + inherited Destroy; +end; + +procedure TcxCustomDBNavigator.DoApplyFilter(Sender: TObject; + AFilterControl: TcxDBFilterControl); +begin + if Assigned(FOnApplyFilter) then + FOnApplyFilter(Self, AFilterControl); +end; + +procedure TcxCustomDBNavigator.DoShowFilterDialog(Sender: TObject; + AFilterControl: TcxDBFilterControl); +begin + if Assigned(FOnShowFilterDialog) then + FOnShowFilterDialog(Self, AFilterControl); +end; + +function TcxCustomDBNavigator.GetButtons: TcxDBNavigatorButtons; +begin + Result := TcxDBNavigatorButtons(CustomButtons); +end; + +function TcxCustomDBNavigator.GetDataLink: TDataLink; +begin + Result := FDataLink; +end; + +function TcxCustomDBNavigator.GetDataSource: TDataSource; +begin + Result := FDataLink.DataSource; +end; + +function TcxCustomDBNavigator.GetDataSet: TDataSet; +begin + Result := FDataLink.DataSet; +end; + +procedure TcxCustomDBNavigator.SetButtons(Value: TcxDBNavigatorButtons); +begin + CustomButtons.Assign(Value); +end; + +procedure TcxCustomDBNavigator.SetDataSource(Value: TDataSource); +begin + if DataSource <> Value then + begin + {$IFDEF DELPHI5} + if (DataSource <> nil) and not (csDestroying in DataSource.ComponentState) then + DataSource.RemoveFreeNotification(Self); + {$ENDIF} + FDataLink.DataSource := Value; + if (DataSource <> nil) then + DataSource.FreeNotification(Self); + end; +end; + +procedure TcxCustomDBNavigator.SetOnApplyFilter(Value: TcxDBNavigatorFilterEvent); +begin + FOnApplyFilter := Value; + if Assigned(FOnApplyFilter) then + Buttons.OnApplyFilter := DoApplyFilter + else + Buttons.OnApplyFilter := nil; +end; + +procedure TcxCustomDBNavigator.SetOnShowFilterDialog(Value: TcxDBNavigatorFilterEvent); +begin + FOnShowFilterDialog := Value; + if Assigned(FOnShowFilterDialog) then + Buttons.OnShowFilterDialog := DoShowFilterDialog + else + Buttons.OnShowFilterDialog := nil; +end; + +function TcxCustomDBNavigator.CreateButtons: TcxCustomNavigatorButtons; +begin + Result := TcxDBNavigatorButtons.Create(Self); + TcxDBNavigatorButtons(Result).OnGetDataLink := GetDataLink; +end; + +procedure TcxCustomDBNavigator.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (FDataLink <> nil) + and (AComponent = DataSource) then + DataSource := nil; +end; + +procedure TcxCustomDBNavigator.DataSetActiveChanged; +begin + Buttons.ClearFilterCriteria; + Buttons.ReleaseBookmark; +end; + +procedure TcxCustomDBNavigator.DataSetDataChanged; +begin + Buttons.CheckBookmark; +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxDBProgressBar.pas b/official/x.35/ExpressEditors Library 5/Sources/cxDBProgressBar.pas new file mode 100644 index 00000000..7f0bbcfd --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxDBProgressBar.pas @@ -0,0 +1,155 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDBProgressBar; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Classes, Controls, Dialogs, Forms, Graphics, Messages, StdCtrls, + SysUtils, cxControls, cxDBEdit, cxEdit, cxProgressBar; + +type + { TcxDBProgressBar } + + TcxDBProgressBar = class(TcxCustomProgressBar) + private + function GetActiveProperties: TcxProgressBarProperties; + function GetDataBinding: TcxDBEditDataBinding; + function GetProperties: TcxProgressBarProperties; + procedure SetDataBinding(Value: TcxDBEditDataBinding); + procedure SetProperties(Value: TcxProgressBarProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxProgressBarProperties + read GetActiveProperties; + published + property Align; + property Anchors; + property AutoSize; + property Constraints; + property DataBinding: TcxDBEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxProgressBarProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Transparent; + property Visible; + property OnContextPopup; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +{ TcxDBProgressBar } + +class function TcxDBProgressBar.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxProgressBarProperties; +end; + +class function TcxDBProgressBar.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBEditDataBinding; +end; + +function TcxDBProgressBar.GetActiveProperties: TcxProgressBarProperties; +begin + Result := TcxProgressBarProperties(InternalGetActiveProperties); +end; + +function TcxDBProgressBar.GetDataBinding: TcxDBEditDataBinding; +begin + Result := TcxDBEditDataBinding(FDataBinding); +end; + +function TcxDBProgressBar.GetProperties: TcxProgressBarProperties; +begin + Result := TcxProgressBarProperties(FProperties); +end; + +procedure TcxDBProgressBar.SetDataBinding(Value: TcxDBEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBProgressBar.SetProperties(Value: TcxProgressBarProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBProgressBar.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxDBRichEdit.pas b/official/x.35/ExpressEditors Library 5/Sources/cxDBRichEdit.pas new file mode 100644 index 00000000..46c35a20 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxDBRichEdit.pas @@ -0,0 +1,178 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDBRichEdit; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, Controls, Graphics, Messages, cxDBEdit, cxEdit, cxRichEdit; + +type + TcxDBRichEditDataBinding = class(TcxDBTextEditDataBinding) + protected + procedure UpdateData; override; + end; + + TcxDBRichEdit = class(TcxCustomRichEdit) + private + function GetActiveProperties: TcxRichEditProperties; + function GetDataBinding: TcxDBRichEditDataBinding; + function GetProperties: TcxRichEditProperties; + procedure SetDataBinding(Value: TcxDBRichEditDataBinding); + procedure SetProperties(Value: TcxRichEditProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + procedure EditingChanged; override; + class function GetDataBindingClass: TcxEditDataBindingClass; override; + function RealReadOnly: Boolean; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxRichEditProperties read GetActiveProperties; + published + property Align; + property Anchors; + property Constraints; + property DataBinding: TcxDBRichEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxRichEditProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnMouseWheel; + property OnMouseWheelDown; + property OnMouseWheelUp; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +{ TcxDBRichEdit } + +class function TcxDBRichEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxRichEditProperties; +end; + +procedure TcxDBRichEdit.EditingChanged; +begin + UpdateInnerEditReadOnly; +end; + +class function TcxDBRichEdit.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBRichEditDataBinding; +end; + +function TcxDBRichEdit.RealReadOnly: Boolean; +begin + Result := inherited RealReadOnly or not DataBinding.Editing; +end; + +function TcxDBRichEdit.GetActiveProperties: TcxRichEditProperties; +begin + Result := TcxRichEditProperties(InternalGetActiveProperties); +end; + +function TcxDBRichEdit.GetDataBinding: TcxDBRichEditDataBinding; +begin + Result := TcxDBRichEditDataBinding(FDataBinding); +end; + +function TcxDBRichEdit.GetProperties: TcxRichEditProperties; +begin + Result := TcxRichEditProperties(FProperties); +end; + +procedure TcxDBRichEdit.SetDataBinding(Value: TcxDBRichEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBRichEdit.SetProperties(Value: TcxRichEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBRichEdit.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxDBRichEditDataBinding } + +procedure TcxDBRichEditDataBinding.UpdateData; +begin + StoredValue := Edit.EditValue; +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxDBShellComboBox.pas b/official/x.35/ExpressEditors Library 5/Sources/cxDBShellComboBox.pas new file mode 100644 index 00000000..4a889b3e --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxDBShellComboBox.pas @@ -0,0 +1,159 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDBShellComboBox; + +{$I cxVer.inc} + +interface + +uses + Messages, Controls, cxDBEdit, cxEdit, cxShellComboBox; + +type + { TcxDBShellComboBox } + + TcxDBShellComboBox = class(TcxCustomShellComboBox) + private + function GetActiveProperties: TcxShellComboBoxProperties; + function GetDataBinding: TcxDBTextEditDataBinding; + function GetProperties: TcxShellComboBoxProperties; + procedure SetDataBinding(Value: TcxDBTextEditDataBinding); + procedure SetProperties(Value: TcxShellComboBoxProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxShellComboBoxProperties + read GetActiveProperties; + published + property Align; + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DataBinding: TcxDBTextEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxShellComboBoxProperties read GetProperties + write SetProperties; + property ShellListView; + property ShellTreeView; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +{ TcxDBShellComboBox } + +class function TcxDBShellComboBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxShellComboBoxProperties; +end; + +class function TcxDBShellComboBox.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBTextEditDataBinding; +end; + +function TcxDBShellComboBox.GetActiveProperties: TcxShellComboBoxProperties; +begin + Result := TcxShellComboBoxProperties(InternalGetActiveProperties); +end; + +function TcxDBShellComboBox.GetDataBinding: TcxDBTextEditDataBinding; +begin + Result := FDataBinding as TcxDBTextEditDataBinding; +end; + +function TcxDBShellComboBox.GetProperties: TcxShellComboBoxProperties; +begin + Result := TcxShellComboBoxProperties(FProperties); +end; + +procedure TcxDBShellComboBox.SetDataBinding(Value: TcxDBTextEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBShellComboBox.SetProperties(Value: TcxShellComboBoxProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBShellComboBox.CMGetDataLink(var Message: TMessage); +begin + if DataBinding <> nil then + Message.Result := Integer(DataBinding.DataLink); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxDBTrackBar.pas b/official/x.35/ExpressEditors Library 5/Sources/cxDBTrackBar.pas new file mode 100644 index 00000000..67aff383 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxDBTrackBar.pas @@ -0,0 +1,155 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDBTrackBar; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Classes, Controls, Dialogs, Forms, Graphics, Messages, StdCtrls, + SysUtils, cxControls, cxDBEdit, cxEdit, cxTrackBar; + +type + { TcxDBTrackBar } + + TcxDBTrackBar = class(TcxCustomTrackBar) + private + function GetActiveProperties: TcxTrackBarProperties; + function GetDataBinding: TcxDBEditDataBinding; + function GetProperties: TcxTrackBarProperties; + procedure SetDataBinding(Value: TcxDBEditDataBinding); + procedure SetProperties(Value: TcxTrackBarProperties); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxTrackBarProperties read GetActiveProperties; + published + property Align; + property Anchors; + property AutoSize; + property Constraints; + property DataBinding: TcxDBEditDataBinding read GetDataBinding + write SetDataBinding; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxTrackBarProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Transparent; + property Visible; + property OnContextPopup; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +{ TcxDBTrackBar } + +class function TcxDBTrackBar.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxTrackBarProperties; +end; + +class function TcxDBTrackBar.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBEditDataBinding; +end; + +function TcxDBTrackBar.GetActiveProperties: TcxTrackBarProperties; +begin + Result := TcxTrackBarProperties(InternalGetActiveProperties); +end; + +function TcxDBTrackBar.GetDataBinding: TcxDBEditDataBinding; +begin + Result := TcxDBEditDataBinding(FDataBinding); +end; + +function TcxDBTrackBar.GetProperties: TcxTrackBarProperties; +begin + Result := TcxTrackBarProperties(FProperties); +end; + +procedure TcxDBTrackBar.SetDataBinding(Value: TcxDBEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBTrackBar.SetProperties(Value: TcxTrackBarProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxDBTrackBar.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxDropDownEdit.pas b/official/x.35/ExpressEditors Library 5/Sources/cxDropDownEdit.pas new file mode 100644 index 00000000..ec6ae62c --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxDropDownEdit.pas @@ -0,0 +1,4489 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDropDownEdit; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Classes, Controls, Graphics, Forms, SysUtils, cxClasses, cxContainer, cxControls, + cxEdit, cxGraphics, cxLookAndFeelPainters, cxLookAndFeels, cxMaskEdit, + cxTextEdit, cxVariants, cxFilterControlUtils, StdCtrls; + +const + CM_POPUPCONTROLKEY = WM_DX + 50; + CM_DROPDOWNBYPASTE = WM_DX + 51; + +type + TcxEditDropDownListStyle = (lsEditFixedList, lsEditList, lsFixedList); + TcxEditCorner = (ecoTopLeft, ecoTopRight, ecoBottomLeft, ecoBottomRight); + TcxEditMouseSizingDirection = (mmdWE, mmdNS, mmdNWSE, mmdNESW, mmdNone); + + TcxCustomComboBox = class; + TcxCustomDropDownEdit = class; + + TcxCustomDrawBorderEvent = procedure(AViewInfo: TcxContainerViewInfo; ACanvas: TcxCanvas; const R: TRect; var AHandled: Boolean; + out ABorderWidth: Integer) of object; + TcxEditDrawItemEvent = procedure(AControl: TcxCustomComboBox; ACanvas: TcxCanvas; + AIndex: Integer; const ARect: TRect; AState: TOwnerDrawState) of object; + TMeasureItemEvent = procedure(AControl: TcxCustomComboBox; AIndex: Integer; + ACanvas: TcxCanvas; var AHeight: Integer) of object; + + { TcxCustomEditPopupWindowViewInfo } + + TcxCustomEditPopupWindowViewInfo = class(TcxContainerViewInfo) + private + FOnCustomDrawBorder: TcxCustomDrawBorderEvent; + protected + function DrawCustomBorder(ACanvas: TcxCanvas; const R: TRect; out ABorderWidth: Integer): Boolean; + procedure InternalPaint(ACanvas: TcxCanvas); override; + public + BorderStyle: TcxEditPopupBorderStyle; + ClientEdge: Boolean; + CloseButton: Boolean; + CloseButtonRect: TRect; + CloseButtonStyle: TcxLookAndFeelKind; + CloseButtonNativeState: Integer; + CloseButtonState: TcxButtonState; + MinSysPanelHeight: Integer; + NativeStyle: Boolean; + Painter: TcxCustomLookAndFeelPainterClass; + Shadow: Boolean; + Sizeable: Boolean; + SizeGripCorner: TcxEditCorner; + SizeGripRect: TRect; + SizeGripSizingRect: TRect; + SizingRegionBounds: TRect; + SizingOffset: Integer; + SysPanelHeight: Integer; + SysPanelStyle: Boolean; + procedure Calculate; virtual; + procedure DrawBorder(ACanvas: TcxCanvas; var R: TRect); reintroduce; virtual; + function GetBorderExtent: TRect; virtual; + function GetClientExtent: TRect; virtual; + function GetSysPanelHeight: Integer; virtual; + function IsSizingPlace(X, Y: Integer): Boolean; virtual; + property OnCustomDrawBorder: TcxCustomDrawBorderEvent read FOnCustomDrawBorder write FOnCustomDrawBorder; + end; + + { TcxCustomEditPopupWindow } + + TcxCustomEditPopupWindow = class(TcxCustomPopupWindow) + private + FLockCheckSize: Boolean; + FPopupAutoSize: Boolean; + FBorderStyle: TcxEditPopupBorderStyle; + FClientEdge: Boolean; + FCloseButton: Boolean; + FMinHeight: Integer; + FMinWidth: Integer; + FNativeStyle: Boolean; + FPopupHeight: Integer; + FPopupWidth: Integer; + FShadow: Boolean; + FShowContentWhileResize: Boolean; + FSizeable: Boolean; + FSizeFrame: TcxSizeFrame; + FSysPanelStyle: Boolean; + function GetEdit: TcxCustomDropDownEdit; + function GetMinSysPanelHeight: Integer; + function GetViewInfo: TcxCustomEditPopupWindowViewInfo; + procedure SetPopupAutoSize(Value: Boolean); + procedure SetBorderStyle(Value: TcxEditPopupBorderStyle); + procedure SetClientEdge(Value: Boolean); + procedure SetCloseButton(Value: Boolean); + procedure SetMinSysPanelHeight(Value: Integer); + procedure SetNativeStyle(Value: Boolean); + procedure SetShadow(Value: Boolean); + procedure SetSizeable(Value: Boolean); + procedure SetSysPanelStyle(Value: Boolean); + procedure CMPopupControlKey(var Message: TMessage); message CM_POPUPCONTROLKEY; + protected + function AcceptsAnySize: Boolean; override; + procedure AdjustClientRect(var Rect: TRect); override; + function CalculatePosition: TPoint; override; + procedure CalculateSize; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure DoClosed; override; + procedure DoClosing; override; + procedure ModalCloseUp; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseLeave(AControl: TControl); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure Resize; override; + procedure CalculateViewInfo; virtual; + function CanResize(var NewWidth, NewHeight: Integer): Boolean; override; + procedure DoPopupControlKey(Key: Char); virtual; + procedure DrawSizeFrame(const R: TRect); + function GetMaxVisualAreaSize: TSize; + function GetMinSize: TSize; virtual; + procedure InternalInvalidateRect(const ARect: TRect); + procedure RefreshPopupWindow; + public + constructor Create(AOwnerControl: TWinControl); override; + destructor Destroy; override; + function GetViewInfoClass: TcxContainerViewInfoClass; override; + procedure Popup(AFocusedControl: TWinControl); override; + property BorderStyle: TcxEditPopupBorderStyle read FBorderStyle write SetBorderStyle; + property ClientEdge: Boolean read FClientEdge write SetClientEdge; + property CloseButton: Boolean read FCloseButton write SetCloseButton; + property Edit: TcxCustomDropDownEdit read GetEdit; + property MinHeight: Integer read FMinHeight write FMinHeight; + property MinSize: TSize read GetMinSize; + property MinSysPanelHeight: Integer read GetMinSysPanelHeight write SetMinSysPanelHeight; + property MinWidth: Integer read FMinWidth write FMinWidth; + property NativeStyle: Boolean read FNativeStyle write SetNativeStyle; + property PopupAutoSize: Boolean read FPopupAutoSize write SetPopupAutoSize; + property PopupHeight: Integer read FPopupHeight write FPopupHeight; + property PopupWidth: Integer read FPopupWidth write FPopupWidth; + property Shadow: Boolean read FShadow write SetShadow; + property ShowContentWhileResize: Boolean read FShowContentWhileResize + write FShowContentWhileResize default False; + property Sizeable: Boolean read FSizeable write SetSizeable; + property SysPanelStyle: Boolean read FSysPanelStyle write SetSysPanelStyle; + property ViewInfo: TcxCustomEditPopupWindowViewInfo read GetViewInfo; + property OnClosed; + end; + + TcxCustomEditPopupWindowClass = class of TcxCustomEditPopupWindow; + + { TcxCustomDropDownEditProperties } + + TcxCustomDropDownEditProperties = class(TcxCustomMaskEditProperties) + private + FGlyphButtonIndex: Integer; + FImmediateDropDown: Boolean; + FImmediatePopup: Boolean; + FInternalChanging: Boolean; + FKeepArrowButtonPressedWhenDroppedDown: Boolean; + FPopupAutoSize: Boolean; + FPopupClientEdge: Boolean; + FPopupDirection: TcxPopupDirection; + FPopupHeight: Integer; + FPopupHorzAlignment: TcxPopupAlignHorz; + FPopupMinHeight: Integer; + FPopupMinWidth: Integer; + FPopupSizeable: Boolean; + FPopupSysPanelStyle: Boolean; + FPopupVertAlignment: TcxPopupAlignVert; + FPopupWidth: Integer; + FPostPopupValueOnTab: Boolean; + FOnCloseQuery: TCloseQueryEvent; + FOnCloseUp: TNotifyEvent; + FOnFinalizePopup: TNotifyEvent; + FOnInitPopup: TNotifyEvent; + FOnPopup: TNotifyEvent; + function GetButtonGlyph: TBitmap; + function GetPopupAlignment: TAlignment; + procedure SetButtonGlyph(Value: TBitmap); + procedure SetGlyphButtonIndex(Value: Integer); + procedure SetKeepArrowButtonPressedWhenDroppedDown(Value: Boolean); + procedure SetPopupAlignment(Value: TAlignment); + procedure SetPopupClientEdge(Value: Boolean); + procedure SetPopupHeight(Value: Integer); + procedure SetPopupMinHeight(Value: Integer); + procedure SetPopupMinWidth(Value: Integer); + procedure SetPopupSizeable(Value: Boolean); + procedure SetPopupSysPanelStyle(Value: Boolean); + procedure SetPopupWidth(Value: Integer); + protected + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + function IsLookupDataVisual: Boolean; override; + function DropDownButtonVisibleIndex: Integer; virtual; + function DropDownOnClick: Boolean; virtual; + function GetAlwaysPostEditValue: Boolean; virtual; + class function GetPopupWindowClass: TcxCustomEditPopupWindowClass; virtual; + function PopupWindowAcceptsAnySize: Boolean; virtual; + function PopupWindowCapturesFocus: Boolean; virtual; + property AlwaysPostEditValue: Boolean read GetAlwaysPostEditValue; + property GlyphButtonIndex: Integer read FGlyphButtonIndex write SetGlyphButtonIndex; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + procedure Changed; override; + class function GetContainerClass: TcxContainerClass; override; + // !!! + property ButtonGlyph: TBitmap read GetButtonGlyph write SetButtonGlyph; + property ImmediateDropDown: Boolean read FImmediateDropDown write FImmediateDropDown default True; + property ImmediatePopup: Boolean read FImmediatePopup write FImmediatePopup default False; + property KeepArrowButtonPressedWhenDroppedDown: Boolean + read FKeepArrowButtonPressedWhenDroppedDown + write SetKeepArrowButtonPressedWhenDroppedDown default False; + property PopupAlignment: TAlignment read GetPopupAlignment write SetPopupAlignment default taLeftJustify; + property PopupAutoSize: Boolean read FPopupAutoSize write FPopupAutoSize default True; + property PopupClientEdge: Boolean read FPopupClientEdge write SetPopupClientEdge default False; + property PopupDirection: TcxPopupDirection read FPopupDirection write FPopupDirection; + property PopupHeight: Integer read FPopupHeight write SetPopupHeight default 200; + property PopupHorzAlignment: TcxPopupAlignHorz read FPopupHorzAlignment write FPopupHorzAlignment; + property PopupMinHeight: Integer read FPopupMinHeight write SetPopupMinHeight default 100; + property PopupMinWidth: Integer read FPopupMinWidth write SetPopupMinWidth default 100; + property PopupSizeable: Boolean read FPopupSizeable write SetPopupSizeable default False; + property PopupSysPanelStyle: Boolean read FPopupSysPanelStyle write SetPopupSysPanelStyle default False; + property PopupVertAlignment: TcxPopupAlignVert read FPopupVertAlignment write FPopupVertAlignment; + property PopupWidth: Integer read FPopupWidth write SetPopupWidth default 250; + property PostPopupValueOnTab: Boolean read FPostPopupValueOnTab + write FPostPopupValueOnTab default False; + property OnCloseQuery: TCloseQueryEvent read FOnCloseQuery write FOnCloseQuery; + property OnCloseUp: TNotifyEvent read FOnCloseUp write FOnCloseUp; + property OnFinalizePopup: TNotifyEvent read FOnFinalizePopup write FOnFinalizePopup; + property OnInitPopup: TNotifyEvent read FOnInitPopup write FOnInitPopup; + property OnPopup: TNotifyEvent read FOnPopup write FOnPopup; + end; + + TcxCustomDropDownEditPropertiesClass = class of TcxCustomDropDownEditProperties; + + { TcxCustomDropDownEditViewData } + + TcxCustomDropDownEditViewData = class(TcxCustomTextEditViewData) + private + function GetProperties: TcxCustomDropDownEditProperties; + protected + function CanPressButton(AViewInfo: TcxCustomEditViewInfo; AButtonVisibleIndex: Integer): Boolean; override; + function GetEditNativeState(AViewInfo: TcxCustomEditViewInfo): Integer; override; + function IsButtonPressed(AViewInfo: TcxCustomEditViewInfo; + AButtonVisibleIndex: Integer): Boolean; override; + public + HasPopupWindow: Boolean; + IsHotAndPopup: Boolean; + KeepArrowButtonPressedWhenDroppedDown: Boolean; + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); override; + property Properties: TcxCustomDropDownEditProperties read GetProperties; + end; + + { TcxCustomDropDownEditData } + + TcxCustomDropDownEditData = class(TcxCustomEditData) + protected + Initialized: Boolean; + Width, Height: Integer; + end; + + TcxCustomDropDownEditDataClass = class of TcxCustomDropDownEditData; + + { TcxEditPopupControlLookAndFeel } + + TcxEditPopupControlLookAndFeel = class(TcxLookAndFeel) + private + function GetEdit: TcxCustomDropDownEdit; + protected + procedure EditStyleChanged; + function InternalGetKind: TcxLookAndFeelKind; override; + function InternalGetNativeStyle: Boolean; override; + function InternalGetSkinName: string; override; + + property Edit: TcxCustomDropDownEdit read GetEdit; + end; + + { TcxCustomDropDownInnerEdit } + + TcxCustomDropDownInnerEdit = class(TcxCustomInnerTextEdit) + private + function GetContainer: TcxCustomDropDownEdit; + procedure CMHintShow(var Message: TCMHintShow); message CM_HINTSHOW; + protected + property Container: TcxCustomDropDownEdit read GetContainer; + // TODO CLX + end; + + { TcxCustomDropDownEdit } + + TcxCustomDropDownEdit = class(TcxCustomMaskEdit) + private + FIsActivatingByMouse: Boolean; + FIsHotAndPopup: Boolean; + FPopupControlsLookAndFeel: TcxEditPopupControlLookAndFeel; + FPopupInitialized: Boolean; + FPopupMouseMoveLocked: Boolean; + FPopupSizeChanged: Boolean; + FPopupSizeChangedByMouse: Boolean; + FSendChildrenStyle: Boolean; + procedure DropDownByPasteHandler; + function GetDroppedDown: Boolean; + function GetProperties: TcxCustomDropDownEditProperties; + function GetActiveProperties: TcxCustomDropDownEditProperties; + procedure SetDroppedDown(Value: Boolean); + procedure SetProperties(Value: TcxCustomDropDownEditProperties); + procedure CMBiDiModeChanged(var Message: TMessage); message CM_BIDIMODECHANGED; + procedure CMDropDownByPaste(var Message: TMessage); message CM_DROPDOWNBYPASTE; + procedure CMHintShow(var Message: TCMHintShow); message CM_HINTSHOW; + protected + FCloseUpReason: TcxEditCloseUpReason; + FPopupWindow: TcxCustomEditPopupWindow; + procedure ContainerStyleChanged(Sender: TObject); override; + function CreateViewData: TcxCustomEditViewData; override; + procedure DestroyWnd; override; + procedure DoButtonDown(AButtonVisibleIndex: Integer); override; + procedure DoExit; override; + procedure DoEditKeyDown(var Key: Word; Shift: TShiftState); override; + procedure DoEditKeyPress(var Key: Char); override; + procedure DoEditProcessTab(Shift: TShiftState); override; + function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; override; + procedure FocusChanged; override; + function GetEditDataClass: TcxCustomEditDataClass; override; + function GetInnerEditClass: TControlClass; override; + function GetScrollLookupDataList(AScrollCause: TcxEditScrollCause): Boolean; override; + procedure Initialize; override; + procedure InitializeEditData; override; + function InternalGetNotPublishedStyleValues: TcxEditStyleValues; override; + function IsEditorKey(Key: Word; Shift: TShiftState): Boolean; override; + procedure PropertiesChanged(Sender: TObject); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + function RefreshContainer(const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AIsMouseEvent: Boolean): Boolean; override; + function SendActivationKey(Key: Char): Boolean; override; + function TabsNeeded: Boolean; override; + procedure CreateHandle; override; + procedure DoStartDock(var DragObject: TDragObject); override; + function CanDropDown: Boolean; virtual; + procedure CloseUp(AReason: TcxEditCloseUpReason); virtual; + procedure CreatePopupWindow; virtual; + procedure DeleteShowPopupWindowMessages; + procedure DoCloseQuery(var CanClose: Boolean); + procedure DoCloseUp; virtual; + procedure DoFinalizePopup; virtual; + procedure DoInitPopup; virtual; + procedure DoPopup; virtual; + procedure DropDown; virtual; + procedure EditButtonClick; virtual; + function GetPopupFocusedControl: TWinControl; virtual; + function GetPopupWindowClientPreferredSize: TSize; virtual; abstract; + function GetPopupWindowOwnerControlBounds: TRect; + procedure InitializeLookupData; virtual; + procedure InitializePopupWindow; virtual; + procedure PopupControlsLookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); virtual; + procedure PopupWindowClosed(Sender: TObject); dynamic; + procedure PopupWindowCloseQuery(Sender: TObject; var CanClose: Boolean); dynamic; + procedure PopupWindowClosing(Sender: TObject); dynamic; + procedure PopupWindowShowing(Sender: TObject); dynamic; + procedure PopupWindowShowed(Sender: TObject); dynamic; + procedure PositionPopupWindowChilds(const AClientRect: TRect); virtual; + procedure SetIsHotAndPopup; + procedure SetupPopupWindow; virtual; + procedure UpdatePopupWindow; + property IsHotAndPopup: Boolean read FIsHotAndPopup; + property PopupControlsLookAndFeel: TcxEditPopupControlLookAndFeel + read FPopupControlsLookAndFeel; + property PopupMouseMoveLocked: Boolean read FPopupMouseMoveLocked write FPopupMouseMoveLocked; + property PopupSizeChanged: Boolean read FPopupSizeChanged; + property SendChildrenStyle: Boolean read FSendChildrenStyle write FSendChildrenStyle; + public + destructor Destroy; override; + procedure Activate(var AEditData: TcxCustomEditData); override; + procedure ActivateByKey(Key: Char; var AEditData: TcxCustomEditData); override; + procedure ActivateByMouse(Shift: TShiftState; X, Y: Integer; + var AEditData: TcxCustomEditData); override; + procedure BeforeDestruction; override; + function Deactivate: Boolean; override; + function Focused: Boolean; override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + function HasPopupWindow: Boolean; override; + procedure PasteFromClipboard; override; + function CanHide: Boolean; virtual; + property ActiveProperties: TcxCustomDropDownEditProperties + read GetActiveProperties; + property DroppedDown: Boolean read GetDroppedDown write SetDroppedDown; + property PopupWindow: TcxCustomEditPopupWindow read FPopupWindow; + property Properties: TcxCustomDropDownEditProperties read GetProperties + write SetProperties; + end; + + { TcxFilterDropDownEditHelper } + + TcxFilterDropDownEditHelper = class(TcxFilterMaskEditHelper) + public + class function EditPropertiesHasButtons: Boolean; override; + end; + + { TcxComboBoxPopupWindow } + + TcxComboBoxPopupWindow = class(TcxCustomEditPopupWindow) + protected + procedure CalculateSize; override; + end; + + { TcxCustomComboBoxListBox } + + TcxCustomComboBoxListBox = class(TcxCustomEditListBox) + private + function GetEdit: TcxCustomComboBox; + protected + procedure CreateParams(var Params: TCreateParams); override; + function DoDrawItem(AIndex: Integer; const ARect: TRect; + AState: TOwnerDrawState): Boolean; override; + function GetItem(Index: Integer): string; override; + procedure MeasureItem(Index: Integer; var Height: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure RecreateWindow; override; + property Edit: TcxCustomComboBox read GetEdit; + public + constructor Create(AOwner: TComponent); override; + function GetHeight(ARowCount: Integer; AMaxHeight: Integer): Integer; override; + end; + + { TcxComboBoxListBox } + + TcxComboBoxListBox = class(TcxCustomComboBoxListBox) + protected + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure RecreateWindow; override; + procedure SetItemIndex(const Value: Integer); override; + procedure Resize; override; + public + function GetItemHeight(AIndex: Integer = -1): Integer; override; + end; + + { TcxComboBoxLookupData } + + TcxComboBoxLookupData = class(TcxCustomTextEditLookupData) + protected + function GetListBoxClass: TcxCustomEditListBoxClass; override; + public + function CanResizeVisualArea(var NewSize: TSize; + AMaxHeight: Integer = 0; AMaxWidth: Integer = 0): Boolean; override; + function GetVisualAreaPreferredSize(AMaxHeight: Integer; AWidth: Integer = 0): TSize; override; + procedure Initialize(AVisualControlsParent: TWinControl); override; + end; + + { TcxCustomComboBoxViewData } + + TcxCustomComboBoxProperties = class; + + TcxCustomComboBoxViewData = class(TcxCustomDropDownEditViewData) + private + function GetProperties: TcxCustomComboBoxProperties; + protected + function IsComboBoxStyle: Boolean; override; + public + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); override; + procedure EditValueToDrawValue(ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + AViewInfo: TcxCustomEditViewInfo); override; + property Properties: TcxCustomComboBoxProperties read GetProperties; + end; + + { TcxCustomTextEditViewInfo } + + TcxCustomComboBoxViewInfo = class(TcxCustomTextEditViewInfo) + private + function GetEdit: TcxCustomComboBox; + protected + procedure DoCustomDraw(ACanvas: TcxCanvas; ARect: TRect); virtual; + public + ItemIndex: Integer; + constructor Create; override; + property Edit: TcxCustomComboBox read GetEdit; + end; + + { TcxCustomComboBoxProperties } + + TcxCustomComboBoxProperties = class(TcxCustomDropDownEditProperties) + private + FDropDownListStyle: TcxEditDropDownListStyle; + FDropDownRows: Integer; + FItemHeight: Integer; + FRevertable: Boolean; + FOnDrawItem: TcxEditDrawItemEvent; + FOnMeasureItem: TMeasureItemEvent; + function GetDropDownAutoWidth: Boolean; + function GetDropDownSizeable: Boolean; + function GetDropDownWidth: Integer; + function GetItems: TStrings; + function GetSorted: Boolean; + procedure SetDropDownAutoWidth(Value: Boolean); + procedure SetDropDownListStyle(Value: TcxEditDropDownListStyle); + procedure SetDropDownRows(Value: Integer); + procedure SetDropDownSizeable(Value: Boolean); + procedure SetDropDownWidth(Value: Integer); + procedure SetItemHeight(Value: Integer); + procedure SetItems(Value: TStrings); + procedure SetSorted(Value: Boolean); + protected + function DropDownOnClick: Boolean; override; + function GetDropDownPageRowCount: Integer; override; + function GetEditingStyle: TcxEditEditingStyle; override; + class function GetLookupDataClass: TcxInterfacedPersistentClass; override; + class function GetPopupWindowClass: TcxCustomEditPopupWindowClass; override; + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + function UseLookupData: Boolean; override; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + class function GetContainerClass: TcxContainerClass; override; + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + // !!! + property DropDownAutoWidth: Boolean read GetDropDownAutoWidth + write SetDropDownAutoWidth default True; + property DropDownListStyle: TcxEditDropDownListStyle read FDropDownListStyle + write SetDropDownListStyle default lsEditList; + property DropDownRows: Integer read FDropDownRows write SetDropDownRows + default cxEditDefaultDropDownPageRowCount; + property DropDownSizeable: Boolean read GetDropDownSizeable + write SetDropDownSizeable default False; + property DropDownWidth: Integer read GetDropDownWidth write SetDropDownWidth + default 0; + property ItemHeight: Integer read FItemHeight write SetItemHeight default 0; + property Items: TStrings read GetItems write SetItems; + property Revertable: Boolean read FRevertable write FRevertable default False; + property Sorted: Boolean read GetSorted write SetSorted default False; + property OnDrawItem: TcxEditDrawItemEvent read FOnDrawItem write FOnDrawItem; + property OnMeasureItem: TMeasureItemEvent read FOnMeasureItem write FOnMeasureItem; + end; + + { TcxComboBoxProperties } + + TcxComboBoxProperties = class(TcxCustomComboBoxProperties) + published + property Alignment; + property AssignedValues; + property AutoSelect; + property BeepOnError; + property ButtonGlyph; + property CaseInsensitive; + property CharCase; + property ClearKey; + property DropDownAutoWidth; + property DropDownListStyle; + property DropDownRows; + property DropDownSizeable; + property DropDownWidth; + property HideSelection; + property IgnoreMaskBlank; + property ImeMode; + property ImeName; + property ImmediateDropDown; + property ImmediatePost; + property ImmediateUpdateText; + property IncrementalSearch; + property ItemHeight; + property Items; + property MaskKind; + property EditMask; + property MaxLength; + property OEMConvert; + property PopupAlignment; + property PostPopupValueOnTab; + property ReadOnly; + property Revertable; + property Sorted; + property UseLeftAlignmentOnEditing; + property ValidateOnEnter; + property OnChange; + property OnCloseUp; + property OnDrawItem; + property OnEditValueChanged; + property OnInitPopup; + property OnMeasureItem; + property OnNewLookupDisplayText; + property OnPopup; + property OnValidate; + end; + + { TcxCustomComboBoxInnerEdit } + + TcxCustomComboBoxInnerEdit = class(TcxCustomDropDownInnerEdit) + private + procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; + protected + end; + + { TcxCustomComboBox } + + TcxCustomComboBox = class(TcxCustomDropDownEdit) + private + function GetActiveProperties: TcxCustomComboBoxProperties; + function GetLookupData: TcxComboBoxLookupData; + function GetProperties: TcxCustomComboBoxProperties; + function GetSelectedItem: Integer; + procedure SetProperties(Value: TcxCustomComboBoxProperties); + procedure SetSelectedItem(Value: Integer); + procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; + protected + function CanDropDown: Boolean; override; + procedure ChangeHandler(Sender: TObject); override; + procedure DblClick; override; + procedure DoFocusChanged; override; + function GetInnerEditClass: TControlClass; override; + function GetPopupWindowClientPreferredSize: TSize; override; + procedure Initialize; override; + procedure InitializePopupWindow; override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure PopupWindowShowed(Sender: TObject); override; + procedure SetupPopupWindow; override; + function CanSynchronizeLookupData: Boolean; + procedure ResetPopupHeight; + procedure SynchronizeItemIndex; + procedure DoOnDrawItem(ACanvas: TcxCanvas; AIndex: Integer; + const ARect: TRect; AState: TOwnerDrawState); + procedure DoOnMeasureItem(AIndex: Integer; ACanvas: TcxCanvas; + var AHeight: Integer); + function IsOnDrawItemEventAssigned: Boolean; + function IsOnMeasureItemEventAssigned: Boolean; + property LookupData: TcxComboBoxLookupData read GetLookupData; + public + procedure Activate(var AEditData: TcxCustomEditData); override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxCustomComboBoxProperties read GetActiveProperties; + property ItemIndex; + property ItemObject; + property Properties: TcxCustomComboBoxProperties read GetProperties + write SetProperties; + property SelectedItem: Integer read GetSelectedItem write SetSelectedItem; + end; + + { TcxComboBox } + + TcxComboBox = class(TcxCustomComboBox) + private + function GetActiveProperties: TcxComboBoxProperties; + function GetProperties: TcxComboBoxProperties; + procedure SetProperties(Value: TcxComboBoxProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxComboBoxProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ItemIndex; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxComboBoxProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Text; + property Visible; + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + + { TcxFilterComboBoxHelper } + + TcxFilterComboBoxHelper = class(TcxFilterDropDownEditHelper) + public + class function GetFilterEditClass: TcxCustomEditClass; override; + class procedure InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); override; + end; + + { TcxPopupEditPopupWindowViewInfo } + + TcxPopupEditPopupWindowViewInfo = class(TcxCustomEditPopupWindowViewInfo) + public + procedure DrawBorder(ACanvas: TcxCanvas; var R: TRect); override; + end; + + { TcxPopupEditPopupWindow } + + TcxPopupEditPopupWindow = class(TcxCustomEditPopupWindow) + public + function GetViewInfoClass: TcxContainerViewInfoClass; override; + end; + + { TcxCustomPopupEditProperties } + + TcxCustomPopupEditProperties = class(TcxCustomDropDownEditProperties) + private + FPopupControl: TControl; + procedure SetPopupControl(Value: TControl); + protected + procedure FreeNotification(Sender: TComponent); override; + class function GetPopupWindowClass: TcxCustomEditPopupWindowClass; override; + function IsLookupDataVisual: Boolean; override; + function PopupWindowCapturesFocus: Boolean; override; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + class function GetContainerClass: TcxContainerClass; override; + // !!! + property PopupControl: TControl read FPopupControl write SetPopupControl; + property PopupSizeable default True; + end; + + { TcxPopupEditProperties } + + TcxPopupEditProperties = class(TcxCustomPopupEditProperties) + public + constructor Create(AOwner: TPersistent); override; + published + property Alignment; + property AssignedValues; + property AutoSelect; + property BeepOnError; + property ButtonGlyph; + property CaseInsensitive; + property CharCase; + property ClearKey; + property EchoMode; + property HideSelection; + property IgnoreMaskBlank; + property ImeMode; + property ImeName; + property ImmediateDropDown; + property ImmediatePopup default True; + property IncrementalSearch; + property LookupItems; + property LookupItemsSorted; + property MaxLength; + property MaskKind; + property EditMask; + property OEMConvert; + property PasswordChar; + property PopupAlignment; + property PopupAutoSize; + property PopupClientEdge; + property PopupControl; + property PopupHeight; + property PopupMinHeight; + property PopupMinWidth; + property PopupSizeable; + property PopupSysPanelStyle; + property PopupWidth; + property ReadOnly; + property UseLeftAlignmentOnEditing; + property ValidateOnEnter; + property OnChange; + property OnCloseQuery; + property OnCloseUp; + property OnEditValueChanged; + property OnInitPopup; + property OnPopup; + property OnValidate; + end; + + { TcxCustomPopupEdit } + + TcxPrevPopupControlData = record + Align: TAlign; + Bounds: TRect; + Parent: TWinControl; + Visible: Boolean; + BorderStyle: TFormBorderStyle; + end; + + TcxCustomPopupEdit = class(TcxCustomDropDownEdit) + private + FPrevPopupControlData: TcxPrevPopupControlData; + function GetProperties: TcxCustomPopupEditProperties; + function GetActiveProperties: TcxCustomPopupEditProperties; + procedure SetProperties(Value: TcxCustomPopupEditProperties); + protected + function CanDropDown: Boolean; override; + procedure DoInitPopup; override; + function GetPopupFocusedControl: TWinControl; override; + function GetPopupWindowClientPreferredSize: TSize; override; + procedure PopupWindowClosed(Sender: TObject); override; + procedure PositionPopupWindowChilds(const AClientRect: TRect); override; + procedure SetupPopupWindow; override; + procedure HidePopup(Sender: TcxControl; AReason: TcxEditCloseUpReason); virtual; + procedure RestorePopupControlData; virtual; + procedure SavePopupControlData; virtual; + public + destructor Destroy; override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxCustomPopupEditProperties read GetActiveProperties; + property Properties: TcxCustomPopupEditProperties read GetProperties + write SetProperties; + end; + + { TcxPopupEdit } + + TcxPopupEdit = class(TcxCustomPopupEdit) + private + function GetActiveProperties: TcxPopupEditProperties; + function GetProperties: TcxPopupEditProperties; + procedure SetProperties(Value: TcxPopupEditProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxPopupEditProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DragMode; + property Enabled; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxPopupEditProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Text; + property Visible; + property DragCursor; + property DragKind; + property ImeMode; + property ImeName; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDrag; + property OnEndDock; + property OnStartDock; + end; + +implementation + +uses + Math, dxThemeConsts, dxThemeManager, dxUxTheme, cxEditConsts, cxEditPaintUtils, + cxEditUtils, cxScrollBar, cxGeometry, cxDWMApi; + +const + + cxEditMouseSizingCursorMap: array[-1 .. 1, -1 .. 1] of TCursor = ( + (crSizeNWSE, crSizeWE, crSizeNESW), + (crSizeNS, crDefault, crSizeNS), + (crSizeNESW, crSizeWE, crSizeNWSE) + ); + + cxEditPopupClientEdgeWidthA: array[TcxEditPopupBorderStyle] of Integer = (0, 2, 2, 1); + cxEditPopupWindowFrameWidthA: array[TcxEditPopupBorderStyle] of Integer = (0, 1, 4, 2); + + CloseButtonNativeStateMap: array [TcxButtonState] of Integer = + (TC_NONE, CBS_NORMAL, CBS_HOT, CBS_PUSHED, CBS_DISABLED); + +type + TcxCustomEditStyleAccess = class(TcxCustomEditStyle); + TControlAccess = class(TControl); + TCustomFormAccess = class(TCustomForm); + TWinControlAccess = class(TWinControl); + +var + FCapturePointOffset: TSize; + FHorzFlag, FVertFlag: Integer; + FSizeFrameBounds: TRect = (Left: 0; Top: 0; Right: 0; Bottom: 0); + FPaintedSizeFrameBounds: TRect = (Left: 0; Top: 0; Right: 0; Bottom: 0); + FSizingCapture: Boolean = False; + FSizingMouseMovement: Boolean = False; + +procedure CheckBounds(const AOuterRect: TRect; var AInnerRect: TRect); +begin + if AInnerRect.Left < AOuterRect.Left then + AInnerRect.Left := AOuterRect.Left; + if AInnerRect.Top < AOuterRect.Top then + AInnerRect.Top := AOuterRect.Top; + if AInnerRect.Right > AOuterRect.Right then + AInnerRect.Right := AOuterRect.Right; + if AInnerRect.Bottom > AOuterRect.Bottom then + AInnerRect.Bottom := AOuterRect.Bottom; +end; + +function GetEditPopupWindowSysPanelDefaultHeight(AViewInfo: TcxCustomEditPopupWindowViewInfo): Integer; +var + ATheme: TdxTheme; + ACloseButtonSize: TSize; + ASizeGripSize: TSize; +begin + ACloseButtonSize.cy := 0; + ASizeGripSize.cy := 0; + with AViewInfo do + if SysPanelStyle and AreVisualStylesMustBeUsed(NativeStyle, totWindow) then + begin + ATheme := OpenTheme(totWindow); + GetThemePartSize(ATheme, 0, WP_CLOSEBUTTON, CBS_NORMAL, TS_TRUE, + ACloseButtonSize); + ATheme := OpenTheme(totScrollBar); + GetThemePartSize(ATheme, 0, SBP_SIZEBOX, SZB_RIGHTALIGN, TS_TRUE, + ASizeGripSize); + end; + + Result := GetSystemMetrics(SM_CYHSCROLL); + if Result < GetSystemMetrics(SM_CYSIZE) then + Result := GetSystemMetrics(SM_CYSIZE); + if Result < ACloseButtonSize.cy then + Result := ACloseButtonSize.cy; + if Result < ASizeGripSize.cy then + Result := ASizeGripSize.cy; +end; + +function GetEditPopupWindowClientEdgeWidth(AViewInfo: TcxCustomEditPopupWindowViewInfo): Integer; +begin + with AViewInfo do + if ClientEdge then + if NativeStyle or (Painter <> nil) then + Result := 2 + else + Result := cxEditPopupClientEdgeWidthA[BorderStyle] + else + Result := 0; +end; + +function GetEditPopupWindowBorderWidth(AViewInfo: TcxCustomEditPopupWindowViewInfo; AIncludeClientEdge: Boolean): Integer; +begin + with AViewInfo do + begin + if not DrawCustomBorder(nil, cxEmptyRect, Result) then + if NativeStyle or (Painter <> nil) then + Result := 1 + else + Result := cxEditPopupWindowFrameWidthA[BorderStyle]; + if ClientEdge and AIncludeClientEdge then + Inc(Result, GetEditPopupWindowClientEdgeWidth(AViewInfo)); + end; +end; + +function GetEditPopupWindowFrameExtent(AViewInfo: TcxCustomEditPopupWindowViewInfo): TRect; +var + AOffset: Integer; +begin + with AViewInfo do + begin + AOffset := GetEditPopupWindowBorderWidth(AViewInfo, True); + Result := Rect(AOffset, AOffset, AOffset, AOffset); + + if Shadow then + begin + Inc(Result.Right, cxEditShadowWidth); + Inc(Result.Bottom, cxEditShadowWidth); + end; + + if SysPanelStyle then + begin + SysPanelHeight := GetSysPanelHeight; + AOffset := SysPanelHeight; + if NativeStyle or (BorderStyle = epbsSingle) or (Painter <> nil) then + Inc(AOffset); + if SizeGripCorner in [ecoBottomLeft, ecoBottomRight] then + Inc(Result.Bottom, AOffset) + else + Inc(Result.Top, AOffset); + end + else + SysPanelHeight := 0; + + SizingOffset := GetSystemMetrics(SM_CYHSCROLL); + if SizingOffset < GetSystemMetrics(SM_CYSIZE) then + SizingOffset := GetSystemMetrics(SM_CYSIZE); + end; +end; + +procedure CalculateEditPopupWindowViewInfo(AViewInfo: TcxCustomEditPopupWindowViewInfo); + + procedure CalculateSizeGripRect; + var + R: TRect; + ASizeGripSizingRegionSize: TSize; + ASizeGripSize: TSize; + ATheme: TdxTheme; + begin + with AViewInfo do + begin + R := SizingRegionBounds; + ASizeGripSizingRegionSize.cx := GetEditPopupWindowSysPanelDefaultHeight(AViewInfo) - 2; + ASizeGripSizingRegionSize.cy := ASizeGripSizingRegionSize.cx; + + if AreVisualStylesMustBeUsed(NativeStyle, totScrollBar) then + begin + ATheme := OpenTheme(totScrollBar); + GetThemePartSize(ATheme, 0, SBP_SIZEBOX, SZB_RIGHTALIGN, TS_TRUE, + ASizeGripSize); + ASizeGripSize.cx := ASizeGripSize.cx + 2; + ASizeGripSize.cy := ASizeGripSize.cy + 2; + if ASizeGripSizingRegionSize.cx < ASizeGripSize.cx then + ASizeGripSizingRegionSize.cx := ASizeGripSize.cx; + if ASizeGripSizingRegionSize.cy < ASizeGripSize.cy then + ASizeGripSizingRegionSize.cy := ASizeGripSize.cy; + end; + + if SizeGripCorner in [ecoTopLeft, ecoBottomLeft] then + R.Right := R.Left + ASizeGripSizingRegionSize.cx + else + R.Left := R.Right - ASizeGripSizingRegionSize.cx; + if SizeGripCorner in [ecoTopLeft, ecoTopRight] then + R.Bottom := R.Top + ASizeGripSizingRegionSize.cy + else + R.Top := R.Bottom - ASizeGripSizingRegionSize.cy; + SizeGripSizingRect := R; + + if SizeGripCorner in [ecoTopLeft, ecoBottomLeft] then + Inc(R.Left, 2) + else + Dec(R.Right, 2); + if SizeGripCorner in [ecoTopLeft, ecoTopRight] then + Inc(R.Top, 2) + else + Dec(R.Bottom, 2); + SizeGripRect := R; + end; + end; + + procedure CalculateCloseButtonRect; + var + R: TRect; + ACloseButtonSize: TSize; + ATheme: TdxTheme; + begin + with AViewInfo do + if CloseButton then + begin + R := SizingRegionBounds; + + if CloseButtonNativeState <> TC_NONE then + begin + ATheme := OpenTheme(totWindow); + GetThemePartSize(ATheme, 0, WP_CLOSEBUTTON, CBS_NORMAL, TS_TRUE, + ACloseButtonSize); + end + else + begin + ACloseButtonSize.cy := GetEditPopupWindowSysPanelDefaultHeight(AViewInfo) - 4; + ACloseButtonSize.cx := ACloseButtonSize.cy; + end; + + if CloseButtonNativeState = TC_NONE then + if SizeGripCorner in [ecoTopLeft, ecoBottomLeft] then + Dec(R.Right, 2) + else + Inc(R.Left, 2); + + if SizeGripCorner in [ecoTopLeft, ecoBottomLeft] then + begin + R.Left := R.Right - ACloseButtonSize.cx; + OffsetRect(R, -1, 0); + end else + begin + R.Right := R.Left + ACloseButtonSize.cx; + OffsetRect(R, 1, 0); + end; + + if CloseButtonNativeState <> TC_NONE then + if SizeGripCorner in [ecoTopLeft, ecoTopRight] then + begin + Inc(R.Top, (SysPanelHeight - ACloseButtonSize.cy) div 2); + R.Bottom := R.Top + ACloseButtonSize.cy; + end else + begin + Dec(R.Bottom, (SysPanelHeight - ACloseButtonSize.cy) div 2); + R.Top := R.Bottom - ACloseButtonSize.cy; + end + else + if SizeGripCorner in [ecoTopLeft, ecoTopRight] then + begin + Inc(R.Top, 2); + R.Bottom := R.Top + ACloseButtonSize.cy; + end else + begin + Dec(R.Bottom, 2); + R.Top := R.Bottom - ACloseButtonSize.cy; + end; + CloseButtonRect := R; + end + else + CloseButtonRect := cxEmptyRect; + end; + +var + AClientExtent: TRect; + ASizingFrameWidth: Integer; +begin + with AViewInfo do + begin + AClientExtent := GetEditPopupWindowFrameExtent(AViewInfo); + ClientRect := Bounds; + OffsetRect(ClientRect, -Bounds.Left, -Bounds.Top); + SizingRegionBounds := ClientRect; + ExtendRect(ClientRect, AClientExtent); + + ASizingFrameWidth := GetEditPopupWindowBorderWidth(AViewInfo, not SysPanelStyle); + InflateRect(SizingRegionBounds, -ASizingFrameWidth, -ASizingFrameWidth); + if Shadow then + begin + Dec(SizingRegionBounds.Bottom, cxEditShadowWidth); + Dec(SizingRegionBounds.Right, cxEditShadowWidth); + end; + + if SysPanelStyle and AreVisualStylesMustBeUsed(NativeStyle, totWindow) then + CloseButtonNativeState := CloseButtonNativeStateMap[CloseButtonState] + else + CloseButtonNativeState := TC_NONE; + + if SysPanelStyle then + begin + if Sizeable then + CalculateSizeGripRect; + CalculateCloseButtonRect; + end; + end; +end; + +procedure DrawEditPopupCloseButton(ACanvas: TcxCanvas; AViewInfo: TcxCustomEditPopupWindowViewInfo); +const + ACloseButtonSize = 11; + AStates: array[Boolean] of Longint = (0, DFCS_PUSHED); +var + R: TRect; + APainterClass: TcxCustomLookAndFeelPainterClass; + ATheme: TdxTheme; +begin + with AViewInfo do + begin + R := AViewInfo.CloseButtonRect; + if Painter <> nil then + begin + Painter.DrawWindowContent(ACanvas, R); + Painter.DrawEditorButton(ACanvas, R, cxbkCloseBtn, CloseButtonState); + end + else + begin + APainterClass := GetPainterClass(NativeStyle, CloseButtonStyle); + if CloseButtonNativeState <> TC_NONE then + begin + ATheme := OpenTheme(totWindow); + CloseButtonNativeState := CloseButtonNativeStateMap[CloseButtonState]; + if IsThemeBackgroundPartiallyTransparent(ATheme, WP_CLOSEBUTTON, CloseButtonNativeState) then + begin + ACanvas.Brush.Color := clBtnFace; + ACanvas.FillRect(R); + end; + DrawThemeBackground(ATheme, ACanvas.Handle, WP_CLOSEBUTTON, CloseButtonNativeState, R); + ACanvas.ExcludeClipRect(R); + end + else + APainterClass.DrawFilterCloseButton(ACanvas, R, CloseButtonState); + end; + end; +end; + +procedure DrawEditPopupWindowBorder(ACanvas: TcxCanvas; AViewInfo: TcxCustomEditPopupWindowViewInfo; + var R: TRect); +var + ABorderWidth: Integer; +begin + with AViewInfo do + if DrawCustomBorder(ACanvas, R, ABorderWidth) then + InflateRect(R, -ABorderWidth, -ABorderWidth) + else + begin + if NativeStyle then + if IsCompositionEnabled then + DrawThemeBackground(OpenTheme(totListBox), ACanvas.Handle, LBCP_BORDER_NOSCROLL, LBPSN_HOT, R) + else + ACanvas.FrameRect(R, clBtnText) + else + if Painter <> nil then + ACanvas.FrameRect(R, Painter.GetContainerBorderColor(False)) + else + case BorderStyle of + epbsSingle: + ACanvas.FrameRect(R, clBtnText); + epbsFrame3D, epbsFlat: + begin + ACanvas.DrawEdge(R, False, True); + InflateRect(R, -1, -1); + ACanvas.DrawEdge(R, False, False); + if BorderStyle = epbsFrame3D then + begin + InflateRect(R, -1, -1); + if ClientEdge then + ACanvas.FrameRect(R, clInactiveBorder) + else + ACanvas.FrameRect(R, clBtnFace); + InflateRect(R, -1, -1); + if ClientEdge then + ACanvas.FrameRect(R, clBtnFace) + else + ACanvas.DrawEdge(R, True, True); + end; + end; + end; + InflateRect(R, -1, -1); + end; +end; + +procedure DrawSizeGrip(ACanvas: TcxCanvas; const ARect: TRect; + ACorner: TcxEditCorner; ANativeStyle: Boolean; + APainter: TcxCustomLookAndFeelPainterClass; AIsTransparent: Boolean = False); +var + DX, DY: Integer; + X, X0, Y, Y0: Integer; + R: TRect; + + procedure DrawTouch(AColor: TColor); + begin + InternalPolyLine(ACanvas, [Point(X, Y0), Point(X0, Y)], AColor, False); + Inc(X, DX); + Inc(Y, DY); + end; + +const + Offset = 2; + RotateAngleMap: array [TcxEditCorner] of TcxRotationAngle = (ra180, raPlus90, raMinus90, ra0); +var + AMirrorX, AMirrorY: Boolean; + ATempRect: TRect; + AScrollBarSize: TSize; + I, J, L: Integer; + APrevBitmap: HBITMAP; + ATheme: TdxTheme; + MDC: HDC; + R1: TRect; + ABitmap: TcxCustomBitmap; +begin + if not AIsTransparent then + begin + ACanvas.Brush.Color := clBtnFace; + ACanvas.FillRect(ARect); + end; + if APainter <> nil then + begin + ABitmap := TcxCustomBitmap.CreateSize(ARect); + try + APainter.DrawWindowContent(ABitmap.cxCanvas, ABitmap.ClientRect); + APainter.DrawSizeGrip(ABitmap.cxCanvas, ABitmap.ClientRect); + ABitmap.Rotate(RotateAngleMap[ACorner]); + ACanvas.CopyRect(ARect, ABitmap.Canvas, ABitmap.ClientRect); + finally + ABitmap.Free; + end; + Exit; + end; + if ANativeStyle then + begin + ATheme := OpenTheme(totScrollBar); + GetThemePartSize(ATheme, ACanvas.Handle, SBP_SIZEBOX, SZB_RIGHTALIGN, + TS_TRUE, AScrollBarSize); + AScrollBarSize.cx := AScrollBarSize.cx + Offset; + AScrollBarSize.cy := AScrollBarSize.cy + Offset; + end else + begin + AScrollBarSize.cx := GetSystemMetrics(SM_CXVSCROLL); + AScrollBarSize.cy := GetSystemMetrics(SM_CYHSCROLL); + end; + ATempRect := ARect; + with ATempRect do + begin + if ACorner in [ecoTopRight, ecoBottomRight] then + Left := Right - AScrollBarSize.cx + else + Right := Left + AScrollBarSize.cx; + if ACorner in [ecoBottomLeft, ecoBottomRight] then + Top := Bottom - AScrollBarSize.cy + else + Bottom := Top + AScrollBarSize.cy; + AMirrorX := ACorner in [ecoTopLeft, ecoBottomLeft]; + AMirrorY := ACorner in [ecoTopLeft, ecoTopRight]; + end; + R := ATempRect; + with R do + begin + if AMirrorX then + begin + Dec(Right, Offset); + end + else + begin + Inc(Left, Offset); + end; + if AMirrorY then + begin + Dec(Bottom, Offset); + end + else + begin + Inc(Top, Offset); + end; + end; + + if ANativeStyle or not AIsTransparent then + begin + X := R.Left; + Y := R.Top; + OffsetRect(R, -R.Left, -R.Top); + MDC := CreateCompatibleDC(ACanvas.Handle); + APrevBitmap := SelectObject(MDC, CreateCompatibleBitmap(ACanvas.Handle, R.Right, R.Bottom)); + if AIsTransparent then + begin + with R do + StretchBlt(MDC, 0, 0, Right, Bottom, + ACanvas.Handle, X + Byte(AMirrorX) * (Right - 1), Y + Byte(AMirrorY) * (Bottom - 1), + (2 * Byte(not AMirrorX) - 1) * Right, + (2 * Byte(not AMirrorY) - 1) * Bottom, SRCCOPY); + end + else + FillRect(MDC, R, COLOR_BTNFACE + 1); + ATheme := 0; + if ANativeStyle then + ATheme := OpenTheme(totScrollBar); + if ATheme <> 0 then + begin + R1 := R; + DrawThemeBackground(ATheme, MDC, SBP_SIZEBOX, SZB_RIGHTALIGN, R1); + end + else + DrawFrameControl(MDC, R, DFC_SCROLL, DFCS_SCROLLSIZEGRIP); + with R do + begin + StretchBlt(ACanvas.Handle, X, Y, Right, Bottom, + MDC, Byte(AMirrorX) * (Right - 1), Byte(AMirrorY) * (Bottom - 1), + (2 * Byte(not AMirrorX) - 1) * Right, + (2 * Byte(not AMirrorY) - 1) * Bottom, SRCCOPY); + end; + DeleteObject(SelectObject(MDC, APrevBitmap)); + DeleteDC(MDC); + end + else + begin + L := (AScrollBarSize.cy - 2) div 12; + if AMirrorX then + begin + DX := 1; + X := R.Left; + end else + begin + DX := -1; + X := R.Right - 1; + end; + if AMirrorY then + begin + DY := 1; + Y := R.Top; + end else + begin + DY := -1; + Y := R.Bottom - 1; + end; + X0 := X; + Y0 := Y; + for I := 0 to 2 do + begin + if AIsTransparent then + begin + Inc(X, DX * L); + Inc(Y, DY * L); + end + else + for J := 1 to L do + DrawTouch(clBtnFace); + for J := 1 to L * 2 do + DrawTouch(clBtnShadow); + for J := 1 to L do + DrawTouch(clBtnHighlight); + end; + end; +end; + +procedure DrawEditPopupWindowFrame(ACanvas: TcxCanvas; AViewInfo: TcxCustomEditPopupWindowViewInfo); +var + R, R1: TRect; + A: Integer; + ABorderColor: TColor; + AClientEdgeWidth: Integer; +begin + with AViewInfo do + begin + R := Rect(0, 0, Bounds.Right - Bounds.Left, Bounds.Bottom - Bounds.Top); + + if Shadow then + begin + Dec(R.Right, cxEditShadowWidth); + Dec(R.Bottom, cxEditShadowWidth); + DrawContainerShadow(ACanvas, R); + end; + + DrawBorder(ACanvas, R); + + if SysPanelStyle and ((BorderStyle = epbsSingle) or (CloseButtonNativeState <> TC_NONE)) then + begin + if Painter <> nil then + ABorderColor := Painter.GetContainerBorderColor(False) + else + ABorderColor := clBtnText; + R1 := ClientRect; + AClientEdgeWidth := GetEditPopupWindowClientEdgeWidth(AViewInfo); + if ClientEdge then + InflateRect(R1, AClientEdgeWidth, AClientEdgeWidth); + if SizeGripCorner in [ecoTopLeft, ecoTopRight] then + InternalPolyLine(ACanvas, [Point(R1.Left, R1.Top - 1), Point(R1.Right, R1.Top - 1)], ABorderColor, True) + else + InternalPolyLine(ACanvas, [Point(R1.Left, R1.Bottom), Point(R1.Right, R1.Bottom)], ABorderColor, True); + end; + + if ClientEdge then + begin + A := SysPanelHeight; + if SysPanelStyle and (NativeStyle or (BorderStyle = epbsSingle)) then + Inc(A); + R1 := R; + if SysPanelStyle then + if SizeGripCorner in [ecoTopLeft, ecoTopRight] then + Inc(R1.Top, A) + else + Dec(R1.Bottom, A); + + ACanvas.DrawEdge(R1, True, True); + if NativeStyle or (BorderStyle <> epbsFlat) then + begin + InflateRect(R1, -1, -1); + ACanvas.DrawEdge(R1, True, False); + end; + end; + + if SysPanelStyle then + begin + if Sizeable then + begin + DrawSizeGrip(ACanvas, SizeGripRect, SizeGripCorner, + NativeStyle or (AViewInfo.Painter <> nil), AViewInfo.Painter); + ACanvas.ExcludeClipRect(SizeGripRect); + end; + + if not IsRectEmpty(CloseButtonRect) then + begin + DrawEditPopupCloseButton(ACanvas, AViewInfo); + ACanvas.ExcludeClipRect(CloseButtonRect); + end; + end; + + if Painter <> nil then + Painter.DrawWindowContent(ACanvas, ClientRect) + else + ACanvas.FillRect(ClientRect, clBtnFace); + + A := SysPanelHeight; + if SizeGripCorner in [ecoTopLeft, ecoTopRight] then + R.Bottom := R.Top + A + else + R.Top := R.Bottom - A; + + if Painter <> nil then + Painter.DrawWindowContent(ACanvas, R) + else + ACanvas.FillRect(R, clBtnFace); + end; +end; + +procedure DrawPopupEditPopupWindowBorder(ACanvas: TcxCanvas; AViewInfo: TcxCustomEditPopupWindowViewInfo; + var R: TRect); +begin + with AViewInfo do + if not NativeStyle and (BorderStyle = epbsFrame3D) then + begin + ACanvas.DrawEdge(R, False, True); + InflateRect(R, -1, -1); + ACanvas.DrawEdge(R, False, False); + InflateRect(R, -1, -1); + ACanvas.FrameRect(R, clInactiveBorder); + InflateRect(R, -1, -1); + ACanvas.FrameRect(R, clBtnFace); + InflateRect(R, -1, -1); + end + else + DrawEditPopupWindowBorder(ACanvas, AViewInfo, R); +end; + +procedure SetEditPopupWindowShadowRegion(APopupWindow: TcxCustomEditPopupWindow); +var + R: TRect; + AExcludeRect: TRect; +begin + AExcludeRect := cxEmptyRect; + R := GetControlRect(APopupWindow); + with APopupWindow.ViewInfo do + begin + if not NativeStyle then + if Shadow then + begin + Dec(R.Right, cxEditShadowWidth); + Dec(R.Bottom, cxEditShadowWidth); + if SizeGripCorner in [ecoTopLeft, ecoTopRight] then + begin + AExcludeRect := APopupWindow.OwnerScreenBounds; + AExcludeRect.TopLeft := APopupWindow.ScreenToClient(AExcludeRect.TopLeft); + AExcludeRect.BottomRight := APopupWindow.ScreenToClient(AExcludeRect.BottomRight); + Dec(AExcludeRect.Right, cxEditShadowWidth); + AExcludeRect.Bottom := APopupWindow.Height; + AExcludeRect.Top := AExcludeRect.Bottom - cxEditShadowWidth; + end; + end; + SetWindowShadowRegion(APopupWindow.Handle, R, + NativeStyle, Shadow, AExcludeRect); + end; +end; + +{ TcxCustomEditPopupWindowViewInfo } + +procedure TcxCustomEditPopupWindowViewInfo.Calculate; +begin + CalculateEditPopupWindowViewInfo(Self); +end; + +procedure TcxCustomEditPopupWindowViewInfo.DrawBorder(ACanvas: TcxCanvas; var R: TRect); +begin + DrawEditPopupWindowBorder(ACanvas, Self, R); +end; + +function TcxCustomEditPopupWindowViewInfo.GetBorderExtent: TRect; +begin + Result := GetEditPopupWindowFrameExtent(Self); +end; + +function TcxCustomEditPopupWindowViewInfo.GetClientExtent: TRect; +begin + Result := GetBorderExtent; +end; + +function TcxCustomEditPopupWindowViewInfo.GetSysPanelHeight: Integer; +begin + Result := GetEditPopupWindowSysPanelDefaultHeight(Self); + if (MinSysPanelHeight > 0) and (Result < MinSysPanelHeight) then + Result := MinSysPanelHeight; +end; + +function TcxCustomEditPopupWindowViewInfo.IsSizingPlace(X, Y: Integer): Boolean; +const + AHorzFlagMap: array[TcxEditCorner] of Integer = (-1, 1, -1, 1); + AVertFlagMap: array[TcxEditCorner] of Integer = (-1, -1, 1, 1); +var + P: TPoint; + ALeftCorner, ARightCorner, ATopCorner, ABottomCorner: Boolean; +begin + Result := False; + if not Sizeable then + Exit; + P := Point(X, Y); + if not PtInRect(Bounds, P) then + Exit; + if PtInRect(SizingRegionBounds, P) and not PtInRect(SizeGripSizingRect, P) then + Exit; + Result := True; + + if PtInRect(SizeGripSizingRect, P) then + begin + FHorzFlag := AHorzFlagMap[SizeGripCorner]; + FVertFlag := AVertFlagMap[SizeGripCorner]; + Exit; + end; + + ALeftCorner := SizeGripCorner in [ecoTopLeft, ecoBottomLeft]; + ARightCorner := SizeGripCorner in [ecoTopRight, ecoBottomRight]; + ATopCorner := SizeGripCorner in [ecoTopLeft, ecoTopRight]; + ABottomCorner := SizeGripCorner in [ecoBottomLeft, ecoBottomRight]; + + FHorzFlag := 0; + if (X < SizingOffset) and ALeftCorner then + FHorzFlag := -1; + if (X >= Bounds.Right - SizingOffset) and ARightCorner then + FHorzFlag := 1; + + FVertFlag := 0; + if (Y < SizingOffset) and ATopCorner then + FVertFlag := -1; + if (Y >= Bounds.Bottom - SizingOffset) and ABottomCorner then + FVertFlag := 1; + + if SizeGripCorner in [ecoTopLeft, ecoTopRight] then + begin + if FVertFlag = 1 then + begin + if (X >= SizingRegionBounds.Left) and (X < SizingRegionBounds.Right) then + FHorzFlag := 0; + FVertFlag := 0; + end; + end else + begin + if FVertFlag = -1 then + begin + if (X >= SizingRegionBounds.Left) and (X < SizingRegionBounds.Right) then + FHorzFlag := 0; + FVertFlag := 0; + end; + end; + + if SysPanelStyle then + if SizeGripCorner in [ecoTopLeft, ecoBottomLeft] then + begin + if FHorzFlag = 1 then + begin + if (Y >= SizingRegionBounds.Top) and (Y < SizingRegionBounds.Bottom) then + FVertFlag := 0; + FHorzFlag := 0; + end; + end else + begin + if FHorzFlag = -1 then + begin + if (Y >= SizingRegionBounds.Top) and (Y < SizingRegionBounds.Bottom) then + FVertFlag := 0; + FHorzFlag := 0; + end; + end; +end; + +function TcxCustomEditPopupWindowViewInfo.DrawCustomBorder(ACanvas: TcxCanvas; const R: TRect; out ABorderWidth: Integer): Boolean; +begin + Result := False; + ABorderWidth := 0; + if Assigned(FOnCustomDrawBorder) then + FOnCustomDrawBorder(Self, ACanvas, R, Result, ABorderWidth); +end; + +procedure TcxCustomEditPopupWindowViewInfo.InternalPaint(ACanvas: TcxCanvas); +begin + DrawEditPopupWindowFrame(ACanvas, Self); +end; + +{ TcxCustomEditPopupWindow } + +constructor TcxCustomEditPopupWindow.Create(AOwnerControl: TWinControl); +begin + inherited Create(AOwnerControl); + ViewInfo.CloseButtonState := cxbsNormal; +end; + +destructor TcxCustomEditPopupWindow.Destroy; +begin + FreeAndNil(FSizeFrame); + inherited Destroy; +end; + +function TcxCustomEditPopupWindow.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxCustomEditPopupWindowViewInfo; +end; + +procedure TcxCustomEditPopupWindow.Popup(AFocusedControl: TWinControl); +begin + if not IsOwnerControlVisible then + Edit.DoFinalizePopup; + inherited Popup(AFocusedControl); +end; + +function TcxCustomEditPopupWindow.AcceptsAnySize: Boolean; +begin + Result := Edit.ActiveProperties.PopupWindowAcceptsAnySize; +end; + +procedure TcxCustomEditPopupWindow.AdjustClientRect(var Rect: TRect); +var + AClientExtent: TRect; +begin + AClientExtent := ViewInfo.GetClientExtent; + ExtendRect(Rect, AClientExtent); +end; + +function TcxCustomEditPopupWindow.CalculatePosition: TPoint; +const + ASizeGripCornerMap: array[Boolean, Boolean] of TcxEditCorner = ( + (ecoTopLeft, ecoBottomLeft), + (ecoTopRight, ecoBottomRight) + ); +var + ALeftFlag, ATopFlag: Boolean; + AOwnerRect: TRect; + ADesktopWorkArea: TRect; +begin + OwnerBounds := Edit.GetPopupWindowOwnerControlBounds; + Result := inherited CalculatePosition; + + AOwnerRect := OwnerScreenBounds; + ADesktopWorkArea := GetDesktopWorkArea(Point(Result.X, Result.Y)); + + ALeftFlag := (AlignHorz = pahRight) and (Result.X + Width = AOwnerRect.Right) and (Result.X > ADesktopWorkArea.Left) or {pahRight + pdVertical} + (Result.X + Width = AOwnerRect.Left) or {pahLeft + pdHorizontal} + (Result.X + Width = ADesktopWorkArea.Right) and (Result.X < AOwnerRect.Right); + ATopFlag := (AlignVert = pavBottom) and (Result.Y + Height = AOwnerRect.Bottom) and (Result.Y > ADesktopWorkArea.Top) or {pavBottom + pdHorizontal} + (Result.Y + Height = AOwnerRect.Top) or {pavTop + pdVertical} + (Result.Y + Height = ADesktopWorkArea.Bottom) and (Result.Y < AOwnerRect.Bottom); + + ViewInfo.SizeGripCorner := ASizeGripCornerMap[not ALeftFlag, not ATopFlag]; + + if Shadow and ATopFlag then + Inc(Result.Y, cxEditShadowWidth); +end; + +procedure TcxCustomEditPopupWindow.CalculateSize; +var + AClientExtent: TRect; + AMinSize: TSize; + APreferredWidth, APreferredHeight: Integer; + APopupWindowVisualAreaSize: TSize; +begin + ViewInfo.SizeGripCorner := ecoBottomRight; + OwnerBounds := Edit.GetPopupWindowOwnerControlBounds; + AClientExtent := ViewInfo.GetClientExtent; + AMinSize := MinSize; + APopupWindowVisualAreaSize := Edit.GetPopupWindowClientPreferredSize; + with OwnerBounds do + begin + if PopupAutoSize then + APreferredWidth := AClientExtent.Left + AClientExtent.Right + APopupWindowVisualAreaSize.cx + else + if PopupWidth = 0 then + APreferredWidth := Right - Left + else + APreferredWidth := PopupWidth; + if Sizeable and (MinWidth > 0) and (APreferredWidth < MinWidth) then + APreferredWidth := MinWidth; + if APreferredWidth < AMinSize.cx then + APreferredWidth := AMinSize.cx; + + APreferredHeight := AMinSize.cy; + if PopupAutoSize then + APreferredHeight := AClientExtent.Top + AClientExtent.Bottom + APopupWindowVisualAreaSize.cy + else + if PopupHeight > 0 then + APreferredHeight := PopupHeight + else + if APreferredHeight < MinHeight then + APreferredHeight := MinHeight; + if Sizeable and (MinHeight > 0) and (APreferredHeight < MinHeight) then + APreferredHeight := MinHeight; + if APreferredHeight < AMinSize.cy then + APreferredHeight := AMinSize.cy; + + Width := APreferredWidth; + Height := APreferredHeight; + end; +end; + +procedure TcxCustomEditPopupWindow.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + if Edit.IsNativeStyle and IsCompositionEnabled then + Params.WindowClass.Style := Params.WindowClass.style or $20000{= CS_DROPSHADOW}; +end; + +procedure TcxCustomEditPopupWindow.DoClosed; +begin + FSizingCapture := False; + FSizingMouseMovement := False; + inherited DoClosed; +end; + +procedure TcxCustomEditPopupWindow.DoClosing; +begin + inherited DoClosing; + DrawSizeFrame(cxEmptyRect); +end; + +procedure TcxCustomEditPopupWindow.ModalCloseUp; +var + AReason: TcxEditCloseUpReason; +begin + case ModalResult of + mrOk: AReason := crEnter; + mrCancel: AReason := crCancel; + else + AReason := crUnknown; + end; + Edit.CloseUp(AReason); +end; + +procedure TcxCustomEditPopupWindow.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + P: TPoint; +begin + P := Point(X, Y); + if Button = mbLeft then + if PtInRect(ViewInfo.CloseButtonRect, P) and (ViewInfo.CloseButtonState <> cxbsPressed) then + begin + ViewInfo.CloseButtonState := cxbsPressed; + InternalInvalidateRect(ViewInfo.CloseButtonRect); + end + else + if (GetCaptureControl <> nil) and ViewInfo.IsSizingPlace(X, Y) then + begin + if FHorzFlag = -1 then + FCapturePointOffset.cx := X + else + FCapturePointOffset.cx := Width - X; + if FVertFlag = -1 then + FCapturePointOffset.cy := Y + else + FCapturePointOffset.cy := Height - Y; + FSizingCapture := True; + Cursor := cxEditMouseSizingCursorMap[FHorzFlag, FVertFlag]; + if not ShowContentWhileResize then + DrawSizeFrame(BoundsRect); + end; +end; + +procedure TcxCustomEditPopupWindow.MouseLeave(AControl: TControl); +begin + if ViewInfo.CloseButtonState <> cxbsNormal then + begin + ViewInfo.CloseButtonState := cxbsNormal; + InternalInvalidateRect(ViewInfo.CloseButtonRect); + end; + Cursor := crDefault; +end; + +procedure TcxCustomEditPopupWindow.MouseMove(Shift: TShiftState; X, Y: Integer); + + procedure CheckWorkArea(var R: TRect); + var + ADesktopWorkArea: TRect; + begin + ADesktopWorkArea := GetDesktopWorkArea(ClientToScreen(Point(X, Y))); + CheckBounds(ADesktopWorkArea, R); + end; + +var + ABoundsRect: TRect; + DX, DY: Integer; + ANewWidth, ANewHeight: Integer; + ACapturePoint: TPoint; + AOwnerRect: TRect; +begin + if FSizingCapture then + begin + ABoundsRect := BoundsRect; + if FHorzFlag = -1 then + ACapturePoint.X := FCapturePointOffset.cx + else + ACapturePoint.X := Width - FCapturePointOffset.cx; + if FVertFlag = -1 then + ACapturePoint.Y := FCapturePointOffset.cy + else + ACapturePoint.Y := Height - FCapturePointOffset.cy; + + DX := X - ACapturePoint.X; + DY := Y - ACapturePoint.Y; + + if not IsRectEmpty(ViewInfo.SizeGripSizingRect) then + begin + if (FHorzFlag = 1) and (DX > 0) and (X <= Width) and not + (PtInRect(ViewInfo.SizeGripSizingRect, ACapturePoint) and + (X >= ViewInfo.SizeGripSizingRect.Left) and (X < ViewInfo.SizeGripSizingRect.Right)) then + DX := 0; + if (FVertFlag = 1) and (Y <= Height) and (DY > 0) and not + (PtInRect(ViewInfo.SizeGripSizingRect, ACapturePoint) and + (Y >= ViewInfo.SizeGripSizingRect.Top) and (Y < ViewInfo.SizeGripSizingRect.Bottom)) then + DY := 0; + end; + + if ((ViewInfo.SizeGripCorner in [ecoTopLeft, ecoBottomLeft]) and (FHorzFlag = 1)) or + ((ViewInfo.SizeGripCorner in [ecoTopRight, ecoBottomRight]) and (FHorzFlag = -1)) then + DX := 0; + if ((ViewInfo.SizeGripCorner in [ecoTopLeft, ecoTopRight]) and (FVertFlag = 1)) or + ((ViewInfo.SizeGripCorner in [ecoBottomLeft, ecoBottomRight]) and (FVertFlag = -1)) then + DY := 0; + + if FHorzFlag = 0 then + DX := 0; + if FVertFlag = 0 then + DY := 0; + + if FHorzFlag = -1 then + Inc(ABoundsRect.Left, DX) + else + Inc(ABoundsRect.Right, DX); + if FVertFlag = -1 then + Inc(ABoundsRect.Top, DY) + else + Inc(ABoundsRect.Bottom, DY); + + ANewWidth := ABoundsRect.Right - ABoundsRect.Left; + ANewHeight := ABoundsRect.Bottom - ABoundsRect.Top; + if CanResize(ANewWidth, ANewHeight) then + if (ANewWidth <> Width) or (ANewHeight <> Height) then + begin + if ViewInfo.SizeGripCorner in [ecoTopLeft, ecoBottomLeft] then + ABoundsRect.Left := BoundsRect.Right - ANewWidth + else + ABoundsRect.Right := BoundsRect.Left + ANewWidth; + if ViewInfo.SizeGripCorner in [ecoTopLeft, ecoTopRight] then + ABoundsRect.Top := BoundsRect.Bottom - ANewHeight + else + ABoundsRect.Bottom := BoundsRect.Top + ANewHeight; + + AOwnerRect := OwnerScreenBounds; + if ABoundsRect.Left > AOwnerRect.Right - 1 then + ABoundsRect.Left := AOwnerRect.Right - 1{Left}; + if ABoundsRect.Right - 1 < AOwnerRect.Left then + ABoundsRect.Right := AOwnerRect.Left +1{Left + Width}; + + CheckWorkArea(ABoundsRect); + if not EqualRect(BoundsRect, ABoundsRect) then + begin + Edit.FPopupSizeChanged := True; + Edit.FPopupSizeChangedByMouse := True; + if ShowContentWhileResize then + begin + BoundsRect := ABoundsRect; + RefreshPopupWindow; + end + else + DrawSizeFrame(ABoundsRect); + end; + end; + end else + begin + if (ViewInfo.CloseButtonState <> cxbsNormal) and + not PtInRect(ViewInfo.CloseButtonRect, Point(X, Y)) then + begin + ViewInfo.CloseButtonState := cxbsNormal; + InternalInvalidateRect(ViewInfo.CloseButtonRect); + end; + if (ViewInfo.CloseButtonState = cxbsNormal) and (Shift = []) and + PtInRect(ViewInfo.CloseButtonRect, Point(X, Y)) then + begin + ViewInfo.CloseButtonState := cxbsHot; + InternalInvalidateRect(ViewInfo.CloseButtonRect); + end; + if ViewInfo.IsSizingPlace(X, Y) then + begin + FSizingMouseMovement := True; + Cursor := cxEditMouseSizingCursorMap[FHorzFlag, FVertFlag]; + end else + begin + if FSizingMouseMovement then + Cursor := crDefault; + FSizingMouseMovement := False; + end; + end; +end; + +procedure TcxCustomEditPopupWindow.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + if (Button = mbLeft) and FSizingCapture then + begin + SetCaptureControl(nil); + FSizingCapture := False; + DrawSizeFrame(cxEmptyRect); + if not ShowContentWhileResize then + begin + BoundsRect := FSizeFrameBounds; + RefreshPopupWindow; + end; + if ViewInfo.IsSizingPlace(X, Y) then + Cursor := cxEditMouseSizingCursorMap[FHorzFlag, FVertFlag] + else + Cursor := crDefault; + end + else + if (ViewInfo.CloseButtonState = cxbsPressed) then + if CloseQuery then + begin + Edit.CloseUp(crUnknown); + if Visible then + begin + ViewInfo.CloseButtonState := cxbsHot; + InternalInvalidateRect(ViewInfo.CloseButtonRect); + end; + end else + begin + ViewInfo.CloseButtonState := cxbsHot; + InternalInvalidateRect(ViewInfo.CloseButtonRect); + end; +end; + +procedure TcxCustomEditPopupWindow.Resize; +begin + inherited Resize; + if HandleAllocated then + SetEditPopupWindowShadowRegion(Self); +end; + +procedure TcxCustomEditPopupWindow.CalculateViewInfo; +begin + ViewInfo.Bounds := GetControlRect(Self); + ViewInfo.Calculate; + ViewInfo.CloseButtonStyle := Edit.PopupControlsLookAndFeel.Kind; + ViewInfo.Painter := Style.LookAndFeel.SkinPainter; +end; + +function TcxCustomEditPopupWindow.CanResize(var NewWidth, NewHeight: Integer): Boolean; +var + AClientExtent: TRect; + AClienExtentSize: TSize; + AMinSize: TSize; + ANewVisualAreaSize, AMaxVisualAreaSize: TSize; +begin + Result := True; + if not Sizeable or (NewWidth = Width) and (NewHeight = Height) or FLockCheckSize then + Exit; + AMinSize := MinSize; + NewWidth := Max(NewWidth, Max(AMinSize.cx, MinWidth)); + NewHeight := Max(NewHeight, Max(AMinSize.cy, MinHeight)); + + if (NewHeight <> Height) or (NewWidth <> Width) then + with Edit do + if ActiveProperties.UseLookupData and ActiveProperties.IsLookupDataVisual then + begin + AClientExtent := Self.ViewInfo.GetClientExtent; + AClienExtentSize := Size(AClientExtent.Left + AClientExtent.Right, AClientExtent.Top + AClientExtent.Bottom); + ANewVisualAreaSize := Size(NewWidth - AClienExtentSize.cx, NewHeight - AClienExtentSize.cy); + AMaxVisualAreaSize := GetMaxVisualAreaSize; + if not ILookupData.CanResizeVisualArea(ANewVisualAreaSize, AMaxVisualAreaSize.cy, AMaxVisualAreaSize.cx) then + begin + NewWidth := Self.Width; + NewHeight := Self.Height; + end + else + begin + NewWidth := Max(ANewVisualAreaSize.cx + AClienExtentSize.cx, AMinSize.cx); + NewHeight := Max(ANewVisualAreaSize.cy + AClienExtentSize.cy, AMinSize.cy); + end; + end; +end; + +procedure TcxCustomEditPopupWindow.DoPopupControlKey(Key: Char); +begin + SendMessage(GetFocus, WM_CHAR, Integer(Key), 0); +end; + +procedure TcxCustomEditPopupWindow.DrawSizeFrame(const R: TRect); +var + ABorderWidth: Integer; +begin + if cxRectIsEmpty(R) then + begin + FreeAndNil(FSizeFrame); + Exit; + end; + if FSizingCapture and not IsRectEmpty(R) then + begin + ABorderWidth := GetEditPopupWindowBorderWidth(ViewInfo, False); + if ABorderWidth < 2 then + ABorderWidth := 2; + if FSizeFrame = nil then + FSizeFrame := TcxSizeFrame.Create(ABorderWidth); + FSizeFrame.Show; + FSizeFrame.DrawSizeFrame(R); + end; + FPaintedSizeFrameBounds := R; + if not IsRectEmpty(R) then + FSizeFrameBounds := R; +end; + +function TcxCustomEditPopupWindow.GetMaxVisualAreaSize: TSize; +var + AClientExtent, AEditBounds, ADesktopArea: TRect; + AShadowWidth: Integer; +begin + AClientExtent := ViewInfo.GetClientExtent; + AEditBounds := Edit.GetPopupWindowOwnerControlBounds; + if IsChildClassWindow(Edit.Handle) then + begin + AEditBounds.TopLeft := Edit.Parent.ClientToScreen(AEditBounds.TopLeft); + AEditBounds.BottomRight := Edit.Parent.ClientToScreen(AEditBounds.BottomRight); + end; + + if ViewInfo.Shadow then + AShadowWidth := cxEditShadowWidth + else + AShadowWidth := 0; + + ADesktopArea := GetDesktopWorkArea(AEditBounds.TopLeft); + + if Edit.ActiveProperties.PopupDirection = pdHorizontal then + begin + Result.cx := Max(ADesktopArea.Right - AEditBounds.Right, AEditBounds.Left - ADesktopArea.Left + AShadowWidth) + 1; + Result.cy := cxRectHeight(ADesktopArea); + end + else + begin + Result.cx := cxRectWidth(ADesktopArea); + Result.cy := Max(ADesktopArea.Bottom - AEditBounds.Bottom, AEditBounds.Top - ADesktopArea.Top + AShadowWidth); + end; + Result.cx := Result.cx - (AClientExtent.Left + AClientExtent.Right); + Result.cy := Result.cy - (AClientExtent.Top + AClientExtent.Bottom); +end; + +function TcxCustomEditPopupWindow.GetMinSize: TSize; +begin + with ViewInfo.GetClientExtent do + Result := Size(Left + Right, Top + Bottom); + if Sizeable and SysPanelStyle then + begin + with ViewInfo.CloseButtonRect do + Result.cx := Result.cx + Right - Left; + with ViewInfo.SizeGripSizingRect do + Result.cx := Result.cx + Right - Left; + Result.cx := Result.cx + 10; + end; +end; + +procedure TcxCustomEditPopupWindow.InternalInvalidateRect(const ARect: TRect); +begin + InvalidateRect(Handle, @ARect, True); +end; + +procedure TcxCustomEditPopupWindow.RefreshPopupWindow; +begin + OwnerBounds := Edit.GetPopupWindowOwnerControlBounds; + CalculateViewInfo; + Edit.PositionPopupWindowChilds(ViewInfo.ClientRect); + InternalInvalidateRect(ViewInfo.Bounds); + Refresh; +end; + +function TcxCustomEditPopupWindow.GetEdit: TcxCustomDropDownEdit; +begin + Result := TcxCustomDropDownEdit(OwnerControl); +end; + +function TcxCustomEditPopupWindow.GetMinSysPanelHeight: Integer; +begin + Result := ViewInfo.MinSysPanelHeight; +end; + +function TcxCustomEditPopupWindow.GetViewInfo: TcxCustomEditPopupWindowViewInfo; +begin + Result := TcxCustomEditPopupWindowViewInfo(FViewInfo); +end; + +procedure TcxCustomEditPopupWindow.SetPopupAutoSize(Value: Boolean); +begin + if Value <> FPopupAutoSize then + FPopupAutoSize := Value; +end; + +procedure TcxCustomEditPopupWindow.SetBorderStyle(Value: TcxEditPopupBorderStyle); +begin + FBorderStyle := Value; + ViewInfo.BorderStyle := Value; +end; + +procedure TcxCustomEditPopupWindow.SetClientEdge(Value: Boolean); +begin + FClientEdge := Value; + ViewInfo.ClientEdge := Value; +end; + +procedure TcxCustomEditPopupWindow.SetCloseButton(Value: Boolean); +begin + FCloseButton := Value; + ViewInfo.CloseButton := Value; +end; + +procedure TcxCustomEditPopupWindow.SetMinSysPanelHeight(Value: Integer); +begin + ViewInfo.MinSysPanelHeight := Value; +end; + +procedure TcxCustomEditPopupWindow.SetNativeStyle(Value: Boolean); +begin + FNativeStyle := Value; + ViewInfo.NativeStyle := Value; +end; + +procedure TcxCustomEditPopupWindow.SetShadow(Value: Boolean); +begin + FShadow := Value; + ViewInfo.Shadow := Value; +end; + +procedure TcxCustomEditPopupWindow.SetSizeable(Value: Boolean); +begin + FSizeable := Value; + ViewInfo.Sizeable := Value; +end; + +procedure TcxCustomEditPopupWindow.SetSysPanelStyle(Value: Boolean); +begin + FSysPanelStyle := Value; + ViewInfo.SysPanelStyle := Value; +end; + +procedure TcxCustomEditPopupWindow.CMPopupControlKey(var Message: TMessage); +begin + if IsVisible then + DoPopupControlKey(Char(Message.WParam)); +end; + +{ TcxCustomDropDownEditViewData } + +procedure TcxCustomDropDownEditViewData.Calculate(ACanvas: TcxCanvas; const ABounds: TRect; + const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); +begin + KeepArrowButtonPressedWhenDroppedDown := Properties.KeepArrowButtonPressedWhenDroppedDown or NativeStyle and IsCompositionEnabled; + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, AIsMouseEvent); + with TcxCustomTextEditViewInfo(AViewInfo) do + begin + DrawSelectionBar := not IsInplace and ((Edit = nil) or + not((Properties.EditingStyle = esFixedList) and Properties.FixedListSelection and + TcxCustomDropDownEdit(Edit).FindSelection)); + if DrawSelectionBar then + DrawSelectionBar := (Properties.EditingStyle = esFixedList) and Focused and + not Transparent and not HasPopupWindow and not (NativeStyle and IsCompositionEnabled); + end; +end; + +function TcxCustomDropDownEditViewData.CanPressButton(AViewInfo: TcxCustomEditViewInfo; AButtonVisibleIndex: Integer): Boolean; +begin + Result := not(IsHotAndPopup and (AButtonVisibleIndex = Properties.DropDownButtonVisibleIndex)); +end; + +function TcxCustomDropDownEditViewData.GetEditNativeState(AViewInfo: TcxCustomEditViewInfo): Integer; +begin + Result := inherited GetEditNativeState(AViewInfo); + if (Result = ETS_SELECTED) and (Properties.EditingStyle = esFixedList) and not HasPopupWindow then + if csHotTrack in ContainerState then + Result := ETS_HOT + else + Result := ETS_NORMAL; +end; + +function TcxCustomDropDownEditViewData.IsButtonPressed( + AViewInfo: TcxCustomEditViewInfo; AButtonVisibleIndex: Integer): Boolean; +begin + Result := inherited IsButtonPressed(AViewInfo, AButtonVisibleIndex); + Result := Result or (Edit <> nil) and (HasPopupWindow or IsHotAndPopup) and + (AButtonVisibleIndex = Properties.DropDownButtonVisibleIndex) and + KeepArrowButtonPressedWhenDroppedDown; +end; + +function TcxCustomDropDownEditViewData.GetProperties: TcxCustomDropDownEditProperties; +begin + Result := TcxCustomDropDownEditProperties(FProperties); +end; + +{ TcxCustomDropDownEditProperties } + +constructor TcxCustomDropDownEditProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FImmediateDropDown := True; + Buttons.Add; + Buttons[0].Kind := bkDown; + FGlyphButtonIndex := DropDownButtonVisibleIndex; + FPopupDirection := pdVertical; + FPopupHorzAlignment := pahLeft; + FPopupVertAlignment := pavBottom; + FPopupAutoSize := True; +end; + +procedure TcxCustomDropDownEditProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomDropDownEditProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with Source as TcxCustomDropDownEditProperties do + begin + Self.ButtonGlyph := ButtonGlyph; + Self.ImmediateDropDown := ImmediateDropDown; + Self.ImmediatePopup := ImmediatePopup; + Self.KeepArrowButtonPressedWhenDroppedDown := KeepArrowButtonPressedWhenDroppedDown; + Self.PopupAutoSize := PopupAutoSize; + Self.PopupClientEdge := PopupClientEdge; + Self.PopupDirection := PopupDirection; + Self.PopupHeight := PopupHeight; + Self.PopupHorzAlignment := PopupHorzAlignment; + Self.PopupMinHeight := PopupMinHeight; + Self.PopupMinWidth := PopupMinWidth; + Self.PopupSizeable := PopupSizeable; + Self.PopupSysPanelStyle := PopupSysPanelStyle; + Self.PopupVertAlignment := PopupVertAlignment; + Self.PopupWidth := PopupWidth; + Self.PostPopupValueOnTab := PostPopupValueOnTab; + + Self.OnClosePopup := OnClosePopup; + Self.OnCloseQuery := OnCloseQuery; + Self.OnCloseUp := OnCloseUp; + Self.OnInitPopup := OnInitPopup; + Self.OnPopup := OnPopup; + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +procedure TcxCustomDropDownEditProperties.Changed; +begin + if FInternalChanging then + Exit; + FInternalChanging := True; + try + if DropDownButtonVisibleIndex < Buttons.VisibleCount then + with Buttons[DropDownButtonVisibleIndex] do + begin + if VerifyBitmap(Glyph) then + Kind := bkGlyph + else + if Kind = bkGlyph then + Kind := bkDown; + end; + finally + FInternalChanging := False; + end; + inherited Changed; +end; + +class function TcxCustomDropDownEditProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxCustomDropDownEdit; +end; + +class function TcxCustomDropDownEditProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxCustomDropDownEditViewData; +end; + +function TcxCustomDropDownEditProperties.IsLookupDataVisual: Boolean; +begin + Result := True; +end; + +function TcxCustomDropDownEditProperties.DropDownButtonVisibleIndex: Integer; +begin + Result := 0; +end; + +function TcxCustomDropDownEditProperties.DropDownOnClick: Boolean; +begin + Result := False; +end; + +function TcxCustomDropDownEditProperties.GetAlwaysPostEditValue: Boolean; +begin + Result := False; +end; + +class function TcxCustomDropDownEditProperties.GetPopupWindowClass: TcxCustomEditPopupWindowClass; +begin + Result := TcxCustomEditPopupWindow; +end; + +function TcxCustomDropDownEditProperties.PopupWindowAcceptsAnySize: Boolean; +begin + Result := True; +end; + +function TcxCustomDropDownEditProperties.PopupWindowCapturesFocus: Boolean; +begin + Result := False; +end; + +function TcxCustomDropDownEditProperties.GetButtonGlyph: TBitmap; +begin + if GlyphButtonIndex < Buttons.Count then + Result := Buttons[GlyphButtonIndex].Glyph + else + Result := nil; +end; + +function TcxCustomDropDownEditProperties.GetPopupAlignment: TAlignment; +const + AAlignHorzMap: array[TcxPopupAlignHorz] of TAlignment = + (taLeftJustify, taCenter, taRightJustify); +begin + Result := AAlignHorzMap[FPopupHorzAlignment]; +end; + +procedure TcxCustomDropDownEditProperties.SetButtonGlyph(Value: TBitmap); +begin + if GlyphButtonIndex < Buttons.Count then + with Buttons[GlyphButtonIndex] do + begin + Glyph := Value; + if VerifyBitmap(Glyph) then + Kind := bkGlyph + else + if Kind = bkGlyph then + Kind := bkDown; + end; +end; + +procedure TcxCustomDropDownEditProperties.SetGlyphButtonIndex(Value: Integer); +begin + if Value <> FGlyphButtonIndex then + begin + Buttons[Value].Glyph := Buttons[FGlyphButtonIndex].Glyph; + Buttons[Value].Kind := bkGlyph; + Buttons[FGlyphButtonIndex].Glyph := nil; + FGlyphButtonIndex := Value; + end; +end; + +procedure TcxCustomDropDownEditProperties.SetKeepArrowButtonPressedWhenDroppedDown( + Value: Boolean); +begin + if Value <> FKeepArrowButtonPressedWhenDroppedDown then + begin + FKeepArrowButtonPressedWhenDroppedDown := Value; + Changed; + end; +end; + +procedure TcxCustomDropDownEditProperties.SetPopupAlignment(Value: TAlignment); +const + AAlignHorzMap: array[TAlignment] of TcxPopupAlignHorz = + (pahLeft, pahRight, pahCenter); +begin + if Value = PopupAlignment then + Exit; + + FPopupHorzAlignment := AAlignHorzMap[Value]; + Changed; +end; + +procedure TcxCustomDropDownEditProperties.SetPopupClientEdge(Value: Boolean); +begin + if Value = FPopupClientEdge then + Exit; + FPopupClientEdge := Value; + Changed; +end; + +procedure TcxCustomDropDownEditProperties.SetPopupHeight(Value: Integer); +begin + if Value < FPopupMinHeight then + Value := FPopupMinHeight; + if FPopupHeight <> Value then + FPopupHeight := Value; +end; + +procedure TcxCustomDropDownEditProperties.SetPopupMinHeight(Value: Integer); +begin + if Value < 0 then + Value := 0; + FPopupMinHeight := Value; + SetPopupHeight(FPopupHeight); +end; + +procedure TcxCustomDropDownEditProperties.SetPopupMinWidth(Value: Integer); +begin + if Value < 0 then + Value := 0; + FPopupMinWidth := Value; + SetPopupWidth(FPopupWidth); +end; + +procedure TcxCustomDropDownEditProperties.SetPopupSizeable(Value: Boolean); +begin + if Value = FPopupSizeable then + Exit; + FPopupSizeable := Value; + Changed; +end; + +procedure TcxCustomDropDownEditProperties.SetPopupSysPanelStyle(Value: Boolean); +begin + if Value = FPopupSysPanelStyle then + Exit; + FPopupSysPanelStyle := Value; + Changed; +end; + +procedure TcxCustomDropDownEditProperties.SetPopupWidth(Value: Integer); +begin + if Value < 0 then + Value := 0 + else + if (Value > 0) and (Value < FPopupMinWidth) then + Value := FPopupMinWidth; + if FPopupWidth <> Value then + FPopupWidth := Value; +end; + +{ TcxEditPopupControlLookAndFeel } + +procedure TcxEditPopupControlLookAndFeel.EditStyleChanged; +var + AChangedValues: TcxLookAndFeelValues; +begin + AChangedValues := []; + if Kind <> InternalGetKind then + Include(AChangedValues, lfvKind); + if NativeStyle <> InternalGetNativeStyle then + Include(AChangedValues, lfvNativeStyle); + if SkinName <> InternalGetSkinName then + Include(AChangedValues, lfvSkinName); + if AChangedValues <> [] then + MasterLookAndFeelChanged(Self, AChangedValues); +end; + +function TcxEditPopupControlLookAndFeel.InternalGetKind: TcxLookAndFeelKind; +begin + Result := GetEditPopupWindowControlsLookAndFeelKind(Edit); +end; + +function TcxEditPopupControlLookAndFeel.InternalGetNativeStyle: Boolean; +begin + Result := Edit.ViewInfo.NativeStyle; +end; + +function TcxEditPopupControlLookAndFeel.InternalGetSkinName: string; +begin + Result := Edit.Style.LookAndFeel.SkinName; +end; + +function TcxEditPopupControlLookAndFeel.GetEdit: TcxCustomDropDownEdit; +begin + Result := TcxCustomDropDownEdit(GetOwner); +end; + +{ TcxCustomDropDownInnerEdit } + +function TcxCustomDropDownInnerEdit.GetContainer: TcxCustomDropDownEdit; +begin + Result := TcxCustomDropDownEdit(Owner); +end; + +procedure TcxCustomDropDownInnerEdit.CMHintShow(var Message: TCMHintShow); +begin + Message.Result := Integer(Container.DroppedDown); +end; + +{ TcxCustomDropDownEdit } + +destructor TcxCustomDropDownEdit.Destroy; +begin + DeleteShowPopupWindowMessages; + if FPopupWindow <> nil then + FreeAndNil(FPopupWindow); + FreeAndNil(FPopupControlsLookAndFeel); + inherited Destroy; +end; + +procedure TcxCustomDropDownEdit.Activate(var AEditData: TcxCustomEditData); +begin + inherited Activate(AEditData); + FPopupSizeChanged := TcxCustomDropDownEditData(AEditData).Initialized and + ActiveProperties.PopupSizeable; + if ActiveProperties.ImmediatePopup then + DroppedDown := True; +end; + +procedure TcxCustomDropDownEdit.ActivateByKey(Key: Char; var AEditData: TcxCustomEditData); +begin + inherited ActivateByKey(Key, AEditData); + if (Key >= #32) and (Key <= #255) and ActiveProperties.ImmediateDropDown and + not ActiveProperties.ImmediatePopup and not SendActivationKey(Key) then + DroppedDown := True; + if not SendActivationKey(Key) and CanDropDown and (GetPopupFocusedControl <> nil) then + PostMessage(PopupWindow.Handle, CM_POPUPCONTROLKEY, Integer(Key), 0); +end; + +procedure TcxCustomDropDownEdit.ActivateByMouse(Shift: TShiftState; X, Y: Integer; + var AEditData: TcxCustomEditData); +begin + FIsActivatingByMouse := True; + try + inherited ActivateByMouse(Shift, X, Y, AEditData); + finally + FIsActivatingByMouse := False; + end; +end; + +procedure TcxCustomDropDownEdit.BeforeDestruction; +begin + if ILookupData <> nil then + ILookupData.Deinitialize; + inherited BeforeDestruction; +end; + +function TcxCustomDropDownEdit.Deactivate: Boolean; +begin + if HasPopupWindow then + CloseUp(crUnknown); + if EditData <> nil then + TcxCustomDropDownEditData(EditData).Initialized := FPopupSizeChanged; + Result := inherited Deactivate; + DeleteShowPopupWindowMessages; +end; + +function TcxCustomDropDownEdit.Focused: Boolean; +begin + Result := inherited Focused or HasPopupWindow; +end; + +class function TcxCustomDropDownEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomDropDownEditProperties; +end; + +procedure TcxCustomDropDownEdit.ContainerStyleChanged(Sender: TObject); +begin + if HandleAllocated and (FPopupControlsLookAndFeel <> nil) then + FPopupControlsLookAndFeel.EditStyleChanged; + inherited ContainerStyleChanged(Sender); +end; + +function TcxCustomDropDownEdit.CreateViewData: TcxCustomEditViewData; +begin + Result := inherited CreateViewData; + with Result as TcxCustomDropDownEditViewData do + begin + HasPopupWindow := Self.HasPopupWindow; + IsHotAndPopup := FIsHotAndPopup; + end; +end; + +procedure TcxCustomDropDownEdit.DestroyWnd; +begin + if FPopupWindow <> nil then + begin + CloseUp(crUnknown); + DoFinalizePopup; + FPopupWindow.DestroyHandle; + end; + inherited DestroyWnd; +end; + +procedure TcxCustomDropDownEdit.DoButtonDown(AButtonVisibleIndex: Integer); +begin + inherited DoButtonDown(AButtonVisibleIndex); + if AButtonVisibleIndex = ActiveProperties.DropDownButtonVisibleIndex then + DroppedDown := True; +end; + +procedure TcxCustomDropDownEdit.DoExit; +begin + CloseUp(crUnknown); + FocusChanged; + inherited DoExit; +end; + +procedure TcxCustomDropDownEdit.DoEditKeyDown(var Key: Word; Shift: TShiftState); +var + AKey: Word; +begin + AKey := TranslateKey(Key); + if (((AKey = VK_UP) or (AKey = VK_DOWN)) and (ssAlt in Shift)) or + ((AKey = VK_F4) and not (ssAlt in Shift)) then + if HasPopupWindow then + begin + CloseUp(crClose); + Key := 0; + end else + begin + DroppedDown := True; + Key := 0; + end + else + if ((AKey = VK_RETURN) or (AKey = VK_ESCAPE)) and not(ssAlt in Shift) and HasPopupWindow then + begin + FIsPopupWindowJustClosed := True; + KeyboardAction := True; + if (AKey = VK_RETURN) and DoEditing then + CloseUp(crEnter) + else + CloseUp(crCancel); + KeyboardAction := False; + if not HasPopupWindow then + begin +// if not(ActiveProperties.UseLookupData and not ILookupData.Find(DisplayValue)) then // TODO + Key := 0; + if AKey = VK_ESCAPE then + SetCaptureControl(nil); + end; + end; + if Key <> 0 then + inherited DoEditKeyDown(Key, Shift); +end; + +procedure TcxCustomDropDownEdit.DoEditKeyPress(var Key: Char); +begin + if (Key >= #32) and (Key <= #255) and ActiveProperties.ImmediateDropDown and + not HasPopupWindow then + begin + DroppedDown := True; + + if ActiveProperties.PopupWindowCapturesFocus and (TranslateKey(Word(Key)) <> VK_RETURN) and + CanDropDown and (GetPopupFocusedControl <> nil) then + begin + PostMessage(PopupWindow.Handle, CM_POPUPCONTROLKEY, Integer(Key), 0); + Key := #0; + end; + end; + if Key <> #0 then + inherited DoEditKeyPress(Key); +end; + +procedure TcxCustomDropDownEdit.DoEditProcessTab(Shift: TShiftState); +begin + if HasPopupWindow and ActiveProperties.PostPopupValueOnTab then + CloseUp(crTab); + inherited DoEditProcessTab(Shift); +end; + +function TcxCustomDropDownEdit.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; +begin + Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos); + if Result then + Exit; + if GetScrollLookupDataList(escMouseWheel) and HasPopupWindow and + ActiveProperties.UseLookupData and not ILookupData.IsEmpty then + with ILookupData do + begin + Result := True; +{$IFDEF DELPHI6} + if GetActiveControl is TControl then + TControlAccess(ActiveControl).DoMouseWheel(Shift, WheelDelta, MousePos) +{$ELSE} + if GetActiveControl is TWinControl then + TWinControlAccess(ActiveControl).DoMouseWheel(Shift, WheelDelta, MousePos) +{$ENDIF} + end; +end; + +procedure TcxCustomDropDownEdit.FocusChanged; +begin + if not ActiveProperties.PopupWindowCapturesFocus and not InnerControl.Focused then + CloseUp(crUnknown); + inherited FocusChanged; +end; + +function TcxCustomDropDownEdit.GetEditDataClass: TcxCustomEditDataClass; +begin + Result := TcxCustomDropDownEditData; +end; + +function TcxCustomDropDownEdit.GetInnerEditClass: TControlClass; +begin + Result := TcxCustomDropDownInnerEdit; +end; + +function TcxCustomDropDownEdit.GetScrollLookupDataList(AScrollCause: TcxEditScrollCause): Boolean; +begin + Result := not PropertiesChangeLocked and (not IsInplace or + (AScrollCause = escMouseWheel) or not InplaceParams.MultiRowParent or HasPopupWindow); +end; + +procedure TcxCustomDropDownEdit.Initialize; +begin + inherited Initialize; + if not IsDesigning then + CreatePopupWindow; + FSendChildrenStyle := True; + FPopupControlsLookAndFeel := TcxEditPopupControlLookAndFeel.Create(Self); + FPopupControlsLookAndFeel.OnChanged := PopupControlsLookAndFeelChanged; +end; + +procedure TcxCustomDropDownEdit.InitializeEditData; +begin + with TcxCustomDropDownEditData(EditData) do + begin + Initialized := False; + Width := ActiveProperties.PopupWidth; + Height := ActiveProperties.PopupHeight; + end; +end; + +function TcxCustomDropDownEdit.InternalGetNotPublishedStyleValues: TcxEditStyleValues; +begin + Result := inherited InternalGetNotPublishedStyleValues - + [svButtonStyle, svButtonTransparency, svGradientButtons, svPopupBorderStyle]; +end; + +function TcxCustomDropDownEdit.IsEditorKey(Key: Word; Shift: TShiftState): Boolean; +begin + Result := inherited IsEditorKey(Key, Shift) or IsInplace and HasPopupWindow and + not((Shift * [ssAlt, ssCtrl] = []) and (Key >= 32) and (Key <= 255)); +end; + +procedure TcxCustomDropDownEdit.PropertiesChanged(Sender: TObject); +begin + if not ActiveProperties.PopupSizeable then + FPopupSizeChanged := False; + if HasPopupWindow then + SetupPopupWindow; + inherited PropertiesChanged(Sender); +end; + +function TcxCustomDropDownEdit.HasPopupWindow: Boolean; +begin + Result := (PopupWindow <> nil) and PopupWindow.IsVisible; +end; + +procedure TcxCustomDropDownEdit.PasteFromClipboard; +var + APrevKeyboardAction: Boolean; + APrevText: string; +begin + if Focused then + begin + APrevKeyboardAction := KeyboardAction; + KeyboardAction := True; + try + APrevText := InnerTextEdit.EditValue; + inherited PasteFromClipboard; + if not InternalCompareString(APrevText, InnerTextEdit.EditValue, True) and + ActiveProperties.ImmediateDropDown and not HasPopupWindow then + begin + DroppedDown := True; + if ActiveProperties.UseLookupData then + PostMessage(Handle, CM_DROPDOWNBYPASTE, 0, 0); + end; + finally + KeyboardAction := APrevKeyboardAction; + end; + end + else + inherited PasteFromClipboard; +end; + +function TcxCustomDropDownEdit.CanHide: Boolean; +begin + Result := True; +end; + +procedure TcxCustomDropDownEdit.MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + if not FIsActivatingByMouse and ActiveProperties.DropDownOnClick and (Button = mbLeft) and + PtInRect(ViewInfo.ClientRect, Point(X, Y)) and not HasPopupWindow and + not FIsHotAndPopup and IsFocused then + DroppedDown := True; +end; + +function TcxCustomDropDownEdit.RefreshContainer(const P: TPoint; Button: TcxMouseButton; + Shift: TShiftState; AIsMouseEvent: Boolean): Boolean; +begin + Result := inherited RefreshContainer(P, Button, Shift, AIsMouseEvent); + if HasPopupWindow then + with ViewInfo do + if IsButtonReallyPressed and (PressedButton = -1) then + CloseUp(crUnknown); + if AIsMouseEvent and not((Button = cxmbLeft) and (cxButtonToShift(Button) * Shift <> [])) then + SetIsHotAndPopup; + if FPopupControlsLookAndFeel <> nil then + FPopupControlsLookAndFeel.EditStyleChanged; +end; + +function TcxCustomDropDownEdit.SendActivationKey(Key: Char): Boolean; +begin + Result := not(ActiveProperties.ImmediateDropDown and ActiveProperties.PopupWindowCapturesFocus and + (TranslateKey(Word(Key)) <> VK_RETURN)); +end; + +function TcxCustomDropDownEdit.TabsNeeded: Boolean; +begin + Result := inherited TabsNeeded or + HasPopupWindow and ActiveProperties.PostPopupValueOnTab; +end; + +procedure TcxCustomDropDownEdit.CreateHandle; +begin + inherited CreateHandle; + InitializeLookupData; +end; + +procedure TcxCustomDropDownEdit.DoStartDock(var DragObject: TDragObject); +begin + CloseUp(crUnknown); + inherited DoStartDock(DragObject); +end; + +function TcxCustomDropDownEdit.CanDropDown: Boolean; +begin + Result := False; +end; + +procedure TcxCustomDropDownEdit.CloseUp(AReason: TcxEditCloseUpReason); +var + APrevLookupKey: TcxEditValue; +begin + if not HasPopupWindow then + Exit; + LockChangeEvents(True); + try + if AReason in [crTab, crEnter, crClose] then + begin + if ActiveProperties.UseLookupData then + begin + APrevLookupKey := ILookupData.CurrentKey; + LockClick(True); + try + ILookupData.SelectItem; + finally + LockClick(False); + if ModifiedAfterEnter and not VarEqualsExact(APrevLookupKey, ILookupData.CurrentKey) then + DoClick; + end; + end; + if not ActiveProperties.AlwaysPostEditValue and ActiveProperties.ImmediatePost and + CanPostEditValue then + InternalPostEditValue(True); + end; + finally + LockChangeEvents(False); + end; + FCloseUpReason := AReason; + PopupWindow.CloseUp; +end; + +procedure TcxCustomDropDownEdit.CreatePopupWindow; +begin + with ActiveProperties do + FPopupWindow := GetPopupWindowClass.Create(Self); + FPopupWindow.CaptureFocus := ActiveProperties.PopupWindowCapturesFocus; + FPopupWindow.IsTopMost := not IsInplace; + FPopupWindow.Style.LookAndFeel.MasterLookAndFeel := Style.LookAndFeel; + FPopupWindow.BiDiMode := BiDiMode; + FPopupWindow.OnCloseQuery := PopupWindowCloseQuery; + FPopupWindow.OnClosed := PopupWindowClosed; + FPopupWindow.OnClosing := PopupWindowClosing; + FPopupWindow.OnShowed := PopupWindowShowed; + FPopupWindow.OnShowing := PopupWindowShowing; +end; + +procedure TcxCustomDropDownEdit.DeleteShowPopupWindowMessages; +begin + if (PopupWindow <> nil) and PopupWindow.HandleAllocated and + KillMessages(PopupWindow.Handle, CM_SHOWPOPUPWINDOW, CM_SHOWPOPUPWINDOW) then + PopupWindowClosed(PopupWindow); +end; + +procedure TcxCustomDropDownEdit.DoCloseQuery(var CanClose: Boolean); +begin + with Properties do + if Assigned(OnCloseQuery) then + OnCloseQuery(Self, CanClose); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnCloseQuery) then + OnCloseQuery(Self, CanClose); +end; + +procedure TcxCustomDropDownEdit.DoCloseUp; +begin + DoClosePopup(FCloseUpReason); + with Properties do + if Assigned(OnCloseUp) then + OnCloseUp(Self); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnCloseUp) then + OnCloseUp(Self); +end; + +procedure TcxCustomDropDownEdit.DoFinalizePopup; +begin + if not FPopupInitialized then + Exit; + FPopupInitialized := False; + + if ActiveProperties.UseLookupData then + ILookupData.CloseUp; + + if Assigned(Properties.OnFinalizePopup) then + Properties.OnFinalizePopup(Self); + if (RepositoryItem <> nil) and Assigned(ActiveProperties.OnFinalizePopup) then + ActiveProperties.OnFinalizePopup(Self); +end; + +procedure TcxCustomDropDownEdit.DoInitPopup; +begin + if FPopupInitialized then + Exit; + FPopupInitialized := True; + try + with Properties do + if Assigned(OnInitPopup) then + OnInitPopup(Self); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnInitPopup) then + OnInitPopup(Self); + except + FPopupInitialized := False; + raise; + end; + if ActiveProperties.UseLookupData then + ILookupData.DropDown; +end; + +procedure TcxCustomDropDownEdit.DoPopup; +begin + FCloseUpReason := crUnknown; + with Properties do + if Assigned(OnPopup) then + OnPopup(Self); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnPopup) then + OnPopup(Self); +end; + +procedure TcxCustomDropDownEdit.SetupPopupWindow; +var + P: TPoint; + {$IFDEF DELPHI6} + AParentForm: TCustomForm; + {$ENDIF} +begin + PopupWindow.CaptureFocus := ActiveProperties.PopupWindowCapturesFocus; + InitializeLookupData; + InitializePopupWindow; + PopupWindow.FLockCheckSize := True; + try + PopupWindow.CalculateSize; + P := PopupWindow.CalculatePosition; + PopupWindow.CorrectBoundsWithDesktopWorkArea(P); + finally + PopupWindow.FLockCheckSize := False; + end; + PopupWindow.SetBounds(P.X, P.Y, PopupWindow.Width, PopupWindow.Height); + PopupWindow.RefreshPopupWindow; + PositionPopupWindowChilds(PopupWindow.ViewInfo.ClientRect); + SetEditPopupWindowShadowRegion(PopupWindow); + + {$IFDEF DELPHI6} + if IsWindowsXPOrLater then // W2K bug + begin + AParentForm := GetParentForm(Self); + if AParentForm <> nil then + begin + PopupWindow.AlphaBlend := TCustomFormAccess(AParentForm).AlphaBlend; + PopupWindow.AlphaBlendValue := TCustomFormAccess(AParentForm).AlphaBlendValue; + PopupWindow.TransparentColor := TCustomFormAccess(AParentForm).TransparentColor; + PopupWindow.TransparentColorValue := TCustomFormAccess(AParentForm).TransparentColorValue; + end; + end; + {$ENDIF} +end; + +procedure TcxCustomDropDownEdit.UpdatePopupWindow; +begin + if HasPopupWindow then + SetupPopupWindow; +end; + +procedure TcxCustomDropDownEdit.DropDown; +begin + if not IsWindowVisible(Handle) then + Exit; + DoInitPopup; + if CanDropDown then + begin + SetupPopupWindow; + PopupWindow.HandleNeeded; + PopupWindow.FocusedControl := GetPopupFocusedControl; + PostMessage(PopupWindow.Handle, CM_SHOWPOPUPWINDOW, 0, 0); + end + else + DoFinalizePopup; +end; + +procedure TcxCustomDropDownEdit.EditButtonClick; +begin +end; + +function TcxCustomDropDownEdit.GetPopupFocusedControl: TWinControl; +var + AActiveControl: TControl; +begin + Result := InnerTextEdit.Control; + with ActiveProperties do + if (ILookupData <> nil) and IsLookupDataVisual and PopupWindowCapturesFocus then + begin + AActiveControl := ILookupData.ActiveControl; + if (AActiveControl <> nil) and (AActiveControl is TWinControl) then + Result := TWinControl(AActiveControl); + end; +end; + +function TcxCustomDropDownEdit.GetPopupWindowOwnerControlBounds: TRect; +begin + if IsInplace and not IsRectEmpty(ContentParams.ExternalBorderBounds) then + Result := ContentParams.ExternalBorderBounds + else + Result := VisibleBounds; + if ViewInfo.Shadow then + Inc(Result.Right, cxEditShadowWidth); + OffsetRect(Result, Left, Top); +end; + +procedure TcxCustomDropDownEdit.InitializeLookupData; +begin + with ActiveProperties do + if (ILookupData <> nil) and not IsDesigning and IsLookupDataVisual then + ILookupData.Initialize(PopupWindow); +end; + +procedure TcxCustomDropDownEdit.InitializePopupWindow; +begin + PopupWindow.OwnerParent := Parent; + with ActiveProperties do + begin + PopupWindow.Direction := PopupDirection; + PopupWindow.AlignHorz := PopupHorzAlignment; + PopupWindow.AlignVert := PopupVertAlignment; + PopupWindow.ClientEdge := PopupClientEdge; + PopupWindow.MinHeight := PopupMinHeight; + PopupWindow.MinWidth := PopupMinWidth; + PopupWindow.PopupAutoSize := PopupAutoSize; + PopupWindow.Sizeable := PopupSizeable; + PopupWindow.SysPanelStyle := PopupSysPanelStyle; + end; + + if IsInplace and ActiveProperties.PopupSizeable then + with TcxCustomDropDownEditData(EditData) do + begin + PopupWindow.PopupWidth := Width; + PopupWindow.PopupHeight := Height; + end + else + begin + PopupWindow.PopupWidth := ActiveProperties.PopupWidth; + PopupWindow.PopupHeight := ActiveProperties.PopupHeight; + end; + + PopupWindow.CloseButton := TcxCustomEditStyleAccess(ActiveStyle).PopupCloseButton; + + with ViewInfo do + begin + PopupWindow.BorderStyle := PopupBorderStyle; + PopupWindow.NativeStyle := NativeStyle; + PopupWindow.Shadow := Shadow; + end; +end; + +procedure TcxCustomDropDownEdit.PopupControlsLookAndFeelChanged( + Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); +begin +end; + +procedure TcxCustomDropDownEdit.PopupWindowClosed(Sender: TObject); +begin + if ActiveProperties.PopupSizeable and FPopupSizeChangedByMouse then + if IsInplace then + begin + if EditData <> nil then + with TcxCustomDropDownEditData(EditData) do + begin + Initialized := True; + Width := PopupWindow.Width; + Height := PopupWindow.Height; + end + end else + begin + with ActiveProperties do + begin + PopupWidth := PopupWindow.Width; + PopupHeight := PopupWindow.Height; + end; + end; + + DoFinalizePopup; + + if ActiveProperties.EditingStyle = esFixedList then + ShortRefreshContainer(False); + DoCloseUp; + LockChangeEvents(True); + try + if ActiveProperties.AlwaysPostEditValue and ActiveProperties.ImmediatePost and + CanPostEditValue and ValidateEdit(True) then + InternalPostEditValue; + finally + LockChangeEvents(False); + end; + + ShortRefreshContainer(False); + if not HandleAllocated then + SetIsHotAndPopup; // perform if VK_ESC was pressed and WM_MOUSEMOVE didn't occur +end; + +procedure TcxCustomDropDownEdit.PopupWindowCloseQuery(Sender: TObject; var CanClose: Boolean); +begin + DoCloseQuery(CanClose); +end; + +procedure TcxCustomDropDownEdit.PopupWindowClosing(Sender: TObject); +begin +end; + +procedure TcxCustomDropDownEdit.PopupWindowShowing(Sender: TObject); +begin +end; + +procedure TcxCustomDropDownEdit.PopupWindowShowed(Sender: TObject); +begin + ShortRefreshContainer(False); + PopupWindow.CalculateViewInfo; + PositionPopupWindowChilds(PopupWindow.ViewInfo.ClientRect); + DoPopup; + UpdateDrawValue; + with ActiveProperties do + if UseLookupData and FindSelection and ImmediateDropDown and + PopupWindowCapturesFocus then + ILookupData.DroppedDown(Copy(DisplayValue, 1, SelStart)); + FPopupSizeChangedByMouse := False; +end; + +procedure TcxCustomDropDownEdit.PositionPopupWindowChilds(const AClientRect: TRect); +begin + ILookupData.PositionVisualArea(AClientRect); +end; + +procedure TcxCustomDropDownEdit.SetIsHotAndPopup; +begin + FIsHotAndPopup := HasPopupWindow and (csHotTrack in ViewInfo.ContainerState); +end; + +procedure TcxCustomDropDownEdit.DropDownByPasteHandler; +var + APrevLookupKey: TcxEditValue; +begin + if not HasPopupWindow then + Exit; + + APrevLookupKey := ILookupData.CurrentKey; + LockClick(True); + try + ILookupData.TextChanged; + finally + LockClick(False); + if not VarEqualsExact(APrevLookupKey, ILookupData.CurrentKey) then + DoClick; + end; + + case ActiveProperties.EditingStyle of + esFixedList: + FindSelection := True; + esEdit: + FindSelection := (SelStart = Length(Text)) and ILookupData.Find(Text); + end; +end; + +function TcxCustomDropDownEdit.GetDroppedDown: Boolean; +begin + Result := HasPopupWindow; +end; + +function TcxCustomDropDownEdit.GetProperties: TcxCustomDropDownEditProperties; +begin + Result := TcxCustomDropDownEditProperties(FProperties); +end; + +function TcxCustomDropDownEdit.GetActiveProperties: TcxCustomDropDownEditProperties; +begin + Result := TcxCustomDropDownEditProperties(InternalGetActiveProperties); +end; + +procedure TcxCustomDropDownEdit.SetDroppedDown(Value: Boolean); +var + AMsg: TMsg; +begin + if DroppedDown <> Value then + if not Value then + CloseUp(crUnknown) + else + if not PeekMessage(AMsg, PopupWindow.Handle, CM_SHOWPOPUPWINDOW, CM_SHOWPOPUPWINDOW, PM_NOREMOVE) then + DropDown; +end; + +procedure TcxCustomDropDownEdit.SetProperties(Value: TcxCustomDropDownEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomDropDownEdit.CMBiDiModeChanged(var Message: TMessage); +begin + inherited; + if PopupWindow <> nil then + PopupWindow.BiDiMode := BiDiMode; +end; + +procedure TcxCustomDropDownEdit.CMDropDownByPaste(var Message: TMessage); +begin + DropDownByPasteHandler; +end; + +procedure TcxCustomDropDownEdit.CMHintShow(var Message: TCMHintShow); +begin + Message.Result := Integer(DroppedDown); +end; + +{ TcxFilterDropDownEditHelper } + +class function TcxFilterDropDownEditHelper.EditPropertiesHasButtons: Boolean; +begin + Result := True; +end; + +{ TcxComboBoxPopupWindow } + +procedure TcxComboBoxPopupWindow.CalculateSize; +var + AClientExtent: TRect; + AMinSize: TSize; + APreferredWidth, APreferredHeight: Integer; + APopupWindowVisualAreaSize: TSize; + ASizeChanged: Boolean; +begin + ViewInfo.SizeGripCorner := ecoBottomRight; + OwnerBounds := Edit.GetPopupWindowOwnerControlBounds; + AClientExtent := ViewInfo.GetClientExtent; + AMinSize := MinSize; + APopupWindowVisualAreaSize := Edit.GetPopupWindowClientPreferredSize; + ASizeChanged := Edit.FPopupSizeChanged; + if Sizeable and ASizeChanged or not PopupAutoSize and (PopupWidth > 0) then + APreferredWidth := PopupWidth + else + if PopupAutoSize then + begin + APreferredWidth := APopupWindowVisualAreaSize.cx + AClientExtent.Left + AClientExtent.Right; + APreferredWidth := Max(APreferredWidth, cxRectWidth(OwnerBounds)); + end + else + APreferredWidth := cxRectWidth(OwnerBounds); + + if not(Sizeable and ASizeChanged) and (PopupHeight = 0) or + not Sizeable and PopupAutoSize then + APreferredHeight := APopupWindowVisualAreaSize.cy + AClientExtent.Top + + AClientExtent.Bottom + else + APreferredHeight := PopupHeight; + + if Sizeable then + begin + APreferredWidth := Max(APreferredWidth, MinWidth); + APreferredHeight := Max(APreferredHeight, MinHeight); + end; + APreferredWidth := Max(APreferredWidth, AMinSize.cx); + APreferredHeight := Max(APreferredHeight, AMinSize.cy); + + Width := APreferredWidth; + Height := APreferredHeight; +end; + +{ TcxCustomComboBoxListBox } + +constructor TcxCustomComboBoxListBox.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Style := lbOwnerDrawVariable; +end; + +function TcxCustomComboBoxListBox.GetHeight(ARowCount: Integer; AMaxHeight: Integer): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to ARowCount - 1 do + Inc(Result, GetItemHeight(I)); +end; + +procedure TcxCustomComboBoxListBox.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + if Edit.IsOnDrawItemEventAssigned then + with Params.WindowClass do + style := style or CS_HREDRAW; +end; + +function TcxCustomComboBoxListBox.DoDrawItem(AIndex: Integer; const ARect: TRect; + AState: TOwnerDrawState): Boolean; +begin + Result := Edit.IsOnDrawItemEventAssigned; + if Result then + Edit.DoOnDrawItem(Canvas, AIndex, ARect, AState); +end; + +function TcxCustomComboBoxListBox.GetItem(Index: Integer): string; +begin + Result := Edit.LookupData.GetItem(Index); +end; + +procedure TcxCustomComboBoxListBox.MeasureItem(Index: Integer; var Height: Integer); +begin + Height := GetItemHeight(Index); +end; + +procedure TcxCustomComboBoxListBox.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + if (Edit <> nil) and Edit.PopupMouseMoveLocked then + Edit.PopupMouseMoveLocked := False + else + inherited MouseMove(Shift, X, Y); +end; + +procedure TcxCustomComboBoxListBox.RecreateWindow; +begin + InternalRecreateWindow; +end; + +function TcxCustomComboBoxListBox.GetEdit: TcxCustomComboBox; +begin + Result := TcxCustomComboBox(inherited Edit); +end; + +{ TcxComboBoxListBox } + +function TcxComboBoxListBox.GetItemHeight(AIndex: Integer = -1): Integer; +begin + if Edit.ActiveProperties.ItemHeight > 0 then + Result := Edit.ActiveProperties.ItemHeight + else + Result := inherited GetItemHeight; + if (AIndex >= 0) and Edit.IsOnMeasureItemEventAssigned then + Edit.DoOnMeasureItem(AIndex, Canvas, Result); +end; + +procedure TcxComboBoxListBox.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +var + AItemIndex: Integer; +begin + inherited MouseUp(Button, Shift, X, Y); + if Button <> mbLeft then + Exit; + AItemIndex := ItemAtPos(Point(X, Y), True); + if AItemIndex <> -1 then + begin + SetCaptureControl(nil); + ItemIndex := AItemIndex; + Edit.CloseUp(crEnter); + end; +end; + +procedure TcxComboBoxListBox.RecreateWindow; +begin + ItemHeight := GetItemHeight; + if Edit.IsOnMeasureItemEventAssigned then + Style := lbOwnerDrawVariable + else + Style := lbOwnerDrawFixed; +end; + +procedure TcxComboBoxListBox.SetItemIndex(const Value: Integer); +begin + Edit.PopupMouseMoveLocked := True; + inherited SetItemIndex(Value); +end; + +procedure TcxComboBoxListBox.Resize; +var + ARgn: HRGN; +begin + if not Edit.HasPopupWindow then + Exit; + if HScrollBar.Visible and VScrollBar.Visible then + begin + ARgn := CreateRectRgnIndirect(GetSizeGripRect); + SendMessage(Handle, WM_NCPAINT, ARgn, 0); + DeleteObject(ARgn); + end; +end; + +{ TcxComboBoxLookupData } + +function TcxComboBoxLookupData.CanResizeVisualArea(var NewSize: TSize; + AMaxHeight: Integer = 0; AMaxWidth: Integer = 0): Boolean; +var + I: Integer; + AItemCount: Integer; + AItemHeight: Integer; + AListClientSize, AListSize: TSize; + AMinWidth: Integer; + AScrollBarSize: TSize; + AVScrollBar: Boolean; +begin + Result := True; + if (NewSize.cx = List.Width) and (NewSize.cy = List.Height) then + Exit; + if AMaxHeight = 0 then + AMaxHeight := MaxInt; + if AMaxWidth = 0 then + AMaxWidth := MaxInt; + AItemCount := GetItemCount; + AListClientSize.cy := 0; + AScrollBarSize := GetScrollBarSize; + AVScrollBar := False; + for I := 0 to AItemCount - 1 do + begin + AItemHeight := List.GetItemHeight(I); + AListClientSize.cy := AListClientSize.cy + AItemHeight; + AListSize.cy := AListClientSize.cy; + AListClientSize.cx := NewSize.cx; + AVScrollBar := I < AItemCount - 1; + if AVScrollBar then + AListClientSize.cx := AListClientSize.cx - AScrollBarSize.cx; + if (AListClientSize.cx < List.ScrollWidth) or (AListClientSize.cx > AMaxWidth) then + AListSize.cy := AListSize.cy + AScrollBarSize.cy; + if (AListSize.cy = NewSize.cy) and not (AListSize.cy > AMaxHeight) then + Break; + if (AListSize.cy > NewSize.cy) or (AListSize.cy > AMaxHeight) then + if (AListSize.cy > AMaxHeight) or (NewSize.cy >= List.Height) then + begin + AListClientSize.cy := AListClientSize.cy - AItemHeight; + AListSize.cy := AListClientSize.cy; + AListClientSize.cx := NewSize.cx; + AVScrollBar := I < AItemCount; + if AVScrollBar then + AListClientSize.cx := AListClientSize.cx - AScrollBarSize.cx; + if (AListClientSize.cx < List.ScrollWidth) or (AListClientSize.cx > AMaxWidth) then + AListSize.cy := AListSize.cy + AScrollBarSize.cy; + Break; + end + else + if NewSize.cy < List.Height then + Break; + end; + NewSize.cy := AListSize.cy; + AMinWidth := 0; + if AVScrollBar then + Inc(AMinWidth, AScrollBarSize.cx); + if AListSize.cy > AListClientSize.cy then + Inc(AMinWidth, AScrollBarSize.cx); + NewSize.cx := Max(NewSize.cx, AMinWidth); +end; + +function TcxComboBoxLookupData.GetVisualAreaPreferredSize(AMaxHeight: Integer; + AWidth: Integer = 0): TSize; +var + AItemWidth: Integer; + AListRowCount, I: Integer; +begin + AListRowCount := GetItemCount; + with TcxCustomComboBoxProperties(ActiveProperties) do + if AListRowCount > DropDownRows then + AListRowCount := DropDownRows; + Result.cy := List.GetHeight(AListRowCount, AMaxHeight); + Result.cx := 0; + for I := 0 to GetItemCount - 1 do + begin + AItemWidth := List.GetItemWidth(I); + if AItemWidth > Result.cx then + Result.cx := AItemWidth; + end; + Result.cx := Result.cx + 4; + List.SetScrollWidth(Result.cx); + with TcxCustomComboBoxProperties(ActiveProperties) do + if (GetItemCount > DropDownRows) or (AMaxHeight > 0) and (Result.cy > AMaxHeight) then + Result.cx := Result.cx + GetScrollBarSize.cx; + if (AWidth > 0) and (Result.cx > AWidth) then + Result.cy := Result.cy + GetScrollBarSize.cy; +end; + +procedure TcxComboBoxLookupData.Initialize(AVisualControlsParent: TWinControl); +begin + inherited Initialize(AVisualControlsParent); + List.LookAndFeel.MasterLookAndFeel := + TcxCustomDropDownEdit(Edit).PopupControlsLookAndFeel; +end; + +function TcxComboBoxLookupData.GetListBoxClass: TcxCustomEditListBoxClass; +begin + Result := TcxComboBoxListBox; +end; + +{ TcxCustomComboBoxViewData } + +procedure TcxCustomComboBoxViewData.Calculate(ACanvas: TcxCanvas; + const ABounds: TRect; const P: TPoint; Button: TcxMouseButton; + Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); +var + AItemIndex: Integer; +begin + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, + AIsMouseEvent); + + if (Properties.DropDownListStyle = lsFixedList) and Assigned(Edit) and + TcxCustomComboBox(Edit).IsOnDrawItemEventAssigned then + AItemIndex := TcxCustomComboBox(Edit).ItemIndex + else + AItemIndex := -1; + + with TcxCustomComboBoxViewInfo(AViewInfo) do + begin + ItemIndex := AItemIndex; + IsOwnerDrawing := ItemIndex <> -1; + end; +end; + +procedure TcxCustomComboBoxViewData.EditValueToDrawValue(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; AViewInfo: TcxCustomEditViewInfo); +begin + inherited EditValueToDrawValue(ACanvas, AEditValue, AViewInfo); + with TcxCustomComboBoxViewInfo(AViewInfo) do + begin + if (Properties.DropDownListStyle = lsFixedList) and Assigned(Properties.OnDrawItem) then + ItemIndex := Properties.LookupItems.IndexOf(VarToStr(AEditValue)) + else + ItemIndex := -1; + IsOwnerDrawing := ItemIndex <> -1; + end; +end; + +function TcxCustomComboBoxViewData.IsComboBoxStyle: Boolean; +begin + Result := True; +end; + +function TcxCustomComboBoxViewData.GetProperties: TcxCustomComboBoxProperties; +begin + Result := TcxCustomComboBoxProperties(FProperties); +end; + +{ TcxCustomComboBoxViewInfo } + +constructor TcxCustomComboBoxViewInfo.Create; +begin + inherited Create; + CustomDrawHandler := DoCustomDraw; +end; + +procedure TcxCustomComboBoxViewInfo.DoCustomDraw(ACanvas: TcxCanvas; ARect: TRect); +var + AState: TOwnerDrawState; + ATextColor: TColor; +begin + AState := [odComboBoxEdit]; + if Focused then + AState := AState + [odSelected, odFocused]; + + if DrawSelectionBar then + begin + ACanvas.Brush.Color := clHighlight; + ATextColor := clHighlightText; + end + else + begin + ACanvas.Brush.Color := BackgroundColor; + ATextColor := TextColor; + end; + ACanvas.Font := Font; + ACanvas.Font.Color := ATextColor; + PrepareCanvasFont(ACanvas.Canvas); + + if Edit = nil then + TcxCustomComboBoxProperties(EditProperties).OnDrawItem(nil, ACanvas, + ItemIndex, ARect, AState) + else + Edit.DoOnDrawItem(ACanvas, ItemIndex, ARect, AState); +end; + +function TcxCustomComboBoxViewInfo.GetEdit: TcxCustomComboBox; +begin + Result := TcxCustomComboBox(FEdit); +end; + +{ TcxCustomComboBoxProperties } + +constructor TcxCustomComboBoxProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FDropDownListStyle := lsEditList; + FDropDownRows := cxEditDefaultDropDownPageRowCount; +end; + +procedure TcxCustomComboBoxProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomComboBoxProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with Source as TcxCustomComboBoxProperties do + begin + Self.DropDownListStyle := DropDownListStyle; + Self.DropDownRows := DropDownRows; + Self.ItemHeight := ItemHeight; + Self.Revertable := Revertable; + + Self.OnDrawItem := OnDrawItem; + Self.OnMeasureItem := OnMeasureItem; + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +class function TcxCustomComboBoxProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxComboBox; +end; + +class function TcxCustomComboBoxProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxCustomComboBoxViewInfo; +end; + +function TcxCustomComboBoxProperties.DropDownOnClick: Boolean; +begin + Result := DropDownListStyle = lsFixedList; +end; + +function TcxCustomComboBoxProperties.GetDropDownPageRowCount: Integer; +begin + Result := DropDownRows; +end; + +function TcxCustomComboBoxProperties.GetEditingStyle: TcxEditEditingStyle; +const + AEditingStyleMap: array[TcxEditDropDownListStyle] of TcxEditEditingStyle = + (esEditList, esEdit, esFixedList); +begin + Result := AEditingStyleMap[DropDownListStyle]; +end; + +class function TcxCustomComboBoxProperties.GetLookupDataClass: TcxInterfacedPersistentClass; +begin + Result := TcxComboBoxLookupData; +end; + +class function TcxCustomComboBoxProperties.GetPopupWindowClass: TcxCustomEditPopupWindowClass; +begin + Result := TcxComboBoxPopupWindow; +end; + +class function TcxCustomComboBoxProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxCustomComboBoxViewData; +end; + +function TcxCustomComboBoxProperties.UseLookupData: Boolean; +begin + Result := True; +end; + +function TcxCustomComboBoxProperties.GetDropDownAutoWidth: Boolean; +begin + Result := PopupAutoSize; +end; + +function TcxCustomComboBoxProperties.GetDropDownSizeable: Boolean; +begin + Result := PopupSizeable; +end; + +function TcxCustomComboBoxProperties.GetDropDownWidth: Integer; +begin + Result := PopupWidth; +end; + +function TcxCustomComboBoxProperties.GetItems: TStrings; +begin + Result := LookupItems; +end; + +function TcxCustomComboBoxProperties.GetSorted: Boolean; +begin + Result := LookupItemsSorted; +end; + +procedure TcxCustomComboBoxProperties.SetDropDownAutoWidth(Value: Boolean); +begin + PopupAutoSize := Value; +end; + +procedure TcxCustomComboBoxProperties.SetDropDownListStyle(Value: TcxEditDropDownListStyle); +begin + if Value = FDropDownListStyle then + Exit; + FDropDownListStyle := Value; + Changed; +end; + +procedure TcxCustomComboBoxProperties.SetDropDownRows(Value: Integer); +begin + if (Value >= 1) and (Value <> FDropDownRows) then + begin + FDropDownRows := Value; + Changed; + end; +end; + +procedure TcxCustomComboBoxProperties.SetDropDownSizeable(Value: Boolean); +begin + PopupSizeable := Value; +end; + +procedure TcxCustomComboBoxProperties.SetDropDownWidth(Value: Integer); +begin + PopupWidth := Value; +end; + +procedure TcxCustomComboBoxProperties.SetItemHeight(Value: Integer); +begin + if Value <> FItemHeight then + begin + FItemHeight := Value; + Changed; + end; +end; + +procedure TcxCustomComboBoxProperties.SetItems(Value: TStrings); +begin + LookupItems := Value; +end; + +procedure TcxCustomComboBoxProperties.SetSorted(Value: Boolean); +begin + LookupItemsSorted := Value; +end; + +{ TcxCustomComboBoxInnerEdit } + +procedure TcxCustomComboBoxInnerEdit.WMLButtonUp(var Message: TWMLButtonUp); +begin + ControlState := ControlState - [csClicked]; + inherited; +end; + +{ TcxCustomComboBox } + +procedure TcxCustomComboBox.Activate(var AEditData: TcxCustomEditData); +begin + inherited Activate(AEditData); + SynchronizeItemIndex; +end; + +class function TcxCustomComboBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomComboBoxProperties; +end; + +function TcxCustomComboBox.CanDropDown: Boolean; +begin + Result := not((ILookupData <> nil) and (ILookupData.IsEmpty)); // TODO ??? +end; + +procedure TcxCustomComboBox.ChangeHandler(Sender: TObject); +var + APrevLookupKey: TcxEditValue; +begin + APrevLookupKey := ILookupData.CurrentKey; + LockChangeEvents(True); + LockClick(True); + try + inherited ChangeHandler(Sender); + if CanSynchronizeLookupData then + ILookupData.TextChanged; + finally + LockClick(False); + LockChangeEvents(False); + if (*ModifiedAfterEnter and *)not VarEqualsExact(APrevLookupKey, ILookupData.CurrentKey) then + DoClick; + end; +end; + +procedure TcxCustomComboBox.DblClick; +var + APrevCurrentKey: TcxEditValue; +begin + inherited DblClick; + LockChangeEvents(True); + LookupItemsScrolling := True; + try + if not HasPopupWindow and ActiveProperties.Revertable then + with ILookupData do + begin + APrevCurrentKey := CurrentKey; + Go(egdNext, True); + if not VarEqualsExact(APrevCurrentKey, ILookupData.CurrentKey) and + CanPostEditValue and ActiveProperties.ImmediatePost and ValidateEdit(True) then + InternalPostEditValue; + end; + finally + LookupItemsScrolling := False; + LockChangeEvents(False); + end; +end; + +procedure TcxCustomComboBox.DoFocusChanged; +begin + if ActiveProperties.AutoSelect and ActiveProperties.HideSelection and not Focused then + SetSelection(0, 0); + inherited; +end; + +function TcxCustomComboBox.GetInnerEditClass: TControlClass; +begin + Result := TcxCustomComboBoxInnerEdit; +end; + +function TcxCustomComboBox.GetPopupWindowClientPreferredSize: TSize; +var + AMaxVisualAreaSize: TSize; + AClientExtent: TRect; + AWidth: Integer; +begin + AMaxVisualAreaSize := PopupWindow.GetMaxVisualAreaSize; + with ActiveProperties do + if not PopupSizeable and not PopupAutoSize then + begin + if PopupWidth > 0 then + AWidth := PopupWidth + else + AWidth := cxRectWidth(GetPopupWindowOwnerControlBounds); + AClientExtent := PopupWindow.ViewInfo.GetClientExtent; + Dec(AWidth, AClientExtent.Left + AClientExtent.Right); + AWidth := Min(AWidth, AMaxVisualAreaSize.cx); + end + else + AWidth := AMaxVisualAreaSize.cx; + Result := ILookupData.GetVisualAreaPreferredSize(AMaxVisualAreaSize.cy, AWidth); +end; + +procedure TcxCustomComboBox.Initialize; +begin + inherited Initialize; + ControlStyle := ControlStyle - [csClickEvents]; +end; + +procedure TcxCustomComboBox.InitializePopupWindow; +begin + inherited InitializePopupWindow; + PopupWindow.SysPanelStyle := ActiveProperties.PopupSizeable; +end; + +procedure TcxCustomComboBox.MouseMove(Shift: TShiftState; X, Y: Integer); +var + AActiveControl: TControl; + AMousePos: TSmallPoint; + P: TPoint; +begin + inherited MouseMove(Shift, X, Y); + AActiveControl := ILookupData.ActiveControl; + if (GetCaptureControl = Self) and (AActiveControl is TWinControl) then + with AActiveControl as TWinControl do + begin + P := InternalGetCursorPos; + if HasPopupWindow and PtInRect(PopupWindow.ViewInfo.ClientRect, + PopupWindow.ScreenToClient(P)) and ILookupData.IsMouseOverList(P) then + begin + AMousePos := PointToSmallPoint(ScreenToClient(P)); + SendMessage(Handle, WM_LBUTTONDOWN, 0, + LPARAM(Word(AMousePos.X) or (Word(AMousePos.Y) shr 16))); + end; + end; +end; + +procedure TcxCustomComboBox.PopupWindowShowed(Sender: TObject); +var + P: TPoint; +begin + inherited PopupWindowShowed(Sender); + with ILookupData do + if ActiveControl is TWinControl then + begin + P := InternalGetCursorPos; + if IsMouseOverList(P) then + FPopupMouseMoveLocked := True; + end; +end; + +procedure TcxCustomComboBox.SetupPopupWindow; +begin + inherited SetupPopupWindow; + if ILookupData.ActiveControl <> nil then + ILookupData.ActiveControl.Invalidate; +end; + +function TcxCustomComboBox.CanSynchronizeLookupData: Boolean; +var + AMsg: TMsg; +begin + Result := not FLookupDataTextChangedLocked and + ( + HasPopupWindow or + not ActiveProperties.CanIncrementalSearch and PeekMessage(AMsg, PopupWindow.Handle, CM_SHOWPOPUPWINDOW, CM_SHOWPOPUPWINDOW, PM_NOREMOVE) or + ( + (ActiveProperties.EditingStyle in [esEditList, esFixedList, esNoEdit]) or + Focused and not InternalCompareString(Text, ILookupData.GetDisplayText(ILookupData.CurrentKey), False) + ) + ); +end; + +procedure TcxCustomComboBox.ResetPopupHeight; +begin + if ActiveProperties.PopupSizeable and IsInplace then + begin + if EditData <> nil then + TcxCustomDropDownEditData(EditData).Height := 0 + end + else + ActiveProperties.PopupHeight := 0; +end; + +procedure TcxCustomComboBox.SynchronizeItemIndex; +begin + if ActiveProperties.UseLookupData then + ILookupData.TextChanged; +end; + +procedure TcxCustomComboBox.DoOnDrawItem(ACanvas: TcxCanvas; AIndex: Integer; + const ARect: TRect; AState: TOwnerDrawState); +begin + with Properties do + if Assigned(OnDrawItem) then + OnDrawItem(Self, ACanvas, AIndex, ARect, AState); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnDrawItem) then + OnDrawItem(Self, ACanvas, AIndex, ARect, AState); +end; + +procedure TcxCustomComboBox.DoOnMeasureItem(AIndex: Integer; ACanvas: TcxCanvas; + var AHeight: Integer); +begin + with Properties do + if Assigned(OnMeasureItem) then + OnMeasureItem(Self, AIndex, ACanvas, AHeight); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnMeasureItem) then + OnMeasureItem(Self, AIndex, ACanvas, AHeight); +end; + +function TcxCustomComboBox.IsOnDrawItemEventAssigned: Boolean; +begin + Result := Assigned(Properties.OnDrawItem) or + Assigned(ActiveProperties.OnDrawItem); +end; + +function TcxCustomComboBox.IsOnMeasureItemEventAssigned: Boolean; +begin + Result := Assigned(Properties.OnMeasureItem) or + Assigned(ActiveProperties.OnMeasureItem); +end; + +function TcxCustomComboBox.GetActiveProperties: TcxCustomComboBoxProperties; +begin + Result := TcxCustomComboBoxProperties(InternalGetActiveProperties); +end; + +function TcxCustomComboBox.GetLookupData: TcxComboBoxLookupData; +begin + Result := TcxComboBoxLookupData(FLookupData); +end; + +function TcxCustomComboBox.GetProperties: TcxCustomComboBoxProperties; +begin + Result := TcxCustomComboBoxProperties(FProperties); +end; + +function TcxCustomComboBox.GetSelectedItem: Integer; +begin + if ILookupData.ActiveControl <> nil then + Result := TcxCustomEditListBox(ILookupData.ActiveControl).ItemIndex + else + Result := -1; +end; + +procedure TcxCustomComboBox.SetProperties(Value: TcxCustomComboBoxProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomComboBox.SetSelectedItem(Value: Integer); +begin + if ILookupData.ActiveControl <> nil then + TcxCustomEditListBox(ILookupData.ActiveControl).ItemIndex := Value; +end; + +procedure TcxCustomComboBox.WMLButtonUp(var Message: TWMLButtonUp); +begin + ControlState := ControlState - [csClicked]; + inherited; +end; + +{ TcxComboBox } + +class function TcxComboBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxComboBoxProperties; +end; + +function TcxComboBox.GetActiveProperties: TcxComboBoxProperties; +begin + Result := TcxComboBoxProperties(InternalGetActiveProperties); +end; + +function TcxComboBox.GetProperties: TcxComboBoxProperties; +begin + Result := TcxComboBoxProperties(FProperties); +end; + +procedure TcxComboBox.SetProperties(Value: TcxComboBoxProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxFilterComboBoxHelper } + +class function TcxFilterComboBoxHelper.GetFilterEditClass: TcxCustomEditClass; +begin + Result := TcxComboBox; +end; + +class procedure TcxFilterComboBoxHelper.InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); +begin + inherited InitializeProperties(AProperties, AEditProperties, AHasButtons); + with TcxCustomComboBoxProperties(AProperties) do + begin + ButtonGlyph := nil; + DropDownRows := 8; + DropDownListStyle := lsEditList; + ImmediateDropDown := False; + PopupAlignment := taLeftJustify; + Revertable := False; + end; +end; + +{ TcxPopupEditPopupWindowViewInfo } + +procedure TcxPopupEditPopupWindowViewInfo.DrawBorder(ACanvas: TcxCanvas; var R: TRect); +begin + DrawPopupEditPopupWindowBorder(ACanvas, Self, R); +end; + +{ TcxPopupEditPopupWindow } + +function TcxPopupEditPopupWindow.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxPopupEditPopupWindowViewInfo; +end; + +{ TcxCustomPopupEditProperties } + +constructor TcxCustomPopupEditProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FPopupAutoSize := True; + FPopupHeight := 200; + FPopupMinHeight := 100; + FPopupMinWidth := 100; + FPopupSizeable := True; + FPopupWidth := 250; +end; + +procedure TcxCustomPopupEditProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomPopupEditProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with Source as TcxCustomPopupEditProperties do + Self.PopupControl := PopupControl; + finally + EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +class function TcxCustomPopupEditProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxPopupEdit; +end; + +procedure TcxCustomPopupEditProperties.FreeNotification(Sender: TComponent); +begin + inherited FreeNotification(Sender); + if Sender = FPopupControl then + FPopupControl := nil; +end; + +class function TcxCustomPopupEditProperties.GetPopupWindowClass: TcxCustomEditPopupWindowClass; +begin + Result := TcxPopupEditPopupWindow; +end; + +function TcxCustomPopupEditProperties.IsLookupDataVisual: Boolean; +begin + Result := False; +end; + +function TcxCustomPopupEditProperties.PopupWindowCapturesFocus: Boolean; +begin + Result := True; +end; + +procedure TcxCustomPopupEditProperties.SetPopupControl(Value: TControl); +begin + if Value = FPopupControl then + Exit; + if FPopupControl <> nil then + FreeNotificator.RemoveSender(Value); + FPopupControl := Value; + if FPopupControl <> nil then + FreeNotificator.AddSender(Value); +end; + +{ TcxPopupEditProperties } + +constructor TcxPopupEditProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + ImmediateDropDown := True; + ImmediatePopup := True; +end; + +{ TcxCustomPopupEdit } + +destructor TcxCustomPopupEdit.Destroy; +begin + if (FPopupWindow <> nil) and FPopupWindow.IsVisible then + RestorePopupControlData; + inherited Destroy; +end; + +class function TcxCustomPopupEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomPopupEditProperties; +end; + +function TcxCustomPopupEdit.CanDropDown: Boolean; +begin + with ActiveProperties do + Result := PopupControl <> nil; +end; + +procedure TcxCustomPopupEdit.DoInitPopup; + + function ControlHasAsParent(AControl: TControl): Boolean; + var + AParent: TControl; + begin + Result := AControl = PopupWindow; + AParent := PopupWindow.OwnerControl; + while AParent <> nil do + begin + if AParent = AControl then + begin + Result := True; + Break; + end; + AParent := AParent.Parent; + end; + end; + +begin + if ControlHasAsParent(ActiveProperties.FPopupControl) then + raise EcxEditError.Create(cxGetResourceString(@cxSEditPopupCircularReferencingError)); + inherited DoInitPopup; +end; + +function TcxCustomPopupEdit.GetPopupFocusedControl: TWinControl; +begin + with ActiveProperties do + if PopupControl is TWinControl then + Result := TWinControl(PopupControl) + else + Result := nil; +end; + +function TcxCustomPopupEdit.GetPopupWindowClientPreferredSize: TSize; +begin + with ActiveProperties.PopupControl do + Result := Size(Width, Height); +end; + +procedure TcxCustomPopupEdit.PopupWindowClosed(Sender: TObject); +begin + RestorePopupControlData; + inherited PopupWindowClosed(Sender); +end; + +procedure TcxCustomPopupEdit.PositionPopupWindowChilds(const AClientRect: TRect); +begin + with AClientRect do + begin + ActiveProperties.PopupControl.Left := Left; + ActiveProperties.PopupControl.Top := Top; + ActiveProperties.PopupControl.Width := Right - Left; + ActiveProperties.PopupControl.Height := Bottom - Top; + end; +end; + +procedure TcxCustomPopupEdit.SetupPopupWindow; +begin + with ActiveProperties.PopupControl do + begin + SavePopupControlData; + Parent := PopupWindow; + Visible := True; + inherited SetupPopupWindow; + Align := alClient; // TODO + end; +end; + +procedure TcxCustomPopupEdit.HidePopup(Sender: TcxControl; AReason: TcxEditCloseUpReason); +begin + FCloseUpReason := AReason; + PopupWindow.ClosePopup; +end; + +procedure TcxCustomPopupEdit.RestorePopupControlData; +begin + if ActiveProperties.PopupControl <> nil then + with ActiveProperties.PopupControl do + begin + Visible := False; + PopupWindow.SetFocusedControl(PopupWindow); + Parent := FPrevPopupControlData.Parent; + Align := FPrevPopupControlData.Align; + BoundsRect := FPrevPopupControlData.Bounds; + Visible := FPrevPopupControlData.Visible; + end; +end; + +procedure TcxCustomPopupEdit.SavePopupControlData; +var + APopupControl: TControl; +begin + APopupControl := ActiveProperties.PopupControl; + with APopupControl do + begin + FPrevPopupControlData.Align := Align; + if APopupControl is TCustomForm then + begin + FPrevPopupControlData.BorderStyle := TCustomForm(APopupControl).BorderStyle; + TCustomForm(APopupControl).BorderStyle := bsNone; + end; + FPrevPopupControlData.Bounds := BoundsRect; + FPrevPopupControlData.Parent := Parent; + FPrevPopupControlData.Visible := Visible; + end; +end; + +function TcxCustomPopupEdit.GetProperties: TcxCustomPopupEditProperties; +begin + Result := TcxCustomPopupEditProperties(FProperties); +end; + +function TcxCustomPopupEdit.GetActiveProperties: TcxCustomPopupEditProperties; +begin + Result := TcxCustomPopupEditProperties(InternalGetActiveProperties); +end; + +procedure TcxCustomPopupEdit.SetProperties(Value: TcxCustomPopupEditProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxPopupEdit } + +class function TcxPopupEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxPopupEditProperties; +end; + +function TcxPopupEdit.GetActiveProperties: TcxPopupEditProperties; +begin + Result := TcxPopupEditProperties(InternalGetActiveProperties); +end; + +function TcxPopupEdit.GetProperties: TcxPopupEditProperties; +begin + Result := TcxPopupEditProperties(FProperties); +end; + +procedure TcxPopupEdit.SetProperties(Value: TcxPopupEditProperties); +begin + FProperties.Assign(Value); +end; + +initialization + GetRegisteredEditProperties.Register(TcxComboBoxProperties, scxSEditRepositoryComboBoxItem); + GetRegisteredEditProperties.Register(TcxPopupEditProperties, scxSEditRepositoryPopupItem); + FilterEditsController.Register(TcxComboBoxProperties, TcxFilterComboBoxHelper); + +finalization + FilterEditsController.Unregister(TcxComboBoxProperties, TcxFilterComboBoxHelper); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxEdit.pas b/official/x.35/ExpressEditors Library 5/Sources/cxEdit.pas new file mode 100644 index 00000000..b3083982 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxEdit.pas @@ -0,0 +1,8886 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxEdit; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + ComCtrls, Classes, Controls, Forms, Graphics, Menus, StdCtrls, SysUtils, + cxClasses, cxContainer, cxControls, cxDataStorage, cxDataUtils, + cxEditPaintUtils, cxGraphics, cxLookAndFeels, cxVariants, cxLookAndFeelPainters; + +type + TcxBlobKind = (bkNone, bkBlob, bkGraphic, bkMemo, bkOle); + TcxEditBorderStyle = (ebsNone, ebsSingle, ebsThick, ebsFlat, ebs3D, + ebsUltraFlat, ebsOffice11); + TcxEditButtonKind = (bkEllipsis, bkDown, bkGlyph, bkText); + TcxEditButtonState = (ebsDisabled, ebsNormal, ebsPressed, ebsSelected); + TcxEditButtonStyle = (btsDefault, bts3D, btsFlat, btsSimple, btsHotFlat, + btsUltraFlat, btsOffice11); + TcxEditButtonsViewStyle = (bvsNormal, bvsButtonsOnly, bvsButtonsAutoWidth); + TcxEditButtonTransparency = (ebtNone, ebtInactive, ebtAlways, ebtHideInactive, + ebtHideUnselected); + TcxEditGradientDirection = dirLeft..dirDown; + TcxEditPopupBorderStyle = (epbsDefault, epbsSingle, epbsFrame3D, epbsFlat); + + TcxEditStyleValue = TcxContainerStyleValue; + TcxEditStyleValues = TcxContainerStyleValues; + + TcxEditHorzAlignment = TAlignment; + TcxEditVertAlignment = (taTopJustify, taBottomJustify, taVCenter); + +const + cxEditDefaultPrecision = 15; + cxEditDefaultUseLeftAlignmentOnEditing = True; + cxEditDefaultHorzAlignment: TcxEditHorzAlignment = taLeftJustify; + cxEditDefaultVertAlignment: TcxEditVertAlignment = taTopJustify; + cxInplaceEditOffset = 1; + + ekDefault = 0; + + svBorderColor = csvBorderColor; + svBorderStyle = csvBorderStyle; + svColor = csvColor; + svEdges = csvEdges; + svFont = csvFont; + svHotTrack = csvHotTrack; + svShadow = csvShadow; + svTextColor = csvTextColor; + svTextStyle = csvTextStyle; + svTransparentBorder = csvTransparentBorder; + svButtonStyle = cxContainerStyleValueCount; + svButtonTransparency = cxContainerStyleValueCount + 1; + svPopupBorderStyle = cxContainerStyleValueCount + 2; + svGradientButtons = cxContainerStyleValueCount + 3; + svGradient = cxContainerStyleValueCount + 4; + svGradientDirection = cxContainerStyleValueCount + 5; + + cxEditStyleValueCount = cxContainerStyleValueCount + 6; + + cxEditStyleValueNameA: array[0..cxEditStyleValueCount - cxContainerStyleValueCount - 1] of string = ( + 'ButtonStyle', + 'ButtonTransparency', + 'PopupBorderStyle', + 'GradientButtons', + 'Gradient', + 'GradientDirection' + ); + + EditContentDefaultOffsets: array [Boolean] of TRect = ( + (Left: 1; Top: 1; Right: 1; Bottom: 3), + (Left: 1; Top: 1; Right: 1; Bottom: 1) + ); + + EditBtnState2ButtonState: array[TcxEditButtonState] of TcxButtonState = + (cxbsDisabled, cxbsNormal, cxbsPressed, cxbsHot); +type + TcxEditDisplayFormatOption = (dfoSupports, dfoNoCurrencyValue); + TcxEditDisplayFormatOptions = set of TcxEditDisplayFormatOption; + TcxEditBackgroundPaintingStyle = (bpsSolid, bpsComboEdit, bpsComboListEdit); + TcxEditEditingStyle = (esEdit, esEditList, esFixedList, esNoEdit); + TcxEditPaintOption = (epoAllowZeroHeight, epoAutoHeight, epoHasExternalBorder, + epoShowEndEllipsis, epoShowFocusRectWhenInplace); + TcxEditPaintOptions = set of TcxEditPaintOption; + TcxEditSpecialFeatures = set of (esfBlobEditValue, esfMinSize, + esfNoContentPart); + TcxEditSupportedOperation = (esoAlwaysHotTrack, esoAutoHeight, esoEditing, + esoFiltering, esoHorzAlignment, esoHotTrack, esoIncSearch, + esoShowingCaption, esoSorting, esoSortingByDisplayText, esoTransparency); + TcxEditSupportedOperations = set of TcxEditSupportedOperation; + TcxEditValue = Variant; + PcxEditValue = ^TcxEditValue; + TcxEditValidateEvent = procedure(Sender: TObject; var DisplayValue: TcxEditValue; + var ErrorText: TCaption; var Error: Boolean) of object; + TcxEditErrorKind = Integer; + TcxCustomEdit = class; + TcxCustomEditStyle = class; + + EcxEditError = class(Exception); + EcxEditValidationError = class(EcxEditError); + + { IcxCustomInnerEdit } + + IcxCustomInnerEdit = interface(IcxContainerInnerControl) + ['{468D21B5-48AA-4077-8ED5-4C6112D460B1}'] + function CallDefWndProc(AMsg: UINT; WParam: WPARAM; + LParam: LPARAM): LRESULT; + function GetEditValue: TcxEditValue; + function GetOnChange: TNotifyEvent; + function GetReadOnly: Boolean; + procedure LockBounds(ALock: Boolean); + procedure SafelySetFocus; + procedure SetEditValue(const Value: TcxEditValue); + procedure SetParent(Value: TWinControl); + procedure SetOnChange(Value: TNotifyEvent); + procedure SetReadOnly(Value: Boolean); + property EditValue: TcxEditValue read GetEditValue write SetEditValue; + property Parent: TWinControl write SetParent; + property ReadOnly: Boolean read GetReadOnly write SetReadOnly; + property OnChange: TNotifyEvent read GetOnChange write SetOnChange; + end; + + IcxInnerEditHelper = interface + ['{35667555-6DC8-40D5-B705-B08D5697C621}'] + function GetHelper: IcxCustomInnerEdit; + end; + + TcxCustomEditProperties = class; + TcxCustomEditPropertiesClass = class of TcxCustomEditProperties; + TcxEditRepository = class; + TcxEditRepositoryItem = class; + + { IcxEditRepositoryItemListener } + + IcxEditRepositoryItemListener = interface + ['{4E27D642-022B-4CD2-AB96-64C7CF9B3299}'] + procedure ItemRemoved(Sender: TcxEditRepositoryItem); + procedure PropertiesChanged(Sender: TcxEditRepositoryItem); + end; + + { TcxEditRepositoryItem } + + TcxEditRepositoryItem = class(TComponent) + private + FListenerList: IInterfaceList; + FProperties: TcxCustomEditProperties; + FPropertiesEvents: TNotifyEvent; + FRepository: TcxEditRepository; + procedure SetProperties(Value: TcxCustomEditProperties); + procedure SetRepository(Value: TcxEditRepository); + protected + procedure PropertiesChanged(Sender: TObject); virtual; + procedure ReadState(Reader: TReader); override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure AddListener(AListener: IcxEditRepositoryItemListener); virtual; + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; virtual; + function GetBaseName: string; virtual; + function GetParentComponent: TComponent; override; + function HasParent: Boolean; override; + procedure RemoveListener(AListener: IcxEditRepositoryItemListener); virtual; + procedure SetParentComponent(AParent: TComponent); override; + property Properties: TcxCustomEditProperties read FProperties + write SetProperties; + property Repository: TcxEditRepository read FRepository write SetRepository; + published + property PropertiesEvents: TNotifyEvent read FPropertiesEvents + write FPropertiesEvents; + end; + + TcxEditRepositoryItemClass = class of TcxEditRepositoryItem; + + IcxEditDefaultValuesProvider = interface + ['{AE727882-6FDF-4E3A-AB35-E58AB28EFE7B}'] + function CanSetEditMode: Boolean; + procedure ClearUsers; + function DefaultAlignment: TAlignment; + function DefaultBlobKind: TcxBlobKind; + function DefaultCanModify: Boolean; + function DefaultDisplayFormat: string; + function DefaultEditFormat: string; + function DefaultEditMask: string; + function DefaultIsFloatValue: Boolean; + function DefaultMaxLength: Integer; + function DefaultMaxValue: Double; + function DefaultMinValue: Double; + function DefaultPrecision: Integer; + function DefaultReadOnly: Boolean; + function DefaultRequired: Boolean; + function GetInstance: TObject; + function IsDataStorage: Boolean; + function IsBlob: Boolean; + function IsCurrency: Boolean; + function IsDataAvailable: Boolean; + function IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean; + function IsOnGetTextAssigned: Boolean; + function IsOnSetTextAssigned: Boolean; + function IsValidChar(AChar: Char): Boolean; + end; + + { TcxEditRepository } + + TcxEditRepository = class(TComponent) + private + FItems: TList; + function GetCount: Integer; + function GetItem(Index: Integer): TcxEditRepositoryItem; + protected + procedure AddItem(AItem: TcxEditRepositoryItem); + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + procedure RemoveItem(AItem: TcxEditRepositoryItem); + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Clear; + function CreateItem(ARepositoryItemClass: TcxEditRepositoryItemClass): TcxEditRepositoryItem; virtual; + function CreateItemEx(ARepositoryItemClass: TcxEditRepositoryItemClass; AOwner: TComponent): TcxEditRepositoryItem; virtual; + function ItemByName(ARepositoryItemName: string): TcxEditRepositoryItem; + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxEditRepositoryItem read GetItem; default; + end; + + { TcxEditButtonViewInfo } + + TcxEditButtonViewInfoData = record + BackgroundColor: TColor; + Caption: string; + ContentAlignment: TAlignment; + Default: Boolean; + Gradient: Boolean; + IsInplace: Boolean; + Kind: TcxEditButtonKind; + LeftAlignment: Boolean; + Leftmost: Boolean; + NativeStyle: Boolean; + Rightmost: Boolean; + State: TcxEditButtonState; + Style: TcxEditButtonStyle; + TextColor: TColor; + Transparent: Boolean; + VisibleCaption: string; + BackgroundPartiallyTransparent: Boolean; + ComboBoxStyle: Boolean; + NativePart: Integer; + NativeState: Integer; + end; + PcxEditButtonViewInfoData = ^TcxEditButtonViewInfoData; + + TcxEditButtonViewInfo = class(TPersistent) + public + Bounds: TRect; + Data: TcxEditButtonViewInfoData; + Glyph: TBitmap; + HasBackground: Boolean; + Index: Integer; + Stretchable: Boolean; + VisibleBounds: TRect; + Width: Integer; + procedure Assign(Source: TPersistent); override; + function GetUpdateRegion(AViewInfo: TcxEditButtonViewInfo): TcxRegion; virtual; + function Repaint(AControl: TWinControl; AViewInfo: TcxEditButtonViewInfo; + const AEditPosition: TPoint): Boolean; virtual; + end; + + TcxEditButtonViewInfoClass = class of TcxEditButtonViewInfo; + + { TcxEditButton } + + TcxEditButton = class(TCollectionItem) + private + FCaption: TCaption; + FContentAlignment: TAlignment; + FDefault: Boolean; + FEnabled: Boolean; + FGlyph: TBitmap; + FHint: string; + FKind: TcxEditButtonKind; + FLeftAlignment: Boolean; + FStretchable: Boolean; + FTag: TcxTag; + FTextColor: TColor; + FVisible: Boolean; + FVisibleCaption: TCaption; + FWidth: Integer; + function GetGlyph: TBitmap; + procedure GlyphChanged(Sender: TObject); + function IsTagStored: Boolean; + procedure SetCaption(const Value: TCaption); + procedure SetContentAlignment(Value: TAlignment); + procedure SetDefault(Value: Boolean); + procedure SetEnabled(Value: Boolean); + procedure SetGlyph(Value: TBitmap); + procedure SetKind(Value: TcxEditButtonKind); + procedure SetLeftAlignment(Value: Boolean); + procedure SetStretchable(Value: Boolean); + procedure SetTextColor(Value: TColor); + procedure SetVisible(Value: Boolean); + procedure SetWidth(Value: Integer); + protected + property TextColor: TColor read FTextColor write SetTextColor default clBtnText; // TODO published + property VisibleCaption: TCaption read FVisibleCaption; + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + published + property Caption: TCaption read FCaption write SetCaption; + property ContentAlignment: TAlignment read FContentAlignment + write SetContentAlignment default taCenter; + property Default: Boolean read FDefault write SetDefault default False; + property Enabled: Boolean read FEnabled write SetEnabled default True; + property Glyph: TBitmap read GetGlyph write SetGlyph; + property Hint: string read FHint write FHint; + property Kind: TcxEditButtonKind read FKind write SetKind default bkDown; + property LeftAlignment: Boolean read FLeftAlignment write SetLeftAlignment default False; + property Stretchable: Boolean read FStretchable write SetStretchable default True; + property Tag: TcxTag read FTag write FTag stored IsTagStored; + property Visible: Boolean read FVisible write SetVisible default True; + property Width: Integer read FWidth write SetWidth default 0; + end; + + TcxEditButtonClass = class of TcxEditButton; + + { TcxEditButtons } + + TcxEditButtons = class(TCollection) + private + FOwner: TPersistent; + FOnChange: TNotifyEvent; + function GetItem(Index: Integer): TcxEditButton; + function GetVisibleCount: Integer; + procedure SetItem(Index: Integer; Value: TcxEditButton); + protected + class function GetButtonClass: TcxEditButtonClass; virtual; + function GetOwner: TPersistent; override; + procedure Update(Item: TCollectionItem); override; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + public + constructor Create(AOwner: TPersistent; AButtonClass: TcxEditButtonClass); virtual; + function Add: TcxEditButton; + property Items[Index: Integer]: TcxEditButton read GetItem write SetItem; default; + property VisibleCount: Integer read GetVisibleCount; + end; + + TcxEditButtonsClass = class of TcxEditButtons; + + { TcxCustomEditViewInfo } + + TcxCustomEditViewInfo = class; + TcxEditAlignment = class; + + TcxEditDrawBackgroundEvent = procedure(Sender: TcxCustomEditViewInfo; + ACanvas: TcxCanvas; var AHandled: Boolean) of object; + TcxEditDrawButtonEvent = procedure(Sender: TcxCustomEditViewInfo; + ACanvas: TcxCanvas; AButtonVisibleIndex: Integer; var AHandled: Boolean) of object; + TcxEditDrawButtonBackgroundEvent = procedure(Sender: TcxCustomEditViewInfo; + ACanvas: TcxCanvas; const ARect: TRect; AButtonVisibleIndex: Integer; + var AHandled: Boolean) of object; + TcxEditDrawButtonBorderEvent = procedure(Sender: TcxCustomEditViewInfo; ACanvas: TcxCanvas; AButtonVisibleIndex: Integer; + out ABackgroundRect, AContentRect: TRect; var AHandled: Boolean) of object; + TcxEditGetButtonStateEvent = procedure(Sender: TcxCustomEditViewInfo; + AButtonVisibleIndex: Integer; var AState: TcxEditButtonState) of object; + TcxEditPaintEvent = procedure(Sender: TcxCustomEditViewInfo; ACanvas: TcxCanvas) of object; + + TcxDrawBackgroundStyle = (dbsCustom, dbsCustomEdit, dbsNone, dbsSimpleFill, dbsSimpleParent, dbsThemeParent); + TcxEditViewInfoState = (evsPaintButtons); + TcxEditViewInfoStates = set of TcxEditViewInfoState; + + TcxCustomEditViewInfo = class(TcxContainerViewInfo) + private + FOnDrawBackground: TcxEditDrawBackgroundEvent; + FOnDrawButton: TcxEditDrawButtonEvent; + FOnDrawButtonBackground: TcxEditDrawButtonBackgroundEvent; + FOnDrawButtonBorder: TcxEditDrawButtonBorderEvent; + FOnGetButtonState: TcxEditGetButtonStateEvent; + FOnPaint: TcxEditPaintEvent; + function DoDrawBackground(ACanvas: TcxCanvas): Boolean; + function DoDrawButton(ACanvas: TcxCanvas; AButtonVisibleIndex: Integer): Boolean; + function DoDrawButtonBackground(ACanvas: TcxCanvas; const ARect: TRect; AButtonVisibleIndex: Integer): Boolean; + function DoDrawButtonBorder(ACanvas: TcxCanvas; AButtonVisibleIndex: Integer; + out ABackgroundRect, AContentRect: TRect): Boolean; + function GetDrawBackgroundStyle: TcxDrawBackgroundStyle; + function IsNativeBackground: Boolean; + function IsTransparent: Boolean; + + function GetPart(const P: TPoint): Integer; + function GetPartRect(APart: Integer): TRect; + function GetHintText(APart: Integer): string; + function GetHintTextRect(const P: TPoint; APart: Integer): TRect; + protected + FEdit: TcxCustomEdit; + FState: TcxEditViewInfoStates; + function GetButtonViewInfoClass: TcxEditButtonViewInfoClass; virtual; + procedure GetColorSettingsByPainter(out ABackground, ATextColor: TColor); + function GetContainerBorderStyle: TcxContainerBorderStyle; override; + procedure InternalPaint(ACanvas: TcxCanvas); override; + function IsRepaintOnStateChangingNeeded: Boolean; virtual; + procedure DrawEditButton(ACanvas: TcxCanvas; AButtonVisibleIndex: Integer); virtual; + procedure SetOnDrawBackground(AValue: TcxEditDrawBackgroundEvent); virtual; + + procedure Draw3DButtonBorder(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; + var ARect: TRect; out AContentRect: TRect; var APenColor, ABrushColor: TColor); virtual; + procedure DrawFlatButtonBorder(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; + var ARect: TRect; out AContentRect: TRect; var APenColor, ABrushColor: TColor); virtual; + procedure DrawHotFlatButtonBorder(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; + var ARect: TRect; out AContentRect: TRect; var APenColor, ABrushColor: TColor); virtual; + procedure DrawNativeButtonBorder(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; + var ARect: TRect; out AContentRect: TRect; var APenColor, ABrushColor: TColor); virtual; + procedure DrawSimpleButtonBorder(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; + var ARect: TRect; out AContentRect: TRect; var APenColor, ABrushColor: TColor); virtual; + procedure DrawUltraFlatButtonBorder(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; + AIsOffice11Style: Boolean; var ARect: TRect; var AContentRect: TRect; out APenColor, ABrushColor: TColor); virtual; + + procedure DrawButtonBorderByPainter(AButtonViewInfo: TcxEditButtonViewInfo; var ARect: TRect; out AContentRect: TRect; + var APenColor, ABrushColor: TColor); + procedure DrawNativeButtonBackground(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; const ARect: TRect); virtual; + procedure DrawUsualButtonBackground(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; const ARect: TRect; ABrushColor: TColor); virtual; + public + BorderExtent: TRect; + BorderStyle: TcxEditBorderStyle; + ButtonsInfo: array of TcxEditButtonViewInfo; + Calculated: Boolean; + Data: Integer; + EditProperties: TcxCustomEditProperties; + Enabled: Boolean; + Focused: Boolean; + Font: TFont; + HasBackground: Boolean; + HasContentOffsets: Boolean; + HasInnerEdit: Boolean; + HasTextButtons: Boolean; + HitTestInfo: Integer; + HotState: TcxContainerHotState; + InnerEditRect: TRect; + IsButtonReallyPressed: Boolean; + IsContainerInnerControl: Boolean; + IsDBEditPaintCopyDrawing: Boolean; + IsDesigning: Boolean; + IsInplace: Boolean; + IsSelected: Boolean; + Left: Integer; + PaintOptions: TcxEditPaintOptions; + PopupBorderStyle: TcxEditPopupBorderStyle; + PressedButton: Integer; + SelectedButton: Integer; + ShadowRect: TRect; + TextColor: TColor; + Top: Integer; + Transparent: Boolean; + WindowHandle: HWND; + constructor Create; override; + destructor Destroy; override; + procedure Assign(Source: TObject); override; + function GetUpdateRegion(AViewInfo: TcxContainerViewInfo): TcxRegion; override; + procedure Offset(DX, DY: Integer); override; + function DrawBackground(ACanvas: TcxCanvas): Boolean; overload; + function DrawBackground(ACanvas: TcxCanvas; const APos: TPoint): Boolean; overload; + procedure DrawButton(ACanvas: TcxCanvas; AButtonVisibleIndex: Integer); virtual; + procedure DrawButtons(ACanvas: TcxCanvas); + procedure DrawEditBackground(ACanvas: TcxCanvas; ARect, AGlyphRect: TRect; AGlyphTransparent: Boolean); + procedure DrawNativeStyleEditBackground(ACanvas: TcxCanvas; ADrawBackground: Boolean; + ABackgroundStyle: TcxEditBackgroundPaintingStyle; ABackgroundBrush: TBrushHandle); virtual; + function IsBackgroundTransparent: Boolean; + + procedure DrawButtonBackground(ACanvas: TcxCanvas; AButtonVisibleIndex: Integer; + const ARect: TRect; ABrushColor: TColor); + procedure DrawButtonBorder(ACanvas: TcxCanvas; AButtonVisibleIndex: Integer; + var ARect: TRect; out AContentRect: TRect; var APenColor, ABrushColor: TColor); virtual; + procedure DrawButtonContent(ACanvas: TcxCanvas; AButtonVisibleIndex: Integer; + const AContentRect: TRect; APenColor, ABrushColor: TColor; ANeedOffsetContent: Boolean); virtual; + + function IsCustomBackground: Boolean; + function IsCustomButton(AButtonVisibleIndex: Integer = 0): Boolean; + function IsCustomButtonBackground(AButtonVisibleIndex: Integer = 0): Boolean; + function IsCustomButtonBorder(AButtonVisibleIndex: Integer = 0): Boolean; + function IsCustomDrawButton(AButtonVisibleIndex: Integer = 0): Boolean; + + function IsHotTrack: Boolean; overload; virtual; + function IsHotTrack(P: TPoint): Boolean; overload; virtual; + function NeedShowHint(ACanvas: TcxCanvas; const P: TPoint; + out AText: TCaption; out AIsMultiLine: Boolean; + out ATextRect: TRect): Boolean; overload; virtual; + function NeedShowHint(ACanvas: TcxCanvas; const P: TPoint; + const AVisibleBounds: TRect; out AText: TCaption; + out AIsMultiLine: Boolean; out ATextRect: TRect): Boolean; overload; virtual; + procedure Paint(ACanvas: TcxCanvas); override; + procedure PaintEx(ACanvas: TcxCanvas); + procedure PrepareCanvasFont(ACanvas: TCanvas); virtual; + function Repaint(AControl: TWinControl; + AViewInfo: TcxContainerViewInfo = nil): Boolean; overload; virtual; + function Repaint(AControl: TWinControl; const AInnerEditRect: TRect; + AViewInfo: TcxContainerViewInfo = nil): Boolean; overload; virtual; + procedure SetButtonCount(ACount: Integer); + property Edit: TcxCustomEdit read FEdit; + property OnDrawBackground: TcxEditDrawBackgroundEvent read FOnDrawBackground + write SetOnDrawBackground; + property OnDrawButton: TcxEditDrawButtonEvent read FOnDrawButton + write FOnDrawButton; + property OnDrawButtonBackground: TcxEditDrawButtonBackgroundEvent + read FOnDrawButtonBackground write FOnDrawButtonBackground; + property OnDrawButtonBorder: TcxEditDrawButtonBorderEvent + read FOnDrawButtonBorder write FOnDrawButtonBorder; + property OnGetButtonState: TcxEditGetButtonStateEvent + read FOnGetButtonState write FOnGetButtonState; + property OnPaint: TcxEditPaintEvent read FOnPaint write FOnPaint; + end; + + { TcxCustomEditViewData } + + TcxInplaceEditPosition = record + Item: TObject; + RecordIndex: Integer; + end; + + TcxInplaceEditParams = record + MultiRowParent: Boolean; + Position: TcxInplaceEditPosition; + end; + + TcxEditSizeProperties = record + Height: Integer; + MaxLineCount: Integer; + Width: Integer; + end; + PcxEditSizeProperties = ^TcxEditSizeProperties; + + TcxEditContentOption = (ecoShowFocusRectWhenInplace, ecoOffsetButtonContent); + TcxEditContentOptions = set of TcxEditContentOption; + + TcxEditContentParams = record + ExternalBorderBounds: TRect; + Offsets: TRect; + Options: TcxEditContentOptions; + SizeCorrection: TSize; + end; + + TcxCustomEditViewData = class; + + TcxEditGetDefaultButtonWidthEvent = procedure(Sender: TcxCustomEditViewData; + AIndex: Integer; var ADefaultWidth: Integer) of object; + TcxEditViewDataGetDisplayTextEvent = procedure(Sender: TcxCustomEditViewData; + var AText: string) of object; + + TcxCustomEditViewData = class(TPersistent) + private + FData: TObject; // internal for OnGetDisplayText event + FIsInplace: Boolean; + FLeftSideLeftmostButtonIndex, FLeftSideRightmostButtonIndex: Integer; + FRightSideLeftmostButtonIndex, FRightSideRightmostButtonIndex: Integer; + FOnGetDefaultButtonWidth: TcxEditGetDefaultButtonWidthEvent; + FOnGetDisplayText: TcxEditViewDataGetDisplayTextEvent; + procedure DoGetButtonState(AViewInfo: TcxCustomEditViewInfo; + AButtonVisibleIndex: Integer; var AState: TcxEditButtonState); + function DoGetDefaultButtonWidth(AIndex: Integer): Integer; + function GetPaintOptions: TcxEditPaintOptions; + function GetStyle: TcxCustomEditStyle; + procedure SetStyle(Value: TcxCustomEditStyle); + protected + FEdit: TcxCustomEdit; + FProperties: TcxCustomEditProperties; + FStyle: TcxCustomEditStyle; + procedure CalculateButtonNativeInfo(AButtonViewInfo: TcxEditButtonViewInfo); virtual; + procedure CalculateViewInfo(AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); + function CanPressButton(AViewInfo: TcxCustomEditViewInfo; AButtonVisibleIndex: Integer): + Boolean; virtual; + procedure CheckSizeConstraints(var AEditSize: TSize); + procedure CorrectBorderStyle(var ABorderStyle: TcxEditBorderStyle); + procedure DoOnGetDisplayText(var AText: string); + function EditValueToDisplayText(AEditValue: TcxEditValue): string; + function GetButtonsStyle: TcxEditButtonStyle; + function GetCaptureButtonVisibleIndex: Integer; + procedure GetColorSettings(AViewInfo: TcxCustomEditViewInfo; var FillColor, TextColor: TColor); + function GetContainerState(const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; + AIsMouseEvent: Boolean): TcxContainerState; virtual; + function GetEditContentDefaultOffsets: TRect; virtual; + function GetEditNativeState(AViewInfo: TcxCustomEditViewInfo): Integer; virtual; + procedure InitCacheData; virtual; + procedure InitEditContentParams(var AParams: TcxEditContentParams); virtual; + procedure Initialize; virtual; + function InternalEditValueToDisplayText(AEditValue: TcxEditValue): string; virtual; + function InternalFocused: Boolean; + function InternalGetEditConstantPartSize(ACanvas: TcxCanvas; AIsInplace: Boolean; + AEditSizeProperties: TcxEditSizeProperties; var MinContentSize: TSize; + AViewInfo: TcxCustomEditViewInfo): TSize; virtual; + function InternalGetEditContentSize(ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + const AEditSizeProperties: TcxEditSizeProperties): TSize; virtual; + function IsButtonPressed(AViewInfo: TcxCustomEditViewInfo; + AButtonVisibleIndex: Integer): Boolean; virtual; + public + AutoHeight: Boolean; + Bounds: TRect; + ButtonsOnlyStyle: Boolean; + ButtonVisibleCount: Integer; + ContainerState: TcxContainerState; + ContentOffset: TRect; + EditContentParams: TcxEditContentParams; + Enabled: Boolean; + Focused: Boolean; + HorzAlignment: TcxEditHorzAlignment; + HScrollBar: TcxControlScrollBar; + InnerEdit: IcxCustomInnerEdit; + InplaceEditParams: TcxInplaceEditParams; + IsDesigning: Boolean; + IsSelected: Boolean; // Row selected + IsValueSource: Boolean; + MaxLineCount: Integer; + NativeStyle: Boolean; + PaintOptions: TcxEditPaintOptions; + PreviewMode: Boolean; + Selected: Boolean; + SelStart, SelLength: Integer; + SelTextColor, SelBackgroundColor: TColor; + VertAlignment: TcxEditVertAlignment; + VScrollBar: TcxControlScrollBar; + WindowHandle: HWND; + constructor Create(AProperties: TcxCustomEditProperties; AStyle: TcxCustomEditStyle; + AIsInplace: Boolean); reintroduce; virtual; + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); virtual; + procedure CalculateButtonBounds(ACanvas: TcxCanvas; AViewInfo: TcxCustomEditViewInfo; + AButtonVisibleIndex: Integer; var ButtonsRect: TRect); virtual; + procedure CalculateButtonsViewInfo(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); virtual; + procedure CalculateButtonViewInfo(ACanvas: TcxCanvas; AViewInfo: TcxCustomEditViewInfo; + AButtonVisibleIndex: Integer; var ButtonsRect: TRect); virtual; + procedure CalculateEx(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); + procedure CheckButtonsOnly(AViewInfo: TcxCustomEditViewInfo; + APrevButtonsWidth, AButtonsWidth: Integer); virtual; + procedure EditValueToDrawValue(ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + AViewInfo: TcxCustomEditViewInfo); virtual; + function GetBorderColor: TColor; virtual; + function GetBorderExtent: TRect; virtual; + function GetBorderStyle: TcxEditBorderStyle; virtual; + function GetButtonsExtent(ACanvas: TcxCanvas): TRect; virtual; + function GetClientExtent(ACanvas: TcxCanvas; + AViewInfo: TcxCustomEditViewInfo): TRect; virtual; + function GetEditConstantPartSize(ACanvas: TcxCanvas; + const AEditSizeProperties: TcxEditSizeProperties; var MinContentSize: TSize; + AViewInfo: TcxCustomEditViewInfo = nil): TSize; virtual; + function GetEditContentSize(ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + const AEditSizeProperties: TcxEditSizeProperties): TSize; virtual; + function GetEditContentSizeCorrection: TSize; virtual; + function GetEditSize(ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + AEditSizeProperties: TcxEditSizeProperties; + AViewInfo: TcxCustomEditViewInfo = nil): TSize; + function HasShadow: Boolean; virtual; + function IgnoreButtonWhileStretching( + AButtonVisibleIndex: Integer): Boolean; virtual; + class function IsNativeStyle(ALookAndFeel: TcxLookAndFeel): Boolean; virtual; + property Data: TObject read FData write FData; + property Edit: TcxCustomEdit read FEdit write FEdit; + property IsInplace: Boolean read FIsInplace; + property Properties: TcxCustomEditProperties read FProperties; + property Style: TcxCustomEditStyle read GetStyle write SetStyle; + property OnGetDefaultButtonWidth: TcxEditGetDefaultButtonWidthEvent + read FOnGetDefaultButtonWidth write FOnGetDefaultButtonWidth; + property OnGetDisplayText: TcxEditViewDataGetDisplayTextEvent + read FOnGetDisplayText write FOnGetDisplayText; + end; + + TcxCustomEditViewDataClass = class of TcxCustomEditViewData; + + { TcxEditStyleController } + + TcxEditStyle = class; + + TcxEditStyleController = class(TcxStyleController) + private + function GetInternalStyle(AState: TcxContainerStateItem): TcxCustomEditStyle; + function GetStyle: TcxEditStyle; + function GetStyleDisabled: TcxEditStyle; + function GetStyleFocused: TcxEditStyle; + function GetStyleHot: TcxEditStyle; + procedure SetInternalStyle(AState: TcxContainerStateItem; Value: TcxCustomEditStyle); + procedure SetStyle(Value: TcxEditStyle); + procedure SetStyleDisabled(Value: TcxEditStyle); + procedure SetStyleFocused(Value: TcxEditStyle); + procedure SetStyleHot(Value: TcxEditStyle); + protected + function GetStyleClass: TcxContainerStyleClass; override; + public + property Styles[AState: TcxContainerStateItem]: TcxCustomEditStyle + read GetInternalStyle write SetInternalStyle; + published + property Style: TcxEditStyle read GetStyle write SetStyle; + property StyleDisabled: TcxEditStyle read GetStyleDisabled + write SetStyleDisabled; + property StyleFocused: TcxEditStyle read GetStyleFocused + write SetStyleFocused; + property StyleHot: TcxEditStyle read GetStyleHot write SetStyleHot; + property OnStyleChanged; + end; + + { TcxCustomEditStyle } + + TcxCustomEditStyle = class(TcxContainerStyle) + private + FButtonStyle: TcxEditButtonStyle; + FButtonTransparency: TcxEditButtonTransparency; + FGradient: Boolean; + FGradientButtons: Boolean; + FGradientDirection: TcxEditGradientDirection; + FPopupBorderStyle: TcxEditPopupBorderStyle; + FPopupCloseButton: Boolean; + + function GetActiveStyleController: TcxEditStyleController; + function GetAssignedValues: TcxEditStyleValues; + function GetBaseStyle: TcxCustomEditStyle; + function GetBorderStyle: TcxEditBorderStyle; + function GetButtonStyle: TcxEditButtonStyle; + function GetButtonTransparency: TcxEditButtonTransparency; + function GetEdit: TcxCustomEdit; + function GetGradient: Boolean; + function GetGradientButtons: Boolean; + function GetGradientDirection: TcxEditGradientDirection; + function GetPopupBorderStyle: TcxEditPopupBorderStyle; + function GetPopupCloseButton: Boolean; + function GetStyleController: TcxEditStyleController; + + function InternalGetButtonStyle(var ButtonStyle: TcxEditButtonStyle): Boolean; + function InternalGetButtonTransparency(var ButtonTransparency: TcxEditButtonTransparency): Boolean; + function InternalGetGradient(var Gradient: Boolean): Boolean; + function InternalGetGradientButtons(var GradientButtons: Boolean): Boolean; + function InternalGetGradientDirection(var GradientDirection: TcxEditGradientDirection): Boolean; + function InternalGetPopupBorderStyle(var PopupBorderStyle: TcxEditPopupBorderStyle): Boolean; + + function IsBorderStyleStored: Boolean; + function IsButtonStyleStored: Boolean; + function IsButtonTransparencyStored: Boolean; + function IsGradientStored: Boolean; + function IsGradientButtonsStored: Boolean; + function IsGradientDirectionStored: Boolean; + function IsPopupBorderStyleStored: Boolean; + function IsStyleControllerStored: Boolean; + + procedure SetAssignedValues(Value: TcxEditStyleValues); + procedure SetBorderStyle(Value: TcxEditBorderStyle); + procedure SetButtonStyle(Value: TcxEditButtonStyle); + procedure SetButtonTransparency(Value: TcxEditButtonTransparency); + procedure SetGradient(Value: Boolean); + procedure SetGradientButtons(Value: Boolean); + procedure SetGradientDirection(Value: TcxEditGradientDirection); + procedure SetPopupBorderStyle(Value: TcxEditPopupBorderStyle); + procedure SetPopupCloseButton(Value: Boolean); + procedure SetStyleController(Value: TcxEditStyleController); + protected + function GetDefaultStyleController: TcxStyleController; override; + function InternalGetNotPublishedExtendedStyleValues: TcxEditStyleValues; override; + function DefaultButtonStyle: TcxEditButtonStyle; virtual; + function DefaultButtonTransparency: TcxEditButtonTransparency; virtual; + function DefaultGradient: Boolean; virtual; + function DefaultGradientButtons: Boolean; virtual; + function DefaultGradientDirection: TcxEditGradientDirection; virtual; + function DefaultPopupBorderStyle: TcxEditPopupBorderStyle; virtual; + property PopupCloseButton: Boolean read GetPopupCloseButton + write SetPopupCloseButton default True; + public + constructor Create(AOwner: TPersistent; ADirectAccessMode: Boolean; + AParentStyle: TcxContainerStyle = nil; + AState: TcxContainerStateItem = csNormal); override; + procedure Assign(Source: TPersistent); override; + function GetStyleValueCount: Integer; override; + function GetStyleValueName(AStyleValue: TcxEditStyleValue; + out StyleValueName: string): Boolean; override; + function IsValueAssigned(AValue: TcxEditStyleValue): Boolean; override; + procedure Init(AParams: TcxViewParams); + property ActiveStyleController: TcxEditStyleController + read GetActiveStyleController; + property AssignedValues: TcxEditStyleValues read GetAssignedValues + write SetAssignedValues stored False; + property BaseStyle: TcxCustomEditStyle read GetBaseStyle; + property BorderStyle: TcxEditBorderStyle read GetBorderStyle + write SetBorderStyle stored IsBorderStyleStored; + property ButtonStyle: TcxEditButtonStyle read GetButtonStyle + write SetButtonStyle stored IsButtonStyleStored; + property ButtonTransparency: TcxEditButtonTransparency read GetButtonTransparency + write SetButtonTransparency stored IsButtonTransparencyStored; + property Edit: TcxCustomEdit read GetEdit; + property Gradient: Boolean read GetGradient write SetGradient + stored IsGradientStored; + property GradientButtons: Boolean read GetGradientButtons + write SetGradientButtons stored IsGradientButtonsStored; + property GradientDirection: TcxEditGradientDirection read GetGradientDirection + write SetGradientDirection stored IsGradientDirectionStored; + property PopupBorderStyle: TcxEditPopupBorderStyle read GetPopupBorderStyle + write SetPopupBorderStyle stored IsPopupBorderStyleStored; + property StyleController: TcxEditStyleController read GetStyleController + write SetStyleController stored IsStyleControllerStored; + end; + + TcxCustomEditStyleClass = class of TcxCustomEditStyle; + + { TcxEditStyle } + + TcxEditStyle = class(TcxCustomEditStyle) + published + property AssignedValues; + property BorderColor; + property BorderStyle; + property ButtonStyle; + property ButtonTransparency; + property Color; + property Edges; + property Font; + property Gradient; +// property GradientButtons; + property GradientDirection; + property HotTrack; + property LookAndFeel; + property PopupBorderStyle; + property Shadow; + property StyleController; + property TextColor; + property TextStyle; + property TransparentBorder; + end; + + { TcxCustomEditPropertiesValues } + + TcxCustomEditPropertiesValues = class(TPersistent) + private + FOwner: TPersistent; + FMaxValue: Boolean; + FMinValue: Boolean; + FReadOnly: Boolean; + function GetProperties: TcxCustomEditProperties; + procedure SetMaxValue(Value: Boolean); + procedure SetMinValue(Value: Boolean); + procedure SetReadOnly(Value: Boolean); + protected + function GetOwner: TPersistent; override; + procedure Changed; + function IsMaxValueStored: Boolean; + function IsMinValueStored: Boolean; + function IsPropertiesPropertyVisible(const APropertyName: string): Boolean; + property MaxValue: Boolean read FMaxValue write SetMaxValue + stored IsMaxValueStored; + property MinValue: Boolean read FMinValue write SetMinValue + stored IsMinValueStored; + property Properties: TcxCustomEditProperties read GetProperties; + public + constructor Create(AOwner: TPersistent); virtual; + procedure Assign(Source: TPersistent); override; + procedure BeginUpdate; + procedure EndUpdate; + procedure RestoreDefaults; virtual; + published + property ReadOnly: Boolean read FReadOnly write SetReadOnly stored False; + end; + + TcxCustomEditPropertiesValuesClass = class of TcxCustomEditPropertiesValues; + + { TcxCustomEditDefaultValuesProvider } + + TcxCustomEditDefaultValuesProvider = class(TcxInterfacedPersistent, + IUnknown, IcxEditDefaultValuesProvider) + public + destructor Destroy; override; + function CanSetEditMode: Boolean; virtual; + procedure ClearUsers; + function DefaultAlignment: TAlignment; virtual; + function DefaultBlobKind: TcxBlobKind; virtual; + function DefaultCanModify: Boolean; virtual; + function DefaultDisplayFormat: string; virtual; + function DefaultEditFormat: string; virtual; + function DefaultEditMask: string; virtual; + function DefaultIsFloatValue: Boolean; virtual; + function DefaultMaxLength: Integer; virtual; + function DefaultMaxValue: Double; virtual; + function DefaultMinValue: Double; virtual; + function DefaultPrecision: Integer; virtual; + function DefaultReadOnly: Boolean; virtual; + function DefaultRequired: Boolean; virtual; + function GetInstance: TObject; + function IsBlob: Boolean; virtual; + function IsCurrency: Boolean; virtual; + function IsDataAvailable: Boolean; virtual; + function IsDataStorage: Boolean; virtual; + function IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean; virtual; + function IsOnGetTextAssigned: Boolean; virtual; + function IsOnSetTextAssigned: Boolean; virtual; + function IsValidChar(AChar: Char): Boolean; virtual; + end; + + TcxCustomEditDefaultValuesProviderClass = class of TcxCustomEditDefaultValuesProvider; + + { TcxCustomEditProperties } + + TcxEditButtonClickEvent = procedure (Sender: TObject; AButtonIndex: Integer) of object; + TcxEditEditingEvent = procedure(Sender: TObject; var CanEdit: Boolean) of object; + TcxEditCloseUpReason = (crUnknown, crTab, crClose, crCancel, crEnter); + TcxEditClosePopupEvent = procedure(Sender: TcxControl; AReason: TcxEditCloseUpReason) of object; + + TcxCustomEditProperties = class(TcxInterfacedPersistent) + private + FAutoSelect: Boolean; + FBeepOnError: Boolean; + FButtons: TcxEditButtons; + FButtonsViewStyle: TcxEditButtonsViewStyle; + FChangedOccurred: Boolean; + FClearKey: TShortCut; + FClickKey: TShortCut; + FFreeNotificator: TcxFreeNotificator; + FImmediatePost: Boolean; + FInnerAlignment: TcxEditAlignment; + FIsChangingCount: Integer; + FMaxValue: Double; + FMinValue: Double; + FReadOnly: Boolean; + FTransparent: Boolean; + FUpdateCount: Integer; + FUseLeftAlignmentOnEditing: Boolean; + FUseMouseWheel: Boolean; + FValidateOnEnter: Boolean; + FOnButtonClick: TcxEditButtonClickEvent; + FOnChange: TNotifyEvent; + FOnClosePopup: TcxEditClosePopupEvent; + FOnEditValueChanged: TNotifyEvent; + FOnValidate: TcxEditValidateEvent; + FOnPropertiesChanged: TNotifyEvent; + function BaseGetAlignment: TcxEditAlignment; + procedure DefaultValuesChanged(Sender: TObject); + function GetIsChanging: Boolean; + function GetReadOnly: Boolean; + function IsAlignmentStored: Boolean; + function IsUseLeftAlignmentOnEditingStored: Boolean; + function IsReadOnlyStored: Boolean; + procedure SetAssignedValues(Value: TcxCustomEditPropertiesValues); + procedure SetAutoSelect(Value: Boolean); + procedure SetButtons(Value: TcxEditButtons); + procedure SetButtonsViewStyle(Value: TcxEditButtonsViewStyle); + procedure SetUseLeftAlignmentOnEditing(Value: Boolean); + procedure SetIDefaultValuesProvider(Value: IcxEditDefaultValuesProvider); + procedure SetMaxValue(Value: Double); + procedure SetMinValue(Value: Double); + procedure SetReadOnly(Value: Boolean); + procedure SetTransparent(Value: Boolean); + protected + FAlignment: TcxEditAlignment; + FAssignedValues: TcxCustomEditPropertiesValues; + FChangedLocked: Boolean; + FIDefaultValuesProvider: IcxEditDefaultValuesProvider; + FOwner: TPersistent; + procedure AlignmentChangedHandler(Sender: TObject); virtual; + procedure BaseSetAlignment(Value: TcxEditAlignment); virtual; + procedure ButtonsChanged(Sender: TObject); virtual; + function CanModify: Boolean; + function CanValidate: Boolean; virtual; + function DefaultUseLeftAlignmentOnEditing: Boolean; virtual; + procedure DefaultValuesProviderDestroyed; virtual; + procedure DoValidate(var ADisplayValue: TcxEditValue; + var AErrorText: TCaption; var AError: Boolean; AEdit: TcxCustomEdit; + out AIsUserErrorDisplayValue: Boolean); + procedure FillMinMaxValues(AMinValue, AMaxValue: Double); + procedure FreeNotification(Sender: TComponent); virtual; + class function GetAssignedValuesClass: TcxCustomEditPropertiesValuesClass; virtual; + function GetDefaultHorzAlignment: TAlignment; virtual; + function GetDisplayFormatOptions: TcxEditDisplayFormatOptions; virtual; + function GetMaxValue: Double; virtual; + function GetMinValue: Double; virtual; + function GetValidateErrorText(AErrorKind: TcxEditErrorKind): string; virtual; + function GetValueEditorEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; virtual; + class function GetViewDataClass: TcxCustomEditViewDataClass; virtual; + function HasDisplayValue: Boolean; virtual; + function InnerEditNeedsTabs: Boolean; virtual; + function IsEditValueConversionDependOnFocused: Boolean; virtual; + function IsMaxValueStored: Boolean; + function IsMinValueStored: Boolean; + property AssignedValues: TcxCustomEditPropertiesValues read FAssignedValues + write SetAssignedValues; + property ButtonsViewStyle: TcxEditButtonsViewStyle read FButtonsViewStyle + write SetButtonsViewStyle default bvsNormal; + property DisplayFormatOptions: TcxEditDisplayFormatOptions read GetDisplayFormatOptions; + property FreeNotificator: TcxFreeNotificator read FFreeNotificator; + property MaxValue: Double read GetMaxValue write SetMaxValue stored IsMaxValueStored; + property MinValue: Double read GetMinValue write SetMinValue stored IsMinValueStored; + property Transparent: Boolean read FTransparent write SetTransparent stored False; // deprecated + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function CanCompareEditValue: Boolean; virtual; + class function GetButtonsClass: TcxEditButtonsClass; virtual; + class function GetContainerClass: TcxContainerClass; virtual; + class function GetStyleClass: TcxCustomEditStyleClass; virtual; + class function GetViewInfoClass: TcxContainerViewInfoClass; virtual; + procedure BeginUpdate; + procedure Changed; virtual; + function ChangedLocked: Boolean; + function CompareDisplayValues( + const AEditValue1, AEditValue2: TcxEditValue): Boolean; virtual; + function CreatePreviewProperties: TcxCustomEditProperties; virtual; + function CreateViewData(AStyle: TcxCustomEditStyle; + AIsInplace: Boolean; APreviewMode: Boolean = False): TcxCustomEditViewData; virtual; + procedure DataChanged; virtual; + procedure EndUpdate(AInvokeChanged: Boolean = True); + function GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; virtual; + function GetEditConstantPartSize(ACanvas: TcxCanvas; AEditStyle: TcxCustomEditStyle; + AIsInplace: Boolean; const AEditSizeProperties: TcxEditSizeProperties; + var MinContentSize: TSize): TSize; + function GetEditContentSize(ACanvas: TcxCanvas; AEditStyle: TcxCustomEditStyle; + AIsInplace: Boolean; const AEditValue: TcxEditValue; const AEditSizeProperties: + TcxEditSizeProperties): TSize; + function GetEditSize(ACanvas: TcxCanvas; AEditStyle: TcxCustomEditStyle; + AIsInplace: Boolean; const AEditValue: TcxEditValue; AEditSizeProperties: + TcxEditSizeProperties): TSize; + function GetSpecialFeatures: TcxEditSpecialFeatures; virtual; + function GetSupportedOperations: TcxEditSupportedOperations; virtual; + function IsActivationKey(AKey: Char): Boolean; virtual; + function IsEditValueValid(var EditValue: TcxEditValue; AEditFocused: Boolean): Boolean; virtual; + function IsResetEditClass: Boolean; virtual; + function IsValueEditorWithValueFormatting: Boolean; + procedure LockUpdate(ALock: Boolean); + procedure PrepareDisplayValue(const AEditValue: TcxEditValue; var DisplayValue: TcxEditValue; AEditFocused: Boolean); virtual; + procedure RestoreDefaults; virtual; + procedure Update(AProperties: TcxCustomEditProperties); virtual; + procedure ValidateDisplayValue(var ADisplayValue: TcxEditValue; + var AErrorText: TCaption; var AError: Boolean; + AEdit: TcxCustomEdit); virtual; + function GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; virtual; + property Buttons: TcxEditButtons read FButtons write SetButtons; + property IDefaultValuesProvider: IcxEditDefaultValuesProvider + read FIDefaultValuesProvider write SetIDefaultValuesProvider; + property IsChanging: Boolean read GetIsChanging; + property OnPropertiesChanged: TNotifyEvent read FOnPropertiesChanged write FOnPropertiesChanged; + property ReadOnly: Boolean read GetReadOnly write SetReadOnly stored IsReadOnlyStored; + property UseLeftAlignmentOnEditing: Boolean read FUseLeftAlignmentOnEditing + write SetUseLeftAlignmentOnEditing stored IsUseLeftAlignmentOnEditingStored; + property UseMouseWheel: Boolean read FUseMouseWheel write FUseMouseWheel default True; + // !!! + property Alignment: TcxEditAlignment read BaseGetAlignment + write BaseSetAlignment stored IsAlignmentStored; + property AutoSelect: Boolean read FAutoSelect write SetAutoSelect default True; + property BeepOnError: Boolean read FBeepOnError write FBeepOnError default False; + property ClearKey: TShortCut read FClearKey write FClearKey default 0; + property ClickKey: TShortCut read FClickKey write FClickKey default VK_RETURN + scCtrl; + property ImmediatePost: Boolean read FImmediatePost write FImmediatePost default False; + property ValidateOnEnter: Boolean read FValidateOnEnter write FValidateOnEnter default False; + property OnButtonClick: TcxEditButtonClickEvent read FOnButtonClick write FOnButtonClick; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + property OnClosePopup: TcxEditClosePopupEvent read FOnClosePopup write FOnClosePopup; + property OnEditValueChanged: TNotifyEvent read FOnEditValueChanged write FOnEditValueChanged; + property OnValidate: TcxEditValidateEvent read FOnValidate write FOnValidate; + end; + + { TcxDataBinding } + + TcxDataBinding = class(TcxCustomDataBinding); + + { TcxEditDataBinding } + + TInterfacedObjectClass = class of TInterfacedObject; + + TcxEditDataBinding = class(TPersistent) + private + FIDefaultValuesProvider: TcxCustomEditDefaultValuesProvider; + function GetIDefaultValuesProvider: IcxEditDefaultValuesProvider; + function GetIsDataAvailable: Boolean; + protected + FEdit: TcxCustomEdit; + procedure DefaultValuesChanged; virtual; + function GetDisplayValue: TcxEditValue; virtual; + function GetEditDataBindingInstance: TcxEditDataBinding; + function GetEditing: Boolean; virtual; + function GetModified: Boolean; virtual; + function GetOwner: TPersistent; override; + function GetStoredValue: TcxEditValue; virtual; + procedure Reset; virtual; + procedure SetInternalDisplayValue(const Value: TcxEditValue); + procedure SetDisplayValue(const Value: TcxEditValue); virtual; + function SetEditMode: Boolean; virtual; + procedure SetStoredValue(const Value: TcxEditValue); virtual; + property Edit: TcxCustomEdit read FEdit; + public + constructor Create(AEdit: TcxCustomEdit); virtual; + destructor Destroy; override; + function CanCheckEditorValue: Boolean; virtual; + function CanPostEditorValue: Boolean; virtual; + function ExecuteAction(Action: TBasicAction): Boolean; virtual; + class function GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; virtual; + procedure SetModified; virtual; + function UpdateAction(Action: TBasicAction): Boolean; virtual; + procedure UpdateDisplayValue; virtual; + procedure UpdateNotConnectedDBEditDisplayValue; virtual; + property DisplayValue: TcxEditValue read GetDisplayValue write SetDisplayValue; + property Editing: Boolean read GetEditing; + property IDefaultValuesProvider: IcxEditDefaultValuesProvider read GetIDefaultValuesProvider; + property IsDataAvailable: Boolean read GetIsDataAvailable; + property Modified: Boolean read GetModified; + property StoredValue: TcxEditValue read GetStoredValue write SetStoredValue; + end; + + TcxEditDataBindingClass = class of TcxEditDataBinding; + + { TcxCustomEdit } + + TcxEditModifiedState = record + Modified: Boolean; + ModifiedAfterEnter: Boolean; + end; + + { TcxCustomEditData } + + TcxCustomEditData = class(TObject) + private + FCleared: Boolean; + FEdit: TcxCustomEdit; + FFreeNotificator: TcxFreeNotificator; + procedure FreeNotification(AComponent: TComponent); + protected + property Cleared: Boolean read FCleared write FCleared; + public + constructor Create(AEdit: TcxCustomEdit); virtual; + destructor Destroy; override; + procedure Clear; + end; + + TcxCustomEditDataClass = class of TcxCustomEditData; + + { TcxEditChangeEventsCatcher } + + TcxEditChangeEventsCatcher = class + private + FEdit: TcxCustomEdit; + FLockCount: Integer; + FOnChangeEvent: Boolean; + FOnEditValueChangedEvent: Boolean; + public + property OnChangeEvent: Boolean read FOnChangeEvent write FOnChangeEvent; + property OnEditValueChangedEvent: Boolean read FOnEditValueChangedEvent + write FOnEditValueChangedEvent; + constructor Create(AEdit: TcxCustomEdit); + function IsLocked: Boolean; + procedure Lock(ALock: Boolean; AInvokeChangedOnUnlock: Boolean = True); + end; + + TcxCustomEdit = class(TcxContainer, IUnknown, IcxEditRepositoryItemListener, IdxSkinSupport) + private + FAutoSize: Boolean; + FCaptureButtonVisibleIndex: Integer; + FChangeEventsCatcher: TcxEditChangeEventsCatcher; + FClickLockCount: Integer; + FDblClickTimer: TcxTimer; + FEditData: TcxCustomEditData; + FEditModeSetting: Boolean; + FEditValueChangingLockCount: Integer; + FFocused: Boolean; + FHandleAllocating: Boolean; + FInnerEdit: IcxCustomInnerEdit; + FInnerEditDefWindowProc: Pointer; + FIsContentParamsInitialized: Boolean; + FIsEditValidated: Boolean; + FIsEditValidating: Boolean; + FIsEditValueResetting: Boolean; + FIsJustCreated: Boolean; + FIsInplace: Boolean; + FIsPosting: Boolean; + FKeyboardAction: Boolean; + FLockValidate: Integer; + FModified: Boolean; + FModifiedAfterEnter: Boolean; + FObjectInstance: Pointer; + FPrevEditValue: TcxEditValue; + FPrevModifiedList: array of TcxEditModifiedState; + FPropertiesEvents: TNotifyEvent; + FRepositoryItem: TcxEditRepositoryItem; + FTransparent: Boolean; + FUpdate: Boolean; + FValidateErrorProcessing: Boolean; + FOnAfterKeyDown: TKeyEvent; + FOnEditing: TcxEditEditingEvent; + FOnPostEditValue: TNotifyEvent; + + function CheckButtonShortCuts(AKey: Integer): Boolean; + procedure DblClickTimerHandler(Sender: TObject); + procedure DoClearEditData(AEditData: TcxCustomEditData); + function GetActiveProperties: TcxCustomEditProperties; + function GetEditActiveStyle: TcxCustomEditStyle; + function GetHeight: Integer; + function GetInternalStyle(AState: TcxContainerStateItem): TcxCustomEditStyle; + function GetStyle: TcxEditStyle; + function GetStyleDisabled: TcxEditStyle; + function GetStyleFocused: TcxEditStyle; + function GetStyleHot: TcxEditStyle; + function GetViewInfo: TcxCustomEditViewInfo; + procedure InitContentParams; + procedure InternalCanResize(var ANewWidth, ANewHeight: Integer); + procedure ReadHeight(Reader: TReader); + procedure ReadWidth(Reader: TReader); + procedure SetDataBinding(Value: TcxEditDataBinding); + procedure SetHeight(Value: Integer); + procedure SetInternalStyle(AState: TcxContainerStateItem; + Value: TcxCustomEditStyle); + procedure SetModified(Value: Boolean); + procedure SetModifiedAfterEnter(Value: Boolean); + procedure SetModifiedAfterEnterValue(Value: Boolean); + procedure SetProperties(Value: TcxCustomEditProperties); + procedure SetRepositoryItem(Value: TcxEditRepositoryItem); + procedure SetReplicatableFlag; + procedure SetStyle(Value: TcxEditStyle); + procedure SetStyleDisabled(Value: TcxEditStyle); + procedure SetStyleFocused(Value: TcxEditStyle); + procedure SetStyleHot(Value: TcxEditStyle); + procedure SetTransparent(Value: Boolean); + procedure WriteHeight(Writer: TWriter); + procedure WriteWidth(Writer: TWriter); + + function GetHintText(APart: Integer): string; + + procedure WMCopy(var Message: TMessage); message WM_COPY; + procedure WMCut(var Message: TMessage); message WM_CUT; + procedure CMHintShow(var Message: TCMHintShow); message CM_HINTSHOW; + procedure WMPaste(var Message: TMessage); message WM_PASTE; + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + procedure CMShowingChanged(var Message: TMessage); message CM_SHOWINGCHANGED; + protected + FDataBinding: TcxEditDataBinding; + FEditValue: TcxEditValue; + FProperties: TcxCustomEditProperties; + FSettingEditWindowRegion: Boolean; + function CanContainerHandleTabs: Boolean; override; + function CanResize(var NewWidth, NewHeight: Integer): Boolean; override; + procedure Click; override; + procedure DblClick; override; + procedure DefineProperties(Filer: TFiler); override; + procedure DoEnter; override; + procedure DoExit; override; + procedure FocusChanged; override; + function GetBorderExtent: TRect; override; + function GetStyleClass: TcxContainerStyleClass; override; + function GetViewInfoClass: TcxContainerViewInfoClass; override; + function InternalGetNotPublishedStyleValues: TcxEditStyleValues; override; + function IsRightBoundFixed: Boolean; virtual; + function IsTransparentBackground: Boolean; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + procedure Loaded; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseLeave(AControl: TControl); override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure Paint; override; + procedure ReadState(Reader: TReader); override; + function RefreshContainer(const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AIsMouseEvent: Boolean): Boolean; override; + procedure RequestAlign; override; + procedure SetName(const Value: TComponentName); override; + procedure SetParent(AParent: TWinControl); override; + procedure SetSize; override; + procedure CreateHandle; override; + function IsNativeStyle: Boolean; override; + procedure SafeSelectionFocusInnerControl; override; + procedure WndProc(var Message: TMessage); override; + procedure AdjustInnerEditPosition; virtual; + procedure AfterPosting; virtual; + procedure BeforePosting; virtual; + function ButtonVisibleIndexAt(const P: TPoint): Integer; + procedure CalculateViewInfo(AIsMouseEvent: Boolean); reintroduce; overload; + procedure CalculateViewInfo(P: TPoint; Button: TcxMouseButton; + Shift: TShiftState; AIsMouseEvent: Boolean); reintroduce; overload; + function CanAutoSize: Boolean; reintroduce; virtual; + function CanAutoWidth: Boolean; virtual; + function CanKeyDownModifyEdit(Key: Word; Shift: TShiftState): Boolean; virtual; + function CanKeyPressModifyEdit(Key: Char): Boolean; virtual; + function CanModify: Boolean; virtual; + procedure ChangeHandler(Sender: TObject); virtual; + procedure CheckHandle; + function CreateInnerEdit: IcxCustomInnerEdit; virtual; + function CreateViewData: TcxCustomEditViewData; virtual; + procedure DefaultButtonClick; virtual; + procedure DisableValidate; + procedure DoAfterKeyDown(var Key: Word; Shift: TShiftState); + procedure DoButtonClick(AButtonVisibleIndex: Integer); virtual; + procedure DoButtonDown(AButtonVisibleIndex: Integer); virtual; + procedure DoButtonUp(AButtonVisibleIndex: Integer); virtual; + procedure DoChange; + procedure DoClick; + procedure DoClosePopup(AReason: TcxEditCloseUpReason); + procedure DoEditValueChanged; + procedure DoEditKeyDown(var Key: Word; Shift: TShiftState); virtual; + procedure DoEditKeyPress(var Key: Char); virtual; + procedure DoEditKeyUp(var Key: Word; Shift: TShiftState); virtual; + procedure DoEditProcessTab(Shift: TShiftState); virtual; + procedure DoFocusChanged; virtual; + procedure DoHideEdit(AExit: Boolean); + procedure DoOnValidate(var ADisplayValue: TcxEditValue; + var AErrorText: TCaption; var AError: Boolean); + procedure DoOnChange; virtual; + procedure DoOnEditValueChanged; virtual; + procedure DoPostEditValue; + procedure DoShowEdit; virtual; + procedure EditingChanged; virtual; + procedure EnableValidate; + procedure FillSizeProperties(var AEditSizeProperties: TcxEditSizeProperties); virtual; + function GetClearValue: TcxEditValue; virtual; + class function GetDataBindingClass: TcxEditDataBindingClass; reintroduce; virtual; + function GetDefaultButtonVisibleIndex: Integer; + function GetDisplayValue: string; virtual; + function GetEditDataClass: TcxCustomEditDataClass; virtual; + function GetEditingValue: TcxEditValue; virtual; + function GetEditValue: TcxEditValue; virtual; + function GetInnerEditClass: TControlClass; virtual; + function HandleMouseWheel(Shift: TShiftState): Boolean; + procedure HandleValidationError(const AErrorText: string; + ACanAbortExecution: Boolean); virtual; + function HasInnerEdit: Boolean; + procedure Initialize; virtual; + procedure InitializeEditData; virtual; + procedure InitializeInnerEdit; virtual; + procedure InitializeViewData(AViewData: TcxCustomEditViewData); virtual; + function InternalDoEditing: Boolean; virtual; + function InternalGetActiveProperties: TcxCustomEditProperties; + function InternalGetEditingValue: TcxEditValue; virtual; + procedure InternalPostEditValue(AValidateEdit: Boolean = False); + procedure InternalSetDisplayValue(const Value: TcxEditValue); virtual; + procedure InternalSetEditValue(const Value: TcxEditValue; + AValidateEditValue: Boolean); virtual; + procedure InternalValidateDisplayValue(const ADisplayValue: TcxEditValue); virtual; + function IsActiveControl: Boolean; virtual; + function IsButtonDC(ADC: THandle): Boolean; virtual; + function IsClickEnabledDuringLoading: Boolean; virtual; + function IsDBEdit: Boolean; + function IsDBEditPaintCopyDrawing: Boolean; virtual; + function IsEditorKey(Key: Word; Shift: TShiftState): Boolean; virtual; + function IsEditValueStored: Boolean; virtual; + function IsNativeBackground: Boolean; virtual; + function IsOnChangeEventAssigned: Boolean; + function IsOnEditValueChangedEventAssigned: Boolean; + function IsOnValidateEventAssigned: Boolean; + function IsResetEditClass: Boolean; + function IsSpecialKey(Key: Word; Shift: TShiftState): Boolean; + function IsTransparent: Boolean; virtual; + function IsValidChar(AChar: Char): Boolean; virtual; + function NeedsInvokeAfterKeyDown(AKey: Word; AShift: TShiftState): Boolean; virtual; + procedure PaintCopyDraw; virtual; + procedure PrepareDisplayValue(const AEditValue: TcxEditValue; + var DisplayValue: TcxEditValue; AEditFocused: Boolean); virtual; + procedure ProcessViewInfoChanges(APrevViewInfo: TcxCustomEditViewInfo; AIsMouseDownUpEvent: Boolean); virtual; + procedure PropertiesChanged(Sender: TObject); virtual; + function PropertiesChangeLocked: Boolean; + function RealReadOnly: Boolean; virtual; + procedure RepositoryItemAssigned; virtual; + procedure RepositoryItemAssigning; virtual; + procedure ResetEditValue; virtual; + procedure RestoreModified; + procedure SaveModified; + function SendActivationKey(Key: Char): Boolean; virtual; + function SetDisplayText(const Value: string): Boolean; virtual; + procedure SetEditAutoSize(Value: Boolean); virtual; + procedure SetEditValue(const Value: TcxEditValue); virtual; + procedure SetInternalEditValue(const Value: TcxEditValue); virtual; + procedure SetInternalDisplayValue(Value: TcxEditValue); virtual; + procedure SynchronizeDisplayValue; virtual; + procedure SynchronizeEditValue; virtual; + function TabsNeeded: Boolean; virtual; + function UpdateContentOnFocusChanging: Boolean; virtual; + procedure UpdateDrawValue; virtual; + procedure UpdateInnerEditReadOnly; + function ValidateKeyDown(var Key: Word; Shift: TShiftState): Boolean; virtual; + function ValidateKeyPress(var Key: Char): Boolean; virtual; + function WantNavigationKeys: Boolean; virtual; + procedure LockedInnerEditWindowProc(var Message: TMessage); virtual; + procedure LockInnerEditRepainting; virtual; + procedure UnlockInnerEditRepainting; virtual; + + // IcxEditRepositoryItemListener + procedure IcxEditRepositoryItemListener.ItemRemoved = RepositoryItemListenerItemRemoved; + procedure IcxEditRepositoryItemListener.PropertiesChanged = RepositoryItemListenerPropertiesChanged; + procedure RepositoryItemListenerItemRemoved(Sender: TcxEditRepositoryItem); + procedure RepositoryItemListenerPropertiesChanged(Sender: TcxEditRepositoryItem); + + property ActiveStyle: TcxCustomEditStyle read GetEditActiveStyle; + property AutoSize: Boolean read FAutoSize write SetEditAutoSize default True; + property CaptureButtonVisibleIndex: Integer read FCaptureButtonVisibleIndex write + FCaptureButtonVisibleIndex; + property ChangeEventsCatcher: TcxEditChangeEventsCatcher read FChangeEventsCatcher; + property DataBinding: TcxEditDataBinding read FDataBinding write SetDataBinding; + property DisplayValue: string read GetDisplayValue; + property EditData: TcxCustomEditData read FEditData; + property EditModeSetting: Boolean read FEditModeSetting; + property InnerEdit: IcxCustomInnerEdit read FInnerEdit; + property IsEditValidated: Boolean read FIsEditValidated write FIsEditValidated; + property IsEditValidating: Boolean read FIsEditValidating; + + property IsEditValueResetting: Boolean read FIsEditValueResetting; + property KeyboardAction: Boolean read FKeyboardAction write FKeyboardAction; + property PrevEditValue: TcxEditValue read FPrevEditValue write FPrevEditValue; + property Properties: TcxCustomEditProperties read FProperties write SetProperties; + property Transparent: Boolean read FTransparent write SetTransparent default False; + public + ContentParams: TcxEditContentParams; + InplaceParams: TcxInplaceEditParams; + constructor Create(AOwner: TComponent); overload; override; + constructor Create(AOwner: TComponent; AIsInplace: Boolean); reintroduce; overload; virtual; + destructor Destroy; override; + procedure DefaultHandler(var Message); override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + procedure GetTabOrderList(List: TList); override; + function IsInplace: Boolean; override; + function UpdateAction(Action: TBasicAction): Boolean; override; + procedure Activate(var AEditData: TcxCustomEditData); virtual; + procedure ActivateByKey(Key: Char; var AEditData: TcxCustomEditData); virtual; + procedure ActivateByMouse(Shift: TShiftState; X, Y: Integer; + var AEditData: TcxCustomEditData); virtual; + function AreChangeEventsLocked: Boolean; + function CanPostEditValue: Boolean; + procedure Clear; virtual; + procedure CopyToClipboard; virtual; + procedure CutToClipboard; virtual; + function Deactivate: Boolean; virtual; + function DoEditing: Boolean; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; virtual; + function InternalFocused: Boolean; + function IsChildWindow(AWnd: THandle): Boolean; virtual; + function IsEditClass: Boolean; virtual; + function IsRepositoryItemAcceptable( + ARepositoryItem: TcxEditRepositoryItem): Boolean; virtual; + procedure LockChangeEvents(ALock: Boolean; AInvokeChangedOnUnlock: Boolean = True); + procedure LockClick(ALock: Boolean); + procedure LockEditValueChanging(ALock: Boolean); + procedure PasteFromClipboard; virtual; + procedure PostEditValue; + procedure PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); virtual; + procedure Reset; + procedure SelectAll; virtual; + function ValidateEdit(ARaiseExceptionOnError: Boolean): Boolean; + {$IFDEF DELPHI10} + function GetTextBaseLine: Integer; virtual; + function HasTextBaseLine: Boolean; virtual; + {$ENDIF} + property ActiveProperties: TcxCustomEditProperties read GetActiveProperties; + property EditingValue: TcxEditValue read GetEditingValue; + property EditModified: Boolean read FModified write SetModified; + property EditValue: TcxEditValue read GetEditValue write SetEditValue stored + IsEditValueStored; + property InternalEditValue: TcxEditValue read GetEditValue + write SetInternalEditValue stored False; + property InternalProperties: TcxCustomEditProperties read FProperties; + property IsPosting: Boolean read FIsPosting; + property ModifiedAfterEnter: Boolean read FModifiedAfterEnter write SetModifiedAfterEnter; + property Style: TcxEditStyle read GetStyle write SetStyle; + property StyleDisabled: TcxEditStyle read GetStyleDisabled + write SetStyleDisabled; + property StyleFocused: TcxEditStyle read GetStyleFocused + write SetStyleFocused; + property StyleHot: TcxEditStyle read GetStyleHot write SetStyleHot; + property Styles[AState: TcxContainerStateItem]: TcxCustomEditStyle + read GetInternalStyle write SetInternalStyle; + property TabStop default True; + property ViewInfo: TcxCustomEditViewInfo read GetViewInfo; + + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + + property OnAfterKeyDown: TKeyEvent read FOnAfterKeyDown write FOnAfterKeyDown; + property OnEditing: TcxEditEditingEvent read FOnEditing write FOnEditing; + property OnPostEditValue: TNotifyEvent read FOnPostEditValue write FOnPostEditValue; + published + property Height: Integer read GetHeight write SetHeight stored False; + property PropertiesEvents: TNotifyEvent read FPropertiesEvents write FPropertiesEvents; + property RepositoryItem: TcxEditRepositoryItem read FRepositoryItem write SetRepositoryItem; + property Width stored False; + property OnFocusChanged; + end; + + TcxCustomEditClass = class of TcxCustomEdit; + + { TcxEditAlignment } + + TcxEditAlignment = class(TPersistent) + private + FHorz: TcxEditHorzAlignment; + FIsHorzAssigned: Boolean; + FOwner: TPersistent; + FVert: TcxEditVertAlignment; + FOnChanged: TNotifyEvent; + procedure SetHorz(const Value: TcxEditHorzAlignment); + procedure SetVert(const Value: TcxEditVertAlignment); + protected + procedure DoChanged; + function GetOwner: TPersistent; override; + property OnChanged: TNotifyEvent read FOnChanged write FOnChanged; + public + constructor Create(AOwner: TPersistent); virtual; + procedure Assign(Source: TPersistent); override; + function IsHorzStored: Boolean; + function IsVertStored: Boolean; + procedure Reset; + published + property Horz: TcxEditHorzAlignment read FHorz write SetHorz stored IsHorzStored; + property Vert: TcxEditVertAlignment read FVert write SetVert stored IsVertStored; + end; + + TcxEditListItem = record + Edit: TcxCustomEdit; + Properties: TcxCustomEditProperties; + end; + + { TcxInplaceEditList } + + TcxInplaceEditList = class + private + FItems: array of TcxEditListItem; + function CreateEdit(APropertiesClass: TcxCustomEditPropertiesClass): TcxCustomEdit; + procedure DestroyItems; + function FindItem(AProperties: TcxCustomEditProperties; + ACanUseFreeEditors: Boolean): Integer; overload; + function FindItem(APropertiesClass: TcxCustomEditPropertiesClass): Integer; overload; + function GetCount: Integer; + function GetEdit(AItemIndex: Integer): TcxCustomEdit; overload; + procedure InitEdit(AEdit: TcxCustomEdit; AProperties: TcxCustomEditProperties); + procedure RemoveItem(AIndex: Integer); overload; + protected + property Count: Integer read GetCount; + public + constructor Create; + destructor Destroy; override; + procedure DisconnectProperties(AProperties: TcxCustomEditProperties); + function FindEdit(AProperties: TcxCustomEditProperties): TcxCustomEdit; overload; + function FindEdit(APropertiesClass: TcxCustomEditPropertiesClass): TcxCustomEdit; overload; + function GetEdit(AProperties: TcxCustomEditProperties): TcxCustomEdit; overload; + function GetEdit(APropertiesClass: TcxCustomEditPropertiesClass): TcxCustomEdit; overload; + procedure RemoveItem(AProperties: TcxCustomEditProperties); overload; + procedure RemoveItem(APropertiesClass: TcxCustomEditPropertiesClass); overload; + end; + + { TcxDefaultEditStyleController } + + TcxDefaultEditStyleController = class(TComponent) + private + function GetEmulateStandardControlDrawing: Boolean; + function GetInternalStyle(AState: TcxContainerStateItem): TcxCustomEditStyle; + function GetOnStyleChanged: TNotifyEvent; + function GetStyle: TcxEditStyle; + function GetStyleDisabled: TcxEditStyle; + function GetStyleFocused: TcxEditStyle; + function GetStyleHot: TcxEditStyle; + procedure SetEmulateStandardControlDrawing(Value: Boolean); + procedure SetInternalStyle(AState: TcxContainerStateItem; + Value: TcxCustomEditStyle); + procedure SetOnStyleChanged(Value: TNotifyEvent); + procedure SetStyle(Value: TcxEditStyle); + procedure SetStyleDisabled(Value: TcxEditStyle); + procedure SetStyleFocused(Value: TcxEditStyle); + procedure SetStyleHot(Value: TcxEditStyle); + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure RestoreStyles; + property Styles[AState: TcxContainerStateItem]: TcxCustomEditStyle + read GetInternalStyle write SetInternalStyle; + published + property EmulateStandardControlDrawing: Boolean + read GetEmulateStandardControlDrawing + write SetEmulateStandardControlDrawing default False; + property Style: TcxEditStyle read GetStyle write SetStyle; + property StyleDisabled: TcxEditStyle read GetStyleDisabled + write SetStyleDisabled; + property StyleFocused: TcxEditStyle read GetStyleFocused + write SetStyleFocused; + property StyleHot: TcxEditStyle read GetStyleHot write SetStyleHot; + property OnStyleChanged: TNotifyEvent read GetOnStyleChanged + write SetOnStyleChanged; + end; + +{$IFDEF BCB} + {$IFNDEF CBUILDER5} + // CBuilder4's IDE problem + A = class(TInterfacedObject) + end; + {$ENDIF} +{$ENDIF} + +const + DefaultcxEditSizeProperties: TcxEditSizeProperties = + (Height: -1; MaxLineCount: 0; Width: -1); + +function ButtonToShift(Button: TMouseButton): TShiftState; +procedure CheckSize(var Size: TSize; const ANewSize: TSize); +function cxButtonToShift(Button: TcxMouseButton): TShiftState; +function cxEditVarEquals(const V1, V2: Variant): Boolean; +function DefaultEditStyleController: TcxEditStyleController; +function EmulateStandardControlDrawing: Boolean; +function GetDefaultEditRepository: TcxEditRepository; +function GetEditPopupWindowControlsLookAndFeelKind( + AEdit: TcxCustomEdit): TcxLookAndFeelKind; +function GetOwnerComponent(APersistent: TPersistent): TComponent; +function GetRegisteredEditProperties: TcxRegisteredClasses; +function GetStandaloneEventSender(AEdit: TcxCustomEdit): TObject; +function InternalVarEqualsExact(const V1, V2: Variant): Boolean; +function IsSpaceChar(C: Char): Boolean; +procedure SendKeyDown(AReceiver: TWinControl; Key: Word; Shift: TShiftState); +procedure SendKeyPress(AReceiver: TWinControl; Key: Char); +procedure SendKeyUp(AReceiver: TWinControl; Key: Word; Shift: TShiftState); +procedure SetStandardControlDrawingEmulationMode(AEmulate: Boolean); +procedure UniteRegions(ADestRgn, ASrcRgn: TcxRegion); + +implementation + +{$R cxEdit.res} +{$R cxScrollCursors.res} + +uses + TypInfo, cxDateUtils, cxEditConsts, cxEditUtils, cxFilterConsts, dxOffice11, + dxThemeConsts, dxUxTheme, dxThemeManager, cxGeometry, cxDWMApi, Math, cxLibraryConsts; + +const + EditContentMaxTotalDefaultHorzOffset = 3; + ecpNone = -2; + ecpControl = -1; + ecpButton = 0; + +type + TControlAccess = class(TControl); + TcxLookAndFeelAccess = class(TcxLookAndFeel); + TWinControlAccess = class(TWinControl); + +var + FCreatedEditPropertiesList: TList; + FDefaultEditRepository: TcxEditRepository; + FDefaultEditStyleController: TcxEditStyleController; + FDefaultEditStyleControllerCount: Integer; + FEmulateStandardControlDrawing: Boolean; + FInplaceEditLists: TList; + FRegisteredEditProperties: TcxRegisteredClasses; + +function ButtonToShift(Button: TMouseButton): TShiftState; +const + AButtonMap: array[TMouseButton] of TShiftState = ([ssLeft], [ssRight], [ssMiddle]); +begin + Result := AButtonMap[Button]; +end; + +procedure CheckSize(var Size: TSize; const ANewSize: TSize); +begin + with ANewSize do + begin + if Size.cx < cx then + Size.cx := cx; + if Size.cy < cy then + Size.cy := cy; + end; +end; + +procedure ClearPropertiesDestroyingListeners(AProperties: TcxCustomEditProperties); +var + I: Integer; +begin + if FInplaceEditLists <> nil then + for I := 0 to FInplaceEditLists.Count - 1 do + TcxInplaceEditList(FInplaceEditLists[I]).DisconnectProperties(AProperties); +end; + +function cxButtonToShift(Button: TcxMouseButton): TShiftState; +const + AButtonMap: array[TcxMouseButton] of TShiftState = ([], [ssLeft], [ssRight], [ssMiddle]); +begin + Result := AButtonMap[Button]; +end; + +function cxEditVarEquals(const V1, V2: Variant): Boolean; + + function VarTypeEquals: Boolean; + begin + Result := VarIsNumericEx(V1) and VarIsNumericEx(V2) or (VarType(V1) = VarType(V2)); + end; + +begin + Result := VarTypeEquals and VarEqualsExact(V1, V2); +end; + +procedure DrawComplexFrameEx(ACanvas: TcxCanvas; var ARect: TRect; ALeftTopColor, ARightBottomColor: TColor); +begin + ACanvas.DrawComplexFrame(ARect, ALeftTopColor, ARightBottomColor); + InflateRect(ARect, -1, -1); +end; + +procedure FrameRectEx(ACanvas: TcxCanvas; var ARect: TRect; AColor: TColor); +begin + ACanvas.FrameRect(ARect, AColor); + InflateRect(ARect, -1, -1); +end; + +function DefaultEditStyleController: TcxEditStyleController; +begin + Result := FDefaultEditStyleController; +end; + +function EmulateStandardControlDrawing: Boolean; +begin + Result := FEmulateStandardControlDrawing; +end; + +function GetDefaultEditRepository: TcxEditRepository; +begin + if FDefaultEditRepository = nil then + FDefaultEditRepository := TcxEditRepository.Create(nil); + Result := FDefaultEditRepository; +end; + +function GetEditPopupWindowControlsLookAndFeelKind( + AEdit: TcxCustomEdit): TcxLookAndFeelKind; +const + APopupControlLookAndFeelKindMap: array [TcxEditButtonStyle] of TcxLookAndFeelKind = + (lfStandard, lfStandard, lfFlat, lfFlat, lfFlat, + lfUltraFlat, lfOffice11); +begin + with AEdit do + if IsInplace then + Result := Style.LookAndFeel.Kind + else + if Length(ViewInfo.ButtonsInfo) > 0 then + Result := APopupControlLookAndFeelKindMap[ViewInfo.ButtonsInfo[0].Data.Style] + else + Result := lfStandard; +end; + +function GetOwnerComponent(APersistent: TPersistent): TComponent; +begin + while (APersistent <> nil) and not(APersistent is TComponent) do + APersistent := GetPersistentOwner(APersistent); + Result := TComponent(APersistent); +end; + +function GetRegisteredEditProperties: TcxRegisteredClasses; +begin + if FRegisteredEditProperties = nil then + begin + FRegisteredEditProperties := TcxRegisteredClasses.Create; + FRegisteredEditProperties.Sorted := True; + end; + Result := FRegisteredEditProperties; +end; + +function GetStandaloneEventSender(AEdit: TcxCustomEdit): TObject; +begin + if not AEdit.IsInplace then + Result := AEdit + else + Result := nil; +end; + +function InternalVarEqualsExact(const V1, V2: Variant): Boolean; +begin + Result := (VarType(V1) = VarType(V2)) and VarEqualsExact(V1, V2); +end; + +function IsSpaceChar(C: Char): Boolean; +begin + Result := (C = ' ') or (C = #0) or (C = #9) or (C = #10) or (C = #12) or + (C = #13); +end; + +function IsRegionEmpty(ARgn: TcxRegion): Boolean; +var + R: TRect; +begin + Result := GetRgnBox(ARgn.Handle, R) = NULLREGION; +end; + +procedure SendKeyDown(AReceiver: TWinControl; Key: Word; Shift: TShiftState); +begin + SendMessage(AReceiver.Handle, WM_KEYDOWN, Key, 0); +end; + +procedure SendKeyPress(AReceiver: TWinControl; Key: Char); +begin + SendMessage(AReceiver.Handle, WM_CHAR, Integer(Key), 0); +end; + +procedure SendKeyUp(AReceiver: TWinControl; Key: Word; Shift: TShiftState); +begin + SendMessage(AReceiver.Handle, WM_KEYUP, Key, 0); +end; + +procedure SetStandardControlDrawingEmulationMode(AEmulate: Boolean); +begin + if AEmulate <> FEmulateStandardControlDrawing then + begin + FEmulateStandardControlDrawing := AEmulate; + if RootLookAndFeel <> nil then + TcxLookAndFeelAccess(RootLookAndFeel).NotifyChanged; + end; +end; + +procedure UniteRegions(ADestRgn, ASrcRgn: TcxRegion); +begin + with ADestRgn do + CombineRgn(Handle, Handle, ASrcRgn.Handle, RGN_OR); +end; + +{ TcxEditRepositoryItem } + +constructor TcxEditRepositoryItem.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FListenerList := TInterfaceList.Create; + FProperties := GetEditPropertiesClass.Create(Self); + FProperties.OnPropertiesChanged := PropertiesChanged; +end; + +destructor TcxEditRepositoryItem.Destroy; + + procedure RemoveNotification; + var + I: Integer; + begin + for I := FListenerList.Count - 1 downto 0 do + IcxEditRepositoryItemListener(FListenerList[I]).ItemRemoved(Self); + end; + +begin + RemoveNotification; + Repository := nil; + FreeAndNil(FProperties); + inherited Destroy; +end; + +procedure TcxEditRepositoryItem.AddListener(AListener: IcxEditRepositoryItemListener); +begin + if FListenerList.IndexOf(AListener) = -1 then + FListenerList.Add(AListener); +end; + +class function TcxEditRepositoryItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomEditProperties; +end; + +function TcxEditRepositoryItem.GetBaseName: string; +const + SSubStr = 'TcxEditRepository'; +var + I: Integer; +begin + I := Pos(SSubStr, ClassName); + if I > 0 then + Result := Copy(ClassName, I + Length(SSubStr), Length(ClassName)) + else + Result := ''; + Result := Repository.Name + Result; +end; + +function TcxEditRepositoryItem.GetParentComponent: TComponent; +begin + Result := Repository; +end; + +function TcxEditRepositoryItem.HasParent: Boolean; +begin + Result := Repository <> nil; +end; + +procedure TcxEditRepositoryItem.RemoveListener(AListener: IcxEditRepositoryItemListener); +begin + FListenerList.Remove(AListener); +end; + +procedure TcxEditRepositoryItem.SetParentComponent(AParent: TComponent); +begin + if not (csLoading in ComponentState) then + Repository := AParent as TcxEditRepository; +end; + +procedure TcxEditRepositoryItem.PropertiesChanged(Sender: TObject); +var + I: Integer; +begin + for I := FListenerList.Count - 1 downto 0 do + IcxEditRepositoryItemListener(FListenerList[I]).PropertiesChanged(Self); +end; + +procedure TcxEditRepositoryItem.ReadState(Reader: TReader); +begin + inherited ReadState(Reader); + Repository := TcxEditRepository(Reader.Parent); +end; + +procedure TcxEditRepositoryItem.SetProperties(Value: TcxCustomEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxEditRepositoryItem.SetRepository(Value: TcxEditRepository); +begin + if FRepository <> Value then + begin + if FRepository <> nil then + FRepository.RemoveItem(Self); + FRepository := Value; + if Value <> nil then + Value.AddItem(Self); + end; +end; + +{ TcxEditRepository } + +constructor TcxEditRepository.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FItems := TList.Create; +end; + +destructor TcxEditRepository.Destroy; +begin + Clear; + FItems.Free; + FItems := nil; + inherited Destroy; +end; + +procedure TcxEditRepository.Clear; +begin + while Count > 0 do + Items[Count - 1].Free; +end; + +function TcxEditRepository.CreateItem(ARepositoryItemClass: TcxEditRepositoryItemClass): TcxEditRepositoryItem; +begin + Result := CreateItemEx(ARepositoryItemClass, Self); +end; + +function TcxEditRepository.CreateItemEx(ARepositoryItemClass: TcxEditRepositoryItemClass; + AOwner: TComponent): TcxEditRepositoryItem; +begin + Result := ARepositoryItemClass.Create(AOwner); + Result.Repository := Self; +end; + +function TcxEditRepository.ItemByName(ARepositoryItemName: string): TcxEditRepositoryItem; +var + I: Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + if AnsiCompareText(Items[I].Name, ARepositoryItemName) = 0 then + begin + Result := Items[I]; + Break; + end; +end; + +procedure TcxEditRepository.AddItem(AItem: TcxEditRepositoryItem); +var + AIndex: Integer; +begin + AIndex := FItems.IndexOf(AItem); + if AIndex = -1 then + FItems.Add(AItem); +end; + +procedure TcxEditRepository.GetChildren(Proc: TGetChildProc; Root: TComponent); +var + AItem: TcxEditRepositoryItem; + I: Integer; +begin + for I := 0 to Count - 1 do + begin + AItem := Items[I]; + if AItem.Owner = Root then + Proc(AItem); + end; +end; + +procedure TcxEditRepository.RemoveItem(AItem: TcxEditRepositoryItem); +begin + FItems.Remove(AItem); +end; + +function TcxEditRepository.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxEditRepository.GetItem(Index: Integer): TcxEditRepositoryItem; +begin + Result := TcxEditRepositoryItem(FItems[Index]); +end; + +{ TcxEditButtonViewInfo } + +procedure TcxEditButtonViewInfo.Assign(Source: TPersistent); +begin + if Source is TcxEditButtonViewInfo then + with Source as TcxEditButtonViewInfo do + begin + Self.Data.NativeState := Data.NativeState; + Self.Data.BackgroundColor := Data.BackgroundColor; + Self.Bounds := Bounds; + Self.Data.Style := Data.Style; + Self.Data.State := Data.State; + end + else + inherited Assign(Source); +end; + +function TcxEditButtonViewInfo.GetUpdateRegion(AViewInfo: TcxEditButtonViewInfo): TcxRegion; +var + AEquals: Boolean; +begin + with AViewInfo do + begin + AEquals := Self.Data.Style = Data.Style; + AEquals := AEquals and (Self.Data.State = Data.State); + AEquals := AEquals and (Self.Data.BackgroundColor = Data.BackgroundColor); + AEquals := AEquals and (Self.Data.NativeState = Data.NativeState); + end; + if AEquals then + Result := TcxRegion.Create + else + Result := TcxRegion.Create(Bounds); +end; + +function TcxEditButtonViewInfo.Repaint(AControl: TWinControl; + AViewInfo: TcxEditButtonViewInfo; const AEditPosition: TPoint): Boolean; +var + R: TRect; +begin + with AViewInfo do + begin + Result := Self.Data.Style <> Data.Style; + Result := Result or (Self.Data.State <> Data.State); + Result := Result or (Self.Data.BackgroundColor <> Data.BackgroundColor); + Result := Result or (Self.Data.NativeState <> Data.NativeState); + end; + if Result then + begin + R := Bounds; + OffsetRect(R, AEditPosition.X, AEditPosition.Y); + InternalInvalidate(AControl.Handle, R, cxEmptyRect, HasBackground); + end; +end; + +{ TcxEditButton } + +constructor TcxEditButton.Create(Collection: TCollection); +begin + Collection.BeginUpdate; + try + inherited Create(Collection); + FContentAlignment := taCenter; + FEnabled := True; + FKind := bkDown; + FStretchable := True; + FTextColor := clBtnText; + FVisible := True; + finally + Collection.EndUpdate; + end; +end; + +destructor TcxEditButton.Destroy; +begin + if FGlyph <> nil then + FreeAndNil(FGlyph); + inherited Destroy; +end; + +procedure TcxEditButton.Assign(Source: TPersistent); +begin + if Source is TcxEditButton then + begin + if Assigned(Collection) then Collection.BeginUpdate; + try + with Source as TcxEditButton do + begin + Self.Caption := Caption; + Self.FVisibleCaption := FVisibleCaption; + Self.ContentAlignment := ContentAlignment; + Self.Default := Default; + Self.Enabled := Enabled; + Self.Glyph := Glyph; + Self.Kind := Kind; + Self.LeftAlignment := LeftAlignment; + Self.Stretchable := Stretchable; + Self.Tag := Tag; + Self.TextColor := TextColor; + Self.Visible := Visible; + Self.Width := Width; + Self.Hint := Hint; + end + finally + if Assigned(Collection) then Collection.EndUpdate; + end + end + else + inherited Assign(Source); +end; + +function TcxEditButton.GetGlyph: TBitmap; +begin + if FGlyph = nil then + FGlyph := TBitmap.Create; + FGlyph.OnChange := GlyphChanged; + Result := FGlyph; +end; + +procedure TcxEditButton.GlyphChanged(Sender: TObject); +begin + Changed(False); +end; + +function TcxEditButton.IsTagStored: Boolean; +begin + Result := Tag <> 0; +end; + +procedure TcxEditButton.SetCaption(const Value: TCaption); +begin + if Value <> FCaption then + begin + FCaption := Value; + FVisibleCaption := RemoveAccelChars(FCaption); + Changed(False); + end; +end; + +procedure TcxEditButton.SetContentAlignment(Value: TAlignment); +begin + if Value <> FContentAlignment then + begin + FContentAlignment := Value; + Changed(False); + end; +end; + +procedure TcxEditButton.SetDefault(Value: Boolean); +var + I: Integer; +begin + if FDefault <> Value then + begin + if Value and Assigned(Collection) and (Collection is TcxEditButtons) then + with Collection as TcxEditButtons do + for I := 0 to Count - 1 do + Items[I].FDefault := False; + FDefault := Value; + Changed(True); + end; +end; + +procedure TcxEditButton.SetEnabled(Value: Boolean); +begin + if Value <> FEnabled then + begin + FEnabled := Value; + Changed(False); + end; +end; + +procedure TcxEditButton.SetGlyph(Value: TBitmap); +begin + if Value <> nil then + Glyph.Assign(Value) + else + if FGlyph <> nil then + FreeAndNil(FGlyph); + Changed(False); +end; + +procedure TcxEditButton.SetKind(Value: TcxEditButtonKind); +begin + if FKind <> Value then + begin + FKind := Value; + Changed(False); + end; +end; + +procedure TcxEditButton.SetLeftAlignment(Value: Boolean); +begin + if FLeftAlignment <> Value then + begin + FLeftAlignment := Value; + Changed(False); + end; +end; + +procedure TcxEditButton.SetStretchable(Value: Boolean); +begin + if Value <> FStretchable then + begin + FStretchable := Value; + Changed(False); + end; +end; + +procedure TcxEditButton.SetTextColor(Value: TColor); +begin + if Value <> FTextColor then + begin + FTextColor := Value; + Changed(False); + end; +end; + +procedure TcxEditButton.SetVisible(Value: Boolean); +begin + if FVisible <> Value then + begin + FVisible := Value; + Changed(False); + end; +end; + +procedure TcxEditButton.SetWidth(Value: Integer); +begin + if (FWidth >= 0) and (FWidth <> Value) then + begin + FWidth := Value; + Changed(False); + end; +end; + +{ TcxEditButtons } + +constructor TcxEditButtons.Create(AOwner: TPersistent; + AButtonClass: TcxEditButtonClass); +begin + FOwner := AOwner; + inherited Create(AButtonClass); +end; + +function TcxEditButtons.Add: TcxEditButton; +begin + Result := TcxEditButton(inherited Add); +end; + +class function TcxEditButtons.GetButtonClass: TcxEditButtonClass; +begin + Result := TcxEditButton; +end; + +function TcxEditButtons.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +procedure TcxEditButtons.Update(Item: TCollectionItem); +begin + if Assigned(FOnChange) then + FOnChange(Self); +end; + +function TcxEditButtons.GetItem(Index: Integer): TcxEditButton; +begin + Result := TcxEditButton(inherited GetItem(Index)); +end; + +function TcxEditButtons.GetVisibleCount: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + if Items[I].Visible then + Inc(Result); +end; + +procedure TcxEditButtons.SetItem(Index: Integer; Value: TcxEditButton); +begin + inherited SetItem(Index, Value); +end; + +{ TcxCustomEditViewInfo } + +constructor TcxCustomEditViewInfo.Create; +begin + inherited Create; + PressedButton := -1; + SelectedButton := -1; +end; + +destructor TcxCustomEditViewInfo.Destroy; +begin + SetButtonCount(0); + inherited Destroy; +end; + +procedure TcxCustomEditViewInfo.Assign(Source: TObject); +var + I: Integer; +begin + if Source is TcxCustomEditViewInfo then + with Source as TcxCustomEditViewInfo do + begin + Self.BackgroundColor := BackgroundColor; + Self.BorderColor := BorderColor; + Self.BorderStyle := BorderStyle; + Self.ContainerState := ContainerState; + Self.NativeState := NativeState; + Self.SetButtonCount(Length(ButtonsInfo)); + for I := 0 to Length(ButtonsInfo) - 1 do + Self.ButtonsInfo[I].Assign(ButtonsInfo[I]); + Self.PressedButton := PressedButton; + Self.SelectedButton := SelectedButton; + end; + inherited Assign(Source); +end; + +function TcxCustomEditViewInfo.GetUpdateRegion(AViewInfo: TcxContainerViewInfo): TcxRegion; +var + I: Integer; + AEquals: Boolean; + ATempRgn: TcxRegion; +begin + Result := inherited GetUpdateRegion(AViewInfo); + if not(AViewInfo is TcxCustomEditViewInfo) then + Exit; + with TcxCustomEditViewInfo(AViewInfo) do + begin + AEquals := (Self.BorderColor = BorderColor) or (Self.BorderStyle = ebsNone); + AEquals := AEquals and (Self.BorderStyle = BorderStyle); + AEquals := AEquals and (Length(Self.ButtonsInfo) = Length(ButtonsInfo)); + AEquals := AEquals and (Self.NativeState = NativeState); + if not AEquals then + begin + if not IsRectEmpty(Self.Bounds) then + begin + ATempRgn := TcxRegion.Create(Self.Bounds); + UniteRegions(Result, ATempRgn); + ATempRgn.Free; + end; + Exit; + end; + for I := 0 to Length(Self.ButtonsInfo) - 1 do + begin + ATempRgn := Self.ButtonsInfo[I].GetUpdateRegion(ButtonsInfo[I]); + if not IsRegionEmpty(ATempRgn) then + UniteRegions(Result, ATempRgn); + ATempRgn.Free; + end; + end; +end; + +procedure TcxCustomEditViewInfo.Offset(DX, DY: Integer); +var + I: Integer; +begin + inherited Offset(DX, DY); + OffsetRect(InnerEditRect, DX, DY); + OffsetRect(ShadowRect, DX, DY); + for I := 0 to Length(ButtonsInfo) - 1 do + with ButtonsInfo[I] do + begin + OffsetRect(Bounds, DX, DY); + OffsetRect(VisibleBounds, DX, DY); + end; +end; + +function TcxCustomEditViewInfo.DrawBackground(ACanvas: TcxCanvas): Boolean; +begin + Result := IsInplace and DoDrawBackground(ACanvas); +end; + +function TcxCustomEditViewInfo.DrawBackground(ACanvas: TcxCanvas; + const APos: TPoint): Boolean; +var + APrevWindowOrg: TPoint; +begin + APrevWindowOrg := ACanvas.WindowOrg; + ACanvas.WindowOrg := Point(APrevWindowOrg.X + APos.X, APrevWindowOrg.Y + APos.Y); + try + Result := DrawBackground(ACanvas); + finally + ACanvas.WindowOrg := APrevWindowOrg; + end; +end; + +procedure TcxCustomEditViewInfo.DrawButton(ACanvas: TcxCanvas; AButtonVisibleIndex: Integer); +var + APrevClipRegion: TcxRegion; + AButtonViewInfo: TcxEditButtonViewInfo; +begin + AButtonViewInfo := ButtonsInfo[AButtonVisibleIndex]; + AButtonViewInfo.Data.BackgroundColor := BackgroundColor; + if not IsRectEmpty(AButtonViewInfo.VisibleBounds) then + begin + APrevClipRegion := nil; + try + if (AButtonViewInfo.Bounds.Left < BorderRect.Left) or + (AButtonViewInfo.Bounds.Right > BorderRect.Right) or + (AButtonViewInfo.Bounds.Top < BorderRect.Top) or + (AButtonViewInfo.Bounds.Bottom > BorderRect.Bottom) then + begin + APrevClipRegion := ACanvas.GetClipRegion; + ACanvas.IntersectClipRect(AButtonViewInfo.VisibleBounds); + end; + if not DoDrawButton(ACanvas, AButtonVisibleIndex) then + DrawEditButton(ACanvas, AButtonVisibleIndex); + finally + if APrevClipRegion <> nil then + ACanvas.SetClipRegion(APrevClipRegion, roSet); + end; + end; +end; + +procedure TcxCustomEditViewInfo.DrawButtons(ACanvas: TcxCanvas); +var + I: Integer; +begin + if (evsPaintButtons in FState) or ((Edit <> nil) and (Edit.IsButtonDC(ACanvas.Handle))) then + Exit; + Include(FState, evsPaintButtons); + try + for I := 0 to Length(ButtonsInfo) - 1 do + DrawButton(ACanvas, I); + finally + Exclude(FState, evsPaintButtons) + end; +end; + +procedure TcxCustomEditViewInfo.DrawEditBackground(ACanvas: TcxCanvas; ARect, AGlyphRect: TRect; AGlyphTransparent: Boolean); +begin + ACanvas.SaveDC; + try + if not AGlyphTransparent then + ACanvas.SetClipRegion(TcxRegion.Create(AGlyphRect), roSubtract); + case GetDrawBackgroundStyle of + dbsSimpleParent: cxDrawTransparentControlBackground(Edit, ACanvas, ARect); + dbsThemeParent: cxDrawThemeParentBackground(Edit, ACanvas, ARect); + dbsCustomEdit: DrawCustomEdit(ACanvas, Self, True, bpsSolid); + dbsCustom: + begin + ACanvas.SetClipRegion(TcxRegion.Create(ARect), roIntersect); + DrawBackground(ACanvas); + end; + dbsSimpleFill: cxEditFillRect(ACanvas, ARect, BackgroundColor); + end; + finally + ACanvas.RestoreDC; + end; +end; + +procedure TcxCustomEditViewInfo.DrawButtonBackground(ACanvas: TcxCanvas; + AButtonVisibleIndex: Integer; const ARect: TRect; ABrushColor: TColor); +begin + if not DoDrawButtonBackground(ACanvas, ARect, AButtonVisibleIndex) then + if ButtonsInfo[AButtonVisibleIndex].Data.NativeStyle then + DrawNativeButtonBackground(ACanvas, ButtonsInfo[AButtonVisibleIndex], ARect) + else + DrawUsualButtonBackground(ACanvas, ButtonsInfo[AButtonVisibleIndex], ARect, ABrushColor); +end; + +procedure TcxCustomEditViewInfo.DrawButtonBorderByPainter( + AButtonViewInfo: TcxEditButtonViewInfo; var ARect: TRect; out AContentRect: TRect; + var APenColor, ABrushColor: TColor); +begin + AContentRect := ARect; + GetColorSettingsByPainter(ABrushColor, APenColor); + if ABrushColor = clDefault then + begin + if Edit <> nil then + ABrushColor := FEdit.Style.Color + else + if AButtonViewInfo.Data.State = ebsDisabled then + ABrushColor := clBtnFace + else + ABrushColor := clWindow; + end; + if APenColor = clDefault then + APenColor := clBtnText; +end; + +procedure TcxCustomEditViewInfo.DrawButtonBorder(ACanvas: TcxCanvas; + AButtonVisibleIndex: Integer; var ARect: TRect; out AContentRect: TRect; + var APenColor, ABrushColor: TColor); +var + AButtonStyle: TcxEditButtonStyle; + AButtonViewInfo: TcxEditButtonViewInfo; +begin + AButtonViewInfo := ButtonsInfo[AButtonVisibleIndex]; + if DoDrawButtonBorder(ACanvas, AButtonVisibleIndex, ARect, AContentRect) then + Exit; + + if AButtonViewInfo.Data.NativeState <> TC_NONE then + DrawNativeButtonBorder(ACanvas, AButtonViewInfo, ARect, AContentRect, APenColor, ABrushColor) + else + if Painter <> nil then + DrawButtonBorderByPainter(AButtonViewInfo, ARect, AContentRect, APenColor, ABrushColor) + else + begin + AButtonStyle := AButtonViewInfo.Data.Style; + if (AButtonViewInfo.Data.State in [ebsPressed, ebsSelected]) and (AButtonStyle = btsSimple) then + AButtonStyle := btsFlat; + case AButtonStyle of + bts3D: + Draw3DButtonBorder(ACanvas, AButtonViewInfo, ARect, AContentRect, APenColor, ABrushColor); + btsFlat: + DrawFlatButtonBorder(ACanvas, AButtonViewInfo, ARect, AContentRect, APenColor, ABrushColor); + btsSimple: + DrawSimpleButtonBorder(ACanvas, AButtonViewInfo, ARect, AContentRect, APenColor, ABrushColor); + btsHotFlat: + DrawHotFlatButtonBorder(ACanvas, AButtonViewInfo, ARect, AContentRect, APenColor, ABrushColor); + btsUltraFlat, btsOffice11: + DrawUltraFlatButtonBorder(ACanvas, AButtonViewInfo, AButtonStyle = btsOffice11, ARect, AContentRect, APenColor, ABrushColor); + end; + end; +end; + +procedure TcxCustomEditViewInfo.DrawButtonContent(ACanvas: TcxCanvas; + AButtonVisibleIndex: Integer; const AContentRect: TRect; + APenColor, ABrushColor: TColor; ANeedOffsetContent: Boolean); +const + EditBtnKind2EditBtnPainterKind: array [TcxEditButtonKind] of TcxEditBtnKind = + (cxbkEllipsisBtn, cxbkComboBtn, cxbkEditorBtn, cxbkEditorBtn); + +var + AButtonViewInfo: TcxEditButtonViewInfo; + + procedure GetContentPosition(const AContentSize: TSize; out X, Y: Integer; + AOffsetContent: Boolean); + var + AHorzSpace, AVertSpace: Integer; + begin + AHorzSpace := cxRectWidth(AContentRect) - AContentSize.cx; + AVertSpace := cxRectHeight(AContentRect) - AContentSize.cy; + X := AContentRect.Left + AHorzSpace div 2; + Y := AContentRect.Top + AVertSpace div 2; + if AOffsetContent then + begin + if X + AContentSize.cx < AContentRect.Right then + Inc(X); + if Y + AContentSize.cy < AContentRect.Bottom then + Inc(Y); + end; + end; + + procedure DrawArrowButtonContent; + + procedure DrawArrow(const R: TRect; AColor: TColor); + var + ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass; // for CLR + begin + ALookAndFeelPainter := TcxStandardLookAndFeelPainter; + ALookAndFeelPainter.DrawArrow(ACanvas, R, adDown, AColor); + end; + + var + AButtonHeight, AButtonWidth: Integer; + R: TRect; + begin + AButtonWidth := cxRectWidth(AButtonViewInfo.Bounds) - cxRectWidth(AContentRect); + R := AContentRect; + if not Odd(AButtonWidth) then + begin + Dec(R.Left, AButtonWidth div 2); + Inc(R.Right, AButtonWidth div 2); + if ANeedOffsetContent then + OffsetRect(R, 1, 0); + end + else + if not ANeedOffsetContent then + begin + Inc(R.Right, AButtonWidth div 2); + Dec(R.Left, AButtonWidth - AButtonWidth div 2); + end else + begin + Dec(R.Left, AButtonWidth div 2); + Inc(R.Right, AButtonWidth - AButtonWidth div 2); + end; + if ANeedOffsetContent then + OffsetRect(R, 0, 1); + + if IsInplace then + begin + AButtonHeight := AButtonViewInfo.Bounds.Bottom - AButtonViewInfo.Bounds.Top; + Dec(AButtonHeight, AContentRect.Bottom - AContentRect.Top); + if not Odd(AButtonHeight) then + begin + Dec(R.Top, AButtonHeight div 2); + Inc(R.Bottom, AButtonHeight div 2); + end + else + if not ANeedOffsetContent then + begin + Inc(R.Bottom, AButtonHeight div 2); + Dec(R.Top, AButtonHeight - AButtonHeight div 2); + end else + begin + Dec(R.Top, AButtonHeight div 2); + Inc(R.Bottom, AButtonHeight - AButtonHeight div 2); + end; + end; + + if AButtonViewInfo.Data.State <> ebsDisabled then + DrawArrow(R, APenColor) + else + begin + DrawArrow(cxRectOffset(R, 1, 1), clBtnHighlight); + DrawArrow(R, clBtnShadow); + end; + end; + + procedure DrawEllipsisButtonContent; + + procedure DrawEllipsis(X, Y, ASize: Integer; AColor: TColor); + var + ABrush: TBrushHandle; + begin + ABrush := GetSolidBrush(ACanvas, AColor); + cxEditFillRect(ACanvas.Handle, Rect(X, Y, X + ASize, Y + ASize), ABrush); + cxEditFillRect(ACanvas.Handle, Rect(X + ASize + 2, Y, X + ASize * 2 + 2, Y + ASize), ABrush); + cxEditFillRect(ACanvas.Handle, Rect(X + ASize * 2 + 4, Y, X + ASize * 3 + 4, Y + ASize), ABrush); + end; + + var + X, Y: Integer; + AContentSize: TSize; + begin + if AContentRect.Right - AContentRect.Left < 12 then + AContentSize.cy := 1 + else + AContentSize.cy := 2; + AContentSize.cx := AContentSize.cy * 3 + 4; + GetContentPosition(AContentSize, X, Y, ANeedOffsetContent); + if AButtonViewInfo.Data.State <> ebsDisabled then + DrawEllipsis(X, Y, AContentSize.cy, APenColor) + else + begin + DrawEllipsis(X + 1, Y + 1, AContentSize.cy, clBtnHighlight); + DrawEllipsis(X, Y, AContentSize.cy, clBtnShadow); + end; + end; + + procedure DrawGlyphButtonContent; + var + AGlyph: TBitmap; + AContentSize: TSize; + AGlyphPosition: TPoint; + begin + AGlyph := AButtonViewInfo.Glyph; + if not VerifyBitmap(AGlyph) then + Exit; + + AContentSize.cx := Min(cxRectWidth(AContentRect), AGlyph.Width); + AContentSize.cy := Min(cxRectHeight(AContentRect), AGlyph.Height); + GetContentPosition(AContentSize, AGlyphPosition.X, AGlyphPosition.Y, ANeedOffsetContent); + + DrawGlyph(ACanvas, AGlyphPosition.X, AGlyphPosition.Y, AGlyph, AButtonViewInfo.Data.State <> ebsDisabled, clNone); + end; + + procedure DrawTextButtonContent; + + procedure DrawText(const R: TRect; AColor: TColor); + begin + ACanvas.Font.Color := AColor; + ACanvas.DrawText(AButtonViewInfo.Data.Caption, R, cxAlignmentsHorz[AButtonViewInfo.Data.ContentAlignment] or + cxAlignVCenter or cxSingleLine or cxShowPrefix or cxShowEndEllipsis); + end; + + var + R: TRect; + AColor: TColor; + begin + ACanvas.Brush.Style := bsClear; + ACanvas.Font := Font; + + R := AContentRect; + if not IsInplace then + InflateRect(R, -1, -1) + else + InflateRect(R, -1, 0); + Dec(R.Right); + if AButtonViewInfo.Data.State = ebsDisabled then + begin + DrawText(cxRectOffset(R, 1, 1), clBtnHighlight); + DrawText(R, clBtnShadow); + end + else + begin + if (AButtonViewInfo.Data.Style = btsHotFlat) and (AButtonViewInfo.Data.State in [ebsPressed, ebsSelected]) then + AColor := APenColor + else + if AButtonViewInfo.Data.TextColor = clDefault then + AColor := TextColor + else + AColor := AButtonViewInfo.Data.TextColor; + + if ANeedOffsetContent then + OffsetRect(R, 1, 1); + DrawText(R, AColor); + end; + ACanvas.Brush.Style := bsSolid; + end; + +var + AKind: TcxEditBtnKind; + +begin + ACanvas.SaveState; + try + ACanvas.SetClipRegion(TcxRegion.Create(AContentRect), roIntersect); + + AButtonViewInfo := ButtonsInfo[AButtonVisibleIndex]; + if Painter <> nil then + begin + AKind := EditBtnKind2EditBtnPainterKind[AButtonViewInfo.Data.Kind]; + Painter.DrawEditorButton(ACanvas, AContentRect, AKind, + EditBtnState2ButtonState[AButtonViewInfo.Data.State]); + case AButtonViewInfo.Data.Kind of + bkText: + DrawTextButtonContent; + bkGlyph: + DrawGlyphButtonContent; + end; + end + else + case AButtonViewInfo.Data.Kind of + bkDown: + DrawArrowButtonContent; + bkEllipsis: + DrawEllipsisButtonContent; + bkGlyph: + DrawGlyphButtonContent; + bkText: + DrawTextButtonContent; + end; + finally + ACanvas.RestoreState; + end; +end; + +procedure TcxCustomEditViewInfo.DrawNativeStyleEditBackground(ACanvas: TcxCanvas; ADrawBackground: Boolean; + ABackgroundStyle: TcxEditBackgroundPaintingStyle; ABackgroundBrush: TBrushHandle); + + procedure CalculateNativeInfo(out AThemedObjectType: TdxThemedObjectType; out ANativePart: Integer; out ABoundsRect: TRect); + begin + ABoundsRect := Bounds; + AThemedObjectType := totEdit; + if IsCompositionEnabled then + begin + if ABackgroundStyle = bpsComboListEdit then + begin + AThemedObjectType := totButton; + ANativePart := BP_PUSHBUTTON; + ABoundsRect := cxRectInflate(ABoundsRect, 1, 1); + end + else + ANativePart := EP_EDITBORDER_NOSCROLL + end + else + ANativePart := EP_EDITTEXT; + end; + + function GetContentRect(ATheme: TdxTheme; ANativePart: Integer; const ABoundsRect: TRect): TRect; + begin + case ABackgroundStyle of + bpsSolid: + if IsCompositionEnabled then + Result := cxRectInflate(ABoundsRect, -2, -2) + else + GetThemeBackgroundContentRect(ATheme, ACanvas.Handle, ANativePart, + NativeState, ABoundsRect, Result); + bpsComboEdit: + begin + Result := cxRectInflate(ABoundsRect, -(cxEditMaxBorderWidth + 1), + -(cxEditMaxBorderWidth + 1)); + Result.Right := Result.Right - 1; + end; + bpsComboListEdit: + if IsCompositionEnabled then + Result := cxEmptyRect + else + Result := ClientRect; + end; + end; + + procedure DrawBorder(ATheme: TdxTheme; ANativePart: Integer; const ABoundsRect, AContentRect: TRect); + begin + ACanvas.SaveClipRegion; + try + ACanvas.ExcludeClipRect(AContentRect); + if IsThemeBackgroundPartiallyTransparent(ATheme, ANativePart, NativeState) and (Edit <> nil) then + cxDrawThemeParentBackground(Edit, ACanvas, ABoundsRect); + DrawThemeBackground(ATheme, ACanvas.Handle, ANativePart, NativeState, ABoundsRect); + finally + ACanvas.RestoreClipRegion; + end; + end; + + procedure DrawBackground(const AContentRect: TRect); + begin + if ADrawBackground or IsInplace or (BorderStyle = ebsNone) then + cxEditFillRect(ACanvas.Handle, AContentRect, ABackgroundBrush) + else + if ABackgroundStyle <> bpsComboListEdit then + InternalFillRect(ACanvas, AContentRect, BorderRect, ABackgroundBrush); + end; + +var + AContentRect: TRect; + ATheme: TdxTheme; + AThemedObjectType: TdxThemedObjectType; + ABoundsRect: TRect; + ANativePart: Integer; +begin + if IsInplace or (BorderStyle = ebsNone) then + AContentRect := Bounds + else + begin + CalculateNativeInfo(AThemedObjectType, ANativePart, ABoundsRect); + ATheme := OpenTheme(AThemedObjectType); + AContentRect := GetContentRect(ATheme, ANativePart, ABoundsRect); + + DrawBorder(ATheme, ANativePart, ABoundsRect, AContentRect); + end; + + if not Transparent then + DrawBackground(AContentRect); +end; + +function TcxCustomEditViewInfo.IsBackgroundTransparent: Boolean; +begin + Result := not (GetDrawBackgroundStyle in [dbsCustomEdit, dbsSimpleFill]); +end; + +function TcxCustomEditViewInfo.IsCustomBackground: Boolean; +begin + Result := DrawBackground(nil); +end; + +function TcxCustomEditViewInfo.IsCustomButton(AButtonVisibleIndex: Integer = 0): Boolean; +begin + Result := DoDrawButton(nil, AButtonVisibleIndex); +end; + +function TcxCustomEditViewInfo.IsCustomButtonBackground(AButtonVisibleIndex: Integer = 0): Boolean; +begin + Result := DoDrawButtonBackground(nil, cxEmptyRect, AButtonVisibleIndex); +end; + +function TcxCustomEditViewInfo.IsCustomButtonBorder(AButtonVisibleIndex: Integer = 0): Boolean; +var + ARect: TRect; +begin + Result := DoDrawButtonBorder(nil, AButtonVisibleIndex, ARect, ARect); +end; + +function TcxCustomEditViewInfo.IsCustomDrawButton(AButtonVisibleIndex: Integer = 0): Boolean; +begin + Result := IsCustomButtonBorder(AButtonVisibleIndex) or IsCustomButtonBackground(AButtonVisibleIndex) or IsCustomButton(AButtonVisibleIndex); +end; + +function TcxCustomEditViewInfo.IsHotTrack: Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to Length(ButtonsInfo) - 1 do + if ButtonsInfo[I].Data.State = ebsSelected then + begin + Result := True; + Break; + end; +end; + +function TcxCustomEditViewInfo.IsHotTrack(P: TPoint): Boolean; +var + I: Integer; +begin + Result := False; + Dec(P.X, Left); + Dec(P.Y, Top); + for I := 0 to Length(ButtonsInfo) - 1 do + if PtInRect(ButtonsInfo[I].Bounds, P) then + begin + Result := True; + Break; + end; +end; + +function TcxCustomEditViewInfo.NeedShowHint(ACanvas: TcxCanvas; + const P: TPoint; out AText: TCaption; out AIsMultiLine: Boolean; + out ATextRect: TRect): Boolean; +begin + Result := NeedShowHint(ACanvas, P, cxEmptyRect, AText, AIsMultiLine, ATextRect); +end; + +function TcxCustomEditViewInfo.NeedShowHint(ACanvas: TcxCanvas; + const P: TPoint; const AVisibleBounds: TRect; out AText: TCaption; + out AIsMultiLine: Boolean; out ATextRect: TRect): Boolean; +var + APart: Integer; +begin + Result := False; + APart := GetPart(P); + if APart >= ecpButton then + begin + AText := GetShortHint(GetHintText(APart)); + AIsMultiLine := False; + ATextRect := GetHintTextRect(P, APart); + Result := Length(AText) > 0; + end; +end; + +procedure TcxCustomEditViewInfo.Paint(ACanvas: TcxCanvas); +begin + if Assigned(FOnPaint) then + FOnPaint(Self, ACanvas); + inherited; +end; + +procedure TcxCustomEditViewInfo.PaintEx(ACanvas: TcxCanvas); +var + P: TPoint; + ACanvasHandle: HDC; +begin + ACanvasHandle := ACanvas.Handle; + GetWindowOrgEx(ACanvasHandle, P); + Dec(P.X, Left); + Dec(P.Y, Top); + SetWindowOrgEx(ACanvasHandle, P.X, P.Y, @P); + try + Paint(ACanvas); + finally + SetWindowOrgEx(ACanvasHandle, P.X, P.Y, nil); + end; +end; + +procedure TcxCustomEditViewInfo.PrepareCanvasFont(ACanvas: TCanvas); +begin +end; + +function TcxCustomEditViewInfo.Repaint(AControl: TWinControl; + AViewInfo: TcxContainerViewInfo = nil): Boolean; +begin + Result := Repaint(AControl, cxEmptyRect, AViewInfo); +end; + +function TcxCustomEditViewInfo.Repaint(AControl: TWinControl; + const AInnerEditRect: TRect; AViewInfo: TcxContainerViewInfo = nil): Boolean; + + procedure CheckRect(var R: TRect); + begin + with ClientRect do + begin + if R.Left < Left then R.Left := Left; + if R.Top < Top then R.Top := Top; + if R.Right > Right then R.Right := Right; + if R.Bottom > Bottom then R.Bottom := Bottom; + end; + end; + + function GetInnerEditRect: TRect; + begin + Result := AInnerEditRect; + CheckRect(Result); + end; + + function RepaintButtons: Boolean; + var + I: Integer; + AEditPosition: TPoint; + begin + Result := False; + AEditPosition := Point(Left, Top); + with TcxCustomEditViewInfo(AViewInfo) do + for I := 0 to Length(Self.ButtonsInfo) - 1 do + if Self.ButtonsInfo[I].Repaint(AControl, ButtonsInfo[I], AEditPosition) then + Result := True; + end; + +var + R, R1: TRect; +begin + Result := AControl.HandleAllocated; + if not Result then + Exit; + + R := Bounds; + OffsetRect(R, Left, Top); + Result := AViewInfo <> nil; + if not Result then + begin + InternalInvalidate(AControl.Handle, R, GetInnerEditRect, HasBackground); + Exit; + end; + with TcxCustomEditViewInfo(AViewInfo) do + begin + while True do + begin + if (Self.NativeState <> NativeState) or + (Self.BackgroundColor <> BackgroundColor) or + (Self.ContainerState <> ContainerState) and Self.IsRepaintOnStateChangingNeeded then + begin + R1 := GetInnerEditRect; + Break; + end; + if Length(Self.ButtonsInfo) <> Length(ButtonsInfo) then + begin + R1 := GetInnerEditRect; + Break; + end; + if (Self.BorderColor <> BorderColor) and (Self.BorderStyle <> ebsNone) or + (Self.BorderStyle <> BorderStyle) then + begin + R1 := Self.BorderRect; + OffsetRect(R1, Self.Left, Self.Top); + Break; + end; + Result := False; + Break; + end; + if Result then + if not IsRectEmpty(Self.Bounds) and not EqualRect(R, R1) then + InternalInvalidate(AControl.Handle, R, R1, HasBackground); + if (Length(Self.ButtonsInfo) = Length(ButtonsInfo)) and RepaintButtons then + Result := True; + end; +end; + +procedure TcxCustomEditViewInfo.SetButtonCount(ACount: Integer); +var + I: Integer; + APrevLength: Integer; +begin + APrevLength := Length(ButtonsInfo); + if APrevLength <> ACount then + begin + if ACount < APrevLength then + begin + for I := Length(ButtonsInfo) - 1 downto ACount do + ButtonsInfo[I].Free; + SetLength(ButtonsInfo, ACount); + end else + begin + SetLength(ButtonsInfo, ACount); + for I := APrevLength to ACount - 1 do + ButtonsInfo[I] := GetButtonViewInfoClass.Create; + end; + end; +end; + +function TcxCustomEditViewInfo.GetButtonViewInfoClass: TcxEditButtonViewInfoClass; +begin + Result := TcxEditButtonViewInfo; +end; + +procedure TcxCustomEditViewInfo.GetColorSettingsByPainter( + out ABackground, ATextColor: TColor); +begin + ABackground := clDefault; + ATextColor := clDefault; + if Painter <> nil then + begin + if (FEdit = nil) or not FEdit.ActiveStyle.IsValueAssigned(svColor) then + ABackground := Painter.DefaultEditorBackgroundColor(not Enabled); + if (FEdit = nil) or not FEdit.ActiveStyle.IsValueAssigned(svTextColor) then + ATextColor := Painter.DefaultEditorTextColor(not Enabled); + end; +end; + +function TcxCustomEditViewInfo.GetContainerBorderStyle: TcxContainerBorderStyle; +begin + Result := TcxContainerBorderStyle(BorderStyle); +end; + +procedure TcxCustomEditViewInfo.InternalPaint(ACanvas: TcxCanvas); +begin + DrawCustomEdit(ACanvas, Self, True, bpsSolid); +end; + +function TcxCustomEditViewInfo.IsRepaintOnStateChangingNeeded: Boolean; +begin + Result := True; +end; + +procedure TcxCustomEditViewInfo.DrawEditButton(ACanvas: TcxCanvas; + AButtonVisibleIndex: Integer); + + function NeedDoubleBuffered: Boolean; + begin + Result := (ButtonsInfo[AButtonVisibleIndex].Data.Kind = bkGlyph) and + VerifyBitmap(ButtonsInfo[AButtonVisibleIndex].Glyph) or (Painter <> nil); + end; + + function NeedOffsetContent: Boolean; + begin + Result := (ButtonsInfo[AButtonVisibleIndex].Data.State = ebsPressed) and + ((Edit = nil) or (ecoOffsetButtonContent in Edit.ContentParams.Options)); // to support the solution in B782 + end; + +var + ABoundsRect, AContentRect, ABackgroundRect: TRect; + APenColor, ABrushColor: TColor; + + ATempCanvas: TcxCanvas; + ABackgroundBitmap: TBitmap; +begin + APenColor := clBtnText; + ABrushColor := 0; + ABoundsRect := ButtonsInfo[AButtonVisibleIndex].Bounds; + + ATempCanvas := TcxCanvas.Create(nil); + if NeedDoubleBuffered then + begin + ABackgroundBitmap := TBitmap.Create; + ABackgroundBitmap.Width := cxRectWidth(ABoundsRect); + ABackgroundBitmap.Height := cxRectHeight(ABoundsRect); + + ATempCanvas.Canvas := ABackgroundBitmap.Canvas; + ATempCanvas.WindowOrg := ABoundsRect.TopLeft; + end + else + begin + ABackgroundBitmap := nil; + ATempCanvas.Canvas := ACanvas.Canvas; + end; + + try + ABackgroundRect := ABoundsRect; + DrawButtonBorder(ATempCanvas, AButtonVisibleIndex, ABackgroundRect, AContentRect, APenColor, ABrushColor); + + if not IsRectEmpty(ABackgroundRect) then + DrawButtonBackground(ATempCanvas, AButtonVisibleIndex, ABackgroundRect, ABrushColor); + if not IsRectEmpty(AContentRect) then + DrawButtonContent(ATempCanvas, AButtonVisibleIndex, AContentRect, APenColor, ABrushColor, NeedOffsetContent); + finally + if ABackgroundBitmap <> nil then + begin + ATempCanvas.WindowOrg := cxNullPoint; + ACanvas.Draw(ABoundsRect.Left, ABoundsRect.Top, ABackgroundBitmap); + ABackgroundBitmap.Free; + end; + ATempCanvas.Free; + end; +end; + +procedure TcxCustomEditViewInfo.SetOnDrawBackground(AValue: TcxEditDrawBackgroundEvent); +begin + FOnDrawBackground := AValue; +end; + +procedure TcxCustomEditViewInfo.Draw3DButtonBorder(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; + var ARect: TRect; out AContentRect: TRect; var APenColor, ABrushColor: TColor); +begin + if not AButtonViewInfo.Data.Transparent then + ABrushColor := clBtnFace + else + ABrushColor := AButtonViewInfo.Data.BackgroundColor; + APenColor := clBtnText; + + if AButtonViewInfo.Data.State = ebsPressed then + begin + FrameRectEx(ACanvas, ARect, clBtnShadow); + FrameRectEx(ACanvas, ARect, ABrushColor); + end else + begin + DrawComplexFrameEx(ACanvas, ARect, cl3DLight, cl3DDkShadow); + DrawComplexFrameEx(ACanvas, ARect, clBtnHighlight, clBtnShadow); + end; + + AContentRect := ARect; +end; + +procedure TcxCustomEditViewInfo.DrawFlatButtonBorder(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; + var ARect: TRect; out AContentRect: TRect; var APenColor, ABrushColor: TColor); +begin + if not AButtonViewInfo.Data.Transparent then + ABrushColor := clBtnFace + else + ABrushColor := AButtonViewInfo.Data.BackgroundColor; + + cxEditUtils.DrawButtonBorder(ACanvas, ARect, [bLeft], ABrushColor); + if AButtonViewInfo.Data.State = ebsPressed then + DrawComplexFrameEx(ACanvas, ARect, clBtnShadow, clBtnHighlight) + else + DrawComplexFrameEx(ACanvas, ARect, clBtnHighlight, clBtnShadow); + cxEditUtils.DrawButtonBorder(ACanvas, ARect, [bRight], ABrushColor); + AContentRect := ARect; +end; + +procedure TcxCustomEditViewInfo.DrawHotFlatButtonBorder(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; + var ARect: TRect; out AContentRect: TRect; var APenColor, ABrushColor: TColor); +const + ABrushColorA: array [TcxEditButtonState] of TColor = ( + clBtnFace, clBtnFace, clBtnText, clBtnShadow + ); +begin + with AButtonViewInfo do + begin + ABrushColor := ABrushColorA[Data.State]; + if Data.Transparent then + ABrushColor := Data.BackgroundColor; + + APenColor := clBtnShadow; + if (Data.LeftAlignment and Data.Rightmost) or (not Data.LeftAlignment and Data.Leftmost) then + FrameRectEx(ACanvas, ARect, APenColor) + else + if Data.LeftAlignment then + begin + cxEditUtils.DrawButtonBorder(ACanvas, ARect, [bBottom, bLeft, bTop], APenColor); + cxEditUtils.DrawButtonBorder(ACanvas, ARect, [bRight], ABrushColor); + end + else + begin + cxEditUtils.DrawButtonBorder(ACanvas, ARect, [bTop, bRight, bBottom], APenColor); + cxEditUtils.DrawButtonBorder(ACanvas, ARect, [bLeft], ABrushColor); + end; + + if Data.State in [ebsPressed, ebsSelected] then + if Data.Transparent and (Data.State = ebsSelected) then + APenColor := clBtnShadow + else + APenColor := clWindow + else + APenColor := clBtnText; + cxEditUtils.DrawButtonBorder(ACanvas, ARect, [bLeft, bRight], ABrushColor); + AContentRect := ARect; + end; +end; + +procedure TcxCustomEditViewInfo.DrawNativeButtonBorder(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; + var ARect: TRect; out AContentRect: TRect; var APenColor, ABrushColor: TColor); + + function GetThemeContentRect(AThemeObject: TdxThemedObjectType; APart: Integer): TRect; + var + ATheme: TdxTheme; + begin + ATheme := OpenTheme(AThemeObject); + GetThemeBackgroundContentRect(ATheme, ACanvas.Handle, APart, + AButtonViewInfo.Data.NativeState, AButtonViewInfo.Bounds, Result); + end; + + function GetContentRect: TRect; + begin + if IsCustomDrawButton then + Result := ARect + else + if AButtonViewInfo.Data.ComboBoxStyle then + Result := cxEmptyRect + else + Result := GetThemeContentRect(totButton, BP_PUSHBUTTON) + end; + +begin + AContentRect := GetContentRect; +end; + +procedure TcxCustomEditViewInfo.DrawSimpleButtonBorder(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; + var ARect: TRect; out AContentRect: TRect; var APenColor, ABrushColor: TColor); +begin + if not Transparent then + ACanvas.FrameRect(ARect, AButtonViewInfo.Data.BackgroundColor); + InflateRect(ARect, -1, -1); + if not AButtonViewInfo.Data.Transparent then + ABrushColor := clBtnFace + else + ABrushColor := AButtonViewInfo.Data.BackgroundColor; + cxEditUtils.DrawButtonBorder(ACanvas, ARect, [bLeft, bRight], ABrushColor); + AContentRect := ARect; +end; + +procedure TcxCustomEditViewInfo.DrawUltraFlatButtonBorder(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; + AIsOffice11Style: Boolean; var ARect: TRect; var AContentRect: TRect; out APenColor, ABrushColor: TColor); +var + ABackgroundRect: TRect; + AHighlightColor: TColor; +begin + if AButtonViewInfo.Data.Transparent then + ABrushColor := AButtonViewInfo.Data.BackgroundColor + else + if AButtonViewInfo.Data.State = ebsDisabled then + ABrushColor := clBtnFace + else + if AButtonViewInfo.Data.State = ebsNormal then + if AIsOffice11Style then + ABrushColor := dxOffice11DockColor1 + else + ABrushColor := clBtnFace + else + ABrushColor := GetEditButtonHighlightColor( + AButtonViewInfo.Data.State = ebsPressed, AIsOffice11Style); + + AHighlightColor := GetEditBorderHighlightColor(AIsOffice11Style); + + if (AButtonViewInfo.Data.State in [ebsDisabled, ebsNormal]) or + not AButtonViewInfo.Data.IsInplace and (BorderStyle = ebsNone) or + AButtonViewInfo.Data.IsInplace and not (epoHasExternalBorder in PaintOptions) then + begin + if not(AButtonViewInfo.Data.State in [ebsDisabled, ebsNormal]) then + ACanvas.FrameRect(ARect, AHighlightColor) + else + if not Transparent then + ACanvas.FrameRect(ARect, AButtonViewInfo.Data.BackgroundColor); + InflateRect(ARect, -1, -1); + ABackgroundRect := ARect; + ExtendRect(ARect, Rect(1, 0, 1, 0)); + end + else + begin + ABackgroundRect := ARect; + if AButtonViewInfo.Data.LeftAlignment then + begin + if AButtonViewInfo.Data.Leftmost then + Inc(ARect.Left) + else + begin + cxEditUtils.DrawButtonBorder(ACanvas, ARect, [bLeft], AHighlightColor); + Inc(ABackgroundRect.Left); + end; + if ARect.Right = BorderRect.Right then + Dec(ARect.Right) + else + begin + cxEditUtils.DrawButtonBorder(ACanvas, ARect, [bRight], AHighlightColor); + Dec(ABackgroundRect.Right); + end; + end + else + begin + if AButtonViewInfo.Data.Rightmost then + Dec(ARect.Right) + else + begin + cxEditUtils.DrawButtonBorder(ACanvas, ARect, [bRight], AHighlightColor); + Dec(ABackgroundRect.Right); + end; + if ARect.Left = BorderRect.Left then + Inc(ARect.Left) + else + begin + cxEditUtils.DrawButtonBorder(ACanvas, ARect, [bLeft], AHighlightColor); + Inc(ABackgroundRect.Left); + end; + end; + InflateRect(ARect, -1, -1); + end; + + AContentRect := ARect; + ARect := ABackgroundRect; +end; + +procedure TcxCustomEditViewInfo.DrawNativeButtonBackground(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; const ARect: TRect); +var + APart: Integer; + AThemeObject: TdxThemedObjectType; +begin + if AButtonViewInfo.Data.ComboBoxStyle then + begin + AThemeObject := totComboBox; + if IsCompositionEnabled and not IsInplace then + if AButtonViewInfo.Data.LeftAlignment then + APart := CP_DROPDOWNBUTTONLEFT + else + APart := CP_DROPDOWNBUTTONRIGHT + else + APart := CP_DROPDOWNBUTTON; + end + else + begin + AThemeObject := totButton; + APart := BP_PUSHBUTTON; + end; + DrawThemeBackground(OpenTheme(AThemeObject), ACanvas.Handle, APart, AButtonViewInfo.Data.NativeState, ARect); +end; + +procedure TcxCustomEditViewInfo.DrawUsualButtonBackground(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; const ARect: TRect; ABrushColor: TColor); + + procedure GetBackgroundParams(out AGradientDrawing: Boolean; + out AColor1, AColor2: TColor); + begin + AGradientDrawing := (AButtonViewInfo.Data.Style = btsOffice11) and + AButtonViewInfo.Data.Gradient and not AButtonViewInfo.Data.Transparent and + (AButtonViewInfo.Data.State <> ebsDisabled) and (Painter = nil); + if AGradientDrawing then + case AButtonViewInfo.Data.State of + ebsNormal: + begin + AColor1 := dxOffice11ToolbarsColor1; + AColor2 := dxOffice11ToolbarsColor2; + end; + ebsPressed: + begin + AColor1 := dxOffice11SelectedDownColor1; + AColor2 := dxOffice11SelectedDownColor2; + end; + ebsSelected: + begin + AColor1 := dxOffice11SelectedColor1; + AColor2 := dxOffice11SelectedColor2; + end; + end; + end; + +var + AClipRgn: TcxRegion; + AColor1, AColor2: TColor; + AGradientDrawing: Boolean; + R: TRect; +begin + GetBackgroundParams(AGradientDrawing, AColor1, AColor2); + if not AGradientDrawing then + cxEditFillRect(ACanvas.Handle, ARect, GetSolidBrush(ACanvas, ABrushColor)) + else + begin + AClipRgn := ACanvas.GetClipRegion; + try + R := Rect(ARect.Left, BorderRect.Top, ARect.Right, BorderRect.Bottom); + if AButtonViewInfo.Data.State = ebsNormal then + ExtendRect(R, Rect(0, 1, 0, 1)); + ACanvas.SetClipRegion(TcxRegion.Create(ARect), roIntersect); + FillGradientRect(ACanvas.Handle, R, AColor1, AColor2, False); + finally + ACanvas.SetClipRegion(AClipRgn, roSet); + end; + end; +end; + +function TcxCustomEditViewInfo.DoDrawBackground(ACanvas: TcxCanvas): Boolean; +begin + Result := False; + if Assigned(FOnDrawBackground) then + FOnDrawBackground(Self, ACanvas, Result); +end; + +function TcxCustomEditViewInfo.DoDrawButton(ACanvas: TcxCanvas; + AButtonVisibleIndex: Integer): Boolean; +begin + Result := False; + if Assigned(FOnDrawButton) then + FOnDrawButton(Self, ACanvas, AButtonVisibleIndex, Result); +end; + +function TcxCustomEditViewInfo.DoDrawButtonBackground(ACanvas: TcxCanvas; + const ARect: TRect; AButtonVisibleIndex: Integer): Boolean; +begin + Result := False; + if Assigned(FOnDrawButtonBackground) then + FOnDrawButtonBackground(Self, ACanvas, ARect, AButtonVisibleIndex, Result); +end; + +function TcxCustomEditViewInfo.DoDrawButtonBorder(ACanvas: TcxCanvas; AButtonVisibleIndex: Integer; + out ABackgroundRect, AContentRect: TRect): Boolean; +begin + Result := False; + if Assigned(FOnDrawButtonBorder) then + FOnDrawButtonBorder(Self, ACanvas, AButtonVisibleIndex, ABackgroundRect, AContentRect, Result); +end; + +function TcxCustomEditViewInfo.GetDrawBackgroundStyle: TcxDrawBackgroundStyle; +begin + Result := dbsSimpleFill; + if IsInplace then + begin + if IsCustomBackground then + Result := dbsCustom + else + if IsTransparent then + Result := dbsNone + end + else + begin + if IsTransparent then + Result := dbsSimpleParent + else + if IsNativeBackground then + Result := dbsThemeParent + else + if not NativeStyle then + Result := dbsCustomEdit; + end; +end; + +function TcxCustomEditViewInfo.IsNativeBackground: Boolean; +begin + Result := (Edit <> nil) and TcxCustomEdit(Edit).IsNativeBackground; +end; + +function TcxCustomEditViewInfo.IsTransparent: Boolean; +begin + Result := Transparent or (Edit <> nil) and TcxCustomEdit(Edit).Transparent; +end; + +function TcxCustomEditViewInfo.GetPart(const P: TPoint): Integer; +var + I: Integer; +begin + if PtInRect(BorderRect, P) then + Result := ecpControl + else + Result := ecpNone; + for I := Low(ButtonsInfo) to High(ButtonsInfo) do + if ButtonsInfo[I].Data.State = ebsSelected then + begin + Result := ButtonsInfo[I].Index; + Break; + end; +end; + +function TcxCustomEditViewInfo.GetPartRect(APart: Integer): TRect; +begin + case APart of + ecpNone: + Result := cxNullRect; + ecpControl: + begin + Result := BorderRect; + if Length(ButtonsInfo) > 0 then + Result.Right := ButtonsInfo[0].Bounds.Left; + end; + else + if (APart >= ecpButton) and (APart < Length(ButtonsInfo)) then + Result := ButtonsInfo[APart].Bounds + else + Result := cxNullRect; + end; +end; + +function TcxCustomEditViewInfo.GetHintText(APart: Integer): string; +begin + if (APart >= ecpButton) and (APart < EditProperties.Buttons.Count) then + Result := EditProperties.Buttons[APart].Hint + else + Result := ''; +end; + +function TcxCustomEditViewInfo.GetHintTextRect(const P: TPoint; + APart: Integer): TRect; +var + AHintWindow: THintWindow; +begin + AHintWindow := THintWindow.Create(nil); + try + Result := AHintWindow.CalcHintRect(Screen.Width, GetHintText(APart), nil); + OffsetRect(Result, P.X, P.Y + cxGetCursorSize.cy); + finally + FreeAndNil(AHintWindow); + end; +end; + +{ TcxCustomEditViewData } + +constructor TcxCustomEditViewData.Create(AProperties: TcxCustomEditProperties; + AStyle: TcxCustomEditStyle; AIsInplace: Boolean); +begin + inherited Create; + FIsInplace := AIsInplace; + FProperties := AProperties; + FStyle := AStyle; + Initialize; + SelTextColor := clDefault; + SelBackgroundColor := clDefault; + InitCacheData; +end; + +procedure TcxCustomEditViewData.Calculate(ACanvas: TcxCanvas; const ABounds: TRect; + const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); + + procedure CalculateContainerState; + begin + AViewInfo.ContainerState := GetContainerState(ABounds, P, Button, Shift, AIsMouseEvent); + + Selected := ContainerState * [csActive, csHotTrack] <> []; + if IsDesigning or not Style.HotTrack or IsInplace then + AViewInfo.HotState := chsNoHotTrack + else + if Selected then + AViewInfo.HotState := chsSelected + else + AViewInfo.HotState := chsNormal; + if Edit <> nil then + Style := Edit.ActiveStyle; + + if not IsInplace and NativeStyle then + AViewInfo.BorderStyle := Style.BaseStyle.BorderStyle + else + AViewInfo.BorderStyle := GetBorderStyle; + end; + + procedure CalculatePopupBorderStyle; + const + ADefaultPopupBorderStyleMap: array [TcxEditBorderStyle] of TcxEditPopupBorderStyle = + (epbsFlat, epbsSingle, epbsSingle, epbsFlat, epbsSingle, epbsSingle, epbsSingle); + AInplaceDefaultPopupBorderStyleMap: array [TcxLookAndFeelKind] of TcxEditPopupBorderStyle = + (epbsFlat, epbsFrame3D, epbsSingle, epbsSingle); + begin + AViewInfo.PopupBorderStyle := Style.PopupBorderStyle; + if (AViewInfo.PopupBorderStyle = epbsDefault) and (Edit <> nil) then + if IsInplace then + AViewInfo.PopupBorderStyle := AInplaceDefaultPopupBorderStyleMap[Style.LookAndFeel.Kind] + else + if (AViewInfo.BorderStyle = ebsNone) and (Length(AViewInfo.ButtonsInfo) > 0) then + AViewInfo.PopupBorderStyle := AInplaceDefaultPopupBorderStyleMap[GetEditPopupWindowControlsLookAndFeelKind(Edit)] + else + AViewInfo.PopupBorderStyle := ADefaultPopupBorderStyleMap[AViewInfo.BorderStyle]; + end; + +var + AClientExtent: TRect; + AIContainerInnerControl: IcxContainerInnerControl; + APrevBorderWidth: Integer; +begin + Shift := Shift - [ssShift, ssAlt, ssCtrl]; + + APrevBorderWidth := GetContainerBorderWidth(TcxContainerBorderStyle(AViewInfo.BorderStyle)); + CalculateContainerState; + if not IsInplace and not NativeStyle and + (GetContainerBorderWidth(TcxContainerBorderStyle(AViewInfo.BorderStyle)) < APrevBorderWidth) then + CalculateContainerState; + TcxContainerViewInfo(AViewInfo).BorderStyle := TcxContainerBorderStyle(AViewInfo.BorderStyle); + ContainerState := AViewInfo.ContainerState; + + AViewInfo.EditProperties := Properties; + if IsInplace then + ButtonsOnlyStyle := (ABounds.Right <> MaxInt) and (Properties.ButtonsViewStyle <> bvsNormal) + else + ButtonsOnlyStyle := Properties.ButtonsViewStyle = bvsButtonsOnly;// (ABounds.Right <> MaxInt) and (Properties.ButtonsViewStyle <> bvsNormal); + Bounds := ABounds; + + AViewInfo.Painter := Style.LookAndFeel.SkinPainter; + AViewInfo.Bounds := Bounds; + AViewInfo.Enabled := Enabled; + AViewInfo.Focused := Focused; + AViewInfo.HasBackground := (Edit <> nil) and Edit.HasBackground; + AViewInfo.HasInnerEdit := (InnerEdit <> nil) and (InnerEdit.Control.Visible); + AViewInfo.IsDBEditPaintCopyDrawing := (Edit <> nil) and Edit.IsDBEditPaintCopyDrawing; + AViewInfo.IsContainerInnerControl := (Edit <> nil) and + Supports(TObject(Edit), IcxContainerInnerControl, AIContainerInnerControl); + AViewInfo.IsDesigning := IsDesigning; + AViewInfo.IsInplace := IsInplace; + AViewInfo.IsSelected := IsSelected; + AViewInfo.PaintOptions := GetPaintOptions; + AViewInfo.Edges := Style.Edges; + + if Style.DirectAccessMode then + AViewInfo.Font := Style.Font + else + AViewInfo.Font := Style.GetVisibleFont; + + AViewInfo.Shadow := not IsInplace and HasShadow; + AViewInfo.WindowHandle := WindowHandle; + + CalculateViewInfo(AViewInfo, AIsMouseEvent); + + CalculateButtonsViewInfo(ACanvas, ABounds, P, Button, Shift, AViewInfo, AIsMouseEvent); + + AViewInfo.ClientRect := ABounds; + AClientExtent := GetClientExtent(ACanvas, AViewInfo); + ExtendRect(AViewInfo.ClientRect, AClientExtent); + if InnerEdit <> nil then + AViewInfo.InnerEditRect := InnerEdit.Control.BoundsRect + else + AViewInfo.InnerEditRect := AViewInfo.ClientRect; + + CalculatePopupBorderStyle; +end; + +procedure TcxCustomEditViewData.CalculateButtonBounds(ACanvas: TcxCanvas; + AViewInfo: TcxCustomEditViewInfo; AButtonVisibleIndex: Integer; + var ButtonsRect: TRect); +var + AButtonVisibleWidth, AButtonWidth: Integer; +begin + with AViewInfo.ButtonsInfo[AButtonVisibleIndex] do + begin + if IsRectEmpty(ButtonsRect) then + begin + Bounds := cxEmptyRect; + VisibleBounds := Bounds; + end else + begin + Bounds.Top := ButtonsRect.Top; + Bounds.Bottom := ButtonsRect.Bottom; + AButtonWidth := CalculateEditDefaultButtonWidth(ACanvas, AViewInfo.ButtonsInfo[AButtonVisibleIndex]); + if AButtonWidth > ButtonsRect.Right - ButtonsRect.Left then + AButtonVisibleWidth := ButtonsRect.Right - ButtonsRect.Left + else + AButtonVisibleWidth := AButtonWidth; + if Data.LeftAlignment then + begin + Bounds.Left := ButtonsRect.Left; + Bounds.Right := Bounds.Left + AButtonWidth; + VisibleBounds := Bounds; + VisibleBounds.Right := VisibleBounds.Left + AButtonVisibleWidth; + Inc(ButtonsRect.Left, AButtonVisibleWidth); + if FLeftSideLeftmostButtonIndex = -1 then + FLeftSideLeftmostButtonIndex := AButtonVisibleIndex; + FLeftSideRightmostButtonIndex := AButtonVisibleIndex; + end else + begin + Bounds.Right := ButtonsRect.Right; + Bounds.Left := Bounds.Right - AButtonWidth; + VisibleBounds := Bounds; + VisibleBounds.Left := VisibleBounds.Right - AButtonVisibleWidth; + Dec(ButtonsRect.Right, AButtonVisibleWidth); + if FRightSideRightmostButtonIndex = -1 then + FRightSideRightmostButtonIndex := AButtonVisibleIndex; + FRightSideLeftmostButtonIndex := AButtonVisibleIndex; + end; + end; + end; +end; + +procedure TcxCustomEditViewData.CalculateButtonsViewInfo(ACanvas: TcxCanvas; + const ABounds: TRect; const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); + + procedure CalculateButtonViewInfos(AButtonsStyle: TcxEditButtonStyle); + var + AButton: TcxEditButton; + AButtonIndex, AButtonVisibleIndex: Integer; + AButtonsRect, APrevButtonsRect: TRect; + AButtonViewInfo: TcxEditButtonViewInfo; + begin + AButtonsRect := ABounds; + if IsInplace or not (AViewInfo.NativeStyle and AViewInfo.ButtonsInfo[0].Data.ComboBoxStyle and IsCompositionEnabled) then + ExtendRect(AButtonsRect, GetButtonsExtent(ACanvas)); + APrevButtonsRect := AButtonsRect; + + AButtonVisibleIndex := Properties.Buttons.VisibleCount - 1; + AViewInfo.HasTextButtons := False; + for AButtonIndex := Properties.Buttons.Count - 1 downto 0 do + begin + AButton := Properties.Buttons[AButtonIndex]; + if AButton.Visible then + begin + if (AButton.Kind = bkText) and not AViewInfo.HasTextButtons then + begin + AViewInfo.HasTextButtons := True; + ACanvas.Font := Style.GetVisibleFont; + AViewInfo.PrepareCanvasFont(ACanvas.Canvas); + end; + + AButtonViewInfo := AViewInfo.ButtonsInfo[AButtonVisibleIndex]; + AButtonViewInfo.Index := AButtonIndex; + AButtonViewInfo.Data.Style := AButtonsStyle; + CalculateButtonViewInfo(ACanvas, AViewInfo, AButtonVisibleIndex, AButtonsRect); + Dec(AButtonVisibleIndex); + end; + end; + + CheckButtonsOnly(AViewInfo, APrevButtonsRect.Right - APrevButtonsRect.Left, + AButtonsRect.Right - AButtonsRect.Left); + end; + + procedure CalculateButtonStates(APrevPressedButton: Integer); + var + AButtonViewInfo: TcxEditButtonViewInfo; + AButtonVisibleIndex: Integer; + ACapturePressing: Boolean; + AHoldPressing: Boolean; + AIsButtonPressed: Boolean; + AMouseButtonPressing: Boolean; + begin + for AButtonVisibleIndex := 0 to High(AViewInfo.ButtonsInfo) do + begin + AIsButtonPressed := IsButtonPressed(AViewInfo, AButtonVisibleIndex); + AButtonViewInfo := AViewInfo.ButtonsInfo[AButtonVisibleIndex]; + with AButtonViewInfo do + begin + if not Enabled or not Properties.Buttons[Index].Enabled then + Data.State := ebsDisabled + else + if AIsButtonPressed or (not IsDesigning and PtInRect(VisibleBounds, P)) then + begin + ACapturePressing := (Button = cxmbNone) and (ssLeft in Shift) and + (Data.State = ebsNormal) and (GetCaptureButtonVisibleIndex = + AButtonVisibleIndex); + AMouseButtonPressing := (Button = cxmbLeft) and + ((Shift = [ssLeft]) or (Shift = [ssLeft, ssDouble])); + AHoldPressing := (Data.State = ebsPressed) and (Shift * [ssLeft] <> []); + if AIsButtonPressed or AMouseButtonPressing or AHoldPressing or + ACapturePressing then + AViewInfo.IsButtonReallyPressed := True; + if not AIsButtonPressed and (Shift = []) and not ACapturePressing then + begin + Data.State := ebsSelected; + AViewInfo.SelectedButton := AButtonVisibleIndex; + end + else + if (AIsButtonPressed or ACapturePressing and CanPressButton(AViewInfo, AButtonVisibleIndex) or ((Shift = [ssLeft]) or (Shift = [ssLeft, ssDouble])) and + ((Button = cxmbLeft) and CanPressButton(AViewInfo, AButtonVisibleIndex) or + (APrevPressedButton = AButtonVisibleIndex))) or AHoldPressing then + begin + Data.State := ebsPressed; + AViewInfo.PressedButton := AButtonVisibleIndex; + end + else + Data.State := ebsNormal; + end + else + Data.State := ebsNormal; + DoGetButtonState(AViewInfo, AButtonVisibleIndex, Data.State); + CalculateButtonNativeInfo(AViewInfo.ButtonsInfo[AButtonVisibleIndex]); + end; + end; + end; + + procedure CorrectButtonBounds; + var + AButtonsRect: TRect; + I: Integer; + begin + AButtonsRect := ABounds; + ExtendRect(AButtonsRect, GetButtonsExtent(ACanvas)); + if FLeftSideLeftmostButtonIndex <> -1 then + AViewInfo.ButtonsInfo[FLeftSideLeftmostButtonIndex].Data.Leftmost := True; + if (FLeftSideRightmostButtonIndex <> -1) and (not ButtonsOnlyStyle or (FRightSideLeftmostButtonIndex = -1)) then + AViewInfo.ButtonsInfo[FLeftSideRightmostButtonIndex].Data.Rightmost := True; + if (FRightSideLeftmostButtonIndex <> -1) and (not ButtonsOnlyStyle or (FLeftSideRightmostButtonIndex = -1)) then + AViewInfo.ButtonsInfo[FRightSideLeftmostButtonIndex].Data.Leftmost := True; + if FRightSideRightmostButtonIndex <> -1 then + AViewInfo.ButtonsInfo[FRightSideRightmostButtonIndex].Data.Rightmost := True; + if ButtonsOnlyStyle then + for I := 0 to High(AViewInfo.ButtonsInfo) do + AViewInfo.ButtonsInfo[I].Data.LeftAlignment := False; + end; + +var + APrevPressedButton: Integer; +begin + if ButtonVisibleCount = 0 then + begin + AViewInfo.SetButtonCount(ButtonVisibleCount); + Exit; + end; + if not(csActive in ContainerState) then + if (Style.ButtonTransparency = ebtHideInactive) or + (not(csHotTrack in ContainerState) and (Style.ButtonTransparency = ebtHideUnselected)) then + begin + AViewInfo.SetButtonCount(0); + Exit; + end; + AViewInfo.SetButtonCount(ButtonVisibleCount); + AViewInfo.IsButtonReallyPressed := False; + if AIsMouseEvent then + APrevPressedButton := AViewInfo.PressedButton + else + APrevPressedButton := -1; + AViewInfo.PressedButton := -1; + AViewInfo.SelectedButton := -1; + + FLeftSideLeftmostButtonIndex := -1; + FLeftSideRightmostButtonIndex := -1; + FRightSideLeftmostButtonIndex := -1; + FRightSideRightmostButtonIndex := -1; + + CalculateButtonViewInfos(GetButtonsStyle); + CalculateButtonStates(APrevPressedButton); + CorrectButtonBounds; +end; + +procedure TcxCustomEditViewData.CalculateButtonViewInfo(ACanvas: TcxCanvas; + AViewInfo: TcxCustomEditViewInfo; AButtonVisibleIndex: Integer; var ButtonsRect: TRect); + + function GetButtonWidth(AButton: TcxEditButton): Integer; + begin + Result := AButton.Width; + if Result = 0 then + Result := DoGetDefaultButtonWidth(AButton.Index); + end; + +var + AButton: TcxEditButton; +begin + with AViewInfo.ButtonsInfo[AButtonVisibleIndex] do + begin + AButton := Properties.Buttons[Index]; + Data.ComboBoxStyle := (Length(AViewInfo.ButtonsInfo) = 1) and + (AButton.Kind = bkDown); + Data.Kind := AButton.Kind; + if Data.Kind = bkText then + begin + Data.Caption := AButton.Caption; + if AViewInfo.Painter <> nil then + Data.TextColor := AViewInfo.Painter.EditButtonTextColor + else + Data.TextColor := AButton.TextColor; + Data.VisibleCaption := AButton.FVisibleCaption; + end; + Data.ContentAlignment := AButton.ContentAlignment; + Data.Default := AButton.Default; + Glyph := AButton.Glyph; + HasBackground := AViewInfo.HasBackground; + Data.Gradient := Self.Style.GradientButtons; + Data.IsInplace := Self.IsInplace; + Data.LeftAlignment := AButton.LeftAlignment; + Data.Leftmost := False; + Data.Rightmost := False; + Data.NativeStyle := AViewInfo.NativeStyle; + Stretchable := AButton.Stretchable; + Width := GetButtonWidth(AButton); + Data.Transparent := (Self.Style.ButtonTransparency = ebtAlways) or + ((Self.Style.ButtonTransparency = ebtInactive) and not Selected); + Data.BackgroundColor := AViewInfo.BackgroundColor; + CalculateButtonBounds(ACanvas, AViewInfo, AButtonVisibleIndex, ButtonsRect); + end; +end; + +procedure TcxCustomEditViewData.CalculateEx(ACanvas: TcxCanvas; const ABounds: TRect; + const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); +var + ANewBounds: TRect; + ANewP: TPoint; +begin + AViewInfo.Left := ABounds.Left; + AViewInfo.Top := ABounds.Top; + ANewBounds := ABounds; + OffsetRect(ANewBounds, -ABounds.Left, -ABounds.Top); + ANewP := Point(P.X - ABounds.Left, P.Y - ABounds.Top); + Calculate(ACanvas, ANewBounds, ANewP, Button, Shift, AViewInfo, AIsMouseEvent); +end; + +procedure TcxCustomEditViewData.CheckButtonsOnly( + AViewInfo: TcxCustomEditViewInfo; APrevButtonsWidth, AButtonsWidth: Integer); +var + AVisibleButtonCount: Integer; + + procedure FindStretchableButtons(out AStretchableButtonCount, + AStretchableButtonsTotalWidth: Integer; out AAllButtonsAreStretchable: Boolean); + var + I: Integer; + begin + AStretchableButtonCount := 0; + AStretchableButtonsTotalWidth := 0; + for I := 0 to AVisibleButtonCount - 1 do + with AViewInfo.ButtonsInfo[I] do + if Stretchable and not IgnoreButtonWhileStretching(I) then + begin + Inc(AStretchableButtonCount); + Inc(AStretchableButtonsTotalWidth, Bounds.Right - Bounds.Left); + end; + AAllButtonsAreStretchable := AStretchableButtonCount = 0; + if AAllButtonsAreStretchable then + begin + AStretchableButtonCount := AVisibleButtonCount; + AStretchableButtonsTotalWidth := APrevButtonsWidth - AButtonsWidth; + end; + end; + + procedure StretchButton(AButtonVisibleIndex: Integer; + AButtonViewInfo: TcxEditButtonViewInfo; AButtonWidthCorrection: Integer); + var + J: Integer; + begin + if AButtonViewInfo.Data.LeftAlignment then + begin + for J := 0 to High(AViewInfo.ButtonsInfo) do + with AViewInfo.ButtonsInfo[J] do + if Data.LeftAlignment and (Bounds.Left >= AButtonViewInfo.Bounds.Right) then + begin + Inc(Bounds.Left, AButtonWidthCorrection); + Inc(Bounds.Right, AButtonWidthCorrection); + VisibleBounds := Bounds; + end; + with AButtonViewInfo do + begin + Inc(Bounds.Right, AButtonWidthCorrection); + VisibleBounds.Right := Bounds.Right; + end; + end + else + begin + for J := 0 to High(AViewInfo.ButtonsInfo) do + with AViewInfo.ButtonsInfo[J] do + if not Data.LeftAlignment and (Bounds.Right <= AButtonViewInfo.Bounds.Left) then + begin + Dec(Bounds.Left, AButtonWidthCorrection); + Dec(Bounds.Right, AButtonWidthCorrection); + VisibleBounds := Bounds; + end; + with AButtonViewInfo do + begin + Dec(Bounds.Left, AButtonWidthCorrection); + VisibleBounds.Left := Bounds.Left; + end; + end; + end; + +var + AAllButtonsAreStretchable: Boolean; + AButtonViewInfo: TcxEditButtonViewInfo; + AFirstStretchableButtonWidthCorrection, AButtonWidthCorrection: Integer; + AStretchableButtonCount, AStretchableButtonsTotalWidth: Integer; + I: Integer; +begin + if not ButtonsOnlyStyle or (AButtonsWidth <= 0) then + Exit; + AVisibleButtonCount := Length(AViewInfo.ButtonsInfo); + FindStretchableButtons(AStretchableButtonCount, AStretchableButtonsTotalWidth, + AAllButtonsAreStretchable); + AFirstStretchableButtonWidthCorrection := AButtonsWidth; + for I := AVisibleButtonCount - 1 downto 0 do + begin + AButtonViewInfo := AViewInfo.ButtonsInfo[I]; + if not AAllButtonsAreStretchable and (not AButtonViewInfo.Stretchable or IgnoreButtonWhileStretching(I)) then + Continue; + Dec(AStretchableButtonCount); + if AStretchableButtonCount = 0 then + AButtonWidthCorrection := AFirstStretchableButtonWidthCorrection + else + begin + with AButtonViewInfo.Bounds do + AButtonWidthCorrection := AButtonsWidth * (Right - Left) div AStretchableButtonsTotalWidth; + Dec(AFirstStretchableButtonWidthCorrection, AButtonWidthCorrection); + end; + StretchButton(I, AButtonViewInfo, AButtonWidthCorrection); + end; +end; + +procedure TcxCustomEditViewData.EditValueToDrawValue(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; AViewInfo: TcxCustomEditViewInfo); +begin +end; + +function TcxCustomEditViewData.GetBorderColor: TColor; +var + AIsHighlightBorder: Boolean; +begin + AIsHighlightBorder := (csActive in ContainerState) or + (csHotTrack in ContainerState) and Style.HotTrack; + if Style.LookAndFeel.SkinPainter <> nil then + Result := Style.LookAndFeel.SkinPainter.GetContainerBorderColor(AIsHighlightBorder) + else + if Style.BorderStyle in [ebsUltraFlat, ebsOffice11] then + begin + AIsHighlightBorder := AIsHighlightBorder or IsDesigning and Enabled; + if AIsHighlightBorder then + Result := GetEditBorderHighlightColor(Style.BorderStyle = ebsOffice11) + else + Result := clBtnShadow; + end + else + Result := Style.BorderColor; +end; + +function TcxCustomEditViewData.GetBorderExtent: TRect; +var + ABorderWidth: Integer; + ANativeStyle: Boolean; + AStyle: TcxCustomEditStyle; +begin + if IsInplace then + Result := ContentOffset + else + begin + AStyle := Style; + ANativeStyle := IsNativeStyle(AStyle.LookAndFeel); + if AStyle.TransparentBorder and (Style.LookAndFeel.SkinPainter = nil) then + Result := cxContainerDefaultBorderExtent + else + if not AStyle.HasBorder or ANativeStyle and (AStyle.BaseStyle.BorderStyle = ebsNone) then + Result := cxEmptyRect + else + if ANativeStyle then + Result := cxContainerDefaultBorderExtent + else + begin + if AStyle.LookAndFeel.SkinPainter = nil then + ABorderWidth := GetContainerBorderWidth(TcxContainerBorderStyle(GetBorderStyle)) + else + ABorderWidth := 1; + Result := cxEmptyRect; + if bLeft in AStyle.Edges then + Result.Left := ABorderWidth; + if bTop in AStyle.Edges then + Result.Top := ABorderWidth; + if bRight in AStyle.Edges then + Result.Right := ABorderWidth; + if bBottom in AStyle.Edges then + Result.Bottom := ABorderWidth; + end; + if HasShadow then + begin + Inc(Result.Right, cxEditShadowWidth); + Inc(Result.Bottom, cxEditShadowWidth); + end; + end; +end; + +function TcxCustomEditViewData.GetBorderStyle: TcxEditBorderStyle; +begin + if IsInplace then + Result := ebsNone + else + begin + Result := Style.BorderStyle; + CorrectBorderStyle(Result); + end; +end; + +function TcxCustomEditViewData.GetButtonsExtent(ACanvas: TcxCanvas): TRect; +var + ATheme: TdxTheme; + R, CR: TRect; +begin + if IsInplace then + Result := ContentOffset + else + if NativeStyle then + begin + if not Style.TransparentBorder and (Style.BaseStyle.BorderStyle = ebsNone) then + Result := cxEmptyRect + else + if (Style.BaseStyle.BorderStyle = ebsNone) then + Result := cxContainerDefaultBorderExtent + else + begin + R := Rect(0, 0, 100, 100); + ATheme := OpenTheme(totEdit); + GetThemeBackgroundContentRect(ATheme, ACanvas.Handle, EP_EDITTEXT, + ETS_NORMAL, R, CR); + Result := CR; + Result.Right := R.Right - CR.Right; + Result.Bottom := R.Bottom - CR.Bottom; + end; + end + else + Result := GetBorderExtent; +end; + +function TcxCustomEditViewData.GetClientExtent(ACanvas: TcxCanvas; + AViewInfo: TcxCustomEditViewInfo): TRect; +var + I: Integer; +begin + Result := GetBorderExtent; + if (Properties.ButtonsViewStyle <> bvsNormal) and (Length(AViewInfo.ButtonsInfo) > 0) then + with GetButtonsExtent(ACanvas) do + begin + Result.Left := Left; + Result.Right := Right; + end; + + if HScrollBar <> nil then + Inc(Result.Bottom, HScrollBar.Height); + if VScrollBar <> nil then + Inc(Result.Right, VScrollBar.Width); + + for I := 0 to Length(AViewInfo.ButtonsInfo) - 1 do + with AViewInfo.ButtonsInfo[I] do + if Data.LeftAlignment then + begin + if Bounds.Right - AViewInfo.Bounds.Left > Result.Left then + Result.Left := Bounds.Right - AViewInfo.Bounds.Left + end else + begin + if AViewInfo.Bounds.Right - Bounds.Left > Result.Right then + Result.Right := AViewInfo.Bounds.Right - Bounds.Left; + end; +end; + +function TcxCustomEditViewData.GetEditConstantPartSize(ACanvas: TcxCanvas; + const AEditSizeProperties: TcxEditSizeProperties; var MinContentSize: TSize; + AViewInfo: TcxCustomEditViewInfo = nil): TSize; +var + ATempViewInfo: TcxCustomEditViewInfo; +begin + if AViewInfo = nil then + ATempViewInfo := TcxCustomEditViewInfo(Properties.GetViewInfoClass.Create) + else + ATempViewInfo := AViewInfo; + try + if AViewInfo = nil then + Calculate(ACanvas, Rect(0, 0, MaxInt, MaxInt), Point(-1, -1), cxmbNone, + [], ATempViewInfo, False); + Result := InternalGetEditConstantPartSize(ACanvas, IsInplace, + AEditSizeProperties, MinContentSize, ATempViewInfo); + finally + if AViewInfo = nil then + FreeAndNil(ATempViewInfo); + end; +end; + +function TcxCustomEditViewData.GetEditContentSize(ACanvas: TcxCanvas; const AEditValue: + TcxEditValue; const AEditSizeProperties: TcxEditSizeProperties): TSize; +begin + if Properties.ButtonsViewStyle <> bvsNormal then + begin + Result.cx := 0; + ACanvas.Font := Style.GetVisibleFont; + Result.cy := ACanvas.TextHeight('Zg') + Self.GetEditContentSizeCorrection.cy; + end + else + Result := InternalGetEditContentSize(ACanvas, AEditValue, AEditSizeProperties); +end; + +function TcxCustomEditViewData.GetEditContentSizeCorrection: TSize; +begin + with EditContentParams do + begin + Result.cx := Offsets.Left + Offsets.Right + SizeCorrection.cx; + Result.cy := Offsets.Top + Offsets.Bottom + SizeCorrection.cy; + end; +end; + +function TcxCustomEditViewData.GetEditSize(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; AEditSizeProperties: TcxEditSizeProperties; + AViewInfo: TcxCustomEditViewInfo = nil): TSize; +var + AContentSize, AMinContentSize: TSize; + ATooNarrowEdit: Boolean; + APrevWidth: Integer; +begin + Result := GetEditConstantPartSize(ACanvas, AEditSizeProperties, + AMinContentSize, AViewInfo); + ATooNarrowEdit := False; + with AEditSizeProperties do + begin + APrevWidth := Width; + if Width >= 0 then + begin + Width := Width - Result.cx; + ATooNarrowEdit := Width < 0; + if ATooNarrowEdit then + Width := 0; + end; + end; + AContentSize := GetEditContentSize(ACanvas, AEditValue, AEditSizeProperties); + CheckSize(AContentSize, AMinContentSize); + if ATooNarrowEdit then + Result.cx := APrevWidth + else + Result.cx := Result.cx + AContentSize.cx; + Result.cy := Result.cy + AContentSize.cy; + if not IsInplace and (Edit <> nil) then + CheckSizeConstraints(Result); +end; + +function TcxCustomEditViewData.HasShadow: Boolean; +begin + Result := IsShadowDrawingNeeded(Self); +end; + +function TcxCustomEditViewData.IgnoreButtonWhileStretching( + AButtonVisibleIndex: Integer): Boolean; +begin + Result := False; +end; + +class function TcxCustomEditViewData.IsNativeStyle(ALookAndFeel: TcxLookAndFeel): Boolean; +begin + Result := AreVisualStylesMustBeUsed(ALookAndFeel.NativeStyle, totEdit); +end; + +procedure TcxCustomEditViewData.CalculateButtonNativeInfo(AButtonViewInfo: TcxEditButtonViewInfo); +const + ButtonStateA: array [Boolean, TcxEditButtonState] of Integer = ( + (PBS_DISABLED, PBS_NORMAL, PBS_PRESSED, PBS_HOT), + (CBXS_DISABLED, CBXS_NORMAL, CBXS_PRESSED, CBXS_HOT) + ); +var + ATheme: TdxTheme; +begin + ATheme := 0; + with AButtonViewInfo do + begin + Data.NativePart := TC_NONE; + if Data.NativeStyle then + begin + if Data.ComboBoxStyle then + ATheme := OpenTheme(totComboBox) + else + ATheme := OpenTheme(totButton); + if ATheme <> 0 then + if Data.ComboBoxStyle then + if IsCompositionEnabled and not IsInplace then + if Data.LeftAlignment then + Data.NativePart := CP_DROPDOWNBUTTONLEFT + else + Data.NativePart := CP_DROPDOWNBUTTONRIGHT + else + Data.NativePart := CP_DROPDOWNBUTTON + else + Data.NativePart := BP_PUSHBUTTON; + end; + + if Data.NativePart = TC_NONE then + begin + Data.BackgroundPartiallyTransparent := False; + Data.NativeState := TC_NONE; + end + else + begin + Data.BackgroundPartiallyTransparent := IsThemeBackgroundPartiallyTransparent(ATheme, + Data.NativePart, Data.NativeState); + Data.NativeState := ButtonStateA[Data.ComboBoxStyle, Data.State]; + end; + end; +end; + +procedure TcxCustomEditViewData.CalculateViewInfo(AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); +var + ABackgroundColor: TColor; +begin + AViewInfo.NativeStyle := NativeStyle; + if AViewInfo.NativeStyle then + AViewInfo.NativeState := GetEditNativeState(AViewInfo) + else + AViewInfo.NativeState := TC_NONE; + + AViewInfo.BorderExtent := GetBorderExtent; + AViewInfo.BorderRect := AViewInfo.Bounds; + ExtendRect(AViewInfo.BorderRect, AViewInfo.BorderExtent); + AViewInfo.ShadowRect := AViewInfo.BorderRect; + + AViewInfo.HasContentOffsets := + (Int64(ContentOffset.TopLeft) <> 0) or (Int64(ContentOffset.BottomRight) <> 0); + + if not IsInplace then + AViewInfo.BorderColor := GetBorderColor; + GetColorSettings(AViewInfo, ABackgroundColor, AViewInfo.TextColor); + AViewInfo.BackgroundColor := ABackgroundColor; +end; + +function TcxCustomEditViewData.CanPressButton(AViewInfo: TcxCustomEditViewInfo; + AButtonVisibleIndex: Integer): Boolean; +begin + Result := True; +end; + +procedure TcxCustomEditViewData.CheckSizeConstraints(var AEditSize: TSize); +begin + with Edit.Constraints do + begin + if (MaxHeight <> 0) and (AEditSize.cy > MaxHeight) then + AEditSize.cy := MaxHeight; + if (MinHeight <> 0) and (AEditSize.cy < MinHeight) then + AEditSize.cy := MinHeight; + if (MaxWidth <> 0) and (AEditSize.cx > MaxWidth) then + AEditSize.cx := MaxWidth; + if (MinWidth <> 0) and (AEditSize.cx < MinWidth) then + AEditSize.cx := MinWidth; + end; +end; + +procedure TcxCustomEditViewData.DoOnGetDisplayText(var AText: string); +begin + if Assigned(FOnGetDisplayText) then + FOnGetDisplayText(Self, AText); +end; + +procedure TcxCustomEditViewData.CorrectBorderStyle(var ABorderStyle: TcxEditBorderStyle); +begin + if ABorderStyle in [ebsUltraFlat, ebsOffice11] then + ABorderStyle := ebsSingle; +end; + +function TcxCustomEditViewData.EditValueToDisplayText(AEditValue: TcxEditValue): string; +begin + Result := InternalEditValueToDisplayText(AEditValue); + DoOnGetDisplayText(Result); +end; + +function TcxCustomEditViewData.GetButtonsStyle: TcxEditButtonStyle; + + function GetDefaultButtonStyle: TcxEditButtonStyle; + const + AButtonStyles: array[TcxEditBorderStyle] of TcxEditButtonStyle = + (btsSimple, btsHotFlat, bts3D, btsFlat, bts3D, btsUltraFlat, btsOffice11); + AInplaceButtonStyles: array[TcxLookAndFeelKind] of TcxEditButtonStyle = + (btsFlat, bts3D, btsUltraFlat, btsOffice11); + begin + if IsInplace or (Style.BorderStyle = ebsNone) and not Style.HotTrack then + Result := AInplaceButtonStyles[Style.LookAndFeel.Kind] + else + Result := AButtonStyles[Style.BorderStyle]; + end; + +begin + Result := Style.ButtonStyle; + if Result = btsDefault then + Result := GetDefaultButtonStyle; +end; + +function TcxCustomEditViewData.GetCaptureButtonVisibleIndex: Integer; +begin + Result := -1; + if Edit <> nil then + Result := Edit.FCaptureButtonVisibleIndex; +end; + +procedure TcxCustomEditViewData.GetColorSettings(AViewInfo: TcxCustomEditViewInfo; + var FillColor, TextColor: TColor); +const + ANativePart: array [Boolean] of Integer = (EP_EDITTEXT, EP_BACKGROUND); +var + AColor: COLORREF; +begin + AViewInfo.GetColorSettingsByPainter(FillColor, TextColor); + if TextColor = clDefault then + TextColor := Style.TextColor; + if (Edit <> nil) and Edit.DefaultParentColor then + FillColor := Style.Color + else + if FillColor = clDefault then + begin + if AViewInfo.NativeStyle and not Enabled and not Style.IsValueAssigned(svColor) then + // if AViewInfo.NativeStyle and (AViewInfo.NativeState in [ETS_DISABLED, ETS_READONLY]) and + // not Style.IsValueAssigned(svColor) then + begin + GetThemeColor(OpenTheme(totEdit), ANativePart[IsCompositionEnabled], + AViewInfo.NativeState, TMT_FILLCOLOR, AColor); + FillColor := AColor; + end + else + FillColor := Style.Color; + end; +end; + +function TcxCustomEditViewData.GetContainerState(const ABounds: TRect; + const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AIsMouseEvent: Boolean): TcxContainerState; + + function GetEditVisibleBounds: TRect; + begin + if Edit <> nil then + Result := Edit.GetVisibleBounds + else + begin + Result := ABounds; + ExtendRect(Result, ContentOffset); + end; + end; + +begin + if Enabled then + if IsDesigning then + Result := [csNormal] + else + begin + if Focused then + Result := [csActive] + else + Result := [csNormal]; + if PtInRect(GetEditVisibleBounds, P) and + ((Shift = []) or (Edit <> nil) and (GetCaptureControl = Edit)) then + Include(Result, csHotTrack); + end + else + Result := [csDisabled]; +end; + +function TcxCustomEditViewData.GetEditContentDefaultOffsets: TRect; +begin + Result := EditContentDefaultOffsets[IsInplace]; +end; + +procedure TcxCustomEditViewData.InitEditContentParams( + var AParams: TcxEditContentParams); +begin + AParams.Offsets := GetEditContentDefaultOffsets; + with AParams.Offsets do + AParams.SizeCorrection.cx := EditContentMaxTotalDefaultHorzOffset - (Left + Right); + if not NativeStyle then + AParams.SizeCorrection.cy := 0 + else + AParams.SizeCorrection.cy := + GetNativeInnerTextEditContentHeightCorrection(Properties, IsInplace); + AParams.ExternalBorderBounds := cxEmptyRect; + AParams.Options := [ecoOffsetButtonContent]; +end; + +function TcxCustomEditViewData.GetEditNativeState(AViewInfo: TcxCustomEditViewInfo): Integer; +begin + if not Enabled then + Result := ETS_DISABLED + else if Properties.ReadOnly then + Result := ETS_READONLY + else if Focused then + if IsCompositionEnabled then + Result := ETS_SELECTED + else + Result := ETS_FOCUSED + else if csHotTrack in ContainerState then + Result := ETS_HOT + else + Result := ETS_NORMAL; +end; + +procedure TcxCustomEditViewData.InitCacheData; +begin + ButtonVisibleCount := Properties.Buttons.VisibleCount; + IsValueSource := Properties.GetEditValueSource(False) = evsValue; + with Properties.Alignment do + begin + HorzAlignment := Horz; + VertAlignment := Vert; + end; + NativeStyle := IsNativeStyle(Style.LookAndFeel); + InitEditContentParams(EditContentParams); +end; + +procedure TcxCustomEditViewData.Initialize; +begin + ContentOffset := cxEmptyRect; + Enabled := True; +end; + +function TcxCustomEditViewData.InternalEditValueToDisplayText( + AEditValue: TcxEditValue): string; +begin + Result := ''; +end; + +function TcxCustomEditViewData.InternalFocused: Boolean; +begin + if Edit <> nil then + Result := Edit.InternalFocused + else + Result := Focused; +end; + +function TcxCustomEditViewData.InternalGetEditConstantPartSize(ACanvas: TcxCanvas; + AIsInplace: Boolean; AEditSizeProperties: TcxEditSizeProperties; + var MinContentSize: TSize; AViewInfo: TcxCustomEditViewInfo): TSize; +var + AButton: TcxEditButton; + AButtonCaptionHeight, AMaxButtonContentHeight, I: Integer; +begin + MinContentSize := cxNullSize; + with AViewInfo.ClientRect do + begin + Result.cx := Left - AViewInfo.Bounds.Left + (AViewInfo.Bounds.Right - Right); + Result.cy := Top - AViewInfo.Bounds.Top + (AViewInfo.Bounds.Bottom - Bottom); + end; + + AMaxButtonContentHeight := 0; + if IsInplace then + for I := 0 to Properties.Buttons.Count - 1 do + begin + AButton := Properties.Buttons[I]; + if AButton.Visible and (AButton.Kind = bkText) then + begin + ACanvas.Font := Style.GetVisibleFont; + AViewInfo.PrepareCanvasFont(ACanvas.Canvas); + Break; + end; + end; + for I := 0 to Properties.Buttons.Count - 1 do + begin + AButton := Properties.Buttons[I]; + if not AButton.Visible then + Continue; + if (AButton.Kind = bkGlyph) and VerifyBitmap(AButton.Glyph) then + if AButton.Glyph.Height > AMaxButtonContentHeight then + AMaxButtonContentHeight := AButton.Glyph.Height; + if IsInplace and (AButton.Kind = bkText) and (Length(AButton.VisibleCaption) > 0) then + begin + AButtonCaptionHeight := ACanvas.TextHeight(AButton.VisibleCaption); + if AButtonCaptionHeight > AMaxButtonContentHeight then + AMaxButtonContentHeight := AButtonCaptionHeight; + end; + end; + if AMaxButtonContentHeight > 0 then + begin + if Style.LookAndFeel.SkinPainter = nil then + with GetButtonsExtent(ACanvas) do + Inc(AMaxButtonContentHeight, Top + Bottom); + + Inc(AMaxButtonContentHeight, GetEditButtonsContentVerticalOffset(ACanvas, + GetButtonsStyle, AViewInfo.NativeStyle)); + MinContentSize.cy := AMaxButtonContentHeight - Result.cy; + if MinContentSize.cy < 0 then + MinContentSize.cy := 0; + end; +end; + +function TcxCustomEditViewData.InternalGetEditContentSize(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; const AEditSizeProperties: TcxEditSizeProperties): TSize; +begin + Result := cxNullSize; +end; + +function TcxCustomEditViewData.IsButtonPressed(AViewInfo: TcxCustomEditViewInfo; + AButtonVisibleIndex: Integer): Boolean; +begin + Result := False; +end; + +procedure TcxCustomEditViewData.DoGetButtonState(AViewInfo: TcxCustomEditViewInfo; + AButtonVisibleIndex: Integer; var AState: TcxEditButtonState); +begin + if Assigned(AViewInfo.FOnGetButtonState) then + AViewInfo.FOnGetButtonState(AViewInfo, AButtonVisibleIndex, AState); +end; + +function TcxCustomEditViewData.DoGetDefaultButtonWidth(AIndex: Integer): Integer; +begin + Result := 0; + if Assigned(FOnGetDefaultButtonWidth) then + FOnGetDefaultButtonWidth(Self, AIndex, Result); +end; + +function TcxCustomEditViewData.GetPaintOptions: TcxEditPaintOptions; +begin + Result := PaintOptions; + if not IsRectEmpty(EditContentParams.ExternalBorderBounds) then + Include(Result, epoHasExternalBorder); + if ecoShowFocusRectWhenInplace in EditContentParams.Options then + Include(Result, epoShowFocusRectWhenInplace); +end; + +function TcxCustomEditViewData.GetStyle: TcxCustomEditStyle; +begin + Result := TcxCustomEditStyle(FStyle); +end; + +procedure TcxCustomEditViewData.SetStyle(Value: TcxCustomEditStyle); +begin + FStyle := Value; +end; + +{ TcxEditStyleController } + +function TcxEditStyleController.GetStyleClass: TcxContainerStyleClass; +begin + Result := TcxEditStyle; +end; + +function TcxEditStyleController.GetInternalStyle(AState: TcxContainerStateItem): TcxCustomEditStyle; +begin + Result := TcxCustomEditStyle(FStyles[AState]); +end; + +function TcxEditStyleController.GetStyle: TcxEditStyle; +begin + Result := TcxEditStyle(FStyles[csNormal]); +end; + +function TcxEditStyleController.GetStyleDisabled: TcxEditStyle; +begin + Result := TcxEditStyle(FStyles[csDisabled]); +end; + +function TcxEditStyleController.GetStyleFocused: TcxEditStyle; +begin + Result := TcxEditStyle(FStyles[csActive]); +end; + +function TcxEditStyleController.GetStyleHot: TcxEditStyle; +begin + Result := TcxEditStyle(FStyles[csHotTrack]); +end; + +procedure TcxEditStyleController.SetInternalStyle(AState: TcxContainerStateItem; + Value: TcxCustomEditStyle); +begin + FStyles[AState] := Value; +end; + +procedure TcxEditStyleController.SetStyle(Value: TcxEditStyle); +begin + FStyles[csNormal] := Value; +end; + +procedure TcxEditStyleController.SetStyleDisabled(Value: TcxEditStyle); +begin + FStyles[csDisabled] := Value; +end; + +procedure TcxEditStyleController.SetStyleFocused(Value: TcxEditStyle); +begin + FStyles[csActive] := Value; +end; + +procedure TcxEditStyleController.SetStyleHot(Value: TcxEditStyle); +begin + FStyles[csHotTrack] := Value; +end; + +{ TcxCustomEditStyle } + +constructor TcxCustomEditStyle.Create(AOwner: TPersistent; + ADirectAccessMode: Boolean; AParentStyle: TcxContainerStyle = nil; + AState: TcxContainerStateItem = csNormal); +begin + inherited Create(AOwner, ADirectAccessMode, AParentStyle, AState); + FPopupCloseButton := True; +end; + +procedure TcxCustomEditStyle.Assign(Source: TPersistent); +begin + if Source is TcxCustomEditStyle then + begin + BeginUpdate; + try + with Source as TcxCustomEditStyle do + begin + Self.FButtonStyle := FButtonStyle; + Self.FButtonTransparency := FButtonTransparency; + Self.FGradient := FGradient; + Self.FGradientButtons := FGradientButtons; + Self.FGradientDirection := FGradientDirection; + Self.FPopupBorderStyle := FPopupBorderStyle; + Self.FPopupCloseButton := FPopupCloseButton; + end; + inherited Assign(Source); + finally + Changed; + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +function TcxCustomEditStyle.GetStyleValueCount: Integer; +begin + Result := cxEditStyleValueCount; +end; + +function TcxCustomEditStyle.GetStyleValueName(AStyleValue: TcxEditStyleValue; + out StyleValueName: string): Boolean; +begin + Result := inherited GetStyleValueName(AStyleValue, StyleValueName); + if not Result then + begin + Result := AStyleValue < cxEditStyleValueCount; + if Result then + StyleValueName := cxEditStyleValueNameA[AStyleValue - cxContainerStyleValueCount]; + end; +end; + +function TcxCustomEditStyle.IsValueAssigned(AValue: TcxEditStyleValue): Boolean; +var + AButtonStyle: TcxEditButtonStyle; + AButtonTransparency: TcxEditButtonTransparency; + AGradientDirection: TcxEditGradientDirection; + APopupBorderStyle: TcxEditPopupBorderStyle; + ATempBool: Boolean; +begin + case AValue of + svButtonStyle: + Result := InternalGetButtonStyle(AButtonStyle); + svButtonTransparency: + Result := InternalGetButtonTransparency(AButtonTransparency); + svGradient: + Result := InternalGetGradient(ATempBool); + svGradientButtons: + Result := InternalGetGradientButtons(ATempBool); + svGradientDirection: + Result := InternalGetGradientDirection(AGradientDirection); + svPopupBorderStyle: + Result := InternalGetPopupBorderStyle(APopupBorderStyle); + else + Result := inherited IsValueAssigned(AValue); + end; +end; + +procedure TcxCustomEditStyle.Init(AParams: TcxViewParams); +begin + BeginUpdate; + try + Color := AParams.Color; + Font := AParams.Font; + TextColor := AParams.TextColor; + finally + EndUpdate; + end; +end; + +function TcxCustomEditStyle.GetAssignedValues: TcxEditStyleValues; +begin + Result := TcxEditStyleValues(inherited AssignedValues); +end; + +function TcxCustomEditStyle.GetBaseStyle: TcxCustomEditStyle; +begin + Result := TcxCustomEditStyle(inherited BaseStyle); +end; + +function TcxCustomEditStyle.GetDefaultStyleController: TcxStyleController; +var + AEdit: TcxCustomEdit; +begin + Result := nil; + if not DirectAccessMode then + begin + AEdit := Edit; + if not((AEdit <> nil) and AEdit.IsInplace) then + Result := DefaultEditStyleController; + end; +end; + +function TcxCustomEditStyle.InternalGetNotPublishedExtendedStyleValues: TcxEditStyleValues; +begin + Result := [svButtonTransparency, svEdges, svFont, svGradient, + svGradientButtons, svGradientDirection, svHotTrack, svPopupBorderStyle, + svShadow, svTransparentBorder]; +end; + +function TcxCustomEditStyle.DefaultButtonStyle: TcxEditButtonStyle; +begin + if IsBaseStyle then + Result := btsDefault + else + Result := TcxCustomEditStyle(ParentStyle).ButtonStyle; +end; + +function TcxCustomEditStyle.DefaultButtonTransparency: TcxEditButtonTransparency; +begin + if IsBaseStyle then + Result := ebtNone + else + Result := TcxCustomEditStyle(ParentStyle).ButtonTransparency; +end; + +function TcxCustomEditStyle.DefaultGradient: Boolean; +begin + if IsBaseStyle then + Result := False + else + Result := TcxCustomEditStyle(ParentStyle).Gradient; +end; + +function TcxCustomEditStyle.DefaultGradientButtons: Boolean; +begin + if IsBaseStyle then + Result := False + else + Result := TcxCustomEditStyle(ParentStyle).GradientButtons; +end; + +function TcxCustomEditStyle.DefaultGradientDirection: TcxEditGradientDirection; +begin + if IsBaseStyle then + Result := dirDown + else + Result := TcxCustomEditStyle(ParentStyle).GradientDirection; +end; + +function TcxCustomEditStyle.DefaultPopupBorderStyle: TcxEditPopupBorderStyle; +begin + if IsBaseStyle then + Result := epbsDefault + else + Result := TcxCustomEditStyle(ParentStyle).PopupBorderStyle; +end; + +function TcxCustomEditStyle.GetActiveStyleController: TcxEditStyleController; +begin + Result := TcxEditStyleController(inherited ActiveStyleController); +end; + +function TcxCustomEditStyle.GetBorderStyle: TcxEditBorderStyle; +begin + Result := TcxEditBorderStyle(inherited BorderStyle); +end; + +function TcxCustomEditStyle.GetButtonStyle: TcxEditButtonStyle; +begin + if DirectAccessMode then + if svButtonStyle in FAssignedValues then + Result := FButtonStyle + else + Result := DefaultButtonStyle + else + if not InternalGetButtonStyle(Result) then + Result := DefaultButtonStyle; +end; + +function TcxCustomEditStyle.GetButtonTransparency: TcxEditButtonTransparency; +begin + if DirectAccessMode then + if svButtonTransparency in FAssignedValues then + Result := FButtonTransparency + else + Result := DefaultButtonTransparency + else + if not InternalGetButtonTransparency(Result) then + Result := DefaultButtonTransparency; +end; + +function TcxCustomEditStyle.GetEdit: TcxCustomEdit; +var + AOwner: TPersistent; +begin + AOwner := GetOwner; + if AOwner is TcxCustomEdit then + Result := TcxCustomEdit(AOwner) + else + Result := nil; +end; + +function TcxCustomEditStyle.GetGradient: Boolean; +begin + if DirectAccessMode then + if svGradient in FAssignedValues then + Result := FGradient + else + Result := DefaultGradient + else + if not InternalGetGradient(Result) then + Result := DefaultGradient; +end; + +function TcxCustomEditStyle.GetGradientButtons: Boolean; +begin + if DirectAccessMode then + if svGradientButtons in FAssignedValues then + Result := FGradientButtons + else + Result := DefaultGradientButtons + else + if not InternalGetGradientButtons(Result) then + Result := DefaultGradientButtons; +end; + +function TcxCustomEditStyle.GetGradientDirection: TcxEditGradientDirection; +begin + if DirectAccessMode then + if svGradientDirection in FAssignedValues then + Result := FGradientDirection + else + Result := DefaultGradientDirection + else + if not InternalGetGradientDirection(Result) then + Result := DefaultGradientDirection; +end; + +function TcxCustomEditStyle.GetPopupBorderStyle: TcxEditPopupBorderStyle; +begin + if DirectAccessMode then + if svPopupBorderStyle in FAssignedValues then + Result := FPopupBorderStyle + else + Result := DefaultPopupBorderStyle + else + if not InternalGetPopupBorderStyle(Result) then + Result := DefaultPopupBorderStyle; +end; + +function TcxCustomEditStyle.GetStyleController: TcxEditStyleController; +begin + Result := TcxEditStyleController(BaseGetStyleController); +end; + +function TcxCustomEditStyle.GetPopupCloseButton: Boolean; +begin + if IsBaseStyle then + Result := FPopupCloseButton + else + Result := TcxCustomEditStyle(ParentStyle).PopupCloseButton; +end; + +function TcxCustomEditStyle.InternalGetButtonStyle(var ButtonStyle: TcxEditButtonStyle): Boolean; +begin + Result := svButtonStyle in FAssignedValues; + if Result then + ButtonStyle := FButtonStyle + else + if ActiveStyleController <> nil then + Result := ActiveStyleController.Styles[TcxContainerStateItem(State)].InternalGetButtonStyle(ButtonStyle); +end; + +function TcxCustomEditStyle.InternalGetButtonTransparency(var ButtonTransparency: TcxEditButtonTransparency): Boolean; +begin + Result := svButtonTransparency in FAssignedValues; + if Result then + ButtonTransparency := FButtonTransparency + else + if ActiveStyleController <> nil then + Result := ActiveStyleController.Styles[TcxContainerStateItem(State)].InternalGetButtonTransparency(ButtonTransparency); +end; + +function TcxCustomEditStyle.InternalGetGradient(var Gradient: Boolean): Boolean; +begin + Result := svGradient in FAssignedValues; + if Result then + Gradient := FGradient + else + if ActiveStyleController <> nil then + Result := ActiveStyleController.Styles[TcxContainerStateItem(State)].InternalGetGradient(Gradient); +end; + +function TcxCustomEditStyle.InternalGetGradientButtons(var GradientButtons: Boolean): Boolean; +begin + Result := svGradientButtons in FAssignedValues; + if Result then + GradientButtons := FGradientButtons + else + if ActiveStyleController <> nil then + Result := ActiveStyleController.Styles[TcxContainerStateItem(State)].InternalGetGradientButtons(GradientButtons); +end; + +function TcxCustomEditStyle.InternalGetGradientDirection( + var GradientDirection: TcxEditGradientDirection): Boolean; +begin + Result := svGradientDirection in FAssignedValues; + if Result then + GradientDirection := FGradientDirection + else + if ActiveStyleController <> nil then + Result := ActiveStyleController.Styles[TcxContainerStateItem(State)].InternalGetGradientDirection(GradientDirection); +end; + +function TcxCustomEditStyle.InternalGetPopupBorderStyle(var PopupBorderStyle: + TcxEditPopupBorderStyle): Boolean; +begin + Result := svPopupBorderStyle in FAssignedValues; + if Result then + PopupBorderStyle := FPopupBorderStyle + else + if ActiveStyleController <> nil then + Result := ActiveStyleController.Styles[TcxContainerStateItem(State)].InternalGetPopupBorderStyle(PopupBorderStyle); +end; + +function TcxCustomEditStyle.IsBorderStyleStored: Boolean; +begin + Result := (svBorderStyle in FAssignedValues) and ((Edit = nil) or + Edit.IsStylePropertyPublished('BorderStyle', State <> csNormal)); +end; + +function TcxCustomEditStyle.IsButtonStyleStored: Boolean; +begin + Result := (svButtonStyle in FAssignedValues) and ((Edit = nil) or + Edit.IsStylePropertyPublished('ButtonStyle', State <> csNormal)); +end; + +function TcxCustomEditStyle.IsButtonTransparencyStored: Boolean; +begin + Result := (svButtonTransparency in FAssignedValues) and ((Edit = nil) or + Edit.IsStylePropertyPublished('ButtonTransparency', State <> csNormal)); +end; + +function TcxCustomEditStyle.IsGradientStored: Boolean; +begin + Result := (svGradient in FAssignedValues) and ((Edit = nil) or + Edit.IsStylePropertyPublished('Gradient', State <> csNormal)); +end; + +function TcxCustomEditStyle.IsGradientButtonsStored: Boolean; +begin + Result := (svGradientButtons in FAssignedValues) and ((Edit = nil) or + Edit.IsStylePropertyPublished('GradientButtons', State <> csNormal)); +end; + +function TcxCustomEditStyle.IsGradientDirectionStored: Boolean; +begin + Result := (svGradientDirection in FAssignedValues) and ((Edit = nil) or + Edit.IsStylePropertyPublished('GradientDirection', State <> csNormal)); +end; + +function TcxCustomEditStyle.IsPopupBorderStyleStored: Boolean; +begin + Result := (svPopupBorderStyle in FAssignedValues) and ((Edit = nil) or + Edit.IsStylePropertyPublished('PopupBorderStyle', State <> csNormal)); +end; + +function TcxCustomEditStyle.IsStyleControllerStored: Boolean; +begin + Result := State = csNormal; +end; + +procedure TcxCustomEditStyle.SetAssignedValues(Value: TcxEditStyleValues); +begin + inherited AssignedValues := Value; +end; + +procedure TcxCustomEditStyle.SetBorderStyle(Value: TcxEditBorderStyle); +begin + inherited BorderStyle := TcxContainerBorderStyle(Value); +end; + +procedure TcxCustomEditStyle.SetButtonStyle(Value: TcxEditButtonStyle); +begin + if (svButtonStyle in FAssignedValues) and (Value = FButtonStyle) then + Exit; + FButtonStyle := Value; + Include(FAssignedValues, svButtonStyle); + Changed; +end; + +procedure TcxCustomEditStyle.SetButtonTransparency(Value: TcxEditButtonTransparency); +begin + if IsBaseStyle then + begin + if (svButtonTransparency in FAssignedValues) and (Value = FButtonTransparency) then + Exit; + FButtonTransparency := Value; + Include(FAssignedValues, svButtonTransparency); + Changed; + end + else + TcxCustomEditStyle(ParentStyle).ButtonTransparency := Value; +end; + +procedure TcxCustomEditStyle.SetGradient(Value: Boolean); +begin + if IsBaseStyle then + begin + if (svGradient in FAssignedValues) and (Value = FGradient) then + Exit; + FGradient := Value; + Include(FAssignedValues, svGradient); + Changed; + end + else + TcxCustomEditStyle(ParentStyle).Gradient := Value; +end; + +procedure TcxCustomEditStyle.SetGradientButtons(Value: Boolean); +begin + if IsBaseStyle then + begin + if (svGradientButtons in FAssignedValues) and (Value = FGradientButtons) then + Exit; + FGradientButtons := Value; + Include(FAssignedValues, svGradientButtons); + Changed; + end + else + TcxCustomEditStyle(ParentStyle).GradientButtons := Value; +end; + +procedure TcxCustomEditStyle.SetGradientDirection(Value: TcxEditGradientDirection); +begin + if IsBaseStyle then + begin + if (svGradientDirection in FAssignedValues) and (Value = FGradientDirection) then + Exit; + FGradientDirection := Value; + Include(FAssignedValues, svGradientDirection); + Changed; + end + else + TcxCustomEditStyle(ParentStyle).GradientDirection := Value; +end; + +procedure TcxCustomEditStyle.SetPopupBorderStyle(Value: TcxEditPopupBorderStyle); +begin + if IsBaseStyle then + begin + if (svPopupBorderStyle in FAssignedValues) and (Value = FPopupBorderStyle) then + Exit; + FPopupBorderStyle := Value; + Include(FAssignedValues, svPopupBorderStyle); + Changed; + end + else + TcxCustomEditStyle(ParentStyle).PopupBorderStyle := Value; +end; + +procedure TcxCustomEditStyle.SetPopupCloseButton(Value: Boolean); +begin + if IsBaseStyle then + begin + if Value <> FPopupCloseButton then + begin + FPopupCloseButton := Value; + Changed; + end; + end + else + TcxCustomEditStyle(ParentStyle).PopupCloseButton := Value; +end; + +procedure TcxCustomEditStyle.SetStyleController(Value: TcxEditStyleController); +begin + BaseSetStyleController(Value); +end; + +{ TcxCustomEditPropertiesValues } + +constructor TcxCustomEditPropertiesValues.Create(AOwner: TPersistent); +begin + inherited Create; + FOwner := AOwner; +end; + +procedure TcxCustomEditPropertiesValues.Assign(Source: TPersistent); +begin + if Source is TcxCustomEditPropertiesValues then + begin + BeginUpdate; + try + with Source as TcxCustomEditPropertiesValues do + begin + Self.MaxValue := MaxValue; + Self.MinValue := MinValue; + Self.ReadOnly := ReadOnly; + end; + finally + EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxCustomEditPropertiesValues.BeginUpdate; +begin + Properties.BeginUpdate; +end; + +procedure TcxCustomEditPropertiesValues.EndUpdate; +begin + Properties.EndUpdate; +end; + +procedure TcxCustomEditPropertiesValues.RestoreDefaults; +begin + BeginUpdate; + try + MaxValue := False; + MinValue := False; + ReadOnly := False; + finally + EndUpdate; + end; +end; + +function TcxCustomEditPropertiesValues.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +procedure TcxCustomEditPropertiesValues.Changed; +begin + Properties.Changed; +end; + +function TcxCustomEditPropertiesValues.IsMaxValueStored: Boolean; +begin + Result := MaxValue and + (TcxCustomEditProperties(Properties).MaxValue = 0{TcxCustomEditProperties(Properties).GetDefaultMaxValue}) and + IsPropertiesPropertyVisible('MaxValue'); +end; + +function TcxCustomEditPropertiesValues.IsMinValueStored: Boolean; +begin + Result := MinValue and + (TcxCustomEditProperties(Properties).MinValue = 0{TcxCustomEditProperties(Properties).GetDefaultMinValue}) and + IsPropertiesPropertyVisible('MinValue'); +end; + +function TcxCustomEditPropertiesValues.IsPropertiesPropertyVisible( + const APropertyName: string): Boolean; +begin + Result := TypInfo.GetPropInfo(Properties, APropertyName) <> nil; +end; + +function TcxCustomEditPropertiesValues.GetProperties: TcxCustomEditProperties; +begin + Result := TcxCustomEditProperties(FOwner); +end; + +procedure TcxCustomEditPropertiesValues.SetMaxValue(Value: Boolean); +begin + if Value <> FMaxValue then + begin + FMaxValue := Value; + Changed; + end; +end; + +procedure TcxCustomEditPropertiesValues.SetMinValue(Value: Boolean); +begin + if Value <> FMinValue then + begin + FMinValue := Value; + Changed; + end; +end; + +procedure TcxCustomEditPropertiesValues.SetReadOnly(Value: Boolean); +begin + if Value <> FReadOnly then + begin + FReadOnly := Value; + Changed; + end; +end; + +{ TcxCustomEditDefaultValuesProvider } + +destructor TcxCustomEditDefaultValuesProvider.Destroy; +begin + ClearUsers; + inherited Destroy; +end; + +function TcxCustomEditDefaultValuesProvider.CanSetEditMode: Boolean; +begin + Result := True; +end; + +procedure TcxCustomEditDefaultValuesProvider.ClearUsers; +var + I: Integer; +begin + if FCreatedEditPropertiesList <> nil then + for I := 0 to FCreatedEditPropertiesList.Count - 1 do + with TcxCustomEditProperties(FCreatedEditPropertiesList[I]) do + if (IDefaultValuesProvider <> nil) and (IDefaultValuesProvider.GetInstance = Self) then + DefaultValuesProviderDestroyed; +end; + +function TcxCustomEditDefaultValuesProvider.DefaultAlignment: TAlignment; +begin + Result := cxEditDefaultHorzAlignment; +end; + +function TcxCustomEditDefaultValuesProvider.DefaultBlobKind: TcxBlobKind; +begin + Result := bkMemo; +end; + +function TcxCustomEditDefaultValuesProvider.DefaultCanModify: Boolean; +begin + Result := True; +end; + +function TcxCustomEditDefaultValuesProvider.DefaultDisplayFormat: string; +begin + Result := ''; +end; + +function TcxCustomEditDefaultValuesProvider.DefaultEditFormat: string; +begin + Result := ''; +end; + +function TcxCustomEditDefaultValuesProvider.DefaultEditMask: string; +begin + Result := ''; +end; + +function TcxCustomEditDefaultValuesProvider.DefaultIsFloatValue: Boolean; +begin + Result := False; +end; + +function TcxCustomEditDefaultValuesProvider.DefaultMaxLength: Integer; +begin + Result := 0; +end; + +function TcxCustomEditDefaultValuesProvider.DefaultMaxValue: Double; +begin + Result := 0; +end; + +function TcxCustomEditDefaultValuesProvider.DefaultMinValue: Double; +begin + Result := 0; +end; + +function TcxCustomEditDefaultValuesProvider.DefaultPrecision: Integer; +begin + Result := cxEditDefaultPrecision; +end; + +function TcxCustomEditDefaultValuesProvider.DefaultReadOnly: Boolean; +begin + Result := False; +end; + +function TcxCustomEditDefaultValuesProvider.DefaultRequired: Boolean; +begin + Result := False; +end; + +function TcxCustomEditDefaultValuesProvider.GetInstance: TObject; +begin + Result := Self; +end; + +function TcxCustomEditDefaultValuesProvider.IsBlob: Boolean; +begin + Result := False; +end; + +function TcxCustomEditDefaultValuesProvider.IsCurrency: Boolean; +begin + Result := False; +end; + +function TcxCustomEditDefaultValuesProvider.IsDataAvailable: Boolean; +begin + Result := True; +end; + +function TcxCustomEditDefaultValuesProvider.IsDataStorage: Boolean; +begin + Result := False; +end; + +function TcxCustomEditDefaultValuesProvider.IsDisplayFormatDefined( + AIsCurrencyValueAccepted: Boolean): Boolean; +begin + Result := False; +end; + +function TcxCustomEditDefaultValuesProvider.IsOnGetTextAssigned: Boolean; +begin + Result := False; +end; + +function TcxCustomEditDefaultValuesProvider.IsOnSetTextAssigned: Boolean; +begin + Result := False; +end; + +function TcxCustomEditDefaultValuesProvider.IsValidChar(AChar: Char): Boolean; +begin + Result := True; +end; + +{ TcxCustomEditProperties } + +constructor TcxCustomEditProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FCreatedEditPropertiesList.Add(Self); + FOwner := AOwner; + FFreeNotificator := TcxFreeNotificator.Create(nil); + FFreeNotificator.OnFreeNotification := FreeNotification; + FAlignment := TcxEditAlignment.Create(Self); + FAlignment.OnChanged := AlignmentChangedHandler; + FAssignedValues := GetAssignedValuesClass.Create(Self); + FAutoSelect := True; + FButtons := GetButtonsClass.Create(Self, GetButtonsClass.GetButtonClass); + FButtons.OnChange := ButtonsChanged; + FButtonsViewStyle := bvsNormal; + FClickKey := VK_RETURN + scCtrl; + FUseLeftAlignmentOnEditing := DefaultUseLeftAlignmentOnEditing; + FUseMouseWheel := True; + FInnerAlignment := TcxEditAlignment.Create(Self); + FUpdateCount := 0; +end; + +destructor TcxCustomEditProperties.Destroy; +begin + ClearPropertiesDestroyingListeners(Self); + FIDefaultValuesProvider := nil; + FreeAndNil(FButtons); + FreeAndNil(FInnerAlignment); + FreeAndNil(FAssignedValues); + FreeAndNil(FAlignment); + FreeAndNil(FFreeNotificator); + if FCreatedEditPropertiesList <> nil then + FCreatedEditPropertiesList.Remove(Self); + inherited Destroy; +end; + +procedure TcxCustomEditProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomEditProperties then + begin + BeginUpdate; + try + with Source as TcxCustomEditProperties do + begin + Self.AutoSelect := AutoSelect; + Self.Buttons.Assign(Buttons); + Self.ButtonsViewStyle := ButtonsViewStyle; + Self.BeepOnError := BeepOnError; + Self.ClearKey := ClearKey; + Self.ClickKey := ClickKey; + Self.FUseLeftAlignmentOnEditing := FUseLeftAlignmentOnEditing; + Self.FIDefaultValuesProvider := FIDefaultValuesProvider; + Self.Alignment := Alignment; + + Self.AssignedValues.MaxValue := False; + if AssignedValues.MaxValue then + Self.MaxValue := MaxValue; + + Self.AssignedValues.MinValue := False; + if AssignedValues.MinValue then + Self.MinValue := MinValue; + + Self.AssignedValues.ReadOnly := False; + if AssignedValues.ReadOnly then + Self.ReadOnly := ReadOnly; + + Self.ImmediatePost := ImmediatePost; + Self.Transparent := Transparent; + Self.UseMouseWheel := UseMouseWheel; + Self.ValidateOnEnter := ValidateOnEnter; + + Self.OnButtonClick := OnButtonClick; + Self.OnChange := OnChange; + Self.OnEditValueChanged := OnEditValueChanged; + Self.OnValidate := OnValidate; + end + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +function TcxCustomEditProperties.CanCompareEditValue: Boolean; +begin + Result := False; +end; + +class function TcxCustomEditProperties.GetButtonsClass: TcxEditButtonsClass; +begin + Result := TcxEditButtons; +end; + +class function TcxCustomEditProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxCustomEdit; +end; + +class function TcxCustomEditProperties.GetStyleClass: TcxCustomEditStyleClass; +begin + Result := TcxEditStyle; +end; + +class function TcxCustomEditProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxCustomEditViewInfo; +end; + +procedure TcxCustomEditProperties.BeginUpdate; +begin + if FUpdateCount = 0 then + FChangedOccurred := False; + Inc(FUpdateCount); +end; + +procedure TcxCustomEditProperties.Changed; + + function CanFireEvent: Boolean; + begin + Result := not ChangedLocked and not((GetOwner is TComponent) and + (csDestroying in TComponent(GetOwner).ComponentState)); + end; + +begin + if not CanFireEvent then + FChangedOccurred := True + else + if Assigned(FOnPropertiesChanged) then + begin + Inc(FIsChangingCount); + try + FOnPropertiesChanged(Self); + finally + Dec(FIsChangingCount); + end; + end; +end; + +function TcxCustomEditProperties.ChangedLocked: Boolean; +begin + Result := FChangedLocked or (FUpdateCount > 0); +end; + +function TcxCustomEditProperties.CompareDisplayValues( + const AEditValue1, AEditValue2: TcxEditValue): Boolean; +var + ADisplayValue1, ADisplayValue2: TcxEditValue; +begin + PrepareDisplayValue(AEditValue1, ADisplayValue1, False); + PrepareDisplayValue(AEditValue2, ADisplayValue2, False); + Result := ADisplayValue1 = ADisplayValue2; +end; + +function TcxCustomEditProperties.CreatePreviewProperties: TcxCustomEditProperties; +begin + Result := TcxCustomEditPropertiesClass(ClassType).Create(nil); +end; + +function TcxCustomEditProperties.CreateViewData(AStyle: TcxCustomEditStyle; + AIsInplace: Boolean; APreviewMode: Boolean = False): TcxCustomEditViewData; +begin + Result := TcxCustomEditViewDataClass(GetViewDataClass).Create(Self, AStyle, AIsInplace); + Result.PreviewMode := APreviewMode; +end; + +procedure TcxCustomEditProperties.DataChanged; +begin +end; + +procedure TcxCustomEditProperties.EndUpdate(AInvokeChanged: Boolean = True); +begin + if FUpdateCount > 0 then + begin + Dec(FUpdateCount); + if (FUpdateCount = 0) and AInvokeChanged and FChangedOccurred then + Changed; + end; +end; + +function TcxCustomEditProperties.GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; +begin + Result := ''; +end; + +function TcxCustomEditProperties.GetEditConstantPartSize(ACanvas: TcxCanvas; + AEditStyle: TcxCustomEditStyle; AIsInplace: Boolean; + const AEditSizeProperties: TcxEditSizeProperties; var MinContentSize: TSize): TSize; +var + AViewData: TcxCustomEditViewData; +begin + AViewData := TcxCustomEditViewData(CreateViewData(AEditStyle, AIsInplace)); + try + Result := AViewData.GetEditConstantPartSize(ACanvas, AEditSizeProperties, + MinContentSize); + finally + FreeAndNil(AViewData); + end; +end; + +function TcxCustomEditProperties.GetEditContentSize(ACanvas: TcxCanvas; + AEditStyle: TcxCustomEditStyle; AIsInplace: Boolean; const AEditValue: TcxEditValue; + const AEditSizeProperties: TcxEditSizeProperties): TSize; +var + AViewData: TcxCustomEditViewData; +begin + AViewData := TcxCustomEditViewData(CreateViewData(AEditStyle, AIsInplace)); + try + Result := AViewData.GetEditContentSize(ACanvas, AEditValue, AEditSizeProperties); + finally + FreeAndNil(AViewData); + end; +end; + +function TcxCustomEditProperties.GetEditSize(ACanvas: TcxCanvas; + AEditStyle: TcxCustomEditStyle; AIsInplace: Boolean; const AEditValue: TcxEditValue; + AEditSizeProperties: TcxEditSizeProperties): TSize; +var + AViewData: TcxCustomEditViewData; +begin + AViewData := TcxCustomEditViewData(CreateViewData(AEditStyle, AIsInplace)); + try + Result := AViewData.GetEditSize(ACanvas, AEditValue, AEditSizeProperties); + finally + FreeAndNil(AViewData); + end; +end; + +function TcxCustomEditProperties.GetSpecialFeatures: TcxEditSpecialFeatures; +begin + Result := []; +end; + +function TcxCustomEditProperties.GetSupportedOperations: TcxEditSupportedOperations; +begin + if Buttons.Count > 0 then + Result := [esoHotTrack] + else + Result := []; +end; + +function TcxCustomEditProperties.IsActivationKey(AKey: Char): Boolean; +begin + Result := False; +end; + +function TcxCustomEditProperties.IsEditValueValid(var EditValue: TcxEditValue; AEditFocused: Boolean): Boolean; +begin + Result := True; +end; + +procedure TcxCustomEditProperties.RestoreDefaults; +begin + FInnerAlignment.Reset; + BeginUpdate; + try + AssignedValues.RestoreDefaults; + finally + EndUpdate; + end; +end; + +procedure TcxCustomEditProperties.Update(AProperties: TcxCustomEditProperties); +begin +end; + +procedure TcxCustomEditProperties.ValidateDisplayValue( + var ADisplayValue: TcxEditValue; var AErrorText: TCaption; + var AError: Boolean; AEdit: TcxCustomEdit); +var + AIsUserErrorDisplayValue: Boolean; +begin + if not CanValidate then + Exit; + if AErrorText = '' then + AErrorText := GetValidateErrorText(ekDefault); + DoValidate(ADisplayValue, AErrorText, AError, AEdit, AIsUserErrorDisplayValue); +end; + +procedure TcxCustomEditProperties.AlignmentChangedHandler(Sender: TObject); +begin + FInnerAlignment.Assign(FAlignment); + Changed; +end; + +procedure TcxCustomEditProperties.BaseSetAlignment(Value: TcxEditAlignment); +begin + FInnerAlignment.Assign(Value); + Changed; +end; + +procedure TcxCustomEditProperties.ButtonsChanged(Sender: TObject); +begin + Changed; +end; + +function TcxCustomEditProperties.CanModify: Boolean; +begin + Result := AssignedValues.ReadOnly and not FReadOnly; + if not Result then + begin + Result := not ReadOnly; + if Result and (IDefaultValuesProvider <> nil) then + Result := IDefaultValuesProvider.DefaultCanModify and + IDefaultValuesProvider.CanSetEditMode; + end; +end; + +function TcxCustomEditProperties.CanValidate: Boolean; +begin + Result := False; +end; + +procedure TcxCustomEditProperties.FillMinMaxValues(AMinValue, AMaxValue: Double); +begin + if AssignedValues.MaxValue and (AMaxValue = FMaxValue) and + AssignedValues.MinValue and (AMinValue = FMinValue) then + Exit; + + AssignedValues.FMaxValue := True; + FMaxValue := AMaxValue; + AssignedValues.FMinValue := True; + FMinValue := AMinValue; + Changed; +end; + +class function TcxCustomEditProperties.GetAssignedValuesClass: TcxCustomEditPropertiesValuesClass; +begin + Result := TcxCustomEditPropertiesValues; +end; + +function TcxCustomEditProperties.GetDefaultHorzAlignment: TAlignment; +begin + if IDefaultValuesProvider <> nil then + Result := IDefaultValuesProvider.DefaultAlignment + else + Result := FAlignment.Horz; +end; + +function TcxCustomEditProperties.GetDisplayFormatOptions: TcxEditDisplayFormatOptions; +begin + Result := []; +end; + +function TcxCustomEditProperties.GetMaxValue: Double; +begin + if AssignedValues.MaxValue then + Result := FMaxValue + else + if IDefaultValuesProvider = nil then + Result := 0 + else + Result := IDefaultValuesProvider.DefaultMaxValue; +end; + +function TcxCustomEditProperties.GetMinValue: Double; +begin + if AssignedValues.MinValue then + Result := FMinValue + else + if IDefaultValuesProvider = nil then + Result := 0 + else + Result := IDefaultValuesProvider.DefaultMinValue; +end; + +function TcxCustomEditProperties.GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; +begin + Result := evsValue; +end; + +function TcxCustomEditProperties.GetValidateErrorText(AErrorKind: TcxEditErrorKind): string; +begin + Result := cxGetResourceString(@cxSEditValidateErrorText); +end; + +function TcxCustomEditProperties.GetValueEditorEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; +begin + Result := evsValue; + if not AEditFocused and (dfoSupports in DisplayFormatOptions) and (IDefaultValuesProvider <> nil) and + IDefaultValuesProvider.IsDisplayFormatDefined(not(dfoNoCurrencyValue in DisplayFormatOptions)) then + Result := evsText; +end; + +class function TcxCustomEditProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxCustomEditViewData; +end; + +function TcxCustomEditProperties.HasDisplayValue: Boolean; +begin + Result := False; +end; + +function TcxCustomEditProperties.InnerEditNeedsTabs: Boolean; +begin + Result := False; +end; + +function TcxCustomEditProperties.IsEditValueConversionDependOnFocused: Boolean; +begin + Result := True; +end; + +function TcxCustomEditProperties.IsMaxValueStored: Boolean; +begin + Result := AssignedValues.MaxValue; +end; + +function TcxCustomEditProperties.IsMinValueStored: Boolean; +begin + Result := AssignedValues.MinValue; +end; + +function TcxCustomEditProperties.IsResetEditClass: Boolean; +begin + Result := False; +end; + +function TcxCustomEditProperties.IsValueEditorWithValueFormatting: Boolean; +begin + Result := (dfoSupports in DisplayFormatOptions) and (GetEditValueSource(True) = evsValue) and + (GetEditValueSource(False) = evsText) and (IDefaultValuesProvider <> nil) and + IDefaultValuesProvider.IsDisplayFormatDefined(not(dfoNoCurrencyValue in DisplayFormatOptions)); +end; + +procedure TcxCustomEditProperties.LockUpdate(ALock: Boolean); +begin + FChangedLocked := ALock; +end; + +procedure TcxCustomEditProperties.PrepareDisplayValue(const AEditValue: TcxEditValue; + var DisplayValue: TcxEditValue; AEditFocused: Boolean); +begin + DisplayValue := AEditValue; +end; + +function TcxCustomEditProperties.DefaultUseLeftAlignmentOnEditing: Boolean; +begin + Result := cxEditDefaultUseLeftAlignmentOnEditing; +end; + +procedure TcxCustomEditProperties.DefaultValuesProviderDestroyed; +begin + FIDefaultValuesProvider := nil; +end; + +procedure TcxCustomEditProperties.DoValidate(var ADisplayValue: TcxEditValue; + var AErrorText: TCaption; var AError: Boolean; AEdit: TcxCustomEdit; + out AIsUserErrorDisplayValue: Boolean); +var + APrevDisplayValue: TcxEditValue; +begin + AIsUserErrorDisplayValue := False; + if AEdit.IsOnValidateEventAssigned then + begin + APrevDisplayValue := ADisplayValue; + AEdit.DoOnValidate(ADisplayValue, AErrorText, AError); + if AError then + begin + AIsUserErrorDisplayValue := not InternalCompareString(APrevDisplayValue, + ADisplayValue, True); + if not AIsUserErrorDisplayValue then + ADisplayValue := AEdit.DisplayValue; + end; + end; +end; + +procedure TcxCustomEditProperties.FreeNotification(Sender: TComponent); +begin +end; + +function TcxCustomEditProperties.BaseGetAlignment: TcxEditAlignment; +var + AOwnerComponent: TComponent; +begin + FAlignment.OnChanged := nil; + FAlignment.Assign(FInnerAlignment); + Result := FAlignment; + if IsAlignmentStored then + begin + AOwnerComponent := GetOwnerComponent(Self); + if (AOwnerComponent <> nil) and (csWriting in AOwnerComponent.ComponentState) then + Exit; + end; + + if not FInnerAlignment.IsHorzStored then + Result.FHorz := GetDefaultHorzAlignment; + FAlignment.OnChanged := AlignmentChangedHandler; +end; + +procedure TcxCustomEditProperties.DefaultValuesChanged(Sender: TObject); +begin + Changed; +end; + +function TcxCustomEditProperties.GetIsChanging: Boolean; +begin + Result := FIsChangingCount > 0; +end; + +function TcxCustomEditProperties.GetReadOnly: Boolean; +begin + if AssignedValues.ReadOnly then + Result := FReadOnly + else + if IDefaultValuesProvider = nil then + Result := False + else + Result := IDefaultValuesProvider.DefaultReadOnly; +end; + +function TcxCustomEditProperties.IsAlignmentStored: Boolean; +begin + with FInnerAlignment do + Result := IsHorzStored or IsVertStored; +end; + +function TcxCustomEditProperties.IsUseLeftAlignmentOnEditingStored: Boolean; +begin + Result := FUseLeftAlignmentOnEditing <> DefaultUseLeftAlignmentOnEditing; +end; + +function TcxCustomEditProperties.IsReadOnlyStored: Boolean; +begin + Result := AssignedValues.ReadOnly; +end; + +procedure TcxCustomEditProperties.SetAssignedValues( + Value: TcxCustomEditPropertiesValues); +begin + FAssignedValues.Assign(Value); +end; + +procedure TcxCustomEditProperties.SetAutoSelect(Value: Boolean); +begin + if Value <> FAutoSelect then + begin + FAutoSelect := Value; + Changed; + end; +end; + +procedure TcxCustomEditProperties.SetButtons(Value: TcxEditButtons); +begin + FButtons.Assign(Value); +end; + +procedure TcxCustomEditProperties.SetButtonsViewStyle(Value: TcxEditButtonsViewStyle); +begin + if Value <> FButtonsViewStyle then + begin + FButtonsViewStyle := Value; + Changed; + end; +end; + +procedure TcxCustomEditProperties.SetUseLeftAlignmentOnEditing(Value: Boolean); +begin + if Value <> FUseLeftAlignmentOnEditing then + begin + FUseLeftAlignmentOnEditing := Value; + Changed; + end; +end; + +procedure TcxCustomEditProperties.SetIDefaultValuesProvider(Value: IcxEditDefaultValuesProvider); +begin + FIDefaultValuesProvider := Value; + if FOwner is TcxCustomEdit then + DefaultValuesChanged(nil); +end; + +procedure TcxCustomEditProperties.SetMaxValue(Value: Double); +begin + if AssignedValues.MaxValue and (Value = FMaxValue) then + Exit; + + AssignedValues.FMaxValue := True; + FMaxValue := Value; + Changed; +end; + +procedure TcxCustomEditProperties.SetMinValue(Value: Double); +begin + if AssignedValues.MinValue and (Value = FMinValue) then + Exit; + + AssignedValues.FMinValue := True; + FMinValue := Value; + Changed; +end; + +procedure TcxCustomEditProperties.SetReadOnly(Value: Boolean); +begin + if AssignedValues.ReadOnly and (Value = FReadOnly) then + Exit; + AssignedValues.FReadOnly := True; + FReadOnly := Value; + Changed; +end; + +procedure TcxCustomEditProperties.SetTransparent(Value: Boolean); +begin + if Value <> FTransparent then + begin + FTransparent := Value; + Changed; + end; +end; + +{ TcxEditDataBinding } + +constructor TcxEditDataBinding.Create(AEdit: TcxCustomEdit); +begin + inherited Create; + FEdit := AEdit; + FIDefaultValuesProvider := GetDefaultValuesProviderClass.Create(nil); +end; + +destructor TcxEditDataBinding.Destroy; +begin + FreeAndNil(FIDefaultValuesProvider); + inherited Destroy; +end; + +function TcxEditDataBinding.CanCheckEditorValue: Boolean; +begin + Result := Edit.IsDesigning or not Edit.ModifiedAfterEnter; +end; + +function TcxEditDataBinding.CanPostEditorValue: Boolean; +begin + Result := Modified; +end; + +function TcxEditDataBinding.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := False; +end; + +class function TcxEditDataBinding.GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; +begin + Result := TcxCustomEditDefaultValuesProvider; +end; + +procedure TcxEditDataBinding.SetModified; +begin + if Edit.Focused then + Edit.ModifiedAfterEnter := True; +end; + +function TcxEditDataBinding.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := False; +end; + +procedure TcxEditDataBinding.UpdateDisplayValue; +begin + Edit.SynchronizeDisplayValue; +end; + +procedure TcxEditDataBinding.UpdateNotConnectedDBEditDisplayValue; +begin +end; + +procedure TcxEditDataBinding.DefaultValuesChanged; +var + AProperties: TcxCustomEditProperties; +begin + AProperties := Edit.ActiveProperties; + if Edit.RepositoryItem = nil then + AProperties.DefaultValuesChanged(nil) + else + begin + AProperties.BeginUpdate; + try + AProperties.DefaultValuesChanged(nil); + finally + AProperties.EndUpdate(False); + end; + Edit.PropertiesChanged(AProperties); + end; +end; + +function TcxEditDataBinding.GetDisplayValue: TcxEditValue; +begin + Result := Edit.DisplayValue; +end; + +function TcxEditDataBinding.GetEditDataBindingInstance: TcxEditDataBinding; +begin + Result := Self; +end; + +function TcxEditDataBinding.GetEditing: Boolean; +begin + Result := Edit.ModifiedAfterEnter; +end; + +function TcxEditDataBinding.GetModified: Boolean; +begin + Result := Edit.ModifiedAfterEnter; +end; + +function TcxEditDataBinding.GetOwner: TPersistent; +begin + Result := FEdit; +end; + +function TcxEditDataBinding.GetStoredValue: TcxEditValue; +begin + Result := Edit.EditValue; +end; + +procedure TcxEditDataBinding.Reset; +begin + Edit.ResetEditValue; +end; + +procedure TcxEditDataBinding.SetInternalDisplayValue(const Value: TcxEditValue); +begin + Edit.SetInternalDisplayValue(Value); +end; + +procedure TcxEditDataBinding.SetDisplayValue(const Value: TcxEditValue); +begin + SetInternalDisplayValue(Value); +end; + +function TcxEditDataBinding.SetEditMode: Boolean; +begin + Edit.ModifiedAfterEnter := True; + Result := True; +end; + +procedure TcxEditDataBinding.SetStoredValue(const Value: TcxEditValue); +begin +end; + +function TcxEditDataBinding.GetIDefaultValuesProvider: IcxEditDefaultValuesProvider; +begin + Result := FIDefaultValuesProvider as IcxEditDefaultValuesProvider; +end; + +function TcxEditDataBinding.GetIsDataAvailable: Boolean; +begin + Result := IDefaultValuesProvider.IsDataAvailable; +end; + +{ TcxCustomEditData } + +constructor TcxCustomEditData.Create(AEdit: TcxCustomEdit); +begin + inherited Create; + FEdit := AEdit; + FFreeNotificator := TcxFreeNotificator.Create(nil); + FFreeNotificator.OnFreeNotification := FreeNotification; + FFreeNotificator.AddSender(AEdit); + Clear; +end; + +destructor TcxCustomEditData.Destroy; +begin + FFreeNotificator.Free; + inherited Destroy; +end; + +procedure TcxCustomEditData.Clear; +begin + FCleared := True; + if FEdit <> nil then + FEdit.DoClearEditData(Self); +end; + +procedure TcxCustomEditData.FreeNotification(AComponent: TComponent); +begin + if AComponent = FEdit then + FEdit := nil; +end; + +{ TcxEditChangeEventsCatcher } + +constructor TcxEditChangeEventsCatcher.Create(AEdit: TcxCustomEdit); +begin + inherited Create; + FEdit := AEdit; +end; + +function TcxEditChangeEventsCatcher.IsLocked: Boolean; +begin + Result := FLockCount > 0; +end; + +procedure TcxEditChangeEventsCatcher.Lock(ALock: Boolean; + AInvokeChangedOnUnlock: Boolean = True); +begin + if ALock then + begin + if FLockCount = 0 then + begin + FOnChangeEvent := False; + FOnEditValueChangedEvent := False; + end; + Inc(FLockCount); + end + else + if FLockCount > 0 then + begin + Dec(FLockCount); + if AInvokeChangedOnUnlock and (FLockCount = 0) and + not(FEdit.IsLoading or FEdit.IsDestroying) then + begin + if OnChangeEvent and FEdit.IsOnChangeEventAssigned then + FEdit.DoOnChange; + if OnEditValueChangedEvent and FEdit.IsOnEditValueChangedEventAssigned then + FEdit.DoOnEditValueChanged; + end; + end; +end; + +{ TcxCustomEdit } + +constructor TcxCustomEdit.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FIsCreating := True; + Initialize; + FIsCreating := False; + if HandleAllocated then + ShortRefreshContainer(False); +end; + +constructor TcxCustomEdit.Create(AOwner: TComponent; AIsInplace: Boolean); +begin + FIsInplace := AIsInplace; + Create(AOwner); +end; + +destructor TcxCustomEdit.Destroy; +begin + FreeAndNil(FDblClickTimer); + if FRepositoryItem <> nil then + FRepositoryItem.RemoveListener(Self); + if HasInnerEdit then + FInnerEdit := nil; + + Properties.OnPropertiesChanged := nil; + if not FIsInplace then + Properties.IDefaultValuesProvider := nil; + FreeAndNil(FDataBinding); + + FPrevModifiedList := nil; + FreeAndNil(FProperties); + FreeAndNil(FChangeEventsCatcher); + inherited Destroy; +end; + +procedure TcxCustomEdit.DefaultHandler(var Message); +var + AMessage: TMessage; +begin + AMessage := TMessage(Message); + if not (IsInplace and (AMessage.Msg = WM_CONTEXTMENU)) then + inherited; +end; + +function TcxCustomEdit.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action) or FDataBinding.ExecuteAction(Action); +end; + +procedure TcxCustomEdit.GetTabOrderList(List: TList); +begin + inherited GetTabOrderList(List); + if IsInplace and Visible then + List.Remove(Parent); +end; + +function TcxCustomEdit.IsInplace: Boolean; +begin + Result := FIsInplace; +end; + +function TcxCustomEdit.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action) or FDataBinding.UpdateAction(Action); +end; + +procedure TcxCustomEdit.Activate(var AEditData: TcxCustomEditData); +begin + if (AEditData = nil) and (GetEditDataClass <> nil) then + AEditData := GetEditDataClass.Create(Self); + FEditData := AEditData; + DoClearEditData(FEditData); + Visible := True; + if HandleAllocated and CanFocus then + begin + SetFocus; + if ActiveProperties.AutoSelect then + SelectAll; + end; + SynchronizeDisplayValue; + EditModified := False; + InplaceParams.MultiRowParent := True; +end; + +procedure TcxCustomEdit.ActivateByKey(Key: Char; var AEditData: TcxCustomEditData); +begin + LockInnerEditRepainting; + try + Activate(AEditData); + if SendActivationKey(Key) then + SendMessage(Handle, WM_CHAR, Integer(Key), 0); + finally + UnlockInnerEditRepainting; + end; +end; + +procedure TcxCustomEdit.ActivateByMouse(Shift: TShiftState; X, Y: Integer; + var AEditData: TcxCustomEditData); +var + P: TPoint; +begin + Activate(AEditData); + P := Parent.ClientToScreen(Point(X, Y)); + P := ScreenToClient(P); + if ssLeft in Shift then + begin + SendMessage(Handle, WM_LBUTTONDOWN, ShiftStateToKeys(Shift), P.Y shl 16 + P.X); + if (GetCaptureControl = Self) and not(ssLeft in InternalGetShiftState) then + SetCaptureControl(nil); + end + else + SendMessage(Handle, WM_LBUTTONUP, ShiftStateToKeys(Shift), P.Y shl 16 + P.X); + FDblClickTimer.Enabled := True; +end; + +function TcxCustomEdit.AreChangeEventsLocked: Boolean; +begin + Result := ChangeEventsCatcher.IsLocked; +end; + +function TcxCustomEdit.CanPostEditValue: Boolean; +begin + Result := not IsDesigning and DataBinding.CanPostEditorValue; +end; + +procedure TcxCustomEdit.Clear; +begin + EditValue := GetClearValue; +end; + +procedure TcxCustomEdit.CopyToClipboard; +begin +end; + +procedure TcxCustomEdit.CutToClipboard; +begin +end; + +function TcxCustomEdit.Deactivate: Boolean; + + procedure ForceConvertingDisplayValueToEditValue; + begin + KeyboardAction := False; + end; + +begin + FDblClickTimer.Enabled := False; + Result := False; + try + ForceConvertingDisplayValueToEditValue; + Result := ValidateEdit(True); + finally + if Result then + begin + SynchronizeDisplayValue; + IsEditValidated := True; + end; + end; +end; + +function TcxCustomEdit.DoEditing: Boolean; + + procedure DoOnEditing; + begin + if Assigned(FOnEditing) then + FOnEditing(Self, Result); + end; + + procedure StandaloneDoEditing; + begin + if not DataBinding.Editing then + begin + DoOnEditing; + if Result then + begin + LockEditValueChanging(True); + try + Result := DataBinding.SetEditMode; + finally + LockEditValueChanging(False); + end; + end; + end + else + begin + DoOnEditing; + if Result then + DataBinding.SetModified; + end; + end; + + procedure InplaceDoEditing; + begin + LockEditValueChanging(True); + try + DoOnEditing; + finally + LockEditValueChanging(False); + end; + end; + +begin + Result := InternalDoEditing; + if not Result then + Exit; + if DataBinding.Modified then + begin + Result := True; + Exit; + end; + Result := CanModify; + if not Result then + Exit; + + FEditModeSetting := True; + try + if IsInplace then + InplaceDoEditing + else + StandaloneDoEditing; + finally + FEditModeSetting := False; + end; +end; + +class function TcxCustomEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomEditProperties; +end; + +procedure TcxCustomEdit.PasteFromClipboard; +begin +end; + +procedure TcxCustomEdit.PostEditValue; +begin + if CanPostEditValue then + InternalPostEditValue(True) + else + if Focused and DoEditing then + begin + ModifiedAfterEnter := True; + try + IsEditValidated := True; + InternalPostEditValue(False); + finally + ModifiedAfterEnter := False; + end; + end; +end; + +procedure TcxCustomEdit.PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); +begin +end; + +procedure TcxCustomEdit.Reset; +begin + DataBinding.Reset; +end; + +procedure TcxCustomEdit.SelectAll; +begin +end; + +function TcxCustomEdit.ValidateEdit(ARaiseExceptionOnError: Boolean): Boolean; +var + ADisplayValue: TcxEditValue; + AError: Boolean; + AErrorText: TCaption; +begin + if not (FModifiedAfterEnter and not FIsEditValidated and (FLockValidate = 0)) then + begin + Result := True; + Exit; + end; + + FIsEditValidating := True; + try + ADisplayValue := DisplayValue; + AError := False; + if ActiveProperties.CanValidate then + ActiveProperties.ValidateDisplayValue(ADisplayValue, AErrorText, AError, Self); + Result := not AError; + if AError then + try + if ARaiseExceptionOnError then + begin + HandleValidationError(AErrorText, True); + Application.ProcessMessages; + end; + finally + if not InternalCompareString(ADisplayValue, DisplayValue, True) then + begin + SetInternalDisplayValue(ADisplayValue); + if Visible then + begin + SelectAll; + if not IsEditClass then + UpdateDrawValue; + end; + end; + end + else + begin + if FKeyboardAction and not DoEditing then + Exit; + InternalValidateDisplayValue(ADisplayValue); + if not IsInplace and not Focused then + ModifiedAfterEnter := False; + FIsEditValidated := True; + end; + finally + FIsEditValidating := False; + end; +end; + +{$IFDEF DELPHI10} +function TcxCustomEdit.GetTextBaseLine: Integer; +begin + Result := 0; +end; + +function TcxCustomEdit.HasTextBaseLine: Boolean; +begin + Result := False; +end; +{$ENDIF} + +function TcxCustomEdit.CanContainerHandleTabs: Boolean; +begin + Result := False; +end; + +function TcxCustomEdit.CanResize(var NewWidth, NewHeight: Integer): Boolean; +begin + Result := inherited CanResize(NewWidth, NewHeight); + if Result and not IsLoading then + InternalCanResize(NewWidth, NewHeight); +end; + +procedure TcxCustomEdit.Click; +begin + if not IsDestroying and (FClickLockCount = 0) and + (not IsLoading or IsClickEnabledDuringLoading) then + inherited Click; +end; + +procedure TcxCustomEdit.DblClick; +var + P: TPoint; + AButton: TMouseButton; + AShiftState: TShiftState; +begin + P := ScreenToClient(InternalGetCursorPos); + if ButtonVisibleIndexAt(P) <> -1 then + begin + AButton := mbLeft; + AShiftState := InternalGetShiftState; + AShiftState := AShiftState + ButtonToShift(AButton); + MouseDown(AButton, AShiftState, P.X, P.Y); + Click; + end + else + inherited DblClick; +end; + +procedure TcxCustomEdit.DefineProperties(Filer: TFiler); + + function HasHeight: Boolean; + begin + Result := (Filer.Ancestor = nil) or (TcxCustomEdit(Filer.Ancestor).Height <> Height); + end; + + function HasWidth: Boolean; + begin + Result := (Filer.Ancestor = nil) or (TcxCustomEdit(Filer.Ancestor).Width <> Width); + end; + +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('Height', ReadHeight, WriteHeight, not CanAutoSize and HasHeight); + Filer.DefineProperty('Width', ReadWidth, WriteWidth, + not (CanAutoSize and CanAutoWidth) and HasWidth); +end; + +procedure TcxCustomEdit.DoEnter; +begin + if not IsDestroying then + begin + if not FValidateErrorProcessing then + DoShowEdit; + ShortRefreshContainer(False); + end; +end; + +procedure TcxCustomEdit.DoExit; +var + APrevKeyboardAction: Boolean; +begin + APrevKeyboardAction := KeyboardAction; + KeyboardAction := False; + try + DoHideEdit(True); + finally + KeyboardAction := APrevKeyboardAction; + end; +end; + +procedure TcxCustomEdit.FocusChanged; +var + AFocused: Boolean; +begin + if IsDestroying or FValidateErrorProcessing then + Exit; + AFocused := Focused and Application.Active; + if FFocused = AFocused then + Exit; + FFocused := not FFocused; + inherited FocusChanged; + DoFocusChanged; +end; + +function TcxCustomEdit.GetBorderExtent: TRect; +begin + Result.Left := ViewInfo.ShadowRect.Left - ViewInfo.Bounds.Left; + Result.Right := ViewInfo.Bounds.Right - ViewInfo.ShadowRect.Right; + Result.Top := ViewInfo.ShadowRect.Top - ViewInfo.Bounds.Top; + Result.Bottom := ViewInfo.Bounds.Bottom - ViewInfo.ShadowRect.Bottom; +end; + +function TcxCustomEdit.GetStyleClass: TcxContainerStyleClass; +begin + Result := GetPropertiesClass.GetStyleClass; +end; + +function TcxCustomEdit.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxCustomEditPropertiesClass(GetPropertiesClass).GetViewInfoClass; +end; + +function TcxCustomEdit.InternalGetNotPublishedStyleValues: + TcxEditStyleValues; +begin + Result := [svButtonStyle, svButtonTransparency, svGradient, svGradientButtons, + svGradientDirection, svPopupBorderStyle]; +end; + +function TcxCustomEdit.IsRightBoundFixed: Boolean; +begin + Result := False; +end; + +function TcxCustomEdit.IsTransparentBackground: Boolean; +begin + Result := IsNativeBackground or IsTransparent; +end; + +procedure TcxCustomEdit.KeyDown(var Key: Word; Shift: TShiftState); +begin + FIsEditValueResetting := False; + if not IsEditorKey(Key, Shift) then + inherited KeyDown(Key, Shift); + if Key <> 0 then + DoEditKeyDown(Key, Shift); + if (Key <> 0) and NeedsInvokeAfterKeyDown(Key, Shift) then + DoAfterKeyDown(Key, Shift); +end; + +procedure TcxCustomEdit.KeyPress(var Key: Char); +begin + if (Word(Key) = VK_ESCAPE) and FIsEditValueResetting then + begin + FIsEditValueResetting := False; + Key := #0; + Exit; + end; + + inherited KeyPress(Key); + if Key <> #0 then + DoEditKeyPress(Key); +end; + +procedure TcxCustomEdit.KeyUp(var Key: Word; Shift: TShiftState); +begin + inherited KeyUp(Key, Shift); + if Key <> 0 then + DoEditKeyUp(Key, Shift); +end; + +procedure TcxCustomEdit.Loaded; +begin + inherited Loaded; + LockChangeEvents(True); + LockClick(True); + try + DataBinding.UpdateNotConnectedDBEditDisplayValue; + ShortRefreshContainer(False); +// SetSize; + if FRepositoryItem = nil then + Properties.OnPropertiesChanged := PropertiesChanged; + PropertiesChanged(ActiveProperties); + ViewInfo.Shadow := False; + ContainerStyleChanged(FStyles.Style); // TODO remove + finally + LockClick(False); + LockChangeEvents(False, False); + end; +end; + +procedure TcxCustomEdit.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +const + AMouseMessages: array[TMouseButton] of UINT = + (WM_LBUTTONDOWN, WM_RBUTTONDOWN, WM_MBUTTONDOWN); +var + AButtonVisibleIndex: Integer; + AControl: TWinControl; + P: TPoint; +begin + if (Button = mbLeft) and FDblClickTimer.Enabled then + begin + FDblClickTimer.Enabled := False; + if ButtonVisibleIndexAt(ScreenToClient(InternalGetCursorPos)) = -1 then + DblClick; + end; + + inherited MouseDown(Button, Shift, X, Y); + P := InternalGetCursorPos; + if HandleAllocated and (WindowFromPoint(P) = Handle) then + begin + AControl := FindControl(WindowFromPoint(P)); + if (AControl <> nil) and (AControl <> Self) then + begin + P := AControl.ScreenToClient(P); + CallWindowProc(TWinControlAccess(AControl).DefWndProc, AControl.Handle, + AMouseMessages[Button], ShiftStateToKeys(InternalGetShiftState), + MakeLong(P.X, P.Y)); + end; + end; + + if (Button = mbLeft) and (GetCaptureControl = Self) then + begin + AButtonVisibleIndex := ButtonVisibleIndexAt(Point(X, Y)); + if (AButtonVisibleIndex <> -1) and + (ViewInfo.ButtonsInfo[AButtonVisibleIndex].Data.State = ebsPressed) then + FCaptureButtonVisibleIndex := AButtonVisibleIndex; + end; +end; + +procedure TcxCustomEdit.MouseLeave(AControl: TControl); +//var +// I: Integer; +begin + inherited MouseLeave(AControl); +// for I := 0 to Length(ViewInfo.ButtonsInfo) - 1 do +// with ViewInfo.ButtonsInfo[I] do +// if Data.State = ebsSelected then +// begin +// Data.State := ebsNormal; +// InvalidateRect(Bounds, HasBackground); +// end; +end; + +procedure TcxCustomEdit.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (AComponent = FRepositoryItem) then + RepositoryItem := nil; +end; + +procedure TcxCustomEdit.Paint; +begin + if IsDBEditPaintCopyDrawing then + PaintCopyDraw + else + begin + CheckIsViewInfoCalculated; + ViewInfo.Paint(Canvas); + end; +end; + +procedure TcxCustomEdit.ReadState(Reader: TReader); +begin + TcxCustomEditProperties(FProperties).OnPropertiesChanged := nil; + inherited ReadState(Reader); +end; + +function TcxCustomEdit.RefreshContainer(const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AIsMouseEvent: Boolean): Boolean; +var + AViewInfo: TcxCustomEditViewInfo; + R: TRect; + AViewInfoChanged: Boolean; +begin + Result := False; + if not HandleAllocated or FIsCreating or (csDestroyingHandle in ControlState) or IsDestroying then + Exit; + IsViewInfoCalculated := True; + + if (FCaptureButtonVisibleIndex <> -1) and (GetCaptureControl <> Self) then + FCaptureButtonVisibleIndex := -1; + + AViewInfo := nil; + try + if AIsMouseEvent then + begin + AViewInfo := TcxCustomEditViewInfo(TcxCustomEditProperties(Properties).GetViewInfoClass.Create); + AViewInfo.Assign(ViewInfo); + end; + + CalculateViewInfo(P, Button, Shift, AIsMouseEvent); + + if HasInnerEdit and IsEditClass then + R := InnerEdit.Control.BoundsRect + else + R := cxEmptyRect; + AViewInfoChanged := ViewInfo.Repaint(Self, R, AViewInfo); + if (AViewInfo <> nil) and not AViewInfoChanged then + Exit; + +// TODO Incorrect CheckBox height calculation when assigning glyph +// ViewInfo.Calculated := True; +// try + SetSize; +// finally +// ViewInfo.Calculated := False; +// end; + + if HandleAllocated then + begin + FSettingEditWindowRegion := True; + SetShadowRegion; + FSettingEditWindowRegion := False; + end; + + if (AViewInfo <> nil) and AViewInfoChanged then + ProcessViewInfoChanges(AViewInfo, Button <> cxmbNone); + finally + FreeAndNil(AViewInfo); + end; + + Result := True; +end; + +procedure TcxCustomEdit.RequestAlign; +begin + inherited RequestAlign; + ShortRefreshContainer(False); +end; + +procedure TcxCustomEdit.SetName(const Value: TComponentName); +begin + inherited SetName(Value); + DataBinding.UpdateNotConnectedDBEditDisplayValue; +end; + +procedure TcxCustomEdit.SetParent(AParent: TWinControl); +begin + if FIsJustCreated and (AParent <> nil) then + begin + FIsJustCreated := False; + DataBinding.UpdateNotConnectedDBEditDisplayValue; + PropertiesChanged(Properties); + DataBinding.UpdateDisplayValue; + end; + inherited SetParent(AParent); +end; + +procedure TcxCustomEdit.SetSize; +var + ANewHeight, ANewWidth: Integer; +begin + if not HandleAllocated or IsDestroying then + Exit; + + ANewWidth := Width; + ANewHeight := Height; + InternalCanResize(ANewWidth, ANewHeight); + if IsRightBoundFixed then + SetBounds(Left + Width - ANewWidth, Top, ANewWidth, ANewHeight) + else + SetBounds(Left, Top, ANewWidth, ANewHeight); + + if InnerEdit <> nil then + AdjustInnerEditPosition; +end; + +procedure TcxCustomEdit.CreateHandle; +begin + inherited CreateHandle; + if HasInnerEdit and inherited Focused then + InnerEdit.SafelySetFocus; +end; + +function TcxCustomEdit.IsNativeStyle: Boolean; +begin + Result := Properties.GetViewDataClass.IsNativeStyle(Style.LookAndFeel); +end; + +procedure TcxCustomEdit.SafeSelectionFocusInnerControl; +begin + InnerEdit.SafelySetFocus; +end; + +procedure TcxCustomEdit.WndProc(var Message: TMessage); +begin + case Message.Msg of + WM_NCCALCSIZE: + if FSettingEditWindowRegion then + begin + Message.Result := 0; + Exit; + end; + end; + inherited WndProc(Message); +end; + +procedure TcxCustomEdit.AdjustInnerEditPosition; +var + R: TRect; +begin + if not HasInnerEdit then + Exit; + R := ViewInfo.ClientRect; + with R do + InnerEdit.Control.SetBounds(Left, Top, Right - Left, Bottom - Top); + AlignControls(InnerEdit.Control, R); +end; + +procedure TcxCustomEdit.AfterPosting; +begin + FIsPosting := False; +end; + +procedure TcxCustomEdit.BeforePosting; +begin + FIsPosting := True; +end; + +function TcxCustomEdit.ButtonVisibleIndexAt(const P: TPoint): Integer; +var + I: Integer; +begin + Result := -1; + with ViewInfo do + for I := 0 to Length(ButtonsInfo) - 1 do + if PtInRect(ButtonsInfo[I].Bounds, P) then + begin + Result := I; + Break; + end; +end; + +procedure TcxCustomEdit.CalculateViewInfo(AIsMouseEvent: Boolean); +var + P: TPoint; +begin + P := ScreenToClient(InternalGetCursorPos); + CalculateViewInfo(P, cxmbNone, InternalGetShiftState, False); +end; + +procedure TcxCustomEdit.CalculateViewInfo(P: TPoint; Button: TcxMouseButton; + Shift: TShiftState; AIsMouseEvent: Boolean); +var + AViewData: TcxCustomEditViewData; +begin + AViewData := TcxCustomEditViewData(CreateViewData); + try + AViewData.Calculate(Canvas, GetControlRect(Self), P, Button, Shift, + ViewInfo, AIsMouseEvent); + finally + FreeAndNil(AViewData); + end; +end; + +function TcxCustomEdit.CanAutoSize: Boolean; +begin + Result := not IsInplace and AutoSize; +end; + +function TcxCustomEdit.CanAutoWidth: Boolean; +begin + Result := ActiveProperties.ButtonsViewStyle = bvsButtonsAutoWidth; +end; + +function TcxCustomEdit.CanKeyDownModifyEdit(Key: Word; Shift: TShiftState): Boolean; +begin + Result := False; +end; + +function TcxCustomEdit.CanKeyPressModifyEdit(Key: Char): Boolean; +begin + Result := False; +end; + +function TcxCustomEdit.CanModify: Boolean; +begin + if IsInplace then + Result := ActiveProperties.CanModify + else + with ActiveProperties do + begin + Result := AssignedValues.ReadOnly and not FReadOnly; + if not Result then + begin + Result := not AssignedValues.ReadOnly or not FReadOnly; + Result := Result and DataBinding.IDefaultValuesProvider.DefaultCanModify and + DataBinding.IDefaultValuesProvider.CanSetEditMode; + end; + end; +end; + +procedure TcxCustomEdit.ChangeHandler(Sender: TObject); +begin + if Focused then + ModifiedAfterEnter := True + else + if not ActiveProperties.IsChanging then + DataBinding.SetModified; + DoChange; +end; + +procedure TcxCustomEdit.CheckHandle; +begin + if HandleAllocated then + Exit; + if not(FHandleAllocating or IsDestroying) then + begin + FHandleAllocating := True; + try + if CanAllocateHandle(Self) then + HandleNeeded; + finally + FHandleAllocating := False; + end; + end; +end; + +function TcxCustomEdit.CreateInnerEdit: IcxCustomInnerEdit; +var + AIInnerEditHelper: IcxInnerEditHelper; + AInnerEdit: TControl; + AInnerEditClass: TControlClass; +begin + AInnerEditClass := GetInnerEditClass; + if AInnerEditClass <> nil then + begin + AInnerEdit := AInnerEditClass.Create(Self); + if Supports(AInnerEdit, IcxInnerEditHelper, AIInnerEditHelper) then + Result := AIInnerEditHelper.GetHelper + else + Supports(AInnerEdit, IcxCustomInnerEdit, Result) + end + else + Result := nil; +end; + +function TcxCustomEdit.CreateViewData: TcxCustomEditViewData; +begin + Result := ActiveProperties.CreateViewData(ActiveStyle, IsInplace); + if FIsContentParamsInitialized and IsInplace then + Result.EditContentParams := ContentParams; + if PropertiesChangeLocked then + Result.Edit := nil + else + Result.Edit := Self; + if HandleAllocated then + Result.WindowHandle := Handle + else + Result.WindowHandle := 0; + InitializeViewData(Result); +end; + +procedure TcxCustomEdit.DefaultButtonClick; +begin + if GetDefaultButtonVisibleIndex <> -1 then + DoButtonClick(GetDefaultButtonVisibleIndex); +end; + +procedure TcxCustomEdit.DisableValidate; +begin + Inc(FLockValidate); +end; + +procedure TcxCustomEdit.DoAfterKeyDown(var Key: Word; Shift: TShiftState); +begin + if Assigned(FOnAfterKeyDown) then + FOnAfterKeyDown(Self, Key, Shift); +end; + +procedure TcxCustomEdit.DoButtonClick(AButtonVisibleIndex: Integer); +begin + with Properties do + if Assigned(FOnButtonClick) then + FOnButtonClick(Self, ViewInfo.ButtonsInfo[AButtonVisibleIndex].Index); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(FOnButtonClick) then + FOnButtonClick(Self, ViewInfo.ButtonsInfo[AButtonVisibleIndex].Index); +end; + +procedure TcxCustomEdit.DoButtonDown(AButtonVisibleIndex: Integer); +begin +end; + +procedure TcxCustomEdit.DoButtonUp(AButtonVisibleIndex: Integer); +begin +end; + +procedure TcxCustomEdit.DoChange; +begin + if IsLoading or IsDestroying then + Exit; + if IsOnChangeEventAssigned then + if AreChangeEventsLocked then + FChangeEventsCatcher.OnChangeEvent := True + else + begin + if IsInplace then + begin + SaveModified; + FModified := True; + SetModifiedAfterEnterValue(True); + end; + try + DoOnChange; + finally + if IsInplace then + RestoreModified; + end; + end; + if not ActiveProperties.HasDisplayValue and not ActiveProperties.CanCompareEditValue then + DoEditValueChanged; +end; + +procedure TcxCustomEdit.DoClick; +begin + ModifiedAfterEnter := True; + if FClickLockCount = 0 then + Click; +end; + +procedure TcxCustomEdit.DoClosePopup(AReason: TcxEditCloseUpReason); +begin + with Properties do + if Assigned(OnClosePopup) then + OnClosePopup(Self, AReason); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnClosePopup) then + OnClosePopup(Self, AReason); +end; + +procedure TcxCustomEdit.DoEditValueChanged; +begin + if IsLoading or IsDestroying then + Exit; + if IsOnEditValueChangedEventAssigned then + if AreChangeEventsLocked then + FChangeEventsCatcher.OnEditValueChangedEvent := True + else + begin + if IsInplace then + begin + SaveModified; + FModified := True; + SetModifiedAfterEnterValue(True); + end; + try + DoOnEditValueChanged; + finally + if IsInplace then + RestoreModified; + end; + end; +end; + +procedure TcxCustomEdit.DoEditKeyDown(var Key: Word; Shift: TShiftState); + + procedure CheckClearKey(AShortCut: TShortCut); + begin + if AShortCut = ActiveProperties.ClearKey then + begin + LockChangeEvents(True); + KeyboardAction := True; + try + InternalEditValue := GetClearValue; + IsEditValidated := True; + finally + KeyboardAction := False; + LockChangeEvents(False); + end; + Key := 0; + end; + end; + + procedure CheckClickKey(AShortCut: TShortCut); + begin + if (GetDefaultButtonVisibleIndex <> -1) and (AShortCut = ActiveProperties.ClickKey) then + begin + KillMessages(Handle, WM_CHAR, WM_CHAR, False); + DefaultButtonClick; + Key := 0; + end; + end; + +var + AShortCut: TShortCut; +begin + if Key = 0 then + Exit; + AShortCut := ShortCut(Key, Shift); + + CheckClearKey(AShortCut); + if Key = 0 then + Exit; + + CheckClickKey(AShortCut); + if Key = 0 then + Exit; + + if not ValidateKeyDown(Key, Shift) then + begin + DoAfterKeyDown(Key, Shift); + Key := 0; + Exit; + end; + + case Key of + VK_ESCAPE: + begin + if FModifiedAfterEnter and IsResetEditClass then + begin + LockChangeEvents(True); + try + DataBinding.Reset; + EditModified := True; + finally + LockChangeEvents(False); + end; + FIsEditValueResetting := True; + Key := 0; + end; + end; + VK_TAB: + if Focused and (Shift * [ssAlt, ssCtrl] = []) and not ActiveProperties.InnerEditNeedsTabs then + begin + DoEditProcessTab(Shift); + DoAfterKeyDown(Key, Shift); + if Key = 0 then + Exit; + Key := 0; + if GetParentForm(Self) <> nil then + TWinControlAccess(GetParentForm(Self)).SelectNext(GetParentForm(Self).ActiveControl, + not(ssShift in Shift), True); + if HandleAllocated and HasInnerEdit and (GetFocus = Handle) then + InnerEdit.SafelySetFocus; + end; + VK_RETURN: + if ActiveProperties.ValidateOnEnter then + begin + Key := 0; + LockChangeEvents(True); + try + if ValidateEdit(True) and CanPostEditValue then + InternalPostEditValue; + finally + LockChangeEvents(False); + end; + end; + end; + + if not WantNavigationKeys then + case Key of + VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_HOME, VK_END, VK_PRIOR, VK_NEXT: + begin + DoAfterKeyDown(Key, Shift); + Key := 0; + end; + end; +end; + +procedure TcxCustomEdit.DoEditKeyPress(var Key: Char); +begin + ValidateKeyPress(Key); +end; + +procedure TcxCustomEdit.DoEditKeyUp(var Key: Word; Shift: TShiftState); +begin +end; + +procedure TcxCustomEdit.DoEditProcessTab(Shift: TShiftState); +begin +end; + +procedure TcxCustomEdit.DoFocusChanged; + + function GetRootParent(AWnd: HWND): HWND; + begin + Result := AWnd; + while (Result <> 0) and IsChildClassWindow(Result) do + Result := GetParent(Result); + end; + + function NeedValidate: Boolean; + var + AParentForm: TCustomForm; + begin + AParentForm := GetParentForm(Self); + Result := AParentForm <> nil; + if Result then + begin + with AParentForm do + Result := not Visible and (fsModal in FormState) and (ModalResult <> mrNone) and (ModalResult <> mrCancel); + Result := Result or not FFocused and HandleAllocated and (Parent is TCustomForm) and + (TCustomForm(Parent).ControlCount = 1) and (GetRootParent(Handle) = GetRootParent(GetFocus)); + end; + end; + +begin + UpdateDrawValue; + if NeedValidate then + ValidateEdit(False); +end; + +procedure TcxCustomEdit.DoHideEdit(AExit: Boolean); +begin + if IsDestroying or FValidateErrorProcessing then + Exit; + SaveModified; + try + LockChangeEvents(True); + try + if not ValidateEdit(True) then + Exit; + if not IsInplace and CanPostEditValue then + InternalPostEditValue; + finally + LockChangeEvents(False); + end; + if UpdateContentOnFocusChanging then + DataBinding.UpdateDisplayValue; + UpdateDrawValue; + ShortRefreshContainer(False); + RestoreModified; + try + if AExit then + inherited DoExit; + finally + ModifiedAfterEnter := False; + SaveModified; + end; + finally + RestoreModified; + end; +end; + +procedure TcxCustomEdit.DoOnValidate(var ADisplayValue: TcxEditValue; + var AErrorText: TCaption; var AError: Boolean); +begin + with Properties do + if Assigned(OnValidate) then + OnValidate(Self, ADisplayValue, AErrorText, AError); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnValidate) then + OnValidate(Self, ADisplayValue, AErrorText, AError); +end; + +procedure TcxCustomEdit.DoOnChange; +begin + with Properties do + if Assigned(OnChange) then + OnChange(Self); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnChange) then + OnChange(Self); +end; + +procedure TcxCustomEdit.DoOnEditValueChanged; +begin + with Properties do + if Assigned(OnEditValueChanged) then + OnEditValueChanged(Self); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnEditValueChanged) then + OnEditValueChanged(Self); +end; + +procedure TcxCustomEdit.DoPostEditValue; +begin + if Assigned(FOnPostEditValue) then + FOnPostEditValue(Self); +end; + +procedure TcxCustomEdit.DoShowEdit; +begin + SaveModified; + try + inherited DoEnter; + if UpdateContentOnFocusChanging then + DataBinding.UpdateDisplayValue; + if ActiveProperties.IsResetEditClass then + PrevEditValue := EditValue; + if UpdateContentOnFocusChanging then + SynchronizeDisplayValue; + finally + RestoreModified; + SetModifiedAfterEnterValue(False); + end; +end; + +procedure TcxCustomEdit.EditingChanged; +begin +end; + +procedure TcxCustomEdit.EnableValidate; +begin + Dec(FLockValidate); +end; + +procedure TcxCustomEdit.FillSizeProperties(var AEditSizeProperties: TcxEditSizeProperties); +begin + AEditSizeProperties := DefaultcxEditSizeProperties; + AEditSizeProperties.MaxLineCount := 1; + AEditSizeProperties.Width := Width; +end; + +function TcxCustomEdit.GetClearValue: TcxEditValue; +begin + Result := Null; +end; + +class function TcxCustomEdit.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxEditDataBinding; +end; + +function TcxCustomEdit.GetDefaultButtonVisibleIndex: Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Length(ViewInfo.ButtonsInfo) - 1 do + if ViewInfo.ButtonsInfo[I].Data.Default then + begin + Result := I; + Break; + end; +end; + +function TcxCustomEdit.GetDisplayValue: string; +begin + Result := ''; +end; + +function TcxCustomEdit.GetEditDataClass: TcxCustomEditDataClass; +begin + Result := nil; +end; + +function TcxCustomEdit.GetEditingValue: TcxEditValue; +begin + if Focused and not IsEditValidated and ModifiedAfterEnter then + Result := InternalGetEditingValue + else + Result := EditValue; +end; + +function TcxCustomEdit.GetInnerEditClass: TControlClass; +begin + Result := nil; +end; + +function TcxCustomEdit.HandleMouseWheel(Shift: TShiftState): Boolean; +begin + Result := not IsInplace or ActiveProperties.UseMouseWheel or ([ssCtrl] * Shift <> []); +end; + +procedure TcxCustomEdit.HandleValidationError(const AErrorText: string; + ACanAbortExecution: Boolean); +var + AControl: TWinControl; +begin + if not CanFocus then + IsEditValidated := True + else + if Visible then + begin + if not Focused then + begin + if HasInnerEdit then + AControl := InnerEdit.Control + else + AControl := Self; + FValidateErrorProcessing := True; + try + AControl.SetFocus; + finally + FValidateErrorProcessing := False; + end; + end; + SelectAll; + end; + if ActiveProperties.BeepOnError then + Beep; + if AErrorText <> '' then + raise EcxEditValidationError.Create(AErrorText) + else + if ACanAbortExecution then + Abort; +end; + +function TcxCustomEdit.HasInnerEdit: Boolean; +begin + Result := Assigned(InnerEdit); +end; + +procedure TcxCustomEdit.Initialize; + + procedure CreateDblClickTimer; + begin + FDblClickTimer := TcxTimer.Create(nil); + with FDblClickTimer do + begin + Enabled := False; + Interval := GetDblClickInterval; + OnTimer := DblClickTimerHandler; + end; + end; + +begin + FChangeEventsCatcher := TcxEditChangeEventsCatcher.Create(Self); + FProperties := GetPropertiesClass.Create(Self); + InitContentParams; + + ControlStyle := ControlStyle + [csSetCaption, csCaptureMouse]; + TabStop := True; + + FInnerEdit := CreateInnerEdit; + if HasInnerEdit then + begin + InitializeInnerEdit; + InnerControl := FInnerEdit.Control; + end; + SetReplicatableFlag; + + FDataBinding := GetDataBindingClass.Create(Self); + + FAutoSize := not IsInplace; + FCaptureButtonVisibleIndex := -1; + FEditValue := Null; + FLockValidate := 0; + FUpdate := False; + + Properties.OnPropertiesChanged := PropertiesChanged; + + if IsInplace then + begin + Keys := Keys + [kAll, kArrows]; + if GetInnerEditClass = nil then + Keys := Keys + [kTab]; + end; + CreateDblClickTimer; + if not IsInplace then + Properties.FIDefaultValuesProvider := FDataBinding.IDefaultValuesProvider; + + ViewInfo.FEdit := Self; + FIsJustCreated := True; +end; + +procedure TcxCustomEdit.InitializeEditData; +begin +end; + +procedure TcxCustomEdit.InitializeInnerEdit; +begin + InnerEdit.Parent := Self; + if ActiveProperties.HasDisplayValue then + InnerEdit.OnChange := ChangeHandler; + TControlAccess(InnerEdit.Control).ParentShowHint := False; +end; + +procedure TcxCustomEdit.InitializeViewData(AViewData: TcxCustomEditViewData); +begin + AViewData.Enabled := Enabled; + AViewData.Focused := Focused; + if HScrollBarVisible then + AViewData.HScrollBar := HScrollBar + else + AViewData.HScrollBar := nil; + AViewData.InnerEdit := InnerEdit; + AViewData.IsDesigning := IsDesigning; + if VScrollBarVisible then + AViewData.VScrollBar := VScrollBar + else + AViewData.VScrollBar := nil; +end; + +function TcxCustomEdit.InternalDoEditing: Boolean; +begin + Result := True; +end; + +function TcxCustomEdit.InternalFocused: Boolean; +begin + Result := not ActiveProperties.IsEditValueConversionDependOnFocused or Focused; +end; + +function TcxCustomEdit.IsChildWindow(AWnd: THandle): Boolean; +begin + Result := cxContainer.IsChildWindow(Self, AWnd); +end; + +function TcxCustomEdit.IsEditClass: Boolean; +begin + Result := False; +end; + +function TcxCustomEdit.IsRepositoryItemAcceptable( + ARepositoryItem: TcxEditRepositoryItem): Boolean; +begin + Result := (ARepositoryItem = nil) or + ARepositoryItem.Properties.InheritsFrom(GetPropertiesClass); +end; + +procedure TcxCustomEdit.LockChangeEvents(ALock: Boolean; AInvokeChangedOnUnlock: Boolean = True); +begin + ChangeEventsCatcher.Lock(ALock, AInvokeChangedOnUnlock); +end; + +procedure TcxCustomEdit.LockClick(ALock: Boolean); +begin + if ALock then + Inc(FClickLockCount) + else + if FClickLockCount > 0 then + Dec(FClickLockCount); +end; + +procedure TcxCustomEdit.LockEditValueChanging(ALock: Boolean); +begin + if ALock then + Inc(FEditValueChangingLockCount) + else + if FEditValueChangingLockCount > 0 then + Dec(FEditValueChangingLockCount); +end; + +function TcxCustomEdit.InternalGetActiveProperties: TcxCustomEditProperties; +begin + if FRepositoryItem = nil then + Result := FProperties + else + begin + Result := FRepositoryItem.Properties; + Result.FIDefaultValuesProvider := DataBinding.IDefaultValuesProvider; + end; +end; + +function TcxCustomEdit.InternalGetEditingValue: TcxEditValue; +begin + Result := EditValue; +end; + +procedure TcxCustomEdit.InternalPostEditValue(AValidateEdit: Boolean = False); +var + APrevKeyboardAction: Boolean; +begin + if AValidateEdit then + begin + APrevKeyboardAction := KeyboardAction; + KeyboardAction := False; + try + if not ValidateEdit(True) then + Exit; + finally + KeyboardAction := APrevKeyboardAction; + end; + end; + + try + BeforePosting; + try + if IsInplace then + begin + DoPostEditValue; + EditModified := False; + end + else + if DataBinding.Modified then + DataBinding.StoredValue := EditValue; + finally + AfterPosting; + end; + except + if not IsInplace then + begin + HandleValidationError('', False); + raise; + end; + end; +end; + +procedure TcxCustomEdit.InternalSetDisplayValue(const Value: TcxEditValue); +begin +end; + +procedure TcxCustomEdit.InternalSetEditValue(const Value: TcxEditValue; + AValidateEditValue: Boolean); +var + AEditValueChanged: Boolean; +begin + if FKeyboardAction and not DoEditing then + Exit; + AEditValueChanged := False; + if ActiveProperties.CanCompareEditValue then + AEditValueChanged := not cxEditVarEquals(Value, FEditValue); + FEditValue := Value; + SynchronizeDisplayValue; + if FKeyboardAction then + ModifiedAfterEnter := True + else + EditModified := False; + if AEditValueChanged then + begin + DoEditValueChanged; + if not ActiveProperties.HasDisplayValue then + DoChange; + end; +end; + +procedure TcxCustomEdit.InternalValidateDisplayValue(const ADisplayValue: TcxEditValue); +begin + SaveModified; + InternalSetDisplayValue(ADisplayValue); + RestoreModified; +end; + +function TcxCustomEdit.IsActiveControl: Boolean; +var + AParentForm: TCustomForm; +begin + Result := Focused; + if Result then + Exit; + AParentForm := GetParentForm(Self); + if AParentForm <> nil then + begin + Result := AParentForm.ActiveControl = Self; + Result := Result or HasInnerEdit and (AParentForm.ActiveControl = InnerEdit.Control); + end; +end; + +function TcxCustomEdit.IsButtonDC(ADC: THandle): Boolean; +begin + Result := False; +end; + +function TcxCustomEdit.IsClickEnabledDuringLoading: Boolean; +begin + Result := False; +end; + +function TcxCustomEdit.IsDBEdit: Boolean; +begin + Result := DataBinding.IDefaultValuesProvider.IsDataStorage; +end; + +function TcxCustomEdit.IsDBEditPaintCopyDrawing: Boolean; +begin + Result := IsDBEdit and (csPaintCopy in ControlState); +end; + +function TcxCustomEdit.IsEditorKey(Key: Word; Shift: TShiftState): Boolean; +begin + Result := (GetDefaultButtonVisibleIndex <> -1) and + (ShortCut(Key, Shift) = ActiveProperties.ClickKey); +end; + +function TcxCustomEdit.IsEditValueStored: Boolean; +begin + Result := not VarIsNull(EditValue); +end; + +function TcxCustomEdit.IsNativeBackground: Boolean; +begin + Result := False; +end; + +function TcxCustomEdit.IsOnChangeEventAssigned: Boolean; +begin + Result := Assigned(Properties.OnChange) or + Assigned(ActiveProperties.OnChange); +end; + +function TcxCustomEdit.IsOnEditValueChangedEventAssigned: Boolean; +begin + Result := Assigned(Properties.OnEditValueChanged) or + Assigned(ActiveProperties.OnEditValueChanged); +end; + +function TcxCustomEdit.IsOnValidateEventAssigned: Boolean; +begin + Result := Assigned(Properties.OnValidate) or + Assigned(ActiveProperties.OnValidate); +end; + +function TcxCustomEdit.IsResetEditClass: Boolean; +begin + Result := IsDBEdit or ActiveProperties.IsResetEditClass; +end; + +function TcxCustomEdit.IsSpecialKey(Key: Word; Shift: TShiftState): Boolean; +var + AShortCut: TShortCut; +begin + AShortCut := ShortCut(Key, Shift); + Result := (ShortCut(Key, Shift) = ActiveProperties.ClearKey) or + (GetDefaultButtonVisibleIndex <> -1) and (AShortCut = ActiveProperties.ClickKey); +end; + +function TcxCustomEdit.IsTransparent: Boolean; +begin + Result := not IsInplace and Transparent; +end; + +function TcxCustomEdit.IsValidChar(AChar: Char): Boolean; +begin + with ActiveProperties do + Result := (IDefaultValuesProvider = nil) or + IDefaultValuesProvider.IsValidChar(AChar) or + IDefaultValuesProvider.IsOnSetTextAssigned; +end; + +function TcxCustomEdit.NeedsInvokeAfterKeyDown(AKey: Word; + AShift: TShiftState): Boolean; +begin + Result := False; +end; + +procedure TcxCustomEdit.PaintCopyDraw; +var + AViewInfo: TcxCustomEditViewInfo; + AViewData: TcxCustomEditViewData; +begin + SetVisibleBoundsClipRect; + AViewInfo := TcxCustomEditViewInfo(Properties.GetViewInfoClass.Create); + AViewInfo.FEdit := Self; + AViewData := TcxCustomEditViewData(CreateViewData); + AViewData.EditValueToDrawValue(Canvas, DataBinding.StoredValue, AViewInfo); + AViewData.Calculate(Canvas, GetControlRect(Self), Point(-1, -1), cxmbNone, + [], AViewInfo, False); + AViewInfo.Paint(Canvas); + FreeAndNil(AViewInfo); + FreeAndNil(AViewData); + Canvas.ExcludeClipRect(GetControlRect(Self)); +end; + +procedure TcxCustomEdit.PrepareDisplayValue(const AEditValue: TcxEditValue; + var DisplayValue: TcxEditValue; AEditFocused: Boolean); +begin + ActiveProperties.PrepareDisplayValue(AEditValue, DisplayValue, AEditFocused); +end; + +procedure TcxCustomEdit.ProcessViewInfoChanges(APrevViewInfo: TcxCustomEditViewInfo; AIsMouseDownUpEvent: Boolean); +begin + if (APrevViewInfo.PressedButton <> ViewInfo.PressedButton) or + (APrevViewInfo.SelectedButton <> ViewInfo.SelectedButton) then + begin + if APrevViewInfo.PressedButton <> -1 then + if APrevViewInfo.PressedButton = ViewInfo.SelectedButton then + begin + DoButtonUp(APrevViewInfo.PressedButton); + DoButtonClick(APrevViewInfo.PressedButton); + end + else + DoButtonUp(APrevViewInfo.PressedButton); + if (ViewInfo.PressedButton <> -1) and (APrevViewInfo.PressedButton = -1) then + DoButtonDown(ViewInfo.PressedButton); + end; +end; + +procedure TcxCustomEdit.PropertiesChanged(Sender: TObject); +begin + FIsEditValidated := False; + UpdateInnerEditReadOnly; + if ModifiedAfterEnter and RealReadOnly then + ModifiedAfterEnter := False; + if ActiveProperties.Transparent then + Transparent := True; + ShortRefreshContainer(False); +end; + +function TcxCustomEdit.PropertiesChangeLocked: Boolean; +begin + Result := not IsDestroying; + if Result then + Result := (GetInnerEditClass = nil) or (InnerEdit <> nil); + Result := not Result; +end; + +function TcxCustomEdit.RealReadOnly: Boolean; +begin + Result := ActiveProperties.ReadOnly or not DataBinding.IsDataAvailable; +end; + +procedure TcxCustomEdit.RepositoryItemAssigned; +begin +end; + +procedure TcxCustomEdit.RepositoryItemAssigning; +begin +end; + +procedure TcxCustomEdit.ResetEditValue; +begin + if FModifiedAfterEnter and ActiveProperties.IsResetEditClass then + begin + LockChangeEvents(True); + try + SetModifiedAfterEnterValue(False); + if IsDBEdit then + InternalEditValue := DataBinding.StoredValue + else + InternalEditValue := FPrevEditValue; + EditModified := True; + SelectAll; + if ActiveProperties.ImmediatePost and CanPostEditValue then + InternalPostEditValue; + finally + LockChangeEvents(False); + end; + end; +end; + +procedure TcxCustomEdit.RestoreModified; +begin + with FPrevModifiedList[Length(FPrevModifiedList) - 1] do + begin + FModified := Modified; + SetModifiedAfterEnterValue(ModifiedAfterEnter); + end; + SetLength(FPrevModifiedList, Length(FPrevModifiedList) - 1); +end; + +procedure TcxCustomEdit.SaveModified; +begin + SetLength(FPrevModifiedList, Length(FPrevModifiedList) + 1); + with FPrevModifiedList[Length(FPrevModifiedList) - 1] do + begin + Modified := FModified; + ModifiedAfterEnter := FModifiedAfterEnter; + end; +end; + +function TcxCustomEdit.SendActivationKey(Key: Char): Boolean; +begin + Result := True; +end; + +function TcxCustomEdit.SetDisplayText(const Value: string): Boolean; +begin + Result := False; +end; + +procedure TcxCustomEdit.SetEditAutoSize(Value: Boolean); +begin + if (Value <> FAutoSize) and not IsInplace then + begin + FAutoSize := Value; + if Value then + begin + CheckHandle; + SetSize; + ShortRefreshContainer(False); + end; + end; +end; + +procedure TcxCustomEdit.SetInternalDisplayValue(Value: TcxEditValue); +begin +end; + +procedure TcxCustomEdit.SetEditValue(const Value: TcxEditValue); +begin + if FEditValueChangingLockCount > 0 then + Exit; + LockClick(True); + try + if not(FKeyboardAction and not DoEditing) then + InternalSetEditValue(Value, True); + finally + LockClick(False); + end; +end; + +procedure TcxCustomEdit.SetInternalEditValue(const Value: TcxEditValue); +begin + if FEditValueChangingLockCount > 0 then + Exit; + if not(FKeyboardAction and not DoEditing) then + InternalSetEditValue(Value, True); +end; + +procedure TcxCustomEdit.SynchronizeDisplayValue; +begin +end; + +procedure TcxCustomEdit.SynchronizeEditValue; +begin +end; + +function TcxCustomEdit.TabsNeeded: Boolean; +begin + Result := IsInplace; +end; + +function TcxCustomEdit.UpdateContentOnFocusChanging: Boolean; +begin + Result := True; +end; + +procedure TcxCustomEdit.UpdateDrawValue; +begin +end; + +procedure TcxCustomEdit.UpdateInnerEditReadOnly; +begin + if not PropertiesChangeLocked and (InnerEdit <> nil) then + InnerEdit.ReadOnly := RealReadOnly; +end; + +function TcxCustomEdit.ValidateKeyDown(var Key: Word; Shift: TShiftState): Boolean; +begin + Result := not(not DataBinding.Modified and CanKeyDownModifyEdit(Key, Shift) and + not DoEditing); +end; + +function TcxCustomEdit.ValidateKeyPress(var Key: Char): Boolean; +begin + if IsTextChar(Key) and not IsValidChar(Key) then + begin + Key := #0; + Beep; + end + else + if not DataBinding.Modified and CanKeyPressModifyEdit(Key) then + if not DoEditing then + Key := #0 + else + Key := Key; + Result := Key <> #0; +end; + +function TcxCustomEdit.WantNavigationKeys: Boolean; +begin + Result := False; +end; + +procedure TcxCustomEdit.LockedInnerEditWindowProc(var Message: TMessage); +begin + with Message do + Result := CallWindowProc(FInnerEditDefWindowProc, Handle, Msg, WParam, LParam); +end; + +procedure TcxCustomEdit.LockInnerEditRepainting; +begin + if not HasInnerEdit then + Exit; + {$IFDEF DELPHI6} + FObjectInstance := Classes.MakeObjectInstance(LockedInnerEditWindowProc); + {$ELSE} + FObjectInstance := Forms.MakeObjectInstance(LockedInnerEditWindowProc); + {$ENDIF} + FInnerEditDefWindowProc := Pointer(GetWindowLong(InnerEdit.Control.Handle, GWL_WNDPROC)); + SetWindowLong(InnerEdit.Control.Handle, GWL_WNDPROC, + Integer(FObjectInstance)); +end; + +procedure TcxCustomEdit.UnlockInnerEditRepainting; +begin + if not HasInnerEdit then + Exit; + SetWindowLong(InnerEdit.Control.Handle, GWL_WNDPROC, Integer(FInnerEditDefWindowProc)); +{$IFDEF DELPHI6} + Classes.FreeObjectInstance(FObjectInstance); +{$ELSE} + Forms.FreeObjectInstance(FObjectInstance); +{$ENDIF} +end; + +// IcxEditRepositoryItemListener +procedure TcxCustomEdit.RepositoryItemListenerItemRemoved(Sender: TcxEditRepositoryItem); +begin + FRepositoryItem := nil; +end; + +procedure TcxCustomEdit.RepositoryItemListenerPropertiesChanged(Sender: TcxEditRepositoryItem); +begin + if ComponentState * [csLoading, csDestroying] = [] then + PropertiesChanged(Sender.Properties); +end; + +function TcxCustomEdit.GetEditValue: TcxEditValue; +begin + Result := FEditValue; +end; + +function TcxCustomEdit.CheckButtonShortCuts(AKey: Integer): Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to High(ViewInfo.ButtonsInfo) do + with ViewInfo.ButtonsInfo[I] do + if (Data.State <> ebsDisabled) and IsAccel(AKey, Data.Caption) then + begin + Result := True; + DoButtonClick(I); + Break; + end; +end; + +procedure TcxCustomEdit.DblClickTimerHandler(Sender: TObject); +begin + FDblClickTimer.Enabled := False; +end; + +procedure TcxCustomEdit.DoClearEditData(AEditData: TcxCustomEditData); +begin + if (FEditData = AEditData) and (FEditData <> nil) and FEditData.Cleared then + begin + InitializeEditData; + FEditData.Cleared := False; + end; +end; + +function TcxCustomEdit.GetActiveProperties: TcxCustomEditProperties; +begin + Result := TcxCustomEditProperties(InternalGetActiveProperties); +end; + +function TcxCustomEdit.GetEditActiveStyle: TcxCustomEditStyle; +begin + Result := TcxCustomEditStyle(inherited ActiveStyle); +end; + +function TcxCustomEdit.GetHeight: Integer; +begin + CheckHandle; + Result := inherited Height; +end; + +function TcxCustomEdit.GetInternalStyle(AState: TcxContainerStateItem): TcxCustomEditStyle; +begin + Result := TcxCustomEditStyle(FStyles[AState]); +end; + +function TcxCustomEdit.GetStyle: TcxEditStyle; +begin + Result := TcxEditStyle(FStyles.Style); +end; + +function TcxCustomEdit.GetStyleDisabled: TcxEditStyle; +begin + Result := TcxEditStyle(FStyles.StyleDisabled); +end; + +function TcxCustomEdit.GetStyleFocused: TcxEditStyle; +begin + Result := TcxEditStyle(FStyles.StyleFocused); +end; + +function TcxCustomEdit.GetStyleHot: TcxEditStyle; +begin + Result := TcxEditStyle(FStyles.StyleHot); +end; + +function TcxCustomEdit.GetViewInfo: TcxCustomEditViewInfo; +begin + Result := TcxCustomEditViewInfo(FViewInfo); +end; + +procedure TcxCustomEdit.InitContentParams; +var + AViewData: TcxCustomEditViewData; +begin + AViewData := CreateViewData; + try + AViewData.InitEditContentParams(ContentParams); + FIsContentParamsInitialized := True; + finally + FreeAndNil(AViewData); + end; +end; + +procedure TcxCustomEdit.InternalCanResize(var ANewWidth, ANewHeight: Integer); +var + AEditSizeProperties: TcxEditSizeProperties; + ASize: TSize; + AViewData: TcxCustomEditViewData; +begin + if CanAutoSize then + begin + FillSizeProperties(AEditSizeProperties); + AViewData := TcxCustomEditViewData(CreateViewData); + try + ASize := AViewData.GetEditSize(cxScreenCanvas, EditValue, AEditSizeProperties); + finally + FreeAndNil(AViewData); + end; + + if CanAutoWidth and not (Align in [alTop, alBottom, alClient{$IFDEF DELPHI6}, alCustom{$ENDIF}]) then + ANewWidth := ASize.cx; + if not (Align in [alLeft, alRight, alClient{$IFDEF DELPHI6}, alCustom{$ENDIF}]) then + ANewHeight := ASize.cy; + end; +end; + +procedure TcxCustomEdit.ReadHeight(Reader: TReader); +begin + Height := Reader.ReadInteger; +end; + +procedure TcxCustomEdit.ReadWidth(Reader: TReader); +begin + Width := Reader.ReadInteger; +end; + +procedure TcxCustomEdit.SetDataBinding(Value: TcxEditDataBinding); +begin + FDataBinding.Assign(Value.GetEditDataBindingInstance); +end; + +procedure TcxCustomEdit.SetHeight(Value: Integer); +begin + inherited Height := Value; +end; + +procedure TcxCustomEdit.SetInternalStyle(AState: TcxContainerStateItem; + Value: TcxCustomEditStyle); +begin + FStyles[AState] := Value; +end; + +procedure TcxCustomEdit.SetModified(Value: Boolean); +begin + FModified := Value; + if not Value then + SetModifiedAfterEnterValue(False); +end; + +procedure TcxCustomEdit.SetModifiedAfterEnter(Value: Boolean); +begin + SetModifiedAfterEnterValue(Value); + if Value then + begin + FIsEditValidated := False; + FModified := True; + end; +end; + +procedure TcxCustomEdit.SetModifiedAfterEnterValue(Value: Boolean); +begin + FModifiedAfterEnter := Value; +end; + +procedure TcxCustomEdit.SetProperties(Value: TcxCustomEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomEdit.SetRepositoryItem(Value: TcxEditRepositoryItem); +begin + if Value = FRepositoryItem then + Exit; + if not IsRepositoryItemAcceptable(Value) then + raise EcxEditError.Create(cxGetResourceString(@cxSEditInvalidRepositoryItem)); + RepositoryItemAssigning; + if FRepositoryItem <> nil then + FRepositoryItem.RemoveListener(Self); + + FRepositoryItem := Value; + if FRepositoryItem <> nil then + FRepositoryItem.AddListener(Self); + if FRepositoryItem = nil then + begin + if ComponentState * [csLoading, csDestroying] = [] then + Properties.OnPropertiesChanged := PropertiesChanged; + Properties.IDefaultValuesProvider := DataBinding.IDefaultValuesProvider; + end + else + begin + FProperties.FIDefaultValuesProvider := nil; + RepositoryItemListenerPropertiesChanged(FRepositoryItem); + TcxCustomEditProperties(FProperties).OnPropertiesChanged := nil; + end; + RepositoryItemAssigned; +end; + +procedure TcxCustomEdit.SetReplicatableFlag; + + procedure SetControlReplicatable(AControl: TControl); + begin + AControl.ControlStyle := AControl.ControlStyle + [csReplicatable]; + end; + + procedure SetReplicatable(AControl: TControl); + var + I: Integer; + begin + SetControlReplicatable(AControl); + if AControl is TWinControl then + for I := 0 to TWinControl(AControl).ControlCount - 1 do + SetReplicatable(TWinControl(AControl).Controls[I]); + end; + +begin + SetReplicatable(Self); + if NeedsScrollBars then + begin + SetControlReplicatable(HScrollBar); + SetControlReplicatable(VScrollBar); + SetControlReplicatable(SizeGrip); + end; +end; + +procedure TcxCustomEdit.SetStyle(Value: TcxEditStyle); +begin + FStyles.Style := Value; +end; + +procedure TcxCustomEdit.SetStyleDisabled(Value: TcxEditStyle); +begin + FStyles.StyleDisabled := Value; +end; + +procedure TcxCustomEdit.SetStyleFocused(Value: TcxEditStyle); +begin + FStyles.StyleFocused := Value; +end; + +procedure TcxCustomEdit.SetStyleHot(Value: TcxEditStyle); +begin + FStyles.StyleHot := Value; +end; + +procedure TcxCustomEdit.SetTransparent(Value: Boolean); +begin + if Value <> FTransparent then + begin + FTransparent := Value; + ShortRefreshContainer(False); + end; +end; + +procedure TcxCustomEdit.WriteHeight(Writer: TWriter); +begin + Writer.WriteInteger(Height); +end; + +procedure TcxCustomEdit.WriteWidth(Writer: TWriter); +begin + Writer.WriteInteger(Width); +end; + +function TcxCustomEdit.GetHintText(APart: Integer): string; +begin + Result := ViewInfo.GetHintText(APart); + if (Length(Result) = 0) and ShowHint then + Result := Hint; +end; + +procedure TcxCustomEdit.WMCopy(var Message: TMessage); +begin + CopyToClipboard; +end; + +procedure TcxCustomEdit.WMCut(var Message: TMessage); +begin + KeyboardAction := True; + try + if (not ActiveProperties.ReadOnly) and DataBinding.IsDataAvailable then + CutToClipboard + else + CopyToClipboard; + finally + KeyboardAction := False; + end; +end; + +procedure TcxCustomEdit.CMHintShow(var Message: TCMHintShow); +var + APart: Integer; +begin + with Message.HintInfo^ do + begin + APart := ViewInfo.GetPart(CursorPos); + if APart <> ecpNone then + begin + HintStr := GetShortHint(GetHintText(APart)); + CursorRect := ViewInfo.GetPartRect(APart); + end + else + Message.Result := -1; + end; +end; + +procedure TcxCustomEdit.WMPaste(var Message: TMessage); +begin + if (not ActiveProperties.ReadOnly) and DataBinding.IsDataAvailable then + begin + KeyboardAction := True; + try + PasteFromClipboard; + finally + KeyboardAction := False; + end; + end; +end; + +procedure TcxCustomEdit.CMDialogChar(var Message: TCMDialogChar); +begin + if CheckButtonShortCuts(Message.CharCode) then + Message.Result := 1 + else + inherited; +end; + +procedure TcxCustomEdit.CMShowingChanged(var Message: TMessage); +begin + inherited; + if Showing then + SetSize; +end; + +{ TcxEditAlignment } + +constructor TcxEditAlignment.Create(AOwner: TPersistent); +begin + inherited Create; + FOwner := AOwner; + FHorz := cxEditDefaultHorzAlignment; + FVert := cxEditDefaultVertAlignment; +end; + +procedure TcxEditAlignment.Assign(Source: TPersistent); +begin + if Source is TcxEditAlignment then + with Source as TcxEditAlignment do + begin + Self.FVert := FVert; + Self.FHorz := FHorz; + Self.FIsHorzAssigned := FIsHorzAssigned; + Self.DoChanged; + end + else + inherited Assign(Source); +end; + +function TcxEditAlignment.IsHorzStored: Boolean; +begin + Result := FIsHorzAssigned; +end; + +function TcxEditAlignment.IsVertStored: Boolean; +begin + Result := Vert <> cxEditDefaultVertAlignment; +end; + +procedure TcxEditAlignment.Reset; +begin + FIsHorzAssigned := False; + DoChanged; +end; + +procedure TcxEditAlignment.DoChanged; +begin + if Assigned(FOnChanged) then + FOnChanged(Self); +end; + +function TcxEditAlignment.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +procedure TcxEditAlignment.SetHorz(const Value: TcxEditHorzAlignment); +begin + if FIsHorzAssigned and (Value = FHorz) then + Exit; + FIsHorzAssigned := True; + FHorz := Value; + DoChanged; +end; + +procedure TcxEditAlignment.SetVert(const Value: TcxEditVertAlignment); +begin + if Value <> FVert then + begin + FVert := Value; + DoChanged; + end; +end; + +{ TcxInplaceEditList } + +constructor TcxInplaceEditList.Create; +begin + inherited Create; + if FInplaceEditLists = nil then + FInplaceEditLists := TList.Create; + FInplaceEditLists.Add(Self); +end; + +destructor TcxInplaceEditList.Destroy; +begin + FInplaceEditLists.Remove(Self); + if FInplaceEditLists.Count = 0 then + FreeAndNil(FInplaceEditLists); + DestroyItems; + inherited Destroy; +end; + +procedure TcxInplaceEditList.DisconnectProperties( + AProperties: TcxCustomEditProperties); +var + AItemIndex: Integer; +begin + AItemIndex := FindItem(AProperties, False); + if AItemIndex <> -1 then + FItems[AItemIndex].Properties := nil; +end; + +function TcxInplaceEditList.FindEdit(AProperties: TcxCustomEditProperties): TcxCustomEdit; +begin + Result := GetEdit(FindItem(AProperties, True)); +end; + +function TcxInplaceEditList.FindEdit(APropertiesClass: TcxCustomEditPropertiesClass): TcxCustomEdit; +begin + Result := GetEdit(FindItem(APropertiesClass)); +end; + +function TcxInplaceEditList.GetEdit(AProperties: TcxCustomEditProperties): TcxCustomEdit; +begin + Result := FindEdit(AProperties); + if Result = nil then + begin + Result := CreateEdit(TcxCustomEditPropertiesClass(AProperties.ClassType)); + SetLength(FItems, Count + 1); + with FItems[Count - 1] do + begin + Edit := Result; + Properties := AProperties; + end; + end; + InitEdit(Result, AProperties); +end; + +function TcxInplaceEditList.GetEdit(APropertiesClass: TcxCustomEditPropertiesClass): TcxCustomEdit; +begin + Result := FindEdit(APropertiesClass); + if Result = nil then + begin + Result := CreateEdit(APropertiesClass); + SetLength(FItems, Count + 1); + with FItems[Count - 1] do + begin + Edit := Result; + Properties := nil; + end; + end; +end; + +procedure TcxInplaceEditList.RemoveItem(AProperties: TcxCustomEditProperties); +begin + RemoveItem(FindItem(AProperties, False)); +end; + +procedure TcxInplaceEditList.RemoveItem(APropertiesClass: TcxCustomEditPropertiesClass); +var + AItemIndex: Integer; +begin + repeat + AItemIndex := FindItem(APropertiesClass); + RemoveItem(AItemIndex); + until AItemIndex = -1; +end; + +function TcxInplaceEditList.CreateEdit(APropertiesClass: TcxCustomEditPropertiesClass): TcxCustomEdit; +begin + Result := TcxCustomEditClass(APropertiesClass.GetContainerClass).Create(nil, True); + Result.Visible := False; +end; + +procedure TcxInplaceEditList.DestroyItems; +begin + while Count <> 0 do + RemoveItem(0); +end; + +function TcxInplaceEditList.FindItem(AProperties: TcxCustomEditProperties; + ACanUseFreeEditors: Boolean): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Count - 1 do + if FItems[I].Properties = AProperties then + begin + Result := I; + Break; + end; + if (Result = -1) and ACanUseFreeEditors then + begin + Result := FindItem(TcxCustomEditPropertiesClass(AProperties.ClassType)); + if Result <> -1 then + FItems[Result].Properties := AProperties; + end; +end; + +function TcxInplaceEditList.FindItem(APropertiesClass: TcxCustomEditPropertiesClass): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Count - 1 do + if (FItems[I].Properties = nil) and (FItems[I].Edit.ClassType = APropertiesClass.GetContainerClass) then + begin + Result := I; + Break; + end; +end; + +function TcxInplaceEditList.GetCount: Integer; +begin + Result := Length(FItems); +end; + +function TcxInplaceEditList.GetEdit(AItemIndex: Integer): TcxCustomEdit; +begin + if AItemIndex <> -1 then + Result := FItems[AItemIndex].Edit + else + Result := nil; +end; + +procedure TcxInplaceEditList.InitEdit(AEdit: TcxCustomEdit; + AProperties: TcxCustomEditProperties); +begin + AEdit.LockChangeEvents(True); + try + AEdit.Properties := AProperties; + finally + AEdit.LockChangeEvents(False, False); + end; +end; + +procedure TcxInplaceEditList.RemoveItem(AIndex: Integer); +begin + if AIndex <> -1 then + begin + FItems[AIndex].Edit.Parent := nil; + FItems[AIndex].Edit.Free; + if AIndex < Count - 1 then + Move(FItems[AIndex + 1], FItems[AIndex], SizeOf(TcxEditListItem) * (Count - AIndex - 1)); + SetLength(FItems, Length(FItems) - 1); + end; +end; + +{ TcxDefaultEditStyleController } + +constructor TcxDefaultEditStyleController.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Inc(FDefaultEditStyleControllerCount); +end; + +destructor TcxDefaultEditStyleController.Destroy; + + procedure ResetDefaultEditStyleController; + begin + if DefaultEditStyleController <> nil then + begin + DefaultEditStyleController.RestoreStyles; + DefaultEditStyleController.OnStyleChanged := nil; + end; + end; + +begin + Dec(FDefaultEditStyleControllerCount); + if FDefaultEditStyleControllerCount = 0 then + ResetDefaultEditStyleController; + inherited Destroy; +end; + +procedure TcxDefaultEditStyleController.RestoreStyles; +begin + DefaultEditStyleController.RestoreStyles; +end; + +function TcxDefaultEditStyleController.GetEmulateStandardControlDrawing: Boolean; +begin + Result := cxEdit.EmulateStandardControlDrawing; +end; + +function TcxDefaultEditStyleController.GetInternalStyle( + AState: TcxContainerStateItem): TcxCustomEditStyle; +begin + Result := DefaultEditStyleController.Styles[AState]; +end; + +function TcxDefaultEditStyleController.GetOnStyleChanged: TNotifyEvent; +begin + Result := DefaultEditStyleController.OnStyleChanged; +end; + +function TcxDefaultEditStyleController.GetStyle: TcxEditStyle; +begin + Result := DefaultEditStyleController.Style; +end; + +function TcxDefaultEditStyleController.GetStyleDisabled: TcxEditStyle; +begin + Result := DefaultEditStyleController.StyleDisabled; +end; + +function TcxDefaultEditStyleController.GetStyleFocused: TcxEditStyle; +begin + Result := DefaultEditStyleController.StyleFocused; +end; + +function TcxDefaultEditStyleController.GetStyleHot: TcxEditStyle; +begin + Result := DefaultEditStyleController.StyleHot; +end; + +procedure TcxDefaultEditStyleController.SetEmulateStandardControlDrawing( + Value: Boolean); +begin + SetStandardControlDrawingEmulationMode(Value); +end; + +procedure TcxDefaultEditStyleController.SetInternalStyle( + AState: TcxContainerStateItem; Value: TcxCustomEditStyle); +begin + DefaultEditStyleController.Styles[AState] := Value; +end; + +procedure TcxDefaultEditStyleController.SetOnStyleChanged(Value: TNotifyEvent); +begin + DefaultEditStyleController.OnStyleChanged := Value; +end; + +procedure TcxDefaultEditStyleController.SetStyle(Value: TcxEditStyle); +begin + DefaultEditStyleController.Style := Value; +end; + +procedure TcxDefaultEditStyleController.SetStyleDisabled(Value: TcxEditStyle); +begin + DefaultEditStyleController.StyleDisabled := Value; +end; + +procedure TcxDefaultEditStyleController.SetStyleFocused(Value: TcxEditStyle); +begin + DefaultEditStyleController.StyleFocused := Value; +end; + +procedure TcxDefaultEditStyleController.SetStyleHot(Value: TcxEditStyle); +begin + DefaultEditStyleController.StyleHot := Value; +end; + +initialization + Screen.Cursors[crcxEditMouseWheel] := LoadCursor(HInstance, 'CXEDIT_MOUSEWHEEL'); + FDefaultEditStyleController := TcxEditStyleController.Create(nil); + cxContainerDefaultStyleController := FDefaultEditStyleController; + FCreatedEditPropertiesList := TList.Create; + cxFilterConsts.cxFilterGetResourceStringFunc := cxGetResourceString; + +finalization + FreeAndNil(FRegisteredEditProperties); + FreeAndNil(FDefaultEditRepository); + FreeAndNil(FCreatedEditPropertiesList); + cxContainerDefaultStyleController := nil; + FreeAndNil(FDefaultEditStyleController); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxEdit.res b/official/x.35/ExpressEditors Library 5/Sources/cxEdit.res new file mode 100644 index 00000000..81cce5f1 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Sources/cxEdit.res differ diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxEditConsts.pas b/official/x.35/ExpressEditors Library 5/Sources/cxEditConsts.pas new file mode 100644 index 00000000..584fe886 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxEditConsts.pas @@ -0,0 +1,166 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxEditConsts; + +interface + +resourcestring + cxSEditButtonCancel = 'Cancel'; + cxSEditButtonOK = 'OK'; + cxSEditDateConvertError = 'Could not convert to date'; + cxSEditInvalidRepositoryItem = 'The repository item is not acceptable'; + cxSEditNumericValueConvertError = 'Could not convert to numeric value'; + cxSEditPopupCircularReferencingError = 'Circular referencing is not allowed'; + cxSEditPostError = 'An error occured during posting edit value'; + cxSEditTimeConvertError = 'Could not convert to time'; + cxSEditValidateErrorText = 'Invalid input value. Use escape key to abandon changes'; + cxSEditValueOutOfBounds = 'Value out of bounds'; + + // TODO + cxSEditCheckBoxChecked = 'True'; + cxSEditCheckBoxGrayed = ''; + cxSEditCheckBoxUnchecked = 'False'; + cxSRadioGroupDefaultCaption = ''; + + cxSTextTrue = 'True'; + cxSTextFalse = 'False'; + + // blob + cxSBlobButtonOK = '&OK'; + cxSBlobButtonCancel = '&Cancel'; + cxSBlobButtonClose = '&Close'; + cxSBlobMemo = '(MEMO)'; + cxSBlobMemoEmpty = '(memo)'; + cxSBlobPicture = '(PICTURE)'; + cxSBlobPictureEmpty = '(picture)'; + + // popup menu items + cxSMenuItemCaptionCut = 'Cu&t'; + cxSMenuItemCaptionCopy = '&Copy'; + cxSMenuItemCaptionPaste = '&Paste'; + cxSMenuItemCaptionDelete = '&Delete'; + cxSMenuItemCaptionLoad = '&Load...'; + cxSMenuItemCaptionSave = 'Save &As...'; + + // date + cxSDatePopupClear = 'Clear'; + cxSDatePopupNow = 'Now'; + cxSDatePopupOK = 'OK'; + cxSDatePopupToday = 'Today'; + cxSDateError = 'Invalid Date'; + + // calculator + scxSCalcError = 'Error'; + + // HyperLink + scxSHyperLinkPrefix = 'http://'; + scxSHyperLinkDoubleSlash = '//'; + + // navigator + cxNavigatorHint_First = 'First record'; + cxNavigatorHint_Prior = 'Prior record'; + cxNavigatorHint_PriorPage = 'Prior page'; + cxNavigatorHint_Next = 'Next record'; + cxNavigatorHint_NextPage = 'Next page'; + cxNavigatorHint_Last = 'Last record'; + cxNavigatorHint_Insert = 'Insert record'; + cxNavigatorHint_Append = 'Append record'; + cxNavigatorHint_Delete = 'Delete record'; + cxNavigatorHint_Edit = 'Edit record'; + cxNavigatorHint_Post = 'Post edit'; + cxNavigatorHint_Cancel = 'Cancel edit'; + cxNavigatorHint_Refresh = 'Refresh data'; + cxNavigatorHint_SaveBookmark = 'Save Bookmark'; + cxNavigatorHint_GotoBookmark = 'Goto Bookmark'; + cxNavigatorHint_Filter = 'Filter data'; + cxNavigator_DeleteRecordQuestion = 'Delete record?'; + + // edit repository + scxSEditRepositoryBlobItem = 'BlobEdit|Represents the BLOB editor'; + scxSEditRepositoryButtonItem = 'ButtonEdit|Represents an edit control with embedded buttons'; + scxSEditRepositoryCalcItem = 'CalcEdit|Represents an edit control with a dropdown calculator window'; + scxSEditRepositoryCheckBoxItem = 'CheckBox|Represents a check box control that allows selecting an option'; + scxSEditRepositoryComboBoxItem = 'ComboBox|Represents the combo box editor'; + scxSEditRepositoryCurrencyItem = 'CurrencyEdit|Represents an editor enabling editing currency data'; + scxSEditRepositoryDateItem = 'DateEdit|Represents an edit control with a dropdown calendar'; + scxSEditRepositoryHyperLinkItem = 'HyperLink|Represents a text editor with hyperlink functionality'; + scxSEditRepositoryImageComboBoxItem = 'ImageComboBox|Represents an editor displaying the list of images and text strings within the dropdown window'; + scxSEditRepositoryImageItem = 'Image|Represents an image editor'; + scxSEditRepositoryLookupComboBoxItem = 'LookupComboBox|Represents a lookup combo box control'; + scxSEditRepositoryMaskItem = 'MaskEdit|Represents a generic masked edit control.'; + scxSEditRepositoryMemoItem = 'Memo|Represents an edit control that allows editing memo data'; + scxSEditRepositoryMRUItem = 'MRUEdit|Represents a text editor displaying the list of most recently used items (MRU) within a dropdown window'; + scxSEditRepositoryPopupItem = 'PopupEdit|Represents an edit control with a dropdown list'; + scxSEditRepositorySpinItem = 'SpinEdit|Represents a spin editor'; + scxSEditRepositoryRadioGroupItem = 'RadioGroup|Represents a group of radio buttons'; + scxSEditRepositoryTextItem = 'TextEdit|Represents a single line text editor'; + scxSEditRepositoryTimeItem = 'TimeEdit|Represents an editor displaying time values'; + + scxRegExprLine = 'Line'; + scxRegExprChar = 'Char'; + scxRegExprNotAssignedSourceStream = 'The source stream is not assigned'; + scxRegExprEmptySourceStream = 'The source stream is empty'; + scxRegExprCantUsePlusQuantifier = 'The ''+'' quantifier cannot be applied here'; + scxRegExprCantUseStarQuantifier = 'The ''*'' quantifier cannot be applied here'; + scxRegExprCantCreateEmptyAlt = 'The alternative should not be empty'; + scxRegExprCantCreateEmptyBlock = 'The block should not be empty'; + scxRegExprIllegalSymbol = 'Illegal ''%s'''; + scxRegExprIllegalQuantifier = 'Illegal quantifier ''%s'''; + scxRegExprNotSupportQuantifier = 'The parameter quantifiers are not supported'; + scxRegExprIllegalIntegerValue = 'Illegal integer value'; + scxRegExprTooBigReferenceNumber = 'Too big reference number'; + scxRegExprCantCreateEmptyEnum = 'Can''t create empty enumeration'; + scxRegExprSubrangeOrder = 'The starting character of the subrange must be less than the finishing one'; + scxRegExprHexNumberExpected0 = 'Hexadecimal number expected'; + scxRegExprHexNumberExpected = 'Hexadecimal number expected but ''%s'' found'; + scxRegExprMissing = 'Missing ''%s'''; + scxRegExprUnnecessary = 'Unnecessary ''%s'''; + scxRegExprIncorrectSpace = 'The space character is not allowed after ''\'''; + scxRegExprNotCompiled = 'Regular expression is not compiled'; + scxRegExprIncorrectParameterQuantifier = 'Incorrect parameter quantifier'; + scxRegExprCantUseParameterQuantifier = 'The parameter quantifier cannot be applied here'; + + scxMaskEditRegExprError = 'Regular expression errors:'; + scxMaskEditInvalidEditValue = 'The edit value is invalid'; + scxMaskEditNoMask = 'None'; + scxMaskEditIllegalFileFormat = 'Illegal file format'; + scxMaskEditEmptyMaskCollectionFile = 'The mask collection file is empty'; + scxMaskEditMaskCollectionFiles = 'Mask collection files'; + cxSSpinEditInvalidNumericValue = 'Invalid numeric value'; + +implementation + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxEditDBRegisteredRepositoryItems.pas b/official/x.35/ExpressEditors Library 5/Sources/cxEditDBRegisteredRepositoryItems.pas new file mode 100644 index 00000000..22d40f85 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxEditDBRegisteredRepositoryItems.pas @@ -0,0 +1,373 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxEditDBRegisteredRepositoryItems; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + SysUtils, Classes, DB, cxClasses, cxGraphics, cxDropDownEdit, cxEdit, + cxDBEditRepository, cxEditRegisteredRepositoryItems, cxEditRepositoryItems; + +type + { TcxEditDBRegisteredRepositoryItems } + + TcxEditDBRegisteredRepositoryItems = class(TcxEditRegisteredRepositoryItems) + private + FCurrencyItems: TcxEditRegisteredRepositoryItemsDataArray; + FLookupItems: TcxEditRegisteredRepositoryItemsDataArray; + function GetCurrencyCount: Integer; + function GetLookupCount: Integer; + protected + { IcxEditRepositoryItemListener } + procedure ItemRemoved(Sender: TcxEditRepositoryItem); override; + + function Add(var AItems: TcxEditRegisteredRepositoryItemsDataArray; + AFieldType: TFieldType; AVersion: Integer; + ARepositoryItem: TcxEditRepositoryItem): Integer; reintroduce; + procedure Clear; + property CurrencyCount: Integer read GetCurrencyCount; + property LookupCount: Integer read GetLookupCount; + public + destructor Destroy; override; + function GetCurrencyItem: TcxEditRepositoryItem; + function GetItem(AFieldType: TFieldType): TcxEditRepositoryItem; reintroduce; + function GetItemByField(AField: TField): TcxEditRepositoryItem; // primary method + function GetLookupItem: TcxEditRepositoryItem; + procedure RegisterItem(AFieldType: TFieldType; AVersion: Integer; ARepositoryItem: TcxEditRepositoryItem); reintroduce; + procedure RegisterCurrencyItem(AVersion: Integer; ARepositoryItem: TcxEditRepositoryItem); + procedure RegisterLookupItem(AVersion: Integer; ARepositoryItem: TcxEditRepositoryItem); + procedure UnregisterItem(AFieldType: TFieldType; AVersion: Integer); reintroduce; + procedure UnregisterCurrencyItem(AVersion: Integer); + procedure UnregisterLookupItem(AVersion: Integer); + end; + +function GetDefaultEditDBRepositoryItems: TcxEditDBRegisteredRepositoryItems; + +implementation + +uses + TypInfo; + +var + DefaultDBEditRepositoryItems: TcxEditDBRegisteredRepositoryItems; + DBRepositoryCurrencyItemClass: TcxEditRepositoryItemClass = TcxEditRepositoryCurrencyItem; + DBRepositoryItemClasses: array[TFieldType] of TcxEditRepositoryItemClass = ( + nil, // ftUnknown + nil, // ftString + nil, // ftSmallint + nil, // ftInteger + nil, // ftWord + TcxEditRepositoryCheckBoxItem, // ftBoolean + nil, // ftFloat + nil, // ftCurrency + nil, // ftBCD + TcxEditRepositoryDateItem, // ftDate + TcxEditRepositoryTimeItem, // ftTime + TcxEditRepositoryDateItem, // ftDateTime + TcxEditRepositoryBlobItem, // ftBytes + TcxEditRepositoryBlobItem, // ftVarBytes + nil, // ftAutoInc + TcxEditRepositoryBlobItem, // ftBlob + TcxEditRepositoryMemoItem, // ftMemo + TcxEditRepositoryImageItem, // ftGraphic + TcxEditRepositoryBlobItem, // ftFmtMemo + TcxEditRepositoryBlobItem, // ftParadoxOle + TcxEditRepositoryBlobItem, // ftDBaseOle + TcxEditRepositoryBlobItem, // ftTypedBinary + nil, // ftCursor + nil, // ftFixedChar + nil, // ftWideString + nil, // ftLargeint + nil, // ftADT + nil, // ftArray + nil, // ftReference + nil // ftDataSet + {$IFDEF DELPHI5} + , nil, // ftOraBlob + nil, // ftOraClob + nil, // ftVariant + nil, // ftInterface + nil, // ftIDispatch + nil // ftGuid + {$ENDIF} + {$IFDEF DELPHI6} + , TcxEditRepositoryDateItem, // ftTimeStamp + nil // ftFMTBcd + {$ENDIF} + {$IFDEF DELPHI10} + , nil, // ftFixedWideChar + nil, // ftWideMemo + nil, // ftOraTimeStamp + nil // ftOraInterval + {$ENDIF} + ); + +procedure CreateDefaultRepositoryItems; +var + I: TFieldType; + ALookupComboBoxItem: TcxEditRepositoryLookupComboBoxItem; +begin + // Simple + GetDefaultEditDBRepositoryItems.RegisterDefaultItem(cxEditRegisteredItemsStandardVersion, + GetDefaultEditRepository.CreateItem(TcxEditRepositoryMaskItem)); + // Currency + GetDefaultEditDBRepositoryItems.RegisterCurrencyItem(cxEditRegisteredItemsStandardVersion, + GetDefaultEditRepository.CreateItem(DBRepositoryCurrencyItemClass)); + // Lookup + ALookupComboBoxItem := GetDefaultEditRepository.CreateItem(TcxEditRepositoryLookupComboBoxItem) as TcxEditRepositoryLookupComboBoxItem; + ALookupComboBoxItem.Properties.ListOptions.GridLines := glNone; + ALookupComboBoxItem.Properties.DropDownListStyle := lsEditFixedList; + ALookupComboBoxItem.Properties.ListOptions.ShowHeader := False; + GetDefaultEditDBRepositoryItems.RegisterLookupItem(cxEditRegisteredItemsStandardVersion, + ALookupComboBoxItem); + // Misc + for I := Low(TFieldType) to High(TFieldType) do + if DBRepositoryItemClasses[I] <> nil then + GetDefaultEditDBRepositoryItems.RegisterItem(I, cxEditRegisteredItemsStandardVersion, + GetDefaultEditRepository.CreateItem(DBRepositoryItemClasses[I])); +end; + +procedure DeleteDefaultRepositoryItems; +var + I: TFieldType; +begin + GetDefaultEditDBRepositoryItems.UnregisterDefaultItem(cxEditRegisteredItemsStandardVersion); +// GetDefaultEditDBRepositoryItems.UnregisterLookupItem(cxEditRegisteredItemsStandardVersion); + for I := Low(TFieldType) to High(TFieldType) do + if DBRepositoryItemClasses[I] <> nil then + GetDefaultEditDBRepositoryItems.UnregisterItem(I, cxEditRegisteredItemsStandardVersion); +end; + +function GetDefaultEditDBRepositoryItems: TcxEditDBRegisteredRepositoryItems; +begin + if DefaultDBEditRepositoryItems = nil then + DefaultDBEditRepositoryItems := TcxEditDBRegisteredRepositoryItems.Create(nil); + Result := DefaultDBEditRepositoryItems; +end; + +{$IFNDEF DELPHI5} + +function IsPublishedProp(Instance: TObject; const PropName: string): Boolean; +begin + Result := GetPropInfo(Instance.ClassInfo, PropName) <> nil; +end; + +function GetPropValue(Instance: TObject; const PropName: string; + PreferStrings: Boolean): Variant; +var + PropInfo: PPropInfo; + TypeData: PTypeData; +begin + // assume failure + Result := Null; + + // get the prop info + PropInfo := GetPropInfo(Instance.ClassInfo, PropName); + if PropInfo <> nil then + begin + TypeData := GetTypeData(PropInfo^.PropType^); + if PropInfo^.PropType^^.Kind = tkEnumeration then + begin + if TypeData^.BaseType^ = TypeInfo(Boolean) then + Result := Boolean(GetOrdProp(Instance, PropInfo)) + else + Result := GetOrdProp(Instance, PropInfo); + end; + end; +end; + +{$ENDIF} + +{ TcxEditDBRegisteredRepositoryItems } + +destructor TcxEditDBRegisteredRepositoryItems.Destroy; +begin + Destroying := True; + Clear; + inherited Destroy; +end; + +function TcxEditDBRegisteredRepositoryItems.GetCurrencyItem: TcxEditRepositoryItem; +begin + if CurrencyCount > 0 then + Result := FCurrencyItems[0].RepositoryItem + else + Result := GetDefaultItem; +end; + +function TcxEditDBRegisteredRepositoryItems.GetItem( + AFieldType: TFieldType): TcxEditRepositoryItem; +begin + Result := inherited GetItem(Integer(AFieldType)); +end; + +function TcxEditDBRegisteredRepositoryItems.GetItemByField( + AField: TField): TcxEditRepositoryItem; + + function IsCurrency(AField: TField): Boolean; + var + V: Variant; + begin + Result := False; + if IsPublishedProp(AField, 'currency') then + begin + V := GetPropValue(AField, 'currency', False); + if (VarType(V) = varBoolean) and V then + Result := True; + end; + end; + +begin + if Assigned(AField) then + begin + if AField.Lookup then + Result := GetLookupItem + else + begin + if (AField is TNumericField) and IsCurrency(AField) then + Result := GetCurrencyItem + else + Result := GetItem(AField.DataType); + end; + end + else + Result := GetDefaultItem; +end; + +function TcxEditDBRegisteredRepositoryItems.GetLookupItem: TcxEditRepositoryItem; +begin + if LookupCount > 0 then + Result := FLookupItems[0].RepositoryItem + else + Result := GetDefaultItem; +end; + +procedure TcxEditDBRegisteredRepositoryItems.RegisterItem( + AFieldType: TFieldType; AVersion: Integer; + ARepositoryItem: TcxEditRepositoryItem); +begin + inherited RegisterItem(Integer(AFieldType), AVersion, ARepositoryItem); +end; + +procedure TcxEditDBRegisteredRepositoryItems.RegisterCurrencyItem( + AVersion: Integer; ARepositoryItem: TcxEditRepositoryItem); +begin + Add(FCurrencyItems, ftUnknown, AVersion, ARepositoryItem); +end; + +procedure TcxEditDBRegisteredRepositoryItems.RegisterLookupItem( + AVersion: Integer; ARepositoryItem: TcxEditRepositoryItem); +begin + Add(FLookupItems, ftUnknown, AVersion, ARepositoryItem); +end; + +procedure TcxEditDBRegisteredRepositoryItems.UnregisterItem( + AFieldType: TFieldType; AVersion: Integer); +begin + inherited UnregisterItem(Integer(AFieldType), AVersion); +end; + +procedure TcxEditDBRegisteredRepositoryItems.UnregisterCurrencyItem( + AVersion: Integer); +var + AIndex: Integer; +begin + if FindIndexForInsertion(FCurrencyItems, Integer(ftUnknown), AVersion, AIndex) then + Delete(FCurrencyItems, AIndex); +end; + +procedure TcxEditDBRegisteredRepositoryItems.UnregisterLookupItem( + AVersion: Integer); +var + AIndex: Integer; +begin + if FindIndexForInsertion(FLookupItems, Integer(ftUnknown), AVersion, AIndex) then + Delete(FLookupItems, AIndex); +end; + +procedure TcxEditDBRegisteredRepositoryItems.ItemRemoved( + Sender: TcxEditRepositoryItem); +var + I: Integer; +begin + inherited ItemRemoved(Sender); + for I := LookupCount - 1 downto 0 do + if FLookupItems[I].RepositoryItem = Sender then + Delete(FLookupItems, I); + for I := CurrencyCount - 1 downto 0 do + if FCurrencyItems[I].RepositoryItem = Sender then + Delete(FCurrencyItems, I); +end; + +function TcxEditDBRegisteredRepositoryItems.Add( + var AItems: TcxEditRegisteredRepositoryItemsDataArray; AFieldType: TFieldType; + AVersion: Integer; ARepositoryItem: TcxEditRepositoryItem): Integer; +begin + Result := inherited Add(AItems, Integer(AFieldType), AVersion, ARepositoryItem); +end; + +procedure TcxEditDBRegisteredRepositoryItems.Clear; +begin + inherited Clear; + while LookupCount > 0 do + Delete(FLookupItems, LookupCount - 1); + while CurrencyCount > 0 do + Delete(FCurrencyItems, CurrencyCount - 1); +end; + +function TcxEditDBRegisteredRepositoryItems.GetCurrencyCount: Integer; +begin + Result := Length(FCurrencyItems); +end; + +function TcxEditDBRegisteredRepositoryItems.GetLookupCount: Integer; +begin + Result := Length(FLookupItems); +end; + +initialization + CreateDefaultRepositoryItems; + +finalization + DeleteDefaultRepositoryItems; + FreeAndNil(DefaultDBEditRepositoryItems); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxEditDataRegisteredRepositoryItems.pas b/official/x.35/ExpressEditors Library 5/Sources/cxEditDataRegisteredRepositoryItems.pas new file mode 100644 index 00000000..8545f4e4 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxEditDataRegisteredRepositoryItems.pas @@ -0,0 +1,132 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxEditDataRegisteredRepositoryItems; + +{$I cxVer.inc} + +interface + +uses + SysUtils, cxClasses, cxDataStorage, cxEdit, cxEditRegisteredRepositoryItems, + cxEditRepositoryItems; + +type + { TcxEditDataRegisteredRepositoryItems } + + TcxEditDataRegisteredRepositoryItems = class(TcxEditRegisteredRepositoryItems) + public + function GetItem(AValueTypeClass: TcxValueTypeClass): TcxEditRepositoryItem; reintroduce; + procedure RegisterItem(AValueTypeClass: TcxValueTypeClass; AVersion: Integer; ARepositoryItem: TcxEditRepositoryItem); reintroduce; + procedure UnregisterItem(AValueTypeClass: TcxValueTypeClass; AVersion: Integer); reintroduce; + end; + +function GetDefaultEditDataRepositoryItems: TcxEditDataRegisteredRepositoryItems; + +implementation + +var + DefaultDataEditRepositoryItems: TcxEditDataRegisteredRepositoryItems; + +function GetDefaultEditDataRepositoryItems: TcxEditDataRegisteredRepositoryItems; +begin + if DefaultDataEditRepositoryItems = nil then + DefaultDataEditRepositoryItems := TcxEditDataRegisteredRepositoryItems.Create(nil); + Result := DefaultDataEditRepositoryItems; +end; + +procedure CreateDefaultRepositoryItems; +begin + GetDefaultEditDataRepositoryItems.RegisterDefaultItem(cxEditRegisteredItemsStandardVersion, + GetDefaultEditRepository.CreateItem(TcxEditRepositoryTextItem)); + GetDefaultEditDataRepositoryItems.RegisterItem(TcxBooleanValueType, cxEditRegisteredItemsStandardVersion, + GetDefaultEditRepository.CreateItem(TcxEditRepositoryCheckBoxItem)); + GetDefaultEditDataRepositoryItems.RegisterItem(TcxCurrencyValueType, cxEditRegisteredItemsStandardVersion, + GetDefaultEditRepository.CreateItem(TcxEditRepositoryCurrencyItem)); + GetDefaultEditDataRepositoryItems.RegisterItem(TcxDateTimeValueType, cxEditRegisteredItemsStandardVersion, + GetDefaultEditRepository.CreateItem(TcxEditRepositoryDateItem)); + {$IFDEF DELPHI6} + GetDefaultEditDataRepositoryItems.RegisterItem(TcxFMTBcdValueType, cxEditRegisteredItemsStandardVersion, + GetDefaultEditRepository.CreateItem(TcxEditRepositoryCurrencyItem)); + GetDefaultEditDataRepositoryItems.RegisterItem(TcxSQLTimeStampValueType, cxEditRegisteredItemsStandardVersion, + GetDefaultEditRepository.CreateItem(TcxEditRepositoryDateItem)); + {$ENDIF} +end; + +procedure DeleteDefaultRepositoryItems; +begin + GetDefaultEditDataRepositoryItems.UnregisterDefaultItem(cxEditRegisteredItemsStandardVersion); + GetDefaultEditDataRepositoryItems.UnregisterItem(TcxBooleanValueType, cxEditRegisteredItemsStandardVersion); + GetDefaultEditDataRepositoryItems.UnregisterItem(TcxCurrencyValueType, cxEditRegisteredItemsStandardVersion); + GetDefaultEditDataRepositoryItems.UnregisterItem(TcxDateTimeValueType, cxEditRegisteredItemsStandardVersion); + {$IFDEF DELPHI6} + GetDefaultEditDataRepositoryItems.UnregisterItem(TcxFMTBcdValueType, cxEditRegisteredItemsStandardVersion); + GetDefaultEditDataRepositoryItems.UnregisterItem(TcxSQLTimeStampValueType, cxEditRegisteredItemsStandardVersion); + {$ENDIF} +end; + +function GetClassID(AClass: TClass): Integer; +begin + Result := Integer(AClass); +end; + +{ TcxEditDataRegisteredRepositoryItems } + +function TcxEditDataRegisteredRepositoryItems.GetItem( + AValueTypeClass: TcxValueTypeClass): TcxEditRepositoryItem; +begin + Result := inherited GetItem(GetClassID(AValueTypeClass)); +end; + +procedure TcxEditDataRegisteredRepositoryItems.RegisterItem(AValueTypeClass: TcxValueTypeClass; + AVersion: Integer; ARepositoryItem: TcxEditRepositoryItem); +begin + inherited RegisterItem(GetClassID(AValueTypeClass), AVersion, ARepositoryItem); +end; + +procedure TcxEditDataRegisteredRepositoryItems.UnregisterItem(AValueTypeClass: TcxValueTypeClass; + AVersion: Integer); +begin + inherited UnregisterItem(GetClassID(AValueTypeClass), AVersion); +end; + +initialization + CreateDefaultRepositoryItems; + +finalization + DeleteDefaultRepositoryItems; + FreeAndNil(DefaultDataEditRepositoryItems); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxEditMaskEditor.dfm b/official/x.35/ExpressEditors Library 5/Sources/cxEditMaskEditor.dfm new file mode 100644 index 00000000..493a21fb --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxEditMaskEditor.dfm @@ -0,0 +1,270 @@ +object cxEditMaskEditorDlg: TcxEditMaskEditorDlg + Left = 353 + Top = 212 + BorderStyle = bsDialog + Caption = 'Input Mask Editor' + ClientHeight = 322 + ClientWidth = 543 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + KeyPreview = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 8 + Top = 8 + Width = 49 + Height = 13 + Caption = 'Mask kind' + Transparent = True + end + object Bevel1: TBevel + Left = 7 + Top = 37 + Width = 266 + Height = 2 + end + object cxMaskKindPickEdit1: TcxComboBox + Tag = 4 + Left = 64 + Top = 4 + Properties.DropDownListStyle = lsFixedList + Properties.Items.Strings = ( + 'Standard' + 'Regular expression' + 'Extended regular expression') + Properties.OnChange = cxMaskKindPickEdit1PropertiesChange + TabOrder = 0 + Width = 193 + end + object ButtonsPanel: TPanel + Left = 0 + Top = 281 + Width = 543 + Height = 41 + Align = alBottom + BevelOuter = bvNone + TabOrder = 3 + object CancelButton: TcxButton + Left = 440 + Top = 5 + Width = 93 + Height = 25 + Caption = 'Cancel' + TabOrder = 2 + OnClick = CancelButtonClick + end + object OKButton: TcxButton + Left = 336 + Top = 5 + Width = 93 + Height = 25 + Caption = 'OK' + TabOrder = 1 + OnClick = OKButtonClick + end + object MasksButton: TcxButton + Left = 8 + Top = 5 + Width = 93 + Height = 25 + Caption = 'Masks...' + TabOrder = 0 + OnClick = MasksButtonClick + end + end + object RegExprMaskPanel: TPanel + Left = 0 + Top = 42 + Width = 543 + Height = 239 + Align = alBottom + BevelOuter = bvNone + TabOrder = 2 + Visible = False + object Label2: TLabel + Left = 4 + Top = 12 + Width = 55 + Height = 13 + Caption = 'Input mask:' + Transparent = True + end + object Label3: TLabel + Left = 4 + Top = 48 + Width = 50 + Height = 13 + Caption = 'Test input:' + Transparent = True + end + object Label4: TLabel + Left = 12 + Top = 96 + Width = 38 + Height = 13 + Caption = 'Sample:' + Transparent = True + end + object Label5: TLabel + Left = 192 + Top = 96 + Width = 56 + Height = 13 + Caption = 'Description:' + Transparent = True + end + object Bevel2: TBevel + Left = 8 + Top = 80 + Width = 529 + Height = 2 + end + object cxEditMaskEdit: TcxTextEdit + Tag = 7 + Left = 64 + Top = 8 + TabOrder = 0 + OnKeyDown = cxEditMaskEditKeyDown + Width = 473 + end + object cxMaskEdit1: TcxMaskEdit + Tag = 4 + Left = 64 + Top = 44 + Properties.IgnoreMaskBlank = True + Properties.MaskKind = emkRegExprEx + Properties.MaxLength = 0 + TabOrder = 1 + OnEnter = cxMaskEdit1Enter + Width = 473 + end + object Memo1: TcxMemo + Left = 192 + Top = 112 + TabOrder = 2 + Height = 121 + Width = 345 + end + object ListBox1: TcxListBox + Left = 8 + Top = 112 + Width = 177 + Height = 121 + ItemHeight = 13 + TabOrder = 3 + OnClick = ListBox1Click + OnExit = ListBox1Exit + end + end + object StandardMaskPanel: TPanel + Left = 0 + Top = 42 + Width = 543 + Height = 239 + BevelOuter = bvNone + TabOrder = 1 + object Bevel3: TBevel + Left = 4 + Top = 188 + Width = 261 + Height = 2 + end + object Label6: TLabel + Left = 8 + Top = 4 + Width = 55 + Height = 13 + Caption = 'Input mask:' + Transparent = True + end + object Label7: TLabel + Left = 8 + Top = 196 + Width = 51 + Height = 13 + Caption = 'Test Input:' + Transparent = True + end + object Label8: TLabel + Left = 272 + Top = 4 + Width = 66 + Height = 13 + Caption = 'Sample mask:' + Transparent = True + end + object Label9: TLabel + Left = 140 + Top = 64 + Width = 98 + Height = 13 + Caption = 'Character for blanks:' + Transparent = True + end + object cxTextEdit1: TcxTextEdit + Tag = 21 + Left = 8 + Top = 20 + TabOrder = 0 + OnExit = cxTextEdit1Exit + OnKeyDown = cxTextEdit1KeyDown + Width = 253 + end + object cxMaskEdit2: TcxMaskEdit + Tag = 22 + Left = 8 + Top = 212 + Properties.IgnoreMaskBlank = True + TabOrder = 3 + Width = 253 + end + object cxTextEdit2: TcxTextEdit + Tag = 23 + Left = 244 + Top = 60 + Properties.MaxLength = 1 + Properties.OnChange = cxTextEdit2PropertiesChange + TabOrder = 1 + OnExit = cxTextEdit2Exit + Width = 17 + end + object cxCheckBox1: TcxCheckBox + Left = 4 + Top = 160 + Caption = 'Save literal characters' + Properties.OnChange = cxCheckBox1PropertiesChange + TabOrder = 2 + Transparent = True + Width = 153 + end + object ListView1: TListView + Left = 272 + Top = 20 + Width = 261 + Height = 213 + Columns = < + item + AutoSize = True + Caption = 'Description' + end + item + AutoSize = True + Caption = 'Sample' + end> + ReadOnly = True + RowSelect = True + TabOrder = 4 + ViewStyle = vsReport + OnSelectItem = ListView1SelectItem + end + end +end diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxEditMaskEditor.pas b/official/x.35/ExpressEditors Library 5/Sources/cxEditMaskEditor.pas new file mode 100644 index 00000000..1ee98da7 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxEditMaskEditor.pas @@ -0,0 +1,968 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxEditMaskEditor; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, SysUtils, Classes, Graphics, Controls, Forms, + cxControls, cxContainer, cxEdit, cxButtonEdit, StdCtrls, + ExtCtrls, ComCtrls, cxMaskEdit, cxButtons, Dialogs, IniFiles, cxTextEdit, + cxDropDownEdit, cxStandardMask, cxClasses, cxEditConsts, cxCheckBox, + cxGraphics, cxMemo, cxListBox, cxLookAndFeelPainters; + +type + + { EcxLoadMaskException } + + EcxLoadMaskException = class(EcxEditError); + + { TcxSample } + + TcxSample = record + ShortDescription: string; + Description: string; + Mask: string; + end; + + TcxSamples = array of TcxSample; + +var + RegExprSamples: TcxSamples; + StandardSamples: TcxSamples; + +const + DefaultRegExprSamplesCount = 20; + DefaultRegExprSamples: array[0..DefaultRegExprSamplesCount - 1] of TcxSample = + ( + ( + ShortDescription: 'Time of day'; + Description: 'The 24 hour day time:'#13#10#13#10'15:25'#13#10'2:05'#13#10'03:57'; + Mask: '(0?\d | 1\d | 2[0-3]) : [0-5]\d'; + ), + ( + ShortDescription: 'Time of day with seconds'; + Description: 'The 24 hour day time with seconds:'#13#10#13#10'12:45:10'#13#10'3:00:01'; + Mask: '(0?\d | 1\d | 2[0-3]) : [0-5]\d : [0-5]\d'; + ), + ( + ShortDescription: 'Time of day (AM/PM)'; + Description: 'The 12 hour day time:'#13#10#13#10'1:35 PM'#13#10'12:45 AM'; + Mask: '(0?[1-9] | 1[012]) : [0-5]\d '' '' (AM | PM)'; + ), + ( + ShortDescription: 'Time of day with seconds (AM/PM)'; + Description: 'The 12 hour day time with seconds:'#13#10#13#10'10:03:10 AM'#13#10'03:00:01 PM'; + Mask: '(0?[1-9] | 1[012]) : [0-5]\d : [0-5]\d '' '' (AM | PM)'; + ), + ( + ShortDescription: 'Date'; + Description: 'The mm/dd/yy or mm/dd/yyyy date with year from 1000 to 3999:'#13#10#13#10 + + '3/12/99'#13#10'06/25/1800'; + Mask: '(0?[1-9] | 1[012]) / ([012]?[1-9] | [123]0 |31) / ([123][0-9])? [0-9][0-9]'; + ), + ( + ShortDescription: 'Telephone number'; + Description: 'The telephone number with or without city code:'#13#10#13#10 + + '(345)234-12-07'#13#10'(210)7-17-81'#13#10'26-32-22'; + Mask: '(\(\d\d\d\))? \d(\d\d?)? - \d\d - \d\d'; + ), + ( + ShortDescription: 'Extension'; + Description: 'For example 15450'; + Mask: '\d\d\d\d\d'; + ), + ( + ShortDescription: 'Social security'; + Description: 'For example 555-55-5555'; + Mask: '\d\d\d - \d\d - \d\d\d\d'; + ), + ( + ShortDescription: 'Short zip code'; + Description: 'For example 11200'; + Mask: '\d\d\d\d\d'; + ), + ( + ShortDescription: 'Long zip code'; + Description: 'For example 11200-0000'; + Mask: '\d\d\d\d\d - \d\d\d\d'; + ), + ( + ShortDescription: 'Decimal number'; + Description: 'Any decimal number'; + Mask: '\d+'; + ), + ( + ShortDescription: 'Hexadecimal number'; + Description: 'Any Hexadecimal number'; + Mask: '(\d | [A-F] | [a-f])+'; + ), + ( + ShortDescription: 'Octal number'; + Description: 'Any Octal number'; + Mask: '[0-7]+'; + ), + ( + ShortDescription: 'Binary number'; + Description: 'Any Binary number'; + Mask: '[01]+'; + ), + ( + ShortDescription: 'Yes/No'; + Description: 'Yes, No, yes, no, Y, N, y or n'; + Mask: '(Y | y)(es)? | (N | n)o?'; + ), + ( + ShortDescription: 'True/False'; + Description: 'True, False, true or false'; + Mask: '(T | t)rue | (F | f)alse'; + ), + ( + ShortDescription: 'Any symbols'; + Description: 'Any symbols'; + Mask: '.+'; + ), + ( + ShortDescription: 'Letters only'; + Description: 'The any letters of the latin alphabet'; + Mask: '[a-zA-Z]+'; + ), + ( + ShortDescription: 'Uppercase letters'; + Description: 'Any uppercase letters of the latin alphabet'; + Mask: '[A-Z]+'; + ), + ( + ShortDescription: 'Lowercase letters'; + Description: 'Any lowercase letters of the latin alphabet'; + Mask: '[a-z]+'; + ) + ); + + DefaultStandardSamplesCount = 8; + DefaultStandardSamples: array[0..DefaultStandardSamplesCount - 1] of TcxSample = + ( + ( + ShortDescription: 'Phone'; + Description: '(213)144-1756'; + Mask: '!\(999\)000-0000;1;_'; + ), + ( + ShortDescription: 'Extension'; + Description: '15023'; + Mask: '!99999;1;_'; + ), + ( + ShortDescription: 'Social security'; + Description: '555-55-5555'; + Mask: '000\-00\-0000;1;_'; + ), + ( + ShortDescription: 'Short zip code'; + Description: '90628'; + Mask: '00000;1;_'; + ), + ( + ShortDescription: 'Long zip code'; + Description: '90628-0000'; + Mask: '00000\-9999;1;_'; + ), + ( + ShortDescription: 'Date'; + Description: '03/24/99'; + Mask: '!99/99/00;1;_'; + ), + ( + ShortDescription: 'Long Time'; + Description: '04:15:34 PM'; + Mask: '!90:00:00> LL;1;_'; + ), + ( + ShortDescription: 'Short Time'; + Description: '21:45'; + Mask: '!90:00;1;_'; + ) + ); + +type + { TcxEditMaskEditorDlg } + TcxEditMaskEditorDlg = class(TForm) + cxMaskKindPickEdit1: TcxComboBox; + Label1: TLabel; + StandardMaskPanel: TPanel; + RegExprMaskPanel: TPanel; + cxEditMaskEdit: TcxTextEdit; + Label2: TLabel; + Label3: TLabel; + cxMaskEdit1: TcxMaskEdit; + Bevel1: TBevel; + Label4: TLabel; + Label5: TLabel; + Bevel2: TBevel; + cxTextEdit1: TcxTextEdit; + cxMaskEdit2: TcxMaskEdit; + Bevel3: TBevel; + Label6: TLabel; + Label7: TLabel; + Label8: TLabel; + Label9: TLabel; + cxTextEdit2: TcxTextEdit; + cxCheckBox1: TcxCheckBox; + ButtonsPanel: TPanel; + Memo1: TcxMemo; + ListBox1: TcxListBox; + CancelButton: TcxButton; + OKButton: TcxButton; + MasksButton: TcxButton; + ListView1: TListView; + procedure FormShow(Sender: TObject); + procedure cxMaskKindPickEdit1PropertiesChange(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure cxEditMaskEditKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure ListBox1Click(Sender: TObject); + procedure ListBox1Exit(Sender: TObject); + procedure OKButtonClick(Sender: TObject); + procedure CancelButtonClick(Sender: TObject); + procedure ListView1SelectItem(Sender: TObject; Item: TListItem; + Selected: Boolean); + procedure cxTextEdit1Exit(Sender: TObject); + procedure cxTextEdit1KeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure cxTextEdit2Exit(Sender: TObject); + procedure cxTextEdit2PropertiesChange(Sender: TObject); + procedure MasksButtonClick(Sender: TObject); + procedure cxMaskEdit1Enter(Sender: TObject); + procedure cxCheckBox1PropertiesChange(Sender: TObject); + private + FMaskEditProperties: TcxCustomMaskEditProperties; + FLastItemIndex: Integer; + + procedure ConvertMaskBlank; + procedure CorrectMaskBlank; + procedure FormatStandardMask(var AMask: string; ANewMaskBlank: Char); overload; + procedure FormatStandardMask(var AMask: string; ANewSaveLiteralChars: Boolean); overload; + function GetCurrentMaskBlank: Char; + function GetSaveLiteralChars(const AEditMask: string): Boolean; + function GetSaveLiteralChartSymbol(const AValue: Boolean): string; + procedure LoadMaskDem(AFileName: string); + procedure LoadMaskDxm(AFileName: string); + procedure OpenMask; + procedure ShowRegExprSamples; + procedure ShowStandardSamples; + public + property MaskEditProperties: TcxCustomMaskEditProperties + read FMaskEditProperties write FMaskEditProperties; + end; + +var + cxEditMaskEditorDlg: TcxEditMaskEditorDlg; + +implementation + +{$R *.dfm} + +type + TcxCustomMaskEditPropertiesAccess = class(TcxCustomMaskEditProperties); + +procedure FreeRegExprSamples; +begin + RegExprSamples := nil; +end; + +procedure FreeStandardSamples; +begin + StandardSamples := nil; +end; + +procedure TcxEditMaskEditorDlg.FormShow(Sender: TObject); +var + AProperties: TcxCustomMaskEditPropertiesAccess; +begin + AProperties := TcxCustomMaskEditPropertiesAccess(MaskEditProperties); + cxMaskKindPickEdit1.ItemIndex := Ord(AProperties.MaskKind); + RegExprMaskPanel.Visible := AProperties.MaskKind <> emkStandard; + ShowRegExprSamples; + ShowStandardSamples; + FLastItemIndex := -1; + if AProperties.MaskKind = emkStandard then + begin + cxTextEdit2.Text := MaskBlank(AProperties.EditMask); + cxTextEdit1.Text := AProperties.EditMask; + cxMaskEdit2.Properties.MaskKind := AProperties.MaskKind; + cxMaskEdit2.Properties.EditMask := AProperties.EditMask; + cxCheckBox1.Checked := GetSaveLiteralChars(AProperties.EditMask); + end + else + begin + cxTextEdit2.Text := cxDefaultBlank; + cxEditMaskEdit.Text := AProperties.EditMask; + cxMaskEdit1.Properties.MaskKind := AProperties.MaskKind; + cxMaskEdit1.Properties.EditMask := AProperties.EditMask; + end; +end; + +procedure TcxEditMaskEditorDlg.cxMaskKindPickEdit1PropertiesChange( + Sender: TObject); +begin + if Visible then + begin + RegExprMaskPanel.Visible := cxMaskKindPickEdit1.ItemIndex <> Integer(emkStandard); + StandardMaskPanel.Visible := not RegExprMaskPanel.Visible; + if RegExprMaskPanel.Visible then + begin + cxMaskEdit1.Properties.MaskKind := TcxEditMaskKind(cxMaskKindPickEdit1.ItemIndex); + if ListBox1.Items.Count = 0 then + FLastItemIndex := -1; + end; + end; +end; + +procedure TcxEditMaskEditorDlg.FormCreate(Sender: TObject); +begin + cxMaskEdit2.Properties.MaskKind := emkStandard; + cxMaskEdit2.Properties.AlwaysShowBlanksAndLiterals := True; +end; + +procedure TcxEditMaskEditorDlg.cxEditMaskEditKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if TranslateKey(Key) = VK_RETURN then + begin + try + cxMaskEdit1.Properties.EditMask := cxEditMaskEdit.Text; + cxMaskEdit1.Enabled := True; + except + on EcxMaskEditError do + begin + cxMaskEdit1.Properties.EditMask := ''; + cxMaskEdit1.Text := ''; + cxMaskEdit1.Enabled := False; + raise; + end; + end; + end; +end; + +function TcxEditMaskEditorDlg.GetCurrentMaskBlank: Char; +begin + Result := Char(cxTextEdit2.Text[1]); +end; + +function TcxEditMaskEditorDlg.GetSaveLiteralChars(const AEditMask: string): Boolean; +var + ALen: Integer; +begin + Result := True; + ALen := Length(AEditMask); + if ALen >= 2 then + begin + if ALen >= 4 then + begin + if AEditMask[ALen - 3] = ';' then + begin + if AEditMask[ALen - 1] = ';' then + Result := not (AEditMask[ALen - 2] = '0'); + end + else + begin + if AEditMask[ALen - 1] = ';' then + Result := not (AEditMask[ALen] = '0'); + end; + end + else + begin + if AEditMask[ALen - 1] = ';' then + Result := not (AEditMask[ALen] = '0'); + end; + end; +end; + +function TcxEditMaskEditorDlg.GetSaveLiteralChartSymbol(const AValue: Boolean): string; +begin + if AValue then + Result := '1' + else + Result := '0'; +end; + +procedure TcxEditMaskEditorDlg.LoadMaskDem(AFileName: string); +var + AMemoryStream: TMemoryStream; + + function GetNextToken(AIndex: Integer): Char; + begin + Result := Char(PByteArray(AMemoryStream.Memory)^[AIndex]); + end; + +var + ASamples: TcxSamples; + AShortDescription: string; + ADescription: string; + AMask: string; + + procedure AddSample; + begin + SetLength(ASamples, Length(ASamples) + 1); + ASamples[Length(ASamples) - 1].ShortDescription := AShortDescription; + ASamples[Length(ASamples) - 1].Description := ADescription; + ASamples[Length(ASamples) - 1].Mask := AMask; + + AShortDescription := ''; + ADescription := ''; + AMask := ''; + end; + +var + AStringNumber: Integer; + AToken: Char; + I: Integer; +begin + AMemoryStream := TMemoryStream.Create; + + AMemoryStream.LoadFromFile(AFileName); + AStringNumber := 0; + AShortDescription := ''; + ADescription := ''; + AMask := ''; + + try + for I := 0 to AMemoryStream.Size - 1 do + begin + AToken := GetNextToken(I); + + if (AToken = ' ') or (AToken = #9) then + begin + if ((AStringNumber = 0) and (AShortDescription = '')) or + ((AStringNumber = 1) and (ADescription = '')) or + ((AStringNumber = 2) and (AMask = '')) then + Continue; + end + else if AToken = #10 then + begin + if (AStringNumber = 2) then + begin + ADescription := FormatText(ADescription, AMask, GetCurrentMaskBlank); + AddSample; + AStringNumber := 0; + end + else + begin + if not ((AStringNumber = 0) and (AShortDescription = '')) then + raise EcxLoadMaskException.Create(cxGetResourceString(@scxMaskEditIllegalFileFormat)); + end; + end + else if AToken = '|' then + begin + if AStringNumber >= 2 then + raise EcxLoadMaskException.Create(cxGetResourceString(@scxMaskEditIllegalFileFormat)) + else + Inc(AStringNumber); + end + else + begin + if AToken <> #13 then + begin + case AStringNumber of + 0: AShortDescription := AShortDescription + AToken; + 1: ADescription := ADescription + AToken; + 2: AMask := AMask + AToken; + end; + end; + end; + end; + + if (AShortDescription <> '') or (ADescription <> '') or (AMask <> '') then + AddSample; + + if Length(ASamples) > 0 then + begin + FreeStandardSamples; + StandardSamples := ASamples; + ShowStandardSamples; + cxTextEdit1.Text := ''; + cxMaskEdit2.Properties.EditMask := ''; + cxCheckBox1.Checked := True; + end + else + raise EcxLoadMaskException.Create(cxGetResourceString(@scxMaskEditEmptyMaskCollectionFile)); + finally + AMemoryStream.Free; + end; +end; + +procedure TcxEditMaskEditorDlg.LoadMaskDxm(AFileName: string); +var + AStandardSamples: TcxSamples; + ARegExprSamples: TcxSamples; + AShortDescription: string; + ADescription: string; + AMask: string; + + procedure NewSample(var ASamples: TcxSamples); + begin + SetLength(ASamples, Length(ASamples) + 1); + ASamples[Length(ASamples) - 1].ShortDescription := AShortDescription; + ASamples[Length(ASamples) - 1].Description := ADescription; + ASamples[Length(ASamples) - 1].Mask := AMask; + end; + + procedure ClearValues; + begin + AShortDescription := ''; + ADescription := ''; + AMask := ''; + end; + + procedure AddStandardSample; + begin + NewSample(AStandardSamples); + ClearValues; + end; + + procedure AddRegExprSample; + begin + NewSample(ARegExprSamples); + ClearValues; + end; + +var + AFile: TMemIniFile; + ASections: TStringList; + AKeys: TStringList; + I: Integer; +begin + AFile := TMemIniFile.Create(AFileName); + ASections := TStringList.Create; + AKeys := TStringList.Create; + + try + AFile.ReadSections(ASections); + for I := 0 to ASections.Count - 1 do + begin + AFile.ReadSection(ASections[I], AKeys); + if AKeys.Count > 3 then + raise EcxLoadMaskException.Create(cxGetResourceString(@scxMaskEditIllegalFileFormat)) + else + begin + AShortDescription := AFile.ReadString(ASections[I], 'ShortDescription', ''); + ADescription := AFile.ReadString(ASections[I], 'Description', ''); + AMask := AFile.ReadString(ASections[I], 'Mask', ''); + if (AShortDescription = '') and (ADescription = '') and (AMask = '') then + Continue; + + if Pos('Standard', ASections[I]) <> 0 then + AddStandardSample + else if Pos('RegExpr', ASections[I]) <> 0 then + AddRegExprSample + else + raise EcxLoadMaskException.Create(cxGetResourceString(@scxMaskEditIllegalFileFormat)); + end; + end; + + if (Length(AStandardSamples) = 0) and (Length(ARegExprSamples) = 0) then + raise EcxLoadMaskException.Create(cxGetResourceString(@scxMaskEditEmptyMaskCollectionFile)); + + FreeStandardSamples; + StandardSamples := AStandardSamples; + ShowStandardSamples; + cxTextEdit1.Text := ''; + cxMaskEdit2.Properties.EditMask := ''; + cxCheckBox1.Checked := True; + + FreeRegExprSamples; + RegExprSamples := ARegExprSamples; + ShowRegExprSamples; + cxEditMaskEdit.Text := ''; + cxMaskEdit1.Properties.EditMask := ''; + + finally + AFile.Free; + AKeys.Free; + ASections.Free; + end; +end; + +procedure TcxEditMaskEditorDlg.OpenMask; +var + ADialog: TOpenDialog; + AExt: string; +begin + ADialog := TOpenDialog.Create(nil); + ADialog.Options := []; + ADialog.Filter := cxGetResourceString(@scxMaskEditMaskCollectionFiles) + ' (*.dem, *.dxm )|*.dem;*.dxm'; + try + if ADialog.Execute then + begin + AExt := ExtractFileExt(ADialog.Files[0]); + if LowerCase(AExt) = '.dem' then + LoadMaskDem(ADialog.Files[0]) + else if LowerCase(AExt) = '.dxm' then + LoadMaskDxm(ADialog.Files[0]); + end; + finally + ADialog.Free; + end; +end; + +procedure TcxEditMaskEditorDlg.ShowRegExprSamples; +var + I: Integer; +begin + ListBox1.Items.Clear; + if RegExprSamples = nil then + begin + for I := 0 to DefaultRegExprSamplesCount - 1 do + ListBox1.Items.Add(DefaultRegExprSamples[I].ShortDescription); + end + else + begin + for I := 0 to Length(RegExprSamples) - 1 do + ListBox1.Items.Add(RegExprSamples[I].ShortDescription); + end; +end; + +procedure TcxEditMaskEditorDlg.ShowStandardSamples; +var + I: Integer; + AItem: TListItem; +begin + ListView1.Items.Clear; + if StandardSamples = nil then + begin + for I := 0 to DefaultStandardSamplesCount - 1 do + begin + AItem := ListView1.Items.Add; + AItem.Caption := DefaultStandardSamples[I].ShortDescription; + AItem.SubItems.Add(DefaultStandardSamples[I].Description); + end; + end + else + begin + for I := 0 to Length(StandardSamples) - 1 do + begin + AItem := ListView1.Items.Add; + AItem.Caption := StandardSamples[I].ShortDescription; + AItem.SubItems.Add(StandardSamples[I].Description); + end; + end; +end; + +procedure TcxEditMaskEditorDlg.ListBox1Click(Sender: TObject); +begin + Memo1.Clear; + if RegExprSamples = nil then + begin + Memo1.Lines.Add(DefaultRegExprSamples[ListBox1.ItemIndex].Description); + cxEditMaskEdit.Text := DefaultRegExprSamples[ListBox1.ItemIndex].Mask; + end + else + begin + Memo1.Lines.Add(RegExprSamples[ListBox1.ItemIndex].Description); + cxEditMaskEdit.Text := RegExprSamples[ListBox1.ItemIndex].Mask; + end; + + try + cxMaskEdit1.Properties.EditMask := cxEditMaskEdit.Text; + cxMaskEdit1.Enabled := True; + except + on EcxMaskEditError do + begin + cxMaskEdit1.Properties.EditMask := ''; + cxMaskEdit1.Text := ''; + cxMaskEdit1.Enabled := False; + raise; + end; + end; +end; + +procedure TcxEditMaskEditorDlg.ListBox1Exit(Sender: TObject); +begin + if ListBox1.ItemIndex <> FLastItemIndex then + begin + cxMaskEdit1.Text := ''; + FLastItemIndex := ListBox1.ItemIndex; + end; +end; + +procedure TcxEditMaskEditorDlg.OKButtonClick(Sender: TObject); +begin + if cxMaskKindPickEdit1.ItemIndex = Integer(emkStandard) then + begin + CorrectMaskBlank; + cxMaskEdit2.Properties.EditMask := ''; + cxMaskEdit2.Text := ''; + cxMaskEdit2.Properties.EditMask := cxTextEdit1.Text; + TcxCustomMaskEditPropertiesAccess(MaskEditProperties).MaskKind := + emkStandard; + TcxCustomMaskEditPropertiesAccess(MaskEditProperties).EditMask := + cxMaskEdit2.Properties.EditMask; + ModalResult := mrOk; + end + else + try + cxMaskEdit1.Properties.EditMask := cxEditMaskEdit.Text; + cxMaskEdit1.Enabled := True; + TcxCustomMaskEditPropertiesAccess(MaskEditProperties).MaskKind := + TcxEditMaskKind(cxMaskKindPickEdit1.ItemIndex); + TcxCustomMaskEditPropertiesAccess(MaskEditProperties).EditMask := + cxMaskEdit1.Properties.EditMask; + ModalResult := mrOk; + except + on EcxMaskEditError do + begin + cxMaskEdit1.Properties.EditMask := ''; + cxMaskEdit1.Text := ''; + cxMaskEdit1.Enabled := False; + cxEditMaskEdit.SetFocus; + raise; + end; + end; +end; + +procedure TcxEditMaskEditorDlg.CancelButtonClick(Sender: TObject); +begin + ModalResult := mrCancel; +end; + +procedure TcxEditMaskEditorDlg.ListView1SelectItem(Sender: TObject; + Item: TListItem; Selected: Boolean); +begin + if Selected then + begin + if StandardSamples = nil then + cxTextEdit1.Text := DefaultStandardSamples[ListView1.Selected.Index].Mask + else + cxTextEdit1.Text := StandardSamples[ListView1.Selected.Index].Mask; + + CorrectMaskBlank; + cxMaskEdit2.Properties.EditMask := ''; + cxMaskEdit2.Text := ''; + cxMaskEdit2.Properties.EditMask := cxTextEdit1.Text; + cxCheckBox1.Checked := GetSaveLiteralChars(cxTextEdit1.Text); + end; +end; + +procedure TcxEditMaskEditorDlg.cxTextEdit1Exit(Sender: TObject); +begin + begin + CorrectMaskBlank; + cxMaskEdit2.Properties.EditMask := ''; + cxMaskEdit2.Text := ''; + cxMaskEdit2.Properties.EditMask := cxTextEdit1.Text; + cxCheckBox1.Checked := GetSaveLiteralChars(cxTextEdit1.Text); + end; +end; + +procedure TcxEditMaskEditorDlg.cxTextEdit1KeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if TranslateKey(Key) = VK_RETURN then + begin + CorrectMaskBlank; + cxMaskEdit2.Properties.EditMask := ''; + cxMaskEdit2.Text := ''; + cxMaskEdit2.Properties.EditMask := cxTextEdit1.Text; + cxCheckBox1.Checked := GetSaveLiteralChars(cxTextEdit1.Text); + end; +end; + +procedure TcxEditMaskEditorDlg.FormatStandardMask(var AMask: string; ANewMaskBlank: Char); +var + AOldMaskBlank: Char; + ASaveLiteralChars: Boolean; + AMaskLength: Integer; +begin + AOldMaskBlank := MaskBlank(AMask); + ASaveLiteralChars := SaveLiteralChars(AMask); + if AOldMaskBlank <> ANewMaskBlank then + begin + AMaskLength := Length(AMask); + + if AMaskLength < 4 then + begin + if (AMaskLength = 2) and (AMask[1] = ';') and ((AMask[2] = '0') or (AMask[2] = '1')) then + AMask := AMask + ';' + ANewMaskBlank + else + AMask := AMask + ';' + GetSaveLiteralChartSymbol(ASaveLiteralChars) + ';' + ANewMaskBlank; + end + else + begin + if (AMask[AMaskLength - 1] = ';') and (AMask[AMaskLength - 3] = ';') and + ((AMask[AMaskLength - 2] = '0') or (AMask[AMaskLength - 2] = '1')) then + begin + Delete(AMask, AMaskLength,1); + AMask := AMask + ANewMaskBlank; + end + else if (AMask[AMaskLength - 1] = ';') and ((AMask[AMaskLength] = '0') or (AMask[AMaskLength] = '1')) then + AMask := AMask + ';' + ANewMaskBlank + else + AMask := AMask + ';' + GetSaveLiteralChartSymbol(ASaveLiteralChars) + ';' + ANewMaskBlank; + end; + end; +end; + +procedure TcxEditMaskEditorDlg.FormatStandardMask(var AMask: string; ANewSaveLiteralChars: Boolean); +var + AMaskLength: Integer; + AMaskBlank: Char; +begin + AMaskLength := Length(AMask); + AMaskBlank := MaskBlank(AMask); + if ANewSaveLiteralChars <> SaveLiteralChars(AMask) then + begin + if AMaskLength < 4 then + begin + if (AMaskLength = 2) and (AMask[1] = ';') and ((AMask[2] = '0') or (AMask[2] = '1')) then + begin + Delete(AMask, AMaskLength, 1); + AMask := AMask + GetSaveLiteralChartSymbol(ANewSaveLiteralChars); + end + else + AMask := AMask + ';' + GetSaveLiteralChartSymbol(ANewSaveLiteralChars) + ';' + AMaskBlank; + end + else + begin + if (AMask[AMaskLength - 1] = ';') and (AMask[AMaskLength - 3] = ';') and + ((AMask[AMaskLength - 2] = '0') or (AMask[AMaskLength - 2] = '1')) then + begin + Delete(AMask, AMaskLength - 2, 1); + Insert(GetSaveLiteralChartSymbol(ANewSaveLiteralChars), AMask, AMaskLength - 2); + end + else if (AMask[AMaskLength - 1] = ';') and ((AMask[AMaskLength] = '0') or (AMask[AMaskLength] = '1')) then + begin + Delete(AMask, AMaskLength, 1); + AMask := AMask + GetSaveLiteralChartSymbol(ANewSaveLiteralChars); + end + else + AMask := AMask + ';' + GetSaveLiteralChartSymbol(ANewSaveLiteralChars) + ';' + AMaskBlank; + end; + end; +end; + +procedure TcxEditMaskEditorDlg.cxTextEdit2Exit(Sender: TObject); +begin + ConvertMaskBlank; +end; + +procedure TcxEditMaskEditorDlg.ConvertMaskBlank; +begin + if Length(cxTextEdit2.Text) > 0 then + begin + if string(cxTextEdit2.Text)[1] < #32 then + cxTextEdit2.Text := '_'; + end + else + cxTextEdit2.Text := '_'; +end; + +procedure TcxEditMaskEditorDlg.cxTextEdit2PropertiesChange( + Sender: TObject); +var + AMask: string; +begin + ConvertMaskBlank; + + AMask := cxTextEdit1.Text; + FormatStandardMask(AMask, string(cxTextEdit2.Text)[1]); + cxTextEdit1.Text := AMask; + cxMaskEdit2.Properties.EditMask := AMask; + cxCheckBox1.Checked := GetSaveLiteralChars(AMask); +end; + +procedure TcxEditMaskEditorDlg.CorrectMaskBlank; +var + AMask: string; +begin + AMask := cxTextEdit1.Text; + cxTextEdit2.Text := MaskBlank(AMask); + if Length(cxTextEdit2.Text) > 0 then + FormatStandardMask(AMask, string(cxTextEdit2.Text)[1]) + else + begin + FormatStandardMask(AMask, '_'); + cxTextEdit2.Text := '_'; + end; + cxTextEdit1.Text := AMask; +end; + +procedure TcxEditMaskEditorDlg.MasksButtonClick(Sender: TObject); +begin + OpenMask; +end; + +procedure TcxEditMaskEditorDlg.cxMaskEdit1Enter(Sender: TObject); +begin + try + cxMaskEdit1.Properties.EditMask := cxEditMaskEdit.Text; + cxMaskEdit1.Enabled := True; + except + on EcxMaskEditError do + begin + cxMaskEdit1.Properties.EditMask := ''; + cxMaskEdit1.Text := ''; + cxMaskEdit1.Enabled := False; + cxEditMaskEdit.SetFocus; + raise; + end; + end; +end; + +procedure TcxEditMaskEditorDlg.cxCheckBox1PropertiesChange( + Sender: TObject); +var + AMask: string; +begin + AMask := cxTextEdit1.Text; + if Length(cxTextEdit2.Text) > 0 then + FormatStandardMask(AMask, Char(cxTextEdit2.Text[1])); + FormatStandardMask(AMask, cxCheckBox1.Checked); + cxTextEdit1.Text := AMask; + cxMaskEdit2.Properties.EditMask := AMask; +end; + +initialization + RegExprSamples := nil; + StandardSamples := nil; + +finalization + FreeRegExprSamples; + FreeStandardSamples; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxEditPaintUtils.pas b/official/x.35/ExpressEditors Library 5/Sources/cxEditPaintUtils.pas new file mode 100644 index 00000000..3b169f76 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxEditPaintUtils.pas @@ -0,0 +1,336 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxEditPaintUtils; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, Controls, Graphics, SysUtils, cxClasses, + cxControls, cxGraphics, cxLookAndFeels; + +const + cxSolidBrushCacheDefaultMaxDepth = 128; + +type + { TcxSolidBrushCache } + + TcxSolidBrushCache = class + private + FBrushColors: array of TColor; + FBrushes: array of TBrushHandle; + FCounts: array of Cardinal; + FDepth: Integer; + FMaxDepth: Integer; + FSystemPaletteChangedNotifier: TcxSystemPaletteChangedNotifier; + protected + procedure SystemPaletteChanged; virtual; + public + constructor Create; overload; + constructor Create(AMaxDepth: Integer); overload; + destructor Destroy; override; + procedure Clear; + function GetBrush(ABrushColor: TColor): TBrushHandle; + end; + +function GetSolidBrush(ABrushColor: TColor): TBrushHandle; overload; +function GetSolidBrush(ACanvas: TCanvas; ABrushColor: TColor): TBrushHandle; overload; +function GetSolidBrush(ACanvas: TcxCanvas; ABrushColor: TColor): TBrushHandle; overload; +procedure ResetSolidBrushCache; + +implementation + +uses + Forms; + +const + cxSysColorPrefix: Cardinal = {$IFDEF DELPHI7}clSystemColor{$ELSE}$80000000{$ENDIF}; + +var + FSolidBrushCache: TcxSolidBrushCache = nil; + FSystemBrushes: array of TBrushHandle; + +function GetSolidBrush(ABrushColor: TColor): TBrushHandle; +begin + Result := FSolidBrushCache.GetBrush(ABrushColor); +end; + +function GetSolidBrush(ACanvas: TCanvas; ABrushColor: TColor): TBrushHandle; +begin + Result := FSolidBrushCache.GetBrush(ABrushColor); +end; + +function GetSolidBrush(ACanvas: TcxCanvas; ABrushColor: TColor): TBrushHandle; +begin + Result := FSolidBrushCache.GetBrush(ABrushColor); +end; + +procedure ResetSolidBrushCache; +begin + FSolidBrushCache.Clear; +end; + +procedure CreateSystemBrushes; +var + I: Word; +begin + SetLength(FSystemBrushes, COLOR_ENDCOLORS - COLOR_SCROLLBAR + 1); + for I := COLOR_SCROLLBAR to COLOR_ENDCOLORS do + FSystemBrushes[I] := GetSysColorBrush(I); +end; + +procedure DestroySystemBrushes; +begin + FSystemBrushes := nil; +end; + +{ TcxSolidBrushCache } + +constructor TcxSolidBrushCache.Create; +begin + Create(cxSolidBrushCacheDefaultMaxDepth); +end; + +constructor TcxSolidBrushCache.Create(AMaxDepth: Integer); +begin + inherited Create; + FMaxDepth := AMaxDepth; + SetLength(FBrushColors, FMaxDepth); + SetLength(FBrushes, FMaxDepth); + SetLength(FCounts, FMaxDepth); + FSystemPaletteChangedNotifier := TcxSystemPaletteChangedNotifier.Create(True); + FSystemPaletteChangedNotifier.OnSystemPaletteChanged := SystemPaletteChanged; +end; + +destructor TcxSolidBrushCache.Destroy; +begin + FreeAndNil(FSystemPaletteChangedNotifier); + Clear; + FBrushColors := nil; + FBrushes := nil; + FCounts := nil; + inherited Destroy; +end; + +procedure TcxSolidBrushCache.Clear; +var + I: Integer; +begin + for I := 0 to FDepth - 1 do + DeleteObject(FBrushes[I]); + FDepth := 0; +end; + +function TcxSolidBrushCache.GetBrush(ABrushColor: TColor): TBrushHandle; + + function GetColorIndex(AColor: TColor; out AIndex: Integer): Boolean; assembler; + var + ADepth: Integer; + APBrushColors, APIndex: ^Integer; + begin + ADepth := FDepth; + APBrushColors := @FBrushColors[0]; + APIndex := @AIndex; + asm + push ebx + push edi + push esi + + mov edi, ADepth + or edi, edi + jne @@0 + mov eax, edi + jmp @@5 + @@0: + mov ebx, APBrushColors + mov edx, AColor + mov esi, ebx + dec edi + shl edi, 2 + add esi, edi + jmp @@3 + @@1: + mov edi, ebx + add edi, esi + shr edi, 1 + and di, $FFFC + cmp edx, [edi] + je @@4 + ja @@2 + mov esi, edi + sub edi, ebx + jmp @@3 + @@2: + mov ebx, edi + sub edi, esi + neg edi + @@3: + cmp edi, 4 + ja @@1 + mov edi, ebx + cmp edx, [edi] + jbe @@4 + mov edi, esi + cmp edx, [edi] + jbe @@4 + add edi, 4 + @@4: + mov eax, edi + sub eax, APBrushColors + shr eax, 2 + @@5: + mov ebx, APIndex + mov [ebx], eax + cmp eax, ADepth + jae @@6 + shl eax, 2 + add eax, APBrushColors + cmp [eax], edx + jne @@6 + xor al, al + inc al + jmp @@7 + @@6: + xor al, al + @@7: + pop esi + pop edi + pop ebx + mov Result, al + end; + end; + + function GetRarestColorIndex: Integer; + var + ADepth: Integer; + APCounts: ^Integer; + begin + ADepth := FDepth; + APCounts := @FCounts[0]; + asm + push ebx + push esi + + mov ebx, APCounts + mov eax, [ebx] + mov ecx, ADepth + mov edx, ebx + @@0: + dec ecx + jz @@1 + add ebx, 4 + mov esi, [ebx] + cmp eax, esi + jbe @@0 + mov eax, esi + mov edx, ebx + jmp @@0 + @@1: + sub edx, APCounts + shr edx, 2 + mov Result, edx + + pop esi + pop ebx + end; + end; + + function PrepareNewItem(AIndex: Integer): TBrushHandle; + var + ACount, ARarestColorIndex: Integer; + begin + if FDepth = FMaxDepth then + begin + ARarestColorIndex := GetRarestColorIndex; + DeleteObject(FBrushes[ARarestColorIndex]); + Dec(FDepth); + if ARarestColorIndex < FDepth then + begin + ACount := (FDepth - ARarestColorIndex) shl 2; + Move(FBrushColors[ARarestColorIndex + 1], FBrushColors[ARarestColorIndex], ACount); + Move(FBrushes[ARarestColorIndex + 1], FBrushes[ARarestColorIndex], ACount); + Move(FCounts[ARarestColorIndex + 1], FCounts[ARarestColorIndex], ACount); + end; + if AIndex > ARarestColorIndex then + Dec(AIndex); + end; + if AIndex < FDepth then + begin + ACount := (FDepth - AIndex) shl 2; + Move(FBrushColors[AIndex], FBrushColors[AIndex + 1], ACount); + Move(FBrushes[AIndex], FBrushes[AIndex + 1], ACount); + Move(FCounts[AIndex], FCounts[AIndex + 1], ACount); + end; + Inc(FDepth); + Result := CreateSolidBrush(ColorToRGB(ABrushColor)); + FBrushColors[AIndex] := ABrushColor; + FBrushes[AIndex] := Result; + FCounts[AIndex] := 0; + end; + +var + AColorIndex: Integer; +begin + if FSystemBrushes <> nil then + if (Cardinal(ABrushColor) >= cxSysColorPrefix) and (Cardinal(ABrushColor) <= cxSysColorPrefix or COLOR_ENDCOLORS) then + begin + Result := FSystemBrushes[ABrushColor and not cxSysColorPrefix]; + Exit; + end; + if GetColorIndex(ABrushColor, AColorIndex) then + begin + Inc(FCounts[AColorIndex]); + Result := FBrushes[AColorIndex]; + end + else + Result := PrepareNewItem(AColorIndex); +end; + +procedure TcxSolidBrushCache.SystemPaletteChanged; +begin + Clear; +end; + +initialization + CreateSystemBrushes; + FSolidBrushCache := TcxSolidBrushCache.Create; + +finalization + FreeAndNil(FSolidBrushCache); + DestroySystemBrushes; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxEditPropEditors.pas b/official/x.35/ExpressEditors Library 5/Sources/cxEditPropEditors.pas new file mode 100644 index 00000000..80a3c00a --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxEditPropEditors.pas @@ -0,0 +1,1186 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxEditPropEditors; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + {$IFNDEF CBUILDER10} + DBReg, + {$ENDIF} + DesignEditors, DesignIntf, VCLEditors, + Types, +{$ELSE} + DsgnIntf, DBReg, +{$ENDIF} + Windows, Forms, Classes, Controls, DB, Graphics, ImgList, TypInfo, cxContainer, + cxDataStorage, cxEdit, cxEditRepositoryItems, cxLookAndFeels, cxPropEditors, + cxDesignWindows, cxLibraryReg; + +const +// cxEditPropEditorsVersion = '6.25'; + cxEditPropEditorsMajorVersion = '6'; + cxEditorsLibraryProductName = 'ExpressEditors Library'; + +type + { TDBStringProperty } + + TDBStringProperty = class(TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValueList(AList: TStrings); virtual; + procedure GetValues(Proc: TGetStrProc); override; + end; + +{$IFDEF CBUILDER10} + { TcxDataFieldProperty } + + TcxDataFieldProperty = class(TDBStringProperty) + public + function GetDataSourcePropName: string; virtual; + procedure GetValueList(AList: TStrings); override; + end; +{$ELSE} + TcxDataFieldProperty = TDataFieldProperty; +{$ENDIF} + + { TcxValueTypeProperty } + + TcxValueTypeProperty = class(TStringProperty) + protected + function IsValueTypeClassValid(AValueTypeClass: TcxValueTypeClass): Boolean; virtual; + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + end; + + { TFieldNameProperty } + + TFieldNameProperty = class(TDBStringProperty) + public + function GetDataSource: TDataSource; virtual; + function GetDataSourcePropName: string; virtual; + procedure GetValueList(AList: TStrings); override; + end; + + { TcxCustomEditorsLibraryComponentEditor } + + TcxCustomEditorsLibraryComponentEditor = class(TcxComponentEditor) + protected + function GetProductMajorVersion: string; override; + function GetProductName: string; override; + end; + + { TcxEditComponentEditor } + + TcxEditComponentEditor = class(TcxCustomEditorsLibraryComponentEditor) + private + function GetEdit: TcxCustomEdit; + protected + function InternalGetVerb(Index: Integer): string; override; + function InternalGetVerbCount: Integer; override; + procedure InternalExecuteVerb(AIndex: Integer); override; + public + procedure Edit; override; + end; + + { TcxEditRepositoryItemProperty } + + TcxEditRepositoryItemProperty = class(TComponentProperty) + private + FStrProc: TGetStrProc; + procedure StrProc(const S: string); + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + end; + + { TcxLookupEditListSourceProperty } + + TcxLookupEditListSourceProperty = class(TcxDataFieldProperty) + public + function GetDataSourcePropName: string; override; + end; + + { TcxEditPropertiesEventEditor } + + TcxEditPropertiesEventEditor = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + public + function GetName: string; override; + end; + + { TcxEditRepositoryItemPropertiesEventEditor } + + TcxEditRepositoryItemPropertiesEventEditor = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + public + function GetName: string; override; + end; + + { TcxNavigatorButtonsEventEditor } + + TcxNavigatorButtonsEventEditor = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + public + function GetName: string; override; + end; + + { TcxGEPropertiesImageIndexProperty } + + TcxGEPropertiesImageIndexProperty = class(TImageIndexProperty) + public + function GetImages: TCustomImageList; override; + end; + + { TcxGEItemImageIndexProperty } + + TcxGEItemImageIndexProperty = class(TImageIndexProperty) + public + function GetImages: TCustomImageList; override; + end; + + { TcxEditorsLibraryComponentEditorEx } + + TcxEditorsLibraryComponentEditorEx = class(TcxCustomEditorsLibraryComponentEditor) + protected + function GetEditItemCaption: string; virtual; + procedure ExecuteEditAction; virtual; abstract; + + function InternalGetVerb(AIndex: Integer): string; override; + function InternalGetVerbCount: Integer; override; + procedure InternalExecuteVerb(AIndex: Integer); override; + end; + + { TcxEditRepositoryComponentEditor } + + TcxEditRepositoryComponentEditor = class(TcxEditorsLibraryComponentEditorEx) + private + function GetEditRepository: TcxEditRepository; + protected + procedure ExecuteEditAction; override; + end; + + { TcxEditMaskProperty } + + TcxEditMaskProperty = class(TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure Edit; override; + end; + + { TcxTextProperty } + + TcxTextProperty = class(TStringProperty) + private + function CanShowDialog: Boolean; + public + function GetAttributes: TPropertyAttributes; override; + procedure Edit; override; + end; + + { TGraphicClassNameProperty } + + TGraphicClassNameProperty = class(TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + end; + +{$IFDEF DELPHI6} + TcxButtonSelectionEditor = class(TSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + + TcxComboBoxSelectionEditor = class(TSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; +{$ENDIF} + + { TcxFilterControlComponentEditor } + + TcxFilterControlComponentEditor = class(TcxDefaultEditor) + protected + function GetProductMajorVersion: string; override; + function GetProductName: string; override; + end; + + { TcxNavigatorControlProperty } + + TcxNavigatorControlProperty = class(TComponentProperty) + private + FStrProc: TGetStrProc; + procedure StrProc(const S: string); + public + procedure GetValues(Proc: TGetStrProc); override; + end; + + { TcxEditorsLibraryComponentEditor } + + TcxEditorsLibraryComponentEditor = class(TcxEditorsLibraryComponentEditorEx) + public + procedure Edit; override; + end; + + { TcxEditorsLibraryComponentWithStylesEditor } + + TcxEditorsLibraryComponentWithStylesEditor = class(TcxEditorsLibraryComponentEditor) + protected + function GetEditItemCaption: string; override; + procedure ExecuteEditAction; override; + procedure RestoreStyles; virtual; abstract; + end; + + { TcxEditorsLibraryComponentWithoutStylesEditor } + + TcxEditorsLibraryComponentWithoutStylesEditor = class(TcxEditorsLibraryComponentEditor) + protected + function GetEditItemCaption: string; override; + procedure ExecuteEditAction; override; + function GetLookAndFeel: TcxLookAndFeel; virtual; abstract; + end; + + { TcxEditStyleControllerEditor } + + TcxEditStyleControllerEditor = class(TcxEditorsLibraryComponentWithStylesEditor) + protected + procedure RestoreStyles; override; + public + procedure Edit; override; + end; + + { TcxDefaultEditStyleControllerEditor } + + TcxDefaultEditStyleControllerEditor = class(TcxEditorsLibraryComponentWithStylesEditor) + protected + procedure RestoreStyles; override; + public + procedure Edit; override; + end; + + { TcxCustomButtonComponentEditor } + + TcxCustomButtonComponentEditor = class(TcxEditorsLibraryComponentWithoutStylesEditor) + protected + function GetLookAndFeel: TcxLookAndFeel; override; + end; + + { TcxRadioButtonComponentEditor } + + TcxRadioButtonComponentEditor = class(TcxEditorsLibraryComponentWithoutStylesEditor) + protected + function GetLookAndFeel: TcxLookAndFeel; override; + end; + + { TcxContainerComponentEditor } + + TcxContainerComponentEditor = class(TcxEditorsLibraryComponentWithStylesEditor) + protected + procedure RestoreStyles; override; + end; + + { TcxCustomNavigatorComponentEditor } + + TcxCustomNavigatorComponentEditor = class(TcxEditorsLibraryComponentWithoutStylesEditor) + protected + function GetLookAndFeel: TcxLookAndFeel; override; + function InternalGetVerb(AIndex: Integer): string; override; + function InternalGetVerbCount: Integer; override; + procedure InternalExecuteVerb(AIndex: Integer); override; + public + procedure Edit; override; + end; + + { TcxCustomImagePropertiesProperty } + + TcxCustomImagePropertiesProperty = class(TcxEditPropertiesEventEditor) + private + FProc: {$IFNDEF DELPHI6}TGetPropEditProc{$ELSE}TGetPropProc{$ENDIF}; + procedure GetPropProc({$IFNDEF DELPHI6}Prop: TPropertyEditor{$ELSE}const Prop: IProperty{$ENDIF}); + public + procedure GetProperties(Proc: {$IFNDEF DELPHI6}TGetPropEditProc{$ELSE}TGetPropProc{$ENDIF}); override; + end; + + { TcxEditPropertiesAssignedValuesProperty } + + TcxEditPropertiesAssignedValuesProperty = class(TClassProperty) + private + FProc: {$IFNDEF DELPHI6}TGetPropEditProc{$ELSE}TGetPropProc{$ENDIF}; + procedure GetPropProc({$IFNDEF DELPHI6}Prop: TPropertyEditor{$ELSE}const Prop: IProperty{$ENDIF}); + function IsVisibleProperty(const APropertyName: string): Boolean; + public + procedure GetProperties( + Proc: {$IFNDEF DELPHI6}TGetPropEditProc{$ELSE}TGetPropProc{$ENDIF}); override; + function GetValue: string; override; + end; + + { TcxDefaultEditStyleControllerStyleProperty } + + TcxDefaultEditStyleControllerStyleProperty = class(TcxStyleControllerStyleProperty) + protected + function GetStyle: TcxContainerStyle; override; + function IsPropertyVisible(const APropertyName: string): Boolean; override; + end; + + { TcxNavigatorButtonImageIndexProperty } + + TcxNavigatorButtonImageIndexProperty = class(TImageIndexProperty) + public + function GetImages: TCustomImageList; override; + end; + +{$IFDEF DELPHI10} + TcxEditGuidelines = class(TWinControlGuidelines) + private + function GetEdit: TcxCustomEdit; + protected + function GetCount: Integer; override; + function GetDesignerGuideOffset(Index: Integer): Integer; override; + function GetDesignerGuideType(Index: Integer): TDesignerGuideType; override; + property Edit: TcxCustomEdit read GetEdit; + end; +{$ENDIF} + + TMethodParam = record + Flags: TParamFlags; + Name: ShortString; + TypeName: ShortString; + end; + +procedure ShowEventMethod( + ADesigner: IDesigner; + AInstance: TObject; const AEventName, AMethodName: string; + const AMethodParams: array of TMethodParam); + +implementation + +uses + SysUtils, cxButtons, cxClasses, cxControls, cxEditMaskEditor, + cxEditRepositoryEditor, cxImage, cxImageComboBox, cxListBox, cxMaskEdit, + cxMaskEditTextEditor, cxNavigator, cxRadioGroup; + +const + cxEditComponentEditorVerbA: array[0..1] of string = ( + 'Restore properties', + 'Restore styles'); + + cxEditRepositoryEditorVerb = 'Edit...'; + + cxCustomEditControlEditorVerbA: array[0..1] of string = ( + 'Restore LookAndFeel', + 'Restore Styles' + ); + + cxCustomNavigatorEditorVerb = 'Restore Buttons'; + + ADefaultMethodParams: array[0..0] of TMethodParam = + ((Flags: [pfAddress]; Name: 'Sender'; TypeName: 'TObject')); + + cxNavigatorButtonsOnButtonClickEventParams: array[0..2] of TMethodParam = ( + (Flags: [pfAddress]; Name: 'Sender'; TypeName: 'TObject'), + (Flags: [pfAddress]; Name: 'AButtonIndex'; TypeName: 'Integer'), + (Flags: [pfVar]; Name: 'ADone'; TypeName: 'Boolean') + ); + +type + TcxCustomEditAccess = class(TcxCustomEdit); + TcxCustomEditPropertiesAccess = class(TcxCustomEditProperties); + TcxCustomMaskEditPropertiesAccess = class(TcxCustomMaskEditProperties); + TcxCustomNavigatorAccess = class(TcxCustomNavigator); + +procedure AddMethodParam(var P: PChar; AParamFlags: TParamFlags; + const AParamName, AParamTypeName: ShortString); +var + AMethodParamFlags: TParamFlags; + S: ShortString; +begin + AMethodParamFlags := AParamFlags; + Move(AMethodParamFlags, P^, SizeOf(AMethodParamFlags)); + Inc(P, SizeOf(AMethodParamFlags)); + S := AParamName; + Move(S[0], P^, Length(S) + 1); + Inc(P, Length(S) + 1); + S := AParamTypeName; + Move(S[0], P^, Length(S) + 1); + Inc(P, Length(S) + 1); +end; + +procedure ShowEventMethod( + ADesigner: IDesigner; + AInstance: TObject; const AEventName, AMethodName: string; + const AMethodParams: array of TMethodParam); + + function GetCurrentMethod: string; + var + ACurrentMethod: TMethod; + begin +{$IFDEF DELPHI5} + ACurrentMethod := GetMethodProp(AInstance, AEventName); +{$ELSE} + ACurrentMethod := GetMethodProp(AInstance, + GetPropInfo(PTypeInfo(AInstance.ClassInfo), AEventName)); +{$ENDIF} + if ACurrentMethod.Code = nil then + Result := '' + else + Result := ADesigner.GetMethodName(ACurrentMethod); + end; + + function CreateNewMethod: string; + var + AMethod: TMethod; + ATypeData: TTypeData; + I: Integer; + P: PChar; + begin + Result := AMethodName; + + ATypeData.MethodKind := mkProcedure; + ATypeData.ParamCount := Length(AMethodParams); + P := @ATypeData.ParamList; + for I := 0 to High(AMethodParams) do + with AMethodParams[I] do + AddMethodParam(P, Flags, Name, TypeName); + AMethod := ADesigner.CreateMethod(AMethodName, @ATypeData); + + {$IFDEF DELPHI5} + SetMethodProp(AInstance, AEventName, AMethod); + {$ELSE} + SetMethodProp(AInstance, GetPropInfo(PTypeInfo(AInstance.ClassInfo), + AEventName), AMethod); + {$ENDIF} + ADesigner.Modified; + end; + +var + S: string; +begin + S := GetCurrentMethod; + if S = '' then + S := CreateNewMethod; + ADesigner.ShowMethod(S); +end; + +{ TDBStringProperty } + +function TDBStringProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList, paSortList, paMultiSelect]; +end; + +procedure TDBStringProperty.GetValueList(AList: TStrings); +begin +end; + +procedure TDBStringProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; + Values: TStringList; +begin + Values := TStringList.Create; + try + GetValueList(Values); + for I := 0 to Values.Count - 1 do Proc(Values[I]); + finally + Values.Free; + end; +end; + +{$IFDEF CBUILDER10} + +{ TcxDataFieldProperty } + +function TcxDataFieldProperty.GetDataSourcePropName: string; +begin + Result := 'DataSource'; +end; + +procedure TcxDataFieldProperty.GetValueList(AList: TStrings); +var + DataSource: TDataSource; +begin + DataSource := GetObjectProp(GetComponent(0), GetDataSourcePropName) as TDataSource; + if (DataSource <> nil) and (DataSource.DataSet <> nil) then + DataSource.DataSet.GetFieldNames(AList); +end; + +{$ENDIF} + +{ TcxValueTypeProperty } + +function TcxValueTypeProperty.IsValueTypeClassValid(AValueTypeClass: TcxValueTypeClass): Boolean; +begin + Result := True; +end; + +function TcxValueTypeProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList, paMultiSelect, paSortList, paRevertable]; +end; + +procedure TcxValueTypeProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to cxValueTypeClassList.Count - 1 do + if IsValueTypeClassValid(cxValueTypeClassList[I]) then + Proc(cxValueTypeClassList[I].Caption); +end; + +{$IFNDEF DELPHI5} + +// TODO: cxDBData.pas (GetObjectProp already exist) +function GetObjectProp(Instance: TObject; const PropName: string): TObject; +var + PropInfo: PPropInfo; +begin + Result := nil; + PropInfo := TypInfo.GetPropInfo(Instance.ClassInfo, PropName); + if (PropInfo <> nil) and (PropInfo^.PropType^.Kind = tkClass) then + Result := TObject(GetOrdProp(Instance, PropInfo)); +end; + +{$ENDIF} + +function TFieldNameProperty.GetDataSource: TDataSource; +begin + Result := GetObjectProp(GetComponent(0), GetDataSourcePropName) as TDataSource; +end; + +function TFieldNameProperty.GetDataSourcePropName: string; +begin + Result := 'DataSource'; +end; + +procedure TFieldNameProperty.GetValueList(AList: TStrings); +var + ADataSource: TDataSource; +begin + ADataSource := GetDataSource; + if (ADataSource <> nil) and (ADataSource.DataSet <> nil) then + ADataSource.DataSet.GetFieldNames(AList); +end; + +{ TcxCustomEditorsLibraryComponentEditor } + +function TcxCustomEditorsLibraryComponentEditor.GetProductMajorVersion: string; +begin + Result := cxEditPropEditorsMajorVersion; +end; + +function TcxCustomEditorsLibraryComponentEditor.GetProductName: string; +begin + Result := cxEditorsLibraryProductName; +end; + +{ TcxEditComponentEditor } + +procedure TcxEditComponentEditor.Edit; +var + AEdit: TcxCustomEdit; + AEventName: string; + AInstance: TObject; + AMethodName: string; + AProperties: TcxCustomEditProperties; +begin + AEdit := TcxCustomEdit(Component); + AMethodName := Component.Name; + if not(AEdit.InnerControl <> nil) and + (GetPropInfo(PTypeInfo(AEdit.ClassInfo), 'OnClick') <> nil) then + begin + AMethodName := AMethodName + 'Click'; + AInstance := AEdit; + AEventName := 'OnClick'; + end + else + begin + AProperties := TcxCustomEditAccess(AEdit).Properties; + if GetPropInfo(PTypeInfo(AProperties.ClassInfo), 'OnChange') <> nil then + begin + AMethodName := AMethodName + 'PropertiesChange'; + AInstance := AProperties; + AEventName := 'OnChange'; + end + else + Exit; + end; + + ShowEventMethod(Designer, AInstance, AEventName, AMethodName, ADefaultMethodParams); +end; + +function TcxEditComponentEditor.InternalGetVerb(Index: Integer): string; +begin + Result := cxEditComponentEditorVerbA[Index]; +end; + +function TcxEditComponentEditor.InternalGetVerbCount: Integer; +begin + Result := Length(cxEditComponentEditorVerbA); +end; + +procedure TcxEditComponentEditor.InternalExecuteVerb(AIndex: Integer); +begin + case AIndex of + 0: + TcxCustomEditAccess(GetEdit).Properties.RestoreDefaults; + 1: + GetEdit.RestoreStyles; + end; + Designer.Modified; +end; + +function TcxEditComponentEditor.GetEdit: TcxCustomEdit; +begin + Result := Component as TcxCustomEdit; +end; + +{ TcxEditRepositoryItemProperty } + +function TcxEditRepositoryItemProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes; + {$IFDEF DELPHI6} + if TcxCustomEdit(GetComponent(0)).RepositoryItem <> nil then + Include(Result, paNotNestable); + {$ENDIF} +end; + +procedure TcxEditRepositoryItemProperty.GetValues(Proc: TGetStrProc); +begin + FStrProc := Proc; + Designer.GetComponentNames(GetTypeData(GetPropType), StrProc); +end; + +procedure TcxEditRepositoryItemProperty.StrProc(const S: string); +var + I: Integer; + ARepositoryItemAcceptable: Boolean; +begin + ARepositoryItemAcceptable := True; + for I := 0 to PropCount - 1 do + if not TcxCustomEdit(GetComponent(I)).IsRepositoryItemAcceptable( + TcxEditRepositoryItem(Designer.GetComponent(S))) then + begin + ARepositoryItemAcceptable := False; + Break; + end; + if ARepositoryItemAcceptable then + FStrProc(S); +end; + +{ TcxLookupEditListSourceProperty } + +function TcxLookupEditListSourceProperty.GetDataSourcePropName: string; +begin + Result := 'ListSource'; +end; + +{ TcxEditPropertiesEventEditor } + +function TcxEditPropertiesEventEditor.GetName: string; +begin + Result := 'Properties'; +end; + +function TcxEditPropertiesEventEditor.GetInstance: TPersistent; +begin + Result := TcxCustomEditAccess(GetComponent(0)).Properties; +end; + +{ TcxEditRepositoryItemPropertiesEventEditor } + +function TcxEditRepositoryItemPropertiesEventEditor.GetName: string; +begin + Result := 'Properties'; +end; + +function TcxEditRepositoryItemPropertiesEventEditor.GetInstance: TPersistent; +begin + Result := TcxEditRepositoryItem(GetComponent(0)).Properties; +end; + +{ TcxNavigatorButtonsEventEditor } + +function TcxNavigatorButtonsEventEditor.GetName: string; +begin + Result := 'Buttons'; +end; + +function TcxNavigatorButtonsEventEditor.GetInstance: TPersistent; +begin + Result := TcxCustomNavigatorAccess(GetComponent(0)).CustomButtons; +end; + +{ TcxGEPropertiesImageIndexProperty } + +function TcxGEPropertiesImageIndexProperty.GetImages: TCustomImageList; +begin + Result := nil; + if GetComponent(0) is TcxImageComboBoxProperties then + Result := TcxImageComboBoxProperties(GetComponent(0)).Images; +end; + +{ TcxGEItemImageIndexProperty } + +function TcxGEItemImageIndexProperty.GetImages: TCustomImageList; +begin + Result := nil; + if GetComponent(0) is TcxImageComboBoxItem then + begin + Result := TcxImageComboBoxProperties(TcxImageComboBoxItems( + TcxImageComboBoxItem(GetComponent(0)).Collection).Owner).LargeImages; + if Result = nil then + Result := TcxImageComboBoxProperties(TcxImageComboBoxItems( + TcxImageComboBoxItem(GetComponent(0)).Collection).Owner).Images; + end; +end; + +{ TcxEditorsLibraryComponentEditorEx } + +function TcxEditorsLibraryComponentEditorEx.GetEditItemcaption: string; +begin + Result := cxEditRepositoryEditorVerb; +end; + +function TcxEditorsLibraryComponentEditorEx.InternalGetVerb(AIndex: Integer): string; +begin + Result := GetEditItemCaption; +end; + +function TcxEditorsLibraryComponentEditorEx.InternalGetVerbCount: Integer; +begin + Result := 1; +end; + +procedure TcxEditorsLibraryComponentEditorEx.InternalExecuteVerb(AIndex: Integer); +begin + ExecuteEditAction; +end; + +{ TcxEditRepositoryComponentEditor } + +procedure TcxEditRepositoryComponentEditor.ExecuteEditAction; +begin + ShowEditRepositoryEditor(Designer, GetEditRepository); +end; + +function TcxEditRepositoryComponentEditor.GetEditRepository: TcxEditRepository; +begin + Result := Component as TcxEditRepository +end; + +{ TcxEditMaskProperty } + +function TcxEditMaskProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paDialog, paMultiSelect]; +end; + +procedure TcxEditMaskProperty.Edit; +var + ADialog: TcxEditMaskEditorDlg; + AMaskEditProperties: TcxCustomMaskEditPropertiesAccess; + APrevEditMask: string; + APrevMaskKind: TcxEditMaskKind; + I: Integer; +begin + AMaskEditProperties := TcxCustomMaskEditPropertiesAccess(GetComponent(0)); + APrevEditMask := AMaskEditProperties.EditMask; + APrevMaskKind := AMaskEditProperties.MaskKind; + ADialog := TcxEditMaskEditorDlg.Create(Application); + try + ADialog.MaskEditProperties := AMaskEditProperties; + if ADialog.ShowModal = mrOk then + for I := 1 to PropCount - 1 do + with TcxCustomMaskEditPropertiesAccess(GetComponent(I)) do + begin + MaskKind := AMaskEditProperties.MaskKind; + EditMask := AMaskEditProperties.EditMask; + end; + if (APrevMaskKind <> AMaskEditProperties.MaskKind) or + (APrevEditMask <> AMaskEditProperties.EditMask) then + Designer.Modified; + finally + ADialog.Free; + end; +end; + +{ TcxTextProperty } + +function TcxTextProperty.GetAttributes: TPropertyAttributes; +begin + if CanShowDialog then + Result := [paDialog] + else + Result := [paMultiSelect]; +end; + +procedure TcxTextProperty.Edit; +var + ADialog: TcxMaskEditTextEditorDlg; +begin + ADialog := TcxMaskEditTextEditorDlg.Create(Application); + try + ADialog.MaskEdit := TcxCustomMaskEdit(GetComponent(0)); + ADialog.ShowModal; + finally + ADialog.Free; + end; +end; + +function TcxTextProperty.CanShowDialog: Boolean; +begin + Result := (PropCount = 1) and + TcxCustomMaskEdit(GetComponent(0)).ActiveProperties.IsMasked; +end; + +{ TGraphicClassNameProperty } + +function TGraphicClassNameProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList, paRevertable]; +end; + +procedure TGraphicClassNameProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for i := 0 to GetRegisteredGraphicClasses.Count - 1 do + Proc(TClass(GetRegisteredGraphicClasses[I]).ClassName); +end; + +{$IFDEF DELPHI6} +{ TcxButtonSelectionEditor } + +procedure TcxButtonSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + Proc('Menus'); + Proc('cxLookAndFeelPainters'); +end; + +procedure TcxComboBoxSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + Proc('cxGraphics'); +end; +{$ENDIF} + +{ TcxFilterControlComponentEditor } + +function TcxFilterControlComponentEditor.GetProductMajorVersion: string; +begin + Result := cxEditPropEditorsMajorVersion; +end; + +function TcxFilterControlComponentEditor.GetProductName: string; +begin + Result := cxEditorsLibraryProductName; +end; + +{ TcxNavigatorControlProperty } + +procedure TcxNavigatorControlProperty.GetValues(Proc: TGetStrProc); +begin + FStrProc := Proc; + Designer.GetComponentNames(GetTypeData(GetPropType), StrProc); +end; + +procedure TcxNavigatorControlProperty.StrProc(const S: string); +var + AComponent: TComponent; +begin + AComponent := Designer.GetComponent(S); + if (AComponent <> nil) and Supports(AComponent, IcxNavigator) then + FStrProc(S); +end; + +{ TcxEditorsLibraryComponentEditor } + +procedure TcxEditorsLibraryComponentEditor.Edit; +begin + ShowEventMethod(Designer, Component, 'OnClick', Component.Name + 'Click', + ADefaultMethodParams); +end; + +{ TcxEditorsLibraryComponentWithStylesEditor } + +function TcxEditorsLibraryComponentWithStylesEditor.GetEditItemCaption: string; +begin + Result := cxCustomEditControlEditorVerbA[1]; +end; + +procedure TcxEditorsLibraryComponentWithStylesEditor.ExecuteEditAction; +begin + RestoreStyles; + Designer.Modified; +end; + +{ TcxEditorsLibraryComponentWithoutStylesEditor } + +function TcxEditorsLibraryComponentWithoutStylesEditor.GetEditItemCaption: string; +begin + Result := cxCustomEditControlEditorVerbA[0]; +end; + +procedure TcxEditorsLibraryComponentWithoutStylesEditor.ExecuteEditAction; +begin + if GetLookAndFeel.AssignedValues <> [] then + begin + GetLookAndFeel.Reset; + Designer.Modified; + end; +end; + +{ TcxEditStyleControllerEditor } + +procedure TcxEditStyleControllerEditor.Edit; +begin + ShowEventMethod(Designer, Component, 'OnStyleChanged', + Component.Name + 'StyleChanged', ADefaultMethodParams); +end; + +procedure TcxEditStyleControllerEditor.RestoreStyles; +begin + TcxEditStyleController(Component).RestoreStyles; +end; + +{ TcxDefaultEditStyleControllerEditor } + +procedure TcxDefaultEditStyleControllerEditor.Edit; +begin + ShowEventMethod(Designer, Component, 'OnStyleChanged', + Component.Name + 'StyleChanged', ADefaultMethodParams); +end; + +procedure TcxDefaultEditStyleControllerEditor.RestoreStyles; +begin + DefaultEditStyleController.RestoreStyles; +end; + +{ TcxCustomButtonComponentEditor } + +function TcxCustomButtonComponentEditor.GetLookAndFeel: TcxLookAndFeel; +begin + Result := TcxCustomButton(Component).LookAndFeel; +end; + +{ TcxRadioButtonComponentEditor } + +function TcxRadioButtonComponentEditor.GetLookAndFeel: TcxLookAndFeel; +begin + Result := TcxRadioButton(Component).LookAndFeel; +end; + +{ TcxContainerComponentEditor } + +procedure TcxContainerComponentEditor.RestoreStyles; +begin + TcxContainer(Component).RestoreStyles; +end; + +{ TcxCustomNavigatorComponentEditor } + +procedure TcxCustomNavigatorComponentEditor.Edit; +var + AButtons: TcxCustomNavigatorButtons; +begin + AButtons := TcxCustomNavigatorAccess(Component).CustomButtons; + ShowEventMethod(Designer, AButtons, 'OnButtonClick', + Component.Name + 'ButtonsButtonClick', cxNavigatorButtonsOnButtonClickEventParams); +end; + +function TcxCustomNavigatorComponentEditor.GetLookAndFeel: TcxLookAndFeel; +begin + Result := TcxCustomNavigator(Component).LookAndFeel; +end; + +function TcxCustomNavigatorComponentEditor.InternalGetVerb(AIndex: Integer): string; +begin + if AIndex = 1 then + Result := cxCustomNavigatorEditorVerb + else + Result := inherited InternalGetVerb(AIndex); +end; + +function TcxCustomNavigatorComponentEditor.InternalGetVerbCount: Integer; +begin + Result := 1 + inherited InternalGetVerbCount; +end; + +procedure TcxCustomNavigatorComponentEditor.InternalExecuteVerb(AIndex: Integer); +begin + if AIndex = 1 then + begin + TcxCustomNavigator(Component).RestoreButtons; + Designer.Modified; + end + else + inherited InternalExecuteVerb(AIndex); +end; + +{ TcxCustomImagePropertiesProperty } + +procedure TcxCustomImagePropertiesProperty.GetProperties(Proc: {$IFNDEF DELPHI6}TGetPropEditProc{$ELSE}TGetPropProc{$ENDIF}); +begin + FProc := Proc; + inherited GetProperties(GetPropProc); +end; + +procedure TcxCustomImagePropertiesProperty.GetPropProc({$IFNDEF DELPHI6}Prop: TPropertyEditor{$ELSE}const Prop: IProperty{$ENDIF}); +var + I: Integer; +begin + if InternalCompareString(Prop.GetName, 'OnGetGraphicClass', False) then + for I := 0 to PropCount - 1 do + if TcxCustomImage(GetComponent(I)).RepositoryItem = nil then + Exit; + FProc(Prop); +end; + +{ TcxEditPropertiesAssignedValuesProperty } + +procedure TcxEditPropertiesAssignedValuesProperty.GetProperties( + Proc: {$IFNDEF DELPHI6}TGetPropEditProc{$ELSE}TGetPropProc{$ENDIF}); +begin + FProc := Proc; + inherited GetProperties(GetPropProc); +end; + +function TcxEditPropertiesAssignedValuesProperty.GetValue: string; +var + AAssignedValues: TcxCustomEditPropertiesValues; + APPropList: PPropList; + APropertyCount: Integer; + I: Integer; +begin + Result := ''; + AAssignedValues := TcxCustomEditPropertiesAccess(GetComponent(0)).AssignedValues; + APropertyCount := GetPropList(GetPropType, [tkUnknown..tkDynArray], nil); + if APropertyCount > 0 then + begin + GetMem(APPropList, APropertyCount * SizeOf(Pointer)); + try + GetPropList(GetPropType, [tkUnknown..tkDynArray], APPropList); + for I := 0 to APropertyCount - 1 do + if Boolean(GetOrdProp(AAssignedValues, APPropList[I])) and + IsVisibleProperty(APPropList[I].Name) then + begin + if Result <> '' then + Result := Result + ','; + Result := Result + APPropList[I].Name; + end; + finally + FreeMem(APPropList); + end; + end; + Result := '[' + Result + ']'; +end; + +procedure TcxEditPropertiesAssignedValuesProperty.GetPropProc( + {$IFNDEF DELPHI6}Prop: TPropertyEditor{$ELSE}const Prop: IProperty{$ENDIF}); +begin + if IsVisibleProperty(Prop.GetName) then + FProc(Prop); +end; + +function TcxEditPropertiesAssignedValuesProperty.IsVisibleProperty( + const APropertyName: string): Boolean; +begin + Result := TypInfo.GetPropInfo(TcxCustomEditProperties(GetComponent(0)), + APropertyName) <> nil; +end; + +{ TcxDefaultEditStyleControllerStyleProperty } + +function TcxDefaultEditStyleControllerStyleProperty.GetStyle: TcxContainerStyle; +begin + Result := DefaultEditStyleController.Style; +end; + +function TcxDefaultEditStyleControllerStyleProperty.IsPropertyVisible( + const APropertyName: string): Boolean; +begin + Result := (APropertyName <> 'StyleController') and + inherited IsPropertyVisible(APropertyName); +end; + +{ TcxNavigatorButtonImageIndexProperty } + +function TcxNavigatorButtonImageIndexProperty.GetImages: TCustomImageList; +begin + Result := TcxNavigatorButton(GetComponent(0)).Buttons.Images; +end; + +{$IFDEF DELPHI10} +{ TcxEditGuidelines } + +function TcxEditGuidelines.GetCount: Integer; +begin + Result := inherited GetCount; + if Edit.HasTextBaseLine then + Inc(Result); +end; + +function TcxEditGuidelines.GetDesignerGuideOffset(Index: Integer): Integer; +begin + if Edit.HasTextBaseLine and (Index = GetCount - 1) then + Result := Edit.GetTextBaseLine + else + Result := inherited GetDesignerGuideOffset(Index); +end; + +function TcxEditGuidelines.GetDesignerGuideType(Index: Integer): TDesignerGuideType; +begin + if Edit.HasTextBaseLine and (Index = GetCount - 1) then + Result := gtBaseline + else + Result := inherited GetDesignerGuideType(Index); +end; + +function TcxEditGuidelines.GetEdit: TcxCustomEdit; +begin + Result := TcxCustomEdit(Component); +end; +{$ENDIF} + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxEditReg.dcr b/official/x.35/ExpressEditors Library 5/Sources/cxEditReg.dcr new file mode 100644 index 00000000..448bf805 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Sources/cxEditReg.dcr differ diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxEditReg.pas b/official/x.35/ExpressEditors Library 5/Sources/cxEditReg.pas new file mode 100644 index 00000000..69fa2be5 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxEditReg.pas @@ -0,0 +1,223 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxEditReg; + +{$I cxVer.inc} + +interface + +uses + Classes, cxEdit; + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI6} + DesignEditors, DesignIntf, VCLEditors, +{$ELSE} + DsgnIntf, +{$ENDIF} + Windows, Controls, DB, Graphics, ImgList, cxBlobEdit, cxButtonEdit, + cxButtons, cxCalc, cxCalendar, cxCheckBox, cxContainer, cxCurrencyEdit, cxDB, + cxDBEdit, cxDBEditRepository, cxDBLookupComboBox, cxDBNavigator, + cxDropDownEdit, cxEditConsts, cxEditPropEditors, cxEditRepositoryEditor, + cxEditRepositoryItems, cxGraphics, cxGroupBox, cxHyperLinkEdit, cxImage, + cxImageComboBox, cxLibraryReg, cxListBox, cxLookAndFeels, cxLookupDBGrid, + cxLookupGrid, cxMaskEdit, cxMemo, cxMRUEdit, cxNavigator, cxPropEditors, + cxRadioGroup, cxSpinEdit, cxTextEdit, cxTimeEdit; + +type + { TcxLookupComboBoxPropertiesFieldNameProperty } + + TcxLookupComboBoxPropertiesFieldNameProperty = class(TFieldNameProperty) + function GetDataSourcePropName: string; override; + end; + + { TcxLookupDBGridColumnFieldNameProperty } + + TcxLookupDBGridColumnFieldNameProperty = class(TFieldNameProperty) + public + function GetDataSource: TDataSource; override; + end; + + TcxLookupDBGridColumnAccess = class(TcxLookupDBGridColumn); + +{ TcxLookupComboBoxPropertiesFieldNameProperty } + +function TcxLookupComboBoxPropertiesFieldNameProperty.GetDataSourcePropName: string; +begin + Result := 'ListSource'; +end; + +{ TcxLookupDBGridColumnFieldNameProperty } + +function TcxLookupDBGridColumnFieldNameProperty.GetDataSource: TDataSource; +begin + Result := TcxLookupDBGridColumnAccess(GetComponent(0) as TcxLookupDBGridColumn).DataController.DataSource; +end; + +procedure RegisterEditRepositoryItems; +begin + RegisterEditRepositoryItem(TcxEditRepositoryTextItem, scxSEditRepositoryTextItem); + RegisterEditRepositoryItem(TcxEditRepositoryButtonItem, scxSEditRepositoryButtonItem); + RegisterEditRepositoryItem(TcxEditRepositoryImageItem, scxSEditRepositoryImageItem); + RegisterEditRepositoryItem(TcxEditRepositoryComboBoxItem, scxSEditRepositoryComboBoxItem); + RegisterEditRepositoryItem(TcxEditRepositoryMaskItem, scxSEditRepositoryMaskItem); + RegisterEditRepositoryItem(TcxEditRepositoryPopupItem, scxSEditRepositoryPopupItem); + RegisterEditRepositoryItem(TcxEditRepositoryCalcItem, scxSEditRepositoryCalcItem); + RegisterEditRepositoryItem(TcxEditRepositoryDateItem, scxSEditRepositoryDateItem); + RegisterEditRepositoryItem(TcxEditRepositoryCurrencyItem, scxSEditRepositoryCurrencyItem); + RegisterEditRepositoryItem(TcxEditRepositorySpinItem, scxSEditRepositorySpinItem); + RegisterEditRepositoryItem(TcxEditRepositoryMemoItem, scxSEditRepositoryMemoItem); + RegisterEditRepositoryItem(TcxEditRepositoryImageComboBoxItem, scxSEditRepositoryImageComboBoxItem); + RegisterEditRepositoryItem(TcxEditRepositoryBlobItem, scxSEditRepositoryBlobItem); + RegisterEditRepositoryItem(TcxEditRepositoryCheckBoxItem, scxSEditRepositoryCheckBoxItem); + RegisterEditRepositoryItem(TcxEditRepositoryTimeItem, scxSEditRepositoryTimeItem); + RegisterEditRepositoryItem(TcxEditRepositoryMRUItem, scxSEditRepositoryMRUItem); + RegisterEditRepositoryItem(TcxEditRepositoryHyperLinkItem, scxSEditRepositoryHyperLinkItem); + RegisterEditRepositoryItem(TcxEditRepositoryLookupComboBoxItem, scxSEditRepositoryLookupComboBoxItem); + RegisterEditRepositoryItem(TcxEditRepositoryRadioGroupItem, scxSEditRepositoryRadioGroupItem); +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterComponents('Express Editors 6', [TcxTextEdit, TcxMaskEdit, TcxMemo, + TcxDateEdit, TcxButtonEdit, TcxCheckBox, TcxComboBox, TcxImageComboBox, + TcxSpinEdit, TcxCalcEdit, TcxHyperLinkEdit, TcxTimeEdit, TcxCurrencyEdit, + TcxImage, TcxBlobEdit, TcxMRUEdit, TcxPopupEdit, TcxLookupComboBox, + TcxRadioButton, TcxRadioGroup, TcxListBox, TcxNavigator]); + RegisterComponents('Express DBEditors 6', [TcxDBTextEdit, TcxDBMaskEdit, TcxDBMemo, + TcxDBDateEdit, TcxDBButtonEdit, TcxDBCheckBox, TcxDBComboBox, TcxDBImageComboBox, + TcxDBSpinEdit, TcxDBCalcEdit, TcxDBHyperLinkEdit, TcxDBTimeEdit, TcxDBCurrencyEdit, + TcxDBImage, TcxDBBlobEdit, TcxDBMRUEdit, TcxDBPopupEdit, TcxDBLookupComboBox, + TcxDBRadioGroup, TcxDBListBox, TcxDBNavigator]); + RegisterComponents('Express Utilities', [TcxButton, TcxGroupBox, + TcxEditStyleController, TcxDefaultEditStyleController, TcxEditRepository]); + + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomEdit, 'PropertiesEvents', TcxEditPropertiesEventEditor); + RegisterPropertyEditor(TypeInfo(TcxEditRepositoryItem), TcxCustomEdit, + 'RepositoryItem', TcxEditRepositoryItemProperty); + + RegisterPropertyEditor(TypeInfo(TColor), TcxCustomGroupBox, 'CaptionBkColor', nil); + RegisterPropertyEditor(TypeInfo(TColor), TcxCustomGroupBox, 'Color', nil); + RegisterPropertyEditor(TypeInfo(TFont), TcxCustomGroupBox, 'Font', nil); + + RegisterPropertyEditor(TypeInfo(string), TcxEditDataBinding, 'DataField', + TcxDataFieldProperty); + RegisterPropertyEditor(TypeInfo(string), TcxCustomDBDataBinding, 'DataField', + TcxDataFieldProperty); + + RegisterPropertyEditor(TypeInfo(TShortCut), TcxCustomEditProperties, 'ClickKey', TShortCutProperty); + RegisterPropertyEditor(TypeInfo(TShortCut), TcxCustomHyperLinkEditProperties, 'StartKey', TShortCutProperty); + RegisterPropertyEditor(TypeInfo(TShortCut), TcxCustomEditProperties, 'ClearKey', TShortCutProperty); + + RegisterPropertyEditor(TypeInfo(TImageIndex), TcxImageComboBoxProperties, 'DefaultImageIndex', TcxGEPropertiesImageIndexProperty); + RegisterPropertyEditor(TypeInfo(TImageIndex), TcxImageComboBoxItem, 'ImageIndex', TcxGEItemImageIndexProperty); + RegisterPropertyEditor(TypeInfo(TImageIndex), TcxNavigatorButton, 'ImageIndex', TcxNavigatorButtonImageIndexProperty); + + RegisterPropertyEditor(TypeInfo(string), TcxImageProperties, 'GraphicClassName', TGraphicClassNameProperty); + RegisterPropertyEditor(TypeInfo(string), TcxImageProperties, 'Caption', TCaptionProperty); + RegisterPropertyEditor(TypeInfo(string), TcxBlobEditProperties, 'PictureGraphicClassName', TGraphicClassNameProperty); + + RegisterComponentEditor(TcxCustomEdit, TcxEditComponentEditor); + RegisterComponentEditor(TcxEditStyleController, TcxEditStyleControllerEditor); + RegisterComponentEditor(TcxDefaultEditStyleController, TcxDefaultEditStyleControllerEditor); + RegisterComponentEditor(TcxCustomButton, TcxCustomButtonComponentEditor); + + RegisterComponentEditor(TcxEditRepository, TcxEditRepositoryComponentEditor); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxEditRepositoryItem, 'PropertiesEvents', TcxEditRepositoryItemPropertiesEventEditor); + RegisterClasses([TcxEditRepositoryItem, TcxEditRepositoryTextItem, TcxEditRepositoryButtonItem]); + RegisterNoIcon([TcxEditRepositoryItem, TcxEditRepositoryTextItem, TcxEditRepositoryButtonItem]); + + RegisterEditRepositoryItems; + + RegisterPropertyEditor(TypeInfo(TcxEditMask), TcxCustomMaskEditProperties, 'EditMask', TcxEditMaskProperty); + RegisterPropertyEditor(TypeInfo(TCaption), TcxCustomMaskEdit, 'Text', TcxTextProperty); + + RegisterPropertyEditor(TypeInfo(TCaption), TcxBlobEdit, 'Text', TCaptionProperty); + RegisterPropertyEditor(TypeInfo(string), TcxLookupComboBoxProperties, 'KeyFieldNames', TcxLookupComboBoxPropertiesFieldNameProperty); + RegisterPropertyEditor(TypeInfo(string), TcxLookupComboBoxProperties, 'ListFieldNames', TcxLookupComboBoxPropertiesFieldNameProperty); + + RegisterPropertyEditor(TypeInfo(string), TcxLookupDBGridColumn, 'FieldName', TcxLookupDBGridColumnFieldNameProperty); +{$IFDEF DELPHI6} + RegisterSelectionEditor(TcxCustomButton, TcxButtonSelectionEditor); + RegisterSelectionEditor(TcxCustomComboBox, TcxComboBoxSelectionEditor); +{$ENDIF} + + RegisterPropertyEditor(TypeInfo(TComponent), TcxCustomNavigatorControl, + 'Control', TcxNavigatorControlProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomNavigator, 'ButtonsEvents', TcxNavigatorButtonsEventEditor); + RegisterComponentEditor(TcxRadioButton, TcxRadioButtonComponentEditor); + RegisterComponentEditor(TcxCustomNavigator, TcxCustomNavigatorComponentEditor); + RegisterComponentEditor(TcxContainer, TcxContainerComponentEditor); + + RegisterPropertyEditor(TypeInfo(TComponent), TcxCustomButton, 'PopupMenu', TcxControlPopupMenuProperty); + RegisterPropertyEditor(TypeInfo(TComponent), TcxRadioButton, 'PopupMenu', TcxControlPopupMenuProperty); + + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomImage, 'PropertiesEvents', TcxCustomImagePropertiesProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomBlobEdit, 'PropertiesEvents', TcxCustomImagePropertiesProperty); + + RegisterPropertyEditor(TypeInfo(TcxLookAndFeel), TcxCustomGroupBox, 'LookAndFeel', nil); + RegisterPropertyEditor(TypeInfo(TImeMode), TcxCustomTextEdit, 'ImeMode', nil); + RegisterPropertyEditor(TypeInfo(TImeName), TcxCustomTextEdit, 'ImeName', nil); + RegisterPropertyEditor(TypeInfo(Boolean), TcxCustomTextEditProperties, + 'HideCursor', nil); + RegisterPropertyEditor(TypeInfo(TcxEditRepositoryItem), TcxGroupBox, + 'RepositoryItem', nil); + RegisterPropertyEditor(TypeInfo(Boolean), TcxCustomButton, 'UseSystemPaint', nil); // deprecated property + RegisterPropertyEditor(TypeInfo(TcxCustomEditPropertiesValues), + TcxCustomEditProperties, 'AssignedValues', TcxEditPropertiesAssignedValuesProperty); + RegisterPropertyEditor(TypeInfo(TCaption), TcxCustomCheckBoxProperties, 'Caption', nil); + RegisterPropertyEditor(TypeInfo(TcxEditStyle), TcxDefaultEditStyleController, + '', TcxDefaultEditStyleControllerStyleProperty); + RegisterPropertyEditor(TypeInfo(TColor), TcxHyperLinkStyle, 'TextColor', nil); + RegisterPropertyEditor(TypeInfo(TcxEditStyle), TcxCustomGroupBox, 'StyleFocused', nil); + RegisterPropertyEditor(TypeInfo(TcxEditStyle), TcxCustomGroupBox, 'StyleHot', nil); + RegisterPropertyEditor(TypeInfo(string), TcxCustomNavigator, 'Hint', nil); + RegisterPropertyEditor(TypeInfo(Boolean), TcxCustomEditProperties, 'Transparent', nil); + RegisterPropertyEditor(TypeInfo(Boolean), TcxCustomHyperLinkEditProperties, 'AutoComplete', nil); +{$IFDEF DELPHI10} + RegisterComponentGuidelines(TcxCustomEdit, TcxEditGuidelines); +{$ENDIF} +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxEditRegisteredRepositoryItems.pas b/official/x.35/ExpressEditors Library 5/Sources/cxEditRegisteredRepositoryItems.pas new file mode 100644 index 00000000..f60c67fb --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxEditRegisteredRepositoryItems.pas @@ -0,0 +1,309 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxEditRegisteredRepositoryItems; + +{$I cxVer.inc} + +interface + +uses + SysUtils, Classes, cxClasses, cxEdit; + +const + cxEditRegisteredItemsStandardVersion = -1; + cxEditRegisteredItemsDefaultVersion = MaxInt; + +type + // TODO: notification!!! + // TODO: BeginUpdate/EndUpdate!!! + + { TcxEditRegisteredRepositoryItems } + + TcxEditRegisteredRepositoryItemsData = record + DataType: Integer; + Version: Integer; + RepositoryItem: TcxEditRepositoryItem; + end; + + TcxEditRegisteredRepositoryItemsDataArray = array of TcxEditRegisteredRepositoryItemsData; + + TcxEditRegisteredRepositoryItems = class(TcxInterfacedPersistent, + IUnknown, IcxEditRepositoryItemListener) // singleton + private + FDestroying: Boolean; + FDefaultItems: TcxEditRegisteredRepositoryItemsDataArray; + FItems: TcxEditRegisteredRepositoryItemsDataArray; + function Find(const AItems: TcxEditRegisteredRepositoryItemsDataArray; + ADataType, AVersion: Integer; AFindItemWithMaxVersion: Boolean; + out AIndex: Integer): Boolean; + function GetCount: Integer; + function GetDefaultCount: Integer; +// function GetDefaultRepositoryItem(Index: Integer): PcxEditRegisteredRepositoryItemsData; +// function GetRepositoryItem(Index: Integer): PcxEditRegisteredRepositoryItemsData; + protected + { IcxEditRepositoryItemListener } + procedure ItemRemoved(Sender: TcxEditRepositoryItem); virtual; + procedure PropertiesChanged(Sender: TcxEditRepositoryItem); virtual; + + function Add(var AItems: TcxEditRegisteredRepositoryItemsDataArray; + ADataType: Integer; AVersion: Integer; + ARepositoryItem: TcxEditRepositoryItem): Integer; virtual; + procedure Changed; virtual; + procedure Clear; + procedure Delete(var AItems: TcxEditRegisteredRepositoryItemsDataArray; + AIndex: Integer); + function FindIndexForInsertion( + const AItems: TcxEditRegisteredRepositoryItemsDataArray; + ADataType, AVersion: Integer; out AIndex: Integer): Boolean; + function FindItemWithMaxVersion( + const AItems: TcxEditRegisteredRepositoryItemsDataArray; + ADataType: Integer): Integer; + property Count: Integer read GetCount; + property DefaultCount: Integer read GetDefaultCount; + property Destroying: Boolean read FDestroying write FDestroying; +// property DefaultItems[Index: Integer]: PcxEditRegisteredRepositoryItemsData read GetDefaultRepositoryItem; +// property Items[Index: Integer]: PcxEditRegisteredRepositoryItemsData read GetRepositoryItem; + public + destructor Destroy; override; + function GetDefaultItem: TcxEditRepositoryItem; virtual; + function GetItem(ADataType: Integer): TcxEditRepositoryItem; virtual; + procedure RegisterDefaultItem(AVersion: Integer; ARepositoryItem: TcxEditRepositoryItem); virtual; + procedure RegisterItem(ADataType: Integer; AVersion: Integer; ARepositoryItem: TcxEditRepositoryItem); virtual; + procedure UnregisterDefaultItem(AVersion: Integer); virtual; + procedure UnregisterItem(ADataType: Integer; AVersion: Integer); virtual; + end; + +implementation + +uses + Math; + +{ TcxEditRegisteredRepositoryItems } + +destructor TcxEditRegisteredRepositoryItems.Destroy; +begin + Destroying := True; + Clear; + inherited Destroy; +end; + +function TcxEditRegisteredRepositoryItems.GetDefaultItem: TcxEditRepositoryItem; +begin + if DefaultCount > 0 then + Result := FDefaultItems[0].RepositoryItem + else + Result := nil; +end; + +function TcxEditRegisteredRepositoryItems.GetItem( + ADataType: Integer): TcxEditRepositoryItem; +var + AIndex: Integer; +begin + AIndex := FindItemWithMaxVersion(FItems, ADataType); + if AIndex <> -1 then + Result := FItems[AIndex].RepositoryItem + else + Result := GetDefaultItem; +end; + +procedure TcxEditRegisteredRepositoryItems.RegisterDefaultItem( + AVersion: Integer; ARepositoryItem: TcxEditRepositoryItem); +begin + Add(FDefaultItems, 0, AVersion, ARepositoryItem); +end; + +procedure TcxEditRegisteredRepositoryItems.RegisterItem(ADataType: Integer; + AVersion: Integer; ARepositoryItem: TcxEditRepositoryItem); +begin + Add(FItems, ADataType, AVersion, ARepositoryItem); +end; + +procedure TcxEditRegisteredRepositoryItems.UnregisterDefaultItem(AVersion: Integer); +var + AIndex: Integer; +begin + if FindIndexForInsertion(FDefaultItems, 0, AVersion, AIndex) then + Delete(FDefaultItems, AIndex); +end; + +procedure TcxEditRegisteredRepositoryItems.UnregisterItem(ADataType: Integer; + AVersion: Integer); +var + AIndex: Integer; +begin + if FindIndexForInsertion(FItems, ADataType, AVersion, AIndex) then + Delete(FItems, AIndex); +end; + +procedure TcxEditRegisteredRepositoryItems.ItemRemoved(Sender: TcxEditRepositoryItem); +var + I: Integer; +begin + for I := DefaultCount - 1 downto 0 do + if FDefaultItems[I].RepositoryItem = Sender then + Delete(FDefaultItems, I); + for I := Count - 1 downto 0 do + if FItems[I].RepositoryItem = Sender then + Delete(FItems, I); +end; + +procedure TcxEditRegisteredRepositoryItems.PropertiesChanged(Sender: TcxEditRepositoryItem); +begin + Changed; +end; + +function TcxEditRegisteredRepositoryItems.Add( + var AItems: TcxEditRegisteredRepositoryItemsDataArray; ADataType: Integer; + AVersion: Integer; ARepositoryItem: TcxEditRepositoryItem): Integer; +begin + if FindIndexForInsertion(AItems, ADataType, AVersion, Result) then + Exit; + SetLength(AItems, Length(AItems) + 1); + if Result < Length(AItems) - 1 then + Move(AItems[Result], AItems[Result + 1], + (Length(AItems) - Result - 1) * SizeOf(TcxEditRegisteredRepositoryItemsData)); + AItems[Result].DataType := ADataType; + AItems[Result].Version := AVersion; + AItems[Result].RepositoryItem := ARepositoryItem; + ARepositoryItem.AddListener(Self); + Changed; +end; + +procedure TcxEditRegisteredRepositoryItems.Changed; +begin + if Destroying then Exit; + // TODO: notification +end; + +procedure TcxEditRegisteredRepositoryItems.Clear; +begin + while DefaultCount > 0 do + Delete(FDefaultItems, DefaultCount - 1); + while Count > 0 do + Delete(FItems, Count - 1); +end; + +procedure TcxEditRegisteredRepositoryItems.Delete( + var AItems: TcxEditRegisteredRepositoryItemsDataArray; AIndex: Integer); +begin + AItems[AIndex].RepositoryItem.RemoveListener(Self); + if AIndex < Length(AItems) - 1 then + Move(AItems[AIndex + 1], AItems[AIndex], + (Length(AItems) - AIndex - 1) * SizeOf(TcxEditRegisteredRepositoryItemsData)); + SetLength(AItems, Length(AItems) - 1); + Changed; +end; + +function TcxEditRegisteredRepositoryItems.FindIndexForInsertion( + const AItems: TcxEditRegisteredRepositoryItemsDataArray; + ADataType, AVersion: Integer; out AIndex: Integer): Boolean; +begin + Result := Find(AItems, ADataType, AVersion, False, AIndex); +end; + +function TcxEditRegisteredRepositoryItems.FindItemWithMaxVersion( + const AItems: TcxEditRegisteredRepositoryItemsDataArray; + ADataType: Integer): Integer; +var + AIndex: Integer; +begin + if Find(AItems, ADataType, 0, True, AIndex) then + Result := AIndex + else + Result := -1; +end; + +function TcxEditRegisteredRepositoryItems.Find( + const AItems: TcxEditRegisteredRepositoryItemsDataArray; + ADataType, AVersion: Integer; AFindItemWithMaxVersion: Boolean; + out AIndex: Integer): Boolean; + + function Compare(const AItem1, AItem2: TcxEditRegisteredRepositoryItemsData): Integer; + begin + Result := Sign(AItem1.DataType - AItem2.DataType); + if (Result = 0) and not AFindItemWithMaxVersion then + Result := Sign(AItem1.Version - AItem2.Version); + end; + +var + AItem, ATempItem: TcxEditRegisteredRepositoryItemsData; + AItemCount, H, I, L: Integer; +begin + AItem.DataType := ADataType; + AItem.Version := AVersion; + AItemCount := Length(AItems); + L := 0; + H := AItemCount - 1; + I := 0; + while L <= H do + begin + I := (L + H) div 2; + ATempItem := AItems[I]; + case Compare(ATempItem, AItem) of + -1: + L := I + 1; + 0: + Break; + else + H := I - 1 + end; + end; + + if L > H then + AIndex := L + else + AIndex := I; + + if AFindItemWithMaxVersion then + while (AIndex < AItemCount - 1) and (AItems[AIndex + 1].DataType = AItem.DataType) do + Inc(AIndex); + + Result := (AIndex < AItemCount) and (AItems[AIndex].DataType = AItem.DataType) and + (AFindItemWithMaxVersion or (AItems[AIndex].Version = AItem.Version)); +end; + +function TcxEditRegisteredRepositoryItems.GetCount: Integer; +begin + Result := Length(FItems); +end; + +function TcxEditRegisteredRepositoryItems.GetDefaultCount: Integer; +begin + Result := Length(FDefaultItems); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxEditRepositoryEditor.dfm b/official/x.35/ExpressEditors Library 5/Sources/cxEditRepositoryEditor.dfm new file mode 100644 index 00000000..604d88ab --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxEditRepositoryEditor.dfm @@ -0,0 +1,86 @@ +inherited cxEditRepositoryEditor: TcxEditRepositoryEditor + Left = 363 + Top = 194 + Width = 353 + Height = 416 + Caption = 'EditRepository editor' + Constraints.MinHeight = 200 + Constraints.MinWidth = 350 + PopupMenu = PopupMenu1 + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object LBItems: TListBox + Left = 0 + Top = 0 + Width = 258 + Height = 382 + Align = alClient + ItemHeight = 13 + MultiSelect = True + Sorted = True + TabOrder = 0 + OnClick = LBItemsClick + end + object Panel1: TPanel + Left = 258 + Top = 0 + Width = 87 + Height = 382 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object btAdd: TButton + Left = 6 + Top = 8 + Width = 75 + Height = 25 + Caption = '&Add...' + TabOrder = 0 + OnClick = btAddClick + end + object btDelete: TButton + Left = 6 + Top = 40 + Width = 75 + Height = 25 + Caption = '&Delete' + TabOrder = 1 + OnClick = btDeleteClick + end + object btClose: TButton + Left = 6 + Top = 356 + Width = 75 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = '&Close' + TabOrder = 2 + OnClick = btCloseClick + end + end + object PopupMenu1: TPopupMenu + Left = 32 + Top = 16 + object miAdd: TMenuItem + Caption = 'Add' + ShortCut = 45 + OnClick = miAddClick + end + object miDelete: TMenuItem + Caption = 'Delete' + Enabled = False + ShortCut = 46 + OnClick = miDeleteClick + end + object N1: TMenuItem + Caption = '-' + end + object miSelectAll: TMenuItem + Caption = 'Select all' + Enabled = False + ShortCut = 16449 + OnClick = miSelectAllClick + end + end +end diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxEditRepositoryEditor.pas b/official/x.35/ExpressEditors Library 5/Sources/cxEditRepositoryEditor.pas new file mode 100644 index 00000000..99f8abd6 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxEditRepositoryEditor.pas @@ -0,0 +1,327 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxEditRepositoryEditor; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + DesignIntf, + Variants, +{$ELSE} + DsgnIntf, +{$ENDIF} + Windows, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, cxDesignWindows, StdCtrls, cxEdit, Menus, ExtCtrls; + +type + TcxEditRepositoryEditor = class(TcxDesignFormEditor) + LBItems: TListBox; + btAdd: TButton; + btDelete: TButton; + btClose: TButton; + Panel1: TPanel; + PopupMenu1: TPopupMenu; + miAdd: TMenuItem; + miDelete: TMenuItem; + N1: TMenuItem; + miSelectAll: TMenuItem; + procedure LBItemsClick(Sender: TObject); + procedure btDeleteClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btAddClick(Sender: TObject); + procedure SelectItem(AItem: TObject); + procedure miAddClick(Sender: TObject); + procedure miDeleteClick(Sender: TObject); + procedure miSelectAllClick(Sender: TObject); + private + function GetEditRepository: TcxEditRepository; + procedure UpdateButtons; + procedure UpdateDesigner(Sender: TObject); + procedure UpdateItems; + protected + procedure InitFormEditor; override; + public + procedure DoItemsModified; override; + procedure SelectionsChanged(const ASelection: TDesignerSelectionList); override; + property EditRepository: TcxEditRepository read GetEditRepository; + end; + +procedure RegisterEditRepositoryItem( + AEditRepositoryItemClass: TcxEditRepositoryItemClass; const ADescription: string); +procedure UnRegisterEditRepositoryItem( + AEditRepositoryItemClass: TcxEditRepositoryItemClass); + +procedure ShowEditRepositoryEditor(ADesigner: IDesigner; + AEditRepository: TcxEditRepository); + +procedure GenEditRepositoryItemName(AEditRepository: TcxEditRepository; + AItem: TcxEditRepositoryItem); + +implementation + +{$R *.dfm} + +uses + cxClasses, cxSelectEditRepositoryItem; + +var + EditRepositoryList: TcxRegisteredClasses; + SetupSelectData: TcxSelectRepositoryItemSetup; + +procedure RegisterEditRepositoryItem( + AEditRepositoryItemClass: TcxEditRepositoryItemClass; const ADescription: string); +begin + EditRepositoryList.Register(AEditRepositoryItemClass, ADescription) +end; + +procedure UnRegisterEditRepositoryItem( + AEditRepositoryItemClass: TcxEditRepositoryItemClass); +begin + EditRepositoryList.UnRegister(AEditRepositoryItemClass); +end; + +procedure ShowEditRepositoryEditor(ADesigner: IDesigner; + AEditRepository: TcxEditRepository); +begin + ShowFormEditorClass(ADesigner, AEditRepository, TcxEditRepositoryEditor); +end; + +procedure GenEditRepositoryItemName(AEditRepository: TcxEditRepository; + AItem: TcxEditRepositoryItem); +var + ABaseName: string; + I: Integer; +begin + ABaseName := AItem.GetBaseName; + I := 1; + while I <> -1 do + try + AItem.Name := ABaseName + IntToStr(I); + I := -1; + except + on EComponentError do //Ignore rename errors + Inc(I); + end; +end; + +procedure TcxEditRepositoryEditor.LBItemsClick(Sender: TObject); +var + AList: TList; + I: Integer; +begin + AList := TList.Create; + try + for I := 0 to LBItems.Items.Count - 1 do + if LBItems.Selected[I] then + AList.Add(LBItems.Items.Objects[I]); + SelectComponents(AList, EditRepository); + finally + AList.Free; + end; + UpdateButtons; +end; + +function TcxEditRepositoryEditor.GetEditRepository: TcxEditRepository; +begin + Result := Component as TcxEditRepository; +end; + +procedure TcxEditRepositoryEditor.UpdateButtons; +begin + btDelete.Enabled := LBItems.SelCount <> 0; + miDelete.Enabled := btDelete.Enabled; + miSelectAll.Enabled := btDelete.Enabled; +end; + +procedure TcxEditRepositoryEditor.btDeleteClick(Sender: TObject); + + function FindItemToSelect: TObject; + var + I: Integer; + begin + Result := nil; + with LBItems do + begin + if ItemIndex = -1 then Exit; + if not Selected[ItemIndex] then + Result := Items.Objects[ItemIndex] + else + begin + for I := ItemIndex + 1 to Items.Count - 1 do + if not Selected[I] then + begin + Result := Items.Objects[I]; + Exit + end; + for I := ItemIndex - 1 downto 0 do + if not Selected[I] then + begin + Result := Items.Objects[I]; + Exit + end; + end; + end; + end; + +var + I: Integer; + AItem: TObject; +begin + if LBItems.SelCount > 0 then + begin + AItem := FindItemToSelect; + for I := 0 to LBItems.Items.Count - 1 do + if LBItems.Selected[I] then + TcxEditRepositoryItem(LBItems.Items.Objects[I]).Free; + UpdateItems; + SelectItem(AItem); + UpdateButtons; + UpdateDesigner(nil); + LBItemsClick(nil); + end; +end; + +procedure TcxEditRepositoryEditor.UpdateDesigner(Sender: TObject); +begin + Designer.Modified; +end; + +procedure TcxEditRepositoryEditor.UpdateItems; +var + I, AItemIndex, ATopIndex: Integer; + ASelection: TStringList; +begin + ListBoxSaveSelection(LBItems, ASelection, AItemIndex, ATopIndex); + try + LBItems.Items.Clear; + for I := 0 to EditRepository.Count - 1 do + LBItems.Items.AddObject(EditRepository.Items[I].Name, EditRepository.Items[I]); + finally + ListBoxRestoreSelection(LBItems, ASelection, AItemIndex, ATopIndex); + end; +end; + +procedure TcxEditRepositoryEditor.InitFormEditor; +begin + inherited InitFormEditor; + UpdateItems; + UpdateSelection; + UpdateButtons; +end; + +procedure TcxEditRepositoryEditor.DoItemsModified; +begin + UpdateItems; +end; + +procedure TcxEditRepositoryEditor.SelectionsChanged( + const ASelection: TDesignerSelectionList); +var + AList: TList; +begin + AList := TList.Create; + try + GetSelectionList(AList); + ListBoxSyncSelection(LBItems, AList); + finally + AList.Free; + end; + UpdateButtons; +end; + +procedure TcxEditRepositoryEditor.btCloseClick(Sender: TObject); +begin + Close; +end; + +procedure TcxEditRepositoryEditor.btAddClick(Sender: TObject); +var + AEditRepositoryItemClass: TcxEditRepositoryItemClass; + AItem: TcxEditRepositoryItem; +begin + with SetupSelectData do + List := EditRepositoryList; + AEditRepositoryItemClass := GetEditRepositoryItemClass(SetupSelectData); + if AEditRepositoryItemClass <> nil then + begin + with EditRepository do + AItem := CreateItemEx(AEditRepositoryItemClass, Owner); + GenEditRepositoryItemName(EditRepository, AItem); + UpdateItems; + SelectItem(AItem); + UpdateButtons; + UpdateDesigner(nil); + end; +end; + +procedure TcxEditRepositoryEditor.SelectItem(AItem: TObject); +begin + LBItems.ItemIndex := LBItems.Items.IndexOfObject(AItem); + ListBoxClearSelection(LBItems); + if Component <> nil then + if AItem <> nil then + Designer.SelectComponent(TComponent(AItem)) + else + Designer.SelectComponent(Component) +end; + +procedure TcxEditRepositoryEditor.miAddClick(Sender: TObject); +begin + btAddClick(nil); +end; + +procedure TcxEditRepositoryEditor.miDeleteClick(Sender: TObject); +begin + btDeleteClick(nil); +end; + +procedure TcxEditRepositoryEditor.miSelectAllClick(Sender: TObject); +begin + ListBoxSelectAll(LBItems); + LBItemsClick(nil); +end; + +initialization + SetupSelectData.Pos := Point(-1, -1); + EditRepositoryList := TcxRegisteredClasses.Create; + +finalization + FreeAndNil(EditRepositoryList); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxEditRepositoryItems.pas b/official/x.35/ExpressEditors Library 5/Sources/cxEditRepositoryItems.pas new file mode 100644 index 00000000..902ddd41 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxEditRepositoryItems.pas @@ -0,0 +1,605 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxEditRepositoryItems; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, ComCtrls, Classes, SysUtils, Graphics, Controls, StdCtrls, + Forms, cxClasses, cxEdit, cxTextEdit, cxButtonEdit, cxDropDownEdit, cxImage, + cxMaskEdit, cxCalendar, cxCurrencyEdit, cxSpinEdit, cxMemo, cxImageComboBox, + cxBlobEdit, cxCalc, cxCheckBox, cxTimeEdit, cxHyperLinkEdit, cxMRUEdit, + cxRadioGroup; + +type + + { TcxEditRepositoryTextItem } + + TcxEditRepositoryTextItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxTextEditProperties; + procedure SetProperties(Value: TcxTextEditProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxTextEditProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryButtonItem } + + TcxEditRepositoryButtonItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxButtonEditProperties; + procedure SetProperties(Value: TcxButtonEditProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxButtonEditProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryImageItem } + + TcxEditRepositoryImageItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxImageProperties; + procedure SetProperties(Value: TcxImageProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxImageProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryComboBoxItem } + + TcxEditRepositoryComboBoxItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxComboBoxProperties; + procedure SetProperties(Value: TcxComboBoxProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxComboBoxProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryMaskItem } + + TcxEditRepositoryMaskItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxMaskEditProperties; + procedure SetProperties(Value: TcxMaskEditProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxMaskEditProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryPopupItem } + + TcxEditRepositoryPopupItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxPopupEditProperties; + procedure SetProperties(Value: TcxPopupEditProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxPopupEditProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryCalcItem } + + TcxEditRepositoryCalcItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxCalcEditProperties; + procedure SetProperties(Value: TcxCalcEditProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxCalcEditProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryDateItem } + + TcxEditRepositoryDateItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxDateEditProperties; + procedure SetProperties(Value: TcxDateEditProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxDateEditProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryCurrencyItem } + + TcxEditRepositoryCurrencyItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxCurrencyEditProperties; + procedure SetProperties(Value: TcxCurrencyEditProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxCurrencyEditProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositorySpinItem } + + TcxEditRepositorySpinItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxSpinEditProperties; + procedure SetProperties(Value: TcxSpinEditProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxSpinEditProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryMemoItem } + + TcxEditRepositoryMemoItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxMemoProperties; + procedure SetProperties(Value: TcxMemoProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxMemoProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryImageComboBoxItem } + + TcxEditRepositoryImageComboBoxItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxImageComboBoxProperties; + procedure SetProperties(Value: TcxImageComboBoxProperties); + protected + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxImageComboBoxProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryBlobItem } + + TcxEditRepositoryBlobItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxBlobEditProperties; + procedure SetProperties(Value: TcxBlobEditProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxBlobEditProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryCheckBoxItem } + + TcxEditRepositoryCheckBoxItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxCheckBoxProperties; + procedure SetProperties(Value: TcxCheckBoxProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxCheckBoxProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryTimeItem } + + TcxEditRepositoryTimeItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxTimeEditProperties; + procedure SetProperties(Value: TcxTimeEditProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxTimeEditProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryMRUItem } + + TcxEditRepositoryMRUItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxMRUEditProperties; + procedure SetProperties(Value: TcxMRUEditProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxMRUEditProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryHyperLinkItem } + + TcxEditRepositoryHyperLinkItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxHyperLinkEditProperties; + procedure SetProperties(Value: TcxHyperLinkEditProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxHyperLinkEditProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryRadioGroupItem } + + TcxEditRepositoryRadioGroupItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxRadioGroupProperties; + procedure SetProperties(Value: TcxRadioGroupProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxRadioGroupProperties read GetProperties write SetProperties; + end; + +implementation + +{ TcxEditRepositoryTextItem } + +class function TcxEditRepositoryTextItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxTextEditProperties; +end; + +function TcxEditRepositoryTextItem.GetProperties: TcxTextEditProperties; +begin + Result := inherited Properties as TcxTextEditProperties; +end; + +procedure TcxEditRepositoryTextItem.SetProperties(Value: TcxTextEditProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryButtonItem } + +class function TcxEditRepositoryButtonItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxButtonEditProperties; +end; + +function TcxEditRepositoryButtonItem.GetProperties: TcxButtonEditProperties; +begin + Result := inherited Properties as TcxButtonEditProperties; +end; + +procedure TcxEditRepositoryButtonItem.SetProperties(Value: TcxButtonEditProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryImageItem } + +class function TcxEditRepositoryImageItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxImageProperties; +end; + +function TcxEditRepositoryImageItem.GetProperties: TcxImageProperties; +begin + Result := inherited Properties as TcxImageProperties; +end; + +procedure TcxEditRepositoryImageItem.SetProperties(Value: TcxImageProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryComboBoxItem } + +class function TcxEditRepositoryComboBoxItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxComboBoxProperties; +end; + +function TcxEditRepositoryComboBoxItem.GetProperties: TcxComboBoxProperties; +begin + Result := inherited Properties as TcxComboBoxProperties; +end; + +procedure TcxEditRepositoryComboBoxItem.SetProperties(Value: TcxComboBoxProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryMaskItem } + +class function TcxEditRepositoryMaskItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxMaskEditProperties; +end; + +function TcxEditRepositoryMaskItem.GetProperties: TcxMaskEditProperties; +begin + Result := inherited Properties as TcxMaskEditProperties; +end; + +procedure TcxEditRepositoryMaskItem.SetProperties(Value: TcxMaskEditProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryPopupItem } + +class function TcxEditRepositoryPopupItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxPopupEditProperties; +end; + +function TcxEditRepositoryPopupItem.GetProperties: TcxPopupEditProperties; +begin + Result := inherited Properties as TcxPopupEditProperties; +end; + +procedure TcxEditRepositoryPopupItem.SetProperties(Value: TcxPopupEditProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryCalcItem } + +class function TcxEditRepositoryCalcItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCalcEditProperties; +end; + +function TcxEditRepositoryCalcItem.GetProperties: TcxCalcEditProperties; +begin + Result := inherited Properties as TcxCalcEditProperties; +end; + +procedure TcxEditRepositoryCalcItem.SetProperties(Value: TcxCalcEditProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryDateItem } + +class function TcxEditRepositoryDateItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxDateEditProperties; +end; + +function TcxEditRepositoryDateItem.GetProperties: TcxDateEditProperties; +begin + Result := inherited Properties as TcxDateEditProperties; +end; + +procedure TcxEditRepositoryDateItem.SetProperties(Value: TcxDateEditProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryCurrencyItem } + +class function TcxEditRepositoryCurrencyItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCurrencyEditProperties; +end; + +function TcxEditRepositoryCurrencyItem.GetProperties: TcxCurrencyEditProperties; +begin + Result := inherited Properties as TcxCurrencyEditProperties; +end; + +procedure TcxEditRepositoryCurrencyItem.SetProperties(Value: TcxCurrencyEditProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositorySpinItem } + +class function TcxEditRepositorySpinItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxSpinEditProperties; +end; + +function TcxEditRepositorySpinItem.GetProperties: TcxSpinEditProperties; +begin + Result := inherited Properties as TcxSpinEditProperties; +end; + +procedure TcxEditRepositorySpinItem.SetProperties(Value: TcxSpinEditProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryMemoItem } + +class function TcxEditRepositoryMemoItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxMemoProperties; +end; + +function TcxEditRepositoryMemoItem.GetProperties: TcxMemoProperties; +begin + Result := inherited Properties as TcxMemoProperties; +end; + +procedure TcxEditRepositoryMemoItem.SetProperties(Value: TcxMemoProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryImageComboBoxItem } + +class function TcxEditRepositoryImageComboBoxItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxImageComboBoxProperties; +end; + +function TcxEditRepositoryImageComboBoxItem.GetProperties: TcxImageComboBoxProperties; +begin + Result := inherited Properties as TcxImageComboBoxProperties; +end; + +procedure TcxEditRepositoryImageComboBoxItem.SetProperties(Value: TcxImageComboBoxProperties); +begin + inherited Properties := Value; +end; + +procedure TcxEditRepositoryImageComboBoxItem.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and not (csDestroying in ComponentState) then + with TcxImageComboBoxProperties(Properties) do + begin + if AComponent = Images then Images := nil; + if AComponent = LargeImages then LargeImages := nil; + end; +end; + +{ TcxEditRepositoryBlobItem } + +class function TcxEditRepositoryBlobItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxBlobEditProperties; +end; + +function TcxEditRepositoryBlobItem.GetProperties: TcxBlobEditProperties; +begin + Result := inherited Properties as TcxBlobEditProperties; +end; + +procedure TcxEditRepositoryBlobItem.SetProperties(Value: TcxBlobEditProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryCheckBoxItem } + +class function TcxEditRepositoryCheckBoxItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCheckBoxProperties; +end; + +function TcxEditRepositoryCheckBoxItem.GetProperties: TcxCheckBoxProperties; +begin + Result := inherited Properties as TcxCheckBoxProperties; +end; + +procedure TcxEditRepositoryCheckBoxItem.SetProperties(Value: TcxCheckBoxProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryTimeItem } + +class function TcxEditRepositoryTimeItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxTimeEditProperties; +end; + +function TcxEditRepositoryTimeItem.GetProperties: TcxTimeEditProperties; +begin + Result := inherited Properties as TcxTimeEditProperties; +end; + +procedure TcxEditRepositoryTimeItem.SetProperties(Value: TcxTimeEditProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryMRUItem } + +class function TcxEditRepositoryMRUItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxMRUEditProperties; +end; + +function TcxEditRepositoryMRUItem.GetProperties: TcxMRUEditProperties; +begin + Result := inherited Properties as TcxMRUEditProperties; +end; + +procedure TcxEditRepositoryMRUItem.SetProperties(Value: TcxMRUEditProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryHyperLinkItem } + +class function TcxEditRepositoryHyperLinkItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxHyperLinkEditProperties; +end; + +function TcxEditRepositoryHyperLinkItem.GetProperties: TcxHyperLinkEditProperties; +begin + Result := inherited Properties as TcxHyperLinkEditProperties; +end; + +procedure TcxEditRepositoryHyperLinkItem.SetProperties(Value: TcxHyperLinkEditProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryRadioGroupItem } + +class function TcxEditRepositoryRadioGroupItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxRadioGroupProperties; +end; + +function TcxEditRepositoryRadioGroupItem.GetProperties: TcxRadioGroupProperties; +begin + Result := inherited Properties as TcxRadioGroupProperties; +end; + +procedure TcxEditRepositoryRadioGroupItem.SetProperties(Value: TcxRadioGroupProperties); +begin + inherited Properties := Value; +end; + +initialization + RegisterClasses([TcxEditRepositoryItem, TcxEditRepositoryTextItem, + TcxEditRepositoryButtonItem, TcxEditRepositoryImageItem, + TcxEditRepositoryComboBoxItem, TcxEditRepositoryMaskItem, + TcxEditRepositoryPopupItem, TcxEditRepositoryCalcItem, + TcxEditRepositoryDateItem, TcxEditRepositoryCurrencyItem, + TcxEditRepositorySpinItem, TcxEditRepositoryMemoItem, + TcxEditRepositoryImageComboBoxItem, TcxEditRepositoryBlobItem, + TcxEditRepositoryCheckBoxItem, TcxEditRepositoryTimeItem, + TcxEditRepositoryMRUItem, TcxEditRepositoryHyperLinkItem, + TcxEditRepositoryRadioGroupItem]); + {$IFDEF DELPHI6} + StartClassGroup(TControl); + GroupDescendentsWith(TcxEditRepositoryItem, TControl); + GroupDescendentsWith(TcxEditRepository, TControl); + {$ENDIF} + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxEditUtils.pas b/official/x.35/ExpressEditors Library 5/Sources/cxEditUtils.pas new file mode 100644 index 00000000..dce2ee00 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxEditUtils.pas @@ -0,0 +1,840 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxEditUtils; + +{$I cxVer.inc} + +interface + +{.$DEFINE NOFLICKER} + +uses + Windows, + dxThemeManager, +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Classes, Controls, Forms, Graphics, ImgList, StdCtrls, SysUtils, + cxContainer, cxControls, cxEdit, cxEditPaintUtils, + cxGraphics, cxLookAndFeels, cxLookAndFeelPainters, cxScrollBar; + +const + cxEditButtonMaxBorderWidth = 2; + cxEditMaxBorderWidth = cxContainerMaxBorderWidth; + cxEditMaxCheckBoxBorderWidth = 2; + cxEditShadowWidth = cxContainerShadowWidth; + +type + TcxEditCanvasHandle = HDC; + +function CalculateEditDefaultButtonWidth(ACanvas: TcxCanvas; AViewInfo: TcxEditButtonViewInfo): Integer; +procedure cxEditFillRect(ACanvas: TCanvas; const R: TRect; AColor: TColor); overload; +procedure cxEditFillRect(ACanvas: TcxCanvas; const R: TRect; AColor: TColor); overload; +procedure cxEditFillRect(ACanvasHandle: TcxEditCanvasHandle; const R: TRect; + ABrush: TBrushHandle); overload; +function cxOffsetRect(var ARect: TRect; AOffset: TPoint): Boolean; +function cxTextOutFlagsToDrawTextFlags(AFlags: DWORD): Integer; +procedure DrawArrow(ACanvas: TcxCanvas; AArrowSize: Integer; AContentRect: TRect; + AArrowDirection: TcxArrowDirection; AIsDoubleArrow: Boolean; + AOffsetContent: Boolean; AColor: TColor); +procedure DrawButtonBorder(ACanvas: TcxCanvas; var ARect: TRect; + ABorders: TcxBorders; AColor: TColor); +procedure DrawCustomEdit(ACanvas: TcxCanvas; AViewInfo: TcxCustomEditViewInfo; + ADrawBackground: Boolean; ABackgroundStyle: TcxEditBackgroundPaintingStyle); +function DrawTextFlagsTocxTextOutFlags(AFlags: DWORD): Integer; +procedure DrawGlyph(ACanvas: TCanvas; X, Y: Integer; AGlyph: TBitmap; + AEnabled: Boolean; ABrushColor: TColor = clNone; ABackgroundBitmap: TBitmap = nil); overload; +procedure DrawGlyph(ACanvas: TcxCanvas; X, Y: Integer; AGlyph: TBitmap; + AEnabled: Boolean; ABrushColor: TColor = clNone; ABackgroundBitmap: TBitmap = nil); overload; +procedure DrawGlyph(ACanvas: TcxCanvas; AImageList: TCustomImageList; + AImageIndex: TImageIndex; + const AGlyphRect: TRect; ABrushColor: TColor; AEnabled: Boolean; + ABackgroundBitmap: TBitmap = nil); overload; +function GetArrowSize(const AContentSize: TSize; AArrowDirection: TcxArrowDirection): TSize; +function GetEditButtonsContentVerticalOffset(ACanvas: TcxCanvas; + AButtonsStyle: TcxEditButtonStyle; ANativeStyle: Boolean): Integer; +function GetHotTrackColor: TColor; +function GetNativeInnerTextEditContentHeightCorrection( + AProperties: TcxCustomEditProperties; AIsInplace: Boolean): Integer; +function GetEditButtonRegion(ACanvas: TcxCanvas; AViewInfo: TcxEditButtonViewInfo): TcxRegion; +function GetEditBorderHighlightColor(AIsOffice11Style: Boolean): TColor; +function GetEditButtonHighlightColor(APressed: Boolean; + AIsOffice11Style: Boolean): TColor; +function GetPainterClass(ANativeStyle: Boolean; + ALookAndFeel: TcxLookAndFeelKind): TcxCustomLookAndFeelPainterClass; +procedure InternalFillRect(ACanvas: TcxCanvas; const AOuterRect, AInternalRect: TRect; + ABrush: TBrushHandle); +procedure InternalPolyLine(ACanvas: TcxCanvas; const Points: array of TPoint; + AColor: TColor; AOrtoDrawing: Boolean = False); +function IsShadowDrawingNeeded(AViewData: TcxCustomEditViewData): Boolean; +procedure RestoreCanvasFont(ACanvas: TcxCanvas; const ASavedLogFont: TLogFont); +procedure SaveCanvasFont(ACanvas: TcxCanvas; out ALogFont: TLogFont); +function VerifyBitmap(ABitmap: TBitmap): Boolean; +function VerifyImages(AImages: TCustomImageList): Boolean; + +implementation + +uses + Messages, cxClasses, cxDrawTextUtils, dxOffice11, dxThemeConsts, dxUxTheme, cxGeometry, cxDWMApi; + +const + cxEditButtonContentVerticalOffset: array [TcxEditButtonStyle] of Integer = + (0, 4, 2, 2, 2, 2, 2); + +var + FIsWin98Or2000: Boolean = False; + +procedure RetrieveWindowsVersion; +var + AInfo: TOSVersionInfo; +begin + AInfo.dwOSVersionInfoSize := SizeOf(AInfo); + GetVersionEx(AInfo); + with AInfo do + FIsWin98Or2000 := + (dwPlatformId = VER_PLATFORM_WIN32_WINDOWS) and (dwMinorVersion <> 0) or + (dwPlatformId = VER_PLATFORM_WIN32_NT) and (dwMajorVersion = 5); +end; + +procedure DrawArrow(ACanvas: TcxCanvas; AArrowSize: Integer; AContentRect: TRect; + AArrowDirection: TcxArrowDirection; AIsDoubleArrow: Boolean; + AOffsetContent: Boolean; AColor: TColor); +var + AArrowBrush: TBrushHandle; + AArrowRect: TRect; + + procedure InternalDrawArrow; + var + I: Integer; + R: TRect; + begin + case AArrowDirection of + adLeft: + begin + with AArrowRect do + R := Rect(Left, Top + AArrowSize - 1, Left + 1, Top + AArrowSize); + with R do + for I := 1 to AArrowSize do + begin + cxEditFillRect(ACanvas.Handle, R, AArrowBrush); + Inc(Left); + Dec(Top); + Inc(Right); + Inc(Bottom); + end; + Inc(AArrowRect.Left, AArrowSize); + end; + adRight: + begin + with AArrowRect do + R := Rect(Left, Top, Left + 1, Bottom); + with R do + for I := 1 to AArrowSize do + begin + cxEditFillRect(ACanvas.Handle, R, AArrowBrush); + Inc(Left); + Inc(Top); + Inc(Right); + Dec(Bottom); + end; + Inc(AArrowRect.Left, AArrowSize); + end; + adUp: + begin + with AArrowRect do + R := Rect(Left + AArrowSize - 1, Top, Left + AArrowSize, Top + 1); + with R do + for I := 1 to AArrowSize do + begin + cxEditFillRect(ACanvas.Handle, R, AArrowBrush); + Dec(Left); + Inc(Top); + Inc(Right); + Inc(Bottom); + end; + Inc(AArrowRect.Top, AArrowSize); + end; + adDown: + begin + with AArrowRect do + R := Rect(Left, Top, Right, Top + 1); + with R do + for I := 1 to AArrowSize do + begin + cxEditFillRect(ACanvas.Handle, R, AArrowBrush); + Inc(Left); + Inc(Top); + Dec(Right); + Inc(Bottom); + end; + Inc(AArrowRect.Top, AArrowSize); + end; + end; + end; + +var + AArrowRectSize: TSize; + I: Integer; +begin + if AArrowDirection in [adLeft, adRight] then + begin + AArrowRectSize.cx := AArrowSize * (1 + Integer(AIsDoubleArrow)); + AArrowRectSize.cy := AArrowSize * 2 - 1; + end + else + begin + AArrowRectSize.cx := AArrowSize * 2 - 1; + AArrowRectSize.cy := AArrowSize * (1 + Integer(AIsDoubleArrow)); + end; + + with AContentRect do + begin + AArrowRect.Left := Left + (Right - Left - AArrowRectSize.cx) div 2; + AArrowRect.Top := Top + (Bottom - Top - AArrowRectSize.cy) div 2; + if AOffsetContent then + begin + Inc(AArrowRect.Left); + Inc(AArrowRect.Top); + end; + AArrowRect.Right := AArrowRect.Left + AArrowRectSize.cx; + AArrowRect.Bottom := AArrowRect.Top + AArrowRectSize.cy; + end; + + AArrowBrush := GetSolidBrush(ACanvas, AColor); + for I := 0 to Integer(AIsDoubleArrow) do + InternalDrawArrow; +end; + +procedure DrawButtonBorder(ACanvas: TcxCanvas; var ARect: TRect; + ABorders: TcxBorders; AColor: TColor); +var + AWorkRect: TRect; +begin + AWorkRect := ARect; + Dec(AWorkRect.Bottom, 1); + Dec(AWorkRect.Right, 1); + ACanvas.Pen.Color := AColor; + + if bLeft in ABorders then + begin + InternalPolyLine(ACanvas, [AWorkRect.TopLeft, Point(AWorkRect.Left, AWorkRect.Bottom)], AColor); + Inc(ARect.Left); + end; + if bRight in ABorders then + begin + InternalPolyLine(ACanvas, [Point(AWorkRect.Right, AWorkRect.Top), AWorkRect.BottomRight], AColor); + Dec(ARect.Right); + end; + if bTop in ABorders then + begin + InternalPolyLine(ACanvas, [AWorkRect.TopLeft, Point(AWorkRect.Right, AWorkRect.Top)], AColor); + Inc(ARect.Top); + end; + if bBottom in ABorders then + begin + InternalPolyLine(ACanvas, [Point(AWorkRect.Left, AWorkRect.Bottom), AWorkRect.BottomRight], AColor); + Dec(ARect.Bottom); + end; +end; + +procedure DrawGlyph(ACanvas: TCanvas; X, Y: Integer; AGlyph: TBitmap; + AEnabled: Boolean; ABrushColor: TColor = clNone; ABackgroundBitmap: TBitmap = nil); + + procedure InternalDrawGlyph1; + var + AGlyphDrawingBrush: TBrush; + APrevBrushStyle: TBrushStyle; + R: TRect; + begin + if ABackgroundBitmap = nil then + AGlyphDrawingBrush := ACanvas.Brush + else + AGlyphDrawingBrush := ABackgroundBitmap.Canvas.Brush; + APrevBrushStyle := AGlyphDrawingBrush.Style; + + with ACanvas do + begin + if (ABackgroundBitmap <> nil) or (ABrushColor = clNone) then + AGlyphDrawingBrush.Style := bsClear + else + AGlyphDrawingBrush.Color := ABrushColor; + if ABackgroundBitmap = nil then + ACanvas.BrushCopy(Bounds(X, Y, AGlyph.Width, AGlyph.Height), AGlyph, + Rect(0, 0, AGlyph.Width, AGlyph.Height), AGlyph.TransparentColor) + else + begin + R := Rect(0, 0, AGlyph.Width, AGlyph.Height); + ABackgroundBitmap.Canvas.BrushCopy(R, AGlyph, R, AGlyph.TransparentColor); + ACanvas.Draw(X, Y, ABackgroundBitmap); + end; + end; + + AGlyphDrawingBrush.Style := APrevBrushStyle; + end; + + procedure InternalDrawGlyph2; + var + ABitmap: TBitmap; + AImageList: TImageList; + begin + ABitmap := nil; + AImageList := nil; + try + AImageList := TImageList.Create(nil); + AImageList.Width := AGlyph.Width; + AImageList.Height := AGlyph.Height; + if (ABackgroundBitmap = nil) and (ABrushColor <> clNone) then + begin + ABitmap := TBitmap.Create; + ABitmap.Width := AImageList.Width; + ABitmap.Height := AImageList.Height; + with ABitmap.Canvas do + cxEditFillRect(Handle, Rect(0, 0, ABitmap.Width, ABitmap.Height), + GetSolidBrush(ABitmap.Canvas, ABrushColor)); + end; + AImageList.AddMasked(AGlyph, AGlyph.TransparentColor); + if ABitmap <> nil then + begin + AImageList.Draw(ABitmap.Canvas, 0, 0, 0, AEnabled); + ACanvas.Draw(X, Y, ABitmap); + end + else + if ABackgroundBitmap = nil then + AImageList.Draw(ACanvas, X, Y, 0, AEnabled) + else + begin + AImageList.Draw(ABackgroundBitmap.Canvas, 0, 0, 0, AEnabled); + ACanvas.Draw(X, Y, ABackgroundBitmap); + end; + finally + if ABitmap <> nil then + ABitmap.Free; + if AImageList <> nil then + AImageList.Free; + end; + end; + +begin + if AEnabled then + InternalDrawGlyph1 + else + InternalDrawGlyph2; +end; + +procedure DrawGlyph(ACanvas: TcxCanvas; X, Y: Integer; AGlyph: TBitmap; + AEnabled: Boolean; ABrushColor: TColor = clNone; ABackgroundBitmap: TBitmap = nil); +begin + DrawGlyph(ACanvas.Canvas, X, Y, AGlyph, AEnabled, ABrushColor, ABackgroundBitmap); +end; + +procedure DrawGlyph(ACanvas: TcxCanvas; AImageList: TCustomImageList; + AImageIndex: TImageIndex; + const AGlyphRect: TRect; ABrushColor: TColor; AEnabled: Boolean; + ABackgroundBitmap: TBitmap = nil); +var + ABitmap: TBitmap; +begin + ABitmap := nil; + try + if ABackgroundBitmap = nil then + begin + ABitmap := TBitmap.Create; + ABitmap.Width := AImageList.Width; + ABitmap.Height := AImageList.Height; + with ABitmap.Canvas do + cxEditFillRect(Handle, Rect(0, 0, ABitmap.Width, ABitmap.Height), + GetSolidBrush(ABitmap.Canvas, ABrushColor)); + end; + if ABackgroundBitmap <> nil then + begin + AImageList.Draw(ABackgroundBitmap.Canvas, 0, 0, AImageIndex, AEnabled); // ??? itMask TODO + ACanvas.Draw(AGlyphRect.Left, AGlyphRect.Top, ABackgroundBitmap); + end else + begin + AImageList.Draw(ABitmap.Canvas, 0, 0, AImageIndex, AEnabled); // ??? itMask TODO + ACanvas.Draw(AGlyphRect.Left, AGlyphRect.Top, ABitmap); + end; + finally + if ABitmap <> nil then + ABitmap.Free; + end; +end; + +function GetPainterClass(ANativeStyle: Boolean; + ALookAndFeel: TcxLookAndFeelKind): TcxCustomLookAndFeelPainterClass; +const + APainterMap: array[TcxLookAndFeelKind] of TcxCustomLookAndFeelPainterClass = ( + TcxFlatLookAndFeelPainter, TcxStandardLookAndFeelPainter, + TcxUltraFlatLookAndFeelPainter, TcxOffice11LookAndFeelPainter + ); +begin + if ANativeStyle and AreVisualStylesAvailable then + Result := TcxWinXPLookAndFeelPainter + else + Result := APainterMap[ALookAndFeel]; +end; + +procedure InternalPolyLine(ACanvas: TcxCanvas; const Points: array of TPoint; + AColor: TColor; AOrtoDrawing: Boolean = False); +var + I: Integer; + P1, P2: TPoint; + ABrush: TBrushHandle; +begin + with ACanvas do + if AOrtoDrawing then + begin + ABrush := GetSolidBrush(AColor); + for I := 0 to Length(Points) - 2 do + begin + P1 := Points[I]; + P2 := Points[I + 1]; + if P1.X = P2.X then + begin + Inc(P2.X); + if P1.Y > P2.Y then + begin + Inc(P1.Y); + Inc(P2.Y); + end; + end + else + begin + Inc(P2.Y); + if P1.X > P2.X then + begin + Inc(P1.X); + Inc(P2.X); + end; + end; + cxEditFillRect(ACanvas.Handle, Rect(P1.X, P1.Y, P2.X, P2.Y), ABrush); + end; + with Points[High(Points)] do + cxEditFillRect(ACanvas.Handle, Rect(X, Y, X + 1, Y + 1), ABrush); + end + else + begin + Pen.Color := AColor; + Polyline(Points); + with Points[High(Points)] do + Pixels[X, Y] := AColor; + end; +end; + +function VerifyBitmap(ABitmap: TBitmap): Boolean; +begin + with ABitmap do + Result := (ABitmap <> nil) and (not Empty) and (Width > 0) and (Height > 0); +end; + +function VerifyImages(AImages: TCustomImageList): Boolean; +begin + with AImages do + Result := (AImages <> nil) and (Width > 0) and (Height > 0); +end; + +function CalculateEditDefaultButtonWidth(ACanvas: TcxCanvas; AViewInfo: TcxEditButtonViewInfo): Integer; + + function GetEditButtonTotalBorderExtent: Integer; + var + ATheme: TdxTheme; + R, CR: TRect; + begin + with AViewInfo do + if Data.NativeStyle then + begin + R := Rect(0, 0, 100, 100); + if Data.ComboBoxStyle then + begin + ATheme := OpenTheme(totComboBox); + GetThemeBackgroundContentRect(ATheme, ACanvas.Handle, CP_DROPDOWNBUTTON, + CBXS_NORMAL, R, CR); + end else + begin + ATheme := OpenTheme(totButton); + GetThemeBackgroundContentRect(ATheme, ACanvas.Handle, BP_PUSHBUTTON, + PBS_NORMAL, R, CR); + end; + Result := CR.Left + (R.Right - R.Left - CR.Right); + end + else + Result := cxEditButtonMaxBorderWidth * 2; + end; + +var + AButtonTotalBorderExtent: Integer; + ACaptionWidth: Integer; +begin + with AViewInfo do + begin + if Data.NativeStyle then + if Data.ComboBoxStyle then + Data.NativeStyle := AreVisualStylesMustBeUsed(Data.NativeStyle, totComboBox) + else + Data.NativeStyle := AreVisualStylesMustBeUsed(Data.NativeStyle, totButton); + AButtonTotalBorderExtent := GetEditButtonTotalBorderExtent; + if Width > 0 then + if Width < AButtonTotalBorderExtent then + Result := AButtonTotalBorderExtent + else + Result := Width + else + if (Data.Kind = bkGlyph) and VerifyBitmap(Glyph) then + Result := Glyph.Width + GetEditButtonTotalBorderExtent + else + begin + if Data.Kind = bkText then + ACaptionWidth := ACanvas.TextWidth(Data.VisibleCaption) + AButtonTotalBorderExtent + 2 + 1 + else + ACaptionWidth := 0; + Result := GetSystemMetrics(SM_CYHSCROLL); + if ACaptionWidth > Result then + Result := ACaptionWidth; + end; + end; +end; + +procedure cxEditFillRect(ACanvas: TCanvas; const R: TRect; AColor: TColor); +begin + Windows.FillRect(ACanvas.Handle, R, GetSolidBrush(AColor)); +end; + +procedure cxEditFillRect(ACanvas: TcxCanvas; const R: TRect; AColor: TColor); +begin + Windows.FillRect(ACanvas.Handle, R, GetSolidBrush(AColor)); +end; + +procedure cxEditFillRect(ACanvasHandle: TcxEditCanvasHandle; const R: TRect; + ABrush: TBrushHandle); +begin + Windows.FillRect(ACanvasHandle, R, ABrush); +end; + +function cxOffsetRect(var ARect: TRect; AOffset: TPoint): Boolean; +begin + Result := OffsetRect(ARect, AOffset.X, AOffset.Y); +end; + +procedure ConvertFlag(AInputFlags: DWORD; var AOutputFlags: Integer; + AInputFlag: DWORD; AOutputFlag: Integer); +begin + if AInputFlags and AInputFlag <> 0 then + AOutputFlags := AOutputFlags or AOutputFlag; +end; + +function cxTextOutFlagsToDrawTextFlags(AFlags: DWORD): Integer; +begin + Result := 0; + ConvertFlag(AFlags, Result, CXTO_LEFT, cxAlignLeft); + ConvertFlag(AFlags, Result, CXTO_CENTER_HORIZONTALLY, cxAlignHCenter); + ConvertFlag(AFlags, Result, CXTO_RIGHT, cxAlignRight); + ConvertFlag(AFlags, Result, CXTO_TOP, cxAlignTop); + ConvertFlag(AFlags, Result, CXTO_CENTER_VERTICALLY, cxAlignVCenter); + ConvertFlag(AFlags, Result, CXTO_BOTTOM, cxAlignBottom); + ConvertFlag(AFlags, Result, CXTO_SINGLELINE, cxSingleLine); + ConvertFlag(AFlags, Result, CXTO_WORDBREAK, cxWordBreak); +end; + +function DrawTextFlagsTocxTextOutFlags(AFlags: DWORD): Integer; +begin + Result := 0; + ConvertFlag(AFlags, Result, cxAlignLeft, CXTO_LEFT); + ConvertFlag(AFlags, Result, cxAlignHCenter, CXTO_CENTER_HORIZONTALLY); + ConvertFlag(AFlags, Result, cxAlignRight, CXTO_RIGHT); + ConvertFlag(AFlags, Result, cxAlignTop, CXTO_TOP); + ConvertFlag(AFlags, Result, cxAlignVCenter, CXTO_CENTER_VERTICALLY); + ConvertFlag(AFlags, Result, cxAlignBottom, CXTO_BOTTOM); + ConvertFlag(AFlags, Result, cxSingleLine, CXTO_SINGLELINE); + ConvertFlag(AFlags, Result, cxWordBreak, CXTO_WORDBREAK); +end; + +procedure InternalFillRect(ACanvas: TcxCanvas; const AOuterRect, AInternalRect: TRect; + ABrush: TBrushHandle); +begin + if IsRectEmpty(AOuterRect) or EqualRect(AOuterRect, AInternalRect) then + Exit; + if IsRectEmpty(AInternalRect) then + cxEditFillRect(ACanvas.Handle, AOuterRect, ABrush) + else + begin + cxEditFillRect(ACanvas.Handle, Rect(AOuterRect.Left, AOuterRect.Top, + AInternalRect.Left, AOuterRect.Bottom), ABrush); + cxEditFillRect(ACanvas.Handle, Rect(AInternalRect.Left, AOuterRect.Top, + AInternalRect.Right, AInternalRect.Top), ABrush); + cxEditFillRect(ACanvas.Handle, Rect(AInternalRect.Right, AOuterRect.Top, + AOuterRect.Right, AOuterRect.Bottom), ABrush); + cxEditFillRect(ACanvas.Handle, Rect(AInternalRect.Left, AInternalRect.Bottom, + AInternalRect.Right, AOuterRect.Bottom), ABrush); + end; +end; + +procedure DrawCustomEdit(ACanvas: TcxCanvas; AViewInfo: TcxCustomEditViewInfo; + ADrawBackground: Boolean; ABackgroundStyle: TcxEditBackgroundPaintingStyle); + + procedure FillEditBorderRect(ABackgroundBrush: TBrushHandle); + begin + if not AViewInfo.Transparent then + cxEditFillRect(ACanvas.Handle, AViewInfo.BorderRect, ABackgroundBrush); + end; + + procedure FillContentOffsetRegion(ABackgroundBrush: TBrushHandle); + begin + with AViewInfo do + begin + if Transparent or not AViewInfo.HasContentOffsets then + Exit; + cxEditFillRect(ACanvas.Handle, Rect(Bounds.Left, Bounds.Top, BorderRect.Left, + Bounds.Bottom), ABackgroundBrush); + cxEditFillRect(ACanvas.Handle, Rect(BorderRect.Left, Bounds.Top, + BorderRect.Right, BorderRect.Top), ABackgroundBrush); + cxEditFillRect(ACanvas.Handle, Rect(BorderRect.Left, BorderRect.Bottom, + BorderRect.Right, Bounds.Bottom), ABackgroundBrush); + cxEditFillRect(ACanvas.Handle, Rect(BorderRect.Right, Bounds.Top, + Bounds.Right, Bounds.Bottom), ABackgroundBrush); + end; + end; + + procedure DrawUsualEditBackground(ABackgroundBrush: TBrushHandle); + var + R, R1: TRect; + ABorderWidth: Integer; + begin + with AViewInfo do + begin + R := BorderRect; + if Painter = nil then + ABorderWidth := GetContainerBorderWidth(TcxContainerBorderStyle(BorderStyle)) + else + ABorderWidth := 1; + Dec(R.Left, ABorderWidth); + Dec(R.Top, ABorderWidth); + if bRight in Edges then Inc(R.Right, ABorderWidth); + if bBottom in Edges then Inc(R.Bottom, ABorderWidth); + if Shadow then + DrawContainerShadow(ACanvas, R); + if not(bRight in Edges) then Inc(R.Right, ABorderWidth); + if not(bBottom in Edges) then Inc(R.Bottom, ABorderWidth); + if BorderStyle <> ebsNone then + begin + R1 := R; + if AViewInfo.Painter <> nil then + ACanvas.FrameRect(R1, BorderColor, ABorderWidth) + else + case BorderStyle of + ebsSingle, ebsThick: + ACanvas.FrameRect(R1, BorderColor, ABorderWidth); + ebsFlat: + begin + ACanvas.DrawEdge(R1, True, True, Edges); + InflateRect(R1, -1, -1); + ACanvas.FrameRect(R1, clBtnFace); + end; + ebs3D: + begin + ACanvas.DrawEdge(R1, True, True, Edges); + InflateRect(R1, -1, -1); + ACanvas.DrawComplexFrame(R1, cl3DDkShadow, cl3DLight, Edges); + end; + end; + end; + if IsInplace then + begin + if not Transparent then + if ADrawBackground then + cxEditFillRect(ACanvas.Handle, Bounds, ABackgroundBrush) + else + FillContentOffsetRegion(ABackgroundBrush); + end + else + if ADrawBackground then + FillEditBorderRect(ABackgroundBrush); + end; + end; + + procedure DrawEditBackground(ABackgroundBrush: TBrushHandle); + begin + if not AViewInfo.DrawBackground(ACanvas) then + if AViewInfo.NativeStyle then + AViewInfo.DrawNativeStyleEditBackground(ACanvas, ADrawBackground, + ABackgroundStyle, ABackgroundBrush) + else + DrawUsualEditBackground(ABackgroundBrush); + end; + +var + AVisibleButtonsCount: Integer; + I: Integer; + ASavedDC: Integer; +begin + AVisibleButtonsCount := Length(AViewInfo.ButtonsInfo); + ASavedDC := 0; + if (AVisibleButtonsCount > 0) and not AViewInfo.ButtonsInfo[0].Data.BackgroundPartiallyTransparent then + begin + ASavedDC := SaveDC(ACanvas.Handle); + for I := 0 to AVisibleButtonsCount - 1 do + ACanvas.ExcludeClipRect(AViewInfo.ButtonsInfo[I].VisibleBounds); + end; + DrawEditBackground(GetSolidBrush(ACanvas, AViewInfo.BackgroundColor)); + + if ASavedDC <> 0 then + RestoreDC(ACanvas.Handle, ASavedDC); + AViewInfo.DrawButtons(ACanvas); +end; + +function GetArrowSize(const AContentSize: TSize; AArrowDirection: TcxArrowDirection): TSize; +var + AMinContentSize: Integer; + ATempVar: Longint; +begin + AMinContentSize := AContentSize.cx; + if AMinContentSize > AContentSize.cy then + AMinContentSize := AContentSize.cy; + + Result.cx := (AMinContentSize - 1) div 2; + if not Odd(Result.cx) then + Result.cx := Result.cx + 1; + Result.cy := Result.cx div 2 + 1; + if AArrowDirection in [adLeft, adRight] then + begin + ATempVar := Result.cx; + Result.cx := Result.cy; + Result.cy := ATempVar; + end; +end; + +function GetEditButtonsContentVerticalOffset(ACanvas: TcxCanvas; + AButtonsStyle: TcxEditButtonStyle; ANativeStyle: Boolean): Integer; +var + ATheme: TdxTheme; + CR, R: TRect; +begin + if ANativeStyle then + begin + R := Rect(0, 0, 100, 100); + ATheme := OpenTheme(totButton); + GetThemeBackgroundContentRect(ATheme, ACanvas.Handle, BP_PUSHBUTTON, + PBS_NORMAL, R, CR); + Result := CR.Top + R.Bottom - CR.Bottom; + end + else + Result := cxEditButtonContentVerticalOffset[AButtonsStyle]; +end; + +function GetHotTrackColor: TColor; +begin + if FIsWin98Or2000 then + Result := GetSysColor({$IFDEF DELPHI5}COLOR_HOTLIGHT{$ELSE}26{$ENDIF}) + else + Result := clBlue; +end; + +function GetNativeInnerTextEditContentHeightCorrection( + AProperties: TcxCustomEditProperties; AIsInplace: Boolean): Integer; +begin + Result := Integer(AIsInplace and (AProperties.Buttons.Count > 0)); +end; + +function GetEditButtonRegion(ACanvas: TcxCanvas; AViewInfo: TcxEditButtonViewInfo): TcxRegion; +var + ATheme: TdxTheme; + ARgn1, ARgn2: HRGN; +begin + with AViewInfo do + if Data.NativeState <> TC_NONE then + begin + if Data.ComboBoxStyle then + begin + ATheme := OpenTheme(totComboBox); + GetThemeBackgroundRegion(ATheme, ACanvas.Handle, CP_DROPDOWNBUTTON, + Data.NativeState, @Bounds, ARgn1); + end else + begin + ATheme := OpenTheme(totButton); + GetThemeBackgroundRegion(ATheme, ACanvas.Handle, Data.NativePart, + Data.NativeState, @Bounds, ARgn1); + end; + ARgn2 := CreateRectRgnIndirect(Bounds); + CombineRgn(ARgn1, ARgn1, ARgn2, RGN_AND); + DeleteObject(ARgn2); + Result := TcxRegion.Create(ARgn1); + end + else + Result := TcxRegion.Create(Bounds); +end; + +function GetEditBorderHighlightColor( + AIsOffice11Style: Boolean): TColor; +begin + if AIsOffice11Style then + Result := dxOffice11SelectedBorderColor + else + Result := clHighlight; +end; + +function GetEditButtonHighlightColor(APressed: Boolean; + AIsOffice11Style: Boolean): TColor; +var + APainterClass: TcxCustomLookAndFeelPainterClass; +begin + if AIsOffice11Style then + APainterClass := TcxOffice11LookAndFeelPainter + else + APainterClass := TcxUltraFlatLookAndFeelPainter; + if APressed then + Result := APainterClass.ButtonColor(cxbsPressed) + else + Result := APainterClass.ButtonColor(cxbsHot); +end; + +function IsShadowDrawingNeeded(AViewData: TcxCustomEditViewData): Boolean; +begin + Result := AViewData.Style.Shadow and not AViewData.IsNativeStyle(AViewData.Style.LookAndFeel); +end; + +procedure RestoreCanvasFont(ACanvas: TcxCanvas; const ASavedLogFont: TLogFont); +begin + ACanvas.Font.Handle := CreateFontIndirect(ASavedLogFont); +end; + +procedure SaveCanvasFont(ACanvas: TcxCanvas; out ALogFont: TLogFont); +begin + cxGetFontData(ACanvas.Font.Handle, ALogFont); +end; + +initialization + RetrieveWindowsVersion; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxExtEditConsts.pas b/official/x.35/ExpressEditors Library 5/Sources/cxExtEditConsts.pas new file mode 100644 index 00000000..43299ef2 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxExtEditConsts.pas @@ -0,0 +1,269 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxExtEditConsts; + +{$I cxVer.inc} + +interface + +{.$DEFINE NOFLICKER} + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Classes, Graphics, SysUtils, cxContainer; + +resourcestring + scxSEditRepositoryColorComboBoxItem = 'ColorComboBox |Represents a editor with color functionality'; + scxSEditRepositoryFontNameComboBoxItem = 'FontNameComboBox |Represents a editor with font functionality'; + scxSEditRepositoryLabelItem = 'Label|Represents a Label'; + scxSEditRepositoryProgressBarItem = 'ProgressBar|Represents a ProgressBar'; + scxSEditRepositoryTrackBarItem = 'TrackBar|Represents a TrackBar'; + scxSEditRepositorySpinButtonItem = 'SpinButton|Represents a SpinButton'; + scxSEditRepositoryCheckComboBox = 'CheckComboBox|Represents a CheckComboBox'; + scxSEditRepositoryShellComboBoxItem = 'ShellComboBox|Represents a combo box with a dropdown shell tree view'; + scxSEditRepositoryCheckGroupItem = 'CheckGroup|Represents a group of check boxes'; + scxUDAssociated = ' is already associated with '; + scxHotZoneStyleMediaPlayer9 = 'MediaPlayer9'; + scxHotZoneStyleMediaPlayer8 = 'MediaPlayer8'; + scxHotZoneStyleXPTaskBar = 'XPTaskBar'; + scxHotZoneStyleSimple = 'Simple'; + scxLoadingFonts = 'Loading ...'; + + cxSEditCheckGroupCaptionStateDelimiter = ': '; + cxSEditCheckGroupFilterColumnSeparator = '; '; + cxSEditCheckGroupChecked = 'Checked'; + cxSEditCheckGroupGrayed = 'Grayed'; + cxSEditCheckGroupUnchecked = 'Unchecked'; + + cxSCheckComboBoxStatesItemsPropertyDlgCaption = 'cxCheckComboBox - CheckStates editor'; + cxSCheckGroupStatesItemsPropertyDlgCaption = 'cxCheckGroup - CheckStates editor'; + cxSCheckComboBoxEmptySelectionText = 'None selected'; + + cxSColorComboBoxDefaultDescription = 'Color not selected'; + + cxSEditRichEditLibraryError = 'Cannot load a RichEdit library'; + cxSEditRichEditLineInsertionError = 'RichEdit line insertion error'; + cxSEditRichEditLoadFail = 'Failed to Load Stream'; + cxSEditRichEditSaveFail = 'Failed to Save Stream'; + cxSEditRichEditSelectionSaveFail = 'Failed to selection Save Stream'; + cxSEditRichEditOleInterfaceFail = 'RichEdit: failed to get IRichEditOle interface'; + cxSEditRichEditCallBackFail = 'RichEdit: failed to set callback'; + cxSEditRichEditLinkFail = 'RichEdit: cannot link to an invalid source'; + scxSEditRepositoryRichEditItem = 'RichEdit|RichEdit control'; + + cxSEditRichEditUndoCaption = '&Undo'; + cxSEditRichEditRedoCaption = '&Redo'; + cxSEditRichEditCutCaption = 'Cu&t'; + cxSEditRichEditCopyCaption = '&Copy'; + cxSEditRichEditPasteCaption = '&Paste'; + cxSEditRichEditDeleteCaption = '&Delete'; + cxSEditRichEditSelectAllCaption = 'Select &All'; + +type + TcxNaturalNumber = 1..High(Integer); + TcxPositiveNumber = 0..High(Integer); + +const + cxDelphiColorValues: + {$IFDEF DELPHI6} + array[0..51] of TColor = + {$ELSE} + array[0..42] of TColor = + {$ENDIF} + (clBlack, clMaroon, clGreen, clOlive, clNavy, clPurple, clTeal, clGray, + clSilver, clRed, clLime, clYellow, clBlue, clFuchsia, clAqua, clWhite, + {$IFDEF DELPHI6} + clMoneyGreen, clSkyBlue, clCream, clMedGray, + {$ENDIF} + clActiveBorder, clActiveCaption, clAppWorkSpace, clBackground, + clBtnFace, clBtnHighlight, clBtnShadow, clBtnText, clCaptionText, + clDefault, + {$IFDEF DELPHI6} + clGradientActiveCaption, clGradientInactiveCaption, + {$ENDIF} + clGrayText, clHighlight, clHighlightText, + {$IFDEF DELPHI6} + clHotLight, + {$ENDIF} + clInactiveBorder, + clInactiveCaption, clInactiveCaptionText, clInfoBk, clInfoText, + clMenu, + {$IFDEF DELPHI6} + clMenuBar, clMenuHighlight, + {$ENDIF} + clMenuText, clNone, clScrollBar, + cl3DDkShadow, cl3DLight, clWindow, clWindowFrame, clWindowText); + + cxDelphiColorNames: + {$IFDEF DELPHI6} + array[0..51] of string = + {$ELSE} + array[0..42] of string = + {$ENDIF} + ('clBlack', 'clMaroon', 'clGreen', 'clOlive', 'clNavy', 'clPurple', 'clTeal', + 'clGray', 'clSilver', 'clRed', 'clLime', 'clYellow', 'clBlue', 'clFuchsia', + 'clAqua', 'clWhite', + {$IFDEF DELPHI6} + 'clMoneyGreen', 'clSkyBlue', 'clCream', 'clMedGray', + {$ENDIF} + 'clActiveBorder', 'clActiveCaption', 'clAppWorkSpace', 'clBackground', + 'clBtnFace', 'clBtnHighlight', 'clBtnShadow', 'clBtnText', 'clCaptionText', + 'clDefault', + {$IFDEF DELPHI6} + 'clGradientActiveCaption', 'clGradientInactiveCaption', + {$ENDIF} + 'clGrayText', 'clHighlight', 'clHighlightText', + {$IFDEF DELPHI6} + 'clHotLight', + {$ENDIF} + 'clInactiveBorder', + 'clInactiveCaption', 'clInactiveCaptionText', 'clInfoBk', 'clInfoText', + 'clMenu', + {$IFDEF DELPHI6} + 'clMenuBar', 'clMenuHighlight', + {$ENDIF} + 'clMenuText', 'clNone', 'clScrollBar', + 'cl3DDkShadow', 'cl3DLight', 'clWindow', 'clWindowFrame', 'clWindowText'); + + cxHTML4ColorValues: array[0..15] of TColor = + ($000000, $C0C0C0, $808080, $FFFFFF, $000080, $0000FF, $800080, $FF00FF, + $008000, $00FF00, $008080, $00FFFF, $800000, $FF0000, $808000, $FFFF00); + + cxHTML4ColorNames: array[0..15] of string = + ('Black', 'Silver', 'Gray', 'White', 'Maroon', 'Red', 'Purple', 'Fuchsia', + 'Green', 'Lime', 'Olive', 'Yellow', 'Navy', 'Blue', 'Teal', 'Aqua'); + + cxX11ColorValues: array[0..139] of TColor = + ($FFF8F0, $D7EBFA, $FFFF00, $D4FF7F, $FFFFF0, $DCF5F5, $C4E4FF, $000000, + $CDEBFF, $FF0000, $E22B8A, $2A2AA5, $87B8DE, $A09E5F, $00FF7F, $1E69D2, + $507FFF, $ED9564, $DCF8FF, $3C14DC, $FFFF00, $8B0000, $8B8B00, $0B86B8, + $A9A9A9, $006400, $6BB7BD, $8B008B, $2F6B55, $008CFF, $CC3299, $00008B, + $7A96E9, $8FBC8F, $8B3D48, $4F4F2F, $D1CE00, $D30094, $9314FF, $FFBF00, + $696969, $FF901E, $2222B2, $F0FAFF, $228B22, $FF00FF, $DCDCDC, $FFF8F8, + $00D7FF, $20A5DA, $808080, $008000, $2FFFAD, $F0FFF0, $B469FF, $5C5CCD, + $82004B, $F0FFFF, $8CE6F0, $FAE6E6, $F5F0FF, $00FC7C, $CDFAFF, $E6D8AD, + $8080F0, $FFFFE0, $D2FAFA, $90EE90, $D3D3D3, $C1B6FF, $7AA0FF, $AAB220, + $FACE87, $998877, $DEC4B0, $E0FFFF, $00FF00, $32CD32, $E6F0FA, $FF00FF, + $000080, $AACD66, $CD0000, $D355BA, $DB7093, $71B33C, $EE687B, $9AFA00, + $CCD148, $8515C7, $701919, $FAFFF5, $E1E4FF, $B5E4FF, $ADDEFF, $800000, + $E6F5FD, $008080, $238E6B, $00A5FF, $0045FF, $D670DA, $AAE8EE, $98FB98, + $EEEEAF, $9370DB, $D5EFFF, $B9DAFF, $3F85CD, $CBC0FF, $DDA0DD, $E6E0B0, + $800080, $0000FF, $8F8FBC, $E16941, $13458B, $7280FA, $60A4F4, $578B2E, + $EEF5FF, $2D52A0, $C0C0C0, $EBCE87, $CD5A6A, $908070, $FAFAFF, $7FFF00, + $B48246, $8CB4D2, $808000, $D8BFD8, $4763FF, $D0E040, $EE82EE, $B3DEF5, + $FFFFFF, $F5F5F5, $00FFFF, $32CD9A); + + cxX11ColorNames: array[0..139] of string = + ('AliceBlue', 'AntiqueWhite', 'Aqua', 'Aquamarine', 'Azure', 'Beige', + 'Bisque', 'Black', 'BlanchedAlmond', 'Blue', 'BlueViolet', 'Brown', + 'BurlyWood', 'CadetBlue', 'Chartreuse', 'Chocolate', 'Coral', + 'CornflowerBlue', 'Cornsilk', 'Crimson', 'Cyan', 'DarkBlue', 'DarkCyan', + 'DarkGoldenrod', 'DarkGray', 'DarkGreen', 'DarkKhaki', 'DarkMagenta', + 'DarkOliveGreen', 'DarkOrange', 'DarkOrchid', 'DarkRed', 'DarkSalmon', + 'DarkSeaGreen', 'DarkSlateBlue', 'DarkSlateGray', 'DarkTurquoise', + 'DarkViolet', 'DeepPink', 'DeepSkyBlue', 'DimGray', 'DodgerBlue', + 'FireBrick', 'FloralWhite', 'ForestGreen', 'Fuchsia', 'Gainsboro', + 'GhostWhite', 'Gold', 'Goldenrod', 'Gray', 'Green', 'GreenYellow', + 'Honeydew', 'HotPink', 'IndianRed', 'Indigo', 'Ivory', 'Khaki', + 'Lavender', 'LavenderBlush', 'LawnGreen', 'LemonChiffon', 'LightBlue', + 'LightCoral', 'LightCyan', 'LightGoldenrodYellow', 'LightGreen', + 'LightGrey', 'LightPink', 'LightSalmon', 'LightSeaGreen', 'LightSkyBlue', + 'LightSlateGray', 'LightSteelBlue', 'LightYellow', 'Lime', 'LimeGreen', + 'Linen', 'Magenta', 'Maroon', 'MediumAquamarine', 'MediumBlue', + 'MediumOrchid', 'MediumPurple', 'MediumSeaGreen', 'MediumSlateBlue', + 'MediumSpringGreen', 'MediumTurquoise', 'MediumVioletRed', 'MidnightBlue', + 'MintCream', 'MistyRose', 'Moccasin', 'NavajoWhite', 'Navy', 'OldLace', + 'Olive', 'OliveDrab', 'Orange', 'OrangeRed', 'Orchid', 'PaleGoldenrod', + 'PaleGreen', 'PaleTurquoise', 'PaleVioletRed', 'PapayaWhip', 'PeachPuff', + 'Peru', 'Pink', 'Plum', 'PowderBlue', 'Purple', 'Red', 'RosyBrown', + 'RoyalBlue', 'SaddleBrown', 'Salmon', 'SandyBrown', 'SeaGreen', 'Seashell', + 'Sienna', 'Silver', 'SkyBlue', 'SlateBlue', 'SlateGray', 'Snow', + 'SpringGreen', 'SteelBlue', 'Tan', 'Teal', 'Thistle', 'Tomato', 'Turquoise', + 'Violet', 'Wheat', 'White', 'WhiteSmoke', 'Yellow', 'YellowGreen'); + + cxX11OrderedColorValues: array[0..139] of TColor = + ($C1B6FF, $CBC0FF, $3C14DC, $F5F0FF, $9370DB, $B469FF, $9314FF, $8515C7, + $D670DA, $D8BFD8, $DDA0DD, $EE82EE, $FF00FF, $FF00FF, $8B008B, $800080, + $D355BA, $D30094, $CC3299, $82004B, $E22B8A, $DB7093, $EE687B, $CD5A6A, + $8B3D48, $FAE6E6, $FFF8F8, $FF0000, $CD0000, $701919, $8B0000, $800000, + $E16941, $ED9564, $DEC4B0, $998877, $908070, $FF901E, $FFF8F0, $B48246, + $FACE87, $EBCE87, $FFBF00, $E6D8AD, $E6E0B0, $A09E5F, $FFFFF0, $FFFFE0, + $EEEEAF, $FFFF00, $FFFF00, $D1CE00, $4F4F2F, $8B8B00, $808000, $CCD148, + $AAB220, $D0E040, $D4FF7F, $AACD66, $9AFA00, $FAFFF5, $7FFF00, $71B33C, + $578B2E, $F0FFF0, $90EE90, $98FB98, $8FBC8F, $32CD32, $00FF00, $228B22, + $008000, $006400, $00FF7F, $00FC7C, $2FFFAD, $2F6B55, $32CD9A, $238E6B, + $DCF5F5, $D2FAFA, $F0FFFF, $E0FFFF, $00FFFF, $008080, $6BB7BD, $CDFAFF, + $AAE8EE, $8CE6F0, $00D7FF, $DCF8FF, $20A5DA, $0B86B8, $F0FAFF, $E6F5FD, + $B3DEF5, $B5E4FF, $00A5FF, $D5EFFF, $CDEBFF, $ADDEFF, $D7EBFA, $8CB4D2, + $87B8DE, $C4E4FF, $008CFF, $E6F0FA, $3F85CD, $B9DAFF, $60A4F4, $1E69D2, + $13458B, $EEF5FF, $2D52A0, $7AA0FF, $507FFF, $0045FF, $7A96E9, $4763FF, + $E1E4FF, $7280FA, $FAFAFF, $8080F0, $8F8FBC, $5C5CCD, $0000FF, $2A2AA5, + $2222B2, $00008B, $000080, $FFFFFF, $F5F5F5, $DCDCDC, $D3D3D3, $C0C0C0, + $A9A9A9, $808080, $696969, $000000); + + cxX11OrderedColorNames: array[0..139] of string = + ('LightPink', 'Pink', 'Crimson', 'LavenderBlush', 'PaleVioletRed', 'HotPink', + 'DeepPink', 'MediumVioletRed', 'Orchid', 'Thistle', 'Plum', 'Violet', + 'Magenta', 'Fuchsia', 'DarkMagenta', 'Purple', 'MediumOrchid', 'DarkViolet', + 'DarkOrchid', 'Indigo', 'BlueViolet', 'MediumPurple', 'MediumSlateBlue', + 'SlateBlue', 'DarkSlateBlue', 'Lavender', 'GhostWhite', 'Blue', 'MediumBlue', + 'MidnightBlue', 'DarkBlue', 'Navy', 'RoyalBlue', 'CornflowerBlue', + 'LightSteelBlue', 'LightSlateGray', 'SlateGray', 'DodgerBlue', 'AliceBlue', + 'SteelBlue', 'LightSkyBlue', 'SkyBlue', 'DeepSkyBlue', 'LightBlue', + 'PowderBlue', 'CadetBlue', 'Azure', 'LightCyan', 'PaleTurquoise', 'Cyan', + 'Aqua', 'DarkTurquoise', 'DarkSlateGray', 'DarkCyan', 'Teal', + 'MediumTurquoise', 'LightSeaGreen', 'Turquoise', 'Aquamarine', + 'MediumAquamarine', 'MediumSpringGreen', 'MintCream', 'SpringGreen', + 'MediumSeaGreen', 'SeaGreen', 'Honeydew', 'LightGreen', 'PaleGreen', + 'DarkSeaGreen', 'LimeGreen', 'Lime', 'ForestGreen', 'Green', 'DarkGreen', + 'Chartreuse', 'LawnGreen', 'GreenYellow', 'DarkOliveGreen', 'YellowGreen', + 'OliveDrab', 'Beige', 'LightGoldenrodYellow', 'Ivory', 'LightYellow', + 'Yellow', 'Olive', 'DarkKhaki', 'LemonChiffon', 'PaleGoldenrod', 'Khaki', + 'Gold', 'Cornsilk', 'Goldenrod', 'DarkGoldenrod', 'FloralWhite', 'OldLace', + 'Wheat', 'Moccasin', 'Orange', 'PapayaWhip', 'BlanchedAlmond', 'NavajoWhite', + 'AntiqueWhite', 'Tan', 'BurlyWood', 'Bisque', 'DarkOrange', 'Linen', 'Peru', + 'PeachPuff', 'SandyBrown', 'Chocolate', 'SaddleBrown', 'Seashell', 'Sienna', + 'LightSalmon', 'Coral', 'OrangeRed', 'DarkSalmon', 'Tomato', 'MistyRose', + 'Salmon', 'Snow', 'LightCoral', 'RosyBrown', 'IndianRed', 'Red', 'Brown', + 'FireBrick', 'DarkRed', 'Maroon', 'White', 'WhiteSmoke', 'Gainsboro', + 'LightGrey', 'Silver', 'DarkGray', 'Gray', 'DimGray', 'Black'); + +implementation + +end. + diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxExtEditReg.dcr b/official/x.35/ExpressEditors Library 5/Sources/cxExtEditReg.dcr new file mode 100644 index 00000000..dd736fed Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Sources/cxExtEditReg.dcr differ diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxExtEditReg.pas b/official/x.35/ExpressEditors Library 5/Sources/cxExtEditReg.pas new file mode 100644 index 00000000..14e49757 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxExtEditReg.pas @@ -0,0 +1,497 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxExtEditReg; + +{$I cxVer.inc} + +interface + +uses + Classes; + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI6} + DesignIntf, DesignEditors, +{$ELSE} + DsgnIntf, +{$ENDIF} + Controls, Forms, Graphics, ImgList, StdCtrls, SysUtils, TypInfo, cxCheckBox, + cxCheckComboBox, cxCheckGroup, cxCheckGroupStatesEditor, cxCheckListBox, + cxClasses, cxColorComboBox, cxContainer, cxDBCheckComboBox, cxDBCheckGroup, + cxDBCheckListBox, cxDBColorComboBox, cxDBFontNameComboBox, cxDBLabel, + cxDBProgressBar, cxDBRichEdit, cxDBTrackBar, cxEdit, cxEditPropEditors, + cxEditRepositoryEditor, cxExtEditConsts, cxExtEditRepositoryItems, + cxFontNameComboBox, cxHeader, cxHint, cxHintEditor, cxLabel, cxListView, + cxLookAndFeels, cxMCListBox, cxProgressBar, cxPropEditors, cxRichEdit, + cxScrollBar, cxSpinButton, cxSplitter, cxSplitterEditor, cxTrackBar, + cxTreeView; + +const + cxEditorsRestoreStyleCaption = 'Restore style'; + cxEditorsRestoreLookAndFeelCaption = 'Restore LookAndFeel'; + cxEditComponentEditorVerbS: array[0..0] of string = (cxEditorsRestoreStyleCaption); + cxEditComponentEditorVerbL: array[0..0] of string = (cxEditorsRestoreLookAndFeelCaption); + cxSplitterStyleControllerVerb = 'Splitter Editor...'; + cxHintStyleControllerVerb = 'Hints Editor...'; + +type + TcxCustomEditAccess = class(TcxCustomEdit); + +type + { TcxHotZoneStyleProperty } + + TcxHotZoneStyleProperty = class(TClassProperty) + protected + function HasSubProperties: Boolean; + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + { TcxCustomHeaderComponentEditor } + + TcxCustomHeaderComponentEditor = class(TcxEditorsLibraryComponentWithoutStylesEditor) + protected + function GetLookAndFeel: TcxLookAndFeel; override; + public + procedure Edit; override; + end; + + { TcxSplitterComponentEditor } + + TcxSplitterComponentEditor = class(TcxEditorsLibraryComponentEditorEx) + protected + function GetEditItemCaption: string; override; + procedure ExecuteEditAction; override; + end; + + { TcxHintStyleComponentEditor } + + TcxHintStyleComponentEditor = class(TcxEditorsLibraryComponentEditorEx) + protected + function GetEditItemCaption: string; override; + procedure ExecuteEditAction; override; + end; + + { TcxHotZoneStyleEventsProperty } + + TcxHotZoneStyleEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + + { TcxHeaderSectionImageIndexProperty } + + TcxHeaderSectionImageIndexProperty = class(TImageIndexProperty) + public + function GetImages: TCustomImageList; override; + end; + + { TcxChecksControlStatesItemsProperty } + + TcxChecksControlStatesItemsProperty = class(TPropertyEditor) + protected + procedure InitializeDlg(ADialog: TcxCheckGroupStatesEditorDlg); virtual; + procedure SynchronizeControlCheckStates(ADialog: TcxCheckGroupStatesEditorDlg); virtual; + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + function GetName: string; override; + function GetValue: string; override; + end; + + { TcxCheckGroupStatesItemsProperty } + + TcxCheckGroupStatesItemsProperty = class(TcxChecksControlStatesItemsProperty) + protected + procedure InitializeDlg(ADialog: TcxCheckGroupStatesEditorDlg); override; + procedure SynchronizeControlCheckStates(ADialog: TcxCheckGroupStatesEditorDlg); override; + end; + + { TcxCheckComboBoxStatesItemsProperty } + + TcxCheckComboBoxStatesItemsProperty = class(TcxChecksControlStatesItemsProperty) + protected + procedure InitializeDlg(ADialog: TcxCheckGroupStatesEditorDlg); override; + procedure SynchronizeControlCheckStates(ADialog: TcxCheckGroupStatesEditorDlg); override; + end; + + { TcxCheckGroupComponentEditor } + + TcxCheckGroupComponentEditor = class(TcxEditComponentEditor) + public + procedure Edit; override; + end; + +{$IFDEF DELPHI6} + TcxCommonControlsSelectionEditor = class(TSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; +{$ENDIF} + + { TcxCheckListBoxItemImageIndexProperty } + + TcxCheckListBoxItemImageIndexProperty = class(TImageIndexProperty) + public + function GetImages: TCustomImageList; override; + end; + +{ TcxHotZoneStyleProperty } + +function TcxHotZoneStyleProperty.HasSubProperties: Boolean; +var + I: Integer; +begin + for I := 0 to PropCount - 1 do + begin + Result := TcxCustomSplitter(GetComponent(I)).HotZone <> nil; + if not Result then Exit; + end; + Result := True; +end; + +function TcxHotZoneStyleProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes; + if not HasSubProperties then + Exclude(Result, paSubProperties); + Result := Result - [paReadOnly] + + [paValueList, paSortList, paRevertable{$IFDEF DELPHI6}, paVolatileSubProperties{$ENDIF}]; +end; + +function TcxHotZoneStyleProperty.GetValue: string; +begin + if HasSubProperties then + Result := GetRegisteredHotZoneStyles.GetDescriptionByClass( + TcxCustomSplitter(GetComponent(0)).HotZone.ClassType) + else + Result := ''; +end; + +procedure TcxHotZoneStyleProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to GetRegisteredHotZoneStyles.Count - 1 do + Proc(GetRegisteredHotZoneStyles.Descriptions[I]); +end; + +procedure TcxHotZoneStyleProperty.SetValue(const Value: string); +var + FHotZoneStyleClass: TcxHotZoneStyleClass; + I: Integer; +begin + FHotZoneStyleClass := TcxHotZoneStyleClass(GetRegisteredHotZoneStyles.FindByClassName(Value)); + if FHotZoneStyleClass = nil then + FHotZoneStyleClass := TcxHotZoneStyleClass(GetRegisteredHotZoneStyles.FindByDescription(Value)); + + for I := 0 to PropCount - 1 do + TcxCustomSplitter(GetComponent(I)).HotZoneStyleClass := FHotZoneStyleClass; + Modified; +end; + +{ TcxHotZoneStyleEventsProperty } + +function TcxHotZoneStyleEventsProperty.GetInstance: TPersistent; +begin + Result := TcxCustomSplitter(GetComponent(0)).HotZone; +end; + +{ TcxHeaderSectionImageIndexProperty } + +function TcxHeaderSectionImageIndexProperty.GetImages: TCustomImageList; +begin + Result := nil; + if GetComponent(0) is TcxHeaderSection then + Result := TCustomImageList(TcxHeaderSection(GetComponent(0)).HeaderControl.Images); +end; + +{ TcxCustomHeaderComponentEditor } + +procedure TcxCustomHeaderComponentEditor.Edit; +begin +end; + +function TcxCustomHeaderComponentEditor.GetLookAndFeel: TcxLookAndFeel; +begin + Result := TcxCustomHeader(Component).LookAndFeel; +end; + +{ TcxSplitterComponentEditor } + +function TcxSplitterComponentEditor.GetEditItemCaption: string; +begin + Result := cxSplitterStyleControllerVerb; +end; + +procedure TcxSplitterComponentEditor.ExecuteEditAction; +begin + ShowSplitterEditor(Component as TcxSplitter); +end; + +{ TcxHintStyleComponentEditor } + +function TcxHintStyleComponentEditor.GetEditItemCaption: string; +begin + Result := cxHintStyleControllerVerb; +end; + +procedure TcxHintStyleComponentEditor.ExecuteEditAction; +begin + ShowHintStyleEditor(Component as TcxHintStyleController); +end; + +{ TcxChecksControlStatesItemsProperty } + +procedure TcxChecksControlStatesItemsProperty.Edit; +var + ADialog: TcxCheckGroupStatesEditorDlg; +begin + ADialog := TcxCheckGroupStatesEditorDlg.Create(Application); + try + InitializeDlg(ADialog); + if ADialog.ShowModal = mrOK then + begin + SynchronizeControlCheckStates(ADialog); + Modified; + end; + finally + ADialog.Free; + end; +end; + +function TcxChecksControlStatesItemsProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paDialog, paReadOnly]; +end; + +function TcxChecksControlStatesItemsProperty.GetName: string; +begin + Result := 'States'; +end; + +function TcxChecksControlStatesItemsProperty.GetValue: string; +begin + Result := ''; +end; + +procedure TcxChecksControlStatesItemsProperty.InitializeDlg(ADialog: TcxCheckGroupStatesEditorDlg); +begin +end; + +procedure TcxChecksControlStatesItemsProperty.SynchronizeControlCheckStates(ADialog: TcxCheckGroupStatesEditorDlg); +begin +end; + +{ TcxCheckGroupStatesItemsProperty } + +procedure TcxCheckGroupStatesItemsProperty.InitializeDlg( + ADialog: TcxCheckGroupStatesEditorDlg); +var + ACheckGroup: TcxCustomCheckGroup; + AItem: TcxCheckListBoxItem; + I: Integer; +begin + ADialog.Caption := cxGetResourceString(@ + cxSCheckGroupStatesItemsPropertyDlgCaption); + ADialog.clbStates.Items.Clear; + ACheckGroup := TcxCustomCheckGroup(GetComponent(0)); + ADialog.clbStates.AllowGrayed := ACheckGroup.ActiveProperties.AllowGrayed and + (ACheckGroup.ActiveProperties.EditValueFormat <> cvfInteger); + for I := 0 to ACheckGroup.ActiveProperties.Items.Count - 1 do + begin + AItem := TcxCheckListBoxItem(ADialog.clbStates.Items.Add); + AItem.Text := ACheckGroup.ActiveProperties.Items[I].Caption; + AItem.State := ACheckGroup.States[I]; + end; +end; + +procedure TcxCheckGroupStatesItemsProperty.SynchronizeControlCheckStates(ADialog: TcxCheckGroupStatesEditorDlg); +var + I: Integer; +begin + with TcxCustomCheckGroup(GetComponent(0)) do + for I := 0 to ADialog.clbStates.Items.Count - 1 do + States[I] := ADialog.clbStates.Items[I].State; +end; + +{ TcxCheckComboBoxStatesItemsProperty } + +procedure TcxCheckComboBoxStatesItemsProperty.InitializeDlg(ADialog: TcxCheckGroupStatesEditorDlg); +var + ACheckComboBox: TcxCustomCheckComboBox; + AItem: TcxCheckListBoxItem; + I: Integer; +begin + ADialog.Caption := cxGetResourceString(@ + cxSCheckComboBoxStatesItemsPropertyDlgCaption); + ADialog.clbStates.Items.Clear; + ACheckComboBox := TcxCustomCheckComboBox(GetComponent(0)); + ADialog.clbStates.AllowGrayed := False; + for I := 0 to ACheckComboBox.ActiveProperties.Items.Count - 1 do + begin + AItem := TcxCheckListBoxItem(ADialog.clbStates.Items.Add); + AItem.Text := ACheckComboBox.ActiveProperties.Items[I].Description; + AItem.State := ACheckComboBox.States[I]; + end; +end; + +procedure TcxCheckComboBoxStatesItemsProperty.SynchronizeControlCheckStates(ADialog: TcxCheckGroupStatesEditorDlg); +var + I: Integer; +begin + with TcxCustomCheckComboBox(GetComponent(0)) do + for I := 0 to ADialog.clbStates.Items.Count - 1 do + States[I] := ADialog.clbStates.Items[I].State; +end; + +{ TcxCheckGroupComponentEditor } + +procedure TcxCheckGroupComponentEditor.Edit; +const + AMethodParams: array[0..0] of TMethodParam = + ((Flags: [pfAddress]; Name: 'Sender'; TypeName: 'TObject')); +begin + ShowEventMethod(Designer, TcxCustomEditAccess(Component).Properties, + 'OnChange', Component.Name + 'PropertiesChange', AMethodParams); +end; + +{$IFDEF DELPHI6} +procedure TcxCommonControlsSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + Proc('ComCtrls'); +end; +{$ENDIF} + +{ TcxCheckListBoxItemImageIndexProperty } + +function TcxCheckListBoxItemImageIndexProperty.GetImages: TCustomImageList; +begin + Result := TcxCustomInnerCheckListBox(GetPersistentOwner( + TcxCheckListBoxItem(GetComponent(0)).Collection)).Container.Images; +end; + +procedure RegisterEditRepositoryItems; +begin + RegisterEditRepositoryItem(TcxEditRepositoryLabel, scxSEditRepositoryLabelItem); + RegisterEditRepositoryItem(TcxEditRepositoryFontNameComboBox, scxSEditRepositoryFontNameComboBoxItem); + RegisterEditRepositoryItem(TcxEditRepositoryColorComboBox, scxSEditRepositoryColorComboBoxItem); + RegisterEditRepositoryItem(TcxEditRepositoryProgressBar, scxSEditRepositoryProgressBarItem); + RegisterEditRepositoryItem(TcxEditRepositoryTrackBar, scxSEditRepositoryTrackBarItem); + RegisterEditRepositoryItem(TcxEditRepositoryCheckComboBox, scxSEditRepositoryCheckComboBox); + RegisterEditRepositoryItem(TcxEditRepositoryCheckGroupItem, scxSEditRepositoryCheckGroupItem); + RegisterEditRepositoryItem(TcxEditRepositoryRichItem, scxSEditRepositoryRichEditItem); +end; + +procedure UnregisterEditRepositoryItems; +begin + UnregisterEditRepositoryItem(TcxEditRepositoryLabel); + UnregisterEditRepositoryItem(TcxEditRepositoryFontNameComboBox); + UnregisterEditRepositoryItem(TcxEditRepositoryColorComboBox); + UnregisterEditRepositoryItem(TcxEditRepositoryProgressBar); + UnregisterEditRepositoryItem(TcxEditRepositoryTrackBar); + UnregisterEditRepositoryItem(TcxEditRepositoryCheckComboBox); + UnregisterEditRepositoryItem(TcxEditRepositoryCheckGroupItem); + UnregisterEditRepositoryItem(TcxEditRepositoryRichItem); +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterComponents('Express Editors 6', [TcxLabel, TcxProgressBar, TcxTrackBar, + TcxCheckListBox, TcxColorComboBox, TcxFontNameComboBox, TcxCheckComboBox, + TcxCheckGroup, TcxRichEdit]); + RegisterComponents('Express DBEditors 6', [TcxDBLabel, TcxDBProgressBar, TcxDBTrackBar, + TcxDBCheckListBox, TcxDBColorComboBox, TcxDBFontNameComboBox, TcxDBCheckComboBox, + TcxDBCheckGroup, TcxDBRichEdit]); + RegisterComponents('Express Utilities', [TcxHintStyleController, TcxSpinButton, + TcxMCListBox, TcxListView, TcxTreeView, TcxHeader, TcxSplitter]); + + RegisterPropertyEditor(TypeInfo(string), TcxCustomSplitter, 'HotZoneClassName', nil); + RegisterPropertyEditor(TypeInfo(Boolean), TcxCustomSplitter, 'ResizeIgnoreSnap', nil); + RegisterPropertyEditor(TypeInfo(TcxHotZoneStyle), TcxCustomSplitter, 'HotZone', TcxHotZoneStyleProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomSplitter, 'HotZoneEvents', TcxHotZoneStyleEventsProperty); + RegisterPropertyEditor(TypeInfo(TcxEditValue), TcxCustomCheckGroup, 'EditValue', nil); + RegisterPropertyEditor(TypeInfo(Boolean), TcxCustomCheckGroup, 'StatesItems', TcxCheckGroupStatesItemsProperty); + RegisterPropertyEditor(TypeInfo(Boolean), TcxCustomCheckComboBox, 'StatesItems', TcxCheckComboBoxStatesItemsProperty); + RegisterPropertyEditor(TypeInfo(TcxEditValue), TcxCustomCheckListBox, 'EditValue', nil); + RegisterPropertyEditor(TypeInfo(TMeasureItemEvent), TcxCustomCheckListBox, 'OnMeasureItem', nil); + RegisterPropertyEditor(TypeInfo(Boolean), TcxLabelProperties, 'ShowEndEllipsis', nil); + RegisterPropertyEditor(TypeInfo(TcxEditValue), TcxCustomCheckComboBox, 'EditValue', nil); + RegisterPropertyEditor(TypeInfo(Variant), TcxCustomCheckComboBox, 'Value', nil); + RegisterPropertyEditor(TypeInfo(Boolean), TcxCustomSpinButton, 'AutoSize', nil); + RegisterPropertyEditor(TypeInfo(TTabOrder), TcxCustomLabel, 'TabOrder', nil); + RegisterPropertyEditor(TypeInfo(Boolean), TcxCustomLabel, 'TabStop', nil); + RegisterPropertyEditor(TypeInfo(Boolean), TcxCustomCheckComboBoxProperties, + 'AllowGrayed', nil); + RegisterPropertyEditor(TypeInfo(TcxProgressBarPropertiesValues), TcxCustomProgressBarProperties, 'AssignedValues', nil); +{$IFDEF DELPHI6} + RegisterPropertyEditor(TypeInfo(Integer), TcxCustomListView, 'ItemIndex', nil); + RegisterSelectionEditor(TcxCustomListView, TcxCommonControlsSelectionEditor); + RegisterSelectionEditor(TcxCustomTreeView, TcxCommonControlsSelectionEditor); +{$ENDIF} + + RegisterPropertyEditor(TypeInfo(TImageIndex), TcxCheckListBoxItem, 'ImageIndex', TcxCheckListBoxItemImageIndexProperty); + RegisterPropertyEditor(TypeInfo(TImageIndex), TcxHeaderSection, 'ImageIndex', TcxHeaderSectionImageIndexProperty); + + RegisterComponentEditor(TcxCheckListBox, TcxContainerComponentEditor); + RegisterComponentEditor(TcxCustomCheckGroup, TcxCheckGroupComponentEditor); + RegisterComponentEditor(TcxCustomHeader, TcxCustomHeaderComponentEditor); + RegisterComponentEditor(TcxDBCheckListBox, TcxContainerComponentEditor); + RegisterComponentEditor(TcxHintStyleController, TcxHintStyleComponentEditor); + RegisterComponentEditor(TcxListView, TcxContainerComponentEditor); + RegisterComponentEditor(TcxMCListBox, TcxContainerComponentEditor); + RegisterComponentEditor(TcxSplitter, TcxSplitterComponentEditor); + RegisterComponentEditor(TcxTreeView, TcxContainerComponentEditor); +end; + +initialization + RegisterEditRepositoryItems; + +finalization + UnregisterEditRepositoryItems; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxExtEditRepositoryItems.pas b/official/x.35/ExpressEditors Library 5/Sources/cxExtEditRepositoryItems.pas new file mode 100644 index 00000000..f448d73c --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxExtEditRepositoryItems.pas @@ -0,0 +1,298 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxExtEditRepositoryItems; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, ComCtrls, Controls, Forms, Graphics, Messages, StdCtrls, + SysUtils, cxCheckComboBox, cxCheckGroup, cxClasses, cxColorComboBox, cxEdit, + cxFontNameComboBox, cxLabel, cxProgressBar, cxRichEdit, cxSpinButton, + cxTextEdit, cxTrackBar; + +type + { TcxEditRepositoryLabel } + + TcxEditRepositoryLabel = class(TcxEditRepositoryItem) + private + function GetProperties: TcxLabelProperties; + procedure SetProperties(Value: TcxLabelProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxLabelProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryProgressBar } + + TcxEditRepositoryProgressBar = class(TcxEditRepositoryItem) + private + function GetProperties: TcxProgressBarProperties; + procedure SetProperties(Value: TcxProgressBarProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxProgressBarProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryFontComboBox } + + TcxEditRepositoryFontNameComboBox = class(TcxEditRepositoryItem) + private + function GetProperties: TcxFontNameComboBoxProperties; + procedure SetProperties(Value: TcxFontNameComboBoxProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxFontNameComboBoxProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryColorComboBox } + + TcxEditRepositoryColorComboBox = class(TcxEditRepositoryItem) + private + function GetProperties: TcxColorComboBoxProperties; + procedure SetProperties(Value: TcxColorComboBoxProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxColorComboBoxProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryTrackBar } + + TcxEditRepositoryTrackBar = class(TcxEditRepositoryItem) + private + function GetProperties: TcxTrackBarProperties; + procedure SetProperties(Value: TcxTrackBarProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxTrackBarProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryCheckComboBox } + + TcxEditRepositoryCheckComboBox = class(TcxEditRepositoryItem) + private + function GetProperties: TcxCheckComboBoxProperties; + procedure SetProperties(Value: TcxCheckComboBoxProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxCheckComboBoxProperties read GetProperties write SetProperties; + end; + + { TcxEditRepositoryCheckGroupItem } + + TcxEditRepositoryCheckGroupItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxCheckGroupProperties; + procedure SetProperties(Value: TcxCheckGroupProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxCheckGroupProperties read GetProperties + write SetProperties; + end; + + { TcxEditRepositoryRichItem } + + TcxEditRepositoryRichItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxRichEditProperties; + procedure SetProperties(Value: TcxRichEditProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxRichEditProperties read GetProperties write SetProperties; + end; + +implementation + +{ TcxEditRepositoryLabel } + +class function TcxEditRepositoryLabel.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxLabelProperties; +end; + +function TcxEditRepositoryLabel.GetProperties: TcxLabelProperties; +begin + Result := inherited Properties as TcxLabelProperties; +end; + +procedure TcxEditRepositoryLabel.SetProperties(Value: TcxLabelProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryProgressBar } + +class function TcxEditRepositoryProgressBar.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxProgressBarProperties; +end; + +function TcxEditRepositoryProgressBar.GetProperties: TcxProgressBarProperties; +begin + Result := inherited Properties as TcxProgressBarProperties; +end; + +procedure TcxEditRepositoryProgressBar.SetProperties(Value: TcxProgressBarProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryFontNameComboBox } + +class function TcxEditRepositoryFontNameComboBox.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxFontNameComboBoxProperties; +end; + +function TcxEditRepositoryFontNameComboBox.GetProperties: TcxFontNameComboBoxProperties; +begin + Result := inherited Properties as TcxFontNameComboBoxProperties; +end; + +procedure TcxEditRepositoryFontNameComboBox.SetProperties(Value: TcxFontNameComboBoxProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryColorComboBox } + +class function TcxEditRepositoryColorComboBox.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxColorComboBoxProperties; +end; + +function TcxEditRepositoryColorComboBox.GetProperties: TcxColorComboBoxProperties; +begin + Result := inherited Properties as TcxColorComboBoxProperties; +end; + +procedure TcxEditRepositoryColorComboBox.SetProperties(Value: TcxColorComboBoxProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryTrackBar } + +class function TcxEditRepositoryTrackBar.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxTrackBarProperties; +end; + +function TcxEditRepositoryTrackBar.GetProperties: TcxTrackBarProperties; +begin + Result := inherited Properties as TcxTrackBarProperties; +end; + +procedure TcxEditRepositoryTrackBar.SetProperties(Value: TcxTrackBarProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryCheckComboBox } + +class function TcxEditRepositoryCheckComboBox.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCheckComboBoxProperties; +end; + +function TcxEditRepositoryCheckComboBox.GetProperties: TcxCheckComboBoxProperties; +begin + Result := inherited Properties as TcxCheckComboBoxProperties; +end; + +procedure TcxEditRepositoryCheckComboBox.SetProperties(Value: TcxCheckComboBoxProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryCheckGroupItem } + +class function TcxEditRepositoryCheckGroupItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCheckGroupProperties; +end; + +function TcxEditRepositoryCheckGroupItem.GetProperties: TcxCheckGroupProperties; +begin + Result := inherited Properties as TcxCheckGroupProperties; +end; + +procedure TcxEditRepositoryCheckGroupItem.SetProperties( + Value: TcxCheckGroupProperties); +begin + inherited Properties := Value; +end; + +{ TcxEditRepositoryRichItem } + +class function TcxEditRepositoryRichItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxRichEditProperties; +end; + +function TcxEditRepositoryRichItem.GetProperties: TcxRichEditProperties; +begin + Result := inherited Properties as TcxRichEditProperties; +end; + +procedure TcxEditRepositoryRichItem.SetProperties( + Value: TcxRichEditProperties); +begin + inherited Properties := Value; +end; + +initialization + RegisterClasses([TcxEditRepositoryLabel, TcxEditRepositoryProgressBar, + TcxEditRepositoryFontNameComboBox, TcxEditRepositoryColorComboBox, + TcxEditRepositoryTrackBar, TcxEditRepositoryCheckComboBox, + TcxEditRepositoryCheckGroupItem, TcxEditRepositoryRichItem]); + +finalization + UnRegisterClasses([TcxEditRepositoryLabel, TcxEditRepositoryProgressBar, + TcxEditRepositoryFontNameComboBox, TcxEditRepositoryColorComboBox, + TcxEditRepositoryTrackBar, TcxEditRepositoryCheckComboBox, + TcxEditRepositoryCheckGroupItem, TcxEditRepositoryRichItem]); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxExtEditUtils.pas b/official/x.35/ExpressEditors Library 5/Sources/cxExtEditUtils.pas new file mode 100644 index 00000000..0e48035f --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxExtEditUtils.pas @@ -0,0 +1,703 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxExtEditUtils; + +{$I cxVer.inc} + +interface + +{.$DEFINE NOFLICKER} + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Classes, Controls, Forms, Graphics, ImgList, Messages, StdCtrls, + SysUtils, cxCheckBox, cxClasses, cxContainer, cxControls, cxEdit, + cxEditPaintUtils, cxEditUtils, cxGraphics, cxLookAndFeelPainters, + cxLookAndFeels, cxTextEdit, cxVariants, dxThemeManager; + +const + MRUDelimiterWidth = 3; + +type + { TcxControlHook } + + TcxControlHook = class(TObject) + private + FControl: TWinControl; + FNewWndProc: Pointer; + FPrevWndProcAddress: Pointer; + FDestroying: Boolean; + protected + procedure SetWinControl(Value: TWinControl); virtual; + procedure HookWndProc(var AMsg: TMessage); virtual; + public + constructor Create; + destructor Destroy; override; + procedure HookControl; virtual; + procedure UnhookControl; virtual; + property WinControl: TWinControl read FControl write SetWinControl; + property IsDestroying: Boolean read FDestroying; + end; + +function DrawBounds(ACanvas: TcxCanvas; Bounds: TRect; const AUpperLeftColor, + ALowerRightColor: TColor): TRect; +procedure DrawCanvasLine(ACanvas: TCanvas; const AColor: TColor; + const AFromPoint, AToPoint: TPoint); +procedure DrawMRUDelimiter(ACanvas: TCanvas; const AItemRect: TRect; + AIsItemSelected: Boolean); +procedure InflateRectEx(var R: TRect; const AlOffset, AtOffset, ArOffset, AbOffset: Integer); +function RectWidth(const ARect: TRect): Integer; +function NonCanvasTextHeight(const AFont: TFont): Integer; +function NonCanvasTextWidth(const AFont: TFont; const AText: string): Integer; +function CalcMaxWidth(ACanvas: TCanvas; const AText: string): Integer; +function RectHeight(const ARect: TRect): Integer; +function PrepareTextFlag(const AStartFlag: Longint; + const AHorzAlignments: TAlignment; const AVertAlignments: TcxAlignmentVert; + const AShowEndEllipsis: Boolean; const AWordWrap: Boolean; + const ATabWidth: Integer = 0; const AIsDTFlags: Boolean = True; + const AShowAccelChar: Boolean = False): Longint; +function IncColor(const AColor: TColor; const AR, AG, AB: Integer): TColor; +function CalcCenterPosHeight(const ARect: TRect; const ADrawHeight: Integer): Integer; +function CalcDrawWidth(const ARect: TRect; const ADrawHeight: Integer): Integer; +function IsVarEmpty(const AValue: Variant): Boolean; +function IsValidStringForInt(S: string): Boolean; +function IsValidStringForDouble(const AValue: string): Boolean; +function cxStrToInt(const AValue: string; + AToFirstNonNum: Boolean = False): Integer; +function cxStrToFloat(const AValue: string; + AToFirstNonNum: Boolean = False): Extended; +function cxStrToColor(const S: string; out AColor: TColor): Boolean; +function cxRGBStringColorToColor(const AString: string): TColor; +function cxHexRGBStringColorToColor(const AString: string): TColor; +function CheckStateToString(const Value: TcxCheckBoxState): string; +function StringToCheckState(const Value: string; const AllowGrayed: Boolean): TcxCheckBoxState; +function CurrentShiftState: TShiftState; +function GetWord(const APosition: Integer; const S: string; + const Delimiter: Char): string; +procedure PaintBackground(const AControl: TWinControl; DC: HDC; DoParent: Boolean); +{$IFNDEF DELPHI5} +function SameText(const S1, S2: string): Boolean; assembler; +{$ENDIF} +function AdjustCanvasFont(ACanvas: TCanvas; AFont: TFont; AAngle: Integer): Boolean; + +implementation + +uses + Math, cxDrawTextUtils, dxThemeConsts, dxUxTheme; + +type + TWinControlAccess = class(TWinControl); + +{ TcxControlHook } + +constructor TcxControlHook.Create; +begin + inherited Create; + FNewWndProc := + {$IFDEF DELPHI6}Classes.{$ENDIF}MakeObjectInstance(HookWndProc); +end; + +destructor TcxControlHook.Destroy; +begin + FDestroying := True; + WinControl := nil; + {$IFDEF DELPHI6}Classes.{$ENDIF}FreeObjectInstance(FNewWndProc); + FNewWndProc := nil; + inherited Destroy; +end; + +procedure TcxControlHook.HookControl; +begin + if Assigned(FControl) and not((csDesigning in FControl.ComponentState) or + (csDestroying in FControl.ComponentState) or FDestroying) then + begin + FControl.HandleNeeded; + FPrevWndProcAddress := Pointer(GetWindowLong(FControl.Handle, GWL_WNDPROC)); + SetWindowLong(FControl.Handle, GWL_WNDPROC, + LongInt(FNewWndProc)); + end; +end; + +procedure TcxControlHook.UnhookControl; +begin + if Assigned(FControl) then + begin + if Assigned(FPrevWndProcAddress) and FControl.HandleAllocated and + (Pointer(GetWindowLong(FControl.Handle, GWL_WNDPROC)) = + FNewWndProc) then + SetWindowLong(FControl.Handle, GWL_WNDPROC, LongInt(FPrevWndProcAddress)); + end; + FPrevWndProcAddress := nil; +end; + +procedure TcxControlHook.HookWndProc(var AMsg: TMessage); +begin + if Assigned(FControl) and not IsDestroying then + begin + if Assigned(FPrevWndProcAddress) then + AMsg.Result := CallWindowProc(FPrevWndProcAddress, FControl.Handle, AMsg.Msg, + AMsg.WParam, AMsg.LParam) + else + AMsg.Result := CallWindowProc(TWinControlAccess(FControl).DefWndProc, + FControl.Handle, AMsg.Msg, AMsg.WParam, AMsg.LParam); + if AMsg.Msg = WM_DESTROY then + UnhookControl; + end; +end; + +procedure TcxControlHook.SetWinControl(Value: TWinControl); +begin + if Value <> FControl then + begin + if FControl <> nil then + UnhookControl; + FControl := Value; + if FControl <> nil then + HookControl; + end; +end; +{ TcxControlHook } + +function DrawBounds(ACanvas: TcxCanvas; Bounds: TRect; + const AUpperLeftColor, ALowerRightColor: TColor): TRect; +begin + ACanvas.Pen.Color:=AUpperLeftColor; + ACanvas.MoveTo(Bounds.Left, Bounds.Top); + ACanvas.LineTo(Bounds.Left, Bounds.Bottom + 1); + ACanvas.MoveTo(Bounds.Left, Bounds.Top); + ACanvas.LineTo(Bounds.Right + 1, Bounds.Top); + ACanvas.Pen.Color:=ALowerRightColor; + ACanvas.MoveTo(Bounds.Right, Bounds.Top + 1); + ACanvas.LineTo(Bounds.Right, Bounds.Bottom); + ACanvas.MoveTo(Bounds.Left + 1, Bounds.Bottom); + ACanvas.LineTo(Bounds.Right + 1, Bounds.Bottom); + Result.Left := Bounds.Left + 1; + Result.Top := Bounds.Top + 1; + Result.Right := Bounds.Right - 1; + Result.Bottom := Bounds.Bottom - 1; +end; + +procedure DrawCanvasLine(ACanvas: TCanvas;const AColor: TColor; + const AFromPoint, AToPoint: TPoint); +begin + ACanvas.Pen.Color := AColor; + ACanvas.MoveTo(AFromPoint.x, AFromPoint.y); + ACanvas.LineTo(AToPoint.x, AToPoint.y); +end; + +procedure DrawMRUDelimiter(ACanvas: TCanvas; const AItemRect: TRect; + AIsItemSelected: Boolean); +begin + if AIsItemSelected then + ACanvas.Pen.Color := clWindow + else + ACanvas.Pen.Color := clWindowText; + ACanvas.MoveTo(AItemRect.Left, AItemRect.Bottom - MRUDelimiterWidth); + ACanvas.LineTo(AItemRect.Right, AItemRect.Bottom - MRUDelimiterWidth); + ACanvas.MoveTo(AItemRect.Left, AItemRect.Bottom - 1); + ACanvas.LineTo(AItemRect.Right, AItemRect.Bottom - 1); +end; + +procedure InflateRectEx(var R: TRect; const AlOffset, AtOffset, ArOffset, AbOffset: Integer); +begin + with R do + begin + Left := Left + AlOffset; + Top := Top + AtOffset; + Right := Right + ArOffset; + Bottom := Bottom + AbOffset; + end; +end; + +function RectWidth(const ARect: TRect): Integer; +begin + Result := ARect.Right - ARect.Left; + if Result < 0 then + Result := 0; +end; + +function RectHeight(const ARect: TRect): Integer; +begin + Result := ARect.Bottom - ARect.Top; + if Result < 0 then + Result := 0; +end; + +function PrepareTextFlag(const AStartFlag: Longint; + const AHorzAlignments: TAlignment; const AVertAlignments: TcxAlignmentVert; + const AShowEndEllipsis: Boolean; const AWordWrap: Boolean; + const ATabWidth: Integer = 0; const AIsDTFlags: Boolean = True; + const AShowAccelChar: Boolean = False): Longint; +const + ShowAccelCharArray: array[Boolean] of Integer = (DT_NOPREFIX, 0); + cxShowAccelCharArray: array[Boolean] of Integer = (0, cxShowPrefix); + + ShowEndEllipsisArray: array[Boolean] of Integer = (0, DT_END_ELLIPSIS); + cxShowEndEllipsisArray: array[Boolean] of Integer = (0, cxShowEndEllipsis); + + WordWrapArray: array[Boolean] of Integer = (0, DT_WORDBREAK); + cxWordWrapArray: array[Boolean] of Integer = (0, cxWordBreak); + +begin + Result := AStartFlag; + if AIsDTFlags then + begin + Result := Result or SystemAlignmentsHorz[AHorzAlignments] or + SystemAlignmentsVert[AVertAlignments] or + ShowEndEllipsisArray[AShowEndEllipsis] or + WordWrapArray[AWordWrap] or ShowAccelCharArray[AShowAccelChar]; + if ATabWidth > 0 then + Result := Result or DT_EXPANDTABS or DT_TABSTOP; + end + else + begin + Result := Result or cxAlignmentsHorz[AHorzAlignments] or + cxAlignmentsVert[AVertAlignments] or + cxShowEndEllipsisArray[AShowEndEllipsis] or + cxWordWrapArray[AWordWrap] or cxShowAccelCharArray[AShowAccelChar]; + if ATabWidth > 0 then + Result := Result or cxExpandTabs; + end; +end; + +function NonCanvasTextHeight(const AFont: TFont): Integer; +var + FBitmap: TBitmap; +begin + FBitmap := TBitmap.Create; + try + FBitmap.Canvas.Font.Assign(AFont); + Result := FBitmap.Canvas.TextHeight('Wg'); + finally + FBitmap.Free; + end; +end; + +function NonCanvasTextWidth(const AFont: TFont; const AText: string): Integer; +var + FBitmap: TBitmap; +begin + FBitmap := TBitmap.Create; + try + FBitmap.Canvas.Font.Assign(AFont); + Result := FBitmap.Canvas.TextWidth(AText); + finally + FBitmap.Free; + end; +end; + +function CalcMaxWidth(ACanvas: TCanvas; const AText: string): Integer; +var + FStringList: TStringList; + I, FWidth: Integer; +begin + Result := ACanvas.TextWidth(AText); + FStringList := TStringList.Create; + try + FStringList.Text := AText; + for I := 0 to FStringList.Count - 1 do + begin + FWidth := ACanvas.TextWidth(FStringList[I]); + if FWidth > Result then Result := FWidth; + end; + finally + FStringList.Free; + end; + Inc(Result, 1); +end; + +function IncColor(const AColor: TColor; const AR, AG, AB: Integer): TColor; +var + FR, FG, FB: Integer; +begin + FR := GetRValue(ColorToRGB(AColor)); + FG := GetGValue(ColorToRGB(AColor)); + FB := GetBValue(ColorToRGB(AColor)); + if (FR + AR) > High(Byte) then + FR := High(Byte) + else + Inc(FR, AR); + if (FG + AG) > High(Byte) then + FG := High(Byte) + else + Inc(FG, AG); + if (FB + AB) > High(Byte) then + FB := High(Byte) + else + Inc(FB, AB); + Result := RGB(FR, FG, FB); +end; + +function CalcCenterPosHeight(const ARect: TRect; const ADrawHeight: Integer): Integer; +begin + Result := (ARect.Bottom - ARect.Top - ADrawHeight) div 2; +end; + +function CalcDrawWidth(const ARect: TRect; const ADrawHeight: Integer): Integer; +begin + Result := (CalcCenterPosHeight(ARect, ADrawHeight) * 2 + 2) + ADrawHeight; +end; + +function IsVarEmpty(const AValue : Variant): Boolean; +begin + Result := VarIsNull(AValue) or VarIsEmpty(AValue); +end; + +{$HINTS OFF} +function IsValidStringForInt(S: string): Boolean; +var + ACode, AValue: Integer; +begin + Result := False; + S := Trim(S); + if Length(S) > 0 then + begin + Val(S, AValue, ACode); + Result := ACode = 0; + end; +end; +{$HINTS ON} + +function IsValidStringForDouble(const AValue: string): Boolean; +var + I: Integer; + AString: string; + ADecimalSeparatorCounter: Integer; +begin + AString := Trim(AValue); + ADecimalSeparatorCounter := 0; + Result := Length(AString) > 0; + { Check for valid numeric symbols in string } + if Result = True then + for I := 1 to Length(AString) do + begin + if not(AString[I] in ['0'..'9', DecimalSeparator]) and + ((AString[I] <> '-') or ((AString[I] = '-') and (I > 1))) then + Result := False + else + if AString[I] = DecimalSeparator then + begin + if ADecimalSeparatorCounter = 0 then + Inc(ADecimalSeparatorCounter) + else + Result := False + end; + if Result = False then Break; + end; + { Check for valid Double range } + if Result then + Result := (Abs(StrToFloat(AString)) <= MaxDouble); +end; + +function cxStrToInt(const AValue: string; + AToFirstNonNum: Boolean = False): Integer; +var + I: Integer; + S: string; +begin + S := ''; + for I := 1 to Length(AValue) do + if AValue[I] in ['0'..'9', '-'] then + S := S + AValue[I] + else + if AToFirstNonNum then + Break; + if S = '' then + S := '0'; + Result := StrToInt(S); +end; + +function cxStrToFloat(const AValue: string; + AToFirstNonNum: Boolean = False): Extended; +var + I: Integer; + S: string; +begin + S := ''; + for I := 1 to Length(AValue) do + if AValue[I] in ['0'..'9', '-', DecimalSeparator] then + S := S + AValue[I] + else + if AToFirstNonNum then + Break; + if S = '' then + S := '0'; + Result := StrToFloat(S); +end; + +function cxStrToColor(const S: string; out AColor: TColor): Boolean; +var + ATempColor: Longint; +begin + Result := IdentToColor(S, ATempColor); + if Result then + AColor := ATempColor + else + begin + Result := IsValidStringForInt(S); + if Result then + AColor := TColor(cxStrToInt(S)); + end; +end; + +function cxRGBStringColorToColor(const AString: string): TColor; +var + I, FPos: Integer; + R, G, B: Integer; + S, FSColor: string; +begin + R := 0; + G := 0; + B := 0; + FSColor := AString; + for I := 1 to 3 do + begin + S := ''; + FPos := Pos('.', FSColor); + if (FPos > 0) then + S := Copy(FSColor, 1, FPos - 1) + else + S := FSColor; + FSColor := Copy(FSColor, FPos + 1, Length(FSColor) - FPos); + case I of + 1: R := cxStrToInt(S); + 2: G := cxStrToInt(S); + 3: B := cxStrToInt(S); + end; + end; + Result := RGB(R, G, B); +end; + +function cxHexRGBStringColorToColor(const AString: string): TColor; +var + R, G, B: Integer; + S: string; + + function IsHexDigit(C: Char): Boolean; + begin + Result := (C >= '0') and (C <= '9') or (C >= 'A') and (C <= 'F') or + (C >= 'a') and (C <= 'f'); + end; + + function RemoveNonHexChars(const AString: string): string; + var + I: Integer; + begin + Result := ''; + for I := 1 to Length(AString) do + if IsHexDigit(AString[I]) then + Result := Result + AString[I]; + end; + + function HexStrToInt(const S: string): Longint; + var + HexStr: string; + begin + if Pos('$', S) = 0 then + HexStr := '$' + S + else + HexStr := S; + Result := StrToIntDef(HexStr, 0); + end; + + function IntToByte(const Value: Integer): Byte; + begin + if Value > MaxByte then + Result := MaxByte + else + Result := Value; + end; + +begin + S := RemoveNonHexChars(AString); + R := IntToByte(HexStrToInt(Copy(S, 1, 2))); + G := IntToByte(HexStrToInt(Copy(S, 3, 2))); + B := IntToByte(HexStrToInt(Copy(S, 5, 2))); + Result := RGB(R, G, B); +end; + +function CheckStateToString(const Value: TcxCheckBoxState): string; +begin + case Value of + cbsChecked: Result := '1'; + cbsGrayed: Result := '2'; + else Result := '0'; + end; +end; + +function StringToCheckState(const Value: string; const AllowGrayed: Boolean): TcxCheckBoxState; +begin + if AllowGrayed then + begin + if Value = '1' then Result := cbsChecked + else if Value = '0' then Result := cbsUnchecked + else Result := cbsGrayed; + end + else + begin + if Value = '1' then Result := cbsChecked + else Result := cbsUnchecked; + end; +end; + +function CurrentShiftState: TShiftState; +{$IFDEF DELPHI5} +var + KeyState: TKeyboardState; +{$ENDIF} +begin + {$IFDEF DELPHI5} + GetKeyboardState(KeyState); + Result := KeyboardStateToShiftState(KeyState); + {$ELSE} + Result := []; + if GetAsyncKeyState(VK_SHIFT) <> 0 then Include(Result, ssShift); + if GetAsyncKeyState(VK_CONTROL) <> 0 then Include(Result, ssCtrl); + if GetAsyncKeyState(VK_MENU) <> 0 then Include(Result, ssAlt); + if GetAsyncKeyState(VK_LBUTTON) <> 0 then Include(Result, ssLeft); + if GetAsyncKeyState(VK_RBUTTON) <> 0 then Include(Result, ssRight); + if GetAsyncKeyState(VK_MBUTTON) <> 0 then Include(Result, ssMiddle); + {$ENDIF} +end; + +function GetWord(const APosition: Integer; const S: string; + const Delimiter: Char): string; +var + I, FPos: Integer; + FStr: string; +begin + Result := ''; + if APosition <= 0 then Exit; + FStr := S; + I := 1; + FPos := Pos(Delimiter, FStr); + if FPos = 0 then + begin + if APosition = 1 then Result := S; + end + else + begin + while FPos > 0 do + begin + if I = APosition then + begin + Result := Copy(FStr, 1, FPos - 1); + Break; + end + else + FStr := Copy(FStr, FPos + 1, Length(FStr)); + Inc(I); + if FStr = '' then Break; + FPos := Pos(Delimiter, FStr); + if (FPos = 0) and (I = APosition) then + Result := FStr; + end; + end; +end; + +procedure PaintBackground(const AControl: TWinControl; DC: HDC; DoParent: Boolean); +var + P: TPoint; + FSaveIndex: Integer; +begin + if Assigned(AControl) and (Assigned(AControl.Parent) and DoParent) then + begin + FSaveIndex := SaveDC(DC); + try + P := AControl.ClientOrigin; + Windows.ScreenToClient(AControl.Parent.Handle, P); + MoveWindowOrg(DC, -P.X, -P.Y); + if Assigned(AControl.Parent) and DoParent then + begin + SendMessage(AControl.Parent.Handle, WM_ERASEBKGND, DC, 0); + SendMessage(AControl.Parent.Handle, WM_PAINT, DC, 0); + TWinControlAccess(AControl.Parent).PaintControls(DC, nil); + end + else + begin + SendMessage(AControl.Handle, WM_ERASEBKGND, DC, 0); + TWinControlAccess(AControl).PaintControls(DC, nil); + end; + finally + RestoreDC(DC, FSaveIndex); + end; + end; +end; + +{$IFNDEF DELPHI5} +function SameText(const S1, S2: string): Boolean; assembler; +asm + CMP EAX,EDX + JZ @1 + OR EAX,EAX + JZ @2 + OR EDX,EDX + JZ @3 + MOV ECX,[EAX-4] + CMP ECX,[EDX-4] + JNE @3 + CALL CompareText + TEST EAX,EAX + JNZ @3 +@1: MOV AL,1 +@2: RET +@3: XOR EAX,EAX +end; +{$ENDIF} + +function AdjustCanvasFont(ACanvas: TCanvas; AFont: TFont; AAngle: Integer): Boolean; +var + ALogFont: TLogFont; + ARealAngle: Integer; + ATextMetric: TTextMetric; +begin + ACanvas.Font.Assign(AFont); + GetTextMetrics(ACanvas.Handle, ATextMetric); + ARealAngle := (AAngle mod 360 + 360) mod 360; + Result := ((ATextMetric.tmPitchAndFamily and TMPF_TRUETYPE) <> 0); + if not Result then Exit; + if ARealAngle <> 0 then + begin + cxGetFontData(ACanvas.Font.Handle, ALogFont); + ALogFont.lfEscapement := ARealAngle * 10; + ACanvas.Font.Handle := CreateFontIndirect(ALogFont); + end; +end; + +end. + diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxFilterControl.pas b/official/x.35/ExpressEditors Library 5/Sources/cxFilterControl.pas new file mode 100644 index 00000000..5da4e0cb --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxFilterControl.pas @@ -0,0 +1,3556 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressFilterControl } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxFilterControl; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, +{$IFDEF DELPHI6} + Types, + Variants, +{$ENDIF} + Classes, SysUtils, Controls, Forms, Graphics, cxFilter, cxEdit, + cxClasses, cxContainer, cxControls, cxGraphics, cxLookAndFeels, + cxLookAndFeelPainters, cxDropDownEdit, Menus, cxTextEdit, StdCtrls, + cxFilterControlUtils, cxDataStorage, cxFormats; + +const + cxFilterControlMaxDropDownRows = 12; + +type + IcxFilterControl = interface + ['{B9890E09-5400-428D-8F72-1FF8FD15937C}'] + function GetCaption(Index: Integer): string; + function GetCount: Integer; + function GetCriteria: TcxFilterCriteria; + function GetItemLink(Index: Integer): TObject; + function GetItemLinkID(Index: Integer): Integer; + function GetItemLinkName(Index: Integer): string; + function GetFieldName(Index: Integer): string; + function GetProperties(Index: Integer): TcxCustomEditProperties; + function GetValueType(Index: Integer): TcxValueTypeClass; + + property Captions[Index: Integer]: string read GetCaption; + property Count: Integer read GetCount; + property Criteria: TcxFilterCriteria read GetCriteria; + property ItemLinkNames[Index: Integer]: string read GetItemLinkName; + property ItemLinkIDs[Index: Integer]: Integer read GetItemLinkID; + property ItemLinks[Index: Integer]: TObject read GetItemLink; + property FieldNames[Index: Integer]: string read GetFieldName; + property Properties[Index: Integer]: TcxCustomEditProperties read GetProperties; + property ValueTypes[Index: Integer]: TcxValueTypeClass read GetValueType; + end; + + IcxFilterControlDialog = interface + ['{D2369F8D-3B22-41A8-881E-B01BEB624B7D}'] + procedure SetDialogLinkComponent(ALink: TComponent); + end; + + TcxFilterControlCriteria = class; + TcxCustomFilterControl = class; + TcxCustomFilterControlClass = class of TcxCustomFilterControl; + TcxFilterControlViewInfo = class; + TcxFilterControlViewInfoClass = class of TcxFilterControlViewInfo; + + { TcxFilterControlCriteriaItem } + + TcxFilterControlCriteriaItem = class(TcxFilterCriteriaItem) + private + function GetFilterControlCriteria: TcxFilterControlCriteria; + function GetFilter: IcxFilterControl; + function GetItemIndex: Integer; + function ValidItem: Boolean; + protected + function GetDataValue(AData: TObject): Variant; override; + function GetFieldCaption: string; override; + function GetFieldName: string; override; + function GetFilterOperatorClass: TcxFilterOperatorClass; override; + property ItemIndex: Integer read GetItemIndex; + public + property Filter: IcxFilterControl read GetFilter; + property Criteria: TcxFilterControlCriteria read GetFilterControlCriteria; + end; + + { TcxFilterControlCriteria } + + TcxFilterControlCriteria = class(TcxFilterCriteria) + private + FControl: TcxCustomFilterControl; + protected + function GetIDByItemLink(AItemLink: TObject): Integer; override; + function GetItemClass: TcxFilterCriteriaItemClass; override; + function GetItemLinkByID(AID: Integer): TObject; override; + //ver. 3 + function GetNameByItemLink(AItemLink: TObject): string; override; + function GetItemLinkByName(const AName: string): TObject; override; + + property Control: TcxCustomFilterControl read FControl; + public + constructor Create(AOwner: TcxCustomFilterControl); virtual; + procedure AssignEvents(Source: TPersistent); override; + end; + + TcxFilterControlCriteriaClass = class of TcxFilterControlCriteria; + + TcxCustomRowViewInfo = class; + TcxGroupViewInfo = class; + TcxConditionViewInfo = class; + + TcxFilterControlHitTest = (fhtNone, fhtButton, fhtBoolOperator, fhtItem, + fhtOperator, fhtValue, fhtAddCondition, fhtAddValue); + + TcxFilterControlHitTestInfo = record + HitTest: TcxFilterControlHitTest; + Mouse: TPoint; + Shift: TShiftState; + Row: TcxCustomRowViewInfo; + ValueIndex: Integer; + end; + + { TcxCustomRowViewInfo } + + TcxCustomRowViewInfo = class + private + FButtonText: string; + FButtonRect: TRect; + FButtonState: TcxButtonState; + FControl: TcxCustomFilterControl; + FCriteriaItem: TcxCustomFilterCriteriaItem; + FLevel: Integer; + FIndent: Integer; + FParent: TcxCustomRowViewInfo; + FRowRect: TRect; + function GetCondition: TcxConditionViewInfo; + function GetFocused: Boolean; + function GetGroup: TcxGroupViewInfo; + procedure GetInternal; + protected + function GetWidth: Integer; virtual; + function IsLast: Boolean; + public + constructor Create(AControl: TcxCustomFilterControl; + AParent: TcxCustomRowViewInfo; + ACriteriaItem: TcxCustomFilterCriteriaItem); virtual; + destructor Destroy; override; + procedure Calc(const ARowRect: TRect); virtual; + procedure GetHitTestInfo(const P: TPoint; var HitInfo: TcxFilterControlHitTestInfo); virtual; + function Ready: Boolean; virtual; + + property ButtonRect: TRect read FButtonRect write FButtonRect; + property ButtonState: TcxButtonState read FButtonState write FButtonState; + property ButtonText: string read FButtonText write FButtonText; + property Condition: TcxConditionViewInfo read GetCondition; + property Control: TcxCustomFilterControl read FControl; + property CriteriaItem: TcxCustomFilterCriteriaItem read FCriteriaItem; + property Focused: Boolean read GetFocused; + property Group: TcxGroupViewInfo read GetGroup; + property Indent: Integer read FIndent; + property Level: Integer read FLevel; + property Parent: TcxCustomRowViewInfo read FParent; + property RowRect: TRect read FRowRect write FRowRect; + property Width: Integer read GetWidth; + end; + + { TcxGroupViewInfo } + + TcxGroupViewInfo = class(TcxCustomRowViewInfo) + private + FBoolOperator: TcxFilterBoolOperatorKind; + FBoolOperatorText: string; + FBoolOperatorRect: TRect; + FCaption: string; + FCaptionRect: TRect; + FRows: TList; + function GetRow(Index: Integer): TcxCustomRowViewInfo; + function GetRowCount: Integer; + procedure SetRow(Index: Integer; const Value: TcxCustomRowViewInfo); + protected + function GetWidth: Integer; override; + public + constructor Create(AControl: TcxCustomFilterControl; + AParent: TcxCustomRowViewInfo; + ACriteriaItem: TcxCustomFilterCriteriaItem); override; + destructor Destroy; override; + procedure Add(ARow: TcxCustomRowViewInfo); + procedure Remove(ARow: TcxCustomRowViewInfo); + procedure Calc(const ARowRect: TRect); override; + procedure GetHitTestInfo(const P: TPoint; var HitInfo: TcxFilterControlHitTestInfo); override; + property BoolOperator: TcxFilterBoolOperatorKind read FBoolOperator write FBoolOperator; + property BoolOperatorText: string read FBoolOperatorText write FBoolOperatorText; + property BoolOperatorRect: TRect read FBoolOperatorRect; + property Caption: string read FCaption write FCaption; + property CaptionRect: TRect read FCaptionRect; + property RowCount: Integer read GetRowCount; + property Rows[Index: Integer]: TcxCustomRowViewInfo read GetRow write SetRow; + end; + + { TcxValuesViewInfo } + + TcxValueInfo = class + private + FValue: TcxEditValue; + FValueText: TCaption; + FValueRect: TRect; + FValueViewInfo: TcxCustomEditViewInfo; + procedure SetValueViewInfo(const Value: TcxCustomEditViewInfo); + public + constructor Create; + destructor Destroy; override; + property Value: TcxEditValue read FValue write FValue; + property ValueText: TCaption read FValueText write FValueText; + property ValueRect: TRect read FValueRect write FValueRect; + property ValueViewInfo: TcxCustomEditViewInfo + read FValueViewInfo write SetValueViewInfo; + end; + + { TcxValuesViewInfo } + + TcxValuesViewInfo = class + private + FAddButtonRect: TRect; + FAddButtonState: TcxButtonState; + FCondition: TcxConditionViewInfo; + FList: TList; + FSeparator: string; + function GetControl: TcxCustomFilterControl; + function GetValue(Index: Integer): TcxValueInfo; + function GetWidth: Integer; + protected + function GetCount: Integer; + procedure UpdateEditorStyle(AStyle: TcxCustomEditStyle; + AHightlited, AEnabled: Boolean); + public + constructor Create(ACondition: TcxConditionViewInfo); + destructor Destroy; override; + procedure AddValue; + procedure Calc; + procedure Clear; + procedure GetHitTestInfo(const P: TPoint; var HitInfo: TcxFilterControlHitTestInfo); virtual; + procedure RemoveValue(AIndex: Integer); + property AddButtonRect: TRect read FAddButtonRect; + property AddButtonState: TcxButtonState read FAddButtonState; + property Condition: TcxConditionViewInfo read FCondition; + property Control: TcxCustomFilterControl read GetControl; + property Count: Integer read GetCount; + property Separator: string read FSeparator; + property Values[Index: Integer]: TcxValueInfo read GetValue; default; + property Width: Integer read GetWidth; + end; + + { TcxConditionViewInfo } + + TcxConditionViewInfo = class(TcxCustomRowViewInfo) + private + FOperator: TcxFilterControlOperator; + FOperatorRect: TRect; + FOperatorText: string; + FItemIndex: Integer; + FItemLink: TObject; + FItemRect: TRect; + FItemText: string; + FEditorHelper: TcxCustomFilterEditHelperClass; + FEditorProperties: TcxCustomEditProperties; + FSupportedOperators: TcxFilterControlOperators; + FValueType: TcxValueTypeClass; + FValues: TcxValuesViewInfo; + private + function GetItemIndex: Integer; + protected + ValueEditorData: TcxCustomEditData; + procedure AddValue; + function GetWidth: Integer; override; + function HasDisplayValues: Boolean; virtual; + procedure InitValues(ASaveValue: Boolean); + procedure InternalInit; virtual; + procedure SetItem(AIndex: Integer); + procedure ValidateConditions; + public + constructor Create(AControl: TcxCustomFilterControl; + AParent: TcxCustomRowViewInfo; + ACriteriaItem: TcxCustomFilterCriteriaItem); override; + destructor Destroy; override; + procedure Calc(const ARowRect: TRect); override; + procedure GetHitTestInfo(const P: TPoint; var HitInfo: TcxFilterControlHitTestInfo); override; + function GetProperties: TcxCustomEditProperties; + function Ready: Boolean; override; + property EditorHelper: TcxCustomFilterEditHelperClass read FEditorHelper; + property EditorProperties: TcxCustomEditProperties read FEditorProperties; + property ItemLink: TObject read FItemLink; + property ItemIndex: Integer read FItemIndex; + property ItemRect: TRect read FItemRect; + property ItemText: string read FItemText write FItemText; + property Operator: TcxFilterControlOperator read FOperator write FOperator; + property OperatorRect: TRect read FOperatorRect; + property OperatorText: string read FOperatorText write FOperatorText; + property SupportedOperators: TcxFilterControlOperators read FSupportedOperators; + property ValueType: TcxValueTypeClass read FValueType; + property Values: TcxValuesViewInfo read FValues; + end; + + { TcxCustomFilterControl } + + TFilterControlState = (fcsNormal, fcsSelectingAction, fcsSelectingItem, + fcsSelectingBoolOperator, fcsSelectingCondition, fcsSelectingValue); + + TcxFilterControlFont = (fcfBoolOperator, fcfItem, fcfCondition, fcfValue); + TcxActivateValueEditKind = (aveEnter, aveKey, aveMouse); + + TcxCustomFilterControl = class(TcxControl, IcxMouseTrackingCaller, + IcxFormatControllerListener, IdxSkinSupport) + private + FActionMenu: TPopupMenu; + FComboBox: TcxComboBox; + FCriteria: TcxFilterControlCriteria; + FFocusedInfo: TcxFilterControlHitTestInfo; + FFonts: array[TcxFilterControlFont] of TFont; + FHotTrack: TcxFilterControlHitTestInfo; + FInplaceEditors: TcxInplaceEditList; + FLeftOffset: Integer; + FLockCount: Integer; + FRoot: TcxCustomRowViewInfo; + FRows: TList; + FSortItems: Boolean; + FState: TFilterControlState; + FTextEditProperties: TcxTextEditProperties; + FTopVisibleRow: Integer; + + FValueEditor: TcxCustomEdit; + FValueEditorStyle: TcxCustomEditStyle; + + FViewInfo: TcxFilterControlViewInfo; + FHotTrackOnUnfocused: Boolean; + FNullString: string; + FShowLevelLines: Boolean; + FWantTabs: Boolean; + FWasError: Boolean; + FOnApplyFilter: TNotifyEvent; + procedure CreateFonts; + procedure DoFontChanged(Sender: TObject); + function GetFont(Index: Integer): TFont; + function IsFontStored(Index: Integer): Boolean; + procedure SetFont(Index: Integer; const Value: TFont); + + function FocusedRowIndex: Integer; + function GetRow(Index: Integer): TcxCustomRowViewInfo; + function GetRowCount: Integer; + function GetFocusedRow: TcxCustomRowViewInfo; + + procedure ComboBoxCloseUp(Sender: TObject); + procedure ComboBoxExit(Sender: TObject); + procedure ComboBoxKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure ComboBoxKeyPress(Sender: TObject; var Key: Char); + procedure ComboBoxPopup(Sender: TObject); + procedure DoComboDropDown(const R: TRect; const AText: string); + procedure SetFocusedRow(ARow: TcxCustomRowViewInfo); + procedure PopupMenuClick(Sender: TObject); + function IsNullStringStored: Boolean; + procedure ProcessHitTest(AHitTest: TcxFilterControlHitTest; AByMouse: Boolean); + procedure ReadData(AStream: TStream); + procedure RecalcRows; + procedure RefreshMenuCaptions; + procedure SetLeftOffset(Value: Integer); + procedure SetNullString(const Value: string); + procedure SetTopVisibleRow(Value: Integer); + procedure SetShowLevelLines(const Value: Boolean); + procedure SetWantTabs(const Value: Boolean); + procedure ValueEditorInit; + // value editor events + procedure ValueEditorAfterKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure ValueEditorExit(Sender: TObject); + procedure ValueEditorKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + + procedure WriteData(AStream: TStream); + protected + procedure CheckInplaceControlsColor; virtual; + // overrided VCL + procedure DefineProperties(Filer: TFiler); override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure Loaded; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure Paint; override; + procedure SetEnabled(Value: Boolean); override; + procedure SetParent(AParent: TWinControl); override; + // overrided cxControl + procedure BoundsChanged; override; + procedure DoLayoutChange; virtual; + procedure FocusChanged; override; + procedure FontChanged; override; + function GetBorderSize: Integer; override; + procedure InitControl; override; + procedure InitScrollBarsParameters; override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); override; + procedure MouseEnter(AControl: TControl); override; + procedure MouseLeave(AControl: TControl); override; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); override; + // work with rows + procedure AddCondition(ARow: TcxCustomRowViewInfo); + procedure AddGroup; + procedure AddValue; + procedure ClearRows; + procedure Remove; + procedure RemoveRow; + procedure RemoveValue; + // navigation + procedure FocusNext(ATab: Boolean); + procedure FocusPrev(ATab: Boolean); + procedure FocusUp(ATab: Boolean); + procedure FocusDown(ATab: Boolean); + procedure RowNavigate(AElement: TcxFilterControlHitTest; ACellIndex: Integer = -1); + procedure ValueEditorHide(AAccept: Boolean); + + procedure EnsureRowVisible; + procedure RefreshProperties; + + procedure BuildFromCriteria; virtual; + procedure BuildFromRows; + + procedure CreateInternalControls; virtual; + procedure DestroyInternalControls; virtual; + procedure DoApplyFilter; virtual; + function GetDefaultProperties: TcxCustomEditProperties; virtual; + function GetDefaultPropertiesViewInfo: TcxCustomEditViewInfo; + function GetFilterControlCriteriaClass: TcxFilterControlCriteriaClass; virtual; + function GetViewInfoClass: TcxFilterControlViewInfoClass; virtual; + function HasFocus: Boolean; + function HasHotTrack: Boolean; + procedure FillFilterItemList(AStrings: TStrings); virtual; + procedure FillConditionList(AStrings: TStrings); virtual; + procedure ValidateConditions(var SupportedOperations: TcxFilterControlOperators); virtual; + + procedure CorrectOperatorClass(var AOperatorClass: TcxFilterOperatorClass); virtual; + function GetFilterCaption: string; virtual; + function GetFilterLink: IcxFilterControl; virtual; + function GetFilterText: string; virtual; + procedure SelectAction; virtual; + procedure SelectBoolOperator; virtual; + procedure SelectCondition; virtual; + procedure SelectItem; virtual; + procedure SelectValue(AActivateKind: TcxActivateValueEditKind; AKey: Char); virtual; + + // IcxMouseTrackingCaller + procedure DoMouseLeave; + procedure IcxMouseTrackingCaller.MouseLeave = DoMouseLeave; + + // IcxFormatContollerListener + procedure FormatChanged; + + property Criteria: TcxFilterControlCriteria read FCriteria; + property FilterLink: IcxFilterControl read GetFilterLink; + property FocusedInfo: TcxFilterControlHitTestInfo read FFocusedInfo; + property FocusedRow: TcxCustomRowViewInfo read GetFocusedRow write SetFocusedRow; + property LeftOffset: Integer read FLeftOffset write SetLeftOffset; + property NullString: string read FNullString write SetNullString stored IsNullStringStored; + property RowCount: Integer read GetRowCount; + property Rows[Index: Integer]: TcxCustomRowViewInfo read GetRow; + property State: TFilterControlState read FState write FState; + property TopVisibleRow: Integer read FTopVisibleRow write SetTopVisibleRow; + property ViewInfo: TcxFilterControlViewInfo read FViewInfo; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure ApplyFilter; + procedure BeginUpdate; + procedure Clear; virtual; + procedure EndUpdate; + function IsValid: Boolean; virtual; + function HasItems: Boolean; + procedure LayoutChanged; + procedure Localize; + // save & restore + procedure LoadFromStream(AStream: TStream); + procedure SaveToStream(AStream: TStream); + procedure LoadFromFile(const AFileName: string); + procedure SaveToFile(const AFileName: string); + + // properties + property Color default clBtnFace; + property FilterCaption: string read GetFilterCaption; + property FilterText: string read GetFilterText; + property FontBoolOperator: TFont index fcfBoolOperator read GetFont write SetFont stored IsFontStored; + property FontCondition: TFont index fcfCondition read GetFont write SetFont stored IsFontStored; + property FontItem: TFont index fcfItem read GetFont write SetFont stored IsFontStored; + property FontValue: TFont index fcfValue read GetFont write SetFont stored IsFontStored; + property HotTrackOnUnfocused: Boolean read FHotTrackOnUnfocused write FHotTrackOnUnfocused default True; + property LookAndFeel; + property ParentColor default False; + property ShowLevelLines: Boolean read FShowLevelLines write SetShowLevelLines default True; + property SortItems: Boolean read FSortItems write FSortItems default False; + property WantTabs: Boolean read FWantTabs write SetWantTabs default False; + property OnApplyFilter: TNotifyEvent read FOnApplyFilter write FOnApplyFilter; + end; + + { TcxFilterControlPainter } + + TcxFilterControlPainter = class + private + FControl: TcxCustomFilterControl; + function GetCanvas: TcxCanvas; + function GetPainter: TcxCustomLookAndFeelPainterClass; + function GetViewInfo: TcxFilterControlViewInfo; + procedure DrawGroup(ARow: TcxGroupViewInfo); + procedure DrawCondition(ARow: TcxConditionViewInfo); + procedure DrawValues(ARow: TcxConditionViewInfo); + protected + function GetContentColor: TColor; virtual; + procedure DrawBorder; + procedure DrawDotLine(const R: TRect); + procedure DrawRow(ARow: TcxCustomRowViewInfo); virtual; + procedure TextDraw(X, Y: Integer; const AText: string); + public + constructor Create(AOwner: TcxCustomFilterControl); virtual; + property Canvas: TcxCanvas read GetCanvas; + property ContentColor: TColor read GetContentColor; + property Control: TcxCustomFilterControl read FControl; + property Painter: TcxCustomLookAndFeelPainterClass read GetPainter; + property ViewInfo: TcxFilterControlViewInfo read GetViewInfo; + end; + + TcxFilterControlPainterClass = class of TcxFilterControlPainter; + + { TcxFilterControlViewInfo } + + TcxFilterControlViewInfo = class + private + FControl: TcxCustomFilterControl; + FAddConditionRect: TRect; + FAddConditionCaption: string; + FBitmap: TBitmap; + FBitmapCanvas: TcxCanvas; + FButtonState: TcxButtonState; + FFocusRect: TRect; + FMaxRowWidth: Integer; + FPainter: TcxFilterControlPainter; + FRowHeight: Integer; + FMinValueWidth: Integer; + FEnabled: Boolean; + procedure CalcButtonState; + procedure CheckBitmap; + function GetCanvas: TcxCanvas; + function GetEditHeight: Integer; + protected + procedure CalcFocusRect; virtual; + function GetPainterClass: TcxFilterControlPainterClass; virtual; + public + constructor Create(AOwner: TcxCustomFilterControl); virtual; + destructor Destroy; override; + procedure Calc; + procedure GetHitTestInfo(AShift: TShiftState; const P: TPoint; + var HitInfo: TcxFilterControlHitTestInfo); virtual; + procedure Paint; + procedure InvalidateRow(ARow: TcxCustomRowViewInfo); + procedure Update; + property AddConditionCaption: string read FAddConditionCaption; + property AddConditionRect: TRect read FAddConditionRect; + property ButtonState: TcxButtonState read FButtonState; + property Canvas: TcxCanvas read GetCanvas; + property Control: TcxCustomFilterControl read FControl; + property Enabled: Boolean read FEnabled; + property MaxRowWidth: Integer read FMaxRowWidth; + property MinValueWidth: Integer read FMinValueWidth; + property Painter: TcxFilterControlPainter read FPainter; + property RowHeight: Integer read FRowHeight; + end; + + { TcxFilterControl } + + TcxFilterControl = class(TcxCustomFilterControl, IcxFilterControlDialog) + private + FLinkComponent: TComponent; + {$IFDEF CBUILDER6} + function GetLinkComponent: TComponent; + {$ENDIF} + procedure SetLinkComponent(Value: TComponent); + protected + //IcxFilterControlDialog + procedure IcxFilterControlDialog.SetDialogLinkComponent = SetLinkComponent; + function GetFilterLink: IcxFilterControl; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + public + procedure UpdateFilter; + published + property Align; + property Anchors; + property Color; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property Font; + property FontBoolOperator; + property FontCondition; + property FontItem; + property FontValue; + property HelpContext; + {$IFDEF DELPHI6} + property HelpKeyword; + property HelpType; + {$ENDIF} + property Hint; + property HotTrackOnUnfocused; + {$IFDEF CBUILDER6} + property LinkComponent: TComponent read GetLinkComponent write SetLinkComponent; + {$ELSE} + property LinkComponent: TComponent read FLinkComponent write SetLinkComponent; + {$ENDIF} + property LookAndFeel; + property NullString; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property ShowHint; + property ShowLevelLines; + property SortItems; + property TabOrder; + property TabStop; + property Visible; + property WantTabs; + property OnApplyFilter; + property OnClick; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +function cxGetConditionText(AOperator: TcxFilterControlOperator): string; +function IsSupportFiltering(AClass: TcxCustomEditPropertiesClass): Boolean; + +implementation + +uses + cxVariants, cxFilterConsts, cxFilterControlStrs, cxCustomData; + +type + TWinControlAccess = class(TWinControl); + +const + cxFilterControlFontColors: array[TcxFilterControlFont] of TColor = (clRed, + clGreen, clMaroon, clBlue); + + EmptyRect: TRect = (Left: 0; Top: 0; Right: 0; Bottom: 0); + +var + cxBoolOperatorText: array[TcxFilterBoolOperatorKind] of string; + cxConditionText: array[TcxFilterControlOperator] of string; + HalftoneBrush: HBRUSH; + +function cxGetConditionText(AOperator: TcxFilterControlOperator): string; +begin + Result := cxConditionText[AOperator]; +end; + +function IsSupportFiltering(AClass: TcxCustomEditPropertiesClass): Boolean; +var + Test: TcxCustomEditProperties; +begin + Result := False; + if AClass <> nil then + begin + Test := AClass.Create(nil); + Result := esoFiltering in Test.GetSupportedOperations; + Test.Free; + end; +end; + +function Max(A, B: Integer): Integer; +begin + if A > B then Result := A else Result := B; +end; + +function Min(A, B: Integer): Integer; +begin + if A < B then Result := A else Result := B; +end; + +function WidthOf(const R: TRect): Integer; +begin + Result := R.Right - R.Left; +end; + +function HeightOf(const R: TRect): Integer; +begin + Result := R.Bottom - R.Top; +end; +procedure CenterRectVert(const ABounds: TRect; var R: TRect); +var + H1, H2: Integer; +begin + H1 := HeightOf(ABounds); + H2 := HeightOf(R); + OffsetRect(R, 0, (ABounds.Top - R.Top) + (H1 - H2) div 2); +end; + +function cxStrFromBoolOperator(ABoolOperator: TcxFilterBoolOperatorKind): string; +begin + case ABoolOperator of + fboAnd: Result := cxGetResourceString(@cxSFilterBoolOperatorAnd); + fboOr: Result := cxGetResourceString(@cxSFilterBoolOperatorOr); + fboNotAnd: Result := cxGetResourceString(@cxSFilterBoolOperatorNotAnd); + fboNotOr: Result := cxGetResourceString(@cxSFilterBoolOperatorNotOr); + else + Result := ''; + end; +end; + +{ TcxFilterControlCriteriaItem } + +function TcxFilterControlCriteriaItem.GetDataValue( + AData: TObject): Variant; +begin + Result := Null; +end; + +function TcxFilterControlCriteriaItem.GetFieldCaption: string; +begin + if ValidItem then + Result := Filter.Captions[ItemIndex] + else + Result := ''; +end; + +function TcxFilterControlCriteriaItem.GetFieldName: string; +begin + if ValidItem then + Result := Filter.FieldNames[ItemIndex] + else + Result := ''; +end; + +function TcxFilterControlCriteriaItem.GetFilterOperatorClass: TcxFilterOperatorClass; +begin + Result := inherited GetFilterOperatorClass; + Criteria.Control.CorrectOperatorClass(Result); +end; + +function TcxFilterControlCriteriaItem.GetFilter: IcxFilterControl; +begin + if (Criteria <> nil) and (Criteria.Control <> nil) then + Result := Criteria.Control.FilterLink + else + Result := nil; +end; + +function TcxFilterControlCriteriaItem.GetItemIndex: Integer; +var + I: Integer; + AFilter: IcxFilterControl; +begin + Result := -1; + AFilter := Filter; + if AFilter <> nil then + begin + for I := 0 to AFilter.Count - 1 do + if AFilter.ItemLinks[I] = ItemLink then + begin + Result := I; + break; + end; + end; +end; + +function TcxFilterControlCriteriaItem.ValidItem: Boolean; +begin + Result := (Filter <> nil) and (ItemIndex >= 0) and (ItemIndex < Filter.Count); +end; + +function TcxFilterControlCriteriaItem.GetFilterControlCriteria: TcxFilterControlCriteria; +begin + Result := TcxFilterControlCriteria(inherited Criteria); +end; + +{ TcxFilterControlCriteria } + +constructor TcxFilterControlCriteria.Create( + AOwner: TcxCustomFilterControl); +begin + inherited Create; + FControl := AOwner; + //ver 3 + Version := cxDataFilterVersion; +end; + +procedure TcxFilterControlCriteria.AssignEvents(Source: TPersistent); +begin +//don't assign events +end; + +function TcxFilterControlCriteria.GetIDByItemLink( + AItemLink: TObject): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Control.FilterLink.Count - 1 do + if Control.FilterLink.ItemLinks[I] = AItemLink then + begin + Result := Control.FilterLink.ItemLinkIDs[I]; + Break; + end; +end; + +function TcxFilterControlCriteria.GetItemClass: TcxFilterCriteriaItemClass; +begin + Result := TcxFilterControlCriteriaItem; +end; + +function TcxFilterControlCriteria.GetItemLinkByID(AID: Integer): TObject; +var + I: Integer; +begin + Result := nil; + for I := 0 to Control.FilterLink.Count - 1 do + if Control.FilterLink.ItemLinkIDs[I] = AID then + begin + Result := Control.FilterLink.ItemLinks[I]; + Break; + end; +end; + +function TcxFilterControlCriteria.GetNameByItemLink(AItemLink: TObject): string; +var + I: Integer; +begin + Result := ''; + for I := 0 to Control.FilterLink.Count - 1 do + if Control.FilterLink.ItemLinks[I] = AItemLink then + begin + Result := Control.FilterLink.ItemLinkNames[I]; + Break; + end; +end; + +function TcxFilterControlCriteria.GetItemLinkByName(const AName: string): TObject; +var + I: Integer; +begin + Result := nil; + for I := 0 to Control.FilterLink.Count - 1 do + if SameText(Control.FilterLink.ItemLinkNames[I], AName) then + begin + Result := Control.FilterLink.ItemLinks[I]; + Break; + end; +end; + +{ TcxCustomRowViewInfo } + +constructor TcxCustomRowViewInfo.Create(AControl: TcxCustomFilterControl; + AParent: TcxCustomRowViewInfo; ACriteriaItem: TcxCustomFilterCriteriaItem); +begin + inherited Create; + FControl := AControl; + FParent := AParent; + FCriteriaItem := ACriteriaItem; + FButtonState := cxbsNormal; + if AParent <> nil then AParent.Group.Add(Self); +end; + +destructor TcxCustomRowViewInfo.Destroy; +begin + if Parent <> nil then Parent.Group.Remove(Self); + inherited Destroy; +end; + +procedure TcxCustomRowViewInfo.Calc(const ARowRect: TRect); +var + AWidth: Integer; +begin + FRowRect := ARowRect; + GetInternal; + with Control do + begin + Canvas.Font.Assign(Font); + if FRoot = Self then + AWidth := Canvas.TextWidth(FButtonText + '00') + else + AWidth := Canvas.TextWidth('0') * Length(FButtonText); + FButtonRect := Classes.Bounds(ARowRect.Left + 4 + Indent, 0, AWidth, + HeightOf(ARowRect) - 4); + if not ViewInfo.Enabled then + FButtonState := cxbsDisabled + else + if (FocusedRow = Self) and (FFocusedInfo.HitTest = fhtButton) then + FButtonState := cxbsDefault + else + if HasHotTrack and (FHotTrack.Row = Self) and (FHotTrack.HitTest = fhtButton) then + FButtonState := cxbsHot + else + FButtonState := cxbsNormal; + end; + CenterRectVert(FRowRect, FButtonRect); +end; + +procedure TcxCustomRowViewInfo.GetHitTestInfo(const P: TPoint; + var HitInfo: TcxFilterControlHitTestInfo); +begin + if PtInRect(ButtonRect, P) then + HitInfo.HitTest := fhtButton +end; + +function TcxCustomRowViewInfo.Ready: Boolean; +begin + Result := True; +end; + +function TcxCustomRowViewInfo.GetWidth: Integer; +begin + Result := FIndent + WidthOf(FButtonRect) + 5; +end; + +function TcxCustomRowViewInfo.IsLast: Boolean; +begin + Result := (FParent = nil) or + (FParent.Group.GetRow(FParent.Group.GetRowCount - 1) = Self); +end; + +function TcxCustomRowViewInfo.GetCondition: TcxConditionViewInfo; +begin + Result := Self as TcxConditionViewInfo; +end; + +function TcxCustomRowViewInfo.GetFocused: Boolean; +begin + Result := Control.FocusedRow = Self; +end; + +function TcxCustomRowViewInfo.GetGroup: TcxGroupViewInfo; +begin + Result := Self as TcxGroupViewInfo; +end; + +procedure TcxCustomRowViewInfo.GetInternal; +var + AParent: TcxCustomRowViewInfo; +begin + FLevel := 0; + AParent := Parent; + if AParent <> nil then + begin + FButtonText := '...'; + while AParent <> nil do + begin + AParent := AParent.Parent; + Inc(FLevel); + end + end + else FButtonText := cxGetResourceString(@cxSFilterRootButtonCaption); + FIndent := FLevel * HeightOf(RowRect); +end; + +{ TcxGroupViewInfo } + +constructor TcxGroupViewInfo.Create(AControl: TcxCustomFilterControl; + AParent: TcxCustomRowViewInfo; ACriteriaItem: TcxCustomFilterCriteriaItem); +begin + inherited; + FRows := TList.Create; + FCaption := cxGetResourceString(@cxSFilterGroupCaption); + if ACriteriaItem <> nil then + FBoolOperator := TcxFilterCriteriaItemList(ACriteriaItem).BoolOperatorKind + else + FBoolOperator := fboAnd; +end; + +destructor TcxGroupViewInfo.Destroy; +begin + while RowCount > 0 do Rows[0].Free; + FreeAndNil(FRows); + inherited Destroy; +end; + +procedure TcxGroupViewInfo.Add(ARow: TcxCustomRowViewInfo); +begin + FRows.Add(ARow); +end; + +procedure TcxGroupViewInfo.Remove(ARow: TcxCustomRowViewInfo); +begin + FRows.Remove(ARow); +end; + +procedure TcxGroupViewInfo.Calc(const ARowRect: TRect); +var + ASize: TSize; +begin + inherited Calc(ARowRect); + with Control.Canvas do + begin + Font.Assign(Control.FontBoolOperator); + FBoolOperatorText := cxBoolOperatorText[BoolOperator]; + ASize := TextExtent(FBoolOperatorText); + FBoolOperatorRect := Bounds(ButtonRect.Right + 8, 0, ASize.cx + 2, ASize.cy + 2); + CenterRectVert(FRowRect, FBoolOperatorRect); + Font.Assign(Control.Font); + ASize := TextExtent(FCaption); + FCaptionRect := Bounds(FBoolOperatorRect.Right + 8, 0, ASize.cx + 2, ASize.cy + 2); + CenterRectVert(FRowRect, FCaptionRect); + end; +end; + +procedure TcxGroupViewInfo.GetHitTestInfo(const P: TPoint; + var HitInfo: TcxFilterControlHitTestInfo); +begin + inherited; + if HitInfo.HitTest = fhtNone then + if PtInRect(FBoolOperatorRect, P) then HitInfo.HitTest := fhtBoolOperator; +end; + +function TcxGroupViewInfo.GetWidth: Integer; +begin + Result := inherited GetWidth + WidthOf(FBoolOperatorRect) + + WidthOf(FCaptionRect) + 16; +end; + +function TcxGroupViewInfo.GetRow(Index: Integer): TcxCustomRowViewInfo; +begin + Result := TcxCustomRowViewInfo(FRows[Index]); +end; + +function TcxGroupViewInfo.GetRowCount: Integer; +begin + Result := FRows.Count; +end; + +procedure TcxGroupViewInfo.SetRow(Index: Integer; + const Value: TcxCustomRowViewInfo); +begin + FRows[Index] := Value; +end; + +{ TcxValueInfo } + +constructor TcxValueInfo.Create; +begin + inherited Create; + FValue := Null; + FValueText := ''; + FValueRect := EmptyRect; +end; + +destructor TcxValueInfo.Destroy; +begin + FreeAndNil(FValueViewInfo); + inherited Destroy; +end; + +procedure TcxValueInfo.SetValueViewInfo( + const Value: TcxCustomEditViewInfo); +begin + FValueViewInfo.Free; + FValueViewInfo := Value; +end; + +{ TcxValuesViewInfo } + +constructor TcxValuesViewInfo.Create(ACondition: TcxConditionViewInfo); +begin + inherited Create; + FCondition := ACondition; + FList := TList.Create; +end; + +destructor TcxValuesViewInfo.Destroy; +begin + Clear; + FreeAndNil(FList); + inherited Destroy; +end; + +procedure TcxValuesViewInfo.AddValue; +var + V: TcxValueInfo; +begin + V := TcxValueInfo.Create; + V.ValueViewInfo := + TcxCustomEditViewInfo(Condition.GetProperties.GetViewInfoClass.Create); + FList.Add(V); +end; + +procedure TcxValuesViewInfo.Calc; +const + AButtonTransparency: array[Boolean] of TcxEditButtonTransparency = + (ebtHideInactive, ebtNone); +var + AHightlited, AHotTrack, AUseDisplayValue: Boolean; + AProperties: TcxCustomEditProperties; + AProvider: IcxEditDefaultValuesProvider; + ASize: TSize; + ASizeProperties: TcxEditSizeProperties; + ATopLeft, AMouse: TPoint; + AValue: TcxEditValue; + AViewData: TcxCustomEditViewData; + I, AExtraSize: Integer; +begin + if not Condition.HasDisplayValues then + begin + for I := 0 to Count - 1 do Values[I].FValueRect := EmptyRect; + Exit; + end + else + begin + ATopLeft := Point(Condition.OperatorRect.Right + 8, 0); + if Condition.Operator in [fcoBetween, fcoNotBetween] then + FSeparator := cxGetResourceString(@cxSFilterAndCaption) + else + if Condition.Operator in [fcoInList, fcoNotInList] then + begin + Control.Canvas.Font.Assign(Control.FontValue); + Inc(ATopLeft.X, Control.Canvas.TextWidth('(')); + FSeparator := ', '; + end; + end; + AHotTrack := Control.HasHotTrack; + AUseDisplayValue := (Condition.EditorHelper <> nil) and + (Condition.EditorHelper.UseDisplayValue); + for I := 0 to Count - 1 do + with Values[I] do + begin + if VarIsNull(Value) then + begin + AProperties := Control.GetDefaultProperties; + AValue := Control.NullString; + end + else + begin + AProperties := Condition.EditorProperties; + if AUseDisplayValue then AValue := ValueText else AValue := Value; + end; + with AProperties do + begin + LockUpdate(True); + AProvider := IDefaultValuesProvider; + IDefaultValuesProvider := nil; + end; + try + ValueViewInfo := TcxCustomEditViewInfo(AProperties.GetViewInfoClass.Create); + with AProperties, Control do + begin + AHightlited := AHotTrack and + (((FHotTrack.Row = Condition) and (FHotTrack.HitTest = fhtValue) and + (FHotTrack.ValueIndex = I) and (State = fcsNormal)) or + (HasFocus and (FocusedRow = Condition) and + (FFocusedInfo.HitTest = fhtValue) and (FFocusedInfo.ValueIndex = I))); + UpdateEditorStyle(FValueEditorStyle, AHightlited, ViewInfo.Enabled); + AViewData := CreateViewData(FValueEditorStyle, True); + AViewData.Enabled := ViewInfo.Enabled; + try + // calculate ValueRect + FValueRect.TopLeft := ATopLeft; + ASizeProperties.MaxLineCount := 1; + ASizeProperties.Width := -1; + ASizeProperties.Height := -1; + ASize := AViewData.GetEditSize(Canvas, AValue, ASizeProperties); + if AHightlited and (ASize.cx < ViewInfo.MinValueWidth) then + ASize.cx := ViewInfo.MinValueWidth; + with FValueRect do + begin + Right := Left + ASize.cx; + Bottom := Top + ASize.cy; + end; + CenterRectVert(Condition.RowRect, FValueRect); + // calculate + if not FilterEditsController.FindHelper(AProperties.ClassType).EditPropertiesHasButtons then + AViewData.ButtonVisibleCount := 0; + AViewData.EditValueToDrawValue(Canvas, AValue, ValueViewInfo); + AViewData.Calculate(Canvas, ValueRect, AMouse, cxmbNone, [], + ValueViewInfo, True); + finally + FreeAndNil(AViewData); + end; + AExtraSize := 4; + if Condition.Operator in [fcoBetween, fcoNotBetween, fcoInList, fcoNotInList] then + begin + Canvas.Font.Assign(FontValue); + Inc(AExtraSize, Canvas.TextWidth(FSeparator) + 4); + end; + Inc(ATopLeft.X, WidthOf(ValueRect) + AExtraSize); + end; + finally + with AProperties do + begin + IDefaultValuesProvider := AProvider; + LockUpdate(False); + end; + end; + end; + if Condition.Operator in [fcoInList, fcoNotInList] then + begin + Control.Canvas.Font.Assign(Control.FontValue); + FAddButtonRect := Bounds(Values[Count - 1].ValueRect.Right + + Control.Canvas.TextWidth(')0'), 0, Control.Canvas.TextWidth('000'), + HeightOf(Condition.RowRect) - 4); + CenterRectVert(Condition.RowRect, FAddButtonRect); + // get ButtonState + if not Control.ViewInfo.Enabled then + FAddButtonState := cxbsDisabled + else + with Control.FFocusedInfo do + if (Row = Condition) and (HitTest = fhtAddValue) then + FAddButtonState := cxbsDefault + else + with Control.FHotTrack do + if AHotTrack and (Row = Condition) and (HitTest = fhtAddValue) then + FAddButtonState := cxbsHot + else + FAddButtonState := cxbsNormal + end + else + FAddButtonRect := EmptyRect; +end; + +procedure TcxValuesViewInfo.Clear; +var + I: Integer; +begin + for I := 0 to FList.Count - 1 do + Values[I].Free; + FList.Clear; +end; + +procedure TcxValuesViewInfo.GetHitTestInfo(const P: TPoint; + var HitInfo: TcxFilterControlHitTestInfo); +var + I: Integer; +begin + if PtInRect(AddButtonRect, P) then + HitInfo.HitTest := fhtAddValue + else + for I := 0 to Count - 1 do + if PtInRect(Values[I].ValueRect, P) then + begin + HitInfo.HitTest := fhtValue; + HitInfo.ValueIndex := I; + break; + end; +end; + +procedure TcxValuesViewInfo.RemoveValue(AIndex: Integer); +begin + if (AIndex < 0) or (AIndex >= FList.Count) then Exit; + Values[AIndex].Free; + FList.Delete(AIndex); +end; + +function TcxValuesViewInfo.GetCount: Integer; +begin + Result := FList.Count; +end; + +procedure TcxValuesViewInfo.UpdateEditorStyle(AStyle: TcxCustomEditStyle; + AHightlited, AEnabled: Boolean); +const + ButtonTransparency: array[Boolean] of TcxEditButtonTransparency = + (ebtHideInactive, ebtNone); +begin + if AEnabled then + AStyle.StyleData.FontColor := Control.FontValue.Color + else + AStyle.StyleData.FontColor := clBtnShadow; + AStyle.ButtonTransparency := ButtonTransparency[AHightlited]; + if AHightlited then + AStyle.Color := clWindow + else + AStyle.Color := Control.ViewInfo.Painter.ContentColor; +end; + +function TcxValuesViewInfo.GetControl: TcxCustomFilterControl; +begin + Result := Condition.Control; +end; + +function TcxValuesViewInfo.GetValue(Index: Integer): TcxValueInfo; +begin + Result := TcxValueInfo(FList[Index]); +end; + +function TcxValuesViewInfo.GetWidth: Integer; +begin + with Condition do + case Operator of + fcoBetween, fcoNotBetween: + Result := Values[Count - 1].ValueRect.Right - OperatorRect.Right; + fcoInList, fcoNotInList: + Result := FAddButtonRect.Right - OperatorRect.Right; + else + if HasDisplayValues then + Result := Values[Count - 1].ValueRect.Right - OperatorRect.Right + else + Result := 0; + end; +end; + +{ TcxConditionViewInfo } + +constructor TcxConditionViewInfo.Create(AControl: TcxCustomFilterControl; + AParent: TcxCustomRowViewInfo; ACriteriaItem: TcxCustomFilterCriteriaItem); +var + I, J: Integer; + S: string; +begin + inherited Create(AControl, AParent, ACriteriaItem); + FValues := TcxValuesViewInfo.Create(Self); + if ACriteriaItem <> nil then + begin + FItemLink := TcxFilterCriteriaItem(ACriteriaItem).ItemLink; + FItemIndex := GetItemIndex; + with Control do + begin + if HasItems and (FItemIndex >= 0) and (FItemIndex < FilterLink.Count) then + FItemText := FilterLink.Captions[FItemIndex] + else + FilterControlError(cxGetResourceString(@cxSFilterErrorBuilding)); + end; + with TcxFilterCriteriaItem(ACriteriaItem) do + begin + FOperator := GetFilterControlOperator(OperatorKind, ValueIsNull(Value)); + case FOperator of + fcoBetween, fcoNotBetween, fcoInList, fcoNotInList: + begin + S := DisplayValue; + J := 1; + for I := VarArrayLowBound(Value, 1) to VarArrayHighBound(Value, 1) do + begin + FValues.AddValue; + FValues[I].Value := Value[I]; + FValues[I].ValueText := ExtractFilterDisplayValue(S, J); + end; + end; + else + begin + FValues.AddValue; + FValues[0].Value := Value; + FValues[0].ValueText := DisplayValue; + end; + end; + end; + InternalInit; + end + else + begin + FItemIndex := -1; + SetItem(-1); + end; +end; + +destructor TcxConditionViewInfo.Destroy; +begin + FreeAndNil(FValues); + FreeAndNil(FEditorProperties); + FreeAndNil(ValueEditorData); + inherited Destroy; +end; + +procedure TcxConditionViewInfo.Calc(const ARowRect: TRect); +var + ASize: TSize; +begin + inherited Calc(ARowRect); + with Control.Canvas do + begin + Font.Assign(Control.FontItem); + ASize := TextExtent(FItemText); + FItemRect := Bounds(ButtonRect.Right + 8, 0, ASize.cx + 2, ASize.cy + 2); + CenterRectVert(FRowRect, FItemRect); + Font.Assign(Control.FontCondition); + FOperatorText := cxConditionText[Operator]; + ASize := TextExtent(FOperatorText); + FOperatorRect := Bounds(FItemRect.Right + 8, 0, ASize.cx + 2, ASize.cy + 2); + CenterRectVert(FRowRect, FOperatorRect); + if HasDisplayValues then Values.Calc; + end; +end; + +procedure TcxConditionViewInfo.GetHitTestInfo(const P: TPoint; + var HitInfo: TcxFilterControlHitTestInfo); +begin + inherited; + if HitInfo.HitTest = fhtNone then + if PtInRect(FItemRect, P) then + HitInfo.HitTest := fhtItem + else + if PtInRect(FOperatorRect, P) then + HitInfo.HitTest := fhtOperator + else + Values.GetHitTestInfo(P, HitInfo); +end; + +function TcxConditionViewInfo.GetProperties: TcxCustomEditProperties; +begin + with Control do + begin + if HasItems and (ItemIndex >= 0) and (ItemIndex < FilterLink.Count) then + Result := FilterLink.Properties[ItemIndex] + else + Result := GetDefaultProperties; + if Result = nil then Result := GetDefaultProperties; + end; +end; + +function TcxConditionViewInfo.Ready: Boolean; +begin + Result := (FItemText <> '') and (FOperatorText <> ''); +end; + +procedure TcxConditionViewInfo.AddValue; +begin + Values.AddValue; + Control.LayoutChanged; +end; + +function TcxConditionViewInfo.GetWidth: Integer; +begin + Result := inherited GetWidth + WidthOf(FItemRect) + WidthOf(FOperatorRect) + + Values.Width + 8 * 2; +end; + +function TcxConditionViewInfo.HasDisplayValues: Boolean; +begin + Result := not (Operator in [fcoBlanks, fcoNonBlanks, fcoYesterday, fcoToday, fcoTomorrow, + fcoLast7Days, fcoLastWeek, fcoLast14Days, fcoLastTwoWeeks, fcoLast30Days, fcoLastMonth, fcoLastYear, fcoInPast, + fcoThisWeek, fcoThisMonth, fcoThisYear, + fcoNext7Days, fcoNextWeek, fcoNext14Days, fcoNextTwoWeeks, fcoNext30Days, fcoNextMonth, fcoNextYear, fcoInFuture]); +end; + +procedure TcxConditionViewInfo.InitValues(ASaveValue: Boolean); +begin + if ASaveValue and HasDisplayValues then + begin + case Operator of + fcoBetween, fcoNotBetween: + begin + while Values.Count > 2 do Values.RemoveValue(2); + if Values.Count < 2 then Values.AddValue; + end; + fcoInList, fcoNotInList:; + else + begin + while Values.Count > 1 do Values.RemoveValue(1); + if Values.Count < 1 then Values.AddValue; + end; + end; + end + else + begin + Values.Clear; + Values.AddValue; + if Operator in [fcoBetween, fcoNotBetween] then Values.AddValue; + end; +end; + +procedure TcxConditionViewInfo.InternalInit; +var + AEditClass: TcxCustomEditClass; + AProperties: TcxCustomEditProperties; +begin + FreeAndNil(ValueEditorData); + FreeAndNil(FEditorProperties); + AProperties := GetProperties; + with Control do + begin + FEditorHelper := FilterEditsController.FindHelper(AProperties.ClassType); + if FEditorHelper = nil then + FEditorHelper := TcxFilterTextEditHelper; + AEditClass := FEditorHelper.GetFilterEditClass; + if AEditClass <> nil then + FEditorProperties := AEditClass.GetPropertiesClass.Create(nil) + else + FEditorProperties := TcxCustomEditPropertiesClass(AProperties.ClassType).Create(nil); + FEditorHelper.InitializeProperties(FEditorProperties, AProperties, True); + FValueType := FilterLink.ValueTypes[FItemIndex]; + FSupportedOperators := FEditorHelper.GetSupportedFilterOperators(AProperties, FValueType, True); + end; + ValidateConditions; +end; + +procedure TcxConditionViewInfo.SetItem(AIndex: Integer); +var + AOperator: TcxFilterControlOperator; + I: Integer; + L: TStringList; +begin + with Control, Control.FilterLink do + begin + if (AIndex >= 0) and (AIndex = ItemIndex) then Exit; + if AIndex < 0 then + begin + AIndex := 0; + if FSortItems then + begin + L := TStringList.Create; + try + L.BeginUpdate; + for I := 0 to Count - 1 do + L.AddObject(Captions[I], TObject(I)); + L.Sort; + L.EndUpdate; + if L.Count > 0 then AIndex := Integer(L.Objects[0]); + finally + L.Free; + end; + end; + end; + FItemIndex := AIndex; + FItemLink := ItemLinks[AIndex]; + FItemText := Captions[AIndex]; + InternalInit; + if fcoLike in FSupportedOperators then + FOperator := fcoLike + else + for AOperator := Low(TcxFilterControlOperator) to High(TcxFilterControlOperator) do + if AOperator in FSupportedOperators then + begin + FOperator := AOperator; + break; + end; + InitValues(False); + Values.Calc; + if FValueEditor <> nil then + FInplaceEditors.RemoveItem(FValueEditor.ActiveProperties); + end; +end; + +procedure TcxConditionViewInfo.ValidateConditions; +begin + Control.ValidateConditions(FSupportedOperators); +end; + +function TcxConditionViewInfo.GetItemIndex: Integer; +var + I: Integer; +begin + Result := -1; + with Control do + for I := 0 to FilterLink.Count - 1 do + if FilterLink.ItemLinks[I] = FItemLink then + begin + Result := I; + break; + end; +end; + +{ TcxCustomFilterControl } + +constructor TcxCustomFilterControl.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + WantTabs := False; + FCriteria := GetFilterControlCriteriaClass.Create(Self); + FRoot := TcxGroupViewInfo.Create(Self, nil, FCriteria.Root); + FRows := TList.Create; + FRows.Add(FRoot); + FViewInfo := GetViewInfoClass.Create(Self); + CreateFonts; + CreateInternalControls; + CheckInplaceControlsColor; + UpdateBoundsRect(Rect(0, 0, 300, 200)); + FFocusedInfo.Row := FRoot; + FFocusedInfo.HitTest := fhtBoolOperator; + FHotTrackOnUnfocused := True; + FNullString := cxGetResourceString(@cxSFilterControlNullString); + FShowLevelLines := True; + cxFormatController.AddListener(Self); + ParentColor := False; + Color := clBtnFace; +end; + +destructor TcxCustomFilterControl.Destroy; +var + AFont: TcxFilterControlFont; +begin + cxFormatController.RemoveListener(Self); + EndMouseTracking(Self); + DestroyInternalControls; + FreeAndNil(FCriteria); + FreeAndNil(FViewInfo); + FreeAndNil(FRows); + FreeAndNil(FRoot); + for AFont := fcfBoolOperator to fcfValue do FreeAndNil(FFonts[AFont]); + inherited Destroy; +end; + +procedure TcxCustomFilterControl.ApplyFilter; +begin + DoApplyFilter; +end; + +procedure TcxCustomFilterControl.BeginUpdate; +begin + Inc(FLockCount); +end; + +procedure TcxCustomFilterControl.Clear; +begin + ValueEditorHide(False); + BeginUpdate; + try + ClearRows; + FCriteria.Clear; + finally + EndUpdate; + end; +end; + +procedure TcxCustomFilterControl.EndUpdate; +begin + Dec(FLockCount); + LayoutChanged; +end; + +function TcxCustomFilterControl.IsValid: Boolean; +var + I: Integer; +begin + Result := True; + for I := 0 to RowCount - 1 do + if not Rows[I].Ready then + begin + Result := False; + break; + end; +end; + +function TcxCustomFilterControl.HasItems: Boolean; +begin + Result := (FilterLink <> nil) and (FilterLink.Count > 0); +end; + +procedure TcxCustomFilterControl.LayoutChanged; +begin + if (FLockCount <> 0) or IsDestroying or IsLoading or not HandleAllocated or + ((FComboBox <> nil) and FComboBox.DroppedDown) then Exit; + Inc(FLockCount); + try + DoLayoutChange; + finally + Dec(FLockCount); + end; +end; + +procedure TcxCustomFilterControl.Localize; +var + AOperator: TcxFilterControlOperator; + ABoolOperator: TcxFilterBoolOperatorKind; +begin + RefreshMenuCaptions; + FRoot.Group.Caption := cxGetResourceString(@cxSFilterRootGroupCaption); + FViewInfo.FAddConditionCaption := cxGetResourceString(@cxSFilterFooterAddCondition); + for AOperator := Low(AOperator) to High(AOperator) do + cxConditionText[AOperator] := GetFilterControlOperatorText(AOperator); + for ABoolOperator := fboAnd to fboNotOr do + cxBoolOperatorText[ABoolOperator] := cxStrFromBoolOperator(ABoolOperator); + FNullString := cxGetResourceString(@cxSFilterControlNullString); + LayoutChanged; +end; + +procedure TcxCustomFilterControl.LoadFromFile(const AFileName: string); +var + F: TFileStream; +begin + F := TFileStream.Create(AFileName, fmOpenRead); + try + LoadFromStream(F); + finally + F.Free; + end; +end; + +procedure TcxCustomFilterControl.LoadFromStream(AStream: TStream); +begin + if not HasItems then + FilterControlError(cxGetResourceString(@cxSFilterErrorBuilding)); + Clear; + ReadData(AStream); + BuildFromCriteria; +end; + +procedure TcxCustomFilterControl.SaveToFile(const AFileName: string); +var + F: TFileStream; +begin + F := TFileStream.Create(AFileName, fmCreate); + try + SaveToStream(F); + finally + F.Free; + end; +end; + +procedure TcxCustomFilterControl.SaveToStream(AStream: TStream); +begin + BuildFromRows; + WriteData(AStream); +end; + +procedure TcxCustomFilterControl.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); +//TODO design-time editor ?? +// Filer.DefineBinaryProperty('FilterCriteria', ReadData, WriteData, FCriteria.Root.Count > 0); +end; + +procedure TcxCustomFilterControl.Loaded; +begin + inherited Loaded; + LayoutChanged; +end; + +procedure TcxCustomFilterControl.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited KeyDown(Key, Shift); + case Key of + VK_LEFT: FocusPrev(False); + VK_RIGHT: FocusNext(False); + VK_TAB: + begin + if ssCtrl in Shift then + TWinControlAccess(Parent).SelectNext(Self, not (ssShift in Shift), True) + else + if Shift = [] then + FocusNext(True) + else + if ssShift in Shift then FocusPrev(True); + Key := 0; + end; + VK_UP: FocusUp(False); + VK_DOWN: FocusDown(False); + VK_DELETE: if ssCtrl in Shift then Remove; + VK_INSERT: if Shift = [] then AddCondition(FocusedRow); + end; +end; + +procedure TcxCustomFilterControl.KeyPress(var Key: Char); +begin + inherited; + if (Key = #13) or (Key = ' ') then + ProcessHitTest(FFocusedInfo.HitTest, False) + else + if (Key <> #27) and (FFocusedInfo.HitTest = fhtValue) then + SelectValue(aveKey, Key); +end; + +procedure TcxCustomFilterControl.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + if FWasError or not HasItems then Exit; + ViewInfo.GetHitTestInfo(Shift, Point(X, Y), FHotTrack); + if (FHotTrack.HitTest <> fhtNone) and (FState = fcsNormal) and (Button = mbLeft) then + begin + FFocusedInfo := FHotTrack; + EnsureRowVisible; + ProcessHitTest(FHotTrack.HitTest, True); + end; +end; + +procedure TcxCustomFilterControl.MouseMove(Shift: TShiftState; X, Y: Integer); +const + Cursors: array[Boolean] of TCursor = (crDefault, crHandPoint); + NonHot = [fhtNone, fhtBoolOperator, fhtItem, fhtOperator]; +var + APrevHotTrack: TcxFilterControlHitTestInfo; + + function SameRow: Boolean; + begin + Result := APrevHotTrack.Row = FHotTrack.Row; + end; + + function SameHitTest: Boolean; + begin + Result := (APrevHotTrack.HitTest = FHotTrack.HitTest) and + (APrevHotTrack.ValueIndex = FHotTrack.ValueIndex); + end; + +begin + inherited MouseMove(Shift, X, Y); + BeginMouseTracking(Self, Bounds, Self); + APrevHotTrack := FHotTrack; + ViewInfo.GetHitTestInfo(Shift, Point(X, Y), FHotTrack); + Cursor := Cursors[HasHotTrack and (FHotTrack.HitTest <> fhtNone)]; + if (APrevHotTrack.HitTest in NonHot) and (FHotTrack.HitTest in NonHot) then Exit; + if SameRow then + if SameHitTest then Exit else ViewInfo.InvalidateRow(FHotTrack.Row) + else + begin + if not (APrevHotTrack.HitTest in NonHot) then + ViewInfo.InvalidateRow(APrevHotTrack.Row); + if not (FHotTrack.HitTest in NonHot) then + ViewInfo.InvalidateRow(FHotTrack.Row); + end; + ViewInfo.Update; +end; + +procedure TcxCustomFilterControl.Paint; +begin + ViewInfo.Paint; +end; + +procedure TcxCustomFilterControl.SetEnabled(Value: Boolean); +begin + inherited; + LayoutChanged; +end; + +procedure TcxCustomFilterControl.SetParent(AParent: TWinControl); +begin + inherited SetParent(AParent); + LayoutChanged; +end; + +procedure TcxCustomFilterControl.BoundsChanged; +begin + inherited BoundsChanged; + if HandleAllocated then + LayoutChanged; +end; + +procedure TcxCustomFilterControl.DoLayoutChange; + + procedure CheckVertical; + begin + while (TopVisibleRow > 0) and + (ClientBounds.Bottom - ViewInfo.AddConditionRect.Bottom >= ViewInfo.RowHeight + 2) do + begin + Dec(FTopVisibleRow); + ViewInfo.Calc; + end; + end; + + procedure CheckHorizontal; + var + ADelta: Integer; + begin + ADelta := ClientBounds.Right - (ViewInfo.MaxRowWidth - LeftOffset) - 2; + if (LeftOffset > 0) and (ADelta > 0) then + begin + FLeftOffset := Max(0, FLeftOffset - ADelta); + ViewInfo.Calc; + end; + end; + +begin + ViewInfo.Calc; + CheckVertical; + CheckHorizontal; + UpdateScrollBars; + Invalidate; +end; + +procedure TcxCustomFilterControl.FocusChanged; +begin + inherited FocusChanged; + ViewInfo.GetHitTestInfo([], ScreenToClient(GetMouseCursorPos), FHotTrack); + LayoutChanged; +end; + +procedure TcxCustomFilterControl.FontChanged; +var + AFont: TcxFilterControlFont; +begin + inherited; + if not IsLoading or (csReading in ComponentState) or IsDesigning then + begin + BeginUpdate; + try + for AFont := fcfBoolOperator to fcfValue do + begin + FFonts[AFont].Name := Font.Name; + FFonts[AFont].Height := Font.Height; + FFonts[AFont].Charset := Font.Charset; + end; + finally + EndUpdate; + end; + end; +end; + +function TcxCustomFilterControl.GetBorderSize: Integer; +begin + Result := LookAndFeel.Painter.BorderSize; +end; + +procedure TcxCustomFilterControl.InitControl; +begin + inherited; + FComboBox.Parent := Self; + Localize; +end; + +procedure TcxCustomFilterControl.InitScrollBarsParameters; +var + APageSize: Integer; +begin + if ViewInfo.RowHeight = 0 then Exit; + APageSize := HeightOf(ClientBounds) div ViewInfo.RowHeight; + SetScrollBarInfo(sbVertical, 0, RowCount - 1, 1, APageSize - 1, TopVisibleRow, True, True); + SetScrollBarInfo(sbHorizontal, 0, ViewInfo.MaxRowWidth, 1, + WidthOf(ClientBounds), FLeftOffset, True, True); +end; + +procedure TcxCustomFilterControl.LookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); +begin + inherited; + LayoutChanged; + CheckInplaceControlsColor; +end; + +procedure TcxCustomFilterControl.MouseEnter(AControl: TControl); +begin + inherited MouseEnter(AControl); + BeginMouseTracking(Self, Bounds, Self); +end; + +procedure TcxCustomFilterControl.MouseLeave(AControl: TControl); +begin + inherited MouseLeave(AControl); + EndMouseTracking(Self); + FHotTrack.HitTest := fhtNone; + LayoutChanged; +end; + +procedure TcxCustomFilterControl.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); + + procedure ScrollVertical; + begin + case AScrollCode of + scLineUp: + TopVisibleRow := TopVisibleRow - 1; + scLineDown: + TopVisibleRow := TopVisibleRow + 1; + scTrack: + TopVisibleRow := AScrollPos; + scPageUp: + TopVisibleRow := TopVisibleRow - VScrollBar.PageSize; + scPageDown: + TopVisibleRow := TopVisibleRow + VScrollBar.PageSize; + end; + AScrollPos := TopVisibleRow; + end; + + procedure ScrollHorizontal; + begin + case AScrollCode of + scLineUp: + LeftOffset := LeftOffset - 8; + scLineDown: + LeftOffset := LeftOffset + 8; + scTrack: + LeftOffset := AScrollPos; + scPageUp: + LeftOffset := LeftOffset - HScrollBar.PageSize; + scPageDown: + LeftOffset := LeftOffset + HScrollBar.PageSize; + end; + AScrollPos := LeftOffset; + end; + +begin + if AScrollBarKind = sbVertical then + ScrollVertical + else + ScrollHorizontal; +end; + +procedure TcxCustomFilterControl.AddCondition(ARow: TcxCustomRowViewInfo); +var + ARowParent: TcxCustomRowViewInfo; +begin + if not HasItems then Exit; + if ARow <> nil then ARowParent := ARow else ARowParent := Rows[RowCount - 1]; + while not (ARowParent is TcxGroupViewInfo) do + ARowParent := ARowParent.Parent; + with FFocusedInfo do + Row := TcxConditionViewInfo.Create(Self, ARowParent, nil); + RecalcRows; + FFocusedInfo.HitTest := fhtAddCondition; // make sure last button visible + ViewInfo.Calc; + UpdateScrollBars; + EnsureRowVisible; + FFocusedInfo.HitTest := fhtItem; + ViewInfo.CalcFocusRect; + Invalidate; +end; + +procedure TcxCustomFilterControl.AddGroup; +var + AGroup: TcxGroupViewInfo; + ARowParent: TcxCustomRowViewInfo; +begin + if not HasItems then Exit; + ARowParent := FocusedRow; + while not (ARowParent is TcxGroupViewInfo) do + ARowParent := ARowParent.Parent; + AGroup := TcxGroupViewInfo.Create(Self, ARowParent, nil); + RecalcRows; + AddCondition(AGroup); +end; + +procedure TcxCustomFilterControl.AddValue; +begin + if not HasItems then Exit; + FocusedRow.Condition.Values.AddValue; + FFocusedInfo.HitTest := fhtValue; + FFocusedInfo.ValueIndex := FocusedRow.Condition.Values.Count - 1; + ViewInfo.Calc; + FLeftOffset := Max((ViewInfo.MaxRowWidth + 2) - ClientBounds.Right, 0); + LayoutChanged; +end; + +procedure TcxCustomFilterControl.ClearRows; +begin + BeginUpdate; + try + with FRoot.Group do + begin + while RowCount > 0 do Rows[0].Free; + FRows.Clear; + end; + FRows.Clear; + FRows.Add(FRoot); + FFocusedInfo.Row := FRoot; + FRoot.Group.BoolOperator := fboAnd; + FFocusedInfo.HitTest := fhtBoolOperator; + FTopVisibleRow := 0; + FLeftOffset := 0; + finally + EndUpdate; + end; +end; + +procedure TcxCustomFilterControl.Remove; +begin + if (FFocusedInfo.HitTest = fhtValue) and + (FocusedRow.Condition.Operator in [fcoInList, fcoNotInList]) and + (FocusedRow.Condition.Values.Count > 1) then + RemoveValue + else + RemoveRow; +end; + +procedure TcxCustomFilterControl.RemoveRow; +var + ARow: TcxCustomRowViewInfo; +begin + if FocusedRow = FRoot then Exit; + ARow := FocusedRow; + // remove Group if last child + while (ARow.Parent <> FRoot) and (ARow.Parent.Group.RowCount = 1) do + ARow := ARow.Parent; + FFocusedInfo.Row := Rows[FRows.IndexOf(ARow) - 1]; + FreeAndNil(ARow); + if FocusedRow is TcxGroupViewInfo then + FFocusedInfo.HitTest := fhtBoolOperator + else + FFocusedInfo.HitTest := fhtItem; + FHotTrack.Row := nil; + RecalcRows; + ViewInfo.Calc; + UpdateScrollBars; + EnsureRowVisible; +end; + +procedure TcxCustomFilterControl.RemoveValue; +begin + FocusedRow.Condition.Values.RemoveValue(FFocusedInfo.ValueIndex); + if FFocusedInfo.ValueIndex > 0 then Dec(FFocusedInfo.ValueIndex); + ViewInfo.Calc; + UpdateScrollBars; + EnsureRowVisible; +end; + +// navigation +procedure TcxCustomFilterControl.FocusDown(ATab: Boolean); +begin + if FocusedRow <> Rows[RowCount - 1] then + if ATab then + begin + FFocusedInfo.Row := Rows[FocusedRowIndex + 1]; + RowNavigate(fhtButton); + end + else + FocusedRow := Rows[FocusedRowIndex + 1] + else + RowNavigate(fhtAddCondition); +end; + +procedure TcxCustomFilterControl.FocusNext(ATab: Boolean); +begin + case FFocusedInfo.HitTest of + fhtAddCondition: if not ATab then FocusedRow := Rows[RowCount - 1]; + fhtAddValue, fhtBoolOperator: + if ATab then FocusDown(ATab); + fhtButton: + if FocusedRow is TcxGroupViewInfo then + RowNavigate(fhtBoolOperator) + else + RowNavigate(fhtItem); + fhtOperator: + if FocusedRow.Condition.HasDisplayValues then + begin + FFocusedInfo.ValueIndex := 0; + RowNavigate(fhtValue); + end + else + if ATab then FocusDown(ATab); + fhtItem: RowNavigate(fhtOperator); + fhtValue: + begin + if (FocusedRow.Condition.Values.Count - 1) > FFocusedInfo.ValueIndex then + begin + Inc(FFocusedInfo.ValueIndex); + RowNavigate(fhtValue); + end + else + if FocusedRow.Condition.Operator in [fcoInList, fcoNotInList] then + RowNavigate(fhtAddValue) + else + if ATab then FocusDown(ATab); + end; + end; +end; + +procedure TcxCustomFilterControl.FocusPrev(ATab: Boolean); +begin + case FFocusedInfo.HitTest of + fhtAddCondition: FocusUp(ATab); + fhtButton: if ATab then FocusUp(ATab); + fhtOperator: RowNavigate(fhtItem); + fhtItem, fhtBoolOperator: RowNavigate(fhtButton); + fhtValue: + begin + if FFocusedInfo.ValueIndex > 0 then + begin + Dec(FFocusedInfo.ValueIndex); + RowNavigate(fhtValue); + end + else RowNavigate(fhtOperator); + end; + fhtAddValue: RowNavigate(fhtValue); + end; +end; + +procedure TcxCustomFilterControl.FocusUp(ATab: Boolean); + + procedure Select(ARow: TcxCustomRowViewInfo); + const + HitItem: array[Boolean] of TcxFilterControlHitTest = (fhtValue, fhtAddValue); + begin + if ATab then + begin + FFocusedInfo.Row := ARow; + if FocusedRow is TcxGroupViewInfo then + RowNavigate(fhtBoolOperator) + else + with FocusedRow.Condition do + if HasDisplayValues then + begin + FFocusedInfo.ValueIndex := Values.Count - 1; + RowNavigate(HitItem[Operator in [fcoInList, fcoNotInList]]); + end + else RowNavigate(fhtOperator) + end + else FocusedRow := ARow; + end; + +begin + if FFocusedInfo.HitTest = fhtAddCondition then + Select(Rows[RowCount - 1]) + else + if FocusedRow <> FRoot then + Select(Rows[FocusedRowIndex - 1]); +end; + +procedure TcxCustomFilterControl.RowNavigate(AElement: TcxFilterControlHitTest; ACellIndex: Integer = -1); +begin + FFocusedInfo.HitTest := AElement; + if (FocusedRow is TcxConditionViewInfo) and (ACellIndex >= 0) and + (ACellIndex < TcxConditionViewInfo(FocusedRow).Values.Count) then + FFocusedInfo.ValueIndex := ACellIndex; + ViewInfo.Calc; + EnsureRowVisible; +end; + +procedure TcxCustomFilterControl.ValueEditorHide(AAccept: Boolean); +var + V: Variant; + S: TCaption; +begin + FWasError := False; + State := fcsNormal; + if FValueEditor = nil then Exit; + if AAccept then + begin + if not FValueEditor.Deactivate then raise EAbort.Create(''); + with FocusedRow.Condition, Values[FFocusedInfo.ValueIndex] do + begin + EditorHelper.GetFilterValue(FValueEditor, GetProperties, V, S); + try + FilterControlValidateValue(FValueEditor, V, Operator, ValueType, EditorHelper); + except + FWasError := True; + raise + end; + FValue := V; + FValueText := S; + end; + end; + if FValueEditor.Focused and Focused then + begin + FValueEditor.EditModified := False; + FValueEditor.OnFocusChanged := nil; + end; + FValueEditor.Parent := nil; + FValueEditor := nil; + EnsureRowVisible; +end; + +procedure TcxCustomFilterControl.EnsureRowVisible; + + function GetFocusedRect: TRect; + begin + with FFocusedInfo do + case HitTest of + fhtButton: + begin + Result := Row.ButtonRect; + if Row = FRoot then Dec(Result.Left, 4); + end; + fhtBoolOperator: Result := Row.Group.BoolOperatorRect; + fhtItem: Result := Row.Condition.ItemRect; + fhtOperator: Result := Row.Condition.OperatorRect; + fhtValue: Result := Row.Condition.Values[ValueIndex].ValueRect; + fhtAddCondition: Result := ViewInfo.AddConditionRect; + fhtAddValue: Result := Row.Condition.Values.AddButtonRect; + else + Result := EmptyRect; + end; + end; + +var + AIndex, ALeft, ABottom: Integer; + R: TRect; +begin + AIndex := FocusedRowIndex; + if AIndex < TopVisibleRow then + FTopVisibleRow := AIndex + else + begin + if FFocusedInfo.HitTest = fhtAddCondition then + ABottom := ViewInfo.AddConditionRect.Bottom + else + ABottom := FocusedRow.RowRect.Bottom; + while (ABottom > ClientBounds.Bottom) and (FTopVisibleRow < RowCount) do + begin + Dec(ABottom, ViewInfo.RowHeight); + Inc(FTopVisibleRow); + end; + end; + R := GetFocusedRect; + ALeft := R.Left; + if R.Right >= ClientBounds.Right then OffsetRect(R, ClientBounds.Right - R.Right - 2, 0); + if R.Left < ClientBounds.Left then OffsetRect(R, ClientBounds.Left - R.Left, 0); + Inc(FLeftOffset, ALeft - R.Left); + ViewInfo.Calc; + UpdateScrollBars; + Invalidate; +end; + +procedure TcxCustomFilterControl.BuildFromCriteria; + + procedure Build(ACriteriaList: TcxFilterCriteriaItemList; ARow: TcxCustomRowViewInfo); + var + I: Integer; + begin + with ACriteriaList do + begin + ARow.Group.BoolOperator := BoolOperatorKind; + for I := 0 to Count - 1 do + if Items[I].IsItemList then + Build(TcxFilterCriteriaItemList(Items[I]), + TcxGroupViewInfo.Create(Self, ARow, Items[I])) + else + TcxConditionViewInfo.Create(Self, ARow, Items[I]); + end; + end; + +begin + BeginUpdate; + try + ClearRows; + Build(FCriteria.Root, FRoot); + RecalcRows; + finally + EndUpdate; + end; +end; + +procedure TcxCustomFilterControl.BuildFromRows; + + function GetValueString(AValueInfo: TcxValueInfo; ASoftNull: Boolean = False): string; + begin + if VarIsNull(AValueInfo.Value) or + (ASoftNull and VarIsStr(AValueInfo.Value) and (AValueInfo.Value = '')) then + Result := cxGetResourceString(@cxSFilterBlankCaption) + else + Result := AValueInfo.ValueText; + end; + + procedure AddCondition(ACriteriaList: TcxFilterCriteriaItemList; ACondition: TcxConditionViewInfo); + var + I: Integer; + AValue: Variant; + AText: string; + begin + with ACondition do + case Operator of + fcoEqual, fcoNotEqual: + ACriteriaList.AddItem(ItemLink, GetFilterOperatorKind(Operator), + Values[0].Value, GetValueString(Values[0])); + fcoBetween, fcoNotBetween: + begin + // sort between + if VarCompare(Values[0].Value, Values[1].Value) < 0 then + begin + AValue := VarBetweenArrayCreate(Values[0].Value, Values[1].Value); + AText := GetValueString(Values[0]) + ';' + GetValueString(Values[1]); + end + else + begin + AValue := VarBetweenArrayCreate(Values[1].Value, Values[0].Value); + AText := GetValueString(Values[1]) + ';' + GetValueString(Values[0]); + end; + ACriteriaList.AddItem(ItemLink, GetFilterOperatorKind(Operator), AValue, AText); + end; + fcoInList, fcoNotInList: + begin + AValue := VarListArrayCreate(Values[0].Value); + AText := GetValueString(Values[0]); + for I := 1 to Values.Count - 1 do + begin + VarListArrayAddValue(AValue, Values[I].Value); + AText := AText + ';' + GetValueString(Values[I]); + end; + ACriteriaList.AddItem(ItemLink, GetFilterOperatorKind(Operator), AValue, AText); + end; + fcoBlanks, fcoNonBlanks: + ACriteriaList.AddItem(ItemLink, GetFilterOperatorKind(Operator), + Values[0].Value, cxGetResourceString(@cxSFilterBlankCaption)); + else + ACriteriaList.AddItem(ItemLink, GetFilterOperatorKind(Operator), + Values[0].Value, GetValueString(Values[0], True)); + end; + end; + + procedure Build(ACriteriaList: TcxFilterCriteriaItemList; ARow: TcxCustomRowViewInfo); + var + I: Integer; + begin + if ARow is TcxGroupViewInfo then + begin + ACriteriaList.BoolOperatorKind := ARow.Group.BoolOperator; + for I := 0 to ARow.Group.RowCount - 1 do + if ARow.Group.Rows[I] is TcxGroupViewInfo then + Build(ACriteriaList.AddItemList(fboAnd), ARow.Group.Rows[I]) + else + AddCondition(ACriteriaList, ARow.Group.Rows[I].Condition); + end + else + AddCondition(ACriteriaList, ARow.Condition); + end; + +begin + ValueEditorHide(True); + if not IsValid then Exit; + with FCriteria do + begin + BeginUpdate; + try + Clear; + Build(Root, Self.FRoot); + Prepare; + finally + EndUpdate; + end; + end; +end; + +procedure TcxCustomFilterControl.CheckInplaceControlsColor; +begin + FComboBox.Style.Color := ViewInfo.Painter.ContentColor; +end; + +procedure TcxCustomFilterControl.CreateInternalControls; + + function NewMenuItem(ATag: Integer): TMenuItem; + begin + Result := TMenuItem.Create(Self); + with Result do + begin + if ATag <> 2 then ImageIndex := ATag; + Tag := ATag; + OnClick := PopupMenuClick; + end; + end; + + procedure CreateComboBox; + begin + FComboBox := TcxComboBox.Create(nil, True); + with FComboBox do + begin + Style.LookAndFeel.MasterLookAndFeel := Self.LookAndFeel; + Visible := False; + ParentColor := True; + OnExit := ComboBoxExit; + OnKeyPress := ComboBoxKeyPress; + OnKeyDown := ComboBoxKeyDown; + end; + with FComboBox.Properties do + begin + Buttons[0].Visible := False; + DropDownListStyle := lsFixedList; + OnPopup := ComboBoxPopup; + OnCloseUp := ComboBoxCloseUp; + end; + end; + +var + I: Integer; +begin + CreateComboBox; + // style for Values + FValueEditorStyle := TcxCustomEditStyle.Create(Self, True); + with FValueEditorStyle do + begin + Font := FontValue; + LookAndFeel.MasterLookAndFeel := Self.LookAndFeel; + ButtonTransparency := ebtHideUnselected; + end; + // action menu + FActionMenu := TPopupMenu.Create(Self); + for I := 0 to 3 do + FActionMenu.Items.Add(NewMenuItem(I)); + // editors pool + FInplaceEditors := TcxInplaceEditList.Create; + FTextEditProperties := TcxTextEditProperties.Create(nil); +end; + +procedure TcxCustomFilterControl.DestroyInternalControls; +begin + FreeAndNil(FInplaceEditors); + FreeAndNil(FValueEditorStyle); + FreeAndNil(FTextEditProperties); + FreeAndNil(FActionMenu); + FreeAndNil(FComboBox); +end; + +procedure TcxCustomFilterControl.DoApplyFilter; +var + ANeedSynchronize: Boolean; +begin + if (FilterLink <> nil) and (FilterLink.Criteria <> nil) then + begin + BuildFromRows; + ANeedSynchronize := FCriteria <> FilterLink.Criteria; + FilterLink.Criteria.BeginUpdate; + try + if ANeedSynchronize then + FilterLink.Criteria.AssignItems(FCriteria); + if Assigned(FOnApplyFilter) then FOnApplyFilter(Self); + finally + FilterLink.Criteria.EndUpdate; + if ANeedSynchronize then + FCriteria.Assign(FilterLink.Criteria); + BuildFromCriteria; + end; + end; +end; + +function TcxCustomFilterControl.GetDefaultProperties: TcxCustomEditProperties; +begin + Result := FTextEditProperties; +end; + +function TcxCustomFilterControl.GetDefaultPropertiesViewInfo: TcxCustomEditViewInfo; +begin + Result := TcxCustomEditViewInfo(GetDefaultProperties.GetViewInfoClass.Create); +end; + +function TcxCustomFilterControl.GetFilterControlCriteriaClass: TcxFilterControlCriteriaClass; +begin + Result := TcxFilterControlCriteria; +end; + +function TcxCustomFilterControl.GetViewInfoClass: TcxFilterControlViewInfoClass; +begin + Result := TcxFilterControlViewInfo; +end; + +function TcxCustomFilterControl.HasFocus: Boolean; +begin + Result := IsFocused or ((FValueEditor <> nil) and FValueEditor.IsFocused); +end; + +function TcxCustomFilterControl.HasHotTrack: Boolean; +begin + Result := Enabled and (FHotTrackOnUnfocused or HasFocus) and HasItems; +end; + +procedure TcxCustomFilterControl.RefreshProperties; +var + I: Integer; + ARow: TcxCustomRowViewInfo; +begin + if RowCount = 0 then Exit; + for I := 0 to RowCount - 1 do + begin + ARow := GetRow(I); + if ARow is TcxConditionViewInfo then + ARow.Condition.InternalInit; + end; + LayoutChanged; +end; + +procedure TcxCustomFilterControl.FillFilterItemList(AStrings: TStrings); +var + I: Integer; + AProperties: TcxCustomEditProperties; +begin + if (AStrings = nil) or not HasItems then Exit; + AStrings.BeginUpdate; + try + AStrings.Clear; + with FilterLink do + for I := 0 to Count - 1 do + begin + AProperties := Properties[I]; + if (AProperties <> nil) and (esoFiltering in AProperties.GetSupportedOperations) then + AStrings.AddObject(Captions[I], TObject(I)); + end; + finally + AStrings.EndUpdate; + end; +end; + +procedure TcxCustomFilterControl.FillConditionList(AStrings: TStrings); +var + AOperator: TcxFilterControlOperator; +begin + if (AStrings = nil) or not HasItems then Exit; + AStrings.BeginUpdate; + try + AStrings.Clear; + FocusedRow.Condition.ValidateConditions; + for AOperator := Low(AOperator) to High(AOperator) do + if AOperator in FocusedRow.Condition.SupportedOperators then + AStrings.AddObject(cxConditionText[AOperator], TObject(AOperator)); + finally + AStrings.EndUpdate; + end; +end; + +procedure TcxCustomFilterControl.ValidateConditions( + var SupportedOperations: TcxFilterControlOperators); +begin + if not FCriteria.SupportedLike then + SupportedOperations := SupportedOperations - [fcoLike, fcoNotLike]; +end; + +procedure TcxCustomFilterControl.CorrectOperatorClass( + var AOperatorClass: TcxFilterOperatorClass); +begin +end; + +function TcxCustomFilterControl.GetFilterCaption: string; +begin + BuildFromRows; + Result := FCriteria.FilterCaption +end; + +function TcxCustomFilterControl.GetFilterLink: IcxFilterControl; +begin + Result := nil; +end; + +function TcxCustomFilterControl.GetFilterText: string; +begin + BuildFromRows; + Result := FCriteria.FilterText +end; + +procedure TcxCustomFilterControl.SelectAction; +var + P: TPoint; +begin + if not HasItems then Exit; + with FocusedRow.ButtonRect do + P := ClientToScreen(Point(Left, Bottom)); + FState := fcsSelectingAction; + if FocusedRow <> FRoot then + begin + FActionMenu.Items[2].Visible := True; + FActionMenu.Items[3].Visible := True; + FActionMenu.Items[3].Caption := cxGetResourceString(@cxSFilterRemoveRow); + end + else + begin + FActionMenu.Items[2].Visible := FRoot.Group.RowCount > 0; + FActionMenu.Items[3].Visible := FRoot.Group.RowCount > 0; + FActionMenu.Items[3].Caption := cxGetResourceString(@cxSFilterClearAll); + end; + FActionMenu.Popup(P.X, P.Y); + FState := fcsNormal; +end; + +procedure TcxCustomFilterControl.SelectBoolOperator; +var + ABoolOperator: TcxFilterBoolOperatorKind; +begin + if not HasItems then Exit; + State := fcsSelectingBoolOperator; + with FComboBox do + begin + Properties.Items.Clear; + Properties.Sorted := False; + Style.Font.Assign(FontBoolOperator); + for ABoolOperator := fboAnd to fboNotOr do + Properties.Items.AddObject(cxBoolOperatorText[ABoolOperator], TObject(ABoolOperator)); + with FocusedRow.Group do + DoComboDropDown(BoolOperatorRect, BoolOperatorText); + end; +end; + +procedure TcxCustomFilterControl.SelectCondition; +begin + if not HasItems then Exit; + State := fcsSelectingCondition; + with FComboBox do + begin + Style.Font.Assign(FontCondition);// + Properties.Sorted := False; + FillConditionList(Properties.Items); + with FocusedRow.Condition do + DoComboDropDown(OperatorRect, OperatorText); + end; +end; + +procedure TcxCustomFilterControl.SelectItem; +begin + if not HasItems then Exit; + with FComboBox do + begin + Style.Font.Assign(FontItem); + State := fcsSelectingItem; + FillFilterItemList(Properties.Items); + Properties.Sorted := FSortItems; + with FocusedRow.Condition do + DoComboDropDown(ItemRect, ItemText); + end; +end; + +procedure TcxCustomFilterControl.SelectValue( + AActivateKind: TcxActivateValueEditKind; AKey: Char); +begin + if not HasItems then Exit; + EnsureRowVisible; + ValueEditorInit; + with FValueEditor do + begin + SendToBack; + case AActivateKind of + aveMouse: + with FocusedRow.Condition do + ActivateByMouse(FFocusedInfo.Shift, FFocusedInfo.Mouse.X, FFocusedInfo.Mouse.Y, ValueEditorData); + aveKey: + with FocusedRow.Condition do + ActivateByKey(AKey, ValueEditorData); + else + with FocusedRow.Condition do + Activate(ValueEditorData); + end; + end; +end; + +// IcxMouseTrackingCaller +procedure TcxCustomFilterControl.DoMouseLeave; +begin + MouseLeave(nil); +end; + +// IcxFormatContollerListener +procedure TcxCustomFilterControl.FormatChanged; +begin + LayoutChanged; +end; + +procedure TcxCustomFilterControl.CreateFonts; +var + AFont: TcxFilterControlFont; +begin + for AFont := fcfBoolOperator to fcfValue do + begin + FFonts[AFont] := TFont.Create; + FFonts[AFont].Color := cxFilterControlFontColors[AFont]; + if AFont <> fcfValue then + FFonts[AFont].Style := [fsUnderline]; + FFonts[AFont].OnChange := DoFontChanged; + end; +end; + +procedure TcxCustomFilterControl.DoFontChanged(Sender: TObject); +begin + LayoutChanged; +end; + +function TcxCustomFilterControl.GetFont(Index: Integer): TFont; +begin + Result := FFonts[TcxFilterControlFont(Index)]; +end; + +function TcxCustomFilterControl.IsFontStored(Index: Integer): Boolean; +const + Styles: array[Boolean] of TFontStyles = ([fsUnderline], []); +begin + with FFonts[TcxFilterControlFont(Index)] do + begin + Result := (CompareText(Name, Font.Name) <> 0) or (Height <> Font.Height) or + (Color <> cxFilterControlFontColors[TcxFilterControlFont(Index)]) or + (Charset <> Font.Charset) or (Style <> Styles[Index = Integer(fcfValue)]); + end; +end; + +procedure TcxCustomFilterControl.SetFont(Index: Integer; + const Value: TFont); +begin + FFonts[TcxFilterControlFont(Index)].Assign(Value); +end; + +function TcxCustomFilterControl.FocusedRowIndex: Integer; +begin + Result := FRows.IndexOf(FFocusedInfo.Row); + if Result < 0 then Result := 0; +end; + +function TcxCustomFilterControl.GetRow(Index: Integer): TcxCustomRowViewInfo; +begin + Result := TcxCustomRowViewInfo(FRows[Index]); +end; + +function TcxCustomFilterControl.GetRowCount: Integer; +begin + Result := FRows.Count; +end; + +function TcxCustomFilterControl.GetFocusedRow: TcxCustomRowViewInfo; +begin + Result := FFocusedInfo.Row; +end; + +procedure TcxCustomFilterControl.ComboBoxCloseUp(Sender: TObject); +begin + if not FComboBox.EditModified then Exit; + with FocusedRow do + case State of + fcsSelectingBoolOperator: + with FComboBox do + Group.BoolOperator := + TcxFilterBoolOperatorKind(Properties.Items.Objects[ItemIndex]); + fcsSelectingItem: + with FComboBox do + begin + Condition.SetItem(Integer(Properties.Items.Objects[ItemIndex])); + FFocusedInfo.HitTest := fhtOperator; + with Condition do + if (fcoLike in SupportedOperators) and (ValueType <> nil) and ValueType.IsString then + Condition.Operator := fcoLike; + end; + fcsSelectingCondition: + begin + with FComboBox do + Condition.Operator := + TcxFilterControlOperator(Properties.Items.Objects[ItemIndex]); + Condition.InitValues(True); + if Condition.HasDisplayValues then + begin + FFocusedInfo.HitTest := fhtValue; + FFocusedInfo.ValueIndex := 0; + end; + end; + end; + FComboBox.Visible := False; + State := fcsNormal; + ViewInfo.Calc; + EnsureRowVisible; + SetFocus; +end; + +procedure TcxCustomFilterControl.ComboBoxExit(Sender: TObject); +begin + //TODO + FComboBox.Visible := False; + State := fcsNormal; +end; + +procedure TcxCustomFilterControl.ComboBoxKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if Key = 32 then Key := 13; +end; + +procedure TcxCustomFilterControl.ComboBoxKeyPress(Sender: TObject; var Key: Char); +begin + if Key = ' ' then Key := #0; +end; + +procedure TcxCustomFilterControl.ComboBoxPopup(Sender: TObject); +begin + TcxComboBoxListBox(FComboBox.ILookupData.ActiveControl).Font.Style := []; +end; + +procedure TcxCustomFilterControl.DoComboDropDown(const R: TRect; const AText: string); +begin + with FComboBox do + begin + Visible := True; + with R do + SetBounds(Left, Top, Right - Left, Bottom - Top); + Properties.DropDownRows := Min(cxFilterControlMaxDropDownRows, + Properties.Items.Count); + EditValue := AText; + DroppedDown := True; + end; +end; + +procedure TcxCustomFilterControl.SetFocusedRow(ARow: TcxCustomRowViewInfo); +begin + FFocusedInfo.Row := ARow; + if ARow is TcxGroupViewInfo then + RowNavigate(fhtBoolOperator) + else + RowNavigate(fhtItem); +end; + +procedure TcxCustomFilterControl.PopupMenuClick(Sender: TObject); +begin + case Integer(TMenuItem(Sender).Tag) of + 0: AddCondition(FocusedRow); + 1: AddGroup; + 3: if FocusedRow <> FRoot then RemoveRow else Clear; + end; +end; + +function TcxCustomFilterControl.IsNullStringStored: Boolean; +begin + Result := FNullString <> cxGetResourceString(@cxSFilterControlNullString); +end; + +procedure TcxCustomFilterControl.ProcessHitTest( + AHitTest: TcxFilterControlHitTest; AByMouse: Boolean); +begin + case AHitTest of + fhtAddCondition: AddCondition(nil); // add last + fhtAddValue: AddValue; + fhtBoolOperator: SelectBoolOperator; + fhtButton: SelectAction; + fhtItem: SelectItem; + fhtOperator: SelectCondition; + fhtValue: + if AByMouse then + SelectValue(aveMouse, #0) + else + SelectValue(aveEnter, #0); + end +end; + +procedure TcxCustomFilterControl.ReadData(AStream: TStream); +begin + FCriteria.ReadData(AStream); +end; + +procedure TcxCustomFilterControl.RecalcRows; + + procedure FillRows(ARow: TcxCustomRowViewInfo); + var + I: Integer; + begin + FRows.Add(ARow); + if ARow is TcxGroupViewInfo then + for I := 0 to ARow.Group.RowCount - 1 do + FillRows(ARow.Group.Rows[I]) + end; + +begin + FRows.Clear; + FillRows(FRoot); +end; + +procedure TcxCustomFilterControl.RefreshMenuCaptions; +begin + with FActionMenu do + begin + Items[0].Caption := cxGetResourceString(@cxSFilterAddCondition); + Items[1].Caption := cxGetResourceString(@cxSFilterAddGroup); + Items[2].Caption := '-'; + end; +end; + +procedure TcxCustomFilterControl.SetLeftOffset(Value: Integer); +begin + Value := Min(Value, ViewInfo.MaxRowWidth - WidthOf(ClientBounds) + 1); + if Value < 0 then Value := 0; + if FLeftOffset <> Value then + begin + FLeftOffset := Value; + LayoutChanged; + end; +end; + +procedure TcxCustomFilterControl.SetNullString(const Value: string); +begin + if FNullString <> Value then + begin + FNullString := Value; + LayoutChanged; + end; +end; + +procedure TcxCustomFilterControl.SetTopVisibleRow(Value: Integer); +begin + Value := Min(Value, RowCount - HeightOf(ClientBounds) div ViewInfo.RowHeight + 1); + if Value < 0 then Value := 0; + if FTopVisibleRow <> Value then + begin + FTopVisibleRow := Value; + LayoutChanged; + end; +end; + +procedure TcxCustomFilterControl.SetShowLevelLines(const Value: Boolean); +begin + if FShowLevelLines <> Value then + begin + FShowLevelLines := Value; + Invalidate; + end; +end; + +procedure TcxCustomFilterControl.SetWantTabs(const Value: Boolean); +begin + FWantTabs := Value; + if Value then + Keys := [kAll, kArrows, kChars, kTab] + else + Keys := [kAll, kArrows, kChars]; +end; + +procedure TcxCustomFilterControl.ValueEditorInit; + + procedure SetValidChars; + var + AWildcardChars: set of AnsiChar; + begin + AWildcardChars := [AnsiChar(FCriteria.UnderscoreWildcard), AnsiChar(FCriteria.PercentWildcard)]; + if FValueEditor is TcxCustomTextEdit then + if FocusedRow.Condition.Operator in [fcoLike, fcoNotLike] then + with TcxCustomTextEditProperties(FValueEditor.ActiveProperties) do + ValidChars := ValidChars + AWildcardChars + end; + +var + AProperties: TcxCustomEditProperties; + AIndex: Integer; +begin + State := fcsSelectingValue; + AIndex := FFocusedInfo.ValueIndex; + with FocusedRow.Condition do + begin + AProperties := GetProperties; + FValueEditor := EditorHelper.GetFilterEdit(AProperties, FInplaceEditors); + EditorHelper.SetFilterValue(FValueEditor, AProperties, Values[AIndex].Value); + end; + SetValidChars; + with FValueEditor do + begin + Parent := Self; + Style.Assign(FValueEditorStyle); + Style.Color := clWindow; + with FocusedRow.Condition.Values[AIndex].ValueRect do + SetBounds(Left, Top, Right - Left, Bottom - Top); + OnAfterKeyDown := ValueEditorAfterKeyDown; + OnExit := ValueEditorExit; + OnKeyDown := ValueEditorKeyDown; + end; +end; + +procedure TcxCustomFilterControl.ValueEditorAfterKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if (Key = VK_UP) or (Key = VK_DOWN) then + try + ValueEditorHide(True); + SetFocus; + KeyDown(Key, Shift); + Key := 0; + except + FValueEditor.SetFocus; + raise; + end; +end; + +procedure TcxCustomFilterControl.ValueEditorExit(Sender: TObject); +begin + try + ValueEditorHide(True); + except + FValueEditor.SetFocus; + raise; + end; +end; + +procedure TcxCustomFilterControl.ValueEditorKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + case Key of + VK_RETURN: + begin + ValueEditorHide(True); + SetFocus; + Key := 0; + end; + VK_TAB: + if FWantTabs then + begin + ValueEditorHide(True); + SetFocus; + if ssShift in Shift then FocusPrev(True) else FocusNext(True); + Key := 0; + end; + VK_ESCAPE: + begin + if FValueEditor <> nil then + Key := 0; + ValueEditorHide(False); + SetFocus; + end; + VK_DELETE: + if Shift = [ssCtrl] then + begin + ValueEditorHide(False); + SetFocus; + Remove; + Key := 0; + end; + end; +end; + +procedure TcxCustomFilterControl.WriteData(AStream: TStream); +begin + FCriteria.WriteData(AStream); +end; + +{ TcxFilterControlPainter } + +constructor TcxFilterControlPainter.Create(AOwner: TcxCustomFilterControl); +begin + inherited Create; + FControl := AOwner; +end; + +function TcxFilterControlPainter.GetContentColor: TColor; +begin + Result := clDefault; + if Control.LookAndFeel.SkinPainter <> nil then + Result := Control.LookAndFeel.SkinPainter.DefaultContentColor; + if Result = clDefault then + Result := Control.Color; +end; + +procedure TcxFilterControlPainter.DrawBorder; +begin + Painter.DrawBorder(Canvas, Control.Bounds); +end; + +procedure TcxFilterControlPainter.DrawDotLine(const R: TRect); +var + APrevBkColor, APrevTextColor: TColorRef; +begin + APrevBkColor := GetBkColor(Canvas.Canvas.Handle); + APrevTextColor := GetTextColor(Canvas.Canvas.Handle); + SetBkColor(Canvas.Canvas.Handle, ColorToRGB(cl3DDkShadow)); + SetTextColor(Canvas.Canvas.Handle, ColorToRGB(ContentColor)); + Windows.FillRect(Canvas.Canvas.Handle, R, HalftoneBrush); + SetBkColor(Canvas.Canvas.Handle, APrevBkColor); + SetTextColor(Canvas.Canvas.Handle, APrevTextColor); +end; + +procedure TcxFilterControlPainter.DrawGroup(ARow: TcxGroupViewInfo); +begin + with ARow, Canvas.Canvas do + begin + Brush.Style := bsClear; + if Caption <> '' then + TextDraw(CaptionRect.Left, CaptionRect.Top + 1, Caption); + Font.Assign(Control.FontBoolOperator); + if BoolOperatorText <> '' then + TextDraw(BoolOperatorRect.Left + 1, BoolOperatorRect.Top + 1, BoolOperatorText); + end; +end; + +procedure TcxFilterControlPainter.DrawCondition(ARow: TcxConditionViewInfo); +begin + with ARow, Canvas.Canvas do + begin + Brush.Style := bsClear; + Font.Assign(Control.FontItem); + if ItemText <> '' then + TextDraw(ItemRect.Left + 1, ItemRect.Top + 1, ItemText); + Font.Assign(Control.FontCondition); + if OperatorText <> '' then + TextDraw(OperatorRect.Left + 1, OperatorRect.Top + 1, OperatorText); + end; + DrawValues(ARow); +end; + +procedure TcxFilterControlPainter.DrawValues(ARow: TcxConditionViewInfo); +var + I: Integer; +begin + with ARow do + begin + if not Condition.HasDisplayValues then Exit; + for I := 0 to Values.Count - 1 do + Values[I].ValueViewInfo.Paint(Self.Canvas); + if Operator in [fcoBetween, fcoNotBetween] then + begin + Canvas.Font.Assign(Control.FontCondition); + Canvas.Brush.Color := ContentColor; + for I := 1 to Values.Count - 1 do + with Values[I - 1] do + TextDraw(ValueRect.Right + 4, ValueRect.Top + 1, Values.Separator); + end + else if Operator in [fcoInList, fcoNotInList] then + begin + Canvas.Font.Assign(Control.FontValue); + Canvas.Brush.Color := ContentColor; + for I := 1 to Values.Count - 1 do + with Values[I - 1] do + TextDraw(ValueRect.Right + 2, ValueRect.Top + 1, Values.Separator); + with OperatorRect do TextDraw(Right + 4, Top, '('); + with Values[Values.Count - 1].ValueRect do TextDraw(Right + 3, Top + 1, ')'); + Painter.DrawButton(Canvas, Values.AddButtonRect, '+', Values.AddButtonState); + end; + end; +end; + +procedure TcxFilterControlPainter.DrawRow(ARow: TcxCustomRowViewInfo); +var + ALeft, H: Integer; + AParent: TcxCustomRowViewInfo; +begin + with Canvas, ARow do + begin + Brush.Color := ContentColor; + FillRect(ARow.RowRect); + Font.Assign(Control.Font); + Painter.DrawButton(Self.Canvas, ButtonRect, ButtonText, ButtonState); + if ARow is TcxGroupViewInfo then + DrawGroup(Group) + else + DrawCondition(Condition); + // draw level's lines if need + if Control.ShowLevelLines and (Level > 0) then + begin + Brush.Style := bsSolid; + Brush.Color := clGray; + ALeft := Parent.ButtonRect.Left + WidthOf({Parent.}ButtonRect) div 2; + H := HeightOf(RowRect) div 2; + DrawDotLine(Bounds(ALeft, RowRect.Top, 1, H)); + if not IsLast then DrawDotLine(Bounds(ALeft, RowRect.Top + H, 1, H + 1)); + Inc(H, RowRect.Top); + DrawDotLine(Rect(ALeft, H, ButtonRect.Left - 3, H + 1)); + AParent := Parent; + while AParent <> nil do + begin + if not AParent.IsLast then + begin + ALeft := AParent.Parent.ButtonRect.Left + WidthOf(ButtonRect) div 2; + DrawDotLine(Rect(ALeft, RowRect.Top, ALeft + 1, RowRect.Bottom)); + end; + AParent := AParent.Parent; + end; + end; + end; +end; + +procedure TcxFilterControlPainter.TextDraw(X, Y: Integer; const AText: string); +begin + with Canvas.Canvas do + begin + if not ViewInfo.Enabled then + begin + Brush.Style := bsClear; + Font.Color := clBtnHighlight; + TextOut(X + 1, Y + 1, AText); + Font.Color := clBtnShadow; + end; + TextOut(X, Y, AText); + end; +end; + +function TcxFilterControlPainter.GetCanvas: TcxCanvas; +begin + Result := ViewInfo.Canvas; +end; + +function TcxFilterControlPainter.GetPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := FControl.LookAndFeel.Painter; +end; + +function TcxFilterControlPainter.GetViewInfo: TcxFilterControlViewInfo; +begin + Result := FControl.FViewInfo; +end; + +{ TcxFilterControlViewInfo } + +constructor TcxFilterControlViewInfo.Create( + AOwner: TcxCustomFilterControl); +begin + inherited Create; + FControl := AOwner; + FBitmap := TBitmap.Create; + FBitmap.PixelFormat := pfDevice; + FBitmapCanvas := TcxCanvas.Create(FBitmap.Canvas); + FPainter := GetPainterClass.Create(AOwner); + FButtonState := cxbsNormal; +end; + +destructor TcxFilterControlViewInfo.Destroy; +begin + FreeAndNil(FPainter); + FreeAndNil(FBitmapCanvas); + FreeAndNil(FBitmap); + inherited Destroy; +end; + +procedure TcxFilterControlViewInfo.Calc; +var + I, AIndent: Integer; + J: TcxFilterControlFont; + R: TRect; + ASize: TSize; +begin + CheckBitmap; + with Control do + begin + FEnabled := HasItems and Enabled; + FRowHeight := Self.Canvas.FontHeight(Font); + FMinValueWidth := Self.Canvas.TextWidth('0') * 12; + for J := fcfBoolOperator to fcfCondition do + FRowHeight := Max(FRowHeight, Self.Canvas.FontHeight(FFonts[J])); + FRowHeight := MulDiv(Max(FRowHeight, GetEditHeight), 3, 2); + with ClientBounds do + R := Rect(Left - LeftOffset, Top, Right, Top + FRowHeight); + OffsetRect(R, 0, - TopVisibleRow * FRowHeight); + FMaxRowWidth := 0; + for I := 0 to RowCount - 1 do + with Rows[I] do + begin + Calc(R); + FMaxRowWidth := Max(FMaxRowWidth, Width); + OffsetRect(R, 0, FRowHeight); + end; + AIndent := Rows[RowCount - 1].Indent + 4; + Inc(R.Left, AIndent); + Self.Canvas.Font.Assign(Font); + ASize := Self.Canvas.TextExtent(FAddConditionCaption + '00'); + FAddConditionRect := Classes.Bounds(R.Left, 0, ASize.cx, HeightOf(R) - 4); + CenterRectVert(R, FAddConditionRect); + FMaxRowWidth := Max(FMaxRowWidth, WidthOf(FAddConditionRect) + AIndent); + end; + CalcButtonState; + CalcFocusRect; +end; + +procedure TcxFilterControlViewInfo.GetHitTestInfo(AShift: TShiftState; + const P: TPoint; var HitInfo: TcxFilterControlHitTestInfo); +var + I: Integer; +begin + with Control do + begin + HitInfo.HitTest := fhtNone; + HitInfo.Mouse := P; + HitInfo.Row := FocusedRow; + if HitInfo.Row = nil then HitInfo.Row := FRoot; + HitInfo.Shift := AShift; + HitInfo.ValueIndex := -1; + if not PtInRect(ClientBounds, P) then Exit; + if PtInRect(AddConditionRect, P) then + HitInfo.HitTest := fhtAddCondition + else + for I := TopVisibleRow to RowCount - 1 do + if PtInRect(Rows[I].RowRect, P) then + begin + HitInfo.Row := Rows[I]; + Rows[I].GetHitTestInfo(P, HitInfo); + break; + end; + end; +end; + +procedure TcxFilterControlViewInfo.Paint; + + function IsFocused: Boolean; + begin + Result := Control.IsFocused or + (Control.FComboBox.IsFocused) or + ((Control.FValueEditor <> nil) and Control.FValueEditor.IsFocused); + end; + +var + I: Integer; + R: TRect; +begin + with Canvas do + begin + Brush.Style := bsSolid; + Brush.Color := Painter.ContentColor; + FillRect(Control.ClientBounds); + end; + for I := Control.TopVisibleRow to Control.RowCount - 1 do + with Control.Rows[I] do + begin + if Canvas.RectVisible(RowRect) then + Painter.DrawRow(Control.Rows[I]); + if RowRect.Top > Control.ClientBounds.Bottom then break; + end; + with Canvas do + begin + Brush.Color := Painter.ContentColor; + Brush.Style := bsSolid; + Font.Assign(Control.Font); + Painter.Painter.DrawButton(Self.Canvas, FAddConditionRect, FAddConditionCaption, FButtonState); + if not IsRectEmpty(FFocusRect) and IsFocused then + DrawFocusRect(FFocusRect); + end; + R := Bounds(0, 0, FBitmap.Width, FBitmap.Height); + Painter.DrawBorder; + BitBlt(Control.Canvas.Handle, 0, 0, FBitmap.Width, FBitmap.Height, + Canvas.Handle, 0, 0, SRCCOPY); +end; + +procedure TcxFilterControlViewInfo.InvalidateRow(ARow: TcxCustomRowViewInfo); +begin + if ARow <> nil then + begin + ARow.Calc(ARow.RowRect); + Control.InvalidateRect(ARow.RowRect, False); + end; +end; + +procedure TcxFilterControlViewInfo.Update; +var + AState: TcxButtonState; +begin + AState := FButtonState; + CalcButtonState; + CalcFocusRect; + if AState <> FButtonState then Control.InvalidateRect(FAddConditionRect, True); +end; + +procedure TcxFilterControlViewInfo.CalcFocusRect; +begin + if not Control.HasItems then + begin + FFocusRect := Control.ClientBounds; + InflateRect(FFocusRect, -2, -2); + end + else + with Control.FFocusedInfo do + begin + FFocusRect := EmptyRect; + case HitTest of + fhtBoolOperator: FFocusRect := Row.Group.BoolOperatorRect; + fhtItem: FFocusRect := Row.Condition.ItemRect; + fhtOperator: FFocusRect := Row.Condition.OperatorRect; + fhtValue: FFocusRect := Row.Condition.Values[ValueIndex].ValueRect; + end; + if HitTest in [fhtBoolOperator, fhtItem, fhtOperator, fhtValue] then + InflateRect(FFocusRect, 1, 1); + end; +end; + +function TcxFilterControlViewInfo.GetPainterClass: TcxFilterControlPainterClass; +begin + Result := TcxFilterControlPainter; +end; + +procedure TcxFilterControlViewInfo.CalcButtonState; +begin + with Control do + if not FEnabled then + FButtonState := cxbsDisabled + else + if FFocusedInfo.HitTest = fhtAddCondition then + FButtonState := cxbsDefault + else + if HasHotTrack and (FHotTrack.HitTest = fhtAddCondition) then + FButtonState := cxbsHot + else + FButtonState := cxbsNormal; +end; + +procedure TcxFilterControlViewInfo.CheckBitmap; +begin + FBitmap.Height := Control.Height; // only if needed + FBitmap.Width := Control.Width; // only if needed +end; + +function TcxFilterControlViewInfo.GetCanvas: TcxCanvas; +begin + Result := FBitmapCanvas; +end; + +function TcxFilterControlViewInfo.GetEditHeight: Integer; +var + AEditSizeProperties: TcxEditSizeProperties; +begin + AEditSizeProperties.MaxLineCount := 1; + AEditSizeProperties.Width := 10; + AEditSizeProperties.Height := -1; + Canvas.Font.Assign(Control.FontValue); + with Control do + Result := FTextEditProperties.GetEditSize(Canvas, FValueEditorStyle, + True, 'Yy', AEditSizeProperties).cy; +end; + +{ TcxFilterControl } + +procedure TcxFilterControl.UpdateFilter; +begin + if (FilterLink <> nil) and (FilterLink.Criteria <> nil) then + begin + if FCriteria <> FilterLink.Criteria then + FCriteria.Assign(FilterLink.Criteria); + BuildFromCriteria; + end + else Clear; +end; + +function TcxFilterControl.GetFilterLink: IcxFilterControl; +begin + if FLinkComponent <> nil then + Supports(TObject(FLinkComponent), IcxFilterControl, Result) + else + Result := nil; +end; + +procedure TcxFilterControl.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (AComponent = FLinkComponent) then + LinkComponent := nil +end; + +{$IFDEF CBUILDER6} +function TcxFilterControl.GetLinkComponent: TComponent; +begin + Result := FLinkComponent; +end; +{$ENDIF} + +procedure TcxFilterControl.SetLinkComponent(Value: TComponent); +begin + if (Value <> nil) and not Supports(Value, IcxFilterControl) then + Value := nil; + if FLinkComponent <> Value then + begin + {$IFDEF DELPHI5} + if FLinkComponent <> nil then + FLinkComponent.RemoveFreeNotification(Self); + {$ENDIF} + FLinkComponent := Value; + if FLinkComponent <> nil then + FLinkComponent.FreeNotification(Self); + UpdateFilter; + end; +end; + +procedure CreateHalftoneBrush; +var + X, Y: Integer; + DC: HDC; + Pattern: HBITMAP; +begin + Pattern := CreateBitmap(8, 8, 1, 1, nil); + DC := CreateCompatibleDC(0); + Pattern := SelectObject(DC, Pattern); + FillRect(DC, Rect(0, 0, 8, 8), GetStockObject(WHITE_BRUSH)); + for Y := 0 to 7 do + for X := 0 to 7 do + if (Y mod 2) = (X mod 2) then SetPixel(DC, X, Y, 0); + Pattern := SelectObject(DC, Pattern); + DeleteDC(DC); + HalftoneBrush := CreatePatternBrush(Pattern); + DeleteObject(Pattern); +end; + +initialization + CreateHalftoneBrush; + +finalization + if HalftoneBrush <> 0 then DeleteObject(HalftoneBrush); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxFilterControlDialog.dfm b/official/x.35/ExpressEditors Library 5/Sources/cxFilterControlDialog.dfm new file mode 100644 index 00000000..55779e1d --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxFilterControlDialog.dfm @@ -0,0 +1,112 @@ +object fmFilterControlDialog: TfmFilterControlDialog + Left = 360 + Top = 200 + BorderIcons = [biSystemMenu] + Caption = 'fmFilterControlDialog' + AutoScroll = False + ClientHeight = 316 + ClientWidth = 552 + Color = clBtnFace + Constraints.MinHeight = 165 + Constraints.MinWidth = 560 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Icon.Data = { + 0000010001001010100000000000280100001600000028000000100000002000 + 00000100040000000000C0000000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000008 + 8EEE8FFFF8FF000888888888888800088EEE8FFFF8FF00088888888888880008 + 8E6677FFF8FF0007700007777777000780F607888788000770F6077777770008 + 80F807888888000880F807888888000808886070000000706888660700000706 + 8F88866070000068F88888660700068FFF88886660000000000000000000C000 + 0000C0000000C0000000C0000000C0000000C0000000C0000000C0000000C000 + 0000C0000000C0000000C00F000080070000800300000003000000030000} + KeyPreview = True + Position = poDefaultPosOnly + OldCreateOrder = False + OnClose = FormClose + OnKeyDown = FormKeyDown + OnKeyPress = FormKeyPress + PixelsPerInch = 96 + TextHeight = 13 + object pnlBottom: TPanel + Left = 0 + Top = 278 + Width = 552 + Height = 38 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + object btOpen: TcxButton + Left = 6 + Top = 8 + Width = 100 + Height = 23 + Hint = 'Open|Opens an existing filter' + Caption = '&Open...' + TabOrder = 0 + OnClick = acOpenExecute + end + object btSave: TcxButton + Left = 112 + Top = 8 + Width = 100 + Height = 23 + Hint = 'Save As|Saves the active filter with a new name' + Caption = 'Save &As...' + TabOrder = 1 + OnClick = acSaveExecute + end + object pnlBottomRight: TPanel + Left = 234 + Top = 0 + Width = 318 + Height = 38 + Align = alRight + BevelOuter = bvNone + TabOrder = 2 + object btApply: TcxButton + Left = 212 + Top = 8 + Width = 100 + Height = 23 + Caption = 'Apply' + TabOrder = 2 + OnClick = acApplyExecute + end + object btCancel: TcxButton + Left = 106 + Top = 8 + Width = 100 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + object btOk: TcxButton + Left = 0 + Top = 8 + Width = 100 + Height = 23 + Caption = 'Ok' + ModalResult = 1 + TabOrder = 0 + OnClick = acOkExecute + end + end + end + object OpenDialog: TOpenDialog + Left = 240 + Top = 8 + end + object SaveDialog: TSaveDialog + Options = [ofOverwritePrompt, ofHideReadOnly, ofEnableSizing] + Left = 272 + Top = 8 + end +end diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxFilterControlDialog.pas b/official/x.35/ExpressEditors Library 5/Sources/cxFilterControlDialog.pas new file mode 100644 index 00000000..33bd2771 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxFilterControlDialog.pas @@ -0,0 +1,276 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressFilterControl } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxFilterControlDialog; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, + SysUtils, Classes, Graphics, Controls, Forms, Dialogs, cxLookAndFeelPainters, + cxButtons, cxControls, cxFilterControl, ExtCtrls, cxLookAndFeels, StdCtrls, + Menus; + +type + TfmFilterControlDialog = class(TForm) + pnlBottom: TPanel; + btOpen: TcxButton; + btSave: TcxButton; + OpenDialog: TOpenDialog; + SaveDialog: TSaveDialog; + pnlBottomRight: TPanel; + btApply: TcxButton; + btCancel: TcxButton; + btOk: TcxButton; + procedure acApplyExecute(Sender: TObject); + procedure acOkExecute(Sender: TObject); + procedure acOpenExecute(Sender: TObject); + procedure acSaveExecute(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormKeyPress(Sender: TObject; var Key: Char); + procedure FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + private + FHasOpenedPopupWindow: Boolean; + FFilterControl: TcxCustomFilterControl; + + procedure Initialize(const AInitialDir: string); + procedure SetLookAndFeel(ALookAndFeel: TcxLookAndFeel); + procedure SetPanelsColor(AColor: TColor); + procedure SetTitle(const ATitle: string); + protected + procedure CreateParams(var Params: TCreateParams); override; + public + constructor Create(AOwner: TComponent); override; + property FilterControl: TcxCustomFilterControl read FFilterControl; + end; + +function cxInternalExecuteFilterControlDialog(AFilterControlClass: TcxCustomFilterControlClass; + ALink: TComponent; ALookAndFeel: TcxLookAndFeel; + AOnApplyProc: TNotifyEvent = nil; AOnShowDialog: TNotifyEvent = nil; + AColor: TColor = clDefault; const AInitialDir: string = ''; AFont: TFont = nil): Boolean; + +function ExecuteFilterControlDialog(ALinkComponent: TComponent; + ALookAndFeel: TcxLookAndFeel; AOnApplyProc: TNotifyEvent = nil; + AOnShowDialog: TNotifyEvent = nil; AColor: TColor = clDefault; + const AInitialDir: string = ''; AFont: TFont = nil): Boolean; + +const + cxFilterDialogPosition: TRect = + (Left: -1; Top: -1; // screen center + Right: -1; Bottom: -1); // BottomRight as TSize + +implementation + +{$R *.dfm} + +uses + cxClasses, cxFilterControlStrs, cxContainer; + +function cxInternalExecuteFilterControlDialog( + AFilterControlClass: TcxCustomFilterControlClass; + ALink: TComponent; ALookAndFeel: TcxLookAndFeel; + AOnApplyProc: TNotifyEvent = nil; AOnShowDialog: TNotifyEvent = nil; + AColor: TColor = clDefault; const AInitialDir: string = ''; AFont: TFont = nil): Boolean; +var + AForm: TfmFilterControlDialog; + AIntf: IcxFilterControlDialog; +begin + AForm := TfmFilterControlDialog.Create(Application); + with AForm do + try + FFilterControl := AFilterControlClass.Create(nil); + SetLookAndFeel(ALookAndFeel); + if AFont <> nil then + DialogApplyFont(AForm, AFont); + + if Supports(TObject(FFilterControl), IcxFilterControlDialog, AIntf) then + AIntf.SetDialogLinkComponent(ALink); + AIntf := nil; //force to clear interface + with FilterControl do + begin + if AColor <> clDefault then Color := AColor; + if ALookAndFeel.SkinPainter = nil then + SetPanelsColor(Color) + else + SetPanelsColor(ALookAndFeel.SkinPainter.DefaultContentColor); + OnApplyFilter := AOnApplyProc; + end; + Initialize(AInitialDir); + OnShow := AOnShowDialog; + Result := ShowModal = mrOk; + finally + FFilterControl.Free; + Free; + end; +end; + +function ExecuteFilterControlDialog(ALinkComponent: TComponent; + ALookAndFeel: TcxLookAndFeel; AOnApplyProc: TNotifyEvent = nil; + AOnShowDialog: TNotifyEvent = nil; AColor: TColor = clDefault; + const AInitialDir: string = ''; AFont: TFont = nil): Boolean; +begin + Result := cxInternalExecuteFilterControlDialog(TcxFilterControl, + ALinkComponent, ALookAndFeel, AOnApplyProc, AOnShowDialog, AColor, + AInitialDir, AFont); +end; + +{ TfmFilterControlDialog } + +constructor TfmFilterControlDialog.Create(AOwner: TComponent); +begin + inherited Create(AOwner); +{$IFDEF DELPHI8} + Position := poDesigned; +{$ENDIF} +end; + +procedure TfmFilterControlDialog.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); +// rollback CorrectDlgParams(Params); + Params.Style := Params.Style or WS_POPUP; // for PopupEdit placed on DockPanel +end; + +procedure TfmFilterControlDialog.Initialize(const AInitialDir: string); +begin + SetTitle(cxGetResourceString(@cxSFilterControlDialogNewFile)); + OpenDialog.InitialDir := AInitialDir; + OpenDialog.Title := cxGetResourceString(@cxSFilterControlDialogOpenDialogCaption); + OpenDialog.DefaultExt := cxGetResourceString(@cxSFilterControlDialogFileExt); + OpenDialog.Filter := cxGetResourceString(@cxSFilterControlDialogFileFilter); + SaveDialog.InitialDir := AInitialDir; + SaveDialog.Title := cxGetResourceString(@cxSFilterControlDialogSaveDialogCaption); + SaveDialog.DefaultExt := OpenDialog.DefaultExt; + SaveDialog.Filter := OpenDialog.Filter; + btSave.Caption := cxGetResourceString(@cxSFilterControlDialogActionSaveCaption); + btOpen.Caption := cxGetResourceString(@cxSFilterControlDialogActionOpenCaption); + btApply.Caption := cxGetResourceString(@cxSFilterControlDialogActionApplyCaption); + btOk.Caption := cxGetResourceString(@cxSFilterControlDialogActionOkCaption); + btCancel.Caption := cxGetResourceString(@cxSFilterControlDialogActionCancelCaption); + with FilterControl do + begin + Align := alClient; + Parent := Self; + end; + with cxFilterDialogPosition do + begin + if (Left = -1) or (Top = -1) then + Position := poScreenCenter + else + begin + Self.Left := Left; + Self.Top := Top; + end; + if Right > 0 then Width := Right; + if Bottom > 0 then Height := Bottom; + end; +end; + +procedure TfmFilterControlDialog.SetLookAndFeel( + ALookAndFeel: TcxLookAndFeel); +begin + if ALookAndFeel <> nil then + begin + btOk.LookAndFeel.MasterLookAndFeel := ALookAndFeel; + btCancel.LookAndFeel.MasterLookAndFeel := ALookAndFeel; + btApply.LookAndFeel.MasterLookAndFeel := ALookAndFeel; + btOpen.LookAndFeel.MasterLookAndFeel := ALookAndFeel; + btSave.LookAndFeel.MasterLookAndFeel := ALookAndFeel; + FilterControl.LookAndFeel.MasterLookAndFeel := ALookAndFeel; + end; +end; + +procedure TfmFilterControlDialog.SetPanelsColor(AColor: TColor); +begin + pnlBottom.Color := AColor; + pnlBottomRight.Color := AColor; +end; + +procedure TfmFilterControlDialog.SetTitle(const ATitle: string); +begin + SaveDialog.FileName := ATitle; + Caption := Format('%s - [%s]', [cxGetResourceString(@cxSFilterControlDialogCaption), ATitle]); +end; + +procedure TfmFilterControlDialog.acApplyExecute(Sender: TObject); +begin + FilterControl.ApplyFilter; +end; + +procedure TfmFilterControlDialog.acOkExecute(Sender: TObject); +begin + FilterControl.ApplyFilter; +end; + +procedure TfmFilterControlDialog.acOpenExecute(Sender: TObject); +begin + OpenDialog.FileName := ''; + if OpenDialog.Execute then + begin + FilterControl.LoadFromFile(OpenDialog.FileName); + SetTitle(OpenDialog.FileName); + end; +end; + +procedure TfmFilterControlDialog.acSaveExecute(Sender: TObject); +begin + if SaveDialog.Execute then + begin + FilterControl.SaveToFile(SaveDialog.FileName); + SetTitle(SaveDialog.FileName); + end; +end; + +procedure TfmFilterControlDialog.FormClose(Sender: TObject; + var Action: TCloseAction); +begin + cxFilterDialogPosition := Rect(Left, Top, Width, Height); +end; + +procedure TfmFilterControlDialog.FormKeyPress(Sender: TObject; + var Key: Char); +begin + if (Key = #27) and not FHasOpenedPopupWindow then + Close; +end; + +procedure TfmFilterControlDialog.FormKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + FHasOpenedPopupWindow := HasOpenedPopupWindow(ActiveControl); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxFilterControlReg.dcr b/official/x.35/ExpressEditors Library 5/Sources/cxFilterControlReg.dcr new file mode 100644 index 00000000..8791bda1 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Sources/cxFilterControlReg.dcr differ diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxFilterControlReg.pas b/official/x.35/ExpressEditors Library 5/Sources/cxFilterControlReg.pas new file mode 100644 index 00000000..a6210dc4 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxFilterControlReg.pas @@ -0,0 +1,233 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressFilterControl } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxFilterControlReg; + +{$I cxVer.inc} + +interface + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI6} + DesignEditors, DesignIntf, VCLEditors, +{$ELSE} + DsgnIntf, +{$ENDIF} + DB, TypInfo, SysUtils, Classes, Controls, cxClasses, cxFilterControl, + cxDBFilterControl, cxEdit, cxEditRepositoryItems, cxEditPropEditors; + +type + { TcxFilterItemPropertiesProperty } + + TcxFilterItemPropertiesProperty = class(TClassProperty) + protected + function HasSubProperties: Boolean; + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + { TcxFilterControlLinkSourceProperty } + + TcxFilterControlLinkComponentProperty = class(TComponentProperty) + private + FCheckProc: TGetStrProc; + procedure CheckComponent(const Value: string); + public + procedure GetValues(Proc: TGetStrProc); override; + end; + +{$IFDEF DELPHI6} + TcxDBFilterControlSelectionEditor = class(TSelectionEditor) + protected + ComponentsList: TStringList; + public + procedure AddComponent(const Name: string); + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + +procedure TcxDBFilterControlSelectionEditor.AddComponent(const Name: string); +begin + ComponentsList.Add(Name); +end; + +procedure TcxDBFilterControlSelectionEditor.RequiresUnits(Proc: TGetStrProc); + + procedure AddPropertiesUnitName(AProperties: TcxCustomEditProperties); + begin + if AProperties <> nil then + Proc(GetTypeData(PTypeinfo(AProperties.ClassType.ClassInfo))^.UnitName); + end; + +var + AComponent: TComponent; + I, J: Integer; +begin + inherited RequiresUnits(Proc); + ComponentsList := TStringList.Create; + try + Designer.GetComponentNames(GetTypeData(PTypeInfo(TcxDBFilterControl.ClassInfo)), AddComponent); + for I := 0 to ComponentsList.Count - 1 do + begin + AComponent := Designer.GetComponent(ComponentsList[I]); + if AComponent is TcxDBFilterControl then + with TcxDBFilterControl(AComponent) do + for J := 0 to Items.Count - 1 do + AddPropertiesUnitName(Items[J].Properties); + end; + finally + ComponentsList.Free; + end; +end; +{$ENDIF} + +{ TcxFilterItemPropertiesProperty } + +function TcxFilterItemPropertiesProperty.HasSubProperties: Boolean; +var + I: Integer; +begin + for I := 0 to PropCount - 1 do + begin + Result := TcxFilterItem(GetComponent(I)).Properties <> nil; + if not Result then Exit; + end; + Result := True; +end; + +function TcxFilterItemPropertiesProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes; + if not HasSubProperties then + Exclude(Result, paSubProperties); + Result := Result - [paReadOnly] + + [paValueList, paSortList, paRevertable{$IFDEF DELPHI6}, paVolatileSubProperties{$ENDIF}]; +end; + +function TcxFilterItemPropertiesProperty.GetValue: string; +begin + if HasSubProperties then + Result := GetRegisteredEditProperties.GetDescriptionByClass(TcxCustomEditProperties(GetOrdValue).ClassType) + else + Result := ''; +end; + +procedure TcxFilterItemPropertiesProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to GetRegisteredEditProperties.Count - 1 do + if IsSupportFiltering(TcxCustomEditPropertiesClass(GetRegisteredEditProperties[I])) then + Proc(GetRegisteredEditProperties.Descriptions[I]); +end; + +procedure TcxFilterItemPropertiesProperty.SetValue(const Value: string); +var + APropertiesClass: TcxCustomEditPropertiesClass; + I: Integer; +begin + APropertiesClass := TcxCustomEditPropertiesClass(GetRegisteredEditProperties.FindByClassName(Value)); + if APropertiesClass = nil then + APropertiesClass := TcxCustomEditPropertiesClass(GetRegisteredEditProperties.FindByDescription(Value)); + if (APropertiesClass = nil) or IsSupportFiltering(APropertiesClass) then + begin + for I := 0 to PropCount - 1 do + TcxFilterItem(GetComponent(I)).PropertiesClass := APropertiesClass; + Modified; + end; +end; + +{ TcxFilterControlLinkComponentProperty } + +procedure TcxFilterControlLinkComponentProperty.CheckComponent( + const Value: string); +var + AComponent: TComponent; +begin + AComponent := TComponent(Designer.GetComponent(Value)); + if (AComponent <> nil) and not Supports(AComponent, IcxFilterControl) then + Exit; + FCheckProc(Value); +end; + +procedure TcxFilterControlLinkComponentProperty.GetValues(Proc: TGetStrProc); +begin + FCheckProc := Proc; + inherited GetValues(CheckComponent); +end; + +type + TcxFilterControlItemFieldNameProperty = class(TFieldNameProperty) + public + function GetDataSource: TDataSource; override; + end; + +{ TcxFilterControlItemFieldNameProperty } + +function TcxFilterControlItemFieldNameProperty.GetDataSource: TDataSource; +begin + Result := TcxDBFilterControl(TcxFilterItem(GetComponent(0)).FilterControl).DataSource; +end; + +procedure Register; +begin + RegisterComponents('Dev Express', [TcxFilterControl, TcxDBFilterControl]); + RegisterComponentEditor(TcxCustomFilterControl, TcxFilterControlComponentEditor); + RegisterClasses([TcxFilterItem]); + RegisterPropertyEditor(TypeInfo(TComponent), TcxFilterControl, + 'LinkComponent', TcxFilterControlLinkComponentProperty); + RegisterPropertyEditor(TypeInfo(string), TcxFilterItem, 'FieldName', TcxFilterControlItemFieldNameProperty); + RegisterPropertyEditor(TypeInfo(string), TcxFilterItem, 'PropertiesClassName', nil); + RegisterPropertyEditor(TypeInfo(TcxCustomEditProperties), TcxFilterItem, + 'Properties', TcxFilterItemPropertiesProperty); +{$IFDEF DELPHI6} + RegisterSelectionEditor(TcxDBFilterControl, TcxDBFilterControlSelectionEditor); +{$ENDIF} +end; + +{$IFDEF DELPHI6} +initialization + StartClassGroup(TControl); + GroupDescendentsWith(TcxFilterControl, TControl); + GroupDescendentsWith(TcxDBFilterControl, TControl); + GroupDescendentsWith(TcxFilterItem, TControl); +{$ENDIF} + +end. + diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxFilterControlStrs.pas b/official/x.35/ExpressEditors Library 5/Sources/cxFilterControlStrs.pas new file mode 100644 index 00000000..a4fa383c --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxFilterControlStrs.pas @@ -0,0 +1,87 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressFilterControl } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxFilterControlStrs; + +{$I cxVer.inc} + +interface + +resourcestring + // cxFilterBoolOperator + cxSFilterBoolOperatorAnd = 'AND'; // all + cxSFilterBoolOperatorOr = 'OR'; // any + cxSFilterBoolOperatorNotAnd = 'NOT AND'; // not all + cxSFilterBoolOperatorNotOr = 'NOT OR'; // not any + // + cxSFilterRootButtonCaption = 'Filter'; + cxSFilterAddCondition = 'Add &Condition'; + cxSFilterAddGroup = 'Add &Group'; + cxSFilterRemoveRow = '&Remove Row'; + cxSFilterClearAll = 'Clear &All'; + cxSFilterFooterAddCondition = 'press the button to add a new condition'; + + cxSFilterGroupCaption = 'applies to the following conditions'; + cxSFilterRootGroupCaption = ''; + cxSFilterControlNullString = ''; + + cxSFilterErrorBuilding = 'Can''t build filter from source'; + + //FilterDialog + cxSFilterDialogCaption = 'Custom Filter'; + cxSFilterDialogInvalidValue = 'Invalid value'; + cxSFilterDialogUse = 'Use'; + cxSFilterDialogSingleCharacter = 'to represent any single character'; + cxSFilterDialogCharactersSeries = 'to represent any series of characters'; + cxSFilterDialogOperationAnd = 'AND'; + cxSFilterDialogOperationOr = 'OR'; + cxSFilterDialogRows = 'Show rows where:'; + + // FilterControlDialog + cxSFilterControlDialogCaption = 'Filter builder'; + cxSFilterControlDialogNewFile = 'untitled.flt'; + cxSFilterControlDialogOpenDialogCaption = 'Open an existing filter'; + cxSFilterControlDialogSaveDialogCaption = 'Save the active filter to file'; + cxSFilterControlDialogActionSaveCaption = '&Save As...'; + cxSFilterControlDialogActionOpenCaption = '&Open...'; + cxSFilterControlDialogActionApplyCaption = '&Apply'; + cxSFilterControlDialogActionOkCaption = 'OK'; + cxSFilterControlDialogActionCancelCaption = 'Cancel'; + cxSFilterControlDialogFileExt = 'flt'; + cxSFilterControlDialogFileFilter = 'Filters (*.flt)|*.flt'; + +implementation + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxFilterControlUtils.pas b/official/x.35/ExpressEditors Library 5/Sources/cxFilterControlUtils.pas new file mode 100644 index 00000000..41757f22 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxFilterControlUtils.pas @@ -0,0 +1,424 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressFilterControl } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxFilterControlUtils; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ELSE} + cxVariants, +{$ENDIF} + Classes, Controls, Forms, SysUtils, cxClasses, cxDataStorage, cxEdit, cxFilter; + +type + TcxFilterControlOperator = (fcoNone, fcoEqual, fcoNotEqual, fcoLess, + fcoLessEqual, fcoGreater, fcoGreaterEqual, fcoLike, fcoNotLike, + fcoBlanks, fcoNonBlanks, fcoBetween, fcoNotBetween, fcoInList, + fcoNotInList, fcoYesterday, fcoToday, fcoTomorrow, + fcoLast7Days, fcoLastWeek, fcoLast14Days, fcoLastTwoWeeks, fcoLast30Days, fcoLastMonth, fcoLastYear, fcoInPast, + fcoThisWeek, fcoThisMonth, fcoThisYear, + fcoNext7Days, fcoNextWeek, fcoNext14Days, fcoNextTwoWeeks, fcoNext30Days, fcoNextMonth, fcoNextYear, fcoInFuture); + + TcxFilterControlOperators = set of TcxFilterControlOperator; + + EcxFilterControlError = class(Exception); + + { TcxCustomFilterEditHelper } + + TcxCustomFilterEditHelper = class + protected + class procedure ClearPropertiesEvents(AProperties: TcxCustomEditProperties); virtual; + class procedure InitializeEdit(AEdit: TcxCustomEdit; + AEditProperties: TcxCustomEditProperties); virtual; + class function IsIDefaultValuesProviderNeeded( + AEditProperties: TcxCustomEditProperties): Boolean; virtual; + public + class function EditPropertiesHasButtons: Boolean; virtual; + class function GetFilterEdit(AEditProperties: TcxCustomEditProperties; + AInplaceEditList: TcxInplaceEditList = nil): TcxCustomEdit; + class function GetFilterEditClass: TcxCustomEditClass; virtual; + class procedure GetFilterValue(AEdit: TcxCustomEdit; + AEditProperties: TcxCustomEditProperties; var V: Variant; var S: TCaption); virtual; + class function GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; virtual; + class procedure InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); virtual; + class function IsValueValid(AValueTypeClass: TcxValueTypeClass; + var AValue: Variant): Boolean; virtual; + class procedure SetFilterValue(AEdit: TcxCustomEdit; + AEditProperties: TcxCustomEditProperties; AValue: Variant); virtual; + class function UseDisplayValue: Boolean; virtual; + end; + + TcxCustomFilterEditHelperClass = class of TcxCustomFilterEditHelper; + + { TcxFilterEditsController } + + TcxFilterEditsController = class(TcxRegisteredClassList) + private + function GetItemClass(AItemClass: TClass): TClass; + public + function FindHelper(APropertiesClass: TClass): TcxCustomFilterEditHelperClass; + procedure Register(AItemClass, ARegisteredClass: TClass); override; + procedure Unregister(AItemClass, ARegisteredClass: TClass); override; + end; + +function GetFilterOperatorKind(AOperator: TcxFilterControlOperator): TcxFilterOperatorKind; +function GetFilterControlOperator(AOperatorKind: TcxFilterOperatorKind; AIsNull: Boolean): TcxFilterControlOperator; + +procedure CorrectDlgParams(var Params: TCreateParams); +procedure FilterControlError(const Msg: string); +procedure FilterControlValidateValue(AEdit: TcxCustomEdit; var AValue: Variant; + AOperator: TcxFilterControlOperator; AValueTypeClass: TcxValueTypeClass; + AFilterEditHelper: TcxCustomFilterEditHelperClass); +function FilterEditsController: TcxFilterEditsController; +function GetFilterControlOperatorText(AOperator: TcxFilterControlOperator): string; + +implementation + +uses + cxFilterConsts, cxFilterControlStrs; + +var + FController: TcxFilterEditsController; + +function GetFilterOperatorKind(AOperator: TcxFilterControlOperator): TcxFilterOperatorKind; +const + OperatorMap: array[TcxFilterControlOperator] of TcxFilterOperatorKind = ( + foEqual, foEqual, foNotEqual, foLess, foLessEqual, + foGreater, foGreaterEqual, foLike, foNotLike, + foEqual, foNotEqual, // blank - non blank + foBetween, foNotBetween, foInList, foNotInList, foYesterday, foToday, foTomorrow, + foLast7Days, foLastWeek, foLast14Days, foLastTwoWeeks, foLast30Days, foLastMonth, foLastYear, foInPast, + foThisWeek, foThisMonth, foThisYear, + foNext7Days, foNextWeek, foNext14Days, foNextTwoWeeks, foNext30Days, foNextMonth, foNextYear, foInFuture); +begin + Result := OperatorMap[AOperator]; +end; + +function GetFilterControlOperator(AOperatorKind: TcxFilterOperatorKind; AIsNull: Boolean): TcxFilterControlOperator; +const + OperatorKindMap: array[TcxFilterOperatorKind] of TcxFilterControlOperator = ( + fcoEqual, fcoNotEqual, fcoLess, fcoLessEqual, fcoGreater, fcoGreaterEqual, + fcoLike, fcoNotLike, fcoBetween, fcoNotBetween, fcoInList, fcoNotInList, + fcoYesterday, fcoToday, fcoTomorrow, + fcoLast7Days, fcoLastWeek, fcoLast14Days, fcoLastTwoWeeks, fcoLast30Days, fcoLastMonth, fcoLastYear, fcoInPast, + fcoThisWeek, fcoThisMonth, fcoThisYear, + fcoNext7Days, fcoNextWeek, fcoNext14Days, fcoNextTwoWeeks, fcoNext30Days, fcoNextMonth, fcoNextYear, fcoInFuture); + ExtOperatorKindMap: array[Boolean] of TcxFilterControlOperator = + (fcoNonBlanks, fcoBlanks); +begin + Result := OperatorKindMap[AOperatorKind]; + if (Result in [fcoEqual, fcoNotEqual]) and AIsNull then + Result := ExtOperatorKindMap[Result = fcoEqual]; +end; + +procedure CorrectDlgParams(var Params: TCreateParams); +var + I: Integer; + AActiveForm: TForm; +begin + AActiveForm := Screen.ActiveForm; + if AActiveForm <> nil then + begin + for I := 0 to Screen.FormCount - 1 do + if (Screen.Forms[I] <> AActiveForm) and (Screen.Forms[I].FormStyle = fsStayOnTop) then + begin + AActiveForm := nil; + break; + end; + end; + if AActiveForm <> nil then + Params.WndParent := AActiveForm.Handle; +end; + +procedure FilterControlError(const Msg: string); +begin + raise EcxFilterControlError.Create(Msg); +end; + +procedure FilterControlValidateValue(AEdit: TcxCustomEdit; var AValue: Variant; + AOperator: TcxFilterControlOperator; AValueTypeClass: TcxValueTypeClass; + AFilterEditHelper: TcxCustomFilterEditHelperClass); +var + AError: Boolean; +begin + if AValueTypeClass = nil then + Exit; + if VarIsStr(AValue) and (AValue = '') and not AValueTypeClass.IsString then + AValue := Null; + if VarIsNull(AValue) or (AOperator in [fcoLike, fcoNotLike]) then + Exit; + AError := True; + try + AError := not AFilterEditHelper.IsValueValid(AValueTypeClass, AValue); + finally + if AError then + begin + FilterControlError(cxGetResourceString(@cxSFilterDialogInvalidValue)); + AEdit.EditModified := True; + if (AEdit <> nil) and AEdit.CanFocusEx then + AEdit.SetFocus; + end; + end; +end; + +function FilterEditsController: TcxFilterEditsController; +begin + if FController = nil then + FController := TcxFilterEditsController.Create; + Result := FController; +end; + +function GetFilterControlOperatorText(AOperator: TcxFilterControlOperator): string; +begin + case AOperator of + fcoEqual: + Result := cxGetResourceString(@cxSFilterOperatorEqual); + fcoNotEqual: + Result := cxGetResourceString(@cxSFilterOperatorNotEqual); + fcoLess: + Result := cxGetResourceString(@cxSFilterOperatorLess); + fcoLessEqual: + Result := cxGetResourceString(@cxSFilterOperatorLessEqual); + fcoGreater: + Result := cxGetResourceString(@cxSFilterOperatorGreater); + fcoGreaterEqual: + Result := cxGetResourceString(@cxSFilterOperatorGreaterEqual); + fcoLike: + Result := cxGetResourceString(@cxSFilterOperatorLike); + fcoNotLike: + Result := cxGetResourceString(@cxSFilterOperatorNotLike); + fcoBlanks: + Result := cxGetResourceString(@cxSFilterOperatorIsNull); + fcoNonBlanks: + Result := cxGetResourceString(@cxSFilterOperatorIsNotNull); + fcoBetween: + Result := cxGetResourceString(@cxSFilterOperatorBetween); + fcoNotBetween: + Result := cxGetResourceString(@cxSFilterOperatorNotBetween); + fcoInList: + Result := cxGetResourceString(@cxSFilterOperatorInList); + fcoNotInList: + Result := cxGetResourceString(@cxSFilterOperatorNotInList); + //date + fcoYesterday: + Result := cxGetResourceString(@cxSFilterOperatorYesterday); + fcoToday: + Result := cxGetResourceString(@cxSFilterOperatorToday); + fcoTomorrow: + Result := cxGetResourceString(@cxSFilterOperatorTomorrow); + fcoLast7Days: + Result := cxGetResourceString(@cxSFilterOperatorLast7Days); + fcoLastWeek: + Result := cxGetResourceString(@cxSFilterOperatorLastWeek); + fcoLast14Days: + Result := cxGetResourceString(@cxSFilterOperatorLast14Days); + fcoLastTwoWeeks: + Result := cxGetResourceString(@cxSFilterOperatorLastTwoWeeks); + fcoLast30Days: + Result := cxGetResourceString(@cxSFilterOperatorLast30Days); + fcoLastMonth: + Result := cxGetResourceString(@cxSFilterOperatorLastMonth); + fcoLastYear: + Result := cxGetResourceString(@cxSFilterOperatorLastYear); + fcoInPast: + Result := cxGetResourceString(@cxSFilterOperatorPast); + fcoThisWeek: + Result := cxGetResourceString(@cxSFilterOperatorThisWeek); + fcoThisMonth: + Result := cxGetResourceString(@cxSFilterOperatorThisMonth); + fcoThisYear: + Result := cxGetResourceString(@cxSFilterOperatorThisYear); + fcoNext7Days: + Result := cxGetResourceString(@cxSFilterOperatorNext7Days); + fcoNextWeek: + Result := cxGetResourceString(@cxSFilterOperatorNextWeek); + fcoNext14Days: + Result := cxGetResourceString(@cxSFilterOperatorNext14Days); + fcoNextTwoWeeks: + Result := cxGetResourceString(@cxSFilterOperatorNextTwoWeeks); + fcoNext30Days: + Result := cxGetResourceString(@cxSFilterOperatorNext30Days); + fcoNextMonth: + Result := cxGetResourceString(@cxSFilterOperatorNextMonth); + fcoNextYear: + Result := cxGetResourceString(@cxSFilterOperatorNextYear); + fcoInFuture: + Result := cxGetResourceString(@cxSFilterOperatorFuture); + else + Result := ''; + end; +end; + +{ TcxCustomFilterEditHelper } + +class procedure TcxCustomFilterEditHelper.ClearPropertiesEvents( + AProperties: TcxCustomEditProperties); +begin + if AProperties = nil then Exit; + with AProperties do + begin + OnValidate := nil; + OnEditValueChanged := nil; + OnChange := nil; + OnButtonClick := nil; + end; +end; + +class procedure TcxCustomFilterEditHelper.InitializeEdit(AEdit: TcxCustomEdit; + AEditProperties: TcxCustomEditProperties); +begin + InitializeProperties(AEdit.ActiveProperties, AEditProperties, + EditPropertiesHasButtons); +end; + +class function TcxCustomFilterEditHelper.IsIDefaultValuesProviderNeeded( + AEditProperties: TcxCustomEditProperties): Boolean; +begin + Result := True; +end; + +class function TcxCustomFilterEditHelper.EditPropertiesHasButtons: Boolean; +begin + Result := False; +end; + +class function TcxCustomFilterEditHelper.GetFilterEdit(AEditProperties: TcxCustomEditProperties; + AInplaceEditList: TcxInplaceEditList = nil): TcxCustomEdit; +begin + if AInplaceEditList = nil then + Result := GetFilterEditClass.Create(nil) + else + Result := AInplaceEditList.GetEdit(TcxCustomEditPropertiesClass(GetFilterEditClass.GetPropertiesClass)); + InitializeEdit(Result, AEditProperties); +end; + +class procedure TcxCustomFilterEditHelper.GetFilterValue(AEdit: TcxCustomEdit; + AEditProperties: TcxCustomEditProperties; var V: Variant; var S: TCaption); +begin + V := AEdit.EditValue; + S := AEditProperties.GetDisplayText(V); +end; + +class function TcxCustomFilterEditHelper.GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; +begin + if AExtendedSet then + Result := [fcoEqual..fcoNotInList] + else + Result := [fcoEqual..fcoNonBlanks]; + if (AValueTypeClass = nil) or not AValueTypeClass.IsString then + Result := Result - [fcoLike, fcoNotLike]; +end; + +class function TcxCustomFilterEditHelper.GetFilterEditClass: TcxCustomEditClass; +begin + Result := nil; +end; + +class procedure TcxCustomFilterEditHelper.InitializeProperties( + AProperties, AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); +begin + with AProperties do + begin + Assign(AEditProperties); + Alignment.Horz := taLeftJustify; + Alignment.Vert := taTopJustify; + BeepOnError := False; + if not AHasButtons then + Buttons.Clear; + ReadOnly := False; + ValidateOnEnter := True; + if not Self.IsIDefaultValuesProviderNeeded(AEditProperties) then + IDefaultValuesProvider := nil; + end; + ClearPropertiesEvents(AProperties); +end; + +class function TcxCustomFilterEditHelper.IsValueValid(AValueTypeClass: TcxValueTypeClass; + var AValue: Variant): Boolean; +begin + Result := AValueTypeClass.IsValueValid(AValue); +end; + +class procedure TcxCustomFilterEditHelper.SetFilterValue(AEdit: TcxCustomEdit; + AEditProperties: TcxCustomEditProperties; AValue: Variant); +begin +end; + +class function TcxCustomFilterEditHelper.UseDisplayValue: Boolean; +begin + Result := False; +end; + +{ TcxFilterEditsController } + +function TcxFilterEditsController.GetItemClass( + AItemClass: TClass): TClass; +begin + Result := AItemClass.ClassParent; +end; + +function TcxFilterEditsController.FindHelper( + APropertiesClass: TClass): TcxCustomFilterEditHelperClass; +begin + Result := TcxCustomFilterEditHelperClass(FindClass(GetItemClass(APropertiesClass))); +end; + +procedure TcxFilterEditsController.Register(AItemClass, + ARegisteredClass: TClass); +begin + inherited Register(GetItemClass(AItemClass), ARegisteredClass); +end; + +procedure TcxFilterEditsController.Unregister(AItemClass, + ARegisteredClass: TClass); +begin + inherited Unregister(GetItemClass(AItemClass), ARegisteredClass); + if Count = 0 then + FreeAndNil(FController); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxFontNameComboBox.pas b/official/x.35/ExpressEditors Library 5/Sources/cxFontNameComboBox.pas new file mode 100644 index 00000000..ccb1afde --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxFontNameComboBox.pas @@ -0,0 +1,2358 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxFontNameComboBox; + +interface + +{$I cxVer.inc} + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Classes, Controls, Dialogs, Forms, Graphics, Messages, Printers, + SysUtils, cxClasses, cxContainer, cxControls, cxGraphics, cxButtons, + cxDataStorage, cxVariants, + cxEdit, cxTextEdit, cxDropDownEdit, cxEditUtils, cxExtEditConsts, cxExtEditUtils, + cxImageComboBox, cxLookAndFeels, cxMaskEdit, cxFilterControlUtils; + +const + SYMBOL_FONTTYPE = 256; + FIXEDPITCH_FONTTYPE = 512; + +type + TcxFontType = (cxftTTF, cxftRaster, cxftDevice, cxftFixed, cxftSymbol); + TcxFontTypes = set of TcxFontType; + TcxShowFontIconType = (ftiShowInCombo, ftiShowInList); + TcxShowFontIconTypes = set of TcxShowFontIconType; + TcxMRUFontNameAction = (mfaInvalidFontName, mfaNone, mfaMoved, mfaAdded, mfaDeleted); + TcxFontPreviewType = (cxfpFontName, cxfpCustom, cxfpFullAlphabet); + TcxDeleteMRUFontEvent = procedure(Sender: TObject; const DeletedMRUFontName: string) of object; + + { TcxMRUFontNameItem } + + TcxMRUFontNameItem = class(TCollectionItem) + private + FFontName: TFontName; + FTag: TcxTag; + function IsTagStored: Boolean; + procedure SetFontName(const Value: TFontName); + public + procedure Assign(Source: TPersistent); override; + published + property FontName: TFontName read FFontName write SetFontName; + property Tag: TcxTag read FTag write FTag stored IsTagStored; + end; + + { TcxMRUFontNameItems } + + TcxMRUFontNameItems = class(TOwnedCollection) + private + function GetItems(Index: Integer): TcxMRUFontNameItem; + procedure SetItems(Index: Integer; const Value: TcxMRUFontNameItem); + protected + procedure Update(Item: TCollectionItem); override; + function Add: TcxMRUFontNameItem; + function Insert(Index: Integer): TcxMRUFontNameItem; + function AddMRUFontName(const AFontName: TFontName): TcxMRUFontNameItem; virtual; + function InsertMRUFontName(Index: Integer; const AFontName: TFontName): TcxMRUFontNameItem; virtual; + procedure Move(CurIndex, NewIndex: Integer); virtual; + public + constructor Create(AOwner: TPersistent; ItemClass: TCollectionItemClass); + destructor Destroy; override; + {$IFNDEF DELPHI6} + function Owner: TPersistent; + {$ENDIF} + property Items[Index: Integer]: TcxMRUFontNameItem read GetItems write SetItems; default; + function FindFontName(const AFontName: TFontName): TcxMRUFontNameItem; virtual; + end; + + { TcxFontLoader } + + TcxFontLoader = class(TThread) + private + FFontTypes: TcxFontTypes; + procedure DoCompleteEvent; + procedure DoDestroyEvent; + protected + procedure Execute; override; + public + OnCompleteThread: TNotifyEvent; + OnDestroyThread: TNotifyEvent; + FontList: TStringList; + constructor Create(const AFontTypes: TcxFontTypes); virtual; + destructor Destroy; override; + end; + + TcxFontButtonType = (cxfbtBold, cxfbtItalic, cxfbtUnderline, cxfbtStrikeOut); + TcxFontButtonClickEvent = procedure(Sender: TObject; ButtonType: TcxFontButtonType) of Object; + + { TcxFontPreview } + + TcxFontPreview = class(TPersistent) + private + FOwner: TPersistent; + FUpdateCount: Integer; + FOnChanged: TNotifyEvent; + FFontStyle: TFontStyles; + FModified: Boolean; + FIsDestroying: Boolean; + FVisible: Boolean; + FPreviewType: TcxFontPreviewType; + FPreviewText: TCaption; + FAlignment: TAlignment; + FShowEndEllipsis: Boolean; + FColor: TColor; + FWordWrap: Boolean; + FShowButtons: Boolean; + FOnButtonClick: TcxFontButtonClickEvent; + procedure BeginUpdate; + procedure EndUpdate; + function IsDestroying: Boolean; + procedure SetFontStyle(Value: TFontStyles); + procedure SetVisible(Value: Boolean); + procedure SetPreviewType(Value: TcxFontPreviewType); + procedure SetPreviewText(Value: TCaption); + procedure SetAlignment(Value: TAlignment); + procedure SetShowEndEllipsis(Value: Boolean); + procedure SetColor(Value: TColor); + procedure SetWordWrap(Value: Boolean); + procedure SetShowButtons(Value: Boolean); + protected + function GetOwner: TPersistent; override; + procedure Changed; virtual; + public + constructor Create(AOwner: TPersistent); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + published + property FontStyle: TFontStyles read FFontStyle write SetFontStyle default []; + property Visible: Boolean read FVisible write SetVisible default True; + property PreviewType: TcxFontPreviewType read FPreviewType write SetPreviewType default cxfpFontName; + property PreviewText: TCaption read FPreviewText write SetPreviewText; + property Alignment: TAlignment read FAlignment write SetAlignment default taCenter; + property ShowButtons: Boolean read FShowButtons write SetShowButtons default True; + property ShowEndEllipsis: Boolean read FShowEndEllipsis write SetShowEndEllipsis default True; + property Color: TColor read FColor write SetColor default clWindow; + property WordWrap: Boolean read FWordWrap write SetWordWrap default False; + property OnButtonClick: TcxFontButtonClickEvent read FOnButtonClick write FOnButtonClick; + end; + + { TcxFontPanelButton } + + TcxFontPanelButton = class(TcxButton) + protected + procedure WndProc(var Message: TMessage); override; + end; + + { TFontPreviewPanel } + + TFontPreviewPanel = class(TCustomControl) + private + FLocked: Boolean; + FcxCanvas: TcxCanvas; + FFontStyle: TFontStyles; + FAlignment: TAlignment; + FShowEndEllipsis: Boolean; + FEdges: TcxBorders; + FBorderColor: TColor; + FFontName: string; + FWordWrap: Boolean; + FShowButtons: Boolean; + FLookAndFeel: TcxLookAndFeel; + FBoldButton: TcxFontPanelButton; + FItalicButton: TcxFontPanelButton; + FUnderLineButton: TcxFontPanelButton; + FStrikeOutButton: TcxFontPanelButton; + procedure SetLocked(Value: Boolean); + procedure SetAlignment(Value: TAlignment); + procedure SetShowEndEllipsis(Value: Boolean); + procedure SetEdges(Value: TcxBorders); + procedure SetFontName(Value: string); + procedure SetFontStyle(Value: TFontStyles); + procedure SetWordWrap(Value: Boolean); + procedure SetShowButtons(Value: Boolean); + procedure SetLookAndFeel(Value: TcxLookAndFeel); + function GetTextFlag(const AStartFlag: Longint): Longint; + procedure CreateButtons; + procedure SetFontStyleButtonsState; + procedure FontButtonsClickHandler(Sender: TObject); + protected + FontPreview: TcxFontPreview; + procedure Paint; override; + procedure CalculateFont(const ARect: TRect); virtual; + function CalculateFontStyle: TFontStyles; virtual; + property cxCanvas: TcxCanvas read FcxCanvas write FcxCanvas; + property Locked: Boolean read FLocked write SetLocked default False; + public + property BorderColor: TColor read FBorderColor write FBorderColor; + property Color default clWindow; + property Alignment: TAlignment read FAlignment write SetAlignment default taCenter; + property ShowEndEllipsis: Boolean read FShowEndEllipsis write SetShowEndEllipsis default True; + property Edges: TcxBorders read FEdges write SetEdges default [bLeft, bTop, bRight, bBottom]; + property FontStyle: TFontStyles read FFontStyle write SetFontStyle default []; + property FontName: string read FFontName write SetFontName; + property WordWrap: Boolean read FWordWrap write SetWordWrap default False; + property ShowButtons: Boolean read FShowButtons write SetShowButtons default True; + property LookAndFeel: TcxLookAndFeel read FLookAndFeel write SetLookAndFeel; + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure RealignButtons; + end; + + { TcxCustomFontNameComboBoxViewInfo } + + TcxCustomFontNameComboBoxViewInfo = class(TcxCustomTextEditViewInfo) + private + FCurrentIndex: Integer; + FIsTrueTypeFont: Boolean; + ImageRect: TRect; + FShowFontTypeIcon: TcxShowFontIconTypes; + protected + SaveClient: TRect; + property IsTrueTypeFont: Boolean read FIsTrueTypeFont write FIsTrueTypeFont; + property ShowFontTypeIcon: TcxShowFontIconTypes read FShowFontTypeIcon write FShowFontTypeIcon; + public + procedure Paint(ACanvas: TcxCanvas); override; + procedure Offset(DX, DY: Integer); override; + end; + + { TcxCustomFontNameComboBoxViewData } + + TcxCustomFontNameComboBoxProperties = class; + + TcxCustomFontNameComboBoxViewData = class(TcxCustomDropDownEditViewData) + private + function GetProperties: TcxCustomFontNameComboBoxProperties; + protected + function IsComboBoxStyle: Boolean; override; + public + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; + const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); override; + procedure DisplayValueToDrawValue(const ADisplayValue: TcxEditValue; + AViewInfo: TcxCustomEditViewInfo); override; + procedure EditValueToDrawValue(ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + AViewInfo: TcxCustomEditViewInfo); override; + function GetEditContentSize(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; + const AEditSizeProperties: TcxEditSizeProperties): TSize; override; + property Properties: TcxCustomFontNameComboBoxProperties + read GetProperties; + end; + + { TcxFontNameComboBoxListBox } + + TcxCustomFontNameComboBox = class; + + TcxFontNameComboBoxListBox = class(TcxCustomComboBoxListBox) + private + function GetEdit: TcxCustomFontNameComboBox; + function IsSymbolFontType(AItemIndex: Integer): Boolean; + protected + function GetItem(Index: Integer): string; override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); override; + property Edit: TcxCustomFontNameComboBox read GetEdit; + public + function GetItemHeight(AIndex: Integer = -1): Integer; override; + function GetItemWidth(AIndex: Integer): Integer; override; + end; + + { TcxFontNameComboBoxLookupData } + + TcxFontNameComboBoxLookupData = class(TcxComboBoxLookupData) + private + FPanel: TFontPreviewPanel; + function GetFontName: string; + function GetPreviewText: string; + protected + function GetListBoxClass: TcxCustomEditListBoxClass; override; + procedure HandleSelectItem(Sender: TObject); override; + procedure InternalChangeCurrentMRUFontNamePosition; virtual; + public + destructor Destroy; override; + function CanResizeVisualArea(var NewSize: TSize; + AMaxHeight: Integer = 0; AMaxWidth: Integer = 0): Boolean; override; + function GetVisualAreaPreferredSize(AMaxHeight: Integer; AWidth: Integer = 0): TSize; override; + procedure Initialize(AVisualControlsParent: TWinControl); override; + procedure PositionVisualArea(const AClientRect: TRect); override; + end; + + { TcxCustomFontNameComboBoxProperties } + + TcxCustomFontNameComboBoxProperties = class(TcxCustomComboBoxProperties) + private + FFontLoader: TcxFontLoader; + FFontPreview: TcxFontPreview; + FFontTypes: TcxFontTypes; + FLoadFontComplete: Boolean; + FMaxMRUFonts: Byte; + FMRUFontNames: TcxMRUFontNameItems; + FShowFontTypeIcon: TcxShowFontIconTypes; + FUseOwnFont: Boolean; + FOnAddedMRUFont: TNotifyEvent; + FOnDeletedMRUFont: TcxDeleteMRUFontEvent; + FOnInternalLoadFontComplete: TNotifyEvent; + FOnLoadFontComplete: TNotifyEvent; + FOnMovedMRUFont: TNotifyEvent; + function GetFontItems: TStrings; + function GetFontTypes: TcxFontTypes; + function GetUseOwnFont: Boolean; + procedure SetMaxMRUFonts(Value: Byte); + procedure SetFontTypes(Value: TcxFontTypes); + procedure SetUseOwnFont(Value: Boolean); + procedure SetShowFontTypeIcon(Value: TcxShowFontIconTypes); + function FindItemByValue(const AEditValue: TcxEditValue): Integer; + procedure DeleteOverMRUFonts; + procedure FontLoaderCompleteHandler(Sender: TObject); + procedure FontLoaderDestroyHandler(Sender: TObject); + function GetItemTypes(Index: Integer): TcxFontTypes; + procedure SetFontPreview(Value: TcxFontPreview); + procedure ShutDownFontLoader; + protected + function FindLookupText(const AText: string): Boolean; override; + class function GetLookupDataClass: TcxInterfacedPersistentClass; override; + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + function AddMRUFontName( + const AFontName: TFontName): TcxMRUFontNameAction; virtual; + function DelMRUFontName( + const AFontName: TFontName): TcxMRUFontNameAction; virtual; + property ItemTypes[Index: Integer]: TcxFontTypes read GetItemTypes; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function CompareDisplayValues( + const AEditValue1, AEditValue2: TcxEditValue): Boolean; override; + class function GetContainerClass: TcxContainerClass; override; + procedure GetFontNameComboBoxDisplayValue(const AEditValue: TcxEditValue; + out AItemIndex: Integer; out AText: string); + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + property LoadFontComplete: Boolean read FLoadFontComplete; + procedure LoadFontNames; virtual; + procedure Update(AProperties: TcxCustomEditProperties); override; + property FontItems: TStrings read GetFontItems; + property MRUFontNames: TcxMRUFontNameItems read FMRUFontNames; + // !!! + property FontPreview: TcxFontPreview read FFontPreview write SetFontPreview; + property FontTypes: TcxFontTypes read GetFontTypes write SetFontTypes + default [cxftTTF, cxftRaster, cxftDevice, cxftFixed, cxftSymbol]; + property MaxMRUFonts: Byte read FMaxMRUFonts write SetMaxMRUFonts + default 10; + property ShowFontTypeIcon: TcxShowFontIconTypes read FShowFontTypeIcon + write SetShowFontTypeIcon default [ftiShowInCombo, ftiShowInList]; + property UseOwnFont: Boolean read GetUseOwnFont write SetUseOwnFont + default False; + property OnAddedMRUFont: TNotifyEvent read FOnAddedMRUFont + write FOnAddedMRUFont; + property OnDeletedMRUFont: TcxDeleteMRUFontEvent read FOnDeletedMRUFont + write FOnDeletedMRUFont; + property OnLoadFontComplete: TNotifyEvent read FOnLoadFontComplete + write FOnLoadFontComplete; + property OnMovedMRUFont: TNotifyEvent read FOnMovedMRUFont + write FOnMovedMRUFont; + end; + + { TcxFontNameComboBoxProperties } + + TcxFontNameComboBoxProperties = class(TcxCustomFontNameComboBoxProperties) + published + property Alignment; + property AssignedValues; + property BeepOnError; + property ButtonGlyph; + property CharCase; + property ClearKey; + property DropDownAutoWidth; + property DropDownRows; + property DropDownSizeable; + property DropDownWidth; + property FontPreview; + property FontTypes; + property HideSelection; + property ImeMode; + property ImeName; + property ImmediateDropDown; + property ImmediatePost; + property ImmediateUpdateText; + property ItemHeight; + property MaxMRUFonts; + property OEMConvert; + property PopupAlignment; + property PostPopupValueOnTab; + property ReadOnly; + property ShowFontTypeIcon; + property UseOwnFont; + property ValidateOnEnter; + property OnAddedMRUFont; + property OnChange; + property OnCloseUp; + property OnDeletedMRUFont; + property OnDrawItem; + property OnEditValueChanged; + property OnInitPopup; + property OnLoadFontComplete; + property OnMeasureItem; + property OnMovedMRUFont; + property OnNewLookupDisplayText; + property OnPopup; + property OnValidate; + end; + + { TcxCustomFontNameComboBoxInnerEdit } + + TcxCustomFontNameComboBoxInnerEdit = class(TcxCustomComboBoxInnerEdit); + + { TcxCustomFontNameComboBox } + + TcxCustomFontNameComboBox = class(TcxCustomComboBox) + private + FDontCheckModifiedWhenUpdatingMRUList: Boolean; + FFontNameQueue: string; + FNeedsUpdateMRUList: Boolean; + function GetFontName: string; + procedure SetFontName(Value: string); + function GetLookupData: TcxFontNameComboBoxLookupData; + function GetProperties: TcxCustomFontNameComboBoxProperties; + function GetActiveProperties: TcxCustomFontNameComboBoxProperties; + procedure SetProperties(Value: TcxCustomFontNameComboBoxProperties); + procedure InternalLoadFontCompleteHandler(Sender: TObject); + procedure UpdateMRUList; + protected + procedure AfterPosting; override; + procedure InternalSetEditValue(const Value: TcxEditValue; + AValidateEditValue: Boolean); override; + function GetInnerEditClass: TControlClass; override; + function GetPopupWindowClientPreferredSize: TSize; override; + procedure Initialize; override; + procedure InitializePopupWindow; override; + procedure CloseUp(AReason: TcxEditCloseUpReason); override; + procedure SetItemIndex(Value: Integer); override; + property LookupData: TcxFontNameComboBoxLookupData read GetLookupData; + public + {$IFDEF CBUILDER10} + constructor Create(AOwner: TComponent); override; + {$ENDIF} + function Deactivate: Boolean; override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + function AddMRUFontName(const AFontName: TFontName): TcxMRUFontNameAction; + function DelMRUFontName(const AFontName: TFontName): TcxMRUFontNameAction; + property ActiveProperties: TcxCustomFontNameComboBoxProperties + read GetActiveProperties; + property FontName: string read GetFontName write SetFontName; + property Properties: TcxCustomFontNameComboBoxProperties read GetProperties + write SetProperties; + end; + + { TcxFontNameComboBox } + + TcxFontNameComboBox = class(TcxCustomFontNameComboBox) + private + function GetActiveProperties: TcxFontNameComboBoxProperties; + function GetProperties: TcxFontNameComboBoxProperties; + procedure SetProperties(Value: TcxFontNameComboBoxProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxFontNameComboBoxProperties + read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxFontNameComboBoxProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Text; + property Visible; + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + + { TcxFilterFontNameComboBoxHelper } + + TcxFilterFontNameComboBoxHelper = class(TcxFilterComboBoxHelper) + public + class function GetFilterEditClass: TcxCustomEditClass; override; + class function GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; override; + end; + +var + FTrueTypeFontBitmap, FNonTrueTypeFontBitmap : TBitmap; + +procedure GetFontSizes(const AFontName: string; AFontSizes: TStrings); +function GetFontTypes(const AFontName: string): TcxFontTypes; +function RealFontTypeToCxTypes(const AFontType: Integer): TcxFontTypes; + +implementation + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + cxListBox; + +{$R cxFontNameComboBox.res} + +type + TCanvasAccess = class(TCanvas); + +const + DropDownListTextOffset = 2; + NUM_SIZES = 16; + caiFontSizes: array[0 .. NUM_SIZES - 1] of Integer = + (8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72); + cxFontPreviewPanelDefaultHeight = 38; + IconBorderWidth = 4; + IconTextOffset = 2; + ItemSymbolFontExampleOffset = 4; + +var + FFontList: TStringList; + FFontSizes: TStrings; + vbFtt : Boolean; + +function RealFontTypeToCxTypes(const AFontType: Integer): TcxFontTypes; +begin + Result := []; + if (AFontType and TRUETYPE_FONTTYPE) <> 0 then + Result := Result + [cxftTTF]; + if (AFontType and RASTER_FONTTYPE) <> 0 then + Result := Result + [cxftRaster]; + if (AFontType and DEVICE_FONTTYPE) <> 0 then + Result := Result + [cxftDevice]; + if (AFontType and FIXEDPITCH_FONTTYPE) <> 0 then + Result := Result + [cxftFixed]; + if (AFontType and SYMBOL_FONTTYPE) <> 0 then + Result := Result + [cxftSymbol]; +end; + +function IsValidFontCondition(AFontTypes: TcxFontTypes; + const ALogFont: TLogFont; AFontType: Integer): Boolean; +begin + Result := + ((cxftTTF in AFontTypes) and (AFontType and TRUETYPE_FONTTYPE = TRUETYPE_FONTTYPE)) or + ((cxftDevice in AFontTypes) and (AFontType and DEVICE_FONTTYPE = DEVICE_FONTTYPE)) or + ((cxftRaster in AFontTypes) and (AFontType and RASTER_FONTTYPE = RASTER_FONTTYPE)) or + ((cxftFixed in AFontTypes) and (ALogFont.lfPitchAndFamily and FIXED_PITCH = FIXED_PITCH)) or + ((cxftSymbol in AFontTypes) and (ALogFont.lfCharSet = SYMBOL_CHARSET)); +end; + +function EnumFontsProc(var ALogFont: TLogFont; var ATextMetric: TTextMetric; + AFontType: DWORD; AData: LPARAM): Integer; stdcall; +begin + if ALogFont.lfCharSet = SYMBOL_CHARSET then + AFontType := AFontType or SYMBOL_FONTTYPE; + if ALogFont.lfPitchAndFamily = FIXED_PITCH then + AFontType := AFontType or FIXEDPITCH_FONTTYPE; + FFontList.AddObject(ALogFont.lfFaceName, TObject(Integer(AFontType))); + Result := 0; +end; + +function EnumFontsProc2(AFontLoader: TcxFontLoader; const ALogFont: TLogFont; + AFontType: DWORD): Integer; +var + AFaceName: string; +begin + AFaceName := ALogFont.lfFaceName; + if (AFontLoader.FontList.IndexOf(AFaceName) = -1) and + IsValidFontCondition(AFontLoader.FFontTypes, ALogFont, AFontType) then + begin + if ALogFont.lfCharSet = SYMBOL_CHARSET then + AFontType := AFontType or SYMBOL_FONTTYPE; + if ALogFont.lfPitchAndFamily = FIXED_PITCH then + AFontType := AFontType or FIXEDPITCH_FONTTYPE; + AFontLoader.FontList.AddObject(AFaceName, TObject(Integer(AFontType))); + end; + if AFontLoader.Terminated then + Result := 0 + else + Result := 1; +end; + +function EnumFontsProc1(var ALogFont: TLogFont; + var ATextMetric: TTextMetric; AFontType: DWORD; + AData: LPARAM): Integer; stdcall; +begin + Result := EnumFontsProc2(TcxFontLoader(AData), ALogFont, AFontType); +end; + +procedure InitLogFont(var ALogFont: TLogFont; const AFontName: string); +begin + FillChar(ALogFont, SizeOf(ALogFont), 0); + StrPCopy(ALogFont.lfFaceName, AFontName); + ALogFont.lfCharset := DEFAULT_CHARSET; +end; + +function GetFontTypes(const AFontName: string): TcxFontTypes; + + procedure EnumFonts; + var + ADC: HDC; + ALogFont: TLogFont; + begin + ADC := GetDC(0); + try + InitLogFont(ALogFont, AFontName); + EnumFontFamiliesEx(ADC, ALogFont, @EnumFontsProc, 0, 0); + finally + ReleaseDC(0, ADC); + end; + end; + +begin + FFontList := TStringList.Create; + try + Result := []; + EnumFonts; + if FFontList.Count > 0 then + Result := RealFontTypeToCxTypes(Integer(FFontList.Objects[0])); + finally + FFontList.Free; + end; +end; + +function SetFontSizes(var ALogFont: TLogFont; var ATextMetric: TTextMetric; + AFontType: DWORD; AData: LPARAM): Integer; stdcall; +var + S: string; +begin + S := IntToStr(((ATextMetric.tmHeight - ATextMetric.tmInternalLeading) * 72 + + ATextMetric.tmDigitizedAspectX div 2) div ATextMetric.tmDigitizedAspectY); + if FFontSizes.IndexOf(S) = -1 then + FFontSizes.Add(S); + Result := 1; +end; + +function SetFTypeFlag(var ALogFont: TLogFont; var ATextMetric: TTextMetric; + AFontType: DWORD; AData: LPARAM): Integer; stdcall; +begin + vbFtt := (ATextMetric.tmPitchAndFamily and TMPF_TRUETYPE) = TMPF_TRUETYPE; + Result := 0; +end; + +procedure GetFontSizes(const AFontName: string; AFontSizes: TStrings); + + function IsTrueTypeFont(ADC: HDC; var ALogFont: TLogFont): Boolean; + begin + EnumFontFamiliesEx(ADC, ALogFont, @SetFTypeFlag, 0, 0); + Result := vbFtt; + end; + +var + ADC: HDC; + ALogFont: TLogFont; + I: Integer; +begin + ADC := GetDC(0); + try + InitLogFont(ALogFont, AFontName); + FFontSizes := AFontSizes; + FFontSizes.Clear; + if IsTrueTypeFont(ADC, ALogFont) then + for I := 0 to NUM_SIZES - 1 do + AFontSizes.Add(Format('%d',[caiFontSizes[I]])) + else + EnumFontFamiliesEx(ADC, ALogFont, @SetFontSizes, 0, 0); + finally + ReleaseDC(0, ADC); + end; +end; + +{ TcxFontLoader } + +constructor TcxFontLoader.Create(const AFontTypes: TcxFontTypes); +begin + FFontTypes := AFontTypes; + FontList := TStringList.Create; + inherited Create(True); + FreeOnTerminate := True; +end; + +destructor TcxFontLoader.Destroy; +begin + Synchronize(DoCompleteEvent); + if Assigned(FontList) then + FreeAndNil(FontList); + Synchronize(DoDestroyEvent); + inherited Destroy; +end; + +procedure TcxFontLoader.DoCompleteEvent; +begin + if Assigned(OnCompleteThread) then OnCompleteThread(Self); +end; + +procedure TcxFontLoader.DoDestroyEvent; +begin + if Assigned(OnDestroyThread) then OnDestroyThread(Self); +end; + +procedure TcxFontLoader.Execute; + + procedure EnumFonts; + var + ADC: HDC; + ALogFont: TLogFont; + begin + ADC := GetDC(0); + try + InitLogFont(ALogFont, ''); + EnumFontFamiliesEx(ADC, ALogFont, @EnumFontsProc1, LPARAM(Self), 0); + finally + ReleaseDC(0, ADC); + end; + end; + +begin + try + FontList.BeginUpdate; + FontList.Clear; + EnumFonts; + TStringList(FontList).Sort; + finally + FontList.EndUpdate; + end; +end; + +{ TcxFontPreview } + +constructor TcxFontPreview.Create(AOwner: TPersistent); +begin + inherited Create; + FOwner := AOwner; + FUpdateCount := 0; + FModified := False; + FFontStyle := []; + FVisible := True; + FPreviewType := cxfpFontName; + FPreviewText := ''; + FAlignment := taCenter; + FShowEndEllipsis := True; + FColor := clWindow; + FWordWrap := False; + FShowButtons := True; +end; + +destructor TcxFontPreview.Destroy; +begin + FIsDestroying := True; + inherited Destroy; +end; + +procedure TcxFontPreview.Assign(Source: TPersistent); +begin + if Source is TcxFontPreview then + begin + BeginUpdate; + try + with Source as TcxFontPreview do + begin + Self.Visible := Visible; + Self.FontStyle := FontStyle; + Self.PreviewType := PreviewType; + Self.PreviewText := PreviewText; + Self.Alignment := Alignment; + Self.ShowEndEllipsis := ShowEndEllipsis; + Self.Color := Color; + Self.WordWrap := WordWrap; + Self.ShowButtons := ShowButtons; + Self.OnButtonClick := OnButtonClick; + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +function TcxFontPreview.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +procedure TcxFontPreview.Changed; +begin + if FUpdateCount = 0 then + begin + if Assigned(FOnChanged) and not IsDestroying then + FOnChanged(Self); + FModified := False; + end + else + FModified := True; +end; + +procedure TcxFontPreview.BeginUpdate; +begin + Inc(FUpdateCount); +end; + +procedure TcxFontPreview.EndUpdate; +begin + if FUpdateCount <> 0 then + begin + Dec(FUpdateCount); + if FModified then Changed; + end; +end; + +function TcxFontPreview.IsDestroying: Boolean; +begin + Result := FIsDestroying; +end; + +procedure TcxFontPreview.SetFontStyle(Value: TFontStyles); +begin + if FFontStyle <> Value then + begin + FFontStyle := Value; + Changed; + end; +end; + +procedure TcxFontPreview.SetVisible(Value: Boolean); +begin + if FVisible <> Value then + begin + FVisible := Value; + Changed; + end; +end; + +procedure TcxFontPreview.SetPreviewType(Value: TcxFontPreviewType); +begin + if FPreviewType <> Value then + begin + FPreviewType := Value; + Changed; + end; +end; + +procedure TcxFontPreview.SetPreviewText(Value: TCaption); +begin + if FPreviewText <> Value then + begin + FPreviewText := Value; + Changed; + end; +end; + +procedure TcxFontPreview.SetAlignment(Value: TAlignment); +begin + if FAlignment <> Value then + begin + FAlignment := Value; + Changed; + end; +end; + +procedure TcxFontPreview.SetShowEndEllipsis(Value: Boolean); +begin + if FShowEndEllipsis <> Value then + begin + FShowEndEllipsis := Value; + Changed; + end; +end; + +procedure TcxFontPreview.SetColor(Value: TColor); +begin + if FColor <> Value then + begin + FColor := Value; + Changed; + end; +end; + +procedure TcxFontPreview.SetWordWrap(Value: Boolean); +begin + if FWordWrap <> Value then + begin + FWordWrap := Value; + Changed; + end; +end; + +procedure TcxFontPreview.SetShowButtons(Value: Boolean); +begin + if FShowButtons <> Value then + begin + FShowButtons := Value; + Changed; + end; +end; +{ TcxFontPreview } + +{ TcxFontPanelButton } +procedure TcxFontPanelButton.WndProc(var Message: TMessage); +begin + inherited; + case Message.Msg of + WM_LBUTTONDOWN, WM_LBUTTONUP: Dispatch(Message); + end; +end; + +{ TFontPreviewPanel } + +constructor TFontPreviewPanel.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := [csAcceptsControls, csCaptureMouse, csClickEvents, + csSetCaption, csOpaque, csDoubleClicks, csReplicatable]; + Width := 100; + Height := 40; + FAlignment := taCenter; + FShowEndEllipsis := True; + FShowButtons := True; + FEdges := [bLeft, bTop, bRight, bBottom]; + FBorderColor := clWindowFrame; + FWordWrap := False; + FFontStyle := []; + Color := clWindow; + UseDockManager := True; + FcxCanvas := TcxCanvas.Create(Canvas); + FLookAndFeel := TcxLookAndFeel.Create(Self); + CreateButtons; +end; + +destructor TFontPreviewPanel.Destroy; +begin + FreeAndNil(FStrikeOutButton); + FreeAndNil(FUnderLineButton); + FreeAndNil(FItalicButton); + FreeAndNil(FBoldButton); + FreeAndNil(FLookAndFeel); + FreeAndNil(FcxCanvas); + inherited; +end; + +procedure TFontPreviewPanel.CreateButtons; + + procedure InitButton(AButton: TcxFontPanelButton; const AButtonSize: TSize); + begin + AButton.Font.Name := 'Arial'; + AButton.Font.Size := 8; + AButton.Height := AButtonSize.cx; + AButton.LookAndFeel.MasterLookAndFeel := LookAndFeel; + AButton.UseSystemPaint := True; + AButton.Width := AButtonSize.cy; + AButton.Parent := Self; + AButton.OnClick := FontButtonsClickHandler; + end; + +var + AButtonSize: TSize; +begin + FBoldButton := TcxFontPanelButton.Create(Self); + + FBoldButton.Font.Name := 'Arial'; + FBoldButton.Font.Size := 8; + AButtonSize.cx := NonCanvasTextWidth(FBoldButton.Font, 'B') + 8; + AButtonSize.cy := NonCanvasTextHeight(FBoldButton.Font) + 2; + + FBoldButton.Caption := 'B'; + FBoldButton.Tag := 0; + InitButton(FBoldButton, AButtonSize); + + FItalicButton := TcxFontPanelButton.Create(Self); + FItalicButton.Caption := 'I'; + FItalicButton.Tag := 1; + InitButton(FItalicButton, AButtonSize); + + FUnderLineButton := TcxFontPanelButton.Create(Self); + FUnderLineButton.Caption := 'U'; + FUnderLineButton.Tag := 2; + InitButton(FUnderLineButton, AButtonSize); + + FStrikeOutButton := TcxFontPanelButton.Create(Self); + FStrikeOutButton.Caption := 'S'; + FStrikeOutButton.Tag := 3; + InitButton(FStrikeOutButton, AButtonSize); +end; + +procedure TFontPreviewPanel.RealignButtons; +begin + FBoldButton.Visible := ShowButtons; + FItalicButton.Visible := ShowButtons; + FUnderLineButton.Visible := ShowButtons; + FStrikeOutButton.Visible := ShowButtons; + if ShowButtons = True then + begin + FBoldButton.Top := Height - FBoldButton.Height - 2; + FItalicButton.Top := FBoldButton.Top; + FUnderLineButton.Top := FBoldButton.Top; + FStrikeOutButton.Top := FBoldButton.Top; + + FStrikeOutButton.Left := Width - FStrikeOutButton.Width - 1; + FUnderLineButton.Left := FStrikeOutButton.Left - FUnderLineButton.Width - 1; + FItalicButton.Left := FUnderLineButton.Left - FItalicButton.Width - 1; + FBoldButton.Left := FItalicButton.Left - FBoldButton.Width - 1; + end; +end; + +procedure TFontPreviewPanel.SetFontStyleButtonsState; +begin + if (fsBold in FFontStyle) then + begin + FBoldButton.Colors.Normal := GetLightSelColor; + FBoldButton.Font.Style := [fsBold]; + end + else + begin + FBoldButton.Colors.Normal := clDefault; + FBoldButton.Font.Style := []; + end; + if (fsItalic in FFontStyle) then + begin + FItalicButton.Colors.Normal := GetLightSelColor; + FItalicButton.Font.Style := [fsBold]; + end + else + begin + FItalicButton.Colors.Normal := clDefault; + FItalicButton.Font.Style := []; + end; + if (fsUnderLine in FFontStyle) then + begin + FUnderLineButton.Colors.Normal := GetLightSelColor; + FUnderLineButton.Font.Style := [fsBold]; + end + else + begin + FUnderLineButton.Colors.Normal := clDefault; + FUnderLineButton.Font.Style := []; + end; + if (fsStrikeOut in FFontStyle) then + begin + FStrikeOutButton.Colors.Normal := GetLightSelColor; + FStrikeOutButton.Font.Style := [fsBold]; + end + else + begin + FStrikeOutButton.Colors.Normal := clDefault; + FStrikeOutButton.Font.Style := []; + end; +end; + +procedure TFontPreviewPanel.Paint; +var + FRect: TRect; +begin + FRect := GetClientRect; + with cxCanvas do + begin + Brush.Color := Color; + FillRect(FRect); + DrawComplexFrame(FRect, FBorderColor, FBorderColor, FEdges); + InflateRect(FRect, -2, -2); + Brush.Style := bsClear; + CalculateFont(FRect); + cxDrawText(Canvas.Handle, Caption, FRect, GetTextFlag(DT_NOPREFIX)); + end; +end; + +procedure TFontPreviewPanel.CalculateFont(const ARect: TRect); +var + FTextRect: TRect; +begin + if FontName = '' then + Canvas.Font.Name := 'Arial' + else + Canvas.Font.Name := FontName; + Canvas.Font.Size := 8; + Canvas.Font.Style := CalculateFontStyle; + if Trim(Caption) = '' then Exit; + FTextRect := Rect(ARect.Left, ARect.Top, ARect.Right - 1, ARect.Top + 1); + while (RectHeight(FTextRect) <= RectHeight(ARect)) and + (RectWidth(FTextRect) <= RectWidth(ARect)) do + begin + DrawText(Canvas.Handle, PChar(Caption), + Length(Caption), FTextRect, GetTextFlag(DT_CALCRECT or DT_NOPREFIX)); + if (RectHeight(FTextRect) <= RectHeight(ARect)) and + (RectWidth(FTextRect) <= RectWidth(ARect)) then + Canvas.Font.Size := Canvas.Font.Size + 1 + else + if Canvas.Font.Size > 8 then + Canvas.Font.Size := Canvas.Font.Size - 1; + end; +end; + +function TFontPreviewPanel.GetTextFlag(const AStartFlag: Longint): Longint; +const + ShowEndEllipsisArray: array[Boolean] of Integer = (0, DT_END_ELLIPSIS); + WordWrapArray: array[Boolean] of Integer = (0, DT_WORDBREAK); +begin + Result := AStartFlag or SystemAlignmentsHorz[Alignment] or DT_VCENTER or + ShowEndEllipsisArray[ShowEndEllipsis] or WordWrapArray[WordWrap]; +end; + +function TFontPreviewPanel.CalculateFontStyle: TFontStyles; +begin + Result := FFontStyle; +end; + +procedure TFontPreviewPanel.FontButtonsClickHandler(Sender: TObject); +begin + case (TComponent(Sender).Tag) of + 0: if (fsBold in FFontStyle) then + FFontStyle := FFontStyle - [fsBold] + else + FFontStyle := FFontStyle + [fsBold]; + 1: if (fsItalic in FFontStyle) then + FFontStyle := FFontStyle - [fsItalic] + else + FFontStyle := FFontStyle + [fsItalic]; + 2: if (fsUnderLine in FFontStyle) then + FFontStyle := FFontStyle - [fsUnderLine] + else + FFontStyle := FFontStyle + [fsUnderLine]; + 3: if (fsStrikeOut in FFontStyle) then + FFontStyle := FFontStyle - [fsStrikeOut] + else + FFontStyle := FFontStyle + [fsStrikeOut]; + end; + + FontPreview.FontStyle := FFontStyle; + if Assigned(FontPreview.OnButtonClick) then + FontPreview.OnButtonClick(Self, TcxFontButtonType((Sender as TComponent).Tag)); + + if TcxFontPanelButton(Sender).Colors.Normal <> clDefault then + begin + TcxFontPanelButton(Sender).Colors.Normal := clDefault; + TcxFontPanelButton(Sender).Font.Style := []; + end else + begin + TcxFontPanelButton(Sender).Colors.Normal := GetLightSelColor; + TcxFontPanelButton(Sender).Font.Style := [fsBold]; + end; + + Invalidate; +end; + +procedure TFontPreviewPanel.SetLocked(Value: Boolean); +begin + FLocked := Value; + if FLocked = False then Invalidate; +end; + +procedure TFontPreviewPanel.SetAlignment(Value: TAlignment); +begin + FAlignment := Value; + if FLocked = False then Invalidate; +end; + +procedure TFontPreviewPanel.SetShowEndEllipsis(Value: Boolean); +begin + FShowEndEllipsis := Value; + if FLocked = False then Invalidate; +end; + +procedure TFontPreviewPanel.SetEdges(Value: TcxBorders); +begin + FEdges := Value; + if FLocked = False then Invalidate; +end; + +procedure TFontPreviewPanel.SetFontName(Value: string); +begin + FFontName := Value; + if FLocked = False then Invalidate; +end; + +procedure TFontPreviewPanel.SetFontStyle(Value: TFontStyles); +begin + FFontStyle := Value; + SetFontStyleButtonsState; +end; + +procedure TFontPreviewPanel.SetWordWrap(Value: Boolean); +begin + FWordWrap := Value; + if FLocked = False then Invalidate; +end; + +procedure TFontPreviewPanel.SetShowButtons(Value: Boolean); +begin + if FShowButtons <> Value then + begin + FShowButtons := Value; + RealignButtons; + end; +end; + +procedure TFontPreviewPanel.SetLookAndFeel(Value: TcxLookAndFeel); +begin + FLookAndFeel.Assign(Value); + RealignButtons; +end; + +{ TcxMRUFontNameItem } + +procedure TcxMRUFontNameItem.Assign(Source: TPersistent); +begin + if Source is TcxMRUFontNameItem then + begin + FontName := TcxMRUFontNameItem(Source).FontName; + Tag := TcxMRUFontNameItem(Source).Tag; + end + else + inherited Assign(Source); +end; + +function TcxMRUFontNameItem.IsTagStored: Boolean; +begin + Result := FTag <> 0; +end; + +procedure TcxMRUFontNameItem.SetFontName(const Value: TFontName); +begin + if FFontName <> Value then + begin + FFontName := Value; + Changed(True); + end; +end; + +{ TcxMRUFontNameItems } + +constructor TcxMRUFontNameItems.Create(AOwner: TPersistent; ItemClass: TCollectionItemClass); +begin + inherited Create(AOwner, ItemClass); +end; + +destructor TcxMRUFontNameItems.Destroy; +begin + inherited Destroy; +end; + +function TcxMRUFontNameItems.GetItems(Index: Integer): TcxMRUFontNameItem; +begin + Result := TcxMRUFontNameItem(inherited Items[Index]); +end; + +procedure TcxMRUFontNameItems.SetItems(Index: Integer; const Value: TcxMRUFontNameItem); +begin + inherited Items[Index] := Value; +end; + +procedure TcxMRUFontNameItems.Update(Item: TCollectionItem); +begin + TcxCustomFontNameComboBoxProperties(Owner).Changed; +end; + +{$IFNDEF DELPHI6} +function TcxMRUFontNameItems.Owner: TPersistent; +begin + Result := GetOwner; +end; +{$ENDIF} + +function TcxMRUFontNameItems.Add: TcxMRUFontNameItem; +begin + Result := TcxMRUFontNameItem(inherited Add); +end; + +function TcxMRUFontNameItems.Insert(Index: Integer): TcxMRUFontNameItem; +begin + Result := TcxMRUFontNameItem(inherited Insert(Index)); +end; + +procedure TcxMRUFontNameItems.Move(CurIndex, NewIndex: Integer); +var + FNewFontNameItem, FOldFontNameItem: TcxMRUFontNameItem; +begin + if CurIndex = NewIndex then Exit; + FOldFontNameItem := Items[CurIndex]; + FNewFontNameItem := Insert(NewIndex); + FNewFontNameItem.Assign(FOldFontNameItem); + FOldFontNameItem.Free; +end; + +function TcxMRUFontNameItems.AddMRUFontName(const AFontName: TFontName): TcxMRUFontNameItem; +begin + Result := nil; + if (AFontName = '') or (FindFontName(AFontName) <> nil) then Exit; + Result := Add; + Result.FontName := AFontName; +end; + +function TcxMRUFontNameItems.InsertMRUFontName(Index: Integer;const AFontName: TFontName): TcxMRUFontNameItem; +begin + Result := nil; + if (AFontName = '') or (FindFontName(AFontName) <> nil) then Exit; + Result := Insert(Index); + Result.FontName := AFontName; +end; + +function TcxMRUFontNameItems.FindFontName(const AFontName: TFontName): TcxMRUFontNameItem; +var + I: Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + begin + if Items[I].FontName = AFontName then + begin + Result := Items[I]; + Break; + end; + end; +end; + +{ TcxCustomFontNameComboBoxViewInfo } +procedure TcxCustomFontNameComboBoxViewInfo.Paint(ACanvas: TcxCanvas); +var + ACurrentBitmap: TBitmap; +begin + inherited Paint(ACanvas); + if (FCurrentIndex <> -1) and (ftiShowInCombo in ShowFontTypeIcon) then + begin + if IsTrueTypeFont then + ACurrentBitmap := FTrueTypeFontBitmap + else + ACurrentBitmap := FNonTrueTypeFontBitmap; + if ACurrentBitmap <> nil then + DrawGlyph(ACanvas, ImageRect.Left, ImageRect.Top, + ACurrentBitmap, Enabled); + end; +end; + +procedure TcxCustomFontNameComboBoxViewInfo.Offset(DX, DY: Integer); +begin + inherited; + OffsetRect(ImageRect, DX, DY); +end; + +{ TcxCustomFontNameComboBoxViewData } + +procedure TcxCustomFontNameComboBoxViewData.Calculate(ACanvas: TcxCanvas; + const ABounds: TRect; const P: TPoint; Button: TcxMouseButton; + Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); + + function GetIconOffset(AClientRect: TRect): TPoint; + begin + Result.Y := (RectHeight(AClientRect) - FTrueTypeFontBitmap.Height) div 2; + if IsInplace then + Result.X := IconBorderWidth - cxInplaceEditOffset + else + Result.X := IconBorderWidth; + end; + + procedure CalculateImageRect(AViewInfo: TcxCustomFontNameComboBoxViewInfo); + begin + AViewInfo.ImageRect := AViewInfo.ClientRect; + if FTrueTypeFontBitmap = nil then + Exit; + AViewInfo.ImageRect.Right := + AViewInfo.ImageRect.Left + FTrueTypeFontBitmap.Width; + AViewInfo.ImageRect.Bottom := + AViewInfo.ImageRect.Top + FTrueTypeFontBitmap.Height; + cxOffsetRect(AViewInfo.ImageRect, + GetIconOffset(AViewInfo.ClientRect)); + end; + +var + AEditViewInfo: TcxCustomFontNameComboBoxViewInfo; +begin + if IsRectEmpty(ABounds) then + begin + inherited; + Exit; + end; + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, AIsMouseEvent); + if (ABounds.Right = MaxInt) or (ABounds.Bottom = MaxInt) then Exit; + + AEditViewInfo := TcxCustomFontNameComboBoxViewInfo(AViewInfo); + AEditViewInfo.ShowFontTypeIcon := Properties.ShowFontTypeIcon; + + if (ftiShowInCombo in AEditViewInfo.ShowFontTypeIcon) then + begin + CalculateImageRect(AEditViewInfo); + AEditViewInfo.TextRect.Left := AEditViewInfo.ImageRect.Right + + IconBorderWidth + IconTextOffset; + end; + + if not IsInplace then + AEditViewInfo.DrawSelectionBar := False; +end; + +procedure TcxCustomFontNameComboBoxViewData.DisplayValueToDrawValue( + const ADisplayValue: TcxEditValue; AViewInfo: TcxCustomEditViewInfo); +var + AViewInfoAccess: TcxCustomFontNameComboBoxViewInfo; +begin + AViewInfoAccess := TcxCustomFontNameComboBoxViewInfo(AViewInfo); + Properties.GetFontNameComboBoxDisplayValue(ADisplayValue, + AViewInfoAccess.FCurrentIndex, AViewInfoAccess.Text); + if PreviewMode then + AViewInfoAccess.Text := ''; + if AViewInfoAccess.FCurrentIndex <> -1 then + AViewInfoAccess.IsTrueTypeFont := + (cxftTTF in Properties.ItemTypes[AViewInfoAccess.FCurrentIndex]); +end; + +procedure TcxCustomFontNameComboBoxViewData.EditValueToDrawValue(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; AViewInfo: TcxCustomEditViewInfo); +begin + PrepareSelection(AViewInfo); + DisplayValueToDrawValue(AEditValue, AViewInfo); + DoOnGetDisplayText(string(TcxCustomTextEditViewInfo(AViewInfo).Text)); +end; + +function TcxCustomFontNameComboBoxViewData.GetEditContentSize(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; + const AEditSizeProperties: TcxEditSizeProperties): TSize; +var + FItemIndex: Integer; +begin + Result := inherited GetEditContentSize(ACanvas, AEditValue, AEditSizeProperties); + FItemIndex := Properties.FindItemByValue(AEditValue); + if (FItemIndex >= 0) and (ftiShowInCombo in Properties.ShowFontTypeIcon) then + Result.cx := Result.cx + FTrueTypeFontBitmap.Width + 4; +end; + +function TcxCustomFontNameComboBoxViewData.IsComboBoxStyle: Boolean; +begin + Result := True; +end; + +function TcxCustomFontNameComboBoxViewData.GetProperties: TcxCustomFontNameComboBoxProperties; +begin + Result := TcxCustomFontNameComboBoxProperties(FProperties); +end; + +{ TcxFontNameComboBoxListBox } + +function TcxFontNameComboBoxListBox.GetItemHeight(AIndex: Integer = -1): Integer; +begin + with Edit.ActiveProperties do + begin + if ItemHeight > 0 then + Result := ItemHeight + else + begin + Result := inherited GetItemHeight; + if UseOwnFont then + Inc(Result, 4) + else + if Result <= FTrueTypeFontBitmap.Height then + Result := FTrueTypeFontBitmap.Height + 4; + end; + if (AIndex >= 0) and Edit.IsOnMeasureItemEventAssigned then + Edit.DoOnMeasureItem(AIndex, Canvas, Result); + if AIndex = (FMRUFontNames.Count - 1) then + Inc(Result, MRUDelimiterWidth); + end; +end; + +function TcxFontNameComboBoxListBox.GetItemWidth(AIndex: Integer): Integer; +var + AFontName, ACanvasFontName: string; + ACanvasFontCharSet: TFontCharSet; +begin + if Edit.ActiveProperties.UseOwnFont then + begin + Canvas.Font.Assign(Font); + ACanvasFontName := Canvas.Font.Name; + ACanvasFontCharSet := Canvas.Font.Charset; + try + Result := 0; + AFontName := GetItem(AIndex); + if IsSymbolFontType(AIndex) then + begin + Canvas.Font.Name := 'Arial'; + Result := Canvas.TextWidth(AFontName); + Inc(Result, ItemSymbolFontExampleOffset); + Canvas.Font.Charset := SYMBOL_CHARSET; + end; + Canvas.Font.Name := AFontName; + Inc(Result, Canvas.TextWidth(AFontName)); + finally + Canvas.Font.Name := ACanvasFontName; + Canvas.Font.Charset := ACanvasFontCharSet; + end; + end + else + Result := inherited GetItemWidth(AIndex); +end; + +function TcxFontNameComboBoxListBox.GetItem(Index: Integer): string; +begin + Result := Edit.ActiveProperties.LookupItems[Index]; +end; + +procedure TcxFontNameComboBoxListBox.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + AItemIndex: Integer; +begin + inherited MouseUp(Button, Shift, X, Y); + if Button <> mbLeft then + Exit; + AItemIndex := ItemAtPos(Point(X, Y), True); + if AItemIndex <> -1 then + begin + SetCaptureControl(nil); + ItemIndex := AItemIndex; + Edit.CloseUp(crEnter); + end; +end; + +procedure TcxFontNameComboBoxListBox.DrawItem(Index: Integer; Rect: TRect; + State: TOwnerDrawState); + + procedure DrawItemText; + var + AFlags: Longint; + AFontBitmap: TBitmap; + AText: string; + ATextRect: TRect; + begin + ATextRect := Rect; + if Index = Edit.ActiveProperties.FMRUFontNames.Count - 1 then + Dec(ATextRect.Bottom, MRUDelimiterWidth); + + if cxftTTF in Edit.ActiveProperties.ItemTypes[Index] then + AFontBitmap := FTrueTypeFontBitmap + else + AFontBitmap := FNonTrueTypeFontBitmap; + if (ftiShowInList in Edit.ActiveProperties.ShowFontTypeIcon) and (AFontBitmap <> nil) then + begin + Canvas.Draw(ATextRect.Left + IconBorderWidth, ATextRect.Top + + (ATextRect.Bottom - ATextRect.Top - AFontBitmap.Height) div 2, AFontBitmap); + Inc(ATextRect.Left, AFontBitmap.Width + IconBorderWidth * 2 + IconTextOffset); + end + else + Inc(ATextRect.Left, DropDownListTextOffset); + + AText := GetItem(Index); + if Edit.ActiveProperties.UseOwnFont then + Canvas.Font.Name := AText; + AFlags := DrawTextBiDiModeFlags(DT_SINGLELINE or DT_LEFT or DT_NOPREFIX or DT_VCENTER); + Canvas.Brush.Style := bsClear; + if Edit.ActiveProperties.UseOwnFont and IsSymbolFontType(Index) then + begin + Canvas.Font.Name := 'Arial'; + DrawText(Canvas.Handle, PChar(AText), Length(AText), + ATextRect, AFlags); + Inc(ATextRect.Left, Canvas.TextWidth(AText) + ItemSymbolFontExampleOffset); + Canvas.Font.Name := AText; + Canvas.Font.Charset := SYMBOL_CHARSET; + AFlags := AFlags and not DT_END_ELLIPSIS; + end; + DrawText(Canvas.Handle, PChar(AText), Length(AText), + ATextRect, AFlags); + Canvas.Brush.Style := bsSolid; + end; + +begin + SaveCanvasParametersForFocusRect; + try + if DoDrawItem(Index, Rect, State) then + Exit; + Canvas.FillRect(Rect); + DrawItemText; + if Index = Edit.ActiveProperties.FMRUFontNames.Count - 1 then + DrawMRUDelimiter(Canvas.Canvas, Rect, odSelected in State); + finally + RestoreCanvasParametersForFocusRect; + end; +end; + +function TcxFontNameComboBoxListBox.GetEdit: TcxCustomFontNameComboBox; +begin + Result := TcxCustomFontNameComboBox(inherited Edit); +end; + +function TcxFontNameComboBoxListBox.IsSymbolFontType(AItemIndex: Integer): Boolean; +begin + Result := Integer(Edit.ActiveProperties.Items.Objects[AItemIndex]) and SYMBOL_FONTTYPE <> 0; +end; + +{ TcxFontNameComboBoxLookupData } + +destructor TcxFontNameComboBoxLookupData.Destroy; +begin + FPanel := nil; + inherited Destroy; +end; + +function TcxFontNameComboBoxLookupData.CanResizeVisualArea(var NewSize: TSize; + AMaxHeight: Integer = 0; AMaxWidth: Integer = 0): Boolean; +var + AFontPreviewPanelHeight: Integer; +begin + if TcxCustomFontNameComboBoxProperties(ActiveProperties).FontPreview.Visible then + AFontPreviewPanelHeight := cxFontPreviewPanelDefaultHeight + else + AFontPreviewPanelHeight := 0; + Result := (AMaxHeight = 0) or (AMaxHeight > AFontPreviewPanelHeight); + if Result then + begin + if AMaxHeight > 0 then + Dec(AMaxHeight, AFontPreviewPanelHeight); + NewSize.cy := NewSize.cy - AFontPreviewPanelHeight; + Result := inherited CanResizeVisualArea(NewSize, AMaxHeight); + NewSize.cy := NewSize.cy + AFontPreviewPanelHeight; + end; +end; + +function TcxFontNameComboBoxLookupData.GetVisualAreaPreferredSize(AMaxHeight: Integer; AWidth: Integer = 0): TSize; +var + AScrollWidth, AWidthDelta: Integer; +begin + Result := inherited GetVisualAreaPreferredSize(AMaxHeight, AWidth); + if TcxCustomFontNameComboBoxProperties(ActiveProperties).FontPreview.Visible then + Result.cy := Result.cy + cxFontPreviewPanelDefaultHeight; + if (ftiShowInCombo in TcxCustomFontNameComboBoxProperties(ActiveProperties).ShowFontTypeIcon) then + AWidthDelta := FTrueTypeFontBitmap.Width + IconBorderWidth * 2 + IconTextOffset + else + AWidthDelta := DropDownListTextOffset; + AScrollWidth := List.ScrollWidth; + List.ScrollWidth := 0; + List.ScrollWidth := AScrollWidth + AWidthDelta; + Result.cx := Result.cx + AWidthDelta; +end; + +procedure TcxFontNameComboBoxLookupData.Initialize(AVisualControlsParent: TWinControl); +begin + inherited Initialize(AVisualControlsParent); + if TcxCustomFontNameComboBoxProperties(ActiveProperties).FontPreview.Visible and + Assigned(AVisualControlsParent) and AVisualControlsParent.HandleAllocated then + begin + if not Assigned(FPanel) then + begin + FPanel := TFontPreviewPanel.Create(AVisualControlsParent); + FPanel.FontPreview := TcxCustomFontNameComboBoxProperties(ActiveProperties).FontPreview; + FPanel.LookAndFeel.MasterLookAndFeel := TcxCustomFontNameComboBox(Edit).PopupControlsLookAndFeel; + end; + + FPanel.Locked := True; + try + FPanel.Edges := [bBottom]; + FPanel.Caption := GetPreviewText; + FPanel.FontName := GetFontName; + FPanel.Height := cxFontPreviewPanelDefaultHeight; + with TcxCustomFontNameComboBoxProperties(ActiveProperties) do + begin + FPanel.FontStyle := FontPreview.FontStyle; + FPanel.Color := FontPreview.Color; + FPanel.ShowEndEllipsis := FontPreview.ShowEndEllipsis and + (FontPreview.PreviewType <> cxfpFontName); + FPanel.Alignment := FontPreview.Alignment; + FPanel.WordWrap := FontPreview.WordWrap and (FontPreview.PreviewType <> cxfpFontName); + FPanel.ShowButtons := FontPreview.ShowButtons; + end; + FPanel.Parent := AVisualControlsParent; + FPanel.Visible := True; + finally + FPanel.Locked := False; + end; + end + else + if Assigned(FPanel) then FPanel.Visible := False; +end; + +procedure TcxFontNameComboBoxLookupData.PositionVisualArea(const AClientRect: TRect); +var + R: TRect; +begin + inherited PositionVisualArea(AClientRect); + R := AClientRect; + if TcxCustomFontNameComboBoxProperties(ActiveProperties).FontPreview.Visible and + Assigned(FPanel) and FPanel.HandleAllocated then + begin + FPanel.SetBounds(R.Left, R.Top, R.Right - R.Left, + cxFontPreviewPanelDefaultHeight); + FPanel.RealignButtons; + Inc(R.Top, FPanel.Height); + end; + List.SetBounds(R.Left, R.Top, R.Right - R.Left, R.Bottom - R.Top); +end; + +function TcxFontNameComboBoxLookupData.GetListBoxClass: TcxCustomEditListBoxClass; +begin + Result := TcxFontNameComboBoxListBox; +end; + +procedure TcxFontNameComboBoxLookupData.HandleSelectItem(Sender: TObject); +begin + inherited HandleSelectItem(Sender); + if Assigned(FPanel) and FPanel.HandleAllocated then + begin + FPanel.Locked := True; + try + if ItemIndex >= 0 then + FPanel.FontName := GetFontName; + with TcxCustomFontNameComboBoxProperties(ActiveProperties) do + if FontPreview.PreviewType <> cxfpFullAlphabet then + FPanel.Caption := GetPreviewText; + finally + FPanel.Locked := False; + end; + end; +end; + +procedure TcxFontNameComboBoxLookupData.InternalChangeCurrentMRUFontNamePosition; +var + FIndex: Integer; +begin + if ItemIndex > (TcxCustomFontNameComboBoxProperties(ActiveProperties).FMRUFontNames.Count - 1) then + begin + FIndex := Items.IndexOf(Items[ItemIndex]); + if FIndex >= 0 then + InternalSetCurrentKey(FIndex); + end; +end; + +function TcxFontNameComboBoxLookupData.GetPreviewText: string; +begin + with TcxCustomFontNameComboBoxProperties(ActiveProperties) do + case FontPreview.PreviewType of + cxfpCustom: Result := TcxCustomFontNameComboBoxProperties(ActiveProperties).FontPreview.PreviewText; + cxfpFullAlphabet: Result := 'ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 1234567890'; + else + Result := GetFontName; + end; +end; + +function TcxFontNameComboBoxLookupData.GetFontName: string; +begin + if ItemIndex = -1 then + Result := '' + else + Result := Items[ItemIndex]; +end; + +{ TcxCustomFontNameComboBoxProperties } + +constructor TcxCustomFontNameComboBoxProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + DropDownListStyle := lsFixedList; + FMaxMRUFonts := 10; + FFontTypes := [cxftTTF, cxftRaster, cxftDevice, cxftFixed, cxftSymbol]; + FUseOwnFont := False; + FShowFontTypeIcon := [ftiShowInCombo, ftiShowInList]; + FMRUFontNames := TcxMRUFontNameItems.Create(Self, TcxMRUFontNameItem); + FFontPreview := TcxFontPreview.Create(Self); + FLoadFontComplete := True; + LoadFontNames; +end; + +destructor TcxCustomFontNameComboBoxProperties.Destroy; +begin + FreeAndNil(FFontPreview); + FreeAndNil(FMRUFontNames); + ShutDownFontLoader; + inherited; +end; + +procedure TcxCustomFontNameComboBoxProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomFontNameComboBoxProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with Source as TcxCustomFontNameComboBoxProperties do + begin + Self.UseOwnFont := UseOwnFont; + Self.FontTypes := FontTypes; + Self.ShowFontTypeIcon := ShowFontTypeIcon; + Self.FontPreview := FontPreview; + Self.MaxMRUFonts := MaxMRUFonts; + Self.OnAddedMRUFont := OnAddedMRUFont; + Self.OnMovedMRUFont := OnMovedMRUFont; + Self.OnDeletedMRUFont := OnDeletedMRUFont; + Self.OnLoadFontComplete := OnLoadFontComplete; + Self.MRUFontNames.Assign(MRUFontNames); + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +function TcxCustomFontNameComboBoxProperties.CompareDisplayValues( + const AEditValue1, AEditValue2: TcxEditValue): Boolean; +var + AItemIndex1, AItemIndex2: Integer; + AText1, AText2: string; +begin + GetFontNameComboBoxDisplayValue(AEditValue1, AItemIndex1, AText1); + GetFontNameComboBoxDisplayValue(AEditValue2, AItemIndex2, AText2); + Result := AItemIndex1 = AItemIndex2; +end; + +class function TcxCustomFontNameComboBoxProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxFontNameComboBox; +end; + +procedure TcxCustomFontNameComboBoxProperties.GetFontNameComboBoxDisplayValue( + const AEditValue: TcxEditValue; out AItemIndex: Integer; out AText: string); +begin + if not LoadFontComplete then + begin + AItemIndex := -1; + AText := cxGetResourceString(@scxLoadingFonts); + end + else + begin + AItemIndex := FindItemByValue(AEditValue); + if AItemIndex = -1 then + AText := '' + else + AText := Items[AItemIndex]; + end; + CheckCharsRegister(AText, CharCase); +end; + +function TcxCustomFontNameComboBoxProperties.FindLookupText( + const AText: string): Boolean; +begin + Result := not LoadFontComplete or inherited FindLookupText(AText); +end; + +class function TcxCustomFontNameComboBoxProperties.GetLookupDataClass: TcxInterfacedPersistentClass; +begin + Result := TcxFontNameComboBoxLookupData; +end; + +class function TcxCustomFontNameComboBoxProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxCustomFontNameComboBoxViewData; +end; + +class function TcxCustomFontNameComboBoxProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxCustomFontNameComboBoxViewInfo; +end; + +procedure TcxCustomFontNameComboBoxProperties.ShutDownFontLoader; +begin + if Assigned(FFontLoader) then + begin + FFontLoader.OnCompleteThread := nil; + FFontLoader.OnDestroyThread := nil; + FFontLoader.Terminate; + FFontLoader := nil; + end; +end; + +function TcxCustomFontNameComboBoxProperties.GetFontItems: TStrings; +begin + Result := Items; +end; + +function TcxCustomFontNameComboBoxProperties.GetFontTypes: TcxFontTypes; +begin + Result := FFontTypes; +end; + +procedure TcxCustomFontNameComboBoxProperties.SetFontTypes(Value: TcxFontTypes); +begin + if FFontTypes <> Value then begin + FFontTypes := Value; + FMRUFontNames.Clear; + LoadFontNames; + Changed; + end; +end; + +procedure TcxCustomFontNameComboBoxProperties.SetMaxMRUFonts(Value: Byte); +var + FOldMaxMRUFonts: Byte; +begin + if FMaxMRUFonts <> Value then + begin + FOldMaxMRUFonts := FMaxMRUFonts; + FMaxMRUFonts := Value; + if FOldMaxMRUFonts > Value then + begin + DeleteOverMRUFonts; + Changed; + end; + end; +end; + +function TcxCustomFontNameComboBoxProperties.GetUseOwnFont: Boolean; +begin + Result := FUseOwnFont; +end; + +procedure TcxCustomFontNameComboBoxProperties.SetUseOwnFont(Value: Boolean); +begin + if FUseOwnFont <> Value + then begin + FUseOwnFont := Value; + Changed; + end; +end; + +procedure TcxCustomFontNameComboBoxProperties.SetShowFontTypeIcon(Value: TcxShowFontIconTypes); +begin + if FShowFontTypeIcon <> Value then + begin + FShowFontTypeIcon := Value; + Changed; + end; +end; + +function TcxCustomFontNameComboBoxProperties.FindItemByValue(const AEditValue: TcxEditValue): Integer; +begin + if not LoadFontComplete then + Result := -1 + else + if IsVarEmpty(AEditValue) then + Result := -1 + else + Result := Items.IndexOf(VarToStr(AEditValue)); +end; + +function TcxCustomFontNameComboBoxProperties.GetItemTypes(Index: Integer): TcxFontTypes; +begin + Result := RealFontTypeToCxTypes(Integer(Items.Objects[Index])); +end; + +procedure TcxCustomFontNameComboBoxProperties.SetFontPreview(Value: TcxFontPreview); +begin + FontPreview.Assign(Value); + Changed; +end; + +procedure TcxCustomFontNameComboBoxProperties.LoadFontNames; +begin + { Prepare to ShutDown FontLoader} + if (not FLoadFontComplete) or (Assigned(FFontLoader)) then + begin + if Assigned(FFontLoader) then FFontLoader.OnCompleteThread := nil; + ShutDownFontLoader; + end; + FLoadFontComplete := False; + FFontLoader := TcxFontLoader.Create(FFontTypes); + FFontLoader.OnCompleteThread := FontLoaderCompleteHandler; + FFontLoader.OnDestroyThread := FontLoaderDestroyHandler; + FFontLoader.Resume; +end; + +procedure TcxCustomFontNameComboBoxProperties.Update(AProperties: TcxCustomEditProperties); +begin + if (AProperties is TcxCustomFontNameComboBoxProperties) and + FLoadFontComplete then + with TcxCustomFontNameComboBoxProperties(AProperties) do + begin + Items.Assign(Self.Items); + MRUFontNames.Assign(Self.MRUFontNames); + end; +end; + +procedure TcxCustomFontNameComboBoxProperties.FontLoaderCompleteHandler(Sender: TObject); +begin + Items.BeginUpdate; + try + Items.Clear; + if Assigned(Sender) then Items.Assign((Sender as TcxFontLoader).FontList); + finally + Items.EndUpdate; + end; + FLoadFontComplete := True; + if Assigned(FOnInternalLoadFontComplete) then FOnInternalLoadFontComplete(Self); + if Assigned(OnLoadFontComplete) then OnLoadFontComplete(Self); + Changed; +end; + +procedure TcxCustomFontNameComboBoxProperties.FontLoaderDestroyHandler(Sender: TObject); +begin + FFontLoader.OnCompleteThread := nil; + FFontLoader.OnDestroyThread := nil; + FFontLoader := nil; + FLoadFontComplete := True; +end; + +function TcxCustomFontNameComboBoxProperties.AddMRUFontName(const AFontName: TFontName): TcxMRUFontNameAction; +var + FIndex: Integer; +begin + Result := mfaNone; + if MaxMRUFonts = 0 then Exit; + Result := mfaInvalidFontName; + FIndex := Items.IndexOf(AFontName); + if FIndex < 0 then Exit; + {If this font exists in MRU list, do not add, only move to first position} + if FMRUFontNames.FindFontName(AFontName) <> nil then + begin + if (FIndex > 0) and (FIndex < FMRUFontNames.Count) then + begin + Result := mfaMoved; + Items.Move(FIndex, 0); + FMRUFontNames.Move(FIndex, 0); + if Assigned(OnMovedMRUFont) then + OnMovedMRUFont(Self); + end + else + Result := mfaNone; + end + else + Result := mfaAdded; + if Result = mfaAdded then + begin + FMRUFontNames.InsertMRUFontName(0, AFontName); + Items.InsertObject(0, AFontName, Items.Objects[FIndex]); + DeleteOverMRUFonts; + if Assigned(OnAddedMRUFont) then + OnAddedMRUFont(Self); + end; +end; + +function TcxCustomFontNameComboBoxProperties.DelMRUFontName(const AFontName: TFontName): TcxMRUFontNameAction; +var + FIndex: Integer; +begin + Result := mfaInvalidFontName; + {Check for right Font name} + FIndex := Items.IndexOf(AFontName); + if FIndex < 0 then Exit; + if FMRUFontNames.FindFontName(AFontName) <> nil then + begin +{$IFDEF DELPHI5} + FMRUFontNames.Delete(FIndex); +{$ELSE} + TcxMRUFontNameItem(FMRUFontNames.Items[FIndex]).Free; +{$ENDIF} + Items.Delete(FIndex); + Result := mfaDeleted; + if Assigned(OnDeletedMRUFont) then + OnDeletedMRUFont(Self, AFontName); + end; +end; + +procedure TcxCustomFontNameComboBoxProperties.DeleteOverMRUFonts; +var + I: Integer; + FDeletedFontName: string; +begin + BeginUpdate; + try + for I := FMRUFontNames.Count - 1 downto 0 do + begin + if I >= FMaxMRUFonts then + begin +{$IFDEF DELPHI5} + FMRUFontNames.Delete(I); +{$ELSE} + TcxMRUFontNameItem(FMRUFontNames.Items[I]).Free; +{$ENDIF} + FDeletedFontName := Items[I]; + Items.Delete(I); + if Assigned(OnDeletedMRUFont) then + OnDeletedMRUFont(Self, FDeletedFontName); + end + else Break; + end; + finally + EndUpdate; + end; +end; + +{ TcxCustomFontNameComboBox } + +{$IFDEF CBUILDER10} +constructor TcxCustomFontNameComboBox.Create(AOwner: TComponent); +begin + inherited Create(AOwner); +end; +{$ENDIF} + +function TcxCustomFontNameComboBox.Deactivate: Boolean; +begin + Result := inherited Deactivate; + UpdateMRUList; +end; + +class function TcxCustomFontNameComboBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomFontNameComboBoxProperties; +end; + +function TcxCustomFontNameComboBox.GetInnerEditClass: TControlClass; +begin + Result := TcxCustomFontNameComboBoxInnerEdit; +end; + +function TcxCustomFontNameComboBox.GetPopupWindowClientPreferredSize: TSize; +begin + Result := inherited GetPopupWindowClientPreferredSize; +end; + +procedure TcxCustomFontNameComboBox.Initialize; +begin + inherited Initialize; + FFontNameQueue := ''; + ControlStyle := ControlStyle - [csClickEvents]; + TcxCustomFontNameComboBoxProperties(FProperties).FOnInternalLoadFontComplete := + InternalLoadFontCompleteHandler; +end; + +procedure TcxCustomFontNameComboBox.InitializePopupWindow; +begin + inherited InitializePopupWindow; + PopupWindow.SysPanelStyle := ActiveProperties.PopupSizeable; +end; + +procedure TcxCustomFontNameComboBox.CloseUp(AReason: TcxEditCloseUpReason); +begin + FNeedsUpdateMRUList := FNeedsUpdateMRUList or (AReason in [crTab, crEnter, crClose]); + try + inherited CloseUp(AReason); + finally + UpdateMRUList; + end; +end; + +procedure TcxCustomFontNameComboBox.SetItemIndex(Value: Integer); +begin + if ActiveProperties.LoadFontComplete then + inherited SetItemIndex(Value); +end; + +function TcxCustomFontNameComboBox.AddMRUFontName(const AFontName: TFontName): TcxMRUFontNameAction; +begin + Result := ActiveProperties.AddMRUFontName(AFontName); +end; + +function TcxCustomFontNameComboBox.DelMRUFontName(const AFontName: TFontName): TcxMRUFontNameAction; +begin + Result := ActiveProperties.DelMRUFontName(AFontName); +end; + +function TcxCustomFontNameComboBox.GetProperties: TcxCustomFontNameComboBoxProperties; +begin + Result := TcxCustomFontNameComboBoxProperties(FProperties); +end; + +function TcxCustomFontNameComboBox.GetActiveProperties: TcxCustomFontNameComboBoxProperties; +begin + Result := TcxCustomFontNameComboBoxProperties(InternalGetActiveProperties); +end; + +function TcxCustomFontNameComboBox.GetFontName: string; +begin + Result := FFontNameQueue; + if (Result = '') and (ItemIndex <> -1) then + Result := ActiveProperties.Items[ItemIndex]; +end; + +procedure TcxCustomFontNameComboBox.SetFontName(Value: string); +begin + if Value = '' then + begin + FFontNameQueue := ''; + ItemIndex := -1; + end + else + begin + if not ActiveProperties.LoadFontComplete then + FFontNameQueue := Value + else + ItemIndex := ActiveProperties.Items.IndexOf(Value); + end; +end; + +function TcxCustomFontNameComboBox.GetLookupData: TcxFontNameComboBoxLookupData; +begin + Result := TcxFontNameComboBoxLookupData(FLookupData); +end; + +procedure TcxCustomFontNameComboBox.SetProperties(Value: TcxCustomFontNameComboBoxProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomFontNameComboBox.InternalLoadFontCompleteHandler(Sender: TObject); +var + FLocalFontName: string; +begin + if FFontNameQueue <> '' then + begin + SetFontName(FFontNameQueue); + FFontNameQueue := ''; + end + else + begin + if IsVarEmpty(FEditValue) then + FLocalFontName := '' + else + FLocalFontName := VarToStr(FEditValue); + LookupData.InternalSetCurrentKey(ActiveProperties.Items.IndexOf(FLocalFontName)); + end; +end; + +procedure TcxCustomFontNameComboBox.UpdateMRUList; +var + AFontName: TFontName; + AFontNameIndex: Integer; +begin + try + if FNeedsUpdateMRUList and (FDontCheckModifiedWhenUpdatingMRUList or ModifiedAfterEnter) then + begin + AFontNameIndex := ActiveProperties.Items.IndexOf(Text); + if AFontNameIndex = -1 then + AFontName := Text + else + AFontName := ActiveProperties.Items[AFontNameIndex]; + if AddMRUFontName(AFontName) in [mfaNone, mfaMoved] then + LookupData.InternalChangeCurrentMRUFontNamePosition; + end; + finally + FDontCheckModifiedWhenUpdatingMRUList := False; + FNeedsUpdateMRUList := False; + end; +end; + +procedure TcxCustomFontNameComboBox.AfterPosting; +begin + inherited AfterPosting; + if IsInplace and FNeedsUpdateMRUList then + FDontCheckModifiedWhenUpdatingMRUList := True; +end; + +procedure TcxCustomFontNameComboBox.InternalSetEditValue(const Value: TcxEditValue; + AValidateEditValue: Boolean); +begin + if IsDestroying then + Exit; + inherited; +end; + +{ TcxFontNameComboBox } + +class function TcxFontNameComboBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxFontNameComboBoxProperties; +end; + +function TcxFontNameComboBox.GetActiveProperties: TcxFontNameComboBoxProperties; +begin + Result := TcxFontNameComboBoxProperties(InternalGetActiveProperties); +end; + +function TcxFontNameComboBox.GetProperties: TcxFontNameComboBoxProperties; +begin + Result := TcxFontNameComboBoxProperties(FProperties); +end; + +procedure TcxFontNameComboBox.SetProperties( + Value: TcxFontNameComboBoxProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxFilterFontNameComboBoxHelper } + +class function TcxFilterFontNameComboBoxHelper.GetFilterEditClass: TcxCustomEditClass; +begin + Result := TcxFontNameComboBox; +end; + +class function TcxFilterFontNameComboBoxHelper.GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; +begin + Result := [fcoEqual, fcoNotEqual, fcoBlanks, fcoNonBlanks]; + if AExtendedSet then + Result := Result + [fcoInList, fcoNotInList]; +end; + +initialization + GetRegisteredEditProperties.Register(TcxFontNameComboBoxProperties, scxSEditRepositoryFontNameComboBoxItem); + FTrueTypeFontBitmap := TBitmap.Create; + FTrueTypeFontBitmap.LoadFromResourceName(HInstance, 'CXFONTCOMBO_TTF'); + FTrueTypeFontBitmap.Transparent := True; + FNonTrueTypeFontBitmap := TBitmap.Create; + FNonTrueTypeFontBitmap.LoadFromResourceName(HInstance, 'CXFONTCOMBO_NONTTF'); + FNonTrueTypeFontBitmap.Transparent := True; + FilterEditsController.Register(TcxFontNameComboBoxProperties, TcxFilterFontNameComboBoxHelper); + +finalization + FilterEditsController.Unregister(TcxFontNameComboBoxProperties, TcxFilterFontNameComboBoxHelper); + GetRegisteredEditProperties.Unregister(TcxFontNameComboBoxProperties); + FreeAndNil(FNonTrueTypeFontBitmap); + FreeAndNil(FTrueTypeFontBitmap); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxFontNameComboBox.res b/official/x.35/ExpressEditors Library 5/Sources/cxFontNameComboBox.res new file mode 100644 index 00000000..4dd46661 Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Sources/cxFontNameComboBox.res differ diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxGroupBox.pas b/official/x.35/ExpressEditors Library 5/Sources/cxGroupBox.pas new file mode 100644 index 00000000..7864c4f8 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxGroupBox.pas @@ -0,0 +1,2970 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGroupBox; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, + SysUtils, Classes, Controls, Graphics, Forms, cxControls, cxGraphics, + cxLookAndFeels, cxContainer, cxEditPaintUtils, cxEdit, + cxTextEdit, cxClasses, cxCheckBox, cxLookAndFeelPainters; + +const + cxGroupBox_SupportNonClientArea: Boolean = True; + +type + TcxCaptionAlignment = (alTopLeft, alTopCenter, alTopRight, + alBottomLeft, alBottomCenter, alBottomRight, + alLeftTop, alLeftCenter, alLeftBottom, + alRightTop, alRightCenter, alRightBottom, + alCenterCenter); + + TcxPanelOffice11BackgroundKind = (pobkGradient, pobkOffice11Color, pobkStyleColor); + + { TcxGroupBoxButtonViewInfo } + + TcxGroupBoxButtonViewInfo = class(TcxEditButtonViewInfo) + public + Caption: string; + Column, Row: Integer; + function GetGlyphRect(ACanvas: TcxCanvas; AGlyphSize: TSize; AAlignment: TLeftRight; AIsPaintCopy: Boolean): TRect; virtual; + end; + + { TcxGroupBoxViewInfo } + + TcxCustomGroupBox = class; + + TcxGroupBoxViewInfo = class(TcxCustomTextEditViewInfo) + private + function GetCaptionRectIndent: TRect; + function GetControlRect: TRect; + function GetEdit: TcxCustomGroupBox; + function CalcOffsetBoundsForPanel: TRect; + procedure CalcBoundsForPanel; + function GetFrameBounds: TRect; + procedure CalcTextBoundsForPanel; + function CalcCorrectionBoundsForPanel: TRect; + procedure AdjustTextBoundsForPanel; + procedure AdjustCaptionBoundsForPanel; + procedure DrawCaption(ACanvas: TcxCanvas); + procedure DrawHorizontalTextCaption(ACanvas: TcxCanvas); + procedure DrawVerticalTextCaption(ACanvas: TcxCanvas); + procedure DrawFrame(ACanvas: TcxCanvas; R: TRect); + function GetThemeBackgroundRect(ACanvas: TcxCanvas): TRect; + function GetBoundsForPanel: TRect; + procedure DrawUsualBackground(ACanvas: TcxCanvas); + procedure DrawNativeBackground(ACanvas: TcxCanvas; const ACaptionRect: TRect); + procedure DrawNativeGroupBoxBackground(ACanvas: TcxCanvas); + procedure DrawNativePanelBackground(ACanvas: TcxCanvas; const ACaptionRect: TRect); + procedure DrawOffice11PanelBackground(ACanvas: TcxCanvas; const R: TRect); + procedure InternalDrawBackground(ACanvas: TcxCanvas); + protected + function GetButtonViewInfoClass: TcxEditButtonViewInfoClass; override; + procedure InternalPaint(ACanvas: TcxCanvas); override; + property ControlRect: TRect read GetControlRect; + public + Alignment: TLeftRight; + CaptionRect: TRect; + IsDesigning: Boolean; + TextRect: TRect; + constructor Create; override; + destructor Destroy; override; + property Edit: TcxCustomGroupBox read GetEdit; + end; + + { TcxGroupBoxViewData } + + TcxGroupBoxViewData = class(TcxCustomEditViewData) + private + function GetCaptionRect(ACanvas: TcxCanvas): TRect; + function GetShadowWidth: Integer; + function HasNonClientArea: Boolean; + procedure AdjustHorizontalCaptionRect(var R: TRect); + procedure AdjustVerticalCaptionRect(var R: TRect); + function GetEdit: TcxCustomGroupBox; + procedure CalcRects(ACanvas: TcxCanvas; AEditViewInfo: TcxGroupBoxViewInfo); + protected + function GetContainerState(const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; + AIsMouseEvent: Boolean): TcxContainerState; override; + public + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); override; + function GetBorderColor: TColor; override; + function GetBorderExtent: TRect; override; + function GetClientExtent(ACanvas: TcxCanvas; + AViewInfo: TcxCustomEditViewInfo): TRect; override; + function HasShadow: Boolean; override; + class function IsNativeStyle(ALookAndFeel: TcxLookAndFeel): Boolean; override; + property Edit: TcxCustomGroupBox read GetEdit; + end; + + { TcxButtonGroupViewData } + + TcxCustomButtonGroupProperties = class; + + TcxEditMetrics = record + AutoHeightColumnWidthCorrection, AutoHeightWidthCorrection, + ColumnWidthCorrection, WidthCorrection: Integer; + ClientLeftBoundCorrection, ClientWidthCorrection, ColumnOffset: Integer; + ButtonSize: TSize; + end; + + { TcxButtonGroupViewInfo } + + TcxButtonGroupViewInfo = class(TcxGroupBoxViewInfo) + protected + procedure DrawEditButton(ACanvas: TcxCanvas; AButtonVisibleIndex: Integer); override; + procedure DrawButtonCaption(ACanvas: TcxCanvas; + AButtonViewInfo: TcxGroupBoxButtonViewInfo; const AGlyphRect: TRect); virtual; abstract; + procedure DrawButtonGlyph(ACanvas: TcxCanvas; + AButtonViewInfo: TcxGroupBoxButtonViewInfo; const AGlyphRect: TRect); virtual; abstract; + function GetGlyphSize: TSize; virtual; + function IsButtonGlypthTransparent(AButtonViewInfo: TcxGroupBoxButtonViewInfo): Boolean; virtual; abstract; + public + CaptionExtent: TRect; + GlyphSize: TSize; + end; + + TcxButtonGroupViewData = class(TcxGroupBoxViewData) + private + function GetProperties: TcxCustomButtonGroupProperties; + protected + procedure CalculateButtonPositions(ACanvas: TcxCanvas; + AViewInfo: TcxCustomEditViewInfo); virtual; + procedure CalculateButtonViewInfos(AViewInfo: TcxCustomEditViewInfo); virtual; + function GetDrawTextFlags: Integer; virtual; + procedure GetEditMetrics(AAutoHeight: Boolean; ACanvas: TcxCanvas; + out AMetrics: TcxEditMetrics); virtual; abstract; + function GetCaptionRectExtent: TRect; virtual; + procedure CalculateButtonNativeState(AViewInfo: TcxCustomEditViewInfo; + AButtonViewInfo: TcxGroupBoxButtonViewInfo); virtual; abstract; + public + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); override; + procedure CalculateButtonsViewInfo(ACanvas: TcxCanvas; const ABounds: TRect; + const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); override; + function GetEditConstantPartSize(ACanvas: TcxCanvas; + const AEditSizeProperties: TcxEditSizeProperties; + var MinContentSize: TSize; AViewInfo: TcxCustomEditViewInfo = nil): TSize; override; + class function IsButtonNativeStyle(ALookAndFeel: TcxLookAndFeel): Boolean; virtual; + property Properties: TcxCustomButtonGroupProperties read GetProperties; + end; + + TcxButtonGroupViewDataClass = class of TcxButtonGroupViewData; + + { TcxCustomGroupBoxProperties } + + TcxCustomGroupBoxProperties = class(TcxCustomEditProperties) + protected + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + public + class function GetContainerClass: TcxContainerClass; override; + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + end; + + { TcxButtonGroupItem } + + TcxButtonGroupItem = class(TCollectionItem) + private + FCaption: TCaption; + FEnabled: Boolean; + FTag: TcxTag; + function GetIsCollectionDestroying: Boolean; + function IsTagStored: Boolean; + procedure SetCaption(const Value: TCaption); + procedure SetEnabled(Value: Boolean); + protected + procedure DoChanged(ACollection: TCollection; ACollectionOperation: TcxCollectionOperation; + AIndex: Integer = -1); + property Caption: TCaption read FCaption write SetCaption; + property Enabled: Boolean read FEnabled write SetEnabled default True; + property IsCollectionDestroying: Boolean read GetIsCollectionDestroying; + property Tag: TcxTag read FTag write FTag stored IsTagStored; + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function GetCaption: TCaption; + end; + + { TcxButtonGroupItems } + + TcxButtonGroupItems = class(TOwnedCollection, + IUnknown, IcxCheckItems) + private + FChangedItemIndex: Integer; + FChangedItemOperation: TcxCollectionOperation; + FIsDestroying: Boolean; + FItemChanged: Boolean; + function GetItem(Index: Integer): TcxButtonGroupItem; + procedure SetItem(Index: Integer; Value: TcxButtonGroupItem); + + { IUnknown } + function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + + { IcxCheckItems } + function IcxCheckItems.GetCaption = CheckItemsGetCaption; + function IcxCheckItems.GetCount = CheckItemsGetCount; + function CheckItemsGetCaption(Index: Integer): string; + function CheckItemsGetCount: Integer; + protected + procedure Update(Item: TCollectionItem); override; + property ChangedItemIndex: Integer read FChangedItemIndex; + property ChangedItemOperation: TcxCollectionOperation + read FChangedItemOperation; + property IsDestroying: Boolean read FIsDestroying; + property ItemChanged: Boolean read FItemChanged; + public + destructor Destroy; override; + procedure InternalNotify(AItem: TcxButtonGroupItem; AItemIndex: Integer; + AItemOperation: TcxCollectionOperation); + property Items[Index: Integer]: TcxButtonGroupItem + read GetItem write SetItem; default; + end; + + TcxButtonGroupItemsClass = class of TcxButtonGroupItems; + + { TcxCustomButtonGroupProperties } + + TcxCustomButtonGroupProperties = class(TcxCustomGroupBoxProperties) + private + FColumns: Integer; + FItems: TcxButtonGroupItems; + FWordWrap: Boolean; + procedure SetColumns(Value: Integer); + procedure SetItems(Value: TcxButtonGroupItems); + procedure SetWordWrap(Value: Boolean); + protected + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + function CreateItems: TcxButtonGroupItems; virtual; + function GetButtonsPerColumn: Integer; + function GetColumnCount: Integer; virtual; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function CreatePreviewProperties: TcxCustomEditProperties; override; + class function GetContainerClass: TcxContainerClass; override; + function GetSpecialFeatures: TcxEditSpecialFeatures; override; + function GetSupportedOperations: TcxEditSupportedOperations; override; + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + // !!! + property Columns: Integer read FColumns write SetColumns default 1; + property Items: TcxButtonGroupItems read FItems write SetItems; + property WordWrap: Boolean read FWordWrap write SetWordWrap default False; + end; + + { TcxPanelStyle } + + TcxPanelStyle = class(TPersistent) + private + FActive: Boolean; + FCaptionIndent: Integer; + FEdit: TcxCustomGroupBox; + FOfficeBackgroundKind: TcxPanelOffice11BackgroundKind; + FWordWrap: Boolean; + + procedure SetActive(AValue: Boolean); + procedure SetCaptionIndent(AValue: Integer); + procedure SetOfficeBackgroundKind(AValue: TcxPanelOffice11BackgroundKind); + procedure SetWordWrap(AValue: Boolean); + protected + procedure Update; + property Edit: TcxCustomGroupBox read FEdit; + public + constructor Create(AOwner: TcxCustomGroupBox); virtual; + procedure Assign(ASource: TPersistent); override; + published + property Active: Boolean read FActive write SetActive default False; + property CaptionIndent: Integer read FCaptionIndent write SetCaptionIndent default 2; + property OfficeBackgroundKind: TcxPanelOffice11BackgroundKind read FOfficeBackgroundKind + write SetOfficeBackgroundKind default pobkOffice11Color; + property WordWrap: Boolean read FWordWrap write SetWordWrap default False; + end; + + { TcxCustomGroupBox } + + TcxGroupBoxCustomDrawEvent = procedure (Sender: TcxCustomGroupBox; var ADone: Boolean) of object; + + TcxCustomGroupBox = class(TcxCustomEdit) + private + FAlignment: TcxCaptionAlignment; + FCaptionBkColor: TColor; // deprecated + FCaptionFont: TFont; + FIsAccelCharHandling: Boolean; + FPanelStyle: TcxPanelStyle; + FVisibleCaption: string; + FOnCustomDraw: TcxGroupBoxCustomDrawEvent; + + procedure CalculateVisibleCaption; + function GetCaptionBkColor: TColor; // deprecated + function GetColor: TColor; // deprecated + function GetFont: TFont; // deprecated + function IsSkinAvailable: Boolean; + + procedure UpdateCaption; + procedure UpdateNonClientArea; + function GetPanelStyleCaptionDrawingFlags: Cardinal; + function GetHorizontalCaptionIndent: Integer; + function GetVerticalCaptionIndent: Integer; + function GetVisibleCaption: string; + + procedure SetAlignment(Value: TcxCaptionAlignment); + procedure SetCaptionBkColor(Value: TColor); // deprecated + procedure SetColor(Value: TColor); // deprecated + procedure SetFont(Value: TFont); // deprecated + procedure SetPanelStyle(AValue: TcxPanelStyle); + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + procedure WMNCPaint(var Message: TWMNCPaint); + {$IFNDEF DELPHI7} + procedure WMPrintClient(var Message: TMessage); message WM_PRINTCLIENT; + {$ENDIF} + protected + procedure AdjustClientRect(var Rect: TRect); override; + function CanAutoSize: Boolean; override; + function CanFocusOnClick: Boolean; override; + function CanHaveTransparentBorder: Boolean; override; + + procedure ContainerStyleChanged(Sender: TObject); override; + function CreatePanelStyle: TcxPanelStyle; virtual; + function DefaultParentColor: Boolean; override; + procedure FontChanged; override; + function GetShadowBounds: TRect; override; + procedure Initialize; override; + function InternalGetActiveStyle: TcxContainerStyle; override; + function InternalGetNotPublishedStyleValues: TcxEditStyleValues; override; + function IsContainerClass: Boolean; override; + function IsNativeBackground: Boolean; override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); override; + procedure Paint; override; + procedure TextChanged; override; + function HasShadow: Boolean; override; + procedure AdjustCanvasFontSettings(ACanvas: TcxCanvas); + function DoCustomDraw: Boolean; + function GetCaptionDrawingFlags: Cardinal; + function HasNonClientArea: Boolean; virtual; + function IsNonClientAreaSupported: Boolean; virtual; + function IsVerticalText: Boolean; + procedure CalculateCaptionFont; + procedure WndProc(var Message: TMessage); override; + property CaptionBkColor: TColor read GetCaptionBkColor write SetCaptionBkColor stored False; // deprecated + property Color: TColor read GetColor write SetColor stored False; // deprecated + property Ctl3D; + property Font: TFont read GetFont write SetFont stored False; // deprecated + property PanelStyle: TcxPanelStyle read FPanelStyle write SetPanelStyle; + property ParentBackground; + property TabStop default False; + property OnCustomDraw: TcxGroupBoxCustomDrawEvent read FOnCustomDraw write FOnCustomDraw; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property Alignment: TcxCaptionAlignment read FAlignment write SetAlignment + default alTopLeft; + property Transparent; + end; + + { TcxGroupBox } + + TcxGroupBox = class(TcxCustomGroupBox) + published + property Align; + property Alignment; + property Anchors; + property BiDiMode; + property Caption; + property CaptionBkColor; // deprecated + property Color; // deprecated + property Constraints; + property Ctl3D; + property DockSite; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property Font; // deprecated + property LookAndFeel; // deprecated + property ParentBackground; + property ParentBiDiMode; + property ParentColor; + property ParentCtl3D; + property ParentFont; + property PanelStyle; + property ParentShowHint; + property PopupMenu; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Transparent; + property Visible; + property OnClick; + property OnContextPopup; + property OnCustomDraw; + property OnDblClick; + property OnDockDrop; + property OnDockOver; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnGetSiteInfo; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + property OnUnDock; + end; + + { TcxCustomButtonGroup } + + TcxCustomButtonGroup = class(TcxCustomGroupBox) + private + FButtons: TList; + procedure DoButtonDragDrop(Sender, Source: TObject; X, Y: Integer); + procedure DoButtonDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure DoButtonKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure DoButtonKeyPress(Sender: TObject; var Key: Char); + procedure DoButtonKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure DoButtonMouseDown(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + procedure DoButtonMouseMove(Sender: TObject; Shift: TShiftState; + X, Y: Integer); + procedure DoButtonMouseUp(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + procedure DoButtonMouseWheel(Sender: TObject; + Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint; var Handled: Boolean); + function GetProperties: TcxCustomButtonGroupProperties; + function GetActiveProperties: TcxCustomButtonGroupProperties; + procedure SetProperties(Value: TcxCustomButtonGroupProperties); + procedure WMWindowPosChanged(var Message: TWMWindowPosChanged); + message WM_WINDOWPOSCHANGED; + protected + function CanAutoSize: Boolean; override; + procedure ContainerStyleChanged(Sender: TObject); override; + procedure CursorChanged; override; + procedure DoEditKeyDown(var Key: Word; Shift: TShiftState); override; + procedure EnabledChanged; override; + procedure Initialize; override; + function IsButtonDC(ADC: THandle): Boolean; override; + function IsContainerClass: Boolean; override; + procedure PropertiesChanged(Sender: TObject); override; + procedure ReadState(Reader: TReader); override; + function RefreshContainer(const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AIsMouseEvent: Boolean): Boolean; override; + procedure CreateHandle; override; + procedure ArrangeButtons; virtual; + function GetButtonDC(AButtonIndex: Integer): THandle; virtual; abstract; + function GetButtonIndexAt(const P: TPoint): Integer; + function GetButtonInstance: TWinControl; virtual; abstract; + function GetFocusedButtonIndex: Integer; + procedure InitButtonInstance(AButton: TWinControl); virtual; + function IsNonClientAreaSupported: Boolean; override; + procedure SetButtonCount(Value: Integer); virtual; + procedure SynchronizeButtonsStyle; virtual; + procedure UpdateButtons; virtual; + property InternalButtons: TList read FButtons; + property TabStop default True; + public + destructor Destroy; override; + procedure ActivateByMouse(Shift: TShiftState; X, Y: Integer; + var AEditData: TcxCustomEditData); override; + function Focused: Boolean; override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + procedure GetTabOrderList(List: TList); override; + function IsButtonNativeStyle: Boolean; + property AutoSize default False; + property ActiveProperties: TcxCustomButtonGroupProperties + read GetActiveProperties; + property Properties: TcxCustomButtonGroupProperties read GetProperties + write SetProperties; + end; + +implementation + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + dxThemeConsts, cxEditUtils, Math, Types, dxOffice11, TypInfo, dxThemeManager, + dxUxTheme, cxDrawTextUtils, cxGeometry; + +const + cxCaptionRectLeftBound = 8; + cxNativeState: array[Boolean] of Integer = (GBS_DISABLED, GBS_NORMAL); + +type + TControlAccess = class(TControl); + TWinControlAccess = class(TWinControl); + +function cxGroupBoxAlignment2GroupBoxCaption(AAlignment: TcxCaptionAlignment): TcxGroupBoxCaptionPosition; +begin + if AAlignment in [alTopLeft, alTopCenter, alTopRight] then + Result := cxgpTop + else + if AAlignment in [alBottomLeft, alBottomCenter, alBottomRight] then + Result := cxgpBottom + else + if AAlignment in [alLeftTop, alLeftCenter, alLeftBottom] then + Result := cxgpLeft + else + if AAlignment in [alRightTop, alRightCenter, alRightBottom] then + Result := cxgpRight + else + Result := cxgpCenter; +end; + +{ TcxGroupBoxButtonViewInfo } + +function TcxGroupBoxButtonViewInfo.GetGlyphRect(ACanvas: TcxCanvas; AGlyphSize: TSize; AAlignment: TLeftRight; AIsPaintCopy: Boolean): TRect; +begin + Result.Top := Bounds.Top + (Bounds.Bottom - Bounds.Top - AGlyphSize.cy) div 2; + Result.Bottom := Result.Top + AGlyphSize.cy; + if AAlignment = taRightJustify then + begin + Result.Left := Bounds.Left; + Result.Right := Result.Left + AGlyphSize.cx; + end + else + begin + Result.Right := Bounds.Right; + Result.Left := Result.Right - AGlyphSize.cx; + end; +end; + +{ TcxGroupBoxViewInfo } + +constructor TcxGroupBoxViewInfo.Create; +begin + inherited Create; +end; + +destructor TcxGroupBoxViewInfo.Destroy; +begin + inherited Destroy; +end; + +function TcxGroupBoxViewInfo.GetButtonViewInfoClass: TcxEditButtonViewInfoClass; +begin + Result := TcxGroupBoxButtonViewInfo; +end; + +procedure TcxGroupBoxViewInfo.InternalPaint(ACanvas: TcxCanvas); +begin + if IsInplace then + begin + if Edit = nil then + inherited InternalPaint(ACanvas) + else + if IsCustomBackground then + DrawBackground(ACanvas) + else + cxEditFillRect(ACanvas, Bounds, BackgroundColor); + Exit; + end; + + InternalDrawBackground(ACanvas); + DrawCaption(ACanvas); + + if not Edit.PanelStyle.Active then + ACanvas.ExcludeClipRect(CaptionRect); + + DrawFrame(ACanvas, GetFrameBounds); + + if Edit.IsDBEditPaintCopyDrawing then + DrawButtons(ACanvas); +end; + +function TcxGroupBoxViewInfo.GetCaptionRectIndent: TRect; +var + ACaptionPosition: TcxGroupBoxCaptionPosition; + R1: TRect; +begin + Result := cxNullRect; + if Assigned(Edit) and Assigned(Edit.Style.LookAndFeel.SkinPainter) and not Edit.PanelStyle.Active then + begin + ACaptionPosition := cxGroupBoxAlignment2GroupBoxCaption(Edit.Alignment); + R1 := Edit.Style.LookAndFeel.SkinPainter.GroupBoxBorderSize(True, ACaptionPosition); + case ACaptionPosition of + cxgpTop: + Result.Top := R1.Top + R1.Bottom; + cxgpBottom: + Result.Bottom := R1.Top + R1.Bottom; + cxgpLeft: + Result.Left := R1.Right + R1.Left; + cxgpRight: + Result.Right := R1.Right + R1.Left; + end; + end; +end; + +function TcxGroupBoxViewInfo.GetControlRect: TRect; +begin + Result := cxContainer.GetControlRect(Edit); +end; + +function TcxGroupBoxViewInfo.GetEdit: TcxCustomGroupBox; +begin + Result := TcxCustomGroupBox(FEdit); +end; + +function TcxGroupBoxViewInfo.CalcOffsetBoundsForPanel: TRect; +var + ABorderSize: TRect; + ACaptionIndentRect: TRect; + ABorderWidth: Integer; +begin + ABorderWidth := GetContainerBorderWidth(TcxContainerBorderStyle(BorderStyle)); + ABorderSize := Rect(ABorderWidth, ABorderWidth, ABorderWidth, ABorderWidth); + ACaptionIndentRect := cxEmptyRect; + case Edit.Alignment of + alTopLeft, alLeftTop, alLeftCenter, alLeftBottom, alBottomLeft: + ACaptionIndentRect.Left := Edit.GetHorizontalCaptionIndent; + alTopRight, alRightTop, alRightCenter, alRightBottom, alBottomRight: + ACaptionIndentRect.Right := Edit.GetHorizontalCaptionIndent; + end; + case Edit.Alignment of + alLeftTop, alTopLeft, alTopCenter, alTopRight, alRightTop: + ACaptionIndentRect.Top := Edit.GetVerticalCaptionIndent; + alLeftBottom, alBottomLeft, alBottomCenter, alBottomRight, alRightBottom: + ACaptionIndentRect.Bottom := Edit.GetVerticalCaptionIndent; + end; + Result.Left := ABorderSize.Left + ACaptionIndentRect.Left; + Result.Top := ABorderSize.Top + ACaptionIndentRect.Top; + Result.Right := ABorderSize.Right + ACaptionIndentRect.Right; + Result.Bottom := ABorderSize.Bottom + ACaptionIndentRect.Bottom; +end; + +procedure TcxGroupBoxViewInfo.CalcBoundsForPanel; +begin + if Edit.PanelStyle.Active then + begin + CalcTextBoundsForPanel; + AdjustTextBoundsForPanel; + CaptionRect := TextRect; + AdjustCaptionBoundsForPanel; + end; +end; + +function TcxGroupBoxViewInfo.GetFrameBounds: TRect; +var + ABorderWidth: Integer; +begin + ABorderWidth := GetContainerBorderWidth(TcxContainerBorderStyle(BorderStyle)); + if Edit.PanelStyle.Active then + Result := GetBoundsForPanel + else + begin + Result := BorderRect; + ExtendRectByBorders(Result, ABorderWidth, Edges); + end; +end; + +procedure TcxGroupBoxViewInfo.CalcTextBoundsForPanel; +var + AFlag: Cardinal; + ACanvas: TcxCanvas; +begin + AFlag := CXTO_CALCRECT; + if Edit.PanelStyle.WordWrap then + AFlag := AFlag or CXTO_WORDBREAK; + TextRect := CalcCorrectionBoundsForPanel; + ACanvas := TcxCanvas.Create(Edit.Canvas.Canvas); + try + Edit.AdjustCanvasFontSettings(ACanvas); + cxTextOut(ACanvas.Handle, PChar(Edit.FVisibleCaption), TextRect, AFlag); + finally + FreeAndNil(ACanvas); + end; +end; + +function TcxGroupBoxViewInfo.CalcCorrectionBoundsForPanel: TRect; +var + AOffsetRect: TRect; +begin + AOffsetRect := CalcOffsetBoundsForPanel; + Result := GetBoundsForPanel; + with AOffsetRect do + begin + Inc(Result.Left, Left); + Inc(Result.Top, Top); + Dec(Result.Right, Right); + Dec(Result.Bottom, Bottom); + end; +end; + +procedure TcxGroupBoxViewInfo.AdjustTextBoundsForPanel; +var + ATextWidth, ATextHeight: Integer; + R: TRect; +begin + with TextRect do + begin + ATextWidth := Right - Left; + ATextHeight := Bottom - Top; + end; + R := CalcCorrectionBoundsForPanel; + OffsetRect(TextRect, R.Left - TextRect.Left, R.Top - TextRect.Top); + case Edit.Alignment of + alTopCenter, alBottomCenter, alCenterCenter: + OffsetRect(TextRect, (R.Right - R.Left - ATextWidth - TextRect.Left) div 2, 0); + alTopRight, alRightTop, alRightCenter, alRightBottom, alBottomRight: + OffsetRect(TextRect, R.Right - ATextWidth - TextRect.Left, 0); + end; + case Edit.Alignment of + alLeftCenter, alRightCenter, alCenterCenter: + OffsetRect(TextRect, 0, (R.Bottom - R.Top - ATextHeight - TextRect.Top) div 2); + alLeftBottom, alBottomLeft, alBottomCenter, alBottomRight, alRightBottom: + OffsetRect(TextRect, 0, R.Bottom - ATextHeight - TextRect.Top); + end; +end; + +procedure TcxGroupBoxViewInfo.AdjustCaptionBoundsForPanel; + + procedure ChangeIfLess(var AInValue, AChangeValue: Integer); + begin + AInValue := Max(AChangeValue, AInValue); + end; + procedure ChangeIfGreat(var AInValue, AChangeValue: Integer); + begin + AInValue := Min(AChangeValue, AInValue); + end; + +var + R: TRect; +begin + R := CalcCorrectionBoundsForPanel; + ChangeIfGreat(CaptionRect.Right, R.Right); + ChangeIfGreat(CaptionRect.Bottom, R.Bottom); + ChangeIfLess(CaptionRect.Left, R.Left); + ChangeIfLess(CaptionRect.Top, R.Top); +end; + +procedure TcxGroupBoxViewInfo.DrawCaption(ACanvas: TcxCanvas); +var + ACaptionPos: TcxGroupBoxCaptionPosition; +begin + if Edit.FVisibleCaption = '' then + Exit; + ACanvas.SaveClipRegion; + try + ACanvas.SetClipRegion(TcxRegion.Create(CaptionRect), roIntersect); + Edit.AdjustCanvasFontSettings(ACanvas); + + if Assigned(Painter) then + begin + ACaptionPos := cxGroupBoxAlignment2GroupBoxCaption(Edit.Alignment); + if not Edit.PanelStyle.Active then + Painter.DrawGroupBoxCaption(ACanvas, CaptionRect, ACaptionPos); + end; + + if not Edit.IsVerticalText then + DrawHorizontalTextCaption(ACanvas) + else + DrawVerticalTextCaption(ACanvas); + finally + ACanvas.RestoreClipRegion; + end; +end; + +procedure TcxGroupBoxViewInfo.DrawHorizontalTextCaption(ACanvas: TcxCanvas); +begin + ACanvas.Brush.Style := bsClear; + cxDrawText(ACanvas.Handle, PChar(Edit.FVisibleCaption), TextRect, Edit.GetCaptionDrawingFlags); +end; + +procedure TcxGroupBoxViewInfo.DrawVerticalTextCaption(ACanvas: TcxCanvas); +var + AFlags, X, Y: Integer; +begin + AFlags := ETO_CLIPPED; + if Edit.FAlignment in [alLeftTop, alLeftCenter, alLeftBottom] then + begin + X := TextRect.Left; + Y := TextRect.Bottom - 1; + end + else + begin + X := TextRect.Right; + Y := TextRect.Top + 1; + end; + ACanvas.Brush.Style := bsClear; + cxExtTextOut(ACanvas.Handle, Edit.FVisibleCaption, Point(X, Y), TextRect, AFlags); +end; + +procedure TcxGroupBoxViewInfo.DrawFrame(ACanvas: TcxCanvas; R: TRect); +var + ABackgroundRect: TRect; + ANativeState: Integer; + ATheme: TdxTheme; +begin + if NativeStyle then + begin + if Edit.PanelStyle.Active then + begin + if BorderStyle <> ebsNone then + Edit.LookAndFeelPainter.DrawBorder(ACanvas, GetBoundsForPanel); + end + else + begin + if BorderStyle <> ebsNone then + begin + ATheme := OpenTheme(totButton); + ANativeState := cxNativeState[Enabled]; + ABackgroundRect := GetThemeBackgroundRect(ACanvas); + DrawThemeBackground(ATheme, ACanvas.Handle, BP_GROUPBOX, ANativeState, + ABackgroundRect); + end; + end; + end + else + begin + if not Assigned(Painter) then + begin + case BorderStyle of + ebsSingle: ACanvas.FrameRect(R, BorderColor, 1, Edit.ActiveStyle.Edges, True); + ebsThick: ACanvas.FrameRect(R, BorderColor, 2, Edit.ActiveStyle.Edges, True); + ebsFlat: + begin + ACanvas.FrameRect(R, clBtnShadow, 1, Edit.ActiveStyle.Edges, True); + InflateRect(R, -1, -1); + ACanvas.FrameRect(R, clBtnHighlight, 1, Edit.ActiveStyle.Edges, True); + end; + ebs3D: + if Edit.Ctl3D then + begin + Dec(R.Right); + Dec(R.Bottom); + ACanvas.FrameRect(R, clBtnShadow, 1, Edit.ActiveStyle.Edges, True); + OffsetRect(R, 1, 1); + ACanvas.FrameRect(R, clBtnHighlight, 1, Edit.ActiveStyle.Edges, True); + end + else + begin + ACanvas.FrameRect(R, clWindowFrame, 1, Edit.ActiveStyle.Edges, True); + InflateRect(R, -1, -1); + ACanvas.FrameRect(R, BackgroundColor, 1, Edit.ActiveStyle.Edges, True); + end; + end; + end; + end; +end; + +function TcxGroupBoxViewInfo.GetThemeBackgroundRect( + ACanvas: TcxCanvas): TRect; +begin + Result := ControlRect; + if not Edit.PanelStyle.Active then + case Edit.FAlignment of + alTopLeft, alTopCenter, alTopRight: + Result.Top := ACanvas.TextHeight('Qq') div 2; + alBottomLeft, alBottomCenter, alBottomRight: + Dec(Result.Bottom, ACanvas.TextHeight('Qq') div 2); + alLeftTop, alLeftCenter, alLeftBottom: + Result.Left := ACanvas.TextHeight('Qq') div 2; + alRightTop, alRightCenter, alRightBottom: + Dec(Result.Right, ACanvas.TextHeight('Qq') div 2); + end; +end; + +function TcxGroupBoxViewInfo.GetBoundsForPanel: TRect; +begin + Result := Bounds; + if not NativeStyle and (Painter = nil) then + if Edit.HasShadow then + begin + Dec(Result.Right, cxContainerShadowWidth); + Dec(Result.Bottom, cxContainerShadowWidth); + end; +end; + +procedure TcxGroupBoxViewInfo.DrawUsualBackground(ACanvas: TcxCanvas); +begin + if Edit.HasShadow then + DrawContainerShadow(ACanvas, GetFrameBounds); + if not Transparent then + begin + if Edit.IsTransparent then + cxDrawTransparentControlBackground(Edit, ACanvas, ControlRect) + else + cxEditFillRect(ACanvas, ControlRect, BackgroundColor); + end; +end; + +procedure TcxGroupBoxViewInfo.DrawNativeBackground(ACanvas: TcxCanvas; + const ACaptionRect: TRect); +begin + if Edit.PanelStyle.Active then + DrawNativePanelBackground(ACanvas, ACaptionRect) + else + DrawNativeGroupBoxBackground(ACanvas); +end; + +procedure TcxGroupBoxViewInfo.DrawNativeGroupBoxBackground( + ACanvas: TcxCanvas); +var + AClipRgn: TcxRegion; + ANativeState: Integer; + ATheme: TdxTheme; +begin + AClipRgn := ACanvas.GetClipRegion; + try + ATheme := OpenTheme(totButton); + ANativeState := cxNativeState[Enabled]; + if Edit.IsTransparent then + cxDrawTransparentControlBackground(Edit, ACanvas, Bounds) + else + if Edit.IsNativeBackground and + IsThemeBackgroundPartiallyTransparent(ATheme, BP_GROUPBOX, ANativeState) then + cxDrawThemeParentBackground(Edit, ACanvas, Bounds) + else + cxEditFillRect(ACanvas.Handle, Bounds, GetSolidBrush(ACanvas, BackgroundColor)); + finally + ACanvas.SetClipRegion(AClipRgn, roSet); + end; +end; + +procedure TcxGroupBoxViewInfo.DrawNativePanelBackground( + ACanvas: TcxCanvas; const ACaptionRect: TRect); +var + ABackgroundRect: TRect; +begin + ABackgroundRect := GetBoundsForPanel; + if BorderStyle <> ebsNone then + InflateRect(ABackgroundRect, -Edit.LookAndFeelPainter.BorderSize, -Edit.LookAndFeelPainter.BorderSize); + + if Edit.IsTransparent then + begin + ACanvas.SaveClipRegion; + try + ACanvas.SetClipRegion(TcxRegion.Create(ABackgroundRect), roIntersect); + Edit.LookAndFeelPainter.DrawPanelBackground(ACanvas, Edit, GetBoundsForPanel); + finally + ACanvas.RestoreClipRegion; + end; + end + else + if Edit.LookAndFeel.NativeStyle then + if Edit.IsNativeBackground then + cxDrawThemeParentBackground(Edit, ACanvas, ABackgroundRect) + else + Edit.LookAndFeelPainter.DrawPanelBackground(ACanvas, Edit, ABackgroundRect, BackgroundColor) + else + if Edit.LookAndFeel.Kind = lfOffice11 then + DrawOffice11PanelBackground(ACanvas, ABackgroundRect); +end; + +procedure TcxGroupBoxViewInfo.DrawOffice11PanelBackground(ACanvas: TcxCanvas; const R: TRect); +begin + with Edit.LookAndFeelPainter do + case Edit.PanelStyle.OfficeBackgroundKind of + pobkGradient: + DrawPanelBackground(ACanvas, Edit, R, dxOffice11ToolbarsColor1, dxOffice11ToolbarsColor2); + pobkOffice11Color: + DrawPanelBackground(ACanvas, Edit, R, GetMiddleRGB(dxOffice11ToolbarsColor1, dxOffice11ToolbarsColor2, 50)); + pobkStyleColor: + DrawPanelBackground(ACanvas, Edit, R, BackgroundColor); + end; +end; + +procedure TcxGroupBoxViewInfo.InternalDrawBackground(ACanvas: TcxCanvas); +begin + if NativeStyle then + DrawNativeBackground(ACanvas, CaptionRect) + else + begin + ACanvas.SaveClipRegion; + try + if Assigned(Edit.LookAndFeel.SkinPainter) then + begin + if Edit.PanelStyle.Active then + Painter.DrawPanelContent(ACanvas, GetBoundsForPanel, BorderStyle <> ebsNone) + else + begin + cxDrawTransparentControlBackground(Edit, ACanvas, ControlRect); + Painter.DrawGroupBoxContent(ACanvas, BorderRect, + cxGroupBoxAlignment2GroupBoxCaption(Edit.Alignment)); + end; + end + else + DrawUsualBackground(ACanvas); + finally + ACanvas.RestoreClipRegion; + end; + end; +end; + +{ TcxGroupBoxViewData } + +procedure TcxGroupBoxViewData.Calculate(ACanvas: TcxCanvas; + const ABounds: TRect; const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); +var + AEditViewInfo: TcxGroupBoxViewInfo; +begin + AEditViewInfo := TcxGroupBoxViewInfo(AViewInfo); + AEditViewInfo.IsDesigning := IsDesigning; + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, AIsMouseEvent); + + if not IsInplace then + begin + Edit.CalculateCaptionFont; + Edit.CalculateVisibleCaption; + CalcRects(ACanvas, AEditViewInfo); + end; +end; + +function TcxGroupBoxViewData.GetBorderColor: TColor; +begin + if Style.BorderStyle in [ebsUltraFlat, ebsOffice11] then + begin + if Enabled then + Result := GetEditBorderHighlightColor(Style.BorderStyle = ebsOffice11) + else + Result := clBtnShadow; + end + else + Result := Style.BorderColor; +end; + +function TcxGroupBoxViewData.GetBorderExtent: TRect; +var + AHeaderSideBorderOffset: Integer; +begin + Result := inherited GetBorderExtent; + if not IsInplace and (Edit.FAlignment <> alCenterCenter) and not Edit.PanelStyle.Active then + begin + cxScreenCanvas.Font := Edit.FCaptionFont; + AHeaderSideBorderOffset := cxScreenCanvas.TextHeight('Qq') div 2 - 1 + + cxEditMaxBorderWidth; + case Edit.FAlignment of + alTopLeft, alTopCenter, alTopRight: + Result.Top := AHeaderSideBorderOffset; + alBottomLeft, alBottomCenter, alBottomRight: + Result.Bottom := AHeaderSideBorderOffset; + alLeftTop, alLeftCenter, alLeftBottom: + Result.Left := AHeaderSideBorderOffset - 1; + alRightTop, alRightCenter, alRightBottom: + Result.Right := AHeaderSideBorderOffset - 1; + end; + end; +end; + +function TcxGroupBoxViewData.GetClientExtent(ACanvas: TcxCanvas; + AViewInfo: TcxCustomEditViewInfo): TRect; +var + AHeaderSideClientExtent: Integer; + ABorderWidth: Integer; +begin + if IsInplace or (Style.LookAndFeel.SkinPainter = nil) then + Result := inherited GetBorderExtent + else + begin + if Edit.PanelStyle.Active then + Result := Style.LookAndFeel.SkinPainter.PanelBorderSize + else + Result := Style.LookAndFeel.SkinPainter.GroupBoxBorderSize(False, + cxGroupBoxAlignment2GroupBoxCaption(Edit.Alignment)); + ABorderWidth := Edit.LookAndFeelPainter.BorderSize; + OffsetRect(Result, ABorderWidth, ABorderWidth); + if HasShadow then + begin + Result.Right := Result.Right + cxEditShadowWidth; + Result.Bottom := Result.Bottom + cxEditShadowWidth; + end; + if HasNonClientArea then + with TcxGroupBoxViewInfo(AViewInfo) do + begin + case cxGroupBoxAlignment2GroupBoxCaption(Edit.Alignment) of + cxgpTop: + Inc(Result.Bottom, GetCaptionRectIndent.Top); + cxgpLeft: + Inc(Result.Right, GetCaptionRectIndent.Left); + end; + end; + end; + + if not IsInplace and not Edit.PanelStyle.Active then + if Edit.FAlignment <> alCenterCenter then + begin + cxScreenCanvas.Font := Edit.FCaptionFont; + AHeaderSideClientExtent := cxScreenCanvas.TextHeight('Qq') + + Result.Top + cxEditMaxBorderWidth + 1; + case Edit.FAlignment of + alTopLeft, alTopCenter, alTopRight: + Result.Top := AHeaderSideClientExtent; + alBottomLeft, alBottomCenter, alBottomRight: + Result.Bottom := AHeaderSideClientExtent; + alLeftTop, alLeftCenter, alLeftBottom: + Result.Left := AHeaderSideClientExtent; + alRightTop, alRightCenter, alRightBottom: + Result.Right := AHeaderSideClientExtent; + end; + end; +end; + +function TcxGroupBoxViewData.HasShadow: Boolean; +begin + Result := Edit.HasShadow and inherited HasShadow; +end; + +class function TcxGroupBoxViewData.IsNativeStyle(ALookAndFeel: TcxLookAndFeel): Boolean; +begin + Result := AreVisualStylesMustBeUsed( + ALookAndFeel.NativeStyle or (ALookAndFeel.Kind = lfOffice11), totEdit) and + (ALookAndFeel.SkinPainter = nil); +end; + +function TcxGroupBoxViewData.GetContainerState(const ABounds: TRect; + const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AIsMouseEvent: Boolean): TcxContainerState; +begin + if Enabled then + Result := [csNormal] + else + Result := [csDisabled]; +end; + +function TcxGroupBoxViewData.HasNonClientArea: Boolean; +begin + Result := not IsInplace and Edit.HasNonClientArea; +end; + +function TcxGroupBoxViewData.GetShadowWidth: Integer; +begin + Result := 0; + if HasShadow then + Result := cxContainerShadowWidth; +end; + +function TcxGroupBoxViewData.GetCaptionRect(ACanvas: TcxCanvas): TRect; +var + ACaptionSize: TSize; +begin + if Edit.FVisibleCaption = '' then + begin + Result := cxEmptyRect; + Exit; + end; + + Edit.AdjustCanvasFontSettings(ACanvas); + with ACanvas do + begin + ACaptionSize := cxTextExtent(Font, Edit.FVisibleCaption, Font.Size); + Result := Rect(0, 0, ACaptionSize.cx, ACaptionSize.cy); + OffsetRect(Result, cxCaptionRectLeftBound, 0); + + if not Edit.IsVerticalText then + AdjustHorizontalCaptionRect(Result) + else + AdjustVerticalCaptionRect(Result); + //B93506 + //InflateRect(Result, 1, 1); + end; +end; + +procedure TcxGroupBoxViewData.AdjustHorizontalCaptionRect(var R: TRect); +var + AShadowWidth: Integer; +begin + AShadowWidth := GetShadowWidth; + + case Edit.FAlignment of + alTopCenter, alBottomCenter, alCenterCenter: + OffsetRect(R, -R.Left + (Edit.Width - AShadowWidth - (R.Right - R.Left)) div 2, 0); + alTopRight, alRightTop, alRightCenter, alRightBottom, alBottomRight: + OffsetRect(R, Edit.Width - R.Right - R.Left - AShadowWidth, 0); + end; + case Edit.FAlignment of + alLeftCenter, alRightCenter, alCenterCenter: + OffsetRect(R, 0, -R.Top + (Edit.Height - AShadowWidth - + (R.Bottom - R.Top)) div 2); + alLeftBottom, alBottomLeft, alBottomCenter, alBottomRight, alRightBottom: + R := Rect(R.Left, Edit.Height - R.Top - + (R.Bottom - R.Top), R.Right, Edit.Height - R.Top); + end +end; + +procedure TcxGroupBoxViewData.AdjustVerticalCaptionRect(var R: TRect); +var + AShadowWidth, ATextWidth: Integer; +begin + AShadowWidth := GetShadowWidth; + ATextWidth := R.Right - R.Left; + + case Edit.FAlignment of + alLeftTop: + begin + R := Rect(R.Top, R.Left, R.Bottom, 0); + R.Bottom := R.Top + ATextWidth + 1; + end; + alLeftCenter: + begin + R := Rect(R.Top, 0, R.Bottom, + Edit.Height - AShadowWidth - (Edit.Height - AShadowWidth - ATextWidth) div 2); + R.Top := R.Bottom - ATextWidth - 1; + end; + alLeftBottom: + begin + R := Rect(R.Top, 0, R.Bottom, + Edit.Height - AShadowWidth - R.Left); + R.Top := R.Bottom - ATextWidth - 1; + end; + alRightTop: + R := Rect(Edit.Width - R.Bottom, R.Left, + Edit.Width - R.Top, R.Left + ATextWidth); + alRightCenter: + begin + R := Rect(Edit.Width - R.Bottom, + (Edit.Height - ATextWidth) div 2, Edit.Width - R.Top, 0); + R.Bottom := R.Top + ATextWidth; + end; + alRightBottom: + R := Rect(Edit.Width - R.Bottom, + Edit.Height - R.Left - ATextWidth, Edit.Width - R.Top, + Edit.Height - R.Left); + end; +end; + +function TcxGroupBoxViewData.GetEdit: TcxCustomGroupBox; +begin + Result := TcxCustomGroupBox(FEdit); +end; + +procedure TcxGroupBoxViewData.CalcRects(ACanvas: TcxCanvas; + AEditViewInfo: TcxGroupBoxViewInfo); + + procedure CalculateBorderRect(var R: TRect; const AIndent: TRect; + ACaptionPosition: TcxGroupBoxCaptionPosition); + begin + if HasNonClientArea then + case ACaptionPosition of + cxgpTop: + Dec(R.Bottom, AIndent.Top); + cxgpLeft: + Dec(R.Right, AIndent.Left); + end; + end; + + procedure CalculateCaptionRect(var R: TRect; const AIndent: TRect; + const ATextSize: TSize; ACaptionPosition: TcxGroupBoxCaptionPosition); + begin + case ACaptionPosition of + cxgpBottom: + R.Top := R.Bottom - ATextSize.cy - AIndent.Bottom; + cxgpRight: + R.Left := R.Right - ATextSize.cy - AIndent.Right; + cxgpCenter: + R := cxRectCenter(R, ATextSize); + cxgpLeft: + begin + R.Right := R.Left + ATextSize.cy; + if HasNonClientArea then + Dec(R.Left, AIndent.Left) + else + Inc(R.Right, AIndent.Left); + end; + cxgpTop: + begin + R.Bottom := R.Top + ATextSize.cy; + if HasNonClientArea then + Dec(R.Top, AIndent.Top) + else + Inc(R.Bottom, AIndent.Top); + end; + end; + end; + + procedure CalculateTextRect(const ABorderSize: TRect; ATextWidth: Integer); + begin + with AEditViewInfo do + begin + TextRect := cxRectContent(CaptionRect, ABorderSize); + if Edit.Alignment in [alTopRight, alBottomRight] then + TextRect.Left := TextRect.Right - ATextWidth; + if Edit.Alignment in [alTopCenter, alBottomCenter] then + TextRect.Left := (TextRect.Left + TextRect.Right - ATextWidth) div 2; + if Edit.Alignment in [alLeftTop, alRightTop] then + TextRect.Bottom := TextRect.Top + ATextWidth; + if Edit.Alignment in [alLeftBottom, alRightBottom] then + TextRect.Top := TextRect.Bottom - ATextWidth; + if Edit.Alignment in [alLeftCenter, alRightCenter] then + begin + TextRect.Top := (TextRect.Bottom + TextRect.Top - ATextWidth) div 2; + TextRect.Bottom := TextRect.Top + ATextWidth; + end; + end; + end; + +var + ACaptionPos: TcxGroupBoxCaptionPosition; + ARect: TRect; + ATextSize: TSize; +begin + if Edit.PanelStyle.Active then + begin + AEditViewInfo.CalcBoundsForPanel; + Exit; + end; + + if Style.LookAndFeel.SkinPainter = nil then + begin + AEditViewInfo.CaptionRect := GetCaptionRect(ACanvas); + AEditViewInfo.TextRect := AEditViewInfo.CaptionRect; + end + else + with AEditViewInfo do + begin + ARect := GetCaptionRectIndent; + BorderRect := ControlRect; + CaptionRect := BorderRect; + Edit.AdjustCanvasFontSettings(ACanvas); + ATextSize := ACanvas.TextExtent(Edit.FVisibleCaption); + ATextSize.cy := Max(ATextSize.cy, ACanvas.TextHeight('Qq')); + ACaptionPos := cxGroupBoxAlignment2GroupBoxCaption(Edit.Alignment); + CalculateCaptionRect(CaptionRect, ARect, ATextSize, ACaptionPos); + CalculateBorderRect(BorderRect, ARect, ACaptionPos); + CalculateTextRect(Style.LookAndFeel.SkinPainter.GroupBoxBorderSize(True, + ACaptionPos), ATextSize.cx); + end; +end; + +{ TcxButtonGroupViewInfo } + +procedure TcxButtonGroupViewInfo.DrawEditButton(ACanvas: TcxCanvas; + AButtonVisibleIndex: Integer); +var + AButtonViewInfo: TcxGroupBoxButtonViewInfo; + AGlyphRect: TRect; +begin + AButtonViewInfo := TcxGroupBoxButtonViewInfo(ButtonsInfo[AButtonVisibleIndex]); + AGlyphRect := AButtonViewInfo.GetGlyphRect(ACanvas, GetGlyphSize, + Alignment, IsDBEditPaintCopyDrawing); + if not IsDBEditPaintCopyDrawing then + DrawEditBackground(ACanvas, AButtonViewInfo.Bounds, AGlyphRect, + IsButtonGlypthTransparent(AButtonViewInfo)); + DrawButtonGlyph(ACanvas, AButtonViewInfo, AGlyphRect); + DrawButtonCaption(ACanvas, AButtonViewInfo, AGlyphRect); +end; + +function TcxButtonGroupViewInfo.GetGlyphSize: TSize; +begin + Result := GlyphSize; +end; + +{ TcxButtonGroupViewData } + +procedure TcxButtonGroupViewData.Calculate(ACanvas: TcxCanvas; + const ABounds: TRect; const P: TPoint; Button: TcxMouseButton; + Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); +begin + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, + AIsMouseEvent); + with TcxButtonGroupViewInfo(AViewInfo) do + begin + DrawTextFlags := GetDrawTextFlags; + CaptionExtent := GetCaptionRectExtent; + end; +end; + +procedure TcxButtonGroupViewData.CalculateButtonsViewInfo(ACanvas: TcxCanvas; + const ABounds: TRect; const P: TPoint; Button: TcxMouseButton; + Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); + + procedure CalculateButtonStates; + var + AButtonsCount, APrevPressedButton, I: Integer; + AButtonViewInfo: TcxGroupBoxButtonViewInfo; + ACapturePressing, AHoldPressing, AIsButtonPressed, AMouseButtonPressing: Boolean; + begin + AButtonsCount := Properties.Items.Count; + AViewInfo.IsButtonReallyPressed := False; + if AIsMouseEvent then + APrevPressedButton := AViewInfo.PressedButton + else + APrevPressedButton := -1; + AViewInfo.PressedButton := -1; + AViewInfo.SelectedButton := -1; + + for I := 0 to AButtonsCount - 1 do + begin + AButtonViewInfo := TcxGroupBoxButtonViewInfo(AViewInfo.ButtonsInfo[I]); + AButtonViewInfo.Index := I; + AButtonViewInfo.Data.NativeStyle := IsButtonNativeStyle(Style.LookAndFeel); + AButtonViewInfo.Data.Transparent := (Self.Style.ButtonTransparency = ebtAlways) or + (Self.Style.ButtonTransparency = ebtInactive) and not Selected; + + AButtonViewInfo.Data.BackgroundColor := AViewInfo.BackgroundColor; + AIsButtonPressed := IsButtonPressed(AViewInfo, I); + with AButtonViewInfo do + begin + if not Enabled then + Data.State := ebsDisabled + else + if AIsButtonPressed or (not IsDesigning and PtInRect(AButtonViewInfo.Bounds, P)) then + begin + ACapturePressing := (Button = cxmbNone) and (ButtonToShift(mbLeft) * + Shift <> []) and (Data.State = ebsNormal) and (GetCaptureButtonVisibleIndex = + I); + AMouseButtonPressing := (Button = ButtonTocxButton(mbLeft)) and + ((Shift = ButtonToShift(mbLeft)) or + (Shift = ButtonToShift(mbLeft) + [ssDouble])); + AHoldPressing := (Data.State = ebsPressed) and (Shift * ButtonToShift(mbLeft) <> []); + if AIsButtonPressed or AMouseButtonPressing or AHoldPressing or + ACapturePressing then + AViewInfo.IsButtonReallyPressed := True; + if not AIsButtonPressed and (Shift = []) and not ACapturePressing then + begin + Data.State := ebsSelected; + AViewInfo.SelectedButton := I; + end + else + if (AIsButtonPressed or ACapturePressing and CanPressButton(AViewInfo, I) or ((Shift = [ssLeft]) or (Shift = [ssLeft, ssDouble])) and + ((Button = cxmbLeft) and CanPressButton(AViewInfo, I) or + (APrevPressedButton = I))) or AHoldPressing then + begin + Data.State := ebsPressed; + AViewInfo.PressedButton := I; + end + else + Data.State := ebsNormal; + end + else + Data.State := ebsNormal; + + CalculateButtonNativeState(AViewInfo, AButtonViewInfo); + end; + end; + end; + +var + AButtonsCount: Integer; +begin + AButtonsCount := Properties.Items.Count; + TcxGroupBoxViewInfo(AViewInfo).SetButtonCount(AButtonsCount); + if AButtonsCount = 0 then + Exit; + + CalculateButtonViewInfos(AViewInfo); + CalculateButtonPositions(ACanvas, AViewInfo); + CalculateButtonStates; +end; + +function TcxButtonGroupViewData.GetEditConstantPartSize(ACanvas: TcxCanvas; + const AEditSizeProperties: TcxEditSizeProperties; + var MinContentSize: TSize; AViewInfo: TcxCustomEditViewInfo = nil): TSize; +var + AButtonsCount, AButtonsPerColumn, AColumnsCount: Integer; + ACaption: string; + AColumnWidth, AMaxButtonHeight: Integer; + ADefaultButtonHeight, AButtonHeight: Integer; + AFlags: Integer; + AMaxColumnWidth: Integer; + ASizeCorrection: TSize; + ATextWidth: Integer; + I: Integer; + R: TRect; + AEditMetrics: TcxEditMetrics; +begin + MinContentSize := cxNullSize; + ACanvas.Font := Style.GetVisibleFont; + ASizeCorrection := Self.GetEditContentSizeCorrection; + AButtonsCount := Properties.Items.Count; + AColumnsCount := Properties.GetColumnCount; + GetEditMetrics(AEditSizeProperties.Width >= 0, ACanvas, AEditMetrics); + ADefaultButtonHeight := ACanvas.TextHeight('Zg') + ASizeCorrection.cy; + if AEditSizeProperties.Width >= 0 then + begin + Result.cx := AEditSizeProperties.Width; + if AButtonsCount = 0 then + Result.cy := ADefaultButtonHeight + else + begin + Result.cy := 0; + AButtonsPerColumn := Properties.GetButtonsPerColumn; + AColumnWidth := AEditSizeProperties.Width - ContentOffset.Left - + ContentOffset.Right + AEditMetrics.AutoHeightWidthCorrection - + AEditMetrics.ColumnOffset * (AColumnsCount - 1); + AColumnWidth := AColumnWidth div AColumnsCount - AEditMetrics.ButtonSize.cx - + AEditMetrics.AutoHeightColumnWidthCorrection; + if AColumnWidth <= 0 then + AColumnWidth := 1; + AMaxButtonHeight := ADefaultButtonHeight; + Include(PaintOptions, epoAutoHeight); + AFlags := GetDrawTextFlags and not cxAlignVCenter or cxAlignTop; + for I := 0 to AButtonsCount - 1 do + begin + R := Rect(0, 0, AColumnWidth, MaxInt); + ACaption := Properties.Items[I].Caption; + if Properties.WordWrap and (ACaption <> '') then + begin + ACanvas.TextExtent(ACaption, R, AFlags); + AButtonHeight := R.Bottom - R.Top + ASizeCorrection.cy; + if AMaxButtonHeight < AButtonHeight then + AMaxButtonHeight := AButtonHeight; + end; + end; + Result.cy := AMaxButtonHeight * AButtonsPerColumn; + if not IsInplace then + begin + R := GetClientExtent(ACanvas, nil); + Result.cy := Result.cy + R.Top + R.Bottom; + end; + end; + end else + begin + if AButtonsCount = 0 then + begin + Result.cx := 0; + Result.cy := ACanvas.TextHeight('Zg') + ASizeCorrection.cy; + end else + begin + AMaxColumnWidth := 0; + AButtonsPerColumn := Properties.GetButtonsPerColumn; + for I := 0 to AButtonsCount - 1 do + begin + ATextWidth := ACanvas.TextWidth(Properties.Items[I].Caption); + if ATextWidth > AMaxColumnWidth then + AMaxColumnWidth := ATextWidth; + end; + Result.cx := (AMaxColumnWidth + AEditMetrics.ColumnWidthCorrection + AEditMetrics.ButtonSize.cx) * + AColumnsCount + AEditMetrics.ColumnOffset * (AColumnsCount - 1) + AEditMetrics.WidthCorrection; + if ADefaultButtonHeight > AEditMetrics.ButtonSize.cy then + Result.cy := ADefaultButtonHeight + else + Result.cy := AEditMetrics.ButtonSize.cy; + Result.cy := Result.cy * AButtonsPerColumn; + end; + end; +end; + +class function TcxButtonGroupViewData.IsButtonNativeStyle( + ALookAndFeel: TcxLookAndFeel): Boolean; +begin + Result := AreVisualStylesMustBeUsed(ALookAndFeel.NativeStyle, totButton); +end; + +procedure TcxButtonGroupViewData.CalculateButtonPositions(ACanvas: TcxCanvas; + AViewInfo: TcxCustomEditViewInfo); +var + AButtonsCount, AButtonsPerColumn, AButtonHeight, AButtonWidth, AClientHeight, + AColumnsCount, ATopOffset, I: Integer; + AButtonViewInfo: TcxGroupBoxButtonViewInfo; + AClientExtent: TRect; + AEditMetrics: TcxEditMetrics; +begin + AButtonsCount := Properties.Items.Count; + AColumnsCount := Properties.GetColumnCount; + AButtonsPerColumn := Properties.GetButtonsPerColumn; + AClientExtent := GetClientExtent(ACanvas, AViewInfo); + GetEditMetrics(False, nil, AEditMetrics); + AButtonWidth := (Bounds.Right - Bounds.Left - (AClientExtent.Left + + AClientExtent.Right) + AEditMetrics.ClientWidthCorrection - + AEditMetrics.ColumnOffset * (AColumnsCount - 1)) div AColumnsCount; + AClientHeight := Bounds.Bottom - Bounds.Top - AClientExtent.Top - AClientExtent.Bottom; + + ATopOffset := Bounds.Top + AClientExtent.Top + (AClientHeight mod AButtonsPerColumn) div 2; + + AButtonHeight := AClientHeight div AButtonsPerColumn; + + for I := 0 to AButtonsCount - 1 do + begin + AButtonViewInfo := TcxGroupBoxButtonViewInfo(AViewInfo.ButtonsInfo[I]); + AButtonViewInfo.Bounds.Left := Bounds.Left + AClientExtent.Left + + AButtonViewInfo.Column * (AButtonWidth + AEditMetrics.ColumnOffset) + + AEditMetrics.ClientLeftBoundCorrection; + AButtonViewInfo.Bounds.Top := ATopOffset + AButtonViewInfo.Row * AButtonHeight; + AButtonViewInfo.Bounds.Right := AButtonViewInfo.Bounds.Left + AButtonWidth; + AButtonViewInfo.Bounds.Bottom := AButtonViewInfo.Bounds.Top + AButtonHeight; + AButtonViewInfo.VisibleBounds := AButtonViewInfo.Bounds; + end; +end; + +procedure TcxButtonGroupViewData.CalculateButtonViewInfos(AViewInfo: TcxCustomEditViewInfo); + + function GetButtonStyle: TcxEditButtonStyle; + const + AButtonInplaceStyleMap: array[TcxLookAndFeelKind] of TcxEditButtonStyle = + (btsFlat, bts3D, btsUltraFlat, + btsOffice11); + AButtonStyleMap: array [TcxEditBorderStyle] of TcxEditButtonStyle = + (bts3D, btsFlat, btsFlat, btsFlat, bts3D, btsUltraFlat, + btsOffice11); + begin + if IsInplace then + Result := AButtonInplaceStyleMap[Style.LookAndFeel.Kind] + else + case Style.BorderStyle of + ebsUltraFlat: + Result := btsUltraFlat; + ebsOffice11: + Result := btsOffice11; + else + Result := AButtonStyleMap[AViewInfo.BorderStyle]; + end; + end; + +var + AButtonsCount, AButtonsPerColumn, I: Integer; + AButtonStyle: TcxEditButtonStyle; + AButtonViewInfo: TcxGroupBoxButtonViewInfo; +begin + AButtonStyle := GetButtonStyle; + AButtonsCount := Properties.Items.Count; + AButtonsPerColumn := Properties.GetButtonsPerColumn; + + for I := 0 to AButtonsCount - 1 do + begin + AButtonViewInfo := TcxGroupBoxButtonViewInfo(AViewInfo.ButtonsInfo[I]); + with AButtonViewInfo do + begin + HasBackground := AViewInfo.HasBackground; + Data.Style := AButtonStyle; + Caption := Properties.FItems[I].Caption; + Column := I div AButtonsPerColumn; + Row := I mod AButtonsPerColumn; + end; + end; +end; + +function TcxButtonGroupViewData.GetDrawTextFlags: Integer; +begin + Result := cxAlignLeft or cxAlignVCenter or cxShowPrefix; + if (epoAutoHeight in PaintOptions) and Properties.WordWrap then + begin + Result := Result or cxDontClip; + Result := Result or cxWordBreak; + end + else + Result := Result or cxSingleLine; +end; + +function TcxButtonGroupViewData.GetCaptionRectExtent: TRect; +begin + Result := cxEmptyRect; +end; + +function TcxButtonGroupViewData.GetProperties: TcxCustomButtonGroupProperties; +begin + Result := TcxCustomButtonGroupProperties(FProperties); +end; + +{ TcxCustomGroupBoxProperties } + +class function TcxCustomGroupBoxProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxCustomGroupBox; +end; + +class function TcxCustomGroupBoxProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxGroupBoxViewInfo; +end; + +class function TcxCustomGroupBoxProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxGroupBoxViewData; +end; + +{ TcxButtonGroupItem } + +constructor TcxButtonGroupItem.Create(Collection: TCollection); +begin + if Assigned(Collection) then + Collection.BeginUpdate; + try + inherited Create(Collection); + FEnabled := True; + DoChanged(Collection, copAdd); + finally + if Assigned(Collection) then + Collection.EndUpdate; + end; +end; + +destructor TcxButtonGroupItem.Destroy; +var + ACollection: TCollection; + AIndex: Integer; +begin + ACollection := Collection; + if not IsCollectionDestroying then + AIndex := Index + else + AIndex := -1; + if Assigned(ACollection) then + ACollection.BeginUpdate; + try + inherited Destroy; + DoChanged(ACollection, copDelete, AIndex); + finally + if Assigned(ACollection) then + ACollection.EndUpdate; + end; +end; + +procedure TcxButtonGroupItem.Assign(Source: TPersistent); +begin + if Source is TcxButtonGroupItem then + with TcxButtonGroupItem(Source) do + begin + Self.Caption := Caption; + Self.Enabled := Enabled; + Self.Tag := Tag; + end + else + inherited Assign(Source); +end; + +function TcxButtonGroupItem.GetCaption: TCaption; +begin + Result := FCaption; +end; + +procedure TcxButtonGroupItem.DoChanged(ACollection: TCollection; + ACollectionOperation: TcxCollectionOperation; AIndex: Integer = -1); +begin + if Assigned(ACollection) then + if AIndex = -1 then + TcxButtonGroupItems(ACollection).InternalNotify(Self, AIndex, ACollectionOperation) + else + TcxButtonGroupItems(ACollection).InternalNotify(nil, AIndex, ACollectionOperation); +end; + +function TcxButtonGroupItem.GetIsCollectionDestroying: Boolean; +begin + Result := (Collection <> nil) and TcxButtonGroupItems(Collection).IsDestroying; +end; + +function TcxButtonGroupItem.IsTagStored: Boolean; +begin + Result := FTag <> 0; +end; + +procedure TcxButtonGroupItem.SetCaption(const Value: TCaption); +begin + if Value <> FCaption then + begin + FCaption := Value; + DoChanged(Collection, copChanged); + end; +end; + +procedure TcxButtonGroupItem.SetEnabled(Value: Boolean); +begin + if Value <> FEnabled then + begin + FEnabled := Value; + DoChanged(Collection, copChanged); + end; +end; + +{ TcxButtonGroupItems } + +destructor TcxButtonGroupItems.Destroy; +begin + FIsDestroying := True; + inherited Destroy; +end; + +procedure TcxButtonGroupItems.InternalNotify(AItem: TcxButtonGroupItem; + AItemIndex: Integer; AItemOperation: TcxCollectionOperation); +begin + if TcxCustomEditProperties(GetOwner).ChangedLocked or IsDestroying then + Exit; + if AItem <> nil then + FChangedItemIndex := AItem.Index + else + FChangedItemIndex := AItemIndex; + FChangedItemOperation := AItemOperation; + FItemChanged := True; + try + TcxCustomEditProperties(GetOwner).Changed; + finally + FItemChanged := False; + end; +end; + +procedure TcxButtonGroupItems.Update(Item: TCollectionItem); +begin + TcxCustomEditProperties(GetOwner).Changed; +end; + +function TcxButtonGroupItems.GetItem(Index: Integer): TcxButtonGroupItem; +begin + Result := TcxButtonGroupItem(inherited Items[Index]); +end; + +procedure TcxButtonGroupItems.SetItem(Index: Integer; Value: TcxButtonGroupItem); +begin + inherited Items[Index] := Value; +end; + +function TcxButtonGroupItems.QueryInterface(const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then + Result := S_OK + else + Result := E_NOINTERFACE; +end; + +function TcxButtonGroupItems._AddRef: Integer; +begin + Result := -1; +end; + +function TcxButtonGroupItems._Release: Integer; +begin + Result := -1; +end; + +function TcxButtonGroupItems.CheckItemsGetCaption(Index: Integer): string; +begin + Result := TcxButtonGroupItem(Items[Index]).Caption; +end; + +function TcxButtonGroupItems.CheckItemsGetCount: Integer; +begin + Result := Count; +end; + +{ TcxCustomButtonGroupProperties } + +constructor TcxCustomButtonGroupProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FColumns := 1; + FItems := CreateItems; +end; + +destructor TcxCustomButtonGroupProperties.Destroy; +begin + BeginUpdate; + try + FreeAndNil(FItems); + finally + EndUpdate(False); + end; + inherited Destroy; +end; + +procedure TcxCustomButtonGroupProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomButtonGroupProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with Source as TcxCustomButtonGroupProperties do + begin + Self.Columns := Columns; + Self.Items := Items; + Self.WordWrap := WordWrap; + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +function TcxCustomButtonGroupProperties.CreatePreviewProperties: TcxCustomEditProperties; +const + AItemCaptions: array [0..2] of string = ('A', 'B', 'C'); +var + I: Integer; +begin + Result := inherited CreatePreviewProperties; + for I := 0 to High(AItemCaptions) do + TcxButtonGroupItem(TcxCustomButtonGroupProperties(Result).Items.Add).Caption := AItemCaptions[I]; + TcxCustomButtonGroupProperties(Result).Columns := 3; +end; + +class function TcxCustomButtonGroupProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxCustomButtonGroup; +end; + +function TcxCustomButtonGroupProperties.GetSpecialFeatures: TcxEditSpecialFeatures; +begin + Result := inherited GetSpecialFeatures + [esfMinSize]; +end; + +function TcxCustomButtonGroupProperties.GetSupportedOperations: TcxEditSupportedOperations; +begin + Result := [esoAlwaysHotTrack, esoAutoHeight, esoEditing, esoFiltering, + esoShowingCaption, esoSorting, esoTransparency]; + if Items.Count > 0 then + Include(Result, esoHotTrack); +end; + +class function TcxCustomButtonGroupProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxButtonGroupViewInfo; +end; + +class function TcxCustomButtonGroupProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxButtonGroupViewData; +end; + +function TcxCustomButtonGroupProperties.GetColumnCount: Integer; +var + AButtonCount, AButtonsPerColumn: Integer; +begin + Result := Columns; + AButtonCount := Items.Count; + if Result > AButtonCount then + Result := AButtonCount; + if AButtonCount > 0 then + begin + if Result = 0 then + Result := 1; + AButtonsPerColumn := (AButtonCount + Result - 1) div Result; + Result := (AButtonCount + AButtonsPerColumn - 1) div AButtonsPerColumn; + end; +end; + +function TcxCustomButtonGroupProperties.CreateItems: TcxButtonGroupItems; +begin + Result := TcxButtonGroupItems.Create(Self, TcxButtonGroupItem); +end; + +function TcxCustomButtonGroupProperties.GetButtonsPerColumn: Integer; +var + AColumnsCount: Integer; +begin + AColumnsCount := GetColumnCount; + Result := (Items.Count + AColumnsCount - 1) div AColumnsCount; +end; + +procedure TcxCustomButtonGroupProperties.SetColumns(Value: Integer); +begin + if Value < 1 then + Value := 1; + if Value <> FColumns then + begin + FColumns := Value; + Changed; + end; +end; + +procedure TcxCustomButtonGroupProperties.SetItems(Value: TcxButtonGroupItems); +begin + FItems.Assign(Value); +end; + +procedure TcxCustomButtonGroupProperties.SetWordWrap(Value: Boolean); +begin + if Value <> FWordWrap then + begin + FWordWrap := Value; + Changed; + end; +end; + +{ TcxPanelStyle } + +constructor TcxPanelStyle.Create(AOwner: TcxCustomGroupBox); +begin + inherited Create; + FEdit := AOwner; + FCaptionIndent := 2; + FActive := False; + FOfficeBackgroundKind := pobkOffice11Color; + FWordWrap := False; +end; + +procedure TcxPanelStyle.Assign(ASource: TPersistent); +begin + if ASource is TcxPanelStyle then + begin + Active := TcxPanelStyle(ASource).Active; + CaptionIndent := TcxPanelStyle(ASource).CaptionIndent; + WordWrap := TcxPanelStyle(ASource).WordWrap; + OfficeBackgroundKind := TcxPanelStyle(ASource).OfficeBackgroundKind; + end + else + inherited Assign(ASource); +end; + +procedure TcxPanelStyle.SetActive(AValue: Boolean); +begin + if AValue <> FActive then + begin + FActive := AValue; + Update; + end; +end; + +procedure TcxPanelStyle.SetCaptionIndent(AValue: Integer); +begin + AValue := Max(2, AValue); + if AValue <> FCaptionIndent then + begin + FCaptionIndent := AValue; + if FActive then + Update; + end; +end; + +procedure TcxPanelStyle.SetOfficeBackgroundKind( + AValue: TcxPanelOffice11BackgroundKind); +begin + if FOfficeBackgroundKind <> AValue then + begin + FOfficeBackgroundKind := AValue; + if FActive and (Edit.LookAndFeel.Kind = lfOffice11) then + Update; + end; +end; + +procedure TcxPanelStyle.SetWordWrap(AValue: Boolean); +begin + if AValue <> FWordWrap then + begin + FWordWrap := AValue; + if FActive then + Update; + end; +end; + +procedure TcxPanelStyle.Update; +begin + Edit.UpdateCaption; +end; + +{ TcxCustomGroupBox } + +constructor TcxCustomGroupBox.Create(AOwner: TComponent); +begin + inherited Create(AOwner); +end; + +destructor TcxCustomGroupBox.Destroy; +begin + FreeAndNil(FCaptionFont); + FreeAndNil(FPanelStyle); + inherited Destroy; +end; + +class function TcxCustomGroupBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomGroupBoxProperties; +end; + +procedure TcxCustomGroupBox.CalculateVisibleCaption; +begin + if not SameText(GetVisibleCaption, FVisibleCaption) then + begin + FVisibleCaption := GetVisibleCaption; + UpdateNonClientArea; + end; +end; + +function TcxCustomGroupBox.GetCaptionBkColor: TColor; +begin + Result := FCaptionBkColor; // for CBuilder 10 +end; + +function TcxCustomGroupBox.GetColor: TColor; +begin + Result := Style.Color; +end; + +function TcxCustomGroupBox.GetFont: TFont; +begin + Result := Style.GetVisibleFont; +end; + +function TcxCustomGroupBox.IsSkinAvailable: Boolean; +begin + Result := LookAndFeel.SkinPainter <> nil; +end; + +procedure TcxCustomGroupBox.UpdateCaption; +begin + CalculateCaptionFont; + CalculateVisibleCaption; + ShortRefreshContainer(False); + UpdateNonClientArea; + Realign; +end; + +procedure TcxCustomGroupBox.UpdateNonClientArea; +const + SetWindowPosFlags = SWP_FRAMECHANGED or SWP_NOACTIVATE or SWP_NOMOVE or + SWP_NOSIZE or SWP_NOZORDER; + RedrawWindowFlags = RDW_ERASE or RDW_INVALIDATE or RDW_FRAME or RDW_ALLCHILDREN; +begin + if HandleAllocated and IsNonClientAreaSupported and IsSkinAvailable then + begin + SetWindowPos(Handle, 0, 0, 0, 0, 0, SetWindowPosFlags); + RedrawWindow(Handle, nil, 0, RedrawWindowFlags); + end; +end; + +procedure TcxCustomGroupBox.SetPanelStyle(AValue: TcxPanelStyle); +begin + if AValue <> FPanelStyle then + begin + FPanelStyle.Assign(AValue); + UpdateCaption; + end; +end; + +function TcxCustomGroupBox.GetHorizontalCaptionIndent: Integer; +begin + Result := 0; + if PanelStyle.Active Then + begin + Result := 2; + if not (Alignment in [alTopCenter, alCenterCenter, alBottomCenter]) then + Result := PanelStyle.CaptionIndent; + end; +end; + +function TcxCustomGroupBox.GetVerticalCaptionIndent: Integer; +begin + Result := 0; + if PanelStyle.Active Then + begin + Result := 2; + if not (FAlignment in [alLeftCenter, alCenterCenter, alRightCenter]) then + Result := PanelStyle.CaptionIndent; + end; +end; + +function TcxCustomGroupBox.GetVisibleCaption: string; +begin + if IsVerticalText then + Result := RemoveAccelChars(Caption) + else + Result := Caption; +end; + +function TcxCustomGroupBox.GetPanelStyleCaptionDrawingFlags: Cardinal; +begin + Result := 0; + case Alignment of + alTopLeft, alLeftTop, alLeftCenter, alLeftBottom, alBottomLeft: + Result := Result or DT_LEFT; + alTopCenter, alCenterCenter, alBottomCenter: + Result := Result or DT_CENTER; + alTopRight, alRightTop, alRightCenter, alRightBottom, alBottomRight: + Result := Result or DT_RIGHT; + end; + case Alignment of + alLeftTop, alTopLeft, alTopCenter, alTopRight, alRightTop: + Result := Result or DT_TOP; + alLeftCenter, alCenterCenter, alRightCenter: + Result := Result or DT_VCENTER; + alLeftBottom, alBottomLeft, alBottomCenter, alBottomRight, alRightBottom: + Result := Result or DT_BOTTOM; + end; +end; + +procedure TcxCustomGroupBox.SetAlignment(Value: TcxCaptionAlignment); +begin + if FAlignment <> Value then + begin + FAlignment := Value; + UpdateCaption; + end; +end; + +procedure TcxCustomGroupBox.SetCaptionBkColor(Value: TColor); +begin + FCaptionBkColor := Value; // for CBuilder 10 +end; + +procedure TcxCustomGroupBox.SetColor(Value: TColor); +begin + Style.Color := Value; +end; + +procedure TcxCustomGroupBox.SetFont(Value: TFont); +begin + Style.Font := Value; +end; + +{$IFNDEF DELPHI7} +procedure TcxCustomGroupBox.WMPrintClient(var Message: TMessage); +begin + if (Message.Result <> 1) and + ((Message.LParam and PRF_CHECKVISIBLE = 0) or Visible) then + PaintHandler(TWMPaint(Message)) + else + inherited; +end; +{$ENDIF} + +procedure TcxCustomGroupBox.CMDialogChar(var Message: TCMDialogChar); +begin + with Message do + if IsAccel(CharCode, Caption) and CanFocus then + begin + FIsAccelCharHandling := True; + try + SelectFirst; + Result := 1; + finally + FIsAccelCharHandling := False; + end; + end + else + inherited; +end; + +procedure TcxCustomGroupBox.WMNCPaint(var Message: TWMNCPaint); + + procedure DrawCaption(const ACanvas: TcxCanvas); + var + AViewInfo: TcxGroupBoxViewInfo; + R, R1: TRect; + begin + ACanvas.SaveClipRegion; + try + AViewInfo := TcxGroupBoxViewInfo(ViewInfo); + R := AViewInfo.GetCaptionRectIndent; + R1 := AViewInfo.CaptionRect; + case cxGroupBoxAlignment2GroupBoxCaption(Alignment) of + cxgpLeft: + R1.Right := R1.Left + R.Left; + cxgpRight: + R1.Left := R1.Right - R.Right; + cxgpTop: + R1.Bottom := R1.Top + R.Top; + cxgpBottom: + R1.Top := R1.Bottom - R.Bottom; + end; + SetWindowOrgEx(ACanvas.Handle, -R.Left, -R.Top, nil); + ACanvas.SetClipRegion(TcxRegion.Create(R1), roSet); + AViewInfo.DrawCaption(ACanvas); + finally + ACanvas.RestoreClipRegion; + end; + end; + +var + ACanvas: TCanvas; + AcxCanvas: TcxCanvas; + DC: HDC; +begin + if IsNonClientAreaSupported and IsSkinAvailable then + begin + DC := GetWindowDC(Handle); + ACanvas := TCanvas.Create; + AcxCanvas := TcxCanvas.Create(ACanvas); + try + ACanvas.Handle := DC; + DrawCaption(AcxCanvas); + ACanvas.Handle := 0; + finally + AcxCanvas.Free; + ACanvas.Free; + end; + ReleaseDC(Handle, DC); + end; +end; + +function TcxCustomGroupBox.IsNonClientAreaSupported: Boolean; +begin + Result := cxGroupBox_SupportNonClientArea; +end; + +procedure TcxCustomGroupBox.WndProc(var Message: TMessage); +begin + case Message.Msg of + WM_NCPAINT: + WMNCPaint(TWMNCPaint(Message)); + WM_NCCALCSIZE: + if HasNonClientArea then + begin + TWMNCCalcSize(Message).CalcSize_Params^.rgrc[0] := cxRectContent(BoundsRect, + TcxGroupBoxViewInfo(ViewInfo).GetCaptionRectIndent); + end; + end; + inherited WndProc(Message); +end; + +procedure TcxCustomGroupBox.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + inherited LookAndFeelChanged(Sender, AChangedValues); + UpdateNonClientArea; + Invalidate; +end; + +procedure TcxCustomGroupBox.AdjustClientRect(var Rect: TRect); +var + AViewData: TcxCustomEditViewData; +begin + if IsDestroying then + Exit; + AViewData := TcxCustomEditViewData(CreateViewData); + try + InitializeViewData(AViewData); + Rect := GetControlRect(Self); + ExtendRect(Rect, AViewData.GetClientExtent(Canvas, ViewInfo)); + finally + FreeAndNil(AViewData); + end; +end; + +function TcxCustomGroupBox.CanAutoSize: Boolean; +begin + Result := False; +end; + +function TcxCustomGroupBox.CanFocusOnClick: Boolean; +begin + Result := False; +end; + +function TcxCustomGroupBox.CanHaveTransparentBorder: Boolean; +begin + Result := not PanelStyle.Active and inherited CanHaveTransparentBorder; +end; + +procedure TcxCustomGroupBox.ContainerStyleChanged(Sender: TObject); +begin + CalculateCaptionFont; + inherited ContainerStyleChanged(Sender); +end; + +function TcxCustomGroupBox.CreatePanelStyle: TcxPanelStyle; +begin + Result := TcxPanelStyle.Create(Self); +end; + +function TcxCustomGroupBox.DefaultParentColor: Boolean; +begin + Result := True; +end; + +procedure TcxCustomGroupBox.FontChanged; +begin + inherited FontChanged; + Realign; +end; + +function TcxCustomGroupBox.GetShadowBounds: TRect; +begin + Result := inherited GetShadowBounds; + case Alignment of + alTopLeft, alTopCenter, alTopRight: + Result.Top := 0; + alBottomLeft, alBottomCenter, alBottomRight: + Result.Bottom := Height; + alLeftTop, alLeftCenter, alLeftBottom: + Result.Left := 0; + alRightTop, alRightCenter, alRightBottom: + Result.Right := Width; + end; +end; + +procedure TcxCustomGroupBox.Initialize; +begin + inherited Initialize; + ControlStyle := ControlStyle + [csAcceptsControls, csCaptureMouse, csClickEvents]; + SetBounds(Left, Top, 185, 105); + FCaptionFont := TFont.Create; + CalculateCaptionFont; + TabStop := False; + FPanelStyle := CreatePanelStyle; +end; + +function TcxCustomGroupBox.InternalGetActiveStyle: TcxContainerStyle; +begin + if csDisabled in ViewInfo.ContainerState then + Result := FStyles.StyleDisabled + else + Result := FStyles.Style; +end; + +function TcxCustomGroupBox.InternalGetNotPublishedStyleValues: TcxEditStyleValues; +begin + Result := inherited InternalGetNotPublishedStyleValues; + Include(Result, svHotTrack); +end; + +function TcxCustomGroupBox.IsContainerClass: Boolean; +begin + Result := True; +end; + +function TcxCustomGroupBox.IsNativeBackground: Boolean; +begin + Result := IsNativeStyle and ParentBackground and not IsInplace and + not Transparent; +end; + +procedure TcxCustomGroupBox.Paint; +begin + if not DoCustomDraw then + inherited Paint; +end; + +procedure TcxCustomGroupBox.TextChanged; +begin + inherited TextChanged; + CalculateVisibleCaption; + ShortRefreshContainer(False); +end; + +function TcxCustomGroupBox.HasShadow: Boolean; +begin + Result := (((Alignment in [alLeftTop, alLeftCenter, alLeftBottom, alTopLeft, alTopCenter, alTopRight]) and + not PanelStyle.Active) or PanelStyle.Active) and not ViewInfo.NativeStyle and + not IsSkinAvailable and inherited HasShadow; +end; + +procedure TcxCustomGroupBox.AdjustCanvasFontSettings(ACanvas: TcxCanvas); +var + AColor: TColorRef; + ATextColor: TColor; + ATheme: TdxTheme; +begin + with ACanvas do + begin + Font := FCaptionFont; + if IsNativeStyle then + begin + ATheme := OpenTheme(totButton); + GetThemeColor(ATheme, BP_GROUPBOX, cxNativeState[Enabled], TMT_TEXTCOLOR, AColor); + Font.Color := AColor; + end; + if ViewInfo.Painter <> nil then + begin + ATextColor := ViewInfo.Painter.GroupBoxTextColor( + cxGroupBoxAlignment2GroupBoxCaption(Alignment)); + if ATextColor <> clDefault then + Font.Color := ATextColor; + end; + end; +end; + +procedure TcxCustomGroupBox.CalculateCaptionFont; +var + AFontEscapement: Longint; + ALogFont: TLogFont; + ATextMetric : TTextMetric; +begin + if IsInplace then + Exit; + FCaptionFont.Assign(ActiveStyle.GetVisibleFont); + if IsVerticalText then + begin + cxScreenCanvas.Font := FCaptionFont; + GetTextMetrics(cxScreenCanvas.Handle, ATextMetric); + if ATextMetric.tmPitchAndFamily and TMPF_TRUETYPE = 0 then + FCaptionFont.Name := 'Arial'; + + if FAlignment in [alLeftTop, alLeftCenter, alLeftBottom] then + AFontEscapement := 900 + else + AFontEscapement := 2700; + cxGetFontData(FCaptionFont.Handle, ALogFont); + if AFontEscapement <> ALogFont.lfEscapement then + begin + ALogFont.lfEscapement := AFontEscapement; + ALogFont.lfOrientation := AFontEscapement; + ALogFont.lfOutPrecision := OUT_TT_ONLY_PRECIS; + FCaptionFont.Handle := CreateFontIndirect(ALogFont); + end; + end; +end; + +function TcxCustomGroupBox.DoCustomDraw: Boolean; +begin + Result := False; + if Assigned(FOnCustomDraw) then + FOnCustomDraw(Self, Result); +end; + +function TcxCustomGroupBox.GetCaptionDrawingFlags: Cardinal; +begin + if PanelStyle.Active then + begin + if PanelStyle.WordWrap then + Result := DT_WORDBREAK + else + Result := DT_SINGLELINE; + Result := Result or GetPanelStyleCaptionDrawingFlags; + end + else + Result := DT_SINGLELINE; +end; + +function TcxCustomGroupBox.HasNonClientArea: Boolean; +begin + Result := not PanelStyle.Active and IsNonClientAreaSupported and + IsSkinAvailable and (Caption <> ''); +end; + +function TcxCustomGroupBox.IsVerticalText: Boolean; +begin + Result := (FAlignment in [alLeftTop, alLeftCenter, alLeftBottom, alRightTop, + alRightCenter, alRightBottom]) and not PanelStyle.Active; +end; + +{ TcxCustomButtonGroup } + +destructor TcxCustomButtonGroup.Destroy; +begin + SetButtonCount(0); + FreeAndNil(FButtons); + inherited Destroy; +end; + +procedure TcxCustomButtonGroup.ActivateByMouse(Shift: TShiftState; X, Y: Integer; + var AEditData: TcxCustomEditData); +var + P: TPoint; + AButtonIndex: Integer; +begin + Activate(AEditData); + P := Parent.ClientToScreen(Point(X, Y)); + P := ScreenToClient(P); + AButtonIndex := GetButtonIndexAt(P); + if AButtonIndex <> -1 then + begin + with ViewInfo.ButtonsInfo[AButtonIndex].Bounds do + begin + P.X := (Right - Left) div 2; + P.Y := (Bottom - Top) div 2; + end; + if ssLeft in Shift then + SendMessage(TWinControl(FButtons[AButtonIndex]).Handle, WM_LBUTTONDOWN, + ShiftStateToKeys(Shift), P.Y shl 16 + P.X) + else + SendMessage(TWinControl(FButtons[AButtonIndex]).Handle, WM_LBUTTONUP, + ShiftStateToKeys(Shift), P.Y shl 16 + P.X); + end; +end; + +function TcxCustomButtonGroup.Focused: Boolean; +var + I: Integer; +begin + Result := inherited Focused; + if not Result and not FIsCreating then + for I := 0 to FButtons.Count - 1 do + if TWinControl(FButtons[I]).Focused then + begin + Result := True; + Break; + end; +end; + +class function TcxCustomButtonGroup.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomButtonGroupProperties; +end; + +procedure TcxCustomButtonGroup.GetTabOrderList(List: TList); +begin + if IsInplace and Visible then + List.Remove(Parent); +end; + +function TcxCustomButtonGroup.IsButtonNativeStyle: Boolean; +begin + Result := TcxButtonGroupViewDataClass(Properties.GetViewDataClass).IsButtonNativeStyle(Style.LookAndFeel); +end; + +procedure TcxCustomButtonGroup.PropertiesChanged(Sender: TObject); +begin + if not (csReading in ComponentState) then + UpdateButtons; + inherited PropertiesChanged(Sender); +end; + +procedure TcxCustomButtonGroup.ReadState(Reader: TReader); +begin + inherited ReadState(Reader); + UpdateButtons; + SynchronizeDisplayValue; +end; + +function TcxCustomButtonGroup.CanAutoSize: Boolean; +begin + Result := not IsInplace and AutoSize; +end; + +procedure TcxCustomButtonGroup.ContainerStyleChanged(Sender: TObject); +begin + inherited ContainerStyleChanged(Sender); + if not FIsCreating then + UpdateButtons; +end; + +procedure TcxCustomButtonGroup.CursorChanged; +begin + UpdateButtons; +end; + +procedure TcxCustomButtonGroup.DoEditKeyDown(var Key: Word; Shift: TShiftState); +var + AButtonsInColumn, AButtonsPerColumn: Integer; + AFocusedButtonIndex: Integer; + AColumn, ARow: Integer; +begin + AFocusedButtonIndex := GetFocusedButtonIndex; + if AFocusedButtonIndex = -1 then + Exit; + AButtonsPerColumn := ActiveProperties.GetButtonsPerColumn; + AButtonsInColumn := AButtonsPerColumn; + with TcxGroupBoxButtonViewInfo(ViewInfo.ButtonsInfo[AFocusedButtonIndex]) do + begin + AColumn := Column; + ARow := Row; + end; + if AFocusedButtonIndex - ARow + AButtonsInColumn - 1 >= ActiveProperties.Items.Count then + AButtonsInColumn := ActiveProperties.Items.Count - (AFocusedButtonIndex - ARow); + case Key of + VK_DOWN: + if ARow < AButtonsInColumn - 1 then + begin + TWinControl(FButtons[AFocusedButtonIndex + 1]).SetFocus; + Key := 0; + end; + VK_LEFT: + if AColumn > 0 then + begin + TWinControl(FButtons[AFocusedButtonIndex - AButtonsPerColumn]).SetFocus; + Key := 0; + end; + VK_RIGHT: + if AFocusedButtonIndex + AButtonsPerColumn < FButtons.Count then + begin + TWinControl(FButtons[AFocusedButtonIndex + AButtonsPerColumn]).SetFocus; + Key := 0; + end; + VK_UP: + if ARow > 0 then + begin + TWinControl(FButtons[AFocusedButtonIndex - 1]).SetFocus; + Key := 0; + end + end; + inherited DoEditKeyDown(Key, Shift); +end; + +procedure TcxCustomButtonGroup.EnabledChanged; +begin + inherited EnabledChanged; + UpdateButtons; +end; + +procedure TcxCustomButtonGroup.Initialize; +begin + inherited Initialize; + FButtons := TList.Create; + AutoSize := False; + TabStop := True; +end; + +function TcxCustomButtonGroup.IsButtonDC(ADC: THandle): Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to InternalButtons.Count - 1 do + if GetButtonDC(I) = ADC then + begin + Result := True; + Break; + end; +end; + +function TcxCustomButtonGroup.IsContainerClass: Boolean; +begin + Result := FIsAccelCharHandling; +end; + +function TcxCustomButtonGroup.RefreshContainer(const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AIsMouseEvent: Boolean): Boolean; +begin + Result := inherited RefreshContainer(P, Button, Shift, AIsMouseEvent); + ArrangeButtons; +end; + +procedure TcxCustomButtonGroup.CreateHandle; +begin + inherited CreateHandle; + UpdateButtons; + SynchronizeDisplayValue; +end; + +procedure TcxCustomButtonGroup.ArrangeButtons; +var + AButtonViewInfo: TcxGroupBoxButtonViewInfo; + I: Integer; + R: TRect; +begin + for I := 0 to FButtons.Count - 1 do + with TWinControl(FButtons[I]) do + begin + AButtonViewInfo := TcxGroupBoxButtonViewInfo(ViewInfo.ButtonsInfo[I]); + R := AButtonViewInfo.Bounds; + SetBounds(R.Left, R.Top, R.Right - R.Left, R.Bottom - R.Top); + end; +end; + +function TcxCustomButtonGroup.GetButtonIndexAt(const P: TPoint): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to ActiveProperties.Items.Count - 1 do + if PtInRect(ViewInfo.ButtonsInfo[I].Bounds, P) then + begin + Result := I; + Break; + end; +end; + +function TcxCustomButtonGroup.GetFocusedButtonIndex: Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to ActiveProperties.Items.Count - 1 do + if TWinControl(FButtons[I]).Focused then + begin + Result := I; + Break; + end; +end; + +procedure TcxCustomButtonGroup.InitButtonInstance(AButton: TWinControl); +begin + TControlAccess(AButton).ParentShowHint := False; + AButton.Parent := Self; + + TControlAccess(AButton).OnDragDrop := DoButtonDragDrop; + TControlAccess(AButton).OnDragOver := DoButtonDragOver; + TWinControlAccess(AButton).OnKeyDown := DoButtonKeyDown; + TWinControlAccess(AButton).OnKeyPress := DoButtonKeyPress; + TWinControlAccess(AButton).OnKeyUp := DoButtonKeyUp; + TControlAccess(AButton).OnMouseDown := DoButtonMouseDown; + TControlAccess(AButton).OnMouseMove := DoButtonMouseMove; + TControlAccess(AButton).OnMouseUp := DoButtonMouseUp; + {$IFDEF DELPHI6} + TControlAccess(AButton).OnMouseWheel := DoButtonMouseWheel; + {$ELSE} + TWinControlAccess(AButton).OnMouseWheel := DoButtonMouseWheel; + {$ENDIF} +end; + +procedure TcxCustomButtonGroup.SetButtonCount(Value: Integer); +begin + with ActiveProperties.Items do + if ItemChanged then + begin + if ChangedItemOperation = copAdd then + InitButtonInstance(GetButtonInstance) + else + if ChangedItemOperation = copDelete then + TWinControl(FButtons[ChangedItemIndex]).Free; + end + else + if Value <> FButtons.Count then + begin + DisableAlign; + try + if Value < FButtons.Count then + while FButtons.Count > Value do + TWinControl(FButtons.Last).Free + else + while FButtons.Count < Value do + InitButtonInstance(GetButtonInstance); + finally + EnableAlign; + end; + end; +end; + +function TcxCustomButtonGroup.IsNonClientAreaSupported: Boolean; +begin + Result := False; +end; + +procedure TcxCustomButtonGroup.SynchronizeButtonsStyle; +var + AButton: TWinControlAccess; + ATempFont: TFont; + I: Integer; +begin + ATempFont := TFont.Create; + try + for I := 0 to FButtons.Count - 1 do + begin + AButton := TWinControlAccess(FButtons[I]); + AButton.Color := ActiveStyle.Color; + ATempFont.Assign(Style.GetVisibleFont); + ATempFont.Color := ActiveStyle.GetVisibleFont.Color; + AssignFonts(AButton.Font, ATempFont); + end; + finally + ATempFont.Free; + end; +end; + +procedure TcxCustomButtonGroup.UpdateButtons; +var + AButton: TWinControl; + I: Integer; +begin + SetButtonCount(ActiveProperties.Items.Count); + ShortRefreshContainer(False); + for I := 0 to FButtons.Count - 1 do + begin + AButton := TWinControl(FButtons[I]); + AButton.Enabled := Enabled and ActiveProperties.Items[I].Enabled; + end; + SynchronizeButtonsStyle; + for I := 0 to FButtons.Count - 1 do + begin + AButton := TWinControl(FButtons[I]); + AButton.Cursor := Cursor; + end; +end; + +procedure TcxCustomButtonGroup.DoButtonDragDrop(Sender, Source: TObject; X, Y: Integer); +begin + with TWinControl(Sender) do + Self.DragDrop(Source, Left + X, Top + Y); +end; + +procedure TcxCustomButtonGroup.DoButtonDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); +begin + with TWinControl(Sender) do + Self.DragOver(Source, Left + X, Top + Y, State, Accept); +end; + +procedure TcxCustomButtonGroup.DoButtonKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); +begin + KeyDown(Key, Shift); +end; + +procedure TcxCustomButtonGroup.DoButtonKeyPress(Sender: TObject; var Key: Char); +begin + KeyPress(Key); +end; + +procedure TcxCustomButtonGroup.DoButtonKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); +begin + KeyUp(Key, Shift); +end; + +procedure TcxCustomButtonGroup.DoButtonMouseDown(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + InnerControlMouseDown := True; + try + with TWinControl(Sender) do + Self.MouseDown(Button, Shift, X + Left, Y + Top); + finally + InnerControlMouseDown := False; + end; +end; + +procedure TcxCustomButtonGroup.DoButtonMouseMove(Sender: TObject; Shift: TShiftState; + X, Y: Integer); +begin + with TWinControl(Sender) do + Self.MouseMove(Shift, X + Left, Y + Top); +end; + +procedure TcxCustomButtonGroup.DoButtonMouseUp(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + with TWinControl(Sender) do + Self.MouseUp(Button, Shift, X + Left, Y + Top); +end; + +procedure TcxCustomButtonGroup.DoButtonMouseWheel(Sender: TObject; Shift: TShiftState; + WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean); +begin + Handled := False; +end; + +function TcxCustomButtonGroup.GetProperties: TcxCustomButtonGroupProperties; +begin + Result := TcxCustomButtonGroupProperties(FProperties); +end; + +function TcxCustomButtonGroup.GetActiveProperties: TcxCustomButtonGroupProperties; +begin + Result := TcxCustomButtonGroupProperties(InternalGetActiveProperties); +end; + +procedure TcxCustomButtonGroup.SetProperties(Value: TcxCustomButtonGroupProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomButtonGroup.WMWindowPosChanged(var Message: TWMWindowPosChanged); +begin + inherited; + if not IsDestroying and IsTransparentBackground then + RedrawWindow(Handle, nil, 0, RDW_INVALIDATE or RDW_ALLCHILDREN); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxHeader.pas b/official/x.35/ExpressEditors Library 5/Sources/cxHeader.pas new file mode 100644 index 00000000..02cdaab9 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxHeader.pas @@ -0,0 +1,1744 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxHeader; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, Controls, Graphics, ImgList, Messages, SysUtils, cxClasses, + cxContainer, cxControls, cxEdit, cxEditUtils, cxExtEditConsts, cxExtEditUtils, + cxGraphics, cxLookAndFeelPainters, cxLookAndFeels, CommCtrl; + +const + CM_GETHEADERITEMINFO = WM_DX + 25; + +type + TcxHeaderSortOrder = (soNone, soAscending, soDescending); + TcxCustomHeader = class; + TcxHeader = class; + TcxHeaderSection = class; + TcxHeaderSections = class; + TcxSectionTrackState = (tsTrackBegin, tsTrackMove, tsTrackEnd, tsTrackNone); + TcxHeaderSectionRects = array of TRect; + TcxHeaderSectionWidths = array of Integer; + TcxHeaderState = (hsNone, hsSized, hsDragged, hsPressed); + THeaderItemInfo = packed record + ImageIndex: Integer; + Rect: TRect; + SectionAlignment: TAlignment; + SortOrder: TcxHeaderSortOrder; + State: TcxButtonState; + Text: string; + end; + PHeaderItemInfo = ^THeaderItemInfo; + + TcxDrawSectionEvent = procedure(HeaderControl: TcxCustomHeader; + Section: TcxHeaderSection; const ARect: TRect; Pressed: Boolean) of object; + TcxSectionNotifyEvent = procedure(HeaderControl: TcxCustomHeader; + Section: TcxHeaderSection) of object; + TcxSectionTrackEvent = procedure(HeaderControl: TcxCustomHeader; + Section: TcxHeaderSection; Width: Integer; State: TcxSectionTrackState) of object; + TcxSectionDragEvent = procedure (Sender: TObject; FromSection, ToSection: TcxHeaderSection; + var AllowDrag: Boolean) of object; + TcxSectionChangingSortOrderEvent = procedure (Sender: TObject; + const Section: TcxHeaderSection; const AOldSortOrder: TcxHeaderSortOrder; + var ANewSortOrder: TcxHeaderSortOrder; var AllowChange: Boolean) of object; + TcxSectionChangedSortOrderEvent = procedure (Sender: TObject; + const Section: TcxHeaderSection; const ASortOrder: TcxHeaderSortOrder) of object; + + { CM_GETHEADERITEMINFO } + + TCMHeaderItemInfo = packed record + Msg: Cardinal; + Index: Integer; + HeaderItemInfo: PHeaderItemInfo; + Result: Longint; + end; + + { TcxHeaderSection } + + TcxHeaderSection = class(TCollectionItem) + private + FAlignment: TAlignment; + FAllowClick: Boolean; + FAutoSize: Boolean; + FBiDiMode: TBiDiMode; + FDataIndex: Integer; + FImageIndex: TImageIndex; + FMaxWidth: TcxNaturalNumber; + FMinWidth: TcxNaturalNumber; + FParentBiDiMode: Boolean; + FSortOrder: TcxHeaderSortOrder; + FState: TcxButtonState; + FText: string; + FWidth: Integer; + function GetLeft: Integer; + function GetRight: Integer; + function IsBiDiModeStored: Boolean; + function IsDataIndexStored: Boolean; + function GetHeaderControl: TcxCustomHeader; + procedure SetAlignment(Value: TAlignment); + procedure SetAutoSize(Value: Boolean); + procedure SetBiDiMode(Value: TBiDiMode); + procedure SetDataIndex(Value: Integer); + procedure SetMaxWidth(Value: TcxNaturalNumber); + procedure SetMinWidth(Value: TcxNaturalNumber); + procedure SetParentBiDiMode(Value: Boolean); + procedure SetState(Value: TcxButtonState); + procedure SetText(const Value: string); + procedure SetWidth(Value: Integer); + procedure SetImageIndex(const Value: TImageIndex); + procedure SetSortOrder(Value: TcxHeaderSortOrder); + protected + function GetDisplayName: string; override; + property State: TcxButtonState read FState write SetState; + public + constructor Create(Collection: TCollection); override; + procedure Assign(Source: TPersistent); override; + procedure ParentBiDiModeChanged; + function UseRightToLeftAlignment: Boolean; + function UseRightToLeftReading: Boolean; + property Left: Integer read GetLeft; + property Right: Integer read GetRight; + property HeaderControl: TcxCustomHeader read GetHeaderControl; + published + property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify; + property AllowClick: Boolean read FAllowClick write FAllowClick default False; + property AutoSize: Boolean read FAutoSize write SetAutoSize default False; + property BiDiMode: TBiDiMode read FBiDiMode write SetBiDiMode stored IsBiDiModeStored; + property DataIndex: Integer read FDataIndex write SetDataIndex + stored IsDataIndexStored; + property ImageIndex: TImageIndex read FImageIndex write SetImageIndex default -1; + property MaxWidth: TcxNaturalNumber read FMaxWidth write SetMaxWidth default 1000; + property MinWidth: TcxNaturalNumber read FMinWidth write SetMinWidth default 30; + property ParentBiDiMode: Boolean read FParentBiDiMode write SetParentBiDiMode default True; + property SortOrder: TcxHeaderSortOrder read FSortOrder write SetSortOrder default soNone; + property Text: string read FText write SetText; + property Width: Integer read FWidth write SetWidth default 50; + end; + + { TcxHeaderSections } + + TcxHeaderSections = class(TCollection) + private + FHeaderControl: TcxCustomHeader; + function GetItem(Index: Integer): TcxHeaderSection; + procedure SetItem(Index: Integer; Value: TcxHeaderSection); + protected + function GetOwner: TPersistent; override; + procedure Update(Item: TCollectionItem); override; + public + constructor Create(HeaderControl: TcxCustomHeader); + procedure Assign(Source: TPersistent); override; + function Add: TcxHeaderSection; + function Insert(Index: Integer): TcxHeaderSection; + property Items[Index: Integer]: TcxHeaderSection read GetItem write SetItem; default; + end; + + { TcxCustomHeader } + + TcxCustomHeader = class(TcxControl, IcxMouseTrackingCaller) + private + FAllowSort: Boolean; + FBrush: TBrush; + FDragReorder: Boolean; + FHotSectionIndex: Integer; + FImages: TCustomImageList; + FImagesChangeLink: TChangeLink; + FLastDrawPosOnMove: Integer; + FLineDC: HDC; + FLineVisible: Boolean; + FMouseOnSizer: Boolean; + FPrevBrush: HBrush; + FPrevMousePos: Integer; + FResizeUpdate: Boolean; + FScreenCursor: TCursor; + FScreenCursorSaved: Boolean; + FSectionDragged: Boolean; + FSections: TcxHeaderSections; + FSectionsFitCalculating: Boolean; + FSectionStream: TMemoryStream; + FSelectedSectionIndex: Integer; + FSizedSectionIndex: Integer; + FState: TcxHeaderState; + FUnderMouseSectionIndex: Integer; + FOnSectionClick: TcxSectionNotifyEvent; + FOnSectionResize: TcxSectionNotifyEvent; + FOnSectionEndResize: TcxSectionNotifyEvent; + FOnSectionTrack: TcxSectionTrackEvent; + FOnDrawSection: TcxDrawSectionEvent; + FOnSectionEndDrag: TNotifyEvent; + FOnSectionDrag: TcxSectionDragEvent; + FOnSectionChangingSortOrder: TcxSectionChangingSortOrderEvent; + FOnSectionChangedSortOrder: TcxSectionChangedSortOrderEvent; + FOnSectionChange: TNotifyEvent; + FOnSectionsChange: TNotifyEvent; + procedure ImageListChange(Sender: TObject); + procedure RestoreScreenCursor; + procedure SetScreenCursor(ACursor: TCursor); + procedure SetSections(Value: TcxHeaderSections); + procedure UpdateSection(Index: Integer); + procedure UpdateSections; + procedure SetImages(Value: TCustomImageList); + procedure SetAllowSort(Value: Boolean); + function GetSectionIndexAtPos(X, Y: Integer; AIncludeNonSectionPart: Boolean = False): Integer; + + function GetSelectedSection: TcxHeaderSection; + function GetSizedSection: TcxHeaderSection; + function GetUnderMouseSection: TcxHeaderSection; + function IsSectionIndex(AIndex: Integer): Boolean; + procedure IcxMouseTrackingCaller.MouseLeave = HeaderMouseLeave; + procedure HeaderMouseLeave; + procedure SetHotSectionIndex(Value: Integer); + procedure SetMouseOnSizer(Value: Boolean); + procedure SetSectionState(AIndex: Integer; AState: TcxButtonState); + procedure SetSelectedSectionIndex(Value: Integer); + procedure SetSizedSectionIndex(Value: Integer); + procedure SetUnderMouseSectionIndex(Value: Integer); + procedure UpdateDraggedSection; + procedure UpdatePressedSection; + procedure UpdateSizedSection; + procedure UpdateUnderMouseSection; + + procedure CMBiDiModeChanged(var Message: TMessage); message CM_BIDIMODECHANGED; + procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED; + procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure WMCaptureChanged(var Message: TMessage); message WM_CAPTURECHANGED; + procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; + procedure WMMouseMove(var Message: TWMMouseMove); message WM_MOUSEMOVE; + procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; + procedure WMSize(var Message: TWMSize); message WM_SIZE; + procedure WMWindowPosChanged(var Message: TWMWindowPosChanged); message WM_WINDOWPOSCHANGED; + procedure HDMGetItemCount(var Message: TMessage); message HDM_GETITEMCOUNT; + procedure HDMGetItemInfo(var Message: TCMHeaderItemInfo); message CM_GETHEADERITEMINFO; + + procedure AllocateSplitLineDC; + procedure ReleaseSplitLine; + procedure DrawSplitLine(XPos: Integer); + procedure InitResize(XPos: Integer); + + property HotSectionIndex: Integer read FHotSectionIndex write SetHotSectionIndex; + property MouseOnSizer: Boolean read FMouseOnSizer write SetMouseOnSizer; + property SelectedSection: TcxHeaderSection read GetSelectedSection; + property SelectedSectionIndex: Integer read FSelectedSectionIndex write SetSelectedSectionIndex; + property SizedSection: TcxHeaderSection read GetSizedSection; + property SizedSectionIndex: Integer read FSizedSectionIndex write SetSizedSectionIndex; + property UnderMouseSection: TcxHeaderSection read GetUnderMouseSection; + property UnderMouseSectionIndex: Integer read FUnderMouseSectionIndex write SetUnderMouseSectionIndex; + protected + procedure ChangeSectionSortOrder(ASection: TcxHeaderSection; + ANewSortOrder: TcxHeaderSortOrder; ADeleteOtherSorting: Boolean); dynamic; + function DoSectionChangingSortOrder(ASection: TcxHeaderSection; + ANewSortOrder: TcxHeaderSortOrder): Boolean; + procedure DoSectionChangedSortOrder(ASection: TcxHeaderSection); + function DoSectionDrag(FromSection, ToSection: TcxHeaderSection): Boolean; virtual; + procedure DoSectionEndDrag; virtual; + function GetSectionRect(Index: Integer): TRect; + function GetSectionRectBySectionWidths(AHeaderWidth: Integer; + const ASectionWidths: TcxHeaderSectionWidths; AIndex: Integer): TRect; virtual; + function CreateSection: TcxHeaderSection; virtual; + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + procedure DestroyWnd; override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); override; + procedure Notification(AComponent: TComponent; + Operation: TOperation); override; + procedure DrawSection(SectionIndex: Integer); dynamic; + procedure DoSectionClickEvent(Section: TcxHeaderSection); dynamic; + procedure DoSectionChange; + procedure DoSectionsChange; + procedure DoSectionDragEvent(FromSection, ToSection: TcxHeaderSection; var AllowDrag: Boolean); dynamic; + procedure DoSectionEndDragEvent; dynamic; + procedure DoSectionResizeEvent(Section: TcxHeaderSection); dynamic; + procedure DoSectionEndResizeEvent(Section: TcxHeaderSection); dynamic; + procedure DoSectionTrackEvent(Section: TcxHeaderSection; Width: Integer; + State: TcxSectionTrackState); dynamic; + procedure DisableSort; virtual; + procedure FitToClientWidth; + function GetSectionContentBounds(ASectionBounds: TRect; + AState: TcxButtonState): TRect; + function IsInnerControl: Boolean; virtual; + procedure Paint; override; + property OnSectionsChange: TNotifyEvent read FOnSectionsChange + write FOnSectionsChange; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure CalcSectionWidths(AHeaderWidth: Integer; + out AWidths: TcxHeaderSectionWidths); virtual; + procedure FlipChildren(AllLevels: Boolean); override; + function GetAutoHeight: Integer; + property AllowSort: Boolean read FAllowSort write SetAllowSort default True; + property DragReorder: Boolean read FDragReorder write FDragReorder default False; + property Images: TCustomImageList read FImages write SetImages; + property LookAndFeel; + property ResizeUpdate: Boolean read FResizeUpdate write FResizeUpdate default True; + property Sections: TcxHeaderSections read FSections write SetSections; + property OnDrawSection: TcxDrawSectionEvent read FOnDrawSection + write FOnDrawSection; + property OnSectionChange: TNotifyEvent read FOnSectionChange + write FOnSectionChange; + property OnSectionChangedSortOrder: TcxSectionChangedSortOrderEvent + read FOnSectionChangedSortOrder write FOnSectionChangedSortOrder; + property OnSectionChangingSortOrder: TcxSectionChangingSortOrderEvent + read FOnSectionChangingSortOrder write FOnSectionChangingSortOrder; + property OnSectionClick: TcxSectionNotifyEvent read FOnSectionClick + write FOnSectionClick; + property OnSectionDrag: TcxSectionDragEvent read FOnSectionDrag + write FOnSectionDrag; + property OnSectionEndDrag: TNotifyEvent read FOnSectionEndDrag + write FOnSectionEndDrag; + property OnSectionEndResize: TcxSectionNotifyEvent read FOnSectionEndResize + write FOnSectionEndResize; + property OnSectionResize: TcxSectionNotifyEvent read FOnSectionResize + write FOnSectionResize; + property OnSectionTrack: TcxSectionTrackEvent read FOnSectionTrack + write FOnSectionTrack; + end; + + { TcxHeader } + + TcxHeader = class(TcxCustomHeader) + published + property Align; + property AllowSort; + property Anchors; + property BiDiMode; + property Color; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property DragReorder; + property Enabled; + property Font; + property Images; + property LookAndFeel; + property ParentBiDiMode; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property ResizeUpdate; + property Sections; + property ShowHint; + property Visible; + property OnContextPopup; + property OnDragDrop; + property OnDragOver; + property OnDrawSection; + property OnEndDock; + property OnEndDrag; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnResize; + property OnSectionChange; + property OnSectionChangedSortOrder; + property OnSectionChangingSortOrder; + property OnSectionClick; + property OnSectionDrag; + property OnSectionEndDrag; + property OnSectionEndResize; + property OnSectionResize; + property OnSectionTrack; + property OnStartDock; + property OnStartDrag; + end; + +procedure DrawHeaderSection(AHeaderHandle: HWND; AIndex: Integer; + ACanvas: TcxCanvas; ALookAndFeel: TcxLookAndFeel; AImages: TCustomImageList = nil); +function SendGetStructMessage(Handle: HWND; Msg: UINT; WParam: WPARAM; var LParam): LRESULT; + +implementation + +uses + Forms, Math, dxThemeConsts, dxThemeManager, dxUxTheme; + +const + ImageTextOffset = 2; + SortingMarkOffset = 4; + SortingMarkWidth = 7; + cxHeaderSectionTextLeftRightIndent = 4; + cxHeaderSectionTextTopBottomIndent = 2; + +procedure DrawHeaderSection(AHeaderHandle: HWND; AIndex: Integer; + ACanvas: TcxCanvas; ALookAndFeel: TcxLookAndFeel; AImages: TCustomImageList); + + procedure DrawSortingMark(const ARect: TRect; ASortOrder: TcxHeaderSortOrder); + var + ASavedPenColor: TColor; + ASortingMarkRect: TRect; + begin + if ASortOrder <> soNone then + begin + ASavedPenColor := ACanvas.Pen.Color; + ASortingMarkRect := ARect; + Dec(ASortingMarkRect.Right, SortingMarkOffset); + ASortingMarkRect.Left := ASortingMarkRect.Right - SortingMarkWidth; + ALookAndFeel.Painter.DrawSortingMark(ACanvas, ASortingMarkRect, + ASortOrder = soAscending); + ACanvas.Pen.Color := ASavedPenColor; + end; + end; + + function GetTextRect(const ANormalContentRect: TRect; ASortOrder: TcxHeaderSortOrder): TRect; + begin + Result := ANormalContentRect; + Inc(Result.Left, cxHeaderSectionTextLeftRightIndent); + Dec(Result.Right, cxHeaderSectionTextLeftRightIndent); + if ASortOrder <> soNone then + Dec(Result.Right, SortingMarkOffset + SortingMarkWidth); + end; + + function GetImageRect(var ATextRect: TRect; var AHeaderItemInfo: THeaderItemInfo): TRect; + var + ATextWidth: Integer; + begin + Result := ATextRect; + ATextWidth := ACanvas.TextWidth(AHeaderItemInfo.Text); + case AHeaderItemInfo.SectionAlignment of + taLeftJustify: + ATextRect.Left := Result.Left + AImages.Width + ImageTextOffset; + taRightJustify: + begin + Result.Left := ATextRect.Right - ATextWidth - AImages.Width - ImageTextOffset; + if Result.Left < ATextRect.Left then + begin + Result.Left := ATextRect.Left; + Inc(ATextRect.Left, AImages.Width + ImageTextOffset); + AHeaderItemInfo.SectionAlignment := taLeftJustify + end; + end; + taCenter: + begin + Result.Left := ATextRect.Left + ((ATextRect.Right - ATextRect.Left) - + AImages.Width - ImageTextOffset - ATextWidth) div 2; + if Result.Left < ATextRect.Left then + begin + Result.Left := ATextRect.Left; + AHeaderItemInfo.SectionAlignment := taLeftJustify + end; + Inc(ATextRect.Left, AImages.Width + ImageTextOffset); + end; + end; + end; + +var + ANormalContentRect, ATextRect, AImageRect: TRect; + AClipRegion: TcxRegion; + ASavedBrushColor: TColor; + AItemCount: Integer; + AHeaderRect: TRect; + AHeaderItemInfo: THeaderItemInfo; +begin + AItemCount := Header_GetItemCount(AHeaderHandle); + GetWindowRect(AHeaderHandle, AHeaderRect); + AHeaderRect := Rect(0, 0, AHeaderRect.Right - AHeaderRect.Left, + AHeaderRect.Bottom - AHeaderRect.Top); + if AItemCount = 0 then + begin + ACanvas.FillRect(AHeaderRect); + Exit; + end; + + SendGetStructMessage(AHeaderHandle, CM_GETHEADERITEMINFO, AIndex, AHeaderItemInfo); + + if (AIndex = AItemCount) then + AHeaderItemInfo.Rect.Right := AHeaderRect.Right + 10 + else + if not ALookAndFeel.NativeStyle and (ALookAndFeel.Kind = lfUltraFlat) then + Inc(AHeaderItemInfo.Rect.Right); + + ANormalContentRect := ALookAndFeel.Painter.HeaderControlSectionContentBounds(AHeaderItemInfo.Rect, cxbsNormal); + ATextRect := GetTextRect(ANormalContentRect, AHeaderItemInfo.SortOrder); + + if Assigned(AImages) and (AHeaderItemInfo.ImageIndex >= 0) then + AImageRect := GetImageRect(ATextRect, AHeaderItemInfo); + + ASavedBrushColor := ACanvas.Brush.Color; + AClipRegion := ACanvas.GetClipRegion; + try + ACanvas.SetClipRegion(TcxRegion.Create(AHeaderItemInfo.Rect), roIntersect); + ALookAndFeel.Painter.DrawHeaderControlSection(ACanvas, AHeaderItemInfo.Rect, ATextRect, + [nRight], cxBordersAll, AHeaderItemInfo.State, AHeaderItemInfo.SectionAlignment, vaCenter, False, + True, AHeaderItemInfo.Text, ACanvas.Font, ACanvas.Font.Color, ACanvas.Brush.Color); + + ACanvas.SetClipRegion(TcxRegion.Create(ANormalContentRect), roIntersect); + + if Assigned(AImages) and (AHeaderItemInfo.ImageIndex >= 0) then + ACanvas.DrawImage(AImages, AImageRect.Left, AImageRect.Top + + (AImageRect.Bottom - AImageRect.Top - AImages.Height) div 2, + AHeaderItemInfo.ImageIndex); + + DrawSortingMark(AHeaderItemInfo.Rect, AHeaderItemInfo.SortOrder); + finally + ACanvas.SetClipRegion(AClipRegion, roSet); + ACanvas.Brush.Color := ASavedBrushColor; + end; +end; + +function SendGetStructMessage(Handle: HWND; Msg: UINT; WParam: WPARAM; + var LParam): LRESULT; +begin + Result := SendMessage(Handle, Msg, WParam, Integer(@LParam)); +end; + +function GetNextSortOrder(ASortOrder: TcxHeaderSortOrder; + ADeleteSorting: Boolean): TcxHeaderSortOrder; +begin + if ADeleteSorting then + Result := soNone + else + if ASortOrder = soAscending then + Result := soDescending + else + Result := soAscending; +end; + +{ TcxCustomHeader } + +procedure TcxCustomHeader.CMBiDiModeChanged(var Message: TMessage); +var + I: Integer; +begin + inherited; + if HandleAllocated then + for I := 0 to Sections.Count - 1 do + if Sections[I].ParentBiDiMode then + Sections[I].ParentBiDiModeChanged; +end; + +procedure TcxCustomHeader.CMEnabledChanged(var Message: TMessage); +begin + inherited; + Invalidate; +end; + +constructor TcxCustomHeader.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := []; + DoubleBuffered := True; + Height := 17; + Width := 117; + + FAllowSort := True; + FResizeUpdate := True; + FSectionStream := nil; + FSelectedSectionIndex := -1; + FSizedSectionIndex := -1; + FUnderMouseSectionIndex := -1; + FHotSectionIndex := -1; + + FSections := TcxHeaderSections.Create(Self); + FImagesChangeLink := TChangeLink.Create; + FImagesChangeLink.OnChange := ImageListChange; +end; + +destructor TcxCustomHeader.Destroy; +begin + EndMouseTracking(Self); + FreeAndNil(FSections); + FreeAndNil(FImagesChangeLink); + FreeAndNil(FSectionStream); + FreeAndNil(FBrush); + inherited Destroy; +end; + +procedure TcxCustomHeader.CalcSectionWidths(AHeaderWidth: Integer; + out AWidths: TcxHeaderSectionWidths); +var + ANewSectionWidth, APrevNonFixedWidthSectionCount, ARemainedWidth: Integer; + ASectionWidth, ATempWidth, AWorkWidth, I: Integer; + ANonFixedWidthSections: TList; + ASection: TcxHeaderSection; +begin + ANonFixedWidthSections := TList.Create; + try + SetLength(AWidths, Sections.Count); + AWorkWidth := AHeaderWidth; + for I := 0 to Sections.Count - 1 do + begin + ASection := Sections[I]; + if ASection.AutoSize then + ANonFixedWidthSections.Add(ASection) + else + begin + Dec(AWorkWidth, ASection.Width); + AWidths[I] := ASection.Width; + end; + end; + if ANonFixedWidthSections.Count > 0 then + repeat + APrevNonFixedWidthSectionCount := ANonFixedWidthSections.Count; + ATempWidth := AWorkWidth div APrevNonFixedWidthSectionCount; + ARemainedWidth := AWorkWidth mod APrevNonFixedWidthSectionCount; + for I := APrevNonFixedWidthSectionCount - 1 downto 0 do + begin + ASection := TcxHeaderSection(ANonFixedWidthSections[I]); + ASectionWidth := ATempWidth; + if I = APrevNonFixedWidthSectionCount - 1 then + Inc(ASectionWidth, ARemainedWidth); + ANewSectionWidth := Max(ASectionWidth, ASection.MinWidth); + ANewSectionWidth := Min(ANewSectionWidth, ASection.MaxWidth); + AWidths[ASection.Index] := ANewSectionWidth; + if ASectionWidth <> ANewSectionWidth then + begin + ANonFixedWidthSections.Remove(ASection); + Dec(AWorkWidth, ANewSectionWidth); + end; + end; + until (ANonFixedWidthSections.Count = 0) or + (ANonFixedWidthSections.Count = APrevNonFixedWidthSectionCount); + finally + ANonFixedWidthSections.Free; + end; +end; + +procedure TcxCustomHeader.FlipChildren(AllLevels: Boolean); +var + I, AFirstSectionWidth, ALastSectionWidth: Integer; + ASectionList: TcxHeaderSections; +begin + if HandleAllocated and (Sections.Count > 0) then + begin + ALastSectionWidth := ClientWidth; + AFirstSectionWidth := Sections[0].Width; + for I := 0 to Sections.Count - 2 do + Dec(ALastSectionWidth, Sections[I].Width); + + ASectionList := TcxHeaderSections.Create(Self); + try + for I := 0 to Sections.Count - 1 do + with ASectionList.Add do + Assign(Sections[I]); + for I := 0 to Sections.Count - 1 do + Sections[I].Assign(ASectionList[Sections.Count - I - 1]); + finally + ASectionList.Free; + end; + + if Sections.Count > 1 then + begin + Sections[Sections.Count - 1].Width := AFirstSectionWidth; + Sections[0].Width := ALastSectionWidth; + end; + UpdateSections; + end; +end; + +function TcxCustomHeader.GetAutoHeight: Integer; +var + AContentHeight: Integer; +begin + Canvas.Font.Assign(Font); + Canvas.Font.Style := [fsBold, fsUnderline]; + + AContentHeight := Canvas.TextHeight('Wq'); + if (Images <> nil) and (AContentHeight < Images.Height) then + AContentHeight := Images.Height; + + Result := AContentHeight + + 2 * (LookAndFeel.Painter.HeaderControlSectionBorderSize(cxbsNormal) + + cxHeaderSectionTextTopBottomIndent); +end; + +procedure TcxCustomHeader.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + Style := Style and not(CS_HREDRAW or CS_VREDRAW); +end; + +function TcxCustomHeader.CreateSection: TcxHeaderSection; +begin + Result := TcxHeaderSection.Create(Sections); +end; + +procedure TcxCustomHeader.CreateWnd; + + procedure ReadSections; + var + AReader: TReader; + begin + Sections.Clear; + AReader := TReader.Create(FSectionStream, 1024); + try + AReader.ReadValue; + AReader.ReadCollection(Sections); + finally + AReader.Free; + end; + FreeAndNil(FSectionStream); + end; + +begin + inherited CreateWnd; + if FSectionStream <> nil then + ReadSections + else + UpdateSections; +end; + +procedure TcxCustomHeader.DestroyWnd; +var + AWriter: TWriter; +begin + if FSectionStream = nil then + FSectionStream := TMemoryStream.Create; + AWriter := TWriter.Create(FSectionStream, 1024); + try + AWriter.WriteCollection(FSections); + finally + AWriter.Free; + FSectionStream.Position := 0; + end; + inherited DestroyWnd; +end; + +procedure TcxCustomHeader.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + inherited LookAndFeelChanged(Sender, AChangedValues); + Invalidate; +end; + +procedure TcxCustomHeader.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (AComponent = Images) then + Images := nil; +end; + +procedure TcxCustomHeader.SetSections(Value: TcxHeaderSections); +begin + FSections.Assign(Value); +end; + +procedure TcxCustomHeader.UpdateSection(Index: Integer); +begin + InvalidateRect(GetSectionRect(Index), False); +end; + +procedure TcxCustomHeader.UpdateSections; +begin + InvalidateRect(ClientRect, False); +end; + +procedure TcxCustomHeader.AllocateSplitLineDC; +begin + FLineDC := GetDCEx(Parent.Handle, 0, DCX_CACHE or DCX_CLIPSIBLINGS or DCX_LOCKWINDOWUPDATE); + if not ResizeUpdate then + begin + if not Assigned(FBrush) then + begin + FBrush := TBrush.Create; + {$IFDEF DELPHI4} + FBrush.Bitmap := AllocPatternBitmap(clBlack, clWhite); + {$ENDIF} + end; + FPrevBrush := SelectObject(FLineDC, FBrush.Handle); + end; +end; + +procedure TcxCustomHeader.DrawSplitLine(XPos: Integer); +begin + FLineVisible := not FLineVisible; + FLastDrawPosOnMove := XPos; + PatBlt(FLineDC, Self.Left + XPos, 1, 1, Parent.Height - 1, DSTINVERT); +end; + +procedure TcxCustomHeader.ReleaseSplitLine; +begin + if FLineVisible then DrawSplitLine(FLastDrawPosOnMove); + if FPrevBrush <> 0 then SelectObject(FLineDC, FPrevBrush); + ReleaseDC(Parent.Handle, FLineDC); + if FBrush <> nil then FreeAndNil(FBrush); +end; + +procedure TcxCustomHeader.InitResize(XPos: Integer); +begin + FLineVisible := False; + AllocateSplitLineDC; + if not ResizeUpdate then DrawSplitLine(XPos); +end; + +procedure TcxCustomHeader.ChangeSectionSortOrder(ASection: TcxHeaderSection; + ANewSortOrder: TcxHeaderSortOrder; ADeleteOtherSorting: Boolean); + + procedure DeleteOtherSorting; + var + I: Integer; + begin + for I := 0 to Sections.Count - 1 do + if Sections[I] <> ASection then + ChangeSectionSortOrder(Sections[I], soNone, False); + end; + +begin + if not AllowSort or (ANewSortOrder = ASection.SortOrder) then + Exit; + + if ADeleteOtherSorting then + DeleteOtherSorting; + + if DoSectionChangingSortOrder(ASection, ANewSortOrder) then + begin + ASection.SortOrder := ANewSortOrder; + DoSectionChangedSortOrder(ASection); + end; +end; + +function TcxCustomHeader.DoSectionChangingSortOrder(ASection: TcxHeaderSection; + ANewSortOrder: TcxHeaderSortOrder): Boolean; +begin + Result := True; + if Assigned(FOnSectionChangingSortOrder) then + FOnSectionChangingSortOrder(Self, ASection, ASection.SortOrder, + ANewSortOrder, Result); +end; + +procedure TcxCustomHeader.DoSectionChangedSortOrder(ASection: TcxHeaderSection); +begin + if Assigned(FOnSectionChangedSortOrder) then + FOnSectionChangedSortOrder(Self, ASection, ASection.SortOrder); +end; + +function TcxCustomHeader.DoSectionDrag(FromSection, + ToSection: TcxHeaderSection): Boolean; +begin + Result := True; + DoSectionDragEvent(FromSection, ToSection, Result); +end; + +procedure TcxCustomHeader.DoSectionEndDrag; +var + AIndexFrom: Integer; +begin + if UnderMouseSectionIndex <> -1 then + begin + AIndexFrom := SelectedSectionIndex; + SelectedSectionIndex := -1; + HotSectionIndex := -1; + Sections[AIndexFrom].Index := UnderMouseSectionIndex; + HotSectionIndex := UnderMouseSectionIndex; + end; + DoSectionEndDragEvent; +end; + +procedure TcxCustomHeader.DrawSection(SectionIndex: Integer); +begin + if IsSectionIndex(SectionIndex) and Assigned(FOnDrawSection) then + FOnDrawSection(Self, FSections[SectionIndex], GetSectionRect(SectionIndex), + FSections[SectionIndex].State = cxbsPressed) + else + DrawHeaderSection(Handle, SectionIndex, Canvas, LookAndFeel, Images); +end; + +procedure TcxCustomHeader.ImageListChange(Sender: TObject); +begin + UpdateSections; +end; + +procedure TcxCustomHeader.RestoreScreenCursor; +begin + if FScreenCursorSaved then + begin + FScreenCursorSaved := False; + Screen.Cursor := FScreenCursor; + end; +end; + +procedure TcxCustomHeader.SetScreenCursor(ACursor: TCursor); +begin + if not FScreenCursorSaved then + begin + FScreenCursor := Screen.Cursor; + FScreenCursorSaved := True; + end; + Screen.Cursor := ACursor; +end; + +procedure TcxCustomHeader.WMSize(var Message: TWMSize); +begin + inherited; + FitToClientWidth; +end; + +procedure TcxCustomHeader.WMWindowPosChanged(var Message: TWMWindowPosChanged); +begin + inherited; + Invalidate; +end; + +procedure TcxCustomHeader.HDMGetItemCount(var Message: TMessage); +begin + Message.Result := Sections.Count; +end; + +procedure TcxCustomHeader.HDMGetItemInfo(var Message: TCMHeaderItemInfo); + + function GetState(AIndex: Integer): TcxButtonState; + begin + if not Enabled then + Result := cxbsDisabled + else + if IsSectionIndex(AIndex) then + Result := FSections[AIndex].State + else + Result := cxbsNormal; + end; + +var + AIndex: Integer; + AHeaderItemInfo: PHeaderItemInfo; +begin + AIndex := Message.Index; + AHeaderItemInfo := Message.HeaderItemInfo; + ZeroMemory(AHeaderItemInfo, SizeOf(THeaderItemInfo)); + AHeaderItemInfo.ImageIndex := -1; + AHeaderItemInfo.State := GetState(AIndex); + AHeaderItemInfo.Rect := GetSectionRect(AIndex); + if IsSectionIndex(AIndex) then + begin + AHeaderItemInfo.Text := FSections[AIndex].Text; + AHeaderItemInfo.SectionAlignment := FSections[AIndex].FAlignment; + AHeaderItemInfo.ImageIndex := FSections[AIndex].ImageIndex; + AHeaderItemInfo.SortOrder := FSections[AIndex].SortOrder; + end; + Message.HeaderItemInfo := AHeaderItemInfo; +end; + +procedure TcxCustomHeader.SetImages(Value: TCustomImageList); +begin + cxSetImageList(Value, FImages, FImagesChangeLink, Self); +end; + +procedure TcxCustomHeader.DoSectionClickEvent(Section: TcxHeaderSection); +begin + if Assigned(FOnSectionClick) then FOnSectionClick(Self, Section); +end; + +procedure TcxCustomHeader.DoSectionChange; +begin + if Assigned(OnSectionChange) then + OnSectionChange(Self); +end; + +procedure TcxCustomHeader.DoSectionsChange; +begin + if Assigned(OnSectionsChange) then + OnSectionsChange(Self); +end; + +procedure TcxCustomHeader.DoSectionDragEvent(FromSection, ToSection: TcxHeaderSection; + var AllowDrag: Boolean); +begin + if Assigned(FOnSectionDrag) then + FOnSectionDrag(Self, FromSection, ToSection, AllowDrag); + FSectionDragged := AllowDrag; +end; + +procedure TcxCustomHeader.DoSectionEndDragEvent; +begin + if Assigned(FOnSectionEndDrag) then FOnSectionEndDrag(Self); +end; + +procedure TcxCustomHeader.DoSectionResizeEvent(Section: TcxHeaderSection); +begin + if Assigned(FOnSectionResize) then FOnSectionResize(Self, Section); +end; + +procedure TcxCustomHeader.DoSectionEndResizeEvent(Section: TcxHeaderSection); +begin + if Assigned(FOnSectionEndResize) then + FOnSectionEndResize(Self, Section); + if not FSectionsFitCalculating then + FitToClientWidth; +end; + +procedure TcxCustomHeader.DoSectionTrackEvent(Section: TcxHeaderSection; + Width: Integer; State: TcxSectionTrackState); +begin + if Assigned(FOnSectionTrack) then FOnSectionTrack(Self, Section, Width, State); +end; + +procedure TcxCustomHeader.Paint; +var + I: Integer; +begin + inherited Paint; + + Canvas.Font.Assign(Font); + Canvas.Brush.Color := Self.Color; + + if (FSections.Count = 0) and not IsInnerControl and IsDesigning then + begin + Canvas.Pen.Style := psDash; + Windows.Rectangle(Canvas.Handle, ClientRect.Left, ClientRect.Top, + ClientRect.Right, ClientRect.Bottom); + end + else + for I := 0 to FSections.Count do + DrawSection(I); +end; + +function TcxCustomHeader.GetSectionRect(Index: Integer): TRect; +var + ASectionWidths: TcxHeaderSectionWidths; + I: Integer; +begin + SetLength(ASectionWidths, Sections.Count); + for I := 0 to Sections.Count - 1 do + ASectionWidths[I] := Sections[I].Width; + Result := GetSectionRectBySectionWidths(Width, ASectionWidths, Index); +end; + +function TcxCustomHeader.GetSectionRectBySectionWidths(AHeaderWidth: Integer; + const ASectionWidths: TcxHeaderSectionWidths; AIndex: Integer): TRect; +var + I: Integer; +begin + Result := cxEmptyRect; + if (AIndex >= 0) and (AIndex <= Sections.Count) then + begin + for I := 0 to AIndex - 1 do + Inc(Result.Left, ASectionWidths[I]); + if AIndex = Sections.Count then + Result.Right := AHeaderWidth + else + Result.Right := Result.Left + ASectionWidths[AIndex]; + Result.Bottom := Height; + end; +end; + +procedure TcxCustomHeader.WMCaptureChanged(var Message: TMessage); +begin + if (FState = hsNone) then + Exit; + + case FState of + hsSized: + begin + if not ResizeUpdate then + ReleaseSplitLine; + UpdateSizedSection; + end; + hsDragged: + begin + DoSectionEndDragEvent; + RestoreScreenCursor; + end; + end; + FState := hsNone; + SelectedSectionIndex := -1; +end; + +procedure TcxCustomHeader.WMLButtonDown(var Message: TWMLButtonDown); +begin + inherited; + if csDesigning in ComponentState then + Exit; + + MouseCapture := True; + if MouseOnSizer then + begin + FState := hsSized; + if not ResizeUpdate then + InitResize(SizedSection.Right); + DoSectionTrackEvent(SizedSection, SizedSection.Width, tsTrackBegin); + FPrevMousePos := Message.XPos; + end + else + begin + if (UnderMouseSectionIndex <> -1) and UnderMouseSection.AllowClick then + begin + FState := hsPressed; + HotSectionIndex := -1; + SelectedSectionIndex := UnderMouseSectionIndex; + end; + end; +end; + +procedure TcxCustomHeader.WMMouseMove(var Message: TWMMouseMove); +var + ACalcNewWidth: Integer; +begin + inherited; + if csDesigning in ComponentState then + Exit; + + UpdateUnderMouseSection; + + case FState of + hsSized: + begin + ACalcNewWidth := SizedSection.Width + Message.XPos - FPrevMousePos; + if ACalcNewWidth < SizedSection.MinWidth then + ACalcNewWidth := SizedSection.MinWidth + else + if ACalcNewWidth > SizedSection.MaxWidth then + ACalcNewWidth := SizedSection.MaxWidth; + + if not ResizeUpdate then + begin + if FLastDrawPosOnMove <> ( SizedSection.Left + ACalcNewWidth) then + begin + DrawSplitLine(FLastDrawPosOnMove); + DrawSplitLine(SizedSection.Left + ACalcNewWidth); + end; + end + else + begin + FPrevMousePos := FPrevMousePos + ACalcNewWidth - SizedSection.Width; + SizedSection.Width := ACalcNewWidth; + DoSectionTrackEvent(SizedSection, SizedSection.Width, tsTrackMove); + end; + + DoSectionResizeEvent(SizedSection); + end; + hsPressed: + begin + if FDragReorder then + begin + FSectionDragged := False; + FState := hsDragged; + UpdateDraggedSection; + end + else + UpdatePressedSection; + end; + hsDragged: + begin + UpdateDraggedSection; + if SelectedSectionIndex <> UnderMouseSectionIndex then + HotSectionIndex := UnderMouseSectionIndex + else + HotSectionIndex := -1; + end; + hsNone: + begin + UpdateSizedSection; + if MouseOnSizer then + HotSectionIndex := -1 + else + HotSectionIndex := UnderMouseSectionIndex; + end; + end; + + BeginMouseTracking(Self, ClientRect, Self); +end; + +procedure TcxCustomHeader.WMLButtonUp(var Message: TWMLButtonUp); +var + ASection: TcxHeaderSection; + AState: TShiftState; +begin + inherited; + if IsDesigning then + Exit; + + case FState of + hsSized: + begin + if not ResizeUpdate then + begin + SizedSection.Width := FLastDrawPosOnMove - SizedSection.Left; + ReleaseSplitLine; + end; + DoSectionTrackEvent(SizedSection, SizedSection.Width, tsTrackEnd); + UpdateSizedSection; + end; + hsDragged: + begin + if FSectionDragged then + DoSectionEndDrag; + RestoreScreenCursor; + UpdateSections; + end; + hsPressed: + begin + if UnderMouseSectionIndex = SelectedSectionIndex then + begin + AState := KeysToShiftState(Message.Keys); + ASection := SelectedSection; + DoSectionClickEvent(ASection); + ChangeSectionSortOrder(ASection, + GetNextSortOrder(ASection.SortOrder, ssCtrl in AState), + [ssCtrl, ssShift] * AState = []); + end; + end; + end; + FState := hsNone; + MouseCapture := False; + SelectedSectionIndex := -1; +end; + +function TcxCustomHeader.GetSectionIndexAtPos(X, Y: Integer; AIncludeNonSectionPart: Boolean): Integer; +var + I: Integer; + ACount: Integer; +begin + Result := -1; + if AIncludeNonSectionPart then + ACount := FSections.Count + else + ACount := FSections.Count - 1; + for I := 0 to ACount do + if PtInRect(GetSectionRect(I), Point(X, Y)) and PtInRect(ClientRect, Point(X, Y)) then + begin + Result := I; + Break; + end; +end; + +function TcxCustomHeader.GetSelectedSection: TcxHeaderSection; +begin + Result := FSections[SelectedSectionIndex]; +end; + +function TcxCustomHeader.GetSizedSection: TcxHeaderSection; +begin + Result := FSections[SizedSectionIndex]; +end; + +function TcxCustomHeader.GetUnderMouseSection: TcxHeaderSection; +begin + Result := FSections[UnderMouseSectionIndex]; +end; + +function TcxCustomHeader.IsSectionIndex(AIndex: Integer): Boolean; +begin + Result := (AIndex >= 0) and (AIndex < FSections.Count); +end; + +procedure TcxCustomHeader.HeaderMouseLeave; +begin + Perform(CM_MOUSELEAVE, 0, 0); +end; + +procedure TcxCustomHeader.SetHotSectionIndex(Value: Integer); +begin + if (FHotSectionIndex <> Value) then + begin + SetSectionState(FHotSectionIndex, cxbsNormal); + FHotSectionIndex := Value; + SetSectionState(FHotSectionIndex, cxbsHot); + end; +end; + +procedure TcxCustomHeader.SetMouseOnSizer(Value: Boolean); +begin + if FMouseOnSizer <> Value then + begin + FMouseOnSizer := Value; + if FMouseOnSizer then + SetScreenCursor(crHSplit) + else + RestoreScreenCursor; + end; +end; + +procedure TcxCustomHeader.SetSectionState(AIndex: Integer; AState: TcxButtonState); +begin + if (Sections.Count > 0) and (AIndex >= 0) and (AIndex < Sections.Count) then + FSections[AIndex].State := AState; +end; + +procedure TcxCustomHeader.SetSelectedSectionIndex(Value: Integer); +begin + if Value <> -1 then + SetSectionState(Value, cxbsPressed) + else + SetSectionState(FSelectedSectionIndex, cxbsNormal); + FSelectedSectionIndex := Value; +end; + +procedure TcxCustomHeader.SetSizedSectionIndex(Value: Integer); +begin + FSizedSectionIndex := Value; + if FSizedSectionIndex = -1 then + MouseOnSizer := False + else + MouseOnSizer := True; +end; + +procedure TcxCustomHeader.SetUnderMouseSectionIndex(Value: Integer); +begin + FUnderMouseSectionIndex := Value; +end; + +procedure TcxCustomHeader.UpdateDraggedSection; +begin + if UnderMouseSectionIndex <> -1 then + begin + SetScreenCursor(crDrag); + DoSectionDrag(SelectedSection, UnderMouseSection); + end + else + RestoreScreenCursor; +end; + +procedure TcxCustomHeader.UpdatePressedSection; +begin + if UnderMouseSectionIndex <> FSelectedSectionIndex then + SetSectionState(FSelectedSectionIndex, cxbsNormal) + else + SetSectionState(FSelectedSectionIndex, cxbsPressed); +end; + +procedure TcxCustomHeader.UpdateSizedSection; +var + ASectionRect: TRect; + APoint: TPoint; + ASizedSectionIndex, AUnderMouseSectionIndex: Integer; +begin + GetCursorPos(APoint); + APoint := ScreenToClient(APoint); + ASizedSectionIndex := -1; + AUnderMouseSectionIndex := GetSectionIndexAtPos(APoint.X, APoint.Y, True); + if AUnderMouseSectionIndex >= 0 then + begin + ASectionRect := GetSectionRect(AUnderMouseSectionIndex); + if (AUnderMouseSectionIndex < FSections.Count) and + (APoint.X >= ASectionRect.Right - 7) and (APoint.X <= ASectionRect.Right) then + ASizedSectionIndex := AUnderMouseSectionIndex + else + if (AUnderMouseSectionIndex > 0) and + (APoint.X >= ASectionRect.Left) and (APoint.X <= ASectionRect.Left + 7) then + ASizedSectionIndex := AUnderMouseSectionIndex - 1 + end; + SizedSectionIndex := ASizedSectionIndex; +end; + +procedure TcxCustomHeader.UpdateUnderMouseSection; +var + APoint: TPoint; +begin + GetCursorPos(APoint); + APoint := ScreenToClient(APoint); + UnderMouseSectionIndex := GetSectionIndexAtPos(APoint.X, APoint.Y); +end; + +procedure TcxCustomHeader.CMMouseEnter(var Message: TMessage); +begin + inherited; + BeginMouseTracking(Self, ClientRect, Self); +end; + +procedure TcxCustomHeader.CMMouseLeave(var Message: TMessage); +begin + inherited; + EndMouseTracking(Self); + case FState of + hsNone: + begin + UnderMouseSectionIndex := -1; + SizedSectionIndex := -1; + HotSectionIndex := -1; + end; + end; +end; + +procedure TcxCustomHeader.SetAllowSort(Value: Boolean); +begin + if FAllowSort <> Value then + begin + FAllowSort := Value; + if not FAllowSort then DisableSort; + end; +end; + +procedure TcxCustomHeader.DisableSort; +var + I: Integer; +begin + Sections.BeginUpdate; + try + for I := 0 to Sections.Count - 1 do + Sections[I].SortOrder := soNone; + finally + Sections.EndUpdate; + end; +end; + +procedure TcxCustomHeader.FitToClientWidth; +var + ASectionWidths: TcxHeaderSectionWidths; + ASectionWidthsChanged: Boolean; + I: Integer; +begin + if not HandleAllocated or (csReading in ComponentState) then + Exit; + CalcSectionWidths(Width, ASectionWidths); + ASectionWidthsChanged := False; + for I := 0 to Sections.Count - 1 do + if Sections[I].Width <> ASectionWidths[I] then + begin + ASectionWidthsChanged := True; + Break; + end; + if ASectionWidthsChanged then + begin + FSectionsFitCalculating := True; + try + Sections.BeginUpdate; + try + for I := 0 to Sections.Count - 1 do + Sections[I].Width := ASectionWidths[I]; + finally + Sections.EndUpdate; + end; + finally + FSectionsFitCalculating := False; + end; + end; +end; + +function TcxCustomHeader.GetSectionContentBounds(ASectionBounds: TRect; + AState: TcxButtonState): TRect; +begin + Result := LookAndFeel.Painter.HeaderControlSectionContentBounds( + ASectionBounds, AState); +end; + +function TcxCustomHeader.IsInnerControl: Boolean; +begin + Result := False; +end; + +{ TcxHeaderSection } +constructor TcxHeaderSection.Create(Collection: TCollection); +begin + FWidth := 50; + FMaxWidth := 1000; + FMinWidth := 30; + FAllowClick := False; + FImageIndex := -1; + FParentBiDiMode := True; + inherited Create(Collection); + ParentBiDiModeChanged; + FDataIndex := Index; +end; + +procedure TcxHeaderSection.Assign(Source: TPersistent); +begin + if Source is TcxHeaderSection then + begin + Alignment := TcxHeaderSection(Source).Alignment; + AllowClick := TcxHeaderSection(Source).AllowClick; + AutoSize := TcxHeaderSection(Source).AutoSize; + BiDiMode := TcxHeaderSection(Source).BiDiMode; + DataIndex := TcxHeaderSection(Source).DataIndex; + ImageIndex := TcxHeaderSection(Source).ImageIndex; + MinWidth := TcxHeaderSection(Source).MinWidth; + MaxWidth := TcxHeaderSection(Source).MaxWidth; + ParentBiDiMode := TcxHeaderSection(Source).ParentBiDiMode; + SortOrder := TcxHeaderSection(Source).SortOrder; + Text := TcxHeaderSection(Source).Text; + Width := TcxHeaderSection(Source).Width; + end + else + inherited Assign(Source); +end; + +procedure TcxHeaderSection.SetBiDiMode(Value: TBiDiMode); +begin + if Value <> FBiDiMode then + begin + FBiDiMode := Value; + FParentBiDiMode := False; + Changed(False); + end; +end; + +procedure TcxHeaderSection.SetDataIndex(Value: Integer); +begin + if Value < -1 then + Value := -1; + if Value <> FDataIndex then + begin + FDataIndex := Value; + Changed(False); + end; +end; + +function TcxHeaderSection.IsBiDiModeStored: Boolean; +begin + Result := not FParentBiDiMode; +end; + +function TcxHeaderSection.IsDataIndexStored: Boolean; +begin + Result := FDataIndex <> Index; +end; + +function TcxHeaderSection.GetHeaderControl: TcxCustomHeader; +begin + Result := TcxHeaderSections(Collection).FHeaderControl; +end; + +procedure TcxHeaderSection.SetParentBiDiMode(Value: Boolean); +begin + if FParentBiDiMode <> Value then + begin + FParentBiDiMode := Value; + ParentBiDiModeChanged; + end; +end; + +procedure TcxHeaderSection.SetState(Value: TcxButtonState); +begin + if FState <> Value then + begin + FState := Value; + Changed(False); + end; +end; + +procedure TcxHeaderSection.ParentBiDiModeChanged; +begin + if FParentBiDiMode then + begin + if GetOwner <> nil then + begin + BiDiMode := TcxHeaderSections(GetOwner).FHeaderControl.BiDiMode; + FParentBiDiMode := True; + end; + end; +end; + +function TcxHeaderSection.UseRightToLeftReading: Boolean; +begin + Result := SysLocale.MiddleEast and (BiDiMode <> bdLeftToRight); +end; + +function TcxHeaderSection.UseRightToLeftAlignment: Boolean; +begin + Result := SysLocale.MiddleEast and (BiDiMode = bdRightToLeft); +end; + +function TcxHeaderSection.GetDisplayName: string; +begin + Result := Text; + if Result = '' then + Result := inherited GetDisplayName; +end; + +function TcxHeaderSection.GetLeft: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Index - 1 do + Inc(Result, TcxHeaderSections(Collection)[I].Width); +end; + +function TcxHeaderSection.GetRight: Integer; +begin + Result := Left + Width; +end; + +procedure TcxHeaderSection.SetAlignment(Value: TAlignment); +begin + if FAlignment <> Value then + begin + FAlignment := Value; + Changed(False); + end; +end; + +procedure TcxHeaderSection.SetAutoSize(Value: Boolean); +begin + if Value <> FAutoSize then + begin + FAutoSize := Value; + if TcxHeaderSections(Collection).FHeaderControl <> nil then + TcxHeaderSections(Collection).FHeaderControl.AdjustSize; + Changed(True); + end; +end; + +procedure TcxHeaderSection.SetMaxWidth(Value: TcxNaturalNumber); +begin + if Value < FMinWidth then + Value := FMinWidth; + if Value > 10000 then + Value := 10000; + FMaxWidth := Value; + SetWidth(FWidth); +end; + +procedure TcxHeaderSection.SetMinWidth(Value: TcxNaturalNumber); +begin + if Value > FMaxWidth then + Value := FMaxWidth; + FMinWidth := Value; + SetWidth(FWidth); +end; + +procedure TcxHeaderSection.SetText(const Value: string); +begin + if FText <> Value then + begin + FText := Value; + Changed(False); + end; +end; + +procedure TcxHeaderSection.SetSortOrder(Value: TcxHeaderSortOrder); +begin + if FSortOrder <> Value then + begin + FSortOrder := Value; + Changed(False); + end; +end; + +procedure TcxHeaderSection.SetWidth(Value: Integer); +begin + if Value < FMinWidth then + Value := FMinWidth; + if Value > FMaxWidth then + Value := FMaxWidth; + if FWidth <> Value then + begin + FWidth := Value; + Changed(True); + + if Collection <> nil then + begin + TcxHeaderSections(Collection).FHeaderControl.DoSectionResizeEvent(Self); + TcxHeaderSections(Collection).FHeaderControl.DoSectionEndResizeEvent(Self); + end; + end; +end; + +procedure TcxHeaderSection.SetImageIndex(const Value: TImageIndex); +begin + if Value <> FImageIndex then + begin + FImageIndex := Value; + Changed(False); + end; +end; + +{ TcxHeaderSections } + +constructor TcxHeaderSections.Create(HeaderControl: TcxCustomHeader); +begin + inherited Create(TcxHeaderSection); + FHeaderControl := HeaderControl; +end; + +procedure TcxHeaderSections.Assign(Source: TPersistent); +var + FHeaderSection: TcxHeaderSection; + I: Integer; +begin + if (Source is TcxHeaderSections) then + begin + Clear; + for I := 0 to (Source as TcxHeaderSections).Count - 1 do + begin + FHeaderSection := Add; + FHeaderSection.Assign((Source as TcxHeaderSections).Items[I]); + end; + end + else + inherited Assign(Source); +end; + +function TcxHeaderSections.Add: TcxHeaderSection; +begin + Result := TcxHeaderSection.Create(Self); +end; + +function TcxHeaderSections.GetItem(Index: Integer): TcxHeaderSection; +begin + Result := TcxHeaderSection(inherited GetItem(Index)); +end; + +function TcxHeaderSections.GetOwner: TPersistent; +begin + Result := FHeaderControl; +end; + +procedure TcxHeaderSections.SetItem(Index: Integer; Value: TcxHeaderSection); +begin + inherited SetItem(Index, Value); +end; + +procedure TcxHeaderSections.Update(Item: TCollectionItem); +begin + if FHeaderControl <> nil then + begin + if Item <> nil then + begin + FHeaderControl.UpdateSection(Item.Index); + FHeaderControl.DoSectionChange; + end + else + begin + if not FHeaderControl.FSectionsFitCalculating then + FHeaderControl.FitToClientWidth; + FHeaderControl.UpdateSections; + FHeaderControl.DoSectionsChange; + end; + end; +end; + +function TcxHeaderSections.Insert(Index: Integer): TcxHeaderSection; +begin + BeginUpdate; + try + if Index < 0 then Index := 0; + if Index > Count then Index := Count - 1; + + Result := Add; + Result.Index := Index; + finally + EndUpdate; + end; +end; +{ TcxHeaderSections } + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxHint.pas b/official/x.35/ExpressEditors Library 5/Sources/cxHint.pas new file mode 100644 index 00000000..02b44542 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxHint.pas @@ -0,0 +1,1750 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxHint; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Classes, Forms, Controls{must be after Forms for D11}, Graphics, + ImgList, Messages, StdCtrls, SysUtils, cxClasses, cxContainer, cxControls, + cxEdit, cxGraphics, cxLookAndFeels, cxTextEdit; + +type + TcxCustomHintStyleController = class; + TcxCustomHintStyle = class; + TcxCustomHintWindow = class; + TcxHintAnimationDelay = 0..1000; + TcxHintStyleChangedEvent = procedure (Sender: TObject; AStyle: TcxCustomHintStyle) of object; + TcxShowHintEvent = procedure(Sender: TObject; var HintStr: string; + var CanShow: Boolean; var HintInfo: THintInfo) of object; + TcxShowHintExEvent = procedure(Sender: TObject; var Caption, HintStr: string; + var CanShow: Boolean; var HintInfo: THintInfo) of object; + TcxCallOutPosition = (cxbpNone, cxbpAuto, cxbpLeftBottom, cxbpLeftTop, cxbpTopLeft, + cxbpTopRight, cxbpRightBottom, cxbpRightTop, cxbpBottomRight, cxbpBottomLeft); + TcxHintIconType = (cxhiNone, cxhiApplication, cxhiInformation, cxhiWarning, + cxhiError, cxhiQuestion, cxhiWinLogo, cxhiCurrentApplication, cxhiCustom); + TcxHintAnimate = TcxHintAnimationStyle; + TcxHintIconSize = (cxisDefault, cxisLarge, cxisSmall); + + IcxHint = interface + ['{0680CE5D-391B-45A1-B55D-AFCAE92F2DA6}'] + function GetAnimate: TcxHintAnimate; + function GetAnimationDelay: TcxHintAnimationDelay; + function GetBorderColor: TColor; + function GetCallOutPosition: TcxCallOutPosition; + function GetColor: TColor; + function GetIconSize: TcxHintIconSize; + function GetIconType: TcxHintIconType; + function GetHintCaption: string; + function GetRounded: Boolean; + function GetRoundRadius: Integer; + function GetStandard: Boolean; + function GetHintFont: TFont; + function GetHintCaptionFont: TFont; + function GetHintIcon: TIcon; + procedure SetHintCaption(Value: string); + property HintCaption: string read GetHintCaption write SetHintCaption; + end; + + { TcxCustomHintStyle } + + TcxCustomHintStyle = class(TPersistent) + private + FAnimate: TcxHintAnimate; + FAnimationDelay: TcxHintAnimationDelay; + FCallOutPosition: TcxCallOutPosition; + FBorderColor: TColor; + FColor: TColor; + FFont: TFont; + FCaptionFont: TFont; + FIcon: TIcon; + FIconSize: TcxHintIconSize; + FIconType: TcxHintIconType; + FRounded: Boolean; + FRoundRadius: Integer; + FStandard: Boolean; + FDirectAccessMode: Boolean; + FIsDestroying: Boolean; + FModified: Boolean; + FOwner: TPersistent; + FUpdateCount: Integer; + FOnChanged: TNotifyEvent; + function GetControl: TcxControl; + function GetFont: TFont; + procedure SetAnimate(Value: TcxHintAnimate); + procedure SetAnimationDelay(Value: TcxHintAnimationDelay); + procedure SetCallOutPosition(Value: TcxCallOutPosition); + procedure SetBorderColor(Value: TColor); + procedure SetCaptionFont(Value: TFont); + procedure SetColor(Value: TColor); + procedure SetFont(Value: TFont); + procedure SetIcon(Value: TIcon); + procedure SetIconSize(Value: TcxHintIconSize); + procedure SetIconType(Value: TcxHintIconType); + procedure SetRounded(Value: Boolean); + procedure SetRoundRadius(Value: Integer); + procedure SetStandard(Value: Boolean); + procedure IconChangeHandler(Sender: TObject); + procedure InternalRestoreDefault; + protected + FHintStyleController: TcxCustomHintStyleController; + function GetOwner: TPersistent; override; + function BaseGetHintStyleController: TcxCustomHintStyleController; + procedure BaseSetHintStyleController(Value: TcxCustomHintStyleController); + procedure Changed; virtual; + procedure ControllerChangedNotification(AStyleController: TcxCustomHintStyleController); virtual; + procedure ControllerFreeNotification(AHintStyleController: TcxCustomHintStyleController); virtual; + procedure HintStyleControllerChanged; virtual; + property HintStyleController: TcxCustomHintStyleController read BaseGetHintStyleController + write BaseSetHintStyleController; + property IsDestroying: Boolean read FIsDestroying write FIsDestroying; + property OnChanged: TNotifyEvent read FOnChanged write FOnChanged; + public + constructor Create(AOwner: TPersistent; ADirectAccessMode: Boolean); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure BeginUpdate; + procedure EndUpdate; + class function GetDefaultHintStyleController: TcxCustomHintStyleController; virtual; + procedure RestoreDefaults; virtual; + property Control: TcxControl read GetControl; + property DirectAccessMode: Boolean read FDirectAccessMode; + published + property Animate: TcxHintAnimate read FAnimate write SetAnimate default cxhaAuto; + property AnimationDelay: TcxHintAnimationDelay read FAnimationDelay write SetAnimationDelay default 100; + property BorderColor: TColor read FBorderColor write SetBorderColor default clWindowFrame; + property CallOutPosition: TcxCallOutPosition read FCallOutPosition write SetCallOutPosition default cxbpNone; + property CaptionFont: TFont read FCaptionFont write SetCaptionFont; + property Color: TColor read FColor write SetColor default clInfoBk; + property Font: TFont read GetFont write SetFont; + property Icon: TIcon read FIcon write SetIcon; + property IconSize: TcxHintIconSize read FIconSize write SetIconSize default cxisDefault; + property IconType: TcxHintIconType read FIconType write SetIconType default cxhiNone; + property Rounded: Boolean read FRounded write SetRounded default False; + property RoundRadius: Integer read FRoundRadius write SetRoundRadius default 11; + property Standard: Boolean read FStandard write SetStandard default False; + end; + + TcxCustomHintWindowClass = class of TcxCustomHintWindow; + TcxHintStyleClass = class of TcxCustomHintStyle; + + { TcxCustomHintStyleController } + + TcxCustomHintStyleController = class(TComponent) + private + FGlobal: Boolean; + FActive: Boolean; + FIsDestruction: Boolean; + FListeners: TList; + FOnHintStyleChanged: TcxHintStyleChangedEvent; + FOnShowHint: TcxShowHintEvent; + FOnShowHintEx: TcxShowHintExEvent; + FHintShortPause: Integer; + FHintPause: Integer; + FHintHidePause: Integer; + FHintWindow: TcxCustomHintWindow; + FPreviousHintWindowClass: THintWindowClass; + FUpdateCount: Integer; + procedure DoApplicationShowHint(var HintStr: string; var CanShow: Boolean; + var HintInfo: THintInfo); + procedure DoShowHint(var HintStr: string; var CanShow: Boolean; + var HintInfo: THintInfo); + function IsGlobalStored: Boolean; + procedure SetGlobal(Value: Boolean); + procedure SetHintStyle(Value: TcxCustomHintStyle); + procedure HintStyleChanged(Sender: TObject); + procedure SetHintShortPause(Value: Integer); + procedure SetHintPause(Value: Integer); + procedure SetHintHidePause(Value: Integer); + procedure SetApplicationHintProperties; + procedure ShowHintHandler(var HintStr: string; var CanShow: Boolean; + var HintInfo: THintInfo); + protected + FHintStyle: TcxCustomHintStyle; + function GetHintStyleClass: TcxHintStyleClass; virtual; + function GetHintWindowClass: TcxCustomHintWindowClass; virtual; + procedure InitHintWindowClass; virtual; + procedure Loaded; override; + procedure BeginUpdate; virtual; + procedure EndUpdate; virtual; + procedure AddListener(AListener: TcxCustomHintStyle); virtual; + procedure Changed; + procedure DoHintStyleChanged(AStyle: TcxCustomHintStyle); virtual; + procedure RemoveListener(AListener: TcxCustomHintStyle); virtual; + procedure UninitHintWindowClass; virtual; + property Active: Boolean read FActive; + property Global: Boolean read FGlobal write SetGlobal stored IsGlobalStored; + property HintHidePause: Integer read FHintHidePause write SetHintHidePause + default 2500; + property HintPause: Integer read FHintPause write SetHintPause default 500; + property HintShortPause: Integer read FHintShortPause + write SetHintShortPause default 50; + property HintStyle: TcxCustomHintStyle read FHintStyle write SetHintStyle; + property IsDestruction: Boolean read FIsDestruction write FIsDestruction; + property Listeners: TList read FListeners; + property OnHintStyleChanged: TcxHintStyleChangedEvent + read FOnHintStyleChanged write FOnHintStyleChanged; + property OnShowHint: TcxShowHintEvent read FOnShowHint write FOnShowHint; + property OnShowHintEx: TcxShowHintExEvent read FOnShowHintEx write FOnShowHintEx; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure SaveShowHintEvent; virtual; + procedure RestoreShowHintEvent; virtual; + + procedure ShowHint(X, Y: Integer; ACaption, AHint: string); + procedure HideHint; + function GetHintWidth(AHint: string): Integer; + function GetHintHeight(AHint: string): Integer; + + property HintWindow: TcxCustomHintWindow read FHintWindow; + end; + + { TcxHintStyleController } + + TcxHintStyleController = class(TcxCustomHintStyleController) + published + property Global; + property HintStyle; + property HintShortPause; + property HintPause; + property HintHidePause; + property OnHintStyleChanged; + property OnShowHint; + property OnShowHintEx; + end; + + { TcxCustomHintWindow } + + TcxCustomHintWindow = class(TcxBaseHintWindow) + private + FCallOutPosition: TcxCallOutPosition; + FBorderColor: TColor; + FHintColor: TColor; + FCaption, FText: string; + FCaptionFont: TFont; + FIcon: TIcon; + FIconSize: TcxHintIconSize; + FIconType: TcxHintIconType; + FRounded: Boolean; + FRoundRadius: Integer; + FWordWrap: Boolean; + Rgn: HRGN; + FLeftRightMargint, FIconLeftMargin: Integer; + FTopBottomMargin, FIconTopMargin: Integer; + FIconHeight: Integer; + FIconWidth: Integer; + FCaptionRect: TRect; + FTextRect: TRect; + FHintWndRect: TRect; + FCallOutSize: Byte; + FCalculatedCallOutPos: TcxCallOutPosition; + FIndentDelta: Integer; + function GetAnimate: TcxHintAnimate; + procedure SetAnimate(AValue: TcxHintAnimate); + procedure SetIcon(Value: TIcon); + procedure WMShowWindow(var Message: TWMShowWindow); message WM_SHOWWINDOW; + protected + procedure EnableRegion; override; + + procedure CreateBalloonForm; virtual; + procedure Paint; override; + procedure CalculateValues; virtual; + procedure CalculateController; virtual; + procedure CalculateIcon; virtual; + function CalculateAutoCallOutPosition(const ARect: TRect): TcxCallOutPosition; virtual; + procedure CalculateRects(const ACaption, AText: string; + const AMaxWidth: Integer); virtual; + procedure LoadPropertiesFromController(const AHintController: TcxCustomHintStyleController); + procedure LoadPropertiesFromHintInterface(const AHintIntf: IcxHint); + procedure LoadPropertiesFromHintStyle(const AHintStyle: TcxCustomHintStyle); + + property StandardHint: Boolean read FStandardHint write FStandardHint; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure ActivateHint(ARect: TRect; const AHint: string); override; + function CalcHintRect(MaxWidth: Integer; const AHint: string; + AData: Pointer): TRect; override; + + property Animate: TcxHintAnimate read GetAnimate write SetAnimate; // obsolete + property BorderColor: TColor read FBorderColor write FBorderColor; + property CallOutPosition: TcxCallOutPosition read FCallOutPosition write FCallOutPosition; + property Caption: string read FCaption write FCaption; + property CaptionFont: TFont read FCaptionFont write FCaptionFont; + property Icon: TIcon read FIcon write SetIcon; + property IconSize: TcxHintIconSize read FIconSize write FIconSize; + property IconType: TcxHintIconType read FIconType write FIconType; + property Rounded: Boolean read FRounded write FRounded; + property RoundRadius: Integer read FRoundRadius write FRoundRadius; + property WordWrap: Boolean read FWordWrap write FWordWrap; + end; + + { TcxHintWindow } + + TcxHintWindow = class(TcxCustomHintWindow) + end; + +implementation + +uses + Dialogs, cxEditConsts, cxEditUtils, cxExtEditUtils, dxThemeConsts, + dxThemeManager, dxUxTheme; + +type +{$IFNDEF DELPHI6} + TAnimateWindowProc = function(hWnd: HWND; dwTime: DWORD; dwFlags: DWORD): BOOL; stdcall; +{$ENDIF} + + { TcxHintedControlController } + + TcxHintedControlController = class(TComponent) + private + FHintedControl: TControl; + procedure SetHintedControl(Value: TControl); + protected + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + public + destructor Destroy; override; + property HintedControl: TControl read FHintedControl write SetHintedControl; + end; + +{$IFNDEF DELPHI6} +const + SPI_GETTOOLTIPANIMATION = $1016; + SPI_GETTOOLTIPFADE = $1018; +{$ENDIF} + +var +{$IFNDEF DELPHI6} + AnimateWindowProc: TAnimateWindowProc = nil; + UserHandle: THandle; +{$ENDIF} + FControllerList: TList; + FHintedControlController: TcxHintedControlController; + FIsApplicationOnShowHintSaved: Boolean; + FSavedApplicationOnShowHint: TShowHintEvent; + +function FindHintController: TcxCustomHintStyleController; forward; +function FindHintedControl: TControl; forward; +function GetHintedControl: TControl; forward; +function GetWindowParent(AWnd: HWND): TWinControl; forward; +procedure SetHintedControl(Value: TControl); forward; + +function FindHintController: TcxCustomHintStyleController; + + function FindHintControllerOnParents: TcxCustomHintStyleController; + + function FindHintControllerAmongComponents( + AControl: TWinControl): TcxCustomHintStyleController; + var + AController: TcxCustomHintStyleController; + I: Integer; + begin + Result := nil; + for I := 0 to AControl.ComponentCount - 1 do + if AControl.Components[I] is TcxCustomHintStyleController then + begin + AController := TcxCustomHintStyleController(AControl.Components[I]); + if AController.Active then + begin + Result := AController; + Break; + end; + end; + end; + + var + AHintedControl: TControl; + AParent: TWinControl; + begin + Result := nil; + AHintedControl := FindHintedControl; + if AHintedControl = nil then + Exit; + if (AHintedControl is TWinControl) and TWinControl(AHintedControl).HandleAllocated then + AParent := GetWindowParent(TWinControl(AHintedControl).Handle) + else + AParent := AHintedControl.Parent; + while AParent <> nil do + begin + Result := FindHintControllerAmongComponents(AParent); + if (Result <> nil) or not AParent.HandleAllocated then + Break; + AParent := GetWindowParent(AParent.Handle); + end; + end; + +var + AController: TcxCustomHintStyleController; + I: Integer; +begin + Result := FindHintControllerOnParents; + if Result = nil then + for I := FControllerList.Count - 1 downto 0 do + begin + AController := TcxCustomHintStyleController(FControllerList[I]); + if AController.Active and AController.Global then + begin + Result := AController; + Break; + end; + end; +end; + +function FindHintedControl: TControl; +var + AWnd: HWND; +begin + if GetHintedControl <> nil then + Result := GetHintedControl + else + begin + Result := nil; + AWnd := WindowFromPoint(InternalGetCursorPos); + if AWnd <> 0 then + begin + Result := FindControl(AWnd); + if Result = nil then + Result := GetWindowParent(AWnd); + end; + end; +end; + +function GetHintedControl: TControl; +begin + if FHintedControlController <> nil then + Result := FHintedControlController.HintedControl + else + Result := nil; +end; + +function GetWindowParent(AWnd: HWND): TWinControl; +begin + Result := nil; + while (Result = nil) and (AWnd <> 0) and IsChildClassWindow(AWnd) do + begin + AWnd := GetParent(AWnd); + Result := FindControl(AWnd); + end; +end; + +procedure SetHintedControl(Value: TControl); +begin + if FHintedControlController <> nil then + FHintedControlController.HintedControl := Value; +end; + +{ TcxHintedControlController } + +destructor TcxHintedControlController.Destroy; +begin + HintedControl := nil; + inherited Destroy; +end; + +procedure TcxHintedControlController.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (AComponent = FHintedControl) then + HintedControl := nil; +end; + +procedure TcxHintedControlController.SetHintedControl(Value: TControl); +begin + if Value <> FHintedControl then + begin + if FHintedControl <> nil then + FHintedControl.RemoveFreeNotification(Self); + FHintedControl := Value; + if FHintedControl <> nil then + FHintedControl.FreeNotification(Self); + end; +end; + +{ TcxCustomHintStyle } + +constructor TcxCustomHintStyle.Create(AOwner: TPersistent; ADirectAccessMode: Boolean); +begin + inherited Create; + FOwner := AOwner; + FDirectAccessMode := ADirectAccessMode; + FFont := TFont.Create; + FCaptionFont := TFont.Create; + FIcon := TIcon.Create; + FIcon.OnChange := IconChangeHandler; + FModified := False; + InternalRestoreDefault; + HintStyleController := GetDefaultHintStyleController; +end; + +destructor TcxCustomHintStyle.Destroy; +begin + FIsDestroying := True; + if FHintStyleController <> nil then + FHintStyleController.RemoveListener(Self); + FreeAndNil(FIcon); + FreeAndNil(FCaptionFont); + FreeAndNil(FFont); + inherited Destroy; +end; + +procedure TcxCustomHintStyle.Assign(Source: TPersistent); +begin + if (Source is TcxCustomHintStyle) then + begin + BeginUpdate; + try + with (Source as TcxCustomHintStyle) do + begin + Self.Animate := Animate; + Self.AnimationDelay := AnimationDelay; + Self.BorderColor := BorderColor; + Self.CallOutPosition := CallOutPosition; + Self.CaptionFont.Assign(CaptionFont); + Self.Color := Color; + Self.HintStyleController := HintStyleController; + Self.IconSize := IconSize; + Self.IconType := IconType; + Self.Rounded := Rounded; + Self.RoundRadius := RoundRadius; + Self.Standard := Standard; + Self.Font.Assign(Font); + Self.CaptionFont.Assign(CaptionFont); + Self.Icon.Assign(Icon); + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +procedure TcxCustomHintStyle.InternalRestoreDefault; +var + FRestoreFont: TFont; +begin + FAnimate := cxhaAuto; + FAnimationDelay := 100; + FBorderColor := clWindowFrame; + FCallOutPosition := cxbpNone; + FColor := clInfoBk; + FIconSize := cxisDefault; + FIconType := cxhiNone; + FRounded := False; + FRoundRadius := 11; + FStandard := False; + FRestoreFont := TFont.Create; + try + FFont.Assign(FRestoreFont); + FCaptionFont.Assign(FRestoreFont); + finally + FreeAndNil(FRestoreFont); + end; +end; + +procedure TcxCustomHintStyle.BeginUpdate; +begin + Inc(FUpdateCount); +end; + +procedure TcxCustomHintStyle.EndUpdate; +begin + if FUpdateCount <> 0 then + begin + Dec(FUpdateCount); + if FModified then + Changed; + end; +end; + +class function TcxCustomHintStyle.GetDefaultHintStyleController: TcxCustomHintStyleController; +begin + Result := nil; +end; + +procedure TcxCustomHintStyle.RestoreDefaults; +begin + BeginUpdate; + try + InternalRestoreDefault; + finally + EndUpdate; + end; +end; + +function TcxCustomHintStyle.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +function TcxCustomHintStyle.BaseGetHintStyleController: TcxCustomHintStyleController; +begin + if FHintStyleController = GetDefaultHintStyleController then + Result := nil + else + Result := FHintStyleController; +end; + +procedure TcxCustomHintStyle.BaseSetHintStyleController(Value: TcxCustomHintStyleController); + + function CheckHintStyleController(AHintStyleController: TcxCustomHintStyleController): Boolean; + var + AOwner: TPersistent; + begin + Result := False; + AOwner := GetOwner; + while AOwner <> nil do + begin + if (AOwner is TcxCustomHintStyleController) and (AOwner = AHintStyleController) then + Exit; + AOwner := GetPersistentOwner(AOwner); + end; + Result := True; + end; + +begin + if Value = nil then + Value := GetDefaultHintStyleController; + + if (Value <> nil) and (not CheckHintStyleController(Value)) then Exit; + + if Value <> FHintStyleController then + begin + if FHintStyleController <> nil then + FHintStyleController.RemoveListener(Self); + FHintStyleController := Value; + if FHintStyleController <> nil then + FHintStyleController.AddListener(Self); + HintStyleControllerChanged; + end; +end; + +procedure TcxCustomHintStyle.Changed; +begin + if FUpdateCount = 0 then + begin + if not DirectAccessMode and Assigned(FOnChanged) and not IsDestroying then + FOnChanged(Self); + FModified := False; + end + else + FModified := True; +end; + +procedure TcxCustomHintStyle.ControllerChangedNotification(AStyleController: TcxCustomHintStyleController); +begin + Changed; +end; + +procedure TcxCustomHintStyle.ControllerFreeNotification(AHintStyleController: TcxCustomHintStyleController); +begin + if (AHintStyleController <> nil) and (AHintStyleController = FHintStyleController) then + HintStyleController := nil; +end; + +procedure TcxCustomHintStyle.HintStyleControllerChanged; +begin + Changed; +end; + +function TcxCustomHintStyle.GetControl: TcxControl; +begin + Result := TcxControl(FOwner); +end; + +function TcxCustomHintStyle.GetFont: TFont; +begin + Result := FFont; +end; + +procedure TcxCustomHintStyle.SetAnimate(Value: TcxHintAnimate); +begin + if Value <> FAnimate then + begin + FAnimate := Value; + Changed; + end; +end; + +procedure TcxCustomHintStyle.SetAnimationDelay(Value: TcxHintAnimationDelay); +begin + if Value <> FAnimationDelay then + begin + FAnimationDelay := Value; + Changed; + end; +end; + +procedure TcxCustomHintStyle.SetCallOutPosition(Value: TcxCallOutPosition); +begin + if Value <> FCallOutPosition then + begin + FCallOutPosition := Value; + Changed; + end; +end; + +procedure TcxCustomHintStyle.SetBorderColor(Value: TColor); +begin + if Value <> FBorderColor then + begin + FBorderColor := Value; + Changed; + end; +end; + +procedure TcxCustomHintStyle.SetColor(Value: TColor); +begin + if FColor <> Value then + begin + FColor := Value; + Changed; + end; +end; + +procedure TcxCustomHintStyle.SetCaptionFont(Value: TFont); +begin + FCaptionFont.Assign(Value); + Changed; +end; + +procedure TcxCustomHintStyle.SetFont(Value: TFont); +begin + FFont.Assign(Value); + Changed; +end; + +procedure TcxCustomHintStyle.SetIconSize(Value: TcxHintIconSize); +begin + if FIconSize <> Value then + begin + FIconSize := Value; + Changed; + end; +end; + +procedure TcxCustomHintStyle.SetIconType(Value: TcxHintIconType); +begin + if FIconType <> Value then + begin + FIconType := Value; + Changed; + end; +end; + +procedure TcxCustomHintStyle.SetIcon(Value: TIcon); +begin + if FIcon <> Value then + begin + FIcon.Assign(Value); + Changed; + end; +end; + +procedure TcxCustomHintStyle.SetRounded(Value: Boolean); +begin + if FRounded <> Value then + begin + FRounded := Value; + Changed; + end; +end; + +procedure TcxCustomHintStyle.SetRoundRadius(Value: Integer); +begin + if FRoundRadius <> Value then + begin + FRoundRadius := Value; + Changed; + end; +end; + +procedure TcxCustomHintStyle.SetStandard(Value: Boolean); +begin + if FStandard <> Value then + begin + FStandard := Value; + Changed; + end; +end; + +procedure TcxCustomHintStyle.IconChangeHandler(Sender: TObject); +begin + Changed; +end; + +{ TcxCustomHintStyleController } + +constructor TcxCustomHintStyleController.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FUpdateCount := 0; + FActive := True; + FHintShortPause := 50; + FHintPause := 500; + FHintHidePause :=2500; + FListeners := TList.Create; + FHintStyle := GetHintStyleClass.Create(Self, False); + FHintStyle.OnChanged := HintStyleChanged; + FHintWindow := GetHintWindowClass.Create(Self); + if FControllerList.Count = 0 then + FGlobal := True; + FControllerList.Add(Self); + if not (csDesigning in ComponentState) then + InitHintWindowClass; +end; + +destructor TcxCustomHintStyleController.Destroy; +var + I: Integer; +begin + FIsDestruction := True; + if not (csDesigning in ComponentState) then + UninitHintWindowClass; + FControllerList.Remove(Self); + for I := 0 to FListeners.Count - 1 do + TcxCustomHintStyle(FListeners[I]).ControllerFreeNotification(Self); + FreeAndNil(FHintStyle); + FreeAndNil(FListeners); + FreeAndNil(FHintWindow); + RestoreShowHintEvent; + inherited Destroy; +end; + +procedure TcxCustomHintStyleController.Assign(Source: TPersistent); +begin + if (Source is TcxCustomHintStyleController) then + begin + BeginUpdate; + try + with (Source as TcxCustomHintStyleController) do + begin + Self.OnHintStyleChanged := OnHintStyleChanged; + Self.OnShowHint := OnShowHint; + Self.OnShowHintEx := OnShowHintEx; + Self.HintShortPause := HintShortPause; + Self.HintPause := HintPause; + Self.HintHidePause := HintHidePause; + Self.HintStyle := HintStyle; + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +procedure TcxCustomHintStyleController.ShowHint(X, Y: Integer; ACaption, AHint: string); +var + R: TRect; +begin + SetHintedControl(FindVCLWindow(Point(X, Y))); + FHintWindow.FCaption := ACaption; + R := FHintWindow.CalcHintRect(Screen.Width, AHint, nil); + OffsetRect(R, X, Y); + FHintWindow.ActivateHint(R, AHint); +end; + +function TcxCustomHintStyleController.GetHintWidth(AHint: string): Integer; +var + R: TRect; +begin + R := FHintWindow.CalcHintRect(Screen.Width, AHint, nil); + Result := R.Right - R.Left; +end; + +function TcxCustomHintStyleController.GetHintHeight(AHint: string): Integer; +var + R: TRect; +begin + R := FHintWindow.CalcHintRect(Screen.Width, AHint, nil); + Result := R.Bottom - R.Top; +end; + +procedure TcxCustomHintStyleController.HideHint; +begin + SetHintedControl(nil); + if (FHintWindow <> nil) and FHintWindow.HandleAllocated and + IsWindowVisible(FHintWindow.Handle) then + ShowWindow(FHintWindow.Handle, SW_HIDE); +end; + +procedure TcxCustomHintStyleController.Loaded; +begin + inherited Loaded; + SetApplicationHintProperties; + Changed; + SaveShowHintEvent; +end; + +procedure TcxCustomHintStyleController.BeginUpdate; +begin + Inc(FUpdateCount); +end; + +procedure TcxCustomHintStyleController.EndUpdate; +begin + Dec(FUpdateCount); + if FUpdateCount = 0 then + SetApplicationHintProperties; +end; + +procedure TcxCustomHintStyleController.AddListener(AListener: TcxCustomHintStyle); +begin + if (AListener = nil) or (FListeners.IndexOf(AListener) >= 0) then + Exit; + FListeners.Add(AListener); +end; + +procedure TcxCustomHintStyleController.Changed; +var + I: Integer; +begin + if (HintStyle <> nil) and Assigned(FOnHintStyleChanged) then + FOnHintStyleChanged(Self, HintStyle); + if not IsDestruction then + for I := 0 to Listeners.Count - 1 do + DoHintStyleChanged(TcxCustomHintStyle(Listeners[I])); +end; + +procedure TcxCustomHintStyleController.DoHintStyleChanged(AStyle: TcxCustomHintStyle); +begin + AStyle.ControllerChangedNotification(Self); + if Assigned(FOnHintStyleChanged) then + FOnHintStyleChanged(Self, AStyle); +end; + +function TcxCustomHintStyleController.GetHintStyleClass: TcxHintStyleClass; +begin + Result := TcxCustomHintStyle; +end; + +function TcxCustomHintStyleController.GetHintWindowClass: TcxCustomHintWindowClass; +begin + Result := TcxCustomHintWindow; +end; + +procedure TcxCustomHintStyleController.InitHintWindowClass; +var + AShowHint: Boolean; +begin + AShowHint := Application.ShowHint; + Application.ShowHint := False; + FPreviousHintWindowClass := HintWindowClass; + HintWindowClass := GetHintWindowClass; + Application.ShowHint := AShowHint; +end; + +procedure TcxCustomHintStyleController.RemoveListener(AListener: TcxCustomHintStyle); +begin + if (AListener = nil) or (FListeners.IndexOf(AListener) < 0) then + Exit; + if not IsDestruction then + FListeners.Remove(AListener); +end; + +procedure TcxCustomHintStyleController.UninitHintWindowClass; +var + AShowHint: Boolean; +begin + if (FControllerList[FControllerList.Count - 1] = Self) and + (HintWindowClass = GetHintWindowClass) then + begin + AShowHint := Application.ShowHint; + Application.ShowHint := False; + HintWindowClass := FPreviousHintWindowClass; + Application.ShowHint := AShowHint; + end; +end; + +procedure TcxCustomHintStyleController.DoApplicationShowHint(var HintStr: string; + var CanShow: Boolean; var HintInfo: THintInfo); +begin + if Assigned(FSavedApplicationOnShowHint) then + FSavedApplicationOnShowHint(HintStr, CanShow, HintInfo); +end; + +procedure TcxCustomHintStyleController.DoShowHint(var HintStr: string; + var CanShow: Boolean; var HintInfo: THintInfo); +var + ACaption: string; +begin + if Assigned(FOnShowHint) then + FOnShowHint(Self, HintStr, CanShow, HintInfo); + ACaption := ''; + if Assigned(FOnShowHintEx) then + FOnShowHintEx(Self, ACaption, HintStr, CanShow, HintInfo); + FHintWindow.Caption := ACaption; + if CanShow then + DoApplicationShowHint(HintStr, CanShow, HintInfo); +end; + +function TcxCustomHintStyleController.IsGlobalStored: Boolean; +begin + Result := (FControllerList.Count > 1) or not FGlobal; +end; + +procedure TcxCustomHintStyleController.SetGlobal(Value: Boolean); + + procedure ResetGlobal; + var + I: Integer; + begin + for I := 0 to FControllerList.Count - 1 do + TcxCustomHintStyleController(FControllerList[I]).FGlobal := False; + end; + +begin + if FGlobal <> Value then + begin + if Value then + ResetGlobal; + FGlobal := Value; + end; +end; + +procedure TcxCustomHintStyleController.SetHintStyle(Value: TcxCustomHintStyle); +begin + FHintStyle.Assign(Value); +end; + +procedure TcxCustomHintStyleController.HintStyleChanged(Sender: TObject); +begin + Changed; +end; + +procedure TcxCustomHintStyleController.SetApplicationHintProperties; +begin + if not (csDesigning in ComponentState) then + begin + Application.HintShortPause := FHintShortPause; + Application.HintPause := FHintPause; + Application.HintHidePause := FHintHidePause; + end; +end; + +procedure TcxCustomHintStyleController.SetHintShortPause(Value: Integer); +begin + if FHintShortPause <> Value then + begin + FHintShortPause := Value; + if FUpdateCount = 0 then + SetApplicationHintProperties; + end; +end; + +procedure TcxCustomHintStyleController.SetHintPause(Value: Integer); +begin + if FHintPause <> Value then + begin + FHintPause := Value; + if FUpdateCount = 0 then + SetApplicationHintProperties; + end; +end; + +procedure TcxCustomHintStyleController.SetHintHidePause(Value: Integer); +begin + if FHintHidePause <> Value then + begin + FHintHidePause := Value; + if FUpdateCount = 0 then + SetApplicationHintProperties; + end; +end; + +procedure TcxCustomHintStyleController.SaveShowHintEvent; +begin + if not (csDesigning in ComponentState) and not FIsApplicationOnShowHintSaved then + begin + FSavedApplicationOnShowHint := Application.OnShowHint; + FIsApplicationOnShowHintSaved := True; + Application.OnShowHint := ShowHintHandler; + end; +end; + +procedure TcxCustomHintStyleController.RestoreShowHintEvent; +begin + if not (csDesigning in ComponentState) and (FControllerList.Count = 0) and + FIsApplicationOnShowHintSaved then + Application.OnShowHint := FSavedApplicationOnShowHint; +end; + +procedure TcxCustomHintStyleController.ShowHintHandler(var HintStr: string; + var CanShow: Boolean; var HintInfo: THintInfo); +var + AController: TcxCustomHintStyleController; +begin + SetHintedControl(HintInfo.HintControl); + AController := FindHintController; + if AController <> nil then + AController.DoShowHint(HintStr, CanShow, HintInfo) + else + DoApplicationShowHint(HintStr, CanShow, HintInfo); +end; + +{ TcxCustomHintWindow } + +constructor TcxCustomHintWindow.Create(AOwner: TComponent); +begin + inherited; + FCallOutSize := 15; + FCallOutPosition := cxbpNone; + FCalculatedCallOutPos := cxbpNone; + FCaption := ''; + Color := clInfoBk; + FHintColor := clInfoBk; + FBorderColor := clWindowFrame; + FRounded := False; + FRoundRadius := 11; + FIconType := cxhiQuestion; + FStandardHint := True; + FWordWrap := True; + FCaptionFont := TFont.Create; + FCaptionFont.Assign(Font); + FCaptionFont.Style := FCaptionFont.Style + [fsBold]; + FIcon := TIcon.Create; + + BorderStyle := bsSingle; +end; + +destructor TcxCustomHintWindow.Destroy; +begin + if Assigned(FIcon) then FreeAndNil(FIcon); + FCaptionFont.Free; + inherited; +end; + +procedure TcxCustomHintWindow.SetIcon(Value: TIcon); +begin + FIcon.Assign(Value); +end; + +function TcxCustomHintWindow.CalcHintRect(MaxWidth: Integer; const AHint: string; + AData: Pointer): TRect; +begin + CalculateController; + if not FStandardHint then + begin + FText := AHint; + inherited Caption := AHint; + CalculateIcon; + CalculateRects(FCaption, FText, MaxWidth); + Result := Rect(0, 0, FHintWndRect.Right, FHintWndRect.Bottom); + end else + begin + Canvas.Font.Assign(Screen.HintFont); + Result := inherited CalcHintRect(MaxWidth, AHint, AData); + end; +end; + +procedure TcxCustomHintWindow.ActivateHint(ARect: TRect; const AHint: string); +begin + if not StandardHint then + begin + Inc(ARect.Bottom, 4); + case FCalculatedCallOutPos of + cxbpLeftBottom: + OffsetRect(ARect, -1, - RectHeight(ARect) - 3); + cxbpLeftTop: + OffsetRect(ARect, 0, -(FCallOutSize * 2) - 6); + cxbpTopLeft: + OffsetRect(ARect, -FCallOutSize, 0); + cxbpTopRight: + OffsetRect(ARect, FCallOutSize - RectWidth(ARect), 0); + cxbpRightBottom: + OffsetRect(ARect, - RectWidth(ARect) + 3, - RectHeight(ARect) - 2); + cxbpRightTop: + OffsetRect(ARect, - RectWidth(ARect) + 1, -(FCallOutSize * 2) - 5); + cxbpBottomRight: + OffsetRect(ARect, - RectWidth(ARect) + FCallOutSize + 1, - RectHeight(ARect) - FCallOutSize - 1); + cxbpBottomLeft: + OffsetRect(ARect, - FCallOutSize - 1, - RectHeight(ARect) - FCallOutSize - 3); + end; + end; + + inherited; +end; + +procedure TcxCustomHintWindow.WMShowWindow(var Message: TWMShowWindow); +begin + inherited; + if not Message.Show then + SetHintedControl(nil); +end; + +procedure TcxCustomHintWindow.Paint; +var + ActualRgn: HRGN; + FIconDrawSize: Integer; + FIconDrawFlag: Integer; +begin + if not FStandardHint then + begin + Canvas.Brush.Color := FHintColor; + Canvas.FillRect(ClientRect); + Canvas.Pen.Color := FBorderColor; + Canvas.Pen.Style := psSolid; + Canvas.Brush.Color := FBorderColor; + Canvas.Brush.Style := bsSolid; + + ActualRgn := CreateRectRgnIndirect(Rect(0, 0, 0, 0)); + try + GetWindowRgn(Handle, ActualRgn); + OffsetRgn(ActualRgn, -1, -1); + FrameRgn(Canvas.Handle, ActualRgn, Canvas.Brush.Handle, 1, 1); + + Canvas.Brush.Color := FHintColor; + + if not FIcon.Empty then + begin + FIconDrawFlag := DI_NORMAL; + case IconSize of + cxisLarge: FIconDrawSize := 32; + cxisSmall: FIconDrawSize := 16; + else + FIconDrawSize := FIcon.Width; + end; + DrawIconEx(Canvas.Handle, FIconLeftMargin, FIconTopMargin, FIcon.Handle, + FIconDrawSize, FIconDrawSize, 0, 0, FIconDrawFlag); + end; + if FCaption <> '' then + begin + Canvas.Font.Assign(FCaptionFont); + DrawText(Canvas.Handle, PChar(FCaption), + Length(FCaption), FCaptionRect, + DT_WORDBREAK or DT_NOPREFIX or DT_VCENTER); + end; + Canvas.Font.Assign(Font); + DrawText(Canvas.Handle, PChar(FText), Length(FText), + FTextRect, DT_WORDBREAK or DT_NOPREFIX); + finally + DeleteObject(ActualRgn); + end; + end + else + begin + DisableRegion; + Canvas.Brush.Color := FHintColor; + Canvas.FillRect(ClientRect); +{$IFDEF DELPHI5} + Canvas.Font.Assign(Screen.HintFont); +{$ENDIF} + inherited Paint; + end; +end; + +procedure TcxCustomHintWindow.CalculateController; + + procedure ResetToStandardHint; + begin + FStandardHint := True; + FHintColor := Application.HintColor; + end; + +var + AController: TcxCustomHintStyleController; + AIHint: IcxHint; +begin + if (GetHintedControl <> nil) and Supports(GetHintedControl, IcxHint, AIHint) then + begin + LoadPropertiesFromHintInterface(AIHint); + Exit; + end; + AController := FindHintController; + if AController <> nil then + LoadPropertiesFromController(AController) + else + ResetToStandardHint; +end; + +function TcxCustomHintWindow.GetAnimate: TcxHintAnimate; +begin + Result := AnimationStyle; +end; + +procedure TcxCustomHintWindow.SetAnimate(AValue: TcxHintAnimate); +begin + AnimationStyle := AValue; +end; + +procedure TcxCustomHintWindow.LoadPropertiesFromController( + const AHintController: TcxCustomHintStyleController); +begin + Caption := AHintController.HintWindow.Caption; + LoadPropertiesFromHintStyle(AHintController.HintStyle); +end; + +procedure TcxCustomHintWindow.LoadPropertiesFromHintInterface(const AHintIntf: IcxHint); +var + FDefaultFont: TFont; +begin + FCaption := AHintIntf.GetHintCaption; + Animate := AHintIntf.GetAnimate; + AnimationDelay := AHintIntf.GetAnimationDelay; + FCallOutPosition := AHintIntf.GetCallOutPosition; + FBorderColor := AHintIntf.GetBorderColor; + FHintColor := AHintIntf.GetColor; + FIconSize := AHintIntf.GetIconSize; + FIconType := AHintIntf.GetIconType; + FRounded := AHintIntf.GetRounded; + FStandardHint := AHintIntf.GetStandard; + if FRounded = False then + FRoundRadius := 0 + else + FRoundRadius := AHintIntf.GetRoundRadius; + if Assigned(AHintIntf.GetHintIcon) then + FIcon.Assign(AHintIntf.GetHintIcon) + else + FreeAndNil(FIcon); + FDefaultFont := TFont.Create; + try + if Assigned(AHintIntf.GetHintFont) then + Font.Assign(AHintIntf.GetHintFont) + else + Font.Assign(FDefaultFont); + if Assigned(AHintIntf.GetHintCaptionFont) then + FCaptionFont.Assign(AHintIntf.GetHintCaptionFont) + else + FCaptionFont.Assign(FDefaultFont); + finally + FreeAndNil(FDefaultFont); + end; +end; + +procedure TcxCustomHintWindow.LoadPropertiesFromHintStyle( + const AHintStyle: TcxCustomHintStyle); +begin + Animate := AHintStyle.Animate; + AnimationDelay := AHintStyle.AnimationDelay; + FCallOutPosition := AHintStyle.CallOutPosition; + FBorderColor := AHintStyle.BorderColor; + FHintColor := AHintStyle.Color; + FIcon.Assign(AHintStyle.Icon); + FIconSize := AHintStyle.IconSize; + FIconType := AHintStyle.IconType; + FRounded := AHintStyle.Rounded; + FStandardHint := AHintStyle.Standard; + if FRounded = False then + FRoundRadius := 0 + else + FRoundRadius := AHintStyle.RoundRadius; + Font.Assign(AHintStyle.Font); + FCaptionFont.Assign(AHintStyle.CaptionFont); +end; + +procedure TcxCustomHintWindow.CalculateValues; + + function GetIconWidth: Integer; + var + FBitmap: TBitmap; + begin + FBitmap := TBitmap.Create; + try + FBitmap.Width := FIcon.Width; + FBitmap.Height := FIcon.Height; + DrawIconEx(FBitmap.Canvas.Handle, 0, 0, FIcon.Handle, + FIcon.Width, FIcon.Height, 0, 0, DI_NORMAL); + Result := FIcon.Width; + finally + FBitmap.Free; + end; + end; + +begin + FIndentDelta := 6; + if FRounded = False then + begin + FLeftRightMargint := FIndentDelta; + FTopBottomMargin := FIndentDelta; + end + else + begin + FLeftRightMargint := (FRoundRadius div 2) + 2; + FTopBottomMargin := (FRoundRadius div 2) + 2; + end; + if not FIcon.Empty then + begin + if FIconType <> cxhiCustom then + FIconWidth := FIcon.Width + else + FIconWidth := GetIconWidth; + FIconHeight := FIcon.Height; + case FIconSize of + cxisLarge: + begin + FIconHeight := 32; + FIconWidth := 32; + end; + cxisSmall: + begin + FIconHeight := 16; + FIconWidth := 16; + end; + end; + end + else + begin + FIconHeight := 0; + FIconWidth := 0; + end; + FIconLeftMargin := FLeftRightMargint; + FIconTopMargin := FLeftRightMargint; +end; + +procedure TcxCustomHintWindow.CalculateRects(const ACaption, AText: string; + const AMaxWidth: Integer); + + function IsCaptionEpty: Boolean; + begin + Result := ACaption = ''; + end; + + function GetIconHorzOffset: Integer; + begin + if FIconWidth > 0 then + Result := FIndentDelta + else + Result := 0; + end; + + function GetMaxCaptionWidth(AIsCaption: Boolean = True): Integer; + var + ADec: Integer; + begin + Result := AMaxWidth; + if Result <= 0 then + begin + Result := MaxInt; + Exit; + end; + ADec := GetIconHorzOffset + 2 * FLeftRightMargint + FIndentDelta; + if AIsCaption then + Inc(ADec, FIconWidth); + Dec(Result, ADec); + end; + + procedure GetCaptionBounds(var ARect: TRect; ACaption: string); + begin + DrawText(Canvas.Handle, PChar(ACaption), + Length(ACaption), ARect, DT_CALCRECT or DT_WORDBREAK or DT_NOPREFIX); + end; + + procedure OffsetRectWithIndents(var ARect: TRect; AIsCaption: Boolean = True); + var + AIconHorzOffset: Integer; + begin + AIconHorzOffset := GetIconHorzOffset; + if AIsCaption then + Inc(AIconHorzOffset, FIconWidth); + InflateRectEx(ARect, FLeftRightMargint + AIconHorzOffset, FTopBottomMargin, + FLeftRightMargint + AIconHorzOffset + FIndentDelta, FTopBottomMargin); + end; + + procedure VertOffsetTextRect(var ATextRect: TRect; const ACaptionBounds: TRect); + var + AVertOffset: Integer; + begin + if RectHeight(ACaptionBounds) > FIconHeight then + AVertOffset := RectHeight(ACaptionBounds) + FIndentDelta + else + AVertOffset := FIconHeight + FIndentDelta; + Inc(ATextRect.Top, AVertOffset); + Inc(ATextRect.Bottom, AVertOffset); + end; + + function CalcCallOutPosition(AHintWndRect: TRect): TRect; + begin + Result := cxEmptyRect; + FCalculatedCallOutPos := CalculateAutoCallOutPosition(AHintWndRect); + with Result do + case FCalculatedCallOutPos of + cxbpRightBottom, cxbpRightTop: Right := FCallOutSize; + cxbpBottomLeft, cxbpBottomRight: Bottom := FCallOutSize; + cxbpLeftTop, cxbpLeftBottom: + begin + Left := FCallOutSize; + Right := FCallOutSize; + FIconLeftMargin := FIconLeftMargin + FCallOutSize; + end; + cxbpTopLeft, cxbpTopRight: + begin + Top := FCallOutSize; + Bottom := FCallOutSize; + FIconTopMargin := FIconTopMargin + FCallOutSize; + end; + end; + end; + + procedure OffsetRectWithCallOutPosition(var ARect: TRect; + const ACalloutPosition: TRect); + begin + with ACalloutPosition do + InflateRectEx(ARect, Left, Top, Right, Bottom); + end; + + procedure CorrectRectHeightWithIcon(var ARect: TRect); + begin + if RectHeight(ARect) < FIconHeight then + ARect.Bottom := ARect.Top + FIconHeight; + end; + + procedure CalculateTextsBouds(var ACaptionBounds, ATextBounds: TRect); + begin + if ACaption = '' then + begin + ATextBounds := Rect(0, 0, GetMaxCaptionWidth, 1); + ACaptionBounds := Rect(0, 0, 0, 0); + end + else + begin + ACaptionBounds := Rect(0, 0, GetMaxCaptionWidth, 1); + Canvas.Font.Assign(FCaptionFont); + GetCaptionBounds(ACaptionBounds, ACaption); + ATextBounds := Rect(0, 0, GetMaxCaptionWidth(False), 1); + end; + Canvas.Font.Assign(Font); + if AText = '' then + ATextBounds := cxEmptyRect + else + GetCaptionBounds(ATextBounds, AText); + end; + + procedure OffsetRectsWithIndents(var ACaptionRect, ATextRect, + AHintWndRect: TRect); + var + ACallOutPosition: TRect; + begin + if ACaption <> '' then + begin + OffsetRectWithIndents(ACaptionRect); + OffsetRectWithIndents(ATextRect, False); + VertOffsetTextRect(ATextRect, ACaptionRect); + if ACaptionRect.Right > ATextRect.Right then + ATextRect.Right := ACaptionRect.Right + else + ACaptionRect.Right := ATextRect.Right; + end + else + begin + OffsetRectWithIndents(ATextRect); + CorrectRectHeightWithIcon(ATextRect); + end; + with ATextRect do + AHintWndRect := + Rect(0, 0, Right + FLeftRightMargint, Bottom + FTopBottomMargin); + ACallOutPosition := CalcCallOutPosition(AHintWndRect); + if FCaption <> '' then + OffsetRectWithCallOutPosition(ACaptionRect, ACallOutPosition); + OffsetRectWithCallOutPosition(ATextRect, ACallOutPosition); + OffsetRectWithCallOutPosition(AHintWndRect, ACallOutPosition); + end; + +begin + CalculateValues; + CalculateTextsBouds(FCaptionRect, FTextRect); + OffsetRectsWithIndents(FCaptionRect, FTextRect, FHintWndRect); +end; + +function TcxCustomHintWindow.CalculateAutoCallOutPosition(const ARect: TRect): TcxCallOutPosition; +var + FCursorPos: TPoint; +begin + if FCallOutPosition = cxbpAuto then + begin + Windows.GetCursorPos(FCursorPos); + if FCursorPos.Y < (Screen.Height div 2) then + begin + if FCursorPos.X - RectWidth(ARect) < 0 then + Result := cxbpTopLeft + else + Result := cxbpTopRight; + end + else + begin + if FCursorPos.X - RectWidth(ARect) < 0 then + Result := cxbpBottomLeft + else + Result := cxbpBottomRight; + end; + end + else + Result := FCallOutPosition; +end; + +procedure TcxCustomHintWindow.CalculateIcon; +type + TcxRealHintIconType = (IDIAPPLICATION, IDIINFORMATION, IDIWARNING, + IDIERROR, IDIQUESTION, IDIWINLOGO); +const + FRealIconTypes: array[TcxRealHintIconType] of MakeIntResource = ( + IDI_APPLICATION, IDI_INFORMATION, IDI_WARNING, IDI_ERROR, IDI_QUESTION, + IDI_WINLOGO); +begin + if FIconType = cxhiNone then + begin + if Assigned(FIcon) and not FIcon.Empty then + begin + FreeAndNil(FIcon); + FIcon := TIcon.Create; + end; + Exit; + end; + if FIconType = cxhiCustom then + Exit; + if FIconType = cxhiCurrentApplication then + FIcon.Assign(Application.Icon) + else + FIcon.Handle := LoadIcon(0, + FRealIconTypes[TcxRealHintIconType(Ord(FIconType) - 1)]); +end; + +procedure TcxCustomHintWindow.EnableRegion; +begin + CreateBalloonForm; +end; + +procedure TcxCustomHintWindow.CreateBalloonForm; +var + R: TRect; + CallOutRgn: HRGN; + CallOutTops: array[0..2] of TPoint; +begin + if (FCalculatedCallOutPos = cxbpNone) and (Rounded = False) then + begin + DisableRegion; + Exit; + end; + R := ClientRect; + + case FCalculatedCallOutPos of + cxbpLeftBottom: + begin + InflateRectEx(R, FCallOutSize, 0, 0, 0); + CallOutTops[0] := Point(R.Left, R.Bottom - FCallOutSize); + CallOutTops[1] := Point(R.Left, R.Bottom - FCallOutSize * 2); + CallOutTops[2] := Point(R.Left - FCallOutSize, R.Bottom - FCallOutSize); + end; + cxbpLeftTop: + begin + InflateRectEx(R, FCallOutSize, 0, 0, 0); + CallOutTops[0] := Point(R.Left, R.Top + FCallOutSize); + CallOutTops[1] := Point(R.Left, R.Top + FCallOutSize * 2); + CallOutTops[2] := Point(R.Left - FCallOutSize, R.Top + FCallOutSize); + end; + cxbpTopRight: + begin + InflateRectEx(R, 0, FCallOutSize, 0, 0); + CallOutTops[0] := Point(R.Right - FCallOutSize, R.Top); + CallOutTops[1] := Point(R.Right - FCallOutSize * 2, R.Top); + CallOutTops[2] := Point(R.Right - FCallOutSize, R.Top - FCallOutSize); + end; + cxbpTopLeft: + begin + InflateRectEx(R, 0, FCallOutSize, 0, 0); + CallOutTops[0] := Point(R.Left + FCallOutSize, R.Top); + CallOutTops[1] := Point(R.Left + FCallOutSize * 2, R.Top); + CallOutTops[2] := Point(R.Left + FCallOutSize, R.Top - FCallOutSize); + end; + cxbpRightBottom: + begin + InflateRectEx(R, 0, 0, -FCallOutSize, 0); + CallOutTops[0] := Point(R.Right - 1, R.Bottom - FCallOutSize); + CallOutTops[1] := Point(R.Right - 1, R.Bottom - FCallOutSize * 2); + CallOutTops[2] := Point(R.Right + FCallOutSize, R.Bottom - FCallOutSize); + end; + cxbpRightTop: + begin + InflateRectEx(R, 0, 0, -FCallOutSize, 0); + CallOutTops[0] := Point(R.Right - 1, R.Top + FCallOutSize); + CallOutTops[1] := Point(R.Right - 1, R.Top + FCallOutSize * 2); + CallOutTops[2] := Point(R.Right + FCallOutSize, R.Top + FCallOutSize); + end; + cxbpBottomRight: + begin + InflateRectEx(R, 0, 0, 0, -FCallOutSize); + CallOutTops[0] := Point(R.Right - FCallOutSize, R.Bottom - 1); + CallOutTops[1] := Point(R.Right - FCallOutSize * 2, R.Bottom - 1); + CallOutTops[2] := Point(R.Right - FCallOutSize, R.Bottom + FCallOutSize); + end; + cxbpBottomLeft: + begin + InflateRectEx(R, 0, 0, 0, -FCallOutSize); + CallOutTops[0] := Point(R.Left + FCallOutSize, R.Bottom - 1); + CallOutTops[1] := Point(R.Left + FCallOutSize * 2, R.Bottom - 1); + CallOutTops[2] := Point(R.Left + FCallOutSize, R.Bottom + FCallOutSize); + end; + end; + + Rgn := CreateRoundRectRgn(R.Left, R.Top, R.Right, R.Bottom, FRoundRadius, FRoundRadius); + CallOutRgn := 0; + if FCalculatedCallOutPos <> cxbpNone then + begin + CallOutRgn := CreatePolygonRgn(CallOutTops, 3, WINDING); + CombineRgn(Rgn, Rgn, CallOutRgn, RGN_OR ); + end; + OffsetRgn(Rgn, 1, 1); + SetWindowRgn(Handle, Rgn, True); + if CallOutRgn <> 0 then + DeleteObject(CallOutRgn); +end; + +initialization +{$IFNDEF DELPHI6} + UserHandle := GetModuleHandle('USER32'); + if UserHandle <> 0 then + @AnimateWindowProc := GetProcAddress(UserHandle, 'AnimateWindow'); +{$ENDIF} + FControllerList := TList.Create; + FHintedControlController := TcxHintedControlController.Create(nil); + +finalization + FreeAndNil(FHintedControlController); + if FControllerList.Count <> 0 then + raise EcxEditError.Create('HintStyleControllerList.Count <> 0'); + FreeAndNil(FControllerList); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxHintEditor.dfm b/official/x.35/ExpressEditors Library 5/Sources/cxHintEditor.dfm new file mode 100644 index 00000000..6fa55de5 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxHintEditor.dfm @@ -0,0 +1,586 @@ +object cxHintStyleEditor: TcxHintStyleEditor + Left = 195 + Top = 125 + BorderStyle = bsDialog + ClientHeight = 440 + ClientWidth = 576 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + ShowHint = True + OnActivate = FormActivate + OnCreate = FormCreate + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object lblHintColour: TLabel + Left = 8 + Top = 412 + Width = 46 + Height = 13 + Caption = 'Hint Color' + end + object cxBtnOk: TcxButton + Left = 415 + Top = 408 + Width = 75 + Height = 25 + Hint = 'Accept you changes and return to the Grep Demo' + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 9 + end + object cxBtnCancel: TcxButton + Left = 495 + Top = 408 + Width = 75 + Height = 25 + Hint = 'Discard your changes and return to the grep demo' + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 10 + end + object cxCbStandard: TcxCheckBox + Left = 304 + Top = 408 + Width = 105 + Height = 21 + Hint = 'Check to display hints in the standard Windows way' + Properties.DisplayUnchecked = 'False' + Properties.Caption = 'Standard Hints' + TabOrder = 7 + OnClick = cxCbStandardClick + end + object cxGbHintFont: TcxGroupBox + Left = 8 + Top = 8 + Width = 185 + Height = 185 + Alignment = alTopLeft + Caption = ' Hint Font ' + TabOrder = 0 + object Label1: TLabel + Left = 12 + Top = 80 + Width = 23 + Height = 13 + Caption = 'Style' + end + object Label2: TLabel + Left = 124 + Top = 80 + Width = 20 + Height = 13 + Caption = 'Size' + end + object Label3: TLabel + Left = 12 + Top = 40 + Width = 24 + Height = 13 + Caption = 'Color' + end + object cxFnHint: TcxFontNameComboBox + Left = 12 + Top = 16 + Width = 161 + Height = 21 + Hint = 'Font for the hint windows' + Properties.FontPreview.Visible = False + Properties.OnChange = cxFnHintPropertiesChange + TabOrder = 0 + OnClick = cxFnHintClick + end + object cxClbHintFontStyles: TcxCheckListBox + Left = 12 + Top = 96 + Width = 105 + Height = 81 + Hint = 'Font Style for Hints' + Columns = 0 + EditValue = 0 + Items = < + item + Tag = 0 + Text = 'Bold' + end + item + Tag = 0 + Text = 'Italics' + end + item + Tag = 0 + Text = 'Underline' + end + item + Tag = 0 + Text = 'Strike Thro' + end> + ParentColor = False + ScrollWidth = 0 + TabOrder = 2 + TabWidth = 0 + OnClickCheck = cxClbHintFontStylesClickCheck + end + object cxLbHfSize: TcxListBox + Left = 124 + Top = 96 + Width = 49 + Height = 81 + Hint = 'Font Size for Hints' + ExtendedSelect = False + ItemHeight = 13 + ParentColor = False + TabOrder = 3 + OnClick = cxLbHfSizeClick + end + object cxCcbHintFontColour: TcxColorComboBox + Left = 12 + Top = 56 + Width = 161 + Height = 21 + Properties.DefaultDescription = 'Color not selected' + Properties.Items = <> + Properties.PrepareInfo = '' + TabOrder = 1 + OnClick = cxCcbHintFontColourClick + end + end + object cxgbHintCapFont: TcxGroupBox + Left = 200 + Top = 8 + Width = 185 + Height = 185 + Alignment = alTopLeft + Caption = ' Hint Caption Font ' + TabOrder = 1 + object Label4: TLabel + Left = 12 + Top = 80 + Width = 23 + Height = 13 + Caption = 'Style' + end + object Label5: TLabel + Left = 124 + Top = 80 + Width = 20 + Height = 13 + Caption = 'Size' + end + object Label6: TLabel + Left = 12 + Top = 40 + Width = 24 + Height = 13 + Caption = 'Color' + end + object cxFnHinCap: TcxFontNameComboBox + Left = 12 + Top = 16 + Width = 161 + Height = 21 + Hint = 'Font for the hint windows' + Properties.FontPreview.Visible = False + Properties.OnChange = cxFnHinCapPropertiesChange + TabOrder = 0 + OnClick = cxFnHinCapClick + end + object cxClbHintCapFontStyles: TcxCheckListBox + Tag = 1 + Left = 12 + Top = 96 + Width = 105 + Height = 81 + Hint = 'Font Style for Hint Captions' + Columns = 0 + EditValue = 0 + Items = < + item + Tag = 0 + Text = 'Bold' + end + item + Tag = 0 + Text = 'Italics' + end + item + Tag = 0 + Text = 'Underline' + end + item + Tag = 0 + Text = 'Strike Thro' + end> + ParentColor = False + ScrollWidth = 0 + TabOrder = 2 + TabWidth = 0 + OnClickCheck = cxClbHintFontStylesClickCheck + end + object cxLbHcfSize: TcxListBox + Left = 124 + Top = 96 + Width = 49 + Height = 81 + Hint = 'Font Size for Hint Caption' + ItemHeight = 13 + ParentColor = False + TabOrder = 3 + OnClick = cxLbHcfSizeClick + end + object cxCcbHintCapColor: TcxColorComboBox + Left = 12 + Top = 56 + Width = 161 + Height = 21 + Properties.DefaultDescription = 'Color not selected' + Properties.Items = <> + Properties.PrepareInfo = '' + TabOrder = 1 + OnClick = cxCcbHintCapColorClick + end + end + object cxGbHintShape: TcxGroupBox + Left = 392 + Top = 8 + Width = 177 + Height = 89 + Alignment = alTopLeft + Caption = ' Shape ' + ParentFont = False + TabOrder = 2 + object Label7: TLabel + Left = 8 + Top = 14 + Width = 72 + Height = 13 + Caption = 'Callout Position' + end + object Label8: TLabel + Left = 8 + Top = 64 + Width = 68 + Height = 13 + Caption = 'Round Radius' + end + object cxCbHintCalloutPos: TcxComboBox + Left = 8 + Top = 32 + Width = 161 + Height = 21 + Hint = 'The '#39'Callout'#39' position' + Properties.DropDownListStyle = lsFixedList + Properties.Items.Strings = ( + 'None' + 'Auto' + 'Left Bottom' + 'Left Top' + 'Top Left' + 'Top Right' + 'Right Bottom' + 'Right Top' + 'Bottom Right' + 'Bottom Left') + TabOrder = 0 + OnClick = cxCbHintCalloutPosClick + end + object cxcbHintRounded: TcxCheckBox + Left = 96 + Top = 10 + Width = 75 + Height = 21 + Hint = 'Rounded corners on the hint windows' + ParentBackground = False + Properties.DisplayUnchecked = 'False' + Properties.OnChange = cxcbHintRoundedPropertiesChange + Properties.Caption = 'Rounded' + TabOrder = 1 + end + object cxSeHintRadius: TcxSpinEdit + Left = 88 + Top = 60 + Width = 81 + Height = 21 + Hint = 'Radius of the rounded corners if enabled' + Properties.MaxValue = 100 + Properties.MinValue = 5 + Properties.SpinButtons.ShowFastButtons = True + Properties.OnChange = cxSeHintRadiusPropertiesChange + TabOrder = 2 + Value = 11 + end + end + object cxGbHintIcons: TcxGroupBox + Left = 8 + Top = 200 + Width = 185 + Height = 97 + Alignment = alTopLeft + Caption = ' Icons ' + TabOrder = 4 + object Label11: TLabel + Left = 8 + Top = 16 + Width = 48 + Height = 13 + Caption = 'Icon Type' + end + object cxCbHintIconType: TcxComboBox + Left = 8 + Top = 32 + Width = 169 + Height = 21 + Hint = 'The Icon type that will be displayed in the hint window' + ParentFont = False + Properties.DropDownListStyle = lsFixedList + Properties.Items.Strings = ( + 'None' + 'Application' + 'Information' + 'Warning' + 'Error' + 'Question' + 'WinLogo' + 'CurrentApplication') + TabOrder = 0 + OnClick = cxCbHintIconTypeClick + end + object cxRbHIDef: TcxRadioButton + Left = 8 + Top = 64 + Width = 57 + Height = 17 + Hint = 'Default Icon Size' + Caption = 'Default' + TabOrder = 1 + OnClick = cxRbHIDefClick + ParentBackground = False + end + object cxRbHILarge: TcxRadioButton + Tag = 1 + Left = 72 + Top = 64 + Width = 49 + Height = 17 + Hint = 'Large Icon Size' + Caption = 'Large' + TabOrder = 2 + OnClick = cxRbHIDefClick + ParentBackground = False + end + object cxRbHISmall: TcxRadioButton + Tag = 2 + Left = 128 + Top = 64 + Width = 49 + Height = 17 + Hint = 'Small Icon Size' + Caption = 'Small' + TabOrder = 3 + OnClick = cxRbHIDefClick + ParentBackground = False + end + end + object cxGbHintPause: TcxGroupBox + Left = 8 + Top = 304 + Width = 185 + Height = 97 + Alignment = alTopLeft + Caption = ' Timings ' + TabOrder = 5 + object Label18: TLabel + Left = 8 + Top = 24 + Width = 77 + Height = 13 + Caption = 'Hint Hide Pause' + end + object Label19: TLabel + Left = 8 + Top = 48 + Width = 52 + Height = 13 + Caption = 'Hint Pause' + end + object Label20: TLabel + Left = 8 + Top = 72 + Width = 80 + Height = 13 + Caption = 'Hint Short Pause' + end + object cxSeHintHidePause: TcxSpinEdit + Left = 96 + Top = 20 + Width = 81 + Height = 21 + Hint = 'The animation delay' + Properties.Increment = 100 + Properties.LargeIncrement = 500 + Properties.MaxValue = 10000 + Properties.MinValue = 500 + Properties.SpinButtons.ShowFastButtons = True + Properties.OnChange = cxSeHintHidePausePropertiesChange + TabOrder = 0 + Value = 2500 + end + object cxSeHintPause: TcxSpinEdit + Left = 96 + Top = 44 + Width = 81 + Height = 21 + Hint = 'The animation delay' + Properties.Increment = 10 + Properties.LargeIncrement = 100 + Properties.MaxValue = 1000 + Properties.MinValue = 50 + Properties.SpinButtons.ShowFastButtons = True + Properties.OnChange = cxSeHintPausePropertiesChange + TabOrder = 1 + Value = 500 + end + object cxSeShortHintPause: TcxSpinEdit + Left = 96 + Top = 68 + Width = 81 + Height = 21 + Hint = 'The animation delay' + Properties.Increment = 5 + Properties.MaxValue = 1000 + Properties.MinValue = 10 + Properties.SpinButtons.ShowFastButtons = True + Properties.OnChange = cxSeHintDelayPropertiesChange + Properties.OnEditValueChanged = cxSeShortHintPausePropertiesEditValueChanged + TabOrder = 2 + Value = 50 + end + end + object cxCcbHintColour: TcxColorComboBox + Left = 72 + Top = 408 + Width = 225 + Height = 21 + Hint = 'Background Color for the hint windows' + Properties.AllowSelectColor = True + Properties.DefaultDescription = 'Color not selected' + Properties.ImmediatePost = True + Properties.OnEditValueChanged = cxCcbHintColourPropertiesEditValueChanged + Properties.Items = <> + Properties.PrepareInfo = '' + TabOrder = 6 + end + object cxGbHintAnimation: TcxGroupBox + Left = 392 + Top = 104 + Width = 177 + Height = 89 + Alignment = alTopLeft + Caption = ' Animation ' + TabOrder = 3 + object Label9: TLabel + Left = 8 + Top = 16 + Width = 72 + Height = 13 + Caption = 'Animation Style' + end + object Label10: TLabel + Left = 8 + Top = 64 + Width = 30 + Height = 13 + Caption = 'Delay ' + end + object cxCbHintAniStyle: TcxComboBox + Left = 8 + Top = 32 + Width = 161 + Height = 21 + Hint = 'The animation style used to display hints' + Properties.DropDownListStyle = lsFixedList + Properties.Items.Strings = ( + 'Slide From Left' + 'Slide From Right' + 'Slide Downward' + 'Slide Upward' + 'Slide From Center' + 'Hide' + 'Activate' + 'Fade In' + 'Auto' + 'None') + Properties.OnChange = cxCbHintAniStylePropertiesChange + TabOrder = 0 + end + object cxSeHintDelay: TcxSpinEdit + Left = 88 + Top = 60 + Width = 81 + Height = 21 + Hint = 'The animation delay' + Properties.MaxValue = 1000 + Properties.MinValue = 50 + Properties.SpinButtons.ShowFastButtons = True + Properties.OnChange = cxSeHintDelayPropertiesChange + TabOrder = 1 + Value = 100 + end + end + object cxGbPreview: TcxGroupBox + Left = 200 + Top = 200 + Width = 369 + Height = 201 + Alignment = alTopLeft + Caption = ' Preview ' + TabOrder = 8 + object pnlPreview: TPanel + Left = 2 + Top = 16 + Width = 365 + Height = 183 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + end + end + object cxHsc: TcxHintStyleController + Global = False + HintStyle.CaptionFont.Charset = DEFAULT_CHARSET + HintStyle.CaptionFont.Color = clWindowText + HintStyle.CaptionFont.Height = -13 + HintStyle.CaptionFont.Name = 'MS Sans Serif' + HintStyle.CaptionFont.Style = [fsBold] + HintStyle.Font.Charset = DEFAULT_CHARSET + HintStyle.Font.Color = clWindowText + HintStyle.Font.Height = -11 + HintStyle.Font.Name = 'MS Sans Serif' + HintStyle.Font.Style = [] + HintStyle.RoundRadius = 15 + HintPause = 700 + Left = 216 + Top = 216 + end + object cxEditStyleController1: TcxEditStyleController + Style.LookAndFeel.Kind = lfFlat + Style.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.Kind = lfFlat + StyleDisabled.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.Kind = lfFlat + StyleFocused.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.Kind = lfFlat + StyleHot.LookAndFeel.NativeStyle = True + Left = 216 + Top = 248 + end +end diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxHintEditor.pas b/official/x.35/ExpressEditors Library 5/Sources/cxHintEditor.pas new file mode 100644 index 00000000..737e75b5 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxHintEditor.pas @@ -0,0 +1,452 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxHintEditor; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Classes, ComCtrls, Controls, Dialogs, ExtCtrls, Forms, Graphics, + Messages, StdCtrls, SysUtils, cxButtons, cxCheckBox, cxCheckListBox, + cxColorComboBox, cxContainer, cxControls, cxDropDownEdit, cxEdit, + cxExtEditConsts, cxFontNameComboBox, cxGroupBox, cxHint, cxLabel, cxListBox, + cxListView, cxLookAndFeelPainters, cxLookandFeels, cxMaskEdit, cxMemo, + cxRadioGroup, cxSpinButton, cxSpinEdit, cxSplitter, cxTextEdit, cxTrackBar; + +type + TcxHintStyleEditor = class(TForm) + cxBtnOk: TcxButton; + cxBtnCancel: TcxButton; + cxCbStandard: TcxCheckBox; + cxGbHintFont: TcxGroupBox; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + cxFnHint: TcxFontNameComboBox; + cxClbHintFontStyles: TcxCheckListBox; + cxLbHfSize: TcxListBox; + cxCcbHintFontColour: TcxColorComboBox; + cxgbHintCapFont: TcxGroupBox; + Label4: TLabel; + Label5: TLabel; + Label6: TLabel; + cxFnHinCap: TcxFontNameComboBox; + cxClbHintCapFontStyles: TcxCheckListBox; + cxLbHcfSize: TcxListBox; + cxCcbHintCapColor: TcxColorComboBox; + cxGbHintShape: TcxGroupBox; + Label7: TLabel; + Label8: TLabel; + cxCbHintCalloutPos: TcxComboBox; + cxcbHintRounded: TcxCheckBox; + cxSeHintRadius: TcxSpinEdit; + cxGbHintIcons: TcxGroupBox; + Label11: TLabel; + cxCbHintIconType: TcxComboBox; + cxRbHIDef: TcxRadioButton; + cxRbHILarge: TcxRadioButton; + cxRbHISmall: TcxRadioButton; + cxGbHintPause: TcxGroupBox; + Label18: TLabel; + Label19: TLabel; + Label20: TLabel; + cxSeHintHidePause: TcxSpinEdit; + cxSeHintPause: TcxSpinEdit; + cxSeShortHintPause: TcxSpinEdit; + lblHintColour: TLabel; + cxCcbHintColour: TcxColorComboBox; + cxGbHintAnimation: TcxGroupBox; + Label9: TLabel; + Label10: TLabel; + cxCbHintAniStyle: TcxComboBox; + cxSeHintDelay: TcxSpinEdit; + cxGbPreview: TcxGroupBox; + cxHsc: TcxHintStyleController; + pnlPreview: TPanel; + cxEditStyleController1: TcxEditStyleController; + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure cxFnHintClick(Sender: TObject); + procedure cxCbHintCalloutPosClick(Sender: TObject); + procedure cxSeHintRadiusPropertiesChange(Sender: TObject); + procedure cxcbHintRoundedPropertiesChange(Sender: TObject); + procedure cxCbHintAniStylePropertiesChange(Sender: TObject); + procedure cxSeHintDelayPropertiesChange(Sender: TObject); + procedure cxCbHintIconTypeClick(Sender: TObject); + procedure cxRbHIDefClick(Sender: TObject); + procedure cxSeHintHidePausePropertiesChange(Sender: TObject); + procedure cxSeHintPausePropertiesChange(Sender: TObject); + procedure cxSeShortHintPausePropertiesEditValueChanged(Sender: TObject); + procedure cxClbHintFontStylesClickCheck(Sender: TObject; + AIndex: Integer; APrevState, ANewState: TcxCheckBoxState); + procedure cxCcbHintFontColourClick(Sender: TObject); + procedure cxCcbHintCapColorClick(Sender: TObject); + procedure cxFnHintPropertiesChange(Sender: TObject); + procedure cxLbHfSizeClick(Sender: TObject); + procedure cxLbHcfSizeClick(Sender: TObject); + procedure cxFnHinCapPropertiesChange(Sender: TObject); + procedure cxCbStandardClick(Sender: TObject); + procedure cxFnHinCapClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure FormActivate(Sender: TObject); + procedure cxCcbHintColourPropertiesEditValueChanged(Sender: TObject); + private + fViewerFontSizes: TStringList; + fHintHorz: Integer; + fHintVert: Integer; + fFormLoaded: Boolean; + procedure SetHsc(const Value: TcxHintStyleController); + procedure RefreshHint; + procedure WMActivate(var Message: TWMActivate); message WM_ACTIVATE; + procedure WMMove(var Message: TWMMove); message WM_MOVE; + public + procedure SetHintController(aDest: TcxHintStyleController); + procedure LoadHintCtrls; + property HintController: TCxHintStyleController read cxHsc write SetHsc; + end; + +var + cxHintStyleEditor: TcxHintStyleEditor; + +procedure ShowHintStyleEditor(AHintStyleController: TcxHintStyleController); + +implementation + +{$R *.dfm} + +resourcestring + SHintCaption = 'Example'; + SHintText = 'Preview Hint'; + +procedure ShowHintStyleEditor(AHintStyleController: TcxHintStyleController); +var + AHintStyleEditor: TcxHintStyleEditor; + AOwnerCaption: string; + APrevApplicationOnShowHint: TShowHintEvent; +begin + APrevApplicationOnShowHint := Application.OnShowHint; + AHintStyleEditor := TcxHintStyleEditor.Create(Application); + with AHintStyleEditor do + try + HintController := AHintStyleController; + if AHintStyleController.Owner <> nil then + AOwnerCaption := AHintStyleController.Owner.Name + '.' + else + AOwnerCaption := ''; + Caption := Format('%s%s - Hint Editor',[AOwnerCaption, AHintStyleController.Name]); + + if ShowModal = mrOK then + begin + AHintStyleController.Assign(cxHsc); + SetDesignerModified(AHintStyleController); + end; + + HintController.HideHint; + finally + Application.OnShowHint := APrevApplicationOnShowHint; + Free; + end; +end; + +procedure TcxHintStyleEditor.FormCreate(Sender: TObject); +begin + fViewerFontSizes := TStringList.Create; + SetControlLookAndFeel(Self, cxEditStyleController1.Style.LookAndFeel); +end; + +procedure TcxHintStyleEditor.FormDestroy(Sender: TObject); +begin + cxHsc.HideHint; + fViewerFontSizes.Free; +end; + +procedure TcxHintStyleEditor.cxCbStandardClick(Sender: TObject); +begin + cxHsc.HintStyle.Standard := cxCbStandard.Checked; + RefreshHint; +end; + +procedure TcxHintStyleEditor.cxFnHintClick(Sender: TObject); +begin + cxHsc.HintStyle.Font.Name := cxFnHint.FontName; + RefreshHint; +end; + +procedure TcxHintStyleEditor.cxFnHinCapClick(Sender: TObject); +begin + cxHsc.HintStyle.CaptionFont.Name := cxFnHinCap.FontName; + RefreshHint; +end; + +procedure TcxHintStyleEditor.cxCbHintCalloutPosClick(Sender: TObject); +begin + cxHsc.HintStyle.CallOutPosition := TcxCallOutPosition(cxCbHintCalloutPos.ItemIndex); + RefreshHint; +end; + +procedure TcxHintStyleEditor.cxSeHintRadiusPropertiesChange(Sender: TObject); +begin + cxHsc.HintStyle.RoundRadius := cxSeHintRadius.Value; + RefreshHint; +end; + +procedure TcxHintStyleEditor.cxcbHintRoundedPropertiesChange(Sender: TObject); +begin + cxHsc.HintStyle.Rounded := cxcbHintRounded.Checked; + RefreshHint; +end; + +procedure TcxHintStyleEditor.cxCbHintAniStylePropertiesChange(Sender: TObject); +begin + cxHsc.HintStyle.Animate := TcxHintAnimate(cxCbHintAniStyle.ItemIndex); + RefreshHint; +end; + +procedure TcxHintStyleEditor.cxSeHintDelayPropertiesChange(Sender: TObject); +begin + cxHsc.HintStyle.AnimationDelay := Integer(cxSeHintDelay.Value); + RefreshHint; +end; + +procedure TcxHintStyleEditor.cxCbHintIconTypeClick(Sender: TObject); +begin + cxHsc.HintStyle.IconType := TcxHintIconType(cxCbHintIconType.ItemIndex); + RefreshHint; +end; + +procedure TcxHintStyleEditor.cxRbHIDefClick(Sender: TObject); +begin + cxHsc.HintStyle.IconSize := TcxHintIconSize(Integer(TcxRadioButton(Sender).Tag)); + RefreshHint; +end; + +procedure TcxHintStyleEditor.SetHsc(const Value: TCxHintStyleController); +begin + cxHsc.Assign(Value); +end; + +procedure TcxHintStyleEditor.SetHintController(aDest: TCxHintStyleController); +begin + aDest.HintStyle.Assign(cxHsc.HintStyle); + aDest.HintShortPause := cxHsc.HintShortPause; + aDest.HintPause := cxHsc.HintPause; + aDest.HintHidePause := cxHsc.HintHidePause; +end; + +procedure TcxHintStyleEditor.LoadHintCtrls; + + function StyleToEditValue(aFontStyle : TFontStyles) : Integer; + begin + Result := 0; + if fsBold in aFontStyle then + Result := 1; + if fsItalic in aFontStyle then + Inc(Result,2); + if fsUnderline in aFontStyle then + Inc(Result,4); + if fsStrikeOut in aFontStyle then + Inc(Result,8); + end; + +begin + cxCbStandard.Checked := cxHsc.HintStyle.Standard; + cxFnHint.FontName := cxHsc.HintStyle.Font.Name; + while not cxFnHint.Properties.LoadFontComplete do + Application.ProcessMessages; + cxCcbHintFontColour.ColorValue := cxHsc.HintStyle.Font.Color; + cxClbHintFontStyles.EditValue := StyleToEditValue(cxHsc.HintStyle.Font.Style); + cxFnHinCap.FontName := cxHsc.HintStyle.CaptionFont.Name; + while not cxFnHinCap.Properties.LoadFontComplete do + Application.ProcessMessages; + cxCcbHintCapColor.ColorValue := cxHsc.HintStyle.CaptionFont.Color; + cxClbHintCapFontStyles.EditValue := StyleToEditValue(cxHsc.HintStyle.CaptionFont.Style); + cxCcbHintColour.ColorValue := cxHsc.HintStyle.Color; + cxCbHintRounded.Checked := cxHsc.HintStyle.Rounded; + cxCbHintCalloutPos.ItemIndex := Ord(cxHsc.HintStyle.CallOutPosition); + cxSeHintRadius.Value := cxHsc.HintStyle.RoundRadius; + cxCbHintAniStyle.ItemIndex := Ord(cxHsc.HintStyle.Animate); + cxSeHintDelay.Value := Variant(cxHsc.HintStyle.AnimationDelay); + cxCbHintIconType.ItemIndex := Ord(cxHsc.HintStyle.IconType); + cxSeHintHidePause.Value := cxHsc.HintHidePause; + cxSeHintPause.Value := cxHsc.HintPause; + cxSeShortHintPause.Value := cxHsc.HintShortPause; + case Ord(cxHsc.HintStyle.IconSize) of + 0: cxRbHiDef.Checked := True; + 1: cxRbHiLarge.Checked := True; + 2: cxRbHiSmall.Checked := True; + end; + cxLbhfSize.ItemIndex := cxLbhFSize.Items.IndexOf(IntToStr(cxHsc.HintStyle.Font.Size)); + cxLbhcfSize.ItemIndex := cxLbhcFSize.Items.IndexOf(IntToStr(cxHsc.HintStyle.CaptionFont.Size)); +End; + +procedure TcxHintStyleEditor.cxSeHintHidePausePropertiesChange( + Sender: TObject); +begin + cxHsc.HintHidePause := cxSeHintHidePause.Value; + RefreshHint; +end; + +procedure TcxHintStyleEditor.cxSeHintPausePropertiesChange( + Sender: TObject); +begin + cxHsc.HintPause := cxSeHintPause.Value; + RefreshHint; +end; + +procedure TcxHintStyleEditor.cxSeShortHintPausePropertiesEditValueChanged( + Sender: TObject); +begin + cxHsc.HintShortPause := cxSeShortHintPause.Value; + RefreshHint; +end; + +procedure TcxHintStyleEditor.cxCcbHintFontColourClick(Sender: TObject); +begin + cxHsc.HintStyle.Font.Color := cxCcbHintFontColour.ColorValue; + RefreshHint; +end; + +procedure TcxHintStyleEditor.cxCcbHintCapColorClick(Sender: TObject); +begin + cxHsc.HintStyle.CaptionFont.Color := cxCcbHintCapColor.ColorValue; + RefreshHint; +end; + +procedure TcxHintStyleEditor.cxLbHfSizeClick(Sender: TObject); +begin + with cxLbHfSize do + cxHsc.HintStyle.Font.Size := StrToInt(Items[ItemIndex]); + RefreshHint; +end; + +procedure TcxHintStyleEditor.cxLbHcfSizeClick(Sender: TObject); +begin + with cxLbHcfSize do + cxHsc.HintStyle.CaptionFont.Size := StrToInt(Items[ItemIndex]); + RefreshHint; +end; + +procedure TcxHintStyleEditor.cxFnHinCapPropertiesChange( + Sender: TObject); +begin + GetFontSizes(cxFnHinCap.FontName,cxLbHcfSize.Items); +end; + +procedure TcxHintStyleEditor.cxFnHintPropertiesChange(Sender: TObject); +begin + GetFontSizes(cxFnHint.FontName,cxLbHfSize.Items); +end; + +procedure TcxHintStyleEditor.RefreshHint; +begin + if HandleAllocated and IsWindowVisible(Handle) then + begin + cxHsc.HideHint; + cxHsc.ShowHint(fHintHorz, fHintVert, SHintCaption, SHintText); + end; +end; + +procedure TcxHintStyleEditor.WMActivate(var Message: TWMActivate); +begin + if Message.Active = WA_INACTIVE then + cxHsc.HideHint + else + RefreshHint; +end; + +procedure TcxHintStyleEditor.WMMove(var Message: TWMMove); +begin + inherited; + if fFormLoaded then + begin + fHintHorz := pnlPreview.ClientOrigin.X + (pnlPreview.Width div 2 - cxHsc.GetHintWidth(SHintText) div 2); + fHintVert := pnlPreview.ClientOrigin.Y + (pnlPreview.Height div 2 - cxHsc.GetHintHeight(SHintText) div 2); + RefreshHint; + end; +end; + +procedure TcxHintStyleEditor.FormShow(Sender: TObject); +begin + fHintHorz := pnlPreview.ClientOrigin.X + (pnlPreview.Width div 2 - cxHsc.GetHintWidth(SHintText) div 2); + fHintVert := pnlPreview.ClientOrigin.Y + (pnlPreview.Height div 2 - cxHsc.GetHintHeight(SHintText) div 2); + + fFormLoaded := True; + LoadHintCtrls; +end; + +procedure TcxHintStyleEditor.FormActivate(Sender: TObject); +begin + RefreshHint; +end; + +procedure TcxHintStyleEditor.cxClbHintFontStylesClickCheck(Sender: TObject; + AIndex: Integer; APrevState, ANewState: TcxCheckBoxState); + + function ChangeFontStyles(AFontStyles: TFontStyles): TFontStyles; + const + AFontStylesByIndex: array [0..3] of TFontStyle = + (fsBold, fsItalic, fsUnderline, fsStrikeOut); + begin + Result := AFontStyles; + case ANewState of + cbsUnchecked: + Exclude(Result, AFontStylesByIndex[AIndex]); + cbsChecked: + Include(Result, AFontStylesByIndex[AIndex]); + end; + end; + +begin + if TcxCheckListBox(Sender).Tag = 0 then + cxHsc.HintStyle.Font.Style := ChangeFontStyles(cxHsc.HintStyle.Font.Style) + else + cxHsc.HintStyle.CaptionFont.Style := + ChangeFontStyles(cxHsc.HintStyle.CaptionFont.Style); + RefreshHint; +end; + +procedure TcxHintStyleEditor.cxCcbHintColourPropertiesEditValueChanged( + Sender: TObject); +begin + cxHsc.HintStyle.Color := cxCcbHintColour.ColorValue; + RefreshHint; +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxHyperLinkEdit.pas b/official/x.35/ExpressEditors Library 5/Sources/cxHyperLinkEdit.pas new file mode 100644 index 00000000..b3531a36 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxHyperLinkEdit.pas @@ -0,0 +1,601 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxHyperLinkEdit; + +{$I cxVer.inc} + +interface + +uses + Messages, + Windows, +{$IFDEF DELPHI6} + Types, +{$ENDIF} + SysUtils, Graphics, Classes, Controls, Menus, cxGraphics, cxContainer, + cxControls, cxEdit, cxTextEdit, cxEditConsts, cxFilterControlUtils; + +const + cxHyperLinkEditDefaultLinkColor = clBlue; + +type + { TcxHyperLinkEditViewInfo } + + TcxCustomHyperLinkEdit = class; + + TcxHyperLinkEditViewInfo = class(TcxCustomTextEditViewInfo) + public + function IsHotTrack: Boolean; override; + function IsHotTrack(P: TPoint): Boolean; override; + procedure PrepareCanvasFont(ACanvas: TCanvas); override; + end; + + { TcxCustomHyperLinkEditProperties } + + TcxHyperLinkEditUsePrefix = (upAlways, upOnlyOnExecute, upNever); + + TcxCustomHyperLinkEditProperties = class(TcxCustomTextEditProperties) + private + FSingleClick: Boolean; + FLinkColor: TColor; + FOnStartClick: TNotifyEvent; + FPrefix: string; + FStartKey: TShortCut; + FUsePrefix: TcxHyperLinkEditUsePrefix; + function GetAutoComplete: Boolean; + function GetPrefixStored: Boolean; + procedure ReadPrefix(Reader: TReader); + procedure SetAutoComplete(Value: Boolean); + procedure SetLinkColor(const Value: TColor); + procedure SetSingleClick(Value: Boolean); + procedure WritePrefix(Writer: TWriter); + protected + procedure DefineProperties(AFiler: TFiler); override; + function AddPrefixTo(AStr: string): string; virtual; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + class function GetContainerClass: TcxContainerClass; override; + class function GetStyleClass: TcxCustomEditStyleClass; override; + function GetSupportedOperations: TcxEditSupportedOperations; override; + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + procedure ValidateDisplayValue(var ADisplayValue: TcxEditValue; + var AErrorText: TCaption; var Error: Boolean; AEdit: TcxCustomEdit); override; + // !!! + property AutoComplete: Boolean read GetAutoComplete write SetAutoComplete + stored False; // deprecated + property AutoSelect default False; + property LinkColor: TColor read FLinkColor write SetLinkColor + default cxHyperLinkEditDefaultLinkColor; + property Prefix: string read FPrefix write FPrefix stored False; + property SingleClick: Boolean read FSingleClick write SetSingleClick + default False; + property StartKey: TShortCut read FStartKey write FStartKey + default VK_RETURN + scCtrl; + property UsePrefix: TcxHyperLinkEditUsePrefix read FUsePrefix + write FUsePrefix default upAlways; + property OnStartClick: TNotifyEvent read FOnStartClick write FOnStartClick; + end; + + { TcxHyperLinkEditProperties } + + TcxHyperLinkEditProperties = class(TcxCustomHyperLinkEditProperties) + published + property Alignment; + property AssignedValues; + property AutoComplete; // deprecated + property AutoSelect; + property ClearKey; + property ImeMode; + property ImeName; + property IncrementalSearch; + property LinkColor; + property LookupItems; + property LookupItemsSorted; + property Prefix; + property ReadOnly; + property StartKey; + property SingleClick; + property UseLeftAlignmentOnEditing; + property UsePrefix; + property ValidateOnEnter; + property OnChange; + property OnEditValueChanged; + property OnStartClick; + property OnValidate; + end; + + { TcxHyperLinkStyle } + + TcxHyperLinkStyle = class(TcxEditStyle) + protected + function GetTextColor: TColor; override; + function GetTextStyle: TFontStyles; override; + end; + + { TcxCustomHyperLinkEdit } + + TcxCustomHyperLinkEdit = class(TcxCustomTextEdit) + private + FSaveCursor: TCursor; + function GetActiveProperties: TcxCustomHyperLinkEditProperties; + function GetProperties: TcxCustomHyperLinkEditProperties; + function GetStyle: TcxHyperLinkStyle; + procedure InternalSetCursor(ACursor: TCursor); + procedure SetProperties(const Value: TcxCustomHyperLinkEditProperties); + procedure SetStyle(Value: TcxHyperLinkStyle); + protected + function DoOnStartClick: Boolean; + procedure DoStart; virtual; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseEnter(AControl: TControl); override; + procedure MouseLeave(AControl: TControl); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure PropertiesChanged(Sender: TObject); override; + public + procedure ActivateByMouse(Shift: TShiftState; X, Y: Integer; + var AEditData: TcxCustomEditData); override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + procedure SelectAll; override; + property ActiveProperties: TcxCustomHyperLinkEditProperties read GetActiveProperties; + property Properties: TcxCustomHyperLinkEditProperties read GetProperties + write SetProperties; + property Style: TcxHyperLinkStyle read GetStyle write SetStyle; + end; + + { TcxHyperLinkEdit } + + TcxHyperLinkEdit = class(TcxCustomHyperLinkEdit) + private + function GetActiveProperties: TcxHyperLinkEditProperties; + function GetProperties: TcxHyperLinkEditProperties; + procedure SetProperties(Value: TcxHyperLinkEditProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxHyperLinkEditProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxHyperLinkEditProperties read GetProperties write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Text; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnEditing; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property BiDiMode; + property ParentBiDiMode; + property OnEndDock; + property OnStartDock; + end; + + { TcxFilterHyperLinkEditHelper } + + TcxFilterHyperLinkEditHelper = class(TcxFilterTextEditHelper) + public + class function GetFilterEditClass: TcxCustomEditClass; override; + end; + +implementation + +uses + ShellAPI, +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Forms, cxVariants, cxClasses, cxLibraryConsts; + +{ TcxHyperLinkEditViewInfo } + +function TcxHyperLinkEditViewInfo.IsHotTrack: Boolean; +begin + Result := inherited IsHotTrack or + TcxCustomHyperLinkEditProperties(EditProperties).SingleClick; +end; + +function TcxHyperLinkEditViewInfo.IsHotTrack(P: TPoint): Boolean; +begin + Result := IsHotTrack; +end; + +procedure TcxHyperLinkEditViewInfo.PrepareCanvasFont(ACanvas: TCanvas); +begin + inherited PrepareCanvasFont(ACanvas); + if Edit = nil then + begin + ACanvas.Font.Style := ACanvas.Font.Style + [fsUnderline]; + if IsSelected then + ACanvas.Font.Color := TextColor + else + ACanvas.Font.Color := TcxCustomHyperLinkEditProperties(EditProperties).LinkColor; + end; +end; + +{ TcxCustomHyperLinkEditProperties } + +constructor TcxCustomHyperLinkEditProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + AutoSelect := False; + FLinkColor := clBlue; + FPrefix := cxGetResourceString(@scxSHyperLinkPrefix); + FSingleClick := False; + FStartKey := VK_RETURN + scCtrl; + FUsePrefix := upAlways; +end; + +function TcxCustomHyperLinkEditProperties.GetAutoComplete: Boolean; +begin + Result := not (UsePrefix = upNever); +end; + +function TcxCustomHyperLinkEditProperties.GetPrefixStored: Boolean; +begin + Result := FPrefix <> cxGetResourceString(@scxSHyperLinkPrefix); +end; + +procedure TcxCustomHyperLinkEditProperties.ReadPrefix(Reader: TReader); +begin + Prefix := Reader.ReadString; +end; + +procedure TcxCustomHyperLinkEditProperties.SetAutoComplete(Value: Boolean); +begin + if Value then + UsePrefix := upAlways + else + UsePrefix := upNever; +end; + +procedure TcxCustomHyperLinkEditProperties.SetLinkColor( + const Value: TColor); +begin + if FLinkColor <> Value then + begin + FLinkColor := Value; + Changed; + end; +end; + +procedure TcxCustomHyperLinkEditProperties.SetSingleClick(Value: Boolean); +begin + if Value <> FSingleClick then + begin + FSingleClick := Value; + Changed; + end; +end; + +procedure TcxCustomHyperLinkEditProperties.WritePrefix(Writer: TWriter); +begin + Writer.WriteString(Prefix); +end; + +procedure TcxCustomHyperLinkEditProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomHyperLinkEditProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with TcxCustomHyperLinkEditProperties(Source) do + begin + Self.LinkColor := LinkColor; + Self.Prefix := Prefix; + Self.SingleClick := SingleClick; + Self.StartKey := StartKey; + Self.UsePrefix := UsePrefix; + Self.OnStartClick := OnStartClick; + end; + finally + EndUpdate + end + end + else + inherited Assign(Source); +end; + +class function TcxCustomHyperLinkEditProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxHyperLinkEdit; +end; + +class function TcxCustomHyperLinkEditProperties.GetStyleClass: TcxCustomEditStyleClass; +begin + Result := TcxHyperLinkStyle; +end; + +function TcxCustomHyperLinkEditProperties.GetSupportedOperations: TcxEditSupportedOperations; +begin + Result := inherited GetSupportedOperations; + if SingleClick then + Include(Result, esoAlwaysHotTrack); +end; + +class function TcxCustomHyperLinkEditProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxHyperLinkEditViewInfo; +end; + +procedure TcxCustomHyperLinkEditProperties.ValidateDisplayValue( + var ADisplayValue: TcxEditValue; var AErrorText: TCaption; var Error: Boolean; + AEdit: TcxCustomEdit); +begin + if UsePrefix = upAlways then + ADisplayValue := AddPrefixTo(VarToStr(ADisplayValue)); + inherited ValidateDisplayValue(ADisplayValue, AErrorText, Error, AEdit); +end; + +procedure TcxCustomHyperLinkEditProperties.DefineProperties(AFiler: TFiler); +begin + inherited DefineProperties(AFiler); + AFiler.DefineProperty('Prefix', ReadPrefix, WritePrefix, GetPrefixStored); +end; + +function TcxCustomHyperLinkEditProperties.AddPrefixTo(AStr: string): string; +begin + Result := Trim(AStr); + if (Prefix <> '') and (Result <> '') and (Pos(Prefix, Result) <> 1) then + Result := Trim(Prefix + Result); +end; + +{ TcxHyperLinkStyle } + +function TcxHyperLinkStyle.GetTextColor: TColor; +begin + if DirectAccessMode then + Result := inherited GetTextColor + else + begin + if (Container = nil) or (TcxCustomHyperLinkEdit(Container).ActiveProperties = nil) then + Result := cxHyperLinkEditDefaultLinkColor + else + Result := TcxCustomHyperLinkEdit(Container).ActiveProperties.LinkColor; + end; +end; + +function TcxHyperLinkStyle.GetTextStyle: TFontStyles; +begin + Result := inherited GetTextStyle + [fsUnderline]; +end; + +{ TcxCustomHyperLinkEdit } + +function TcxCustomHyperLinkEdit.DoOnStartClick: Boolean; +begin + Result := Assigned(Properties.OnStartClick) or + Assigned(ActiveProperties.OnStartClick); + with Properties do + if Assigned(OnStartClick) then + OnStartClick(Self); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnStartClick) then + OnStartClick(Self); +end; + +procedure TcxCustomHyperLinkEdit.DoStart; +var + AText: string; +begin + if not DoOnStartClick then + begin + AText := Trim(DisplayValue); + if ActiveProperties.UsePrefix <> upNever then + AText := ActiveProperties.AddPrefixTo(AText); + if AText <> '' then + ShellExecute(0, 'OPEN', PChar(AText), + nil, nil, SW_SHOWMAXIMIZED); + end; +end; + +function TcxCustomHyperLinkEdit.GetActiveProperties: TcxCustomHyperLinkEditProperties; +begin + Result := TcxCustomHyperLinkEditProperties(InternalGetActiveProperties); +end; + +function TcxCustomHyperLinkEdit.GetProperties: TcxCustomHyperLinkEditProperties; +begin + Result := TcxCustomHyperLinkEditProperties(FProperties); +end; + +function TcxCustomHyperLinkEdit.GetStyle: TcxHyperLinkStyle; +begin + Result := TcxHyperLinkStyle(FStyles.Style); +end; + +procedure TcxCustomHyperLinkEdit.InternalSetCursor(ACursor: TCursor); +begin + InnerTextEdit.Control.Cursor := ACursor; + Cursor := ACursor; + SetCursor(Screen.Cursors[ACursor]); +end; + +procedure TcxCustomHyperLinkEdit.SetProperties( + const Value: TcxCustomHyperLinkEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomHyperLinkEdit.SetStyle(Value: TcxHyperLinkStyle); +begin + FStyles.Style := Value; +end; + +procedure TcxCustomHyperLinkEdit.KeyDown(var Key: Word; + Shift: TShiftState); +begin + if (ShortCut(Key, Shift) <> 0) and (ActiveProperties.StartKey = ShortCut(Key, Shift)) then + begin + DoStart; + Key := 0; + end + else + inherited KeyDown(Key, Shift); +end; + +procedure TcxCustomHyperLinkEdit.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + if (Button = mbLeft) and PtInRect(ViewInfo.ClientRect, Point(X, Y)) and + (not ActiveProperties.SingleClick and (ssDouble in Shift)) then + DoStart; +end; + +procedure TcxCustomHyperLinkEdit.MouseEnter(AControl: TControl); +begin + inherited MouseEnter(AControl); + if ActiveProperties.SingleClick and (Cursor = crDefault) then + begin + FSaveCursor := Cursor; + InternalSetCursor(crcxHandPoint); + end; +end; + +procedure TcxCustomHyperLinkEdit.MouseLeave(AControl: TControl); +begin + inherited MouseLeave(AControl); + if ActiveProperties.SingleClick then + InternalSetCursor(FSaveCursor); +end; + +procedure TcxCustomHyperLinkEdit.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + if (Button = mbLeft) and PtInRect(ViewInfo.ClientRect, Point(X, Y)) and + ActiveProperties.SingleClick and (SelLength = 0) then + DoStart; +end; + +procedure TcxCustomHyperLinkEdit.PropertiesChanged(Sender: TObject); +begin + inherited PropertiesChanged(Sender); + ContainerStyleChanged(Style); +end; + +class function TcxCustomHyperLinkEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomHyperLinkEditProperties; +end; + +procedure TcxCustomHyperLinkEdit.ActivateByMouse(Shift: TShiftState; X, Y: Integer; + var AEditData: TcxCustomEditData); +begin + if IsInplace and ActiveProperties.SingleClick and (Cursor = crDefault) then + begin + FSaveCursor := Cursor; + InternalSetCursor(crcxHandPoint); + end; + inherited; +end; + +procedure TcxCustomHyperLinkEdit.SelectAll; +begin + if not (IsInplace and ActiveProperties.SingleClick) then + inherited SelectAll; +end; + +{ TcxHyperLinkEdit } + +class function TcxHyperLinkEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxHyperLinkEditProperties; +end; + +function TcxHyperLinkEdit.GetActiveProperties: TcxHyperLinkEditProperties; +begin + Result := TcxHyperLinkEditProperties(InternalGetActiveProperties); +end; + +function TcxHyperLinkEdit.GetProperties: TcxHyperLinkEditProperties; +begin + Result := TcxHyperLinkEditProperties(FProperties); +end; + +procedure TcxHyperLinkEdit.SetProperties(Value: TcxHyperLinkEditProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxFilterHyperLinkEditHelper } + +class function TcxFilterHyperLinkEditHelper.GetFilterEditClass: TcxCustomEditClass; +begin + Result := TcxHyperLinkEdit; +end; + +initialization + GetRegisteredEditProperties.Register(TcxHyperLinkEditProperties, scxSEditRepositoryHyperLinkItem); + FilterEditsController.Register(TcxHyperLinkEditProperties, TcxFilterHyperLinkEditHelper); + +finalization + FilterEditsController.Unregister(TcxHyperLinkEditProperties, TcxFilterHyperLinkEditHelper); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxImage.pas b/official/x.35/ExpressEditors Library 5/Sources/cxImage.pas new file mode 100644 index 00000000..d5c276d0 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxImage.pas @@ -0,0 +1,1766 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxImage; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, Variants, +{$ENDIF} + Windows, Messages, ExtDlgs, SysUtils, Classes, Clipbrd, Controls, Dialogs, + ExtCtrls, Forms, Graphics, Menus, StdCtrls, cxClasses, cxContainer, + cxControls, cxDataUtils, cxEdit, cxEditConsts, cxGraphics, cxLookAndFeels; + +const + cxImageDefaultInplaceHeight = 15; + +type + TcxCustomImage = class; + TcxPopupMenuItem = (pmiCut, pmiCopy, pmiPaste, pmiDelete, pmiLoad, pmiSave, + pmiCustom); + TcxPopupMenuItemClick = procedure(Sender: TObject; + MenuItem: TcxPopupMenuItem) of object; + TcxPopupMenuItems = set of TcxPopupMenuItem; + + { TcxPopupMenuLayout } + + TcxPopupMenuLayout = class(TPersistent) + private + FCustomMenuItemCaption: string; + FCustomMenuItemGlyph: TBitmap; + FImage: TcxCustomImage; + FMenuItems: TcxPopupMenuItems; + function GetCustomMenuItemGlyph: TBitmap; virtual; + procedure SetCustomMenuItemGlyph(Value: TBitmap); + public + constructor Create(AImage: TcxCustomImage); + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + published + property MenuItems: TcxPopupMenuItems read FMenuItems write FMenuItems default + [pmiCut, pmiCopy, pmiPaste, pmiDelete, pmiLoad, pmiSave]; + property CustomMenuItemCaption: string + read FCustomMenuItemCaption write FCustomMenuItemCaption; + property CustomMenuItemGlyph: TBitmap + read GetCustomMenuItemGlyph write SetCustomMenuItemGlyph; + end; + + { TcxImageViewInfo } + + TcxImageViewInfo = class(TcxCustomEditViewInfo) + private + FFreePicture: Boolean; + FTempBitmap: TBitmap; + procedure DrawTransparentBackground(ACanvas: TcxCanvas; const R: TRect); + protected + procedure InternalPaint(ACanvas: TcxCanvas); override; + function IsRepaintOnStateChangingNeeded: Boolean; override; + public + ShowFocusRect: Boolean; + TopLeft: TPoint; + Caption: string; + Center: Boolean; + Picture: TPicture; + Proportional: Boolean; + Stretch: Boolean; + destructor Destroy; override; + end; + + { TcxImageViewData } + + TcxImageViewData = class(TcxCustomEditViewData) + public + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); override; + procedure EditValueToDrawValue(ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + AViewInfo: TcxCustomEditViewInfo); override; + function GetEditContentSize(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; + const AEditSizeProperties: TcxEditSizeProperties): TSize; override; + end; + + { TcxCustomImageProperties } + + TcxImageAssignPictureEvent = procedure(Sender: TObject; + const Picture: TPicture) of object; + TcxImageGraphicClassEvent = procedure(AItem: TObject; ARecordIndex: Integer; + APastingFromClipboard: Boolean; var AGraphicClass: TGraphicClass) of object; + TcxImageEditGraphicClassEvent = procedure(Sender: TObject; + APastingFromClipboard: Boolean; var AGraphicClass: TGraphicClass) of object; + + TcxImageTransparency = (gtDefault, gtOpaque, gtTransparent); + + TcxCustomImageProperties = class(TcxCustomEditProperties) + private + FCaption: string; + FCenter: Boolean; + FCustomFilter: string; + FDefaultHeight: Integer; + FGraphicClass: TGraphicClass; + FGraphicTransparency: TcxImageTransparency; + FPopupMenuLayout: TcxPopupMenuLayout; + FProportional: Boolean; + FShowFocusRect: Boolean; + FStretch: Boolean; + FOnAssignPicture: TcxImageAssignPictureEvent; + FOnCustomClick: TNotifyEvent; + FOnGetGraphicClass: TcxImageGraphicClassEvent; + function GetGraphicClassName: string; + function IsGraphicClassNameStored: Boolean; + procedure ReadIsGraphicClassNameEmpty(Reader: TReader); + procedure SetCaption(const Value: string); + procedure SetCenter(Value: Boolean); + procedure SetGraphicClass(const Value: TGraphicClass); + procedure SetGraphicClassName(const Value: string); + procedure SetGraphicTransparency(Value: TcxImageTransparency); + procedure SetPopupMenuLayout(Value: TcxPopupMenuLayout); + procedure SetProportional(AValue: Boolean); + procedure SetShowFocusRect(Value: Boolean); + procedure SetStretch(Value: Boolean); + procedure WriteIsGraphicClassNameEmpty(Writer: TWriter); + protected + function CanValidate: Boolean; override; + procedure DefineProperties(Filer: TFiler); override; + function IsDesigning: Boolean; + function GetDefaultGraphicClass: TGraphicClass; virtual; + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + property DefaultHeight: Integer read FDefaultHeight write FDefaultHeight + default cxImageDefaultInplaceHeight; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + class function GetContainerClass: TcxContainerClass; override; + function GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; override; + function GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; override; + function GetGraphicClass(AItem: TObject; + ARecordIndex: Integer; + APastingFromClipboard: Boolean = False): TGraphicClass; virtual; + function GetSpecialFeatures: TcxEditSpecialFeatures; override; + function GetSupportedOperations: TcxEditSupportedOperations; override; + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + function IsResetEditClass: Boolean; override; + procedure ValidateDisplayValue(var DisplayValue: TcxEditValue; var ErrorText: TCaption; + var Error: Boolean; AEdit: TcxCustomEdit); override; + property GraphicClass: TGraphicClass read FGraphicClass write SetGraphicClass; + // !!! + property Caption: string read FCaption write SetCaption; + property Center: Boolean read FCenter write SetCenter default True; + property CustomFilter: string read FCustomFilter write FCustomFilter; + property GraphicClassName: string read GetGraphicClassName + write SetGraphicClassName stored IsGraphicClassNameStored; + property GraphicTransparency: TcxImageTransparency + read FGraphicTransparency write SetGraphicTransparency default gtDefault; + property PopupMenuLayout: TcxPopupMenuLayout + read FPopupMenuLayout write SetPopupMenuLayout; + property Proportional: Boolean read FProportional write SetProportional default True; + property ShowFocusRect: Boolean read FShowFocusRect write SetShowFocusRect default True; + property Stretch: Boolean read FStretch write SetStretch default False; + property OnAssignPicture: TcxImageAssignPictureEvent + read FOnAssignPicture write FOnAssignPicture; + property OnCustomClick: TNotifyEvent read FOnCustomClick + write FOnCustomClick; + property OnGetGraphicClass: TcxImageGraphicClassEvent read FOnGetGraphicClass + write FOnGetGraphicClass; + end; + + { TcxImageProperties } + + TcxImageProperties = class(TcxCustomImageProperties) + published + property AssignedValues; + property Caption; + property Center; + property ClearKey; + property CustomFilter; + property GraphicClassName; + property GraphicTransparency; + property ImmediatePost; + property PopupMenuLayout; + property Proportional; + property ReadOnly; + property ShowFocusRect; + property Stretch; + property OnAssignPicture; + property OnChange; + property OnCustomClick; + property OnEditValueChanged; + property OnGetGraphicClass; + end; + + { TcxCustomImage } + + TcxCustomImage = class(TcxCustomEdit) + private + FClipboardFormat: Word; + FEditPopupMenu: TPopupMenu; + FInternalChanging: Boolean; + FIsDialogShowed: Boolean; + FPicture: TPicture; + FTransparent: Boolean; + FOnGetGraphicClass: TcxImageEditGraphicClassEvent; + procedure EditAndClear; + procedure EditPopupMenuClick(Sender: TObject); + {$IFDEF CBUILDER10} + function GetPicture: TPicture; + {$ENDIF} + function GetProperties: TcxCustomImageProperties; + function GetActiveProperties: TcxCustomImageProperties; + procedure MenuItemClick(Sender: TObject; MenuItem: TcxPopupMenuItem); + procedure PictureChanged(Sender: TObject); + procedure PreparePopup; + procedure ResetImage; + procedure SetPicture(Value: TPicture); + procedure SetProperties(const Value: TcxCustomImageProperties); + procedure SetTransparent(AValue: Boolean); + procedure SynchronizeImage; + protected + function CanAutoSize: Boolean; override; + function CanAutoWidth: Boolean; override; + procedure DoContextPopup( MousePos: TPoint; + var Handled: Boolean); override; + procedure Initialize; override; + procedure InitScrollBarsParameters; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + function NeedsInvokeAfterKeyDown(AKey: Word; AShift: TShiftState): Boolean; override; + function NeedsScrollBars: Boolean; override; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); override; + function GetEditValue: TcxEditValue; override; + procedure InternalSetEditValue(const Value: TcxEditValue; + AIsValueValid: Boolean); override; + procedure PropertiesChanged(Sender: TObject); override; + procedure UpdateScrollBars; override; + + // virtual methods + function CanPasteFromClipboard: Boolean; virtual; + procedure CustomClick; virtual; + procedure DoOnAssignPicture; + function GetGraphicClass(APastingFromClipboard: Boolean = False): TGraphicClass; virtual; + property AutoSize default False; + property ParentColor default False; + property OnGetGraphicClass: TcxImageEditGraphicClassEvent + read FOnGetGraphicClass write FOnGetGraphicClass; + public + destructor Destroy; override; + procedure CopyToClipboard; override; + procedure CutToClipboard; override; + function Focused: Boolean; override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + procedure LoadFromFile; + procedure PasteFromClipboard; override; + procedure SaveToFile; + property ActiveProperties: TcxCustomImageProperties read GetActiveProperties; + property ClipboardFormat: Word + read FClipboardFormat write FClipboardFormat; + property Picture: TPicture read {$IFDEF CBUILDER10}GetPicture{$ELSE}FPicture{$ENDIF} + write SetPicture; + property Properties: TcxCustomImageProperties read GetProperties + write SetProperties; + property Transparent: Boolean read FTransparent write SetTransparent default False; + end; + + { TcxImage } + + TcxImage = class(TcxCustomImage) + private + function GetActiveProperties: TcxImageProperties; + function GetProperties: TcxImageProperties; + procedure SetProperties(Value: TcxImageProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxImageProperties read GetActiveProperties; + published + property Align; + property Anchors; + property AutoSize; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ParentColor; + property ParentShowHint; + property Picture; + property PopupMenu; + property Properties: TcxImageProperties read GetProperties + write SetProperties; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Transparent; + property Visible; + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnGetGraphicClass; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +function IsPictureEmpty(APicture: TPicture): Boolean; +procedure LoadPicture(APicture: TPicture; AGraphicClass: TGraphicClass; + const AValue: Variant); +procedure SavePicture(APicture: TPicture; var AValue: AnsiString); + +function GetGraphicClassByName(const AClassName: string): TGraphicClass; +function GetRegisteredGraphicClasses: TList; +procedure RegisterGraphicClass(AGraphicClass: TGraphicClass); +procedure UnRegisterGraphicClass(AGraphicClass: TGraphicClass); + +implementation + +uses +{$IFNDEF DELPHI6} + cxVariants, +{$ENDIF} +{$IFDEF USEJPEGIMAGE} + Jpeg, +{$ENDIF} + dxGDIPlusApi, dxGDIPlusClasses, + Math, ImgList, cxEditUtils; + +type + {$IFNDEF DELPHI6} + TDummyGraphic = class(TGraphic); + TDummyGraphicClass = class of TDummyGraphic; + {$ENDIF} + TMemoryStreamAccess = class(TMemoryStream); + {$IFDEF USEJPEGIMAGE} + TJPEGImageAccess = class(TJPEGImage); + {$ENDIF} + +var + cxGraphicPopupMenuImages: TImageList; + cxRegisteredGraphicClasses: TList; + +function GetGraphicClassByName(const AClassName: string): TGraphicClass; +var + I: Integer; +begin + Result := nil; + for i := 0 to GetRegisteredGraphicClasses.Count - 1 do + if InternalCompareString(AClassName, TClass(GetRegisteredGraphicClasses[I]).ClassName, False) then + begin + Result := TGraphicClass(GetRegisteredGraphicClasses[I]); + Break; + end; +end; + +function GetRegisteredGraphicClasses: TList; +begin + if cxRegisteredGraphicClasses = nil then + begin + cxRegisteredGraphicClasses := TList.Create; + RegisterGraphicClass(TBitmap); + RegisterGraphicClass(TIcon); + RegisterGraphicClass(TMetaFile); + if GetClass(TdxPNGImage.ClassName) <> nil then + RegisterGraphicClass(TdxPNGImage); + {$IFDEF USEJPEGIMAGE} + RegisterGraphicClass(TJpegImage); + {$ENDIF} + end; + Result := cxRegisteredGraphicClasses +end; + +procedure RegisterGraphicClass(AGraphicClass: TGraphicClass); +begin + if cxRegisteredGraphicClasses.IndexOf(TObject(AGraphicClass)) = -1 then + cxRegisteredGraphicClasses.Add(TObject(AGraphicClass)); +end; + +procedure UnRegisterGraphicClass(AGraphicClass: TGraphicClass); +var + I: Integer; +begin + I := cxRegisteredGraphicClasses.IndexOf(TObject(AGraphicClass)); + if I <> -1 then + cxRegisteredGraphicClasses.Delete(I); +end; + +procedure CalcStretchRect(R: TRect; W, H: Integer; out CalcRect: TRect); +var + W1, H1: Integer; +begin + if IsRectEmpty(R) then + begin + CalcRect := R; + Exit; + end; + CalcRect.TopLeft := R.TopLeft; + W1 := R.Right - R.Left; + H1 := R.Bottom - R.Top; + if W / H > W1 / H1 then + begin + CalcRect.Right := R.Right; + CalcRect.Bottom := CalcRect.Top + (W1 * H div W); + end + else + begin + CalcRect.Bottom := R.Bottom; + CalcRect.Right := CalcRect.Left + (H1 * W div H); + end; +end; + +function IsPictureEmpty(APicture: TPicture): Boolean; +begin + Result := not Assigned(APicture.Graphic) or APicture.Graphic.Empty; +end; + +procedure LoadPicture(APicture: TPicture; AGraphicClass: TGraphicClass; + const AValue: Variant); +{ Paradox graphic BLOB header - see DB.pas} +type + TGraphicHeader = record + Count: Word; { Fixed at 1 } + HType: Word; { Fixed at $0100 } + Size: Longint; { Size not including header } + end; +var + AGraphic: TGraphic; + AHeader: TGraphicHeader; + ASize: Longint; + AStream: TMemoryStream; +begin + if VarType(AValue) = varString then // Field.Value -> stored as string + begin + AStream := TMemoryStream.Create; + try + ASize := Length(AnsiString(AValue)); + if ASize >= SizeOf(AHeader) then + begin + TMemoryStreamAccess(AStream).SetPointer(@VarToStr(AValue)[1], ASize); + AStream.Position := 0; + AStream.Read(AHeader, SizeOf(AHeader)); + if (AHeader.Count <> 1) or (AHeader.HType <> $0100) or + (AHeader.Size <> ASize - SizeOf(AHeader)) then + AStream.Position := 0; + end; + if AStream.Size > 0 then + try + if AGraphicClass = nil then + APicture.Bitmap.LoadFromStream(AStream) + else + begin + AGraphic := {$IFNDEF DELPHI6}TDummyGraphicClass{$ENDIF}(AGraphicClass).Create; + try + AGraphic.LoadFromStream(AStream); + APicture.Graphic := AGraphic; + finally + AGraphic.Free; + end; + end; + except + APicture.Assign(nil); + end + else + APicture.Assign(nil); + finally + AStream.Free; + end; + end + else + APicture.Assign(nil); +end; + +procedure SavePicture(APicture: TPicture; var AValue: AnsiString); +var + AStream: TMemoryStream; +begin + if not Assigned(APicture) or IsPictureEmpty(APicture) then + AValue := '' + else + begin + AStream := TMemoryStream.Create; + try + APicture.Graphic.SaveToStream(AStream); + AStream.Position := 0; + SetLength(AValue, AStream.Size); + AStream.ReadBuffer(AValue[1], AStream.Size); + finally + AStream.Free; + end; + end; +end; + +{ TcxPopupMenuLayout } + +constructor TcxPopupMenuLayout.Create(AImage: TcxCustomImage); +begin + inherited Create; + FImage := AImage; + FMenuItems := [pmiCut, pmiCopy, pmiPaste, pmiDelete, pmiLoad, pmiSave]; +end; + +destructor TcxPopupMenuLayout.Destroy; +begin + if FCustomMenuItemGlyph <> nil then FCustomMenuItemGlyph.Free; + inherited Destroy; +end; + +function TcxPopupMenuLayout.GetCustomMenuItemGlyph: TBitmap; +begin + if FCustomMenuItemGlyph = nil then + FCustomMenuItemGlyph := TBitmap.Create; + Result := FCustomMenuItemGlyph; +end; + +procedure TcxPopupMenuLayout.SetCustomMenuItemGlyph(Value: TBitmap); +begin + if (Value = nil) then + begin + FCustomMenuItemGlyph.Free; + FCustomMenuItemGlyph := nil; + end + else + CustomMenuItemGlyph.Assign(Value); +end; + +procedure TcxPopupMenuLayout.Assign(Source: TPersistent); +begin + if Source is TcxPopupMenuLayout then + with TcxPopupMenuLayout(Source) do + begin + Self.MenuItems := MenuItems; + Self.CustomMenuItemCaption := CustomMenuItemCaption; + Self.CustomMenuItemGlyph.Assign(CustomMenuItemGlyph); + end + else + inherited Assign(Source); +end; + +{ TcxCustomImageProperties } + +constructor TcxCustomImageProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FPopupMenuLayout := TcxPopupMenuLayout.Create(nil); + FCenter := True; + FDefaultHeight := cxImageDefaultInplaceHeight; + FGraphicTransparency := gtDefault; + FProportional := True; + FShowFocusRect := True; + FStretch := False; + FGraphicClass := GetDefaultGraphicClass; +end; + +destructor TcxCustomImageProperties.Destroy; +begin + FPopupMenuLayout.Free; + inherited Destroy; +end; + +function TcxCustomImageProperties.GetGraphicClassName: string; +begin + if FGraphicClass = nil then + Result := '' + else + Result := FGraphicClass.ClassName; +end; + +function TcxCustomImageProperties.IsGraphicClassNameStored: Boolean; +begin + Result := GraphicClass <> GetDefaultGraphicClass; +end; + +procedure TcxCustomImageProperties.ReadIsGraphicClassNameEmpty(Reader: TReader); +begin + Reader.ReadBoolean; + GraphicClassName := ''; +end; + +procedure TcxCustomImageProperties.SetCaption(const Value: string); +begin + if FCaption <> Value then + begin + FCaption := Value; + Changed; + end; +end; + +procedure TcxCustomImageProperties.SetCenter(Value: Boolean); +begin + if FCenter <> Value then + begin + FCenter := Value; + Changed; + end; +end; + +procedure TcxCustomImageProperties.SetGraphicClass( + const Value: TGraphicClass); +begin + if FGraphicClass <> Value then + begin + FGraphicClass := Value; + Changed; + end; +end; + +procedure TcxCustomImageProperties.SetGraphicClassName( + const Value: string); +var + AGraphicClass: TGraphicClass; +begin + if Value = '' then + GraphicClass := nil + else + begin + AGraphicClass := GetGraphicClassByName(Value); + if AGraphicClass <> nil then + GraphicClass := AGraphicClass; + end; +end; + +procedure TcxCustomImageProperties.SetGraphicTransparency( + Value: TcxImageTransparency); +begin + if FGraphicTransparency <> Value then + begin + FGraphicTransparency := Value; + Changed; + end; +end; + +procedure TcxCustomImageProperties.SetPopupMenuLayout( + Value: TcxPopupMenuLayout); +begin + FPopupMenuLayout.Assign(Value); +end; + +procedure TcxCustomImageProperties.SetProportional(AValue: Boolean); +begin + if AValue <> FProportional then + begin + FProportional := AValue; + if FStretch then + Changed; + end; +end; + +procedure TcxCustomImageProperties.SetShowFocusRect(Value: Boolean); +begin + if FShowFocusRect <> Value then + begin + FShowFocusRect := Value; + Changed; + end; +end; + +procedure TcxCustomImageProperties.SetStretch(Value: Boolean); +begin + if FStretch <> Value then + begin + FStretch := Value; + Changed; + end; +end; + +procedure TcxCustomImageProperties.WriteIsGraphicClassNameEmpty(Writer: TWriter); +begin + Writer.WriteBoolean(True); +end; + +function TcxCustomImageProperties.CanValidate: Boolean; +begin + Result := True; +end; + +procedure TcxCustomImageProperties.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('IsGraphicClassNameEmpty', ReadIsGraphicClassNameEmpty, + WriteIsGraphicClassNameEmpty, GraphicClassName = ''); +end; + +function TcxCustomImageProperties.IsDesigning: Boolean; +var + AOwner: TPersistent; +begin + AOwner := GetOwner; + Result := (AOwner is TComponent) and + (csDesigning in (AOwner as TComponent).ComponentState); +end; + +function TcxCustomImageProperties.GetDefaultGraphicClass: TGraphicClass; +begin + if GetRegisteredGraphicClasses.Count > 0 then + Result := TGraphicClass(GetRegisteredGraphicClasses[0]) + else + Result := nil; +end; + +class function TcxCustomImageProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxImageViewData; +end; + +procedure TcxCustomImageProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomImageProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with TcxCustomImageProperties(Source) do + begin + Self.Caption := Caption; + Self.Center := Center; + Self.CustomFilter := CustomFilter; + Self.GraphicClass := GraphicClass; + Self.GraphicTransparency := GraphicTransparency; + Self.PopupMenuLayout := PopupMenuLayout; + Self.ShowFocusRect := ShowFocusRect; + Self.Proportional := Proportional; + Self.Stretch := Stretch; + Self.OnAssignPicture := OnAssignPicture; + Self.OnCustomClick := OnCustomClick; + Self.OnGetGraphicClass := OnGetGraphicClass; + end; + finally + EndUpdate + end + end + else + inherited Assign(Source); +end; + +class function TcxCustomImageProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxImage; +end; + +function TcxCustomImageProperties.GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; +begin + if VarIsNull(AEditValue) then Result := '' else Result := Caption; +end; + +function TcxCustomImageProperties.GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; +begin + Result := evsValue; +end; + +function TcxCustomImageProperties.GetGraphicClass(AItem: TObject; + ARecordIndex: Integer; APastingFromClipboard: Boolean = False): TGraphicClass; +begin + Result := FGraphicClass; + if Result = nil then + begin + if APastingFromClipboard then + Result := TBitmap; + if Assigned(FOnGetGraphicClass) then + FOnGetGraphicClass(AItem, ARecordIndex, APastingFromClipboard, Result); + end; +end; + +function TcxCustomImageProperties.GetSpecialFeatures: TcxEditSpecialFeatures; +begin + Result := inherited GetSpecialFeatures + [esfBlobEditValue]; +end; + +function TcxCustomImageProperties.GetSupportedOperations: TcxEditSupportedOperations; +begin + Result := inherited GetSupportedOperations + [esoAutoHeight, esoEditing]; +end; + +class function TcxCustomImageProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxImageViewInfo; +end; + +function TcxCustomImageProperties.IsResetEditClass: Boolean; +begin + Result := True; +end; + +procedure TcxCustomImageProperties.ValidateDisplayValue(var DisplayValue: TcxEditValue; + var ErrorText: TCaption; var Error: Boolean; AEdit: TcxCustomEdit); +begin + with TcxCustomImage(AEdit) do + begin + LockEditValueChanging(True); + try + DoOnAssignPicture; + SaveModified; + try + EditModified := False; + DoEditing; + finally + RestoreModified; + end; + finally + LockEditValueChanging(False); + end; + end; +end; + +{ TcxCustomImage } + +destructor TcxCustomImage.Destroy; +begin + if FEditPopupMenu <> nil then FEditPopupMenu.Free; + FPicture.Free; + inherited Destroy; +end; + +procedure TcxCustomImage.EditAndClear; +begin + if DoEditing then + FPicture.Graphic := nil; +end; + +procedure TcxCustomImage.EditPopupMenuClick(Sender: TObject); +begin + MenuItemClick(Sender, TcxPopupMenuItem(Integer(TMenuItem(Sender).Tag))); +end; + +{$IFDEF CBUILDER10} +function TcxCustomImage.GetPicture: TPicture; +begin + Result := FPicture; +end; +{$ENDIF} + +function TcxCustomImage.GetProperties: TcxCustomImageProperties; +begin + Result := TcxCustomImageProperties(FProperties); +end; + +function TcxCustomImage.GetActiveProperties: TcxCustomImageProperties; +begin + Result := TcxCustomImageProperties(InternalGetActiveProperties); +end; + +procedure TcxCustomImage.MenuItemClick(Sender: TObject; + MenuItem: TcxPopupMenuItem); +begin + KeyboardAction := True; + try + case MenuItem of + pmiCut: CutToClipboard; + pmiCopy: CopyToClipboard; + pmiPaste: PasteFromClipboard; + pmiDelete: EditAndClear; + pmiLoad: LoadFromFile; + pmiSave: SaveToFile; + pmiCustom: CustomClick; + end; + finally + KeyboardAction := False; + end; +end; + +procedure TcxCustomImage.PictureChanged(Sender: TObject); +var + PrevEvent: TNotifyEvent; +begin + LockChangeEvents(True); + try + if Picture.Graphic is TIcon then // Otherwise the Icon returns the incorrect sizes + TIcon(Picture.Graphic).Handle; // HandleNeeded; + + if ActiveProperties.GraphicTransparency <> gtDefault then + begin + PrevEvent := FPicture.OnChange; + try + FPicture.OnChange := nil; + if not IsPictureEmpty(FPicture) then + FPicture.Graphic.Transparent := ActiveProperties.GraphicTransparency = gtTransparent; + finally + FPicture.OnChange := PrevEvent; + end; + end; + if not (csLoading in ComponentState) then + begin + ResetImage; + SetSize; + end; + if not FInternalChanging then + begin + if KeyboardAction then + ModifiedAfterEnter := True; + DoChange; + ShortRefreshContainer(False); + end; + if ActiveProperties.ImmediatePost and CanPostEditValue and ValidateEdit(True) then + InternalPostEditValue; + finally + LockChangeEvents(False); + end; + UpdateScrollBars; +end; + +procedure TcxCustomImage.PreparePopup; + + procedure RefreshCaptions; + begin + with FEditPopupMenu do + begin + Items[0].Caption := cxGetResourceString(@cxSMenuItemCaptionCut); + Items[1].Caption := cxGetResourceString(@cxSMenuItemCaptionCopy); + Items[2].Caption := cxGetResourceString(@cxSMenuItemCaptionPaste); + Items[3].Caption := cxGetResourceString(@cxSMenuItemCaptionDelete); + Items[5].Caption := cxGetResourceString(@cxSMenuItemCaptionLoad); + Items[6].Caption := cxGetResourceString(@cxSMenuItemCaptionSave); + end; + end; + + function NewItem(const ACaption: string; ABitmap: TBitmap; + ATag: Integer): TMenuItem; + begin + Result := TMenuItem.Create(Self); + with Result do + begin + Caption := ACaption; + if Assigned(ABitmap) then Bitmap := ABitmap else ImageIndex := ATag; + Tag := ATag; + OnClick := EditPopupMenuClick; + end; + end; + + procedure AddItem(AItems: TMenuItem; AMenuItem: TcxPopupMenuItem); + begin + with AItems do + begin + if AMenuItem = pmiCustom then + begin + ActiveProperties.PopupMenuLayout.CustomMenuItemGlyph.Transparent := True; + Add(NewItem(ActiveProperties.PopupMenuLayout.CustomMenuItemCaption, + ActiveProperties.PopupMenuLayout.CustomMenuItemGlyph, Integer(AMenuItem))); + end + else + Add(NewItem('', nil, Integer(AMenuItem))); + if AMenuItem in [pmiDelete, pmiSave] then + Add(NewItem('-', nil, -1)); + end; + end; + +var + I: TcxPopupMenuItem; + AFlagRO, AFlagEmpty, AIsIcon, ACanPaste: Boolean; +begin + with ActiveProperties.PopupMenuLayout do + begin + if FEditPopupMenu = nil then + begin + FEditPopupMenu := TPopupMenu.Create(nil); + FEditPopupMenu.Images := cxGraphicPopupMenuImages; + for I := Low(TcxPopupMenuItem) to High(TcxPopupMenuItem) do + AddItem(FEditPopupMenu.Items, I); + end; + RefreshCaptions; + // visible + with FEditPopupMenu do + begin + Items[0].Visible := pmiCut in MenuItems; + Items[1].Visible := pmiCopy in MenuItems; + Items[2].Visible := pmiPaste in MenuItems; + Items[3].Visible := pmiDelete in MenuItems; + Items[5].Visible := pmiLoad in MenuItems; + Items[6].Visible := pmiSave in MenuItems; + Items[8].Visible := pmiCustom in MenuItems; + // Separators + Items[4].Visible := Items[5].Visible or Items[6].Visible; + Items[7].Visible := Items[8].Visible; + + AIsIcon := ActiveProperties.GraphicClass = TIcon; + + ACanPaste := CanPasteFromClipboard; + // Custom Item + with Items[8] do + begin + Caption := CustomMenuItemCaption; + Bitmap := CustomMenuItemGlyph; + end; + + AFlagRO := not CanModify; + AFlagEmpty := IsPictureEmpty(FPicture); + Items[0].Enabled := not (AFlagEmpty or AFlagRO or AIsIcon); + Items[1].Enabled := not AFlagEmpty and not AIsIcon; + Items[2].Enabled := not AFlagRO and ACanPaste; + Items[3].Enabled := not AFlagEmpty and not AFlagRO; + Items[5].Enabled := not AFlagRO; + Items[6].Enabled := not AFlagEmpty; + end; + end; +end; + +procedure TcxCustomImage.ResetImage; +begin + HScrollBar.Position := 0; + VScrollBar.Position := 0; + SynchronizeImage; +end; + +procedure TcxCustomImage.SetPicture(Value: TPicture); +begin + FPicture.Assign(Value); +end; + +procedure TcxCustomImage.SetProperties(const Value: TcxCustomImageProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomImage.SetTransparent(AValue: Boolean); +begin + if AValue <> FTransparent then + begin + FTransparent := AValue; + ViewInfo.Transparent := FTransparent; + InvalidateRect(ViewInfo.ClientRect, False); + end; +end; + +procedure TcxCustomImage.SynchronizeImage; +begin + if not HandleAllocated then Exit; + with TcxImageViewInfo(ViewInfo) do + begin + if HScrollBar.Visible then TopLeft.X := HScrollBar.Position else TopLeft.X := 0; + if VScrollBar.Visible then TopLeft.Y := VScrollBar.Position else TopLeft.Y := 0; + end; + CalculateViewInfo(False); + InvalidateRect(ViewInfo.ClientRect, False); +end; + +function TcxCustomImage.CanAutoSize: Boolean; +begin + Result := inherited CanAutoSize and not IsPictureEmpty(Picture); +end; + +function TcxCustomImage.CanAutoWidth: Boolean; +begin + Result := True; +end; + +procedure TcxCustomImage.DoContextPopup( MousePos: TPoint; + var Handled: Boolean); +var + P: TPoint; +begin + if (PopupMenu = nil) and (ActiveProperties.PopupMenuLayout.MenuItems <> []) then + begin + Handled := True; + P := MousePos; + if (P.X = -1) and (P.Y = -1) then + begin + P.X := 10; + P.Y := 10; + end; + // Popup + PreparePopup; + P := ClientToScreen(P); + FEditPopupMenu.Popup(P.X, P.Y); + end + else + inherited; +end; + +procedure TcxCustomImage.Initialize; +begin + inherited Initialize; + AutoSize := False; + Width := 140; + Height := 100; + FClipboardFormat := CF_PICTURE; + FPicture := TPicture.Create; + FPicture.OnChange := PictureChanged; + TcxImageViewInfo(ViewInfo).Picture := FPicture; +end; + +procedure TcxCustomImage.InitScrollBarsParameters; +begin + if IsInplace or AutoSize or IsRectEmpty(ClientBounds) or IsPictureEmpty(Picture) or // TODO + ActiveProperties.Center or ActiveProperties.Stretch then // TODO + Exit; + with ClientBounds do + begin + SetScrollBarInfo(sbHorizontal, 0, Picture.Width - 1, 8, Right - Left, + TcxImageViewInfo(ViewInfo).TopLeft.X, True, True); + SetScrollBarInfo(sbVertical, 0, Picture.Height - 1, 8, Bottom - Top, + TcxImageViewInfo(ViewInfo).TopLeft.Y, True, True); + end; + SynchronizeImage; +end; + +procedure TcxCustomImage.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited KeyDown(Key, Shift); + KeyboardAction := True; + try + case Key of + VK_INSERT: + if ssShift in Shift then + PasteFromClipBoard + else + if ssCtrl in Shift then + CopyToClipBoard; + VK_DELETE: + if ssShift in Shift then + CutToClipBoard; + end; + finally + KeyboardAction := False; + end; +end; + +procedure TcxCustomImage.KeyPress(var Key: Char); +begin + inherited KeyPress(Key); + KeyboardAction := True; + try + case Key of + ^X: CutToClipBoard; + ^C: CopyToClipBoard; + ^V: PasteFromClipBoard; + end; + finally + KeyboardAction := False; + end; +end; + +function TcxCustomImage.NeedsInvokeAfterKeyDown(AKey: Word; + AShift: TShiftState): Boolean; +begin + Result := inherited NeedsInvokeAfterKeyDown(AKey, AShift); + case AKey of + VK_INSERT: + Result := AShift * [ssCtrl, ssShift] = []; + VK_DELETE: + Result := not (ssShift in AShift); + end; +end; + +function TcxCustomImage.NeedsScrollBars: Boolean; +begin + Result := True; +end; + +procedure TcxCustomImage.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +begin + case AScrollCode of + scLineUp: + Dec(AScrollPos, 8); + scLineDown: + Inc(AScrollPos, 8); + end; + case AScrollBarKind of + sbVertical: + begin + AScrollPos := Min(AScrollPos, Picture.Height - VScrollBar.PageSize); + VScrollBar.Position := AScrollPos; + AScrollPos := VScrollBar.Position; + end; + sbHorizontal: + begin + AScrollPos := Min(AScrollPos, Picture.Width - HScrollBar.PageSize); + HScrollBar.Position := AScrollPos; + AScrollPos := HScrollBar.Position; + end; + end; + SynchronizeImage; +end; + +function TcxCustomImage.GetEditValue: TcxEditValue; +var + S: AnsiString; +begin + if IsPictureEmpty(FPicture) then + Result := Null + else + begin + SavePicture(FPicture, S); + Result := S; + end; +end; + +procedure TcxCustomImage.InternalSetEditValue(const Value: TcxEditValue; AIsValueValid: Boolean); +begin + FInternalChanging := True; + try + if VarIsStr(Value) then + LoadPicture(Picture, GetGraphicClass, Value) + else + Picture.Assign(nil); + finally + EditModified := False; + FInternalChanging := False; + end; +end; + +procedure TcxCustomImage.PropertiesChanged(Sender: TObject); +begin + if not PropertiesChangeLocked then + begin + PictureChanged(nil); + UpdateScrollBars; + inherited PropertiesChanged(Sender) + end; +end; + +procedure TcxCustomImage.UpdateScrollBars; +begin + inherited UpdateScrollBars; + SynchronizeImage; +end; + +function TcxCustomImage.CanPasteFromClipboard: Boolean; +var + AGraphicClass: TGraphicClass; +begin + AGraphicClass := ActiveProperties.GraphicClass; + if AGraphicClass = TBitmap then + Result := Clipboard.HasFormat(CF_BITMAP) + else if AGraphicClass = TIcon then + Result := False + else if AGraphicClass = TMetafile then + Result := Clipboard.HasFormat(CF_METAFILEPICT) + {$IFDEF USEJPEGIMAGE} + else if AGraphicClass = TJPEGImage then + Result := Clipboard.HasFormat(CF_BITMAP) + {$ENDIF} + else if AGraphicClass = nil then + Result := Clipboard.HasFormat(CF_PICTURE) + else + Result := Clipboard.HasFormat(ClipboardFormat); +end; + +procedure TcxCustomImage.CustomClick; +begin + with Properties do + if Assigned(OnCustomClick) then + OnCustomClick(Self); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnCustomClick) then + OnCustomClick(Self); +end; + +procedure TcxCustomImage.DoOnAssignPicture; +begin + with Properties do + if Assigned(OnAssignPicture) then + OnAssignPicture(Self, Picture); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnAssignPicture) then + OnAssignPicture(Self, Picture); +end; + +function TcxCustomImage.GetGraphicClass(APastingFromClipboard: Boolean = False): TGraphicClass; +begin + if IsInplace then + Result := ActiveProperties.GetGraphicClass(InplaceParams.Position.Item, + InplaceParams.Position.RecordIndex, APastingFromClipboard) + else + begin + Result := ActiveProperties.GraphicClass; + if Result = nil then + begin + if APastingFromClipboard then + Result := TBitmap; + if Assigned(FOnGetGraphicClass) then + FOnGetGraphicClass(Self, APastingFromClipboard, Result); + end; + end; +end; + +procedure TcxCustomImage.CopyToClipboard; +begin + if (FPicture <> nil) and (FPicture.Graphic <> nil) then + Clipboard.Assign(FPicture); +end; + +procedure TcxCustomImage.CutToClipboard; +begin + CopyToClipboard; + EditAndClear; +end; + +function TcxCustomImage.Focused: Boolean; +begin + Result := FIsDialogShowed or inherited Focused; +end; + +class function TcxCustomImage.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomImageProperties; +end; + +procedure TcxCustomImage.LoadFromFile; + + function GetDialogFilter: string; + var + AGraphicClass: TGraphicClass; + begin + if ActiveProperties.CustomFilter <> '' then + Result := ActiveProperties.CustomFilter + else + begin + AGraphicClass := ActiveProperties.GraphicClass; + if AGraphicClass <> nil then + Result := GraphicFilter(AGraphicClass) + else + Result := GraphicFilter(TGraphic); + end; + end; + +var + ADialog: TOpenPictureDialog; +begin + if not CanModify then + Exit; + ADialog := TOpenPictureDialog.Create(nil); + try + FIsDialogShowed := True; + ADialog.Filter := GetDialogFilter; + if ADialog.Execute and DoEditing then + begin + FPicture.LoadFromFile(ADialog.FileName); + DoClosePopup(crEnter); + end + else + DoClosePopup(crCancel); + Application.ProcessMessages; + finally + FIsDialogShowed := False; + ADialog.Free; + end; +end; + +procedure TcxCustomImage.PasteFromClipboard; +{$IFDEF USEJPEGIMAGE} +var + AGraphicClass: TGraphicClass; + AGraphic: TJPEGImage; +{$ENDIF} +begin + if CanPasteFromClipboard and DoEditing then + if Clipboard.HasFormat(CF_BITMAP) then + begin +{$IFDEF USEJPEGIMAGE} + AGraphicClass := GetGraphicClass(True); + if (AGraphicClass = TJPEGImage) then + begin + AGraphic := TJPEGImage.Create; + try + TJPEGImageAccess(AGraphic).NewBitmap; + TJPEGImageAccess(AGraphic).Bitmap.Assign(Clipboard); + AGraphic.JPEGNeeded; + FPicture.Graphic := AGraphic; + finally + AGraphic.Free; + end; + end + else +{$ENDIF} + FPicture.Bitmap.Assign(Clipboard); + end + else + FPicture.Assign(Clipboard); +end; + +procedure TcxCustomImage.SaveToFile; +var + ADialog: TSavePictureDialog; +begin + if (FPicture = nil) or (FPicture.Graphic = nil) then + Exit; + ADialog := TSavePictureDialog.Create(Application); + FIsDialogShowed := True; + try + if ActiveProperties.CustomFilter <> '' then + ADialog.Filter := ActiveProperties.CustomFilter + else + ADialog.Filter := GraphicFilter(TGraphicClass(FPicture.Graphic.ClassType)); + ADialog.DefaultExt := GraphicExtension(TGraphicClass(FPicture.Graphic.ClassType)); + if ADialog.Execute then + FPicture.SaveToFile(ADialog.FileName); + Application.ProcessMessages; + finally + FIsDialogShowed := False; + ADialog.Free; + end; +end; + +{ TcxImage } + +class function TcxImage.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxImageProperties; +end; + +function TcxImage.GetActiveProperties: TcxImageProperties; +begin + Result := TcxImageProperties(InternalGetActiveProperties); +end; + +function TcxImage.GetProperties: TcxImageProperties; +begin + Result := TcxImageProperties(FProperties); +end; + +procedure TcxImage.SetProperties(Value: TcxImageProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxImageViewInfo } + +destructor TcxImageViewInfo.Destroy; +begin + if FFreePicture then + Picture.Free; + FTempBitmap.Free; + inherited Destroy; +end; + +procedure TcxImageViewInfo.DrawTransparentBackground(ACanvas: TcxCanvas; const R: TRect); +begin + ACanvas.SaveClipRegion; + try + ACanvas.SetClipRegion(TcxRegion.Create(R), roIntersect); + cxDrawTransparentControlBackground(Edit, ACanvas, Bounds); + finally + ACanvas.RestoreClipRegion; + end; +end; + +procedure TcxImageViewInfo.InternalPaint(ACanvas: TcxCanvas); + + procedure FocusRect(ACanvas: TCanvas; R: TRect); + begin + ACanvas.Brush.Style := bsClear; + ACanvas.Rectangle(R); + ACanvas.Brush.Style := bsSolid; + end; + +var + CR, R, Temp: TRect; + NeedDrawBkg: Boolean; + SaveRgn: TcxRegion; +begin + CR := ClientRect; + if Self.Transparent then + DrawTransparentBackground(ACanvas, Bounds); + with ACanvas do + begin + if not Assigned(Picture) or IsPictureEmpty(Picture) then + begin + inherited InternalPaint(ACanvas); + Brush.Color := BackgroundColor; + if Caption <> '' then + begin + Brush.Style := bsClear; + Canvas.Font.Assign(Self.Font); + Canvas.Font.Color := Self.TextColor; + ACanvas.DrawText(Caption, CR, cxAlignCenter + cxSingleLine); + Brush.Style := bsSolid; + end; + if ShowFocusRect then FocusRect(Canvas, CR); + Exit; + end; + with CR do + begin + if Stretch then + begin + if Proportional then + CalcStretchRect(CR, Picture.Width, Picture.Height, R) + else + R := CR; + if Center then + begin + OffsetRect(R, (Right - Left - (R.Right - R.Left)) div 2, 0); + OffsetRect(R, 0, (Bottom - Top - (R.Bottom - R.Top)) div 2); + end; + end + else + begin + R := Rect(Left, Top, Left + Picture.Width, Top + Picture.Height); + if Center then + begin + OffsetRect(R, (Right - Left - Picture.Width) div 2, 0); + OffsetRect(R, 0, (Bottom - Top - Picture.Height) div 2); + end + else + OffsetRect(R, -Self.TopLeft.X, -Self.TopLeft.Y); + end; + end; + SaveRgn := GetClipRegion; // for native mode + ExcludeClipRect(CR); + DrawCustomEdit(ACanvas, Self, False, bpsSolid); + SetClipRegion(SaveRgn, roSet); + if ShowFocusRect then + begin + FocusRect(Canvas, CR); + InflateRect(CR, -1, -1); + end; + SaveRgn := GetClipRegion; + IntersectClipRect(CR); + if ShowFocusRect then InflateRect(CR, 1, 1); + if not Self.Transparent and Picture.Graphic.Transparent then + begin + if FTempBitmap = nil then + begin + FTempBitmap := TBitmap.Create; + FTempBitmap.PixelFormat := pfDevice; + end; + try + FTempBitmap.Width := R.Right - R.Left; + FTempBitmap.Height := R.Bottom - R.Top; + FTempBitmap.Canvas.Brush.Color := BackgroundColor; + FTempBitmap.Canvas.FillRect(Rect(0, 0, FTempBitmap.Width, FTempBitmap.Height)); + FTempBitmap.Canvas.StretchDraw(Rect(0, 0, FTempBitmap.Width, FTempBitmap.Height), Picture.Graphic); + Canvas.Draw(R.Left, R.Top, FTempBitmap); + except + on EOutOfResources do + begin + Canvas.Brush.Color := BackgroundColor; + Canvas.FillRect(ClientRect); + Canvas.StretchDraw(R, Picture.Graphic); + end; + end; + end + else + Canvas.StretchDraw(R, Picture.Graphic); + NeedDrawBkg := not (IntersectRect(Temp, R, CR) and EqualRect(Temp, CR)) and not Self.Transparent; + if NeedDrawBkg then + begin + ExcludeClipRect(R); + Brush.Color := BackgroundColor; + FillRect(CR); + end; + SetClipRegion(SaveRgn, roSet); + end; +end; + +function TcxImageViewInfo.IsRepaintOnStateChangingNeeded: Boolean; +begin + Result := (not Assigned(Picture) or IsPictureEmpty(Picture)) and (Caption <> ''); +end; + +{ TcxImageViewData } + +procedure TcxImageViewData.Calculate(ACanvas: TcxCanvas; + const ABounds: TRect; const P: TPoint; Button: TcxMouseButton; + Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); +var + AProperties: TcxCustomImageProperties; +begin + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, AIsMouseEvent); + if IsRectEmpty(ABounds) then + Exit; + AProperties := TcxCustomImageProperties(Properties); + with TcxImageViewInfo(AViewInfo) do + begin + Caption := AProperties.Caption; + Center := AProperties.Center; + ShowFocusRect := AProperties.ShowFocusRect and Focused and not IsInplace; + Stretch := AProperties.Stretch; + Proportional := AProperties.Proportional; + if Center or Stretch then + TopLeft := Point(0, 0); + end; +end; + +procedure TcxImageViewData.EditValueToDrawValue(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; AViewInfo: TcxCustomEditViewInfo); +var + AGraphicClass: TGraphicClass; +begin + with TcxImageViewInfo(AViewInfo) do + if VarIsStr(AEditValue) and (AEditValue <> '') then + begin + if not Assigned(Picture) then + begin + Picture := TPicture.Create; + FFreePicture := True; + end; + AGraphicClass := TcxCustomImageProperties(Properties).GetGraphicClass( + InplaceEditParams.Position.Item, InplaceEditParams.Position.RecordIndex); + LoadPicture(Picture, AGraphicClass, AEditValue); + if TcxCustomImageProperties(Properties).GraphicTransparency <> gtDefault then + Picture.Graphic.Transparent := + TcxCustomImageProperties(Properties).GraphicTransparency = gtTransparent; + end + else + if Assigned(Picture) then + Picture.Assign(nil); +end; + +function TcxImageViewData.GetEditContentSize(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; + const AEditSizeProperties: TcxEditSizeProperties): TSize; +var + ABorderExtent: TRect; + AGraphicClass: TGraphicClass; + APicture: TPicture; + S: string; +begin + if IsInplace then + begin + if Edit <> nil then + begin + Result := Size(Edit.Width, Edit.Height); + ABorderExtent := GetBorderExtent; + Result.cx := Result.cx - (ABorderExtent.Left + ABorderExtent.Right); + Result.cy := Result.cy - (ABorderExtent.Top + ABorderExtent.Bottom); + end + else + with TcxCustomImageProperties(Properties) do + begin + Result := Size(0, DefaultHeight); + if VarIsStr(AEditValue) then + begin + AGraphicClass := GetGraphicClass(InplaceEditParams.Position.Item, + InplaceEditParams.Position.RecordIndex); + APicture := TPicture.Create; + try + S := AEditValue; + LoadPicture(APicture, AGraphicClass, S); + Result := Size(APicture.Width, APicture.Height); + finally + APicture.Free; + end; + if Stretch then + if (AEditSizeProperties.Width > 0) and (Result.cx > 0) then + Result := Size(AEditSizeProperties.Width, Round(Result.cy * AEditSizeProperties.Width / Result.cx)) + else + if (AEditSizeProperties.Height > 0) and (Result.cy > 0) then + Result := Size(Round(Result.cx * AEditSizeProperties.Height / Result.cy), AEditSizeProperties.Height); + end + else + if Length(Caption) <> 0 then + begin + ACanvas.Font := Style.GetVisibleFont; + Result := ACanvas.TextExtent(Caption); + end; + end; + end + else + if Edit <> nil then + with TcxCustomImage(Edit) do + Result := Size(Picture.Width, Picture.Height) + else + Result := Size(0, 0); +end; + +procedure LoadPopupMenuImages; + + function GetResourceName(APopupMenuItem: TcxPopupMenuItem): string; + begin + case APopupMenuItem of + pmiCut: + Result := 'CXMENUIMAGE_CUT'; + pmiCopy: + Result := 'CXMENUIMAGE_COPY'; + pmiPaste: + Result := 'CXMENUIMAGE_PASTE'; + pmiDelete: + Result := 'CXMENUIMAGE_DELETE'; + pmiLoad: + Result := 'CXMENUIMAGE_LOAD'; + pmiSave: + Result := 'CXMENUIMAGE_SAVE'; + else + Result := ''; + end; + end; + + procedure LoadBitmapFromResource(ABitmap: TBitmap; + APopupMenuItem: TcxPopupMenuItem); + begin + ABitmap.LoadFromResourceName(HInstance, GetResourceName(APopupMenuItem)); + end; + +var + ABitmap: TBitmap; + APopupMenuItem: TcxPopupMenuItem; +begin + ABitmap := TBitmap.Create; + try + LoadBitmapFromResource(ABitmap, Low(TcxPopupMenuItem)); + if cxGraphicPopupMenuImages = nil then + cxGraphicPopupMenuImages := TImageList.CreateSize(ABitmap.Width, ABitmap.Height); + cxGraphicPopupMenuImages.AddMasked(ABitmap, clDefault); + + for APopupMenuItem := Succ(Low(TcxPopupMenuItem)) to High(TcxPopupMenuItem) do + begin + if APopupMenuItem = pmiCustom then + Continue; + LoadBitmapFromResource(ABitmap, APopupMenuItem); + cxGraphicPopupMenuImages.AddMasked(ABitmap, clDefault); + end; + finally + ABitmap.Free; + end; +end; + +initialization + LoadPopupMenuImages; + GetRegisteredEditProperties.Register(TcxImageProperties, scxSEditRepositoryImageItem); + +finalization + FreeAndNil(cxRegisteredGraphicClasses); + FreeAndNil(cxGraphicPopupMenuImages); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxImageComboBox.pas b/official/x.35/ExpressEditors Library 5/Sources/cxImageComboBox.pas new file mode 100644 index 00000000..d6023857 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxImageComboBox.pas @@ -0,0 +1,1317 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxImageComboBox; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, ComCtrls, +{$IFDEF DELPHI6} + Types, Variants, +{$ENDIF} + cxVariants, SysUtils, Classes, Graphics, Controls, Forms, StdCtrls, ExtCtrls, Clipbrd, + ImgList, cxClasses, cxGraphics, cxControls, cxContainer, cxDataStorage, cxDataUtils, + cxEdit, cxDropDownEdit, cxTextEdit, cxFilterControlUtils; + +type + { TcxImageComboBoxItem } + + TcxImageComboBoxItem = class(TCollectionItem) + private + FDescription: TCaption; + FImageIndex: TImageIndex; + FTag: TcxTag; + FValue: Variant; + function IsStoredValue: Boolean; + function IsTagStored: Boolean; + procedure SetDescription(const Value: TCaption); + procedure SetImageIndex(const Value: TImageIndex); + procedure SetValue(const AValue: Variant); + public + constructor Create(Collection: TCollection); override; + procedure Assign(Source: TPersistent); override; + published + property Description: TCaption read FDescription write SetDescription; + property ImageIndex: TImageIndex read FImageIndex write SetImageIndex default -1; + property Tag: TcxTag read FTag write FTag stored IsTagStored; + property Value: Variant read FValue write SetValue stored IsStoredValue; + end; + + { TcxImageComboBoxItems } + + TcxImageComboBoxItems = class(TOwnedCollection) + private + function GetItems(Index: Integer): TcxImageComboBoxItem; + procedure SetItems(Index: Integer; const Value: TcxImageComboBoxItem); + protected + procedure InternalChanged; + procedure Update(Item: TCollectionItem); override; + public + constructor Create(AOwner: TPersistent); + function Add: TcxImageComboBoxItem; + {$IFNDEF DELPHI6} + function Owner: TPersistent; + {$ENDIF} + property Items[Index: Integer]: TcxImageComboBoxItem + read GetItems write SetItems; default; + end; + + { TcxImageComboBoxListBox } + + TcxCustomImageComboBox = class; + TcxCustomImageComboBoxProperties = class; + + TcxImageComboBoxListBox = class(TcxComboBoxListBox) + private + FClientWidth: Integer; + FHasScrollbar: Boolean; + function GetEdit: TcxCustomImageComboBox; + function GetProperties: TcxCustomImageComboBoxProperties; + protected + procedure DrawItem(Index: Integer; Rect: TRect; + State: TOwnerDrawState); override; + procedure MeasureItem(Index: Integer; var Height: Integer); override; + procedure RecreateWindow; override; + function GetImageRect(const R: TRect): TRect; + function GetImages: TCustomImageList; + function GetMaxItemWidth: Integer; virtual; + property Edit: TcxCustomImageComboBox read GetEdit; + property Properties: TcxCustomImageComboBoxProperties read GetProperties; + public + constructor Create(AOwner: TComponent); override; + function GetHeight(ARowCount: Integer; AMaxHeight: Integer): Integer; override; + function GetItemWidth(AIndex: Integer): Integer; override; + end; + + { TcxImageComboBoxLookupData } + + TcxImageComboBoxLookupData = class(TcxComboBoxLookupData) + protected + function GetListBoxClass: TcxCustomEditListBoxClass; override; + function GetItem(Index: Integer): string; override; + function GetItemCount: Integer; override; + public + procedure TextChanged; override; + end; + + { TcxImageComboBoxViewData } + + TcxImageComboBoxViewData = class(TcxCustomDropDownEditViewData) + private + function GetProperties: TcxCustomImageComboBoxProperties; + protected + function InternalEditValueToDisplayText(AEditValue: TcxEditValue): string; override; + function InternalGetEditConstantPartSize(ACanvas: TcxCanvas; AIsInplace: Boolean; + AEditSizeProperties: TcxEditSizeProperties; var MinContentSize: TSize; + AViewInfo: TcxCustomEditViewInfo): TSize; override; + function IsComboBoxStyle: Boolean; override; + public + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; + const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); override; + procedure DisplayValueToDrawValue(const ADisplayValue: TcxEditValue; + AViewInfo: TcxCustomEditViewInfo); override; + procedure EditValueToDrawValue(ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + AViewInfo: TcxCustomEditViewInfo); override; + property Properties: TcxCustomImageComboBoxProperties read GetProperties; + end; + + { TcxImageComboBoxViewInfo } + + TcxImageAlign = (iaLeft, iaRight); + + TcxImageComboBoxViewInfo = class(TcxCustomTextEditViewInfo) + protected + procedure InternalPaint(ACanvas: TcxCanvas); override; + public + ImageRect: TRect; + ShowDescriptions: Boolean; + ImageAlign: TcxImageAlign; + ImageIndex: TImageIndex; + Images: TCustomImageList; + procedure Offset(DX, DY: Integer); override; + end; + + { TcxCustomImageComboBoxProperties } + + TcxCustomImageComboBoxProperties = class(TcxCustomComboBoxProperties) + private + FDefaultDescription: string; + FDefaultImageIndex: TImageIndex; + FImageAlign: TcxImageAlign; + FImages: TCustomImageList; + FImagesChangeLink: TChangeLink; + FItems: TcxImageComboBoxItems; + FLargeImages: TCustomImageList; + FLargeImagesChangeLink: TChangeLink; + FMultiLineText: Boolean; + FShowDescriptions: Boolean; + procedure ImagesChange(Sender: TObject); + procedure LargeImagesChange(Sender: TObject); + procedure SetDefaultDescription(const Value: string); + procedure SetDefaultImageIndex(const Value: TImageIndex); + procedure SetImageAlign(const Value: TcxImageAlign); + procedure SetImages(Value: TCustomImageList); + procedure SetItems(const Value: TcxImageComboBoxItems); + procedure SetLargeImages(Value: TCustomImageList); + procedure SetMultiLineText(const Value: Boolean); + procedure SetShowDescriptions(const Value: Boolean); + protected + function FindItemByText(const AText: string): TcxImageComboBoxItem; + function FindLookupText(const AText: string): Boolean; override; + procedure FreeNotification(Sender: TComponent); override; + function GetDisplayFormatOptions: TcxEditDisplayFormatOptions; override; + class function GetLookupDataClass: TcxInterfacedPersistentClass; override; + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + function HasDisplayValue: Boolean; override; + procedure InternalGetImageComboBoxDisplayValue(AItem: TcxImageComboBoxItem; + out AText: TCaption; out AImageIndex: TImageIndex; + AAlwaysShowDescription: Boolean = False); virtual; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function CompareDisplayValues( + const AEditValue1, AEditValue2: TcxEditValue): Boolean; override; + function FindItemByValue(const AValue: Variant): TcxImageComboBoxItem; + class function GetContainerClass: TcxContainerClass; override; + function GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; override; + function GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; override; + procedure GetImageComboBoxDisplayValue(const AEditValue: TcxEditValue; + out AText: TCaption; out AImageIndex: TImageIndex); + function GetSupportedOperations: TcxEditSupportedOperations; override; + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + function IsEditValueValid(var AEditValue: TcxEditValue; AEditFocused: Boolean): Boolean; override; + procedure PrepareDisplayValue(const AEditValue: TcxEditValue; + var DisplayValue: TcxEditValue; AEditFocused: Boolean); override; + // !!! + property DefaultDescription: string + read FDefaultDescription write SetDefaultDescription; + property DefaultImageIndex: TImageIndex + read FDefaultImageIndex write SetDefaultImageIndex default -1; + property ImageAlign: TcxImageAlign + read FImageAlign write SetImageAlign default iaLeft; + property Images: TCustomImageList read FImages write SetImages; + property Items: TcxImageComboBoxItems read FItems write SetItems; + property LargeImages: TCustomImageList read FLargeImages write SetLargeImages; + property MultiLineText: Boolean + read FMultiLineText write SetMultiLineText default False; + property ShowDescriptions: Boolean + read FShowDescriptions write SetShowDescriptions default True; + end; + + { TcxImageComboBoxProperties } + + TcxImageComboBoxProperties = class(TcxCustomImageComboBoxProperties) + published + property Alignment; + property AssignedValues; + property ButtonGlyph; + property ClearKey; + property DefaultDescription; + property DefaultImageIndex; + property DropDownRows; + property ImageAlign; + property Images; + property ImeMode; + property ImeName; + property ImmediateDropDown; + property ImmediatePost; + property ImmediateUpdateText; + property Items; + property LargeImages; + property MultiLineText; + property PopupAlignment; + property PostPopupValueOnTab; + property ReadOnly; + property Revertable; + property ShowDescriptions; + property ValidateOnEnter; + property OnButtonClick; + property OnChange; + property OnCloseQuery; + property OnCloseUp; + property OnEditValueChanged; + property OnInitPopup; + property OnPopup; + property OnValidate; + end; + + { TcxCustomImageComboBox } + + TcxCustomImageComboBox = class(TcxCustomComboBox) + private + function GetProperties: TcxCustomImageComboBoxProperties; + function GetActiveProperties: TcxCustomImageComboBoxProperties; + procedure SetProperties(const Value: TcxCustomImageComboBoxProperties); + protected + function GetItemObject: TObject; override; + function GetPopupWindowClientPreferredSize: TSize; override; + function InternalGetEditingValue: TcxEditValue; override; + function IsValidChar(AChar: Char): Boolean; override; + function LookupKeyToEditValue(const AKey: TcxEditValue): TcxEditValue; override; + procedure SynchronizeDisplayValue; override; + procedure UpdateDrawValue; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + procedure PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); override; + property ActiveProperties: TcxCustomImageComboBoxProperties read GetActiveProperties; + property Properties: TcxCustomImageComboBoxProperties read GetProperties + write SetProperties; + end; + + { TcxImageComboBox } + + TcxImageComboBox = class(TcxCustomImageComboBox) + private + function GetActiveProperties: TcxImageComboBoxProperties; + function GetProperties: TcxImageComboBoxProperties; + procedure SetProperties(Value: TcxImageComboBoxProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxImageComboBoxProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property EditValue; + property Enabled; + property ImeMode; + property ImeName; + property ItemIndex; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxImageComboBoxProperties read GetProperties write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnEditing; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + end; + + { TcxFilterImageComboBoxHelper } + + TcxFilterImageComboBoxHelper = class(TcxFilterComboBoxHelper) + public + class function GetFilterEditClass: TcxCustomEditClass; override; + class function GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; override; + class procedure InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); override; + end; + +implementation + +uses + Dialogs, Math, cxGeometry, cxButtons, cxEditConsts, cxEditUtils, cxScrollBar, + cxDWMApi; + +const + EmptyRect: TRect = (Left: 0; Top: 0; Right: 0; Bottom: 0); + +type + TcxCustomTextEditAccess = class(TcxCustomTextEdit); + +{ TcxImageComboBoxItem } + +constructor TcxImageComboBoxItem.Create(Collection: TCollection); +var + AImages: TCustomImageList; +begin + FValue := Null; // for D5 variants + inherited Create(Collection); + AImages := + TcxCustomImageComboBoxProperties(TcxImageComboBoxItems(Collection).Owner).Images; + if (AImages <> nil) and (AImages.Count >= Collection.Count) then + FImageIndex := Collection.Count - 1 + else + FImageIndex := -1; +end; + +function TcxImageComboBoxItem.IsStoredValue: Boolean; +begin + Result := not VarIsNull(FValue); +end; + +function TcxImageComboBoxItem.IsTagStored: Boolean; +begin + Result := FTag <> 0; +end; + +procedure TcxImageComboBoxItem.SetDescription(const Value: TCaption); +begin + if FDescription <> Value then + begin + FDescription := Value; + TcxImageComboBoxItems(Collection).InternalChanged; + end; +end; + +procedure TcxImageComboBoxItem.SetImageIndex(const Value: TImageIndex); +begin + if FImageIndex <> Value then + begin + FImageIndex := Value; + TcxImageComboBoxItems(Collection).InternalChanged; + end; +end; + +procedure TcxImageComboBoxItem.SetValue(const AValue: Variant); +begin + if not InternalVarEqualsExact(FValue, AValue) then + begin + FValue := AValue; + TcxImageComboBoxItems(Collection).InternalChanged; + end; +end; + +procedure TcxImageComboBoxItem.Assign(Source: TPersistent); +begin + if Source is TcxImageComboBoxItem then + with TcxImageComboBoxItem(Source) do + begin + Self.Description := Description; + Self.ImageIndex := ImageIndex; + Self.Tag := Tag; + Self.Value := Value; + end + else + inherited Assign(Source); +end; + +{ TcxImageComboBoxItems } + +function TcxImageComboBoxItems.GetItems(Index: Integer): TcxImageComboBoxItem; +begin + Result := TcxImageComboBoxItem(inherited Items[Index]); +end; + +procedure TcxImageComboBoxItems.SetItems(Index: Integer; + const Value: TcxImageComboBoxItem); +begin + inherited Items[Index] := Value; +end; + +procedure TcxImageComboBoxItems.InternalChanged; +begin + Changed; +end; + +procedure TcxImageComboBoxItems.Update(Item: TCollectionItem); +begin + with TcxCustomImageComboBoxProperties(Owner) do + Changed; +end; + +constructor TcxImageComboBoxItems.Create(AOwner: TPersistent); +begin + inherited Create(AOwner, TcxImageComboBoxItem); +end; + +function TcxImageComboBoxItems.Add: TcxImageComboBoxItem; +begin + Result := TcxImageComboBoxItem(inherited Add); +end; + +{$IFNDEF DELPHI6} +function TcxImageComboBoxItems.Owner: TPersistent; +begin + Result := GetOwner; +end; +{$ENDIF} + +{ TcxImageComboBoxListBox } + +constructor TcxImageComboBoxListBox.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + BorderStyle := bsNone; + Style := lbOwnerDrawVariable; +end; + +function TcxImageComboBoxListBox.GetHeight(ARowCount: Integer; AMaxHeight: Integer): Integer; +var + I, H: Integer; + R: TRect; +begin + if Properties.MultiLineText then + with TcxCustomImageComboBox(Edit) do + begin + R := GetPopupWindowOwnerControlBounds; + FClientWidth := R.Right - R.Left; + R := PopupWindow.ViewInfo.GetClientExtent; + Dec(FClientWidth, R.Left + R.Right); + end + else + FClientWidth := 0; + Result := 0; + for I := 0 to ARowCount - 1 do + begin + H := 0; + MeasureItem(I, H); + Inc(Result, H); + end; + if Properties.MultiLineText then + begin + FHasScrollbar := (Result > AMaxHeight) or (ARowCount < Items.Count); + if FHasScrollbar then + begin + Dec(FClientWidth, GetScrollBarSize.cx); + Result := 0; + for I := 0 to ARowCount - 1 do + begin + H := 0; + MeasureItem(I, H); + Inc(Result, H); + end; + end; + end; +end; + +function TcxImageComboBoxListBox.GetItemWidth(AIndex: Integer): Integer; +begin + if Properties.MultiLineText then + Result := 0 + else + Result := inherited GetItemWidth(AIndex); +end; + +procedure TcxImageComboBoxListBox.DrawItem(Index: Integer; Rect: TRect; + State: TOwnerDrawState); +var + Flags: Longint; + Data: string; + AImages: TCustomImageList; + R: TRect; + AImageIndex: Integer; +begin + if not DoDrawItem(Index, Rect, State) then + begin + Canvas.FillRect(Rect); + if (Index < Items.Count) and (Index > -1) then + begin + if Properties.MultiLineText then + Flags := DrawTextBiDiModeFlags(DT_LEFT or DT_EXPANDTABS or + DT_NOPREFIX or DT_WORDBREAK) + else + Flags := DrawTextBiDiModeFlags(DT_SINGLELINE or DT_VCENTER or + DT_NOPREFIX); + if not UseRightToLeftAlignment then + Inc(Rect.Left, 2) + else + Dec(Rect.Right, 2); + Data := Properties.Items[Index].Description; + AImages := GetImages; + if AImages <> nil then + begin + R := GetImageRect(Rect); + AImageIndex := Properties.Items[Index].ImageIndex; + if (AImageIndex > -1) and (AImageIndex < AImages.Count) then + with R do + AImages.Draw(Canvas.Canvas, Left + 1, (Bottom + Top - AImages.Height) div 2, + AImageIndex, Enabled); + if R.Left > Rect.Left then Rect.Right := R.Left; + if R.Right < Rect.Right then Rect.Left := R.Right; + end; + if not IsRectEmpty(Rect) then + begin + SetBkMode(Handle, TRANSPARENT); + DrawText(Canvas.Handle, PChar(Data), Length(Data), Rect, Flags); + end; + end; + end; +end; + +procedure TcxImageComboBoxListBox.MeasureItem(Index: Integer; var Height: Integer); +var + AData: string; + AImages: TCustomImageList; + W, H, AFlags: Integer; + R: TRect; +begin + W := FClientWidth - 2; + AImages := GetImages; + if AImages <> nil then + begin + Dec(W, AImages.Width + 4); + H := AImages.Height + 2; + end + else + H := 0; + if Properties.MultiLineText and (W > 0) then + begin + R := Rect(0, 0, W, H); + AData := Properties.Items[Index].Description; + AFlags := DT_LEFT or DT_EXPANDTABS or DT_NOPREFIX or DT_WORDBREAK or DT_CALCRECT; + DrawText(Canvas.Handle, PChar(AData), Length(AData), R, AFlags); + H := Max(H, R.Bottom - R.Top + 2); + end + else + H := Max(Canvas.TextHeight('Wg') + 2, H); + Height := H; + if (Index >= 0) and Edit.IsOnMeasureItemEventAssigned then + Edit.DoOnMeasureItem(Index, Canvas, Height); +end; + +procedure TcxImageComboBoxListBox.RecreateWindow; +begin + InternalRecreateWindow; +end; + +function TcxImageComboBoxListBox.GetImageRect(const R: TRect): TRect; +var + AImages: TCustomImageList; +begin + AImages := GetImages; + if AImages <> nil then + with Properties do + begin + Result := R; + with Result do + if ImageAlign = iaLeft then + Right := Left + AImages.Width + 4 + else + Left := Right - AImages.Width - 4; + end + else + Result := EmptyRect; +end; + +function TcxImageComboBoxListBox.GetImages: TCustomImageList; +begin + Result := Properties.LargeImages; + if Result = nil then Result := Properties.Images; +end; + +function TcxImageComboBoxListBox.GetMaxItemWidth: Integer; +var + AImages: TCustomImageList; + I, W, J: Integer; +begin + AImages := GetImages; + if AImages <> nil then Result := AImages.Width + 8 else Result := 4; + with Properties do + begin + J := Result; + for I := 0 to Items.Count - 1 do + begin + W := Canvas.TextWidth(Items[I].Description) + J; + if W > Result then Result := W; + end; + end; + if Properties.DropDownRows < Items.Count then + Inc(Result, GetScrollBarSize.cx); +end; + +function TcxImageComboBoxListBox.GetEdit: TcxCustomImageComboBox; +begin + Result := TcxCustomImageComboBox(inherited Edit); +end; + +function TcxImageComboBoxListBox.GetProperties: TcxCustomImageComboBoxProperties; +begin + Result := TcxCustomImageComboBox(Edit).ActiveProperties; +end; + +{ TcxImageComboBoxLookupData } + +function TcxImageComboBoxLookupData.GetListBoxClass: TcxCustomEditListBoxClass; +begin + Result := TcxImageComboBoxListBox; +end; + +function TcxImageComboBoxLookupData.GetItem(Index: Integer): string; +begin + with TcxCustomImageComboBox(Edit).ActiveProperties do + if (Index > -1) and (Index < Items.Count) then + Result := Items[Index].Description + else + Result := '' +end; + +function TcxImageComboBoxLookupData.GetItemCount: Integer; +begin + Result := TcxCustomImageComboBox(Edit).ActiveProperties.Items.Count; +end; + +procedure TcxImageComboBoxLookupData.TextChanged; +var + AItem: TcxImageComboBoxItem; +begin + if TcxCustomImageComboBox(Edit).EditModeSetting then + Exit; + with TcxCustomImageComboBoxProperties(ActiveProperties) do + AItem := FindItemByValue(Edit.EditValue); + if AItem <> nil then + InternalSetCurrentKey(AItem.Index) + else + InternalSetCurrentKey(-1); +end; + +{ TcxImageComboBoxViewData } + +procedure TcxImageComboBoxViewData.Calculate(ACanvas: TcxCanvas; + const ABounds: TRect; const P: TPoint; Button: TcxMouseButton; + Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); +var + R: TRect; +begin + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, + AIsMouseEvent); + + with TcxImageComboBoxViewInfo(AViewInfo) do + begin + ImageAlign := TcxCustomImageComboBoxProperties(Properties).ImageAlign; + Images := TcxCustomImageComboBoxProperties(Properties).Images; + ShowDescriptions := TcxCustomImageComboBoxProperties(Properties).ShowDescriptions; + R := ClientRect; + if Assigned(Images) then + begin + ImageRect := cxRectInflate(R, -2, 0); + with ImageRect do + begin + if cxRectWidth(ImageRect) > Images.Width then + begin + if ShowDescriptions then + if ImageAlign = iaLeft then + begin + Right := Left + Images.Width; + R.Left := Right + 2; + end + else + begin + Left := Right - Images.Width; + R.Right := Left - 2; + end + else + begin + Left := Left + (Right - Left - Images.Width) div 2; + Right := Left + Images.Width; + end; + end + else + R.Left := R.Right; + if cxRectHeight(ImageRect) > Images.Height then + begin + Top := Top + (Bottom - Top - Images.Height) div 2; + Bottom := Top + Images.Height; + end; + end; + end; + + if not IsInplace then + ClientRect := R; + InflateRect(R, -2, -1); + TextRect := R; + if not ShowDescriptions then + Text := ''; + if not IsInplace then + DrawSelectionBar := False; + end; +end; + +procedure TcxImageComboBoxViewData.EditValueToDrawValue(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; AViewInfo: TcxCustomEditViewInfo); +var + AText: string; + ACaption: TCaption; + AImageIndex: TImageIndex; +begin + PrepareSelection(AViewInfo); + Properties.GetImageComboBoxDisplayValue(AEditValue, ACaption, AImageIndex); + TcxImageComboBoxViewInfo(AViewInfo).ImageIndex := AImageIndex; + AText := ACaption; + DoOnGetDisplayText(AText); + TcxImageComboBoxViewInfo(AViewInfo).Text := AText; +end; + +procedure TcxImageComboBoxViewData.DisplayValueToDrawValue( + const ADisplayValue: TcxEditValue; AViewInfo: TcxCustomEditViewInfo); +var + ACurrentKey: TcxEditValue; + AItem: TcxImageComboBoxItem; + ACaption: TCaption; + AImageIndex: TImageIndex; +begin + if Edit = nil then + Exit; + ACurrentKey := TcxCustomImageComboBox(Edit).ILookupData.CurrentKey; + if ACurrentKey = -1 then + AItem := Properties.FindItemByValue(Edit.EditValue) + else + AItem := Properties.Items[ACurrentKey]; + Properties.InternalGetImageComboBoxDisplayValue(AItem, ACaption, AImageIndex); + TcxImageComboBoxViewInfo(AViewInfo).Text := ACaption; + TcxImageComboBoxViewInfo(AViewInfo).ImageIndex := AImageIndex; +end; + +function TcxImageComboBoxViewData.InternalEditValueToDisplayText( + AEditValue: TcxEditValue): string; +var + AIndex: TImageIndex; + ACaption: TCaption; +begin + Properties.GetImageComboBoxDisplayValue(AEditValue, + ACaption, AIndex); + Result := ACaption; +end; + +function TcxImageComboBoxViewData.InternalGetEditConstantPartSize( + ACanvas: TcxCanvas; AIsInplace: Boolean; + AEditSizeProperties: TcxEditSizeProperties; var MinContentSize: TSize; + AViewInfo: TcxCustomEditViewInfo): TSize; +begin + Result := inherited InternalGetEditConstantPartSize(ACanvas, AIsInplace, + AEditSizeProperties, MinContentSize, AViewInfo); + with TcxCustomImageComboBoxProperties(Properties) do + begin + if Assigned(Images) then + begin + if Images.Height > MinContentSize.cy then + MinContentSize.cy := Images.Height; + Result.cx := Result.cx + Images.Width + 5; + end + else + Result.cx := Result.cx + 1; + end; +end; + +function TcxImageComboBoxViewData.IsComboBoxStyle: Boolean; +begin + Result := IsCompositionEnabled; +end; + +function TcxImageComboBoxViewData.GetProperties: TcxCustomImageComboBoxProperties; +begin + Result := TcxCustomImageComboBoxProperties(FProperties); +end; + +{ TcxImageComboBoxViewInfo } + +procedure TcxImageComboBoxViewInfo.Offset(DX, DY: Integer); +begin + inherited Offset(DX, DY); + OffsetRect(ImageRect, DX, DY); +end; + +procedure TcxImageComboBoxViewInfo.InternalPaint(ACanvas: TcxCanvas); +var + R: TRect; +begin + if not RectVisible(ACanvas.Handle, Bounds) then + Exit; + inherited InternalPaint(ACanvas); + if Assigned(Images) and (ImageIndex > -1) and (ImageIndex < Images.Count) then + begin + ACanvas.SaveClipRegion; + try + IntersectRect(R, ImageRect, BorderRect); + ACanvas.SetClipRegion(TcxRegion.Create(R), roIntersect); + + if Transparent or IsCompositionEnabled and NativeStyle then + Images.Draw(ACanvas.Canvas, ImageRect.Left, ImageRect.Top, + ImageIndex, Enabled) + else + cxEditUtils.DrawGlyph(ACanvas, + Images, ImageIndex, ImageRect, BackgroundColor, Enabled); + finally + ACanvas.RestoreClipRegion; + end; + end; +end; + +{ TcxCustomImageComboBoxProperties } + +constructor TcxCustomImageComboBoxProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FShowDescriptions := True; + FDefaultImageIndex := -1; + FImageAlign := iaLeft; + FItems := TcxImageComboBoxItems.Create(Self); + DropDownListStyle := lsFixedList; + FImagesChangeLink := TChangeLink.Create; + FImagesChangeLink.OnChange := ImagesChange; + FLargeImagesChangeLink := TChangeLink.Create; + FLargeImagesChangeLink.OnChange := LargeImagesChange; +end; + +destructor TcxCustomImageComboBoxProperties.Destroy; +begin + FImagesChangeLink.Free; + FLargeImagesChangeLink.Free; + FItems.Free; + inherited Destroy; +end; + +procedure TcxCustomImageComboBoxProperties.ImagesChange(Sender: TObject); +begin + Changed; +end; + +procedure TcxCustomImageComboBoxProperties.LargeImagesChange(Sender: TObject); +begin + Changed; +end; + +procedure TcxCustomImageComboBoxProperties.SetDefaultDescription( + const Value: string); +begin + if FDefaultDescription <> Value then + begin + FDefaultDescription := Value; + Changed; + end; +end; + +procedure TcxCustomImageComboBoxProperties.SetDefaultImageIndex( + const Value: TImageIndex); +begin + if FDefaultImageIndex <> Value then + begin + FDefaultImageIndex := Value; + Changed; + end; +end; + +procedure TcxCustomImageComboBoxProperties.SetImageAlign( + const Value: TcxImageAlign); +begin + if FImageAlign <> Value then + begin + FImageAlign := Value; + Changed; + end; +end; + +procedure TcxCustomImageComboBoxProperties.SetImages(Value: TCustomImageList); +begin + cxSetImageList(Value, FImages, FImagesChangeLink, FreeNotificator); +end; + +procedure TcxCustomImageComboBoxProperties.SetLargeImages(Value: TCustomImageList); +begin + cxSetImageList(Value, FLargeImages, FLargeImagesChangeLink, FreeNotificator); +end; + +procedure TcxCustomImageComboBoxProperties.SetItems( + const Value: TcxImageComboBoxItems); +begin + FItems.Assign(Value); + Changed; +end; + +procedure TcxCustomImageComboBoxProperties.SetMultiLineText( + const Value: Boolean); +begin + if FMultiLineText <> Value then + begin + FMultiLineText := Value; + Changed; + end; +end; + +procedure TcxCustomImageComboBoxProperties.SetShowDescriptions( + const Value: Boolean); +begin + if FShowDescriptions <> Value then + begin + FShowDescriptions := Value; + Changed; + end; +end; + +function TcxCustomImageComboBoxProperties.FindItemByText(const AText: string): + TcxImageComboBoxItem; +var + I: Integer; +begin + Result := nil; + if ShowDescriptions then + for I := 0 to Items.Count - 1 do + if InternalCompareString(Items[I].Description, AText, False) then + begin + Result := Items[I]; + Break; + end; +end; + +function TcxCustomImageComboBoxProperties.FindLookupText(const AText: string): Boolean; +begin + Result := FindItemByText(AText) <> nil; +end; + +procedure TcxCustomImageComboBoxProperties.FreeNotification(Sender: TComponent); +begin + inherited FreeNotification(Sender); + if Sender = FImages then + FImages := nil; + if Sender = FLargeImages then + FLargeImages := nil; +end; + +function TcxCustomImageComboBoxProperties.GetDisplayFormatOptions: TcxEditDisplayFormatOptions; +begin + Result := []; +end; + +class function TcxCustomImageComboBoxProperties.GetLookupDataClass: TcxInterfacedPersistentClass; +begin + Result := TcxImageComboBoxLookupData; +end; + +class function TcxCustomImageComboBoxProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxImageComboBoxViewData; +end; + +function TcxCustomImageComboBoxProperties.HasDisplayValue: Boolean; +begin + Result := False; +end; + +procedure TcxCustomImageComboBoxProperties.InternalGetImageComboBoxDisplayValue( + AItem: TcxImageComboBoxItem; out AText: TCaption; out AImageIndex: TImageIndex; + AAlwaysShowDescription: Boolean = False); +begin + if AAlwaysShowDescription or ShowDescriptions then + if AItem = nil then + AText := DefaultDescription + else + AText := AItem.Description + else + AText := ''; + if AItem = nil then + AImageIndex := DefaultImageIndex + else + AImageIndex := AItem.ImageIndex; +end; + +procedure TcxCustomImageComboBoxProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomImageComboBoxProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with TcxCustomImageComboBoxProperties(Source) do + begin + Self.DefaultDescription := DefaultDescription; + Self.DefaultImageIndex := DefaultImageIndex; + Self.ImageAlign := ImageAlign; + Self.Images := Images; + Self.Items.Assign(Items); + Self.LargeImages := LargeImages; + Self.MultiLineText := MultiLineText; + Self.ShowDescriptions := ShowDescriptions; + end; + finally + EndUpdate + end + end + else + inherited Assign(Source); +end; + +function TcxCustomImageComboBoxProperties.CompareDisplayValues( + const AEditValue1, AEditValue2: TcxEditValue): Boolean; +var + AImageIndex1, AImageIndex2: TImageIndex; + AText1, AText2: TCaption; +begin + GetImageComboBoxDisplayValue(AEditValue1, AText1, AImageIndex1); + GetImageComboBoxDisplayValue(AEditValue2, AText2, AImageIndex2); + Result := InternalCompareString(AText1, AText2, True) and ((Images = nil) or + (AImageIndex1 = AImageIndex2)); +end; + +function TcxCustomImageComboBoxProperties.FindItemByValue( + const AValue: Variant): TcxImageComboBoxItem; +var + I: Integer; +begin + Result := nil; + for I := 0 to Items.Count - 1 do + with Items[I] do + if VarEqualsExact(AValue, Value) then + begin + Result := Items[I]; + Break; + end; +end; + +class function TcxCustomImageComboBoxProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxImageComboBox; +end; + +function TcxCustomImageComboBoxProperties.GetDisplayText( + const AEditValue: TcxEditValue; AFullText: Boolean = False; + AIsInplace: Boolean = True): WideString; +var + ADisplayValue: TcxEditValue; +begin + PrepareDisplayValue(AEditValue, ADisplayValue, False); + Result := ADisplayValue; +end; + +function TcxCustomImageComboBoxProperties.GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; +begin + Result := evsValue; +end; + +procedure TcxCustomImageComboBoxProperties.GetImageComboBoxDisplayValue( + const AEditValue: TcxEditValue; out AText: TCaption; + out AImageIndex: TImageIndex); +begin + InternalGetImageComboBoxDisplayValue(FindItemByValue(AEditValue), AText, + AImageIndex); +end; + +function TcxCustomImageComboBoxProperties.GetSupportedOperations: TcxEditSupportedOperations; +begin + Result := [esoEditing, esoFiltering, esoHorzAlignment, esoSorting, + esoSortingByDisplayText]; + if Buttons.Count > 0 then + Include(Result, esoHotTrack); + if ShowDescriptions then + Include(Result, esoIncSearch); +end; + +class function TcxCustomImageComboBoxProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxImageComboBoxViewInfo; +end; + +function TcxCustomImageComboBoxProperties.IsEditValueValid( + var AEditValue: TcxEditValue; AEditFocused: Boolean): Boolean; +begin + Result := True; +end; + +procedure TcxCustomImageComboBoxProperties.PrepareDisplayValue( + const AEditValue: TcxEditValue; var DisplayValue: TcxEditValue; + AEditFocused: Boolean); +var + AImageIndex: TImageIndex; + AText: TCaption; +begin + InternalGetImageComboBoxDisplayValue(FindItemByValue(AEditValue), AText, + AImageIndex, True); + DisplayValue := AText; +end; + +{ TcxCustomImageComboBox } + +function TcxCustomImageComboBox.GetProperties: TcxCustomImageComboBoxProperties; +begin + Result := TcxCustomImageComboBoxProperties(FProperties); +end; + +function TcxCustomImageComboBox.GetActiveProperties: TcxCustomImageComboBoxProperties; +begin + Result := TcxCustomImageComboBoxProperties(InternalGetActiveProperties); +end; + +procedure TcxCustomImageComboBox.SetProperties(const Value: TcxCustomImageComboBoxProperties); +begin + FProperties.Assign(Value); +end; + +function TcxCustomImageComboBox.IsValidChar(AChar: Char): Boolean; +begin + Result := IsTextChar(AChar); +end; + +function TcxCustomImageComboBox.GetItemObject: TObject; +begin + Result := nil; +end; + +function TcxCustomImageComboBox.GetPopupWindowClientPreferredSize: TSize; +begin + Result := inherited GetPopupWindowClientPreferredSize; + if not ActiveProperties.MultiLineText then + begin + if (LookupData.ActiveControl <> nil) and (LookupData.ActiveControl is TcxImageComboBoxListBox) then + with TcxImageComboBoxListBox(LookupData.ActiveControl) do + Result.cx := Max(GetMaxItemWidth, Result.cx); + end + else + Result.cx := 0; +end; + +function TcxCustomImageComboBox.InternalGetEditingValue: TcxEditValue; +begin + PrepareEditValue(Null, Result, True); +end; + +function TcxCustomImageComboBox.LookupKeyToEditValue(const AKey: TcxEditValue): TcxEditValue; +begin + if not VarEqualsExact(AKey, -1) then + Result := ActiveProperties.Items[AKey].Value + else + Result := Null; +end; + +procedure TcxCustomImageComboBox.SynchronizeDisplayValue; +var + APrevLookupKey: TcxEditValue; +begin + SaveModified; + try + APrevLookupKey := ILookupData.CurrentKey; + LockClick(True); + try + ILookupData.TextChanged; + finally + LockClick(False); + if (*ModifiedAfterEnter and *)not VarEqualsExact(APrevLookupKey, ILookupData.CurrentKey) then + DoClick; + end; + finally + RestoreModified; + ResetOnNewDisplayValue; + UpdateDrawValue; + end; +end; + +procedure TcxCustomImageComboBox.UpdateDrawValue; +begin + inherited UpdateDrawValue; + SetInternalDisplayValue(ViewInfo.Text); +end; + +class function TcxCustomImageComboBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomImageComboBoxProperties; +end; + +procedure TcxCustomImageComboBox.PrepareEditValue( + const ADisplayValue: TcxEditValue; out EditValue: TcxEditValue; + AEditFocused: Boolean); +begin + if VarEqualsExact(LookupData.CurrentKey, -1) then + EditValue := Null + else + EditValue := ActiveProperties.Items[LookupData.CurrentKey].Value; +end; + +{ TcxImageComboBox } + +class function TcxImageComboBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxImageComboBoxProperties; +end; + +function TcxImageComboBox.GetActiveProperties: TcxImageComboBoxProperties; +begin + Result := TcxImageComboBoxProperties(InternalGetActiveProperties); +end; + +function TcxImageComboBox.GetProperties: TcxImageComboBoxProperties; +begin + Result := TcxImageComboBoxProperties(FProperties); +end; + +procedure TcxImageComboBox.SetProperties(Value: TcxImageComboBoxProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxFilterImageComboBoxHelper } + +class function TcxFilterImageComboBoxHelper.GetFilterEditClass: TcxCustomEditClass; +begin + Result := TcxImageComboBox; +end; + +class function TcxFilterImageComboBoxHelper.GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; +begin + Result := [fcoEqual, fcoNotEqual, fcoBlanks, fcoNonBlanks]; + if AExtendedSet then + Result := Result + [fcoInList, fcoNotInList]; +end; + +class procedure TcxFilterImageComboBoxHelper.InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); +begin + inherited InitializeProperties(AProperties, AEditProperties, AHasButtons); + TcxImageComboBoxProperties(AProperties).DropDownListStyle := lsFixedList; + TcxImageComboBoxProperties(AProperties).ImmediateDropDown := True; + TcxImageComboBoxProperties(AProperties).ShowDescriptions := True; +end; + +initialization + GetRegisteredEditProperties.Register(TcxImageComboBoxProperties, scxSEditRepositoryImageComboBoxItem); + FilterEditsController.Register(TcxImageComboBoxProperties, TcxFilterImageComboBoxHelper); + +finalization + FilterEditsController.Unregister(TcxImageComboBoxProperties, TcxFilterImageComboBoxHelper); + +end. + diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxInplaceContainer.pas b/official/x.35/ExpressEditors Library 5/Sources/cxInplaceContainer.pas new file mode 100644 index 00000000..9b9b4bfd --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxInplaceContainer.pas @@ -0,0 +1,7133 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Common Editing Library } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE COMMONEDITINGLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxInplaceContainer; + +{$I cxVer.inc} + +interface + +uses + Classes, SysUtils, + Windows, Messages, +{$IFDEF DELPHI6} + Variants, Types, +{$ENDIF} + Forms, Controls, StdCtrls, Graphics, cxVariants, cxClasses, + cxControls, cxGraphics, cxStyles, cxContainer, cxEdit, cxTextEdit, cxData, + cxCustomData, cxDataUtils, cxDataStorage, cxLookAndFeels, cxLookAndFeelPainters, + cxEditDataRegisteredRepositoryItems, cxGeometry, cxLibraryConsts; + +const + ecs_Content = 0; + ecs_Background = 1; + ecs_Inactive = 2; + ecs_Selection = 3; + + ecs_EditContainerStylesMaxIndex = ecs_Content; + ecs_EditingStylesMaxIndex = ecs_Selection; + +// predefined hit codes + echc_Empty = 0; + echc_IsMouseEvent = 1; + +// viewinfo states + cvis_IsDirty = 1; + cvis_StyleInvalid = 2; + + cxSizingMarkWidth = 1; + cxScrollWidthDragInterval = 50; + +type + TcxDragSizingDirection = (dsdHorz, dsdVert); + + TcxGetEditPropertiesEvent = procedure(Sender: TObject; AData: Pointer; + var AEditProperties: TcxCustomEditProperties) of object; + TcxOnGetContentStyleEvent = procedure(Sender: TObject; AData: Pointer; + out AStyle: TcxStyle) of object; + + TcxInplaceEditContainerClass = class of TcxCustomInplaceEditContainer; + TcxCustomInplaceEditContainer = class; + TcxItemDataBindingClass = class of TcxCustomItemDataBinding; + + TcxCustomControlDragAndDropObjectClass = class of TcxCustomControlDragAndDropObject; + + TcxEditingController = class; + TcxEditingControllerClass = class of TcxEditingController; + + TcxCustomEditStyleClass = class of TcxCustomEditStyle; + + TcxCustomControlControllerClass = class of TcxCustomControlController; + TcxCustomControlController = class; + TcxControlDataController = class; + TcxCustomControlPainter = class; + TcxEditingControl = class; + + TcxHotTrackControllerClass = class of TcxHotTrackController; + TcxCustomHitTestController = class; + + TcxEditItemShowEditButtons = (eisbDefault, eisbNever, eisbAlways); + TcxEditingControlEditShowButtons = (ecsbAlways, ecsbFocused, ecsbNever); + + TcxCustomControlViewInfo = class; + + TcxCustomControlStyles = class; + + TcxEditCellViewInfo = class; + TcxEditCellViewInfoClass = class of TcxEditCellViewInfo; + + TcxHitCode = type Int64; + + { TcxInterfacedCollectionItem } + + TcxInterfacedCollectionItem = class(TCollectionItem, IUnknown) + private + FOwnerInterface: IUnknown; + protected + // IUnknown + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall; + public + procedure AfterConstruction; override; + end; + + { TcxContainerItemDefaultValuesProvider } + + TcxContainerItemDefaultValuesProvider = class(TcxCustomEditDefaultValuesProvider) + function IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean; override; + end; + + { TcxCustomItemDataBinding } + + TcxCustomItemDataBinding = class(TcxOwnedPersistent) + private + FDefaultValuesProvider: TcxCustomEditDefaultValuesProvider; + FData: Pointer; + function GetDataController: TcxCustomDataController; + function GetEditContainer: TcxCustomInplaceEditContainer; + protected + function DefaultRepositoryItem: TcxEditRepositoryItem; virtual; + function GetDefaultCaption: string; virtual; + function GetDefaultValuesProvider(AProperties: TcxCustomEditProperties): IcxEditDefaultValuesProvider; virtual; + function GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; virtual; + function GetValueTypeClass: TcxValueTypeClass; virtual; + procedure Init; virtual; + function IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean; + procedure ValueTypeClassChanged; virtual; + property DataController: TcxCustomDataController read GetDataController; + property DefaultValuesProvider: TcxCustomEditDefaultValuesProvider read FDefaultValuesProvider; + property EditContainer: TcxCustomInplaceEditContainer read GetEditContainer; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + property Data: Pointer read FData write FData; + end; + + { TcxItemDataBinding } + + TcxItemDataBinding = class(TcxCustomItemDataBinding) + private + FValueTypeClass: TcxValueTypeClass; + function GetValueType: string; + procedure SetValueType(const Value: string); + procedure SetValueTypeClass(Value: TcxValueTypeClass); + protected + function GetValueTypeClass: TcxValueTypeClass; override; + function IsValueTypeStored: Boolean; virtual; + public + procedure Assign(Source: TPersistent); override; + property ValueTypeClass: TcxValueTypeClass read GetValueTypeClass write SetValueTypeClass; + published + property ValueType: string read GetValueType write SetValueType stored IsValueTypeStored; + end; + + { TcxControlDataController } + + TcxControlDataController = class(TcxDataController) + private + function GetControl: TcxEditingControl; + protected + procedure UpdateControl(AInfo: TcxUpdateControlInfo); override; + public + function GetItem(Index: Integer): TObject; override; + function GetItemID(AItem: TObject): Integer; override; + function GetItemValueSource(AItemIndex: Integer): TcxDataEditValueSource; override; + procedure UpdateData; override; + procedure UpdateItemIndexes; override; + end; + + { TcxCustomEditContainerItemOptions } + + TcxCustomEditContainerItemOptionsClass = class of TcxCustomEditContainerItemOptions; + + TcxCustomEditContainerItemOptions = class(TcxOwnedPersistent) + private + FCustomizing: Boolean; + FEditing: Boolean; + FFiltering: Boolean; + FFocusing: Boolean; + FIncSearch: Boolean; + FMoving: Boolean; + FShowEditButtons: TcxEditItemShowEditButtons; + FSorting: Boolean; + FTabStop: Boolean; + function GetEditContainer: TcxCustomInplaceEditContainer; + procedure SetEditing(Value: Boolean); + procedure SetFiltering(Value: Boolean); + procedure SetFocusing(Value: Boolean); + procedure SetIncSearch(Value: Boolean); + procedure SetShowEditButtons(Value: TcxEditItemShowEditButtons); + protected + procedure Changed; virtual; + property EditContainer: TcxCustomInplaceEditContainer read GetEditContainer; + property Moving: Boolean read FMoving write FMoving default True; + property Customizing: Boolean read FCustomizing write FCustomizing default True; + property Sorting: Boolean read FSorting write FSorting default True; + property Editing: Boolean read FEditing write SetEditing default True; + property Filtering: Boolean read FFiltering write SetFiltering default True; + property Focusing: Boolean read FFocusing write SetFocusing default True; + property IncSearch: Boolean read FIncSearch write SetIncSearch default True; + property ShowEditButtons: TcxEditItemShowEditButtons read FShowEditButtons + write SetShowEditButtons default eisbDefault; + property TabStop: Boolean read FTabStop write FTabStop default True; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(AOwner: TPersistent); override; + end; + + { TcxControlOptionsView } + + TcxControlOptionsViewClass = class of TcxControlOptionsView; + + TcxControlOptionsView = class(TcxOwnedPersistent) + private + FCellAutoHeight: Boolean; + FCellEndEllipsis: Boolean; + FCellTextMaxLineCount: Integer; + FShowEditButtons: TcxEditingControlEditShowButtons; + function GetEditingControl: TcxEditingControl; + function GetScrollBars: TScrollStyle; + procedure SetCellAutoHeight(const Value: Boolean); + procedure SetCellEndEllipsis(const Value: Boolean); + procedure SetCellTextMaxLineCount(const Value: Integer); + procedure SetScrollBars(const Value: TScrollStyle); + procedure SetShowEditButtons(const Value: TcxEditingControlEditShowButtons); + protected + procedure Changed; virtual; + property EditingControl: TcxEditingControl read GetEditingControl; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + published + property CellAutoHeight: Boolean read FCellAutoHeight write SetCellAutoHeight default False; + property CellEndEllipsis: Boolean read FCellEndEllipsis write SetCellEndEllipsis default False; + property CellTextMaxLineCount: Integer read FCellTextMaxLineCount write SetCellTextMaxLineCount default 0; + property ScrollBars: TScrollStyle read GetScrollBars write SetScrollBars default ssBoth; + property ShowEditButtons: TcxEditingControlEditShowButtons read FShowEditButtons write SetShowEditButtons default ecsbNever; + end; + + { TcxControlOptionsData } + + TcxControlOptionsDataClass = class of TcxControlOptionsData; + + TcxControlOptionsData = class(TcxOwnedPersistent) + private + FCancelOnExit: Boolean; + FEditing: Boolean; + function GetEditingControl: TcxEditingControl; + procedure SetEditing(Value: Boolean); + protected + procedure Changed; virtual; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + property EditingControl: TcxEditingControl read GetEditingControl; + published + property CancelOnExit: Boolean read FCancelOnExit write FCancelOnExit default True; + property Editing: Boolean read FEditing write SetEditing default True; + end; + + { TcxControlOptionsBehavior } + + TcxControlOptionsBehaviorClass = class of TcxControlOptionsBehavior; + + TcxControlOptionsBehavior = class(TcxOwnedPersistent) + private + FAlwaysShowEditor: Boolean; + FCellHints: Boolean; + FDragDropText: Boolean; + FFocusCellOnCycle: Boolean; + FFocusFirstCellOnNewRecord: Boolean; + FGoToNextCellOnEnter: Boolean; + FGoToNextCellOnTab: Boolean; + FImmediateEditor: Boolean; + FIncSearch: Boolean; + FIncSearchItem: TcxCustomInplaceEditContainer; + function GetEditingControl: TcxEditingControl; + procedure SetAlwaysShowEditor(Value: Boolean); + procedure SetCellHints(Value: Boolean); + procedure SetFocusCellOnCycle(Value: Boolean); + procedure SetFocusFirstCellOnNewRecord(Value: Boolean); + procedure SetGoToNextCellOnEnter(Value: Boolean); + procedure SetGoToNextCellOnTab(Value: Boolean); + procedure SetImmediateEditor(Value: Boolean); + procedure SetIncSearch(Value: Boolean); + procedure SetIncSearchItem(Value: TcxCustomInplaceEditContainer); + protected + procedure Changed; virtual; + property DragDropText: Boolean read FDragDropText write FDragDropText default False; + property EditingControl: TcxEditingControl read GetEditingControl; + property FocusCellOnCycle: Boolean read FFocusCellOnCycle write SetFocusCellOnCycle default False; + property FocusFirstCellOnNewRecord: Boolean read FFocusFirstCellOnNewRecord write SetFocusFirstCellOnNewRecord default False; + property IncSearch: Boolean read FIncSearch write SetIncSearch default False; + property IncSearchItem: TcxCustomInplaceEditContainer read FIncSearchItem write SetIncSearchItem; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + published + property AlwaysShowEditor: Boolean read FAlwaysShowEditor write SetAlwaysShowEditor default False; + property CellHints: Boolean read FCellHints write SetCellHints default False; + property GoToNextCellOnEnter: Boolean read FGoToNextCellOnEnter write SetGoToNextCellOnEnter default False; + property GoToNextCellOnTab: Boolean read FGoToNextCellOnTab write SetGoToNextCellOnTab default False; + property ImmediateEditor: Boolean read FImmediateEditor write SetImmediateEditor default True; + end; + + { TcxEditContainerStyles } + + TcxEditContainerStylesClass = class of TcxEditContainerStyles; + + TcxEditContainerStyles = class(TcxStyles) + private + function GetContainer: TcxCustomInplaceEditContainer; + function GetControl: TcxEditingControl; + function GetControlStyles: TcxCustomControlStyles; + protected + procedure Changed(AIndex: Integer); override; + public + procedure Assign(Source: TPersistent); override; + property Container: TcxCustomInplaceEditContainer read GetContainer; + property Control: TcxEditingControl read GetControl; + property ControlStyles: TcxCustomControlStyles read GetControlStyles; + published + property Content: TcxStyle index ecs_Content read GetValue write SetValue; + end; + + { TcxCustomInplaceEditContainer } + + IcxEditorPropertiesContainer = interface + ['{9F0CD5D9-A3D1-44B7-82DC-CAEAC1367C5D}'] + function GetProperties: TcxCustomEditProperties; + function GetPropertiesClass: TcxCustomEditPropertiesClass; + procedure SetPropertiesClass(Value: TcxCustomEditPropertiesClass); + end; + + TcxCustomInplaceEditContainer = class(TComponent, IUnknown, IcxEditRepositoryItemListener, IcxEditorPropertiesContainer) + private + FData: Pointer; + FEditData: TcxCustomEditData; + FEditingControl: TcxEditingControl; + FEditViewData: TcxCustomEditViewData; + FEditValueSource: TcxDataEditValueSource; + FItemIndex: Integer; + FOptions: TcxCustomEditContainerItemOptions; + FProperties: TcxCustomEditProperties; + FPropertiesClass: TcxCustomEditPropertiesClass; + FPropertiesEvents: TNotifyEvent; + FPropertiesValue: TcxCustomEditProperties; + FRepositoryItem: TcxEditRepositoryItem; + FStyles: TcxEditContainerStyles; + FOnGetEditProperties: TcxGetEditPropertiesEvent; + FOnGetEditingProperties: TcxGetEditPropertiesEvent; + procedure IcxEditRepositoryItemListener.PropertiesChanged = RepositoryItemPropertiesChanged; + procedure IcxEditRepositoryItemListener.ItemRemoved = RepositoryItemRemoved; + function GetDataController: TcxCustomDataController; + function GetFocused: Boolean; + function GetFocusedCellViewInfo: TcxEditCellViewInfo; + function GetIncSearching: Boolean; + function GetProperties: TcxCustomEditProperties; + function GetPropertiesClass: TcxCustomEditPropertiesClass; + function GetPropertiesClassName: string; + function GetPropertiesValue: TcxCustomEditProperties; + procedure SetDataBinding(Value: TcxCustomItemDataBinding); + procedure SetFocused(Value: Boolean); + procedure SetOptions(Value: TcxCustomEditContainerItemOptions); + procedure SetProperties(Value: TcxCustomEditProperties); + procedure SetPropertiesClass(Value: TcxCustomEditPropertiesClass); + procedure SetPropertiesClassName(const Value: string); + procedure SetRepositoryItem(Value: TcxEditRepositoryItem); + procedure SetStyles(Value: TcxEditContainerStyles); + procedure CreateProperties; + procedure DestroyProperties; + procedure RecreateProperties; + procedure RepositoryItemPropertiesChanged(Sender: TcxEditRepositoryItem); + procedure RepositoryItemRemoved(Sender: TcxEditRepositoryItem); + protected + FDataBinding: TcxCustomItemDataBinding; + procedure CalculateEditViewInfo(const AValue: Variant; + AEditViewInfo: TcxEditCellViewInfo; const APoint: TPoint); virtual; + function CanEdit: Boolean; virtual; + function CanFocus: Boolean; virtual; + procedure CancelIncSearching; + function CanInitEditing: Boolean; virtual; + function CanIncSearch: Boolean; virtual; + function CanTabStop: Boolean; virtual; + procedure Changed; virtual; + function CreateEditViewData(AProperties: TcxCustomEditProperties; AEditStyleData: Pointer): TcxCustomEditViewData; virtual; + procedure DataChanged; virtual; + procedure DoGetDisplayText(ARecordIndex: Integer; var AText: string); virtual; + function DoGetEditProperties(AData: Pointer): TcxCustomEditProperties; virtual; + procedure DoGetEditingProperties(AData: Pointer; var AProperties: TcxCustomEditProperties); virtual; + function DoGetPropertiesFromEvent(AEvent: TcxGetEditPropertiesEvent; AData: Pointer; + AProperties: TcxCustomEditProperties): TcxCustomEditProperties; virtual; + procedure DoOnPropertiesChanged(Sender: TObject); virtual; + procedure EditViewDataGetDisplayTextHandler(Sender: TcxCustomEditViewData; var AText: string); virtual; + function GetControlCanvas: TcxCanvas; virtual; + function GetController: TcxCustomControlController; virtual; + function GetCurrentValue: Variant; virtual; + function GetDataBindingClass: TcxItemDataBindingClass; virtual; + function GetDefaultEditProperties: TcxCustomEditProperties; virtual; + function GetDisplayValue(AProperties: TcxCustomEditProperties; ARecordIndex: Integer): Variant; virtual; + function GetEditDataValueTypeClass: TcxValueTypeClass; virtual; // todo: + function GetEditDefaultHeight(AFont: TFont): Integer; virtual; + function GetEditHeight(AEditViewInfo: TcxEditCellViewInfo): Integer; virtual; + function GetEditing: Boolean; virtual; + function GetEditStyle(AData: Pointer): TcxCustomEditStyle; virtual; + function GetEditValue: Variant; virtual; + function GetEditWidth(AEditViewInfo: TcxEditCellViewInfo): Integer; virtual; + function GetOptionsClass: TcxCustomEditContainerItemOptionsClass; virtual; + function GetStylesClass: TcxEditContainerStylesClass; virtual; + function GetValue(ARecordIndex: Integer): Variant; virtual; + function GetValueCount: Integer; virtual; + function HasDataTextHandler: Boolean; virtual; + procedure InitEditViewInfo(AEditViewInfo: TcxEditCellViewInfo); virtual; + procedure InitProperties(AProperties: TcxCustomEditProperties); virtual; + procedure InternalPropertiesChanged; + function IsDestroying: Boolean; + function IsEditPartVisible: Boolean; + procedure PropertiesChanged; virtual; + procedure SetCurrentValue(const Value: Variant); virtual; + procedure SetEditing(Value: Boolean); virtual; + procedure SetEditingControl(Value: TcxEditingControl); virtual; + procedure SetEditValue(const Value: Variant); virtual; + procedure SetValue(ARecordIndex: Integer; const Value: Variant); virtual; + property Controller: TcxCustomControlController read GetController; + property DataBinding: TcxCustomItemDataBinding read FDataBinding write SetDataBinding; + property DataController: TcxCustomDataController read GetDataController; // todo: should be protected + property IncSearching: Boolean read GetIncSearching; + property EditData: TcxCustomEditData read FEditData; + property Editing: Boolean read GetEditing write SetEditing; + property EditingControl: TcxEditingControl read FEditingControl write SetEditingControl; + property EditValue: Variant read GetEditValue write SetEditValue; + property EditValueSource: TcxDataEditValueSource read FEditValueSource; + property EditViewData: TcxCustomEditViewData read FEditViewData; + property Focused: Boolean read GetFocused write SetFocused; + property FocusedCellViewInfo: TcxEditCellViewInfo read GetFocusedCellViewInfo; + property Options: TcxCustomEditContainerItemOptions read FOptions write SetOptions; + property PropertiesValue: TcxCustomEditProperties read GetPropertiesValue; + property Value: Variant read GetCurrentValue write SetCurrentValue; + property ValueCount: Integer read GetValueCount; + property Values[ARecordIndex: Integer]: Variant read GetValue write SetValue; + property OnGetEditProperties: TcxGetEditPropertiesEvent read FOnGetEditProperties write FOnGetEditProperties; + property OnGetEditingProperties: TcxGetEditPropertiesEvent read FOnGetEditingProperties write FOnGetEditingProperties; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + property Data: Pointer read FData write FData; + property ItemIndex: Integer read FItemIndex; + property PropertiesClass: TcxCustomEditPropertiesClass read FPropertiesClass write SetPropertiesClass; + published + property PropertiesClassName: string read GetPropertiesClassName write SetPropertiesClassName; + property Properties: TcxCustomEditProperties read GetProperties write SetProperties; + property PropertiesEvents: TNotifyEvent read FPropertiesEvents write FPropertiesEvents; + property RepositoryItem: TcxEditRepositoryItem read FRepositoryItem write SetRepositoryItem; + property Styles: TcxEditContainerStyles read FStyles write SetStyles; + end; + + { IcxHotTrackElement } + + IcxHotTrackElement = interface + ['{E7171E58-276E-499B-9DDF-298D850883C9}'] + function GetOrigin: TPoint; + function IsNeedHint(ACanvas: TcxCanvas; const P: TPoint; + out AText: TCaption; + out AIsMultiLine: Boolean; + out ATextRect: TRect; var IsNeedOffsetHint: Boolean): Boolean; + procedure UpdateHotTrackState(const APoint: TPoint); + end; + + { TcxHotTrackController } + + TcxHotTrackController = class + private + FControl: TcxEditingControl; + FShowHint: Boolean; + procedure InternalHideHint(Sender: TObject); + procedure InternalShowHint(Sender: TObject); + procedure ResetTimer; + protected + Hint: TCaption; + HintIsMultiLine: Boolean; + HintTimer: TcxTimer; + HintRect: TRect; + HintVisible: Boolean; + HintElement: TObject; + HintWindow: THintWindow; + PrevHitPoint: TPoint; + PrevElement: TObject; + function CanShowHint: Boolean; + procedure CheckDestroyingElement(AElement: TObject); + procedure CheckHintClass; + procedure DoHideHint; virtual; + procedure DoShowHint; virtual; + function HintNeeded: Boolean; + procedure InitTimer(AInterval: Integer; AEnabled: Boolean; const AHandler: TNotifyEvent); + public + constructor Create(AControl: TcxEditingControl); virtual; + destructor Destroy; override; + procedure CancelHint; + procedure Clear; + procedure SetHotElement(AElement: TObject; const APoint: TPoint); + property Control: TcxEditingControl read FControl write FControl; + property ShowHint: Boolean read FShowHint write FShowHint; + end; + + { IcxDragSizing } + + IcxDragSizing = interface + ['{5EA02F4E-E367-4E4D-A26D-000B5E5CD434}'] + function CanSizing(ADirection: TcxDragSizingDirection): Boolean; + function GetSizingBoundsRect(ADirection: TcxDragSizingDirection): TRect; + function GetSizingIncrement(ADirection: TcxDragSizingDirection): Integer; + function IsDynamicUpdate: Boolean; + procedure SetSizeDelta(ADirection: TcxDragSizingDirection; ADelta: Integer); + end; + + { TcxSizingDragAndDropObject } + + TcxSizingDragAndDropObject = class(TcxDragAndDropObject) + private + FDelta: Integer; + FDirection: TcxDragSizingDirection; + FDragBounds: TRect; + FDragPos: TPoint; + FDynamicUpdate: Boolean; + FStartPos: TPoint; + FSizeDelta: Integer; + function GetCanvas: TcxCanvas; + function GetController: TcxCustomControlController; + function GetDragCoord(APoint: TPoint): Integer; + function GetDragItem: TObject; + function GetDragSizing: IcxDragSizing; + function GetIsSizingKind(Index: Integer): Boolean; + protected + procedure BeginDragAndDrop; override; + procedure DirtyChanged; override; + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); override; + procedure EndDragAndDrop(Accepted: Boolean); override; + function GetDragAndDropCursor(Accepted: Boolean): TCursor; override; + function GetDragPos(const APoint: TPoint): TPoint; virtual; + function GetImmediateStart: Boolean; override; + function GetSizingMarkBounds: TRect; virtual; + property StartPos: TPoint read FStartPos; + property Controller: TcxCustomControlController read GetController; + property Delta: Integer read FDelta; + property DragCoord[Point: TPoint]: Integer read GetDragCoord; + property DragPos: TPoint read FDragPos; + property DragSizing: IcxDragSizing read GetDragSizing; + property Direction: TcxDragSizingDirection read FDirection; + public + property Canvas: TcxCanvas read GetCanvas; + property DragBounds: TRect read FDragBounds; + property DragItem: TObject read GetDragItem; + property DynamicUpdate: Boolean read FDynamicUpdate; + property IsHorzSizing: Boolean index 0 read GetIsSizingKind; + property IsVertSizing: Boolean index 1 read GetIsSizingKind; + property SizeDelta: Integer read FSizeDelta; + end; + + { TcxAutoScrollingObject } + + TcxAutoScrollingObject = class + private + FArea: TRect; + FCode: TScrollCode; + FIncrement: Integer; + FKind: TScrollBarKind; + FOwner: TObject; + FTimer: TcxTimer; + protected + procedure DoScrollInspectingControl; virtual; + function GetControl: TcxEditingControl; virtual; + function GetScrollBar(AKind: TScrollBarKind): TcxControlScrollBar; virtual; + procedure TimerHandler(Sender: TObject); virtual; + public + constructor Create(AOwner: TObject); virtual; + destructor Destroy; override; + function Check(APos: TPoint): Boolean; + procedure SetParams(const Area: TRect; AKind: TScrollBarKind; + ACode: TScrollCode; AIncrement: Integer); + procedure Stop; + property Code: TScrollCode read FCode; + property Control: TcxEditingControl read GetControl; + property Increment: Integer read FIncrement; + property Kind: TScrollBarKind read FKind; + property Owner: TObject read FOwner; + property Timer: TcxTimer read FTimer; + end; + + { TcxDragDropAutoScrollingObject } + + TcxDragDropObjectAutoScrollingObject = class(TcxAutoScrollingObject) + protected + function GetControl: TcxEditingControl; override; + end; + + { TcxControllerAutoScrollingObject } + + TcxControllerAutoScrollingObject = class(TcxAutoScrollingObject) + private + FBoundsMode: Boolean; + FCheckHorz: Boolean; + FCheckVert: Boolean; + FDirections: TcxNeighbors; + protected + procedure DoScrollInspectingControl; override; + function GetControl: TcxEditingControl; override; + public + function CheckBounds(APos: TPoint): Boolean; + procedure SetBoundsParams(const AClientArea: TRect; + ACheckHorz, ACheckVert: Boolean; AIncrement: Integer); + end; + + TcxAutoScrollingObjectClass = class of TcxAutoScrollingObject; + + { TcxBaseDragAndDropObject } + + TcxBaseDragAndDropObject = class(TcxDragAndDropObject) + private + function GetEditingControl: TcxEditingControl; + protected + function GetDragAndDropCursor(Accepted: Boolean): TCursor; override; + property EditingControl: TcxEditingControl read GetEditingControl; + end; + + { TcxDragImage } + + TcxDragImage = class(cxControls.TcxDragImage) + public + property Image; + property WindowCanvas; + end; + + { TcxPlaceArrows } + + TcxPlaceArrows = class(TcxDragImage) + private + FBorderColor: TColor; + FColor: TColor; + FPrevRect: TRect; + FPrevSide: TcxBorder; + FWindowRegion: HRGN; + procedure SetWindowRegion(ARegion: HRGN); + protected + function CreateArrowsRgns(const ARect: TRect; ASide: TcxBorder): HRGN; + + property BorderColor: TColor read FBorderColor; + property Color: TColor read FColor; + property WindowRegion: HRGN read FWindowRegion write SetWindowRegion; + public + constructor CreateArrows(AColor: TColor; ABorderColor: TColor = clDefault); virtual; + function MoveTo(ARect: TRect; ASide: TcxBorder): Boolean; + end; + + { TcxCustomControlDragAndDropObject } + + TcxCustomControlDragAndDropObject = class(TcxBaseDragAndDropObject) + private + FAutoScrollObjects: TList; + FCanDrop: Boolean; + FDragImage: TcxDragImage; + FHotSpot: TPoint; + FOrgOffset: TPoint; + FPictureSize: TRect; + function CheckScrolling(const P: TPoint): Boolean; + function GetAutoScrollObject(Index: Integer): TcxAutoScrollingObject; + function GetAutoScrollObjectCount: Integer; + function GetCanvas: TcxCanvas; + function GetHitTestController: TcxCustomHitTestController; + protected + procedure AddAutoScrollingObject(const ARect: TRect; AKind: TScrollBarKind; ACode: TScrollCode); + procedure BeginDragAndDrop; override; + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); override; + procedure DrawDragImage; virtual; + procedure DrawImage(const APoint: TPoint); + procedure EndDragAndDrop(Accepted: Boolean); override; + function GetAcceptedRect: TRect; virtual; + function GetAutoScrollingObjectClass: TcxAutoScrollingObjectClass; virtual; + function GetDisplayRect: TRect; virtual; + function GetDragAndDropCursor(Accepted: Boolean): TCursor; override; + function GetHorzScrollInc: Integer; virtual; + function GetVertScrollInc: Integer; virtual; + procedure OwnerImageChanged; virtual; + procedure OwnerImageChanging; virtual; + procedure Paint; virtual; + procedure StopScrolling; + // screen image working + property AcceptedRect: TRect read GetAcceptedRect; + property AutoScrollObjectCount: Integer read GetAutoScrollObjectCount; + property AutoScrollObjects[Index: Integer]: TcxAutoScrollingObject read GetAutoScrollObject; + property Canvas: TcxCanvas read GetCanvas; + property CanDrop: Boolean read FCanDrop; + property DisplayRect: TRect read GetDisplayRect; + property DragImage: TcxDragImage read FDragImage; + property HitTestController: TcxCustomHitTestController read GetHitTestController; + property HotSpot: TPoint read FHotSpot; + property OrgOffset: TPoint read FOrgOffset; + property PictureSize: TRect read FPictureSize; + public + constructor Create(AControl: TcxControl); override; + destructor Destroy; override; + end; + + { TcxDragImageHelper } + + TcxDragImageHelperClass = class of TcxDragImageHelper; + + TcxDragImageHelper = class + private + FDragControl: TcxEditingControl; + FDragImageVisible: Boolean; + FDragPos: TPoint; + function GetImageRect: TRect; + procedure SetDragImageVisible(Value: Boolean); + protected + DragImage: TcxDragImage; + HotSpot: TPoint; + DragPictureBounds: TRect; + MousePos: TPoint; + procedure DragAndDrop(const P: TPoint); virtual; + function GetDisplayRect: TRect; virtual; + procedure InitDragImage; virtual; + // working with screen + procedure DrawImage(const APoint: TPoint); virtual; + public + constructor Create(AControl: TcxEditingControl; ADragPos: TPoint); virtual; + destructor Destroy; override; + procedure Hide; virtual; + procedure Show; virtual; + + property DragControl: TcxEditingControl read FDragControl; + property DragImageRect: TRect read GetImageRect; + property DragImageVisible: Boolean read FDragImageVisible write SetDragImageVisible; + end; + + { TcxCustomHitTestController } + + TcxHitTestControllerClass = class of TcxCustomHitTestController; + + TcxCustomHitTestController = class + private + FController: TcxCustomControlController; + FHitPoint: TPoint; + FHitTestItem: TObject; + FShift: TShiftState; + function GetControl: TcxEditingControl; + function GetCoordinate(AIndex: Integer): Integer; + function GetEditCellViewInfo: TcxEditCellViewInfo; + function GetHasCode(Mask: TcxHitCode): Boolean; + function GetHotTrackController: TcxHotTrackController; + function GetIsItemEditCell: Boolean; + function GetIsMouseEvent: Boolean; + function GetViewInfo: TcxCustomControlViewInfo; + procedure SetCoordinate(AIndex: Integer; Value: Integer); + procedure SetHasCode(ACode: TcxHitCode; AValue: Boolean); + procedure SetHitPoint(const APoint: TPoint); + procedure SetHitTestItem(AItem: TObject); + procedure SetIsMouseEvent(Value: Boolean); + protected + FHitState: TcxHitCode; + function AllowDesignMouseEvents(X, Y: Integer; AShift: TShiftState): Boolean; virtual; + procedure ClearState; + procedure DestroyingItem(AItem: TObject); + procedure DoCalculate; virtual; + function GetCurrentCursor: TCursor; virtual; + procedure HitCodeChanged(APrevCode: Integer); virtual; + procedure HitTestItemChanged(APrevHitTestItem: TObject); virtual; + procedure RecalculateOnMouseEvent(X, Y: Integer; AShift: TShiftState); + property Control: TcxEditingControl read GetControl; + property Controller: TcxCustomControlController read FController; + property HotTrackController: TcxHotTrackController read GetHotTrackController; + property IsMouseEvent: Boolean read GetIsMouseEvent write SetIsMouseEvent; + property Shift: TShiftState read FShift; + property ViewInfo: TcxCustomControlViewInfo read GetViewInfo; + public + constructor Create(AOwner: TcxCustomControlController); virtual; + destructor Destroy; override; + procedure ReCalculate; overload; + procedure ReCalculate(const APoint: TPoint); overload; + property EditCellViewInfo: TcxEditCellViewInfo read GetEditCellViewInfo; + property HitPoint: TPoint read FHitPoint write SetHitPoint; + property HitX: Integer index 0 read GetCoordinate write SetCoordinate; + property HitY: Integer index 1 read GetCoordinate write SetCoordinate; + property HitState: TcxHitCode read FHitState; + property HitCode[ACode: TcxHitCode]: Boolean read GetHasCode write SetHasCode; + property HitTestItem: TObject read FHitTestItem write SetHitTestItem; + property IsItemEditCell: Boolean read GetIsItemEditCell; + end; + + { TcxCustomCellNavigator } + + TcxCustomCellNavigator = class + private + FController: TcxCustomControlController; + FEatKeyPress: Boolean; + FDownOnEnter: Boolean; + FDownOnTab: Boolean; + function GetDataController: TcxCustomDataController; + protected + RowCount: Integer; + function SelectCell(AForward, ANextRow: Boolean; + var ARowIndex, ACellIndex: Integer): TcxCustomInplaceEditContainer; virtual; + + procedure CalcNextRow(AForward: Boolean; var ARowIndex, ACellIndex: Integer); virtual; + function GetCellContainer(ARowIndex, ACellIndex: Integer): TcxCustomInplaceEditContainer; virtual; + function GetCount(ARowIndex: Integer): Integer; virtual; + procedure Init(var ARowIndex, ACellIndex, ARowCount: Integer); virtual; + function MayFocusedEmptyRow(ARowIndex: Integer): Boolean; virtual; + procedure SetFocusCell(ARowIndex, ACellIndex: Integer; AShift: TShiftState); virtual; + procedure DoKeyPress(var Key: Char); virtual; + property DownOnEnter: Boolean read FDownOnEnter write FDownOnEnter; + property DownOnTab: Boolean read FDownOnTab write FDownOnTab; + public + constructor Create(AController: TcxCustomControlController); virtual; + procedure FocusNextCell(AForward, ANextRow: Boolean; AShift: TShiftState = []); virtual; + procedure KeyDown(var Key: Word; Shift: TShiftState); virtual; + procedure KeyPress(var Key: Char); virtual; + procedure Refresh; virtual; + property Count[ARowIndex: Integer]: Integer read GetCount; + property Controller: TcxCustomControlController read FController; + property DataController: TcxCustomDataController read GetDataController; + property EatKeyPress: Boolean read FEatKeyPress write FEatKeyPress; + end; + + TcxCustomCellNavigatorClass = class of TcxCustomCellNavigator; + + { TcxDesignSelectionHelper } + + TcxCustomDesignSelectionHelper = class + private + FControl: TcxEditingControl; + function GetController: TcxCustomControlController; + protected + property Control: TcxEditingControl read FControl; + property Controller: TcxCustomControlController read GetController; + public + constructor Create(AControl: TcxEditingControl); virtual; + function IsObjectSelected(AObject: TPersistent): Boolean; virtual; abstract; + procedure Select(AObject: TPersistent; AShift: TShiftState); virtual; abstract; + procedure UnselectObject(AObject: TPersistent); virtual; abstract; + end; + + TcxCustomDesignSelectionHelperClass = class of TcxCustomDesignSelectionHelper; + + { TcxCustomControlController } + + TcxCustomControlController = class + private + FAllowCheckEdit: Boolean; + FBlockRecordKeyboardHandling: Boolean; + FCheckEditNeeded: Boolean; + FDisableCellsRefresh: Boolean; + FDragCancel: Boolean; + FDragItem: TObject; + FEatKeyPress: Boolean; + FEditingBeforeDrag: Boolean; + FEditingController: TcxEditingController; + FEditingControl: TcxEditingControl; + FFocused: Boolean; + FFocusedItem: TcxCustomInplaceEditContainer; + FHitTestController: TcxCustomHitTestController; + FHotTrackController: TcxHotTrackController; + FIsDblClick: Boolean; + FIsHandleTabStop: Boolean; + FLockShowHint: Boolean; + FNavigator: TcxCustomCellNavigator; + FWasFocusedBeforeClick: Boolean; + function GetDataController: TcxCustomDataController; + function GetDesignSelectionHelper: TcxCustomDesignSelectionHelper; + function GetEditingItem: TcxCustomInplaceEditContainer; + function GetIsEditing: Boolean; + function GetItemForIncSearching: TcxCustomInplaceEditContainer; + procedure SetEditingItem(Value: TcxCustomInplaceEditContainer); + procedure SetIncSearchingText(const Value: string); + protected + procedure MouseEnter; virtual; + procedure MouseLeave; virtual; + procedure DoCancelMode; virtual; + + procedure AfterPaint; virtual; + procedure BeforeEditKeyDown(var Key: Word; var Shift: TShiftState); virtual; + procedure BeforeMouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); virtual; + procedure BeforePaint; virtual; + procedure BeforeShowEdit; virtual; + procedure BehaviorChanged; virtual; + procedure CancelCheckEditPost; + function CanFocusedRecordIndex(AIndex: Integer): Boolean; virtual; + procedure CheckEdit; virtual; + procedure DoEditDblClick(Sender: TObject); virtual; + procedure DoMouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); virtual; + procedure DoMouseMove(Shift: TShiftState; X, Y: Integer); virtual; + procedure DoMouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); virtual; + procedure DoNextPage(AForward: Boolean; Shift: TShiftState); virtual; + function GetEditingViewInfo: TcxEditCellViewInfo; virtual; + function GetFocused: Boolean; virtual; + function GetFocusedCellViewInfo(AEditContainer: TcxCustomInplaceEditContainer): TcxEditCellViewInfo; virtual; + function GetFocusedRecordIndex: Integer; virtual; + function GetResizeDirection: TcxDragSizingDirection; virtual; + procedure FocusedItemChanged(APrevFocusedItem: TcxCustomInplaceEditContainer); virtual; + procedure FocusedRecordChanged(APrevFocusedRecordIndex, AFocusedRecordIndex: Integer); virtual; + function HasFocusedControls: Boolean; virtual; + procedure HideHint; virtual; + function IncSearchKeyDown(AKey: Word; AShift: TShiftState): Word; virtual; + procedure InternalSetFocusedItem(Value: TcxCustomInplaceEditContainer); + function IsImmediatePost: Boolean; virtual; + function IsKeyForController(AKey: Word; AShift: TShiftState): Boolean; virtual; + procedure PostCheckEdit; + procedure PostShowEdit; + procedure ProcessCheckEditPost; + procedure RefreshFocusedCellViewInfo(AItem: TcxCustomInplaceEditContainer); virtual; + procedure RefreshFocusedRecord; virtual; + procedure SetFocused(Value: Boolean); virtual; + procedure SetFocusedItem(Value: TcxCustomInplaceEditContainer); virtual; + procedure SetFocusedRecordIndex(Value: Integer); virtual; + // behavior options + function GetAlwaysShowEditor: Boolean; virtual; + function GetCancelEditingOnExit: Boolean; virtual; + function GetFocusCellOnCycle: Boolean; virtual; + function GetGoToNextCellOnEnter: Boolean; virtual; + function GetGoToNextCellOnTab: Boolean; virtual; + function GetImmediateEditor: Boolean; virtual; + // drag'n'drop + procedure BeforeStartDrag; virtual; + function CanDrag(X, Y: Integer): Boolean; virtual; + procedure DragDrop(Source: TObject; X, Y: Integer); virtual; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); virtual; + procedure EndDrag(Target: TObject; X, Y: Integer); virtual; + function GetDragAndDropObject: TcxCustomControlDragAndDropObject; + function GetDragAndDropObjectClass: TcxDragAndDropObjectClass; virtual; + function GetIsDragging: Boolean; virtual; + function GetNavigatorClass: TcxCustomCellNavigatorClass; virtual; + procedure StartDrag(var DragObject: TDragObject); virtual; + // scrolling + function GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; virtual; + function IsPixelScrollBar(AKind: TScrollBarKind): Boolean; virtual; + // focus + procedure DoEnter; virtual; + procedure DoExit; virtual; + function MayFocus: Boolean; virtual; + procedure FocusChanged; virtual; + procedure RemoveFocus; virtual; + procedure SetFocus; virtual; + // incremental search + procedure CancelIncSearching; virtual; + function GetIncSearchingItem: TcxCustomInplaceEditContainer; virtual; + function GetIncSearchingText: string; virtual; + function GetIsIncSearching: Boolean; virtual; + procedure SearchLocate(AItem: TcxCustomInplaceEditContainer; const Value: string); virtual; + procedure SearchLocateNext(AItem: TcxCustomInplaceEditContainer; AForward: Boolean); virtual; + procedure UpdateRecord(ARecordIndex: Integer); virtual; + property AllowCheckEdit: Boolean read FAllowCheckEdit write FAllowCheckEdit; + property BlockRecordKeyboardHandling: Boolean read FBlockRecordKeyboardHandling + write FBlockRecordKeyboardHandling; + property DesignSelectionHelper: TcxCustomDesignSelectionHelper read GetDesignSelectionHelper; + property DisableCellsRefresh: Boolean read FDisableCellsRefresh write FDisableCellsRefresh; + property DragAndDropObject: TcxCustomControlDragAndDropObject read GetDragAndDropObject; + property DragCancel: Boolean read FDragCancel write FDragCancel; + property DragItem: TObject read FDragItem write FDragItem; + property EatKeyPress: Boolean read FEatKeyPress write FEatKeyPress; + property EditingControl: TcxEditingControl read FEditingControl; + property EditingController: TcxEditingController read FEditingController; + property EditingItem: TcxCustomInplaceEditContainer read GetEditingItem write SetEditingItem; + property EditingViewInfo: TcxEditCellViewInfo read GetEditingViewInfo; + property HotTrackController: TcxHotTrackController read FHotTrackController; + property HitTestController: TcxCustomHitTestController read FHitTestController; + property IncSearchingText: string read GetIncSearchingText write SetIncSearchingText; + property IncSearchingItem: TcxCustomInplaceEditContainer read GetIncSearchingItem; + property IsHandleTabStop: Boolean read FIsHandleTabStop write FIsHandleTabStop; + property IsDragging: Boolean read GetIsDragging; + property IsIncSearching: Boolean read GetIsIncSearching; + property ItemForIncSearching: TcxCustomInplaceEditContainer read GetItemForIncSearching; + property LockShowHint: Boolean read FLockShowHint write FLockShowHint; + property Navigator: TcxCustomCellNavigator read FNavigator; + property WasFocusedBeforeClick: Boolean read FWasFocusedBeforeClick; + public + constructor Create(AOwner: TcxEditingControl); reintroduce; virtual; + destructor Destroy; override; + procedure Clear; virtual; + procedure ControlFocusChanged; virtual; + procedure DblClick; virtual; + function GetCursor(X, Y: Integer): TCursor; virtual; + procedure KeyDown(var Key: Word; Shift: TShiftState); virtual; + procedure KeyPress(var Key: Char); virtual; + procedure KeyUp(var Key: Word; Shift: TShiftState); virtual; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); virtual; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); virtual; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); virtual; + procedure Reset; + procedure WndProc(var Message: TMessage); virtual; + // drag'n'drop + procedure BeginDragAndDrop; virtual; + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); virtual; + procedure EndDragAndDrop(Accepted: Boolean); virtual; + function StartDragAndDrop(const P: TPoint): Boolean; virtual; + // scrolling + procedure InitScrollBarsParameters; virtual; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); virtual; + procedure SetFocusedRecordItem(ARecordIndex: Integer; + AItem: TcxCustomInplaceEditContainer); virtual; + procedure SetScrollBarInfo(AScrollBarKind: TScrollBarKind; + AMin, AMax, AStep, APage, APos: Integer; AAllowShow, AAllowHide: Boolean); + + procedure MakeFocusedItemVisible; virtual; + procedure MakeFocusedRecordVisible; virtual; + + property DataController: TcxCustomDataController read GetDataController; + property Focused: Boolean read GetFocused write SetFocused; + property FocusedItem: TcxCustomInplaceEditContainer read FFocusedItem write SetFocusedItem; + property FocusedRecordIndex: Integer read GetFocusedRecordIndex write SetFocusedRecordIndex; + + property IsDblClick: Boolean read FIsDblClick; + property IsEditing: Boolean read GetIsEditing; + end; + + { TcxEditingController } + + TcxEditingController = class + private + FController: TcxCustomControlController; + FEdit: TcxCustomEdit; + FEditHiding: Boolean; + FEditingItem: TcxCustomInplaceEditContainer; + FEditingItemSetting: Boolean; + FEditList: TcxInplaceEditList; + FEditPreparing: Boolean; + FEditShowingTimer: TcxTimer; + FEditShowingTimerItem: TcxCustomInplaceEditContainer; + FEditUpdateNeeded: Boolean; + FInitiatingEditing: Boolean; + FIsEditPlaced: Boolean; + FIsErrorOnEditExit: Boolean; + FPrevEditOnChange: TNotifyEvent; + FPrevEditOnEditValueChanged: TNotifyEvent; + function GetEditingControl: TcxEditingControl; + function GetEditingProperties: TcxCustomEditProperties; + function GetIsDragging: Boolean; + function GetIsEditing: Boolean; + procedure SetEditingItem(Value: TcxCustomInplaceEditContainer); + procedure EditShowingTimerHandler(Sender: TObject); + protected + procedure AfterViewInfoCalculate; virtual; + procedure BeforeViewInfoCalculate; virtual; + procedure CancelEditUpdatePost; + function CanRemoveEditFocus: Boolean; virtual; + procedure CheckEditUpdatePost; + procedure AssignEditEvents; virtual; + procedure UnassignEditEvents; virtual; + procedure DoUpdateEdit; + function GetHideEditOnExit: Boolean; virtual; + function GetHideEditOnFocusedRecordChange: Boolean; virtual; + procedure HideInplaceEditor; + procedure InitEdit; virtual; + function PrepareEdit(AItem: TcxCustomInplaceEditContainer; AIsMouseEvent: Boolean): Boolean; virtual; + procedure UpdateEdit; + procedure UpdateEditValue; + procedure UpdateValue; + + procedure EditAfterKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); virtual; + procedure EditChanged(Sender: TObject); virtual; + procedure EditDblClick(Sender: TObject); virtual; + procedure EditEditing(Sender: TObject; var CanEdit: Boolean); virtual; + procedure EditEnter(Sender: TObject); virtual; + procedure EditExit(Sender: TObject); virtual; + procedure EditFocusChanged(Sender: TObject); virtual; + procedure EditKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); virtual; + procedure EditKeyPress(Sender: TObject; var Key: Char); virtual; + procedure EditKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); virtual; + procedure EditPostEditValue(Sender: TObject); virtual; + procedure EditValueChanged(Sender: TObject); virtual; + + property Controller: TcxCustomControlController read FController; + property EditingControl: TcxEditingControl read GetEditingControl; + property EditHiding: Boolean read FEditHiding write FEditHiding; + property EditingProperties: TcxCustomEditProperties read GetEditingProperties; + property EditList: TcxInplaceEditList read FEditList; + property EditUpdateNeeded: Boolean read FEditUpdateNeeded; + property HideEditOnExit: Boolean read GetHideEditOnExit; + property HideEditOnFocusedRecordChange: Boolean read GetHideEditOnFocusedRecordChange; + property InitiatingEditing: Boolean read FInitiatingEditing; + property IsEditPlaced: Boolean read FIsEditPlaced; + property IsErrorOnEditExit: Boolean read FIsErrorOnEditExit write FIsErrorOnEditExit; + public + constructor Create(AController: TcxCustomControlController); virtual; + destructor Destroy; override; + procedure HideEdit(Accept: Boolean); virtual; + procedure PostEditUpdate; + procedure RemoveEdit(AProperties: TcxCustomEditProperties); virtual; + procedure ShowEdit(AItem: TcxCustomInplaceEditContainer = nil); overload; + procedure ShowEdit(AItem: TcxCustomInplaceEditContainer; Key: Char); overload; + procedure ShowEdit(AItem: TcxCustomInplaceEditContainer; Shift: TShiftState; X, Y: Integer); overload; + + procedure StartEditShowingTimer(AItem: TcxCustomInplaceEditContainer); + procedure StopEditShowingTimer; + + property Edit: TcxCustomEdit read FEdit; + property EditingItem: TcxCustomInplaceEditContainer read FEditingItem write SetEditingItem; + property IsDragging: Boolean read GetIsDragging; + property IsEditing: Boolean read GetIsEditing; + end; + + { TcxCustomControlViewInfo } + + TcxCustomControlViewInfo = class + private + FControl: TcxEditingControl; + FClientRect: TRect; + FDefaultEditHeight: Integer; + FEditCellViewInfoList: TList; + FPainter: TcxCustomControlPainter; + FState: Integer; + function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; + function GetState(AMask: Integer): Boolean; + procedure SetState(AMask: Integer; Value: Boolean); + procedure UpdateSelectionParams; + protected + Brush: TBrush; + SelectionBrush: TBrush; + SelectionParams: TcxViewParams; + function AddEditCellViewInfo(AViewInfoClass: TcxEditCellViewInfoClass; + AEditContainer: TcxCustomInplaceEditContainer): TcxEditCellViewInfo; + function CalculateDefaultEditHeight: Integer; virtual; + procedure CalculateDefaultHeights; virtual; + procedure ClearEditCellViewInfos; + procedure CreatePainter; virtual; + procedure DoCalculate; virtual; + procedure RemoveEditCellViewInfo(AViewInfo: TcxEditCellViewInfo); + procedure UpdateSelection; virtual; + property IsDirty: Boolean index cvis_IsDirty read GetState write SetState; + property State[AMask: Integer]: Boolean read GetState write SetState; + public + ViewParams: TcxViewParams; + constructor Create(AOwner: TcxEditingControl); virtual; + destructor Destroy; override; + + procedure Calculate; + procedure Invalidate(ARecalculate: Boolean = False); virtual; + property ClientRect: TRect read FClientRect; + property Control: TcxEditingControl read FControl; + property DefaultEditHeight: Integer read FDefaultEditHeight; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter; + property Painter: TcxCustomControlPainter read FPainter write FPainter; + end; + + TcxCustomControlViewInfoClass = class of TcxCustomControlViewInfo; + + { TcxCustomViewInfoItem } + + TcxCustomViewInfoItem = class + private + FOwner: TObject; + function GetControlViewInfo: TcxCustomControlViewInfo; + function GetPainterClass: TcxCustomLookAndFeelPainterClass; + protected + ItemViewParams: TcxViewParams; + ItemVisible: Boolean; + ClipRect: TRect; + DisplayRect: TRect; + procedure CheckClipping(const ADisplayRect, AAvailableRect: TRect); overload; virtual; + procedure CheckClipping(const ADisplayRect: TRect); overload; virtual; + procedure DoCalculate; virtual; + procedure DoHorzOffset(AShift: Integer); virtual; + procedure DoVertOffset(AShift: Integer); virtual; + function GetControl: TcxEditingControl; virtual; + function IsTransparent: Boolean; virtual; + procedure UpdateEditRect; + property Owner: TObject read FOwner; + property ControlViewInfo: TcxCustomControlViewInfo read GetControlViewInfo; + public + constructor Create(AOwner: TObject); virtual; + procedure Assign(Source: TcxCustomViewInfoItem); virtual; + procedure Invalidate(ARecalculate: Boolean = False); + property BoundsRect: TRect read DisplayRect; + property Control: TcxEditingControl read GetControl; + property LookAndFeelPainterClass: TcxCustomLookAndFeelPainterClass read GetPainterClass; + property Visible: Boolean read ItemVisible; + property VisibleRect: TRect read ClipRect; + property ViewParams: TcxViewParams read ItemViewParams; + end; + + { TcxEditCellViewInfo } + + TcxEditCellViewInfo = class(TcxCustomViewInfoItem, IUnknown, IcxHotTrackElement) + private + function GetTransparent: Boolean; + procedure SetTransparent(Value: Boolean); + protected + CellEditRect: TRect; + CellHeight: Integer; + CellValue: Variant; + CellContentRect: TRect; + CellBorders: TcxBorders; + IsViewDataCreated: Boolean; + Properties: TcxCustomEditProperties; + ViewInfo: TcxCustomEditViewInfo; + ViewData: TcxCustomEditViewData; + // IUnknown + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + // IcxHotTrackElement + function GetOrigin: TPoint; + function IsNeedHint(ACanvas: TcxCanvas; const P: TPoint; + out AText: TCaption; + out AIsMultiLine: Boolean; + out ATextRect: TRect; var IsNeedOffsetHint: Boolean): Boolean; virtual; + procedure UpdateHotTrackState(const APoint: TPoint); virtual; + function CalculateEditHeight: Integer; + function CalculateEditWidth: Integer; + function ChangedHeight(APrevHeight, ANewHeight: Integer): Boolean; virtual; + procedure CheckClipping(const ADisplayRect, AAvailableRect: TRect); override; + function ContentOffset: TRect; virtual; + procedure DoCalculate; override; + function GetButtonTransparency: TcxEditButtonTransparency; virtual; + function GetControl: TcxEditingControl; override; + function GetDisplayValue: Variant; virtual; + function GetEditContainer: TcxCustomInplaceEditContainer; virtual; + function GetEditViewParams: TcxViewParams; virtual; + function GetFocused: Boolean; virtual; + function GetInplaceEditPosition: TcxInplaceEditPosition; + function GetMaxLineCount: Integer; virtual; + function GetRecordIndex: Integer; virtual; + function GetSelectedTextColor: Integer; virtual; + function GetSelectedBKColor: Integer; virtual; + function GetViewInfoData: Pointer; virtual; + function IsAutoHeight: Boolean; virtual; + function IsEndEllipsis: Boolean; virtual; + function IsSupportedHotTrack: Boolean; virtual; + procedure SetBounds(const ABounds: TRect; const ADisplayRect: TRect); + property EditContainer: TcxCustomInplaceEditContainer read GetEditContainer; + property EditRect: TRect read CellEditRect; + public + destructor Destroy; override; + procedure Assign(Source: TcxCustomViewInfoItem); override; + // IUnknown + function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall; + + function Refresh(ARecalculate: Boolean): Boolean; virtual; + property Borders: TcxBorders read CellBorders; + property ContentRect: TRect read CellContentRect; + property DisplayValue: Variant read CellValue; + property EditViewInfo: TcxCustomEditViewInfo read ViewInfo; + property Focused: Boolean read GetFocused; + property MaxLineCount: Integer read GetMaxLineCount; + property RecordIndex: Integer read GetRecordIndex; + property Transparent: Boolean read GetTransparent write SetTransparent; + property BoundsRect; + property Control; + property ViewParams; + property VisibleRect; + end; + + { TcxCustomControlPainter } + + TcxCustomDrawViewInfoItemEvent = procedure(Sender: TObject; Canvas: TcxCanvas; + AViewInfo: TcxCustomViewInfoItem; var ADone: Boolean) of object; + + TcxCustomControlPainter = class + private + FSaveViewParams: TcxViewParams; + FBitmap: TBitmap; + FBitmapCanvas: TcxCanvas; + FBuffered: Boolean; + FControl: TcxEditingControl; + function GetPainter: TcxCustomLookAndFeelPainterClass; + function GetViewInfo: TcxCustomControlViewInfo; + procedure SetBuffered(Value: Boolean); + protected + FCanvas: TcxCanvas; + procedure AfterCustomDraw(AViewInfo: TcxCustomViewInfoItem); overload; virtual; + procedure BeforeCustomDraw(AViewInfo: TcxCustomViewInfoItem); overload; virtual; + function DoCustomDraw(AViewInfoItem: TcxCustomViewInfoItem; + AEvent: TcxCustomDrawViewInfoItemEvent): Boolean; + procedure DoPaintEditCell(ACellViewInfo: TcxEditCellViewInfo; AIsExcludeRect: Boolean = True); virtual; + procedure DoPaint; virtual; + public + constructor Create(AOwner: TcxEditingControl); virtual; + destructor Destroy; override; + procedure Paint; + property Buffered: Boolean read FBuffered write SetBuffered; + property Canvas: TcxCanvas read FCanvas; + property Control: TcxEditingControl read FControl; + property Painter: TcxCustomLookAndFeelPainterClass read GetPainter; + property ViewInfo: TcxCustomControlViewInfo read GetViewInfo; + end; + + TcxCustomControlPainterClass = class of TcxCustomControlPainter; + + { TcxCustomControlStyles } + + TcxCustomControlStylesClass = class of TcxCustomControlStyles; + + TcxCustomControlStyles = class(TcxStyles) + private + FDefaultStyle: TcxStyle; + FOnGetContentStyle: TcxOnGetContentStyleEvent; + function GetControl: TcxEditingControl; + function GetPainter: TcxCustomLookAndFeelPainterClass; + protected + procedure Changed(AIndex: Integer); override; + function GetDefaultStyle(Index: Integer; AData: Pointer): TcxStyle; + procedure GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); override; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function GetBackgroundParams: TcxViewParams; + function GetSelectionParams: TcxViewParams; + property Control: TcxEditingControl read GetControl; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetPainter; + published + property Background: TcxStyle index ecs_Background read GetValue write SetValue; + property Content: TcxStyle index ecs_Content read GetValue write SetValue; + property Inactive: TcxStyle index ecs_Inactive read GetValue write SetValue; + property Selection: TcxStyle index ecs_Selection read GetValue write SetValue; + property OnGetContentStyle: TcxOnGetContentStyleEvent read FOnGetContentStyle write FOnGetContentStyle; + property StyleSheet; + end; + + { TcxEditingControl } + + IcxEditingControlOptions = interface + ['{6A041541-53E2-413B-8377-0D249356B5DF}'] + function GetOptionsBehavior: TcxControlOptionsBehavior; + function GetOptionsData: TcxControlOptionsData; + function GetOptionsView: TcxControlOptionsView; + property OptionsBehavior: TcxControlOptionsBehavior read GetOptionsBehavior; + property OptionsData: TcxControlOptionsData read GetOptionsData; + property OptionsView: TcxControlOptionsView read GetOptionsView; + end; + + TcxecEditingEvent = procedure(Sender, AItem: TObject; var Allow: Boolean) of object; + TcxecInitEditEvent = procedure(Sender, AItem: TObject; AEdit: TcxCustomEdit) of object; + TcxecItemEvent = procedure(Sender: TObject; AItem: TcxCustomInplaceEditContainer) of object; + + TcxEditingControl = class(TcxControl, IcxMouseTrackingCaller) + private + FBrushCache: TcxBrushCache; + FChangesCount: Integer; + FContainerList: TList; + FDesignSelectionHelper: TcxCustomDesignSelectionHelper; + FDragHelper: TcxDragImageHelper; + FDragPos: TPoint; + FEditStyle: TcxCustomEditStyle; + FIsLayoutChanged: Boolean; + FStyles: TcxCustomControlStyles; + FViewInfo: TcxCustomControlViewInfo; + FOnCustomDrawCell: TcxCustomDrawViewInfoItemEvent; + FOnEditChanged: TcxecItemEvent; + FOnEdited: TcxecItemEvent; + FOnEditing: TcxecEditingEvent; + FOnEditValueChanged: TcxecItemEvent; + FOnInitEdit: TcxecInitEditEvent; + procedure IcxMouseTrackingCaller.MouseLeave = DoMouseLeave; + function GetBufferedPaint: Boolean; + function GetPainter: TcxCustomControlPainter; + procedure DoMouseLeave; + procedure SetBufferedPaint(Value: Boolean); + procedure SetEditStyle(Value: TcxCustomEditStyle); + procedure SetStyles(Value: TcxCustomControlStyles); + procedure WMCancelMode(var Message: TWMCancelMode); message WM_CANCELMODE; + procedure WMSetCursor(var Message: TWMSetCursor); message WM_SetCursor; + protected + FController: TcxCustomControlController; + FDataController: TcxCustomDataController; + FLockUpdate: Integer; + procedure AfterLayoutChanged; virtual; + procedure BeginAutoDrag; override; + procedure BeforeUpdate; virtual; + procedure CheckCreateDesignSelectionHelper; virtual; + procedure CreateSubClasses; virtual; + procedure ControlUpdateData(AInfo: TcxUpdateControlInfo); virtual; + procedure DataChanged; virtual; + procedure DataLayoutChanged; virtual; + procedure DestroyDesignSelectionHelper; + procedure DestroySubClasses; virtual; + procedure DoBeginUpdate; virtual; + procedure DoEndUpdate; virtual; + procedure DoEditChanged(AItem: TcxCustomInplaceEditContainer); virtual; + procedure DoEdited(AItem: TcxCustomInplaceEditContainer); virtual; + function DoEditing(AItem: TcxCustomInplaceEditContainer): Boolean; virtual; + procedure DoEditValueChanged(AItem: TcxCustomInplaceEditContainer); virtual; + procedure DoInitEdit(AItem: TcxCustomInplaceEditContainer; AEdit: TcxCustomEdit); virtual; + procedure DoInplaceEditContainerItemAdded(AItem: TcxCustomInplaceEditContainer); virtual; + procedure DoInplaceEditContainerItemRemoved(AItem: TcxCustomInplaceEditContainer); virtual; + procedure DoLayoutChanged; virtual; + // + function GetControllerClass: TcxCustomControlControllerClass; virtual; // TODO: need overriding + function GetControlStylesClass: TcxCustomControlStylesClass; virtual; + function GetDataControllerClass: TcxCustomDataControllerClass; virtual; + function GetDragImageHelperClass: TcxDragImageHelperClass; virtual; + function GetEditStyleClass: TcxCustomEditStyleClass; virtual; + function GetEditingControllerClass: TcxEditingControllerClass; virtual; + function GetHitTestControllerClass: TcxHitTestControllerClass; virtual; + function GetHotTrackControllerClass: TcxHotTrackControllerClass; virtual; + function GetViewInfoClass: TcxCustomControlViewInfoClass; virtual; + function GetOptions: IcxEditingControlOptions; virtual; + function GetPainterClass: TcxCustomControlPainterClass; virtual; + function IsLocked: Boolean; virtual; + procedure RecreateViewInfo; virtual; + procedure SelectionChanged(AInfo: TcxSelectionChangedInfo); virtual; + procedure UpdateIndexes; + procedure UpdateViewStyles; + procedure UpdateData; virtual; + // VCL methods + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + procedure DestroyWnd; override; + procedure AlignControls(AControl: TControl; var Rect: TRect); override; + procedure DoExit; override; + procedure DblClick; override; + procedure FocusChanged; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + procedure Loaded; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseEnter(AControl: TControl); override; + procedure MouseLeave(AControl: TControl); override; + procedure Paint; override; + procedure WndProc(var Message: TMessage); override; + + // cxControl's + procedure AfterMouseDown(AButton: TMouseButton; X, Y: Integer); override; + procedure BoundsChanged; override; + function CanDrag(X, Y: Integer): Boolean; override; + procedure DoCancelMode; override; + procedure FontChanged; override; + function GetCursor(X, Y: Integer): TCursor; override; + function GetDesignHitTest(X, Y: Integer; Shift: TShiftState): Boolean; override; + function GetIsFocused: Boolean; override; + function GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; override; + procedure InitControl; override; + function IsPixelScrollBar(AKind: TScrollBarKind): Boolean; override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); override; + function MayFocus: Boolean; override; + // drag'n'drop + procedure DoEndDrag(Target: TObject; X, Y: Integer); override; + procedure DoStartDrag(var DragObject: TDragObject); override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); override; + function DragDropImageDisplayRect: TRect; virtual; + procedure DrawDragDropImage(ADragBitmap: TBitmap; ACanvas: TcxCanvas); virtual; + procedure FinishDragImages; + function HasDragDropImages: Boolean; virtual; + // scrollbars + procedure InitScrollBarsParameters; override; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); override; + + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); override; + procedure EndDragAndDrop(Accepted: Boolean); override; + function GetDragAndDropObjectClass: TcxDragAndDropObjectClass; override; + function StartDragAndDrop(const P: TPoint): Boolean; override; + + property BrushCache: TcxBrushCache read FBrushCache; + property ContainerList: TList read FContainerList; + property Controller: TcxCustomControlController read FController; + property ChangesCount: Integer read FChangesCount; + property DragPos: TPoint read FDragPos write FDragPos; + property DataController: TcxCustomDataController read FDataController; + property DesignSelectionHelper: TcxCustomDesignSelectionHelper read FDesignSelectionHelper; + property DragHelper: TcxDragImageHelper read FDragHelper; + property EditStyle: TcxCustomEditStyle read FEditStyle write SetEditStyle; + property IsLayoutChanged: Boolean read FIsLayoutChanged write FIsLayoutChanged; + property Options: IcxEditingControlOptions read GetOptions; + property Painter: TcxCustomControlPainter read GetPainter; + property Styles: TcxCustomControlStyles read FStyles write SetStyles; + property ViewInfo: TcxCustomControlViewInfo read FViewInfo write FViewInfo; + property OnCustomDrawCell: TcxCustomDrawViewInfoItemEvent read FOnCustomDrawCell write FOnCustomDrawCell; + property OnEditChanged: TcxecItemEvent read FOnEditChanged write FOnEditChanged; + property OnEdited: TcxecItemEvent read FOnEdited write FOnEdited; + property OnEditing: TcxecEditingEvent read FOnEditing write FOnEditing; + property OnEditValueChanged: TcxecItemEvent read FOnEditValueChanged write FOnEditValueChanged; + property OnInitEdit: TcxecInitEditEvent read FOnInitEdit write FOnInitEdit; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure BeginUpdate; + procedure BeginDragAndDrop; override; + procedure CancelUpdate; + procedure EndUpdate; + function ExecuteAction(Action: TBasicAction): Boolean; override; + procedure DragDrop(Source: TObject; X, Y: Integer); override; + procedure LayoutChanged; + function UpdateAction(Action: TBasicAction): Boolean; override; + property BufferedPaint: Boolean read GetBufferedPaint write SetBufferedPaint; + property LockUpdate: Integer read FLockUpdate; + property DragCursor default crDefault; + property TabStop default True; + published + property BorderStyle default cxcbsDefault; + end; + + { TcxExtEditingControl } + + TcxExtEditingControl = class(TcxEditingControl, IcxEditingControlOptions) + private + FOptionsBehavior: TcxControlOptionsBehavior; + FOptionsData: TcxControlOptionsData; + FOptionsView: TcxControlOptionsView; + // IcxEditingControlOptions + function GetOptionsBehavior: TcxControlOptionsBehavior; + function GetOptionsData: TcxControlOptionsData; + function GetOptionsView: TcxControlOptionsView; + + procedure SetOptionsBehavior(Value: TcxControlOptionsBehavior); + procedure SetOptionsData(Value: TcxControlOptionsData); + procedure SetOptionsView(Value: TcxControlOptionsView); + protected + procedure CreateSubClasses; override; + procedure DestroySubClasses; override; + function GetOptions: IcxEditingControlOptions; override; + function GetOptionsBehaviorClass: TcxControlOptionsBehaviorClass; virtual; + function GetOptionsDataClass: TcxControlOptionsDataClass; virtual; + function GetOptionsViewClass: TcxControlOptionsViewClass; virtual; + property OptionsBehavior: TcxControlOptionsBehavior read GetOptionsBehavior write SetOptionsBehavior; + property OptionsData: TcxControlOptionsData read GetOptionsData write SetOptionsData; + property OptionsView: TcxControlOptionsView read GetOptionsView write SetOptionsView; + end; + + { TcxValueTypeClassRepository } + + TcxValueTypeClassRepository = class + private + FList: TStringList; + function GetCount: Integer; + function GetValueTypeClass(AIndex: Integer): TcxValueTypeClass; + function GetDescription(AIndex: Integer): string; + public + constructor Create; + destructor Destroy; override; + function FindByClassType(ATypeClass: TcxValueTypeClass): string; + function FindByDescription(const ADescription: string): TcxValueTypeClass; + procedure RegisterValueTypeClass(const ADescription: string; ATypeClass: TcxValueTypeClass); + procedure UnRegisterValueTypeClass(ATypeClass: TcxValueTypeClass); + property Count: Integer read GetCount; + property Description[AIndex: Integer]: string read GetDescription; + property ValueTypeClass[AIndex: Integer]: TcxValueTypeClass read GetValueTypeClass; + end; + +function cxieValueTypeClassRepository: TcxValueTypeClassRepository; +procedure cxieRegisterValueTypeClass(const ADescription: string; ATypeClass: TcxValueTypeClass); +procedure cxieUnRegisterValueTypeClass(ATypeClass: TcxValueTypeClass); + +procedure cxAssignEditStyle(AViewInfo: TcxEditCellViewInfo); +function cxPtInViewInfoItem(AItem: TcxCustomViewInfoItem; const APoint: TPoint): Boolean; +procedure cxStylesToViewParams(AMasterStyles: TcxCustomControlStyles; AIndex: Integer; + AData: Pointer; const AStyles: array of TcxStyle; out AParams: TcxViewParams); + +function cxInRange(Value: Integer; AMin, AMax: Integer): Boolean; +function cxRange(var Value: Integer; AMin, AMax: Integer): Boolean; +function cxSetValue(Condition: Boolean; ATrueValue, AFalseValue: Integer): Integer; + +function cxConfirmMessageBox(const AText, ACaption: string): Boolean; +procedure cxAbstractError; + +{$IFNDEF DELPHI5} +function Supports(const Instance: TObject; const IID: TGUID; out Intf): Boolean; +{$ENDIF} + +const + EditStartChars = [#8, ^V, ^X, #32..#255]; + IncSearchStartChars = [#8, #32..#255]; + cxIntOffs: array[Boolean] of Integer = (-1, 1); + cxDefaultEditSizeProp: TcxEditSizeProperties = (Height: -1; MaxLineCount: 0; Width: -1); + cxDesignSelectionHelperClass: TcxCustomDesignSelectionHelperClass = nil; + +implementation + +type + TControlAccess = class(TControl); + THintWindowAccess = class(THintWindow); + TcxCustomEditStyleAccess = class(TcxCustomEditStyle); + TcxCustomEditViewDataAccess = class(TcxCustomEditViewData); + TcxDragAndDropObjectAccess = class(TcxDragAndDropObject); + + PIntArray = ^TIntArray; + TIntArray = array[0..MaxInt div SizeOf(Integer) - 1] of Integer; + +var + ValueTypeClassRepository: TcxValueTypeClassRepository; + cxDragControl: TcxEditingControl; + cxDragPrevHook: HHook; + +const + cxInvisibleCoordinate = 30000; + +procedure cxAbstractError; +begin + RunError(210); +end; + +{$IFNDEF DELPHI5} +function Supports(const Instance: TObject; const IID: TGUID; out Intf): Boolean; +begin + Result := (Instance <> nil) and Instance.GetInterface(IID, Intf); +end; +{$ENDIF} + +procedure cxAssignEditStyle(AViewInfo: TcxEditCellViewInfo); +var + AStyle: TcxCustomEditStyleAccess; +begin + AStyle := TcxCustomEditStyleAccess(AViewInfo.Control.EditStyle); + with AViewInfo do + begin + AStyle.FAssignedValues := AStyle.FAssignedValues - [svFont] + [svColor, svButtonTransparency]; + if ViewParams.Font = nil then + AStyle.StyleData.Font := GetEditViewParams.Font + else + AStyle.StyleData.Font := ViewParams.Font; + AStyle.StyleData.Color := ViewParams.Color; + AStyle.StyleData.FontColor := ViewParams.TextColor; + AStyle.ButtonTransparency := GetButtonTransparency; + AStyle.Changed; + ViewInfo.Transparent := IsTransparent; + end; +end; + +function MouseMsgHookProcForDragDrop(Code: Integer; + WParam, LParam: Longint): Longint stdcall; +begin + Result := CallNextHookEx(cxDragPrevHook, Code, WParam, LParam); + if (cxDragControl <> nil) then + begin + case WParam of + WM_MOUSEMOVE: + begin + with cxDragControl do + if Dragging then + DragHelper.DragAndDrop(PMouseHookStruct(LParam).Pt); + end; + WM_LBUTTONUP, WM_RBUTTONUP: + cxDragControl.FinishDragImages; + end; + end; +end; + +procedure cxInstallMouseHookForDragControl(AControl: TcxEditingControl); +begin + cxDragControl := AControl; + cxDragPrevHook := SetWindowsHookEx(WH_MOUSE, + @MouseMsgHookProcForDragDrop, 0, GetCurrentThreadID); +end; + +procedure cxResetMouseHookForDragControl; +begin + try + if cxDragPrevHook <> 0 then + UnhookWindowsHookEx(cxDragPrevHook); + finally + cxDragControl := nil; + cxDragPrevHook := 0; + end; +end; + +{ TcxInterfacedCollectionItem } + +procedure TcxInterfacedCollectionItem.AfterConstruction; +begin + inherited AfterConstruction; + if GetOwner <> nil then + GetOwner.GetInterface(IUnknown, FOwnerInterface); +end; + +function TcxInterfacedCollectionItem._AddRef: Integer; +begin + if FOwnerInterface <> nil then + Result := FOwnerInterface._AddRef else + Result := -1; +end; + +function TcxInterfacedCollectionItem._Release: Integer; +begin + if FOwnerInterface <> nil then + Result := FOwnerInterface._Release else + Result := -1; +end; + +function TcxInterfacedCollectionItem.QueryInterface(const IID: TGUID; + out Obj): HResult; +begin + if GetInterface(IID, Obj) then Result := 0 else Result := cxE_NOINTERFACE; +end; + +{ TcxCustomItemDataBinding } + +constructor TcxCustomItemDataBinding.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FDefaultValuesProvider := GetDefaultValuesProviderClass.Create(Self); +end; + +destructor TcxCustomItemDataBinding.Destroy; +begin + FreeAndNil(FDefaultValuesProvider); + inherited Destroy; +end; + +function TcxCustomItemDataBinding.DefaultRepositoryItem: TcxEditRepositoryItem; +begin + Result := GetDefaultEditDataRepositoryItems.GetItem(GetValueTypeClass); +end; + +function TcxCustomItemDataBinding.GetDefaultCaption: string; +begin + Result := ''; +end; + +function TcxCustomItemDataBinding.GetDefaultValuesProvider( + AProperties: TcxCustomEditProperties): IcxEditDefaultValuesProvider; +begin + Result := DefaultValuesProvider; +end; + +function TcxCustomItemDataBinding.GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; +begin + Result := TcxContainerItemDefaultValuesProvider; +end; + +function TcxCustomItemDataBinding.GetValueTypeClass: TcxValueTypeClass; +begin + Result := TcxStringValueType; +end; + +procedure TcxCustomItemDataBinding.Init; +begin +end; + +function TcxCustomItemDataBinding.IsDisplayFormatDefined( + AIsCurrencyValueAccepted: Boolean): Boolean; +begin + Result := + DataController.IsDisplayFormatDefined(EditContainer.ItemIndex, not AIsCurrencyValueAccepted) or + EditContainer.HasDataTextHandler; +end; + +procedure TcxCustomItemDataBinding.ValueTypeClassChanged; +begin + DataController.ChangeValueTypeClass(EditContainer.ItemIndex, GetValueTypeClass); + EditContainer.InternalPropertiesChanged; +end; + +function TcxCustomItemDataBinding.GetDataController: TcxCustomDataController; +begin + Result := EditContainer.EditingControl.DataController; +end; + +function TcxCustomItemDataBinding.GetEditContainer: TcxCustomInplaceEditContainer; +begin + Result := TcxCustomInplaceEditContainer(GetOwner); +end; + +{ TcxItemDataBinding } + +procedure TcxItemDataBinding.Assign(Source: TPersistent); +begin + if Source is TcxItemDataBinding then + begin + ValueType := TcxItemDataBinding(Source).ValueType; + ValueTypeClass := TcxItemDataBinding(Source).ValueTypeClass; + end; +end; + +function TcxItemDataBinding.GetValueTypeClass: TcxValueTypeClass; +begin + if FValueTypeClass = nil then + Result := inherited GetValueTypeClass + else + Result := FValueTypeClass; +end; + +function TcxItemDataBinding.IsValueTypeStored: Boolean; +begin + Result := FValueTypeClass <> inherited GetValueTypeClass; +end; + +function TcxItemDataBinding.GetValueType: string; +begin + Result := ValueTypeClassRepository.FindByClassType(ValueTypeClass); +end; + +procedure TcxItemDataBinding.SetValueType(const Value: string); +var + ATypeClass: TcxValueTypeClass; +begin + ATypeClass := ValueTypeClassRepository.FindByDescription(Value); + if ATypeClass <> nil then + ValueTypeClass := ATypeClass; +end; + +procedure TcxItemDataBinding.SetValueTypeClass(Value: TcxValueTypeClass); +begin + if ValueTypeClass <> Value then + begin + FValueTypeClass := Value; + ValueTypeClassChanged; + end; +end; + +{ TcxControlDataController } + +procedure TcxControlDataController.UpdateData; +begin + GetControl.UpdateData; +end; + +procedure TcxControlDataController.UpdateItemIndexes; +begin + GetControl.UpdateIndexes; + inherited UpdateItemIndexes; +end; + +function TcxControlDataController.GetItem(Index: Integer): TObject; +begin + Result := GetControl.FContainerList[Index]; +end; + +function TcxControlDataController.GetItemID(AItem: TObject): Integer; +begin + if AItem is TcxCustomInplaceEditContainer then + Result := TcxCustomInplaceEditContainer(AItem).ItemIndex + else + Result := -1; +end; + +function TcxControlDataController.GetItemValueSource( + AItemIndex: Integer): TcxDataEditValueSource; +begin + with TcxCustomInplaceEditContainer(GetControl.FContainerList[AItemIndex]) do + Result := PropertiesValue.GetEditValueSource(True); +end; + +procedure TcxControlDataController.UpdateControl(AInfo: TcxUpdateControlInfo); +begin + GetControl.ControlUpdateData(AInfo); +end; + +function TcxControlDataController.GetControl: TcxEditingControl; +begin + Result := TcxEditingControl(GetOwner); +end; + +{ TcxContainerItemDefaultValuesProvider } + +function TcxContainerItemDefaultValuesProvider.IsDisplayFormatDefined( + AIsCurrencyValueAccepted: Boolean): Boolean; +begin + Result := False; +end; + +{ TcxCustomEditContainerItemOptions } + +constructor TcxCustomEditContainerItemOptions.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FMoving := True; + FCustomizing := True; + FSorting := True; + FEditing := True; + FFiltering := True; + FFocusing := True; + FIncSearch := True; + FShowEditButtons := eisbDefault; + FTabStop := True; +end; + +procedure TcxCustomEditContainerItemOptions.Assign(AOwner: TPersistent); +begin + if AOwner is TcxCustomEditContainerItemOptions then + with TcxCustomEditContainerItemOptions(AOwner) do + begin + Self.Customizing := Customizing; + Self.Editing := Editing; + Self.Filtering := Filtering; + Self.Focusing := Focusing; + Self.IncSearch := IncSearch; + Self.Moving := Moving; + Self.ShowEditButtons := ShowEditButtons; + Self.Sorting := Sorting; + Self.TabStop := TabStop; + end; +end; + +procedure TcxCustomEditContainerItemOptions.Changed; +begin + EditContainer.Changed; +end; + +function TcxCustomEditContainerItemOptions.GetEditContainer: TcxCustomInplaceEditContainer; +begin + Result := TcxCustomInplaceEditContainer(GetOwner); +end; + +procedure TcxCustomEditContainerItemOptions.SetEditing(Value: Boolean); +begin + if FEditing <> Value then + begin + FEditing := Value; + if not Value then EditContainer.Editing := False; + end; +end; + +procedure TcxCustomEditContainerItemOptions.SetFiltering(Value: Boolean); +begin + if FFiltering <> Value then + begin + FFiltering := Value; + Changed; + end; +end; + +procedure TcxCustomEditContainerItemOptions.SetFocusing(Value: Boolean); +begin + if FFocusing <> Value then + begin + FFocusing := Value; + if not Value then EditContainer.Focused := False; + end; +end; + +procedure TcxCustomEditContainerItemOptions.SetIncSearch(Value: Boolean); +begin + if FIncSearch <> Value then + begin + if not Value and EditContainer.IncSearching then + EditContainer.CancelIncSearching; + FIncSearch := Value; + end; +end; + +procedure TcxCustomEditContainerItemOptions.SetShowEditButtons( + Value: TcxEditItemShowEditButtons); +begin + if Value <> FShowEditButtons then + begin + FShowEditButtons := Value; + Changed; + end; +end; + +{ TcxControlOptionsView } + +constructor TcxControlOptionsView.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FShowEditButtons := ecsbNever; +end; + +procedure TcxControlOptionsView.Assign(Source: TPersistent); +begin + if Source is TcxControlOptionsView then + with TcxControlOptionsView(Source) do + begin + Self.CellAutoHeight := CellAutoHeight; + Self.CellEndEllipsis := CellEndEllipsis; + Self.CellTextMaxLineCount := CellTextMaxLineCount; + Self.ScrollBars := ScrollBars; + Self.ShowEditButtons := ShowEditButtons; + end +end; + +procedure TcxControlOptionsView.Changed; +begin + EditingControl.LayoutChanged; +end; + +function TcxControlOptionsView.GetEditingControl: TcxEditingControl; +begin + Result := TcxEditingControl(GetOwner); +end; + +function TcxControlOptionsView.GetScrollBars: TScrollStyle; +begin + Result := EditingControl.ScrollBars; +end; + +procedure TcxControlOptionsView.SetCellAutoHeight(const Value: Boolean); +begin + if FCellAutoHeight <> Value then + begin + FCellAutoHeight := Value; + Changed; + end; +end; + +procedure TcxControlOptionsView.SetCellEndEllipsis(const Value: Boolean); +begin + if FCellEndEllipsis <> Value then + begin + FCellEndEllipsis := Value; + Changed; + end; +end; + +procedure TcxControlOptionsView.SetCellTextMaxLineCount( + const Value: Integer); +begin + if FCellTextMaxLineCount <> Value then + begin + FCellTextMaxLineCount := Value; + Changed; + end; +end; + +procedure TcxControlOptionsView.SetScrollBars(const Value: TScrollStyle); +begin + EditingControl.ScrollBars := Value; +end; + +procedure TcxControlOptionsView.SetShowEditButtons( + const Value: TcxEditingControlEditShowButtons); +begin + if FShowEditButtons <> Value then + begin + FShowEditButtons := Value; + Changed; + end; +end; + +{ TcxControlOptionsData } + +constructor TcxControlOptionsData.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FCancelOnExit := True; + FEditing := True; +end; + +procedure TcxControlOptionsData.Assign(Source: TPersistent); +begin + if Source is TcxControlOptionsData then + with TcxControlOptionsData(Source) do + begin + Self.CancelOnExit := CancelOnExit; + Self.Editing := Editing; + end +end; + +procedure TcxControlOptionsData.Changed; +begin +end; + +function TcxControlOptionsData.GetEditingControl: TcxEditingControl; +begin + Result := TcxEditingControl(GetOwner) +end; + +procedure TcxControlOptionsData.SetEditing(Value: Boolean); +begin + if FEditing <> Value then + begin + FEditing := Value; + if not Value then + EditingControl.Controller.EditingItem := nil; + Changed; + end; +end; + +{ TcxControlOptionsBehavior } + +constructor TcxControlOptionsBehavior.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FImmediateEditor := True; +end; + +procedure TcxControlOptionsBehavior.Assign(Source: TPersistent); +begin + if Source is TcxControlOptionsBehavior then + with TcxControlOptionsBehavior(Source) do + begin + Self.AlwaysShowEditor := AlwaysShowEditor; + Self.CellHints := CellHints; + Self.FocusCellOnCycle := FocusCellOnCycle; + Self.FocusFirstCellOnNewRecord := FocusFirstCellOnNewRecord; + Self.GoToNextCellOnEnter := GoToNextCellOnEnter; + Self.GoToNextCellOnTab := GoToNextCellOnTab; + Self.ImmediateEditor := ImmediateEditor; + end +end; + +procedure TcxControlOptionsBehavior.Changed; +begin + if EditingControl.Controller <> nil then + EditingControl.Controller.BehaviorChanged; +end; + +function TcxControlOptionsBehavior.GetEditingControl: TcxEditingControl; +begin + Result := TcxEditingControl(GetOwner); +end; + +procedure TcxControlOptionsBehavior.SetAlwaysShowEditor(Value: Boolean); +begin + if FAlwaysShowEditor <> Value then + begin + FAlwaysShowEditor := Value; + Changed; + end; +end; + +procedure TcxControlOptionsBehavior.SetCellHints(Value: Boolean); +begin + if FCellHints <> Value then + begin + FCellHints := Value; + Changed; + end; +end; + +procedure TcxControlOptionsBehavior.SetFocusCellOnCycle(Value: Boolean); +begin + if FFocusCellOnCycle <> Value then + begin + FFocusCellOnCycle := Value; + Changed; + end; +end; + +procedure TcxControlOptionsBehavior.SetFocusFirstCellOnNewRecord( + Value: Boolean); +begin + if FFocusFirstCellOnNewRecord <> Value then + begin + FFocusFirstCellOnNewRecord := Value; + Changed; + end; +end; + +procedure TcxControlOptionsBehavior.SetGoToNextCellOnEnter(Value: Boolean); +begin + if FGoToNextCellOnEnter <> Value then + begin + FGoToNextCellOnEnter := Value; + Changed; + end; +end; + +procedure TcxControlOptionsBehavior.SetGoToNextCellOnTab(Value: Boolean); +begin + if FGoToNextCellOnTab <> Value then + begin + FGoToNextCellOnTab := Value; + with EditingControl do + if Value then + Keys := Keys + [kTab] + else + Keys := Keys - [kTab]; + Changed; + end; +end; + +procedure TcxControlOptionsBehavior.SetImmediateEditor(Value: Boolean); +begin + if FImmediateEditor <> Value then + begin + FImmediateEditor := Value; + Changed; + end; +end; + +procedure TcxControlOptionsBehavior.SetIncSearch(Value: Boolean); +begin + if Value <> FIncSearch then + begin + FIncSearch := Value; + if not Value then + EditingControl.Controller.CancelIncSearching; + end; +end; + +procedure TcxControlOptionsBehavior.SetIncSearchItem(Value: TcxCustomInplaceEditContainer); +begin + if Value <> FIncSearchItem then + begin + FIncSearchItem := Value; + EditingControl.Controller.CancelIncSearching; + end; +end; + +{ TcxEditContainerStyles } + +procedure TcxEditContainerStyles.Assign(Source: TPersistent); +begin + if Source is TcxEditContainerStyles then + Content := TcxEditContainerStyles(Source).Content; + inherited Assign(Source); +end; + +procedure TcxEditContainerStyles.Changed(AIndex: Integer); +begin + inherited Changed(AIndex); + Control.UpdateViewStyles; +end; + +function TcxEditContainerStyles.GetContainer: TcxCustomInplaceEditContainer; +begin + Result := TcxCustomInplaceEditContainer(GetOwner); +end; + +function TcxEditContainerStyles.GetControl: TcxEditingControl; +begin + Result := Container.EditingControl; +end; + +function TcxEditContainerStyles.GetControlStyles: TcxCustomControlStyles; +begin + Result := Control.Styles; +end; + +{ TcxCustomInplaceEditContainer } + +constructor TcxCustomInplaceEditContainer.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FDataBinding := GetDataBindingClass.Create(Self); + FOptions := GetOptionsClass.Create(Self); + FStyles := GetStylesClass.Create(Self); +end; + +destructor TcxCustomInplaceEditContainer.Destroy; +begin + if not EditingControl.IsDestroying and EditingControl.IsDesigning and + (Controller.DesignSelectionHelper <> nil) then + Controller.DesignSelectionHelper.UnselectObject(Self); + RepositoryItem := nil; + EditingControl := nil; + FOptions.Free; + FDataBinding.Free; + FStyles.Free; + DestroyProperties; + inherited Destroy; +end; + +procedure TcxCustomInplaceEditContainer.Assign(Source: TPersistent); +begin + if Source is TcxCustomInplaceEditContainer then + with TcxCustomInplaceEditContainer(Source) do + begin + Self.DataBinding := DataBinding; + Self.PropertiesClassName := PropertiesClassName; + Self.Properties := Properties; + Self.RepositoryItem := RepositoryItem; + Self.Styles := Styles; + Self.OnGetEditProperties := OnGetEditProperties; + end +end; + +procedure TcxCustomInplaceEditContainer.CalculateEditViewInfo( + const AValue: Variant; AEditViewInfo: TcxEditCellViewInfo; const APoint: TPoint); +var + ACanvas: TcxCanvas; +begin + ACanvas := GetControlCanvas; + cxAssignEditStyle(AEditViewInfo); + with AEditViewInfo do + begin + if IncSearching and (Controller.IncSearchingItem = Self) and + (Controller.FocusedRecordIndex = RecordIndex) then + with ViewData do + begin + SelTextColor := GetSelectedTextColor; + SelBackgroundColor := GetSelectedBKColor; + SelStart := 0; + SelLength := Length(Controller.IncSearchingText); + end + else + ViewData.SelLength := 0; + ViewData.MaxLineCount := AEditViewInfo.MaxLineCount; + ViewData.EditValueToDrawValue(ACanvas, AValue, ViewInfo); + ViewData.ContentOffset := ContentOffset; + ViewData.CalculateEx(ACanvas, ContentRect, APoint, cxmbNone, [], ViewInfo, False); + end; +end; + +function TcxCustomInplaceEditContainer.CanEdit: Boolean; +begin + Result := CanFocus and EditingControl.Options.OptionsData.Editing and + FOptions.Editing and (dceoShowEdit in DataController.EditOperations) and + (DataController.RecordCount > 0); +end; + +function TcxCustomInplaceEditContainer.CanFocus: Boolean; +begin + Result := Options.FFocusing; +end; + +procedure TcxCustomInplaceEditContainer.CancelIncSearching; +begin + Controller.CancelIncSearching; +end; + +function TcxCustomInplaceEditContainer.CanInitEditing: Boolean; +begin + Result := DataController.CanInitEditing(ItemIndex); +end; + +function TcxCustomInplaceEditContainer.CanIncSearch: Boolean; +begin + Result := (esoIncSearch in FPropertiesValue.GetSupportedOperations) and + EditingControl.Options.OptionsBehavior.IncSearch and Options.IncSearch; +end; + +function TcxCustomInplaceEditContainer.CanTabStop: Boolean; +begin + Result := Options.TabStop; +end; + +procedure TcxCustomInplaceEditContainer.Changed; +begin + if EditingControl <> nil then + EditingControl.UpdateViewStyles; +end; + +function TcxCustomInplaceEditContainer.CreateEditViewData( + AProperties: TcxCustomEditProperties; AEditStyleData: Pointer): TcxCustomEditViewData; +begin + Result := AProperties.CreateViewData(GetEditStyle(AEditStyleData), True); + Result.OnGetDisplayText := EditViewDataGetDisplayTextHandler; +end; + +procedure TcxCustomInplaceEditContainer.DataChanged; +begin + FDataBinding.Init; + InternalPropertiesChanged; +end; + +procedure TcxCustomInplaceEditContainer.DoGetDisplayText( + ARecordIndex: Integer; var AText: string); +begin +end; + +function TcxCustomInplaceEditContainer.DoGetEditProperties( + AData: Pointer): TcxCustomEditProperties; +begin + Result := + DoGetPropertiesFromEvent(FOnGetEditProperties, AData, FPropertiesValue); +end; + +procedure TcxCustomInplaceEditContainer.DoGetEditingProperties(AData: Pointer; + var AProperties: TcxCustomEditProperties); +begin + AProperties := + DoGetPropertiesFromEvent(FOnGetEditingProperties, AData, AProperties); +end; + +function TcxCustomInplaceEditContainer.DoGetPropertiesFromEvent( + AEvent: TcxGetEditPropertiesEvent; AData: Pointer; + AProperties: TcxCustomEditProperties): TcxCustomEditProperties; +begin + Result := AProperties; + if Assigned(AEvent) then + begin + AEvent(Self, AData, Result); + if Result = nil then + Result := AProperties; + end; + InitProperties(Result); +end; + +procedure TcxCustomInplaceEditContainer.DoOnPropertiesChanged(Sender: TObject); +begin + InternalPropertiesChanged; +end; + +procedure TcxCustomInplaceEditContainer.EditViewDataGetDisplayTextHandler( + Sender: TcxCustomEditViewData; var AText: string); +begin + if Sender <> nil then + DoGetDisplayText(Sender.InplaceEditParams.Position.RecordIndex, AText); +end; + +function TcxCustomInplaceEditContainer.GetDefaultEditProperties: TcxCustomEditProperties; +begin + if FRepositoryItem <> nil then + Result := FRepositoryItem.Properties + else + if FProperties <> nil then + Result := FProperties + else + Result := DataBinding.DefaultRepositoryItem.Properties; +end; + +function TcxCustomInplaceEditContainer.GetControlCanvas: TcxCanvas; +begin + if (EditingControl <> nil) and EditingControl.HandleAllocated then + Result := EditingControl.Canvas + else + Result := cxScreenCanvas; +end; + +function TcxCustomInplaceEditContainer.GetController: TcxCustomControlController; +begin + Result := EditingControl.Controller; +end; + +function TcxCustomInplaceEditContainer.GetCurrentValue: Variant; +begin + with DataController do + Result := Values[FocusedRecordIndex, ItemIndex]; +end; + +function TcxCustomInplaceEditContainer.GetDataBindingClass: TcxItemDataBindingClass; +begin + Result := TcxItemDataBinding; +end; + +function TcxCustomInplaceEditContainer.GetDisplayValue( + AProperties: TcxCustomEditProperties; ARecordIndex: Integer): Variant; +begin + if AProperties.GetEditValueSource(False) = evsValue then + Result := Values[ARecordIndex] + else + Result := DataController.DisplayTexts[ARecordIndex, ItemIndex]; +end; + +function TcxCustomInplaceEditContainer.GetEditDataValueTypeClass: TcxValueTypeClass; +begin + Result := FDataBinding.GetValueTypeClass; +end; + +function TcxCustomInplaceEditContainer.GetEditDefaultHeight(AFont: TFont): Integer; +var + ASizeProp: TcxEditSizeProperties; +begin + ASizeProp := cxDefaultEditSizeProp; + EditViewData.Style.Font := AFont; + if AFont = nil then + EditViewData.Style.Font := EditingControl.Font; + EditViewData.ContentOffset := cxNullRect; + Result := EditViewData.GetEditSize(GetControlCanvas, Null, ASizeProp).cy; +end; + +function TcxCustomInplaceEditContainer.GetEditHeight( + AEditViewInfo: TcxEditCellViewInfo): Integer; +var + ASizeProp: TcxEditSizeProperties; +begin + ASizeProp := cxDefaultEditSizeProp; + with AEditViewInfo do + begin + ViewData.Style.Font := ViewParams.Font; + if ViewParams.Font = nil then + EditViewData.Style.Font := EditingControl.Font; + ViewData.ContentOffset := ContentOffset; + ASizeProp.Width := cxRectWidth(ContentRect); + ASizeProp.MaxLineCount := MaxLineCount; + Result := ViewData.GetEditSize(GetControlCanvas, DisplayValue, ASizeProp).cy; + Inc(Result, Byte(bBottom in Borders)); + Inc(Result, Byte(bTop in Borders)); + end; +end; + +function TcxCustomInplaceEditContainer.GetEditWidth( + AEditViewInfo: TcxEditCellViewInfo): Integer; +var + ASizeProp: TcxEditSizeProperties; +begin + ASizeProp := cxDefaultEditSizeProp; + with AEditViewInfo do + begin + ViewData.Style.Font := ViewParams.Font; + ViewData.ContentOffset := ContentOffset; + ASizeProp.MaxLineCount := MaxLineCount; + Result := ViewData.GetEditSize(GetControlCanvas, DisplayValue, ASizeProp).cx; + end; +end; + +function TcxCustomInplaceEditContainer.GetOptionsClass: TcxCustomEditContainerItemOptionsClass; +begin + Result := TcxCustomEditContainerItemOptions; +end; + +function TcxCustomInplaceEditContainer.GetStylesClass: TcxEditContainerStylesClass; +begin + Result := TcxEditContainerStyles; +end; + +function TcxCustomInplaceEditContainer.GetValue(ARecordIndex: Integer): Variant; +begin + Result := DataController.Values[ARecordIndex, ItemIndex]; +end; + +function TcxCustomInplaceEditContainer.GetValueCount: Integer; +begin + if FEditingControl <> nil then + Result := DataController.RecordCount + else + Result := 0; +end; + +function TcxCustomInplaceEditContainer.HasDataTextHandler: Boolean; +begin + Result := False; +end; + +function TcxCustomInplaceEditContainer.GetEditing: Boolean; +begin + Result := Controller.EditingItem = Self; +end; + +function TcxCustomInplaceEditContainer.GetEditStyle(AData: Pointer): TcxCustomEditStyle; +begin + Result := EditingControl.EditStyle +end; + +function TcxCustomInplaceEditContainer.GetEditValue: Variant; +begin + if Editing then + begin + if DataController.RecordCount = 0 then + Result := Null + else + Result := DataController.GetEditValue(ItemIndex, FEditValueSource); + end + else + Result := Unassigned; +end; + +procedure TcxCustomInplaceEditContainer.PropertiesChanged; +begin + Changed; +end; + +procedure TcxCustomInplaceEditContainer.SetCurrentValue(const Value: Variant); +begin + with DataController do + Values[FocusedRecordIndex, ItemIndex] := Value; +end; + +procedure TcxCustomInplaceEditContainer.SetEditing(Value: Boolean); +begin + if Value then + Controller.EditingItem := Self + else + if Editing then + Controller.EditingItem := nil; +end; + +procedure TcxCustomInplaceEditContainer.SetEditingControl( + Value: TcxEditingControl); +begin + if FEditingControl <> Value then + begin + if Value <> nil then + Value.ViewInfo.State[cvis_StyleInvalid] := True; + if FEditingControl <> nil then + FEditingControl.DoInplaceEditContainerItemRemoved(Self); + FEditingControl := Value; + if FEditingControl <> nil then + begin + FEditingControl.BeginUpdate; + try + FEditingControl.DoInplaceEditContainerItemAdded(Self); + DataBinding.ValueTypeClassChanged; + finally + FEditingControl.CancelUpdate; + InternalPropertiesChanged; + end; + end; + end; +end; + +procedure TcxCustomInplaceEditContainer.SetEditValue(const Value: Variant); +begin + if Editing then + DataController.SetEditValue(ItemIndex, Value, FEditValueSource); +end; + +procedure TcxCustomInplaceEditContainer.SetValue( + ARecordIndex: Integer; const Value: Variant); +begin + DataController.Values[ARecordIndex, ItemIndex] := Value; +end; + +function TcxCustomInplaceEditContainer.GetDataController: TcxCustomDataController; +begin + Result := FEditingControl.DataController; +end; + +function TcxCustomInplaceEditContainer.GetFocused: Boolean; +begin + Result := Controller.FocusedItem = Self; +end; + +function TcxCustomInplaceEditContainer.GetFocusedCellViewInfo: TcxEditCellViewInfo; +begin + Result := Controller.GetFocusedCellViewInfo(Self); +end; + +function TcxCustomInplaceEditContainer.GetIncSearching: Boolean; +begin + Result := Controller.IncSearchingItem = Self; +end; + +function TcxCustomInplaceEditContainer.GetProperties: TcxCustomEditProperties; +begin + Result := FProperties; +end; + +function TcxCustomInplaceEditContainer.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := FPropertiesClass; +end; + +function TcxCustomInplaceEditContainer.GetPropertiesClassName: string; +begin + if FProperties = nil then + Result := '' + else + Result := FProperties.ClassName; +end; + +function TcxCustomInplaceEditContainer.GetPropertiesValue: TcxCustomEditProperties; +begin + Result := FPropertiesValue; + Result.LockUpdate(True); + if FDataBinding = nil then + Result.IDefaultValuesProvider := nil + else + Result.IDefaultValuesProvider := FDataBinding.DefaultValuesProvider; + Result.LockUpdate(False); +end; + +procedure TcxCustomInplaceEditContainer.SetDataBinding(Value: TcxCustomItemDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxCustomInplaceEditContainer.SetFocused(Value: Boolean); +begin + if Value then + Controller.FocusedItem := Self + else + if Focused then + // TODO: +{ if not Controller.FocusNextItem(VisibleIndex, True, True, False) then + Controller.FocusedItem := nil;} +end; + +procedure TcxCustomInplaceEditContainer.SetOptions( + Value: TcxCustomEditContainerItemOptions); +begin + FOptions.Assign(Value); +end; + +procedure TcxCustomInplaceEditContainer.SetProperties( + Value: TcxCustomEditProperties); +begin + if (FProperties <> nil) and (Value <> nil) then + FProperties.Assign(Value); +end; + +procedure TcxCustomInplaceEditContainer.SetPropertiesClass( + Value: TcxCustomEditPropertiesClass); +begin + if FPropertiesClass <> Value then + begin + FPropertiesClass := Value; + RecreateProperties; + end; +end; + +procedure TcxCustomInplaceEditContainer.SetPropertiesClassName( + const Value: string); +begin + if PropertiesClassName <> Value then + begin + with GetRegisteredEditProperties do + PropertiesClass := TcxCustomEditPropertiesClass(FindByClassName(Value)); + end; +end; + +procedure TcxCustomInplaceEditContainer.SetRepositoryItem( + Value: TcxEditRepositoryItem); +begin + if FRepositoryItem <> Value then + begin + if FRepositoryItem <> nil then + begin + FRepositoryItem.RemoveListener(Self); + Controller.EditingController.RemoveEdit(FRepositoryItem.Properties); + end; + FRepositoryItem := Value; + if FRepositoryItem <> nil then + FRepositoryItem.AddListener(Self); + InternalPropertiesChanged; + end; +end; + +procedure TcxCustomInplaceEditContainer.SetStyles( + Value: TcxEditContainerStyles); +begin + FStyles.Assign(Value); +end; + +procedure TcxCustomInplaceEditContainer.CreateProperties; +begin + if FPropertiesClass <> nil then + FProperties := FPropertiesClass.Create(Self); + InternalPropertiesChanged; +end; + +procedure TcxCustomInplaceEditContainer.DestroyProperties; +begin + FreeAndNil(FEditData); + FreeAndNil(FEditViewData); + FreeAndNil(FProperties); +end; + +procedure TcxCustomInplaceEditContainer.InitEditViewInfo( + AEditViewInfo: TcxEditCellViewInfo); + + procedure CheckOption(IsSetValue: Boolean; Value: TcxEditPaintOption); + begin + if IsSetValue then + Include(AEditViewInfo.ViewData.PaintOptions, Value) + else + Exclude(AEditViewInfo.ViewData.PaintOptions, Value); + end; + +var + AProp: TcxCustomEditProperties; +begin + with AEditViewInfo do + begin + AProp := Properties; + Properties := DoGetEditProperties(GetViewInfoData); + CellValue := GetDisplayValue; + ItemViewParams := GetEditViewParams; + if (AProp = nil) or (AProp <> Properties) then + begin + try + if IsViewDataCreated then + FreeAndNil(ViewData); + FreeAndNil(ViewInfo); + finally + if Properties = FPropertiesValue then + ViewData := EditViewData + else + ViewData := CreateEditViewData(Properties, GetViewInfoData); + IsViewDataCreated := ViewData <> EditViewData; + ViewInfo := TcxCustomEditViewInfo(Properties.GetViewInfoClass.Create); + if not IsViewDataCreated then + TcxCustomEditViewDataAccess(ViewData).InitCacheData; + end; + end + else + if not IsViewDataCreated then ViewData := EditViewData; + CheckOption(IsAutoHeight, epoAutoHeight); + CheckOption(IsEndEllipsis, epoShowEndEllipsis); + ViewData.InplaceEditParams.Position.RecordIndex := RecordIndex; + ViewData.InplaceEditParams.Position.Item := Self; + end; +end; + +procedure TcxCustomInplaceEditContainer.InitProperties( + AProperties: TcxCustomEditProperties); +begin + with AProperties do + begin + LockUpdate(True); + try + IDefaultValuesProvider := DataBinding.GetDefaultValuesProvider(AProperties); + finally + LockUpdate(False); + end; + end; +end; + +procedure TcxCustomInplaceEditContainer.InternalPropertiesChanged; +begin + if IsDestroying then Exit; + if not Controller.IsEditing and not Controller.FEditingController.FEditHiding then + FreeAndNil(FEditData); + FreeAndNil(FEditViewData); + FPropertiesValue := GetDefaultEditProperties; + InitProperties(FPropertiesValue); + if EditingControl <> nil then + FEditViewData := CreateEditViewData(FPropertiesValue, nil); + with FPropertiesValue do + begin + if not Assigned(OnPropertiesChanged) then + OnPropertiesChanged := DoOnPropertiesChanged; + end; + PropertiesChanged; +end; + +function TcxCustomInplaceEditContainer.IsDestroying: Boolean; +begin + Result := csDestroying in ComponentState; +end; + +function TcxCustomInplaceEditContainer.IsEditPartVisible: Boolean; +begin + Result := (FocusedCellViewInfo <> nil) and + not IsRectEmpty(FocusedCellViewInfo.VisibleRect); +end; + +procedure TcxCustomInplaceEditContainer.RecreateProperties; +begin + DestroyProperties; + CreateProperties; +end; + +procedure TcxCustomInplaceEditContainer.RepositoryItemPropertiesChanged( + Sender: TcxEditRepositoryItem); +begin + DoOnPropertiesChanged(Sender); +end; + +procedure TcxCustomInplaceEditContainer.RepositoryItemRemoved(Sender: TcxEditRepositoryItem); +begin + RepositoryItem := nil; +end; + +{ TcxHotTrackController } + +constructor TcxHotTrackController.Create(AControl: TcxEditingControl); +begin + FControl := AControl; + HintTimer := TcxTimer.Create(nil); + HintWindow := HintWindowClass.Create(nil); + HintWindow.Color := Application.HintColor; + ResetTimer; +end; + +destructor TcxHotTrackController.Destroy; +begin + HintWindow.Free; + HintTimer.Free; + inherited Destroy; +end; + +procedure TcxHotTrackController.CancelHint; +begin + InternalHideHint(HintTimer); +end; + +procedure TcxHotTrackController.Clear; +begin + PrevHitPoint := cxInvalidPoint; + PrevElement := nil; +end; + +procedure TcxHotTrackController.SetHotElement(AElement: TObject; + const APoint: TPoint); + + procedure CalculateHotState(AObject: TObject; const P: TPoint); + var + AIntf: IcxHotTrackElement; + begin + if Supports(AObject, IcxHotTrackElement, AIntf) then + AIntf.UpdateHotTrackState(P); + end; + +begin + if Control.IsLocked then + Clear + else + try + if AElement <> PrevElement then + begin + HintElement := PrevElement; + CalculateHotState(PrevElement, cxInvalidPoint); + CalculateHotState(AElement, APoint); + end + else + if Int64(PrevHitPoint) <> Int64(APoint) then + CalculateHotState(AElement, APoint); + finally + PrevHitPoint := APoint; + PrevElement := AElement; + if AElement <> HintElement then CancelHint; + if HintNeeded then InternalShowHint(Self); + end; +end; + +type + TCustomFormAccess = class(TCustomForm); + +function TcxHotTrackController.CanShowHint: Boolean; +var + AForm: TCustomForm; +begin + Result := FShowHint and not Control.Controller.LockShowHint; + if Result then + begin + AForm := GetParentForm(Control); + Result := ((AForm = nil) or AForm.Active or + (TCustomFormAccess(AForm).FormStyle = fsMDIForm) and Application.Active) and + not Control.IsDesigning and not Control.Dragging and + (Control.DragAndDropState = ddsNone) and + not ((Control.Controller.GetEditingViewInfo = PrevElement) and + Control.Controller.IsEditing); + end; +end; + +procedure TcxHotTrackController.CheckDestroyingElement(AElement: TObject); +begin + if (AElement = PrevElement) or (AElement = HintElement) then + begin + if AElement = PrevElement then + PrevElement := nil; + if AElement = HintElement then + begin + CancelHint; + HintElement := nil; + end; + SetHotElement(nil, cxInvalidPoint); + end; +end; + +procedure TcxHotTrackController.CheckHintClass; +begin + if HintWindow.ClassType <> HintWindowClass then + begin + HintWindow.Free; + HintWindow := HintWindowClass.Create(nil); + end; +end; + +procedure TcxHotTrackController.DoHideHint; +begin +end; + +procedure TcxHotTrackController.DoShowHint; +begin +end; + +function TcxHotTrackController.HintNeeded: Boolean; +var + P: TPoint; + AIntf: IcxHotTrackElement; + AIsNeedOffsetHint: Boolean; +begin + Result := Supports(PrevElement, IcxHotTrackElement, AIntf) and CanShowHint; + if Result then + begin + CheckHintClass; + AIsNeedOffsetHint := False; + P := cxPoint(PrevHitPoint.X, PrevHitPoint.Y); + Result := AIntf.IsNeedHint(cxScreenCanvas, P, Hint, HintIsMultiLine, + HintRect, AIsNeedOffsetHint); + if Result then + begin + P := Control.ClientToScreen(AIntf.GetOrigin); + if AIsNeedOffsetHint then Inc(P.Y, cxGetCursorSize.cy); + THintWindowAccess(HintWindow).Canvas.Font.Assign(cxScreenCanvas.Font); + if PrevElement is TcxEditCellViewInfo then + begin + Dec(P.X); + Dec(P.Y); + end; + HintRect := cxRectOffset(HintWindow.CalcHintRect(Screen.Width, Hint, nil), P.X, P.Y); + end; + end; +end; + +procedure TcxHotTrackController.InitTimer( + AInterval: Integer; AEnabled: Boolean; const AHandler: TNotifyEvent); +begin + with HintTimer do + begin + Enabled := False; + Interval := AInterval; + OnTimer := AHandler; + Enabled := AEnabled; + end; +end; + +procedure TcxHotTrackController.InternalHideHint(Sender: TObject); +begin + if HintVisible then + try + DoHideHint; + finally + HintVisible := False; + ShowWindow(HintWindow.Handle, SW_HIDE); //MUST USE ShowWindow - WIN32 BUG + ResetTimer; + end; +end; + +procedure TcxHotTrackController.InternalShowHint(Sender: TObject); +begin + if not HintVisible and (HintElement <> PrevElement) then + begin + DoShowHint; + HintElement := PrevElement; + HintVisible := True; + HintWindow.ActivateHint(HintRect, Hint); + InitTimer(Application.HintHidePause, (Application.HintHidePause > 0), InternalHideHint); + end; +end; + +procedure TcxHotTrackController.ResetTimer; +begin + InitTimer(Application.HintPause, False, InternalShowHint); +end; + +{ TcxEditingController } + +constructor TcxEditingController.Create(AController: TcxCustomControlController); +begin + inherited Create; + FController := AController; + FEditList := TcxInplaceEditList.Create; +end; + +destructor TcxEditingController.Destroy; +begin + StopEditShowingTimer; + FEditList.Free; + inherited Destroy; +end; + +function TcxEditingController.GetEditingControl: TcxEditingControl; +begin + Result := FController.EditingControl; +end; + +function TcxEditingController.GetEditingProperties: TcxCustomEditProperties; +begin + if IsEditing and not EditingControl.IsDestroying then + with Controller.EditingViewInfo do + begin + Result := EditContainer.DoGetEditProperties(GetViewInfoData); + EditContainer.DoGetEditingProperties(GetViewInfoData, Result); + end + else + Result := nil; +end; + +function TcxEditingController.GetIsDragging: Boolean; +begin + with EditingControl do + Result := Dragging or (DragAndDropState = ddsInProcess); +end; + +function TcxEditingController.GetIsEditing: Boolean; +begin + Result := FEditingItem <> nil; +end; + +procedure TcxEditingController.SetEditingItem(Value: TcxCustomInplaceEditContainer); +begin + if FEditingItem <> Value then + begin + if FEditingItemSetting then Exit; + FEditingItemSetting := True; + try + if Value <> nil then + begin + if not Value.CanEdit or not EditingControl.DoEditing(Value) then Exit; + Value.Focused := True; + end; + HideEdit(False); + FEditingItem := Value; + if IsEditing then + try + ShowEdit(Value); + if not FEditPreparing and (FEdit = nil) then + FEditingItem := nil; + except + FEditingItem := nil; + raise; + end; + finally + FEditingItemSetting := False; + end; + end; +end; + +procedure TcxEditingController.EditShowingTimerHandler(Sender: TObject); +begin + StopEditShowingTimer; + FEditShowingTimerItem.Editing := True; + Controller.FEditingBeforeDrag := Controller.IsEditing; +end; + +procedure TcxEditingController.AfterViewInfoCalculate; +begin + if IsEditing and (not FIsEditPlaced or FEditingItem.IsEditPartVisible) then + begin + CancelEditUpdatePost; + FEdit.Left := cxInvisibleCoordinate; + end; +end; + +procedure TcxEditingController.BeforeViewInfoCalculate; +begin + FIsEditPlaced := False; +end; + +procedure TcxEditingController.CancelEditUpdatePost; +begin + FEditUpdateNeeded := False; +end; + +function TcxEditingController.CanRemoveEditFocus: Boolean; +begin + Result := not (IsEditing and FEdit.IsFocused and not FEditHiding); +end; + +procedure TcxEditingController.CheckEditUpdatePost; +begin + if FEditUpdateNeeded then DoUpdateEdit; +end; + +procedure TcxEditingController.AssignEditEvents; +begin + with FEdit do + begin + OnAfterKeyDown := EditAfterKeyDown; + OnEditing := EditEditing; + OnPostEditValue := EditPostEditValue; + OnExit := EditExit; + OnDblClick := EditDblClick; + OnFocusChanged := EditFocusChanged; + OnKeyDown := EditKeyDown; + OnKeyPress := EditKeyPress; + OnKeyUp := EditKeyUp; + InternalProperties.OnChange := EditChanged; + InternalProperties.OnEditValueChanged := EditValueChanged; + end; +end; + +procedure TcxEditingController.UnassignEditEvents; +begin + with FEdit do + begin + OnAfterKeyDown := nil; + OnEditing := nil; + OnPostEditValue := nil; + OnExit := nil; + OnDblClick := nil; + OnFocusChanged := nil; + OnKeyDown := nil; + OnKeyPress := nil; + OnKeyUp := nil; + InternalProperties.OnChange := FPrevEditOnChange; + InternalProperties.OnEditValueChanged := FPrevEditOnEditValueChanged; + end; +end; + +procedure TcxEditingController.DoUpdateEdit; +var + AEditViewInfo: TcxEditCellViewInfo; +begin + CancelEditUpdatePost; + if IsEditing and (FEdit <> nil) then + begin + with Controller do + begin + BeforeShowEdit; + AEditViewInfo := GetFocusedCellViewInfo(FFocusedItem); + end; + if (AEditViewInfo = nil) or + not AEditViewInfo.Visible or cxRectIsEmpty(AEditViewInfo.EditRect) then + FEdit.Left := cxInvisibleCoordinate + else + begin + if FEditPreparing then + begin + AEditViewInfo.Refresh(False); + cxAssignEditStyle(AEditViewInfo); + FEdit.Style.Assign(EditingControl.EditStyle); + end; + FEdit.BoundsRect := AEditViewInfo.EditRect; + FEdit.Visible := True; + end; + end; +end; + +function TcxEditingController.GetHideEditOnExit: Boolean; +begin + Result := not Controller.GetAlwaysShowEditor or Controller.EditingControl.IsFocused; +end; + +function TcxEditingController.GetHideEditOnFocusedRecordChange: Boolean; +begin +//TODO + Result := not FController.GetAlwaysShowEditor or + (FEditingItem <> nil) and Assigned(FEditingItem.OnGetEditProperties) {or FEditingItem.ShowButtons(False)} or +// (esoAlwaysHotTrack in FEditingItem.FocusedCellViewInfo.Properties.GetSupportedOperations)) or // TODO: HitTestController + Assigned(EditingControl.OnEditing) or Assigned(EditingControl.OnInitEdit); +end; + +procedure TcxEditingController.HideInplaceEditor; +begin + if FEdit <> nil then + begin + UnassignEditEvents; + FEdit.EditModified := False; + FController.AllowCheckEdit := False; + try + FController.SetFocus; + finally + FController.AllowCheckEdit := True; + end; + FEdit.Visible := False; + FEdit := nil; + end; +end; + +procedure TcxEditingController.InitEdit; +begin + with FEdit.InternalProperties do + begin + FPrevEditOnChange := OnChange; + FPrevEditOnEditValueChanged := OnEditValueChanged; + OnChange := nil; + OnEditValueChanged := nil; + end; + FEdit.InplaceParams.Position := FEditingItem.FocusedCellViewInfo.GetInplaceEditPosition; + UpdateEdit; + UpdateEditValue; + AssignEditEvents; + EditingControl.DoInitEdit(FEditingItem, FEdit); +end; + +function TcxEditingController.PrepareEdit(AItem: TcxCustomInplaceEditContainer; + AIsMouseEvent: Boolean): Boolean; +var + AEditCellViewInfo: TcxEditCellViewInfo; +begin + Result := False; + Controller.CancelCheckEditPost; + if FEditPreparing or FEditHiding or (AItem = nil) or IsDragging then Exit; + if AItem.Editing and not FEditingItemSetting then + begin + Result := (FEdit <> nil) and (FController.EditingControl.Focused and + not FEdit.IsFocused or AIsMouseEvent); + Exit; + end; + FEditPreparing := True; + try + Result := FController.EditingControl.Focused; + if not Result then Exit; + Controller.BeforeShowEdit; + AEditCellViewInfo := Controller.GetFocusedCellViewInfo(AItem); + AItem.Editing := AEditCellViewInfo <> nil; + Result := AItem.Editing; + if not Result then Exit; + try + AItem.FEditValueSource := EditingProperties.GetEditValueSource(True); + FEdit := FEditList.GetEdit(EditingProperties); + FEdit.Visible := False; + FEdit.Parent := nil; + FEdit.Parent := EditingControl; + except + AItem.Editing := False; + Result := False; + raise; + end; + FEditingItem.FocusedCellViewInfo.Invalidate; + InitEdit; + finally + FEditPreparing := False; + end; +end; + +procedure TcxEditingController.UpdateEdit; +begin + if (FEdit = nil) or (FEditingItem.FocusedCellViewInfo = nil) then Exit; + if FEditPreparing then + DoUpdateEdit + else + PostEditUpdate; + FIsEditPlaced := True; +end; + +procedure TcxEditingController.UpdateEditValue; +begin + if IsEditing and not FEditHiding and not FInitiatingEditing and + not FEdit.IsPosting then + begin + FEdit.EditValue := EditingItem.EditValue; + FEdit.SelectAll; + end; +end; + +procedure TcxEditingController.UpdateValue; +begin + if IsEditing and FEdit.EditModified then + begin + FEdit.ValidateEdit(True); + FEditingItem.EditValue := FEdit.EditValue; + if FEdit <> nil then + FEdit.ModifiedAfterEnter := False; + end; +end; + +procedure TcxEditingController.EditAfterKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if FController.IsKeyForController(Key, Shift) then + FController.KeyDown(Key, Shift); +end; + +procedure TcxEditingController.EditChanged(Sender: TObject); +begin + if Assigned(FPrevEditOnChange) then FPrevEditOnChange(Sender); + EditingControl.DoEditChanged(FEditingItem); +end; + +procedure TcxEditingController.EditDblClick(Sender: TObject); +begin + Controller.DoEditDblClick(Sender); +end; + +procedure TcxEditingController.EditEditing(Sender: TObject; var CanEdit: Boolean); +begin + FInitiatingEditing := True; + try + CanEdit := (EditingItem <> nil) and EditingItem.CanInitEditing; + finally + FInitiatingEditing := False; + end; +end; + +procedure TcxEditingController.EditEnter(Sender: TObject); +begin + if not Controller.Focused then + begin + Controller.Focused := True; + Controller.ControlFocusChanged; + end; +end; + +procedure TcxEditingController.EditExit(Sender: TObject); +begin + if HideEditOnExit then + try + HideEdit(not FController.GetCancelEditingOnExit); + except + if IsEditing then + begin + FEdit.SetFocus; + FIsErrorOnEditExit := True; + end; + raise; + end; + FController.EditingControl.FocusChanged; +end; + +procedure TcxEditingController.EditFocusChanged(Sender: TObject); +begin + Controller.FFocused := EditingControl.IsFocused or + (IsEditing and (Edit <> nil) and Edit.Focused); + Controller.EditingControl.ViewInfo.UpdateSelection; +end; + +procedure TcxEditingController.EditKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +var + AModified: Boolean; +begin + if Assigned(EditingControl.OnKeyDown) then + EditingControl.OnKeyDown(EditingControl, Key, Shift); + with FController do + begin + BeforeEditKeyDown(Key, Shift); + if not EditingControl.IsScrollingContent and IsKeyForController(Key, Shift) then + FController.MakeFocusedItemVisible; + end; + case Key of + VK_RETURN: + begin + HideEdit(True); + if FController.GetGoToNextCellOnEnter then + begin + FController.BlockRecordKeyboardHandling := True; + try + FController.KeyDown(Key, Shift); + finally + FController.BlockRecordKeyboardHandling := False; + end; + ShowEdit; + end + else + FController.CheckEdit; + Key := 0; + end; + VK_ESCAPE: + begin + AModified := FEdit.EditModified; + HideEdit(False); + FController.CheckEdit; + if AModified then Key := 0; + end; + VK_DELETE: + if Shift = [ssCtrl] then + begin + FController.KeyDown(Key, Shift); + Key := 0; + end; + end; +end; + +procedure TcxEditingController.EditKeyPress(Sender: TObject; var Key: Char); +begin + if Assigned(EditingControl.OnKeyPress) then + EditingControl.OnKeyPress(EditingControl, Key); + if Key = #27 then Key := #0; + FController.MakeFocusedItemVisible; +end; + +procedure TcxEditingController.EditKeyUp(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if Assigned(EditingControl.OnKeyUp) then + EditingControl.OnKeyUp(EditingControl, Key, Shift); +end; + +procedure TcxEditingController.EditPostEditValue(Sender: TObject); +begin + UpdateValue; +end; + +procedure TcxEditingController.EditValueChanged(Sender: TObject); +begin + if Assigned(FPrevEditOnEditValueChanged) then FPrevEditOnEditValueChanged(Sender); + EditingControl.DoEditValueChanged(FEditingItem); +end; + +procedure TcxEditingController.HideEdit(Accept: Boolean); +var + AEditViewInfo: TcxEditCellViewInfo; + AItem: TcxCustomInplaceEditContainer; +begin + FController.CancelCheckEditPost; + CancelEditUpdatePost; + StopEditShowingTimer; + if FEditHiding or not IsEditing or EditingControl.IsDestroying then Exit; + FEditHiding := True; + try + if Accept then + begin + if not FEdit.Deactivate then raise EAbort.Create(''); + EditingControl.DataController.PostEditingData; + if FController.IsImmediatePost then + EditingControl.DataController.Post; + if FEditingItem = nil then Exit; + AEditViewInfo := FEditingItem.FocusedCellViewInfo; + if AEditViewInfo <> nil then + FEdit.InternalProperties.Update(AEditViewInfo.Properties); + end; + AItem := EditingItem; + if not EditingControl.IsDestroying then + EditingControl.DoEdited(AItem); + EditingItem := nil; + Controller.RefreshFocusedCellViewInfo(AItem); + HideInplaceEditor; + FIsErrorOnEditExit := False; + finally + FEditHiding := False; + end; +end; + +procedure TcxEditingController.PostEditUpdate; +begin + FEditUpdateNeeded := True; +end; + +procedure TcxEditingController.RemoveEdit(AProperties: TcxCustomEditProperties); +begin + if EditingProperties = AProperties then + EditingItem := nil; + FEditList.RemoveItem(AProperties); +end; + +procedure TcxEditingController.ShowEdit(AItem: TcxCustomInplaceEditContainer = nil); +begin + if AItem = nil then AItem := FController.FocusedItem; + if PrepareEdit(AItem, False) then + FEdit.Activate(AItem.FEditData); +end; + +procedure TcxEditingController.ShowEdit(AItem: TcxCustomInplaceEditContainer; Key: Char); +begin + if PrepareEdit(AItem, False) then + FEdit.ActivateByKey(Key, AItem.FEditData); +end; + +procedure TcxEditingController.ShowEdit(AItem: TcxCustomInplaceEditContainer; + Shift: TShiftState; X, Y: Integer); +begin + if PrepareEdit(AItem, True) then + FEdit.ActivateByMouse(Shift, X, Y, AItem.FEditData); +end; + +procedure TcxEditingController.StartEditShowingTimer(AItem: TcxCustomInplaceEditContainer); +begin + StopEditShowingTimer; + FEditShowingTimerItem := AItem; + FEditShowingTimer := TcxTimer.Create(nil); + with FEditShowingTimer do + begin + Interval := GetDblClickInterval; + OnTimer := EditShowingTimerHandler; + end; +end; + +procedure TcxEditingController.StopEditShowingTimer; +begin + FreeAndNil(FEditShowingTimer); +end; + +{ TcxSizingDragAndDropObject } + +procedure TcxSizingDragAndDropObject.BeginDragAndDrop; +begin + if (DragItem = nil) or (DragSizing = nil) then + raise EAbort.Create(''); + FDirection := Controller.GetResizeDirection; + FDragBounds := DragSizing.GetSizingBoundsRect(FDirection); + FSizeDelta := DragSizing.GetSizingIncrement(FDirection); + FStartPos := CurMousePos; + FDragPos := GetDragPos(CurMousePos); + FDynamicUpdate := DragSizing.IsDynamicUpdate; + inherited BeginDragAndDrop; +end; + +procedure TcxSizingDragAndDropObject.DirtyChanged; +begin + if not DynamicUpdate and cxRectIntersect(GetSizingMarkBounds, Control.ClientBounds) then + Canvas.InvertRect(GetSizingMarkBounds); + inherited DirtyChanged; +end; + +procedure TcxSizingDragAndDropObject.DragAndDrop( + const P: TPoint; var Accepted: Boolean); +var + ADragPos: TPoint; +begin + ADragPos := GetDragPos(P); + with FDragBounds do + if (DragCoord[P] < DragCoord[TopLeft]) or (DragCoord[P] > DragCoord[BottomRight]) then Exit; + if not DynamicUpdate then + FDelta := Round((DragCoord[P] - DragCoord[StartPos]) / SizeDelta) + else + FDelta := Trunc((DragCoord[P] - DragCoord[StartPos]) / SizeDelta); + if (FDelta = 0) and (DragCoord[ADragPos] = DragCoord[DragPos]) then Exit; + Dirty := True; + FDragPos := ADragPos; + if DynamicUpdate then + begin + DragSizing.SetSizeDelta(Direction, Delta); + FStartPos := P; + end; + inherited DragAndDrop(P, Accepted); +end; + +procedure TcxSizingDragAndDropObject.EndDragAndDrop(Accepted: Boolean); +begin + inherited EndDragAndDrop(Accepted); + if not DynamicUpdate and (Delta <> 0) and not Controller.FDragCancel then + DragSizing.SetSizeDelta(Direction, Delta); +end; + +function TcxSizingDragAndDropObject.GetDragAndDropCursor( + Accepted: Boolean): TCursor; +begin + if IsHorzSizing then + Result := crHSplit + else + Result := crVSplit; +end; + +function TcxSizingDragAndDropObject.GetDragCoord(APoint: TPoint): Integer; +begin + if IsHorzSizing then + Result := APoint.X + else + Result := APoint.Y; +end; + +function TcxSizingDragAndDropObject.GetDragPos(const APoint: TPoint): TPoint; +begin + Result := FStartPos; + with Result do + begin + if IsHorzSizing then + Inc(X, Round((DragCoord[APoint] - X) / SizeDelta) * SizeDelta) + else + Inc(Y, Round((DragCoord[APoint] - Y) / SizeDelta) * SizeDelta); + end; +end; + +function TcxSizingDragAndDropObject.GetImmediateStart: Boolean; +begin + Result := True; +end; + +function TcxSizingDragAndDropObject.GetSizingMarkBounds: TRect; +begin + if IsHorzSizing then + Result := cxRectSetLeft(FDragBounds, + DragPos.X - cxSizingMarkWidth div 1, cxSizingMarkWidth) + else + Result := cxRectSetTop(FDragBounds, + DragPos.Y - cxSizingMarkWidth div 1, cxSizingMarkWidth); +end; + +function TcxSizingDragAndDropObject.GetCanvas: TcxCanvas; +begin + Result := TcxEditingControl(Control).Canvas; +end; + +function TcxSizingDragAndDropObject.GetController: TcxCustomControlController; +begin + Result := TcxEditingControl(Control).Controller; +end; + +function TcxSizingDragAndDropObject.GetDragItem: TObject; +begin + Result := Controller.DragItem; +end; + +function TcxSizingDragAndDropObject.GetDragSizing: IcxDragSizing; +begin + Supports(DragItem, IcxDragSizing, Result); +end; + +function TcxSizingDragAndDropObject.GetIsSizingKind(Index: Integer): Boolean; +begin + Result := TcxDragSizingDirection(Index) = FDirection; +end; + +{ TcxAutoScrollingObject } + +constructor TcxAutoScrollingObject.Create(AOwner: TObject); +begin + FOwner := AOwner; + FTimer := TcxTimer.Create(nil); + FTimer.Enabled := False; + FTimer.Interval := cxScrollWidthDragInterval; + FTimer.OnTimer := TimerHandler; +end; + +destructor TcxAutoScrollingObject.Destroy; +begin + FTimer.Enabled := False; + FTimer.Free; + inherited Destroy; +end; + +function TcxAutoScrollingObject.Check(APos: TPoint): Boolean; +begin + Result := cxRectPtIn(FArea, APos); + FTimer.Enabled := Result; +end; + +procedure TcxAutoScrollingObject.SetParams( + const Area: TRect; AKind: TScrollBarKind; ACode: TScrollCode; AIncrement: Integer); +begin + FArea := Area; + FCode := ACode; + FKind := AKind; + if ACode = scLineUp then + AIncrement := -AIncrement; + FIncrement := AIncrement; +end; + +procedure TcxAutoScrollingObject.Stop; +begin + FTimer.Enabled := False; +end; + +procedure TcxAutoScrollingObject.DoScrollInspectingControl; +var + AMin, AMax, APos, ANewPos: Integer; +begin + with GetScrollBar(FKind) do + begin + AMin := Min; + AMax := Max - PageSize + 1; + APos := Position; + ANewPos := APos + FIncrement; + if ANewPos < AMin then ANewPos := AMin + else + if ANewPos > AMax then ANewPos := AMax; + end; + if GetScrollBar(FKind).Visible and (ANewPos <> APos) then + Control.Controller.Scroll(FKind, FCode, ANewPos); +end; + +function TcxAutoScrollingObject.GetScrollBar(AKind: TScrollBarKind): TcxControlScrollBar; +begin + with Control do + if AKind = sbHorizontal then Result := HScrollBar else Result := VScrollBar; +end; + +procedure TcxAutoScrollingObject.TimerHandler(Sender: TObject); +begin + DoScrollInspectingControl; +end; + +function TcxAutoScrollingObject.GetControl: TcxEditingControl; +begin + Result := nil; +end; + +{ TcxDragDropAutoScrollingObject } + +function TcxDragDropObjectAutoScrollingObject.GetControl: TcxEditingControl; +begin + Result := TcxEditingControl(TcxDragAndDropObjectAccess(FOwner).Control); +end; + +{ TcxControllerAutoScrollingObject } + +function TcxControllerAutoScrollingObject.CheckBounds(APos: TPoint): Boolean; +begin + FDirections := []; + Result := not cxRectPtIn(FArea, APos); + if Result then + begin + if FCheckHorz then + if APos.X <= FArea.Left then + Include(FDirections, nLeft) + else + if APos.X >= FArea.Right then + Include(FDirections, nRight); + if FCheckVert then + if APos.Y <= FArea.Top then + Include(FDirections, nTop) + else + if APos.Y >= FArea.Bottom then + Include(FDirections, nBottom); + Result := Result and (FDirections <> []); + end; + FTimer.Enabled := Result; +end; + +procedure TcxControllerAutoScrollingObject.SetBoundsParams( + const AClientArea: TRect; ACheckHorz, ACheckVert: Boolean; AIncrement: Integer); +begin + FArea := AClientArea; + FCheckHorz := ACheckHorz; + FCheckVert := ACheckVert; + FIncrement := AIncrement; + FBoundsMode := True; +end; + +procedure TcxControllerAutoScrollingObject.DoScrollInspectingControl; + + procedure CheckDirection(ADir: TcxNeighbor); + const + Kinds: array[Boolean] of TScrollBarKind = (sbVertical, sbHorizontal); + Codes: array[Boolean] of TScrollCode = (scLineDown, scLineUp); + var + AMin, AMax, APos, ANewPos: Integer; + AKind: TScrollBarKind; + ACode: TScrollCode; + begin + AKind := Kinds[ADir in [nLeft, nRight]]; + with GetScrollBar(AKind) do + begin + if Visible then + begin + AMin := Min; + AMax := Max - PageSize + 1; + APos := Position; + ACode := Codes[ADir in [nLeft, nTop]]; + if ACode = scLineDown then + ANewPos := APos + FIncrement + else + ANewPos := APos - FIncrement; + if ANewPos < AMin then ANewPos := AMin + else + if ANewPos > AMax then ANewPos := AMax; + if ANewPos <> APos then + Control.Controller.Scroll(AKind, ACode, ANewPos); + end; + end; + end; + +var + I: TcxNeighbor; +begin + if not FBoundsMode then + inherited DoScrollInspectingControl + else + for I := nLeft to nBottom do + if I in FDirections then + CheckDirection(I); +end; + +function TcxControllerAutoScrollingObject.GetControl: TcxEditingControl; +begin + Result := TcxCustomControlController(FOwner).EditingControl; +end; + +{ TcxPlaceArrows } + +constructor TcxPlaceArrows.CreateArrows( + AColor: TColor; ABorderColor: TColor = clDefault); +begin + inherited Create(); + FBorderColor := ABorderColor; + FColor := AColor; +{$IFDEF DELPHI6} + AlphaBlend := False; +{$ENDIF} +end; + +function TcxPlaceArrows.MoveTo(ARect: TRect; ASide: TcxBorder): Boolean; +var + R: TRect; + ARgn: HRGN; +begin + HandleNeeded; + Result := not EqualRect(ARect, FPrevRect) or (ASide <> FPrevSide) or not Visible; + if Result then + begin + Hide; + FPrevRect := ARect; + FPrevSide := ASide; + ARgn := CreateArrowsRgns(ARect, ASide); + GetRgnBox(ARgn, R); + SetBounds(R.Left, R.Top, R.Right - R.Left, R.Bottom - R.Top); + OffsetRect(ARect, -R.Left, -R.Top); + OffsetRgn(ARgn, -R.Left, -R.Top); + cxDrawArrows(Canvas.Canvas, ARect, ASide, Color, BorderColor); + WindowRegion := ARgn; + Show; + end; +end; + +function TcxPlaceArrows.CreateArrowsRgns(const ARect: TRect; ASide: TcxBorder): HRGN; +var + ArrowRgns: array[0..1, 0..6, 0..1] of Integer; + BaseLine: array[0..1, 0..1] of Integer; + I, J, K: Integer; + ArrowRgn: HRGN; +const + BaseRgns: array[0..3, 0..6, 0..1] of Integer = + (((0, 0), (-5, -6), (-2, -6), (-2, -9), (3, -9), (3, -6), (6, -6)), + ((0, -1), (6, 6), (3, 6), (3, 9), (-2, 9), (-2, 6), (-6, 6)), + ((0, 0), (-6, -6), (-6, -2), (-9, -2), (-9, 3), (-6, 3), (-6, 6)), + ((0, 0), (6, 6), (6, 3), (9, 3), (9, -2), (6, -2), (6, -6))); +begin + with ARect do + begin + BaseLine[0, 0] := Left; + BaseLine[0, 1] := Top; + BaseLine[1, 0] := Right; + BaseLine[1, 1] := Bottom; + end; + if ASide in [bLeft, bBottom] then + begin + BaseLine[Byte(ASide = bLeft), 0] := ARect.Left; + BaseLine[Byte(ASide = bLeft), 1] := ARect.Bottom; + end + else + begin + BaseLine[Byte(ASide = bTop), 0] := ARect.Right; + BaseLine[Byte(ASide = bTop), 1] := ARect.Top; + end; + Move(BaseRgns[Byte(ASide in [bTop, bBottom]) shl 1], ArrowRgns, SizeOf(ArrowRgns)); + for I := 0 to 1 do + for J := 0 to 6 do + for K := 0 to 1 do + Inc(ArrowRgns[I, J, K], BaseLine[I, K]); + Result := CreateRectRgn(0, 0, 0, 0); + for I := 0 to 1 do + begin + ArrowRgn := CreatePolygonRgn(ArrowRgns[I], Length(ArrowRgns[I]), ALTERNATE); + CombineRgn(Result, Result, ArrowRgn, RGN_OR); + DeleteObject(ArrowRgn); + end; +end; + +procedure TcxPlaceArrows.SetWindowRegion(ARegion: HRGN); +begin + if FWindowRegion <> 0 then + DeleteObject(FWindowRegion); + FWindowRegion := ARegion; + if ARegion <> 0 then + SetWindowRgn(Handle, ARegion, False); +end; + +{ TcxBaseDragAndDropObject } + +function TcxBaseDragAndDropObject.GetDragAndDropCursor( + Accepted: Boolean): TCursor; +begin + if Accepted then + Result := EditingControl.DragCursor + else + Result := crNoDrop; +end; + +function TcxBaseDragAndDropObject.GetEditingControl: TcxEditingControl; +begin + Result := TcxEditingControl(Control); +end; + +{ TcxCustomControlDragAndDropObject } + +constructor TcxCustomControlDragAndDropObject.Create(AControl: TcxControl); +begin + inherited Create(AControl); + FAutoScrollObjects := TList.Create; +end; + +destructor TcxCustomControlDragAndDropObject.Destroy; +var + I: Integer; +begin + for I := 0 to FAutoScrollObjects.Count - 1 do + TObject(FAutoScrollObjects.List^[I]).Free; + FAutoScrollObjects.Free; + FDragImage.Free; + inherited Destroy; +end; + +procedure TcxCustomControlDragAndDropObject.AddAutoScrollingObject( + const ARect: TRect; AKind: TScrollBarKind; ACode: TScrollCode); +var + AObj: TcxAutoScrollingObject; +begin + AObj := GetAutoScrollingObjectClass.Create(Self); + if AKind = sbHorizontal then + AObj.SetParams(ARect, AKind, ACode, GetHorzScrollInc) + else + AObj.SetParams(ARect, AKind, ACode, GetVertScrollInc); + FAutoScrollObjects.Add(AObj); +end; + +procedure TcxCustomControlDragAndDropObject.BeginDragAndDrop; +begin + inherited BeginDragAndDrop; + DrawDragImage; +end; + +procedure TcxCustomControlDragAndDropObject.DragAndDrop(const P: TPoint; + var Accepted: Boolean); +var + R: TRect; +begin + inherited DragAndDrop(P, Accepted); + R := cxRectOffset(PictureSize, [OrgOffset, HotSpot, CurMousePos]); + DrawImage(R.TopLeft); +//lcm + if not CheckScrolling(P) then; +// Accepted := cxRectPtIn(GetAcceptedRect, P); + FCanDrop := Accepted; +end; + +procedure TcxCustomControlDragAndDropObject.DrawDragImage; +var + AOrg: TRect; + ASaveCanvas: TcxCanvas; +begin + AOrg := DisplayRect; + with AOrg do + FPictureSize := Rect(0, 0, Right - Left, Bottom - Top); + + FDragImage := TcxDragImage.Create; + FDragImage.SetBounds(0, 0, FPictureSize.Right, FPictureSize.Bottom); + + FHotSpot.X := AOrg.Left - CurMousePos.X; + FHotSpot.Y := AOrg.Top - CurMousePos.Y; + cxSetCanvasOrg(FDragImage.Canvas.Canvas, AOrg); + + FOrgOffset := Control.ClientToScreen(FOrgOffset); + ASaveCanvas := TcxEditingControl(Control).Painter.FCanvas; + TcxEditingControl(Control).Painter.FCanvas := FDragImage.Canvas; + try + Paint; + finally + TcxEditingControl(Control).Painter.FCanvas := ASaveCanvas; + cxSetCanvasOrg(FDragImage.Canvas.Canvas, AOrg); + end; +end; + +procedure TcxCustomControlDragAndDropObject.DrawImage( + const APoint: TPoint); +begin + DragImage.MoveTo(APoint); + DragImage.Show; +end; + +procedure TcxCustomControlDragAndDropObject.EndDragAndDrop( + Accepted: Boolean); +begin + StopScrolling; + inherited EndDragAndDrop(Accepted); +end; + +function TcxCustomControlDragAndDropObject.GetAcceptedRect: TRect; +begin + Result := cxNullRect; +end; + +function TcxCustomControlDragAndDropObject.GetAutoScrollingObjectClass: TcxAutoScrollingObjectClass; +begin + Result := TcxDragDropObjectAutoScrollingObject; +end; + +function TcxCustomControlDragAndDropObject.GetDisplayRect: TRect; +begin + cxAbstractError; +end; + +function TcxCustomControlDragAndDropObject.GetDragAndDropCursor( + Accepted: Boolean): TCursor; +const + DragCursors: array[Boolean] of TCursor = (crcxNoDrop, crDefault); +begin + Result := DragCursors[Accepted]; +end; + +function TcxCustomControlDragAndDropObject.GetHorzScrollInc: Integer; +begin + Result := 1; +end; + +function TcxCustomControlDragAndDropObject.GetVertScrollInc: Integer; +begin + Result := 1; +end; + +procedure TcxCustomControlDragAndDropObject.OwnerImageChanged; +begin + DrawImage(cxPointOffset(cxPointOffset(CurMousePos, FOrgOffset), HotSpot)); +end; + +procedure TcxCustomControlDragAndDropObject.OwnerImageChanging; +begin +end; + +procedure TcxCustomControlDragAndDropObject.Paint; +begin + cxAbstractError; +end; + +procedure TcxCustomControlDragAndDropObject.StopScrolling; +var + I: Integer; +begin + for I := 0 to AutoScrollObjectCount - 1 do + AutoScrollObjects[I].Stop; +end; + +function TcxCustomControlDragAndDropObject.CheckScrolling( + const P: TPoint): Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to AutoScrollObjectCount - 1 do + Result := Result or AutoScrollObjects[I].Check(P); +end; + +function TcxCustomControlDragAndDropObject.GetAutoScrollObject( + Index: Integer): TcxAutoScrollingObject; +begin + Result := TcxAutoScrollingObject(FAutoScrollObjects[Index]); +end; + +function TcxCustomControlDragAndDropObject.GetAutoScrollObjectCount: Integer; +begin + Result := FAutoScrollObjects.Count; +end; + +function TcxCustomControlDragAndDropObject.GetCanvas: TcxCanvas; +begin + Result := TcxEditingControl(Control).Painter.FCanvas; +end; + +function TcxCustomControlDragAndDropObject.GetHitTestController: TcxCustomHitTestController; +begin + Result := TcxEditingControl(Control).Controller.HitTestController; +end; + +constructor TcxDragImageHelper.Create(AControl: TcxEditingControl; + ADragPos: TPoint); +begin + FDragControl := AControl; + FDragPos := ADragPos; + InitDragImage; +end; + +destructor TcxDragImageHelper.Destroy; +begin + if DragImageVisible then Hide; + FreeAndNil(DragImage); + inherited Destroy; +end; + +procedure TcxDragImageHelper.Hide; +begin + FDragImageVisible := False; + DragImage.Hide; +end; + +procedure TcxDragImageHelper.Show; +begin + FDragImageVisible := True; + DrawImage(MousePos); + DragImage.Show; +end; + +procedure TcxDragImageHelper.DragAndDrop(const P: TPoint); +var + R: TRect; +begin + R := cxRectOffset(DragPictureBounds, [HotSpot, P]); + MousePos := R.TopLeft; + DrawImage(MousePos); +end; + +function TcxDragImageHelper.GetDisplayRect: TRect; +begin + Result := DragControl.DragDropImageDisplayRect; +end; + +procedure TcxDragImageHelper.InitDragImage; +begin + DragPictureBounds := GetDisplayRect; + HotSpot := DragPictureBounds.TopLeft; + DragPictureBounds := cxRectOffset(DragPictureBounds, cxPointInvert(HotSpot)); + with FDragPos do + HotSpot := cxPoint(HotSpot.X - X, HotSpot.Y - Y); + DragImage := TcxDragImage.Create; + with cxRectSize(DragPictureBounds) do + DragImage.SetBounds(0, 0, Cx, Cy); + DragControl.DrawDragDropImage(DragImage.Image, DragImage.Canvas); +end; + +procedure TcxDragImageHelper.DrawImage( + const APoint: TPoint); +begin + DragImage.MoveTo(APoint); + if not DragImage.Visible then + DragImage.Show; +end; + +function TcxDragImageHelper.GetImageRect: TRect; +begin + Result := cxRectOffset(DragPictureBounds, MousePos) +end; + +procedure TcxDragImageHelper.SetDragImageVisible(Value: Boolean); +begin + if Value <> FDragImageVisible then + begin + FDragImageVisible := Value; + if Value then + Show + else + Hide; + end; +end; + +{ TcxCustomHitTestController } + +constructor TcxCustomHitTestController.Create(AOwner: TcxCustomControlController); +begin + FController := AOwner; + FHitPoint := cxInvalidPoint; +end; + +destructor TcxCustomHitTestController.Destroy; +begin +end; + +procedure TcxCustomHitTestController.ReCalculate; +begin + Recalculate(FHitPoint); +end; + +procedure TcxCustomHitTestController.ReCalculate(const APoint: TPoint); +begin + ClearState; + if Control.IsLocked then Exit; + FHitPoint := APoint; + if ViewInfo.IsDirty then ViewInfo.Calculate; + DoCalculate; +end; + +function TcxCustomHitTestController.AllowDesignMouseEvents( + X, Y: Integer; AShift: TShiftState): Boolean; +begin + RecalculateOnMouseEvent(X, Y, AShift); + Result := False; +end; + +procedure TcxCustomHitTestController.ClearState; +begin + FHitState := FHitState and echc_IsMouseEvent; +end; + +procedure TcxCustomHitTestController.DestroyingItem(AItem: TObject); +begin + if FHitTestItem = AItem then + begin + FHitTestItem := nil; + ClearState; + Controller.HotTrackController.CheckDestroyingElement(AItem); + end; +end; + +procedure TcxCustomHitTestController.DoCalculate; +var + I: Integer; + AItem: TcxEditCellViewInfo; +begin + with ViewInfo do + for I := 0 to FEditCellViewInfoList.Count - 1 do + begin + AItem := FEditCellViewInfoList.List^[I]; + if AItem.Visible and cxRectPtIn(AItem.ClipRect, HitPoint) then + begin + HitTestItem := AItem; + Exit; + end; + end; + HitTestItem := nil; +end; + +function TcxCustomHitTestController.GetCurrentCursor: TCursor; +begin + Result := crDefault; +end; + +procedure TcxCustomHitTestController.HitCodeChanged(APrevCode: Integer); +begin +end; + +procedure TcxCustomHitTestController.HitTestItemChanged(APrevHitTestItem: TObject); +begin +end; + +procedure TcxCustomHitTestController.RecalculateOnMouseEvent(X, Y: Integer; AShift: TShiftState); +begin + FShift := AShift; + IsMouseEvent := True; + try + ReCalculate(cxPoint(X, Y)); + finally + IsMouseEvent := False; + end; +end; + +function TcxCustomHitTestController.GetControl: TcxEditingControl; +begin + Result := Controller.EditingControl; +end; + +function TcxCustomHitTestController.GetCoordinate(AIndex: Integer): Integer; +begin + Result := PIntArray(@FHitPoint)^[AIndex]; +end; + +function TcxCustomHitTestController.GetEditCellViewInfo: TcxEditCellViewInfo; +begin + if IsItemEditCell then + Result := TcxEditCellViewInfo(FHitTestItem) + else + Result := nil; +end; + +function TcxCustomHitTestController.GetHasCode(Mask: TcxHitCode): Boolean; +begin + Result := FHitState and Mask <> 0; +end; + +function TcxCustomHitTestController.GetHotTrackController: TcxHotTrackController; +begin + Result := FController.HotTrackController; +end; + +function TcxCustomHitTestController.GetIsItemEditCell: Boolean; +begin + Result := FHitTestItem is TcxEditCellViewInfo; +end; + +function TcxCustomHitTestController.GetIsMouseEvent: Boolean; +begin + Result := FHitState and echc_IsMouseEvent <> 0; +end; + +function TcxCustomHitTestController.GetViewInfo: TcxCustomControlViewInfo; +begin + Result := Control.ViewInfo; +end; + +procedure TcxCustomHitTestController.SetCoordinate(AIndex: Integer; Value: Integer); +begin + PIntArray(@FHitPoint)^[AIndex] := Value; + Recalculate; +end; + +procedure TcxCustomHitTestController.SetHasCode(ACode: TcxHitCode; AValue: Boolean); +var + APrevState: TcxHitCode; +begin + if (FHitState and ACode <> 0) <> AValue then + begin + APrevState := FHitState; + if AValue then + FHitState := FHitState or ACode + else + FHitState := FHitState and not ACode; + HitCodeChanged(APrevState); + end; +end; + +procedure TcxCustomHitTestController.SetHitPoint(const APoint: TPoint); +begin + Recalculate(APoint); +end; + +procedure TcxCustomHitTestController.SetHitTestItem(AItem: TObject); +var + APrevItem: TObject; +begin + APrevItem := FHitTestItem; + FHitTestItem := AItem; + if IsMouseEvent then + with Controller.HotTrackController do + begin + ShowHint := Self.Control.Options.OptionsBehavior.CellHints; + SetHotElement(AItem, HitPoint); + end; + if APrevItem <> AItem then + HitTestItemChanged(APrevItem); +end; + +procedure TcxCustomHitTestController.SetIsMouseEvent(Value: Boolean); +begin + if Value then + FHitState := FHitState or echc_IsMouseEvent + else + FHitState := FHitState and not echc_IsMouseEvent; +end; + +{ TcxCustomCellNavigator } + +constructor TcxCustomCellNavigator.Create(AController: TcxCustomControlController); +begin + FController := AController; +end; + +procedure TcxCustomCellNavigator.FocusNextCell(AForward, ANextRow: Boolean; + AShift: TShiftState = []); +var + APrevRowIndex, APrevCellIndex, ARowIndex, ACellIndex: Integer; + + function IsValidCellIndex(ACount: Integer): Boolean; + begin + Result := cxInRange(ACellIndex, 0, ACount - 1) or + (MayFocusedEmptyRow(ARowIndex) and (ACount = 0)); + end; + +begin + Init(APrevRowIndex, APrevCellIndex, RowCount); + ARowIndex := APrevRowIndex; + ACellIndex := APrevCellIndex; + if ANextRow then + CalcNextRow(AForward, ARowIndex, ACellIndex) + else + ACellIndex := APrevCellIndex + cxIntOffs[AForward]; + SelectCell(AForward, ANextRow, ARowIndex, ACellIndex); + if not IsValidCellIndex(Count[ARowIndex]) then + begin + ACellIndex := APrevCellIndex; + ARowIndex := APrevRowIndex; + end; + if (ARowIndex <> APrevRowIndex) or (ACellIndex <> APrevCellIndex) then + SetFocusCell(ARowIndex, ACellIndex, AShift); +end; + +procedure TcxCustomCellNavigator.KeyDown(var Key: Word; Shift: TShiftState); +begin + case Key of + VK_LEFT, VK_RIGHT: + begin + FocusNextCell(Key = VK_RIGHT, False, Shift); + Key := 0; + end; + VK_TAB: + begin + FocusNextCell(not (ssShift in Shift), DownOnTab, Shift); + Key := 0; + end; + VK_RETURN, VK_F2: + if (Controller.FocusedItem <> nil) and (Shift = []) then + begin + Controller.FocusedItem.Editing := True; + if Controller.FocusedItem.Editing then + Key := 0; + end; + VK_UP, VK_DOWN: + begin + FocusNextCell(Key = VK_DOWN, True, Shift); + Key := 0; + end; + end; +end; + +procedure TcxCustomCellNavigator.KeyPress(var Key: Char); +begin + if (Key in EditStartChars) and (Controller.FocusedItem <> nil) then + begin + Controller.EditingController.ShowEdit(Controller.FocusedItem, Key); + Key := #0; + end; +end; + +procedure TcxCustomCellNavigator.Refresh; +begin + // todo: msn !!! need synchronize focused cell and row + {Init(ARowIndex, ACellIndex, ARowCount); + SetFocusCell(ARowIndex, ACellIndex);} +end; + +function TcxCustomCellNavigator.SelectCell(AForward, ANextRow: Boolean; + var ARowIndex, ACellIndex: Integer): TcxCustomInplaceEditContainer; +var + ACurRow, ACurCell, ARow: Integer; + AItemFound: Boolean; +begin + Result := nil; + ACurRow := ARowIndex; + ACurCell := ACellIndex; + repeat + AItemFound := False; + while not AItemFound do + begin + Result := GetCellContainer(ACurRow, ACurCell); + AItemFound := (Result = nil) or Result.CanFocus and Result.CanTabStop; + if not AItemFound then Inc(ACurCell, cxIntOffs[AForward]); + end; + if Result = nil then + begin + ACurCell := ACellIndex; + ARow := ACurRow; + if Controller.GetFocusCellOnCycle and not ANextRow then + CalcNextRow(AForward, ACurRow, ACurCell); + if (ARow <> ACurRow) and not ((Count[ACurRow] = 0) and MayFocusedEmptyRow(ACurRow)) then + ACurCell := cxSetValue(AForward, 0, Count[ACurRow] - 1) + else + break; + end + else + if MayFocusedEmptyRow(ARowIndex) then break; + until Result <> nil; + ARowIndex := ACurRow; + ACellIndex := ACurCell; +end; + +procedure TcxCustomCellNavigator.CalcNextRow(AForward: Boolean; + var ARowIndex, ACellIndex: Integer); +begin + cxAbstractError; +end; + +function TcxCustomCellNavigator.GetCellContainer( + ARowIndex, ACellIndex: Integer): TcxCustomInplaceEditContainer; +begin + Result := nil; + cxAbstractError; +end; + +function TcxCustomCellNavigator.GetCount(ARowIndex: Integer): Integer; +begin + Result := -1; + cxAbstractError; +end; + +procedure TcxCustomCellNavigator.Init( + var ARowIndex, ACellIndex, ARowCount: Integer); +begin + cxAbstractError; +end; + +function TcxCustomCellNavigator.MayFocusedEmptyRow(ARowIndex: Integer): Boolean; +begin + Result := False +end; + +procedure TcxCustomCellNavigator.SetFocusCell( + ARowIndex, ACellIndex: Integer; AShift: TShiftState); +begin + cxAbstractError; +end; + +procedure TcxCustomCellNavigator.DoKeyPress(var Key: Char); +begin + if FEatKeyPress then + FEatKeyPress := False + else + KeyPress(Key); +end; + +function TcxCustomCellNavigator.GetDataController: TcxCustomDataController; +begin + Result := FController.DataController; +end; + +{ TcxCustomDesignSelectionHelper } + +constructor TcxCustomDesignSelectionHelper.Create(AControl: TcxEditingControl); +begin + inherited Create; + FControl := AControl; +end; + +function TcxCustomDesignSelectionHelper.GetController: TcxCustomControlController; +begin + Result := FControl.Controller; +end; + +{ TcxCustomControlController } + +constructor TcxCustomControlController.Create(AOwner: TcxEditingControl); +begin + inherited Create; + FEditingControl := AOwner; + FAllowCheckEdit := True; + with EditingControl do + begin + FEditingController := GetEditingControllerClass.Create(Self); + FHitTestController := GetHitTestControllerClass.Create(Self); + FHotTrackController := GetHotTrackControllerClass.Create(FEditingControl); + end; + FNavigator := GetNavigatorClass.Create(Self); +end; + +destructor TcxCustomControlController.Destroy; +begin + FNavigator.Free; + FEditingController.Free; + FHotTrackController.Free; + FHitTestController.Free; + inherited Destroy; +end; + +procedure TcxCustomControlController.Clear; +begin + HitTestController.ClearState; + HotTrackController.Clear; +end; + +procedure TcxCustomControlController.DblClick; +begin +end; + +function TcxCustomControlController.GetCursor(X, Y: Integer): TCursor; +begin + Result := crDefault; +end; + +procedure TcxCustomControlController.KeyDown(var Key: Word; + Shift: TShiftState); +begin + if not BlockRecordKeyboardHandling then + begin + if IsIncSearching then Key := IncSearchKeyDown(Key, Shift); + FNavigator.KeyDown(Key, Shift); + end; + case Key of + VK_ESCAPE: + EditingControl.DataController.Cancel; + VK_RETURN: + if GetGoToNextCellOnEnter and ((Shift = []) or (Shift = [ssShift])) then + Navigator.FocusNextCell(Shift = [], Navigator.DownOnEnter, Shift); + VK_TAB: + if GetGoToNextCellOnTab and ((Shift = []) or (Shift = [ssShift])) then + begin + Navigator.FocusNextCell(Shift = [], Navigator.DownOnTab, Shift); + Key := 0; + end; + VK_PRIOR, VK_NEXT: + DoNextPage(Key = VK_NEXT, Shift); + end; +end; + +procedure TcxCustomControlController.KeyPress(var Key: Char); +begin + if FEatKeyPress then + begin + FEatKeyPress := False; + Exit; + end; + if (Key in IncSearchStartChars) and + (ItemForIncSearching <> nil) and ItemForIncSearching.CanIncSearch and + (DataController.EditState * [dceInsert, dceEdit] = []) then + begin + if Key <> #8 then + IncSearchingText := IncSearchingText + Key; + Key := #0; + end; + FNavigator.DoKeyPress(Key); +end; + +procedure TcxCustomControlController.KeyUp(var Key: Word; Shift: TShiftState); +begin +end; + +procedure TcxCustomControlController.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin +end; + +procedure TcxCustomControlController.MouseMove( + Shift: TShiftState; X, Y: Integer); +begin +end; + +procedure TcxCustomControlController.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin +end; + +procedure TcxCustomControlController.Reset; +begin + EditingController.PostEditUpdate; + FHitTestController.ClearState; + FHitTestController.FHitTestItem := nil; + FHotTrackController.Clear; +end; + +procedure TcxCustomControlController.WndProc(var Message: TMessage); +begin + case Message.Msg of + WM_IME_STARTCOMPOSITION: + EditingController.ShowEdit; + end; +end; + +// drag'n'drop +procedure TcxCustomControlController.BeginDragAndDrop; +begin + EditingController.HideEdit(True); +end; + +procedure TcxCustomControlController.DragAndDrop(const P: TPoint; var Accepted: Boolean); +begin +end; + +procedure TcxCustomControlController.EndDragAndDrop(Accepted: Boolean); +begin + if EditingControl.DragAndDropState = ddsNone then + CheckEdit; +end; + +function TcxCustomControlController.StartDragAndDrop( + const P: TPoint): Boolean; +begin + Result := False; +end; + +procedure TcxCustomControlController.MouseEnter; +begin + HitTestController.ReCalculate; +end; + +procedure TcxCustomControlController.MouseLeave; +begin + HideHint; + HitTestController.IsMouseEvent := True; + HitTestController.HitTestItem := nil; + HitTestController.IsMouseEvent := False; +end; + +procedure TcxCustomControlController.DoCancelMode; +begin + FocusChanged; +end; + +procedure TcxCustomControlController.AfterPaint; +begin + with EditingControl do + begin + if DragAndDropState = ddsInProcess then + if DragAndDropObject is TcxCustomControlDragAndDropObject then + TcxCustomControlDragAndDropObject(DragAndDropObject).OwnerImageChanged; + end; + ProcessCheckEditPost; +end; + +procedure TcxCustomControlController.BeforeEditKeyDown(var Key: Word; + var Shift: TShiftState); +begin +end; + +procedure TcxCustomControlController.BeforeMouseDown( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FEditingBeforeDrag := IsEditing; +end; + +procedure TcxCustomControlController.BeforePaint; +begin + with EditingControl do + begin + EditingController.CheckEditUpdatePost; + if DragAndDropState = ddsInProcess then + if DragAndDropObject is TcxCustomControlDragAndDropObject then + TcxCustomControlDragAndDropObject(DragAndDropObject).OwnerImageChanging; + end; +end; + +procedure TcxCustomControlController.BeforeShowEdit; +begin +end; + +procedure TcxCustomControlController.BehaviorChanged; +begin + EditingControl.ViewInfo.UpdateSelection; +end; + +procedure TcxCustomControlController.CancelCheckEditPost; +begin + FCheckEditNeeded := False; +end; + +function TcxCustomControlController.CanFocusedRecordIndex( + AIndex: Integer): Boolean; +begin + Result := True; +end; + +procedure TcxCustomControlController.CancelIncSearching; +var + AItem: TcxCustomInplaceEditContainer; +begin + AItem := ItemForIncSearching; + DataController.Search.Cancel; + if (AItem <> nil) and (AItem.FocusedCellViewInfo <> nil) then + AItem.FocusedCellViewInfo.Refresh(True); +end; + +function TcxCustomControlController.GetIncSearchingItem: TcxCustomInplaceEditContainer; +begin + if IsIncSearching then + Result := TcxCustomInplaceEditContainer(EditingControl.ContainerList[DataController.Search.ItemIndex]) + else + Result := nil; +end; + +function TcxCustomControlController.GetIncSearchingText: string; +begin + Result := DataController.Search.SearchText; +end; + +function TcxCustomControlController.GetIsIncSearching: Boolean; +begin + Result := DataController.Search.Searching +end; + +procedure TcxCustomControlController.SearchLocate( + AItem: TcxCustomInplaceEditContainer; const Value: string); +begin + DataController.Search.Locate(AItem.ItemIndex, Value); +end; + +procedure TcxCustomControlController.SearchLocateNext( + AItem: TcxCustomInplaceEditContainer; AForward: Boolean); +begin + DataController.Search.LocateNext(AForward); +end; + +procedure TcxCustomControlController.UpdateRecord(ARecordIndex: Integer); +begin +end; + +procedure TcxCustomControlController.CheckEdit; +begin + CancelCheckEditPost; + if FAllowCheckEdit and GetAlwaysShowEditor then + FEditingController.ShowEdit; +end; + +procedure TcxCustomControlController.DoEditDblClick(Sender: TObject); +begin + EditingControl.DblClick; +end; + +procedure TcxCustomControlController.DoMouseDown( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + APrevFocusedRecord: Integer; + APrevFocusedItem: TcxCustomInplaceEditContainer; + APrevEditViewInfo, AEditViewInfo: TcxEditCellViewInfo; + AButtonClick: Boolean; + + procedure DoShowEdit; + begin + if Button <> mbLeft then Exit; + with FEditingController, AEditViewInfo do + begin + if AButtonClick then + ShowEdit(EditContainer, Shift, X, Y) + else + ShowEdit(EditContainer, [], -1, -1) + end; + end; + +begin + APrevFocusedRecord := FocusedRecordIndex; + APrevFocusedItem := FocusedItem; + FIsDblClick := ssDouble in Shift; + FWasFocusedBeforeClick := False; + EditingController.StopEditShowingTimer; + with HitTestController do + begin + AButtonClick := HitTestController.IsItemEditCell and + EditCellViewInfo.ViewInfo.IsHotTrack(Point(X, Y)) {and (EditingControl.DragMode = dmManual)}; + if AButtonClick then + APrevEditViewInfo := EditCellViewInfo + else + APrevEditViewInfo := nil; + end; + MouseDown(Button, Shift, X, Y); + HitTestController.RecalculateOnMouseEvent(X, Y, Shift); + if (Button <> mbMiddle) and HitTestController.IsItemEditCell then + begin + AEditViewInfo := HitTestController.EditCellViewInfo; + SetFocusedRecordItem(AEditViewInfo.RecordIndex, AEditViewInfo.EditContainer); + HitTestController.RecalculateOnMouseEvent(X, Y, Shift); + if HitTestController.IsItemEditCell then + begin + AEditViewInfo := HitTestController.EditCellViewInfo; + if GetImmediateEditor then + DoShowEdit + else + begin + if AButtonClick and (AEditViewInfo = APrevEditViewInfo) then + DoShowEdit + else + begin + FWasFocusedBeforeClick := (APrevFocusedRecord = FocusedRecordIndex) and + (APrevFocusedItem = FocusedItem) and (FocusedItem <> nil); + if not FWasFocusedBeforeClick and (FocusedItem <> nil) then + FocusedItem.CancelIncSearching; + end; + end; + end; + end; +end; + +procedure TcxCustomControlController.DoMouseMove( + Shift: TShiftState; X, Y: Integer); +begin + MouseMove(Shift, X, Y); + HitTestController.RecalculateOnMouseEvent(X, Y, Shift); +end; + +procedure TcxCustomControlController.DoMouseUp( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + MouseUp(Button, Shift, X, Y); + if WasFocusedBeforeClick then + begin + with HitTestController do + if not IsEditing and not IsDblClick and IsItemEditCell and (Button = mbLeft) then + FEditingController.StartEditShowingTimer(EditCellViewInfo.EditContainer); + end; + HitTestController.RecalculateOnMouseEvent(X, Y, Shift); + with HitTestController do + if not IsEditing and not IsDblClick and IsItemEditCell and GetImmediateEditor then + begin + FEditingController.StopEditShowingTimer; + if Button = mbLeft then + FEditingController.ShowEdit(EditCellViewInfo.EditContainer) + end +end; + +procedure TcxCustomControlController.DoNextPage(AForward: Boolean; Shift: TShiftState); +begin +end; + +function TcxCustomControlController.GetEditingViewInfo: TcxEditCellViewInfo; +begin + Result := GetFocusedCellViewInfo(EditingItem); +end; + +function TcxCustomControlController.GetFocused: Boolean; +begin + Result := FFocused; +end; + +function TcxCustomControlController.GetFocusedCellViewInfo( + AEditContainer: TcxCustomInplaceEditContainer): TcxEditCellViewInfo; +begin + Result := nil; + cxAbstractError; +end; + +function TcxCustomControlController.GetFocusedRecordIndex: Integer; +begin + Result := EditingControl.DataController.GetFocusedRecordIndex; +end; + +function TcxCustomControlController.GetResizeDirection: TcxDragSizingDirection; +begin + Result := dsdHorz; +end; + +procedure TcxCustomControlController.FocusedItemChanged( + APrevFocusedItem: TcxCustomInplaceEditContainer); + + procedure RefreshCells(APrevViewInfo, ACurViewInfo: TcxEditCellViewInfo); + begin + if (APrevViewInfo = ACurViewInfo) or DisableCellsRefresh then Exit; + if APrevViewInfo <> nil then + APrevViewInfo.Refresh(False); + if ACurViewInfo <> nil then + ACurViewInfo.Refresh(False); + end; + +begin + if EditingControl.ComponentState * [csLoading, csDestroying] <> [] then Exit; + CancelIncSearching; + MakeFocusedItemVisible; + RefreshCells(GetFocusedCellViewInfo(APrevFocusedItem), + GetFocusedCellViewInfo(FocusedItem)); + Navigator.Refresh; +end; + +procedure TcxCustomControlController.FocusedRecordChanged( + APrevFocusedRecordIndex, AFocusedRecordIndex: Integer); +begin + with EditingController do + if HideEditOnFocusedRecordChange then HideEdit(True); + CheckEdit; + EditingController.UpdateEditValue; +end; + +function TcxCustomControlController.HasFocusedControls: Boolean; +begin + with FEditingController do + Result := (Edit <> nil) and Edit.IsFocused; +end; + +procedure TcxCustomControlController.HideHint; +begin + HotTrackController.CancelHint; +end; + +function TcxCustomControlController.IncSearchKeyDown(AKey: Word; AShift: TShiftState): Word; +begin + if ItemForIncSearching = nil then + begin + Result := AKey; + Exit; + end + else + Result := 0; + case AKey of + VK_ESCAPE: + ItemForIncSearching.CancelIncSearching; + VK_BACK: + IncSearchingText := Copy(IncSearchingText, 1, Length(IncSearchingText) - 1); + VK_UP, VK_DOWN: + if AShift = [ssCtrl] then + SearchLocateNext(ItemForIncSearching, AKey = VK_DOWN) + else + Result := AKey; + else + Result := AKey; + end; +end; + +procedure TcxCustomControlController.InternalSetFocusedItem( + Value: TcxCustomInplaceEditContainer); +begin + FFocusedItem := Value; +end; + +function TcxCustomControlController.IsImmediatePost: Boolean; +begin + Result := False; +end; + +function TcxCustomControlController.IsKeyForController( + AKey: Word; AShift: TShiftState): Boolean; +begin + Result := ((AKey = VK_TAB) and GetGoToNextCellOnTab) or + (AKey = VK_UP) or (AKey = VK_DOWN) or (AKey = VK_PRIOR) or (AKey = VK_NEXT) or + (AKey = VK_INSERT) or (AKey = VK_ESCAPE) or (AKey = VK_LEFT) or (AKey = VK_RIGHT); +end; + +procedure TcxCustomControlController.PostCheckEdit; +begin + if FAllowCheckEdit then FCheckEditNeeded := True; +end; + +procedure TcxCustomControlController.ProcessCheckEditPost; +begin + if FCheckEditNeeded then CheckEdit; +end; + +procedure TcxCustomControlController.PostShowEdit; +begin + with EditingControl.Options.OptionsBehavior do + begin + if not IsEditing and (ImmediateEditor or AlwaysShowEditor) and + (EditingControl.DragAndDropState = ddsNone) then + if HitTestController.IsItemEditCell then PostCheckEdit; + end; +end; + +procedure TcxCustomControlController.RefreshFocusedCellViewInfo( + AItem: TcxCustomInplaceEditContainer); +var + ACellViewInfo: TcxEditCellViewInfo; +begin + if DisableCellsRefresh then Exit; + ACellViewInfo := GetFocusedCellViewInfo(AItem); + if (ACellViewInfo <> nil) and (ACellViewInfo.Refresh(True)) then + EditingControl.LayoutChanged; +end; + +procedure TcxCustomControlController.RefreshFocusedRecord; +var + I: Integer; + ANeedUpdate: Boolean; + ACellViewInfo: TcxEditCellViewInfo; +begin + with EditingControl do + begin + Inc(FLockUpdate); + ANeedUpdate := False; + try + for I := 0 to FContainerList.Count - 1 do + with TcxCustomInplaceEditContainer(FContainerList.List^[I]) do + begin + ACellViewInfo := FocusedCellViewInfo; + ANeedUpdate := ANeedUpdate or ((ACellViewInfo <> nil) and ACellViewInfo.Refresh(True)); + end; + finally + Dec(FLockUpdate); + if ANeedUpdate and not IsLocked then + begin + BeforeUpdate; + LayoutChanged; + end; + end; + end; +end; + +procedure TcxCustomControlController.SetFocused(Value: Boolean); +begin + FFocused := Value; +end; + +procedure TcxCustomControlController.SetFocusedItem( + Value: TcxCustomInplaceEditContainer); +var + APrevFocusedItem: TcxCustomInplaceEditContainer; +begin + if IsEditing then EditingController.HideEdit(True); + if (Value <> nil) and not Value.CanFocus then Exit; + if FFocusedItem <> Value then + begin + APrevFocusedItem := FFocusedItem; + if (FFocusedItem <> nil) and not FEditingController.FEditingItemSetting then + FEditingController.HideEdit(True); + FFocusedItem := Value; + FocusedItemChanged(APrevFocusedItem); + end + else + if Assigned(Value) then + MakeFocusedItemVisible; + CheckEdit; +end; + +procedure TcxCustomControlController.SetFocusedRecordIndex( + Value: Integer); +var + AIndexesAreEqual: Boolean; +begin + with DataController do + begin + if cxInRange(Value, 0, RecordCount - 1) and + not (CanFocusedRecordIndex(Value) and ChangeFocusedRowIndex(Value)) then Exit; + end; + AIndexesAreEqual := FocusedRecordIndex = Value; + if AIndexesAreEqual then MakeFocusedRecordVisible; +end; + +function TcxCustomControlController.GetAlwaysShowEditor: Boolean; +begin + Result := EditingControl.Options.OptionsBehavior.AlwaysShowEditor; +end; + +function TcxCustomControlController.GetCancelEditingOnExit: Boolean; +begin + with EditingControl do + Result := Options.OptionsData.CancelOnExit and + (DataController.EditState * [dceInsert, dceChanging, dceModified] = [dceInsert]); +end; + +function TcxCustomControlController.GetFocusCellOnCycle: Boolean; +begin + Result := EditingControl.Options.OptionsBehavior.FocusCellOnCycle; +end; + +function TcxCustomControlController.GetGoToNextCellOnEnter: Boolean; +begin + Result := EditingControl.Options.OptionsBehavior.GoToNextCellOnEnter; +end; + +function TcxCustomControlController.GetGoToNextCellOnTab: Boolean; +begin + Result := EditingControl.Options.OptionsBehavior.GoToNextCellOnTab; +end; + +function TcxCustomControlController.GetImmediateEditor: Boolean; +begin + with EditingControl.Options.OptionsBehavior do + Result := (ImmediateEditor or AlwaysShowEditor) and (EditingControl.DragMode = dmManual); +end; + +procedure TcxCustomControlController.BeforeStartDrag; +begin +end; + +function TcxCustomControlController.CanDrag(X, Y: Integer): Boolean; +begin + Result := False; +end; + +procedure TcxCustomControlController.DragDrop(Source: TObject; X, Y: Integer); +begin +end; + +procedure TcxCustomControlController.DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); +begin + EditingController.HideEdit(True); +end; + +procedure TcxCustomControlController.EndDrag(Target: TObject; X, Y: Integer); +begin + HitTestController.ReCalculate(Point(X, Y)); + if FEditingBeforeDrag or + EditingControl.Options.OptionsBehavior.AlwaysShowEditor then + EditingController.ShowEdit; +end; + +function TcxCustomControlController.GetDragAndDropObject: TcxCustomControlDragAndDropObject; +begin + Result := EditingControl.DragAndDropObject as TcxCustomControlDragAndDropObject; +end; + +function TcxCustomControlController.GetDragAndDropObjectClass: TcxDragAndDropObjectClass; +begin + Result := nil; +end; + +function TcxCustomControlController.GetIsDragging: Boolean; +begin + Result := False; +end; + +function TcxCustomControlController.GetNavigatorClass: TcxCustomCellNavigatorClass; +begin + Result := TcxCustomCellNavigator; +end; + +procedure TcxCustomControlController.StartDrag(var DragObject: TDragObject); +begin +end; + +function TcxCustomControlController.GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; +begin + Result := mwskNone; +end; + +function TcxCustomControlController.IsPixelScrollBar( + AKind: TScrollBarKind): Boolean; +begin + Result := False; +end; + +procedure TcxCustomControlController.InitScrollBarsParameters; +begin +end; + +procedure TcxCustomControlController.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +begin +end; + +procedure TcxCustomControlController.SetFocusedRecordItem( + ARecordIndex: Integer; AItem: TcxCustomInplaceEditContainer); +begin + EditingController.HideEdit(True); + AllowCheckEdit := False; + try + DisableCellsRefresh := (FocusedRecordIndex = ARecordIndex); + FocusedRecordIndex := ARecordIndex; + DisableCellsRefresh := DisableCellsRefresh and (FocusedItem = AItem); + FocusedItem := AItem; + finally + AllowCheckEdit := True; + CheckEdit; + DisableCellsRefresh := False; + end; +end; + +procedure TcxCustomControlController.SetScrollBarInfo( + AScrollBarKind: TScrollBarKind; AMin, AMax, AStep, APage, APos: Integer; + AAllowShow, AAllowHide: Boolean); +begin + EditingControl.SetScrollBarInfo(AScrollBarKind, AMin, + AMax, AStep, APage, APos, AAllowShow, AAllowHide); +end; + +procedure TcxCustomControlController.MakeFocusedItemVisible; +begin + cxAbstractError; +end; + +procedure TcxCustomControlController.MakeFocusedRecordVisible; +begin + cxAbstractError; +end; + +procedure TcxCustomControlController.FocusChanged; +var + AFocused: Boolean; +begin + AFocused := EditingControl.IsFocused; + with EditingController do + begin + AFocused := AFocused or (IsEditing and (Edit <> nil) and Edit.Focused); + if AFocused then + begin + CheckEdit; + if IsEditing and (Edit <> nil) and GetAlwaysShowEditor and not Edit.Focused and Edit.CanFocus then + Edit.SetFocus + else + if (Edit <> nil) and not Edit.Focused and not GetAlwaysShowEditor then + HideEdit(True) + else + if GetAlwaysShowEditor and not IsEditing and GetImmediateEditor then ShowEdit; + end; + end; + if FFocused <> AFocused then + begin + FFocused := AFocused; + ControlFocusChanged; + end; +end; + +procedure TcxCustomControlController.DoEnter; +begin +end; + +procedure TcxCustomControlController.DoExit; +begin + if GetCancelEditingOnExit then + EditingControl.DataController.Cancel + else + begin + EditingControl.DataController.PostEditingData; + if IsImmediatePost then + EditingControl.DataController.Post; + end; +end; + +function TcxCustomControlController.MayFocus: Boolean; +begin + Result := not EditingControl.IsFocused or not IsEditing or + not GetAlwaysShowEditor and FEditingController.Edit.ValidateEdit(True); +end; + +procedure TcxCustomControlController.RemoveFocus; +begin +end; + +procedure TcxCustomControlController.SetFocus; +begin + if not FEditingController.CanRemoveEditFocus then Exit; + with EditingControl do + if CanFocusEx and IsFocused then SetFocus; + PostCheckEdit; +end; + +procedure TcxCustomControlController.ControlFocusChanged; +begin + with EditingController do + if not Self.Focused and HideEditOnExit then HideEdit(True); + EditingControl.ViewInfo.UpdateSelection; +end; + +function TcxCustomControlController.GetDataController: TcxCustomDataController; +begin + Result := EditingControl.DataController; +end; + +function TcxCustomControlController.GetDesignSelectionHelper: TcxCustomDesignSelectionHelper; +begin + Result := EditingControl.DesignSelectionHelper; +end; + +function TcxCustomControlController.GetEditingItem: TcxCustomInplaceEditContainer; +begin + Result := FEditingController.EditingItem; +end; + +function TcxCustomControlController.GetIsEditing: Boolean; +begin + Result := FEditingController.IsEditing; +end; + +procedure TcxCustomControlController.SetEditingItem( + Value: TcxCustomInplaceEditContainer); +begin + FEditingController.EditingItem := Value; +end; + +function TcxCustomControlController.GetItemForIncSearching: TcxCustomInplaceEditContainer; +begin + Result := nil; + if EditingControl.Options.OptionsBehavior.IncSearch then + Result := EditingControl.Options.OptionsBehavior.IncSearchItem; + if Result = nil then + Result := FocusedItem; +end; + +procedure TcxCustomControlController.SetIncSearchingText(const Value: string); +var + AItem: TcxCustomInplaceEditContainer; + + function GetItemIndex: Integer; + begin + AItem := nil; + if IsIncSearching then + AItem := IncSearchingItem + else + AItem := ItemForIncSearching; + if AItem <> nil then + Result := AItem.ItemIndex + else + Result := -1; + end; + +begin + if (IncSearchingText = Value) or (GetItemIndex = -1) then Exit; + if Value = '' then + CancelIncSearching + else + SearchLocate(AItem, Value); + if (ItemForIncSearching <> nil) and (ItemForIncSearching.FocusedCellViewInfo <> nil) then + ItemForIncSearching.FocusedCellViewInfo.Invalidate(True); +end; + +{ TcxCustomControlViewInfo } + +constructor TcxCustomControlViewInfo.Create(AOwner: TcxEditingControl); +begin + FControl := AOwner; + FState := FState or cvis_StyleInvalid; + CreatePainter; + FEditCellViewInfoList := TList.Create; + FEditCellViewInfoList.Capacity := 1024; + Brush := TBrush.Create; + SelectionBrush := TBrush.Create; +end; + +destructor TcxCustomControlViewInfo.Destroy; +begin + with FControl do + if Assigned(FController) then FController.Reset; + FPainter.Free; + FEditCellViewInfoList.Free; + Brush.Free; + SelectionBrush.Free; + inherited Destroy; +end; + +procedure TcxCustomControlViewInfo.Calculate; +begin + with Control.FBrushCache do + begin + BeginUpdate; + try + if State[cvis_StyleInvalid] then + begin + State[cvis_StyleInvalid] := False; + CalculateDefaultHeights; + ViewParams := Control.Styles.GetBackgroundParams; + Brush.Color := ViewParams.Color; + UpdateSelectionParams; + Control.Invalidate; + end; + FClientRect := Control.ClientBounds; + DoCalculate; + IsDirty := False; + finally + EndUpdate; + end; + end; +end; + +procedure TcxCustomControlViewInfo.Invalidate(ARecalculate: Boolean = False); +begin + if ARecalculate then + Control.LayoutChanged + else + Control.InvalidateRect(ClientRect, False); +end; + +function TcxCustomControlViewInfo.AddEditCellViewInfo( + AViewInfoClass: TcxEditCellViewInfoClass; + AEditContainer: TcxCustomInplaceEditContainer): TcxEditCellViewInfo; +begin + Result := AViewInfoClass.Create(AEditContainer); + FEditCellViewInfoList.Add(Result); + IsDirty := True; +end; + +function TcxCustomControlViewInfo.CalculateDefaultEditHeight: Integer; +begin + Result := -1; + cxAbstractError; +end; + +procedure TcxCustomControlViewInfo.CalculateDefaultHeights; +begin + FDefaultEditHeight := CalculateDefaultEditHeight; +end; + +procedure TcxCustomControlViewInfo.ClearEditCellViewInfos; +var + I: Integer; +begin + for I := 0 to FEditCellViewInfoList.Count - 1 do + TcxEditCellViewInfo(FEditCellViewInfoList.List^[I]).Free; + FEditCellViewInfoList.Clear; + IsDirty := True; +end; + +procedure TcxCustomControlViewInfo.CreatePainter; +begin + FPainter := Control.GetPainterClass.Create(Control); +end; + +procedure TcxCustomControlViewInfo.DoCalculate; +var + I: Integer; +begin + for I := 0 to FEditCellViewInfoList.Count - 1 do + with TcxEditCellViewInfo(FEditCellViewInfoList.List^[I]) do + if Visible then DoCalculate; +end; + +procedure TcxCustomControlViewInfo.RemoveEditCellViewInfo( + AViewInfo: TcxEditCellViewInfo); +begin + FEditCellViewInfoList.Remove(AViewInfo); + AViewInfo.Free; + IsDirty := True; +end; + +procedure TcxCustomControlViewInfo.UpdateSelection; +begin + UpdateSelectionParams; +end; + +function TcxCustomControlViewInfo.GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := FPainter.Painter; +end; + +function TcxCustomControlViewInfo.GetState(AMask: Integer): Boolean; +begin + Result := FState and AMask = AMask; +end; + +procedure TcxCustomControlViewInfo.SetState(AMask: Integer; Value: Boolean); +begin + if Value then + FState := FState or AMask + else + FState := FState and not AMask; +end; + +procedure TcxCustomControlViewInfo.UpdateSelectionParams; +begin + SelectionParams := Control.Styles.GetSelectionParams; + SelectionBrush.Color := SelectionParams.Color; +end; + +{ TcxCustomViewInfoItem } + +constructor TcxCustomViewInfoItem.Create(AOwner: TObject); +begin + FOwner := AOwner; +end; + +procedure TcxCustomViewInfoItem.Assign(Source: TcxCustomViewInfoItem); +begin + DisplayRect := Source.DisplayRect; + ClipRect := Source.ClipRect; + ItemVisible := Source.ItemVisible; + ItemViewParams := Source.ItemViewParams; +end; + +procedure TcxCustomViewInfoItem.Invalidate(ARecalculate: Boolean = False); +begin + if ARecalculate then + DoCalculate; + if Visible then + Control.InvalidateRect(VisibleRect, False); +end; + +procedure TcxCustomViewInfoItem.CheckClipping( + const ADisplayRect: TRect); +begin + CheckClipping(ADisplayRect, ControlViewInfo.FClientRect); +end; + +procedure TcxCustomViewInfoItem.DoCalculate; +begin + cxAbstractError; +end; + +procedure TcxCustomViewInfoItem.DoHorzOffset(AShift: Integer); +begin + cxAbstractError; +end; + +procedure TcxCustomViewInfoItem.DoVertOffset(AShift: Integer); +begin + cxAbstractError; +end; + +function TcxCustomViewInfoItem.GetControl: TcxEditingControl; +begin + Result := nil; + cxAbstractError; +end; + +function TcxCustomViewInfoItem.IsTransparent: Boolean; +begin + with ItemViewParams do + Result := (Bitmap <> nil) and not Bitmap.Empty; +end; + +procedure TcxCustomViewInfoItem.UpdateEditRect; +begin + CheckClipping(DisplayRect); +end; + +procedure TcxCustomViewInfoItem.CheckClipping( + const ADisplayRect, AAvailableRect: TRect); +begin + DisplayRect := ADisplayRect; + ItemVisible := cxRectIntersect(ClipRect, AAvailableRect, DisplayRect); +end; + +function TcxCustomViewInfoItem.GetControlViewInfo: TcxCustomControlViewInfo; +begin + Result := Control.ViewInfo; +end; + +function TcxCustomViewInfoItem.GetPainterClass: TcxCustomLookAndFeelPainterClass; +begin + Result := Control.LookAndFeelPainter; +end; + +{ TcxEditCellViewInfo } + +destructor TcxEditCellViewInfo.Destroy; +begin + if (EditContainer <> nil) and not EditContainer.IsDestroying then + Control.Controller.HitTestController.DestroyingItem(Self); + ViewInfo.Free; + if IsViewDataCreated then ViewData.Free; + inherited Destroy; +end; + +procedure TcxEditCellViewInfo.Assign(Source: TcxCustomViewInfoItem); +begin + if Source is TcxCustomViewInfoItem then + begin + CellEditRect := TcxEditCellViewInfo(Source).CellEditRect; + CellContentRect := TcxEditCellViewInfo(Source).CellContentRect; + CellBorders := TcxEditCellViewInfo(Source).CellBorders; + end; + inherited Assign(Source); +end; + +function TcxEditCellViewInfo.QueryInterface(const IID: TGUID; + out Obj): HResult; +begin + if GetInterface(IID, Obj) then Result := 0 else Result := cxE_NOINTERFACE; +end; + +function TcxEditCellViewInfo.Refresh(ARecalculate: Boolean): Boolean; +begin + Result := False; + if EditContainer = nil then Exit; + if ARecalculate then + begin + if IsAutoHeight then + Result := ChangedHeight(CellHeight, CalculateEditHeight); + if not Result then DoCalculate; + end + else + if ViewInfo <> nil then + begin + ItemViewParams := GetEditViewParams; + ViewInfo.TextColor := ItemViewParams.TextColor; + ViewInfo.Font := ItemViewParams.Font; + ViewInfo.BackgroundColor := ItemViewParams.Color; + ViewInfo.Transparent := IsTransparent; + end; + if not Result then Invalidate; +end; + +function TcxEditCellViewInfo._AddRef: Integer; +begin + Result := -1; +end; + +function TcxEditCellViewInfo._Release: Integer; +begin + Result := -1; +end; + +function TcxEditCellViewInfo.GetOrigin: TPoint; +begin + Result := cxPoint(ViewInfo.Left, ViewInfo.Top); +end; + +function TcxEditCellViewInfo.IsNeedHint(ACanvas: TcxCanvas; const P: TPoint; + out AText: TCaption; + out AIsMultiLine: Boolean; + out ATextRect: TRect; var IsNeedOffsetHint: Boolean): Boolean; +begin + Result := Visible and + ViewInfo.NeedShowHint(ACanvas, P, GetControl.ClientBounds, + AText, AIsMultiLine, ATextRect); + IsNeedOffsetHint := False; +end; + +procedure TcxEditCellViewInfo.UpdateHotTrackState(const APoint: TPoint); +var + ATempViewInfo: TcxCustomEditViewInfo; +begin + if not IsSupportedHotTrack then Exit; + ATempViewInfo := TcxCustomEditViewInfo(Properties.GetViewInfoClass.Create); + try + ATempViewInfo.Assign(ViewInfo); + cxAssignEditStyle(Self); + ViewData.ContentOffset := ContentOffset; + ViewData.CalculateEx(EditContainer.GetControlCanvas, ContentRect, + APoint, cxmbNone, [], ViewInfo, False); + if (EditContainer <> nil) and (EditContainer.EditingControl.DragAndDropState = ddsNone) then + ViewInfo.Repaint(Control, ATempViewInfo); + finally + ATempViewInfo.Free; + end; +end; + +function TcxEditCellViewInfo.CalculateEditHeight: Integer; +begin + if IsAutoHeight then + begin + with EditContainer do + begin + InitEditViewInfo(Self); + Result := GetEditHeight(Self); + end; + end + else + Result := ControlViewInfo.DefaultEditHeight; +end; + +function TcxEditCellViewInfo.CalculateEditWidth: Integer; +begin + Result := EditContainer.GetEditHeight(Self); +end; + +function TcxEditCellViewInfo.ChangedHeight(APrevHeight, ANewHeight: Integer): Boolean; +begin + Result := APrevHeight <> ANewHeight; + CellHeight := ANewHeight; +end; + +procedure TcxEditCellViewInfo.CheckClipping( + const ADisplayRect, AAvailableRect: TRect); +begin + inherited CheckClipping(ADisplayRect, AAvailableRect); + CellContentRect := DisplayRect; + if CellBorders = [] then + with ContentOffset do + CellEditRect := cxRectInflate(VisibleRect, -Left, -Top, -Right, -Bottom) + else + begin + with CellContentRect do + begin + Inc(Left, Byte(bLeft in CellBorders)); + Inc(Top, Byte(bTop in CellBorders)); + Dec(Right, Byte(bRight in CellBorders)); + Dec(Bottom, Byte(bBottom in CellBorders)); + end; + if cxRectIntersect(CellEditRect, VisibleRect, CellContentRect) then + with ContentOffset do + CellEditRect := cxRectInflate(CellEditRect, -Left, -Top, -Right, -Bottom); + end; +end; + +function TcxEditCellViewInfo.ContentOffset: TRect; +begin + Result := cxSimpleRect; +end; + +procedure TcxEditCellViewInfo.DoCalculate; +begin + with EditContainer do + begin + if not IsAutoHeight then + InitEditViewInfo(Self) + else + begin + ViewData.InplaceEditParams.Position.RecordIndex := RecordIndex; + ViewData.InplaceEditParams.Position.Item := Self; + end; + CalculateEditViewInfo(CellValue, Self, cxInvalidPoint); + end; +end; + +function TcxEditCellViewInfo.GetButtonTransparency: TcxEditButtonTransparency; +var + B1: TcxEditingControlEditShowButtons; + B2: TcxEditItemShowEditButtons; +begin + B1 := Control.Options.OptionsView.ShowEditButtons; + B2 := EditContainer.Options.ShowEditButtons; + if (B2 = eisbAlways) or (B2 = eisbDefault) and + ((B1 = ecsbAlways) or (B1 = ecsbFocused) and Focused) then + Result := ebtNone + else + Result := ebtHideInactive; +end; + +function TcxEditCellViewInfo.GetControl: TcxEditingControl; +begin + Result := EditContainer.EditingControl; +end; + +function TcxEditCellViewInfo.GetDisplayValue: Variant; +begin + with EditContainer.DataController do + begin + if (RecordIndex >= 0) and (RecordIndex < RecordCount) then + Result := EditContainer.GetDisplayValue(Properties, RecordIndex) + else + Result := Null + end; +end; + +function TcxEditCellViewInfo.GetEditContainer: TcxCustomInplaceEditContainer; +begin + Result := TcxCustomInplaceEditContainer(Owner); +end; + +function TcxEditCellViewInfo.GetEditViewParams: TcxViewParams; +begin + Result := Control.Styles.GetBackgroundParams; +end; + +function TcxEditCellViewInfo.GetFocused: Boolean; +begin + with EditContainer do + Result := (FocusedCellViewInfo = Self) and (DataController.FocusedRecordIndex = RecordIndex); +end; + +function TcxEditCellViewInfo.GetInplaceEditPosition: TcxInplaceEditPosition; +begin + Result.Item := EditContainer; + Result.RecordIndex := RecordIndex; +end; + +function TcxEditCellViewInfo.GetMaxLineCount: Integer; +begin + Result := Control.Options.OptionsView.CellTextMaxLineCount; +end; + +function TcxEditCellViewInfo.GetRecordIndex: Integer; +begin + Result := 0; +end; + +function TcxEditCellViewInfo.GetSelectedTextColor: Integer; +begin + Result := $FFFFFF xor ColorToRgb(ViewParams.TextColor); +end; + +function TcxEditCellViewInfo.GetSelectedBKColor: Integer; +begin + Result := $FFFFFF xor ColorToRgb(ViewParams.Color); +end; + +function TcxEditCellViewInfo.GetViewInfoData: Pointer; +begin + Result := Pointer(RecordIndex); +end; + +function TcxEditCellViewInfo.IsAutoHeight: Boolean; +begin + Result := Control.Options.OptionsView.CellAutoHeight; +end; + +function TcxEditCellViewInfo.IsEndEllipsis: Boolean; +begin + Result := Control.Options.OptionsView.CellEndEllipsis; +end; + +function TcxEditCellViewInfo.IsSupportedHotTrack: Boolean; +begin + Result := not Control.IsDesigning and + (esoHotTrack in Properties.GetSupportedOperations) and + ViewData.Style.LookAndFeel.Painter.IsButtonHotTrack; +end; + +procedure TcxEditCellViewInfo.SetBounds(const ABounds: TRect; const ADisplayRect: TRect); +begin + CheckClipping(ABounds, ADisplayRect); + DoCalculate; +end; + +function TcxEditCellViewInfo.GetTransparent: Boolean; +begin + Result := ViewInfo.Transparent; +end; + +procedure TcxEditCellViewInfo.SetTransparent(Value: Boolean); +begin + ViewInfo.Transparent := Value; +end; + +{ TcxCustomControlPainter } + +constructor TcxCustomControlPainter.Create( + AOwner: TcxEditingControl); +begin + FControl := AOwner; + FCanvas := FControl.Canvas; +end; + +destructor TcxCustomControlPainter.Destroy; +begin + FBitmap.Free; + FBitmapCanvas.Free; + inherited Destroy; +end; + +procedure TcxCustomControlPainter.Paint; +var + ACanvas: TcxCanvas; +begin + ACanvas := FCanvas; + if not Canvas.RectVisible(ViewInfo.ClientRect) then Exit; + try + if Buffered then + begin + FBitmap.Width := FControl.Width; + FBitmap.Height := FControl.Height; + if not Control.IsLayoutChanged then + FBitmapCanvas.SetClipRegion(FCanvas.GetClipRegion, roSet) + else + begin + FBitmapCanvas.SetClipRegion(TcxRegion.Create(ViewInfo.ClientRect), roSet); + Control.IsLayoutChanged := False; + end; + FCanvas := FBitmapCanvas; + end; + DoPaint; + finally + FCanvas := ACanvas; + if Buffered then + Canvas.Draw(0, 0, FBitmap); + end; +end; + +procedure TcxCustomControlPainter.AfterCustomDraw( + AViewInfo: TcxCustomViewInfoItem); +begin + AViewInfo.ItemViewParams := FSaveViewParams; + // synchronize EditViewInfo with ViewParams + if AViewInfo is TcxEditCellViewInfo then + with TcxEditCellViewInfo(AViewInfo).EditViewInfo do + begin + Font := FSaveViewParams.Font; + TextColor := FSaveViewParams.TextColor; + BackgroundColor := FSaveViewParams.Color; + end; +end; + +procedure TcxCustomControlPainter.BeforeCustomDraw(AViewInfo: TcxCustomViewInfoItem); +begin + with AViewInfo do + begin + FSaveViewParams := ItemViewParams; + cxApplyViewParams(Canvas, ItemViewParams); + ItemViewParams.Font := Canvas.Font; + end; + if AViewInfo is TcxEditCellViewInfo then + TcxEditCellViewInfo(AViewInfo).EditViewInfo.Font := + AViewInfo.ItemViewParams.Font; +end; + +function TcxCustomControlPainter.DoCustomDraw( + AViewInfoItem: TcxCustomViewInfoItem; AEvent: TcxCustomDrawViewInfoItemEvent): Boolean; +begin + if (AViewInfoItem <> nil) and AViewInfoItem.Visible + and Canvas.RectVisible(AViewInfoItem.VisibleRect) then + begin + Result := False; + if Assigned(AEvent) then + begin +// BeforeCustomDraw(AViewInfoItem); + AEvent(Control, Canvas, AViewInfoItem, Result); +// AfterCustomDraw(AViewInfoItem); + end; + end + else + Result := True; +end; + +procedure TcxCustomControlPainter.DoPaintEditCell( + ACellViewInfo: TcxEditCellViewInfo; AIsExcludeRect: Boolean = True); +begin + if not DoCustomDraw(ACellViewInfo, Control.OnCustomDrawCell) then + ACellViewInfo.ViewInfo.PaintEx(Canvas); + if AIsExcludeRect then + Canvas.ExcludeClipRect(ACellViewInfo.ClipRect); +end; + +procedure TcxCustomControlPainter.DoPaint; +begin + with ViewInfo do + begin + FCanvas.Brush.Assign(Brush); + FCanvas.FillRect(ClientRect); + end; +end; + +function TcxCustomControlPainter.GetPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := Control.LookAndFeelPainter; +end; + +function TcxCustomControlPainter.GetViewInfo: TcxCustomControlViewInfo; +begin + Result := Control.FViewInfo; +end; + +procedure TcxCustomControlPainter.SetBuffered(Value: Boolean); +begin + if Value <> FBuffered then + begin + FBuffered := Value; + if not Value then + begin + FreeAndNil(FBitmap); + FreeAndNil(FBitmapCanvas); + end + else + begin + FBitmap := TBitmap.Create; + FBitmapCanvas := TcxCanvas.Create(FBitmap.Canvas); + end; + if ViewInfo <> nil then + ViewInfo.Invalidate; + end; +end; + +{ TcxCustomControlStyles } +constructor TcxCustomControlStyles.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FDefaultStyle := TcxStyle.Create(nil); +end; + +destructor TcxCustomControlStyles.Destroy; +begin + FDefaultStyle.Free; + inherited Destroy; +end; + +procedure TcxCustomControlStyles.Assign(Source: TPersistent); +var + I: Integer; +begin + if Source is TcxCustomControlStyles then + begin + for I := ecs_Content to ecs_Selection do + SetValue(I, TcxCustomControlStyles(Source).GetValue(I)); + end; + inherited Assign(Source); + Changed(ecs_Content); +end; + +function TcxCustomControlStyles.GetBackgroundParams: TcxViewParams; +begin + GetViewParams(ecs_Background, nil, nil, Result); +end; + +function TcxCustomControlStyles.GetSelectionParams: TcxViewParams; +const + AStyleIndexes: array[Boolean] of Integer = (ecs_Inactive, ecs_Selection); +begin + GetViewParams(AStyleIndexes[Control.Controller.Focused or Control.IsFocused], nil, nil, Result); +end; + +procedure TcxCustomControlStyles.Changed(AIndex: Integer); +begin + inherited Changed(AIndex); + if GetOwner is TcxEditingControl then + Control.UpdateViewStyles; +end; + +function TcxCustomControlStyles.GetDefaultStyle(Index: Integer; AData: Pointer): TcxStyle; +var + AParams: TcxViewParams; +begin + GetDefaultViewParams(Index, AData, AParams); + with FDefaultStyle do + begin + Color := AParams.Color; + Font := AParams.Font; + TextColor := AParams.TextColor; + // todo: enumeration names equal cxStyles. and cxEditors + AssignedValues := [cxStyles.svColor, cxStyles.svFont, cxStyles.svTextColor]; + end; + Result := FDefaultStyle; +end; + +procedure TcxCustomControlStyles.GetDefaultViewParams( + Index: Integer; AData: TObject; out AParams: TcxViewParams); +begin + inherited GetDefaultViewParams(Index, AData, AParams); + with AParams, LookAndFeelPainter do + begin + Bitmap := nil; + Font := Control.Font; + case Index of + ecs_Background, ecs_Content: + begin + Color := DefaultContentColor; + TextColor := DefaultContentTextColor; + end; + ecs_Selection: + begin + Color := DefaultSelectionColor; + TextColor := DefaultSelectionTextColor; + end; + ecs_Inactive: + begin + Color := DefaultInactiveColor; + TextColor := DefaultInactiveTextColor; + end; + else + inherited GetDefaultViewParams(Index, AData, AParams); + end; + end; +end; + +function TcxCustomControlStyles.GetControl: TcxEditingControl; +begin + Result := TcxEditingControl(GetOwner); +end; + +function TcxCustomControlStyles.GetPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := Control.LookAndFeelPainter; +end; + +{ TcxEditingControl } + +constructor TcxEditingControl.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FContainerList := TList.Create; + CreateSubClasses; + Keys := [kArrows, kChars]; + BorderStyle := cxcbsDefault; + DragCursor := crDefault; +end; + +destructor TcxEditingControl.Destroy; +begin + DestroyDesignSelectionHelper; + EndMouseTracking(Self); + DestroySubClasses; + FreeAndNil(FContainerList); + inherited Destroy; +end; + +procedure TcxEditingControl.BeginUpdate; +begin + DoBeginUpdate; +end; + +procedure TcxEditingControl.BeginDragAndDrop; +begin + Controller.BeginDragAndDrop; + inherited; +end; + +procedure TcxEditingControl.CancelUpdate; +begin + DataController.EndUpdate; + Dec(FLockUpdate); +end; + +procedure TcxEditingControl.EndUpdate; +begin + DoEndUpdate; +end; + +function TcxEditingControl.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action) or + DataController.ExecuteAction(Action); +end; + +procedure TcxEditingControl.DragDrop(Source: TObject; X, Y: Integer); +begin + Controller.DragDrop(Source, X, Y); + inherited DragDrop(Source, X, Y); +end; + +procedure TcxEditingControl.LayoutChanged; +begin + if ViewInfo <> nil then ViewInfo.IsDirty := True; + if IsLocked then Exit; + Inc(FChangesCount); + Controller.Reset; + BeginUpdate; + try + DoLayoutChanged; + finally + ViewInfo.IsDirty := False; + CancelUpdate; + SetInternalControlsBounds; //TODO: need validation scrollbars visible + UpdateScrollBars; + Dec(FChangesCount); + if FChangesCount = 0 then + begin + Controller.HitTestController.ReCalculate; + Controller.EditingController.PostEditUpdate; + FIsLayoutChanged := True; + AfterLayoutChanged; + Invalidate; + end; + end; +end; + +function TcxEditingControl.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action) or + DataController.UpdateAction(Action); +end; + +procedure TcxEditingControl.AfterLayoutChanged; +begin +end; + +procedure TcxEditingControl.BeginAutoDrag; +begin + Controller.HideHint; + if Controller.IsEditing then + Controller.EditingController.HideEdit(True); +// ControlState := ControlState - [csLButtonDown]; + BeginDrag(False, Mouse.DragThreshold); +// ControlState := ControlState + [csLButtonDown]; +end; + +procedure TcxEditingControl.BeforeUpdate; +begin +end; + +procedure TcxEditingControl.CheckCreateDesignSelectionHelper; +begin + if (FDesignSelectionHelper = nil) and (cxDesignSelectionHelperClass <> nil) and IsDesigning then + FDesignSelectionHelper := cxDesignSelectionHelperClass.Create(Self); +end; + +procedure TcxEditingControl.CreateSubClasses; +begin + FStyles := GetControlStylesClass.Create(Self); + FBrushCache := TcxBrushCache.Create; + FEditStyle := GetEditStyleClass.Create(nil, True); + FEditStyle.LookAndFeel.MasterLookAndFeel := LookAndFeel; + FController := GetControllerClass.Create(Self); + FDataController := GetDataControllerClass.Create(Self); + RecreateViewInfo; +end; + +procedure TcxEditingControl.ControlUpdateData(AInfo: TcxUpdateControlInfo); +begin + if AInfo is TcxDataChangedInfo then + DataChanged + else + if AInfo is TcxLayoutChangedInfo then + DataLayoutChanged + else + if AInfo is TcxFocusedRecordChangedInfo then + with TcxFocusedRecordChangedInfo(AInfo) do + begin + // need use row index instead of record index + Controller.FocusedRecordChanged(PrevFocusedRowIndex, FocusedRowIndex); + Controller.Navigator.Refresh; + end + else + if AInfo is TcxSelectionChangedInfo then + SelectionChanged(TcxSelectionChangedInfo(AInfo)) + else + if AInfo is TcxUpdateRecordInfo then + Controller.UpdateRecord(TcxUpdateRecordInfo(AInfo).RecordIndex); +end; + +procedure TcxEditingControl.DataChanged; +var + I: Integer; +begin + Inc(FLockUpdate); + try + for I := 0 to FContainerList.Count - 1 do + TcxCustomInplaceEditContainer(FContainerList.List^[I]).DataChanged; + finally + Dec(FLockUpdate); + if not IsLocked then Controller.RefreshFocusedRecord; + end; +end; + +procedure TcxEditingControl.DataLayoutChanged; +begin + Controller.EditingController.UpdateEditValue; + Controller.RefreshFocusedRecord; +end; + +procedure TcxEditingControl.DestroyDesignSelectionHelper; +begin + FreeAndNil(FDesignSelectionHelper); +end; + +procedure TcxEditingControl.DestroySubClasses; +begin + FreeAndNil(FViewInfo); + FreeAndNil(FBrushCache); + FreeAndNil(FController); + FreeAndNil(FEditStyle); + FreeAndNil(FDataController); + FreeAndNil(FStyles); +end; + +procedure TcxEditingControl.DoBeginUpdate; +begin + Inc(FLockUpdate); + DataController.BeginUpdate; +end; + +procedure TcxEditingControl.DoEndUpdate; +begin + DataController.EndUpdate; + Dec(FLockUpdate); + if FLockUpdate = 0 then BeforeUpdate; + LayoutChanged; +end; + +procedure TcxEditingControl.DoEditChanged( + AItem: TcxCustomInplaceEditContainer); +begin + if Assigned(FOnEditChanged) then FOnEditChanged(Self, AItem); +end; + +procedure TcxEditingControl.DoEdited( + AItem: TcxCustomInplaceEditContainer); +begin + if Assigned(FOnEdited) then FOnEdited(Self, AItem); +end; + +function TcxEditingControl.DoEditing( + AItem: TcxCustomInplaceEditContainer): Boolean; +begin + Result := True; + if Assigned(FOnEditing) then + FOnEditing(Self, AItem, Result); +end; + +procedure TcxEditingControl.DoEditValueChanged( + AItem: TcxCustomInplaceEditContainer); +begin + if Assigned(FOnEditValueChanged) then FOnEditValueChanged(Self, AItem); +end; + +procedure TcxEditingControl.DoInitEdit( + AItem: TcxCustomInplaceEditContainer; AEdit: TcxCustomEdit); +begin + if Assigned(FOnInitEdit) then FOnInitEdit(Self, AItem, AEdit); +end; + +procedure TcxEditingControl.DoInplaceEditContainerItemAdded( + AItem: TcxCustomInplaceEditContainer); +begin + try + with DataController do + begin + FContainerList.Add(AItem); + UpdateIndexes; + AddItem(AItem); + end; + finally + LayoutChanged; + end; +end; + +procedure TcxEditingControl.DoInplaceEditContainerItemRemoved( + AItem: TcxCustomInplaceEditContainer); +begin + try + FContainerList.Remove(AItem); + DataController.RemoveItem(AItem); + UpdateIndexes; + finally + LayoutChanged; + end; +end; + +procedure TcxEditingControl.DoLayoutChanged; +begin + ViewInfo.Calculate; +end; + +function TcxEditingControl.GetControllerClass: TcxCustomControlControllerClass; +begin + Result := TcxCustomControlController; +end; + +function TcxEditingControl.GetControlStylesClass: TcxCustomControlStylesClass; +begin + Result := TcxCustomControlStyles; +end; + +function TcxEditingControl.GetDataControllerClass: TcxCustomDataControllerClass; +begin + Result := TcxControlDataController; +end; + +function TcxEditingControl.GetDragImageHelperClass: TcxDragImageHelperClass; +begin + Result := TcxDragImageHelper; +end; + +function TcxEditingControl.GetEditStyleClass: TcxCustomEditStyleClass; +begin + Result := TcxEditStyle; +end; + +function TcxEditingControl.GetEditingControllerClass: TcxEditingControllerClass; +begin + Result := TcxEditingController; +end; + +function TcxEditingControl.GetHitTestControllerClass: TcxHitTestControllerClass; +begin + Result := TcxCustomHitTestController; +end; + +function TcxEditingControl.GetHotTrackControllerClass: TcxHotTrackControllerClass; +begin + Result := TcxHotTrackController; +end; + +function TcxEditingControl.GetViewInfoClass: TcxCustomControlViewInfoClass; +begin + Result := TcxCustomControlViewInfo; +end; + +function TcxEditingControl.GetOptions: IcxEditingControlOptions; +begin + cxAbstractError; +end; + +function TcxEditingControl.GetPainterClass: TcxCustomControlPainterClass; +begin + Result := TcxCustomControlPainter; +end; + +function TcxEditingControl.IsLocked: Boolean; +begin + Result := (FLockUpdate <> 0) or IsLoading or IsDestroying or not HandleAllocated; +end; + +procedure TcxEditingControl.RecreateViewInfo; +begin + if Controller <> nil then + begin + Controller.EditingController.EditingItem := nil; + Controller.Clear; + FreeAndNil(FViewInfo); + FViewInfo := GetViewInfoClass.Create(Self); + end + else + begin + FreeAndNil(FViewInfo); + FViewInfo := GetViewInfoClass.Create(Self); + end; +end; + +procedure TcxEditingControl.SelectionChanged(AInfo: TcxSelectionChangedInfo); +begin +end; + +procedure TcxEditingControl.UpdateIndexes; +var + I: Integer; +begin + for I := 0 to FContainerList.Count - 1 do + TcxCustomInplaceEditContainer(FContainerList.List^[I]).FItemIndex := I; +end; + +procedure TcxEditingControl.UpdateViewStyles; +begin + if ViewInfo <> nil then + ViewInfo.State[cvis_StyleInvalid] := True; + LayoutChanged; +end; + +procedure TcxEditingControl.UpdateData; +begin + Controller.EditingController.UpdateValue; +end; + +procedure TcxEditingControl.AlignControls(AControl: TControl; var Rect: TRect); +begin + if not (AControl is TcxCustomEdit) then + inherited AlignControls(AControl, Rect); +end; + +procedure TcxEditingControl.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + WindowClass.style := WindowClass.style and not (CS_HREDRAW or CS_VREDRAW); +end; + +procedure TcxEditingControl.CreateWnd; +begin + DestroyDesignSelectionHelper; + inherited CreateWnd; + CheckCreateDesignSelectionHelper; +end; + +procedure TcxEditingControl.DestroyWnd; +begin + DestroyDesignSelectionHelper; + inherited DestroyWnd; +end; + +procedure TcxEditingControl.DoExit; +begin + if Controller <> nil then + Controller.DoExit; + inherited DoExit; +end; + +procedure TcxEditingControl.DblClick; +begin + Controller.DblClick; + inherited DblClick; +end; + +procedure TcxEditingControl.KeyDown(var Key: Word; Shift: TShiftState); +begin + Controller.FDragCancel := Key = VK_ESCAPE; + try + inherited KeyDown(Key, Shift); + Controller.KeyDown(Key, Shift); + finally + Controller.FDragCancel := False; + end; +end; + +procedure TcxEditingControl.FocusChanged; +begin + inherited FocusChanged; + if not IsDestroying then + Controller.FocusChanged; +end; + +procedure TcxEditingControl.KeyPress(var Key: Char); +begin + inherited KeyPress(Key); + Controller.KeyPress(Key); +end; + +procedure TcxEditingControl.KeyUp(var Key: Word; Shift: TShiftState); +begin + inherited KeyUp(Key, Shift); + Controller.KeyUp(Key, Shift); +end; + +procedure TcxEditingControl.Loaded; +begin + inherited Loaded; + DataController.Loaded; + LayoutChanged; + CheckCreateDesignSelectionHelper; +end; + +procedure TcxEditingControl.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + with Controller do + begin + HideHint; + LockShowHint := True; + BeforeMouseDown(Button, Shift, X, Y); + inherited MouseDown(Button, Shift, X, Y); + HitTestController.RecalculateOnMouseEvent(X, Y, Shift); + if not EditingController.IsErrorOnEditExit then + DoMouseDown(Button, Shift, X, Y); + end; +end; + +procedure TcxEditingControl.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + Controller.HitTestController.RecalculateOnMouseEvent(X, Y, Shift); + if DragAndDropState = ddsNone then //??? + Controller.DoMouseMove(Shift, X, Y); +end; + +procedure TcxEditingControl.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + Controller.LockShowHint := False; + Controller.HitTestController.RecalculateOnMouseEvent(X, Y, Shift); + if DragAndDropState = ddsNone then + begin + Controller.DoMouseUp(Button, Shift, X, Y); + inherited MouseUp(Button, Shift, X, Y); + end + else + begin + inherited MouseUp(Button, Shift, X, Y); + Controller.DoMouseUp(Button, Shift, X, Y); + end; + Controller.PostShowEdit; +end; + +procedure TcxEditingControl.MouseEnter(AControl: TControl); +begin + inherited MouseEnter(AControl); + BeginMouseTracking(Self, Bounds, Self); + Controller.MouseEnter; +end; + +procedure TcxEditingControl.MouseLeave(AControl: TControl); +begin + EndMouseTracking(Self); + Controller.MouseLeave; + inherited MouseLeave(AControl); +end; + +procedure TcxEditingControl.Paint; +begin + Controller.BeforePaint; + try + inherited Paint; + Painter.Paint; + finally + Controller.AfterPaint; + end; +end; + +procedure TcxEditingControl.WndProc(var Message: TMessage); +begin + if Controller <> nil then + Controller.WndProc(Message); + inherited WndProc(Message); +end; + +procedure TcxEditingControl.AfterMouseDown(AButton: TMouseButton; + X, Y: Integer); +begin + FDragPos := cxPoint(X, Y); + inherited AfterMouseDown(AButton, X, Y); +end; + +procedure TcxEditingControl.BoundsChanged; +begin + LayoutChanged; + inherited BoundsChanged; +end; + +function TcxEditingControl.CanDrag(X, Y: Integer): Boolean; +begin + if Controller <> nil then + Result := Controller.CanDrag(X, Y) + else + Result := False; +end; + +procedure TcxEditingControl.DoCancelMode; +begin + inherited DoCancelMode; + Controller.DoCancelMode; +end; + +procedure TcxEditingControl.FontChanged; +begin + inherited FontChanged; + UpdateViewStyles; +end; + +function TcxEditingControl.GetCursor(X, Y: Integer): TCursor; +begin + Result := Controller.GetCursor(X, Y); + if Result = crDefault then + Result := inherited GetCursor(X, Y); +end; + +function TcxEditingControl.GetDesignHitTest( + X, Y: Integer; Shift: TShiftState): Boolean; +begin + Result := Controller.HitTestController.AllowDesignMouseEvents(X, Y, Shift); +end; + +function TcxEditingControl.GetIsFocused: Boolean; +begin + Result := inherited GetIsFocused or Controller.HasFocusedControls; +end; + +function TcxEditingControl.GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; +begin + Result := inherited GetMouseWheelScrollingKind; + if Result = mwskNone then + Result := Controller.GetMouseWheelScrollingKind; +end; + +procedure TcxEditingControl.InitControl; +begin + inherited InitControl; + LayoutChanged; +end; + +function TcxEditingControl.IsPixelScrollBar(AKind: TScrollBarKind): Boolean; +begin + Result := Controller.IsPixelScrollBar(AKind); +end; + +procedure TcxEditingControl.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +var + I: Integer; + AIsEditing: Boolean; +begin + AIsEditing := (Controller <> nil) and Controller.IsEditing; + if AIsEditing then + Controller.EditingController.HideEdit(True); + inherited LookAndFeelChanged(Sender, AChangedValues); + BeginUpdate; + try + for I := 0 to FContainerList.Count - 1 do + TcxCustomInplaceEditContainer(FContainerList[I]).InternalPropertiesChanged; + finally + UpdateViewStyles; + EndUpdate; + if AIsEditing then + Controller.EditingController.ShowEdit; + end; +end; + +function TcxEditingControl.MayFocus: Boolean; +begin + Result := inherited MayFocus; + if Controller <> nil then + Result := Result and Controller.MayFocus; +end; + +// drag'n'drop +procedure TcxEditingControl.DoEndDrag(Target: TObject; X, Y: Integer); +begin + Controller.EndDrag(Target, X, Y); + inherited DoEndDrag(Target, X, Y); + Controller.LockShowHint := False; + Controller.PostShowEdit; + FinishDragImages; + FDragPos := cxNullPoint; +end; + +procedure TcxEditingControl.DoStartDrag(var DragObject: TDragObject); +begin + Controller.HitTestController.HitPoint := FDragPos; + Controller.BeforeStartDrag; + inherited DoStartDrag(DragObject); + Controller.StartDrag(DragObject); + FinishDragImages; + if HasDragDropImages then + begin + FDragHelper := GetDragImageHelperClass.Create(Self, FDragPos); + cxInstallMouseHookForDragControl(Self); + end; +end; + +procedure TcxEditingControl.DragOver(Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); +begin + inherited DragOver(Source, X, Y, State, Accept); + Controller.DragOver(Source, X, Y, State, Accept); +end; + +function TcxEditingControl.DragDropImageDisplayRect: TRect; +begin + Result := cxNullRect; +end; + +procedure TcxEditingControl.DrawDragDropImage( + ADragBitmap: TBitmap; ACanvas: TcxCanvas); +begin +end; + +procedure TcxEditingControl.FinishDragImages; +begin + if FDragHelper <> nil then + begin + cxResetMouseHookForDragControl; + FreeAndNil(FDragHelper); + end; +end; + +function TcxEditingControl.HasDragDropImages: Boolean; +begin + Result := Options.OptionsBehavior.DragDropText; +end; + +// scrollbars +procedure TcxEditingControl.InitScrollBarsParameters; +begin + if Controller <> nil then + Controller.InitScrollBarsParameters; +end; + +procedure TcxEditingControl.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +begin + Controller.EditingController.PostEditUpdate; + Controller.Scroll(AScrollBarKind, AScrollCode, AScrollPos); +end; + +procedure TcxEditingControl.DragAndDrop(const P: TPoint; + var Accepted: Boolean); +begin + inherited DragAndDrop(P, Accepted); + Controller.DragAndDrop(P, Accepted); +end; + +procedure TcxEditingControl.EndDragAndDrop(Accepted: Boolean); +begin + inherited EndDragAndDrop(Accepted); + Controller.EndDragAndDrop(Accepted); + FDragPos := cxNullPoint; +end; + +function TcxEditingControl.GetDragAndDropObjectClass: TcxDragAndDropObjectClass; +begin + Result := Controller.GetDragAndDropObjectClass; +end; + +function TcxEditingControl.StartDragAndDrop(const P: TPoint): Boolean; +begin + Result := Controller.StartDragAndDrop(P); + if Result then + Controller.HideHint; +end; + +function TcxEditingControl.GetBufferedPaint: Boolean; +begin + Result := GetPainter.Buffered; +end; + +function TcxEditingControl.GetPainter: TcxCustomControlPainter; +begin + Result := ViewInfo.FPainter; +end; + +procedure TcxEditingControl.DoMouseLeave; +begin + MouseLeave(Self); +end; + +procedure TcxEditingControl.SetBufferedPaint(Value: Boolean); +begin + Painter.Buffered := Value; +end; + +procedure TcxEditingControl.SetEditStyle(Value: TcxCustomEditStyle); +begin + FEditStyle.Assign(Value); +end; + +procedure TcxEditingControl.SetStyles(Value: TcxCustomControlStyles); +begin + FStyles.Assign(Value); +end; + +procedure TcxEditingControl.WMCancelMode(var Message: TWMCancelMode); +begin + Controller.FDragCancel := True; + try + inherited; + finally + Controller.FDragCancel := False; + end; +end; + +procedure TcxEditingControl.WMSetCursor(var Message: TWMSetCursor); +var + P: TPoint; +begin + GetCursorPos(P); + P := ScreenToClient(P); + with Controller.HitTestController do + begin + if IsDesigning and (DragAndDropState = ddsNone) and + AllowDesignMouseEvents(P.X, P.Y, [ssLeft]) then + SetCursor(Screen.Cursors[GetCurrentCursor]) + else + inherited; + end; +end; + +{ TcxExtEditingControl } + +procedure TcxExtEditingControl.CreateSubClasses; +begin + FOptionsBehavior := GetOptionsBehaviorClass.Create(Self); + FOptionsData := GetOptionsDataClass.Create(Self); + FOptionsView := GetOptionsViewClass.Create(Self); + inherited CreateSubClasses; +end; + +procedure TcxExtEditingControl.DestroySubClasses; +begin + inherited DestroySubClasses; + FOptionsBehavior.Free; + FOptionsData.Free; + FOptionsView.Free; +end; + +function TcxExtEditingControl.GetOptions: IcxEditingControlOptions; +begin + Result := Self; +end; + +function TcxExtEditingControl.GetOptionsBehaviorClass: TcxControlOptionsBehaviorClass; +begin + Result := TcxControlOptionsBehavior; +end; + +function TcxExtEditingControl.GetOptionsDataClass: TcxControlOptionsDataClass; +begin + Result := TcxControlOptionsData; +end; + +function TcxExtEditingControl.GetOptionsViewClass: TcxControlOptionsViewClass; +begin + Result := TcxControlOptionsView; +end; + +function TcxExtEditingControl.GetOptionsBehavior: TcxControlOptionsBehavior; +begin + Result := FOptionsBehavior; +end; + +function TcxExtEditingControl.GetOptionsData: TcxControlOptionsData; +begin + Result := FOptionsData; +end; + +function TcxExtEditingControl.GetOptionsView: TcxControlOptionsView; +begin + Result := FOptionsView; +end; + +procedure TcxExtEditingControl.SetOptionsBehavior( + Value: TcxControlOptionsBehavior); +begin + FOptionsBehavior.Assign(Value); +end; + +procedure TcxExtEditingControl.SetOptionsData( + Value: TcxControlOptionsData); +begin + FOptionsData.Assign(Value); +end; + +procedure TcxExtEditingControl.SetOptionsView( + Value: TcxControlOptionsView); +begin + FOptionsView.Assign(Value); +end; + +{ TcxValueTypeClassRepository } + +constructor TcxValueTypeClassRepository.Create; +begin + FList := TStringList.Create; +end; + +destructor TcxValueTypeClassRepository.Destroy; +begin + FList.Free; + inherited Destroy; +end; + +function TcxValueTypeClassRepository.FindByClassType(ATypeClass: TcxValueTypeClass): string; +var + I: Integer; +begin + I := FList.IndexOfObject(TObject(ATypeClass)); + if I >= 0 then + Result := FList[I] + else + Result := ''; +end; + +function TcxValueTypeClassRepository.FindByDescription(const ADescription: string): TcxValueTypeClass; +var + I: Integer; +begin + I := FList.IndexOf(ADescription); + if I >= 0 then + Result := TcxValueTypeClass(FList.Objects[I]) + else + Result := nil; +end; + +procedure TcxValueTypeClassRepository.RegisterValueTypeClass(const ADescription: string; ATypeClass: TcxValueTypeClass); +begin + if FList.IndexOfObject(TObject(ATypeClass)) < 0 then + FList.AddObject(ADescription, TObject(ATypeClass)); +end; + +procedure TcxValueTypeClassRepository.UnRegisterValueTypeClass(ATypeClass: TcxValueTypeClass); +var + I: Integer; +begin + I := FList.IndexOfObject(TObject(ATypeClass)); + if I >= 0 then FList.Delete(I); +end; + +function TcxValueTypeClassRepository.GetCount: Integer; +begin + Result := FList.Count; +end; + +function TcxValueTypeClassRepository.GetValueTypeClass(AIndex: Integer): TcxValueTypeClass; +begin + Result := TcxValueTypeClass(FList.Objects[AIndex]); +end; + +function TcxValueTypeClassRepository.GetDescription(AIndex: Integer): string; +begin + Result := FList[AIndex]; +end; + +function cxieValueTypeClassRepository: TcxValueTypeClassRepository; +begin + Result := ValueTypeClassRepository; +end; + +procedure cxieRegisterValueTypeClass( + const ADescription: string; ATypeClass: TcxValueTypeClass); +begin + ValueTypeClassRepository.RegisterValueTypeClass(ADescription, ATypeClass); +end; + +procedure cxieUnRegisterValueTypeClass(ATypeClass: TcxValueTypeClass); +begin + ValueTypeClassRepository.UnRegisterValueTypeClass(ATypeClass); +end; + +function cxPtInViewInfoItem(AItem: TcxCustomViewInfoItem; const APoint: TPoint): Boolean; +begin + Result := (AItem <> nil) and AItem.Visible and cxRectPtIn(AItem.ClipRect, APoint); +end; + +procedure RegisterDefaultValueTypeClasses; +begin + cxieRegisterValueTypeClass('Boolean', TcxBooleanValueType); + cxieRegisterValueTypeClass('String', TcxStringValueType); + cxieRegisterValueTypeClass('Integer', TcxIntegerValueType); + cxieRegisterValueTypeClass('Currency', TcxCurrencyValueType); + cxieRegisterValueTypeClass('Float', TcxFloatValueType); + cxieRegisterValueTypeClass('DateTime', TcxDateTimeValueType); + cxieRegisterValueTypeClass('Variant', TcxVariantValueType); +end; + +procedure cxStylesToViewParams(AMasterStyles: TcxCustomControlStyles; AIndex: Integer; + AData: Pointer; const AStyles: array of TcxStyle; out AParams: TcxViewParams); +var + I: Integer; + IsColorAssigned, IsFontAssigned, IsFontColorAssigned, IsBitmapAssigned: Boolean; + + function NeedValueAssign(var AFlag: Boolean; IsValueAssigned: Boolean): Boolean; + begin + Result := not AFlag and IsValueAssigned; + if Result then AFlag := True; + end; + + function AssignStyle(AStyle: TcxStyle): Boolean; + begin + Result := False; + if not Assigned(AStyle) or (csDestroying in AStyle.ComponentState) then Exit; + with AStyle do + begin + if NeedValueAssign(IsColorAssigned, cxStyles.svColor in AssignedValues) then + AParams.Color := Color; + if NeedValueAssign(IsFontAssigned, cxStyles.svFont in AssignedValues) then + AParams.Font := Font; + if NeedValueAssign(IsFontColorAssigned, cxStyles.svTextColor in AssignedValues) then + AParams.TextColor := TextColor; + if NeedValueAssign(IsBitmapAssigned, cxStyles.svBitmap in AssignedValues) then + AParams.Bitmap := Bitmap; + end; + Result := IsFontColorAssigned and IsFontAssigned and IsColorAssigned and IsBitmapAssigned; + end; + + procedure AssignDefaultViewParams; + var + ADefParams: TcxViewParams; + begin + AMasterStyles.GetDefaultViewParams(AIndex, AData, ADefParams); + if not IsColorAssigned then + AParams.Color := ADefParams.Color; + if not IsFontAssigned then + AParams.Font := ADefParams.Font; + if not IsFontColorAssigned then + AParams.TextColor := ADefParams.TextColor; + if not IsBitmapAssigned then + AParams.Bitmap := ADefParams.Bitmap; + end; + +begin + IsColorAssigned := False; + IsFontAssigned := False; + IsFontColorAssigned := False; + IsBitmapAssigned := False; + FillChar(AParams, SizeOf(AParams), 0); + for I := Low(AStyles) to High(AStyles) do + if AssignStyle(AStyles[I]) then Exit; + AssignDefaultViewParams; +end; + +function cxInRange(Value: Integer; AMin, AMax: Integer): Boolean; +begin + Result := (Value >= AMin) and (Value <= AMax); +end; + +function cxRange(var Value: Integer; AMin, AMax: Integer): Boolean; +begin + Result := (Value >= AMin) and (Value <= AMax); + if not Result then + begin + if Value < AMin then + Value := AMin + else + Value := AMax + end; +end; + +function cxSetValue(Condition: Boolean; ATrueValue, AFalseValue: Integer): Integer; +begin + if Condition then + Result := ATrueValue + else + Result := AFalseValue; +end; + +function cxConfirmMessageBox(const AText, ACaption: string): Boolean; +begin + Result := Application.MessageBox(PChar(AText), PChar(ACaption), + MB_ICONQUESTION or MB_OKCANCEL) = ID_OK +end; + +initialization + ValueTypeClassRepository := TcxValueTypeClassRepository.Create; + RegisterDefaultValueTypeClasses; + +finalization + cxResetMouseHookForDragControl; + FreeAndNil(ValueTypeClassRepository); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxInplaceContainerReg.pas b/official/x.35/ExpressEditors Library 5/Sources/cxInplaceContainerReg.pas new file mode 100644 index 00000000..c659852a --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxInplaceContainerReg.pas @@ -0,0 +1,325 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Common Editing Library } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE COMMONEDITINGLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxInplaceContainerReg; + +{$I cxVer.inc} + +interface + +uses + Classes, SysUtils, +{$IFDEF DELPHI6} + DesignIntf, DesignEditors, +{$ELSE} + DsgnWnds, DsgnIntf, +{$ENDIF} + cxClasses, cxPropEditors, cxEdit, cxDesignWindows, cxInplaceContainer; + +type + TItemDataBindingAccess = class(TcxItemDataBinding); + + { TcxstPropEventsProperty } + + TcxInplaceEditContainerPropertiesEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + + { TcxInplaceEditContainerPropertiesProperty } + + TcxInplaceEditContainerPropertiesProperty = class(TClassProperty) + protected + function HasSubProperties: Boolean; + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + { TcxValueTypeClassProperty } + + TcxValueTypeClassProperty = class(TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + { TcxDesignSelectionHelper } + + TcxDesignSelectionHelper = class(TcxCustomDesignSelectionHelper + {$IFDEF DELPHI6}, IUnknown, IDesignNotification{$ENDIF}) + private + FDesignHelper: TcxDesignHelper; + protected + {$IFDEF DELPHI6} + // IUnknown + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall; + // IDesignNotification + procedure ItemDeleted(const ADesigner: IDesigner; AItem: TPersistent); + procedure ItemInserted(const ADesigner: IDesigner; AItem: TPersistent); + procedure ItemsModified(const ADesigner: IDesigner); + procedure SelectionChanged(const ADesigner: IDesigner; const ASelection: IDesignerSelections); + procedure DesignerOpened(const ADesigner: IDesigner; AResurrecting: Boolean); + procedure DesignerClosed(const ADesigner: IDesigner; AGoingDormant: Boolean); + {$ENDIF} + public + constructor Create(AControl: TcxEditingControl); override; + destructor Destroy; override; + function IsObjectSelected(AObject: TPersistent): Boolean; override; + procedure Select(AObject: TPersistent; AShift: TShiftState); override; + procedure UnselectObject(AObject: TPersistent); override; + end; + +procedure Register; + +implementation + +uses + Windows; + +{ TcxInplaceEditContainerPropertiesEventsProperty } + +function TcxInplaceEditContainerPropertiesEventsProperty.GetInstance: TPersistent; +var + AIntf: IcxEditorPropertiesContainer; +begin + if Supports(GetComponent(0), IcxEditorPropertiesContainer, AIntf) then + Result := AIntf.GetProperties + else + Result := nil; +end; + +{ TcxInplaceEditContainerPropertiesProperty } + +function TcxInplaceEditContainerPropertiesProperty.HasSubProperties: Boolean; +var + I: Integer; + AIntf: IcxEditorPropertiesContainer; +begin + for I := 0 to PropCount - 1 do + begin + Result := Supports(GetComponent(I), IcxEditorPropertiesContainer, AIntf) and + (AIntf.GetProperties <> nil); + if not Result then Exit; + end; + Result := True; +end; + +function TcxInplaceEditContainerPropertiesProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes; + if not HasSubProperties then + Exclude(Result, paSubProperties); + Result := Result - [paReadOnly] + [paValueList, paSortList, paRevertable] + + {$IFDEF DELPHI6}[paVolatileSubProperties] {$ELSE } [] {$ENDIF}; +end; + +function TcxInplaceEditContainerPropertiesProperty.GetValue: string; +begin + if HasSubProperties then + Result := GetRegisteredEditProperties.GetDescriptionByClass( + TcxCustomEditProperties(GetOrdValue).ClassType) + else + Result := ''; +end; + +procedure TcxInplaceEditContainerPropertiesProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to GetRegisteredEditProperties.Count - 1 do + Proc(GetRegisteredEditProperties.Descriptions[I]); +end; + +procedure TcxInplaceEditContainerPropertiesProperty.SetValue(const Value: string); +var + APropertiesClass: TcxCustomEditPropertiesClass; + I: Integer; + AIntf: IcxEditorPropertiesContainer; +begin + {$IFNDEF DELPHI7} + ObjectInspectorCollapseProperty; + {$ENDIF} + APropertiesClass := TcxCustomEditPropertiesClass( + GetRegisteredEditProperties.FindByClassName(Value)); + if APropertiesClass = nil then + APropertiesClass := TcxCustomEditPropertiesClass( + GetRegisteredEditProperties.FindByDescription(Value)); + for I := 0 to PropCount - 1 do + if Supports(GetComponent(I), IcxEditorPropertiesContainer, AIntf) then + AIntf.SetPropertiesClass(APropertiesClass); + Modified; +end; + +{ TcxValueTypeClassProperty } + +function TcxValueTypeClassProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes - [paReadOnly] + [paValueList]; +end; + +procedure TcxValueTypeClassProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to cxieValueTypeClassRepository.Count - 1 do + Proc(cxieValueTypeClassRepository.Description[I]); +end; + +procedure TcxValueTypeClassProperty.SetValue(const Value: string); +var + I: Integer; +begin + for I := 0 to PropCount - 1 do + TItemDataBindingAccess(GetComponent(I)).ValueType := Value; +end; + +{ TcxDesignSelectionHelper } + +constructor TcxDesignSelectionHelper.Create(AControl: TcxEditingControl); +begin + inherited Create(AControl); + FDesignHelper := TcxDesignHelper.Create(Control); +{$IFDEF DELPHI6} + RegisterDesignNotification(Self); +{$ENDIF} +end; + +destructor TcxDesignSelectionHelper.Destroy; +begin +{$IFDEF DELPHI6} + UnregisterDesignNotification(Self); +{$ENDIF} + FDesignHelper.Free; + inherited Destroy; +end; + +function TcxDesignSelectionHelper.IsObjectSelected( + AObject: TPersistent): Boolean; +begin + Result := FDesignHelper.IsObjectSelected(AObject); +end; + +procedure TcxDesignSelectionHelper.Select(AObject: TPersistent; + AShift: TShiftState); +begin + if AShift * [ssCtrl, ssAlt] <> [] then Exit; + if AObject = nil then + FDesignHelper.SelectObject(Control) + else + if ssShift in AShift then + FDesignHelper.ChangeSelection(AObject) + else + FDesignHelper.SelectObject(AObject); +end; + +procedure TcxDesignSelectionHelper.UnselectObject(AObject: TPersistent); +begin + FDesignHelper.UnselectObject(AObject); +end; + +{$IFDEF DELPHI6} +function TcxDesignSelectionHelper._AddRef: Integer; stdcall; +begin + Result := -1; +end; + +function TcxDesignSelectionHelper._Release: Integer; stdcall; +begin + Result := -1; +end; + +function TcxDesignSelectionHelper.QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; +begin + if GetInterface(IID, Obj) then Result := 0 else Result := cxE_NOINTERFACE; +end; + +procedure TcxDesignSelectionHelper.ItemDeleted(const ADesigner: IDesigner; + AItem: TPersistent); +begin +end; + +procedure TcxDesignSelectionHelper.ItemInserted(const ADesigner: IDesigner; + AItem: TPersistent); +begin +end; + +procedure TcxDesignSelectionHelper.ItemsModified(const ADesigner: IDesigner); +begin +end; + +procedure TcxDesignSelectionHelper.SelectionChanged(const ADesigner: IDesigner; + const ASelection: IDesignerSelections); +begin + Control.LayoutChanged; + Control.Invalidate; +end; + +procedure TcxDesignSelectionHelper.DesignerOpened(const ADesigner: IDesigner; + AResurrecting: Boolean); +begin +end; + +procedure TcxDesignSelectionHelper.DesignerClosed(const ADesigner: IDesigner; + AGoingDormant: Boolean); +begin +end; +{$ENDIF} + +procedure Register; +begin + RegisterClasses([TcxCustomInplaceEditContainer]); + RegisterNoIcon([TcxCustomInplaceEditContainer]); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomInplaceEditContainer, 'PropertiesEvents', + TcxInplaceEditContainerPropertiesEventsProperty); + RegisterPropertyEditor(TypeInfo(string), TcxCustomInplaceEditContainer, + 'PropertiesClassName', nil); + RegisterPropertyEditor(TypeInfo(TcxCustomEditProperties), TcxCustomInplaceEditContainer, + 'Properties', TcxInplaceEditContainerPropertiesProperty); + RegisterPropertyEditor(TypeInfo(string), TcxItemDataBinding, + 'ValueType', TcxValueTypeClassProperty); +end; + +initialization +{$IFDEF DELPHI6} + cxDesignSelectionHelperClass := TcxDesignSelectionHelper; +{$ENDIF} + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxLabel.pas b/official/x.35/ExpressEditors Library 5/Sources/cxLabel.pas new file mode 100644 index 00000000..7b85f586 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxLabel.pas @@ -0,0 +1,1364 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxLabel; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, Variants, +{$ENDIF} + Windows, Classes, Controls, Forms, Graphics, Messages, SysUtils, cxClasses, + cxContainer, cxControls, cxCustomData, cxDataUtils, cxEdit, cxExtEditConsts, + cxGraphics, cxTextEdit, cxVariants; + +type + TcxLabelEffect = (cxleNormal, cxleFun, cxleExtrude, cxleCool); + TcxLabelStyle = (cxlsNormal, cxlsRaised, cxlsLowered, cxlsOutLine); + TcxLabelOrientation = (cxoLeft, cxoRight, cxoTop, cxoBottom, cxoLeftTop, + cxoLeftBottom, cxoRightTop, cxoRightBottom); + + { TcxLabelEditStyle } + + TcxLabelEditStyle = class(TcxEditStyle) + protected + function DefaultBorderStyle: TcxContainerBorderStyle; override; + function DefaultHotTrack: Boolean; override; + end; + + { TcxCustomLabelViewInfo } + + TcxCustomLabelViewInfo = class(TcxCustomTextEditViewInfo) + private + FAlignment: TcxEditAlignment; + FAngle: Integer; + FDepth: Word; + FDepthDeltaSize: TSize; + FDrawBitmap: TBitmap; + FGlyph: TBitmap; + FIsDrawBitmapDirty: Boolean; + FInplaceOffset: TPoint; + FLabelEffect: TcxLabelEffect; + FLabelStyle: TcxLabelStyle; + FLabelTextRect: TRect; + FOrientation: TcxLabelOrientation; + FPenWidth: Integer; + FShadowedColor: TColor; + FWordWrap: Boolean; + protected + procedure SetBackgroundColor(Value: TColor); override; + property Alignment: TcxEditAlignment read FAlignment write FAlignment; + property LabelEffect: TcxLabelEffect read FLabelEffect write FLabelEffect; + property LabelStyle: TcxLabelStyle read FLabelStyle write FLabelStyle; + property Orientation: TcxLabelOrientation read FOrientation write FOrientation; + property Depth: Word read FDepth write FDepth; + property DepthDeltaSize: TSize read FDepthDeltaSize write FDepthDeltaSize; + property ShadowedColor: TColor read FShadowedColor write FShadowedColor; + property Angle: Integer read FAngle write FAngle; + property PenWidth: Integer read FPenWidth write FPenWidth; + property WordWrap: Boolean read FWordWrap write FWordWrap; + property Glyph: TBitmap read FGlyph write FGlyph; + property LabelTextRect: TRect read FLabelTextRect write FLabelTextRect; + public + DrawTextOffsets: TRect; + FocusRect: TRect; + HasGlyph: Boolean; + LeftTop: TPoint; + ShowAccelChar: Boolean; + constructor Create; override; + destructor Destroy; override; + procedure Offset(DX, DY: Integer); override; + procedure Paint(ACanvas: TcxCanvas); override; + procedure DrawLabel(ACanvas: TcxCanvas); virtual; + end; + + { TcxCustomLabelViewData } + + TcxCustomLabelProperties = class; + + TcxCustomLabelViewData = class(TcxCustomEditViewData) + private + function GetProperties: TcxCustomLabelProperties; + procedure CalculateLabelViewInfoProps(AViewInfo: TcxCustomEditViewInfo); + protected + function GetDrawTextFlags: Integer; virtual; + function GetIsEditClass: Boolean; + function InternalEditValueToDisplayText(AEditValue: TcxEditValue): string; override; + public + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); override; + procedure EditValueToDrawValue(ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + AViewInfo: TcxCustomEditViewInfo); override; + function GetEditContentSize(ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + const AEditSizeProperties: TcxEditSizeProperties): TSize; override; + property Properties: TcxCustomLabelProperties read GetProperties; + end; + + { TcxCustomLabelProperties } + + TcxCustomLabelProperties = class(TcxCustomEditProperties) + private + FLabelEffect: TcxLabelEffect; + FLabelStyle: TcxLabelStyle; + FOrientation: TcxLabelOrientation; + FDepth: Word; + FShadowedColor: TColor; + FShowAccelChar: Boolean; + FShowEndEllipsis: Boolean; // deprecated + FAngle: Integer; + FPenWidth: Integer; + FGlyph: TBitmap; + FWordWrap: Boolean; + procedure SetLabelEffect(Value : TcxLabelEffect); + procedure SetLabelStyle(Value : TcxLabelStyle); + procedure SetOrientation(Value : TcxLabelOrientation); + procedure SetDepth(Value : Word); + procedure SetShadowedColor(Value : TColor); + procedure SetAngle(Value: Integer); + procedure SetPenWidth(Value: Integer); + function GetGlyph: TBitmap; + procedure GlyphChanged(Sender: TObject); + procedure SetGlyph(Value: TBitmap); + procedure SetShowAccelChar(Value: Boolean); + procedure SetWordWrap(Value: Boolean); + protected + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + function HasDisplayValue: Boolean; override; + function CalculateDepthDelta: TSize; virtual; + function GetDisplayFormatOptions: TcxEditDisplayFormatOptions; override; + property ShowEndEllipsis: Boolean read FShowEndEllipsis + write FShowEndEllipsis stored False; // deprecated + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function CanCompareEditValue: Boolean; override; + class function GetContainerClass: TcxContainerClass; override; + class function GetStyleClass: TcxCustomEditStyleClass; override; + function GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; override; + function GetSupportedOperations: TcxEditSupportedOperations; override; + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + function IsEditValueValid(var EditValue: TcxEditValue; AEditFocused: Boolean): Boolean; override; + procedure PrepareDisplayValue(const AEditValue: TcxEditValue; + var DisplayValue: TcxEditValue; AEditFocused: Boolean); override; + function GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; override; + // !!! + property Angle: Integer read FAngle write SetAngle default 0; + property Depth: Word read FDepth write SetDepth default 0; + property Glyph: TBitmap read GetGlyph write SetGlyph; + property LabelEffect: TcxLabelEffect read FLabelEffect + write SetLabelEffect default cxleNormal; + property LabelStyle: TcxLabelStyle read FLabelStyle + write SetLabelStyle default cxlsNormal; + property Orientation: TcxLabelOrientation read FOrientation + write SetOrientation default cxoRightBottom; + property PenWidth: Integer read FPenWidth write SetPenWidth default 1; + property ShadowedColor: TColor read FShadowedColor + write SetShadowedColor default clGrayText; + property ShowAccelChar: Boolean read FShowAccelChar write SetShowAccelChar + default True; + property Transparent; // deprecated + property WordWrap: Boolean read FWordWrap write SetWordWrap default False; + end; + + { TcxLabelProperties } + + TcxLabelProperties = class(TcxCustomLabelProperties) + published + property Alignment; + property Angle; + property Depth; + property Glyph; + property LabelEffect; + property LabelStyle; + property Orientation; + property PenWidth; + property ShadowedColor; + property ShowAccelChar; + property ShowEndEllipsis; // deprecated + property Transparent; // deprecated + property WordWrap; + end; + + { TcxCustomLabel } + + TcxCustomLabel = class(TcxCustomEdit) + private + FFirstIsRightBoundFixedCalling: Boolean; + FFocusControl: TWinControl; + FLockCaption: Boolean; + function GetProperties: TcxCustomLabelProperties; + function GetActiveProperties: TcxCustomLabelProperties; + function GetStyle: TcxLabelEditStyle; + function GetViewInfo: TcxCustomLabelViewInfo; + procedure SetProperties(Value: TcxCustomLabelProperties); + procedure SetStyle(Value: TcxLabelEditStyle); + procedure SetFocusControl(Value: TWinControl); + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + protected + procedure Initialize; override; + procedure InternalSetEditValue(const Value: TcxEditValue; AValidateEditValue: Boolean); override; + function IsRightBoundFixed: Boolean; override; + procedure ReadState(Reader: TReader); override; + procedure SetInternalDisplayValue(Value: TcxEditValue); override; + procedure TextChanged; override; + function CanAutoWidth: Boolean; override; + function CanFocusOnClick: Boolean; override; + function DefaultParentColor: Boolean; override; + procedure Notification(ACOmponent: TComponent; Operation: TOperation); override; + property FocusControl: TWinControl read FFocusControl write SetFocusControl; + property ViewInfo: TcxCustomLabelViewInfo read GetViewInfo; + public + destructor Destroy; override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + function CanFocus: Boolean; override; + {$IFDEF DELPHI10} + function GetTextBaseLine: Integer; override; + function HasTextBaseLine: Boolean; override; + {$ENDIF} + property ActiveProperties: TcxCustomLabelProperties + read GetActiveProperties; + property Caption; + property Properties: TcxCustomLabelProperties read GetProperties + write SetProperties; + property Style: TcxLabelEditStyle read GetStyle write SetStyle; + property TabOrder stored False; + property Transparent; + end; + + { TcxCustomLabel } + + TcxLabel = class(TcxCustomLabel) + private + function GetActiveProperties: TcxLabelProperties; + function GetProperties: TcxLabelProperties; + procedure SetProperties(Value: TcxLabelProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxLabelProperties read GetActiveProperties; + published + property Align; + property Anchors; + property AutoSize; + property Caption; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property FocusControl; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxLabelProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property Transparent; + property Visible; + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +uses + Math, cxEditConsts, cxEditPaintUtils, cxEditUtils, cxExtEditUtils, + cxFilterControlUtils, dxThemeConsts, dxThemeManager, dxUxTheme; + +const + TextFromBorderOffset = 1; + +procedure CalculateCustomLabelViewInfo(ACanvas: TcxCanvas; AViewData: TcxCustomLabelViewData; + AViewInfo: TcxCustomLabelViewInfo); + + procedure CheckFocusRectBounds; + begin + with AViewInfo do + begin + if FocusRect.Left < TextRect.Left - 1 then + FocusRect.Left := TextRect.Left - 1; + if FocusRect.Top < TextRect.Top - 1 then + FocusRect.Top := TextRect.Top - 1; + if FocusRect.Right > TextRect.Right + 1 then + FocusRect.Right := TextRect.Right + 1; + if FocusRect.Bottom > TextRect.Bottom + 1 then + FocusRect.Bottom := TextRect.Bottom + 1; + end; + end; + +begin + with AViewInfo do + begin + if not IsInplace and Focused then + if Length(Text) = 0 then + FocusRect := cxEmptyRect + else + begin + FocusRect := TextRect; + InflateRect(FocusRect, 1, 1); + CheckFocusRectBounds; + end; + end; +end; + +{ TcxLabelEditStyle } + +function TcxLabelEditStyle.DefaultBorderStyle: TcxContainerBorderStyle; +begin + if IsBaseStyle then + Result := cbsNone + else + Result := inherited DefaultBorderStyle; +end; + +function TcxLabelEditStyle.DefaultHotTrack: Boolean; +begin + Result := False; +end; + +{ TcxCustomLabelViewInfo } + +constructor TcxCustomLabelViewInfo.Create; +begin + inherited Create; + FAlignment := TcxEditAlignment.Create(nil); + FDrawBitmap := TBitmap.Create; + FInplaceOffset := Point(MaxInt, MaxInt); +end; + +destructor TcxCustomLabelViewInfo.Destroy; +begin + FreeAndNil(FDrawBitmap); + if Assigned(FAlignment) then FreeAndNil(FAlignment); + inherited; +end; + +procedure TcxCustomLabelViewInfo.Offset(DX, DY: Integer); +begin + inherited Offset(DX, DY); + OffsetRect(FLabelTextRect, DX, DY); + OffsetRect(FocusRect, DX, DY); + if Transparent then + FIsDrawBitmapDirty := True; +end; + +procedure TcxCustomLabelViewInfo.Paint(ACanvas: TcxCanvas); +begin + DrawCustomEdit(ACanvas, Self, False, bpsSolid); + DrawLabel(ACanvas); +end; + +procedure TcxCustomLabelViewInfo.DrawLabel(ACanvas: TcxCanvas); + + function GetColor(BColor, EColor: TColor; N,H: Integer) : TColor; + begin + EColor := ColorToRGB(EColor); + BColor := ColorToRGB(BColor); + + Result := RGB(Trunc(GetRValue(BColor) + (GetRValue(EColor) - GetRValue(BColor)) * N / H), + Trunc(GetGValue(BColor) + (GetGValue(EColor) - GetGValue(BColor)) * N / H), + Trunc(GetBValue(BColor) + (GetBValue(EColor) - GetBValue(BColor)) * N / H)); + end; + + procedure DrawBackground(ADrawCanvas: TcxCanvas; const ADrawingRect: TRect; + AParentBackgroundOffset: TPoint); + begin + if Self.DrawBackground(ADrawCanvas, AParentBackgroundOffset) then + Exit; + if not Transparent or IsInplace and Focused then + cxEditFillRect(ADrawCanvas, ADrawingRect, BackgroundColor) + else + if IsInplace then + BitBlt(ADrawCanvas.Handle, ADrawingRect.Left, ADrawingRect.Top, + RectWidth(ADrawingRect), RectHeight(ADrawingRect), ACanvas.Handle, + AParentBackgroundOffset.X, AParentBackgroundOffset.Y, SRCCOPY) + else + begin + if not (csPaintCopy in Edit.ControlState) then + begin + with AParentBackgroundOffset do + cxDrawTransparentControlBackground(Edit, ADrawCanvas, + Rect(X, Y, X + RectWidth(ADrawingRect), Y + RectHeight(ADrawingRect))); + end; + end; + end; + + function GetLabelStyleOffset: Integer; + begin + Result := 0; + if LabelStyle in [cxlsRaised, cxlsLowered] then + begin + if Font.Size >= 12 then + Result := 2 + else + Result := 1; + end; + end; + + function GetTextDrawingParameters(ACanvas: TCanvas; ADrawingRect: TRect; + AAngle: Integer; out AStep: TSize): TPoint; + + procedure CalcRotatedTextPos(ACanvas: TCanvas); + var + ARect: TRect; + AText: string; + begin + if AAngle <> 0 then + begin + ARect := ADrawingRect; + Dec(ARect.Right, DepthDeltaSize.cx); + Dec(ARect.Bottom, DepthDeltaSize.cy); + AText := Text; + if ShowAccelChar then + AText := RemoveAccelChars(AText); + cxDrawText(ACanvas.Handle, AText, ADrawingRect, DT_CALCRECT or DT_NOPREFIX); + + Result.X := Round( + (ARect.Left + ARect.Right)/2 - + RectWidth(ADrawingRect) / 2 * Cos(AAngle * PI / 180) - + RectHeight(ADrawingRect) / 2 * Sin(AAngle * PI / 180)); + Result.Y := Round( + (ARect.Top + ARect.Bottom)/2 + + RectWidth(ADrawingRect) / 2 * Sin(AAngle * PI / 180) - + RectHeight(ADrawingRect) / 2 * Cos(AAngle * PI / 180)); + end; + end; + + function GetSignByValue(AValue: Longint): ShortInt; + begin + Result := 0; + if AValue = 0 then + Exit; + if AValue > 0 then + Result := 1 + else + Result := -1; + end; + + var + ALabelStyleOffset: Integer; + begin + Result := Point(0, 0); + CalcRotatedTextPos(ACanvas); + AStep := Size(0, 0); + ALabelStyleOffset := GetLabelStyleOffset; + if (LabelEffect <> cxleNormal) and (FDepth <> 0) then + begin + AStep := DepthDeltaSize; + if Orientation in [cxoRight, cxoRightTop, cxoRightBottom] then + begin + Inc(Result.X, DepthDeltaSize.cx + ALabelStyleOffset); + AStep.cx := -AStep.cx; + end; + if Orientation in [cxoBottom, cxoLeftBottom , cxoRightBottom] then + begin + Inc(Result.Y, DepthDeltaSize.cy + ALabelStyleOffset); + AStep.cy := -AStep.cy; + end; + if LabelEffect in [cxleFun, cxleExtrude] then + begin + AStep.cx := GetSignByValue(AStep.cx); + AStep.cy := GetSignByValue(AStep.cy); + end; + end; + end; + + procedure DrawActualText(ACanvas: TcxCanvas; const ADrawingRect: TRect; + const APosition: TPoint; AIsTextRotated: Boolean); + var + ATextRect: TRect; + AText: string; + begin + ATextRect := ADrawingRect; + if not AIsTextRotated then + begin + Dec(ATextRect.Right, DepthDeltaSize.cx); + Dec(ATextRect.Bottom, DepthDeltaSize.cy); + OffsetRect(ATextRect, APosition.X, APosition.Y); + ACanvas.DrawText(Text, ATextRect, + PrepareTextFlag(0, Alignment.Horz, TcxAlignmentVert(Ord(Alignment.Vert)), + (epoShowEndEllipsis in PaintOptions) and IsInplace, + WordWrap, 0, False, ShowAccelChar)); + end + else + begin + AText := Text; + if ShowAccelChar then + AText := RemoveAccelChars(AText); + ExtTextOut(ACanvas.Handle, APosition.X, APosition.Y, 0, + @ATextRect, PChar(AText), + Length(AText), nil); + end; + end; + + procedure DrawLabelEffect(ACanvas: TcxCanvas; const ADrawingRect: TRect; + var AStartPos: TPoint; const AStep: TSize; AIsTextRotated: Boolean); + var + AIterationCount, I: Integer; + begin + if (LabelEffect = cxleNormal) or (FDepth = 0) then + Exit; + if AStep.cx <> 0 then + AIterationCount := FDepth div Abs(AStep.cx) + else + AIterationCount := FDepth div Abs(AStep.cy); + if LabelEffect <> cxleFun then + ACanvas.Font.Color := ShadowedColor; + for I := 1 to AIterationCount do + begin + if LabelEffect = cxleFun then + ACanvas.Font.Color := + GetColor(BackgroundColor, ShadowedColor, I, AIterationCount); + DrawActualText(ACanvas, ADrawingRect, AStartPos, AIsTextRotated); + Inc(AStartPos.X, AStep.cx); + Inc(AStartPos.Y, AStep.cy); + end; + end; + + procedure DrawConventionalizedText(ACanvas: TcxCanvas; ARect: TRect; + const APosition: TPoint; AGlyph: TBitmap; AIsTrueType: Boolean; + AIsTextRotated: Boolean); + + procedure DrawFilledText(XPosOffset, YPosOffset: Integer; + AGlyphOnly: Boolean = False); + begin + if not AGlyph.Empty and AIsTrueType and (AGlyph.Width > 0) and + (AGlyph.Height > 0) then + begin + BeginPath(ACanvas.Handle); + DrawActualText(ACanvas, ARect, Point(APosition.X + XPosOffset, + APosition.Y + YPosOffset), AIsTextRotated); + EndPath(ACanvas.Handle); + SelectClipPath(ACanvas.Handle, RGN_COPY); + ACanvas.FillRect(ARect, AGlyph); + SelectClipRgn(ACanvas.Handle, 0); + end + else + if not AGlyphOnly then + DrawActualText(ACanvas, ARect, Point(APosition.X + XPosOffset, + APosition.Y + YPosOffset), AIsTextRotated); + end; + + begin + ACanvas.Font.Color := TextColor; + case LabelStyle of + cxlsNormal: + DrawFilledText(0, 0); + cxlsRaised: + begin + ACanvas.Font.Color := clBtnHighlight; + DrawActualText(ACanvas, ARect, APosition, + AIsTextRotated); + if Font.Size >= 12 then + begin + ACanvas.Font.Color := clBtnShadow; + DrawActualText(ACanvas, ARect, Point(APosition.X + 2, APosition.Y + 2), + AIsTextRotated); + end; + ACanvas.Font.Color := TextColor; + DrawFilledText(1, 1); + end; + cxlsLowered: + begin + if Font.Size >= 12 then + begin + ACanvas.Font.Color := clBtnShadow; + DrawActualText(ACanvas, ARect, APosition, + AIsTextRotated); + end; + ACanvas.Font.Color := clBtnHighlight; + DrawActualText(ACanvas, ARect, Point(APosition.X + 2, APosition.Y + 2), + AIsTextRotated); + ACanvas.Font.Color := TextColor; + DrawFilledText(1, 1); + end; + cxlsOutLine: + begin + DrawFilledText(0, 0, AIsTrueType); + if AIsTrueType then + begin + BeginPath(ACanvas.Handle); + DrawActualText(ACanvas, ARect, APosition, AIsTextRotated); + EndPath(ACanvas.Handle); + ACanvas.Pen.Color := TextColor; + ACanvas.Pen.Width := FPenWidth; + StrokePath(ACanvas.Handle); + ACanvas.Pen.Width := 1; + end; + end; + end; + end; + + procedure AdjustTextPosWithLabelStyle(var APosition: TPoint; + const AStep: TSize); + var + ALabelStyleOffset: Integer; + begin + ALabelStyleOffset := GetLabelStyleOffset; + if AStep.cx < 0 then + Dec(APosition.X, ALabelStyleOffset); + if AStep.cy < 0 then + Dec(APosition.Y, ALabelStyleOffset); + end; + + procedure AdjustTextRectWithOffset(var ATextRect: TRect); + begin + if IsInplace then + with DrawTextOffsets do + begin + Inc(ATextRect.Left, Left); + Inc(ATextRect.Top, Top); + Dec(ATextRect.Right, Right); + Dec(ATextRect.Bottom, Bottom); + end + else + if BorderStyle <> ebsNone then + InflateRect(ATextRect, -TextFromBorderOffset, 0); + end; + + procedure InternalDrawLabel(ADrawCanvas: TcxCanvas; + const ABackgroundRect, ATextRect: TRect; const AParentBackgroundOffset: TPoint); + var + AIsTrueType: Boolean; + ARealAngle: Integer; + AStep: TSize; + AStartPos: TPoint; + begin + DrawBackground(ADrawCanvas, ABackgroundRect, AParentBackgroundOffset); + + AIsTrueType := AdjustCanvasFont(ADrawCanvas.Canvas, Font, FAngle); + ARealAngle := Integer(AIsTrueType) * FAngle; + ARealAngle := (ARealAngle mod 360 + 360) mod 360; + AStartPos := GetTextDrawingParameters(ADrawCanvas.Canvas, ATextRect, + ARealAngle, AStep); + ADrawCanvas.Brush.Style := bsClear; + DrawLabelEffect(ADrawCanvas, ATextRect, AStartPos, AStep, ARealAngle <> 0); + AdjustTextPosWithLabelStyle(AStartPos, AStep); + DrawConventionalizedText(ADrawCanvas, ATextRect, AStartPos, FGlyph, + AIsTrueType, ARealAngle <> 0); + ADrawCanvas.Brush.Style := bsSolid; + end; + + function InplaceOffsetChanged: Boolean; + begin + Result := (FInplaceOffset.X <> Left) or (FInplaceOffset.Y <> Top); + if Result then + begin + FInplaceOffset.X := Left; + FInplaceOffset.Y := Top; + end; + end; + +var + ABitmapCanvas: TcxCanvas; + AContentRect, ATextRect: TRect; + APrevLogFont: TLogFont; +begin + SaveCanvasFont(ACanvas, APrevLogFont); + try + AContentRect := LabelTextRect; + ATextRect := LabelTextRect; + AdjustTextRectWithOffset(ATextRect); + if not IsInplace and Transparent and (csPaintCopy in Edit.ControlState) then + InternalDrawLabel(ACanvas, AContentRect, ATextRect, AContentRect.TopLeft) + else + begin + if not IsInplace and NativeStyle then + GetThemeBackgroundContentRect(OpenTheme(totEdit), ACanvas.Handle, + EP_EDITTEXT, NativeState, Bounds, AContentRect); + if InplaceOffsetChanged or FIsDrawBitmapDirty or Transparent then + begin + FDrawBitmap.Width := RectWidth(AContentRect); + FDrawBitmap.Height := RectHeight(AContentRect); + ABitmapCanvas := TcxCanvas.Create(FDrawBitmap.Canvas); + OffsetRect(ATextRect, -AContentRect.Left, -AContentRect.Top); + try + InternalDrawLabel(ABitmapCanvas, Rect(0, 0, FDrawBitmap.Width, FDrawBitmap.Height), + ATextRect, AContentRect.TopLeft); + finally + FreeAndNil(ABitmapCanvas); + end; + FIsDrawBitmapDirty := False; + end; + BitBlt(ACanvas.Handle, AContentRect.Left, AContentRect.Top, + FDrawBitmap.Width, FDrawBitmap.Height, FDrawBitmap.Canvas.Handle, 0, 0, SRCCOPY); + end; + finally + RestoreCanvasFont(ACanvas, APrevLogFont); + end; +end; + +procedure TcxCustomLabelViewInfo.SetBackgroundColor(Value: TColor); +begin + inherited SetBackgroundColor(Value); + FIsDrawBitmapDirty := True; +end; + +{ TcxCustomLabelViewData } + +procedure TcxCustomLabelViewData.CalculateLabelViewInfoProps(AViewInfo: TcxCustomEditViewInfo); +begin + with TcxCustomLabelViewInfo(AViewInfo) do + begin + LabelEffect := Properties.LabelEffect; + LabelStyle := Properties.LabelStyle; + Orientation := Properties.Orientation; + Depth := Properties.Depth; + ShadowedColor := Properties.ShadowedColor; + ShowAccelChar := Properties.ShowAccelChar; + Angle := Properties.Angle; + PenWidth := Properties.PenWidth; + WordWrap := Properties.WordWrap; + Alignment.Assign(Properties.Alignment); + Glyph := Properties.Glyph; + end; +end; + +procedure TcxCustomLabelViewData.Calculate(ACanvas: TcxCanvas; const ABounds: TRect; + const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); +var + ALabelViewInfo: TcxCustomLabelViewInfo; +begin + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, AIsMouseEvent); + if ((ABounds.Bottom >= MaxInt) or (ABounds.Right >= MaxInt)) and IsInplace then + Exit; + ALabelViewInfo := TcxCustomLabelViewInfo(AViewInfo); + {Standart properties} + ALabelViewInfo.IsEditClass := GetIsEditClass; + ALabelViewInfo.DrawSelectionBar := False; + ALabelViewInfo.HasPopupWindow := False; + ALabelViewInfo.DrawTextFlags := GetDrawTextFlags; + if AreVisualStylesMustBeUsed(ALabelViewInfo.NativeStyle, totButton) and + (ALabelViewInfo.BorderStyle = ebsNone) then + ALabelViewInfo.NativeStyle := False; + if not IsInplace then + ALabelViewInfo.Transparent := TcxCustomLabel(Edit).Transparent; + {Label properties} + CalculateLabelViewInfoProps(ALabelViewInfo); + ALabelViewInfo.DepthDeltaSize := Properties.CalculateDepthDelta; + ALabelViewInfo.TextRect := AViewInfo.ClientRect; + ALabelViewInfo.LabelTextRect := AViewInfo.ClientRect; + CalculateCustomLabelViewInfo(ACanvas, Self, ALabelViewInfo); + if not IsInplace then ALabelViewInfo.DrawSelectionBar := False; + + if Edit <> nil then + ALabelViewInfo.LeftTop := Point(Edit.Left, Edit.Top); + + ALabelViewInfo.DrawTextOffsets := GetTextEditDrawTextOffset(Self); + + ALabelViewInfo.FIsDrawBitmapDirty := True; +end; + +procedure TcxCustomLabelViewData.EditValueToDrawValue(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; AViewInfo: TcxCustomEditViewInfo); +begin + TcxCustomLabelViewInfo(AViewInfo).Text := EditValueToDisplayText(AEditValue); +end; + +function TcxCustomLabelViewData.GetEditContentSize(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; const AEditSizeProperties: TcxEditSizeProperties): TSize; + + function CalculateLabelTextSize(ACanvas: TcxCanvas; const AText: string; + const ATextRect: TRect; AAngle: Integer; ADepthSize, + AContentSizeCorrection: TSize; ALabelStyleOffset: Integer; AIsInplace, + AWordWrap, AShowAccelChar: Boolean): TSize; + var + ARealAngle, ATextFlag, ATextWidth: Integer; + ARealText: string; + ARect: TRect; + ARealWordWrap: Boolean; + begin + ARect := Rect(0, 0, RectWidth(ATextRect), RectHeight(ATextRect)); + ARealAngle := (AAngle mod 360 + 360) mod 360; + ARealWordWrap := AWordWrap and (ARealAngle = 0); + if ARect.Right < 0 then + begin + if AIsInplace then + ARealWordWrap := False; + end + else + begin + Dec(ARect.Right, ADepthSize.cx + ALabelStyleOffset); + if (Style.BorderStyle <> ebsNone) and not AIsInplace then + Dec(ARect.Right, TextFromBorderOffset * 2); + if AIsInplace then + Dec(ARect.Right, AContentSizeCorrection.cx); + end; + ATextFlag := PrepareTextFlag(DT_CALCRECT, TAlignment(0), + TcxAlignmentVert(0), False, + ARealWordWrap, 0, True, AShowAccelChar and (ARealAngle = 0)); + ARealText := AText; + if (ARealAngle <> 0) and AShowAccelChar then + ARealText := RemoveAccelChars(AText); + cxDrawText(ACanvas.Handle, ARealText, ARect, ATextFlag); + if ARealAngle <> 0 then + begin + ATextWidth := ARect.Right; + ARect.Right := Trunc(Abs(ARect.Right * Cos(ARealAngle * PI / 180)) + + Abs(ARect.Bottom * Sin(ARealAngle * PI / 180)) + 0.5); + ARect.Bottom := Trunc(Abs(ATextWidth * Sin(ARealAngle * PI / 180)) + + Abs(ARect.Bottom * Cos(ARealAngle * PI / 180)) + 0.5); + end; + Result.cx := ARect.Right; + Result.cy := ARect.Bottom; + Result.cx := Result.cx + ADepthSize.cx + ALabelStyleOffset; + Result.cy := Result.cy + ADepthSize.cy + ALabelStyleOffset; + if (Style.BorderStyle <> ebsNone) and not AIsInplace then + Result.cx := Result.cx + TextFromBorderOffset * 2; + if AIsInplace then + begin + Result.cx := Result.cx + AContentSizeCorrection.cx; + Result.cy := Result.cy + AContentSizeCorrection.cy; + end; + end; + +var + ADisplayText: string; + ALabelStyleOffset: Integer; + APrevLogFont: TLogFont; + ARealAngle: Integer; + ASizeDelta: TSize; +begin + SaveCanvasFont(ACanvas, APrevLogFont); + try + Result := Size(0, 0); + if Edit <> nil then + ADisplayText := TcxCustomLabel(Edit).ViewInfo.Text + else + ADisplayText := EditValueToDisplayText(AEditValue); + if ADisplayText = '' then + ADisplayText := ' '; + Result.cx := AEditSizeProperties.Width; + ARealAngle := Integer(AdjustCanvasFont(ACanvas.Canvas, Style.GetVisibleFont, Properties.Angle)) * + Properties.Angle; + ASizeDelta := Properties.CalculateDepthDelta; + if Properties.LabelStyle in [cxlsRaised, cxlsLowered] then + begin + if ACanvas.Font.Size >= 12 then + ALabelStyleOffset := 2 + else + ALabelStyleOffset := 1; + end + else + ALabelStyleOffset := 0; + + with Properties do + Result := CalculateLabelTextSize(ACanvas, ADisplayText, + Rect(0, 0, Result.cx, Result.cy), ARealAngle, ASizeDelta, + Self.GetEditContentSizeCorrection, ALabelStyleOffset, IsInplace, + WordWrap, Properties.ShowAccelChar); + finally + RestoreCanvasFont(ACanvas, APrevLogFont); + end; +end; + +function TcxCustomLabelViewData.GetDrawTextFlags: Integer; +var + ARealAngle: Integer; +begin + ARealAngle := (Properties.Angle mod 360 + 360) mod 360; + Result := DrawTextFlagsTocxTextOutFlags( + PrepareTextFlag(0, Properties.Alignment.Horz, + TcxAlignmentVert(Ord(Properties.Alignment.Vert)), + epoShowEndEllipsis in PaintOptions, + Properties.WordWrap and (ARealAngle = 0), 0, False)); +end; + +function TcxCustomLabelViewData.GetIsEditClass: Boolean; +begin + Result := False; +end; + +function TcxCustomLabelViewData.InternalEditValueToDisplayText( + AEditValue: TcxEditValue): string; +begin + Result := VarToStr(AEditValue); +end; + +function TcxCustomLabelViewData.GetProperties: TcxCustomLabelProperties; +begin + Result := TcxCustomLabelProperties(FProperties); +end; + +{ TcxCustomLabelProperties } + +constructor TcxCustomLabelProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FLabelEffect := cxleNormal; + FLabelStyle := cxlsNormal; + FOrientation := cxoRightBottom; + FDepth := 0; + FShadowedColor := clGrayText; + FShowAccelChar := True; + FAngle := 0; + FPenWidth := 1; + FWordWrap := False; +end; + +destructor TcxCustomLabelProperties.Destroy; +begin + if FGlyph <> nil then FreeAndNil(FGlyph); + inherited Destroy; +end; + +procedure TcxCustomLabelProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomLabelProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with Source as TcxCustomLabelProperties do + begin + Self.LabelEffect := LabelEffect; + Self.LabelStyle := LabelStyle; + Self.Orientation := Orientation; + Self.Depth := Depth; + Self.ShadowedColor := ShadowedColor; + Self.Angle := Angle; + Self.PenWidth := PenWidth; + Self.Glyph := Glyph; + Self.ShowAccelChar := ShowAccelChar; + Self.WordWrap := WordWrap; + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +function TcxCustomLabelProperties.CanCompareEditValue: Boolean; +begin + Result := True; +end; + +class function TcxCustomLabelProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxLabel; +end; + +class function TcxCustomLabelProperties.GetStyleClass: TcxCustomEditStyleClass; +begin + Result := TcxLabelEditStyle; +end; + +function TcxCustomLabelProperties.GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; +var + ADisplayValue: TcxEditValue; +begin + PrepareDisplayValue(AEditValue, ADisplayValue, False); + Result := ADisplayValue; +end; + +function TcxCustomLabelProperties.GetSupportedOperations: TcxEditSupportedOperations; +begin + Result := [esoAutoHeight, esoFiltering, esoShowingCaption, esoSorting, + esoTransparency]; +end; + +class function TcxCustomLabelProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxCustomLabelViewInfo; +end; + +function TcxCustomLabelProperties.IsEditValueValid(var EditValue: TcxEditValue; AEditFocused: Boolean): Boolean; +begin + Result := inherited IsEditValueValid(EditValue, AEditFocused); +end; + +procedure TcxCustomLabelProperties.PrepareDisplayValue(const AEditValue: + TcxEditValue; var DisplayValue: TcxEditValue; AEditFocused: Boolean); +begin + DisplayValue := VarToStr(AEditValue); +end; + +class function TcxCustomLabelProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxCustomLabelViewData; +end; + +function TcxCustomLabelProperties.HasDisplayValue: Boolean; +begin + Result := True; +end; + +procedure TcxCustomLabelProperties.SetLabelEffect(Value : TcxLabelEffect); +begin + if FLabelEffect <> Value then + begin + FLabelEffect := Value; + Changed; + end; +end; + +procedure TcxCustomLabelProperties.SetLabelStyle(Value : TcxLabelStyle); +begin + if FLabelStyle <> Value then + begin + FLabelStyle := Value; + Changed; + end; +end; + +procedure TcxCustomLabelProperties.SetOrientation(Value : TcxLabelOrientation); +begin + if FOrientation <> Value then + begin + FOrientation := Value; + Changed; + end; +end; + +procedure TcxCustomLabelProperties.SetDepth(Value : Word); +begin + if FDepth <> Value then + begin + FDepth := Value; + Changed; + end; +end; + +procedure TcxCustomLabelProperties.SetShadowedColor(Value : TColor); +begin + if FShadowedColor <> Value then + begin + FShadowedColor := Value; + Changed; + end; +end; + +procedure TcxCustomLabelProperties.SetAngle(Value: Integer); +begin + if FAngle <> Value then + begin + FAngle := Value; + Changed; + end; +end; + +procedure TcxCustomLabelProperties.SetPenWidth(Value: Integer); +begin + if FPenWidth <> Value then + begin + FPenWidth := Value; + Changed; + end; +end; + +function TcxCustomLabelProperties.GetGlyph: TBitmap; +begin + if FGlyph = nil then + begin + FGlyph := TBitmap.Create; + FGlyph.OnChange := GlyphChanged; + end; + Result := FGlyph; +end; + +procedure TcxCustomLabelProperties.GlyphChanged(Sender: TObject); +begin + Changed; +end; + +procedure TcxCustomLabelProperties.SetGlyph(Value: TBitmap); +begin + if Value = nil then + FreeAndNil(FGlyph) + else + Glyph.Assign(Value); + Changed; +end; + +procedure TcxCustomLabelProperties.SetShowAccelChar(Value: Boolean); +begin + if FShowAccelChar <> Value then + begin + FShowAccelChar := Value; + Changed; + end; +end; + +procedure TcxCustomLabelProperties.SetWordWrap(Value: Boolean); +begin + if FWordWrap <> Value then + begin + FWordWrap := Value; + Changed; + end; +end; + +function TcxCustomLabelProperties.CalculateDepthDelta: TSize; +begin + Result.cx := 0; + Result.cy := 0; + if LabelEffect = cxleNormal then Exit; + case FOrientation of + cxoLeft, cxoRight: Result.cx := FDepth; + cxoTop, cxoBottom: Result.cy := FDepth; + cxoLeftTop, cxoLeftBottom, cxoRightTop, cxoRightBottom: + begin + Result.cx := FDepth; + Result.cy := FDepth; + end; + end; +end; + +function TcxCustomLabelProperties.GetDisplayFormatOptions: TcxEditDisplayFormatOptions; +begin + Result := []; +end; + +function TcxCustomLabelProperties.GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; +begin + Result := evsText; +end; + +{ TcxCustomLabel } + +destructor TcxCustomLabel.Destroy; +begin + FFocusControl := nil; + inherited Destroy; +end; + +procedure TcxCustomLabel.Notification(ACOmponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (FFocusControl <> nil) and + (AComponent = FFocusControl) then FFocusControl := nil; +end; + +class function TcxCustomLabel.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomLabelProperties; +end; + +procedure TcxCustomLabel.SetStyle(Value: TcxLabelEditStyle); +begin + FStyles.Style := Value; +end; + +procedure TcxCustomLabel.Initialize; +begin + inherited Initialize; + ControlStyle := ControlStyle - [csCaptureMouse]; + Width := 121; + Height := 21; +end; + +procedure TcxCustomLabel.SetFocusControl(Value: TWinControl); +begin + if (FFocusControl <> Value) and (Value <> Self) then + FFocusControl := Value; +end; + +procedure TcxCustomLabel.InternalSetEditValue(const Value: TcxEditValue; + AValidateEditValue: Boolean); +begin + inherited InternalSetEditValue(Value, AValidateEditValue); + if not FLockCaption then + Caption := VarToStr(Value); + SetInternalDisplayValue(Caption); +end; + +function TcxCustomLabel.IsRightBoundFixed: Boolean; +var + AAlignment: TAlignment; +begin + Result := not (csReading in ComponentState); + if Result then + begin + AAlignment := ActiveProperties.Alignment.Horz; + if UseRightToLeftAlignment then + ChangeBiDiModeAlignment(AAlignment); + Result := (AAlignment = taRightJustify) and not FFirstIsRightBoundFixedCalling; + FFirstIsRightBoundFixedCalling := False; + end; +end; + +procedure TcxCustomLabel.ReadState(Reader: TReader); +begin + FFirstIsRightBoundFixedCalling := True; + inherited ReadState(Reader); +end; + +procedure TcxCustomLabel.SetInternalDisplayValue(Value: TcxEditValue); +begin + ViewInfo.Text := VarToStr(Value); + ShortRefreshContainer(False); +end; + +procedure TcxCustomLabel.TextChanged; +begin + inherited TextChanged; + FLockCaption := True; + try + InternalEditValue := Caption; + finally + FLockCaption := False; + end; +end; + +function TcxCustomLabel.CanFocus: Boolean; +begin + Result := IsInplace; +end; + +{$IFDEF DELPHI10} +function TcxCustomLabel.GetTextBaseLine: Integer; +begin + Result := ViewInfo.GetTextBaseLine; +end; + +function TcxCustomLabel.HasTextBaseLine: Boolean; +begin + Result := ActiveProperties.Angle = 0; +end; +{$ENDIF} + +function TcxCustomLabel.CanAutoWidth: Boolean; +begin + Result := not ActiveProperties.WordWrap; +end; + +function TcxCustomLabel.CanFocusOnClick: Boolean; +begin + Result := inherited CanFocusOnClick and IsInplace; +end; + +function TcxCustomLabel.DefaultParentColor: Boolean; +begin + Result := True; +end; + +procedure TcxCustomLabel.CMDialogChar(var Message: TCMDialogChar); +begin + if (FFocusControl <> nil) and Enabled and Properties.ShowAccelChar and + IsAccel(Message.CharCode, Caption) and FFocusControl.CanFocus then + begin + FFocusControl.SetFocus; + Message.Result := 1; + end; +end; + +function TcxCustomLabel.GetProperties: TcxCustomLabelProperties; +begin + Result := TcxCustomLabelProperties(FProperties); +end; + +function TcxCustomLabel.GetActiveProperties: TcxCustomLabelProperties; +begin + Result := TcxCustomLabelProperties(InternalGetActiveProperties); +end; + +function TcxCustomLabel.GetStyle: TcxLabelEditStyle; +begin + Result := TcxLabelEditStyle(FStyles.Style); +end; + +function TcxCustomLabel.GetViewInfo: TcxCustomLabelViewInfo; +begin + Result := TcxCustomLabelViewInfo(FViewInfo); +end; + +procedure TcxCustomLabel.SetProperties(Value: TcxCustomLabelProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxLabel } + +class function TcxLabel.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxLabelProperties; +end; + +function TcxLabel.GetActiveProperties: TcxLabelProperties; +begin + Result := TcxLabelProperties(InternalGetActiveProperties); +end; + +function TcxLabel.GetProperties: TcxLabelProperties; +begin + Result := TcxLabelProperties(FProperties); +end; + +procedure TcxLabel.SetProperties(Value: TcxLabelProperties); +begin + FProperties.Assign(Value); +end; + +initialization + GetRegisteredEditProperties.Register(TcxLabelProperties, scxSEditRepositoryLabelItem); + FilterEditsController.Register(TcxLabelProperties, TcxFilterTextEditHelper); + +finalization + FilterEditsController.Unregister(TcxLabelProperties, TcxFilterTextEditHelper); + GetRegisteredEditProperties.Unregister(TcxLabelProperties); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxListBox.pas b/official/x.35/ExpressEditors Library 5/Sources/cxListBox.pas new file mode 100644 index 00000000..890dd018 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxListBox.pas @@ -0,0 +1,872 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressCommonLibrary } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCOMMONLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxListBox; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, + Classes, Controls, Forms, Menus, StdCtrls, SysUtils, cxClasses, cxControls, + cxContainer, cxDataUtils, cxGraphics, cxLookAndFeels, cxScrollBar; + +type + TcxListBox = class; + + { TcxInnerListBox } + + TcxInnerListBox = class(TcxCustomInnerListBox) + private + function GetContainer: TcxListBox; + procedure SetContainer(Value: TcxListBox); + procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; + protected + procedure Click; override; + procedure CreateWindowHandle(const Params: TCreateParams); override; + procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); override; + property Container: TcxListBox read GetContainer write SetContainer; + public + function ExecuteAction(Action: TBasicAction): Boolean; override; + function UpdateAction(Action: TBasicAction): Boolean; override; +{$IFDEF DELPHI5} + function CanFocus: Boolean; override; +{$ENDIF} + end; + + TcxInnerListBoxClass = class of TcxInnerListBox; + + { TcxListBox } + + TcxListBoxDrawItemEvent = procedure(AControl: TcxListBox; ACanvas: TcxCanvas; + AIndex: Integer; ARect: TRect; AState: TOwnerDrawState) of object; + TcxListBoxMeasureItemEvent = procedure(AControl: TcxListBox; AIndex: Integer; + var Height: Integer) of object; + + TcxListBox = class(TcxContainer) + private + FInnerListBox: TcxInnerListBox; + FIntegralHeight: Boolean; + FIsExitProcessing: Boolean; + FOnDrawItem: TcxListBoxDrawItemEvent; + FOnMeasureItem: TcxListBoxMeasureItemEvent; + procedure DoMeasureItem(Control: TWinControl; Index: Integer; + var Height: Integer); + function GetAutoComplete: Boolean; + function GetAutoCompleteDelay: Cardinal; + function GetColumns: Integer; + function GetCount: Integer; + function GetExtendedSelect: Boolean; + function GetInnerListBox: TListBox; + function GetItemHeight: Integer; + function GetItemIndex: Integer; + function GetItemObject: TObject; + function GetItems: TStrings; + function GetListStyle: TListBoxStyle; + function GetMultiSelect: Boolean; + function GetReadOnly: Boolean; + function GetSelCount: Integer; + function GetSelected(Index: Integer): Boolean; + function GetSorted: Boolean; + function GetTopIndex: Integer; + procedure SetAutoComplete(Value: Boolean); + procedure SetAutoCompleteDelay(Value: Cardinal); + procedure SetColumns(Value: Integer); + procedure SetExtendedSelect(Value: Boolean); + procedure SetItemHeight(Value: Integer); + procedure SetItemIndex(Value: Integer); + procedure SetItemObject(Value: TObject); + procedure SetItems(Value: TStrings); + procedure SetListStyle(Value: TListBoxStyle); + procedure SetMultiSelect(Value: Boolean); + procedure SetOnMeasureItem(Value: TcxListBoxMeasureItemEvent); + procedure SetReadOnly(Value: Boolean); + procedure SetSelected(Index: Integer; Value: Boolean); + procedure SetSorted(Value: Boolean); + procedure SetTopIndex(Value: Integer); + {$IFDEF DELPHI6} + function GetOnData: TLBGetDataEvent; + function GetOnDataFind: TLBFindDataEvent; + function GetOnDataObject: TLBGetDataObjectEvent; + procedure SetCount(Value: Integer); + procedure SetOnData(Value: TLBGetDataEvent); + procedure SetOnDataFind(Value: TLBFindDataEvent); + procedure SetOnDataObject(Value: TLBGetDataObjectEvent); + {$ENDIF} + function GetScrollWidth: Integer; + function GetTabWidth: Integer; + procedure SetIntegralHeight(Value: Boolean); + procedure SetScrollWidth(Value: Integer); + procedure SetTabWidth(Value: Integer); + protected + FDataBinding: TcxCustomDataBinding; + procedure DataChange; override; + procedure DoExit; override; + procedure FontChanged; override; + function IsInternalControl(AControl: TControl): Boolean; override; + function IsReadOnly: Boolean; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure UpdateData; override; + function CanResize(var NewWidth, NewHeight: Integer): Boolean; override; + procedure SetSize; override; + procedure WndProc(var Message: TMessage); override; + function DrawItem(ACanvas: TcxCanvas; AIndex: Integer; const ARect: TRect; + AState: TOwnerDrawState): Boolean; virtual; + function GetDataBindingClass: TcxCustomDataBindingClass; virtual; + function GetInnerListBoxClass: TcxInnerListBoxClass; virtual; + procedure GetOptimalHeight(var ANewHeight: Integer); + property DataBinding: TcxCustomDataBinding read FDataBinding; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + function UpdateAction(Action: TBasicAction): Boolean; override; + procedure AddItem(AItem: string; AObject: TObject); + procedure Clear; + procedure ClearSelection; + procedure DeleteSelected; + function ItemAtPos(const APos: TPoint; AExisting: Boolean): Integer; + function ItemRect(Index: Integer): TRect; + function ItemVisible(Index: Integer): Boolean; + procedure SelectAll; +{$IFDEF DELPHI6} + procedure CopySelection(ADestination: TCustomListControl); + procedure MoveSelection(ADestination: TCustomListControl); +{$ENDIF} + property Count: Integer read GetCount{$IFDEF DELPHI6} write SetCount{$ENDIF}; + property InnerListBox: TListBox read GetInnerListBox; + property ItemIndex: Integer read GetItemIndex write SetItemIndex; + property ItemObject: TObject read GetItemObject write SetItemObject; + property SelCount: Integer read GetSelCount; + property Selected[Index: Integer]: Boolean read GetSelected write SetSelected; + property TopIndex: Integer read GetTopIndex write SetTopIndex; + published + property Align; + property Anchors; + property AutoComplete: Boolean read GetAutoComplete write SetAutoComplete + default True; + property AutoCompleteDelay: Cardinal read GetAutoCompleteDelay + write SetAutoCompleteDelay default cxDefaultAutoCompleteDelay; + property BiDiMode; + property Columns: Integer read GetColumns write SetColumns default 0; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ExtendedSelect: Boolean read GetExtendedSelect + write SetExtendedSelect default True; + property ImeMode; + property ImeName; + property IntegralHeight: Boolean read FIntegralHeight + write SetIntegralHeight default False; + property ItemHeight: Integer read GetItemHeight write SetItemHeight; + property Items: TStrings read GetItems write SetItems; + property ListStyle: TListBoxStyle read GetListStyle write SetListStyle + default lbStandard; + property MultiSelect: Boolean read GetMultiSelect write SetMultiSelect + default False; + property ParentBiDiMode; + property ParentColor default False; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property ReadOnly: Boolean read GetReadOnly write SetReadOnly default False; + property ScrollWidth: Integer read GetScrollWidth write SetScrollWidth + default 0; + property ShowHint; + property Sorted: Boolean read GetSorted write SetSorted default False; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property TabWidth: Integer read GetTabWidth write SetTabWidth default 0; + property Visible; + property OnClick; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + {$IFDEF DELPHI6} + property OnData: TLBGetDataEvent read GetOnData write SetOnData; + property OnDataFind: TLBFindDataEvent read GetOnDataFind write SetOnDataFind; + property OnDataObject: TLBGetDataObjectEvent read GetOnDataObject + write SetOnDataObject; + {$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnDrawItem: TcxListBoxDrawItemEvent read FOnDrawItem + write FOnDrawItem; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMeasureItem: TcxListBoxMeasureItemEvent read FOnMeasureItem + write SetOnMeasureItem; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Graphics, cxEdit; + +type + TWinControlAccess = class(TWinControl); + +{ TcxInnerListBox } + +function TcxInnerListBox.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action) or + Container.FDataBinding.ExecuteAction(Action); +end; + +function TcxInnerListBox.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action) or + Container.FDataBinding.UpdateAction(Action); +end; + +{$IFDEF DELPHI5} +function TcxInnerListBox.CanFocus: Boolean; +begin + Result := Container.CanFocusEx; +end; +{$ENDIF} + +procedure TcxInnerListBox.Click; +begin + if Container.DataBinding.SetEditMode then + inherited Click; +end; + +procedure TcxInnerListBox.CreateWindowHandle(const Params: TCreateParams); +begin + inherited CreateWindowHandle(Params); + SetExternalScrollBarsParameters; +end; + +procedure TcxInnerListBox.DrawItem(Index: Integer; Rect: TRect; + State: TOwnerDrawState); +begin + if not Container.DrawItem(Canvas, Index, Rect, State) then + inherited DrawItem(Index, Rect, State); +end; + +function TcxInnerListBox.GetContainer: TcxListBox; +begin + Result := TcxListBox(Owner); +end; + +procedure TcxInnerListBox.SetContainer(Value: TcxListBox); +begin + FContainer := Value; +end; + +procedure TcxInnerListBox.WMLButtonDown(var Message: TWMLButtonDown); +begin + if Container.DataBinding.SetEditMode then + inherited + else + begin + SetFocus; + with Message do + MouseDown(mbLeft, KeysToShiftState(Keys), XPos, YPos); + end; +end; + +{ TcxListBox } + +constructor TcxListBox.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FDataBinding := GetDataBindingClass.Create(Self, Self); + with FDataBinding do + begin + OnDataChange := Self.DataChange; + OnDataSetChange := Self.DataSetChange; + OnUpdateData := Self.UpdateData; + end; + FInnerListBox := GetInnerListBoxClass.Create(Self); + FInnerListBox.BorderStyle := bsNone; + FInnerListBox.Parent := Self; + FInnerListBox.Container := Self; + InnerControl := FInnerListBox; + FInnerListBox.LookAndFeel.MasterLookAndFeel := Style.LookAndFeel; + Width := 121; + Height := 97; +end; + +destructor TcxListBox.Destroy; +begin + FreeAndNil(FInnerListBox); + FreeAndNil(FDataBinding); + inherited Destroy; +end; + +function TcxListBox.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action) or + FDataBinding.ExecuteAction(Action); +end; + +function TcxListBox.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action) or + FDataBinding.UpdateAction(Action); +end; + +procedure TcxListBox.AddItem(AItem: string; AObject: TObject); +begin + FInnerListBox.AddItem(AItem, AObject); +end; + +procedure TcxListBox.Clear; +begin + FInnerListBox.Clear; +end; + +procedure TcxListBox.ClearSelection; +begin + FInnerListBox.ClearSelection; +end; + +procedure TcxListBox.DeleteSelected; +begin + FInnerListBox.DeleteSelected; +end; + +function TcxListBox.ItemAtPos(const APos: TPoint; AExisting: Boolean): Integer; +begin + with FInnerListBox do + Result := ItemAtPos(Point(APos.X - Left, APos.Y - Top), AExisting); +end; + +function TcxListBox.ItemRect(Index: Integer): TRect; +begin + Result := FInnerListBox.ItemRect(Index); + OffsetRect(Result, FInnerListBox.Left, FInnerListBox.Top); +end; + +function TcxListBox.ItemVisible(Index: Integer): Boolean; +begin + Result := FInnerListBox.ItemVisible(Index); +end; + +procedure TcxListBox.SelectAll; +begin + FInnerListBox.SelectAll; +end; + +{$IFDEF DELPHI6} +procedure TcxListBox.CopySelection(ADestination: TCustomListControl); +begin + FInnerListBox.CopySelection(ADestination); +end; + +procedure TcxListBox.MoveSelection(ADestination: TCustomListControl); +begin + FInnerListBox.MoveSelection(ADestination); +end; +{$ENDIF} + +procedure TcxListBox.DataChange; +begin + if DataBinding.IsDataSourceLive then + ItemIndex := Items.IndexOf(VarToStr(DataBinding.GetStoredValue(evsText, Focused))) + else + ItemIndex := -1; +end; + +procedure TcxListBox.DoExit; +begin + if IsDestroying or FIsExitProcessing then + Exit; + FIsExitProcessing := True; + try + try + DataBinding.UpdateDataSource; + except + SetFocus; + raise; + end; + inherited DoExit; + finally + FIsExitProcessing := False; + end; +end; + +procedure TcxListBox.FontChanged; +begin + inherited FontChanged; + SetSize; + TWinControlAccess(InnerListBox).RecreateWnd; +end; + +function TcxListBox.IsInternalControl(AControl: TControl): Boolean; +begin + if FInnerListBox = nil then + Result := True + else + Result := (AControl = FInnerListBox.HScrollBar) or (AControl = FInnerListBox.VScrollBar); + Result := Result or inherited IsInternalControl(AControl); +end; + +function TcxListBox.IsReadOnly: Boolean; +begin + Result := DataBinding.IsControlReadOnly; +end; + +procedure TcxListBox.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited KeyDown(Key, Shift); + case Key of + VK_PRIOR, VK_NEXT, VK_END, VK_HOME, VK_LEFT, VK_UP, VK_RIGHT, VK_DOWN: + if not DataBinding.SetEditMode then + Key := 0; + end; +end; + +procedure TcxListBox.KeyPress(var Key: Char); +begin + inherited KeyPress(Key); + if IsTextChar(Key) then + begin + if not DataBinding.SetEditMode then + Key := #0; + end + else + if Key = #27 then + DataBinding.Reset; +end; + +procedure TcxListBox.UpdateData; +begin + if ItemIndex >= 0 then + DataBinding.SetStoredValue(evsText, Items[ItemIndex]) + else + DataBinding.SetStoredValue(evsText, ''); +end; + +function TcxListBox.CanResize(var NewWidth, NewHeight: Integer): Boolean; +begin + Result := inherited CanResize(NewWidth, NewHeight); + if not Result or not IntegralHeight or IsLoading then + Exit; + if Align in [alLeft, alRight, alClient] then + Exit; + GetOptimalHeight(NewHeight); +end; + +procedure TcxListBox.SetSize; +var + ANewHeight: Integer; + APrevBoundsRect: TRect; +begin + if IsLoading then + Exit; + APrevBoundsRect := FInnerListBox.BoundsRect; + try + if not IntegralHeight or (Align in [alLeft, alRight, alClient]) then + begin + inherited SetSize; + Exit; + end; + ANewHeight := Height; + GetOptimalHeight(ANewHeight); + Height := ANewHeight; + inherited SetSize; + finally + if not EqualRect(APrevBoundsRect, FInnerListBox.BoundsRect) and FInnerListBox.HandleAllocated then + KillMessages(FInnerListBox.Handle, WM_MOUSEMOVE, WM_MOUSEMOVE); + end; +end; + +procedure TcxListBox.WndProc(var Message: TMessage); +begin + if FInnerListBox <> nil then + case Message.Msg of + LB_ADDSTRING..LB_MSGMAX: + begin + with TMessage(Message) do + Result := SendMessage(FInnerListBox.Handle, Msg, WParam, LParam); + Exit; + end; + end; + inherited WndProc(Message); + if (FInnerListBox <> nil) and (Message.Msg = WM_COMMAND) and (Message.WParamHi = LBN_SELCHANGE) then + FInnerListBox.SetExternalScrollBarsParameters; +end; + +function TcxListBox.DrawItem(ACanvas: TcxCanvas; AIndex: Integer; + const ARect: TRect; AState: TOwnerDrawState): Boolean; +begin + Result := Assigned(FOnDrawItem); + if Result then + FOnDrawItem(Self, ACanvas, AIndex, ARect, AState); +end; + +function TcxListBox.GetDataBindingClass: TcxCustomDataBindingClass; +begin + Result := TcxDataBinding; +end; + +function TcxListBox.GetInnerListBoxClass: TcxInnerListBoxClass; +begin + Result := TcxInnerListBox; +end; + +procedure TcxListBox.GetOptimalHeight(var ANewHeight: Integer); + + function GetItemHeight(AIndex: Integer): Integer; + begin + case ListStyle of + lbStandard{$IFDEF DELPHI6}, lbVirtual{$ENDIF}: + Result := Canvas.FontHeight(Font); + lbOwnerDrawFixed{$IFDEF DELPHI6}, lbVirtualOwnerDraw{$ENDIF}: + Result := ItemHeight; + lbOwnerDrawVariable: + begin + Result := ItemHeight; + if (AIndex < Count) and Assigned(FInnerListBox.OnMeasureItem) then + FInnerListBox.OnMeasureItem(Self, AIndex, Result); + end; + end; + end; + +var + I: Integer; + ABorderExtent: TRect; + AItemHeight: Integer; + AListClientSize, AListSize, AScrollBarSize: TSize; + AScrollWidth: Integer; + AVScrollBar: Boolean; +begin + ABorderExtent := GetBorderExtent; + AListClientSize.cy := ABorderExtent.Top + ABorderExtent.Bottom; + AScrollBarSize := GetScrollBarSize; + AScrollWidth := ScrollWidth; + if AScrollWidth > 0 then + Inc(AScrollWidth, 4); + I := 0; + repeat + AItemHeight := GetItemHeight(I); + AListClientSize.cy := AListClientSize.cy + AItemHeight; + AListSize.cy := AListClientSize.cy; + AListClientSize.cx := Width - (ABorderExtent.Left + ABorderExtent.Right); + AVScrollBar := I + 1 < Count; + if AVScrollBar then + AListClientSize.cx := AListClientSize.cx - AScrollBarSize.cx; + if AListClientSize.cx < AScrollWidth then + AListSize.cy := AListSize.cy + AScrollBarSize.cy; + if AListSize.cy = ANewHeight then + Break; + if AListSize.cy > ANewHeight then + begin + if I > 0 then + begin + AListClientSize.cy := AListClientSize.cy - AItemHeight; + AListSize.cy := AListClientSize.cy; + AListClientSize.cx := Width - (ABorderExtent.Left + ABorderExtent.Right); + AVScrollBar := I < Count; + if AVScrollBar then + AListClientSize.cx := AListClientSize.cx - AScrollBarSize.cx; + if AListClientSize.cx < AScrollWidth then + AListSize.cy := AListSize.cy + AScrollBarSize.cy; + end; + Break; + end; + Inc(I); + until False; + ANewHeight := AListSize.cy; +end; + +procedure TcxListBox.DoMeasureItem(Control: TWinControl; Index: Integer; + var Height: Integer); +begin + FOnMeasureItem(Self, Index, Height); +end; + +function TcxListBox.GetAutoComplete: Boolean; +begin + Result := FInnerListBox.AutoComplete; +end; + +function TcxListBox.GetAutoCompleteDelay: Cardinal; +begin + Result := FInnerListBox.AutoCompleteDelay; +end; + +function TcxListBox.GetColumns: Integer; +begin + Result := FInnerListBox.Columns; +end; + +function TcxListBox.GetCount: Integer; +begin + Result := FInnerListBox.Items.Count; +end; + +function TcxListBox.GetExtendedSelect: Boolean; +begin + Result := FInnerListBox.ExtendedSelect; +end; + +function TcxListBox.GetInnerListBox: TListBox; +begin + Result := FInnerListBox; +end; + +function TcxListBox.GetItemHeight: Integer; +begin + Result := FInnerListBox.ItemHeight; +end; + +function TcxListBox.GetItemIndex: Integer; +begin + Result := FInnerListBox.ItemIndex; +end; + +function TcxListBox.GetItemObject: TObject; +begin + if ItemIndex <> -1 then + Result := Items.Objects[ItemIndex] + else + Result := nil; +end; + +function TcxListBox.GetItems: TStrings; +begin + Result := FInnerListBox.Items; +end; + +function TcxListBox.GetListStyle: TListBoxStyle; +begin + Result := FInnerListBox.Style; +end; + +function TcxListBox.GetMultiSelect: Boolean; +begin + Result := FInnerListBox.MultiSelect; +end; + +function TcxListBox.GetReadOnly: Boolean; +begin + Result := DataBinding.ReadOnly; +end; + +function TcxListBox.GetSelCount: Integer; +begin + Result := FInnerListBox.SelCount; +end; + +function TcxListBox.GetSelected(Index: Integer): Boolean; +begin + Result := FInnerListBox.Selected[Index]; +end; + +function TcxListBox.GetSorted: Boolean; +begin + Result := FInnerListBox.Sorted; +end; + +function TcxListBox.GetTopIndex: Integer; +begin + Result := FInnerListBox.TopIndex; +end; + +procedure TcxListBox.SetAutoComplete(Value: Boolean); +begin + FInnerListBox.AutoComplete := Value; +end; + +procedure TcxListBox.SetAutoCompleteDelay(Value: Cardinal); +begin + FInnerListBox.AutoCompleteDelay := Value; +end; + +procedure TcxListBox.SetColumns(Value: Integer); +begin + FInnerListBox.Columns := Value; + FInnerListBox.SetExternalScrollBarsParameters; +end; + +procedure TcxListBox.SetExtendedSelect(Value: Boolean); +begin + FInnerListBox.ExtendedSelect := Value; +end; + +procedure TcxListBox.SetItemHeight(Value: Integer); +begin + FInnerListBox.ItemHeight := Value; +end; + +procedure TcxListBox.SetItemIndex(Value: Integer); +begin + FInnerListBox.ItemIndex := Value; +end; + +procedure TcxListBox.SetItemObject(Value: TObject); +begin + ItemIndex := Items.IndexOfObject(Value); +end; + +procedure TcxListBox.SetItems(Value: TStrings); +begin + FInnerListBox.Items := Value; + DataChange; +end; + +procedure TcxListBox.SetListStyle(Value: TListBoxStyle); +begin + FInnerListBox.Style := Value; +end; + +procedure TcxListBox.SetMultiSelect(Value: Boolean); +begin + FInnerListBox.MultiSelect := Value; +end; + +procedure TcxListBox.SetOnMeasureItem(Value: TcxListBoxMeasureItemEvent); +begin + FOnMeasureItem := Value; + if Assigned(FOnMeasureItem) then + FInnerListBox.OnMeasureItem := DoMeasureItem + else + FInnerListBox.OnMeasureItem := nil; +end; + +procedure TcxListBox.SetReadOnly(Value: Boolean); +begin + DataBinding.ReadOnly := Value; +end; + +procedure TcxListBox.SetSelected(Index: Integer; Value: Boolean); +begin + FInnerListBox.Selected[Index] := Value; +end; + +procedure TcxListBox.SetSorted(Value: Boolean); +begin + FInnerListBox.Sorted := Value; +end; + +procedure TcxListBox.SetTopIndex(Value: Integer); +begin + FInnerListBox.TopIndex := Value; +end; + + {$IFDEF DELPHI6} +function TcxListBox.GetOnData: TLBGetDataEvent; +begin + Result := FInnerListBox.OnData; +end; + +function TcxListBox.GetOnDataFind: TLBFindDataEvent; +begin + Result := FInnerListBox.OnDataFind; +end; + +function TcxListBox.GetOnDataObject: TLBGetDataObjectEvent; +begin + Result := FInnerListBox.OnDataObject; +end; + +procedure TcxListBox.SetCount(Value: Integer); +begin + FInnerListBox.Count := Value; +end; + +procedure TcxListBox.SetOnData(Value: TLBGetDataEvent); +begin + FInnerListBox.OnData := Value; +end; + +procedure TcxListBox.SetOnDataFind(Value: TLBFindDataEvent); +begin + FInnerListBox.OnDataFind := Value; +end; + +procedure TcxListBox.SetOnDataObject(Value: TLBGetDataObjectEvent); +begin + FInnerListBox.OnDataObject := Value; +end; + {$ENDIF} + +function TcxListBox.GetScrollWidth: Integer; +begin + Result := FInnerListBox.ScrollWidth; +end; + +function TcxListBox.GetTabWidth: Integer; +begin + Result := FInnerListBox.TabWidth; +end; + +procedure TcxListBox.SetIntegralHeight(Value: Boolean); +begin + if Value <> FIntegralHeight then + begin + FIntegralHeight := Value; + SetSize; + end; +end; + +procedure TcxListBox.SetScrollWidth(Value: Integer); +begin + FInnerListBox.ScrollWidth := Value; +end; + +procedure TcxListBox.SetTabWidth(Value: Integer); +begin + FInnerListBox.TabWidth := Value; +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxListView.pas b/official/x.35/ExpressEditors Library 5/Sources/cxListView.pas new file mode 100644 index 00000000..ab3333da --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxListView.pas @@ -0,0 +1,2132 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressCommonLibrary } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCOMMONLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +{$DEFINE USETCXSCROLLBAR} + +unit cxListView; + +{$I cxVer.inc} + +interface + +uses + Windows, Forms, Classes, ComCtrls, CommCtrl, Controls, ImgList, Menus, + Messages, StdCtrls, SysUtils, cxClasses, cxContainer, cxControls, + cxExtEditConsts, cxGraphics, cxLookAndFeels, cxScrollBar, cxHeader; + +type + TcxCustomListView = class; + + { TcxIconOptions } + + TcxIconOptions = class(TPersistent) + private + FArrangement: TIconArrangement; + FAutoArrange: Boolean; + FWrapText: Boolean; + FArrangementChange: TNotifyEvent; + FAutoArrangeChange: TNotifyEvent; + FWrapTextChange: TNotifyEvent; + procedure SetArrangement(Value: TIconArrangement); + procedure SetAutoArrange(Value: Boolean); + procedure SetWrapText(Value: Boolean); + public + constructor Create(AOwner: TPersistent); + published + property Arrangement: TIconArrangement read FArrangement write SetArrangement default iaTop; + property AutoArrange: Boolean read FAutoArrange write SetAutoArrange default False; + property WrapText: Boolean read FWrapText write SetWrapText default True; + end; + + { TcxCustomInnerListView } + + TcxCustomInnerListView = class(TListView, IUnknown, + IcxContainerInnerControl) + private + FCanvas: TcxCanvas; + FDefHeaderProc: Pointer; + FHeaderHandle: HWND; + FHeaderInstance: Pointer; + FOldHint: string; + FOldItem: TListItem; + FPressedHeaderItemIndex: Integer; + + function GetHeaderHotItemIndex: Integer; + function GetHeaderItemRect(AItemIndex: Integer): TRect; + function GetHeaderPressedItemIndex: Integer; + function HeaderItemIndex(AHeaderItem: Integer): Integer; + procedure HeaderWndProc(var Message: TMessage); + + procedure HScrollHandler(Sender: TObject; ScrollCode: TScrollCode; + var ScrollPos: Integer); + procedure VScrollHandler(Sender: TObject; ScrollCode: TScrollCode; + var ScrollPos: Integer); + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + procedure WMKillFocus(var Message: TWMKillFocus); message WM_KILLFOCUS; + procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure WMNotify(var Message: TWMNotify); message WM_NOTIFY; + procedure WMSetFocus(var Message: TWMSetFocus); message WM_SETFOCUS; + procedure WMWindowPosChanged(var Message: TWMWindowPosChanged); message WM_WINDOWPOSCHANGED; + procedure CMHintShow(var Message: TCMHintShow); message CM_HINTSHOW; + procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure CNNotify(var Message: TWMNotify); message CN_NOTIFY; + procedure LVMGetHeaderItemInfo(var Message: TCMHeaderItemInfo); message CM_GETHEADERITEMINFO; + + function GetContainer: TcxCustomListView; + function GetControl: TWinControl; + function GetControlContainer: TcxContainer; + protected + FContainer: TcxCustomListView; + procedure Click; override; + procedure DblClick; override; + procedure Loaded; override; + function CanEdit(Item: TListItem): Boolean; override; + function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; override; + procedure DoStartDock(var DragObject: TDragObject); override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + procedure WndProc(var Message: TMessage); override; + procedure DoCancelEdit; virtual; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); virtual; + procedure MouseEnter(AControl: TControl); dynamic; + procedure MouseLeave(AControl: TControl); dynamic; + + procedure DrawHeader; virtual; + + property Container: TcxCustomListView read GetContainer; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure DefaultHandler(var Message); override; + procedure DragDrop(Source: TObject; X, Y: Integer); override; + property Canvas: TcxCanvas read FCanvas; + function CanFocus: Boolean; override; + {$IFDEF DELPHI6} + procedure DeleteSelected; override; + {$ENDIF} + end; + + TcxCustomInnerListViewClass = class of TcxCustomInnerListView; + + { TcxCustomListView } + + TcxCustomListView = class(TcxContainer) + private + FInnerListView: TcxCustomInnerListView; + FIconOptions: TcxIconOptions; + FOnCancelEdit: TNotifyEvent; + FOwnerDraw: Boolean; + function GetReadOnly: Boolean; + function GetListItems: TListItems; + function GetListColumns: TListColumns; + function GetListViewCanvas: TcxCanvas; + function GetColumnClick: Boolean; + function GetHideSelection: Boolean; + function GetIconOptions: TcxIconOptions; + function GetAllocBy: Integer; + function GetHoverTime: Integer; + function GetLargeImages: TCustomImageList; + function GetMultiSelect: Boolean; + function GetOwnerData: Boolean; + function GetOwnerDraw: Boolean; + function GetOnAdvancedCustomDraw: TLVAdvancedCustomDrawEvent; + function GetOnAdvancedCustomDrawItem: TLVAdvancedCustomDrawItemEvent; + function GetOnAdvancedCustomDrawSubItem: TLVAdvancedCustomDrawSubItemEvent; + function GetOnChange: TLVChangeEvent; + function GetOnChanging: TLVChangingEvent; + function GetOnColumnClick: TLVColumnClickEvent; + function GetOnColumnDragged: TNotifyEvent; + function GetOnColumnRightClick: TLVColumnRClickEvent; + function GetOnCompare: TLVCompareEvent; + function GetOnCustomDraw: TLVCustomDrawEvent; + function GetOnCustomDrawItem: TLVCustomDrawItemEvent; + function GetOnCustomDrawSubItem: TLVCustomDrawSubItemEvent; + function GetOnData: TLVOwnerDataEvent; + function GetOnDataFind: TLVOwnerDataFindEvent; + function GetOnDataHint: TLVOwnerDataHintEvent; + function GetOnDataStateChange: TLVOwnerDataStateChangeEvent; + function GetOnDeletion: TLVDeletedEvent; + function GetOnDrawItem: TLVDrawItemEvent; + function GetOnEdited: TLVEditedEvent; + function GetOnEditing: TLVEditingEvent; + function GetOnInfoTip: TLVInfoTipEvent; + function GetOnInsert: TLVDeletedEvent; + function GetOnGetImageIndex: TLVNotifyEvent; + function GetOnGetSubItemImage: TLVSubItemImageEvent; + function GetShowWorkAreas: Boolean; + function GetOnSelectItem: TLVSelectItemEvent; + function GetShowColumnHeaders: Boolean; + function GetSmallImages: TCustomImageList; + function GetSortType: TSortType; + function GetStateImages: TCustomImageList; + function GetViewStyle: TViewStyle; + {$IFDEF DELPHI6} + function GetOnCreateItemClass: TLVCreateItemClassEvent; + {$ENDIF} + procedure SetReadOnly(Value: Boolean); + procedure SetListItems(Value: TListItems); + procedure SetListColumns(Value: TListColumns); + procedure SetColumnClick(Value: Boolean); + procedure SetHideSelection(Value: Boolean); + procedure SetIconOptions(Value: TcxIconOptions); + procedure SetAllocBy(Value: Integer); + procedure SetHoverTime(Value: Integer); + procedure SetLargeImages(Value: TCustomImageList); + procedure SetMultiSelect(Value: Boolean); + procedure SetOwnerData(Value: Boolean); + procedure SetOwnerDraw(Value: Boolean); + procedure SetOnAdvancedCustomDraw(Value: TLVAdvancedCustomDrawEvent); + procedure SetOnAdvancedCustomDrawItem(Value: TLVAdvancedCustomDrawItemEvent); + procedure SetOnAdvancedCustomDrawSubItem(Value: TLVAdvancedCustomDrawSubItemEvent); + procedure SetOnChange(Value: TLVChangeEvent); + procedure SetOnChanging(Value: TLVChangingEvent); + procedure SetOnColumnClick(Value: TLVColumnClickEvent); + procedure SetOnColumnDragged(Value: TNotifyEvent); + procedure SetOnColumnRightClick(Value: TLVColumnRClickEvent); + procedure SetOnCompare(Value: TLVCompareEvent); + procedure SetOnCustomDraw(Value: TLVCustomDrawEvent); + procedure SetOnCustomDrawItem(Value: TLVCustomDrawItemEvent); + procedure SetOnCustomDrawSubItem(Value: TLVCustomDrawSubItemEvent); + procedure SetOnData(Value: TLVOwnerDataEvent); + procedure SetOnDataFind(Value: TLVOwnerDataFindEvent); + procedure SetOnDataHint(Value: TLVOwnerDataHintEvent); + procedure SetOnDataStateChange(Value: TLVOwnerDataStateChangeEvent); + procedure SetOnDeletion(Value: TLVDeletedEvent); + procedure SetOnDrawItem(Value: TLVDrawItemEvent); + procedure SetOnEdited(Value: TLVEditedEvent); + procedure SetOnEditing(Value: TLVEditingEvent); + procedure SetOnInfoTip(Value: TLVInfoTipEvent); + procedure SetOnInsert(Value: TLVDeletedEvent); + procedure SetOnGetImageIndex(Value: TLVNotifyEvent); + procedure SetOnGetSubItemImage(Value: TLVSubItemImageEvent); + procedure SetShowWorkAreas(Value: Boolean); + procedure SetOnSelectItem(Value: TLVSelectItemEvent); + procedure SetShowColumnHeaders(Value: Boolean); + procedure SetSmallImages(Value: TCustomImageList); + procedure SetSortType(Value: TSortType); + procedure SetStateImages(Value: TCustomImageList); + {$IFDEF DELPHI6} + procedure SetOnCreateItemClass(Value: TLVCreateItemClassEvent); + {$ENDIF} + function GetCheckBoxes: Boolean; + function GetColumnFromIndex(Index: Integer): TListColumn; + function GetDropTarget: TListItem; + function GetFullDrag: Boolean; + function GetGridLines: Boolean; + function GetHotTrack: Boolean; + function GetHotTrackStyles: TListHotTrackStyles; + function GetItemFocused: TListItem; + function GetRowSelect: Boolean; + function GetSelCount: Integer; + function GetSelected: TListItem; + function GetTopItem: TListItem; + function GetViewOrigin: TPoint; + function GetVisibleRowCount: Integer; + function GetBoundingRect: TRect; + function GetWorkAreas: TWorkAreas; + procedure SetCheckboxes(Value: Boolean); + procedure SetDropTarget(Value: TListItem); + procedure SetFullDrag(Value: Boolean); + procedure SetGridLines(Value: Boolean); + procedure SetHotTrack(Value: Boolean); + procedure SetHotTrackStyles(Value: TListHotTrackStyles); + procedure SetItemFocused(Value: TListItem); + procedure SetRowSelect(Value: Boolean); + procedure SetSelected(Value: TListItem); + procedure ArrangementChangeHandler(Sender: TObject); + procedure AutoArrangeChangeHandler(Sender: TObject); + procedure WrapTextChangeHandler(Sender: TObject); + procedure UpdateIconOptions; + protected + procedure DoExit; override; + procedure FontChanged; override; + function IsReadOnly: Boolean; override; + procedure Loaded; override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); override; + function NeedsScrollBars: Boolean; override; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); override; + procedure WriteState(Writer: TWriter); override; + + class function GetListViewClass: TcxCustomInnerListViewClass; virtual; + + function CanChange(Item: TListItem; Change: Integer): Boolean; + function CanEdit(Item: TListItem): Boolean; + procedure ChangeScale(M, D: Integer); override; + function ColumnsShowing: Boolean; + function GetCount: Integer; + {$IFDEF DELPHI6} + function GetItemIndex: Integer; overload; + function GetListViewItemIndex: Integer; + procedure SetItemIndex(Value: Integer); + {$ENDIF} + function GetItemIndex(Value: TListItem): Integer; overload; + procedure SetViewStyle(Value: TViewStyle); virtual; + procedure UpdateColumn(AnIndex: Integer); + procedure UpdateColumns; + + property Columns: TListColumns read GetListColumns write SetListColumns; + property ColumnClick: Boolean read GetColumnClick write SetColumnClick default True; + property HideSelection: Boolean read GetHideSelection write SetHideSelection default True; + property IconOptions: TcxIconOptions read GetIconOptions write SetIconOptions; + property Items: TListItems read GetListItems write SetListItems; + property AllocBy: Integer read GetAllocBy write SetAllocBy default 0; + property HoverTime: Integer read GetHoverTime write SetHoverTime default -1; + property ListViewCanvas: TcxCanvas read GetListViewCanvas; + property LargeImages: TCustomImageList read GetLargeImages write SetLargeImages; + property MultiSelect: Boolean read GetMultiSelect write SetMultiSelect default False; + property ReadOnly: Boolean read GetReadOnly write SetReadOnly default False; + property OwnerData: Boolean read GetOwnerData write SetOwnerData default False; + property OwnerDraw: Boolean read GetOwnerDraw write SetOwnerDraw default False; + property RowSelect: Boolean read GetRowSelect write SetRowSelect default False; + property ShowColumnHeaders: Boolean read GetShowColumnHeaders + write SetShowColumnHeaders default True; + property ShowWorkAreas: Boolean read GetShowWorkAreas write SetShowWorkAreas default False; + property SmallImages: TCustomImageList read GetSmallImages write SetSmallImages; + property SortType: TSortType read GetSortType write SetSortType default stNone; + property StateImages: TCustomImageList read GetStateImages write SetStateImages; + property ViewStyle: TViewStyle read GetViewStyle write SetViewStyle default vsIcon; + property OnAdvancedCustomDraw: TLVAdvancedCustomDrawEvent read GetOnAdvancedCustomDraw + write SetOnAdvancedCustomDraw; + property OnAdvancedCustomDrawItem: TLVAdvancedCustomDrawItemEvent + read GetOnAdvancedCustomDrawItem write SetOnAdvancedCustomDrawItem; + property OnAdvancedCustomDrawSubItem: TLVAdvancedCustomDrawSubItemEvent + read GetOnAdvancedCustomDrawSubItem write SetOnAdvancedCustomDrawSubItem; + property OnCancelEdit: TNotifyEvent read FOnCancelEdit write FOnCancelEdit; + property OnChange: TLVChangeEvent read GetOnChange write SetOnChange; + property OnChanging: TLVChangingEvent read GetOnChanging write SetOnChanging; + property OnColumnClick: TLVColumnClickEvent read GetOnColumnClick write SetOnColumnClick; + property OnColumnDragged: TNotifyEvent read GetOnColumnDragged write SetOnColumnDragged; + property OnColumnRightClick: TLVColumnRClickEvent read GetOnColumnRightClick + write SetOnColumnRightClick; + property OnCompare: TLVCompareEvent read GetOnCompare write SetOnCompare; + property OnCustomDraw: TLVCustomDrawEvent read GetOnCustomDraw write SetOnCustomDraw; + property OnCustomDrawItem: TLVCustomDrawItemEvent read GetOnCustomDrawItem + write SetOnCustomDrawItem; + property OnCustomDrawSubItem: TLVCustomDrawSubItemEvent read GetOnCustomDrawSubItem + write SetOnCustomDrawSubItem; + property OnData: TLVOwnerDataEvent read GetOnData write SetOnData; + property OnDataFind: TLVOwnerDataFindEvent read GetOnDataFind write SetOnDataFind; + property OnDataHint: TLVOwnerDataHintEvent read GetOnDataHint write SetOnDataHint; + property OnDataStateChange: TLVOwnerDataStateChangeEvent read GetOnDataStateChange + write SetOnDataStateChange; + property OnDeletion: TLVDeletedEvent read GetOnDeletion write SetOnDeletion; + property OnDrawItem: TLVDrawItemEvent read GetOnDrawItem write SetOnDrawItem; + property OnEdited: TLVEditedEvent read GetOnEdited write SetOnEdited; + property OnEditing: TLVEditingEvent read GetOnEditing write SetOnEditing; + property OnInfoTip: TLVInfoTipEvent read GetOnInfoTip write SetOnInfoTip; + property OnInsert: TLVDeletedEvent read GetOnInsert write SetOnInsert; + property OnGetImageIndex: TLVNotifyEvent read GetOnGetImageIndex write SetOnGetImageIndex; + property OnGetSubItemImage: TLVSubItemImageEvent read GetOnGetSubItemImage + write SetOnGetSubItemImage; + property OnSelectItem: TLVSelectItemEvent read GetOnSelectItem write SetOnSelectItem; + {$IFDEF DELPHI6} + property OnCreateItemClass: TLVCreateItemClassEvent read GetOnCreateItemClass + write SetOnCreateItemClass; + {$ENDIF} + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property InnerListView: TcxCustomInnerListView read FInnerListView; + function AlphaSort: Boolean; + procedure Arrange(Code: TListArrangement); + procedure Clear; + {$IFDEF DELPHI6} + procedure ClearSelection; + procedure AddItem(Item: string; AObject: TObject); + procedure CopySelection(Destination: TCustomListControl); + procedure DeleteSelected; + procedure SelectAll; + {$ENDIF} + function FindCaption(StartIndex: Integer; Value: string; + Partial, Inclusive, Wrap: Boolean): TListItem; + function FindData(StartIndex: Integer; Value: Pointer; + Inclusive, Wrap: Boolean): TListItem; + function GetHitTestInfoAt(X, Y: Integer): THitTests; + function GetItemAt(X, Y: Integer): TListItem; + function GetNearestItem(Point: TPoint; + Direction: TSearchDirection): TListItem; + function GetNextItem(StartItem: TListItem; + Direction: TSearchDirection; States: TItemStates): TListItem; + function GetSearchString: string; + function IsEditing: Boolean; + function CustomSort(SortProc: TLVCompare; lParam: Longint): Boolean; + function StringWidth(S: string): Integer; + procedure UpdateItems(FirstIndex, LastIndex: Integer); + + property Checkboxes: Boolean read GetCheckBoxes write SetCheckboxes default False; + property Column[Index: Integer]: TListColumn read GetColumnFromIndex; + property DropTarget: TListItem read GetDropTarget write SetDropTarget; + property FullDrag: Boolean read GetFullDrag write SetFullDrag default False; + property GridLines: Boolean read GetGridLines write SetGridLines default False; + property HotTrack: Boolean read GetHotTrack write SetHotTrack default False; + property HotTrackStyles: TListHotTrackStyles read GetHotTrackStyles write SetHotTrackStyles default []; + property ItemFocused: TListItem read GetItemFocused write SetItemFocused; + {$IFDEF DELPHI6} + property ItemIndex: Integer read GetListViewItemIndex write SetItemIndex + default -1; + {$ENDIF} + property SelCount: Integer read GetSelCount; + property Selected: TListItem read GetSelected write SetSelected; + property TopItem: TListItem read GetTopItem; + property ViewOrigin: TPoint read GetViewOrigin; + property VisibleRowCount: Integer read GetVisibleRowCount; + property BoundingRect: TRect read GetBoundingRect; + property WorkAreas: TWorkAreas read GetWorkAreas; + end; + + { TcxListView } + + TcxListView = class(TcxCustomListView) + public + property ListViewCanvas; + published + property Align; + property AllocBy default 0; + property Anchors; + property BiDiMode; + property Checkboxes; + property ColumnClick default True; + property Columns; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property HideSelection default True; + property HotTrack default False; + property HoverTime default -1; + property IconOptions; + {$IFDEF DELPHI6} + property ItemIndex; + {$ENDIF} + property Items; + property LargeImages; + property MultiSelect default False; + property OwnerData default False; + property OwnerDraw default False; + property ParentBiDiMode; + property ParentColor default False; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property ReadOnly default False; + property RowSelect default False; + property ShowColumnHeaders default True; + property ShowHint; + property ShowWorkAreas default False; + property SmallImages; + property SortType default stNone; + property StateImages; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property ViewStyle default vsIcon; + property Visible; + property OnAdvancedCustomDraw; + property OnAdvancedCustomDrawItem; + property OnAdvancedCustomDrawSubItem; + property OnCancelEdit; + property OnChange; + property OnChanging; + property OnClick; + property OnColumnClick; + property OnColumnDragged; + property OnColumnRightClick; + property OnCompare; + property OnContextPopup; + {$IFDEF DELPHI6} + property OnCreateItemClass; + {$ENDIF} + property OnCustomDraw; + property OnCustomDrawItem; + property OnCustomDrawSubItem; + property OnData; + property OnDataFind; + property OnDataHint; + property OnDataStateChange; + property OnDblClick; + property OnDeletion; + property OnDragDrop; + property OnDragOver; + property OnDrawItem; + property OnEdited; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnGetImageIndex; + property OnGetSubItemImage; + property OnInfoTip; + property OnInsert; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnSelectItem; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Graphics, Math, cxLookAndFeelPainters; + +{ TcxIconOptions } + +constructor TcxIconOptions.Create(AOwner: TPersistent); +begin + inherited Create; + Arrangement := iaTop; + AutoArrange := False; + WrapText := True; +end; + +procedure TcxIconOptions.SetArrangement(Value: TIconArrangement); +begin + if Value <> Arrangement then + begin; + FArrangement := Value; + if Assigned(FArrangementChange) then FArrangementChange(Self); + end; +end; + +procedure TcxIconOptions.SetAutoArrange(Value: Boolean); +begin + if Value <> AutoArrange then + begin + FAutoArrange := Value; + if Assigned(FAutoArrangeChange) then FAutoArrangeChange(Self); + end; +end; + +procedure TcxIconOptions.SetWrapText(Value: Boolean); +begin + if Value <> WrapText then + begin + FWrapText := Value; + if Assigned(FWrapTextChange) then FWrapTextChange(Self); + end; +end; + +{ TcxCustomInnerListView } + +constructor TcxCustomInnerListView.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FCanvas := TcxCanvas.Create(inherited Canvas); + BorderStyle := bsNone; + ControlStyle := ControlStyle + [csDoubleClicks]; + IconOptions.Arrangement := iaTop; + IconOptions.AutoArrange := False; + IconOptions.WrapText := True; + ParentColor := False; + ParentFont := True; + ShowColumnHeaders := True; + FPressedHeaderItemIndex := -1; +end; + +destructor TcxCustomInnerListView.Destroy; +begin + FreeAndNil(FCanvas); + if FHeaderHandle <> 0 then + begin + SetWindowLong(FHeaderHandle, GWL_WNDPROC, Integer(FDefHeaderProc)); + FHeaderHandle := 0; + end; + FreeObjectInstance(FHeaderInstance); + inherited Destroy; +end; + +procedure TcxCustomInnerListView.DefaultHandler(var Message); +begin + if (Container = nil) or + not Container.InnerControlDefaultHandler(TMessage(Message)) then + inherited DefaultHandler(Message); +end; + +procedure TcxCustomInnerListView.Loaded; +begin + inherited; + Container.UpdateIconOptions; + FoldHint := Hint; +end; + +procedure TcxCustomInnerListView.DragDrop(Source: TObject; X, Y: Integer); +begin + if Container <> nil then + Container.DragDrop(Source, Left + X, Top + Y); +end; + +procedure TcxCustomInnerListView.Click; +begin + inherited Click; + if Container <> nil then + _TcxContainerAccess.Click(Container); +end; + +procedure TcxCustomInnerListView.DblClick; +begin + inherited DblClick; + if Container <> nil then + _TcxContainerAccess.DblClick(Container); +end; + +function TcxCustomInnerListView.CanEdit(Item: TListItem): Boolean; +begin + if Container <> nil then + begin + Result := (not Container.ReadOnly) {and (not OwnerData)}; {<- Prevent bug, when Caption not saved after CreateWnd in "OwnerData" mode} + if Result then + Result := inherited CanEdit(Item); + end + else + Result := inherited CanEdit(Item); +end; + +function TcxCustomInnerListView.DoMouseWheel(Shift: TShiftState; + WheelDelta: Integer; MousePos: TPoint): Boolean; +begin + Result := (Container <> nil) and + _TcxContainerAccess.DoMouseWheel(Container, Shift, WheelDelta, MousePos); + if not Result then + inherited DoMouseWheel(Shift, WheelDelta, MousePos); +end; + +procedure TcxCustomInnerListView.DoStartDock(var DragObject: TDragObject); +begin + _TcxContainerAccess.BeginAutoDrag(Container); +end; + +procedure TcxCustomInnerListView.DragOver(Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); +begin + if Container <> nil then + _TcxContainerAccess.DragOver(Container, Source, Left + X, Top + Y, State, Accept); +end; + +procedure TcxCustomInnerListView.DoCancelEdit; +begin + if IsEditing and Assigned(Container) and not Container.IsDestroying and + Assigned(Container.OnCancelEdit) then + Container.OnCancelEdit(Container); +end; + +procedure TcxCustomInnerListView.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + if FHeaderHandle <> 0 then + InvalidateRect(FHeaderHandle, nil, False); +end; + +procedure TcxCustomInnerListView.MouseEnter(AControl: TControl); +begin +end; + +procedure TcxCustomInnerListView.MouseLeave(AControl: TControl); +begin + if Container <> nil then + Container.ShortRefreshContainer(True); +end; + +procedure TcxCustomInnerListView.DrawHeader; +var + I: Integer; +begin + Canvas.Brush.Color := clBtnFace; + Canvas.Font := Font; + Canvas.Font.Color := clBtnText; + for I := 0 to Columns.Count do + DrawHeaderSection(FHeaderHandle, I, Canvas, Container.LookAndFeel, SmallImages); +end; + +procedure TcxCustomInnerListView.KeyDown(var Key: Word; Shift: TShiftState); +begin + if Container <> nil then + _TcxContainerAccess.KeyDown(Container, Key, Shift); + if Key <> 0 then + inherited KeyDown(Key, Shift); +end; + +procedure TcxCustomInnerListView.KeyPress(var Key: Char); +begin + if Key = Char(VK_TAB) then + Key := #0; + if Container <> nil then + _TcxContainerAccess.KeyPress(Container, Key); + if Word(Key) = VK_RETURN then + Key := #0; + if Key <> #0 then + inherited KeyPress(Key); +end; + +procedure TcxCustomInnerListView.KeyUp(var Key: Word; Shift: TShiftState); +begin + if Key = VK_TAB then + Key := 0; + if Container <> nil then + _TcxContainerAccess.KeyUp(Container, Key, Shift); + if Key <> 0 then + inherited KeyUp(Key, Shift); +end; + +procedure TcxCustomInnerListView.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + if Container <> nil then + with Container do + begin + InnerControlMouseDown := True; + try + MouseDown(Button, Shift, X + Self.Left, Y + Self.Top); + finally + InnerControlMouseDown := False; + end; + end; +end; + +procedure TcxCustomInnerListView.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + if (GetItemAt(X, Y) = nil) then + Hint := FOldHint; + if Container <> nil then + _TcxContainerAccess.MouseMove(Container, Shift, X + Left, Y + Top); +end; + +procedure TcxCustomInnerListView.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + if Container <> nil then + _TcxContainerAccess.MouseUp(Container, Button, Shift, X + Left, Y + Top); +end; + +procedure TcxCustomInnerListView.CreateParams(var Params: TCreateParams); +begin + inherited; + if Container.IconOptions.AutoArrange then + Params.Style := Params.Style or LVS_AUTOARRANGE + else + Params.Style := Params.Style and not LVS_AUTOARRANGE; + if not Container.ShowColumnHeaders then + Params.Style := Params.Style or LVS_NOCOLUMNHEADER; +end; + +procedure TcxCustomInnerListView.CreateWnd; +begin + inherited CreateWnd; + Container.SetScrollBarsParameters; + Container.AdjustInnerControl; +end; + +procedure TcxCustomInnerListView.WndProc(var Message: TMessage); +var + AHeaderStyle: Integer; + S: string; +begin + if (Container <> nil) and Container.InnerControlMenuHandler(Message) then + Exit; + inherited WndProc(Message); + case Message.Msg of + WM_PAINT: + Container.UpdateScrollBarsParameters; + WM_PARENTNOTIFY: + if Message.WParamLo = WM_CREATE then + begin + SetLength(S, 80); + SetLength(S, GetClassName(Message.LParam, PChar(S), Length(S))); + if S = 'SysHeader32' then + begin + FHeaderHandle := Message.LParam; + FHeaderInstance := MakeObjectInstance(HeaderWndProc); + FDefHeaderProc := Pointer(SetWindowLong(FHeaderHandle, GWL_WNDPROC, Integer(FHeaderInstance))); + AHeaderStyle := GetWindowLong(FHeaderHandle, GWL_STYLE); + SetWindowLong(FHeaderHandle, GWL_STYLE, AHeaderStyle or HDS_HOTTRACK); + end; + end; + end; +end; + +function TcxCustomInnerListView.CanFocus: Boolean; +begin + Result := Container.CanFocus; +end; + +{$IFDEF DELPHI6} +procedure TcxCustomInnerListView.DeleteSelected; +begin + if Assigned(Container) and (not Container.ReadOnly) then + inherited DeleteSelected; +end; +{$ENDIF} + +function TcxCustomInnerListView.GetHeaderHotItemIndex: Integer; +var + AHitTestInfo: THDHitTestInfo; +begin + if WindowFromPoint(InternalGetCursorPos) <> FHeaderHandle then + begin + Result := -1; + Exit; + end; + + AHitTestInfo.Point := InternalGetCursorPos; + Windows.ScreenToClient(FHeaderHandle, AHitTestInfo.Point); + SendGetStructMessage(FHeaderHandle, HDM_HITTEST, 0, AHitTestInfo); + Result := AHitTestInfo.Item; +end; + +function TcxCustomInnerListView.GetHeaderItemRect(AItemIndex: Integer): TRect; +var + AHeaderItem: THDItem; + I: Integer; + R: TRect; +begin + if GetComCtlVersion >= ComCtlVersionIE3 then + SendGetStructMessage(FHeaderHandle, HDM_GETITEMRECT, AItemIndex, Result) + else + begin + Result.Top := 0; + GetWindowRect(FHeaderHandle, R); + Result.Bottom := R.Bottom - R.Top; + Result.Left := 0; + AHeaderItem.Mask := HDI_WIDTH; + for I := 0 to AItemIndex - 1 do + begin + SendGetStructMessage(FHeaderHandle, HDM_GETITEM, I, AHeaderItem); + Inc(Result.Left, AHeaderItem.cxy); + end; + SendGetStructMessage(FHeaderHandle, HDM_GETITEM, AItemIndex, AHeaderItem); + Result.Right := Result.Left + AHeaderItem.cxy; + end; +end; + +function TcxCustomInnerListView.GetHeaderPressedItemIndex: Integer; +var + AHitTestInfo: THDHitTestInfo; +begin + AHitTestInfo.Point := InternalGetCursorPos; + Windows.ScreenToClient(FHeaderHandle, AHitTestInfo.Point); + SendGetStructMessage(FHeaderHandle, HDM_HITTEST, 0, AHitTestInfo); + if AHitTestInfo.Flags and (HHT_ONDIVIDER or HHT_ONDIVOPEN) <> 0 then + Result := -1 + else + Result := AHitTestInfo.Item; +end; + +function TcxCustomInnerListView.HeaderItemIndex(AHeaderItem: Integer): Integer; +begin + Result := AHeaderItem; + if GetComCtlVersion >= ComCtlVersionIE3 then + Result := SendMessage(FHeaderHandle, HDM_ORDERTOINDEX, AHeaderItem, 0); +end; + +procedure TcxCustomInnerListView.HeaderWndProc(var Message: TMessage); + + procedure CallDefHeaderProc; + begin + Message.Result := CallWindowProc(FDefHeaderProc, FHeaderHandle, + Message.Msg, Message.WParam, Message.LParam); + end; + +var + ADC: HDC; + APaintStruct: TPaintStruct; + R: TRect; +begin + case Message.Msg of + WM_ERASEBKGND: + Message.Result := 1; + WM_PAINT, WM_PRINTCLIENT: + begin + ADC := Message.WParam; + if ADC = 0 then + ADC := BeginPaint(FHeaderHandle, APaintStruct); + try + Canvas.Canvas.Handle := ADC; + Canvas.Canvas.Refresh; + DrawHeader; + finally + if Message.WParam = 0 then + EndPaint(FHeaderHandle, APaintStruct); + end; + end; + WM_LBUTTONDOWN: + begin + CallDefHeaderProc; + if ColumnClick and (GetCapture = FHeaderHandle) then + FPressedHeaderItemIndex := GetHeaderPressedItemIndex; + end; + WM_CAPTURECHANGED: + begin + if FPressedHeaderItemIndex <> -1 then + begin + R := GetHeaderItemRect(FPressedHeaderItemIndex); + InvalidateRect(FHeaderHandle, @R, False); + end; + FPressedHeaderItemIndex := -1; + CallDefHeaderProc; + end; + CM_GETHEADERITEMINFO: + Perform(CM_GETHEADERITEMINFO, Message.WParam, Message.LParam); + else + CallDefHeaderProc; + end; +end; + +procedure TcxCustomInnerListView.HScrollHandler(Sender: TObject; ScrollCode: TScrollCode; + var ScrollPos: Integer); +begin + if ScrollCode = scTrack then + SendMessage(Handle, LVM_SCROLL, ScrollPos - GetScrollPos(Handle, SB_HORZ), 0) + else + begin + CallWindowProc(DefWndProc, Handle, WM_HSCROLL, + MakeWParam(Word(ScrollCode), Word(ScrollPos)), Container.HScrollBar.Handle); + ScrollPos := GetScrollPos(Handle, SB_HORZ); + end; +end; + +procedure TcxCustomInnerListView.VScrollHandler(Sender: TObject; ScrollCode: TScrollCode; + var ScrollPos: Integer); + + function GetLineHeight: Integer; + var + AItemRect: TRect; + begin + AItemRect := TopItem.DisplayRect(drBounds); + Result := AItemRect.Bottom - AItemRect.Top; + end; + +var + P: TPoint; +begin + if ScrollCode = scTrack then + case ViewStyle of + vsReport: + SendMessage(Handle, LVM_SCROLL, 0, (ScrollPos - ListView_GetTopIndex(Handle)) * GetLineHeight); + vsIcon, vsSmallIcon: + begin + SendGetStructMessage(Handle, LVM_GETORIGIN, 0, P); + SendMessage(Handle, LVM_SCROLL, 0, ScrollPos - P.Y); + end; + end + else + begin + CallWindowProc(DefWndProc, Handle, WM_VSCROLL, Word(ScrollCode) + + Word(ScrollPos) shl 16, Container.VScrollBar.Handle); + ScrollPos := GetScrollPos(Handle, SB_VERT); + end; +end; + +procedure TcxCustomInnerListView.WMGetDlgCode(var Message: TWMGetDlgCode); +begin + inherited; + if Container <> nil then + with Message do + begin + Result := Result or DLGC_WANTCHARS; + if GetKeyState(VK_CONTROL) >= 0 then + Result := Result or DLGC_WANTTAB; + end; +end; + +procedure TcxCustomInnerListView.WMKillFocus(var Message: TWMKillFocus); +begin + inherited; + if (Container <> nil) and not Container.IsDestroying then + Container.FocusChanged; +end; + +procedure TcxCustomInnerListView.WMLButtonDown(var Message: TWMLButtonDown); +begin + inherited; + if Dragging then + begin + CancelDrag; + Container.BeginDrag(False); + end; +end; + +procedure TcxCustomInnerListView.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + inherited; + if not Container.ScrollBarsCalculating then + Container.SetScrollBarsParameters; +end; + +procedure TcxCustomInnerListView.WMNCPaint(var Message: TWMNCPaint); +var + DC: HDC; + ABrush: HBRUSH; +begin + if UsecxScrollBars and Container.HScrollBarVisible and + Container.VScrollBarVisible then + begin + DC := GetWindowDC(Handle); + ABrush := 0; + try + with Container.LookAndFeel do + ABrush := CreateSolidBrush(ColorToRGB(Painter.DefaultSizeGripAreaColor)); + FillRect(DC, GetSizeGripRect(Self), ABrush); + finally + if ABrush <> 0 then + DeleteObject(ABrush); + ReleaseDC(Handle, DC); + end; + end; +end; + +procedure TcxCustomInnerListView.WMNotify(var Message: TWMNotify); +begin + inherited; + if Message.NMHdr.code = HDN_ITEMCHANGED then + Container.SetScrollBarsParameters(True); +end; + +procedure TcxCustomInnerListView.WMSetFocus(var Message: TWMSetFocus); +begin + inherited; + if (Container <> nil) and not Container.IsDestroying and + not(csDestroying in ComponentState) and + (Message.FocusedWnd <> Container.Handle) then + Container.FocusChanged; +end; + +procedure TcxCustomInnerListView.WMWindowPosChanged(var Message: TWMWindowPosChanged); +var + ARgn: HRGN; +begin + if not (csDestroying in ComponentState) then + Container.SetScrollBarsParameters; + inherited; + if csDestroying in ComponentState then + Exit; + if Container.HScrollBarVisible and Container.VScrollBarVisible then + begin + ARgn := CreateRectRgnIndirect(GetSizeGripRect(Self)); + SendMessage(Handle, WM_NCPAINT, ARgn, 0); + DeleteObject(ARgn); + end; +end; + +procedure TcxCustomInnerListView.CMHintShow(var Message: TCMHintShow); +var + AInfoTip: string; + AItem: TListItem; + AItemRect: TRect; + AHintInfo: PHintInfo; +begin + AItem := GetItemAt(Message.HintInfo.CursorPos.X, + Message.HintInfo.CursorPos.Y); + if FOldItem = AItem then + Exit; + + if not Assigned(OnInfoTip) then + begin + FOldHint := Hint; + inherited; + end + else + if AItem <> nil then + begin + AInfoTip := AItem.Caption; + DoInfoTip(AItem, AInfoTip); + + AItemRect := AItem.DisplayRect(drBounds); + AItemRect.TopLeft := ClientToScreen(AItemRect.TopLeft); + AItemRect.BottomRight := ClientToScreen(AItemRect.BottomRight); + + AHintInfo := Message.HintInfo; + AHintInfo.HintStr := AInfoTip; + AHintInfo.CursorRect := AItemRect; + AHintInfo.HintPos := Point( + AHintInfo.CursorRect.Left + GetSystemMetrics(SM_CXCURSOR), + AHintInfo.CursorRect.Top + GetSystemMetrics(SM_CYCURSOR)); + AHintInfo.HintMaxWidth := ClientWidth; + Hint := AInfoTip; + end; + FOldItem := AItem; +end; + +procedure TcxCustomInnerListView.CMMouseEnter(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseEnter(Self) + else + MouseEnter(TControl(Message.lParam)); +end; + +procedure TcxCustomInnerListView.CMMouseLeave(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseLeave(Self) + else + MouseLeave(TControl(Message.lParam)); +end; + +procedure TcxCustomInnerListView.CNNotify( + var Message: TWMNotify); +var + AItem: PLVItem; + APrevBrushChangeHandler, APrevFontChangeHandler: TNotifyEvent; +begin + if Message.NMHdr.code = LVN_ENDLABELEDIT then + begin + AItem := @PLVDispInfo(Message.NMHdr)^.item; + if (AItem.iItem <> -1) then + if (AItem.pszText <> nil) then + begin + if CanChange(Items[AItem.iItem], LVIF_TEXT) then + Edit(AItem^); + end + else + DoCancelEdit; + end + else + if Message.NMHdr.code = NM_CUSTOMDRAW then + begin + APrevBrushChangeHandler := Canvas.Brush.OnChange; + APrevFontChangeHandler := Canvas.Font.OnChange; + inherited; + Canvas.Brush.OnChange := APrevBrushChangeHandler; + Canvas.Font.OnChange := APrevFontChangeHandler; + end + else + inherited; +end; + +procedure TcxCustomInnerListView.LVMGetHeaderItemInfo(var Message: TCMHeaderItemInfo); + + function GetItemState: TcxButtonState; + + function CanHotTrack: Boolean; + var + I: Integer; + begin + Result := ColumnClick; + if Result then + for I := 0 to Columns.Count - 1 do + if Columns[I].ImageIndex <> -1 then + begin + Result := False; + Break; + end; + end; + + var + AHeaderItemIndex: Integer; + begin + if not Parent.Enabled then + Result := cxbsDisabled + else + begin + AHeaderItemIndex := HeaderItemIndex(Message.Index); + if AHeaderItemIndex = FPressedHeaderItemIndex then + Result := cxbsPressed + else + if CanHotTrack and (AHeaderItemIndex = GetHeaderHotItemIndex) then + Result := cxbsHot + else + Result := cxbsNormal; + end; + end; + + function GetItemRect: TRect; + var + R: TRect; + begin + if Message.Index = Columns.Count then + begin + Windows.GetClientRect(FHeaderHandle, Result); + if Columns.Count > 0 then + begin + R := GetHeaderItemRect(HeaderItemIndex(Columns.Count - 1)); + Result.Left := R.Right; + end; + end + else + Result := GetHeaderItemRect(HeaderItemIndex(Message.Index)); + end; + +var + AIndex: Integer; + AHeaderItemInfo: PHeaderItemInfo; +begin + AIndex := Message.Index; + AHeaderItemInfo := Message.HeaderItemInfo; + ZeroMemory(AHeaderItemInfo, SizeOf(THeaderItemInfo)); + if AIndex < Columns.Count then + begin + AHeaderItemInfo.ImageIndex := Columns[AIndex].ImageIndex; + AHeaderItemInfo.SectionAlignment := Columns[AIndex].Alignment; + AHeaderItemInfo.SortOrder := soNone; + AHeaderItemInfo.Text := Columns[AIndex].Caption; + end + else + AHeaderItemInfo.ImageIndex := -1; + AHeaderItemInfo.Rect := GetItemRect; + AHeaderItemInfo.State := GetItemState; + Message.HeaderItemInfo := AHeaderItemInfo; +end; + +function TcxCustomInnerListView.GetContainer: TcxCustomListView; +begin + Result := TcxCustomListView(FContainer); +end; + +function TcxCustomInnerListView.GetControl: TWinControl; +begin + Result := Self; +end; + +function TcxCustomInnerListView.GetControlContainer: TcxContainer; +begin + Result := FContainer; +end; + +{ TcxCustomListView } + +constructor TcxCustomListView.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FOwnerDraw := False; + FIconOptions := TcxIconOptions.Create(Self); + FIconOptions.FArrangementChange := ArrangementChangeHandler; + FIconOptions.FAutoArrangeChange := AutoArrangeChangeHandler; + FIconOptions.FWrapTextChange := WrapTextChangeHandler; + FInnerListView := GetListViewClass.Create(Self); + FInnerListView.AutoSize := False; + FInnerListView.Align := alClient; + FInnerListView.BorderStyle := bsNone; + FInnerListView.Parent := Self; + FInnerListView.FContainer := Self; + FInnerListView.OwnerDraw := False; + InnerControl := FInnerListView; + Width := 121; + Height := 97; +end; + +destructor TcxCustomListView.Destroy; +begin + FreeAndNil(FInnerListView); + FreeAndNil(FIconOptions); + inherited Destroy; +end; + +procedure TcxCustomListView.UpdateIconOptions; +begin + if Assigned(InnerListView) then + begin + InnerListView.Items.BeginUpdate; + try + InnerListView.IconOptions.Arrangement := FIconOptions.Arrangement; + InnerListView.IconOptions.AutoArrange := FIconOptions.AutoArrange; + InnerListView.IconOptions.WrapText := FIconOptions.WrapText; + finally + InnerListView.Items.EndUpdate; + end; + end; +end; + +class function TcxCustomListView.GetListViewClass: TcxCustomInnerListViewClass; +begin + Result := TcxCustomInnerListView; +end; + +{$IFDEF DELPHI6} +procedure TcxCustomListView.AddItem(Item: string; AObject: TObject); +begin + InnerListView.AddItem(Item, AObject); +end; + +procedure TcxCustomListView.ClearSelection; +begin + InnerListView.ClearSelection; +end; + +procedure TcxCustomListView.DeleteSelected; +begin + InnerListView.DeleteSelected; +end; +{$ENDIF} + +procedure TcxCustomListView.Clear; +begin +{$IFDEF DELPHI6} + InnerListView.Clear; +{$ELSE} + InnerListView.Items.Clear; +{$ENDIF} +end; + +procedure TcxCustomListView.DoExit; +begin + if IsDestroying then + Exit; + try + except + SetFocus; + raise; + end; + inherited DoExit; +end; + +procedure TcxCustomListView.FontChanged; +begin + inherited FontChanged; + SetSize; +end; + +function TcxCustomListView.IsReadOnly: Boolean; +begin + Result := ReadOnly; +end; + +procedure TcxCustomListView.Loaded; +begin + inherited; + UpdateIconOptions; + InnerListView.OwnerDraw := FOwnerDraw; +end; + +procedure TcxCustomListView.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + inherited LookAndFeelChanged(Sender, AChangedValues); + if not IsDestroying and not FIsCreating then + InnerListView.LookAndFeelChanged(Sender, AChangedValues); +end; + +function TcxCustomListView.NeedsScrollBars: Boolean; +begin + Result := True; +end; + +procedure TcxCustomListView.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +begin + inherited Scroll(AScrollBarKind, AScrollCode, AScrollPos); +{$IFDEF USETCXSCROLLBAR} + if AScrollBarKind = sbHorizontal then + InnerListView.HScrollHandler(Self, AScrollCode, AScrollPos) + else + InnerListView.VScrollHandler(Self, AScrollCode, AScrollPos); + SetScrollBarsParameters; +{$ENDIF} +end; + +procedure TcxCustomListView.WriteState(Writer: TWriter); +begin + FInnerListView.HandleNeeded; + inherited; +end; + +procedure TcxCustomListView.SetReadOnly(Value: Boolean); +begin + if Value <> ReadOnly then + begin + InnerListView.ReadOnly := Value; + DataSetChange; + end; +end; + +procedure TcxCustomListView.SetHideSelection(Value: Boolean); +begin + InnerListView.HideSelection := Value; +end; + +procedure TcxCustomListView.SetMultiSelect(Value: Boolean); +begin + InnerListView.MultiSelect := Value; +end; + +procedure TcxCustomListView.SetOwnerData(Value: Boolean); +begin + InnerListView.OwnerData := Value; +end; + +procedure TcxCustomListView.SetOwnerDraw(Value: Boolean); +begin + FOwnerDraw := Value; + InnerListView.OwnerDraw := Value; +end; + +procedure TcxCustomListView.SetRowSelect(Value: Boolean); +begin + InnerListView.RowSelect := Value; +end; + +procedure TcxCustomListView.SetShowColumnHeaders(Value: Boolean); +begin + InnerListView.ShowColumnHeaders := Value; +end; + +procedure TcxCustomListView.SetColumnClick(Value: Boolean); +begin + InnerListView.ColumnClick := Value; +end; + +function TcxCustomListView.GetReadOnly: Boolean; +begin + Result := InnerListView.ReadOnly; +end; + +function TcxCustomListView.AlphaSort: Boolean; +begin + Result := InnerListView.AlphaSort; +end; + +procedure TcxCustomListView.Arrange(Code: TListArrangement); +begin + InnerListView.Arrange(Code); +end; + +{$IFDEF DELPHI6} +procedure TcxCustomListView.CopySelection(Destination: TCustomListControl); +begin + InnerListView.CopySelection(Destination); +end; +{$ENDIF} + +function TcxCustomListView.FindCaption(StartIndex: Integer; Value: string; + Partial, Inclusive, Wrap: Boolean): TListItem; +begin + Result := InnerListView.FindCaption(StartIndex, Value, Partial, Inclusive, Wrap); +end; + +function TcxCustomListView.FindData(StartIndex: Integer; Value: Pointer; + Inclusive, Wrap: Boolean): TListItem; +begin + Result := InnerListView.FindData(StartIndex, Value, Inclusive, Wrap); +end; + +function TcxCustomListView.GetHitTestInfoAt(X, Y: Integer): THitTests; +begin + Result := InnerListView.GetHitTestInfoAt(X, Y); +end; + +function TcxCustomListView.GetItemAt(X, Y: Integer): TListItem; +begin + Result := InnerListView.GetItemAt(X, Y); +end; + +function TcxCustomListView.GetNearestItem(Point: TPoint; Direction: TSearchDirection): TListItem; +begin + Result := InnerListView.GetNearestItem(Point, Direction); +end; + +function TcxCustomListView.GetNextItem(StartItem: TListItem; + Direction: TSearchDirection; States: TItemStates): TListItem; +begin + Result := InnerListView.GetNextItem(StartItem, Direction, States); +end; + +function TcxCustomListView.GetSearchString: string; +begin + Result := InnerListView.GetSearchString; +end; + +function TcxCustomListView.IsEditing: Boolean; +begin + Result := InnerListView.IsEditing; +end; + +{$IFDEF DELPHI6} +procedure TcxCustomListView.SelectAll; +begin + InnerListView.SelectAll; +end; +{$ENDIF} + +function TcxCustomListView.CustomSort(SortProc: TLVCompare; + lParam: Longint): Boolean; +begin + Result := InnerListView.CustomSort(SortProc, lParam); +end; + +function TcxCustomListView.StringWidth(S: string): Integer; +begin + Result := InnerListView.StringWidth(S); +end; + +procedure TcxCustomListView.UpdateItems(FirstIndex, LastIndex: Integer); +begin + InnerListView.UpdateItems(FirstIndex, LastIndex); +end; + +function TcxCustomListView.GetListItems: TListItems; +begin + Result := InnerListView.Items; +end; + +procedure TcxCustomListView.SetListItems(Value: TListItems); +begin + InnerListView.Items := Value; +end; + +function TcxCustomListView.CanChange(Item: TListItem; Change: Integer): Boolean; +begin + Result := InnerListView.CanChange(Item, Change); +end; + +function TcxCustomListView.CanEdit(Item: TListItem): Boolean; +begin + Result := InnerListView.CanEdit(Item); +end; + +procedure TcxCustomListView.ChangeScale(M, D: Integer); +begin + inherited ChangeScale(M, D); + InnerListView.ChangeScale(M, D); +end; + +function TcxCustomListView.ColumnsShowing: Boolean; +begin + Result := InnerListView.ColumnsShowing; +end; + +function TcxCustomListView.GetCount: Integer; +begin +{$IFDEF DELPHI6} + Result := InnerListView.GetCount; +{$ELSE} + Result := InnerListView.Items.Count; +{$ENDIF} +end; + +function TcxCustomListView.GetItemIndex(Value: TListItem): Integer; +begin + Result := InnerListView.GetItemIndex(Value); +end; + +{$IFDEF DELPHI6} +function TcxCustomListView.GetItemIndex: Integer; +begin + Result := InnerListView.GetItemIndex; +end; + +function TcxCustomListView.GetListViewItemIndex: Integer; +begin + Result := GetItemIndex; +end; +{$ENDIF} + +{$IFDEF DELPHI6} +procedure TcxCustomListView.SetItemIndex(Value: Integer); +begin + InnerListView.SetItemIndex(Value); +end; +{$ENDIF} + +procedure TcxCustomListView.SetViewStyle(Value: TViewStyle); +begin + InnerListView.ViewStyle := Value; + SetScrollBarsParameters; +end; + +procedure TcxCustomListView.UpdateColumn(AnIndex: Integer); +begin + InnerListView.UpdateColumn(AnIndex); +end; + +procedure TcxCustomListView.UpdateColumns; +begin + InnerListView.UpdateColumns; +end; + +function TcxCustomListView.GetListColumns: TListColumns; +begin + Result := InnerListView.Columns; +end; + +function TcxCustomListView.GetListViewCanvas: TcxCanvas; +begin + Result := InnerListView.Canvas; +end; + +procedure TcxCustomListView.SetListColumns(Value: TListColumns); +begin + InnerListView.Columns := Value; +end; + +function TcxCustomListView.GetColumnClick: Boolean; +begin + Result := InnerListView.ColumnClick; +end; + +function TcxCustomListView.GetHideSelection: Boolean; +begin + Result := InnerListView.HideSelection; +end; + +function TcxCustomListView.GetIconOptions: TcxIconOptions; +begin + Result := FIconOptions; +end; + +procedure TcxCustomListView.SetIconOptions(Value: TcxIconOptions); +begin + FIconOptions := Value; + UpdateIconOptions; +end; + +function TcxCustomListView.GetAllocBy: Integer; +begin + Result := InnerListView.AllocBy; +end; + +procedure TcxCustomListView.SetAllocBy(Value: Integer); +begin + InnerListView.AllocBy := Value; +end; + +function TcxCustomListView.GetHoverTime: Integer; +begin + Result := InnerListView.HoverTime; +end; + +procedure TcxCustomListView.SetHoverTime(Value: Integer); +begin + InnerListView.HoverTime := Value; +end; + +function TcxCustomListView.GetLargeImages: TCustomImageList; +begin + Result := InnerListView.LargeImages; +end; + +procedure TcxCustomListView.SetLargeImages(Value: TCustomImageList); +begin + InnerListView.LargeImages := Value; +end; + +function TcxCustomListView.GetMultiSelect: Boolean; +begin + Result := InnerListView.MultiSelect; +end; + +function TcxCustomListView.GetOwnerData: Boolean; +begin + Result := InnerListView.OwnerData; +end; + +function TcxCustomListView.GetOwnerDraw: Boolean; +begin + Result := InnerListView.OwnerDraw; +end; + +function TcxCustomListView.GetOnAdvancedCustomDraw: TLVAdvancedCustomDrawEvent; +begin + Result := InnerListView.OnAdvancedCustomDraw; +end; + +procedure TcxCustomListView.SetOnAdvancedCustomDraw(Value: TLVAdvancedCustomDrawEvent); +begin + InnerListView.OnAdvancedCustomDraw := Value; +end; + +function TcxCustomListView.GetOnAdvancedCustomDrawItem: TLVAdvancedCustomDrawItemEvent; +begin + Result := InnerListView.OnAdvancedCustomDrawItem; +end; + +procedure TcxCustomListView.SetOnAdvancedCustomDrawItem(Value: TLVAdvancedCustomDrawItemEvent); +begin + InnerListView.OnAdvancedCustomDrawItem := Value; +end; + +function TcxCustomListView.GetOnAdvancedCustomDrawSubItem: TLVAdvancedCustomDrawSubItemEvent; +begin + Result := InnerListView.OnAdvancedCustomDrawSubItem; +end; + +procedure TcxCustomListView.SetOnAdvancedCustomDrawSubItem(Value: TLVAdvancedCustomDrawSubItemEvent); +begin + InnerListView.OnAdvancedCustomDrawSubItem := Value; +end; + +function TcxCustomListView.GetOnChange: TLVChangeEvent; +begin + Result := InnerListView.OnChange; +end; + +procedure TcxCustomListView.SetOnChange(Value: TLVChangeEvent); +begin + InnerListView.OnChange := Value; +end; + +function TcxCustomListView.GetOnChanging: TLVChangingEvent; +begin + Result := InnerListView.OnChanging; +end; + +procedure TcxCustomListView.SetOnChanging(Value: TLVChangingEvent); +begin + InnerListView.OnChanging := Value; +end; + +function TcxCustomListView.GetOnColumnClick: TLVColumnClickEvent; +begin + Result := InnerListView.OnColumnClick; +end; + +procedure TcxCustomListView.SetOnColumnClick(Value: TLVColumnClickEvent); +begin + InnerListView.OnColumnClick := Value; +end; + +function TcxCustomListView.GetOnColumnDragged: TNotifyEvent; +begin + Result := InnerListView.OnColumnDragged; +end; + +procedure TcxCustomListView.SetOnColumnDragged(Value: TNotifyEvent); +begin + InnerListView.OnColumnDragged := Value; +end; + +function TcxCustomListView.GetOnColumnRightClick: TLVColumnRClickEvent; +begin + Result := InnerListView.OnColumnRightClick; +end; + +procedure TcxCustomListView.SetOnColumnRightClick(Value: TLVColumnRClickEvent); +begin + InnerListView.OnColumnRightClick := Value; +end; + +function TcxCustomListView.GetOnCompare: TLVCompareEvent; +begin + Result := InnerListView.OnCompare; +end; + +procedure TcxCustomListView.SetOnCompare(Value: TLVCompareEvent); +begin + InnerListView.OnCompare := Value; +end; + +function TcxCustomListView.GetOnCustomDraw: TLVCustomDrawEvent; +begin + Result := InnerListView.OnCustomDraw; +end; + +procedure TcxCustomListView.SetOnCustomDraw(Value: TLVCustomDrawEvent); +begin + InnerListView.OnCustomDraw := Value; +end; + +function TcxCustomListView.GetOnCustomDrawItem: TLVCustomDrawItemEvent; +begin + Result := InnerListView.OnCustomDrawItem; +end; + +procedure TcxCustomListView.SetOnCustomDrawItem(Value: TLVCustomDrawItemEvent); +begin + InnerListView.OnCustomDrawItem := Value; +end; + +function TcxCustomListView.GetOnCustomDrawSubItem: TLVCustomDrawSubItemEvent; +begin + Result := InnerListView.OnCustomDrawSubItem; +end; + +procedure TcxCustomListView.SetOnCustomDrawSubItem(Value: TLVCustomDrawSubItemEvent); +begin + InnerListView.OnCustomDrawSubItem := Value; +end; + +function TcxCustomListView.GetOnData: TLVOwnerDataEvent; +begin + Result := InnerListView.OnData; +end; + +procedure TcxCustomListView.SetOnData(Value: TLVOwnerDataEvent); +begin + InnerListView.OnData := Value; +end; + +function TcxCustomListView.GetOnDataFind: TLVOwnerDataFindEvent; +begin + Result := InnerListView.OnDataFind; +end; + +procedure TcxCustomListView.SetOnDataFind(Value: TLVOwnerDataFindEvent); +begin + InnerListView.OnDataFind := Value; +end; + +function TcxCustomListView.GetOnDataHint: TLVOwnerDataHintEvent; +begin + Result := InnerListView.OnDataHint; +end; + +procedure TcxCustomListView.SetOnDataHint(Value: TLVOwnerDataHintEvent); +begin + InnerListView.OnDataHint := Value; +end; + +function TcxCustomListView.GetOnDataStateChange: TLVOwnerDataStateChangeEvent; +begin + Result := InnerListView.OnDataStateChange; +end; + +procedure TcxCustomListView.SetOnDataStateChange(Value: TLVOwnerDataStateChangeEvent); +begin + InnerListView.OnDataStateChange := Value; +end; + +function TcxCustomListView.GetOnDeletion: TLVDeletedEvent; +begin + Result := InnerListView.OnDeletion; +end; + +procedure TcxCustomListView.SetOnDeletion(Value: TLVDeletedEvent); +begin + InnerListView.OnDeletion := Value; +end; + +function TcxCustomListView.GetOnDrawItem: TLVDrawItemEvent; +begin + Result := InnerListView.OnDrawItem; +end; + +procedure TcxCustomListView.SetOnDrawItem(Value: TLVDrawItemEvent); +begin + InnerListView.OnDrawItem := Value; +end; + +function TcxCustomListView.GetOnEdited: TLVEditedEvent; +begin + Result := InnerListView.OnEdited; +end; + +procedure TcxCustomListView.SetOnEdited(Value: TLVEditedEvent); +begin + InnerListView.OnEdited := Value; +end; + +function TcxCustomListView.GetOnEditing: TLVEditingEvent; +begin + Result := InnerListView.OnEditing; +end; + +procedure TcxCustomListView.SetOnEditing(Value: TLVEditingEvent); +begin + InnerListView.OnEditing := Value; +end; + +function TcxCustomListView.GetOnInfoTip: TLVInfoTipEvent; +begin + Result := InnerListView.OnInfoTip; +end; + +procedure TcxCustomListView.SetOnInfoTip(Value: TLVInfoTipEvent); +begin + InnerListView.OnInfoTip := Value; +end; + +function TcxCustomListView.GetOnInsert: TLVDeletedEvent; +begin + Result := InnerListView.OnInsert; +end; + +procedure TcxCustomListView.SetOnInsert(Value: TLVDeletedEvent); +begin + InnerListView.OnInsert := Value; +end; + +function TcxCustomListView.GetOnGetImageIndex: TLVNotifyEvent; +begin + Result := InnerListView.OnGetImageIndex; +end; + +procedure TcxCustomListView.SetOnGetImageIndex(Value: TLVNotifyEvent); +begin + InnerListView.OnGetImageIndex := Value; +end; + +function TcxCustomListView.GetOnGetSubItemImage: TLVSubItemImageEvent; +begin + Result := InnerListView.OnGetSubItemImage; +end; + +procedure TcxCustomListView.SetOnGetSubItemImage(Value: TLVSubItemImageEvent); +begin + InnerListView.OnGetSubItemImage := Value; +end; + +function TcxCustomListView.GetOnSelectItem: TLVSelectItemEvent; +begin + Result := InnerListView.OnSelectItem; +end; + +procedure TcxCustomListView.SetOnSelectItem(Value: TLVSelectItemEvent); +begin + InnerListView.OnSelectItem := Value; +end; + +function TcxCustomListView.GetShowColumnHeaders: Boolean; +begin + Result := InnerListView.ShowColumnHeaders; +end; + +function TcxCustomListView.GetShowWorkAreas: Boolean; +begin + Result := InnerListView.ShowWorkAreas; +end; + +procedure TcxCustomListView.SetShowWorkAreas(Value: Boolean); +begin + InnerListView.ShowWorkAreas := Value; +end; + +function TcxCustomListView.GetSmallImages: TCustomImageList; +begin + Result := InnerListView.SmallImages; +end; + +procedure TcxCustomListView.SetSmallImages(Value: TCustomImageList); +begin + InnerListView.SmallImages := Value; +end; + +function TcxCustomListView.GetSortType: TSortType; +begin + Result := InnerListView.SortType; +end; + +procedure TcxCustomListView.SetSortType(Value: TSortType); +begin + InnerListView.SortType := Value; +end; + +function TcxCustomListView.GetStateImages: TCustomImageList; +begin + Result := InnerListView.StateImages; +end; + +procedure TcxCustomListView.SetStateImages(Value: TCustomImageList); +begin + InnerListView.StateImages := Value; +end; + +function TcxCustomListView.GetViewStyle: TViewStyle; +begin + Result := InnerListView.ViewStyle; +end; + +{$IFDEF DELPHI6} +function TcxCustomListView.GetOnCreateItemClass: TLVCreateItemClassEvent; +begin + Result := InnerListView.OnCreateItemClass; +end; + +procedure TcxCustomListView.SetOnCreateItemClass(Value: TLVCreateItemClassEvent); +begin + InnerListView.OnCreateItemClass := Value; +end; +{$ENDIF} + +function TcxCustomListView.GetCheckBoxes: Boolean; +begin + Result := InnerListView.Checkboxes; +end; + +function TcxCustomListView.GetColumnFromIndex(Index: Integer): TListColumn; +begin + Result := InnerListView.Column[Index]; +end; + +function TcxCustomListView.GetDropTarget: TListItem; +begin + Result := InnerListView.DropTarget; +end; + +function TcxCustomListView.GetFullDrag: Boolean; +begin + Result := InnerListView.FullDrag; +end; + +function TcxCustomListView.GetGridLines: Boolean; +begin + Result := InnerListView.GridLines; +end; + +function TcxCustomListView.GetHotTrack: Boolean; +begin + Result := InnerListView.HotTrack; +end; + +function TcxCustomListView.GetHotTrackStyles: TListHotTrackStyles; +begin + Result := InnerListView.HotTrackStyles; +end; + +function TcxCustomListView.GetItemFocused: TListItem; +begin + Result := InnerListView.ItemFocused; +end; + +function TcxCustomListView.GetRowSelect: Boolean; +begin + Result := InnerListView.RowSelect; +end; + +function TcxCustomListView.GetSelCount: Integer; +begin + Result := InnerListView.SelCount; +end; + +function TcxCustomListView.GetSelected: TListItem; +begin + Result := InnerListView.Selected; +end; + +function TcxCustomListView.GetTopItem: TListItem; +begin + Result := InnerListView.TopItem; +end; + +function TcxCustomListView.GetViewOrigin: TPoint; +begin + Result := InnerListView.ViewOrigin; +end; + +function TcxCustomListView.GetVisibleRowCount: Integer; +begin + Result := InnerListView.VisibleRowCount; +end; + +function TcxCustomListView.GetBoundingRect: TRect; +begin + Result := InnerListView.BoundingRect; +end; + +function TcxCustomListView.GetWorkAreas: TWorkAreas; +begin + Result := InnerListView.WorkAreas; +end; + +procedure TcxCustomListView.SetCheckboxes(Value: Boolean); +begin + InnerListView.Checkboxes := value; +end; + +procedure TcxCustomListView.SetDropTarget(Value: TListItem); +begin + InnerListView.DropTarget := Value; +end; + +procedure TcxCustomListView.SetFullDrag(Value: Boolean); +begin + InnerListView.FullDrag := Value; +end; + +procedure TcxCustomListView.SetGridLines(Value: Boolean); +begin + InnerListView.GridLines := Value; +end; + +procedure TcxCustomListView.SetHotTrack(Value: Boolean); +begin + InnerListView.HotTrack := Value; +end; + +procedure TcxCustomListView.SetHotTrackStyles(Value: TListHotTrackStyles); +begin + InnerListView.HotTrackStyles := Value; +end; + +procedure TcxCustomListView.SetItemFocused(Value: TListItem); +begin + InnerListView.ItemFocused := Value; +end; + +procedure TcxCustomListView.SetSelected(Value: TListItem); +begin + InnerListView.Selected := Value; +end; + +procedure TcxCustomListView.ArrangementChangeHandler(Sender: TObject); +begin + if Assigned(InnerListView) then + InnerListView.IconOptions.Arrangement := FIconOptions.Arrangement; +end; + +procedure TcxCustomListView.AutoArrangeChangeHandler(Sender: TObject); +begin + if Assigned(InnerListView) then + InnerListView.IconOptions.AutoArrange := FIconOptions.AutoArrange; +end; + +procedure TcxCustomListView.WrapTextChangeHandler(Sender: TObject); +begin + if Assigned(InnerListView) then + InnerListView.IconOptions.WrapText := FIconOptions.WrapText; +end; +{ TcxCustomListView } + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxLookupDBGrid.pas b/official/x.35/ExpressEditors Library 5/Sources/cxLookupDBGrid.pas new file mode 100644 index 00000000..f71e2d25 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxLookupDBGrid.pas @@ -0,0 +1,525 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxLookupDBGrid; + +{$I cxVer.inc} + +interface + +uses + Windows, + SysUtils, Classes, Controls, Graphics, Forms, StdCtrls, DB, + cxClasses, cxControls, cxGraphics, cxLookAndFeelPainters, + cxEdit, cxDBEdit, cxCustomData, cxDB, cxDBData, cxEditRepositoryItems, + cxLookupGrid; + +const + DefaultSyncMode = False; + +type + TcxCustomLookupDBGrid = class; + + { TcxLookupGridDBDataController } + + TcxLookupGridDBDataController = class(TcxDBDataController) + private + function GetGrid: TcxCustomLookupDBGrid; + protected + procedure UpdateScrollBars; override; + public + constructor Create(AOwner: TComponent); override; + function GetItem(Index: Integer): TObject; override; + property Grid: TcxCustomLookupDBGrid read GetGrid; + published + property OnCompare; + end; + + { TcxLookupDBGridColumn } + + TcxLookupDBGridDefaultValuesProvider = class(TcxCustomDBEditDefaultValuesProvider) + function IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean; override; + end; + + TcxLookupDBGridColumn = class(TcxLookupGridColumn) + private + function GetDataController: TcxLookupGridDBDataController; + function GetField: TField; + function GetFieldName: string; + procedure SetFieldName(const Value: string); + protected + function GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; override; + procedure InitDefaultValuesProvider; + property DataController: TcxLookupGridDBDataController read GetDataController; + public + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; override; + function DefaultRepositoryItem: TcxEditRepositoryItem; override; + function DefaultWidth: Integer; override; + property Field: TField read GetField; + published + property FieldName: string read GetFieldName write SetFieldName; + end; + + { TcxLookupDBGridColumns } + + TcxLookupDBGridColumns = class(TcxLookupGridColumns) + private + function GetColumn(Index: Integer): TcxLookupDBGridColumn; + procedure SetColumn(Index: Integer; Value: TcxLookupDBGridColumn); + public + function Add: TcxLookupDBGridColumn; + function ColumnByFieldName(const AFieldName: string): TcxLookupDBGridColumn; + property Items[Index: Integer]: TcxLookupDBGridColumn read GetColumn write SetColumn; default; + end; + + { TcxLookupDBGridOptions } + + TcxLookupDBGridOptions = class(TcxLookupGridOptions) + private + function GetGrid: TcxCustomLookupDBGrid; + function GetSyncMode: Boolean; + procedure SetSyncMode(Value: Boolean); + public + procedure Assign(Source: TPersistent); override; + property Grid: TcxCustomLookupDBGrid read GetGrid; + published + property SyncMode: Boolean read GetSyncMode write SetSyncMode + default DefaultSyncMode; + end; + + { TcxCustomLookupDBGrid } + + TcxCustomLookupDBGrid = class(TcxCustomLookupGrid) + private + function GetColumns: TcxLookupDBGridColumns; + function GetDataController: TcxLookupGridDBDataController; + function GetDataSource: TDataSource; + function GetKeyFieldNames: string; + function GetOptions: TcxLookupDBGridOptions; + procedure SetColumns(Value: TcxLookupDBGridColumns); + procedure SetDataController(Value: TcxLookupGridDBDataController); + procedure SetDataSource(Value: TDataSource); + procedure SetKeyFieldNames(const Value: string); + procedure SetOptions(Value: TcxLookupDBGridOptions); + protected + procedure CreateColumnsByFields(AFieldNames: TStrings); virtual; + procedure DataChanged; override; + function GetColumnClass: TcxLookupGridColumnClass; override; + function GetColumnsClass: TcxLookupGridColumnsClass; override; + function GetDataControllerClass: TcxCustomDataControllerClass; override; + function GetOptionsClass: TcxLookupGridOptionsClass; override; + procedure InitScrollBarsParameters; override; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; var AScrollPos: Integer); override; + procedure UpdateScrollBars; override; // for Delphi .NET + public + procedure CreateAllColumns; + procedure CreateColumnsByFieldNames(const AFieldNames: string); + property Align; + property Anchors; + property Color; + property Columns: TcxLookupDBGridColumns read GetColumns write SetColumns; + property DataController: TcxLookupGridDBDataController read GetDataController write SetDataController; + property Font; + property LookAndFeel; + property Options: TcxLookupDBGridOptions read GetOptions write SetOptions; + property ParentFont; + property Visible; + published + property DataSource: TDataSource read GetDataSource write SetDataSource; + property KeyFieldNames: string read GetKeyFieldNames write SetKeyFieldNames; + end; + + TcxCustomLookupDBGridClass = class of TcxCustomLookupDBGrid; + +implementation + +uses + cxEditDBRegisteredRepositoryItems; + +function TcxLookupDBGridDefaultValuesProvider.IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean; +begin + with TcxLookupDBGridColumn(Owner) do + Result := DataController.GetItemTextStored(Index); +end; + +{ TcxLookupDBGridColumn } + +procedure TcxLookupDBGridColumn.Assign(Source: TPersistent); +begin + if Source is TcxLookupDBGridColumn then + FieldName := TcxLookupDBGridColumn(Source).FieldName; + inherited Assign(Source); +end; + +function TcxLookupDBGridColumn.DefaultCaption: string; +var + AField: TField; +begin + AField := Field; + if AField = nil then + Result := FieldName + else + Result := AField.DisplayName; +end; + +function TcxLookupDBGridColumn.DefaultRepositoryItem: TcxEditRepositoryItem; +begin + Result := GetDefaultEditDBRepositoryItems.GetItemByField(Field); +end; + +function TcxLookupDBGridColumn.DefaultWidth: Integer; +var + AField: TField; + ACanvas: TcxCanvas; + W: Integer; +begin + AField := Field; + if AField = nil then + Result := inherited DefaultWidth + else + begin + ACanvas := Grid.ViewInfo.Canvas; + ACanvas.Font := GetContentFont; + Result := AField.DisplayWidth * ACanvas.TextWidth('0') + 4; + if Grid.Options.ShowHeader then + begin + W := Grid.Painter.LFPainterClass.HeaderWidth(ACanvas, cxBordersAll, Caption, + Grid.ViewInfo.GetHeaderFont); + if W > Result then Result := W; + end; + end; + CheckWidthValue(Result); +end; + +function TcxLookupDBGridColumn.GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; +begin + Result := TcxLookupDBGridDefaultValuesProvider; +end; + +procedure TcxLookupDBGridColumn.InitDefaultValuesProvider; +begin + TcxCustomDBEditDefaultValuesProvider(DefaultValuesProvider.GetInstance).Field := Field; +end; + +function TcxLookupDBGridColumn.GetDataController: TcxLookupGridDBDataController; +begin + Result := TcxLookupGridDBDataController(inherited DataController); +end; + +function TcxLookupDBGridColumn.GetField: TField; +begin + Result := DataController.GetItemField(Index); +end; + +function TcxLookupDBGridColumn.GetFieldName: string; +begin + Result := DataController.GetItemFieldName(Index); +end; + +procedure TcxLookupDBGridColumn.SetFieldName(const Value: string); +begin + DataController.ChangeFieldName(Index, Value); +end; + +{ TcxLookupDBGridColumns } + +function TcxLookupDBGridColumns.Add: TcxLookupDBGridColumn; +begin + Result := inherited Add as TcxLookupDBGridColumn; +end; + +function TcxLookupDBGridColumns.ColumnByFieldName(const AFieldName: string): TcxLookupDBGridColumn; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I]; + if AnsiCompareText(Result.FieldName, AFieldName) = 0 then + Exit; + end; + Result := nil; +end; + +function TcxLookupDBGridColumns.GetColumn(Index: Integer): TcxLookupDBGridColumn; +begin + Result := inherited Items[Index] as TcxLookupDBGridColumn; +end; + +procedure TcxLookupDBGridColumns.SetColumn(Index: Integer; Value: TcxLookupDBGridColumn); +begin + inherited Items[Index] := Value; +end; + +{ TcxLookupGridDBDataController } + +constructor TcxLookupGridDBDataController.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + DataModeController.SyncMode := DefaultSyncMode; + DataModeController.SyncInsert := False; +end; + +function TcxLookupGridDBDataController.GetItem(Index: Integer): TObject; +begin + Result := Grid.Columns[Index]; +end; + +procedure TcxLookupGridDBDataController.UpdateScrollBars; +begin + Grid.UpdateScrollBars; +end; + +function TcxLookupGridDBDataController.GetGrid: TcxCustomLookupDBGrid; +begin + Result := GetOwner as TcxCustomLookupDBGrid; +end; + +{ TcxLookupDBGridOptions } + +procedure TcxLookupDBGridOptions.Assign(Source: TPersistent); +begin + if Source is TcxLookupDBGridOptions then + begin + if Assigned(Grid) then + Grid.BeginUpdate; + try + inherited Assign(Source); + SyncMode := TcxLookupDBGridOptions(Source).SyncMode; + finally + if Assigned(Grid) then + Grid.EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +function TcxLookupDBGridOptions.GetGrid: TcxCustomLookupDBGrid; +begin + Result := TcxCustomLookupDBGrid(FGrid); +end; + +function TcxLookupDBGridOptions.GetSyncMode: Boolean; +begin + if Assigned(Grid) then + Result := Grid.DataController.DataModeController.SyncMode + else + Result := DefaultSyncMode; +end; + +procedure TcxLookupDBGridOptions.SetSyncMode(Value: Boolean); +begin + if Assigned(Grid) then + Grid.DataController.DataModeController.SyncMode := Value; +end; + +{ TcxCustomLookupDBGrid } + +procedure TcxCustomLookupDBGrid.CreateAllColumns; +var + ADataSet: TDataSet; + AFieldNames: TStrings; +begin + Columns.Clear; + ADataSet := DataController.DataSet; + if ADataSet <> nil then + begin + AFieldNames := TStringList.Create; + try + {$WARNINGS OFF} { for Borland Delphi 10 } + ADataSet.GetFieldNames(AFieldNames); + {$WARNINGS ON} + CreateColumnsByFields(AFieldNames); + finally + AFieldNames.Free; + end; + end; +end; + +procedure TcxCustomLookupDBGrid.CreateColumnsByFieldNames(const AFieldNames: string); +var + AFieldNamesList: TStrings; +begin + Columns.Clear; + AFieldNamesList := TStringList.Create; + try + GetFieldNames(AFieldNames, AFieldNamesList); + CreateColumnsByFields(AFieldNamesList); + finally + AFieldNamesList.Free; + end; +end; + +procedure TcxCustomLookupDBGrid.CreateColumnsByFields(AFieldNames: TStrings); +var + I: Integer; +begin + BeginUpdate; + try + for I := 0 to AFieldNames.Count - 1 do + Columns.Add.FieldName := AFieldNames[I]; + finally + EndUpdate; + end; +end; + +procedure TcxCustomLookupDBGrid.DataChanged; +var + I: Integer; +begin + for I := 0 to Columns.Count - 1 do + Columns[I].InitDefaultValuesProvider; + inherited DataChanged; +end; + +function TcxCustomLookupDBGrid.GetColumnClass: TcxLookupGridColumnClass; +begin + Result := TcxLookupDBGridColumn; +end; + +function TcxCustomLookupDBGrid.GetColumnsClass: TcxLookupGridColumnsClass; +begin + Result := TcxLookupDBGridColumns; +end; + +function TcxCustomLookupDBGrid.GetDataControllerClass: TcxCustomDataControllerClass; +begin + Result := TcxLookupGridDBDataController; +end; + +function TcxCustomLookupDBGrid.GetOptionsClass: TcxLookupGridOptionsClass; +begin + Result := TcxLookupDBGridOptions; +end; + +procedure TcxCustomLookupDBGrid.InitScrollBarsParameters; +begin + if DataController.IsGridMode and DataController.IsSequenced then + begin + SetScrollBarInfo(sbVertical, 0, + (DataController.DataSetRecordCount - 1) + (ViewInfo.VisibleRowCount - 1), + 1, ViewInfo.VisibleRowCount, DataController.RecNo - 1, True, True); + end + else + inherited InitScrollBarsParameters; +end; + +procedure TcxCustomLookupDBGrid.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +begin + if DataController.IsGridMode and DataController.IsSequenced then + begin + if AScrollBarKind = sbVertical then + begin + case AScrollCode of + scLineUp: + FocusNextRow(False); + scLineDown: + FocusNextRow(True); + scPageUp: + FocusPriorPage; + scPageDown: + FocusNextPage; + scTrack: ; + scPosition: + DataController.RecNo := AScrollPos + 1; + end; + end + else + inherited Scroll(AScrollBarKind, AScrollCode, AScrollPos); + AScrollPos := DataController.RecNo - 1; + end + else + inherited Scroll(AScrollBarKind, AScrollCode, AScrollPos); +end; + +procedure TcxCustomLookupDBGrid.UpdateScrollBars; +begin + inherited UpdateScrollBars; +end; + +function TcxCustomLookupDBGrid.GetColumns: TcxLookupDBGridColumns; +begin + Result := inherited Columns as TcxLookupDBGridColumns; +end; + +function TcxCustomLookupDBGrid.GetDataController: TcxLookupGridDBDataController; +begin + Result := TcxLookupGridDBDataController(FDataController); +end; + +function TcxCustomLookupDBGrid.GetDataSource: TDataSource; +begin + Result := DataController.DataSource; +end; + +function TcxCustomLookupDBGrid.GetKeyFieldNames: string; +begin + Result := DataController.KeyFieldNames; +end; + +function TcxCustomLookupDBGrid.GetOptions: TcxLookupDBGridOptions; +begin + Result := TcxLookupDBGridOptions(FOptions); +end; + +procedure TcxCustomLookupDBGrid.SetColumns(Value: TcxLookupDBGridColumns); +begin + inherited Columns := Value; +end; + +procedure TcxCustomLookupDBGrid.SetDataController(Value: TcxLookupGridDBDataController); +begin + FDataController.Assign(Value); +end; + +procedure TcxCustomLookupDBGrid.SetDataSource(Value: TDataSource); +begin + DataController.DataSource := Value; +end; + +procedure TcxCustomLookupDBGrid.SetKeyFieldNames(const Value: string); +begin + DataController.KeyFieldNames := Value; +end; + +procedure TcxCustomLookupDBGrid.SetOptions(Value: TcxLookupDBGridOptions); +begin + FOptions.Assign(Value); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxLookupEdit.pas b/official/x.35/ExpressEditors Library 5/Sources/cxLookupEdit.pas new file mode 100644 index 00000000..51122ceb --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxLookupEdit.pas @@ -0,0 +1,1185 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxLookupEdit; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Messages, SysUtils, Classes, Controls, Graphics, Forms, + cxClasses, cxGraphics, cxControls, cxContainer, cxLookAndFeels, + cxEdit, cxTextEdit, cxDropDownEdit, cxDataUtils, cxCustomData; + +type + TcxCustomLookupEdit = class; + TcxCustomLookupEditProperties = class; + + { TcxCustomLookupEditLookupData } + + TcxLookupGridCloseUpEvent = procedure (Sender: TObject; AAccept: Boolean) of object; + + TcxCustomLookupEditLookupData = class(TcxInterfacedPersistent, + IUnknown, IcxTextEditLookupData) + private + FOwner: TPersistent; + FVisible: Boolean; + FOnCurrentKeyChanged: TNotifyEvent; + FOnSelectItem: TNotifyEvent; + function GetDataController: TcxCustomDataController; + function GetEdit: TcxCustomLookupEdit; + function GetFocusedRecordIndex: Integer; + function GetListIndex: Integer; + function GetProperties: TcxCustomLookupEditProperties; + protected + FCurrentKey: Variant; + function GetOwner: TPersistent; override; + // IcxTextEditLookupData + function CanResizeVisualArea(var NewSize: TSize; + AMaxHeight: Integer = 0; AMaxWidth: Integer = 0): Boolean; virtual; + procedure CloseUp; virtual; + procedure Deinitialize; virtual; + procedure DropDown; virtual; + procedure DroppedDown(const AFindStr: string); virtual; + function Find(const AText: string): Boolean; virtual; + function GetActiveControl: TControl; + function GetCurrentKey: TcxEditValue; virtual; + function GetDisplayText(const AKey: TcxEditValue): string; virtual; + function GetOnCurrentKeyChanged: TNotifyEvent; + function GetOnSelectItem: TNotifyEvent; + function GetVisualAreaPreferredSize(AMaxHeight: Integer; AWidth: Integer = 0): TSize; + procedure Go(ADirection: TcxEditLookupDataGoDirection; ACircular: Boolean); virtual; + procedure Initialize(AVisualControlsParent: TWinControl); + function IsEmpty: Boolean; virtual; + function IsMouseOverList(const P: TPoint): Boolean; + function Locate(var AText, ATail: string; ANext: Boolean): Boolean; virtual; + procedure PositionVisualArea(const AClientRect: TRect); + procedure PropertiesChanged; virtual; + procedure SelectItem; virtual; + procedure SetCurrentKey(const AKey: TcxEditValue); virtual; + procedure SetOnCurrentKeyChanged(Value: TNotifyEvent); + procedure SetOnSelectItem(Value: TNotifyEvent); + procedure TextChanged; virtual; + + procedure DoCurrentKeyChanged; virtual; + procedure DoSelectItem; virtual; + procedure DoSetCurrentKey(ARecordIndex: Integer); virtual; + procedure DoSetKeySelection(AKeySelected: Boolean); + procedure DoSyncGrid; virtual; + procedure GridClick(Sender: TObject); virtual; + procedure GridCloseUp(Sender: TObject; AAccept: Boolean); virtual; + procedure GridFocusedRowChanged(Sender: TObject); virtual; + function IsKeySelected: Boolean; virtual; + function LocateText(const AText: string): Boolean; virtual; + procedure ResetIncrementalFilter; virtual; + procedure SyncGrid; virtual; + procedure SyncSelected; virtual; + procedure UpdateDropDownCount; virtual; + property DataController: TcxCustomDataController read GetDataController; + property Edit: TcxCustomLookupEdit read GetEdit; + property FocusedRecordIndex: Integer read GetFocusedRecordIndex; + property Properties: TcxCustomLookupEditProperties read GetProperties; + public + constructor Create(AOwner: TPersistent); override; + procedure DisableChanging; + procedure EnableChanging; + end; + + { TcxCustomLookupEditProperties } + + TcxCustomLookupEditProperties = class(TcxCustomComboBoxProperties) + private + FDisplayColumnIndex: Integer; + FLockCount: Integer; + FImmediateUpdateText: Boolean; + FInGridDataChanged: Boolean; + FIncrementalFiltering: Boolean; + function GetDataController: TcxCustomDataController; + function GetDropDownAutoSize: Boolean; + function GetDropDownHeight: Integer; + function GetDropDownSizeable: Boolean; + function GetDropDownWidth: Integer; + procedure SetDropDownAutoSize(Value: Boolean); + procedure SetDropDownHeight(Value: Integer); + procedure SetDropDownSizeable(Value: Boolean); + procedure SetDropDownWidth(Value: Integer); + protected + // LookupGrid methods + function GetLookupGridActiveControl: TWinControl; virtual; + function GetLookupGridCanResize: Boolean; virtual; + function GetLookupGridColumnCount: Integer; virtual; + function GetLookupGridControl: TWinControl; virtual; + function GetLookupGridDataController: TcxCustomDataController; virtual; + function GetLookupGridVisualAreaPreferredWidth: Integer; virtual; + function GetLookupGridNearestPopupHeight(AHeight: Integer): Integer; virtual; + function GetLookupGridPopupHeight(ADropDownRowCount: Integer): Integer; virtual; + function IsLookupGridMouseOverList(const P: TPoint): Boolean; virtual; + procedure LookupGridDeinitialize; virtual; // IsPopup := False + procedure LookupGridDroppedDown(const AFindStr: string); virtual; + procedure LookupGridInitEvents(AOnClick, AOnFocusedRowChanged: TNotifyEvent; AOnCloseUp: TcxLookupGridCloseUpEvent); virtual; + procedure LookupGridInitialize; virtual; // IsPopup := True + procedure LookupGridInitLookAndFeel(ALookAndFeel: TcxLookAndFeel; AColor: TColor; AFont: TFont); virtual; + procedure LookupGridLockMouseMove; virtual; + procedure LookupGridMakeFocusedRowVisible; virtual; + procedure LookupGridUnlockMouseMove; virtual; + + procedure CheckDisplayColumnIndex; + procedure DeinitializeDataController; virtual; + function FindByText(AItemIndex: Integer; const AText: string; APartialCompare: Boolean): Integer; virtual; + function FindLookupText(const AText: string): Boolean; override; + function GetDisplayColumnIndex: Integer; virtual; + function GetDisplayFormatOptions: TcxEditDisplayFormatOptions; override; + function GetDisplayLookupText(const AKey: TcxEditValue): string; virtual; + function GetIncrementalFiltering: Boolean; virtual; + function GetListIndex: Integer; virtual; + class function GetLookupDataClass: TcxInterfacedPersistentClass; override; + function GetNullKey: Variant; virtual; + procedure GridDataChanged(Sender: TObject); virtual; + procedure InitializeDataController; virtual; + function IsChangeLocked: Boolean; virtual; + function IsDataChangedPostponed: Boolean; virtual; + function IsEditValueConversionDependOnFocused: Boolean; override; + function IsPickMode: Boolean; virtual; + function IsPopupKey(Key: Word; Shift: TShiftState): Boolean; override; + procedure LockDataChanged; virtual; + procedure SetDisplayColumnIndex(Value: Integer); virtual; + procedure UnlockDataChanged; virtual; + procedure UnlinkLookupGridControlParent; virtual; + property DataController: TcxCustomDataController read GetDataController; + property DisplayColumnIndex: Integer read GetDisplayColumnIndex write SetDisplayColumnIndex default 0; + property ImmediateUpdateText: Boolean read FImmediateUpdateText write FImmediateUpdateText default False; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + class function GetContainerClass: TcxContainerClass; override; + function GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; override; + function GetSupportedOperations: TcxEditSupportedOperations; override; + function IsDefinedByLookup: Boolean; virtual; + function IsEditValueValid(var EditValue: TcxEditValue; AEditFocused: Boolean): Boolean; override; + function IsLookupField: Boolean; virtual; + procedure PrepareDisplayValue(const AEditValue: TcxEditValue; var DisplayValue: TcxEditValue; + AEditFocused: Boolean); override; + property DropDownAutoSize: Boolean read GetDropDownAutoSize write SetDropDownAutoSize default False; + property DropDownHeight: Integer read GetDropDownHeight write SetDropDownHeight default 0; + property DropDownListStyle default lsEditFixedList; + property DropDownSizeable: Boolean read GetDropDownSizeable write SetDropDownSizeable default False; + property DropDownWidth: Integer read GetDropDownWidth write SetDropDownWidth default 0; + property IncrementalFiltering: Boolean read FIncrementalFiltering write FIncrementalFiltering default True; + end; + + { TcxCustomLookupEdit } + + TcxCustomLookupEdit = class(TcxCustomComboBox) + private + function GetILookupData: IcxTextEditLookupData; + function GetLookupData: TcxCustomLookupEditLookupData; + function GetProperties: TcxCustomLookupEditProperties; + function GetActiveProperties: TcxCustomLookupEditProperties; + procedure SetLookupData(Value: TcxCustomLookupEditLookupData); + procedure SetProperties(Value: TcxCustomLookupEditProperties); + protected + procedure AfterPosting; override; + procedure BeforePosting; override; + procedure DoShowEdit; override; + procedure DropDown; override; + procedure Initialize; override; + function InternalGetEditingValue: TcxEditValue; override; + function NeedResetInvalidTextWhenPropertiesChanged: Boolean; override; + procedure RepositoryItemAssigning; override; + procedure SynchronizeDisplayValue; override; + property ILookupData: IcxTextEditLookupData read GetILookupData; + property LookupData: TcxCustomLookupEditLookupData read GetLookupData write SetLookupData; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + procedure PrepareEditValue(const ADisplayValue: TcxEditValue; out EditValue: TcxEditValue; AEditFocused: Boolean); override; + property ActiveProperties: TcxCustomLookupEditProperties read GetActiveProperties; + property Properties: TcxCustomLookupEditProperties read GetProperties + write SetProperties; + end; + +implementation + +// TODO: Field.DisplayText <> Field.AsString <- DataSet.Locate + +{ TcxCustomLookupEditLookupData } + +constructor TcxCustomLookupEditLookupData.Create(AOwner: TPersistent); +begin + inherited Create(nil); + FOwner := AOwner; + FCurrentKey := Null; +end; + +procedure TcxCustomLookupEditLookupData.DisableChanging; +begin + Inc(Properties.FLockCount); +end; + +procedure TcxCustomLookupEditLookupData.EnableChanging; +begin + Dec(Properties.FLockCount); +end; + +function TcxCustomLookupEditLookupData.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +// IcxTextEditLookupData + +function TcxCustomLookupEditLookupData.CanResizeVisualArea(var NewSize: TSize; + AMaxHeight: Integer = 0; AMaxWidth: Integer = 0): Boolean; +begin + if (AMaxHeight > 0) and (NewSize.cy > AMaxHeight) then + NewSize.cy := AMaxHeight; + if Properties.GetLookupGridCanResize then + NewSize.cy := Properties.GetLookupGridNearestPopupHeight(NewSize.cy); + Result := True; +end; + +procedure TcxCustomLookupEditLookupData.CloseUp; +begin + DisableChanging; + try +// if Properties.GetLookupGridControl <> nil then +// Properties.GetLookupGridControl.Parent := nil; + ResetIncrementalFilter; + FVisible := False; + Properties.LookupGridInitEvents(nil, nil, nil); + Properties.LookupGridUnlockMouseMove; + Properties.LookupGridDeinitialize; + Properties.UnlockDataChanged; + finally + EnableChanging; + end; +end; + +procedure TcxCustomLookupEditLookupData.Deinitialize; +begin +// if Properties.GetLookupGridControl <> nil then +// Properties.GetLookupGridControl.Parent := nil; + Properties.UnlinkLookupGridControlParent +end; + +procedure TcxCustomLookupEditLookupData.DropDown; +begin + DisableChanging; + try + Properties.LockDataChanged; + Properties.LookupGridInitialize; + Properties.LookupGridInitEvents(GridClick, GridFocusedRowChanged, GridCloseUp); + Properties.LookupGridInitLookAndFeel(Edit.PopupControlsLookAndFeel, + Edit.ActiveStyle.Color, Edit.ActiveStyle.GetVisibleFont); + Properties.LookupGridLockMouseMove; + FVisible := True; + SyncGrid; + SyncSelected; + finally + EnableChanging; + end; +end; + +procedure TcxCustomLookupEditLookupData.DroppedDown(const AFindStr: string); +begin + Properties.LookupGridDroppedDown(AFindStr); +end; + +function TcxCustomLookupEditLookupData.Find(const AText: string): Boolean; +begin + Result := Properties.FindLookupText(AText); +end; + +function TcxCustomLookupEditLookupData.GetActiveControl: TControl; +begin + Result := Properties.GetLookupGridActiveControl; +end; + +function TcxCustomLookupEditLookupData.GetCurrentKey: TcxEditValue; +begin + Result := FCurrentKey; +end; + +function TcxCustomLookupEditLookupData.GetDisplayText(const AKey: TcxEditValue): string; +begin + Result := Properties.GetDisplayLookupText(AKey); +end; + +function TcxCustomLookupEditLookupData.GetOnCurrentKeyChanged: TNotifyEvent; +begin + Result := FOnCurrentKeyChanged; +end; + +function TcxCustomLookupEditLookupData.GetOnSelectItem: TNotifyEvent; +begin + Result := FOnSelectItem; +end; + +function TcxCustomLookupEditLookupData.GetVisualAreaPreferredSize(AMaxHeight: Integer; + AWidth: Integer = 0): TSize; +var + ARowCount: Integer; +begin + Result.cx := Properties.GetLookupGridVisualAreaPreferredWidth; + // auto correct + ARowCount := Properties.DropDownRows; + if (DataController <> nil) and (DataController.GetRowCount < ARowCount) then + ARowCount := DataController.GetRowCount; + if ARowCount < 1 then + ARowCount := 1; + Result.cy := Properties.GetLookupGridPopupHeight(ARowCount); +end; + +procedure TcxCustomLookupEditLookupData.Go(ADirection: TcxEditLookupDataGoDirection; + ACircular: Boolean); +begin + if (DataController = nil) or (DataController.RecordCount = 0) then Exit; + DisableChanging; + try + ResetIncrementalFilter; + UpdateDropDownCount; + Properties.LockDataChanged; + try + if ADirection = egdBegin then + DataController.GotoFirst + else + if ADirection = egdEnd then + DataController.GotoLast + else + begin + SyncGrid; + if ADirection in [egdNext, egdPageDown] then + begin + if ACircular and DataController.IsEOF then + DataController.GotoFirst + else + if ADirection = egdNext then + DataController.GotoNext + else + DataController.MoveBy(Properties.DropDownRows); + end + else + begin + if ACircular and DataController.IsBOF then + DataController.GotoLast + else + if ADirection = egdPrev then + DataController.GotoPrev + else + DataController.MoveBy(-Properties.DropDownRows); + end; + end; + finally + Properties.UnlockDataChanged; + end; + DoSetCurrentKey(DataController.GetFocusedRecordIndex); + DoSetKeySelection(DataController.GetFocusedRecordIndex <> -1); + DoSelectItem; + finally + EnableChanging; + end; +end; + +procedure TcxCustomLookupEditLookupData.Initialize(AVisualControlsParent: TWinControl); +begin + if Properties.GetLookupGridControl <> nil then + Properties.GetLookupGridControl.Parent := AVisualControlsParent; +end; + +function TcxCustomLookupEditLookupData.IsEmpty: Boolean; +begin + Result := (GetListIndex = -1) or (DataController = nil) or + (DataController.RecordCount = 0); +end; + +function TcxCustomLookupEditLookupData.IsMouseOverList(const P: TPoint): Boolean; +var + APoint: TPoint; +begin + if Properties.GetLookupGridControl <> nil then + begin + APoint := Properties.GetLookupGridControl.ScreenToClient(P); + Result := Properties.IsLookupGridMouseOverList(APoint); + end + else + Result := False; +end; + +function TcxCustomLookupEditLookupData.Locate(var AText, ATail: string; ANext: Boolean): Boolean; + + function SetGridFilter(AItemIndex: Integer; const AText: string): Integer; + var + APrevIncrementalFilterText: string; + begin + if AText = '' then + begin + ResetIncrementalFilter; + Result := Properties.FindByText(AItemIndex, AText, True); + end + else + begin + APrevIncrementalFilterText := DataController.GetIncrementalFilterText; + Result := DataController.SetIncrementalFilter(AItemIndex, AText); + if DataController.FilteredRecordCount = 0 then + begin + if Properties.DropDownListStyle <> lsEditList then + DataController.SetIncrementalFilter(AItemIndex, APrevIncrementalFilterText); + Result := -1; + end; + end; + UpdateDropDownCount; + end; + +var + AItemIndex, ARecordIndex: Integer; + S: string; +begin + Result := False; + DisableChanging; + try + AItemIndex := GetListIndex; + if (AItemIndex <> -1) and (DataController <> nil) then + begin + // TODO: Next + if FVisible and Properties.GetIncrementalFiltering {and (Properties.DropDownListStyle <> lsFixedList)} then + ARecordIndex := SetGridFilter(AItemIndex, AText) + else + ARecordIndex := Properties.FindByText(AItemIndex, AText, True); + if ARecordIndex <> -1 then + begin + DataController.ChangeFocusedRecordIndex(ARecordIndex); + DoSetCurrentKey(ARecordIndex); + Result := True; + S := DataController.DisplayTexts[ARecordIndex, AItemIndex]; + AText := Copy(S, 1, Length(AText)); + ATail := Copy(S, Length(AText) + 1, Length(S)); + DoSetKeySelection(True); + end + else + DoSetKeySelection(False); + end; + finally + EnableChanging; + end; +end; + +procedure TcxCustomLookupEditLookupData.PositionVisualArea(const AClientRect: TRect); +begin + if Properties.GetLookupGridControl <> nil then + begin + with AClientRect do + Properties.GetLookupGridControl.SetBounds(Left, Top, Right - Left, Bottom - Top); + Properties.GetLookupGridControl.HandleNeeded; + Properties.LookupGridMakeFocusedRowVisible; + end; +end; + +procedure TcxCustomLookupEditLookupData.PropertiesChanged; +begin +end; + +procedure TcxCustomLookupEditLookupData.SelectItem; +begin + if IsKeySelected then + begin + DoSetCurrentKey(FocusedRecordIndex); + DoSelectItem; + end; +end; + +procedure TcxCustomLookupEditLookupData.SetCurrentKey(const AKey: TcxEditValue); +begin + FCurrentKey := AKey; + SyncGrid; +end; + +procedure TcxCustomLookupEditLookupData.SetOnCurrentKeyChanged(Value: TNotifyEvent); +begin + FOnCurrentKeyChanged := Value; +end; + +procedure TcxCustomLookupEditLookupData.SetOnSelectItem(Value: TNotifyEvent); +begin + FOnSelectItem := Value; +end; + +procedure TcxCustomLookupEditLookupData.TextChanged; +begin + if Edit.CanSynchronizeLookupData then + begin + DisableChanging; + try + SyncSelected; + finally + EnableChanging; + end; + end; +end; + +// end IcxTextEditLookupData + +procedure TcxCustomLookupEditLookupData.DoCurrentKeyChanged; +begin + if Assigned(FOnCurrentKeyChanged) then + FOnCurrentKeyChanged(Self); +end; + +procedure TcxCustomLookupEditLookupData.DoSelectItem; +begin + if Assigned(FOnSelectItem) then + FOnSelectItem(Self); +end; + +procedure TcxCustomLookupEditLookupData.DoSetCurrentKey(ARecordIndex: Integer); +begin + FCurrentKey := ARecordIndex; +end; + +procedure TcxCustomLookupEditLookupData.DoSetKeySelection(AKeySelected: Boolean); +begin + if DataController <> nil then + DataController.SyncSelected(AKeySelected); +end; + +procedure TcxCustomLookupEditLookupData.DoSyncGrid; +begin + if DataController <> nil then + DataController.ChangeFocusedRecordIndex(Integer(GetCurrentKey)); +end; + +procedure TcxCustomLookupEditLookupData.GridClick(Sender: TObject); +begin + SelectItem; +end; + +procedure TcxCustomLookupEditLookupData.GridCloseUp(Sender: TObject; AAccept: Boolean); +begin + if AAccept then + Edit.CloseUp(crEnter) + else + Edit.CloseUp(crCancel) +end; + +procedure TcxCustomLookupEditLookupData.GridFocusedRowChanged(Sender: TObject); +begin + // TODO: ImmediateUpdateText +end; + +function TcxCustomLookupEditLookupData.IsKeySelected: Boolean; +begin + Result := (DataController <> nil) and (DataController.GetSelectedCount = 1) and + (DataController.GetFocusedRowIndex = DataController.GetSelectedRowIndex(0)); +end; + +function TcxCustomLookupEditLookupData.LocateText(const AText: string): Boolean; +var + AItemIndex, ARecordIndex: Integer; +begin + Result := False; + AItemIndex := GetListIndex; + if (AItemIndex <> -1) and (DataController <> nil) then + begin +// Result := InternalCompareString(AText, GetDisplayText(FCurrentKey), False); +// if Result then +// Exit; + // TODO: Search + ARecordIndex := Properties.FindByText(AItemIndex, AText, False); + if ARecordIndex <> -1 then + begin + DataController.ChangeFocusedRecordIndex(ARecordIndex); + DoSetCurrentKey(ARecordIndex); + Result := True; + DoSetKeySelection(True); + end + else + DoSetKeySelection(False); + end; +end; + +procedure TcxCustomLookupEditLookupData.ResetIncrementalFilter; +begin + if DataController <> nil then + DataController.ResetIncrementalFilter; +end; + +procedure TcxCustomLookupEditLookupData.SyncGrid; +begin + DoSyncGrid; + Properties.LookupGridMakeFocusedRowVisible; +end; + +procedure TcxCustomLookupEditLookupData.SyncSelected; +var + ASelected: Boolean; + AItemIndex: Integer; + ARecordIndex: Integer; + S: string; +begin + if Properties.FInGridDataChanged then Exit; + if FVisible and Properties.GetIncrementalFiltering then + begin + if (DataController <> nil) and DataController.ChangeIncrementalFilterText(Edit.Text) then + UpdateDropDownCount; + end; + ASelected := False; + AItemIndex := GetListIndex; + if (DataController <> nil) and (AItemIndex <> -1) then + begin + ARecordIndex := FocusedRecordIndex; + if ARecordIndex <> -1 then + begin + S := DataController.DisplayTexts[ARecordIndex, AItemIndex]; + ASelected := DataCompareText(S, Edit.Text, False); + end; + if not ASelected or not FVisible then // Properties.EditingStyle in [esEditList, esFixedList] + begin + ARecordIndex := Properties.FindByText(AItemIndex, Edit.Text, False); + if ARecordIndex <> -1 then + begin + ASelected := True; + DataController.ChangeFocusedRecordIndex(ARecordIndex); + DoSetCurrentKey(ARecordIndex); + end; + end; + end; + DoSetKeySelection(ASelected); +end; + +procedure TcxCustomLookupEditLookupData.UpdateDropDownCount; +var + AGridRowCount, ARowCount, AHeight: Integer; +begin + if not FVisible then Exit; + if Edit.PopupWindow.IsVisible and (DataController <> nil) then + begin + AGridRowCount := DataController.GetRowCount; + ARowCount := Properties.DropDownRows; + if AGridRowCount > ARowCount then + AGridRowCount := ARowCount; + if AGridRowCount < 1 then + AGridRowCount := 1; + AHeight := Properties.GetLookupGridPopupHeight(AGridRowCount); + if (Properties.GetLookupGridControl <> nil) and + (Properties.GetLookupGridControl.ClientHeight <> AHeight) then + begin + if not Edit.PopupSizeChanged then + Edit.ResetPopupHeight; + Edit.SetupPopupWindow; + end; + end; +end; + +function TcxCustomLookupEditLookupData.GetDataController: TcxCustomDataController; +begin + Result := Properties.DataController; +end; + +function TcxCustomLookupEditLookupData.GetEdit: TcxCustomLookupEdit; +begin + Result := TcxCustomLookupEdit(FOwner); +end; + +function TcxCustomLookupEditLookupData.GetFocusedRecordIndex: Integer; +begin + if DataController <> nil then + Result := DataController.GetFocusedRecordIndex + else + Result := -1; +end; + +function TcxCustomLookupEditLookupData.GetListIndex: Integer; +begin + Result := Properties.GetListIndex; +end; + +function TcxCustomLookupEditLookupData.GetProperties: TcxCustomLookupEditProperties; +begin + Result := Edit.ActiveProperties; +end; + +{ TcxCustomLookupEditProperties } + +constructor TcxCustomLookupEditProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FIncrementalFiltering := True; + DropDownHeight := 0; + DropDownWidth := 0; + DropDownListStyle := lsEditFixedList; + DropDownAutoSize := False; + DropDownSizeable := False; +end; + +procedure TcxCustomLookupEditProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomLookupEditProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + if not IsDefinedByLookup then + DisplayColumnIndex := TcxCustomLookupEditProperties(Source).DisplayColumnIndex; + ImmediateUpdateText := TcxCustomLookupEditProperties(Source).ImmediateUpdateText; + IncrementalFiltering := TcxCustomLookupEditProperties(Source).IncrementalFiltering; + finally + EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +class function TcxCustomLookupEditProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxCustomLookupEdit; +end; + +function TcxCustomLookupEditProperties.GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; +begin + if IsPickMode then + Result := evsText + else + Result := evsValue; +end; + +function TcxCustomLookupEditProperties.GetSupportedOperations: TcxEditSupportedOperations; +begin + Result := inherited GetSupportedOperations; + if GetEditValueSource(False) = evsValue then + Include(Result, esoSortingByDisplayText); +end; + +function TcxCustomLookupEditProperties.IsDefinedByLookup: Boolean; +begin + Result := IsLookupField; +end; + +function TcxCustomLookupEditProperties.IsEditValueValid(var EditValue: TcxEditValue; + AEditFocused: Boolean): Boolean; +begin + Result := True; +end; + +function TcxCustomLookupEditProperties.IsLookupField: Boolean; +begin + Result := False; +end; + +procedure TcxCustomLookupEditProperties.PrepareDisplayValue(const AEditValue: TcxEditValue; + var DisplayValue: TcxEditValue; AEditFocused: Boolean); +begin + if IsPickMode or (IsLookupField and not AEditFocused) then + inherited PrepareDisplayValue(AEditValue, DisplayValue, AEditFocused) + else + DisplayValue := GetDisplayLookupText(AEditValue); +end; + +function TcxCustomLookupEditProperties.GetLookupGridActiveControl: TWinControl; +begin + Result := GetLookupGridControl; +end; + +function TcxCustomLookupEditProperties.GetLookupGridCanResize: Boolean; +begin + Result := True; +end; + +function TcxCustomLookupEditProperties.GetLookupGridColumnCount: Integer; +begin + Result := 0; +end; + +function TcxCustomLookupEditProperties.GetLookupGridControl: TWinControl; +begin + Result := nil; +end; + +function TcxCustomLookupEditProperties.GetLookupGridDataController: TcxCustomDataController; +begin + Result := nil; +end; + +function TcxCustomLookupEditProperties.GetLookupGridVisualAreaPreferredWidth: Integer; +begin + Result := 0; +end; + +function TcxCustomLookupEditProperties.GetLookupGridNearestPopupHeight( + AHeight: Integer): Integer; +begin + Result := AHeight; +end; + +function TcxCustomLookupEditProperties.GetLookupGridPopupHeight(ADropDownRowCount: Integer): Integer; +begin + Result := 0; +end; + +function TcxCustomLookupEditProperties.IsLookupGridMouseOverList(const P: TPoint): Boolean; +begin + Result := False; +end; + +procedure TcxCustomLookupEditProperties.LookupGridDeinitialize; +begin +end; + +procedure TcxCustomLookupEditProperties.LookupGridDroppedDown(const AFindStr: string); +begin +end; + +procedure TcxCustomLookupEditProperties.LookupGridInitEvents(AOnClick, AOnFocusedRowChanged: TNotifyEvent; + AOnCloseUp: TcxLookupGridCloseUpEvent); +begin +end; + +procedure TcxCustomLookupEditProperties.LookupGridInitialize; +begin +end; + +procedure TcxCustomLookupEditProperties.LookupGridInitLookAndFeel(ALookAndFeel: TcxLookAndFeel; + AColor: TColor; AFont: TFont); +begin +end; + +procedure TcxCustomLookupEditProperties.LookupGridLockMouseMove; +begin +end; + +procedure TcxCustomLookupEditProperties.LookupGridMakeFocusedRowVisible; +begin +end; + +procedure TcxCustomLookupEditProperties.LookupGridUnlockMouseMove; +begin +end; + +procedure TcxCustomLookupEditProperties.CheckDisplayColumnIndex; +begin + if FDisplayColumnIndex >= GetLookupGridColumnCount then + DisplayColumnIndex := GetLookupGridColumnCount - 1; +end; + +procedure TcxCustomLookupEditProperties.DeinitializeDataController; +begin + if DataController <> nil then + DataController.RemoveDataChangedListener(Self, GridDataChanged); +end; + +function TcxCustomLookupEditProperties.FindByText(AItemIndex: Integer; + const AText: string; APartialCompare: Boolean): Integer; +begin + Result := DataController.FindRecordIndexByText(0, AItemIndex, AText, APartialCompare, False, True); +end; + +function TcxCustomLookupEditProperties.FindLookupText(const AText: string): Boolean; +var + AItemIndex: Integer; +begin + AItemIndex := GetListIndex; + Result := (AItemIndex <> -1) and (DataController <> nil) and + (FindByText(AItemIndex, AText, False) <> -1); +end; + +function TcxCustomLookupEditProperties.GetDisplayColumnIndex: Integer; +begin + Result := FDisplayColumnIndex; +end; + +function TcxCustomLookupEditProperties.GetDisplayFormatOptions: TcxEditDisplayFormatOptions; +begin + Result := []; +end; + +function TcxCustomLookupEditProperties.GetDisplayLookupText(const AKey: TcxEditValue): string; +begin + Result := ''; +end; + +function TcxCustomLookupEditProperties.GetIncrementalFiltering: Boolean; +begin + Result := IncrementalFiltering; +end; + +function TcxCustomLookupEditProperties.GetListIndex: Integer; +begin + Result := DisplayColumnIndex; + if Result >= GetLookupGridColumnCount then + Result := GetLookupGridColumnCount - 1; +end; + +class function TcxCustomLookupEditProperties.GetLookupDataClass: TcxInterfacedPersistentClass; +begin + Result := TcxCustomLookupEditLookupData; +end; + +function TcxCustomLookupEditProperties.GetNullKey: Variant; +begin + Result := Null; +end; + +procedure TcxCustomLookupEditProperties.GridDataChanged(Sender: TObject); +begin + if FInGridDataChanged or IsChangeLocked then Exit; + if IsDataChangedPostponed then Exit; + FInGridDataChanged := True; + try + Changed; + finally + FInGridDataChanged := False; + end; +end; + +procedure TcxCustomLookupEditProperties.InitializeDataController; +begin + if DataController <> nil then + DataController.AddDataChangedListener(Self, GridDataChanged); +end; + +function TcxCustomLookupEditProperties.IsChangeLocked: Boolean; +begin + Result := FLockCount <> 0; +end; + +function TcxCustomLookupEditProperties.IsDataChangedPostponed: Boolean; +begin + Result := (DataController <> nil) and DataController.DataChangedNotifyLocked; +end; + +function TcxCustomLookupEditProperties.IsEditValueConversionDependOnFocused: Boolean; +begin + Result := False; +end; + +function TcxCustomLookupEditProperties.IsPickMode: Boolean; +begin + Result := False; +end; + +function TcxCustomLookupEditProperties.IsPopupKey(Key: Word; Shift: TShiftState): Boolean; +begin + case Key of + VK_UP, VK_DOWN, VK_PRIOR, VK_NEXT: + Result := not (ssAlt in Shift); + VK_HOME, VK_END: + Result := ssCtrl in Shift; + else + Result := False; + end; +end; + +procedure TcxCustomLookupEditProperties.LockDataChanged; +begin + if DataController <> nil then + DataController.LockDataChangedNotify; +end; + +procedure TcxCustomLookupEditProperties.SetDisplayColumnIndex(Value: Integer); +begin + if Value >= GetLookupGridColumnCount then Value := GetLookupGridColumnCount - 1; + if Value < 0 then Value := 0; + if FDisplayColumnIndex <> Value then + begin + FDisplayColumnIndex := Value; + Changed; + end; +end; + +procedure TcxCustomLookupEditProperties.UnlockDataChanged; +begin + if DataController <> nil then + DataController.UnlockDataChangedNotify; +end; + +procedure TcxCustomLookupEditProperties.UnlinkLookupGridControlParent; +begin + if GetLookupGridControl <> nil then + GetLookupGridControl.Parent := nil; +end; + +function TcxCustomLookupEditProperties.GetDataController: TcxCustomDataController; +begin + Result := GetLookupGridDataController; +end; + +function TcxCustomLookupEditProperties.GetDropDownAutoSize: Boolean; +begin + Result := inherited PopupAutoSize; +end; + +function TcxCustomLookupEditProperties.GetDropDownHeight: Integer; +begin + Result := inherited PopupHeight; +end; + +function TcxCustomLookupEditProperties.GetDropDownSizeable: Boolean; +begin + Result := inherited PopupSizeable; +end; + +function TcxCustomLookupEditProperties.GetDropDownWidth: Integer; +begin + Result := inherited PopupWidth; +end; + +procedure TcxCustomLookupEditProperties.SetDropDownAutoSize(Value: Boolean); +begin + inherited PopupAutoSize := Value; +end; + +procedure TcxCustomLookupEditProperties.SetDropDownHeight(Value: Integer); +begin + inherited PopupHeight := Value; +end; + +procedure TcxCustomLookupEditProperties.SetDropDownSizeable(Value: Boolean); +begin + inherited PopupSizeable := Value; +end; + +procedure TcxCustomLookupEditProperties.SetDropDownWidth(Value: Integer); +begin + inherited PopupWidth := Value; +end; + +{ TcxCustomLookupEdit } + +class function TcxCustomLookupEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomLookupEditProperties; +end; + +procedure TcxCustomLookupEdit.PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); +begin + if ActiveProperties.IsPickMode then + EditValue := ADisplayValue + else + if ILookupData.GetDisplayText(ILookupData.CurrentKey) = ADisplayValue then + EditValue := ILookupData.CurrentKey + else + if LookupData.LocateText(ADisplayValue) then + EditValue := ILookupData.CurrentKey + else + EditValue := ActiveProperties.GetNullKey; +end; + +procedure TcxCustomLookupEdit.AfterPosting; +begin + inherited AfterPosting; + LookupData.EnableChanging; +end; + +procedure TcxCustomLookupEdit.BeforePosting; +begin + LookupData.DisableChanging; + inherited BeforePosting; +end; + +procedure TcxCustomLookupEdit.DoShowEdit; +begin + inherited DoShowEdit; + ILookupData.TextChanged; +end; + +procedure TcxCustomLookupEdit.DropDown; +begin + inherited DropDown; + ILookupData.CurrentKey := EditValue; +end; + +procedure TcxCustomLookupEdit.Initialize; +begin + inherited Initialize; + Width := 145; +end; + +function TcxCustomLookupEdit.InternalGetEditingValue: TcxEditValue; +begin + PrepareEditValue(Text, Result, InternalFocused); +end; + +function TcxCustomLookupEdit.NeedResetInvalidTextWhenPropertiesChanged: Boolean; +begin + Result := False; +end; + +procedure TcxCustomLookupEdit.RepositoryItemAssigning; +begin + TcxCustomLookupEditProperties(ActiveProperties).UnlinkLookupGridControlParent; +end; + +procedure TcxCustomLookupEdit.SynchronizeDisplayValue; +begin + inherited SynchronizeDisplayValue; + if HasPopupWindow then + ILookupData.CurrentKey := EditValue; +end; + +function TcxCustomLookupEdit.GetILookupData: IcxTextEditLookupData; +begin + Result := FLookupData as IcxTextEditLookupData; +end; + +function TcxCustomLookupEdit.GetLookupData: TcxCustomLookupEditLookupData; +begin + Result := TcxCustomLookupEditLookupData(FLookupData); +end; + +function TcxCustomLookupEdit.GetProperties: TcxCustomLookupEditProperties; +begin + Result := TcxCustomLookupEditProperties(FProperties); +end; + +function TcxCustomLookupEdit.GetActiveProperties: TcxCustomLookupEditProperties; +begin + Result := TcxCustomLookupEditProperties(InternalGetActiveProperties); +end; + +procedure TcxCustomLookupEdit.SetLookupData(Value: TcxCustomLookupEditLookupData); +begin + FLookupData.Assign(Value); +end; + +procedure TcxCustomLookupEdit.SetProperties(Value: TcxCustomLookupEditProperties); +begin + FProperties.Assign(Value); +end; + +end. + diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxLookupGrid.pas b/official/x.35/ExpressEditors Library 5/Sources/cxLookupGrid.pas new file mode 100644 index 00000000..246efef5 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxLookupGrid.pas @@ -0,0 +1,2710 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxLookupGrid; + +{$I cxVer.inc} + +interface + +uses + Windows, + SysUtils, Classes, Controls, Graphics, Forms, StdCtrls, + cxClasses, cxControls, cxContainer, cxGraphics, cxLookAndFeels, cxLookAndFeelPainters, + cxDataUtils, cxDataStorage, cxCustomData, cxData, cxEdit, cxEditRepositoryItems; + +const + cxLookupGridColumnDefaultMinWidth = 20; + // TODO: Common +// cxGridCellTextOffset = 2; // ? + cxGridEditOffset = 1; + +type + TcxCustomLookupGrid = class; + TcxLookupGridColumn = class; + + TcxLookupGridHitTest = (htNone, htHeader, htCell); + TcxLookupGridScrollMode = (smNone, smTop, smBottom); + + { TcxLookupGridDataController } + + TcxLookupGridDataController = class(TcxDataController) + private + function GetGrid: TcxCustomLookupGrid; + public + function GetItem(Index: Integer): TObject; override; + property Grid: TcxCustomLookupGrid read GetGrid; + published + property OnCompare; + end; + + { TcxLookupGridViewInfo } + + TcxLookupGridPartViewInfo = class + Bounds: TRect; + ContentBounds: TRect; + end; + + // Columns + + TcxLookupGridColumnViewInfo = class(TcxLookupGridPartViewInfo) + private + FEditViewData: TcxCustomEditViewData; + FStyle: TcxCustomEditStyle; + public + Alignment: TAlignment; + Borders: TcxBorders; + Neighbors: TcxNeighbors; + SortOrder: TcxDataSortOrder; + Text: string; + destructor Destroy; override; + function CreateEditStyle(AProperties: TcxCustomEditProperties): TcxCustomEditStyle; + function CreateEditViewData(AProperties: TcxCustomEditProperties): TcxCustomEditViewData; + procedure DestroyEditViewData; + property Style: TcxCustomEditStyle read FStyle; + end; + + TcxLookupGridColumnsViewInfo = class(TcxObjectList) + private + function GetItem(Index: Integer): TcxLookupGridColumnViewInfo; + public + property Items[Index: Integer]: TcxLookupGridColumnViewInfo read GetItem; default; + end; + + // rows + + TcxLookupGridCellViewInfo = class(TcxLookupGridPartViewInfo) + private + FEditViewInfo: TcxCustomEditViewInfo; + public + Borders: TcxBorders; + Index: Integer; + IsFocused: Boolean; + destructor Destroy; override; + function CreateEditViewInfo(AProperties: TcxCustomEditProperties): TcxCustomEditViewInfo; + property EditViewInfo: TcxCustomEditViewInfo read FEditViewInfo; + end; + + TcxLookupGridRowViewInfo = class(TcxObjectList) + private + function GetItem(Index: Integer): TcxLookupGridCellViewInfo; + protected + function AddCell(AIndex: Integer; const AInitBounds: TRect; AIsFocused: Boolean): TcxLookupGridCellViewInfo; + public + Borders: TcxBorders; + Bounds: TRect; + ContentBounds: TRect; + IsFocused: Boolean; + RecordIndex: Integer; + RowIndex: Integer; + property Items[Index: Integer]: TcxLookupGridCellViewInfo read GetItem; default; + end; + + TcxLookupGridRowsViewInfo = class(TcxObjectList) + private + function GetItem(Index: Integer): TcxLookupGridRowViewInfo; + public + function FindByRowIndex(ARowIndex: Integer): TcxLookupGridRowViewInfo; + property Items[Index: Integer]: TcxLookupGridRowViewInfo read GetItem; default; + end; + + TcxLookupGridTopRowIndexCalculation = (ticNone, ticForward, ticBackward); + + TcxLookupGridViewInfo = class + private + FColumns: TcxLookupGridColumnsViewInfo; + FGrid: TcxCustomLookupGrid; + FInternalTopRowIndex: Integer; + FTopRowIndexCalculation: TcxLookupGridTopRowIndexCalculation; + FRowMinHeight: Integer; + FRows: TcxLookupGridRowsViewInfo; + function GetBounds: TRect; + function GetCanvas: TcxCanvas; + function GetClientBounds: TRect; + function GetEmptyAreaColor: TColor; + function GetGridLines: TcxGridLines; + function GetRowCount: Integer; + function GetRowHeight: Integer; + function GetTopRowIndex: Integer; + protected + function AddRow(ARowIndex: Integer; const AInitBounds: TRect): TcxLookupGridRowViewInfo; + function CalcCellMinHeight(AIndex: Integer): Integer; + function CalcRowMinHeight: Integer; + procedure CalculateCells(ARowViewInfo: TcxLookupGridRowViewInfo); + function GetCellHeight(ARowIndex, AColumnIndex: Integer): Integer; + function GetHeaderHeight: Integer; virtual; + property TopRowIndexCalculation: TcxLookupGridTopRowIndexCalculation read FTopRowIndexCalculation write FTopRowIndexCalculation; + public + BorderSize: Integer; + HeadersRect: TRect; + EmptyRectBottom, EmptyRectRight: TRect; + PartialVisibleRowCount, VisibleRowCount: Integer; + RowsRect: TRect; + VisibleRowsRect: TRect; + constructor Create(AGrid: TcxCustomLookupGrid); virtual; + destructor Destroy; override; + procedure CalcCellColors(ARowIsSelected, ACellIsSelected: Boolean; var AColor, AFontColor: TColor); + procedure CalcColumns; virtual; + procedure CalcEmptyAreas; virtual; + procedure CalcHeaders; virtual; + procedure CalcRows; virtual; + procedure Calculate; virtual; + function CheckTopRowIndex(ANewTopIndex: Integer): Integer; virtual; + procedure CreateEditStyle(AColumnViewInfo: TcxLookupGridColumnViewInfo; AColumn: TcxLookupGridColumn); virtual; + function CreateEditViewData(AColumnViewInfo: TcxLookupGridColumnViewInfo; AColumn: TcxLookupGridColumn): TcxCustomEditViewData; virtual; + procedure DestroyEditViewData(AColumnViewInfo: TcxLookupGridColumnViewInfo; AColumn: TcxLookupGridColumn); virtual; + function GetContentColor: TColor; virtual; + function GetContentFont: TFont; virtual; + function GetContentFontColor: TColor; virtual; + function GetGridColor: TColor; virtual; + function GetGridLineWidth: Integer; virtual; + function GetHeaderColor: TColor; virtual; + function GetHeaderFont: TFont; virtual; + function GetHeaderFontColor: TColor; virtual; + function GetSelectedColor: TColor; virtual; + function GetSelectedFontColor: TColor; virtual; + + property Bounds: TRect read GetBounds; + property Canvas: TcxCanvas read GetCanvas; + property ClientBounds: TRect read GetClientBounds; + property Columns: TcxLookupGridColumnsViewInfo read FColumns; + property EmptyAreaColor: TColor read GetEmptyAreaColor; + property Grid: TcxCustomLookupGrid read FGrid; + property GridLines: TcxGridLines read GetGridLines; + property GridLineWidth: Integer read GetGridLineWidth; + property RowCount: Integer read GetRowCount; + property RowHeight: Integer read GetRowHeight; + property Rows: TcxLookupGridRowsViewInfo read FRows; + property TopRowIndex: Integer read GetTopRowIndex; + end; + + TcxLookupGridViewInfoClass = class of TcxLookupGridViewInfo; + + { TcxLookupGridPainter } + + TcxLookupGridPainter = class + private + FCanvas: TcxCanvas; + FGrid: TcxCustomLookupGrid; + FLFPainterClass: TcxCustomLookAndFeelPainterClass; + function GetCanvas: TcxCanvas; + function GetViewInfo: TcxLookupGridViewInfo; + protected + procedure DrawBorder; virtual; + procedure DrawCell(ACellViewInfo: TcxLookupGridCellViewInfo); virtual; + procedure DrawContent; virtual; + procedure DrawEmptyArea; virtual; + procedure DrawHeaders; virtual; + procedure DrawRow(ARowViewInfo: TcxLookupGridRowViewInfo); virtual; + procedure DrawRows; virtual; + property ViewInfo: TcxLookupGridViewInfo read GetViewInfo; + public + constructor Create(AGrid: TcxCustomLookupGrid); virtual; + destructor Destroy; override; + procedure Invalidate; + procedure Paint; + property Canvas: TcxCanvas read GetCanvas; + property Grid: TcxCustomLookupGrid read FGrid; + property LFPainterClass: TcxCustomLookAndFeelPainterClass read FLFPainterClass write FLFPainterClass; + end; + + TcxLookupGridPainterClass = class of TcxLookupGridPainter; + + { TcxLookupGridColumn } + + TcxLookupGridDefaultValuesProvider = class(TcxCustomEditDefaultValuesProvider) + function IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean; override; + end; + + TcxLookupGridColumn = class(TCollectionItem, IUnknown, + IcxEditRepositoryItemListener) + private + FCaption: string; + FDefaultValuesProvider: TcxCustomEditDefaultValuesProvider; + FHeaderAlignment: TAlignment; + FInternalDefaultRepositoryItem: TcxEditRepositoryItem; + FIsCaptionAssigned: Boolean; + FIsWidthAssigned: Boolean; + FMinWidth: Integer; + FFixed: Boolean; + FSorting: Boolean; + FRepositoryItem: TcxEditRepositoryItem; + FWidth: Integer; + function GetCaption: string; + function GetDataController: TcxCustomDataController; + function GetGrid: TcxCustomLookupGrid; + function GetMinWidth: Integer; + function GetProperties: TcxCustomEditProperties; + function GetSortOrder: TcxDataSortOrder; + function GetWidth: Integer; + function IsCaptionStored: Boolean; + function IsWidthStored: Boolean; + procedure SetCaption(const Value: string); + procedure SetFixed(Value: Boolean); + procedure SetHeaderAlignment(Value: TAlignment); + procedure SetMinWidth(Value: Integer); + procedure SetRepositoryItem(Value: TcxEditRepositoryItem); + procedure SetSorting(Value: Boolean); + procedure SetSortOrder(Value: TcxDataSortOrder); + procedure SetWidth(Value: Integer); + protected + // IUnknown + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + // IcxEditRepositoryItemListener + procedure ItemRemoved(Sender: TcxEditRepositoryItem); + procedure PropertiesChanged(Sender: TcxEditRepositoryItem); + // base + procedure CheckWidthValue(var Value: Integer); virtual; + function GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; virtual; + function GetValueTypeClass: TcxValueTypeClass; virtual; + procedure SetIndex(Value: Integer); override; + procedure SetValueTypeClass(Value: TcxValueTypeClass); virtual; + property DataController: TcxCustomDataController read GetDataController; + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; virtual; + function DefaultRepositoryItem: TcxEditRepositoryItem; virtual; + function DefaultWidth: Integer; virtual; + function GetContentFont: TFont; virtual; + function GetInternalDefaultRepositoryItem: TcxEditRepositoryItem; virtual; + function GetRepositoryItem: TcxEditRepositoryItem; virtual; + function IsLeft: Boolean; virtual; + function IsRight: Boolean; virtual; + procedure RestoreDefaults; virtual; + property DefaultValuesProvider: TcxCustomEditDefaultValuesProvider read FDefaultValuesProvider; + property Properties: TcxCustomEditProperties read GetProperties; + property Grid: TcxCustomLookupGrid read GetGrid; + property ValueTypeClass: TcxValueTypeClass read GetValueTypeClass write SetValueTypeClass; + published + property Caption: string read GetCaption write SetCaption stored IsCaptionStored; + property Fixed: Boolean read FFixed write SetFixed default False; + property HeaderAlignment: TAlignment read FHeaderAlignment write SetHeaderAlignment default taLeftJustify; + property MinWidth: Integer read GetMinWidth write SetMinWidth default cxLookupGridColumnDefaultMinWidth; + property Sorting: Boolean read FSorting write SetSorting default True; + property SortOrder: TcxDataSortOrder read GetSortOrder write SetSortOrder default soNone; + property RepositoryItem: TcxEditRepositoryItem read FRepositoryItem write SetRepositoryItem; + property Width: Integer read GetWidth write SetWidth stored IsWidthStored; + end; + + TcxLookupGridColumnClass = class of TcxLookupGridColumn; + + { TcxLookupGridColumns } + + TcxLookupGridColumns = class(TCollection) + private + FGrid: TcxCustomLookupGrid; + function GetColumn(Index: Integer): TcxLookupGridColumn; + procedure SetColumn(Index: Integer; Value: TcxLookupGridColumn); + protected + function GetOwner: TPersistent; override; + procedure Update(Item: TCollectionItem); override; + public + constructor Create(AGrid: TcxCustomLookupGrid; AColumnClass: TcxLookupGridColumnClass); virtual; + function Add: TcxLookupGridColumn; + procedure BeginUpdate; override; + procedure EndUpdate; override; + procedure RestoreDefaults; virtual; + property Grid: TcxCustomLookupGrid read FGrid; + property Items[Index: Integer]: TcxLookupGridColumn read GetColumn write SetColumn; default; + end; + + TcxLookupGridColumnsClass = class of TcxLookupGridColumns; + + { TcxCustomLookupGrid } + + TcxLookupGridChange = (lgcLayout, lgcData, lgcFocusedRow); + TcxLookupGridChanges = set of TcxLookupGridChange; + + TcxLookupGridHitInfo = record + HitTest: TcxLookupGridHitTest; + RowIndex: Integer; + ColumnIndex: Integer; + end; + + TcxLookupGridOptions = class(TPersistent) + private + FColumnSorting: Boolean; + FFocusRowOnMouseMove: Boolean; + FGridLines: TcxGridLines; + FRowSelect: Boolean; + FShowHeader: Boolean; + FOnChanged: TNotifyEvent; + function GetAnsiSort: Boolean; + function GetCaseInsensitive: Boolean; + procedure SetAnsiSort(Value: Boolean); + procedure SetCaseInsensitive(Value: Boolean); + procedure SetGridLines(Value: TcxGridLines); + procedure SetRowSelect(Value: Boolean); + procedure SetShowHeader(Value: Boolean); + protected + FGrid: TcxCustomLookupGrid; + procedure Changed; virtual; + public + constructor Create(AGrid: TcxCustomLookupGrid); virtual; + procedure Assign(Source: TPersistent); override; + property Grid: TcxCustomLookupGrid read FGrid; + property OnChanged: TNotifyEvent read FOnChanged write FOnChanged; + published + property AnsiSort: Boolean read GetAnsiSort write SetAnsiSort default False; + property CaseInsensitive: Boolean read GetCaseInsensitive write SetCaseInsensitive default False; + property ColumnSorting: Boolean read FColumnSorting write FColumnSorting default True; + property FocusRowOnMouseMove: Boolean read FFocusRowOnMouseMove + write FFocusRowOnMouseMove default True; + property GridLines: TcxGridLines read FGridLines write SetGridLines default glBoth; + property RowSelect: Boolean read FRowSelect write SetRowSelect default True; + property ShowHeader: Boolean read FShowHeader write SetShowHeader default True; + end; + + TcxLookupGridOptionsClass = class of TcxLookupGridOptions; + + TcxLookupGridCloseUpEvent = procedure (Sender: TObject; AAccept: Boolean) of object; + + TcxCustomLookupGrid = class(TcxControl) + private + FChanges: TcxLookupGridChanges; + FColumns: TcxLookupGridColumns; + FFocusedColumn: TcxLookupGridColumn; + FIsPopupControl: Boolean; + FLockCount: Integer; + FPainter: TcxLookupGridPainter; + FRowPressed: Boolean; + FScrollMode: TcxLookupGridScrollMode; + FScrollTimer: TcxTimer; + FTopRowIndex: Integer; + FViewInfo: TcxLookupGridViewInfo; + FOnClick: TNotifyEvent; + FOnCloseUp: TcxLookupGridCloseUpEvent; + FOnDataChanged: TNotifyEvent; + FOnFocusedRowChanged: TNotifyEvent; + procedure CreateScrollTimer; + procedure DestroyScrollTimer; + function GetDataController: TcxCustomDataController; + function GetFocusedColumn: TcxLookupGridColumn; + function GetFocusedColumnIndex: Integer; + function GetFocusedRowIndex: Integer; + function GetRowCount: Integer; + procedure SetColumns(Value: TcxLookupGridColumns); + procedure SetDataController(Value: TcxCustomDataController); + procedure SetFocusedColumn(Value: TcxLookupGridColumn); + procedure SetFocusedColumnIndex(Value: Integer); + procedure SetFocusedRowIndex(Value: Integer); + procedure SetIsPopupControl(Value: Boolean); + procedure SetOptions(Value: TcxLookupGridOptions); + procedure SetTopRowIndex(Value: Integer); + procedure ScrollTimerHandler(Sender: TObject); + protected + FDataController: TcxCustomDataController; + FOptions: TcxLookupGridOptions; + procedure ColorChanged; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure Loaded; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure Paint; override; + function AllowDragAndDropWithoutFocus: Boolean; override; + procedure BoundsChanged; override; + procedure DoCancelMode; override; + procedure FocusChanged; override; + procedure FontChanged; override; + function GetBorderSize: Integer; override; + procedure InitControl; override; + procedure InitScrollBarsParameters; override; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); override; + + procedure AddColumn(AColumn: TcxLookupGridColumn); virtual; + procedure Change(AChanges: TcxLookupGridChanges); virtual; + procedure CheckChanges; + procedure CheckSetTopRowIndex(var Value: Integer); + procedure CheckTopRowIndex(ATopRowIndex: Integer; ANotUpdate: Boolean); + procedure CreateHandlers; virtual; + procedure CreateSubClasses; virtual; + procedure DestroyHandlers; virtual; + procedure DestroySubClasses; virtual; + procedure DoCellClick(ARowIndex, AColumnIndex: Integer; AShift: TShiftState); virtual; + procedure DoHeaderClick(AColumnIndex: Integer; AShift: TShiftState); virtual; + procedure FocusColumn(AColumnIndex: Integer); + procedure FocusNextPage; + procedure FocusNextRow(AGoForward: Boolean); + procedure FocusPriorPage; + function GetColumnClass: TcxLookupGridColumnClass; virtual; + function GetColumnsClass: TcxLookupGridColumnsClass; virtual; + function GetDataControllerClass: TcxCustomDataControllerClass; virtual; + function GetLFPainterClass: TcxCustomLookAndFeelPainterClass; virtual; + function GetOptionsClass: TcxLookupGridOptionsClass; virtual; + function GetPainterClass: TcxLookupGridPainterClass; virtual; + function GetScrollBarOffsetBegin: Integer; virtual; + function GetScrollBarOffsetEnd: Integer; virtual; + function GetViewInfoClass: TcxLookupGridViewInfoClass; virtual; + function IsHotTrack: Boolean; virtual; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); override; + procedure RemoveColumn(AColumn: TcxLookupGridColumn); virtual; + procedure SetScrollMode(Value: TcxLookupGridScrollMode); virtual; + procedure ShowNextPage; + procedure ShowPrevPage; + procedure UpdateFocusing; virtual; + procedure UpdateRowInfo(ARowIndex: Integer; ARecalculate: Boolean); virtual; + procedure UpdateLayout; virtual; + + // Data Controller Notifications + procedure DataChanged; virtual; + procedure DataLayoutChanged; virtual; + procedure DoClick; virtual; + procedure DoCloseUp(AAccept: Boolean); virtual; + procedure DoFocusedRowChanged; virtual; + procedure FocusedRowChanged(APrevFocusedRowIndex, AFocusedRowIndex: Integer); virtual; + procedure LayoutChanged; virtual; + procedure SelectionChanged(AInfo: TcxSelectionChangedInfo); virtual; + procedure UpdateControl(AInfo: TcxUpdateControlInfo); virtual; + + property Color default clWindow; + property ParentColor default False; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure BeginUpdate; + procedure CancelUpdate; + procedure EndUpdate; + function GetHitInfo(P: TPoint): TcxLookupGridHitInfo; + function GetNearestPopupHeight(AHeight: Integer): Integer; + function GetPopupHeight(ADropDownRowCount: Integer): Integer; + function IsMouseOverList(const P: TPoint): Boolean; + function IsRowVisible(ARowIndex: Integer): Boolean; + procedure LockPopupMouseMove; + procedure MakeFocusedRowVisible; + procedure MakeRowVisible(ARowIndex: Integer); + procedure SyncSelected(ASelected: Boolean); virtual; + + property Columns: TcxLookupGridColumns read FColumns write SetColumns; + property DataController: TcxCustomDataController read GetDataController write SetDataController; + property FocusedColumn: TcxLookupGridColumn read GetFocusedColumn write SetFocusedColumn; + property FocusedColumnIndex: Integer read GetFocusedColumnIndex write SetFocusedColumnIndex; + property FocusedRowIndex: Integer read GetFocusedRowIndex write SetFocusedRowIndex; + property IsPopupControl: Boolean read FIsPopupControl write SetIsPopupControl; + property LockCount: Integer read FLockCount; + property LookAndFeel; + property Options: TcxLookupGridOptions read FOptions write SetOptions; + property Painter: TcxLookupGridPainter read FPainter; + property RowCount: Integer read GetRowCount; + property ScrollBarOffsetBegin: Integer read GetScrollBarOffsetBegin; + property ScrollBarOffsetEnd: Integer read GetScrollBarOffsetEnd; + property TopRowIndex: Integer read FTopRowIndex write SetTopRowIndex; + property ViewInfo: TcxLookupGridViewInfo read FViewInfo; + property OnClick: TNotifyEvent read FOnClick write FOnClick; + property OnCloseUp: TcxLookupGridCloseUpEvent read FOnCloseUp write FOnCloseUp; + property OnDataChanged: TNotifyEvent read FOnDataChanged write FOnDataChanged; + property OnFocusedRowChanged: TNotifyEvent read FOnFocusedRowChanged write FOnFocusedRowChanged; + end; + + TcxCustomLookupGridClass = class of TcxCustomLookupGrid; + + { TcxLookupGrid } + + TcxLookupGrid = class(TcxCustomLookupGrid) + published + property Align; + property Anchors; + property Color; + property Font; + property ParentFont; + property Visible; + + property Columns; + property DataController; + property Options; + property LookAndFeel; + end; + +implementation + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + cxEditRegisteredRepositoryItems, cxEditDataRegisteredRepositoryItems; + +const + ScrollTimerInterval = 50; +var + FPrevMousePos: TPoint; + +function PtInWidth(const R: TRect; P: TPoint): Boolean; +begin + Result := (R.Left <= P.X) and (P.X < R.Right) +end; + +{ TcxLookupGridColumnViewInfo } + +destructor TcxLookupGridColumnViewInfo.Destroy; +begin + FreeAndNil(FStyle); + inherited Destroy; +end; + +function TcxLookupGridColumnViewInfo.CreateEditStyle(AProperties: TcxCustomEditProperties): TcxCustomEditStyle; +begin + FStyle := AProperties.GetStyleClass.Create(nil, True) as TcxCustomEditStyle; + FStyle.ButtonTransparency := ebtHideInactive; + Result := FStyle; +end; + +function TcxLookupGridColumnViewInfo.CreateEditViewData(AProperties: TcxCustomEditProperties): TcxCustomEditViewData; +begin + FEditViewData := AProperties.CreateViewData(FStyle, True); + Result := FEditViewData; +end; + +procedure TcxLookupGridColumnViewInfo.DestroyEditViewData; +begin + FreeAndNil(FEditViewData); +end; + +{ TcxLookupGridColumnsViewInfo } + +function TcxLookupGridColumnsViewInfo.GetItem(Index: Integer): TcxLookupGridColumnViewInfo; +begin + Result := TcxLookupGridColumnViewInfo(inherited Items[Index]); +end; + +{ TcxLookupGridCellViewInfo } + +destructor TcxLookupGridCellViewInfo.Destroy; +begin + FreeAndNil(FEditViewInfo); + inherited Destroy; +end; + +function TcxLookupGridCellViewInfo.CreateEditViewInfo(AProperties: TcxCustomEditProperties): TcxCustomEditViewInfo; +begin + if FEditViewInfo <> nil then FEditViewInfo.Free; + FEditViewInfo := AProperties.GetViewInfoClass.Create as TcxCustomEditViewInfo; + Result := FEditViewInfo; +end; + +{ TcxLookupGridRowViewInfo } + +function TcxLookupGridRowViewInfo.AddCell(AIndex: Integer; const AInitBounds: TRect; + AIsFocused: Boolean): TcxLookupGridCellViewInfo; +begin + Result := TcxLookupGridCellViewInfo.Create; + Add(Result); + Result.Index := AIndex; + Result.IsFocused := AIsFocused; + Result.Bounds := AInitBounds; +end; + +function TcxLookupGridRowViewInfo.GetItem(Index: Integer): TcxLookupGridCellViewInfo; +begin + Result := TcxLookupGridCellViewInfo(inherited Items[Index]); +end; + +{ TcxLookupGridRowsViewInfo } + +function TcxLookupGridRowsViewInfo.FindByRowIndex(ARowIndex: Integer): TcxLookupGridRowViewInfo; +var + I: Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + if Items[I].RowIndex = ARowIndex then + begin + Result := Items[I]; + Break; + end; +end; + +function TcxLookupGridRowsViewInfo.GetItem(Index: Integer): TcxLookupGridRowViewInfo; +begin + Result := TcxLookupGridRowViewInfo(inherited Items[Index]); +end; + +{ TcxLookupGridViewInfo } + +constructor TcxLookupGridViewInfo.Create(AGrid: TcxCustomLookupGrid); +begin + inherited Create; + FGrid := AGrid; + FColumns := TcxLookupGridColumnsViewInfo.Create; + FRows := TcxLookupGridRowsViewInfo.Create; +end; + +destructor TcxLookupGridViewInfo.Destroy; +begin + FRows.Free; + FColumns.Free; + inherited Destroy; +end; + +procedure TcxLookupGridViewInfo.CalcHeaders; + + procedure CreateItems; + var + I: Integer; + AItem: TcxLookupGridColumnViewInfo; + begin + for I := 0 to Grid.Columns.Count - 1 do + begin + AItem := TcxLookupGridColumnViewInfo.Create; + with AItem do + begin + Alignment := Grid.Columns[I].HeaderAlignment; + Neighbors := []; + if not Grid.Columns[I].IsLeft then + Neighbors := Neighbors + [nLeft]; + if not Grid.Columns[I].IsRight then + Neighbors := Neighbors + [nRight]; + Borders := Grid.Painter.LFPainterClass.HeaderBorders(Neighbors); + SortOrder := Grid.Columns[I].SortOrder; + Text := Grid.Columns[I].Caption; + end; + CreateEditStyle(AItem, Grid.Columns[I]); + FColumns.Add(AItem); + end; + end; + + procedure CalcBounds; + var + I, ALeft: Integer; + AAutoWidthObject: TcxAutoWidthObject; + AItem: TcxLookupGridColumnViewInfo; + begin + AAutoWidthObject := TcxAutoWidthObject.Create(Grid.Columns.Count); + try + for I := 0 to Grid.Columns.Count - 1 do + begin + with AAutoWidthObject.AddItem do + begin + MinWidth := Grid.Columns[I].MinWidth; + Width := Grid.Columns[I].Width; + Fixed := Grid.Columns[I].Fixed; + end; + end; + AAutoWidthObject.AvailableWidth := HeadersRect.Right - HeadersRect.Left; + AAutoWidthObject.Calculate; + ALeft := HeadersRect.Left; + for I := 0 to Grid.Columns.Count - 1 do + begin + AItem := Columns[I]; + with AItem do + begin + Bounds := Rect(ALeft, HeadersRect.Top, + ALeft + AAutoWidthObject[I].AutoWidth, HeadersRect.Bottom); + ALeft := Bounds.Right; + ContentBounds := Grid.Painter.LFPainterClass.HeaderContentBounds(Bounds, Borders); + end; + end; + if ALeft < HeadersRect.Right then + HeadersRect.Right := ALeft; + finally + AAutoWidthObject.Free; + end; + end; + +begin + CreateItems; + CalcBounds; +end; + +procedure TcxLookupGridViewInfo.CalcEmptyAreas; +begin + if HeadersRect.Right < ClientBounds.Right then + EmptyRectRight := Rect(HeadersRect.Right, ClientBounds.Top, + ClientBounds.Right, ClientBounds.Bottom) + else + SetRectEmpty(EmptyRectRight); + if RowsRect.Bottom < ClientBounds.Bottom then + EmptyRectBottom := Rect(ClientBounds.Left, RowsRect.Bottom, + ClientBounds.Right, ClientBounds.Bottom) + else + SetRectEmpty(EmptyRectBottom); +end; + +procedure TcxLookupGridViewInfo.CalcCellColors(ARowIsSelected, ACellIsSelected: Boolean; + var AColor, AFontColor: TColor); +begin + if ARowIsSelected and not ACellIsSelected then + begin + AColor := GetSelectedColor; + AFontColor := GetSelectedFontColor; + end + else + begin + AColor := GetContentColor; + AFontColor := GetContentFontColor; + end; +end; + +procedure TcxLookupGridViewInfo.CalcColumns; +begin + FColumns.Clear; + if Grid.Columns.Count > 0 then + begin + HeadersRect := ClientBounds; + if Grid.Options.ShowHeader then + HeadersRect.Bottom := HeadersRect.Top + GetHeaderHeight + else + HeadersRect.Bottom := HeadersRect.Top; + CalcHeaders; + end + else + SetRectEmpty(HeadersRect); +end; + +procedure TcxLookupGridViewInfo.CalcRows; + + procedure CalcCells(ARowIndex: Integer; var ATop: Integer); + var + I, ACellHeight, ARowHeight: Integer; + ARect: TRect; + ARowViewInfo: TcxLookupGridRowViewInfo; + ACellViewInfo: TcxLookupGridCellViewInfo; + + function ExistEmptyArea: Boolean; + begin + Result := (TopRowIndexCalculation = ticNone) and + (ARowViewInfo.Bounds.Bottom <> ClientBounds.Bottom); + end; + + begin + ARowViewInfo := AddRow(ARowIndex, Rect(RowsRect.Left, ATop, RowsRect.Right, ATop)); + // Init Cells + ARowHeight := 0; + for I := 0 to Grid.Columns.Count - 1 do + begin + ACellHeight := GetCellHeight(ARowIndex, I); + if ACellHeight > ARowHeight then + ARowHeight := ACellHeight; + with Columns[I].Bounds do + ARect := Rect(Left, ATop, Right, ATop); + ARowViewInfo.AddCell(I, ARect, Grid.FocusedColumnIndex = I); + end; + // Correct Bottom + Calc Content + ARowViewInfo.Bounds.Bottom := ATop + ARowHeight; + ARowViewInfo.ContentBounds := ARowViewInfo.Bounds; + for I := 0 to ARowViewInfo.Count - 1 do + begin + ACellViewInfo := ARowViewInfo[I]; + ACellViewInfo.Bounds.Bottom := ARowViewInfo.Bounds.Bottom; + ACellViewInfo.ContentBounds := ACellViewInfo.Bounds; + if (GridLines in [glBoth, glVertical]) or + ((GridLines = glHorizontal) and (I = (ARowViewInfo.Count - 1))) then + begin + Dec(ACellViewInfo.ContentBounds.Right, GetGridLineWidth); + if I = (ARowViewInfo.Count - 1) then + begin + Dec(ARowViewInfo.ContentBounds.Right, GetGridLineWidth); + Include(ARowViewInfo.Borders, bRight); + end + else + Include(ACellViewInfo.Borders, bRight); + end; + end; + if (GridLines in [glBoth, glHorizontal]) or + ((GridLines = glVertical) and (ARowIndex = (RowCount - 1)) and ExistEmptyArea) then + begin + Inc(ARowViewInfo.Bounds.Bottom, GetGridLineWidth); + Include(ARowViewInfo.Borders, bBottom); + end; + RowsRect.Bottom := ARowViewInfo.Bounds.Bottom; + ATop := RowsRect.Bottom; + CalculateCells(ARowViewInfo); + end; + +var + I, ATop: Integer; +begin + FRows.Clear; + SetRectEmpty(RowsRect); + SetRectEmpty(VisibleRowsRect); + PartialVisibleRowCount := 0; + VisibleRowCount := 0; + if (HeadersRect.Right - HeadersRect.Left) > 0 then + begin + FRowMinHeight := CalcRowMinHeight; + RowsRect := Rect(HeadersRect.Left, HeadersRect.Bottom, HeadersRect.Right, HeadersRect.Bottom); + VisibleRowsRect := RowsRect; + ATop := RowsRect.Top; + if TopRowIndexCalculation = ticBackward then + begin + for I := TopRowIndex downto 0 do + begin + CalcCells(I, ATop); + Inc(PartialVisibleRowCount); + if RowsRect.Bottom <= ClientBounds.Bottom then + begin + Inc(VisibleRowCount); + VisibleRowsRect.Bottom := RowsRect.Bottom; + end + else + Break; + end; + end + else + begin + for I := TopRowIndex to RowCount - 1 do + begin + CalcCells(I, ATop); + Inc(PartialVisibleRowCount); + if RowsRect.Bottom <= ClientBounds.Bottom then + begin + Inc(VisibleRowCount); + VisibleRowsRect.Bottom := RowsRect.Bottom; + end + else + Break; + end; + end; + if (PartialVisibleRowCount > 0) and (VisibleRowCount = 0) then + VisibleRowCount := 1; + end; +end; + +procedure TcxLookupGridViewInfo.Calculate; +begin + BorderSize := FGrid.GetBorderSize; + CalcColumns; + CalcRows; + CalcEmptyAreas; +end; + +function TcxLookupGridViewInfo.CheckTopRowIndex(ANewTopIndex: Integer): Integer; +begin + TopRowIndexCalculation := ticForward; + try + FInternalTopRowIndex := ANewTopIndex; + Calculate; + if not IsRectEmpty(EmptyRectBottom) then + begin + TopRowIndexCalculation := ticBackward; + try + FInternalTopRowIndex := ANewTopIndex + VisibleRowCount - 1; + if FInternalTopRowIndex > (RowCount - 1) then + FInternalTopRowIndex := RowCount - 1; + Calculate; + ANewTopIndex := FInternalTopRowIndex - VisibleRowCount + 1; + finally + TopRowIndexCalculation := ticNone; + end; + end; + finally + TopRowIndexCalculation := ticNone; + end; + Result := ANewTopIndex; +end; + +function TcxLookupGridViewInfo.AddRow(ARowIndex: Integer; const AInitBounds: TRect): TcxLookupGridRowViewInfo; +begin + Result := TcxLookupGridRowViewInfo.Create; + FRows.Add(Result); + Result.RowIndex := ARowIndex; + Result.RecordIndex := Grid.FDataController.GetRowInfo(ARowIndex).RecordIndex; + Result.IsFocused := ARowIndex = Grid.FocusedRowIndex; + Result.Bounds := AInitBounds; +end; + +function TcxLookupGridViewInfo.CalcCellMinHeight(AIndex: Integer): Integer; +var + AEditViewData: TcxCustomEditViewData; +begin + AEditViewData := CreateEditViewData(Columns[AIndex], Grid.Columns[AIndex]); + try + Result := 2 * cxGridEditOffset + + AEditViewData.GetEditSize(Canvas, Null, DefaultcxEditSizeProperties).cy; + finally + DestroyEditViewData(Columns[AIndex], Grid.Columns[AIndex]); + end; +end; + +function TcxLookupGridViewInfo.CalcRowMinHeight: Integer; +var + I, ACellHeight: Integer; +begin + Result := 0; + for I := 0 to Grid.Columns.Count - 1 do + begin + ACellHeight := CalcCellMinHeight(I); + if ACellHeight > Result then + Result := ACellHeight; + end; +end; + +procedure TcxLookupGridViewInfo.CalculateCells(ARowViewInfo: TcxLookupGridRowViewInfo); + + procedure CalcCell(ACellViewInfo: TcxLookupGridCellViewInfo); + var + AColor, AFontColor: TColor; + ADisplayValue: Variant; + AEditViewData: TcxCustomEditViewData; + AEditViewInfo: TcxCustomEditViewInfo; + ARect: TRect; + ASelected: Boolean; + begin + // Style + ASelected := Grid.DataController.IsRowSelected(ARowViewInfo.RowIndex); + CalcCellColors(ASelected and ARowViewInfo.IsFocused, + ASelected and ACellViewInfo.IsFocused, AColor, AFontColor); + with Columns[ACellViewInfo.Index].Style do + begin + StyleData.Color := AColor; + StyleData.FontColor := AFontColor; + end; + // Calculate + AEditViewInfo := ACellViewInfo.CreateEditViewInfo(Grid.Columns[ACellViewInfo.Index].Properties); + AEditViewData := CreateEditViewData(Columns[ACellViewInfo.Index], Grid.Columns[ACellViewInfo.Index]); + try + // Value + if Grid.Columns[ACellViewInfo.Index].Properties.GetEditValueSource(False) = evsValue then + ADisplayValue := Grid.FDataController.Values[ARowViewInfo.RecordIndex, ACellViewInfo.Index] + else + ADisplayValue := Grid.FDataController.DisplayTexts[ARowViewInfo.RecordIndex, ACellViewInfo.Index]; + // Calculate + ARect := ACellViewInfo.ContentBounds; + InflateRect(ARect, -cxGridEditOffset, -cxGridEditOffset); + AEditViewData.EditValueToDrawValue(Canvas, ADisplayValue, AEditViewInfo); + AEditViewData.Calculate(Canvas, ARect, Point(-1, -1), cxmbNone, [], AEditViewInfo, False); + finally + DestroyEditViewData(Columns[ACellViewInfo.Index], Grid.Columns[ACellViewInfo.Index]); + end; + end; + +var + I: Integer; +begin + for I := 0 to ARowViewInfo.Count - 1 do + CalcCell(ARowViewInfo[I]); +end; + +function TcxLookupGridViewInfo.GetCellHeight(ARowIndex, AColumnIndex: Integer): Integer; +begin + Result := FRowMinHeight; +end; + +function TcxLookupGridViewInfo.GetContentColor: TColor; +begin + Result := Grid.Color; +end; + +function TcxLookupGridViewInfo.GetContentFont: TFont; +begin + Result := Grid.Font; +end; + +function TcxLookupGridViewInfo.GetContentFontColor: TColor; +begin + Result := GetContentFont.Color; +end; + +procedure TcxLookupGridViewInfo.CreateEditStyle(AColumnViewInfo: TcxLookupGridColumnViewInfo; + AColumn: TcxLookupGridColumn); +begin + AColumnViewInfo.CreateEditStyle(AColumn.Properties); + with AColumnViewInfo.Style do + StyleData.Font := AColumn.GetContentFont; +end; + +function TcxLookupGridViewInfo.CreateEditViewData(AColumnViewInfo: TcxLookupGridColumnViewInfo; + AColumn: TcxLookupGridColumn): TcxCustomEditViewData; +begin + with AColumn.Properties do + begin + LockUpdate(True); + try + IDefaultValuesProvider := AColumn.DefaultValuesProvider; + finally + LockUpdate(False); + end; + end; + Result := AColumnViewInfo.CreateEditViewData(AColumn.Properties); +end; + +procedure TcxLookupGridViewInfo.DestroyEditViewData(AColumnViewInfo: TcxLookupGridColumnViewInfo; + AColumn: TcxLookupGridColumn); +begin + AColumnViewInfo.DestroyEditViewData; + with AColumn.Properties do + begin + LockUpdate(True); + try + IDefaultValuesProvider := nil; + finally + LockUpdate(False); + end; + end; +end; + +function TcxLookupGridViewInfo.GetGridColor: TColor; +begin + Result := clBtnFace; // TODO: style +end; + +function TcxLookupGridViewInfo.GetGridLineWidth: Integer; +begin + Result := 1; +end; + +function TcxLookupGridViewInfo.GetHeaderColor: TColor; +begin + Result := Grid.Painter.LFPainterClass.DefaultHeaderColor; +end; + +function TcxLookupGridViewInfo.GetHeaderFont: TFont; +begin + Result := Grid.Font; // TODO: style +end; + +function TcxLookupGridViewInfo.GetHeaderFontColor: TColor; +begin + Result := Grid.Painter.LFPainterClass.DefaultHeaderTextColor; +end; + +function TcxLookupGridViewInfo.GetSelectedColor: TColor; +begin + Result := Grid.Painter.LFPainterClass.DefaultSelectionColor; // clHighlight; +end; + +function TcxLookupGridViewInfo.GetSelectedFontColor: TColor; +begin + Result := Grid.Painter.LFPainterClass.DefaultSelectionTextColor; // clHighlightText; +end; + +function TcxLookupGridViewInfo.GetHeaderHeight: Integer; +begin + Result := Grid.Painter.LFPainterClass.HeaderHeight(Canvas.FontHeight(GetHeaderFont)); +end; + +function TcxLookupGridViewInfo.GetBounds: TRect; +begin + Result := FGrid.Bounds; +end; + +function TcxLookupGridViewInfo.GetCanvas: TcxCanvas; +begin + Result := FGrid.Painter.Canvas; +end; + +function TcxLookupGridViewInfo.GetClientBounds: TRect; +begin + Result := FGrid.ClientBounds; +end; + +function TcxLookupGridViewInfo.GetEmptyAreaColor: TColor; +begin + Result := FGrid.Color; +end; + +function TcxLookupGridViewInfo.GetGridLines: TcxGridLines; +begin + Result := FGrid.Options.GridLines; +end; + +function TcxLookupGridViewInfo.GetRowCount: Integer; +begin + Result := Grid.RowCount; +end; + +function TcxLookupGridViewInfo.GetRowHeight: Integer; +begin + // TODO: RowAutoHeight + Result := FRowMinHeight; + if (Grid.Options.GridLines in [glBoth, glHorizontal]) then + Inc(Result, GetGridLineWidth); +end; + +function TcxLookupGridViewInfo.GetTopRowIndex: Integer; +begin + if TopRowIndexCalculation <> ticNone then + Result := FInternalTopRowIndex + else + Result := Grid.TopRowIndex; +end; + +{ TcxLookupGridPainter } + +constructor TcxLookupGridPainter.Create(AGrid: TcxCustomLookupGrid); +begin + inherited Create; + FGrid := AGrid; +end; + +destructor TcxLookupGridPainter.Destroy; +begin + FreeAndNil(FCanvas); + inherited Destroy; +end; + +procedure TcxLookupGridPainter.Invalidate; +begin + Grid.Invalidate; +end; + +procedure TcxLookupGridPainter.Paint; +begin + DrawBorder; + DrawContent; +end; + +procedure TcxLookupGridPainter.DrawBorder; +begin + with ViewInfo do + if BorderSize <> 0 then + begin + LFPainterClass.DrawBorder(Canvas, Bounds); + Canvas.IntersectClipRect(ClientBounds); + end; +end; + +procedure TcxLookupGridPainter.DrawContent; +begin + DrawHeaders; + DrawEmptyArea; + DrawRows; +end; + +procedure TcxLookupGridPainter.DrawCell(ACellViewInfo: TcxLookupGridCellViewInfo); +begin + ACellViewInfo.EditViewInfo.Paint(Canvas); + Canvas.FrameRect(ACellViewInfo.ContentBounds, ACellViewInfo.EditViewInfo.BackgroundColor, + cxGridEditOffset); + Canvas.FrameRect(ACellViewInfo.Bounds, ViewInfo.GetGridColor, + ViewInfo.GetGridLineWidth, ACellViewInfo.Borders); +end; + +procedure TcxLookupGridPainter.DrawEmptyArea; +begin + with ViewInfo do + if not IsRectEmpty(EmptyRectBottom) or not IsRectEmpty(EmptyRectRight) then + begin + Canvas.Brush.Color := EmptyAreaColor; + if not IsRectEmpty(EmptyRectBottom) then + Canvas.FillRect(EmptyRectBottom); + if not IsRectEmpty(EmptyRectRight) then + Canvas.FillRect(EmptyRectRight); + end; +end; + +procedure TcxLookupGridPainter.DrawHeaders; +var + R, ASortRect, ATextRect: TRect; + ASortOrder: TcxDataSortOrder; + I: Integer; +begin + with ViewInfo do + if not IsRectEmpty(HeadersRect) then + begin + for I := 0 to Columns.Count - 1 do + begin + R := Columns[I].Bounds; + ATextRect := LFPainterClass.HeaderContentBounds(R, Columns[I].Borders); + InflateRect(ATextRect, -cxHeaderTextOffset, -cxHeaderTextOffset); + ASortOrder := Columns[I].SortOrder; + if ASortOrder <> soNone then + begin + ASortRect := Rect(ATextRect.Right - LFPainterClass.SortingMarkAreaSize.X, ATextRect.Top, + ATextRect.Right, ATextRect.Bottom); + ATextRect.Right := ASortRect.Left; + if ATextRect.Right < ATextRect.Left then + ATextRect.Right := ATextRect.Left; + end; + LFPainterClass.DrawHeader(Canvas, R, ATextRect, Columns[I].Neighbors, Columns[I].Borders, + cxbsNormal, Columns[I].Alignment, vaCenter, False, True, Columns[I].Text, + GetHeaderFont, GetHeaderFontColor, GetHeaderColor); + if ASortOrder <> soNone then + LFPainterClass.DrawSortingMark(Canvas, ASortRect, ASortOrder = soAscending); + end; + end; +end; + +procedure TcxLookupGridPainter.DrawRow(ARowViewInfo: TcxLookupGridRowViewInfo); +var + I: Integer; + ACellViewInfo: TcxLookupGridCellViewInfo; +begin + for I := 0 to ARowViewInfo.Count - 1 do + begin + ACellViewInfo := ARowViewInfo[I]; + Canvas.FrameRect(ACellViewInfo.Bounds, ViewInfo.GetGridColor, + ViewInfo.GetGridLineWidth, ACellViewInfo.Borders); + DrawCell(ACellViewInfo); + end; + Canvas.FrameRect(ARowViewInfo.Bounds, ViewInfo.GetGridColor, + ViewInfo.GetGridLineWidth, ARowViewInfo.Borders); + if ARowViewInfo.IsFocused and (Grid.Focused or Grid.IsPopupControl) then + Canvas.DrawFocusRect(ARowViewInfo.ContentBounds); +end; + +procedure TcxLookupGridPainter.DrawRows; +var + I: Integer; +begin + with ViewInfo do + if not IsRectEmpty(RowsRect) then + for I := 0 to PartialVisibleRowCount - 1 do + DrawRow(Rows[I]); +end; + +function TcxLookupGridPainter.GetCanvas: TcxCanvas; +begin + if Grid.HandleAllocated then + begin + if FCanvas <> nil then + FreeAndNil(FCanvas); + Result := Grid.Canvas; + end + else + begin + if FCanvas = nil then + FCanvas := TcxScreenCanvas.Create; + Result := FCanvas; + end; +end; + +function TcxLookupGridPainter.GetViewInfo: TcxLookupGridViewInfo; +begin + Result := Grid.ViewInfo; +end; + +{ TcxLookupGridDefaultValuesProvider } + +function TcxLookupGridDefaultValuesProvider.IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean; +begin + with TcxLookupGridColumn(Owner) do + Result := DataController.GetItemTextStored(Index); +end; + +{ TcxLookupGridColumn } + +constructor TcxLookupGridColumn.Create(Collection: TCollection); +var + AGrid: TcxCustomLookupGrid; +begin + if Assigned(Collection) and (Collection is TcxLookupGridColumns) then + AGrid := TcxLookupGridColumns(Collection).Grid + else + AGrid := nil; + if Assigned(AGrid) then + AGrid.BeginUpdate; + try + inherited Create(Collection); + FDefaultValuesProvider := GetDefaultValuesProviderClass.Create(Self); + FMinWidth := cxLookupGridColumnDefaultMinWidth; + FSorting := True; + Changed(False); + if AGrid <> nil then + AGrid.AddColumn(Self); + finally + if Assigned(AGrid) then + AGrid.EndUpdate; + end; +end; + +destructor TcxLookupGridColumn.Destroy; +var + AGrid: TcxCustomLookupGrid; + AGridNotify: Boolean; +begin + AGrid := Grid; + AGridNotify := False; + if AGrid <> nil then + begin + AGridNotify := not (csDestroying in AGrid.ComponentState) {and + not TcxLookupGridColumns(Collection).Locked}; + if AGridNotify then AGrid.BeginUpdate; + AGrid.RemoveColumn(Self); + end; + try + RepositoryItem := nil; + FreeAndNil(FInternalDefaultRepositoryItem); + FDefaultValuesProvider.Free; + FDefaultValuesProvider := nil; + inherited Destroy; + finally + if (AGrid <> nil) and AGridNotify then + AGrid.EndUpdate; + end; +end; + +procedure TcxLookupGridColumn.Assign(Source: TPersistent); +begin + if Source is TcxLookupGridColumn then + begin + if Assigned(Collection) then + Collection.BeginUpdate; + try + RestoreDefaults; + if TcxLookupGridColumn(Source).IsCaptionStored then + Caption := TcxLookupGridColumn(Source).Caption; + HeaderAlignment := TcxLookupGridColumn(Source).HeaderAlignment; + MinWidth := TcxLookupGridColumn(Source).MinWidth; + Fixed := TcxLookupGridColumn(Source).Fixed; + Sorting := TcxLookupGridColumn(Source).Sorting; + SortOrder := TcxLookupGridColumn(Source).SortOrder; + RepositoryItem := TcxLookupGridColumn(Source).RepositoryItem; + if TcxLookupGridColumn(Source).IsWidthStored then + Width := TcxLookupGridColumn(Source).Width; + finally + if Assigned(Collection) then + Collection.EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +function TcxLookupGridColumn.DefaultCaption: string; +begin + Result := ''; +end; + +function TcxLookupGridColumn.DefaultRepositoryItem: TcxEditRepositoryItem; +begin + Result := GetDefaultEditDataRepositoryItems.GetDefaultItem; +end; + +function TcxLookupGridColumn.DefaultWidth: Integer; +begin + Result := 64; +end; + +function TcxLookupGridColumn.GetContentFont: TFont; +begin + if Grid <> nil then + Result := Grid.ViewInfo.GetContentFont + else + Result := nil; +end; + +function TcxLookupGridColumn.GetInternalDefaultRepositoryItem: TcxEditRepositoryItem; +begin + Result := DefaultRepositoryItem; + if Result = nil then + begin + if FInternalDefaultRepositoryItem = nil then + FInternalDefaultRepositoryItem := TcxEditRepositoryTextItem.Create(nil); + Result := FInternalDefaultRepositoryItem; + end; +end; + +function TcxLookupGridColumn.GetRepositoryItem: TcxEditRepositoryItem; +begin + if RepositoryItem <> nil then + Result := RepositoryItem + else + Result := GetInternalDefaultRepositoryItem; +end; + +function TcxLookupGridColumn.IsLeft: Boolean; +begin + Result := Index = 0; +end; + +function TcxLookupGridColumn.IsRight: Boolean; +begin + Result := Index = Collection.Count - 1; +end; + +procedure TcxLookupGridColumn.RestoreDefaults; +begin + FIsCaptionAssigned := False; + FIsWidthAssigned := False; + FHeaderAlignment := taLeftJustify; + FMinWidth := cxLookupGridColumnDefaultMinWidth; + FFixed := False; + FSorting := True; + Changed(False); +end; + +// IUnknown + +function TcxLookupGridColumn.QueryInterface(const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then + Result := S_OK + else + Result := E_NOINTERFACE; +end; + +function TcxLookupGridColumn._AddRef: Integer; +begin + Result := -1; // -1 indicates no reference counting is taking Position +end; + +function TcxLookupGridColumn._Release: Integer; +begin + Result := -1; // -1 indicates no reference counting is taking Position +end; + +// IcxEditRepositoryItemListener + +procedure TcxLookupGridColumn.ItemRemoved(Sender: TcxEditRepositoryItem); +begin + RepositoryItem := nil; +end; + +procedure TcxLookupGridColumn.PropertiesChanged(Sender: TcxEditRepositoryItem); +begin + Changed(False); +end; + +procedure TcxLookupGridColumn.CheckWidthValue(var Value: Integer); +begin + if Value < FMinWidth then + Value := FMinWidth; +end; + +function TcxLookupGridColumn.GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; +begin + Result := TcxLookupGridDefaultValuesProvider; +end; + +function TcxLookupGridColumn.GetValueTypeClass: TcxValueTypeClass; +begin + if Grid <> nil then + Result := Grid.FDataController.GetItemValueTypeClass(Index) + else + Result := nil; +end; + +procedure TcxLookupGridColumn.SetIndex(Value: Integer); +begin + inherited SetIndex(Value); + if Grid <> nil then + Grid.FDataController.UpdateItemIndexes; +end; + +procedure TcxLookupGridColumn.SetValueTypeClass(Value: TcxValueTypeClass); +begin + if Grid <> nil then + Grid.FDataController.ChangeValueTypeClass(Index, Value); +end; + +function TcxLookupGridColumn.GetCaption: string; +begin + if FIsCaptionAssigned then + Result := FCaption + else + Result := DefaultCaption; +end; + +function TcxLookupGridColumn.GetDataController: TcxCustomDataController; +begin + Result := TcxCustomDataController(Grid.FDataController) +end; + +function TcxLookupGridColumn.GetGrid: TcxCustomLookupGrid; +begin + Result := TcxLookupGridColumns(Collection).Grid; +end; + +function TcxLookupGridColumn.GetMinWidth: Integer; +begin + Result := FMinWidth; +end; + +function TcxLookupGridColumn.GetProperties: TcxCustomEditProperties; +begin + Result := GetRepositoryItem.Properties; +end; + +function TcxLookupGridColumn.GetSortOrder: TcxDataSortOrder; +begin + if Grid <> nil then + Result := Grid.FDataController.GetItemSortOrder(Index) + else + Result := soNone; +end; + +function TcxLookupGridColumn.GetWidth: Integer; +begin + if FIsWidthAssigned then + Result := FWidth + else + Result := DefaultWidth; +end; + +function TcxLookupGridColumn.IsCaptionStored: Boolean; +begin + Result := FIsCaptionAssigned; +end; + +function TcxLookupGridColumn.IsWidthStored: Boolean; +begin + Result := FIsWidthAssigned; +end; + +procedure TcxLookupGridColumn.SetCaption(const Value: string); +begin + FCaption := Value; + FIsCaptionAssigned := True; + Changed(False); +end; + +procedure TcxLookupGridColumn.SetFixed(Value: Boolean); +begin + if FFixed <> Value then + begin + FFixed := Value; + Changed(False); + end; +end; + +procedure TcxLookupGridColumn.SetHeaderAlignment(Value: TAlignment); +begin + if FHeaderAlignment <> Value then + begin + FHeaderAlignment := Value; + Changed(False); + end; +end; + +procedure TcxLookupGridColumn.SetMinWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FMinWidth <> Value then + begin + FMinWidth := Value; + if Width < FMinWidth then + Width := FMinWidth; + Changed(False); + end; +end; + +procedure TcxLookupGridColumn.SetRepositoryItem(Value: TcxEditRepositoryItem); +begin + if FRepositoryItem <> Value then + begin + if FRepositoryItem <> nil then + FRepositoryItem.RemoveListener(Self); + FRepositoryItem := Value; + if FRepositoryItem <> nil then + FRepositoryItem.AddListener(Self); + PropertiesChanged(FRepositoryItem); + end; +end; + +procedure TcxLookupGridColumn.SetSorting(Value: Boolean); +begin + if FSorting <> Value then + begin + FSorting := Value; + Changed(False); + end; +end; + +procedure TcxLookupGridColumn.SetSortOrder(Value: TcxDataSortOrder); +begin + if Grid <> nil then + Grid.FDataController.ChangeSorting(Index, Value); +end; + +procedure TcxLookupGridColumn.SetWidth(Value: Integer); +begin + CheckWidthValue(Value); + FWidth := Value; + FIsWidthAssigned := True; + Changed(False); +end; + +{ TcxLookupGridColumns } + +constructor TcxLookupGridColumns.Create(AGrid: TcxCustomLookupGrid; + AColumnClass: TcxLookupGridColumnClass); +begin + inherited Create(AColumnClass); + FGrid := AGrid; +end; + +function TcxLookupGridColumns.Add: TcxLookupGridColumn; +begin + Result := TcxLookupGridColumn(inherited Add); +end; + +procedure TcxLookupGridColumns.BeginUpdate; +begin + if (Grid <> nil) and not (csDestroying in Grid.ComponentState) then + Grid.BeginUpdate; + inherited; +end; + +procedure TcxLookupGridColumns.EndUpdate; +begin + inherited; + if (Grid <> nil) and not (csDestroying in Grid.ComponentState) then + Grid.EndUpdate; +end; + +procedure TcxLookupGridColumns.RestoreDefaults; +var + I: Integer; +begin + BeginUpdate; + try + for I := 0 to Count-1 do + Items[I].RestoreDefaults; + finally + EndUpdate; + end; +end; + +function TcxLookupGridColumns.GetOwner: TPersistent; +begin + Result := FGrid; +end; + +procedure TcxLookupGridColumns.Update(Item: TCollectionItem); +begin + if (FGrid = nil) or (csLoading in FGrid.ComponentState) then Exit; + Grid.Change([lgcLayout]); +end; + +function TcxLookupGridColumns.GetColumn(Index: Integer): TcxLookupGridColumn; +begin + Result := TcxLookupGridColumn(inherited Items[Index]); +end; + +procedure TcxLookupGridColumns.SetColumn(Index: Integer; Value: TcxLookupGridColumn); +begin + Items[Index].Assign(Value); +end; + +{ TcxLookupGridDataController } + +function TcxLookupGridDataController.GetItem(Index: Integer): TObject; +begin + Result := Grid.Columns[Index]; +end; + +function TcxLookupGridDataController.GetGrid: TcxCustomLookupGrid; +begin + Result := GetOwner as TcxCustomLookupGrid; +end; + +{ TcxLookupGridOptions } + +constructor TcxLookupGridOptions.Create(AGrid: TcxCustomLookupGrid); +begin + inherited Create; + FGrid := AGrid; + FColumnSorting := True; + FFocusRowOnMouseMove := True; + FGridLines := glBoth; + FRowSelect := True; + FShowHeader := True; +end; + +procedure TcxLookupGridOptions.Assign(Source: TPersistent); +begin + if Source is TcxLookupGridOptions then + begin + if Assigned(Grid) then + Grid.BeginUpdate; + try + AnsiSort := TcxLookupGridOptions(Source).AnsiSort; + CaseInsensitive := TcxLookupGridOptions(Source).CaseInsensitive; + ColumnSorting := TcxLookupGridOptions(Source).ColumnSorting; + FocusRowOnMouseMove := TcxLookupGridOptions(Source).FocusRowOnMouseMove; + GridLines := TcxLookupGridOptions(Source).GridLines; + RowSelect := TcxLookupGridOptions(Source).RowSelect; + ShowHeader := TcxLookupGridOptions(Source).ShowHeader; + finally + if Assigned(Grid) then + Grid.EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxLookupGridOptions.Changed; +begin + if Assigned(Grid) then + Grid.Change([lgcLayout]); + if Assigned(FOnChanged) then + FOnChanged(Self); +end; + +function TcxLookupGridOptions.GetAnsiSort: Boolean; +begin + if Assigned(Grid) then + Result := dcoAnsiSort in Grid.DataController.Options + else + Result := False; +end; + +function TcxLookupGridOptions.GetCaseInsensitive: Boolean; +begin + if Assigned(Grid) then + Result := dcoCaseInsensitive in Grid.DataController.Options + else + Result := False; +end; + +procedure TcxLookupGridOptions.SetAnsiSort(Value: Boolean); +begin + if Assigned(Grid) then + begin + if Value then + Grid.DataController.Options := Grid.DataController.Options + [dcoAnsiSort] + else + Grid.DataController.Options := Grid.DataController.Options - [dcoAnsiSort]; + end; +end; + +procedure TcxLookupGridOptions.SetCaseInsensitive(Value: Boolean); +begin + if Assigned(Grid) then + begin + if Value then + Grid.DataController.Options := Grid.DataController.Options + [dcoCaseInsensitive] + else + Grid.DataController.Options := Grid.DataController.Options - [dcoCaseInsensitive]; + end; +end; + +procedure TcxLookupGridOptions.SetGridLines(Value: TcxGridLines); +begin + if FGridLines <> Value then + begin + FGridLines := Value; + Changed; + end; +end; + +procedure TcxLookupGridOptions.SetRowSelect(Value: Boolean); +begin + if FRowSelect <> Value then + begin + FRowSelect := Value; + if Value and Assigned(Grid) then + Grid.FocusedColumn := nil; + end; +end; + +procedure TcxLookupGridOptions.SetShowHeader(Value: Boolean); +begin + if FShowHeader <> Value then + begin + FShowHeader := Value; + Changed; + end; +end; + +{ TcxCustomLookupGrid } + +constructor TcxCustomLookupGrid.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FColumns := GetColumnsClass.Create(Self, GetColumnClass); + FOptions := GetOptionsClass.Create(Self); + CreateHandlers; + CreateSubClasses; + Color := clWindow; + ParentColor := False; + Width := 250; + Height := 200; + Keys := [kArrows]; +end; + +destructor TcxCustomLookupGrid.Destroy; +begin + SetScrollMode(smNone); + DestroySubClasses; + DestroyHandlers; + FOptions.Free; + FColumns.Free; + inherited Destroy; +end; + +procedure TcxCustomLookupGrid.BeginUpdate; +begin + Inc(FLockCount); + FDataController.BeginUpdate; +end; + +procedure TcxCustomLookupGrid.CancelUpdate; +begin + Dec(FLockCount); +end; + +procedure TcxCustomLookupGrid.EndUpdate; +begin + FDataController.EndUpdate; + Dec(FLockCount); + CheckChanges; +end; + +function TcxCustomLookupGrid.GetHitInfo(P: TPoint): TcxLookupGridHitInfo; + + function CalcColumnIndex(out AColumnIndex: Integer): Boolean; + var + I: Integer; + begin + Result := False; + for I := 0 to ViewInfo.Columns.Count - 1 do + if PtInRect(ViewInfo.Columns[I].Bounds, P) then + begin + AColumnIndex := I; + Result := True; + Break; + end; + end; + + function CalcCellIndex(out ARowIndex, AColumnIndex: Integer): Boolean; + var + I, J: Integer; + begin + Result := False; + for I := 0 to ViewInfo.Rows.Count - 1 do + if PtInRect(ViewInfo.Rows[I].Bounds, P) then + begin + ARowIndex := ViewInfo.Rows[I].RowIndex; + for J := 0 to ViewInfo.Rows[I].Count - 1 do + if PtInWidth(ViewInfo.Rows[I][J].Bounds, P) then + begin + AColumnIndex := ViewInfo.Rows[I][J].Index; + Result := True; + Break; + end; + Break; + end; + end; + +begin + Result.HitTest := htNone; + Result.RowIndex := -1; + Result.ColumnIndex := -1; + if not PtInRect(ViewInfo.ClientBounds, P) then Exit; + if PtInRect(ViewInfo.HeadersRect, P) then + begin + if CalcColumnIndex(Result.ColumnIndex) then + Result.HitTest := htHeader; + end + else + if PtInRect(ViewInfo.RowsRect, P) then + begin + if CalcCellIndex(Result.RowIndex, Result.ColumnIndex) then + Result.HitTest := htCell; + end; +end; + +function TcxCustomLookupGrid.GetNearestPopupHeight(AHeight: Integer): Integer; +var + AHeaderHeight, ARowHeight, ARowCount: Integer; +begin + AHeaderHeight := ViewInfo.HeadersRect.Bottom - ViewInfo.HeadersRect.Top; + ARowHeight := ViewInfo.RowHeight; + ARowCount := (AHeight - AHeaderHeight) div ARowHeight; + if ARowCount <= 0 then + ARowCount := 1 + else + if ARowCount > GetRowCount then + ARowCount := GetRowCount; + if ARowCount < 1 then ARowCount := 1; + Result := AHeaderHeight + ARowHeight * ARowCount; +end; + +function TcxCustomLookupGrid.GetPopupHeight(ADropDownRowCount: Integer): Integer; +begin + Result := ViewInfo.HeadersRect.Bottom - ViewInfo.HeadersRect.Top + + ViewInfo.RowHeight * ADropDownRowCount; +end; + +function TcxCustomLookupGrid.IsMouseOverList(const P: TPoint): Boolean; +begin + Result := GetHitInfo(P).RowIndex <> -1; +end; + +function TcxCustomLookupGrid.IsRowVisible(ARowIndex: Integer): Boolean; +begin + with ViewInfo do + Result := (VisibleRowCount > 0) and (Rows[0].RowIndex <= ARowIndex) and + (ARowIndex <= Rows[VisibleRowCount - 1].RowIndex); +end; + +procedure TcxCustomLookupGrid.LockPopupMouseMove; +begin + FPrevMousePos := InternalGetCursorPos; +end; + +procedure TcxCustomLookupGrid.MakeFocusedRowVisible; +begin + if FocusedRowIndex <> -1 then + MakeRowVisible(FocusedRowIndex); +end; + +procedure TcxCustomLookupGrid.MakeRowVisible(ARowIndex: Integer); + + procedure SetBottomRowIndex(ARowIndex: Integer); + begin + TopRowIndex := ARowIndex - ViewInfo.VisibleRowCount + 1; // TODO: AutoHeight + end; + +begin + if ViewInfo.VisibleRowCount > 0 then + begin + if ARowIndex < ViewInfo.Rows[0].RowIndex then + TopRowIndex := ARowIndex + else + if ARowIndex > ViewInfo.Rows[ViewInfo.VisibleRowCount - 1].RowIndex then + SetBottomRowIndex(ARowIndex); + end; +end; + +procedure TcxCustomLookupGrid.SyncSelected(ASelected: Boolean); +begin + DataController.SyncSelected(ASelected); +end; + +procedure TcxCustomLookupGrid.ColorChanged; +begin + LayoutChanged; + inherited ColorChanged; +end; + +procedure TcxCustomLookupGrid.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited KeyDown(Key, Shift); + case Key of + VK_LEFT: + FocusColumn(FocusedColumnIndex - 1); + VK_RIGHT: + FocusColumn(FocusedColumnIndex + 1); + VK_UP: + FocusNextRow(False); // Grid mode + VK_DOWN: + FocusNextRow(True); // Grid mode + VK_HOME: + if (ssCtrl in Shift) or Options.RowSelect then + DataController.GotoFirst + else + FocusColumn(0); + VK_END: + if (ssCtrl in Shift) or Options.RowSelect then + DataController.GotoLast + else + FocusColumn(Columns.Count - 1); + VK_PRIOR: + FocusPriorPage; + VK_NEXT: + FocusNextPage; + VK_RETURN: + DoCloseUp(FocusedRowIndex <> -1); + end; +end; + +procedure TcxCustomLookupGrid.Loaded; +begin + inherited Loaded; + Change([lgcLayout]); +end; + +procedure TcxCustomLookupGrid.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + AHitInfo: TcxLookupGridHitInfo; +begin + inherited MouseDown(Button, Shift, X, Y); + AHitInfo := GetHitInfo(Point(X, Y)); + if AHitInfo.HitTest = htHeader then + DoHeaderClick(AHitInfo.ColumnIndex, Shift) + else + if AHitInfo.HitTest = htCell then + begin + DoCellClick(AHitInfo.RowIndex, AHitInfo.ColumnIndex, Shift); + FRowPressed := True; + end; +end; + +procedure TcxCustomLookupGrid.MouseMove(Shift: TShiftState; X, Y: Integer); +const + ScrollModeA: array[Boolean] of TcxLookupGridScrollMode = (smTop, smBottom); +var + AHitInfo: TcxLookupGridHitInfo; + P: TPoint; +begin + inherited MouseMove(Shift, X, Y); + P := InternalGetCursorPos; + if (P.X = FPrevMousePos.X) and (P.Y = FPrevMousePos.Y) then + Exit; + FPrevMousePos := P; + if MouseCapture or IsHotTrack then + begin + AHitInfo := GetHitInfo(Point(X, Y)); + if FRowPressed and MouseCapture and ((Y < ViewInfo.VisibleRowsRect.Top) or + (Y > ViewInfo.VisibleRowsRect.Bottom)) then + SetScrollMode(ScrollModeA[Y > ViewInfo.VisibleRowsRect.Bottom]) + else + begin + SetScrollMode(smNone); + if AHitInfo.HitTest = htCell then + begin + FocusedRowIndex := AHitInfo.RowIndex; + SyncSelected(True); + end; + end; + end; +end; + +procedure TcxCustomLookupGrid.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + AHitInfo: TcxLookupGridHitInfo; +begin + inherited MouseUp(Button, Shift, X, Y); + SetScrollMode(smNone); + AHitInfo := GetHitInfo(Point(X, Y)); + if FRowPressed then + DoCloseUp(AHitInfo.HitTest = htCell); + FRowPressed := False; +end; + +procedure TcxCustomLookupGrid.Paint; +begin + inherited Paint; + FPainter.Paint; +end; + +function TcxCustomLookupGrid.AllowDragAndDropWithoutFocus: Boolean; +begin + Result := True; +end; + +procedure TcxCustomLookupGrid.BoundsChanged; +begin + LayoutChanged; + inherited BoundsChanged; +end; + +procedure TcxCustomLookupGrid.DoCancelMode; +begin + DestroyScrollTimer; + FRowPressed := False; +end; + +procedure TcxCustomLookupGrid.FocusChanged; +begin + UpdateFocusing; + inherited FocusChanged; +end; + +procedure TcxCustomLookupGrid.FontChanged; +begin + inherited FontChanged; + LayoutChanged; +end; + +function TcxCustomLookupGrid.GetBorderSize: Integer; +begin + if IsPopupControl then + Result := 0 + else + Result := Painter.LFPainterClass.BorderSize; +end; + +procedure TcxCustomLookupGrid.InitControl; +begin + inherited InitControl; + LayoutChanged; +end; + +procedure TcxCustomLookupGrid.InitScrollBarsParameters; +begin + SetScrollBarInfo(sbVertical, 0, ViewInfo.RowCount - 1 + ScrollBarOffsetBegin + ScrollBarOffsetEnd, + 1, ViewInfo.VisibleRowCount, ScrollBarOffsetBegin + ViewInfo.TopRowIndex, True, True); +end; + +procedure TcxCustomLookupGrid.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +begin + if AScrollBarKind = sbVertical then + begin + case AScrollCode of + scLineUp: + TopRowIndex := TopRowIndex - 1; + scLineDown: + TopRowIndex := TopRowIndex + 1; + scPageUp: + ShowPrevPage; + scPageDown: + ShowNextPage; + scTrack: + if not DataController.IsGridMode then + TopRowIndex := AScrollPos; // check in CLX!!! + scPosition: + if DataController.IsGridMode then + TopRowIndex := AScrollPos - ScrollBarOffsetBegin; + end; + AScrollPos := ScrollBarOffsetBegin + TopRowIndex; + end; +end; + +procedure TcxCustomLookupGrid.AddColumn(AColumn: TcxLookupGridColumn); +begin + if FDataController <> nil then + FDataController.AddItem(AColumn); +end; + +procedure TcxCustomLookupGrid.Change(AChanges: TcxLookupGridChanges); +begin + FChanges := FChanges + AChanges; + CheckChanges; +end; + +procedure TcxCustomLookupGrid.CheckChanges; +begin + if (FChanges <> []) and (LockCount = 0) then + try + if FChanges * [lgcData, lgcLayout, lgcFocusedRow] <> [] then + LayoutChanged; + finally + FChanges := []; + end; +end; + +procedure TcxCustomLookupGrid.CheckSetTopRowIndex(var Value: Integer); +var + AMaxValue: Integer; +begin + if DataController.IsGridMode then + begin + if Value < 0 then + begin + if not DataController.IsBOF then + DataController.Scroll(Value); + Value := 0; + end + else + if Value >= RowCount then + begin + if not DataController.IsEOF then + DataController.Scroll(Value - (RowCount - 1)); + Value := RowCount - 1; + end + else + begin + AMaxValue := RowCount - ViewInfo.VisibleRowCount; // TODO + if Value > AMaxValue then + begin + if not DataController.IsEOF then + DataController.Scroll(Value - AMaxValue); +// AMaxValue := GetMaxValue; + Value := AMaxValue; + end; + end; + end; + if Value >= RowCount then + Value := RowCount - 1; + if Value < 0 then + Value := 0; +end; + +procedure TcxCustomLookupGrid.CheckTopRowIndex(ATopRowIndex: Integer; ANotUpdate: Boolean); +var + APrevTopRowIndex, ANewTopRowIndex: Integer; +begin + APrevTopRowIndex := TopRowIndex; + ANewTopRowIndex := ViewInfo.CheckTopRowIndex(ATopRowIndex); + if APrevTopRowIndex <> ANewTopRowIndex then + begin + FTopRowIndex := ANewTopRowIndex; + if not ANotUpdate then + UpdateLayout; + end + else + ViewInfo.Calculate; +end; + +procedure TcxCustomLookupGrid.CreateHandlers; +begin + FPainter := GetPainterClass.Create(Self); + FPainter.LFPainterClass := GetLFPainterClass; + FViewInfo := GetViewInfoClass.Create(Self); +end; + +function TcxCustomLookupGrid.GetDataControllerClass: TcxCustomDataControllerClass; +begin + Result := TcxLookupGridDataController; +end; + +procedure TcxCustomLookupGrid.CreateSubClasses; +begin + FDataController := GetDataControllerClass.Create(Self); + FDataController.OnUpdateControl := UpdateControl; +end; + +procedure TcxCustomLookupGrid.DestroyHandlers; +begin + FreeAndNil(FViewInfo); + FreeAndNil(FPainter); +end; + +procedure TcxCustomLookupGrid.DestroySubClasses; +begin + FreeAndNil(FDataController); +end; + +procedure TcxCustomLookupGrid.DoCellClick(ARowIndex, AColumnIndex: Integer; AShift: TShiftState); +begin + if ARowIndex <> -1 then + FocusedRowIndex := ARowIndex; + if AColumnIndex <> -1 then + FocusedColumnIndex := AColumnIndex; +end; + +procedure TcxCustomLookupGrid.DoHeaderClick(AColumnIndex: Integer; AShift: TShiftState); +var + ASortOrder: TcxDataSortOrder; +begin + if not Options.ColumnSorting or (AColumnIndex = -1) or + not Columns[AColumnIndex].Sorting then Exit; + try + BeginUpdate; + try + with Columns[AColumnIndex] do + if ssCtrl in AShift then + SortOrder := soNone + else + begin + if SortOrder = soAscending then + ASortOrder := soDescending + else + ASortOrder := soAscending; + if not (ssShift in AShift) then + FDataController.ClearSorting(True); + SortOrder := ASortOrder; + end; + finally + EndUpdate; + end; + finally + MakeFocusedRowVisible; + end; +end; + +procedure TcxCustomLookupGrid.FocusColumn(AColumnIndex: Integer); +begin + FocusedColumnIndex := AColumnIndex; + MakeFocusedRowVisible; +end; + +procedure TcxCustomLookupGrid.FocusNextPage; +begin + MakeFocusedRowVisible; + if FocusedRowIndex = TopRowIndex + ViewInfo.VisibleRowCount - 1 then + ShowNextPage; + FocusedRowIndex := TopRowIndex + ViewInfo.VisibleRowCount - 1; +end; + +procedure TcxCustomLookupGrid.FocusNextRow(AGoForward: Boolean); +var + AFocusedRowIndex: Integer; +begin + AFocusedRowIndex := FocusedRowIndex; + if DataController.IsGridMode then + begin + if AGoForward then + begin + if not DataController.IsEOF and (AFocusedRowIndex = (RowCount - 1)) then + begin + DataController.Scroll(1); + if not DataController.IsEOF then + Dec(AFocusedRowIndex); + end; + end + else + begin + if (AFocusedRowIndex = 0) and not DataController.IsBOF then + begin + DataController.Scroll(-1); + if not DataController.IsBOF then + Inc(AFocusedRowIndex); + end; + end; + end; + if AGoForward then + AFocusedRowIndex := AFocusedRowIndex + 1 + else + AFocusedRowIndex := AFocusedRowIndex - 1; + if AFocusedRowIndex < 0 then + AFocusedRowIndex := 0; + if AFocusedRowIndex >= RowCount then + AFocusedRowIndex := RowCount - 1; + FocusedRowIndex := AFocusedRowIndex; + SyncSelected(True); +end; + +procedure TcxCustomLookupGrid.FocusPriorPage; +begin + MakeFocusedRowVisible; + if FocusedRowIndex = TopRowIndex then + ShowPrevPage; + FocusedRowIndex := TopRowIndex; +end; + +function TcxCustomLookupGrid.GetColumnClass: TcxLookupGridColumnClass; +begin + Result := TcxLookupGridColumn; +end; + +function TcxCustomLookupGrid.GetColumnsClass: TcxLookupGridColumnsClass; +begin + Result := TcxLookupGridColumns; +end; + +function TcxCustomLookupGrid.GetLFPainterClass: TcxCustomLookAndFeelPainterClass; +begin + Result := LookAndFeel.Painter; +end; + +function TcxCustomLookupGrid.GetOptionsClass: TcxLookupGridOptionsClass; +begin + Result := TcxLookupGridOptions; +end; + +function TcxCustomLookupGrid.GetPainterClass: TcxLookupGridPainterClass; +begin + Result := TcxLookupGridPainter; +end; + +function TcxCustomLookupGrid.GetScrollBarOffsetBegin: Integer; +begin + if DataController.IsGridMode then + Result := Ord(not DataController.IsBOF) + else + Result := 0; +end; + +function TcxCustomLookupGrid.GetScrollBarOffsetEnd: Integer; +begin + if DataController.IsGridMode then + Result := Ord(not DataController.IsEOF) + else + Result := 0; +end; + +function TcxCustomLookupGrid.GetViewInfoClass: TcxLookupGridViewInfoClass; +begin + Result := TcxLookupGridViewInfo; +end; + +function TcxCustomLookupGrid.IsHotTrack: Boolean; +begin + Result := IsPopupControl and Options.FocusRowOnMouseMove; +end; + +procedure TcxCustomLookupGrid.LookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); +begin + inherited; + Painter.LFPainterClass := GetLFPainterClass; + Change([lgcLayout]); +end; + +procedure TcxCustomLookupGrid.RemoveColumn(AColumn: TcxLookupGridColumn); +begin + if FDataController <> nil then + FDataController.RemoveItem(AColumn); + if FFocusedColumn = AColumn then + FFocusedColumn := nil; // TODO: prev/next +end; + +procedure TcxCustomLookupGrid.SetScrollMode(Value: TcxLookupGridScrollMode); +begin + if FScrollMode <> Value then + begin + DestroyScrollTimer; + FScrollMode := Value; + if FScrollMode <> smNone then + CreateScrollTimer; + end; +end; + +procedure TcxCustomLookupGrid.ShowNextPage; +begin + if ViewInfo.VisibleRowCount > 1 then + TopRowIndex := TopRowIndex + ViewInfo.VisibleRowCount - 1 + else + TopRowIndex := TopRowIndex + 1; +end; + +procedure TcxCustomLookupGrid.ShowPrevPage; +begin + if ViewInfo.VisibleRowCount > 1 then + TopRowIndex := TopRowIndex - (ViewInfo.VisibleRowCount - 1) // TODO: AutoHeight + else + TopRowIndex := TopRowIndex - 1; +end; + +procedure TcxCustomLookupGrid.UpdateFocusing; +begin + UpdateRowInfo(FocusedRowIndex, False); +end; + +procedure TcxCustomLookupGrid.UpdateRowInfo(ARowIndex: Integer; ARecalculate: Boolean); +var + ARowViewInfo: TcxLookupGridRowViewInfo; +begin + ARowViewInfo := ViewInfo.Rows.FindByRowIndex(ARowIndex); + if ARowViewInfo <> nil then + begin + if ARecalculate then + begin + ARowViewInfo.IsFocused := ARowViewInfo.RowIndex = FocusedRowIndex; + ViewInfo.CalculateCells(ARowViewInfo); + end; + InvalidateRect(ARowViewInfo.Bounds, False); + end; +end; + +procedure TcxCustomLookupGrid.UpdateLayout; +begin + if HandleAllocated then + begin + ViewInfo.Calculate; + Painter.Invalidate; + UpdateScrollBars; + end; +end; + +procedure TcxCustomLookupGrid.DataChanged; +begin + // TODO: + LayoutChanged; + if Assigned(FOnDataChanged) then + FOnDataChanged(Self); +end; + +procedure TcxCustomLookupGrid.DataLayoutChanged; +begin + // TODO: + LayoutChanged; +end; + +procedure TcxCustomLookupGrid.DoClick; +begin + if Assigned(FOnClick) then + FOnClick(Self); +end; + +procedure TcxCustomLookupGrid.DoCloseUp(AAccept: Boolean); +begin + if Assigned(FOnCloseUp) then + FOnCloseUp(Self, AAccept); +end; + +procedure TcxCustomLookupGrid.DoFocusedRowChanged; +begin + if Assigned(FOnFocusedRowChanged) then + FOnFocusedRowChanged(Self); +end; + +procedure TcxCustomLookupGrid.FocusedRowChanged(APrevFocusedRowIndex, AFocusedRowIndex: Integer); +begin + if IsRowVisible(AFocusedRowIndex) then + begin + UpdateRowInfo(APrevFocusedRowIndex, True); + UpdateRowInfo(AFocusedRowIndex, True); + end + else + begin + LayoutChanged; + MakeFocusedRowVisible; + end; +end; + +procedure TcxCustomLookupGrid.LayoutChanged; +begin + CheckTopRowIndex(TopRowIndex, True); + UpdateLayout; +end; + +procedure TcxCustomLookupGrid.SelectionChanged(AInfo: TcxSelectionChangedInfo); +var + I: Integer; +begin + if AInfo.Count = 0 then + LayoutChanged + else + for I := 0 to AInfo.Count - 1 do + UpdateRowInfo(AInfo.RowIndexes[I], True); +end; + +procedure TcxCustomLookupGrid.UpdateControl(AInfo: TcxUpdateControlInfo); +begin + if AInfo is TcxDataChangedInfo then + DataChanged + else + if AInfo is TcxLayoutChangedInfo then + DataLayoutChanged + else + if AInfo is TcxFocusedRowChangedInfo then + with TcxFocusedRowChangedInfo(AInfo) do + FocusedRowChanged(PrevFocusedRowIndex, FocusedRowIndex) + else + if AInfo is TcxSelectionChangedInfo then + SelectionChanged(TcxSelectionChangedInfo(AInfo)); +end; + +procedure TcxCustomLookupGrid.CreateScrollTimer; +begin + if FScrollTimer <> nil then Exit; + FScrollTimer := TcxTimer.Create(nil); + with FScrollTimer do + begin + Interval := ScrollTimerInterval; + OnTimer := ScrollTimerHandler; + end; +end; + +procedure TcxCustomLookupGrid.DestroyScrollTimer; +begin + FreeAndNil(FScrollTimer); +end; + +function TcxCustomLookupGrid.GetDataController: TcxCustomDataController; +begin + Result := TcxCustomDataController(FDataController); +end; + +function TcxCustomLookupGrid.GetFocusedColumn: TcxLookupGridColumn; +begin +// if (FFocusedColumn = nil) and (Columns.Count > 0) then +// FFocusedColumn := Columns[0]; + Result := FFocusedColumn; +end; + +function TcxCustomLookupGrid.GetFocusedColumnIndex: Integer; +begin + if FocusedColumn <> nil then + Result := FocusedColumn.Index + else + Result := -1; +end; + +function TcxCustomLookupGrid.GetFocusedRowIndex: Integer; +begin + Result := FDataController.GetFocusedRowIndex; +end; + +function TcxCustomLookupGrid.GetRowCount: Integer; +begin + Result := FDataController.GetRowCount; +end; + +procedure TcxCustomLookupGrid.SetColumns(Value: TcxLookupGridColumns); +begin + FColumns.Assign(Value); +end; + +procedure TcxCustomLookupGrid.SetDataController(Value: TcxCustomDataController); +begin + FDataController.Assign(Value); +end; + +procedure TcxCustomLookupGrid.SetFocusedColumn(Value: TcxLookupGridColumn); +begin + if Options.RowSelect then Value := nil; + if FocusedColumn <> Value then + begin + FFocusedColumn := Value; + Change([lgcLayout]); + end; +end; + +procedure TcxCustomLookupGrid.SetFocusedColumnIndex(Value: Integer); +begin + if Columns.Count = 0 then Exit; + if Value >= Columns.Count then + Value := Columns.Count - 1; + if Value < 0 then + Value := 0; + if FocusedColumnIndex <> Value then + FocusedColumn := Columns[Value]; +end; + +procedure TcxCustomLookupGrid.SetFocusedRowIndex(Value: Integer); +begin + FDataController.ChangeFocusedRowIndex(Value); +end; + +procedure TcxCustomLookupGrid.SetIsPopupControl(Value: Boolean); +begin + if FIsPopupControl <> Value then + begin + FIsPopupControl := Value; + Change([lgcLayout]); + end; +end; + +procedure TcxCustomLookupGrid.SetOptions(Value: TcxLookupGridOptions); +begin + FOptions.Assign(Value); +end; + +procedure TcxCustomLookupGrid.SetTopRowIndex(Value: Integer); +begin + CheckSetTopRowIndex(Value); + if TopRowIndex <> Value then + begin + CheckTopRowIndex(Value, False); + end; +end; + +procedure TcxCustomLookupGrid.ScrollTimerHandler(Sender: TObject); + + procedure ChangeFocusedRow(Value: Integer); + begin + if Value >= RowCount then + Value := RowCount - 1; + if Value < 0 then Value := 0; + FocusedRowIndex := Value; + MakeFocusedRowVisible; + SyncSelected(False); + end; + +var + P: TPoint; +begin + GetCursorPos(P); + P := ScreenToClient(P); + if P.Y < ViewInfo.VisibleRowsRect.Top then + ChangeFocusedRow(TopRowIndex - 1) + else + if P.Y > ViewInfo.VisibleRowsRect.Bottom then + ChangeFocusedRow(TopRowIndex + ViewInfo.VisibleRowCount + 1); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxMCListBox.pas b/official/x.35/ExpressEditors Library 5/Sources/cxMCListBox.pas new file mode 100644 index 00000000..21248f48 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxMCListBox.pas @@ -0,0 +1,1786 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressCommonLibrary } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCOMMONLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxMCListBox; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, Controls, ExtCtrls, Forms, Graphics, ImgList, Messages, + StdCtrls, SysUtils, cxClasses, cxContainer, cxControls, cxDataUtils, cxEdit, + cxExtEditConsts, cxExtEditUtils, cxGraphics, cxHeader, cxLookAndFeelPainters, + cxLookAndFeels, cxScrollBar; + +type + TcxMCInnerHeader = class; + TcxMCListBox = class; + + { TcxMCInnerHeader } + + TcxMCInnerHeader = class(TcxHeader, IUnknown, + IcxContainerInnerControl) + private + FContainer: TcxContainer; + function GetControlContainer: TcxContainer; + function GetControl: TWinControl; + function GetContainer: TcxMCListBox; + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; + procedure WMSetFocus(var Message: TWMSetFocus); message WM_SETFOCUS; + protected + procedure AdjustSize; override; + procedure Click; override; +// procedure DoSectionEndResizeEvent(Section: TcxHeaderSection); override; + function IsInnerControl: Boolean; override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); override; + procedure Notification(AComponent: TComponent; + Operation: TOperation); override; +// procedure AdjustScrollWidth; + procedure UpdateHeight; + property Container: TcxMCListBox read GetContainer; + public + constructor Create(AOwner: TComponent); override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + function UpdateAction(Action: TBasicAction): Boolean; override; + end; + + { TcxMCInnerListBox } + + TcxMCInnerListBox = class(TcxCustomInnerListBox) + private + FItems: TStrings; + FVScrollBarVisible: Boolean; + function GetContainer: TcxMCListBox; + function IsVScrollBarVisible: Boolean; + procedure ItemsChanged(Sender: TStrings; AStartIndex, AEndIndex: Integer); + procedure SetContainer(Value: TcxMCListBox); + procedure SetItems(Value: TStrings); + procedure WMPaint(var Message: TWMPaint); message WM_PAINT; + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; + protected + property Container: TcxMCListBox read GetContainer write SetContainer; + procedure Click; override; + procedure RecalcItemRects(AStartIndex: Integer = -1; + AEndIndex: Integer = -1); virtual; + procedure DrawLines; virtual; + procedure FullRepaint; virtual; + property VScrollBarVisible: Boolean read FVScrollBarVisible; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function CanFocus: Boolean; override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + function UpdateAction(Action: TBasicAction): Boolean; override; + published + property Items: TStrings read FItems write SetItems; + end; + + { TcxMCInnerPanel } + + TcxMCInnerPanel = class(TcxControl) + private + function GetMCListBox: TcxMCListBox; + procedure WMSetFocus(var Message: TWMSetFocus); message WM_SETFOCUS; + protected + procedure AdjustChildsPosition; + procedure BoundsChanged; override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); override; + procedure Paint; override; + property MCListBox: TcxMCListBox read GetMCListBox; + public + constructor Create(AOwner: TComponent); override; + end; + + { TcxMCListBox } + + TcxMCListBox = class(TcxContainer) + private + FAlignment: TAlignment; + FColumnLineColor: TColor; + FDelimiter: Char; + FInnerHeader: TcxMCInnerHeader; + FInnerHeaderSectionRectsWithoutScrollbar: TcxHeaderSectionRects; + FInnerHeaderSectionRectsWithScrollbar: TcxHeaderSectionRects; + FInnerListBox: TcxMCInnerListBox; + FInnerPanel: TcxMCInnerPanel; + FIntegralHeight: Boolean; + FInternalFlagCreatedHeader: Boolean; + FInternalPaint: Boolean; + FIsExitProcessing: Boolean; + FMultiLines: Boolean; + FOverflowEmptyColumn: Boolean; + FOverLoadList: TStringList; + FSavedHScroll: TScrollEvent; + FSavedIndex: Integer; + FShowColumnLines: Boolean; + FShowEndEllipsis: Boolean; + FShowHeader: Boolean; + function CalcCellTextRect(AApproximateRect: TRect; AItemIndex, AColumnIndex: Integer): TRect; + procedure DrawCellTextEx(var ARect: TRect; AFlags, AItemIndex, AColumnIndex: Integer); + procedure DrawCellText(ARect: TRect; AItemIndex, AColumnIndex: Integer); + function GetCellRect(AItemIndex, AColumnIndex, ATop, ABottom: Integer; + AVScrollBarVisible: Boolean): TRect; + function GetCellTextRect(AItemIndex, AColumnIndex, ATop, ABottom: Integer; + AVScrollBarVisible: Boolean): TRect; + function GetDelimiter: Char; + function GetImages: TCustomImageList; + procedure SetImages(Value: TCustomImageList); + function GetHeaderSectionRect(AIndex: Integer; + AVScrollBarVisible: Boolean): TRect; + function GetHeaderSections: TcxHeaderSections; + procedure SetHeaderSections(Value: TcxHeaderSections); + procedure SectionEndResizeHandler(HeaderControl: TcxCustomHeader; + Section: TcxHeaderSection); + procedure SectionTrackHandler(HeaderControl: TcxCustomHeader; + Section: TcxHeaderSection; Width: Integer; State: TcxSectionTrackState); + procedure SetMultiLines(Value: Boolean); + procedure SetAlignment(Value: TAlignment); + procedure SetShowEndEllipsis(Value: Boolean); + procedure SetDelimiter(Value: Char); + function GetHeaderDragReorder: Boolean; + procedure SetHeaderDragReorder(Value: Boolean); + procedure SetShowColumnLines(Value: Boolean); + procedure SetShowHeader(Value: Boolean); + procedure SetColumnLineColor(Value: TColor); + procedure SetOverflowEmptyColumn(Value: Boolean); + function GetTextPart(AItemIndex, AColumnIndex: Integer): string; + procedure SectionsChangeHandler(Sender: TObject); + procedure HScrollHandler(Sender: TObject; ScrollCode: TScrollCode; + var ScrollPos: Integer); + procedure SectionEndDragHandler(Sender: TObject); + procedure DrawItem(Control: TWinControl; Index: Integer; ARect: TRect; State: TOwnerDrawState); + procedure MeasureItem(Control: TWinControl; Index: Integer; var Height: Integer); + function GetCount: Integer; + function GetExtendedSelect: Boolean; + function GetItemHeight: Integer; + function GetItemIndex: Integer; + function GetItems: TStrings; + function GetMultiSelect: Boolean; + function GetReadOnly: Boolean; + function GetSelCount: Integer; + function GetSelected(Index: Integer): Boolean; + function GetSorted: Boolean; + function GetTopIndex: Integer; + procedure SetExtendedSelect(Value: Boolean); + procedure SetItemHeight(Value: Integer); + procedure SetItemIndex(Value: Integer); + procedure SetItems(Value: TStrings); + procedure SetMultiSelect(Value: Boolean); + procedure SetReadOnly(Value: Boolean); + procedure SetSelected(Index: Integer; Value: Boolean); + procedure SetSorted(Value: Boolean); + procedure SetTopIndex(Value: Integer); + function GetAutoComplete: Boolean; + function GetAutoCompleteDelay: Cardinal; + procedure SetAutoComplete(Value: Boolean); + procedure SetAutoCompleteDelay(Value: Cardinal); + function GetScrollWidth: Integer; + function GetTabWidth: Integer; + procedure SetIntegralHeight(Value: Boolean); + procedure SetScrollWidth(Value: Integer); + procedure SetTabWidth(Value: Integer); + protected + FDataBinding: TcxCustomDataBinding; + procedure CalcHeaderSectionRects; + function CalcItemHeight(AIndex: Integer; + AVScrollBarVisible: Boolean): Integer; virtual; + procedure CreateWnd; override; + procedure CursorChanged; override; + procedure FontChanged; override; + procedure AdjustInnerControl; override; + procedure DataChange; override; + procedure DoExit; override; + function IsInternalControl(AControl: TControl): Boolean; override; + function IsReadOnly: Boolean; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure Loaded; override; + function RefreshContainer(const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AIsMouseEvent: Boolean): Boolean; override; + procedure UpdateData; override; + function CanResize(var NewWidth, NewHeight: Integer): Boolean; override; + procedure SetSize; override; + procedure FullRepaint; + procedure SectionSortChangedHandler(Sender: TObject; + const Section: TcxHeaderSection; const ASortOrder: TcxHeaderSortOrder); virtual; + procedure WndProc(var Message: TMessage); override; + function GetDataBindingClass: TcxCustomDataBindingClass; virtual; + procedure GetOptimalHeight(var ANewHeight: Integer); + property DataBinding: TcxCustomDataBinding read FDataBinding; + property InnerHeader: TcxMCInnerHeader read FInnerHeader; + property ReadOnly: Boolean read GetReadOnly write SetReadOnly; + property ScrollWidth: Integer read GetScrollWidth write SetScrollWidth default 0; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function Focused: Boolean; override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + procedure GetTabOrderList(List: TList); override; + function UpdateAction(Action: TBasicAction): Boolean; override; + procedure AddItem(AItem: string; AObject: TObject); + procedure Clear; + procedure ClearSelection; + procedure DeleteSelected; + function ItemAtPos(const APos: TPoint; AExisting: Boolean): Integer; + function ItemRect(Index: Integer): TRect; + function ItemVisible(Index: Integer): Boolean; + procedure SelectAll; + {$IFDEF DELPHI6} + procedure CopySelection(ADestination: TCustomListControl); + procedure MoveSelection(ADestination: TCustomListControl); + {$ENDIF} + property Count: Integer read GetCount; + property InnerListBox: TcxMCInnerListBox read FInnerListBox write FInnerListBox; + property ItemIndex: Integer read GetItemIndex write SetItemIndex; + property SelCount: Integer read GetSelCount; + property Selected[Index: Integer]: Boolean read GetSelected write SetSelected; + property TopIndex: Integer read GetTopIndex write SetTopIndex; + published + property Align; + property Alignment: TAlignment read FAlignment write SetAlignment + default taLeftJustify; + property AutoComplete: Boolean read GetAutoComplete write SetAutoComplete + default True; + property AutoCompleteDelay: Cardinal read GetAutoCompleteDelay + write SetAutoCompleteDelay default cxDefaultAutoCompleteDelay; + property Anchors; + property BiDiMode; + property ColumnLineColor: TColor read FColumnLineColor + write SetColumnLineColor default clBtnShadow; + property Constraints; + property Delimiter: Char read GetDelimiter write SetDelimiter default #59; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ExtendedSelect: Boolean read GetExtendedSelect + write SetExtendedSelect default True; + property HeaderDragReorder: Boolean read GetHeaderDragReorder + write SetHeaderDragReorder default False; + property HeaderSections: TcxHeaderSections read GetHeaderSections + write SetHeaderSections; + property Images: TCustomImageList read GetImages write SetImages; + property ImeMode; + property ImeName; + property IntegralHeight: Boolean read FIntegralHeight + write SetIntegralHeight default False; + property ItemHeight: Integer read GetItemHeight write SetItemHeight + default 16; + property Items: TStrings read GetItems write SetItems; + property MultiLines: Boolean read FMultiLines write SetMultiLines + default False; + property MultiSelect: Boolean read GetMultiSelect write SetMultiSelect + default False; + property OverflowEmptyColumn: Boolean read FOverflowEmptyColumn + write SetOverflowEmptyColumn default True; + property ParentBiDiMode; + property ParentColor default False; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property ShowColumnLines: Boolean read FShowColumnLines + write SetShowColumnLines default True; + property ShowEndEllipsis: Boolean read FShowEndEllipsis + write SetShowEndEllipsis default True; + property ShowHeader: Boolean read FShowHeader write SetShowHeader + default True; + property ShowHint; + property Sorted: Boolean read GetSorted write SetSorted default False; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property TabWidth: Integer read GetTabWidth write SetTabWidth default 0; + property Visible; + property OnClick; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + cxVariants, dxThemeConsts, dxThemeManager, dxUxTheme; + +type + TMCStringList = class(TStringList) + private + SortOrder: TcxHeaderSortOrder; + SortColumn: Integer; + Delimiter: Char; + public +{$IFDEF DELPHI5} + procedure CustomSort(Compare: TStringListSortCompare); override; +{$ENDIF} + end; + + TStringsChangeEvent = procedure(Sender: TStrings; + AStartIndex, AEndIndex: Integer) of object; + + TcxMCListBoxStrings = class(TStrings) + private + FStorage: TStrings; + FUpdating: Boolean; + FOnChange: TStringsChangeEvent; + protected + function Get(Index: Integer): string; override; + function GetCount: Integer; override; + function GetObject(Index: Integer): TObject; override; + procedure Put(Index: Integer; const S: string); override; + procedure PutObject(Index: Integer; AObject: TObject); override; + procedure SetUpdateState(Updating: Boolean); override; + procedure Changed(AStartIndex: Integer = -1; + AEndIndex: Integer = -1); virtual; + property Storage: TStrings read FStorage; + public + constructor Create(AStorage: TStrings); virtual; + procedure Clear; override; + procedure Delete(Index: Integer); override; + procedure Exchange(Index1, Index2: Integer); override; + function IndexOf(const S: string): Integer; override; + procedure Insert(Index: Integer; const S: string); override; + procedure Move(CurIndex, NewIndex: Integer); override; + property OnChange: TStringsChangeEvent read FOnChange write FOnChange; + end; + +{$IFDEF DELPHI5} +function ListCompare(List: TStringList; Index1, Index2: Integer): Integer; + + function InternalCompareText(const S1, S2: string): Integer; + begin + Result := AnsiCompareText(S1, S2); + end; + +var + s1, s2: string; + FDelimiter: Char; +begin + FDelimiter := TMCStringList(List).Delimiter; + + s1 := GetWord(TMCStringList(List).SortColumn, List[Index1], FDelimiter); + s2 := GetWord(TMCStringList(List).SortColumn, List[Index2], FDelimiter); + + if TMCStringList(List).SortOrder = soAscending then + Result := InternalCompareText(s1, s2) + else + Result := InternalCompareText(s2, s1); +end; + +procedure TMCStringList.CustomSort(Compare: TStringListSortCompare); +begin + inherited CustomSort(ListCompare); +end; +{$ENDIF} + +{ TcxMCListBoxStrings } + +constructor TcxMCListBoxStrings.Create(AStorage: TStrings); +begin + inherited Create; + FStorage := AStorage; +end; + +procedure TcxMCListBoxStrings.Clear; +begin + Storage.Clear; +end; + +procedure TcxMCListBoxStrings.Delete(Index: Integer); +begin + Storage.Delete(Index); + Changed; +end; + +procedure TcxMCListBoxStrings.Exchange(Index1, Index2: Integer); +begin + Storage.Exchange(Index1, Index2); +end; + +function TcxMCListBoxStrings.IndexOf(const S: string): Integer; +begin + Result := Storage.IndexOf(S); +end; + +procedure TcxMCListBoxStrings.Insert(Index: Integer; const S: string); +begin + Storage.Insert(Index, S); + Changed(Index, Count - 1); +end; + +procedure TcxMCListBoxStrings.Move(CurIndex, NewIndex: Integer); +begin + Storage.Move(CurIndex, NewIndex); +end; + +function TcxMCListBoxStrings.Get(Index: Integer): string; +begin + Result := Storage[Index]; +end; + +function TcxMCListBoxStrings.GetCount: Integer; +begin + Result := Storage.Count; +end; + +function TcxMCListBoxStrings.GetObject(Index: Integer): TObject; +begin + Result := Storage.Objects[Index]; +end; + +procedure TcxMCListBoxStrings.Put(Index: Integer; const S: string); +begin + Storage[Index] := S; +end; + +procedure TcxMCListBoxStrings.PutObject(Index: Integer; AObject: TObject); +begin + Storage.Objects[Index] := AObject; +end; + +procedure TcxMCListBoxStrings.SetUpdateState(Updating: Boolean); +begin + FUpdating := Updating; + if Updating then + Storage.BeginUpdate + else + Storage.EndUpdate; + if not Updating then + Changed; +end; + +procedure TcxMCListBoxStrings.Changed(AStartIndex: Integer = -1; + AEndIndex: Integer = -1); +begin + if not FUpdating and Assigned(FOnChange) then + FOnChange(Self, AStartIndex, AEndIndex); +end; + +{ TcxMCInnerListBox } + +constructor TcxMCInnerListBox.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FItems := TcxMCListBoxStrings.Create(inherited Items); + TcxMCListBoxStrings(FItems).OnChange := ItemsChanged; +end; + +destructor TcxMCInnerListBox.Destroy; +begin + FreeAndNil(FItems); + inherited Destroy; +end; + +function TcxMCInnerListBox.CanFocus: Boolean; +begin + Result := Container.CanFocus; +end; + +function TcxMCInnerListBox.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action) or + Container.FDataBinding.ExecuteAction(Action); +end; + +function TcxMCInnerListBox.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action) or + Container.FDataBinding.UpdateAction(Action); +end; + +procedure TcxMCInnerListBox.Click; +begin + if Container.DataBinding.SetEditMode then + inherited Click; +end; + +procedure TcxMCInnerListBox.FullRepaint; +begin + InternalInvalidateRect(Self, GetControlRect(Self), True); +end; + +procedure TcxMCInnerListBox.SetItems(Value: TStrings); +begin + FItems.Assign(Value); +end; + +procedure TcxMCInnerListBox.WMPaint(var Message: TWMPaint); +begin + inherited; + if Container.ShowColumnLines then + DrawLines; +end; + +procedure TcxMCInnerListBox.CMFontChanged(var Message: TMessage); +begin + inherited; + RecalcItemRects; +end; + +procedure TcxMCInnerListBox.RecalcItemRects(AStartIndex: Integer = -1; + AEndIndex: Integer = -1); +var + AIsWindowRecreationNeeded: Boolean; + AItemHeight, ANewItemHeight, I: Integer; + AVScrollBarVisibilityChanged: Boolean; +begin + Container.CalcHeaderSectionRects; + + if (AStartIndex = -1) and (AEndIndex = -1) then + begin + AStartIndex := 0; + AEndIndex := Items.Count - 1; + end; + + AIsWindowRecreationNeeded := False; + AVScrollBarVisibilityChanged := FVScrollBarVisible <> IsVScrollBarVisible; + if AVScrollBarVisibilityChanged then + begin + FVScrollBarVisible := not FVScrollBarVisible; + (Parent as TcxMCInnerPanel).AdjustChildsPosition; + end; + for I := AStartIndex to AEndIndex do + begin + AItemHeight := Perform(LB_GETITEMHEIGHT, I, 0); + ANewItemHeight := Container.CalcItemHeight(I, FVScrollBarVisible); + if ANewItemHeight <> AItemHeight then + begin + AIsWindowRecreationNeeded := True; + Break; + end; + end; + if AIsWindowRecreationNeeded and HandleAllocated then + begin + RecreateWnd; + Update; + end; +end; + +function TcxMCInnerListBox.GetContainer: TcxMCListBox; +begin + Result := TcxMCListBox(FContainer); +end; + +function TcxMCInnerListBox.IsVScrollBarVisible: Boolean; +var + AItemsHeight: Integer; + I: Integer; +begin + AItemsHeight := 0; + for I := 0 to Items.Count - 1 do + begin + Inc(AItemsHeight, Container.CalcItemHeight(I, False)); + if AItemsHeight > Height then + Break; + end; + Result := AItemsHeight > Height; +end; + +procedure TcxMCInnerListBox.ItemsChanged(Sender: TStrings; + AStartIndex, AEndIndex: Integer); +begin + RecalcItemRects(AStartIndex, AEndIndex); +end; + +procedure TcxMCInnerListBox.SetContainer(Value: TcxMCListBox); +begin + FContainer := Value; +end; + +procedure TcxMCInnerListBox.DrawLines; +var + AColumnLineTop, I: Integer; + ALastItemRect: TRect; +begin + if Items.Count > 0 then + begin + ALastItemRect := ItemRect(Items.Count - 1); + if ALastItemRect.Bottom > Height then + Exit + else + AColumnLineTop := ALastItemRect.Bottom; + end + else + AColumnLineTop := 0; + + Canvas.Pen.Color := Container.ColumnLineColor; + Canvas.Pen.Width := 1; + for I := 0 to Container.HeaderSections.Count - 1 do + begin + Canvas.MoveTo(Container.HeaderSections[I].Right, AColumnLineTop); + Canvas.LineTo(Container.HeaderSections[I].Right, Height); + end; +end; + +{ TcxMCInnerHeader } + +constructor TcxMCInnerHeader.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := ControlStyle + [csNoDesignVisible]; + TabStop := False; +end; + +function TcxMCInnerHeader.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action) or + Container.FDataBinding.ExecuteAction(Action); +end; + +function TcxMCInnerHeader.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action) or + Container.FDataBinding.UpdateAction(Action); +end; + +procedure TcxMCInnerHeader.AdjustSize; +begin + inherited AdjustSize; + FitToClientWidth; +end; + +procedure TcxMCInnerHeader.Click; +begin + if Container.DataBinding.SetEditMode then + inherited Click; +end; + +//procedure TcxMCInnerHeader.DoSectionEndResizeEvent(Section: TcxHeaderSection); +//begin +// inherited DoSectionEndResizeEvent(Section); +// AdjustScrollWidth; +//end; + +function TcxMCInnerHeader.IsInnerControl: Boolean; +begin + Result := True; +end; + +procedure TcxMCInnerHeader.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + inherited LookAndFeelChanged(Sender, AChangedValues); + if HandleAllocated then + UpdateHeight; +end; + +procedure TcxMCInnerHeader.Notification(AComponent: TComponent; + Operation: TOperation); +var + AHeightCalculatingNeeded: Boolean; +begin + AHeightCalculatingNeeded := (Operation = opRemove) and (AComponent = Images); + inherited Notification(AComponent, Operation); + if AHeightCalculatingNeeded then + UpdateHeight; +end; + +procedure TcxMCInnerHeader.UpdateHeight; +var + APrevHeight: Integer; +begin + APrevHeight := Height; + if Container.ShowHeader then + Height := GetAutoHeight + else + Height := 0; + if Height <> APrevHeight then + begin + (Parent as TcxMCInnerPanel).AdjustChildsPosition; + Container.InnerListBox.RecalcItemRects; + end; +end; + +//procedure TcxMCInnerHeader.AdjustScrollWidth; +//var +// AScrollWidth, I: Integer; +//begin +// AScrollWidth := 0; +// for I := 0 to Sections.Count - 1 do +// Inc(AScrollWidth, Sections[I].Width); +// if AScrollWidth < Width then +// AScrollWidth := Width; +// Container.InnerListBox.ScrollWidth := AScrollWidth; +//end; + +function TcxMCInnerHeader.GetControlContainer: TcxContainer; +begin + Result := FContainer; +end; + +function TcxMCInnerHeader.GetControl: TWinControl; +begin + Result := Self; +end; + +function TcxMCInnerHeader.GetContainer: TcxMCListBox; +begin + Result := TcxMCListBox(FContainer); +end; + +procedure TcxMCInnerHeader.CMFontChanged(var Message: TMessage); +begin + inherited; + UpdateHeight; +end; + +procedure TcxMCInnerHeader.WMSetFocus(var Message: TWMSetFocus); +begin + Container.InnerListBox.SetFocus; +end; + +{ TcxMCInnerPanel } + +constructor TcxMCInnerPanel.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := ControlStyle - [csAcceptsControls]; + TabStop := False; +end; + +procedure TcxMCInnerPanel.AdjustChildsPosition; + + function GetInnerHeaderWidth: Integer; + begin + Result := ClientWidth; + if MCListBox.InnerListBox.VScrollBarVisible then + Dec(Result, GetScrollBarSize.cx); + end; + +begin + MCListBox.InnerHeader.SetBounds(0, 0, GetInnerHeaderWidth, + MCListBox.InnerHeader.Height); + MCListBox.InnerListBox.SetBounds(0, MCListBox.InnerHeader.Height, ClientWidth, + ClientHeight - MCListBox.InnerHeader.Height); +end; + +procedure TcxMCInnerPanel.BoundsChanged; +begin + inherited BoundsChanged; + AdjustChildsPosition; + MCListBox.InnerListBox.RecalcItemRects; +end; + +procedure TcxMCInnerPanel.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + inherited LookAndFeelChanged(Sender, AChangedValues); + Invalidate; +end; + +procedure TcxMCInnerPanel.Paint; +var + R: TRect; +begin + inherited Paint; + R := Rect(MCListBox.InnerHeader.Width, 0, ClientWidth, MCListBox.InnerHeader.Height); + InflateRect(R, 10, 0); + LookAndFeel.Painter.DrawHeaderControlSection(Canvas, R, cxEmptyRect, [], + [bTop, bBottom], cxbsNormal, taLeftJustify, vaTop, False, False, '', Canvas.Font, + clNone, clBtnFace); +end; + +function TcxMCInnerPanel.GetMCListBox: TcxMCListBox; +begin + Result := Parent as TcxMCListBox; +end; + +procedure TcxMCInnerPanel.WMSetFocus(var Message: TWMSetFocus); +var + AInnerListBox: TcxMCInnerListBox; +begin + AInnerListBox := TcxMCListBox(Parent).InnerListBox; + if AInnerListBox.CanFocus then + AInnerListBox.SetFocus; +end; + +{ TcxMCListBox } + +constructor TcxMCListBox.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FAlignment := taLeftJustify; + FMultiLines := False; + FShowEndEllipsis := True; + FDelimiter := ';'; + FOverflowEmptyColumn := True; + FShowColumnLines := True; + FColumnLineColor := clBtnShadow; + FInternalPaint := False; + FInternalFlagCreatedHeader := False; + FSavedIndex := -1; + FShowHeader := True; + Width := 121; + Height := 97; + FOverLoadList := TStringList.Create; + + FDataBinding := GetDataBindingClass.Create(Self, Self); + FDataBinding.OnDataChange := Self.DataChange; + FDataBinding.OnDataSetChange := Self.DataSetChange; + FDataBinding.OnUpdateData := Self.UpdateData; + + FInnerPanel := TcxMCInnerPanel.Create(Self); + FInnerPanel.Parent := Self; + FInnerPanel.Align := alClient; + FInnerPanel.LookAndFeel.MasterLookAndFeel := Style.LookAndFeel; + + FInnerHeader := TcxMCInnerHeader.Create(FInnerPanel); + InnerControl := FInnerPanel; + FInnerHeader.Color := clBtnFace; + FInnerHeader.ParentFont := True; + FInnerHeader.Parent := FInnerPanel; + FInnerHeader.FContainer := Self; + FInnerHeader.LookAndFeel.MasterLookAndFeel := Style.LookAndFeel; + FInnerHeader.OnSectionEndResize := SectionEndResizeHandler; + FInnerHeader.OnSectionTrack := SectionTrackHandler; + FInnerHeader.OnSectionsChange := SectionsChangeHandler; + FInnerHeader.OnSectionChangedSortOrder := SectionSortChangedHandler; + FInnerHeader.OnSectionEndDrag := SectionEndDragHandler; + FInnerHeader.AllowSort := True; + FInnerHeader.ResizeUpdate := False; + + FInnerListBox := TcxMCInnerListBox.Create(FInnerPanel); + FInnerListBox.ParentColor := True; + FInnerListBox.Parent := FInnerPanel; + FInnerListBox.Cursor := Cursor; + FInnerListBox.BorderStyle := bsNone; + FInnerListBox.Container := Self; + FInnerListBox.LookAndFeel.MasterLookAndFeel := Style.LookAndFeel; + FInnerListBox.Style := lbOwnerDrawVariable; + FInnerListBox.OnMeasureItem := MeasureItem; + FInnerListBox.OnDrawItem := DrawItem; + FSavedHScroll := FInnerListBox.HScrollBar.OnScroll; + FInnerListBox.HScrollBar.OnScroll := HScrollHandler; + + DataBinding.VisualControl := FInnerListBox; +end; + +destructor TcxMCListBox.Destroy; +begin + FreeAndNil(FInnerListBox); + FreeAndNil(FInnerHeader); + FreeAndNil(FInnerPanel); + FreeAndNil(FDataBinding); + FreeAndNil(FOverLoadList); + inherited Destroy; +end; + +function TcxMCListBox.Focused: Boolean; +begin + Result := inherited Focused or InnerListBox.Focused or FInnerHeader.Focused; +end; + +procedure TcxMCListBox.AddItem(AItem: string; AObject: TObject); +begin + Items.AddObject(AItem, AObject); +end; + +procedure TcxMCListBox.Clear; +begin + Items.Clear; +end; + +procedure TcxMCListBox.ClearSelection; +begin + FInnerListBox.ClearSelection; +end; + +procedure TcxMCListBox.DeleteSelected; +begin + FInnerListBox.DeleteSelected; +end; + +function TcxMCListBox.ItemAtPos(const APos: TPoint; AExisting: Boolean): Integer; +begin + Result := FInnerListBox.ItemAtPos(APos, AExisting); +end; + +function TcxMCListBox.ItemRect(Index: Integer): TRect; +begin + Result := FInnerListBox.ItemRect(Index); +end; + +function TcxMCListBox.ItemVisible(Index: Integer): Boolean; +begin + Result := FInnerListBox.ItemVisible(Index); +end; + +procedure TcxMCListBox.SelectAll; +begin + FInnerListBox.SelectAll; +end; + +{$IFDEF DELPHI6} +procedure TcxMCListBox.CopySelection(ADestination: TCustomListControl); +begin + FInnerListBox.CopySelection(ADestination); +end; + +procedure TcxMCListBox.MoveSelection(ADestination: TCustomListControl); +begin + FInnerListBox.MoveSelection(ADestination); +end; +{$ENDIF} + +procedure TcxMCListBox.CreateWnd; +var + FSection: TcxHeaderSection; +begin + inherited; + if not FInternalFlagCreatedHeader then + begin + FInternalFlagCreatedHeader := True; + if (FInnerHeader.Sections.Count = 0) then + begin + FSection := FInnerHeader.Sections.Add; + FSection.Text := 'Section #1'; + FSection.Width := FInnerHeader.Canvas.TextWidth(FSection.Text) + 4; + end; + end; +end; + +procedure TcxMCListBox.CursorChanged; +begin + inherited CursorChanged; + if FInnerListBox <> nil then + FInnerListBox.Cursor := Cursor; +end; + +procedure TcxMCListBox.FontChanged; +begin + inherited; + FullRepaint; + _TWinControlAccess._RecreateWnd(FInnerListBox); +end; + +procedure TcxMCListBox.AdjustInnerControl; +var + AFont: TFont; +begin + FInnerHeader.Font := ActiveStyle.GetVisibleFont; + + FInnerListBox.Color := ViewInfo.BackgroundColor; + AFont := TFont.Create; + try + AFont.Assign(Style.GetVisibleFont); + AFont.Color := ActiveStyle.GetVisibleFont.Color; + FInnerListBox.Font := AFont; + finally + AFont.Free; + end; +end; + +procedure TcxMCListBox.DataChange; +begin + if DataBinding.IsDataSourceLive then + ItemIndex := Items.IndexOf(VarToStr(DataBinding.GetStoredValue(evsText, Focused))) + else + ItemIndex := -1; +end; + +procedure TcxMCListBox.DoExit; +begin + if IsDestroying or FIsExitProcessing then + Exit; + FIsExitProcessing := True; + try + try + DataBinding.UpdateDataSource; + except + SetFocus; + raise; + end; + inherited DoExit; + finally + FIsExitProcessing := False; + end; +end; + +function TcxMCListBox.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action) or + FDataBinding.ExecuteAction(Action); +end; + +procedure TcxMCListBox.GetTabOrderList(List: TList); +var + AActiveControl: TWinControl; +begin + AActiveControl := GetParentForm(Self).ActiveControl; + if (AActiveControl <> Self) and CanFocus and (InnerListBox = AActiveControl) then + begin + List.Add(InnerListBox); + List.Remove(Self); + end; +end; + +function TcxMCListBox.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action) or + FDataBinding.UpdateAction(Action); +end; + +function TcxMCListBox.IsInternalControl(AControl: TControl): Boolean; +begin + if FInnerListBox = nil then + Result := True + else + Result := (AControl = FInnerListBox.HScrollBar) or (AControl = FInnerListBox.VScrollBar); + Result := Result or inherited IsInternalControl(AControl); +end; + +function TcxMCListBox.IsReadOnly: Boolean; +begin + Result := DataBinding.IsControlReadOnly; +end; + +procedure TcxMCListBox.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited KeyDown(Key, Shift); + case Key of + VK_PRIOR, VK_NEXT, VK_END, VK_HOME, VK_LEFT, VK_UP, VK_RIGHT, VK_DOWN: + if not DataBinding.SetEditMode then + Key := 0; + end; +end; + +procedure TcxMCListBox.KeyPress(var Key: Char); +begin + inherited KeyPress(Key); + if IsTextChar(Key) and not DataBinding.SetEditMode then + Key := #0 + else + if Key = Char(VK_ESCAPE) then + DataBinding.Reset; +end; + +procedure TcxMCListBox.Loaded; +begin + inherited; + FontChanged; +end; + +function TcxMCListBox.RefreshContainer(const P: TPoint; Button: TcxMouseButton; + Shift: TShiftState; AIsMouseEvent: Boolean): Boolean; +begin + Result := inherited RefreshContainer(P, Button, Shift, AIsMouseEvent); +end; + +procedure TcxMCListBox.UpdateData; +begin + if ItemIndex >= 0 then + DataBinding.SetStoredValue(evsText, Items[ItemIndex]) + else + DataBinding.SetStoredValue(evsText, ''); +end; + +function TcxMCListBox.CanResize(var NewWidth, NewHeight: Integer): Boolean; +begin + Result := inherited CanResize(NewWidth, NewHeight); + if not Result or not IntegralHeight or IsLoading then + Exit; + if Align in [alLeft, alRight, alClient] then + Exit; + GetOptimalHeight(NewHeight); +end; + +procedure TcxMCListBox.SetSize; +var + ANewHeight: Integer; + APrevBoundsRect: TRect; +begin + if IsLoading then + Exit; + APrevBoundsRect := FInnerListBox.BoundsRect; + try + if not IntegralHeight or (Align in [alLeft, alRight, alClient]) then + begin + inherited SetSize; + Exit; + end; + ANewHeight := Height; + GetOptimalHeight(ANewHeight); + if Height >= (FInnerHeader.Height + 2) then + Height := ANewHeight + else + Height := FInnerHeader.Height + 2; + inherited SetSize; + finally + if not EqualRect(APrevBoundsRect, FInnerListBox.BoundsRect) and + FInnerListBox.HandleAllocated then + KillMessages(FInnerListBox.Handle, WM_MOUSEMOVE, WM_MOUSEMOVE); + end; +end; + +procedure TcxMCListBox.WndProc(var Message: TMessage); +begin + if FInnerListBox <> nil then + case Message.Msg of + LB_ADDSTRING .. LB_MSGMAX: + begin + with Message do + Result := SendMessage(FInnerListBox.Handle, Msg, WParam, LParam); + Exit; + end; + end; + inherited WndProc(Message); +end; + +function TcxMCListBox.GetDataBindingClass: TcxCustomDataBindingClass; +begin + Result := TcxCustomDataBinding; +end; + +procedure TcxMCListBox.GetOptimalHeight(var ANewHeight: Integer); + + function GetItemHeight(AIndex: Integer): Integer; + begin + case FInnerListBox.Style of + lbStandard{$IFDEF DELPHI6}, lbVirtual{$ENDIF}: + Result := Canvas.FontHeight(Font); + lbOwnerDrawFixed{$IFDEF DELPHI6}, lbVirtualOwnerDraw{$ENDIF}: + Result := ItemHeight; + lbOwnerDrawVariable: + begin + Result := ItemHeight; + if (AIndex < Count) and Assigned(FInnerListBox.OnMeasureItem) then + FInnerListBox.OnMeasureItem(Self, AIndex, Result); + end; + end; + end; + +var + I: Integer; + ABorderExtent: TRect; + AItemHeight: Integer; + AListClientSize, AListSize, AScrollBarSize: TSize; + AScrollWidth: Integer; + AVScrollBar: Boolean; +begin + ABorderExtent := GetBorderExtent; + AListClientSize.cy := ABorderExtent.Top + ABorderExtent.Bottom; + AScrollBarSize := GetScrollBarSize; + AScrollWidth := ScrollWidth; + if AScrollWidth > 0 then + Inc(AScrollWidth, 4); + I := FInnerHeader.Height; + repeat + AItemHeight := GetItemHeight(I); + AListClientSize.cy := AListClientSize.cy + AItemHeight; + AListSize.cy := AListClientSize.cy; + AListClientSize.cx := Width - (ABorderExtent.Left + ABorderExtent.Right); + AVScrollBar := I + 1 < Count; + if AVScrollBar then + AListClientSize.cx := AListClientSize.cx - AScrollBarSize.cx; + if AListClientSize.cx < AScrollWidth then + AListSize.cy := AListSize.cy + AScrollBarSize.cy; + if AListSize.cy = ANewHeight then + Break; + if AListSize.cy > ANewHeight then + begin + if I > 0 then + begin + AListClientSize.cy := AListClientSize.cy - AItemHeight; + AListSize.cy := AListClientSize.cy; + AListClientSize.cx := Width - (ABorderExtent.Left + ABorderExtent.Right); + AVScrollBar := I < Count; + if AVScrollBar then + AListClientSize.cx := AListClientSize.cx - AScrollBarSize.cx; + if AListClientSize.cx < AScrollWidth then + AListSize.cy := AListSize.cy + AScrollBarSize.cy; + end; + Break; + end; + Inc(I); + until False; + ANewHeight := AListSize.cy; +end; + +function TcxMCListBox.CalcCellTextRect(AApproximateRect: TRect; AItemIndex, AColumnIndex: Integer): TRect; +begin + Result := AApproximateRect; + DrawCellTextEx(Result, DT_CALCRECT or DT_NOPREFIX or DT_VCENTER, AItemIndex, AColumnIndex); +end; + +procedure TcxMCListBox.DrawCellTextEx(var ARect: TRect; AFlags, AItemIndex, AColumnIndex: Integer); + + function GetDrawTextParams: TDrawTextParams; + begin + Result.cbSize := SizeOf(TDrawTextParams); + Result.iTabLength := TabWidth; + Result.iLeftMargin := 0; + Result.iRightMargin := 0; + end; + + function GetTextFlag(const AStartFlag: Longint): Longint; + const + ShowEndEllipsisArray: array[Boolean] of Integer = (0, DT_END_ELLIPSIS); + WordWrapArray: array[Boolean] of Integer = (0, DT_WORDBREAK); + begin + Result := AStartFlag or + SystemAlignmentsHorz[HeaderSections[AColumnIndex].Alignment] or + WordWrapArray[MultiLines] or ShowEndEllipsisArray[ShowEndEllipsis]; + if not MultiLines then + Result := Result or DT_SINGLELINE; + if FInnerListBox.TabWidth > 0 then + Result := Result or DT_EXPANDTABS or DT_TABSTOP; + end; + +var + ADrawTextParams: TDrawTextParams; + AText: string; +begin + ADrawTextParams := GetDrawTextParams; + AText := GetTextPart(AItemIndex, AColumnIndex); + DrawTextEx(FInnerListBox.Canvas.Handle, PChar(AText), + Length(AText), ARect, GetTextFlag(AFlags), @ADrawTextParams); +end; + +procedure TcxMCListBox.DrawCellText(ARect: TRect; AItemIndex, AColumnIndex: Integer); +begin + DrawCellTextEx(ARect, DT_NOPREFIX or DT_VCENTER, AItemIndex, AColumnIndex); +end; + +function TcxMCListBox.GetCellRect(AItemIndex, AColumnIndex, + ATop, ABottom: Integer; AVScrollBarVisible: Boolean): TRect; +var + AHeaderSectionRect: TRect; + I: Integer; +begin + AHeaderSectionRect := GetHeaderSectionRect(AColumnIndex, AVScrollBarVisible); + Result := Rect(AHeaderSectionRect.Left + 2, ATop, AHeaderSectionRect.Right - 2, ABottom); + if OverflowEmptyColumn then + for I := AColumnIndex + 1 to HeaderSections.Count - 1 do + if GetTextPart(AItemIndex, I) = '' then + Result.Right := Result.Right + RectWidth(GetHeaderSectionRect(I, AVScrollBarVisible)) + else + Break; +end; + +function TcxMCListBox.GetCellTextRect(AItemIndex, AColumnIndex, + ATop, ABottom: Integer; AVScrollBarVisible: Boolean): TRect; +begin + Result := CalcCellTextRect(GetCellRect(AItemIndex, AColumnIndex, ATop, ABottom, AVScrollBarVisible), + AItemIndex, AColumnIndex); +end; + +function TcxMCListBox.GetDelimiter: Char; +begin + Result := FDelimiter; +end; + +function TcxMCListBox.GetImages: TCustomImageList; +begin + Result := FInnerHeader.Images; +end; + +procedure TcxMCListBox.SetImages(Value: TCustomImageList); +begin + FInnerHeader.Images := Value; + FInnerHeader.UpdateHeight; +end; + +function TcxMCListBox.GetHeaderSectionRect(AIndex: Integer; + AVScrollBarVisible: Boolean): TRect; +begin + if AVScrollBarVisible then + Result := FInnerHeaderSectionRectsWithScrollbar[AIndex] + else + Result := FInnerHeaderSectionRectsWithoutScrollbar[AIndex]; +end; + +function TcxMCListBox.GetHeaderSections: TcxHeaderSections; +begin + Result := FInnerHeader.Sections; +end; + +procedure TcxMCListBox.SetHeaderSections(Value: TcxHeaderSections); +begin + FInnerHeader.Sections := Value; +end; + +procedure TcxMCListBox.SetAlignment(Value: TAlignment); +var + I: Integer; +begin + if FAlignment <> Value then + begin + FAlignment := Value; + for I := 0 to Pred(HeaderSections.Count) do + HeaderSections[I].Alignment := FAlignment; + FullRepaint; + end; +end; + +procedure TcxMCListBox.SetMultiLines(Value: Boolean); +begin + if FMultiLines <> Value then + begin + FMultiLines := Value; + FullRepaint; + end; +end; + +procedure TcxMCListBox.SetShowEndEllipsis(Value: Boolean); +begin + if FShowEndEllipsis <> Value then + begin + FShowEndEllipsis := Value; + FullRepaint; + end; +end; + +procedure TcxMCListBox.SetDelimiter(Value: Char); +begin + if FDelimiter <> Value then + begin + FDelimiter := Value; + FullRepaint; + end; +end; + +function TcxMCListBox.GetHeaderDragReorder: Boolean; +begin + Result := FInnerHeader.DragReorder; +end; + +procedure TcxMCListBox.SetHeaderDragReorder(Value: Boolean); +begin + FInnerHeader.DragReorder := Value; +end; + +procedure TcxMCListBox.SetShowColumnLines(Value: Boolean); +begin + if FShowColumnLines <> Value then + begin + FShowColumnLines := Value; + FullRepaint; + end; +end; + +procedure TcxMCListBox.SetShowHeader(Value: Boolean); +begin + if Value <> FShowHeader then + begin + FShowHeader := Value; + FInnerHeader.UpdateHeight; + end; +end; + +procedure TcxMCListBox.SetColumnLineColor(Value: TColor); +begin + if FColumnLineColor <> Value then + begin + FColumnLineColor := Value; + FullRepaint; + end; +end; + +procedure TcxMCListBox.SetOverflowEmptyColumn(Value: Boolean); +begin + if FOverflowEmptyColumn <> Value then + begin + FOverflowEmptyColumn := Value; + FullRepaint; + end; +end; + +procedure TcxMCListBox.SectionEndResizeHandler(HeaderControl: TcxCustomHeader; + Section: TcxHeaderSection); +begin + FullRepaint; +end; + +procedure TcxMCListBox.SectionsChangeHandler(Sender: TObject); +begin + FullRepaint; +end; + +procedure TcxMCListBox.HScrollHandler(Sender: TObject; ScrollCode: TScrollCode; + var ScrollPos: Integer); +begin + if Assigned(FSavedHScroll) then FSavedHScroll(Sender, ScrollCode, ScrollPos); +end; + +procedure TcxMCListBox.SectionEndDragHandler(Sender: TObject); +begin + FInnerListBox.Invalidate; +end; + +procedure TcxMCListBox.SectionTrackHandler(HeaderControl: TcxCustomHeader; + Section: TcxHeaderSection; Width: Integer; State: TcxSectionTrackState); +begin + if (State = tsTrackEnd) then + FullRepaint; +end; + +procedure TcxMCListBox.FullRepaint; +begin + Canvas.Canvas.Lock; + try + if Count = 0 then + FInnerListBox.FullRepaint + else + begin + FSavedIndex := ItemIndex; + FInternalPaint := True; + FInnerListBox.RecalcItemRects; + FInnerListBox.FullRepaint; + FInnerListBox.ItemIndex := FSavedIndex; + end; + finally + FInternalPaint := False; + Canvas.Canvas.Unlock; + end; +end; + +procedure TcxMCListBox.SectionSortChangedHandler(Sender: TObject; + const Section: TcxHeaderSection; const ASortOrder: TcxHeaderSortOrder); +var + TmpList: TMCStringList; +begin + if ASortOrder = soNone then + Exit; + + TmpList := TMCStringList.Create; + try + Items.BeginUpdate; + try + TmpList.Assign(Items); + try + TmpList.Delimiter := FDelimiter; + TmpList.SortOrder := ASortOrder; + + if ASortOrder = soNone then + TmpList.SortColumn := -1 + else + TmpList.SortColumn := Succ(Section.DataIndex); + + TmpList.Sort; + finally + Items.Assign(TmpList); + end; + finally + Items.EndUpdate; + end; + finally + TmpList.Free; + end; +end; + +function TcxMCListBox.GetTextPart(AItemIndex, AColumnIndex: Integer): string; +var + APartIndex: Integer; +begin + APartIndex := HeaderSections[AColumnIndex].DataIndex; + if APartIndex < 0 then + Result := '' + else + Result := GetWord(APartIndex + 1, Items[AItemIndex], FDelimiter); +end; + +procedure TcxMCListBox.DrawItem(Control: TWinControl; Index: Integer; + ARect: TRect; State: TOwnerDrawState); + + procedure AdjustCanvasColors; + var + ABackgroundColor, ATextColor: TColor; + begin + if (not FInternalPaint and (odSelected in State)) or + (FInternalPaint and (FSavedIndex = Index)) then + begin + ABackgroundColor := clHighlight; + ATextColor := clHighlightText; + end else + begin + ABackgroundColor := ActiveStyle.Color; + ATextColor := ActiveStyle.GetVisibleFont.Color; + end; + FInnerListBox.Canvas.Brush.Color := ABackgroundColor; + FInnerListBox.Canvas.Font.Color := ATextColor; + end; + + procedure DrawColumnSectionText(AColumnIndex: Integer); + var + ATextRect: TRect; + begin + ATextRect := GetCellRect(Index, AColumnIndex, ARect.Top, ARect.Bottom, + InnerListBox.VScrollBarVisible); + DrawCellText(ATextRect, Index, AColumnIndex); + FInnerListBox.Canvas.ExcludeClipRect(ATextRect); + end; + + procedure DrawColumnSectionLine(AColumnIndex: Integer); + begin + FInnerListBox.Canvas.Pen.Color := ColumnLineColor; + FInnerListBox.Canvas.Pen.Width := 1; + FInnerListBox.Canvas.MoveTo(GetHeaderSectionRect(AColumnIndex, InnerListBox.VScrollBarVisible).Right, ARect.Top); + FInnerListBox.Canvas.LineTo(GetHeaderSectionRect(AColumnIndex, InnerListBox.VScrollBarVisible).Right, ARect.Bottom); + end; + +var + I: Integer; +begin + AdjustCanvasColors; + FInnerListBox.Canvas.FillRect(ARect); + for I := 0 to HeaderSections.Count - 1 do + begin + DrawColumnSectionText(I); + if ShowColumnLines then + DrawColumnSectionLine(I); + end; +end; + +procedure TcxMCListBox.MeasureItem(Control: TWinControl; Index: Integer; var Height: Integer); +begin + Height := CalcItemHeight(Index, InnerListBox.VScrollBarVisible); +end; + +procedure TcxMCListBox.CalcHeaderSectionRects; + + procedure InternalCalcHeaderSectionRects(AHeaderWidth: Integer; + out ASectionRects: TcxHeaderSectionRects); + var + ASectionWidths: TcxHeaderSectionWidths; + I: Integer; + begin + InnerHeader.CalcSectionWidths(AHeaderWidth, ASectionWidths); + SetLength(ASectionRects, InnerHeader.Sections.Count); + for I := 0 to InnerHeader.Sections.Count - 1 do + ASectionRects[I] := InnerHeader.GetSectionRectBySectionWidths(AHeaderWidth, ASectionWidths, I); + end; + +begin + InternalCalcHeaderSectionRects(FInnerPanel.ClientWidth, FInnerHeaderSectionRectsWithoutScrollbar); + InternalCalcHeaderSectionRects(FInnerPanel.ClientWidth - GetScrollBarSize.cx, FInnerHeaderSectionRectsWithScrollbar); +end; + +function TcxMCListBox.CalcItemHeight(AIndex: Integer; AVScrollBarVisible: Boolean): Integer; +var + I, ATextHeight: Integer; + ACalcRect: TRect; +begin + Result := GetItemHeight; + ATextHeight := FInnerListBox.Canvas.TextHeight('Wq'); + if ATextHeight > Result then + Result := ATextHeight; + for I := 0 to HeaderSections.Count - 1 do + begin + ACalcRect := GetCellTextRect(AIndex, I, 0, Result, AVScrollBarVisible); + if RectHeight(ACalcRect) > Result then + Result := RectHeight(ACalcRect); + end; +end; + +function TcxMCListBox.GetCount: Integer; +begin + Result := FInnerListBox.Items.Count; +end; + +function TcxMCListBox.GetExtendedSelect: Boolean; +begin + Result := FInnerListBox.ExtendedSelect; +end; + +function TcxMCListBox.GetItemHeight: Integer; +begin + Result := FInnerListBox.ItemHeight; +end; + +function TcxMCListBox.GetItemIndex: Integer; +begin + Result := FInnerListBox.ItemIndex; +end; + +function TcxMCListBox.GetItems: TStrings; +begin + Result := FInnerListBox.Items; +end; + +function TcxMCListBox.GetMultiSelect: Boolean; +begin + Result := FInnerListBox.MultiSelect; +end; + +function TcxMCListBox.GetReadOnly: Boolean; +begin + Result := DataBinding.ReadOnly; +end; + +function TcxMCListBox.GetSelCount: Integer; +begin + Result := FInnerListBox.SelCount; +end; + +function TcxMCListBox.GetSelected(Index: Integer): Boolean; +begin + Result := FInnerListBox.Selected[Index]; +end; + +function TcxMCListBox.GetSorted: Boolean; +begin + Result := FInnerListBox.Sorted; +end; + +function TcxMCListBox.GetTopIndex: Integer; +begin + Result := FInnerListBox.TopIndex; +end; + +procedure TcxMCListBox.SetExtendedSelect(Value: Boolean); +begin + FInnerListBox.ExtendedSelect := Value; +end; + +procedure TcxMCListBox.SetItemHeight(Value: Integer); +begin + FInnerListBox.ItemHeight := Value; + FullRepaint; +end; + +procedure TcxMCListBox.SetItemIndex(Value: Integer); +begin + FInnerListBox.ItemIndex := Value; +end; + +procedure TcxMCListBox.SetItems(Value: TStrings); +begin + FInnerListBox.Items.Assign(Value); + DataChange; +end; + +procedure TcxMCListBox.SetMultiSelect(Value: Boolean); +begin + FInnerListBox.MultiSelect := Value; +end; + +procedure TcxMCListBox.SetReadOnly(Value: Boolean); +begin + DataBinding.ReadOnly := Value; +end; + +procedure TcxMCListBox.SetSelected(Index: Integer; Value: Boolean); +begin + FInnerListBox.Selected[Index] := Value; +end; + +procedure TcxMCListBox.SetSorted(Value: Boolean); +begin + FInnerListBox.Sorted := Value; +end; + +procedure TcxMCListBox.SetTopIndex(Value: Integer); +begin + FInnerListBox.TopIndex := Value; +end; + +function TcxMCListBox.GetAutoComplete: Boolean; +begin + Result := FInnerListBox.AutoComplete; +end; + +function TcxMCListBox.GetAutoCompleteDelay: Cardinal; +begin + Result := FInnerListBox.AutoCompleteDelay; +end; + +procedure TcxMCListBox.SetAutoComplete(Value: Boolean); +begin + FInnerListBox.AutoComplete := Value; +end; + +procedure TcxMCListBox.SetAutoCompleteDelay(Value: Cardinal); +begin + FInnerListBox.AutoCompleteDelay := Value; +end; + +function TcxMCListBox.GetScrollWidth: Integer; +begin + Result := FInnerListBox.ScrollWidth; +end; + +function TcxMCListBox.GetTabWidth: Integer; +begin + Result := FInnerListBox.TabWidth; +end; + +procedure TcxMCListBox.SetIntegralHeight(Value: Boolean); +begin + if Value <> FIntegralHeight then + begin + FIntegralHeight := Value; + SetSize; + end; +end; + +procedure TcxMCListBox.SetScrollWidth(Value: Integer); +begin + FInnerListBox.ScrollWidth := Value; +end; + +procedure TcxMCListBox.SetTabWidth(Value: Integer); +begin + FInnerListBox.Items.BeginUpdate; + try + FInnerListBox.TabWidth := Value; + finally + FInnerListBox.Items.EndUpdate; + end; +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxMRUEdit.pas b/official/x.35/ExpressEditors Library 5/Sources/cxMRUEdit.pas new file mode 100644 index 00000000..2f9859d8 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxMRUEdit.pas @@ -0,0 +1,464 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxMRUEdit; + +{$I cxVer.inc} + +interface + +uses + Messages, +{$IFDEF DELPHI6} + Types, +{$ENDIF} + SysUtils, Classes, Controls, Graphics, cxContainer, cxEdit, + cxDropDownEdit, cxFilterControlUtils; + +type + TcxCustomMRUEditProperties = class; + + TcxMRUEditDeleteLookupItemEvent = procedure(AProperties: TcxCustomMRUEditProperties; + AItemIndex: Integer) of object; + + { TcxCustomMRUEditProperties } + + TcxCustomMRUEditProperties = class(TcxCustomComboBoxProperties) + private + FMaxItemCount: Integer; + FShowEllipsis: Boolean; + FOnButtonClick: TNotifyEvent; + FOnDeleteLookupItem: TcxMRUEditDeleteLookupItemEvent; + procedure CheckItemCount; + procedure SetMaxItemCount(Value: Integer); + procedure SetShowEllipsis(Value: Boolean); + protected + procedure DoDeleteLookupItem(AItemIndex: Integer); + procedure DoOnNewLookupDisplayText(const AText: string); virtual; + procedure InternalAddItem(const AItem: string; + ARaiseOnNewLookupDisplayTextEvent: Boolean); virtual; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + class function GetContainerClass: TcxContainerClass; override; + procedure Update(AProperties: TcxCustomEditProperties); override; + procedure AddItem(const AItem: string); + // !!! + property MaxItemCount: Integer read FMaxItemCount write SetMaxItemCount + default 0; + property ShowEllipsis: Boolean read FShowEllipsis write SetShowEllipsis + default True; + property OnButtonClick: TNotifyEvent + read FOnButtonClick write FOnButtonClick; + property OnDeleteLookupItem: TcxMRUEditDeleteLookupItemEvent + read FOnDeleteLookupItem write FOnDeleteLookupItem; + end; + + { TcxMRUEditProperties } + + TcxMRUEditProperties = class(TcxCustomMRUEditProperties) + published + property Alignment; + property AssignedValues; + property AutoSelect; + property BeepOnError; + property ButtonGlyph; + property CaseInsensitive; + property CharCase; + property ClearKey; + property ClickKey; + property DropDownAutoWidth; + property DropDownListStyle; + property DropDownRows; + property DropDownSizeable; + property DropDownWidth; + property HideSelection; + property IgnoreMaskBlank; + property ImeMode; + property ImeName; + property ImmediateDropDown; + property ImmediatePost; + property ImmediateUpdateText; + property ItemHeight; + property LookupItems; + property MaskKind; + property EditMask; + property MaxItemCount; + property MaxLength; + property OEMConvert; + property PopupAlignment; + property PostPopupValueOnTab; + property ReadOnly; + property Revertable; + property ShowEllipsis; + property UseLeftAlignmentOnEditing; + property ValidateOnEnter; + property OnButtonClick; + property OnChange; + property OnCloseUp; + property OnDeleteLookupItem; + property OnDrawItem; + property OnEditValueChanged; + property OnInitPopup; + property OnMeasureItem; + property OnNewLookupDisplayText; + property OnPopup; + property OnValidate; + end; + + { TcxMRUEditProperties } + + TcxCustomMRUEdit = class(TcxCustomComboBox) + private + function GetProperties: TcxCustomMRUEditProperties; + function GetActiveProperties: TcxCustomMRUEditProperties; + procedure SetProperties(Value: TcxCustomMRUEditProperties); + protected + procedure DoButtonClick(AButtonVisibleIndex: Integer); override; + procedure DoEditKeyDown(var Key: Word; Shift: TShiftState); override; + procedure HandleSelectItem(Sender: TObject); override; + procedure InternalValidateDisplayValue(const ADisplayValue: TcxEditValue); override; + procedure PropertiesChanged(Sender: TObject); override; + public + procedure AddItem(const Value: string); virtual; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxCustomMRUEditProperties read GetActiveProperties; + property Properties: TcxCustomMRUEditProperties read GetProperties + write SetProperties; + end; + + { TcxMRUEdit } + + TcxMRUEdit = class(TcxCustomMRUEdit) + private + function GetActiveProperties: TcxMRUEditProperties; + function GetProperties: TcxMRUEditProperties; + procedure SetProperties(Value: TcxMRUEditProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxMRUEditProperties read GetActiveProperties; + property ItemIndex; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxMRUEditProperties read GetProperties write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Text; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +uses + Windows, cxControls, cxEditConsts, cxTextEdit; + +{ TcxCustomMRUEditProperties } + +constructor TcxCustomMRUEditProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FMaxItemCount := 0; + FShowEllipsis := True; + Buttons.Add; + GlyphButtonIndex := 1; + Buttons[1].Kind := bkEllipsis; + Buttons[1].Default := True; + DropDownListStyle := lsEditList; + MRUMode := True; +end; + +procedure TcxCustomMRUEditProperties.CheckItemCount; +begin + if FMaxItemCount > 0 then + while Items.Count > FMaxItemCount do + begin + DoDeleteLookupItem(Items.Count - 1); + Items.Delete(Items.Count - 1); + end; +end; + +procedure TcxCustomMRUEditProperties.SetMaxItemCount(Value: Integer); +begin + if Value < 0 then Value := 0; + if FMaxItemCount <> Value then + begin + FMaxItemCount := Value; + CheckItemCount; + Changed; + end; +end; + +procedure TcxCustomMRUEditProperties.SetShowEllipsis(Value: Boolean); +begin + if FShowEllipsis <> Value then + try + BeginUpdate; + FShowEllipsis := Value; + Buttons[1].Visible := Value; + if Value then + GlyphButtonIndex := 1 + else + GlyphButtonIndex := 0; + finally + EndUpdate; + end; +end; + +procedure TcxCustomMRUEditProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomMRUEditProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with TcxCustomMRUEditProperties(Source) do + begin + Self.MaxItemCount := MaxItemCount; + Self.ShowEllipsis := ShowEllipsis; + Self.OnButtonClick := OnButtonClick; + Self.OnDeleteLookupItem := OnDeleteLookupItem; + end; + finally + EndUpdate + end + end + else + inherited Assign(Source); +end; + +class function TcxCustomMRUEditProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxMRUEdit; +end; + +procedure TcxCustomMRUEditProperties.Update(AProperties: TcxCustomEditProperties); +begin + if AProperties is TcxCustomMRUEditProperties then + TcxCustomMRUEditProperties(AProperties).LookupItems.Assign(LookupItems); +end; + +procedure TcxCustomMRUEditProperties.AddItem(const AItem: string); +begin + InternalAddItem(AItem, True); +end; + +procedure TcxCustomMRUEditProperties.DoDeleteLookupItem(AItemIndex: Integer); +begin + if Assigned(FOnDeleteLookupItem) then + FOnDeleteLookupItem(Self, AItemIndex); +end; + +procedure TcxCustomMRUEditProperties.DoOnNewLookupDisplayText( + const AText: string); +begin + if Assigned(OnNewLookupDisplayText) then + OnNewLookupDisplayText(Self, AText); +end; + +procedure TcxCustomMRUEditProperties.InternalAddItem(const AItem: string; + ARaiseOnNewLookupDisplayTextEvent: Boolean); +var + I: Integer; +begin + if AItem = '' then + Exit; + I := LookupItems.IndexOf(AItem); + if I <> 0 then + if I = -1 then + begin + if ARaiseOnNewLookupDisplayTextEvent then + DoOnNewLookupDisplayText(AItem); + LookupItems.Insert(0, AItem); + CheckItemCount; + end + else + LookupItems.Move(I, 0); +end; + +{ TcxCustomMRUEdit } + +function TcxCustomMRUEdit.GetProperties: TcxCustomMRUEditProperties; +begin + Result := TcxCustomMRUEditProperties(FProperties); +end; + +function TcxCustomMRUEdit.GetActiveProperties: TcxCustomMRUEditProperties; +begin + Result := TcxCustomMRUEditProperties(InternalGetActiveProperties); +end; + +procedure TcxCustomMRUEdit.SetProperties(Value: TcxCustomMRUEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomMRUEdit.DoButtonClick(AButtonVisibleIndex: Integer); +begin + if AButtonVisibleIndex = 1 then + begin + with Properties do + if Assigned(OnButtonClick) then + OnButtonClick(Self); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnButtonClick) then + OnButtonClick(Self); + end; +end; + +procedure TcxCustomMRUEdit.DoEditKeyDown(var Key: Word; Shift: TShiftState); +begin + if (Key = VK_RETURN) and not(ssAlt in Shift) and + (not HasPopupWindow or (TcxCustomEditListBox(ILookupData.ActiveControl).ItemIndex = -1)) then + AddItem(Text); + inherited DoEditKeyDown(Key, Shift); +end; + +procedure TcxCustomMRUEdit.HandleSelectItem(Sender: TObject); +begin + inherited HandleSelectItem(Sender); + if not LookupItemsScrolling and DoEditing then + AddItem(Text); +end; + +procedure TcxCustomMRUEdit.InternalValidateDisplayValue( + const ADisplayValue: TcxEditValue); +begin + AddItem(Text); + inherited InternalValidateDisplayValue(ADisplayValue); +end; + +procedure TcxCustomMRUEdit.PropertiesChanged(Sender: TObject); +begin + with ActiveProperties do + if ShowEllipsis then + if ButtonGlyph.Empty then + Buttons[1].Kind := bkEllipsis + else + Buttons[1].Kind := bkGlyph + else + if ButtonGlyph.Empty then + Buttons[0].Kind := bkDown + else + Buttons[0].Kind := bkGlyph; + inherited PropertiesChanged(Sender); +end; + +procedure TcxCustomMRUEdit.AddItem(const Value: string); +begin + if Value <> '' then + begin + if ActiveProperties.LookupItems.IndexOf(Value) = -1 then + DoOnNewLookupDisplayText(Value); + ActiveProperties.InternalAddItem(Value, False); + end; +end; + +class function TcxCustomMRUEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomMRUEditProperties; +end; + +{ TcxMRUEdit } + +class function TcxMRUEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxMRUEditProperties; +end; + +function TcxMRUEdit.GetActiveProperties: TcxMRUEditProperties; +begin + Result := TcxMRUEditProperties(InternalGetActiveProperties); +end; + +function TcxMRUEdit.GetProperties: TcxMRUEditProperties; +begin + Result := TcxMRUEditProperties(FProperties); +end; + +procedure TcxMRUEdit.SetProperties(Value: TcxMRUEditProperties); +begin + FProperties.Assign(Value); +end; + +initialization + GetRegisteredEditProperties.Register(TcxMRUEditProperties, scxSEditRepositoryMRUItem); + FilterEditsController.Register(TcxMRUEditProperties, TcxFilterTextEditHelper); + +finalization + FilterEditsController.Unregister(TcxMRUEditProperties, TcxFilterTextEditHelper); + +end. + diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxMaskEdit.pas b/official/x.35/ExpressEditors Library 5/Sources/cxMaskEdit.pas new file mode 100644 index 00000000..39cd8e7f --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxMaskEdit.pas @@ -0,0 +1,3200 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxMaskEdit; + +{$I cxVer.inc} + +interface + +uses + {$IFDEF DELPHI6} + Variants, + {$ENDIF} + Windows, + Messages, + SysUtils, Classes, Controls, StdCtrls, Clipbrd, cxClasses, cxControls, cxContainer, + cxDataStorage, cxDataUtils, cxEdit, cxTextEdit, cxEditConsts, cxRegExpr, + cxStandardMask, cxFilterControlUtils; + +type + TcxEditMask = type string; + TcxEditMaskKind = (emkStandard, emkRegExpr, emkRegExprEx); + + TcxCustomMaskEdit = class; + TcxCustomMaskEditProperties = class; + + { EcxMaskEditError } + + EcxMaskEditError = class(EcxEditError); + + { TcxMaskEditCustomMode } + + TcxMaskEditCustomMode = class + private + FCharCase: TEditCharCase; + FEchoMode: TcxEditEchoMode; + FEditMask: string; + FProperties: TcxCustomMaskEditProperties; + function GetProperties: TcxCustomMaskEditProperties; + protected + FClipboardTextLength: Integer; + FEdit: TcxCustomMaskEdit; + FNeedUpdateEditValue: Boolean; + procedure ClearText; + function GetMaskKind: TcxEditMaskKind; virtual; + function HasEdit: Boolean; + property CharCase: TEditCharCase read FCharCase write FCharCase; + property EchoMode: TcxEditEchoMode read FEchoMode write FEchoMode; + property EditMask: string read FEditMask; + property Properties: TcxCustomMaskEditProperties read GetProperties; + public + constructor Create(AEdit: TcxCustomMaskEdit; AProperties: TcxCustomMaskEditProperties); virtual; + procedure AfterPasteFromClipboard; virtual; abstract; + procedure BeepOnError; + procedure Compile(AMask: string); virtual; abstract; + function GetEmptyString: string; virtual; abstract; + function GetFormattedText(AText: string; + AMatchForBlanksAndLiterals: Boolean = True): string; virtual; abstract; + procedure GotoEnd; virtual; abstract; + function IsCursorBegin: Boolean; virtual; abstract; + function IsCursorEnd: Boolean; virtual; abstract; + function IsFullValidText(AText: string): Boolean; virtual; abstract; + procedure LMouseDown; virtual; abstract; + procedure PrePasteFromClipboard; virtual; abstract; + function PressBackSpace: Boolean; virtual; abstract; + function PressDelete: Boolean; virtual; abstract; + function PressEnd: Boolean; virtual; abstract; + function PressHome: Boolean; virtual; abstract; + function PressLeft: Boolean; virtual; abstract; + function PressRight: Boolean; virtual; abstract; + function PressSymbol(var ASymbol: Char): Boolean; virtual; abstract; + procedure SetText(AText: string); virtual; abstract; + procedure SynchronizeEditValue; virtual; + procedure UpdateEditValue; virtual; abstract; + function GetUpdatedText(const AText: string; + AMatchForBlanksAndLiterals: Boolean = True): string; virtual; abstract; + property ClipboardTextLength: Integer read FClipboardTextLength write FClipboardTextLength; + end; + + TcxMaskEditCustomModeClass = class of TcxMaskEditCustomMode; + + { TcxMaskEditStandardMode } + + TcxMaskEditStandardMode = class(TcxMaskEditCustomMode) + protected + FMask: TcxStandardMask; + FSelStart: Integer; + function GetBlank(APos: Integer): Char; virtual; + public + constructor Create(AEdit: TcxCustomMaskEdit; AProperties: TcxCustomMaskEditProperties); override; + destructor Destroy; override; + procedure AfterPasteFromClipboard; override; + procedure Compile(AMask: string); override; + function GetEmptyString: string; override; + function GetFormattedText(AText: string; + AMatchForBlanksAndLiterals: Boolean = True): string; override; + procedure GotoEnd; override; + function IsCursorBegin: Boolean; override; + function IsCursorEnd: Boolean; override; + function IsFullValidText(AText: string): Boolean; override; + procedure LMouseDown; override; + procedure PrePasteFromClipboard; override; + function PressBackSpace: Boolean; override; + function PressDelete: Boolean; override; + function PressEnd: Boolean; override; + function PressHome: Boolean; override; + function PressLeft: Boolean; override; + function PressRight: Boolean; override; + function PressSymbol(var ASymbol: Char): Boolean; override; + procedure SetText(AText: string); override; + procedure SynchronizeEditValue; override; + procedure UpdateEditValue; override; + function GetUpdatedText(const AText: string; + AMatchForBlanksAndLiterals: Boolean = True): string; override; + end; + + { TcxMaskEditRegExprMode } + + TcxMaskEditRegExprMode = class(TcxMaskEditCustomMode) + protected + FBeginCursor: Boolean; + FHead: string; + FRegExpr: TcxRegExpr; + FSelect: string; + FTail: string; + FMouseAction: Boolean; + procedure ClearTail; + function CompileRegExpr(ARegExpr: TcxRegExpr): Boolean; + procedure CursorCorrection; + procedure DeleteSelection; virtual; + function GetMaskKind: TcxEditMaskKind; override; + function NextTail: Boolean; + procedure RestoreSelection; virtual; + public + constructor Create(AEdit: TcxCustomMaskEdit; AProperties: TcxCustomMaskEditProperties); override; + destructor Destroy; override; + procedure AfterPasteFromClipboard; override; + procedure Compile(AMask: string); override; + function GetEmptyString: string; override; + function GetFormattedText(AText: string; + AMatchForBlanksAndLiterals: Boolean = True): string; override; + procedure GotoEnd; override; + function IsCursorBegin: Boolean; override; + function IsCursorEnd: Boolean; override; + function IsFullValidText(AText: string): Boolean; override; + procedure LMouseDown; override; + procedure PrePasteFromClipboard; override; + function PressBackSpace: Boolean; override; + function PressDelete: Boolean; override; + function PressEnd: Boolean; override; + function PressHome: Boolean; override; + function PressLeft: Boolean; override; + function PressRight: Boolean; override; + function PressSymbol(var ASymbol: Char): Boolean; override; + procedure SetText(AText: string); override; + procedure SetRegExprCaseInsensitive; + procedure SynchronizeEditValue; override; + procedure UpdateEditValue; override; + function GetUpdatedText(const AText: string; + AMatchForBlanksAndLiterals: Boolean = True): string; override; + end; + + { TcxMaskEditRegExprExMode } + + TcxMaskEditRegExprExMode = class(TcxMaskEditRegExprMode) + private + FInternalUpdate: string; + procedure InternalSymbolUpdate(ASymbol: Char); + protected + FDeleteNumber: Integer; + FNewCursorPos: Integer; + FUpdate: string; + procedure Clear; + procedure CursorCorrection; + procedure DeleteSelection; override; + function GetMaskKind: TcxEditMaskKind; override; + procedure RestoreSelection; override; + procedure SymbolDelete; + procedure SymbolUpdate(ASymbol: Char); + procedure UpdateTail; + public + constructor Create(AEdit: TcxCustomMaskEdit; AProperties: TcxCustomMaskEditProperties); override; + destructor Destroy; override; + procedure AfterPasteFromClipboard; override; + procedure Compile(AMask: string); override; + function GetEmptyString: string; override; + function GetFormattedText(AText: string; + AMatchForBlanksAndLiterals: Boolean = True): string; override; + procedure GotoEnd; override; + function IsFullValidText(AText: string): Boolean; override; + procedure PrePasteFromClipboard; override; + function PressBackSpace: Boolean; override; + function PressDelete: Boolean; override; + function PressEnd: Boolean; override; + function PressHome: Boolean; override; + function PressLeft: Boolean; override; + function PressRight: Boolean; override; + function PressSymbol(var ASymbol: Char): Boolean; override; + procedure SetText(AText: string); override; + procedure UpdateEditValue; override; + end; + + { TcxCustomMaskEditProperties } + + TcxCustomMaskEditProperties = class(TcxCustomTextEditProperties) + private + FAlwaysShowBlanksAndLiterals: Boolean; + FCaseInsensitive: Boolean; + FEditMask: TcxEditMask; + FEmptyString: string; + FIgnoreMaskBlank: Boolean; + FMaskKind: TcxEditMaskKind; + FMaxLengthSetting: Boolean; + FTempMode: TcxMaskEditCustomMode; + function CreateMode: TcxMaskEditCustomMode; + function CreateMode1: TcxMaskEditCustomMode; + function GetEditMask: TcxEditMask; + function GetIsMasked: Boolean; + procedure SetAlwaysShowBlanksAndLiterals(AValue: Boolean); + procedure SetCaseInsensitive(AValue: Boolean); + procedure SetEditMask(Value: TcxEditMask); + procedure SetMaskKind(Value: TcxEditMaskKind); + function SpaceToken(AToken: Char): Boolean; + function TestTempEditMask: Boolean; + function TestTempMaskKind: Boolean; + protected + function EmptyMask(AMask: string): Boolean; + function GetEmptyString: string; + procedure SetCharCase(Value: TEditCharCase); override; + function GetDisplayFormatOptions: TcxEditDisplayFormatOptions; override; + function GetModeClass(AMaskKind: TcxEditMaskKind): TcxMaskEditCustomModeClass; virtual; + procedure MaxLengthChanged; override; + function UseLookupData: Boolean; override; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure Changed; override; + class function GetContainerClass: TcxContainerClass; override; +// function GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; override; + function IsEditValueValid(var EditValue: TcxEditValue; AEditFocused: Boolean): Boolean; override; + procedure PrepareDisplayValue(const AEditValue: TcxEditValue; var DisplayValue: TcxEditValue; + AEditFocused: Boolean); override; + procedure ValidateDisplayValue(var ADisplayValue: TcxEditValue; var AErrorText: TCaption; + var Error: Boolean; AEdit: TcxCustomEdit); override; + public + property IsMasked: Boolean read GetIsMasked; + // !!! + property AlwaysShowBlanksAndLiterals: Boolean + read FAlwaysShowBlanksAndLiterals write SetAlwaysShowBlanksAndLiterals + default False; + property CaseInsensitive: Boolean read FCaseInsensitive + write SetCaseInsensitive default True; + property EditMask: TcxEditMask read GetEditMask write SetEditMask; + property IgnoreMaskBlank: Boolean read FIgnoreMaskBlank + write FIgnoreMaskBlank default False; + property MaskKind: TcxEditMaskKind read FMaskKind write SetMaskKind + default emkStandard; + property ValidateOnEnter default True; + end; + + TcxMaskEditProperties = class; + + { TcxCustomMaskEdit } + + TcxCustomMaskEdit = class(TcxCustomTextEdit) + private + FInternalTextSelection: Boolean; + FMode: TcxMaskEditCustomMode; + FMyMessage: Boolean; + FShiftOn: Boolean; + FText: string; + function GetEditText: TCaption; + function GetProperties: TcxCustomMaskEditProperties; + function GetActiveProperties: TcxCustomMaskEditProperties; + function InternalGetEmptyString: string; + procedure InternalSetValue(AValue: string); + function IsCursorBegin: Boolean; + function IsCursorEnd: Boolean; + procedure SetEditText(AValue: TCaption); + procedure SetProperties(Value: TcxCustomMaskEditProperties); + procedure SendMyKeyDown(Key: Word; Shift: TShiftState); + procedure SendMyKeyPress(AKey: Char); + protected + procedure ChangeHandler(Sender: TObject); override; + procedure DblClick; override; + procedure DoEnter; override; + procedure DoEditKeyDown(var Key: Word; Shift: TShiftState); override; + procedure DoEditKeyPress(var Key: Char); override; + procedure DoEditKeyUp(var Key: Word; Shift: TShiftState); override; + procedure Initialize; override; + function InternalGetText: string; override; + procedure InternalSetDisplayValue(const Value: TcxEditValue); override; + function InternalSetText(const Value: string): Boolean; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + procedure Loaded; override; + procedure LockInnerEditRepainting; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure PropertiesChanged(Sender: TObject); override; + procedure SelChange(Sender: TObject); override; + procedure SetSelText(const Value: TCaption); override; + procedure SynchronizeDisplayValue; override; + procedure UndoPerformed; override; + procedure UnlockInnerEditRepainting; override; + function CanSynchronizeModeText: Boolean; virtual; + procedure DirectSetSelLength(AValue: Integer); + procedure DirectSetSelStart(AValue: Integer); + function IsCharValidForPos(var AChar: Char; APos: Integer): Boolean; virtual; + procedure UpdateTextFormatting; virtual; + property Mode: TcxMaskEditCustomMode read FMode; + public + {$IFDEF CBUILDER10} + constructor Create(AOwner: TComponent); override; + {$ENDIF} + destructor Destroy; override; + procedure CutToClipboard; override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + procedure PasteFromClipboard; override; + procedure PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); override; + property ActiveProperties: TcxCustomMaskEditProperties read GetActiveProperties; + property EditText: TCaption read GetEditText write SetEditText; + property Properties: TcxCustomMaskEditProperties read GetProperties + write SetProperties; + end; + + { TcxMaskEditProperties } + + TcxMaskEditProperties = class(TcxCustomMaskEditProperties) + published + property Alignment; + property AlwaysShowBlanksAndLiterals; + property AssignedValues; + property AutoSelect; + property BeepOnError; + property CaseInsensitive; + property CharCase; + property ClearKey; + property EchoMode; + property HideSelection; + property IgnoreMaskBlank; + property ImeMode; + property ImeName; + property IncrementalSearch; + property LookupItems; + property LookupItemsSorted; + property MaskKind; + property EditMask; + property MaxLength; + property OEMConvert; + property PasswordChar; + property ReadOnly; + property UseLeftAlignmentOnEditing; + property ValidateOnEnter; + property OnChange; + property OnEditValueChanged; + property OnNewLookupDisplayText; + property OnValidate; + end; + + { TcxMaskEdit } + + TcxMaskEdit = class(TcxCustomMaskEdit) + private + function GetActiveProperties: TcxMaskEditProperties; + function GetProperties: TcxMaskEditProperties; + procedure SetProperties(Value: TcxMaskEditProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxMaskEditProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DragMode; + property Enabled; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxMaskEditProperties read GetProperties write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Text; + property Visible; + property DragCursor; + property DragKind; + property ImeMode; + property ImeName; + property OnClick; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDrag; + property OnEndDock; + property OnStartDock; + end; + + { TcxFilterMaskEditHelper } + + TcxFilterMaskEditHelper = class(TcxFilterTextEditHelper) + public + class function GetFilterEditClass: TcxCustomEditClass; override; + class function GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; override; + class procedure InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); override; + end; + +function IsAlphaChar(ch: Char): Boolean; +//function GetSaveLiteralChars(AMaskEdit: TcxCustomMaskEdit): Boolean; + +implementation + +uses + cxVariants; + +function IsAlphaChar(ch: Char): Boolean; +begin + Result := IsCharAlpha(ch); +end; + +{function GetSaveLiteralChars(AMaskEdit: TcxCustomMaskEdit): Boolean; +begin + Result := False; + if AMaskEdit.Mode is TcxMaskEditStandardMode then + if TcxMaskEditStandardMode(AMaskEdit.Mode).FMask <> nil then + Result := TcxMaskEditStandardMode(AMaskEdit.Mode).FMask.SaveLiteralCharacters; +end;} + +{ TcxMaskEditCustomMode } + +constructor TcxMaskEditCustomMode.Create(AEdit: TcxCustomMaskEdit; + AProperties: TcxCustomMaskEditProperties); +begin + inherited Create; + FEdit := AEdit; + if FEdit = nil then + FProperties := AProperties; + FClipboardTextLength := 0; + FNeedUpdateEditValue := False; + FCharCase := ecNormal; + FEchoMode := eemNormal; +end; + +procedure TcxMaskEditCustomMode.BeepOnError; +begin + if Properties.BeepOnError then + Beep; +end; + +procedure TcxMaskEditCustomMode.SynchronizeEditValue; +var + ADisplayValue: Variant; +begin + if HasEdit then + begin + with FEdit do + begin + if ModifiedAfterEnter then + begin + ADisplayValue := FEdit.DisplayValue; + ADisplayValue := GetFormattedText(ADisplayValue); + end + else + ActiveProperties.PrepareDisplayValue(EditValue, ADisplayValue, Focused); + end; + FEdit.SetInternalDisplayValue(ADisplayValue); + end; +end; + +procedure TcxMaskEditCustomMode.ClearText; +begin + if HasEdit then + FEdit.DataBinding.UpdateNotConnectedDBEditDisplayValue; +end; + +function TcxMaskEditCustomMode.GetMaskKind: TcxEditMaskKind; +begin + Result := emkStandard; +end; + +function TcxMaskEditCustomMode.HasEdit: Boolean; +begin + Result := (FEdit <> nil) and not FEdit.PropertiesChangeLocked; +end; + +function TcxMaskEditCustomMode.GetProperties: TcxCustomMaskEditProperties; +begin + if FEdit <> nil then + Result := FEdit.ActiveProperties + else + Result := FProperties; +end; + +{ TcxMaskEditStandardMode } + +constructor TcxMaskEditStandardMode.Create(AEdit: TcxCustomMaskEdit; + AProperties: TcxCustomMaskEditProperties); +begin + inherited Create(AEdit, AProperties); + + FMask := TcxStandardMask.Create; +end; + +destructor TcxMaskEditStandardMode.Destroy; +begin + FMask.Free; + inherited Destroy; +end; + +procedure TcxMaskEditStandardMode.AfterPasteFromClipboard; +var + AText: string; +begin + AText := Clipboard.AsText; + FEdit.SelStart := FSelStart + Length(AText); + if FEdit.SelStart >= Length(FEdit.EditText) then + FEdit.SelStart := Length(FEdit.EditText) - 1; + if FEdit.SelStart < 0 then + FEdit.SelStart := 0; + if FMask.Items[FEdit.SelStart] is TcxStandardMaskLiteralItem then + begin + FEdit.FShiftOn := False; + PressRight; + end; +end; + +procedure TcxMaskEditStandardMode.Compile(AMask: string); +begin + FEditMask := AMask; + if Properties.EmptyMask(AMask) then + Exit; + + FMask.Compile(AMask); + + FNeedUpdateEditValue := not HasEdit; +end; + +function TcxMaskEditStandardMode.GetEmptyString: string; +begin + Result := FMask.EmptyString; +end; + +function TcxMaskEditStandardMode.GetFormattedText(AText: string; + AMatchForBlanksAndLiterals: Boolean = True): string; +begin + FMask.Format(AText, True, AMatchForBlanksAndLiterals); + Result := AText; +end; + +procedure TcxMaskEditStandardMode.GotoEnd; +begin +end; + +function TcxMaskEditStandardMode.IsCursorBegin: Boolean; +var + I: Integer; + ACount: Integer; +begin + ACount := 0; + for I := 0 to FMask.Count - 1 do + begin + if FMask.Items[I] is TcxStandardMaskLiteralItem then + Inc(ACount) + else + Break; + end; + Result := (FEdit.SelStart <= ACount) and (FEdit.SelLength <= 1) or + (FEdit.SelStart <= ACount) and (FEdit.CursorPos = FEdit.SelStart); +end; + +function TcxMaskEditStandardMode.IsCursorEnd: Boolean; +begin + Result := FEdit.SelStart = Length(FEdit.EditText); +end; + +function TcxMaskEditStandardMode.IsFullValidText(AText: string): Boolean; +begin + Result := FMask.IsFullValid(AText); + if not Result and Properties.IgnoreMaskBlank then + Result := AText = GetFormattedText(''); +end; + +procedure TcxMaskEditStandardMode.LMouseDown; +begin + if FEdit.HandleAllocated and Properties.IsMasked then + begin + if FEdit.SelLength = 0 then + FEdit.DirectSetSelLength(1); + end; +end; + +procedure TcxMaskEditStandardMode.PrePasteFromClipboard; +var + AText: string; +begin + AText := Clipboard.AsText; + FSelStart := FEdit.SelStart; + FEdit.DirectSetSelStart(FSelStart); + FEdit.DirectSetSelLength(Length(AText)); +end; + +function TcxMaskEditStandardMode.PressBackSpace: Boolean; +begin + Result := False; + + if FEdit.SelLength <= 1 then + PressLeft; + PressDelete; +end; + +function TcxMaskEditStandardMode.PressDelete: Boolean; +var + ABlank: Char; + ASelStart: Integer; + AText: string; + I: Integer; +begin + Result := False; + + AText := FEdit.EditText; + ASelStart := FEdit.SelStart; + for I := FEdit.SelStart to FEdit.SelStart + FEdit.SelLength - 1 do + begin + if FMask.Items[I] is TcxStandardMaskManyItem then + begin + ABlank := GetBlank(I + 1); + if ABlank <> #0 then + begin + Delete(AText, I + 1, 1); + Insert(ABlank, AText, I + 1); + FEdit.SetInternalDisplayValue(AText); + FEdit.SelStart := ASelStart; + end; + end; + end; +end; + +function TcxMaskEditStandardMode.PressEnd: Boolean; +begin + if FEdit.FShiftOn then + begin + Result := True; + Exit; + end + else + Result := False; + + FEdit.SelStart := Length(FEdit.EditText); +end; + +function TcxMaskEditStandardMode.PressHome: Boolean; +begin + if FEdit.FShiftOn then + begin + Result := True; + Exit; + end + else + Result := False; + + FEdit.SelStart := 0; + if FMask.Count > 0 then + if FMask.Items[FEdit.SelStart] is TcxStandardMaskLiteralItem then + PressRight; +end; + +function TcxMaskEditStandardMode.PressLeft: Boolean; + function GetSelStart: Integer; + var + I: Integer; + AReset: Boolean; + AEnd: Integer; + begin + Result := 0; + AReset := True; + AEnd := FEdit.SelStart + FEdit.SelLength; + if AEnd >= Length(FEdit.EditText) then + Dec(AEnd); + if AEnd < 0 then + AEnd := 0; + for I := FEdit.SelStart to AEnd do + begin + if FMask.Items[I] is TcxStandardMaskLiteralItem then + Inc(Result) + else + begin + AReset := False; + Break; + end; + end; + if AReset then + begin + if FEdit.SelStart + FEdit.SelLength >= Length(FEdit.EditText) then + begin + Result := AEnd - FEdit.SelStart; + Inc(Result); + end + else + Result := 0; + end; + end; +var + ADec: Integer; + ALeftLiteralCount: Integer; + I: Integer; +begin + if FEdit.FShiftOn then + begin + if FEdit.SelLength = 1 then + begin + FEdit.SelStart := FEdit.SelStart + 1; + FEdit.SelLength := 0; + FEdit.SendMyKeyDown(VK_LEFT, []); + FEdit.SendMyKeyDown(VK_LEFT, []); + end; + + Result := True; + Exit; + end + else + Result := False; + + if FEdit.SelLength > 1 then + begin + I := FEdit.SelStart + GetSelStart; + FEdit.SelStart := 0; + FEdit.SelStart := I; + Exit; + end; + + ALeftLiteralCount := 0; + for I := FEdit.SelStart - 1 downto 0 do + begin + if FMask.Items[I] is TcxStandardMaskLiteralItem then + Inc(ALeftLiteralCount) + else + Break; + end; + + ADec := ALeftLiteralCount + 1; + if FEdit.SelStart - ADec < 0 then + ADec := 0; + + if FEdit.SelStart > 0 then + FEdit.SelStart := FEdit.SelStart - ADec; +end; + +function TcxMaskEditStandardMode.PressRight: Boolean; + function GetSelStart(AI: Integer): Integer; + var + I: Integer; + AReset: Boolean; + begin + Result := 0; + AReset := True; + for I := AI downto FEdit.SelStart do + begin + if FMask.Items[I] is TcxStandardMaskLiteralItem then + Inc(Result) + else + begin + AReset := False; + Break; + end; + end; + if AReset then + Result := 0; + end; +var + AInc: Integer; + ARightLiteralCount: Integer; + I: Integer; +begin + if FEdit.FShiftOn then + begin + if (FEdit.SelLength = 1) and (FEdit.SelStart = FEdit.CursorPos) then + FEdit.SelLength := 0; + + Result := True; + Exit; + end + else + Result := False; + + if FEdit.SelLength > 1 then + begin + I := FEdit.SelStart + FEdit.SelLength; + if I < Length(FEdit.EditText) then + begin + Dec(I); + Dec(I, GetSelStart(I)); + end; + FEdit.SelStart := 0; + FEdit.SelStart := I; + Exit; + end; + + ARightLiteralCount := 0; + for I := FEdit.SelStart + 1 to FMask.Count - 1 do + begin + if FMask.Items[I] is TcxStandardMaskLiteralItem then + Inc(ARightLiteralCount) + else + Break; + end; + + AInc := ARightLiteralCount + 1; + if FEdit.SelStart + AInc > Length(FEdit.EditText) then + AInc := 0; + + FEdit.SelStart := FEdit.SelStart + AInc; +end; + +function TcxMaskEditStandardMode.PressSymbol(var ASymbol: Char): Boolean; +var + AText: string; + ASelStart: Integer; +begin + Result := False; + if Length(FEdit.EditText) <= 0 then + Exit; + if FEdit.SelStart >= Length(FEdit.EditText) then + Exit; + if FMask.Items[FEdit.SelStart] is TcxStandardMaskLiteralItem then + begin + FEdit.FShiftOn := False; + if FEdit.SelLength > 1 then + PressDelete; + ASelStart := FEdit.SelStart; + PressRight; + if FEdit.SelStart > ASelStart then + PressSymbol(ASymbol); + end + else + begin + if FMask.Items[FEdit.SelStart].Check(ASymbol) and + FEdit.IsCharValidForPos(ASymbol, FEdit.SelStart + 1) then + if ASymbol <> #0 then + begin + if FEdit.SelLength > 1 then + PressDelete; + AText := FEdit.EditText; + ASelStart := FEdit.SelStart; + Delete(AText, FEdit.SelStart + 1 , 1); + Insert(ASymbol, AText, FEdit.SelStart + 1); + FEdit.SetInternalDisplayValue(AText); + FEdit.SelStart := ASelStart; + FEdit.FShiftOn := False; + PressRight; + end + else + BeepOnError; + end; +end; + +procedure TcxMaskEditStandardMode.SetText(AText: string); +begin + LMouseDown; +end; + +procedure TcxMaskEditStandardMode.SynchronizeEditValue; +begin + inherited SynchronizeEditValue; + LMouseDown; +end; + +procedure TcxMaskEditStandardMode.UpdateEditValue; +begin + if FNeedUpdateEditValue then + begin + FEdit.InternalEditValue := FMask.EmptyString; + FNeedUpdateEditValue := False; + end; +end; + +function TcxMaskEditStandardMode.GetUpdatedText(const AText: string; + AMatchForBlanksAndLiterals: Boolean = True): string; +begin + Result := AText; + if FMask.Count > 0 then + begin + FMask.Format(Result, Properties.CharCase = ecNormal, AMatchForBlanksAndLiterals); + FMask.Format2(Result); + end; +end; + +function TcxMaskEditStandardMode.GetBlank(APos: Integer): Char; +begin + Result := FMask.Blank; +end; + +{ TcxMaskEditRegExprMode } + +constructor TcxMaskEditRegExprMode.Create(AEdit: TcxCustomMaskEdit; + AProperties: TcxCustomMaskEditProperties); +begin + inherited Create(AEdit, AProperties); + + FRegExpr := TcxRegExpr.Create; + FRegExpr.CaseInsensitive := Properties.CaseInsensitive; + FMouseAction := False; +end; + +destructor TcxMaskEditRegExprMode.Destroy; +begin + FRegExpr.Free; + inherited Destroy; +end; + +procedure TcxMaskEditRegExprMode.AfterPasteFromClipboard; +begin +end; + +procedure TcxMaskEditRegExprMode.Compile(AMask: string); +var + I: Integer; + AStream: TStringStream; + AStr: string; +begin + FEditMask := AMask; + if Properties.EmptyMask(AMask) then + Exit; + + AStream := TStringStream.Create(AMask); + try + try + FRegExpr.Compile(AStream); + except + on E: EcxRegExprError do + begin + AStr := cxGetResourceString(@scxMaskEditRegExprError); + for I := 0 to E.Errors.Count - 1 do + AStr := AStr + #13#10 + E.Errors[I].FullMessage; + raise EcxMaskEditError.Create(AStr); + end; + end; + finally + AStream.Free; + end; +end; + +function TcxMaskEditRegExprMode.PressDelete: Boolean; +begin + CursorCorrection; + if FEdit.SelLength <= 0 then + begin + if FTail <> '' then + begin + FSelect := FTail[1]; + Delete(FTail, 1, 1); + + if not NextTail then + begin + ClearTail; + if FEdit.SelStart > 0 then + FEdit.DirectSetSelStart(FEdit.SelStart - 1); + end; + end; + + Result := True; + end + else + begin + DeleteSelection; + if NextTail then + Result := True + else + begin + FEdit.SendMyKeyDown(VK_DELETE, []); + ClearTail; + + Result := False; + end; + end; + + FSelect := ''; + + if not Result then + BeepOnError; +end; + +function TcxMaskEditRegExprMode.PressEnd: Boolean; +var + I: Integer; +begin + CursorCorrection; + Result := True; + + if FTail <> '' then + begin + for I := 1 to Length(FTail) do + begin + FRegExpr.Next(FTail[I]); + end; + FHead := FHead + FTail; + FTail := ''; + end; +end; + +function TcxMaskEditRegExprMode.PressHome: Boolean; +begin + CursorCorrection; + Result := True; + + if FHead <> '' then + begin + FTail := FHead + FTail; + FHead := ''; + FRegExpr.Reset; + end; +end; + +function TcxMaskEditRegExprMode.GetEmptyString: string; +begin + Result := ''; +end; + +function TcxMaskEditRegExprMode.GetFormattedText(AText: string; + AMatchForBlanksAndLiterals: Boolean = True): string; +var + I: Integer; +begin + if not FRegExpr.IsCompiled then + begin + Result := ''; + Exit; + end; + FRegExpr.Reset; + Result := ''; + for I := 1 to Length(AText) do + begin + if FRegExpr.Next(AText[I]) then + Result := Result + AText[I]; + end; +end; + +procedure TcxMaskEditRegExprMode.GotoEnd; +var + I: Integer; +begin + CursorCorrection; + if FTail = '' then + Exit; + + for I := 1 to Length(FTail) do + begin + FRegExpr.Next(FTail[I]); + end; + + FHead := FHead + FTail; + FTail := ''; +end; + +function TcxMaskEditRegExprMode.IsCursorBegin: Boolean; +begin + Result := FEdit.SelStart = 0; +end; + +function TcxMaskEditRegExprMode.IsCursorEnd: Boolean; +begin + Result := FEdit.SelStart = Length(FEdit.Text); +end; + +function TcxMaskEditRegExprMode.IsFullValidText(AText: string): Boolean; +var + ARegExpr: TcxRegExpr; + I: Integer; +begin + Result := AText = ''; + + if not Result then + begin + ARegExpr := TcxRegExpr.Create; + ARegExpr.CaseInsensitive := Properties.CaseInsensitive; + + Result := CompileRegExpr(ARegExpr); + if Result then + begin + for I := 1 to Length(AText) do + begin + if not ARegExpr.Next(AText[I]) then + begin + Result := False; + Break; + end; + end; + + if Result then + if not Properties.IgnoreMaskBlank then + Result := ARegExpr.IsFinal; + end; + + ARegExpr.Free; + end; +end; + +procedure TcxMaskEditRegExprMode.LMouseDown; +begin + FMouseAction := True; +end; + +procedure TcxMaskEditRegExprMode.PrePasteFromClipboard; +begin +end; + +function TcxMaskEditRegExprMode.PressBackSpace: Boolean; +begin + CursorCorrection; + if FEdit.SelLength <= 0 then + begin + if FHead <> '' then + begin + FRegExpr.Prev; + if NextTail then + Delete(FHead, Length(FHead), 1) + else + ClearTail; + end; + + Result := True; + end + else + begin + DeleteSelection; + if NextTail then + Result := True + else + begin + FEdit.SendMyKeyPress(#8); + + ClearTail; + + Result := False; + end; + end; + + FSelect := ''; + + if not Result then + BeepOnError; +end; + +function TcxMaskEditRegExprMode.PressLeft: Boolean; +var + I: Integer; +begin + CursorCorrection; + Result := True; + + if FHead <> '' then + begin + if FEdit.SelLength > 0 then + begin + if (FEdit.CursorPos = FEdit.SelStart + FEdit.SelLength) and + not FEdit.FShiftOn then + begin + for I := 0 to FEdit.SelLength - 1 do + begin + FRegExpr.Prev; + FTail := FHead[Length(FHead)] + FTail; + Delete(FHead, Length(FHead), 1); + end; + + Exit; + end + else if (FEdit.CursorPos = FEdit.SelStart) and not FEdit.FShiftOn then + Exit; + end; + + FRegExpr.Prev; + FTail := FHead[Length(FHead)] + FTail; + Delete(FHead, Length(FHead), 1); + end; +end; + +function TcxMaskEditRegExprMode.PressRight: Boolean; + + procedure GetTailFirstChar; + begin + FRegExpr.Next(FTail[1]); + FHead := FHead + FTail[1]; + Delete(FTail, 1, 1); + end; + +var + I: Integer; +begin + CursorCorrection; + Result := True; + + if FTail <> '' then + begin + if FEdit.SelLength > 0 then + begin + if (FEdit.CursorPos = FEdit.SelStart) and + not FEdit.FShiftOn then + begin + for I := 0 to FEdit.SelLength - 1 do + GetTailFirstChar; + Exit; + end + else if (FEdit.CursorPos = FEdit.SelStart + FEdit.SelLength) and + not FEdit.FShiftOn then + Exit; + end; + + GetTailFirstChar; + end; +end; + +function TcxMaskEditRegExprMode.PressSymbol(var ASymbol: Char): Boolean; +begin + CursorCorrection; + if FEdit.SelLength > 0 then + DeleteSelection; + + if FRegExpr.Next(ASymbol) then + begin + FHead := FHead + ASymbol; + if not NextTail then + begin + if FSelect <> '' then + begin + FEdit.SendMyKeyDown(VK_DELETE, []); + FEdit.SendMyKeyPress(ASymbol); + Result := False; + end + else + Result := True; + + ClearTail; + end + else + Result := True; + end + else + begin + RestoreSelection; + Result := False; + end; + + FSelect := ''; + + if not Result then + BeepOnError; +end; + +procedure TcxMaskEditRegExprMode.SetText(AText: string); +var + I: Integer; +begin + FRegExpr.Reset; + + if (ClipboardTextLength > 0) and (Length(AText) > 0) then + begin + FRegExpr.Reset; + for I := 1 to FEdit.SelStart + ClipboardTextLength do + begin + FRegExpr.Next(AText[I]); + end; + + FHead := Copy(AText, 1, FEdit.SelStart + ClipboardTextLength); + FTail := Copy(AText, FEdit.SelStart + ClipboardTextLength + 1, Length(AText)); + + ClipboardTextLength := 0; + end + else + begin + FHead := ''; + FTail := AText; + end; +end; + +procedure TcxMaskEditRegExprMode.SetRegExprCaseInsensitive; +begin + FRegExpr.CaseInsensitive := Properties.CaseInsensitive; +end; + +procedure TcxMaskEditRegExprMode.UpdateEditValue; +begin +end; + +function TcxMaskEditRegExprMode.GetUpdatedText(const AText: string; + AMatchForBlanksAndLiterals: Boolean = True): string; +begin + Result := AText; +end; + +procedure TcxMaskEditRegExprMode.ClearTail; +var + AStr: string; +begin + AStr := FEdit.DataBinding.DisplayValue; + Delete(AStr, FEdit.SelStart + 1, Length(FTail)); + FEdit.DataBinding.DisplayValue := AStr; + FEdit.DirectSetSelStart(Length(AStr)); + FTail := ''; +end; + +function TcxMaskEditRegExprMode.CompileRegExpr( + ARegExpr: TcxRegExpr): Boolean; +begin + if FRegExpr.Stream = nil then + begin + Result := False; + Exit; + end; + + Result := True; + try + ARegExpr.Compile(FRegExpr.Stream); + except + on EcxMaskEditError do + Result := False; + end; +end; + +procedure TcxMaskEditRegExprMode.CursorCorrection; +var + I: Integer; + ASymbol: Char; +begin + if ((FHead = '') and (FTail = '') and (FEdit.Text <> '')) or FMouseAction then + begin + FMouseAction := False; + FRegExpr.Reset; + FTail := FEdit.Text; + FHead := ''; + for I := 0 to FEdit.CursorPos - 1 do + begin + if Length(FEdit.Text) > I then + begin + ASymbol := Char(FEdit.Text[I + 1]); + FRegExpr.Next(ASymbol); + FHead := FHead + FTail[1]; + Delete(FTail, 1, 1); + end; + end; + end; +end; + +procedure TcxMaskEditRegExprMode.DeleteSelection; +var + I: Integer; +begin + if FEdit.SelStart = Length(FHead) then // Begin cursor + begin + FSelect := Copy(FTail, 1, FEdit.SelLength); + Delete(FTail, 1, FEdit.SelLength); + + FBeginCursor := True; + end + else if (FEdit.SelStart + FEdit.SelLength) = Length(FHead) then // End cursor + begin + FSelect := Copy(FHead, FEdit.SelStart + 1, FEdit.SelLength); + Delete(FHead, FEdit.SelStart + 1, FEdit.SelLength); + for I := 1 to Length(FSelect) do + FRegExpr.Prev; + + FBeginCursor := False; + end; +end; + +function TcxMaskEditRegExprMode.GetMaskKind: TcxEditMaskKind; +begin + Result := emkRegExpr; +end; + +function TcxMaskEditRegExprMode.NextTail: Boolean; +var + AIsCharValid: Boolean; + I, J, NextNumber: Integer; +begin + NextNumber := 0; + + for I := 1 to Length(FTail) do + begin + AIsCharValid := FRegExpr.Next(FTail[I]); + if AIsCharValid then + Inc(NextNumber) + else + begin + for J := 0 to NextNumber - 1 do + FRegExpr.Prev; + + Result := False; + Exit; + end; + end; + + for I := 1 to Length(FTail) do + FRegExpr.Prev; + + Result := True; +end; + +procedure TcxMaskEditRegExprMode.RestoreSelection; +var + I: Integer; +begin + if FBeginCursor then + FTail := FSelect + FTail + else + begin + FHead := FHead + FSelect; + for I := 1 to Length(FSelect) do + begin + FRegExpr.Next(FSelect[I]); + end; + end; +end; + +procedure TcxMaskEditRegExprMode.SynchronizeEditValue; +begin + inherited SynchronizeEditValue; + FEdit.SelStart := Length(FEdit.Text); + FHead := FEdit.Text; + FTail := ''; + FRegExpr.Reset; + FRegExpr.NextEx(FHead); +end; + +{ TcxMaskEditRegExprExMode } + +constructor TcxMaskEditRegExprExMode.Create(AEdit: TcxCustomMaskEdit; + AProperties: TcxCustomMaskEditProperties); +begin + inherited Create(AEdit, AProperties); + + FRegExpr.OnSymbolUpdate := SymbolUpdate; + FRegExpr.OnSymbolDelete := SymbolDelete; + FRegExpr.UpdateOn := True; + FNewCursorPos := -1; + Clear; +end; + +destructor TcxMaskEditRegExprExMode.Destroy; +begin + inherited Destroy; +end; + +procedure TcxMaskEditRegExprExMode.Clear; +begin + FUpdate := ''; + FDeleteNumber := 0; +end; + +procedure TcxMaskEditRegExprExMode.RestoreSelection; +begin + FRegExpr.UpdateOn := False; + + inherited RestoreSelection; + + FRegExpr.UpdateOn := True; + + if FUpdate <> '' then + begin + FRegExpr.Prev; + Clear; + end; +end; + +procedure TcxMaskEditRegExprExMode.SymbolDelete; +begin + Inc(FDeleteNumber); +end; + +procedure TcxMaskEditRegExprExMode.SymbolUpdate(ASymbol: Char); +begin + FUpdate := FUpdate + ASymbol; +end; + +procedure TcxMaskEditRegExprExMode.AfterPasteFromClipboard; +begin + if FNewCursorPos < 0 then + Exit; + + FEdit.DirectSetSelStart(FNewCursorPos); + FNewCursorPos := -1; +end; + +procedure TcxMaskEditRegExprExMode.Compile(AMask: string); +var + I: Integer; + AStream: TStringStream; + AStr: string; +begin + Clear; + FEditMask := AMask; + if Properties.EmptyMask(AMask) then + Exit; + + AStream := TStringStream.Create(AMask); + try + try + FRegExpr.Compile(AStream); + except + on E: EcxRegExprError do + begin + AStr := cxGetResourceString(@scxMaskEditRegExprError); + for I := 0 to E.Errors.Count - 1 do + AStr := AStr + #13#10 + E.Errors[I].FullMessage; + raise EcxMaskEditError.Create(AStr); + end; + end; + finally + AStream.Free; + end; + + FNeedUpdateEditValue := not HasEdit; +end; + +function TcxMaskEditRegExprExMode.GetEmptyString: string; +var + ARegExpr: TcxRegExpr; +begin + ARegExpr := TcxRegExpr.Create; + ARegExpr.CaseInsensitive := Properties.CaseInsensitive; + ARegExpr.UpdateOn := False; + + if CompileRegExpr(ARegExpr) then + begin + ARegExpr.OnSymbolUpdate := InternalSymbolUpdate; + FInternalUpdate := ''; + ARegExpr.UpdateOn := True; + Result := FInternalUpdate; + end + else + Result := ''; + + ARegExpr.Free; +end; + +function TcxMaskEditRegExprExMode.GetFormattedText(AText: string; + AMatchForBlanksAndLiterals: Boolean = True): string; +begin + if not FRegExpr.IsCompiled then + begin + Result := ''; + Exit; + end; + + FRegExpr.UpdateOn := False; + Clear; + + Result := inherited GetFormattedText(AText, AMatchForBlanksAndLiterals); + + FRegExpr.UpdateOn := True; + Result := Result + FUpdate; +end; + +procedure TcxMaskEditRegExprExMode.GotoEnd; +begin + FRegExpr.UpdateOn := False; + + inherited GotoEnd; + + FRegExpr.UpdateOn := True; +end; + +function TcxMaskEditRegExprExMode.IsFullValidText(AText: string): Boolean; +var + ARegExpr: TcxRegExpr; + + function IsStart: Boolean; + begin + ARegExpr.UpdateOn := True; + Result := AText = FInternalUpdate; + end; + +var + I: Integer; +begin + ARegExpr := TcxRegExpr.Create; + ARegExpr.CaseInsensitive := Properties.CaseInsensitive; + ARegExpr.UpdateOn := False; + Result := CompileRegExpr(ARegExpr); + + if Result then + begin + ARegExpr.OnSymbolUpdate := InternalSymbolUpdate; + FInternalUpdate := ''; + if not IsStart then + begin + ARegExpr.UpdateOn := False; + ARegExpr.Reset; + for I := 1 to Length(AText) do + begin + if not ARegExpr.Next(AText[I]) then + begin + Result := False; + Break; + end; + end; + + if Result then + if not Properties.IgnoreMaskBlank then + Result := ARegExpr.IsFinal; + end; + end; + + ARegExpr.Free; +end; + +procedure TcxMaskEditRegExprExMode.PrePasteFromClipboard; +begin + CursorCorrection; +end; + +function TcxMaskEditRegExprExMode.PressBackSpace: Boolean; +var + ASelLength: Integer; + I: Integer; +begin + CursorCorrection; + Clear; + + if FEdit.SelLength <= 0 then + begin + if FHead = '' then + begin + Result := False; + Exit; + end; + + FRegExpr.Prev; + + if FRegExpr.IsStart then + if FEdit.SelStart = FDeleteNumber then + begin + FRegExpr.Next(FHead[1]); + Result := False; + BeepOnError; + Exit; + end; + + Delete(FHead, Length(FHead) - FDeleteNumber, FDeleteNumber + 1); + + for I := 0 to FDeleteNumber do + FEdit.SendMyKeyPress(#8); + + FRegExpr.UpdateOn := False; + + if NextTail then + UpdateTail + else + ClearTail; + + FRegExpr.UpdateOn := True; + end + else + begin + DeleteSelection; + + if FEdit.SelStart = 0 then + begin + FRegExpr.UpdateOn := False; + FRegExpr.UpdateOn := True; + if FUpdate <> '' then + begin + FHead := FUpdate; + Clear; + ASelLength := FEdit.SelLength; + FEdit.SelStart := Length(FHead); + FEdit.SelLength := ASelLength - FEdit.SelStart; + FTail := Copy(FEdit.Text, FEdit.SelStart + 1, FEdit.SelLength) + FTail; + Result := PressBackSpace; + Exit; + end + end; + + FEdit.SendMyKeyPress(#8); + + FRegExpr.UpdateOn := False; + + if NextTail then + UpdateTail + else + ClearTail; + + FRegExpr.UpdateOn := True; + end; + + Result := False; +end; + +function TcxMaskEditRegExprExMode.PressDelete: Boolean; +var + I: Integer; +begin + CursorCorrection; + Clear; + + if FEdit.SelLength <= 0 then + begin + if FTail = '' then + begin + Result := False; + Exit; + end; + + if FEdit.SelStart = 0 then + begin + FRegExpr.UpdateOn := False; + FRegExpr.UpdateOn := True; + if FUpdate <> '' then + begin + FRegExpr.Prev; + Clear; + Result := False; + BeepOnError; + Exit; + end; + end; + + FRegExpr.Next(FTail[1]); + for I := 0 to Length(FUpdate) do + FEdit.SendMyKeyDown(VK_DELETE, []); + Delete(FTail, 1, Length(FUpdate) + 1); + FRegExpr.Prev; + + FRegExpr.UpdateOn := False; + + if NextTail then + UpdateTail + else + ClearTail; + + FRegExpr.UpdateOn := True; + end + else + PressBackSpace; + + Result := False; +end; + +function TcxMaskEditRegExprExMode.PressEnd: Boolean; +begin + Result := True; + + CursorCorrection; + Clear; + + FRegExpr.UpdateOn := False; + + inherited PressEnd; + + FRegExpr.UpdateOn := True; +end; + +function TcxMaskEditRegExprExMode.PressHome: Boolean; +begin + Result := True; + + CursorCorrection; + Clear; + + inherited PressHome; +end; + +function TcxMaskEditRegExprExMode.PressLeft: Boolean; +var + I: Integer; +begin + Result := True; + + CursorCorrection; + Clear; + + if FEdit.SelLength > 0 then + begin + if (FEdit.CursorPos = FEdit.SelStart + FEdit.SelLength) and + not FEdit.FShiftOn then + begin + FRegExpr.UpdateOn := False; + inherited PressLeft; + Clear; + FRegExpr.UpdateOn := True; + if FUpdate <> '' then + FRegexpr.Prev; + + Exit; + end + else if (FEdit.CursorPos = FEdit.SelStart) and not FEdit.FShiftOn then + Exit; + end; + + inherited PressLeft; + + if FRegExpr.IsStart then + if FEdit.SelStart = 0 then + begin + if FEdit.SelLength = FDeleteNumber then + Dec(FDeleteNumber); + end + else + if FEdit.SelStart = FDeleteNumber then + Dec(FDeleteNumber); + + if FDeleteNumber > 0 then + begin + for I := 0 to FDeleteNumber - 1 do + begin + FTail := FHead[Length(FHead) - I] + FTail; + FEdit.SendMyKeyDown(VK_LEFT, []); + end; + Delete(FHead, Length(FHead) - FDeleteNumber + 1, FDeleteNumber); + end; +end; + +function TcxMaskEditRegExprExMode.PressRight: Boolean; +var + I: Integer; +begin + Result := True; + + CursorCorrection; + Clear; + + if FEdit.SelLength > 0 then + begin + if (FEdit.CursorPos = FEdit.SelStart) and + not FEdit.FShiftOn then + begin + FRegExpr.UpdateOn := False; + inherited PressRight; + Clear; + FRegExpr.UpdateOn := True; + + Exit; + end + else if (FEdit.CursorPos = FEdit.SelStart + Fedit.SelLength) and + not FEdit.FShiftOn then + Exit; + end; + + inherited PressRight; + + if FUpdate <> '' then + begin + for I := 1 to Length(FUpdate) do + begin + FHead := FHead + FTail[I]; + FEdit.SendMyKeyDown(VK_RIGHT, []); + end; + Delete(FTail, 1, Length(FUpdate)); + end; +end; + +function TcxMaskEditRegExprExMode.PressSymbol(var ASymbol: Char): Boolean; +var + I: Integer; + ASelLength: Integer; +begin + CursorCorrection; + Clear; + + if FEdit.SelLength > 0 then + begin + DeleteSelection; + if FEdit.SelStart = 0 then + begin + FRegExpr.UpdateOn := False; + FRegExpr.UpdateOn := True; + if FUpdate <> '' then + begin + FHead := FUpdate; + Clear; + ASelLength := FEdit.SelLength; + FEdit.SelStart := Length(FHead); + FEdit.SelLength := ASelLength - FEdit.SelStart; + FTail := Copy(FEdit.Text, FEdit.SelStart + 1, FEdit.SelLength) + FTail; + Result := PressSymbol(ASymbol); + Exit; + end + end; + end; + + if FRegExpr.Next(ASymbol) then + begin + FHead := FHead + ASymbol + FUpdate; + + FEdit.SendMyKeyPress(ASymbol); + for I := 1 to Length(FUpdate) do + FEdit.SendMyKeyPress(FUpdate[I]); + + FRegExpr.UpdateOn := False; + + if NextTail then + UpdateTail + else + ClearTail; + + FRegExpr.UpdateOn := True; + end + else + begin + if FEdit.SelLength > 0 then + RestoreSelection; + + BeepOnError; + end; + + FSelect := ''; + Result := False; +end; + +procedure TcxMaskEditRegExprExMode.SetText(AText: string); +var + I: Integer; +begin + FRegExpr.UpdateOn := False; + FRegExpr.Reset; + + for I := 1 to Length(AText) do + begin + FRegExpr.Next(AText[I]); + end; + + Clear; + FRegExpr.UpdateOn := True; + FHead := AText + FUpdate; + FTail := ''; + + if HasEdit then + begin + FMouseAction := True; + CursorCorrection; + end; + + ClipboardTextLength := 0; +end; + +procedure TcxMaskEditRegExprExMode.UpdateEditValue; +begin + if FNeedUpdateEditValue then + begin + FEdit.InternalEditValue := FUpdate; + FNeedUpdateEditValue := False; + end; +end; + +procedure TcxMaskEditRegExprExMode.CursorCorrection; + + procedure Next; + begin + if FTail <> '' then + begin + Clear; + FRegExpr.Next(FTail[1]); + FHead := FHead + Copy(FTail, 1, Length(FUpdate) + 1); + Delete(FTail, 1, Length(FUpdate) + 1); + end; + end; + + procedure Prev; + begin + if FHead <> '' then + begin + Clear; + FRegExpr.Prev; + + FTail := Copy(FHead, Length(FHead) - FDeleteNumber, FDeleteNumber + 1) + FTail; + + if FRegExpr.IsStart then + FHead := '' + else + Delete(FHead, Length(FHead) - FDeleteNumber, FDeleteNumber + 1); + end; + end; + +var + ASelStart: Integer; + ASelEnd: Integer; + + procedure CorrectSelLength; + begin + while True do + begin + Next; + if ASelEnd <= Length(FHead) then + begin + FEdit.DirectSetSelLength(Length(FHead) - FEdit.SelStart); + Break; + end; + end; + end; + +begin + if not HasEdit or not FEdit.HandleAllocated then + Exit; + + if (FHead = '') and (FTail = '') and (FEdit.Text <> '') then + begin + FTail := FEdit.Text; + FRegExpr.Reset; + FMouseAction := True; + end; + + if not FMouseAction then + Exit + else + FMouseAction := False; + + ASelStart := FEdit.SelStart; + ASelEnd := FEdit.SelStart + FEdit.SelLength; + + // Correct FEdit.SelStart + if ASelStart > Length(FHead) then + while True do + begin + Next; + if ASelStart < Length(FHead) then + begin + Prev; + FEdit.DirectSetSelStart(Length(FHead)); + Break; + end + else + if ASelStart = Length(FHead) then + Break; + end + else + if ASelStart < Length(FHead) then + while True do + begin + Prev; + if ASelStart > Length(FHead) then + begin + FEdit.DirectSetSelStart(Length(FHead)); + Break; + end + else + if ASelStart = Length(FHead) then + Break; + end; + + // Correct FEdit.SelLength + if ASelEnd > ASelStart then + CorrectSelLength; +end; + +procedure TcxMaskEditRegExprExMode.DeleteSelection; +begin + FRegExpr.UpdateOn := False; + + inherited DeleteSelection; + + FRegExpr.UpdateOn := True; + + if FUpdate <> '' then + begin + FRegExpr.Prev; + Clear; + end; +end; + +function TcxMaskEditRegExprExMode.GetMaskKind: TcxEditMaskKind; +begin + Result := emkRegExprEx; +end; + +procedure TcxMaskEditRegExprExMode.UpdateTail; +var + I: Integer; +begin + Clear; + + if FTail = '' then + Exit; + + for I := 1 to Length(FTail) do + begin + FRegExpr.Next(FTail[I]); + FEdit.DirectSetSelStart(FEdit.SelStart + 1); + end; + + FRegExpr.UpdateOn := True; + + if FUpdate <> '' then + for I := 1 to Length(FUpdate) do + begin + FTail := FTail + FUpdate[I]; + FEdit.SendMyKeyPress(FUpdate[I]); + end; + + FRegExpr.UpdateOn := False; + + for I := 1 to Length(FTail) do + begin + FRegExpr.Prev; + FEdit.DirectSetSelStart(FEdit.SelStart - 1); + end; +end; + +procedure TcxMaskEditRegExprExMode.InternalSymbolUpdate(ASymbol: Char); +begin + FInternalUpdate := FInternalUpdate + ASymbol; +end; + +{ TcxCustomMaskEditProperties } + +constructor TcxCustomMaskEditProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + + MaskKind := emkStandard; + FAlwaysShowBlanksAndLiterals := False; + ValidateOnEnter := True; + CaseInsensitive := True; + FTempMode := nil; +end; + +destructor TcxCustomMaskEditProperties.Destroy; +begin + FTempMode.Free; + + inherited Destroy; +end; + +procedure TcxCustomMaskEditProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomMaskEditProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with Source as TcxCustomMaskEditProperties do + begin + Self.MaskKind := MaskKind; + Self.EditMask := EditMask; + Self.CaseInsensitive := CaseInsensitive; + Self.IgnoreMaskBlank := IgnoreMaskBlank; + Self.AlwaysShowBlanksAndLiterals := AlwaysShowBlanksAndLiterals; + end + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +procedure TcxCustomMaskEditProperties.Changed; +begin + FreeAndNil(FTempMode); + inherited Changed; +end; + +class function TcxCustomMaskEditProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxMaskEdit; +end; + +function TcxCustomMaskEditProperties.UseLookupData: Boolean; +begin + Result := not IsMasked and inherited UseLookupData; +end; + +{function TcxCustomMaskEditProperties.GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; +begin + if IsMasked then + Result := evsValue + else + Result := inherited GetEditValueSource(AEditFocused); +end;} + +function TcxCustomMaskEditProperties.IsEditValueValid(var EditValue: TcxEditValue; + AEditFocused: Boolean): Boolean; +begin + Result := IsMasked or inherited IsEditValueValid(EditValue, AEditFocused); +end; + +procedure TcxCustomMaskEditProperties.PrepareDisplayValue( + const AEditValue: TcxEditValue; var DisplayValue: TcxEditValue; AEditFocused: Boolean); +var + AText: string; +begin + if IsMasked and not (not AEditFocused and (IDefaultValuesProvider <> nil) and + IDefaultValuesProvider.IsDisplayFormatDefined(True)) then + begin + AText := VarToStr(AEditValue); + if (FTempMode = nil) or not TestTempMaskKind or not TestTempEditMask then + begin + FreeAndNil(FTempMode); + FTempMode := CreateMode; + end; + if FTempMode <> nil then + begin + if not AEditFocused and (FTempMode is TcxMaskEditStandardMode) then + begin + if not FAlwaysShowBlanksAndLiterals then + DisplayValue := FTempMode.GetUpdatedText(AText, False) + else + DisplayValue := FTempMode.GetFormattedText(AText, False); + end + else + DisplayValue := FTempMode.GetFormattedText(AText, False); + end; + end + else + inherited PrepareDisplayValue(AEditValue, DisplayValue, AEditFocused); +end; + +procedure TcxCustomMaskEditProperties.ValidateDisplayValue(var ADisplayValue: TcxEditValue; + var AErrorText: TCaption; var Error: Boolean; AEdit: TcxCustomEdit); +var + AText: string; +begin + if not Error then + begin + if not IsMasked{ or IgnoreMaskBlank }then + Error := False + else + begin + AText := VarToStr(ADisplayValue); + + Error := not TcxCustomMaskEdit(AEdit).Mode.IsFullValidText(AText); + + if Error then + AErrorText := cxGetResourceString(@scxMaskEditInvalidEditValue); + end; + end; + + inherited ValidateDisplayValue(ADisplayValue, AErrorText, Error, AEdit); +end; + +function TcxCustomMaskEditProperties.CreateMode: TcxMaskEditCustomMode; +begin + Result := nil; + if not EmptyMask(EditMask) then + begin + Result := GetModeClass(FMaskKind).Create(nil, Self); + Result.Compile(EditMask); + end; +end; + +function TcxCustomMaskEditProperties.CreateMode1: TcxMaskEditCustomMode; +begin + Result := GetModeClass(MaskKind).Create(nil, Self); +end; + +function TcxCustomMaskEditProperties.EmptyMask(AMask: string): Boolean; +var + I: Integer; +begin + Result := AMask = ''; + + if not Result then + begin + for I := 1 to Length(AMask) do + if not SpaceToken(AMask[I]) then + begin + Result := False; + Exit; + end; + + Result := True; + end; +end; + +function TcxCustomMaskEditProperties.GetEditMask: TcxEditMask; +begin + if FMaskKind <> emkStandard then + Result := FEditMask + else + begin + if EmptyMask(FEditMask) then + begin + if IDefaultValuesProvider <> nil then + Result := IDefaultValuesProvider.DefaultEditMask + else + Result := ''; + end + else + Result := FEditMask + end; +end; + +function TcxCustomMaskEditProperties.GetIsMasked: Boolean; +begin + Result := not EmptyMask(EditMask); +end; + +procedure TcxCustomMaskEditProperties.SetAlwaysShowBlanksAndLiterals(AValue: Boolean); +begin + if AValue <> FAlwaysShowBlanksAndLiterals then + begin + FAlwaysShowBlanksAndLiterals := AValue; + Changed; + end; +end; + +procedure TcxCustomMaskEditProperties.SetCaseInsensitive(AValue: Boolean); +begin + if CharCase = ecNormal then + FCaseInsensitive := AValue + else + FCaseInsensitive := True; + Changed; +end; + +procedure TcxCustomMaskEditProperties.SetEditMask(Value: TcxEditMask); +var + AMode: TcxMaskEditCustomMode; +begin + if EditMask = Value then + FEditMask := Value + else + begin + AMode := CreateMode1; + try + AMode.Compile(Value); + FEditMask := Value; + Changed; + finally + AMode.Free; + end; + end; +end; + +procedure TcxCustomMaskEditProperties.SetMaskKind(Value: TcxEditMaskKind); +begin + if Value <> FMaskKind then + begin + FMaskKind := Value; + Changed; + end; +end; + +function TcxCustomMaskEditProperties.GetDisplayFormatOptions: TcxEditDisplayFormatOptions; +begin + if not IsMasked then + Result := [dfoSupports] + else + Result := []; +end; + +function TcxCustomMaskEditProperties.GetModeClass( + AMaskKind: TcxEditMaskKind): TcxMaskEditCustomModeClass; +begin + case AMaskKind of + emkStandard: + Result := TcxMaskEditStandardMode; + emkRegExpr: + Result := TcxMaskEditRegExprMode; + else + Result := TcxMaskEditRegExprExMode; + end; +end; + +procedure TcxCustomMaskEditProperties.MaxLengthChanged; +begin + if IsMasked then + begin + if FMaxLengthSetting then + Exit; + FMaxLengthSetting := True; + BeginUpdate; + try + MaxLength := 0; + finally + FMaxLengthSetting := False; + EndUpdate; + end; + end + else + inherited MaxLengthChanged; +end; + +function TcxCustomMaskEditProperties.SpaceToken(AToken: Char): Boolean; +begin + Result := IsSpaceChar(AToken); +end; + +function TcxCustomMaskEditProperties.GetEmptyString: string; +begin + Result := FEmptyString; +end; + +procedure TcxCustomMaskEditProperties.SetCharCase(Value: TEditCharCase); +begin + if Value in [ecLowerCase, ecUpperCase] then + FCaseInsensitive := True; + + inherited SetCharCase(Value); +end; + +function TcxCustomMaskEditProperties.TestTempEditMask: Boolean; +begin + Result := FTempMode.EditMask = EditMask; +end; + +function TcxCustomMaskEditProperties.TestTempMaskKind: Boolean; +begin + Result := False; + case FMaskKind of + emkStandard: + Result := FTempMode is TcxMaskEditStandardMode; + emkRegExpr: + Result := FTempMode is TcxMaskEditRegExprMode; + emkRegExprEx: + Result := FTempMode is TcxMaskEditRegExprExMode; + end; +end; + +{ TcxCustomMaskEdit } + +{$IFDEF CBUILDER10} +constructor TcxCustomMaskEdit.Create(AOwner: TComponent); +begin + inherited Create(AOwner); +end; +{$ENDIF} + +destructor TcxCustomMaskEdit.Destroy; +begin + FreeAndNil(FMode); + inherited Destroy; +end; + +procedure TcxCustomMaskEdit.CutToClipboard; +begin + if ActiveProperties.IsMasked then + begin + if not Focused or DoEditing then + begin + CopyToClipboard; + if Mode.PressDelete then + SendMyKeyPress(Char(VK_BACK)); + end + end + else + inherited CutToClipBoard; +end; + +class function TcxCustomMaskEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomMaskEditProperties; +end; + +procedure TcxCustomMaskEdit.SendMyKeyDown(Key: Word; Shift: TShiftState); +begin + FMyMessage := True; + try + SendKeyDown(Self, Key, Shift); + finally + FMyMessage := False; + end; +end; + +procedure TcxCustomMaskEdit.SendMyKeyPress(AKey: Char); +begin + FMyMessage := True; + try + SendKeyPress(Self, AKey); + finally + FMyMessage := False; + end; +end; + +procedure TcxCustomMaskEdit.ChangeHandler(Sender: TObject); +begin + FText := FMode.GetUpdatedText(InnerEdit.EditValue); + + inherited ChangeHandler(Sender); +end; + +procedure TcxCustomMaskEdit.DblClick; +begin + if ActiveProperties.IsMasked then + Mode.GotoEnd; + + inherited DblClick; +end; + +procedure TcxCustomMaskEdit.DoEnter; +begin + if ActiveProperties.IsMasked then + if ActiveProperties.AutoSelect then + Mode.GotoEnd; + + inherited DoEnter; +end; + +procedure TcxCustomMaskEdit.DoEditKeyDown(var Key: Word; Shift: TShiftState); +var + AAfterKeyDownNeed: Boolean; +begin + if not ActiveProperties.IsMasked or IsSpecialKey(Key, Shift) then + begin + inherited DoEditKeyDown(Key, Shift); + Exit; + end; + + if not ValidateKeyDown(Key, Shift) then + begin + DoAfterKeyDown(Key, Shift); + Key := 0; + Exit; + end; + + if Key = VK_TAB then + begin + inherited DoEditKeyDown(Key, Shift); + Exit; + end; + + FShiftOn := ssShift in Shift; + + if ((Key = VK_UP) or (Key = VK_DOWN)) and not HasPopupWindow then + begin + DoAfterKeyDown(Key, Shift); + Key := 0; + end + else if Key = VK_LEFT then + begin + if ssCtrl in Shift then + begin + SendMyKeyDown(VK_HOME, Shift); + if not Mode.PressHome then + Key := 0; + end + else + begin + AAfterKeyDownNeed := IsCursorBegin; + if not Mode.PressLeft then + begin + if AAfterKeyDownNeed then + DoAfterKeyDown(Key, Shift); + Key := 0; + end; + end; + end + else if Key = VK_RIGHT then + begin + if ssCtrl in Shift then + begin + SendMyKeyDown(VK_END, Shift); + if not Mode.PressEnd then + Key := 0; + end + else + begin + AAfterKeyDownNeed := IsCursorEnd; + if not Mode.PressRight then + begin + if AAfterKeyDownNeed then + DoAfterKeyDown(Key, Shift); + Key := 0; + end; + end; + end + else if Key = VK_DELETE then + begin + if ssShift in Shift then + begin + if SelLength = 0 then + if not Mode.PressBackSpace then + Key := 0; + end + else + if not Mode.PressDelete then + Key := 0; + end + else if Key = VK_HOME then + begin + if not Mode.PressHome then + Key := 0; + end + else if Key = VK_END then + begin + if not Mode.PressEnd then + Key := 0; + end; + + if Key <> 0 then + inherited DoEditKeyDown(Key, Shift); +end; + +procedure TcxCustomMaskEdit.DoEditKeyPress(var Key: Char); +begin + if not ActiveProperties.IsMasked then + begin + inherited DoEditKeyPress(Key); + Exit; + end; + + if (Key = #9) or (Key = #27) then + Key := #0 + else if not ValidateKeyPress(Key) then + Key := #0 + else + begin + if Key <> #13 then + begin + if not ActiveProperties.IsMasked then + inherited DoEditKeyPress(Key) + else + begin + if (Key = #3) or (Key = #22) or (Key = #24) then // ^c ^v ^x + begin + inherited DoEditKeyPress(Key); + end + else + begin + if Key = #8 then // Backspace + begin + if not Mode.PressBackSpace then + Key := #0; + end + else + if not Mode.PressSymbol(Key) then + Key := #0; + end; + end; + end; + end; +end; + +function TcxCustomMaskEdit.GetEditText: TCaption; +begin + Result := InnerEdit.EditValue; +end; + +function TcxCustomMaskEdit.GetProperties: TcxCustomMaskEditProperties; +begin + Result := TcxCustomMaskEditProperties(FProperties); +end; + +function TcxCustomMaskEdit.GetActiveProperties: TcxCustomMaskEditProperties; +begin + Result := TcxCustomMaskEditProperties(InternalGetActiveProperties); +end; + +function TcxCustomMaskEdit.InternalGetEmptyString: string; +begin + if ActiveProperties.IsMasked then + begin + if Mode <> nil then + Result := Mode.GetEmptyString + else + Result := ''; + end + else + Result := ''; +end; + +procedure TcxCustomMaskEdit.InternalSetValue(AValue: string); +begin + if ActiveProperties.IsMasked and CanSynchronizeModeText then + Mode.SetText(AValue); +end; + +function TcxCustomMaskEdit.IsCursorBegin: Boolean; +begin + Result := FMode.IsCursorBegin; +end; + +function TcxCustomMaskEdit.IsCursorEnd: Boolean; +begin + Result := FMode.IsCursorEnd; +end; + +procedure TcxCustomMaskEdit.SetEditText(AValue: TCaption); +var + AEditText: string; +begin + if not Focused and (Mode is TcxMaskEditStandardMode) then + begin + if not ActiveProperties.AlwaysShowBlanksAndLiterals then + AEditText := Mode.GetUpdatedText(AValue) + else + AEditText := Mode.GetFormattedText(AValue); + end + else + AEditText := Mode.GetFormattedText(AValue); + InnerEdit.EditValue := AEditText; + FEditValue := FText; +end; + +procedure TcxCustomMaskEdit.SetProperties(Value: TcxCustomMaskEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomMaskEdit.DoEditKeyUp(var Key: Word; Shift: TShiftState); +begin + if not ActiveProperties.IsMasked then + begin + inherited DoEditKeyUp(Key, Shift); + Exit; + end; + + inherited DoEditKeyUp(Key, Shift); +end; + +procedure TcxCustomMaskEdit.Initialize; +begin + inherited Initialize; + FMode := ActiveProperties.GetModeClass(emkStandard).Create(Self, ActiveProperties); + FShiftOn := False; + ActiveProperties.FEmptyString := InternalGetEmptyString; +end; + +function TcxCustomMaskEdit.InternalGetText: string; +begin + if ActiveProperties.IsMasked then + Result := FText + else + Result := inherited InternalGetText; +end; + +procedure TcxCustomMaskEdit.InternalSetDisplayValue(const Value: TcxEditValue); +var + AText: string; +begin + if ActiveProperties.IsMasked and not IsLoading then + begin + AText := VarToStr(Value); + + if not Focused and (Mode is TcxMaskEditStandardMode) then + begin + if not ActiveProperties.AlwaysShowBlanksAndLiterals then + inherited InternalSetDisplayValue(Mode.GetUpdatedText(AText)) + else + inherited InternalSetDisplayValue(Mode.GetFormattedText(AText)); + end + else + inherited InternalSetDisplayValue(Mode.GetFormattedText(AText)); + + InternalSetValue(Text); + end + else + inherited InternalSetDisplayValue(Value); +end; + +function TcxCustomMaskEdit.InternalSetText(const Value: string): Boolean; +begin + if ActiveProperties.IsMasked then + begin + Result := True; + InternalEditValue := Value; + FEditValue := FText; + end + else + Result := inherited InternalSetText(Value); +end; + +procedure TcxCustomMaskEdit.KeyDown(var Key: Word; Shift: TShiftState); +begin + if not FMyMessage then + inherited KeyDown(Key, Shift); +end; + +procedure TcxCustomMaskEdit.KeyPress(var Key: Char); +begin + if not FMyMessage then + inherited KeyPress(Key); +end; + +procedure TcxCustomMaskEdit.KeyUp(var Key: Word; Shift: TShiftState); +begin + if not FMyMessage then + inherited KeyUp(Key, Shift); +end; + +procedure TcxCustomMaskEdit.Loaded; +begin + inherited Loaded; + if ActiveProperties.IsMasked then + begin + LockChangeEvents(True, False); + try + UpdateTextFormatting; + finally + LockChangeEvents(False, False); + end; + end; +end; + +procedure TcxCustomMaskEdit.LockInnerEditRepainting; +begin + if HasInnerEdit then + if ActiveProperties.IsMasked then + SendMessage(InnerEdit.Control.Handle, WM_SETREDRAW, 0, 0) + else + inherited LockInnerEditRepainting; +end; + +procedure TcxCustomMaskEdit.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + if ActiveProperties.IsMasked then + if Button = mbLeft then + Mode.LMouseDown; + + inherited MouseDown(Button, Shift, X, Y); +end; + +procedure TcxCustomMaskEdit.MouseMove(Shift: TShiftState; X, Y: Integer); +var + AShiftOn: Boolean; +begin + if ActiveProperties.IsMasked then + if ssLeft in Shift then + begin + AShiftOn := FShiftOn; + FShiftOn := True; + Mode.LMouseDown; + FShiftOn := AShiftOn; + end; + + inherited MouseMove(Shift, X, Y); +end; + +procedure TcxCustomMaskEdit.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); +end; + +procedure TcxCustomMaskEdit.PropertiesChanged(Sender: TObject); +var + AEditMask: string; + ASelStart: Integer; + ASelLength: Integer; + AEditMaskCleared: Boolean; + + procedure DoMaskChanged; + begin + ActiveProperties.MaxLength := 0; + + FMode.Compile(AEditMask); + if AEditMaskCleared then + ActiveProperties.FEditMask := AEditMask; + if not ActiveProperties.EmptyMask(AEditMask) then + FMode.SynchronizeEditValue + else + begin + if FMode is TcxMaskEditStandardMode then + begin + if HandleAllocated and (SelLength = 1) then + begin + ASelStart := SelStart; + SelLength := 0; + SelStart := ASelStart; + end; + end; + end; + ActiveProperties.FEmptyString := InternalGetEmptyString; + end; + + procedure DoMaskKindChanged; + var + APrevMaskKind: TcxEditMaskKind; + APrevEditMask: string; + begin + APrevMaskKind := FMode.GetMaskKind; + APrevEditMask := FMode.EditMask; + FreeAndNil(FMode); + + if ActiveProperties.MaskKind = emkRegExpr then + begin + if APrevMaskKind = emkStandard then + begin + ActiveProperties.FEditMask := ''; + AEditMaskCleared := True; + end; + FMode := ActiveProperties.GetModeClass(emkRegExpr).Create(Self, ActiveProperties) + end + else if ActiveProperties.MaskKind = emkRegExprEx then + begin + if APrevMaskKind = emkStandard then + begin + ActiveProperties.FEditMask := ''; + AEditMaskCleared := True; + end; + FMode := ActiveProperties.GetModeClass(emkRegExprEx).Create(Self, ActiveProperties) + end + else if ActiveProperties.MaskKind = emkStandard then + begin + if (APrevMaskKind = emkRegExpr) or (APrevMaskKind = emkRegExprEx) then + begin + ActiveProperties.FEditMask := ''; + AEditMaskCleared := True; + end; + FMode := ActiveProperties.GetModeClass(emkStandard).Create(Self, ActiveProperties) + end; + + FMode.Compile(ActiveProperties.EditMask); + if not ActiveProperties.EmptyMask(ActiveProperties.EditMask) then + FMode.SynchronizeEditValue; + + ActiveProperties.FEmptyString := InternalGetEmptyString; + end; + + procedure DoCharCaseChanged; + begin + if ActiveProperties.CharCase = ecNormal then + begin + if HasInnerEdit then + InnerTextEdit.CharCase := ecNormal; + FMode.SynchronizeEditValue; + end; + FMode.CharCase := ActiveProperties.CharCase; + end; + + procedure SaveSels; + begin + ASelStart := SelStart; + ASelLength := SelLength; + end; + + procedure LoadSels; + begin + SelStart := ASelStart; + SelLength := ASelLength; + end; + +var + AEditMaskChanged: Boolean; + AEditMaskKindChanged: Boolean; + ACharCaseChanged: Boolean; +begin + AEditMaskCleared := False; + ActiveProperties.LockUpdate(True); + + AEditMask := ActiveProperties.EditMask; + AEditMaskChanged := (FMode.EditMask <> ActiveProperties.EditMask) or ActiveProperties.FormatChanging; + AEditMaskKindChanged := FMode.GetMaskKind <> ActiveProperties.MaskKind; + ACharCaseChanged := ActiveProperties.CharCase <> FMode.CharCase; + if AEditMaskKindChanged then + DoMaskKindChanged; + if AEditMaskChanged then + DoMaskChanged; + if ACharCaseChanged then + DoCharCaseChanged; + if (ActiveProperties.EchoMode <> FMode.EchoMode) and HandleAllocated then + SaveSels; + + if not(not PropertiesChangeLocked and VarIsNull(EditValue)) and ActiveProperties.IsMasked then + FMode.UpdateEditValue; + + ActiveProperties.LockUpdate(False); + + if FMode is TcxMaskEditRegExprMode then + TcxMaskEditRegExprMode(FMode).SetRegExprCaseInsensitive; + + inherited PropertiesChanged(Sender); + + if ActiveProperties.EchoMode <> FMode.EchoMode then + begin + if HandleAllocated then + LoadSels; + FMode.EchoMode := ActiveProperties.EchoMode; + end; + + if ACharCaseChanged or AEditMaskKindChanged or AEditMaskChanged then + FText := FMode.GetUpdatedText(InnerEdit.EditValue); +end; + +procedure TcxCustomMaskEdit.PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); +begin + if ActiveProperties.IsMasked then + if not AEditFocused and (Mode is TcxMaskEditStandardMode) and + (TcxMaskEditStandardMode(Mode).FMask.SaveLiteralCharacters or not ActiveProperties.AlwaysShowBlanksAndLiterals) then + inherited PrepareEditValue(ADisplayValue, EditValue, AEditFocused) + else + EditValue := Mode.GetUpdatedText(ADisplayValue) + else + inherited PrepareEditValue(ADisplayValue, EditValue, AEditFocused); +end; + +procedure TcxCustomMaskEdit.PasteFromClipboard; +begin + if not Clipboard.HasFormat(CF_TEXT) then + Exit; + + if not ActiveProperties.IsMasked then + begin + inherited PasteFromClipboard; + Exit; + end; + + Mode.ClipboardTextLength := Length(Clipboard.AsText); + Mode.PrePasteFromClipboard; + +// inherited PasteFromClipboard; + SelText := Clipboard.AsText; // TODO + + Mode.AfterPasteFromClipboard; +end; + +procedure TcxCustomMaskEdit.SelChange(Sender: TObject); +begin + inherited SelChange(Sender); + if not FInternalTextSelection then + Mode.LMouseDown; +end; + +procedure TcxCustomMaskEdit.SetSelText(const Value: TCaption); +begin + if not ActiveProperties.IsMasked then + inherited SetSelText(Value) + else + begin + Mode.ClipboardTextLength := Length(Value); + Mode.PrePasteFromClipboard; + + inherited SetSelText(Value); + + Mode.AfterPasteFromClipboard; + end; +end; + +procedure TcxCustomMaskEdit.SynchronizeDisplayValue; +begin + inherited SynchronizeDisplayValue; + + if ActiveProperties.IsMasked then + InternalSetValue(Text); +end; + +procedure TcxCustomMaskEdit.UndoPerformed; +begin + InternalSetValue(Text); +end; + +procedure TcxCustomMaskEdit.UnlockInnerEditRepainting; +begin + if HasInnerEdit then + if ActiveProperties.IsMasked then + begin + SendMessage(InnerEdit.Control.Handle, WM_SETREDRAW, 1, 0); + InnerEdit.Control.Invalidate; + end + else + inherited UnlockInnerEditRepainting; +end; + +function TcxCustomMaskEdit.CanSynchronizeModeText: Boolean; +begin + Result := True; +end; + +procedure TcxCustomMaskEdit.DirectSetSelLength(AValue: Integer); +begin + FInternalTextSelection := True; + try + SelLength := AValue; + finally + FInternalTextSelection := False; + end; +end; + +procedure TcxCustomMaskEdit.DirectSetSelStart(AValue: Integer); +begin + FInternalTextSelection := True; + try + SelStart := AValue; + finally + FInternalTextSelection := False; + end; +end; + +function TcxCustomMaskEdit.IsCharValidForPos(var AChar: Char; + APos: Integer): Boolean; +begin + Result := True; +end; + +procedure TcxCustomMaskEdit.UpdateTextFormatting; +begin + InternalSetDisplayValue(Text); +end; + +{ TcxMaskEdit } + +class function TcxMaskEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxMaskEditProperties; +end; + +function TcxMaskEdit.GetActiveProperties: TcxMaskEditProperties; +begin + Result := TcxMaskEditProperties(InternalGetActiveProperties); +end; + +function TcxMaskEdit.GetProperties: TcxMaskEditProperties; +begin + Result := TcxMaskEditProperties(FProperties); +end; + +procedure TcxMaskEdit.SetProperties(Value: TcxMaskEditProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxFilterMaskEditHelper } + +class function TcxFilterMaskEditHelper.GetFilterEditClass: TcxCustomEditClass; +begin + Result := TcxMaskEdit; +end; + +class function TcxFilterMaskEditHelper.GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; +begin + Result := [fcoEqual, fcoNotEqual, fcoLess, fcoLessEqual, + fcoGreater, fcoGreaterEqual, fcoBlanks, fcoNonBlanks]; + if not TcxCustomMaskEditProperties(AProperties).IsMasked and + ((AValueTypeClass <> nil) and AValueTypeClass.IsString) then + Result := Result + [fcoLike, fcoNotLike]; + if AExtendedSet then + Result := Result + [fcoBetween..fcoNotInList]; +end; + +class procedure TcxFilterMaskEditHelper.InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); +begin + inherited InitializeProperties(AProperties, AEditProperties, AHasButtons); + with TcxCustomMaskEditProperties(AProperties) do + begin + if TcxCustomMaskEditProperties(AEditProperties).MaskKind = + emkRegExpr then + MaskKind := emkRegExprEx; + AutoSelect := not IsMasked; + end; +end; + +initialization + GetRegisteredEditProperties.Register(TcxMaskEditProperties, scxSEditRepositoryMaskItem); + FilterEditsController.Register(TcxMaskEditProperties, TcxFilterMaskEditHelper); + +finalization + FilterEditsController.Unregister(TcxMaskEditProperties, TcxFilterMaskEditHelper); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxMaskEditTextEditor.dfm b/official/x.35/ExpressEditors Library 5/Sources/cxMaskEditTextEditor.dfm new file mode 100644 index 00000000..58b53a51 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxMaskEditTextEditor.dfm @@ -0,0 +1,75 @@ +object cxMaskEditTextEditorDlg: TcxMaskEditTextEditorDlg + Left = 327 + Top = 323 + BorderStyle = bsDialog + Caption = 'Masked Text Editor' + ClientHeight = 151 + ClientWidth = 466 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + KeyPreview = True + OldCreateOrder = False + OnKeyDown = FormKeyDown + OnShow = FormShow + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 8 + Top = 24 + Width = 47 + Height = 13 + Caption = 'Input text:' + end + object Label2: TLabel + Left = 8 + Top = 62 + Width = 49 + Height = 13 + Caption = 'Edit mask:' + end + object Label3: TLabel + Left = 64 + Top = 62 + Width = 3 + Height = 13 + end + object Bevel1: TBevel + Left = 8 + Top = 96 + Width = 449 + Height = 2 + end + object cxMaskEdit1: TcxMaskEdit + Tag = 25 + Left = 64 + Top = 20 + Width = 391 + Height = 21 + Properties.IgnoreMaskBlank = True + Properties.MaxLength = 0 + TabOrder = 0 + end + object cxButton2: TButton + Left = 352 + Top = 112 + Width = 105 + Height = 25 + Caption = 'Cancel' + TabOrder = 1 + OnClick = cxButton2Click + end + object cxButton1: TButton + Left = 240 + Top = 112 + Width = 105 + Height = 25 + Caption = 'OK' + TabOrder = 2 + OnClick = cxButton1Click + end +end diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxMaskEditTextEditor.pas b/official/x.35/ExpressEditors Library 5/Sources/cxMaskEditTextEditor.pas new file mode 100644 index 00000000..7679c846 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxMaskEditTextEditor.pas @@ -0,0 +1,125 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxMaskEditTextEditor; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, SysUtils, Classes, Graphics, Controls, Forms, + cxMaskEdit, StdCtrls, cxButtons, cxControls, cxContainer, cxEdit, + ExtCtrls, cxTextEdit, cxClasses, cxEditConsts; + +type + TcxMaskEditTextEditorDlg = class(TForm) + Label1: TLabel; + Label2: TLabel; + cxMaskEdit1: TcxMaskEdit; + Label3: TLabel; + Bevel1: TBevel; + cxButton2: TButton; + cxButton1: TButton; + procedure FormShow(Sender: TObject); + procedure cxButton1Click(Sender: TObject); + procedure cxButton2Click(Sender: TObject); + procedure FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + private + { Private declarations } + FMaskEdit: TcxCustomMaskEdit; + public + { Public declarations } + property MaskEdit: TcxCustomMaskEdit read FMaskEdit write FMaskEdit; + end; + +var + cxMaskEditTextEditorDlg: TcxMaskEditTextEditorDlg; + +implementation + +{$R *.dfm} + +type + TcxCustomMaskEditPropertiesAccess = class(TcxCustomMaskEditProperties); + +procedure TcxMaskEditTextEditorDlg.FormShow(Sender: TObject); +var + AProperties: TcxCustomMaskEditPropertiesAccess; +begin + AProperties := TcxCustomMaskEditPropertiesAccess(MaskEdit.ActiveProperties); + begin + cxMaskEdit1.Properties.AlwaysShowBlanksAndLiterals := True; + cxMaskEdit1.Properties.MaxLength := AProperties.MaxLength; + cxMaskEdit1.Text := ''; + cxMaskEdit1.Properties.MaskKind := AProperties.MaskKind; + cxMaskEdit1.Properties.EditMask := AProperties.EditMask; + cxMaskEdit1.Properties.MaxLength := AProperties.MaxLength; + cxMaskEdit1.Properties.CaseInsensitive := AProperties.CaseInsensitive; + cxMaskEdit1.Text := MaskEdit.Text; + if AProperties.IsMasked then + Label3.Caption := AProperties.EditMask + else + Label3.Caption := cxGetResourceString(@scxMaskEditNoMask); + end; +end; + +procedure TcxMaskEditTextEditorDlg.cxButton1Click(Sender: TObject); +begin + MaskEdit.Text := cxMaskEdit1.Text; + Close; +end; + +procedure TcxMaskEditTextEditorDlg.cxButton2Click(Sender: TObject); +begin + Close; +end; + +procedure TcxMaskEditTextEditorDlg.FormKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if TranslateKey(Key) = VK_ESCAPE then + Close + else if TranslateKey(Key) = VK_RETURN then + begin + MaskEdit.Text := cxMaskEdit1.Text; + Close; + end; +end; + +end. + diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxMemo.pas b/official/x.35/ExpressEditors Library 5/Sources/cxMemo.pas new file mode 100644 index 00000000..8ab24f6d --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxMemo.pas @@ -0,0 +1,1986 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxMemo; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Classes, Controls, Forms, Graphics, Menus, StdCtrls, SysUtils, cxClasses, + cxContainer, cxControls, cxDataStorage, cxDataUtils, cxEdit, cxDrawTextUtils, + cxGraphics, cxLookAndFeels, cxTextEdit, cxFilterControlUtils; + +type + { IcxInnerMemo } + + IcxInnerMemo = interface(IcxInnerTextEdit) + ['{9D0DFE35-58DC-4C0C-9C98-65C5AAD757C9}'] + function GetCaretPos: TPoint; + function GetLines: TStrings; + function GetScrollBars: TScrollStyle; + function GetWantReturns: Boolean; + function GetWantTabs: Boolean; + function GetWordWrap: Boolean; + procedure SetCaretPos(const Value: TPoint); + procedure SetScrollBars(Value: TScrollStyle); + procedure SetWantReturns(Value: Boolean); + procedure SetWantTabs(Value: Boolean); + procedure SetWordWrap(Value: Boolean); + property CaretPos: TPoint read GetCaretPos write SetCaretPos; + property Lines: TStrings read GetLines; + property ScrollBars: TScrollStyle read GetScrollBars write SetScrollBars; + property WantReturns: Boolean read GetWantReturns write SetWantReturns; + property WantTabs: Boolean read GetWantTabs write SetWantTabs; + property WordWrap: Boolean read GetWordWrap write SetWordWrap; + end; + + { TcxCustomTextEditViewInfo } + + TcxCustomMemoViewInfo = class(TcxCustomTextEditViewInfo) + public + procedure DrawText(ACanvas: TcxCanvas); override; + end; + + { TcxCustomMemoViewData } + + TcxCustomMemoProperties = class; + + TcxCustomMemoViewData = class(TcxCustomTextEditViewData) + private + function GetProperties: TcxCustomMemoProperties; + protected + function GetMaxLineCount: Integer; override; + function InternalGetEditConstantPartSize(ACanvas: TcxCanvas; AIsInplace: Boolean; + AEditSizeProperties: TcxEditSizeProperties; var MinContentSize: TSize; + AViewInfo: TcxCustomEditViewInfo): TSize; override; + function InternalGetEditContentSize(ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + const AEditSizeProperties: TcxEditSizeProperties): TSize; override; + public + function GetDrawTextFlags: DWORD; override; + function GetDrawTextOffset: TRect; override; + function GetEditContentSizeCorrection: TSize; override; + property Properties: TcxCustomMemoProperties read GetProperties; + end; + + { TcxCustomMemoProperties } + + TcxCustomInnerMemo = class; + + TcxCustomMemoProperties = class(TcxCustomTextEditProperties) + private + FScrollBars: TScrollStyle; + FVisibleLineCount: Integer; + FWantReturns: Boolean; + FWantTabs: Boolean; + FWordWrap: Boolean; + function GetAlignment: TAlignment; + function IsAlignmentStored: Boolean; + procedure SetAlignment(Value: TAlignment); + procedure SetScrollBars(Value: TScrollStyle); + procedure SetVisibleLineCount(Value: Integer); + procedure SetWantReturns(Value: Boolean); + procedure SetWantTabs(Value: Boolean); + procedure SetWordWrap(Value: Boolean); + protected + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + function InnerEditNeedsTabs: Boolean; override; + function IsMultiLine: Boolean; override; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + class function GetContainerClass: TcxContainerClass; override; + function GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; override; + function GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; override; + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + // !!! + property Alignment: TAlignment read GetAlignment write SetAlignment stored IsAlignmentStored; + property AutoSelect default False; + property ScrollBars: TScrollStyle read FScrollBars write SetScrollBars default ssNone; + property VisibleLineCount: Integer read FVisibleLineCount write SetVisibleLineCount default 0; + property WantReturns: Boolean read FWantReturns write SetWantReturns default True; + property WantTabs: Boolean read FWantTabs write SetWantTabs default False; + property WordWrap: Boolean read FWordWrap write SetWordWrap default True; + end; + + { TcxMemoProperties } + + TcxMemoProperties = class(TcxCustomMemoProperties) + published + property Alignment; + property AssignedValues; + property AutoSelect; + property CharCase; + property ClearKey; + property HideSelection; + property ImeMode; + property ImeName; + property MaxLength; + property OEMConvert; + property ReadOnly; + property ScrollBars; + property VisibleLineCount; + property WantReturns; + property WantTabs; + property WordWrap; + property OnChange; + property OnEditValueChanged; + property OnValidate; + end; + + { TcxCustomMemo } + + TcxCustomMemo = class(TcxCustomTextEdit) + private + FCanCreateScrollBars: Boolean; + FInternalAction: Boolean; + FScrollBarsCalculating: Boolean; + function GetActiveProperties: TcxCustomMemoProperties; + function GetCaretPos: TPoint; + function GetLines: TStrings; + function GetInnerMemo: IcxInnerMemo; + function GetProperties: TcxCustomMemoProperties; + procedure SetCaretPos(const Value: TPoint); + procedure SetLines(Value: TStrings); + procedure SetProperties(Value: TcxCustomMemoProperties); + procedure WMCommand(var Message: TWMCommand); message WM_COMMAND; + protected + procedure AdjustInnerEdit; override; + procedure AdjustInnerEditPosition; override; + function CanAutoSize: Boolean; override; + function CanKeyDownModifyEdit(Key: Word; Shift: TShiftState): Boolean; override; + function CanScrollLineWithoutScrollBars(ADirection: TcxDirection): Boolean; override; + procedure ChangeHandler(Sender: TObject); override; + procedure DoEditKeyDown(var Key: Word; Shift: TShiftState); override; + procedure FontChanged; override; + function GetInnerEditClass: TControlClass; override; + procedure Initialize; override; + procedure InitializeViewData(AViewData: TcxCustomEditViewData); override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + function NeedsScrollBars: Boolean; override; + procedure PropertiesChanged(Sender: TObject); override; + procedure ReadState(Reader: TReader); override; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); override; + function SendActivationKey(Key: Char): Boolean; override; + procedure SetSelText(const Value: TCaption); override; + function TabsNeeded: Boolean; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure WndProc(var Message: TMessage); override; + function CanMemoKeyModifyEdit(Key: Word; Shift: TShiftState; + AIsKeyPress: Boolean): Boolean; virtual; + procedure InternalSynchronizeEditValue; + property InnerMemo: IcxInnerMemo read GetInnerMemo; + property ScrollBarsCalculating: Boolean read FScrollBarsCalculating; + public + procedure ClearSelection; override; + procedure CutToClipboard; override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + function IsEditClass: Boolean; override; + property ActiveProperties: TcxCustomMemoProperties read GetActiveProperties; + property CaretPos: TPoint read GetCaretPos write SetCaretPos; + property Lines: TStrings read GetLines write SetLines; + property Properties: TcxCustomMemoProperties read GetProperties + write SetProperties; + end; + + { TcxMemo } + + TcxMemo = class(TcxCustomMemo) + private + function GetActiveProperties: TcxMemoProperties; + function GetProperties: TcxMemoProperties; + procedure SetProperties(Value: TcxMemoProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxMemoProperties read GetActiveProperties; + published + property Align; + property Anchors; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property Lines; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxMemoProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + + { TcxFilterMemoHelper } + + TcxFilterMemoHelper = class(TcxFilterTextEditHelper) + public + class function GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; override; + end; + + { TcxCustomInnerMemoHelper } + + TcxCustomInnerMemoHelper = class(TcxInterfacedPersistent, + IcxContainerInnerControl, IcxCustomInnerEdit, IcxInnerTextEdit, + IcxInnerMemo) + private + FEdit: TcxCustomInnerMemo; + protected + property Edit: TcxCustomInnerMemo read FEdit; + public + constructor Create(AEdit: TcxCustomInnerMemo); reintroduce; virtual; + + // IcxContainerInnerControl + function GetControlContainer: TcxContainer; + function GetControl: TWinControl; + + // IcxCustomInnerEdit + function CallDefWndProc(AMsg: UINT; WParam: WPARAM; + LParam: LPARAM): LRESULT; + function GetEditValue: TcxEditValue; + function GetOnChange: TNotifyEvent; + procedure LockBounds(ALock: Boolean); + procedure SafelySetFocus; + procedure SetEditValue(const Value: TcxEditValue); + procedure SetParent(Value: TWinControl); + procedure SetOnChange(Value: TNotifyEvent); + + // IcxInnerTextEdit + procedure ClearSelection; + procedure CopyToClipboard; + function GetAlignment: TAlignment; + function GetAutoSelect: Boolean; + function GetCharCase: TEditCharCase; + function GetEchoMode: TcxEditEchoMode; + function GetHideSelection: Boolean; + function GetImeLastChar: Char; + function GetImeMode: TImeMode; + function GetImeName: TImeName; + function GetInternalUpdating: Boolean; + function GetMaxLength: Integer; + function GetMultiLine: Boolean; + function GetOEMConvert: Boolean; + function GetOnSelChange: TNotifyEvent; + function GetPasswordChar: TCaptionChar; + function GetReadOnly: Boolean; + function GetSelLength: Integer; + function GetSelStart: Integer; + function GetSelText: string; + procedure SelectAll; + procedure SetAlignment(Value: TAlignment); + procedure SetAutoSelect(Value: Boolean); + procedure SetCharCase(Value: TEditCharCase); + procedure SetEchoMode(Value: TcxEditEchoMode); + procedure SetHideSelection(Value: Boolean); + procedure SetImeMode(Value: TImeMode); + procedure SetImeName(const Value: TImeName); + procedure SetInternalUpdating(Value: Boolean); + procedure SetMaxLength(Value: Integer); + procedure SetOEMConvert(Value: Boolean); + procedure SetOnSelChange(Value: TNotifyEvent); + procedure SetPasswordChar(Value: TCaptionChar); + procedure SetReadOnly(Value: Boolean); + procedure SetSelLength(Value: Integer); + procedure SetSelStart(Value: Integer); + procedure SetSelText(Value: string); + + // IcxInnerMemo + function GetCaretPos: TPoint; + function GetLines: TStrings; + function GetScrollBars: TScrollStyle; + function GetWantReturns: Boolean; + function GetWantTabs: Boolean; + function GetWordWrap: Boolean; + procedure SetCaretPos(const Value: TPoint); + procedure SetScrollBars(Value: TScrollStyle); + procedure SetWantReturns(Value: Boolean); + procedure SetWantTabs(Value: Boolean); + procedure SetWordWrap(Value: Boolean); + end; + + { TcxCustomInnerMemo } + + TcxMultiLineEditCharPosition = packed record + Line, Col: Integer; + end; + + TcxInnerMemoSelectionState = packed record + CursorPosition: TcxMultiLineEditCharPosition; + SelectionStart: TcxMultiLineEditCharPosition; + SelectionEnd: TcxMultiLineEditCharPosition; + end; + + TcxCustomInnerMemo = class(TMemo, IUnknown, + IcxContainerInnerControl, IcxInnerEditHelper) + private + FAutoSelect: Boolean; + FEchoMode: TcxEditEchoMode; + FEscapePressed: Boolean; + FHelper: TcxCustomInnerMemoHelper; + FInternalTextSettingCount: Integer; + FInternalUpdating: Boolean; + FIsCreating: Boolean; + FLockBoundsCount: Integer; + FOnSelChange: TNotifyEvent; + + procedure BeginInternalTextSetting; + procedure EndInternalTextSetting; + function IsInternalTextSetting: Boolean; + + function GetContainer: TcxCustomMemo; + procedure WMClear(var Message: TMessage); message WM_CLEAR; + procedure WMCut(var Message: TMessage); message WM_CUT; + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + procedure WMKeyDown(var Message: TWMKeyDown); message WM_KEYDOWN; + procedure WMKillFocus(var Message: TWMKillFocus); message WM_KILLFOCUS; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure WMPaste(var Message: TMessage); message WM_PASTE; + procedure WMSetFocus(var Message: TWMSetFocus); message WM_SETFOCUS; + procedure WMSetFont(var Message: TWMSetFont); message WM_SETFONT; + procedure WMSetText(var Message: TWMSetText); message WM_SETTEXT; + procedure WMWindowPosChanged(var Message: TWMWindowPosChanged); message WM_WINDOWPOSCHANGED; + procedure WMWindowPosChanging(var Message: TWMWindowPosChanging); message WM_WINDOWPOSCHANGING; + procedure EMReplaceSel(var Message: TMessage); message EM_REPLACESEL; + procedure EMSetSel(var Message: TMessage); message EM_SETSEL; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure CNKeyDown(var Message: TWMKeyDown); message CN_KEYDOWN; + procedure WMIMEComposition(var Message: TMessage); message WM_IME_COMPOSITION; + protected + procedure Click; override; + procedure DblClick; override; + procedure DoEnter; override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseLeave(AControl: TControl); dynamic; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure CreateHandle; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWindowHandle(const Params: TCreateParams); override; + procedure WndProc(var Message: TMessage); override; + + // IcxContainerInnerControl + function GetControl: TWinControl; + function GetControlContainer: TcxContainer; + + // IcxInnerEditHelper + function GetHelper: IcxCustomInnerEdit; + + property AutoSelect: Boolean read FAutoSelect write FAutoSelect default False; + property Container: TcxCustomMemo read GetContainer; + property Helper: TcxCustomInnerMemoHelper read FHelper; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure DragDrop(Source: TObject; X, Y: Integer); override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + function UpdateAction(Action: TBasicAction): Boolean; override; +{$IFDEF DELPHI5} + function CanFocus: Boolean; override; +{$ENDIF} + procedure DefaultHandler(var Message); override; + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; + property CharCase; + property OnSelChange: TNotifyEvent read FOnSelChange write FOnSelChange; + end; + +procedure ExtractFirstLine(var AText: WideString; AMaxLength: Integer = 0); +procedure SetMemoCaretPos(AMemo: TCustomMemo; const Value: TPoint); + +implementation + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Clipbrd, cxEditConsts, cxEditUtils, cxScrollBar; + +type + TWinControlAccess = class(TWinControl); + +const + cxMemoMaxDisplayTextLength = 250; + +procedure CorrectLineBreaks(var S: string); +var + I, L: Integer; +begin + L := Length(S); + I := 1; + while I < L do + if (S[I] = #10) and (S[I + 1] = #13) then + begin + S[I] := #13; + Inc(I); + S[I] := #10; + Inc(I); + Insert(#13#10, S, I); + Inc(I, 2); + end + else + begin + if (S[I] = #13) and (S[I + 1] = #10) then + Inc(I); + Inc(I); + end; +end; + +procedure DrawMemo(ACanvas: TcxCanvas; AViewInfo: TcxCustomMemoViewInfo); +var + AText: PcxCaptionChar; +begin + with AViewInfo do + begin + AText := PcxCaptionChar(Text); + if Length(AText) = 0 then + Exit; + ACanvas.Font := Font; + ACanvas.Font.Color := TextColor; + InternalTextOut(ACanvas.Canvas, AViewInfo, AText, TextRect, DrawTextFlags, + SelStart, SelLength, SelBackgroundColor, SelTextColor, MaxLineCount); + end; +end; + +procedure ExtractFirstLine(var AText: WideString; AMaxLength: Integer = 0); +var + ALength, I: Integer; +begin + ALength := Length(AText); + if (AMaxLength > 0) and (ALength > AMaxLength) then + ALength := AMaxLength; + for I := 1 to ALength do + if (AText[I] = #10) or (AText[I] = #13) then + begin + SetLength(AText, I - 1); + Break; + end; + if Length(AText) > ALength then + SetLength(AText, ALength); +end; + +procedure SetMemoCaretPos(AMemo: TCustomMemo; const Value: TPoint); +var + ACharIdx: Integer; +begin + ACharIdx := SendMessage(AMemo.Handle, EM_LINEINDEX, Value.Y, 0) + Value.X; + SendMessage(AMemo.Handle, EM_SETSEL, ACharIdx, ACharIdx); +end; + +{ TcxCustomMemoViewInfo } + +procedure TcxCustomMemoViewInfo.DrawText(ACanvas: TcxCanvas); +begin + DrawMemo(ACanvas, Self); +end; + +{ TcxCustomMemoViewData } + +function TcxCustomMemoViewData.GetDrawTextFlags: DWORD; +const + AAlignmentFlagMap: array [TAlignment] of DWORD = (CXTO_LEFT, + CXTO_RIGHT, CXTO_CENTER_HORIZONTALLY); +begin + Result := Integer(CXTO_EDITCONTROL); + with Properties do + if not (ScrollBars in [ssHorizontal, ssBoth]) and WordWrap then + Result := Result or CXTO_WORDBREAK or CXTO_CHARBREAK; + Result := Result or AAlignmentFlagMap[Properties.Alignment]; + Result := Result or CXTO_PREVENT_LEFT_EXCEED or CXTO_EXPANDTABS; +end; + +function TcxCustomMemoViewData.GetDrawTextOffset: TRect; +begin + Result := EditContentDefaultOffsets[IsInplace]; +end; + +function TcxCustomMemoViewData.GetEditContentSizeCorrection: TSize; +begin + with GetDrawTextOffset do + Result := Size(Left + Right, Top + Bottom); +end; + +function TcxCustomMemoViewData.GetMaxLineCount: Integer; +begin + if Properties.VisibleLineCount > 0 then + Result := Properties.VisibleLineCount + else + Result := inherited GetMaxLineCount; +end; + +function TcxCustomMemoViewData.InternalGetEditConstantPartSize( + ACanvas: TcxCanvas; AIsInplace: Boolean; + AEditSizeProperties: TcxEditSizeProperties; var MinContentSize: TSize; + AViewInfo: TcxCustomEditViewInfo): TSize; +var + AContentHeight: Integer; +begin + Result := inherited InternalGetEditConstantPartSize(ACanvas, AIsInplace, + AEditSizeProperties, MinContentSize, AViewInfo); + if (Edit <> nil) and (Properties.ScrollBars in [ssHorizontal, ssBoth]) then + Result.cy := Result.cy + GetScrollBarSize.cy; + if Properties.VisibleLineCount > 0 then + begin + ACanvas.Font := Style.GetVisibleFont; + AContentHeight := ACanvas.TextHeight('Zg') * Properties.VisibleLineCount + + GetEditContentSizeCorrection.cy; + if MinContentSize.cy < AContentHeight then + MinContentSize.cy := AContentHeight; + end; +end; + +function TcxCustomMemoViewData.InternalGetEditContentSize(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; const AEditSizeProperties: TcxEditSizeProperties): TSize; +begin + Result := GetTextEditContentSize(ACanvas, Self, EditValueToDisplayText(AEditValue), + GetDrawTextFlags, AEditSizeProperties, Properties.VisibleLineCount); +end; + +function TcxCustomMemoViewData.GetProperties: TcxCustomMemoProperties; +begin + Result := TcxCustomMemoProperties(FProperties); +end; + +{ TcxCustomMemoProperties } + +constructor TcxCustomMemoProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + inherited Alignment.Vert := taTopJustify; + AutoSelect := False; + FScrollBars := ssNone; + FWantReturns := True; + FWordWrap := True; +end; + +procedure TcxCustomMemoProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomMemoProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with Source as TcxCustomMemoProperties do + begin + Self.ScrollBars := ScrollBars; + Self.VisibleLineCount := VisibleLineCount; + Self.WantReturns := WantReturns; + Self.WantTabs := WantTabs; + Self.WordWrap := WordWrap; + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +class function TcxCustomMemoProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxMemo; +end; + +function TcxCustomMemoProperties.GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; +begin + Result := inherited GetDisplayText(AEditValue); + if AFullText then + Exit; + ExtractFirstLine(Result, cxMemoMaxDisplayTextLength); +end; + +class function TcxCustomMemoProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxCustomMemoViewInfo; +end; + +function TcxCustomMemoProperties.GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; +begin + if (IDefaultValuesProvider <> nil) and IDefaultValuesProvider.IsBlob then + Result := evsValue + else + Result := evsText; +end; + +class function TcxCustomMemoProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxCustomMemoViewData; +end; + +function TcxCustomMemoProperties.InnerEditNeedsTabs: Boolean; +begin + Result := WantTabs; +end; + +function TcxCustomMemoProperties.IsMultiLine: Boolean; +begin + Result := True; +end; + +function TcxCustomMemoProperties.GetAlignment: TAlignment; +begin + Result := inherited Alignment.Horz; +end; + +function TcxCustomMemoProperties.IsAlignmentStored: Boolean; +begin + Result := inherited Alignment.IsHorzStored; +end; + +procedure TcxCustomMemoProperties.SetAlignment(Value: TAlignment); +begin + inherited Alignment.Horz := Value; +end; + +procedure TcxCustomMemoProperties.SetScrollBars(Value: TScrollStyle); +begin + if Value <> FScrollBars then + begin + FScrollBars := Value; + Changed; + end; +end; + +procedure TcxCustomMemoProperties.SetVisibleLineCount(Value: Integer); +begin + if Value < 0 then + Value := 0; + if Value <> FVisibleLineCount then + begin + FVisibleLineCount := Value; + Changed; + end; +end; + +procedure TcxCustomMemoProperties.SetWantReturns(Value: Boolean); +begin + if Value <> FWantReturns then + begin + FWantReturns := Value; + Changed; + end; +end; + +procedure TcxCustomMemoProperties.SetWantTabs(Value: Boolean); +begin + if Value <> FWantTabs then + begin + FWantTabs := Value; + Changed; + end; +end; + +procedure TcxCustomMemoProperties.SetWordWrap(Value: Boolean); +begin + if Value <> FWordWrap then + begin + FWordWrap := Value; + Changed; + end; +end; + +{ TcxCustomMemo } + +procedure TcxCustomMemo.ClearSelection; +var + APrevKeyboardAction: Boolean; +begin + if SelLength = 0 then + Exit; + if Focused and not DoEditing then + Exit; + APrevKeyboardAction := KeyboardAction; + KeyboardAction := Focused; + try + FInternalAction := True; + try + InnerMemo.ClearSelection; + finally + FInternalAction := False; + end; + InternalSynchronizeEditValue; + finally + KeyboardAction := APrevKeyboardAction; + end; +end; + +procedure TcxCustomMemo.CutToClipboard; +begin + if SelLength = 0 then + Exit; + InnerTextEdit.CopyToClipboard; + ClearSelection; +end; + +class function TcxCustomMemo.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomMemoProperties; +end; + +function TcxCustomMemo.IsEditClass: Boolean; +begin + Result := True; +end; + +procedure TcxCustomMemo.AdjustInnerEdit; +var + AFont: TFont; + AInnerControl: TWinControlAccess; +begin + if (InnerControl = nil) or FIsCreating then + Exit; + AInnerControl := TWinControlAccess(InnerControl); + InnerEdit.LockBounds(True); + try + AInnerControl.Color := ViewInfo.BackgroundColor; + AFont := TFont.Create; + try + AFont.Assign(ActiveStyle.GetVisibleFont); + AFont.Color := ViewInfo.TextColor; + AssignFonts(AInnerControl.Font, AFont); + finally + FreeAndNil(AFont); + end; + finally + InnerEdit.LockBounds(False); + end; +end; + +procedure TcxCustomMemo.AdjustInnerEditPosition; +var + AInnerEditBounds: TRect; + R: TRect; +begin + if (InnerTextEdit = nil) or FInnerEditPositionAdjusting then + Exit; + FInnerEditPositionAdjusting := True; + try + R := ViewInfo.ClientRect; + AInnerEditBounds := Rect(R.Left - cxContainerMaxBorderWidth, R.Top - cxContainerMaxBorderWidth, + R.Right - R.Left + cxContainerMaxBorderWidth * 2, R.Bottom - R.Top + cxContainerMaxBorderWidth * 2); + with AInnerEditBounds do + if not EqualRect(InnerEdit.Control.BoundsRect, Rect(Left, Top, Left + Right, Top + Bottom)) then + InnerEdit.Control.SetBounds(Left, Top, Right, Bottom); + AlignControls(InnerEdit.Control, R); + finally + FInnerEditPositionAdjusting := False; + end; +end; + +function TcxCustomMemo.CanAutoSize: Boolean; +begin + Result := not IsInplace and (ActiveProperties.VisibleLineCount > 0); +end; + +function TcxCustomMemo.CanKeyDownModifyEdit(Key: Word; Shift: TShiftState): Boolean; +begin + Result := inherited CanKeyDownModifyEdit(Key, Shift) or + CanMemoKeyModifyEdit(Key, Shift, False); +end; + +function TcxCustomMemo.CanScrollLineWithoutScrollBars( + ADirection: TcxDirection): Boolean; +begin + Result := ADirection in [dirUp, dirDown]; +end; + +procedure TcxCustomMemo.ChangeHandler(Sender: TObject); +begin + inherited ChangeHandler(Sender); + UpdateScrollBarsParameters; +end; + +procedure TcxCustomMemo.DoEditKeyDown(var Key: Word; Shift: TShiftState); +begin + inherited DoEditKeyDown(Key, Shift); + if Key = 0 then + Exit; + + if ((Char(Key) = 'a') or (Char(Key) = 'A')) and (ssCtrl in Shift) and + (Shift * [ssAlt, ssShift] = []) and (Lines.Count > 0) then + begin + if InnerControl is TCustomEdit then + TCustomEdit(InnerControl).SelectAll; + DoAfterKeyDown(Key, Shift); + Key := 0; + end; +end; + +procedure TcxCustomMemo.FontChanged; +begin + inherited FontChanged; + SetScrollBarsParameters; +end; + +function TcxCustomMemo.GetInnerEditClass: TControlClass; +begin + Result := TcxCustomInnerMemo; +end; + +procedure TcxCustomMemo.Initialize; +begin + inherited Initialize; + Width := 185; + Height := 89; +end; + +procedure TcxCustomMemo.InitializeViewData(AViewData: TcxCustomEditViewData); +begin + inherited InitializeViewData(AViewData); + AViewData.HScrollBar := nil; + AViewData.VScrollBar := nil; +end; + +procedure TcxCustomMemo.KeyDown(var Key: Word; Shift: TShiftState); +var + AKey: Word; +begin + AKey := TranslateKey(Key); + if IsInplace and (AKey = VK_RETURN) and ((ssCtrl in Shift) and not ActiveProperties.WantReturns or + not (ssCtrl in Shift) and ActiveProperties.WantReturns) then + DoEditKeyDown(Key, Shift) + else + inherited KeyDown(Key, Shift); +end; + +function TcxCustomMemo.NeedsScrollBars: Boolean; +begin + Result := FCanCreateScrollBars and (ActiveProperties <> nil) and + (ActiveProperties.ScrollBars <> ssNone); +end; + +procedure TcxCustomMemo.PropertiesChanged(Sender: TObject); +begin + if PropertiesChangeLocked then + Exit; + if InnerMemo.ScrollBars <> ActiveProperties.ScrollBars then + begin + FCanCreateScrollBars := True; + CheckNeedsScrollBars; + InnerMemo.ScrollBars := ActiveProperties.ScrollBars; + if HandleAllocated then + RecreateWnd; + if InnerControl.HandleAllocated then + TWinControlAccess(InnerControl).RecreateWnd; + end; + InnerMemo.WantReturns := ActiveProperties.WantReturns; + InnerMemo.WantTabs := ActiveProperties.WantTabs; + InnerMemo.WordWrap := ActiveProperties.WordWrap; + inherited PropertiesChanged(Sender); +end; + +procedure TcxCustomMemo.ReadState(Reader: TReader); +begin + inherited ReadState(Reader); + if Lines.Count > 0 then + PrepareEditValue(Text, FEditValue, InternalFocused); +end; + +procedure TcxCustomMemo.Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); +const + ALineCounts: array[Boolean] of Integer = (-1, 1); +begin + if AScrollBarKind = sbHorizontal then + begin + InnerMemo.CallDefWndProc(WM_HSCROLL, + Word(AScrollCode) + Word(AScrollPos) shl 16, HScrollBar.Handle); + AScrollPos := GetScrollPos(InnerControl.Handle, SB_HORZ); + end + else + begin + if AScrollCode in [scLineDown, scLineUp] then + SendMessage(InnerControl.Handle, EM_LINESCROLL, 0, + ALineCounts[AScrollCode = scLineDown]) + else + InnerMemo.CallDefWndProc(WM_VSCROLL, + Word(AScrollCode) + Word(AScrollPos) shl 16, VScrollBar.Handle); + AScrollPos := GetScrollPos(InnerControl.Handle, SB_VERT); + end; + SetScrollBarsParameters; +end; + +function TcxCustomMemo.SendActivationKey(Key: Char): Boolean; +begin + Result := not(TranslateKey(Word(Key)) = VK_RETURN); +end; + +procedure TcxCustomMemo.SetSelText(const Value: TCaption); +var + ANewValue: string; + ANewValueLength: Integer; + APrevKeyboardAction: Boolean; +begin + ANewValue := Value; + if Focused and (ActiveProperties.MaxLength > 0) and + (Length(WideString(Copy(Text, 1, SelStart) + Value)) > ActiveProperties.MaxLength) then + begin + ANewValueLength := ActiveProperties.MaxLength - Length(WideString(Copy(Text, 1, SelStart))); + if ANewValueLength <= 0 then + Exit; + ANewValue := Copy(WideString(Value), 1, ANewValueLength); + end; + if Focused and not DoEditing then + Exit; + APrevKeyboardAction := KeyboardAction; + KeyboardAction := Focused; + try + InnerTextEdit.SelText := ANewValue; + InternalSynchronizeEditValue; + finally + KeyboardAction := APrevKeyboardAction; + end; +end; + +function TcxCustomMemo.TabsNeeded: Boolean; +begin + Result := inherited TabsNeeded or ActiveProperties.WantTabs; +end; + +procedure TcxCustomMemo.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params.WindowClass do + begin + style := style and not CS_VREDRAW; + if (ActiveProperties.ScrollBars in [ssHorizontal, ssBoth]) or not ActiveProperties.WordWrap then + style := style and not CS_HREDRAW; + end; +end; + +procedure TcxCustomMemo.WndProc(var Message: TMessage); +begin + inherited WndProc(Message); + case Message.Msg of + WM_NCCALCSIZE, + WM_WINDOWPOSCHANGED, + CM_WININICHANGE: + UpdateScrollBarsParameters; + end; +end; + +function TcxCustomMemo.CanMemoKeyModifyEdit(Key: Word; Shift: TShiftState; + AIsKeyPress: Boolean): Boolean; +var + ATranslatedKey: Word; +begin + ATranslatedKey := TranslateKey(Key); + Result := (ATranslatedKey = VK_RETURN) and (ActiveProperties.WantReturns or + (ssCtrl in Shift)); + Result := Result or (ATranslatedKey = VK_TAB) and + (ActiveProperties.WantTabs or AIsKeyPress); +end; + +procedure TcxCustomMemo.InternalSynchronizeEditValue; +begin + if not KeyboardAction then + begin + ResetOnNewDisplayValue; + SynchronizeEditValue; + EditModified := False; + end; +end; + +function TcxCustomMemo.GetActiveProperties: TcxCustomMemoProperties; +begin + Result := TcxCustomMemoProperties(InternalGetActiveProperties); +end; + +function TcxCustomMemo.GetCaretPos: TPoint; +begin + Result := InnerMemo.CaretPos; +end; + +function TcxCustomMemo.GetLines: TStrings; +begin + Result := InnerMemo.Lines; +end; + +function TcxCustomMemo.GetInnerMemo: IcxInnerMemo; +begin + Result := InnerEdit as IcxInnerMemo; +end; + +function TcxCustomMemo.GetProperties: TcxCustomMemoProperties; +begin + Result := TcxCustomMemoProperties(FProperties); +end; + +procedure TcxCustomMemo.SetCaretPos(const Value: TPoint); +begin + InnerMemo.CaretPos := Value; +end; + +procedure TcxCustomMemo.SetLines(Value: TStrings); +begin + InnerMemo.Lines.Assign(Value); +end; + +procedure TcxCustomMemo.SetProperties(Value: TcxCustomMemoProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomMemo.WMCommand(var Message: TWMCommand); +begin + inherited; + if (Message.NotifyCode = EN_VSCROLL) or (Message.NotifyCode = EN_HSCROLL) then + SetScrollBarsParameters; +end; + +{ TcxMemo } + +class function TcxMemo.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxMemoProperties; +end; + +function TcxMemo.GetActiveProperties: TcxMemoProperties; +begin + Result := TcxMemoProperties(InternalGetActiveProperties); +end; + +function TcxMemo.GetProperties: TcxMemoProperties; +begin + Result := TcxMemoProperties(FProperties); +end; + +procedure TcxMemo.SetProperties(Value: TcxMemoProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxFilterMemoHelper } + +class function TcxFilterMemoHelper.GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; +begin + Result := [fcoLike, fcoNotLike, fcoBlanks, fcoNonBlanks]; +end; + +{ TcxCustomInnerMemoHelper } + +constructor TcxCustomInnerMemoHelper.Create(AEdit: TcxCustomInnerMemo); +begin + inherited Create(nil); + FEdit := AEdit; +end; + +{ IcxContainerInnerControl } +function TcxCustomInnerMemoHelper.GetControlContainer: TcxContainer; +begin + Result := Edit.Container; +end; + +function TcxCustomInnerMemoHelper.GetControl: TWinControl; +begin + Result := Edit; +end; + +{ IcxCustomInnerEdit } +function TcxCustomInnerMemoHelper.CallDefWndProc(AMsg: UINT; WParam: WPARAM; + LParam: LPARAM): LRESULT; +begin + Result := CallWindowProc(Edit.DefWndProc, Edit.Handle, AMsg, WParam, LParam); +end; + +function TcxCustomInnerMemoHelper.GetEditValue: TcxEditValue; +begin + Result := Edit.Lines.Text; +end; + +function TcxCustomInnerMemoHelper.GetOnChange: TNotifyEvent; +begin + Result := Edit.OnChange; +end; + +procedure TcxCustomInnerMemoHelper.LockBounds(ALock: Boolean); +begin + with Edit do + if ALock then + Inc(FLockBoundsCount) + else + if FLockBoundsCount > 0 then + Dec(FLockBoundsCount); +end; + +procedure TcxCustomInnerMemoHelper.SafelySetFocus; +var + APrevAutoSelect: Boolean; +begin + with Edit do + begin + APrevAutoSelect := AutoSelect; + AutoSelect := False; + SetFocus; + AutoSelect := APrevAutoSelect; + end; +end; + +procedure TcxCustomInnerMemoHelper.SetEditValue(const Value: TcxEditValue); +begin + with Edit do + if HandleAllocated then + begin + Container.LockChangeEvents(True); + BeginInternalTextSetting; + try + if Container.IsInplace and WordWrap then + Lines.Clear; + Lines.Text := VarToStr(Value); + finally + EndInternalTextSetting; + Container.ChangeEventsCatcher.OnEditValueChangedEvent := False; + Container.LockChangeEvents(False); + end; + end + else + Text := VarToStr(Value); +end; + +procedure TcxCustomInnerMemoHelper.SetParent(Value: TWinControl); +begin + Edit.Parent := Value; +end; + +procedure TcxCustomInnerMemoHelper.SetOnChange(Value: TNotifyEvent); +begin + Edit.OnChange := Value; +end; + +// IcxInnerTextEdit +procedure TcxCustomInnerMemoHelper.ClearSelection; +begin + Edit.ClearSelection; +end; + +procedure TcxCustomInnerMemoHelper.CopyToClipboard; +begin + Edit.CopyToClipboard; +end; + +function TcxCustomInnerMemoHelper.GetAlignment: TAlignment; +begin + Result := Edit.Alignment; +end; + +function TcxCustomInnerMemoHelper.GetAutoSelect: Boolean; +begin + Result := Edit.AutoSelect; +end; + +function TcxCustomInnerMemoHelper.GetCharCase: TEditCharCase; +begin + Result := Edit.CharCase; +end; + +function TcxCustomInnerMemoHelper.GetEchoMode: TcxEditEchoMode; +begin + Result := eemNormal; +end; + +function TcxCustomInnerMemoHelper.GetHideSelection: Boolean; +begin + Result := Edit.HideSelection; +end; + +function TcxCustomInnerMemoHelper.GetImeLastChar: Char; +begin + Result := #0; +end; + +function TcxCustomInnerMemoHelper.GetImeMode: TImeMode; +begin + Result := Edit.ImeMode; +end; + +function TcxCustomInnerMemoHelper.GetImeName: TImeName; +begin + Result := Edit.ImeName; +end; + +function TcxCustomInnerMemoHelper.GetInternalUpdating: Boolean; +begin + Result := Edit.FInternalUpdating; +end; + +function TcxCustomInnerMemoHelper.GetMaxLength: Integer; +begin + Result := Edit.MaxLength; +end; + +function TcxCustomInnerMemoHelper.GetMultiLine: Boolean; +begin + Result := True; +end; + +function TcxCustomInnerMemoHelper.GetOEMConvert: Boolean; +begin + Result := Edit.OEMConvert; +end; + +function TcxCustomInnerMemoHelper.GetOnSelChange: TNotifyEvent; +begin + Result := Edit.OnSelChange; +end; + +function TcxCustomInnerMemoHelper.GetPasswordChar: TCaptionChar; +begin + Result := #0; +end; + +function TcxCustomInnerMemoHelper.GetReadOnly: Boolean; +begin + Result := Edit.ReadOnly; +end; + +function TcxCustomInnerMemoHelper.GetSelLength: Integer; +begin + Result := Edit.SelLength; +end; + +function TcxCustomInnerMemoHelper.GetSelStart: Integer; +begin + Result := Edit.SelStart; +end; + +function TcxCustomInnerMemoHelper.GetSelText: string; +begin + Result := Edit.SelText; +end; + +procedure TcxCustomInnerMemoHelper.SelectAll; +begin + with Edit do + if HandleAllocated then + SelectAll; +end; + +procedure TcxCustomInnerMemoHelper.SetAlignment(Value: TAlignment); +begin + with Edit do + begin + Alignment := Value; + end; +end; + +procedure TcxCustomInnerMemoHelper.SetAutoSelect(Value: Boolean); +begin + Edit.AutoSelect := Value; +end; + +procedure TcxCustomInnerMemoHelper.SetCharCase(Value: TEditCharCase); +begin + Edit.CharCase := Value; +end; + +procedure TcxCustomInnerMemoHelper.SetEchoMode(Value: TcxEditEchoMode); +begin +end; + +procedure TcxCustomInnerMemoHelper.SetHideSelection(Value: Boolean); +begin + Edit.HideSelection := Value; +end; + +procedure TcxCustomInnerMemoHelper.SetImeMode(Value: TImeMode); +begin + Edit.ImeMode := Value; +end; + +procedure TcxCustomInnerMemoHelper.SetImeName(const Value: TImeName); +begin + Edit.ImeName := Value; +end; + +procedure TcxCustomInnerMemoHelper.SetInternalUpdating(Value: Boolean); +begin + Edit.FInternalUpdating := Value; +end; + +procedure TcxCustomInnerMemoHelper.SetMaxLength(Value: Integer); +begin + Edit.MaxLength := Value; +end; + +procedure TcxCustomInnerMemoHelper.SetOEMConvert(Value: Boolean); +begin + Edit.OEMConvert := Value; +end; + +procedure TcxCustomInnerMemoHelper.SetOnSelChange(Value: TNotifyEvent); +begin + Edit.OnSelChange := Value; +end; + +procedure TcxCustomInnerMemoHelper.SetPasswordChar(Value: TCaptionChar); +begin +end; + +procedure TcxCustomInnerMemoHelper.SetReadOnly(Value: Boolean); +begin + Edit.ReadOnly := Value; +end; + +procedure TcxCustomInnerMemoHelper.SetSelLength(Value: Integer); +begin + Edit.SelLength := Value; +end; + +procedure TcxCustomInnerMemoHelper.SetSelStart(Value: Integer); +begin + with Edit do + begin + SelStart := Value; + end; +end; + +procedure TcxCustomInnerMemoHelper.SetSelText(Value: string); +begin + Edit.SelText := Value; +end; + +// IcxInnerMemo +function TcxCustomInnerMemoHelper.GetCaretPos: TPoint; +begin + Result := Edit.CaretPos; +end; + +function TcxCustomInnerMemoHelper.GetLines: TStrings; +begin + Result := Edit.Lines; +end; + +function TcxCustomInnerMemoHelper.GetScrollBars: TScrollStyle; +begin + Result := Edit.ScrollBars; +end; + +function TcxCustomInnerMemoHelper.GetWantReturns: Boolean; +begin + Result := Edit.WantReturns; +end; + +function TcxCustomInnerMemoHelper.GetWantTabs: Boolean; +begin + Result := Edit.WantTabs; +end; + +function TcxCustomInnerMemoHelper.GetWordWrap: Boolean; +begin + Result := Edit.WordWrap; +end; + +procedure TcxCustomInnerMemoHelper.SetCaretPos(const Value: TPoint); +begin + SetMemoCaretPos(Edit, Value); +end; + +procedure TcxCustomInnerMemoHelper.SetScrollBars(Value: TScrollStyle); +begin + Edit.ScrollBars := Value; +end; + +procedure TcxCustomInnerMemoHelper.SetWantReturns(Value: Boolean); +begin + Edit.WantReturns := Value; +end; + +procedure TcxCustomInnerMemoHelper.SetWantTabs(Value: Boolean); +begin + Edit.WantTabs := Value; +end; + +procedure TcxCustomInnerMemoHelper.SetWordWrap(Value: Boolean); +begin + Edit.WordWrap := Value; +end; + +{ TcxCustomInnerMemo } + +constructor TcxCustomInnerMemo.Create(AOwner: TComponent); +begin + FIsCreating := True; + inherited Create(AOwner); + if not (csDesigning in ComponentState) then + Cursor := crIBeam; + ParentColor := True; + ParentFont := True; + FEchoMode := eemNormal; + FHelper := TcxCustomInnerMemoHelper.Create(Self); + FInternalUpdating := False; + FIsCreating := False; +end; + +destructor TcxCustomInnerMemo.Destroy; +begin + FreeAndNil(FHelper); + inherited Destroy; +end; + +procedure TcxCustomInnerMemo.DragDrop(Source: TObject; X, Y: Integer); +begin + Container.DragDrop(Source, Left + X, Top + Y); +end; + +function TcxCustomInnerMemo.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action) or + Container.DataBinding.ExecuteAction(Action); +end; + +function TcxCustomInnerMemo.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action) or + Container.DataBinding.UpdateAction(Action); +end; + +{$IFDEF DELPHI5} +function TcxCustomInnerMemo.CanFocus: Boolean; +begin + Result := Container.CanFocusEx; +end; +{$ENDIF} + +procedure TcxCustomInnerMemo.DefaultHandler(var Message); +begin + if not Container.InnerControlDefaultHandler(TMessage(Message)) then + inherited DefaultHandler(Message); +end; + +procedure TcxCustomInnerMemo.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); +begin + if not FIsCreating and (FLockBoundsCount = 0) then + begin + Container.LockAlignControls(True); + try + inherited SetBounds(ALeft, ATop, AWidth, AHeight); + finally + Container.LockAlignControls(False); + end; + end; +end; + +procedure TcxCustomInnerMemo.Click; +begin + inherited Click; + Container.Click; +end; + +procedure TcxCustomInnerMemo.DblClick; +begin + inherited DblClick; + Container.DblClick; +end; + +procedure TcxCustomInnerMemo.DoEnter; +begin + inherited DoEnter; + if FAutoSelect then + SelectAll +end; + +procedure TcxCustomInnerMemo.DragOver(Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); +begin + Container.DragOver(Source, Left + X, Top + Y, State, Accept); +end; + +procedure TcxCustomInnerMemo.KeyDown(var Key: Word; Shift: TShiftState); +begin + FInternalUpdating := False; + Container.KeyDown(Key, Shift); + if Key = 0 then + FInternalUpdating := True + else + inherited KeyDown(Key, Shift); +end; + +procedure TcxCustomInnerMemo.KeyPress(var Key: Char); +begin + FInternalUpdating := False; +// if not WantTabs and ((Key = Char(VK_TAB))) then +// Key := #0; + Container.KeyPress(Key); + if Key = #0 then + FInternalUpdating := True + else + inherited KeyPress(Key); +end; + +procedure TcxCustomInnerMemo.KeyUp(var Key: Word; Shift: TShiftState); +begin + FInternalUpdating := False; + if not WantTabs and ((Key = VK_TAB)) then + Key := 0; + Container.KeyUp(Key, Shift); + if Key = 0 then + FInternalUpdating := True + else + inherited KeyUp(Key, Shift); +end; + +procedure TcxCustomInnerMemo.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + with Container do + begin + InnerControlMouseDown := True; + try + MouseDown(Button, Shift, X + Self.Left, Y + Self.Top); + finally + InnerControlMouseDown := False; + end; + end; +end; + +procedure TcxCustomInnerMemo.MouseLeave(AControl: TControl); +begin + Container.ShortRefreshContainer(True); +end; + +procedure TcxCustomInnerMemo.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + Container.MouseMove(Shift, X + Left, Y + Top); +end; + +procedure TcxCustomInnerMemo.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + Container.MouseUp(Button, Shift, X + Left, Y + Top); +end; + +procedure TcxCustomInnerMemo.CreateHandle; +begin + Container.ClearSavedChildControlRegions; + inherited CreateHandle; +end; + +procedure TcxCustomInnerMemo.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params.WindowClass do + begin + style := style and not CS_VREDRAW; + if (ScrollBars in [ssHorizontal, ssBoth]) or not WordWrap then + style := style and not CS_HREDRAW; + end; +end; + +procedure TcxCustomInnerMemo.CreateWindowHandle(const Params: TCreateParams); +begin + BeginInternalTextSetting; + try + inherited CreateWindowHandle(Params); // do not handle WM_SETTEXT from inherited CreateWindowHandle + finally + EndInternalTextSetting; + end; + Lines.Text := Text; + Container.SetScrollBarsParameters; +end; + +procedure TcxCustomInnerMemo.WndProc(var Message: TMessage); +begin + if Container.InnerControlMenuHandler(Message) then + Exit; + if ((Message.Msg = WM_LBUTTONDOWN) or (Message.Msg = WM_LBUTTONDBLCLK)) and + (Container.DragMode = dmAutomatic) and not Container.IsDesigning then + Container.BeginAutoDrag + else + inherited WndProc(Message); +end; + +// IcxContainerInnerControl +function TcxCustomInnerMemo.GetControl: TWinControl; +begin + Result := Self; +end; + +function TcxCustomInnerMemo.GetControlContainer: TcxContainer; +begin + Result := Container; +end; + +// IcxInnerEditHelper +function TcxCustomInnerMemo.GetHelper: IcxCustomInnerEdit; +begin + Result := Helper; +end; + +procedure TcxCustomInnerMemo.BeginInternalTextSetting; +begin + Inc(FInternalTextSettingCount); +end; + +procedure TcxCustomInnerMemo.EndInternalTextSetting; +begin + Dec(FInternalTextSettingCount); +end; + +function TcxCustomInnerMemo.IsInternalTextSetting: Boolean; +begin + Result := FInternalTextSettingCount > 0; +end; + +function TcxCustomInnerMemo.GetContainer: TcxCustomMemo; +begin + Result := TcxCustomMemo(Owner); +end; + +procedure TcxCustomInnerMemo.WMClear(var Message: TMessage); +begin + if Container.FInternalAction then + inherited + else + if not ReadOnly then + with Container do + begin + KeyboardAction := True; + try + ClearSelection; + finally + KeyboardAction := False; + end; + end; +end; + +procedure TcxCustomInnerMemo.WMCut(var Message: TMessage); +begin + with Container do + begin + KeyboardAction := True; + try + if not Self.ReadOnly then + CutToClipboard + else + CopyToClipboard; + finally + KeyboardAction := False; + end; + end; +end; + +procedure TcxCustomInnerMemo.WMGetDlgCode(var Message: TWMGetDlgCode); +begin + inherited; + if Container.TabsNeeded and (GetKeyState(VK_CONTROL) >= 0) then + Message.Result := Message.Result or DLGC_WANTTAB; + if FEscapePressed then + Message.Result := Message.Result and not DLGC_WANTALLKEYS; +end; + +procedure TcxCustomInnerMemo.WMKeyDown(var Message: TWMKeyDown); +var + AKey: Word; + APrevState: TcxCustomInnerTextEditPrevState; + AShiftState: TShiftState; +begin + SaveTextEditState(Helper, True, APrevState); + FInternalUpdating := False; + inherited; + Container.UpdateScrollBarsParameters; + if FInternalUpdating then + Exit; + + AShiftState := KeyDataToShiftState(Message.KeyData); + if not CheckTextEditState(Helper, APrevState) and (Message.CharCode <> 0) and + (Message.CharCode <> VK_UP) and (Message.CharCode <> VK_DOWN) then + begin + AShiftState := KeyDataToShiftState(Message.KeyData); + AKey := Message.CharCode; + Container.DoAfterKeyDown(AKey, AShiftState); + Message.CharCode := AKey; + end; +end; + +procedure TcxCustomInnerMemo.WMKillFocus(var Message: TWMKillFocus); +begin + inherited; + if not(csDestroying in ComponentState) then + Container.FocusChanged; +end; + +procedure TcxCustomInnerMemo.WMNCPaint(var Message: TWMNCPaint); + + function GetScrollBarRect(AScrollBarKind: TScrollBarKind): TRect; + const + AScrollBarObjects: array [TScrollBarKind] of Longword = (OBJID_HSCROLL, OBJID_VSCROLL); + var + AScrollBarInfo: TcxScrollBarInfo; + AScrollBarState: DWORD; + begin + Result := cxEmptyRect; + if (csDestroying in ComponentState) or not HandleAllocated then + Exit; + if not cxGetScrollBarInfo(Handle, Integer(AScrollBarObjects[AScrollBarKind]), + AScrollBarInfo) then + Exit; + AScrollBarState := AScrollBarInfo.rgstate[0]; + if AScrollBarState and (STATE_SYSTEM_INVISIBLE or STATE_SYSTEM_OFFSCREEN) <> 0 then + Exit; + with AScrollBarInfo.rcScrollBar do + begin + Result.TopLeft := ScreenToClient(TopLeft); + Result.Right := Result.Left + Right - Left; + Result.Bottom := Result.Top + Bottom - Top; + end; + OffsetRect(Result, cxContainerMaxBorderWidth, cxContainerMaxBorderWidth); + end; + + function GetSizeGripRect: TRect; + var + RH, RV: TRect; + begin + Result := cxEmptyRect; + RH := GetScrollBarRect(sbHorizontal); + if IsRectEmpty(RH) then + Exit; + RV := GetScrollBarRect(sbVertical); + if IsRectEmpty(RV) then + Exit; + Result := Rect(RV.Left, RH.Top, RV.Right, RH.Bottom); + end; + + procedure FillSizeGrip; + var + ABrush: HBRUSH; + ADC: HDC; + R: TRect; + begin + if ScrollBars <> ssBoth then + Exit; + R := GetSizeGripRect; + if not IsRectEmpty(R) then + begin + ABrush := 0; + ADC := GetWindowDC(Handle); + try + with Container.LookAndFeel do + ABrush := CreateSolidBrush(ColorToRGB(Painter.DefaultSizeGripAreaColor)); + FillRect(ADC, R, ABrush); + finally + if ABrush <> 0 then + DeleteObject(ABrush); + ReleaseDC(Handle, ADC); + end; + end; + end; + +var + A: Integer; +begin + if not UsecxScrollBars then + begin + inherited; + Exit; + end; + A := GetWindowLong(Handle, GWL_STYLE); + A := A and not(WS_HSCROLL or WS_VSCROLL); + SetWindowLong(Handle, GWL_STYLE, A); + inherited; + A := GetWindowLong(Handle, GWL_STYLE); + if ScrollBars in [ssHorizontal, ssBoth] then + A := A or WS_HSCROLL; + if ScrollBars in [ssVertical, ssBoth] then + A := A or WS_VSCROLL; + SetWindowLong(Handle, GWL_STYLE, A); + FillSizeGrip; +end; + +procedure TcxCustomInnerMemo.WMPaste(var Message: TMessage); +begin + if not ReadOnly then + with Container do + begin + KeyboardAction := True; + try + PasteFromClipboard; + finally + KeyboardAction := False; + end; + end; +end; + +procedure TcxCustomInnerMemo.WMSetFocus(var Message: TWMSetFocus); +begin + inherited; + if not(csDestroying in ComponentState) and (Message.FocusedWnd <> Container.Handle) then + Container.FocusChanged; +end; + +procedure TcxCustomInnerMemo.WMSetFont(var Message: TWMSetFont); +begin + inherited; + if (*Container.IsInplace and *)NewStyleControls then + SendMessage(Handle, EM_SETMARGINS, EC_LEFTMARGIN or EC_RIGHTMARGIN, 0); +end; + +procedure TcxCustomInnerMemo.WMSetText(var Message: TWMSetText); +begin + inherited; + if IsInternalTextSetting then + Exit; + BeginInternalTextSetting; + try + Container.InternalEditValue := string(Message.Text); + finally + EndInternalTextSetting; + end; +end; + +procedure TcxCustomInnerMemo.WMWindowPosChanged(var Message: TWMWindowPosChanged); +begin + Container.SetScrollBarsParameters; + inherited; +end; + +procedure TcxCustomInnerMemo.WMWindowPosChanging(var Message: TWMWindowPosChanging); +begin + inherited; + Container.SetScrollBarsParameters; +end; + +procedure TcxCustomInnerMemo.EMReplaceSel(var Message: TMessage); +var + APrevLParam: Integer; + S: string; +begin + S := PChar(Message.LParam); + CorrectLineBreaks(S); + + APrevLParam := Message.LParam; + Message.LParam := Integer(PChar(S)); + try + inherited; + Container.SynchronizeEditValue; + finally + Message.LParam := APrevLParam; + end; +end; + +procedure TcxCustomInnerMemo.EMSetSel(var Message: TMessage); +begin + inherited; + if Assigned(OnSelChange) then + OnSelChange(Self); +end; + +procedure TcxCustomInnerMemo.CMMouseLeave(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseLeave(Self) + else + MouseLeave(TControl(Message.lParam)); +end; + +procedure TcxCustomInnerMemo.CNKeyDown(var Message: TWMKeyDown); +begin + if Message.CharCode = VK_ESCAPE then + FEscapePressed := True; + try + inherited; + finally + FEscapePressed := False; + end; +end; + +procedure TcxCustomInnerMemo.WMIMEComposition(var Message: TMessage); +begin + if Container.DoEditing then + inherited; +end; + +initialization + GetRegisteredEditProperties.Register(TcxMemoProperties, scxSEditRepositoryMemoItem); + FilterEditsController.Register(TcxMemoProperties, TcxFilterMemoHelper); + +finalization + FilterEditsController.Unregister(TcxMemoProperties, TcxFilterMemoHelper); + +end. + diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxNavigator.pas b/official/x.35/ExpressEditors Library 5/Sources/cxNavigator.pas new file mode 100644 index 00000000..78ea363f --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxNavigator.pas @@ -0,0 +1,1872 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxNavigator; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Messages, Windows, Classes, Controls, Forms, Graphics, ImgList, + StdCtrls, SysUtils, cxClasses, cxContainer, cxControls, cxFilter, cxGraphics, + cxLookAndFeels, cxLookAndFeelPainters, dxThemeManager; + +const + NavigatorButtonCount = 16; + + NBDI_FIRST = 0; + NBDI_PRIORPAGE = 1; + NBDI_PRIOR = 2; + NBDI_NEXT = 3; + NBDI_NEXTPAGE = 4; + NBDI_LAST = 5; + NBDI_INSERT = 6; + NBDI_APPEND = 7; + NBDI_DELETE = 8; + NBDI_EDIT = 9; + NBDI_POST = 10; + NBDI_CANCEL = 11; + NBDI_REFRESH = 12; + NBDI_SAVEBOOKMARK = 13; + NBDI_GOTOBOOKMARK = 14; + NBDI_FILTER = 15; + +type + TcxCustomNavigatorButtons = class; + + TcxNavigatorChangeType = (nctProperties, nctSize, nctLayout); + + IcxNavigatorOwner = interface + ['{504B7F43-8847-46C5-B84A-C24F8E5E61A6}'] + procedure NavigatorChanged(AChangeType: TcxNavigatorChangeType); + function GetNavigatorBounds: TRect; + function GetNavigatorButtons: TcxCustomNavigatorButtons; + function GetNavigatorCanvas: TCanvas; + function GetNavigatorControl: TWinControl; + function GetNavigatorFocused: Boolean; + function GetNavigatorLookAndFeel: TcxLookAndFeel; + function GetNavigatorOwner: TComponent; + function GetNavigatorShowHint: Boolean; + function GetNavigatorTabStop: Boolean; + procedure NavigatorButtonsStateChanged; + procedure RefreshNavigator; + end; + + TcxNavigatorButton = class(TPersistent) + private + FButtons: TcxCustomNavigatorButtons; + FDefaultIndex: Integer; + FDefaultVisible: Boolean; + FEnabled: Boolean; + FHint: string; + FImageIndex: TImageIndex; + FIsVisibleAssigned: Boolean; + FVisible: Boolean; + FOnClick: TNotifyEvent; + function GetInternalImageIndex: Integer; + function GetIternalImages: TCustomImageList; + procedure InternalSetVisible(Value: Boolean; AIsInternalSetting: Boolean = True); + function IsVisibleStored: Boolean; + procedure SetEnabled(const Value: Boolean); + procedure SetHint(const Value: string); + procedure SetImageIndex(Value: TImageIndex); + procedure SetOnClick(const Value: TNotifyEvent); + procedure SetVisible(const Value: Boolean); + protected + function GetOwner: TPersistent; override; + function GetInternalEnabled: Boolean; + function GetInternalHint: string; + function IsUserImageListUsed: Boolean; + procedure DoClick; dynamic; + procedure RestoreDefaultVisible(ACanBeVisible: Boolean); + + function GetNavigator: IcxNavigatorOwner; + + property DefaultIndex: Integer read FDefaultIndex write FDefaultIndex; + property InternalImageIndex: Integer read GetInternalImageIndex; + property InternalImages: TCustomImageList read GetIternalImages; + public + constructor Create(AButtons: TcxCustomNavigatorButtons; + ADefaultVisible: Boolean); + + procedure Assign(Source: TPersistent); override; + procedure Click; + function GetImageSize: TSize; + + property Buttons: TcxCustomNavigatorButtons read FButtons; + property Navigator: IcxNavigatorOwner read GetNavigator; + property OnClick: TNotifyEvent read FOnClick write SetOnClick; + published + property Enabled: Boolean read FEnabled write SetEnabled default True; + property Hint: string read FHint write SetHint; + property ImageIndex: TImageIndex read FImageIndex write SetImageIndex default -1; + property Visible: Boolean read FVisible write SetVisible stored IsVisibleStored; + end; + + TcxCustomNavigator = class; + + TcxNavigatorButtonClickEvent = procedure(Sender: TObject; AButtonIndex: Integer; + var ADone: Boolean) of object; + + TcxCustomNavigatorButtons = class(TPersistent) + private + FNavigator: IcxNavigatorOwner; + FButtons: array [0 .. NavigatorButtonCount - 1] of TcxNavigatorButton; + FImages: TCustomImageList; + FImageChangeLink: TChangeLink; + FConfirmDelete: Boolean; + FOnButtonClick: TcxNavigatorButtonClickEvent; + + function GetButton(Index: Integer): TcxNavigatorButton; + function GetButtonCount: Integer; + function GetDefaultImages: TCustomImageList; + procedure SetButton(Index: Integer; const Value: TcxNavigatorButton); + procedure SetConfirmDelete(const Value: Boolean); + procedure SetImages(const Value: TCustomImageList); + procedure SetOnButtonClick(const Value: TcxNavigatorButtonClickEvent); + procedure ImageListChange(Sender: TObject); + protected + function GetOwner: TPersistent; override; + procedure CreateButtons; virtual; + procedure DestroyButtons; virtual; + + procedure DoButtonClick(ADefaultIndex: Integer); virtual; + function GetButtonEnabled(ADefaultIndex: Integer): Boolean; virtual; + function GetButtonHint(ADefaultIndex: Integer): string; virtual; + function GetButtonImageOffset: Integer; virtual; + function IsNavigatorEnabled: Boolean; + + property ConfirmDelete: Boolean read FConfirmDelete write SetConfirmDelete default True; + + property First: TcxNavigatorButton index NBDI_FIRST read GetButton write SetButton; + property PriorPage: TcxNavigatorButton index NBDI_PRIORPAGE read GetButton write SetButton; + property Prior: TcxNavigatorButton index NBDI_PRIOR read GetButton write SetButton; + property Next: TcxNavigatorButton index NBDI_NEXT read GetButton write SetButton; + property NextPage: TcxNavigatorButton index NBDI_NEXTPAGE read GetButton write SetButton; + property Last: TcxNavigatorButton index NBDI_LAST read GetButton write SetButton; + property Insert: TcxNavigatorButton index NBDI_INSERT read GetButton write SetButton; + property Append: TcxNavigatorButton index NBDI_APPEND read GetButton write SetButton; + property Delete: TcxNavigatorButton index NBDI_DELETE read GetButton write SetButton; + property Edit: TcxNavigatorButton index NBDI_EDIT read GetButton write SetButton; + property Post: TcxNavigatorButton index NBDI_POST read GetButton write SetButton; + property Cancel: TcxNavigatorButton index NBDI_CANCEL read GetButton write SetButton; + property Refresh: TcxNavigatorButton index NBDI_REFRESH read GetButton write SetButton; + property SaveBookmark: TcxNavigatorButton index NBDI_SAVEBOOKMARK read GetButton write SetButton; + property GotoBookmark: TcxNavigatorButton index NBDI_GOTOBOOKMARK read GetButton write SetButton; + property Filter: TcxNavigatorButton index NBDI_FILTER read GetButton write SetButton; + public + constructor Create(ANavigator: IcxNavigatorOwner); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure ClickButton(Index: Integer); + procedure ReleaseBookmark; virtual; + + property ButtonCount: Integer read GetButtonCount; + property Buttons[Index: Integer]: TcxNavigatorButton read GetButton; default; + property DefaultImages: TCustomImageList read GetDefaultImages; + property Images: TCustomImageList read FImages write SetImages; + property Navigator: IcxNavigatorOwner read FNavigator; + published + property OnButtonClick: TcxNavigatorButtonClickEvent read FOnButtonClick + write SetOnButtonClick; + end; + + TcxNavigatorButtonViewInfo = class + public + Button: TcxNavigatorButton; + Bounds: TRect; + Enabled: Boolean; + Hint: string; + end; + + TcxNavigatorViewInfo = class + private + FButtonPressTimer: TcxTimer; + FButtons: TList; + FCanvas: TcxCanvas; + FFocusedButton: TcxNavigatorButton; + FHintTimer: TcxTimer; + FHintWindow: THintWindow; + FHintWindowShowing: Boolean; + FHotTrackButtonViewInfo: TcxNavigatorButtonViewInfo; + FIsDirty: Boolean; + FIsInplace: Boolean; + FIsSelected: Boolean; + FNavigator: IcxNavigatorOwner; + FPressedButtonViewInfo: TcxNavigatorButtonViewInfo; + + function GetButton(Index: Integer): TcxNavigatorButtonViewInfo; + function GetButtonCount: Integer; + function GetFocusedButton: TcxNavigatorButtonViewInfo; + procedure SetFocusedButton(Value: TcxNavigatorButtonViewInfo); + function StopButtonPressTimerIfLeftMouseReleased: Boolean; + + procedure DoButtonPressTimer(Sender: TObject); + procedure DoHintTimer(Sender: TObject); + + procedure UpdateSelected; + protected + function GetButtonBorderExtent(APainter: TcxCustomLookAndFeelPainterClass; + AButtonIndex, AButtonCount: Integer): TRect; + function GetButtonState(AButton: TcxNavigatorButtonViewInfo): TcxButtonState; + function GetMiddleButtonBorderExtent(APainter: TcxCustomLookAndFeelPainterClass): TRect; + function GetMinButtonSize(AButtonIndex, AButtonCount: Integer; + AAutoHeight: Boolean = False): TSize; + function GetVisibleButtonCount: Integer; + procedure InvalidateButton(AButton: TcxNavigatorButtonViewInfo); + procedure PaintButton(AButtonIndex: Integer); + procedure HintActivate(AShow: Boolean); + + property Canvas: TcxCanvas read FCanvas; + property FocusedButton: TcxNavigatorButtonViewInfo read GetFocusedButton + write SetFocusedButton; + property HotTrackButtonViewInfo: TcxNavigatorButtonViewInfo + read FHotTrackButtonViewInfo write FHotTrackButtonViewInfo; + property Navigator: IcxNavigatorOwner read FNavigator; + property PressedButtonViewInfo: TcxNavigatorButtonViewInfo + read FPressedButtonViewInfo write FPressedButtonViewInfo; + public + constructor Create(ANavigator: IcxNavigatorOwner; + AIsInplace: Boolean = True); virtual; + destructor Destroy; override; + procedure Calculate; + procedure CheckSize(var AWidth, AHeight: Integer; + ACheckMinHeight: Boolean = False); + procedure Clear; + procedure DoEnter; + procedure DoExit; + function GetButtonAt(const pt: TPoint): TcxNavigatorButton; + function GetButtonViewInfoAt(const pt: TPoint): TcxNavigatorButtonViewInfo; + function GetButtonViewInfoByButton(AButton: TcxNavigatorButton): TcxNavigatorButtonViewInfo; + procedure MakeIsDirty; + procedure MouseDown(X, Y: Integer); + procedure MouseMove(X, Y: Integer); + procedure MouseUp(X, Y: Integer); + procedure Paint; + procedure PressArrowKey(ALeftKey: Boolean); + procedure UpdateButtonsEnabled; + + property ButtonCount: Integer read GetButtonCount; + property Buttons[Index: Integer]: TcxNavigatorButtonViewInfo read GetButton; + end; + + TcxNavigatorViewInfoClass = class of TcxNavigatorViewInfo; + + TcxCustomNavigator = class(TcxControl, IUnknown, + IcxNavigatorOwner, IcxMouseTrackingCaller, IdxSkinSupport) + private + FButtons: TcxCustomNavigatorButtons; + FButtonsEvents: TNotifyEvent; + FViewInfo: TcxNavigatorViewInfo; + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED; + procedure CMHintShow(var Message: TCMHintShow); message CM_HINTSHOW; + protected + function CanFocusOnClick: Boolean; override; + function CanResize(var NewWidth, NewHeight: Integer): Boolean; override; + function CreateButtons: TcxCustomNavigatorButtons; virtual; + procedure DoEnter; override; + procedure DoExit; override; + procedure EnabledChanged; dynamic; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseEnter(AControl: TControl); override; + procedure MouseLeave(AControl: TControl); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure Paint; override; + //IcxMouseTrackingCaller + procedure IcxMouseTrackingCaller.MouseLeave = NavigatorMouseLeave; + procedure NavigatorMouseLeave; + // IcxNavigatorOwner + procedure NavigatorChanged(AChangeType: TcxNavigatorChangeType); + function GetNavigatorBounds: TRect; + function GetNavigatorButtons: TcxCustomNavigatorButtons; + function GetNavigatorCanvas: TCanvas; + function GetNavigatorControl: TWinControl; + function GetNavigatorFocused: Boolean; + function GetNavigatorLookAndFeel: TcxLookAndFeel; + function GetNavigatorOwner: TComponent; + function GetNavigatorShowHint: Boolean; + function GetNavigatorTabStop: Boolean; + function GetViewInfoClass: TcxNavigatorViewInfoClass; virtual; + procedure InitButtons; virtual; + procedure NavigatorButtonsStateChanged; + procedure RefreshNavigator; + procedure CreateWnd; override; + procedure WndProc(var Message: TMessage); override; + property CustomButtons: TcxCustomNavigatorButtons read FButtons; + property ViewInfo: TcxNavigatorViewInfo read FViewInfo; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure ClickButton(Index: Integer); + procedure RestoreButtons; + property LookAndFeel; + published + property TabStop default False; + property ButtonsEvents: TNotifyEvent read FButtonsEvents + write FButtonsEvents; + end; + + TcxNavigatorControlNotifier = class + private + FList: TList; + public + constructor Create; + destructor Destroy; override; + procedure AddNavigator(ANavigator: IcxNavigatorOwner); + procedure RemoveNavigator(ANavigator: IcxNavigatorOwner); + procedure RefreshNavigatorButtons; + end; + + IcxNavigator = interface + ['{A15F80CA-DE56-47CB-B0EB-035D0BF90E9D}'] + function CanAppend: Boolean; + function CanDelete: Boolean; + function CanEdit: Boolean; + function CanInsert: Boolean; + function IsActive: Boolean; + function IsBof: Boolean; + function IsBookmarkAvailable: Boolean; + function IsEditing: Boolean; + function IsEof: Boolean; + procedure ClearBookmark; + procedure DoAction(AButtonIndex: Integer); + function GetNotifier: TcxNavigatorControlNotifier; + function IsActionSupported(AButtonIndex: Integer): Boolean; + end; + + TcxNavigatorControlButtonsGetControl = function: IcxNavigator of object; + + TcxNavigatorControlButtons = class(TcxCustomNavigatorButtons) + private + FOnGetControl: TcxNavigatorControlButtonsGetControl; + + function GetControl: IcxNavigator; + protected + procedure DoButtonClick(ADefaultIndex: Integer); override; + function GetButtonEnabled(ADefaultIndex: Integer): Boolean; override; + + property Control: IcxNavigator read GetControl; + public + procedure ReleaseBookmark; override; + property OnGetControl: TcxNavigatorControlButtonsGetControl + read FOnGetControl write FOnGetControl; + published + property ConfirmDelete; + property Images; + + property First; + property PriorPage; + property Prior; + property Next; + property NextPage; + property Last; + property Insert; + property Append; + property Delete; + property Edit; + property Post; + property Cancel; + property Refresh; + property SaveBookmark; + property GotoBookmark; + property Filter; + end; + + TcxNavigatorControlButtonsClass = class of TcxNavigatorControlButtons; + + TcxCustomNavigatorControl = class(TcxCustomNavigator) + private + FControl: TComponent; + function GetButtons: TcxNavigatorControlButtons; + function GetControl: IcxNavigator; + procedure SetButtons(Value: TcxNavigatorControlButtons); + procedure SetControl(Value: TComponent); + protected + function CreateButtons: TcxCustomNavigatorButtons; override; + function GetButtonsClass: TcxNavigatorControlButtonsClass; virtual; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure InitButtons; override; + property Buttons: TcxNavigatorControlButtons read GetButtons write SetButtons; + property Control: TComponent read FControl write SetControl; + public + destructor Destroy; override; + end; + + TcxNavigator = class(TcxCustomNavigatorControl) + published + property Control; + property Buttons; + property LookAndFeel; + + property Align; + property Anchors; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property Ctl3D; + property ParentCtl3D; + property ParentShowHint; + property PopupMenu; + property ShowHint; + property TabOrder; + property TabStop; + property Visible; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnResize; + property OnStartDock; + property OnStartDrag; + end; + +function NavigatorImages: TImageList; + +implementation + +uses + cxEditPaintUtils, cxEditUtils, cxEditConsts, dxThemeConsts, dxUxTheme, cxGeometry; + +const + cxInitRepeatPause = 400; + cxRepeatPause = 100; + +type + TCustomFormAccess = class(TCustomForm); + +var + FNavigatorImages: TImageList = nil; + +function NavigatorImages: TImageList; + + procedure LoadImageListFromResource(AImageList: TCustomImageList; + const AResName: string; AMaskColor: TColor); + begin + AImageList.GetInstRes(HInstance, rtBitmap, AResName, + AImageList.Width, [], AMaskColor); + end; + +begin + if FNavigatorImages = nil then + begin + FNavigatorImages := TImageList.Create(nil); + FNavigatorImages.Height := 11; + FNavigatorImages.Width := 12; + LoadImageListFromResource(FNavigatorImages, 'CXNAVIGATORBUTTONS', clOlive); + end; + Result := FNavigatorImages; +end; + +{ TcxNavigatorButton } + +constructor TcxNavigatorButton.Create(AButtons: TcxCustomNavigatorButtons; + ADefaultVisible: Boolean); +begin + inherited Create; + FButtons := AButtons; + FDefaultIndex := -1; + FDefaultVisible := ADefaultVisible; + FEnabled := True; + FImageIndex := -1; + FVisible := ADefaultVisible; +end; + +function TcxNavigatorButton.GetOwner: TPersistent; +begin + Result := FButtons; +end; + +procedure TcxNavigatorButton.Assign(Source: TPersistent); +begin + if Source is TcxNavigatorButton then + with Source as TcxNavigatorButton do + begin + Self.Enabled := Enabled; + Self.Hint := Hint; + Self.ImageIndex := ImageIndex; + Self.Visible := Visible; + Self.FIsVisibleAssigned := FIsVisibleAssigned; + Self.OnClick := OnClick; + end + else + inherited Assign(Source); +end; + +procedure TcxNavigatorButton.Click; +begin + if GetInternalEnabled then + DoClick; +end; + +function TcxNavigatorButton.GetInternalEnabled: Boolean; +begin + Result := Enabled; + if Result then + Result := Buttons.GetButtonEnabled(DefaultIndex); +end; + +function TcxNavigatorButton.GetInternalHint: string; +begin + Result := Hint; + if Hint = '' then + Result := Buttons.GetButtonHint(DefaultIndex); +end; + +function TcxNavigatorButton.IsUserImageListUsed: Boolean; +begin + Result := (Buttons.Images <> nil) and (ImageIndex > -1); +end; + +procedure TcxNavigatorButton.DoClick; +var + ADone: Boolean; +begin + if Assigned(OnClick) then + OnClick(Self) + else + begin + ADone := False; + if Assigned(Buttons.FOnButtonClick) then + Buttons.FOnButtonClick(Buttons, DefaultIndex, ADone); + if not ADone then + Buttons.DoButtonClick(DefaultIndex); + end; +end; + +procedure TcxNavigatorButton.RestoreDefaultVisible(ACanBeVisible: Boolean); +begin + if not FIsVisibleAssigned then + InternalSetVisible(FDefaultVisible and ACanBeVisible); +end; + +function TcxNavigatorButton.GetImageSize: TSize; +var + APainter: TcxCustomLookAndFeelPainterClass; +begin + APainter := GetNavigator.GetNavigatorLookAndFeel.SkinPainter; + if (APainter = nil) or IsUserImageListUsed then + begin + Result.cx := InternalImages.Width; + Result.cy := InternalImages.Height; + end + else + Result := APainter.NavigatorGlyphSize; +end; + +function TcxNavigatorButton.GetNavigator: IcxNavigatorOwner; +begin + Result := Buttons.Navigator; +end; + +procedure TcxNavigatorButton.SetEnabled(const Value: Boolean); +begin + if Enabled <> Value then + begin + FEnabled := Value; + if Visible then + Navigator.RefreshNavigator; + Navigator.NavigatorChanged(nctLayout); + end; +end; + +procedure TcxNavigatorButton.SetHint(const Value: string); +begin + if AnsiCompareStr(FHint, Value) <> 0 then + begin + FHint := Value; + Navigator.NavigatorChanged(nctProperties); + end; +end; + +function TcxNavigatorButton.GetInternalImageIndex: Integer; +begin + if (Buttons.Images <> nil) and (ImageIndex > -1) then + Result := ImageIndex + else + Result := DefaultIndex; +end; + +function TcxNavigatorButton.GetIternalImages: TCustomImageList; +begin + if (Buttons.Images <> nil) and (ImageIndex > -1) then + Result := Buttons.Images + else + Result := Buttons.DefaultImages; +end; + +procedure TcxNavigatorButton.InternalSetVisible(Value: Boolean; + AIsInternalSetting: Boolean = True); +begin + if not AIsInternalSetting then + FIsVisibleAssigned := True; + if FVisible <> Value then + begin + FVisible := Value; + Navigator.RefreshNavigator; + Navigator.NavigatorChanged(nctSize); + end; +end; + +function TcxNavigatorButton.IsVisibleStored: Boolean; +begin + Result := FIsVisibleAssigned; +end; + +procedure TcxNavigatorButton.SetImageIndex(Value: TImageIndex); +begin + if ImageIndex <> Value then + begin + FImageIndex := Value; + if Visible then + Navigator.RefreshNavigator; + Navigator.NavigatorChanged(nctLayout); + end; +end; + +procedure TcxNavigatorButton.SetOnClick(const Value: TNotifyEvent); +begin + FOnClick := Value; + Navigator.NavigatorChanged(nctProperties); +end; + +procedure TcxNavigatorButton.SetVisible(const Value: Boolean); +begin + InternalSetVisible(Value, False); +end; + +{ TcxCustomNavigatorButtons } + +constructor TcxCustomNavigatorButtons.Create(ANavigator: IcxNavigatorOwner); +begin + inherited Create; + FNavigator := ANavigator; + FImageChangeLink := TChangeLink.Create; + FImageChangeLink.OnChange := ImageListChange; + CreateButtons; + FConfirmDelete := True; +end; + +destructor TcxCustomNavigatorButtons.Destroy; +begin + FreeAndNil(FImageChangeLink); + DestroyButtons; + inherited Destroy; +end; + +procedure TcxCustomNavigatorButtons.Assign(Source: TPersistent); +var + I: Integer; +begin + if Source is TcxCustomNavigatorButtons then + with TcxCustomNavigatorButtons(Source) do + begin + for I := 0 to ButtonCount - 1 do + Self.FButtons[I].Assign(FButtons[I]); + Self.ConfirmDelete := ConfirmDelete; + Self.Images := Images; + Self.OnButtonClick := OnButtonClick; + end + else + inherited Assign(Source); +end; + +procedure TcxCustomNavigatorButtons.ClickButton(Index: Integer); +begin + Buttons[Index].Click; +end; + +procedure TcxCustomNavigatorButtons.ReleaseBookmark; +begin +end; + +procedure TcxCustomNavigatorButtons.CreateButtons; + + function IsButtonVisibleByDefault(AIndex: Integer): Boolean; + begin + Result := AIndex <> NBDI_APPEND; + end; + +var + I: Integer; +begin + for I := 0 to NavigatorButtonCount - 1 do + begin + FButtons[I] := TcxNavigatorButton.Create(Self, IsButtonVisibleByDefault(I)); + FButtons[I].DefaultIndex := I; + end; +end; + +function TcxCustomNavigatorButtons.GetOwner: TPersistent; +begin + Result := FNavigator.GetNavigatorOwner; +end; + +procedure TcxCustomNavigatorButtons.DestroyButtons; +var + I: Integer; +begin + for I := 0 to NavigatorButtonCount - 1 do + FButtons[I].Free; +end; + +procedure TcxCustomNavigatorButtons.DoButtonClick(ADefaultIndex: Integer); +begin +end; + +function TcxCustomNavigatorButtons.GetButtonEnabled(ADefaultIndex: Integer): Boolean; +begin + Result := IsNavigatorEnabled; +end; + +function TcxCustomNavigatorButtons.GetButtonHint(ADefaultIndex: Integer): string; +begin + case ADefaultIndex of + NBDI_FIRST: Result := cxGetResourceString(@cxNavigatorHint_First); + NBDI_PRIORPAGE: Result := cxGetResourceString(@cxNavigatorHint_PriorPage); + NBDI_PRIOR: Result := cxGetResourceString(@cxNavigatorHint_Prior); + NBDI_LAST: Result := cxGetResourceString(@cxNavigatorHint_Last); + NBDI_NEXT: Result := cxGetResourceString(@cxNavigatorHint_Next); + NBDI_NEXTPAGE: Result := cxGetResourceString(@cxNavigatorHint_NextPage); + NBDI_INSERT: Result := cxGetResourceString(@cxNavigatorHint_Insert); + NBDI_APPEND: Result := cxGetResourceString(@cxNavigatorHint_Append); + NBDI_DELETE: Result := cxGetResourceString(@cxNavigatorHint_Delete); + NBDI_EDIT: Result := cxGetResourceString(@cxNavigatorHint_Edit); + NBDI_POST: Result := cxGetResourceString(@cxNavigatorHint_Post); + NBDI_CANCEL: Result := cxGetResourceString(@cxNavigatorHint_Cancel); + NBDI_REFRESH: Result := cxGetResourceString(@cxNavigatorHint_Refresh); + NBDI_SAVEBOOKMARK: Result := cxGetResourceString(@cxNavigatorHint_SaveBookmark); + NBDI_GOTOBOOKMARK: Result := cxGetResourceString(@cxNavigatorHint_GotoBookmark); + NBDI_FILTER: Result := cxGetResourceString(@cxNavigatorHint_Filter); + else Result := ''; + end; +end; + +function TcxCustomNavigatorButtons.GetButtonImageOffset: Integer; +begin + Result := 2; +end; + +function TcxCustomNavigatorButtons.IsNavigatorEnabled: Boolean; +begin + Result := Navigator.GetNavigatorControl.Enabled; +end; + +function TcxCustomNavigatorButtons.GetButton(Index: Integer): TcxNavigatorButton; +begin + Result := FButtons[Index]; +end; + +function TcxCustomNavigatorButtons.GetButtonCount: Integer; +begin + Result := High(FButtons) - Low(FButtons) + 1; +end; + +function TcxCustomNavigatorButtons.GetDefaultImages: TCustomImageList; +begin + Result := NavigatorImages; +end; + +procedure TcxCustomNavigatorButtons.SetButton(Index: Integer; const Value: TcxNavigatorButton); +begin + FButtons[Index].Assign(Value); +end; + +procedure TcxCustomNavigatorButtons.SetConfirmDelete(const Value: Boolean); +begin + if FConfirmDelete <> Value then + begin + FConfirmDelete := Value; + Navigator.NavigatorChanged(nctProperties); + end; +end; + +procedure TcxCustomNavigatorButtons.SetImages(const Value: TCustomImageList); +begin + cxSetImageList(Value, FImages, FImageChangeLink, Navigator.GetNavigatorOwner); + Navigator.NavigatorChanged(nctLayout); +end; + +procedure TcxCustomNavigatorButtons.SetOnButtonClick( + const Value: TcxNavigatorButtonClickEvent); +begin + FOnButtonClick := Value; + Navigator.NavigatorChanged(nctProperties); +end; + +procedure TcxCustomNavigatorButtons.ImageListChange(Sender: TObject); +begin + Navigator.RefreshNavigator; +end; + +{ TcxNavigatorViewInfo } + +constructor TcxNavigatorViewInfo.Create(ANavigator: IcxNavigatorOwner; + AIsInplace: Boolean = True); +begin + inherited Create; + FNavigator := ANavigator; + FIsDirty := True; + FIsInplace := AIsInplace; + FButtons := TList.Create; + FHintWindowShowing := False; + FButtonPressTimer := TcxTimer.Create(nil); + FButtonPressTimer.Enabled := False; + FButtonPressTimer.OnTimer := DoButtonPressTimer; + FHintTimer := TcxTimer.Create(nil); + FHintTimer.Enabled := False; + FHintTimer.Interval := 500; + FHintTimer.OnTimer := DoHintTimer; + FCanvas := TcxCanvas.Create(nil); +end; + +destructor TcxNavigatorViewInfo.Destroy; +begin + FreeAndNil(FCanvas); + FreeAndNil(FHintTimer); + FreeAndNil(FButtonPressTimer); + FreeAndNil(FHintWindow); + Clear; + FreeAndNil(FButtons); + inherited Destroy; +end; + +procedure TcxNavigatorViewInfo.Calculate; +var + AHeight, AWidth: Integer; + I: Integer; + ANavigatorBounds: TRect; +begin + ANavigatorBounds := Navigator.GetNavigatorBounds; + with ANavigatorBounds do + begin + AWidth := Right - Left; + AHeight := Bottom - Top; + end; + CheckSize(AWidth, AHeight); + for I := 0 to ButtonCount - 1 do + begin + Buttons[I].Enabled := Buttons[I].Button.GetInternalEnabled; + Buttons[I].Hint := Buttons[I].Button.GetInternalHint; + end; + FIsDirty := False; +end; + +procedure TcxNavigatorViewInfo.CheckSize(var AWidth, AHeight: Integer; + ACheckMinHeight: Boolean = False); + + procedure CheckButtonCount; + var + APButtonViewInfo: TcxNavigatorButtonViewInfo; + AVisibleButtonCount, I: Integer; + begin + AVisibleButtonCount := GetVisibleButtonCount; + if AVisibleButtonCount < FButtons.Count then + for I := 1 to FButtons.Count - AVisibleButtonCount do + begin + TcxNavigatorButtonViewInfo(FButtons[AVisibleButtonCount]).Free; + FButtons.Delete(AVisibleButtonCount); + end + else + for I := FButtons.Count to AVisibleButtonCount - 1 do + begin + APButtonViewInfo := TcxNavigatorButtonViewInfo.Create; + FButtons.Add(APButtonViewInfo); + end; + end; + +var + AButtonViewInfo: TcxNavigatorButtonViewInfo; + AButtonVisibleIndex: Integer; + AMinWidth, AMinHeight, ADifX: Integer; + AMinSize: TSize; + ANavigatorBounds, AButtonBounds: TRect; + ANavigatorButtons: TcxCustomNavigatorButtons; + AVisibleButtonCount: Integer; + I: Integer; + AHotTrackButton, APressedButton: TcxNavigatorButton; +begin + ANavigatorBounds := Navigator.GetNavigatorBounds; + + FIsDirty := True; + AHotTrackButton := nil; + APressedButton := nil; + if FHotTrackButtonViewInfo <> nil then + AHotTrackButton := FHotTrackButtonViewInfo.Button; + if FPressedButtonViewInfo <> nil then + APressedButton := FPressedButtonViewInfo.Button; + FHotTrackButtonViewInfo := nil; + FPressedButtonViewInfo := nil; + + AMinWidth := 0; + AMinHeight := 0; + ANavigatorButtons := Navigator.GetNavigatorButtons; + AVisibleButtonCount := GetVisibleButtonCount; + CheckButtonCount; + AButtonVisibleIndex := 0; + + for I := 0 to ANavigatorButtons.ButtonCount - 1 do + if ANavigatorButtons[I].Visible then + begin + AButtonViewInfo := TcxNavigatorButtonViewInfo(FButtons[AButtonVisibleIndex]); + AButtonViewInfo.Button := ANavigatorButtons[I]; + if AButtonViewInfo.Button = APressedButton then + FPressedButtonViewInfo := AButtonViewInfo; + if AButtonViewInfo.Button = AHotTrackButton then + FHotTrackButtonViewInfo := AButtonViewInfo; + AMinSize := GetMinButtonSize(AButtonVisibleIndex, AVisibleButtonCount, + ACheckMinHeight); + Inc(AMinWidth, AMinSize.cx); + if AMinHeight < AMinSize.cy then + AMinHeight := AMinSize.cy; + Inc(AButtonVisibleIndex); + end; + ADifX := 0; + if AHeight < AMinHeight then + AHeight := AMinHeight; + if AWidth < AMinWidth then + AWidth := AMinWidth + else + begin + if ButtonCount > 0 then + ADifX := (AWidth - AMinWidth) div ButtonCount; + AWidth := AMinWidth + ADifX * ButtonCount; + end; + AButtonBounds.Right := ANavigatorBounds.Left; + AButtonBounds.Top := ANavigatorBounds.Top; + AButtonBounds.Bottom := AButtonBounds.Top + AHeight; + for I := 0 to ButtonCount - 1 do + begin + AButtonBounds.Left := AButtonBounds.Right; + AButtonBounds.Right := AButtonBounds.Right + GetMinButtonSize(I, AVisibleButtonCount).cx + ADifX; + Buttons[I].Bounds := AButtonBounds; + end; +end; + +procedure TcxNavigatorViewInfo.Clear; +var + I: Integer; +begin + FIsDirty := True; + FHotTrackButtonViewInfo := nil; + FPressedButtonViewInfo := nil; + for I := 0 to ButtonCount - 1 do + TcxNavigatorButtonViewInfo(FButtons[I]).Free; + FButtons.Clear; +end; + +procedure TcxNavigatorViewInfo.DoEnter; +begin + InvalidateButton(FocusedButton); + UpdateSelected; +end; + +procedure TcxNavigatorViewInfo.DoExit; +begin + InvalidateButton(FocusedButton); + UpdateSelected; +end; + +function TcxNavigatorViewInfo.GetButtonAt(const pt: TPoint): TcxNavigatorButton; +var + AViewInfo: TcxNavigatorButtonViewInfo; +begin + AViewInfo := GetButtonViewInfoAt(pt); + if AViewInfo <> nil then + Result := AViewInfo.Button + else + Result := nil; +end; + +function TcxNavigatorViewInfo.GetButtonViewInfoAt(const pt: TPoint): TcxNavigatorButtonViewInfo; +var + I: Integer; +begin + Result := nil; + for I := 0 to ButtonCount - 1 do + if PtInRect(Buttons[I].Bounds, pt) then + begin + Result := Buttons[I]; + Break; + end; +end; + +function TcxNavigatorViewInfo.GetButtonViewInfoByButton( + AButton: TcxNavigatorButton): TcxNavigatorButtonViewInfo; +var + I: Integer; +begin + Result := nil; + for I := 0 to ButtonCount - 1 do + if Buttons[I].Button = AButton then + begin + Result := Buttons[I]; + break; + end; +end; + +procedure TcxNavigatorViewInfo.MakeIsDirty; +begin + FIsDirty := True; +end; + +procedure TcxNavigatorViewInfo.MouseDown(X, Y: Integer); +var + AButtonViewInfo: TcxNavigatorButtonViewInfo; +begin + FHintTimer.Enabled := False; + HintActivate(False); + AButtonViewInfo := GetButtonViewInfoAt(Point(X, Y)); + if (AButtonViewInfo <> nil) + and (GetButtonState(AButtonViewInfo) <> cxbsDisabled) then + begin + FButtonPressTimer.Interval := cxInitRepeatPause; + FButtonPressTimer.Enabled := True; + PressedButtonViewInfo := AButtonViewInfo; + FocusedButton := AButtonViewInfo; + InvalidateButton(PressedButtonViewInfo); + end; + UpdateSelected; +end; + +procedure TcxNavigatorViewInfo.MouseMove(X, Y: Integer); +var + AButtonViewInfo: TcxNavigatorButtonViewInfo; +begin + AButtonViewInfo := GetButtonViewInfoAt(Point(X, Y)); + if AButtonViewInfo <> HotTrackButtonViewInfo then + begin + if (HotTrackButtonViewInfo <> nil) + and (GetButtonState(HotTrackButtonViewInfo) <> cxbsDisabled) then + InvalidateButton(HotTrackButtonViewInfo); + FHotTrackButtonViewInfo := AButtonViewInfo; + if (HotTrackButtonViewInfo <> nil) + and (GetButtonState(HotTrackButtonViewInfo) <> cxbsDisabled) then + InvalidateButton(HotTrackButtonViewInfo); + if FHintWindowShowing then + HintActivate(True) + else FHintTimer.Enabled := True; + end; + if HotTrackButtonViewInfo = nil then + HintActivate(False); + UpdateSelected; +end; + +procedure TcxNavigatorViewInfo.MouseUp(X, Y: Integer); +var + AButtonViewInfo: TcxNavigatorButtonViewInfo; +begin + FButtonPressTimer.Enabled := False; + AButtonViewInfo := PressedButtonViewInfo; + FPressedButtonViewInfo := nil; + InvalidateButton(AButtonViewInfo); + FHintTimer.Enabled := True; + UpdateSelected; + if (AButtonViewInfo <> nil) and PtInRect(AButtonViewInfo.Bounds, Point(X, Y)) and AButtonViewInfo.Enabled then + AButtonViewInfo.Button.DoClick; +end; + +procedure TcxNavigatorViewInfo.Paint; +var + R: TRect; + I: Integer; + ANavigatorControl: TWinControl; +begin + FCanvas.Canvas := Navigator.GetNavigatorCanvas; + if FIsDirty then + Calculate; + for I := 0 to ButtonCount - 1 do + PaintButton(I); + R := Navigator.GetNavigatorBounds; + ANavigatorControl := Navigator.GetNavigatorControl; + Navigator.GetNavigatorLookAndFeel.GetAvailablePainter(totButton).DrawButtonGroupBorder(Canvas, + R, FIsInplace and ANavigatorControl.Enabled, FIsSelected or (not FIsInplace and + (csDesigning in ANavigatorControl.ComponentState) and ANavigatorControl.Enabled)); + if FIsInplace then + Canvas.ExcludeClipRect(R); +end; + +procedure TcxNavigatorViewInfo.PressArrowKey(ALeftKey: Boolean); +var + AIndex: Integer; +begin + AIndex := FButtons.IndexOf(FocusedButton); + if AIndex < 0 then exit; + if ALeftKey then + begin + if AIndex > 0 then + FocusedButton := Buttons[AIndex - 1]; + end else + begin + if AIndex < ButtonCount - 1 then + FocusedButton := Buttons[AIndex + 1]; + end; +end; + +procedure TcxNavigatorViewInfo.UpdateButtonsEnabled; +var + I: Integer; +begin + for I := 0 to ButtonCount - 1 do + if Buttons[I].Enabled <> Buttons[I].Button.GetInternalEnabled then + begin + Buttons[I].Enabled := not Buttons[I].Enabled; + InvalidateButton(Buttons[I]); + end; +end; + +procedure TcxNavigatorViewInfo.InvalidateButton(AButton: TcxNavigatorButtonViewInfo); +var + ANavigatorControl: TWinControl; +begin + if AButton <> nil then + begin + ANavigatorControl := Navigator.GetNavigatorControl; + if ANavigatorControl.HandleAllocated then + Windows.InvalidateRect(ANavigatorControl.Handle, + @(AButton.Bounds), False); + end; +end; + +procedure TcxNavigatorViewInfo.PaintButton(AButtonIndex: Integer); + + procedure DrawButtonGlyph(ACanvas: TcxCanvas; const AGlyphRect: TRect); + var + AButton: TcxNavigatorButtonViewInfo; + AButtonState: TcxButtonState; + APainter: TcxCustomLookAndFeelPainterClass; + begin + AButton := TcxNavigatorButtonViewInfo(FButtons[AButtonIndex]); + AButtonState := GetButtonState(AButton); + APainter := Navigator.GetNavigatorLookAndFeel.GetAvailablePainter(totButton); + APainter.DrawNavigatorGlyph(ACanvas, AButton.Button.InternalImages, + AButton.Button.InternalImageIndex, AButtonIndex, AGlyphRect, + AButtonState <> cxbsDisabled, AButton.Button.IsUserImageListUsed); + end; + +var + ABitmap: TcxCustomBitmap; + AButton: TcxNavigatorButtonViewInfo; + AButtonBounds, AContentRect, AImageRect, R1: TRect; + AButtonState: TcxButtonState; + AImageSize: TSize; + APainter: TcxCustomLookAndFeelPainterClass; + ACanvas: TcxCanvas; +begin + AButton := TcxNavigatorButtonViewInfo(FButtons[AButtonIndex]); + AButtonBounds := AButton.Bounds; + if not Canvas.RectVisible(AButtonBounds) then + Exit; + AButtonState := GetButtonState(AButton); + APainter := Navigator.GetNavigatorLookAndFeel.GetAvailablePainter(totButton); + AButtonBounds := APainter.AdjustGroupButtonDisplayRect(AButtonBounds, FButtons.Count, AButtonIndex); + AImageSize := AButton.Button.GetImageSize; + AContentRect := AButtonBounds; + ExtendRect(AContentRect, GetButtonBorderExtent(APainter, AButtonIndex, FButtons.Count)); + with AContentRect do + begin + AImageRect.Left := Left + (Right - Left - AImageSize.cx) div 2; + AImageRect.Top := Top + (Bottom - Top - AImageSize.cy) div 2; + AImageRect.Right := AImageRect.Left + AImageSize.cx; + AImageRect.Bottom := AImageRect.Top + AImageSize.cy; + if GetButtonState(AButton) = cxbsPressed then + OffsetRect(AImageRect, 1, 1); + end; + + ABitmap := TcxCustomBitmap.CreateSize(cxRectWidth(AButtonBounds), cxRectHeight(AButtonBounds), pf32bit); + try + ACanvas := ABitmap.cxCanvas; + cxDrawTransparentControlBackground(Navigator.GetNavigatorControl, ACanvas, + AButtonBounds); + APainter.DrawButtonInGroup(ACanvas, ABitmap.ClientRect, + AButtonState, FButtons.Count, AButtonIndex, clWindow); + + R1 := AImageRect; + OffsetRect(R1, - AButtonBounds.Left, - AButtonBounds.Top); + DrawButtonGlyph(ACanvas, R1); + cxBitBlt(Canvas.Handle, ACanvas.Handle, AButtonBounds, cxNullPoint, SRCCOPY); + + if Navigator.GetNavigatorTabStop and (AButton = FocusedButton) and + Navigator.GetNavigatorFocused + then + Canvas.DrawFocusRect(AImageRect); + + if APainter = TcxWinXPLookAndFeelPainter then + Canvas.ExcludeClipRect(AButton.Bounds); + finally + FreeAndNil(ABitmap); + end; +end; + +procedure TcxNavigatorViewInfo.HintActivate(AShow: Boolean); + + function NeedShowHint(const AHint: string): Boolean; + begin + Result := AShow and Navigator.GetNavigatorShowHint and (AHint <> '') and + CanShowHint(Navigator.GetNavigatorControl); + end; + +var + AHint: string; + P: TPoint; + R: TRect; +begin + if FHintWindow <> nil then + begin + FHintWindow.Hide; + if IsWindowVisible(FHintWindow.Handle) then + ShowWindow(FHintWindow.Handle, SW_HIDE); + FreeAndNil(FHintWindow); + end; + FHintTimer.Enabled := False; + FHintWindowShowing := False; + if (HotTrackButtonViewInfo <> nil) then + AHint := GetShortHint(HotTrackButtonViewInfo.Hint) + else + AHint := ''; + if NeedShowHint(AHint) then + begin + FHintWindow := HintWindowClass.Create(nil); + P := InternalGetCursorPos; + Inc(P.Y, cxGetCursorSize.cy); + R := FHintWindow.CalcHintRect(Screen.Width, AHint, nil); + R := Rect(P.X, P.Y, P.X + R.Right, P.Y + R.Bottom - R.Top); + FHintWindow.Color := Application.HintColor; + {$IFDEF DELPHI7} + FHintWindow.ParentWindow := Application.Handle; //Bug in delphi7 and higher + {$ENDIF} + FHintWindow.ActivateHint(R, AHint); + FHintWindowShowing := True; + end; +end; + +function TcxNavigatorViewInfo.GetButton(Index: Integer): TcxNavigatorButtonViewInfo; +begin + Result := TcxNavigatorButtonViewInfo(FButtons[Index]); +end; + +function TcxNavigatorViewInfo.GetButtonCount: Integer; +begin + Result := FButtons.Count; +end; + +function TcxNavigatorViewInfo.GetFocusedButton: TcxNavigatorButtonViewInfo; +begin + if (FFocusedButton <> nil) and not FFocusedButton.Visible then + FFocusedButton := nil; + if (FFocusedButton = nil) and (ButtonCount > 0) then + FFocusedButton := Buttons[0].Button; + if (FFocusedButton <> nil) then + Result := GetButtonViewInfoByButton(FFocusedButton) + else Result := nil; +end; + +procedure TcxNavigatorViewInfo.SetFocusedButton(Value: TcxNavigatorButtonViewInfo); +var + AOldButtonViewInfo: TcxNavigatorButtonViewInfo; +begin + AOldButtonViewInfo := GetFocusedButton; + if AOldButtonViewInfo <> Value then + begin + FFocusedButton := Value.Button; + InvalidateButton(AOldButtonViewInfo); + InvalidateButton(Value); + end; +end; + +function TcxNavigatorViewInfo.StopButtonPressTimerIfLeftMouseReleased: Boolean; +begin + if not (ssLeft in InternalGetShiftState) then + begin + FButtonPressTimer.Enabled := False; + MouseUp(-1, -1); + Result := True; + end + else + Result := False; +end; + +function TcxNavigatorViewInfo.GetButtonBorderExtent(APainter: TcxCustomLookAndFeelPainterClass; + AButtonIndex, AButtonCount: Integer): TRect; +begin + Result := APainter.ButtonGroupBorderSizes(AButtonCount, AButtonIndex); +end; + +function TcxNavigatorViewInfo.GetButtonState(AButton: TcxNavigatorButtonViewInfo): TcxButtonState; +begin + Result := cxbsNormal; + if not AButton.Enabled then + Result := cxbsDisabled + else + if (AButton = PressedButtonViewInfo) + and (AButton = HotTrackButtonViewInfo) then + Result := cxbsPressed + else + if AButton = HotTrackButtonViewInfo then + Result := cxbsHot; +end; + +function TcxNavigatorViewInfo.GetMiddleButtonBorderExtent( + APainter: TcxCustomLookAndFeelPainterClass): TRect; +begin + Result := APainter.ButtonGroupBorderSizes(3, 1); +end; + +function TcxNavigatorViewInfo.GetMinButtonSize( + AButtonIndex, AButtonCount: Integer; AAutoHeight: Boolean = False): TSize; +var + AButtonBorderExtent: TRect; + APainter: TcxCustomLookAndFeelPainterClass; +begin + Result := TcxNavigatorButtonViewInfo(FButtons[AButtonIndex]).Button.GetImageSize; + APainter := Navigator.GetNavigatorLookAndFeel.GetAvailablePainter(totButton); + AButtonBorderExtent := GetMiddleButtonBorderExtent(APainter); + Result.cx := Result.cx + AButtonBorderExtent.Left + AButtonBorderExtent.Right + 1; + if AAutoHeight then + Result.cy := Result.cy + AButtonBorderExtent.Top + AButtonBorderExtent.Bottom + 1 + else + Result.cy := AButtonBorderExtent.Top + AButtonBorderExtent.Bottom + 1; +end; + +function TcxNavigatorViewInfo.GetVisibleButtonCount: Integer; +var + ANavigatorButtons: TcxCustomNavigatorButtons; + I: Integer; +begin + Result := 0; + ANavigatorButtons := Navigator.GetNavigatorButtons; + for I := 0 to ANavigatorButtons.ButtonCount - 1 do + if ANavigatorButtons[I].Visible then + Inc(Result); +end; + +procedure TcxNavigatorViewInfo.DoButtonPressTimer(Sender: TObject); +begin + if StopButtonPressTimerIfLeftMouseReleased then + Exit; + FButtonPressTimer.Interval := cxRepeatPause; + if (HotTrackButtonViewInfo <> nil) and (HotTrackButtonViewInfo = PressedButtonViewInfo) and + PressedButtonViewInfo.Enabled and (PressedButtonViewInfo.Button.DefaultIndex in [NBDI_PRIOR, NBDI_NEXT]) then + try + PressedButtonViewInfo.Button.DoClick; + except + FButtonPressTimer.Enabled := False; + raise; + end; +end; + +procedure TcxNavigatorViewInfo.DoHintTimer(Sender: TObject); +begin + HintActivate(True); +end; + +procedure TcxNavigatorViewInfo.UpdateSelected; +var + AIsSelected: Boolean; + ANavigatorControl: TWinControl; + R1, R2: TRect; +begin + if not Navigator.GetNavigatorLookAndFeel.Painter.IsButtonHotTrack then + Exit; + ANavigatorControl := Navigator.GetNavigatorControl; + AIsSelected := (HotTrackButtonViewInfo <> nil) or (PressedButtonViewInfo <> nil) or + Navigator.GetNavigatorFocused; + if (AIsSelected <> FIsSelected) and ANavigatorControl.HandleAllocated then + begin + FIsSelected := AIsSelected; + R1 := Navigator.GetNavigatorBounds; + R2 := R1; + InflateRect(R2, -1, -1); + InternalInvalidate(ANavigatorControl.Handle, R1, R2, False); + end; +end; + +{ TcxCustomNavigator } + +constructor TcxCustomNavigator.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := ControlStyle - [csAcceptsControls, csSetCaption] + [csOpaque]; + FButtons := CreateButtons; + FViewInfo := GetViewInfoClass.Create(Self, False); + TabStop := False; + Height := 25; +end; + +destructor TcxCustomNavigator.Destroy; +begin + EndMouseTracking(Self); + FreeAndNil(FViewInfo); + FreeAndNil(FButtons); + inherited Destroy; +end; + +procedure TcxCustomNavigator.ClickButton(Index: Integer); +begin + CustomButtons.ClickButton(Index); +end; + +procedure TcxCustomNavigator.RestoreButtons; +var + I: Integer; +begin + with CustomButtons do + for I := 0 to ButtonCount - 1 do + FButtons[I].FIsVisibleAssigned := False; + InitButtons; +end; + +function TcxCustomNavigator.CanFocusOnClick: Boolean; +begin + Result := inherited CanFocusOnClick and TabStop; +end; + +function TcxCustomNavigator.CanResize(var NewWidth, NewHeight: Integer): Boolean; +begin + Result := inherited CanResize(NewWidth, NewHeight); + if Result and (FViewInfo <> nil) and HandleAllocated then + FViewInfo.CheckSize(NewWidth, NewHeight); +end; + +function TcxCustomNavigator.CreateButtons: TcxCustomNavigatorButtons; +begin + Result := TcxCustomNavigatorButtons.Create(Self); +end; + +procedure TcxCustomNavigator.Paint; +begin + FViewInfo.Paint; +end; + +procedure TcxCustomNavigator.DoEnter; +begin + inherited DoEnter; + FViewInfo.DoEnter; +end; + +procedure TcxCustomNavigator.DoExit; +begin + inherited DoExit; + FViewInfo.DoExit; +end; + +procedure TcxCustomNavigator.EnabledChanged; +begin + RefreshNavigator; +end; + +procedure TcxCustomNavigator.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited KeyDown(Key, Shift); + if (Key = VK_LEFT) or (Key = VK_RIGHT) then + FViewInfo.PressArrowKey(Key = VK_LEFT); + if (Key = VK_SPACE) and (FViewInfo.FocusedButton <> nil) + and FViewInfo.FocusedButton.Enabled then + FViewInfo.FocusedButton.Button.DoClick; +end; + +procedure TcxCustomNavigator.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + if Button = mbLeft then + FViewInfo.MouseDown(X, Y); +end; + +procedure TcxCustomNavigator.MouseEnter(AControl: TControl); +begin + inherited MouseEnter(AControl); +{$IFDEF DELPHI7} + if IsDesigning then + Exit; +{$ENDIF} + BeginMouseTracking(Self, Bounds, Self); +end; + +procedure TcxCustomNavigator.MouseLeave(AControl: TControl); +begin + inherited MouseLeave(AControl); +{$IFDEF DELPHI7} + if IsDesigning then + Exit; +{$ENDIF} + EndMouseTracking(Self); + FViewInfo.MouseMove(-1, -1); +end; + +procedure TcxCustomNavigator.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + FViewInfo.MouseMove(X, Y); + BeginMouseTracking(Self, Bounds, Self); +end; + +procedure TcxCustomNavigator.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + FViewInfo.MouseUp(X, Y); +end; + +procedure TcxCustomNavigator.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + inherited LookAndFeelChanged(Sender, AChangedValues); + RecreateWnd +end; + +procedure TcxCustomNavigator.NavigatorMouseLeave; +begin + FViewInfo.MouseMove(-1, -1); +// FViewInfo.FHintWindow.Free; +// FViewInfo.FHintWindow := THintWindow.Create(nil); +end; + +procedure TcxCustomNavigator.NavigatorChanged(AChangeType: TcxNavigatorChangeType); +begin +end; + +function TcxCustomNavigator.GetNavigatorBounds: TRect; +begin + Result := Rect(0, 0, ClientWidth, ClientHeight); +end; + +function TcxCustomNavigator.GetNavigatorButtons: TcxCustomNavigatorButtons; +begin + Result := CustomButtons; +end; + +function TcxCustomNavigator.GetNavigatorCanvas: TCanvas; +begin + Result := Canvas.Canvas; +end; + +function TcxCustomNavigator.GetNavigatorControl: TWinControl; +begin + Result := Self; +end; + +function TcxCustomNavigator.GetNavigatorLookAndFeel: TcxLookAndFeel; +begin + Result := LookAndFeel; +end; + +function TcxCustomNavigator.GetNavigatorFocused: Boolean; +begin + Result := Focused; +end; + +function TcxCustomNavigator.GetNavigatorShowHint: Boolean; +begin + Result := ShowHint; +end; + +function TcxCustomNavigator.GetNavigatorTabStop: Boolean; +begin + Result := TabStop; +end; + +function TcxCustomNavigator.GetViewInfoClass: TcxNavigatorViewInfoClass; +begin + Result := TcxNavigatorViewInfo; +end; + +procedure TcxCustomNavigator.InitButtons; +var + I: Integer; +begin + for I := 0 to FButtons.ButtonCount - 1 do + FButtons[I].RestoreDefaultVisible(True); +end; + +function TcxCustomNavigator.GetNavigatorOwner: TComponent; +begin + Result := Self; +end; + +procedure TcxCustomNavigator.NavigatorButtonsStateChanged; +begin + FViewInfo.UpdateButtonsEnabled; +end; + +procedure TcxCustomNavigator.RefreshNavigator; +var + AWidth, AHeight: Integer; +begin + if not HandleAllocated then + Exit; + AWidth := Width; + AHeight := Height; + FViewInfo.CheckSize(AWidth, AHeight); + if (AWidth <> Width) or (Height <> AHeight) then + SetBounds(Left, Top, AWidth, AHeight) + else + Invalidate; +end; + +procedure TcxCustomNavigator.CreateWnd; +begin + inherited CreateWnd; + RefreshNavigator; +end; + +procedure TcxCustomNavigator.WndProc(var Message: TMessage); +begin + if (FViewInfo <> nil) and (FViewInfo.FHintWindowShowing) then + with Message do + if ((Msg >= WM_KEYFIRST) and (Msg <= WM_KEYLAST)) or + ((Msg = CM_ACTIVATE) or (Msg = CM_DEACTIVATE)) or + (Msg = CM_APPKEYDOWN) or (Msg = CM_APPSYSCOMMAND) or + (Msg = WM_COMMAND) or ((Msg > WM_MOUSEMOVE) and + (Msg <= WM_MOUSELAST)) or (Msg = WM_NCMOUSEMOVE) then + FViewInfo.HintActivate(False); + inherited WndProc(Message); +end; + +procedure TcxCustomNavigator.WMGetDlgCode(var Message: TWMGetDlgCode); +begin + Message.Result := DLGC_WANTARROWS; +end; + +procedure TcxCustomNavigator.CMEnabledChanged(var Message: TMessage); +begin + inherited; + EnabledChanged; +end; + +procedure TcxCustomNavigator.CMHintShow(var Message: TCMHintShow); +begin + Message.Result := 1; +end; + +{ TcxNavigatorControlNotifier } + +constructor TcxNavigatorControlNotifier.Create; +begin + inherited Create; + FList := TList.Create; +end; + +destructor TcxNavigatorControlNotifier.Destroy; +begin + FreeAndNil(FList); + inherited Destroy; +end; + +procedure TcxNavigatorControlNotifier.AddNavigator(ANavigator: IcxNavigatorOwner); +begin + if FList.IndexOf(Pointer(ANavigator)) < 0 then + FList.Add(Pointer(ANavigator)); +end; + +procedure TcxNavigatorControlNotifier.RemoveNavigator(ANavigator: IcxNavigatorOwner); +begin + FList.Remove(Pointer(ANavigator)); +end; + +procedure TcxNavigatorControlNotifier.RefreshNavigatorButtons; +var + I: Integer; +begin + for I := 0 to FList.Count - 1 do + IcxNavigatorOwner(FList[I]).NavigatorButtonsStateChanged; +end; + +{ TcxNavigatorControlButtons } +procedure TcxNavigatorControlButtons.ReleaseBookmark; +var + ANavigatorControl: IcxNavigator; +begin + ANavigatorControl := Control; + if (ANavigatorControl <> nil) and ANavigatorControl.IsBookmarkAvailable then + ANavigatorControl.ClearBookmark; +end; + +function TcxNavigatorControlButtons.GetControl: IcxNavigator; +begin + if Assigned(FOnGetControl) then + Result := FOnGetControl + else + Result := nil; +end; + +procedure TcxNavigatorControlButtons.DoButtonClick(ADefaultIndex: Integer); +var + ANavigatorControl: IcxNavigator; +begin + ANavigatorControl := Control; + if ANavigatorControl <> nil then + ANavigatorControl.DoAction(ADefaultIndex); + FNavigator.NavigatorButtonsStateChanged; +end; + +function TcxNavigatorControlButtons.GetButtonEnabled(ADefaultIndex: Integer): Boolean; +var + ANavigatorControl: IcxNavigator; +begin + ANavigatorControl := Control; + Result := (ANavigatorControl <> nil) and IsNavigatorEnabled and + (ANavigatorControl.IsActive or (ADefaultIndex = NBDI_FILTER)); + if Result then + case ADefaultIndex of + NBDI_FIRST, NBDI_PRIOR, NBDI_PRIORPAGE: + Result := not ANavigatorControl.IsBof; + NBDI_LAST, NBDI_NEXT, NBDI_NEXTPAGE: + Result := not ANavigatorControl.IsEof; + NBDI_INSERT: + Result := ANavigatorControl.CanInsert; + NBDI_APPEND: + Result := ANavigatorControl.CanAppend; + NBDI_DELETE: + Result := ANavigatorControl.CanDelete; + NBDI_EDIT: + Result := ANavigatorControl.CanEdit and not ANavigatorControl.IsEditing; + NBDI_POST, NBDI_CANCEL: + Result := ANavigatorControl.IsEditing; + NBDI_GOTOBOOKMARK: + Result := ANavigatorControl.IsBookmarkAvailable; + end; +end; + +{ TcxCustomNavigatorControl } + +destructor TcxCustomNavigatorControl.Destroy; +begin + Control := nil; + inherited Destroy; +end; + +function TcxCustomNavigatorControl.CreateButtons: TcxCustomNavigatorButtons; +begin + Result := GetButtonsClass.Create(Self); + TcxNavigatorControlButtons(Result).OnGetControl := GetControl; +end; + +function TcxCustomNavigatorControl.GetButtonsClass: TcxNavigatorControlButtonsClass; +begin + Result := TcxNavigatorControlButtons; +end; + +procedure TcxCustomNavigatorControl.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (AComponent = Control) then + Control := nil; +end; + +procedure TcxCustomNavigatorControl.InitButtons; +var + ANavigator: IcxNavigator; + I: Integer; +begin + if FControl = nil then + begin + for I := 0 to FButtons.ButtonCount - 1 do + FButtons[I].RestoreDefaultVisible(True); + end + else + begin + Supports(FControl, IcxNavigator, ANavigator); + for I := 0 to FButtons.ButtonCount - 1 do + FButtons[I].RestoreDefaultVisible(ANavigator.IsActionSupported(FButtons[I].DefaultIndex)); + end; +end; + +function TcxCustomNavigatorControl.GetButtons: TcxNavigatorControlButtons; +begin + Result := TcxNavigatorControlButtons(CustomButtons); +end; + +function TcxCustomNavigatorControl.GetControl: IcxNavigator; +begin + if Control <> nil then + Supports(Control, IcxNavigator, Result) + else + Result := nil; +end; + +procedure TcxCustomNavigatorControl.SetButtons(Value: TcxNavigatorControlButtons); +begin + CustomButtons.Assign(Value); +end; + +procedure TcxCustomNavigatorControl.SetControl(Value: TComponent); +var + ANavigator: IcxNavigator; +begin + if (Value <> FControl) and ((Value = nil) or Supports(Value, IcxNavigator, + ANavigator)) then + begin + if FControl <> nil then + begin + {$IFDEF DELPHI5} + FControl.RemoveFreeNotification(Self); + {$ENDIF} + Supports(FControl, IcxNavigator, ANavigator); + if ANavigator.GetNotifier <> nil then + ANavigator.GetNotifier.RemoveNavigator(Self); + end; + FControl := Value; + if (FControl <> nil) then + begin + FControl.FreeNotification(Self); + Supports(FControl, IcxNavigator, ANavigator); + if ANavigator.GetNotifier <> nil then + ANavigator.GetNotifier.AddNavigator(Self); + end; + InitButtons; + RefreshNavigator; + end; +end; + +initialization + +finalization + FreeAndNil(FNavigatorImages); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxProgressBar.pas b/official/x.35/ExpressEditors Library 5/Sources/cxProgressBar.pas new file mode 100644 index 00000000..beff3921 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxProgressBar.pas @@ -0,0 +1,2737 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxProgressBar; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, Variants, +{$ENDIF} + Windows, Classes, Controls, Forms, Graphics, Messages, SysUtils, cxClasses, + cxContainer, cxControls, cxCustomData, cxEdit, cxExtEditConsts, + cxFilterControlUtils, cxGraphics, cxTextEdit, cxVariants; + +const + cxProgressBarDefaultAnimationSpeed = 10; + cxProgressBarDefaultAnimationRestartDelay = 0; +type + TcxBorderWidth = 0..MaxWord; + TcxProgressBarAnimationSpeed = 0..20; + TcxProgressBarBevelOuter = (cxbvNone, cxbvLowered, cxbvRaised); + TcxProgressBarOrientation = (cxorHorizontal, cxorVertical); + TcxProgressBarTextStyle = (cxtsPercent, cxtsPosition, cxtsText); + TcxProgressBarBarStyle = (cxbsSolid, cxbsLEDs, cxbsGradient, + cxbsGradientLEDs, cxbsBitmap, cxbsBitmapLEDs, cxbsAnimation, + cxbsAnimationLEDs); + TcxProgressBarAnimationPath = (cxapCycle, cxapPingPong); + +const + cxDefaultShowTextStyle = cxtsPercent; + +type + { TcxCustomProgressBarViewInfo } + + TcxCustomProgressBar = class; + + TcxCustomProgressBarViewInfo = class(TcxCustomTextEditViewInfo) + private + FAnimationPath: TcxProgressBarAnimationPath; + FAnimationRestartDelay: Cardinal; + FAnimationPosition: Integer; + FAnimationDirection: Integer; + FAnimationSpeed: Cardinal; + FAnimationTimer: TcxTimer; + FAnimationRestartDelayTimer: TcxTimer; + FBeginColor: TColor; + FBarBevelOuter: TcxProgressBarBevelOuter; + FUsualBitmap: TcxBitmap; + FPainterBitmap: TcxBitmap; + FEndColor: TColor; + FMarquee: Boolean; + FMax: Double; + FMin: Double; + FNativeBitmap: TBitmap; + FPosition: Double; + FForegroundImage: TBitmap; + FOrientation: TcxProgressBarOrientation; + FShowText: Boolean; + FShowTextStyle: TcxProgressBarTextStyle; + FTextOrientation: TcxProgressBarOrientation; + FSolidTextColor: Boolean; + FBarStyle: TcxProgressBarBarStyle; + FOverloadValue: Double; + FOverloadBeginColor: TColor; + FOverloadEndColor: TColor; + FShowOverload: Boolean; + FPeakValue: Double; + FPeakColor: TColor; + FPeakSize: TcxNaturalNumber; + FShowPeak: Boolean; + FRealShowOverload: Boolean; + FRealShowPeak: Boolean; + FPropTransparent: Boolean; + procedure CalcDrawingParams(out ADrawProgressBarRect, ADrawOverloadBarRect, + ADrawPeakBarRect, ADrawAnimationBarRect, ASolidRect: TRect; out ALEDsWidth: Integer); + function CanAnimationBarShow: Boolean; + procedure CreateBarBmp; + procedure CreateNativeBitmap(const ASize: TSize); + procedure CreatePainterBitmap; + procedure ExcludeRects(ACanvas: TcxCanvas; const ABounds: TRect); + procedure ExcludeLEDRects(ACanvas: TcxCanvas; const ABounds: TRect); + function GetAnimationTimerInterval: Cardinal; + function GetAnimationOffset: Integer; + function GetMaxMinDiff: Double; + function GetRelativeOverloadValue: Double; + function GetRelativePeakValue: Double; + function GetRelativePosition: Double; + function IsLEDStyle: Boolean; + procedure DrawBackground(ACanvas: TcxCanvas; const ACanvasParent: TcxCanvas; const ABounds: TRect); + function GetDrawDelta: Integer; + function GetDrawText: string; + procedure DrawBarCaption(ACanvas: TcxCanvas); + procedure PaintBarBevelOuter(ACanvas: TcxCanvas; ABBORect: TRect); + procedure DrawBarBitmap(ACanvas: TcxCanvas; ARect: TRect); + procedure DrawGradientBar(ACanvas: TcxCanvas; const ANormalRect, AOverloadRect: TRect); + procedure DrawSolidBar(ACanvas: TcxCanvas; const ANormalRect, AOverloadRect: TRect); + procedure DrawAnimationBar(ACanvas: TcxCanvas; const ABar, ASolidRect: TRect); + procedure DrawAnimationBarBackground(ACanvas: TcxCanvas; const ASolidRect: TRect; ASolidColor: TColor; ADrawBar: Boolean); + function CalcLEDsWidth: Integer; + procedure AdjustForLEDsBarBounds(var ABarRect, AOverloadBarRect: TRect; const ALEDsWidth: Integer); + procedure DrawPeak(ACanvas: TcxCanvas; const APeakRect: TRect); + procedure DrawBorderLEDs(ACanvas: TcxCanvas; const ABarRect: TRect; ALEDsWidth: Integer); + procedure DoAnimationTimer(Sender: TObject); + procedure DoAnimationRestartDelayTimer(Sender: TObject); + procedure StartAnimationTimer; + procedure StartAnimationRestartDelayTimer; + procedure StopAnimationTimer; + procedure StopAnimationRestartDelayTimer; + procedure SetAnimationPath(AValue: TcxProgressBarAnimationPath); + procedure SetAnimationSpeed(AValue: Cardinal); + procedure SetMarquee(AValue: Boolean); + procedure SetBarStyle(AValue: TcxProgressBarBarStyle); + procedure SetAnimationFirstPosition; + procedure CalcAnimationCurrentPosition; + function GetCorrectAnimationBarRect: TRect; + function GetMinPositionInBounds: Integer; + function GetMaxPositionInBounds: Integer; + procedure SetOrientation(AValue: TcxProgressBarOrientation); + protected + ChangedBounds: Boolean; + ChangedBoundsBarRect: Boolean; + BarRect: TRect; + ProgressBarRect: TRect; + OverloadBarRect: TRect; + PeakBarRect: TRect; + AnimationBarRect: TRect; + procedure PaintProgressBarByPainter(ACanvas: TcxCanvas); + function GetAnimationBarDimension: Integer; virtual; + function GetAnimationDerection: Integer; virtual; + + property AnimationPath: TcxProgressBarAnimationPath read FAnimationPath + write SetAnimationPath; + property AnimationRestartDelay: Cardinal read FAnimationRestartDelay write FAnimationRestartDelay; + property AnimationSpeed: Cardinal read FAnimationSpeed write SetAnimationSpeed; + property BeginColor: TColor read FBeginColor write FBeginColor; + property BarBevelOuter: TcxProgressBarBevelOuter read FBarBevelOuter + write FBarBevelOuter; + property EndColor: TColor read FEndColor write FEndColor; + property Marquee: Boolean read FMarquee write SetMarquee; + property Min: Double read FMin write FMin; + property Max: Double read FMax write FMax; + property MaxMinDiff: Double read GetMaxMinDiff; + property OverloadValue: Double read FOverloadValue write FOverloadValue; + property PeakValue: Double read FPeakValue write FPeakValue; + property Position: Double read FPosition write FPosition; + property RelativePeakValue: Double read GetRelativePeakValue; + property RelativeOverloadValue: Double read GetRelativeOverloadValue; + property RelativePosition: Double read GetRelativePosition; + + property ForegroundImage: TBitmap read FForegroundImage write FForegroundImage; + property Orientation: TcxProgressBarOrientation read FOrientation write SetOrientation; + property ShowText: Boolean read FShowText write FShowText; + property ShowTextStyle: TcxProgressBarTextStyle read FShowTextStyle write FShowTextStyle; + property TextOrientation: TcxProgressBarOrientation read FTextOrientation + write FTextOrientation; + property SolidTextColor: Boolean read FSolidTextColor write FSolidTextColor; + property BarStyle: TcxProgressBarBarStyle read FBarStyle write SetBarStyle; + property OverloadBeginColor: TColor read FOverloadBeginColor write FOverloadBeginColor; + property OverloadEndColor: TColor read FOverloadEndColor write FOverloadEndColor; + property PeakColor: TColor read FPeakColor write FPeakColor; + property PeakSize: TcxNaturalNumber read FPeakSize write FPeakSize; + property ShowOverload: Boolean read FShowOverload write FShowOverload; + property ShowPeak: Boolean read FShowPeak write FShowPeak; + property PropTransparent: Boolean read FPropTransparent write FPropTransparent; + public + FocusRect: TRect; + HasForegroundImage: Boolean; + constructor Create; override; + destructor Destroy; override; + procedure DrawText(ACanvas: TcxCanvas); override; + function GetPercentDone: Integer; + function GetUpdateRegion(AViewInfo: TcxContainerViewInfo): TcxRegion; override; + function NeedShowHint(ACanvas: TcxCanvas; const P: TPoint; out AText: TCaption; + out AIsMultiLine: Boolean; out ATextRect: TRect): Boolean; override; + procedure Paint(ACanvas: TcxCanvas); override; + procedure PaintProgressBar(ACanvas: TcxCanvas); virtual; + procedure Offset(DX: Integer; DY: Integer); override; + end; + + { TcxCustomProgressBarViewData } + + TcxCustomProgressBarProperties = class; + + TcxCustomProgressBarViewData = class(TcxCustomEditViewData) + private + function GetProperties: TcxCustomProgressBarProperties; + protected + procedure CalculateViewInfoProperties(AViewInfo: TcxCustomEditViewInfo); virtual; + function InternalGetEditConstantPartSize(ACanvas: TcxCanvas; AIsInplace: Boolean; + AEditSizeProperties: TcxEditSizeProperties; + var MinContentSize: TSize; AViewInfo: TcxCustomEditViewInfo): TSize; override; + function GetDrawTextFlags: Integer; virtual; + function GetIsEditClass: Boolean; + public + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); override; + procedure CalculateButtonsViewInfo(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); override; + procedure EditValueToDrawValue(ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + AViewInfo: TcxCustomEditViewInfo); override; + property Properties: TcxCustomProgressBarProperties read GetProperties; + end; + + { TcxProgressBarPropertiesValues } + + TcxProgressBarPropertiesValues = class(TcxCustomEditPropertiesValues) + private + function GetMax: Boolean; + function GetMin: Boolean; + function IsMaxStored: Boolean; + function IsMinStored: Boolean; + procedure SetMax(Value: Boolean); + procedure SetMin(Value: Boolean); + published + property Max: Boolean read GetMax write SetMax stored IsMaxStored; + property Min: Boolean read GetMin write SetMin stored IsMinStored; + end; + + { TcxCustomProgressBarProperties } + + TcxCustomProgressBarProperties = class(TcxCustomEditProperties) + private + FAnimationPath: TcxProgressBarAnimationPath; + FAnimationRestartDelay: Cardinal; + FAnimationSpeed: TcxProgressBarAnimationSpeed; + FBeginColor: TColor; + FBarBevelOuter: TcxProgressBarBevelOuter; + FChangedForegroundImage: Boolean; + FChangedPosition: Boolean; + FEndColor: TColor; + FForegroundImage: TBitmap; + FMarquee: Boolean; + FOrientation: TcxProgressBarOrientation; + FShowText: Boolean; + FShowTextStyle: TcxProgressBarTextStyle; + FText: string; + FTextOrientation: TcxProgressBarOrientation; + FSolidTextColor: Boolean; + FBarStyle: TcxProgressBarBarStyle; + FTransparentImage: Boolean; + FBorderWidth: TcxBorderWidth; + FOverloadValue: Double; + FShowOverload: Boolean; + FOverloadBeginColor: TColor; + FOverloadEndColor: TColor; + FPeakValue: Double; + FShowPeak: Boolean; + FPeakColor: TColor; + FPeakSize: TcxNaturalNumber; + function GetAssignedValues: TcxProgressBarPropertiesValues; + function GetForegroundImage: TBitmap; + procedure ForegroundImageChanged(Sender: TObject); + function GetMax: Double; + function GetMin: Double; + function GetOverloadValueStored: Boolean; + function GetPeakValueStored: Boolean; + function GetRealPeakValue(APosition: Double): Double; + function IsMaxStored: Boolean; + function IsMinStored: Boolean; + function IsShowTextStyleStored: Boolean; + procedure SetAnimationPath(AValue: TcxProgressBarAnimationPath); + procedure SetAnimationRestartDelay(AValue: Cardinal); + procedure SetAnimationSpeed(AValue: TcxProgressBarAnimationSpeed); + procedure SetAssignedValues(Value: TcxProgressBarPropertiesValues); + procedure SetBeginColor(Value: TColor); + procedure SetBarBevelOuter(Value: TcxProgressBarBevelOuter); + procedure SetColorVista; + procedure SetEndColor(Value: TColor); + procedure SetForegroundImage(Value: TBitmap); + procedure SetMarquee(Value: Boolean); + procedure SetMax(Value: Double); + procedure SetMin(Value: Double); + procedure SetOrientation(Value: TcxProgressBarOrientation); + procedure SetShowText(Value: Boolean); + procedure SetShowTextStyle(Value: TcxProgressBarTextStyle); + procedure SetTextOrientation(Value: TcxProgressBarOrientation); + procedure SetSolidTextColor(Value: Boolean); + procedure SetBarStyle(Value: TcxProgressBarBarStyle); + procedure SetText(const AValue: string); + procedure SetTransparentImage(Value: Boolean); + procedure SetBorderWidth(Value: TcxBorderWidth); + procedure SetOverloadValue(Value: Double); + procedure SetShowOverload(Value: Boolean); + procedure SetOverloadBeginColor(Value: TColor); + procedure SetOverloadEndColor(Value: TColor); + procedure SetPeakValue(Value: Double); + procedure SetShowPeak(Value: Boolean); + procedure SetPeakColor(Value: TColor); + procedure SetPeakSize(Value: TcxNaturalNumber); + procedure PostMinValue; + procedure PostMaxValue; + procedure PostOverloadValue; + protected + procedure CorrectPositionWithMaxMin( + AViewInfo: TcxCustomProgressBarViewInfo); virtual; + class function GetAssignedValuesClass: TcxCustomEditPropertiesValuesClass; override; + function GetMaxValue: Double; override; + function GetMinValue: Double; override; + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + function HasDisplayValue: Boolean; override; + property AssignedValues: TcxProgressBarPropertiesValues read GetAssignedValues + write SetAssignedValues; + property ChangedForegroundImage: Boolean read FChangedForegroundImage + write FChangedForegroundImage default False; + property ChangedPosition: Boolean read FChangedPosition + write FChangedPosition default False; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function CanCompareEditValue: Boolean; override; + class function GetContainerClass: TcxContainerClass; override; + function GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; override; + function GetSupportedOperations: TcxEditSupportedOperations; override; + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + function IsEditValueValid(var EditValue: TcxEditValue; + AEditFocused: Boolean): Boolean; override; + procedure PrepareDisplayValue(const AEditValue: TcxEditValue; + var DisplayValue: TcxEditValue; AEditFocused: Boolean); override; + // !!! + property AnimationPath: TcxProgressBarAnimationPath read FAnimationPath + write SetAnimationPath default cxapCycle; + property AnimationRestartDelay: Cardinal read FAnimationRestartDelay write SetAnimationRestartDelay default cxProgressBarDefaultAnimationRestartDelay; + property AnimationSpeed: TcxProgressBarAnimationSpeed read FAnimationSpeed write SetAnimationSpeed default cxProgressBarDefaultAnimationSpeed; + property BarBevelOuter: TcxProgressBarBevelOuter read FBarBevelOuter + write SetBarBevelOuter default cxbvNone; + property BarStyle: TcxProgressBarBarStyle read FBarStyle write SetBarStyle + default cxbsSolid; + property BeginColor: TColor read FBeginColor write SetBeginColor + default clNavy; + property BorderWidth : TcxBorderWidth read FBorderWidth write SetBorderWidth + default 0; + property EndColor: TColor read FEndColor write SetEndColor default clWhite; + property ForegroundImage: TBitmap read GetForegroundImage + write SetForegroundImage; + property Marquee: Boolean read FMarquee write SetMarquee default False; + property Max: Double read GetMax write SetMax stored IsMaxStored; + property Min: Double read GetMin write SetMin stored IsMinStored; + property Orientation: TcxProgressBarOrientation read FOrientation + write SetOrientation default cxorHorizontal; + property OverloadBeginColor: TColor read FOverloadBeginColor + write SetOverloadBeginColor default $008080FF; + property OverloadEndColor: TColor read FOverloadEndColor + write SetOverloadEndColor default clFuchsia; + property OverloadValue: Double read FOverloadValue write SetOverloadValue + stored GetOverloadValueStored; + property PeakColor: TColor read FPeakColor write SetPeakColor default clRed; + property PeakSize: TcxNaturalNumber read FPeakSize write SetPeakSize + default 2; + property PeakValue: Double read FPeakValue write SetPeakValue + stored GetPeakValueStored; + property ShowOverload: Boolean read FShowOverload write SetShowOverload + default False; + property ShowPeak: Boolean read FShowPeak write SetShowPeak default False; + property ShowText: Boolean read FShowText write SetShowText default True; + property ShowTextStyle: TcxProgressBarTextStyle read FShowTextStyle + write SetShowTextStyle stored IsShowTextStyleStored; + property SolidTextColor: Boolean read FSolidTextColor + write SetSolidTextColor default False; + property Text: string read FText write SetText; + property TextOrientation: TcxProgressBarOrientation read FTextOrientation + write SetTextOrientation default cxorHorizontal; + property Transparent; // deprecated + property TransparentImage: Boolean read FTransparentImage + write SetTransparentImage default True; + end; + + { TcxProgressBarProperties } + + TcxProgressBarProperties = class(TcxCustomProgressBarProperties) + published + property AnimationPath; + property AnimationRestartDelay; + property AnimationSpeed; + property AssignedValues; + property BarBevelOuter; + property BarStyle; + property BeginColor; + property BorderWidth; + property EndColor; + property ForegroundImage; + property Marquee; + property Max; + property Min; + property Orientation; + property OverloadBeginColor; + property OverloadEndColor; + property OverloadValue; + property PeakColor; + property PeakSize; + property PeakValue; + property ShowOverload; + property ShowPeak; + property ShowText; + property ShowTextStyle; + property SolidTextColor; + property Text; + property TextOrientation; + property Transparent; // deprecated + property TransparentImage; + end; + + { TcxCustomProgressBar } + + TcxCustomProgressBar = class(TcxCustomEdit) + private + function GetPercentDone: Integer; + function GetPosition: Double; + function GetPositionStored: Boolean; + function GetProperties: TcxCustomProgressBarProperties; + function GetActiveProperties: TcxCustomProgressBarProperties; + function GetViewInfo: TcxCustomProgressBarViewInfo; + procedure SetProperties(Value: TcxCustomProgressBarProperties); + procedure SetPosition(Value: Double); + protected + procedure CheckEditorValueBounds; virtual; + procedure CheckEditValue; virtual; + function DefaultParentColor: Boolean; override; + procedure FillSizeProperties(var AEditSizeProperties: TcxEditSizeProperties); override; + procedure Initialize; override; + function InternalGetNotPublishedStyleValues: TcxEditStyleValues; override; + procedure SynchronizeDisplayValue; override; + procedure PropertiesChanged(Sender: TObject); override; + property ViewInfo: TcxCustomProgressBarViewInfo read GetViewInfo; + function CanFocusOnClick: Boolean; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + function CanFocus: Boolean; override; + property ActiveProperties: TcxCustomProgressBarProperties + read GetActiveProperties; + property PercentDone: Integer read GetPercentDone; + property Position: Double read GetPosition write SetPosition + stored GetPositionStored; + property Properties: TcxCustomProgressBarProperties read GetProperties + write SetProperties; + property Transparent; + end; + + { TcxCustomProgressBar } + + TcxProgressBar = class(TcxCustomProgressBar) + private + function GetActiveProperties: TcxProgressBarProperties; + function GetProperties: TcxProgressBarProperties; + procedure SetProperties(Value: TcxProgressBarProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxProgressBarProperties + read GetActiveProperties; + published + property Align; + property Anchors; + property AutoSize; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Position; + property Properties: TcxProgressBarProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Transparent; + property Visible; + property OnContextPopup; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +uses + Math, cxEditConsts, cxDrawTextUtils, cxEditUtils, cxExtEditUtils, cxSpinEdit, + dxThemeConsts, dxThemeManager, dxUxTheme, cxGeometry, dxOffice11, cxLookAndFeels; + +const + cxAnimationBarColorLightPercentage = 60; + cxAnimationBarMiddlePartWidth = 10; + cxAnimationBarTopPartWidth = 6; + cxAnimationBarTopBeginColorLightPercentage = 40; + cxAnimationBarTopEndColorLightPercentage = 80; + cxAnimationBarBorderExtPartColorLightPercentage = 90; + cxAnimationBarBorderIntPartColorLightPercentage = 80; + cxAnimationBarBorderExtPathWidth = 4; + cxAnimationBarBorderIntPathWidth = 20; + cxAnimationBarBackgroundBorderWidth = 8; + +type + { TcxFilterProgressBarHelper } + + TcxFilterProgressBarHelper = class(TcxFilterSpinEditHelper) + public + class procedure InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); override; + end; + +procedure CalculateCustomProgressBarViewInfo(ACanvas: TcxCanvas; AViewData: TcxCustomProgressBarViewData; + AViewInfo: TcxCustomProgressBarViewInfo); + + procedure CheckFocusRectBounds; + begin + with AViewInfo do + begin + if FocusRect.Left < TextRect.Left - 1 then + FocusRect.Left := TextRect.Left - 1; + if FocusRect.Top < TextRect.Top - 1 then + FocusRect.Top := TextRect.Top - 1; + if FocusRect.Right > TextRect.Right + 1 then + FocusRect.Right := TextRect.Right + 1; + if FocusRect.Bottom > TextRect.Bottom + 1 then + FocusRect.Bottom := TextRect.Bottom + 1; + end; + end; + +begin + with AViewInfo do + begin + if not IsInplace and Focused then + if Length(Text) = 0 then + FocusRect := cxEmptyRect + else + begin + FocusRect := TextRect; + InflateRect(FocusRect, 1, 1); + CheckFocusRectBounds; + end; + end; +end; + +function CalculateDelta(const APositionDelta, ARectWidth, AMaxMinDelta: Double): Integer; +var + ACalc: Double; +begin + ACalc := (APositionDelta * ARectWidth) / AMaxMinDelta; + Result := Trunc(ACalc); +end; + +{ TcxCustomProgressBarViewInfo } + +constructor TcxCustomProgressBarViewInfo.Create; +begin + inherited Create; + FForegroundImage := TBitmap.Create; + ChangedBounds := False; + ChangedBoundsBarRect := False; + FMarquee := False; + FAnimationPath := cxapCycle; + FAnimationRestartDelay := cxProgressBarDefaultAnimationRestartDelay; + FUsualBitmap := TcxBitmap.Create; +end; + +destructor TcxCustomProgressBarViewInfo.Destroy; +begin + FreeAndNil(FForegroundImage); + FreeAndNil(FAnimationTimer); + FreeAndNil(FAnimationRestartDelayTimer); + FreeAndNil(FUsualBitmap); + FreeAndNil(FNativeBitmap); + FreeAndNil(FPainterBitmap); + inherited Destroy; +end; + +function TcxCustomProgressBarViewInfo.GetUpdateRegion(AViewInfo: TcxContainerViewInfo): TcxRegion; +begin + Result := inherited GetUpdateRegion(AViewInfo); + if not (AViewInfo is TcxCustomProgressBarViewInfo) then Exit; +end; + +function TcxCustomProgressBarViewInfo.NeedShowHint(ACanvas: TcxCanvas; + const P: TPoint; out AText: TCaption; out AIsMultiLine: Boolean; + out ATextRect: TRect): Boolean; +begin + Result := False; +end; + +procedure TcxCustomProgressBarViewInfo.DrawText(ACanvas: TcxCanvas); +begin + DrawBarCaption(ACanvas); +end; + +function TcxCustomProgressBarViewInfo.GetPercentDone: Integer; +begin + Result := Math.Min(Round(RelativePosition * 100 / MaxMinDiff), 100); +end; + +procedure TcxCustomProgressBarViewInfo.Offset(DX: Integer; DY: Integer); +begin + inherited Offset(DX, DY); + InflateRectEx(BarRect, DX, DY, DX, DY); + InflateRectEx(ProgressBarRect, DX, DY, DX, DY); + InflateRectEx(OverloadBarRect, DX, DY, DX, DY); + InflateRectEx(PeakBarRect, DX, DY, DX, DY); +end; + +procedure TcxCustomProgressBarViewInfo.Paint(ACanvas: TcxCanvas); +begin + if ChangedBoundsBarRect then + CreateBarBmp; + if not Assigned(FUsualBitmap) then + Exit; + + if not ChangedBounds and not (FShowText and (GetDrawText <> '')) then + Exit; + if Painter <> nil then + PaintProgressBarByPainter(ACanvas) + else + begin + if not (AreVisualStylesMustBeUsed(NativeStyle, totProgress) or + IsInplace and Transparent) then + DrawCustomEdit(ACanvas, Self, False, bpsSolid); + PaintProgressBar(ACanvas); + end; +end; + +procedure TcxCustomProgressBarViewInfo.PaintProgressBar(ACanvas: TcxCanvas); +var + ALEDsWidth: Integer; + ADrawDelta: Integer; + ABarRect: TRect; + ADrawProgressBarRect: TRect; + ADrawOverloadBarRect: TRect; + ADrawPeakBarRect: TRect; + ADrawAnimationBarRect: TRect; + ASolidRect: TRect; + APrevLogFont: TLogFont; +begin + SaveCanvasFont(ACanvas, APrevLogFont); + try + ADrawDelta := GetDrawDelta; + CalcDrawingParams(ADrawProgressBarRect, ADrawOverloadBarRect, ADrawPeakBarRect, + ADrawAnimationBarRect, ASolidRect, ALEDsWidth); + ABarRect := BarRect; + if IsInplace then + InflateRectEx(ABarRect, -BarRect.Left, -BarRect.Top, -BarRect.Left, -BarRect.Top); + FUsualBitmap.cxCanvas.SaveClipRegion; + try + DrawBackground(FUsualBitmap.cxCanvas, ACanvas, ABarRect); + if FMarquee and not IsInplace then + begin + ExcludeRects(FUsualBitmap.cxCanvas, ASolidRect); + ExcludeRects(FUsualBitmap.cxCanvas, ADrawAnimationBarRect); + ExcludeLEDRects(FUsualBitmap.cxCanvas, ADrawAnimationBarRect); + ASolidRect := ADrawAnimationBarRect; + end + else + begin + ExcludeRects(FUsualBitmap.cxCanvas, ASolidRect); + ExcludeLEDRects(FUsualBitmap.cxCanvas, ASolidRect); + end; + case FBarStyle of + cxbsSolid, cxbsLEDs, cxbsGradient, cxbsGradientLEDs: + begin + if (FBarStyle in [cxbsSolid, cxbsLEDs]) and not NativeStyle then + DrawSolidBar(FUsualBitmap.cxCanvas, ADrawProgressBarRect, ADrawOverloadBarRect) + else + DrawGradientBar(FUsualBitmap.cxCanvas, ADrawProgressBarRect, ADrawOverloadBarRect); + if not IsLEDStyle then + PaintBarBevelOuter(FUsualBitmap.cxCanvas, ASolidRect); + end; + cxbsBitmap, cxbsBitmapLEDs: + if IsGlyphAssigned(FForegroundImage) then + DrawBarBitmap(FUsualBitmap.cxCanvas, ASolidRect); + cxbsAnimation, cxbsAnimationLEDs: + begin + if not (FMarquee and IsDesigning) then + DrawAnimationBarBackground(FUsualBitmap.cxCanvas, ASolidRect, FBeginColor, True); + if not FMarquee then + DrawAnimationBar(FUsualBitmap.cxCanvas, ADrawAnimationBarRect, ASolidRect); + end; + end; + if IsLEDStyle then + DrawBorderLEDs(FUsualBitmap.cxCanvas, ASolidRect, ALEDsWidth); + finally + FUsualBitmap.cxCanvas.RestoreClipRegion; + end; + if not (FBarStyle in [cxbsAnimation, cxbsAnimationLEDs]) then + DrawPeak(FUsualBitmap.cxCanvas, ADrawPeakBarRect); + DrawText(FUsualBitmap.cxCanvas); + BitBlt(ACanvas.Canvas.Handle, BarRect.Left, BarRect.Top, + FUsualBitmap.Width, FUsualBitmap.Height, FUsualBitmap.cxCanvas.Handle, + ADrawDelta, ADrawDelta, SRCCOPY); + finally + RestoreCanvasFont(ACanvas, APrevLogFont); + end; +end; + +procedure TcxCustomProgressBarViewInfo.PaintProgressBarByPainter(ACanvas: TcxCanvas); +var + AChunkRect: TRect; + AContentRect: TRect; + ARect: TRect; + AVertical: Boolean; + + function CalcRect(AVertical: Boolean; const AContentRect: TRect; + AProgressKf: Double): TRect; + begin + Result := AContentRect; + if AVertical then + Inc(Result.Top, Trunc(RectHeight(Result) * (1 - AProgressKf))) + else + Result.Right := Result.Left + Trunc(RectWidth(Result) * AProgressKf); + end; + + procedure DrawOverload(ACanvas: TcxCanvas); + var + AOverloadRect: TRect; + begin + AOverloadRect := CalcRect(AVertical, AContentRect, RelativeOverloadValue / MaxMinDiff); + if AVertical then + begin + AOverloadRect.Bottom := AOverloadRect.Top; + AOverloadRect.Top := AChunkRect.Top; + end + else + begin + AOverloadRect.Left := AOverloadRect.Right; + AOverloadRect.Right := AChunkRect.Right; + end; + + if not IsRectEmpty(AOverloadRect) then + ACanvas.InvertRect(AOverloadRect); + end; + +begin + if Painter = nil then Exit; + ARect := Bounds; + AVertical := Orientation = cxorVertical; + OffsetRect(ARect, -ARect.Left, -ARect.Top); + CreatePainterBitmap; + if not Assigned(FPainterBitmap) then + Exit; + if not IsInplace then + cxDrawTransparentControlBackground(Edit, FPainterBitmap.cxCanvas, Bounds) + else + cxEditFillRect(FPainterBitmap.cxCanvas, ARect, BackgroundColor); + + ARect := Rect(BarRect.Left - Bounds.Left, BarRect.Top - Bounds.Top, + FPainterBitmap.Width - (Bounds.Right - BarRect.Right), + FPainterBitmap.Height - (Bounds.Bottom - BarRect.Bottom)); + + AContentRect := cxRectContent(ARect, Painter.ProgressBarBorderSize(AVertical)); + if FMarquee and not IsInplace then + AChunkRect := GetCorrectAnimationBarRect + else + AChunkRect := CalcRect(AVertical, AContentRect, RelativePosition / MaxMinDiff); + Painter.DrawProgressBarBorder(FPainterBitmap.cxCanvas, ARect, AVertical); + FPainterBitmap.cxCanvas.SetClipRegion(TcxRegion.Create(AContentRect), roSet); + Painter.DrawProgressBarChunk(FPainterBitmap.cxCanvas, AChunkRect, AVertical); + + if FRealShowOverload then + DrawOverload(FPainterBitmap.cxCanvas); + DrawText(FPainterBitmap.cxCanvas); + cxBitBlt(ACanvas.Handle, FPainterBitmap.cxCanvas.Handle, Bounds, cxNullPoint, SRCCOPY); +end; + +procedure TcxCustomProgressBarViewInfo.CalcDrawingParams(out ADrawProgressBarRect, ADrawOverloadBarRect, + ADrawPeakBarRect, ADrawAnimationBarRect, ASolidRect: TRect; out ALEDsWidth: Integer); +begin + ADrawProgressBarRect := ProgressBarRect; + ADrawOverloadBarRect := OverloadBarRect; + ADrawPeakBarRect := PeakBarRect; + ADrawAnimationBarRect := GetCorrectAnimationBarRect; + + if IsInplace then + begin + InflateRectEx(ADrawProgressBarRect, -BarRect.Left, -BarRect.Top, -BarRect.Left, -BarRect.Top); + InflateRectEx(ADrawOverloadBarRect, -BarRect.Left, -BarRect.Top, -BarRect.Left, -BarRect.Top); + InflateRectEx(ADrawPeakBarRect, -BarRect.Left, -BarRect.Top, -BarRect.Left, -BarRect.Top); + InflateRectEx(ADrawAnimationBarRect, -BarRect.Left, -BarRect.Top, -BarRect.Left, -BarRect.Top); + end; + + ALEDsWidth := CalcLEDsWidth; + + if IsLEDStyle then + AdjustForLEDsBarBounds(ADrawProgressBarRect, ADrawOverloadBarRect, ALEDsWidth); + + if not FRealShowOverload then + ASolidRect := ADrawProgressBarRect + else + if FOrientation = cxorHorizontal then + ASolidRect := Rect(ADrawProgressBarRect.Left, ADrawProgressBarRect.Top, + ADrawOverloadBarRect.Right, ADrawOverloadBarRect.Bottom) + else + ASolidRect := Rect(ADrawOverloadBarRect.Left, ADrawOverloadBarRect.Top, + ADrawProgressBarRect.Right, ADrawProgressBarRect.Bottom); +end; + +function TcxCustomProgressBarViewInfo.CanAnimationBarShow: Boolean; +begin + Result := (((FBarStyle in [cxbsAnimation, cxbsAnimationLEDs]) and not FMarquee) or FMarquee) and + (FAnimationSpeed > 0) and not IsDesigning and not IsInplace; +end; + +procedure TcxCustomProgressBarViewInfo.CreateBarBmp; +var + ADrawDelta: Integer; +begin + FreeAndNil(FUsualBitmap); + FUsualBitmap := TcxBitmap.Create; + ADrawDelta := GetDrawDelta; + FUsualBitmap.Width := RectWidth(BarRect) + ADrawDelta; + FUsualBitmap.Height := RectHeight(BarRect) + ADrawDelta; + ChangedBoundsBarRect := False; +end; + +procedure TcxCustomProgressBarViewInfo.CreateNativeBitmap(const ASize: TSize); +var + ATheme: TdxTheme; + ACreateNewBitmap: Boolean; + ANativeBitmapRect: TRect; +begin + ACreateNewBitmap := not Assigned(FNativeBitmap); + if not ACreateNewBitmap and + ((FNativeBitmap.Height <> ASize.cy) or (FNativeBitmap.Width <> ASize.cx)) then + ACreateNewBitmap := True; + if not ACreateNewBitmap then + Exit; + if not Assigned(FNativeBitmap) then + FNativeBitmap := TBitmap.Create; + ATheme := OpenTheme(totProgress); + FNativeBitmap.Width := ASize.cx; + FNativeBitmap.Height := ASize.cy; + ANativeBitmapRect := FNativeBitmap.Canvas.ClipRect; + if FOrientation = cxorHorizontal then + begin + ANativeBitmapRect.Left := -4; + DrawThemeBackground(ATheme, FNativeBitmap.Canvas.Handle, PP_CHUNK, 1, + ANativeBitmapRect); + end + else + begin + ANativeBitmapRect.Top := -4; + DrawThemeBackground(ATheme, FNativeBitmap.Canvas.Handle, PP_CHUNKVERT, 1, + ANativeBitmapRect); + end; +end; + +procedure TcxCustomProgressBarViewInfo.CreatePainterBitmap; +var + ACreateNewBitmap: Boolean; +begin + ACreateNewBitmap := not Assigned(FPainterBitmap); + if not ACreateNewBitmap and + ((FPainterBitmap.Height <> RectHeight(Bounds)) or + (FPainterBitmap.Width <> RectWidth(Bounds))) then + ACreateNewBitmap := True; + if not ACreateNewBitmap then + Exit; + FreeAndNil(FPainterBitmap); + FPainterBitmap := TcxBitmap.CreateSize(Bounds); +end; + +procedure TcxCustomProgressBarViewInfo.ExcludeRects(ACanvas: TcxCanvas; const ABounds: TRect); +begin + if (FBarStyle in [cxbsAnimation, cxbsAnimationLEDs]) and + NativeStyle then + begin + if FOrientation = cxorHorizontal then + begin + ACanvas.ExcludeClipRect(Rect(ABounds.Right, Bounds.Top, Bounds.Right, Bounds.Bottom)); + ACanvas.ExcludeClipRect(Rect(Bounds.Left, Bounds.Top, ABounds.Left, Bounds.Bottom)); + end + else + begin + ACanvas.ExcludeClipRect(Rect(Bounds.Left, Bounds.Top, Bounds.Right, ABounds.Top)); + ACanvas.ExcludeClipRect(Rect(Bounds.Left, ABounds.Bottom, Bounds.Right, Bounds.Bottom)) + end; + end + else + ACanvas.SetClipRegion(TcxRegion.Create(ABounds), roIntersect); +end; +procedure TcxCustomProgressBarViewInfo.ExcludeLEDRects(ACanvas: TcxCanvas; + const ABounds: TRect); +var + I, ALEDsWidth, ALEDsMaxCount: Integer; +begin + ALEDsWidth := CalcLEDsWidth; + if IsLEDStyle then + begin + if FOrientation = cxorHorizontal then + begin + ALEDsMaxCount := RectWidth(ABounds) div ALEDsWidth; + for I := 1 to ALEDsMaxCount do + ACanvas.ExcludeClipRect(Rect(ABounds.Left + I * ALEDsWidth - 2, ABounds.Top, + ABounds.Left + I * ALEDsWidth, ABounds.Bottom)); + end + else + begin + ALEDsMaxCount := RectHeight(ABounds) div ALEDsWidth; + for I := 1 to ALEDsMaxCount do + ACanvas.ExcludeClipRect(Rect(ABounds.Left, ABounds.Bottom - I * ALEDsWidth, + ABounds.Right, ABounds.Bottom - I * ALEDsWidth + 2)); + end; + end; +end; + +function TcxCustomProgressBarViewInfo.GetAnimationTimerInterval: Cardinal; +begin + if FAnimationSpeed <= High(FAnimationSpeed) div 2 then + Result := 30 + else + Result := 30 + (High(FAnimationSpeed) - FAnimationSpeed) * 4; +end; + +function TcxCustomProgressBarViewInfo.GetAnimationOffset: Integer; +begin + if FAnimationSpeed >= High(FAnimationSpeed) div 2 then + Result := 2 + else + Result := 2 + (FAnimationSpeed + High(FAnimationSpeed)) * 2; +end; + +function TcxCustomProgressBarViewInfo.GetMaxMinDiff: Double; +begin + Result := Max - Min; + if Result = 0 then + Result := 1; +end; + +function TcxCustomProgressBarViewInfo.GetRelativeOverloadValue: Double; +begin + Result := OverloadValue - Min; +end; + +function TcxCustomProgressBarViewInfo.GetRelativePeakValue: Double; +begin + Result := PeakValue - Min; +end; + +function TcxCustomProgressBarViewInfo.GetRelativePosition: Double; +begin + if FMarquee then + Result := Max + else + Result := Position - Min; +end; + +function TcxCustomProgressBarViewInfo.IsLEDStyle: Boolean; +begin + Result := FBarStyle in [cxbsLEDs, cxbsGradientLEDs, cxbsBitmapLEDs, + cxbsAnimationLEDs]; +end; + +procedure TcxCustomProgressBarViewInfo.DrawBackground(ACanvas: TcxCanvas; const ACanvasParent: TcxCanvas; const ABounds: TRect); +var + ATheme: TdxTheme; + ABarThemeType: Integer; +begin + if PropTransparent then + begin + if not IsInplace then + begin + cxDrawTransparentControlBackground(Edit, ACanvas, Bounds); + end + else + begin + BitBlt(ACanvas.Handle, 0, 0, + ABounds.Right - ABounds.Left, ABounds.Bottom - ABounds.Top, + ACanvasParent.Handle, ABounds.Left, ABounds.Top, SRCCOPY); + end; + end + else + begin + if not (FBarStyle in [cxbsAnimation, cxbsAnimationLEDs]) then + begin + ACanvas.Brush.Style := bsSolid; + ACanvas.FillRect(ABounds, BackgroundColor); + end; + end; + if (NativeStyle or (FBarStyle in [cxbsAnimation, cxbsAnimationLEDs])) and + not IsInplace and not PropTransparent then + begin + if NativeStyle then + begin + ATheme := OpenTheme(totProgress); + if FOrientation = cxorHorizontal then + ABarThemeType := PP_BAR + else + ABarThemeType := PP_BARVERT; + DrawThemeBackground(ATheme, ACanvas.Handle, ABarThemeType, 1, + ABounds); + end; + end; + if (FBarStyle in [cxbsAnimation, cxbsAnimationLEDs]) then + begin + if NativeStyle then + ACanvas.SetClipRegion(TcxRegion.CreateRoundCorners(ABounds, 2, 2), roIntersect); + if not PropTransparent then + DrawAnimationBarBackground(ACanvas, ABounds, BackgroundColor, False); + end; +end; + +function TcxCustomProgressBarViewInfo.GetDrawDelta: Integer; +begin + if NativeStyle or IsInplace or (Painter <> nil) then + Result := 0 + else + Result := 2; +end; + +function TcxCustomProgressBarViewInfo.GetDrawText: string; +begin + Result := ''; + case FShowTextStyle of + cxtsPercent: + Result := IntToStr(GetPercentDone) + ' %'; + cxtsPosition: + Result := FloatToStr(FPosition); + cxtsText: + Result := Text; + end; + if FMarquee then + Result := Text; +end; + +procedure TcxCustomProgressBarViewInfo.DrawBarCaption(ACanvas: TcxCanvas); +var + ABarText: string; + ATextBmp, ATextSavedBmp: TcxBitmap; + ATextRect: TRect; + ABarRect: TRect; +begin + if not FShowText then Exit; + ABarRect := BarRect; + if IsInplace then + InflateRectEx(ABarRect, -BarRect.Left, -BarRect.Top, -BarRect.Left, -BarRect.Top); + ABarText := GetDrawText; + ACanvas.Font.Assign(Font); + if (Painter = nil) or ((Painter <> nil) and (Painter.ProgressBarTextColor = clDefault)) then + ACanvas.Font.Color := TextColor + else + ACanvas.Font.Color := Painter.ProgressBarTextColor; + ACanvas.Brush.Style := bsClear; + if FTextOrientation = cxorVertical then + ACanvas.SetFontAngle(270); + ATextRect := Rect(0, 0, ACanvas.TextWidth(ABarText), ACanvas.TextHeight(ABarText)); + if FTextOrientation = cxorVertical then + ATextRect := Rect(ATextRect.Top, ATextRect.Left, ATextRect.Bottom, ATextRect.Right); + OffsetRect(ATextRect, GetDrawDelta, GetDrawDelta); + OffsetRect(ATextRect, + (RectWidth(ABarRect) - RectWidth(ATextRect)) div 2, + (RectHeight(ABarRect) - RectHeight(ATextRect)) div 2); + if (SolidTextColor = False) and (Painter = nil) then + begin + ATextBmp := TcxBitmap.Create; + ATextSavedBmp := TcxBitmap.Create; + try + ATextBmp.Width := RectWidth(ABarRect); + ATextBmp.Height := RectHeight(ABarRect); + ATextSavedBmp.Width := ATextBmp.Width; + ATextSavedBmp.Height := ATextBmp.Height; + ATextBmp.cxCanvas.Font.Assign(ACanvas.Font); + ATextBmp.cxCanvas.Font.Color := clBlack; + ATextBmp.cxCanvas.Brush.Color := clWhite; + ATextBmp.cxCanvas.FillRect(ABarRect); + if FTextOrientation = cxorVertical then + TextOut(ATextBmp.cxCanvas.Handle, ATextRect.Right, ATextRect.Top, PChar(ABarText), Length(ABarText)) + else + TextOut(ATextBmp.cxCanvas.Handle, ATextRect.Left, ATextRect.Top, PChar(ABarText), Length(ABarText)); + BitBlt(ATextSavedBmp.cxCanvas.Handle, 0, 0, ATextBmp.Width, ATextBmp.Height, + ACanvas.Handle, 0, 0, SRCCOPY); + BitBlt(ATextBmp.cxCanvas.Handle, 0, 0, ATextBmp.Width, ATextBmp.Height, + ACanvas.Handle, 0, 0, DSTINVERT); + cxTextOut(ACanvas.Handle, PChar(ABarText), Bounds, CXTO_CENTER_HORIZONTALLY or CXTO_CENTER_VERTICALLY); + ACanvas.CopyMode := cmSrcCopy; + ACanvas.Draw(0, 0, ATextSavedBmp); + ACanvas.CopyMode := cmSrcInvert; + ACanvas.Draw(0, 0, ATextBmp); + finally + FreeAndNil(ATextBmp); + FreeAndNil(ATextSavedBmp); + end; + end + else + if FTextOrientation = cxorVertical then + TextOut(ACanvas.Handle, ATextRect.Right, ATextRect.Top, PChar(ABarText), Length(ABarText)) + else + TextOut(ACanvas.Handle, ATextRect.Left, ATextRect.Top, PChar(ABarText), Length(ABarText)); +end; + +procedure TcxCustomProgressBarViewInfo.PaintBarBevelOuter( + ACanvas: TcxCanvas; ABBORect: TRect); +begin + if FBarBevelOuter = cxbvLowered then + begin + DrawEdge(ACanvas.Handle, ABBORect, BDR_SUNKENOUTER, BF_TOPLEFT); + DrawEdge(ACanvas.Handle, ABBORect, BDR_SUNKENOUTER, BF_BOTTOMRIGHT); + end; + if FBarBevelOuter = cxbvRaised then + begin + DrawEdge(ACanvas.Handle, ABBORect, BDR_RAISEDINNER, BF_TOPLEFT); + DrawEdge(ACanvas.Handle, ABBORect, BDR_RAISEDINNER, BF_BOTTOMRIGHT); + end; +end; + +procedure TcxCustomProgressBarViewInfo.DrawBarBitmap(ACanvas: TcxCanvas; ARect: TRect); +begin + ACanvas.Brush.Bitmap := FForegroundImage; + ACanvas.FillRect(ARect); +end; + +procedure TcxCustomProgressBarViewInfo.DrawGradientBar(ACanvas: TcxCanvas; const ANormalRect, AOverloadRect: TRect); +var + ASize: TSize; +begin + with ACanvas do + begin + if NativeStyle then + begin + if FOrientation = cxorHorizontal then + with ANormalRect do + begin + ASize.cx := 1; + if RectHeight(ANormalRect) < 0 then + ASize.cy := 0 + else + ASize.cy := RectHeight(ANormalRect); + CreateNativeBitmap(ASize); + if not Assigned(FNativeBitmap) then + Exit; + StretchBlt(Handle, ANormalRect.Left, ANormalRect.Top, RectWidth(ANormalRect), + RectHeight(ANormalRect), FNativeBitmap.Canvas.Handle, 0, 0, + FNativeBitmap.Width, FNativeBitmap.Height, SRCCOPY); + end + else + with ANormalRect do + begin + ASize.cy := 1; + if RectWidth(ANormalRect) < 0 then + ASize.cx := 0 + else + ASize.cx := RectWidth(ANormalRect); + CreateNativeBitmap(ASize); + if not Assigned(FNativeBitmap) then + Exit; + StretchBlt(Handle, ANormalRect.Left, ANormalRect.Top, RectWidth(ANormalRect), + RectHeight(ANormalRect), FNativeBitmap.Canvas.Handle, 0, 0, + FNativeBitmap.Width, FNativeBitmap.Height, SRCCOPY); + end; + end + else + if FOrientation = cxorHorizontal then + FillGradientRect(Handle, Bounds, FBeginColor, FEndColor, True) + else + FillGradientRect(Handle, Bounds, FEndColor, FBeginColor, False); + + if FRealShowOverload then + begin + if FOrientation = cxorHorizontal then + FillGradientRect(Handle, Rect(AOverloadRect.Left, AOverloadRect.Top, Bounds.Right, AOverloadRect.Bottom), FOverloadBeginColor, FOverloadEndColor, True) + else + FillGradientRect(Handle, Rect(AOverloadRect.Left, AOverloadRect.Top, Bounds.Right, AOverloadRect.Bottom), FOverloadEndColor, FOverloadBeginColor, False); + end; + end; +end; + +procedure TcxCustomProgressBarViewInfo.DrawSolidBar(ACanvas: TcxCanvas; const ANormalRect, AOverloadRect: TRect); +begin + with ACanvas do + begin + cxEditFillRect(ACanvas, ANormalRect, FBeginColor); + if FRealShowOverload then + cxEditFillRect(ACanvas, AOverloadRect, FOverloadBeginColor); + end; +end; + +procedure TcxCustomProgressBarViewInfo.DrawAnimationBar(ACanvas: TcxCanvas; const ABar, ASolidRect: TRect); + + procedure LightCanvasByGradient(ACanvas: TcxCanvas; const ARect: TRect; AIsHorizontal: Boolean = True); + var + I: Integer; + ABeginColor: TColor; + AEndColor: TColor; + ACurrentPercentage: Byte; + ADeltaPercentage: Byte; + AWidth: Integer; + begin + if AIsHorizontal then + begin + AWidth := RectWidth(ARect) div 2; + for I := ARect.Top to (ARect.Top + cxAnimationBarTopPartWidth - 1) do + begin + ABeginColor := ACanvas.Canvas.Pixels[ASolidRect.Left + 1, I]; + AEndColor := Light(ABeginColor, cxAnimationBarColorLightPercentage); + FillGradientRect(ACanvas.Handle, Rect(ARect.Left - AWidth, I, + ARect.Left + AWidth - cxAnimationBarMiddlePartWidth div 2, I + 1), + ABeginColor, AEndColor, True); + FillRectByColor(ACanvas.Handle, Rect(ARect.Left + AWidth - cxAnimationBarMiddlePartWidth div 2, + I, ARect.Left + AWidth + cxAnimationBarMiddlePartWidth div 2, I +1), AEndColor); + FillGradientRect(ACanvas.Handle, Rect(ARect.Left + AWidth + cxAnimationBarMiddlePartWidth div 2, + I, ARect.Right + AWidth, I + 1), AEndColor, ABeginColor, True); + end; + ACanvas.SaveClipRegion; + try + ACanvas.SetClipRegion(TcxRegion.Create(Rect(ARect.Left, ARect.Top, + ARect.Right, ARect.Bottom)), roIntersect); + for I := ARect.Left to ARect.Right do + begin + ACurrentPercentage := cxAnimationBarColorLightPercentage; + ADeltaPercentage := 0; + if I < (AWidth + ARect.Left - cxAnimationBarMiddlePartWidth div 2) then + ADeltaPercentage := (100 - cxAnimationBarColorLightPercentage) * + (AWidth + ARect.Left - (cxAnimationBarMiddlePartWidth div 2) - I) div + (AWidth - cxAnimationBarMiddlePartWidth div 2) + else + if I > (AWidth + ARect.Left + cxAnimationBarMiddlePartWidth div 2) then + ADeltaPercentage := (100 - cxAnimationBarColorLightPercentage) * + (I - AWidth - ARect.Left - cxAnimationBarMiddlePartWidth div 2) div + (AWidth - cxAnimationBarMiddlePartWidth div 2); + Inc(ACurrentPercentage, ADeltaPercentage); + ABeginColor := ACanvas.Canvas.Pixels[I, ARect.Top + cxAnimationBarTopPartWidth]; + AEndColor := Light(ABeginColor, ACurrentPercentage); + ACanvas.FillRect(Rect(I, ARect.Top + cxAnimationBarTopPartWidth, I + 1, + ARect.Bottom), AEndColor); + end; + finally + ACanvas.RestoreClipRegion; + end; + end + else + begin + AWidth := RectHeight(ARect) div 2; + for I := ARect.Left to (ARect.Left + cxAnimationBarTopPartWidth - 1) do + begin + ABeginColor := GetPixel(ACanvas.Handle, I, ASolidRect.Bottom - 2); + AEndColor := Light(ABeginColor, cxAnimationBarColorLightPercentage); + FillGradientRect(ACanvas.Handle, Rect(I, ARect.Top - AWidth, I + 1, + ARect.Top + AWidth - cxAnimationBarMiddlePartWidth div 2), ABeginColor, AEndColor, False); + ACanvas.FillRect(Rect(I, ARect.Top + AWidth - cxAnimationBarMiddlePartWidth div 2, + I + 1, ARect.Top + AWidth + cxAnimationBarMiddlePartWidth div 2), AEndColor); + FillGradientRect(ACanvas.Handle, Rect(I, ARect.Top + AWidth + cxAnimationBarMiddlePartWidth div 2, + I + 1, ARect.Bottom + AWidth), AEndColor, ABeginColor, False); + end; + ACanvas.SaveClipRegion; + try + ACanvas.SetClipRegion(TcxRegion.Create(Rect(ARect.Left, ARect.Top, ARect.Right, ARect.Bottom)), roIntersect); + for I := ARect.Top to ARect.Bottom do + begin + ACurrentPercentage := cxAnimationBarColorLightPercentage; + ADeltaPercentage := 0; + if I < (AWidth + ARect.Top - cxAnimationBarMiddlePartWidth div 2) then + ADeltaPercentage := (100 - cxAnimationBarColorLightPercentage) * + (AWidth + ARect.Top - (cxAnimationBarMiddlePartWidth div 2) - I) div + (AWidth - cxAnimationBarMiddlePartWidth div 2) + else + if I > (AWidth + ARect.Top + cxAnimationBarMiddlePartWidth div 2) then + ADeltaPercentage := (100 - cxAnimationBarColorLightPercentage) * + (I - AWidth - ARect.Top - cxAnimationBarMiddlePartWidth div 2) div + (AWidth - cxAnimationBarMiddlePartWidth div 2); + Inc(ACurrentPercentage, ADeltaPercentage); + ABeginColor := ACanvas.Canvas.Pixels[ARect.Left + cxAnimationBarTopPartWidth, I]; + if (ABeginColor < 0) or (ABeginColor >= (1 shl 24)) then + Continue; + AEndColor := Light(ABeginColor, ACurrentPercentage); + ACanvas.FillRect(Rect(ARect.Left + cxAnimationBarTopPartWidth, I, ARect.Right, I + 1), AEndColor); + end; + finally + ACanvas.RestoreClipRegion; + end; + end; + end; + +begin + if not CanAnimationBarShow then + begin + StopAnimationTimer; + Exit; + end; + if not Assigned(FAnimationTimer) then + begin + if FAnimationSpeed > 0 then + StartAnimationTimer; + Exit; + end; + LightCanvasByGradient(ACanvas, ABar, (FOrientation = cxorHorizontal)); +end; + +procedure TcxCustomProgressBarViewInfo.DrawAnimationBarBackground(ACanvas: TcxCanvas; const ASolidRect: TRect; ASolidColor: TColor; ADrawBar: Boolean); +var + ABorderBeginColor, ABorderEndColor: TColor; + ATopBorderBeginColor, ATopBorderEndColor: TColor; + ABorderExtPathWidth, ABorderIntPathWidth, ABorderWidth: Integer; +begin + ATopBorderBeginColor := Light(ASolidColor, cxAnimationBarTopBeginColorLightPercentage); + ATopBorderEndColor := Light(ASolidColor, cxAnimationBarTopEndColorLightPercentage); + ABorderBeginColor := Dark(ASolidColor, cxAnimationBarBorderExtPartColorLightPercentage); + ABorderEndColor := Dark(ASolidColor, cxAnimationBarBorderIntPartColorLightPercentage); + + if ADrawBar then + begin + ABorderExtPathWidth := cxAnimationBarBorderExtPathWidth; + ABorderIntPathWidth := cxAnimationBarBorderIntPathWidth; +end + else + begin + ABorderExtPathWidth := 1; + ABorderIntPathWidth := cxAnimationBarBackgroundBorderWidth; + end; + ABorderWidth := ABorderExtPathWidth + ABorderIntPathWidth; + + with ACanvas do + begin + cxEditFillRect(ACanvas, ASolidRect, ASolidColor); + if FOrientation = cxorHorizontal then + begin + if ADrawBar and (RectWidth(ASolidRect) < 3 * ABorderWidth) then + begin + ABorderExtPathWidth := ABorderExtPathWidth * RectWidth(ASolidRect) div (3 * ABorderWidth); + ABorderIntPathWidth := ABorderIntPathWidth * RectWidth(ASolidRect) div (3 * ABorderWidth); + end; + ABorderWidth := ABorderIntPathWidth + ABorderExtPathWidth; + + with ASolidRect do + begin + FillGradientRect(Handle, Rect(Left, Top, Left + ABorderExtPathWidth, Bottom), + ABorderBeginColor, ABorderEndColor, True); + FillGradientRect(Handle, Rect(Right - ABorderExtPathWidth, Top, Right, Bottom), + ABorderEndColor, ABorderBeginColor, True); + + FillGradientRect(Handle, Rect(Left + ABorderExtPathWidth, Top, Left + ABorderWidth, + Bottom), ABorderEndColor, ASolidColor, True); + FillGradientRect(Handle, Rect(Right - ABorderWidth, Top, Right - ABorderExtPathWidth, Bottom), + ASolidColor, ABorderEndColor, True); + + FillGradientRect(Handle, Rect(Left, Top, Right, Top + cxAnimationBarTopPartWidth), + ATopBorderBeginColor, ATopBorderEndColor, False); + end; + end + else + begin + if RectHeight(ASolidRect) < 3 * ABorderWidth then + begin + ABorderExtPathWidth := ABorderExtPathWidth * RectHeight(ASolidRect) div (3 * ABorderWidth); + ABorderIntPathWidth := ABorderIntPathWidth * RectHeight(ASolidRect) div (3 * ABorderWidth); + end; + ABorderWidth := ABorderIntPathWidth + ABorderExtPathWidth; + + with ASolidRect do + begin + FillGradientRect(Handle, Rect(Left, Top, Right, Top + ABorderExtPathWidth), + ABorderBeginColor, ABorderEndColor, False); + FillGradientRect(Handle, Rect(Left, Bottom - ABorderExtPathWidth, ASolidRect.Right, Bottom), + ABorderEndColor, ABorderBeginColor, False); + + FillGradientRect(Handle, Rect(Left, Top + ABorderExtPathWidth, Right, + Top + ABorderWidth), ABorderEndColor, ASolidColor, False); + FillGradientRect(Handle, Rect(Left, Bottom - ABorderWidth, Right, Bottom - ABorderExtPathWidth), + ASolidColor, ABorderEndColor, False); + + FillGradientRect(Handle, Rect(Left, Top, Left + cxAnimationBarTopPartWidth, + Bottom), ATopBorderBeginColor, ATopBorderEndColor, True); + end; + end; + end; +end; + +function TcxCustomProgressBarViewInfo.CalcLEDsWidth: Integer; +begin + if FOrientation = cxorHorizontal then + begin + Result := Trunc(RectHeight(ProgressBarRect) * 2 / 3) + 2; + if (FBarStyle = cxbsBitmapLEDs) and + Assigned(FForegroundImage) and + (Result > FForegroundImage.Width) and + (FForegroundImage.Width > 0) then + Result := FForegroundImage.Width; + end + else + begin + Result := Trunc(RectWidth(ProgressBarRect) * 2 / 3) + 2; + if (FBarStyle = cxbsBitmapLEDs) and + Assigned(FForegroundImage) and + (Result > FForegroundImage.Height) and + (FForegroundImage.Height > 0) then + Result := FForegroundImage.Height; + end; +end; + +procedure TcxCustomProgressBarViewInfo.AdjustForLEDsBarBounds(var ABarRect, + AOverloadBarRect: TRect; const ALEDsWidth: Integer); +var + ALEDsDelta: Integer; +begin + if FOrientation = cxorHorizontal then + begin + if FRealShowOverload then + begin + ALEDsDelta := RectWidth(ABarRect) mod ALEDsWidth; + Dec(ABarRect.Right, ALEDsDelta); + Dec(AOverloadBarRect.Left, ALEDsDelta); + end; + end + else + begin + if FRealShowOverload then + begin + ALEDsDelta := RectHeight(ABarRect) mod ALEDsWidth; + Inc(ABarRect.Top, ALEDsDelta); + Inc(AOverloadBarRect.Bottom, ALEDsDelta); + end; + end; +end; + +procedure TcxCustomProgressBarViewInfo.DrawPeak(ACanvas: TcxCanvas; const APeakRect: TRect); +begin + if FRealShowPeak = True then + cxEditFillRect(ACanvas, APeakRect, FPeakColor); +end; + +procedure TcxCustomProgressBarViewInfo.DrawBorderLEDs(ACanvas: TcxCanvas; + const ABarRect: TRect; ALEDsWidth: Integer); +var + I, AMaxCount: Integer; +begin + if FBarBevelOuter = cxbvNone then + Exit; + if FOrientation = cxorHorizontal then + begin + AMaxCount := RectWidth(ABarRect) div ALEDsWidth; + for I := 1 to AMaxCount do + begin + PaintBarBevelOuter(ACanvas, Rect(ABarRect.Left + (I - 1) * ALEDsWidth, ABarRect.Top, + ABarRect.Left + I * ALEDsWidth - 2, ABarRect.Bottom)); + end; + if (ABarRect.Left + AMaxCount * ALEDsWidth) < ABarRect.Right then + PaintBarBevelOuter(ACanvas, Rect(ABarRect.Left + AMaxCount * ALEDsWidth, + ABarRect.Top, ABarRect.Right, ABarRect.Bottom)); + end + else + begin + AMaxCount := RectHeight(ABarRect) div ALEDsWidth; + for I := 1 to AMaxCount do + begin + PaintBarBevelOuter(ACanvas, Rect(ABarRect.Left, ABarRect.Bottom - (I - 1) * ALEDsWidth, + ABarRect.Right, ABarRect.Bottom - I * ALEDsWidth + 2)); + end; + if (ABarRect.Bottom - AMaxCount * ALEDsWidth) > ABarRect.Top then + PaintBarBevelOuter(ACanvas, Rect(ABarRect.Left, ABarRect.Bottom - AMaxCount * ALEDsWidth, + ABarRect.Right, ABarRect.Top)); + end; +end; + +procedure TcxCustomProgressBarViewInfo.DoAnimationTimer(Sender: TObject); +begin + if not CanAnimationBarShow then + StopAnimationTimer; + if not Assigned(FAnimationTimer) then Exit; + CalcAnimationCurrentPosition; + Edit.Repaint; +end; + +procedure TcxCustomProgressBarViewInfo.DoAnimationRestartDelayTimer(Sender: TObject); +begin + StopAnimationRestartDelayTimer; +end; + +procedure TcxCustomProgressBarViewInfo.StartAnimationTimer; +begin + if Assigned(FAnimationTimer) then + StopAnimationTimer; + if not CanAnimationBarShow then + Exit; + FAnimationTimer := TcxTimer.Create(nil); + with FAnimationTimer do + begin + Enabled := False; + Interval := GetAnimationTimerInterval; + OnTimer := DoAnimationTimer; + Enabled := True; + end; + SetAnimationFirstPosition; +end; + +procedure TcxCustomProgressBarViewInfo.StartAnimationRestartDelayTimer; +begin + if FAnimationRestartDelayTimer <> nil then + StopAnimationRestartDelayTimer; + if FAnimationRestartDelay = 0 then + Exit; + FAnimationRestartDelayTimer := TcxTimer.Create(nil); + with FAnimationRestartDelayTimer do + begin + Enabled := False; + Interval := AnimationRestartDelay; + OnTimer := DoAnimationRestartDelayTimer; + Enabled := True; + end; +end; + +procedure TcxCustomProgressBarViewInfo.StopAnimationTimer; +begin + FreeAndNil(FAnimationTimer); +end; + +procedure TcxCustomProgressBarViewInfo.StopAnimationRestartDelayTimer; +begin + FreeAndNil(FAnimationRestartDelayTimer); +end; + +procedure TcxCustomProgressBarViewInfo.SetAnimationPath(AValue: TcxProgressBarAnimationPath); +begin + if AValue <> FAnimationPath then + begin + FAnimationPath := AValue; + StartAnimationTimer; + end; +end; + +procedure TcxCustomProgressBarViewInfo.SetAnimationSpeed(AValue: Cardinal); +begin + if AValue <> FAnimationSpeed then + begin + FAnimationSpeed := AValue; + if Assigned(FAnimationTimer) then + begin + FAnimationTimer.Interval := GetAnimationTimerInterval; + if FAnimationSpeed = 0 then + StopAnimationTimer; + end + else + if FAnimationSpeed > 0 then + StartAnimationTimer; + end; +end; + +procedure TcxCustomProgressBarViewInfo.SetMarquee(AValue: Boolean); +begin + if AValue <> FMarquee then + begin + FMarquee := AValue; + StartAnimationTimer; + end; +end; + +procedure TcxCustomProgressBarViewInfo.SetBarStyle( + AValue: TcxProgressBarBarStyle); +begin + if AValue <> FBarStyle then + begin + FBarStyle := AValue; + StartAnimationTimer; + end; +end; + +procedure TcxCustomProgressBarViewInfo.CalcAnimationCurrentPosition; +begin + if FAnimationRestartDelayTimer <> nil then Exit; + Inc(FAnimationPosition, FAnimationDirection * GetAnimationOffset); + case FAnimationPath of + cxapCycle: + if (FAnimationPosition > (GetMaxPositionInBounds + GetAnimationBarDimension div 2)) or + (FAnimationPosition < (GetMinPositionInBounds - GetAnimationBarDimension div 2)) then + begin + SetAnimationFirstPosition; + StartAnimationRestartDelayTimer; + end; + cxapPingPong: + begin + if FAnimationDirection > 0 then + begin + if FAnimationPosition > (GetMaxPositionInBounds - GetAnimationBarDimension div 2) then + begin + FAnimationDirection := -FAnimationDirection; + Dec(FAnimationPosition); + StartAnimationRestartDelayTimer; + end; + end + else + begin + if FAnimationPosition < (GetMinPositionInBounds + GetAnimationBarDimension div 2) then + begin + FAnimationDirection := -FAnimationDirection; + Inc(FAnimationPosition); + StartAnimationRestartDelayTimer; + end; + end; + end; + end; +end; + +procedure TcxCustomProgressBarViewInfo.SetAnimationFirstPosition; +begin + case FAnimationPath of + cxapCycle: + if GetAnimationDerection > 0 then + FAnimationPosition := -GetAnimationBarDimension div 2 + else + FAnimationPosition := GetAnimationBarDimension div 2; + cxapPingPong: + FAnimationPosition := GetAnimationBarDimension div 2; + end; + if FOrientation = cxorHorizontal then + FAnimationDirection := GetAnimationDerection + else + begin + FAnimationDirection := -GetAnimationDerection; + FAnimationPosition := -FAnimationPosition; + end; + if FAnimationDirection > 0 then + Inc(FAnimationPosition, GetMinPositionInBounds) + else + Inc(FAnimationPosition, GetMaxPositionInBounds); +end; + +function TcxCustomProgressBarViewInfo.GetAnimationBarDimension: Integer; +begin + Result := 50; +end; + +function TcxCustomProgressBarViewInfo.GetAnimationDerection: Integer; +begin + Result := 1; +end; + +function TcxCustomProgressBarViewInfo.GetCorrectAnimationBarRect: TRect; +begin + Result := AnimationBarRect; + if FOrientation = cxorHorizontal then + OffsetRect(Result, FAnimationPosition, 0) + else + OffsetRect(Result, 0, FAnimationPosition); +end; + +function TcxCustomProgressBarViewInfo.GetMaxPositionInBounds: Integer; +begin + if FOrientation = cxorHorizontal then + Result := Trunc(RectWidth(Bounds) / GetMaxMinDiff * GetRelativePosition) + else + Result := RectHeight(Bounds); +end; + +function TcxCustomProgressBarViewInfo.GetMinPositionInBounds: Integer; +begin + if FOrientation = cxorHorizontal then + Result := 0 + else + Result := RectHeight(Bounds) - Trunc(RectHeight(Bounds) / GetMaxMinDiff * GetRelativePosition); +end; + +procedure TcxCustomProgressBarViewInfo.SetOrientation( + AValue: TcxProgressBarOrientation); +begin + if AValue <> FOrientation then + begin + FOrientation := AValue; + StartAnimationTimer; + end; +end; + +{ TcxCustomProgressBarViewData } + +procedure TcxCustomProgressBarViewData.CalculateViewInfoProperties(AViewInfo: TcxCustomEditViewInfo); +begin + with TcxCustomProgressBarViewInfo(AViewInfo) do + begin + AnimationPath := Properties.AnimationPath; + AnimationRestartDelay := Properties.AnimationRestartDelay; + AnimationSpeed := Properties.AnimationSpeed; + BeginColor := ColorToRGB(Properties.BeginColor); + EndColor := ColorToRGB(Properties.EndColor); + BarBevelOuter := Properties.BarBevelOuter; + Marquee := Properties.Marquee; + Min := Properties.Min; + Max := Properties.Max; + Orientation := Properties.Orientation; + ShowText := Properties.ShowText; + ShowTextStyle := Properties.ShowTextStyle; + Text := Properties.Text; + TextOrientation := Properties.TextOrientation; + SolidTextColor := Properties.SolidTextColor; + BarStyle := Properties.BarStyle; + BorderWidth := Properties.BorderWidth; + OverloadValue := Properties.OverloadValue; + OverloadBeginColor := ColorToRGB(Properties.OverloadBeginColor); + OverloadEndColor := ColorToRGB(Properties.OverloadEndColor); + ShowOverload := Properties.ShowOverload; + PeakValue := Properties.GetRealPeakValue(Position); + PeakColor := ColorToRGB(Properties.PeakColor); + PeakSize := Properties.PeakSize; + ShowPeak := Properties.ShowPeak; + if IsInplace then + PropTransparent := Transparent + else + PropTransparent := TcxCustomProgressBar(Edit).Transparent; + end; +end; + +procedure TcxCustomProgressBarViewData.Calculate(ACanvas: TcxCanvas; const ABounds: TRect; + const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); +var + FBounds : TRect; + FViewInfo : TcxCustomProgressBarViewInfo; + FRealNativeStyle: Boolean; + FBmp: TBitmap; + AProgressBarRect, ABarRect: TRect; + AOverloadBarRect, APeakBarRect: TRect; +begin + if (ABounds.Bottom = MaxInt) or (ABounds.Right = MaxInt) then Exit; + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, AIsMouseEvent); + FViewInfo := TcxCustomProgressBarViewInfo(AViewInfo); + CalculateViewInfo(FViewInfo, AIsMouseEvent); + FViewInfo.Font := Style.GetVisibleFont; + CalculateViewInfoProperties(AViewInfo); + if AreVisualStylesMustBeUsed(NativeStyle, totProgress) then + begin + FBounds := ABounds; + FRealNativeStyle := True; + ABarRect := ABounds; + if IsInplace then + InflateRectEx(FBounds, (AViewInfo.BorderWidth + 2), (AViewInfo.BorderWidth + 2), + -(AViewInfo.BorderWidth + 2), -(AViewInfo.BorderWidth + 2)) + else + if not (Properties.BarStyle in [cxbsAnimation, cxbsAnimationLEDs]) then + InflateRectEx(FBounds, (AViewInfo.BorderWidth + 3), (AViewInfo.BorderWidth + 3), + -(AViewInfo.BorderWidth + 2), -(AViewInfo.BorderWidth + 2)) + else + InflateRectEx(FBounds, (AViewInfo.BorderWidth + 1), (AViewInfo.BorderWidth + 1), + -(AViewInfo.BorderWidth + 1), -(AViewInfo.BorderWidth + 1)); + AProgressBarRect := FBounds; + end + else + begin + if IsInplace then + ABarRect := ABounds + else + ABarRect := FViewInfo.BorderRect; + FBounds := FViewInfo.BorderRect; + FRealNativeStyle := False; + InflateRect(FBounds, -AViewInfo.BorderWidth, -AViewInfo.BorderWidth); + AProgressBarRect := FBounds; + end; + FViewInfo.NativeStyle := FRealNativeStyle; + CalculateCustomProgressBarViewInfo(ACanvas, Self, FViewInfo); + + if not Properties.Marquee then + begin + if FViewInfo.FOrientation = cxorHorizontal then + AProgressBarRect.Right := FBounds.Left + + CalculateDelta(FViewInfo.Position - FViewInfo.Min, RectWidth(FBounds), + FViewInfo.MaxMinDiff) + else + AProgressBarRect.Top := FBounds.Bottom - + CalculateDelta((FViewInfo.Position - FViewInfo.Min), RectHeight(FBounds), + FViewInfo.MaxMinDiff); + end; + + FViewInfo.FRealShowOverload := False; + if not Properties.Marquee and Properties.ShowOverload and + not FRealNativeStyle and + (FViewInfo.Position >= FViewInfo.OverloadValue) then + begin + FViewInfo.FRealShowOverload := True; + AOverloadBarRect := AProgressBarRect; + if FViewInfo.FOrientation = cxorHorizontal then + begin + AOverloadBarRect.Left := FBounds.Left + + CalculateDelta(FViewInfo.RelativeOverloadValue, RectWidth(FBounds), + FViewInfo.MaxMinDiff); + AOverloadBarRect.Right := Math.Min(AOverloadBarRect.Right, FBounds.Right); + AProgressBarRect.Right := AOverloadBarRect.Left; + end else + begin + AOverloadBarRect.Top := AOverloadBarRect.Bottom - + CalculateDelta(FViewInfo.RelativePosition, RectHeight(FBounds), + FViewInfo.MaxMinDiff); + AOverloadBarRect.Bottom := AOverloadBarRect.Bottom - + CalculateDelta(FViewInfo.RelativeOverloadValue, RectHeight(FBounds), + FViewInfo.MaxMinDiff); + AOverloadBarRect.Bottom := Math.Max(AOverloadBarRect.Bottom, FBounds.Top); + AProgressBarRect.Top := AOverloadBarRect.Bottom; + end; + end; + + FViewInfo.FRealShowPeak := FViewInfo.ShowPeak and not Properties.Marquee; + if FViewInfo.FRealShowPeak then + begin + APeakBarRect := FViewInfo.ProgressBarRect; + if FViewInfo.FOrientation = cxorHorizontal then + begin + APeakBarRect.Left := FBounds.Left + + CalculateDelta(FViewInfo.RelativePeakValue, RectWidth(FBounds), + FViewInfo.MaxMinDiff); + APeakBarRect.Left := Math.Min(APeakBarRect.Left, FBounds.Right - FViewInfo.PeakSize); + APeakBarRect.Right := APeakBarRect.Left + FViewInfo.PeakSize; + end + else + begin + APeakBarRect.Bottom := FBounds.Bottom - + CalculateDelta(FViewInfo.RelativePeakValue, RectHeight(FBounds), + FViewInfo.MaxMinDiff); + APeakBarRect.Bottom := Math.Max(APeakBarRect.Bottom, FBounds.Top + FViewInfo.PeakSize); + APeakBarRect.Top := APeakBarRect.Bottom - FViewInfo.PeakSize; + end; + end; + if Properties.ChangedForegroundImage or + (FViewInfo.ForegroundImage.Width <= 0) or + (FViewInfo.ForegroundImage.Height <= 0) then + begin + FViewInfo.ForegroundImage.Assign(Properties.ForegroundImage); + Properties.ChangedForegroundImage := False; + if Properties.TransparentImage then + begin + FBmp := TBitmap.Create; + try + FViewInfo.ForegroundImage.Transparent := True; + FBmp.Width := FViewInfo.ForegroundImage.Width; + FBmp.Height := FViewInfo.ForegroundImage.Height; + FBmp.Canvas.Brush.Color := FViewInfo.BackgroundColor; + FBmp.Canvas.FillRect(FBmp.Canvas.ClipRect); + FBmp.Canvas.Draw(0, 0, FViewInfo.ForegroundImage); + FViewInfo.ForegroundImage.Assign(FBmp); + finally + FBmp.Free; + end; + end; + end; + + with FViewInfo do + if Properties.Orientation = cxorHorizontal then + begin + AnimationBarRect.Left := AProgressBarRect.Left; + AnimationBarRect.Top := AProgressBarRect.Top; + AnimationBarRect.Right := AProgressBarRect.Left + GetAnimationBarDimension; + AnimationBarRect.Bottom := AProgressBarRect.Bottom; + OffsetRect(AnimationBarRect, -GetAnimationBarDimension div 2, 0); + end + else + begin + AnimationBarRect.Left := AProgressBarRect.Left; + AnimationBarRect.Top := Bounds.Top; + AnimationBarRect.Right := AProgressBarRect.Right; + AnimationBarRect.Bottom := AnimationBarRect.Top + GetAnimationBarDimension; + OffsetRect(AnimationBarRect, 0, -GetAnimationBarDimension div 2); + end; + if not IsInplace then FViewInfo.DrawSelectionBar := False; + + if Properties.ChangedPosition and not AIsMouseEvent and + cxRectCompare(AProgressBarRect, FViewInfo.ProgressBarRect) and + cxRectCompare(ABarRect, FViewInfo.BarRect) and + (not FViewInfo.FRealShowOverload or cxRectCompare(AOverloadBarRect, FViewInfo.OverloadBarRect)) and + (not FViewInfo.FRealShowPeak or cxRectCompare(APeakBarRect, FViewInfo.PeakBarRect)) then + begin + FViewInfo.ChangedBounds := False; + end + else + begin + FViewInfo.ProgressBarRect := AProgressBarRect; + if not cxRectCompare(FViewInfo.BarRect, ABarRect) then + begin + FViewInfo.BarRect := ABarRect; + FViewInfo.ChangedBoundsBarRect := True; + end; + FViewInfo.OverloadBarRect := AOverloadBarRect; + FViewInfo.PeakBarRect := APeakBarRect; + FViewInfo.ChangedBounds := True; + end; + Properties.ChangedPosition := False; +end; + +procedure TcxCustomProgressBarViewData.CalculateButtonsViewInfo(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); +begin +end; + +procedure TcxCustomProgressBarViewData.EditValueToDrawValue(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; AViewInfo: TcxCustomEditViewInfo); +var + ADisplayValue: TcxEditValue; +begin + CalculateCustomProgressBarViewInfo(ACanvas, Self, + TcxCustomProgressBarViewInfo(AViewInfo)); + if PreviewMode then + Properties.PrepareDisplayValue(30, ADisplayValue, InternalFocused) + else + Properties.PrepareDisplayValue(AEditValue, ADisplayValue, InternalFocused); + TcxCustomProgressBarViewInfo(AViewInfo).Position := ADisplayValue; + Properties.CorrectPositionWithMaxMin(TcxCustomProgressBarViewInfo(AViewInfo)); +end; + +function TcxCustomProgressBarViewData.InternalGetEditConstantPartSize(ACanvas: TcxCanvas; + AIsInplace: Boolean; AEditSizeProperties: TcxEditSizeProperties; + var MinContentSize: TSize; AViewInfo: TcxCustomEditViewInfo): TSize; +var + APrevLogFont: TLogFont; + ASize1, ASize2: TSize; + AText: string; +begin + SaveCanvasFont(ACanvas, APrevLogFont); + try + Result := inherited InternalGetEditConstantPartSize(ACanvas, AIsInplace, + AEditSizeProperties, MinContentSize, AViewInfo); + + with TcxCustomProgressBarViewInfo(AViewInfo) do + begin + ASize1.cx := RectWidth(ProgressBarRect); + + if not(IsInplace or + AreVisualStylesMustBeUsed(AViewInfo.NativeStyle, totButton)) then + ASize1.cx := ASize1.cx + 4; + + AText := ''; + ASize2 := GetTextEditContentSize(ACanvas, Self, AText, + DrawTextFlagsTocxTextOutFlags(cxTextOutFlagsToDrawTextFlags(GetDrawTextFlags) and + not(CXTO_CENTER_VERTICALLY or CXTO_BOTTOM) or CXTO_TOP), AEditSizeProperties, 0, False); + ASize2.cx := ASize2.cx + 3; + ASize1.cx := ASize1.cx + ASize2.cx; + ASize1.cy := ASize2.cy; + end; + Result.cx := Result.cx + ASize1.cx; + Result.cy := Result.cy + ASize1.cy; + finally + RestoreCanvasFont(ACanvas, APrevLogFont); + end; +end; + +function TcxCustomProgressBarViewData.GetDrawTextFlags: Integer; +begin + Result := 0; +end; + +function TcxCustomProgressBarViewData.GetIsEditClass: Boolean; +begin + Result := False; +end; + +function TcxCustomProgressBarViewData.GetProperties: TcxCustomProgressBarProperties; +begin + Result := TcxCustomProgressBarProperties(FProperties); +end; + +{ TProgressBarPropertiesValues } + +function TcxProgressBarPropertiesValues.GetMax: Boolean; +begin + Result := MaxValue; +end; + +function TcxProgressBarPropertiesValues.GetMin: Boolean; +begin + Result := MinValue; +end; + +function TcxProgressBarPropertiesValues.IsMaxStored: Boolean; +begin + Result := Max and (TcxCustomProgressBarProperties(Properties).Max = 0); +end; + +function TcxProgressBarPropertiesValues.IsMinStored: Boolean; +begin + Result := Min and (TcxCustomProgressBarProperties(Properties).Min = 0); +end; + +procedure TcxProgressBarPropertiesValues.SetMax(Value: Boolean); +begin + MaxValue := Value; +end; + +procedure TcxProgressBarPropertiesValues.SetMin(Value: Boolean); +begin + MinValue := Value; +end; + +{ TcxCustomProgressBarProperties } + +constructor TcxCustomProgressBarProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); +// FCurrentPosition := 0; + FAnimationPath := cxapCycle; + FAnimationRestartDelay := cxProgressBarDefaultAnimationRestartDelay; + FChangedForegroundImage := False; + FChangedPosition := False; + FBeginColor := clNavy; + FEndColor := clWhite; + FBarBevelOuter := cxbvNone; + FPeakValue := 0; + FOverloadValue := 80; + FPeakSize := 2; + FOrientation := cxorHorizontal; + FShowText := True; + FShowTextStyle := cxDefaultShowTextStyle; + FTextOrientation := cxorHorizontal; + FSolidTextColor := False; + FBarStyle := cxbsSolid; + FTransparentImage := True; + FMarquee := False; + FOverloadValue := 80; + FBorderWidth := 0; + FShowOverload := False; + FOverloadBeginColor := $008080FF; + FOverloadEndColor := clFuchsia; + FShowPeak := False; + FPeakColor := clRed; + FAnimationSpeed := cxProgressBarDefaultAnimationSpeed; + FText := ''; +end; + +destructor TcxCustomProgressBarProperties.Destroy; +begin + if FForegroundImage <> nil then + FreeAndNil(FForegroundImage); + inherited Destroy; +end; + +procedure TcxCustomProgressBarProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomProgressBarProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with Source as TcxCustomProgressBarProperties do + begin + Self.AnimationPath := AnimationPath; + Self.AnimationRestartDelay := AnimationRestartDelay; + Self.BeginColor := BeginColor; + Self.BarBevelOuter := BarBevelOuter; + Self.EndColor := EndColor; + Self.ForegroundImage := ForegroundImage; + Self.Marquee := Marquee; + Self.Min := Min; + Self.Max := Max; + Self.Orientation := Orientation; + Self.ShowText := ShowText; + Self.ShowTextStyle := ShowTextStyle; + Self.TextOrientation := TextOrientation; + Self.SolidTextColor := SolidTextColor; + Self.BarStyle := BarStyle; + Self.TransparentImage := TransparentImage; + Self.BorderWidth := BorderWidth; + Self.OverloadValue := OverloadValue; + Self.ShowOverload := ShowOverload; + Self.OverloadBeginColor := OverloadBeginColor; + Self.OverloadEndColor := OverloadEndColor; + Self.PeakValue := PeakValue; + Self.ShowPeak := ShowPeak; + Self.PeakColor := PeakColor; + Self.PeakSize := PeakSize; + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +function TcxCustomProgressBarProperties.CanCompareEditValue: Boolean; +begin + Result := True; +end; + +class function TcxCustomProgressBarProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxProgressBar; +end; + +function TcxCustomProgressBarProperties.GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; +var + ADisplayValue: TcxEditValue; +begin + PrepareDisplayValue(AEditValue, ADisplayValue, False); + if FShowTextStyle = cxtsPercent then + ADisplayValue := VarToStr(ADisplayValue) + ' %'; + Result := VarToStr(ADisplayValue); +end; + +function TcxCustomProgressBarProperties.GetSupportedOperations: TcxEditSupportedOperations; +begin + Result := [esoAlwaysHotTrack, esoFiltering, esoSorting]; +end; + +class function TcxCustomProgressBarProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxCustomProgressBarViewInfo; +end; + +function TcxCustomProgressBarProperties.IsEditValueValid(var EditValue: TcxEditValue; + AEditFocused: Boolean): Boolean; +begin + Result := inherited IsEditValueValid(EditValue, AEditFocused); +end; + +procedure TcxCustomProgressBarProperties.PrepareDisplayValue(const AEditValue: + TcxEditValue; var DisplayValue: TcxEditValue; AEditFocused: Boolean); +var + AValue: Double; + ACode: Integer; +begin + DisplayValue := 0; + if VarIsStr(AEditValue) then + begin + Val(VarToStr(AEditValue), AValue, ACode); + if ACode = 0 then + DisplayValue := AValue; + end + else + if VarIsNumericEx(AEditValue) or VarIsDate(AEditValue) then + DisplayValue := AEditValue; +// PrepareCurrentPosition(DisplayValue); +end; + +procedure TcxCustomProgressBarProperties.CorrectPositionWithMaxMin( + AViewInfo: TcxCustomProgressBarViewInfo); +begin + if Min < Max then + AViewInfo.Position := Math.Min(Math.Max(AViewInfo.Position, Min), Max); +end; + +class function TcxCustomProgressBarProperties.GetAssignedValuesClass: TcxCustomEditPropertiesValuesClass; +begin + Result := TcxProgressBarPropertiesValues; +end; + +function TcxCustomProgressBarProperties.GetMaxValue: Double; +begin + if AssignedValues.Max then + Result := inherited GetMaxValue + else + Result := 100; +end; + +function TcxCustomProgressBarProperties.GetMinValue: Double; +begin + if AssignedValues.Min then + Result := inherited GetMinValue + else + Result := 0; +end; + +class function TcxCustomProgressBarProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxCustomProgressBarViewData; +end; + +function TcxCustomProgressBarProperties.HasDisplayValue: Boolean; +begin + Result := True; +end; + +function TcxCustomProgressBarProperties.GetAssignedValues: TcxProgressBarPropertiesValues; +begin + Result := TcxProgressBarPropertiesValues(FAssignedValues); +end; + +function TcxCustomProgressBarProperties.GetForegroundImage: TBitmap; +begin + if FForegroundImage = nil then + begin + FForegroundImage := TBitmap.Create; + FForegroundImage.OnChange := ForegroundImageChanged; + end; + Result := FForegroundImage; +end; + +procedure TcxCustomProgressBarProperties.ForegroundImageChanged(Sender: TObject); +begin + Changed; +end; + +function TcxCustomProgressBarProperties.GetMax: Double; +begin + Result := MaxValue; +end; + +function TcxCustomProgressBarProperties.GetMin: Double; +begin + Result := MinValue; +end; + +function TcxCustomProgressBarProperties.GetOverloadValueStored: Boolean; +begin + Result := FOverloadValue <> 80; +end; + +function TcxCustomProgressBarProperties.GetPeakValueStored: Boolean; +begin + Result := FPeakValue <> 0; +end; + +procedure TcxCustomProgressBarProperties.SetAnimationPath(AValue: TcxProgressBarAnimationPath); +begin + if AValue <> FAnimationPath then + begin + FAnimationPath := AValue; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetAnimationRestartDelay(AValue: Cardinal); +begin + if AValue <> FAnimationRestartDelay then + begin + FAnimationRestartDelay := AValue; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetAnimationSpeed(AValue: TcxProgressBarAnimationSpeed); +begin + if AValue < Low(AValue) then + AValue := Low(AValue); + if AValue > High(AValue) then + AValue := High(AValue); + if AValue <> FAnimationSpeed then + begin + FAnimationSpeed := AValue; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetAssignedValues( + Value: TcxProgressBarPropertiesValues); +begin + FAssignedValues.Assign(Value); +end; + +procedure TcxCustomProgressBarProperties.SetBeginColor(Value: TColor); +begin + if FBeginColor <> Value then + begin + FBeginColor := Value; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetBarBevelOuter(Value: TcxProgressBarBevelOuter); +begin + if FBarBevelOuter <> Value then + begin + FBarBevelOuter := Value; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetColorVista; +begin + FBeginColor := $D328; +end; + +procedure TcxCustomProgressBarProperties.SetEndColor(Value: TColor); +begin + if Value <> FEndColor then + begin + FEndColor := Value; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetForegroundImage(Value: TBitmap); +begin + if Value = nil then + FreeAndNil(FForegroundImage) + else + ForegroundImage.Assign(Value); + ChangedForegroundImage := True; + Changed; +end; + +procedure TcxCustomProgressBarProperties.SetMarquee(Value: Boolean); +begin + if Value <> FMarquee then + begin + FMarquee := Value; + if FMarquee then + ShowTextStyle := cxtsText; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetMax(Value: Double); +begin + MaxValue := Value; + PostMaxValue; +end; + +procedure TcxCustomProgressBarProperties.SetMin(Value: Double); +begin + MinValue := Value; + PostMinValue; +end; + +procedure TcxCustomProgressBarProperties.SetOverloadValue(Value: Double); +begin + if FOverloadValue <> Value then + begin + FOverloadValue := Value; + PostOverloadValue; + Changed; + end; +end; + +function TcxCustomProgressBarProperties.GetRealPeakValue(APosition: Double): Double; +begin + Result := Math.Max(Math.Min(Math.Max(FPeakValue, Min), Max), APosition); + FPeakValue := Math.Max(FPeakValue, Result); +end; + +function TcxCustomProgressBarProperties.IsMaxStored: Boolean; +begin + Result := IsMaxValueStored; +end; + +function TcxCustomProgressBarProperties.IsMinStored: Boolean; +begin + Result := IsMinValueStored; +end; + +function TcxCustomProgressBarProperties.IsShowTextStyleStored: Boolean; +begin + Result := not Marquee and (FShowTextStyle <> cxDefaultShowTextStyle); +end; + +procedure TcxCustomProgressBarProperties.SetPeakValue(Value: Double); +begin + if FPeakValue <> Value then + begin + FPeakValue := Value; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.PostMinValue; +begin + if Min > Max then Max := Min; +// if FCurrentPosition < FMin then FCurrentPosition := FMin; + if FOverloadValue < Min then FOverloadValue := Min; + if FPeakValue < Min then FPeakValue := Min; +end; + +procedure TcxCustomProgressBarProperties.PostMaxValue; +begin + if Min > Max then Min := Max; +// if FCurrentPosition > FMax then FCurrentPosition := FMax; + if FOverloadValue > Max then FOverloadValue := Max; + if FPeakValue > Max then FPeakValue := Max; +end; + +procedure TcxCustomProgressBarProperties.PostOverloadValue; +begin + if FOverloadValue < Min then + FOverloadValue := Min; + if FOverloadValue > Max then + FOverloadValue := Max; +end; + +procedure TcxCustomProgressBarProperties.SetOrientation(Value: TcxProgressBarOrientation); +begin + if FOrientation <> Value then + begin + FOrientation := Value; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetShowText(Value: Boolean); +begin + if FShowText <> Value then + begin + FShowText := Value; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetShowTextStyle(Value: TcxProgressBarTextStyle); +begin + if (FShowTextStyle <> Value) and (not Marquee or (Marquee and (Value = cxtsText))) then + begin + FShowTextStyle := Value; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetTextOrientation(Value: TcxProgressBarOrientation); +begin + if FTextOrientation <> Value then + begin + FTextOrientation := Value; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetSolidTextColor(Value: Boolean); +begin + if FSolidTextColor <> Value then + begin + FSolidTextColor := Value; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetBarStyle(Value: TcxProgressBarBarStyle); +begin + if FBarStyle <> Value then + begin + FBarStyle := Value; + if FBarStyle in [cxbsAnimation, cxbsAnimationLEDs] then + SetColorVista; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetText(const AValue: string); +begin + if FText <> AValue then + begin + FText := AValue; + if Length(FText) > 0 then + ShowTextStyle := cxtsText; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetTransparentImage(Value: Boolean); +begin + if FTransparentImage <> Value then + begin + FTransparentImage := Value; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetBorderWidth(Value: TcxBorderWidth); +begin + if FBorderWidth <> Value then + begin + FBorderWidth := Value; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetShowOverload(Value: Boolean); +begin + if FShowOverload <> Value then + begin + FShowOverload := Value; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetOverloadBeginColor(Value: TColor); +begin + if FOverloadBeginColor <> Value then + begin + FOverloadBeginColor := Value; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetOverloadEndColor(Value: TColor); +begin + if FOverloadEndColor <> Value then + begin + FOverloadEndColor := Value; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetShowPeak(Value: Boolean); +begin + if FShowPeak <> Value then + begin + FShowPeak := Value; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetPeakColor(Value: TColor); +begin + if FPeakColor <> Value then + begin + FPeakColor := Value; + Changed; + end; +end; + +procedure TcxCustomProgressBarProperties.SetPeakSize(Value: TcxNaturalNumber); +begin + if FPeakSize <> Value then + begin + FPeakSize := Value; + Changed; + end; +end; + +{ TcxCustomProgressBar } + +class function TcxCustomProgressBar.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomProgressBarProperties; +end; + +procedure TcxCustomProgressBar.CheckEditorValueBounds; +var + AValue: Variant; +begin + KeyboardAction := True; + try + with ActiveProperties do + if Min < Max then + begin + PrepareDisplayValue(FEditValue, AValue, Focused); + if AValue < Min then + InternalSetEditValue(Min, False) + else + if AValue > Max then + InternalSetEditValue(Max, False); + end; + finally + KeyboardAction := False; + end; +end; + +procedure TcxCustomProgressBar.CheckEditValue; +begin + if not(IsInplace or IsDBEdit or PropertiesChangeLocked) then + CheckEditorValueBounds; +end; + +function TcxCustomProgressBar.DefaultParentColor: Boolean; +begin + Result := True; +end; + +procedure TcxCustomProgressBar.FillSizeProperties(var AEditSizeProperties: TcxEditSizeProperties); +begin + AEditSizeProperties := DefaultcxEditSizeProperties; + AEditSizeProperties.MaxLineCount := 1; + AEditSizeProperties.Width := ViewInfo.TextRect.Right - ViewInfo.TextRect.Left; +end; + +procedure TcxCustomProgressBar.Initialize; +begin + inherited Initialize; + ControlStyle := ControlStyle - [csDoubleClicks, csCaptureMouse, csClickEvents]; + Width := 121; + Height := 21; +end; + +function TcxCustomProgressBar.InternalGetNotPublishedStyleValues: TcxEditStyleValues; +begin + Result := inherited InternalGetNotPublishedStyleValues; + Include(Result, svHotTrack); +end; + +procedure TcxCustomProgressBar.SynchronizeDisplayValue; +var + ADisplayValue: TcxEditValue; +begin + ActiveProperties.PrepareDisplayValue(FEditValue, ADisplayValue, Focused); + TcxCustomProgressBarViewInfo(ViewInfo).Position := ADisplayValue; + if ActiveProperties.Transparent then + Invalidate; +// if not (IsInplace and (ActiveProperties.ShowTextStyle = cxtsPosition)) then + ActiveProperties.CorrectPositionWithMaxMin(ViewInfo); + ShortRefreshContainer(False); + //Invalidate; +end; + +procedure TcxCustomProgressBar.PropertiesChanged(Sender: TObject); +begin + CheckEditValue; +// if not (IsInplace and (ActiveProperties.ShowTextStyle = cxtsPosition)) then + ActiveProperties.CorrectPositionWithMaxMin(ViewInfo); + inherited PropertiesChanged(Sender); + if ActiveProperties.Transparent then + Invalidate; +end; + +function TcxCustomProgressBar.CanFocus: Boolean; +begin + Result := IsInplace; +end; + +function TcxCustomProgressBar.CanFocusOnClick: Boolean; +begin + Result := inherited CanFocusOnClick and IsInplace; +end; + +function TcxCustomProgressBar.GetPercentDone: Integer; +begin + Result := ViewInfo.GetPercentDone; +end; + +function TcxCustomProgressBar.GetPosition: Double; +begin + Result := ViewInfo.Position; +end; + +function TcxCustomProgressBar.GetPositionStored: Boolean; +begin + Result := ViewInfo.Position <> 0; +end; + +function TcxCustomProgressBar.GetProperties: TcxCustomProgressBarProperties; +begin + Result := TcxCustomProgressBarProperties(FProperties); +end; + +function TcxCustomProgressBar.GetActiveProperties: TcxCustomProgressBarProperties; +begin + Result := TcxCustomProgressBarProperties(InternalGetActiveProperties); +end; + +function TcxCustomProgressBar.GetViewInfo: TcxCustomProgressBarViewInfo; +begin + Result := TcxCustomProgressBarViewInfo(FViewInfo); +end; + +procedure TcxCustomProgressBar.SetProperties( + Value: TcxCustomProgressBarProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomProgressBar.SetPosition(Value: Double); +begin + if Value = ViewInfo.Position then + Exit; + ActiveProperties.ChangedPosition := True; + with ActiveProperties do + if (not IsLoading) and (Min < Max) then + Value := Math.Min(Math.Max(Value, Min), Max); + EditValue := Value; +end; + +{ TcxProgressBar } + +class function TcxProgressBar.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxProgressBarProperties; +end; + +function TcxProgressBar.GetActiveProperties: TcxProgressBarProperties; +begin + Result := TcxProgressBarProperties(InternalGetActiveProperties); +end; + +function TcxProgressBar.GetProperties: TcxProgressBarProperties; +begin + Result := TcxProgressBarProperties(FProperties); +end; + +procedure TcxProgressBar.SetProperties(Value: TcxProgressBarProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxFilterProgressBarHelper } + +class procedure TcxFilterProgressBarHelper.InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); +begin + inherited InitializeProperties(AProperties, AEditProperties, AHasButtons); + with TcxCustomSpinEditProperties(AProperties) do + begin + Buttons.Add; + Buttons.Add; + MinValue := TcxCustomProgressBarProperties(AEditProperties).Min; + MaxValue := TcxCustomProgressBarProperties(AEditProperties).Max; + end; +end; + +initialization + GetRegisteredEditProperties.Register(TcxProgressBarProperties, scxSEditRepositoryProgressBarItem); + FilterEditsController.Register(TcxProgressBarProperties, TcxFilterProgressBarHelper); + +finalization + FilterEditsController.Unregister(TcxProgressBarProperties, TcxFilterProgressBarHelper); + GetRegisteredEditProperties.Unregister(TcxProgressBarProperties); + +end. + diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxPropertiesConverters.pas b/official/x.35/ExpressEditors Library 5/Sources/cxPropertiesConverters.pas new file mode 100644 index 00000000..5fab3211 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxPropertiesConverters.pas @@ -0,0 +1,922 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxPropertiesConverters; + +{$I cxVer.inc} + +interface + +uses + cxCustomConverter, cxBlobEdit, StdCtrls, cxConverterUtils, cxImage, cxButtonEdit, + cxEdit, Classes, Graphics, cxCalc, cxCheckBox, cxDropDownEdit, cxCurrencyEdit, + cxCalendar, cxDBLookupComboBox, cxHyperLinkEdit, cxImageComboBox, Controls, SysUtils, + cxMaskEdit, cxMemo, cxMRUEdit, cxSpinEdit, cxTextEdit, cxTimeEdit; + +type + { TcxCustomPropertiesConverter } + TcxCustomPropertiesConverter = class(TcxCustomConverter) + protected + function ConvertPictureTransparency(const AValue: string): TcxImageTransparency; + function ConvertVertAlignment(const AVertAlignment: string): TcxEditVertAlignment; + end; + + { TcxBlobEditPropertiesConverter } + TcxBlobEditPropertiesConverter = class(TcxCustomPropertiesConverter) + private + function ConvertBlobEditKind(const AKind: string): TcxBlobEditKind; + function ConvertBlobPaintStyle(const AStyle: string): TcxBlobPaintStyle; + function GetDestination: TcxBlobEditProperties; + protected + procedure DoImport; override; + public + property Destination: TcxBlobEditProperties read GetDestination; + end; + + { TcxButtonEditPropertiesConverter } + TcxButtonEditPropertiesConverter = class(TcxCustomPropertiesConverter) + private + function ConvertButtonKind(const AButtonKind: string): TcxEditButtonKind; + function GetDestination: TcxButtonEditProperties; + protected + procedure DoImport; override; + public + property Destination: TcxButtonEditProperties read GetDestination; + end; + + { TcxCalcEditPropertiesConverter } + TcxCalcEditPropertiesConverter = class(TcxCustomPropertiesConverter) + private + function GetDestination: TcxCalcEditProperties; + protected + procedure DoImport; override; + public + property Destination: TcxCalcEditProperties read GetDestination; + end; + + { TcxCheckBoxPropertiesConverter } + TcxCheckBoxPropertiesConverter = class(TcxCustomPropertiesConverter) + private + function ConvertNullFieldStyle(const AValue: string): TcxCheckBoxNullValueShowingStyle; + function GetDestination: TcxCheckBoxProperties; + protected + procedure DoImport; override; + public + property Destination: TcxCheckBoxProperties read GetDestination; + end; + + { TcxComboBoxPropertiesConverter } + TcxComboBoxPropertiesConverter = class(TcxCustomPropertiesConverter) + private + function GetDestination: TcxComboBoxProperties; + protected + procedure DoImport; override; + public + property Destination: TcxComboBoxProperties read GetDestination; + end; + + { TcxCurrencyEditPropertiesConverter } + TcxCurrencyEditPropertiesConverter = class(TcxCustomPropertiesConverter) + private + function GetDestination: TcxCurrencyEditProperties; + protected + procedure DoImport; override; + public + property Destination: TcxCurrencyEditProperties read GetDestination; + end; + + { TcxDateEditPropertiesConverter } + TcxDateEditPropertiesConverter = class(TcxCustomPropertiesConverter) + private + function GetDestination: TcxDateEditProperties; + protected + procedure DoImport; override; + public + property Destination: TcxDateEditProperties read GetDestination; + end; + + { TcxHyperLinkEditPropertiesConverter } + TcxHyperLinkEditPropertiesConverter = class(TcxCustomPropertiesConverter) + private + function GetDestination: TcxHyperLinkEditProperties; + protected + procedure DoImport; override; + public + property Destination: TcxHyperLinkEditProperties read GetDestination; + end; + + { TcxImagePropertiesConverter } + TcxImagePropertiesConverter = class(TcxCustomPropertiesConverter) + private + function GetDestination: TcxImageProperties; + protected + procedure DoImport; override; + public + property Destination: TcxImageProperties read GetDestination; + end; + + { TcxImageComboBoxPropertiesConverter } + TcxImageComboBoxPropertiesConverter = class(TcxCustomPropertiesConverter) + private + function GetDestination: TcxImageComboBoxProperties; + protected + procedure DoImport; override; + public + property Destination: TcxImageComboBoxProperties read GetDestination; + end; + + { TcxLookupComboBoxPropertiesConverter } + TcxLookupComboBoxPropertiesConverter = class(TcxCustomPropertiesConverter) + private + function GetDestination: TcxLookupComboBoxProperties; + protected + procedure DoImport; override; + public + property Destination: TcxLookupComboBoxProperties read GetDestination; + end; + + { TcxMaskEditPropertiesConverter } + TcxMaskEditPropertiesConverter = class(TcxCustomPropertiesConverter) + private + function GetDestination: TcxMaskEditProperties; + protected + procedure DoImport; override; + public + property Destination: TcxMaskEditProperties read GetDestination; + end; + + { TcxMemoPropertiesConverter } + TcxMemoPropertiesConverter = class(TcxCustomPropertiesConverter) + private + function GetDestination: TcxMemoProperties; + protected + procedure DoImport; override; + public + property Destination: TcxMemoProperties read GetDestination; + end; + + { TcxMRUEditPropertiesConverter } + TcxMRUEditPropertiesConverter = class(TcxCustomPropertiesConverter) + private + function GetDestination: TcxMRUEditProperties; + protected + procedure DoImport; override; + public + property Destination: TcxMRUEditProperties read GetDestination; + end; + + { TcxPopupEditPropertiesConverter } + TcxPopupEditPropertiesConverter = class(TcxCustomPropertiesConverter) + private + function GetDestination: TcxPopupEditProperties; + protected + procedure DoImport; override; + public + property Destination: TcxPopupEditProperties read GetDestination; + end; + + { TcxSpinEditPropertiesConverter } + TcxSpinEditPropertiesConverter = class(TcxCustomPropertiesConverter) + private + function GetDestination: TcxSpinEditProperties; + protected + procedure DoImport; override; + public + property Destination: TcxSpinEditProperties read GetDestination; + end; + + { TcxTextEditPropertiesConverter } + TcxTextEditPropertiesConverter = class(TcxCustomPropertiesConverter) + private + function GetDestination: TcxTextEditProperties; + protected + procedure DoImport; override; + public + property Destination: TcxTextEditProperties read GetDestination; + end; + + { TcxTimeEditPropertiesConverter } + TcxTimeEditPropertiesConverter = class(TcxCustomPropertiesConverter) + private + function ConvertTimeFormat(const AFormat: string): TcxTimeEditTimeFormat; + function GetDestination: TcxTimeEditProperties; + protected + procedure DoImport; override; + public + property Destination: TcxTimeEditProperties read GetDestination; + end; + +implementation + +uses + ImgList; + +type + TcxButtonEditPropertiesAccess = class(TcxButtonEditProperties); + +{ TcxCustomPropertiesConverter } + +function TcxCustomPropertiesConverter.ConvertPictureTransparency( + const AValue: string): TcxImageTransparency; +begin + if AValue = 'gtDefault' then + Result := gtDefault + else if AValue = 'gtOpaque' then + Result := gtOpaque + else if AValue = 'gtTransparent' then + Result := gtTransparent + else + Result := gtDefault; +end; + +function TcxCustomPropertiesConverter.ConvertVertAlignment(const AVertAlignment: string): TcxEditVertAlignment; +begin + if AVertAlignment = 'tlCenter' then + Result := taVCenter + else if AVertAlignment = 'tlTop' then + Result := taTopJustify + else if AVertAlignment = 'tlBottom' then + Result := taBottomJustify + else + Result := taVCenter; +end; + +{ TcxBlobEditPropertiesConverter } + +procedure TcxBlobEditPropertiesConverter.DoImport; +begin + with Destination do + begin + AlwaysSaveData := GetBooleanProperty(Source, 'AlwaysSaveText', AlwaysSaveData); + BlobEditKind := ConvertBlobEditKind(GetEnumProperty(Source, 'BlobKind')); + BlobPaintStyle := ConvertBlobPaintStyle(GetEnumProperty(Source, 'BlobPaintStyle')); + MemoCharCase := ConvertCharCase(GetEnumProperty(Source, 'MemoCharCase')); + MemoMaxLength := GetIntegerProperty(Source, 'MemoMaxLength', MemoMaxLength); + MemoOEMConvert := GetBooleanProperty(Source, 'MemoOEMConvert', MemoOEMConvert); + MemoScrollBars := ConvertScrollStyle(GetEnumProperty(Source, 'MemoScrollBars')); + MemoWantReturns := GetBooleanProperty(Source, 'MemoWantReturns', MemoWantReturns); + MemoWantTabs := GetBooleanProperty(Source, 'MemoWantTabs', MemoWantTabs); + MemoWordWrap := GetBooleanProperty(Source, 'MemoWordWrap', MemoWordWrap); + PictureAutoSize := GetBooleanProperty(Source, 'PictureAutoSize', PictureAutoSize); + PictureFilter := GetStringProperty(Source, 'PictureFilter', PictureFilter); + PictureTransparency := ConvertPictureTransparency(GetEnumProperty(Source, 'PictureTransparency')); + ReadOnly := GetBooleanProperty(Source, 'ReadOnly', ReadOnly); + ShowExPopupItems := GetBooleanProperty(Source, 'ShowExPopupItems', ShowExPopupItems); + ShowPicturePopup := GetBooleanProperty(Source, 'ShowPicturePopup', ShowPicturePopup); + end; + inherited DoImport; +end; + +function TcxBlobEditPropertiesConverter.ConvertBlobEditKind( + const AKind: string): TcxBlobEditKind; +begin + if AKind = 'bkAuto' then + Result := bekAuto + else if AKind = 'bkBlob' then + Result := bekBlob + else if AKind = 'bkMemo' then + Result := bekMemo + else if AKind = 'bkOle' then + Result := bekOle + else if AKind = 'bkPict' then + Result := bekPict + else + Result := bekAuto; +end; + +function TcxBlobEditPropertiesConverter.ConvertBlobPaintStyle( + const AStyle: string): TcxBlobPaintStyle; +begin + if AStyle = 'bpsDefault' then + Result := bpsDefault + else if AStyle = 'bpsIcon' then + Result := bpsIcon + else if AStyle = 'bpsText' then + Result := bpsText + else + Result := bpsDefault; +end; + +function TcxBlobEditPropertiesConverter.GetDestination: TcxBlobEditProperties; +begin + Result := inherited Destination as TcxBlobEditProperties; +end; + +{ TcxButtonEditPropertiesConverter } + +procedure TcxButtonEditPropertiesConverter.DoImport; +var + AButtons: TObject; + AButton: TcxEditButton; + I: Integer; +begin + with TcxButtonEditPropertiesAccess(Destination) do + HideCursor := GetBooleanProperty(Source, 'HideEditCursor', HideCursor); + with Destination do + begin + CharCase := ConvertCharCase(GetEnumProperty(Source, 'CharCase')); + Alignment.Horz := ConvertAlignment(GetEnumProperty(Source, 'Alignment')); + ClickKey := GetIntegerProperty(Source, 'ClickKey', ClickKey); + AButtons := GetClassProperty(Source, 'Buttons'); + if AButtons <> nil then + begin + if AButtons is TCollection then + with TCollection(AButtons) do + begin + Buttons.Clear; + for I := 0 to Count - 1 do + begin + AButton := Buttons.Add; + AButton.Default := GetBooleanProperty(Items[I], 'Default', AButton.Default); + AButton.Glyph.Assign(GetClassProperty(Items[I], 'Glyph') as TBitmap); + AButton.Kind := ConvertButtonKind(GetEnumProperty(Items[I], 'Kind')); + AButton.LeftAlignment := GetBooleanProperty(Items[I], 'LeftAlignment', AButton.LeftAlignment); + AButton.Visible := GetBooleanProperty(Items[I], 'Visible', AButton.Visible); + AButton.Width := GetIntegerProperty(Items[I], 'Width', AButton.Width); + end; + end; + end; + end; + inherited DoImport; +end; + +function TcxButtonEditPropertiesConverter.ConvertButtonKind(const AButtonKind: string): TcxEditButtonKind; +begin + if AButtonKind = 'bkDown' then + Result := bkDown + else if AButtonKind = 'bkEllipsis' then + Result := bkEllipsis + else if AButtonKind = 'bkGlyph' then + Result := bkGlyph + else + Result := bkDown; +end; + +function TcxButtonEditPropertiesConverter.GetDestination: TcxButtonEditProperties; +begin + Result := inherited Destination as TcxButtonEditProperties; +end; + +{ TcxCalcEditPropertiesConverter } + +procedure TcxCalcEditPropertiesConverter.DoImport; +begin + with Destination do + begin + Alignment.Horz := ConvertAlignment(GetEnumProperty(Source, 'Alignment')); + Alignment.Vert := ConvertVertAlignment(GetEnumProperty(Source, 'VertAlignment')); + BeepOnError := GetBooleanProperty(Source, 'BeepOnError', BeepOnError); + ButtonGlyph.Assign(GetClassProperty(Source, 'ButtonGlyph') as TBitmap); + Precision := GetIntegerProperty(Source, 'Precision', Precision); + QuickClose := GetBooleanProperty(Source, 'QuickClose', QuickClose); + ReadOnly := GetBooleanProperty(Source, 'ReadOnly', ReadOnly); + end; + inherited DoImport; +end; + +function TcxCalcEditPropertiesConverter.GetDestination: TcxCalcEditProperties; +begin + Result := inherited Destination as TcxCalcEditProperties; +end; + +{ TcxCheckBoxPropertiesConverter } + +procedure TcxCheckBoxPropertiesConverter.DoImport; +begin + with Destination do + begin + Alignment := ConvertAlignment(GetEnumProperty(Source, 'Alignment')); + AllowGrayed := GetBooleanProperty(Source, 'AllowGrayed', AllowGrayed); + Glyph.Assign(GetClassProperty(Source, 'Glyph') as TBitmap); + GlyphCount := GetIntegerProperty(Source, 'GlyphCount', GlyphCount); + ReadOnly := GetBooleanProperty(Source, 'ReadOnly', ReadOnly); + ValueChecked := GetStringProperty(Source, 'ValueChecked', ''); + ValueGrayed := GetStringProperty(Source, 'ValueGrayed', ''); + ValueUnchecked := GetStringProperty(Source, 'ValueUnchecked', ''); + DisplayChecked := GetStringProperty(Source, 'DisplayChecked', DisplayChecked); + DisplayGrayed := GetStringProperty(Source, 'DisplayNull', DisplayGrayed); + DisplayUnchecked := GetStringProperty(Source, 'DisplayUnchecked', DisplayUnchecked); + NullStyle := ConvertNullFieldStyle(GetEnumProperty(Source, 'ShowNullFieldStyle')); + end; + inherited DoImport; +end; + +function TcxCheckBoxPropertiesConverter.ConvertNullFieldStyle(const AValue: string): TcxCheckBoxNullValueShowingStyle; +begin + if AValue = 'nsGrayedChecked' then + Result := nssGrayedChecked + else if AValue = 'nsInactive' then + Result := nssInactive + else if AValue = 'nsUnchecked' then + Result := nssUnchecked + else + Result := nssUnchecked; +end; + +function TcxCheckBoxPropertiesConverter.GetDestination: TcxCheckBoxProperties; +begin + Result := inherited Destination as TcxCheckBoxProperties; +end; + +{ TcxComboBoxPropertiesConverter } + +procedure TcxComboBoxPropertiesConverter.DoImport; +var + AObject: TObject; + I: Integer; +begin + with Destination do + begin + Alignment.Horz := ConvertAlignment(GetEnumProperty(Source, 'Alignment')); + Alignment.Vert := ConvertVertAlignment(GetEnumProperty(Source, 'VertAlignment')); + ButtonGlyph.Assign(GetClassProperty(Source, 'ButtonGlyph') as TBitmap); + CharCase := ConvertCharCase(GetEnumProperty(Source, 'CharCase')); + DropDownRows := GetIntegerProperty(Source, 'DropDownRows', DropDownRows); + ImmediateDropDown := GetBooleanProperty(Source, 'ImmediateDropDown', ImmediateDropDown); + AObject := GetClassProperty(Source, 'Items'); + if AObject <> nil then + if AObject is TStrings then + for I := 0 to TStrings(AObject).Count - 1 do + Items.Add(TStrings(AObject)[I]); + MaxLength := GetIntegerProperty(Source, 'MaxLength', MaxLength); + OEMConvert := GetBooleanProperty(Source, 'OEMConvert', OEMConvert); + PopupAlignment := ConvertAlignment(GetEnumProperty(Source, 'PopupAlignment')); + ReadOnly := GetBooleanProperty(Source, 'ReadOnly', ReadOnly); + Revertable := GetBooleanProperty(Source, 'Revertable', Revertable); + if GetBooleanProperty(Source, 'DropDownListStyle', False) then + DropDownListStyle := lsEditFixedList + else + DropDownListStyle := lsEditList; + end; + inherited DoImport; +end; + +function TcxComboBoxPropertiesConverter.GetDestination: TcxComboBoxProperties; +begin + Result := inherited Destination as TcxComboBoxProperties; +end; + +{ TcxCurrencyEditPropertiesConverter } + +procedure TcxCurrencyEditPropertiesConverter.DoImport; +begin + with Destination do + begin + Alignment.Horz := ConvertAlignment(GetEnumProperty(Source, 'Alignment')); + Alignment.Vert := ConvertVertAlignment(GetEnumProperty(Source, 'VertAlignment')); + ReadOnly := GetBooleanProperty(Source, 'ReadOnly', ReadOnly); + DecimalPlaces := GetIntegerProperty(Source, 'DecimalPlaces', DecimalPlaces); + DisplayFormat := GetStringProperty(Source, 'DisplayFormat', DisplayFormat); + MaxValue := GetFloatProperty(Source, 'MaxValue', MaxValue); + MinValue := GetFloatProperty(Source, 'MinValue', MinValue); + Nullable := GetBooleanProperty(Source, 'Nullable', Nullable); + NullString := GetStringProperty(Source, 'NullString', NullString); + UseThousandSeparator := GetBooleanProperty(Source, 'UseThousandSeparator', UseThousandSeparator); + end; + inherited DoImport; +end; + +function TcxCurrencyEditPropertiesConverter.GetDestination: TcxCurrencyEditProperties; +begin + Result := inherited Destination as TcxCurrencyEditProperties; +end; + +{ TcxDateEditPropertiesConverter } + +procedure TcxDateEditPropertiesConverter.DoImport; +var + ADateButtons: TStringList; + AcxDateButtons: TDateButtons; + I: Integer; + ADateOnError: string; +begin + with Destination do + begin + Alignment.Horz := ConvertAlignment(GetEnumProperty(Source, 'Alignment')); + Alignment.Vert := ConvertVertAlignment(GetEnumProperty(Source, 'VertAlignment')); + ButtonGlyph.Assign(GetClassProperty(Source, 'ButtonGlyph') as TBitmap); + ADateButtons := TStringList.Create; + try + GetSetProperty(Source, 'DateButtons', ADateButtons); + ADateButtons.Sort; + AcxDateButtons := []; + if ADateButtons.Find('btnToday', I) then + Include(AcxDateButtons, btnToday); + if ADateButtons.Find('btnClear', I) then + Include(AcxDateButtons, btnClear); + DateButtons := AcxDateButtons; + finally + ADateButtons.Free; + end; + if GetBooleanProperty(Source, 'DateValidation') then + DateOnError := deNoChange + else + begin + ADateOnError := GetEnumProperty(Source, 'DateOnError'); + if ADateOnError = 'deToday'then + DateOnError := deToday + else if ADateOnError = 'deNull' then + DateOnError := deNull; + end; + SaveTime := GetBooleanProperty(Source, 'SaveTime', SaveTime); + if GetBooleanProperty(Source, 'UseEditMask', False) then + InputKind := ikMask + else + InputKind := ikRegExpr; + end; + inherited DoImport; +end; + +function TcxDateEditPropertiesConverter.GetDestination: TcxDateEditProperties; +begin + Result := inherited Destination as TcxDateEditProperties; +end; + +{ TcxHyperLinkEditPropertiesConverter } + +procedure TcxHyperLinkEditPropertiesConverter.DoImport; +begin + with Destination do + begin + Alignment.Horz := ConvertAlignment(GetEnumProperty(Source, 'Alignment')); + Alignment.Vert := ConvertVertAlignment(GetEnumProperty(Source, 'VertAlignment')); + ReadOnly := GetBooleanProperty(Source, 'ReadOnly', ReadOnly); + SingleClick := GetBooleanProperty(Source, 'SingleClick', SingleClick); + StartKey := GetIntegerProperty(Source, 'StartKey', StartKey); + end; + inherited DoImport; +end; + +function TcxHyperLinkEditPropertiesConverter.GetDestination: TcxHyperLinkEditProperties; +begin + Result := inherited Destination as TcxHyperLinkEditProperties; +end; + +{ TcxImagePropertiesConverter } + +procedure TcxImagePropertiesConverter.DoImport; +var + AObject: TObject; + AGlyph: TObject; + AButtons: TStringList; + AMenuItems: TcxPopupMenuItems; + I: Integer; +begin + with Destination do + begin + Center := GetBooleanProperty(Source, 'Center', Center); + CustomFilter := GetStringProperty(Source, 'CustomFilter', CustomFilter); + GraphicTransparency := ConvertPictureTransparency( + GetEnumProperty(Source, 'GraphicTransparency')); + ReadOnly := GetBooleanProperty(Source, 'ReadOnly', ReadOnly); + Stretch := GetBooleanProperty(Source, 'Stretch', Stretch); + AObject := GetClassProperty(Source, 'PopupToolBar'); + if AObject <> nil then + begin + PopupMenuLayout.CustomMenuItemCaption := GetStringProperty(AObject, + 'CustomButtonCaption', PopupMenuLayout.CustomMenuItemCaption); + AGlyph := GetClassProperty(AObject, 'CustomButtonGlyph'); + PopupMenuLayout.CustomMenuItemGlyph.Assign(AGlyph as TBitmap); + AButtons := TStringList.Create; + try + GetSetProperty(AObject, 'Buttons', AButtons); + AButtons.Sort; + AMenuItems := []; + if AButtons.Find('ptbCut', I) then + Include(AMenuItems, pmiCut); + if AButtons.Find('ptbCopy', I) then + Include(AMenuItems, pmiCopy); + if AButtons.Find('ptbPaste', I) then + Include(AMenuItems, pmiPaste); + if AButtons.Find('ptbDelete', I) then + Include(AMenuItems, pmiDelete); + if AButtons.Find('ptbLoad', I) then + Include(AMenuItems, pmiLoad); + if AButtons.Find('ptbSave', I) then + Include(AMenuItems, pmiSave); + if AButtons.Find('ptbCustom', I) then + Include(AMenuItems, pmiCustom); + PopupMenuLayout.MenuItems := AMenuItems; + finally + AButtons.Free; + end; + end; + end; + inherited DoImport; +end; + +function TcxImagePropertiesConverter.GetDestination: TcxImageProperties; +begin + Result := inherited Destination as TcxImageProperties; +end; + +{ TcxImageComboBoxPropertiesConverter } + +procedure TcxImageComboBoxPropertiesConverter.DoImport; +var + AObject: TObject; + AItem: TcxImageComboBoxItem; + AdxImageIndexes: TObject; + AdxValues: TObject; + AdxDescriptions: TObject; + I: Integer; +begin + with Destination do + begin + Alignment.Horz := ConvertAlignment(GetEnumProperty(Source, 'Alignment')); + Alignment.Vert := ConvertVertAlignment(GetEnumProperty(Source, 'VertAlignment')); + ButtonGlyph.Assign(GetClassProperty(Source, 'ButtonGlyph') as TBitmap); + DropDownRows := GetIntegerProperty(Source, 'DropDownRows', DropDownRows); + AObject := GetClassProperty(Source, 'Images'); + if AObject <> nil then + Images := AObject as TCustomImageList + else + Images := nil; + AObject := GetClassProperty(Source, 'LargeImages'); + if AObject <> nil then + LargeImages := AObject as TCustomImageList + else + LargeImages := nil; + ReadOnly := GetBooleanProperty(Source, 'ReadOnly', ReadOnly); + MultiLineText := GetBooleanProperty(Source,'MultiLineText', MultiLineText); + ShowDescriptions := GetBooleanProperty(Source, 'ShowDescription', ShowDescriptions); + AdxImageIndexes := GetClassProperty(Source, 'ImageIndexes'); + AdxValues := GetClassProperty(Source, 'Values'); + AdxDescriptions := GetClassProperty(Source, 'Descriptions'); + if (AdxImageIndexes <> nil) and (AdxValues <> nil) and + (AdxDescriptions <> nil) then + begin + if (AdxImageIndexes is TStrings) and (AdxValues is TStrings) and + (AdxDescriptions is TStrings) then + begin + for I := 0 to TStrings(AdxImageIndexes).Count - 1 do + begin + AItem := Items.Add as TcxImageComboBoxItem; + AItem.ImageIndex := StrToInt(TStrings(AdxImageIndexes)[I]); + if I < TStrings(AdxDescriptions).Count then + AItem.Description := TStrings(AdxDescriptions)[I]; + if I < TStrings(AdxValues).Count then + AItem.Value := TStrings(AdxValues)[I]; + end; + end; + end; + end; + inherited DoImport; +end; + +function TcxImageComboBoxPropertiesConverter.GetDestination: TcxImageComboBoxProperties; +begin + Result := inherited Destination as TcxImageComboBoxProperties; +end; + +{ TcxLookupComboBoxPropertiesConverter } + +procedure TcxLookupComboBoxPropertiesConverter.DoImport; +begin + with Destination do + begin + Alignment.Horz := ConvertAlignment(GetEnumProperty(Source, 'Alignment')); + Alignment.Vert := ConvertVertAlignment(GetEnumProperty(Source, 'VertAlignment')); + ReadOnly := GetBooleanProperty(Source, 'ReadOnly', ReadOnly); + CharCase := ConvertCharCase(GetEnumProperty(Source, 'CharCase')); + ClearKey := GetIntegerProperty(Source, 'ClearKey', ClearKey); + ImmediateDropDown := GetBooleanProperty(Source, 'ImmediateDropDown', ImmediateDropDown); + OEMConvert := GetBooleanProperty(Source, 'OEMConvert', OEMConvert); + MaxLength := GetIntegerProperty(Source, 'MaxLength', MaxLength); + ButtonGlyph.Assign(GetClassProperty(Source, 'ButtonGlyph') as TBitmap); + DropDownRows := GetIntegerProperty(Source, 'DropDownRows', DropDownRows); + DropDownWidth := GetIntegerProperty(Source, 'DropDownWidth', DropDownWidth); + ListFieldNames := GetStringProperty(Source, 'ListFieldName', ListFieldNames); + PopupAlignment := ConvertAlignment(GetEnumProperty(Source, 'PopupAlignment')); + ListOptions.ShowHeader := False; + end; + inherited DoImport; +end; + +function TcxLookupComboBoxPropertiesConverter.GetDestination: TcxLookupComboBoxProperties; +begin + Result := inherited Destination as TcxLookupComboBoxProperties; +end; + +{ TcxMaskEditPropertiesConverter } + +procedure TcxMaskEditPropertiesConverter.DoImport; +begin + with Destination do + begin + Alignment.Horz := ConvertAlignment(GetEnumProperty(Source, 'Alignment')); + Alignment.Vert := ConvertVertAlignment(GetEnumProperty(Source, 'VertAlignment')); + ReadOnly := GetBooleanProperty(Source, 'ReadOnly', ReadOnly); + CharCase := ConvertCharCase(GetEnumProperty(Source, 'CharCase')); + EditMask := GetStringProperty(Source, 'EditMask', EditMask); + IgnoreMaskBlank := GetBooleanProperty(Source, 'IgnoreMaskBlank', IgnoreMaskBlank); + MaskKind := emkStandard; + MaxLength := GetIntegerProperty(Source, 'MaxLength', MaxLength); + OEMConvert := GetBooleanProperty(Source, 'OEMConvert', OEMConvert); + end; + inherited DoImport; +end; + +function TcxMaskEditPropertiesConverter.GetDestination: TcxMaskEditProperties; +begin + Result := inherited Destination as TcxMaskEditProperties; +end; + +{ TcxMemoPropertiesConverter } + +procedure TcxMemoPropertiesConverter.DoImport; +begin + with Destination do + begin + Alignment := ConvertAlignment(GetEnumProperty(Source, 'Alignment')); + ReadOnly := GetBooleanProperty(Source, 'ReadOnly', ReadOnly); + CharCase := ConvertCharCase(GetEnumProperty(Source, 'CharCase')); + MaxLength := GetIntegerProperty(Source, 'MaxLength', MaxLength); + OEMConvert := GetBooleanProperty(Source, 'OEMConvert', OEMConvert); + ScrollBars := ConvertScrollStyle(GetEnumProperty(Source, 'ScrollBars')); + WantReturns := GetBooleanProperty(Source, 'WantReturns', WantReturns); + WantTabs := GetBooleanProperty(Source, 'WantTabs', WantTabs); + WordWrap := GetBooleanProperty(Source, 'WordWrap', WordWrap); + end; + inherited DoImport; +end; + +function TcxMemoPropertiesConverter.GetDestination: TcxMemoProperties; +begin + Result := inherited Destination as TcxMemoProperties; +end; + +{ TcxMRUEditPropertiesConverter } + +procedure TcxMRUEditPropertiesConverter.DoImport; +var + AObject: TObject; + AItems: TStringList; + I: Integer; +begin + with Destination do + begin + AItems := GetClassProperty(Source, 'Items') as TStringList; + if AItems <> nil then + for I := 0 to AItems.Count - 1 do + LookupItems.Add(AItems[I]); + Alignment.Horz := ConvertAlignment(GetEnumProperty(Source, 'Alignment')); + Alignment.Vert := ConvertVertAlignment(GetEnumProperty(Source, 'VertAlignment')); + ReadOnly := GetBooleanProperty(Source, 'ReadOnly', ReadOnly); + AObject := GetClassProperty(Source, 'ButtonGlyph'); + ButtonGlyph.Assign(AObject as TBitmap); + DropDownRows := GetIntegerProperty(Source, 'DropDownRows', DropDownRows); + ImmediateDropDown := GetBooleanProperty(Source, 'ImmediateDropDown', ImmediateDropDown); + MaxItemCount := GetIntegerProperty(Source, 'MaxItemCount', MaxItemCount); + ShowEllipsis := GetBooleanProperty(Source, 'ShowEllipsis', ShowEllipsis); + end; + inherited DoImport; +end; + +function TcxMRUEditPropertiesConverter.GetDestination: TcxMRUEditProperties; +begin + Result := inherited Destination as TcxMRUEditProperties; +end; + +{ TcxPopupEditPropertiesConverter } + +procedure TcxPopupEditPropertiesConverter.DoImport; +var + AObject: TObject; + APanelStyle: string; +begin + with Destination do + begin + Alignment.Horz := ConvertAlignment(GetEnumProperty(Source, 'Alignment')); + Alignment.Vert := ConvertVertAlignment(GetEnumProperty(Source, 'VertAlignment')); + ReadOnly := GetBooleanProperty(Source, 'ReadOnly', ReadOnly); + CharCase := ConvertCharCase(GetEnumProperty(Source, 'CharCase')); + MaxLength := GetIntegerProperty(Source, 'MaxLength', MaxLength); + OEMConvert := GetBooleanProperty(Source, 'OEMConvert', OEMConvert); + PopupAutoSize := GetBooleanProperty(Source, 'PopupAutoSize', PopupAutoSize); + PopupClientEdge := GetBooleanProperty(Source, 'PopupFormClientEdge', PopupClientEdge); + AObject := GetClassProperty(Source, 'PopupControl'); + if AObject <> nil then + PopupControl := AObject as TControl + else + PopupControl := nil; + PopupHeight := GetIntegerProperty(Source, 'PopupHeight', PopupHeight); + PopupMinHeight := GetIntegerProperty(Source, 'PopupMinHeight', PopupMinHeight); + PopupMinWidth := GetIntegerProperty(Source, 'PopupMinWidth', PopupMinWidth); + PopupWidth := GetIntegerProperty(Source, 'PopupWidth', PopupWidth); + PopupSizeable := GetBooleanProperty(Source, 'PopupFormSizeable', PopupSizeable); + APanelStyle := GetEnumProperty(Source, 'PopupFormBorderStyle'); + PopupSysPanelStyle := APanelStyle = 'pbsSysPanel'; + end; + inherited DoImport; +end; + +function TcxPopupEditPropertiesConverter.GetDestination: TcxPopupEditProperties; +begin + Result := inherited Destination as TcxPopupEditProperties; +end; + +{ TcxSpinEditPropertiesConverter } + +procedure TcxSpinEditPropertiesConverter.DoImport; +begin + with Destination do + begin + Alignment.Horz := ConvertAlignment(GetEnumProperty(Source, 'Alignment')); + Alignment.Vert := ConvertVertAlignment(GetEnumProperty(Source, 'VertAlignment')); + Increment := GetFloatProperty(Source, 'Increment', Increment); + MaxValue := GetFloatProperty(Source, 'MaxValue', MaxValue); + MinValue := GetFloatProperty(Source, 'MinValue', MinValue); + ReadOnly := GetBooleanProperty(Source, 'ReadOnly', ReadOnly); + end; + inherited DoImport; +end; + +function TcxSpinEditPropertiesConverter.GetDestination: TcxSpinEditProperties; +begin + Result := inherited Destination as TcxSpinEditProperties; +end; + +{ TcxTextEditPropertiesConverter } + +procedure TcxTextEditPropertiesConverter.DoImport; +begin + with Destination do + begin + Alignment.Horz := ConvertAlignment(GetEnumProperty(Source, 'Alignment')); + Alignment.Vert := ConvertVertAlignment(GetEnumProperty(Source, 'VertAlignment')); + ReadOnly := GetBooleanProperty(Source, 'ReadOnly', ReadOnly); + CharCase := ConvertCharCase(GetEnumProperty(Source, 'CharCase')); + MaxLength := GetIntegerProperty(Source, 'MaxLength', MaxLength); + OEMConvert := GetBooleanProperty(Source, 'OEMConvert', OEMConvert); + end; + inherited DoImport; +end; + +function TcxTextEditPropertiesConverter.GetDestination: TcxTextEditProperties; +begin + Result := inherited Destination as TcxTextEditProperties; +end; + +{ TcxTimeEditPropertiesConverter } + +procedure TcxTimeEditPropertiesConverter.DoImport; +begin + with Destination do + begin + Alignment.Horz := ConvertAlignment(GetEnumProperty(Source, 'Alignment')); + Alignment.Vert := ConvertVertAlignment(GetEnumProperty(Source, 'VertAlignment')); + ReadOnly := GetBooleanProperty(Source, 'ReadOnly', ReadOnly); + TimeFormat := ConvertTimeFormat(GetEnumProperty(Source, 'TimeEditFormat')); + end; + inherited DoImport; +end; + +function TcxTimeEditPropertiesConverter.ConvertTimeFormat(const AFormat: string): TcxTimeEditTimeFormat; +begin + if AFormat = 'tfHour' then + Result := tfHour + else if AFormat = 'tfHourMin' then + Result := tfHourMin + else if AFormat = 'tfHourMinSec' then + Result := tfHourMinSec + else + Result := tfHour; +end; + +function TcxTimeEditPropertiesConverter.GetDestination: TcxTimeEditProperties; +begin + Result := inherited Destination as TcxTimeEditProperties; +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxRadioGroup.pas b/official/x.35/ExpressEditors Library 5/Sources/cxRadioGroup.pas new file mode 100644 index 00000000..1003552f --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxRadioGroup.pas @@ -0,0 +1,2304 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxRadioGroup; + +{$I cxVer.inc} + +interface + +uses + Windows, + Messages, +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Classes, Controls, Forms, Graphics, ImgList, StdCtrls, SysUtils, cxClasses, + cxContainer, cxControls, cxDataStorage, cxEdit, cxGraphics, cxLookAndFeels, + Menus, cxTextEdit, cxGroupBox, dxUxTheme, cxDropDownEdit, cxFilterControlUtils; + +type + TcxRadioButtonState = (rbsDisabled, rbsHot, rbsNormal, rbsPressed); + TcxRadioGroupState = (rgsActive, rgsDisabled, rgsHot, rgsNormal); + + TcxCustomRadioGroup = class; + TcxCustomRadioGroupProperties = class; + + { TcxRadioButton } + + TcxRadioButton = class(TRadioButton, IUnknown, + IcxMouseTrackingCaller, IcxLookAndFeelContainer, IdxSkinSupport) + private + FButtonRect: TRect; + FCanvas: TcxCanvas; + FColumn: Integer; + FControlCanvas: TControlCanvas; + FLookAndFeel: TcxLookAndFeel; + FPopupMenu: TComponent; + FRow: Integer; + FState: TcxRadioButtonState; + FTransparent: Boolean; + {$IFNDEF DELPHI7} + FParentBackground: Boolean; + FWordWrap: Boolean; + {$ENDIF} + function GetTextColor: TColor; + procedure DrawItem(const DrawItemStruct: TDrawItemStruct); + function IsDisabledTextColorAssigned: Boolean; + function GetRadioButtonRect(const ARadioButtonSize: TSize; + ANativeStyle: Boolean): TRect; + procedure SetLookAndFeel(Value: TcxLookAndFeel); + procedure SetPopupMenu(Value: TComponent); + procedure SetState(Value: TcxRadioButtonState); + procedure SetTransparent(Value: Boolean); + {$IFNDEF DELPHI7} + procedure SetParentBackground(Value: Boolean); + procedure SetWordWrap(Value: Boolean); + {$ENDIF} + procedure WMContextMenu(var Message: TWMContextMenu); message WM_CONTEXTMENU; + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND; + procedure WMWindowPosChanged(var Message: TWMWindowPosChanged); + message WM_WINDOWPOSCHANGED; + procedure BMSetCheck(var Message: TMessage); message BM_SETCHECK; + procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED; + procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure CMSysColorChange(var Message: TMessage); message CM_SYSCOLORCHANGE; + procedure CNDrawItem(var Message: TWMDrawItem); message CN_DRAWITEM; + procedure CNKeyDown(var Message: TWMKeyDown); message CN_KEYDOWN; + procedure CNMeasureItem(var Message: TWMMeasureItem); message CN_MEASUREITEM; + procedure CNSysKeyDown(var Message: TWMSysKeyDown); message CN_SYSKEYDOWN; + protected + procedure CreateHandle; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure DoEnter; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + + procedure CorrectTextRect(var R: TRect; ANativeStyle: Boolean); virtual; + procedure DoContextPopup(MousePos: TPoint; + var Handled: Boolean); {$IFNDEF DELPHI5}virtual{$ELSE}override{$ENDIF}; + function DoShowPopupMenu(APopupMenu: TComponent; + X, Y: Integer): Boolean; virtual; + procedure DrawBackground; virtual; + procedure DrawCaption(ACanvas: TcxCanvas; ANativeStyle: Boolean); virtual; + procedure EnabledChanged; dynamic; + procedure InternalPolyLine(const APoints: array of TPoint); + function IsInplace: Boolean; virtual; + function IsNativeBackground: Boolean; virtual; + function IsNativeStyle: Boolean; virtual; + function IsTransparent: Boolean; virtual; + function IsTransparentBackground: Boolean; virtual; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); virtual; + procedure MouseEnter(AControl: TControl); dynamic; + procedure MouseLeave(AControl: TControl); dynamic; + procedure Paint(ADrawOnlyFocusedState: Boolean); virtual; + procedure ShortUpdateState; + procedure UpdateState(Button: TcxMouseButton; Shift: TShiftState; + const P: TPoint); virtual; + + // IcxMouseTrackingCaller + procedure IcxMouseTrackingCaller.MouseLeave = MouseTrackingCallerMouseLeave; + procedure MouseTrackingCallerMouseLeave; + + // IcxLookAndFeelContainer + function GetLookAndFeel: TcxLookAndFeel; + + property Canvas: TcxCanvas read FCanvas; + property Column: Integer read FColumn; + property Row: Integer read FRow; + property State: TcxRadioButtonState read FState write SetState; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function Focused: Boolean; override; + procedure Invalidate; override; + published + property LookAndFeel: TcxLookAndFeel read FLookAndFeel write SetLookAndFeel; + property PopupMenu: TComponent read FPopupMenu write SetPopupMenu; + property ParentBackground{$IFNDEF DELPHI7}: Boolean read FParentBackground write SetParentBackground{$ENDIF} default True; + property Transparent: Boolean read FTransparent write SetTransparent default False; + {$IFNDEF DELPHI7} + property WordWrap: Boolean read FWordWrap write SetWordWrap default False; + {$ENDIF} + end; + + { TcxRadioGroupButtonViewInfo } + + TcxRadioGroupButtonViewInfo = class(TcxGroupBoxButtonViewInfo) + public + function GetGlyphRect(ACanvas: TcxCanvas; AGlyphSize: TSize; AAlignment: TLeftRight; AIsPaintCopy: Boolean): TRect; override; + end; + + { TcxCustomRadioGroupViewInfo } + + TcxCustomRadioGroupViewInfo = class(TcxButtonGroupViewInfo) + private + function GetEdit: TcxCustomRadioGroup; + function ThemeHandle: TdxTheme; + protected + procedure DrawButtonCaption(ACanvas: TcxCanvas; + AButtonViewInfo: TcxGroupBoxButtonViewInfo; const AGlyphRect: TRect); override; + procedure DrawButtonGlyph(ACanvas: TcxCanvas; + AButtonViewInfo: TcxGroupBoxButtonViewInfo; const AGlyphRect: TRect); override; + function GetButtonViewInfoClass: TcxEditButtonViewInfoClass; override; + function IsButtonGlypthTransparent(AButtonViewInfo: TcxGroupBoxButtonViewInfo): Boolean; override; + public + ItemIndex: Integer; + constructor Create; override; + property Edit: TcxCustomRadioGroup read GetEdit; + end; + + { TcxCustomRadioGroupViewData } + + TcxCustomRadioGroupViewData = class(TcxButtonGroupViewData) + private + function GetProperties: TcxCustomRadioGroupProperties; + protected + procedure GetEditMetrics(AAutoHeight: Boolean; ACanvas: TcxCanvas; + out AMetrics: TcxEditMetrics); override; + procedure CalculateButtonNativeState(AViewInfo: TcxCustomEditViewInfo; + AButtonViewInfo: TcxGroupBoxButtonViewInfo); override; + public + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); override; + procedure EditValueToDrawValue(ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + AViewInfo: TcxCustomEditViewInfo); override; + property Properties: TcxCustomRadioGroupProperties read GetProperties; + end; + + { TcxRadioGroupItem } + + TcxRadioGroupItem = class(TcxButtonGroupItem) + private + FValue: TcxEditValue; + function IsValueStored: Boolean; + procedure SetValue(const Value: TcxEditValue); + public + constructor Create(Collection: TCollection); override; + procedure Assign(Source: TPersistent); override; + published + property Caption; + property Value: TcxEditValue read FValue write SetValue stored IsValueStored; + property Tag; + end; + + { TcxRadioGroupItems } + + TcxRadioGroupItems = class(TcxButtonGroupItems) + private + function GetItem(Index: Integer): TcxRadioGroupItem; + procedure SetItem(Index: Integer; Value: TcxRadioGroupItem); + public + function Add: TcxRadioGroupItem; + property Items[Index: Integer]: TcxRadioGroupItem + read GetItem write SetItem; default; + end; + + { TcxCustomRadioGroupProperties } + + TcxCustomRadioGroupProperties = class(TcxCustomButtonGroupProperties) + private + FDefaultCaption: WideString; + FDefaultValue: TcxEditValue; + function GetItems: TcxRadioGroupItems; + function IsDefaultCaptionStored: Boolean; + function IsDefaultValueStored: Boolean; + procedure SetDefaultValue(const Value: TcxEditValue); + procedure SetItems(Value: TcxRadioGroupItems); + protected + function CreateItems: TcxButtonGroupItems; override; + function GetColumnCount: Integer; override; + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + function HasDisplayValue: Boolean; override; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + function CanCompareEditValue: Boolean; override; + function CompareDisplayValues( + const AEditValue1, AEditValue2: TcxEditValue): Boolean; override; + class function GetContainerClass: TcxContainerClass; override; + function GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; override; + function GetRadioGroupItemIndex(const AEditValue: TcxEditValue): Integer; + function GetSupportedOperations: TcxEditSupportedOperations; override; + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + function IsResetEditClass: Boolean; override; + procedure PrepareDisplayValue(const AEditValue: TcxEditValue; + var DisplayValue: TcxEditValue; AEditFocused: Boolean); override; + // !!! + property DefaultCaption: WideString read FDefaultCaption + write FDefaultCaption stored IsDefaultCaptionStored; + property DefaultValue: TcxEditValue read FDefaultValue write SetDefaultValue + stored IsDefaultValueStored; + property Items: TcxRadioGroupItems read GetItems write SetItems; + end; + + { TcxRadioGroupProperties } + + TcxRadioGroupProperties = class(TcxCustomRadioGroupProperties) + published + property AssignedValues; + property ClearKey; + property Columns; + property DefaultCaption; + property DefaultValue; + property ImmediatePost; + property Items; + property ReadOnly; + property WordWrap; + property OnChange; + property OnEditValueChanged; + end; + + { TcxCustomRadioGroupButton } + + TcxCustomRadioGroupButton = class(TcxRadioButton, IUnknown, + IcxContainerInnerControl) + private + FFocusingByMouse: Boolean; + FInternalSettingChecked: Boolean; + FIsClickLocked: Boolean; + function GetRadioGroup: TcxCustomRadioGroup; + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + procedure WMKillFocus(var Message: TWMKillFocus); message WM_KILLFOCUS; + procedure WMSetFocus(var Message: TWMSetFocus); message WM_SETFOCUS; + procedure CNCommand(var Message: TWMCommand); message CN_COMMAND; + protected + procedure Click; override; + procedure CorrectTextRect(var R: TRect; ANativeStyle: Boolean); override; + procedure DoEnter; override; + procedure DoExit; override; + procedure DrawBackground; override; + function IsInplace: Boolean; override; + function IsNativeBackground: Boolean; override; + function IsNativeStyle: Boolean; override; + function IsTransparent: Boolean; override; + function IsTransparentBackground: Boolean; override; + procedure KeyPress(var Key: Char); override; + procedure Paint(ADrawOnlyFocusedState: Boolean); override; + procedure SetChecked(Value: Boolean); override; + procedure WndProc(var Message: TMessage); override; + + // IcxContainerInnerControl + function GetControl: TWinControl; + function GetControlContainer: TcxContainer; + + procedure InternalSetChecked(AValue: Boolean); + + property RadioGroup: TcxCustomRadioGroup read GetRadioGroup; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + function UpdateAction(Action: TBasicAction): Boolean; override; +{$IFDEF DELPHI5} + function CanFocus: Boolean; override; +{$ENDIF} + procedure DefaultHandler(var Message); override; + end; + + TcxCustomRadioGroupButtonClass = class of TcxCustomRadioGroupButton; + + { TcxCustomRadioGroup } + + TcxCustomRadioGroup = class(TcxCustomButtonGroup) + private + FLoadedItemIndex: Integer; + FSkinsPaintCopy: Boolean; + function GetCheckedIndex: Integer; + function GetButton(Index: Integer): TcxCustomRadioGroupButton; + function GetProperties: TcxCustomRadioGroupProperties; + function GetActiveProperties: TcxCustomRadioGroupProperties; + function GetItemIndex: Integer; + function GetViewInfo: TcxCustomRadioGroupViewInfo; + procedure SetItemIndex(Value: Integer); + procedure SetProperties(Value: TcxCustomRadioGroupProperties); + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + procedure CMCtl3DChanged(var Message: TMessage); message CM_CTL3DCHANGED; + protected + procedure CursorChanged; override; + function GetButtonDC(AButtonIndex: Integer): THandle; override; + procedure Initialize; override; + procedure InternalSetEditValue(const Value: TcxEditValue; + AValidateEditValue: Boolean); override; + function IsContainerFocused: Boolean; override; + function IsDBEditPaintCopyDrawing: Boolean; override; + function IsInternalControl(AControl: TControl): Boolean; override; + procedure SetDragMode(Value: TDragMode); override; + procedure SetInternalValues(const AEditValue: TcxEditValue; + AValidateEditValue, AFromButtonChecked: Boolean); + procedure SynchronizeButtonsStyle; override; + procedure ParentBackgroundChanged; override; + procedure Resize; override; + procedure SetDragKind(Value: TDragKind); override; + procedure ArrangeButtons; override; + function GetButtonInstance: TWinControl; override; + procedure UpdateButtons; override; + + procedure AfterLoading; + function IsLoading: Boolean; + procedure Loaded; override; + procedure Updated; override; + + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + + procedure ButtonChecked(AButton: TcxCustomRadioGroupButton); + + property ViewInfo: TcxCustomRadioGroupViewInfo read GetViewInfo; + property SkinsPaintCopy: Boolean read FSkinsPaintCopy write FSkinsPaintCopy; + public + procedure Activate(var AEditData: TcxCustomEditData); override; + procedure Clear; override; + procedure FlipChildren(AllLevels: Boolean); override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + procedure GetTabOrderList(List: TList); override; + procedure PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); override; + procedure SetFocus; override; + property ActiveProperties: TcxCustomRadioGroupProperties read GetActiveProperties; + property Buttons[Index: Integer]: TcxCustomRadioGroupButton read GetButton; + property ItemIndex: Integer read GetItemIndex write SetItemIndex default -1; + property Properties: TcxCustomRadioGroupProperties read GetProperties + write SetProperties; + property Transparent; + end; + + { TcxRadioGroup } + + TcxRadioGroup = class(TcxCustomRadioGroup) + private + function GetActiveProperties: TcxRadioGroupProperties; + function GetProperties: TcxRadioGroupProperties; + procedure SetProperties(Value: TcxRadioGroupProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxRadioGroupProperties read GetActiveProperties; + published + property Align; + property Alignment; + property Anchors; + property BiDiMode; + property Caption; + property Constraints; + property Ctl3D; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ParentBackground; + property ParentBiDiMode; + property ParentColor; + property ParentCtl3D; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxRadioGroupProperties read GetProperties write SetProperties; + property ItemIndex; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Transparent; + property Visible; + property OnClick; + property OnContextPopup; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnStartDock; + property OnStartDrag; + end; + + { TcxFilterRadioGroupHelper } + + TcxFilterRadioGroupHelper = class(TcxFilterComboBoxHelper) + public + class procedure GetFilterValue(AEdit: TcxCustomEdit; + AEditProperties: TcxCustomEditProperties; var V: Variant; var S: TCaption); override; + class function GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; override; + class procedure InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); override; + class procedure SetFilterValue(AEdit: TcxCustomEdit; AEditProperties: TcxCustomEditProperties; + AValue: Variant); override; + class function UseDisplayValue: Boolean; override; + end; + +implementation + +uses + Math, dxThemeConsts, dxThemeManager, cxVariants, cxLookAndFeelPainters, + cxEditConsts, cxEditPaintUtils, cxEditUtils; + +const + AButtonStateMap: array [TcxRadioButtonState] of TcxButtonState = + (cxbsDisabled, cxbsHot, cxbsNormal, cxbsPressed); + +type + TCanvasAccess = class(TCanvas); + +function InternalGetShiftState: TShiftState; +var + AKeyState: TKeyBoardState; +begin + GetKeyboardState(AKeyState); + Result := KeyboardStateToShiftState(AKeyState); +end; + +{ TcxRadioButton } + +constructor TcxRadioButton.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := ControlStyle + [csDoubleClicks]; + FControlCanvas := TControlCanvas.Create; + FControlCanvas.Control := Self; + FCanvas := TcxCanvas.Create(TCanvas(FControlCanvas)); + FLookAndFeel := TcxLookAndFeel.Create(Self); + FLookAndFeel.OnChanged := LookAndFeelChanged; + FState := rbsNormal; + ParentBackground := True; + PrepareRadioButtonImageList; +end; + +destructor TcxRadioButton.Destroy; +begin + EndMouseTracking(Self); + FreeAndNil(FLookAndFeel); + FreeAndNil(FCanvas); + FreeAndNil(FControlCanvas); + inherited Destroy; +end; + +function TcxRadioButton.Focused: Boolean; +begin + Result := not(csDesigning in ComponentState) and + inherited Focused; +end; + +procedure TcxRadioButton.Invalidate; +begin + InternalInvalidateRect(Self, Rect(0, 0, Width, Height), False); +end; + +procedure TcxRadioButton.DoEnter; +begin + inherited DoEnter; + if not Checked and not ClicksDisabled then + begin + ClicksDisabled := True; + try + Checked := True; + finally + ClicksDisabled := False; + if not (csLoading in ComponentState) then + Click; + end; + end; +end; + +procedure TcxRadioButton.DrawCaption(ACanvas: TcxCanvas; ANativeStyle: Boolean); + + function GetDrawTextFlags: Integer; + begin + Result := cxAlignLeft or cxAlignVCenter or cxShowPrefix; + if WordWrap then + Result := Result or cxDontClip or cxWordBreak + else + Result := Result or cxSingleLine; + end; + + procedure CheckFocusRect(var R: TRect); + begin + if IsInplace then + begin + R.Top := Max(R.Top, 1); + R.Bottom := Min(R.Bottom, Height - 1); + R.Right := Min(R.Right, Width); + end + else + begin + R.Left := Min(R.Left, 0); + R.Top := Min(R.Top, 0); + R.Right := Min(R.Right, Width); + R.Bottom := Min(R.Bottom, Height); + if (Alignment = taLeftJustify) and (R.Right > FButtonRect.Left) then + R.Right := FButtonRect.Left; + end; + end; + +var + AFlags: Integer; + R: TRect; +begin + ACanvas.Font.Assign(Font); + TCanvasAccess(ACanvas.Canvas).RequiredState([csFontValid]); + ACanvas.Font.Color := GetTextColor; + + R := GetControlRect(Self); + if Alignment = taRightJustify then + R.Left := FButtonRect.Right + else + R.Right := FButtonRect.Left; + ACanvas.Brush.Style := bsClear; + CorrectTextRect(R, ANativeStyle); + AFlags := GetDrawTextFlags; + if IsNativeBackground then + ACanvas.Canvas.Refresh; + ACanvas.DrawText(Caption, R, AFlags, IsDisabledTextColorAssigned or + Supports(Self, IcxContainerInnerControl) or ANativeStyle or Enabled); + ACanvas.Brush.Style := bsSolid; + if Focused and (Caption <> '') then + begin + ACanvas.TextExtent(Caption, R, AFlags); + InflateRect(R, 1, 1); + Inc(R.Bottom); + if IsInplace then + CheckFocusRect(R); + ACanvas.Brush.Color := Color; + ACanvas.Font.Color := Font.Color; + TCanvasAccess(ACanvas.Canvas).RequiredState([csFontValid]); + ACanvas.Canvas.DrawFocusRect(R); + end; +end; + +procedure TcxRadioButton.MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + UpdateState(ButtonTocxButton(Button), Shift, Point(X, Y)); +end; + +procedure TcxRadioButton.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + UpdateState(cxmbNone, Shift, Point(X, Y)); + BeginMouseTracking(Self, GetControlRect(Self), Self); +end; + +procedure TcxRadioButton.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + UpdateState(ButtonTocxButton(Button), Shift, Point(X, Y)); +end; + +procedure TcxRadioButton.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (AComponent = PopupMenu) then + PopupMenu := nil; +end; + +procedure TcxRadioButton.CreateHandle; +begin + inherited CreateHandle; + ShortUpdateState; +end; + +procedure TcxRadioButton.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + Style := Style and not BS_RADIOBUTTON or BS_OWNERDRAW; +end; + +procedure TcxRadioButton.CorrectTextRect(var R: TRect; ANativeStyle: Boolean); + + function GetTextRectCorrection: TRect; + const + AInplaceTextRectCorrectionA: array [Boolean] of TRect = ( + (Left: 5; Top: 0; Right: 1; Bottom: 0), + (Left: 3; Top: 0; Right: 0; Bottom: 0) + ); + ATextRectCorrectionA: array [Boolean, TLeftRight] of TRect = ( + ((Left: 2; Top: -1; Right: 1; Bottom: 0), + (Left: 5; Top: -1; Right: 0; Bottom: 0)), + ((Left: 2; Top: -1; Right: 6; Bottom: 0), + (Left: 5; Top: -1; Right: 2; Bottom: 0)) + ); + ANativeStyleTextRectCorrectionA: array [Boolean, TLeftRight] of TRect = ( + ((Left: 0; Top: -1; Right: 1; Bottom: 0), + (Left: 3; Top: -1; Right: 0; Bottom: 0)), + ((Left: 0; Top: -1; Right: 3; Bottom: 0), + (Left: 3; Top: -1; Right: 0; Bottom: 0)) + ); + begin + if IsInplace then + Result := AInplaceTextRectCorrectionA[ANativeStyle] + else + if ANativeStyle then + begin + Result := ANativeStyleTextRectCorrectionA[WordWrap, Alignment]; + if EmulateStandardControlDrawing then + begin + Result.Top := 0; + Result.Bottom := 0; + end; + end + else + Result := ATextRectCorrectionA[WordWrap, Alignment]; + end; + +begin + ExtendRect(R, GetTextRectCorrection); +end; + +procedure TcxRadioButton.DoContextPopup(MousePos: TPoint; + var Handled: Boolean); +var + P: TPoint; +begin +{$IFDEF DELPHI5} + inherited DoContextPopup(MousePos, Handled); +{$ENDIF} + if not Handled then + begin + if (MousePos.X = -1) and (MousePos.Y = -1) then + P := ClientToScreen(Point(0, 0)) + else + P := ClientToScreen(MousePos); + Handled := DoShowPopupMenu(PopupMenu, P.X, P.Y); + end; +end; + +function TcxRadioButton.DoShowPopupMenu(APopupMenu: TComponent; + X, Y: Integer): Boolean; +begin + Result := ShowPopupMenu(Self, APopupMenu, X, Y); +end; + +procedure TcxRadioButton.DrawBackground; +begin + if not IsTransparentBackground then + cxEditFillRect(Canvas, GetControlRect(Self), Color); +end; + +procedure TcxRadioButton.EnabledChanged; +begin + ShortUpdateState; + Invalidate; +end; + +function TcxRadioButton.GetTextColor: TColor; +begin + Result := clDefault; + if Font.Color = clWindowText then + Result := LookAndFeel.Painter.DefaultEditorTextColor(not Enabled); + if Result = clDefault then + begin + if Enabled or Supports(Self, IcxContainerInnerControl) then + Result := Font.Color + else + Result := clBtnShadow; + end; +end; + +procedure TcxRadioButton.InternalPolyLine(const APoints: array of TPoint); +begin + Canvas.Polyline(APoints); + with APoints[High(APoints)] do + Canvas.Pixels[X, Y] := Canvas.Pen.Color; +end; + +function TcxRadioButton.IsDisabledTextColorAssigned: Boolean; +begin + Result := LookAndFeel.Painter.DefaultEditorTextColor(True) <> clDefault; +end; + +function TcxRadioButton.IsInplace: Boolean; +begin + Result := False; +end; + +function TcxRadioButton.IsNativeBackground: Boolean; +begin + Result := IsNativeStyle and ParentBackground and not IsInplace and + not Transparent; +end; + +function TcxRadioButton.IsNativeStyle: Boolean; +begin + Result := AreVisualStylesMustBeUsed(LookAndFeel.NativeStyle, totButton); +end; + +function TcxRadioButton.IsTransparent: Boolean; +begin + Result := Transparent and not IsInplace; +end; + +function TcxRadioButton.IsTransparentBackground: Boolean; +begin + Result := IsNativeBackground or IsTransparent; +end; + +procedure TcxRadioButton.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + Invalidate; +end; + +procedure TcxRadioButton.MouseEnter(AControl: TControl); +begin + ShortUpdateState; + BeginMouseTracking(Self, GetControlRect(Self), Self); +end; + +procedure TcxRadioButton.MouseLeave(AControl: TControl); +begin + UpdateState(cxmbNone, [], Point(-1, -1)); + EndMouseTracking(Self); +end; + +procedure TcxRadioButton.Paint(ADrawOnlyFocusedState: Boolean); + + function GetBackgroundColor: TColor; + begin + if IsTransparentBackground then + begin + if LookAndFeel.SkinPainter <> nil then + Result := clNone + else + Result := clDefault; + end else + Result := Color; + end; + + function GetNativeState: Integer; + const + ANativeStateMap: array [Boolean, TcxRadioButtonState] of Integer = ( + (RBS_UNCHECKEDDISABLED, RBS_UNCHECKEDHOT, RBS_UNCHECKEDNORMAL, + RBS_UNCHECKEDPRESSED), + (RBS_CHECKEDDISABLED, RBS_CHECKEDHOT, RBS_CHECKEDNORMAL, + RBS_CHECKEDPRESSED) + ); + begin + Result := ANativeStateMap[Checked, FState]; + end; + +var + ARadioButtonSize: TSize; + APainter: TcxCustomLookAndFeelPainterClass; +begin + if not ADrawOnlyFocusedState then + begin + if IsTransparent then + cxDrawTransparentControlBackground(Self, Canvas, GetControlRect(Self)) + else + if IsNativeBackground then + cxDrawThemeParentBackground(Self, Canvas, GetControlRect(Self)); + if IsNativeStyle then + DrawBackground; + end; + + APainter := LookAndFeel.GetAvailablePainter(totButton); + ARadioButtonSize := APainter.RadioButtonSize; + FButtonRect := GetRadioButtonRect(ARadioButtonSize, IsNativeStyle); + + APainter.DrawRadioButton(Canvas, FButtonRect.Left, FButtonRect.Top, + AButtonStateMap[State], Checked, Focused, GetBackgroundColor, + csDesigning in ComponentState); + Canvas.ExcludeClipRect(FButtonRect); + + if not ADrawOnlyFocusedState and not IsNativeStyle then + DrawBackground; + + DrawCaption(Canvas, IsNativeStyle); +end; + +procedure TcxRadioButton.ShortUpdateState; +begin + if not HandleAllocated then + Exit; + UpdateState(cxmbNone, InternalGetShiftState, ScreenToClient(InternalGetCursorPos)); +end; + +procedure TcxRadioButton.UpdateState(Button: TcxMouseButton; Shift: TShiftState; + const P: TPoint); +begin + if not Enabled then + State := rbsDisabled + else + if (csDesigning in ComponentState) then + State := rbsNormal + else + if GetCaptureControl = Self then // VCL only + if PtInRect(GetControlRect(Self), P) then + State := rbsPressed + else + State := rbsHot + else + if PtInRect(GetControlRect(Self), P) then + begin + if Shift = [] then + State := rbsHot + else + State := rbsNormal + end + else + State := rbsNormal; +end; + +// IcxMouseTrackingCaller +procedure TcxRadioButton.MouseTrackingCallerMouseLeave; +begin + MouseLeave(nil); +end; + +// IcxLookAndFeelContainer +function TcxRadioButton.GetLookAndFeel: TcxLookAndFeel; +begin + Result := LookAndFeel; +end; + +procedure TcxRadioButton.DrawItem(const DrawItemStruct: TDrawItemStruct); +begin + FCanvas.Canvas.Handle := DrawItemStruct.hDC; + Paint(DrawItemStruct.itemAction = ODA_FOCUS); // SC bug B19151 + FCanvas.Canvas.Handle := 0; +end; + +function TcxRadioButton.GetRadioButtonRect(const ARadioButtonSize: TSize; + ANativeStyle: Boolean): TRect; +begin + Result.Top := (Height - ARadioButtonSize.cy) div 2; + Result.Bottom := Result.Top + ARadioButtonSize.cy; + if Alignment = taRightJustify then + begin + if ANativeStyle then + Result.Left := 0 + else + if IsInplace then + Result.Left := 0 + else + Result.Left := 1; + Result.Right := Result.Left + ARadioButtonSize.cx; + end else + begin + Result.Right := Width; + Result.Left := Result.Right - ARadioButtonSize.cx; + end; +end; + +procedure TcxRadioButton.SetLookAndFeel(Value: TcxLookAndFeel); +begin + FLookAndFeel.Assign(Value); +end; + +procedure TcxRadioButton.SetPopupMenu(Value: TComponent); +var + AIPopupMenu: IcxPopupMenu; +begin + if (Value <> nil) and not((Value is TPopupMenu) or + Supports(Value, IcxPopupMenu, AIPopupMenu)) then + Value := nil; + if FPopupMenu <> Value then + begin + {$IFDEF DELPHI5} + if FPopupMenu <> nil then + FPopupMenu.RemoveFreeNotification(Self); + {$ENDIF} + FPopupMenu := Value; + if FPopupMenu <> nil then + FPopupMenu.FreeNotification(Self); + end; +end; + +procedure TcxRadioButton.SetState(Value: TcxRadioButtonState); +var + R: TRect; +begin + if Value <> FState then + begin + FState := Value; + R := FButtonRect; + InflateRect(R, 1, 1); + InternalInvalidateRect(Self, R, False); + end; +end; + +procedure TcxRadioButton.SetTransparent(Value: Boolean); +begin + if Value <> FTransparent then + begin + FTransparent := Value; + Invalidate; + end; +end; + +{$IFNDEF DELPHI7} +procedure TcxRadioButton.SetParentBackground(Value: Boolean); +begin + if Value <> FParentBackground then + begin + FParentBackground := Value; + Invalidate; + end; +end; + +procedure TcxRadioButton.SetWordWrap(Value: Boolean); +begin + if Value <> FWordWrap then + begin + FWordWrap := Value; + Invalidate; + end; +end; +{$ENDIF} + +procedure TcxRadioButton.WMContextMenu(var Message: TWMContextMenu); +var + AHandled: Boolean; + P, P1: TPoint; +begin + if Message.Result <> 0 then + Exit; + if csDesigning in ComponentState then + begin + inherited; + Exit; + end; + + P := SmallPointToPoint(Message.Pos); + if (P.X = -1) and (P.Y = -1) then + P1 := P + else + begin + P1 := ScreenToClient(P); + if not PtInRect(ClientRect, P1) then + begin + inherited; + Exit; + end; + end; + + AHandled := False; + DoContextPopup(P1, AHandled); + Message.Result := Ord(AHandled); + if not AHandled then + inherited; +end; + +procedure TcxRadioButton.WMEraseBkgnd(var Message: TWMEraseBkgnd); +begin + Message.Result := 1; +end; + +procedure TcxRadioButton.WMWindowPosChanged(var Message: TWMWindowPosChanged); +begin + inherited; + if not (csDestroying in ComponentState) and IsTransparentBackground then + Invalidate; +end; + +procedure TcxRadioButton.BMSetCheck(var Message: TMessage); +begin + inherited; + InternalInvalidateRect(Self, FButtonRect, False); +end; + +procedure TcxRadioButton.CMEnabledChanged(var Message: TMessage); +begin + inherited; + EnabledChanged; +end; + +procedure TcxRadioButton.CMMouseEnter(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseEnter(Self) + else + MouseEnter(TControl(Message.lParam)); +end; + +procedure TcxRadioButton.CMMouseLeave(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseLeave(Self) + else + MouseLeave(TControl(Message.lParam)); +end; + +procedure TcxRadioButton.CMSysColorChange(var Message: TMessage); +begin + inherited; + Invalidate; +end; + +procedure TcxRadioButton.CNDrawItem(var Message: TWMDrawItem); +begin + if not (csDestroying in ComponentState) then + DrawItem(Message.DrawItemStruct^); +end; + +procedure TcxRadioButton.CNKeyDown(var Message: TWMKeyDown); +begin + if IsPopupMenuShortCut(PopupMenu, Message) then + Message.Result := 1 + else + inherited; +end; + +procedure TcxRadioButton.CNMeasureItem(var Message: TWMMeasureItem); +var + ATempVar: TMeasureItemStruct; +begin + ATempVar := Message.MeasureItemStruct^; + ATempVar.itemWidth := Width; + ATempVar.itemHeight := Height; + Message.MeasureItemStruct^ := ATempVar; +end; + +procedure TcxRadioButton.CNSysKeyDown(var Message: TWMSysKeyDown); +begin + if IsPopupMenuShortCut(PopupMenu, Message) then + Message.Result := 1 + else + inherited; +end; + +{ TcxRadioGroupButtonViewInfo } + +function TcxRadioGroupButtonViewInfo.GetGlyphRect(ACanvas: TcxCanvas; + AGlyphSize: TSize; AAlignment: TLeftRight; AIsPaintCopy: Boolean): TRect; + + procedure CorrectRadioRect(var ACheckRect: TRect); + begin + if AIsPaintCopy and not Data.NativeStyle then + OffsetRect(ACheckRect, 1, 0); + end; + +begin + Result := inherited GetGlyphRect(ACanvas, AGlyphSize, AAlignment, AIsPaintCopy); + CorrectRadioRect(Result); +end; + +{ TcxCustomRadioGroupViewInfo } + +constructor TcxCustomRadioGroupViewInfo.Create; +begin + inherited Create; + PrepareRadioButtonImageList; +end; + +procedure TcxCustomRadioGroupViewInfo.DrawButtonCaption(ACanvas: TcxCanvas; + AButtonViewInfo: TcxGroupBoxButtonViewInfo; const AGlyphRect: TRect); + + procedure CorrectTextRect(var R: TRect); + const + ANativeStyleTextRectCorrection: TRect = (Left: 3; Top: -1; Right: 0; Bottom: -1); + ATextRectCorrection: TRect = (Left: 5; Top: 0; Right: 1; Bottom: 0); + begin + if AButtonViewInfo.Data.NativeStyle then + ExtendRect(R, ANativeStyleTextRectCorrection) + else + ExtendRect(R, ATextRectCorrection); + if (Edit <> nil) and Edit.IsDBEditPaintCopyDrawing then + OffsetRect(R, 0, -1); + end; + +var + R: TRect; +begin + ACanvas.Font := Font; + ACanvas.Font.Color := TextColor; + PrepareCanvasFont(ACanvas.Canvas); + R := AButtonViewInfo.Bounds; + if Alignment = taRightJustify then + R.Left := AGlyphRect.Right + else + R.Right := AGlyphRect.Left; + ACanvas.Brush.Style := bsClear; + CorrectTextRect(R); + ACanvas.DrawText(AButtonViewInfo.Caption, R, DrawTextFlags); + ACanvas.Brush.Style := bsSolid; + if not IsInplace and Focused then + begin + ACanvas.TextExtent(AButtonViewInfo.Caption, R, DrawTextFlags); + InflateRect(R, 1, 1); + Inc(R.Bottom); + ACanvas.Brush.Color := BackgroundColor; + TCanvasAccess(ACanvas.Canvas).RequiredState([csFontValid]); + ACanvas.Canvas.DrawFocusRect(R); + end; +end; + +procedure TcxCustomRadioGroupViewInfo.DrawButtonGlyph(ACanvas: TcxCanvas; + AButtonViewInfo: TcxGroupBoxButtonViewInfo; const AGlyphRect: TRect); +const + ALookAndFeelKindMap: array [TcxEditButtonStyle] of TcxLookAndFeelKind = + (lfStandard, lfStandard, lfFlat, lfStandard, lfStandard, + lfUltraFlat, lfOffice11); + AButtonStateMap: array [TcxEditButtonState] of TcxButtonState = + (cxbsDisabled, cxbsNormal, cxbsPressed, cxbsHot); +var + APrevClipRegion: TcxRegion; + ABackgroundColor: TColor; + APainter: TcxCustomLookAndFeelPainterClass; +begin + APrevClipRegion := ACanvas.GetClipRegion; + try + ACanvas.IntersectClipRect(AButtonViewInfo.Bounds); + if AButtonViewInfo.Data.NativeStyle then + DrawThemeBackground(ThemeHandle, ACanvas.Handle, BP_RADIOBUTTON, + AButtonViewInfo.Data.NativeState, AGlyphRect) + else + begin + if IsBackgroundTransparent {and (Painter = nil)} then + ABackgroundColor := clDefault + else + ABackgroundColor := BackgroundColor; + if Painter = nil then + APainter := GetPainterClass(False, ALookAndFeelKindMap[AButtonViewInfo.Data.Style]) + else + APainter := Painter; + APainter.DrawRadioButton(ACanvas, AGlyphRect.Left, AGlyphRect.Top, + AButtonStateMap[AButtonViewInfo.Data.State], + ItemIndex = AButtonViewInfo.Index, False, ABackgroundColor, IsDesigning); + end; + finally + ACanvas.SetClipRegion(APrevClipRegion, roSet); + end; +end; + +function TcxCustomRadioGroupViewInfo.GetButtonViewInfoClass: TcxEditButtonViewInfoClass; +begin + Result := TcxRadioGroupButtonViewInfo; +end; + +function TcxCustomRadioGroupViewInfo.IsButtonGlypthTransparent(AButtonViewInfo: TcxGroupBoxButtonViewInfo): Boolean; +begin + Result := IsBackgroundTransparent or + AButtonViewInfo.Data.NativeStyle and + IsThemeBackgroundPartiallyTransparent(ThemeHandle, BP_RADIOBUTTON, AButtonViewInfo.Data.NativeState); +end; + +function TcxCustomRadioGroupViewInfo.GetEdit: TcxCustomRadioGroup; +begin + Result := TcxCustomRadioGroup(FEdit); +end; + +function TcxCustomRadioGroupViewInfo.ThemeHandle: TdxTheme; +begin + Result := OpenTheme(totButton); +end; + +{ TcxCustomRadioGroupViewData } + +procedure TcxCustomRadioGroupViewData.Calculate(ACanvas: TcxCanvas; + const ABounds: TRect; const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); +begin + with TcxCustomRadioGroupViewInfo(AViewInfo) do + Alignment := taRightJustify; + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, AIsMouseEvent); + TcxCustomRadioGroupViewInfo(AViewInfo).GlyphSize := + Style.LookAndFeel.GetAvailablePainter(totButton).RadioButtonSize; + AViewInfo.BackgroundColor := Style.Color; +end; + +procedure TcxCustomRadioGroupViewData.EditValueToDrawValue(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; AViewInfo: TcxCustomEditViewInfo); +begin + if PreviewMode then + TcxCustomRadioGroupViewInfo(AViewInfo).ItemIndex := 0 + else + TcxCustomRadioGroupViewInfo(AViewInfo).ItemIndex := + Properties.GetRadioGroupItemIndex(AEditValue); + if epoAutoHeight in PaintOptions then + Include(AViewInfo.PaintOptions, epoAutoHeight); +end; + +procedure TcxCustomRadioGroupViewData.GetEditMetrics(AAutoHeight: Boolean; + ACanvas: TcxCanvas; out AMetrics: TcxEditMetrics); +const + AColumnWidthCorrectionA: array [Boolean] of Integer = (7, 5); + AAutoHeightColumnWidthCorrectionA: array [Boolean] of Integer = (3, 1); +var + ANativeStyle: Boolean; +begin + AMetrics.ClientLeftBoundCorrection := 6 - 5 * Integer(IsInplace); + AMetrics.ClientWidthCorrection := 4 * Integer(IsInplace) - 6; + AMetrics.ColumnOffset := 0; + if ACanvas = nil then + Exit; + + ANativeStyle := IsButtonNativeStyle(Style.LookAndFeel); + AMetrics.ButtonSize := Style.LookAndFeel.GetAvailablePainter(totButton).RadioButtonSize; + AMetrics.ColumnWidthCorrection := AColumnWidthCorrectionA[ANativeStyle]; + AMetrics.AutoHeightColumnWidthCorrection := + AAutoHeightColumnWidthCorrectionA[ANativeStyle]; + AMetrics.WidthCorrection := 6 - 5 * Integer(IsInplace); + AMetrics.AutoHeightWidthCorrection := Integer(IsInplace) - 6; +end; + +procedure TcxCustomRadioGroupViewData.CalculateButtonNativeState(AViewInfo: TcxCustomEditViewInfo; + AButtonViewInfo: TcxGroupBoxButtonViewInfo); +const + AButtonStateMap: array [Boolean, TcxEditButtonState] of Integer = ( + (RBS_UNCHECKEDDISABLED, RBS_UNCHECKEDNORMAL, RBS_UNCHECKEDPRESSED, RBS_UNCHECKEDHOT), + (RBS_CHECKEDDISABLED, RBS_CHECKEDNORMAL, RBS_CHECKEDPRESSED, RBS_CHECKEDHOT) + ); +var + ATheme: TdxTheme; +begin + with AButtonViewInfo do + begin + if not Data.NativeStyle then + Exit; + Data.NativePart := BP_RADIOBUTTON; + Data.NativeState := AButtonStateMap[Index = TcxCustomRadioGroupViewInfo(AViewInfo).ItemIndex, Data.State]; + ATheme := OpenTheme(totButton); + Data.BackgroundPartiallyTransparent := IsThemeBackgroundPartiallyTransparent(ATheme, + Data.NativePart, Data.NativeState); + end; +end; + +function TcxCustomRadioGroupViewData.GetProperties: TcxCustomRadioGroupProperties; +begin + Result := TcxCustomRadioGroupProperties(FProperties); +end; + +{ TcxRadioGroupItem } + +constructor TcxRadioGroupItem.Create(Collection: TCollection); +begin + FValue := Null; + inherited Create(Collection); +end; + +procedure TcxRadioGroupItem.Assign(Source: TPersistent); +begin + if Source is TcxRadioGroupItem then + Value := TcxRadioGroupItem(Source).Value; + inherited Assign(Source); +end; + +function TcxRadioGroupItem.IsValueStored: Boolean; +begin + Result := not VarIsNull(FValue); +end; + +procedure TcxRadioGroupItem.SetValue(const Value: TcxEditValue); +begin + if not InternalVarEqualsExact(Value, FValue) then + begin + FValue := Value; + if Assigned(Collection) then + TcxRadioGroupItems(Collection).InternalNotify(Self, -1, copChanged); + end; +end; + +{ TcxRadioGroupItems } + +function TcxRadioGroupItems.Add: TcxRadioGroupItem; +begin + Result := TcxRadioGroupItem(inherited Add); +end; + +function TcxRadioGroupItems.GetItem(Index: Integer): TcxRadioGroupItem; +begin + Result := TcxRadioGroupItem(inherited Items[Index]); +end; + +procedure TcxRadioGroupItems.SetItem(Index: Integer; Value: TcxRadioGroupItem); +begin + inherited Items[Index] := Value; +end; + +{ TcxCustomRadioGroupProperties } + +constructor TcxCustomRadioGroupProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FDefaultCaption := cxGetResourceString(@cxSRadioGroupDefaultCaption); + FDefaultValue := Null; +end; + +procedure TcxCustomRadioGroupProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomRadioGroupProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with Source as TcxCustomRadioGroupProperties do + begin + Self.DefaultCaption := DefaultCaption; + Self.DefaultValue := DefaultValue; + Self.WordWrap := WordWrap; + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +function TcxCustomRadioGroupProperties.CanCompareEditValue: Boolean; +begin + Result := True; +end; + +function TcxCustomRadioGroupProperties.CompareDisplayValues( + const AEditValue1, AEditValue2: TcxEditValue): Boolean; +begin + Result := GetRadioGroupItemIndex(AEditValue1) = GetRadioGroupItemIndex(AEditValue2); +end; + +class function TcxCustomRadioGroupProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxRadioGroup; +end; + +function TcxCustomRadioGroupProperties.GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; +var + AItemIndex: Integer; +begin + AItemIndex := GetRadioGroupItemIndex(AEditValue); + if AItemIndex = -1 then + Result := FDefaultCaption + else + Result := Items[AItemIndex].Caption; +end; + +function TcxCustomRadioGroupProperties.GetRadioGroupItemIndex( + const AEditValue: TcxEditValue): Integer; +var + I: Integer; + AIsNull: Boolean; + AItem: TcxRadioGroupItem; +begin + Result := -1; + for I := 0 to Items.Count - 1 do + begin + AItem := Items[I]; + AIsNull := VarIsNull(AItem.Value); + if AIsNull and InternalCompareString(AItem.Caption, VarToStr(AEditValue), True) or + not AIsNull and VarEqualsExact(AEditValue, AItem.Value) then + begin + Result := I; + Break; + end; + end; +end; + +function TcxCustomRadioGroupProperties.GetSupportedOperations: TcxEditSupportedOperations; +begin + Result := inherited GetSupportedOperations + [esoHorzAlignment, esoSortingByDisplayText]; +end; + +class function TcxCustomRadioGroupProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxCustomRadioGroupViewInfo; +end; + +function TcxCustomRadioGroupProperties.IsResetEditClass: Boolean; +begin + Result := True; +end; + +procedure TcxCustomRadioGroupProperties.PrepareDisplayValue(const AEditValue: + TcxEditValue; var DisplayValue: TcxEditValue; AEditFocused: Boolean); +begin + DisplayValue := GetRadioGroupItemIndex(AEditValue); +end; + +function TcxCustomRadioGroupProperties.CreateItems: TcxButtonGroupItems; +begin + Result := TcxRadioGroupItems.Create(Self, TcxRadioGroupItem); +end; + +function TcxCustomRadioGroupProperties.GetColumnCount: Integer; +begin + Result := Columns; + if Result > Items.Count then + Result := Items.Count; + if Result = 0 then + Result := 1; +end; + +class function TcxCustomRadioGroupProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxCustomRadioGroupViewData; +end; + +function TcxCustomRadioGroupProperties.HasDisplayValue: Boolean; +begin + Result := True; +end; + +function TcxCustomRadioGroupProperties.GetItems: TcxRadioGroupItems; +begin + Result := TcxRadioGroupItems(inherited Items); +end; + +function TcxCustomRadioGroupProperties.IsDefaultCaptionStored: Boolean; +begin + Result := not InternalCompareString(FDefaultCaption, + cxGetResourceString(@cxSRadioGroupDefaultCaption), True); +end; + +function TcxCustomRadioGroupProperties.IsDefaultValueStored: Boolean; +begin + Result := not VarIsNull(FDefaultValue); +end; + +procedure TcxCustomRadioGroupProperties.SetDefaultValue(const Value: TcxEditValue); +begin + if not InternalVarEqualsExact(Value, FDefaultValue) then + begin + FDefaultValue := Value; + Changed; + end; +end; + +procedure TcxCustomRadioGroupProperties.SetItems(Value: TcxRadioGroupItems); +begin + inherited Items.Assign(Value); +end; + +{ TcxCustomRadioGroupButton } + +constructor TcxCustomRadioGroupButton.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + with TcxCustomRadioGroup(AOwner) do + begin + InternalButtons.Add(Self); + Self.LookAndFeel.MasterLookAndFeel := Style.LookAndFeel; + end; +end; + +destructor TcxCustomRadioGroupButton.Destroy; +begin + RadioGroup.InternalButtons.Remove(Self); + inherited Destroy; +end; + +function TcxCustomRadioGroupButton.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action) or + RadioGroup.DataBinding.ExecuteAction(Action); +end; + +function TcxCustomRadioGroupButton.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action) or + RadioGroup.DataBinding.UpdateAction(Action); +end; + +{$IFDEF DELPHI5} +function TcxCustomRadioGroupButton.CanFocus: Boolean; +begin + Result := RadioGroup.CanFocusEx; +end; +{$ENDIF} + +procedure TcxCustomRadioGroupButton.DefaultHandler(var Message); +begin + if not RadioGroup.InnerControlDefaultHandler(TMessage(Message)) then + inherited DefaultHandler(Message); +end; + +procedure TcxCustomRadioGroupButton.Click; +begin + inherited Click; + with RadioGroup do + if not IsLoading then + RadioGroup.Click; +end; + +procedure TcxCustomRadioGroupButton.CorrectTextRect(var R: TRect; ANativeStyle: Boolean); +begin + inherited CorrectTextRect(R, ANativeStyle); +end; + +procedure TcxCustomRadioGroupButton.DoEnter; +begin + with RadioGroup do + begin + ShortRefreshContainer(False); + if not Checked and not IsInplace and not FFocusingByMouse and DoEditing then + Checked := True; + end; +end; + +procedure TcxCustomRadioGroupButton.DoExit; +begin + inherited DoExit; + RadioGroup.ShortRefreshContainer(False); +end; + +procedure TcxCustomRadioGroupButton.DrawBackground; +var + APrevWindowOrg: TPoint; +begin + if RadioGroup.ViewInfo.IsCustomBackground then + begin + OffsetWindowOrgEx(Canvas.Handle, Left, Top, APrevWindowOrg); + try + RadioGroup.ViewInfo.DrawBackground(Canvas); + finally + SetWindowOrgEx(Canvas.Handle, APrevWindowOrg.X, APrevWindowOrg.Y, nil); + end; + end + else + if not IsTransparentBackground then + inherited DrawBackground; +end; + +function TcxCustomRadioGroupButton.IsInplace: Boolean; +begin + Result := RadioGroup.IsInplace; +end; + +function TcxCustomRadioGroupButton.IsNativeBackground: Boolean; +begin + Result := RadioGroup.IsNativeBackground; +end; + +function TcxCustomRadioGroupButton.IsNativeStyle: Boolean; +begin + Result := RadioGroup.IsButtonNativeStyle; +end; + +function TcxCustomRadioGroupButton.IsTransparent: Boolean; +begin + Result := RadioGroup.IsTransparent; +end; + +function TcxCustomRadioGroupButton.IsTransparentBackground: Boolean; +begin + Result := inherited IsTransparentBackground or RadioGroup.ViewInfo.IsCustomBackground; +end; + +procedure TcxCustomRadioGroupButton.KeyPress(var Key: Char); +begin + inherited KeyPress(Key); + if ((Key = #8) or (Key = ' ')) and not RadioGroup.CanModify then + Key := #0; +end; + +procedure TcxCustomRadioGroupButton.Paint(ADrawOnlyFocusedState: Boolean); + + procedure SetSkinsPaintCopy(AValue: Boolean); + begin + if RadioGroup <> nil then + RadioGroup.SkinsPaintCopy := AValue; + end; + + function DrawByPainter(APainter: TcxCustomLookAndFeelPainterClass): Boolean; + var + ABitmap: TcxBitmap; + ARadioButtonSize: TSize; + begin + Result := APainter <> nil; + if Result then + begin + with ClientRect do + ABitmap := TcxBitmap.CreateSize(Right - Left, Bottom - Top); + ABitmap.PixelFormat := pf32bit; + try + SetSkinsPaintCopy(True); + try + cxDrawTransparentControlBackground(Self, ABitmap.cxCanvas, ClientRect); + finally + SetSkinsPaintCopy(False); + end; + ARadioButtonSize := APainter.RadioButtonSize; + FButtonRect := GetRadioButtonRect(ARadioButtonSize, IsNativeStyle); + + with FButtonRect do + APainter.DrawRadioButton(ABitmap.cxCanvas, Left, Top, AButtonStateMap[State], + Checked, Focused, clNone, csDesigning in ComponentState); + + DrawCaption(ABitmap.cxCanvas, IsNativeStyle); + Canvas.Draw(0, 0, ABitmap); + finally + ABitmap.Free; + end; + end; + end; + +begin + if not DrawByPainter(LookAndFeel.SkinPainter) then + inherited Paint(ADrawOnlyFocusedState); +end; + +procedure TcxCustomRadioGroupButton.SetChecked(Value: Boolean); +begin + if Value = Checked then + Exit; + ClicksDisabled := True; + try + inherited SetChecked(Value); + finally + ClicksDisabled := False; + end; + if Value and not FInternalSettingChecked then + RadioGroup.ButtonChecked(Self); +end; + +procedure TcxCustomRadioGroupButton.WndProc(var Message: TMessage); +begin + if RadioGroup.InnerControlMenuHandler(Message) then + Exit; + if ((Message.Msg = WM_LBUTTONDOWN) or (Message.Msg = WM_LBUTTONDBLCLK)) and + (RadioGroup.DragMode = dmAutomatic) and not RadioGroup.IsDesigning then + RadioGroup.BeginAutoDrag + else + begin + if Message.Msg = WM_LBUTTONDOWN then + FFocusingByMouse := True; + inherited WndProc(Message); + if Message.Msg = WM_LBUTTONDOWN then + FFocusingByMouse := False; + end; +end; + +// IcxContainerInnerControl +function TcxCustomRadioGroupButton.GetControl: TWinControl; +begin + Result := Self; +end; + +function TcxCustomRadioGroupButton.GetControlContainer: TcxContainer; +begin + Result := RadioGroup; +end; + +procedure TcxCustomRadioGroupButton.InternalSetChecked(AValue: Boolean); +begin + if FInternalSettingChecked then + Exit; + FInternalSettingChecked := True; + try + Checked := AValue; + finally + FInternalSettingChecked := False; + end; +end; + +function TcxCustomRadioGroupButton.GetRadioGroup: TcxCustomRadioGroup; +begin + Result := TcxCustomRadioGroup(Owner); +end; + +procedure TcxCustomRadioGroupButton.WMGetDlgCode(var Message: TWMGetDlgCode); +begin + inherited; + if RadioGroup.TabsNeeded and (GetKeyState(VK_CONTROL) >= 0) then + Message.Result := Message.Result or DLGC_WANTTAB; + if RadioGroup.IsInplace then + Message.Result := Message.Result or DLGC_WANTARROWS; +end; + +procedure TcxCustomRadioGroupButton.WMKillFocus(var Message: TWMKillFocus); +begin + inherited; + if not(csDestroying in ComponentState) and (Message.FocusedWnd <> RadioGroup.Handle) then + RadioGroup.FocusChanged; +end; + +procedure TcxCustomRadioGroupButton.WMSetFocus(var Message: TWMSetFocus); +begin + inherited; + if not(csDestroying in ComponentState) and (Message.FocusedWnd <> RadioGroup.Handle) then + RadioGroup.FocusChanged; +end; + +procedure TcxCustomRadioGroupButton.CNCommand(var Message: TWMCommand); +begin + if FIsClickLocked then + Exit; + FIsClickLocked := True; + try + try + with RadioGroup do + if ((Message.NotifyCode = BN_CLICKED) or (Message.NotifyCode = BN_DOUBLECLICKED)) and + (Checked or CanModify and DoEditing) then + inherited; + except + Application.HandleException(Self); + end; + finally + FIsClickLocked := False; + end; +end; + +{ TcxCustomRadioGroup } + +procedure TcxCustomRadioGroup.Activate(var AEditData: TcxCustomEditData); +var + ACheckedButtonIndex: Integer; +begin + inherited Activate(AEditData); + if InternalButtons.Count = 0 then + Exit; + ACheckedButtonIndex := ItemIndex; + if ACheckedButtonIndex = -1 then + ACheckedButtonIndex := 0; + if Buttons[ACheckedButtonIndex].CanFocus then + Buttons[ACheckedButtonIndex].SetFocus; +end; + +procedure TcxCustomRadioGroup.Clear; +begin + ItemIndex := -1; +end; + +procedure TcxCustomRadioGroup.FlipChildren(AllLevels: Boolean); +begin +end; + +class function TcxCustomRadioGroup.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomRadioGroupProperties; +end; + +procedure TcxCustomRadioGroup.GetTabOrderList(List: TList); +var + I: Integer; +begin + inherited GetTabOrderList(List); + List.Remove(Self); + if (TabStop or Focused) and (ItemIndex <> -1) then + for I := 0 to InternalButtons.Count - 1 do + if Buttons[I].Enabled then + List.Add(Buttons[I]); +end; + +procedure TcxCustomRadioGroup.PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); +begin + if ADisplayValue = -1 then + EditValue := ActiveProperties.DefaultValue + else + begin + EditValue := ActiveProperties.Items[ADisplayValue].Value; + if VarIsNull(EditValue) then + EditValue := ActiveProperties.Items[ADisplayValue].Caption; + end; +end; + +procedure TcxCustomRadioGroup.SetFocus; +var + ACheckedIndex: Integer; +begin + ACheckedIndex := GetCheckedIndex; + if (ACheckedIndex <> -1) and Buttons[ACheckedIndex].CanFocus then + Buttons[ACheckedIndex].SetFocus + else + inherited SetFocus; +end; + +procedure TcxCustomRadioGroup.CursorChanged; +var + I: Integer; +begin + inherited CursorChanged; + for I := 0 to InternalButtons.Count - 1 do + Buttons[I].Cursor := Cursor; +end; + +function TcxCustomRadioGroup.GetButtonDC(AButtonIndex: Integer): THandle; +begin + Result := Buttons[AButtonIndex].Canvas.Handle; +end; + +procedure TcxCustomRadioGroup.Initialize; +begin + inherited Initialize; + {$IFDEF DELPHI7} + ControlStyle := ControlStyle * [csParentBackground]; + {$ELSE} + ControlStyle := []; + {$ENDIF} + ControlStyle := ControlStyle + [csCaptureMouse, csClickEvents, csSetCaption, + csDoubleClicks, csReplicatable]; + + FLoadedItemIndex := -1; + Width := 185; + Height := 105; +end; + +procedure TcxCustomRadioGroup.InternalSetEditValue(const Value: TcxEditValue; + AValidateEditValue: Boolean); +begin + SetInternalValues(Value, AValidateEditValue, False); +end; + +function TcxCustomRadioGroup.IsContainerFocused: Boolean; +var + AIsButtonFocused: Boolean; + I: Integer; +begin + AIsButtonFocused := False; + for I := 0 to ActiveProperties.Items.Count - 1 do + if Buttons[I].Focused then + begin + AIsButtonFocused := True; + Break; + end; + if AIsButtonFocused then + Result := False + else + Result := inherited Focused; +end; + +function TcxCustomRadioGroup.IsDBEditPaintCopyDrawing: Boolean; +begin + Result := not FSkinsPaintCopy and inherited IsDBEditPaintCopyDrawing; +end; + +function TcxCustomRadioGroup.IsInternalControl(AControl: TControl): Boolean; +var + I: Integer; +begin + Result := AControl <> nil; + if Result then + begin + Result := inherited IsInternalControl(AControl); + if not Result then + for I := 0 to InternalButtons.Count - 1 do + if AControl = InternalButtons[I] then + begin + Result := True; + Exit; + end; + end; +end; + +procedure TcxCustomRadioGroup.SetDragMode(Value: TDragMode); +var + I: Integer; +begin + inherited SetDragMode(Value); + for I := 0 to InternalButtons.Count - 1 do + Buttons[I].DragMode := Value; +end; + +procedure TcxCustomRadioGroup.SetInternalValues(const AEditValue: TcxEditValue; + AValidateEditValue, AFromButtonChecked: Boolean); + + procedure FocusButton(AIndex: Integer); + begin + if Focused and (GetFocus <> Handle) then + Buttons[AIndex].SetFocus; + end; + + procedure SetButtonCheck(AItemIndex: Integer); + begin + if AFromButtonChecked then + FocusButton(AItemIndex) + else + begin + if AItemIndex < 0 then + Buttons[ItemIndex].InternalSetChecked(False) + else + begin + Buttons[AItemIndex].InternalSetChecked(True); + FocusButton(AItemIndex); + end; + if IsLoading or IsDesigning then + FLoadedItemIndex := AItemIndex; + end; + end; + +var + AItemIndex: Integer; +begin + LockChangeEvents(True); + try + inherited InternalSetEditValue(AEditValue, AValidateEditValue); + AItemIndex := ActiveProperties.GetRadioGroupItemIndex(AEditValue); + if AFromButtonChecked or (GetCheckedIndex <> AItemIndex) then + begin + SetButtonCheck(AItemIndex); + DoClick; + DoChange; + end + else + if not KeyboardAction then + EditModified := False; + finally + LockChangeEvents(False); + end; + ShortRefreshContainer(False); +end; + +procedure TcxCustomRadioGroup.SynchronizeButtonsStyle; +const + AButtonLookAndFeelKinds: array [TcxEditButtonStyle] of TcxLookAndFeelKind = + (lfStandard, lfStandard, lfFlat, lfStandard, lfStandard, + lfUltraFlat, lfOffice11); +var + I: Integer; +begin + inherited SynchronizeButtonsStyle; + if Length(ViewInfo.ButtonsInfo) > 0 then + for I := 0 to InternalButtons.Count - 1 do + begin + Buttons[I].LookAndFeel.Kind := AButtonLookAndFeelKinds[ViewInfo.ButtonsInfo[0].Data.Style]; + if not Buttons[I].Enabled then + Buttons[I].Font.Color := StyleDisabled.GetVisibleFont.Color; + Buttons[I].Transparent := Transparent; // Repaint buttons + end; +end; + +procedure TcxCustomRadioGroup.Resize; +begin + inherited Resize; + if IsDesigning and IsNativeBackground then + InvalidateRect(GetControlRect(Self), True); +end; + +procedure TcxCustomRadioGroup.ParentBackgroundChanged; +var + I: Integer; +begin + for I := 0 to InternalButtons.Count - 1 do + Buttons[I].ParentBackground := ParentBackground; +end; + +procedure TcxCustomRadioGroup.SetDragKind(Value: TDragKind); +var + I: Integer; +begin + inherited SetDragKind(Value); + for I := 0 to InternalButtons.Count - 1 do + Buttons[I].DragKind := Value; +end; + +procedure TcxCustomRadioGroup.ArrangeButtons; +var + AButtonViewInfo: TcxGroupBoxButtonViewInfo; + I: Integer; +begin + inherited ArrangeButtons; + for I := 0 to InternalButtons.Count - 1 do + begin + AButtonViewInfo := TcxGroupBoxButtonViewInfo(ViewInfo.ButtonsInfo[I]); + Buttons[I].FColumn := AButtonViewInfo.Column; + Buttons[I].FRow := AButtonViewInfo.Row; + end; +end; + +function TcxCustomRadioGroup.GetButtonInstance: TWinControl; +begin + Result := TcxCustomRadioGroupButton.Create(Self); +end; + +procedure TcxCustomRadioGroup.UpdateButtons; +var + I: Integer; + AItemIndex: Integer; +begin + AItemIndex := ItemIndex; + inherited UpdateButtons; + if IsLoading then + Exit; + if GetCheckedIndex <> AItemIndex then + ItemIndex := AItemIndex; + + for I := 0 to InternalButtons.Count - 1 do + begin + Buttons[I].Caption := ActiveProperties.Items[I].Caption; + Buttons[I].WordWrap := ActiveProperties.WordWrap; + end; +end; + +procedure TcxCustomRadioGroup.AfterLoading; +begin + LockChangeEvents(True); + LockClick(True); + try + if not IsDBEdit then + FEditValue := ActiveProperties.DefaultValue; + ItemIndex := FLoadedItemIndex; + finally + LockClick(False); + LockChangeEvents(False, False); + end; + UpdateButtons; +end; + +function TcxCustomRadioGroup.IsLoading: Boolean; +begin + Result := [csReading, csLoading, csUpdating] * ComponentState <> []; +end; + +procedure TcxCustomRadioGroup.Loaded; +begin + inherited; + AfterLoading; +end; + +procedure TcxCustomRadioGroup.Updated; +begin + inherited; + AfterLoading; +end; + +procedure TcxCustomRadioGroup.GetChildren(Proc: TGetChildProc; Root: TComponent); +begin +end; + +procedure TcxCustomRadioGroup.ButtonChecked(AButton: TcxCustomRadioGroupButton); +var + AEditValue: TcxEditValue; +begin + LockChangeEvents(True); + try + KeyboardAction := Focused; + try + if not IsLoading then + begin + PrepareEditValue(InternalButtons.IndexOf(AButton), AEditValue, InternalFocused); + SetInternalValues(AEditValue, True, True); + end; + finally + KeyboardAction := False; + end; + if Focused and ActiveProperties.ImmediatePost and CanPostEditValue and ValidateEdit(True) then + InternalPostEditValue; + finally + LockChangeEvents(False); + end; +end; + +function TcxCustomRadioGroup.GetCheckedIndex: Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to InternalButtons.Count - 1 do + if Buttons[I].Checked then + begin + Result := I; + Break; + end; +end; + +function TcxCustomRadioGroup.GetButton(Index: Integer): TcxCustomRadioGroupButton; +begin + Result := TcxCustomRadioGroupButton(InternalButtons[Index]); +end; + +function TcxCustomRadioGroup.GetProperties: TcxCustomRadioGroupProperties; +begin + Result := TcxCustomRadioGroupProperties(FProperties); +end; + +function TcxCustomRadioGroup.GetActiveProperties: TcxCustomRadioGroupProperties; +begin + Result := TcxCustomRadioGroupProperties(InternalGetActiveProperties); +end; + +function TcxCustomRadioGroup.GetItemIndex: Integer; +begin + if IsLoading or IsDesigning then + Result := FLoadedItemIndex + else + Result := GetCheckedIndex; +end; + +function TcxCustomRadioGroup.GetViewInfo: TcxCustomRadioGroupViewInfo; +begin + Result := TcxCustomRadioGroupViewInfo(FViewInfo); +end; + +procedure TcxCustomRadioGroup.SetItemIndex(Value: Integer); + + procedure InternalUpdateValues; + var + AEditValue: TcxEditValue; + begin + if Value < -1 then + Value := -1 + else + if Value >= InternalButtons.Count then + Value := InternalButtons.Count - 1; + + PrepareEditValue(Value, AEditValue, InternalFocused); + SetInternalValues(AEditValue, True, False); + end; + +begin + if not IsLoading then + InternalUpdateValues; + if IsLoading or IsDesigning then + FLoadedItemIndex := Value; +end; + +procedure TcxCustomRadioGroup.SetProperties(Value: TcxCustomRadioGroupProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomRadioGroup.CMDialogChar(var Message: TCMDialogChar); +begin + if IsAccel(Message.CharCode, Caption) and CanFocus then + begin + SelectFirst; + Message.Result := 1; + end + else + inherited; +end; + +procedure TcxCustomRadioGroup.CMCtl3DChanged(var Message: TMessage); +begin + inherited; + ShortRefreshContainer(False); +end; + +{ TcxRadioGroup } + +class function TcxRadioGroup.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxRadioGroupProperties; +end; + +function TcxRadioGroup.GetActiveProperties: TcxRadioGroupProperties; +begin + Result := TcxRadioGroupProperties(InternalGetActiveProperties); +end; + +function TcxRadioGroup.GetProperties: TcxRadioGroupProperties; +begin + Result := TcxRadioGroupProperties(FProperties); +end; + +procedure TcxRadioGroup.SetProperties(Value: TcxRadioGroupProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxFilterRadioGroupHelper } + +class procedure TcxFilterRadioGroupHelper.GetFilterValue( + AEdit: TcxCustomEdit; AEditProperties: TcxCustomEditProperties; + var V: Variant; var S: TCaption); +var + AItemIndex: Integer; +begin + AItemIndex := TcxComboBox(AEdit).ItemIndex; + with TcxCustomRadioGroupProperties(AEditProperties) do + begin + if AItemIndex = -1 then + begin + V := DefaultValue; + S := DefaultCaption; + end + else + begin + V := Items[AItemIndex].Value; + S := Items[AItemIndex].Caption; + end; + end; +end; + +class function TcxFilterRadioGroupHelper.GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean): TcxFilterControlOperators; +begin + Result := [fcoEqual, fcoNotEqual, fcoBlanks, fcoNonBlanks]; + if AExtendedSet then Result := Result + [fcoInList, fcoNotInList]; +end; + +class procedure TcxFilterRadioGroupHelper.InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); +var + ARadioGroupProperties: TcxCustomRadioGroupProperties; + I: Integer; +begin + ARadioGroupProperties := TcxCustomRadioGroupProperties(AEditProperties); + with TcxComboBoxProperties(AProperties).Items do + begin + Clear; + for I := 0 to ARadioGroupProperties.Items.Count - 1 do + Add(ARadioGroupProperties.Items[I].Caption); + end; + TcxComboBoxProperties(AProperties).DropDownListStyle := lsFixedList; + TcxComboBoxProperties(AProperties).IDefaultValuesProvider := nil; + ClearPropertiesEvents(AProperties); +end; + +class procedure TcxFilterRadioGroupHelper.SetFilterValue( + AEdit: TcxCustomEdit; AEditProperties: TcxCustomEditProperties; + AValue: Variant); +var + V: TcxEditValue; +begin + AEditProperties.PrepareDisplayValue(AValue, V, AEdit.Focused); + TcxComboBox(AEdit).ItemIndex := V; +end; + +class function TcxFilterRadioGroupHelper.UseDisplayValue: Boolean; +begin + Result := True; +end; + +initialization + GetRegisteredEditProperties.Register(TcxRadioGroupProperties, scxSEditRepositoryRadioGroupItem); + FilterEditsController.Register(TcxRadioGroupProperties, TcxFilterRadioGroupHelper); + +finalization + FilterEditsController.Unregister(TcxRadioGroupProperties, TcxFilterRadioGroupHelper); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxRegExpr.pas b/official/x.35/ExpressEditors Library 5/Sources/cxRegExpr.pas new file mode 100644 index 00000000..ad857e6d --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxRegExpr.pas @@ -0,0 +1,3115 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxRegExpr; + +{$I cxVer.inc} + +interface + +uses + SysUtils, Classes, cxClasses, cxEdit, cxEditConsts; + +type + { TcxRegExprError } + + TcxRegExprError = class + private + FChar: Integer; + FLine: Integer; + FMessage: string; + function GetFullMessage: string; + public + constructor Create(ALine: Integer; AChar: Integer; AMessage: string); + function Clone: TcxRegExprError; + property Char: Integer read FChar; + property FullMessage: string read GetFullMessage; + property Line: Integer read FLine; + property Message: string read FMessage; + end; + + { TcxRegExprErrors } + + TcxRegExprErrors = class + private + FErrors: TList; + function GetCount: Integer; + function GetItems(Index: Integer): TcxRegExprError; + public + constructor Create; + destructor Destroy; override; + procedure Add(AError: TcxRegExprError); + procedure Clear; + function Clone: TcxRegExprErrors; + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxRegExprError read GetItems; default; + end; + + { EcxRegExprError } + + EcxRegExprError = class(EcxEditError) + private + FErrors: TcxRegExprErrors; + public + constructor Create(AErrors: TcxRegExprErrors); + property Errors: TcxRegExprErrors read FErrors; + end; + + { TcxLexem } + + TcxLexem = record + Char: Integer; + Code: Integer; + Line: Integer; + Value: string; + end; + PcxLexem = ^TcxLexem; + + { TcxRegExprLexemCode } + + TcxRegExprLexemCode = + ( + relcSymbol, + relcSpecial, + relcInteger, + relcAll, + relcId, + relcNotId, + relcDigit, + relcNotDigit, + relcSpace, + relcNotSpace, + relcReference, + relcDateSeparator, + relcTimeSeparator + ); + + { TcxLexems } + + TcxLexems = class + private + FLexems: TList; + function GetCount: Integer; + function GetItems(Index: Integer): TcxLexem; + public + constructor Create; + destructor Destroy; override; + procedure Add(ALexem: TcxLexem); + procedure Clear; + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxLexem read GetItems; default; + end; + + { TcxRegExprItem } + + TcxRegExprItem = class + public + function Check(var AToken: Char; ACaseInsensitive: Boolean): Boolean; virtual; abstract; + function Clone: TcxRegExprItem; virtual; abstract; + end; + + { TcxRegExprSymbol } + + TcxRegExprSymbol = class(TcxRegExprItem) + private + FValue: Char; + public + constructor Create(AValue: Char); + function Check(var AToken: Char; ACaseInsensitive: Boolean): Boolean; override; + function Clone: TcxRegExprItem; override; + end; + + { TcxRegExprTimeSeparator } + + TcxRegExprTimeSeparator = class(TcxRegExprItem) + public + function Check(var AToken: Char; ACaseInsensitive: Boolean): Boolean; override; + function Clone: TcxRegExprItem; override; + function Value: Char; + end; + + { TcxRegExprDateSeparator } + + TcxRegExprDateSeparator = class(TcxRegExprItem) + public + function Check(var AToken: Char; ACaseInsensitive: Boolean): Boolean; override; + function Clone: TcxRegExprItem; override; + function Value: Char; + end; + + { TcxRegExprSubrange } + + TcxRegExprSubrange = class(TcxRegExprItem) + private + FStartValue: Char; + FFinishValue: Char; + public + constructor Create(AStartValue: Char; AFinishValue: Char); + function Check(var AToken: Char; ACaseInsensitive: Boolean): Boolean; override; + function Clone: TcxRegExprItem; override; + end; + + { TcxRegExprEnumeration } + + TcxRegExprEnumeration = class(TcxRegExprItem) + private + FInverse: Boolean; + public + constructor Create(AInverse: Boolean = False); + end; + + { TcxRegExprUserEnumeration } + + TcxRegExprUserEnumeration = class(TcxRegExprEnumeration) + private + FItems: TList; + function Item(AIndex: Integer): TcxRegExprItem; + public + constructor Create(AInverse: Boolean = False); + destructor Destroy; override; + procedure Add(AItem: TcxRegExprItem); + function Check(var AToken: Char; ACaseInsensitive: Boolean): Boolean; override; + function Clone: TcxRegExprItem; override; + end; + + { TcxRegExprDigit } + + TcxRegExprDigit = class(TcxRegExprEnumeration) + public + constructor Create(AInverse: Boolean = False); + function Check(var AToken: Char; ACaseInsensitive: Boolean): Boolean; override; + function Clone: TcxRegExprItem; override; + end; + + { TcxRegExprIdLetter } + + TcxRegExprIdLetter = class(TcxRegExprEnumeration) + public + constructor Create(AInverse: Boolean = False); + function Check(var AToken: Char; ACaseInsensitive: Boolean): Boolean; override; + function Clone: TcxRegExprItem; override; + end; + + { TcxRegExprSpace } + + TcxRegExprSpace = class(TcxRegExprEnumeration) + public + constructor Create(AInverse: Boolean = False); + function Check(var AToken: Char; ACaseInsensitive: Boolean): Boolean; override; + function Clone: TcxRegExprItem; override; + end; + + { TcxRegExprAll } + + TcxRegExprAll = class(TcxRegExprItem) + public + function Check(var AToken: Char; ACaseInsensitive: Boolean): Boolean; override; + function Clone: TcxRegExprItem; override; + end; + + TcxRegExprStates = class; + + { TcxRegExprState } + + TcxRegExprState = class + protected + FStates: TcxRegExprStates; + public + constructor Create; + destructor Destroy; override; + procedure Add(AState: TcxRegExprState); overload; + procedure Add(AStates: TcxRegExprStates); overload; + function Check(var AToken: Char; ACaseInsensitive: Boolean): TcxRegExprStates; virtual; + function Clone: TcxRegExprState; virtual; + function GetAllNextStates: TcxRegExprStates; + function GetSelf: TcxRegExprStates; virtual; + function Next(var AToken: Char; ACaseInsensitive: Boolean): TcxRegExprStates; + property States: TcxRegExprStates read FStates; + end; + + { TcxRegExprSimpleState } + + TcxRegExprSimpleState = class(TcxRegExprState) + private + FIsFinal: Boolean; + FValue: TcxRegExprItem; + public + constructor Create(AValue: TcxRegExprItem); + destructor Destroy; override; + function Check(var AToken: Char; ACaseInsensitive: Boolean): TcxRegExprStates; override; + function Clone: TcxRegExprState; override; + function GetSelf: TcxRegExprStates; override; + procedure SetFinal; + property IsFinal: Boolean read FIsFinal; + end; + + { TcxRegExprBlockState } + + TcxRegExprBlockState = class(TcxRegExprState) + public + function Check(var AToken: Char; ACaseInsensitive: Boolean): TcxRegExprStates; override; + function Clone: TcxRegExprState; override; + function GetSelf: TcxRegExprStates; override; + end; + + { TcxRegExprStates } + + TcxRegExprStates = class + private + FStates: TList; + function GetCount: Integer; + function GetState(AIndex: Integer): TcxRegExprState; + public + constructor Create; + destructor Destroy; override; + procedure Add(AState: TcxRegExprState); overload; + procedure Add(AStates: TcxRegExprStates); overload; + procedure Clear; + function Equ(var ASymbol: Char): Boolean; + function GetAllNextStates: TcxRegExprStates; + function IsFinal: Boolean; + function Next(var AToken: Char; ACaseInsensitive: Boolean): TcxRegExprStates; + property Count: Integer read GetCount; + property State[AIndex: Integer]: TcxRegExprState read GetState; default; + end; + + TcxRegExprParserAlts = class; + TcxRegExpr = class; + + { TcxRegExprAutomat } + + TcxRegExprAutomat = class + private + FCurrentStates: TcxRegExprStates; + FExpr: TcxRegExprParserAlts; + FHistory: TList; + FOwner: TcxRegExpr; + FStartState: TcxRegExprSimpleState; + function GetAllNextStates: TcxRegExprStates; + function Pop: TcxRegExprStates; + procedure Push(AStates: TcxRegExprStates); + public + constructor Create(AExpr: TcxRegExprParserAlts; AOwner: TcxRegExpr); + destructor Destroy; override; + function IsFinal: Boolean; + function IsStart: Boolean; + function Next(var AToken: Char; ACaseInsensitive: Boolean): Boolean; + function Prev: Boolean; + function Print: string; + procedure Reset; + procedure ReUpdate; + procedure Update; + end; + + { TcxRegExprQuantifier } + + TcxRegExprQuantifier = class + public + function CanMissing: Boolean; virtual; abstract; + function CanRepeat: Boolean; virtual; abstract; + function Clone: TcxRegExprQuantifier; virtual; abstract; + function Print: string; virtual; abstract; + end; + + { TcxRegExprSimpleQuantifier } + + TcxRegExprSimpleQuantifier = class(TcxRegExprQuantifier) // missing quantifier + public + function CanMissing: Boolean; override; + function CanRepeat: Boolean; override; + function Clone: TcxRegExprQuantifier; override; + function Print: string; override; + end; + + { TcxRegExprQuestionQuantifier } + + TcxRegExprQuestionQuantifier = class(TcxRegExprQuantifier) // ? + public + function CanMissing: Boolean; override; + function CanRepeat: Boolean; override; + function Clone: TcxRegExprQuantifier; override; + function Print: string; override; + end; + + { TcxRegExprStarQuantifier } + + TcxRegExprStarQuantifier = class(TcxRegExprQuantifier) // * + public + function CanMissing: Boolean; override; + function CanRepeat: Boolean; override; + function Clone: TcxRegExprQuantifier; override; + function Print: string; override; + end; + + { TcxRegExprPlusQuantifier } + + TcxRegExprPlusQuantifier = class(TcxRegExprQuantifier) // + + public + function CanMissing: Boolean; override; + function CanRepeat: Boolean; override; + function Clone: TcxRegExprQuantifier; override; + function Print: string; override; + end; + + { TcxRegExprParserItem } + + TcxRegExprParserItem = class + private + FQuantifier: TcxRegExprQuantifier; + public + constructor Create(AQuantifier: TcxRegExprQuantifier = nil); + destructor Destroy; override; + function CanEmpty: Boolean; virtual; abstract; + function CanMissing: Boolean; + function CanRepeat: Boolean; + function Clone: TcxRegExprParserItem; virtual; abstract; + function NotQuantifier: Boolean; + function Print: string; virtual; abstract; + procedure SetFinal; virtual; abstract; + procedure SetQuantifier(AQuantifier: TcxRegExprQuantifier); + end; + + { TcxRegExprParserSimpleItem } + + TcxRegExprParserSimpleItem = class(TcxRegExprParserItem) + private + FState: TcxRegExprState; + public + constructor Create(AState: TcxRegExprState; AQuantifier: TcxRegExprQuantifier = nil); + destructor Destroy; override; + function CanEmpty: Boolean; override; + function Clone: TcxRegExprParserItem; override; + function Print: string; override; + procedure SetFinal; override; + property State: TcxRegExprState read FState; + end; + + TcxRegExprParserAlt = class; + + { TcxRegExprParserBlockItem } + + TcxRegExprParserBlockItem = class(TcxRegExprParserItem) + private + FAlts: TcxRegExprParserAlts; + FFinishState: TcxRegExprState; + FStartState: TcxRegExprState; + public + constructor Create(AQuantifier: TcxRegExprQuantifier = nil); + destructor Destroy; override; + function CanEmpty: Boolean; override; + procedure CreateConnections; + procedure AddAlt(AAlt: TcxRegExprParserAlt); + procedure AddAlts(AAlts: TcxRegExprParserAlts); + function Clone: TcxRegExprParserItem; override; + function Print: string; override; + procedure SetFinal; override; + property Alts: TcxRegExprParserAlts read FAlts; + property FinishState: TcxRegExprState read FFinishState; + property StartState: TcxRegExprState read FStartState; + end; + + { TcxRegExprParserAlt } + + TcxRegExprParserAlt = class + private + FItems: TList; + function GetCount: Integer; + function GetFirstItem: TcxRegExprParserItem; + function GetItem(AIndex: Integer): TcxRegExprParserItem; + function GetLastItem: TcxRegExprParserItem; + procedure SetLastItem(AItem: TcxRegExprParserItem); + public + constructor Create; + destructor Destroy; override; + procedure Add(AItem: TcxRegExprParserItem); + function CanEmpty: Boolean; + function CanMissing: Boolean; + function Clone: TcxRegExprParserAlt; + procedure CreateConnections; + procedure CreateFinalStates; + function GetStartConnections: TcxRegExprStates; + function Print: string; + procedure SetFinishConnection(AFinishState: TcxRegExprState); + property Count: Integer read GetCount; + property FirstItem: TcxRegExprParserItem read GetFirstItem; + property Item[AIndex: Integer]: TcxRegExprParserItem read GetItem; default; + property LastItem: TcxRegExprParserItem read GetLastItem write SetLastItem; + end; + + { TcxRegExprParserAlts } + + TcxRegExprParserAlts = class + private + FAlts: TList; + function GetAlt(AIndex: Integer): TcxRegExprParserAlt; + function GetCount: Integer; + function GetLastAlt: TcxRegExprParserAlt; + public + constructor Create; + destructor Destroy; override; + procedure Add(AAlt: TcxRegExprParserAlt); + procedure AddAlt; + function CanEmpty: Boolean; + procedure CreateConnections; + procedure CreateFinalStates; + function Clone: TcxRegExprParserAlts; + function GetStartConnections: TcxRegExprStates; + function Print: string; + procedure SetFinishConnections(AFinishState: TcxRegExprState); + function StartStateIsFinal: Boolean; + function ThereIsEmptyAlt: Boolean; + property Alt[AIndex: Integer]: TcxRegExprParserAlt read GetAlt; default; + property Count: Integer read GetCount; + property LastAlt: TcxRegExprParserAlt read GetLastAlt; + end; + + TcxSymbolDeleteEvent = procedure of object; + TcxSymbolUpdateEvent = procedure(ASymbol: Char) of object; + + { TcxRegExpr } + + TcxRegExpr = class + private + FAutomat: TcxRegExprAutomat; + FBlocks: TList; + FChar: Integer; + FCaseInsensitive: Boolean; + FCompiled: Boolean; + FErrors: TcxRegExprErrors; + FFirstExpr: Boolean; + FIndex: Integer; + FLexemIndex: Integer; + FLexems: TcxLexems; + FLine: Integer; + FOnSymbolDelete: TcxSymbolDeleteEvent; + FOnSymbolUpdate: TcxSymbolUpdateEvent; + FStream: TMemoryStream; + FUpdateOn: Boolean; + procedure Clear; + function Decimal(AToken: Char): Boolean; + function EmptyStream: Boolean; + function CreateLexem(ALine: Integer; AChar: Integer; ACode: Integer; + AValue: string): TcxLexem; + function GetLexem(var ALexem: TcxLexem): Boolean; + function GetToken(out AToken: Char): Boolean; + function GetStream: TStream; + function Hexadecimal(AToken: Char): Boolean; + function LookToken(out AToken: Char; APtr: Integer): Boolean; + function ParseAlt(AAlt: TcxRegExprParserAlt; Global: Boolean = True): Boolean; + function ParseBlock: TcxRegExprParserBlockItem; + function ParseEnumeration: TcxRegExprParserSimpleItem; + procedure ParseExpr; + procedure ParseQuantifier(var A: Integer; var B: Integer); + procedure ScanASCII(ALine: Integer; AChar: Integer); + procedure ScanClass; + procedure ScanExpr; + procedure ScanEscape(ALine: Integer; AChar: Integer); + function ScanInteger(ALine: Integer; AChar: Integer; var AToken: Char): Boolean; + procedure ScanQuantifier; + procedure ScanString; + procedure SetUpdateOn(AUpdateOn: Boolean); + function Space(AToken: Char): Boolean; + procedure SymbolDelete; + procedure SymbolUpdate(ASymbol: Char); + procedure TestCompiledStatus; + public + constructor Create; + destructor Destroy; override; + procedure Compile(AStream: TStream); + function IsCompiled: Boolean; + function IsFinal: Boolean; + function IsStart: Boolean; + function Next(var AToken: Char): Boolean; + function NextEx(const AString: string): string; + function Prev: Boolean; + function Print: string; + procedure Reset; + property CaseInsensitive: Boolean read FCaseInsensitive write FCaseInsensitive; + property Stream: TStream read GetStream; + property UpdateOn: Boolean read FUpdateOn write SetUpdateOn; + property OnSymbolDelete: TcxSymbolDeleteEvent read FOnSymbolDelete write FOnSymbolDelete; + property OnSymbolUpdate: TcxSymbolUpdateEvent read FOnSymbolUpdate write FOnSymbolUpdate; + end; + + function IsTextFullValid(const AText, AMask: string): Boolean; + function IsTextValid(const AText, AMask: string): Boolean; + +implementation + +{ TcxRegExprError } + +constructor TcxRegExprError.Create(ALine, AChar: Integer; AMessage: string); +begin + inherited Create; + FLine := ALine; + FChar := AChar; + FMessage := AMessage; +end; + +function TcxRegExprError.Clone: TcxRegExprError; +begin + Result := TcxRegExprError.Create(FLine, FChar, FMessage); +end; + +function TcxRegExprError.GetFullMessage: string; +begin + Result := ''; + if FLine > 0 then + begin + Result := Result + cxGetResourceString(@scxRegExprLine) + IntToStr(FLine); + if FChar > 0 then + Result := Result + ', ' + cxGetResourceString(@scxRegExprChar) + IntToStr(FChar); + Result := Result + ': '; + end; + Result := Result + FMessage; +end; + +{ TcxRegExprErrors } + +constructor TcxRegExprErrors.Create; +begin + inherited Create; + FErrors := TList.Create; +end; + +destructor TcxRegExprErrors.Destroy; +begin + Clear; + FErrors.Free; + inherited Destroy; +end; + +procedure TcxRegExprErrors.Add(AError: TcxRegExprError); +begin + FErrors.Add(AError); +end; + +procedure TcxRegExprErrors.Clear; +var + I: Integer; +begin + for I := 0 to FErrors.Count - 1 do + TcxRegExprError(FErrors[I]).Free; + FErrors.Clear; +end; + +function TcxRegExprErrors.Clone: TcxRegExprErrors; +var + I: Integer; +begin + Result := TcxRegExprErrors.Create; + + for I := 0 to Count - 1 do + Result.Add(Items[I].Clone); +end; + +function TcxRegExprErrors.GetCount: Integer; +begin + Result := FErrors.Count; +end; + +function TcxRegExprErrors.GetItems(Index: Integer): TcxRegExprError; +begin + Result := TcxRegExprError(FErrors[Index]); +end; + +{ EcxRegExprError } + +constructor EcxRegExprError.Create(AErrors: TcxRegExprErrors); +begin + FErrors := AErrors; +end; + +{ TcxLexems } + +constructor TcxLexems.Create; +begin + inherited Create; + FLexems := TList.Create; +end; + +destructor TcxLexems.Destroy; +begin + Clear; + FLexems.Free; + inherited Destroy; +end; + +procedure TcxLexems.Add(ALexem: TcxLexem); +var + LexemP: PcxLexem; +begin + New(LexemP); + LexemP^ := ALexem; + FLexems.Add(LexemP); +end; + +procedure TcxLexems.Clear; +var + I: Integer; +begin + for I := 0 to FLexems.Count - 1 do + Dispose(PcxLexem(FLexems[I])); + FLexems.Clear; +end; + +function TcxLexems.GetCount: Integer; +begin + Result := FLexems.Count; +end; + +function TcxLexems.GetItems(Index: Integer): TcxLexem; +begin + Result := PcxLexem(FLexems[Index])^; +end; + +{ TcxRegExprSymbol } + +constructor TcxRegExprSymbol.Create(AValue: Char); +begin + inherited Create; + FValue := AValue; +end; + +function TcxRegExprSymbol.Check(var AToken: Char; ACaseInsensitive: Boolean): Boolean; +begin + if ACaseInsensitive then + begin + Result := AnsiUpperCase(AToken) = AnsiUpperCase(FValue); + if Result then + AToken := FValue; + end + else + Result := AToken = FValue; +end; + +function TcxRegExprSymbol.Clone: TcxRegExprItem; +begin + Result := TcxRegExprSymbol.Create(FValue); +end; + +{ TcxRegExprTimeSeparator } + +function TcxRegExprTimeSeparator.Check(var AToken: Char; + ACaseInsensitive: Boolean): Boolean; +begin + Result := AToken = Value; +end; + +function TcxRegExprTimeSeparator.Clone: TcxRegExprItem; +begin + Result := TcxRegExprTimeSeparator.Create; +end; + +function TcxRegExprTimeSeparator.Value: Char; +begin + Result := TimeSeparator; +end; + +{ TcxRegExprDateSeparator } + +function TcxRegExprDateSeparator.Check(var AToken: Char; + ACaseInsensitive: Boolean): Boolean; +begin + Result := AToken = Value; +end; + +function TcxRegExprDateSeparator.Clone: TcxRegExprItem; +begin + Result := TcxRegExprDateSeparator.Create; +end; + +function TcxRegExprDateSeparator.Value: Char; +begin + Result := DateSeparator; +end; + +{ TcxRegExprSubrange } + +constructor TcxRegExprSubrange.Create(AStartValue, AFinishValue: Char); +begin + inherited Create; + FStartValue := AStartValue; + FFinishValue := AFinishValue; +end; + +function TcxRegExprSubrange.Check(var AToken: Char; ACaseInsensitive: Boolean): Boolean; +begin + Result := (AToken >= FStartValue) and (AToken <= FFinishValue); +end; + +function TcxRegExprSubrange.Clone: TcxRegExprItem; +begin + Result := TcxRegExprSubrange.Create(FStartValue, FFinishValue); +end; + +{ TcxRegExprEnumeration } + +constructor TcxRegExprEnumeration.Create(AInverse: Boolean = False); +begin + inherited Create; + FInverse := AInverse; +end; + +{ TcxRegExprUserEnumeration } + +constructor TcxRegExprUserEnumeration.Create(AInverse: Boolean); +begin + inherited Create(AInverse); + + FItems := TList.Create; +end; + +destructor TcxRegExprUserEnumeration.Destroy; +var + I: Integer; +begin + for I := 0 to FItems.Count - 1 do + Item(I).Free; + FItems.Free; + inherited Destroy; +end; + +procedure TcxRegExprUserEnumeration.Add(AItem: TcxRegExprItem); +begin + FItems.Add(AItem); +end; + +function TcxRegExprUserEnumeration.Check(var AToken: Char; ACaseInsensitive: Boolean): Boolean; +var + I: Integer; +begin + for I := 0 to FItems.Count - 1 do + if Item(I).Check(AToken, ACaseInsensitive) then + begin + Result := not FInverse; + Exit; + end; + + Result := FInverse; +end; + +function TcxRegExprUserEnumeration.Item(AIndex: Integer): TcxRegExprItem; +begin + Result := TcxRegExprItem(FItems[AIndex]); +end; + +function TcxRegExprUserEnumeration.Clone: TcxRegExprItem; +var + I: Integer; +begin + Result := TcxRegExprUserEnumeration.Create(FInverse); + + for I := 0 to FItems.Count - 1 do + TcxRegExprUserEnumeration(Result).Add(Item(I).Clone); +end; + +{ TcxRegExprDigit } + +constructor TcxRegExprDigit.Create(AInverse: Boolean); +begin + inherited Create(AInverse); +end; + +function TcxRegExprDigit.Check(var AToken: Char; ACaseInsensitive: Boolean): Boolean; +begin + if (AToken >= '0') and (AToken <= '9') then + Result := not FInverse + else + Result := FInverse; +end; + +function TcxRegExprDigit.Clone: TcxRegExprItem; +begin + Result := TcxRegExprDigit.Create(FInverse); +end; + +{ TcxRegExprIdLetter } + +constructor TcxRegExprIdLetter.Create(AInverse: Boolean); +begin + inherited Create(AInverse); +end; + +function TcxRegExprIdLetter.Check(var AToken: Char; ACaseInsensitive: Boolean): Boolean; +begin + if ((AToken >= 'a') and (AToken <= 'z')) or (AToken = '_') or + ((AToken >= 'A') and (AToken <= 'Z')) or + ((AToken >= '0') and (AToken <= '9')) then + Result := not FInverse + else + Result := FInverse; +end; + +function TcxRegExprIdLetter.Clone: TcxRegExprItem; +begin + Result := TcxRegExprIdLetter.Create(FInverse); +end; + +{ TcxRegExprSpace } + +constructor TcxRegExprSpace.Create(AInverse: Boolean); +begin + inherited Create(AInverse); +end; + +function TcxRegExprSpace.Check(var AToken: Char; ACaseInsensitive: Boolean): Boolean; +begin + if (AToken = ' ') or (AToken = #0) or (AToken = #9) or + (AToken = #10) or (AToken = #12) or (AToken = #13) then + Result := not FInverse + else + Result := FInverse; +end; + +function TcxRegExprSpace.Clone: TcxRegExprItem; +begin + Result := TcxRegExprSpace.Create(FInverse); +end; + +{ TcxRegExprAll } + +function TcxRegExprAll.Check(var AToken: Char; ACaseInsensitive: Boolean): Boolean; +begin + Result := True; +end; + +function TcxRegExprAll.Clone: TcxRegExprItem; +begin + Result := TcxRegExprAll.Create; +end; + +{ TcxRegExprState } + +constructor TcxRegExprState.Create; +begin + inherited Create; + FStates := TcxRegExprStates.Create; +end; + +destructor TcxRegExprState.Destroy; +begin + FStates.Free; + inherited Destroy; +end; + +procedure TcxRegExprState.Add(AState: TcxRegExprState); +begin + States.Add(AState); +end; + +procedure TcxRegExprState.Add(AStates: TcxRegExprStates); +begin + States.Add(AStates); +end; + +function TcxRegExprState.Check(var AToken: Char; ACaseInsensitive: Boolean): TcxRegExprStates; +begin + Result := TcxRegExprStates.Create; +end; + +function TcxRegExprState.Clone: TcxRegExprState; +begin + Result := TcxRegExprState.Create; +end; + +function TcxRegExprState.GetAllNextStates: TcxRegExprStates; +var + I: Integer; +begin + Result := TcxRegExprStates.Create; + + for I := 0 to States.Count - 1 do + Result.Add(States[I].GetSelf); +end; + +function TcxRegExprState.GetSelf: TcxRegExprStates; +begin + Result := TcxRegExprStates.Create; + + Result.Add(Self); +end; + +function TcxRegExprState.Next(var AToken: Char; ACaseInsensitive: Boolean): TcxRegExprStates; +var + I: Integer; +begin + Result := TcxRegExprStates.Create; + + for I := 0 to FStates.Count - 1 do + Result.Add(FStates[I].Check(AToken, ACaseInsensitive)); +end; + +{ TcxRegExprSimpleState } + +constructor TcxRegExprSimpleState.Create(AValue: TcxRegExprItem); +begin + inherited Create; + + FValue := AValue; + FIsFinal := False; +end; + +destructor TcxRegExprSimpleState.Destroy; +begin + if FValue <> nil then + FValue.Free; + + inherited Destroy; +end; + +function TcxRegExprSimpleState.Check(var AToken: Char; ACaseInsensitive: Boolean): TcxRegExprStates; +begin + Result := TcxRegExprStates.Create; + + if FValue.Check(AToken, ACaseInsensitive) then + Result.Add(Self); +end; + +function TcxRegExprSimpleState.Clone: TcxRegExprState; +begin + Result := TcxRegExprSimpleState.Create(FValue.Clone); +end; + +function TcxRegExprSimpleState.GetSelf: TcxRegExprStates; +begin + Result := TcxRegExprStates.Create; + + Result.Add(Self); +end; + +procedure TcxRegExprSimpleState.SetFinal; +begin + FIsFinal := True; +end; + +{ TcxRegExprBlockState } + +function TcxRegExprBlockState.Check(var AToken: Char; ACaseInsensitive: Boolean): TcxRegExprStates; +begin + Result := Next(AToken, ACaseInsensitive); +end; + +function TcxRegExprBlockState.Clone: TcxRegExprState; +begin + Result := TcxRegExprBlockState.Create; +end; + +function TcxRegExprBlockState.GetSelf: TcxRegExprStates; +var + I: Integer; +begin + Result := TcxRegExprStates.Create; + + for I := 0 to States.Count - 1 do + Result.Add(States[I].GetSelf); +end; + +{ TcxRegExprStates } + +constructor TcxRegExprStates.Create; +begin + inherited Create; + FStates := TList.Create; +end; + +destructor TcxRegExprStates.Destroy; +begin + FStates.Free; + inherited Destroy; +end; + +procedure TcxRegExprStates.Add(AState: TcxRegExprState); +begin + FStates.Add(AState); +end; + +procedure TcxRegExprStates.Add(AStates: TcxRegExprStates); +var + I: Integer; +begin + for I := 0 to AStates.Count - 1 do + Add(AStates.State[I]); + AStates.Free; +end; + +procedure TcxRegExprStates.Clear; +begin + FStates.Clear; +end; + +function TcxRegExprStates.Equ(var ASymbol: Char): Boolean; +var + I: Integer; + Flag: Boolean; +begin + if Count = 0 then + begin + Result := False; + Exit; + end; + + Flag := False; + + for I := 0 to Count - 1 do + begin + if State[I] is TcxRegExprSimpleState then + begin + with TcxRegExprSimpleState(State[I]) do + begin + if FValue is TcxRegExprSymbol then + begin + if not Flag then + begin + ASymbol := TcxRegExprSymbol(FValue).FValue; + Flag := True; + end + else + begin + if ASymbol <> TcxRegExprSymbol(FValue).FValue then + begin + Result := False; + Exit; + end; + end; + end + else if FValue is TcxRegExprTimeSeparator then + begin + if not Flag then + begin + ASymbol := TcxRegExprTimeSeparator(FValue).Value; + Flag := True; + end + else + begin + if ASymbol <> TcxRegExprTimeSeparator(FValue).Value then + begin + Result := False; + Exit; + end; + end; + end + else if FValue is TcxRegExprDateSeparator then + begin + if not Flag then + begin + ASymbol := TcxRegExprDateSeparator(FValue).Value; + Flag := True; + end + else + begin + if ASymbol <> TcxRegExprDateSeparator(FValue).Value then + begin + Result := False; + Exit; + end; + end; + end + else + begin + Result := False; + Exit; + end; + end; + end + else + begin + Result := False; + Exit; + end; + end; + + Result := True; +end; + +function TcxRegExprStates.GetAllNextStates: TcxRegExprStates; +var + I: Integer; +begin + Result := TcxRegExprStates.Create; + + for I := 0 to Count - 1 do + Result.Add(State[I].GetAllNextStates); +end; + +function TcxRegExprStates.IsFinal: Boolean; +var + I: Integer; +begin + for I := 0 to Count - 1 do + if TcxRegExprSimpleState(State[I]).IsFinal then + begin + Result := True; + Exit; + end; + + Result := False; +end; + +function TcxRegExprStates.Next(var AToken: Char; ACaseInsensitive: Boolean): TcxRegExprStates; +var + I: Integer; +begin + Result := TcxRegExprStates.Create; + + for I := 0 to Count - 1 do + Result.Add(State[I].Next(AToken, ACaseInsensitive)); +end; + +function TcxRegExprStates.GetCount: Integer; +begin + Result := FStates.Count; +end; + +function TcxRegExprStates.GetState(AIndex: Integer): TcxRegExprState; +begin + Result := TcxRegExprState(FStates[AIndex]); +end; + +{ TcxRegExprAutomat } + +constructor TcxRegExprAutomat.Create(AExpr: TcxRegExprParserAlts; AOwner: TcxRegExpr); +begin + inherited Create; + FHistory := TList.Create; + FExpr := AExpr; + FStartState := TcxRegExprSimpleState.Create(nil); + FStartState.Add(FExpr.GetStartConnections); + if FExpr.StartStateIsFinal then + FStartState.SetFinal; + FCurrentStates := TcxRegExprStates.Create; + FCurrentStates.Add(FStartState); + FOwner := AOwner; +end; + +destructor TcxRegExprAutomat.Destroy; +var + I: Integer; +begin + for I := 0 to FHistory.Count - 1 do + TcxRegExprStates(FHistory[I]).Free; + FHistory.Free; + FCurrentStates.Free; + FExpr.Free; + FStartState.Free; + inherited Destroy; +end; + +function TcxRegExprAutomat.GetAllNextStates: TcxRegExprStates; +begin + Result := FCurrentStates.GetAllNextStates +end; + +function TcxRegExprAutomat.IsFinal: Boolean; +begin + Result := FCurrentStates.IsFinal; +end; + +function TcxRegExprAutomat.IsStart: Boolean; +begin + Result := FCurrentStates[0] = FStartState; +end; + +function TcxRegExprAutomat.Next(var AToken: Char; ACaseInsensitive: Boolean): Boolean; +var + NextStates: TcxRegExprStates; +begin + NextStates := FCurrentStates.Next(AToken, ACaseInsensitive); + if NextStates.Count > 0 then + begin + Push(FCurrentStates); + FCurrentStates := NextStates; + Result := True; + end + else + begin + NextStates.Free; + Result := False; + end; +end; + +function TcxRegExprAutomat.Prev: Boolean; +var + LastStates: TcxRegExprStates; +begin + LastStates := Pop; + if LastStates = nil then + Result := False + else + begin + FCurrentStates.Free; + FCurrentStates := LastStates; + Result := True; + end; +end; + +function TcxRegExprAutomat.Print: string; +begin + Result := FExpr.Print; +end; + +procedure TcxRegExprAutomat.Reset; +var + I: Integer; +begin + for I := 0 to FHistory.Count - 1 do + TcxRegExprStates(FHistory[I]).Free; + FHistory.Clear; + FCurrentStates.Free; + FCurrentStates := TcxRegExprStates.Create; + FCurrentStates.Add(FStartState); +end; + +procedure TcxRegExprAutomat.ReUpdate; +var + ASymbol: Char; + PrevStates: TcxRegExprStates; + AllNextStates: TcxRegExprStates; +begin + while FCurrentStates.Equ(ASymbol) do + begin + PrevStates := Pop; + if PrevStates = nil then + begin + Push(PrevStates); + Exit; + end; + + AllNextStates := PrevStates.GetAllNextStates; + if not AllNextStates.Equ(ASymbol) or PrevStates.IsFinal then + begin + Push(PrevStates); + AllNextStates.Free; + Exit; + end + else + AllNextStates.Free; + + FOwner.SymbolDelete; + + FCurrentStates.Free; + FCurrentStates := PrevStates; + end; +end; + +procedure TcxRegExprAutomat.Update; +var + NextStates: TcxRegExprStates; + ASymbol: Char; +begin + if FCurrentStates.IsFinal then + Exit; + + NextStates := GetAllNextStates; + + while NextStates.Equ(ASymbol) do + begin + FOwner.SymbolUpdate(ASymbol); + + Push(FCurrentStates); + FCurrentStates := NextStates; + + if NextStates.IsFinal then + Exit; + + NextStates := GetAllNextStates; + end; + + NextStates.Free; +end; + +function TcxRegExprAutomat.Pop: TcxRegExprStates; +begin + if FHistory.Count > 0 then + begin + Result := TcxRegExprStates(FHistory.Last); + FHistory.Delete(FHistory.Count - 1); + end + else + Result := nil; +end; + +procedure TcxRegExprAutomat.Push(AStates: TcxRegExprStates); +begin + FHistory.Add(AStates); +end; + +{ TcxRegExprSimpleQuantifier } + +function TcxRegExprSimpleQuantifier.CanMissing: Boolean; +begin + Result := False; +end; + +function TcxRegExprSimpleQuantifier.CanRepeat: Boolean; +begin + Result := False; +end; + +function TcxRegExprSimpleQuantifier.Clone: TcxRegExprQuantifier; +begin + Result := TcxRegExprSimpleQuantifier.Create; +end; + +function TcxRegExprSimpleQuantifier.Print: string; +begin + Result := ''; +end; + +{ TcxRegExprQuestionQuantifier } + +function TcxRegExprQuestionQuantifier.CanMissing: Boolean; +begin + Result := True; +end; + +function TcxRegExprQuestionQuantifier.CanRepeat: Boolean; +begin + Result := False; +end; + +function TcxRegExprQuestionQuantifier.Clone: TcxRegExprQuantifier; +begin + Result := TcxRegExprQuestionQuantifier.Create; +end; + +function TcxRegExprQuestionQuantifier.Print: string; +begin + Result := '?'; +end; + +{ TcxRegExprStarQuantifier } + +function TcxRegExprStarQuantifier.CanMissing: Boolean; +begin + Result := True; +end; + +function TcxRegExprStarQuantifier.CanRepeat: Boolean; +begin + Result := True; +end; + +function TcxRegExprStarQuantifier.Clone: TcxRegExprQuantifier; +begin + Result := TcxRegExprStarQuantifier.Create; +end; + +function TcxRegExprStarQuantifier.Print: string; +begin + Result := '*'; +end; + +{ TcxRegExprPlusQuantifier } + +function TcxRegExprPlusQuantifier.CanMissing: Boolean; +begin + Result := False; +end; + +function TcxRegExprPlusQuantifier.CanRepeat: Boolean; +begin + Result := True; +end; + +function TcxRegExprPlusQuantifier.Clone: TcxRegExprQuantifier; +begin + Result := TcxRegExprPlusQuantifier.Create; +end; + +function TcxRegExprPlusQuantifier.Print: string; +begin + Result := '+'; +end; + +{ TcxRegExprParserItem } + +constructor TcxRegExprParserItem.Create(AQuantifier: TcxRegExprQuantifier = nil); +begin + inherited Create; + if AQuantifier = nil then + FQuantifier := TcxRegExprSimpleQuantifier.Create + else + FQuantifier := AQuantifier; +end; + +destructor TcxRegExprParserItem.Destroy; +begin + FQuantifier.Free; + inherited Destroy; +end; + +function TcxRegExprParserItem.CanMissing: Boolean; +begin + Result := FQuantifier.CanMissing; +end; + +function TcxRegExprParserItem.CanRepeat: Boolean; +begin + Result := FQuantifier.CanRepeat; +end; + +function TcxRegExprParserItem.NotQuantifier: Boolean; +begin + Result := FQuantifier is TcxRegExprSimpleQuantifier; +end; + +procedure TcxRegExprParserItem.SetQuantifier( + AQuantifier: TcxRegExprQuantifier); +begin + if AQuantifier <> nil then + begin + FQuantifier.Free; + FQuantifier := AQuantifier; + end; +end; + +{ TcxRegExprParserSimpleItem } + +constructor TcxRegExprParserSimpleItem.Create(AState: TcxRegExprState; + AQuantifier: TcxRegExprQuantifier); +begin + inherited Create(AQuantifier); + FState := AState; +end; + +destructor TcxRegExprParserSimpleItem.Destroy; +begin + if FState <> nil then + FState.Free; + inherited Destroy; +end; + +function TcxRegExprParserSimpleItem.CanEmpty: Boolean; +begin + Result := FQuantifier.CanMissing; +end; + +function TcxRegExprParserSimpleItem.Clone: TcxRegExprParserItem; +begin + Result := TcxRegExprParserSimpleItem.Create(FState.Clone, FQuantifier.Clone); +end; + +function TcxRegExprParserSimpleItem.Print: string; +begin + Result := 'item --> ' + FQuantifier.Print + #13#10; +end; + +procedure TcxRegExprParserSimpleItem.SetFinal; +begin + TcxRegExprSimpleState(State).SetFinal; +end; + +{ TcxRegExprParserBlockItem } + +constructor TcxRegExprParserBlockItem.Create(AQuantifier: TcxRegExprQuantifier = nil); +begin + inherited Create(AQuantifier); + + FStartState := TcxRegExprBlockState.Create; + FFinishState := TcxRegExprBlockState.Create; + FAlts := TcxRegExprParserAlts.Create; +end; + +destructor TcxRegExprParserBlockItem.Destroy; +begin + FStartState.Free; + FFinishState.Free; + FAlts.Free; + + inherited Destroy; +end; + +function TcxRegExprParserBlockItem.CanEmpty: Boolean; +begin + if FQuantifier.CanMissing then + Result := True + else + Result := Alts.CanEmpty; +end; + +procedure TcxRegExprParserBlockItem.CreateConnections; +begin + Alts.CreateConnections; +end; + +procedure TcxRegExprParserBlockItem.AddAlt(AAlt: TcxRegExprParserAlt); +begin + FAlts.Add(AAlt); +end; + +procedure TcxRegExprParserBlockItem.AddAlts(AAlts: TcxRegExprParserAlts); +var + I: Integer; +begin + for I := 0 to AAlts.Count - 1 do + FAlts.Add(AAlts[I]); + AAlts.Free; +end; + +function TcxRegExprParserBlockItem.Clone: TcxRegExprParserItem; +begin + Result := TcxRegExprParserBlockItem.Create(FQuantifier.Clone); + with TcxRegExprParserBlockItem(Result) do + begin + FAlts.Free; + FAlts := Self.Alts.Clone; + end; +end; + +function TcxRegExprParserBlockItem.Print: string; +begin + Result := ''#13#10; + Result := Result + Alts.Print; + Result := Result + ' --> ' + FQuantifier.Print + #13#10; +end; + +procedure TcxRegExprParserBlockItem.SetFinal; +begin + Alts.CreateFinalStates; +end; + +{ TcxRegExprParserAlt } + +constructor TcxRegExprParserAlt.Create; +begin + inherited Create; + FItems := TList.Create; +end; + +destructor TcxRegExprParserAlt.Destroy; +var + I: Integer; +begin + for I := 0 to FItems.Count - 1 do + TcxRegExprParserItem(FItems[I]).Free; + FItems.Free; + inherited Destroy; +end; + +procedure TcxRegExprParserAlt.Add(AItem: TcxRegExprParserItem); +begin + FItems.Add(AItem); +end; + +function TcxRegExprParserAlt.CanEmpty: Boolean; +var + I: Integer; +begin + for I := 0 to Count - 1 do + if not Item[I].CanEmpty then + begin + Result := False; + Exit; + end; + + Result := True; +end; + +function TcxRegExprParserAlt.CanMissing: Boolean; +var + I: Integer; +begin + for I := 0 to Count - 1 do + if not Item[I].CanMissing then + begin + Result := False; + Exit; + end; + + Result := True; +end; + +function TcxRegExprParserAlt.Clone: TcxRegExprParserAlt; +var + I: Integer; +begin + Result := TcxRegExprParserAlt.Create; + + for I := 0 to Count - 1 do + Result.Add(Item[I].Clone); +end; + +procedure TcxRegExprParserAlt.CreateConnections; +var + I, J: Integer; +begin + for I := 0 to Count - 1 do + begin + if Item[I] is TcxRegExprParserSimpleItem then + begin + with TcxRegExprParserSimpleItem(Item[I]) do + begin + for J := I + 1 to Count - 1 do + begin + if Item[J] is TcxRegExprParserSimpleItem then + State.Add(TcxRegExprParserSimpleItem(Item[J]).State) + else if Item[J] is TcxRegExprParserBlockItem then + State.Add(TcxRegExprParserBlockItem(Item[J]).StartState); + + if not Item[J].CanMissing then + Break; + end; + + if Item[I].CanRepeat then + State.Add(State); + end; + end + else if Item[I] is TcxRegExprParserBlockItem then + begin + with TcxRegExprParserBlockItem(Item[I]) do + begin + for J := I + 1 to Count - 1 do + begin + if Item[J] is TcxRegExprParserSimpleItem then + FinishState.Add(TcxRegExprParserSimpleItem(Item[J]).State) + else if Item[J] is TcxRegExprParserBlockItem then + FinishState.Add(TcxRegExprParserBlockItem(Item[J]).StartState); + + if not Item[J].CanMissing then + Break; + end; + + if Item[I].CanRepeat then + FinishState.Add(StartState); + + StartState.Add(Alts.GetStartConnections); + if Alts.ThereIsEmptyAlt then + StartState.Add(FinishState); + + Alts.CreateConnections; + Alts.SetFinishConnections(FinishState); + end; + end; + end; +end; + +procedure TcxRegExprParserAlt.CreateFinalStates; +var + I: Integer; +begin + for I := Count - 1 downto 0 do + begin + Item[I].SetFinal; + + if not Item[I].CanMissing then + Break; + end; +end; + +function TcxRegExprParserAlt.GetStartConnections: TcxRegExprStates; +var + I: Integer; +begin + Result := TcxRegExprStates.Create; + + for I := 0 to Count - 1 do + begin + if Item[I] is TcxRegExprParserSimpleItem then + Result.Add(TcxRegExprParserSimpleItem(Item[I]).State) + else if Item[I] is TcxRegExprParserBlockItem then + Result.Add(TcxRegExprParserBlockItem(Item[I]).StartState); + + if not Item[I].CanMissing then + Break; + end; +end; + +function TcxRegExprParserAlt.Print: string; +var + I: Integer; +begin + Result := ''#13#10; + for I := 0 to Count - 1 do + Result := Result + Item[I].Print; + Result := result + ''#13#10; +end; + +procedure TcxRegExprParserAlt.SetFinishConnection( + AFinishState: TcxRegExprState); +var + I: Integer; +begin + for I := Count - 1 downto 0 do + begin + if Item[I] is TcxRegExprParserSimpleItem then + TcxRegExprParserSimpleItem(Item[I]).State.Add(AFinishState) + else if Item[I] is TcxRegExprParserBlockItem then + TcxRegExprParserBlockItem(Item[I]).FinishState.Add(AFinishState); + + if not Item[I].CanMissing then + Break; + end; +end; + +function TcxRegExprParserAlt.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxRegExprParserAlt.GetFirstItem: TcxRegExprParserItem; +begin + Result := TcxRegExprParserItem(FItems[0]); +end; + +function TcxRegExprParserAlt.GetItem( + AIndex: Integer): TcxRegExprParserItem; +begin + Result := TcxRegExprParserItem(FItems[AIndex]); +end; + +function TcxRegExprParserAlt.GetLastItem: TcxRegExprParserItem; +begin + Result := TcxRegExprParserItem(FItems.Last); +end; + +procedure TcxRegExprParserAlt.SetLastItem(AItem: TcxRegExprParserItem); +begin + TcxRegExprParserItem(FItems[FItems.Count - 1]).Free; + FItems.Delete(FItems.Count - 1); + FItems.Add(AItem); +end; + +{ TcxRegExprParserAlts } + +constructor TcxRegExprParserAlts.Create; +begin + inherited Create; + FAlts := TList.Create; +end; + +destructor TcxRegExprParserAlts.Destroy; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Alt[I].Free; + FAlts.Free; + inherited Destroy; +end; + +procedure TcxRegExprParserAlts.Add(AAlt: TcxRegExprParserAlt); +begin + FAlts.Add(AAlt); +end; + +procedure TcxRegExprParserAlts.AddAlt; +begin + FAlts.Add(TcxRegExprParserAlt.Create) +end; + +function TcxRegExprParserAlts.CanEmpty: Boolean; +var + I: Integer; +begin + for I := 0 to Count - 1 do + if Alt[I].CanEmpty then + begin + Result := True; + Exit; + end; + + Result := False; +end; + +procedure TcxRegExprParserAlts.CreateConnections; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Alt[I].CreateConnections; +end; + +procedure TcxRegExprParserAlts.CreateFinalStates; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Alt[I].CreateFinalStates; +end; + +function TcxRegExprParserAlts.Clone: TcxRegExprParserAlts; +var + I: Integer; +begin + Result := TcxRegExprParserAlts.Create; + + for I := 0 to Count - 1 do + Result.Add(Alt[I].Clone); +end; + +function TcxRegExprParserAlts.GetStartConnections: TcxRegExprStates; +var + I: Integer; +begin + Result := TcxRegExprStates.Create; + + for I := 0 to Count - 1 do + Result.Add(Alt[I].GetStartConnections); +end; + +function TcxRegExprParserAlts.Print: string; +var + I: Integer; +begin + Result := ''; + for I := 0 to Count - 1 do + Result := Result + Alt[I].Print; +end; + +procedure TcxRegExprParserAlts.SetFinishConnections( + AFinishState: TcxRegExprState); +var + I: Integer; +begin + for I := 0 to Count - 1 do + Alt[I].SetFinishConnection(AFinishState); +end; + +function TcxRegExprParserAlts.StartStateIsFinal: Boolean; +var + I: Integer; +begin + for I := 0 to Count - 1 do + if Alt[I].CanMissing then + begin + Result := True; + Exit; + end; + + Result := False; +end; + +function TcxRegExprParserAlts.ThereIsEmptyAlt: Boolean; +var + I: Integer; +begin + for I := 0 to Count - 1 do + if Alt[I].CanMissing then + begin + Result := True; + Exit; + end; + + Result := False; +end; + +function TcxRegExprParserAlts.GetAlt(AIndex: Integer): TcxRegExprParserAlt; +begin + Result := TcxRegExprParserAlt(FAlts[AIndex]); +end; + +function TcxRegExprParserAlts.GetCount: Integer; +begin + Result := FAlts.Count; +end; + +function TcxRegExprParserAlts.GetLastAlt: TcxRegExprParserAlt; +begin + Result := TcxRegExprParserAlt(FAlts.Last); +end; + +{ TcxRegExpr } + +constructor TcxRegExpr.Create; +begin + inherited Create; + FStream := TMemoryStream.Create; + FErrors := TcxRegExprErrors.Create; + FLexems := TcxLexems.Create; + FBlocks := TList.Create; + FAutomat := nil; + FIndex := 0; + FLexemIndex := 0; + FLine := 1; + FChar := 0; + FFirstExpr := True; + FCompiled := False; + FUpdateOn := False; + FCaseInsensitive := False; +end; + +destructor TcxRegExpr.Destroy; +begin + Clear; + FStream.Free; + FLexems.Free; + FBlocks.Free; + FErrors.Free; + if FAutomat <> nil then + FAutomat.Free; + inherited Destroy; +end; + +procedure TcxRegExpr.Compile(AStream: TStream); +begin + if FFirstExpr then + FFirstExpr := False + else + Clear; + + try + FStream.LoadFromStream(AStream); + except + FErrors.Add(TcxRegExprError.Create(0, 0, cxGetResourceString(@scxRegExprNotAssignedSourceStream))); + raise EcxRegExprError.Create(FErrors); + end; + + if EmptyStream then + begin + FErrors.Add(TcxRegExprError.Create(0, 0, cxGetResourceString(@scxRegExprEmptySourceStream))); + raise EcxRegExprError.Create(FErrors); + end; + + ScanExpr; + if FErrors.Count > 0 then + raise EcxRegExprError.Create(FErrors); + + ParseExpr; + if FErrors.Count > 0 then + raise EcxRegExprError.Create(FErrors); + + FCompiled := True; + + if UpdateOn then + FAutomat.Update; +end; + +function TcxRegExpr.IsCompiled: Boolean; +begin + Result := FCompiled; +end; + +function TcxRegExpr.IsFinal: Boolean; +begin + TestCompiledStatus; + + Result := FAutomat.IsFinal; +end; + +function TcxRegExpr.IsStart: Boolean; +begin + TestCompiledStatus; + + Result := FAutomat.IsStart; +end; + +function TcxRegExpr.Next(var AToken: Char): Boolean; +begin + TestCompiledStatus; + + Result := FAutomat.Next(AToken, FCaseInsensitive); + + if not FAutomat.IsFinal and Result and UpdateOn then + FAutomat.Update; +end; + +function TcxRegExpr.NextEx(const AString: string): string; +var + C: Char; + I: Integer; +begin + TestCompiledStatus; + + Result := ''; + for I := 1 to Length(AString) do + begin + C := AString[I]; + if FAutomat.Next(C, FCaseInsensitive) then + Result := Result + AString[I]; + end; +end; + +function TcxRegExpr.Prev: Boolean; +begin + TestCompiledStatus; + + if UpdateOn then + FAutomat.ReUpdate; + + Result := FAutomat.Prev; +end; + +function TcxRegExpr.Print: string; +begin + Result := FAutomat.Print; +end; + +procedure TcxRegExpr.Reset; +begin + TestCompiledStatus; + + FAutomat.Reset; +end; + +procedure TcxRegExpr.Clear; +begin + FStream.Size := 0; + FErrors.Clear; + FLexems.Clear; + FBlocks.Clear; + + if FAutomat <> nil then + FAutomat.Free; + + FAutomat := nil; + FIndex := 0; + FLexemIndex := 0; + FChar := 0; + FLine := 1; + FCompiled := False; +end; + +function TcxRegExpr.Decimal(AToken: Char): Boolean; +begin + if AToken in ['0','1','2','3','4','5','6','7','8','9'] then + Result := True + else + Result := False; +end; + +function TcxRegExpr.EmptyStream: Boolean; +var + AToken: Char; + I: Integer; +begin + if FStream.Size = 0 then + Result := True + else + begin + I := 0; + while LookToken(AToken, I) do + begin + if not Space(AToken) then + begin + Result := False; + Exit; + end; + + Inc(I); + end; + + Result := True; + end; +end; + +function TcxRegExpr.CreateLexem(ALine: Integer; AChar: Integer; ACode: Integer; + AValue: string): TcxLexem; +begin + Result.Line := ALine; + Result.Char := AChar; + Result.Code := ACode; + Result.Value := AValue; +end; + +function TcxRegExpr.GetLexem(var ALexem: TcxLexem): Boolean; +begin + if (FLexemIndex >= 0) and (FLexemIndex < FLexems.Count) then + begin + ALexem := FLexems[FLexemIndex]; + Inc(FLexemIndex); + + Result := True; + end + else + Result := False; +end; + +function TcxRegExpr.GetToken(out AToken: Char): Boolean; +begin + Result := LookToken(AToken, 0); + if Result then + begin + Inc(FIndex); + + if AToken = #13 then + Inc(FLine); + + if AToken = #10 then + FChar := 0 + else + Inc(FChar); + end; +end; + +function TcxRegExpr.GetStream: TStream; +begin + if FCompiled then + Result := FStream + else + Result := nil; +end; + +function TcxRegExpr.Hexadecimal(AToken: Char): Boolean; +begin + Result := (AToken >= '0') and (AToken <= '9') or + (AToken >= 'A') and (AToken <= 'F') or + (AToken >= 'a') and (AToken <= 'f'); +end; + +function TcxRegExpr.LookToken(out AToken: Char; APtr: Integer): Boolean; +begin + Result := ((FIndex + APtr) < FStream.Size) and ((FIndex + APtr) >= 0); + if Result then + AToken := Char(PByteArray(FStream.Memory)[FIndex + APtr]); +end; + +function TcxRegExpr.ParseAlt(AAlt: TcxRegExprParserAlt; Global: Boolean): Boolean; +var + ALexem: TcxLexem; + ACurrentItem: TcxRegExprParserItem; + + procedure AddItem(AItem: TcxRegExprParserItem); + begin + ACurrentItem := AItem; + AAlt.Add(AItem); + end; + + procedure SetQuantifier(AQuantifier: TcxRegExprQuantifier); + var + ABlock: TcxRegExprParserBlockItem; + begin + if ACurrentItem.NotQuantifier then + ACurrentItem.SetQuantifier(AQuantifier) + else + begin + ABlock := TcxRegExprParserBlockItem.Create(AQuantifier); + ABlock.Alts.AddAlt; + ABlock.Alts.LastAlt.Add(ACurrentItem); + ACurrentItem := ABlock; + AAlt.FItems[AAlt.FItems.Count - 1] := ABlock; + end; + end; + + function CreateParameterQuantifierBlock(AIndex, ACount: Integer): TcxRegExprParserItem; + begin + if AIndex < (ACount - 1) then + begin + Result := TcxRegExprParserBlockItem.Create(TcxRegExprQuestionQuantifier.Create); + with TcxRegExprParserBlockItem(Result).Alts do + begin + AddAlt; + LastAlt.Add(ACurrentItem.Clone); + LastAlt.Add(CreateParameterQuantifierBlock(AIndex + 1, ACount)); + end; + end + else + begin + Result := ACurrentItem.Clone; + Result.SetQuantifier(TcxRegExprQuestionQuantifier.Create); + end; + end; + + procedure SetParameterQuantifier(A, B: Integer); + var + ABlock: TcxRegExprParserBlockItem; + AItem: TcxRegExprParserItem; + I: Integer; + begin + if ACurrentItem.CanMissing then + begin + FErrors.Add(TcxRegExprError.Create(ALexem.Line, ALexem.Char, + cxGetResourceString(@scxRegExprCantUseParameterQuantifier))); + Exit; + end; + + ABlock := TcxRegExprParserBlockItem.Create(TcxRegExprSimpleQuantifier.Create); + ABlock.Alts.AddAlt; + for I := 0 to A - 1 do + ABlock.Alts.LastAlt.Add(ACurrentItem.Clone); + if B = -1 then + begin + AItem := ACurrentItem.Clone; + AItem.SetQuantifier(TcxRegExprStarQuantifier.Create); + ABlock.Alts.LastAlt.Add(AItem); + end + else if B > A then + ABlock.Alts.LastAlt.Add(CreateParameterQuantifierBlock(A, B)); + ACurrentItem := ABlock; + AAlt.LastItem := ABlock; + end; + + procedure SetQuestionQuantifier; + begin + SetQuantifier(TcxRegExprQuestionQuantifier.Create); + end; + + procedure SetPlusQuantifier; + begin + if ACurrentItem.CanEmpty then + FErrors.Add(TcxRegExprError.Create(ALexem.Line, ALexem.Char, + cxGetResourceString(@scxRegExprCantUsePlusQuantifier))) + else + SetQuantifier(TcxRegExprPlusQuantifier.Create); + end; + + procedure SetStarQuantifier; + begin + if ACurrentItem.CanEmpty then + FErrors.Add(TcxRegExprError.Create(ALexem.Line, ALexem.Char, + cxGetResourceString(@scxRegExprCantUseStarQuantifier))) + else + SetQuantifier(TcxRegExprStarQuantifier.Create); + end; + +var + RefNumber: Integer; + A, B: Integer; +begin + ACurrentItem := nil; + + if GetLexem(ALexem) then + begin + if (TcxRegExprLexemCode(ALexem.Code) = relcSpecial) and (ALexem.Value[1] = '|') then + begin + FErrors.Add(TcxRegExprError.Create(ALexem.Line, ALexem.Char, + cxGetResourceString(@scxRegExprCantCreateEmptyAlt))); + Result := True; + Exit; + end; + + if not Global then + begin + if (TcxRegExprLexemCode(ALexem.Code) = relcSpecial) and (ALexem.Value[1] = ')') then + begin + FErrors.Add(TcxRegExprError.Create(ALexem.Line, ALexem.Char, + cxGetResourceString(@scxRegExprCantCreateEmptyBlock))); + Result := False; + Exit; + end; + end; + end + else + begin + FErrors.Add(TcxRegExprError.Create(0, 0, cxGetResourceString(@scxRegExprCantCreateEmptyAlt))); + Result := False; + Exit; + end; + + repeat + case TcxRegExprLexemCode(ALexem.Code) of + relcSymbol: + AddItem( + TcxRegExprParserSimpleItem.Create( + TcxRegExprSimpleState.Create( + TcxRegExprSymbol.Create( + ALexem.Value[1])))); + relcSpecial: + begin + case ALexem.Value[1] of + '|': + begin + Result := True; + Exit; + end; + '(': + AddItem(ParseBlock); + ')': + begin + if Global then + FErrors.Add(TcxRegExprError.Create(ALexem.Line, ALexem.Char, + Format(cxGetResourceString(@scxRegExprIllegalSymbol), [')']))) + else + begin + Result := False; + Exit; + end; + end; + '[': + AddItem(ParseEnumeration); + ']': + FErrors.Add(TcxRegExprError.Create(ALexem.Line, ALexem.Char, + Format(cxGetResourceString(@scxRegExprIllegalSymbol), [']']))); + '{': + begin + if ACurrentItem = nil then + FErrors.Add(TcxRegExprError.Create(ALexem.Line, ALexem.Char, + cxGetResourceString(@scxRegExprIncorrectParameterQuantifier))) + else + begin + ParseQuantifier(A, B); + SetParameterQuantifier(A, B); + end; + end; + '}': + FErrors.Add(TcxRegExprError.Create(ALexem.Line, ALexem.Char, + Format(cxGetResourceString(@scxRegExprIllegalSymbol), ['}']))); + '-': + FErrors.Add(TcxRegExprError.Create(ALexem.Line, ALexem.Char, + Format(cxGetResourceString(@scxRegExprIllegalSymbol), ['-']))); + '?': + begin + if ACurrentItem = nil then + FErrors.Add(TcxRegExprError.Create(ALexem.Line, ALexem.Char, + Format(cxGetResourceString(@scxRegExprIllegalQuantifier), ['?']))) + else + SetQuestionQuantifier; + end; + '+': + begin + if ACurrentItem = nil then + FErrors.Add(TcxRegExprError.Create(ALexem.Line, ALexem.Char, + Format(cxGetResourceString(@scxRegExprIllegalQuantifier), ['+']))) + else + SetPlusQuantifier; + end; + '*': + begin + if ACurrentItem = nil then + FErrors.Add(TcxRegExprError.Create(ALexem.Line, ALexem.Char, + Format(cxGetResourceString(@scxRegExprIllegalQuantifier), ['*']))) + else + SetStarQuantifier; + end; + end; + end; + relcInteger: + FErrors.Add(TcxRegExprError.Create(ALexem.Line, ALexem.Char, + cxGetResourceString(@scxRegExprIllegalIntegerValue))); + relcTimeSeparator: + AddItem( + TcxRegExprParserSimpleItem.Create( + TcxRegExprSimpleState.Create( + TcxRegExprTimeSeparator.Create))); + relcDateSeparator: + AddItem( + TcxRegExprParserSimpleItem.Create( + TcxRegExprSimpleState.Create( + TcxRegExprDateSeparator.Create))); + relcAll: + AddItem( + TcxRegExprParserSimpleItem.Create( + TcxRegExprSimpleState.Create( + TcxRegExprAll.Create))); + relcId: + AddItem( + TcxRegExprParserSimpleItem.Create( + TcxRegExprSimpleState.Create( + TcxRegExprIdLetter.Create))); + relcNotId: + AddItem( + TcxRegExprParserSimpleItem.Create( + TcxRegExprSimpleState.Create( + TcxRegExprIdLetter.Create(True)))); + relcDigit: + AddItem( + TcxRegExprParserSimpleItem.Create( + TcxRegExprSimpleState.Create( + TcxRegExprDigit.Create))); + relcNotDigit: + AddItem( + TcxRegExprParserSimpleItem.Create( + TcxRegExprSimpleState.Create( + TcxRegExprDigit.Create(True)))); + relcSpace: + AddItem( + TcxRegExprParserSimpleItem.Create( + TcxRegExprSimpleState.Create( + TcxRegExprSpace.Create))); + relcNotSpace: + AddItem( + TcxRegExprParserSimpleItem.Create( + TcxRegExprSimpleState.Create( + TcxRegExprSpace.Create(True)))); + relcReference: + begin + RefNumber := StrToInt(ALexem.Value) - 1; + if RefNumber >= FBlocks.Count then + FErrors.Add(TcxRegExprError.Create(ALexem.Line, ALexem.Char, + cxGetResourceString(@scxRegExprTooBigReferenceNumber))) + else + AddItem(TcxRegExprParserItem(FBlocks[RefNumber]).Clone); + end; + end; + until not GetLexem(ALexem); + + Result := False; +end; + +function TcxRegExpr.ParseBlock: TcxRegExprParserBlockItem; +begin + Result := TcxRegExprParserBlockItem.Create; + FBlocks.Add(Result); + + repeat + Result.Alts.AddAlt; + until not ParseAlt(Result.Alts.LastAlt, False); +end; + +function TcxRegExpr.ParseEnumeration: TcxRegExprParserSimpleItem; +var + ALexem: TcxLexem; + ALexem1: TcxLexem; + Enumeration: TcxRegExprUserEnumeration; +begin + GetLexem(ALexem); + + if (TcxRegExprLexemCode(ALexem.Code) = relcSpecial) and (ALexem.Value[1] = '^') then + begin + Enumeration := TcxRegExprUserEnumeration.Create(True); + GetLexem(ALexem); + end + else + Enumeration := TcxRegExprUserEnumeration.Create; + + Result := TcxRegExprParserSimpleItem.Create(TcxRegExprSimpleState.Create(Enumeration)); + + if (TcxRegExprLexemCode(ALexem.Code) = relcSpecial) and (ALexem.Value[1] = ']') then + begin + FErrors.Add(TcxRegExprError.Create(ALexem.Line, ALexem.Char, + cxGetResourceString(@scxRegExprCantCreateEmptyEnum))); + Exit; + end; + + repeat + GetLexem(ALexem1); + + if (TcxRegExprLexemCode(ALexem1.Code) = relcSpecial) and (ALexem1.Value[1] = '-') then + begin + GetLexem(ALexem1); + if ALexem.Value[1] < ALexem1.Value[1] then + Enumeration.Add(TcxRegExprSubrange.Create(ALexem.Value[1], ALexem1.Value[1])) + else + FErrors.Add(TcxRegExprError.Create(ALexem1.Line, ALexem1.Char, + cxGetResourceString(@scxRegExprSubrangeOrder))); + + GetLexem(ALexem); + while (TcxRegExprLexemCode(ALexem.Code) = relcSpecial) and (ALexem.Value[1] = '-') do + begin + FErrors.Add(TcxRegExprError.Create(ALexem.Line, ALexem.Char, + Format(cxGetResourceString(@scxRegExprIllegalSymbol), ['-']))); + GetLexem(ALexem); + end; + end + else + begin + case TcxRegExprLexemCode(ALexem.Code) of + relcTimeSeparator: + Enumeration.Add(TcxRegExprTimeSeparator.Create); + relcDateSeparator: + Enumeration.Add(TcxRegExprDateSeparator.Create); + relcAll: + Enumeration.Add(TcxRegExprAll.Create); + relcId: + Enumeration.Add(TcxRegExprIdLetter.Create); + relcNotId: + Enumeration.Add(TcxRegExprIdLetter.Create(True)); + relcDigit: + Enumeration.Add(TcxRegExprDigit.Create); + relcNotDigit: + Enumeration.Add(TcxRegExprDigit.Create(True)); + relcSpace: + Enumeration.Add(TcxRegExprSpace.Create); + relcNotSpace: + Enumeration.Add(TcxRegExprSpace.Create(True)); + else + Enumeration.Add(TcxRegExprSymbol.Create(ALexem.Value[1])); + end; + + ALexem := ALexem1; + end; + + until (TcxRegExprLexemCode(ALexem.Code) = relcSpecial) and (ALexem.Value[1] = ']'); +end; + +procedure TcxRegExpr.ParseExpr; +var + Expr: TcxRegExprParserAlts; +begin + Expr := TcxRegExprParserAlts.Create; + + repeat + Expr.AddAlt; + until not ParseAlt(Expr.LastAlt); + + if FErrors.Count > 0 then + Expr.Free + else + begin + Expr.CreateConnections; + Expr.CreateFinalStates; + FAutomat := TcxRegExprAutomat.Create(Expr, Self); + end; +end; + +procedure TcxRegExpr.ParseQuantifier(var A: Integer; var B: Integer); +var + ALexem: TcxLexem; +begin + GetLexem(ALexem); + if TcxRegExprLexemCode(ALexem.Code) = relcInteger then + begin + A := StrToInt(ALexem.Value); + GetLexem(ALexem); + if TcxRegExprLexemCode(ALexem.Code) = relcSpecial then + begin + if ALexem.Value = ',' then + begin + GetLexem(ALexem); + if TcxRegExprLexemCode(ALexem.Code) = relcInteger then + begin + B := StrToInt(ALexem.Value); + if B >= A then + begin + GetLexem(ALexem); + if (TcxRegExprLexemCode(ALexem.Code) = relcSpecial) and (ALexem.Value = '}') then + Exit; + end; + end + else if TcxRegExprLexemCode(ALexem.Code) = relcSpecial then + begin + if ALexem.Value = '}' then + begin + B := -1; + Exit; + end; + end; + end + else if ALexem.Value = '}' then + begin + B := A; + Exit; + end; + end; + end; + FErrors.Add(TcxRegExprError.Create(ALexem.Line, ALexem.Char, + cxGetResourceString(@scxRegExprIncorrectParameterQuantifier))); +end; + +procedure TcxRegExpr.ScanASCII(ALine: Integer; AChar: Integer); +var + AToken: Char; + ALexem: TcxLexem; +begin + if GetToken(AToken) then + begin + if Hexadecimal(AToken)then + ALexem.Value := AToken + else + begin + FErrors.Add(TcxRegExprError.Create(FLine, FChar, + Format(cxGetResourceString(@scxRegExprHexNumberExpected), [AToken]))); + Exit; + end; + + if GetToken(AToken) then + begin + if Hexadecimal(AToken)then + ALexem.Value := ALexem.Value + AToken + else + begin + FErrors.Add(TcxRegExprError.Create(FLine, FChar, + Format(cxGetResourceString(@scxRegExprHexNumberExpected), [AToken]))); + Exit; + end; + + ALexem.Line := ALine; + ALexem.Char := AChar; + ALexem.Code := Ord(relcSymbol); + ALexem.Value := Char(StrToInt('$' + ALexem.Value)); + FLexems.Add(ALexem); + end + else + FErrors.Add(TcxRegExprError.Create(FLine, FChar + 1, + cxGetResourceString(@scxRegExprHexNumberExpected0))); + end + else + FErrors.Add(TcxRegExprError.Create(FLine, FChar + 1, + cxGetResourceString(@scxRegExprHexNumberExpected0))); +end; + +procedure TcxRegExpr.ScanClass; +var + AToken: Char; + Flag: Boolean; + _Line: Integer; + _Char: Integer; +begin + while GetToken(AToken) do + begin + if Space(AToken) then + Continue; + case AToken of + '''': + begin + ScanString; + Break; + end; + '^': + begin + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcSpecial), AToken)); + Break; + end; + ':': + begin + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcTimeSeparator), AToken)); + Break; + end; + '/': + begin + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcDateSeparator), AToken)); + Break; + end; + '\': + begin + ScanEscape(FLine, FChar); + Break; + end; + ']': + begin + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcSpecial), AToken)); + Exit; + end; + else + begin + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcSymbol), AToken)); + Break; + end; + end; + end; + + while GetToken(AToken) do + begin + if Space(AToken) then + Continue; + case AToken of + '''': + ScanString; + ']': + begin + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcSpecial), AToken)); + Exit; + end; + '-': + begin + Flag := False; + _Line := FLine; + _Char := FChar; + while LookToken(AToken, 0) do + begin + if Space(AToken) then + begin + GetToken(AToken); + Continue; + end + else + begin + if AToken = ']' then + FLexems.Add(CreateLexem(_Line, _Char, Ord(relcSymbol), '-')) + else + FLexems.Add(CreateLexem(_Line, _Char, Ord(relcSpecial), '-')); + + Flag := True; + Break; + end; + end; + + if not Flag then + begin + FLexems.Add(CreateLexem(_Line, _Char, Ord(relcSpecial), '-')); + FErrors.Add(TcxRegExprError.Create(FLine, FChar + 1, + Format(cxGetResourceString(@scxRegExprMissing), [']']))); + Exit; + end; + end; + ':': + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcTimeSeparator), AToken)); + '/': + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcDateSeparator), AToken)); + '\': + ScanEscape(FLine, FChar); + else + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcSymbol), AToken)); + end; + end; + + FErrors.Add(TcxRegExprError.Create(FLine, FChar + 1, + Format(cxGetResourceString(@scxRegExprMissing), [']']))); +end; + +procedure TcxRegExpr.ScanExpr; +var + AToken: Char; + AOpenSkobCounter: Integer; +begin + AOpenSkobCounter := 0; + + while GetToken(AToken) do + begin + if Space(AToken) then + Continue; + + case AToken of + '''': + ScanString; + '[': + begin + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcSpecial), AToken)); + ScanClass; + end; + '{': + begin + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcSpecial), AToken)); + ScanQuantifier; + end; + '.': + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcAll), AToken)); + ':': + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcTimeSeparator), AToken)); + '/': + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcDateSeparator), AToken)); + '\': + ScanEscape(FLine, FChar); + '(': + begin + Inc(AOpenSkobCounter); + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcSpecial), AToken)); + end; + ')': + begin + Dec(AOpenSkobCounter); + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcSpecial), AToken)); + end; + '+', '*', '?', '|': + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcSpecial), AToken)); + else + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcSymbol), AToken)); + end; + end; + + if AOpenSkobCounter > 0 then + FErrors.Add(TcxRegExprError.Create(0, 0, + Format(cxGetResourceString(@scxRegExprMissing), [')']))) + else if AOpenSkobCounter < 0 then + FErrors.Add(TcxRegExprError.Create(0, 0, + Format(cxGetResourceString(@scxRegExprUnnecessary), [')']))); +end; + +procedure TcxRegExpr.ScanEscape(ALine: Integer; AChar: Integer); +var + AToken: Char; +begin + while GetToken(AToken) do + begin + if Decimal(AToken) and (AToken <> '0') then + begin + FLexems.Add(CreateLexem(ALine, AChar, Ord(relcReference), AToken)); + Exit; + end + else + begin + if Space(AToken) then + begin + FErrors.Add(TcxRegExprError.Create(FLine, FChar, + cxGetResourceString(@scxRegExprIncorrectSpace))); + Exit; + end; + + case AToken of + 'x': + begin + ScanASCII(ALine, AChar); + Exit; + end; + 'w': + begin + FLexems.Add(CreateLexem(ALine, AChar, Ord(relcId), AToken)); + Exit; + end; + 'W': + begin + FLexems.Add(CreateLexem(ALine, AChar, Ord(relcNotId), AToken)); + Exit; + end; + 'd': + begin + FLexems.Add(CreateLexem(ALine, AChar, Ord(relcDigit), AToken)); + Exit; + end; + 'D': + begin + FLexems.Add(CreateLexem(ALine, AChar, Ord(relcNotDigit), AToken)); + Exit; + end; + 's': + begin + FLexems.Add(CreateLexem(ALine, AChar, Ord(relcSpace), AToken)); + Exit; + end; + 'S': + begin + FLexems.Add(CreateLexem(ALine, AChar, Ord(relcNotSpace), AToken)); + Exit; + end; + 't': + begin + FLexems.Add(CreateLexem(ALine, AChar, Ord(relcSymbol), #9)); + Exit; + end; + 'n': + begin + FLexems.Add(CreateLexem(ALine, AChar, Ord(relcSymbol), #10)); + Exit; + end; + 'r': + begin + FLexems.Add(CreateLexem(ALine, AChar, Ord(relcSymbol), #13)); + Exit; + end; + 'f': + begin + FLexems.Add(CreateLexem(ALine, AChar, Ord(relcSymbol), #12)); + Exit; + end; + 'a': + begin + FLexems.Add(CreateLexem(ALine, AChar, Ord(relcSymbol), #7)); + Exit; + end; + 'e': + begin + FLexems.Add(CreateLexem(ALine, AChar, Ord(relcSymbol), #27)); + Exit; + end; + 'p': + begin + FLexems.Add(CreateLexem(ALine, AChar, Ord(relcSymbol), DecimalSeparator)); + Exit; + end + else + begin + FLexems.Add(CreateLexem(ALine, AChar, Ord(relcSymbol), AToken)); + Exit; + end; + end; + end; + end; +end; + +function TcxRegExpr.ScanInteger(ALine, AChar: Integer; var AToken: Char): Boolean; +var + AValue: string; +begin + AValue := AToken; + while GetToken(AToken) do + begin + if Decimal(AToken) then + AValue := AValue + AToken + else + begin + FLexems.Add(CreateLexem(ALine, AChar, Ord(relcInteger), AValue)); + Result := True; + Exit; + end; + end; + + FLexems.Add(CreateLexem(ALine, AChar, Ord(relcInteger), AValue)); + Result := False; +end; + +procedure TcxRegExpr.ScanQuantifier; +var + AToken: Char; + ALexem: TcxLexem; +begin + ALexem.Value := ''; + + while GetToken(AToken) do + begin + if Space(AToken) then + Continue + else if Decimal(AToken) then + begin + if not ScanInteger(FLine, FChar, AToken) then + Break; + if Space(AToken) then + Continue; + end; + + case AToken of + '''': + FErrors.Add(TcxRegExprError.Create(FLine, FChar, + Format(cxGetResourceString(@scxRegExprIllegalSymbol), [' '' ']))); + ',': + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcSpecial), AToken)); + '}': + begin + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcSpecial), AToken)); + Exit; + end; + else + FErrors.Add(TcxRegExprError.Create(FLine, FChar, + Format(cxGetResourceString(@scxRegExprIllegalSymbol), [AToken]))); + end; + end; + + FErrors.Add(TcxRegExprError.Create(FLine, FChar + 1, + Format(cxGetResourceString(@scxRegExprMissing), ['}']))); +end; + +procedure TcxRegExpr.ScanString; +var + AToken: Char; +begin + while GetToken(AToken) do + begin + if AToken = '''' then + begin + if LookToken(AToken, 0) then + begin + if AToken = '''' then + begin + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcSymbol), '''')); + GetToken(AToken); + Continue; + end + else + Exit; + end + else + Exit; + end + else + FLexems.Add(CreateLexem(FLine, FChar, Ord(relcSymbol), AToken)); + end; + + FErrors.Add(TcxRegExprError.Create(FLine, FChar + 1, + Format(cxGetResourceString(@scxRegExprMissing), [' '' ']))); +end; + +procedure TcxRegExpr.SetUpdateOn(AUpdateOn: Boolean); +begin + FUpdateOn := AUpdateOn; + if FCompiled then + if FUpdateOn then + FAutomat.Update; +end; + +function TcxRegExpr.Space(AToken: Char): Boolean; +begin + Result := IsSpaceChar(AToken); +end; + +procedure TcxRegExpr.SymbolDelete; +begin + if Assigned(FOnSymbolDelete) then + FOnSymbolDelete; +end; + +procedure TcxRegExpr.SymbolUpdate(ASymbol: Char); +begin + if Assigned(FOnSymbolUpdate) then + FOnSymbolUpdate(ASymbol); +end; + +procedure TcxRegExpr.TestCompiledStatus; +begin + if not FCompiled then + raise EcxEditError.Create(cxGetResourceString(@scxRegExprNotCompiled)); +end; + +function IsTextFullValid(const AText, AMask: string): Boolean; +var + ARegExpr: TcxRegExpr; + AStream: TStringStream; + C: Char; + I: Integer; +begin + ARegExpr := TcxRegExpr.Create; + AStream := TStringStream.Create(AMask); + + Result := False; + try + try + ARegExpr.Compile(AStream); + + Result := True; + for I := 1 to Length(AText) do + begin + C := AText[I]; + if not ARegExpr.Next(C) then + begin + Result := False; + Break; + end; + end; + + if Result then + if not ARegExpr.IsFinal then + Result := False; + except + on E: EcxRegExprError do + raise EcxRegExprError.Create(E.Errors.Clone); + end; + finally + AStream.Free; + ARegExpr.Free; + end; +end; + +function IsTextValid(const AText, AMask: string): Boolean; +var + ARegExpr: TcxRegExpr; + AStream: TStringStream; + C: Char; + I: Integer; +begin + ARegExpr := TcxRegExpr.Create; + AStream := TStringStream.Create(AMask); + + Result := False; + try + try + ARegExpr.Compile(AStream); + + Result := True; + for I := 1 to Length(AText) do + begin + C := AText[I]; + if not ARegExpr.Next(C) then + begin + Result := False; + Break; + end; + end; + except + on E: EcxRegExprError do + raise EcxRegExprError.Create(E.Errors.Clone); + end; + finally + AStream.Free; + ARegExpr.Free; + end; +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxRichEdit.pas b/official/x.35/ExpressEditors Library 5/Sources/cxRichEdit.pas new file mode 100644 index 00000000..40f3b6a5 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxRichEdit.pas @@ -0,0 +1,4383 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxRichEdit; + +{$I cxVer.inc} + +interface + +uses + Variants, Windows, Messages, ActiveX, OleDlg, OleConst, OleCtnrs, Classes, + ClipBrd, ComCtrls, Controls, Dialogs, Forms, Graphics, + Menus, RichEdit, StdCtrls, SysUtils, cxClasses, cxContainer, + cxControls, cxEdit, cxDrawTextUtils, cxGraphics, cxLookAndFeels, cxMemo, + cxScrollbar, cxTextEdit; + +(*$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IOleLink);'*) + +type + TcxRichEditStreamMode = (resmSelection, resmPlainRtf, resmRtfNoObjs, resmUnicode, resmTextIzed); + TcxRichEditStreamModes = set of TcxRichEditStreamMode; + + TcxTextRange = record + chrg: TCharRange; + lpstrText: PAnsiChar; + end; + + TReObject = packed record + cbStruct: DWORD; // Size of structure + cp: Cardinal; // Character position of object + clsid: TCLSID; // Class ID of object + oleobj: IOleObject; // OLE object interface + stg: IStorage; // Associated storage interface + olesite: IOLEClientSite;// Associated client site interface + sizel: TSize; // Size of object (may be 0,0) + dvaspect: DWORD; // Display aspect to use + dwFlags: DWORD; // Object status flags + dwUser: DWORD; // Dword for user's use + end; + + TcxCustomRichEdit = class; + + TcxRichEditURLClickEvent = procedure(Sender: TcxCustomRichEdit; const URLText: string; + Button: TMouseButton) of object; + TcxRichEditURLMoveEvent = procedure(Sender: TcxCustomRichEdit; const URLText: string) of object; + TcxRichEditQueryInsertObjectEvent = procedure(Sender: TcxCustomRichEdit; var AAllowInsertObject: Boolean; + const ACLSID: TCLSID) of object; + + TcxCustomRichEditViewInfo = class(TcxCustomMemoViewInfo) + public + DrawBitmap: HBITMAP; + IsDrawBitmapDirty: Boolean; + PrevDrawBitmapSize: TSize; + constructor Create; override; + destructor Destroy; override; + procedure DrawNativeStyleEditBackground(ACanvas: TcxCanvas; ADrawBackground: Boolean; + ABackgroundStyle: TcxEditBackgroundPaintingStyle; ABackgroundBrush: TBrushHandle); override; + procedure DrawText(ACanvas: TcxCanvas); override; + function GetUpdateRegion(AViewInfo: TcxContainerViewInfo): TcxRegion; override; + function NeedShowHint(ACanvas: TcxCanvas; const P: TPoint; + const AVisibleBounds: TRect; out AText: TCaption; + out AIsMultiLine: Boolean; out ATextRect: TRect): Boolean; override; + procedure Paint(ACanvas: TcxCanvas); override; + end; + + TcxCustomRichEditProperties = class; + + TcxCustomRichEditViewData = class(TcxCustomMemoViewData) + private + function GetProperties: TcxCustomRichEditProperties; + protected + function InternalGetEditContentSize(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; + const AEditSizeProperties: TcxEditSizeProperties): TSize; override; + public + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); override; + property Properties: TcxCustomRichEditProperties read GetProperties; + end; + + {IRichEditOleCallback} + + TcxRichInnerEdit = class; + + IcxRichEditOleCallback = interface(IUnknown) + ['{00020D00-0000-0000-C000-000000000046}'] + function GetNewStorage(out stg: IStorage): HRESULT; stdcall; + function GetInPlaceContext(out Frame: IOleInPlaceFrame; + out Doc: IOleInPlaceUIWindow; lpFrameInfo: POleInPlaceFrameInfo): HRESULT; stdcall; + function ShowContainerUI(fShow: BOOL): HRESULT; stdcall; + function QueryInsertObject(const clsid: TCLSID; stg: IStorage; cp: longint): HRESULT; stdcall; + function DeleteObject(oleobj: IOLEObject): HRESULT; stdcall; + function QueryAcceptData(dataobj: IDataObject; var cfFormat: TClipFormat; + reco: DWORD; fReally: BOOL; hMetaPict: HGLOBAL): HRESULT; stdcall; + function ContextSensitiveHelp(fEnterMode: BOOL): HRESULT; stdcall; + function GetClipboardData(const chrg: TCharRange; reco: DWORD; + out dataobj: IDataObject): HRESULT; stdcall; + function GetDragDropEffect(fDrag: BOOL; grfKeyState: DWORD; + var dwEffect: DWORD): HRESULT; stdcall; + function GetContextMenu(seltype: Word; oleobj: IOleObject; + const chrg: TCharRange; var menu: HMENU): HRESULT; stdcall; + end; + + { IRichEditOle } + + IcxRichEditOle = interface(IUnknown) + ['{00020D00-0000-0000-C000-000000000046}'] + function GetClientSite(out clientSite: IOleClientSite): HResult; stdcall; + function GetObjectCount: HResult; stdcall; + function GetLinkCount: HResult; stdcall; + function GetObject(iob: Longint; out reobject: TReObject; + dwFlags: DWORD): HResult; stdcall; + function InsertObject(var reobject: TReObject): HResult; stdcall; + function ConvertObject(iob: Longint; rclsidNew: TIID; + lpstrUserTypeNew: LPCSTR): HResult; stdcall; + function ActivateAs(rclsid: TIID; rclsidAs: TIID): HResult; stdcall; + function SetHostNames(lpstrContainerApp: LPCSTR; + lpstrContainerObj: LPCSTR): HResult; stdcall; + function SetLinkAvailable(iob: Longint; fAvailable: BOOL): HResult; stdcall; + function SetDvaspect(iob: Longint; dvaspect: DWORD): HResult; stdcall; + function HandsOffStorage(iob: Longint): HResult; stdcall; + function SaveCompleted(iob: Longint; const stg: IStorage): HResult; stdcall; + function InPlaceDeactivate: HResult; stdcall; + function ContextSensitiveHelp(fEnterMode: BOOL): HResult; stdcall; + function GetClipboardData(var chrg: TCharRange; reco: DWORD; + out dataobj: IDataObject): HResult; stdcall; + function ImportDataObject(dataobj: IDataObject; cf: TClipFormat; + hMetaPict: HGLOBAL): HResult; stdcall; + end; + + { TcxRichEditOleCallback } + + TcxRichEditOleCallback = class(TcxIUnknownObject, IcxRichEditOleCallback) + private + FEdit: TcxRichInnerEdit; + public + constructor Create(AOwner: TcxRichInnerEdit); + + //IRichEditOleCallback + function ContextSensitiveHelp(fEnterMode: BOOL): HRESULT; stdcall; + function DeleteObject(oleobj: IOLEObject): HRESULT; stdcall; + function GetClipboardData(const chrg: TCharRange; reco: DWORD; + out dataobj: IDataObject): HRESULT; stdcall; + function GetContextMenu(seltype: Word; oleobj: IOleObject; + const chrg: TCharRange; var menu: HMENU): HRESULT; stdcall; + function GetDragDropEffect(fDrag: BOOL; grfKeyState: DWORD; + var dwEffect: DWORD): HRESULT; stdcall; + function GetInPlaceContext(out Frame: IOleInPlaceFrame; + out Doc: IOleInPlaceUIWindow; lpFrameInfo: POleInPlaceFrameInfo): HRESULT; stdcall; + function GetNewStorage(out stg: IStorage): HRESULT; stdcall; + function QueryInsertObject(const clsid: TCLSID; stg: IStorage; cp: longint): HRESULT; stdcall; + function QueryAcceptData(dataobj: IDataObject; var cfFormat: TClipFormat; + reco: DWORD; fReally: BOOL; hMetaPict: HGLOBAL): HRESULT; stdcall; + function ShowContainerUI(fShow: BOOL): HRESULT; stdcall; + end; + + { TcxCustomRichEditProperties } + + TcxCustomRichEditProperties = class(TcxCustomMemoProperties) + private + FAllowObjects: Boolean; + FAutoURLDetect: Boolean; + FHideScrollBars: Boolean; + FMemoMode: Boolean; + FPlainText: Boolean; + FPlainTextChanged: Boolean; + FSelectionBar: Boolean; + FStreamModes: TcxRichEditStreamModes; + FOnQueryInsertObject: TcxRichEditQueryInsertObjectEvent; + FOnProtectChange: TRichEditProtectChange; + FOnResizeRequest: TRichEditResizeEvent; + FOnSaveClipboard: TRichEditSaveClipboard; + FOnSelectionChange: TNotifyEvent; + FOnURLClick: TcxRichEditURLClickEvent; + FOnURLMove: TcxRichEditURLMoveEvent; + procedure SetAllowObjects(const Value: Boolean); + procedure SetAutoURLDetect(const Value: Boolean); + procedure SetHideScrollBars(Value: Boolean); + procedure SetMemoMode(Value: Boolean); + procedure SetPlainText(Value: Boolean); + procedure SetSelectionBar(Value: Boolean); + procedure SetStreamModes(const Value: TcxRichEditStreamModes); + procedure SetOnQueryInsertObject(Value: TcxRichEditQueryInsertObjectEvent); + protected + function CanValidate: Boolean; override; + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + property PlainTextChanged: Boolean read FPlainTextChanged; + public + constructor Create(AOwner: TPersistent); override; + + procedure Assign(Source: TPersistent); override; + class function GetContainerClass: TcxContainerClass; override; + function GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; override; + function GetSupportedOperations: TcxEditSupportedOperations; override; + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + function IsResetEditClass: Boolean; override; + property AllowObjects: Boolean read FAllowObjects write SetAllowObjects default False; + property AutoURLDetect: Boolean read FAutoURLDetect write SetAutoURLDetect default False; + property PlainText: Boolean read FPlainText write SetPlainText default False; + // !!! + property HideScrollBars: Boolean read FHideScrollBars + write SetHideScrollBars default True; + property MemoMode: Boolean read FMemoMode write SetMemoMode default False; + property SelectionBar: Boolean read FSelectionBar write SetSelectionBar + default False; + property StreamModes: TcxRichEditStreamModes read FStreamModes + write SetStreamModes default []; + property OnQueryInsertObject: TcxRichEditQueryInsertObjectEvent read FOnQueryInsertObject + write SetOnQueryInsertObject; + property OnProtectChange: TRichEditProtectChange read FOnProtectChange + write FOnProtectChange; + property OnResizeRequest: TRichEditResizeEvent read FOnResizeRequest + write FOnResizeRequest; + property OnSaveClipboard: TRichEditSaveClipboard read FOnSaveClipboard + write FOnSaveClipboard; + property OnSelectionChange: TNotifyEvent read FOnSelectionChange + write FOnSelectionChange; + property OnURLClick: TcxRichEditURLClickEvent read FOnURLClick + write FOnURLClick; + property OnURLMove: TcxRichEditURLMoveEvent read FOnURLMove + write FOnURLMove; + end; + + { TcxRichEditProperties } + + TcxRichEditProperties = class(TcxCustomRichEditProperties) + published + property Alignment; + property AllowObjects; + property AssignedValues; + property AutoSelect; + property AutoURLDetect; + property ClearKey; + property HideScrollBars; + property HideSelection; + property ImeMode; + property ImeName; + property MaxLength; + property MemoMode; + property OEMConvert; + property PlainText; + property ReadOnly; + property ScrollBars; + property SelectionBar; + property StreamModes; + property VisibleLineCount; + property WantReturns; + property WantTabs; + property WordWrap; + property OnQueryInsertObject; + property OnChange; + property OnEditValueChanged; + property OnProtectChange; + property OnResizeRequest; + property OnSaveClipboard; + property OnSelectionChange; + property OnURLClick; + property OnURLMove; + end; + + { TcxOleUILinkInfo } + + TcxOleUILinkInfo = class(TcxIUnknownObject, IOleUILinkInfo) + private + FRichEdit: TcxRichInnerEdit; + FReObject: TReObject; + FOleLink: IOleLink; + public + constructor Create(AOwner: TcxRichInnerEdit; AReObject: TReObject); + destructor Destroy; override; + + //IOleUILinkInfo + function GetLastUpdate(dwLink: Longint; var LastUpdate: TFileTime): HResult; stdcall; + + //IOleUILinkContainer + function GetNextLink(dwLink: Longint): Longint; stdcall; + function SetLinkUpdateOptions(dwLink: Longint; dwUpdateOpt: Longint): HResult; stdcall; + function GetLinkUpdateOptions(dwLink: Longint; + var dwUpdateOpt: Longint): HResult; stdcall; + function SetLinkSource(dwLink: Longint; pszDisplayName: PChar; + lenFileName: Longint; var chEaten: Longint; + fValidateSource: BOOL): HResult; stdcall; + function GetLinkSource(dwLink: Longint; var pszDisplayName: PChar; + var lenFileName: Longint; var pszFullLinkType: PChar; + var pszShortLinkType: PChar; var fSourceAvailable: BOOL; + var fIsSelected: BOOL): HResult; stdcall; + function OpenLinkSource(dwLink: Longint): HResult; stdcall; + function UpdateLink(dwLink: Longint; fErrorMessage: BOOL; + fErrorAction: BOOL): HResult; stdcall; + function CancelLink(dwLink: Longint): HResult; stdcall; + end; + + { TcxOleUIObjInfo } + + TcxOleUIObjInfo = class(TcxIUnknownObject, IOleUIObjInfo) + private + FRichEdit: TcxRichInnerEdit; + FReObject: TReObject; + + function GetObjectDataSize: Integer; + public + constructor Create(AOwner: TcxRichInnerEdit; AReObject: TReObject); + + //IOleUIObjInfo + function GetObjectInfo(dwObject: Longint; + var dwObjSize: Longint; var lpszLabel: PChar; + var lpszType: PChar; var lpszShortType: PChar; + var lpszLocation: PChar): HResult; stdcall; + function GetConvertInfo(dwObject: Longint; var ClassID: TCLSID; + var wFormat: Word; var ConvertDefaultClassID: TCLSID; + var lpClsidExclude: PCLSID; var cClsidExclude: Longint): HResult; stdcall; + function ConvertObject(dwObject: Longint; const clsidNew: TCLSID): HResult; stdcall; + function GetViewInfo(dwObject: Longint; var hMetaPict: HGlobal; + var dvAspect: Longint; var nCurrentScale: Integer): HResult; stdcall; + function SetViewInfo(dwObject: Longint; hMetaPict: HGlobal; + dvAspect: Longint; nCurrentScale: Integer; + bRelativeToOrig: BOOL): HResult; stdcall; + end; + + { TcxCustomRichEdit } + + TcxCustomRichEdit = class(TcxCustomMemo) + private + FEditPopupMenu: TComponent; + FIsNullEditValue: Boolean; + FPropertiesChange: Boolean; + procedure DoProtectChange(Sender: TObject; AStartPos, AEndPos: Integer; + var AAllowChange: Boolean); + procedure DoSaveClipboard(Sender: TObject; ANumObjects, ANumChars: Integer; + var ASaveClipboard: Boolean); + procedure EditPopupMenuClick(Sender: TObject); + function GetLines: TStrings; + function GetInnerRich: TcxRichInnerEdit; + procedure SetLines(Value: TStrings); + function GetActiveProperties: TcxCustomRichEditProperties; + function GetProperties: TcxCustomRichEditProperties; + procedure SetProperties(Value: TcxCustomRichEditProperties); + function GetCanUndo: Boolean; + function GetDefAttributes: TTextAttributes; + function GetDefaultConverter: TConversionClass; + function GetPageRect: TRect; + function GetParagraph: TParaAttributes; + function GetSelAttributes: TTextAttributes; + procedure RefreshScrollBars; + procedure SetDefAttributes(const Value: TTextAttributes); + procedure SetDefaultConverter(Value: TConversionClass); + procedure SetPageRect(const Value: TRect); + procedure SetSelAttributes(const Value: TTextAttributes); + procedure EMCanPaste(var Message: TMessage); message EM_CANPASTE; + procedure CMVisibleChanged(var Message: TMessage); message CM_VISIBLECHANGED; + protected + procedure AdjustInnerEdit; override; + function CanFocusOnClick: Boolean; override; + function CanKeyDownModifyEdit(Key: Word; Shift: TShiftState): Boolean; override; + procedure ContainerStyleChanged(Sender: TObject); override; + function DoShowPopupMenu(AMenu: TComponent; X, Y: Integer): Boolean; override; + function GetEditValue: TcxEditValue; override; + function GetInnerEditClass: TControlClass; override; + procedure ChangeHandler(Sender: TObject); override; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); override; + procedure Initialize; override; + procedure InternalSetEditValue(const Value: TcxEditValue; + AValidateEditValue: Boolean); override; + procedure InternalValidateDisplayValue(const ADisplayValue: TcxEditValue); override; + procedure PropertiesChanged(Sender: TObject); override; + procedure ResetEditValue; override; + procedure SetParent(AParent: TWinControl); override; + procedure SynchronizeDisplayValue; override; + procedure SynchronizeEditValue; override; + function UpdateContentOnFocusChanging: Boolean; override; + procedure UpdateScrollBars; override; + function CanDeleteSelection: Boolean; + procedure Changed(Sender: TObject); + procedure DoOnResizeRequest(const R: TRect); + procedure DoOnSelectionChange; + function GetEditPopupMenuInstance: TComponent; virtual; + function IsNavigationKey(Key: Word; Shift: TShiftState): Boolean; virtual; + procedure UpdateEditPopupMenuItems(APopupMenu: TComponent); virtual; + property EditPopupMenu: TComponent read FEditPopupMenu write FEditPopupMenu; + property InnerRich: TcxRichInnerEdit read GetInnerRich; + property PropertiesChange: Boolean read FPropertiesChange; + public + destructor Destroy; override; + + procedure ClearSelection; override; + procedure CutToClipboard; override; + function FindTexT(const ASearchStr: string; AStartPos, ALength: Integer; + AOptions: TSearchTypes): Integer; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + procedure PasteFromClipboard; override; + procedure PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); override; + procedure Print(const Caption: string); virtual; + procedure SaveSelectionToStream(Stream: TStream); virtual; + procedure Undo; override; + function InsertObject: Boolean; + function PasteSpecial: Boolean; + function ShowObjectProperties: Boolean; + class procedure RegisterConversionFormat(const AExtension: string; + AConversionClass: TConversionClass); + property ActiveProperties: TcxCustomRichEditProperties + read GetActiveProperties; + property CanUndo: Boolean read GetCanUndo; + property DefAttributes: TTextAttributes read GetDefAttributes write SetDefAttributes; + property DefaultConverter: TConversionClass + read GetDefaultConverter write SetDefaultConverter; + property Lines: TStrings read GetLines write SetLines; + property PageRect: TRect read GetPageRect write SetPageRect; + property Paragraph: TParaAttributes read GetParagraph; + property Properties: TcxCustomRichEditProperties read GetProperties + write SetProperties; + property SelAttributes: TTextAttributes read GetSelAttributes write SetSelAttributes; + end; + + { TcxRichEdit } + + TcxRichEdit = class(TcxCustomRichEdit) + private + function GetActiveProperties: TcxRichEditProperties; + function GetProperties: TcxRichEditProperties; + procedure SetProperties(Value: TcxRichEditProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxRichEditProperties read GetActiveProperties; + published + property Align; + property Anchors; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxRichEditProperties read GetProperties + write SetProperties; + property Lines; // must be after Properties because of Properties.Alignment + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnMouseWheel; + property OnMouseWheelDown; + property OnMouseWheelUp; + property OnStartDock; + property OnStartDrag; + end; + + TcxRichInnerEditHelper = class(TcxInterfacedPersistent, + IcxContainerInnerControl, IcxCustomInnerEdit, IcxInnerTextEdit, + IcxInnerMemo) + private + FEdit: TcxRichInnerEdit; + protected + property Edit: TcxRichInnerEdit read FEdit; + public + constructor Create(AEdit: TcxRichInnerEdit); reintroduce; virtual; + + // IcxContainerInnerControl + function GetControlContainer: TcxContainer; + function GetControl: TWinControl; + + // IcxCustomInnerEdit + function CallDefWndProc(AMsg: UINT; WParam: WPARAM; + LParam: LPARAM): LRESULT; + function GetEditValue: TcxEditValue; + function GetOnChange: TNotifyEvent; + procedure LockBounds(ALock: Boolean); + procedure SafelySetFocus; + procedure SetEditValue(const Value: TcxEditValue); + procedure SetParent(Value: TWinControl); + procedure SetOnChange(Value: TNotifyEvent); + + // IcxInnerTextEdit + procedure ClearSelection; + procedure CopyToClipboard; + function GetAlignment: TAlignment; + function GetAutoSelect: Boolean; + function GetCharCase: TEditCharCase; + function GetEchoMode: TcxEditEchoMode; + function GetHideSelection: Boolean; + function GetImeLastChar: Char; + function GetImeMode: TImeMode; + function GetImeName: TImeName; + function GetInternalUpdating: Boolean; + function GetMaxLength: Integer; + function GetMultiLine: Boolean; + function GetOEMConvert: Boolean; + function GetOnSelChange: TNotifyEvent; + function GetPasswordChar: TCaptionChar; + function GetReadOnly: Boolean; + function GetSelLength: Integer; + function GetSelStart: Integer; + function GetSelText: string; + procedure SelectAll; + procedure SetAlignment(Value: TAlignment); + procedure SetAutoSelect(Value: Boolean); + procedure SetCharCase(Value: TEditCharCase); + procedure SetEchoMode(Value: TcxEditEchoMode); + procedure SetHideSelection(Value: Boolean); + procedure SetInternalUpdating(Value: Boolean); + procedure SetImeMode(Value: TImeMode); + procedure SetImeName(const Value: TImeName); + procedure SetMaxLength(Value: Integer); + procedure SetOEMConvert(Value: Boolean); + procedure SetOnSelChange(Value: TNotifyEvent); + procedure SetPasswordChar(Value: TCaptionChar); + procedure SetReadOnly(Value: Boolean); + procedure SetSelLength(Value: Integer); + procedure SetSelStart(Value: Integer); + procedure SetSelText(Value: string); + + // IcxInnerMemo + function GetCaretPos: TPoint; + function GetLines: TStrings; + function GetScrollBars: TScrollStyle; + function GetWantReturns: Boolean; + function GetWantTabs: Boolean; + function GetWordWrap: Boolean; + procedure SetCaretPos(const Value: TPoint); + procedure SetScrollBars(Value: TScrollStyle); + procedure SetWantReturns(Value: Boolean); + procedure SetWantTabs(Value: Boolean); + procedure SetWordWrap(Value: Boolean); + end; + + { TcxRichEditStrings } + + TcxRichEditStreamOperation = (esoLoadFrom, esoSaveTo); + + TcxRichEditStreamOperationInfo = record + EditStream: TEditStream; + StreamInfo: TRichEditStreamInfo; + TextType: Longint; + end; + + TcxRichEditStrings = class(TStrings) + private + FConverter: TConversion; + FRichEdit: TcxRichInnerEdit; + FTextType: Longint; + function CalcStreamTextType(AStreamOperation: TcxRichEditStreamOperation; ACustom: Boolean = False; + ACustomStreamModes: TcxRichEditStreamModes = []): Longint; + function GetAllowStreamModesByStreamOperation(AStreamOperation: TcxRichEditStreamOperation): TcxRichEditStreamModes; + function GetStreamModes: TcxRichEditStreamModes; + protected + function Get(Index: Integer): string; override; + procedure InitConverter(const AFileName: string); virtual; + procedure InitStreamOperation(AStream: TStream; + var AStreamOperationInfo: TcxRichEditStreamOperationInfo; + AStreamOperation: TcxRichEditStreamOperation; ACustom: Boolean = False; + ACustomStreamModes: TcxRichEditStreamModes = []); + function GetCount: Integer; override; + procedure Put(Index: Integer; const S: string); override; + procedure SetUpdateState(Updating: Boolean); override; + procedure SetTextStr(const Value: string); override; + function GetLineBreakString: string; virtual; + property RichEdit: TcxRichInnerEdit read FRichEdit; + public + constructor Create(ARichEdit: TcxRichInnerEdit); virtual; + destructor Destroy; override; + procedure Clear; override; + procedure AddStrings(Strings: TStrings); override; + procedure Delete(Index: Integer); override; + procedure Insert(Index: Integer; const S: string); override; + procedure LoadFromFile(const FileName: string); override; + procedure LoadFromStream(Stream: TStream); override; + procedure SaveToFile(const FileName: string); override; + procedure SaveToStream(Stream: TStream); override; + end; + + { TcxRichInnerEdit } + + TcxRichInnerEdit = class(TRichEdit, IUnknown, + IcxContainerInnerControl, IcxInnerEditHelper) + private + FAllowObjects: Boolean; + FAutoSelect: Boolean; + FAutoURLDetect: Boolean; + FURLClickRange: TCharRange; + FURLClickBtn: TMouseButton; + FEchoMode: TcxEditEchoMode; + FEscapePressed: Boolean; + FHelper: TcxRichInnerEditHelper; + FInternalUpdating: Boolean; + FIsEraseBackgroundLocked: Boolean; + FKeyPressProcessed: Boolean; + FLockBoundsCount: Integer; + FMemoMode: Boolean; + FRichEditOle: IUnknown; + FRichEditOleCallback: TObject; + FRichVersion: Integer; + FSavedPlainText: Boolean; + FSelectionBar: Boolean; + FStreamModes: TcxRichEditStreamModes; + FRichLines: TcxRichEditStrings; + FUseCRLF: Boolean; + FOnQueryInsertObject: TcxRichEditQueryInsertObjectEvent; + + // IcxContainerInnerControl + function GetControl: TWinControl; + function GetControlContainer: TcxContainer; + + // IcxInnerEditHelper + function GetHelper: IcxCustomInnerEdit; + + function GetAutoURLDetect: Boolean; + function GetContainer: TcxCustomRichEdit; + function GetLineCount: Integer; + function GetLineIndex(AIndex: Integer): Integer; + function GetLineLength(AIndex: Integer): Integer; + function GetRichLines: TcxRichEditStrings; + function GetRichEditOle: IcxRichEditOle; + function GetRichEditOleCallBack: TcxRichEditOleCallback; + function GetTextRange(AStartPos, AEndPos: Longint): string; + procedure InternalSetMemoMode(AForcedReload: Boolean = False); + procedure SetAllowObjects(Value: Boolean); + procedure SetAutoURLDetect(Value: Boolean); + procedure SetMemoMode(Value: Boolean); + procedure SetRichLines(Value: TcxRichEditStrings); + procedure SetSelectionBar(Value: Boolean); + procedure WMChar(var Message: TWMChar); message WM_CHAR; + procedure WMClear(var Message: TMessage); message WM_CLEAR; + procedure WMCut(var Message: TMessage); message WM_CUT; + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND; + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + procedure WMKeyDown(var Message: TWMKeyDown); message WM_KEYDOWN; + procedure WMKillFocus(var Message: TWMKillFocus); message WM_KILLFOCUS; + procedure WMMButtonDown(var Message: TWMMButtonDown); message WM_MBUTTONDOWN; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure WMPaint(var Message: TWMPaint); message WM_PAINT; + procedure WMPaste(var Message: TMessage); message WM_PASTE; + procedure WMSetFocus(var Message: TWMSetFocus); message WM_SETFOCUS; + procedure WMSetFont(var Message: TWMSetFont); message WM_SETFONT; + procedure WMHScroll(var Message: TWMHScroll); message WM_HSCROLL; + procedure WMVScroll(var Message: TWMVScroll); message WM_VSCROLL; + procedure WMWindowPosChanged(var Message: TWMWindowPosChanged); message WM_WINDOWPOSCHANGED; + procedure WMWindowPosChanging(var Message: TWMWindowPosChanging); message WM_WINDOWPOSCHANGING; + procedure EMReplaceSel(var Message: TMessage); message EM_REPLACESEL; + procedure EMSetCharFormat(var Message: TMessage); message EM_SETCHARFORMAT; + procedure EMSetParaFormat(var Message: TMessage); message EM_SETPARAFORMAT; + procedure CMColorChanged(var Message: TMessage); message CM_COLORCHANGED; + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure CNNotify(var Message: TWMNotify); message CN_NOTIFY; + procedure CNCommand(var Message: TWMCommand); message CN_COMMAND; + procedure CNKeyDown(var Message: TWMKeyDown); message CN_KEYDOWN; + procedure WMGetText(var Message: TMessage); message WM_GETTEXT; + procedure WMGetTextLength(var Message: TWMGetTextLength); message WM_GETTEXTLENGTH; + procedure WMSetText(var Message: TWMSetText); message WM_SETTEXT; + procedure WMIMEComposition(var Message: TMessage); message WM_IME_COMPOSITION; + procedure EMExLineFromChar(var Message: TMessage); message EM_EXLINEFROMCHAR; + procedure EMLineLength(var Message: TMessage); message EM_LINELENGTH; + protected + procedure BeforeInsertObject(var AAllowInsertObject: Boolean; const ACLSID: TCLSID); dynamic; + procedure Click; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + procedure DblClick; override; + procedure DestroyWnd; override; + procedure DoEnter; override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseLeave(AControl: TControl); dynamic; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure RequestAlign; override; + procedure RequestSize(const Rect: TRect); override; + procedure RichCreateParams(var Params: TCreateParams; + out ARichVersion: Integer); virtual; + procedure SelectionChange; override; + procedure URLClick(const AURLText: string; AButton: TMouseButton); dynamic; + procedure URLMove(const AURLText: string); dynamic; + procedure WndProc(var Message: TMessage); override; + function CanPaste: Boolean; + function GetSelection: TCharRange; virtual; + property AllowObjects: Boolean read FAllowObjects write SetAllowObjects default True; + property AutoSelect: Boolean read FAutoSelect write FAutoSelect default False; + property AutoURLDetect: Boolean read GetAutoURLDetect write SetAutoURLDetect default True; + property Container: TcxCustomRichEdit read GetContainer; + property Helper: TcxRichInnerEditHelper read FHelper; + property MemoMode: Boolean read FMemoMode write SetMemoMode default False; + property RichVersion: Integer read FRichVersion write FRichVersion; + property RichEditOle: IcxRichEditOle read GetRichEditOle; + property RichEditOleCallBack: TcxRichEditOleCallback read GetRichEditOleCallBack; + property SelectionBar: Boolean read FSelectionBar write SetSelectionBar + default False; + property StreamModes: TcxRichEditStreamModes read FStreamModes + write FStreamModes default []; + property OnQueryInsertObject: TcxRichEditQueryInsertObjectEvent + read FOnQueryInsertObject write FOnQueryInsertObject; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + procedure DefaultHandler(var Message); override; + procedure DragDrop(Source: TObject; X, Y: Integer); override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + function FindTexT(const ASearchStr: string; + AStartPos, ALength: Longint; AOptions: TSearchTypes): Integer; + function InsertObject: Boolean; + function ShowObjectProperties: Boolean; + function PasteSpecial: Boolean; + procedure Print(const Caption: string); override; + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; + function UpdateAction(Action: TBasicAction): Boolean; override; + function CanFocus: Boolean; override; + function CanRedo: Boolean; virtual; + procedure Redo; virtual; + procedure Undo; virtual; + property RichLines: TcxRichEditStrings + read GetRichLines write SetRichLines; + end; + +function AdjustRichLineBreaks(ADest, ASource: PChar; AShortBreak: Boolean = False): Integer; +procedure SetRichEditText(ARichEdit: TRichEdit; + const AEditValue: TcxEditValue); + +implementation + +uses + CommDlg, Printers, cxEditPaintUtils, cxEditUtils, cxExtEditConsts, cxVariants, + cxDWMAPI, dxUxTheme, dxThemeConsts, dxThemeManager, ComObj, CommCtrl, + Math, Types; + +type + TcxRichEditNames = array of string; + TStringsAccess = class(TStrings); + PcxENLink = ^TENLink; + +const + RTFConversionFormat: TConversionFormat = ( + ConversionClass: TConversion; + Extension: 'rtf'; + Next: nil + ); + TextConversionFormat: TConversionFormat = ( + ConversionClass: TConversion; + Extension: 'txt'; + Next: @RTFConversionFormat + ); + cxRichReadError = $0001; + cxRichWriteError = $0002; + cxRichNoError = $0000; + +const + cxRichEditVersions: array[0..4] of Integer = + (100, 200, 300, 410, 500); + +const + // Flags to specify which interfaces should be returned in the structure above + REO_GETOBJ_NO_INTERFACES = $00000000; + REO_GETOBJ_POLEOBJ = $00000001; + REO_GETOBJ_PSTG = $00000002; + REO_GETOBJ_POLESITE = $00000004; + REO_GETOBJ_ALL_INTERFACES = $00000007; + + // Place object at selection + REO_CP_SELECTION = $FFFFFFFF; + + // Use character position to specify object instead of index + REO_IOB_SELECTION = $FFFFFFFF; + REO_IOB_USE_CP = $FFFFFFFE; + + // Object flags + REO_NULL = $00000000; // No flags + REO_READWRITEMASK = $0000003F; // Mask out RO bits + REO_DONTNEEDPALETTE = $00000020; // Object doesn't need palette + REO_BLANK = $00000010; // Object is blank + REO_DYNAMICSIZE = $00000008; // Object defines size always + REO_INVERTEDSELECT = $00000004; // Object drawn all inverted if sel + REO_BELOWBASELINE = $00000002; // Object sits below the baseline + REO_RESIZABLE = $00000001; // Object may be resized + REO_LINK = $80000000; // Object is a link (RO) + REO_STATIC = $40000000; // Object is static (RO) + REO_SELECTED = $08000000; // Object selected (RO) + REO_OPEN = $04000000; // Object open in its server (RO) + REO_INPLACEACTIVE = $02000000; // Object in place active (RO) + REO_HILITED = $01000000; // Object is to be hilited (RO) + REO_LINKAVAILABLE = $00800000; // Link believed available (RO) + REO_GETMETAFILE = $00400000; // Object requires metafile (RO) + + RECO_PASTE = $00000000; // paste from clipboard + RECO_DROP = $00000001; // drop + RECO_COPY = $00000002; // copy to the clipboard + RECO_CUT = $00000003; // cut to the clipboard + RECO_DRAG = $00000004; // drag + + cxDataFormatCount = 6; + cxPasteFormatCount = 6; + +var + FRichEditLibrary: HMODULE = 0; + FRichRenderer, FRichConverter: TcxRichInnerEdit; + FConversionFormatList: PConversionFormat = @TextConversionFormat; + + FRichEditDLLNames: TcxRichEditNames; + FRichEditClassNames: TcxRichEditNames; + + CFObjectDescriptor: Integer; + CFEmbeddedObject: Integer; + CFLinkSource: Integer; + CFRtf: Integer; + CFRETextObj: Integer; + +procedure ReleaseObject(var AObj); +begin + if IUnknown(AObj) <> nil then + IUnknown(AObj)._Release; + IUnknown(AObj) := nil; +end; + +function cxIsFormMDIChild(AForm: TCustomForm): Boolean; +begin + Result := (AForm is TForm) and (TForm(AForm).FormStyle = fsMDIChild); +end; + +function cxSetDrawAspect(AOleObject: IOleObject; AIconic: Boolean; + AIconMetaPict: HGlobal; var ADrawAspect: Cardinal): HResult; +var + AOleCache: IOleCache; + AEnumStatData: IEnumStatData; + AOldAspect: Cardinal; + AAdviseFlags, AConnection: Longint; + ATempMetaPict: HGlobal; + AFormatEtc: TFormatEtc; + AMedium: TStgMedium; + AClassID: TCLSID; + AStatData: TStatData; + AViewObject: IViewObject; +begin + AOldAspect := ADrawAspect; + if AIconic then + begin + ADrawAspect := DVASPECT_ICON; + AAdviseFlags := ADVF_NODATA; + end else + begin + ADrawAspect := DVASPECT_CONTENT; + AAdviseFlags := ADVF_PRIMEFIRST; + end; + if (ADrawAspect <> AOldAspect) or (ADrawAspect = DVASPECT_ICON) then + begin + AOleCache := AOleObject as IOleCache; + if ADrawAspect <> AOldAspect then + begin + OleCheck(AOleCache.EnumCache(AEnumStatData)); + if AEnumStatData <> nil then + while AEnumStatData.Next(1, AStatData, nil) = 0 do + if AStatData.formatetc.dwAspect = Integer(AOldAspect) then + AOleCache.Uncache(AStatData.dwConnection); + FillChar(AFormatEtc, SizeOf(FormatEtc), 0); + AFormatEtc.dwAspect := ADrawAspect; + AFormatEtc.lIndex := -1; + OleCheck(AOleCache.Cache(AFormatEtc, AAdviseFlags, AConnection)); + if AOleObject.QueryInterface(IViewObject, AViewObject) = 0 then + AViewObject.SetAdvise(ADrawAspect, 0, nil); + end; + if ADrawAspect = DVASPECT_ICON then + begin + ATempMetaPict := 0; + if AIconMetaPict = 0 then + begin + OleCheck(AOleObject.GetUserClassID(AClassID)); + ATempMetaPict := OleGetIconOfClass(AClassID, nil, True); + AIconMetaPict := ATempMetaPict; + end; + try + with AFormatEtc do + begin + cfFormat := CF_METAFILEPICT; + ptd := nil; + dwAspect := DVASPECT_ICON; + lindex := -1; + tymed := TYMED_MFPICT; + end; + with AMedium do + begin + tymed := TYMED_MFPICT; + hMetaFilePict := AIconMetaPict; + unkForRelease := nil; + end; + OleCheck(AOleCache.SetData(AFormatEtc, AMedium, False)); + finally + DestroyMetaPict(ATempMetaPict); + end; + end; + if ADrawAspect <> DVASPECT_ICON then + AOleObject.Update; + end; + Result := S_OK; +end; + +procedure cxCreateStorage(var AStorage: IStorage); +var + ALockBytes: ILockBytes; +begin + OleCheck(CreateILockBytesOnHGlobal(0, True, ALockBytes)); + OleCheck(StgCreateDocfileOnILockBytes(ALockBytes, STGM_READWRITE + or STGM_SHARE_EXCLUSIVE or STGM_CREATE, 0, AStorage)); + ReleaseObject(ALockBytes); +end; + +function cxWStrLen(AStr: PWideChar): Integer; +begin + Result := 0; + while AStr[Result] <> #0 do Inc(Result); +end; + +procedure cxCenterWindow(Wnd: HWnd); +var + Rect: TRect; +begin + GetWindowRect(Wnd, Rect); + SetWindowPos(Wnd, 0, + (GetSystemMetrics(SM_CXSCREEN) - Rect.Right + Rect.Left) div 2, + (GetSystemMetrics(SM_CYSCREEN) - Rect.Bottom + Rect.Top) div 3, + 0, 0, SWP_NOACTIVATE or SWP_NOSIZE or SWP_NOZORDER); +end; + +function cxOleDialogHook(Wnd: HWnd; Msg, WParam, LParam: Longint): Longint; stdcall; +begin + Result := 0; + if Msg = WM_INITDIALOG then + begin + if GetWindowLong(Wnd, GWL_STYLE) and WS_CHILD <> 0 then + Wnd := GetWindowLong(Wnd, GWL_HWNDPARENT); + cxCenterWindow(Wnd); + Result := 1; + end; +end; + +function cxOleStdGetFirstMoniker(const AMoniker: IMoniker): IMoniker; +var + AMksys: Longint; + AEnumMoniker: IEnumMoniker; +begin + Result := nil; + if AMoniker <> nil then + begin + if (AMoniker.IsSystemMoniker(AMksys) = 0) and + (AMksys = MKSYS_GENERICCOMPOSITE) then + begin + if AMoniker.Enum(True, AEnumMoniker) <> 0 then Exit; + AEnumMoniker.Next(1, Result, nil); + end + else + Result := AMoniker; + end; +end; + +function cxOleStdGetLenFilePrefixOfMoniker(const AMoniker: IMoniker): Integer; +var + AMkFirst: IMoniker; + ABindCtx: IBindCtx; + AMksys: Longint; + P: PWideChar; +begin + Result := 0; + if AMoniker <> nil then + begin + AMkFirst := cxOleStdGetFirstMoniker(AMoniker); + if (AMkFirst <> nil) and + (AMkFirst.IsSystemMoniker(AMksys) = 0) and + (AMksys = MKSYS_FILEMONIKER) and + (CreateBindCtx(0, ABindCtx) = 0) and + (AMkFirst.GetDisplayName(ABindCtx, nil, P) = 0) and (P <> nil) then + begin + Result := cxWStrLen(P); + CoTaskMemFree(P); + end; + end; +end; + +function cxCoAllocCStr(const S: string): PChar; +begin + Result := StrCopy(CoTaskMemAlloc(Length(S) + 1), PChar(S)); +end; + +function cxGetOleLinkDisplayName(const AOleLink: IOleLink): PChar; +var + P: PWideChar; +begin + AOleLink.GetSourceDisplayName(P); + Result := cxCoAllocCStr(WideCharToString(P)); +end; + +function cxGetOleObjectFullName(const AOleObject: IOleObject): PChar; +var + P: PWideChar; +begin + AOleObject.GetUserType(USERCLASSTYPE_FULL, P); + Result := cxCoAllocCStr(WideCharToString(P)); + CoTaskMemFree(P); +end; + +function cxGetOleObjectShortName(const AOleObject: IOleObject): PChar; +var + P: PWideChar; +begin + AOleObject.GetUserType(USERCLASSTYPE_SHORT, P); + Result := cxCoAllocCStr(WideCharToString(P)); + CoTaskMemFree(P); +end; + +function cxGetIconMetaPict(AOleObject: IOleObject; ADrawAspect: Longint): HGlobal; +var + ADataObject: IDataObject; + AFormatEtc: TFormatEtc; + AMedium: TStgMedium; + AClassID: TCLSID; +begin + Result := 0; + if ADrawAspect = DVASPECT_ICON then + begin + AOleObject.QueryInterface(IDataObject, ADataObject); + if ADataObject <> nil then + begin + with AFormatEtc do + begin + cfFormat := CF_METAFILEPICT; + ptd := nil; + dwAspect := DVASPECT_ICON; + lIndex := -1; + tymed := TYMED_MFPICT; + end; + if Succeeded(ADataObject.GetData(AFormatEtc, AMedium)) then + Result := AMedium.hMetaFilePict; + ReleaseObject(ADataObject); + end; + end; + if Result = 0 then + begin + OleCheck(AOleObject.GetUserClassID(AClassID)); + Result := OleGetIconOfClass(AClassID, nil, True); + end; +end; + +function cxRichEditGetOleInterface(ARichEdit: TcxRichInnerEdit; + out AOleInterface: IcxRichEditOle): Boolean; +begin + Result := Assigned(ARichEdit) and ARichEdit.HandleAllocated and + Boolean(SendMessage(ARichEdit.Handle, EM_GETOLEINTERFACE, 0, longint(@AOleInterface))); +end; + +function cxRichEditSetOleCallback(ARichEdit: TcxRichInnerEdit; + AOleInterface: IcxRichEditOleCallback): Boolean; +begin + Result := Assigned(ARichEdit) and ARichEdit.HandleAllocated and + Boolean(SendMessage(ARichEdit.Handle, EM_SETOLECALLBACK, 0, longint(AOleInterface))); +end; + +function cxGetVCLFrameForm(AForm: TCustomForm): IVCLFrameForm; +begin + if AForm.OleFormObject = nil then + TOleForm.Create(AForm); + Result := AForm.OleFormObject as IVCLFrameForm; +end; + +function cxSendStructMessageEx(AHandle: THandle; AMsg: UINT; const AStructure; AParam: Integer; AStructureIsLParam: Boolean): LRESULT; overload; +begin + if AStructureIsLParam then + Result := SendMessage(AHandle, AMsg, AParam, Integer(@AStructure)) + else + Result := SendMessage(AHandle, AMsg, Integer(@AStructure), AParam); +end; + +function cxSendStructMessage(AHandle: THandle; AMsg: UINT; WParam: WPARAM; const LParam): LRESULT; overload; +begin + Result := cxSendStructMessageEx(AHandle, AMsg, LParam, WParam, True); +end; + +function cxSendStructMessage(AHandle: THandle; AMsg: UINT; const WParam; LParam: LParam): LRESULT; overload; +begin + Result := cxSendStructMessageEx(AHandle, AMsg, WParam, LParam, False); +end; + +function cxRichEditDLLNames: TcxRichEditNames; + + procedure InitRichEditDLLNames; + const + cxRichEditDLLNamesCount = 3; + begin + SetLength(FRichEditDLLNames, cxRichEditDLLNamesCount); + FRichEditDLLNames[0] := 'Riched32.dll'; + FRichEditDLLNames[1] := 'Riched20.dll'; + FRichEditDLLNames[2] := 'Msftedit.dll'; + end; + +begin + if Length(FRichEditDLLNames) = 0 then + InitRichEditDLLNames; + Result := FRichEditDLLNames; +end; + +function cxRichEditClassNames: TcxRichEditNames; + + procedure InitRichEditClassNames; + const + cxRichEditClassNamesCount = 5; + begin + SetLength(FRichEditClassNames, cxRichEditClassNamesCount); + FRichEditClassNames[0] := 'RICHEDIT'; + FRichEditClassNames[1] := 'RICHEDIT20'; + FRichEditClassNames[2] := 'RICHEDIT30'; + FRichEditClassNames[3] := 'RICHEDIT41'; + FRichEditClassNames[4] := 'RICHEDIT50'; + end; + +begin + if Length(FRichEditClassNames) = 0 then + InitRichEditClassNames; + Result := FRichEditClassNames; +end; + +function AdjustRichLineBreaks(ADest, ASource: PChar; AShortBreak: Boolean = False): Integer; +var + APrevDest: PChar; +begin + APrevDest := ADest; + repeat + if ASource^ in [#13, #10] then + begin + if AShortBreak then + ADest^ := #13 + else + begin + PWord(ADest)^ := $0A0D; + Inc(ADest); + end; + if PWord(ASource)^ = $0A0D then + Inc(ASource); + end + else + ADest^ := ASource^; + Inc(ASource); + Inc(ADest); + until ASource^ = Char(0); + ADest^ := #0; + Result := ADest - APrevDest; +end; + +function cxRichEditStreamLoad(dwCookie: Longint; pbBuff: PByte; + cb: Longint; var pcb: Longint): Longint; stdcall; +var + ABuffer, P: PChar; + AStreamInfo: PRichEditStreamInfo; +begin + Result := cxRichNoError; + AStreamInfo := PRichEditStreamInfo(Pointer(dwCookie)); + ABuffer := StrAlloc(cb + 1); + try + cb := cb div 2; + pcb := 0; + P := ABuffer + cb; + try + if AStreamInfo^.Converter <> nil then + pcb := AStreamInfo^.Converter.ConvertReadStream(AStreamInfo^.Stream, P, + cb); + if pcb > 0 then + begin + P[pcb] := #0; + if P[pcb - 1] = #13 then + P[pcb - 1] := #0; + pcb := AdjustRichLineBreaks(ABuffer, P); + Move(ABuffer^, pbBuff^, pcb); + end; + except + Result := cxRichReadError; + end; + finally + StrDispose(ABuffer); + end; +end; + +function cxRichEditStreamSave(dwCookie: Longint; pbBuff: PByte; cb: Longint; + var pcb: Longint): Longint; stdcall; +var + AStreamInfo: PRichEditStreamInfo; +begin + Result := cxRichNoError; + AStreamInfo := PRichEditStreamInfo(Pointer(dwCookie)); + try + pcb := 0; + if AStreamInfo^.Converter <> nil then + pcb := AStreamInfo^.Converter.ConvertWriteStream(AStreamInfo^.Stream, + PChar(pbBuff), cb); + except + Result := cxRichWriteError; + end; +end; + +function IsRichText(const AText: string): Boolean; +const + ARichPrefix = '{\rtf'; +begin + Result := Copy(AText, 1, Length(ARichPrefix)) = ARichPrefix; +end; + +procedure LoadRichFromString(ALines: TStrings; const S: string); + + procedure PrepareStream( + AStream: TStringStream); + begin + end; + +var + AStream: TStringStream; +begin + AStream := TStringStream.Create(S); + try + PrepareStream(AStream); + ALines.LoadFromStream(AStream); + finally + AStream.Free; + end; +end; + +procedure ReleaseConversionFormatList; +var + AConversionFormatList: PConversionFormat; +begin + while FConversionFormatList <> @TextConversionFormat do + begin + AConversionFormatList := FConversionFormatList^.Next; + Dispose(FConversionFormatList); + FConversionFormatList := AConversionFormatList; + end; +end; + +function CreateInnerRich: TcxRichInnerEdit; +begin + Result := nil; + if Application.Handle <> 0 then + begin + Result := TcxRichInnerEdit.Create(nil); + Result.ParentWindow := Application.Handle; + SendMessage(Result.Handle, EM_SETEVENTMASK, 0, 0); + end; +end; + +function RichRenderer: TcxRichInnerEdit; +begin + if FRichRenderer = nil then + FRichRenderer := CreateInnerRich; + Result := FRichRenderer; +end; + +function RichConverter: TcxRichInnerEdit; +begin + if FRichConverter = nil then + FRichConverter := CreateInnerRich; + Result := FRichConverter; +end; + +procedure InternalSetRichEditText(ARichEdit: TRichEdit; const AText: string); +begin + if not ARichEdit.PlainText then + LoadRichFromString(ARichEdit.Lines, AText) + else + ARichEdit.Perform(WM_SETTEXT, 0, Longint(PChar(AText))); +end; + +function ConvertRichText(const AText: string): string; +begin + InternalSetRichEditText(RichConverter, AText); + Result := RichConverter.Text; +end; + +procedure SetRichDefAttributes(AEdit: TRichEdit; AFont: TFont; ATextColor: TColor); +begin + if not AEdit.HandleAllocated then + Exit; + + AEdit.DefAttributes.Assign(AFont); + AEdit.DefAttributes.Color := ATextColor; +end; + +procedure InitRichRenderer(AProperties: TcxCustomRichEditProperties; + AFont: TFont; AColor, ATextColor: TColor; const AText: string); +begin + with RichRenderer do + begin + MemoMode := TcxCustomRichEditProperties(AProperties).MemoMode; + PlainText := TcxCustomRichEditProperties(AProperties).PlainText; + Alignment := TcxCustomRichEditProperties(AProperties).Alignment; + AutoURLDetect := TcxCustomRichEditProperties(AProperties).AutoURLDetect; + AllowObjects := TcxCustomRichEditProperties(AProperties).AllowObjects; + HandleNeeded; + + if not RichRenderer.MemoMode then + LoadRichFromString(RichLines, AText) + else + Text := AText; + + if not IsRichText(AText) or MemoMode or PlainText then + SetRichDefAttributes(RichRenderer, AFont, ATextColor); + SendMessage(Handle, EM_SETBKGNDCOLOR, 0, ColorToRGB(AColor)); + end; +end; + +procedure DrawRichEdit(ADC: HDC; const ARect: TRect; const AText: string; + AProperties: TcxCustomRichEditProperties; AFont: TFont; + AColor, ATextColor: TColor; ACalculateHeight: Boolean; out AHeight: Integer); +const + TwipsPerInch = 1440; +var + AFormatRange: TFormatRange; + AStartIndex: Integer; +begin + if not ACalculateHeight then + FillRect(ADC, Rect(0, 0, ARect.Right - ARect.Left, + ARect.Bottom - ARect.Top), GetSolidBrush(AColor)); + InitRichRenderer(AProperties, AFont, AColor, ATextColor, AText); + SendMessage(RichRenderer.Handle, EM_FORMATRANGE, 0, 0); + + if ACalculateHeight then + AHeight := 0; + AFormatRange.hdc := ADC; + AFormatRange.hdcTarget := ADC; + AFormatRange.chrg.cpMin := 0; + AFormatRange.chrg.cpMax := -1; + repeat + AFormatRange.rc := cxEmptyRect; + AFormatRange.rc.Right := (ARect.Right - ARect.Left) * TwipsPerInch div GetDeviceCaps(ADC, LOGPIXELSX); + if ACalculateHeight then + AFormatRange.rc.Bottom := TwipsPerInch + else + AFormatRange.rc.Bottom := (ARect.Bottom - ARect.Top)(*65535*) * TwipsPerInch div GetDeviceCaps(ADC, LOGPIXELSY); + AFormatRange.rcPage := AFormatRange.rc; + AStartIndex := AFormatRange.chrg.cpMin; + AFormatRange.chrg.cpMin := cxSendStructMessage(RichRenderer.Handle, EM_FORMATRANGE, + WPARAM(not ACalculateHeight), AFormatRange); + if AFormatRange.chrg.cpMin <= AStartIndex then + Break; + if ACalculateHeight then + Inc(AHeight, AFormatRange.rc.Bottom - AFormatRange.rc.Top); + until not ACalculateHeight; + if ACalculateHeight then + AHeight := AHeight * GetDeviceCaps(ADC, LOGPIXELSY) div TwipsPerInch; + + SendMessage(RichRenderer.Handle, EM_FORMATRANGE, 0, 0); +end; + +procedure SetRichEditText(ARichEdit: TRichEdit; const AEditValue: TcxEditValue); +begin + InternalSetRichEditText(ARichEdit, VarToStr(AEditValue)); +end; + +{ TcxRichEdit } + +class function TcxRichEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxRichEditProperties; +end; + +function TcxRichEdit.GetActiveProperties: TcxRichEditProperties; +begin + Result := TcxRichEditProperties(InternalGetActiveProperties); +end; + +function TcxRichEdit.GetProperties: TcxRichEditProperties; +begin + Result := TcxRichEditProperties(FProperties); +end; + +procedure TcxRichEdit.SetProperties(Value: TcxRichEditProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxRichInnerEditHelper } + +constructor TcxRichInnerEditHelper.Create(AEdit: TcxRichInnerEdit); +begin + inherited Create(nil); + FEdit := AEdit; + FEdit.PlainText := False; + FEdit.WordWrap := False; +end; + +function TcxRichInnerEditHelper.GetControl: TWinControl; +begin + Result := Edit; +end; + +procedure TcxRichInnerEditHelper.LockBounds(ALock: Boolean); +begin + with Edit do + if ALock then + Inc(FLockBoundsCount) + else + if FLockBoundsCount > 0 then + Dec(FLockBoundsCount); +end; + +function TcxRichInnerEditHelper.GetOnChange: TNotifyEvent; +begin + Result := Edit.OnChange; +end; + +procedure TcxRichInnerEditHelper.SafelySetFocus; +var + APrevAutoSelect: Boolean; +begin + with Edit do + begin + APrevAutoSelect := AutoSelect; + AutoSelect := False; + SetFocus; + AutoSelect := APrevAutoSelect; + end; +end; + +function TcxRichInnerEditHelper.CallDefWndProc(AMsg: UINT; WParam: WPARAM; + LParam: LPARAM): LRESULT; +begin + Result := CallWindowProc(Edit.DefWndProc, Edit.Handle, AMsg, WParam, LParam); +end; + +function TcxRichInnerEditHelper.GetEditValue: TcxEditValue; +begin + with Edit do + Result := Text; +end; + +procedure TcxRichInnerEditHelper.SetEditValue(const Value: TcxEditValue); +var + AContainer: TcxCustomRichEdit; +begin + AContainer := Edit.Container; + if AContainer.PropertiesChange then + Exit; + + if AContainer.ActiveProperties.MemoMode or not CanAllocateHandle(Edit) then + Edit.Text := VarToStr(Value) + else + begin + Edit.Container.LockChangeEvents(True); + try + Edit.HandleNeeded; + LoadRichFromString(Edit.RichLines, VarToStr(Value)); + finally + Edit.Container.LockChangeEvents(False); + end; + end; +end; + +procedure TcxRichInnerEditHelper.SetParent(Value: TWinControl); +begin + Edit.Parent := Value; +end; + +procedure TcxRichInnerEditHelper.SetOnChange(Value: TNotifyEvent); +begin + Edit.OnChange := Value; +end; + +// IcxInnerTextEdit +procedure TcxRichInnerEditHelper.ClearSelection; +begin + Edit.ClearSelection; +end; + +procedure TcxRichInnerEditHelper.CopyToClipboard; +begin + Edit.CopyToClipboard; +end; + +function TcxRichInnerEditHelper.GetAlignment: TAlignment; +begin + Result := Edit.Alignment; +end; + +function TcxRichInnerEditHelper.GetAutoSelect: Boolean; +begin + Result := Edit.AutoSelect; +end; + +function TcxRichInnerEditHelper.GetCharCase: TEditCharCase; +begin + Result := Edit.CharCase; +end; + +function TcxRichInnerEditHelper.GetEchoMode: TcxEditEchoMode; +begin + Result := eemNormal; +end; + +function TcxRichInnerEditHelper.GetHideSelection: Boolean; +begin + Result := Edit.HideSelection; +end; + +function TcxRichInnerEditHelper.GetInternalUpdating: Boolean; +begin + Result := Edit.FInternalUpdating; +end; + +function TcxRichInnerEditHelper.GetMaxLength: Integer; +begin + Result := Edit.MaxLength; +end; + +function TcxRichInnerEditHelper.GetMultiLine: Boolean; +begin + Result := True; +end; + +function TcxRichInnerEditHelper.GetOEMConvert: Boolean; +begin + Result := Edit.OEMConvert; +end; + +function TcxRichInnerEditHelper.GetOnSelChange: TNotifyEvent; +begin + Result := Edit.OnSelectionChange; +end; + +function TcxRichInnerEditHelper.GetPasswordChar: TCaptionChar; +begin + Result := #0; +end; + +function TcxRichInnerEditHelper.GetReadOnly: Boolean; +begin + Result := Edit.ReadOnly; +end; + +function TcxRichInnerEditHelper.GetSelLength: Integer; +begin + Result := Edit.SelLength; +end; + +function TcxRichInnerEditHelper.GetSelStart: Integer; +begin + Result := Edit.SelStart; +end; + +function TcxRichInnerEditHelper.GetSelText: string; +begin + Result := Edit.SelText; +end; + +procedure TcxRichInnerEditHelper.SelectAll; +begin + if not Edit.Container.IsInplace then + Edit.SelectAll; +end; + +procedure TcxRichInnerEditHelper.SetAlignment(Value: TAlignment); +begin + Edit.Alignment := Value; +end; + +procedure TcxRichInnerEditHelper.SetAutoSelect(Value: Boolean); +begin + Edit.AutoSelect := Value; +end; + +procedure TcxRichInnerEditHelper.SetCharCase(Value: TEditCharCase); +begin + Edit.CharCase := Value; +end; + +procedure TcxRichInnerEditHelper.SetEchoMode(Value: TcxEditEchoMode); +begin +end; + +procedure TcxRichInnerEditHelper.SetHideSelection(Value: Boolean); +begin + if not Edit.Container.IsInplace then + Edit.HideSelection := Value; +end; + +procedure TcxRichInnerEditHelper.SetInternalUpdating(Value: Boolean); +begin + Edit.FInternalUpdating := Value; +end; + +procedure TcxRichInnerEditHelper.SetImeMode(Value: TImeMode); +begin + Edit.ImeMode := Value; +end; + +procedure TcxRichInnerEditHelper.SetImeName(const Value: TImeName); +begin + Edit.ImeName := Value; +end; + +procedure TcxRichInnerEditHelper.SetMaxLength(Value: Integer); +begin + Edit.MaxLength := Value; +end; + +procedure TcxRichInnerEditHelper.SetOEMConvert(Value: Boolean); +begin + Edit.OEMConvert := Value; +end; + +procedure TcxRichInnerEditHelper.SetOnSelChange(Value: TNotifyEvent); +begin + Edit.OnSelectionChange := Value; +end; + +procedure TcxRichInnerEditHelper.SetPasswordChar(Value: TCaptionChar); +begin +end; + +procedure TcxRichInnerEditHelper.SetReadOnly(Value: Boolean); +begin + Edit.ReadOnly := Value; +end; + +procedure TcxRichInnerEditHelper.SetSelLength(Value: Integer); +begin + Edit.SelLength := Value; +end; + +procedure TcxRichInnerEditHelper.SetSelStart(Value: Integer); +begin + with Edit do + SelStart := Value; +end; + +procedure TcxRichInnerEditHelper.SetSelText(Value: string); +begin + Edit.SelText := Value; +end; + +function TcxRichInnerEditHelper.GetImeLastChar: Char; +begin + Result := #0; +end; + +function TcxRichInnerEditHelper.GetImeMode: TImeMode; +begin + Result := Edit.ImeMode; +end; + +function TcxRichInnerEditHelper.GetImeName: TImeName; +begin + Result := Edit.ImeName; +end; + +function TcxRichInnerEditHelper.GetControlContainer: TcxContainer; +begin + Result := Edit.Container; +end; + +// IcxInnerMemo +function TcxRichInnerEditHelper.GetCaretPos: TPoint; +begin + Result := Edit.CaretPos; +end; + +function TcxRichInnerEditHelper.GetLines: TStrings; +begin + Result := Edit.Lines; +end; + +function TcxRichInnerEditHelper.GetScrollBars: TScrollStyle; +begin + Result := Edit.ScrollBars; +end; + +function TcxRichInnerEditHelper.GetWantReturns: Boolean; +begin + Result := Edit.WantReturns; +end; + +function TcxRichInnerEditHelper.GetWantTabs: Boolean; +begin + Result := Edit.WantTabs; +end; + +function TcxRichInnerEditHelper.GetWordWrap: Boolean; +begin + Result := Edit.WordWrap; +end; + +procedure TcxRichInnerEditHelper.SetCaretPos(const Value: TPoint); +begin + SetMemoCaretPos(Edit, Value); +end; + +procedure TcxRichInnerEditHelper.SetScrollBars(Value: TScrollStyle); +begin + Edit.ScrollBars := Value; +end; + +procedure TcxRichInnerEditHelper.SetWantReturns(Value: Boolean); +begin + Edit.WantReturns := Value; +end; + +procedure TcxRichInnerEditHelper.SetWantTabs(Value: Boolean); +begin + Edit.WantTabs := Value; +end; + +procedure TcxRichInnerEditHelper.SetWordWrap(Value: Boolean); +begin + Edit.WordWrap := Value; +end; + +{ TcxRichEditStrings } + +constructor TcxRichEditStrings.Create(ARichEdit: TcxRichInnerEdit); +begin + inherited Create; + FRichEdit := ARichEdit; + FTextType := SF_TEXT; +end; + +destructor TcxRichEditStrings.Destroy; +begin + FreeAndNil(FConverter); + inherited Destroy; +end; + +procedure TcxRichEditStrings.Clear; +begin + if Count > 0 then + RichEdit.Lines.Clear; +end; + +function TcxRichEditStrings.CalcStreamTextType(AStreamOperation: TcxRichEditStreamOperation; ACustom: Boolean; + ACustomStreamModes: TcxRichEditStreamModes): Longint; +var + AStreamModes, AAllowStreamModes: TcxRichEditStreamModes; +begin + if ACustom then + AStreamModes := ACustomStreamModes + else + AStreamModes := GetStreamModes; + AAllowStreamModes := GetAllowStreamModesByStreamOperation(AStreamOperation); + if RichEdit.MemoMode or RichEdit.PlainText then + begin + Result := SF_TEXT; + if (resmUnicode in AStreamModes) and (resmUnicode in AAllowStreamModes) then + Result := Result or SF_UNICODE; + if (resmTextIzed in AStreamModes) and (resmTextIzed in AAllowStreamModes) then + Result := SF_TEXTIZED; + end + else + begin + Result := SF_RTF; + if (resmRtfNoObjs in AStreamModes) and (resmRtfNoObjs in AAllowStreamModes) then + Result := SF_RTFNOOBJS; + if (resmPlainRtf in AStreamModes) and (resmPlainRtf in AAllowStreamModes) then + Result := Result or SFF_PLAINRTF; + end; + if (resmSelection in AStreamModes) and (resmSelection in AAllowStreamModes) then + Result := Result or SFF_SELECTION; +end; + +function TcxRichEditStrings.GetAllowStreamModesByStreamOperation(AStreamOperation: TcxRichEditStreamOperation): TcxRichEditStreamModes; +begin + if AStreamOperation = esoSaveTo then + Result := [resmSelection, resmPlainRtf, resmRtfNoObjs, resmUnicode, resmTextIzed] + else + Result := [resmSelection, resmPlainRtf, resmUnicode]; +end; + +function TcxRichEditStrings.GetStreamModes: TcxRichEditStreamModes; +begin + Result := FRichEdit.StreamModes; +end; + +procedure TcxRichEditStrings.AddStrings(Strings: TStrings); +var + APrevSelectionChange: TNotifyEvent; +begin + APrevSelectionChange := RichEdit.OnSelectionChange; + RichEdit.OnSelectionChange := nil; + try + inherited AddStrings(Strings); + finally + RichEdit.OnSelectionChange := APrevSelectionChange; + end; +end; + +procedure TcxRichEditStrings.Delete(Index: Integer); +begin + FRichEdit.Lines.Delete(Index); +end; + +procedure TcxRichEditStrings.Insert(Index: Integer; const S: string); +var + AFormat: string; + AStr: PChar; + ASelection: TCharRange; +begin + if (Index < 0) or (Index > Count) then + Exit; + + ASelection.cpMin := FRichEdit.GetLineIndex(Index); + if ASelection.cpMin < 0 then + begin + ASelection.cpMin := FRichEdit.GetLineIndex(Index - 1); + if ASelection.cpMin < 0 then + ASelection.cpMin := 0 + else + ASelection.cpMin := ASelection.cpMin + FRichEdit.GetLineLength(Index - 1); + AFormat := GetLineBreakString + '%s'; + end + else + AFormat := '%s'+ GetLineBreakString; + + ASelection.cpMax := ASelection.cpMin; + AStr := PChar(Format(AFormat, [S])); + cxSendStructMessage(FRichEdit.Handle, EM_EXSETSEL, 0, ASelection); + AdjustRichLineBreaks(AStr, PChar(Format(AFormat, [S])), Length(GetLineBreakString) = 1); + SendMessage(FRichEdit.Handle, EM_REPLACESEL, 0, LongInt(AStr)); + + if FRichEdit.SelStart <> (ASelection.cpMax + Length(WideString(AStr))) then + raise EOutOfResources.Create( + cxGetResourceString(@cxSEditRichEditLineInsertionError)); +end; + +procedure TcxRichEditStrings.LoadFromFile(const FileName: string); +begin + InitConverter(FileName); + inherited LoadFromFile(FileName); + FRichEdit.Container.EditModified := False +end; + +procedure TcxRichEditStrings.LoadFromStream(Stream: TStream); +var + APos: Longint; + AStreamOperationInfo: TcxRichEditStreamOperationInfo; +begin + APos := Stream.Position; + try + InitStreamOperation(Stream, AStreamOperationInfo, esoLoadFrom); + with AStreamOperationInfo do + begin + SendMessage(RichEdit.Handle, EM_STREAMIN, TextType, Longint(@EditStream)); + if ((TextType and SF_RTF) <> 0) and (EditStream.dwError <> 0) then + begin + Stream.Position := APos; + TextType := SF_TEXT; + cxSendStructMessage(RichEdit.Handle, EM_STREAMIN, TextType, EditStream); + end; + if EditStream.dwError <> 0 then + raise EOutOfResources.Create(cxGetResourceString(@cxSEditRichEditLoadFail)); + FTextType := TextType; + end; + finally + if FConverter = nil then + FreeAndNil(AStreamOperationInfo.StreamInfo.Converter); + end; + + with FRichEdit do + if Container <> nil then + Container.EditModified := False +end; + +procedure TcxRichEditStrings.SaveToFile(const FileName: string); +begin + InitConverter(FileName); + inherited SaveToFile(FileName); +end; + +procedure TcxRichEditStrings.SaveToStream(Stream: TStream); +var + AStreamOperationInfo: TcxRichEditStreamOperationInfo; +begin + try + InitStreamOperation(Stream, AStreamOperationInfo, esoSaveTo); + with AStreamOperationInfo do + begin + cxSendStructMessage(RichEdit.Handle, EM_STREAMOUT, TextType, EditStream); + if EditStream.dwError <> 0 then + raise EOutOfResources.Create(cxGetResourceString(@cxSEditRichEditSaveFail)); + end; + finally + if FConverter = nil then + FreeAndNil(AStreamOperationInfo.StreamInfo.Converter); + end; +end; + +function TcxRichEditStrings.Get(Index: Integer): string; +begin + Result := FRichEdit.Lines[Index]; + while (Length(Result) > 0) and (Result[Length(Result)] in [#10, #13]) do + System.Delete(Result, Length(Result), 1); +end; + +procedure TcxRichEditStrings.InitConverter(const AFileName: string); +var + AExtension: string; + AConversionFormat: PConversionFormat; +begin + AExtension := AnsiLowerCaseFileName(ExtractFileExt(AFilename)); + System.Delete(AExtension, 1, 1); + AConversionFormat := FConversionFormatList; + while AConversionFormat <> nil do + with AConversionFormat^ do + if Extension <> AExtension then AConversionFormat := Next + else Break; + if AConversionFormat = nil then + AConversionFormat := @TextConversionFormat; + if (FConverter = nil) or + (FConverter.ClassType <> AConversionFormat^.ConversionClass) then + begin + FreeAndNil(FConverter); + FConverter := AConversionFormat^.ConversionClass.Create; + end; +end; + +procedure TcxRichEditStrings.InitStreamOperation(AStream: TStream; + var AStreamOperationInfo: TcxRichEditStreamOperationInfo; + AStreamOperation: TcxRichEditStreamOperation; ACustom: Boolean; + ACustomStreamModes: TcxRichEditStreamModes); +var + AConverter: TConversion; +begin + if FConverter <> nil then + AConverter := FConverter + else + AConverter := RichEdit.DefaultConverter.Create; + with AStreamOperationInfo do + begin + StreamInfo.Converter := AConverter; + StreamInfo.Stream := AStream; + EditStream.dwCookie := Longint(Pointer(@StreamInfo)); + EditStream.dwError := 0; + if AStreamOperation = esoLoadFrom then + EditStream.pfnCallBack := @cxRichEditStreamLoad + else + EditStream.pfnCallBack := @cxRichEditStreamSave; + TextType := CalcStreamTextType(AStreamOperation, ACustom, ACustomStreamModes); + end; +end; + +function TcxRichEditStrings.GetCount: Integer; +begin + Result := RichEdit.GetLineCount; + if (Result > 0) and (RichEdit.GetLineLength(Result - 1) = 0) then + Dec(Result); +end; + +procedure TcxRichEditStrings.Put(Index: Integer; const S: string); +begin + TStringsAccess(FRichEdit.Lines).Put(Index, S); +end; + +procedure TcxRichEditStrings.SetUpdateState(Updating: Boolean); +begin + TStringsAccess(FRichEdit.Lines).SetUpdateState(Updating); +end; + +procedure TcxRichEditStrings.SetTextStr(const Value: string); +begin + FRichEdit.Container.Text := Value; +end; + +function TcxRichEditStrings.GetLineBreakString: string; +begin + if FRichEdit.RichVersion >= 200 then + Result := #13 + else + Result := #13#10 +end; + +{ TcxRichInnerEdit } + +constructor TcxRichInnerEdit.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ParentColor := True; + ParentFont := True; + FAllowObjects := False; + FAutoURLDetect := False; + FEchoMode := eemNormal; + FHelper := TcxRichInnerEditHelper.Create(Self); + FInternalUpdating := False; + FRichLines := TcxRichEditStrings.Create(Self); + FStreamModes := []; + FUseCRLF := True; + FRichEditOleCallback := TcxRichEditOleCallback.Create(Self); +end; + +destructor TcxRichInnerEdit.Destroy; +begin + FreeAndNil(FRichLines); + FreeAndNil(FHelper); + inherited Destroy; + FreeAndNil(FRichEditOleCallBack); +end; + +procedure TcxRichInnerEdit.DefaultHandler(var Message); +begin + if (Container = nil) or + not Container.InnerControlDefaultHandler(TMessage(Message)) then + inherited DefaultHandler(Message); +end; + +procedure TcxRichInnerEdit.DragDrop(Source: TObject; X, Y: Integer); +begin + Container.DragDrop(Source, Left + X, Top + Y); +end; + +function TcxRichInnerEdit.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action) or (Container <> nil) and + Container.DataBinding.ExecuteAction(Action); +end; + +function TcxRichInnerEdit.FindText(const ASearchStr: string; + AStartPos, ALength: Longint; AOptions: TSearchTypes): Integer; +var + AFindText: TFindText; + AFlags: Integer; +begin + with AFindText.chrg do + begin + cpMin := AStartPos; + cpMax := cpMin + ALength; + end; + AFlags := FR_DOWN; + if stWholeWord in AOptions then AFlags := AFlags or FT_WHOLEWORD; + if stMatchCase in AOptions then AFlags := AFlags or FT_MATCHCASE; + AFindText.lpstrText := PChar(ASearchStr); + Result := cxSendStructMessage(Handle, EM_FINDTEXT, AFlags, AFindText); +end; + +function TcxRichInnerEdit.InsertObject: Boolean; +var + AData: TOleUIInsertObject; + ANameBuffer: array[0..255] of Char; + AOleClientSite: IOleClientSite; + AStorage: IStorage; + AReObject: TReObject; + AOleObject: IOleObject; + ASelection: TCharRange; + AIsNewObject: Boolean; +begin + Result := False; + if not FAllowObjects or not Assigned(FRichEditOle) then + Exit; + FillChar(AData, SizeOf(AData), 0); + FillChar(ANameBuffer, SizeOf(ANameBuffer), 0); + AStorage := nil; + try + cxCreateStorage(AStorage); + RichEditOle.GetClientSite(AOleClientSite); + with AData do + begin + cbStruct := SizeOf(AData); + dwFlags := IOF_SELECTCREATENEW or IOF_VERIFYSERVERSEXIST or + IOF_CREATENEWOBJECT or IOF_CREATEFILEOBJECT or IOF_CREATELINKOBJECT; + hWndOwner := Handle; + lpfnHook := cxOleDialogHook; + lpszFile := ANameBuffer; + cchFile := SizeOf(ANameBuffer); + oleRender := OLERENDER_DRAW; + iid := IOleObject; + lpIOleClientSite := AOleClientSite; + lpIStorage := AStorage; + ppvObj := @AOleObject; + end; + if OleUIInsertObject(AData) = OLEUI_OK then + try + AIsNewObject := AData.dwFlags and IOF_SELECTCREATENEW = IOF_SELECTCREATENEW; + FillChar(AReObject, SizeOf(AReObject), 0); + with AReObject do + begin + cbStruct := SizeOf(AReObject); + cp := REO_CP_SELECTION; + clsid := AData.clsid; + oleobj := AOleObject; + stg := AStorage; + olesite := AOleClientSite; + dvaspect := DVASPECT_CONTENT; + dwFlags := REO_RESIZABLE; + if AIsNewObject then + dwFlags := dwFlags or REO_BLANK; + OleCheck(cxSetDrawAspect(AOleObject, AData.dwFlags and IOF_CHECKDISPLAYASICON <> 0, + AData.hMetaPict, dvaspect)); + end; + if HandleAllocated then + begin + SendMessage(Handle, EM_EXGETSEL, 0, Longint(@ASelection)); + ASelection.cpMax := ASelection.cpMin + 1; + end; + if Succeeded(RichEditOle.InsertObject(AReObject)) then + begin + if HandleAllocated then + begin + SendMessage(Handle, EM_EXSETSEL, 0, Longint(@ASelection)); + SendMessage(Handle, EM_SCROLLCARET, 0, 0); + end; + RichEditOle.SetDvaspect(Longint(REO_IOB_SELECTION), AReObject.dvaspect); + if AIsNewObject then OleCheck(AReObject.oleobj.DoVerb(OLEIVERB_SHOW, nil, + AOleClientSite, 0, Handle, ClientRect)); + Result := True; + end; + finally + DestroyMetaPict(AData.hMetaPict); + ReleaseObject(AOleObject); + ZeroMemory(@AReObject,SizeOf(AReObject)); + end; + finally + ZeroMemory(@AData,SizeOf(AData)); + end; +end; + +function TcxRichInnerEdit.ShowObjectProperties: Boolean; +var + AObjectProps: TOleUIObjectProps; + APropSheet: TPropSheetHeader; + AGeneralProps: TOleUIGnrlProps; + AViewProps: TOleUIViewProps; + ALinkProps: TOleUILinkProps; + ADialogCaption: string; + AReObject: TReObject; +begin + Result := False; + if not Assigned(FRichEditOle) or + (RichEditOle.GetObjectCount <= 0) then + Exit; + if HandleAllocated and + not (SendMessage(Handle, EM_SELECTIONTYPE, 0, 0) in [SEL_OBJECT, SEL_MULTIOBJECT]) then + Exit; + FillChar(AObjectProps, SizeOf(AObjectProps), 0); + FillChar(APropSheet, SizeOf(APropSheet), 0); + FillChar(AGeneralProps, SizeOf(AGeneralProps), 0); + FillChar(AViewProps, SizeOf(AViewProps), 0); + FillChar(ALinkProps, SizeOf(ALinkProps), 0); + AReObject.cbStruct := SizeOf(AReObject); + OleCheck(RichEditOle.GetObject(Longint(REO_IOB_SELECTION), AReObject, REO_GETOBJ_POLEOBJ or + REO_GETOBJ_POLESITE or REO_GETOBJ_PSTG)); + with AObjectProps do + begin + cbStruct := SizeOf(AObjectProps); + dwFlags := 0; + lpPS := @APropSheet; + lpObjInfo := TcxOleUIObjInfo.Create(Self, AReObject); + if (AReObject.dwFlags and REO_LINK) <> 0 then + begin + dwFlags := AObjectProps.dwFlags or OPF_OBJECTISLINK; + lpLinkInfo := TcxOleUILinkInfo.Create(Self, AReObject); + end; + lpGP := @AGeneralProps; + lpVP := @AViewProps; + lpLP := @ALinkProps; + end; + with APropSheet do + begin + dwSize := SizeOf(APropSheet); + hWndParent := Application.Handle; + hInstance := MainInstance; + ADialogCaption := Format(SPropDlgCaption, [cxGetOleObjectFullName(AReObject.oleobj)]); + pszCaption := PChar(ADialogCaption); + end; + AGeneralProps.cbStruct := SizeOf(AGeneralProps); + AGeneralProps.lpfnHook := cxOleDialogHook; + with AViewProps do + begin + cbStruct := SizeOf(AViewProps); + dwFlags := VPF_DISABLESCALE; + end; + ALinkProps.cbStruct := SizeOf(ALinkProps); + ALinkProps.dwFlags := ELF_DISABLECANCELLINK; + if OleUIObjectProperties(AObjectProps) = OLEUI_OK then + Result := True; + ZeroMemory(@AObjectProps, SizeOf(AObjectProps)); + ZeroMemory(@APropSheet, SizeOf(APropSheet)); + ZeroMemory(@AGeneralProps, SizeOf(AGeneralProps)); + ZeroMemory(@AViewProps, SizeOf(AViewProps)); + ZeroMemory(@ALinkProps, SizeOf(ALinkProps)); + ZeroMemory(@AReObject, SizeOf(AReObject)); +end; + +function TcxRichInnerEdit.PasteSpecial: Boolean; + + procedure SetPasteFormats(var APasteFormat: TOleUIPasteEntry; AFormat: TClipFormat; + Atymed: DWORD; const AFormatName, AResultText: string; AFlags: DWORD); + begin + with APasteFormat do begin + fmtetc.cfFormat := AFormat; + fmtetc.dwAspect := DVASPECT_CONTENT; + fmtetc.lIndex := -1; + fmtetc.tymed := Atymed; + if AFormatName <> '' then + lpstrFormatName := PChar(AFormatName) + else + lpstrFormatName := '%s'; + if AResultText <> '' then + lpstrResultText := PChar(AResultText) + else + lpstrResultText := '%s'; + dwFlags := AFlags; + end; + end; + +var + AData: TOleUIPasteSpecial; + APasteFormats: array[0..cxPasteFormatCount - 1] of TOleUIPasteEntry; + AFormat: Integer; + AReObject: TReObject; + AClientSite: IOleClientSite; + AStorage: IStorage; + AOleObject: IOleObject; + ASelection: TCharRange; +begin + Result := False; + if not CanPaste then Exit; + if not Assigned(FRichEditOle) then Exit; + FillChar(AData, SizeOf(AData), 0); + FillChar(APasteFormats, SizeOf(APasteFormats), 0); + with AData do + begin + cbStruct := SizeOf(AData); + dwFlags := PSF_SELECTPASTE; + hWndOwner := Application.Handle; + lpfnHook := cxOleDialogHook; + arrPasteEntries := @APasteFormats; + cPasteEntries := cxPasteFormatCount; + arrLinkTypes := @CFLinkSource; + cLinkTypes := 1; + end; + SetPasteFormats(APasteFormats[0], CFEmbeddedObject, TYMED_ISTORAGE, + '%s', '%s', OLEUIPASTE_PASTE or OLEUIPASTE_ENABLEICON); + SetPasteFormats(APasteFormats[1], CFLinkSource, TYMED_ISTREAM, + '%s', '%s', OLEUIPASTE_LINKTYPE1 or OLEUIPASTE_ENABLEICON); + SetPasteFormats(APasteFormats[2], CF_BITMAP, TYMED_GDI, + 'Windows bitmap', 'bitmap image', OLEUIPASTE_PASTE); + SetPasteFormats(APasteFormats[3], CFRtf, TYMED_ISTORAGE, + CF_RTF, CF_RTF, OLEUIPASTE_PASTE); + SetPasteFormats(APasteFormats[4], CF_TEXT, TYMED_HGLOBAL, + 'Unformatted text', 'text without any formatting', OLEUIPASTE_PASTE); + SetPasteFormats(APasteFormats[5], CFRETextObj, TYMED_ISTORAGE, + CF_RETEXTOBJ, CF_RETEXTOBJ, OLEUIPASTE_PASTE); + try + if OleUIPasteSpecial(AData) = OLEUI_OK then + begin + if AData.nSelectedIndex in [0, 1] then // CFEmbeddedObject, CFLinkSource + begin + FillChar(AReObject, SizeOf(AReObject), 0); + RichEditOle.GetClientSite(AClientSite); + cxCreateStorage(AStorage); + try + case AData.nSelectedIndex of + 0: {CFEmbeddedObject} + OleCheck(OleCreateFromData(AData.lpSrcDataObj, IOleObject, + OLERENDER_DRAW, nil, AClientSite, AStorage, AOleObject)); + 1: {CFLinkSource} + OleCheck(OleCreateLinkFromData(AData.lpSrcDataObj, IOleObject, + OLERENDER_DRAW, nil, AClientSite, AStorage, AOleObject)); + end; + try + with AReObject do + begin + cbStruct := SizeOf(AReObject); + cp := REO_CP_SELECTION; + oleobj := AOleObject; + AOleObject.GetUserClassID(clsid); + stg := AStorage; + olesite := AClientSite; + dvaspect := DVASPECT_CONTENT; + dwFlags := REO_RESIZABLE; + OleCheck(cxSetDrawAspect(oleobj, + AData.dwFlags and PSF_CHECKDISPLAYASICON <> 0, + AData.hMetaPict, dvaspect)); + end; + SendMessage(Handle, EM_EXGETSEL, 0, Longint(@ASelection)); + ASelection.cpMax := ASelection.cpMin + 1; + if Succeeded(RichEditOle.InsertObject(AReObject)) then + begin + SendMessage(Handle, EM_EXSETSEL, 0, Longint(@ASelection)); + OleCheck(RichEditOle.SetDvaspect(Longint(REO_IOB_SELECTION), AReObject.dvaspect)); + end; + finally + ZeroMemory(@AReObject, SizeOf(AReObject)); + end; + finally + ReleaseObject(AClientSite); + ReleaseObject(AStorage); + end; + end + else + begin + AFormat := APasteFormats[AData.nSelectedIndex].fmtetc.cfFormat; + if not Succeeded(RichEditOle.ImportDataObject(AData.lpSrcDataObj, + AFormat, AData.hMetaPict)) then + Exit; + end; + Result := True; + end; + finally + DestroyMetaPict(AData.hMetaPict); + ReleaseObject(AData.lpSrcDataObj); + ZeroMemory(@AData, SizeOf(AData)); + end; +end; + +procedure TcxRichInnerEdit.Print(const Caption: string); +var + AIsCRLFUsed: Boolean; +begin + AIsCRLFUsed := FUseCRLF; + FUseCRLF := False; + try + inherited; + finally + FUseCRLF := AIsCRLFUsed; + end; +end; + +procedure TcxRichInnerEdit.BeforeInsertObject(var AAllowInsertObject: Boolean; + const ACLSID: TCLSID); +begin + if Assigned(OnQueryInsertObject) then + OnQueryInsertObject(Container, AAllowInsertObject, ACLSID); +end; + +procedure TcxRichInnerEdit.Click; +begin + inherited Click; + _TcxContainerAccess.Click(Container); +end; + +procedure TcxRichInnerEdit.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + RichCreateParams(Params, FRichVersion); + with Params.WindowClass do + style := style or CS_VREDRAW or CS_HREDRAW; + if SelectionBar then + Params.Style := Params.Style or ES_SELECTIONBAR; + Params.Style := Params.Style or WS_CLIPSIBLINGS or WS_CLIPCHILDREN; +end; + +procedure TcxRichInnerEdit.CreateWnd; +begin + if Container <> nil then + begin + Alignment := Container.ActiveProperties.Alignment; + Container.ClearSavedChildControlRegions; + PlainText := FSavedPlainText; + end; + inherited CreateWnd; + if Container <> nil then + PlainText := Container.ActiveProperties.PlainText or Container.ActiveProperties.MemoMode; + SendMessage(Handle, EM_SETEVENTMASK, 0, ENM_CHANGE or ENM_SELCHANGE or ENM_IMECHANGE or + ENM_REQUESTRESIZE or ENM_PROTECTED or ENM_KEYEVENTS or ENM_LINK or ENM_LANGCHANGE or + ENM_OBJECTPOSITIONS); + if MaxLength = 0 then + SendMessage(Handle, EM_EXLIMITTEXT, 0, MaxLongint); + if HandleAllocated then + begin + SendMessage(Handle, EM_AUTOURLDETECT, Longint(FAutoURLDetect and not MemoMode), 0); + if FAllowObjects then + begin + if not cxRichEditGetOleInterface(Self, IcxRichEditOle(FRichEditOle)) then + raise EOutOfResources.Create(cxGetResourceString(@cxSEditRichEditOleInterfaceFail)); + if not cxRichEditSetOleCallback(Self, RichEditOlecallback) then + raise EOutOfResources.Create(cxGetResourceString(@cxSEditRichEditCallBackFail)); + end; + end; + InternalSetMemoMode; +end; + +procedure TcxRichInnerEdit.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); +begin + if FLockBoundsCount = 0 then + inherited SetBounds(ALeft, ATop, AWidth, AHeight); +end; + +function TcxRichInnerEdit.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action) or (Container <> nil) and + Container.DataBinding.UpdateAction(Action); +end; + +function TcxRichInnerEdit.CanFocus: Boolean; +begin + if Container = nil then + Result := inherited CanFocus + else + Result := Container.CanFocusEx; +end; + +function TcxRichInnerEdit.CanRedo: Boolean; +begin + Result := False; + if HandleAllocated then + Result := SendMessage(Handle, EM_CANREDO, 0, 0) <> 0; +end; + +procedure TcxRichInnerEdit.Redo; +begin + if HandleAllocated then + SendMessage(Handle, EM_REDO, 0, 0); +end; + +procedure TcxRichInnerEdit.Undo; +begin + if HandleAllocated then + SendMessage(Handle, EM_UNDO, 0, 0); +end; + +procedure TcxRichInnerEdit.DblClick; +begin + inherited DblClick; + _TcxContainerAccess.DblClick(Container); +end; + +procedure TcxRichInnerEdit.DestroyWnd; +begin + FSavedPlainText := PlainText; + inherited DestroyWnd; +end; + +procedure TcxRichInnerEdit.DoEnter; +begin + inherited DoEnter; + if FAutoSelect then + SelectAll; +end; + +procedure TcxRichInnerEdit.DragOver(Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); +begin + _TcxContainerAccess.DragOver(Container, Source, Left + X, Top + Y, State, Accept); +end; + +procedure TcxRichInnerEdit.KeyDown(var Key: Word; Shift: TShiftState); +begin + FInternalUpdating := False; + _TcxContainerAccess.KeyDown(Container, Key, Shift); + if Key = 0 then + FInternalUpdating := True + else + inherited KeyDown(Key, Shift); + if (RichVersion >= 200) and (Key = VK_RETURN) and not WantReturns and + not(ssCtrl in InternalGetShiftState) then + begin + Key := 0; + Exit; + end; +end; + +procedure TcxRichInnerEdit.KeyPress(var Key: Char); +begin + FInternalUpdating := False; +// Ctrl+I calls KeyPress with Key = Char(VK_TAB). A tab must be inserted even when WantTabs = False +// if not WantTabs and (Key = Char(VK_TAB)) then +// Key := #0; + _TcxContainerAccess.KeyPress(Container, Key); + if Key = #0 then + FInternalUpdating := True + else + inherited KeyPress(Key); +end; + +procedure TcxRichInnerEdit.KeyUp(var Key: Word; Shift: TShiftState); +begin + FInternalUpdating := False; + if not WantTabs and ((Key = VK_TAB)) then + Key := 0; + _TcxContainerAccess.KeyUp(Container, Key, Shift); + if Key = 0 then + FInternalUpdating := True + else + inherited KeyUp(Key, Shift); +end; + +procedure TcxRichInnerEdit.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + _TcxContainerAccess.MouseDown(Container, Button, Shift, X + Left, Y + Top); +end; + +procedure TcxRichInnerEdit.MouseLeave(AControl: TControl); +begin + Container.ShortRefreshContainer(True); +end; + +procedure TcxRichInnerEdit.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + _TcxContainerAccess.MouseMove(Container, Shift, X + Left, Y + Top); +end; + +procedure TcxRichInnerEdit.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + _TcxContainerAccess.MouseUp(Container, Button, Shift, X + Left, Y + Top); +end; + +procedure TcxRichInnerEdit.RequestAlign; +begin +end; + +procedure TcxRichInnerEdit.RequestSize(const Rect: TRect); +var + R: TRect; +begin + if Container <> nil then + begin + R := Rect; + Dec(R.Left, Left); + Dec(R.Top, Top); + Inc(R.Right, Container.Width - Width - Left); + Inc(R.Bottom, Container.Height - Height - Top); + OffsetRect(R, Container.Left, Container.Top); + Container.DoOnResizeRequest(R); + end; +end; + +procedure TcxRichInnerEdit.RichCreateParams(var Params: TCreateParams; + out ARichVersion: Integer); +var + ARichClassName: string; + AWndClass: TWndClass; + I: Integer; +begin + if FRichEditLibrary = 0 then + for I := High(cxRichEditDLLNames) downto Low(cxRichEditDLLNames) do + begin + FRichEditLibrary := LoadLibrary(PChar(cxRichEditDLLNames[I])); + if FRichEditLibrary <> 0 then + Break; + end; + if FRichEditLibrary = 0 then + raise EcxEditError.Create(cxGetResourceString(@cxSEditRichEditLibraryError)); + + for I := High(cxRichEditClassNames) downto Low(cxRichEditClassNames) do + begin +// ARichClassName := cxRichEditClassNames[I] + 'W'; +// if GetClassInfo(HInstance, PChar(ARichClassName), AWndClass) then +// Break; + ARichClassName := cxRichEditClassNames[I] + 'A'; + if GetClassInfo(HInstance, PChar(ARichClassName), AWndClass) then + Break; + ARichClassName := cxRichEditClassNames[I]; + if GetClassInfo(HInstance, PChar(ARichClassName), AWndClass) then + Break; + end; + + if GetClassInfo(HInstance, PChar(ARichClassName), AWndClass) then + ARichVersion := cxRichEditVersions[I] + else + raise EcxEditError.Create(cxGetResourceString(@cxSEditRichEditLibraryError)); + CreateSubClass(Params, PChar(ARichClassName)); +end; + +procedure TcxRichInnerEdit.SelectionChange; +begin + inherited SelectionChange; + if Container <> nil then + Container.DoOnSelectionChange; +end; + +procedure TcxRichInnerEdit.URLClick(const AURLText: string; AButton: TMouseButton); +begin + if Assigned(Container.ActiveProperties.OnURLClick) then + Container.ActiveProperties.OnURLClick(Container, AURLText, AButton); +end; + +procedure TcxRichInnerEdit.URLMove(const AURLText: string); +begin + if Assigned(Container.ActiveProperties.OnURLMove) then + Container.ActiveProperties.OnURLMove(Container, AURLText); +end; + +procedure TcxRichInnerEdit.WndProc(var Message: TMessage); +begin + if (Container <> nil) and Container.InnerControlMenuHandler(Message) then + Exit; + if ((Message.Msg = WM_LBUTTONDOWN) or (Message.Msg = WM_LBUTTONDBLCLK)) and + (Container.DragMode = dmAutomatic) and not Container.IsDesigning then + begin + _TcxContainerAccess.BeginAutoDrag(Container); + Exit; + end; + inherited WndProc(Message); +end; + +function TcxRichInnerEdit.CanPaste: Boolean; +begin + Result := HandleAllocated and + (SendMessage(Handle, EM_CANPASTE, 0, 0) <> 0); +end; + +function TcxRichInnerEdit.GetSelection: TCharRange; +begin + cxSendStructMessage(Handle, EM_EXGETSEL, 0, Result); +end; + +function TcxRichInnerEdit.GetAutoURLDetect: Boolean; +begin + Result := FAutoURLDetect; + if HandleAllocated and not (csDesigning in ComponentState) then + Result := Boolean(SendMessage(Handle, EM_GETAUTOURLDETECT, 0, 0)); +end; + +//IcxContainerInnerControl +function TcxRichInnerEdit.GetControl: TWinControl; +begin + Result := Self; +end; + +function TcxRichInnerEdit.GetControlContainer: TcxContainer; +begin + Result := Container; +end; + +// IcxInnerEditHelper +function TcxRichInnerEdit.GetHelper: IcxCustomInnerEdit; +begin + Result := Helper; +end; + +function TcxRichInnerEdit.GetContainer: TcxCustomRichEdit; +begin + if Parent is TcxCustomRichEdit then + Result := TcxCustomRichEdit(Parent) + else + Result := nil; +end; + +function TcxRichInnerEdit.GetLineCount: Integer; +begin + Result := SendMessage(Handle, EM_GETLINECOUNT, 0, 0); +end; + +function TcxRichInnerEdit.GetLineIndex(AIndex: Integer): Integer; +begin + Result := SendMessage(Handle, EM_LINEINDEX , AIndex, 0); +end; + +function TcxRichInnerEdit.GetLineLength(AIndex: Integer): Integer; +begin + if GetLineIndex(AIndex) <> -1 then + Result := SendMessage(Handle, EM_LINELENGTH, GetLineIndex(AIndex), 0) + else + Result := 0; +end; + +function TcxRichInnerEdit.GetRichLines: TcxRichEditStrings; +begin + Result := FRichLines; +end; + +function TcxRichInnerEdit.GetRichEditOle: IcxRichEditOle; +begin + if FRichEditOle <> nil then + Result := FRichEditOle as IcxRichEditOle + else + Result := nil; +end; + +function TcxRichInnerEdit.GetRichEditOleCallBack: TcxRichEditOleCallback; +begin + if Assigned(FRichEditOleCallback) then + Result := FRichEditOleCallback as TcxRichEditOleCallback + else + Result := nil; +end; + +function TcxRichInnerEdit.GetTextRange(AStartPos, AEndPos: Longint): string; +var + ATextRange: TcxTextRange; +begin + SetLength(Result, AEndPos - AStartPos + 1); + ATextRange.chrg.cpMin := AStartPos; + ATextRange.chrg.cpMax := AEndPos; + ATextRange.lpstrText := PAnsiChar(Result); + SetLength(Result, SendMessage(Handle, EM_GETTEXTRANGE, 0, Longint(@ATextRange))); +end; + +procedure TcxRichInnerEdit.InternalSetMemoMode(AForcedReload: Boolean); +var + AText: string; + ATextMode: LRESULT; +begin + if not HandleAllocated then + Exit; + ATextMode := SendMessage(Handle, EM_GETTEXTMODE, 0, 0); + if MemoMode and (ATextMode and TM_PLAINTEXT <> 0) or + not MemoMode and (ATextMode and TM_RICHTEXT <> 0) and + not AForcedReload then + Exit; + AText := Text; + SendMessage(Handle, WM_SETTEXT, 0, 0); + if MemoMode then + ATextMode := ATextMode and not TM_RICHTEXT or TM_PLAINTEXT + else + ATextMode := ATextMode and not TM_PLAINTEXT or TM_RICHTEXT; + SendMessage(Handle, EM_SETTEXTMODE, ATextMode, 0); + Text := AText; +end; + +procedure TcxRichInnerEdit.SetAllowObjects(Value: Boolean); +begin + if FAllowObjects <> Value then + begin + FAllowObjects := Value; + if not FAllowObjects then + FRichEditOle := nil; + RecreateWnd; + end; +end; + +procedure TcxRichInnerEdit.SetAutoURLDetect(Value: Boolean); +begin + if Value <> FAutoURLDetect then + begin + FAutoURLDetect := Value; + if not HandleAllocated then + Exit; + SendMessage(Handle, EM_AUTOURLDETECT, Longint(FAutoURLDetect and not MemoMode), 0); + if Assigned(FRichEditOle) then + if RichEditOle.GetObjectCount > 0 then + Exit; + InternalSetMemoMode(True); + end; +end; + +procedure TcxRichInnerEdit.SetMemoMode(Value: Boolean); +begin + if Value <> FMemoMode then + begin + FMemoMode := Value; + RecreateWnd; + end; +end; + +procedure TcxRichInnerEdit.SetRichLines(Value: TcxRichEditStrings); +begin + FRichLines.Assign(Value); +end; + +procedure TcxRichInnerEdit.SetSelectionBar(Value: Boolean); +begin + if Value <> FSelectionBar then + begin + FSelectionBar := Value; + RecreateWnd; + end; +end; + +procedure TcxRichInnerEdit.WMClear(var Message: TMessage); +begin + if (Self.SelLength > 0) and Container.DoEditing then + inherited; +end; + +procedure TcxRichInnerEdit.WMCut(var Message: TMessage); +begin + if SelLength > 0 then + if Container.DoEditing then + inherited + else + Container.CopyToClipboard; +end; + +procedure TcxRichInnerEdit.WMEraseBkgnd(var Message: TWMEraseBkgnd); +begin + if FIsEraseBackgroundLocked or (Container <> nil) and Container.IsInplace then + Message.Result := 1 + else + CallWindowProc(DefWndProc, Handle, Message.Msg, Message.DC, 0); +end; + +procedure TcxRichInnerEdit.WMGetDlgCode(var Message: TWMGetDlgCode); +begin + inherited; + if Container.TabsNeeded and (GetKeyState(VK_CONTROL) >= 0) then + Message.Result := Message.Result or DLGC_WANTTAB; + if FEscapePressed then + Message.Result := Message.Result and not DLGC_WANTALLKEYS; +end; + +procedure TcxRichInnerEdit.WMKeyDown(var Message: TWMKeyDown); +var + AKey: Word; + APrevState: TcxCustomInnerTextEditPrevState; + AShiftState: TShiftState; +begin + if Message.CharCode <> VK_ESCAPE then + FKeyPressProcessed := True; + try + SaveTextEditState(Helper, False, APrevState); + FInternalUpdating := False; + inherited; + Container.SetScrollBarsParameters; + if FInternalUpdating then + Exit; + finally + FKeyPressProcessed := False; + end; + AShiftState := KeyDataToShiftState(Message.KeyData); + AKey := Message.CharCode; + if (AKey <> 0) and not Container.CanKeyDownModifyEdit(AKey, AShiftState) and + not CheckTextEditState(Helper, APrevState) and + not Container.IsNavigationKey(AKey, AShiftState) then + Container.DoAfterKeyDown(AKey, AShiftState); + Message.CharCode := AKey; +end; + +procedure TcxRichInnerEdit.WMKillFocus(var Message: TWMKillFocus); +begin + inherited; + if not(csDestroying in ComponentState) then + Container.FocusChanged; +end; + +procedure TcxRichInnerEdit.WMMButtonDown(var Message: TWMMButtonDown); +begin + Message.Result := 1; + SendMessage(Container.Handle, WM_MBUTTONDOWN, 0, + MakeLParam(Message.XPos + Left, Message.YPos + Top)); +end; + +procedure TcxRichInnerEdit.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + inherited; + if (Container <> nil) and not Container.ScrollBarsCalculating then + Container.SetScrollBarsParameters; +end; + +procedure TcxRichInnerEdit.WMNCPaint(var Message: TWMNCPaint); + + procedure FillSizeGrip; + var + ABrush: HBRUSH; + DC: HDC; + begin + if Container.NeedsScrollBars and Container.HScrollBar.Visible and + Container.VScrollBar.Visible then + begin + DC := GetWindowDC(Handle); + ABrush := 0; + try + with Container.LookAndFeel do + ABrush := CreateSolidBrush(ColorToRGB(Painter.DefaultSizeGripAreaColor)); + FillRect(DC, GetSizeGripRect(Self), ABrush); + finally + if ABrush <> 0 then + Windows.DeleteObject(ABrush); + ReleaseDC(Handle, DC); + end; + end; + end; + +begin + inherited; + if (Container = nil) or not UsecxScrollBars then + Exit; + FillSizeGrip; +end; + +procedure TcxRichInnerEdit.WMPaint(var Message: TWMPaint); +begin + if RichVersion >= 200 then + FIsEraseBackgroundLocked := True; + try + inherited; + finally + FIsEraseBackgroundLocked := False; + end; +end; + +procedure TcxRichInnerEdit.WMPaste(var Message: TMessage); +begin + if (Clipboard.FormatCount > 0) and Container.DoEditing then + inherited; +end; + +procedure TcxRichInnerEdit.WMSetFocus(var Message: TWMSetFocus); +begin + inherited; + if not(csDestroying in ComponentState) and (Message.FocusedWnd <> Container.Handle) then + Container.FocusChanged; +end; + +procedure TcxRichInnerEdit.WMSetFont(var Message: TWMSetFont); +begin + if HandleAllocated and MemoMode then + begin + with TMessage(Message) do + Result := CallWindowProc(DefWndProc, Handle, Msg, WParam, LParam); + DefAttributes.Color := Font.Color; + end + else + inherited; +end; + +procedure TcxRichInnerEdit.WMHScroll(var Message: TWMHScroll); +begin + inherited; + if not Focused then + Container.SetScrollBarsParameters; +end; + +procedure TcxRichInnerEdit.WMVScroll(var Message: TWMVScroll); +begin + inherited; + if not Focused then + Container.SetScrollBarsParameters; +end; + +procedure TcxRichInnerEdit.WMWindowPosChanged(var Message: TWMWindowPosChanged); +begin + if Container <> nil then + Container.SetScrollBarsParameters; + inherited; +end; + +procedure TcxRichInnerEdit.WMWindowPosChanging(var Message: TWMWindowPosChanging); +var + ARgn: HRGN; +begin + inherited; + if (Container <> nil) and not(csDestroying in ComponentState) and + Container.NeedsScrollBars and Container.HScrollBar.Visible and Container.VScrollBar.Visible then + begin + ARgn := CreateRectRgnIndirect(GetSizeGripRect(Self)); + SendMessage(Handle, WM_NCPAINT, ARgn, 0); + Windows.DeleteObject(ARgn); + end; +end; + +procedure TcxRichInnerEdit.EMReplaceSel(var Message: TMessage); +begin + if (Container <> nil) and Container.Focused then + Container.DoEditing; + inherited; +end; + +procedure TcxRichInnerEdit.EMSetCharFormat(var Message: TMessage); +begin + if Focused and (Message.WParam = SCF_SELECTION) and (SelLength > 0) then + Container.DoEditing; + inherited; +end; + +procedure TcxRichInnerEdit.EMSetParaFormat(var Message: TMessage); +begin + if (Container <> nil) and not Container.IsDestroying and + (Container.ComponentState * [csLoading, csReading] = []) and Focused then + Container.DoEditing; + inherited; +end; + +procedure TcxRichInnerEdit.CMColorChanged(var Message: TMessage); +begin + if (Container <> nil) and not Container.IsInplace then + inherited; +end; + +procedure TcxRichInnerEdit.CMFontChanged(var Message: TMessage); +begin + if HandleAllocated and MemoMode then + Perform(WM_SETFONT, Font.Handle, 0) + else + if (Container <> nil) and not Container.IsInplace then + SetRichDefAttributes(Self, Font, + Container.ActiveStyle.GetVisibleFont.Color); +end; + +procedure TcxRichInnerEdit.CMMouseLeave(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseLeave(Self) + else + MouseLeave(TControl(Message.lParam)); +end; + +procedure TcxRichInnerEdit.CNNotify(var Message: TWMNotify); + + procedure SetOutRange(var ARange: TCharRange); + begin + ARange.cpMin := -1; + ARange.cpMax := -1; + end; + +begin + if not (csDesigning in ComponentState) then + with Message do + case NMHdr^.code of + EN_REQUESTRESIZE: + begin + if NMHdr^.idFrom = 0 then + Exit; + end; + EN_LINK: + with PcxENLink(NMHdr)^ do + begin + case Msg of + WM_RBUTTONDOWN: + begin + FURLClickRange := chrg; + FURLClickBtn := mbRight; + end; + WM_RBUTTONUP: + begin + if (FURLClickBtn = mbRight) and (FURLClickRange.cpMin = chrg.cpMin) and + (FURLClickRange.cpMax = chrg.cpMax) then + URLClick(GetTextRange(chrg.cpMin, chrg.cpMax), mbRight); + SetOutRange(FURLClickRange); + end; + WM_LBUTTONDOWN: + begin + FURLClickRange := chrg; + FURLClickBtn := mbLeft; + end; + WM_LBUTTONUP: + begin + if (FURLClickBtn = mbLeft) and (FURLClickRange.cpMin = chrg.cpMin) and + (FURLClickRange.cpMax = chrg.cpMax) then + URLClick(GetTextRange(chrg.cpMin, chrg.cpMax), mbLeft); + SetOutRange(FURLClickRange); + end; + WM_MOUSEMOVE: + URLMove(GetTextRange(chrg.cpMin, chrg.cpMax)); + end; + end; + end; + inherited; +end; + +procedure TcxRichInnerEdit.WMChar(var Message: TWMChar); +begin + if Message.CharCode <> VK_ESCAPE then + FKeyPressProcessed := True; + try + inherited; + finally + FKeyPressProcessed := False; + end; +end; + +procedure TcxRichInnerEdit.CNCommand(var Message: TWMCommand); + +begin + if Message.NotifyCode <> EN_CHANGE then + begin + inherited; + Exit; + end; + + if (Container <> nil) and not Container.IsDestroying and + (Container.ComponentState * [csLoading, csReading] = []) and + Focused and FKeyPressProcessed then + Container.DoEditing; + inherited; +end; + +procedure TcxRichInnerEdit.CNKeyDown(var Message: TWMKeyDown); +begin + if Message.CharCode = VK_ESCAPE then + FEscapePressed := True; + try + inherited; + finally + FEscapePressed := False; + end; +end; + +const + AUseCRLFFlag: array[Boolean] of DWORD = (0, 1); + +procedure TcxRichInnerEdit.WMGetText(var Message: TMessage); +var + ATextInfo: TGetTextEx; +begin + if (RichVersion >= 200) and HandleAllocated then + begin + ZeroMemory(@ATextInfo, SizeOf(ATextInfo)); + ATextInfo.cb := Message.WParam; + ATextInfo.flags := AUseCRLFFlag[FUseCRLF]; + Message.Result := cxSendStructMessage(Handle, EM_GETTEXTEX, ATextInfo, Message.LParam); + end + else + inherited; +end; + +procedure TcxRichInnerEdit.WMGetTextLength(var Message: TWMGetTextLength); +var + ATextInfo: TGetTextLengthEx; +begin + if (RichVersion >= 200) and HandleAllocated then + begin + ZeroMemory(@ATextInfo, SizeOf(ATextInfo)); + ATextInfo.flags := GTL_PRECISE or GTL_NUMCHARS or AUseCRLFFlag[FUseCRLF]; + Message.Result := cxSendStructMessage(Handle, EM_GETTEXTLENGTHEX, ATextInfo, 0); + end + else + inherited; +end; + +procedure TcxRichInnerEdit.WMSetText(var Message: TWMSetText); +begin + if MemoMode and IsRichText(Message.Text) then + Message.Text := PChar(ConvertRichText(Message.Text)); + inherited; +end; + +procedure TcxRichInnerEdit.WMIMEComposition(var Message: TMessage); +begin + if Container.DoEditing then + inherited; +end; + +procedure TcxRichInnerEdit.EMExLineFromChar(var Message: TMessage); +begin + inherited; + if MemoMode then + begin + if GetLineIndex(Message.Result + 1) = Message.LParam then + Message.Result := Message.Result + 1; + end; +end; + +procedure TcxRichInnerEdit.EMLineLength(var Message: TMessage); +var + ALineIndex: Integer; +begin + inherited; + if MemoMode then + begin + ALineIndex := SendMessage(Handle, EM_EXLINEFROMCHAR, 0, Message.WParam); + if (ALineIndex = GetLineCount - 1) and (Lines[ALineIndex] = '') then + Message.Result := 0; + end; +end; + +{ TcxOleUILinkInfo } + +constructor TcxOleUILinkInfo.Create(AOwner: TcxRichInnerEdit; AReObject: TReObject); +begin + inherited Create; + FRichEdit := AOwner; + FReObject := AReObject; + FReObject.oleobj.QueryInterface(IOleLink, FOleLink); +end; + +destructor TcxOleUILinkInfo.Destroy; +begin + ReleaseObject(FOleLink); + inherited Destroy; +end; + +//IOleUILinkInfo +function TcxOleUILinkInfo.GetLastUpdate(dwLink: Longint; + var LastUpdate: TFileTime): HResult; +begin + Result := S_OK; +end; + +//IOleUILinkContainer +function TcxOleUILinkInfo.GetNextLink(dwLink: Longint): Longint; +begin + if dwLink = 0 then + Result := Longint(FRichEdit) + else + Result := 0; +end; + +function TcxOleUILinkInfo.SetLinkUpdateOptions(dwLink: Longint; + dwUpdateOpt: Longint): HResult; +begin + Result := FOleLink.SetUpdateOptions(dwUpdateOpt); + if Succeeded(Result) then + FRichEdit.Modified := True; +end; + +function TcxOleUILinkInfo.GetLinkUpdateOptions(dwLink: Longint; + var dwUpdateOpt: Longint): HResult; +begin + Result := FOleLink.GetUpdateOptions(dwUpdateOpt); +end; + +function TcxOleUILinkInfo.SetLinkSource(dwLink: Longint; pszDisplayName: PChar; + lenFileName: Longint; var chEaten: Longint; + fValidateSource: BOOL): HResult; +var + ADisplayName: string; + ABuffer: array[0..255] of WideChar; +begin + Result := E_FAIL; + if fValidateSource then + begin + ADisplayName := pszDisplayName; + if Succeeded(FOleLink.SetSourceDisplayName(StringToWideChar(ADisplayName, + ABuffer, SizeOf(ABuffer) div 2))) then + begin + chEaten := Length(ADisplayName); + OleCheck(FReObject.oleobj.Update); + Result := S_OK; + end; + end + else + raise EOutOfResources.Create(cxGetResourceString(@cxSEditRichEditLinkFail)); +end; + +function TcxOleUILinkInfo.GetLinkSource(dwLink: Longint; var pszDisplayName: PChar; + var lenFileName: Longint; var pszFullLinkType: PChar; + var pszShortLinkType: PChar; var fSourceAvailable: BOOL; + var fIsSelected: BOOL): HResult; +var + AMoniker: IMoniker; +begin + if @pszDisplayName <> nil then + pszDisplayName := cxGetOleLinkDisplayName(FOleLink); + if @lenFileName <> nil then + begin + lenFileName := 0; + FOleLink.GetSourceMoniker(AMoniker); + if AMoniker <> nil then + begin + lenFileName := cxOleStdGetLenFilePrefixOfMoniker(AMoniker); + if Assigned(AMoniker) then + AMoniker._Release; + end; + end; + if @pszFullLinkType <> nil then + pszFullLinkType := cxGetOleObjectFullName(FReObject.oleobj); + if @pszShortLinkType <> nil then + pszShortLinkType := cxGetOleObjectShortName(FReObject.oleobj); + Result := S_OK; +end; + +function TcxOleUILinkInfo.OpenLinkSource(dwLink: Longint): HResult; +begin + OleCheck(FReObject.oleobj.DoVerb(OLEIVERB_SHOW, nil, FReObject.olesite, + 0, FRichEdit.Handle, FRichEdit.ClientRect)); + Result := S_OK; +end; + +function TcxOleUILinkInfo.UpdateLink(dwLink: Longint; fErrorMessage: BOOL; + fErrorAction: BOOL): HResult; +begin + OleCheck(FReObject.oleobj.Update); + Result := S_OK; +end; + +function TcxOleUILinkInfo.CancelLink(dwLink: Longint): HResult; +begin + Result := E_NOTIMPL; +end; + +{ TcxOleUIObjInfo } + +constructor TcxOleUIObjInfo.Create(AOwner: TcxRichInnerEdit; AReObject: TReObject); +begin + inherited Create; + FRichEdit := AOwner; + FReObject := AReObject; +end; + +function TcxOleUIObjInfo.GetObjectDataSize: Integer; +begin + Result := -1; +end; + +//IOleUIObjInfo +function TcxOleUIObjInfo.GetObjectInfo(dwObject: Longint; + var dwObjSize: Longint; var lpszLabel: PChar; + var lpszType: PChar; var lpszShortType: PChar; + var lpszLocation: PChar): HResult; +begin + if @dwObjSize <> nil then + dwObjSize := GetObjectDataSize; + if @lpszLabel <> nil then + lpszLabel := cxGetOleObjectFullName(FReObject.oleobj); + if @lpszType <> nil then + lpszType := cxGetOleObjectFullName(FReObject.oleobj); + if @lpszShortType <> nil then + lpszShortType := cxGetOleObjectShortName(FReObject.oleobj); + if @lpszLocation <> nil then + lpszLocation := cxCoAllocCStr(Application.Title); + Result := S_OK; +end; + +function TcxOleUIObjInfo.GetConvertInfo(dwObject: Longint; var ClassID: TCLSID; + var wFormat: Word; var ConvertDefaultClassID: TCLSID; + var lpClsidExclude: PCLSID; var cClsidExclude: Longint): HResult; +begin + FReObject.oleobj.GetUserClassID(ClassID); + Result := S_OK; +end; + +function TcxOleUIObjInfo.ConvertObject(dwObject: Longint; const clsidNew: TCLSID): HResult; +begin + Result := E_NOTIMPL; +end; + +function TcxOleUIObjInfo.GetViewInfo(dwObject: Longint; var hMetaPict: HGlobal; + var dvAspect: Longint; var nCurrentScale: Integer): HResult; +begin + if @hMetaPict <> nil then + hMetaPict := cxGetIconMetaPict(FReObject.oleobj, FReObject.dvaspect); + if @dvAspect <> nil then + dvAspect := FReObject.dvaspect; + if @nCurrentScale <> nil then + nCurrentScale := 100; + Result := S_OK; +end; + +function TcxOleUIObjInfo.SetViewInfo(dwObject: Longint; hMetaPict: HGlobal; + dvAspect: Longint; nCurrentScale: Integer; + bRelativeToOrig: BOOL): HResult; +var + AShowAsIcon: Boolean; +begin + if not Assigned(FRichEdit.FRichEditOle) then + begin + Result := E_NOTIMPL; + Exit; + end; + case dvAspect of + DVASPECT_CONTENT: AShowAsIcon := False; + DVASPECT_ICON: AShowAsIcon := True; + else + AShowAsIcon := FReObject.dvaspect = DVASPECT_ICON; + end; + FRichEdit.RichEditOle.InPlaceDeactivate; + Result := cxSetDrawAspect(FReObject.oleobj, AShowAsIcon, hMetaPict, + FReObject.dvaspect); + if Succeeded(Result) then + FRichEdit.RichEditOle.SetDvaspect(Longint(REO_IOB_SELECTION), + FReObject.dvaspect); +end; + +{ TcxRichEdit } + +destructor TcxCustomRichEdit.Destroy; +begin + FreeAndNil(FEditPopupMenu); + inherited Destroy; +end; + +function TcxCustomRichEdit.GetInnerEditClass: TControlClass; +begin + Result := TcxRichInnerEdit; +end; + +procedure TcxCustomRichEdit.DoProtectChange(Sender: TObject; + AStartPos, AEndPos: Integer; var AAllowChange: Boolean); +begin + with Properties do + if Assigned(OnProtectChange) then + OnProtectChange(Self, AStartPos, AEndPos, AAllowChange); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnProtectChange) then + OnProtectChange(Self, AStartPos, AEndPos, AAllowChange); +end; + +procedure TcxCustomRichEdit.DoSaveClipboard(Sender: TObject; + ANumObjects, ANumChars: Integer; var ASaveClipboard: Boolean); +begin + if IsDestroying then + Exit; + with Properties do + if Assigned(OnSaveClipboard) then + OnSaveClipboard(Self, ANumObjects, ANumChars, ASaveClipboard); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnSaveClipboard) then + OnSaveClipboard(Self, ANumObjects, ANumChars, ASaveClipboard); +end; + +procedure TcxCustomRichEdit.EditPopupMenuClick(Sender: TObject); +begin + case Integer(TMenuItem(Sender).Tag) of + -1: Undo; + -2: InnerRich.Redo; + -3: CutToClipboard; + -4: CopyToClipboard; + -5: PasteFromClipboard; + -6: ClearSelection; + -7: InnerRich.SelectAll; + end; +end; + +function TcxCustomRichEdit.GetLines: TStrings; +begin + Result := InnerRich.RichLines; +end; + +function TcxCustomRichEdit.GetInnerRich: TcxRichInnerEdit; +begin + Result := TcxRichInnerEdit(InnerControl); +end; + +procedure TcxCustomRichEdit.SetLines(Value: TStrings); +begin + InnerRich.RichLines.Assign(Value); +end; + +procedure TcxCustomRichEdit.ChangeHandler(Sender: TObject); +begin + FIsNullEditValue := False; + inherited ChangeHandler(Sender); + DoEditValueChanged; +end; + +procedure TcxCustomRichEdit.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); + + function GetScrollBarHandle(AScrollBarKind: TScrollBarKind): HWND; + var + AScrollBar: TcxScrollBar; + begin + Result := 0; + if AScrollBarKind = sbHorizontal then + AScrollBar := HScrollBar + else + AScrollBar := VScrollBar; + if AScrollBar <> nil then + Result := AScrollBar.Handle; + end; + +const + ScrollBarIDs: array[TScrollBarKind] of Integer = (SB_HORZ, SB_VERT); + ScrollMessages: array[TScrollBarKind] of UINT = (WM_HSCROLL, WM_VSCROLL); +begin + with InnerRich do + begin + CallWindowProc(DefWndProc, Handle, ScrollMessages[AScrollBarKind], + Word(AScrollCode) + Word(AScrollPos) shl 16, GetScrollBarHandle(AScrollBarKind)); + if AScrollCode <> scTrack then + AScrollPos := GetScrollPos(Handle, ScrollBarIDs[AScrollBarKind]); + end; + if AScrollCode <> scTrack then + SetScrollBarsParameters; +end; + +procedure TcxCustomRichEdit.AdjustInnerEdit; +begin + if ActiveProperties.MemoMode then + inherited AdjustInnerEdit + else + begin + InnerRich.Color := ViewInfo.BackgroundColor; + InnerRich.Font := Style.GetVisibleFont; + end; +end; + +function TcxCustomRichEdit.CanFocusOnClick: Boolean; +begin + Result := inherited CanFocusOnClick and + not(csLButtonDown in InnerRich.ControlState); +end; + +function TcxCustomRichEdit.CanKeyDownModifyEdit(Key: Word; Shift: TShiftState): Boolean; +begin + Result := inherited CanKeyDownModifyEdit(Key, Shift) or + (((Key = VK_DELETE) or (Key = VK_INSERT)) and (ssShift in Shift)) or + (((Key = Ord('V')) or (Key = Ord('X')) and (ssCtrl in Shift))) and + (Clipboard.FormatCount > 0); + Result := Result or (Key = VK_BACK); // !!! +end; + +procedure TcxCustomRichEdit.ContainerStyleChanged(Sender: TObject); +begin + inherited ContainerStyleChanged(Sender); + if not IsInplace and DataBinding.IDefaultValuesProvider.IsDataStorage and + not ActiveProperties.MemoMode and not ModifiedAfterEnter then + Reset; +end; + +function TcxCustomRichEdit.DoShowPopupMenu(AMenu: TComponent; X, Y: Integer): Boolean; +begin + if Assigned(AMenu) then + Result := inherited DoShowPopupMenu(AMenu, X, Y) + else + begin + UpdateEditPopupMenuItems(GetEditPopupMenuInstance); + Result := inherited DoShowPopupMenu(GetEditPopupMenuInstance, X, Y); + EditingChanged; + end; +end; + +function TcxCustomRichEdit.GetEditValue: TcxEditValue; +begin + if FIsNullEditValue then + Result := Null + else + PrepareEditValue('', Result, False); +end; + +{ TcxCustomRichEditViewData } + +procedure TcxCustomRichEditViewData.Calculate(ACanvas: TcxCanvas; + const ABounds: TRect; const P: TPoint; Button: TcxMouseButton; + Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); +begin + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, AIsMouseEvent); + TcxCustomRichEditViewInfo(AViewInfo).IsDrawBitmapDirty := True; +end; + +function TcxCustomRichEditViewData.InternalGetEditContentSize( + ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + const AEditSizeProperties: TcxEditSizeProperties): TSize; +var + ADC: HDC; + AHeight: Integer; +begin + if (AEditSizeProperties.Width = -1) or (Properties.VisibleLineCount > 0) then + Result := inherited InternalGetEditContentSize(ACanvas, AEditValue, + AEditSizeProperties) + else + begin + ADC := CreateCompatibleDC(ACanvas.Handle); + try + Result.cx := AEditSizeProperties.Width; + DrawRichEdit(ADC, Rect(0, 0, AEditSizeProperties.Width, 0), VarToStr(AEditValue), + Properties, Style.Font, clWhite, clBlack, True, AHeight); + if AHeight > 0 then + Inc(AHeight, GetEditContentSizeCorrection.cy); + Result.cy := AHeight; + finally + DeleteDC(ADC); + end; + end; +end; + +function TcxCustomRichEditViewData.GetProperties: TcxCustomRichEditProperties; +begin + Result := TcxCustomRichEditProperties(FProperties); +end; + +{ TcxRichEditOleCallback } + +constructor TcxRichEditOleCallback.Create(AOwner: TcxRichInnerEdit); +begin + inherited Create; + FEdit := AOwner; +end; + +function TcxRichEditOleCallback.ContextSensitiveHelp(fEnterMode: BOOL): HRESULT; +begin + Result := E_NOTIMPL; +end; + +function TcxRichEditOleCallback.DeleteObject(oleobj: IOLEObject): HRESULT; +begin + if Assigned(oleobj) then + oleobj.Close(OLECLOSE_NOSAVE); + Result := S_OK; +end; + +function TcxRichEditOleCallback.GetClipboardData(const chrg: TCharRange; reco: DWORD; + out dataobj: IDataObject): HRESULT; +begin + Result := E_NOTIMPL; +end; + +function TcxRichEditOleCallback.GetContextMenu(seltype: Word; oleobj: IOleObject; + const chrg: TCharRange; var menu: HMENU): HRESULT; +var + P: TPoint; +begin + P := GetMouseCursorPos; + PostMessage(FEdit.Handle, WM_CONTEXTMENU, FEdit.Handle, Integer(PointToSmallPoint(P))); + Result := S_OK; +end; + +function TcxRichEditOleCallback.GetDragDropEffect(fDrag: BOOL; grfKeyState: DWORD; + var dwEffect: DWORD): HRESULT; + var Effect: DWORD; +begin + Result:= S_OK; + if not fDrag then + begin + if ((grfKeyState and (MK_CONTROL or MK_SHIFT)) = (MK_CONTROL or MK_SHIFT)) then + Effect := DROPEFFECT_LINK + else if ((grfKeyState and MK_CONTROL) = MK_CONTROL) then + Effect := DROPEFFECT_COPY + else + Effect := DROPEFFECT_MOVE; + if (Effect and dwEffect <> 0) then + dwEffect := Effect; + end; +end; + +function TcxRichEditOleCallback.GetInPlaceContext(out Frame: IOleInPlaceFrame; + out Doc: IOleInPlaceUIWindow; + lpFrameInfo: POleInPlaceFrameInfo): HRESULT; +begin + Doc := nil; + Frame := cxGetVCLFrameForm(ValidParentForm(FEdit)); + Frame._AddRef; + with lpFrameInfo^ do + begin + fMDIApp := False; + Frame.GetWindow(hWndFrame); + hAccel := 0; + cAccelEntries := 0; + end; + Result := S_OK; +end; + +function TcxRichEditOleCallback.GetNewStorage(out stg: IStorage): HRESULT; +var + LockBytes: ILockBytes; +begin + Result:= S_OK; + try + OleCheck(CreateILockBytesOnHGlobal(0, True, LockBytes)); + OleCheck(StgCreateDocfileOnILockBytes(LockBytes, STGM_READWRITE + or STGM_SHARE_EXCLUSIVE or STGM_CREATE, 0, stg)); + except + Result:= E_OUTOFMEMORY; + end; +end; + +function TcxRichEditOleCallback.QueryAcceptData(dataobj: IDataObject; var cfFormat: TClipFormat; + reco: DWORD; fReally: BOOL; hMetaPict: HGLOBAL): HRESULT; +begin + Result := S_OK; +end; + +function TcxRichEditOleCallback.QueryInsertObject(const clsid: TCLSID; + stg: IStorage; cp: longint): HRESULT; +var + AAllowInsertObject: Boolean; +begin + Result := E_NOTIMPL; + if cp <> -1 then + Exit; + AAllowInsertObject := True; + FEdit.BeforeInsertObject(AAllowInsertObject, clsid); + if AAllowInsertObject then + Result := S_OK; +end; + +function TcxRichEditOleCallback.ShowContainerUI(fShow: BOOL): HRESULT; +begin + Result:= E_NOTIMPL; +end; + +{ TcxCustomRichEditProperties } + +constructor TcxCustomRichEditProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FHideScrollBars := True; + FAutoURLDetect := False; + FAllowObjects := False; + FStreamModes := []; +end; + +procedure TcxCustomRichEditProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomRichEditProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with Source as TcxCustomRichEditProperties do + begin + Self.AllowObjects := AllowObjects; + Self.AutoURLDetect := AutoURLDetect; + Self.HideScrollBars := HideScrollBars; + Self.MemoMode := MemoMode; + Self.PlainText := PlainText; + Self.SelectionBar := SelectionBar; + Self.StreamModes := StreamModes; + Self.OnQueryInsertObject := OnQueryInsertObject; + Self.OnProtectChange := OnProtectChange; + Self.OnResizeRequest := OnResizeRequest; + Self.OnSaveClipboard := OnSaveClipboard; + Self.OnSelectionChange := OnSelectionChange; + Self.OnURLClick := OnURLClick; + Self.OnURLMove := OnURLMove; + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +class function TcxCustomRichEditProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxRichEdit; +end; + +function TcxCustomRichEditProperties.GetDisplayText( + const AEditValue: TcxEditValue; AFullText: Boolean = False; + AIsInplace: Boolean = True): WideString; +begin + if (MemoMode or not PlainText) and IsRichText(VarToStr(AEditValue)) then + Result := inherited GetDisplayText(ConvertRichText(VarToStr(AEditValue)), AFullText) + else + Result := inherited GetDisplayText(AEditValue, AFullText); +end; + +function TcxCustomRichEditProperties.GetSupportedOperations: TcxEditSupportedOperations; +begin + Result := [esoAutoHeight, esoEditing, esoHorzAlignment]; +end; + +function TcxCustomRichEditProperties.CanValidate: Boolean; +begin + Result := False; +end; + +class function TcxCustomRichEditProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxCustomRichEditViewData; +end; + +class function TcxCustomRichEditProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxCustomRichEditViewInfo; +end; + +function TcxCustomRichEditProperties.IsResetEditClass: Boolean; +begin + Result := False; +end; + +procedure TcxCustomRichEditProperties.SetAllowObjects( + const Value: Boolean); +begin + if FAllowObjects <> Value then + begin + FAllowObjects := Value; + Changed; + end; +end; + +procedure TcxCustomRichEditProperties.SetAutoURLDetect( + const Value: Boolean); +begin + if Value <> FAutoURLDetect then + begin + FAutoURLDetect := Value; + Changed; + end; +end; + +procedure TcxCustomRichEditProperties.SetHideScrollBars(Value: Boolean); +begin + if Value <> FHideScrollBars then + begin + FHideScrollBars := Value; + Changed; + end; +end; + +procedure TcxCustomRichEditProperties.SetMemoMode(Value: Boolean); +begin + if Value <> FMemoMode then + begin + FMemoMode := Value; + Changed; + end; +end; + +procedure TcxCustomRichEditProperties.SetPlainText(Value: Boolean); +begin + if FPlainText <> Value then + begin + FPlainText := Value; + FPlainTextChanged := True; + try + Changed; + finally + FPlainTextChanged := False; + end; + end; +end; + +procedure TcxCustomRichEditProperties.SetSelectionBar(Value: Boolean); +begin + if Value <> FSelectionBar then + begin + FSelectionBar := Value; + Changed; + end; +end; + +procedure TcxCustomRichEditProperties.SetStreamModes(const Value: TcxRichEditStreamModes); +begin + if Value <> FStreamModes then + begin + FStreamModes := Value; + Changed; + end; +end; + +procedure TcxCustomRichEditProperties.SetOnQueryInsertObject( + Value: TcxRichEditQueryInsertObjectEvent); +begin + FOnQueryInsertObject := Value; + Changed; +end; + +{ TcxCustomRichEditViewInfo } + +constructor TcxCustomRichEditViewInfo.Create; +begin + inherited Create; + PrevDrawBitmapSize.cx := -1; + PrevDrawBitmapSize.cy := -1; +end; + +destructor TcxCustomRichEditViewInfo.Destroy; +begin + if DrawBitmap <> 0 then + DeleteObject(DrawBitmap); + inherited Destroy; +end; + +procedure TcxCustomRichEditViewInfo.DrawNativeStyleEditBackground(ACanvas: TcxCanvas; ADrawBackground: Boolean; + ABackgroundStyle: TcxEditBackgroundPaintingStyle; ABackgroundBrush: TBrushHandle); +begin + if IsInplace or (BorderStyle = ebsNone) or not IsCompositionEnabled then + inherited DrawNativeStyleEditBackground(ACanvas, ADrawBackground, ABackgroundStyle, ABackgroundBrush) + else + DrawThemeBackground(OpenTheme(totEdit), ACanvas.Handle, EP_EDITTEXT, ETS_NORMAL, Bounds); +end; + +procedure TcxCustomRichEditViewInfo.DrawText(ACanvas: TcxCanvas); + + procedure PrepareDrawBitmap; + var + ADC: HDC; + APrevBitmap: HBITMAP; + ATempVar: Integer; + begin + if IsDrawBitmapDirty then + begin + if (DrawBitmap = 0) or (PrevDrawBitmapSize.cx <> TextRect.Right - TextRect.Left) or + (PrevDrawBitmapSize.cy <> TextRect.Bottom - TextRect.Top) then + begin + if DrawBitmap <> 0 then + DeleteObject(DrawBitmap); + DrawBitmap := CreateCompatibleBitmap(ACanvas.Handle, + TextRect.Right - TextRect.Left, TextRect.Bottom - TextRect.Top); + end; + ADC := CreateCompatibleDC(ACanvas.Handle); + APrevBitmap := 0; + try + APrevBitmap := SelectObject(ADC, DrawBitmap); + DrawRichEdit(ADC, TextRect, Text, TcxCustomRichEditProperties(EditProperties), + Font, BackgroundColor, TextColor, False, ATempVar); + finally + if APrevBitmap <> 0 then + SelectObject(ADC, APrevBitmap); + DeleteDC(ADC); + end; + IsDrawBitmapDirty := False; + end; + end; + +var + ADC: HDC; + APrevBitmap: HBITMAP; +begin + PrepareDrawBitmap; + ADC := CreateCompatibleDC(ACanvas.Handle); + APrevBitmap := 0; + try + APrevBitmap := SelectObject(ADC, DrawBitmap); + with TextRect do + BitBlt(ACanvas.Handle, Left, Top, Right - Left, Bottom - Top, ADC, 0, 0, SRCCOPY); + finally + if APrevBitmap <> 0 then + SelectObject(ADC, APrevBitmap); + DeleteDC(ADC); + end; +end; + +function TcxCustomRichEditViewInfo.GetUpdateRegion(AViewInfo: TcxContainerViewInfo): TcxRegion; +begin + Result := TcxRegion.Create(Self.Bounds); +end; + +function TcxCustomRichEditViewInfo.NeedShowHint(ACanvas: TcxCanvas; + const P: TPoint; const AVisibleBounds: TRect; out AText: TCaption; + out AIsMultiLine: Boolean; out ATextRect: TRect): Boolean; +begin + Result := False; +end; + +procedure TcxCustomRichEditViewInfo.Paint(ACanvas: TcxCanvas); +begin + ACanvas.Canvas.Lock; + try + if IsInplace and not Focused or IsDBEditPaintCopyDrawing then + begin + DrawText(ACanvas); + ACanvas.ExcludeClipRect(TextRect); + end; + DrawCustomEdit(ACanvas, Self, True, bpsComboListEdit); + finally + ACanvas.Canvas.Unlock; + end; +end; + +function TcxCustomRichEdit.GetActiveProperties: TcxCustomRichEditProperties; +begin + Result := TcxCustomRichEditProperties(InternalGetActiveProperties); +end; + +function TcxCustomRichEdit.GetProperties: TcxCustomRichEditProperties; +begin + Result := TcxCustomRichEditProperties(FProperties); +end; + +procedure TcxCustomRichEdit.SetProperties(Value: TcxCustomRichEditProperties); +begin + FProperties.Assign(Value); +end; + +function TcxCustomRichEdit.GetCanUndo: Boolean; +begin + Result := InnerRich.CanUndo; +end; + +procedure TcxCustomRichEdit.Initialize; +begin + inherited Initialize; + InnerRich.OnProtectChange := DoProtectChange; + InnerRich.OnSaveClipboard := DoSaveClipboard; + Width := 185; + Height := 89; + FIsNullEditValue := True; +end; + +procedure TcxCustomRichEdit.InternalSetEditValue(const Value: TcxEditValue; + AValidateEditValue: Boolean); +begin + LockChangeEvents(True); + try + SendMessage(InnerRich.Handle, WM_SETREDRAW, 0, 0); + try + SendMessage(InnerRich.Handle, WM_SETTEXT, 0, Integer(PChar(''))); + InnerEdit.EditValue := Value; + EditModified := False; + FIsNullEditValue := VarIsNull(Value); + finally + SendMessage(InnerRich.Handle, WM_SETREDRAW, 1, 0); + InnerRich.Invalidate; + end; + finally + LockChangeEvents(False); + end; +end; + +procedure TcxCustomRichEdit.InternalValidateDisplayValue(const ADisplayValue: TcxEditValue); +begin +end; + +procedure TcxCustomRichEdit.PropertiesChanged(Sender: TObject); +begin + with InnerRich do + begin + HideScrollBars := ActiveProperties.HideScrollBars; + MemoMode := ActiveProperties.MemoMode; + PlainText := ActiveProperties.PlainText or MemoMode; + SelectionBar := ActiveProperties.SelectionBar; + AutoURLDetect := ActiveProperties.AutoURLDetect; + AllowObjects := ActiveProperties.AllowObjects; + StreamModes := ActiveProperties.StreamModes; + OnQueryInsertObject := ActiveProperties.OnQueryInsertObject; + end; + if not(IsInplace or IsDBEdit) then + FPropertiesChange := True; + try + inherited PropertiesChanged(Sender); + finally + FPropertiesChange := False; + end; +end; + +procedure TcxCustomRichEdit.ResetEditValue; +begin + if not IsInplace and IsDBEdit then + Reset; +end; + +procedure TcxCustomRichEdit.SetParent(AParent: TWinControl); +begin + inherited SetParent(AParent); + RefreshScrollBars; +end; + +procedure TcxCustomRichEdit.SynchronizeDisplayValue; +begin +end; + +procedure TcxCustomRichEdit.SynchronizeEditValue; +begin +end; + +function TcxCustomRichEdit.GetDefAttributes: TTextAttributes; +begin + Result := InnerRich.DefAttributes; +end; + +function TcxCustomRichEdit.GetDefaultConverter: TConversionClass; +begin + Result := InnerRich.DefaultConverter; +end; + +function TcxCustomRichEdit.GetPageRect: TRect; +begin + Result := InnerRich.PageRect; +end; + +function TcxCustomRichEdit.GetParagraph: TParaAttributes; +begin + Result := InnerRich.Paragraph; +end; + +function TcxCustomRichEdit.GetSelAttributes: TTextAttributes; +begin + if ActiveProperties.MemoMode then + Result := InnerRich.DefAttributes + else + Result := InnerRich.SelAttributes; +end; + +procedure TcxCustomRichEdit.RefreshScrollBars; +var + ARgn: HRGN; +begin + if HandleAllocated and NeedsScrollBars then + begin + ARgn := CreateRectRgnIndirect(GetControlRect(InnerRich)); + SendMessage(InnerRich.Handle, WM_NCPAINT, ARgn, 0); + SetScrollBarsParameters; + VScrollBar.Invalidate; + HScrollBar.Invalidate; + DeleteObject(ARgn); + end; +end; + +procedure TcxCustomRichEdit.SetDefAttributes(const Value: TTextAttributes); +begin + InnerRich.DefAttributes := Value; +end; + +procedure TcxCustomRichEdit.SetDefaultConverter(Value: TConversionClass); +begin + InnerRich.DefaultConverter := Value; +end; + +procedure TcxCustomRichEdit.SetPageRect(const Value: TRect); +begin + InnerRich.PageRect := Value; +end; + +procedure TcxCustomRichEdit.SetSelAttributes(const Value: TTextAttributes); +begin + InnerRich.SelAttributes := Value; +end; + +procedure TcxCustomRichEdit.EMCanPaste(var Message: TMessage); +begin + InnerRich.Dispatch(Message); +end; + +procedure TcxCustomRichEdit.CMVisibleChanged(var Message: TMessage); +begin + inherited; + RefreshScrollBars; +end; + +function TcxCustomRichEdit.UpdateContentOnFocusChanging: Boolean; +begin + Result := False; +end; + +procedure TcxCustomRichEdit.UpdateScrollBars; +begin +end; + +function TcxCustomRichEdit.CanDeleteSelection: Boolean; +begin + Result := (SelLength > 0) and CanModify; +end; + +procedure TcxCustomRichEdit.Changed(Sender: TObject); +begin + DoEditing; +end; + +procedure TcxCustomRichEdit.DoOnResizeRequest(const R: TRect); +begin + with Properties do + if Assigned(OnResizeRequest) then + OnResizeRequest(Self, R); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnResizeRequest) then + OnResizeRequest(Self, R); +end; + +procedure TcxCustomRichEdit.DoOnSelectionChange; +begin + with Properties do + if Assigned(OnSelectionChange) then + OnSelectionChange(Self); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnSelectionChange) then + OnSelectionChange(Self); +end; + +function TcxCustomRichEdit.GetEditPopupMenuInstance: TComponent; + + function NewItem(const ACaption: string; ATag: Integer): TMenuItem; + begin + Result := TMenuItem.Create(Self); + with Result do + begin + Caption := ACaption; + Tag := ATag; + OnClick := EditPopupMenuClick; + end; + end; + +var + APopupMenu: TPopupMenu; +begin + if Assigned(FEditPopupMenu) then + begin + Result := FEditPopupMenu; + Exit; + end; + APopupMenu := TPopupMenu.Create(Self); + FEditPopupMenu := APopupMenu; + APopupMenu.Items.Add( + NewItem(cxGetResourceString(@cxSEditRichEditUndoCaption), -1)); + APopupMenu.Items.Add( + NewItem(cxGetResourceString(@cxSEditRichEditRedoCaption), -2)); + APopupMenu.Items.Add(NewItem('-', MaxInt)); + APopupMenu.Items.Add( + NewItem(cxGetResourceString(@cxSEditRichEditCutCaption), -3)); + APopupMenu.Items.Add( + NewItem(cxGetResourceString(@cxSEditRichEditCopyCaption), -4)); + APopupMenu.Items.Add( + NewItem(cxGetResourceString(@cxSEditRichEditPasteCaption), -5)); + APopupMenu.Items.Add( + NewItem(cxGetResourceString(@cxSEditRichEditDeleteCaption), -6)); + APopupMenu.Items.Add(NewItem('-', MaxInt)); + APopupMenu.Items.Add( + NewItem(cxGetResourceString(@cxSEditRichEditSelectAllCaption), -7)); + Result := APopupMenu; +end; + +function TcxCustomRichEdit.IsNavigationKey(Key: Word; + Shift: TShiftState): Boolean; +begin + Result := (((Key = VK_UP) or (Key = VK_DOWN) or + (Key = VK_LEFT) or (Key = VK_RIGHT)) and (Shift = [])) or + (Key = VK_NEXT) or (Key = VK_PRIOR) or (Key = VK_HOME) or (Key = VK_END); +end; + +procedure TcxCustomRichEdit.UpdateEditPopupMenuItems(APopupMenu: TComponent); + + procedure UpdateItems(APopupMenu: TPopupMenu); + begin + APopupMenu.Items[0].Enabled := InnerRich.CanUndo; + APopupMenu.Items[1].Enabled := InnerRich.CanRedo; + APopupMenu.Items[3].Enabled := CanDeleteSelection; + APopupMenu.Items[4].Enabled := InnerRich.SelLength > 0; + APopupMenu.Items[5].Enabled := InnerRich.CanPaste; + APopupMenu.Items[6].Enabled := CanDeleteSelection; + APopupMenu.Items[8].Enabled := True; + end; + +begin + if not (APopupMenu is TPopupMenu) then + Exit; + InnerRich.ReadOnly := inherited RealReadOnly; + UpdateItems(TPopupMenu(APopupMenu)); + InnerRich.ReadOnly := RealReadOnly; // !!! ReadOnly must be True in DBRichEdit while DataSet is not in EditMode (for AddictSpellChecker) +end; + +procedure TcxCustomRichEdit.ClearSelection; +begin + InnerRich.ClearSelection; +end; + +procedure TcxCustomRichEdit.CutToClipboard; +begin + InnerRich.CutToClipboard; +end; + +function TcxCustomRichEdit.FindText(const ASearchStr: string; + AStartPos, ALength: Integer; AOptions: TSearchTypes): Integer; +begin + Result := InnerRich.FindText(ASearchStr, AStartPos, ALength, AOptions); +end; + +class function TcxCustomRichEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomRichEditProperties; +end; + +procedure TcxCustomRichEdit.PasteFromClipboard; +begin + InnerRich.PasteFromClipboard; +end; + +procedure TcxCustomRichEdit.PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); +var + AStream: TStringStream; +begin + if ActiveProperties.MemoMode or ActiveProperties.PlainText or + (Parent = nil) or not Parent.HandleAllocated then + EditValue := InnerRich.Text + else + begin + AStream := TStringStream.Create(''); + try + Lines.SaveToStream(AStream); + EditValue := AStream.DataString; + finally + AStream.Free; + end; + end; +end; + +procedure TcxCustomRichEdit.Print(const Caption: string); +begin + InnerRich.Print(Caption); +end; + +procedure TcxCustomRichEdit.SaveSelectionToStream(Stream: TStream); +var + AStreamOperationInfo: TcxRichEditStreamOperationInfo; + ACustomStreamModes: TcxRichEditStreamModes; +begin + ACustomStreamModes := [resmSelection]; + TcxRichEditStrings(Lines).InitStreamOperation(Stream, + AStreamOperationInfo, esoSaveTo, True, ACustomStreamModes); + with AStreamOperationInfo do + begin + cxSendStructMessage(InnerRich.Handle, EM_STREAMOUT, TextType, EditStream); + if EditStream.dwError <> 0 then + raise EOutOfResources.Create(cxGetResourceString(@cxSEditRichEditSelectionSaveFail)); + end; +end; + +procedure TcxCustomRichEdit.Undo; +begin + InnerRich.Undo; +end; + +function TcxCustomRichEdit.InsertObject: Boolean; +begin + Result := InnerRich.InsertObject; +end; + +function TcxCustomRichEdit.PasteSpecial: Boolean; +begin + Result := InnerRich.PasteSpecial; +end; + +function TcxCustomRichEdit.ShowObjectProperties: Boolean; +begin + Result := InnerRich.ShowObjectProperties; +end; + +class procedure TcxCustomRichEdit.RegisterConversionFormat( + const AExtension: string; AConversionClass: TConversionClass); +var + AConversionFormat: PConversionFormat; +begin + New(AConversionFormat); + with AConversionFormat^ do + begin + Extension := AnsiLowerCaseFileName(AExtension); + ConversionClass := AConversionClass; + Next := FConversionFormatList; + end; + FConversionFormatList := AConversionFormat; + TCustomRichEdit.RegisterConversionFormat(AExtension, AConversionClass); +end; + +procedure Initialize; +begin + GetRegisteredEditProperties.Register(TcxRichEditProperties, + cxGetResourceString(@scxSEditRepositoryRichEditItem)); + CFObjectDescriptor := RegisterClipboardFormat('Object Descriptor'); + CFEmbeddedObject := RegisterClipboardFormat('Embedded Object'); + CFLinkSource := RegisterClipboardFormat('Link Source'); + CFRtf := RegisterClipboardFormat(CF_RTF); + CFRETextObj := RegisterClipboardFormat(CF_RETEXTOBJ); +end; + +initialization + Initialize; +finalization + FreeAndNil(FRichRenderer); + FreeAndNil(FRichConverter); + GetRegisteredEditProperties.Unregister(TcxRichEditProperties); + if FRichEditLibrary <> 0 then + FreeLibrary(FRichEditLibrary); + ReleaseConversionFormatList; +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxScrollCursors.res b/official/x.35/ExpressEditors Library 5/Sources/cxScrollCursors.res new file mode 100644 index 00000000..400d2d4f Binary files /dev/null and b/official/x.35/ExpressEditors Library 5/Sources/cxScrollCursors.res differ diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxSelectEditRepositoryItem.dfm b/official/x.35/ExpressEditors Library 5/Sources/cxSelectEditRepositoryItem.dfm new file mode 100644 index 00000000..3c39a141 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxSelectEditRepositoryItem.dfm @@ -0,0 +1,75 @@ +object cxSelectRepositoryItem: TcxSelectRepositoryItem + Left = 403 + Top = 209 + BorderStyle = bsDialog + Caption = 'Select EditRepositoryItem' + ClientHeight = 392 + ClientWidth = 346 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 10 + Top = 320 + Width = 56 + Height = 13 + Caption = 'Description:' + end + object lbItems: TListBox + Left = 8 + Top = 8 + Width = 233 + Height = 305 + ItemHeight = 13 + Sorted = True + TabOrder = 0 + OnClick = lbItemsClick + OnMouseDown = lbItemsMouseDown + end + object Panel1: TPanel + Left = 8 + Top = 335 + Width = 329 + Height = 49 + BevelInner = bvLowered + Color = clInfoBk + TabOrder = 3 + object lbHint: TLabel + Left = 4 + Top = 4 + Width = 321 + Height = 41 + AutoSize = False + Caption = 'LongHint' + WordWrap = True + end + end + object btOk: TButton + Left = 256 + Top = 8 + Width = 75 + Height = 25 + Caption = '&Ok' + Default = True + Enabled = False + ModalResult = 1 + TabOrder = 1 + end + object btCancel: TButton + Left = 256 + Top = 40 + Width = 75 + Height = 25 + Cancel = True + Caption = '&Cancel' + ModalResult = 2 + TabOrder = 2 + end +end diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxSelectEditRepositoryItem.pas b/official/x.35/ExpressEditors Library 5/Sources/cxSelectEditRepositoryItem.pas new file mode 100644 index 00000000..17882a74 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxSelectEditRepositoryItem.pas @@ -0,0 +1,145 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSelectEditRepositoryItem; + +{$I cxVer.inc} + +interface + +uses + Windows, SysUtils, Classes, Controls, Forms, StdCtrls, cxClasses, cxEdit, + ExtCtrls; + +type + TcxSelectRepositoryItemSetup = record + TopIndex: Integer; + Selected: Integer; + List: TcxRegisteredClasses; + Pos: TPoint; + end; + + TcxSelectRepositoryItem = class(TForm) + lbItems: TListBox; + Panel1: TPanel; + lbHint: TLabel; + Label1: TLabel; + btOk: TButton; + btCancel: TButton; + procedure lbItemsClick(Sender: TObject); + procedure lbItemsMouseDown(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + private + FList: TcxRegisteredClasses; + procedure Setup(const AData: TcxSelectRepositoryItemSetup); + procedure SaveSetup(var AData: TcxSelectRepositoryItemSetup); + end; + +function GetEditRepositoryItemClass( + var ASetupData: TcxSelectRepositoryItemSetup): TcxEditRepositoryItemClass; + +implementation + +{$R *.dfm} + +function GetEditRepositoryItemClass( + var ASetupData: TcxSelectRepositoryItemSetup): TcxEditRepositoryItemClass; +var + ASelectRepositoryItem: TcxSelectRepositoryItem; +begin + Result := nil; + ASelectRepositoryItem := TcxSelectRepositoryItem.Create(nil); + try + ASelectRepositoryItem.Setup(ASetupData); + if ASelectRepositoryItem.ShowModal = mrOk then + Result := TcxEditRepositoryItemClass( + ASelectRepositoryItem.lbItems.Items.Objects[ASelectRepositoryItem.lbItems.ItemIndex]); + ASelectRepositoryItem.SaveSetup(ASetupData); + finally + ASelectRepositoryItem.Release; + end; +end; + +procedure TcxSelectRepositoryItem.lbItemsClick(Sender: TObject); +begin + btOk.Enabled := lbItems.ItemIndex <> -1; + if btOk.Enabled then + lbHint.Caption := FList.GetHintByClass( + TcxEditRepositoryItemClass(lbItems.Items.Objects[lbItems.ItemIndex])) + else + lbHint.Caption := ''; +end; + +procedure TcxSelectRepositoryItem.lbItemsMouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + if (ssDouble in Shift) and (mbLeft = Button) and + (lbItems.ItemAtPos(Point(X, Y), True) <> -1) then ModalResult := mrOk; +end; + +procedure TcxSelectRepositoryItem.Setup(const AData: TcxSelectRepositoryItemSetup); +var + I: Integer; +begin + with AData do + begin + FList := List; + for I := 0 to List.Count - 1 do + lbItems.Items.AddObject(List.Descriptions[I], TObject(List[I])); + if (Pos.X = -1) and (Pos.Y = -1) then Position := poScreenCenter + else + begin + Left := Pos.X; + Top := Pos.Y; + end; + lbItems.TopIndex := TopIndex; + if (Selected = -1) or ((Selected > 0) and (Selected < List.Count)) then + lbItems.ItemIndex := Selected; + lbItemsClick(nil); + end; +end; + +procedure TcxSelectRepositoryItem.SaveSetup(var AData: TcxSelectRepositoryItemSetup); +begin + with AData do + begin + Pos := Point(Left, Top); + Selected := lbItems.ItemIndex; + TopIndex := lbItems.TopIndex; + end; +end; + +end. + diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxShellBrowser.dfm b/official/x.35/ExpressEditors Library 5/Sources/cxShellBrowser.dfm new file mode 100644 index 00000000..0cfc1e06 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxShellBrowser.dfm @@ -0,0 +1,74 @@ +object cxShellBrowserDlg: TcxShellBrowserDlg + Left = 455 + Top = 160 + ActiveControl = cxStv + AutoScroll = False + BorderIcons = [biSystemMenu] + Caption = 'Browse for Folder' + ClientHeight = 358 + ClientWidth = 308 + Color = clBtnFace + Constraints.MinHeight = 300 + Constraints.MinWidth = 250 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + OnCreate = FormCreate + OnPaint = FormPaint + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object lblFolder: TcxLabel + Left = 12 + Top = 8 + Caption = 'Current Folder' + Transparent = True + end + object cxStv: TcxShellTreeView + Left = 12 + Top = 56 + Width = 284 + Height = 261 + Anchors = [akLeft, akTop, akRight, akBottom] + HideSelection = False + Indent = 19 + Options.ShowNonFolders = False + RightClickSelect = True + TabOrder = 0 + OnChange = cxStvChange + end + object cxTeFolder: TcxTextEdit + Left = 12 + Top = 24 + Anchors = [akLeft, akTop, akRight, akBottom] + Properties.ReadOnly = True + Style.Color = clWindow + TabOrder = 1 + Width = 284 + end + object cxButton1: TcxButton + Left = 139 + Top = 323 + Width = 75 + Height = 25 + Anchors = [akRight, akBottom] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 2 + end + object cxButton2: TcxButton + Left = 219 + Top = 323 + Width = 75 + Height = 25 + Anchors = [akRight, akBottom] + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 3 + end +end diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxShellBrowser.pas b/official/x.35/ExpressEditors Library 5/Sources/cxShellBrowser.pas new file mode 100644 index 00000000..fbeaa0cc --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxShellBrowser.pas @@ -0,0 +1,300 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxShellBrowser; + +{$I cxVer.inc} + +{$IFDEF DELPHI6} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, cxControls, cxContainer, cxShellTreeView, + cxShellCommon, cxSHellControls, cxShellDlgs, + ShlObj, ComObj, ActiveX, cxEdit, cxTextEdit, FileCtrl, + ComCtrls, cxLookAndFeels, cxLookAndFeelPainters, + cxLabel, cxButtons, Menus, cxGraphics; + +type + { TcxShellBrowserDlg } + + TcxShellBrowserDlg = class(TForm) + cxStv: TcxShellTreeView; + lblFolder: TcxLabel; + cxTeFolder: TcxTextEdit; + cxButton1: TcxButton; + cxButton2: TcxButton; + procedure FormResize(Sender: TObject); + procedure cxStvChange(Sender: TObject; Node: TTreeNode); + procedure FormPaint(Sender: TObject); + procedure FormCreate(Sender: TObject); + private + FLookAndFeel: TcxLookAndFeel; + FSizeGripWidth: integer; + FSizeGripHeight: integer; + FSizeGripRect: TRect; + function GetFolder: string; + procedure SetFolder(const Value: string); + function GetCaption: string; + procedure SetCaption(const Value: string); + function GetFolderCaption: string; + procedure SetFolderCaption(const Value: string); + function GetShellOptions: TcxShellTreeViewOptions; + procedure SetShellOptions(Value: TcxShellTreeViewOptions); + function GetRoot: TcxShellTreeRoot; + procedure SetRoot(const Value: TcxShellTreeRoot); + function GetShButtons: boolean; + function GetShInfoTips: boolean; + function GetShShowLines: boolean; + function GetShShowRoot: boolean; + procedure SetSfShowRoot(const Value: boolean); + procedure SetShButtons(const Value: boolean); + procedure SetShInfoTips(const Value: boolean); + procedure SetShShowLines(const Value: boolean); + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + + procedure LFChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); + procedure SetLookAndFeel(Value: TcxLookAndFeel); + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + property DlgCaption: string read GetCaption write SetCaption; + property DlgFolderLabelCaption: string read GetFolderCaption write SetFolderCaption; + property DlgOptions: TcxShellTreeViewOptions read GetShellOptions + write SetShellOptions; + property DlgShowButtons: boolean read GetShButtons write SetShButtons; + property DlgShowInfoTips: boolean read GetShInfoTips write SetShInfoTips; + property DlgShowLines: boolean read GetShShowLines write SetShShowLines; + property DlgShowRoot: boolean read GetShShowRoot write SetSfShowRoot; + property DlgRoot: TcxShellTreeRoot read GetRoot write SetRoot; + property DlgFolder: string read GetFolder write SetFolder; + property LookAndFeel: TcxLookAndFeel read FLookAndFeel write SetLookAndFeel; + end; + +implementation + +{$R *.dfm} + +uses + Types, cxClasses, cxEditConsts, dxThemeConsts, dxThemeManager, dxUxTheme; + +{ TcxShellBrowserDlg } + +constructor TcxShellBrowserDlg.Create(AOwner: TComponent); +begin + inherited Create(AOwner); +{$IFDEF DELPHI9} + PopupMode := pmAuto; + cxStv.InnerTreeView.HandleNeeded; +{$ENDIF} + FLookAndFeel := TcxLookAndFeel.Create(Self); + FLookAndFeel.OnChanged := LFChanged; + cxStv.Style.LookAndFeel.MasterLookAndFeel := FLookAndFeel; + cxTeFolder.Style.LookAndFeel.MasterLookAndFeel := FLookAndFeel; + cxButton1.LookAndFeel.MasterLookAndFeel := FLookAndFeel; + cxButton2.LookAndFeel.MasterLookAndFeel := FLookAndFeel; + cxButton1.Caption := cxGetResourceString(@cxSEditButtonOK); + cxButton2.Caption := cxGetResourceString(@cxSEditButtonCancel); +end; + +destructor TcxShellBrowserDlg.Destroy; +begin + FreeAndNil(FLookAndFeel); + inherited Destroy; +end; + +procedure TcxShellBrowserDlg.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + Params.ExStyle := WS_EX_DLGMODALFRAME or WS_EX_WINDOWEDGE; +end; + +procedure TcxShellBrowserDlg.CreateWnd; +begin + inherited CreateWnd; + SendMessage(Handle, WM_SETICON, 1, 0); +end; + +function TcxShellBrowserDlg.GetCaption: string; +begin + Result := Caption; +end; + +function TcxShellBrowserDlg.GetFolder: string; +begin + Result := cxStv.Path; +end; + +function TcxShellBrowserDlg.GetFolderCaption: string; +begin + Result := lblFolder.Caption; +end; + +procedure TcxShellBrowserDlg.SetCaption(const Value: string); +begin + Caption := Value; +end; + +procedure TcxShellBrowserDlg.SetFolder(const Value: string); +begin + cxStv.Path := Value; +end; + +procedure TcxShellBrowserDlg.SetFolderCaption(const Value: string); +begin + lblFolder.Caption := Value; +end; + +procedure TcxShellBrowserDlg.FormResize(Sender: TObject); +begin + cxTeFolder.Text := MinimizeName(cxStv.Path, Canvas, cxTeFolder.Width); + FSizeGripRect := ClientRect; + FSizeGripRect.Left := FSizeGripRect.Right - FSizeGripWidth; + FSizeGripRect.Top := FSizeGripRect.Bottom - FSizeGripHeight; + Refresh; +end; + +procedure TcxShellBrowserDlg.cxStvChange(Sender: TObject; + Node: TTreeNode); +begin + with cxTeFolder do + Text := MinimizeName(cxStv.Path, Self.Canvas, Width); + // cxStv.InnerTreeView.Selected.MakeVisible; +end; + +procedure TcxShellBrowserDlg.SetShellOptions(Value: TcxShellTreeViewOptions); +begin + cxStv.Options := Value; +end; + +function TcxShellBrowserDlg.GetRoot: TcxShellTreeRoot; +begin + Result := cxStv.Root; +end; + +procedure TcxShellBrowserDlg.SetRoot(const Value: TcxShellTreeRoot); +begin + cxStv.Root := Value; +end; + +function TcxShellBrowserDlg.GetShButtons: boolean; +begin + Result := cxStv.ShowButtons; +end; + +function TcxShellBrowserDlg.GetShellOptions: TcxShellTreeViewOptions; +begin + Result := cxStv.Options; +end; + +function TcxShellBrowserDlg.GetShInfoTips: boolean; +begin + Result := cxStv.ShowInfoTips; +end; + +function TcxShellBrowserDlg.GetShShowLines: boolean; +begin + Result := cxStv.ShowLines; +end; + +function TcxShellBrowserDlg.GetShShowRoot: boolean; +begin + Result := cxStv.ShowRoot; +end; + +procedure TcxShellBrowserDlg.SetSfShowRoot(const Value: boolean); +begin + cxStv.ShowRoot := Value; +end; + +procedure TcxShellBrowserDlg.SetShButtons(const Value: boolean); +begin + cxStv.ShowButtons := Value; +end; + +procedure TcxShellBrowserDlg.SetShInfoTips(const Value: boolean); +begin + cxStv.ShowInfoTips := Value; +end; + +procedure TcxShellBrowserDlg.SetShShowLines(const Value: boolean); +begin + cxStv.ShowLines := Value; +end; + +procedure TcxShellBrowserDlg.FormPaint(Sender: TObject); +var + ACanvas: TcxCanvas; +begin + ACanvas := TcxCanvas.Create(Canvas); + try + FLookAndFeel.Painter.DrawSizeGrip(ACanvas, FSizeGripRect, clNone); + finally + ACanvas.Free; + end; +end; + +procedure TcxShellBrowserDlg.FormCreate(Sender: TObject); +begin + FSizeGripWidth := GetSystemMetrics(SM_CXVSCROLL); + FSizeGripHeight := GetSystemMetrics(SM_CYHSCROLL); +end; + +procedure TcxShellBrowserDlg.WMNCHitTest(var Message: TWMNCHitTest); +begin + inherited; + if PtInRect(FSizeGripRect, + ScreenToClient(SmallPointToPoint(Message.Pos))) then + Message.Result := HTBOTTOMRIGHT; +end; + +procedure TcxShellBrowserDlg.LFChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); +begin +end; + +procedure TcxShellBrowserDlg.SetLookAndFeel(Value: TcxLookAndFeel); +begin + FLookAndFeel.Assign(Value); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxShellBrowserDialog.pas b/official/x.35/ExpressEditors Library 5/Sources/cxShellBrowserDialog.pas new file mode 100644 index 00000000..38cf4750 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxShellBrowserDialog.pas @@ -0,0 +1,168 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxShellBrowserDialog; + +interface + +uses + Windows, Messages, SysUtils, Classes, Controls, Forms, + cxShellCommon, cxSHellControls, + cxShellDlgs, cxShellBrowser, cxLookAndFeels; + +type + { TcxCustomShellBrowserDialog } + + TcxCustomShellBrowserDialog = class(TComponent) + private + FDlg: TcxShellBrowserDlg; + FFolderCaption: string; + FLookAndFeel: TcxLookAndFeel; + FPath: string; + FRoot: TcxDlgShellRoot; + FShButtons: Boolean; + FShellOptions: TcxDlgShellOptions; + FShInfoTips: Boolean; + FShShowLines: Boolean; + FShShowRoot: Boolean; + FTitle: string; + procedure SetLookAndFeel(Value: TcxLookAndFeel); + protected + function CreateForm: TcxShellBrowserDlg; dynamic; + property FolderLabelCaption: string read FFolderCaption write FFolderCaption; + property LookAndFeel: TcxLookAndFeel read FLookAndFeel write SetLookAndFeel; + property Options: TcxDlgShellOptions read fShellOptions write fShellOptions; + property Path: string read fPath write fPath; + property Root: TcxDlgShellRoot read fRoot write fRoot; + property ShowButtons: Boolean read FShButtons write FShButtons default True; + property ShowInfoTips: Boolean read FShInfoTips write FShInfoTips default False; + property ShowLines: Boolean read fShShowLines write fShShowLines default True; + property ShowRoot: Boolean read FShShowRoot write FShShowRoot default True; + property Title: string read FTitle write FTitle; + public + constructor Create(aOwner: TComponent); override; + destructor Destroy; override; + function Execute: Boolean; + end; + + { TcxShellBrowserDialog } + + TcxShellBrowserDialog = class(TcxCustomShellBrowserDialog) + published + property FolderLabelCaption; + property LookAndFeel; + property Options; + property Path; + property Root; + property ShowButtons; + property ShowInfoTips; + property ShowLines; + property ShowRoot; + property Title; + end; + +implementation + +{ TcxCustomShellBrowser } + +constructor TcxCustomShellBrowserDialog.Create(aOwner: TComponent); +begin + inherited; + fShellOptions := TcxDlgShellOptions.Create; + fRoot := TcxDlgShellRoot.Create; + Title := ''; + FShShowRoot := True; + FShButtons := True; + fShShowLines := True; + FLookAndFeel := TcxLookAndFeel.Create(Self); +end; + +destructor TcxCustomShellBrowserDialog.Destroy; +begin + FreeAndNil(FLookAndFeel); + fRoot.Free; + fShellOptions.Free; + inherited; +end; + +function TcxCustomShellBrowserDialog.Execute: Boolean; +var + vOc: TCursor; +begin + vOc := Screen.Cursor; + Screen.Cursor := crHourglass; + try + FDlg := CreateForm; + with FDlg do + begin + if Length(Title) > 0 then + DlgCaption := Title; + if Length(FFolderCaption) > 0 then + DlgFolderLabelCaption := FFolderCaption; + DlgOptions.ShowFolders := fShellOptions.ShowFolders; + DlgOptions.ShowToolTip := fShellOptions.ShowToolTip; + DlgOptions.TrackShellChanges := fShellOptions.TrackShellChanges; + DlgOptions.ContextMenus := fShellOptions.ContextMenus; + DlgOptions.ShowNonFolders := fShellOptions.ShowNonFolders; + DlgOptions.ShowHidden := fShellOptions.ShowHidden; + DlgRoot.BrowseFolder := fRoot.BrowseFolder; + DlgRoot.CustomPath := fRoot.CustomPath; + DlgShowButtons := ShowButtons; + DlgShowInfoTips := ShowInfoTips; + DlgShowLines := ShowLines; + DlgShowRoot := ShowRoot; + DlgFolder := fPath; + FDlg.LookAndFeel.MasterLookAndFeel := Self.LookAndFeel; + Result := ShowModal = idOk; + if Result then + fPath := FDlg.DlgFolder; + end; + finally + FreeAndNil(FDlg); + Screen.Cursor := vOc; + end; +end; + +function TcxCustomShellBrowserDialog.CreateForm: TcxShellBrowserDlg; +begin + Result := TcxShellBrowserDlg.Create(Application); +end; + +procedure TcxCustomShellBrowserDialog.SetLookAndFeel(Value: TcxLookAndFeel); +begin + FLookAndFeel.Assign(Value); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxShellComboBox.pas b/official/x.35/ExpressEditors Library 5/Sources/cxShellComboBox.pas new file mode 100644 index 00000000..4c74db25 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxShellComboBox.pas @@ -0,0 +1,1876 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxShellComboBox; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, Classes, ComCtrls, Controls, ImgList, ShlObj, cxClasses, + cxContainer, cxDataUtils, cxDropDownEdit, cxEdit, cxGraphics, cxTextEdit, + cxShellListView, cxShellTreeView, cxShellCommon, cxShellControls; + +type + TcxShellComboBoxViewOption = (scvoShowFiles, scvoShowHidden); + TcxShellComboBoxViewOptions = set of TcxShellComboBoxViewOption; + + TcxPopupShellTreeViewOption = (tvoContextMenus, tvoHotTrack, tvoShowButtons, + tvoShowInfoTips, tvoShowLines, tvoShowRoot, tvoShowToolTip, + tvoRightClickSelect); + TcxPopupShellTreeViewOptions = set of TcxPopupShellTreeViewOption; + + TcxShellComboBoxShowFullPath = (sfpNever, sfpAlways, sfpNotFocused); + + { TcxShellComboBoxViewInfo } + + TcxShellComboBoxViewInfo = class(TcxCustomTextEditViewInfo) + public + ShellIconPosition: TPoint; + ShellSysIconIndex: Integer; + ShellSysIconOverlayIndex: Integer; + procedure Offset(DX, DY: Integer); override; + procedure Paint(ACanvas: TcxCanvas); override; + end; + + { TcxShellComboBoxViewData } + + TcxCustomShellComboBoxProperties = class; + + TcxShellComboBoxViewData = class(TcxCustomDropDownEditViewData) + private + function GetProperties: TcxCustomShellComboBoxProperties; + protected + function InternalEditValueToDisplayText(AEditValue: TcxEditValue): string; override; + function InternalGetEditConstantPartSize(ACanvas: TcxCanvas; AIsInplace: Boolean; + AEditSizeProperties: TcxEditSizeProperties; var MinContentSize: TSize; + AViewInfo: TcxCustomEditViewInfo): TSize; override; + public + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; + const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AViewInfo: TcxCustomEditViewInfo; AIsMouseEvent: Boolean); override; + procedure EditValueToDrawValue(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; AViewInfo: TcxCustomEditViewInfo); override; + function GetClientExtent(ACanvas: TcxCanvas; + AViewInfo: TcxCustomEditViewInfo): TRect; override; + property Properties: TcxCustomShellComboBoxProperties read GetProperties; + end; + + { TcxShellComboBoxRoot } + + TcxShellComboBoxRoot = class(TcxCustomShellRoot) + private + FOnChange: TNotifyEvent; + protected + procedure RootUpdated; override; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + end; + + { TcxShellComboBoxLookupData } + + TcxCustomShellComboBox = class; + + TcxShellComboBoxLookupData = class(TcxCustomTextEditLookupData) + private + function GetEdit: TcxCustomShellComboBox; + protected + function GetItem(Index: Integer): string; override; + function GetItemCount: Integer; override; + procedure ListChanged; override; + property Edit: TcxCustomShellComboBox read GetEdit; + end; + + { TcxCustomShellComboBoxProperties } + + TcxCustomShellComboBoxProperties = class(TcxCustomPopupEditProperties) + private + FFastSearch: Boolean; + FIncrementalSearch: Boolean; + FRoot: TcxShellComboBoxRoot; + FShowFullPath: TcxShellComboBoxShowFullPath; + FStoreRelativePath: Boolean; + FTreeViewOptions: TcxPopupShellTreeViewOptions; + FViewOptions: TcxShellComboBoxViewOptions; + FOnAddFolder: TcxShellAddFolderEvent; + FOnRootSettingsChanged: TNotifyEvent; + procedure DoRootSettingsChanged; + function GetDropDownSizeable: Boolean; + function GetDropDownWidth: Integer; + procedure RootChangeHandler(Sender: TObject); + procedure RootSettingsChanged(Sender: TObject); + procedure SetDropDownSizeable(Value: Boolean); + procedure SetDropDownWidth(Value: Integer); + procedure SetFastSearch(Value: Boolean); + procedure SetIncrementalSearch(Value: Boolean); + procedure SetShowFullPath(Value: TcxShellComboBoxShowFullPath); + procedure SetStoreRelativePath(Value: Boolean); + procedure SetTreeViewOptions(Value: TcxPopupShellTreeViewOptions); + procedure SetViewOptions(Value: TcxShellComboBoxViewOptions); + protected + class function GetPopupWindowClass: TcxCustomEditPopupWindowClass; override; + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + procedure CheckRoot; + function EditValueToPIDL(const AEditValue: TcxEditValue): PItemIDList; virtual; + function GetShellViewOptions: TcxShellViewOptions; + procedure RootChanged; virtual; + property OnRootSettingsChanged: TNotifyEvent read FOnRootSettingsChanged + write FOnRootSettingsChanged; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function CompareDisplayValues( + const AEditValue1, AEditValue2: TcxEditValue): Boolean; override; + class function GetContainerClass: TcxContainerClass; override; + function GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; override; + function GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; override; + class function GetLookupDataClass: TcxInterfacedPersistentClass; override; + procedure GetShellDisplayValue(const AEditValue: TcxEditValue; + AFocused: Boolean; out AText: string; + out AShellSysIconIndex, AShellSysIconOverlayIndex: Integer); + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + function IsEditValueValid(var EditValue: TcxEditValue; + AEditFocused: Boolean): Boolean; override; + // !!! + property DropDownSizeable: Boolean read GetDropDownSizeable write SetDropDownSizeable default True; + property DropDownWidth: Integer read GetDropDownWidth write SetDropDownWidth + default 250; + property FastSearch: Boolean read FFastSearch write SetFastSearch default False; + property IncrementalSearch: Boolean read FIncrementalSearch + write SetIncrementalSearch default False; + property Root: TcxShellComboBoxRoot read FRoot write FRoot; + property ShowFullPath: TcxShellComboBoxShowFullPath read FShowFullPath + write SetShowFullPath default sfpNever; + property StoreRelativePath: Boolean read FStoreRelativePath write SetStoreRelativePath default True; + property TreeViewOptions: TcxPopupShellTreeViewOptions read FTreeViewOptions + write SetTreeViewOptions default [tvoContextMenus, tvoHotTrack, + tvoShowButtons, tvoShowLines, tvoShowRoot, tvoShowToolTip]; + property ViewOptions: TcxShellComboBoxViewOptions read FViewOptions + write SetViewOptions default []; + property OnAddFolder: TcxShellAddFolderEvent read FOnAddFolder + write FOnAddFolder; + end; + + { TcxShellComboBoxProperties } + + TcxShellComboBoxProperties = class(TcxCustomShellComboBoxProperties) + published + property Alignment; + property AssignedValues; + property AutoSelect; + property ButtonGlyph; + property ClearKey; + property DropDownSizeable; + property DropDownWidth; + property FastSearch; + property HideSelection; + property ImeMode; + property ImeName; + property IncrementalSearch; + property PopupAlignment; + property ReadOnly; + property Root; + property ShowFullPath; + property StoreRelativePath; + property TreeViewOptions; + property UseLeftAlignmentOnEditing; + property ValidateOnEnter; + property ViewOptions; + property OnAddFolder; + property OnChange; + property OnCloseUp; + property OnEditValueChanged; + property OnPopup; + end; + + { TcxPopupShellTreeView } + + TcxPopupShellTreeView = class(TcxShellTreeView) + private + function GetEdit: TcxCustomShellComboBox; + protected + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure DoSelectNode(AClosePopupReason: TcxEditCloseUpReason); virtual; + property Edit: TcxCustomShellComboBox read GetEdit; + end; + + TcxPopupShellTreeViewClass = class of TcxPopupShellTreeView; + + { TcxShellComboBoxPopupWindow } + + TcxShellComboBoxPopupWindow = class(TcxPopupEditPopupWindow) + private + procedure WMEnable(var Message: TMessage); message WM_ENABLE; + end; + + { TcxCustomShellComboBox } + + TcxCustomShellComboBox = class(TcxCustomPopupEdit) + private + FAbsolutePIDL: PItemIDList; + FIsDependentShellControlsNotification, FNotificationFromDependentShellControls: Boolean; + FIsSelectedNodeChangeEventLocked: Boolean; + FPopupShellTreeView: TcxPopupShellTreeView; + FPopupWindowShowing: Boolean; + FShellListView: TcxCustomShellListView; + FShellTreeView: TcxCustomShellTreeView; + procedure AddFolderHandler(Sender: TObject; AFolder: TcxShellFolder; + var ACanAdd: Boolean); + function GetAbsolutePIDL: PItemIDList; + function GetActiveProperties: TcxCustomShellComboBoxProperties; + function GetPath: string; + function GetProperties: TcxCustomShellComboBoxProperties; +// function GetRelativePath: string; + function GetViewInfo: TcxShellComboBoxViewInfo; + procedure RootChangeHandler(Sender: TObject); + procedure RootSettingsChanged(Sender: TObject); + procedure SetAbsolutePIDL(Value: PItemIDList); + procedure SetPath(const Value: string); + procedure SetProperties(Value: TcxCustomShellComboBoxProperties); + procedure SetRelativePIDL(Value: PItemIDList); +// procedure SetRelativePath(const Value: string); + procedure SetShellListView(Value: TcxCustomShellListView); + procedure SetShellTreeView(Value: TcxCustomShellTreeView); + procedure DSMDoNavigate(var Message: TMessage); message DSM_DONAVIGATE; + procedure DSMSynchronizeRoot(var Message: TMessage); message DSM_SYNCHRONIZEROOT; + protected + function CanDropDown: Boolean; override; + procedure CloseUp(AReason: TcxEditCloseUpReason); override; + procedure CreatePopupWindow; override; + procedure DoInitPopup; override; + procedure DropDown; override; + procedure HandleSelectItem(Sender: TObject); override; + procedure Initialize; override; + procedure InitializePopupWindow; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure PopupWindowShowed(Sender: TObject); override; + procedure PopupWindowShowing(Sender: TObject); override; + procedure PropertiesChanged(Sender: TObject); override; + procedure SynchronizeDisplayValue; override; + procedure SynchronizeEditValue; override; + function CheckAbsolutePIDL(var APIDL: PItemIDList; + ACheckObjectExistence: Boolean): Boolean; + procedure CheckPopupShellTreeView; + function FindNodeAmongExpandedNodes(ANodeText: string): TTreeNode; + function GetPopupShellTreeViewClass: TcxPopupShellTreeViewClass; virtual; + procedure InternalSetAbsolutePIDL(Value: PItemIDList); + procedure InternalSynchronizeEditValue(APIDL: PItemIDList; + const ADisplayText: string = ''); virtual; + procedure InvalidateShellIconRect; + procedure SelectedNodeChangeHandler(Sender: TObject; ANode: TTreeNode); virtual; + procedure SynchronizeDependentShellControls; + procedure SynchronizePopupShellTreeView; + function TraverseAllVisibleNodes(var ANodeIndex: Integer; + ATreeNode: TTreeNode = nil): TTreeNode; + property ShellListView: TcxCustomShellListView read FShellListView write SetShellListView; + property ShellTreeView: TcxCustomShellTreeView read FShellTreeView write SetShellTreeView; + property ViewInfo: TcxShellComboBoxViewInfo read GetViewInfo; + public + destructor Destroy; override; + function CanHide: Boolean; override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property AbsolutePIDL: PItemIDList read GetAbsolutePIDL write SetAbsolutePIDL; + property AbsolutePath: string read GetPath write SetPath; // deprecated + property ActiveProperties: TcxCustomShellComboBoxProperties + read GetActiveProperties; + property Path: string read GetPath write SetPath; + property PopupShellTreeView: TcxPopupShellTreeView read FPopupShellTreeView; + property Properties: TcxCustomShellComboBoxProperties read GetProperties + write SetProperties; + property RelativePIDL: PItemIDList write SetRelativePIDL; // TODO +// property RelativePath: string read GetRelativePath write SetRelativePath; + end; + + { TcxShellComboBox } + + TcxShellComboBox = class(TcxCustomShellComboBox) + private + function GetActiveProperties: TcxShellComboBoxProperties; + function GetProperties: TcxShellComboBoxProperties; + procedure SetProperties(Value: TcxShellComboBoxProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxShellComboBoxProperties + read GetActiveProperties; + published + property Align; + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxShellComboBoxProperties read GetProperties + write SetProperties; + property ShellListView; + property ShellTreeView; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +var + cxShellComboBoxImageList: TCustomImageList; + +implementation + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + ActiveX, CommCtrl, Graphics, ShellAPI, SysUtils, cxControls, cxDBEdit, + cxEditPaintUtils, cxEditUtils, cxExtEditConsts, cxFilterControlUtils, + cxGeometry, cxVariants; + +type + TcxDBTextEditDataBindingAccess = class(TcxDBTextEditDataBinding); + TcxCustomEditAccess = class(TcxCustomEdit); + TcxInnerShellListViewAccess = class(TcxInnerShellListView); + TcxInnerShellTreeViewAccess = class(TcxInnerShellTreeView); + TcxPopupEditPopupWindowAccess = class(TcxPopupEditPopupWindow); + TcxShellTreeItemProducerAccess = class(TcxShellTreeItemProducer); + +const + ShellRootIDL: Word = 0; + +type + { TcxFilterShellComboBoxHelper } + + TcxFilterShellComboBoxHelper = class(TcxFilterDropDownEditHelper) + public + class function GetFilterEditClass: TcxCustomEditClass; override; + end; + +class function TcxFilterShellComboBoxHelper.GetFilterEditClass: TcxCustomEditClass; +begin + Result := TcxShellComboBox; +end; + +procedure FreeAndNilPIDL(var APIDL: PItemIDList); +begin + if APIDL <> nil then + begin + cxMalloc.Free(APIDL); + APIDL := nil; + end; +end; + +procedure GetShellSysIconIndex(APIDL: PItemIDList; + out AShellSysIconIndex, AShellSysIconOverlayIndex: Integer); +const + SHGFI_ATTR_SPECIFIED = $20000; +var + AFlags: Integer; + ASHFileInfo: TSHFileInfo; +begin + AFlags := SHGFI_PIDL or SHGFI_SYSICONINDEX or SHGFI_SMALLICON or + SHGFI_ATTR_SPECIFIED or SHGFI_ATTRIBUTES; + ASHFileInfo.dwAttributes := SFGAO_LINK or SFGAO_SHARE; + SHGetFileInfo(Pointer(APIDL), 0, ASHFileInfo, SizeOf(ASHFileInfo), AFlags); + AShellSysIconIndex := ASHFileInfo.iIcon; + if ASHFileInfo.dwAttributes and SFGAO_LINK <> 0 then + AShellSysIconOverlayIndex := cxShellShortcutItemOverlayIndex + else + if ASHFileInfo.dwAttributes and SFGAO_SHARE <> 0 then + AShellSysIconOverlayIndex := cxShellSharedItemOverlayIndex + else + AShellSysIconOverlayIndex := cxShellNormalItemOverlayIndex; +end; + +procedure PrepareShellComboBoxImageList; +var + ASHFileInfo : TSHFileInfo; +begin + cxShellComboBoxImageList := TCustomImageList.Create(nil); + with cxShellComboBoxImageList do + begin + ShareImages := True; + Handle := SHGetFileInfo(@ShellRootIDL, 0, ASHFileInfo, SizeOf(ASHFileInfo), + SHGFI_PIDL or SHGFI_SYSICONINDEX or SHGFI_SMALLICON); + end; +end; + +{ TcxShellComboBoxViewInfo } + +procedure TcxShellComboBoxViewInfo.Offset(DX, DY: Integer); +begin + inherited Offset(DX, DY); + Inc(ShellIconPosition.X, DX); + Inc(ShellIconPosition.Y, DY); +end; + +procedure TcxShellComboBoxViewInfo.Paint(ACanvas: TcxCanvas); +var + R: TRect; +begin + if (ShellSysIconIndex <> -1) and (cxShellComboBoxImageList <> nil) then + begin + R.TopLeft := ShellIconPosition; + R.Right := R.Left + cxShellComboBoxImageList.Width; + R.Bottom := R.Top + cxShellComboBoxImageList.Height; + if not Transparent then + cxEditFillRect(ACanvas.Handle, R, GetSolidBrush(BackgroundColor)); + ImageList_Draw(cxShellComboBoxImageList.Handle, ShellSysIconIndex, + ACanvas.Handle, R.Left, R.Top, + ILD_TRANSPARENT or IndexToOverlayMask(ShellSysIconOverlayIndex + 1)); + if not Transparent then + ACanvas.ExcludeClipRect(R); + end; + inherited Paint(ACanvas); +end; + +{ TcxShellComboBoxViewData } + +procedure TcxShellComboBoxViewData.Calculate(ACanvas: TcxCanvas; + const ABounds: TRect; const P: TPoint; Button: TcxMouseButton; + Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); + + function GetIconPosition: TPoint; + begin + if cxShellComboBoxImageList = nil then + Result := cxNullPoint + else + with TcxShellComboBoxViewInfo(AViewInfo) do + begin + Result.X := BorderRect.Left + 1; + Result.Y := BorderRect.Top + (BorderRect.Bottom - BorderRect.Top - + cxShellComboBoxImageList.Height) div 2 + end; + end; + +begin + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, AIsMouseEvent); + TcxShellComboBoxViewInfo(AViewInfo).ShellIconPosition := GetIconPosition; +end; + +procedure TcxShellComboBoxViewData.EditValueToDrawValue(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; AViewInfo: TcxCustomEditViewInfo); +begin + with TcxShellComboBoxViewInfo(AViewInfo) do + begin + Properties.GetShellDisplayValue(AEditValue, False, string(Text), + ShellSysIconIndex, ShellSysIconOverlayIndex); + DoOnGetDisplayText(string(Text)); + end; + PrepareSelection(AViewInfo); +end; + +function TcxShellComboBoxViewData.GetClientExtent(ACanvas: TcxCanvas; + AViewInfo: TcxCustomEditViewInfo): TRect; +begin + Result := inherited GetClientExtent(ACanvas, AViewInfo); + if not (Properties.FastSearch and (Edit = nil) or (cxShellComboBoxImageList = nil)) then + Inc(Result.Left, cxShellComboBoxImageList.Width + 4); +end; + +function TcxShellComboBoxViewData.InternalGetEditConstantPartSize(ACanvas: TcxCanvas; + AIsInplace: Boolean; AEditSizeProperties: TcxEditSizeProperties; + var MinContentSize: TSize; AViewInfo: TcxCustomEditViewInfo): TSize; +begin + Result := inherited InternalGetEditConstantPartSize(ACanvas, AIsInplace, + AEditSizeProperties, MinContentSize, AViewInfo); + if IsInplace or (Edit <> nil) and TcxCustomEditAccess(Edit).AutoSize then + begin + if (cxShellComboBoxImageList <> nil) and + (MinContentSize.cy < cxShellComboBoxImageList.Height) then + MinContentSize.cy := cxShellComboBoxImageList.Height; + end; +end; + +function TcxShellComboBoxViewData.InternalEditValueToDisplayText( + AEditValue: TcxEditValue): string; +var + AShellSysIconIndex, AShellSysIconOverlayIndex: Integer; +begin + Properties.GetShellDisplayValue(AEditValue, Focused, Result, AShellSysIconIndex, + AShellSysIconOverlayIndex); +end; + +function TcxShellComboBoxViewData.GetProperties: TcxCustomShellComboBoxProperties; +begin + Result := TcxCustomShellComboBoxProperties(FProperties); +end; + +{ TcxShellComboBoxRoot } + +procedure TcxShellComboBoxRoot.RootUpdated; +begin + inherited RootUpdated; + TcxCustomShellComboBoxProperties(Owner).RootChangeHandler(Self); + if Assigned(FOnChange) then + FOnChange(Self); +end; + +{ TcxShellComboBoxLookupData } + +function TcxShellComboBoxLookupData.GetItem(Index: Integer): string; +begin + Result := Edit.TraverseAllVisibleNodes(Index).Text; +end; + +function TcxShellComboBoxLookupData.GetItemCount: Integer; +begin + if Edit.ActiveProperties.IncrementalSearch then + begin + Result := -1; + Edit.TraverseAllVisibleNodes(Result); + end + else + Result := 0; +end; + +procedure TcxShellComboBoxLookupData.ListChanged; +begin +end; + +function TcxShellComboBoxLookupData.GetEdit: TcxCustomShellComboBox; +begin + Result := TcxCustomShellComboBox(GetOwner); +end; + +{ TcxCustomShellComboBoxProperties } + +constructor TcxCustomShellComboBoxProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FRoot := TcxShellComboBoxRoot.Create(Self, 0); + FRoot.OnSettingsChanged := RootSettingsChanged; + DropDownSizeable := True; + ImmediateDropDown := False; + PopupAutoSize := False; + TreeViewOptions := [tvoContextMenus, tvoHotTrack, tvoShowButtons, + tvoShowLines, tvoShowRoot, tvoShowToolTip]; + ValidateOnEnter := True; + + FStoreRelativePath := True; +end; + +destructor TcxCustomShellComboBoxProperties.Destroy; +begin + FreeAndNil(FRoot); + inherited Destroy; +end; + +procedure TcxCustomShellComboBoxProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomShellComboBoxProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with Source as TcxCustomShellComboBoxProperties do + begin + Self.FastSearch := FastSearch; + Self.IncrementalSearch := IncrementalSearch; + Self.Root.Assign(Root); + Self.ShowFullPath := ShowFullPath; + Self.StoreRelativePath := StoreRelativePath; + Self.TreeViewOptions := TreeViewOptions; + Self.ViewOptions := ViewOptions; + Self.OnAddFolder := OnAddFolder; + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +function TcxCustomShellComboBoxProperties.CompareDisplayValues( + const AEditValue1, AEditValue2: TcxEditValue): Boolean; +var + AShellSysIconIndex1, AShellSysIconIndex2: Integer; + AShellSysIconOverlayIndex1, AShellSysIconOverlayIndex2: Integer; + AText1, AText2: string; +begin + GetShellDisplayValue(AEditValue1, False, AText1, AShellSysIconIndex1, + AShellSysIconOverlayIndex1); + GetShellDisplayValue(AEditValue2, False, AText2, AShellSysIconIndex2, + AShellSysIconOverlayIndex2); + Result := InternalCompareString(AText1, AText2, True) and (FastSearch or + (AShellSysIconIndex1 = AShellSysIconIndex2) and + (AShellSysIconOverlayIndex1 = AShellSysIconOverlayIndex2)); +end; + +class function TcxCustomShellComboBoxProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxShellComboBox; +end; + +function TcxCustomShellComboBoxProperties.GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; +var + AShellSysIconIndex, AShellSysIconOverlayIndex: Integer; + AText: string; +begin + GetShellDisplayValue(AEditValue, False, AText, AShellSysIconIndex, + AShellSysIconOverlayIndex); + Result := AText; +end; + +function TcxCustomShellComboBoxProperties.GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; +begin + Result := evsValue; +end; + +class function TcxCustomShellComboBoxProperties.GetLookupDataClass: TcxInterfacedPersistentClass; +begin + Result := TcxShellComboBoxLookupData; +end; + +procedure TcxCustomShellComboBoxProperties.GetShellDisplayValue( + const AEditValue: TcxEditValue; AFocused: Boolean; + out AText: string; out AShellSysIconIndex, AShellSysIconOverlayIndex: Integer); +var + APath: string; + + procedure GetShellObjectName; + var + APathLength: Integer; + I: Integer; + begin + APathLength := Length(APath); + for I := APathLength - 1 downto 1 do + if APath[I] = '\' then + begin + APath := Copy(APath, I + 1, APathLength - I); + Break; + end; + end; + +var + AAttributes, AParsedCharCount: ULONG; + APIDL: PItemIDList; +begin + AShellSysIconIndex := -1; + if FastSearch then + begin + if VarIsNull(AEditValue) or VarIsEmpty(AEditValue) then + AText := '' + else + begin + APath := VarToStr(AEditValue); + CheckRoot; + if APath = '' then + AText := GetPIDLDisplayName(Root.Pidl) + else + case CheckShellObjectPath(APath, GetPidlName(Root.Pidl), False) of + sptVirtual: + begin + AAttributes := SFGAO_HIDDEN or SFGAO_FOLDER; + GetDesktopIShellFolder.ParseDisplayName(0, nil, StringToOleStr(APath), + AParsedCharCount, APIDL, AAttributes); + if (APIDL <> nil) and not CheckViewOptions(GetShellViewOptions, AAttributes) then + APIDL := nil; + if APIDL = nil then + AText := APath + else + begin + AText := GetPIDLDisplayName(APIDL); + DisposePidl(APIDL); + end; + end; + else + begin + GetShellObjectName; + AText := APath; + end; + end; + end; + Exit; + end; + + if VarIsNull(AEditValue) or VarIsEmpty(AEditValue) then + APIDL := nil + else + APIDL := EditValueToPIDL(AEditValue); + if APIDL = nil then + AText := VarToStr(AEditValue) + else + begin + AText := GetPIDLDisplayName(APIDL, (ShowFullPath = sfpAlways) or + (ShowFullPath = sfpNotFocused) and not AFocused); + GetShellSysIconIndex(APIDL, AShellSysIconIndex, AShellSysIconOverlayIndex); + DisposePidl(APIDL); + end; + DisplayValueToDisplayText(AText); +end; + +class function TcxCustomShellComboBoxProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxShellComboBoxViewInfo; +end; + +function TcxCustomShellComboBoxProperties.IsEditValueValid(var EditValue: TcxEditValue; + AEditFocused: Boolean): Boolean; +begin + Result := True; +end; + +class function TcxCustomShellComboBoxProperties.GetPopupWindowClass: TcxCustomEditPopupWindowClass; +begin + Result := TcxShellComboBoxPopupWindow; +end; + +class function TcxCustomShellComboBoxProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxShellComboBoxViewData; +end; + +procedure TcxCustomShellComboBoxProperties.CheckRoot; +begin + if Root.ShellFolder = nil then + begin + BeginUpdate; + try + Root.CheckRoot; + finally + EndUpdate(False); + end; + end; +end; + +function TcxCustomShellComboBoxProperties.EditValueToPIDL(const AEditValue: TcxEditValue): PItemIDList; +begin + CheckRoot; + if VarIsNull(AEditValue) or VarIsEmpty(AEditValue) then + Result := nil + else + Result := PathToAbsolutePIDL(VarToStr(AEditValue), Root, GetShellViewOptions); +end; + +function TcxCustomShellComboBoxProperties.GetShellViewOptions: TcxShellViewOptions; +begin + Result := [svoShowFolders]; + if scvoShowFiles in FViewOptions then + Include(Result, svoShowFiles); + if scvoShowHidden in FViewOptions then + Include(Result, svoShowHidden); +end; + +procedure TcxCustomShellComboBoxProperties.RootChanged; +begin + Changed; +end; + +procedure TcxCustomShellComboBoxProperties.DoRootSettingsChanged; +begin + if Assigned(FOnRootSettingsChanged) then + FOnRootSettingsChanged(Self); +end; + +function TcxCustomShellComboBoxProperties.GetDropDownSizeable: Boolean; +begin + Result := PopupSizeable; +end; + +function TcxCustomShellComboBoxProperties.GetDropDownWidth: Integer; +begin + Result := PopupWidth; +end; + +procedure TcxCustomShellComboBoxProperties.RootChangeHandler(Sender: TObject); +begin + RootChanged; +end; + +procedure TcxCustomShellComboBoxProperties.RootSettingsChanged(Sender: TObject); +begin + DoRootSettingsChanged; +end; + +procedure TcxCustomShellComboBoxProperties.SetDropDownSizeable(Value: Boolean); +begin + PopupSizeable := Value; +end; + +procedure TcxCustomShellComboBoxProperties.SetDropDownWidth(Value: Integer); +begin + PopupWidth := Value; +end; + +procedure TcxCustomShellComboBoxProperties.SetFastSearch(Value: Boolean); +begin + if Value <> FFastSearch then + begin + FFastSearch := Value; + Changed; + end; +end; + +procedure TcxCustomShellComboBoxProperties.SetIncrementalSearch(Value: Boolean); +begin + if Value <> FIncrementalSearch then + begin + FIncrementalSearch := Value; + Changed; + end; +end; + +procedure TcxCustomShellComboBoxProperties.SetShowFullPath( + Value: TcxShellComboBoxShowFullPath); +begin + if Value <> FShowFullPath then + begin + FShowFullPath := Value; + Changed; + end; +end; + +procedure TcxCustomShellComboBoxProperties.SetStoreRelativePath(Value: Boolean); +begin + if Value <> FStoreRelativePath then + begin + FStoreRelativePath := Value; + Changed; + end; +end; + +procedure TcxCustomShellComboBoxProperties.SetTreeViewOptions(Value: TcxPopupShellTreeViewOptions); +begin + if Value <> FTreeViewOptions then + begin + FTreeViewOptions := Value; + Changed; + end; +end; + +procedure TcxCustomShellComboBoxProperties.SetViewOptions(Value: TcxShellComboBoxViewOptions); +begin + if Value <> FViewOptions then + begin + FViewOptions := Value; + Changed; + end; +end; + +{ TcxPopupShellTreeView } + +procedure TcxPopupShellTreeView.KeyDown(var Key: Word; Shift: TShiftState); +begin + if Key = VK_TAB then + Edit.DoEditKeyDown(Key, Shift); + inherited KeyDown(Key, Shift); + case Key of + VK_ESCAPE: + begin + DoSelectNode(crCancel); + Key := 0; + end; + VK_F4: + if not (ssAlt in Shift) then + begin + DoSelectNode(crClose); + Key := 0; + end; + VK_UP, VK_DOWN: + if ssAlt in Shift then + begin + DoSelectNode(crClose); + Key := 0; + end; + VK_RETURN: + if (Shift = []) and (InnerTreeView.Selected <> nil) then + DoSelectNode(crEnter); + end; +end; + +procedure TcxPopupShellTreeView.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + AHitTests : THitTests; +begin + inherited MouseUp(Button, Shift, X, Y); + AHitTests := InnerTreeView.GetHitTestInfoAt(X, Y); + if ((Button = mbLeft) and not RightClickSelect) or ((Button = mbRight) and RightClickSelect) then + if ([htOnIcon, htOnItem, htOnLabel] * AHitTests <> []) and (AHitTests <> [htOnIcon, htOnItem]) then + DoSelectNode(crEnter); +end; + +procedure TcxPopupShellTreeView.DoSelectNode(AClosePopupReason: TcxEditCloseUpReason); +begin + Edit.CloseUp(AClosePopupReason) +end; + +function TcxPopupShellTreeView.GetEdit: TcxCustomShellComboBox; +begin + Result := TcxCustomShellComboBox(TcxPopupEditPopupWindowAccess(Parent).Edit); +end; + +{ TcxShellComboBoxPopupWindow } + +procedure TcxShellComboBoxPopupWindow.WMEnable(var Message: TMessage); +begin + inherited; + if not IsInternalWindowsDisabling then + if Bool(Message.WParam) then + EnableAppWindows + else + DisableAppWindows; +end; + +{ TcxCustomShellComboBox } + +destructor TcxCustomShellComboBox.Destroy; +begin + if FAbsolutePIDL <> nil then + begin + DisposePidl(FAbsolutePIDL); + FAbsolutePIDL := nil; + end; + + if FShellListView <> nil then + with FShellListView do + if (InnerListView <> nil) and not(csDestroying in InnerListView.ComponentState) then + TcxInnerShellListViewAccess(InnerListView).ComboBoxControl := nil; + + if FShellTreeView <> nil then + with FShellTreeView do + if (InnerTreeView <> nil) and not(csDestroying in InnerTreeView.ComponentState) then + TcxInnerShellTreeViewAccess(InnerTreeView).ComboBoxControl := nil; + + inherited Destroy; +end; + +function TcxCustomShellComboBox.CanHide: Boolean; +begin + Result := not HasPopupWindow or IsWindowEnabled(PopupWindow.Handle); +end; + +class function TcxCustomShellComboBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomShellComboBoxProperties; +end; + +function TcxCustomShellComboBox.CanDropDown: Boolean; +begin + Result := True; +end; + +procedure TcxCustomShellComboBox.CloseUp(AReason: TcxEditCloseUpReason); +begin + if not HasPopupWindow then + Exit; + if AReason in [crTab, crEnter] then + begin + ValidateEdit(True); + SelectAll; + end; + FCloseUpReason := AReason; + PopupWindow.ClosePopup; +end; + +procedure TcxCustomShellComboBox.CreatePopupWindow; +begin + inherited CreatePopupWindow; + PopupWindow.ModalMode := False; +end; + +procedure TcxCustomShellComboBox.DoInitPopup; +begin + inherited DoInitPopup; + ActiveProperties.PopupControl := FPopupShellTreeView; +end; + +procedure TcxCustomShellComboBox.DropDown; +begin + FIsSelectedNodeChangeEventLocked := True; + inherited DropDown; +end; + +procedure TcxCustomShellComboBox.HandleSelectItem(Sender: TObject); +var + ANodeIndex: Integer; + APIDL: PItemIDList; +begin + ANodeIndex := ILookupData.CurrentKey; + APIDL := FPopupShellTreeView.GetNodeAbsolutePIDL(TraverseAllVisibleNodes(ANodeIndex)); + InternalSynchronizeEditValue(APIDL, ''); + DisposePidl(APIDL); + SelectAll; +end; + +procedure TcxCustomShellComboBox.Initialize; +begin + inherited Initialize; + ActiveProperties.Root.OnChange := RootChangeHandler; + ActiveProperties.Root.OnSettingsChanged := RootSettingsChanged; + if IsDesigning then + Exit; + FPopupShellTreeView := GetPopupShellTreeViewClass.Create(PopupWindow); + ActiveProperties.PopupControl := FPopupShellTreeView; + with FPopupShellTreeView do + begin + LookAndFeel.MasterLookAndFeel := Self.PopupControlsLookAndFeel; + ParentColor := True; + Parent := Self.PopupWindow; + Options.ShowNonFolders := False; + Style.BorderStyle := cbsNone; + Style.HotTrack := False; + Style.TransparentBorder := False; + TreeHotTrack := True; + InnerTreeView.ShowInfoTips := False; + OnAddFolder := Self.AddFolderHandler; + OnChange := Self.SelectedNodeChangeHandler; + end; +end; + +procedure TcxCustomShellComboBox.InitializePopupWindow; +begin + inherited InitializePopupWindow; + TcxPopupEditPopupWindowAccess(PopupWindow).SysPanelStyle := ActiveProperties.PopupSizeable; + PopupShellTreeView.Color := ActiveStyle.Color; + PopupWindow.Font := ActiveStyle.GetVisibleFont; +end; + +procedure TcxCustomShellComboBox.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + + if Operation = opRemove then + if AComponent = ShellListView then + ShellListView := nil + else + if AComponent = ShellTreeView then + ShellTreeView := nil; +end; + +procedure TcxCustomShellComboBox.PopupWindowShowed(Sender: TObject); +begin + inherited PopupWindowShowed(Sender); + FPopupWindowShowing := False; +end; + +procedure TcxCustomShellComboBox.PopupWindowShowing(Sender: TObject); +var + ARootNode: TTreeNode; +begin + FPopupWindowShowing := True; + try + inherited PopupWindowShowing(Sender); + SynchronizePopupShellTreeView; + ARootNode := FPopupShellTreeView.InnerTreeView.Items.GetFirstNode; + if (ARootNode <> nil) and not ARootNode.Expanded then + ARootNode.Expanded := True; + finally + FIsSelectedNodeChangeEventLocked := False; + end; +end; + +procedure TcxCustomShellComboBox.PropertiesChanged(Sender: TObject); +begin + inherited PropertiesChanged(Sender); + ActiveProperties.PopupControl := FPopupShellTreeView; + if FPopupShellTreeView <> nil then + with FPopupShellTreeView do + begin + ImeMode := ActiveProperties.ImeMode; + ImeName := ActiveProperties.ImeName; + Options.ContextMenus := tvoContextMenus in ActiveProperties.TreeViewOptions; + Options.ShowHidden := scvoShowHidden in ActiveProperties.ViewOptions; + Options.ShowNonFolders := scvoShowFiles in ActiveProperties.ViewOptions; + Options.ShowToolTip := tvoShowToolTip in ActiveProperties.TreeViewOptions; + RightClickSelect := tvoRightClickSelect in ActiveProperties.TreeViewOptions; + ShowButtons := tvoShowButtons in ActiveProperties.TreeViewOptions; + ShowInfoTips := tvoShowInfoTips in ActiveProperties.TreeViewOptions; + ShowLines := tvoShowLines in ActiveProperties.TreeViewOptions; + ShowRoot := tvoShowRoot in ActiveProperties.TreeViewOptions; + TreeHotTrack := tvoHotTrack in ActiveProperties.TreeViewOptions + end; +end; + +procedure TcxCustomShellComboBox.SynchronizeDisplayValue; +var + APIDL: PItemIDList; + S: String; +begin + if DataBinding is TcxDBTextEditDataBinding then // TODO Remove cxDBEdit, IsDataSourceLive + with TcxDBTextEditDataBindingAccess(DataBinding) do + if not IsDataAvailable then + begin + ViewInfo.ShellSysIconIndex := -1; + Exit; + end; + + if VarIsNull(FEditValue) or VarIsEmpty(FEditValue) then + begin + ActiveProperties.CheckRoot; + APIDL := GetPidlCopy(ActiveProperties.Root.Pidl); + end + else + APIDL := ActiveProperties.EditValueToPIDL(FEditValue); + + InternalSetAbsolutePIDL(APIDL); + + if APIDL = nil then + begin + S := VarToStr(FEditValue); + ViewInfo.ShellSysIconIndex := -1; + end + else + begin + S := GetPIDLDisplayName(APIDL, (ActiveProperties.ShowFullPath = sfpAlways) or + (ActiveProperties.ShowFullPath = sfpNotFocused) and not IsFocused); + GetShellSysIconIndex(APIDL, ViewInfo.ShellSysIconIndex, + ViewInfo.ShellSysIconOverlayIndex); + DisposePidl(APIDL); + end; + + DataBinding.DisplayValue := S; +// SelStart := Length(S); + InvalidateShellIconRect; +end; + +procedure TcxCustomShellComboBox.SynchronizeEditValue; +var + APIDL: PItemIDList; + + function GetRootAbsolutePIDL: PItemIDList; + begin + Result := GetPidlCopy(ActiveProperties.Root.Pidl); + end; + + function GetSelectedNodeAbsolutePIDL: PItemIDList; + begin + with PopupShellTreeView do + Result := GetNodeAbsolutePIDL(InnerTreeView.Selected); + end; + + procedure InternalEditValueToPIDL; + var + ACSIDL: Integer; + ANode: TTreeNode; + AParentIFolder: IShellFolder; + AParentFolderPIDL: PItemIDList; + APath: string; + APathType: TcxShellObjectPathType; + AShellViewOptions: TcxShellViewOptions; + ATempPIDL: PItemIDList; + begin + APath := AnsiUpperCase(DisplayValue); + ActiveProperties.CheckRoot; + + if APath = '' then + begin + APIDL := GetRootAbsolutePIDL; + Exit; + end; + + if IsDesigning or (FPopupShellTreeView.InnerTreeView.Selected = nil) then + ATempPIDL := GetRootAbsolutePIDL + else + ATempPIDL := GetSelectedNodeAbsolutePIDL; + try + APathType := CheckShellObjectPath(APath, + AnsiUpperCase(GetPidlName(ATempPIDL)), True); + finally + DisposePidl(ATempPIDL); + end; + + APIDL := nil; + AShellViewOptions := ActiveProperties.GetShellViewOptions; + repeat + case APathType of + sptAbsolutePhysical, sptUNC, sptVirtual: + APIDL := InternalParseDisplayName(GetDesktopIShellFolder, APath, + AShellViewOptions); + sptInternalAbsoluteVirtual, sptInternalRelativeVirtual: + APIDL := ShellObjectInternalVirtualPathToPIDL(APath, ActiveProperties.Root, + AShellViewOptions); + sptRelativePhysical: + begin + if IsDesigning or (FPopupShellTreeView.InnerTreeView.Selected = nil) then + begin + AParentFolderPIDL := GetRootAbsolutePIDL; + AParentIFolder := ActiveProperties.Root.ShellFolder; + end + else + begin + AParentFolderPIDL := GetSelectedNodeAbsolutePIDL; + if APath = AnsiUpperCase(FPopupShellTreeView.InnerTreeView.Selected.Text) then + begin + APIDL := AParentFolderPIDL; + Break; + end; + GetDesktopIShellFolder.BindToObject(AParentFolderPIDL, nil, + IID_IShellFolder, Pointer(AParentIFolder)); + end; + if AParentIFolder <> nil then + begin + APIDL := InternalParseDisplayName(AParentIFolder, APath, + AShellViewOptions); + if APIDL <> nil then + begin + ATempPIDL := APIDL; + APIDL := ConcatenatePidls(AParentFolderPIDL, APIDL); + DisposePidl(ATempPIDL); + end; + DisposePidl(AParentFolderPIDL); + if APIDL <> nil then + Break; + end; + + if not IsDesigning then + begin + ANode := FindNodeAmongExpandedNodes(APath); + if ANode <> nil then + begin + APIDL := FPopupShellTreeView.GetNodeAbsolutePIDL(ANode); + Break; + end; + end; + + for ACSIDL := CSIDL_DESKTOP to CSIDL_HISTORY do + with cxShellSpecialFolderInfoTable[ACSIDL] do + if (PIDL <> nil) and (PIDLUpperCaseDisplayName = APath) and + CheckViewOptions(AShellViewOptions, Attributes) then + begin + APIDL := GetPidlCopy(PIDL); + Break; + end; + end; + end; + until True; + + if (APIDL <> nil) and not IsSubPath(ActiveProperties.Root.Pidl, APIDL) then + begin + DisposePidl(APIDL); + APIDL := nil; + end; + end; + +begin + if DataBinding is TcxDBTextEditDataBinding then // TODO Remove cxDBEdit, IsDataSourceLive + with TcxDBTextEditDataBindingAccess(DataBinding) do + if not IsDataAvailable then + begin + ViewInfo.ShellSysIconIndex := -1; + Exit; + end; + InternalEditValueToPIDL; + InternalSynchronizeEditValue(APIDL, DisplayValue); + DisposePidl(APIDL); +end; + +function TcxCustomShellComboBox.CheckAbsolutePIDL(var APIDL: PItemIDList; + ACheckObjectExistence: Boolean): Boolean; +begin + ActiveProperties.CheckRoot; + if APIDL = nil then + begin + Result := True; + APIDL := ActiveProperties.Root.Pidl; + end + else + begin + Result := IsSubPath(ActiveProperties.Root.Pidl, APIDL); + if Result and ACheckObjectExistence then + Result := CheckShellObjectExistence(APIDL); + end; +end; + +procedure TcxCustomShellComboBox.CheckPopupShellTreeView; +var + ARootNode: TTreeNode; +begin + if (FPopupShellTreeView = nil) or (FPopupShellTreeView.InnerTreeView = nil) or + (FPopupShellTreeView.InnerTreeView.Items.Count = 0) then + Exit; + + ARootNode := FPopupShellTreeView.InnerTreeView.Items[0]; + if not ARootNode.Expanded then + ARootNode.Expanded := True; +end; + +function TcxCustomShellComboBox.FindNodeAmongExpandedNodes(ANodeText: string): TTreeNode; + + function InternalFindPIDLAmongExpandedNodes(ANode: TTreeNode): TTreeNode; + var + AChildNode: TTreeNode; + begin + Result := nil; + if ANode = nil then + Exit; + if ANodeText = AnsiUpperCase(ANode.Text) then + begin + Result := ANode; + Exit; + end; + if not ANode.Expanded then + Exit; + AChildNode := ANode.GetFirstChild; + while AChildNode <> nil do + begin + Result := InternalFindPIDLAmongExpandedNodes(AChildNode); + if Result <> nil then + Break; + AChildNode := ANode.GetNextChild(AChildNode); + end; + end; + +begin + ANodeText := AnsiUpperCase(ANodeText); + with FPopupShellTreeView.InnerTreeView do + if (Selected <> nil) and (ANodeText = AnsiUpperCase(Selected.Text)) then + Result := Selected + else + Result := InternalFindPIDLAmongExpandedNodes(Items.GetFirstNode); +end; + +function TcxCustomShellComboBox.GetPopupShellTreeViewClass: TcxPopupShellTreeViewClass; +begin + Result := TcxPopupShellTreeView; +end; + +procedure TcxCustomShellComboBox.InternalSetAbsolutePIDL(Value: PItemIDList); +begin + if not EqualPIDLs(FAbsolutePIDL, Value) then + begin + if FAbsolutePIDL <> nil then + FreeAndNilPIDL(FAbsolutePIDL); + if Value <> nil then + begin + FAbsolutePIDL := GetPidlCopy(Value); + SynchronizeDependentShellControls; + end; + end; +end; + +procedure TcxCustomShellComboBox.InternalSynchronizeEditValue(APIDL: PItemIDList; + const ADisplayText: string = ''); +var + APIDLName: string; + + function UseInternalVirtualPathFormat: Boolean; + var + AShellSysIconIndex1, AShellSysIconOverlayIndex1: Integer; + AShellSysIconIndex2, AShellSysIconOverlayIndex2: Integer; + ATempPIDL: PItemIDList; + begin + APIDLName := GetPidlName(APIDL); + Result := APIDLName = ''; + if not Result then + begin + ATempPIDL := InternalParseDisplayName(GetDesktopIShellFolder, APIDLName, + ActiveProperties.GetShellViewOptions); + try + GetShellSysIconIndex(APIDL, AShellSysIconIndex1, AShellSysIconOverlayIndex1); + GetShellSysIconIndex(ATempPIDL, AShellSysIconIndex2, AShellSysIconOverlayIndex2); + Result := (AShellSysIconIndex1 <> AShellSysIconIndex2) or + (AShellSysIconOverlayIndex1 <> AShellSysIconOverlayIndex2); + finally + DisposePidl(ATempPIDL); + end; + end; + end; + +var + AIsEditValueChanged: Boolean; + ANewEditValue: string; + AParentIFolder: IShellFolder; + AStrRet: TStrRet; + ATempPIDL, ATempPIDL1: PItemIDList; + I: Integer; + S1, S2: string; +begin + InternalSetAbsolutePIDL(APIDL); + + if APIDL = nil then + begin + ViewInfo.ShellSysIconIndex := -1; + S1 := ADisplayText; + ANewEditValue := DisplayValue; + end + else + begin + if ActiveProperties.StoreRelativePath and EqualPIDLs(ActiveProperties.Root.Pidl, APIDL) then + begin + ANewEditValue := ''; + S1 := GetPIDLDisplayName(APIDL, (ActiveProperties.ShowFullPath = sfpAlways) or + (ActiveProperties.ShowFullPath = sfpNotFocused) and not IsFocused); + end + else + if UseInternalVirtualPathFormat then + begin + ATempPIDL := APIDL; + try + if ActiveProperties.StoreRelativePath then + begin + Integer(APIDL) := Integer(APIDL) + GetPidlSize(ActiveProperties.Root.Pidl); + S2 := cxShellObjectInternalRelativeVirtualPathPrefix; + AParentIFolder := ActiveProperties.Root.ShellFolder; + end + else + begin + S2 := cxShellObjectInternalAbsoluteVirtualPathPrefix; + AParentIFolder := GetDesktopIShellFolder; + end; + for I := 1 to GetPidlItemsCount(APIDL) do + begin + ATempPIDL1 := cxMalloc.Alloc(APIDL^.mkid.cb + SizeOf(SHITEMID)); + FillChar(ATempPIDL1^, APIDL^.mkid.cb + SizeOf(SHITEMID), 0); + CopyMemory(ATempPIDL1, APIDL, APIDL^.mkid.cb); + Integer(APIDL) := Integer(APIDL) + APIDL^.mkid.cb; + AParentIFolder.GetDisplayNameOf(ATempPIDL1, SHGDN_INFOLDER, AStrRet); + S1 := GetTextFromStrRet(AStrRet, ATempPIDL1); + S2 := S2 + '\' + S1; + AParentIFolder.BindToObject(ATempPIDL1, nil, IID_IShellFolder, + Pointer(AParentIFolder)); + DisposePidl(ATempPIDL1); + end; + ANewEditValue := S2; + finally + APIDL := ATempPIDL; + end; + end + else + begin + if ActiveProperties.StoreRelativePath then + begin + S1 := GetPidlName(ActiveProperties.Root.Pidl); + S2 := GetPidlName(APIDL); + if Pos(S1, S2) = 1 then + begin + if S1[Length(S1)] = '\' then + S1 := Copy(S2, Length(S1) + 1, Length(S2) - Length(S1)) + else + S1 := Copy(S2, Length(S1) + 2, Length(S2) - Length(S1) - 1); + if (Length(S1) >= 1) and (S1[1] = '\') then + S1 := Copy(S1, 2, Length(S1) - 1); + ANewEditValue := S1; + end + else + ANewEditValue := GetPidlName(APIDL); + end + else + ANewEditValue := APidlName; + S1 := GetPIDLDisplayName(APIDL, (ActiveProperties.ShowFullPath = sfpAlways) or + (ActiveProperties.ShowFullPath = sfpNotFocused) and not IsFocused); + end; + GetShellSysIconIndex(APIDL, ViewInfo.ShellSysIconIndex, + ViewInfo.ShellSysIconOverlayIndex); + end; + + AIsEditValueChanged := (VarType(FEditValue) <> VarType(ANewEditValue)) or + not VarEqualsExact(FEditValue, ANewEditValue); + FEditValue := ANewEditValue; + + DataBinding.DisplayValue := S1; +// SelStart := Length(S1); + InvalidateShellIconRect; + + if AIsEditValueChanged then + DoEditValueChanged; +end; + +procedure TcxCustomShellComboBox.InvalidateShellIconRect; +begin + with ViewInfo.ShellIconPosition do + InvalidateRect(Rect(X, Y, X + cxShellComboBoxImageList.Width, Y + + cxShellComboBoxImageList.Height), False); +end; + +procedure TcxCustomShellComboBox.SelectedNodeChangeHandler(Sender: TObject; + ANode: TTreeNode); +var + ANodeIndex: Integer; +begin + if (not HasPopupWindow) and not FNotificationFromDependentShellControls then + Exit; + + ANodeIndex := -1; + TraverseAllVisibleNodes(ANodeIndex, ANode); + TcxShellComboBoxLookupData(FLookupData).InternalSetCurrentKey(ANodeIndex); + + if FIsSelectedNodeChangeEventLocked or (not FPopupWindowShowing and + not DataBinding.Modified and not DoEditing) then + Exit; + + DataBinding.DisplayValue := + GetPIDLDisplayName(FPopupShellTreeView.GetNodeAbsolutePIDL(ANode), + ActiveProperties.ShowFullPath = sfpAlways); + if FPopupWindowShowing then + ModifiedAfterEnter := False + else + if IsFocused then + ModifiedAfterEnter := True; + SelStart := Length(DataBinding.DisplayValue); + ViewInfo.ShellSysIconIndex := ANode.ImageIndex; + ViewInfo.ShellSysIconOverlayIndex := ANode.OverlayIndex; + InvalidateShellIconRect; + + if ActiveProperties.ImmediatePost and CanPostEditValue and ValidateEdit(True) then + InternalPostEditValue; +end; + +procedure TcxCustomShellComboBox.SynchronizeDependentShellControls; +var + ATempPIDL: PItemIDList; +begin + if FIsDependentShellControlsNotification or FNotificationFromDependentShellControls then + Exit; + FIsDependentShellControlsNotification := True; + try + if FAbsolutePIDL = nil then + Exit; + ATempPIDL := GetPidlCopy(FAbsolutePIDL); + try + if (FShellTreeView <> nil) and FShellTreeView.HandleAllocated then + SendMessage(FShellTreeView.InnerTreeView.Handle, DSM_DONAVIGATE, + Integer(ATempPIDL), 0); + + if FShellListView <> nil then + FShellListView.ProcessTreeViewNavigate(ATempPIDL); + + SynchronizePopupShellTreeView; + finally + DisposePidl(ATempPIDL); + end; + finally + FIsDependentShellControlsNotification := False; + end; +end; + +procedure TcxCustomShellComboBox.SynchronizePopupShellTreeView; +begin + if FAbsolutePIDL = nil then + Exit; + + if not IsDesigning and (FPopupShellTreeView <> nil) and (HasPopupWindow(* or not IsInplace*)) then + with FPopupShellTreeView do + if (Parent <> nil) and Parent.HandleAllocated and (InnerTreeView <> nil) then + begin + InnerTreeView.HandleNeeded; + SendMessage(InnerTreeView.Handle, DSM_DONAVIGATE, WPARAM(FAbsolutePIDL), 0); + end; +end; + +function TcxCustomShellComboBox.TraverseAllVisibleNodes(var ANodeIndex: Integer; + ATreeNode: TTreeNode = nil): TTreeNode; +var + ANodeCount: Integer; + + function InternalTraverseAllVisibleNodes(ANode: TTreeNode): TTreeNode; + var + AChildNode: TTreeNode; + begin + Result := nil; + if ANode = nil then + Exit; + if (ANodeCount = ANodeIndex) or (ANode = ATreeNode) then + begin + Result := ANode; + Exit; + end; + Inc(ANodeCount); + if not ANode.Expanded then + Exit; + AChildNode := ANode.GetFirstChild; + while AChildNode <> nil do + begin + Result := InternalTraverseAllVisibleNodes(AChildNode); + if Result <> nil then + Break; + AChildNode := ANode.GetNextChild(AChildNode); + end; + end; + +begin + CheckPopupShellTreeView; + ANodeCount := 0; + if FPopupShellTreeView = nil then + Result := nil + else + with FPopupShellTreeView.InnerTreeView do + Result := InternalTraverseAllVisibleNodes(Items.GetFirstNode); + ANodeIndex := ANodeCount; +end; + +procedure TcxCustomShellComboBox.AddFolderHandler(Sender: TObject; + AFolder: TcxShellFolder; var ACanAdd: Boolean); + + procedure DoAddFolder(AProperties: TcxCustomShellComboBoxProperties); + begin + with AProperties do + if Assigned(OnAddFolder) then + OnAddFolder(Self, AFolder, ACanAdd); + end; + +begin + DoAddFolder(Properties); + if ACanAdd and (RepositoryItem <> nil) then + DoAddFolder(ActiveProperties); +end; + +function TcxCustomShellComboBox.GetAbsolutePIDL: PItemIDList; +begin + Result := GetPidlCopy(FAbsolutePIDL); +end; + +function TcxCustomShellComboBox.GetActiveProperties: TcxCustomShellComboBoxProperties; +begin + Result := TcxCustomShellComboBoxProperties(InternalGetActiveProperties); +end; + +function TcxCustomShellComboBox.GetPath: string; +begin + if FAbsolutePIDL = nil then + Result := '' + else + Result := GetPidlName(FAbsolutePIDL); +end; + +function TcxCustomShellComboBox.GetProperties: TcxCustomShellComboBoxProperties; +begin + Result := TcxCustomShellComboBoxProperties(FProperties); +end; + +(*function TcxCustomShellComboBox.GetRelativePath: string; +begin +end;*) + +function TcxCustomShellComboBox.GetViewInfo: TcxShellComboBoxViewInfo; +begin + Result := TcxShellComboBoxViewInfo(FViewInfo); +end; + +procedure TcxCustomShellComboBox.RootChangeHandler(Sender: TObject); +begin + if not IsDesigning then + FPopupShellTreeView.Root.Assign(ActiveProperties.Root); + if not ActiveProperties.ChangedLocked and not ModifiedAfterEnter then + SynchronizeDisplayValue; +end; + +procedure TcxCustomShellComboBox.RootSettingsChanged(Sender: TObject); +begin + if IsLoading then + Exit; + if (ShellListView <> nil) and ShellListView.HandleAllocated then + SendMessage(ShellListView.InnerListView.Handle, DSM_SYNCHRONIZEROOT, + Integer(ActiveProperties.Root), 0); + if (ShellTreeView <> nil) and ShellTreeView.HandleAllocated then + SendMessage(ShellTreeView.InnerTreeView.Handle, DSM_SYNCHRONIZEROOT, + Integer(ActiveProperties.Root), 0); +end; + +procedure TcxCustomShellComboBox.SetAbsolutePIDL(Value: PItemIDList); +begin + if not CheckAbsolutePIDL(Value, True) then + Exit; + InternalSynchronizeEditValue(Value); +end; + +procedure TcxCustomShellComboBox.SetPath(const Value: string); +begin + InternalEditValue := Value; +end; + +procedure TcxCustomShellComboBox.SetProperties(Value: TcxCustomShellComboBoxProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomShellComboBox.SetRelativePIDL(Value: PItemIDList); +var + ATempPIDL: PItemIDList; +begin + ActiveProperties.CheckRoot; + if Value = nil then + InternalSynchronizeEditValue(ActiveProperties.Root.Pidl) + else + begin + ATempPIDL := ConcatenatePidls(ActiveProperties.Root.Pidl, Value); + try + if CheckShellObjectExistence(ATempPIDL) then + InternalSynchronizeEditValue(ATempPIDL); + finally + DisposePidl(ATempPIDL); + end; + end; +end; + +(*procedure TcxCustomShellComboBox.SetRelativePath(const Value: string); +begin +end;*) + +procedure TcxCustomShellComboBox.SetShellListView(Value: TcxCustomShellListView); +begin + if Value = FShellListView then + Exit; + if FShellListView <> nil then + begin + if (FShellListView.InnerListView <> nil) and not(csDestroying in FShellListView.InnerListView.ComponentState) then + TcxInnerShellListViewAccess(FShellListView.InnerListView).ComboBoxControl := nil; +{$IFDEF DELPHI5} + FShellListView.RemoveFreeNotification(Self); +{$ENDIF} + end; + FShellListView := Value; + if FShellListView <> nil then + begin + FShellListView.FreeNotification(Self); + TcxInnerShellListViewAccess(FShellListView.InnerListView).ComboBoxControl := Self; + end; +end; + +procedure TcxCustomShellComboBox.SetShellTreeView(Value: TcxCustomShellTreeView); +begin + if Value = FShellTreeView then + Exit; + if FShellTreeView <> nil then + begin + if (FShellTreeView.InnerTreeView <> nil) and not(csDestroying in FShellTreeView.InnerTreeView.ComponentState) then + TcxInnerShellTreeViewAccess(FShellTreeView.InnerTreeView).ComboBoxControl := nil; +{$IFDEF DELPHI5} + FShellTreeView.RemoveFreeNotification(Self); +{$ENDIF} + end; + FShellTreeView := Value; + if FShellTreeView <> nil then + begin + FShellTreeView.FreeNotification(Self); + TcxInnerShellTreeViewAccess(FShellTreeView.InnerTreeView).ComboBoxControl := Self; + end; +end; + +procedure TcxCustomShellComboBox.DSMDoNavigate(var Message: TMessage); +var + APIDL: PItemIDList; +begin + if FIsDependentShellControlsNotification or FNotificationFromDependentShellControls then + Exit; + FNotificationFromDependentShellControls := True; + try + if FShellTreeView <> nil then + APIDL := FShellTreeView.AbsolutePIDL + else if FShellListView <> nil then + APIDL := FShellListView.AbsolutePIDL + else + APIDL := PItemIDList(Message.WParam); + if not CheckAbsolutePIDL(APIDL, False) then + Exit; + if not IsDesigning and (FPopupShellTreeView <> nil) then + with FPopupShellTreeView do + if (Parent <> nil) and Parent.HandleAllocated and (InnerTreeView <> nil) then + begin + InnerTreeView.HandleNeeded; + SendMessage(InnerTreeView.Handle, DSM_DONAVIGATE, WPARAM(APIDL), 0); + SynchronizeEditValue; + Exit; + end; + + InternalSynchronizeEditValue(APIDL); + finally + FNotificationFromDependentShellControls := False; + end; +end; + +procedure TcxCustomShellComboBox.DSMSynchronizeRoot(var Message: TMessage); +begin + if not IsLoading then + ActiveProperties.Root.Update(TcxCustomShellRoot(Message.WParam)); +end; + +{ TcxShellComboBox } + +class function TcxShellComboBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxShellComboBoxProperties; +end; + +function TcxShellComboBox.GetActiveProperties: TcxShellComboBoxProperties; +begin + Result := TcxShellComboBoxProperties(InternalGetActiveProperties); +end; + +function TcxShellComboBox.GetProperties: TcxShellComboBoxProperties; +begin + Result := TcxShellComboBoxProperties(FProperties); +end; + +procedure TcxShellComboBox.SetProperties(Value: TcxShellComboBoxProperties); +begin + FProperties.Assign(Value); +end; + +initialization + GetRegisteredEditProperties.Register(TcxShellComboBoxProperties, scxSEditRepositoryShellComboBoxItem); + FilterEditsController.Register(TcxShellComboBoxProperties, TcxFilterShellComboBoxHelper); + PrepareShellComboBoxImageList; + +finalization + FreeAndNil(cxShellComboBoxImageList); + FilterEditsController.Unregister(TcxShellComboBoxProperties, TcxFilterShellComboBoxHelper); + GetRegisteredEditProperties.Unregister(TcxShellComboBoxProperties); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxShellCommon.pas b/official/x.35/ExpressEditors Library 5/Sources/cxShellCommon.pas new file mode 100644 index 00000000..8f06a8c6 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxShellCommon.pas @@ -0,0 +1,2867 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxShellCommon; + +{$I cxVer.inc} + +interface + +uses +{$IFNDEF DELPHI6} + Mask, +{$ELSE} + MaskUtils, +{$ENDIF} + Windows, ActiveX, Classes, ComObj, Controls, Dialogs, Forms, Math, Messages, + ShellApi, ShlObj, SyncObjs, SysUtils; + +resourcestring + SShellDefaultNameStr = 'Name'; + SShellDefaultSizeStr = 'Size'; + SShellDefaultTypeStr = 'Type'; + SShellDefaultModifiedStr = 'Modified'; + +const + cxShellObjectInternalAbsoluteVirtualPathPrefix = '::{9C211B58-E6F1-456A-9F22-7B3B418A7BB1}'; + cxShellObjectInternalRelativeVirtualPathPrefix = '::{63BE9ADB-E4B5-4623-96AA-57440B4EF5A8}'; + cxShellObjectInternalVirtualPathPrefixLength = 40; + + cxSFGAO_GHOSTED = $00008000; // Error in ShlObj.pas + + {$IFNDEF DELPHI6} + SID_IShellFolder2 = '{93F2F68C-1D1B-11D3-A30E-00C04F79ABD1}'; + SID_IEnumExtraSearch = '{0E700BE1-9DB6-11D1-A1CE-00C04FD75D13}'; + SID_IShellDetails = '{000214EC-0000-0000-C000-000000000046}'; + + {IShellFolder2.GetDefaultColumnState Values} + SHCOLSTATE_TYPE_STR = $00000001; + SHCOLSTATE_TYPE_INT = $00000002; + SHCOLSTATE_TYPE_DATE = $00000003; + SHCOLSTATE_TYPEMASK = $0000000F; + SHCOLSTATE_ONBYDEFAULT = $00000010; // should on by default in details view + SHCOLSTATE_SLOW = $00000020; // will be slow to compute; do on a background thread + SHCOLSTATE_EXTENDED = $00000040; // provided by a handler; not the folder + SHCOLSTATE_SECONDARYUI = $00000080; // not displayed in context menu; but listed in the "More..." dialog + SHCOLSTATE_HIDDEN = $00000100; // not displayed in the UI + + {$EXTERNALSYM IID_IShellDetails} + IID_IShellDetails: TGUID = ( + D1:$000214EC; D2:$0000; D3:$0000; D4:($C0,$00,$00,$00,$00,$00,$00,$46)); + {$ENDIF} + +// Interface declarations, that missed in D4 and D5 versions + +{$IFDEF BCB} +(*$HPPEMIT '#include '*) + {$IFNDEF DELPHI6} +(*$HPPEMIT '#if !defined(NO_WIN32_LEAN_AND_MEAN)'*) +(*$HPPEMIT 'typedef struct _STRRET'*) +(*$HPPEMIT '{'*) +(*$HPPEMIT ' UINT uType;'*) +(*$HPPEMIT ' union'*) +(*$HPPEMIT ' {'*) +(*$HPPEMIT ' LPWSTR pOleStr;'*) +(*$HPPEMIT ' LPSTR pStr;'*) +(*$HPPEMIT ' UINT uOffset;'*) +(*$HPPEMIT ' char cStr[MAX_PATH];'*) +(*$HPPEMIT ' } DUMMYUNIONNAME;'*) +(*$HPPEMIT '} STRRET, *LPSTRRET;'*) +(*$HPPEMIT '#endif'*) + {$ENDIF} +{$ENDIF} + +{$IFNDEF DELPHI6} +type + {$EXTERNALSYM PExtraSearch} + PExtraSearch = ^TExtraSearch; + {$EXTERNALSYM tagExtraSearch} + tagExtraSearch = record + guidSearch: TGUID; + wszFriendlyName, + wszMenuText: array[0..79] of WideChar; + wszHelpText: array[0..MAX_PATH] of WideChar; + wszUrl: array[0..2047] of WideChar; + wszIcon, + wszGreyIcon, + wszClrIcon: array[0..MAX_PATH+10] of WideChar; + end; + {$EXTERNALSYM TExtraSearch} + TExtraSearch = tagExtraSearch; + + {$EXTERNALSYM IEnumExtraSearch} + IEnumExtraSearch = interface + [SID_IEnumExtraSearch] + function Next(celt: ULONG; out rgelt: PExtraSearch; + out pceltFetched: ULONG): HResult; stdcall; + function Skip(celt: ULONG): HResult; stdcall; + function Reset: HResult; stdcall; + function Clone(out ppEnum: IEnumExtraSearch): HResult; stdcall; + end; + + {$EXTERNALSYM PShColumnID} + PShColumnID = ^TShColumnID; + {$EXTERNALSYM SHCOLUMNID} + SHCOLUMNID = record + fmtid: TGUID; + pid: DWORD; + end; + {$EXTERNALSYM TShColumnID} + TShColumnID = SHCOLUMNID; + + { IShellDetails is supported on Win9x and NT4; for >= NT5 use IShellFolder2 } + _SHELLDETAILS = record + fmt, + cxChar: Integer; + str: STRRET; + end; + {$EXTERNALSYM SHELLDETAILS} + SHELLDETAILS = _SHELLDETAILS; + TShellDetails = _SHELLDETAILS; + PShellDetails = ^TShellDetails; + + IShellDetails = interface + [SID_IShellDetails] + function GetDetailsOf(pidl: PItemIDList; iColumn: UINT; + var pDetails: TShellDetails): HResult; stdcall; + function ColumnClick(iColumn: UINT): HResult; stdcall; + end; + + {$EXTERNALSYM IShellFolder2} + IShellFolder2 = interface(IShellFolder) + [SID_IShellFolder2] + function GetDefaultSearchGUID(out pguid: TGUID): HResult; stdcall; + function EnumSearches(out ppEnum: IEnumExtraSearch): HResult; stdcall; + function GetDefaultColumn(dwRes: DWORD; var pSort: ULONG; + var pDisplay: ULONG): HResult; stdcall; + function GetDefaultColumnState(iColumn: UINT; var pcsFlags: DWORD): HResult; stdcall; + function GetDetailsEx(pidl: PItemIDList; const pscid: SHCOLUMNID; + pv: POleVariant): HResult; stdcall; + function GetDetailsOf(pidl: PItemIDList; iColumn: UINT; + var psd: TShellDetails): HResult; stdcall; + function MapNameToSCID(pwszName: LPCWSTR; var pscid: TShColumnID): HResult; stdcall; + end; +{$ENDIF} + +// cxShell common classes +type + ITEMIDLISTARRAY=array [0..MaxInt div SizeOf(PItemIDList) - 1] of PItemIDList; + PITEMIDLISTARRAY=^ITEMIDLISTARRAY; + + TcxBrowseFolder=(bfCustomPath, bfAltStartup, bfBitBucket, + bfCommonDesktopDirectory, bfCommonDocuments, + bfCommonFavorites, bfCommonPrograms, + bfCommonStartMenu, bfCommonStartup, bfCommonTemplates, bfControls, + bfDesktop, bfDesktopDirectory, bfDrives, bfPrinters, + bfFavorites, bfFonts, bfHistory, bfMyMusic, + bfMyPictures, bfNetHood, bfProfile, bfProgramFiles, bfPrograms, + bfRecent, bfStartMenu, bfStartUp, bfTemplates); + + TcxDropEffect=(deCopy, deMove, deLink); + TcxDropEffectSet=set of TcxDropEffect; + + TcxCustomItemProducer=class; + + IcxDropSource = interface(IDropSource) + ['{FCCB8EC5-ABB4-4256-B34C-25E3805EA046}'] + end; + + TcxDropSource=class(TInterfacedObject, IcxDropSource) + private + FOwner: TWinControl; + protected + function QueryContinueDrag(fEscapePressed: BOOL; + grfKeyState: Longint): HResult; stdcall; + function GiveFeedback(dwEffect: Longint): HResult; stdcall; + public + constructor Create(AOwner:TWinControl);virtual; + property Owner:TWinControl read FOwner; + end; + + { TcxShellOptions } + + TcxShellOptions=class(TPersistent) + private + FContextMenus: Boolean; + FOwner: TWinControl; + FShowFolders: Boolean; + FShowToolTip: Boolean; + FShowNonFolders: Boolean; + FShowHidden: Boolean; + FTrackShellChanges: Boolean; + FOnShowToolTipChanged: TNotifyEvent; + procedure SetShowFolders(Value: Boolean); + procedure SetShowHidden(Value: Boolean); + procedure SetShowNonFolders(Value: Boolean); + procedure SetShowToolTip(Value: Boolean); + procedure NotifyUpdateContents; + protected + property OnShowToolTipChanged: TNotifyEvent read FOnShowToolTipChanged + write FOnShowToolTipChanged; + public + constructor Create(AOwner: TWinControl); virtual; + procedure Assign(Source: TPersistent); override; + function GetEnumFlags:Cardinal; + property Owner:TWinControl read FOwner; + published + property ShowFolders:Boolean read FShowFolders write SetShowFolders default True; + property ShowNonFolders:Boolean read FShowNonFolders write SetShowNonFolders default True; + property ShowHidden:Boolean read FShowHidden write SetShowHidden default False; + property ContextMenus:Boolean read FContextMenus write FContextMenus default True; + property TrackShellChanges:Boolean read FTrackShellChanges write FTrackShellChanges default True; + property ShowToolTip: Boolean read FShowToolTip write SetShowToolTip default True; + end; + + TcxDetailItem=record + Text:String; + Width:Integer; + Alignment:TAlignment; + ID:Integer; + end; + + TcxRequestItem = record + ItemIndex: Integer; + ItemProducer: TcxCustomItemProducer; + Priority: Boolean; + end; + + PcxRequestItem=^TcxRequestItem; + + PcxDetailItem=^TcxDetailItem; + + TcxShellDetails=class + private + FItems: TList; + function GetItems(Index: Integer): PcxDetailItem; + function GetCount: Integer; + protected + property Items:TList read FItems; + public + constructor Create; + destructor Destroy;override; + procedure ProcessDetails(ACharWidth: Integer; AShellFolder: IShellFolder; + AFileSystem: Boolean); + procedure Clear; + function Add:PcxDetailItem; + procedure Remove(Item:PcxDetailItem); + property Item[Index:Integer]:PcxDetailItem read GetItems;default; + property Count:Integer read GetCount; + end; + + { TcxShellFolder } + + TcxShellFolderAttribute = (sfaGhosted, sfaHidden, sfaIsSlow, sfaLink, + sfaReadOnly, sfaShare); + TcxShellFolderAttributes = set of TcxShellFolderAttribute; + + TcxShellFolderCapability = (sfcCanCopy, sfcCanDelete, sfcCanLink, sfcCanMove, + sfcCanRename, sfcDropTarget, sfcHasPropSheet); + TcxShellFolderCapabilities = set of TcxShellFolderCapability; + + TcxShellFolderProperty = (sfpBrowsable, sfpCompressed, sfpEncrypted, + sfpNewContent, sfpNonEnumerated, sfpRemovable); + TcxShellFolderProperties = set of TcxShellFolderProperty; + + TcxShellFolderStorageCapability = (sfscFileSysAncestor, sfscFileSystem, + sfscFolder, sfscLink, sfscReadOnly, sfscStorage, sfscStorageAncestor, + sfscStream); + TcxShellFolderStorageCapabilities = set of TcxShellFolderStorageCapability; + + TcxShellFolder = class + private + FAbsolutePIDL: PItemIDList; + FParentShellFolder: IShellFolder; + FRelativePIDL: PItemIDList; + function GetAttributes: TcxShellFolderAttributes; + function GetCapabilities: TcxShellFolderCapabilities; + function GetDisplayName: string; + function GetIsFolder: Boolean; + function GetPathName: string; + function GetProperties: TcxShellFolderProperties; + function GetShellAttributes(ARequestedAttributes: LongWord): LongWord; + function GetShellFolder: IShellFolder; + function GetStorageCapabilities: TcxShellFolderStorageCapabilities; + function GetSubFolders: Boolean; + function HasShellAttribute(AAttribute: LongWord): Boolean; overload; + function HasShellAttribute(AAttributes, AAttribute: LongWord): Boolean; overload; + function InternalGetDisplayName(AFolder: IShellFolder; APIDL: PItemIDList; + ANameType: DWORD): string; + public + constructor Create(AAbsolutePIDL: PItemIDList); + destructor Destroy; override; + + property Attributes: TcxShellFolderAttributes read GetAttributes; + property Capabilities: TcxShellFolderCapabilities read GetCapabilities; + property IsFolder: Boolean read GetIsFolder; + property Properties: TcxShellFolderProperties read GetProperties; + property StorageCapabilities: TcxShellFolderStorageCapabilities + read GetStorageCapabilities; + property SubFolders: Boolean read GetSubFolders; + + property AbsolutePIDL: PItemIDList read FAbsolutePIDL; + property DisplayName: string read GetDisplayName; + property ParentShellFolder: IShellFolder read FParentShellFolder; + property PathName: string read GetPathName; + property RelativePIDL: PItemIDList read FRelativePIDL; + property ShellFolder: IShellFolder read GetShellFolder; + end; + + TcxCustomShellRoot=class(TPersistent) + private + FAttributes: Cardinal; + FBrowseFolder: TcxBrowseFolder; + FCustomPath: WideString; + FFolder: TcxShellFolder; + FIsRootChecking: Boolean; + FOwner: TPersistent; + FParentWindow: HWND; + FPidl: PItemIDList; + FRootChangingCount: Integer; + FShellFolder: IShellFolder; + FUpdating: Boolean; + FValid: Boolean; + FOnSettingsChanged: TNotifyEvent; + procedure SetBrowseFolder(Value: TcxBrowseFolder); + procedure SetCustomPath(const Value: WideString); + procedure SetPidl(const Value: PItemIDList); + function GetCurrentPath: WideString; + procedure UpdateFolder; + protected + procedure CheckRoot; virtual; + procedure DoSettingsChanged; + procedure RootUpdated; virtual; + property Owner: TPersistent read FOwner; + property ParentWindow: HWND read FParentWindow; + public + constructor Create(AOwner: TPersistent; AParentWindow: HWND); virtual; + destructor Destroy;override; + procedure Assign(Source: TPersistent); override; + procedure Update(ARoot: TcxCustomShellRoot); + property Attributes:Cardinal read FAttributes; + property CurrentPath:WideString read GetCurrentPath; + property Folder: TcxShellFolder read FFolder; + property IsValid:Boolean read FValid; + property Pidl:PItemIDList read FPidl write SetPidl; + property ShellFolder:IShellFolder read FShellFolder; + property OnSettingsChanged: TNotifyEvent read FOnSettingsChanged + write FOnSettingsChanged; + published + property BrowseFolder:TcxBrowseFolder read FBrowseFolder + write SetBrowseFolder default bfDesktop; + property CustomPath:WideString read FCustomPath write SetCustomPath; + end; + + TcxRootChangedEvent=procedure (Sender:TObject; Root:TcxCustomShellRoot) of object; + + TcxShellItemInfo=class + private + FCanRename: Boolean; + FDetails: TStrings; + FFolder: TcxShellFolder; + FFullPIDL: PItemIDList; + FHasSubfolder: Boolean; + FIconIndex: Integer; + FInfoTip: WideString; + FInitialized: Boolean; + FIsDropTarget: Boolean; + FIsFilesystem: Boolean; + FIsFolder: Boolean; + FIsGhosted: Boolean; + FIsLink: Boolean; + FIsRemovable: Boolean; + FIsShare: Boolean; + FItemProducer: TcxCustomItemProducer; + FName: WideString; + FOpenIconIndex: Integer; + Fpidl: PItemIDList; + FUpdated: Boolean; + FUpdating: Boolean; + protected + property Updating:Boolean read FUpdating write FUpdating; + public + constructor Create(AItemProducer: TcxCustomItemProducer; + AParentIFolder: IShellFolder; AParentPIDL, APIDL: PItemIDList; + AFast: Boolean); virtual; + destructor Destroy;override; + procedure CheckUpdate(ShellFolder:IShellFolder;FolderPidl:PItemIDList;Fast:Boolean); + procedure CheckInitialize(AIFolder: IShellFolder; APIDL: PItemIDList); + procedure FetchDetails(wnd:HWND;ShellFolder:IShellFolder;DetailsMap:TcxShellDetails); + procedure CheckSubitems(AParentIFolder: IShellFolder; + AEnumSettings: Cardinal); + procedure SetNewPidl(pFolder:IShellFolder;FolderPidl,apidl:PItemIDList); + property CanRename:Boolean read FCanRename; + property Details:TStrings read FDetails; + property Folder: TcxShellFolder read FFolder; + property FullPIDL: PItemIDList read FFullPIDL; + property HasSubfolder:Boolean read FHasSubfolder; + property IconIndex:Integer read FIconIndex; + property InfoTip:WideString read FInfoTip; + property Initialized:Boolean read FInitialized; + property IsDropTarget:Boolean read FIsDropTarget; + property IsFilesystem:Boolean read FIsFilesystem; + property IsFolder:Boolean read FIsFolder; + property IsGhosted:Boolean read FIsGhosted; + property IsLink:Boolean read FIsLink; + property IsRemovable:Boolean read FIsRemovable; + property IsShare:Boolean read FIsShare; + property ItemProducer: TcxCustomItemProducer read FItemProducer; + property Name:WideString read FName; + property OpenIconIndex:Integer read FOpenIconIndex; + property pidl:PItemIDList read Fpidl; + property Updated:Boolean read FUpdated write FUpdated; + end; + + PcxShellItemInfo = TcxShellItemInfo; + + { TcxShellItemsInfoGatherer } + + TcxShellItemsInfoGatherer = class + private + FFetchQueue: TList; + FFetchStoppedEvent: THandle; + FFetchThread: THandle; + FIsFetchQueueClearing: Boolean; + FOwner: TWinControl; + FStopFetchCount: Integer; + FStopFetchEvent: THandle; + FTerminateFetchThreadEvent: THandle; + procedure CreateFetchThread; + function CreateRequestItem(AItemProducer: TcxCustomItemProducer; + AIndex: Integer; APriority: Boolean): PcxRequestItem; + function GetFetchQueueItemIndex(AFetchQueue: TList; + AItemProducer: TcxCustomItemProducer; AIndex: Integer): Integer; + function GetIsFetchStopping: Boolean; + function GetIsFetchThreadTerminating: Boolean; + procedure FetchResumed; + procedure FetchStopped; + procedure InternalCloseHandle(var AHandle: THandle); + procedure TerminateFetchThread; + property FetchQueue: TList read FFetchQueue; + property IsFetchStopping: Boolean read GetIsFetchStopping; + property IsFetchThreadTerminating: Boolean read GetIsFetchThreadTerminating; + protected + procedure DestroyFetchThread; + public + constructor Create(AOwner: TWinControl); + destructor Destroy; override; + procedure ClearFetchQueue(AItemProducer: TcxCustomItemProducer); + procedure RequestItemInfo(AItemProducer: TcxCustomItemProducer; + AIndex: Integer; APriority: Boolean); + procedure ResumeFetch; + procedure StopFetch; + end; + + TcxCustomItemProducer=class + private + FDetails: TcxShellDetails; + FFolderPidl: PItemIDList; + FItems: TList; + FItemsLock: TMultiReadExclusiveWriteSynchronizer; + FOwner: TWinControl; + FShellFolder: IShellFolder; + protected + function AllowBackgroundProcessing: Boolean; virtual; abstract; + function CanAddFolder(AFolder: TcxShellFolder): Boolean; virtual; + function DoCompareItems(AItem1, AItem2: TcxShellFolder; + out ACompare: Integer): Boolean; virtual; + procedure FetchItems(cPreloadItems:Integer); + function GetEnumFlags:Cardinal;virtual;abstract; + function GetItemsInfoGatherer: TcxShellItemsInfoGatherer; virtual; abstract; + function GetShowToolTip:Boolean;virtual;abstract; + procedure InitializeItem(Item:TcxShellItemInfo);virtual; + procedure CheckForSubitems(AItem: TcxShellItemInfo); virtual; + procedure ClearFetchQueue; + property ItemsLock:TMultiReadExclusiveWriteSynchronizer read FItemsLock; + property ShellFolder:IShellFolder read FShellFolder; + property FolderPidl:PItemIDList read FFolderPidl write FFolderPidl; + property Owner:TWinControl read FOwner; + public + constructor Create(AOwner:TWinControl);virtual; + destructor Destroy;override; + procedure ProcessItems(AIFolder: IShellFolder; AFolderPIDL: PItemIDList; + cPreloadItems: Integer); virtual; + procedure ProcessDetails(ShellFolder:IShellFolder;CharWidth:Integer);virtual; + procedure FetchRequest(AIndex: Integer; APriority: Boolean = False); + procedure ClearItems; + procedure LockRead; + procedure LockWrite; + procedure UnlockRead; + procedure UnlockWrite; + procedure RequestItemsInfo; + procedure SetItemsCount(Count:Integer);virtual; + procedure NotifyUpdateItem(AItem: PcxRequestItem); virtual; abstract; + procedure NotifyRemoveItem(Index:Integer);virtual; + procedure NotifyAddItem(Index:Integer);virtual; + procedure DoGetInfoTip(Handle:HWND;ItemIndex: Integer; InfoTip: PChar; cch:Integer); + function GetItemByPidl(apidl:PItemIDList):TcxShellItemInfo; + function GetItemIndexByPidl(apidl:PItemIDList):Integer; + property Details:TcxShellDetails read FDetails; + property Items:TList read FItems; + property ItemsInfoGatherer: TcxShellItemsInfoGatherer read GetItemsInfoGatherer; + end; + + TcxDragDropSettings = class(TPersistent) + private + FAllowDragObjects: Boolean; + FDefaultDropEffect: TcxDropEffect; + FDropEffect: TcxDropEffectSet; + FScroll: Boolean; + FOnChange: TNotifyEvent; + function GetDefaultDropEffectAPI: Integer; + function GetDropEffectAPI: DWORD; + procedure SetAllowDragObjects(Value: Boolean); + protected + procedure Changed; + public + property DropEffectAPI: DWORD read GetDropEffectApi; + property DefaultDropEffectAPI: Integer read GetDefaultDropEffectAPI; + constructor Create; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + published + property AllowDragObjects: Boolean read FAllowDragObjects + write SetAllowDragObjects default True; + property DefaultDropEffect: TcxDropEffect read FDefaultDropEffect + write FDefaultDropEffect default deMove; + property DropEffect: TcxDropEffectSet read FDropEffect write FDropEffect + default [deCopy, deMove, deLink]; + property Scroll: Boolean read FScroll write FScroll stored False; // deprecated + end; + + TShChangeNotifyEntry = packed record + pidlPath: PItemIDList; + bWatchSubtree: BOOL; + end; + + DWORDITEMID=record + cb: SHORT; + dwItem1: DWORD; + dwItem2: DWORD; + end; + + PDWORDITEMID=^DWORDITEMID; + + PShChangeNotifyEntry = ^TShChangeNotifyEntry; + +function GetDesktopIShellFolder: IShellFolder; +function GetTextFromStrRet(var AStrRet: TStrRet; APIDL: PitemIDList): WideString; +function GetShellDetails(pFolder:IShellFolder;pidl:PItemIDList;out sd:IShellDetails):Hresult; +function HasSubItems(AParentIFolder: IShellFolder; AFullPIDL: PItemIDList; + AEnumSettings: Cardinal): Boolean; +function cxFileTimeToDateTime(fTime:FILETIME):TDateTime; +function cxMalloc: IMalloc; +procedure DisplayContextMenu(AWnd: HWND; AIFolder: IShellFolder; + AItemPIDLList: TList; const APos: TPoint); + +{ Pidl Tools} + +function GetPidlItemsCount(pidl:PItemIDList):Integer; +function GetPidlSize(pidl:PItemIDList):Integer; +function GetNextItemID(pidl:PItemIDList):PItemIDList; +function GetPidlCopy(pidl:PItemIDList):PItemIDList; +function GetLastPidlItem(pidl:PItemIDList):PItemIDList; +function GetPidlName(APIDL: PItemIDList): WideString; +function ConcatenatePidls(pidl1,pidl2:PItemIDList):PItemIDList; +procedure DisposePidl(pidl:PItemIDList); +function GetPidlParent(pidl:PItemIDList):PItemIDList; +function CreateEmptyPidl:PItemIDList; +function CreatePidlListFromList(List:TList):PItemIDList; +function ExtractParticularPidl(pidl:PItemIDList):PItemIDList; +function EqualPIDLs(APIDL1, APIDL2: PItemIDList): Boolean; +function IsSubPath(APIDL1, APIDL2: PItemIDList): Boolean; + +{ Unicode Tools } + +procedure StrPLCopyW(Dest:PWideChar;Source:WideString;MaxLen:Cardinal); +function StrPasW(Source:PWideChar):WideString; +function StrLenW(Source:PWideChar):Cardinal; +function UpperCaseW(Source:WideString):WideString; +function LowerCaseW(Source:WideString):WideString; + +procedure CheckShellRoot(ARoot: TcxCustomShellRoot); +function GetShellItemDisplayName(AIFolder: IShellFolder; + APIDL: PItemIDList; ACheckIsFolder: Boolean): WideString; + +const + DSM_SETCOUNT=CM_BASE+315; + DSM_NOTIFYUPDATE=CM_BASE+316; + DSM_NOTIFYREMOVEITEM=CM_BASE+318; + DSM_NOTIFYADDITEM=CM_BASE+319; + DSM_NOTIFYUPDATECONTENTS=CM_BASE+320; + DSM_SHELLCHANGENOTIFY=CM_BASE+321; + DSM_DONAVIGATE=CM_BASE+322; + DSM_SYNCHRONIZEROOT=CM_BASE+323; + DSM_SHELLTREECHANGENOTIFY=CM_BASE+324; + DSM_SHELLTREERESTORECURRENTPATH=CM_BASE+325; + + PRELOAD_ITEMS_COUNT=10; + + SHCNF_ACCEPT_INTERRUPTS = $1; + SHCNF_ACCEPT_NON_INTERRUPTS = $2; + SHCNF_NO_PROXY = $8000; + +var + SHChangeNotifyRegister:function (hwnd:HWND;dwFlags:DWORD;wEventMask:DWORD; + uMsg:UINT;cItems:DWORD;lpItems:PShChangeNotifyEntry):Cardinal;stdcall; + SHChangeNotifyUnregister:function (hNotify:Cardinal):Boolean;stdcall; + +implementation + +uses + cxContainer, cxControls, cxEdit, dxUxTheme; + +const + ShellLibraryName = 'shell32.dll'; +{$IFNDEF DELPHI6} + PathDelim = '\'; + cxIID_IShellFolder2: TGUID = ( + D1:$93F2F68C; D2:$1D1B; D3:$11D3; D4:($A3,$0E,$00,$C0,$4F,$79,$AB,$D1)); +{$ENDIF} + SFGAO_ENCRYPTED = $00002000; + SFGAO_ISSLOW = $00004000; + SFGAO_STORAGE = $00000008; + SFGAO_STORAGEANCESTOR = $00800000; + SFGAO_STORAGECAPMASK = $70C50008; + SFGAO_STREAM = $00400000; + +type + TcxContextMenuMessageWindow = class(TcxMessageWindow) + private + FContextMenu: IContextMenu2; + protected + procedure WndProc(var Message: TMessage); override; + public + property ContextMenu: IContextMenu2 read FContextMenu write FContextMenu; + end; + + TSHGetPathFromIDList = function(APIDL: PItemIDList; APath: PChar): BOOL; stdcall; + TSHGetPathFromIDListW = function(APIDL: PItemIDList; APath: PWideChar): BOOL; stdcall; + +{$IFDEF DELPHI6} + cxIShellFolder2 = interface(IShellFolder2) + ['{93F2F68C-1D1B-11D3-A30E-00C04F79ABD1}'] + end; +{$ENDIF} + +var + FSysFileIconIndex: Integer = -1; + FSysFolderIconIndex: Integer = -1; + FSysFolderOpenIconIndex: Integer = -1; + cxSHGetFolderLocation:function (wnd:HWND;nFolder:Integer;hToken:THandle; + dwReserwed:DWORD;var ppidl:PItemIDList):HResult;stdcall; + cxSHGetPathFromIDList: TSHGetPathFromIDList = nil; + cxSHGetPathFromIDListW: TSHGetPathFromIDListW = nil; + ShellLibrary: HMODULE = 0; + FcxMalloc: IMalloc; + FShellItemsInfoGatherers: TList; + +(*function GetShellItemDisplayName(AIFolder: IShellFolder; + APIDL: PItemIDList; ACheckIsFolder: Boolean): WideString; +var + AAttributes, AFlags: Cardinal; + AIsFolder: Boolean; + AStrRet: TStrRet; +begin + Result := ''; + + if ACheckIsFolder then + begin + AAttributes := SFGAO_FOLDER; + if not Succeeded(AIFolder.GetAttributesOf(1, APIDL, AAttributes)) then + Exit; + AIsFolder := AAttributes and SFGAO_FOLDER <> 0; + end + else + AIsFolder := False; + + AFlags := SHGDN_INFOLDER; + if AIsFolder then + AFlags := AFlags or SHGDN_FORPARSING; + + if not Succeeded(AIFolder.GetDisplayNameOf(APIDL, AFlags, AStrRet)) then + Exit; + Result := GetTextFromStrRet(AStrRet, APIDL); + if AIsFolder and (Length(Result) > 2) then + if (Result[1] = ':') and (Result[2] = ':') or + (Result[1] = '\') and (Result[2] = '\') then + begin + AIFolder.GetDisplayNameOf(APIDL, SHGDN_INFOLDER, AStrRet); + Result := GetTextFromStrRet(AStrRet, APIDL); + end; +end;*) + +procedure CheckShellRoot(ARoot: TcxCustomShellRoot); +begin + if ARoot.ShellFolder = nil then + ARoot.CheckRoot; +end; + +function GetShellItemDisplayName(AIFolder: IShellFolder; + APIDL: PItemIDList; ACheckIsFolder: Boolean): WideString; +var + AStrRet: TStrRet; +begin + if Succeeded(AIFolder.GetDisplayNameOf(APIDL, SHGDN_INFOLDER, AStrRet)) then + Result := GetTextFromStrRet(AStrRet, APIDL) + else + Result := ''; +end; + +function HasSubItems(AParentIFolder: IShellFolder; AFullPIDL: PItemIDList; + AEnumSettings: Cardinal): Boolean; + + function HasAttributes(AAttributes: UINT): Boolean; + var + ATempAttributes: UINT; + ATempPIDL: PItemIDList; + begin + ATempAttributes := AAttributes; + ATempPIDL := GetLastPidlItem(AFullPIDL); + AParentIFolder.GetAttributesOf(1, ATempPIDL, ATempAttributes); + Result := ATempAttributes and AAttributes = AAttributes; + end; + + function CheckLocalFolder(out AHasSubItems: Boolean): Boolean; + var + AAttributes, AParsedCharCount: ULONG; + ADesktopIFolder: IShellFolder; + AFileSearchAttributes: Integer; + ATempPIDL: PItemIDList; + ASearchRec: TSearchRec; + S: WideString; + begin + Result := False; + S := GetPidlName(AFullPIDL); + if (S = '')(* or (Pos('\\', S) = 1)*) then + Exit; + SHGetDesktopFolder(ADesktopIFolder); + AAttributes := 0; + ADesktopIFolder.ParseDisplayName(0, nil, PWideChar(S), + AParsedCharCount, ATempPIDL, AAttributes); + if ATempPIDL = nil then + Exit; + try + Result := True; + AHasSubItems := False; + + AFileSearchAttributes := faReadOnly or faSysFile or faArchive; + if AEnumSettings and SHCONTF_FOLDERS <> 0 then + AFileSearchAttributes := AFileSearchAttributes or faDirectory; + if AEnumSettings and SHCONTF_INCLUDEHIDDEN <> 0 then + AFileSearchAttributes := AFileSearchAttributes or faHidden; + + if S[Length(S)] = PathDelim then + Delete(S, Length(S), 1); + if FindFirst(S + PathDelim + '*.*', AFileSearchAttributes, ASearchRec) = 0 then + begin + repeat + if (ASearchRec.Name = '.') or (ASearchRec.Name = '..') then + begin + if FindNext(ASearchRec) <> 0 then + Break; + end + else + begin + AHasSubItems := True; + Break; + end; + until False; + FindClose(ASearchRec); + end; + finally + DisposePidl(ATempPIDL); + end; + end; + +var + ATempIFolder: IShellFolder; + ATempPIDL: PItemIDList; + AIEnum: IEnumIDList; + AFetchedItemCount: Cardinal; +begin + Result := HasAttributes(SFGAO_FOLDER); + if not Result then + Exit; +// if (AEnumSettings and SHCONTF_NONFOLDERS = 0) and AFast then + if AEnumSettings and SHCONTF_NONFOLDERS = 0 then + Result := HasAttributes(SFGAO_HASSUBFOLDER) + else + begin + if CheckLocalFolder(Result) then + Exit; + Result := False; + if Succeeded(AParentIFolder.BindToObject(GetLastPidlItem(AFullPIDL), nil, IID_IShellFolder, + ATempIFolder)) then + if ATempIFolder <> nil then + if Succeeded(ATempIFolder.EnumObjects(0, AEnumSettings, AIEnum)) and Assigned(AIEnum) then + if AIEnum.Next(1, ATempPIDL, AFetchedItemCount) = S_OK then + try + Result := AFetchedItemCount = 1; + finally + DisposePidl(ATempPIDL); + end; + end; +end; + +function GetDesktopIShellFolder: IShellFolder; +begin + OleCheck(SHGetDesktopFolder(Result)); +end; + +function GetTextFromStrRet(var AStrRet: TStrRet; APIDL: PitemIDList): WideString; +var + P: PChar; +begin + case AStrRet.uType of + STRRET_CSTR: + SetString(Result, AStrRet.cStr, lstrlen(AStrRet.cStr)); + STRRET_OFFSET: + begin + P := @APIDL.mkid.abID; + Inc(P, AStrRet.uOffset - SizeOf(APIDL.mkid.cb)); + SetString(Result, P, APIDL.mkid.cb - AStrRet.uOffset); + end; + STRRET_WSTR: + begin + Result := StrPasW(AStrRet.pOleStr); + cxMalloc.Free(AStrRet.pOleStr); + end; + end; +end; + +function GetShellDetails(pFolder:IShellFolder;pidl:PItemIDList;out sd:IShellDetails):Hresult; +begin + try + Result := pFolder.QueryInterface(IID_IShellDetails, sd); + if Result = S_OK then + Exit; + Result:=pFolder.GetUIObjectOf(0,0,pidl,IID_IShellDetails,nil,sd); + if Result = S_OK then + Exit; + Result:=pFolder.CreateViewObject(0,IID_IShellDetails,sd); + if Result = S_OK then + Exit; + Result:=pFolder.GetUIObjectOf(0,Integer(pidl<>nil)(*1*),pidl,IID_IShellDetails,nil,sd); + finally + if sd = nil then + Result := E_NOINTERFACE; + end; +end; + +function cxFileTimeToDateTime(fTime:FILETIME):TDateTime; +var + LocalTime:TFileTime; + Age:Integer; +begin + FileTimeToLocalFileTime(FTime,LocalTime); + if FileTimeToDosDateTime(LocalTime,LongRec(Age).Hi,LongRec(Age).Lo) then + Result:=FileDateToDateTime(Age) + else + Result:=-1; +end; + +function cxMalloc: IMalloc; +begin + if FcxMalloc = nil then + SHGetMalloc(FcxMalloc); + Result := FcxMalloc; +end; + +procedure TcxContextMenuMessageWindow.WndProc(var Message: TMessage); +begin + case Message.Msg of + WM_INITMENUPOPUP: + begin + ContextMenu.HandleMenuMsg(Message.Msg, Message.wParam, Message.lParam); + Message.Result := 0; + end; + WM_DRAWITEM, WM_MEASUREITEM: + begin + ContextMenu.HandleMenuMsg(Message.Msg, Message.wParam, Message.lParam); + Message.Result := 1; + end; + else + inherited WndProc(Message); + end; +end; + +function CreateCallbackWnd(AContextMenu: IContextMenu2): TcxContextMenuMessageWindow; +begin + Result := TcxContextMenuMessageWindow.Create; + Result.ContextMenu := AContextMenu; +end; + +procedure DisplayContextMenu(AWnd: HWND; AIFolder: IShellFolder; + AItemPIDLList: TList; const APos: TPoint); +var + ACallbackWnd: TcxContextMenuMessageWindow; + ACmd: Longbool; + AContextMenu: IContextMenu; + AContextMenu2: IContextMenu2; + AInvokeCommandInfo: TCMInvokeCommandInfo; + AMenu: HMENU; + APIDLList: PItemIDList; +begin + if (AIFolder = nil) or (AItemPIDLList.Count = 0) then + Exit; + APIDLList := CreatePidlListFromList(AItemPIDLList); + try + if Failed(AIFolder.GetUIObjectOf(AWnd, AItemPIDLList.Count, + PItemIDList(APIDLList^), IID_IContextMenu, nil, AContextMenu)) then + Exit; + AMenu := CreatePopupMenu; + ACallbackWnd := nil; + if AMenu <> 0 then + try + if Failed(AContextMenu.QueryContextMenu(AMenu, 0, 1, $7FFF, CMF_NORMAL)) then + Exit; + if Succeeded(AContextMenu.QueryInterface(IID_IContextMenu2, AContextMenu2)) then + ACallbackWnd := CreateCallbackWnd(AContextMenu2); + if ACallbackWnd <> nil then + ACmd := TrackPopupMenu(AMenu, TPM_LEFTALIGN or TPM_LEFTBUTTON or + TPM_RIGHTBUTTON or TPM_RETURNCMD, APos.X, APos.Y, 0, ACallbackWnd.Handle, nil) + else + ACmd := TrackPopupMenu(AMenu, TPM_LEFTALIGN or TPM_LEFTBUTTON or + TPM_RIGHTBUTTON or TPM_RETURNCMD, APos.X, APos.Y, 0, AWnd, nil); + if ACmd then + begin + ZeroMemory(@AInvokeCommandInfo, SizeOf(AInvokeCommandInfo)); + AInvokeCommandInfo.cbSize := SizeOf(AInvokeCommandInfo); + AInvokeCommandInfo.hwnd := AWnd; + AInvokeCommandInfo.lpVerb := MakeIntResource(Longint(ACmd) - 1); + AInvokeCommandInfo.nShow := SW_SHOWNORMAL; + AContextMenu.InvokeCommand(AInvokeCommandInfo); + end; + finally + DestroyMenu(AMenu); + FreeAndNil(ACallbackWnd); + end; + finally + DisposePidl(APIDLList); + end; +end; + +function SysFileIconIndex: Integer; +var + AFileInfo: TSHFileInfo; +begin + if FSysFileIconIndex = -1 then + begin + SHGetFileInfo('C:\CXDUMMYFILE.TXT', FILE_ATTRIBUTE_NORMAL, AFileInfo, + SizeOf(AFileInfo), SHGFI_SYSICONINDEX or SHGFI_USEFILEATTRIBUTES); + FSysFileIconIndex := AFileInfo.iIcon; + end; + Result := FSysFileIconIndex; +end; + +function SysFolderIconIndex: Integer; +var + AFileInfo: TSHFileInfo; +begin + if FSysFolderIconIndex = -1 then + begin + SHGetFileInfo('C:\CXDUMMYFOLDER', FILE_ATTRIBUTE_DIRECTORY, AFileInfo, + SizeOf(AFileInfo), SHGFI_SYSICONINDEX or SHGFI_USEFILEATTRIBUTES); + FSysFolderIconIndex := AFileInfo.iIcon; + end; + Result := FSysFolderIconIndex; +end; + +function SysFolderOpenIconIndex: Integer; +var + AFileInfo: TSHFileInfo; +begin + if FSysFolderOpenIconIndex = -1 then + begin + SHGetFileInfo('C:\CXDUMMYFOLDER', FILE_ATTRIBUTE_DIRECTORY, AFileInfo, + SizeOf(AFileInfo), SHGFI_SYSICONINDEX or SHGFI_USEFILEATTRIBUTES or SHGFI_OPENICON); + FSysFolderOpenIconIndex := AFileInfo.iIcon; + end; + Result := FSysFolderOpenIconIndex; +end; + +{ Unicode Tools } + +function UpperCaseW(Source:WideString):WideString; +begin + Result:=AnsiUpperCase(Source); +end; + +function LowerCaseW(Source:WideString):WideString; +begin + Result:=AnsiLowerCase(Source); +end; + +function StrLenW(Source: PWideChar): Cardinal; +asm + MOV EDX, EDI + MOV EDI, EAX + MOV ECX, 0FFFFFFFFH + XOR AX, AX + REPNE SCASW + MOV EAX, 0FFFFFFFEH + SUB EAX, ECX + MOV EDI, EDX +end; + +function StrPasW(Source:PWideChar):WideString; +var + StringLength:Cardinal; +begin + StringLength:=StrLenW(Source); + SetLength(Result,StringLength); + CopyMemory(Pointer(Result),Source,StringLength*2); +end; + +procedure StrPLCopyW(Dest:PWideChar;Source:WideString;MaxLen:Cardinal); +begin + lstrcpynw(Dest,PWideChar(Source),MaxLen); +end; + +{ PidlTools} + +function GetPidlParent(pidl:PItemIDList):PItemIDList; +var + SourceSize:Integer; + PrevPidl:PItemIDList; + InitialPidl:PItemIDList; + TempPidl:PItemIDList; +begin + Result:=nil; + SourceSize:=0; + InitialPidl:=pidl; + PrevPidl:=nil; + if pidl<>nil then + begin + while pidl.mkid.cb<>0 do + begin + Inc(SourceSize,pidl.mkid.cb); + PrevPidl:=pidl; + pidl:=GetNextItemID(pidl); + end; + if SourceSize>0 then + Dec(SourceSize,PrevPidl.mkid.cb); + Result:=cxMalloc.Alloc(SourceSize+SizeOf(SHITEMID)); + CopyMemory(Result,InitialPidl,SourceSize); + TempPidl:=Pointer(Integer(Result)+SourceSize); + TempPidl.mkid.cb:=0; + TempPidl.mkid.abID[0]:=0; + end; +end; + +function CreateEmptyPidl:PItemIDList; +begin + Result:=cxMalloc.Alloc(SizeOf(ITEMIDLIST)); + Result.mkid.cb:=0; + Result.mkid.abID[0]:=0; +end; + +function CreatePidlListFromList(List:TList):PItemIDList; +var + i:Integer; + tempResult:PITEMIDLISTARRAY; +begin + Result:=nil; + if List=nil then + Exit; + tempResult:=cxMalloc.Alloc(List.Count*SizeOf(ITEMIDLIST)); + for i:=0 to List.Count-1 do + tempResult[i]:=List[i]; + Result:=Pointer(tempResult); +end; + +function ExtractParticularPidl(pidl:PItemIDList):PItemIDList; +var + temp:PItemIDList; +begin + Result:=nil; + if (pidl<>nil) and (pidl.mkid.cb<>0) then + begin + Result:=cxMalloc.Alloc(pidl.mkid.cb+SizeOf(SHITEMID)); + CopyMemory(Result,pidl,pidl.mkid.cb+SizeOf(SHITEMID)); + end; + temp:=GetNextItemID(Result); + temp.mkid.cb:=0; + temp.mkid.abID[0]:=0; +end; + +function EqualPIDLs(APIDL1, APIDL2: PItemIDList): Boolean; +var + L1, L2: Integer; +begin + Result := APIDL1 = APIDL2; + if not Result then + if (APIDL1 = nil) or (APIDL2 = nil) then + Exit + else + begin + L1 := GetPidlSize(APIDL1); + L2 := GetPidlSize(APIDL2); + Result := (L1 = L2) and CompareMem(APIDL1, APIDL2, L1); + end; +end; + +function IsSubPath(APIDL1, APIDL2: PItemIDList): Boolean; // TODO +var + L1, L2: Integer; +begin + L1 := GetPidlSize(APIDL1); + L2 := GetPidlSize(APIDL2); + Result := (L1 = 0) or (L2 >= L1) and CompareMem(APIDL1, APIDL2, L1); +end; + +function ConcatenatePidls(pidl1,pidl2:PItemIDList):PItemIDList; +var + cb1,cb2:Integer; +begin + if (pidl1=nil) and (pidl2=nil) then + Result:=nil + else + if pidl1=nil then + Result:=GetPidlCopy(pidl2) + else + if pidl2=nil then + Result:=GetPidlCopy(pidl1) + else + begin + cb1:=GetPidlSize(pidl1); + cb2:=GetPidlSize(pidl2)+SizeOf(SHITEMID); + Result:=cxMalloc.Alloc(cb1+cb2); + if Result<>nil then + begin + CopyMemory(Result,pidl1,cb1); + CopyMemory(Pointer(Integer(Result)+cb1),pidl2,cb2); + end; + end; +end; + +function GetPidlName(APIDL: PItemIDList): WideString; +var + P: PChar; + PW: PWideChar; +begin + Result := ''; + if APIDL = nil then + Exit; + if not Assigned(cxSHGetPathFromIDListW) then + begin + GetMem(P, MAX_PATH + 1); + try + cxSHGetPathFromIDList(APIDL, P); + Result := StrPas(P); + finally + FreeMem(P); + end; + end + else + begin + GetMem(PW, (MAX_PATH + 1) * 2); + try + cxSHGetPathFromIDListW(APIDL, PW); + Result := StrPasW(PW); + finally + FreeMem(PW); + end; + end; +end; + +function GetLastPidlItem(pidl:PItemIDList):PItemIDList; +var + TempPidl:PItemIDList; +begin + Result:=pidl; + if pidl<>nil then + begin + TempPidl:=pidl; + while TempPidl.mkid.cb<>0 do + begin + Result:=TempPidl; + TempPidl:=GetNextItemID(TempPidl); + end; + end; +end; + +procedure DisposePidl(pidl:PItemIDList); +begin + if pidl<>nil then + cxMalloc.Free(pidl); +end; + +function GetPidlCopy(pidl:PItemIDList):PItemIDList; +var + Size:Integer; +begin + Result:=nil; + if pidl<>nil then + begin + Size:=GetPidlSize(pidl)+SizeOf(SHITEMID); + Result:=cxMalloc.Alloc(Size); + CopyMemory(Result,pidl,Size); + end; +end; + +function GetPidlItemsCount(pidl:PItemIDList):Integer; +begin + Result:=0; + if pidl<>nil then + begin + while pidl.mkid.cb<>0 do + begin + Inc(Result); + pidl:=GetNextItemID(pidl); + if Result>MAX_PATH then + begin + Result:=-1; + Break; + end; + end; + end; +end; + +function GetPidlSize(pidl:PItemIDList):Integer; +begin + Result:=0; + while (pidl<>nil) and (pidl.mkid.cb<>0) do + begin + Inc(Result,pidl.mkid.cb); + pidl:=GetNextItemID(pidl); + end; +end; + +function GetNextItemID(pidl:PItemIDList):PItemIDList; +begin + Result:=nil; + if (pidl<>nil) and (pidl.mkid.cb<>0) then + Result:=PItemIDLIst(Integer(pidl)+pidl.mkid.cb); +end; + +function cxShellItemsInfoGathererFetchThreadFunction( + AItemsInfoGatherer: TcxShellItemsInfoGatherer): Integer; stdcall; + + function CanProcessFetchQueueItems: Boolean; + begin + Result := not AItemsInfoGatherer.IsFetchThreadTerminating and + not AItemsInfoGatherer.IsFetchStopping; + end; + + procedure ProcessFetchQueueItem(AItem: PcxRequestItem); + var + AItemData: TcxShellItemInfo; + AItemProducer: TcxCustomItemProducer; + begin + AItemProducer := AItem^.ItemProducer; + AItemProducer.LockRead; + try + if AItem^.ItemIndex >= AItemProducer.Items.Count then + Exit; + AItemData := AItemProducer.Items[AItem^.ItemIndex]; + AItemData.CheckUpdate(AItemProducer.ShellFolder, + AItemProducer.FolderPidl, False); + AItemProducer.CheckForSubItems(AItemData); + AItemData.Updated := True; + finally + AItem^.ItemProducer.UnlockRead; + end; + AItemProducer.NotifyUpdateItem(AItem); + end; + + procedure ProcessFetchQueueItems; + var + AFetchQueue: TList; + begin + AFetchQueue := AItemsInfoGatherer.FetchQueue; + while AFetchQueue.Count <> 0 do + begin + ProcessFetchQueueItem(PcxRequestItem(AFetchQueue[0])); + Dispose(AFetchQueue[0]); + AFetchQueue.Delete(0); + if not CanProcessFetchQueueItems then + Break; + end; + end; + +const + cxShellItemsInfoGathererSleepPause = 10; +begin + CoInitializeEx(nil, COINIT_APARTMENTTHREADED); + try + repeat + if CanProcessFetchQueueItems then + begin + AItemsInfoGatherer.FetchResumed; + if AItemsInfoGatherer.FetchQueue.Count <> 0 then + ProcessFetchQueueItems; + end; + if AItemsInfoGatherer.IsFetchThreadTerminating then + Break; + if AItemsInfoGatherer.IsFetchStopping then + AItemsInfoGatherer.FetchStopped; + Sleep(cxShellItemsInfoGathererSleepPause); + until False; + Result := 0; + finally + CoUninitialize; + end; +end; + +procedure RegisterShellItemsInfoGatherer(AGatherer: TcxShellItemsInfoGatherer); +begin + if FShellItemsInfoGatherers = nil then + FShellItemsInfoGatherers := TList.Create; + FShellItemsInfoGatherers.Add(AGatherer); +end; + +procedure UnregisterShellItemsInfoGatherer(AGatherer: TcxShellItemsInfoGatherer); +begin + FShellItemsInfoGatherers.Remove(AGatherer); + if FShellItemsInfoGatherers.Count = 0 then + FreeAndNil(FShellItemsInfoGatherers); +end; + +{ TcxCustomShellRoot } + +procedure TcxCustomShellRoot.CheckRoot; +const + ACSIDLs: array[TcxBrowseFolder] of Integer = ( + $00, $07, $0A, $19, $2E, $1F, $17, $16, $18, $2D, + $03, $00, $10, $11, $04, $06, $14, $22, $0D, $27, + $12, $28, $26, $02, $08, $0B, $07, $15 + ); +var + ABrowseFolder: TcxBrowseFolder; + ACSIDL: Integer; + ADesktopFolder: IShellFolder; + AParsedCharCount, AAttributes: Cardinal; + ATempCustomPath: PWideChar; + ATempPIDL: PItemIDList; +begin + if FIsRootChecking then + Exit; + + ADesktopFolder := GetDesktopIShellFolder; + ATempPIDL := nil; + FValid := False; + FShellFolder := nil; + if FPidl <> nil then + begin + DisposePidl(FPidl); + FPidl := nil; + end; + + ABrowseFolder := BrowseFolder; + if (ABrowseFolder = bfCustomPath) and (CustomPath = '') then + ABrowseFolder := bfDesktop; + + FIsRootChecking := True; + try + try + if ABrowseFolder = bfCustomPath then + begin + ATempCustomPath := StringToOleStr(CustomPath); + OleCheck(ADesktopFolder.ParseDisplayName(ParentWindow, nil, + ATempCustomPath, AParsedCharCount, ATempPIDL, AAttributes)); + end + else + begin + ACSIDL := ACSIDLs[ABrowseFolder]; + if Win32MajorVersion < 5 then + OleCheck(SHGetSpecialFolderLocation(ParentWindow, ACSIDL, ATempPIDL)) + else + OleCheck(cxSHGetFolderLocation(ParentWindow, ACSIDL, 0, 0, ATempPIDL)); + end; + except + on E: Exception do + if FRootChangingCount > 0 then + raise EcxEditError.Create(E.Message) + else + begin + RootUpdated; + Exit; + end; + end; + if ABrowseFolder = bfDesktop then + begin + FShellFolder := ADesktopFolder; + FPidl := GetPidlCopy(ATempPIDL); + FValid := True; + FAttributes := SFGAO_FILESYSTEM; + RootUpdated; + end + else + Pidl := ATempPIDL; + finally + FIsRootChecking := False; + if ATempPIDL <> nil then + DisposePidl(ATempPIDL); + end; +end; + +procedure TcxCustomShellRoot.DoSettingsChanged; +begin + if not FUpdating and Assigned(FOnSettingsChanged) then + FOnSettingsChanged(Self); +end; + +procedure TcxCustomShellRoot.RootUpdated; +begin + UpdateFolder; +end; + +procedure TcxCustomShellRoot.SetPidl(const Value: PItemIDList); +var + DesktopFolder:IShellFolder; + pFolder:IShellFolder; +begin + if Value = nil then + Exit; + if FPidl<>nil then + begin + DisposePidl(FPidl); + FPidl:=nil; + FValid:=False; + FAttributes:=0; + end; + if Failed(SHGetDesktopFolder(DesktopFolder)) then + Exit; + if Succeeded(DesktopFolder.BindToObject(Value,nil,IID_IShellFolder, pFolder)) then + begin + FShellFolder:=pFolder; + FPidl:=GetPidlCopy(Value); + FValid:=True; + FAttributes:=0; + if Failed(DesktopFolder.GetAttributesOf(1,FPidl,FAttributes)) then + FAttributes:=0; + end + else + begin + FShellFolder:=DesktopFolder; + FPidl:=GetPidlCopy(Value); + FValid:=True; + FAttributes:=SFGAO_FILESYSTEM; + end; + RootUpdated; +end; + +constructor TcxCustomShellRoot.Create(AOwner: TPersistent; AParentWindow: HWND); +begin + inherited Create; + FOwner := AOwner; + FParentWindow := AParentWindow; + FBrowseFolder := bfDesktop; + FCustomPath := ''; + FShellFolder := nil; + FPidl := nil; +end; + +destructor TcxCustomShellRoot.Destroy; +begin + FreeAndNil(FFolder); + FShellFolder := nil; + DisposePidl(FPidl); + inherited; +end; + +procedure TcxCustomShellRoot.Assign(Source: TPersistent); +var + APrevBrowseFolder: TcxBrowseFolder; + APrevCustomPath: WideString; +begin + if Source is TcxCustomShellRoot then + begin + APrevBrowseFolder := FBrowseFolder; + APrevCustomPath := FCustomPath; + try + FBrowseFolder := TcxCustomShellRoot(Source).FBrowseFolder; + FCustomPath := TcxCustomShellRoot(Source).FCustomPath; + Inc(Self.FRootChangingCount); + try + CheckRoot; + finally + Dec(FRootChangingCount); + end; + DoSettingsChanged; + except + FBrowseFolder := APrevBrowseFolder; + FCustomPath := APrevCustomPath; + CheckRoot; + raise; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxCustomShellRoot.Update(ARoot: TcxCustomShellRoot); +begin + if FUpdating then + Exit; + FUpdating := True; + try + Assign(ARoot); + finally + FUpdating := False; + end; +end; + +procedure TcxCustomShellRoot.SetBrowseFolder(Value: TcxBrowseFolder); +var + APrevBrowseFolder: TcxBrowseFolder; +begin + APrevBrowseFolder := FBrowseFolder; + try + Inc(FRootChangingCount); + try + if FBrowseFolder <> Value then + begin + FBrowseFolder := Value; + CheckRoot; + end + else + if Pidl = nil then + CheckRoot; + finally + Dec(FRootChangingCount); + end; + DoSettingsChanged; + except + FBrowseFolder := APrevBrowseFolder; + CheckRoot; + raise; + end; +end; + +procedure TcxCustomShellRoot.SetCustomPath(const Value: WideString); +var + APrevCustomPath: WideString; +begin + APrevCustomPath := FCustomPath; + try + FCustomPath := Value; + Inc(FRootChangingCount); + try + if BrowseFolder = bfCustomPath then + CheckRoot; + finally + Dec(FRootChangingCount); + end; + DoSettingsChanged; + except + FCustomPath := APrevCustomPath; + CheckRoot; + raise; + end; +end; + +function TcxCustomShellRoot.GetCurrentPath: WideString; +var + Desktop:IShellFolder; + StrName:TStrRet; +begin + Result:=''; + if Pidl<>nil then + begin + if Failed(SHGetDesktopFolder(Desktop)) then + Exit; + if Succeeded(Desktop.GetDisplayNameOf(Pidl,SHGDN_NORMAL or SHGDN_FORPARSING,StrName)) then + Result:=GetTextFromStrRet(StrName,Pidl); + end; +end; + +procedure TcxCustomShellRoot.UpdateFolder; +begin + FreeAndNil(FFolder); + FFolder := TcxShellFolder.Create(PIDL); +end; + +{ TcxCustomItemProducer } + +procedure TcxCustomItemProducer.ClearItems; + + (*function HasItems: Boolean; + begin + LockRead; + try + Result := Items.Count <> 0; + finally + UnlockRead; + end; + end;*) + +var + I: Integer; +begin + //if HasItems then + begin + ClearFetchQueue; + for I := 0 to Items.Count - 1 do + TcxShellItemInfo(Items[I]).Free; + Items.Clear; + end; + FShellFolder := nil; + if FFolderPidl <> nil then + begin + DisposePidl(FFolderPidl); + FFolderPidl := nil; + end; +end; + +constructor TcxCustomItemProducer.Create(AOwner: TWinControl); +begin + inherited Create; + FOwner := AOwner; + FDetails := TcxShellDetails.Create; + FItems := TList.Create; + FItemsLock := TMultiReadExclusiveWriteSynchronizer.Create; +end; + +procedure TcxCustomItemProducer.RequestItemsInfo; +var + I: Integer; +begin + ItemsInfoGatherer.StopFetch; + try + for I := 0 to Items.Count - 1 do + if not TcxShellItemInfo(Items[I]).Updated then + FetchRequest(I, False); + finally + ItemsInfoGatherer.ResumeFetch; + end; +end; + +destructor TcxCustomItemProducer.Destroy; +begin + ClearItems; + FreeAndNil(FDetails); + FreeAndNil(FItems); + FreeAndNil(FItemsLock); + inherited Destroy; +end; + +procedure TcxCustomItemProducer.LockRead; +begin + ItemsLock.BeginRead; +end; + +procedure TcxCustomItemProducer.LockWrite; +begin + ItemsLock.BeginWrite; +end; + +procedure TcxCustomItemProducer.ProcessItems(AIFolder: IShellFolder; + AFolderPIDL: PItemIDList; cPreloadItems: Integer); +begin + if FFolderPidl <> nil then + begin + DisposePidl(FFolderPidl); + FFolderPidl := nil; + end; + FShellFolder := AIFolder; + FFolderPidl := GetPidlCopy(AFolderPIDL); + ProcessDetails(ShellFolder, cPreloadItems); + FetchItems(cPreloadItems); + if AllowBackgroundProcessing then + RequestItemsInfo; +end; + +procedure TcxCustomItemProducer.SetItemsCount(Count: Integer); +begin + if Owner.HandleAllocated then + SendMessage(Owner.Handle,DSM_SETCOUNT,Count,0); +end; + +procedure TcxCustomItemProducer.UnlockRead; +begin + ItemsLock.EndRead; +end; + +procedure TcxCustomItemProducer.UnlockWrite; +begin + ItemsLock.EndWrite; +end; + +procedure TcxCustomItemProducer.NotifyRemoveItem(Index: Integer); +begin + if Owner.HandleAllocated then + SendMessage(Owner.Handle,DSM_NOTIFYREMOVEITEM,Index,0); +end; + +procedure TcxCustomItemProducer.NotifyAddItem(Index: Integer); +begin + if Owner.HandleAllocated then + SendMessage(Owner.Handle,DSM_NOTIFYADDITEM,Index,0); +end; + +procedure TcxCustomItemProducer.InitializeItem(Item:TcxShellItemInfo); +begin + // Do nothing by default +end; + +function TcxCustomItemProducer.CanAddFolder(AFolder: TcxShellFolder): Boolean; +begin + Result := True; +end; + +function TcxCustomItemProducer.DoCompareItems(AItem1, AItem2: TcxShellFolder; + out ACompare: Integer): Boolean; +begin + Result := False; +end; + +procedure TcxCustomItemProducer.FetchItems(cPreloadItems:Integer); +const + R: array[Boolean] of Byte = (0, 1); +var + pEnum:IEnumIDList; + currentCelt:Cardinal; + rPidl:PItemIDList; + Item:TcxShellItemInfo; + Res:HRESULT; + SaveCursor:TCursor; + PreloadInfo:Integer; + + function ShellSortFunction(Item1, Item2: Pointer): Integer; + var + AItemInfo1, AItemInfo2: TcxShellItemInfo; + begin + AItemInfo1 := TcxShellItemInfo(Item1); + AItemInfo2 := TcxShellItemInfo(Item2); + if not AItemInfo1.ItemProducer.DoCompareItems(AItemInfo1.Folder, AItemInfo2.Folder, Result) then + begin + Result := R[AItemInfo2.IsFolder] - R[AItemInfo1.IsFolder]; + if Result = 0 then + Result := SmallInt(AItemInfo1.ItemProducer.ShellFolder.CompareIDs(0, AItemInfo1.pidl, AItemInfo2.pidl)); + end; + end; + +begin + if Succeeded(ShellFolder.EnumObjects(Owner.ParentWindow, GetEnumFlags, pEnum)) and + Assigned(pEnum) then + begin + currentCelt:=1; + PreloadInfo:=cPreloadItems; + LockWrite; + SaveCursor:=Screen.Cursor; + try + try + Screen.Cursor:=crHourGlass; + repeat + Res:=pEnum.Next(currentCelt,rPidl,currentCelt); + if Res=E_INVALIDARG then + begin + currentCelt:=1; + Res:=pEnum.Next(currentCelt,rPidl,currentCelt); + end; + if Failed(Res) or (Res=S_FALSE) then + Break; + if (currentCelt=0) or (rPidl=nil) then + Break; + try + Item:=TcxShellItemInfo.Create(Self, ShellFolder, FFolderPidl, rPidl, False); + if (Item.Name = '') or not CanAddFolder(Item.Folder) then + begin + Item.Free; + Continue; + end; + if PreloadInfo>0 then + begin + Item.CheckUpdate(ShellFolder,FolderPidl,False); + Dec(PreloadInfo); + end + else + InitializeItem(Item); + Items.Add(Item); + finally + DisposePidl(rPidl); + end; + until(Res=S_FALSE); + Items.Sort(@ShellSortFunction); + finally + UnlockWrite; + end; + finally + Screen.Cursor:=SaveCursor; + end; + end; + SetItemsCount(Items.Count); +end; + +procedure TcxCustomItemProducer.ProcessDetails(ShellFolder: IShellFolder; + CharWidth: Integer); +var + DesktopFolder:IShellFolder; + Attr:Cardinal; + tempPidl:PitemIDList; +begin + if Failed(SHGetDesktopFolder(DesktopFolder)) then + Exit; + Attr:=0; + tempPidl:=GetPidlCopy(FolderPidl); + try + if Failed(DesktopFolder.GetAttributesOf(1,tempPidl,Attr)) then + Attr:=0; + Details.ProcessDetails(CharWidth,ShellFolder,(Attr and SFGAO_FILESYSTEM)=SFGAO_FILESYSTEM); + finally + DisposePidl(tempPidl); + end; +end; + +procedure TcxCustomItemProducer.DoGetInfoTip(Handle:HWND;ItemIndex: Integer; + InfoTip: PChar; cch: Integer); +var + tempShellItem:TcxShellItemInfo; + tempPidl:PItemIDList; + queryInfo:IQueryInfo; + infoStr:PWideChar; +begin + if GetShowToolTip then + begin + if ItemIndex>Items.Count-1 then + Exit; + tempShellItem:=Items[ItemIndex]; + tempPidl:=GetPidlCopy(tempShellItem.pidl); + try + if Failed(ShellFolder.GetUIObjectOf(Handle,1,tempPidl,IQueryInfo,nil,queryInfo)) then + Exit; + if Succeeded(queryInfo.GetInfoTip(0,infoStr)) and (infoStr <> nil) then + begin + StrPLCopy(InfoTip,StrPasW(infoStr),cch); + cxMalloc.Free(infoStr); + end; + finally + DisposePidl(tempPidl); + end; + end + else + StrPLCopy(InfoTip,'',cch); +end; + +function TcxCustomItemProducer.GetItemByPidl( + apidl: PItemIDList): TcxShellItemInfo; +var + i:Integer; + tempItem:TcxShellItemInfo; +begin + Result:=nil; + LockRead; + try + for i:=0 to Items.Count-1 do + begin + tempItem:=Items[i]; + if SmallInt(ShellFolder.CompareIDs(0,tempItem.pidl,apidl))=0 then + begin + Result:=tempItem; + Break; + end; + end; + finally + UnlockRead; + end; +end; + +function TcxCustomItemProducer.GetItemIndexByPidl( + apidl: PItemIDList): Integer; +var + i:Integer; + tempItem:TcxShellItemInfo; +begin + Result:=-1; + LockRead; + try + for i:=0 to Items.Count-1 do + begin + tempItem:=Items[i]; + if SmallInt(ShellFolder.CompareIDs(0,tempItem.pidl,apidl))=0 then + begin + Result:=i; + Break; + end; + end; + finally + UnlockRead; + end; +end; + +procedure TcxCustomItemProducer.FetchRequest(AIndex: Integer; + APriority: Boolean = False); +begin + ItemsInfoGatherer.RequestItemInfo(Self, AIndex, APriority); +end; + +procedure TcxCustomItemProducer.ClearFetchQueue; +begin + ItemsInfoGatherer.ClearFetchQueue(Self); +end; + +procedure TcxCustomItemProducer.CheckForSubitems(AItem: TcxShellItemInfo); +begin +end; + +{ TcxShellItemsInfoGatherer } + +constructor TcxShellItemsInfoGatherer.Create(AOwner: TWinControl); +begin + inherited Create; + FOwner := AOwner; + FFetchQueue := TList.Create; + CreateFetchThread; + RegisterShellItemsInfoGatherer(Self); +end; + +destructor TcxShellItemsInfoGatherer.Destroy; +begin + UnregisterShellItemsInfoGatherer(Self); + DestroyFetchThread; + FreeAndNil(FFetchQueue); + inherited Destroy; +end; + +procedure TcxShellItemsInfoGatherer.ClearFetchQueue( + AItemProducer: TcxCustomItemProducer); + + procedure InternalClearFetchQueue; + var + AItem: PcxRequestItem; + I: Integer; + begin + I := 0; + while I < FetchQueue.Count do + begin + AItem := FetchQueue[I]; + if (AItemProducer = nil) or (AItem.ItemProducer = AItemProducer) then + begin + FetchQueue.Remove(AItem); + Dispose(AItem); + end + else + Inc(I); + end; + end; + +begin + if FIsFetchQueueClearing then + Exit; + FIsFetchQueueClearing := True; + StopFetch; + try + InternalClearFetchQueue; + finally + FIsFetchQueueClearing := False; + ResumeFetch; + end; +end; + +procedure TcxShellItemsInfoGatherer.RequestItemInfo( + AItemProducer: TcxCustomItemProducer; AIndex: Integer; APriority: Boolean); +var + AItemIndex: Integer; +begin + StopFetch; + try + AItemIndex := GetFetchQueueItemIndex(FetchQueue, AItemProducer, AIndex); + if AItemIndex = -1 then + begin + if APriority then + FetchQueue.Insert(0, CreateRequestItem(AItemProducer, AIndex, True)) + else + FetchQueue.Add(CreateRequestItem(AItemProducer, AIndex, False)); + end + else + if APriority then + FetchQueue.Move(AItemIndex, 0); + finally + ResumeFetch; + end; +end; + +procedure TcxShellItemsInfoGatherer.ResumeFetch; +begin + if FStopFetchCount > 0 then + begin + Dec(FStopFetchCount); + if FStopFetchCount = 0 then + ResetEvent(FStopFetchEvent); + end; +end; + +procedure TcxShellItemsInfoGatherer.StopFetch; +begin + Inc(FStopFetchCount); + if FStopFetchCount = 1 then + begin + SetEvent(FStopFetchEvent); + WaitForSingleObject(FFetchStoppedEvent, INFINITE); + end; +end; + +procedure TcxShellItemsInfoGatherer.DestroyFetchThread; +begin + TerminateFetchThread; + InternalCloseHandle(FFetchThread); + InternalCloseHandle(FFetchStoppedEvent); + InternalCloseHandle(FStopFetchEvent); + InternalCloseHandle(FTerminateFetchThreadEvent); +end; + +procedure TcxShellItemsInfoGatherer.CreateFetchThread; +var + AFetchThreadID: DWORD; +begin + FFetchStoppedEvent := CreateEvent(nil, True, False, nil); + FStopFetchEvent := CreateEvent(nil, True, False, nil); + FTerminateFetchThreadEvent := CreateEvent(nil, True, False, nil); + FFetchThread := CreateThread(nil, 0, + @cxShellItemsInfoGathererFetchThreadFunction, Self, 0, AFetchThreadID); +end; + +function TcxShellItemsInfoGatherer.CreateRequestItem( + AItemProducer: TcxCustomItemProducer; AIndex: Integer; + APriority: Boolean): PcxRequestItem; +begin + New(Result); + Result.ItemIndex := AIndex; + Result.ItemProducer := AItemProducer; + Result.Priority := APriority; +end; + +function TcxShellItemsInfoGatherer.GetFetchQueueItemIndex( + AFetchQueue: TList; AItemProducer: TcxCustomItemProducer; + AIndex: Integer): Integer; +var + APItem: PcxRequestItem; + I: Integer; +begin + Result := -1; + for I := 0 to AFetchQueue.Count - 1 do + begin + APItem := AFetchQueue[I]; + if (APItem.ItemIndex = AIndex) and (APItem.ItemProducer = AItemProducer) then + begin + Result := I; + Break; + end; + end; +end; + +function TcxShellItemsInfoGatherer.GetIsFetchStopping: Boolean; +begin + Result := WaitForSingleObject(FStopFetchEvent, 0) = WAIT_OBJECT_0; +end; + +function TcxShellItemsInfoGatherer.GetIsFetchThreadTerminating: Boolean; +begin + Result := WaitForSingleObject(FTerminateFetchThreadEvent, 0) = WAIT_OBJECT_0; +end; + +procedure TcxShellItemsInfoGatherer.FetchResumed; +begin + ResetEvent(FFetchStoppedEvent); +end; + +procedure TcxShellItemsInfoGatherer.FetchStopped; +begin + SetEvent(FFetchStoppedEvent); +end; + +procedure TcxShellItemsInfoGatherer.InternalCloseHandle(var AHandle: THandle); +begin + CloseHandle(AHandle); + AHandle := 0; +end; + +procedure TcxShellItemsInfoGatherer.TerminateFetchThread; +begin + SetEvent(FTerminateFetchThreadEvent); + WaitForSingleObject(FFetchThread, INFINITE); +end; + +{ TcxShellFolder } + +constructor TcxShellFolder.Create(AAbsolutePIDL: PItemIDList); +var + AParentPIDL: PItemIDList; +begin + inherited Create; + FAbsolutePIDL := AAbsolutePIDL; + if GetPIDLItemsCount(FAbsolutePIDL) <= 1 then + begin + FParentShellFolder := GetDesktopIShellFolder; + FRelativePIDL := GetPIDLCopy(FAbsolutePIDL); + end + else + begin + AParentPIDL := GetPIDLParent(FAbsolutePIDL); + try + GetDesktopIShellFolder.BindToObject(AParentPIDL, nil, IID_IShellFolder, + FParentShellFolder); + finally + DisposePidl(AParentPIDL); + end; + FRelativePIDL := GetPIDLCopy(GetLastPIDLItem(FAbsolutePIDL)); + end; +end; + +destructor TcxShellFolder.Destroy; +begin + DisposePIDL(FRelativePIDL); + inherited Destroy; +end; + +function TcxShellFolder.GetAttributes: TcxShellFolderAttributes; + + procedure CheckAttribute(AShellAttributes, AAttributeShellAttribute: LongWord; + AAttribute: TcxShellFolderAttribute); + begin + if HasShellAttribute(AShellAttributes, AAttributeShellAttribute) then + Include(Result, AAttribute); + end; + +var + AShellAttributes: LongWord; +begin + AShellAttributes := GetShellAttributes(SFGAO_DISPLAYATTRMASK); + Result := []; + CheckAttribute(AShellAttributes, cxSFGAO_GHOSTED, sfaGhosted); + CheckAttribute(AShellAttributes, SFGAO_HIDDEN, sfaHidden); + CheckAttribute(AShellAttributes, SFGAO_ISSLOW, sfaIsSlow); + CheckAttribute(AShellAttributes, SFGAO_LINK, sfaLink); + CheckAttribute(AShellAttributes, SFGAO_READONLY, sfaReadOnly); + CheckAttribute(AShellAttributes, SFGAO_SHARE, sfaShare); +end; + +function TcxShellFolder.GetCapabilities: TcxShellFolderCapabilities; + + procedure CheckCapability(AShellAttributes, ACapabilityShellAttribute: LongWord; + ACapability: TcxShellFolderCapability); + begin + if HasShellAttribute(AShellAttributes, ACapabilityShellAttribute) then + Include(Result, ACapability); + end; + +var + AShellAttributes: LongWord; +begin + AShellAttributes := GetShellAttributes(SFGAO_CAPABILITYMASK); + Result := []; + CheckCapability(AShellAttributes, SFGAO_CANCOPY, sfcCanCopy); + CheckCapability(AShellAttributes, SFGAO_CANDELETE, sfcCanDelete); + CheckCapability(AShellAttributes, SFGAO_CANLINK, sfcCanLink); + CheckCapability(AShellAttributes, SFGAO_CANMOVE, sfcCanMove); + CheckCapability(AShellAttributes, SFGAO_CANRENAME, sfcCanRename); + CheckCapability(AShellAttributes, SFGAO_DROPTARGET, sfcDropTarget); + CheckCapability(AShellAttributes, SFGAO_HASPROPSHEET, sfcHasPropSheet); +end; + +function TcxShellFolder.GetDisplayName: string; +begin + Result := InternalGetDisplayName(ParentShellFolder, RelativePIDL, SHGDN_INFOLDER); +end; + +function TcxShellFolder.GetIsFolder: Boolean; +begin + Result := HasShellAttribute(SFGAO_FOLDER); +end; + +function TcxShellFolder.GetPathName: string; + + function GetDisplayName(ANameType: DWORD): string; + begin + Result := InternalGetDisplayName(GetDesktopIShellFolder, AbsolutePIDL, ANameType); + end; + +begin + Result := InternalGetDisplayName(GetDesktopIShellFolder, AbsolutePIDL, SHGDN_FORPARSING); + if Pos('::{', Result) = 1 then + Result := InternalGetDisplayName(GetDesktopIShellFolder, AbsolutePIDL, SHGDN_NORMAL); +end; + +function TcxShellFolder.GetProperties: TcxShellFolderProperties; + + procedure CheckProperty(AShellAttributes, APropertyShellAttribute: LongWord; + AProperty: TcxShellFolderProperty); + begin + if HasShellAttribute(AShellAttributes, APropertyShellAttribute) then + Include(Result, AProperty); + end; + +var + AShellAttributes: LongWord; +begin + AShellAttributes := GetShellAttributes(SFGAO_BROWSABLE or SFGAO_COMPRESSED or + SFGAO_ENCRYPTED or SFGAO_NEWCONTENT or SFGAO_NONENUMERATED or SFGAO_REMOVABLE); + Result := []; + CheckProperty(AShellAttributes, SFGAO_BROWSABLE, sfpBrowsable); + CheckProperty(AShellAttributes, SFGAO_COMPRESSED, sfpCompressed); + CheckProperty(AShellAttributes, SFGAO_ENCRYPTED, sfpEncrypted); + CheckProperty(AShellAttributes, SFGAO_NEWCONTENT, sfpNewContent); + CheckProperty(AShellAttributes, SFGAO_NONENUMERATED, sfpNonEnumerated); + CheckProperty(AShellAttributes, SFGAO_REMOVABLE, sfpRemovable); +end; + +function TcxShellFolder.GetShellAttributes(ARequestedAttributes: LongWord): LongWord; +begin + ParentShellFolder.GetAttributesOf(1, FRelativePIDL, ARequestedAttributes); + Result := ARequestedAttributes; +end; + +function TcxShellFolder.GetShellFolder: IShellFolder; +begin + if GetPIDLItemsCount(AbsolutePIDL) = 0 then + Result := GetDesktopIShellFolder + else + GetDesktopIShellFolder.BindToObject(AbsolutePIDL, nil, IID_IShellFolder, Result); +end; + +function TcxShellFolder.GetStorageCapabilities: TcxShellFolderStorageCapabilities; + + procedure CheckStorageCapability(AShellAttributes, AStorageCapabilityShellAttribute: LongWord; + AStorageCapability: TcxShellFolderStorageCapability); + begin + if HasShellAttribute(AShellAttributes, AStorageCapabilityShellAttribute) then + Include(Result, AStorageCapability); + end; + +var + AShellAttributes: LongWord; +begin + AShellAttributes := GetShellAttributes(SFGAO_STORAGECAPMASK); + Result := []; + CheckStorageCapability(AShellAttributes, SFGAO_FILESYSANCESTOR, sfscFileSysAncestor); + CheckStorageCapability(AShellAttributes, SFGAO_FILESYSTEM, sfscFileSystem); + CheckStorageCapability(AShellAttributes, SFGAO_FOLDER, sfscFolder); + CheckStorageCapability(AShellAttributes, SFGAO_LINK, sfscLink); + CheckStorageCapability(AShellAttributes, SFGAO_READONLY, sfscReadOnly); + CheckStorageCapability(AShellAttributes, SFGAO_STORAGE, sfscStorage); + CheckStorageCapability(AShellAttributes, SFGAO_STORAGEANCESTOR, sfscStorageAncestor); + CheckStorageCapability(AShellAttributes, SFGAO_STREAM, sfscStream); +end; + +function TcxShellFolder.GetSubFolders: Boolean; +begin + Result := HasShellAttribute(SFGAO_HASSUBFOLDER); +end; + +function TcxShellFolder.HasShellAttribute(AAttribute: LongWord): Boolean; +begin + Result := HasShellAttribute(GetShellAttributes(AAttribute), AAttribute); +end; + +function TcxShellFolder.HasShellAttribute(AAttributes, AAttribute: LongWord): Boolean; +begin + Result := AAttributes and AAttribute <> 0; +end; + +function TcxShellFolder.InternalGetDisplayName(AFolder: IShellFolder; + APIDL: PItemIDList; ANameType: DWORD): string; +var + AStrRet: TStrRet; +begin + AFolder.GetDisplayNameOf(APIDL, ANameType, AStrRet); + Result := GetTextFromStrRet(AStrRet, APIDL); +end; + +{ TcxShellItemInfo } + +procedure TcxShellItemInfo.CheckInitialize(AIFolder: IShellFolder; + APIDL: PItemIDList); +var + AAttributes: Cardinal; +begin + if Initialized then + Exit; + + AAttributes := SFGAO_FOLDER; + if Succeeded(AIFolder.GetAttributesOf(1, APIDL, AAttributes)) then + FIsFolder := AAttributes and SFGAO_FOLDER <> 0 + else + begin + FIsFolder := False; + FIsFilesystem := False; + FIsDropTarget := True; + FCanRename := True; + end; + if IsFolder then + FHasSubfolder := True + else + FHasSubfolder := False; + FName := GetShellItemDisplayName(AIFolder, APIDL, IsFolder); + if IsFolder then + begin + FIconIndex := sysFolderIconIndex; + FOpenIconIndex := sysFolderOpenIconIndex; + end + else + begin + FIconIndex := sysFileIconIndex; + FOpenIconIndex := sysFileIconIndex; + end; + FInitialized := True; +end; + +{ TcxShellItemInfo } + +procedure TcxShellItemInfo.CheckSubitems(AParentIFolder: IShellFolder; + AEnumSettings: Cardinal); +begin + FHasSubfolder := HasSubItems(AParentIFolder, FFullPIDL, AEnumSettings); +end; + +procedure TcxShellItemInfo.CheckUpdate(ShellFolder: IShellFolder; + FolderPidl:PItemIDList;Fast:Boolean); +var + attr:Cardinal; + FileInfo:TShFileInfo; + fqPidl:PItemIDList; + Flags:Cardinal; + pszName:PChar; + tempPidl:PItemIDList; +begin + if Updated or Updating then + Exit; + Updating:=True; + try + Assert(pidl<>nil,'Item object not initialized'); + if pidl=nil then + Exit; + fqPidl:=ConcatenatePidls(FolderPidl,pidl); + try + attr:=0; + tempPidl:=pidl; + CheckInitialize(ShellFolder,tempPidl); + if Fast then + begin + if not IsFolder then + begin + GetMem(pszName,MAX_PATH); + try + StrPLCopy(pszName,Name,MAX_PATH); + SHGetFileInfo(pszName,FILE_ATTRIBUTE_NORMAL,FileInfo,SizeOf(TShFileInfo), + SHGFI_SYSICONINDEX or SHGFI_USEFILEATTRIBUTES); + FIconIndex:=FileInfo.iIcon; + SHGetFileInfo(pszName,FILE_ATTRIBUTE_NORMAL,FileInfo,SizeOf(TShFileInfo), + SHGFI_SYSICONINDEX or SHGFI_USEFILEATTRIBUTES or + SHGFI_OPENICON); + FOpenIconIndex:=FileInfo.iIcon; + finally + FreeMem(pszName); + end; + end + else + begin + Flags:=SHGFI_PIDL or SHGFI_SYSICONINDEX; + SHGetFileInfo(PChar(fqPidl),0,FileInfo,SizeOf(FileInfo),Flags); + FIconIndex:=FileInfo.iIcon; + end; + end + else + begin + // Processing attributes + if Succeeded(ShellFolder.GetAttributesOf(1,TempPidl,attr)) then + FIsFilesystem:=(attr and SFGAO_FILESYSTEM)=SFGAO_FILESYSTEM; + attr:=SFGAO_HIDDEN or SFGAO_SHARE or SFGAO_LINK or SFGAO_REMOVABLE; + if Succeeded(ShellFolder.GetAttributesOf(1,TempPidl,attr)) then + begin + FIsGhosted:=(attr and SFGAO_HIDDEN)=SFGAO_HIDDEN; + FIsShare:=(attr and SFGAO_SHARE)=SFGAO_SHARE; + FIsLink:=(attr and SFGAO_LINK)=SFGAO_LINK; + FIsRemovable:=(attr and SFGAO_REMOVABLE)=SFGAO_REMOVABLE; + end; + attr:=SFGAO_CAPABILITYMASK; + if Succeeded(ShellFolder.GetAttributesOf(1,TempPidl,attr)) then + begin + FIsDropTarget:=(attr and SFGAO_DROPTARGET)=SFGAO_DROPTARGET; + FCanRename:=(attr and SFGAO_CANRENAME)=SFGAO_CANRENAME; + end; + // Processing icons + Flags:=SHGFI_PIDL or SHGFI_SYSICONINDEX or SHGFI_TYPENAME; + SHGetFileInfo(PChar(fqPidl),0,FileInfo,SizeOf(FileInfo),Flags); + FIconIndex:=FileInfo.iIcon; + if FIsFolder then + SHGetFileInfo(PChar(fqPidl),0,FileInfo,SizeOf(FileInfo),Flags or SHGFI_OPENICON); + FOpenIconIndex:=FileInfo.iIcon; + Updated:=True; + end; + finally + DisposePidl(fqPidl); + end; + finally + Updating:=False; + end; +end; + +constructor TcxShellItemInfo.Create(AItemProducer: TcxCustomItemProducer; + AParentIFolder: IShellFolder; AParentPIDL, APIDL: PItemIDList; + AFast: Boolean); +var + AWithoutAV: Boolean; +begin + inherited Create; + FItemProducer := AItemProducer; + // the following code required to get rid of bug, that occasionally appeared + // on Windows XP. The pidl received from thr shell, anothed memory block + // allocated internally, but occasionally appeared exception thad CopyMemory + // can't be performed + repeat + FDetails := TStringList.Create; + try + FPIDL := GetPidlCopy(APIDL); + AWithoutAV := True; + except + AWithoutAV := False; + end; + until(AWithoutAV); + if not AFast then + CheckInitialize(AParentIFolder, APIDL) + else + begin + FName := ' '; + FIconIndex := sysFileIconIndex; + FOpenIconIndex := sysFileIconIndex; + end; + FInfoTip := ''; + FUpdated := False; + FUpdating := False; + FFullPIDL := ConcatenatePidls(AParentPIDL, APIDL); + FFolder := TcxShellFolder.Create(FFullPIDL); +end; + +destructor TcxShellItemInfo.Destroy; +begin + FreeAndNil(FFolder); + DisposePidl(FFullPIDL); + DisposePidl(Fpidl); + FreeAndNil(FDetails); + inherited; +end; + +procedure TcxShellItemInfo.FetchDetails(wnd:HWND;ShellFolder: IShellFolder;DetailsMap:TcxShellDetails); + + function FormatSizeStr(AStr: string): string; + begin + Result := FormatMaskText('!### ### ### KB;0;*', AStr); + end; + + function GetFileTypeInfo(const AFilename: string): string; + begin + Result := GetRegStringValue(GetRegStringValue(ExtractFileExt(AFileName), ''), ''); + end; + +var + AColumnDetails: TShellDetails; + AFileInfo: TWIN32FindData; + AFileSize: record + case integer of + 0:(l,h:cardinal); + 1:(c:int64); + end; + AFindFileHandle: THandle; + APDetailItem: PcxDetailItem; + AShellDetails: IShellDetails; + AShellFolder2: IShellFolder2; + AStrPath: TStrRet; + ATempName: PChar; + I: Integer; +begin + // Processing details + Details.Clear; + if Succeeded(ShellFolder.QueryInterface({$IFNDEF DELPHI6}cxIID_IShellFolder2{$ELSE}cxIShellFolder2{$ENDIF}, AShellFolder2)) then + begin + for I := 0 to DetailsMap.Count - 1 do + begin + APDetailItem := DetailsMap[I]; + if APDetailItem.ID = 0 then + Continue; // Name column already exists + if AShellFolder2.GetDetailsOf(pidl, APDetailItem.ID, AColumnDetails) = S_OK then + Details.Add(GetTextFromStrRet(AColumnDetails.str, pidl)) + else + Details.Add(''); + end; + end + else + if Succeeded(GetShellDetails(ShellFolder, pidl, AShellDetails)) then + begin + for I := 0 to DetailsMap.Count - 1 do + begin + APDetailItem := DetailsMap[I]; + if APDetailItem.ID = 0 then + Continue; // Name column already exists + if AShellDetails.GetDetailsOf(pidl, APDetailItem.ID, AColumnDetails) = S_OK then + Details.Add(GetTextFromStrRet(AColumnDetails.str, pidl)) + else + Details.Add(''); + end; + end + else + if IsFilesystem then + begin + if Failed(ShellFolder.GetDisplayNameOf(pidl, SHGDN_NORMAL or SHGDN_FORPARSING, AStrPath)) then + Exit; + GetMem(ATempName, MAX_PATH); + try + StrPLCopy(ATempName, GetTextFromStrRet(AStrPath, pidl), MAX_PATH); + AFindFileHandle := FindFirstFile(ATempName, AFileInfo); + if AFindFileHandle <> INVALID_HANDLE_VALUE then + try + AFileSize.h := AFileInfo.nFileSizeHigh; + AFileSize.l := AFileInfo.nFileSizeLow; + Details.Add(FormatSizeStr(IntToStr(Ceil(AFileSize.c/1024)))); + Details.Add(GetFileTypeInfo(AFileInfo.cFileName)); + Details.Add(DateTimeToStr(cxFileTimeToDateTime(AFileInfo.ftLastWriteTime))); + finally + Windows.FindClose(AFindFileHandle); + end; + finally + FreeMem(ATempName); + end; + end; +end; + +procedure TcxShellItemInfo.SetNewPidl(pFolder:IShellFolder;FolderPidl,apidl: PItemIDList); +begin + if apidl=nil then + Exit; + if Fpidl<>nil then + DisposePidl(FPidl); + FPidl:=GetPidlCopy(apidl); + Updated:=False; + CheckUpdate(pFolder,FolderPidl,False); +end; + +{ TcxShellOptions } + +constructor TcxShellOptions.Create(AOwner:TWinControl); +begin + inherited Create; + FOwner:=AOwner; + FContextMenus:=True; + FShowFolders:=True; + FShowNonFolders:=True; + FShowHidden:=False; + FShowToolTip := True; + FTrackShellChanges:=True; +end; + +procedure TcxShellOptions.Assign(Source: TPersistent); +begin + if Source is TcxShellOptions then + with TcxShellOptions(Source) do + begin + Self.FContextMenus := FContextMenus; + Self.FShowFolders := FShowFolders; + Self.FShowHidden := FShowHidden; + Self.FShowNonFolders := FShowNonFolders; + Self.ShowToolTip := ShowToolTip; + Self.FTrackShellChanges := FTrackShellChanges; + NotifyUpdateContents; + end + else + inherited Assign(Source); +end; + +function TcxShellOptions.GetEnumFlags: Cardinal; +begin + if ShowFolders then + Result:=SHCONTF_FOLDERS + else + Result:=0; + if ShowNonFolders then + Result:=Result or SHCONTF_NONFOLDERS; + if ShowHidden then + Result:=Result or SHCONTF_INCLUDEHIDDEN; +end; + +procedure TcxShellOptions.NotifyUpdateContents; +begin + if Owner.HandleAllocated then + SendMessage(Owner.Handle,DSM_NOTIFYUPDATECONTENTS,0,0); +end; + +procedure TcxShellOptions.SetShowFolders(Value: Boolean); +begin + FShowFolders := Value; + NotifyUpdateContents; +end; + +procedure TcxShellOptions.SetShowHidden(Value: Boolean); +begin + FShowHidden := Value; + NotifyUpdateContents; +end; + +procedure TcxShellOptions.SetShowNonFolders(Value: Boolean); +begin + FShowNonFolders := Value; + NotifyUpdateContents; +end; + +procedure TcxShellOptions.SetShowToolTip(Value: Boolean); +begin + if Value <> FShowToolTip then + begin + FShowToolTip := Value; + if Assigned(FOnShowToolTipChanged) then + FOnShowToolTipChanged(Self); + end; +end; + +{ TcxShellDetails } + +function TcxShellDetails.Add: PcxDetailItem; +begin + New(Result); + Items.Add(Result); +end; + +procedure TcxShellDetails.Clear; +var + di:PcxDetailItem; +begin + while Items.Count<>0 do + begin + di:=Items.Last; + Items.Remove(di); + Dispose(di); + end; +end; + +constructor TcxShellDetails.Create; +begin + inherited Create; + FItems:=TList.Create; +end; + +destructor TcxShellDetails.Destroy; +begin + Clear; + FreeAndNil(FItems); +end; + +function TcxShellDetails.GetCount: Integer; +begin + Result:=Items.Count; +end; + +function TcxShellDetails.GetItems(Index: Integer): PcxDetailItem; +begin + Result:=Items[Index]; +end; + +procedure TcxShellDetails.ProcessDetails(ACharWidth: Integer; + AShellFolder: IShellFolder; AFileSystem: Boolean); +const + AAlignment: array[0..2] of TAlignment = (taLeftJustify, taRightJustify, taCenter); +var + AColumnDetails: TShellDetails; + AColumnFlags: Cardinal; + AColumnIndex: Integer; + SD: IShellDetails; + SF2: IShellFolder2; + + procedure SetItemInfo(AItem: PcxDetailItem; AText: string; AWidth:Integer; + AAlignment: TAlignment; AID:Integer); + begin + AItem.Text := AText; + AItem.Width := AWidth * ACharWidth; + AItem.Alignment := AAlignment; + AItem.ID := AID; + end; + + procedure AddItem(ADetails: TShellDetails; AIndex: Integer); + var + ANewColumn: PcxDetailItem; + begin + ANewColumn := Add; + SetItemInfo(ANewColumn, GetTextFromStrRet(ADetails.str, nil), + ADetails.cxChar, AAlignment[ADetails.fmt], AIndex); + end; + +var + ADefaultColumns: Boolean; +begin + ZeroMemory(@AColumnDetails, SizeOf(AColumnDetails)); + AColumnIndex := 0; + Clear; + if Succeeded(AShellFolder.QueryInterface({$IFNDEF DELPHI6}cxIID_IShellFolder2{$ELSE}cxIShellFolder2{$ENDIF}, SF2)) then + begin + ADefaultColumns := False; + while SF2.GetDetailsOf(nil, AColumnIndex, AColumnDetails) = S_OK do + begin + Inc(AColumnIndex); + if Succeeded(SF2.GetDefaultColumnState(AColumnIndex - 1, AColumnFlags)) then + begin + ADefaultColumns := ADefaultColumns or (AColumnFlags and SHCOLSTATE_ONBYDEFAULT = SHCOLSTATE_ONBYDEFAULT); + if not IsWindowsXPOrLater and ADefaultColumns and + (AColumnFlags and SHCOLSTATE_ONBYDEFAULT <> SHCOLSTATE_ONBYDEFAULT) then + Break; + if (AColumnFlags and SHCOLSTATE_ONBYDEFAULT <> SHCOLSTATE_ONBYDEFAULT) or + (AColumnFlags and SHCOLSTATE_HIDDEN = SHCOLSTATE_HIDDEN) then + Continue; + end; + AddItem(AColumnDetails, AColumnIndex - 1); + end; + end + else + if GetShellDetails(AShellFolder, nil, SD) = S_OK then + begin + while SD.GetDetailsOf(nil, AColumnIndex, AColumnDetails) = S_OK do + begin + AddItem(AColumnDetails, AColumnIndex); + Inc(AColumnIndex); + end; + end + else + begin // Processing creating columns manually (for Win95/98) + SetItemInfo(Add, SShellDefaultNameStr, 25, taLeftJustify, 0); + if AFileSystem then + begin + SetItemInfo(Add, SShellDefaultSizeStr, 10, taRightJustify, 1); + SetItemInfo(Add, SShellDefaultTypeStr, 10, taLeftJustify, 2); + SetItemInfo(Add, SShellDefaultModifiedStr, 14, taLeftJustify, 3); + end; + end; +end; + +procedure TcxShellDetails.Remove(Item: PcxDetailItem); +begin + Items.Remove(Item); + Dispose(Item); +end; + +{ TcxDropTarget } + +constructor TcxDropSource.Create(AOwner: TWinControl); +begin + inherited Create; + FOwner := AOwner; +end; + +function TcxDropSource.GiveFeedback(dwEffect: Integer): HResult; +begin + Result:=DRAGDROP_S_USEDEFAULTCURSORS; +end; + +function TcxDropSource.QueryContinueDrag(fEscapePressed: BOOL; + grfKeyState: Integer): HResult; +begin + if fEscapePressed then + Result:=DRAGDROP_S_CANCEL + else + if ((grfKeyState and MK_LBUTTON)<>MK_LBUTTON) and + ((grfKeyState and MK_RBUTTON)<>MK_RBUTTON) then + Result:=DRAGDROP_S_DROP + else + Result:=S_OK; +end; + +{ TcxDragDropSettings } + +constructor TcxDragDropSettings.Create; +begin + inherited Create; + FAllowDragObjects := True; + FDefaultDropEffect := deMove; + FDropEffect := [deMove, deCopy, deLink]; +end; + +procedure TcxDragDropSettings.Changed; +begin + if Assigned(FOnChange) then + FOnChange(Self); +end; + +function TcxDragDropSettings.GetDefaultDropEffectAPI: Integer; +begin + case DefaultDropEffect of + deCopy: + Result := DROPEFFECT_COPY; + deMove: + Result := DROPEFFECT_MOVE; + deLink: + Result := DROPEFFECT_LINK; + else + Result := DROPEFFECT_NONE; + end; +end; + +function TcxDragDropSettings.GetDropEffectAPI: DWORD; +begin + Result := 0; + if deCopy in DropEffect then + Result := Result or DROPEFFECT_COPY; + if deMove in DropEffect then + Result := Result or DROPEFFECT_MOVE; + if deLink in DropEffect then + Result := Result or DROPEFFECT_LINK; +end; + +procedure TcxDragDropSettings.SetAllowDragObjects(Value: Boolean); +begin + if Value <> FAllowDragObjects then + begin + FAllowDragObjects := Value; + Changed; + end; +end; + +procedure cxShellInitialize; +begin + OleInitialize(nil); + ShellLibrary := LoadLibrary(ShellLibraryName); + cxSHGetFolderLocation := GetProcAddress(ShellLibrary, 'SHGetFolderLocation'); + SHChangeNotifyRegister := GetProcAddress(ShellLibrary,PChar(2)); + SHChangeNotifyUnregister := GetProcAddress(ShellLibrary,PChar(4)); + cxSHGetPathFromIDList := GetProcAddress(ShellLibrary, 'SHGetPathFromIDListA'); + cxSHGetPathFromIDListW := GetProcAddress(ShellLibrary, 'SHGetPathFromIDListW'); +end; + +procedure cxShellUninitialize; +var + I: Integer; +begin + if FShellItemsInfoGatherers <> nil then + for I := 0 to FShellItemsInfoGatherers.Count - 1 do + TcxShellItemsInfoGatherer(FShellItemsInfoGatherers[I]).DestroyFetchThread; + + FcxMalloc := nil; + if ShellLibrary <> 0 then + FreeLibrary(ShellLibrary); + OleUninitialize; +end; + +initialization + cxShellInitialize; + +finalization + cxShellUninitialize; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxShellControls.pas b/official/x.35/ExpressEditors Library 5/Sources/cxShellControls.pas new file mode 100644 index 00000000..15ea43ba --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxShellControls.pas @@ -0,0 +1,2763 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxShellControls; + +{$I cxVer.inc} + +interface + +uses + Windows, ActiveX, Classes, ComCtrls, CommCtrl, ComObj, Controls, Dialogs, + Menus, Messages, ShellApi, ShlObj, SysUtils, cxShellCommon; + +const + cxShellNormalItemOverlayIndex = -1; + cxShellSharedItemOverlayIndex = 0; + cxShellShortcutItemOverlayIndex = 1; + +type + TcxCustomInnerShellListView = class; + TcxCustomInnerShellTreeView = class; + + TcxListViewStyle=(lvsIcon, lvsSmallIcon, lvsList, lvsReport); + // Custom listview styles added because D4 and D5 does not allow detect + // the ViewStyle change. Also, we can add more styles to this component: + // Tile/Thumbnails/Custom... + + TcxNavigationEvent = procedure (Sender:TcxCustomInnerShellListView;fqPidl:PItemIDList; + FolderPath:WideString) of object; + TcxShellAddFolderEvent = procedure(Sender: TObject; AFolder: TcxShellFolder; + var ACanAdd: Boolean) of object; + TcxShellChangeEvent = procedure(Sender: TObject; AEventID: DWORD; + APIDL1, APIDL2: PItemIDList) of object; + TcxShellCompareEvent = procedure(Sender: TObject; + AItem1, AItem2: TcxShellFolder; out ACompare: Integer) of object; + + TcxShellListViewProducer = class(TcxCustomItemProducer) + private + function GetListView: TcxCustomInnerShellListView; + protected + function AllowBackgroundProcessing: Boolean; override; + function CanAddFolder(AFolder: TcxShellFolder): Boolean; override; + function DoCompareItems(AItem1, AItem2: TcxShellFolder; + out ACompare: Integer): Boolean; override; + function GetEnumFlags: Cardinal; override; + function GetItemsInfoGatherer: TcxShellItemsInfoGatherer; override; + function GetShowToolTip: Boolean; override; + property ListView: TcxCustomInnerShellListView read GetListView; + public + procedure NotifyUpdateItem(AItem: PcxRequestItem); override; + procedure ProcessDetails(ShellFolder: IShellFolder; CharWidth: Integer); override; + end; + + { TcxShellListRoot } + + TcxShellListRoot = class(TcxCustomShellRoot) + protected + procedure RootUpdated; override; + end; + + TDropTargetType = (dttNone, dttOpenFolder, dttItem); + + IcxDropTarget = interface(IDropTarget) + ['{F688E250-96A6-4222-AF9D-049EB6E7D05B}'] + end; + + { TcxShellListViewOptions } + + TcxShellListViewOptions = class(TcxShellOptions) + private + FAutoNavigate: Boolean; + public + constructor Create(AOwner: TWinControl); override; + procedure Assign(Source: TPersistent); override; + published + property AutoNavigate: Boolean read FAutoNavigate write FAutoNavigate + default True; + end; + + IcxDataObject = interface(IDataObject) + ['{9A9CDB78-150E-4469-A551-608EFF415145}'] + end; + + TcxShellChangeNotifierData = record + Handle: THandle; + PIDL: PItemIDList; + end; + + { TcxCustomInnerShellListView } + + TcxCustomInnerShellListView = class(TCustomListView, IUnknown, IcxDropTarget) + private + FAfterNavigation: TcxNavigationEvent; + FBeforeNavigation: TcxNavigationEvent; + FComboBoxControl: TWinControl; + FCurrentDropTarget: IcxDropTarget; + FDragDropSettings: TcxDragDropSettings; + FDraggedObject: IcxDataObject; + FDropTargetItemIndex: Integer; + FFirstUpdateItem: Integer; + FInternalLargeImages: THandle; + FInternalSmallImages: THandle; + FItemProducer: TcxShellListViewProducer; + FItemsInfoGatherer: TcxShellItemsInfoGatherer; + FLastUpdateItem: Integer; + FListViewStyle: TcxListViewStyle; + FNotificationLock: Boolean; + FOptions: TcxShellListViewOptions; + FRoot: TcxShellListRoot; + FRootChanged: TcxRootChangedEvent; + FShellChangeNotifierData: TcxShellChangeNotifierData; + FTreeViewControl: TWinControl; + FOnAddFolder: TcxShellAddFolderEvent; + FOnCompare: TcxShellCompareEvent; + FOnShellChange: TcxShellChangeEvent; + function GetFolder(AIndex: Integer): TcxShellFolder; + function GetFolderCount: Integer; + procedure RootSettingsChanged(Sender: TObject); + procedure SetListViewStyle(const Value: TcxListViewStyle); + procedure SetDropTargetItemIndex(Value: Integer); + procedure DSMSynchronizeRoot(var Message: TMessage); message DSM_SYNCHRONIZEROOT; + protected + procedure CreateWnd; override; + procedure DestroyWnd; override; + function OwnerDataFetch(Item: TListItem; Request: TItemRequest): Boolean; override; + procedure DblClick; override; + procedure DoContextPopup(MousePos: TPoint; var Handled: Boolean); override; + function CanEdit(Item: TListItem): Boolean; override; + procedure Loaded;override; + procedure Edit(const Item: TLVItem); override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure DisplayContextMenu(const APos: TPoint); + procedure DoProcessDefaultCommand(Item:TcxShellItemInfo); virtual; + procedure DoProcessNavigation(Item:TcxShellItemInfo); + procedure DoBeforeNavigation(fqPidl:PItemIDList); + function DoAddFolder(AFolder: TcxShellFolder): Boolean; + procedure DoAfterNavigation; + function DoCompare(AItem1, AItem2: TcxShellFolder; + out ACompare: Integer): Boolean; virtual; + procedure CreateColumns; + procedure CreateDropTarget; + procedure CreateChangeNotification; + procedure RemoveColumns; + procedure RemoveDropTarget; + procedure RemoveChangeNotification; + procedure CheckUpdateItems; + procedure DoBeginDrag; + procedure DoNavigateTreeView; + procedure GetDropTarget(pt:TPoint;out New:Boolean); + procedure Navigate(APIDL: PItemIDList); virtual; + function TryReleaseDropTarget:HResult; + procedure CNNotify(var Message: TWMNotify); message CN_NOTIFY; + procedure DsmSetCount(var Message:TMessage); message DSM_SETCOUNT; + procedure DsmNotifyUpdateItem(var Message:TMessage); message DSM_NOTIFYUPDATE; + procedure DsmNotifyUpdateContents(var Message:TMessage); message DSM_NOTIFYUPDATECONTENTS; + procedure DsmShellChangeNotify(var Message:TMessage); message DSM_SHELLCHANGENOTIFY; + property ComboBoxControl: TWinControl read FComboBoxControl write FComboBoxControl; + property FirstUpdateItem:Integer read FFirstUpdateItem write FFirstUpdateItem; + property LastUpdateItem:Integer read FLastUpdateItem write FLastUpdateItem; + property ItemProducer:TcxShellListViewProducer read FItemProducer; + property CurrentDropTarget:IcxDropTarget read FCurrentDropTarget write FCurrentDropTarget; + property DropTargetItemIndex: Integer read FDropTargetItemIndex write SetDropTargetItemIndex; + property DraggedObject:IcxDataObject read FDraggedObject write FDraggedObject; + property TreeViewControl:TWinControl read FTreeViewControl write FTreeViewControl; + // IcxDropTarget methods + function DragEnter(const dataObj: IDataObject; grfKeyState: Longint; + pt: TPoint; var dwEffect: Longint): HResult; stdcall; + function IcxDropTarget.DragOver=IDropTargetDragOver; + function IDropTargetDragOver(grfKeyState: Longint; pt: TPoint; + var dwEffect: Longint): HResult; stdcall; + function DragLeave: HResult; stdcall; + function Drop(const dataObj: IDataObject; grfKeyState: Longint; pt: TPoint; + var dwEffect: Longint): HResult; stdcall; + property ItemsInfoGatherer: TcxShellItemsInfoGatherer read FItemsInfoGatherer; + property OnAddFolder: TcxShellAddFolderEvent read FOnAddFolder + write FOnAddFolder; + property OnCompare: TcxShellCompareEvent read FOnCompare write FOnCompare; + property OnShellChange: TcxShellChangeEvent read FOnShellChange write FOnShellChange; + public + constructor Create(AOwner:TComponent); override; + destructor Destroy; override; + procedure BrowseParent; + procedure SetTreeView(ATreeView:TWinControl); + procedure ProcessTreeViewNavigate(APIDL: PItemIDList); + procedure UpdateContent; + property DragDropSettings: TcxDragDropSettings read FDragDropSettings write FDragDropSettings; + property FolderCount: Integer read GetFolderCount; + property Folders[AIndex: Integer]: TcxShellFolder read GetFolder; + property ListViewStyle: TcxListViewStyle read FListViewStyle write SetListViewStyle; + property Options: TcxShellListViewOptions read FOptions write FOptions; + property Root: TcxShellListRoot read FRoot write FRoot; + property AfterNavigation: TcxNavigationEvent read FAfterNavigation write FAfterNavigation; + property BeforeNavigation: TcxNavigationEvent read FBeforeNavigation write FBeforeNavigation; + property OnRootChanged: TcxRootChangedEvent read FRootChanged write FRootChanged; + end; + + TcxShellTreeRoot = class(TcxCustomShellRoot) + protected + procedure RootUpdated; override; + end; + + TcxShellTreeItemProducer = class(TcxCustomItemProducer) + private + FNode: TTreeNode; + FOnDestroy: TNotifyEvent; + function GetTreeView: TcxCustomInnerShellTreeView; + protected + function AllowBackgroundProcessing: Boolean; override; + function CanAddFolder(AFolder: TcxShellFolder): Boolean; override; + function GetEnumFlags:Cardinal; override; + function GetItemsInfoGatherer: TcxShellItemsInfoGatherer; override; + function GetShowToolTip:Boolean; override; + property Node:TTreeNode read FNode write FNode; + procedure InitializeItem(Item:TcxShellItemInfo); override; + procedure CheckForSubitems(AItem: TcxShellItemInfo); override; + property TreeView: TcxCustomInnerShellTreeView read GetTreeView; + public + constructor Create(AOwner:TWinControl); override; + destructor Destroy; override; + procedure SetItemsCount(Count:Integer); override; + procedure NotifyUpdateItem(AItem: PcxRequestItem); override; + procedure NotifyRemoveItem(Index:Integer); override; + procedure NotifyAddItem(Index:Integer); override; + procedure ProcessItems(AIFolder: IShellFolder; APIDL: PItemIDList; + ANode: TTreeNode; cPreloadItems:Integer); reintroduce; overload; + function CheckUpdates:Boolean; + property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy; + end; + + PcxShellTreeItemProducer = ^TcxShellTreeItemProducer; + + { TcxShellTreeViewOptions } + + TcxShellTreeViewOptions = class(TcxShellOptions) + end; + + TcxShellTreeViewStateData = record + CurrentPath: PItemIDList; + ExpandedNodeList: TList; + TopItemIndex: Integer; + end; + + TcxCustomInnerShellTreeView = class(TTreeView, IUnknown, IcxDropTarget) + private + FComboBoxControl: TWinControl; + FContextPopupItemProducer: TcxShellTreeItemProducer; + FCurrentDropTarget: IcxDropTarget; + FDragDropSettings: TcxDragDropSettings; + FDraggedObject: IcxDataObject; + FInternalSmallImages:THandle; + FIsChangeNotificationCreationLocked: Boolean; + FIsUpdating: Boolean; + FItemProducersList: TThreadList; + FItemsInfoGatherer: TcxShellItemsInfoGatherer; + FListView: TcxCustomInnerShellListView; + FNavigation: Boolean; + FOptions: TcxShellTreeViewOptions; + FPrevTargetNode: TTreeNode; + FRoot: TcxShellTreeRoot; + FRootChanged: TcxRootChangedEvent; + FShellChangeNotificationCreation: Boolean; + FShellChangeNotifierData: TcxShellChangeNotifierData; + FShowInfoTips: Boolean; + FStateData: TcxShellTreeViewStateData; + FOnAddFolder: TcxShellAddFolderEvent; + FOnShellChange: TcxShellChangeEvent; + procedure SetPrevTargetNode(const Value: TTreeNode); + procedure ContextPopupItemProducerDestroyHandler(Sender: TObject); + function GetFolder(AIndex: Integer): TcxShellFolder; + function GetFolderCount: Integer; + function GetNodeFromItem(const Item: TTVItem): TTreeNode; + procedure RestoreTreeState; + procedure SaveTreeState; + procedure SetListView(Value: TcxCustomInnerShellListView); + procedure RootSettingsChanged(Sender: TObject); + procedure SetShowInfoTips(Value: Boolean); + procedure ShowToolTipChanged(Sender: TObject); + procedure DSMShellTreeChangeNotify(var Message: TMessage); message DSM_SHELLTREECHANGENOTIFY; + procedure DSMShellTreeRestoreCurrentPath(var Message: TMessage); + message DSM_SHELLTREERESTORECURRENTPATH; + procedure DSMSynchronizeRoot(var Message: TMessage); message DSM_SYNCHRONIZEROOT; + property CurrentDropTarget:IcxDropTarget read FCurrentDropTarget write FCurrentDropTarget; + property DraggedObject:IcxDataObject read FDraggedObject write FDraggedObject; + property ItemProducersList:TThreadList read FItemProducersList; + property Navigation:Boolean read FNavigation write FNavigation; + property PrevTargetNode:TTreeNode read FPrevTargetNode write SetPrevTargetNode; + protected + procedure AdjustControlParams; + procedure CreateWnd; override; + procedure DestroyWnd; override; + procedure Change(Node: TTreeNode); override; + function CanEdit(Node: TTreeNode): Boolean; override; + procedure Edit(const Item: TTVItem); override; + function CanExpand(Node: TTreeNode): Boolean; override; + procedure Delete(Node: TTreeNode); override; + procedure CreateParams(var Params: TCreateParams); override; + function IsLoading: Boolean; virtual; + procedure Loaded; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure DoContextPopup(MousePos: TPoint; var Handled: Boolean); override; + procedure CreateDropTarget; + procedure RemoveDropTarget; + procedure AddItemProducer(Producer:TcxShellTreeItemProducer); + procedure RemoveItemProducer(Producer:TcxShellTreeItemProducer); + procedure CreateChangeNotification(ANode: TTreeNode = nil); + function DoAddFolder(AFolder: TcxShellFolder): Boolean; + procedure DoBeginDrag; + procedure DoNavigateListView; + procedure DragDropSettingsChanged(Sender: TObject); virtual; + function GetNodeByPIDL(APIDL: PItemIDList): TTreeNode; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure RemoveChangeNotification; + function TryReleaseDropTarget:HResult; + procedure GetDropTarget(out New:Boolean;pt:TPoint); + procedure DsmSetCount(var Message:TMessage); message DSM_SETCOUNT; + procedure DsmNotifyUpdateItem(var Message:TMessage); message DSM_NOTIFYUPDATE; + procedure DsmNotifyRemoveItem(var Message:TMessage); message DSM_NOTIFYREMOVEITEM; + procedure DsmNotifyAddItem(var Message:TMessage); message DSM_NOTIFYADDITEM; + procedure DsmNotifyUpdateContents(var Message:TMessage); message DSM_NOTIFYUPDATECONTENTS; + procedure DsmShellChangeNotify(var Message:TMessage); message DSM_SHELLCHANGENOTIFY; + procedure DsmDoNavigate(var Message:TMessage); message DSM_DONAVIGATE; + procedure CNNotify(var Message: TWMNotify); message CN_NOTIFY; + // IcxDropTarget methods + function DragEnter(const dataObj: IDataObject; grfKeyState: Longint; + pt: TPoint; var dwEffect: Longint): HResult; stdcall; + function IcxDropTarget.DragOver=IDropTargetDragOver; + function IDropTargetDragOver(grfKeyState: Longint; pt: TPoint; + var dwEffect: Longint): HResult; stdcall; + function DragLeave: HResult; stdcall; + function Drop(const dataObj: IDataObject; grfKeyState: Longint; pt: TPoint; + var dwEffect: Longint): HResult; stdcall; + property ComboBoxControl: TWinControl read FComboBoxControl write FComboBoxControl; + property ItemsInfoGatherer: TcxShellItemsInfoGatherer read FItemsInfoGatherer; + property OnAddFolder: TcxShellAddFolderEvent read FOnAddFolder + write FOnAddFolder; + property OnShellChange: TcxShellChangeEvent read FOnShellChange write FOnShellChange; + public + constructor Create(AOwner:TComponent); override; + destructor Destroy; override; + procedure UpdateContent; + procedure UpdateNode(ANode:TTreeNode; AFast: Boolean); + property DragDropSettings:TcxDragDropSettings read FDragDropSettings write FDragDropSettings; + property FolderCount: Integer read GetFolderCount; + property Folders[AIndex: Integer]: TcxShellFolder read GetFolder; + property ListView:TcxCustomInnerShellListView read FListView write SetListView; + property Options: TcxShellTreeViewOptions read FOptions write FOptions; + property Root:TcxShellTreeRoot read FRoot write FRoot; + property ShowInfoTips: Boolean read FShowInfoTips write SetShowInfoTips default False; + property OnRootChanged:TcxRootChangedEvent read FRootChanged write FRootChanged; + end; + +implementation + +uses + Forms, ImgList, Math; + +type + TcxShellOptionsAccess = class(TcxShellOptions); + + PPItemIDList = ^PItemIDList; + +procedure DoShellChange(Sender: TObject; AEvent: TcxShellChangeEvent; + const Message: TMessage); forward; +function GetShellItemOverlayIndex( + AItemData: TcxShellItemInfo): Integer; forward; +procedure RegisterShellChangeNotifier(ANotifierPIDL: PItemIDList; AWnd: HWND; + ANotificationMsg: Cardinal; AWatchSubtree: Boolean; + var ANotifierData: TcxShellChangeNotifierData); forward; +procedure UnregisterShellChangeNotifier( + var ANotifierData: TcxShellChangeNotifierData); forward; + +procedure DoShellChange(Sender: TObject; AEvent: TcxShellChangeEvent; + const Message: TMessage); +begin + if Assigned(AEvent) then + AEvent(Sender, Message.LParam, PPItemIDList(Message.WParam)^, + PPItemIDList(Message.WParam + SizeOf(Pointer))^); +end; + +function GetShellItemOverlayIndex(AItemData: TcxShellItemInfo): Integer; +begin + if AItemData.IsLink then + Result := cxShellShortcutItemOverlayIndex + else + if AItemData.IsShare then + Result := cxShellSharedItemOverlayIndex + else + Result := cxShellNormalItemOverlayIndex; +end; + +procedure RegisterShellChangeNotifier(ANotifierPIDL: PItemIDList; AWnd: HWND; + ANotificationMsg: Cardinal; AWatchSubtree: Boolean; + var ANotifierData: TcxShellChangeNotifierData); +var + AItems: PSHChangeNotifyEntry; +begin + if EqualPIDLs(ANotifierData.PIDL, ANotifierPIDL) then + Exit; + UnregisterShellChangeNotifier(ANotifierData); + ANotifierData.PIDL := GetPidlCopy(ANotifierPIDL); + New(AItems); + try + AItems.pidlPath := ANotifierPIDL; + AItems.bWatchSubtree := AWatchSubtree; + ANotifierData.Handle := SHChangeNotifyRegister(AWnd, + SHCNF_ACCEPT_INTERRUPTS or SHCNF_ACCEPT_NON_INTERRUPTS, + SHCNE_RENAMEITEM or SHCNE_CREATE or SHCNE_DELETE or SHCNE_MKDIR or + SHCNE_RMDIR or SHCNE_ATTRIBUTES or SHCNE_UPDATEDIR or SHCNE_UPDATEITEM or + SHCNE_UPDATEIMAGE or SHCNE_RENAMEFOLDER, ANotificationMsg, 1, AItems); + finally + Dispose(AItems); + end; +end; + +procedure UnregisterShellChangeNotifier( + var ANotifierData: TcxShellChangeNotifierData); +begin + if ANotifierData.Handle <> 0 then + begin + SHChangeNotifyUnregister(ANotifierData.Handle); + ANotifierData.Handle := 0; + DisposePidl(ANotifierData.PIDL); + ANotifierData.PIDL := nil; + end; +end; + +{ TcxShellListViewOptions } + +constructor TcxShellListViewOptions.Create(AOwner: TWinControl); +begin + inherited Create(AOwner); + FAutoNavigate := True; +end; + +procedure TcxShellListViewOptions.Assign(Source: TPersistent); +begin + if Source is TcxShellListViewOptions then + AutoNavigate := TcxShellListViewOptions(Source).AutoNavigate; + inherited Assign(Source); +end; + +{ TcxCustomInnerShellListView } + +constructor TcxCustomInnerShellListView.Create(AOwner: TComponent); +var + AFileInfo: TShFileInfo; +begin + inherited Create(AOwner); + FDragDropSettings := TcxDragDropSettings.Create; + FDropTargetItemIndex := -1; + FFirstUpdateItem := -1; + FInternalLargeImages := SHGetFileInfo('C:\', 0, AFileInfo, SizeOf(AFileInfo), + SHGFI_SYSICONINDEX or SHGFI_LARGEICON); + FInternalSmallImages := SHGetFileInfo('C:\', 0, AFileInfo, SizeOf(AFileInfo), + SHGFI_SYSICONINDEX or SHGFI_SMALLICON); + FItemProducer := TcxShellListViewProducer.Create(Self); + FItemsInfoGatherer := TcxShellItemsInfoGatherer.Create(Self); + FLastUpdateItem := -1; + FOptions := TcxShellListViewOptions.Create(Self); + FRoot := TcxShellListRoot.Create(Self, 0); + FRoot.OnSettingsChanged := RootSettingsChanged; + DoubleBuffered := True; + DragMode := dmManual; + HideSelection := False; + OwnerData := True; +end; + +destructor TcxCustomInnerShellListView.Destroy; +begin + RemoveChangeNotification; + FreeAndNil(FDragDropSettings); + FreeAndNil(FItemProducer); + FreeAndNil(FItemsInfoGatherer); + FreeAndNil(FOptions); + FreeAndNil(FRoot); + inherited Destroy; +end; + +procedure TcxCustomInnerShellListView.BrowseParent; +var + APIDL: PItemIDList; +begin + APIDL := GetPidlParent(ItemProducer.FolderPidl); + try + Navigate(APIDL); + finally + DisposePidl(APIDL); + end; +end; + +function TcxCustomInnerShellListView.CanEdit(Item: TListItem): Boolean; +begin + Result := True; + if Item = nil then + Exit; + if Item.Index > ItemProducer.Items.Count - 1 then + begin + Result := False; + Exit; + end; + Result := TcxShellItemInfo(ItemProducer.Items[Item.Index]).CanRename; +end; + +procedure TcxCustomInnerShellListView.CheckUpdateItems; +begin + ItemProducer.ClearItems; + if IsWindow(WindowHandle) then + begin + if not Root.IsValid then + Items.Clear + else + if ItemProducer.Items.Count = 0 then + ItemProducer.ProcessItems(Root.ShellFolder, Root.Pidl, + PRELOAD_ITEMS_COUNT); + CreateChangeNotification; + Refresh; + end; +end; + +procedure TcxCustomInnerShellListView.CNNotify(var Message: TWMNotify); + + function GetOverlayIndex: Integer; + var + AItemData: TcxShellItemInfo; + begin + AItemData := ItemProducer.Items[PLVDispInfo(Message.NMHdr)^.item.iItem]; + AItemData.CheckUpdate(ItemProducer.ShellFolder, ItemProducer.FolderPidl, False); + Result := GetShellItemOverlayIndex(AItemData); + end; + +begin + if csDestroying in ComponentState then + Exit; + case Message.NMHdr^.code of + LVN_BEGINDRAG, LVN_BEGINRDRAG: + begin + if not DragDropSettings.AllowDragObjects then + begin + inherited; + Exit; + end; + if SelCount <= 0 then + Exit; + DoBeginDrag; + end; + LVN_GETINFOTIP: + ItemProducer.DoGetInfoTip(Handle, PNMLVGetInfoTip(Message.NMHdr)^.iItem, + PNMLVGetInfoTip(Message.NMHdr)^.pszText, + PNMLVGetInfoTip(Message.NMHdr)^.cchTextMax); + LVN_GETDISPINFO: + begin + inherited; + with PLVDispInfo(Message.NMHdr)^.item do + if (mask and LVIF_IMAGE <> 0) and (iSubItem = 0) then + if (iItem >= 0) and (iItem < ItemProducer.Items.Count) then + begin + state := IndexToOverlayMask(GetOverlayIndex + 1); + stateMask := ILD_OVERLAYMASK; + mask := mask or LVIF_STATE; + end; + end; + else + inherited; + end; +end; + +procedure TcxCustomInnerShellListView.CreateChangeNotification; +begin + if not Options.TrackShellChanges then + RemoveChangeNotification + else + RegisterShellChangeNotifier(ItemProducer.FolderPidl, Handle, + DSM_SHELLCHANGENOTIFY, False, FShellChangeNotifierData); +end; + +procedure TcxCustomInnerShellListView.CreateColumns; +var + i: Integer; + Column: TListColumn; +begin + if ListViewStyle <> lvsReport then + Exit; + Columns.BeginUpdate; + try + Columns.Clear; + for i := 0 to ItemProducer.Details.Count - 1 do + begin + Column := Columns.Add; + Column.Caption := ItemProducer.Details[i].Text; + Column.Alignment := ItemProducer.Details[i].Alignment; + Column.Width := ItemProducer.Details[i].Width; + end; + finally + Columns.EndUpdate; + end; +end; + +procedure TcxCustomInnerShellListView.CreateDropTarget; +var + AIDropTarget: IcxDropTarget; +begin + GetInterface(IcxDropTarget, AIDropTarget); + RegisterDragDrop(Handle,IDropTarget(AIDropTarget)); +end; + +procedure TcxCustomInnerShellListView.CreateWnd; +begin + inherited CreateWnd; + if HandleAllocated then + begin + if FInternalSmallImages <> 0 then + SendMessage(Handle, LVM_SETIMAGELIST, LVSIL_SMALL, LParam(FInternalSmallImages)); + if FInternalLargeImages <> 0 then + SendMessage(Handle, LVM_SETIMAGELIST, LVSIL_NORMAL, LParam(FInternalLargeImages)); + CreateDropTarget; + if Root.Pidl = nil then + Root.CheckRoot + else + CheckUpdateItems; + end; +end; + +procedure TcxCustomInnerShellListView.DblClick; +var + AItem: TcxShellItemInfo; +begin + if not Options.AutoNavigate or (Selected = nil) then + Exit; + ItemProducer.LockRead; + try + AItem := ItemProducer.Items[Selected.Index]; + if AItem.IsFolder then + DoProcessNavigation(AItem) + else + DoProcessDefaultCommand(AItem); + finally + ItemProducer.UnlockRead; + end; +end; + +procedure TcxCustomInnerShellListView.DestroyWnd; +begin + RemoveChangeNotification; + RemoveColumns; + RemoveDropTarget; + inherited DestroyWnd; +end; + +function TcxCustomInnerShellListView.DoAddFolder(AFolder: TcxShellFolder): Boolean; +begin + Result := True; + if Assigned(FOnAddFolder) then + FOnAddFolder(Self, AFolder, Result); +end; + +procedure TcxCustomInnerShellListView.DoAfterNavigation; +begin + if Assigned(AfterNavigation) then + AfterNavigation(Self, Root.Pidl, Root.CurrentPath); +end; + +function TcxCustomInnerShellListView.DoCompare(AItem1, AItem2: TcxShellFolder; + out ACompare: Integer): Boolean; +begin + Result := Assigned(FOnCompare); + if Result then + FOnCompare(Self, AItem1, AItem2, ACompare); +end; + +procedure TcxCustomInnerShellListView.DoBeforeNavigation(fqPidl: PItemIDList); +var + Desktop: IShellFolder; + tempPath: WideString; + StrName: TStrRet; +begin + if Failed(SHGetDesktopFolder(Desktop)) then + Exit; + if Succeeded(Desktop.GetDisplayNameOf(fqPidl, SHGDN_NORMAL or SHGDN_FORPARSING, StrName)) then + tempPath := GetTextFromStrRet(StrName, fqPidl) + else + tempPath := ''; + if Assigned(BeforeNavigation) then + BeforeNavigation(Self, fqPidl, tempPath); +end; + +procedure TcxCustomInnerShellListView.DoBeginDrag; +var + i: Integer; + tempList: TList; + pidlList: PItemIDList; + pDataObject: IDataObject; + pDropSource: IcxDropSource; + dwEffect: Integer; + Item: TListItem; +begin + tempList := TList.Create; + try + Item := Selected; + while Item <> nil do + begin + tempList.Add(GetPidlCopy(TcxShellItemInfo(ItemProducer.Items[Item.Index]).pidl)); + Item := GetNextItem(Item,sdAll,[isSelected]); + end; + pidlList := CreatePidlListFromList(tempList); + try + if Failed(ItemProducer.ShellFolder.GetUIObjectOf(Handle, SelCount, PItemIDList(pidlList^), IDataObject, nil, Pointer(pDataObject))) then + Exit; + pDropSource := TcxDropSource.Create(Self); + dwEffect := DragDropSettings.DropEffectAPI; + DoDragDrop(pDataObject, pDropSource, dwEffect, dwEffect); + finally + DisposePidl(pidlList); + end; + finally + try + for i := 0 to tempList.Count - 1 do + DisposePidl(tempList[i]); + finally + FreeAndNil(tempList); + end; + end; +end; + +procedure TcxCustomInnerShellListView.DoContextPopup(MousePos: TPoint; + var Handled: Boolean); +begin + if Options.ContextMenus and (SelCount > 0) then + begin + Handled := True; + ItemProducer.LockRead; + try + DisplayContextMenu(ClientToScreen(MousePos)); + finally + ItemProducer.UnlockRead; + end; + end + else + inherited DoContextPopup(MousePos, Handled); +end; + +procedure TcxCustomInnerShellListView.DoProcessDefaultCommand( + Item: TcxShellItemInfo); +var + fqPidl: PItemIDList; + lpExecInfo: PShellExecuteInfo; +begin + fqPidl := ConcatenatePidls(ItemProducer.FolderPidl,Item.pidl); + try + New(lpExecInfo); + try + ZeroMemory(lpExecInfo, SizeOf(TShellExecuteInfo)); + lpExecInfo.cbSize := SizeOf(TShellExecuteInfo); + lpExecInfo.fMask := SEE_MASK_INVOKEIDLIST; + lpExecInfo.Wnd := Handle; + lpExecInfo.lpIDList := fqPidl; + lpExecInfo.nShow := SW_SHOW; + ShellExecuteEx(lpExecInfo); + finally + Dispose(lpExecInfo); + end; + finally + DisposePidl(fqPidl); + end; +end; + +procedure TcxCustomInnerShellListView.DoProcessNavigation( + Item: TcxShellItemInfo); +var + APIDL: PItemIDList; +begin + if not Item.IsFolder then + Exit; + APIDL := ConcatenatePidls(ItemProducer.FolderPidl, Item.pidl); + try + Navigate(APIDL); + finally + DisposePidl(APIDL); + end; +end; + +function TcxCustomInnerShellListView.DragEnter(const dataObj: IDataObject; + grfKeyState: Integer; pt: TPoint; var dwEffect: Integer): HResult; +var + new: Boolean; +begin + DraggedObject := IcxDataObject(dataObj); + GetDropTarget(pt, new); + dwEffect := DragDropSettings.DefaultDropEffectAPI; + if CurrentDropTarget = nil then + begin + dwEffect := DROPEFFECT_NONE; + Result := S_OK; + end + else + Result := CurrentDropTarget.DragEnter(dataObj, grfKeyState, pt, dwEffect) +end; + +function TcxCustomInnerShellListView.DragLeave: HResult; +begin + DraggedObject := nil; + Result := TryReleaseDropTarget; +end; + +function TcxCustomInnerShellListView.IDropTargetDragOver(grfKeyState: Integer; pt: TPoint; + var dwEffect: Integer): HResult; +var + New: Boolean; +begin + GetDropTarget(pt, new); + if CurrentDropTarget = nil then + begin + dwEffect := DROPEFFECT_NONE; + Result := S_OK; + end + else + begin + if New then + Result := CurrentDropTarget.DragEnter(DraggedObject, grfKeyState, pt, dwEffect) + else + Result := S_OK; + if Succeeded(Result) then + Result := CurrentDropTarget.DragOver(grfKeyState, pt, dwEffect); + end; +end; + +function TcxCustomInnerShellListView.Drop(const dataObj: IDataObject; + grfKeyState: Integer; pt: TPoint; var dwEffect: Integer): HResult; +var + New: Boolean; +begin + GetDropTarget(pt, new); + if CurrentDropTarget = nil then + begin + dwEffect := DROPEFFECT_NONE; + Result := S_OK; + end + else + begin + if New then + Result := CurrentDropTarget.DragEnter(dataObj, grfKeyState, pt, dwEffect) + else + Result := S_OK; + if Succeeded(Result) then + Result := CurrentDropTarget.Drop(dataObj, grfKeyState, pt, dwEffect); + end; + DraggedObject := nil; + TryReleaseDropTarget; +end; + +procedure TcxCustomInnerShellListView.DsmNotifyUpdateContents( + var Message: TMessage); +begin + if not (csLoading in ComponentState) then + CheckUpdateItems; +end; + +procedure TcxCustomInnerShellListView.DsmNotifyUpdateItem( + var Message: TMessage); +begin + UpdateItems(Message.WParam, Message.WParam); +end; + +procedure TcxCustomInnerShellListView.DsmSetCount(var Message: TMessage); +begin + Items.Count := Message.WParam; + ItemFocused := nil; + Selected := nil; +end; + +procedure TcxCustomInnerShellListView.DsmShellChangeNotify( + var Message: TMessage); +begin + if FNotificationLock then + Exit; + FNotificationLock := True; + try + CheckUpdateItems; + finally + FNotificationLock := False; + end; + DoShellChange(Self, OnShellChange, Message); +end; + +procedure TcxCustomInnerShellListView.Edit(const Item: TLVItem); +var + tempItem: TcxShellItemInfo; + NewName: WideString; + pidlOut: PItemIDList; +begin + inherited; + if (ItemProducer.Items.Count - 1) < Item.iItem then + Exit; + tempItem := ItemProducer.Items[Item.iItem]; + NewName := StrPas(Item.pszText); + ItemProducer.ShellFolder.SetNameOf(Handle, tempItem.pidl, PWideChar(NewName), + SHGDN_INFOLDER or SHGDN_FORPARSING, pidlOut); + try + tempItem.SetNewPidl(ItemProducer.ShellFolder, ItemProducer.FolderPidl, pidlOut); + finally + DisposePidl(pidlOut); + end; +end; + +procedure TcxCustomInnerShellListView.KeyDown(var Key: Word; + Shift: TShiftState); +begin + inherited KeyDown(Key, Shift); + if not IsEditing then + case Key of + VK_RETURN: + DblClick; + VK_BACK: + if Options.AutoNavigate then + BrowseParent; + VK_F5: + UpdateContent; + end; +end; + +procedure TcxCustomInnerShellListView.DisplayContextMenu(const APos: TPoint); + + function GetItemPIDLList: TList; + var + AItem: TListItem; + AItemPIDL: PItemIDList; + begin + Result := TList.Create; + AItem := Selected; + while AItem <> nil do + begin + AItemPIDL := TcxShellItemInfo(ItemProducer.Items[AItem.Index]).pidl; + if AItemPIDL <> nil then + Result.Add(GetPidlCopy(AItemPIDL)); + AItem := GetNextItem(AItem, sdAll, [isSelected]); + end; + end; + +var + AItemPIDLList: TList; + I: Integer; +begin + if SelCount = 0 then + Exit; + + AItemPIDLList := GetItemPIDLList; + try + cxShellCommon.DisplayContextMenu(Handle, ItemProducer.ShellFolder, + AItemPIDLList, APos); + finally + for I := 0 to AItemPIDLList.Count - 1 do + DisposePidl(AItemPIDLList[I]); + AItemPIDLList.Free; + end; +end; + +procedure TcxCustomInnerShellListView.Loaded; +begin + inherited Loaded; + if csDesigning in ComponentState then + Root.RootUpdated; +end; + +procedure TcxCustomInnerShellListView.GetDropTarget(pt: TPoint; + out New: Boolean); + + function GetDropTargetItemIndex: Integer; + var + AItem: TListItem; + P: TPoint; + begin + Result := -1; + P := ScreenToClient(pt); + AItem := GetItemAt(P.X, P.Y); + if AItem <> nil then + Result := AItem.Index; + end; + +var + AItemIndex: Integer; + tempDropTarget: IcxDropTarget; + tempPidl: PItemIDList; +begin + AItemIndex := GetDropTargetItemIndex; + if AItemIndex = -1 then + begin // There are no items selected, so drop target is current opened folder + if (DropTargetItemIndex = -1) and (CurrentDropTarget <> nil) then + begin + New := False; + Exit; + end; + TryReleaseDropTarget; + New := True; + if Failed(ItemProducer.ShellFolder.CreateViewObject(Handle,IDropTarget, tempDropTarget)) then + Exit; + CurrentDropTarget := tempDropTarget; + end + else + begin // Use one of Items as Drop Target + if AItemIndex = DropTargetItemIndex then + begin + New := False; + Exit; + end; + TryReleaseDropTarget; + New := True; + tempPidl := GetPidlCopy(TcxShellItemInfo(ItemProducer.Items[AItemIndex]).pidl); + try + if Failed(ItemProducer.ShellFolder.GetUIObjectOf(Handle, 1, tempPidl, IDropTarget, nil, tempDropTarget)) then + Exit; + finally + DisposePidl(tempPidl); + end; + CurrentDropTarget := tempDropTarget; + DropTargetItemIndex := AItemIndex; + end; +end; + +procedure TcxCustomInnerShellListView.Navigate(APIDL: PItemIDList); +begin + if EqualPIDLs(APIDL, ItemProducer.FolderPidl) then + Exit; + Items.BeginUpdate; + try + DoBeforeNavigation(APIDL); + Root.Pidl := APIDL; + DoNavigateTreeView; + DoAfterNavigation; + finally + Items.EndUpdate; + end; +end; + +function TcxCustomInnerShellListView.OwnerDataFetch(Item: TListItem; + Request: TItemRequest): Boolean; +var + ShellItem: TcxShellItemInfo; + i: Integer; +begin + Result := True; + ItemProducer.LockRead; + try + if Item.Index >= ItemProducer.Items.Count then + Exit; + ShellItem := ItemProducer.Items[Item.Index]; + ShellItem.CheckUpdate(ItemProducer.ShellFolder, ItemProducer.FolderPidl, False); + Item.Caption := ShellItem.Name; + Item.ImageIndex := ShellItem.IconIndex; + if ListViewStyle = lvsReport then + begin + if ShellItem.Details.Count = 0 then + ShellItem.FetchDetails(Handle, ItemProducer.ShellFolder, ItemProducer.Details); + for i := 0 to ShellItem.Details.Count - 1 do + Item.SubItems.Add(ShellItem.Details[i]); + end; + Item.Cut := ShellItem.IsGhosted; + if not ShellItem.Updated then + ItemProducer.FetchRequest(Item.Index, True); + finally + ItemProducer.UnlockRead; + end; + Result := inherited OwnerDataFetch(Item, Request); +end; + +procedure TcxCustomInnerShellListView.RemoveChangeNotification; +begin + UnregisterShellChangeNotifier(FShellChangeNotifierData); +end; + +procedure TcxCustomInnerShellListView.RemoveColumns; +begin + Columns.Clear; +end; + +procedure TcxCustomInnerShellListView.RemoveDropTarget; +begin + RevokeDragDrop(Handle); +end; + +procedure TcxCustomInnerShellListView.SetDropTargetItemIndex(Value: Integer); +begin + if FDropTargetItemIndex <> -1 then + Items[FDropTargetItemIndex].DropTarget := False; + FDropTargetItemIndex := Value; + if FDropTargetItemIndex <> -1 then + Items[FDropTargetItemIndex].DropTarget := True; +end; + +procedure TcxCustomInnerShellListView.DSMSynchronizeRoot(var Message: TMessage); +begin + if not((Parent <> nil) and (csLoading in Parent.ComponentState)) then + Root.Update(TcxCustomShellRoot(Message.WParam)); +end; + +function TcxCustomInnerShellListView.GetFolder(AIndex: Integer): TcxShellFolder; +begin + Result := TcxShellItemInfo(ItemProducer.Items[AIndex]).Folder; +end; + +function TcxCustomInnerShellListView.GetFolderCount: Integer; +begin + Result := Items.Count; +end; + +procedure TcxCustomInnerShellListView.RootSettingsChanged(Sender: TObject); +begin + if (Parent <> nil) and (csLoading in Parent.ComponentState) then + Exit; + if (FTreeViewControl <> nil) and FTreeViewControl.HandleAllocated then + SendMessage(FTreeViewControl.Handle, DSM_SYNCHRONIZEROOT, Integer(Root), 0); + if (FComboBoxControl <> nil) and FComboBoxControl.HandleAllocated then + SendMessage(FComboBoxControl.Handle, DSM_SYNCHRONIZEROOT, Integer(Root), 0); +end; + +procedure TcxCustomInnerShellListView.SetListViewStyle( + const Value: TcxListViewStyle); +begin + if FListViewStyle <> Value then + begin + FListViewStyle := Value; + case FListViewStyle of + lvsIcon: ViewStyle:=vsIcon; + lvsSmallIcon: ViewStyle:=vsSmallIcon; + lvsList: ViewStyle:=vsList; + lvsReport: ViewStyle:=vsReport; + end; + CheckUpdateItems; + end; +end; + +function TcxCustomInnerShellListView.TryReleaseDropTarget:HResult; +begin + Result := S_OK; + if CurrentDropTarget <> nil then + Result := CurrentDropTarget.DragLeave; + CurrentDropTarget := nil; + DropTargetItemIndex := -1; +end; + +procedure TcxCustomInnerShellListView.SetTreeView(ATreeView: TWinControl); +begin + TreeViewControl := ATreeView; +end; + +var + NavigationLock: Boolean; + +procedure TcxCustomInnerShellListView.DoNavigateTreeView; +var + tempPidl: PItemIDList; +begin + if NavigationLock or (not Assigned(TreeViewControl) and not Assigned(ComboBoxControl)) then + Exit; + + tempPidl:=GetPidlCopy(Root.Pidl); + try + if Assigned(TreeViewControl) and (TreeViewControl.Parent <> nil) then + begin + TreeViewControl.HandleNeeded; + SendMessage(TreeViewControl.Handle,DSM_DONAVIGATE,WPARAM(tempPidl),0); + end; + if Assigned(ComboBoxControl) and (ComboBoxControl.Parent <> nil) then + begin + ComboBoxControl.HandleNeeded; + SendMessage(ComboBoxControl.Handle,DSM_DONAVIGATE,WPARAM(tempPidl),0); + end; + finally + DisposePidl(tempPidl); + end; +end; + +procedure TcxCustomInnerShellListView.ProcessTreeViewNavigate( + APIDL: PItemIDList); + + function IsFolder(APIDL: PItemIDList): Boolean; + const + SHGFI_ATTR_SPECIFIED = $20000; + var + ASHFileInfo: TSHFileInfo; + begin + ASHFileInfo.dwAttributes := SFGAO_FOLDER; + SHGetFileInfo(Pointer(APIDL), 0, ASHFileInfo, SizeOf(ASHFileInfo), + SHGFI_PIDL or SHGFI_ATTR_SPECIFIED or SHGFI_ATTRIBUTES); + Result := ASHFileInfo.dwAttributes and SFGAO_FOLDER <> 0; + end; + +begin + NavigationLock := True; + try + if IsFolder(APIDL) and not EqualPIDLs(APIDL, Root.Pidl) then + Root.Pidl := APIDL; + finally + NavigationLock := False; + end; +end; + +procedure TcxCustomInnerShellListView.UpdateContent; +var + AItemIndex: Integer; + ASelectedItemPID: PItemIDList; +begin + ASelectedItemPID := nil; + try + if not MultiSelect and (Selected <> nil) then + ASelectedItemPID := GetPidlCopy( + TcxShellItemInfo(ItemProducer.Items[Selected.Index]).pidl); + CheckUpdateItems; + if ASelectedItemPID <> nil then + begin + AItemIndex := ItemProducer.GetItemIndexByPidl(ASelectedItemPID); + if (AItemIndex >= 0) and (AItemIndex < Items.Count) then + Items[AItemIndex].Selected := True; + end; + finally + DisposePidl(ASelectedItemPID); + end; +end; + +{ TcxShellListRoot } + +procedure TcxShellListRoot.RootUpdated; +begin + inherited RootUpdated; + (Owner as TcxCustomInnerShellListView).CheckUpdateItems; + if Assigned(TcxCustomInnerShellListView(Owner).OnRootChanged) then + TcxCustomInnerShellListView(Owner).OnRootChanged(Owner, Self); +end; + +{ TcxShellListViewProducer } + +function TcxShellListViewProducer.AllowBackgroundProcessing: Boolean; +begin + Result := True; +end; + +function TcxShellListViewProducer.CanAddFolder(AFolder: TcxShellFolder): Boolean; +begin + Result := ListView.DoAddFolder(AFolder); +end; + +function TcxShellListViewProducer.DoCompareItems(AItem1, AItem2: TcxShellFolder; + out ACompare: Integer): Boolean; +begin + Result := ListView.DoCompare(AItem1, AItem2, ACompare); +end; + +function TcxShellListViewProducer.GetEnumFlags: Cardinal; +begin + Result := ListView.Options.GetEnumFlags; +end; + +function TcxShellListViewProducer.GetItemsInfoGatherer: TcxShellItemsInfoGatherer; +begin + Result := ListView.ItemsInfoGatherer; +end; + +function TcxShellListViewProducer.GetShowToolTip: Boolean; +begin + Result := ListView.Options.ShowToolTip; +end; + +function TcxShellListViewProducer.GetListView: TcxCustomInnerShellListView; +begin + Result := TcxCustomInnerShellListView(Owner); +end; + +procedure TcxShellListViewProducer.NotifyUpdateItem(AItem: PcxRequestItem); +begin + if AItem.Priority and Owner.HandleAllocated and (AItem.ItemIndex >= 0) and + (AItem.ItemIndex < Items.Count) then + PostMessage(Owner.Handle, DSM_NOTIFYUPDATE, AItem.ItemIndex, 0); +end; + +procedure TcxShellListViewProducer.ProcessDetails(ShellFolder: IShellFolder; + CharWidth: Integer); +begin + inherited ProcessDetails(ShellFolder, ListView.StringWidth('X')); + ListView.CreateColumns; +end; + +{ TcxShellTreeRoot } + +procedure TcxShellTreeRoot.RootUpdated; +begin + inherited RootUpdated; +// TcxCustomInnerShellTreeView(Owner).ItemsInfoGatherer.ClearFetchQueue(nil); + TcxCustomInnerShellTreeView(Owner).Items.Clear; + TcxCustomInnerShellTreeView(Owner).UpdateNode(nil, False); + if Assigned(TcxCustomInnerShellTreeView(Owner).OnRootChanged) then + TcxCustomInnerShellTreeView(Owner).OnRootChanged(Owner, Self); +end; + +{ TcxCustomInnerShellTreeView } + +procedure TcxCustomInnerShellTreeView.AddItemProducer( + Producer: TcxShellTreeItemProducer); +var + tempList: TList; +begin + tempList := ItemProducersList.LockList; + try + tempList.Add(Producer); + finally + ItemProducersList.UnlockList; + end; +end; + +function TcxCustomInnerShellTreeView.CanEdit(Node: TTreeNode): Boolean; +var + ItemProducer:TcxShellTreeItemProducer; +begin + Result := False; + if Node.Parent = nil then + Exit; + ItemProducer := TcxShellTreeItemProducer(Node.Parent.Data); + ItemProducer.LockRead; + try + if (ItemProducer.Items.Count - 1) < Node.Index then + Exit; + Result := TcxShellItemInfo(ItemProducer.Items[Node.Index]).CanRename; + Result := Result and inherited CanEdit(Node); + finally + ItemProducer.UnlockRead; + end; +end; + +function TcxCustomInnerShellTreeView.CanExpand(Node: TTreeNode): Boolean; +var + ItemProducer: TcxShellTreeItemProducer; + processingPidl: PItemIDList; + processingFolder: IShellFolder; + begin + Result := True; + if Node.GetFirstChild = nil then + begin + if Node.Parent <> nil then + begin + ItemProducer := TcxShellTreeItemProducer(Node.Parent.Data); + Result := TcxShellItemInfo(ItemProducer.Items[Node.Index]).IsFolder; + Node.HasChildren := Result; + if not Result then + Exit; + if (ItemProducer.Items.Count-1) < Node.Index then + begin + Result := False; + Exit; + end; + if Failed(ItemProducer.ShellFolder.BindToObject(TcxShellItemInfo(ItemProducer. + Items[Node.Index]).pidl, nil, IID_IShellFolder, processingFolder)) then + begin + Result := False; + Exit; + end; + processingPidl := ConcatenatePidls(ItemProducer.FolderPidl, + TcxShellItemInfo(ItemProducer.Items[Node.Index]).pidl); + end + else + begin + processingFolder := Root.ShellFolder; + processingPidl := GetPidlCopy(Root.Pidl); + end; + try + ItemProducer := TcxShellTreeItemProducer(Node.Data); + ItemProducer.ProcessItems(processingFolder, processingPidl, Node, 0); + finally + DisposePidl(processingPidl); + end; + end; + Result := Result and inherited CanExpand(Node); +end; + +procedure TcxCustomInnerShellTreeView.CNNotify(var Message: TWMNotify); +var + tempNode: TTreeNode; + ItemProducer: TcxShellTreeItemProducer; +begin + if (Message.NMHdr^.code = TVN_BEGINDRAG) or + (Message.NMHdr^.code = TVN_BEGINRDRAG) then + begin + with PNMTreeView(Message.NMHdr)^ do + Selected := GetNodeFromItem(ItemNew); + DoBeginDrag; + end + else + if Message.NMHdr^.code = TVN_GETINFOTIP then + begin + tempNode := Items.GetNode(PNMTVGetInfoTip(Message.NMHdr)^.hItem); + if (tempNode <> nil) and (tempNode.Parent <> nil) then + begin + ItemProducer := TcxShellTreeItemProducer(tempNode.Parent.Data); + ItemProducer.DoGetInfoTip(Handle,tempNode.Index, + PNMTVGetInfoTip(Message.NMHdr)^.pszText, + PNMTVGetInfoTip(Message.NMHdr)^.cchTextMax); + end; + end + else + inherited; +end; + +constructor TcxCustomInnerShellTreeView.Create(AOwner: TComponent); +var + FileInfo: TShFileInfo; +begin + inherited; + FItemsInfoGatherer := TcxShellItemsInfoGatherer.Create(Self); + FRoot:=TcxShellTreeRoot.Create(Self, 0); + FRoot.OnSettingsChanged := RootSettingsChanged; + FDragDropSettings := TcxDragDropSettings.Create; + FDragDropSettings.OnChange := DragDropSettingsChanged; + FOptions := TcxShellTreeViewOptions.Create(Self); + TcxShellOptionsAccess(FOptions).OnShowToolTipChanged := ShowToolTipChanged; + FItemProducersList := TThreadList.Create; + FInternalSmallImages := SHGetFileInfo('C:\', 0, FileInfo, SizeOf(FileInfo), + SHGFI_SYSICONINDEX or SHGFI_SMALLICON); + CurrentDropTarget := nil; + PrevTargetNode := nil; + DraggedObject := nil; + DoubleBuffered := True; + DragMode := dmAutomatic; + RightClickSelect := True; +end; + +procedure TcxCustomInnerShellTreeView.CreateDropTarget; +var + AIDropTarget: IcxDropTarget; +begin + GetInterface(IcxDropTarget, AIDropTarget); + RegisterDragDrop(Handle,IDropTarget(AIDropTarget)); +end; + +procedure TcxCustomInnerShellTreeView.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + if ShowInfoTips then + Params.Style := (Params.Style or TVS_INFOTIP) and not TVS_NOTOOLTIPS; +end; + +function TcxCustomInnerShellTreeView.IsLoading: Boolean; +begin + Result := csLoading in ComponentState; +end; + +procedure TcxCustomInnerShellTreeView.AdjustControlParams; +var + AStyle: Longint; +begin + if HandleAllocated then + begin + AStyle := GetWindowLong(Handle, GWL_STYLE) and not(TVS_INFOTIP) or TVS_NOTOOLTIPS; + if ShowInfoTips or Options.ShowToolTip then + AStyle := AStyle and not TVS_NOTOOLTIPS; + if ShowInfoTips then + AStyle := AStyle or TVS_INFOTIP; + SetWindowLong(Handle, GWL_STYLE, AStyle); + end; +end; + +procedure TcxCustomInnerShellTreeView.CreateWnd; +begin + inherited; + if HandleAllocated then + begin + if FInternalSmallImages <> 0 then + SendMessage(Handle, TVM_SETIMAGELIST, TVSIL_NORMAL, LParam(FInternalSmallImages)); + if not IsLoading and (Root.Pidl = nil) then + Root.CheckRoot; + UpdateNode(nil, False); + CreateDropTarget; + end; +end; + +procedure TcxCustomInnerShellTreeView.Delete(Node: TTreeNode); +var + ItemProducer: TcxShellTreeItemProducer; +begin + ItemProducer := TcxShellTreeItemProducer(Node.Data); + if ItemProducer <> nil then + begin + ItemProducer.Free; + Node.Data := nil; + end; + inherited; +end; + +destructor TcxCustomInnerShellTreeView.Destroy; +var + AList: TList; + I: Integer; +begin + if FListView <> nil then + FListView.SetTreeView(nil); + + RemoveChangeNotification; + + AList := FItemProducersList.LockList; + try + for I := 0 to AList.Count - 1 do + TcxShellTreeItemProducer(AList[I]).ClearFetchQueue; + finally + FItemProducersList.UnlockList; + end; + + Items.Clear; + FreeAndNil(FItemProducersList); + FreeAndNil(FOptions); + FreeAndNil(FDragDropSettings); + FreeAndNil(FRoot); + FreeAndNil(FItemsInfoGatherer); + inherited Destroy; +end; + +procedure TcxCustomInnerShellTreeView.UpdateContent; +begin + if HandleAllocated then + begin + if Root.ShellFolder = nil then + Root.CheckRoot; + SendMessage(Handle, DSM_SHELLTREECHANGENOTIFY, WPARAM(Root.Pidl), 0); + end; +end; + +procedure TcxCustomInnerShellTreeView.DestroyWnd; +begin + RemoveChangeNotification; + RemoveDropTarget; + CreateWndRestores := False; + inherited; +end; + +procedure TcxCustomInnerShellTreeView.DoBeginDrag; +var + ItemProducer: TcxShellTreeItemProducer; + tempPidl: PItemIDList; + pDataObject: IDataObject; + pDropSource: IcxDropSource; + dwEffect: Integer; +begin + if Selected.Parent = nil then + Exit; + ItemProducer := TcxShellTreeItemProducer(Selected.Parent.Data); + ItemProducer.LockRead; + try + if (ItemProducer.Items.Count-1) < Selected.Index then + Exit; + tempPidl:=GetPidlCopy(TcxShellItemInfo(ItemProducer.Items[Selected.Index]).pidl); + try + if Failed(ItemProducer.ShellFolder.GetUIObjectOf(Handle, 1, tempPidl, IDataObject, nil, pDataObject)) then + Exit; + pDropSource := TcxDropSource.Create(Self); + dwEffect := DragDropSettings.DropEffectAPI; + DoDragDrop(pDataObject, pDropSource, dwEffect, dwEffect); + if not TcxShellTreeItemProducer(Selected.Parent.Data).CheckUpdates then + UpdateNode(Selected.Parent, False); + finally + DisposePidl(tempPidl); + end; + finally + ItemProducer.UnlockRead; + end; +end; + +procedure TcxCustomInnerShellTreeView.DoContextPopup(MousePos: TPoint; + var Handled: Boolean); +var + AItem: TcxShellItemInfo; + AItemPIDLList: TList; + ANode: TTreeNode; +begin + try + ANode := GetNodeAt(MousePos.X, MousePos.Y); + if not Options.ContextMenus or (ANode = nil) then + begin + inherited DoContextPopup(MousePos, Handled); + Exit; + end; + Handled := True; + if ANode.Parent = nil then + Exit; + + FContextPopupItemProducer := TcxShellTreeItemProducer(ANode.Parent.Data); + FContextPopupItemProducer.OnDestroy := ContextPopupItemProducerDestroyHandler; + FContextPopupItemProducer.LockRead; + try + CreateChangeNotification(ANode); + AItem := FContextPopupItemProducer.Items[ANode.Index]; + FIsChangeNotificationCreationLocked := True; + if AItem.pidl <> nil then + begin + AItemPIDLList := TList.Create; + try + AItemPIDLList.Add(GetPidlCopy(AItem.pidl)); + cxShellCommon.DisplayContextMenu(Handle, FContextPopupItemProducer.ShellFolder, + AItemPIDLList, ClientToScreen(MousePos)); + finally + DisposePidl(AItemPIDLList[0]); + AItemPIDLList.Free; + end; + end; + finally + if FContextPopupItemProducer <> nil then + FContextPopupItemProducer.UnlockRead; + end; + finally + FIsChangeNotificationCreationLocked := False; + if FContextPopupItemProducer <> nil then + begin + FContextPopupItemProducer.OnDestroy := nil; + FContextPopupItemProducer := nil; + end; + end; +end; + +function TcxCustomInnerShellTreeView.DragEnter(const dataObj: IDataObject; + grfKeyState: Integer; pt: TPoint; var dwEffect: Integer): HResult; +var + New: Boolean; +begin + DraggedObject := IcxDataObject(dataObj); + GetDropTarget(new, pt); + dwEffect := DragDropSettings.DefaultDropEffectAPI; + if CurrentDropTarget = nil then + begin + dwEffect := DROPEFFECT_NONE; + Result := S_OK; + end + else + Result := CurrentDropTarget.DragEnter(dataObj, grfKeyState, pt, dwEffect) +end; + +function TcxCustomInnerShellTreeView.DragLeave: HResult; +begin + DraggedObject := nil; + Result := TryReleaseDropTarget; +end; + +function TcxCustomInnerShellTreeView.IDropTargetDragOver(grfKeyState: Integer; pt: TPoint; + var dwEffect: Integer): HResult; +var + New: Boolean; +begin + GetDropTarget(new, pt); + if CurrentDropTarget = nil then + begin + dwEffect := DROPEFFECT_NONE; + Result := S_OK; + end + else + begin + if New then + Result := CurrentDropTarget.DragEnter(DraggedObject, grfKeyState, pt, dwEffect) + else + Result := S_OK; + if Succeeded(Result) then + Result := CurrentDropTarget.DragOver(grfKeyState, pt, dwEffect); + end; +end; + +function TcxCustomInnerShellTreeView.Drop(const dataObj: IDataObject; + grfKeyState: Integer; pt: TPoint; var dwEffect: Integer): HResult; +var + New: Boolean; +begin + GetDropTarget(new, pt); + if CurrentDropTarget = nil then + begin + dwEffect := DROPEFFECT_NONE; + Result := S_OK; + end + else + begin + if New then + Result := CurrentDropTarget.DragEnter(dataObj, grfKeyState, pt, dwEffect) + else + Result := S_OK; + if Succeeded(Result) then + Result := CurrentDropTarget.Drop(dataObj, grfKeyState, pt, dwEffect); + end; + PostMessage(Handle, DSM_SHELLCHANGENOTIFY, WPARAM(PrevTargetNode.Data), 0); + TryReleaseDropTarget; +end; + +procedure TcxCustomInnerShellTreeView.DsmNotifyAddItem(var Message: TMessage); +var + Node, NewNode: TTreeNode; + ItemProducer: TcxShellTreeItemProducer; + tempShellItem: TcxShellItemInfo; +begin + Node := TTreeNode(Message.LParam); + ItemProducer := TcxShellTreeItemProducer(Node.Data); + ItemProducer.LockRead; + try + tempShellItem := ItemProducer.Items[Message.WParam]; + NewNode := Items.AddChild(Node, tempShellItem.Name); + NewNode.Data := TcxShellTreeItemProducer.Create(Self); + NewNode.ImageIndex := tempShellItem.IconIndex; + NewNode.SelectedIndex := tempShellItem.OpenIconIndex; + NewNode.HasChildren := tempShellItem.HasSubfolder; + finally + ItemProducer.UnlockRead; + end; +end; + +procedure TcxCustomInnerShellTreeView.DsmNotifyRemoveItem( + var Message: TMessage); +var + Node: TTreeNode; +begin + Node := TTreeNode(Message.LParam); + if Message.WParam < Node.Count then + Node.Item[Message.WParam].Delete; +end; + +procedure TcxCustomInnerShellTreeView.DsmNotifyUpdateContents( + var Message: TMessage); +begin + if not (csLoading in ComponentState) then + UpdateNode(nil, False); +end; + +procedure TcxCustomInnerShellTreeView.DsmNotifyUpdateItem( + var Message: TMessage); + + function GetChildNode(ANode: TTreeNode; AIndex: Integer): TTreeNode; + begin + Result := ANode.getFirstChild; + while (Result <> nil) and (AIndex > 0) do + begin + Result := ANode.GetNextChild(Result); + Dec(AIndex); + end; + end; + +var + AItem: TcxShellItemInfo; + AItemProducer: TcxShellTreeItemProducer; + ANode, ATempNode: TTreeNode; +begin + ANode := TTreeNode(Message.LParam); + if ANode.getFirstChild = nil then + Exit; + ATempNode := GetChildNode(ANode, Message.WParam); + if ATempNode = nil then + Exit; + + AItemProducer := TcxShellTreeItemProducer(ANode.Data); + AItemProducer.LockRead; + try + AItem := AItemProducer.Items[Message.WParam]; + ATempNode.ImageIndex := AItem.IconIndex; + ATempNode.SelectedIndex := AItem.OpenIconIndex; + ATempNode.Text := AItem.Name; + ATempNode.HasChildren := AItem.HasSubfolder; + ATempNode.Cut := AItem.IsGhosted; + ATempNode.OverlayIndex := GetShellItemOverlayIndex(AItem); + finally + AItemProducer.UnlockRead; + end; +end; + +procedure TcxCustomInnerShellTreeView.DsmSetCount(var Message: TMessage); +var + Node: TTreeNode; + ItemProducer: TcxShellTreeItemProducer; + i: Integer; + NewNode: TTreeNode; + tempShellItem: TcxShellItemInfo; +begin + Node := TTreeNode(Message.LParam); + if Message.WParam = 0 then + begin + Node.DeleteChildren; + Node.HasChildren := False; + Exit; + end; + ItemProducer := TcxShellTreeItemProducer(Node.Data); + ItemProducer.LockRead; + try + Items.BeginUpdate; + try + for i := 0 to ItemProducer.Items.Count-1 do + begin + tempShellItem := ItemProducer.Items[i]; + if not tempShellItem.Updated then + ItemProducer.FetchRequest(i, False); + NewNode := Items.AddChild(Node, tempShellItem.Name); + NewNode.Data := TcxShellTreeItemProducer.Create(Self); + NewNode.ImageIndex := tempShellItem.IconIndex; + NewNode.SelectedIndex := tempShellItem.OpenIconIndex; + NewNode.HasChildren := tempShellItem.HasSubfolder; + NewNode.Cut := tempShellItem.IsGhosted; + NewNode.OverlayIndex := GetShellItemOverlayIndex(tempShellItem); + end; + finally + Items.EndUpdate; + end; + if Node.GetFirstChild = nil then + Node.HasChildren := False; + finally + ItemProducer.UnlockRead; + end; +end; + +procedure TcxCustomInnerShellTreeView.DsmShellChangeNotify( + var Message: TMessage); +begin + Sleep(100); + if not TcxShellTreeItemProducer(Message.WParam).CheckUpdates then + UpdateNode(PrevTargetNode, False); +end; + +procedure TcxCustomInnerShellTreeView.Edit(const Item: TTVItem); +var + AItemInfo: TcxShellItemInfo; + AItemProducer: TcxShellTreeItemProducer; + ANode: TTreeNode; + APIDL: PItemIDList; + APrevNodeText: string; +begin + ANode := GetNodeFromItem(Item); + APrevNodeText := ''; + if ANode <> nil then + APrevNodeText := ANode.Text; + inherited Edit(Item); + if (Item.pszText = nil) or (ANode = nil) or (ANode.Parent = nil) then + Exit; + AItemProducer := TcxShellTreeItemProducer(ANode.Parent.Data); + AItemInfo := AItemProducer.Items[ANode.Index]; + RemoveChangeNotification; + if AItemProducer.ShellFolder.SetNameOf(Handle, AItemInfo.pidl, PWideChar(WideString(ANode.Text)), + SHGDN_INFOLDER or SHGDN_FORPARSING, APIDL) = S_OK then + try + AItemInfo.SetNewPidl(AItemProducer.ShellFolder, AItemProducer.FolderPidl, APIDL); + finally + DisposePidl(APIDL); + end + else + ANode.Text := APrevNodeText; +end; + +procedure TcxCustomInnerShellTreeView.GetDropTarget(out New: Boolean;pt:TPoint); +var + Node: TTreeNode; + cpt: TPoint; + ItemProducer: TcxShellTreeItemProducer; + tempDropTarget: IcxDropTarget; + tempShellItem: TcxShellItemInfo; + tempPidl: PItemIDList; + Res: HRESULT; + tempShellFolder: IShellFolder; +begin + cpt := ScreenToClient(pt); + Node := GetNodeAt(cpt.X, cpt.Y); + if Node = nil then + begin + TryReleaseDropTarget; + Exit; + end; + if (Node = PrevTargetNode) and (CurrentDropTarget <> nil) then + begin + New := False; + Exit; + end; + TryReleaseDropTarget; + New := True; + if Node.Parent = nil then + begin // Root object selected + ItemProducer := TcxShellTreeItemProducer(Node.Data); + if ItemProducer.ShellFolder = nil then + Exit; + Res:=ItemProducer.ShellFolder.CreateViewObject(Handle, IDropTarget, tempDropTarget); + if Failed(Res) then + Exit; + end + else + begin // Non-root object selected + ItemProducer := TcxShellTreeItemProducer(Node.Parent.Data); + tempShellItem := ItemProducer.Items[Node.Index]; + tempPidl := GetPidlCopy(tempShellItem.pidl); + try + if tempShellItem.IsFolder then + begin + if Failed(ItemProducer.ShellFolder.BindToObject(tempPidl, nil, IID_IShellFolder, tempShellFolder)) then + Exit; + if Failed(tempShellFolder.CreateViewObject(Handle, IDropTarget, tempDropTarget)) then + Exit; + end + else + begin + Res := ItemProducer.ShellFolder.GetUIObjectOf(Handle, 1, tempPidl, IDropTarget, nil, tempDropTarget); + if Failed(Res) then + Exit; + end; + finally + DisposePidl(tempPidl); + end; + end; + + PrevTargetNode := Node; + CurrentDropTarget := tempDropTarget; +end; + +procedure TcxCustomInnerShellTreeView.ContextPopupItemProducerDestroyHandler( + Sender: TObject); +begin + FContextPopupItemProducer.UnlockRead; + FContextPopupItemProducer.OnDestroy := nil; + FContextPopupItemProducer := nil; +end; + +function TcxCustomInnerShellTreeView.GetFolder(AIndex: Integer): TcxShellFolder; +var + ANode: TTreeNode; +begin + ANode := Items[AIndex]; + if ANode.Parent = nil then + Result := Root.Folder + else + Result := TcxShellItemInfo(TcxShellTreeItemProducer(ANode.Parent.Data).Items[ANode.Index]).Folder; +end; + +function TcxCustomInnerShellTreeView.GetFolderCount: Integer; +begin + Result := Items.Count; +end; + +function TcxCustomInnerShellTreeView.GetNodeFromItem( + const Item: TTVItem): TTreeNode; +begin + Result := nil; + if Items <> nil then + with Item do + if (state and TVIF_PARAM) <> 0 then + Result := Pointer(lParam) + else + Result := Items.GetNode(hItem); +end; + +procedure TcxCustomInnerShellTreeView.RestoreTreeState; + + procedure RestoreExpandedNodes; + + procedure ExpandNode(APIDL: PItemIDList); + var + ANode: TTreeNode; + begin + if Root.ShellFolder = nil then + Root.CheckRoot; + if APIDL = nil then + APIDL := Root.Pidl; + ANode := GetNodeByPIDL(APIDL); + if ANode <> nil then + ANode.Expand(False); + end; + + procedure DestroyExpandedNodeList; + var + I: Integer; + begin + if FStateData.ExpandedNodeList = nil then + Exit; + for I := 0 to FStateData.ExpandedNodeList.Count - 1 do + DisposePidl(PItemIDList(FStateData.ExpandedNodeList[I])); + FreeAndNil(FStateData.ExpandedNodeList); + end; + + var + I: Integer; + begin + try + for I := 0 to FStateData.ExpandedNodeList.Count - 1 do + ExpandNode(PItemIDList(FStateData.ExpandedNodeList[I])); + finally + DestroyExpandedNodeList; + end; + end; + + procedure RestoreTopItemIndex; + begin + if (FStateData.TopItemIndex >= 0) and (FStateData.TopItemIndex < Items.Count) then + TopItem := Items[FStateData.TopItemIndex]; + end; + + procedure RestoreCurrentPath; + var + ACurrentPath, ATempPIDL: PItemIDList; + begin + if FStateData.CurrentPath = nil then + Exit; + ACurrentPath := GetPidlCopy(FStateData.CurrentPath); + try + repeat + if GetNodeByPIDL(ACurrentPath) <> nil then + begin + PostMessage(Handle, DSM_SHELLTREERESTORECURRENTPATH, + WPARAM(GetPidlCopy(ACurrentPath)), 0); + Break; + end; + ATempPIDL := ACurrentPath; + ACurrentPath := GetPidlParent(ACurrentPath); + DisposePidl(ATempPIDL); + until False; + finally + DisposePidl(ACurrentPath); + end; + end; + +begin + try + RestoreExpandedNodes; + RestoreTopItemIndex; + RestoreCurrentPath; + finally + DisposePidl(FStateData.CurrentPath); + FStateData.CurrentPath := nil; + end; +end; + +procedure TcxCustomInnerShellTreeView.SaveTreeState; + + procedure SaveTopItemIndex; + begin + if TopItem <> nil then + FStateData.TopItemIndex := TopItem.AbsoluteIndex + else + FStateData.TopItemIndex := -1; + end; + + procedure SaveExpandedNodes; + + procedure SaveExpandedNode(ANode: TTreeNode); + var + AParentItemProducer: TcxShellTreeItemProducer; + begin + if ANode.Parent = nil then + FStateData.ExpandedNodeList.Add(nil) + else + begin + AParentItemProducer := TcxShellTreeItemProducer(ANode.Parent.Data); + FStateData.ExpandedNodeList.Add(GetPidlCopy( + TcxShellItemInfo(AParentItemProducer.Items[ANode.Index]).FullPIDL)); + end; + end; + + var + ANode: TTreeNode; + begin + FStateData.ExpandedNodeList := TList.Create; + ANode := Items.GetFirstNode; + while ANode <> nil do + begin + if ANode.Expanded then + SaveExpandedNode(ANode); + ANode := ANode.GetNext; + end; + end; + + procedure SaveCurrentPath; + begin + if Selected <> nil then + begin + if Selected.Parent = nil then + FStateData.CurrentPath := Root.Pidl + else + FStateData.CurrentPath := TcxShellItemInfo(TcxShellTreeItemProducer( + Selected.Parent.Data).Items[Selected.Index]).FullPIDL; + FStateData.CurrentPath := GetPidlCopy(FStateData.CurrentPath); + end + else + FStateData.CurrentPath := nil; + end; + +begin + SaveTopItemIndex; + SaveExpandedNodes; + SaveCurrentPath; +end; + +procedure TcxCustomInnerShellTreeView.Loaded; +begin + if Root.Pidl = nil then + Root.CheckRoot; + UpdateNode(nil, False); +end; + +procedure TcxCustomInnerShellTreeView.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if Operation = opRemove then + if AComponent = FListView then + FListView := nil +end; + +procedure TcxCustomInnerShellTreeView.RemoveDropTarget; +begin + RevokeDragDrop(Handle); +end; + +procedure TcxCustomInnerShellTreeView.RemoveItemProducer( + Producer: TcxShellTreeItemProducer); +var + tempList: TList; +begin + tempList := ItemProducersList.LockList; + try + tempList.Remove(Producer); + finally + ItemProducersList.UnlockList; + end; +end; + +procedure TcxCustomInnerShellTreeView.CreateChangeNotification( + ANode: TTreeNode = nil); + + function GetShellChangeNotifierPIDL: PItemIDList; + begin + if Root.ShellFolder = nil then + Root.CheckRoot; + if ANode = nil then + if Selected = nil then + ANode := Items[0] + else + ANode := Selected; + if ANode.Parent = nil then + Result := Root.Pidl + else + Result := TcxShellItemInfo(TcxShellTreeItemProducer( + ANode.Parent.Data).Items[ANode.Index]).FullPIDL; + end; + +begin + if FIsChangeNotificationCreationLocked then + Exit; + FShellChangeNotificationCreation := True; + try + if not Options.TrackShellChanges or (Items.Count = 0) then + RemoveChangeNotification + else + RegisterShellChangeNotifier(GetShellChangeNotifierPIDL, Handle, + DSM_SHELLTREECHANGENOTIFY, True, FShellChangeNotifierData); + finally + FShellChangeNotificationCreation := False; + end; +end; + +function TcxCustomInnerShellTreeView.DoAddFolder(AFolder: TcxShellFolder): Boolean; +begin + Result := True; + if Assigned(FOnAddFolder) then + FOnAddFolder(Self, AFolder, Result); +end; + +procedure TcxCustomInnerShellTreeView.SetPrevTargetNode(const Value: TTreeNode); +begin + if FPrevTargetNode <> nil then + FPrevTargetNode.DropTarget := False; + FPrevTargetNode := Value; + if FPrevTargetNode <> nil then + FPrevTargetNode.DropTarget := True; +end; + +function TcxCustomInnerShellTreeView.TryReleaseDropTarget: HResult; +begin + Result := S_OK; + if CurrentDropTarget <> nil then + Result := CurrentDropTarget.DragLeave; + CurrentDropTarget := nil; + PrevTargetNode := nil; +end; + +(*procedure TcxCustomInnerShellTreeView.UpdateNode(ANode: TTreeNode); +var + uNode:TTreeNode; +begin + if csLoading in ComponentState then + Exit; + uNode:=nil; + if IsWindow(Handle) and Root.IsValid then + begin + if ANode=nil then + begin + if (Items.Count > 0) and (Items[0].Data <> nil) then + Items.Clear; + if Items.Count=0 then + uNode:=Items.AddFirst(nil,'') + else + uNode:=Items[0]; + uNode.Data:=TcxShellTreeItemProducer.Create(Self); + end + else + uNode:=ANode; + uNode.HasChildren:=True; + end; + if uNode<>nil then + CanExpand(uNode); +end;*) + +procedure TcxCustomInnerShellTreeView.UpdateNode(ANode: TTreeNode; + AFast: Boolean); +var + AFullPIDL: PITemIDList; + AParentItemProducer: TcxShellTreeItemProducer; + ATempNode: TTreeNode; +begin + if csLoading in ComponentState then + Exit; + if IsWindow(WindowHandle) and Root.IsValid then + begin + if ANode = nil then + begin + if (Items.Count > 0) and (Items[0].Data <> nil) then + Items.Clear; + if Items.Count = 0 then + ATempNode := Items.AddFirst(nil, '') + else + ATempNode := Items[0]; + ATempNode.Data := TcxShellTreeItemProducer.Create(Self); + end + else + ATempNode := ANode; + if not AFast or (ATempNode.Parent = nil) then + ATempNode.HasChildren := True + else + begin + AParentItemProducer := TcxShellTreeItemProducer(ATempNode.Parent.Data); + AFullPIDL := ConcatenatePidls(AParentItemProducer.FolderPidl, + TcxShellItemInfo(AParentItemProducer.Items[ATempNode.Index]).pidl); + TcxShellTreeItemProducer(ATempNode.Data).FolderPidl := AFullPIDL; + ATempNode.HasChildren := HasSubItems(AParentItemProducer.ShellFolder, + AFullPIDL, AParentItemProducer.GetEnumFlags); + end; + if not AFast or (ATempNode.Parent = nil) then + CanExpand(ATempNode); + CreateChangeNotification; + end; +end; + +procedure TcxCustomInnerShellTreeView.SetListView( + Value: TcxCustomInnerShellListView); +begin + if FListView = Value then + Exit; + if FListView <> nil then + begin + FListView.SetTreeView(nil); + FListView.RemoveFreeNotification(Self); + end; + FListView := Value; + if FListView <> nil then + begin + FListView.FreeNotification(Self); + FListView.SetTreeView(Self); + end; + DoNavigateListView; +end; + +procedure TcxCustomInnerShellTreeView.RootSettingsChanged(Sender: TObject); +begin + if (Parent <> nil) and (csLoading in Parent.ComponentState) then + Exit; + if (FListView <> nil) and FListView.HandleAllocated then + SendMessage(FListView.Handle, DSM_SYNCHRONIZEROOT, Integer(Root), 0); + if (FComboBoxControl <> nil) and FComboBoxControl.HandleAllocated then + SendMessage(FComboBoxControl.Handle, DSM_SYNCHRONIZEROOT, Integer(Root), 0); +end; + +procedure TcxCustomInnerShellTreeView.SetShowInfoTips(Value: Boolean); +begin + if Value <> FShowInfoTips then + begin + FShowInfoTips := Value; + AdjustControlParams; + end; +end; + +procedure TcxCustomInnerShellTreeView.ShowToolTipChanged(Sender: TObject); +begin + ToolTips := Options.ShowToolTip; + AdjustControlParams; +end; + +procedure TcxCustomInnerShellTreeView.DSMShellTreeChangeNotify(var Message: TMessage); + + function NeedProcessMessage: Boolean; // TODO more detailed selection + begin + Result := (Message.LParam <> SHCNE_UPDATEITEM) or + (GetNodeByPIDL(PPItemIDList(Message.WParam)^) <> nil); + end; + +begin + if FShellChangeNotificationCreation or FIsUpdating or not NeedProcessMessage then + Exit; + try + if DraggedObject <> nil then + Exit; + + Items.BeginUpdate; + FIsUpdating := True; + try + SendMessage(Parent.Handle, WM_SETREDRAW, 0, 0); + try + SaveTreeState; + try + Items.Clear; + UpdateNode(nil, False); + finally + RestoreTreeState; + end; + finally + SendMessage(Parent.Handle, WM_SETREDRAW, 1, 0); + Parent.Update; + end; + finally + FIsUpdating := False; + Items.EndUpdate; + end; + finally + DoShellChange(Self, OnShellChange, Message); + end; +end; + +procedure TcxCustomInnerShellTreeView.DSMShellTreeRestoreCurrentPath(var Message: TMessage); +var + APrevAutoExpand: Boolean; +begin + if FIsChangeNotificationCreationLocked then + PostMessage(Handle, DSM_SHELLTREERESTORECURRENTPATH, Message.WPARAM, 0) + else + try + APrevAutoExpand := AutoExpand; + AutoExpand := False; + try + SendMessage(Handle, DSM_DONAVIGATE, Message.WPARAM, 0); + DoNavigateListView; + finally + AutoExpand := APrevAutoExpand; + end; + finally + DisposePidl(PItemIDList(Message.WPARAM)); + end; +end; + +procedure TcxCustomInnerShellTreeView.DSMSynchronizeRoot(var Message: TMessage); +begin + if not((Parent <> nil) and (csLoading in Parent.ComponentState)) then + Root.Update(TcxCustomShellRoot(Message.WParam)); +end; + +procedure TcxCustomInnerShellTreeView.DoNavigateListView; +var + ATempPIDL: PItemIDList; +begin + if (Items.Count = 0) or (not Assigned(ListView) and not Assigned(ComboBoxControl)) then + Exit; + + if Selected <> nil then + ATempPIDL := TcxShellTreeItemProducer(Selected.Data).FolderPidl + else + ATempPIDL := TcxShellTreeItemProducer(Items[0].Data).FolderPidl; + if Assigned(ListView) then + ListView.ProcessTreeViewNavigate(ATempPIDL); + + if Assigned(ComboBoxControl) and (ComboBoxControl.Parent <> nil) then + begin + ComboBoxControl.HandleNeeded; + SendMessage(ComboBoxControl.Handle, DSM_DONAVIGATE, Integer(ATempPIDL), 0); + end; +end; + +procedure TcxCustomInnerShellTreeView.DragDropSettingsChanged(Sender: TObject); +begin + if DragDropSettings.AllowDragObjects then + DragMode := dmAutomatic + else + DragMode := dmManual; +end; + +function TcxCustomInnerShellTreeView.GetNodeByPIDL(APIDL: PItemIDList): TTreeNode; +var + AItemIndex, I: Integer; + APID: PItemIDList; +begin + Result := nil; + if APIDL = nil then + Exit; + + if Root.ShellFolder = nil then + Root.CheckRoot; + if EqualPIDLs(Root.Pidl, APIDL) then + begin + Result := Items[0]; + Exit; + end; + + if not IsSubPath(Root.Pidl, APIDL) then + Exit; + + for I := 0 to GetPidlItemsCount(Root.Pidl) - 1 do + APIDL := GetNextItemID(APIDL); + Result := Items[0]; + for I := 0 to GetPidlItemsCount(APIDL) - 1 do + begin + APID := ExtractParticularPidl(APIDL); + if APID = nil then + Break; + try + AItemIndex := TcxShellTreeItemProducer(Result.Data).GetItemIndexByPidl(APID); + if (AItemIndex = -1) or (AItemIndex >= Result.Count) then + begin + Result := nil; + Break; + end; + Result := Result.Item[AItemIndex]; + APIDL := GetNextItemID(APIDL); + finally + DisposePidl(APID); + end; + end; +end; + +procedure TcxCustomInnerShellTreeView.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited KeyDown(Key, Shift); + if Key = VK_F5 then + UpdateContent; +end; + +procedure TcxCustomInnerShellTreeView.RemoveChangeNotification; +begin + UnregisterShellChangeNotifier(FShellChangeNotifierData); +end; + +procedure TcxCustomInnerShellTreeView.Change(Node: TTreeNode); +begin + inherited Change(Node); + UpdateNode(Selected, not Navigation); + if not Navigation then + DoNavigateListView; +end; + +procedure TcxCustomInnerShellTreeView.DsmDoNavigate(var Message: TMessage); +var + srcPidl: PItemIDList; + destPidl: PItemIDList; + pFolder: IShellFolder; + partDstPidl: PItemIDList; + i: Integer; + tempProducer: TcxShellTreeItemProducer; + tempIndex: Integer; +begin + Navigation := True; + Items.BeginUpdate; + try + if Failed(SHGetDesktopFolder(pFolder)) then + Exit; + srcPidl := Root.Pidl; + destPidl := PItemIDList(Message.WParam); + if GetPidlItemsCount(srcPidl) > GetPidlItemsCount(destPidl) then + begin + Root.Pidl := destPidl; + Items[0].Selected := True; + Exit; + end; + for i := 0 to GetPidlItemsCount(srcPidl) - 1 do + DestPidl := GetNextItemID(DestPidl); + Selected := Items[0]; + for i := 0 to GetPidlItemsCount(destPidl) - 1 do + begin + tempProducer := Selected.Data; + partDstPidl := ExtractParticularPidl(destPidl); + destPidl := GetNextItemID(destPidl); + if partDstPidl = nil then + Break; + try + tempIndex := tempProducer.GetItemIndexByPidl(partDstPidl); + if tempIndex = -1 then + Break; + Selected := Selected.Item[tempIndex]; + finally + DisposePidl(partDstPidl); + end; + end; + finally + Items.EndUpdate; + Navigation := False; + end; + + if Selected <> nil then + SendMessage(Handle, TVM_ENSUREVISIBLE, 0, LPARAM(Selected.ItemId)); +end; + +{ TcxShellTreeItemProducer } + +function TcxShellTreeItemProducer.GetItemsInfoGatherer: TcxShellItemsInfoGatherer; +begin + Result := TreeView.ItemsInfoGatherer; +end; + +procedure TcxShellTreeItemProducer.CheckForSubitems( + AItem: TcxShellItemInfo); +begin + inherited CheckForSubitems(AItem); + if (AItem <> nil) and (not AItem.IsRemovable) then + AItem.CheckSubitems(ShellFolder, GetEnumFlags); +end; + +function TcxShellTreeItemProducer.CheckUpdates:Boolean; +const + R: array[Boolean] of Byte = (0, 1); +var + pEnum: IEnumIDList; + currentCelt: Cardinal; + rPidl: PItemIDList; + Item: TcxShellItemInfo; + Res: HRESULT; + SaveCursor: TCursor; + tempList: TList; + + function ShellSortFunction(Item1, Item2: Pointer): Integer; + var + AItemInfo1, AItemInfo2: TcxShellItemInfo; + begin + Result := 0; + if (Item1 = nil) or (Item2 = nil) then + Exit; + AItemInfo1 := TcxShellItemInfo(Item1); + AItemInfo2 := TcxShellItemInfo(Item2); + Result := R[AItemInfo2.IsFolder] - R[AItemInfo1.IsFolder]; + if Result = 0 then + Result := Smallint(TcxShellTreeItemProducer( + AItemInfo1.ItemProducer).ShellFolder.CompareIDs(0, AItemInfo1.pidl, AItemInfo2.pidl)); + end; + + procedure MergeItems(Existent,New:TList); + var + i, j: Integer; + exstItem: TcxShellItemInfo; + newItem: TcxShellItemInfo; + found: Boolean; + begin + i := 0; + while (i < Existent.Count) do + begin + exstItem := Existent[i]; + found := False; + for j := 0 to New.Count-1 do + begin + newItem := New[j]; + if Smallint(ShellFolder.CompareIDs(0, exstItem.pidl, newItem.pidl)) = 0 then + begin + exstItem.Free; + Existent[i] := newItem; + New.Remove(newItem); + found := True; + Break; + end; + end; + if not found then + begin + NotifyRemoveItem(i); + Existent.Remove(exstItem); + exstItem.Free; + end + else + Inc(i); + end; + for i := 0 to New.Count - 1 do + if CanAddFolder(TcxShellItemInfo(New[i]).Folder) then + begin + Existent.Add(New[i]); + exstItem := Existent[Existent.Count - 1]; + exstItem.CheckUpdate(ShellFolder, FolderPidl, False); + NotifyAddItem(Existent.Count - 1); + end + else + TcxShellItemInfo(New[i]).Free; + end; + +begin + Result := False; + if ShellFolder = nil then + Exit; + if Failed(ShellFolder.EnumObjects(Owner.ParentWindow, GetEnumFlags, pEnum)) or + not Assigned(pEnum) then + Exit; + currentCelt := 1; + tempList := TList.Create; + SaveCursor := Owner.Cursor; + try + Owner.Cursor := crHourGlass; + repeat + Res := pEnum.Next(currentCelt, rPidl, currentCelt); + try + if Res = E_INVALIDARG then + begin + currentCelt := 1; + Res := pEnum.Next(currentCelt, rPidl, currentCelt); + end; + if Failed(Res) or (Res = S_FALSE) then + Break; + if currentCelt = 0 then + Break; + Item := TcxShellItemInfo.Create(Self, ShellFolder, FolderPidl, rPidl, False); + if Item.Name = '' then + begin + Item.Free; + Continue; + end; + tempList.Add(Item); + finally + DisposePidl(rPidl); + end; + until(Res = S_FALSE); + tempList.Sort(@ShellSortFunction); + LockWrite; + try + MergeItems(Items, tempList); + finally + UnlockWrite; + end; + finally + Owner.Cursor := SaveCursor; + FreeAndNil(tempList); + end; + Result := True; +end; + +constructor TcxShellTreeItemProducer.Create(AOwner: TWinControl); +begin + inherited Create(AOwner); + TreeView.AddItemProducer(Self); +end; + +destructor TcxShellTreeItemProducer.Destroy; +begin + if Assigned(FOnDestroy) then + FOnDestroy(Self); + TreeView.RemoveItemProducer(Self); + inherited Destroy; +end; + +function TcxShellTreeItemProducer.AllowBackgroundProcessing: Boolean; +begin + Result:= not TreeView.Navigation; +end; + +function TcxShellTreeItemProducer.CanAddFolder(AFolder: TcxShellFolder): Boolean; +begin + Result := TreeView.DoAddFolder(AFolder); +end; + +function TcxShellTreeItemProducer.GetEnumFlags: Cardinal; +begin + Result := TreeView.Options.GetEnumFlags; +end; + +function TcxShellTreeItemProducer.GetShowToolTip: Boolean; +begin + Result := TreeView.ShowInfoTips; +end; + +procedure TcxShellTreeItemProducer.InitializeItem(Item: TcxShellItemInfo); +begin + inherited; + Item.CheckUpdate(ShellFolder, FolderPidl, False); + CheckForSubitems(Item); +end; + +procedure TcxShellTreeItemProducer.NotifyAddItem(Index: Integer); +begin + if (Owner.HandleAllocated) and (Node <> nil) then + SendMessage(Owner.Handle, DSM_NOTIFYADDITEM, Index, Integer(Node)); +end; + +procedure TcxShellTreeItemProducer.NotifyRemoveItem(Index: Integer); +begin + if (Owner.HandleAllocated) and (Node <> nil) then + SendMessage(Owner.Handle, DSM_NOTIFYREMOVEITEM, Index, Integer(Node)); +end; + +procedure TcxShellTreeItemProducer.NotifyUpdateItem(AItem: PcxRequestItem); +begin + if (Owner.HandleAllocated) and (Node <> nil) then + PostMessage(Owner.Handle, DSM_NOTIFYUPDATE, AItem.ItemIndex, Integer(Node)); +end; + +procedure TcxShellTreeItemProducer.ProcessItems(AIFolder: IShellFolder; + APIDL: PItemIDList; ANode: TTreeNode; cPreloadItems: Integer); + + function SetNodeText: Boolean; + var + ATempPIDL: PItemIDList; + begin + Result := ANode.Parent <> nil; + if not Result then + Exit; + ATempPIDL := GetLastPidlItem(APIDL); + Node.Text := GetShellItemDisplayName( + TcxShellTreeItemProducer(Node.Parent.Data).ShellFolder, ATempPIDL, True); + end; + +var + AFileInfo: TShFileInfo; +begin + Node := ANode; + SHGetFileInfo(PChar(APIDL), 0, AFileInfo, SizeOf(AFileInfo), + SHGFI_PIDL or SHGFI_DISPLAYNAME or SHGFI_SYSICONINDEX); + if not SetNodeText then + Node.Text := StrPas(AFileInfo.szDisplayName); + ANode.ImageIndex := AFileInfo.iIcon; + SHGetFileInfo(PChar(APIDL), 0, AFileInfo, SizeOf(AFileInfo), + SHGFI_PIDL or SHGFI_SYSICONINDEX or SHGFI_OPENICON); + Node.SelectedIndex := AFileInfo.iIcon; + ProcessItems(AIFolder, APIDL, cPreloadItems); +end; + +procedure TcxShellTreeItemProducer.SetItemsCount(Count: Integer); +begin + if (Owner.HandleAllocated) and (Node <> nil) then + SendMessage(Owner.Handle, DSM_SETCOUNT, Count, Integer(Node)); +end; + +function TcxShellTreeItemProducer.GetTreeView: TcxCustomInnerShellTreeView; +begin + Result := TcxCustomInnerShellTreeView(Owner); +end; + +initialization + NavigationLock := False; + +end. + diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxShellDlgs.pas b/official/x.35/ExpressEditors Library 5/Sources/cxShellDlgs.pas new file mode 100644 index 00000000..6d57269a --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxShellDlgs.pas @@ -0,0 +1,106 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxShellDlgs; + +interface + +uses + Windows, Messages, SysUtils, Classes, + cxShellCommon, cxLookAndFeels; + +type + { TcxDlgShellOptions } + + TcxDlgShellOptions = class(TPersistent) + private + FContextMenus: Boolean; + FShowFolders: Boolean; + FShowHidden: Boolean; + FShowNonFolders: Boolean; + FShowToolTip: Boolean; + FTrackShellChanges: Boolean; + public + constructor Create; + published + property ContextMenus: Boolean read FContextMenus write fContextMenus + default True; + property ShowFolders: Boolean read FShowFolders write FShowFolders + default True; + property ShowHidden: Boolean read FShowHidden write fShowHidden + default False; + property ShowNonFolders: Boolean read FShowNonFolders write fShowNonFolders + default False; + property ShowToolTip: Boolean read FShowToolTip write FShowToolTip + default True; + property TrackShellChanges: Boolean read FTrackShellChanges + write FTrackShellChanges default True; + end; + + { TcxDlgShellRoot } + + TcxDlgShellRoot = class(TPersistent) + private + fCustomPath: string; + fBroFold: TcxBrowseFolder; + public + constructor Create; + published + property BrowseFolder: TcxBrowseFolder read fBroFold write fBroFold default bfDesktop; + property CustomPath: string read fCustomPath write fCustomPath; + end; + +implementation + +{ TcxDdlgShellOptions } + +constructor TcxDlgShellOptions.Create; +begin + inherited Create; + FContextMenus := True; + FShowFolders := True; + FShowToolTip := True; + FTrackShellChanges := True; +end; + +{ TcxDlgShellRoot } + +constructor TcxDlgShellRoot.Create; +begin + inherited; + fBroFold := bfDesktop; +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxShellEditRepositoryItems.pas b/official/x.35/ExpressEditors Library 5/Sources/cxShellEditRepositoryItems.pas new file mode 100644 index 00000000..f973e85a --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxShellEditRepositoryItems.pas @@ -0,0 +1,84 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxShellEditRepositoryItems; + +interface + +uses + cxEdit, cxShellComboBox; + +type + { TcxEditRepositoryShellComboBoxItem } + + TcxEditRepositoryShellComboBoxItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxShellComboBoxProperties; + procedure SetProperties(Value: TcxShellComboBoxProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxShellComboBoxProperties read GetProperties write SetProperties; + end; + +implementation + +uses + Classes; + +{ TcxEditRepositoryShellComboBoxItem } + +class function TcxEditRepositoryShellComboBoxItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxShellComboBoxProperties; +end; + +function TcxEditRepositoryShellComboBoxItem.GetProperties: TcxShellComboBoxProperties; +begin + Result := TcxShellComboBoxProperties(inherited Properties); +end; + +procedure TcxEditRepositoryShellComboBoxItem.SetProperties(Value: TcxShellComboBoxProperties); +begin + inherited Properties := Value; +end; + +initialization + RegisterClasses([TcxEditRepositoryShellComboBoxItem]); + +finalization + UnregisterClasses([TcxEditRepositoryShellComboBoxItem]); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxShellEditorsReg.pas b/official/x.35/ExpressEditors Library 5/Sources/cxShellEditorsReg.pas new file mode 100644 index 00000000..3900db75 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxShellEditorsReg.pas @@ -0,0 +1,160 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxShellEditorsReg; + +{$I cxVer.inc} + +interface + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI6} + DesignEditors, DesignIntf, +{$ELSE} + DsgnIntf, +{$ENDIF} + Windows, Classes, Forms, ShellApi, cxDBShellComboBox, cxEditPropEditors, + cxEditRepositoryEditor, cxExtEditConsts, cxShellBrowserDialog, cxShellComboBox, + cxShellCommon, cxShellEditRepositoryItems, cxShellListView, cxShellTreeView; + +const + cxShellBrowserEditorVerb = 'Test Browser...'; + +type +{$IFDEF DELPHI6} + { TcxShellEditorSelectionEditor } + + TcxShellEditorSelectionEditor = class(TSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; +{$ENDIF} + + { TcxShellBrowserEditor } + + TcxShellBrowserEditor = class(TcxEditorsLibraryComponentEditorEx) + protected + function GetEditItemCaption: string; override; + procedure ExecuteEditAction; override; + public + procedure ExecuteVerb(Index: Integer); override; + end; + +{$IFDEF DELPHI6} +{ TcxShellEditorSelectionEditor } + +procedure TcxShellEditorSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + Proc('ComCtrls'); + Proc('ShlObj'); + Proc('cxShellCommon'); +end; +{$ENDIF} + +{ TcxShellBrowserEditor } + +procedure TcxShellBrowserEditor.ExecuteVerb(Index: Integer); +begin + if Index = 4 then + ShellExecute(0, 'OPEN', 'http://www.devexpress.com', nil, nil, SW_SHOWMAXIMIZED) + else + inherited ExecuteVerb(Index); +end; + +function TcxShellBrowserEditor.GetEditItemCaption: string; +begin + Result := cxShellBrowserEditorVerb; +end; + +procedure TcxShellBrowserEditor.ExecuteEditAction; +var + ADialog: TcxShellBrowserDialog; +begin +ADialog := Component as TcxShellBrowserDialog; +with TcxShellBrowserDialog.Create(Application) do + try + if Length(ADialog.Title) > 0 then + Title := ADialog.Title; + if Length(ADialog.FolderLabelCaption) > 0 then + FolderLabelCaption := ADialog.FolderLabelCaption; + Options.ShowFolders := ADialog.Options.ShowFolders; + Options.ShowToolTip := ADialog.Options.ShowToolTip; + Options.TrackShellChanges := ADialog.Options.TrackShellChanges; + Options.ContextMenus := ADialog.Options.ContextMenus; + Options.ShowNonFolders := ADialog.Options.ShowNonFolders; + Options.ShowHidden := ADialog.Options.ShowHidden; + Root.BrowseFolder := ADialog.Root.BrowseFolder; + Root.CustomPath := ADialog.Root.CustomPath; + LookAndFeel.Kind := ADialog.LookAndFeel.Kind; + LookAndFeel.NativeStyle := ADialog.LookAndFeel.NativeStyle; + ShowButtons := ADialog.ShowButtons; + ShowInfoTips := ADialog.ShowInfoTips; + ShowLines := ADialog.ShowLines; + ShowRoot := ADialog.ShowRoot; + Path := ADialog.Path; + Execute; + finally + Free; + end; +end; + +procedure Register; +begin + RegisterComponents('Express Editors 6', [TcxShellComboBox]); + RegisterComponents('Express DBEditors 6', [TcxDBShellComboBox]); + RegisterComponents('Express Utilities', [TcxShellListView, TcxShellTreeView, + TcxShellBrowserDialog]); +{$IFDEF DELPHI6} + RegisterSelectionEditor(TcxCustomShellComboBox, TcxShellEditorSelectionEditor); + RegisterSelectionEditor(TcxCustomShellListView, TcxShellEditorSelectionEditor); + RegisterSelectionEditor(TcxCustomShellTreeView, TcxShellEditorSelectionEditor); +{$ENDIF} + RegisterComponentEditor(TcxShellBrowserDialog, TcxShellBrowserEditor); + RegisterPropertyEditor(TypeInfo(Boolean), TcxDragDropSettings, 'Scroll', nil); + RegisterPropertyEditor(TypeInfo(Boolean), TcxCustomShellTreeView, 'RightClickSelect', nil); +end; + +initialization + RegisterEditRepositoryItem(TcxEditRepositoryShellComboBoxItem, + scxSEditRepositoryShellComboBoxItem); + +finalization + UnregisterEditRepositoryItem(TcxEditRepositoryShellComboBoxItem); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxShellListView.pas b/official/x.35/ExpressEditors Library 5/Sources/cxShellListView.pas new file mode 100644 index 00000000..e8d79beb --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxShellListView.pas @@ -0,0 +1,1750 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxShellListView; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, Comctrls, Controls, Forms, Classes, Menus, ShlObj, StdCtrls, + cxGraphics, cxContainer, cxDataUtils, cxScrollBar, cxShellCommon, cxShellControls, + cxHeader, cxLookAndFeels, cxLookAndFeelPainters; + +type + TcxShellObjectPathType = (sptAbsolutePhysical, sptRelativePhysical, sptUNC, sptVirtual, + sptInternalAbsoluteVirtual, sptInternalRelativeVirtual, sptIncorrect); + + TcxShellViewOption = (svoShowFiles, svoShowFolders, svoShowHidden); + TcxShellViewOptions = set of TcxShellViewOption; + + TcxCustomShellListView = class; + + TcxBeforeNavigationEvent = procedure(Sender: TcxCustomShellListView; ANewAbsolutePIDL: PItemIDList) of object; + TcxCurrentFolderChangedEvent = procedure(Sender: TcxCustomShellListView) of object; + + { TcxInnerShellListView } + + TcxInnerShellListView = class(TcxCustomInnerShellListView, IUnknown, + IcxContainerInnerControl) + private + FCanvas: TcxCanvas; + FDefHeaderProc: Pointer; + FHeaderHandle: HWND; + FHeaderInstance: Pointer; + FPressedHeaderItemIndex: Integer; + FOnChange: TLVChangeEvent; + + // IcxContainerInnerControl + function GetControl: TWinControl; + function GetControlContainer: TcxContainer; + // header + function GetHeaderHotItemIndex: Integer; + function GetHeaderItemRect(AItemIndex: Integer): TRect; + function GetHeaderPressedItemIndex: Integer; + function HeaderItemIndex(AHeaderItem: Integer): Integer; + procedure HeaderWndProc(var Message: TMessage); + procedure LVMGetHeaderItemInfo(var Message: TCMHeaderItemInfo); message CM_GETHEADERITEMINFO; + + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + procedure WMKillFocus(var Message: TWMKillFocus); message WM_KILLFOCUS; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCPaint(var Message: TMessage); message WM_NCPAINT; + procedure WMSetFocus(var Message: TWMSetFocus); message WM_SETFOCUS; + procedure WMWindowPosChanged(var Message: TWMWindowPosChanged); message WM_WINDOWPOSCHANGED; + procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure DSMShellChangeNotify(var Message: TMessage); message DSM_SHELLCHANGENOTIFY; + protected + FContainer: TcxCustomShellListView; + procedure Click; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure DblClick; override; + function DoCompare(AItem1, AItem2: TcxShellFolder; + out ACompare: Integer): Boolean; override; + function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); override; + procedure DrawHeader; virtual; + function GetPopupMenu: TPopupMenu; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); virtual; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure Navigate(APIDL: PItemIDList); override; + procedure WndProc(var Message: TMessage); override; + procedure ChangeHandler(Sender: TObject; AItem: TListItem; + AChange: TItemChange); virtual; + procedure MouseEnter(AControl: TControl); dynamic; + procedure MouseLeave(AControl: TControl); dynamic; + + property Canvas: TcxCanvas read FCanvas; + property Container: TcxCustomShellListView read FContainer; + property OnChange: TLVChangeEvent read FOnChange write FOnChange; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure DefaultHandler(var Message); override; + procedure DragDrop(Source: TObject; X, Y: Integer); override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + function UpdateAction(Action: TBasicAction): Boolean; override; +{$IFDEF DELPHI5} + function CanFocus: Boolean; override; +{$ENDIF} + public + property Align; + property Anchors; + property BorderStyle; + property Color; + property DragDropSettings; + property HotTrack; + property IconOptions; + property Items; + property ListViewStyle; + property MultiSelect; + property Options; + property Root; + property Visible; + property AfterNavigation; + property BeforeNavigation; + property OnAddFolder; + property OnCompare; + property OnRootChanged; + property OnSelectItem; + property OnShellChange; + end; + + { TcxCustomShellListView } + + TcxCustomShellListView = class(TcxContainer) + private + FInnerListView: TcxInnerShellListView; + FIsExitProcessing: Boolean; + FScrollBarsCalculating: Boolean; + FOnAddFolder: TcxShellAddFolderEvent; + FOnBeforeNavigation: TcxBeforeNavigationEvent; + FOnChange: TLVChangeEvent; + FOnCurrentFolderChanged: TcxCurrentFolderChangedEvent; + FOnCompare: TcxShellCompareEvent; + FOnSelectItem: TLVSelectItemEvent; + FOnShellChange: TcxShellChangeEvent; + + procedure AddFolderHandler(Sender: TObject; AFolder: TcxShellFolder; + var ACanAdd: Boolean); + procedure BeforeNavigationHandler(Sender: TcxCustomInnerShellListView; + APItemIDList: PItemIDList; AFolderPath: WideString); + procedure ChangeHandler(Sender: TObject; Item: TListItem; + Change: TItemChange); + procedure SelectItemHandler(Sender: TObject; Item: TListItem; + Selected: Boolean); + procedure ShellChangeHandler(Sender: TObject; AEventID: DWORD; + APIDL1, APIDL2: PItemIDList); + + function DoCompare(AItem1, AItem2: TcxShellFolder; + out ACompare: Integer): Boolean; + function GetAbsolutePIDL: PItemIDList; + function GetDragDropSettings: TcxDragDropSettings; + function GetFolder(AIndex: Integer): TcxShellFolder; + function GetFolderCount: Integer; + function GetIconOptions: TIconOptions; + function GetListHotTrack: Boolean; + function GetMultiSelect: Boolean; + function GetOptions: TcxShellListViewOptions; + function GetPath: string; + function GetRoot: TcxShellListRoot; + function GetShowColumnHeaders: Boolean; + function GetViewStyle: TViewStyle; + procedure SetAbsolutePIDL(Value: PItemIDList); + procedure SetDragDropSettings(Value: TcxDragDropSettings); + procedure SetIconOptions(Value: TIconOptions); + procedure SetListHotTrack(Value: Boolean); + procedure SetMultiSelect(Value: Boolean); + procedure SetOptions(Value: TcxShellListViewOptions); + procedure SetPath(Value: string); + procedure SetRoot(Value: TcxShellListRoot); + procedure SetShowColumnHeaders(Value: Boolean); + procedure SetViewStyle(Value: TViewStyle); + protected + FDataBinding: TcxCustomDataBinding; + procedure DoExit; override; + procedure Loaded; override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); override; + function NeedsScrollBars: Boolean; override; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); override; + procedure CurrentFolderChangedHandler(Sender: TObject; Root: TcxCustomShellRoot); virtual; + function GetDataBindingClass: TcxCustomDataBindingClass; virtual; + function GetViewOptions(AForNavigation: Boolean = False): TcxShellViewOptions; + procedure SetTreeView(ATreeView:TWinControl); + property DataBinding: TcxCustomDataBinding read FDataBinding; + property DragDropSettings: TcxDragDropSettings read GetDragDropSettings write SetDragDropSettings; + property IconOptions: TIconOptions read GetIconOptions write SetIconOptions; + property ListHotTrack: Boolean read GetListHotTrack write SetListHotTrack default False; + property MultiSelect: Boolean read GetMultiSelect write SetMultiSelect default False; + property Options: TcxShellListViewOptions read GetOptions write SetOptions; + property Root: TcxShellListRoot read GetRoot write SetRoot; + property ShowColumnHeaders: Boolean read GetShowColumnHeaders + write SetShowColumnHeaders default True; + property ViewStyle: TViewStyle read GetViewStyle write SetViewStyle default vsIcon; + property OnAddFolder: TcxShellAddFolderEvent read FOnAddFolder + write FOnAddFolder; + property OnBeforeNavigation: TcxBeforeNavigationEvent read FOnBeforeNavigation write FOnBeforeNavigation; + property OnChange: TLVChangeEvent read FOnChange write FOnChange; + property OnCompare: TcxShellCompareEvent read FOnCompare write FOnCompare; + property OnCurrentFolderChanged: TcxCurrentFolderChangedEvent + read FOnCurrentFolderChanged write FOnCurrentFolderChanged; + property OnSelectItem: TLVSelectItemEvent read FOnSelectItem write FOnSelectItem; + property OnShellChange: TcxShellChangeEvent read FOnShellChange write FOnShellChange; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + function UpdateAction(Action: TBasicAction): Boolean; override; + procedure SetFocus; override; + procedure BrowseParent; + function GetItemAbsolutePIDL(AIndex: Integer): PItemIDList; + procedure ProcessTreeViewNavigate(apidl:PItemIDList); + procedure UpdateContent; + property AbsolutePath: string read GetPath write SetPath; // deprecated + property AbsolutePIDL: PItemIDList read GetAbsolutePIDL write SetAbsolutePIDL; + property FolderCount: Integer read GetFolderCount; + property Folders[AIndex: Integer]: TcxShellFolder read GetFolder; + property InnerListView: TcxInnerShellListView read FInnerListView; + property Path: string read GetPath write SetPath; + end; + + { TcxShellListView } + + TcxShellListView = class(TcxCustomShellListView) + published + property Align; + property Anchors; + property Constraints; + property DragDropSettings; + property Enabled; + property IconOptions; + property ListHotTrack; + property MultiSelect; + property Options; + property ParentColor default False; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Root; + property ShowColumnHeaders; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property ViewStyle; + property Visible; + property OnAddFolder; + property OnBeforeNavigation; + property OnChange; + property OnClick; + property OnCompare; + property OnContextPopup; + property OnCurrentFolderChanged; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnSelectItem; + property OnShellChange; + property OnStartDock; + property OnStartDrag; + end; + + TcxShellSpecialFolderInfoTableItem = record + Attributes: ULONG; + PIDL: PItemIDList; + PIDLDisplayName, PIDLName, PIDLUpperCaseDisplayName: string; + end; + +function CheckAbsolutePIDL(var APIDL: PItemIDList; ARoot: TcxCustomShellRoot; + ACheckObjectExistence: Boolean; ACheckIsSubPath: Boolean = True): Boolean; +function CheckShellObjectExistence(APIDL: PItemIDList): Boolean; +function CheckShellObjectPath(var APath: string; ACurrentPath: string; + AIsDisplayText: Boolean): TcxShellObjectPathType; +function CheckViewOptions(AViewOptions: TcxShellViewOptions; + AShellObjectAttributes: ULONG): Boolean; +function GetPIDLDisplayName(APIDL: PItemIDList; AShowFullPath: Boolean = False): string; +function InternalParseDisplayName(AParentIFolder: IShellFolder; + ADisplayName: string; AViewOptions: TcxShellViewOptions): PItemIDList; +function PathToAbsolutePIDL(APath: string; ARoot: TcxCustomShellRoot; + AViewOptions: TcxShellViewOptions; ACheckIsSubPath: Boolean = True): PItemIDList; +function ShellObjectInternalVirtualPathToPIDL(APath: string; + ARoot: TcxCustomShellRoot; AViewOptions: TcxShellViewOptions): PItemIDList; + +const + cxShellSpecialFolderInfoTableLength = CSIDL_HISTORY - CSIDL_DESKTOP + 1; + +var + cxShellSpecialFolderInfoTable: array[CSIDL_DESKTOP..CSIDL_HISTORY] of + TcxShellSpecialFolderInfoTableItem; + +implementation + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + SysUtils, CommCtrl, ComObj, Graphics, ShellAPI, cxClasses, cxEdit, + cxControls; + +type + TcxCustomDataBindingAccess = class(TcxCustomDataBinding); + TcxContainerAccess = class(TcxContainer); + TcxCustomShellRootAccess = class(TcxCustomShellRoot); + +function CheckAbsolutePIDL(var APIDL: PItemIDList; ARoot: TcxCustomShellRoot; + ACheckObjectExistence: Boolean; ACheckIsSubPath: Boolean = True): Boolean; +begin + CheckShellRoot(ARoot); + if APIDL = nil then + begin + Result := True; + APIDL := ARoot.Pidl; + end + else + begin + Result := not ACheckIsSubPath or IsSubPath(ARoot.Pidl, APIDL); + if Result and ACheckObjectExistence then + Result := CheckShellObjectExistence(APIDL); + end; +end; + +function CheckShellObjectExistence(APIDL: PItemIDList): Boolean; +var + ASHFileInfo: TSHFileInfo; +begin + Result := SHGetFileInfo(PChar(APIDL), 0, ASHFileInfo, SizeOf(ASHFileInfo), + SHGFI_PIDL or SHGFI_SYSICONINDEX or SHGFI_SMALLICON) <> 0; +end; + +function CheckShellObjectPath(var APath: string; ACurrentPath: string; + AIsDisplayText: Boolean): TcxShellObjectPathType; +var + APathLength: Integer; + S: string; +begin + APathLength := Length(APath); + Result := sptIncorrect; + if APathLength = 0 then + Exit; + + if (APathLength > 1) and (APath[APathLength] = '\') and (APath[APathLength - 1] <> ':') then + begin + Dec(APathLength); + SetLength(APath, APathLength); + end; + + if (APathLength > 2) and (APath[1] = '\') and (APath[2] = '\') then + begin + Result := sptUNC; + Exit; + end; + if APathLength >= cxShellObjectInternalVirtualPathPrefixLength then + begin + S := AnsiUpperCase(Copy(APath, 1, cxShellObjectInternalVirtualPathPrefixLength)); + if S = cxShellObjectInternalAbsoluteVirtualPathPrefix then + begin + Result := sptInternalAbsoluteVirtual; + Exit; + end; + if S = cxShellObjectInternalRelativeVirtualPathPrefix then + begin + Result := sptInternalRelativeVirtual; + Exit; + end; + if Copy(S, 1, 3) = '::{' then + begin + Result := sptVirtual; + Exit; + end; + end; + if (Length(APath) >= 3) and (APath[2] = ':') and (APath[3] = '\') and + (APath[1] in ['A'..'Z', 'a'..'z']) then + begin + Result := sptAbsolutePhysical; + Exit; + end; + if (APath[1] = '\') or (Length(APath) >= 2) and (APath[2] = ':') and + (APath[1] in ['A'..'Z', 'a'..'z']) then + begin + if (Length(ACurrentPath) < 3) or (ACurrentPath[2] <> ':') or + (ACurrentPath[3] <> '\') or not(ACurrentPath[1] in ['A'..'Z', 'a'..'z']) then + Exit; + if (APath[1] <> '\') and (UpperCase(APath[1]) <> UpperCase(ACurrentPath[1])) then + Exit; + if (APath[1] <> '\') and (APathLength = 2) then + begin + if AIsDisplayText then + begin + APath := ACurrentPath; + Result := sptAbsolutePhysical; + Exit; + end + else + Exit; + end + else + if APath[1] = '\' then + begin + if APathLength = 1 then + APath := Copy(ACurrentPath, 1, 3) + else + APath := Copy(ACurrentPath, 1, 2) + APath; + Result := sptAbsolutePhysical; + Exit; + end + else + if not AIsDisplayText then + Exit + else + begin + APath := Copy(APath, 3, APathLength - 2); + Result := sptRelativePhysical; + Exit; + end; + end; + Result := sptRelativePhysical; +end; + +function CheckViewOptions(AViewOptions: TcxShellViewOptions; + AShellObjectAttributes: ULONG): Boolean; +begin + Result := not((AShellObjectAttributes and SFGAO_HIDDEN <> 0) and + not(svoShowHidden in AViewOptions)); + Result := Result and not((AShellObjectAttributes and SFGAO_FOLDER = 0) and + not(svoShowFiles in AViewOptions)); + Result := Result and not((AShellObjectAttributes and SFGAO_FOLDER <> 0) and + not(svoShowFolders in AViewOptions)); +end; + +procedure DestroyShellSpecialFolderInfoTable; +var + ACSIDL: Integer; +begin + for ACSIDL := CSIDL_DESKTOP to CSIDL_HISTORY do + begin + DisposePidl(cxShellSpecialFolderInfoTable[ACSIDL].PIDL); + cxShellSpecialFolderInfoTable[ACSIDL].PIDL := nil; + end; +end; + +function GetShellEnumObjectsFlags(AViewOptions: TcxShellViewOptions): DWORD; +begin + Result := 0; + if svoShowFiles in AViewOptions then + Result := Result or SHCONTF_NONFOLDERS; + if svoShowFolders in AViewOptions then + Result := Result or SHCONTF_FOLDERS; + if svoShowHidden in AViewOptions then + Result := Result or SHCONTF_INCLUDEHIDDEN; +end; + +function GetPIDLDisplayName(APIDL: PItemIDList; AShowFullPath: Boolean = False): string; +var + AParentIFolder: IShellFolder; + AStrRet: TStrRet; + ATempPIDL: PItemIDList; + I: Integer; +begin + Result := ''; + if AShowFullPath then + begin + Result := GetPidlName(APIDL); + if Result <> '' then + Exit; + end; + AParentIFolder := GetDesktopIShellFolder; + for I := 1 to GetPidlItemsCount(APIDL) + Integer(AShowFullPath) - 1 do + begin + ATempPIDL := cxMalloc.Alloc(APIDL^.mkid.cb + SizeOf(SHITEMID)); + FillChar(ATempPIDL^, APIDL^.mkid.cb + SizeOf(SHITEMID), 0); + CopyMemory(ATempPIDL, APIDL, APIDL^.mkid.cb); + Integer(APIDL) := Integer(APIDL) + APIDL^.mkid.cb; + + if AShowFullPath then + begin + if AParentIFolder.GetDisplayNameOf(ATempPIDL, SHGDN_INFOLDER, AStrRet) <> S_OK then + Break; + if Result <> '' then + Result := Result + '\'; + Result := Result + GetTextFromStrRet(AStrRet, APIDL); + end; + + AParentIFolder.BindToObject(ATempPIDL, nil, IID_IShellFolder, Pointer(AParentIFolder)); + DisposePidl(ATempPIDL); + end; + + if not AShowFullPath and (AParentIFolder.GetDisplayNameOf(APIDL, SHGDN_NORMAL, AStrRet) = S_OK) then + Result := GetTextFromStrRet(AStrRet, APIDL); +end; + +function InternalParseDisplayName(AParentIFolder: IShellFolder; + ADisplayName: string; AViewOptions: TcxShellViewOptions): PItemIDList; +var + AAttributes, AFetchedItemCount, AParsedCharCount: ULONG; + AFlags: DWORD; + AIEnumIDList: IEnumIDList; +// AStrRet: TStrRet; + ATempPIDL: PItemIDList; +begin + Result := nil; + AAttributes := SFGAO_HIDDEN or SFGAO_FOLDER; + AParentIFolder.ParseDisplayName(0, nil, StringToOleStr(ADisplayName), + AParsedCharCount, Result, AAttributes); + if Result <> nil then + begin + if not CheckViewOptions(AViewOptions, AAttributes) then + Result := nil; + Exit; + end; + + AFlags := GetShellEnumObjectsFlags(AViewOptions); + if (AParentIFolder.EnumObjects(0, AFlags, AIEnumIDList) = S_OK) and + Assigned(AIEnumIDList) then + begin + ADisplayName := AnsiUpperCase(ADisplayName); + while AIEnumIDList.Next(1, ATempPIDL, AFetchedItemCount) = NOERROR do + begin +// FillChar(AStrRet, SizeOf(AStrRet), 0); +// AParentIFolder.GetDisplayNameOf(ATempPIDL, SHGDN_INFOLDER, AStrRet); +// if AnsiUpperCase(GetTextFromStrRet(AStrRet, ATempPIDL)) = ADisplayName then + if AnsiUpperCase(GetShellItemDisplayName(AParentIFolder, ATempPIDL, True)) = ADisplayName then + begin + Result := ATempPIDL; + Break; + end + else + DisposePidl(ATempPIDL); + end; + end; +end; + +function PathToAbsolutePIDL(APath: string; ARoot: TcxCustomShellRoot; + AViewOptions: TcxShellViewOptions; ACheckIsSubPath: Boolean = True): PItemIDList; + + function InternalPathToAbsolutePIDL: PItemIDList; + var + ACSIDL: Integer; + APathType: TcxShellObjectPathType; + ATempPIDL: PItemIDList; + begin + Result := nil; + APathType := CheckShellObjectPath(APath, AnsiUpperCase(GetPidlName(ARoot.Pidl)), False); + case APathType of + sptIncorrect: + Exit; + sptAbsolutePhysical, sptUNC, sptVirtual: + Result := InternalParseDisplayName(GetDesktopIShellFolder, APath, AViewOptions); + sptInternalAbsoluteVirtual, sptInternalRelativeVirtual: + Result := ShellObjectInternalVirtualPathToPIDL(APath, ARoot, AViewOptions); + sptRelativePhysical: + begin + ATempPIDL := InternalParseDisplayName(ARoot.ShellFolder, APath, AViewOptions); + if ATempPIDL <> nil then + begin + Result := ConcatenatePidls(ARoot.Pidl, ATempPIDL); + DisposePidl(ATempPIDL); + Exit; + end; + + for ACSIDL := CSIDL_DESKTOP to CSIDL_HISTORY do + with cxShellSpecialFolderInfoTable[ACSIDL] do + if (PIDL <> nil) and (PIDLUpperCaseDisplayName = APath) and + CheckViewOptions(AViewOptions, Attributes) then + begin + Result := GetPidlCopy(PIDL); + Break; + end; + end; + end; + end; + +begin + CheckShellRoot(ARoot); + + if APath = '' then + Result := GetPidlCopy(ARoot.Pidl) + else + begin + APath := AnsiUpperCase(APath); + Result := InternalPathToAbsolutePIDL; + end; + + if (Result <> nil) and ACheckIsSubPath and not IsSubPath(ARoot.Pidl, Result) then + begin + DisposePidl(Result); + Result := nil; + end; +end; + +function ShellObjectInternalVirtualPathToPIDL(APath: string; + ARoot: TcxCustomShellRoot; AViewOptions: TcxShellViewOptions): PItemIDList; +var + AAttributes: UINT; + AFetchedItemCount: ULONG; + AFlags: DWORD; + AIEnumIDList: IEnumIDList; + AParentIFolder: IShellFolder; + AStrRet: TStrRet; + ATempPIDL, ATempPIDL1, ATempPIDL2: PItemIDList; + I: Integer; + S: string; +begin + Result := nil; + + if Copy(APath, 1, cxShellObjectInternalVirtualPathPrefixLength) = cxShellObjectInternalAbsoluteVirtualPathPrefix then + begin + AParentIFolder := GetDesktopIShellFolder; + ATempPIDL := nil; + end + else + begin + AParentIFolder := ARoot.ShellFolder; + ATempPIDL := GetPidlCopy(ARoot.Pidl); + end; + APath := Copy(APath, cxShellObjectInternalVirtualPathPrefixLength + 2, + Length(APath) - cxShellObjectInternalVirtualPathPrefixLength - 1); + if APath = '' then + begin + Result := CreateEmptyPidl; + Exit; + end; + + repeat + I := Pos('\', APath); + if I = 0 then + begin + S := APath; + APath := ''; + end + else + begin + S := Copy(APath, 1, I - 1); + APath := Copy(APath, I + 1, Length(APath) - I); + end; + + AFlags := GetShellEnumObjectsFlags(AViewOptions); + if (AParentIFolder.EnumObjects(0, AFlags, AIEnumIDList) <> S_OK) or + not Assigned(AIEnumIDList) then + begin + DisposePidl(ATempPIDL); + Exit; + end; + while AIEnumIDList.Next(1, ATempPIDL1, AFetchedItemCount) = NOERROR do + begin + FillChar(AStrRet, SizeOf(AStrRet), 0); + AParentIFolder.GetDisplayNameOf(ATempPIDL1, SHGDN_INFOLDER, AStrRet); + if AnsiUpperCase(GetTextFromStrRet(AStrRet, ATempPIDL1)) = S then + begin + if APath = '' then + begin + Result := ConcatenatePidls(ATempPIDL, ATempPIDL1); + DisposePidl(ATempPIDL); + DisposePidl(ATempPIDL1); + Exit; + end; + AAttributes := SFGAO_FOLDER; + AParentIFolder.GetAttributesOf(1, ATempPIDL1, AAttributes); + if AAttributes and SFGAO_FOLDER = 0 then + begin + DisposePidl(ATempPIDL); + DisposePidl(ATempPIDL1); + Exit; + end; + AParentIFolder.BindToObject(ATempPIDL1, nil, IID_IShellFolder, Pointer(AParentIFolder)); + ATempPIDL2 := ATempPIDL; + ATempPIDL := ConcatenatePidls(ATempPIDL, ATempPIDL1); + DisposePidl(ATempPIDL1); + DisposePidl(ATempPIDL2); + Break; + end; + end; + until I = 0; +end; + +procedure PrepareShellSpecialFolderInfoTable; +var + ACSIDL: Integer; + ADesktopIFolder: IShellFolder; + ATempPIDL: PItemIDList; +begin + ADesktopIFolder := GetDesktopIShellFolder; + for ACSIDL := CSIDL_DESKTOP to CSIDL_HISTORY do + with cxShellSpecialFolderInfoTable[ACSIDL] do + begin + if SHGetSpecialFolderLocation(0, ACSIDL, PIDL) <> S_OK then + begin + Attributes := 0; + PIDL := nil; + PIDLDisplayName := ''; + PIDLName := ''; + PIDLUpperCaseDisplayName := ''; + Continue; + end; + + PIDLDisplayName := GetPIDLDisplayName(PIDL); + PIDLUpperCaseDisplayName := AnsiUpperCase(PIDLDisplayName); + PIDLName := AnsiUpperCase(GetPidlName(PIDL)); + + if PIDL <> nil then + begin + Attributes := SFGAO_HIDDEN or SFGAO_FOLDER; + ATempPIDL := GetLastPidlItem(PIDL); + if ADesktopIFolder.GetAttributesOf(1, ATempPIDL, Attributes) <> NOERROR then + raise EcxEditError.Create(''); + Attributes := Attributes and (SFGAO_HIDDEN or SFGAO_FOLDER); + end; + end; +end; + +{ TcxInnerShellListView } + +constructor TcxInnerShellListView.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + BorderStyle := bsNone; + ControlStyle := ControlStyle + [csDoubleClicks]; + ParentColor := False; + ParentFont := True; + ShowColumnHeaders := True; + FPressedHeaderItemIndex := -1; + FCanvas := TcxCanvas.Create(inherited Canvas); + inherited OnChange := ChangeHandler; +end; + +destructor TcxInnerShellListView.Destroy; +begin + FreeAndNil(FCanvas); + if FHeaderHandle <> 0 then + begin + SetWindowLong(FHeaderHandle, GWL_WNDPROC, Integer(FDefHeaderProc)); + FHeaderHandle := 0; + end; + FreeObjectInstance(FHeaderInstance); + inherited Destroy; +end; + +procedure TcxInnerShellListView.DefaultHandler(var Message); +begin + if (Container = nil) or not Container.InnerControlDefaultHandler(TMessage(Message)) then + inherited DefaultHandler(Message); +end; + +procedure TcxInnerShellListView.DragDrop(Source: TObject; X, Y: Integer); +begin + if Container <> nil then + Container.DragDrop(Source, Left + X, Top + Y); +end; + +function TcxInnerShellListView.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action) or + TcxCustomDataBindingAccess(Container.FDataBinding).ExecuteAction(Action); +end; + +function TcxInnerShellListView.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action) or + TcxCustomDataBindingAccess(Container.FDataBinding).UpdateAction(Action); +end; + +{$IFDEF DELPHI5} +function TcxInnerShellListView.CanFocus: Boolean; +begin + Result := Container.CanFocusEx; +end; +{$ENDIF} + +procedure TcxInnerShellListView.Click; +begin + inherited Click; + if Container <> nil then + Container.Click; +end; + +procedure TcxInnerShellListView.DblClick; +begin + inherited DblClick; + if Container <> nil then + Container.DblClick; +end; + +procedure TcxInnerShellListView.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + if Container.IconOptions.AutoArrange then + Params.Style := Params.Style or LVS_AUTOARRANGE + else + Params.Style := Params.Style and not LVS_AUTOARRANGE; + if not Container.ShowColumnHeaders then + Params.Style := Params.Style or LVS_NOCOLUMNHEADER; +end; + +function TcxInnerShellListView.DoCompare(AItem1, AItem2: TcxShellFolder; + out ACompare: Integer): Boolean; +begin + Result := Container.DoCompare(AItem1, AItem2, ACompare); +end; + +function TcxInnerShellListView.DoMouseWheel(Shift: TShiftState; + WheelDelta: Integer; MousePos: TPoint): Boolean; +begin + Result := (Container <> nil) and Container.DoMouseWheel(Shift, + WheelDelta, MousePos); + if not Result then + inherited DoMouseWheel(Shift, WheelDelta, MousePos); +end; + +procedure TcxInnerShellListView.DragOver(Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); +begin + if Container <> nil then + Container.DragOver(Source, Left + X, Top + Y, State, Accept); +end; + +procedure TcxInnerShellListView.DrawHeader; +var + I: Integer; +begin + Canvas.Brush.Color := clBtnFace; + Canvas.Font := Font; + Canvas.Font.Color := clBtnText; + for I := 0 to Columns.Count do + DrawHeaderSection(FHeaderHandle, I, Canvas, Container.LookAndFeel, SmallImages); +end; + +function TcxInnerShellListView.GetPopupMenu: TPopupMenu; +begin + if Container = nil then + Result := inherited GetPopupMenu + else + Result := Container.GetPopupMenu; +end; + +procedure TcxInnerShellListView.KeyDown(var Key: Word; Shift: TShiftState); +begin + if Container <> nil then + Container.KeyDown(Key, Shift); + if Key <> 0 then + inherited KeyDown(Key, Shift); +end; + +procedure TcxInnerShellListView.KeyPress(var Key: Char); +begin + if Key = Char(VK_TAB) then + Key := #0; + if Container <> nil then + Container.KeyPress(Key); + if Word(Key) = VK_RETURN then + Key := #0; + if Key <> #0 then + inherited KeyPress(Key); +end; + +procedure TcxInnerShellListView.KeyUp(var Key: Word; Shift: TShiftState); +begin + if Key = VK_TAB then + Key := 0; + if Container <> nil then + Container.KeyUp(Key, Shift); + if Key <> 0 then + inherited KeyUp(Key, Shift); +end; + +procedure TcxInnerShellListView.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + if FHeaderHandle <> 0 then + InvalidateRect(FHeaderHandle, nil, False); +end; + +procedure TcxInnerShellListView.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + if Container <> nil then + with Container do + begin + InnerControlMouseDown := True; + try + MouseDown(Button, Shift, X + Self.Left, Y + Self.Top); + finally + InnerControlMouseDown := False; + end; + end; +end; + +procedure TcxInnerShellListView.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + if Container <> nil then + Container.MouseMove(Shift, X + Left, Y + Top); +end; + +procedure TcxInnerShellListView.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + if Container <> nil then + Container.MouseUp(Button, Shift, X + Left, Y + Top); +end; + +procedure TcxInnerShellListView.Navigate(APIDL: PItemIDList); +begin + inherited Navigate(APIDL); + if HandleAllocated then + begin + SendMessage(Handle, WM_HSCROLL, MakeWParam(SB_LEFT, 0), 0); + SendMessage(Handle, WM_VSCROLL, MakeWParam(SB_TOP, 0), 0); + end; +end; + +procedure TcxInnerShellListView.WndProc(var Message: TMessage); +var + AHeaderStyle: Integer; + S: string; +begin + if (Container <> nil) and Container.InnerControlMenuHandler(Message) then + Exit; + +{$IFNDEF DELPHI5} + if Message.Msg = WM_RBUTTONDOWN then + begin + Container.LockPopupMenu(True); + try + inherited WndProc(Message); + finally + Container.LockPopupMenu(False); + end; + Exit; + end; +{$ENDIF} + + if Container <> nil then + if ((Message.Msg = WM_LBUTTONDOWN) or (Message.Msg = WM_LBUTTONDBLCLK)) and + (Container.DragMode = dmAutomatic) and not Container.IsDesigning then + begin + Container.BeginAutoDrag; + Exit; + end; + + inherited WndProc(Message); + case Message.Msg of + DSM_NOTIFYUPDATECONTENTS, + DSM_NOTIFYUPDATE, + WM_HSCROLL, + WM_MOUSEWHEEL, + WM_VSCROLL, + WM_WINDOWPOSCHANGED, + CM_WININICHANGE, + LVM_SETITEMCOUNT: + Container.SetScrollBarsParameters; + WM_SETREDRAW: + if Message.WParam <> 0 then + Container.SetScrollBarsParameters; + WM_PARENTNOTIFY: + if Message.WParamLo = WM_CREATE then + begin + SetLength(S, 80); + SetLength(S, GetClassName(Message.LParam, PChar(S), Length(S))); + if S = 'SysHeader32' then + begin + FHeaderHandle := Message.LParam; + FHeaderInstance := MakeObjectInstance(HeaderWndProc); + FDefHeaderProc := Pointer(SetWindowLong(FHeaderHandle, GWL_WNDPROC, Integer(FHeaderInstance))); + AHeaderStyle := GetWindowLong(FHeaderHandle, GWL_STYLE); + SetWindowLong(FHeaderHandle, GWL_STYLE, AHeaderStyle or HDS_HOTTRACK); + end; + end; + end; +end; + +procedure TcxInnerShellListView.ChangeHandler(Sender: TObject; AItem: TListItem; + AChange: TItemChange); +begin + if AItem <> nil then + try + if Assigned(FOnChange) then + FOnChange(Sender, AItem, AChange); + finally + Container.SetScrollBarsParameters; + end; +end; + +procedure TcxInnerShellListView.MouseEnter(AControl: TControl); +begin +end; + +procedure TcxInnerShellListView.MouseLeave(AControl: TControl); +begin + if Container <> nil then + Container.ShortRefreshContainer(True); +end; + +function TcxInnerShellListView.GetControl: TWinControl; +begin + Result := Self; +end; + +function TcxInnerShellListView.GetControlContainer: TcxContainer; +begin + Result := FContainer; +end; + +function TcxInnerShellListView.GetHeaderHotItemIndex: Integer; +var + AHitTestInfo: THDHitTestInfo; +begin + if WindowFromPoint(InternalGetCursorPos) <> FHeaderHandle then + begin + Result := -1; + Exit; + end; + + AHitTestInfo.Point := InternalGetCursorPos; + Windows.ScreenToClient(FHeaderHandle, AHitTestInfo.Point); + SendGetStructMessage(FHeaderHandle, HDM_HITTEST, 0, AHitTestInfo); + Result := AHitTestInfo.Item; +end; + +function TcxInnerShellListView.GetHeaderItemRect(AItemIndex: Integer): TRect; +var + AHeaderItem: THDItem; + I: Integer; + R: TRect; +begin + if GetComCtlVersion >= ComCtlVersionIE3 then + SendGetStructMessage(FHeaderHandle, HDM_GETITEMRECT, AItemIndex, Result) + else + begin + Result.Top := 0; + GetWindowRect(FHeaderHandle, R); + Result.Bottom := R.Bottom - R.Top; + Result.Left := 0; + AHeaderItem.Mask := HDI_WIDTH; + for I := 0 to AItemIndex - 1 do + begin + SendGetStructMessage(FHeaderHandle, HDM_GETITEM, I, AHeaderItem); + Inc(Result.Left, AHeaderItem.cxy); + end; + SendGetStructMessage(FHeaderHandle, HDM_GETITEM, AItemIndex, AHeaderItem); + Result.Right := Result.Left + AHeaderItem.cxy; + end; +end; + +function TcxInnerShellListView.GetHeaderPressedItemIndex: Integer; +var + AHitTestInfo: THDHitTestInfo; +begin + AHitTestInfo.Point := InternalGetCursorPos; + Windows.ScreenToClient(FHeaderHandle, AHitTestInfo.Point); + SendGetStructMessage(FHeaderHandle, HDM_HITTEST, 0, AHitTestInfo); + if AHitTestInfo.Flags and (HHT_ONDIVIDER or HHT_ONDIVOPEN) <> 0 then + Result := -1 + else + Result := AHitTestInfo.Item; +end; + +function TcxInnerShellListView.HeaderItemIndex(AHeaderItem: Integer): Integer; +begin + Result := AHeaderItem; + if GetComCtlVersion >= ComCtlVersionIE3 then + Result := SendMessage(FHeaderHandle, HDM_ORDERTOINDEX, AHeaderItem, 0); +end; + +procedure TcxInnerShellListView.HeaderWndProc(var Message: TMessage); + + procedure CallDefHeaderProc; + begin + Message.Result := CallWindowProc(FDefHeaderProc, FHeaderHandle, + Message.Msg, Message.WParam, Message.LParam); + end; + +var + ADC: HDC; + APaintStruct: TPaintStruct; + R: TRect; +begin + case Message.Msg of + WM_ERASEBKGND: + Message.Result := 1; + WM_PAINT, WM_PRINTCLIENT: + begin + ADC := Message.WParam; + if ADC = 0 then + ADC := BeginPaint(FHeaderHandle, APaintStruct); + try + Canvas.Canvas.Handle := ADC; + Canvas.Canvas.Refresh; + DrawHeader; + finally + if Message.WParam = 0 then + EndPaint(FHeaderHandle, APaintStruct); + end; + end; + WM_LBUTTONDOWN: + begin + CallDefHeaderProc; + if ColumnClick and (GetCapture = FHeaderHandle) then + FPressedHeaderItemIndex := GetHeaderPressedItemIndex; + end; + WM_CAPTURECHANGED: + begin + if FPressedHeaderItemIndex <> -1 then + begin + R := GetHeaderItemRect(FPressedHeaderItemIndex); + InvalidateRect(FHeaderHandle, @R, False); + end; + FPressedHeaderItemIndex := -1; + CallDefHeaderProc; + end; + CM_GETHEADERITEMINFO: + Perform(CM_GETHEADERITEMINFO, Message.WParam, Message.LParam); + else + CallDefHeaderProc; + end; +end; + +procedure TcxInnerShellListView.LVMGetHeaderItemInfo(var Message: TCMHeaderItemInfo); + + function GetItemState: TcxButtonState; + + function CanHotTrack: Boolean; + var + I: Integer; + begin + Result := ColumnClick; + if Result then + for I := 0 to Columns.Count - 1 do + if Columns[I].ImageIndex <> -1 then + begin + Result := False; + Break; + end; + end; + + var + AHeaderItemIndex: Integer; + begin + if not Parent.Enabled then + Result := cxbsDisabled + else + begin + AHeaderItemIndex := HeaderItemIndex(Message.Index); + if AHeaderItemIndex = FPressedHeaderItemIndex then + Result := cxbsPressed + else + if CanHotTrack and (AHeaderItemIndex = GetHeaderHotItemIndex) then + Result := cxbsHot + else + Result := cxbsNormal; + end; + end; + + function GetItemRect: TRect; + var + R: TRect; + begin + if Message.Index = Columns.Count then + begin + Windows.GetClientRect(FHeaderHandle, Result); + if Columns.Count > 0 then + begin + R := GetHeaderItemRect(HeaderItemIndex(Columns.Count - 1)); + Result.Left := R.Right; + end; + end + else + Result := GetHeaderItemRect(HeaderItemIndex(Message.Index)); + end; + +var + AIndex: Integer; + AHeaderItemInfo: PHeaderItemInfo; +begin + AIndex := Message.Index; + AHeaderItemInfo := Message.HeaderItemInfo; + ZeroMemory(AHeaderItemInfo, SizeOf(THeaderItemInfo)); + if AIndex < Columns.Count then + begin + AHeaderItemInfo.ImageIndex := Columns[AIndex].ImageIndex; + AHeaderItemInfo.SectionAlignment := Columns[AIndex].Alignment; + AHeaderItemInfo.SortOrder := soNone; + AHeaderItemInfo.Text := Columns[AIndex].Caption; + end + else + AHeaderItemInfo.ImageIndex := -1; + AHeaderItemInfo.Rect := GetItemRect; + AHeaderItemInfo.State := GetItemState; + Message.HeaderItemInfo := AHeaderItemInfo; +end; + +procedure TcxInnerShellListView.WMGetDlgCode(var Message: TWMGetDlgCode); +begin + inherited; + if Container <> nil then + with Message do + begin + Result := Result or DLGC_WANTCHARS; + if GetKeyState(VK_CONTROL) >= 0 then + Result := Result or DLGC_WANTTAB; + end; +end; + +procedure TcxInnerShellListView.WMKillFocus(var Message: TWMKillFocus); +begin + inherited; + if (Container <> nil) and not Container.IsDestroying then + Container.FocusChanged; +end; + +procedure TcxInnerShellListView.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + inherited; + if UsecxScrollBars and not Container.FScrollBarsCalculating then + Container.SetScrollBarsParameters; +end; + +procedure TcxInnerShellListView.WMNCPaint(var Message: TMessage); +var + DC: HDC; + ABrush: HBRUSH; +begin + if not UsecxScrollBars then + begin + inherited; + Exit; + end; + + Message.Result := 1; + if UsecxScrollBars and Container.HScrollBar.Visible and Container.VScrollBar.Visible then + begin + DC := GetWindowDC(Handle); + ABrush := 0; + try + with Container.LookAndFeel do + ABrush := CreateSolidBrush(ColorToRGB(Painter.DefaultSizeGripAreaColor)); + FillRect(DC, GetSizeGripRect(Self), ABrush); + finally + if ABrush <> 0 then + DeleteObject(ABrush); + ReleaseDC(Handle, DC); + end; + end; +end; + +procedure TcxInnerShellListView.WMSetFocus(var Message: TWMSetFocus); +begin + inherited; + if (Container <> nil) and not Container.IsDestroying and not(csDestroying in ComponentState) + and (Message.FocusedWnd <> Container.Handle) then + Container.FocusChanged; +end; + +procedure TcxInnerShellListView.WMWindowPosChanged(var Message: TWMWindowPosChanged); +var + ARgn: HRGN; +begin + inherited; + if csDestroying in ComponentState then + Exit; + if Container.HScrollBar.Visible and Container.VScrollBar.Visible then + begin + ARgn := CreateRectRgnIndirect(GetSizeGripRect(Self)); + SendMessage(Handle, WM_NCPAINT, ARgn, 0); + DeleteObject(ARgn); + end; +end; + +procedure TcxInnerShellListView.CMMouseEnter(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseEnter(Self) + else + MouseEnter(TControl(Message.lParam)); +end; + +procedure TcxInnerShellListView.CMMouseLeave(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseLeave(Self) + else + MouseLeave(TControl(Message.lParam)); +end; + +procedure TcxInnerShellListView.DSMShellChangeNotify(var Message: TMessage); +begin + inherited; + Container.SetScrollBarsParameters; +end; + +{ TcxCustomShellListView } + +constructor TcxCustomShellListView.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FDataBinding := GetDataBindingClass.Create(Self, Self); + with TcxCustomDataBindingAccess(FDataBinding) do + begin + OnDataChange := Self.DataChange; + OnDataSetChange := Self.DataSetChange; + OnUpdateData := Self.UpdateData; + end; + FInnerListView := TcxInnerShellListView.Create(Self); + with FInnerListView do + begin + FContainer := Self; + LookAndFeel.MasterLookAndFeel := Self.Style.LookAndFeel; + Parent := Self; + BeforeNavigation := Self.BeforeNavigationHandler; + OnAddFolder := Self.AddFolderHandler; + OnChange := Self.ChangeHandler; + OnRootChanged := Self.CurrentFolderChangedHandler; + OnSelectItem := Self.SelectItemHandler; + OnShellChange := Self.ShellChangeHandler; + end; + InnerControl := FInnerListView; + HScrollBar.SmallChange := 1; + VScrollBar.SmallChange := 1; + Width := 250; + Height := 150; +end; + +destructor TcxCustomShellListView.Destroy; +begin + FreeAndNil(FInnerListView); + FreeAndNil(FDataBinding); + inherited Destroy; +end; + +function TcxCustomShellListView.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action) or + TcxCustomDataBindingAccess(FDataBinding).ExecuteAction(Action); +end; + +function TcxCustomShellListView.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action) or + TcxCustomDataBindingAccess(FDataBinding).UpdateAction(Action); +end; + +procedure TcxCustomShellListView.SetFocus; +begin + if not IsDesigning then + inherited SetFocus; +end; + +procedure TcxCustomShellListView.BrowseParent; +begin + FInnerListView.BrowseParent; +end; + +function TcxCustomShellListView.GetItemAbsolutePIDL(AIndex: Integer): PItemIDList; +begin + CheckShellRoot(Root); + Result := TcxShellItemInfo(InnerListView.ItemProducer.Items[AIndex]).pidl; + Result := ConcatenatePidls(Root.Pidl, Result); +end; + +procedure TcxCustomShellListView.ProcessTreeViewNavigate(apidl: PItemIDList); +begin + FInnerListView.ProcessTreeViewNavigate(apidl); +end; + +procedure TcxCustomShellListView.UpdateContent; +begin + FInnerListView.UpdateContent; +end; + +procedure TcxCustomShellListView.DoExit; +begin + if IsDestroying or FIsExitProcessing then + Exit; + FIsExitProcessing := True; + try + try + DataBinding.UpdateDataSource; + except + SetFocus; + raise; + end; + inherited DoExit; + finally + FIsExitProcessing := False; + end; +end; + +procedure TcxCustomShellListView.Loaded; +begin + inherited Loaded; + InnerListView.Loaded; + SetScrollBarsParameters; +end; + +procedure TcxCustomShellListView.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + inherited LookAndFeelChanged(Sender, AChangedValues); + if not IsDestroying and not FIsCreating then + InnerListView.LookAndFeelChanged(Sender, AChangedValues); +end; + +function TcxCustomShellListView.NeedsScrollBars: Boolean; +begin + Result := True; +end; + +procedure TcxCustomShellListView.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); + + procedure HorizontalScroll; + var + ACurrentScrollPos, I: Integer; + begin + with FInnerListView do + if AScrollCode = scTrack then + if ViewStyle = vsList then + begin + ACurrentScrollPos := GetScrollPos(Handle, SB_HORZ); + if AScrollPos <> ACurrentScrollPos then + begin + if AScrollPos > ACurrentScrollPos then + for I := ACurrentScrollPos + 1 to AScrollPos do + CallWindowProc(DefWndProc, Handle, WM_HSCROLL, Word(scLineDown) + + Word(I) shl 16, HScrollBar.Handle) + else + for I := ACurrentScrollPos - 1 downto AScrollPos do + CallWindowProc(DefWndProc, Handle, WM_HSCROLL, Word(scLineUp) + + Word(I) shl 16, HScrollBar.Handle); + end + end + else + CallWindowProc(DefWndProc, Handle, LVM_SCROLL, AScrollPos - + GetScrollPos(Handle, SB_HORZ), 0) + else + begin + CallWindowProc(DefWndProc, Handle, WM_HSCROLL, Word(AScrollCode) + + Word(AScrollPos) shl 16, HScrollBar.Handle); + AScrollPos := GetScrollPos(Handle, SB_HORZ); + end; + end; + + procedure VerticalScroll; + begin + with FInnerListView do + if AScrollCode = scTrack then + case ViewStyle of + vsReport: + SendMessage(Handle, LVM_SCROLL, 0, (AScrollPos - ListView_GetTopIndex(Handle)) * + (Self.Canvas.FontHeight(Font) + 1)); + vsIcon, vsSmallIcon: + CallWindowProc(DefWndProc, Handle, LVM_SCROLL, 0, AScrollPos - + GetScrollPos(Handle, SB_VERT)) + end + else + begin + CallWindowProc(DefWndProc, Handle, WM_VSCROLL, Word(AScrollCode) + + Word(AScrollPos) shl 16, VScrollBar.Handle); + AScrollPos := GetScrollPos(Handle, SB_VERT); + end; + end; + +begin + inherited Scroll(AScrollBarKind, AScrollCode, AScrollPos); + if not Enabled then + Exit; + if AScrollBarKind = sbHorizontal then + HorizontalScroll + else + VerticalScroll; + SetScrollBarsParameters; +end; + +procedure TcxCustomShellListView.CurrentFolderChangedHandler(Sender: TObject; Root: TcxCustomShellRoot); +begin + try + if Assigned(FOnCurrentFolderChanged) then + FOnCurrentFolderChanged(Self); + finally + SetScrollBarsParameters; + end; +end; + +function TcxCustomShellListView.GetDataBindingClass: TcxCustomDataBindingClass; +begin + Result := TcxDataBinding; +end; + +function TcxCustomShellListView.GetViewOptions(AForNavigation: Boolean = False): TcxShellViewOptions; +begin + if AForNavigation then + Result := [svoShowFolders, svoShowHidden] + else + with InnerListView do + begin + Result := []; + if Options.ShowNonFolders then + Include(Result, svoShowFiles); + if Options.ShowFolders then + Include(Result, svoShowFolders); + if Options.ShowHidden then + Include(Result, svoShowHidden); + end; +end; + +procedure TcxCustomShellListView.SetTreeView(ATreeView: TWinControl); +begin + FInnerListView.SetTreeView(ATreeView); +end; + +procedure TcxCustomShellListView.AddFolderHandler(Sender: TObject; + AFolder: TcxShellFolder; var ACanAdd: Boolean); +begin + if Assigned(FOnAddFolder) then + FOnAddFolder(Self, AFolder, ACanAdd); +end; + +procedure TcxCustomShellListView.BeforeNavigationHandler(Sender: TcxCustomInnerShellListView; + APItemIDList: PItemIDList; AFolderPath: WideString); +begin + if Assigned(FOnBeforeNavigation) then + FOnBeforeNavigation(Self, APItemIDList); +end; + +procedure TcxCustomShellListView.ChangeHandler(Sender: TObject; Item: TListItem; + Change: TItemChange); +begin + if Assigned(FOnChange) then + FOnChange(Self, Item, Change); +end; + +procedure TcxCustomShellListView.SelectItemHandler(Sender: TObject; Item: TListItem; + Selected: Boolean); +begin + if Assigned(FOnSelectItem) then + FOnSelectItem(Self, Item, Selected); +end; + +procedure TcxCustomShellListView.ShellChangeHandler(Sender: TObject; + AEventID: DWORD; APIDL1, APIDL2: PItemIDList); +begin + if Assigned(FOnShellChange) then + FOnShellChange(Self, AEventID, APIDL1, APIDL2); +end; + +function TcxCustomShellListView.DoCompare(AItem1, AItem2: TcxShellFolder; + out ACompare: Integer): Boolean; +begin + Result := Assigned(FOnCompare); + if Result then + FOnCompare(Self, AItem1, AItem2, ACompare); +end; + +function TcxCustomShellListView.GetAbsolutePIDL: PItemIDList; +begin + if FInnerListView <> nil then + begin + CheckShellRoot(Root); + Result := GetPidlCopy(FInnerListView.Root.Pidl); + end + else + Result := nil; +end; + +function TcxCustomShellListView.GetDragDropSettings: TcxDragDropSettings; +begin + Result := TcxDragDropSettings(FInnerListView.DragDropSettings); +end; + +function TcxCustomShellListView.GetFolder(AIndex: Integer): TcxShellFolder; +begin + Result := FInnerListView.Folders[AIndex]; +end; + +function TcxCustomShellListView.GetFolderCount: Integer; +begin + Result := FInnerListView.FolderCount; +end; + +function TcxCustomShellListView.GetIconOptions: TIconOptions; +begin + Result := FInnerListView.IconOptions; +end; + +function TcxCustomShellListView.GetListHotTrack: Boolean; +begin + Result := FInnerListView.HotTrack; +end; + +function TcxCustomShellListView.GetMultiSelect: Boolean; +begin + Result := FInnerListView.MultiSelect; +end; + +function TcxCustomShellListView.GetOptions: TcxShellListViewOptions; +begin + Result := FInnerListView.Options; +end; + +function TcxCustomShellListView.GetPath: string; +begin + if FInnerListView <> nil then + begin + CheckShellRoot(Root); + Result := GetPidlName(FInnerListView.Root.Pidl); + end + else + Result := ''; +end; + +function TcxCustomShellListView.GetRoot: TcxShellListRoot; +begin + Result := TcxShellListRoot(FInnerListView.Root) +end; + +function TcxCustomShellListView.GetShowColumnHeaders: Boolean; +begin + Result := FInnerListView.ShowColumnHeaders; +end; + +function TcxCustomShellListView.GetViewStyle: TViewStyle; +begin + Result := FInnerListView.ViewStyle; +end; + +procedure TcxCustomShellListView.SetAbsolutePIDL(Value: PItemIDList); +begin + if FInnerListView <> nil then + begin + if not CheckAbsolutePIDL(Value, Root, True, False) then + Exit; + FInnerListView.ProcessTreeViewNavigate(Value); + end; +end; + +procedure TcxCustomShellListView.SetDragDropSettings(Value: TcxDragDropSettings); +begin + FInnerListView.DragDropSettings := Value; +end; + +procedure TcxCustomShellListView.SetIconOptions(Value: TIconOptions); +begin + FInnerListView.IconOptions := Value; +end; + +procedure TcxCustomShellListView.SetListHotTrack(Value: Boolean); +begin + FInnerListView.HotTrack := Value; +end; + +procedure TcxCustomShellListView.SetMultiSelect(Value: Boolean); +begin + FInnerListView.MultiSelect := Value; +end; + +procedure TcxCustomShellListView.SetOptions(Value: TcxShellListViewOptions); +begin + FInnerListView.Options.Assign(Value); +end; + +procedure TcxCustomShellListView.SetPath(Value: string); +var + APIDL: PItemIDList; +begin + if (FInnerListView <> nil) and FInnerListView.HandleAllocated then + begin + APIDL := PathToAbsolutePIDL(Value, Root, GetViewOptions(True), False); // TODO + if APIDL <> nil then + try + FInnerListView.ProcessTreeViewNavigate(APIDL); + FInnerListView.DoNavigateTreeView; + finally + DisposePidl(APIDL); + end; + end; +end; + +procedure TcxCustomShellListView.SetRoot(Value: TcxShellListRoot); +begin + FInnerListView.Root := Value; +end; + +procedure TcxCustomShellListView.SetShowColumnHeaders(Value: Boolean); +begin + InnerListView.ShowColumnHeaders := Value; +end; + +procedure TcxCustomShellListView.SetViewStyle(Value: TViewStyle); +begin + FInnerListView.ListViewStyle := TcxListViewStyle(Value); + SetScrollBarsParameters; +end; + +initialization + PrepareShellSpecialFolderInfoTable; + +finalization + DestroyShellSpecialFolderInfoTable; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxShellTreeView.pas b/official/x.35/ExpressEditors Library 5/Sources/cxShellTreeView.pas new file mode 100644 index 00000000..89c6e46e --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxShellTreeView.pas @@ -0,0 +1,1163 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxShellTreeView; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, Classes, ComCtrls, CommCtrl, Controls, Forms, Graphics, + ImgList, Menus, ShlObj, StdCtrls, cxContainer, cxDataUtils, cxShellListView, + cxShellCommon, cxShellControls; + +type + TcxCustomShellTreeView = class; + + { TcxInnerShellTreeView } + + TcxInnerShellTreeView = class(TcxCustomInnerShellTreeView, IUnknown, + IcxContainerInnerControl) + private + // IcxContainerInnerControl + function GetControl: TWinControl; + function GetControlContainer: TcxContainer; + + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + procedure WMKillFocus(var Message: TWMKillFocus); message WM_KILLFOCUS; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCPaint(var Message: TMessage); message WM_NCPAINT; + procedure WMSetFocus(var Message: TWMSetFocus); message WM_SETFOCUS; + procedure WMWindowPosChanged(var Message: TWMWindowPosChanged); message WM_WINDOWPOSCHANGED; + procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure DSMShellChangeNotify(var Message: TMessage); message DSM_SHELLCHANGENOTIFY; + procedure TVMEnsureVisible(var Message: TMessage); message TVM_ENSUREVISIBLE; + protected + FContainer: TcxCustomShellTreeView; + procedure Click; override; + procedure DblClick; override; + function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); override; + function GetPopupMenu: TPopupMenu; override; + function IsLoading: Boolean; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure CreateWindowHandle(const Params: TCreateParams); override; + procedure WndProc(var Message: TMessage); override; + procedure MouseEnter(AControl: TControl); dynamic; + procedure MouseLeave(AControl: TControl); dynamic; + property Container: TcxCustomShellTreeView read FContainer; + public + constructor Create(AOwner: TComponent); override; + function CanFocus: Boolean; override; + procedure DragDrop(Source: TObject; X, Y: Integer); override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + function UpdateAction(Action: TBasicAction): Boolean; override; + property Align; + property Anchors; + property AutoExpand; + property BorderStyle; + property ChangeDelay; + property Color; + property Ctl3D; + property Cursor; + property DragDropSettings; + property Enabled; + property Font; + property HideSelection; + property HotTrack; + property Indent; + property Items; + property ListView; + property Options; + property ParentColor; + property ParentCtl3D; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property RightClickSelect; + property Root; + property ShowButtons; + property ShowHint; + property ShowLines; + property ShowRoot; + property StateImages; + property TabOrder; + property TabStop default True; + property Visible; + property OnAddFolder; + property OnChange; + property OnChanging; + property OnClick; + property OnCollapsed; + property OnCollapsing; + property OnDblClick; + property OnEdited; + property OnEditing; + property OnEnter; + property OnExit; + property OnExpanded; + property OnExpanding; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnRootChanged; + property OnShellChange; + end; + + { TcxCustomShellTreeView } + + TcxCustomShellTreeView = class(TcxContainer) + private + FInnerTreeView: TcxInnerShellTreeView; + FIsExitProcessing: Boolean; + FScrollBarsCalculating: Boolean; + FOnAddFolder: TcxShellAddFolderEvent; + FOnChange: TTVChangedEvent; + FOnChanging: TTVChangingEvent; + FOnCollapsed: TTVExpandedEvent; + FOnCollapsing: TTVCollapsingEvent; + FOnEdited: TTVEditedEvent; + FOnEditing: TTVEditingEvent; + FOnExpanded: TTVExpandedEvent; + FOnExpanding: TTVExpandingEvent; + FOnShellChange: TcxShellChangeEvent; + + procedure AddFolderHandler(Sender: TObject; AFolder: TcxShellFolder; + var ACanAdd: Boolean); + procedure ChangeHandler(Sender: TObject; Node: TTreeNode); + procedure ChangingHandler(Sender: TObject; Node: TTreeNode; + var AllowChange: Boolean); + procedure CollapsedHandler(Sender: TObject; Node: TTreeNode); + procedure CollapsingHandler(Sender: TObject; Node: TTreeNode; + var AllowCollapse: Boolean); + procedure EditedHandler(Sender: TObject; Node: TTreeNode; var S: string); + procedure EditingHandler(Sender: TObject; Node: TTreeNode; + var AllowEdit: Boolean); + procedure ExpandedHandler(Sender: TObject; Node: TTreeNode); + procedure ExpandingHandler(Sender: TObject; Node: TTreeNode; + var AllowExpansion: Boolean); + procedure ShellChangeHandler(Sender: TObject; AEventID: DWORD; + APIDL1, APIDL2: PItemIDList); + + function GetAbsolutePIDL: PItemIDList; + function GetAutoExpand: Boolean; + function GetChangeDelay: Integer; + function GetDragDropSettings: TcxDragDropSettings; + function GetFolder(AIndex: Integer): TcxShellFolder; + function GetFolderCount: Integer; + function GetHideSelection: Boolean; + function GetIndent: Integer; + function GetOptions: TcxShellTreeViewOptions; + function GetPath: string; + function GetRightClickSelect: Boolean; + function GetRoot: TcxShellTreeRoot; + function GetShellListView: TcxCustomShellListView; + function GetShowButtons: Boolean; + function GetShowInfoTips: Boolean; + function GetShowLines: Boolean; + function GetShowRoot: Boolean; + function GetStateImages: TCustomImageList; + function GetTreeHotTrack: Boolean; + procedure SetAbsolutePIDL(Value: PItemIDList); + procedure SetAutoExpand(Value: Boolean); + procedure SetChangeDelay(Value: Integer); + procedure SetDragDropSettings(Value: TcxDragDropSettings); + procedure SetHideSelection(Value: Boolean); + procedure SetIndent(Value: Integer); + procedure SetOptions(Value: TcxShellTreeViewOptions); + procedure SetPath(const Value: string); + procedure SetRightClickSelect(Value: Boolean); + procedure SetRoot(Value: TcxShellTreeRoot); + procedure SetShellListView(Value: TcxCustomShellListView); + procedure SetShowButtons(Value: Boolean); + procedure SetShowInfoTips(Value: Boolean); + procedure SetShowLines(Value: Boolean); + procedure SetShowRoot(Value: Boolean); + procedure SetStateImages(Value: TCustomImageList); + procedure SetTreeHotTrack(Value: Boolean); + protected + FDataBinding: TcxCustomDataBinding; + procedure DoExit; override; + procedure Loaded; override; + function NeedsScrollBars: Boolean; override; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); override; + procedure CurrentFolderChangedHandler(Sender: TObject; Root: TcxCustomShellRoot); virtual; + function GetDataBindingClass: TcxCustomDataBindingClass; virtual; + function GetViewOptions(AForNavigation: Boolean = False): TcxShellViewOptions; + property AutoExpand: Boolean read GetAutoExpand write SetAutoExpand default False; + property ChangeDelay: Integer read GetChangeDelay write SetChangeDelay default 0; + property DataBinding: TcxCustomDataBinding read FDataBinding; + property DragDropSettings: TcxDragDropSettings read GetDragDropSettings write SetDragDropSettings; + property HideSelection: Boolean read GetHideSelection write SetHideSelection default True; + property Indent: Integer read GetIndent write SetIndent; + property Options: TcxShellTreeViewOptions read GetOptions write SetOptions; + property RightClickSelect: Boolean read GetRightClickSelect + write SetRightClickSelect default False; + property Root: TcxShellTreeRoot read GetRoot write SetRoot; + property ShellListView: TcxCustomShellListView read GetShellListView write SetShellListView; + property ShowButtons: Boolean read GetShowButtons write SetShowButtons default True; + property ShowInfoTips: Boolean read GetShowInfoTips + write SetShowInfoTips default False; + property ShowLines: Boolean read GetShowLines write SetShowLines default True; + property ShowRoot: Boolean read GetShowRoot write SetShowRoot default True; + property StateImages: TCustomImageList read GetStateImages write SetStateImages; + property TreeHotTrack: Boolean read GetTreeHotTrack write SetTreeHotTrack default False; + property OnAddFolder: TcxShellAddFolderEvent read FOnAddFolder write FOnAddFolder; + property OnChange: TTVChangedEvent read FOnChange write FOnChange; + property OnChanging: TTVChangingEvent read FOnChanging write FOnChanging; + property OnCollapsed: TTVExpandedEvent read FOnCollapsed write FOnCollapsed; + property OnCollapsing: TTVCollapsingEvent read FOnCollapsing write FOnCollapsing; + property OnEdited: TTVEditedEvent read FOnEdited write FOnEdited; + property OnEditing: TTVEditingEvent read FOnEditing write FOnEditing; + property OnExpanded: TTVExpandedEvent read FOnExpanded write FOnExpanded; + property OnExpanding: TTVExpandingEvent read FOnExpanding write FOnExpanding; + property OnShellChange: TcxShellChangeEvent read FOnShellChange write FOnShellChange; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + procedure SetFocus; override; + function UpdateAction(Action: TBasicAction): Boolean; override; + function GetNodeAbsolutePIDL(ANode: TTreeNode): PItemIDList; + procedure UpdateContent; + property AbsolutePath: string read GetPath write SetPath; // deprecated; + property AbsolutePIDL: PItemIDList read GetAbsolutePIDL write SetAbsolutePIDL; + property FolderCount: Integer read GetFolderCount; + property Folders[AIndex: Integer]: TcxShellFolder read GetFolder; + property InnerTreeView: TcxInnerShellTreeView read FInnerTreeView; + property Path: string read GetPath write SetPath; +// property RelativePIDL: PItemIDList write SetRelativePIDL; // TODO + end; + + { TcxShellTreeView } + + TcxShellTreeView = class(TcxCustomShellTreeView) + published + property Align; + property Anchors; + property AutoExpand; + property ChangeDelay; + property Constraints; + property DragDropSettings; + property Enabled; + property HideSelection; + property Indent; + property Options; + property ParentColor default False; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property RightClickSelect; + property Root; + property ShellListView; + property ShowButtons; + property ShowHint; + property ShowInfoTips; + property ShowLines; + property ShowRoot; + property StateImages; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property TreeHotTrack; + property Visible; + property OnAddFolder; + property OnChange; + property OnChanging; + property OnClick; + property OnCollapsed; + property OnCollapsing; + property OnDblClick; + property OnEdited; + property OnEditing; + property OnEnter; + property OnExit; + property OnExpanded; + property OnExpanding; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnShellChange; + end; + +implementation + +uses + SysUtils, cxClasses, cxEdit, cxScrollBar; + +type + TcxContainerAccess = class(TcxContainer); + TcxCustomDataBindingAccess = class(TcxCustomDataBinding); + TcxInnerShellListViewAccess = class(TcxInnerShellListView); + TcxShellTreeItemProducerAccess = class(TcxShellTreeItemProducer); + +{ TcxInnerShellTreeView } + +constructor TcxInnerShellTreeView.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + BorderStyle := bsNone; + ControlStyle := ControlStyle + [csDoubleClicks]; + ParentColor := False; + ParentFont := True; +end; + +function TcxInnerShellTreeView.CanFocus: Boolean; +begin + Result := Container.CanFocusEx; +end; + +procedure TcxInnerShellTreeView.DragDrop(Source: TObject; X, Y: Integer); +begin + if Container <> nil then + Container.DragDrop(Source, Left + X, Top + Y); +end; + +function TcxInnerShellTreeView.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action) or + TcxCustomDataBindingAccess(Container.FDataBinding).ExecuteAction(Action); +end; + +function TcxInnerShellTreeView.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action) or + TcxCustomDataBindingAccess(Container.FDataBinding).UpdateAction(Action); +end; + +procedure TcxInnerShellTreeView.Click; +begin + inherited Click; + if Container <> nil then + Container.Click; +end; + +procedure TcxInnerShellTreeView.DblClick; +begin + inherited DblClick; + if Container <> nil then + Container.DblClick; +end; + +function TcxInnerShellTreeView.DoMouseWheel(Shift: TShiftState; + WheelDelta: Integer; MousePos: TPoint): Boolean; +begin + Result := (Container <> nil) and Container.DoMouseWheel(Shift, + WheelDelta, MousePos); + if not Result then + inherited DoMouseWheel(Shift, WheelDelta, MousePos); +end; + +procedure TcxInnerShellTreeView.DragOver(Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); +begin + if Container <> nil then + Container.DragOver(Source, Left + X, Top + Y, State, Accept); +end; + +function TcxInnerShellTreeView.GetPopupMenu: TPopupMenu; +begin + if Container = nil then + Result := inherited GetPopupMenu + else + Result := Container.GetPopupMenu; +end; + +function TcxInnerShellTreeView.IsLoading: Boolean; +begin + Result := csLoading in Container.ComponentState; +end; + +procedure TcxInnerShellTreeView.KeyDown(var Key: Word; Shift: TShiftState); +begin + if Container <> nil then + Container.KeyDown(Key, Shift); + if Key <> 0 then + inherited KeyDown(Key, Shift); +end; + +procedure TcxInnerShellTreeView.KeyPress(var Key: Char); +begin + if Key = Char(VK_TAB) then + Key := #0; + if Container <> nil then + Container.KeyPress(Key); + if Word(Key) = VK_RETURN then + Key := #0; + if Key <> #0 then + inherited KeyPress(Key); +end; + +procedure TcxInnerShellTreeView.KeyUp(var Key: Word; Shift: TShiftState); +begin + if Key = VK_TAB then + Key := 0; + if Container <> nil then + Container.KeyUp(Key, Shift); + if Key <> 0 then + inherited KeyUp(Key, Shift); +end; + +procedure TcxInnerShellTreeView.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + if Container <> nil then + with Container do + begin + InnerControlMouseDown := True; + try + MouseDown(Button, Shift, X + Self.Left, Y + Self.Top); + finally + InnerControlMouseDown := False; + end; + end; +end; + +procedure TcxInnerShellTreeView.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + if Container <> nil then + Container.MouseMove(Shift, X + Left, Y + Top); +end; + +procedure TcxInnerShellTreeView.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + if Container <> nil then + Container.MouseUp(Button, Shift, X + Left, Y + Top); +end; + +procedure TcxInnerShellTreeView.CreateWindowHandle(const Params: TCreateParams); +begin + inherited CreateWindowHandle(Params); + Container.SetScrollBarsParameters; +end; + +procedure TcxInnerShellTreeView.WndProc(var Message: TMessage); +begin + if (Container <> nil) and Container.InnerControlMenuHandler(Message) then + Exit; + +{$IFNDEF DELPHI5} + if Message.Msg = WM_RBUTTONDOWN then + begin + Container.LockPopupMenu(True); + try + inherited WndProc(Message); + finally + Container.LockPopupMenu(False); + end; + Exit; + end; +{$ENDIF} + + if Container <> nil then + if ((Message.Msg = WM_LBUTTONDOWN) or (Message.Msg = WM_LBUTTONDBLCLK)) and + (Container.DragMode = dmAutomatic) and not Container.IsDesigning then + begin + Container.BeginAutoDrag; + Exit; + end; + + inherited WndProc(Message); + case Message.Msg of + WM_HSCROLL, +// WM_MOUSEWHEEL, + WM_VSCROLL, + WM_WINDOWPOSCHANGED, + CM_WININICHANGE: + Container.SetScrollBarsParameters; + end; +end; + +procedure TcxInnerShellTreeView.MouseEnter(AControl: TControl); +begin +end; + +procedure TcxInnerShellTreeView.MouseLeave(AControl: TControl); +begin + if Container <> nil then + Container.ShortRefreshContainer(True); +end; + +function TcxInnerShellTreeView.GetControl: TWinControl; +begin + Result := Self; +end; + +function TcxInnerShellTreeView.GetControlContainer: TcxContainer; +begin + Result := FContainer; +end; + +procedure TcxInnerShellTreeView.WMGetDlgCode(var Message: TWMGetDlgCode); +begin + inherited; + if Container <> nil then + with Message do + begin + Result := Result or DLGC_WANTCHARS; + if GetKeyState(VK_CONTROL) >= 0 then + Result := Result or DLGC_WANTTAB; + end; +end; + +procedure TcxInnerShellTreeView.WMKillFocus(var Message: TWMKillFocus); +begin + inherited; + if (Container <> nil) and not Container.IsDestroying then + Container.FocusChanged; +end; + +procedure TcxInnerShellTreeView.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + inherited; + if UsecxScrollBars and not Container.FScrollBarsCalculating then + Container.SetScrollBarsParameters; +end; + +procedure TcxInnerShellTreeView.WMNCPaint(var Message: TMessage); +var + DC: HDC; + ABrush: HBRUSH; +begin + if not UsecxScrollBars then + begin + inherited; + Exit; + end; + + Message.Result := 1; + if UsecxScrollBars and Container.HScrollBar.Visible and Container.VScrollBar.Visible then + begin + DC := GetWindowDC(Handle); + ABrush := 0; + try + with Container.LookAndFeel do + ABrush := CreateSolidBrush(ColorToRGB(Painter.DefaultSizeGripAreaColor)); + FillRect(DC, GetSizeGripRect(Self), ABrush); + finally + if ABrush <> 0 then + DeleteObject(ABrush); + ReleaseDC(Handle, DC); + end; + end; +end; + +procedure TcxInnerShellTreeView.WMSetFocus(var Message: TWMSetFocus); +begin + inherited; + if (Container <> nil) and not Container.IsDestroying and not(csDestroying in ComponentState) + and (Message.FocusedWnd <> Container.Handle) then + Container.FocusChanged; +end; + +procedure TcxInnerShellTreeView.WMWindowPosChanged(var Message: TWMWindowPosChanged); +var + ARgn: HRGN; +begin + inherited; + if csDestroying in ComponentState then + Exit; + if Container.HScrollBar.Visible and Container.VScrollBar.Visible then + begin + ARgn := CreateRectRgnIndirect(GetSizeGripRect(Self)); + SendMessage(Handle, WM_NCPAINT, ARgn, 0); + DeleteObject(ARgn); + end; +end; + +procedure TcxInnerShellTreeView.CMMouseEnter(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseEnter(Self) + else + MouseEnter(TControl(Message.lParam)); +end; + +procedure TcxInnerShellTreeView.CMMouseLeave(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseLeave(Self) + else + MouseLeave(TControl(Message.lParam)); +end; + +procedure TcxInnerShellTreeView.DSMShellChangeNotify(var Message: TMessage); +begin + inherited; + Container.SetScrollBarsParameters; +end; + +procedure TcxInnerShellTreeView.TVMEnsureVisible(var Message: TMessage); +begin + inherited; + Container.SetScrollBarsParameters; +end; + +{ TcxCustomShellTreeView } + +constructor TcxCustomShellTreeView.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FDataBinding := GetDataBindingClass.Create(Self, Self); + with TcxCustomDataBindingAccess(FDataBinding) do + begin + OnDataChange := Self.DataChange; + OnDataSetChange := Self.DataSetChange; + OnUpdateData := Self.UpdateData; + end; + FInnerTreeView := TcxInnerShellTreeView.Create(Self); + with FInnerTreeView do + begin + FContainer := Self; + LookAndFeel.MasterLookAndFeel := Self.Style.LookAndFeel; + Parent := Self; + + OnAddFolder := Self.AddFolderHandler; + OnChange := Self.ChangeHandler; + OnChanging := Self.ChangingHandler; + OnCollapsed := Self.CollapsedHandler; + OnCollapsing := Self.CollapsingHandler; + OnEdited := Self.EditedHandler; + OnEditing := Self.EditingHandler; + OnExpanded := Self.ExpandedHandler; + OnExpanding := Self.ExpandingHandler; + OnRootChanged := Self.CurrentFolderChangedHandler; + OnShellChange := Self.ShellChangeHandler; + end; + InnerControl := FInnerTreeView; + HScrollBar.SmallChange := 1; + VScrollBar.SmallChange := 1; + Width := 121; + Height := 97; +end; + +destructor TcxCustomShellTreeView.Destroy; +begin + FreeAndNil(FInnerTreeView); + FreeAndNil(FDataBinding); + inherited Destroy; +end; + +function TcxCustomShellTreeView.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action) or + TcxCustomDataBindingAccess(FDataBinding).ExecuteAction(Action); +end; + +procedure TcxCustomShellTreeView.SetFocus; +begin + if not IsDesigning then + inherited SetFocus; +end; + +function TcxCustomShellTreeView.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action) or + TcxCustomDataBindingAccess(FDataBinding).UpdateAction(Action); +end; + +function TcxCustomShellTreeView.GetNodeAbsolutePIDL(ANode: TTreeNode): PItemIDList; +var + AIFolder: IShellFolder; + AList: TStringList; + ATempPIDL1, ATempPIDL2: PItemIDList; + AViewOptions: TcxShellViewOptions; + I: Integer; +begin + with TcxShellTreeItemProducerAccess(ANode.Data) do + if FolderPidl <> nil then + begin + Result := GetPidlCopy(FolderPidl); + Exit; + end; + + CheckShellRoot(Root); + Result := GetPidlCopy(Root.Pidl); + if ANode.Parent = nil then + Exit; + + AList := TStringList.Create; + try + repeat + AList.Insert(0, ANode.Text); + ANode := ANode.Parent; + until ANode.Parent = nil; + AIFolder := Root.ShellFolder; + AViewOptions := GetViewOptions; + for I := 0 to AList.Count - 1 do + begin + ATempPIDL1 := InternalParseDisplayName(AIFolder, AList[I], AViewOptions); + ATempPIDL2 := Result; + Result := ConcatenatePidls(Result, ATempPIDL1); + if I < AList.Count - 1 then + AIFolder.BindToObject(ATempPIDL1, nil, IID_IShellFolder, Pointer(AIFolder)); + DisposePidl(ATempPIDL1); + DisposePidl(ATempPIDL2); + end; + finally + AList.Free; + end; +end; + +procedure TcxCustomShellTreeView.UpdateContent; +begin + FInnerTreeView.UpdateContent; +end; + +procedure TcxCustomShellTreeView.DoExit; +begin + if IsDestroying or FIsExitProcessing then + Exit; + FIsExitProcessing := True; + try + try + DataBinding.UpdateDataSource; + except + SetFocus; + raise; + end; + inherited DoExit; + finally + FIsExitProcessing := False; + end; +end; + +procedure TcxCustomShellTreeView.Loaded; +begin + inherited Loaded; + InnerTreeView.Loaded; + SetScrollBarsParameters; +end; + +function TcxCustomShellTreeView.NeedsScrollBars: Boolean; +begin + Result := True; +end; + +procedure TcxCustomShellTreeView.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +var + AScrollInfo: TScrollInfo; +begin + inherited Scroll(AScrollBarKind, AScrollCode, AScrollPos); + if not Enabled then + Exit; + with FInnerTreeView do + if AScrollBarKind = sbHorizontal then + begin + CallWindowProc(DefWndProc, Handle, WM_HSCROLL, Word(AScrollCode) + + Word(AScrollPos) shl 16, HScrollBar.Handle); + AScrollPos := GetScrollPos(Handle, SB_HORZ); + end + else + begin + if (AScrollCode = scTrack) and (Win32MajorVersion >= 6) then + begin + AScrollInfo.cbSize := SizeOf(AScrollInfo); + AScrollInfo.fMask := SIF_POS; + AScrollInfo.nPos := AScrollPos; + SetScrollInfo(Handle, SB_VERT, AScrollInfo, True); + end; + CallWindowProc(DefWndProc, Handle, WM_VSCROLL, Word(AScrollCode) + + Word(AScrollPos) shl 16, VScrollBar.Handle); + AScrollPos := GetScrollPos(Handle, SB_VERT); + end; + SetScrollBarsParameters(True); +end; + +procedure TcxCustomShellTreeView.CurrentFolderChangedHandler(Sender: TObject; + Root: TcxCustomShellRoot); +begin + SetScrollBarsParameters; +end; + +function TcxCustomShellTreeView.GetDataBindingClass: TcxCustomDataBindingClass; +begin + Result := TcxDataBinding; +end; + +function TcxCustomShellTreeView.GetViewOptions(AForNavigation: Boolean = False): TcxShellViewOptions; +begin + with InnerTreeView do + begin + Result := []; + if Options.ShowNonFolders then + Include(Result, svoShowFiles); + if Options.ShowFolders then + Include(Result, svoShowFolders); + if AForNavigation or Options.ShowHidden then + Include(Result, svoShowHidden); + end; +end; + +procedure TcxCustomShellTreeView.AddFolderHandler(Sender: TObject; + AFolder: TcxShellFolder; var ACanAdd: Boolean); +begin + if Assigned(FOnAddFolder) then + FOnAddFolder(Self, AFolder, ACanAdd); +end; + +procedure TcxCustomShellTreeView.ChangeHandler(Sender: TObject; Node: TTreeNode); +begin + try + if Assigned(FOnChange) then + FOnChange(Self, Node); + finally + SetScrollBarsParameters; + end; +end; + +procedure TcxCustomShellTreeView.ChangingHandler(Sender: TObject; Node: TTreeNode; + var AllowChange: Boolean); +begin + if Assigned(FOnChanging) then + FOnChanging(Self, Node, AllowChange); +end; + +procedure TcxCustomShellTreeView.CollapsedHandler(Sender: TObject; + Node: TTreeNode); +begin + try + if Assigned(FOnCollapsed) then + FOnCollapsed(Self, Node); + finally + SetScrollBarsParameters; + end; +end; + +procedure TcxCustomShellTreeView.CollapsingHandler(Sender: TObject; + Node: TTreeNode; var AllowCollapse: Boolean); +begin + if Assigned(FOnCollapsing) then + FOnCollapsing(Self, Node, AllowCollapse); +end; + +procedure TcxCustomShellTreeView.EditedHandler(Sender: TObject; + Node: TTreeNode; var S: string); +begin + try + if Assigned(FOnEdited) then + FOnEdited(Self, Node, S); + finally + SetScrollBarsParameters; + end; +end; + +procedure TcxCustomShellTreeView.EditingHandler(Sender: TObject; Node: TTreeNode; + var AllowEdit: Boolean); +begin + if Assigned(FOnEditing) then + FOnEditing(Self, Node, AllowEdit); +end; + +procedure TcxCustomShellTreeView.ExpandedHandler(Sender: TObject; + Node: TTreeNode); +begin + try + if Assigned(FOnExpanded) then + FOnExpanded(Self, Node); + finally + SetScrollBarsParameters; + end; +end; + +procedure TcxCustomShellTreeView.ExpandingHandler(Sender: TObject; + Node: TTreeNode; var AllowExpansion: Boolean); +begin + if Assigned(FOnExpanding) then + FOnExpanding(Self, Node, AllowExpansion); +end; + +procedure TcxCustomShellTreeView.ShellChangeHandler(Sender: TObject; + AEventID: DWORD; APIDL1, APIDL2: PItemIDList); +begin + if Assigned(FOnShellChange) then + FOnShellChange(Self, AEventID, APIDL1, APIDL2); +end; + +function TcxCustomShellTreeView.GetAbsolutePIDL: PItemIDList; +begin + Result := nil; + if FInnerTreeView <> nil then + with FInnerTreeView do + if Selected <> nil then + Result := GetNodeAbsolutePIDL(Selected); +end; + +function TcxCustomShellTreeView.GetAutoExpand: Boolean; +begin + Result := FInnerTreeView.AutoExpand; +end; + +function TcxCustomShellTreeView.GetChangeDelay: Integer; +begin + Result := FInnerTreeView.ChangeDelay; +end; + +function TcxCustomShellTreeView.GetDragDropSettings: TcxDragDropSettings; +begin + Result := TcxDragDropSettings(FInnerTreeView.DragDropSettings); +end; + +function TcxCustomShellTreeView.GetFolder(AIndex: Integer): TcxShellFolder; +begin + Result := FInnerTreeView.Folders[AIndex]; +end; + +function TcxCustomShellTreeView.GetFolderCount: Integer; +begin + Result := FInnerTreeView.FolderCount; +end; + +function TcxCustomShellTreeView.GetHideSelection: Boolean; +begin + Result := FInnerTreeView.HideSelection; +end; + +function TcxCustomShellTreeView.GetIndent: Integer; +begin + Result := FInnerTreeView.Indent; +end; + +function TcxCustomShellTreeView.GetOptions: TcxShellTreeViewOptions; +begin + Result := TcxShellTreeViewOptions(FInnerTreeView.Options); +end; + +function TcxCustomShellTreeView.GetPath: string; +var + ATempPIDL: PItemIDList; +begin + Result := ''; + if FInnerTreeView <> nil then + with FInnerTreeView do + if Selected <> nil then + begin + ATempPIDL := GetNodeAbsolutePIDL(Selected); + try + Result := GetPidlName(ATempPIDL); + finally + DisposePidl(ATempPIDL); + end; + end; +end; + +function TcxCustomShellTreeView.GetRightClickSelect: Boolean; +begin + Result := FInnerTreeView.RightClickSelect; +end; + +function TcxCustomShellTreeView.GetRoot: TcxShellTreeRoot; +begin + Result := TcxShellTreeRoot(FInnerTreeView.Root) +end; + +function TcxCustomShellTreeView.GetShellListView: TcxCustomShellListView; +begin + if FInnerTreeView.ListView is TcxInnerShellListView then + Result := TcxInnerShellListViewAccess(FInnerTreeView.ListView).Container + else + Result := nil; +end; + +function TcxCustomShellTreeView.GetShowButtons: Boolean; +begin + Result := FInnerTreeView.ShowButtons; +end; + +function TcxCustomShellTreeView.GetShowInfoTips: Boolean; +begin + Result := FInnerTreeView.ShowInfoTips; +end; + +function TcxCustomShellTreeView.GetShowLines: Boolean; +begin + Result := FInnerTreeView.ShowLines; +end; + +function TcxCustomShellTreeView.GetShowRoot: Boolean; +begin + Result := FInnerTreeView.ShowRoot; +end; + +function TcxCustomShellTreeView.GetStateImages: TCustomImageList; +begin + Result := FInnerTreeView.StateImages; +end; + +function TcxCustomShellTreeView.GetTreeHotTrack: Boolean; +begin + Result := FInnerTreeView.HotTrack; +end; + +procedure TcxCustomShellTreeView.SetAbsolutePIDL(Value: PItemIDList); +begin + if (FInnerTreeView <> nil) and FInnerTreeView.HandleAllocated then + begin + if not CheckAbsolutePIDL(Value, Root, True) then + Exit; + SendMessage(FInnerTreeView.Handle, DSM_DONAVIGATE, WPARAM(Value), 0); + FInnerTreeView.DoNavigateListView; + end; +end; + +procedure TcxCustomShellTreeView.SetAutoExpand(Value: Boolean); +begin + FInnerTreeView.AutoExpand := Value; +end; + +procedure TcxCustomShellTreeView.SetChangeDelay(Value: Integer); +begin + FInnerTreeView.ChangeDelay := Value; +end; + +procedure TcxCustomShellTreeView.SetDragDropSettings(Value: TcxDragDropSettings); +begin + FInnerTreeView.DragDropSettings := Value; +end; + +procedure TcxCustomShellTreeView.SetHideSelection(Value: Boolean); +begin + FInnerTreeView.HideSelection := Value; +end; + +procedure TcxCustomShellTreeView.SetIndent(Value: Integer); +var + APrevIndent: Integer; +begin + APrevIndent := FInnerTreeView.Indent; + FInnerTreeView.Indent := Value; + if APrevIndent <> FInnerTreeView.Indent then + SetScrollBarsParameters; +end; + +procedure TcxCustomShellTreeView.SetOptions(Value: TcxShellTreeViewOptions); +begin + FInnerTreeView.Options.Assign(Value); +end; + +procedure TcxCustomShellTreeView.SetPath(const Value: string); +var + APIDL: PItemIDList; +begin + if (FInnerTreeView <> nil) and FInnerTreeView.HandleAllocated and (Path <> Value) then + begin + APIDL := PathToAbsolutePIDL(Value, Root, GetViewOptions(True)); + if APIDL <> nil then + try + SendMessage(FInnerTreeView.Handle, DSM_DONAVIGATE, WPARAM(APIDL), 0); + FInnerTreeView.DoNavigateListView; + finally + DisposePidl(APIDL); + end; + end; +end; + +procedure TcxCustomShellTreeView.SetRightClickSelect(Value: Boolean); +begin + FInnerTreeView.RightClickSelect := Value; +end; + +procedure TcxCustomShellTreeView.SetRoot(Value: TcxShellTreeRoot); +begin + FInnerTreeView.Root := Value; +end; + +procedure TcxCustomShellTreeView.SetShellListView(Value: TcxCustomShellListView); +begin + if Value = nil then + FInnerTreeView.ListView := nil + else + FInnerTreeView.ListView := Value.InnerListView; +end; + +procedure TcxCustomShellTreeView.SetShowButtons(Value: Boolean); +begin + FInnerTreeView.ShowButtons := Value; +end; + +procedure TcxCustomShellTreeView.SetShowInfoTips(Value: Boolean); +begin + FInnerTreeView.ShowInfoTips := Value; +end; + +procedure TcxCustomShellTreeView.SetShowLines(Value: Boolean); +begin + FInnerTreeView.ShowLines := Value; +end; + +procedure TcxCustomShellTreeView.SetShowRoot(Value: Boolean); +begin + FInnerTreeView.ShowRoot := Value; +end; + +procedure TcxCustomShellTreeView.SetStateImages(Value: TCustomImageList); +begin + FInnerTreeView.StateImages := Value; +end; + +procedure TcxCustomShellTreeView.SetTreeHotTrack(Value: Boolean); +begin + FInnerTreeView.HotTrack := Value; +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxSpinButton.pas b/official/x.35/ExpressEditors Library 5/Sources/cxSpinButton.pas new file mode 100644 index 00000000..afcc0ee9 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxSpinButton.pas @@ -0,0 +1,560 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSpinButton; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Classes, Controls, Forms, Graphics, Messages, StdCtrls, SysUtils, + cxClasses, cxContainer, cxControls, cxCustomData, cxEdit, cxExtEditConsts, + cxExtEditUtils, cxGraphics, cxMaskEdit, cxSpinEdit, cxTextEdit, cxVariants; + +type + { TcxSpinButtonViewData } + + TcxCustomSpinButtonProperties = class; + + TcxSpinButtonViewData = class(TcxSpinEditViewData) + private + function GetProperties: TcxCustomSpinButtonProperties; + protected + function CanPressButton(AViewInfo: TcxCustomEditViewInfo; AButtonVisibleIndex: Integer): + Boolean; override; + function IsButtonPressed(AViewInfo: TcxCustomEditViewInfo; AButtonVisibleIndex: + Integer): Boolean; override; + public + PressedState: TcxSpinEditPressedState; + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); override; + property Properties: TcxCustomSpinButtonProperties read GetProperties; + end; + + { TcxCustomSpinButtonProperties } + + TcxCustomSpinButton = class; + + TcxCustomSpinButtonProperties = class(TcxCustomSpinEditProperties) + protected + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + function IsDisplayValueNumeric: Boolean; override; + function IsEditValueNumeric: Boolean; override; + function PreserveSelection: Boolean; override; + public + constructor Create(AOwner: TPersistent); override; + class function GetContainerClass: TcxContainerClass; override; + end; + + { TcxSpinButtonProperties } + + TcxSpinButtonProperties = class(TcxCustomSpinButtonProperties) + published + property Alignment; + property AssignedValues; + property AutoSelect; + property BeepOnError; + property HideSelection; + property ImmediatePost; + property Increment; + property LargeIncrement; + property MaxValue; + property MinValue; + property ReadOnly; + property SpinButtons; + property UseCtrlIncrement; + property UseLeftAlignmentOnEditing; + property ValueType default vtInt; + property OnChange; + property OnEditValueChanged; + end; + + { TcxSpinButtonControlHook } + + TcxSpinButtonControlHook = class(TcxControlHook) + private + FParent: TWinControl; + protected + procedure HookWndProc(var AMsg: TMessage); override; + public + destructor Destroy; override; + end; + + { TcxCustomSpinButton } + + TcxCustomSpinButton = class(TcxCustomSpinEdit) + private + FAssociate: TWinControl; + FAutoWidth: Boolean; + FSpinButtonControlHook: TcxSpinButtonControlHook; + function GetActiveProperties: TcxCustomSpinButtonProperties; + function GetProperties: TcxCustomSpinButtonProperties; + procedure SetAssociate(AValue: TWinControl); + procedure SetAutoWidth(Value: Boolean); + procedure SetProperties(Value: TcxCustomSpinButtonProperties); + protected + procedure InternalSetEditValue(const Value: TcxEditValue; + AValidateEditValue: Boolean); override; + procedure InternalSetDisplayValue(const Value: TcxEditValue); override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + function CanFocusOnClick: Boolean; override; + procedure SetSize; override; + procedure Initialize; override; + function InternalDoEditing: Boolean; override; + procedure JoinToAssociate; virtual; + procedure SetAssociateText(const AValue: Variant); virtual; + function GetValue: Variant; override; + procedure SynchronizeEditValueFromAssociate; virtual; + property Associate: TWinControl read FAssociate write SetAssociate; + property AutoWidth: Boolean read FAutoWidth write SetAutoWidth default True; + property TabStop default False; + public + destructor Destroy; override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + function Increment(AButton: TcxSpinEditButton): Boolean; override; + property ActiveProperties: TcxCustomSpinButtonProperties read GetActiveProperties; + property Properties: TcxCustomSpinButtonProperties read GetProperties + write SetProperties; + end; + + { TcxSpinButton } + + TcxSpinButton = class(TcxCustomSpinButton) + private + function GetActiveProperties: TcxSpinButtonProperties; + function GetProperties: TcxSpinButtonProperties; + procedure SetProperties(Value: TcxSpinButtonProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxSpinButtonProperties read GetActiveProperties; + published + property Anchors; + property Associate; + property AutoSize; + property AutoWidth; + property BeepOnEnter; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxSpinButtonProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Value; + property Visible; + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +uses + cxEditConsts, cxEditUtils, dxThemeConsts, dxThemeManager; + +type + TWinControlAccess = class(TWinControl); + +{ TcxSpinButtonControlHook } + +destructor TcxSpinButtonControlHook.Destroy; +begin + FParent := nil; + inherited Destroy; +end; + +procedure TcxSpinButtonControlHook.HookWndProc(var AMsg: TMessage); +var + AKey: Longint; +begin + if Assigned(WinControl) and not IsDestroying and + ((AMsg.Msg = WM_KEYDOWN) or (AMsg.Msg = WM_KEYUP)) then + begin + AKey := AMsg.WParam; + if (FParent <> nil) and (AKey in [VK_UP, VK_DOWN, VK_NEXT, VK_PRIOR]) then + PostMessage(FParent.Handle, AMsg.Msg, AKey, AMsg.LParam); + end; + inherited HookWndProc(AMsg); +end; + +{ TcxSpinButtonViewData } + +procedure TcxSpinButtonViewData.Calculate(ACanvas: TcxCanvas; const ABounds: TRect; + const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); +begin + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, AIsMouseEvent); + TcxSpinEditViewInfo(AViewInfo).Text := ''; +end; + +function TcxSpinButtonViewData.CanPressButton(AViewInfo: TcxCustomEditViewInfo; + AButtonVisibleIndex: Integer): Boolean; +begin + Result := inherited CanPressButton(AViewInfo, AButtonVisibleIndex); +end; + +function TcxSpinButtonViewData.IsButtonPressed(AViewInfo: TcxCustomEditViewInfo; + AButtonVisibleIndex: Integer): Boolean; +begin + Result := inherited IsButtonPressed(AViewInfo, AButtonVisibleIndex); +end; + +function TcxSpinButtonViewData.GetProperties: TcxCustomSpinButtonProperties; +begin + Result := TcxCustomSpinButtonProperties(FProperties); +end; + +{ TcxCustomSpinButtonProperties } + +constructor TcxCustomSpinButtonProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + HideCursor := True; +end; + +class function TcxCustomSpinButtonProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxSpinButton; +end; + +class function TcxCustomSpinButtonProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxSpinButtonViewData; +end; + +function TcxCustomSpinButtonProperties.IsDisplayValueNumeric: Boolean; +begin + Result := True; +end; + +function TcxCustomSpinButtonProperties.IsEditValueNumeric: Boolean; +begin + Result := True; +end; + +function TcxCustomSpinButtonProperties.PreserveSelection: Boolean; +begin + Result := False; +end; + +{ TcxCustomSpinButton } + +destructor TcxCustomSpinButton.Destroy; +begin + FSpinButtonControlHook.Free; + inherited Destroy; +end; + +class function TcxCustomSpinButton.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomSpinButtonProperties; +end; + +function TcxCustomSpinButton.GetValue: Variant; +const + AVarTypeMap: array [TcxSpinEditValueType] of TVarType = (varInteger, varDouble); +begin + PrepareEditValue(Text, Result, InternalFocused); + if not VarIsNumeric(Result) then + Result := VarAsType(ActiveProperties.MinValue, AVarTypeMap[ActiveProperties.ValueType]); +end; + +procedure TcxCustomSpinButton.InternalSetDisplayValue(const Value: TcxEditValue); +begin + if IsDestroying then + Exit; + inherited InternalSetDisplayValue(Value); + SetAssociateText(Value); +end; + +procedure TcxCustomSpinButton.InternalSetEditValue(const Value: TcxEditValue; AValidateEditValue: Boolean); +begin + if IsDestroying then + Exit; + inherited InternalSetEditValue(Value, AValidateEditValue); + SetAssociateText(Value); +end; + +procedure TcxCustomSpinButton.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (AComponent = FAssociate) then + Associate := nil; +end; + +function TcxCustomSpinButton.CanFocusOnClick: Boolean; +begin + Result := False; +end; + +function TcxCustomSpinButton.Increment(AButton: TcxSpinEditButton): Boolean; +begin + if Assigned(Associate) then SynchronizeEditValueFromAssociate; + Result := inherited Increment(AButton); + if not Result then + Exit; + KeyboardAction := True; + try + SynchronizeEditValue; + SetAssociateText(EditValue); + finally + KeyboardAction := False; + end; +end; + +procedure TcxCustomSpinButton.SynchronizeEditValueFromAssociate; +var + FAssociateValue: TcxEditValue; +begin + if not((FAssociate is TCustomEdit) or (FAssociate is TcxCustomTextEdit)) then + Exit; + if ActiveProperties.ValueType = vtInt then + begin + if FAssociate is TcxCustomTextEdit then + FAssociateValue := cxStrToInt(TcxCustomTextEdit(FAssociate).Text, True) + else + FAssociateValue := cxStrToInt(TCustomEdit(FAssociate).Text, True); + end + else + begin + if FAssociate is TcxCustomTextEdit then + FAssociateValue := cxStrToFloat(TcxCustomTextEdit(FAssociate).Text, True) + else + FAssociateValue := cxStrToFloat(TCustomEdit(FAssociate).Text, True); + end; + if FAssociateValue <> Value then + Value := FAssociateValue; +end; + +procedure TcxCustomSpinButton.SetSize; +var + AWidth: Integer; +begin + inherited SetSize; + if not AutoWidth then + Exit; + with ViewInfo do + begin + AWidth := (BorderRect.Right - BorderRect.Left) - (TextRect.Right - TextRect.Left); + if Painter <> nil then + Dec(AWidth) + else + if Length(ButtonsInfo) > 0 then + if not ButtonsInfo[0].Data.NativeStyle then + begin + AWidth := Succ(AWidth); + if Shadow then + AWidth := AWidth + cxContainerShadowWidth; + end; + end; + Width := AWidth; +end; + +procedure TcxCustomSpinButton.Initialize; +begin + inherited Initialize; + FAutoWidth := True; + FSpinButtonControlHook := TcxSpinButtonControlHook.Create; + FSpinButtonControlHook.FParent := Self; + AutoSize := False; + TabStop := False; +end; + +function TcxCustomSpinButton.InternalDoEditing: Boolean; +begin + Result := True; +end; + +function TcxCustomSpinButton.GetActiveProperties: TcxCustomSpinButtonProperties; +begin + Result := TcxCustomSpinButtonProperties(InternalGetActiveProperties); +end; + +function TcxCustomSpinButton.GetProperties: TcxCustomSpinButtonProperties; +begin + Result := TcxCustomSpinButtonProperties(FProperties); +end; + +procedure TcxCustomSpinButton.SetAssociate(AValue: TWinControl); +var + I: Integer; + FCompoundControl: IcxCompoundControl; + + function IsClass(ClassType: TClass; const Name: string): Boolean; + begin + Result := True; + while ClassType <> nil do + begin + if ClassType.ClassNameIs(Name) then Exit; + ClassType := ClassType.ClassParent; + end; + Result := False; + end; + +begin + if AValue <> nil then + for I := 0 to Parent.ControlCount - 1 do {Is control already associated ?} + if (Parent.Controls[I] is TcxCustomSpinButton) and (Parent.Controls[I] <> Self) then + if TcxCustomSpinButton(Parent.Controls[I]).Associate = AValue then + raise EcxEditError.Create(AValue.Name + + cxGetResourceString(@scxUDAssociated) + Parent.Controls[I].Name); + + if FAssociate <> nil then + begin + FSpinButtonControlHook.WinControl := nil; + FAssociate := nil; + end; + + if (AValue <> nil) and (AValue.Parent = Self.Parent) and + not (AValue is TcxCustomSpinButton) and + not IsClass(AValue.ClassType, 'TcxDBTextEdit') and + not IsClass(AValue.ClassType, 'TcxDBMemo') and + not IsClass(AValue.ClassType, 'TDBTextEdit') and + not IsClass(AValue.ClassType, 'TDBMemo') then + begin + FAssociate := AValue; + if Supports(FAssociate, IcxCompoundControl, FCompoundControl) then + FSpinButtonControlHook.WinControl := FCompoundControl.ActiveControl + else + FSpinButtonControlHook.WinControl := FAssociate; + JoinToAssociate; + SetAssociateText(Value); + end; +end; + +procedure TcxCustomSpinButton.SetAutoWidth(Value: Boolean); +begin + if FAutoWidth <> Value then + begin + FAutoWidth := Value; + if Value then + begin + CheckHandle; + ActiveProperties.ViewStyle := vsNormal; + end + else + ActiveProperties.ViewStyle := vsButtonsOnly; + if Value then + begin + SetSize; + ShortRefreshContainer(False); + end; + end; +end; + +procedure TcxCustomSpinButton.SetProperties(Value: TcxCustomSpinButtonProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomSpinButton.JoinToAssociate; +begin + if FAssociate is TcxCustomEdit then + Font := TcxCustomEdit(FAssociate).Style.Font + else + Font := TWinControlAccess(FAssociate).Font; + Top := FAssociate.Top; + Left := FAssociate.Left + FAssociate.Width; + Height := FAssociate.Height; +end; + +procedure TcxCustomSpinButton.SetAssociateText(const AValue: Variant); +begin + if (FAssociate = nil) or ((not (FAssociate is TcxCustomTextEdit)) and + (not (FAssociate is TCustomEdit))) then Exit; + if (FAssociate is TcxCustomTextEdit) then + TcxCustomTextEdit(FAssociate).Text := VarToStr(AValue) + else + if (FAssociate is TCustomEdit) then + TCustomEdit(FAssociate).Text := VarToStr(AValue); +end; + +{ TcxSpinButton } + +class function TcxSpinButton.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxSpinButtonProperties; +end; + +function TcxSpinButton.GetActiveProperties: TcxSpinButtonProperties; +begin + Result := TcxSpinButtonProperties(InternalGetActiveProperties); +end; + +function TcxSpinButton.GetProperties: TcxSpinButtonProperties; +begin + Result := TcxSpinButtonProperties(FProperties); +end; + +procedure TcxSpinButton.SetProperties(Value: TcxSpinButtonProperties); +begin + FProperties.Assign(Value); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxSpinEdit.pas b/official/x.35/ExpressEditors Library 5/Sources/cxSpinEdit.pas new file mode 100644 index 00000000..0d024da9 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxSpinEdit.pas @@ -0,0 +1,2350 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSpinEdit; + +{$I cxVer.inc} + +interface + +uses + Windows, +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Classes, Controls, Forms, Graphics, SysUtils, cxClasses, cxContainer, + cxControls, cxDataStorage, cxDataUtils, cxEdit, cxGraphics, cxMaskEdit, + cxTextEdit, cxVariants, cxLookAndFeelPainters, cxFilterControlUtils; + +const + cxSpinBackwardButtonIndex = 0; + cxSpinForwardButtonIndex = 1; + cxSpinFastBackwardButtonIndex = 2; + cxSpinFastForwardButtonIndex = 3; + +type + TcxSpinBoundsCheckingKind = (bckDoNotExceed, bckExtendToBound, bckCircular); + TcxSpinEditButtonsPosition = (sbpHorzLeftRight, sbpHorzRight, sbpVert); + TcxSpinEditButton = (sebBackward, sebForward, sebFastBackward, sebFastForward); + + { TcxSpinEditViewInfo } + + TcxSpinEditViewInfo = class(TcxCustomTextEditViewInfo) + protected + procedure DrawHotFlatButtonBorder(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; + var ARect: TRect; out AContentRect: TRect; var APenColor, ABrushColor: TColor); override; + procedure DrawNativeButtonBorder(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; + var ARect: TRect; out AContentRect: TRect; var APenColor, ABrushColor: TColor); override; + procedure DrawUltraFlatButtonBorder(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; + AIsOffice11Style: Boolean; var ARect: TRect; var AContentRect: TRect; out APenColor, ABrushColor: TColor); override; + + procedure DrawNativeButtonBackground(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; const ARect: TRect); override; + procedure InternalPaint(ACanvas: TcxCanvas); override; + public + ArrowSize: Integer; + ButtonsPosition: TcxSpinEditButtonsPosition; + DelimiterLine: array[0..1] of TPoint; + + procedure DrawButtonContent(ACanvas: TcxCanvas; AButtonVisibleIndex: Integer; + const AContentRect: TRect; APenColor, ABrushColor: TColor; + ANeedOffsetContent: Boolean); override; + end; + + { TcxSpinEditViewData } + + TcxSpinEditPressedState = (epsNone, epsDown, epsUp, epsFastDown, epsFastUp); + TcxCustomSpinEditProperties = class; + + TcxSpinEditViewData = class(TcxCustomTextEditViewData) + private + function GetProperties: TcxCustomSpinEditProperties; + protected + function CanPressButton(AViewInfo: TcxCustomEditViewInfo; AButtonVisibleIndex: Integer): + Boolean; override; + function IsButtonPressed(AViewInfo: TcxCustomEditViewInfo; AButtonVisibleIndex: + Integer): Boolean; override; + procedure CalculateButtonNativeInfo(AButtonViewInfo: TcxEditButtonViewInfo); override; + public + PressedState: TcxSpinEditPressedState; + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); override; + procedure CalculateButtonBounds(ACanvas: TcxCanvas; AViewInfo: TcxCustomEditViewInfo; + AButtonVisibleIndex: Integer; var ButtonsRect: TRect); override; + procedure CalculateButtonViewInfo(ACanvas: TcxCanvas; AViewInfo: TcxCustomEditViewInfo; + AButtonVisibleIndex: Integer; var ButtonsRect: TRect); override; + procedure CheckButtonsOnly(AViewInfo: TcxCustomEditViewInfo; + APrevButtonsWidth, AButtonsWidth: Integer); override; + function IgnoreButtonWhileStretching( + AButtonVisibleIndex: Integer): Boolean; override; + property Properties: TcxCustomSpinEditProperties read GetProperties; + end; + + { TcxSpinEditButtons } + + TcxSpinEditButtons = class(TPersistent) + private + FOwner: TPersistent; + FPosition: TcxSpinEditButtonsPosition; + FShowFastButtons: Boolean; + FVisible: Boolean; + function GetProperties: TcxCustomSpinEditProperties; + procedure SetPosition(Value: TcxSpinEditButtonsPosition); + procedure SetShowFastButtons(Value: Boolean); + procedure SetVisible(Value: Boolean); + protected + procedure Changed; + property Properties: TcxCustomSpinEditProperties read GetProperties; + public + constructor Create(AOwner: TPersistent); virtual; + procedure Assign(Source: TPersistent); override; + published + property Position: TcxSpinEditButtonsPosition read FPosition + write SetPosition default sbpVert; + property ShowFastButtons: Boolean read FShowFastButtons + write SetShowFastButtons default False; + property Visible: Boolean read FVisible + write SetVisible default True; + end; + + { TcxSpinEditPropertiesValues } + + TcxSpinEditPropertiesValues = class(TcxTextEditPropertiesValues) + private + FValueType: Boolean; + procedure SetValueType(Value: Boolean); + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property ValueType: Boolean read FValueType write SetValueType stored False; + end; + + { TcxCustomSpinEditProperties } + + TcxSpinEditValueType = (vtInt, vtFloat); + + TcxCustomSpinEdit = class; + + TcxSpinEditGetValueEvent = procedure(Sender: TObject; const AText: TCaption; + out AValue: Variant; var ErrorText: TCaption; var Error: Boolean) of object; + + TcxCustomSpinEditProperties = class(TcxCustomMaskEditProperties) + private + FSpinButtons: TcxSpinEditButtons; + FCanEdit: Boolean; + FCircular: Boolean; + FIncrement, FLargeIncrement: Double; + FExceptionOnInvalidInput: Boolean; + FUseCtrlIncrement: Boolean; + FValueType: TcxSpinEditValueType; + FOnGetValue: TcxSpinEditGetValueEvent; + function DoubleAsValueType(AValue: Double; + AValueType: TcxSpinEditValueType): Double; + function GetAssignedValues: TcxSpinEditPropertiesValues; + function GetValueType: TcxSpinEditValueType; + function IsIncrementStored: Boolean; + function IsLargeIncrementStored: Boolean; + function IsValueTypeStored: Boolean; + procedure ReadZeroIncrement(Reader: TReader); + procedure ReadZeroLargeIncrement(Reader: TReader); + procedure SetAssignedValues(Value: TcxSpinEditPropertiesValues); + procedure SetCircular(Value: Boolean); + procedure SetSpinButtons(Value: TcxSpinEditButtons); + procedure SetValueType(Value: TcxSpinEditValueType); + function TryTextToValue(S: string; out AValue: TcxEditValue): Boolean; + function VarToCurrentValueType(AValue: TcxEditValue): TcxEditValue; + procedure WriteZeroIncrement(Writer: TWriter); + procedure WriteZeroLargeIncrement(Writer: TWriter); + protected + function DefaultFocusedDisplayValue: TcxEditValue; override; + procedure DefineProperties(Filer: TFiler); override; + class function GetAssignedValuesClass: TcxCustomEditPropertiesValuesClass; override; + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + function IsEditValueNumeric: Boolean; override; + function CheckValueBounds(const Value: Variant): Variant; + function ExtendValueUpToBound: Boolean; virtual; + function GetBoundsCheckingKind: TcxSpinBoundsCheckingKind; virtual; + function GetMaxMinValueForCurrentValueType( + AMinValue: Boolean = True): TcxEditValue; + function InternalMaxValue: TcxEditValue; virtual; + function InternalMinValue: TcxEditValue; virtual; + function IsDisplayValueNumeric: Boolean; virtual; + function IsValueBoundsValid(AValue: Extended): Boolean; + function PrepareValue(const AValue: TcxEditValue): Variant; virtual; + function PreserveSelection: Boolean; virtual; + function SetVariantType(const Value: TcxEditValue): TcxEditValue; + property AssignedValues: TcxSpinEditPropertiesValues read GetAssignedValues + write SetAssignedValues; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure Changed; override; + function CreateViewData(AStyle: TcxCustomEditStyle; + AIsInplace: Boolean; APreviewMode: Boolean = False): TcxCustomEditViewData; override; + class function GetContainerClass: TcxContainerClass; override; + function GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; override; + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + function IsDisplayValueValid(var DisplayValue: TcxEditValue; AEditFocused: Boolean): Boolean; override; + function IsEditValueValid(var EditValue: TcxEditValue; + AEditFocused: Boolean): Boolean; override; + procedure ValidateDisplayValue(var ADisplayValue: TcxEditValue; + var AErrorText: TCaption; var AError: Boolean; + AEdit: TcxCustomEdit); override; + // !!! + property CanEdit: Boolean read FCanEdit write FCanEdit default True; + property Circular: Boolean read FCircular write SetCircular default False; + property ExceptionOnInvalidInput: Boolean read FExceptionOnInvalidInput + write FExceptionOnInvalidInput default False; + property Increment: Double read FIncrement write FIncrement stored IsIncrementStored; + property LargeIncrement: Double read FLargeIncrement write FLargeIncrement + stored IsLargeIncrementStored; + property SpinButtons: TcxSpinEditButtons read FSpinButtons write SetSpinButtons; + property UseCtrlIncrement: Boolean read FUseCtrlIncrement write FUseCtrlIncrement default False; + property ValueType: TcxSpinEditValueType read GetValueType write SetValueType stored IsValueTypeStored; + property OnGetValue: TcxSpinEditGetValueEvent read FOnGetValue + write FOnGetValue; + end; + + { TcxSpinEditProperties } + + TcxSpinEditProperties = class(TcxCustomSpinEditProperties) + published + property Alignment; + property AssignedValues; + property AutoSelect; + property BeepOnError; + property CanEdit; + property ClearKey; + property DisplayFormat; + property EchoMode; + property EditFormat; + property ExceptionOnInvalidInput; + property HideSelection; + property ImeMode; + property ImeName; + property ImmediatePost; + property Increment; + property LargeIncrement; + property MaxValue; + property MinValue; + property PasswordChar; + property ReadOnly; + property SpinButtons; + property UseCtrlIncrement; + property UseDisplayFormatWhenEditing; + property UseLeftAlignmentOnEditing; + property ValidateOnEnter; + property ValueType; + property OnChange; + property OnEditValueChanged; + property OnGetValue; + property OnValidate; + end; + + { TcxCustomSpinEdit } + + TcxCustomSpinEdit = class(TcxCustomMaskEdit) + private + FInternalValue: TcxEditValue; + FIsCustomText: Boolean; + FIsCustomTextAction: Boolean; + FPressedState: TcxSpinEditPressedState; + FTimer: TcxTimer; + function GetProperties: TcxCustomSpinEditProperties; + function GetActiveProperties: TcxCustomSpinEditProperties; + procedure HandleTimer(Sender: TObject); + function IsValueStored: Boolean; + procedure SetInternalValue(AValue: TcxEditValue); + procedure SetPressedState(Value: TcxSpinEditPressedState); + procedure SetProperties(Value: TcxCustomSpinEditProperties); + procedure StopTracking; + protected + procedure ChangeHandler(Sender: TObject); override; + procedure CheckEditorValueBounds; override; + procedure DblClick; override; + procedure DoButtonDown(AButtonVisibleIndex: Integer); override; + procedure DoEditKeyDown(var Key: Word; Shift: TShiftState); override; + procedure DoEditKeyPress(var Key: Char); override; + procedure DoEditKeyUp(var Key: Word; Shift: TShiftState); override; + function DoMouseWheelDown(Shift: TShiftState; MousePos: + TPoint): Boolean; override; + function DoMouseWheelUp(Shift: TShiftState; MousePos: + TPoint): Boolean; override; + procedure FocusChanged; override; + procedure Initialize; override; + function InternalGetEditingValue: TcxEditValue; override; + function InternalGetNotPublishedStyleValues: TcxEditStyleValues; override; + function IsValidChar(AChar: Char): Boolean; override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure PropertiesChanged(Sender: TObject); override; + function RefreshContainer(const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AIsMouseEvent: Boolean): Boolean; override; + procedure SynchronizeDisplayValue; override; + procedure SynchronizeEditValue; override; + procedure DoOnGetValue(const AText: TCaption; out AValue: Variant; + var ErrorText: TCaption; var Error: Boolean); + function GetIncrement(AButton: TcxSpinEditButton): Double; virtual; + function GetValue: Variant; virtual; + function IncrementValueToStr(const AValue: TcxEditValue): string; virtual; + function InternalPrepareEditValue(const ADisplayValue: TcxEditValue; + ARaiseException: Boolean; out EditValue: TcxEditValue; + out AErrorText: TCaption): Boolean; + function IsOnGetValueEventAssigned: Boolean; + procedure SetValue(const Value: Variant); virtual; + property PressedState: TcxSpinEditPressedState read FPressedState write SetPressedState; + property Value: Variant read GetValue write SetValue stored IsValueStored; + public + procedure ClearSelection; override; + procedure CutToClipboard; override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + function Increment(AButton: TcxSpinEditButton): Boolean; virtual; + procedure PasteFromClipboard; override; + procedure PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); override; + property ActiveProperties: TcxCustomSpinEditProperties read GetActiveProperties; + property Properties: TcxCustomSpinEditProperties read GetProperties + write SetProperties; + end; + + { TcxSpinEdit } + + TcxSpinEdit = class(TcxCustomSpinEdit) + private + function GetActiveProperties: TcxSpinEditProperties; + function GetProperties: TcxSpinEditProperties; + procedure SetProperties(Value: TcxSpinEditProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxSpinEditProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DragMode; + property Enabled; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxSpinEditProperties read GetProperties write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Value; + property Visible; + property DragCursor; + property DragKind; + property ImeMode; + property ImeName; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDrag; + property OnEndDock; + property OnStartDock; + end; + + { TcxFilterSpinEditHelper } + + TcxFilterSpinEditHelper = class(TcxFilterMaskEditHelper) + public + class function EditPropertiesHasButtons: Boolean; override; + class function GetFilterEditClass: TcxCustomEditClass; override; + class function GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; override; + class procedure InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); override; + end; + +implementation + +uses + dxOffice11, dxThemeConsts, dxThemeManager, dxUxTheme, + cxGeometry, cxEditConsts, cxEditPaintUtils, cxEditUtils, cxFormats, cxDWMApi, Math; + +const + cxSpinEditTimerInitialInterval = 400; + cxSpinEditTimerInterval = 100; +{$IFDEF DELPHI6} + MaxIntValue = High(Int64); + MinIntValue = Low(Int64); +{$ELSE} + MaxIntValue = High(Integer); + MinIntValue = Low(Integer); +{$ENDIF} + +type + TcxSpinEditUltraFlatButtonPosition = (sufbpLeftMost, sufbpMiddle, sufbpRightMost, + sufbpMiddleTop, sufbpMiddleBottom, sufbpRightTop, sufbpRightBottom); + TcxSpinEditFlatButtonPosition = (sfbpLeftSide, sfbpLeftSideRightMost, + sfbpRightSide, sfbpRightSideLeftMost, sfbpMiddleTop, sfbpMiddleBottom, + sfbpRightTop, sfbpRightBottom); + +procedure CalculateSpinEditViewInfo(AViewData: TcxSpinEditViewData; + AViewInfo: TcxSpinEditViewInfo); +const + AButtonNativeStateMap: array [TcxEditButtonState] of Integer = + (UPS_DISABLED, UPS_NORMAL, UPS_PRESSED, UPS_HOT); +var + ATheme: TdxTheme; + I: Integer; +begin + if Length(AViewInfo.ButtonsInfo) = 0 then + Exit; + with AViewInfo do + if NativeStyle and AreVisualStylesMustBeUsed(NativeStyle, totSpin) then + begin + ATheme := OpenTheme(totSpin); + for I := 0 to Length(AViewInfo.ButtonsInfo) - 1 do + begin + ButtonsInfo[I].Data.NativeState := AButtonNativeStateMap[ButtonsInfo[I].Data.State]; + ButtonsInfo[I].Data.BackgroundPartiallyTransparent := IsThemeBackgroundPartiallyTransparent( + ATheme, ButtonsInfo[I].Data.NativePart, ButtonsInfo[I].Data.NativeState); + end + end + else + for I := 0 to Length(AViewInfo.ButtonsInfo) - 1 do + ButtonsInfo[I].Data.NativeState := TC_NONE; +end; + +procedure DrawSpinEdit(ACanvas: TcxCanvas; AViewInfo: TcxSpinEditViewInfo); +var + APrevClipRgn: TcxRegion; +begin + DrawTextEdit(ACanvas, AViewInfo); + with AViewInfo do + if (Length(ButtonsInfo) > 0) and (ButtonsInfo[0].Data.NativePart <> TC_NONE) and + (ButtonsPosition <> sbpHorzLeftRight) and not IsCustomDrawButton then + begin + APrevClipRgn := ACanvas.GetClipRegion; + try + ACanvas.IntersectClipRect(AViewInfo.BorderRect); + InternalPolyLine(ACanvas, [DelimiterLine[0], DelimiterLine[1]], BackgroundColor, True); + finally + ACanvas.SetClipRegion(APrevClipRgn, roSet); + end; + end; +end; + +procedure DrawSpinEditFlatButtonBorder(ACanvas: TcxCanvas; + AButtonPosition: TcxSpinEditFlatButtonPosition; var R: TRect; AContentColor, ABorderColor: TColor); +begin + with R do + case AButtonPosition of + sfbpLeftSide: + begin + DrawButtonBorder(ACanvas, R, [bBottom, bLeft, bTop], ABorderColor); + DrawButtonBorder(ACanvas, R, [bRight], AContentColor); + end; + sfbpLeftSideRightMost, sfbpRightSideLeftMost, sfbpRightTop: + begin + ACanvas.FrameRect(R, ABorderColor); + InflateRect(R, -1, -1); + end; + sfbpRightSide, sfbpMiddleTop: + begin + DrawButtonBorder(ACanvas, R, [bTop, bRight, bBottom], ABorderColor); + DrawButtonBorder(ACanvas, R, [bLeft], AContentColor); + end; + sfbpMiddleBottom: + begin + DrawButtonBorder(ACanvas, R, [bBottom, bRight], ABorderColor); + DrawButtonBorder(ACanvas, R, [bLeft, bTop], AContentColor); + end; + sfbpRightBottom: + begin + DrawButtonBorder(ACanvas, R, [bLeft, bBottom, bRight], ABorderColor); + DrawButtonBorder(ACanvas, R, [bTop], AContentColor); + end; + end; +end; + +procedure DrawSpinEditUltraFlatButtonBorder(ACanvas: TcxCanvas; R: TRect; + AButtonPosition: TcxSpinEditUltraFlatButtonPosition; ABrushColor: TColor; + AButtonViewInfo: TcxEditButtonViewInfo; const ABounds: TRect; + AIsEditBackgroundTransparent, AHasExternalBorder: Boolean; + AEditBorderStyle: TcxEditBorderStyle; out ABackgroundRect, AContentRect: TRect); +var + AHighlightColor: TColor; +begin + AHighlightColor := GetEditBorderHighlightColor( + AButtonViewInfo.Data.Style = btsOffice11); + + if (AButtonViewInfo.Data.State in [ebsDisabled, ebsNormal]) or + not AButtonViewInfo.Data.IsInplace and (AEditBorderStyle = ebsNone) or + AButtonViewInfo.Data.IsInplace and not AHasExternalBorder then + begin + if not(AButtonViewInfo.Data.State in [ebsDisabled, ebsNormal]) then + ACanvas.FrameRect(R, AHighlightColor) + else + if not AIsEditBackgroundTransparent then + ACanvas.FrameRect(R, AButtonViewInfo.Data.BackgroundColor); + InflateRect(R, -1, -1); + ABackgroundRect := R; + end + else + begin + ABackgroundRect := R; + case AButtonPosition of + sufbpLeftMost: + begin + DrawButtonBorder(ACanvas, R, [bRight], AHighlightColor); + Dec(ABackgroundRect.Right); + ExtendRect(R, Rect(1, 1, 0, 1)); + end; + sufbpMiddle: + if R.Left = ABounds.Left then + begin + DrawButtonBorder(ACanvas, R, [bRight], AHighlightColor); + Dec(ABackgroundRect.Right); + ExtendRect(R, Rect(1, 1, 0, 1)); + end + else + begin + DrawButtonBorder(ACanvas, R, [bLeft, bRight], AHighlightColor); + ExtendRect(ABackgroundRect, Rect(1, 0, 1, 0)); + ExtendRect(R, Rect(0, 1, 0, 1)); + end; + sufbpRightMost: + begin + DrawButtonBorder(ACanvas, R, [bLeft], AHighlightColor); + Inc(ABackgroundRect.Left); + ExtendRect(R, Rect(0, 1, 1, 1)); + end; + sufbpRightTop: + begin + DrawButtonBorder(ACanvas, R, [bBottom], AHighlightColor); + Dec(ABackgroundRect.Bottom); + if R.Left = ABounds.Left then + Inc(R.Left) + else + begin + DrawButtonBorder(ACanvas, R, [bLeft], AHighlightColor); + Inc(ABackgroundRect.Left); + end; + ExtendRect(R, Rect(0, 1, 1, 0)); + end; + sufbpRightBottom: + begin + DrawButtonBorder(ACanvas, R, [bTop], AHighlightColor); + Inc(ABackgroundRect.Top); + if R.Left = ABounds.Left then + Inc(R.Left) + else + begin + DrawButtonBorder(ACanvas, R, [bLeft], AHighlightColor); + Inc(ABackgroundRect.Left); + end; + ExtendRect(R, Rect(0, 0, 1, 1)); + end; + sufbpMiddleTop: + begin + DrawButtonBorder(ACanvas, R, [bLeft, bBottom, bRight], AHighlightColor); + ExtendRect(ABackgroundRect, Rect(1, 0, 1, 1)); + Inc(R.Top); + end; + sufbpMiddleBottom: + begin + DrawButtonBorder(ACanvas, R, [bLeft, bTop, bRight], AHighlightColor); + ExtendRect(ABackgroundRect, Rect(1, 1, 1, 0)); + Dec(R.Bottom); + end; + end; + end; + AContentRect := R; +end; + +{ TcxSpinEditViewInfo } + +procedure TcxSpinEditViewInfo.DrawButtonContent(ACanvas: TcxCanvas; + AButtonVisibleIndex: Integer; const AContentRect: TRect; + APenColor, ABrushColor: TColor; ANeedOffsetContent: Boolean); + +const + APainterArrowMap: array[Boolean, 0..3] of TcxEditBtnKind = ( + (cxbkSpinLeftBtn, cxbkSpinRightBtn, cxbkSpinLeftBtn, cxbkSpinRightBtn), + (cxbkSpinDownBtn, cxbkSpinUpBtn, cxbkSpinDownBtn, cxbkSpinUpBtn)); + + procedure InternalDrawArrow(const R: TRect; AColor: TColor); + const + AArrowDirectionMap: array[Boolean, 0..3] of TcxArrowDirection = ( + (adLeft, adRight, adLeft, adRight), + (adDown, adUp, adLeft, adRight) + ); + begin + DrawArrow(ACanvas, ArrowSize, R, + AArrowDirectionMap[ButtonsPosition = sbpVert, AButtonVisibleIndex], + AButtonVisibleIndex > 1, ANeedOffsetContent, AColor); + end; + +var + AButtonInfo: TcxEditButtonViewInfo; +begin + AButtonInfo := ButtonsInfo[AButtonVisibleIndex]; + if Painter <> nil then + begin + Painter.DrawEditorButton(ACanvas, AContentRect, + APainterArrowMap[ButtonsPosition = sbpVert, AButtonVisibleIndex], + EditBtnState2ButtonState[AButtonInfo.Data.State]); + end + else + if AButtonInfo.Data.State <> ebsDisabled then + InternalDrawArrow(AContentRect, APenColor) + else + begin + InternalDrawArrow(cxRectOffset(AContentRect, 1, 1), clBtnHighlight); + InternalDrawArrow(AContentRect, clBtnShadow); + end; +end; + +procedure TcxSpinEditViewInfo.DrawHotFlatButtonBorder(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; + var ARect: TRect; out AContentRect: TRect; var APenColor, ABrushColor: TColor); + + function GetButtonPosition: TcxSpinEditFlatButtonPosition; + const + AButtonPositionA: array[Boolean, TcxSpinEditButtonsPosition, sebBackward..sebForward] of TcxSpinEditFlatButtonPosition = ( + ( + (sfbpLeftSideRightMost, sfbpRightSideLeftMost), + (sfbpRightSideLeftMost, sfbpRightSide), + (sfbpRightBottom, sfbpRightTop) + ), + ( + (sfbpLeftSideRightMost, sfbpRightSideLeftMost), + (sfbpRightSide, sfbpRightSide), + (sfbpMiddleBottom, sfbpMiddleTop) + ) + ); + AFastButtonPositionA: array[TcxSpinEditButtonsPosition, sebFastBackward..sebFastForward] of TcxSpinEditFlatButtonPosition = ( + (sfbpLeftSide, sfbpRightSide), + (sfbpRightSideLeftMost, sfbpRightSide), + (sfbpRightSideLeftMost, sfbpRightSide) + ); + begin + if AButtonViewInfo.Index > 1 then + Result := AFastButtonPositionA[ButtonsPosition, TcxSpinEditButton(AButtonViewInfo.Index)] + else + Result := AButtonPositionA[Length(ButtonsInfo) > 2, ButtonsPosition, + TcxSpinEditButton(AButtonViewInfo.Index)]; + end; + +const + ABrushColorA: array [TcxEditButtonState] of TColor = ( + clBtnFace, clBtnFace, clBtnText, clBtnShadow + ); +begin + with AButtonViewInfo do + begin + ABrushColor := ABrushColorA[Data.State]; + if Data.Transparent then + ABrushColor := Data.BackgroundColor; + + if Data.State in [ebsPressed, ebsSelected] then + if Data.Transparent and (Data.State = ebsSelected) then + APenColor := clBtnShadow + else + APenColor := clBtnHighlight + else + APenColor := clBtnText; + DrawSpinEditFlatButtonBorder(ACanvas, GetButtonPosition, ARect, ABrushColor, clBtnShadow); + + AContentRect := ARect; + end; +end; + +procedure TcxSpinEditViewInfo.DrawNativeButtonBorder(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; + var ARect: TRect; out AContentRect: TRect; var APenColor, ABrushColor: TColor); +begin + if IsCustomDrawButton then + AContentRect := ARect + else + AContentRect := cxEmptyRect; +end; + +procedure TcxSpinEditViewInfo.DrawUltraFlatButtonBorder(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; + AIsOffice11Style: Boolean; var ARect: TRect; var AContentRect: TRect; out APenColor, ABrushColor: TColor); +var + AButtonPosition: TcxSpinEditUltraFlatButtonPosition; +begin + with ACanvas, AButtonViewInfo do + begin + if AButtonViewInfo.Data.Transparent then + ABrushColor := Data.BackgroundColor + else + if AButtonViewInfo.Data.State = ebsDisabled then + ABrushColor := clBtnFace + else + if AButtonViewInfo.Data.State = ebsNormal then + if AIsOffice11Style then + ABrushColor := dxOffice11DockColor1 + else + ABrushColor := clBtnFace + else + ABrushColor := GetEditButtonHighlightColor( + AButtonViewInfo.Data.State = ebsPressed, AIsOffice11Style); + case AButtonViewInfo.Index of + cxSpinFastBackwardButtonIndex: + if ButtonsPosition = sbpHorzLeftRight then + AButtonPosition := sufbpLeftMost + else + AButtonPosition := sufbpMiddle; + cxSpinFastForwardButtonIndex: + AButtonPosition := sufbpRightMost; + cxSpinBackwardButtonIndex: + if ButtonsPosition = sbpVert then + if Length(ButtonsInfo) > 2 then + AButtonPosition := sufbpMiddleBottom + else + AButtonPosition := sufbpRightBottom + else + if (Length(ButtonsInfo) = 2) and (ButtonsPosition = sbpHorzLeftRight) then + AButtonPosition := sufbpLeftMost + else + AButtonPosition := sufbpMiddle; + else + if ButtonsPosition = sbpVert then + if Length(ButtonsInfo) > 2 then + AButtonPosition := sufbpMiddleTop + else + AButtonPosition := sufbpRightTop + else + if Length(ButtonsInfo) > 2 then + AButtonPosition := sufbpMiddle + else + AButtonPosition := sufbpRightMost; + end; + DrawSpinEditUltraFlatButtonBorder(ACanvas, ARect, + AButtonPosition, ABrushColor, AButtonViewInfo, BorderRect, + Transparent, epoHasExternalBorder in PaintOptions, Self.BorderStyle, + ARect, AContentRect); + end; +end; + +procedure TcxSpinEditViewInfo.DrawNativeButtonBackground(ACanvas: TcxCanvas; AButtonViewInfo: TcxEditButtonViewInfo; const ARect: TRect); +begin + with AButtonViewInfo do + DrawThemeBackground(OpenTheme(totSpin), ACanvas.Handle, Data.NativePart, + Data.NativeState, ARect) +end; + +procedure TcxSpinEditViewInfo.InternalPaint(ACanvas: TcxCanvas); +begin + DrawSpinEdit(ACanvas, Self); +end; + +{ TcxSpinEditViewData } + +procedure TcxSpinEditViewData.Calculate(ACanvas: TcxCanvas; const ABounds: TRect; + const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); +begin + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, AIsMouseEvent); + CalculateSpinEditViewInfo(Self, TcxSpinEditViewInfo(AViewInfo)); +end; + +procedure TcxSpinEditViewData.CalculateButtonBounds(ACanvas: TcxCanvas; + AViewInfo: TcxCustomEditViewInfo; AButtonVisibleIndex: Integer; + var ButtonsRect: TRect); +var + AButtonWidth, ADefaultButtonHeight, AFastButtonWidth: Integer; + ANativeStyle: Boolean; + ASpinButtonsPosition: TcxSpinEditButtonsPosition; + Y: Integer; + + procedure CalculateButtonMetrics; + var + AClientExtent: TRect; + AEditButtonsExtent: TRect; + begin + ACanvas.Font := Style.GetVisibleFont; + AButtonWidth := CalculateEditDefaultButtonWidth(ACanvas, AViewInfo.ButtonsInfo[AButtonVisibleIndex]); + + AClientExtent := GetClientExtent(ACanvas, AViewInfo); + AEditButtonsExtent := GetButtonsExtent(ACanvas); + TcxSpinEditViewInfo(AViewInfo).ArrowSize := GetArrowSize(Size(AButtonWidth + 2, + (ButtonsRect.Bottom - ButtonsRect.Top) div 2 + 2), adUp).cy; + if ANativeStyle then + begin + ADefaultButtonHeight := ACanvas.TextHeight('Zg') + + Self.GetEditContentSizeCorrection.cy + (AClientExtent.Top + AClientExtent.Bottom) - + (AEditButtonsExtent.Top + AEditButtonsExtent.Bottom) - 1; + ADefaultButtonHeight := ADefaultButtonHeight div 2 + Integer(Odd(ADefaultButtonHeight)); + end + else + if Style.LookAndFeel.SkinPainter <> nil then + begin + with Style.LookAndFeel.SkinPainter.EditButtonSize do + begin + ADefaultButtonHeight := cy div 2 + TcxSpinEditViewInfo(AViewInfo).ArrowSize; + AFastButtonWidth := ADefaultButtonHeight * 3 div 2 + Integer(Odd(cy)); + Exit; + end; + end + else + ADefaultButtonHeight := (TcxSpinEditViewInfo(AViewInfo).ArrowSize * 2 - 1) * 2 + 1 - 2; + AFastButtonWidth := MulDiv(ADefaultButtonHeight, 3, 2) + Integer(Odd(AFastButtonWidth)); + end; + + procedure UpdateButtonsNativePart; + + procedure SetButtonsNativePart; + begin + if ASpinButtonsPosition = sbpVert then + begin + AViewInfo.ButtonsInfo[cxSpinBackwardButtonIndex].Data.NativePart := SPNP_DOWN; + AViewInfo.ButtonsInfo[cxSpinForwardButtonIndex].Data.NativePart := SPNP_UP; + end + else + begin + AViewInfo.ButtonsInfo[cxSpinBackwardButtonIndex].Data.NativePart := SPNP_DOWNHORZ; + AViewInfo.ButtonsInfo[cxSpinForwardButtonIndex].Data.NativePart := SPNP_UPHORZ; + end; + if Length(AViewInfo.ButtonsInfo) > 2 then + begin + AViewInfo.ButtonsInfo[cxSpinFastBackwardButtonIndex].Data.NativePart := SPNP_DOWNHORZ; + AViewInfo.ButtonsInfo[cxSpinFastForwardButtonIndex].Data.NativePart := SPNP_UPHORZ; + end; + end; + + procedure ResetButtonsNativePart; + var + I: Integer; + begin + for I := Low(AViewInfo.ButtonsInfo) to High(AViewInfo.ButtonsInfo) do + AViewInfo.ButtonsInfo[I].Data.NativePart := TC_NONE; + end; + + begin + if NativeStyle then + begin + SetButtonsNativePart; + end + else + ResetButtonsNativePart; + end; + + function GetDelimiterSize: Integer; + begin + if ANativeStyle and not AViewInfo.IsCustomDrawButton + then + Result := 1 + else + Result := 0; + end; + + function GetBottomCorrection: Integer; + begin + if ANativeStyle and IsCompositionEnabled and not AViewInfo.IsCustomDrawButton then + Result := 1 + else + Result := 0; + end; + +var + APrevButtonsRect: TRect; + AShowFastButtons: Boolean; +begin + if AButtonVisibleIndex <> ButtonVisibleCount - 1 then + Exit; + APrevButtonsRect := ButtonsRect; + AShowFastButtons := Properties.SpinButtons.ShowFastButtons; + ASpinButtonsPosition := Properties.SpinButtons.Position; + ANativeStyle := AreVisualStylesMustBeUsed(AViewInfo.NativeStyle, totSpin); + TcxSpinEditViewInfo(AViewInfo).ButtonsPosition := Properties.SpinButtons.Position; + + CalculateButtonMetrics; + if AShowFastButtons then + with AViewInfo.ButtonsInfo[cxSpinFastForwardButtonIndex] do + begin + Bounds := Rect(ButtonsRect.Right - AFastButtonWidth, ButtonsRect.Top, + ButtonsRect.Right, ButtonsRect.Bottom - GetBottomCorrection); + ButtonsRect.Right := Bounds.Left; + end; + + if ASpinButtonsPosition = sbpVert then + begin + with AViewInfo.ButtonsInfo[cxSpinForwardButtonIndex] do + begin + Bounds := Rect(ButtonsRect.Right - AButtonWidth, ButtonsRect.Top, + ButtonsRect.Right, ButtonsRect.Top + (cxRectHeight(ButtonsRect) - GetDelimiterSize) div 2); + Y := Bounds.Bottom + GetDelimiterSize; + end; + with AViewInfo.ButtonsInfo[cxSpinBackwardButtonIndex] do + begin + Bounds := Rect(ButtonsRect.Right - AButtonWidth, Y, + ButtonsRect.Right, ButtonsRect.Bottom); + ButtonsRect.Right := Bounds.Left; + end; + end + else + begin + with AViewInfo.ButtonsInfo[cxSpinForwardButtonIndex] do + begin + Bounds := Rect(ButtonsRect.Right - ADefaultButtonHeight, ButtonsRect.Top, + ButtonsRect.Right, ButtonsRect.Bottom - GetBottomCorrection); + ButtonsRect.Right := Bounds.Left; + Dec(ButtonsRect.Right, GetDelimiterSize); + end; + end; + + if ASpinButtonsPosition = sbpHorzLeftRight then + begin + if AShowFastButtons then + with AViewInfo.ButtonsInfo[cxSpinFastBackwardButtonIndex] do + begin + Bounds := Rect(ButtonsRect.Left, ButtonsRect.Top, + ButtonsRect.Left + AFastButtonWidth, ButtonsRect.Bottom - GetBottomCorrection); + ButtonsRect.Left := Bounds.Right; + end; + with AViewInfo.ButtonsInfo[cxSpinBackwardButtonIndex] do + begin + Bounds := Rect(ButtonsRect.Left, ButtonsRect.Top, + ButtonsRect.Left + ADefaultButtonHeight, ButtonsRect.Bottom - GetBottomCorrection); + ButtonsRect.Left := Bounds.Right; + end; + end + else + begin + if ASpinButtonsPosition = sbpHorzRight then + begin + with AViewInfo.ButtonsInfo[cxSpinBackwardButtonIndex] do + begin + Bounds := Rect(ButtonsRect.Right - ADefaultButtonHeight, ButtonsRect.Top, + ButtonsRect.Right, ButtonsRect.Bottom); + ButtonsRect.Right := Bounds.Left; + end; + end; + if AShowFastButtons then + with AViewInfo.ButtonsInfo[cxSpinFastBackwardButtonIndex] do + begin + Bounds := Rect(ButtonsRect.Right - AFastButtonWidth, ButtonsRect.Top, + ButtonsRect.Right, ButtonsRect.Bottom - GetBottomCorrection); + ButtonsRect.Right := Bounds.Left; + end; + end; + UpdateButtonsNativePart; +end; + +procedure TcxSpinEditViewData.CalculateButtonViewInfo(ACanvas: TcxCanvas; + AViewInfo: TcxCustomEditViewInfo; AButtonVisibleIndex: Integer; + var ButtonsRect: TRect); +begin + inherited CalculateButtonViewInfo(ACanvas, AViewInfo, AButtonVisibleIndex, + ButtonsRect); + if Properties.SpinButtons.Position = sbpHorzLeftRight then + begin + AViewInfo.ButtonsInfo[cxSpinBackwardButtonIndex].Data.LeftAlignment := True; + if Length(AViewInfo.ButtonsInfo) > 2 then + AViewInfo.ButtonsInfo[cxSpinFastBackwardButtonIndex].Data.LeftAlignment := True; + end; +end; + +procedure TcxSpinEditViewData.CheckButtonsOnly(AViewInfo: TcxCustomEditViewInfo; + APrevButtonsWidth, AButtonsWidth: Integer); + + procedure SetButtonsVisibleBounds; + var + I: Integer; + begin + for I := 0 to Length(AViewInfo.ButtonsInfo) - 1 do + with AViewInfo.ButtonsInfo[I] do + IntersectRect(VisibleBounds, Bounds, AViewInfo.BorderRect); + end; + +var + ASpinEditViewInfo: TcxSpinEditViewInfo; +begin + inherited CheckButtonsOnly(AViewInfo, APrevButtonsWidth, AButtonsWidth); + if Properties.SpinButtons.Position = sbpVert then + with AViewInfo.ButtonsInfo[cxSpinForwardButtonIndex].Bounds do + begin + AViewInfo.ButtonsInfo[cxSpinBackwardButtonIndex].Bounds.Left := Left; + AViewInfo.ButtonsInfo[cxSpinBackwardButtonIndex].Bounds.Right := Right; + end; + SetButtonsVisibleBounds; + if AreVisualStylesMustBeUsed(AViewInfo.NativeStyle, totSpin) then + begin + ASpinEditViewInfo := TcxSpinEditViewInfo(AViewInfo); + case Properties.SpinButtons.Position of + sbpHorzLeftRight: + with ASpinEditViewInfo do + FillChar(DelimiterLine, SizeOf(DelimiterLine), 0); + sbpHorzRight: + with AViewInfo.ButtonsInfo[cxSpinBackwardButtonIndex].Bounds do + begin + ASpinEditViewInfo.DelimiterLine[0] := Point(Right, Top); + ASpinEditViewInfo.DelimiterLine[1] := Point(Right, Bottom - 1); + end; + sbpVert: + with AViewInfo.ButtonsInfo[cxSpinForwardButtonIndex].Bounds do + begin + ASpinEditViewInfo.DelimiterLine[0] := Point(Left, Bottom); + ASpinEditViewInfo.DelimiterLine[1] := Point(Right - 1, Bottom); + end; + end; + end; +end; + +function TcxSpinEditViewData.IgnoreButtonWhileStretching( + AButtonVisibleIndex: Integer): Boolean; +begin + Result := (Properties.SpinButtons.Position = sbpVert) and + (AButtonVisibleIndex = cxSpinBackwardButtonIndex); +end; + +function TcxSpinEditViewData.CanPressButton(AViewInfo: TcxCustomEditViewInfo; + AButtonVisibleIndex: Integer): Boolean; +begin + if Edit <> nil then + Result := TcxCustomSpinEdit(Edit).PressedState = epsNone + else + Result := True; +end; + +function TcxSpinEditViewData.IsButtonPressed(AViewInfo: TcxCustomEditViewInfo; + AButtonVisibleIndex: Integer): Boolean; +var + APressedState: TcxSpinEditPressedState; +begin + if Edit = nil then + APressedState := epsNone + else + APressedState := TcxCustomSpinEdit(Edit).PressedState; + Result := (AButtonVisibleIndex + 1) = Integer(APressedState) +end; + +procedure TcxSpinEditViewData.CalculateButtonNativeInfo(AButtonViewInfo: TcxEditButtonViewInfo); +begin +end; + +function TcxSpinEditViewData.GetProperties: TcxCustomSpinEditProperties; +begin + Result := TcxCustomSpinEditProperties(FProperties); +end; + +{ TcxSpinEditButtons } + +constructor TcxSpinEditButtons.Create(AOwner: TPersistent); +begin + inherited Create; + FOwner := AOwner; + FPosition := sbpVert; + FVisible := True; +end; + +procedure TcxSpinEditButtons.Assign(Source: TPersistent); +begin + if Source is TcxSpinEditButtons then + begin + Properties.BeginUpdate; + try + with TcxSpinEditButtons(Source) do + begin + Self.Position := Position; + Self.ShowFastButtons := ShowFastButtons; + Self.Visible := Visible; + end; + finally + Properties.EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxSpinEditButtons.Changed; +begin + Properties.Changed; +end; + +function TcxSpinEditButtons.GetProperties: TcxCustomSpinEditProperties; +begin + Result := TcxCustomSpinEditProperties(FOwner); +end; + +procedure TcxSpinEditButtons.SetPosition(Value: TcxSpinEditButtonsPosition); +begin + if Value <> FPosition then + begin + FPosition := Value; + Changed; + end; +end; + +procedure TcxSpinEditButtons.SetShowFastButtons(Value: Boolean); +begin + if Value <> FShowFastButtons then + begin + FShowFastButtons := Value; + Changed; + end; +end; + +procedure TcxSpinEditButtons.SetVisible(Value: Boolean); +begin + if Value <> FVisible then + begin + FVisible := Value; + Changed; + end; +end; + +{ TcxSpinEditPropertiesValues } + +procedure TcxSpinEditPropertiesValues.Assign(Source: TPersistent); +begin + if Source is TcxSpinEditPropertiesValues then + begin + BeginUpdate; + try + inherited Assign(Source); + ValueType := TcxSpinEditPropertiesValues(Source).ValueType; + finally + EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxSpinEditPropertiesValues.RestoreDefaults; +begin + BeginUpdate; + try + inherited RestoreDefaults; + ValueType := False; + finally + EndUpdate; + end; +end; + +procedure TcxSpinEditPropertiesValues.SetValueType(Value: Boolean); +begin + if Value <> FValueType then + begin + FValueType := Value; + Changed; + end; +end; + +{ TcxCustomSpinEditProperties } + +constructor TcxCustomSpinEditProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + Buttons.Add; + Buttons.Add; + FSpinButtons := TcxSpinEditButtons.Create(Self); + FCanEdit := True; + FIncrement := 1.0; + FLargeIncrement := 10.0; +end; + +destructor TcxCustomSpinEditProperties.Destroy; +begin + FreeAndNil(FSpinButtons); + inherited Destroy; +end; + +procedure TcxCustomSpinEditProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomSpinEditProperties then + begin + BeginUpdate; + try + with Source as TcxCustomSpinEditProperties do + begin + Self.FIDefaultValuesProvider := FIDefaultValuesProvider; + Self.AssignedValues.ValueType := False; + if AssignedValues.ValueType then + Self.ValueType := ValueType; + end; + inherited Assign(Source); + with Source as TcxCustomSpinEditProperties do + begin + Self.CanEdit := CanEdit; + Self.Circular := Circular; + Self.ExceptionOnInvalidInput := ExceptionOnInvalidInput; + Self.Increment := Increment; + Self.LargeIncrement := LargeIncrement; + Self.SpinButtons := SpinButtons; + Self.UseCtrlIncrement := UseCtrlIncrement; + Self.OnGetValue := OnGetValue; + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +procedure TcxCustomSpinEditProperties.Changed; + + function GetButtonCount: Integer; + begin + Result := 0; + if SpinButtons.Visible then + begin + Inc(Result, 2); + if SpinButtons.ShowFastButtons then + Inc(Result, 2); + end; + end; + +var + AButtonCount: Integer; +begin + if FSpinButtons <> nil then + begin + BeginUpdate; + try + AButtonCount := GetButtonCount; + while Buttons.Count < AButtonCount do + Buttons.Add; + while Buttons.Count > AButtonCount do + Buttons[0].Free; + finally + EndUpdate(False); + end; + end; + inherited Changed; +end; + +function TcxCustomSpinEditProperties.CreateViewData(AStyle: TcxCustomEditStyle; + AIsInplace: Boolean; APreviewMode: Boolean = False): TcxCustomEditViewData; +begin + Result := inherited CreateViewData(AStyle, AIsInplace, APreviewMode); + with TcxSpinEditViewData(Result) do + if Edit <> nil then + PressedState := TcxCustomSpinEdit(Edit).FPressedState + else + PressedState := epsNone; +end; + +class function TcxCustomSpinEditProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxSpinEdit; +end; + +class function TcxCustomSpinEditProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxSpinEditViewInfo; +end; + +function TcxCustomSpinEditProperties.IsDisplayValueValid(var DisplayValue: TcxEditValue; AEditFocused: Boolean): + Boolean; +var + AValue: TcxEditValue; +begin + Result := inherited IsDisplayValueValid(DisplayValue, AEditFocused); + if not Result or not IsDisplayValueNumeric then + Exit; + try + if DisplayValue <> '' then + begin + Result := TryTextToValue(Trim(VarToStr(DisplayValue)), AValue); + if not Result then + Exit; + if (AValue < InternalMinValue) or (AValue > InternalMaxValue) then + DisplayValue := VarToStr(AValue); + end; + Result := True; + except + on EConvertError do + Result := False; + end; +end; + +function TcxCustomSpinEditProperties.IsEditValueValid(var EditValue: TcxEditValue; + AEditFocused: Boolean): Boolean; +var + AValue: TcxEditValue; +begin + if VarIsStr(EditValue) or VarIsNumericEx(EditValue) then + begin + Result := TryTextToValue(VarToStr(EditValue), AValue); + if Result then + EditValue := AValue; + end + else + Result := {VarIsNumericEx(EditValue) or} VarIsSoftNull(EditValue) or + VarIsDate(EditValue); + if not Result then + Exit; + try + EditValue := PrepareValue(EditValue); +// EditValue := CheckValueBounds(EditValue); + EditValue := SetVariantType(EditValue); + except + Result := False; + end; +end; + +procedure TcxCustomSpinEditProperties.ValidateDisplayValue( + var ADisplayValue: TcxEditValue; var AErrorText: TCaption; + var AError: Boolean; AEdit: TcxCustomEdit); +var + AEditValue: TcxEditValue; + AIsUserErrorDisplayValue: Boolean; +begin + if TcxCustomSpinEdit(AEdit).FIsCustomText then + AError := not TcxCustomSpinEdit(AEdit).InternalPrepareEditValue(ADisplayValue, + False, AEditValue, AErrorText) + else + AEditValue := TcxCustomSpinEdit(AEdit).FInternalValue; + if not AError then + begin + if VarIsNull(AEditValue) then + begin + AEditValue := CheckValueBounds(0); + AEditValue := SetVariantType(AEditValue); + end; + if not ExceptionOnInvalidInput then + if AEditValue < InternalMinValue then + AEditValue := InternalMinValue + else + if AEditValue > InternalMaxValue then + AEditValue := InternalMaxValue; + ADisplayValue := VarToStr(AEditValue); + if ExceptionOnInvalidInput then + begin + AError := (AEditValue < InternalMinValue) or (AEditValue > InternalMaxValue); + if AError then + AErrorText := cxGetResourceString(@cxSEditValueOutOfBounds); + end; + end; + + DoValidate(ADisplayValue, AErrorText, AError, AEdit, AIsUserErrorDisplayValue); +end; + +function TcxCustomSpinEditProperties.DefaultFocusedDisplayValue: TcxEditValue; +begin + PrepareDisplayValue(CheckValueBounds(0), Result, True) +end; + +procedure TcxCustomSpinEditProperties.DefineProperties(Filer: TFiler); + + function HasZeroIncrement: Boolean; + begin + Result := (Increment = 0) and ((Filer.Ancestor = nil) or + (TcxCustomSpinEditProperties(Filer.Ancestor).Increment <> Increment)); + end; + + function HasZeroLargeIncrement: Boolean; + begin + Result := (LargeIncrement = 0) and ((Filer.Ancestor = nil) or + (TcxCustomSpinEditProperties(Filer.Ancestor).LargeIncrement <> LargeIncrement)); + end; + +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('ZeroIncrement', ReadZeroIncrement, WriteZeroIncrement, + HasZeroIncrement); + Filer.DefineProperty('ZeroLargeIncrement', ReadZeroLargeIncrement, + WriteZeroLargeIncrement, HasZeroLargeIncrement); +end; + +class function TcxCustomSpinEditProperties.GetAssignedValuesClass: TcxCustomEditPropertiesValuesClass; +begin + Result := TcxSpinEditPropertiesValues; +end; + +function TcxCustomSpinEditProperties.GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; +begin + if not AEditFocused and not AssignedValues.DisplayFormat then + Result := evsText + else + Result := evsValue; +end; + +class function TcxCustomSpinEditProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxSpinEditViewData; +end; + +function TcxCustomSpinEditProperties.IsEditValueNumeric: Boolean; +begin + Result := True; +end; + +function TcxCustomSpinEditProperties.CheckValueBounds(const Value: Variant): Variant; +begin + Result := Value; + if VarIsNumericEx(Result) then + if IsValueBoundDefined(evbMin) and (Result < MinValue) then + Result := MinValue + else + if IsValueBoundDefined(evbMax) and (Result > MaxValue) then + Result := MaxValue; +end; + +function TcxCustomSpinEditProperties.ExtendValueUpToBound: Boolean; +begin + Result := True; +end; + +function TcxCustomSpinEditProperties.GetBoundsCheckingKind: TcxSpinBoundsCheckingKind; +begin + if FCircular then + Result := bckCircular + else + if ExtendValueUpToBound then + Result := bckExtendToBound + else + Result := bckDoNotExceed; +end; + +function TcxCustomSpinEditProperties.GetMaxMinValueForCurrentValueType( + AMinValue: Boolean = True): TcxEditValue; +begin + if ValueType = vtInt then + if AMinValue then + Result := MinIntValue + else + Result := MaxIntValue + else + if AMinValue then + Result := -MaxDouble + else + Result := MaxDouble; +end; + +function TcxCustomSpinEditProperties.InternalMaxValue: TcxEditValue; +begin + if IsValueBoundDefined(evbMax) then + Result := DoubleAsValueType(MaxValue, ValueType) + else + Result := GetMaxMinValueForCurrentValueType(False); + Result := VarToCurrentValueType(Result); +end; + +function TcxCustomSpinEditProperties.InternalMinValue: TcxEditValue; +begin + if IsValueBoundDefined(evbMin) then + Result := DoubleAsValueType(MinValue, ValueType) + else + Result := GetMaxMinValueForCurrentValueType; + Result := VarToCurrentValueType(Result); +end; + +function TcxCustomSpinEditProperties.IsDisplayValueNumeric: Boolean; +begin + Result := True; +end; + +function TcxCustomSpinEditProperties.IsValueBoundsValid(AValue: Extended): Boolean; +begin + if ValueType = vtInt then + Result := (AValue >= MinIntValue) and (AValue <= MaxIntValue) + else + Result := (AValue >= -MaxDouble) and (AValue <= MaxDouble); +end; + +function TcxCustomSpinEditProperties.PrepareValue(const AValue: TcxEditValue): Variant; +begin + if VarIsSoftNull(AValue) then + Result := VarToCurrentValueType(0) + else + Result := VarToCurrentValueType(AValue); +end; + +function TcxCustomSpinEditProperties.PreserveSelection: Boolean; +begin + Result := False; +end; + +function TcxCustomSpinEditProperties.SetVariantType(const Value: TcxEditValue): TcxEditValue; +begin + if VarIsNumericEx(Value) then + Result := VarToCurrentValueType(Value) + else + Result := Value; +end; + +function TcxCustomSpinEditProperties.DoubleAsValueType(AValue: Double; + AValueType: TcxSpinEditValueType): Double; +begin + if AValueType = vtInt then + Result := Round(AValue) + else + Result := AValue; +end; + +function TcxCustomSpinEditProperties.GetAssignedValues: TcxSpinEditPropertiesValues; +begin + Result := TcxSpinEditPropertiesValues(FAssignedValues); +end; + +function TcxCustomSpinEditProperties.GetValueType: TcxSpinEditValueType; +const + ASpinEditValueTypeMap: array [Boolean] of TcxSpinEditValueType = (vtInt, vtFloat); +begin + if AssignedValues.ValueType then + Result := FValueType + else + if IDefaultValuesProvider <> nil then + Result := ASpinEditValueTypeMap[IDefaultValuesProvider.DefaultIsFloatValue] + else + Result := vtFloat; +end; + +function TcxCustomSpinEditProperties.IsIncrementStored: Boolean; +begin + Result := FIncrement <> 1.0; +end; + +function TcxCustomSpinEditProperties.IsLargeIncrementStored: Boolean; +begin + Result := FLargeIncrement <> 10.0; +end; + +function TcxCustomSpinEditProperties.IsValueTypeStored: Boolean; +begin + Result := AssignedValues.ValueType; +end; + +procedure TcxCustomSpinEditProperties.ReadZeroIncrement(Reader: TReader); +begin + Reader.ReadBoolean; + Increment := 0; +end; + +procedure TcxCustomSpinEditProperties.ReadZeroLargeIncrement(Reader: TReader); +begin + Reader.ReadBoolean; + LargeIncrement := 0; +end; + +procedure TcxCustomSpinEditProperties.SetAssignedValues( + Value: TcxSpinEditPropertiesValues); +begin + FAssignedValues.Assign(Value); +end; + +procedure TcxCustomSpinEditProperties.SetCircular(Value: Boolean); +begin + if Value <> FCircular then + begin + FCircular := Value; + Changed; + end; +end; + +procedure TcxCustomSpinEditProperties.SetSpinButtons(Value: TcxSpinEditButtons); +begin + FSpinButtons.Assign(Value); +end; + +function TcxCustomSpinEditProperties.TryTextToValue(S: string; + out AValue: TcxEditValue): Boolean; +var + AExtendedValue: Extended; + AIntegerValue: {$IFDEF DELPHI6}Int64{$ELSE}Integer{$ENDIF}; +{$IFNDEF DELPHI6} + E: Integer; +{$ENDIF} +begin + AValue := Null; + AIntegerValue := 0; + if ValueType = vtInt then + begin + {$IFDEF DELPHI6} + Result := TryStrToInt64(S, AIntegerValue); + {$ELSE} + Val(S, AIntegerValue, E); + Result := E = 0; + {$ENDIF} + end + else + begin + Result := TextToFloat(PChar(S), AExtendedValue, fvExtended); + Result := Result and IsValueBoundsValid(AExtendedValue); + end; + if Result then + begin + if ValueType = vtInt then + AValue := AIntegerValue + else + AValue := AExtendedValue; + end; +end; + +procedure TcxCustomSpinEditProperties.SetValueType(Value: TcxSpinEditValueType); +begin + if AssignedValues.ValueType and (Value = FValueType) then + Exit; + AssignedValues.FValueType := True; + FValueType := Value; + Changed; +end; + +function TcxCustomSpinEditProperties.VarToCurrentValueType(AValue: TcxEditValue): TcxEditValue; +begin + if ValueType = vtFloat then + Result := VarAsType(AValue, varDouble) + else + Result := VarAsType(AValue, {$IFDEF DELPHI6}varInt64{$ELSE}varInteger{$ENDIF}); +end; + +procedure TcxCustomSpinEditProperties.WriteZeroIncrement(Writer: TWriter); +begin + Writer.WriteBoolean(True); +end; + +procedure TcxCustomSpinEditProperties.WriteZeroLargeIncrement(Writer: TWriter); +begin + Writer.WriteBoolean(True); +end; + +{ TcxCustomSpinEdit } + +procedure TcxCustomSpinEdit.ClearSelection; +begin + if not (Focused and not ActiveProperties.CanEdit) then + begin + FIsCustomTextAction := True; + try + inherited ClearSelection; + finally + FIsCustomTextAction := False; + end; + end; +end; + +procedure TcxCustomSpinEdit.CutToClipboard; +begin + if not (Focused and not ActiveProperties.CanEdit) then + begin + FIsCustomTextAction := True; + try + inherited CutToClipboard; + finally + FIsCustomTextAction := False; + end; + end; +end; + +class function TcxCustomSpinEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomSpinEditProperties; +end; + +function TcxCustomSpinEdit.Increment(AButton: TcxSpinEditButton): Boolean; + + function GetMinMaxValueDelta(const AValue: Variant; + AIsMin: Boolean = True): Variant; + var + ADelta, AMaxRange, ARange: Variant; + begin + if AIsMin then + begin + AMaxRange := ActiveProperties.GetMaxMinValueForCurrentValueType; + ARange := ActiveProperties.InternalMinValue; + end + else + begin + AMaxRange := ActiveProperties.GetMaxMinValueForCurrentValueType(False); + ARange := ActiveProperties.InternalMaxValue; + end; + + if (ARange > 0) and (AValue > 0) or + (ARange < 0) and (AValue < 0) then + Result := ARange - AValue + else + begin + ADelta := AMaxRange - ARange; + ADelta := ADelta + AValue; + if (ADelta < 0) and (AValue < 0) or + (ADelta > 0) and (AValue > 0) then + Result := AMaxRange + else + Result := ARange - AValue; + end; + end; + + function InternalIncrement(var AValue: Variant; AIncrement: Variant): Boolean; + var + AMaxValueDelta, AMinValueDelta: TcxEditValue; + begin + Result := True; + AIncrement := ActiveProperties.VarToCurrentValueType(AIncrement); + AMinValueDelta := GetMinMaxValueDelta(AValue); + AMaxValueDelta := GetMinMaxValueDelta(AValue, False); + if (AIncrement < AMinValueDelta) or (AIncrement > AMaxValueDelta) then + case ActiveProperties.GetBoundsCheckingKind of + bckDoNotExceed: + begin + Result := False; + Exit; + end; + bckExtendToBound: + if AIncrement < AMinValueDelta then + AValue := ActiveProperties.InternalMinValue + else + AValue := ActiveProperties.InternalMaxValue; + bckCircular: + if AIncrement < AMinValueDelta then + AValue := ActiveProperties.InternalMaxValue + AIncrement + 1 + - AMinValueDelta + else + AValue := ActiveProperties.InternalMinValue + AIncrement - 1 + - AMaxValueDelta; + end + else + AValue := AValue + AIncrement; + end; + + function GetNewValue(out AValue: Variant): Boolean; + var + ABoundsCheckingKind: TcxSpinBoundsCheckingKind; + begin + Result := False; + with ActiveProperties do + begin + ABoundsCheckingKind := ActiveProperties.GetBoundsCheckingKind; + AValue := Value; + if AValue < InternalMinValue then + if AButton in [sebForward, sebFastForward] then + AValue := InternalMinValue + else + if ABoundsCheckingKind = bckCircular then + AValue := InternalMaxValue + else + Exit + else + if AValue > InternalMaxValue then + if AButton in [sebBackward, sebFastBackward] then + AValue := InternalMaxValue + else + if ABoundsCheckingKind = bckCircular then + AValue := InternalMinValue + else + Exit + else + begin + if not InternalIncrement(AValue, GetIncrement(AButton)) then + Exit; + end; + end; + Result := True; + AValue := ActiveProperties.SetVariantType(AValue); + end; + +var + ADisplayValue: TcxEditValue; + APrevText: string; + AValue: Variant; + APrevSelStart: Integer; + APrevSelLength: Integer; +begin + LockChangeEvents(True); + try + Result := False; + if not DoEditing then + Exit; + if not GetNewValue(AValue) then + Exit; + + APrevText := Text; + + ADisplayValue := IncrementValueToStr(AValue); + APrevSelStart := SelStart; + APrevSelLength := SelLength; + SetInternalValue(AValue); + KeyboardAction := True; + try + SetInternalDisplayValue(ADisplayValue); + finally + KeyboardAction := False; + end; + Result := not InternalCompareString(APrevText, Text, True); + if Result then + begin + ModifiedAfterEnter := True; + if ActiveProperties.PreserveSelection then + SetSelection(APrevSelStart, APrevSelLength) + else + SelStart := Length(Text); + if ActiveProperties.ImmediatePost and CanPostEditValue and ValidateEdit(True) then + begin + InternalPostEditValue; + SynchronizeDisplayValue; + end; + end; + finally + LockChangeEvents(False); + end; +end; + +procedure TcxCustomSpinEdit.PasteFromClipboard; +begin + if not (Focused and not ActiveProperties.CanEdit) then + begin + FIsCustomTextAction := True; + try + inherited PasteFromClipboard; + finally + FIsCustomTextAction := False; + end; + end; +end; + +procedure TcxCustomSpinEdit.PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); +var + AErrorText: TCaption; +begin + InternalPrepareEditValue(ADisplayValue, True, EditValue, AErrorText); +end; + +procedure TcxCustomSpinEdit.ChangeHandler(Sender: TObject); +begin + FIsCustomText := FIsCustomTextAction; + inherited ChangeHandler(Sender); + FIsCustomTextAction := False; +end; + +procedure TcxCustomSpinEdit.CheckEditorValueBounds; +begin + KeyboardAction := ModifiedAfterEnter; + try + with ActiveProperties do + if Value < InternalMinValue then + Value := InternalMinValue + else + if Value > InternalMaxValue then + Value := InternalMaxValue; + finally + KeyboardAction := False; + end; +end; + +procedure TcxCustomSpinEdit.DblClick; +var + P: TPoint; +begin + inherited DblClick; + P := ScreenToClient(InternalGetCursorPos); + if ButtonVisibleIndexAt(P) = -1 then + StopTracking; +end; + +procedure TcxCustomSpinEdit.DoButtonDown(AButtonVisibleIndex: Integer); + + procedure CreateTimer; + begin + if ActiveProperties.ReadOnly or not DataBinding.IsDataAvailable then + Exit; + if FTimer <> nil then + FTimer.Free; + FTimer := TcxTimer.Create(Self); + FTimer.Interval := cxSpinEditTimerInitialInterval; + FTimer.OnTimer := HandleTimer; + end; + +begin + inherited DoButtonDown(AButtonVisibleIndex); + if FPressedState = epsNone then + with ViewInfo do + if PressedButton <> -1 then + begin + Increment(TcxSpinEditButton(PressedButton)); + CreateTimer; + end; +end; + +procedure TcxCustomSpinEdit.DoEditKeyDown(var Key: Word; Shift: TShiftState); +const + APressedStateMap: array[TcxSpinEditButton] of TcxSpinEditPressedState = + (epsDown, epsUp, epsFastDown, epsFastUp); +var + AButton: TcxSpinEditButton; +begin + FIsCustomTextAction := False; + if ((Key = VK_UP) or (Key = VK_DOWN) or (Key = VK_NEXT) or (Key = VK_PRIOR)) and + not (ActiveProperties.UseCtrlIncrement and not (ssCtrl in Shift)) then + begin + if not DataBinding.Modified and not DoEditing then + Exit; + case Key of + VK_UP: + AButton := sebForward; + VK_DOWN: + AButton := sebBackward; + VK_PRIOR: + AButton := sebFastForward; + else + AButton := sebFastBackward; + end; + PressedState := APressedStateMap[AButton]; + + if HasNativeHandle(Self, GetCapture) then + SetCaptureControl(nil); + Increment(AButton); + Key := 0; + end + else + begin + StopTracking; + if Key <> VK_ESCAPE then + FIsCustomTextAction := True; + if not ActiveProperties.CanEdit and CanKeyDownModifyEdit(Key, Shift) then + begin + DoAfterKeyDown(Key, Shift); + Key := 0; + end; + end; + + if Key <> 0 then + inherited DoEditKeyDown(Key, Shift); +end; + +procedure TcxCustomSpinEdit.DoEditKeyPress(var Key: Char); +begin + if (Key = '.') or (Key = ',') then + Key := DecimalSeparator; + if IsTextChar(Key) or (Key = Char(VK_BACK)) or (Key = Char(VK_DELETE)) then + if not IsValidChar(Key) then + begin + Key := #0; + Beep; + end + else + FIsCustomTextAction := True; + if Key <> #0 then + inherited DoEditKeyPress(Key); +end; + +procedure TcxCustomSpinEdit.DoEditKeyUp(var Key: Word; Shift: TShiftState); +begin + FIsCustomTextAction := False; + inherited DoEditKeyUp(Key, Shift); + if Key = 0 then + Exit; + if (Key = VK_UP) or (Key = VK_DOWN) or (Key = VK_NEXT) or (Key = VK_PRIOR) then + StopTracking; +end; + +function TcxCustomSpinEdit.DoMouseWheelDown(Shift: TShiftState; + MousePos: TPoint): Boolean; +begin + Result := HandleMouseWheel(Shift); + if Result then + Increment(sebBackward); +end; + +function TcxCustomSpinEdit.DoMouseWheelUp(Shift: TShiftState; + MousePos: TPoint): Boolean; +begin + Result := HandleMouseWheel(Shift); + if Result then + Increment(sebForward); +end; + +procedure TcxCustomSpinEdit.FocusChanged; +begin + inherited FocusChanged; + StopTracking; +end; + +procedure TcxCustomSpinEdit.Initialize; +begin + inherited Initialize; + InternalEditValue := 0; + FPressedState := epsNone; +end; + +function TcxCustomSpinEdit.InternalGetEditingValue: TcxEditValue; +begin + Result := Value; +end; + +function TcxCustomSpinEdit.InternalGetNotPublishedStyleValues: TcxEditStyleValues; +begin + Result := inherited InternalGetNotPublishedStyleValues - + [svButtonStyle, svButtonTransparency, svGradientButtons]; +end; + +function TcxCustomSpinEdit.IsValidChar(AChar: Char): Boolean; +begin + with ActiveProperties do + if CanEdit and IsOnGetValueEventAssigned then + begin + Result := True; + Exit; + end; + if ActiveProperties.ValueType = vtFloat then + Result := IsNumericChar(AChar, ntExponent) + else + Result := IsNumericChar(AChar, ntInteger) or + (AChar = 'e') or (AChar = 'E'); + Result := Result or (AChar < #32) or + (AnsiChar(AChar) in ActiveProperties.ValidChars); + if not ActiveProperties.CanEdit and Result and ((AChar >= #32) or + (AChar = Char(#8)) or (AChar = Char(VK_DELETE))) then + Result := False; +end; + +procedure TcxCustomSpinEdit.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + StopTracking; +end; + +procedure TcxCustomSpinEdit.PropertiesChanged(Sender: TObject); +begin + inherited PropertiesChanged(Sender); + if not DataBinding.CanCheckEditorValue and ModifiedAfterEnter then + CheckEditorValueBounds; +end; + +function TcxCustomSpinEdit.RefreshContainer(const P: TPoint; Button: TcxMouseButton; + Shift: TShiftState; AIsMouseEvent: Boolean): Boolean; +begin + Result := inherited RefreshContainer(P, Button, Shift, AIsMouseEvent); + with ViewInfo do + if (Length(ButtonsInfo) > 0) and (PressedButton = -1) and (CaptureButtonVisibleIndex = -1) then + StopTracking; +end; + +procedure TcxCustomSpinEdit.SynchronizeDisplayValue; +var + AValue: TcxEditValue; +begin + AValue := EditValue; + with ActiveProperties do + if IsEditValueValid(AValue, Focused) then + SetInternalValue(PrepareValue(AValue)) + else + SetInternalValue(ActiveProperties.CheckValueBounds(0)); + inherited SynchronizeDisplayValue; +end; + +procedure TcxCustomSpinEdit.SynchronizeEditValue; +begin + inherited SynchronizeEditValue; + SetInternalValue(FEditValue); +end; + +procedure TcxCustomSpinEdit.DoOnGetValue(const AText: TCaption; + out AValue: Variant; var ErrorText: TCaption; var Error: Boolean); +begin + with Properties do + if Assigned(OnGetValue) then + OnGetValue(Self, AText, AValue, ErrorText, Error); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnGetValue) then + OnGetValue(Self, AText, AValue, ErrorText, Error); +end; + +function TcxCustomSpinEdit.GetIncrement(AButton: TcxSpinEditButton): Double; +begin + if AButton in [sebBackward, sebForward] then + Result := ActiveProperties.Increment + else + Result := ActiveProperties.LargeIncrement; + if ActiveProperties.ValueType = vtInt then + Result := Round(Result); + if AButton in [sebBackward, sebFastBackward] then + Result := -Result; +end; + +function TcxCustomSpinEdit.GetProperties: TcxCustomSpinEditProperties; +begin + Result := TcxCustomSpinEditProperties(FProperties); +end; + +function TcxCustomSpinEdit.GetActiveProperties: TcxCustomSpinEditProperties; +begin + Result := TcxCustomSpinEditProperties(InternalGetActiveProperties); +end; + +function TcxCustomSpinEdit.GetValue: Variant; +begin + if Focused then + begin + if FIsCustomText then + PrepareEditValue(Text, Result, Focused) + else + Result := FInternalValue; + if not VarIsNumericEx(Result) then // Null + Result := ActiveProperties.CheckValueBounds(0); + end + else + begin + if VarIsNumericEx(EditValue) then + Result := EditValue + else + if VarIsStr(EditValue) then + begin + if EditValue = '' then + Result := ActiveProperties.CheckValueBounds(0) + else + if not ActiveProperties.TryTextToValue(EditValue, Result) then + Result := ActiveProperties.CheckValueBounds(0); + end + else + Result := ActiveProperties.CheckValueBounds(0); + end; + Result := ActiveProperties.SetVariantType(Result); +end; + +function TcxCustomSpinEdit.IncrementValueToStr(const AValue: TcxEditValue): string; +var + ADisplayValue: TcxEditValue; +begin + ActiveProperties.PrepareDisplayValue(AValue, ADisplayValue, InternalFocused); + Result := ADisplayValue; +end; + +function TcxCustomSpinEdit.InternalPrepareEditValue( + const ADisplayValue: TcxEditValue; ARaiseException: Boolean; + out EditValue: TcxEditValue; out AErrorText: TCaption): Boolean; +var + AError: Boolean; + AValue: Variant; +begin + Result := True; + if ADisplayValue = '' then + with ActiveProperties do + if (IDefaultValuesProvider <> nil) and IDefaultValuesProvider.DefaultRequired then + EditValue := ActiveProperties.CheckValueBounds(0) + else + EditValue := Null + else + begin + AError := not ActiveProperties.TryTextToValue(VarToStr(ADisplayValue), AValue); + if AError then + begin + AErrorText := ''; + if IsOnGetValueEventAssigned then + try + DoOnGetValue(ADisplayValue, AValue, AErrorText, AError); + except + on E: Exception do + if ARaiseException then + raise + else + begin + Result := False; + AErrorText := E.Message; + Exit; + end; + end; + end; + + if AError then + begin + if AErrorText = '' then + AErrorText := cxGetResourceString(@cxSSpinEditInvalidNumericValue); + if not ActiveProperties.ExceptionOnInvalidInput then + AErrorText := ''; + if ARaiseException and ActiveProperties.ExceptionOnInvalidInput then + raise EcxEditError.Create(AErrorText); + AValue := FInternalValue; + end; + EditValue := AValue; + Result := not AError; + end; +// ActiveProperties.CheckValueBounds(EditValue); + EditValue := ActiveProperties.SetVariantType(EditValue); +end; + +function TcxCustomSpinEdit.IsOnGetValueEventAssigned: Boolean; +begin + Result := Assigned(Properties.OnGetValue) or + Assigned(ActiveProperties.OnGetValue); +end; + +procedure TcxCustomSpinEdit.HandleTimer(Sender: TObject); +begin + if FTimer.Interval = cxSpinEditTimerInitialInterval then + FTimer.Interval := cxSpinEditTimerInterval; + if ViewInfo.PressedButton <> -1 then + Increment(TcxSpinEditButton(ViewInfo.PressedButton)); +end; + +function TcxCustomSpinEdit.IsValueStored: Boolean; +begin + Result := not VarEqualsExact(Value, 0); +end; + +procedure TcxCustomSpinEdit.SetInternalValue(AValue: TcxEditValue); +begin + FInternalValue := ActiveProperties.SetVariantType(AValue); +end; + +procedure TcxCustomSpinEdit.SetPressedState(Value: TcxSpinEditPressedState); +const + ASpinButtonMap: array[TcxSpinEditPressedState] of TcxSpinEditButton = + (sebBackward, sebBackward, sebForward, sebFastBackward, sebFastForward); +var + I: Integer; +begin + if (Length(ViewInfo.ButtonsInfo) > 0) and (Value <> FPressedState) then + begin + FPressedState := Value; + CalculateViewInfo(False); + for I := 0 to Length(ViewInfo.ButtonsInfo) - 1 do + InvalidateRect(ViewInfo.ButtonsInfo[I].Bounds, False); + end; +end; + +procedure TcxCustomSpinEdit.SetProperties(Value: TcxCustomSpinEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomSpinEdit.SetValue(const Value: Variant); +var + AValue: TcxEditValue; +begin + if VarIsNumericEx(Value) then + begin + AValue := Value; + if ActiveProperties.IsEditValueValid(AValue, Focused) then + InternalEditValue := AValue; + end; +end; + +procedure TcxCustomSpinEdit.StopTracking; +var + I: Integer; +begin + CaptureButtonVisibleIndex := -1; + PressedState := epsNone; + if Length(ViewInfo.ButtonsInfo) > 0 then + for I := 0 to 1 do + with ViewInfo.ButtonsInfo[I] do + if Data.State = ebsPressed then + begin + Data.State := ebsNormal; + CalculateViewInfo(False); + InvalidateRect(Bounds, False); + end; + + FreeAndNil(FTimer); + if GetCaptureControl = Self then + SetCaptureControl(nil); +end; + +{ TcxSpinEdit } + +class function TcxSpinEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxSpinEditProperties; +end; + +function TcxSpinEdit.GetActiveProperties: TcxSpinEditProperties; +begin + Result := TcxSpinEditProperties(InternalGetActiveProperties); +end; + +function TcxSpinEdit.GetProperties: TcxSpinEditProperties; +begin + Result := TcxSpinEditProperties(FProperties); +end; + +procedure TcxSpinEdit.SetProperties(Value: TcxSpinEditProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxFilterSpinEditHelper } + +class function TcxFilterSpinEditHelper.EditPropertiesHasButtons: Boolean; +begin + Result := True; +end; + +class function TcxFilterSpinEditHelper.GetFilterEditClass: TcxCustomEditClass; +begin + Result := TcxSpinEdit; +end; + +class function TcxFilterSpinEditHelper.GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; +begin + Result := [fcoEqual..fcoGreaterEqual, fcoBlanks, fcoNonBlanks]; + if AExtendedSet then + Result := Result + [fcoBetween..fcoNotInList] +end; + +class procedure TcxFilterSpinEditHelper.InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); +begin + inherited InitializeProperties(AProperties, AEditProperties, AHasButtons); + with TcxCustomSpinEditProperties(AProperties) do + CanEdit := True; +end; + +initialization + GetRegisteredEditProperties.Register(TcxSpinEditProperties, scxSEditRepositorySpinItem); + FilterEditsController.Register(TcxSpinEditProperties, TcxFilterSpinEditHelper); + +finalization + FilterEditsController.Unregister(TcxSpinEditProperties, TcxFilterSpinEditHelper); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxSplitter.pas b/official/x.35/ExpressEditors Library 5/Sources/cxSplitter.pas new file mode 100644 index 00000000..436783e9 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxSplitter.pas @@ -0,0 +1,2481 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSplitter; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, Controls, Forms, Graphics, Messages, SysUtils, cxClasses, + cxControls, cxExtEditConsts, cxExtEditUtils, cxGraphics, cxLookAndFeels; + +type + TcxPositionAfterOpen = 2..High(Integer); + TcxSplitterAlign = (salBottom, salLeft, salRight, salTop); + TcxSplitterDragState = (sstNormal, sstResizing, sstHotZoneClick); + TcxSplitterMouseState = (smsClicked, smsInHotZone); + TcxSplitterMouseStates = set of TcxSplitterMouseState; + TcxSplitterState = (ssOpened, ssClosed); + TcxSplitterDirection = (cxsdLeftToRight, cxsdRightToLeft, cxsdTopToBottom, cxsdBottomToTop); + TCanResizeEvent = procedure(Sender: TObject; var NewSize: Integer; var Accept: Boolean) of object; + TBeforeOpenHotZoneEvent = procedure(Sender: TObject; + var NewSize: Integer; var AllowOpen: Boolean) of object; + TBeforeCloseHotZoneEvent = procedure(Sender: TObject; var AllowClose: Boolean) of object; + +type + TcxCustomSplitter = class; + + { TcxHotZoneStyle } + + TcxHotZoneStyle = class(TPersistent) + private + FOwner: TcxCustomSplitter; + FSizePercent: TcxNaturalNumber; + FVisible: Boolean; + FHotZoneRect: TRect; + procedure SetSizePercent(Value: TcxNaturalNumber); + procedure SetVisible(Value: Boolean); + protected + procedure Changed; virtual; + function SplitterDirection: TcxSplitterDirection; virtual; + function CalculateHotZoneRect(const ABounds: TRect): TRect; virtual; + function GetMinSize: TcxNaturalNumber; virtual; + function GetMaxSize: TcxNaturalNumber; virtual; + function DrawHotZone(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean): TRect; virtual; + procedure DrawBackground(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean); virtual; + public + constructor Create(AOwner: TcxCustomSplitter); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + property SizePercent: TcxNaturalNumber read FSizePercent write SetSizePercent default 30; + property Visible: Boolean read FVisible write SetVisible default True; + property HotZoneRect: TRect read FHotZoneRect write FHotZoneRect; + property Owner: TcxCustomSplitter read FOwner; + end; + + TcxHotZoneStyleClass = class of TcxHotZoneStyle; + + { TcxMediaPlayer9Style } + TcxMediaPlayer9Style = class(TcxHotZoneStyle) + private + FArrowRect: TRect; + FArrowColor: TColor; + FArrowHighlightColor: TColor; + FLightColor: TColor; + FBorderColor: TColor; + FShadowStartColor: TColor; + FShadowHighlightStartColor: TColor; + procedure SetArrowColor(Value: TColor); + procedure SetArrowHighlightColor(Value: TColor); + procedure SetLightColor(Value: TColor); + procedure SetBorderColor(Value: TColor); + procedure SetShadowStartColor(Value: TColor); + procedure SetShadowHighlightStartColor(Value: TColor); + protected + function DrawHotZone(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean): TRect; override; + procedure DrawBackground(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean); override; + function CalculateHotZoneRect(const ABounds: TRect): TRect; override; + public + constructor Create(AOwner: TcxCustomSplitter); override; + procedure Assign(Source: TPersistent); override; + published + property SizePercent; + property Visible; + property ArrowColor: TColor read FArrowColor write SetArrowColor default clWindowText; + property ArrowHighlightColor: TColor read FArrowHighlightColor write SetArrowHighlightColor default clBlue; + property LightColor: TColor read FLightColor write SetLightColor default clWindow; + property BorderColor: TColor read FBorderColor write SetBorderColor default clBtnShadow; + property ShadowStartColor: TColor read FShadowStartColor write SetShadowStartColor default $00F5E6CD; + property ShadowHighlightStartColor: TColor read FShadowHighlightStartColor + write SetShadowHighlightStartColor default $00AFF5C3; + end; + + { TcxMediaPlayer8Style } + TcxMediaPlayer8Style = class(TcxHotZoneStyle) + private + FLTPointsRect: TRect; + FRBPointsRect: TRect; + FArrowRect: TRect; + FArrowColor: TColor; + FArrowHighlightColor: TColor; + FLightColor: TColor; + FShadowColor: TColor; + procedure SetArrowColor(Value: TColor); + procedure SetArrowHighlightColor(Value: TColor); + procedure SetLightColor(Value: TColor); + procedure SetShadowColor(Value: TColor); + procedure DrawArrowRect(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean); + protected + function DrawHotZone(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean): TRect; override; + procedure DrawBackground(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean); override; + function CalculateHotZoneRect(const ABounds: TRect): TRect; override; + public + constructor Create(AOwner: TcxCustomSplitter); override; + procedure Assign(Source : TPersistent); override; + published + property SizePercent; + property Visible; + property ArrowColor: TColor read FArrowColor write SetArrowColor default clWindowText; + property ArrowHighlightColor: TColor read FArrowHighlightColor write SetArrowHighlightColor default clWindow; + property LightColor: TColor read FLightColor write SetLightColor default clWindow; + property ShadowColor: TColor read FShadowColor write SetShadowColor default clBtnShadow; + end; + + { TcxXPTaskBarStyle } + TcxXPTaskBarStyle = class(TcxHotZoneStyle) + private + FLightColor: TColor; + FShadowColor: TColor; + FLTPointsRect: TRect; + FRBPointsRect: TRect; + procedure SetLightColor(Value: TColor); + procedure SetShadowColor(Value: TColor); + protected + function DrawHotZone(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean): TRect; override; + procedure DrawBackground(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean); override; + function CalculateHotZoneRect(const ABounds: TRect): TRect; override; + public + constructor Create(AOwner: TcxCustomSplitter); override; + procedure Assign(Source : TPersistent); override; + published + property SizePercent; + property Visible; + property LightColor: TColor read FLightColor write SetLightColor default clWindow; + property ShadowColor: TColor read FShadowColor write SetShadowColor default clBtnShadow; + end; + + { TcxSimpleStyle } + TcxSimpleStyle = class(TcxHotZoneStyle) + private + FArrowColor: TColor; + FArrowHighlightColor: TColor; + FLightColor: TColor; + FShadowColor: TColor; + FDotsColor: TColor; + FDotsShadowColor: TColor; + FLTArrowRect: TRect; + FRBArrowRect: TRect; + procedure SetArrowColor(Value: TColor); + procedure SetArrowHighlightColor(Value: TColor); + procedure SetLightColor(Value: TColor); + procedure SetShadowColor(Value: TColor); + procedure SetDotsColor(Value: TColor); + procedure SetDotsShadowColor(Value: TColor); + protected + function DrawHotZone(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean): TRect; override; + procedure DrawBackground(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean); override; + function CalculateHotZoneRect(const ABounds: TRect): TRect; override; + public + constructor Create(AOwner: TcxCustomSplitter); override; + procedure Assign(Source : TPersistent); override; + published + property SizePercent; + property Visible; + property ArrowColor: TColor read FArrowColor write SetArrowColor default clWindowText; + property ArrowHighlightColor: TColor read FArrowHighlightColor write SetArrowHighlightColor default clWindow; + property LightColor: TColor read FLightColor write SetLightColor default clWindow; + property ShadowColor: TColor read FShadowColor write SetShadowColor default clBtnShadow; + property DotsColor: TColor read FDotsColor write SetDotsColor default clHighlight; + property DotsShadowColor: TColor read FDotsShadowColor write SetDotsShadowColor default clWindow; + end; + + {TdxSplitterDragImage} + + TdxSplitterDragImage = class(TcxCustomDragImage) + protected + procedure Paint; override; + end; + + { TcxCustomSplitter } + + TcxCustomSplitter = class(TcxControl) + private + FActiveControl: TWinControl; + FAlignSplitter: TcxSplitterAlign; + FAllowHotZoneDrag: Boolean; + FAutoPosition: Boolean; + FAutoSnap: Boolean; + FBrush: TBrush; + FControl: TControl; + FDragImage: TdxSplitterDragImage; + FDragThreshold: TcxNaturalNumber; + FDrawCanvas: TcxCanvas; + FHotZone: TcxHotZoneStyle; + FHotZoneClickPoint: TPoint; + FHotZoneEvents: TNotifyEvent; + FHotZoneStyleClass: TcxHotZoneStyleClass; + FInvertDirection: Boolean; + FLastPatternDrawPosition: Integer; + FMaxSize: Word; + FMinSize: TcxNaturalNumber; + FMouseStates: TcxSplitterMouseStates; + FNativeBackground: Boolean; + FNewSize: Integer; + FOldSize: Integer; + FOnAfterClose: TNotifyEvent; + FOnAfterOpen: TNotifyEvent; + FOnBeforeClose: TBeforeCloseHotZoneEvent; + FOnBeforeOpen: TBeforeOpenHotZoneEvent; + FOnCanResize: TCanResizeEvent; + FOnMoved: TNotifyEvent; + FPositionAfterOpen: TcxPositionAfterOpen; + FPrevKeyDown: TKeyEvent; + FResizeIgnoreSnap: Boolean; //deprecated + FResizeUpdate: Boolean; + FSavedParentShowHint: Boolean; + FSavedShowHint: Boolean; + FSplit: Integer; + FSplitterClickPoint: TPoint; + FSplitterState: TcxSplitterDragState; + FState: TcxSplitterState; + procedure CalcSplitSize(X, Y: Integer; var NewSize, Split: Integer; + ACorrectWithMaxMin: Boolean = True); + procedure ControlResizing(X, Y: Integer); + function FindControl: TControl; + procedure FocusKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + function GetMaxControlSize: Integer; + function IsAllControlHotZoneStyle: Boolean; + procedure UpdateControlSize; + procedure UpdateSize(X, Y: Integer); + + function GetDragImageTopLeft: TPoint; + procedure InitDragImage; + procedure MoveDragImage; + procedure ReleaseDragImage; + + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure SetAlignSplitter(Value: TcxSplitterAlign); + procedure SetSplitterState(Value: TcxSplitterState); + procedure SetAllowHotZoneDrag(Value: Boolean); + procedure SetInvertDirection(Value: Boolean); + procedure SetHotZone(Value: TcxHotZoneStyle); + procedure SetNativeBackground(Value: Boolean); + procedure SetDefaultStates; + procedure RecalcLastPosition; + procedure NormalizeSplitterSize; + procedure SetHotZoneStyleClass(const Value: TcxHotZoneStyleClass); + function GetHotZoneClassName: string; + procedure SetHotZoneClassName(Value: string); + procedure InitResize(X, Y: Integer); + procedure WMCancelMode(var Message: TWMCancelMode); message WM_CANCELMODE; + procedure WMSetCursor(var Message: TWMSetCursor); message WM_SETCURSOR; + protected + { Protected declarations } + FDrawBitmap: TBitmap; + FPositionBeforeClose: Integer; + function CanFocusOnClick: Boolean; override; + function CanResize(var NewSize: Integer): Boolean; reintroduce; virtual; + function DoCanResize(var NewSize: Integer): Boolean; virtual; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure HotZoneStyleChanged; virtual; + procedure DrawHotZone; virtual; + procedure Paint; override; + procedure StopSizing; virtual; + function GetSplitterMinSize: TcxNaturalNumber; virtual; + function GetSplitterMaxSize: TcxNaturalNumber; virtual; + procedure CreateHotZone; virtual; + procedure DestroyHotZone; virtual; + procedure DoEventBeforeOpen(var ANewSize: Integer; + var AllowOpenHotZone: Boolean); virtual; + procedure DoEventAfterOpen; virtual; + procedure DoEventBeforeClose(var AllowCloseHotZone: Boolean); virtual; + procedure DoEventAfterClose; virtual; + procedure DoEventMoved; virtual; + function InternalGetMinSize: Integer; + procedure Notification(ACOmponent: TComponent; Operation: TOperation); override; + procedure Loaded; override; + function CalculateSplitterDirection: TcxSplitterDirection; virtual; + procedure UpdateMouseStates(X, Y: Integer); virtual; + property AlignSplitter: TcxSplitterAlign read FAlignSplitter + write SetAlignSplitter default salLeft; + property AutoPosition: Boolean read FAutoPosition write FAutoPosition default True; + property AutoSnap: Boolean read FAutoSnap write FAutoSnap default False; + property AllowHotZoneDrag: Boolean read FAllowHotZoneDrag write SetAllowHotZoneDrag default True; + property DragThreshold: TcxNaturalNumber read FDragThreshold write FDragThreshold default 3; + property InvertDirection: Boolean read FInvertDirection + write SetInvertDirection default False; + property MinSize: TcxNaturalNumber read FMinSize write FMinSize default 30; + property PositionAfterOpen: TcxPositionAfterOpen read FPositionAfterOpen + write FPositionAfterOpen default 30; + property ResizeUpdate: Boolean read FResizeUpdate + write FResizeUpdate default False; + property ResizeIgnoreSnap: Boolean read FResizeIgnoreSnap + write FResizeIgnoreSnap stored False; //deprecated + property Control: TControl read FControl write FControl; + property NativeBackground: Boolean read FNativeBackground write SetNativeBackground default True; + property OnCanResize: TCanResizeEvent read FOnCanResize write FOnCanResize; + property OnMoved: TNotifyEvent read FOnMoved write FOnMoved; + property OnBeforeOpen: TBeforeOpenHotZoneEvent read FOnBeforeOpen write FOnBeforeOpen; + property OnAfterOpen: TNotifyEvent read FOnAfterOpen write FOnAfterOpen; + property OnBeforeClose: TBeforeCloseHotZoneEvent read FOnBeforeClose write FOnBeforeClose; + property OnAfterClose: TNotifyEvent read FOnAfterClose write FOnAfterClose; + public + { Public declarations } + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure OpenSplitter; + procedure CloseSplitter; + property State: TcxSplitterState read FState write SetSplitterState; + function IsPointInHotZone(const X, Y: Integer): Boolean; + function IsPointInSplitter(const X, Y: Integer): Boolean; + property HotZoneStyleClass: TcxHotZoneStyleClass read FHotZoneStyleClass + write SetHotZoneStyleClass; + property Direction: TcxSplitterDirection read CalculateSplitterDirection; + published + property HotZoneClassName: string read GetHotZoneClassName write SetHotZoneClassName; + property HotZone: TcxHotZoneStyle read FHotZone write SetHotZone; + property HotZoneEvents: TNotifyEvent read FHotZoneEvents write FHotZoneEvents; + end; + + { TcxSplitter } + TcxSplitter = class(TcxCustomSplitter) + published + { Public declarations } + property AlignSplitter; + property AllowHotZoneDrag; + property AutoPosition; + property DragThreshold; + property NativeBackground; + property PositionAfterOpen; + property AutoSnap; + property InvertDirection; + property MinSize; + property ResizeUpdate; + property ResizeIgnoreSnap; //deprecated + property Control; + property OnCanResize; + property OnMoved; + property OnBeforeOpen; + property OnAfterOpen; + property OnBeforeClose; + property OnAfterClose; + property Color; + property ShowHint; + property ParentColor; + property ParentShowHint; + property Visible; + end; + +function GetRegisteredHotZoneStyles: TcxRegisteredClasses; + +implementation + +uses + cxContainer, dxThemeConsts, dxThemeManager, dxUxTheme; + +type + TWinControlAccess = class(TWinControl); + +const + SplitterDefaultSize = 8; + +var + FRegisteredHotZoneStyles: TcxRegisteredClasses; + +function GetRegisteredHotZoneStyles: TcxRegisteredClasses; +begin + if FRegisteredHotZoneStyles = nil then + FRegisteredHotZoneStyles := TcxRegisteredClasses.Create; + Result := FRegisteredHotZoneStyles; +end; + +procedure DrawSplitterDots(ACanvas: TcxCanvas; const ARect: TRect; const AClicked: Boolean; + const AFromLeftTop: Boolean; const ALightColor, AShadowColor: TColor; + const ASplitterDirection: TcxSplitterDirection; const ABetweenPoints, AIndent: Integer); +var + I, ANextDotPoint: Integer; + + procedure PaintOuterDot(X, Y: Integer); + begin + ACanvas.Brush.Color := ALightColor; + ACanvas.FillRect(Rect(X, Y, X + 2, Y + 2)); + ACanvas.Brush.Color := AShadowColor; + ACanvas.FillRect(Rect(X + 1, Y + 1, X + 3, Y + 3)); + end; + + procedure PaintInnerDot(X, Y: Integer); + begin + ACanvas.Brush.Color := ALightColor; + ACanvas.FillRect(Rect(X + 1, Y + 1, X + 3, Y + 3)); + ACanvas.Brush.Color := AShadowColor; + ACanvas.FillRect(Rect(X, Y, X + 2, Y + 2)); + end; + +begin + if AFromLeftTop = True then + begin + if (ASplitterDirection = cxsdLeftToRight) or (ASplitterDirection = cxsdRightToLeft) then + begin + ANextDotPoint := ARect.Top + ABetweenPoints; + for I := ARect.Top + ABetweenPoints to ARect.Bottom - ABetweenPoints do + if (I = ANextDotPoint) and ((I + ABetweenPoints) <= ARect.Bottom) then + begin + if AClicked = False then + PaintOuterDot(ARect.Left + AIndent, I) + else + PaintInnerDot(ARect.Left + AIndent, I); + Inc(ANextDotPoint, ABetweenPoints + 2); + end; + end + else + begin + ANextDotPoint := ARect.Left + ABetweenPoints; + for I := ARect.Left + ABetweenPoints to ARect.Right - ABetweenPoints do + if (I = ANextDotPoint) and ((I + ABetweenPoints) <= ARect.Right) then + begin + if AClicked = False then + PaintOuterDot(I, ARect.Top + AIndent) + else + PaintInnerDot(I, ARect.Top + AIndent); + Inc(ANextDotPoint, ABetweenPoints + 2); + end; + end; + end + else + begin + if (ASplitterDirection = cxsdLeftToRight) or (ASplitterDirection = cxsdRightToLeft) then + begin + ANextDotPoint := ARect.Bottom - (ABetweenPoints * 2); + for I := ARect.Bottom - (ABetweenPoints * 2) downto ARect.Top do + if (I = ANextDotPoint) and (I >= ARect.Top) then + begin + if AClicked = False then + PaintOuterDot(ARect.Left + AIndent, I) + else + PaintInnerDot(ARect.Left + AIndent, I); + Dec(ANextDotPoint, ABetweenPoints + 2); + end; + end + else + begin + ANextDotPoint := ARect.Right - (ABetweenPoints * 2); + for I := ARect.Right - (ABetweenPoints * 2) downto ARect.Left do + if (I = ANextDotPoint) and (I >= ARect.Left) then + begin + if AClicked = False then + PaintOuterDot(I, ARect.Top + AIndent) + else + PaintInnerDot(I, ARect.Top + AIndent); + Dec(ANextDotPoint, ABetweenPoints + 2); + end; + end; + end; +end; + +procedure DrawHotZoneArrow(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean; const ArrowColor, ArrowHighlightColor: TColor; + const ASplitterDirection: TcxSplitterDirection); +var + I, ADelta, ACenter, ARectSize: Integer; + ALocalArrowColor: TColor; +begin + if (AHighlighted = False) or (AClicked = True) then + ALocalArrowColor := ArrowColor + else + ALocalArrowColor := ArrowHighlightColor; + if (ASplitterDirection = cxsdLeftToRight) or (ASplitterDirection = cxsdRightToLeft) then + begin + ARectSize := ARect.Bottom - ARect.Top; + if (ARectSize mod 2) <> 0 then Dec(ARectSize, 1); + ACenter := (ARectSize div 2) + 1; + end + else + begin + ARectSize := ARect.Right - ARect.Left; + if (ARectSize mod 2) <> 0 then Dec(ARectSize, 1); + ACenter := (ARectSize div 2) + 1; + end; + case ASplitterDirection of + cxsdLeftToRight: + begin + for I := 0 to 3 do + begin + if I = 3 then + ADelta := 1 + else + ADelta := 0; + DrawCanvasLine(ACanvas.Canvas, ALocalArrowColor, Point(ARect.Left + 4 - I + ADelta, + ARect.Top + ACenter - I), Point(ARect.Left + 6 - I, ARect.Top + ACenter - I)); + DrawCanvasLine(ACanvas.Canvas, ALocalArrowColor, Point(ARect.Left + 4 - I + ADelta, + ARect.Top + ACenter + I), Point(ARect.Left + 6 - I, ARect.Top + ACenter + I)); + end; + end; + cxsdRightToLeft: + begin + for I := 0 to 3 do + begin + if I = 3 then + ADelta := -1 + else + ADelta := 0; + DrawCanvasLine(ACanvas.Canvas, ALocalArrowColor, Point(ARect.Left + 2 + I, + ARect.Top + ACenter - I), Point(ARect.Left + 4 + I + ADelta, ARect.Top + ACenter - I)); + DrawCanvasLine(ACanvas.Canvas, ALocalArrowColor, Point(ARect.Left + 2 + I, + ARect.Top + ACenter + I), Point(ARect.Left + 4 + I + ADelta, ARect.Top + ACenter + I)); + end; + end; + cxsdTopToBottom: + begin + for I := 0 to 3 do + begin + if I = 3 then + ADelta := 1 + else + ADelta := 0; + DrawCanvasLine(ACanvas.Canvas, ALocalArrowColor, Point(ARect.Left + ACenter - I, + ARect.Top + 4 - I + ADelta), Point(ARect.Left + ACenter - I, ARect.Top + 6 - I)); + DrawCanvasLine(ACanvas.Canvas, ALocalArrowColor, Point(ARect.Left + ACenter + I, + ARect.Top + 4 - I + ADelta), Point(ARect.Left + ACenter + I, ARect.Top + 6 - I)); + end; + end; + cxsdBottomToTop: + begin + for I := 0 to 3 do + begin + if I = 3 then + ADelta := -1 + else + ADelta := 0; + DrawCanvasLine(ACanvas.Canvas, ALocalArrowColor, Point(ARect.Left + ACenter - I, + ARect.Top + 2 + I), Point(ARect.Left + ACenter - I, ARect.Top + 4 + I + ADelta)); + DrawCanvasLine(ACanvas.Canvas, ALocalArrowColor, Point(ARect.Left + ACenter + I, + ARect.Top + 2 + I), Point(ARect.Left + ACenter + I, ARect.Top + 4 + I + ADelta)); + end; + end; + end; +end; + +{ TcxHotZoneStyle } +constructor TcxHotZoneStyle.Create(AOwner: TcxCustomSplitter); +begin + inherited Create; + FOwner := AOwner; + FSizePercent := 30; + FVisible := True; +end; + +destructor TcxHotZoneStyle.Destroy; +begin + FOwner := nil; + inherited; +end; + +procedure TcxHotZoneStyle.Assign(Source: TPersistent); +begin + if (Source is TcxHotZoneStyle) then + begin + with (Source as TcxHotZoneStyle) do + begin + Self.SizePercent := SizePercent; + Self.Visible := Visible; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxHotZoneStyle.Changed; +begin + if Assigned(FOwner) then FOwner.HotZoneStyleChanged; +end; + +function TcxHotZoneStyle.SplitterDirection: TcxSplitterDirection; +begin + if Assigned(FOwner) then + Result := FOwner.CalculateSplitterDirection + else + Result := Low(TcxSplitterDirection); +end; + +procedure TcxHotZoneStyle.SetSizePercent(Value: TcxNaturalNumber); +begin + if FSizePercent <> Value then + begin + FSizePercent := Value; + Changed; + end; +end; + +procedure TcxHotZoneStyle.SetVisible(Value: Boolean); +begin + if FVisible <> Value then + begin + FVisible := Value; + Changed; + end; +end; + +function TcxHotZoneStyle.DrawHotZone(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean): TRect; +begin + { Dummy } +end; + +procedure TcxHotZoneStyle.DrawBackground(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean); +begin + { Dummy } +end; + +function TcxHotZoneStyle.GetMinSize: TcxNaturalNumber; +begin + Result := SplitterDefaultSize; +end; + +function TcxHotZoneStyle.GetMaxSize: TcxNaturalNumber; +begin + Result := SplitterDefaultSize; +end; + +function TcxHotZoneStyle.CalculateHotZoneRect(const ABounds: TRect): TRect; +var + ARect : TRect; + AHotZoneRectSize, APos: Integer; +begin + ARect := ABounds; + if (SplitterDirection = cxsdLeftToRight) or (SplitterDirection = cxsdRightToLeft) then + begin + ARect.Right := ARect.Left + SplitterDefaultSize - 1; + AHotZoneRectSize := ((ARect.Bottom - ARect.Top) * SizePercent) div 100; + APos := ((ARect.Bottom - ARect.Top) div 2) - (AHotZoneRectSize div 2); + Result := Rect(ARect.Left, APos, ARect.Right, APos + AHotZoneRectSize); + end + else + begin + ARect.Bottom := ARect.Top + SplitterDefaultSize - 1; + AHotZoneRectSize := ((ARect.Right - ARect.Left) * SizePercent) div 100; + APos := ((ARect.Right - ARect.Left) div 2) - (AHotZoneRectSize div 2); + Result := Rect(APos, ARect.Top, APos + AHotZoneRectSize, ARect.Bottom); + end; + HotZoneRect := Result; +end; +{ TcxHotZoneStyle } + +{ TcxMediaPlayer9Style } +constructor TcxMediaPlayer9Style.Create(AOwner: TcxCustomSplitter); +begin + inherited Create(AOwner); + FArrowColor := clWindowText; + FArrowHighlightColor := clBlue; + FLightColor := clWindow; + FBorderColor := clBtnShadow; + FShadowStartColor := $00F5E6CD; + FShadowHighlightStartColor := $00AFF5C3; +end; + +procedure TcxMediaPlayer9Style.Assign(Source: TPersistent); +begin + if (Source is TcxMediaPlayer9Style) then + begin + inherited Assign(Source); + with (Source as TcxMediaPlayer9Style) do + begin + Self.ArrowColor := ArrowColor; + Self.ArrowHighlightColor := ArrowHighlightColor; + Self.LightColor := LightColor; + Self.BorderColor := BorderColor; + Self.ShadowStartColor := ShadowStartColor; + Self.ShadowHighlightStartColor := ShadowHighlightStartColor; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxMediaPlayer9Style.SetArrowColor(Value: TColor); +begin + if FArrowColor <> Value then + begin + FArrowColor := Value; + Changed; + end; +end; + +procedure TcxMediaPlayer9Style.SetArrowHighlightColor(Value: TColor); +begin + if FArrowHighlightColor <> Value then + begin + FArrowHighlightColor := Value; + Changed; + end; +end; + +procedure TcxMediaPlayer9Style.SetLightColor(Value: TColor); +begin + if FLightColor <> Value then + begin + FLightColor := Value; + Changed; + end; +end; + +procedure TcxMediaPlayer9Style.SetBorderColor(Value: TColor); +begin + if FBorderColor <> Value then + begin + FBorderColor := Value; + Changed; + end; +end; + +procedure TcxMediaPlayer9Style.SetShadowStartColor(Value: TColor); +begin + if FShadowStartColor <> Value then + begin + FShadowStartColor := Value; + Changed; + end; +end; + +procedure TcxMediaPlayer9Style.SetShadowHighlightStartColor(Value: TColor); +begin + if FShadowHighlightStartColor <> Value then + begin + FShadowHighlightStartColor := Value; + Changed; + end; +end; + +function TcxMediaPlayer9Style.DrawHotZone(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean): TRect; +begin + Result := CalculateHotZoneRect(ARect); + ACanvas.Canvas.Lock; + try + ACanvas.Canvas.Brush.Color := Owner.Color; + DrawBackground(ACanvas, HotZoneRect, AHighlighted, AClicked); + DrawHotZoneArrow(ACanvas, FArrowRect, AHighlighted, AClicked, FArrowColor, + FArrowHighlightColor, SplitterDirection); + finally + ACanvas.Canvas.Unlock; + end; +end; + +function TcxMediaPlayer9Style.CalculateHotZoneRect(const ABounds: TRect): TRect; +begin + Result := inherited CalculateHotZoneRect(ABounds); + if (SplitterDirection = cxsdLeftToRight) or (SplitterDirection = cxsdRightToLeft) then + FArrowRect := Rect(Result.Left, Result.Top + (RectHeight(Result) div 2) - 7, + Result.Left + SplitterDefaultSize - 1, + Result.Top + (RectHeight(Result) div 2) + 7) + else + FArrowRect := Rect(Result.Left + (RectWidth(Result) div 2) - 7, + Result.Top, Result.Left + (RectWidth(Result) div 2) + 7, + Result.Top + SplitterDefaultSize - 1); + HotZoneRect := Result; +end; + +procedure TcxMediaPlayer9Style.DrawBackground(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean); +var + FRect: TRect; + FXDelta, FYDelta, FShadowStepDelta, FShadowStep: Integer; + FLocalShadowColor: TColor; +begin + FRect := ARect; + case SplitterDirection of + cxsdLeftToRight, cxsdRightToLeft: InflateRectEx(FRect, 0, 1, 0, -1); + cxsdTopToBottom, cxsdBottomToTop: InflateRectEx(FRect, 1, 0, -1, 0); + end; + ACanvas.Pen.Color := BorderColor; + ACanvas.Brush.Color := LightColor; + ACanvas.FillRect(FRect); + DrawBounds(ACanvas, FRect, BorderColor, BorderColor); + if AHighlighted = False then + FLocalShadowColor := ShadowStartColor + else + FLocalShadowColor := ShadowHighlightStartColor; + if not AClicked then + begin + FXDelta := 4; + FYDelta := 2; + FShadowStep := 0; + FShadowStepDelta := -30; + end + else + begin + FXDelta := 1; + FYDelta := 0; + FShadowStep := -60; + FShadowStepDelta := 30; + end; + case SplitterDirection of + cxsdLeftToRight, cxsdRightToLeft: + begin + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 2, ARect.Top + 1), + Point(ARect.Right - 1, ARect.Top + 1)); + DrawCanvasLine(ACanvas.Canvas, BorderColor, Point(ARect.Left + 1, ARect.Top), + Point(ARect.Right, ARect.Top)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 2, ARect.Bottom - 1), + Point(ARect.Right - 1, ARect.Bottom - 1)); + DrawCanvasLine(ACanvas.Canvas, BorderColor, Point(ARect.Left + 1, ARect.Bottom), + Point(ARect.Right, ARect.Bottom)); + DrawCanvasLine(ACanvas.Canvas, IncColor(FLocalShadowColor, FShadowStep, FShadowStep, FShadowStep), + Point(ARect.Left + FXDelta, ARect.Top + FYDelta), Point(ARect.Left + FXDelta, + ARect.Bottom + FYDelta - 2)); + Inc(FShadowStep, FShadowStepDelta); + DrawCanvasLine(ACanvas.Canvas, IncColor(FLocalShadowColor, FShadowStep, FShadowStep, FShadowStep), + Point(ARect.Left + FXDelta + 1, ARect.Top + FYDelta + 1), + Point(ARect.Left + FXDelta + 1, ARect.Bottom + FYDelta - 2)); + Inc(FShadowStep, FShadowStepDelta); + DrawCanvasLine(ACanvas.Canvas, IncColor(FLocalShadowColor, FShadowStep, FShadowStep, FShadowStep), + Point(ARect.Left + FXDelta + 2, ARect.Top + FYDelta + 1), + Point(ARect.Left + FXDelta + 2, ARect.Bottom + FYDelta - 3)); + end; + cxsdTopToBottom, cxsdBottomToTop: + begin + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 1, ARect.Top + 2), + Point(ARect.Left + 1, ARect.Bottom - 1)); + DrawCanvasLine(ACanvas.Canvas, BorderColor, Point(ARect.Left, ARect.Top + 1), + Point(ARect.Left, ARect.Bottom)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Right - 1, ARect.Top + 2), + Point(ARect.Right - 1, ARect.Bottom - 1)); + DrawCanvasLine(ACanvas.Canvas, BorderColor, Point(ARect.Right, ARect.Top + 1), + Point(ARect.Right, ARect.Bottom)); + DrawCanvasLine(ACanvas.Canvas, IncColor(FLocalShadowColor, FShadowStep, FShadowStep, FShadowStep), + Point(ARect.Left + FYDelta, ARect.Top + FXDelta), + Point(ARect.Right + FYDelta - 2, ARect.Top + FXDelta)); + Inc(FShadowStep, FShadowStepDelta); + DrawCanvasLine(ACanvas.Canvas, IncColor(FLocalShadowColor, FShadowStep, FShadowStep, FShadowStep), + Point(ARect.Left + FYDelta + 1, ARect.Top + FXDelta + 1), + Point(ARect.Right + FYDelta - 2, ARect.Top + FXDelta + 1)); + Inc(FShadowStep, FShadowStepDelta); + DrawCanvasLine(ACanvas.Canvas, IncColor(FLocalShadowColor, FShadowStep, FShadowStep, FShadowStep), + Point(ARect.Left + FYDelta + 1, ARect.Top + FXDelta + 2), + Point(ARect.Right + FYDelta - 3, ARect.Top + FXDelta + 2)); + end; + end; + ACanvas.Pen.Color := FOwner.Color; + ACanvas.Brush.Color := FOwner.Color; +end; +{ TcxMediaPlayer9Style } + +{ TcxMediaPlayer8Style } +constructor TcxMediaPlayer8Style.Create(AOwner: TcxCustomSplitter); +begin + inherited Create(AOwner); + FArrowColor := clWindowText; + FArrowHighlightColor := clWindow; + FLightColor := clWindow; + FShadowColor := clBtnShadow; +end; + +procedure TcxMediaPlayer8Style.Assign(Source: TPersistent); +begin + if (Source is TcxMediaPlayer8Style) then + begin + inherited Assign(Source); + with (Source as TcxMediaPlayer8Style) do + begin + Self.ShadowColor := ShadowColor; + Self.LightColor := LightColor; + Self.ArrowColor := ArrowColor; + Self.ArrowHighlightColor := ArrowHighlightColor; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxMediaPlayer8Style.SetShadowColor(Value: TColor); +begin + if FShadowColor <> Value then + begin + FShadowColor := Value; + Changed; + end; +end; + +procedure TcxMediaPlayer8Style.SetLightColor(Value: TColor); +begin + if FLightColor <> Value then + begin + FLightColor := Value; + Changed; + end; +end; + +procedure TcxMediaPlayer8Style.SetArrowColor(Value: TColor); +begin + if FArrowColor <> Value then + begin + FArrowColor := Value; + Changed; + end; +end; + +procedure TcxMediaPlayer8Style.SetArrowHighlightColor(Value: TColor); +begin + if FArrowHighlightColor <> Value then + begin + FArrowHighlightColor := Value; + Changed; + end; +end; + +function TcxMediaPlayer8Style.DrawHotZone(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean): TRect; +begin + Result := CalculateHotZoneRect(ARect); + ACanvas.Canvas.Lock; + try + ACanvas.Canvas.Brush.Color := Owner.Color; + DrawBackground(ACanvas, HotZoneRect, AHighlighted, AClicked); + DrawSplitterDots(ACanvas, FLTPointsRect, AClicked, False, FLightColor, + FShadowColor, SplitterDirection, 3, 3); + DrawSplitterDots(ACanvas, FRBPointsRect, AClicked, True, FLightColor, + FShadowColor, SplitterDirection, 3, 3); + DrawArrowRect(ACanvas, FArrowRect, AHighlighted, AClicked); + DrawHotZoneArrow(ACanvas, FArrowRect, AHighlighted, AClicked, FArrowColor, + FArrowHighlightColor, SplitterDirection); + finally + ACanvas.Canvas.Unlock; + end; +end; + +function TcxMediaPlayer8Style.CalculateHotZoneRect(const ABounds: TRect): TRect; +var + FRect : TRect; + FHotZoneRectSize, FPos: Integer; + FHotZonePointsRectHeight, FHotZoneRoundRectHeight: Integer; +begin + FRect := ABounds; + if (SplitterDirection = cxsdLeftToRight) or (SplitterDirection = cxsdRightToLeft) then + begin + FRect.Right := FRect.Left + SplitterDefaultSize - 1; + FHotZoneRectSize := ((FRect.Bottom - FRect.Top) * SizePercent) div 100; + FPos := ((FRect.Bottom - FRect.Top) div 2) - (FHotZoneRectSize div 2); + HotZoneRect := Rect(FRect.Left, FPos, FRect.Right, FPos + FHotZoneRectSize); + end + else + begin + FRect.Bottom := FRect.Top + SplitterDefaultSize - 1; + FHotZoneRectSize := ((FRect.Right - FRect.Left) * SizePercent) div 100; + FPos := ((FRect.Right - FRect.Left) div 2) - (FHotZoneRectSize div 2); + HotZoneRect := Rect(FPos, FRect.Top, FPos + FHotZoneRectSize, FRect.Bottom); + end; + + FHotZoneRoundRectHeight := 4; + FHotZonePointsRectHeight := (FHotZoneRectSize - (FHotZoneRoundRectHeight * 2) - 19) div 2; + if (SplitterDirection = cxsdLeftToRight) or (SplitterDirection = cxsdRightToLeft) then + begin + FLTPointsRect := Rect(HotZoneRect.Left, HotZoneRect.Top + FHotZoneRoundRectHeight, + HotZoneRect.Left + HotZoneRect.Right - HotZoneRect.Left, + HotZoneRect.Top + FHotZoneRoundRectHeight + FHotZonePointsRectHeight); + FRBPointsRect := Rect(HotZoneRect.Left, HotZoneRect.Bottom - FHotZoneRoundRectHeight - FHotZonePointsRectHeight, + HotZoneRect.Left + HotZoneRect.Right - HotZoneRect.Left, + HotZoneRect.Bottom - FHotZoneRoundRectHeight - FHotZonePointsRectHeight + FHotZonePointsRectHeight); + FArrowRect := Rect(HotZoneRect.Left, HotZoneRect.Top + FHotZonePointsRectHeight + FHotZoneRoundRectHeight, + HotZoneRect.Left + SplitterDefaultSize - 1, + HotZoneRect.Top + FHotZonePointsRectHeight + FHotZoneRoundRectHeight + 19); + end + else + begin + FLTPointsRect := Rect(HotZoneRect.Left + FHotZoneRoundRectHeight, + HotZoneRect.Top, HotZoneRect.Left + FHotZoneRoundRectHeight + FHotZonePointsRectHeight, + HotZoneRect.Bottom); + FRBPointsRect := Rect(HotZoneRect.Right - FHotZoneRoundRectHeight - FHotZonePointsRectHeight, + HotZoneRect.Top, HotZoneRect.Right - FHotZoneRoundRectHeight - FHotZonePointsRectHeight + FHotZonePointsRectHeight, + HotZoneRect.Bottom); + FArrowRect := Rect(HotZoneRect.Left + FHotZonePointsRectHeight + FHotZoneRoundRectHeight, + HotZoneRect.Top, HotZoneRect.Left + FHotZonePointsRectHeight + FHotZoneRoundRectHeight + 19, + HotZoneRect.Top + SplitterDefaultSize - 1); + end; + Result := HotZoneRect; +end; + +procedure TcxMediaPlayer8Style.DrawBackground(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean); +begin + ACanvas.Pen.Color := FOwner.Color; + ACanvas.Brush.Color := FOwner.Color; + ACanvas.FillRect(ARect); + case SplitterDirection of + cxsdLeftToRight: + begin + {Shadow border} + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Left, ARect.Bottom - 4), + Point(ARect.Left, ARect.Top + 3)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Right, ARect.Bottom), + Point(ARect.Right, ARect.Top)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Left + 1, ARect.Bottom - 2), + Point(ARect.Left + 1, ARect.Bottom - 4)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Left + 1, ARect.Top + 2), + Point(ARect.Left + 1, ARect.Top + 4)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Left + 2, ARect.Bottom - 1), + Point(ARect.Left + 4, ARect.Bottom - 1)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Left + 2, ARect.Top + 1), + Point(ARect.Left + 4, ARect.Top + 1)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Left + 4, ARect.Bottom), + Point(ARect.Right, ARect.Bottom)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Left + 4, ARect.Top), + Point(ARect.Right + 1, ARect.Top)); + {Light border} + if AClicked = False then + begin + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 1, ARect.Bottom - 4), + Point(ARect.Left + 1, ARect.Top + 3)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 2, ARect.Top + 2), + Point(ARect.Left + 2, ARect.Top + 4)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 2, ARect.Top + 2), + Point(ARect.Left + 4, ARect.Top + 2)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 4, ARect.Top + 1), + Point(ARect.Right, ARect.Top + 1)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 2, ARect.Bottom - 2), + Point(ARect.Left + 2, ARect.Bottom - 4)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 2, ARect.Bottom - 2), + Point(ARect.Left + 4, ARect.Bottom - 2)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 4, ARect.Bottom - 1), + Point(ARect.Left + 5, ARect.Bottom - 1)); + end + else + begin + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Right - 1, ARect.Bottom - 1), + Point(ARect.Right - 1, ARect.Top + 1)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 2, ARect.Bottom - 2), + Point(ARect.Left + 4, ARect.Bottom - 2)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 4, ARect.Bottom - 1), + Point(ARect.Left + 7, ARect.Bottom - 1)); + end; + end; + cxsdRightToLeft: + begin + {Shadow border} + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Right, ARect.Bottom - 4), + Point(ARect.Right, ARect.Top + 3)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Left, ARect.Bottom), + Point(ARect.Left, ARect.Top)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Right - 1, ARect.Bottom - 2), + Point(ARect.Right - 1, ARect.Bottom - 4)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Right - 1, ARect.Top + 2), + Point(ARect.Right - 1, ARect.Top + 4)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Right - 2, ARect.Bottom - 1), + Point(ARect.Right - 4, ARect.Bottom - 1)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Right - 2, ARect.Top + 1), + Point(ARect.Right - 4, ARect.Top + 1)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Right - 4, ARect.Bottom), + Point(ARect.Left, ARect.Bottom)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Right - 3, ARect.Top), + Point(ARect.Left - 1, ARect.Top)); + {Light border} + if AClicked = False then + begin + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 1, ARect.Bottom - 1), + Point(ARect.Left + 1, ARect.Top + 1)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 1, ARect.Top + 1), + Point(ARect.Left + 4, ARect.Top + 1)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 4, ARect.Top + 2), + Point(ARect.Left + 6, ARect.Top + 2)); + end + else + begin + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 3, ARect.Top + 1), + Point(ARect.Left + 4, ARect.Top + 1)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 4, ARect.Top + 2), + Point(ARect.Left + 6, ARect.Top + 2)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 5, ARect.Top + 2), + Point(ARect.Left + 5, ARect.Top + 4)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 6, ARect.Top + 4), + Point(ARect.Left + 6, ARect.Bottom - 3)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 1, ARect.Bottom - 1), + Point(ARect.Left + 4, ARect.Bottom - 1)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 4, ARect.Bottom - 2), + Point(ARect.Left + 6, ARect.Bottom - 2)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 5, ARect.Bottom - 2), + Point(ARect.Left + 5, ARect.Bottom - 4)); + end; + end; + cxsdTopToBottom: + begin + {Shadow border} + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Left + 4, ARect.Top), + Point(ARect.Right - 3, ARect.Top)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Left, ARect.Bottom), + Point(ARect.Right, ARect.Bottom)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Left + 2, ARect.Top + 1), + Point(ARect.Left + 4, ARect.Top + 1)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Right - 2, ARect.Top + 1), + Point(ARect.Right - 4, ARect.Top + 1 )); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Left + 1, ARect.Top + 2), + Point(ARect.Left + 1, ARect.Top + 4)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Right - 1, ARect.Top + 2), + Point(ARect.Right - 1,ARect.Top + 4)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Left, ARect.Top + 4), + Point(ARect.Left, ARect.Bottom)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Right, ARect.Top + 4), + Point(ARect.Right, ARect.Bottom + 1)); + {Light border} + if AClicked = False then + begin + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 4, ARect.Top + 1), + Point(ARect.Right - 3, ARect.Top + 1)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Right - 2, ARect.Top + 2), + Point(ARect.Right - 4, ARect.Top + 2)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Right - 2, ARect.Top + 2), + Point(ARect.Right - 2, ARect.Top + 4)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Right - 1, ARect.Top + 4), + Point(ARect.Right - 1, ARect.Bottom)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 2, ARect.Top + 2), + Point(ARect.Left + 4, ARect.Top + 2)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 2, ARect.Top + 2), + Point(ARect.Left + 2, ARect.Top + 4)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 1, ARect.Top + 4), + Point(ARect.Left + 1, ARect.Top + 5)); + end + else + begin + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 1, ARect.Bottom - 1), + Point(ARect.Right - 1, ARect.Bottom - 1)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 2, ARect.Top + 2), + Point(ARect.Left + 2, ARect.Top + 4)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 1, ARect.Top + 4), + Point(ARect.Left + 1, ARect.Top + 7)); + end; + end; + cxsdBottomToTop: + begin + {Shadow border} + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Left + 4, ARect.Bottom), + Point(ARect.Right - 3, ARect.Bottom)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Left, ARect.Top), + Point(ARect.Right, ARect.Top)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Left + 2, ARect.Bottom - 1), + Point(ARect.Left + 4, ARect.Bottom - 1)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Right - 2, ARect.Bottom - 1), + Point(ARect.Right - 4, ARect.Bottom - 1 )); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Left + 1, ARect.Bottom - 2), + Point(ARect.Left + 1, ARect.Bottom - 4)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Right - 1, ARect.Bottom - 2), + Point(ARect.Right - 1,ARect.Bottom - 4)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Left, ARect.Bottom - 4), + Point(ARect.Left, ARect.Top)); + DrawCanvasLine(ACanvas.Canvas, ShadowColor, Point(ARect.Right, ARect.Bottom - 3), + Point(ARect.Right, ARect.Top - 1)); + {Light border} + if AClicked = False then + begin + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 1, ARect.Top + 1), + Point(ARect.Right - 1, ARect.Top + 1)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 2, ARect.Bottom - 2), + Point(ARect.Left + 2, ARect.Bottom - 4)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 1, ARect.Bottom - 4), + Point(ARect.Left + 1, ARect.Bottom - 7)); + end + else + begin + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 4, ARect.Bottom - 1), + Point(ARect.Right - 3, ARect.Bottom - 1)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Right - 2, ARect.Bottom - 2), + Point(ARect.Right - 4, ARect.Bottom - 2)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Right - 2, ARect.Bottom - 2), + Point(ARect.Right - 2, ARect.Bottom - 4)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Right - 1, ARect.Bottom - 4), + Point(ARect.Right - 1, ARect.Top)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 2, ARect.Bottom - 2), + Point(ARect.Left + 4, ARect.Bottom - 2)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 2, ARect.Bottom - 2), + Point(ARect.Left + 2, ARect.Bottom - 4)); + DrawCanvasLine(ACanvas.Canvas, LightColor, Point(ARect.Left + 1, ARect.Bottom - 4), + Point(ARect.Left + 1, ARect.Bottom - 5)); + end; + end; + end; +end; + +procedure TcxMediaPlayer8Style.DrawArrowRect(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean); +begin + ACanvas.Brush.Color := FOwner.Color; + ACanvas.FillRect(ARect); + if AClicked = False then + DrawBounds(ACanvas, ARect, FShadowColor, FLightColor) + else + DrawBounds(ACanvas, ARect, FLightColor, FShadowColor); +end; +{ TcxMediaPlayer8Style } + +{ TcxXPTaskBarStyle } +constructor TcxXPTaskBarStyle.Create(AOwner: TcxCustomSplitter); +begin + inherited Create(AOwner); + FLightColor := clWindow; + FShadowColor := clBtnShadow; +end; + +procedure TcxXPTaskBarStyle.Assign(Source: TPersistent); +begin + if (Source is TcxXPTaskBarStyle) then + begin + inherited Assign(Source); + with (Source as TcxXPTaskBarStyle) do + begin + Self.LightColor := LightColor; + Self.ShadowColor := ShadowColor; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxXPTaskBarStyle.SetLightColor(Value: TColor); +begin + if FLightColor <> Value then + begin + FLightColor := Value; + Changed; + end; +end; + +procedure TcxXPTaskBarStyle.SetShadowColor(Value: TColor); +begin + if FShadowColor <> Value then + begin + FShadowColor := Value; + Changed; + end; +end; + +function TcxXPTaskBarStyle.DrawHotZone(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean): TRect; +begin + Result := CalculateHotZoneRect(ARect); + ACanvas.Canvas.Lock; + try + ACanvas.Canvas.Brush.Color := Owner.Color; + DrawBackground(ACanvas, HotZoneRect, AHighlighted, AClicked); + DrawSplitterDots(ACanvas, FLTPointsRect, not AClicked, True, FLightColor, + FShadowColor, SplitterDirection, 4, 0); + DrawSplitterDots(ACanvas, FRBPointsRect, not AClicked, True, FLightColor, + FShadowColor, SplitterDirection, 4, 0); + finally + ACanvas.Canvas.Unlock; + end; +end; + +function TcxXPTaskBarStyle.CalculateHotZoneRect(const ABounds: TRect): TRect; +var + FRect : TRect; + FHotZoneRectSize, FPos: Integer; +begin + Result := inherited CalculateHotZoneRect(ABounds); + + FRect := ABounds; + case SplitterDirection of + cxsdLeftToRight, cxsdRightToLeft: + begin + FRect.Right := FRect.Left + SplitterDefaultSize - 1; + FHotZoneRectSize := ((FRect.Bottom - FRect.Top) * SizePercent) div 100; + FPos := ((FRect.Bottom - FRect.Top) div 2) - (FHotZoneRectSize div 2); + Result := Rect(FRect.Left, FPos, FRect.Right, FPos + FHotZoneRectSize); + FLTPointsRect := Rect(Result.Left + 1, Result.Top, + (Result.Right div 2), Result.Bottom); + FRBPointsRect := Rect((Result.Right div 2) + 1, Result.Top + 3, + Result.Right, Result.Bottom); + end; + else + begin + FRect.Bottom := FRect.Top + SplitterDefaultSize - 1; + FHotZoneRectSize := ((FRect.Right - FRect.Left) * SizePercent) div 100; + FPos := ((FRect.Right - FRect.Left) div 2) - (FHotZoneRectSize div 2); + Result := Rect(FPos, FRect.Top, FPos + FHotZoneRectSize, FRect.Bottom); + FLTPointsRect := Rect(Result.Left, Result.Top + 1, + Result.Right, Result.Bottom div 2); + FRBPointsRect := Rect(Result.Left + 3, (Result.Bottom div 2) + 1, + Result.Right, Result.Bottom); + end; + end; + HotZoneRect := Result; +end; + +procedure TcxXPTaskBarStyle.DrawBackground(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean); +begin + if AreVisualStylesAvailable and Owner.NativeBackground then + cxDrawThemeParentBackground(Owner, ACanvas, ARect) + else + begin + ACanvas.Brush.Color := Owner.Color; + ACanvas.FillRect(ARect); + end; +end; +{ TcxXPTaskBarStyle } + +{ TcxSimpleStyle } +constructor TcxSimpleStyle.Create(AOwner: TcxCustomSplitter); +begin + inherited Create(AOwner); + FLightColor := clWindow; + FShadowColor := clBtnShadow; + FArrowColor := clWindowText; + FArrowHighlightColor := clWindow; + FDotsColor := clHighlight; + FDotsShadowColor := clWindow; +end; + +procedure TcxSimpleStyle.Assign(Source: TPersistent); +begin + if (Source is TcxSimpleStyle) then + begin + inherited Assign(Source); + with (Source as TcxSimpleStyle) do + begin + Self.LightColor := LightColor; + Self.ShadowColor := ShadowColor; + Self.ArrowColor := ArrowColor; + Self.ArrowHighlightColor := ArrowHighlightColor; + Self.DotsColor := DotsColor; + Self.DotsShadowColor := DotsShadowColor; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxSimpleStyle.SetLightColor(Value: TColor); +begin + if FLightColor <> Value then + begin + FLightColor := Value; + Changed; + end; +end; + +procedure TcxSimpleStyle.SetShadowColor(Value: TColor); +begin + if FShadowColor <> Value then + begin + FShadowColor := Value; + Changed; + end; +end; + +procedure TcxSimpleStyle.SetArrowColor(Value: TColor); +begin + if FArrowColor <> Value then + begin + FArrowColor := Value; + Changed; + end; +end; + +procedure TcxSimpleStyle.SetArrowHighlightColor(Value: TColor); +begin + if FArrowHighlightColor <> Value then + begin + FArrowHighlightColor := Value; + Changed; + end; +end; + +procedure TcxSimpleStyle.SetDotsColor(Value: TColor); +begin + if FDotsColor <> Value then + begin + FDotsColor := Value; + Changed; + end; +end; + +procedure TcxSimpleStyle.SetDotsShadowColor(Value: TColor); +begin + if FDotsShadowColor <> Value then + begin + FDotsShadowColor := Value; + Changed; + end; +end; + +function TcxSimpleStyle.DrawHotZone(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean): TRect; +begin + Result := CalculateHotZoneRect(ARect); + ACanvas.Canvas.Lock; + try + ACanvas.Canvas.Brush.Color := Owner.Color; + DrawBackground(ACanvas, HotZoneRect, AHighlighted, AClicked); + DrawHotZoneArrow(ACanvas, FLTArrowRect, AHighlighted, AClicked, FArrowColor, + FArrowHighlightColor, SplitterDirection); + DrawHotZoneArrow(ACanvas, FRBArrowRect, AHighlighted, AClicked, FArrowColor, + FArrowHighlightColor, SplitterDirection); + finally + ACanvas.Canvas.Unlock; + end; +end; + +function TcxSimpleStyle.CalculateHotZoneRect(const ABounds: TRect): TRect; +begin + Result := inherited CalculateHotZoneRect(ABounds); + case SplitterDirection of + cxsdLeftToRight, cxsdRightToLeft: + begin + FLTArrowRect := Rect(Result.Left, Result.Top + 5, Result.Right, Result.Top + 12); + FRBArrowRect := Rect(Result.Left, Result.Bottom - 12, Result.Right, Result.Bottom - 5); + end; + else + begin + FLTArrowRect := Rect(Result.Left + 5, Result.Top, Result.Left + 12, Result.Bottom); + FRBArrowRect := Rect(Result.Right - 12, Result.Top, Result.Right - 5, Result.Bottom); + end; + end; + HotZoneRect := Result; +end; + +procedure TcxSimpleStyle.DrawBackground(ACanvas: TcxCanvas; const ARect: TRect; + const AHighlighted, AClicked: Boolean); +var + MiddlePos, I_count : Integer; + FRect: TRect; +begin + with ACanvas, ARect do + begin + FRect := DrawBounds(ACanvas, HotZoneRect, ShadowColor, ShadowColor); + Brush.Color := Owner.Color; + FillRect(FRect); + {Draw Border} + if AClicked = False then + DrawBounds(ACanvas, FRect, LightColor, Owner.Color) + else + DrawBounds(ACanvas, FRect, Owner.Color, LightColor); + + Pen.Color := clHighlight; + Brush.Color := clHighlight; + if (SplitterDirection = cxsdTopToBottom) or (SplitterDirection = cxsdBottomToTop) then + begin + MiddlePos:=Top + (Bottom - Top) div 2; + for I_count := 0 to ((Right - Left - 32) div 3) do + begin + if AClicked = False then + begin + Pixels[Left + 15 + I_count * 3, MiddlePos] := DotsShadowColor; + Pixels[Left + 16 + I_count * 3, MiddlePos + 1] := DotsColor; + end + else + begin + Pixels[Left + 15 + I_count * 3, MiddlePos] := DotsColor; + Pixels[Left + 16 + I_count * 3, MiddlePos + 1] := DotsShadowColor; + end; + end; + end + else + begin + MiddlePos := Left + (Right - Left) div 2; + for I_count := 0 to ((Bottom - Top - 32) div 3) do + begin + if AClicked = False then + begin + Pixels[MiddlePos, Top + 15 + I_count * 3] := DotsShadowColor; + Pixels[MiddlePos + 1, Top + 16 + I_count * 3] := DotsColor; + end + else + begin + Pixels[MiddlePos, Top + 15 + I_count * 3] := DotsColor; + Pixels[MiddlePos + 1, Top + 16 + I_count * 3] := DotsShadowColor; + end; + end; + end; + end; +end; +{ TcxSimpleStyle } + +{TdxSplitterDragImage} + +procedure TdxSplitterDragImage.Paint; +begin + Canvas.Canvas.FillRect(ClientRect); +end; + +{ TcxCustomSplitter } +constructor TcxCustomSplitter.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := ControlStyle - [csSetCaption]; + FState := ssOpened; + FResizeUpdate := False; + FSplitterState := sstNormal; + FMouseStates := []; + FAllowHotZoneDrag := True; + FDragThreshold := 3; + FAutoSnap := False; + FResizeIgnoreSnap := False; //deprecated + FAutoPosition := True; + FMinSize := 30; + FPositionAfterOpen := 30; + FNativeBackground := True; + FInvertDirection := False; + FNewSize := 30; + FOldSize := -1; + FPositionBeforeClose := FMinSize; + FHotZone := nil; + FHotZoneClickPoint := Point(-1, -1); + FLastPatternDrawPosition := -1; + FDrawBitmap := TBitmap.Create; + FDrawCanvas := TcxCanvas.Create(FDrawBitmap.Canvas); + BorderStyle := cxcbsNone; + Align := alNone; + SetAlignSplitter(salLeft); + Width := SplitterDefaultSize; + TabStop := False; +end; + +destructor TcxCustomSplitter.Destroy; +begin + FControl := nil; + DestroyHotZone; + if Assigned(FBrush) then FreeAndNil(FBrush); + if Assigned(FDrawCanvas) then FreeAndNil(FDrawCanvas); + if Assigned(FDrawBitmap) then FreeAndNil(FDrawBitmap); + inherited Destroy; +end; + +procedure TcxCustomSplitter.Loaded; +begin + inherited Loaded; + if FControl = nil then + FControl := FindControl; + SetAlignSplitter(FAlignSplitter); +end; + +procedure TcxCustomSplitter.Notification(AComponent: TComponent; Operation: Toperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (FControl <> nil) and + (AComponent = FControl) then + FControl := nil; +end; + +procedure TcxCustomSplitter.SetHotZoneStyleClass(const Value: TcxHotZoneStyleClass); +var + ASavedHotZone: TcxHotZoneStyle; +begin + if FHotZoneStyleClass <> Value then + begin + ASavedHotZone := nil; + try + if Assigned(FHotZone) then + begin + ASavedHotZone := TcxHotZoneStyle.Create(Self); + ASavedHotZone.Assign(FHotZone); + end; + DestroyHotZone; + FHotZoneStyleClass := Value; + CreateHotZone; + if Assigned(FHotZone) and Assigned(ASavedHotZone) then + FHotZone.Assign(ASavedHotZone); + finally + if Assigned(ASavedHotZone) then + FreeAndNil(ASavedHotZone); + end; + NormalizeSplitterSize; + end; +end; + +function TcxCustomSplitter.GetHotZoneClassName: string; +begin + if FHotZone = nil then + Result := '' + else + Result := FHotZone.ClassName; +end; + +procedure TcxCustomSplitter.SetHotZoneClassName(Value: string); +begin + HotZoneStyleClass := TcxHotZoneStyleClass(GetRegisteredHotZoneStyles.FindByClassName(Value)); +end; + +procedure TcxCustomSplitter.CreateHotZone; +begin + if FHotZoneStyleClass <> nil then + FHotZone := FHotZoneStyleClass.Create(Self); + Invalidate; +end; + +procedure TcxCustomSplitter.DestroyHotZone; +begin + if Assigned(FHotZone) then FreeAndNil(FHotZone); +end; + +procedure TcxCustomSplitter.SetHotZone(Value: TcxHotZoneStyle); +begin + FHotZone := Value; + NormalizeSplitterSize; + Invalidate; +end; + +procedure TcxCustomSplitter.SetNativeBackground(Value: Boolean); +begin + if FNativeBackground <> Value then + begin + FNativeBackground := Value; + Invalidate; + end; +end; + +procedure TcxCustomSplitter.SetDefaultStates; +begin + FMouseStates := []; + FSplitterState := sstNormal; +end; + +function TcxCustomSplitter.GetMaxControlSize: Integer; +begin + Result := 0; + if FControl = nil then + Exit; + case AlignSplitter of + salBottom, salTop: + Result := FControl.Constraints.MaxHeight; + salLeft, salRight: + Result := FControl.Constraints.MaxWidth; + end; +end; + +function TcxCustomSplitter.IsAllControlHotZoneStyle: Boolean; +begin + Result := LookAndFeel.SkinPainter <> nil; +end; + +function TcxCustomSplitter.GetDragImageTopLeft: TPoint; +begin + Result := Point(Left, Top); + if Align in [alLeft, alRight] then + Result.X := Left + FSplit + 1 + else + Result.Y := Top + FSplit + 1; + Result := Parent.ClientToScreen(Result); +end; + +procedure TcxCustomSplitter.InitDragImage; +begin + if not ResizeUpdate then + begin + FDragImage := TdxSplitterDragImage.Create; + FDragImage.Canvas.Brush.Bitmap := AllocPatternBitmap(clBlack, clWhite); + FDragImage.SetBounds(GetDragImageTopLeft.X, GetDragImageTopLeft.Y, + Width - 1, Height - 1); + FDragImage.Show; + end; +end; + +procedure TcxCustomSplitter.MoveDragImage; +begin + FDragImage.MoveTo(GetDragImageTopLeft); +end; + +procedure TcxCustomSplitter.ReleaseDragImage; +begin + FreeAndNil(FDragImage); +end; + +procedure TcxCustomSplitter.CMMouseLeave(var Message: TMessage); +begin + inherited; + if smsInHotZone in FMouseStates then + Invalidate; + Exclude(FMouseStates, smsInHotZone); +end; + +procedure TcxCustomSplitter.SetAlignSplitter(Value: TcxSplitterAlign); +begin + FAlignSplitter := Value; + if Assigned(FHotZone) then + NormalizeSplitterSize; + case FAlignSplitter of + salBottom: Align := alBottom; + salLeft: Align := alLeft; + salRight: Align := alRight; + salTop: Align := alTop; + end; +end; + +function TcxCustomSplitter.GetSplitterMinSize: TcxNaturalNumber; +var + AHorizontal: Boolean; +begin + if LookAndFeel.SkinPainter <> nil then + begin + AHorizontal := AlignSplitter in [salBottom, salTop]; + if AHorizontal then + Result := LookAndFeel.SkinPainter.GetSplitterSize(AHorizontal).cy + else + Result := LookAndFeel.SkinPainter.GetSplitterSize(AHorizontal).cx; + end + else + if Assigned(FHotZone) then + Result := FHotZone.GetMinSize + else + Result := SplitterDefaultSize; +end; + +function TcxCustomSplitter.GetSplitterMaxSize: TcxNaturalNumber; +var + AHorizontal: Boolean; +begin + if LookAndFeel.SkinPainter <> nil then + begin + AHorizontal := AlignSplitter in [salBottom, salTop]; + if AHorizontal then + Result := LookAndFeel.SkinPainter.GetSplitterSize(AHorizontal).cy + else + Result := LookAndFeel.SkinPainter.GetSplitterSize(AHorizontal).cx; + end + else + if Assigned(FHotZone) then + Result := FHotZone.GetMaxSize + else + Result := SplitterDefaultSize; +end; + +procedure TcxCustomSplitter.NormalizeSplitterSize; + + procedure AdjustSplitterSize; + begin + case FAlignSplitter of + salBottom, salTop: Height := GetSplitterMinSize; + salLeft, salRight: Width := GetSplitterMinSize; + end; + case FAlignSplitter of + salBottom, salTop:begin + Constraints.MinWidth := 0; + Constraints.MaxWidth := 0; + Constraints.MinHeight := GetSplitterMinSize; + Constraints.MaxHeight := GetSplitterMaxSize; + if (Height < Constraints.MinHeight) or (Height > Constraints.MaxHeight) then + Height := Constraints.MinHeight; + end; + salLeft, salRight:begin + Constraints.MinWidth := GetSplitterMinSize; + Constraints.MaxWidth := GetSplitterMaxSize; + Constraints.MinHeight := 0; + Constraints.MaxHeight := 0; + if (Width < Constraints.MinWidth) or (Width > Constraints.MaxWidth) then + Width := Constraints.MinWidth; + end; + end; + end; + +begin + if not Assigned(FHotZone) and (LookAndFeel.SkinPainter = nil) then + begin + Constraints.MinWidth := 0; + Constraints.MaxWidth := 0; + Constraints.MinHeight := 0; + Constraints.MaxHeight := 0; + end + else + AdjustSplitterSize; +end; + +function TcxCustomSplitter.CalculateSplitterDirection: TcxSplitterDirection; +begin + Result := Low(TcxSplitterDirection); + case FAlignSplitter of + salTop: + if ((State = ssOpened) and (not InvertDirection)) or + ((State = ssClosed) and (InvertDirection)) then + Result := cxsdBottomToTop + else + Result := cxsdTopToBottom; + salBottom: + if ((State = ssOpened) and (not InvertDirection)) or + ((State = ssClosed) and (InvertDirection)) then + Result := cxsdTopToBottom + else + Result := cxsdBottomToTop; + salLeft: + if ((State = ssOpened) and (not InvertDirection)) or + ((State = ssClosed) and (InvertDirection)) then + Result := cxsdRightToLeft + else + Result := cxsdLeftToRight; + salRight: + if ((State = ssOpened) and (not InvertDirection)) or + ((State = ssClosed) and (InvertDirection)) then + Result := cxsdLeftToRight + else + Result := cxsdRightToLeft; + end; +end; + +procedure TcxCustomSplitter.UpdateMouseStates(X, Y: Integer); +begin + if IsPointInHotZone(X, Y) then + Include(FMouseStates, smsInHotZone) + else + Exclude(FMouseStates, smsInHotZone); +end; + +procedure TcxCustomSplitter.SetSplitterState(Value: TcxSplitterState); +begin + if FState <> Value then + begin + if Assigned(FControl) then + begin + case Value of + ssOpened: OpenSplitter; + ssClosed: CloseSplitter; + end; + end; + FState := Value; + end; +end; + +procedure TcxCustomSplitter.SetAllowHotZoneDrag(Value: Boolean); +begin + if FAllowHotZoneDrag <> Value then + begin + StopSizing; + FAllowHotZoneDrag := Value; + end; +end; + +procedure TcxCustomSplitter.SetInvertDirection(Value: Boolean); +begin + if FInvertDirection <> Value then + begin + FInvertDirection := Value; + StopSizing; + Invalidate; + end; +end; + +function TcxCustomSplitter.FindControl: TControl; +var + P: TPoint; + I_count: Integer; + R, FRReligned: TRect; +begin + Result := nil; + P := Point(Left, Top); + case Align of + alLeft: Dec(P.X); + alRight: Inc(P.X, Width); + alTop: Dec(P.Y); + alBottom: Inc(P.Y, Height); + else Exit; + end; + for I_count:=0 to Parent.ControlCount-1 do + begin + Result := Parent.Controls[I_count]; + if (Result.Visible) and (Result.Enabled) then + begin + R := Result.BoundsRect; + if (R.Right - R.Left) = 0 then + if (Align in [alTop, alLeft]) then + Dec(R.Left) + else + Inc(R.Right); + if (R.Bottom - R.Top) = 0 then + if (Align in [alTop, alLeft]) then + Dec(R.Top) + else + Inc(R.Bottom); + if PtInRect(R, P) = True then Exit + else + begin + if (Result.Align = Self.Align) then + begin + FRReligned := Result.BoundsRect; + case Result.Align of + alLeft: if (FRReligned.Right = FRReligned.Left) and + (FRReligned.Left = Self.Width) then Exit; + alRight: if (FRReligned.Right = FRReligned.Left) and + (FRReligned.Right = Self.Left) then Exit; + alTop: if (FRReligned.Bottom = FRReligned.Top) and + (FRReligned.Top = Self.Height) then Exit; + alBottom: if (FRReligned.Bottom = FRReligned.Top) and + (FRReligned.Bottom = Self.Top) then Exit; + end; + end; + end; + end; + end; + Result := nil; +end; + +procedure TcxCustomSplitter.HotZoneStyleChanged; +begin + Invalidate; +end; + +procedure TcxCustomSplitter.Paint; +var + R: TRect; +begin + R := ClientRect; + FDrawBitmap.Width := RectWidth(R); + FDrawBitmap.Height := RectHeight(R); + FDrawBitmap.Canvas.Brush.Color := Color; + if LookAndFeel.SkinPainter = nil then + begin + if AreVisualStylesAvailable and NativeBackground then + begin + cxDrawThemeParentBackground(Self, Canvas, R); + BitBlt(FDrawBitmap.Canvas.Handle, 0, 0, RectWidth(R), RectHeight(R), + Canvas.Handle, 0, 0, SRCCOPY); + end + else + FDrawBitmap.Canvas.FillRect(R); + if (HotZone <> nil) and HotZone.Visible then + DrawHotZone; + end else + begin + cxDrawTransparentControlBackground(Self, FDrawCanvas, R); + LookAndFeel.SkinPainter.DrawSplitter(FDrawCanvas, R, smsInHotZone in FMouseStates, + (smsClicked in FMouseStates) and (smsInHotZone in FMouseStates), + AlignSplitter in [salBottom, salTop]); + end; + BitBlt(Canvas.Handle, 0, 0, RectWidth(R), RectHeight(R), + FDrawBitmap.Canvas.Handle, 0, 0, SRCCOPY); +end; + +procedure TcxCustomSplitter.DrawHotZone; +begin + if HotZone <> nil then + HotZone.DrawHotZone(FDrawCanvas, FDrawCanvas.Canvas.ClipRect, + (smsInHotZone in FMouseStates), + (smsClicked in FMouseStates) and (smsInHotZone in FMouseStates)); +end; + +function TcxCustomSplitter.DoCanResize(var NewSize: Integer): Boolean; +begin + Result := CanResize(NewSize); + if Result and FAutoSnap and (NewSize < InternalGetMinSize) then + NewSize := 0; +end; + +procedure TcxCustomSplitter.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + inherited LookAndFeelChanged(Sender, AChangedValues); + NormalizeSplitterSize; +end; + +function TcxCustomSplitter.CanFocusOnClick: Boolean; +begin + Result := False; +end; + +function TcxCustomSplitter.CanResize(var NewSize: Integer): Boolean; +begin + Result := True; + if Assigned(FOnCanResize) then FOnCanResize(Self, NewSize, Result); +end; + +procedure TcxCustomSplitter.UpdateControlSize; + + procedure CorrectSelfPosition; + begin + if FOldSize <= 0 then + case Align of + alLeft: + Left := FControl.Left + FControl.Width; + alTop: + Top := FControl.Top + FControl.Height; + alRight: + Left := FControl.BoundsRect.Right - Width; + alBottom: + Top := FControl.BoundsRect.Bottom - Height; + end; + end; + +begin + if not Assigned(FControl) or (FNewSize = FOldSize) then + Exit; + Parent.DisableAlign; + try + case Align of + alLeft: + FControl.SetBounds(FControl.Left, FControl.Top, FNewSize, FControl.Height); + alTop: + FControl.SetBounds(FControl.Left, FControl.Top, FControl.Width, FNewSize); + alRight: + FControl.SetBounds(FControl.Left + FControl.Width - FNewSize, + FControl.Top, FNewSize, FControl.Height); + alBottom: + FControl.SetBounds(FControl.Left, + FControl.Top + FControl.Height - FNewSize, FControl.Width, FNewSize); + end; + finally + Parent.EnableAlign; + CorrectSelfPosition; + end; + FOldSize := FNewSize; + DoEventMoved; +end; + +procedure TcxCustomSplitter.CalcSplitSize(X, Y: Integer; + var NewSize, Split: Integer; ACorrectWithMaxMin: Boolean = True); +var + S: Integer; +begin + if not Assigned(FControl) then Exit; + if Align in [alLeft, alRight] then + Split := X - FSplitterClickPoint.X + else + Split := Y - FSplitterClickPoint.Y; + S:=0; + case Align of + alLeft: S := FControl.Width + Split; + alRight: S := FControl.Width - Split; + alTop: S := FControl.Height + Split; + alBottom: S := FControl.Height - Split; + end; + NewSize := S; + if not ACorrectWithMaxMin then + Exit; + if NewSize < 0 then + NewSize := 0; + + if (S < InternalGetMinSize) then + begin + if AutoSnap then + NewSize := 0 + else + NewSize := InternalGetMinSize; + end + else + if S > FMaxSize then + NewSize := FMaxSize; + + if S <> NewSize then + begin + if Align in [alRight, alBottom] then + S := S - NewSize + else + S := NewSize - S; + Inc(Split, S); + end; +end; + +procedure TcxCustomSplitter.ControlResizing(X, Y: Integer); + procedure UpdateState; + begin + if FNewSize > 0 then + FState := ssOpened + else + FState := ssClosed; + end; + + procedure AdjustControlWithMinSize(ANewSize: Integer); + begin + if (ANewSize < MinSize) then + begin + if (FState = ssOpened) and not FAutoSnap then + FNewSize := MinSize + else + case FState of + ssClosed: + if ANewSize >= 0 then + OpenSplitter + else + FNewSize := 0; + ssOpened: + CloseSplitter; + end; + end; + end; + +var + ASplit, ANewSize: Integer; +begin + FLastPatternDrawPosition := -1; + ParentShowHint := FSavedParentShowHint; + ShowHint := FSavedShowHint; + FHotZoneClickPoint := Point(-1, -1); + case FSplitterState of + sstHotZoneClick: + if (smsInHotZone in FMouseStates) then + begin + UpdateMouseStates(X, Y); + case FState of + ssClosed: OpenSplitter; + ssOpened: CloseSplitter; + end; + end; + sstResizing: + begin + StopSizing; + CalcSplitSize(X, Y, ANewSize, ASplit, False); + AdjustControlWithMinSize(ANewSize); + UpdateControlSize; + UpdateState; + if (ANewSize >= 0) then + RecalcLastPosition; + end; + end; + SetDefaultStates; + Invalidate; +end; + +procedure TcxCustomSplitter.UpdateSize(X, Y: Integer); +begin + CalcSplitSize(X, Y, FNewSize, FSplit); +end; + +function TcxCustomSplitter.IsPointInHotZone(const X, Y: Integer): Boolean; +var + AHotZoneRect: TRect; +begin + if not IsAllControlHotZoneStyle then + begin + if HotZone <> nil then + begin + AHotZoneRect := HotZone.CalculateHotZoneRect(ClientRect); + Result := (X >= AHotZoneRect.Left) and (X <= AHotZoneRect.Right) and + (Y >= AHotZoneRect.Top) and (Y <= AHotZoneRect.Bottom); + end + else + Result := False; + end + else + Result := (X >= ClientRect.Left) and (X <= ClientRect.Right) and + (Y >= ClientRect.Top) and (Y <= ClientRect.Bottom); +end; + +function TcxCustomSplitter.IsPointInSplitter(const X, Y: Integer): Boolean; +var + FRect : TRect; +begin + FRect := ClientRect; + Result := ((X >= FRect.Left) and (X <= FRect.Right) and + (Y >= FRect.Top) and (Y <= FRect.Bottom)); +end; + +procedure TcxCustomSplitter.InitResize(X, Y: Integer); + + function GetMaxSize: Integer; + var + AMaxControlSize: Integer; + begin + Result := 0; + case Align of + alLeft: + Result := Parent.ClientWidth - Width - FControl.Left; + alRight: + Result := FControl.Left + FControl.Width - Width; + alTop: + Result := Parent.ClientHeight - Height - FControl.Top; + alBottom: + Result := FControl.Top + FControl.Height - Height; + end; + Dec(Result, FMinSize); + AMaxControlSize := GetMaxControlSize; + if (AMaxControlSize <> 0) and (Result > AMaxControlSize) then + Result := AMaxControlSize; + end; + +begin + FMaxSize := GetMaxSize; + UpdateSize(X, Y); + InitDragImage; + with ValidParentForm(Self) do + if ActiveControl <> nil then + begin + FActiveControl := ActiveControl; + FPrevKeyDown := TWinControlAccess(FActiveControl).OnKeyDown; + TWinControlAccess(FActiveControl).OnKeyDown := FocusKeyDown; + end; + if not ResizeUpdate then + MoveDragImage; +end; + +procedure TcxCustomSplitter.WMCancelMode(var Message: TWMCancelMode); +begin + inherited; + if FSplitterState = sstResizing then + ControlResizing(Left, Top); +end; + +procedure TcxCustomSplitter.WMSetCursor(var Message: TWMSetCursor); +begin +end; + +procedure TcxCustomSplitter.MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + if (Button = mbLeft) and Assigned(FControl) then + begin + FSplitterClickPoint := Point(X, Y); + FSavedShowHint := ShowHint; + FSavedParentShowHint := ParentShowHint; + ShowHint := False; + Include(FMouseStates, smsClicked); + UpdateMouseStates(X, Y); + if (smsInHotZone in FMouseStates) then + begin + FSplitterState := sstHotZoneClick; + FHotZoneClickPoint := Point(X, Y); + Invalidate; + end + else + begin + FSplitterState := sstResizing; + InitResize(X, Y); + end; + end; +end; + +procedure TcxCustomSplitter.MouseMove(Shift: TShiftState; X, Y: Integer); +var + ACursor: TCursor; + ALocalNewSize: Integer; + ASavedMouseStates: TcxSplitterMouseStates; +begin + inherited; + ASavedMouseStates := FMouseStates; + UpdateMouseStates(X, Y); + if (ssLeft in Shift) and (Assigned(FControl)) then + begin + CalcSplitSize(X, Y, ALocalNewSize, FSplit); + case FSplitterState of + sstResizing: + begin + if DoCanResize(ALocalNewSize) then + begin + FNewSize := ALocalNewSize; + if not ResizeUpdate then + MoveDragImage + else + begin + RecalcLastPosition; + UpdateControlSize; + end; + end; + end; + sstHotZoneClick: + begin + if AllowHotZoneDrag then + begin + if (((FHotZoneClickPoint.X + DragThreshold) <= X) or + ((FHotZoneClickPoint.X - DragThreshold) >= X) or + ((FHotZoneClickPoint.Y + DragThreshold) <= Y) or + ((FHotZoneClickPoint.Y - DragThreshold) >= Y)) and + DoCanResize(ALocalNewSize) then + begin + FSplitterState := sstResizing; + InitResize(X, Y); + end; + end + else + if (FMouseStates <> ASavedMouseStates) then + Invalidate; + end; + end; + end; + if Shift * [ssLeft, ssRight] = [] then + begin + if FMouseStates <> ASavedMouseStates then + Invalidate; + if (smsInHotZone in FMouseStates) and not IsAllControlHotZoneStyle then + ACursor := crDefault + else + begin + ACursor := Cursor; + if ACursor = crDefault then + if Align in [alBottom, alTop] then + ACursor := crVSplit + else + ACursor := crHSplit; + end; + SetCursor(Screen.Cursors[ACursor]); + end; +end; + +procedure TcxCustomSplitter.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + if (Button = mbLeft) and Assigned(FControl) and (smsClicked in FMouseStates) then + ControlResizing(X, Y); +end; + +procedure TcxCustomSplitter.FocusKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); +begin + if (Key = VK_ESCAPE) then + begin + StopSizing; + SetDefaultStates; + end + else + if Assigned(FPrevKeyDown) then FPrevKeyDown(Sender, Key, Shift); +end; + +procedure TcxCustomSplitter.StopSizing; +var + AMousePoint: TPoint; +begin + if Assigned(FControl) then + begin + ReleaseDragImage; + AMousePoint := ScreenToClient(Mouse.CursorPos); + UpdateMouseStates(AMousePoint.X, AMousePoint.Y); + if Assigned(FActiveControl) then + begin + TWinControlAccess(FActiveControl).OnKeyDown := FPrevKeyDown; + FActiveControl := nil; + end; + FSplitterState := sstNormal; + end; +end; + +procedure TcxCustomSplitter.OpenSplitter; +var + AAllowOpenHotZone: Boolean; + ANewSize: Integer; +begin + if State = ssOpened then Exit; + if FAutoPosition = True then + ANewSize := FPositionBeforeClose + else + ANewSize := FPositionAfterOpen; + if ANewSize < InternalGetMinSize then + ANewSize := InternalGetMinSize; + + AAllowOpenHotZone := True; + DoEventBeforeOpen(ANewSize, AAllowOpenHotZone); + if AAllowOpenHotZone = False then Exit; + FState := ssOpened; + FNewSize := ANewSize; + RecalcLastPosition; + UpdateControlSize; + DoEventAfterOpen; + Invalidate; +end; + +procedure TcxCustomSplitter.CloseSplitter; +var + FAllowCloseHotZone: Boolean; +begin + if State = ssClosed then Exit; + FAllowCloseHotZone := True; + DoEventBeforeClose(FAllowCloseHotZone); + if FAllowCloseHotZone = False then Exit; + FState := ssClosed; + FNewSize := 0; + RecalcLastPosition; + UpdateControlSize; + DoEventAfterClose; + Invalidate; +end; + +procedure TcxCustomSplitter.RecalcLastPosition; +begin + if (FControl<>nil) then + case FAlignSplitter of + salBottom, salTop: + FPositionBeforeClose := FControl.Height; + salLeft, salRight: + FPositionBeforeClose := FControl.Width; + end; +end; + +procedure TcxCustomSplitter.DoEventBeforeOpen(var ANewSize: Integer; + var AllowOpenHotZone: Boolean); +begin + if Assigned(FOnBeforeOpen) then + FOnBeforeOpen(Self, ANewSize, AllowOpenHotZone); +end; + +procedure TcxCustomSplitter.DoEventAfterOpen; +begin + if Assigned(FOnAfterOpen) then FOnAfterOpen(Self); +end; + +procedure TcxCustomSplitter.DoEventBeforeClose(var AllowCloseHotZone: Boolean); +begin + if Assigned(FOnBeforeClose) then FOnBeforeClose(Self, AllowCloseHotZone); +end; + +procedure TcxCustomSplitter.DoEventAfterClose; +begin + if Assigned(FOnAfterClose) then FOnAfterClose(Self); +end; + +procedure TcxCustomSplitter.DoEventMoved; +begin + if Assigned(FOnMoved) then FOnMoved(Self); +end; + +function TcxCustomSplitter.InternalGetMinSize: Integer; +var + AMinSizeConstraints: Integer; +begin + Result := FMinSize; + if FControl = nil then + Exit; + case AlignSplitter of + salBottom, salTop: + AMinSizeConstraints := FControl.Constraints.MinHeight; + salLeft, salRight: + AMinSizeConstraints := FControl.Constraints.MinWidth; + else + AMinSizeConstraints := 0; + end; + if AMinSizeConstraints > FMinSize then + Result := AMinSizeConstraints; +end; + +initialization + GetRegisteredHotZoneStyles.Register(TcxMediaPlayer8Style, scxHotZoneStyleMediaPlayer8); + GetRegisteredHotZoneStyles.Register(TcxMediaPlayer9Style, scxHotZoneStyleMediaPlayer9); + GetRegisteredHotZoneStyles.Register(TcxXPTaskBarStyle, scxHotZoneStyleXPTaskBar); + GetRegisteredHotZoneStyles.Register(TcxSimpleStyle, scxHotZoneStyleSimple); + +finalization + GetRegisteredHotZoneStyles.Unregister(TcxMediaPlayer8Style); + GetRegisteredHotZoneStyles.Unregister(TcxMediaPlayer9Style); + GetRegisteredHotZoneStyles.Unregister(TcxXPTaskBarStyle); + GetRegisteredHotZoneStyles.Unregister(TcxSimpleStyle); + FreeAndNil(FRegisteredHotZoneStyles); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxSplitterEditor.dfm b/official/x.35/ExpressEditors Library 5/Sources/cxSplitterEditor.dfm new file mode 100644 index 00000000..5cd18424 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxSplitterEditor.dfm @@ -0,0 +1,259 @@ +object cxSplitEditor: TcxSplitEditor + Left = 224 + Top = 210 + ActiveControl = cxCbAhd + BorderStyle = bsDialog + ClientHeight = 383 + ClientWidth = 466 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object cxGroupBox1: TcxGroupBox + Left = 8 + Top = 200 + Width = 449 + Height = 145 + Caption = ' Preview ' + TabOrder = 0 + object Panel1: TPanel + Left = 8 + Top = 16 + Width = 426 + Height = 121 + BevelOuter = bvNone + TabOrder = 0 + object cxListBox1: TcxListBox + Left = 0 + Top = 0 + Width = 145 + Height = 121 + TabStop = False + Align = alLeft + ItemHeight = 13 + TabOrder = 0 + end + object cxSplit: TcxSplitter + Left = 145 + Top = 0 + Width = 8 + Height = 121 + AutoPosition = False + AutoSnap = True + Control = cxListBox1 + end + object cxListBox2: TcxListBox + Left = 153 + Top = 0 + Width = 273 + Height = 121 + TabStop = False + Align = alClient + ItemHeight = 13 + TabOrder = 2 + end + end + end + object cxGroupBox2: TcxGroupBox + Left = 8 + Top = 8 + Width = 153 + Height = 189 + Caption = ' Operation ' + TabOrder = 1 + object Label1: TLabel + Left = 27 + Top = 119 + Width = 40 + Height = 13 + Caption = 'Min Size' + end + object Label2: TLabel + Left = 28 + Top = 61 + Width = 88 + Height = 13 + Caption = 'Position after open' + end + object cxCbAhd: TcxCheckBox + Left = 8 + Top = 16 + Width = 121 + Height = 21 + Caption = 'Allow HotZone Drag' + TabOrder = 0 + OnClick = cxCbAhdClick + end + object cxCbAp: TcxCheckBox + Left = 8 + Top = 40 + Width = 105 + Height = 21 + Caption = 'Auto Position' + TabOrder = 1 + OnClick = cxCbApClick + end + object cxCbSnap: TcxCheckBox + Left = 8 + Top = 99 + Width = 105 + Height = 21 + Caption = 'Auto Snap' + TabOrder = 3 + OnClick = cxCbSnapClick + end + object cxCbRu: TcxCheckBox + Left = 8 + Top = 161 + Width = 105 + Height = 21 + Caption = 'Resize Update' + TabOrder = 5 + OnClick = cxCbRuClick + end + object cxSeMs: TcxSpinEdit + Left = 27 + Top = 133 + Width = 89 + Height = 21 + Properties.MaxValue = 145.000000000000000000 + Properties.SpinButtons.ShowFastButtons = True + Properties.OnChange = cxSeMsPropertiesChange + TabOrder = 4 + Value = 30 + end + object cxSePao: TcxSpinEdit + Left = 28 + Top = 75 + Width = 89 + Height = 21 + Properties.MaxValue = 200.000000000000000000 + Properties.MinValue = 1.000000000000000000 + Properties.SpinButtons.ShowFastButtons = True + Properties.OnChange = cxSePaoPropertiesChange + TabOrder = 2 + Value = 200 + end + end + object cxGroupBox3: TcxGroupBox + Left = 168 + Top = 8 + Width = 289 + Height = 189 + Caption = ' Hot Zone ' + TabOrder = 2 + object Label3: TLabel + Left = 9 + Top = 120 + Width = 73 + Height = 13 + Caption = 'HotZone Width' + end + object cxRbHzNone: TcxRadioButton + Left = 9 + Top = 40 + Width = 113 + Height = 17 + Caption = 'None' + Checked = True + TabOrder = 1 + TabStop = True + OnClick = cxRbHzNoneClick + end + object cxRbHzMp8: TcxRadioButton + Left = 9 + Top = 65 + Width = 96 + Height = 17 + Hint = 'MediaPlayer8' + Caption = 'Media Player 8' + TabOrder = 2 + OnClick = cxRbHzMp8Click + end + object cxRbHzMp9: TcxRadioButton + Left = 106 + Top = 65 + Width = 113 + Height = 17 + Hint = 'MediaPlayer9' + Caption = 'Media Player 9' + TabOrder = 3 + OnClick = cxRbHzMp8Click + end + object cxRbHzSimple: TcxRadioButton + Left = 106 + Top = 90 + Width = 113 + Height = 17 + Hint = 'Simple' + Caption = 'Simple' + TabOrder = 4 + OnClick = cxRbHzMp8Click + end + object cxRbHzXp: TcxRadioButton + Left = 9 + Top = 90 + Width = 96 + Height = 17 + Hint = 'XPTaskBar' + Caption = 'XP Task Bar' + TabOrder = 5 + OnClick = cxRbHzMp8Click + end + object cxCbHzVisible: TcxCheckBox + Left = 9 + Top = 16 + Width = 121 + Height = 21 + Caption = 'Visible' + Enabled = False + Properties.OnChange = cxCbHzVisiblePropertiesChange + TabOrder = 0 + end + object cxTbHzWidth: TcxTrackBar + Left = 8 + Top = 136 + Width = 273 + Height = 49 + Position = 10 + Properties.Frequency = 5 + Properties.Min = 10 + Properties.Max = 100 + Properties.SelectionStart = 30 + Properties.SelectionEnd = 60 + Properties.SelectionColor = clGreen + Properties.OnChange = cxTbHzWidthPropertiesChange + TabOrder = 6 + end + end + object cxBtnOK: TcxButton + Left = 304 + Top = 352 + Width = 75 + Height = 25 + Caption = 'OK' + ModalResult = 1 + TabOrder = 3 + end + object cxBtnCancel: TcxButton + Left = 384 + Top = 352 + Width = 75 + Height = 25 + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 4 + end + object cxLookAndFeelController1: TcxLookAndFeelController + Kind = lfFlat + NativeStyle = True + Left = 200 + Top = 344 + end +end diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxSplitterEditor.pas b/official/x.35/ExpressEditors Library 5/Sources/cxSplitterEditor.pas new file mode 100644 index 00000000..6e2a7381 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxSplitterEditor.pas @@ -0,0 +1,242 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSplitterEditor; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Classes, Controls, Dialogs, ExtCtrls, Forms, Graphics, Messages, + StdCtrls, SysUtils, cxButtons, cxCheckBox, cxContainer, cxControls, cxEdit, + cxGroupBox, cxListBox, cxLookAndFeelPainters, cxLookAndFeels, cxMaskEdit, + cxRadioGroup, cxSpinEdit, cxSplitter, cxTextEdit, cxTrackBar; + +type + TcxSplitEditor = class(TForm) + cxGroupBox1: TcxGroupBox; + Panel1: TPanel; + cxListBox1: TcxListBox; + cxSplit: TcxSplitter; + cxListBox2: TcxListBox; + cxGroupBox2: TcxGroupBox; + cxCbAhd: TcxCheckBox; + cxCbAp: TcxCheckBox; + cxCbSnap: TcxCheckBox; + cxCbRu: TcxCheckBox; + Label1: TLabel; + cxSeMs: TcxSpinEdit; + Label2: TLabel; + cxSePao: TcxSpinEdit; + cxGroupBox3: TcxGroupBox; + cxRbHzNone: TcxRadioButton; + cxRbHzMp8: TcxRadioButton; + cxRbHzMp9: TcxRadioButton; + cxRbHzSimple: TcxRadioButton; + cxRbHzXp: TcxRadioButton; + cxLookAndFeelController1: TcxLookAndFeelController; + cxCbHzVisible: TcxCheckBox; + cxTbHzWidth: TcxTrackBar; + Label3: TLabel; + cxBtnOK: TcxButton; + cxBtnCancel: TcxButton; + procedure cxCbAhdClick(Sender: TObject); + procedure cxCbApClick(Sender: TObject); + procedure cxCbSnapClick(Sender: TObject); + procedure cxCbRuClick(Sender: TObject); + procedure cxSeMsPropertiesChange(Sender: TObject); + procedure cxSePaoPropertiesChange(Sender: TObject); + procedure cxCbHzVisiblePropertiesChange(Sender: TObject); + procedure cxRbHzNoneClick(Sender: TObject); + procedure cxRbHzMp8Click(Sender: TObject); + procedure cxTbHzWidthPropertiesChange(Sender: TObject); + public + procedure SetSplitControls; + end; + +procedure ShowSplitterEditor(ASplitter: TcxSplitter); + +implementation + +{$R *.dfm} + +uses + cxExtEditConsts; + +procedure ShowSplitterEditor(ASplitter: TcxSplitter); +var + AOwnerCaption: string; +begin + with TcxSplitEditor.Create(Application) do + try + if ASplitter.Owner <> nil then + AOwnerCaption := ASplitter.Owner.Name + '.' + else + AOwnerCaption := ''; + Caption := Format('%s%s - Splitter Control', [AOwnerCaption, ASplitter.Name]); + cxSplit.AllowHotZoneDrag := ASplitter.AllowHotZoneDrag; + cxSplit.AutoPosition := ASplitter.AutoPosition; + cxSplit.AutoSnap := ASplitter.AutoSnap; + cxSplit.PositionAfterOpen := ASplitter.PositionAfterOpen; + cxSplit.MinSize := ASplitter.MinSize; + cxSplit.ResizeUpdate := ASplitter.ResizeUpdate; + if Assigned(ASplitter.HotZone) then + begin + cxSplit.HotZoneClassName := ASplitter.HotZoneClassName; + cxSplit.HotZone.Assign(ASplitter.Hotzone); + end; + SetSplitControls; + if ShowModal = mrOK then + begin + ASplitter.AllowHotZoneDrag := cxSplit.AllowHotZoneDrag; + ASplitter.AutoPosition := cxSplit.AutoPosition; + ASplitter.AutoSnap := cxSplit.AutoSnap; + ASplitter.PositionAfterOpen := cxSplit.PositionAfterOpen; + ASplitter.MinSize := cxSplit.MinSize; + ASplitter.ResizeUpdate := cxSplit.ResizeUpdate; + if Assigned(cxSplit.HotZone) then + begin + ASplitter.HotZoneClassName := cxSplit.HotZoneClassName; + ASplitter.HotZone.Assign(cxSplit.HotZone); + end + else + ASplitter.HotZoneClassName := ''; + SetDesignerModified(ASplitter); + end; + finally + Free; + end; +end; + +procedure TcxSplitEditor.cxCbAhdClick(Sender: TObject); +begin + cxSplit.AllowHotZoneDrag := cxCbAhd.Checked; +end; + +procedure TcxSplitEditor.cxCbApClick(Sender: TObject); +begin + cxSplit.AutoPosition := cxCbAp.Checked; +end; + +procedure TcxSplitEditor.cxCbSnapClick(Sender: TObject); +begin + cxSplit.AutoSnap := cxCbSnap.Checked; +end; + +procedure TcxSplitEditor.cxCbRuClick(Sender: TObject); +begin + cxSplit.ResizeUpdate := cxCbRu.Checked; +end; + +procedure TcxSplitEditor.cxSeMsPropertiesChange(Sender: TObject); +begin + cxSplit.MinSize := Integer(cxSeMs.Value); +end; + +procedure TcxSplitEditor.cxSePaoPropertiesChange(Sender: TObject); +begin + cxSplit.PositionAfterOpen := Integer(cxSePao.Value); +end; + +procedure TcxSplitEditor.cxCbHzVisiblePropertiesChange(Sender: TObject); +begin + if Assigned(cxSplit.Hotzone) then + cxSplit.HotZone.Visible := cxCbHzVisible.Checked; +end; + +procedure TcxSplitEditor.cxRbHzNoneClick(Sender: TObject); +begin + cxCbHzVisible.Checked := False; + cxSplit.HotZoneClassName := ''; + cxCbHzVisible.Enabled := False; + cxTbHzWidth.Enabled := False; +end; + +procedure TcxSplitEditor.cxRbHzMp8Click(Sender: TObject); +var + vText: string; + vHzcl: TcxHotZoneStyleClass; +begin + vText := TcxRadioButton(Sender).Hint; + vHzCl := TcxHotZoneStyleClass(GetRegisteredHotZoneStyles.FindByClassName(vText)); + if vHzCl = nil then + vHzCl := TcxHotZoneStyleClass(GetRegisteredHotZoneStyles.FindByDescription(vText)); + cxSplit.HotZoneStyleClass := vHzCl; + cxCbHzVisible.Enabled := True; + cxCbHzVisible.Checked := True; + cxTbHzWidth.Enabled := True; + cxTbHzWidth.EditValue := Variant(cxSplit.HotZone.SizePercent); +end; + +procedure TcxSplitEditor.cxTbHzWidthPropertiesChange(Sender: TObject); +begin + if Assigned(cxSplit.HotZone) then + cxSplit.HotZone.SizePercent := Integer(cxTbHzWidth.EditValue); +end; + +Procedure TcxSplitEditor.SetSplitControls; +Var + vHzt: Integer; +Begin + cxCbAhd.Checked := cxSplit.AllowHotZoneDrag; + cxCbAp.Checked := cxSplit.AutoPosition; + cxSePao.Value := Variant(cxSplit.PositionAfterOpen); + cxCbSnap.Checked := cxSplit.AutoSnap; + cxSeMs.Value := Variant(cxSplit.MinSize); + cxCbRu.Checked := cxSplit.ResizeUpdate; + if Assigned(cxSplit.HotZone) then + begin + cxTbHzWidth.EditValue := TcxEditValue(cxSplit.HotZone.SizePercent); + cxCbHzVisible.Checked := cxSplit.HotZone.Visible; + vHzt := GetRegisteredHotZoneStyles.GetIndexByClass(cxSplit.HotZone.ClassType); + case vHzt of + 0: cxRbHzMp8.Checked := True; + 1: cxRbHzMp9.Checked := True; + 2: cxRbHzXp.Checked := True; + 3: cxRbHzSimple.Checked := True; + end; + end + else + begin + cxRbHzNone.Checked := True; + end; + cxTbHzWidth.Enabled := Assigned(cxSplit.HotZone); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxStandardMask.pas b/official/x.35/ExpressEditors Library 5/Sources/cxStandardMask.pas new file mode 100644 index 00000000..fae41f20 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxStandardMask.pas @@ -0,0 +1,738 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxStandardMask; + +{$I cxVer.inc} + +interface + +uses + Classes, SysUtils; + +type + { TcxStandardMaskCustomItem } + + TcxStandardMaskCustomItem = class + public + function Check(var AChar: Char): Boolean; virtual; abstract; + end; + + { TcxStandardMaskLiteralItem } + + TcxStandardMaskLiteralItem = class(TcxStandardMaskCustomItem) + private + FLiteral: Char; + public + constructor Create(ALiteral: Char); + function Check(var AChar: Char): Boolean; override; + property Literal: Char read FLiteral; + end; + + { TcxCaseControl } + + TcxCaseControl = (ccUpperCase, ccLowerCase, ccUserCase); + + { TcxStandardMaskManyItem } + + TcxStandardMaskManyItem = class(TcxStandardMaskCustomItem) + private + FCaseControl: TcxCaseControl; + FOptional: Boolean; + protected + procedure DoCaseControl(var AChar: Char); + public + constructor Create(AOptional: Boolean; ACaseControl: TcxCaseControl); + property Optional: Boolean read FOptional; + end; + + { TcxStandardMaskAlphaItem } + + TcxStandardMaskAlphaItem = class(TcxStandardMaskManyItem) + public + function Check(var AChar: Char): Boolean; override; + end; + + { TcxStandardMaskAlphaNumericItem } + + TcxStandardMaskAlphaNumericItem = class(TcxStandardMaskManyItem) + public + function Check(var AChar: Char): Boolean; override; + end; + + { TcxStandardMaskASCIIItem } + + TcxStandardMaskASCIIItem = class(TcxStandardMaskManyItem) + public + function Check(var AChar: Char): Boolean; override; + end; + + { TcxStandardMaskNumericItem } + + TcxStandardMaskNumericItem = class(TcxStandardMaskManyItem) + public + function Check(var AChar: Char): Boolean; override; + end; + + { TcxStandardMaskNumericSymbolItem } + + TcxStandardMaskNumericSymbolItem = class(TcxStandardMaskManyItem) + public + constructor Create(AOptional: Boolean; ACaseControl: TcxCaseControl); + function Check(var AChar: Char): Boolean; override; + end; + + { TcxStandardMask } + + TcxStandardMask = class + private + FBlank: Char; + FItems: TList; + FLeading: Boolean; + FSaveLiteralCharacters: Boolean; + FMask: string; + procedure Clear; + procedure DoCompileBody(const AMask: string); + procedure DoCompileHead(var AMask: string); + function GetCount: Integer; + function GetEmptyString: string; + function GetFullEmptyString: string; + function GetItems(AIndex: Integer): TcxStandardMaskCustomItem; + public + constructor Create; + destructor Destroy; override; + procedure Compile(AMask: string); + procedure Format(var AText: string; AChangeCharCase: Boolean = True; + AMatchForBlanksAndLiterals: Boolean = True); + procedure Format2(var AText: string); + function IsFullValid(var AText: string): Boolean; + function IsValid(var AText: string): Boolean; + property Blank: Char read FBlank write FBlank; + property Count: Integer read GetCount; + property EmptyString: string read GetEmptyString; + property FullEmptyString: string read GetFullEmptyString; + property Items[AIndex: Integer]: TcxStandardMaskCustomItem read GetItems; + property Mask: string read FMask; + property SaveLiteralCharacters: Boolean read FSaveLiteralCharacters; + end; + + function EmptyString(const AMask: string; const ABlank: Char = #0): string; + function FormatText(const AText, AMask: string; const ABlank: Char = #0): string; + function IsTextFullValid(const AText, AMask: string): Boolean; + function IsTextValid(const AText, AMask: string): Boolean; + function MaskBlank(const AMask: string): Char; + function SaveLiteralChars(const AMask: string): Boolean; + +const + cxDefaultBlank = '_'; + +implementation + +function EmptyString(const AMask: string; const ABlank: Char): string; +var + AMaskObject: TcxStandardMask; +begin + AMaskObject := TcxStandardMask.Create; + try + AMaskObject.Compile(AMask); + if ABlank <> #0 then + AMaskObject.Blank := ABlank; + Result := AMaskObject.EmptyString; + finally + AMaskObject.Free; + end; +end; + +function FormatText(const AText, AMask: string; const ABlank: Char): string; +var + AMaskObject: TcxStandardMask; +begin + AMaskObject := TcxStandardMask.Create; + try + AMaskObject.Compile(AMask); + Result := AText; + if ABlank <> #0 then + AMaskObject.Blank := ABlank; + AMaskObject.Format(Result); + finally + AMaskObject.Free; + end; +end; + +function IsTextFullValid(const AText, AMask: string): Boolean; +var + AMaskObject: TcxStandardMask; + AAText: string; +begin + AMaskObject := TcxStandardMask.Create; + try + AMaskObject.Compile(AMask); + AAText := AText; + Result := AMaskObject.IsFullValid(AAText); + finally + AMaskObject.Free; + end; +end; + +function IsTextValid(const AText, AMask: string): Boolean; +var + AMaskObject: TcxStandardMask; + AAText: string; +begin + AMaskObject := TcxStandardMask.Create; + try + AMaskObject.Compile(AMask); + AAText := AText; + Result := AMaskObject.IsValid(AAText); + finally + AMaskObject.Free; + end; +end; + +function MaskBlank(const AMask: string): Char; +var + AMaskObject: TcxStandardMask; +begin + AMaskObject := TcxStandardMask.Create; + try + AMaskObject.Compile(AMask); + Result := AMaskObject.Blank; + finally + AMaskObject.Free; + end; +end; + +function SaveLiteralChars(const AMask: string): Boolean; +var + AMaskObject: TcxStandardMask; +begin + AMaskObject := TcxStandardMask.Create; + try + AMaskObject.Compile(AMask); + Result := AMaskObject.SaveLiteralCharacters; + finally + AMaskObject.Free; + end; +end; + +{ TcxStandardMaskLiteralItem } + +constructor TcxStandardMaskLiteralItem.Create(ALiteral: Char); +begin + inherited Create; + FLiteral := ALiteral; +end; + +function TcxStandardMaskLiteralItem.Check(var AChar: Char): Boolean; +begin + Result := AChar = FLiteral; +end; + +{ TcxStandardMaskManyItem } + +constructor TcxStandardMaskManyItem.Create(AOptional: Boolean; ACaseControl: TcxCaseControl); +begin + inherited Create; + FOptional := AOptional; + FCaseControl := ACaseControl; +end; + +procedure TcxStandardMaskManyItem.DoCaseControl(var AChar: Char); +var + AStr: string; +begin + AStr := AChar; + + case FCaseControl of + ccUpperCase: + AStr := UpperCase(AStr); + ccLowerCase: + AStr := LowerCase(AStr); + ccUsercase:; + end; + + AChar := AStr[1]; +end; + +{ TcxStandardMaskAlphaItem } + +function TcxStandardMaskAlphaItem.Check(var AChar: Char): Boolean; +begin + Result := AChar in ['a'..'z', 'A'..'Z']; + DoCaseControl(AChar); +end; + +{ TcxStandardMaskAlphaNumericItem } + +function TcxStandardMaskAlphaNumericItem.Check(var AChar: Char): Boolean; +begin + Result := AChar in ['a'..'z', 'A'..'Z', '0'..'9']; + DoCaseControl(AChar); +end; + +{ TcxStandardMaskASCIIItem } + +function TcxStandardMaskASCIIItem.Check(var AChar: Char): Boolean; +begin + Result := True; + DoCaseControl(AChar); +end; + +{ TcxStandardMaskNumericItem } + +function TcxStandardMaskNumericItem.Check(var AChar: Char): Boolean; +begin + Result := AChar in ['0'..'9']; + DoCaseControl(AChar); +end; + +{ TcxStandardMaskNumericSymbolItem } + +constructor TcxStandardMaskNumericSymbolItem.Create(AOptional: Boolean; ACaseControl: TcxCaseControl); +begin + inherited Create(True, ACaseControl); +end; + +function TcxStandardMaskNumericSymbolItem.Check(var AChar: Char): Boolean; +begin + Result := AChar in ['0'..'9', '+', '-']; + DoCaseControl(AChar); +end; + +{ TcxStandardMask } + +constructor TcxStandardMask.Create; +begin + inherited Create; + FMask := ''; + FLeading := False; + FSaveLiteralCharacters := True; + FBlank := cxDefaultBlank; + FItems := TList.Create; +end; + +destructor TcxStandardMask.Destroy; +begin + Clear; + FItems.Free; + + inherited Destroy; +end; + +procedure TcxStandardMask.Compile(AMask: string); +var + AString: string; +begin + Clear; + + FMask := AMask; + AString := AMask; + DoCompileHead(AString); + DoCompileBody(AString); +end; + +procedure TcxStandardMask.Format(var AText: string; AChangeCharCase: Boolean = True; + AMatchForBlanksAndLiterals: Boolean = True); +var + AChar: Char; + ANotTestedPos, AStep, I, J: Integer; + AResult: string; +begin + AResult := FullEmptyString; + + if FLeading then + begin + ANotTestedPos := Count - 1; + AStep := -1; + I := Length(AText); + end + else + begin + ANotTestedPos := 0; + AStep := 1; + I := 1; + end; + + while (I >= 1) and (I <= Length(AText)) do + begin + AChar := AText[I]; + J := ANotTestedPos; + while (J >= 0) and (J < Count) do + begin + if not SaveLiteralCharacters and not AMatchForBlanksAndLiterals and + (Items[J] is TcxStandardMaskLiteralItem) then + begin + Inc(J, AStep); + Continue; + end; + if Items[J].Check(AChar) then + begin + Delete(AResult, J + 1, 1); + if AChangeCharCase then + Insert(AChar, AResult, J + 1) + else + Insert(AText[I], AResult, J + 1); + ANotTestedPos := J + AStep; + Break; + end + else + begin + if ((AText[I] = FBlank) or (AText[I] = ' ')) and (Items[J] is TcxStandardMaskManyItem) then + begin + ANotTestedPos := J + AStep; + Break; + end; + end; + Inc(J, AStep); + end; + Inc(I, AStep); + end; + + AText := AResult; +end; + +// The AText must be fotmatted by Format procedure already +procedure TcxStandardMask.Format2(var AText: string); + + function FormatWithLiteralCharacters: string; + var + I: Integer; + begin + Result := ''; + for I := 1 to Length(AText) do + begin + if I > Count then + Break; + if Items[I - 1] is TcxStandardMaskLiteralItem then + Result := Result + AText[I] + else if Items[I - 1] is TcxStandardMaskManyItem then + begin + if AText[I] = FBlank then + Result := Result + ' ' + else + Result := Result + AText[I]; + end; + end; + end; + + function FormatWithoutLiteralCharacters: string; + var + I: Integer; + begin + Result := ''; + for I := 1 to Length(AText) do + begin + if I > Count then + Break; + if Items[I - 1] is TcxStandardMaskManyItem then + if AText[I] = FBlank then + Result := Result + ' ' + else + Result := Result + AText[I]; + end; + end; + +begin + if SaveLiteralCharacters then + AText := FormatWithLiteralCharacters + else + AText := FormatWithoutLiteralCharacters; +end; + +function TcxStandardMask.IsFullValid(var AText: string): Boolean; +var + AIsCharValid: Boolean; + I: Integer; +begin + if Length(AText) = Count then + begin + Result := True; + for I := 1 to Length(AText) do + begin + AIsCharValid := Items[I - 1].Check(AText[I]); + if not AIsCharValid then + begin + if ((AText[I] = FBlank) or (AText[I] = ' ')) and (Items[I - 1] is TcxStandardMaskManyItem) and + (TcxStandardMaskManyItem(Items[I - 1]).Optional) then + Continue + else + begin + Result := False; + Break; + end; + end; + end; + end + else + Result := False; +end; + +function TcxStandardMask.IsValid(var AText: string): Boolean; +var + AIsCharValid: Boolean; + I: Integer; +begin + if Length(AText) <= Count then + begin + Result := True; + for I := 1 to Length(AText) do + begin + AIsCharValid := Items[I - 1].Check(AText[I]); + if not AIsCharValid then + begin + if ((AText[I] = FBlank) or (AText[I] = ' ')) and (Items[I - 1] is TcxStandardMaskManyItem) then + Continue + else + begin + Result := False; + Break; + end; + end; + end; + end + else + Result := False; +end; + +procedure TcxStandardMask.Clear; +var + I: Integer; +begin + FMask := ''; + FLeading := False; + FSaveLiteralCharacters := True; + FBlank := cxDefaultBlank; + for I := 0 to FItems.Count - 1 do + TcxStandardMaskCustomItem(FItems[I]).Free; + FItems.Clear; +end; + +procedure TcxStandardMask.DoCompileBody(const AMask: string); +var + I: Integer; + ACaseControl: TcxCaseControl; +begin + I := 1; + ACaseControl := ccUserCase; + while I <= Length(AMask) do + begin + case AMask[I] of + 'L': + begin + FItems.Add(TcxStandardMaskAlphaItem.Create(False, ACaseControl)); + Inc(I); + end; + 'l': + begin + FItems.Add(TcxStandardMaskAlphaItem.Create(True, ACaseControl)); + Inc(I); + end; + 'A': + begin + FItems.Add(TcxStandardMaskAlphaNumericItem.Create(False, ACaseControl)); + Inc(I); + end; + 'a': + begin + FItems.Add(TcxStandardMaskAlphaNumericItem.Create(True, ACaseControl)); + Inc(I); + end; + 'C': + begin + FItems.Add(TcxStandardMaskASCIIItem.Create(False, ACaseControl)); + Inc(I); + end; + 'c': + begin + FItems.Add(TcxStandardMaskASCIIItem.Create(True, ACaseControl)); + Inc(I); + end; + '0': + begin + FItems.Add(TcxStandardMaskNumericItem.Create(False, ACaseControl)); + Inc(I); + end; + '9': + begin + FItems.Add(TcxStandardMaskNumericItem.Create(True, ACaseControl)); + Inc(I); + end; + '#': + begin + FItems.Add(TcxStandardMaskNumericSymbolItem.Create(True, ACaseControl)); + Inc(I); + end; + ':': + begin + FItems.Add(TcxStandardMaskLiteralItem.Create(TimeSeparator)); + Inc(I); + end; + '/': + begin + FItems.Add(TcxStandardMaskLiteralItem.Create(DateSeparator)); + Inc(I); + end; + '\': + begin + Inc(I); + if I <= Length(AMask) then + begin + FItems.Add(TcxStandardMaskLiteralItem.Create(AMask[I])); + Inc(I); + end; + end; + '<': + begin + ACaseControl := ccLowerCase; + Inc(I); + if I <= Length(AMask) then + if AMask[I] = '>' then + begin + ACaseControl := ccUserCase; + Inc(I); + end; + end; + '>': + begin + ACaseControl := ccUpperCase; + Inc(I); + end; + ';': + begin + if Length(AMask) - I = 3 then + begin + if AMask[I + 2] = ';' then + begin + if (AMask[I + 1] = '0') or (AMask[I + 1] = '1') then + begin + FSaveLiteralCharacters := AMask[I + 1] <> '0'; + FBlank := AMask[I + 3]; + Inc(I, 4); + end + else + begin + FItems.Add(TcxStandardMaskLiteralItem.Create(AMask[I])); + Inc(I); + end; + end + else + begin + FItems.Add(TcxStandardMaskLiteralItem.Create(AMask[I])); + Inc(I); + end; + end + else if Length(AMask) - I = 1 then + begin + if (AMask[I + 1] = '0') or (AMask[I + 1] = '1') then + begin + FSaveLiteralCharacters := AMask[I + 1] <> '0'; + Inc(I, 2); + end + else + begin + FItems.Add(TcxStandardMaskLiteralItem.Create(AMask[I])); + Inc(I); + end; + end + else + begin + FItems.Add(TcxStandardMaskLiteralItem.Create(AMask[I])); + Inc(I); + end; + end; + else + begin + FItems.Add(TcxStandardMaskLiteralItem.Create(AMask[I])); + Inc(I); + end; + end; + end; +end; + +procedure TcxStandardMask.DoCompileHead(var AMask: string); +begin + if AMask <> '' then + begin + if AMask[1] = '!' then + begin + FLeading := True; + Delete(AMask, 1, 1); + end + else + FLeading := False; + end; +end; + +function TcxStandardMask.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxStandardMask.GetEmptyString: string; +var + I: Integer; +begin + Result := ''; + for I := 0 to Count - 1 do + begin + if Items[I] is TcxStandardMaskLiteralItem then + begin + if FSaveLiteralCharacters then + Result := Result + TcxStandardMaskLiteralItem(Items[I]).Literal + end + else + Result := Result + ' '; + end; +end; + +function TcxStandardMask.GetFullEmptyString: string; +var + I: Integer; +begin + Result := ''; + for I := 0 to Count - 1 do + begin + if Items[I] is TcxStandardMaskLiteralItem then + Result := Result + TcxStandardMaskLiteralItem(Items[I]).Literal + else if Items[I] is TcxStandardMaskManyItem then + Result := Result + FBlank + end; +end; + +function TcxStandardMask.GetItems(AIndex: Integer): TcxStandardMaskCustomItem; +begin + Result := TcxStandardMaskCustomItem(FItems[AIndex]); +end; + +end. + diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxTextEdit.pas b/official/x.35/ExpressEditors Library 5/Sources/cxTextEdit.pas new file mode 100644 index 00000000..d74c96d5 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxTextEdit.pas @@ -0,0 +1,5704 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxTextEdit; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Classes, Clipbrd, Controls, Forms, Graphics, Menus, StdCtrls, SysUtils, cxClasses, + cxContainer, cxControls, cxDataUtils, cxEdit, cxDrawTextUtils, cxFormats, + cxGraphics, cxVariants, cxFilterControlUtils; + +const + cxEditDefaultDropDownPageRowCount = 8; + ekValueOutOfBounds = 1; + +type + TcxEditEchoMode = (eemNormal, eemPassword); + TcxEditScrollCause = (escKeyboard, escMouseWheel); + TcxEditValueBound = (evbMin, evbMax); + TcxTextEditViewStyle = (vsNormal, vsHideCursor, vsButtonsOnly, vsButtonsAutoWidth); + TcxTextEditCustomDrawHandler = procedure(ACanvas: TcxCanvas; ARect: TRect) of object; + + TcxCustomTextEdit = class; + + IcxInnerTextEdit = interface(IcxCustomInnerEdit) + ['{263EBB8D-1EA9-4CAC-8367-ADD74D2A9651}'] + procedure ClearSelection; + procedure CopyToClipboard; + function GetAlignment: TAlignment; + function GetAutoSelect: Boolean; + function GetCharCase: TEditCharCase; + function GetEchoMode: TcxEditEchoMode; + function GetHideSelection: Boolean; + function GetImeLastChar: Char; + function GetImeMode: TImeMode; + function GetImeName: TImeName; + function GetInternalUpdating: Boolean; + function GetMaxLength: Integer; + function GetMultiLine: Boolean; + function GetOEMConvert: Boolean; + function GetOnSelChange: TNotifyEvent; + function GetPasswordChar: TCaptionChar; + function GetSelLength: Integer; + function GetSelStart: Integer; + function GetSelText: string; + procedure SelectAll; + procedure SetAlignment(Value: TAlignment); + procedure SetAutoSelect(Value: Boolean); + procedure SetCharCase(Value: TEditCharCase); + procedure SetEchoMode(Value: TcxEditEchoMode); + procedure SetHideSelection(Value: Boolean); + procedure SetInternalUpdating(Value: Boolean); + procedure SetImeMode(Value: TImeMode); + procedure SetImeName(const Value: TImeName); + procedure SetMaxLength(Value: Integer); + procedure SetOEMConvert(Value: Boolean); + procedure SetOnSelChange(Value: TNotifyEvent); + procedure SetPasswordChar(Value: TCaptionChar); + procedure SetSelLength(Value: Integer); + procedure SetSelStart(Value: Integer); + procedure SetSelText(Value: string); + property Alignment: TAlignment read GetAlignment write SetAlignment; + property AutoSelect: Boolean read GetAutoSelect write SetAutoSelect; + property CharCase: TEditCharCase read GetCharCase write SetCharCase; + property EchoMode: TcxEditEchoMode read GetEchoMode write SetEchoMode; + property HideSelection: Boolean read GetHideSelection write SetHideSelection; + property ImeLastChar: Char read GetImeLastChar; + property ImeMode: TImeMode read GetImeMode write SetImeMode; + property ImeName: TImeName read GetImeName write SetImeName; + property InternalUpdating: Boolean read GetInternalUpdating write SetInternalUpdating; + property MaxLength: Integer read GetMaxLength write SetMaxLength; + property MultiLine: Boolean read GetMultiLine; + property OEMConvert: Boolean read GetOEMConvert write SetOEMConvert; + property PasswordChar: TCaptionChar read GetPasswordChar write SetPasswordChar; + property SelLength: Integer read GetSelLength write SetSelLength; + property SelStart: Integer read GetSelStart write SetSelStart; + property SelText: string read GetSelText write SetSelText; + property OnSelChange: TNotifyEvent read GetOnSelChange write SetOnSelChange; + end; + + { TcxCustomInnerTextEditHelper } + + TcxCustomInnerTextEdit = class; + + TcxCustomInnerTextEditHelper = class(TcxInterfacedPersistent, + IcxContainerInnerControl, IcxCustomInnerEdit, IcxInnerTextEdit) + private + FAlignmentLock: Boolean; + FEdit: TcxCustomInnerTextEdit; + FSelLength: Integer; + FSelStart: Integer; + function GetUseLeftAlignmentOnEditing: Boolean; + protected + property Edit: TcxCustomInnerTextEdit read FEdit; + property UseLeftAlignmentOnEditing: Boolean read GetUseLeftAlignmentOnEditing; + public + constructor Create(AEdit: TcxCustomInnerTextEdit); reintroduce; virtual; + + // IcxContainerInnerControl + function GetControlContainer: TcxContainer; + function GetControl: TWinControl; + + // IcxCustomInnerEdit + function CallDefWndProc(AMsg: UINT; WParam: WPARAM; + LParam: LPARAM): LRESULT; + function GetEditValue: TcxEditValue; + function GetOnChange: TNotifyEvent; + procedure LockBounds(ALock: Boolean); + procedure SafelySetFocus; + procedure SetEditValue(const Value: TcxEditValue); + procedure SetParent(Value: TWinControl); + procedure SetOnChange(Value: TNotifyEvent); + + // IcxInnerTextEdit + procedure ClearSelection; + procedure CopyToClipboard; + function GetAlignment: TAlignment; + function GetAutoSelect: Boolean; + function GetCharCase: TEditCharCase; + function GetEchoMode: TcxEditEchoMode; + function GetHideSelection: Boolean; + function GetImeLastChar: Char; + function GetImeMode: TImeMode; + function GetImeName: TImeName; + function GetInternalUpdating: Boolean; + function GetMaxLength: Integer; + function GetMultiLine: Boolean; + function GetOEMConvert: Boolean; + function GetOnSelChange: TNotifyEvent; + function GetPasswordChar: TCaptionChar; + function GetReadOnly: Boolean; + function GetSelLength: Integer; + function GetSelStart: Integer; + function GetSelText: string; + procedure SelectAll; + procedure SetAlignment(Value: TAlignment); + procedure SetAutoSelect(Value: Boolean); + procedure SetCharCase(Value: TEditCharCase); + procedure SetEchoMode(Value: TcxEditEchoMode); + procedure SetHideSelection(Value: Boolean); + procedure SetInternalUpdating(Value: Boolean); + procedure SetImeMode(Value: TImeMode); + procedure SetImeName(const Value: TImeName); + procedure SetMaxLength(Value: Integer); + procedure SetOEMConvert(Value: Boolean); + procedure SetOnSelChange(Value: TNotifyEvent); + procedure SetPasswordChar(Value: TCaptionChar); + procedure SetReadOnly(Value: Boolean); + procedure SetSelLength(Value: Integer); + procedure SetSelStart(Value: Integer); + procedure SetSelText(Value: string); + end; + + { TcxCustomInnerTextEdit } + + TcxCustomInnerTextEditPrevState = record + IsPrevTextSaved: Boolean; + PrevText: string; + PrevSelLength, PrevSelStart: Integer; + end; + + TcxCustomInnerTextEdit = class(TCustomEdit, IUnknown, + IcxContainerInnerControl, IcxInnerEditHelper) + private + FAlignment: TAlignment; + FEchoMode: TcxEditEchoMode; + FDblClickLock: Boolean; + FDblClickTimer: TcxTimer; + FHelper: TcxCustomInnerTextEditHelper; + FImeCharCount: Integer; + FImeLastChar: Char; + FInternalUpdating: Boolean; + FIsCreating: Boolean; + FLockBoundsCount: Integer; + FPasswordChar: TCaptionChar; + FRepaintOnGlass: Boolean; + FOnSelChange: TNotifyEvent; + procedure DblClickTimerHandle(Sender: TObject); + function GetContainer: TcxCustomTextEdit; + function GetCursorPos: Integer; + procedure InitializeDblClickTimer; + function NeadAdjustAlignment: Boolean; + procedure UpdateEchoMode; + procedure WMChar(var Message: TWMChar); message WM_CHAR; + procedure WMClear(var Message: TMessage); message WM_CLEAR; + procedure WMCut(var Message: TMessage); message WM_CUT; + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND; + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + procedure WMIMEChar(var Message: TMessage); message WM_IME_CHAR; + procedure WMIMEComposition(var Message: TMessage); message WM_IME_COMPOSITION; + procedure WMKeyDown(var Message: TWMKeyDown); message WM_KEYDOWN; + procedure WMKillFocus(var Message: TWMKillFocus); message WM_KILLFOCUS; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure WMPaste(var Message: TMessage); message WM_PASTE; + procedure WMSetFocus(var Message: TWMSetFocus); message WM_SETFOCUS; + procedure WMSize(var Message: TWMSize); message WM_SIZE; + procedure WMUndo(var Message: TWMSize); message WM_UNDO; + procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure EMSetSel(var Message: TMessage); message EM_SETSEL; + protected + procedure AdjustAlignment; virtual; + procedure Change; override; // for Delphi .NET + procedure Click; override; + procedure CreateHandle; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWindowHandle(const Params: TCreateParams); override; + procedure CreateWnd; override; + procedure DblClick; override; + function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); override; + function GetBasedAlignment: TAlignment; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure WndProc(var Message: TMessage); override; + procedure AdjustMargins; virtual; + procedure MouseEnter(AControl: TControl); dynamic; + procedure MouseLeave(AControl: TControl); dynamic; + procedure RecreateWnd; // for Delphi .NET + + // IcxContainerInnerControl + function GetControl: TWinControl; + function GetControlContainer: TcxContainer; + + // IcxInnerEditHelper + function GetHelper: IcxCustomInnerEdit; + + property Alignment: TAlignment read FAlignment; + property Container: TcxCustomTextEdit read GetContainer; + property CursorPos: Integer read GetCursorPos; + property Helper: TcxCustomInnerTextEditHelper read FHelper; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure DragDrop(Source: TObject; X, Y: Integer); override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + function UpdateAction(Action: TBasicAction): Boolean; override; +{$IFDEF DELPHI5} + function CanFocus: Boolean; override; +{$ENDIF} + procedure DefaultHandler(var Message); override; + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; + property AutoSelect; + property CharCase; + property HideSelection; + property ImeMode; + property ImeName; + property MaxLength; + property OEMConvert; + property ReadOnly; + property OnChange; + property OnSelChange: TNotifyEvent read FOnSelChange write FOnSelChange; + end; + + { TcxTextEditPropertiesValues } + + TcxTextEditPropertiesValues = class(TcxCustomEditPropertiesValues) + private + FDisplayFormat: Boolean; + FEditFormat: Boolean; + FMaxLength: Boolean; + function IsDisplayFormatStored: Boolean; + function IsEditFormatStored: Boolean; + procedure SetDisplayFormat(Value: Boolean); + procedure SetEditFormat(Value: Boolean); + procedure SetMaxLength(Value: Boolean); + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property DisplayFormat: Boolean read FDisplayFormat write SetDisplayFormat + stored IsDisplayFormatStored; + property EditFormat: Boolean read FEditFormat write SetEditFormat + stored IsEditFormatStored; + property MaxLength: Boolean read FMaxLength write SetMaxLength stored False; + property MaxValue; + property MinValue; + end; + + { TcxCustomEditListBox } + + TcxCustomEditListBox = class(TcxCustomInnerListBox) + private + FHotTrack: Boolean; + FOnSelectItem: TNotifyEvent; + function GetEdit: TcxCustomTextEdit; + {$IFNDEF DELPHI6} + function GetItemIndex: Integer; + {$ENDIF} + procedure CMShowingChanged(var Message: TMessage); message CM_SHOWINGCHANGED; + protected + procedure Click; override; + function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; override; + procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); override; + function GetItemData(Index: Integer): Longint; override; + function NeedDrawFocusRect: Boolean; override; + procedure MeasureItem(Index: Integer; var Height: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure SetItemData(Index: Integer; + AData: Longint); override; + function DoDrawItem(AIndex: Integer; const ARect: TRect; + AState: TOwnerDrawState): Boolean; virtual; + procedure DoSelectItem; + function GetDefaultItemHeight: Integer; + function GetItem(Index: Integer): string; virtual; + procedure InternalRecreateWindow; + procedure RecreateWindow; virtual; + procedure SetItemCount(Value: Integer); + procedure SetItemIndex(const Value: Integer); {$IFDEF DELPHI6}override;{$ELSE}virtual;{$ENDIF} + property Edit: TcxCustomTextEdit read GetEdit; + property HotTrack: Boolean read FHotTrack write FHotTrack; +{$IFNDEF DELPHI6} + property ItemIndex: Integer read GetItemIndex write SetItemIndex; +{$ENDIF} + property OnSelectItem: TNotifyEvent read FOnSelectItem write FOnSelectItem; + public + constructor Create(AOwner: TComponent); override; + function GetHeight(ARowCount: Integer; AMaxHeight: Integer): Integer; virtual; + function GetItemHeight(AIndex: Integer = -1): Integer; virtual; + function GetItemWidth(AIndex: Integer): Integer; virtual; + function IsVisible: Boolean; + procedure SetScrollWidth(Value: Integer); + end; + + TcxCustomEditListBoxClass = class of TcxCustomEditListBox; + + { IcxTextEditLookupData } + + TcxEditLookupDataGoDirection = (egdBegin, egdEnd, egdNext, egdPrev, egdPageUp, egdPageDown); + + IcxTextEditLookupData = interface + ['{F49C5F08-7758-4362-A360-1DF02354E708}'] + function CanResizeVisualArea(var NewSize: TSize; + AMaxHeight: Integer = 0; AMaxWidth: Integer = 0): Boolean; + procedure CloseUp; + procedure Deinitialize; + procedure DropDown; + procedure DroppedDown(const AFindStr: string); + function Find(const AText: string): Boolean; + function GetActiveControl: TControl; + function GetCurrentKey: TcxEditValue; + function GetDisplayText(const AKey: TcxEditValue): string; overload; + function GetOnCurrentKeyChanged: TNotifyEvent; + function GetOnSelectItem: TNotifyEvent; + function GetVisualAreaPreferredSize(AMaxHeight: Integer; AWidth: Integer = 0): TSize; + procedure Go(ADirection: TcxEditLookupDataGoDirection; ACircular: Boolean); + procedure Initialize(AVisualControlsParent: TWinControl); + function IsEmpty: Boolean; + function IsMouseOverList(const P: TPoint): Boolean; + function Locate(var AText, ATail: string; ANext: Boolean): Boolean; + procedure PositionVisualArea(const AClientRect: TRect); + procedure PropertiesChanged; + procedure SelectItem; + procedure SetCurrentKey(const AKey: TcxEditValue); + procedure SetOnCurrentKeyChanged(Value: TNotifyEvent); + procedure SetOnSelectItem(Value: TNotifyEvent); + procedure TextChanged; + property ActiveControl: TControl read GetActiveControl; + property CurrentKey: TcxEditValue read GetCurrentKey write SetCurrentKey; + property OnCurrentKeyChanged: TNotifyEvent read GetOnCurrentKeyChanged write SetOnCurrentKeyChanged; + property OnSelectItem: TNotifyEvent read GetOnSelectItem write SetOnSelectItem; + end; + + { TcxCustomTextEditLookupData } + + TcxCustomTextEditProperties = class; + + TcxCustomTextEditLookupData = class(TcxInterfacedPersistent, IcxTextEditLookupData) + private + FCurrentKey: Integer; + FItemIndex: Integer; + FList: TcxCustomEditListBox; + FOwner: TPersistent; + FOnCurrentKeyChanged: TNotifyEvent; + FOnSelectItem: TNotifyEvent; + function GetEdit: TcxCustomTextEdit; + function GetItems: TStrings; + function GetActiveProperties: TcxCustomTextEditProperties; + function IndexOf(const AText: string): Integer; + procedure SetItemIndex(Value: Integer); + procedure SetItems(Value: TStrings); + protected + function GetOwner: TPersistent; override; + procedure DoCurrentKeyChanged; + procedure DoSelectItem; + function GetItem(Index: Integer): string; virtual; + function GetItemCount: Integer; virtual; + function GetListBoxClass: TcxCustomEditListBoxClass; virtual; + procedure HandleSelectItem(Sender: TObject); virtual; // TODO test for CLX + function InternalLocate(var AText, ATail: string; ANext, ASynchronizeWithText: Boolean): + Boolean; virtual; + procedure InternalSetItemIndex(Value: Integer); + procedure ListChanged; virtual; + procedure SetListItemIndex(Value: Integer); + property Edit: TcxCustomTextEdit read GetEdit; + property ItemIndex: Integer read FItemIndex write SetItemIndex stored False; + property Items: TStrings read GetItems write SetItems; + property List: TcxCustomEditListBox read FList; + property ActiveProperties: TcxCustomTextEditProperties read GetActiveProperties; + public + constructor Create(AOwner: TPersistent); override; + function CanResizeVisualArea(var NewSize: TSize; + AMaxHeight: Integer = 0; AMaxWidth: Integer = 0): Boolean; virtual; + procedure CloseUp; + procedure Deinitialize; + procedure DropDown; virtual; + procedure DroppedDown(const AFindStr: string); virtual; + function Find(const AText: string): Boolean; virtual; + function GetActiveControl: TControl; + function GetCurrentKey: TcxEditValue; + function GetDisplayText(const AKey: TcxEditValue): string; overload; + function GetOnCurrentKeyChanged: TNotifyEvent; + function GetOnSelectItem: TNotifyEvent; + function GetVisualAreaPreferredSize(AMaxHeight: Integer; AWidth: Integer = 0): TSize; virtual; + procedure Go(ADirection: TcxEditLookupDataGoDirection; ACircular: Boolean); + procedure Initialize(AVisualControlsParent: TWinControl); virtual; + procedure InternalSetCurrentKey(Value: Integer); + function IsEmpty: Boolean; + function IsMouseOverList(const P: TPoint): Boolean; + function Locate(var AText, ATail: string; ANext: Boolean): Boolean; + procedure PositionVisualArea(const AClientRect: TRect); virtual; + procedure PropertiesChanged; virtual; + procedure SelectItem; + procedure SetCurrentKey(const AKey: TcxEditValue); + procedure SetOnCurrentKeyChanged(Value: TNotifyEvent); + procedure SetOnSelectItem(Value: TNotifyEvent); + procedure TextChanged; virtual; + property ActiveControl: TControl read GetActiveControl; + property CurrentKey: TcxEditValue read GetCurrentKey write SetCurrentKey; + property OnCurrentKeyChanged: TNotifyEvent read GetOnCurrentKeyChanged write SetOnCurrentKeyChanged; + property OnSelectItem: TNotifyEvent read GetOnSelectItem write SetOnSelectItem; + end; + + { TcxCustomTextEditViewData } + + TcxCustomTextEditViewData = class(TcxCustomEditViewData) + private + FIsValueEditorWithValueFormatting: Boolean; + function GetProperties: TcxCustomTextEditProperties; + function InvertColor(AColor: TColor): TColor; + protected + procedure CalculateButtonNativeInfo(AButtonViewInfo: TcxEditButtonViewInfo); override; + function GetIsEditClass: Boolean; virtual; + function GetMaxLineCount: Integer; virtual; + procedure InitCacheData; override; + function InternalEditValueToDisplayText(AEditValue: TcxEditValue): string; override; + function InternalGetEditContentSize(ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + const AEditSizeProperties: TcxEditSizeProperties): TSize; override; + function IsComboBoxStyle: Boolean; virtual; + procedure PrepareDrawTextFlags(ACanvas: TcxCanvas; + AViewInfo: TcxCustomEditViewInfo); virtual; + public + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); override; + procedure DisplayValueToDrawValue(const ADisplayValue: TcxEditValue; + AViewInfo: TcxCustomEditViewInfo); virtual; + procedure EditValueToDrawValue(ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + AViewInfo: TcxCustomEditViewInfo); override; + function GetClientExtent(ACanvas: TcxCanvas; + AViewInfo: TcxCustomEditViewInfo): TRect; override; + function GetDrawTextFlags: DWORD; virtual; + function GetDrawTextOffset: TRect; virtual; + procedure PrepareSelection(AViewInfo: TcxCustomEditViewInfo); + property Properties: TcxCustomTextEditProperties read GetProperties; + end; + + { TcxCustomTextEditViewInfo } + + TcxTextOutData = record + ForceEndEllipsis: Boolean; + Initialized: Boolean; + RowCount: Integer; + SelStart, SelLength: Integer; + SelBackgroundColor, SelTextColor: TColor; + TextParams: TcxTextParams; + TextRect: TRect; + TextRows: TcxTextRows; + end; + + TcxCustomTextEditViewInfo = class(TcxCustomEditViewInfo) + protected + procedure InternalPaint(ACanvas: TcxCanvas); override; + public + ComboBoxStyle: Boolean; + CustomDrawHandler: TcxTextEditCustomDrawHandler; + DrawSelectionBar: Boolean; + DrawTextFlags: DWORD; + EditingStyle: TcxEditEditingStyle; + HasPopupWindow: Boolean; + IsEditClass: Boolean; + IsOwnerDrawing: Boolean; + MaxLineCount: Integer; + SelStart, SelLength: Integer; + SelTextColor, SelBackgroundColor: TColor; + Text: string; + TextOutData: TcxTextOutData; + TextRect: TRect; + destructor Destroy; override; + function NeedShowHint(ACanvas: TcxCanvas; const P: TPoint; + const AVisibleBounds: TRect; out AText: TCaption; + out AIsMultiLine: Boolean; out ATextRect: TRect): Boolean; override; + procedure Offset(DX, DY: Integer); override; + procedure DrawText(ACanvas: TcxCanvas); virtual; + {$IFDEF DELPHI10} + function GetTextBaseLine: Integer; virtual; + {$ENDIF} + end; + +{ TcxCustomTextEditProperties } + + TcxNewLookupDisplayTextEvent = procedure(Sender: TObject; const AText: TCaption) of object; + TcxTextEditChars = set of AnsiChar; + + TcxCustomTextEditProperties = class(TcxCustomEditProperties, IcxFormatControllerListener) + private + FCharCase: TEditCharCase; + FDisplayFormat: string; + FEchoMode: TcxEditEchoMode; + FEditFormat: string; + FFixedListSelection: Boolean; + FFormatChanging: Boolean; + FHideCursor: Boolean; + FHideSelection: Boolean; + FImeMode: TImeMode; + FImeName: TImeName; + FImmediateUpdateText: Boolean; + FIncrementalSearch: Boolean; + FLookupItems: TStringList; + FMaxLength: Integer; + FMRUMode: Boolean; + FOEMConvert: Boolean; + FPasswordChar: TCaptionChar; + FUseDisplayFormatWhenEditing: Boolean; + FValidChars: TcxTextEditChars; + FOnNewLookupDisplayText: TcxNewLookupDisplayTextEvent; + function GetAssignedValues: TcxTextEditPropertiesValues; + function GetDisplayFormat: string; + function GetEditFormat: string; + function GetInnerEditMaxLength: Integer; + function GetLookupItems: TStrings; + function GetLookupItemsSorted: Boolean; + function GetMaxLength: Integer; + function GetViewStyle: TcxTextEditViewStyle; + function IsDisplayFormatStored: Boolean; + function IsEditFormatStored: Boolean; + function IsMaxLengthStored: Boolean; + procedure LookupItemsChanged(Sender: TObject); + procedure ReadIsDisplayFormatAssigned(Reader: TReader); // obsolete + procedure SetAssignedValues(Value: TcxTextEditPropertiesValues); + procedure SetDisplayFormat(const Value: string); + procedure SetEchoMode(Value: TcxEditEchoMode); + procedure SetEditFormat(const Value: string); + procedure SetFixedListSelection(Value: Boolean); + procedure SetHideCursor(Value: Boolean); + procedure SetHideSelection(Value: Boolean); + procedure SetImeMode(Value: TImeMode); + procedure SetImeName(const Value: TImeName); + procedure SetIncrementalSearch(Value: Boolean); + procedure SetLookupItems(Value: TStrings); + procedure SetLookupItemsSorted(Value: Boolean); + procedure SetMaxLength(Value: Integer); + procedure SetMRUMode(Value: Boolean); + procedure SetOEMConvert(Value: Boolean); + procedure SetPasswordChar(Value: TCaptionChar); + procedure SetUseDisplayFormatWhenEditing(Value: Boolean); + procedure SetViewStyle(Value: TcxTextEditViewStyle); + protected + procedure AlignmentChangedHandler(Sender: TObject); override; + procedure BaseSetAlignment(Value: TcxEditAlignment); override; + function CanValidate: Boolean; override; + procedure DefineProperties(Filer: TFiler); override; // obsolete + class function GetAssignedValuesClass: TcxCustomEditPropertiesValuesClass; override; + function GetDisplayFormatOptions: TcxEditDisplayFormatOptions; override; + function GetValidateErrorText(AErrorKind: TcxEditErrorKind): string; override; + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + function HasDisplayValue: Boolean; override; + + // IcxFormatControllerListener + procedure FormatChanged; virtual; + + function CanIncrementalSearch: Boolean; + procedure CheckEditorValueBounds(var DisplayValue: TcxEditValue; + var ErrorText: TCaption; var Error: Boolean; AEdit: TcxCustomEdit); virtual; + function DefaultFocusedDisplayValue: TcxEditValue; virtual; + function FindLookupText(const AText: string): Boolean; virtual; + function GetDefaultDisplayFormat: string; virtual; + function GetDefaultDisplayValue(const AEditValue: TcxEditValue; AEditFocused: Boolean): TcxEditValue; + function GetDefaultMaxLength: Integer; virtual; + function GetDropDownPageRowCount: Integer; virtual; + function GetEditingStyle: TcxEditEditingStyle; virtual; + class function GetLookupDataClass: TcxInterfacedPersistentClass; virtual; + function HasDigitGrouping(AIsDisplayValueSynchronizing: Boolean): Boolean; virtual; + function InternalGetEditFormat(out AIsCurrency, AIsOnGetTextAssigned: Boolean; + AEdit: TcxCustomTextEdit = nil): string; virtual; + function IsEditValueNumeric: Boolean; virtual; + function IsLookupDataVisual: Boolean; virtual; + function IsMultiLine: Boolean; virtual; + function IsPopupKey(Key: Word; Shift: TShiftState): Boolean; virtual; + function IsValueBoundDefined(ABound: TcxEditValueBound): Boolean; virtual; + function IsValueBoundsDefined: Boolean; virtual; + procedure LookupDataChanged(Sender: TObject); virtual; + procedure MaxLengthChanged; virtual; + procedure SetCharCase(Value: TEditCharCase); virtual; + function UseLookupData: Boolean; virtual; + property AssignedValues: TcxTextEditPropertiesValues read GetAssignedValues + write SetAssignedValues; + property EditingStyle: TcxEditEditingStyle read GetEditingStyle; + property FixedListSelection: Boolean read FFixedListSelection + write SetFixedListSelection default True; + property FormatChanging: Boolean read FFormatChanging; + property HideCursor: Boolean read FHideCursor write SetHideCursor + stored False; + property MRUMode: Boolean read FMRUMode write SetMRUMode default False; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function CanCompareEditValue: Boolean; override; + function CompareDisplayValues( + const AEditValue1, AEditValue2: TcxEditValue): Boolean; override; + class function GetContainerClass: TcxContainerClass; override; + function GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; override; + function GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; override; + function GetSupportedOperations: TcxEditSupportedOperations; override; + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + function IsEditValueValid(var EditValue: TcxEditValue; AEditFocused: Boolean): Boolean; override; + function IsResetEditClass: Boolean; override; + procedure PrepareDisplayValue(const AEditValue: TcxEditValue; + var DisplayValue: TcxEditValue; AEditFocused: Boolean); override; + procedure ValidateDisplayValue(var DisplayValue: TcxEditValue; var ErrorText: TCaption; + var Error: Boolean; AEdit: TcxCustomEdit); override; + procedure DisplayValueToDisplayText(var ADisplayValue: string); virtual; + function IsDisplayValueValid(var DisplayValue: TcxEditValue; AEditFocused: Boolean): Boolean; virtual; + procedure SetMinMaxValues(AMinValue, AMaxValue: Double); + property ValidChars: TcxTextEditChars read FValidChars write FValidChars; + // !!! + property CharCase: TEditCharCase read FCharCase write SetCharCase default ecNormal; + property DisplayFormat: string read GetDisplayFormat write SetDisplayFormat + stored IsDisplayFormatStored; + property EchoMode: TcxEditEchoMode read FEchoMode write SetEchoMode default eemNormal; + property EditFormat: string read GetEditFormat write SetEditFormat + stored IsEditFormatStored; + property HideSelection: Boolean read FHideSelection write SetHideSelection default True; + property ImeMode: TImeMode read FImeMode write SetImeMode default imDontCare; + property ImeName: TImeName read FImeName write SetImeName; + property ImmediateUpdateText: Boolean read FImmediateUpdateText write FImmediateUpdateText default False; + property IncrementalSearch: Boolean read FIncrementalSearch + write SetIncrementalSearch default True; + property LookupItems: TStrings read GetLookupItems write SetLookupItems; + property LookupItemsSorted: Boolean read GetLookupItemsSorted write + SetLookupItemsSorted default False; + property MaxLength: Integer read GetMaxLength write SetMaxLength stored IsMaxLengthStored; + property MaxValue; + property MinValue; + property OEMConvert: Boolean read FOEMConvert write SetOEMConvert default False; + property PasswordChar: TCaptionChar read FPasswordChar write SetPasswordChar + default #0; + property UseDisplayFormatWhenEditing: Boolean + read FUseDisplayFormatWhenEditing write SetUseDisplayFormatWhenEditing + default False; + property ViewStyle: TcxTextEditViewStyle read GetViewStyle write SetViewStyle default vsNormal; + property OnNewLookupDisplayText: TcxNewLookupDisplayTextEvent read + FOnNewLookupDisplayText write FOnNewLookupDisplayText; + end; + + { TcxTextEditProperties } + + TcxTextEditProperties = class(TcxCustomTextEditProperties) + published + property Alignment; + property AssignedValues; + property AutoSelect; + property BeepOnError; + property CharCase; + property ClearKey; + property EchoMode; + property HideSelection; + property ImeMode; + property ImeName; + property IncrementalSearch; + property LookupItems; + property LookupItemsSorted; + property MaxLength; + property OEMConvert; + property PasswordChar; + property ReadOnly; + property UseLeftAlignmentOnEditing; + property ValidateOnEnter; + property OnChange; + property OnEditValueChanged; + property OnNewLookupDisplayText; + property OnValidate; + end; + + { TcxCustomTextEdit } + + TcxCustomTextEdit = class(TcxCustomEdit, IcxFormatControllerListener) + private + FBeepOnEnter: Boolean; + FDisableRefresh: Boolean; + FFindSelection: Boolean; + FHideInnerEdit: Boolean; + FInternalTextSetting: Boolean; + FIsDisplayValueSynchronizing: Boolean; + FLookupItemsScrolling: Boolean; + FShowInnerEdit: Boolean; + FTesting: Boolean; + FText: TCaption; + function GetCursorPos: Integer; + function GetEditingText: TCaption; + function GetInnerTextEdit: IcxInnerTextEdit; + function GetILookupData: IcxTextEditLookupData; + function GetLookupData: TcxCustomTextEditLookupData; + function GetProperties: TcxCustomTextEditProperties; + function GetActiveProperties: TcxCustomTextEditProperties; + function GetSelLength: Integer; + function GetSelStart: Integer; + function GetSelText: TCaption; + function GetViewInfo: TcxCustomTextEditViewInfo; + procedure SetFindSelection(Value: Boolean); + procedure SetHideInnerEdit(Value: Boolean); + procedure SetItemObject(Value: TObject); + procedure SetProperties(Value: TcxCustomTextEditProperties); + procedure SetSelLength(Value: Integer); + procedure SetSelStart(Value: Integer); + procedure SetShowInnerEdit(Value: Boolean); + procedure SetTesting(Value: Boolean); + procedure WMClear(var Message: TMessage); message WM_CLEAR; + procedure WMGetText(var Message: TWMGetText); message WM_GETTEXT; + procedure WMGetTextLength(var Message: TWMGetTextLength); message WM_GETTEXTLENGTH; + procedure WMSetText(var Message: TWMSetText); message WM_SETTEXT; + protected + FInnerEditPositionAdjusting: Boolean; + FIsPopupWindowJustClosed: Boolean; + FLookupData: TcxInterfacedPersistent; + FLookupDataTextChangedLocked: Boolean; + procedure AdjustInnerEditPosition; override; + function CanKeyDownModifyEdit(Key: Word; Shift: TShiftState): Boolean; override; + function CanKeyPressModifyEdit(Key: Char): Boolean; override; + procedure ChangeHandler(Sender: TObject); override; + procedure DoEditKeyDown(var Key: Word; Shift: TShiftState); override; + procedure DoEditKeyPress(var Key: Char); override; + procedure DoExit; override; + function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; override; + procedure FillSizeProperties(var AEditSizeProperties: TcxEditSizeProperties); override; + function GetDisplayValue: string; override; + function GetInnerControlBounds(const AInnerControlsRegion: TRect; + AInnerControl: TControl): TcxContainerInnerControlBounds; override; + function GetInnerEditClass: TControlClass; override; + procedure Initialize; override; + function InternalDoEditing: Boolean; override; + function InternalGetEditingValue: TcxEditValue; override; + procedure InternalSetDisplayValue(const Value: TcxEditValue); override; + procedure InternalValidateDisplayValue(const ADisplayValue: TcxEditValue); override; + function IsValidChar(AChar: Char): Boolean; override; + procedure KeyPress(var Key: Char); override; + procedure Loaded; override; + procedure PropertiesChanged(Sender: TObject); override; + function RefreshContainer(const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AIsMouseEvent: Boolean): Boolean; override; + function SetDisplayText(const Value: string): Boolean; override; + procedure SetInternalDisplayValue(Value: TcxEditValue); override; + function WantNavigationKeys: Boolean; override; + procedure LockedInnerEditWindowProc(var Message: TMessage); override; + procedure UnlockInnerEditRepainting; override; + // IcxFormatControllerListener + procedure FormatChanged; virtual; + + procedure AdjustInnerEdit; virtual; + function CanChangeSelText(const Value: string; out ANewText: string; + out ANewSelStart: Integer): Boolean; virtual; + procedure CheckEditValue; virtual; + procedure CheckEditorValueBounds; virtual; + procedure DoOnNewLookupDisplayText(const AText: string); virtual; + function GetInnerEditHeight: Integer; virtual; + function GetItemIndex: Integer; virtual; + function GetItemObject: TObject; virtual; + function GetScrollLookupDataList(AScrollCause: TcxEditScrollCause): Boolean; virtual; + procedure HandleSelectItem(Sender: TObject); virtual; + function InternalGetText: string; virtual; + function InternalSetText(const Value: string): Boolean; virtual; + function ItemIndexToLookupKey(AItemIndex: Integer): TcxEditValue; virtual; + procedure LockLookupDataTextChanged; + function LookupKeyToEditValue(const AKey: TcxEditValue): TcxEditValue; virtual; + function LookupKeyToItemIndex(const AKey: TcxEditValue): Integer; virtual; + function NeedResetInvalidTextWhenPropertiesChanged: Boolean; virtual; + procedure ResetOnNewDisplayValue; virtual; + procedure SelChange(Sender: TObject); virtual; + procedure SetEditingText(const Value: TCaption); virtual; + procedure SetItemIndex(Value: Integer); virtual; + procedure SetSelText(const Value: TCaption); virtual; + procedure SynchronizeDisplayValue; override; + procedure SynchronizeEditValue; override; + procedure UndoPerformed; virtual; + procedure UnlockLookupDataTextChanged; + procedure UpdateDrawValue; override; + procedure UpdateDisplayValue; virtual; + property BeepOnEnter: Boolean read FBeepOnEnter write FBeepOnEnter default True; + property HideInnerEdit: Boolean read FHideInnerEdit write SetHideInnerEdit; // for test + property InnerTextEdit: IcxInnerTextEdit read GetInnerTextEdit; + property ItemIndex: Integer read GetItemIndex write SetItemIndex stored False; + property ItemObject: TObject read GetItemObject write SetItemObject; + property LookupData: TcxCustomTextEditLookupData read GetLookupData; + property LookupItemsScrolling: Boolean read FLookupItemsScrolling write FLookupItemsScrolling; + property ParentColor default False; + property ShowInnerEdit: Boolean read FShowInnerEdit write SetShowInnerEdit; // for test + property Testing: Boolean read FTesting write SetTesting; // for test + property ViewInfo: TcxCustomTextEditViewInfo read GetViewInfo; + public + {$IFDEF CBUILDER10} + constructor Create(AOwner: TComponent); override; + {$ENDIF} + destructor Destroy; override; + procedure Activate(var AEditData: TcxCustomEditData); override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + procedure CopyToClipboard; override; + procedure CutToClipboard; override; + function IsEditClass: Boolean; override; + procedure PasteFromClipboard; override; + procedure PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); override; + procedure SelectAll; override; + {$IFDEF DELPHI10} + function GetTextBaseLine: Integer; override; + function HasTextBaseLine: Boolean; override; + {$ENDIF} + procedure ClearSelection; virtual; + procedure SetSelection(ASelStart: Integer; ASelLength: Integer); + procedure Undo; virtual; + property ActiveProperties: TcxCustomTextEditProperties read GetActiveProperties; + property CursorPos: Integer read GetCursorPos; + property EditingText: TCaption read GetEditingText write SetEditingText; + property FindSelection: Boolean read FFindSelection write SetFindSelection; + property ILookupData: IcxTextEditLookupData read GetILookupData; + property Properties: TcxCustomTextEditProperties read GetProperties + write SetProperties; + property SelLength: Integer read GetSelLength write SetSelLength; + property SelStart: Integer read GetSelStart write SetSelStart; + property SelText: TCaption read GetSelText write SetSelText; + property Text; + end; + + { TcxTextEdit } + + TcxTextEdit = class(TcxCustomTextEdit) + private + function GetActiveProperties: TcxTextEditProperties; + function GetProperties: TcxTextEditProperties; + procedure SetProperties(Value: TcxTextEditProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxTextEditProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxTextEditProperties read GetProperties write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Text; + property Visible; + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + + { TcxFilterTextEditHelper } + + TcxFilterTextEditHelper = class(TcxCustomFilterEditHelper) + public + class function GetFilterEditClass: TcxCustomEditClass; override; + class procedure InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); override; + class procedure SetFilterValue(AEdit: TcxCustomEdit; AEditProperties: TcxCustomEditProperties; + AValue: Variant); override; + end; + +procedure CheckCharsRegister(var AText: string; ACharCase: TEditCharCase); +function CheckTextEditState(ATextEdit: IcxInnerTextEdit; const APrevState: + TcxCustomInnerTextEditPrevState): Boolean; +procedure DrawEditText(ACanvas: TcxCanvas; AViewInfo: TcxCustomTextEditViewInfo); +procedure DrawTextEdit(ACanvas: TcxCanvas; AViewInfo: TcxCustomTextEditViewInfo); +function GetTextEditContentSize(ACanvas: TcxCanvas; AViewData: TcxCustomEditViewData; + const AText: string; ADrawTextFlags: DWORD; const AEditSizeProperties: TcxEditSizeProperties; + ALineCount: Integer = 0; ACorrectWidth: Boolean = True): TSize; +function GetTextEditDrawTextOffset(AViewData: TcxCustomEditViewData): TRect; overload; +function GetTextEditDrawTextOffset(AAlignment: TAlignment; AIsInplace: Boolean): TRect; overload; // deprecated +procedure InternalTextOut(ACanvas: TCanvas; AViewInfo: TcxCustomTextEditViewInfo; + AText: PcxCaptionChar; var R: TRect; AFormat: TcxTextOutFormat; ASelStart, + ASelLength: Integer; ASelBackgroundColor, ASelTextColor: TColor; + AMaxLineCount: Integer = 0; ALeftIndent: Integer = 0; ARightIndent: Integer = 0); +procedure InsertThousandSeparator(var S: string); +function RemoveExponentialPart(var S: string): string; +procedure RemoveThousandSeparator(var S: string); +procedure SaveTextEditState(ATextEdit: IcxInnerTextEdit; + ASaveText: Boolean; + var APrevState: TcxCustomInnerTextEditPrevState); +procedure SeparateDigitGroups(AEdit: TcxCustomTextEdit); + +implementation + +uses +{$IFDEF DELPHI6} + FMTBcd, +{$ENDIF} + cxEditConsts, cxEditUtils, dxThemeConsts, dxThemeManager, cxDWMApi; + +type + TCanvasAccess = class(TCanvas); + TControlAccess = class(TControl); + TWinControlAccess = class(TWinControl); + //TcxEditDataBindingAccess = class(TcxEditDataBinding) + +procedure CalculateTextEditViewInfo(ACanvas: TcxCanvas; AViewData: TcxCustomTextEditViewData; + AViewInfo: TcxCustomTextEditViewInfo; AIsMouseEvent: Boolean); +begin + with AViewInfo do + begin + TextRect := ClientRect; + ExtendRect(TextRect, AViewData.GetDrawTextOffset); + if not IsInplace and (TextRect.Bottom - TextRect.Top < ACanvas.TextHeight('Zg')) then + begin + TextRect.Bottom := ACanvas.TextHeight('Zg') + TextRect.Top; + if TextRect.Bottom > ClientRect.Bottom then + TextRect.Bottom := ClientRect.Bottom; + end; + end; +end; + +procedure CheckCharsRegister(var AText: string; ACharCase: TEditCharCase); +begin + if ACharCase = ecUpperCase then + AText := AnsiUpperCase(AText) + else + if ACharCase = ecLowerCase then + AText := AnsiLowerCase(AText); +end; + +function CheckTextEditState(ATextEdit: IcxInnerTextEdit; const APrevState: + TcxCustomInnerTextEditPrevState): Boolean; +begin + if not ATextEdit.Control.HandleAllocated then + Result := True + else + with APrevState do + Result := (PrevSelStart <> ATextEdit.SelStart) or + (PrevSelLength <> ATextEdit.SelLength) or + IsPrevTextSaved and not InternalCompareString(PrevText, ATextEdit.EditValue, False); +end; + +procedure DrawEditText(ACanvas: TcxCanvas; AViewInfo: TcxCustomTextEditViewInfo); +var + AText: PcxCaptionChar; + ATextColor: TColor; + R: TRect; +begin + with AViewInfo do + begin + AText := PcxCaptionChar(Text); +{$IFNDEF NOFLICKER} + if StrLen(AText) = 0 then + Exit; +{$ENDIF} + + R := TextRect; + if DrawSelectionBar then + ATextColor := clHighlightText + else + ATextColor := TextColor; + ACanvas.Font := Font; + ACanvas.Font.Color := ATextColor; + PrepareCanvasFont(ACanvas.Canvas); + InternalTextOut(ACanvas.Canvas, AViewInfo, AText, R, DrawTextFlags, + SelStart, SelLength, SelBackgroundColor, SelTextColor, MaxLineCount); + end; +end; + +procedure DrawTextEdit(ACanvas: TcxCanvas; AViewInfo: TcxCustomTextEditViewInfo); + + function GetBackgroundPaintingStyle: TcxEditBackgroundPaintingStyle; + begin + with AViewInfo do + if ComboBoxStyle then + if EditingStyle in [esFixedList, esNoEdit] then + Result := bpsComboListEdit + else + Result := bpsComboEdit + else + Result := bpsSolid; + end; + + procedure InternalDrawFocusRect(R: TRect); + begin + with AViewInfo, ACanvas do + if not IsEditClass and Focused and not IsInplace and not HasPopupWindow then + begin + if DrawSelectionBar then + begin + Canvas.Font.Color := clHighlightText; + Canvas.Brush.Color := clHighlight; + end else + begin + Canvas.Font.Color := clBtnText; + Canvas.Brush.Color := AViewInfo.BackgroundColor; + end; + TCanvasAccess(Canvas).RequiredState([csFontValid]); + Canvas.DrawFocusRect(R); + end; + end; + +var + ARealTransparent: Boolean; + R: TRect; +begin + with AViewInfo, ACanvas do + begin + ARealTransparent := Transparent or DrawSelectionBar; + DrawCustomEdit(ACanvas, AViewInfo, not ARealTransparent, GetBackgroundPaintingStyle); + R := ClientRect; + if not IsInplace then + begin + if ((NativeState = TC_NONE) or DrawSelectionBar) and not Transparent and + (AViewInfo.EditingStyle <> esNoEdit) then + FrameRect(R, BackgroundColor); + InflateRect(R, -1, -1); + end; + if IsOwnerDrawing then + CustomDrawHandler(ACanvas, R) + else + begin + if DrawSelectionBar then + begin + Brush.Color := clHighlight; + FillRect(R); + end; + if IsDBEditPaintCopyDrawing or not HasInnerEdit or not IsEditClass then + AViewInfo.DrawText(ACanvas); + end; + InternalDrawFocusRect(R); + end; +end; + +function GetTextEditContentSize(ACanvas: TcxCanvas; AViewData: TcxCustomEditViewData; + const AText: string; ADrawTextFlags: DWORD; const AEditSizeProperties: TcxEditSizeProperties; + ALineCount: Integer = 0; ACorrectWidth: Boolean = True): TSize; + + function GetAutoHeightSize: TSize; + var + AAlignment: TcxEditAlignment; + AFlags: DWORD; + ARowCount: Integer; + ATextParams: TcxTextParams; + ATextRows: TcxTextRows; + ASizeCorrection: TSize; + AWidth: Integer; + R: TRect; + begin + AAlignment := nil; + if not AViewData.IsInplace and (AViewData is TcxCustomTextEditViewData) then + with TcxCustomTextEditProperties(AViewData.Properties) do + if (EditingStyle in [esFixedList, esNoEdit]) and + not (not AViewData.IsInplace and TcxCustomTextEditViewData(AViewData).IsComboBoxStyle and + AreVisualStylesMustBeUsed(AViewData.Style.LookAndFeel.NativeStyle, totEdit)) then + AAlignment := Alignment; + ACanvas.Font := AViewData.Style.GetVisibleFont; + AFlags := ADrawTextFlags; + ASizeCorrection := AViewData.GetEditContentSizeCorrection; + AWidth := AEditSizeProperties.Width; + + if ALineCount > 0 then + begin + Result.cy := ACanvas.TextHeight('Zg') * ALineCount; + Result.cx := AEditSizeProperties.Width; + end + else + begin + if AViewData.IsInplace then + Dec(AWidth, 2); + if AAlignment <> nil then + Dec(AWidth); + if AWidth <= 0 then + begin + Result.cx := 0; + if (epoAllowZeroHeight in AViewData.PaintOptions) and (Length(AText) = 0) then + Result.cy := 0 + else + Result.cy := ACanvas.TextHeight('Zg'); + end + else + begin + Result.cx := AEditSizeProperties.Width; + if Length(AText) = 0 then + if epoAllowZeroHeight in AViewData.PaintOptions then + Result.cy := 0 + else + Result.cy := ACanvas.TextHeight('Zg') + else + begin + AFlags := AFlags or CXTO_CALCROWCOUNT; + if AFlags and CXTO_SINGLELINE <> 0 then + AFlags := AFlags and not CXTO_SINGLELINE or CXTO_WORDBREAK or + CXTO_EDITCONTROL; + AFlags := AFlags and not(CXTO_CENTER_VERTICALLY or CXTO_BOTTOM) or CXTO_TOP; + R := Rect(0, 0, AWidth, MaxInt); + ATextParams := cxCalcTextParams(ACanvas.Canvas, AFlags); + ATextRows := nil; + cxMakeTextRows(ACanvas.Canvas, PcxCaptionChar(AText), R, ATextParams, ATextRows, ARowCount, AEditSizeProperties.MaxLineCount); + if (AEditSizeProperties.MaxLineCount > 0) and (ARowCount > AEditSizeProperties.MaxLineCount) then + ARowCount := AEditSizeProperties.MaxLineCount; + Result.cy := ARowCount * ACanvas.TextHeight('Zg'); + ATextRows := nil; + end; + end; + end; + if Result.cy > 0 then + Result.cy := Result.cy + ASizeCorrection.cy; + end; + + function GetBestFitSize: TSize; + var + AAlignment: TcxEditAlignment; + AFlags: DWORD; + ARowCount: Integer; + ATextParams: TcxTextParams; + ATextRows: TcxTextRows; + ATextFlags: Integer; + ASizeCorrection: TSize; + R: TRect; + begin + AAlignment := nil; + if not AViewData.IsInplace and (AViewData is TcxCustomTextEditViewData) then + with TcxCustomTextEditProperties(AViewData.Properties) do + if (EditingStyle in [esFixedList, esNoEdit]) and + not (not AViewData.IsInplace and TcxCustomTextEditViewData(AViewData).IsComboBoxStyle and + AreVisualStylesMustBeUsed(AViewData.Style.LookAndFeel.NativeStyle, totEdit)) then + AAlignment := Alignment; + ACanvas.Font := AViewData.Style.GetVisibleFont; + AFlags := ADrawTextFlags; + ASizeCorrection := AViewData.GetEditContentSizeCorrection; + + if (AFlags and CXTO_SINGLELINE <> 0) and not ((epoAutoHeight in AViewData.PaintOptions) and + (esoAutoHeight in AViewData.Properties.GetSupportedOperations)) then + begin + ATextFlags := cxTextOutFlagsToDrawTextFlags(AFlags); + Result.cy := ACanvas.TextHeight('Zg'); + R := Rect(0, 0, MaxInt, 0); + if Length(AText) = 0 then + Result.cx := 0 + else + begin + ACanvas.TextExtent(AText, R, ATextFlags); + Result.cx := R.Right - R.Left; + end; + end + else + begin + if AFlags and CXTO_SINGLELINE <> 0 then + AFlags := AFlags and not CXTO_SINGLELINE or + CXTO_WORDBREAK or CXTO_EDITCONTROL; + AFlags := AFlags or CXTO_CALCRECT; + R := Rect(0, 0, MaxInt, MaxInt); + + ATextParams := cxCalcTextParams(ACanvas.Canvas, AFlags); + ATextRows := nil; + cxMakeTextRows(ACanvas.Canvas, PcxCaptionChar(AText), R, ATextParams, ATextRows, ARowCount); + if ALineCount > 0 then + begin + if ARowCount > ALineCount then + ARowCount := ALineCount; + end + else + if (AEditSizeProperties.MaxLineCount > 0) and (ARowCount > AEditSizeProperties.MaxLineCount) then + ARowCount := AEditSizeProperties.MaxLineCount; + if ARowCount = 0 then + Result.cx := 0 + else + Result.cx := cxGetLongestTextRowWidth(ATextRows, ARowCount); + ATextRows := nil; + Result.cy := ACanvas.TextHeight('Zg'); + if ALineCount > 0 then + Result.cy := Result.cy * ALineCount; + end; + if AAlignment <> nil then + Result.cx := Result.cx + 1; + if ACorrectWidth then + Result.cx := Result.cx + ASizeCorrection.cx; + if Result.cy > 0 then + Result.cy := Result.cy + ASizeCorrection.cy; + end; + +begin + if AEditSizeProperties.Width >= 0 then + Result := GetAutoHeightSize + else + Result := GetBestFitSize; +end; + +function GetTextEditDrawTextOffset(AViewData: TcxCustomEditViewData): TRect; +begin + Result := AViewData.EditContentParams.Offsets; + if not AViewData.IsInplace and (AViewData is TcxCustomTextEditViewData) then + with AViewData as TcxCustomTextEditViewData do + if TcxCustomTextEditProperties(Properties).EditingStyle in [esFixedList, esNoEdit] then + begin + if AViewData.VertAlignment = taTopJustify then + begin + Inc(Result.Top); + Dec(Result.Bottom); + end; + if AViewData.HorzAlignment = taRightJustify then + Inc(Result.Right) + else + Inc(Result.Left); + end; +end; + +function GetTextEditDrawTextOffset(AAlignment: TAlignment; AIsInplace: Boolean): TRect; // deprecated +begin + Result := EditContentDefaultOffsets[AIsInplace]; +end; + +procedure PrepareTextRows(ACanvas: TCanvas; var TextOutData: TcxTextOutData; + AText: PcxCaptionChar; var R: TRect; AFormat: TcxTextOutFormat; ASelStart, + ASelLength: Integer; ASelBackgroundColor, ASelTextColor: TColor; + AMaxLineCount: Integer = 0; ALeftIndent: Integer = 0; ARightIndent: Integer = 0); + + procedure InternalPrepareTextRows; + var + ATextLength: Integer; + begin + TextOutData.RowCount := 0; + TextOutData.TextRows := nil; + ATextLength := StrLen(AText); + if ATextLength = 0 then + Exit; + TextOutData.TextParams := cxCalcTextParams(ACanvas.Handle, AFormat); + TextOutData.TextRect := cxPrepareRect(R, TextOutData.TextParams, ALeftIndent, + ARightIndent); + + if not IsRectEmpty(TextOutData.TextRect) then + begin + TextOutData.ForceEndEllipsis := not cxMakeTextRows(ACanvas.Handle, (AText), TextOutData.TextRect, TextOutData.TextParams, TextOutData.TextRows, TextOutData.RowCount, AMaxLineCount); + if TextOutData.RowCount <> 0 then + begin + if (AMaxLineCount > 0) and (TextOutData.RowCount >= AMaxLineCount) then + begin + TextOutData.RowCount := AMaxLineCount; + with TextOutData.TextParams do + TextOutData.ForceEndEllipsis := TextOutData.ForceEndEllipsis and EndEllipsis and EditControl and not SingleLine; + end + else + TextOutData.ForceEndEllipsis := False; + + cxPlaceTextRows(ACanvas.Handle, TextOutData.TextRect, TextOutData.TextParams, TextOutData.TextRows, TextOutData.RowCount); + if (ASelStart < 0) or (ASelStart >= ATextLength) then + ASelLength := 0 + else + if (ASelLength + ASelStart) > ATextLength then + ASelLength := ATextLength - ASelStart; + + TextOutData.SelStart := ASelStart; + TextOutData.SelLength := ASelLength; + TextOutData.SelBackgroundColor := ASelBackgroundColor; + TextOutData.SelTextColor := ASelTextColor; + end; + end; + end; + +begin + TextOutData.Initialized := True; + InternalPrepareTextRows; +end; + +procedure InternalTextOut(ACanvas: TCanvas; AViewInfo: TcxCustomTextEditViewInfo; + AText: PcxCaptionChar; var R: TRect; AFormat: TcxTextOutFormat; ASelStart, + ASelLength: Integer; ASelBackgroundColor, ASelTextColor: TColor; + AMaxLineCount: Integer = 0; ALeftIndent: Integer = 0; ARightIndent: Integer = 0); +begin + if not AViewInfo.TextOutData.Initialized then + PrepareTextRows(ACanvas, AViewInfo.TextOutData, AText, R, AFormat, ASelStart, + ASelLength, ASelBackgroundColor, ASelTextColor, AMaxLineCount, ALeftIndent, + ARightIndent); + TCanvasAccess(ACanvas).RequiredState([csFontValid]); + with AViewInfo.TextOutData do + cxTextRowsOutHighlight(ACanvas.Handle, TextRect, TextParams, TextRows, + RowCount, SelStart, SelLength, SelBackgroundColor, SelTextColor, ForceEndEllipsis); +end; + +procedure PrepareTextEditDrawTextFlags(ACanvas: TcxCanvas; AViewData: TcxCustomTextEditViewData; + AViewInfo: TcxCustomTextEditViewInfo); +var + ADrawTextOffset: TRect; + AFlags: DWORD; + R: TRect; + ATextHeight: Integer; + ATextParams: TcxTextParams; + ATextRows: TcxTextRows; + ARowCount: Integer; +begin + if AViewData.Style.GetVisibleFont = nil then + Exit; + ACanvas.Font := AViewData.Style.GetVisibleFont; + with AViewInfo do + begin + DrawTextFlags := AViewData.GetDrawTextFlags; + AFlags := DrawTextFlags and not CXTO_SINGLELINE or + CXTO_WORDBREAK or CXTO_EDITCONTROL or CXTO_CALCROWCOUNT; + R := Rect(0, 0, TextRect.Right - TextRect.Left, MaxInt); + ADrawTextOffset := AViewData.GetDrawTextOffset; + Inc(R.Right, ADrawTextOffset.Left + ADrawTextOffset.Right); + Dec(R.Right, AViewData.GetEditContentSizeCorrection.cx); + Dec(R.Right, AViewData.ContentOffset.Left + AViewData.ContentOffset.Right); + if TcxCustomTextEditProperties(AViewData.Properties).Alignment.Horz = taRightJustify then + Inc(R.Right); + ATextParams := cxCalcTextParams(ACanvas.Canvas, AFlags); +// TODO optimize + cxMakeTextRows(ACanvas.Canvas, PcxCaptionChar(Text), R, ATextParams, ATextRows, ARowCount); + ATextHeight := ARowCount * ATextParams.RowHeight; + if ARowCount > 1 then + begin + DrawTextFlags := DrawTextFlags and not CXTO_SINGLELINE or + CXTO_WORDBREAK or CXTO_EDITCONTROL; + if ATextHeight > TextRect.Bottom - TextRect.Top then + DrawTextFlags := DrawTextFlags and not CXTO_BOTTOM + and not CXTO_CENTER_VERTICALLY or CXTO_TOP; + end; + ATextRows := nil; + end; +end; + +procedure InsertThousandSeparator(var S: string); + + function IsDigitChar(C: Char): Boolean; + begin + Result := C in ['0'..'9']; + end; + +var + I, J: Integer; + ACaption: string; + APrefix, ASuffix: string; +begin + APrefix := TrimRight(S); + ASuffix := Copy(S, Length(APrefix) + 1, Length(S) - Length(APrefix)); + APrefix := TrimLeft(S); + APrefix := Copy(S, 1, Length(S) - Length(APrefix)); + S := Trim(S); + ACaption := RemoveExponentialPart(S); + RemoveThousandSeparator(S); + I := Pos(DecimalSeparator, S); + if I = 0 then + I := Length(S) + else + Dec(I); + J := 0; + while (I > 1) and IsDigitChar(S[I - 1]) do + begin + Inc(J); + if J = 3 then + begin + Insert(ThousandSeparator, S, I); + J := 0; + end; + Dec(I); + end; + S := APrefix + S + ACaption + ASuffix; +end; + +function RemoveExponentialPart(var S: string): string; +var + APos: Integer; +begin + APos := Pos('E', UpperCase(S)); + if APos > 0 then + begin + Result := Copy(S, APos, Length(S) - APos + 1); + Delete(S, APos, Length(S) - APos + 1); + end + else + Result := ''; +end; + +procedure RemoveThousandSeparator(var S: string); +var + APos: Integer; +begin + repeat + APos := Pos(ThousandSeparator, S); + if APos <> 0 then + Delete(S, APos, 1); + until APos = 0; +end; + +procedure SaveTextEditState(ATextEdit: IcxInnerTextEdit; + ASaveText: Boolean; + var APrevState: TcxCustomInnerTextEditPrevState); +begin + with APrevState do + begin + IsPrevTextSaved := ASaveText; + if ASaveText then + PrevText := ATextEdit.EditValue; + PrevSelStart := ATextEdit.SelStart; + PrevSelLength := ATextEdit.SelLength; + end; +end; + +procedure SeparateDigitGroups(AEdit: TcxCustomTextEdit); + + function IsValidNumber(S: string): Boolean; + var + AValue: Extended; + begin + RemoveThousandSeparator(S); + Result := (S <> '') and TextToFloat(PChar(S), AValue, fvExtended); + end; + + function GetRealCaretPos: Integer; + var + I: Integer; + begin + Result := 0; + for I := 1 to AEdit.SelStart do + if AEdit.Text[I] <> ThousandSeparator then + Inc(Result); + end; + + procedure SetRealCaretPos(APrevCaretPos: Integer); + var + I: Integer; + S: string; + begin + S := AEdit.Text; + for I := 1 to Length(S) do + begin + if S[I] <> ThousandSeparator then + Dec(APrevCaretPos); + if APrevCaretPos = 0 then + begin + AEdit.SelStart := I; + Break; + end; + end; + end; + +var + ACaretPos: Integer; + S: string; +begin + S := AEdit.Text; + InsertThousandSeparator(S); + if IsValidNumber(S) then + begin + ACaretPos := GetRealCaretPos; + AEdit.SetInternalDisplayValue(S); + SetRealCaretPos(ACaretPos); + end; +end; + +{ TcxCustomInnerTextEditHelper } + +constructor TcxCustomInnerTextEditHelper.Create(AEdit: TcxCustomInnerTextEdit); +begin + inherited Create(nil); + FEdit := AEdit; + FAlignmentLock := False; +end; + +// IcxContainerInnerControl +function TcxCustomInnerTextEditHelper.GetControlContainer: TcxContainer; +begin + Result := Edit.Container; +end; + +function TcxCustomInnerTextEditHelper.GetControl: TWinControl; +begin + Result := Edit; +end; + +// IcxCustomInnerEdit +function TcxCustomInnerTextEditHelper.CallDefWndProc(AMsg: UINT; WParam: WPARAM; + LParam: LPARAM): LRESULT; +begin + Result := CallWindowProc(Edit.DefWndProc, Edit.Handle, AMsg, WParam, LParam); +end; + +function TcxCustomInnerTextEditHelper.GetEditValue: TcxEditValue; +begin + Result := (Edit.Text); +end; + +function TcxCustomInnerTextEditHelper.GetOnChange: TNotifyEvent; +begin + Result := Edit.OnChange; +end; + +procedure TcxCustomInnerTextEditHelper.LockBounds(ALock: Boolean); +begin + with Edit do + if ALock then + Inc(FLockBoundsCount) + else + if FLockBoundsCount > 0 then + Dec(FLockBoundsCount); +end; + +procedure TcxCustomInnerTextEditHelper.SafelySetFocus; +var + APrevAutoSelect: Boolean; +begin + with Edit do + begin + APrevAutoSelect := AutoSelect; + AutoSelect := False; + SetFocus; + AutoSelect := APrevAutoSelect; + end; +end; + +procedure TcxCustomInnerTextEditHelper.SetEditValue(const Value: TcxEditValue); +var + ATextChanged: Boolean; + AIsDesigning: Boolean; +begin + with Edit do + begin + AIsDesigning := csDesigning in ComponentState; + if AIsDesigning then + ATextChanged := not InternalCompareString(Text, VarToStr(Value), True) + else + ATextChanged := False; + Text := VarToStr(Value); + if ATextChanged then + Change; + end; +end; + +procedure TcxCustomInnerTextEditHelper.SetParent(Value: TWinControl); +begin + Edit.Parent := Value; +end; + +procedure TcxCustomInnerTextEditHelper.SetOnChange(Value: TNotifyEvent); +begin + Edit.OnChange := Value; +end; + +// IcxInnerTextEdit +procedure TcxCustomInnerTextEditHelper.ClearSelection; +begin + Edit.ClearSelection; +end; + +procedure TcxCustomInnerTextEditHelper.CopyToClipboard; +begin + Edit.CopyToClipboard; +end; + +function TcxCustomInnerTextEditHelper.GetAlignment: TAlignment; +begin + Result := Edit.FAlignment; +end; + +function TcxCustomInnerTextEditHelper.GetAutoSelect: Boolean; +begin + Result := Edit.AutoSelect; +end; + +function TcxCustomInnerTextEditHelper.GetCharCase: TEditCharCase; +begin + Result := Edit.CharCase; +end; + +function TcxCustomInnerTextEditHelper.GetEchoMode: TcxEditEchoMode; +begin + Result := Edit.FEchoMode; +end; + +function TcxCustomInnerTextEditHelper.GetHideSelection: Boolean; +begin + Result := Edit.HideSelection; +end; + +function TcxCustomInnerTextEditHelper.GetImeLastChar: Char; +begin + if Edit.FImeCharCount = 2 then + Result := Edit.FImeLastChar + else + Result := #0; +end; + +function TcxCustomInnerTextEditHelper.GetImeMode: TImeMode; +begin + Result := Edit.ImeMode; +end; + +function TcxCustomInnerTextEditHelper.GetImeName: TImeName; +begin + Result := Edit.ImeName; +end; + +function TcxCustomInnerTextEditHelper.GetInternalUpdating: Boolean; +begin + Result := Edit.FInternalUpdating; +end; + +function TcxCustomInnerTextEditHelper.GetMaxLength: Integer; +begin + Result := Edit.MaxLength; +end; + +function TcxCustomInnerTextEditHelper.GetMultiLine: Boolean; +begin + Result := False; +end; + +function TcxCustomInnerTextEditHelper.GetPasswordChar: TCaptionChar; +begin + Result := Edit.FPasswordChar; +end; + +function TcxCustomInnerTextEditHelper.GetOEMConvert: Boolean; +begin + Result := Edit.OEMConvert; +end; + +function TcxCustomInnerTextEditHelper.GetOnSelChange: TNotifyEvent; +begin + Result := Edit.OnSelChange; +end; + +function TcxCustomInnerTextEditHelper.GetReadOnly: Boolean; +begin + Result := Edit.ReadOnly; +end; + +function TcxCustomInnerTextEditHelper.GetSelLength: Integer; +begin + with Edit do + if FImeCharCount > 0 then + Result := Self.FSelLength + else + Result := SelLength; +end; + +function TcxCustomInnerTextEditHelper.GetSelStart: Integer; +begin + with Edit do + if FImeCharCount > 0 then + Result := Self.FSelStart + else + Result := SelStart; +end; + +function TcxCustomInnerTextEditHelper.GetSelText: string; +begin + Result := Edit.SelText; +end; + +procedure TcxCustomInnerTextEditHelper.SelectAll; +begin + with Edit do + if HandleAllocated then + SelectAll; +end; + +procedure TcxCustomInnerTextEditHelper.SetAlignment(Value: TAlignment); +begin + if FAlignmentLock then Exit; + with Edit do + if Value <> FAlignment then + begin + FAlignment := Value; + FAlignmentLock := True; + try + RecreateWnd; + finally + FAlignmentLock := False; + end; + end; +end; + +procedure TcxCustomInnerTextEditHelper.SetAutoSelect(Value: Boolean); +begin + Edit.AutoSelect := Value; +end; + +procedure TcxCustomInnerTextEditHelper.SetCharCase(Value: TEditCharCase); +begin + with Edit do + begin + CharCase := Value; + end; +end; + +procedure TcxCustomInnerTextEditHelper.SetEchoMode(Value: TcxEditEchoMode); +begin + with Edit do + if Value <> FEchoMode then + begin + FEchoMode := Value; + UpdateEchoMode; + end; +end; + +procedure TcxCustomInnerTextEditHelper.SetHideSelection(Value: Boolean); +begin + Edit.HideSelection := Value; +end; + +procedure TcxCustomInnerTextEditHelper.SetInternalUpdating(Value: Boolean); +begin + Edit.FInternalUpdating := Value; +end; + +procedure TcxCustomInnerTextEditHelper.SetImeMode(Value: TImeMode); +begin + Edit.ImeMode := Value; +end; + +procedure TcxCustomInnerTextEditHelper.SetImeName(const Value: TImeName); +begin + Edit.ImeName := Value; +end; + +procedure TcxCustomInnerTextEditHelper.SetMaxLength(Value: Integer); +begin + Edit.MaxLength := Value; +end; + +procedure TcxCustomInnerTextEditHelper.SetOEMConvert(Value: Boolean); +begin + Edit.OEMConvert := Value; +end; + +procedure TcxCustomInnerTextEditHelper.SetOnSelChange(Value: TNotifyEvent); +begin + Edit.OnSelChange := Value; +end; + +procedure TcxCustomInnerTextEditHelper.SetPasswordChar(Value: TCaptionChar); +begin + with Edit do + if Value <> FPasswordChar then + begin + FPasswordChar := Value; + if FEchoMode = eemPassword then + UpdateEchoMode; + end; +end; + +procedure TcxCustomInnerTextEditHelper.SetReadOnly(Value: Boolean); +begin + Edit.ReadOnly := Value; +end; + +procedure TcxCustomInnerTextEditHelper.SetSelLength(Value: Integer); +begin + with Edit do + if HandleAllocated then + if FImeCharCount > 0 then + Self.FSelLength := Value + else + SelLength := Value; +end; + +procedure TcxCustomInnerTextEditHelper.SetSelStart(Value: Integer); +begin + with Edit do + begin + if not HandleAllocated then + Exit; + if FImeCharCount > 0 then + begin + Self.FSelStart := Value; + Exit; + end; + SelStart := Value; + end; +end; + +procedure TcxCustomInnerTextEditHelper.SetSelText(Value: string); +begin + Edit.SelText := Value; +end; + +function TcxCustomInnerTextEditHelper.GetUseLeftAlignmentOnEditing: Boolean; +begin + Result := Edit.Container.ActiveProperties.UseLeftAlignmentOnEditing; +end; + +{ TcxCustomInnerTextEdit } + +constructor TcxCustomInnerTextEdit.Create(AOwner: TComponent); +begin + FIsCreating := True; + inherited Create(AOwner); + InitializeDblClickTimer; + FHelper := TcxCustomInnerTextEditHelper.Create(Self); + ControlStyle := ControlStyle + [csDoubleClicks]; + ParentColor := True; + ParentFont := False; + FAlignment := cxEditDefaultHorzAlignment; + FInternalUpdating := False; + FEchoMode := eemNormal; + UpdateEchoMode; + FIsCreating := False; +end; + +destructor TcxCustomInnerTextEdit.Destroy; +begin + FreeAndNil(FHelper); + FreeAndNil(FDblClickTimer); + inherited Destroy; +end; + +procedure TcxCustomInnerTextEdit.DragDrop(Source: TObject; X, Y: Integer); +begin + Container.DragDrop(Source, Left + X, Top + Y); +end; + +function TcxCustomInnerTextEdit.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action) or + Container.DataBinding.ExecuteAction(Action); +end; + +function TcxCustomInnerTextEdit.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action) or + Container.DataBinding.UpdateAction(Action); +end; + +{$IFDEF DELPHI5} +function TcxCustomInnerTextEdit.CanFocus: Boolean; +begin + Result := Container.CanFocusEx; +end; +{$ENDIF} + +procedure TcxCustomInnerTextEdit.DefaultHandler(var Message); +begin + if not Container.InnerControlDefaultHandler(TMessage(Message)) then + inherited DefaultHandler(Message); +end; + +procedure TcxCustomInnerTextEdit.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); +begin + if not FIsCreating and (FLockBoundsCount = 0) then + begin + Container.LockAlignControls(True); + try + inherited SetBounds(ALeft, ATop, AWidth, AHeight); + finally + Container.LockAlignControls(False); + end; + end; +end; + +procedure TcxCustomInnerTextEdit.AdjustAlignment; +begin + if NeadAdjustAlignment then + begin + if Focused then + Helper.SetAlignment(taLeftJustify) + else + Helper.SetAlignment(GetBasedAlignment); + Container.ShortRefreshContainer(False); + end; +end; + +// for Delphi .NET +procedure TcxCustomInnerTextEdit.Change; +begin + inherited Change; +end; + +procedure TcxCustomInnerTextEdit.Click; +begin + inherited Click; + Container.Click; +end; + +procedure TcxCustomInnerTextEdit.CreateHandle; +begin + Container.ClearSavedChildControlRegions; + inherited CreateHandle; +end; + +procedure TcxCustomInnerTextEdit.CreateParams(var Params: TCreateParams); +const + AAlignmentMap: array[TAlignment] of DWORD = (ES_LEFT, ES_RIGHT, ES_CENTER); +begin + inherited CreateParams(Params); + with Params do + begin + Style := Style or AAlignmentMap[Alignment]; + Style := Style and (not WS_BORDER); + Style := Style and (not WS_DLGFRAME); + Style := Style and (not WS_SIZEBOX); + Style := Style and (not WS_THICKFRAME); + Style := Style or ES_AUTOHSCROLL; + ExStyle := ExStyle and (not WS_EX_CLIENTEDGE); + end; +end; + +procedure TcxCustomInnerTextEdit.CreateWindowHandle(const Params: TCreateParams); +var + AParams: TCreateParams; +begin + AParams := Params; + AParams.Caption := ''; + inherited CreateWindowHandle(AParams); + if HandleAllocated then + CallWindowProc(DefWndProc, Handle, WM_SETTEXT, 0, Integer(WindowText)); +end; + +procedure TcxCustomInnerTextEdit.CreateWnd; +begin + inherited CreateWnd; + AdjustMargins; +end; + +procedure TcxCustomInnerTextEdit.DblClick; +begin + inherited DblClick; + Container.DblClick; +end; + +function TcxCustomInnerTextEdit.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; +begin + Result := False; +end; + +procedure TcxCustomInnerTextEdit.DragOver(Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); +begin + Container.DragOver(Source, Left + X, Top + Y, State, Accept); +end; + +function TcxCustomInnerTextEdit.GetBasedAlignment: TAlignment; +begin + Result := Container.ActiveProperties.Alignment.Horz; +end; + +procedure TcxCustomInnerTextEdit.KeyDown(var Key: Word; Shift: TShiftState); +begin + FDblClickTimer.Enabled := False; + FInternalUpdating := False; + try + Container.KeyDown(Key, Shift); + finally + if Key = 0 then + FInternalUpdating := True; + end; + if Key <> 0 then + inherited KeyDown(Key, Shift); +end; + +procedure TcxCustomInnerTextEdit.KeyPress(var Key: Char); +var + AKey: Word; +begin + FInternalUpdating := False; + try + AKey := Word(Key); + if (AKey = VK_TAB) then + Key := #0; + Container.KeyPress(Key); + + AKey := Word(Key); + if (Container.IsInplace or Container.FIsPopupWindowJustClosed or + (not Container.BeepOnEnter and (AKey = VK_RETURN))) and + ((AKey = VK_RETURN) or (AKey = VK_ESCAPE)) then + begin + Key := #0; + Container.FIsPopupWindowJustClosed := False; + end; + finally + if Key = #0 then + FInternalUpdating := True + end; + if Key <> #0 then + inherited KeyPress(Key); +end; + +procedure TcxCustomInnerTextEdit.KeyUp(var Key: Word; Shift: TShiftState); +begin + FInternalUpdating := False; + try + if (Key = VK_TAB) then + Key := 0; + Container.KeyUp(Key, Shift); + finally + if Key = 0 then + FInternalUpdating := True; + end; + if Key <> 0 then + inherited KeyUp(Key, Shift); +end; + +procedure TcxCustomInnerTextEdit.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + with Container do + begin + InnerControlMouseDown := True; + try + MouseDown(Button, Shift, X + Self.Left, Y + Self.Top); + finally + InnerControlMouseDown := False; + end; + end; +end; + +procedure TcxCustomInnerTextEdit.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + Container.MouseMove(Shift, X + Left, Y + Top); +end; + +procedure TcxCustomInnerTextEdit.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + Container.MouseUp(Button, Shift, X + Left, Y + Top); +end; + +procedure TcxCustomInnerTextEdit.WndProc(var Message: TMessage); +begin + if Container.InnerControlMenuHandler(Message) then + Exit; + case Message.Msg of + WM_LBUTTONDOWN: + if NeadAdjustAlignment and (FAlignment <> taLeftJustify) then + begin + SetFocus; + inherited WndProc(Message); + FDblClickTimer.Enabled := True; + FDblClickLock := True; + end + else + begin + if (Container.DragMode = dmAutomatic) and not Container.IsDesigning then + Container.BeginAutoDrag + else + begin + if FDblClickTimer.Enabled then + begin + Message.Msg := WM_LBUTTONDBLCLK; + FDblClickTimer.Enabled := False; + FDblClickTimer.Enabled := True; + end; + FDblClickLock := False; + inherited WndProc(Message); + end; + end; + WM_LBUTTONDBLCLK: + begin + if (Container.DragMode = dmAutomatic) and not Container.IsDesigning then + Container.BeginAutoDrag + else + begin + if FDblClickTimer.Enabled then + Exit; + inherited WndProc(Message); + end; + end; + WM_PAINT: + begin + if Container.OnGlass and IsCompositionEnabled then + begin + WMPaintWindowOnGlass(Handle); + Message.Result := 0; + end + else + inherited WndProc(Message); + end; + CN_CTLCOLOREDIT, CN_CTLCOLORSTATIC: + begin + inherited WndProc(Message); + if not FRepaintOnGlass and Container.OnGlass and + IsCompositionEnabled then + begin + FRepaintOnGlass := True; + PostMessage(Handle, CM_BUFFEREDPAINTONGLASS, 0, 0); + end; + end; + CM_BUFFEREDPAINTONGLASS: + if FRepaintOnGlass then + begin + RepaintWindowOnGlass(Handle); + FRepaintOnGlass := False; + end; + else + inherited WndProc(Message); + end; +end; + +procedure TcxCustomInnerTextEdit.AdjustMargins; +begin + SendMessage(Handle, EM_SETMARGINS, EC_LEFTMARGIN + EC_RIGHTMARGIN, 1 shl 16); +end; + +procedure TcxCustomInnerTextEdit.MouseEnter(AControl: TControl); +begin +end; + +procedure TcxCustomInnerTextEdit.MouseLeave(AControl: TControl); +begin + Container.ShortRefreshContainer(True); +end; + +// for Delphi .NET +procedure TcxCustomInnerTextEdit.RecreateWnd; +begin + inherited RecreateWnd; +end; + +// IcxContainerInnerControl +function TcxCustomInnerTextEdit.GetControl: TWinControl; +begin + Result := Self; +end; + +function TcxCustomInnerTextEdit.GetControlContainer: TcxContainer; +begin + Result := Container; +end; + +// IcxInnerEditHelper +function TcxCustomInnerTextEdit.GetHelper: IcxCustomInnerEdit; +begin + Result := Helper; +end; + +procedure TcxCustomInnerTextEdit.DblClickTimerHandle(Sender: TObject); +begin + FDblClickTimer.Enabled := False; +end; + +function TcxCustomInnerTextEdit.GetContainer: TcxCustomTextEdit; +begin + Result := TcxCustomTextEdit(Owner); +end; + +function TcxCustomInnerTextEdit.GetCursorPos: Integer; +var + X: Integer; + P: TPoint; + I, I0, I1: Smallint; + ATextLength: Integer; +begin + ATextLength := Length(Text); + GetCaretPos(P); + I0 := 0; + I1 := ATextLength - 1; + repeat + I := (I0 + I1) div 2; + X := Smallint(SendMessage(Handle, EM_POSFROMCHAR, I, 0) and $FFFF); + if X < P.X then + I0 := I + else + I1 := I; + until I1 - I0 < 2; + if SendMessage(Handle, EM_POSFROMCHAR, I0, 0) and $FFFF = P.X then + Result := I0 + else if SendMessage(Handle, EM_POSFROMCHAR, I1, 0) and $FFFF = P.X then + Result := I1 + else + Result := I1 + 1; +end; + +procedure TcxCustomInnerTextEdit.InitializeDblClickTimer; +begin + FreeAndNil(FDblClickTimer); + FDblClickTimer := TcxTimer.Create(Self); + with FDblClickTimer do + begin + Enabled := False; + OnTimer := DblClickTimerHandle; + Interval := GetDoubleClickTime; + end; +end; + +function TcxCustomInnerTextEdit.NeadAdjustAlignment: Boolean; +begin + Result := Helper.UseLeftAlignmentOnEditing and (GetBasedAlignment <> taLeftJustify) +end; + +procedure TcxCustomInnerTextEdit.UpdateEchoMode; +begin + if FEchoMode = eemNormal then + PasswordChar := #0 + else + if FPasswordChar = #0 then + PasswordChar := '*' + else + PasswordChar := FPasswordChar; +end; + +procedure TcxCustomInnerTextEdit.WMChar(var Message: TWMChar); +var + APrevState: TcxCustomInnerTextEditPrevState; +begin + SaveTextEditState(Helper, True, APrevState); + FInternalUpdating := False; + inherited; + if FImeCharCount > 0 then + begin + Dec(FImeCharCount); + if (FImeCharCount = 0) and Container.FindSelection then + begin + SelStart := Helper.FSelStart; + SelLength := Helper.FSelLength; + end; + end; + Container.UnlockLookupDataTextChanged; + if FInternalUpdating then + Exit; + if CheckTextEditState(Helper, APrevState) then + Container.FindSelection := False; +end; + +procedure TcxCustomInnerTextEdit.WMClear(var Message: TMessage); +begin + if not ReadOnly then + with Container do + begin + KeyboardAction := True; + try + ClearSelection; + finally + KeyboardAction := False; + end; + end; +end; + +procedure TcxCustomInnerTextEdit.WMCut(var Message: TMessage); +begin + with Container do + begin + KeyboardAction := True; + try + if not Self.ReadOnly then + CutToClipboard + else + CopyToClipboard; + finally + KeyboardAction := False; + end; + end; +end; + +procedure TcxCustomInnerTextEdit.WMEraseBkgnd(var Message: TWMEraseBkgnd); +begin + Message.Result := 1; +end; + +procedure TcxCustomInnerTextEdit.WMGetDlgCode(var Message: TWMGetDlgCode); +begin + inherited; + with Message do + begin + Result := Result or DLGC_WANTCHARS; + if Container.TabsNeeded and (GetKeyState(VK_CONTROL) >= 0) then + Result := Result or DLGC_WANTTAB; + if Container.IsInplace or Container.HasPopupWindow then + Result := Result or DLGC_WANTALLKEYS; + end; +end; + +procedure TcxCustomInnerTextEdit.WMIMEChar(var Message: TMessage); +begin + if (Message.WParam and $FF00) shr 8 <> 0 then + begin + FImeCharCount := 2; + FImeLastChar := Char(Message.WParam and $FF); + end + else + FImeCharCount := 1; + + Helper.FSelStart := SelStart; + Helper.FSelLength := SelLength; + inherited; +end; + +procedure TcxCustomInnerTextEdit.WMIMEComposition(var Message: TMessage); +begin + if Container.DoEditing then + inherited; +end; + +procedure TcxCustomInnerTextEdit.WMKeyDown(var Message: TWMKeyDown); +var + AKey: Word; + APrevState: TcxCustomInnerTextEditPrevState; + AShiftState: TShiftState; +begin + AShiftState := KeyDataToShiftState(Message.KeyData); + if Container.HasPopupWindow and Container.ActiveProperties.IsPopupKey(Message.CharCode, AShiftState) then + with Container.ILookupData do + if ActiveControl is TWinControl then + begin + SendMessage(TWinControl(ActiveControl).Handle, WM_KEYDOWN, TMessage(Message).WParam, TMessage(Message).LParam); + if Message.Result = 0 then + Exit; + end; + + SaveTextEditState(Helper, True, APrevState); + FInternalUpdating := False; + inherited; + if (Message.CharCode = 0) or FInternalUpdating then + Exit; + if not CheckTextEditState(Helper, APrevState) then + begin + AKey := Message.CharCode; + AShiftState := KeyDataToShiftState(Message.KeyData); + Container.DoAfterKeyDown(AKey, AShiftState); + Message.CharCode := AKey; + end; +end; + +procedure TcxCustomInnerTextEdit.WMKillFocus(var Message: TWMKillFocus); +begin + inherited; + if not(csDestroying in ComponentState) then + begin + FDblClickTimer.Enabled := False; + AdjustAlignment; + Container.FocusChanged; + end; +end; + +procedure TcxCustomInnerTextEdit.WMNCPaint(var Message: TWMNCPaint); +begin + Message.Result := 0; + Exit; +end; + +procedure TcxCustomInnerTextEdit.WMPaste(var Message: TMessage); +begin + if not ReadOnly then + with Container do + begin + KeyboardAction := True; + try + PasteFromClipboard; + finally + KeyboardAction := False; + end; + end; +end; + +procedure TcxCustomInnerTextEdit.WMSetFocus(var Message: TWMSetFocus); +begin + if not(csDestroying in ComponentState) then + AdjustAlignment; + inherited; + if not(csDestroying in ComponentState) and (Message.FocusedWnd <> Container.Handle) then + Container.FocusChanged; +end; + +procedure TcxCustomInnerTextEdit.WMSize(var Message: TWMSize); +begin + inherited; + AdjustMargins; +end; + +procedure TcxCustomInnerTextEdit.WMUndo(var Message: TWMSize); +begin + inherited; + Container.UndoPerformed; +end; + +procedure TcxCustomInnerTextEdit.CMMouseEnter(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseEnter(Self) + else + MouseEnter(TControl(Message.lParam)); +end; + +procedure TcxCustomInnerTextEdit.CMMouseLeave(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseLeave(Self) + else + MouseLeave(TControl(Message.lParam)); +end; + +procedure TcxCustomInnerTextEdit.EMSetSel(var Message: TMessage); +begin + inherited; + if Assigned(OnSelChange) then + OnSelChange(Self); +end; + +{ TcxTextEditPropertiesValues } + +procedure TcxTextEditPropertiesValues.Assign(Source: TPersistent); +begin + if Source is TcxTextEditPropertiesValues then + begin + BeginUpdate; + try + inherited Assign(Source); + with Source as TcxTextEditPropertiesValues do + begin + Self.DisplayFormat := DisplayFormat; + Self.EditFormat := EditFormat; + Self.MaxLength := MaxLength; + end; + finally + EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxTextEditPropertiesValues.RestoreDefaults; +begin + BeginUpdate; + try + inherited RestoreDefaults; + DisplayFormat := False; + EditFormat := False; + MaxLength := False; + finally + EndUpdate; + end; +end; + +function TcxTextEditPropertiesValues.IsDisplayFormatStored: Boolean; +begin + Result := DisplayFormat and + (TcxCustomTextEditProperties(Properties).FDisplayFormat = '') and + IsPropertiesPropertyVisible('DisplayFormat'); +end; + +function TcxTextEditPropertiesValues.IsEditFormatStored: Boolean; +begin + Result := EditFormat and + (TcxCustomTextEditProperties(Properties).FEditFormat = '') and + IsPropertiesPropertyVisible('EditFormat'); +end; + +procedure TcxTextEditPropertiesValues.SetDisplayFormat(Value: Boolean); +begin + if Value <> FDisplayFormat then + begin + FDisplayFormat := Value; + Changed; + end; +end; + +procedure TcxTextEditPropertiesValues.SetEditFormat(Value: Boolean); +begin + if Value <> FEditFormat then + begin + FEditFormat := Value; + Changed; + end; +end; + +procedure TcxTextEditPropertiesValues.SetMaxLength(Value: Boolean); +begin + if Value <> FMaxLength then + begin + FMaxLength := Value; + TcxCustomTextEditProperties(Properties).MaxLengthChanged; + end; +end; + +{ TcxCustomEditListBox } + +constructor TcxCustomEditListBox.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FHotTrack := True; + BorderStyle := bsNone; +end; + +function TcxCustomEditListBox.GetHeight(ARowCount: Integer; AMaxHeight: Integer): Integer; +begin + Result := ARowCount * GetItemHeight; +end; + +function TcxCustomEditListBox.GetItemHeight(AIndex: Integer = -1): Integer; +begin + Result := GetDefaultItemHeight; +end; + +function TcxCustomEditListBox.GetItemWidth(AIndex: Integer): Integer; +begin + Canvas.Font.Assign(Font); + Result := Canvas.TextWidth(GetItem(AIndex)); +end; + +function TcxCustomEditListBox.IsVisible: Boolean; +begin + Result := HandleAllocated and IsWindowVisible(Handle); +end; + +procedure TcxCustomEditListBox.SetScrollWidth(Value: Integer); +begin + ScrollWidth := 0; + ScrollWidth := Value; +end; + +procedure TcxCustomEditListBox.Click; +begin + inherited Click; + DoSelectItem; +end; + +function TcxCustomEditListBox.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; +const + AScrollDirectionMap: array [Boolean] of Integer = (SB_LINEDOWN, SB_LINEUP); +var + I: Integer; +begin + Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos); + if Result then + Exit; + for I := 0 to Mouse.WheelScrollLines - 1 do + Result := (SendMessage(Handle, WM_VScroll, AScrollDirectionMap[WheelDelta > 0], 0) = 0); +end; + +procedure TcxCustomEditListBox.DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); +var + AFlags: Longint; + AText: string; +begin + if DoDrawItem(Index, Rect, State) then + Exit; + Canvas.FillRect(Rect); + if (Index >= 0) and (Index < Items.Count) then + begin + AFlags := DrawTextBiDiModeFlags(DT_SINGLELINE or DT_VCENTER or DT_NOPREFIX); + if not UseRightToLeftAlignment then + Inc(Rect.Left, 2) + else + Dec(Rect.Right, 2); + AText := GetItem(Index); + DrawText(Canvas.Handle, PChar(AText), Length(AText), Rect, AFlags); + end; +end; + +function TcxCustomEditListBox.GetItemData(Index: Integer): + Longint; +begin + Result := 0; +end; + +function TcxCustomEditListBox.NeedDrawFocusRect: Boolean; +begin + Result := Edit.ActiveProperties.EditingStyle in [esFixedList, esNoEdit]; +end; + +procedure TcxCustomEditListBox.MeasureItem(Index: Integer; var Height: Integer); +begin + Height := GetItemHeight; +end; + +procedure TcxCustomEditListBox.MouseMove(Shift: TShiftState; X, Y: Integer); +var + AItemIndex: Integer; +begin + inherited MouseMove(Shift, X, Y); + if (GetCaptureControl <> Self) and HotTrack then + begin + AItemIndex := ItemAtPos(Point(X, Y), False); + if (AItemIndex <> -1) and (ItemIndex <> AItemIndex) then + ItemIndex := AItemIndex; + end; +end; + +procedure TcxCustomEditListBox.SetItemData(Index: Integer; + AData: Longint); +begin +end; + +function TcxCustomEditListBox.DoDrawItem(AIndex: Integer; const ARect: TRect; + AState: TOwnerDrawState): Boolean; +begin + Result := False; +end; + +procedure TcxCustomEditListBox.DoSelectItem; +begin + SetExternalScrollBarsParameters; + if Assigned(FOnSelectItem) then + FOnSelectItem(Self); +end; + +function TcxCustomEditListBox.GetDefaultItemHeight: Integer; +begin + Canvas.Font := Font; + Result := Canvas.TextHeight('Wg'); +end; + +function TcxCustomEditListBox.GetItem(Index: Integer): string; +begin + Result := Items[Index]; +end; + +procedure TcxCustomEditListBox.InternalRecreateWindow; +begin + RecreateWnd; +end; + +procedure TcxCustomEditListBox.RecreateWindow; +begin +end; + +procedure TcxCustomEditListBox.SetItemCount(Value: Integer); +var + I: Integer; +begin + with Items do + begin + if Value = Count then + Exit; + BeginUpdate; + try + if Value > Count then + for I := 1 to Value - Count do + Add('') + else + for I := 1 to Count - Value do + Delete(Count - 1); + finally + EndUpdate; + end; + end; +end; + +procedure TcxCustomEditListBox.SetItemIndex(const Value: Integer); +begin +{$IFDEF DELPHI6} + inherited SetItemIndex(Value); +{$ELSE} + inherited ItemIndex := Value; +{$ENDIF} + DoSelectItem; +end; + +procedure TcxCustomEditListBox.CMShowingChanged(var Message: TMessage); +begin + inherited; + CallWindowProc(DefWndProc, Handle, WM_SETFOCUS, 0, 0); +end; + +function TcxCustomEditListBox.GetEdit: TcxCustomTextEdit; +begin + Result := TcxCustomTextEdit(TcxCustomPopupWindow(Owner).OwnerControl); +end; + +{$IFNDEF DELPHI6} +function TcxCustomEditListBox.GetItemIndex: Integer; +begin + Result := inherited ItemIndex; +end; +{$ENDIF} + +{ TcxCustomTextEditLookupData } + +constructor TcxCustomTextEditLookupData.Create(AOwner: TPersistent); +begin + inherited Create(nil); + FOwner:= AOwner; + FCurrentKey := -1; + FItemIndex := -1; +end; + +function TcxCustomTextEditLookupData.CanResizeVisualArea(var NewSize: TSize; + AMaxHeight: Integer = 0; AMaxWidth: Integer = 0): Boolean; +begin + Result := True; +end; + +procedure TcxCustomTextEditLookupData.CloseUp; +begin + if not Edit.EditModeSetting then + InternalSetItemIndex(FCurrentKey); +end; + +procedure TcxCustomTextEditLookupData.Deinitialize; +begin +end; + +procedure TcxCustomTextEditLookupData.DropDown; +begin +end; + +procedure TcxCustomTextEditLookupData.DroppedDown(const AFindStr: string); +begin +end; + +function TcxCustomTextEditLookupData.Find(const AText: string): Boolean; +begin + Result := IndexOf(AText) <> -1; +end; + +function TcxCustomTextEditLookupData.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +procedure TcxCustomTextEditLookupData.DoCurrentKeyChanged; +begin + if Assigned(FOnCurrentKeyChanged) then + FOnCurrentKeyChanged(Self); +end; + +procedure TcxCustomTextEditLookupData.DoSelectItem; +begin + if Assigned(FOnSelectItem) then + FOnSelectItem(Self); +end; + +function TcxCustomTextEditLookupData.GetItem(Index: Integer): string; +begin + Result := ActiveProperties.FLookupItems[Index]; +end; + +function TcxCustomTextEditLookupData.GetItemCount: Integer; +begin + Result := ActiveProperties.FLookupItems.Count; +end; + +function TcxCustomTextEditLookupData.GetDisplayText(const AKey: TcxEditValue): string; +begin + if (AKey < 0) or (AKey >= GetItemCount) then + Result := '' + else + Result := GetItem(AKey); +end; + +function TcxCustomTextEditLookupData.GetListBoxClass: TcxCustomEditListBoxClass; +begin + Result := nil; +end; + +procedure TcxCustomTextEditLookupData.HandleSelectItem(Sender: TObject); +begin + FItemIndex := FList.ItemIndex; +end; + +function TcxCustomTextEditLookupData.InternalLocate(var AText, ATail: string; + ANext, ASynchronizeWithText: Boolean): Boolean; + + procedure CheckCurrentKey; + var + ACorrectCurrentKey: Boolean; + begin + case ActiveProperties.EditingStyle of + esEditList: + ACorrectCurrentKey := ASynchronizeWithText or (AText = ''); + esFixedList: + ACorrectCurrentKey := ASynchronizeWithText; + else + ACorrectCurrentKey := True; + end; + if ACorrectCurrentKey then + InternalSetCurrentKey(-1); + end; + +var + AItem: string; + AIStart, AItemIndex, I, L: Integer; + S: string; +begin + Result := False; + if GetItemCount = 0 then + begin + CheckCurrentKey; + Exit; + end; + + if ASynchronizeWithText and ActiveProperties.MRUMode then + begin + AItemIndex := IndexOf(AText); + if AItemIndex = -1 then + InternalSetCurrentKey(-1) + else + begin + Result := True; + ATail := ''; + InternalSetCurrentKey(AItemIndex); + end; + Exit; + end; + + if ANext then + AIStart := ItemIndex + else + AIStart := -1; + I := AIStart; + L := Length(AText); + repeat + Inc(I); + if (I = GetItemCount) or (I = AIStart) or (L = 0) then + Break; + + AItem := GetItem(I); + S := Copy(AItem, 1, L); + + if InternalCompareString(AText, S, False) then + begin + AText := S; + ATail := Copy(AItem, L + 1, Length(AItem) - L); + InternalSetCurrentKey(I); + Result := True; + Break; + end; + until Result; + + if not Result then + CheckCurrentKey; +end; + +function TcxCustomTextEditLookupData.GetVisualAreaPreferredSize(AMaxHeight: Integer; + AWidth: Integer = 0): TSize; +begin + Result := Size(0, 0); +end; + +procedure TcxCustomTextEditLookupData.Go(ADirection: TcxEditLookupDataGoDirection; + ACircular: Boolean); +var + ANewCurrentKey: Integer; + AItemIndex: Integer; +begin + if GetItemCount = 0 then + Exit; + ANewCurrentKey := 0; + if ItemIndex = -1 then + AItemIndex := CurrentKey + else + AItemIndex := ItemIndex; + case ADirection of + egdBegin: + ANewCurrentKey := 0; + egdEnd: + ANewCurrentKey := GetItemCount - 1; + egdPrev: + begin + ANewCurrentKey := AItemIndex - 1; + if (ANewCurrentKey < 0) then + if ACircular then + ANewCurrentKey := GetItemCount - 1 + else + ANewCurrentKey := AItemIndex; + end; + egdNext: + begin + ANewCurrentKey := AItemIndex + 1; + if (ANewCurrentKey = GetItemCount) then + if ACircular then + ANewCurrentKey := 0 + else + ANewCurrentKey := AItemIndex; + end; + egdPageUp: + if AItemIndex = -1 then + if ACircular then + ANewCurrentKey := GetItemCount - 1 + else + ANewCurrentKey := AItemIndex + else + begin + ANewCurrentKey := AItemIndex - ActiveProperties.GetDropDownPageRowCount + 1; + if (ANewCurrentKey < 0) then + if ACircular then + if AItemIndex = 0 then + ANewCurrentKey := GetItemCount - 1 + else + ANewCurrentKey := 0 + else + ANewCurrentKey := 0; + end; + egdPageDown: + begin + if AItemIndex = -1 then + ANewCurrentKey := AItemIndex + ActiveProperties.GetDropDownPageRowCount + else + ANewCurrentKey := AItemIndex + ActiveProperties.GetDropDownPageRowCount - 1; + if (ANewCurrentKey >= GetItemCount) then + if ACircular then + if AItemIndex = GetItemCount - 1 then + ANewCurrentKey := 0 + else + ANewCurrentKey := GetItemCount - 1 + else + ANewCurrentKey := GetItemCount - 1; + end; + end; + if (FList = nil) or not FList.IsVisible or + ActiveProperties.ImmediateUpdateText and Edit.DoEditing then + CurrentKey := ANewCurrentKey + else + InternalSetItemIndex(ANewCurrentKey); +end; + +procedure TcxCustomTextEditLookupData.Initialize(AVisualControlsParent: TWinControl); +begin + if (FList = nil) and (GetListBoxClass <> nil) then + FList := GetListBoxClass.Create(AVisualControlsParent); + with FList do + begin + Color := Edit.ActiveStyle.Color; + Font := Edit.ActiveStyle.GetVisibleFont; + Canvas.Font := Font; + Parent := AVisualControlsParent; + OnSelectItem := HandleSelectItem; + SetItemCount(GetItemCount); + ItemIndex := FItemIndex; + RecreateWindow; + end; + TextChanged; +end; + +procedure TcxCustomTextEditLookupData.InternalSetCurrentKey(Value: Integer); +begin + if (Value >= -1) and (Value < GetItemCount) then + begin + FCurrentKey := Value; + InternalSetItemIndex(Value); + end; +end; + +function TcxCustomTextEditLookupData.IsEmpty: Boolean; +begin + Result := GetItemCount = 0; +end; + +function TcxCustomTextEditLookupData.IsMouseOverList(const P: TPoint): Boolean; +begin + Result := PtInRect(FList.BoundsRect, FList.ScreenToClient(P)); +end; + +procedure TcxCustomTextEditLookupData.ListChanged; +begin + if FList <> nil then + FList.SetItemCount(GetItemCount); +end; + +procedure TcxCustomTextEditLookupData.SetListItemIndex(Value: Integer); +begin + FList.ItemIndex := Value; +end; + +function TcxCustomTextEditLookupData.Locate(var AText, ATail: string; + ANext: Boolean): Boolean; +begin + Result := InternalLocate(AText, ATail, ANext, False); +end; + +procedure TcxCustomTextEditLookupData.PositionVisualArea(const AClientRect: TRect); +begin + with AClientRect do + begin + FList.SetBounds(Left, Top, Right - Left, Bottom - Top); + if FList.HandleAllocated then + FList.SetScrollWidth(FList.ScrollWidth); + end; +end; + +procedure TcxCustomTextEditLookupData.PropertiesChanged; +begin + ListChanged; +end; + +procedure TcxCustomTextEditLookupData.SelectItem; +var + APrevCurrentKey: TcxEditValue; +begin + if (FItemIndex = -1) or (CurrentKey <> FItemIndex) and not Edit.DoEditing then + Exit; + APrevCurrentKey := CurrentKey; + CurrentKey := FItemIndex; + if VarEqualsExact(APrevCurrentKey, CurrentKey) then + DoSelectItem; +end; + +function TcxCustomTextEditLookupData.GetActiveControl: TControl; +begin + Result := FList; +end; + +function TcxCustomTextEditLookupData.GetCurrentKey: TcxEditValue; +begin + Result := FCurrentKey; +end; + +function TcxCustomTextEditLookupData.GetOnCurrentKeyChanged: TNotifyEvent; +begin + Result := FOnCurrentKeyChanged; +end; + +function TcxCustomTextEditLookupData.GetOnSelectItem: TNotifyEvent; +begin + Result := FOnSelectItem; +end; + +function TcxCustomTextEditLookupData.GetEdit: TcxCustomTextEdit; +begin + Result := TcxCustomTextEdit(FOwner); +end; + +function TcxCustomTextEditLookupData.GetItems: TStrings; +begin + Result := ActiveProperties.FLookupItems; +end; + +function TcxCustomTextEditLookupData.GetActiveProperties: TcxCustomTextEditProperties; +begin + Result := Edit.ActiveProperties; +end; + +function TcxCustomTextEditLookupData.IndexOf(const AText: string): Integer; +var + ACount, I: Integer; +begin + Result := -1; + ACount := GetItemCount; + for I := 0 to ACount - 1 do + if InternalCompareString(AText, GetItem(I), False) then + begin + Result := I; + Break; + end; +end; + +procedure TcxCustomTextEditLookupData.InternalSetItemIndex(Value: Integer); +begin + if (Value < -1) or (Value >= GetItemCount) or (Value = FItemIndex) and (Value <> -1) then + Exit; + if (FList <> nil) and (GetItemCount > 0) then + begin + if Value = -1 then + SetListItemIndex(0); + SetListItemIndex(Value); + end; + FItemIndex := Value; +end; + +procedure TcxCustomTextEditLookupData.SetCurrentKey(const AKey: TcxEditValue); +var + APrevCurrentKey: TcxEditValue; +begin + APrevCurrentKey := FCurrentKey; + InternalSetCurrentKey(AKey); + if Edit <> nil then + Edit.LockLookupDataTextChanged; + try + if not VarEqualsExact(APrevCurrentKey, FCurrentKey) or ((AKey >= 0) and (AKey < GetItemCount) and not InternalCompareString(Edit.Text, GetItem(AKey), True)) then + DoSelectItem; + finally + if Edit <> nil then + Edit.UnlockLookupDataTextChanged; + end; +end; + +procedure TcxCustomTextEditLookupData.SetItemIndex(Value: Integer); +begin + if (FList = nil) or not FList.IsVisible or ActiveProperties.ImmediateUpdateText then + CurrentKey := Value + else + InternalSetItemIndex(Value); +end; + +procedure TcxCustomTextEditLookupData.SetItems(Value: TStrings); +begin + ActiveProperties.FLookupItems.Assign(Value); +end; + +procedure TcxCustomTextEditLookupData.SetOnCurrentKeyChanged(Value: TNotifyEvent); +begin + FOnCurrentKeyChanged := Value; +end; + +procedure TcxCustomTextEditLookupData.SetOnSelectItem(Value: TNotifyEvent); +begin + FOnSelectItem := Value; +end; + +procedure TcxCustomTextEditLookupData.TextChanged; +var + AText, ATail: string; +begin + if Edit.EditModeSetting then + Exit; + AText := Edit.Text; + if (ItemIndex >= GetItemCount) or + not InternalCompareString(GetDisplayText(ItemIndex), AText, False) then + InternalLocate(AText, ATail, False, True); +end; + +{ TcxCustomTextEditViewData } + +procedure TcxCustomTextEditViewData.Calculate(ACanvas: TcxCanvas; const ABounds: TRect; + const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); +begin + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, AIsMouseEvent); + with AViewInfo as TcxCustomTextEditViewInfo do + begin + DrawSelectionBar := False; + EditingStyle := Properties.EditingStyle; + IsEditClass := GetIsEditClass; + if Edit <> nil then + TcxCustomTextEditViewInfo(AViewInfo).HasPopupWindow := Edit.HasPopupWindow + else + TcxCustomTextEditViewInfo(AViewInfo).HasPopupWindow := False; + CalculateTextEditViewInfo(ACanvas, Self, TcxCustomTextEditViewInfo(AViewInfo), AIsMouseEvent); + MaxLineCount := Self.GetMaxLineCount; + TextOutData.Initialized := False; + end; + PrepareDrawTextFlags(ACanvas, AViewInfo); +end; + +procedure TcxCustomTextEditViewData.DisplayValueToDrawValue(const ADisplayValue: TcxEditValue; + AViewInfo: TcxCustomEditViewInfo); +begin + with TcxCustomTextEditViewInfo(AViewInfo) do + begin + Text := ADisplayValue; + Properties.DisplayValueToDisplayText(Text); + end; +end; + +procedure TcxCustomTextEditViewData.EditValueToDrawValue(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; AViewInfo: TcxCustomEditViewInfo); +begin + if PreviewMode then + TcxCustomTextEditViewInfo(AViewInfo).Text := '' + else + TcxCustomTextEditViewInfo(AViewInfo).Text := + string(EditValueToDisplayText(AEditValue)); + PrepareSelection(AViewInfo); +end; + +function TcxCustomTextEditViewData.GetClientExtent(ACanvas: TcxCanvas; + AViewInfo: TcxCustomEditViewInfo): TRect; +begin + Result := inherited GetClientExtent(ACanvas, AViewInfo); + if not IsInplace and IsComboBoxStyle and + AreVisualStylesMustBeUsed(Style.LookAndFeel.NativeStyle, totEdit) then + Inc(Result.Right); +end; + +function TcxCustomTextEditViewData.GetDrawTextFlags: DWORD; +const + AHorzAlignmentFlags: array [TcxEditHorzAlignment] of DWORD = ( + CXTO_LEFT, CXTO_RIGHT, CXTO_CENTER_HORIZONTALLY + ); + AVertAlignmentFlags: array [TcxEditVertAlignment] of DWORD = ( + CXTO_TOP, CXTO_BOTTOM, CXTO_CENTER_VERTICALLY + ); +begin + Result := AHorzAlignmentFlags[HorzAlignment]; + Result := Result or AVertAlignmentFlags[VertAlignment]; + Result := Result or CXTO_SINGLELINE; + Result := Result or CXTO_PREVENT_LEFT_EXCEED or CXTO_PREVENT_TOP_EXCEED; +end; + +function TcxCustomTextEditViewData.GetDrawTextOffset: TRect; +begin + Result := GetTextEditDrawTextOffset(Self); +end; + +procedure TcxCustomTextEditViewData.PrepareSelection(AViewInfo: TcxCustomEditViewInfo); +var + ACustomTextEditViewInfo: TcxCustomTextEditViewInfo; +begin + ACustomTextEditViewInfo := TcxCustomTextEditViewInfo(AViewInfo); + ACustomTextEditViewInfo.SelStart := SelStart; + ACustomTextEditViewInfo.SelLength := SelLength; + if SelLength = 0 then + Exit; + if SelBackgroundColor = clDefault then + begin + if SelTextColor = clDefault then + begin + if Style.Color = clHighlight then + begin + ACustomTextEditViewInfo.SelBackgroundColor := clBlack; + ACustomTextEditViewInfo.SelTextColor := clWhite; + end + else + begin + ACustomTextEditViewInfo.SelBackgroundColor := clHighlight; + ACustomTextEditViewInfo.SelTextColor := clHighlightText; + end; + end + else + begin + ACustomTextEditViewInfo.SelTextColor := SelTextColor; + ACustomTextEditViewInfo.SelBackgroundColor := InvertColor(SelTextColor); + end; + end + else + begin + ACustomTextEditViewInfo.SelBackgroundColor := SelBackgroundColor; + if SelTextColor = clDefault then + ACustomTextEditViewInfo.SelTextColor := InvertColor(SelBackgroundColor) + else + ACustomTextEditViewInfo.SelTextColor := SelTextColor; + end; +end; + +procedure TcxCustomTextEditViewData.CalculateButtonNativeInfo(AButtonViewInfo: TcxEditButtonViewInfo); +begin + inherited CalculateButtonNativeInfo(AButtonViewInfo); + if NativeStyle and IsCompositionEnabled and not IsInplace and + (Properties.EditingStyle = esFixedList) and + AButtonViewInfo.Data.ComboBoxStyle and + (AButtonViewInfo.Data.NativeState <> CBXS_DISABLED) then + AButtonViewInfo.Data.NativeState := CBXS_NORMAL; +end; + +function TcxCustomTextEditViewData.GetIsEditClass: Boolean; +begin + Result := (Edit <> nil) and Edit.IsEditClass; +end; + +function TcxCustomTextEditViewData.GetMaxLineCount: Integer; +begin + Result := MaxLineCount; +end; + +procedure TcxCustomTextEditViewData.InitCacheData; +begin + inherited InitCacheData; + FIsValueEditorWithValueFormatting := Properties.IsValueEditorWithValueFormatting; +end; + +function TcxCustomTextEditViewData.InternalEditValueToDisplayText( + AEditValue: TcxEditValue): string; +begin + Result := ''; + try + if FIsValueEditorWithValueFormatting then + Result := VarToStr(AEditValue) + else + Result := Properties.GetDefaultDisplayValue(AEditValue, InternalFocused); + finally + Properties.DisplayValueToDisplayText(string(Result)); + end; +end; + +function TcxCustomTextEditViewData.InternalGetEditContentSize(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; const AEditSizeProperties: TcxEditSizeProperties): TSize; +var + AContentSize: TSize; +begin + AContentSize := inherited InternalGetEditContentSize(ACanvas, AEditValue, + AEditSizeProperties); + Result := GetTextEditContentSize(ACanvas, Self, + EditValueToDisplayText(AEditValue), GetDrawTextFlags, AEditSizeProperties); + CheckSize(Result, AContentSize); +end; + +function TcxCustomTextEditViewData.IsComboBoxStyle: Boolean; +begin + Result := False; +end; + +procedure TcxCustomTextEditViewData.PrepareDrawTextFlags(ACanvas: TcxCanvas; + AViewInfo: TcxCustomEditViewInfo); +begin + with TcxCustomTextEditViewInfo(AViewInfo) do + begin + if not Properties.IsMultiLine and (esoAutoHeight in Properties.GetSupportedOperations) and + (epoAutoHeight in Self.PaintOptions) then + PrepareTextEditDrawTextFlags(ACanvas, Self, TcxCustomTextEditViewInfo(AViewInfo)) + else + DrawTextFlags := GetDrawTextFlags; + if epoShowEndEllipsis in PaintOptions then + DrawTextFlags := DrawTextFlags or CXTO_END_ELLIPSIS; + ComboBoxStyle := IsComboBoxStyle; + end; +end; + +function TcxCustomTextEditViewData.GetProperties: TcxCustomTextEditProperties; +begin + Result := TcxCustomTextEditProperties(FProperties); +end; + +function TcxCustomTextEditViewData.InvertColor(AColor: TColor): TColor; +begin + Result := ColorToRGB(AColor) xor $FFFFFF; +end; + +{ TcxCustomTextEditViewInfo } + +destructor TcxCustomTextEditViewInfo.Destroy; +begin + TextOutData.TextRows := nil; + inherited Destroy; +end; + +function TcxCustomTextEditViewInfo.NeedShowHint(ACanvas: TcxCanvas; + const P: TPoint; const AVisibleBounds: TRect; out AText: TCaption; + out AIsMultiLine: Boolean; out ATextRect: TRect): Boolean; + + function GetRealVisibleBounds: TRect; + begin + Result := AVisibleBounds; + if EqualRect(Result, cxEmptyRect) then + Result := TextRect + else + begin + OffsetRect(Result, -Left, -Top); + IntersectRect(Result, TextRect, Result); + end; + end; + + function IsMultiLine(ATextFlags: DWORD): Boolean; + begin + Result := (ATextFlags and CXTO_SINGLELINE = 0) and (ATextFlags and CXTO_WORDBREAK <> 0); + end; + + function GetTextFlags: Integer; + begin + Result := DrawTextFlags and not(CXTO_CENTER_VERTICALLY or CXTO_BOTTOM) or + CXTO_TOP or CXTO_CALCROWCOUNT; + end; + + function IsTextNotFullyVisible(const ARealVisibleBounds: TRect): Boolean; + var + AFlags: Integer; + ARowCount: Integer; + ARowText: string; + ASize: TSize; + ATextRows: TcxTextRows; + ATextWidth, ATextBottom: Integer; + I, L: Integer; + R: TRect; + begin + ACanvas.Font := Font; + AFlags := GetTextFlags; + R := TextRect; + if not IsMultiLine(AFlags) then + R.Right := MaxInt div 2; + R.Bottom := MaxInt div 2; + ATextRows := nil; + Result := not cxMakeTextRows(ACanvas.Canvas, + PcxCaptionChar(Text), + R, cxCalcTextParams(ACanvas.Canvas, AFlags), ATextRows, ARowCount, MaxLineCount); + if not Result then + begin + L := R.Left; + ATextWidth := R.Right - R.Left; + ATextBottom := TextRect.Top; + for I := 0 to ARowCount - 1 do + begin + ARowText := TrimRight(Copy(ATextRows[I].Text, 1, ATextRows[I].TextLength)); + if ARowText = '' then + ASize := Size(0, ACanvas.TextHeight('Zg')) + else + GetTextExtentPoint32(ACanvas.Handle, PAnsiChar(ARowText), Length(ARowText), ASize); + Inc(ATextBottom, ASize.cy); + if (ASize.cx > ATextWidth) or (L + ASize.cx > ARealVisibleBounds.Right) + or (ATextBottom > ARealVisibleBounds.Bottom) then + begin + Result := True; + Break; + end; + end; + end; + end; + +var + ARealVisibleBounds: TRect; +begin + ARealVisibleBounds := GetRealVisibleBounds; + Result := PtInRect(ARealVisibleBounds, Point(P.X - Left, P.Y - Top)) and + IsTextNotFullyVisible(ARealVisibleBounds); + if Result then + begin + AIsMultiLine := IsMultiLine(GetTextFlags); + AText := Text; + ATextRect := TextRect; + OffsetRect(ATextRect, Left, Top); + end; +end; + +procedure TcxCustomTextEditViewInfo.Offset(DX, DY: Integer); +var + I: Integer; +begin + inherited Offset(DX, DY); + OffsetRect(TextRect, DX, DY); + with TextOutData do + if Initialized then + begin + OffsetRect(TextRect, DX, DY); + for I := 0 to Length(TextRows) - 1 do + with TextRows[I] do + begin + TextOriginX := TextOriginX + DX; + TextOriginY := TextOriginY + DY; + end; + end; +end; + +procedure TcxCustomTextEditViewInfo.DrawText(ACanvas: TcxCanvas); +begin + DrawEditText(ACanvas, Self); +end; + +{$IFDEF DELPHI10} +function TcxCustomTextEditViewInfo.GetTextBaseLine: Integer; +var + ACanvas: TcxScreenCanvas; + ATextMetric: TTextMetric; +begin + ACanvas := TcxScreenCanvas.Create; + try + ACanvas.Font := Font; + GetTextMetrics(ACanvas.Handle, ATextMetric); + case EditProperties.Alignment.Vert of + taTopJustify: + Result := TextRect.Top + ATextMetric.tmAscent + 1; + taBottomJustify: + Result := TextRect.Bottom - ATextMetric.tmDescent + 1; + else + Result := TextRect.Top + (TextRect.Bottom - TextRect.Top - ATextMetric.tmHeight) div 2 + ATextMetric.tmAscent + 1; + end; + finally + ACanvas.Free; + end; +end; +{$ENDIF} + +procedure TcxCustomTextEditViewInfo.InternalPaint(ACanvas: TcxCanvas); +begin + DrawTextEdit(ACanvas, Self); +end; + +{ TcxCustomTextEditProperties } + +constructor TcxCustomTextEditProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FCharCase := ecNormal; + FEchoMode := eemNormal; + FFixedListSelection := True; + FHideSelection := True; + FImeMode := imDontCare; + FIncrementalSearch := True; + FLookupItems := TStringList.Create; + FLookupItems.Duplicates := dupAccept; + FLookupItems.OnChange := LookupItemsChanged; + cxFormatController.AddListener(Self); +end; + +destructor TcxCustomTextEditProperties.Destroy; +begin + cxFormatController.RemoveListener(Self); + FreeAndNil(FLookupItems); + inherited Destroy; +end; + +procedure TcxCustomTextEditProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomTextEditProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with Source as TcxCustomTextEditProperties do + begin + Self.CharCase := CharCase; + Self.EchoMode := EchoMode; + Self.FixedListSelection := FixedListSelection; + Self.HideCursor := HideCursor; + Self.HideSelection := HideSelection; + Self.ImmediateUpdateText := ImmediateUpdateText; + Self.IncrementalSearch := IncrementalSearch; + Self.MRUMode := MRUMode; + Self.ValidChars := ValidChars; + + Self.LookupItemsSorted := False; + Self.LookupItems.Assign(LookupItems); + Self.LookupItemsSorted := LookupItemsSorted; + + Self.AssignedValues.DisplayFormat := False; + if AssignedValues.DisplayFormat then + Self.DisplayFormat := DisplayFormat; + + Self.AssignedValues.EditFormat := False; + if AssignedValues.EditFormat then + Self.EditFormat := EditFormat; + + Self.AssignedValues.MaxLength := False; + if AssignedValues.MaxLength then + Self.MaxLength := MaxLength; + + Self.OEMConvert := OEMConvert; + Self.ImeMode := ImeMode; + Self.ImeName := ImeName; + Self.PasswordChar := PasswordChar; + Self.UseDisplayFormatWhenEditing := UseDisplayFormatWhenEditing; + Self.OnNewLookupDisplayText := OnNewLookupDisplayText; + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +function TcxCustomTextEditProperties.CanCompareEditValue: Boolean; +begin + Result := True; +end; + +function TcxCustomTextEditProperties.CompareDisplayValues( + const AEditValue1, AEditValue2: TcxEditValue): Boolean; +var + AText1, AText2: string; +begin + AText1 := GetDisplayText(AEditValue1, True); + AText2 := GetDisplayText(AEditValue2, True); + Result := InternalCompareString(AText1, AText2, True); +end; + +class function TcxCustomTextEditProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxTextEdit; +end; + +function TcxCustomTextEditProperties.GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; +var + AText: string; +begin + AText := ''; + try + if IsValueEditorWithValueFormatting then + AText := VarToStr(AEditValue) + else + AText := GetDefaultDisplayValue(AEditValue, + not AIsInplace and not IsEditValueConversionDependOnFocused); + finally + DisplayValueToDisplayText(AText); + Result := AText; + end; +end; + +function TcxCustomTextEditProperties.GetSupportedOperations: TcxEditSupportedOperations; +begin + Result := inherited GetSupportedOperations + [esoAutoHeight, esoEditing, + esoFiltering, esoHorzAlignment, esoIncSearch, esoSorting]; +end; + +class function TcxCustomTextEditProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxCustomTextEditViewInfo; +end; + +function TcxCustomTextEditProperties.IsEditValueValid(var EditValue: TcxEditValue; AEditFocused: Boolean): Boolean; +begin + Result := VarIsNull(EditValue) or not VarIsStr(EditValue) or + IsDisplayValueValid(EditValue, AEditFocused); +end; + +procedure TcxCustomTextEditProperties.PrepareDisplayValue(const AEditValue: TcxEditValue; + var DisplayValue: TcxEditValue; AEditFocused: Boolean); + + procedure InternalPrepareDisplayValue(AValue: Variant); + + var + AEditFormat: string; + AIsCurrency, AIsOnGetTextAssigned: Boolean; + S: string; +{$IFDEF DELPHI6} + APrecision: Integer; + V: TBcd; +{$ENDIF} + begin + if AEditFocused then + begin + AEditFormat := InternalGetEditFormat(AIsCurrency, AIsOnGetTextAssigned); + +{$IFDEF DELPHI6} + if IDefaultValuesProvider = nil then + APrecision := cxEditDefaultPrecision + else + APrecision := IDefaultValuesProvider.DefaultPrecision; +{$ENDIF} + + if AIsCurrency then +{$IFDEF DELPHI6} + begin + DisplayValue := VarToStr(AValue); + if TryStrToBcd(DisplayValue, V) then + DisplayValue := BcdToStrF(V, ffFixed, APrecision, CurrencyDecimals); + end +{$ELSE} + DisplayValue := FloatToStrF(AValue, ffFixed, cxEditDefaultPrecision, CurrencyDecimals) +{$ENDIF} + else + if AEditFormat = '' then + begin +{$IFDEF DELPHI6} + S := VarToStr(AValue); + if TryStrToBcd(S, V) then + S := BcdToStrF(V, ffGeneral, APrecision, 0); +{$ELSE} + S := FloatToStrF(AValue, ffGeneral, cxEditDefaultPrecision, 0); +{$ENDIF} + if HasDigitGrouping(False) then + InsertThousandSeparator(S); + DisplayValue := S; + end + else + DisplayValue := FormatFloat(AEditFormat, AValue); + end + else + if DisplayFormat <> '' then + DisplayValue := FormatFloat(DisplayFormat, AValue) + else + DisplayValue := VarToStr(AValue); + end; + +begin + if IsEditValueNumeric then + begin + if VarIsSoftNull(AEditValue) then + DisplayValue := '' + else + if not VarIsNumericEx(AEditValue) and not VarIsStr(AEditValue) then + raise EConvertError.CreateFmt(cxGetResourceString(@cxSEditNumericValueConvertError), []) + else + InternalPrepareDisplayValue(AEditValue); + end + else + if VarIsArray(AEditValue) then + DisplayValue := '' + else + DisplayValue := VarToStr(AEditValue); +end; + +procedure TcxCustomTextEditProperties.ValidateDisplayValue(var DisplayValue: TcxEditValue; + var ErrorText: TCaption; var Error: Boolean; AEdit: TcxCustomEdit); +begin + if IsEditValueNumeric and IsValueBoundsDefined then + CheckEditorValueBounds(DisplayValue, ErrorText, Error, AEdit); + inherited ValidateDisplayValue(DisplayValue, ErrorText, Error, AEdit); +end; + +procedure TcxCustomTextEditProperties.DisplayValueToDisplayText( + var ADisplayValue: string); + + function GetPasswordChar: TCaptionChar; + begin + if PasswordChar = #0 then + Result := '*' + else + Result := PasswordChar; + end; + +begin + if EchoMode <> eemNormal then + ADisplayValue := StringOfChar(GetPasswordChar, Length(ADisplayValue)) + else + if CharCase <> ecNormal then + CheckCharsRegister(ADisplayValue, CharCase); +end; + +function TcxCustomTextEditProperties.IsDisplayValueValid(var DisplayValue: TcxEditValue; AEditFocused: Boolean): Boolean; +var + AText: string; +begin + AText := VarToStr(DisplayValue); + Result := not((AText <> '') and (EditingStyle in [esEditList, esFixedList]) and + UseLookupData and not FindLookupText(AText)); + if Result then + begin + CheckCharsRegister(AText, CharCase); + DisplayValue := AText; + end; +end; + +procedure TcxCustomTextEditProperties.SetMinMaxValues(AMinValue, AMaxValue: Double); +begin + FillMinMaxValues(AMinValue, AMaxValue); +end; + +procedure TcxCustomTextEditProperties.AlignmentChangedHandler(Sender: TObject); +begin + BeginUpdate; + try + inherited AlignmentChangedHandler(Sender); + finally + EndUpdate; + end; +end; + +procedure TcxCustomTextEditProperties.BaseSetAlignment(Value: TcxEditAlignment); +begin + BeginUpdate; + try + inherited BaseSetAlignment(Value); + finally + EndUpdate; + end; +end; + +function TcxCustomTextEditProperties.CanValidate: Boolean; +begin + Result := True; +end; + +// obsolete +procedure TcxCustomTextEditProperties.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('IsDisplayFormatAssigned', ReadIsDisplayFormatAssigned, + nil, False); +end; + +class function TcxCustomTextEditProperties.GetAssignedValuesClass: TcxCustomEditPropertiesValuesClass; +begin + Result := TcxTextEditPropertiesValues; +end; + +function TcxCustomTextEditProperties.GetDisplayFormatOptions: TcxEditDisplayFormatOptions; +begin + Result := [dfoSupports]; +end; + +function TcxCustomTextEditProperties.GetValidateErrorText(AErrorKind: TcxEditErrorKind): string; +begin + if AErrorKind = ekValueOutOfBounds then + Result := cxGetResourceString(@cxSEditValueOutOfBounds) + else + Result := inherited GetValidateErrorText(AErrorKind); +end; + +class function TcxCustomTextEditProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxCustomTextEditViewData; +end; + +function TcxCustomTextEditProperties.GetEditingStyle: TcxEditEditingStyle; +begin + if FHideCursor then + Result := esNoEdit + else + Result := esEdit; +end; + +class function TcxCustomTextEditProperties.GetLookupDataClass: TcxInterfacedPersistentClass; +begin + Result := TcxCustomTextEditLookupData; +end; + +function TcxCustomTextEditProperties.HasDigitGrouping( + AIsDisplayValueSynchronizing: Boolean): Boolean; +begin + Result := False; +end; + +function TcxCustomTextEditProperties.GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; +begin + Result := evsText; +end; + +function TcxCustomTextEditProperties.HasDisplayValue: Boolean; +begin + Result := True; +end; + +procedure TcxCustomTextEditProperties.FormatChanged; +begin + FFormatChanging := True; + try + Changed; + finally + FFormatChanging := False; + end; +end; + +function TcxCustomTextEditProperties.IsResetEditClass: Boolean; +begin + Result := EditingStyle <> esNoEdit; +end; + +function TcxCustomTextEditProperties.CanIncrementalSearch: Boolean; +begin + Result := (EditingStyle = esEdit) and IncrementalSearch or + (EditingStyle in [esEditList, esFixedList]) +end; + +procedure TcxCustomTextEditProperties.CheckEditorValueBounds(var DisplayValue: TcxEditValue; + var ErrorText: TCaption; var Error: Boolean; AEdit: TcxCustomEdit); +var + AEditValue: TcxEditValue; +begin + AEdit.PrepareEditValue(DisplayValue, AEditValue, AEdit.InternalFocused); + if (VarIsNumericEx(AEditValue) or VarIsDate(AEditValue)) and + (IsValueBoundDefined(evbMin) and (AEditValue < MinValue) or + IsValueBoundDefined(evbMax) and (AEditValue > MaxValue)) then + begin + Error := True; + ErrorText := GetValidateErrorText(ekValueOutOfBounds); + end; +end; + +function TcxCustomTextEditProperties.DefaultFocusedDisplayValue: TcxEditValue; +begin + Result := ''; +end; + +function TcxCustomTextEditProperties.FindLookupText(const AText: string): Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to FLookupItems.Count - 1 do + if InternalCompareString(AText, FLookupItems[I], False) then + begin + Result := True; + Break; + end; +end; + +function TcxCustomTextEditProperties.GetDefaultDisplayFormat: string; +begin + Result := ''; +end; + +function TcxCustomTextEditProperties.GetDefaultDisplayValue(const AEditValue: TcxEditValue; + AEditFocused: Boolean): TcxEditValue; +var + AValue: TcxEditValue; +begin + AValue := AEditValue; + if IsEditValueValid(AValue, AEditFocused) then + PrepareDisplayValue(AValue, Result, AEditFocused) + else + if VarIsDate(AEditValue) then + Result := DateTimeToStr(AEditValue) + else + Result := VarToStr(AEditValue) +end; + +function TcxCustomTextEditProperties.GetDefaultMaxLength: Integer; +begin + if IDefaultValuesProvider = nil then + Result := 0 + else + Result := IDefaultValuesProvider.DefaultMaxLength; +end; + +function TcxCustomTextEditProperties.GetDropDownPageRowCount: Integer; +begin + Result := cxEditDefaultDropDownPageRowCount; +end; + +function TcxCustomTextEditProperties.InternalGetEditFormat( + out AIsCurrency, AIsOnGetTextAssigned: Boolean; + AEdit: TcxCustomTextEdit = nil): string; +begin + AIsCurrency := False; + AIsOnGetTextAssigned := False; + Result := ''; + if AssignedValues.EditFormat then + Result := FEditFormat + else + begin + if not ((AEdit <> nil) and AEdit.IsInplace) and (IDefaultValuesProvider <> nil) and + IDefaultValuesProvider.IsOnGetTextAssigned then + begin + AIsOnGetTextAssigned := True; + Exit; + end; + if (IDefaultValuesProvider <> nil) and + (IDefaultValuesProvider.DefaultEditFormat <> '') then + Result := IDefaultValuesProvider.DefaultEditFormat + else + begin + if AssignedValues.DisplayFormat then + Result := DisplayFormat + else + if (IDefaultValuesProvider <> nil) and (IDefaultValuesProvider.DefaultDisplayFormat <> '') then + Result := IDefaultValuesProvider.DefaultDisplayFormat + else + if GetDefaultDisplayFormat <> '' then + Result := GetDefaultDisplayFormat + else + if IDefaultValuesProvider <> nil then + AIsCurrency := not(dfoNoCurrencyValue in DisplayFormatOptions) and + IDefaultValuesProvider.IsCurrency; + if not UseDisplayFormatWhenEditing then + Result := ''; + end; + end; +end; + +function TcxCustomTextEditProperties.IsEditValueNumeric: Boolean; +begin + Result := False; +end; + +function TcxCustomTextEditProperties.IsLookupDataVisual: Boolean; +begin + Result := False; +end; + +function TcxCustomTextEditProperties.IsMultiLine: Boolean; +begin + Result := False; +end; + +function TcxCustomTextEditProperties.IsPopupKey(Key: Word; Shift: TShiftState): Boolean; +begin + Result := False; +end; + +function TcxCustomTextEditProperties.IsValueBoundDefined( + ABound: TcxEditValueBound): Boolean; +begin + if Integer(AssignedValues.MinValue) + Integer(AssignedValues.MaxValue) = 1 then + Result := (ABound = evbMin) and AssignedValues.MinValue or + (ABound = evbMax) and AssignedValues.MaxValue + else + Result := MinValue < MaxValue; +end; + +function TcxCustomTextEditProperties.IsValueBoundsDefined: Boolean; +begin + Result := IsValueBoundDefined(evbMin) or IsValueBoundDefined(evbMax); +end; + +procedure TcxCustomTextEditProperties.LookupDataChanged(Sender: TObject); +begin + Changed; +end; + +procedure TcxCustomTextEditProperties.MaxLengthChanged; +begin + Changed; +end; + +procedure TcxCustomTextEditProperties.SetCharCase(Value: TEditCharCase); +begin + if Value <> FCharCase then + begin + FCharCase := Value; + Changed; + end; +end; + +function TcxCustomTextEditProperties.UseLookupData: Boolean; +begin + Result := GetLookupDataClass <> nil; +end; + +function TcxCustomTextEditProperties.GetAssignedValues: TcxTextEditPropertiesValues; +begin + Result := TcxTextEditPropertiesValues(FAssignedValues); +end; + +function TcxCustomTextEditProperties.GetDisplayFormat: string; +begin + if AssignedValues.DisplayFormat then + Result := FDisplayFormat + else + if (IDefaultValuesProvider = nil) or + (IDefaultValuesProvider.DefaultDisplayFormat = '') then + Result := GetDefaultDisplayFormat + else + Result := IDefaultValuesProvider.DefaultDisplayFormat; +end; + +function TcxCustomTextEditProperties.GetEditFormat: string; +var + A: Boolean; +begin + Result := InternalGetEditFormat(A, A); +end; + +function TcxCustomTextEditProperties.GetInnerEditMaxLength: Integer; +begin + Result := GetMaxLength; +end; + +function TcxCustomTextEditProperties.GetLookupItems: TStrings; +begin + Result := FLookupItems; +end; + +function TcxCustomTextEditProperties.GetLookupItemsSorted: Boolean; +begin + Result := FLookupItems.Sorted; +end; + +function TcxCustomTextEditProperties.GetMaxLength: Integer; +begin + if AssignedValues.MaxLength then + Result := FMaxLength + else + Result := GetDefaultMaxLength; +end; + +function TcxCustomTextEditProperties.GetViewStyle: TcxTextEditViewStyle; +const + AViewStyleMap: array[TcxEditButtonsViewStyle] of TcxTextEditViewStyle = + (vsNormal, vsButtonsOnly, vsButtonsAutoWidth); +begin + if ButtonsViewStyle <> bvsNormal then + Result := AViewStyleMap[ButtonsViewStyle] + else + if HideCursor then + Result := vsHideCursor + else + Result := vsNormal; +end; + +function TcxCustomTextEditProperties.IsDisplayFormatStored: Boolean; +begin + Result := AssignedValues.DisplayFormat; +end; + +function TcxCustomTextEditProperties.IsEditFormatStored: Boolean; +begin + Result := AssignedValues.EditFormat; +end; + +function TcxCustomTextEditProperties.IsMaxLengthStored: Boolean; +begin + Result := AssignedValues.MaxLength; +end; + +procedure TcxCustomTextEditProperties.LookupItemsChanged(Sender: TObject); +begin + Changed; +end; + +procedure TcxCustomTextEditProperties.ReadIsDisplayFormatAssigned(Reader: TReader); +begin + AssignedValues.DisplayFormat := Reader.ReadBoolean; +end; + +procedure TcxCustomTextEditProperties.SetDisplayFormat(const Value: string); +begin + if AssignedValues.DisplayFormat and (Value = FDisplayFormat) then + Exit; + + AssignedValues.FDisplayFormat := True; + FDisplayFormat := Value; + Changed; +end; + +// obsolete +procedure TcxCustomTextEditProperties.SetAssignedValues( + Value: TcxTextEditPropertiesValues); +begin + FAssignedValues.Assign(Value); +end; + +procedure TcxCustomTextEditProperties.SetEchoMode(Value: TcxEditEchoMode); +begin + if Value <> FEchoMode then + begin + FEchoMode := Value; + Changed; + end; +end; + +procedure TcxCustomTextEditProperties.SetEditFormat(const Value: string); +begin + if AssignedValues.EditFormat and (Value = FEditFormat) then + Exit; + + AssignedValues.FEditFormat := True; + FEditFormat := Value; + Changed; +end; + +procedure TcxCustomTextEditProperties.SetFixedListSelection(Value: Boolean); +begin + if Value <> FFixedListSelection then + begin + FFixedListSelection := Value; + if EditingStyle = esFixedList then + Changed; + end; +end; + +procedure TcxCustomTextEditProperties.SetHideCursor(Value: Boolean); +begin + if Value <> FHideCursor then + begin + FHideCursor := Value; + Changed; + end; +end; + +procedure TcxCustomTextEditProperties.SetHideSelection(Value: Boolean); +begin + if Value <> FHideSelection then + begin + FHideSelection := Value; + Changed; + end; +end; + +procedure TcxCustomTextEditProperties.SetImeMode(Value: TImeMode); +begin + if FImeMode <> Value then + begin + FImeMode := Value; + Changed; + end; +end; + +procedure TcxCustomTextEditProperties.SetImeName(const Value: TImeName); +begin + if FImeName <> Value then + begin + FImeName := Value; + Changed; + end; +end; + +procedure TcxCustomTextEditProperties.SetIncrementalSearch(Value: Boolean); +begin + if Value <> FIncrementalSearch then + begin + FIncrementalSearch := Value; + Changed; + end; +end; + +procedure TcxCustomTextEditProperties.SetLookupItems(Value: TStrings); +begin + FLookupItems.Assign(Value); +end; + +procedure TcxCustomTextEditProperties.SetLookupItemsSorted(Value: Boolean); +begin + FLookupItems.Sorted := Value; +end; + +procedure TcxCustomTextEditProperties.SetMaxLength(Value: Integer); +begin + if Value < 0 then + Value := 0; + if AssignedValues.MaxLength and (Value = FMaxLength) then + Exit; + + AssignedValues.FMaxLength := True; + FMaxLength := Value; + MaxLengthChanged; +end; + +procedure TcxCustomTextEditProperties.SetMRUMode(Value: Boolean); +begin + if Value <> FMRUMode then + begin + FMRUMode := Value; + Changed; + end; +end; + +procedure TcxCustomTextEditProperties.SetOEMConvert(Value: Boolean); +begin + if Value <> FOEMConvert then + begin + FOEMConvert := Value; + Changed; + end; +end; + +procedure TcxCustomTextEditProperties.SetPasswordChar(Value: TCaptionChar); +begin + if Value <> FPasswordChar then + begin + FPasswordChar := Value; + Changed; + end; +end; + +procedure TcxCustomTextEditProperties.SetUseDisplayFormatWhenEditing( + Value: Boolean); +begin + if Value <> FUseDisplayFormatWhenEditing then + begin + FUseDisplayFormatWhenEditing := Value; + Changed; + end; +end; + +procedure TcxCustomTextEditProperties.SetViewStyle(Value: TcxTextEditViewStyle); +const + AButtonsViewStyleMap: array[TcxTextEditViewStyle] of TcxEditButtonsViewStyle = + (bvsNormal, bvsNormal, bvsButtonsOnly, bvsButtonsAutoWidth); +begin + if Value <> ViewStyle then + begin + BeginUpdate; + try + ButtonsViewStyle := AButtonsViewStyleMap[Value]; + HideCursor := Value <> vsNormal; + finally + EndUpdate; + end; + end; +end; + +{ TcxCustomTextEdit } + +{$IFDEF CBUILDER10} +constructor TcxCustomTextEdit.Create(AOwner: TComponent); +begin + inherited Create(AOwner); +end; +{$ENDIF} + +destructor TcxCustomTextEdit.Destroy; +begin + FText := Text; + cxFormatController.RemoveListener(Self); + FreeAndNil(FLookupData); + inherited Destroy; +end; + +procedure TcxCustomTextEdit.Activate(var AEditData: TcxCustomEditData); +begin + inherited Activate(AEditData); + if HandleAllocated then + begin + SelStart := 0; + if ActiveProperties.AutoSelect then + SelectAll; + end; +end; + +class function TcxCustomTextEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomTextEditProperties; +end; + +procedure TcxCustomTextEdit.CopyToClipboard; +begin + if ActiveProperties.EditingStyle in [esFixedList, esNoEdit] then + SelectAll; + if SelLength > 0 then + InnerTextEdit.CopyToClipboard; +end; + +procedure TcxCustomTextEdit.CutToClipboard; +var + ANewSelStart: Integer; + ANewText, S: string; + APrevKeyboardAction: Boolean; +begin + if SelLength = 0 then + Exit; + if Focused then + begin + APrevKeyboardAction := KeyboardAction; + KeyboardAction := True; + try + S := ''; + if CanChangeSelText(S, ANewText, ANewSelStart) then + InnerEdit.CallDefWndProc(WM_CUT, 0, 0); + finally + KeyboardAction := APrevKeyboardAction; + end; + end + else + begin + InnerTextEdit.CopyToClipboard; + SelText := ''; + end; +end; + +function TcxCustomTextEdit.IsEditClass: Boolean; +begin + if FHideInnerEdit or FShowInnerEdit then + begin + Result := not FHideInnerEdit and FShowInnerEdit; + Exit; + end; + + Result := (ActiveProperties.EditingStyle in [esEdit, esEditList]) + and not PropertiesChangeLocked and not IsDesigning; +end; + +procedure TcxCustomTextEdit.PasteFromClipboard; +var + ANewSelStart: Integer; + ANewText, S: string; + APrevKeyboardAction: Boolean; +begin + if Clipboard.HasFormat(CF_TEXT) then + if Focused then + begin + APrevKeyboardAction := KeyboardAction; + KeyboardAction := True; + try + S := Clipboard.AsText; + if CanChangeSelText(S, ANewText, ANewSelStart) then + InnerEdit.CallDefWndProc(WM_PASTE, 0, 0); + finally + KeyboardAction := APrevKeyboardAction; + end; + end + else + SelText := Clipboard.AsText; +end; + +procedure TcxCustomTextEdit.PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); +begin + EditValue := ADisplayValue; +end; + +procedure TcxCustomTextEdit.SelectAll; +begin + InnerTextEdit.SelectAll; +end; + +{$IFDEF DELPHI10} +function TcxCustomTextEdit.GetTextBaseLine: Integer; +begin + Result := ViewInfo.GetTextBaseLine; +end; + +function TcxCustomTextEdit.HasTextBaseLine: Boolean; +begin + Result := True; +end; +{$ENDIF} + +procedure TcxCustomTextEdit.ClearSelection; +var + APrevKeyboardAction: Boolean; + APrevSelStart: Integer; + AText: string; +begin + if SelLength = 0 then + Exit; + APrevKeyboardAction := KeyboardAction; + KeyboardAction := Focused; + try + AText := DisplayValue; + Delete(AText, SelStart + 1, SelLength); + APrevSelStart := SelStart; + if SetDisplayText(AText) then + SelStart := APrevSelStart; + finally + KeyboardAction := APrevKeyboardAction; + end; +end; + +procedure TcxCustomTextEdit.SetSelection(ASelStart: Integer; ASelLength: Integer); +begin + SelStart := ASelStart; + SelLength := ASelLength; +end; + +procedure TcxCustomTextEdit.Undo; +begin + Reset; +end; + +procedure TcxCustomTextEdit.AdjustInnerEditPosition; +var + AInnerEditBounds: TRect; + AInnerEditHeight, AInnerEditTop: Integer; + R: TRect; +begin + if (InnerTextEdit = nil) or FInnerEditPositionAdjusting then + Exit; + FInnerEditPositionAdjusting := True; + try + AInnerEditHeight := GetInnerEditHeight; + AInnerEditTop := 0; + R := ViewInfo.ClientRect; + case TcxCustomTextEditProperties(ActiveProperties).Alignment.Vert of + taTopJustify: + AInnerEditTop := R.Top + ContentParams.Offsets.Top; + taBottomJustify: + AInnerEditTop := R.Bottom - AInnerEditHeight - ContentParams.Offsets.Bottom; + taVCenter: + AInnerEditTop := R.Top + ContentParams.Offsets.Top + (R.Bottom - R.Top - AInnerEditHeight - ContentParams.Offsets.Top - ContentParams.Offsets.Bottom) div 2; + end; + if AInnerEditTop < R.Top + ContentParams.Offsets.Top then + AInnerEditTop := R.Top + ContentParams.Offsets.Top; + with ContentParams.Offsets do + AInnerEditBounds := Rect(R.Left + Left, AInnerEditTop, + R.Right - R.Left + 1 - (Left + Right), AInnerEditHeight); + with AInnerEditBounds do + if not EqualRect(InnerEdit.Control.BoundsRect, Rect(Left, Top, Left + Right, Top + Bottom)) then + InnerEdit.Control.SetBounds(Left, Top, Right, Bottom); + if IsInplace then + begin + Inc(R.Top); + Dec(R.Bottom); + end; + if not IsInplace and (ViewInfo.NativeState <> TC_NONE) and + ViewInfo.ComboBoxStyle and (ActiveProperties.EditingStyle in [esEdit, esEditList]) then + begin + Dec(R.Right); + Dec(R.Bottom); + end; + AlignControls(InnerEdit.Control, R); + finally + FInnerEditPositionAdjusting := False; + end; +end; + +function TcxCustomTextEdit.CanKeyDownModifyEdit(Key: Word; Shift: TShiftState): Boolean; +begin + Result := inherited CanKeyDownModifyEdit(Key, Shift); + Result := Result or (Key = VK_DELETE); + if ActiveProperties.UseLookupData and not ILookupData.IsEmpty and + GetScrollLookupDataList(escKeyboard) then + case Key of + VK_DOWN, VK_UP: + Result := not(ssAlt in Shift) and not HasPopupWindow; + VK_PRIOR, VK_NEXT: + Result := not HasPopupWindow; + end; +end; + +function TcxCustomTextEdit.CanKeyPressModifyEdit(Key: Char): Boolean; +begin + Result := (Key = #8) or (Key = #22) or (Key = #24) or IsTextChar(Key); +end; + +procedure TcxCustomTextEdit.ChangeHandler(Sender: TObject); +begin + LockChangeEvents(True); + try + inherited ChangeHandler(Sender); + if not ViewInfo.IsEditClass then + UpdateDrawValue; + if Focused and ActiveProperties.IsEditValueNumeric and + ActiveProperties.HasDigitGrouping(FIsDisplayValueSynchronizing) then + SeparateDigitGroups(Self); + finally + LockChangeEvents(False); + end; +end; + +procedure TcxCustomTextEdit.DoEditKeyDown(var Key: Word; Shift: TShiftState); +var + AEditingStyle: TcxEditEditingStyle; + AFindSelection: Boolean; + APrevCurrentKey: TcxEditValue; + APrevKey: Word; +begin + AEditingStyle := ActiveProperties.EditingStyle; + if (AEditingStyle = esFixedList) and not IsSpecialKey(Key, Shift) then + case Key of + VK_LEFT, VK_RIGHT, VK_DELETE: + begin + FindSelection := False; + DoAfterKeyDown(Key, Shift); + Key := 0; + end; + end; + + InnerTextEdit.InternalUpdating := True; + APrevKey := Key; + AFindSelection := FindSelection; + inherited DoEditKeyDown(Key, Shift); + if (TranslateKey(APrevKey) = VK_RETURN) and AFindSelection then + SelectAll; + if Key = 0 then + Exit; + + case Key of + VK_LEFT, VK_RIGHT: + begin + if not(ssShift in Shift) and (SelLength > 0) then + begin + if Key = VK_RIGHT then + SelStart := SelStart + SelLength + else + SelStart := SelStart; + SelLength := 0; + Key := 0; + end; + FindSelection := False; + end; + + VK_DOWN, VK_UP, VK_PRIOR, VK_NEXT, VK_HOME, VK_END: + begin + if ((Key <> VK_HOME) and (Key <> VK_END) or (AEditingStyle = esFixedList)) and + ActiveProperties.UseLookupData and GetScrollLookupDataList(escKeyboard) and + not ILookupData.IsEmpty then + begin + LockChangeEvents(True); + LookupItemsScrolling := True; + try + APrevCurrentKey := ILookupData.CurrentKey; + LockClick(True); + try + case Key of + VK_PRIOR: + if ssCtrl in Shift then + ILookupData.Go(egdBegin, False) + else + ILookupData.Go(egdPageUp, False); + VK_NEXT: + if ssCtrl in Shift then + ILookupData.Go(egdEnd, False) + else + ILookupData.Go(egdPageDown, False); + VK_UP: + ILookupData.Go(egdPrev, False); + VK_DOWN: + ILookupData.Go(egdNext, False); + VK_HOME: + ILookupData.Go(egdBegin, False); + VK_END: + ILookupData.Go(egdEnd, False); + end; + finally + LockClick(False); + end; + if not VarEqualsExact(APrevCurrentKey, ILookupData.CurrentKey) then + begin + DoClick; + if CanPostEditValue and ActiveProperties.ImmediatePost and + ValidateEdit(True) then + InternalPostEditValue; + end; + Key := 0; + finally + LookupItemsScrolling := False; + LockChangeEvents(False); + end; + end; + if (Key <> VK_HOME) and (Key <> VK_END) and not InnerTextEdit.MultiLine then + begin + if Key <> 0 then + DoAfterKeyDown(Key, Shift); + Key := 0; + end; + end; + + VK_DELETE: + begin + if AEditingStyle = esEditList then + begin + DoAfterKeyDown(Key, Shift); + Key := 0; + end + else + FindSelection := False; + end; + end; + if (Key = VK_END) and (SelLength = 0) and (AEditingStyle <> esFixedList) then + FindSelection := False; + + if Key <> 0 then + InnerTextEdit.InternalUpdating := False; +end; + +procedure TcxCustomTextEdit.DoEditKeyPress(var Key: Char); + + function FillFromList(var AFindText: string): Boolean; + var + ATail: string; + L: Integer; + S: string; + begin + S := AFindText; + if InnerTextEdit.ImeLastChar <> #0 then + S := S + InnerTextEdit.ImeLastChar; + Result := ILookupData.Locate(S, ATail, False); + if Result then + begin + AFindText := S; + if InnerTextEdit.ImeLastChar <> #0 then + begin + L := Length(AFindText); + Insert(Copy(AFindText, L, 1), ATail, 1); + Delete(AFindText, L, 1); + end; + end; + FFindSelection := Result; + if AFindText = '' then + begin + if ActiveProperties.EditingStyle <> esFixedList then + InternalSetDisplayValue(''); + FFindSelection := False; + end; + if Result then + begin + DataBinding.DisplayValue := AFindText + ATail; + SelStart := Length(AFindText); + SelLength := Length(ATail); + end; + UpdateDrawValue; + end; + + function CanContinueIncrementalSearch: Boolean; + begin + Result := ActiveProperties.EditingStyle in [esEditList, esFixedList]; + if not Result then + Result := (SelLength = 0) and (SelStart = Length(DisplayValue)) or + FindSelection or (SelLength > 0); + end; + +var + AEditingStyle: TcxEditEditingStyle; + AFindText: string; + AFound: Boolean; + APrevCurrentKey: TcxEditValue; + APrevFindSelection: Boolean; +begin + InnerTextEdit.InternalUpdating := True; + inherited DoEditKeyPress(Key); + if Key = #0 then + Exit; + + UnlockLookupDataTextChanged; + KeyboardAction := True; + AEditingStyle := ActiveProperties.EditingStyle; + if AEditingStyle = esFixedList then + case Key of + #8: + if not ActiveProperties.FixedListSelection then + begin + Key := #0; + FindSelection := False; + end; + end; + + APrevCurrentKey := ILookupData.CurrentKey; + APrevFindSelection := FindSelection; + AFound := False; + LockClick(True); + try + case Key of + #8: + if ActiveProperties.UseLookupData and ActiveProperties.CanIncrementalSearch then + begin + if (AEditingStyle = esEditList) and (Length(DisplayValue) > 0) and not FindSelection then + begin + SelLength := Length(DisplayValue) - SelStart; + FindSelection := True; + end; + if FindSelection then + begin + AFindText := Copy(DisplayValue, 1, Length(DisplayValue) - SelLength); + SetLength(AFindText, Length(AFindText) - Length(AnsiLastChar(AFindText))); + LockLookupDataTextChanged; + AFound := FillFromList(AFindText); + end; + if AEditingStyle = esFixedList then + Key := #0; + end; + #32..#255: + if ActiveProperties.UseLookupData then + begin + if ActiveProperties.CanIncrementalSearch and CanContinueIncrementalSearch then + begin + LockLookupDataTextChanged; + AFound := False; + AFindText := DisplayValue; + if SelLength > 0 then + AFindText := Copy(AFindText, 1, SelStart) + Key + else + if AEditingStyle = esFixedList then + if FindSelection then + begin + AFindText := AFindText + Key; + AFound := FillFromList(AFindText); + if not AFound then + AFindText := Key; + end + else + AFindText := Key + else + Insert(Key, AFindText, SelStart + 1); + if not AFound then + AFound := FillFromList(AFindText); + if (AEditingStyle = esFixedList) and not ActiveProperties.FixedListSelection and not AFound then + begin + AFindText := Key; + AFound := FillFromList(AFindText); + end; + end; + if (AEditingStyle in [esEditList, esFixedList]) and not AFound then + begin + Key := #0; + if (AEditingStyle = esEditList) and (DisplayValue <> '') or + (AEditingStyle = esFixedList) and ActiveProperties.FixedListSelection and APrevFindSelection then + FindSelection := True; + end; + end; + end; + finally + LockClick(False); + KeyboardAction := False; + if ActiveProperties.UseLookupData and not VarEqualsExact(APrevCurrentKey, + ILookupData.CurrentKey) then + DoClick; + end; + if AFound then + Key := #0; + if Key <> #0 then + InnerTextEdit.InternalUpdating := False; +end; + +procedure TcxCustomTextEdit.DoExit; +begin + inherited DoExit; + FindSelection := False; +end; + +function TcxCustomTextEdit.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; +const + AGoDirectionMap: array [Boolean] of TcxEditLookupDataGoDirection = (egdNext, egdPrev); +var + APrevCurrentKey: TcxEditValue; +begin + Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos); + if Result then + Exit; + + Result := GetScrollLookupDataList(escMouseWheel) and not HasPopupWindow and + ActiveProperties.UseLookupData and not ILookupData.IsEmpty and HandleMouseWheel(Shift); + if not(Result and DoEditing) then + Exit; + + APrevCurrentKey := ILookupData.CurrentKey; + LockChangeEvents(True); + LookupItemsScrolling := True; + try + LockClick(True); + try + ILookupData.Go(AGoDirectionMap[WheelDelta > 0], False); + finally + LockClick(False); + if not VarEqualsExact(APrevCurrentKey, ILookupData.CurrentKey) then + begin + DoClick; + if CanPostEditValue and ActiveProperties.ImmediatePost and ValidateEdit(True) then + InternalPostEditValue; + end; + end; + finally + LookupItemsScrolling := False; + LockChangeEvents(False); + end; +end; + +procedure TcxCustomTextEdit.FillSizeProperties(var AEditSizeProperties: TcxEditSizeProperties); +begin + if ViewInfo = nil then + Exit; + AEditSizeProperties := DefaultcxEditSizeProperties; + AEditSizeProperties.MaxLineCount := 1; +end; + +function TcxCustomTextEdit.GetInnerControlBounds(const AInnerControlsRegion: TRect; + AInnerControl: TControl): TcxContainerInnerControlBounds; +begin + if IsEditClass then + Result := inherited GetInnerControlBounds(AInnerControlsRegion, AInnerControl) + else + begin + Result.IsEmpty := False; + Result.Rect := cxEmptyRect; + end; +end; + +function TcxCustomTextEdit.GetDisplayValue: string; +begin + if InnerEdit = nil then + Result := '' + else + Result := InnerEdit.EditValue; +end; + +function TcxCustomTextEdit.GetInnerEditClass: TControlClass; +begin + Result := TcxCustomInnerTextEdit; +end; + +procedure TcxCustomTextEdit.Initialize; +var + ALookupDataClass: TcxInterfacedPersistentClass; +begin + inherited Initialize; + FBeepOnEnter := True; + FFindSelection := False; + + if InnerTextEdit <> nil then + begin + TControlAccess(InnerTextEdit.Control).Color := clWindow; + InnerTextEdit.OnSelChange := SelChange; + end; + Width := 121; + Height := 21; + + ALookupDataClass := Properties.GetLookupDataClass; + if ALookupDataClass <> nil then + begin + FLookupData := ALookupDataClass.Create(Self); + ILookupData.OnSelectItem := HandleSelectItem; + end; + + cxFormatController.AddListener(Self); +end; + +function TcxCustomTextEdit.InternalDoEditing: Boolean; +begin + Result := ActiveProperties.EditingStyle <> esNoEdit; +end; + +function TcxCustomTextEdit.InternalGetEditingValue: TcxEditValue; +begin + Result := Text; +end; + +procedure TcxCustomTextEdit.InternalSetDisplayValue(const Value: TcxEditValue); +begin + DataBinding.DisplayValue := Value; + if not KeyboardAction then + begin + ResetOnNewDisplayValue; + SynchronizeEditValue; + EditModified := False; + end; +end; + +procedure TcxCustomTextEdit.InternalValidateDisplayValue(const ADisplayValue: TcxEditValue); +//var +// APrevFindSelection: Boolean; +begin +// APrevFindSelection := FindSelection; +// try + if (ActiveProperties.EditingStyle = esEdit) and ActiveProperties.UseLookupData and + not ILookupData.Find(ADisplayValue) then + DoOnNewLookupDisplayText(ADisplayValue); + inherited InternalValidateDisplayValue(ADisplayValue); +// finally +// FindSelection := APrevFindSelection; +// end; +end; + +function TcxCustomTextEdit.IsValidChar(AChar: Char): Boolean; +begin + Result := inherited IsValidChar(AChar) or + (AnsiChar(AChar) in ActiveProperties.ValidChars); +end; + +procedure TcxCustomTextEdit.KeyPress(var Key: Char); +begin + if (Word(Key) = VK_ESCAPE) and IsEditValueResetting and + FIsPopupWindowJustClosed and not HasPopupWindow then + FIsPopupWindowJustClosed := False; + inherited KeyPress(Key); +end; + +procedure TcxCustomTextEdit.Loaded; +begin + inherited Loaded; + ShortRefreshContainer(False); +end; + +procedure TcxCustomTextEdit.PropertiesChanged(Sender: TObject); +begin + if InnerTextEdit <> nil then + InnerTextEdit.Alignment := ActiveProperties.FAlignment.Horz; + if ActiveProperties.UseLookupData then + ILookupData.PropertiesChanged; + if ActiveProperties.UseLookupData and not FLookupDataTextChangedLocked then + ILookupData.TextChanged; + if not PropertiesChangeLocked and not IsEditClass then + UpdateDrawValue; + + if InnerTextEdit = nil then + Exit; + + ImeMode := ActiveProperties.ImeMode; + ImeName := ActiveProperties.ImeName; + with InnerTextEdit do + begin + Alignment := ActiveProperties.Alignment.Horz; + AutoSelect := ActiveProperties.AutoSelect and not IsInplace; + CharCase := ActiveProperties.FCharCase; + EchoMode := ActiveProperties.FEchoMode; + HideSelection := ActiveProperties.FHideSelection; + ImeMode := ActiveProperties.ImeMode; + ImeName := ActiveProperties.ImeName; + MaxLength := ActiveProperties.GetInnerEditMaxLength; + OEMConvert := ActiveProperties.OEMConvert; + PasswordChar := ActiveProperties.PasswordChar; + end; + + CheckEditValue; + if not IsPosting then + UpdateDisplayValue; + UpdateDrawValue; + inherited PropertiesChanged(Sender); + if InnerTextEdit <> nil then + InnerTextEdit.Control.Invalidate; +end; + +function TcxCustomTextEdit.RefreshContainer(const P: TPoint; Button: TcxMouseButton; + Shift: TShiftState; AIsMouseEvent: Boolean): Boolean; +begin + Result := False; + if (not HandleAllocated) or (csDestroying in ComponentState) then Exit; + Result := inherited RefreshContainer(P, Button, Shift, AIsMouseEvent); + if Result then + AdjustInnerEdit; +end; + +function TcxCustomTextEdit.SetDisplayText(const Value: string): Boolean; +var + ADisplayValue: TcxEditValue; +begin + ADisplayValue := Value; + Result := ActiveProperties.IsDisplayValueValid(ADisplayValue, InternalFocused); + if Result then + Result := not(KeyboardAction and not DoEditing); + if Result then + InternalSetDisplayValue(ADisplayValue); +end; + +procedure TcxCustomTextEdit.SetInternalDisplayValue(Value: TcxEditValue); +begin + if InnerEdit <> nil then + InnerEdit.EditValue := Value; +end; + +function TcxCustomTextEdit.WantNavigationKeys: Boolean; +begin + Result := True; +end; + +procedure TcxCustomTextEdit.LockedInnerEditWindowProc(var Message: TMessage); +begin + if Message.Msg = WM_SETFOCUS then + begin + if InnerTextEdit.AutoSelect then + SelectAll; + end + else + inherited LockedInnerEditWindowProc(Message); +end; + +procedure TcxCustomTextEdit.UnlockInnerEditRepainting; +var + APrevAutoSelect: Boolean; +begin + inherited UnlockInnerEditRepainting; + APrevAutoSelect := InnerTextEdit.AutoSelect; + InnerTextEdit.AutoSelect := False; + SendMessage(InnerEdit.Control.Handle, WM_SETFOCUS, 0, 0); + InnerTextEdit.AutoSelect := APrevAutoSelect; +end; + +procedure TcxCustomTextEdit.FormatChanged; +begin + ActiveProperties.Changed; + SynchronizeDisplayValue; +end; + +procedure TcxCustomTextEdit.AdjustInnerEdit; +var + AFont: TFont; +begin + if (InnerTextEdit = nil) or FIsCreating then + Exit; + InnerEdit.LockBounds(True); + try + with TControlAccess(InnerTextEdit.Control) do + begin + Color := ViewInfo.BackgroundColor; + AFont := TFont.Create; + try + AFont.Assign(ActiveStyle.GetVisibleFont); + AFont.Color := ViewInfo.TextColor; + AssignFonts(Font, AFont); + finally + FreeAndNil(AFont); + end; + end; + finally + InnerEdit.LockBounds(False); + end; +end; + +function TcxCustomTextEdit.CanChangeSelText(const Value: string; + out ANewText: string; out ANewSelStart: Integer): Boolean; +var + ADisplayValue: TcxEditValue; + AEditingStyle: TcxEditEditingStyle; + AValue: string; +begin + AValue := string(PChar(Value)); + Result := False; + AEditingStyle := ActiveProperties.EditingStyle; + if KeyboardAction and (AEditingStyle = esNoEdit) then + Exit; + if AEditingStyle in [esFixedList, esNoEdit] then + SelectAll; + if KeyboardAction and (AEditingStyle in [esEdit, esNoEdit]) and (ActiveProperties.MaxLength > 0) then + begin + ANewText := Copy(Text, 1, SelStart) + AValue; + ANewSelStart := Length(WideString(ANewText)); + if ANewSelStart > ActiveProperties.MaxLength then + ANewSelStart := ActiveProperties.MaxLength; + ANewSelStart := Length(string(Copy(WideString(ANewText), 1, ANewSelStart))); + if ANewSelStart < SelStart then + Exit; + + ANewText := ANewText + Copy(Text, SelStart + SelLength + 1, Length(Text) - SelStart - SelLength); + if Length(WideString(ANewText)) > ActiveProperties.MaxLength then + ANewText := Copy(WideString(ANewText), 1, ActiveProperties.MaxLength); + end else + begin + if ActiveProperties.EditingStyle <> esFixedList then + begin + ANewText := Text; + ANewText := Copy(ANewText, 1, SelStart) + AValue + + Copy(ANewText, SelStart + SelLength + 1, Length(ANewText) - SelLength - SelStart); + end + else + ANewText := AValue; + ANewSelStart := SelStart + Length(AValue); + end; + ADisplayValue := ANewText; + Result := ActiveProperties.IsDisplayValueValid(ADisplayValue, InternalFocused) and + not (KeyboardAction and not DoEditing); + if Result then + ANewText := VarToStr(ADisplayValue); +end; + +procedure TcxCustomTextEdit.CheckEditValue; +begin + if DataBinding.CanCheckEditorValue and ActiveProperties.IsEditValueNumeric and + not PropertiesChangeLocked and ActiveProperties.IsValueBoundsDefined then + CheckEditorValueBounds; +end; + +procedure TcxCustomTextEdit.CheckEditorValueBounds; +begin +end; + +procedure TcxCustomTextEdit.DoOnNewLookupDisplayText(const AText: string); +begin + with Properties do + if Assigned(OnNewLookupDisplayText) then + OnNewLookupDisplayText(Self, AText); + if RepositoryItem <> nil then + with ActiveProperties do + if Assigned(OnNewLookupDisplayText) then + OnNewLookupDisplayText(Self, AText); +end; + +function TcxCustomTextEdit.GetInnerEditHeight: Integer; +begin + Result := cxScreenCanvas.FontHeight(TControlAccess(InnerTextEdit.Control).Font) +end; + +function TcxCustomTextEdit.GetItemIndex: Integer; +begin + Result := LookupKeyToItemIndex(ILookupData.CurrentKey); +end; + +function TcxCustomTextEdit.GetItemObject: TObject; +begin + if ItemIndex <> -1 then + Result := ActiveProperties.LookupItems.Objects[ItemIndex] + else + Result := nil; +end; + +function TcxCustomTextEdit.GetScrollLookupDataList(AScrollCause: TcxEditScrollCause): Boolean; +begin + Result := False; +end; + +procedure TcxCustomTextEdit.HandleSelectItem(Sender: TObject); +var + ANewEditValue: TcxEditValue; + AEditValueChanged: Boolean; +begin + ANewEditValue := LookupKeyToEditValue(ILookupData.CurrentKey); + AEditValueChanged := not VarEqualsExact(EditValue, ANewEditValue); + if AEditValueChanged and not DoEditing then + Exit; + SaveModified; + LockLookupDataTextChanged; + try + InternalEditValue := ANewEditValue; + finally + UnlockLookupDataTextChanged; + RestoreModified; + end; + if AEditValueChanged then + ModifiedAfterEnter := True; + SelectAll; + ShortRefreshContainer(False); +end; + +function TcxCustomTextEdit.InternalGetText: string; +begin + Result := DisplayValue; +end; + +function TcxCustomTextEdit.InternalSetText(const Value: string): Boolean; +begin + Result := SetDisplayText(Value); +end; + +function TcxCustomTextEdit.ItemIndexToLookupKey(AItemIndex: Integer): TcxEditValue; +begin + Result := AItemIndex; +end; + +procedure TcxCustomTextEdit.LockLookupDataTextChanged; +begin + FLookupDataTextChangedLocked := True; +end; + +function TcxCustomTextEdit.LookupKeyToEditValue(const AKey: TcxEditValue): TcxEditValue; +var + AText: string; +begin + AText := ILookupData.GetDisplayText(AKey); + PrepareEditValue(AText, Result, False); +end; + +function TcxCustomTextEdit.LookupKeyToItemIndex(const AKey: TcxEditValue): Integer; +begin + Result := AKey; +end; + +function TcxCustomTextEdit.NeedResetInvalidTextWhenPropertiesChanged: Boolean; +begin + Result := not IsInplace and not DataBinding.IDefaultValuesProvider.IsDataStorage; +end; + +procedure TcxCustomTextEdit.ResetOnNewDisplayValue; +begin + if ActiveProperties.UseLookupData then + FindSelection := False; +end; + +procedure TcxCustomTextEdit.SelChange(Sender: TObject); +begin +end; + +procedure TcxCustomTextEdit.SetEditingText(const Value: TCaption); +begin + if DoEditing then + begin + Text := Value; + ModifiedAfterEnter := True; + end; +end; + +procedure TcxCustomTextEdit.SetItemIndex(Value: Integer); +var + ANewEditValue: TcxEditValue; + APrevItemIndex: Integer; +begin + APrevItemIndex := ItemIndex; + LockClick(True); + try + ILookupData.CurrentKey := ItemIndexToLookupKey(Value); + ANewEditValue := LookupKeyToEditValue(ILookupData.CurrentKey); + if not VarEqualsExact(EditValue, ANewEditValue) then + EditValue := ANewEditValue; + finally + LockClick(False); + end; + if ItemIndex <> APrevItemIndex then + begin + EditModified := False; + Click; + end; +end; + +procedure TcxCustomTextEdit.SynchronizeDisplayValue; +var + ADisplayValue, AEditValue: TcxEditValue; + AIsEditValueValid: Boolean; +begin + if ActiveProperties.CanValidate then + begin + AEditValue := EditValue; + AIsEditValueValid := ActiveProperties.IsEditValueValid(AEditValue, InternalFocused); + if not AIsEditValueValid and not Focused then + try + if VarIsDate(EditValue) then + ADisplayValue := DateTimeToStr(EditValue) + else + ADisplayValue := VarToStr(EditValue) + except + on EVariantError do + ADisplayValue := ''; + end + else + if AIsEditValueValid then + PrepareDisplayValue(AEditValue, ADisplayValue, InternalFocused) + else + ADisplayValue := ActiveProperties.DefaultFocusedDisplayValue; + end + else + PrepareDisplayValue(EditValue, ADisplayValue, InternalFocused); + SaveModified; + FIsDisplayValueSynchronizing := True; + try + DataBinding.DisplayValue := ADisplayValue; + finally + FIsDisplayValueSynchronizing := False; + RestoreModified; + ResetOnNewDisplayValue; + UpdateDrawValue; + end; +end; + +procedure TcxCustomTextEdit.SynchronizeEditValue; +var + APrevEditValue: TcxEditValue; + ACompareEditValue, AEditValueChanged: Boolean; +begin + ACompareEditValue := ActiveProperties.CanCompareEditValue; + if ACompareEditValue then + APrevEditValue := EditValue + else + APrevEditValue := Null; + PrepareEditValue(DisplayValue, FEditValue, InternalFocused); + + if ACompareEditValue then + AEditValueChanged := not InternalVarEqualsExact(APrevEditValue, FEditValue) + else + AEditValueChanged := False; + if KeyboardAction then + ModifiedAfterEnter := True + else + EditModified := False; + if AEditValueChanged then + begin + DoEditValueChanged; + if not ActiveProperties.HasDisplayValue then + DoChange; + end; +end; + +procedure TcxCustomTextEdit.UndoPerformed; +begin +end; + +procedure TcxCustomTextEdit.UnlockLookupDataTextChanged; +begin + FLookupDataTextChangedLocked := False; +end; + +procedure TcxCustomTextEdit.UpdateDrawValue; + + procedure SetTextSelection; + var + AEditingStyle: TcxEditEditingStyle; + begin + AEditingStyle := ActiveProperties.EditingStyle; + if AEditingStyle in [esFixedList, esNoEdit] then + with ViewInfo do + if (AEditingStyle = esNoEdit) or not FindSelection or not ActiveProperties.FixedListSelection then + SelLength := 0 + else + begin + if DrawSelectionBar then + begin + SelStart := 0; + SelLength := Length(Text) - Self.SelLength; + SelBackgroundColor := clHighlightText; + SelTextColor := clHighlight; + end else + begin + SelStart := Self.SelStart; + SelLength := Self.SelLength; + SelBackgroundColor := clHighlight; + SelTextColor := clHighlightText; + end; + end; + end; + +var + AViewData: TcxCustomTextEditViewData; +begin + AViewData := TcxCustomTextEditViewData(CreateViewData); + try + AViewData.DisplayValueToDrawValue(DisplayValue, ViewInfo); + finally + AViewData.Free; + end; + if HandleAllocated then + begin + CalculateViewInfo(False); + SetTextSelection; + InvalidateRect(Rect(0, 0, Width, Height), False); + end; +end; + +procedure TcxCustomTextEdit.UpdateDisplayValue; +var + ADisplayValue: TcxEditValue; +begin + if PropertiesChangeLocked then + Exit; + + if ActiveProperties.EditingStyle in [esEditList, esFixedList] then + begin + if ModifiedAfterEnter and not IsEditValidated or NeedResetInvalidTextWhenPropertiesChanged then + begin + ADisplayValue := DisplayValue; + if not ActiveProperties.IsDisplayValueValid(ADisplayValue, True) then + begin + SaveModified; + DataBinding.DisplayValue := ActiveProperties.DefaultFocusedDisplayValue; + RestoreModified; + if not ModifiedAfterEnter then + SynchronizeEditValue; + end; + end + else + SynchronizeDisplayValue; + end + else + if not ModifiedAfterEnter then + DataBinding.UpdateDisplayValue; +end; + +function TcxCustomTextEdit.GetCursorPos: Integer; +begin + if InnerTextEdit.Control is TcxCustomInnerTextEdit then + Result := TcxCustomInnerTextEdit(InnerTextEdit.Control).CursorPos + else + Result := 0; +end; + +function TcxCustomTextEdit.GetEditingText: TCaption; +begin + Result := Text; +end; + +function TcxCustomTextEdit.GetInnerTextEdit: IcxInnerTextEdit; +begin + Result := InnerEdit as IcxInnerTextEdit; +end; + +function TcxCustomTextEdit.GetILookupData: IcxTextEditLookupData; +begin + Result := FLookupData as IcxTextEditLookupData; +end; + +function TcxCustomTextEdit.GetLookupData: TcxCustomTextEditLookupData; +begin + Result := TcxCustomTextEditLookupData(FLookupData); +end; + +function TcxCustomTextEdit.GetProperties: TcxCustomTextEditProperties; +begin + Result := TcxCustomTextEditProperties(FProperties); +end; + +function TcxCustomTextEdit.GetActiveProperties: TcxCustomTextEditProperties; +begin + Result := TcxCustomTextEditProperties(InternalGetActiveProperties); +end; + +function TcxCustomTextEdit.GetSelLength: Integer; +var + AEditingStyle: TcxEditEditingStyle; +begin + AEditingStyle := ActiveProperties.EditingStyle; + if (AEditingStyle = esFixedList) and not FindSelection or (AEditingStyle = esNoEdit) then + Result := 0 + else + Result := InnerTextEdit.SelLength; +end; + +function TcxCustomTextEdit.GetSelStart: Integer; +var + AEditingStyle: TcxEditEditingStyle; +begin + AEditingStyle := ActiveProperties.EditingStyle; + if (AEditingStyle = esFixedList) and not FindSelection or (AEditingStyle = esNoEdit) then + Result := 0 + else + Result := InnerTextEdit.SelStart; +end; + +function TcxCustomTextEdit.GetSelText: TCaption; +var + AEditingStyle: TcxEditEditingStyle; +begin + AEditingStyle := ActiveProperties.EditingStyle; + if (AEditingStyle = esFixedList) and not FindSelection or (AEditingStyle = esNoEdit) then + Result := '' + else + Result := InnerTextEdit.SelText; +end; + +function TcxCustomTextEdit.GetViewInfo: TcxCustomTextEditViewInfo; +begin + Result := TcxCustomTextEditViewInfo(FViewInfo); +end; + +procedure TcxCustomTextEdit.SetFindSelection(Value: Boolean); +begin + if not HandleAllocated or (Value = FindSelection) or FDisableRefresh then + Exit; + FFindSelection := Value; + CalculateViewInfo(False); + UpdateDrawValue; +end; + +procedure TcxCustomTextEdit.SetHideInnerEdit(Value: Boolean); +begin + if Value <> FHideInnerEdit then + begin + FHideInnerEdit := Value; + PropertiesChanged(ActiveProperties); + end; +end; + +procedure TcxCustomTextEdit.SetItemObject(Value: TObject); +begin + ItemIndex := ActiveProperties.LookupItems.IndexOfObject(Value); +end; + +procedure TcxCustomTextEdit.SetProperties(Value: TcxCustomTextEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomTextEdit.SetSelLength(Value: Integer); +begin + if ActiveProperties.EditingStyle <> esNoEdit then + InnerTextEdit.SelLength := Value; +end; + +procedure TcxCustomTextEdit.SetSelStart(Value: Integer); +begin + if ActiveProperties.EditingStyle <> esNoEdit then + InnerTextEdit.SelStart := Value; +end; + +procedure TcxCustomTextEdit.SetShowInnerEdit(Value: Boolean); +begin + if Value <> FShowInnerEdit then + begin + FShowInnerEdit := Value; + PropertiesChanged(ActiveProperties); + end; +end; + +procedure TcxCustomTextEdit.SetTesting(Value: Boolean); +begin + if Value <> FTesting then + begin + FTesting := Value; + ShortRefreshContainer(False); + end; +end; + +procedure TcxCustomTextEdit.SetSelText(const Value: TCaption); +var + ANewSelStart: Integer; + ANewText: string; + APrevKeyboardAction: Boolean; +begin + APrevKeyboardAction := KeyboardAction; + KeyboardAction := Focused; + try + if CanChangeSelText(Value, ANewText, ANewSelStart) then + begin + InternalSetDisplayValue(ANewText); + SelStart := ANewSelStart; + end; + finally + KeyboardAction := APrevKeyboardAction; + end; +end; + +procedure TcxCustomTextEdit.WMClear(var Message: TMessage); +begin + KeyboardAction := True; + try + if (not ActiveProperties.ReadOnly) and DataBinding.IsDataAvailable then + ClearSelection; + finally + KeyboardAction := False; + end; +end; + +procedure TcxCustomTextEdit.WMGetText(var Message: TWMGetText); +var + S: string; +begin + if Message.TextMax > 0 then + begin + if FProperties = nil then + S := FText + else + S := InternalGetText; + + if Length(S) > Message.TextMax - 1 then + SetLength(S, Message.TextMax - 1); + StrLCopy(Message.Text, PChar(S), Message.TextMax - 1); + Message.Result := Length(S); + end + else + Message.Result := 0; +end; + +procedure TcxCustomTextEdit.WMGetTextLength(var Message: TWMGetTextLength); +begin + if FProperties = nil then + Message.Result := Length(FText) + else + Message.Result := Length(InternalGetText); +end; + +procedure TcxCustomTextEdit.WMSetText(var Message: TWMSetText); +begin + if FInternalTextSetting then + inherited + else + begin + Message.Result := 0; + FInternalTextSetting := True; + try + if InternalSetText(string(Message.Text)) then + Message.Result := 1; + finally + FInternalTextSetting := False; + end; + end; +end; + +{ TcxTextEdit } + +class function TcxTextEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxTextEditProperties; +end; + +function TcxTextEdit.GetActiveProperties: TcxTextEditProperties; +begin + Result := TcxTextEditProperties(InternalGetActiveProperties); +end; + +function TcxTextEdit.GetProperties: TcxTextEditProperties; +begin + Result := TcxTextEditProperties(FProperties); +end; + +procedure TcxTextEdit.SetProperties(Value: TcxTextEditProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxFilterTextEditHelper } + +class function TcxFilterTextEditHelper.GetFilterEditClass: TcxCustomEditClass; +begin + Result := TcxTextEdit; +end; + +class procedure TcxFilterTextEditHelper.InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); +begin + inherited InitializeProperties(AProperties, AEditProperties, AHasButtons); + with TcxCustomTextEditProperties(AProperties) do + begin + AutoSelect := True; + HideSelection := True; + ViewStyle := vsNormal; + end; +end; + +class procedure TcxFilterTextEditHelper.SetFilterValue(AEdit: TcxCustomEdit; + AEditProperties: TcxCustomEditProperties; AValue: Variant); +begin + AEdit.EditValue := AValue; +end; + +initialization + GetRegisteredEditProperties.Register(TcxTextEditProperties, scxSEditRepositoryTextItem); + FilterEditsController.Register(TcxTextEditProperties, TcxFilterTextEditHelper); + +finalization + FilterEditsController.Unregister(TcxTextEditProperties, TcxFilterTextEditHelper); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxTimeEdit.pas b/official/x.35/ExpressEditors Library 5/Sources/cxTimeEdit.pas new file mode 100644 index 00000000..c8074027 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxTimeEdit.pas @@ -0,0 +1,1148 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxTimeEdit; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, + Classes, Controls, SysUtils, cxClasses, cxContainer, cxDataUtils, cxDateUtils, + cxEdit, cxFormats, cxMaskEdit, cxSpinEdit, cxVariants, cxFilterControlUtils; + +type + TcxTimeEditZoneKind = (tzHour, tzMin, tzSec, tzTimeSuffix); + + TcxTimeEditZoneInfo = record + Kind: TcxTimeEditZoneKind; + Start, Length: Integer; + TimeSuffixKind: TcxTimeSuffixKind; + Use24HourFormat: Boolean; + end; + + { TcxTimeEditMaskMode } + + TcxTimeEditMaskMode = class(TcxMaskEditStandardMode) + protected + function GetBlank(APos: Integer): Char; override; + end; + + { TcxCustomTimeEditProperties } + + TcxCustomTimeEdit = class; + TcxTimeEditTimeFormat = (tfHourMinSec, tfHourMin, tfHour); + + TcxCustomTimeEditProperties = class(TcxCustomSpinEditProperties) + private + FAutoCorrectHours: Boolean; + FShowDate: Boolean; + FTimeFormat: TcxTimeEditTimeFormat; + FUse24HourFormat: Boolean; + FUseTimeFormatWhenUnfocused: Boolean; + procedure SetAutoCorrectHours(Value: Boolean); + procedure SetUse24HourFormat(Value: Boolean); + procedure SetShowDate(Value: Boolean); + procedure SetTimeFormat(Value: TcxTimeEditTimeFormat); + procedure SetUseTimeFormatWhenUnfocused(Value: Boolean); + protected + function DefaultFocusedDisplayValue: TcxEditValue; override; + function ExtendValueUpToBound: Boolean; override; + procedure FormatChanged; override; + function GetDisplayFormatOptions: TcxEditDisplayFormatOptions; override; + function GetModeClass(AMaskKind: TcxEditMaskKind): TcxMaskEditCustomModeClass; override; + procedure GetTimeZoneInfo(APos: Integer; + out AInfo: TcxTimeEditZoneInfo); virtual; + function IsDisplayValueNumeric: Boolean; override; + function IsEditValueNumeric: Boolean; override; + function PrepareValue(const AValue: TcxEditValue): Variant; override; + function PreserveSelection: Boolean; override; + function GetEditingPlace(APos: Integer): TcxTimeEditZoneKind; + function GetTimePartLength(AKind: TcxTimeEditZoneKind): Integer; virtual; + function GetTimePartPos(AKind: TcxTimeEditZoneKind): Integer; virtual; + function GetTimeSuffixKind: TcxTimeSuffixKind; virtual; + procedure UpdateEditMask; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + class function GetContainerClass: TcxContainerClass; override; + function GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; override; + function IsDisplayValueValid(var DisplayValue: TcxEditValue; AEditFocused: Boolean): Boolean; override; + function IsEditValueValid(var EditValue: TcxEditValue; AEditFocused: Boolean): Boolean; override; + procedure PrepareDisplayValue(const AEditValue: TcxEditValue; var DisplayValue: TcxEditValue; + AEditFocused: Boolean); override; + procedure ValidateDisplayValue(var ADisplayValue: TcxEditValue; + var AErrorText: TCaption; var AError: Boolean; + AEdit: TcxCustomEdit); override; + // !!! + property AutoCorrectHours: Boolean read FAutoCorrectHours + write SetAutoCorrectHours default True; + property ShowDate: Boolean read FShowDate write SetShowDate default False; + property TimeFormat: TcxTimeEditTimeFormat read FTimeFormat write SetTimeFormat default tfHourMinSec; + property Use24HourFormat: Boolean read FUse24HourFormat write SetUse24HourFormat default True; + property UseTimeFormatWhenUnfocused: Boolean read FUseTimeFormatWhenUnfocused + write SetUseTimeFormatWhenUnfocused default True; + end; + + { TcxTimeEditProperties } + + TcxTimeEditProperties = class(TcxCustomTimeEditProperties) + published + property Alignment; + property AssignedValues; + property AutoCorrectHours; + property AutoSelect; + property BeepOnError; + property Circular; + property ClearKey; + property HideSelection; + property ImeMode; + property ImeName; + property ImmediatePost; + property ReadOnly; + property ShowDate; + property TimeFormat; + property UseCtrlIncrement; + property UseLeftAlignmentOnEditing; + property Use24HourFormat; + property UseTimeFormatWhenUnfocused; + property ValidateOnEnter; + property OnChange; + property OnEditValueChanged; + property OnValidate; + end; + + { TcxCustomTimeEdit } + + TcxCustomTimeEdit = class(TcxCustomSpinEdit) + private + FSavedDate: TDate; + function GetProperties: TcxCustomTimeEditProperties; + function GetActiveProperties: TcxCustomTimeEditProperties; + function GetTime: TTime; + procedure SetProperties(Value: TcxCustomTimeEditProperties); + procedure SetTime(Value: TTime); + protected + function GetIncrement(AButton: TcxSpinEditButton): Double; override; + function GetValue: Variant; override; + function IncrementValueToStr(const AValue: TcxEditValue): string; override; + procedure Initialize; override; + function InternalGetEditingValue: TcxEditValue; override; + function InternalGetText: string; override; + procedure InternalSetDisplayValue(const Value: TcxEditValue); override; + procedure InternalSetEditValue(const Value: TcxEditValue; + AValidateEditValue: Boolean); override; + function InternalSetText(const Value: string): Boolean; override; + function IsValidChar(AChar: Char): Boolean; override; + function IsCharValidForPos(var AChar: Char; APos: Integer): Boolean; override; + procedure PropertiesChanged(Sender: TObject); override; + procedure SetValue(const Value: Variant); override; + function EditingPlace: TcxTimeEditZoneKind; + public + procedure Clear; override; + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + function Increment(AButton: TcxSpinEditButton): Boolean; override; + procedure PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); override; + property ActiveProperties: TcxCustomTimeEditProperties read GetActiveProperties; + property Properties: TcxCustomTimeEditProperties read GetProperties + write SetProperties; + property Time: TTime read GetTime write SetTime stored False; + end; + + { TcxTimeEdit } + + TcxTimeEdit = class(TcxCustomTimeEdit) + private + function GetActiveProperties: TcxTimeEditProperties; + function GetProperties: TcxTimeEditProperties; + procedure SetProperties(Value: TcxTimeEditProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxTimeEditProperties read GetActiveProperties; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DragMode; + property EditValue; + property Enabled; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties: TcxTimeEditProperties read GetProperties write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Time; + property Visible; + property DragCursor; + property DragKind; + property ImeMode; + property ImeName; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDrag; + property OnEndDock; + property OnStartDock; + end; + + { TcxFilterTimeEditHelper } + + TcxFilterTimeEditHelper = class(TcxFilterSpinEditHelper) + protected + class procedure InitializeEdit(AEdit: TcxCustomEdit; + AEditProperties: TcxCustomEditProperties); override; + public + class function GetFilterEditClass: TcxCustomEditClass; override; + end; + +function IsCharValidForTimeEdit(ATimeEdit: TcxCustomMaskEdit; + var AChar: Char; APos: Integer; + const ATimeZoneInfo: TcxTimeEditZoneInfo): Boolean; + +implementation + +uses + StdCtrls, cxControls, cxEditConsts, cxTextEdit{$IFDEF DELPHI6}, DateUtils{$ENDIF}, + Forms, Dialogs, Math; + +type + + { TcxTimeEditFormatListener } + + TcxTimeEditFormatListener = class(TcxInterfacedPersistent, IcxFormatControllerListener) + protected + procedure FormatChanged; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + end; + +var + cxTimeEditHalfDayIncrement, + cxTimeEditOneHourIncrement, + cxTimeEditOneMinIncrement, + cxTimeEditOneSecIncrement: Double; + FTimeEditFormatListener: TcxTimeEditFormatListener; + + cxTimeEditFormats: array [TcxTimeEditTimeFormat, Boolean, 0 .. 1] of string = ( + (('hh:nn:ss ampm', '00:00:00 LL;1;0'), ('hh:nn:ss', '00:00:00;1;0')), + (('hh:nn ampm', '00:00 LL;1;0'), ('hh:nn', '00:00;1;0')), + (('hh ampm', '00 LL;1;0'), ('hh', '00;1;0')) + ); + +function EqualChars(C1, C2: Char): Boolean; +begin + Result := UpperCase(C1) = UpperCase(C2); +end; + +function GetFirstDifferenceIndex(const S1, S2: string): Integer; +var + ACount, I: Integer; +begin + Result := -1; + ACount := Min(Length(S1), Length(S2)); + for I := 1 to ACount do + if not EqualChars(S1[I], S2[I]) then + begin + Result := I; + Break; + end; + if (Result = -1) and (Length(S1) <> Length(S2)) then + Result := ACount + 1; +end; + +procedure GetTimeSuffixes(ATimeSuffixKind: TcxTimeSuffixKind; + out ATimeSuffix1, ATimeSuffix2: string); +begin + case ATimeSuffixKind of + tskAP: + begin + ATimeSuffix1 := 'A'; + ATimeSuffix2 := 'P'; + end; + tskAMPM: + begin + ATimeSuffix1 := 'AM'; + ATimeSuffix2 := 'PM'; + end; + tskAMPMString: + begin + ATimeSuffix1 := TimeAMString; + ATimeSuffix2 := TimePMString; + end; + end; +end; + +function IsCharValidForTimeEdit(ATimeEdit: TcxCustomMaskEdit; + var AChar: Char; APos: Integer; + const ATimeZoneInfo: TcxTimeEditZoneInfo): Boolean; + + procedure GetTimeValueItemValueRange(out AMinValue, AMaxValue: Integer); + begin + AMinValue := 0; + if ATimeZoneInfo.Kind = tzHour then + if not ATimeZoneInfo.Use24HourFormat then + begin + AMinValue := 1; + AMaxValue := 12; + end + else + AMaxValue := 23 + else + AMaxValue := 59; + end; + + procedure SetEditText(const AText: string; APos: Integer); + var + ASelStart: Integer; + S: string; + begin + S := ATimeEdit.Text; + Delete(S, APos, Length(AText)); + Insert(AText, S, APos); + ASelStart := ATimeEdit.SelStart; + TCustomEdit(ATimeEdit.InnerControl).Text := S; + ATimeEdit.SelStart := ASelStart; + end; + + function CheckTimeSuffix: Boolean; + var + AFirstDifferenceIndex: Integer; + ATimeSuffix, ATimeSuffix1, ATimeSuffix2: string; + begin + GetTimeSuffixes(ATimeZoneInfo.TimeSuffixKind, ATimeSuffix1, ATimeSuffix2); + AFirstDifferenceIndex := ATimeZoneInfo.Start + + GetFirstDifferenceIndex(ATimeSuffix1, ATimeSuffix2) - 1; + if APos < AFirstDifferenceIndex then + begin + Result := EqualChars(AChar, ATimeSuffix1[APos - ATimeZoneInfo.Start + 1]); + if Result then + AChar := ATimeSuffix1[APos - ATimeZoneInfo.Start + 1]; + end + else + if APos > AFirstDifferenceIndex then + begin + Result := EqualChars(AChar, ATimeEdit.Text[APos]); + if Result then + AChar := ATimeEdit.Text[APos]; + end + else + begin + Result := True; + if EqualChars(AChar, ATimeSuffix1[APos - ATimeZoneInfo.Start + 1]) then + ATimeSuffix := ATimeSuffix1 + else if EqualChars(AChar, ATimeSuffix2[APos - ATimeZoneInfo.Start + 1]) then + ATimeSuffix := ATimeSuffix2 + else + Result := False; + if Result then + begin + AChar := #0; + SetEditText(ATimeSuffix, ATimeZoneInfo.Start); + ATimeEdit.SelStart := ATimeZoneInfo.Start + ATimeZoneInfo.Length; + end; + end; + end; + + function CheckTimeValueItemFirstDigit(ADigit: Char): Boolean; + var + AMaxTimeZoneValue, AMinTimeZoneValue: Integer; + begin + Result := True; + GetTimeValueItemValueRange(AMinTimeZoneValue, AMaxTimeZoneValue); + if ADigit = '0' then + begin + SetEditText('0' + ATimeEdit.Text[APos], APos); + ATimeEdit.SelStart := ATimeEdit.SelStart + 1; + AChar := #0; + end + else + if ADigit <= IntToStr(AMaxTimeZoneValue)[1] then + begin + SetEditText(ADigit + '0', APos); + ATimeEdit.SelStart := ATimeEdit.SelStart + 1; + AChar := #0; + end + else + begin + SetEditText('0', APos); + ATimeEdit.SelStart := ATimeEdit.SelStart + 1; + end + end; + + function CheckTimeValueItemSecondDigit(ADigit: Char): Boolean; + begin + Result := ADigit <> '0'; + if Result then + begin + SetEditText('0', APos - 1); + Result := True; + end; + end; + + function CheckTimeValueItem: Boolean; + var + AMaxTimeZoneValue, AMinTimeZoneValue: Integer; + S: string; + begin + S := Copy(ATimeEdit.Text, ATimeZoneInfo.Start, ATimeZoneInfo.Length); + S[APos - ATimeZoneInfo.Start + 1] := AChar; + GetTimeValueItemValueRange(AMinTimeZoneValue, AMaxTimeZoneValue); + Result := (StrToInt(S) >= AMinTimeZoneValue) and (StrToInt(S) <= AMaxTimeZoneValue); + if not Result then + if APos = ATimeZoneInfo.Start then + Result := CheckTimeValueItemFirstDigit(AChar) + else + Result := CheckTimeValueItemSecondDigit(AChar); + end; + +begin + if ATimeZoneInfo.Kind = tzTimeSuffix then + Result := CheckTimeSuffix + else + Result := CheckTimeValueItem; +end; + +function IsSpace(AChar: Char): Boolean; +begin + Result := AChar = ' '; +end; + +procedure PrepareTimeEditMasks; +var + AMask: string; + ATimeFormat: TcxTimeEditTimeFormat; + I: Integer; + S: string; +begin + S := FormatDateTime('hh:mm:ss AMPM', 1.5); + AMask := ''; + for I := 9 to Length(S) do + if IsSpace(S[I]) then + AMask := AMask + ' ' + else + AMask := AMask + 'c'; + AMask := TrimRight(AMask); + for ATimeFormat := tfHourMinSec to tfHour do + begin + S := cxTimeEditFormats[ATimeFormat, False, 1]; + S := Copy(S, 1, (3 - Integer(ATimeFormat)) * 3 - 1); + S := S + AMask + ';1;0'; + cxTimeEditFormats[ATimeFormat, False, 1] := S; + end; +end; + +{ TcxTimeEditFormatListener } + +constructor TcxTimeEditFormatListener.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + cxFormatController.AddListener(Self); + PrepareTimeEditMasks; +end; + +destructor TcxTimeEditFormatListener.Destroy; +begin + cxFormatController.RemoveListener(Self); + inherited Destroy; +end; + +procedure TcxTimeEditFormatListener.FormatChanged; +begin + PrepareTimeEditMasks; +end; + +{ TcxTimeEditMaskMode } + +function TcxTimeEditMaskMode.GetBlank(APos: Integer): Char; +begin + if TcxCustomTimeEditProperties(Properties).GetEditingPlace(APos) = tzTimeSuffix then + Result := #0 + else + Result := '0'; +end; + +{ TcxCustomTimeEditProperties } + +constructor TcxCustomTimeEditProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FTimeFormat := tfHourMinSec; + ValueType := vtFloat; + FAutoCorrectHours := True; + FUse24HourFormat := True; + FUseTimeFormatWhenUnfocused := True; + UpdateEditMask; + IgnoreMaskBlank := True; + Increment := 1; + MinValue := 0; + MaxValue := 24 * 60 * 60 - 1; + AlwaysShowBlanksAndLiterals := True; +end; + +procedure TcxCustomTimeEditProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomTimeEditProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with Source as TcxCustomTimeEditProperties do + begin + Self.AutoCorrectHours := AutoCorrectHours; + Self.ShowDate := ShowDate; + Self.TimeFormat := TimeFormat; + Self.Use24HourFormat := Use24HourFormat; + Self.UseTimeFormatWhenUnfocused := UseTimeFormatWhenUnfocused; + end + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +class function TcxCustomTimeEditProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxTimeEdit; +end; + +function TcxCustomTimeEditProperties.IsDisplayValueValid(var DisplayValue: TcxEditValue; + AEditFocused: Boolean): Boolean; +var + AText: string; + ADateTime: TDateTime; +begin + AText := VarToStr(DisplayValue); + Result := True; + try + ADateTime := StrToDateTime(AText); + DisplayValue := FormatDateTime(cxTimeEditFormats[TimeFormat, FUse24HourFormat, 0], ADateTime); + DisplayValue := TrimRight(DisplayValue); + except + Result := False; + end; +end; + +function TcxCustomTimeEditProperties.IsEditValueValid(var EditValue: TcxEditValue; + AEditFocused: Boolean): Boolean; +begin + if VarIsStr(EditValue) then + Result := IsDisplayValueValid(EditValue, AEditFocused) + else + Result := VarIsNull(EditValue) or VarIsDate(EditValue) or VarIsNumericEx(EditValue); +end; + +procedure TcxCustomTimeEditProperties.PrepareDisplayValue(const AEditValue: TcxEditValue; + var DisplayValue: TcxEditValue; AEditFocused: Boolean); + + function InternalFormatDateTime(AValue: TcxEditValue): string; + begin + if AEditFocused or FUseTimeFormatWhenUnfocused and + ((AValue = 0) or not ShowDate or (DateOf(AValue) = 0)) then + Result := FormatDateTime(cxTimeEditFormats[TimeFormat, Use24HourFormat, 0], AValue) + else + if (AValue = 0) or not ShowDate or (DateOf(AValue) = 0) then + Result := TimeToStr(AValue) + else + Result := DateTimeToStr(AValue); + Result := TrimRight(Result); + end; + +begin + if VarIsNull(AEditValue) then + if not AEditFocused then + DisplayValue := '' + else + begin + DisplayValue := FormatDateTime(cxTimeEditFormats[TimeFormat, FUse24HourFormat, 0], 0); + DisplayValue := TrimRight(DisplayValue); + end + else + if not VarIsDate(AEditValue) and not VarIsNumericEx(AEditValue) and + not VarIsStr(AEditValue) then + raise EConvertError.CreateFmt(cxGetResourceString(@cxSEditTimeConvertError), []) + else + try + if VarIsStr(AEditValue) then + DisplayValue := InternalFormatDateTime(StrToDateTime(AEditValue)) + else + DisplayValue := InternalFormatDateTime(AEditValue); + except + DisplayValue := InternalFormatDateTime(SysUtils.Now); + end; +end; + +procedure TcxCustomTimeEditProperties.ValidateDisplayValue( + var ADisplayValue: TcxEditValue; var AErrorText: TCaption; + var AError: Boolean; AEdit: TcxCustomEdit); +var + AIsUserErrorDisplayValue: Boolean; +begin + if AErrorText = '' then + AErrorText := cxGetResourceString(@cxSEditTimeConvertError); + DoValidate(ADisplayValue, AErrorText, AError, AEdit, AIsUserErrorDisplayValue); +end; + +function TcxCustomTimeEditProperties.GetEditValueSource(AEditFocused: Boolean): TcxDataEditValueSource; +begin + Result := GetValueEditorEditValueSource(AEditFocused); +end; + +function TcxCustomTimeEditProperties.DefaultFocusedDisplayValue: TcxEditValue; +begin + Result := FormatDateTime(cxTimeEditFormats[TimeFormat, FUse24HourFormat, 0], 0); + Result := TrimRight(Result); +end; + +function TcxCustomTimeEditProperties.ExtendValueUpToBound: Boolean; +begin + Result := False; +end; + +procedure TcxCustomTimeEditProperties.FormatChanged; +begin + BeginUpdate; + try + UpdateEditMask; + finally + EndUpdate; + end; +end; + +function TcxCustomTimeEditProperties.GetDisplayFormatOptions: TcxEditDisplayFormatOptions; +begin + Result := [dfoSupports, dfoNoCurrencyValue]; +end; + +function TcxCustomTimeEditProperties.GetModeClass( + AMaskKind: TcxEditMaskKind): TcxMaskEditCustomModeClass; +begin + Result := TcxTimeEditMaskMode; +end; + +procedure TcxCustomTimeEditProperties.GetTimeZoneInfo(APos: Integer; + out AInfo: TcxTimeEditZoneInfo); +begin + AInfo.Kind := GetEditingPlace(APos); + AInfo.Start := GetTimePartPos(AInfo.Kind); + AInfo.Length := GetTimePartLength(AInfo.Kind); + AInfo.TimeSuffixKind := GetTimeSuffixKind; + AInfo.Use24HourFormat := Use24HourFormat; +end; + +function TcxCustomTimeEditProperties.GetTimePartLength(AKind: TcxTimeEditZoneKind): Integer; +begin + Result := 2; +end; + +function TcxCustomTimeEditProperties.GetTimePartPos(AKind: TcxTimeEditZoneKind): Integer; +begin + if AKind = tzTimeSuffix then + Result := (3 - Integer(TimeFormat)) * 3 + 1 + else + Result := Integer(AKind) * 3 + 1; +end; + +function TcxCustomTimeEditProperties.GetTimeSuffixKind: TcxTimeSuffixKind; +begin + Result := tskAMPMString; +end; + +function TcxCustomTimeEditProperties.IsDisplayValueNumeric: Boolean; +begin + Result := False; +end; + +function TcxCustomTimeEditProperties.IsEditValueNumeric: Boolean; +begin + Result := False; +end; + +function TcxCustomTimeEditProperties.PrepareValue(const AValue: TcxEditValue): Variant; +begin + Result := 0; +end; + +function TcxCustomTimeEditProperties.PreserveSelection: Boolean; +begin + Result := True; +end; + +function TcxCustomTimeEditProperties.GetEditingPlace( + APos: Integer): TcxTimeEditZoneKind; +var + ATimeStringLength: Integer; + ATimeZoneChar: Char; + S: string; +begin + ATimeStringLength := (3 - Integer(TimeFormat)) * 3 - 1; + if (MaxLength > 0) and (APos > MaxLength) then + APos := MaxLength; + if (APos > ATimeStringLength) and not Use24HourFormat then + begin + Result := tzTimeSuffix; + Exit; + end; + S := UpperCase(cxTimeEditFormats[TimeFormat, Use24HourFormat, 0]); + if APos > Length(S) then + APos := Length(S); + ATimeZoneChar := S[APos]; + if not ((ATimeZoneChar = 'H') or (ATimeZoneChar = 'N') or + (ATimeZoneChar = 'S')) then + begin + Inc(APos); + if APos > Length(S) then + APos := Length(S); + ATimeZoneChar := S[APos]; + end; + + case ATimeZoneChar of + 'H': + Result := tzHour; + 'N': + Result := tzMin; + else + Result := tzSec; + end; +end; + +procedure TcxCustomTimeEditProperties.UpdateEditMask; +begin + EditMask := cxTimeEditFormats[FTimeFormat, FUse24HourFormat, 1]; +end; + +procedure TcxCustomTimeEditProperties.SetAutoCorrectHours(Value: Boolean); +begin + if Value <> FAutoCorrectHours then + FAutoCorrectHours := Value; +end; + +procedure TcxCustomTimeEditProperties.SetUse24HourFormat(Value: Boolean); +begin + if Value <> FUse24HourFormat then + begin + FUse24HourFormat := Value; + UpdateEditMask; + Changed; + end; +end; + +procedure TcxCustomTimeEditProperties.SetShowDate(Value: Boolean); +begin + if Value <> FShowDate then + begin + FShowDate := Value; + Changed; + end; +end; + +procedure TcxCustomTimeEditProperties.SetTimeFormat(Value: TcxTimeEditTimeFormat); +begin + if FTimeFormat <> Value then + begin + FTimeFormat := Value; + UpdateEditMask; + Changed; + end; +end; + +procedure TcxCustomTimeEditProperties.SetUseTimeFormatWhenUnfocused( + Value: Boolean); +begin + if FUseTimeFormatWhenUnfocused <> Value then + begin + FUseTimeFormatWhenUnfocused := Value; + Changed; + end; +end; + +{ TcxCustomTimeEdit } + +procedure TcxCustomTimeEdit.Clear; +begin + Time := 0; +end; + +class function TcxCustomTimeEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomTimeEditProperties; +end; + +function TcxCustomTimeEdit.Increment(AButton: TcxSpinEditButton): Boolean; +var + ACursorPosition: Integer; + ASelStart, ASelLength: Integer; +begin + ACursorPosition := 0; + ASelLength := 0; + if HandleAllocated then + begin + ASelStart := SelStart; + if EditingPlace = tzTimeSuffix then + begin + ACursorPosition := (3 - Integer(ActiveProperties.TimeFormat)) * 3; + while IsSpace(DisplayValue[ACursorPosition]) do + Inc(ACursorPosition); + if IsPM(TDateTime(Time)) then + ASelLength := Length(TimeAMString) + else + ASelLength := Length(TimePMString); + Dec(ACursorPosition); + end else + begin + ASelLength := 1; + case ASelStart of + 0..1: + ACursorPosition := 1; + 2..4: + ACursorPosition := 4; + else + ACursorPosition := 7; + end; + end; + end; + Result := inherited Increment(AButton); + if HandleAllocated then + SetSelection(ACursorPosition, ASelLength); +end; + +procedure TcxCustomTimeEdit.PrepareEditValue(const ADisplayValue: TcxEditValue; + out EditValue: TcxEditValue; AEditFocused: Boolean); + + function GetCorrectTimeSuffix(const ASuffix: string): string; + var + APos: Integer; + begin + APos := Pos(TimeAMString, ASuffix); + if APos <> 0 then + Result := TimeAMString + else + Result := TimePMString; + end; + +var + ATimeStringLength: Integer; + AText: string; + AValue: Double; +begin + AText := ADisplayValue; + ATimeStringLength := (3 - Integer(ActiveProperties.TimeFormat)) * 3 - 1; + if not ActiveProperties.Use24HourFormat then + AText := Copy(AText, 1, ATimeStringLength); + if Length(AText) = 2 then + AText := AText + ':00'; // delphi bug + if not ActiveProperties.Use24HourFormat then + AText := AText + GetCorrectTimeSuffix( + Copy(ADisplayValue, ATimeStringLength + 1, + Length(ADisplayValue) - ATimeStringLength)); + AValue := 0; + try + try + if AText <> '' then + AValue := StrToTime(AText); + except + AValue := 0; + end + finally + AValue := FSavedDate + AValue * cxSign(FSavedDate); + EditValue := AValue; + end; + if EditValue <> 0 then + EditValue := VarAsType(EditValue, varDate); +end; + +function TcxCustomTimeEdit.GetIncrement(AButton: TcxSpinEditButton): Double; +var + AEditingPlace: TcxTimeEditZoneKind; + AIsForwardDirection: Boolean; +begin + Result := 0; + AIsForwardDirection := AButton in [sebForward, sebFastForward]; + AEditingPlace := EditingPlace; + case AEditingPlace of + tzTimeSuffix: + begin + Result := cxTimeEditHalfDayIncrement; + if AIsForwardDirection and (Value >= cxTimeEditHalfDayIncrement) or + not AIsForwardDirection and (Value < cxTimeEditHalfDayIncrement) then + Result := -Result; + end; + tzHour: Result := cxTimeEditOneHourIncrement; + tzMin: Result := cxTimeEditOneMinIncrement; + tzSec: Result := cxTimeEditOneSecIncrement; + end; + if (AEditingPlace in [tzMin, tzSec]) and (AButton in [sebFastBackward, sebFastForward]) then + Result := Result * 10; + if not AIsForwardDirection then + Result := -Result; +end; + +function TcxCustomTimeEdit.GetValue: Variant; +var + AHours, ATimeSuffixLength, AValue: Integer; + S: string; +begin + S := Text; + AHours := StrToInt(Copy(S, 1, 2)); + if not ActiveProperties.Use24HourFormat then + AHours := AHours mod 12; + AValue := AHours * 60 * 60; + if ActiveProperties.TimeFormat <> tfHour then + AValue := AValue + StrToInt(Copy(S, 4, 2)) * 60; + if ActiveProperties.TimeFormat = tfHourMinSec then + AValue := AValue + StrToInt(Copy(S, 7, 2)); + ATimeSuffixLength := Length(TimePMString); + if not ActiveProperties.Use24HourFormat and InternalCompareString(Copy(S, + Length(S) - ATimeSuffixLength + 1, ATimeSuffixLength), TimePMString, True) then + Inc(AValue, 12 * 60 * 60); + Result := AValue; +end; + +function TcxCustomTimeEdit.IncrementValueToStr(const AValue: TcxEditValue): string; +var + ATime: TDateTime; +begin + ATime := AValue; + Result := inherited IncrementValueToStr(ATime * {$IFDEF DELPHI7}MSecsPerSec{$ELSE}1000{$ENDIF} / MSecsPerDay); +end; + +procedure TcxCustomTimeEdit.Initialize; +begin + inherited Initialize; + ControlStyle := ControlStyle - [csSetCaption]; +end; + +function TcxCustomTimeEdit.InternalGetEditingValue: TcxEditValue; +begin + PrepareEditValue(Text, Result, True); +end; + +function TcxCustomTimeEdit.InternalGetText: string; +begin + Result := DisplayValue; +end; + +procedure TcxCustomTimeEdit.InternalSetDisplayValue(const Value: TcxEditValue); +begin + if ActiveProperties.Use24HourFormat or (VarToStr(Value) <> '') then + inherited InternalSetDisplayValue(Value) + else + InnerTextEdit.EditValue := Value; +end; + +procedure TcxCustomTimeEdit.InternalSetEditValue(const Value: TcxEditValue; + AValidateEditValue: Boolean); +var + AValue: TcxEditValue; + AIsEditValueValid: Boolean; +begin + AValue := Value; + AIsEditValueValid := not AValidateEditValue or ActiveProperties.IsEditValueValid(AValue, InternalFocused); + if VarIsNull(Value) or not AIsEditValueValid then + FSavedDate := 0 + else + if VarIsStr(AValue) then + FSavedDate := TDate(DateOf(StrToDateTime(Value))) + else + FSavedDate := TDate(DateOf(Value)); + inherited InternalSetEditValue(Value, AValidateEditValue); +end; + +function TcxCustomTimeEdit.InternalSetText(const Value: string): Boolean; +begin + Result := SetDisplayText(Value); +end; + +function TcxCustomTimeEdit.IsValidChar(AChar: Char): Boolean; +begin + Result := True; +end; + +function TcxCustomTimeEdit.IsCharValidForPos(var AChar: Char; + APos: Integer): Boolean; +var + ATimeZoneInfo: TcxTimeEditZoneInfo; +begin + ActiveProperties.GetTimeZoneInfo(APos, ATimeZoneInfo); + Result := IsCharValidForTimeEdit(Self, AChar, APos, ATimeZoneInfo); +end; + +procedure TcxCustomTimeEdit.PropertiesChanged(Sender: TObject); +begin + if not Focused then + DataBinding.UpdateDisplayValue; + SelStart := Length(DisplayValue); + inherited PropertiesChanged(Sender); +end; + +procedure TcxCustomTimeEdit.SetValue(const Value: Variant); +var + ATime: TDateTime; +begin + ATime := Value; + Time := ATime * {$IFDEF DELPHI7}MSecsPerSec{$ELSE}1000{$ENDIF} / MSecsPerDay; +end; + +function TcxCustomTimeEdit.EditingPlace: TcxTimeEditZoneKind; +begin + Result := ActiveProperties.GetEditingPlace(SelStart + 1); +end; + +function TcxCustomTimeEdit.GetProperties: TcxCustomTimeEditProperties; +begin + Result := TcxCustomTimeEditProperties(FProperties); +end; + +function TcxCustomTimeEdit.GetActiveProperties: TcxCustomTimeEditProperties; +begin + Result := TcxCustomTimeEditProperties(InternalGetActiveProperties); +end; + +function TcxCustomTimeEdit.GetTime: TTime; +var + AValue: TcxEditValue; +begin + Result := TTime(SysUtils.Now); + try + if Focused then + begin + PrepareEditValue(DisplayValue, AValue, True); + Result := TTime(VarAsType(AValue, varDate)); + end + else + if VarIsStr(EditValue) then + Result := TTime(StrToDateTime(EditValue)) + else + begin + Result := TTime(VarAsType(EditValue, varDate)); + end; + finally + Result := Abs(Frac(Result)); + end; +end; + +procedure TcxCustomTimeEdit.SetProperties(Value: TcxCustomTimeEditProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomTimeEdit.SetTime(Value: TTime); +begin + InternalEditValue := VarToDateTime( + Abs(Frac(Value)) * cxSign(FSavedDate) + FSavedDate); +end; + +{ TcxTimeEdit } + +class function TcxTimeEdit.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxTimeEditProperties; +end; + +function TcxTimeEdit.GetActiveProperties: TcxTimeEditProperties; +begin + Result := TcxTimeEditProperties(InternalGetActiveProperties); +end; + +function TcxTimeEdit.GetProperties: TcxTimeEditProperties; +begin + Result := TcxTimeEditProperties(FProperties); +end; + +procedure TcxTimeEdit.SetProperties(Value: TcxTimeEditProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxFilterTimeEditHelper } + +class procedure TcxFilterTimeEditHelper.InitializeEdit(AEdit: TcxCustomEdit; + AEditProperties: TcxCustomEditProperties); +begin + inherited InitializeEdit(AEdit, AEditProperties); + TcxTimeEdit(AEdit).Time := 0; +end; + +class function TcxFilterTimeEditHelper.GetFilterEditClass: TcxCustomEditClass; +begin + Result := TcxTimeEdit; +end; + +initialization + cxTimeEditHalfDayIncrement := 12 * 60 * 60; + cxTimeEditOneHourIncrement := 60 * 60; + cxTimeEditOneMinIncrement := 60; + cxTimeEditOneSecIncrement := 1; + FTimeEditFormatListener := TcxTimeEditFormatListener.Create(nil); + + GetRegisteredEditProperties.Register(TcxTimeEditProperties, scxSEditRepositoryTimeItem); + FilterEditsController.Register(TcxTimeEditProperties, TcxFilterTimeEditHelper); + +finalization + FilterEditsController.Unregister(TcxTimeEditProperties, TcxFilterTimeEditHelper); + FreeAndNil(FTimeEditFormatListener); + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxTrackBar.pas b/official/x.35/ExpressEditors Library 5/Sources/cxTrackBar.pas new file mode 100644 index 00000000..75457ba9 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxTrackBar.pas @@ -0,0 +1,2372 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxTrackBar; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, Variants, +{$ENDIF} + Windows, Classes, Controls, Forms, Graphics, Messages, SysUtils, cxClasses, + cxContainer, cxControls, cxCustomData, cxEdit, cxExtEditConsts, cxLookAndFeelPainters, + cxFilterControlUtils, cxGraphics, cxLookAndFeels, cxTextEdit, cxVariants, Math; + +type + TcxTrackBarOrientation = (tboHorizontal, tboVertical); + TcxTrackBarTextOrientation = (tbtoHorizontal, tbtoVertical); + TcxTrackBarTickMarks = (cxtmBoth, cxtmTopLeft, cxtmBottomRight); + TcxTrackBarTickType = (tbttTicks, tbttNumbers, tbttValueNumber); + TcxTrackBarMouseState = (tbmpInControl, tbmpUnderThumb, tbmpSliding); + TcxTrackBarMouseStates = set of TcxTrackBarMouseState; + TcxTrackBarSlideState = (tbksNormal, tbksIncludeSelection); + TcxTrackBarThumbType = (cxttNone, cxttRegular, cxttCustom); + TcxTrackBarThumbStep = (cxtsNormal, cxtsJump); + + TcxGetThumbRectEvent = procedure(Sender: TObject; var ARect: TRect) of object; + TcxDrawThumbEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + const ARect: TRect) of object; + + { TcxTrackBarStyle } + + TcxTrackBarStyle = class(TcxEditStyle) + protected + function DefaultBorderStyle: TcxContainerBorderStyle; override; + function DefaultHotTrack: Boolean; override; + end; + + { TcxCustomTrackBarViewInfo } + + TcxCustomTrackBar = class; + + TcxCustomTrackBarViewInfo = class(TcxCustomTextEditViewInfo) + private + FLookAndFeel: TcxLookAndFeel; + FPosition: Integer; + FSelectionEnd: Integer; + FSelectionStart: Integer; + FShowSelection: Boolean; + FTBBitmap: TBitmap; + FTBCanvas: TcxCanvas; + FThumbHeight: Integer; + FThumbWidth: Integer; + FTrackBarState: Integer; + FTrackSize: Integer; + function GetEdit: TcxCustomTrackBar; + protected + RealTrackBarRect: TRect; + TrackBarRect: TRect; + TrackZoneRect: TRect; + TrackRect: TRect; + ThumbRect: TRect; + SelectionRect: TRect; + FromBorderIndent: Integer; + procedure DrawTrack(ACanvas: TcxCanvas); virtual; + procedure DrawSelection(ACanvas: TcxCanvas); virtual; + procedure DrawTicks(ACanvas: TcxCanvas); virtual; + procedure DrawThumb(ACanvas: TcxCanvas); virtual; + function DrawingThumbRectToRealThumbRect(ACanvas: TcxCanvas): TRect; virtual; + function GetThumbThemeType: Byte; virtual; + procedure PaintTrackBar(ACanvas: TcxCanvas); virtual; + public + FocusRect: TRect; + HasForegroundImage: Boolean; + MouseStates: TcxTrackBarMouseStates; + NeedPointer: Boolean; + ThumbLargeSize, ThumbSize, TrackRectDelta: Integer; + TickColor: TColor; + TickOffset: Double; + TrackBarBorderWidth: Integer; + TrackHeight, TrackWidth: Integer; + + procedure Assign(Source: TObject); override; + procedure DrawText(ACanvas: TcxCanvas); override; + function GetUpdateRegion(AViewInfo: TcxContainerViewInfo): TcxRegion; override; + function IsHotTrack: Boolean; overload; override; + function IsHotTrack(P: TPoint): Boolean; overload; override; + function NeedShowHint(ACanvas: TcxCanvas; const P: TPoint; out AText: TCaption; + out AIsMultiLine: Boolean; out ATextRect: TRect): Boolean; override; + procedure Offset(DX, DY: Integer); override; + procedure Paint(ACanvas: TcxCanvas); override; + constructor Create; override; + destructor Destroy; override; + + property Edit: TcxCustomTrackBar read GetEdit; + property LookAndFeel: TcxLookAndFeel read FLookAndFeel write FLookAndFeel; + property Position: Integer read FPosition write FPosition; + property SelectionEnd: Integer read FSelectionEnd write FSelectionEnd; + property SelectionStart: Integer read FSelectionStart write FSelectionStart; + property ThumbHeight: Integer read FThumbHeight write FThumbHeight; + property ThumbWidth: Integer read FThumbWidth write FThumbWidth; + property TrackBarState: Integer read FTrackBarState write FTrackBarState; + property TrackSize: Integer read FTrackSize write FTrackSize; + end; + + { TcxCustomTrackBarViewData } + + TcxCustomTrackBarProperties = class; + + TcxCustomTrackBarViewData = class(TcxCustomEditViewData) + private + procedure GetOnGetThumbRect(out AValue: TcxGetThumbRectEvent); + function GetProperties: TcxCustomTrackBarProperties; + protected + procedure CalculateCustomTrackBarRects(ACanvas: TcxCanvas; + AViewInfo: TcxCustomTrackBarViewInfo); virtual; + function InternalGetEditConstantPartSize(ACanvas: TcxCanvas; AIsInplace: Boolean; + AEditSizeProperties: TcxEditSizeProperties; + var MinContentSize: TSize; AViewInfo: TcxCustomEditViewInfo): TSize; override; + function GetTopLeftTickSize(ACanvas: TcxCanvas; + AViewInfo: TcxCustomTrackBarViewInfo; ALeftTop: Boolean): Integer; virtual; + procedure CalculateTBViewInfoProps(AViewInfo: TcxCustomEditViewInfo); virtual; + procedure CalculateTrackBarRect(AViewInfo: TcxCustomTrackBarViewInfo); virtual; + procedure CalculateTrackZoneRect(ACanvas: TcxCanvas; + AViewInfo: TcxCustomTrackBarViewInfo); virtual; + procedure CalculateTrackRect(AViewInfo: TcxCustomTrackBarViewInfo); virtual; + procedure CalculateThumbSize(AViewInfo: TcxCustomTrackBarViewInfo); virtual; + procedure CalculateThumbRect(ACanvas: TcxCanvas; + AViewInfo: TcxCustomTrackBarViewInfo); virtual; + procedure CalculateSelectionRect(AViewInfo: TcxCustomTrackBarViewInfo); virtual; + procedure DoOnGetThumbRect(var ARect: TRect); + function IsOnGetThumbRectEventAssigned: Boolean; + public + procedure Calculate(ACanvas: TcxCanvas; const ABounds: TRect; const P: TPoint; + Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); override; + procedure EditValueToDrawValue(ACanvas: TcxCanvas; const AEditValue: TcxEditValue; + AViewInfo: TcxCustomEditViewInfo); override; + property Properties: TcxCustomTrackBarProperties read GetProperties; + end; + + { TcxCustomTrackBarProperties } + + TcxCustomTrackBarProperties = class(TcxCustomEditProperties) + private + FAutoSize: Boolean; + FBorderWidth: Integer; + FFrequency: Integer; + FMin: Integer; + FMax: Integer; + FOrientation: TcxTrackBarOrientation; + FTextOrientation: TcxTrackBarTextOrientation; + FPageSize: TcxNaturalNumber; + FSelectionStart: Integer; + FSelectionEnd: Integer; + FSelectionColor: TColor; + FShowTicks: Boolean; + FThumbType: TcxTrackBarThumbType; + FShowTrack: Boolean; + FTickColor: TColor; + FTickType: TcxTrackBarTickType; + FTickMarks: TcxTrackBarTickMarks; + FTickSize: TcxNaturalNumber; + FTrackColor: TColor; + FTrackSize: Integer; + FTrackRect: TRect; + FThumbRect: TRect; + FThumbHeight: Integer; + FThumbWidth: Integer; + FThumbColor: TColor; + FThumbHighlightColor: TColor; + FThumbStep: TcxTrackBarThumbStep; + FTickOffset: Double; + FOnGetThumbRect: TcxGetThumbRectEvent; + FOnDrawThumb: TcxDrawThumbEvent; + procedure SetAutoSize(Value: Boolean); + procedure SetBorderWidth(Value: Integer); + procedure SetFrequency(Value: Integer); + procedure SetMin(Value: Integer); + procedure SetMax(Value: Integer); + procedure SetOrientation(Value: TcxTrackBarOrientation); + procedure SetTextOrientation(Value: TcxTrackBarTextOrientation); + procedure SetPageSize(Value: TcxNaturalNumber); + procedure SetSelectionStart(Value: Integer); + procedure SetSelectionEnd(Value: Integer); + procedure SetSelectionColor(Value: TColor); + procedure SetShowTicks(Value: Boolean); + procedure SetThumbType(Value: TcxTrackBarThumbType); + procedure SetShowTrack(Value: Boolean); + procedure SetTickColor(Value: TColor); + procedure SetTickType(Value: TcxTrackBarTickType); + procedure SetTickMarks(Value: TcxTrackBarTickMarks); + procedure SetTickSize(Value: TcxNaturalNumber); + procedure SetTrackColor(Value: TColor); + procedure SetTrackSize(Value: Integer); + procedure SetThumbHeight(Value: Integer); + procedure SetThumbWidth(Value: Integer); + procedure SetThumbColor(Value: TColor); + procedure SetThumbHighlightColor(Value: TColor); + procedure DoDrawThumb(Sender: TObject; ACanvas: TcxCanvas; const ARect: TRect); + protected + class function GetViewDataClass: TcxCustomEditViewDataClass; override; + function HasDisplayValue: Boolean; override; + function FixPosition(const APosition: Integer): Integer; virtual; + function EditValueToPosition(const AEditValue: TcxEditValue): Integer; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function CanCompareEditValue: Boolean; override; + class function GetContainerClass: TcxContainerClass; override; + function GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; override; + class function GetStyleClass: TcxCustomEditStyleClass; override; + function GetSupportedOperations: TcxEditSupportedOperations; override; + class function GetViewInfoClass: TcxContainerViewInfoClass; override; + function IsEditValueValid(var EditValue: TcxEditValue; AEditFocused: Boolean): Boolean; override; + procedure PrepareDisplayValue(const AEditValue: TcxEditValue; + var DisplayValue: TcxEditValue; AEditFocused: Boolean); override; + // !!! + property AutoSize: Boolean read FAutoSize write SetAutoSize default True; + property BorderWidth: Integer read FBorderWidth write SetBorderWidth + default 0; + property Frequency: Integer read FFrequency write SetFrequency default 1; + property Max: Integer read FMax write SetMax default 10; + property Min: Integer read FMin write SetMin default 0; + property Orientation: TcxTrackBarOrientation read FOrientation + write SetOrientation default tboHorizontal; + property PageSize: TcxNaturalNumber read FPageSize write SetPageSize + default 1; + property SelectionColor: TColor read FSelectionColor write SetSelectionColor + default clHighlight; + property SelectionEnd: Integer read FSelectionEnd write SetSelectionEnd + default 0; + property SelectionStart: Integer read FSelectionStart + write SetSelectionStart default 0; + property ShowTicks: Boolean read FShowTicks write SetShowTicks default True; + property ShowTrack: Boolean read FShowTrack write SetShowTrack default True; + property TextOrientation: TcxTrackBarTextOrientation read FTextOrientation + write SetTextOrientation default tbtoHorizontal; + property ThumbColor: TColor read FThumbColor write SetThumbColor + default clBtnFace; + property ThumbHeight: Integer read FThumbHeight write SetThumbHeight + default 12; + property ThumbHighlightColor: TColor read FThumbHighlightColor + write SetThumbHighlightColor default clSilver; + property ThumbStep: TcxTrackBarThumbStep read FThumbStep write FThumbStep + default cxtsNormal; + property ThumbType: TcxTrackBarThumbType read FThumbType write SetThumbType + default cxttRegular; + property ThumbWidth: Integer read FThumbWidth write SetThumbWidth default 7; + property TickColor: TColor read FTickColor write SetTickColor + default clWindowText; + property TickMarks: TcxTrackBarTickMarks read FTickMarks write SetTickMarks + default cxtmBottomRight; + property TickSize: TcxNaturalNumber read FTickSize write SetTickSize + default 3; + property TickType: TcxTrackBarTickType read FTickType write SetTickType + default tbttTicks; + property TrackColor: TColor read FTrackColor write SetTrackColor + default clWindow; + property TrackSize : Integer read FTrackSize write SetTrackSize default 5; + property OnDrawThumb: TcxDrawThumbEvent read FOnDrawThumb + write FOnDrawThumb; + property OnGetThumbRect: TcxGetThumbRectEvent read FOnGetThumbRect + write FOnGetThumbRect; + end; + + { TcxTrackBarProperties } + + TcxTrackBarProperties = class(TcxCustomTrackBarProperties) + published + property AutoSize; + property BorderWidth; + property ClearKey; + property Frequency; + property Max; + property Min; + property Orientation; + property PageSize; + property SelectionColor; + property SelectionEnd; + property SelectionStart; + property ShowTicks; + property ShowTrack; + property TextOrientation; + property ThumbColor; + property ThumbHeight; + property ThumbHighlightColor; + property ThumbStep; + property ThumbType; + property ThumbWidth; + property TickColor; + property TickMarks; + property TickSize; + property TickType; + property TrackColor; + property TrackSize; + property OnChange; + property OnDrawThumb; + property OnGetThumbRect; + end; + + { TcxCustomTrackBar } + + TcxCustomTrackBar = class(TcxCustomEdit) + private + FSlideState: TcxTrackBarSlideState; + FStartSelectionPosition: Integer; + function GetStyle: TcxTrackBarStyle; + procedure SetStyle(Value: TcxTrackBarStyle); + procedure SetNewSelectionPosition(const ANewPosition: Integer); + function GetPosition: Integer; + procedure SetPosition(Value: Integer); + function GetProperties: TcxCustomTrackBarProperties; + function GetActiveProperties: TcxCustomTrackBarProperties; + procedure GetOnGetThumbRect(out AValue: TcxGetThumbRectEvent); + function GetViewInfo: TcxCustomTrackBarViewInfo; + procedure SetProperties(Value: TcxCustomTrackBarProperties); + procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + protected + function DefaultParentColor: Boolean; override; + procedure FillSizeProperties(var AEditSizeProperties: TcxEditSizeProperties); override; + procedure Initialize; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseEnter(AControl: TControl); override; + procedure MouseLeave(AControl: TControl); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure SynchronizeDisplayValue; override; + function WantNavigationKeys: Boolean; override; + procedure InternalSetPosition(Value: Integer); + property ViewInfo: TcxCustomTrackBarViewInfo read GetViewInfo; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxCustomTrackBarProperties + read GetActiveProperties; + property Position: Integer read GetPosition write SetPosition default 0; + property Properties: TcxCustomTrackBarProperties read GetProperties + write SetProperties; + property Style: TcxTrackBarStyle read GetStyle write SetStyle; + property Transparent; + end; + + { TcxCustomTrackBar } + + TcxTrackBar = class(TcxCustomTrackBar) + private + function GetActiveProperties: TcxTrackBarProperties; + function GetProperties: TcxTrackBarProperties; + procedure SetProperties(Value: TcxTrackBarProperties); + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxTrackBarProperties read GetActiveProperties; + published + property Align; + property Anchors; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Position; + property Properties: TcxTrackBarProperties read GetProperties + write SetProperties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Transparent; + property Visible; + property OnContextPopup; + property OnDragDrop; + property OnDragOver; + property OnEditing; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +uses + cxEditConsts, cxEditPaintUtils, cxEditUtils, cxExtEditUtils, cxSpinEdit, + dxThemeConsts, dxThemeManager, dxUxTheme; + +const + BetweenTrackAndTick = 1; + FromBorderIndent = 7; + +type + { TcxFilterTrackBarHelper } + + TcxFilterTrackBarHelper = class(TcxFilterSpinEditHelper) + public + class procedure InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); override; + end; + +procedure CalculateCustomTrackBarViewInfo(ACanvas: TcxCanvas; AViewData: TcxCustomTrackBarViewData; + AViewInfo: TcxCustomTrackBarViewInfo); + + procedure CheckFocusRectBounds; + begin + with AViewInfo do + begin + if FocusRect.Left < TextRect.Left - 1 then + FocusRect.Left := TextRect.Left - 1; + if FocusRect.Top < TextRect.Top - 1 then + FocusRect.Top := TextRect.Top - 1; + if FocusRect.Right > TextRect.Right + 1 then + FocusRect.Right := TextRect.Right + 1; + if FocusRect.Bottom > TextRect.Bottom + 1 then + FocusRect.Bottom := TextRect.Bottom + 1; + end; + end; + +begin + with AViewInfo do + begin + BackgroundColor := AViewData.Style.Color; + if not IsInplace and Focused then + if Length(Text) = 0 then + FocusRect := cxEmptyRect + else + begin + FocusRect := TextRect; + InflateRect(FocusRect, 1, 1); + CheckFocusRectBounds; + end; + end; +end; + +procedure DrawBottomRightThumb(ACanvas: TcxCanvas; const AThumbRect: TRect; + const AOrientation: TcxTrackBarOrientation; const AThumbSize: Integer; + const AKind: TcxLookAndFeelKind; const AThumbColor: TColor); +var + FX, FY: Integer; + FLightPolyLine: array[0..3] of TPoint; + FShadowPolyLine: array[0..2] of TPoint; + FDarkPolyLine: array[0..2] of TPoint; + FPolygon: array[0..5] of TPoint; +begin + if AOrientation = tboVertical then + begin + FX := AThumbRect.Right - (AThumbSize div 2); + + FLightPolyLine[0] := Point(AThumbRect.Left, AThumbRect.Bottom); + FLightPolyLine[1] := Point(AThumbRect.Left, AThumbRect.Top); + FLightPolyLine[2] := Point(FX, AThumbRect.Top); + FLightPolyLine[3] := Point(AThumbRect.Right, AThumbRect.Top + (AThumbSize div 2)); + + FShadowPolyLine[0] := Point(AThumbRect.Left + 1, AThumbRect.Bottom); + FShadowPolyLine[1] := Point(AThumbRect.Right - (AThumbSize div 2), AThumbRect.Bottom); + FShadowPolyLine[2] := Point(AThumbRect.Right - 1, AThumbRect.Bottom - (AThumbSize div 2) + 1); + + FDarkPolyLine[0] := Point(AThumbRect.Left, AThumbRect.Bottom + 1); + FDarkPolyLine[1] := Point(AThumbRect.Right - (AThumbSize div 2), AThumbRect.Bottom + 1); + FDarkPolyLine[2] := Point(AThumbRect.Right, AThumbRect.Bottom - (AThumbSize div 2) + 1); + + FPolygon[0] := Point(AThumbRect.Left + 1, AThumbRect.Bottom); + FPolygon[1] := Point(AThumbRect.Left + 1, AThumbRect.Top + 1); + FPolygon[2] := Point(FX, AThumbRect.Top + 1); + FPolygon[3] := Point(AThumbRect.Right - 1, AThumbRect.Top + (AThumbSize div 2)); + FPolygon[4] := Point(AThumbRect.Right - 1, AThumbRect.Top + (AThumbSize div 2) + 1); + FPolygon[5] := Point(AThumbRect.Right - (AThumbSize div 2), AThumbRect.Bottom); + end else + begin + FY := AThumbRect.Bottom - (AThumbSize div 2); + + FLightPolyLine[0] := Point(AThumbRect.Right, AThumbRect.Top); + FLightPolyLine[1] := Point(AThumbRect.Left, AThumbRect.Top); + FLightPolyLine[2] := Point(AThumbRect.Left, FY); + FLightPolyLine[3] := Point(AThumbRect.Left + (AThumbSize div 2), AThumbRect.Bottom); + + FShadowPolyLine[0] := Point(AThumbRect.Left + (AThumbSize div 2), AThumbRect.Bottom - 1); + FShadowPolyLine[1] := Point(AThumbRect.Right - 1, FY); + FShadowPolyLine[2] := Point(AThumbRect.Right - 1, AThumbRect.Top + 1); + + FDarkPolyLine[0] := Point(AThumbRect.Left + (AThumbSize div 2), AThumbRect.Bottom); + FDarkPolyLine[1] := Point(AThumbRect.Right, FY); + FDarkPolyLine[2] := Point(AThumbRect.Right, AThumbRect.Top); + + FPolygon[0] := Point(AThumbRect.Right - 1, AThumbRect.Top + 1); + FPolygon[1] := Point(AThumbRect.Left + 1, AThumbRect.Top + 1); + FPolygon[2] := Point(AThumbRect.Left + 1, FY); + FPolygon[3] := Point(AThumbRect.Left + (AThumbSize div 2) - 1, AThumbRect.Bottom - 1); + FPolygon[4] := Point(AThumbRect.Left + (AThumbSize div 2), AThumbRect.Bottom - 1); + FPolygon[5] := Point(AThumbRect.Right - 1, FY); + end; + InternalPolyLine(ACanvas, FLightPolyLine, clWindow); + InternalPolyLine(ACanvas, FShadowPolyLine, clBtnShadow); + InternalPolyLine(ACanvas, FDarkPolyLine, clWindowText); + ACanvas.Pen.Color := AThumbColor; + ACanvas.Brush.Color := AThumbColor; + ACanvas.Polygon(FPolygon); + case AKind of + lfStandard: + begin + InternalPolyLine(ACanvas, FLightPolyLine, clBtnHighlight); + InternalPolyLine(ACanvas, FShadowPolyLine, clBtnShadow); + InternalPolyLine(ACanvas, FDarkPolyLine, cl3DDkShadow); + end; + lfFlat: + begin + InternalPolyLine(ACanvas, FLightPolyLine, clBtnHighlight); + InternalPolyLine(ACanvas, FDarkPolyLine, clBtnShadow); + end; + lfUltraFlat, lfOffice11: + begin + InternalPolyLine(ACanvas, FLightPolyLine, clWindowText); + InternalPolyLine(ACanvas, FDarkPolyLine, clWindowText); + end; + end; +end; + +procedure DrawTopLeftThumb(ACanvas: TcxCanvas; const AThumbRect: TRect; + const AOrientation: TcxTrackBarOrientation; const AThumbSize: Integer; + const AKind: TcxLookAndFeelKind; const AThumbColor: TColor); +var + FX, FY: Integer; + FLightPolyLine: array[0..2] of TPoint; + FShadowPolyLine: array[0..3] of TPoint; + FDarkPolyLine: array[0..3] of TPoint; + FPolygon: array[0..5] of TPoint; +begin + if AOrientation = tboVertical then + begin + FX := AThumbRect.Left + (AThumbSize div 2); + + FLightPolyLine[0] := Point(AThumbRect.Right, AThumbRect.Top); + FLightPolyLine[1] := Point(FX, AThumbRect.Top); + FLightPolyLine[2] := Point(AThumbRect.Left, AThumbRect.Top + (AThumbSize div 2)); + + FShadowPolyLine[0] := Point(AThumbRect.Right - 1, AThumbRect.Top + 1); + FShadowPolyLine[1] := Point(AThumbRect.Right - 1, AThumbRect.Bottom); + FShadowPolyLine[2] := Point(AThumbRect.Left + (AThumbSize div 2), AThumbRect.Bottom); + FShadowPolyLine[3] := Point(AThumbRect.Left + 1, AThumbRect.Bottom - (AThumbSize div 2) + 1); + + FDarkPolyLine[0] := Point(AThumbRect.Right, AThumbRect.Top); + FDarkPolyLine[1] := Point(AThumbRect.Right, AThumbRect.Bottom + 1); + FDarkPolyLine[2] := Point(AThumbRect.Left + (AThumbSize div 2), AThumbRect.Bottom + 1); + FDarkPolyLine[3] := Point(AThumbRect.Left, AThumbRect.Bottom - (AThumbSize div 2) + 1); + + FPolygon[0] := Point(AThumbRect.Right - 2, AThumbRect.Bottom); + FPolygon[1] := Point(AThumbRect.Right - 2, AThumbRect.Top + 1); + FPolygon[2] := Point(FX, AThumbRect.Top + 1); + FPolygon[3] := Point(AThumbRect.Left + 1, AThumbRect.Top + (AThumbSize div 2)); + FPolygon[4] := Point(AThumbRect.Left + 1, AThumbRect.Top + (AThumbSize div 2) + 1); + FPolygon[5] := Point(AThumbRect.Left + (AThumbSize div 2), AThumbRect.Bottom); + end else + begin + FY := AThumbRect.Top + (AThumbSize div 2); + + FLightPolyLine[0] := Point(AThumbRect.Left, AThumbRect.Bottom); + FLightPolyLine[1] := Point(AThumbRect.Left, FY); + FLightPolyLine[2] := Point(AThumbRect.Left + (AThumbSize div 2), AThumbRect.Top); + + FShadowPolyLine[0] := Point(AThumbRect.Left + (AThumbSize div 2), AThumbRect.Top + 1); + FShadowPolyLine[1] := Point(AThumbRect.Right - 1, FY); + FShadowPolyLine[2] := Point(AThumbRect.Right - 1, AThumbRect.Bottom - 1); + FShadowPolyLine[3] := Point(AThumbRect.Left, AThumbRect.Bottom - 1); + + FDarkPolyLine[0] := Point(AThumbRect.Left + (AThumbSize div 2), AThumbRect.Top); + FDarkPolyLine[1] := Point(AThumbRect.Right, FY); + FDarkPolyLine[2] := Point(AThumbRect.Right, AThumbRect.Bottom); + FDarkPolyLine[3] := Point(AThumbRect.Left, AThumbRect.Bottom); + + FPolygon[0] := Point(AThumbRect.Right - 1, AThumbRect.Bottom - 2); + FPolygon[1] := Point(AThumbRect.Left + 1, AThumbRect.Bottom - 2); + FPolygon[2] := Point(AThumbRect.Left + 1, FY); + FPolygon[3] := Point(AThumbRect.Left + (AThumbSize div 2) - 1, AThumbRect.Top + 2); + FPolygon[4] := Point(AThumbRect.Left + (AThumbSize div 2), AThumbRect.Top + 2); + FPolygon[5] := Point(AThumbRect.Right - 1, FY); + end; + ACanvas.Pen.Color := AThumbColor; + ACanvas.Brush.Color := AThumbColor; + ACanvas.Polygon(FPolygon); + case AKind of + lfStandard: + begin + InternalPolyLine(ACanvas, FLightPolyLine, clBtnHighlight); + InternalPolyLine(ACanvas, FShadowPolyLine, clBtnShadow); + InternalPolyLine(ACanvas, FDarkPolyLine, cl3DDkShadow); + end; + lfFlat: + begin + InternalPolyLine(ACanvas, FLightPolyLine, clBtnHighlight); + InternalPolyLine(ACanvas, FDarkPolyLine, clBtnShadow); + end; + lfUltraFlat, lfOffice11: + begin + InternalPolyLine(ACanvas, FLightPolyLine, clWindowText); + InternalPolyLine(ACanvas, FDarkPolyLine, clWindowText); + end; + end; +end; + +{ TcxTrackBarStyle } + +function TcxTrackBarStyle.DefaultBorderStyle: TcxContainerBorderStyle; +begin + if IsBaseStyle then + Result := cbsNone + else + Result := inherited DefaultBorderStyle; +end; + +function TcxTrackBarStyle.DefaultHotTrack: Boolean; +begin + Result := False; +end; + +{ TcxCustomTrackBarViewInfo } + +constructor TcxCustomTrackBarViewInfo.Create; +begin + inherited Create; + FLookAndFeel := TcxLookAndFeel.Create(nil); + FTBBitmap := TBitmap.Create; + FTBBitmap.PixelFormat := pfDevice; + FTBCanvas := TcxCanvas.Create(FTBBitmap.Canvas); + MouseStates := []; +end; + +destructor TcxCustomTrackBarViewInfo.Destroy; +begin + FreeAndNil(FTBBitmap); + FreeAndNil(FTBCanvas); + FreeAndNil(FLookAndFeel); + inherited Destroy; +end; + +procedure TcxCustomTrackBarViewInfo.Assign(Source: TObject); +begin + inherited Assign(Source); + if Source is TcxCustomTrackBarViewInfo then + with Source as TcxCustomTrackBarViewInfo do + begin + Self.LookAndFeel.Assign(LookAndFeel); + Self.Position := Position; + Self.TrackSize := TrackSize; + Self.ThumbWidth := ThumbWidth; + Self.ThumbHeight := ThumbHeight; + Self.TrackBarBorderWidth := TrackBarBorderWidth; + Self.TrackBarState := TrackBarState; + Self.SelectionStart := SelectionStart; + Self.SelectionEnd := SelectionEnd; + end; +end; + +function TcxCustomTrackBarViewInfo.GetUpdateRegion(AViewInfo: TcxContainerViewInfo): TcxRegion; +begin + Result := inherited GetUpdateRegion(AViewInfo); + if not (AViewInfo is TcxCustomTrackBarViewInfo) then Exit; +end; + +function TcxCustomTrackBarViewInfo.IsHotTrack: Boolean; +begin + Result := True; +end; + +function TcxCustomTrackBarViewInfo.IsHotTrack(P: TPoint): Boolean; +begin + Result := True; +end; + +function TcxCustomTrackBarViewInfo.NeedShowHint(ACanvas: TcxCanvas; + const P: TPoint; out AText: TCaption; out AIsMultiLine: Boolean; + out ATextRect: TRect): Boolean; +begin + Result := False; +end; + +procedure TcxCustomTrackBarViewInfo.DrawText(ACanvas: TcxCanvas); +begin + {Dummy} +end; + +procedure TcxCustomTrackBarViewInfo.Offset(DX, DY: Integer); +begin + inherited Offset(DX, DY); + OffsetRect(RealTrackBarRect, DX, DY); +end; + +procedure TcxCustomTrackBarViewInfo.Paint(ACanvas: TcxCanvas); + + procedure FillBackground; + var + AIsCustomBackground: Boolean; + begin + if IsInplace then + begin + if Transparent then + BitBlt(FTBCanvas.Canvas.Handle, 0, 0, FTBBitmap.Width, FTBBitmap.Height, + ACanvas.Handle, Bounds.Left, Bounds.Top, SRCCOPY) + else + begin + FTBCanvas.WindowOrg := Bounds.TopLeft; + try + AIsCustomBackground := DrawBackground(FTBCanvas); + finally + FTBCanvas.WindowOrg := Point(0, 0); + end; + if not AIsCustomBackground then + begin + FTBCanvas.Brush.Color := BackgroundColor; + FTBCanvas.FillRect(Rect(0, 0, FTBBitmap.Width, FTBBitmap.Height)); + end; + end; + end + else + if Edit.Transparent or NativeStyle or (Painter <> nil) then + cxDrawTransparentControlBackground(Edit, FTBCanvas, Bounds) + else + DrawCustomEdit(FTBCanvas, Self, True, bpsSolid); + end; + +var + APrevClipRgn: TcxRegion; +begin + FTBBitmap.Width := RectWidth(Bounds); + FTBBitmap.Height := RectHeight(Bounds); + + FillBackground; + + APrevClipRgn := FTBCanvas.GetClipRegion; + try + FTBCanvas.SetClipRegion(TcxRegion.Create(TrackBarRect), roSet); + PaintTrackBar(FTBCanvas); + finally + FTBCanvas.SetClipRegion(APrevClipRgn, roSet); + end; + BitBlt(ACanvas.Canvas.Handle, Bounds.Left, Bounds.Top, + FTBBitmap.Width, FTBBitmap.Height, + FTBCanvas.Handle, 0, 0, SRCCOPY); +end; + +procedure TcxCustomTrackBarViewInfo.PaintTrackBar(ACanvas: TcxCanvas); +var + AEditProperties: TcxCustomTrackBarProperties; +begin + AEditProperties := TcxCustomTrackBarProperties(EditProperties); + if AEditProperties.ShowTrack then + begin + DrawTrack(ACanvas); + if FShowSelection then + DrawSelection(ACanvas); + end; + if AEditProperties.ShowTicks then + DrawTicks(ACanvas); + case AEditProperties.ThumbType of + cxttRegular: + DrawThumb(ACanvas); + cxttCustom: + AEditProperties.DoDrawThumb(Self, ACanvas, ThumbRect); + end; +end; + +procedure TcxCustomTrackBarViewInfo.DrawTrack(ACanvas: TcxCanvas); +var + FEdgeTrackRect: TRect; + FTheme: TdxTheme; + FTrackThemeType: Byte; +begin + FEdgeTrackRect := TrackRect; + if Painter <> nil then + Painter.DrawTrackBar(ACanvas, FEdgeTrackRect, SelectionRect, FShowSelection, + Enabled, TcxCustomTrackBarProperties(EditProperties).Orientation = tboHorizontal) + else + if AreVisualStylesMustBeUsed(LookAndFeel.NativeStyle, totTrackBar) then + begin + FTheme := OpenTheme(totTrackBar); + if TcxCustomTrackBarProperties(EditProperties).Orientation = tboHorizontal then + FTrackThemeType := TKP_TRACK + else + FTrackThemeType := TKP_TRACKVERT; + DrawThemeBackground(FTheme, ACanvas.Handle, FTrackThemeType, FTrackBarState, + FEdgeTrackRect); + end + else + begin + cxEditFillRect(ACanvas, FEdgeTrackRect, TcxCustomTrackBarProperties(EditProperties).TrackColor); + Dec(FEdgeTrackRect.Right); + case LookAndFeel.Kind of + lfStandard: + begin + FEdgeTrackRect := DrawBounds(ACanvas, FEdgeTrackRect, clBtnShadow, clBtnHighlight); + FEdgeTrackRect := DrawBounds(ACanvas, FEdgeTrackRect, cl3DDkShadow, cl3DLight); + end; + lfFlat: + begin + FEdgeTrackRect := DrawBounds(ACanvas, FEdgeTrackRect, clBtnShadow, clBtnHighlight); + FEdgeTrackRect := DrawBounds(ACanvas, FEdgeTrackRect, clBtnFace, clBtnFace); + end; + lfUltraFlat, lfOffice11: + FEdgeTrackRect := DrawBounds(ACanvas, FEdgeTrackRect, clWindowFrame, clWindowFrame); + end; + end; +end; + +procedure TcxCustomTrackBarViewInfo.DrawSelection(ACanvas: TcxCanvas); +begin + if Painter = nil then + cxEditFillRect(ACanvas, SelectionRect, + TcxCustomTrackBarProperties(EditProperties).SelectionColor); +end; + +procedure TcxCustomTrackBarViewInfo.DrawTicks(ACanvas: TcxCanvas); +var + I, X, Y, FDeltaTopLeft, FDeltaX, FDeltaY: Integer; + FCalcTickSize: Integer; + FFrequencyCondition: Boolean; + FTickAsLine: Boolean; + FTextWidth, FTextHeight: Integer; + FLocalFont: TFont; + FTM: TTextMetric; + FLF: TLogFont; + + procedure PrepareIndirectFont(const Angle: Integer); + begin + FLocalFont := TFont.Create; + FLocalFont.Assign(Font); + GetTextMetrics(FLocalFont.Handle, FTM); + if (FTM.tmPitchAndFamily and TMPF_TRUETYPE) = 0 then + FLocalFont.Name := 'Arial'; + cxGetFontData(FLocalFont.Handle, FLF); + FLF.lfEscapement := Angle * 10; + ACanvas.Font.Handle := CreateFontIndirect(FLF); + end; + + procedure RemoveIndirectFont; + begin + FLF.lfEscapement := 0; + ACanvas.Font.Handle := CreateFontIndirect(FLF); + FLocalFont.Free; + end; + + function DrawTickAsLine(ATickValue: Integer): Boolean; + var + AEditProperties: TcxCustomTrackBarProperties; + begin + AEditProperties := TcxCustomTrackBarProperties(EditProperties); + Result := (AEditProperties.TickType = tbttTicks) or ((AEditProperties.TickType = tbttValueNumber) and + not ((ATickValue = AEditProperties.Min) or (ATickValue = AEditProperties.Max) or (ATickValue = Position))); + end; + + function GetBounds(ALeft, ATop, AWidth, AHeight: Integer): TRect; + begin + {$IFDEF DELPHI6} + Result := Types.Bounds(ALeft, ATop, AWidth, AHeight); + {$ELSE} + Result := Classes.Bounds(ALeft, ATop, AWidth, AHeight); + {$ENDIF} + end; + +var + AEditProperties: TcxCustomTrackBarProperties; +begin + AEditProperties := TcxCustomTrackBarProperties(EditProperties); + ACanvas.Font.Assign(Font); + ACanvas.Brush.Color := clBtnFace; + if Painter <> nil then + begin + ACanvas.Font.Color := Painter.TrackBarTicksColor(True); + ACanvas.Pen.Color := Painter.TrackBarTicksColor(False); + end + else + begin + ACanvas.Font.Color := TextColor; + ACanvas.Pen.Color := TickColor; + end; + + if AEditProperties.TextOrientation = tbtoVertical then PrepareIndirectFont(90); + try + if AEditProperties.Orientation = tboVertical then + begin + for I := AEditProperties.Min to AEditProperties.Max do + begin + Y := Trunc(TickOffset * (I - AEditProperties.Min)) + TrackRect.Top + (ThumbSize div 2); + FTickAsLine := DrawTickAsLine(I); + FCalcTickSize := AEditProperties.TickSize; + if (I = AEditProperties.Min) or (I = AEditProperties.Max) then FCalcTickSize := FCalcTickSize + (AEditProperties.TickSize div 2); + FFrequencyCondition := (I = AEditProperties.Min) or (I = AEditProperties.Max) or ((AEditProperties.Frequency > 0) and ((I mod AEditProperties.Frequency) = 0)); + if not FFrequencyCondition then Continue; + if not FTickAsLine then + begin + FTextWidth := ACanvas.TextWidth(IntToStr(I)); + FTextHeight := ACanvas.TextHeight(IntToStr(I)); + if AEditProperties.TextOrientation = tbtoVertical then + begin + FDeltaTopLeft := FTextWidth div 2; + FDeltaX := FTextHeight; + end + else + begin + FDeltaTopLeft := -(FTextHeight div 2); + FDeltaX := FTextWidth; + end; + SetBkMode(ACanvas.Handle, Windows.Transparent); + if AEditProperties.TickMarks in [cxtmBottomRight, cxtmBoth] then + ACanvas.DrawText(IntToStr(I), GetBounds(ThumbRect.Right + BetweenTrackAndTick + 1, + Y + FDeltaTopLeft, FTextWidth + 2, FTextHeight + 2), 0, True); + if AEditProperties.TickMarks in [cxtmTopLeft, cxtmBoth] then + ACanvas.DrawText(IntToStr(I), GetBounds(ThumbRect.Left - BetweenTrackAndTick - FDeltaX, + Y + FDeltaTopLeft, FTextWidth + 2, FTextHeight + 2), 0, True); + end + else + begin + if AEditProperties.TickMarks in [cxtmBottomRight, cxtmBoth] then + begin + ACanvas.MoveTo(ThumbRect.Right + BetweenTrackAndTick + 1, Y); + ACanvas.LineTo(ThumbRect.Right + BetweenTrackAndTick + FCalcTickSize + 1, Y); + end; + if AEditProperties.TickMarks in [cxtmTopLeft, cxtmBoth] then + begin + ACanvas.MoveTo(ThumbRect.Left - (BetweenTrackAndTick + FCalcTickSize), Y); + ACanvas.LineTo(ThumbRect.left - BetweenTrackAndTick, Y); + end; + end; + end; + end + else + begin + for I := AEditProperties.Min to AEditProperties.Max do + begin + X := Trunc(TickOffset * (I - AEditProperties.Min)) + TrackRect.Left + (ThumbSize div 2); + FTickAsLine := DrawTickAsLine(I); + FCalcTickSize := AEditProperties.TickSize; + if (I = AEditProperties.Min) or (I = AEditProperties.Max) then FCalcTickSize := FCalcTickSize + (AEditProperties.TickSize div 2); + FFrequencyCondition := (I = AEditProperties.Min) or (I = AEditProperties.Max) or ((AEditProperties.Frequency > 0) and ((I mod AEditProperties.Frequency) = 0)); + if not FFrequencyCondition then Continue; + if not FTickAsLine then + begin + FTextWidth := ACanvas.TextWidth(IntToStr(I)); + FTextHeight := ACanvas.TextHeight(IntToStr(I)); + if AEditProperties.TextOrientation = tbtoVertical then + begin + FDeltaTopLeft := (FTextHeight div 2) - 1; + FDeltaX := FTextWidth; + FDeltaY := 0; + end + else + begin + FDeltaTopLeft := (FTextWidth div 2); + FDeltaX := 0; + FDeltaY := FTextHeight; + end; + SetBkMode(ACanvas.Handle, Windows.Transparent); + if AEditProperties.TickMarks in [cxtmBottomRight, cxtmBoth] then + ACanvas.DrawText(IntToStr(I), GetBounds(X - FDeltaTopLeft, + ThumbRect.Bottom + BetweenTrackAndTick + FDeltaX, FTextWidth + 2, FTextHeight + 2), 0, True); + if AEditProperties.TickMarks in [cxtmTopLeft, cxtmBoth] then + ACanvas.DrawText(IntToStr(I), GetBounds(X - FDeltaTopLeft, + ThumbRect.Top - (BetweenTrackAndTick + FDeltaY), FTextWidth + 2, FTextHeight + 2), 0, True); + end + else + begin + if AEditProperties.TickMarks in [cxtmBottomRight, cxtmBoth] then + begin + ACanvas.MoveTo(X, ThumbRect.Bottom + BetweenTrackAndTick + 1); + ACanvas.LineTo(X, ThumbRect.Bottom + BetweenTrackAndTick + FCalcTickSize + 1); + end; + if AEditProperties.TickMarks in [cxtmTopLeft, cxtmBoth] then + begin + ACanvas.MoveTo(X, ThumbRect.Top - (BetweenTrackAndTick + FCalcTickSize)); + ACanvas.LineTo(X, ThumbRect.Top - BetweenTrackAndTick); + end; + end; + end; + end; + finally + if AEditProperties.TextOrientation = tbtoVertical then RemoveIndirectFont; + end; +end; + +procedure TcxCustomTrackBarViewInfo.DrawThumb(ACanvas: TcxCanvas); +const + ATrackBarStates2BtnStates: array[1..5] of TcxButtonState = + (cxbsNormal, cxbsHot, cxbsPressed, cxbsHot, cxbsDisabled); + ATrackBarTicks2TicksAlign: array[TcxTrackBarTickMarks] of TcxTrackBarTicksAlign = + (tbtaBoth, tbtaUp, tbtaDown); + + function GetThumbRealColor: TColor; + begin + case TrackBarState of + TUS_DISABLED: + Result := clBtnShadow; + TUS_PRESSED, TUS_HOT: + if LookAndFeel.Kind in [lfUltraFlat, lfOffice11] then + Result := GetEditButtonHighlightColor( + TrackBarState = TUS_PRESSED, LookAndFeel.Kind = lfOffice11) + else + Result := TcxCustomTrackBarProperties(EditProperties).ThumbHighLightColor; + else + Result := TcxCustomTrackBarProperties(EditProperties).ThumbColor; + end; + end; + +var + AEditProperties: TcxCustomTrackBarProperties; + FDrawThumbRect: TRect; + FTheme: TdxTheme; + FThumbRealColor: TColor; +begin + AEditProperties := TcxCustomTrackBarProperties(EditProperties); + if Painter <> nil then + begin + Painter.DrawTrackBarThumb(ACanvas, ThumbRect, + ATrackBarStates2BtnStates[TrackBarState], + AEditProperties.Orientation = tboHorizontal, + ATrackBarTicks2TicksAlign[AEditProperties.TickMarks]); + end + else + if AreVisualStylesMustBeUsed(LookAndFeel.NativeStyle, totTrackBar) then + begin + FTheme := OpenTheme(totTrackBar); + DrawThemeBackground(FTheme, ACanvas.Handle, GetThumbThemeType, + FTrackBarState, ThumbRect); + end + else + begin + FThumbRealColor := GetThumbRealColor; + if NeedPointer then + begin + if (AEditProperties.TickMarks = cxtmBottomRight) then + DrawBottomRightThumb(ACanvas, ThumbRect, AEditProperties.Orientation, ThumbSize, LookAndFeel.Kind, FThumbRealColor) + else + DrawTopLeftThumb(ACanvas, ThumbRect, AEditProperties.Orientation, ThumbSize, LookAndFeel.Kind, FThumbRealColor); + end + else + begin + case LookAndFeel.Kind of + lfStandard: + begin + FDrawThumbRect := DrawBounds(ACanvas, ThumbRect, clWindow, clWindowFrame); + FDrawThumbRect := DrawBounds(ACanvas, FDrawThumbRect, clBtnFace, clBtnShadow); + end; + lfFlat: + FDrawThumbRect := DrawBounds(ACanvas, ThumbRect, clWindow, clBtnShadow); + lfUltraFlat, lfOffice11: + FDrawThumbRect := DrawBounds(ACanvas, ThumbRect, clWindowFrame, clWindowFrame); + end; + + Inc(FDrawThumbRect.Right); + Inc(FDrawThumbRect.Bottom); + ACanvas.Brush.Color := FThumbRealColor; + ACanvas.FillRect(FDrawThumbRect); + end; + end; +end; + +function TcxCustomTrackBarViewInfo.DrawingThumbRectToRealThumbRect( + ACanvas: TcxCanvas): TRect; +var + AThumbSize: TSize; +begin + Result := ThumbRect; + if AreVisualStylesMustBeUsed(NativeStyle, totTrackBar) then + begin + GetThemePartSize(OpenTheme(totTrackBar), ACanvas.Handle, + GetThumbThemeType, TrackBarState, Result, TS_DRAW, AThumbSize); + Result.Left := Result.Left + + (RectWidth(Result) - AThumbSize.cx) div 2; + Result.Top := Result.Top + + (RectHeight(Result) - AThumbSize.cy) div 2; + Result.Right := Result.Left + AThumbSize.cx; + Result.Bottom := Result.Top + AThumbSize.cy; + end + else + ExtendRect(Result, Rect(0, 0, -1, -1)); + OffsetRect(Result, RealTrackBarRect.Left, RealTrackBarRect.Top); +end; + +function TcxCustomTrackBarViewInfo.GetThumbThemeType: Byte; +const + AThumbThemeParts: array[TcxTrackBarTickMarks, Boolean] of Byte = ( + (TKP_THUMB, TKP_THUMBVERT), + (TKP_THUMBTOP, TKP_THUMBLEFT), + (TKP_THUMBBOTTOM, TKP_THUMBRIGHT) + ); +begin + Result := AThumbThemeParts[TcxCustomTrackBarProperties(EditProperties).TickMarks, + TcxCustomTrackBarProperties(EditProperties).Orientation = tboVertical]; +end; + +function TcxCustomTrackBarViewInfo.GetEdit: TcxCustomTrackBar; +begin + Result := TcxCustomTrackBar(FEdit); +end; + +{ TcxCustomTrackBarViewData } + +procedure TcxCustomTrackBarViewData.CalculateTBViewInfoProps(AViewInfo: TcxCustomEditViewInfo); +begin + with TcxCustomTrackBarViewInfo(AViewInfo) do + begin + TrackBarBorderWidth := Properties.BorderWidth; + TrackSize := Properties.TrackSize; + SelectionStart := Properties.SelectionStart; + SelectionEnd := Properties.SelectionEnd; + if not Enabled then + TickColor := clBtnShadow + else + TickColor := Properties.TickColor; + ThumbHeight := Properties.ThumbHeight; + ThumbWidth := Properties.ThumbWidth; + end; +end; + +function TcxCustomTrackBarViewData.GetTopLeftTickSize( + ACanvas: TcxCanvas; AViewInfo: TcxCustomTrackBarViewInfo; + ALeftTop: Boolean): Integer; +var + ACalcNumValue: string; +begin + Result := 0; + if ((Properties.TickMarks <> cxtmBottomRight) and (ALeftTop = True)) or + (Properties.TickMarks <> cxtmTopLeft) and (ALeftTop = False) then + case Properties.TickType of + tbttTicks: Result := Properties.TickSize + BetweenTrackAndTick; + tbttNumbers, tbttValueNumber: + begin + if ((Properties.Orientation = tboHorizontal) and + (Properties.TextOrientation = tbtoHorizontal)) or + ((Properties.Orientation = tboVertical) and + (Properties.TextOrientation = tbtoVertical)) then + Result := ACanvas.TextHeight(IntToStr(Properties.Min)) + else + begin + if Length(IntToStr(Properties.Min)) > Length(IntToStr(Properties.Max)) then + ACalcNumValue := IntToStr(Properties.Min) + else + ACalcNumValue := IntToStr(Properties.Max); + Result := ACanvas.TextWidth(ACalcNumValue); + end; + end; + end; + if AViewInfo.TrackBarBorderWidth = 0 then + Inc(Result, 1); +end; + +procedure TcxCustomTrackBarViewData.CalculateTrackBarRect( + AViewInfo: TcxCustomTrackBarViewInfo); +begin + AViewInfo.RealTrackBarRect := AViewInfo.ClientRect; + AViewInfo.TrackBarRect := AViewInfo.ClientRect; + OffsetRect(AViewInfo.TrackBarRect, -Bounds.Left, -Bounds.Top); + if (RectWidth(AViewInfo.TrackBarRect) div 2) < AViewInfo.TrackBarBorderWidth then + AViewInfo.TrackBarBorderWidth := RectWidth(AViewInfo.TrackBarRect) div 2; + if (RectHeight(AViewInfo.TrackBarRect) div 2) < AViewInfo.TrackBarBorderWidth then + AViewInfo.TrackBarBorderWidth := RectHeight(AViewInfo.TrackBarRect) div 2; +end; + +procedure TcxCustomTrackBarViewData.CalculateTrackZoneRect(ACanvas: TcxCanvas; + AViewInfo: TcxCustomTrackBarViewInfo); +var + FTopLeftIndent, FBottomRightIndent: Integer; + FTrackZoneSize, FRealTrackZoneSize: Integer; + FCustomRect: TRect; +begin + FTopLeftIndent := GetTopLeftTickSize(ACanvas, AViewInfo, True); + FBottomRightIndent := GetTopLeftTickSize(ACanvas, AViewInfo, False); + if Properties.Orientation = tboHorizontal then + FTrackZoneSize := RectHeight(AViewInfo.TrackBarRect) - FTopLeftIndent - FBottomRightIndent + else + FTrackZoneSize := RectWidth(AViewInfo.TrackBarRect) - FTopLeftIndent - FBottomRightIndent; + FRealTrackZoneSize := FTrackZoneSize; + if FTrackZoneSize < 10 then FRealTrackZoneSize := 10; + if FTrackZoneSize > 21 then FRealTrackZoneSize := 21; + + if (Properties.ThumbType = cxttCustom) and + IsOnGetThumbRectEventAssigned then + begin + DoOnGetThumbRect(FCustomRect); +// Properties.OnGetThumbRect(Properties, FCustomRect); + if (Properties.Orientation = tboHorizontal) and + (RectHeight(FCustomRect) > FRealTrackZoneSize) then + FRealTrackZoneSize := RectHeight(FCustomRect); + if (Properties.Orientation = tboVertical) and + (RectWidth(FCustomRect) > FRealTrackZoneSize) then + FRealTrackZoneSize := RectWidth(FCustomRect); + end; + + AViewInfo.FromBorderIndent := FromBorderIndent; + if AViewInfo.Painter <> nil then + AViewInfo.TrackSize := AViewInfo.Painter.TrackBarTrackSize + else + if Properties.AutoSize then + AViewInfo.TrackSize := FRealTrackZoneSize div 2; + + if Properties.Orientation = tboHorizontal then + begin + AViewInfo.TrackZoneRect.Top := AViewInfo.TrackBarRect.Top + + ((FTrackZoneSize - FRealTrackZoneSize) div 2) + FTopLeftIndent; + AViewInfo.TrackZoneRect.Bottom := AViewInfo.TrackZoneRect.Top + FRealTrackZoneSize; + AViewInfo.TrackZoneRect.Left := AViewInfo.TrackBarRect.Left + + AViewInfo.TrackBarBorderWidth + AViewInfo.FromBorderIndent; + AViewInfo.TrackZoneRect.Right := AViewInfo.TrackBarRect.Right - + AViewInfo.TrackBarBorderWidth - AViewInfo.FromBorderIndent; + end + else + begin + AViewInfo.TrackZoneRect.Left := AViewInfo.TrackBarRect.Left + + ((FTrackZoneSize - FRealTrackZoneSize) div 2) + FTopLeftIndent; + AViewInfo.TrackZoneRect.Right := AViewInfo.TrackZoneRect.Left + FRealTrackZoneSize; + AViewInfo.TrackZoneRect.Top := AViewInfo.TrackBarRect.Top + + AViewInfo.TrackBarBorderWidth + AViewInfo.FromBorderIndent; + AViewInfo.TrackZoneRect.Bottom := AViewInfo.TrackBarRect.Bottom - + AViewInfo.TrackBarBorderWidth - AViewInfo.FromBorderIndent; + end; +end; + +procedure TcxCustomTrackBarViewData.CalculateTrackRect( + AViewInfo: TcxCustomTrackBarViewInfo); +begin + if Properties.Orientation = tboHorizontal then + begin + AViewInfo.TrackRect.Left := AViewInfo.TrackZoneRect.Left; + AViewInfo.TrackRect.Right := AViewInfo.TrackZoneRect.Right; + AViewInfo.TrackRect.Top := AViewInfo.TrackZoneRect.Top + + (RectHeight(AViewInfo.TrackZoneRect) - AViewInfo.TrackSize) div 2; + AViewInfo.TrackRect.Bottom := AViewInfo.TrackRect.Top + AViewInfo.TrackSize; + end + else + begin + AViewInfo.TrackRect.Top := AViewInfo.TrackZoneRect.Top; + AViewInfo.TrackRect.Bottom := AViewInfo.TrackZoneRect.Bottom; + AViewInfo.TrackRect.Left := AViewInfo.TrackZoneRect.Left + + (RectWidth(AViewInfo.TrackZoneRect) - AViewInfo.TrackSize) div 2; + AViewInfo.TrackRect.Right := AViewInfo.TrackRect.Left + AViewInfo.TrackSize; + end; + Properties.FTrackRect := AViewInfo.TrackRect; +end; + +procedure TcxCustomTrackBarViewData.CalculateThumbSize( + AViewInfo: TcxCustomTrackBarViewInfo); +var + FMinMaxDiff: Integer; + FTickOffset: Double; + FThumbSize, FThumbLargeSize: Integer; + FCustomRect: TRect; + AThumbSize: TSize; +begin + FMinMaxDiff := Properties.Max - Properties.Min; + if FMinMaxDiff = 0 then FMinMaxDiff := 1; + AViewInfo.NeedPointer := (Properties.TickMarks <> cxtmBoth); + if (Properties.ThumbType = cxttCustom) and IsOnGetThumbRectEventAssigned then + begin + DoOnGetThumbRect(FCustomRect); + if Properties.Orientation = tboHorizontal then + begin + FThumbSize := RectWidth(FCustomRect); + FThumbLargeSize := RectHeight(FCustomRect); + end + else + begin + FThumbSize := RectHeight(FCustomRect); + FThumbLargeSize := RectWidth(FCustomRect); + end; + AViewInfo.ThumbWidth := FThumbSize; + AViewInfo.ThumbHeight := FThumbLargeSize; + end + else + if AViewInfo.Painter <> nil then + begin + AThumbSize := AViewInfo.Painter.TrackBarThumbSize(Properties.Orientation = tboHorizontal); + if Properties.Orientation = tboHorizontal then + begin + FThumbSize := AThumbSize.cx; + FThumbLargeSize := Min(AThumbSize.cy, RectHeight(AViewInfo.TrackZoneRect)); + end + else + begin + FThumbSize := AThumbSize.cy; + FThumbLargeSize := Min(AThumbSize.cx, RectWidth(AViewInfo.TrackZoneRect)); + end; + end + else + begin + if Properties.AutoSize then + begin + FThumbSize := AViewInfo.TrackSize; + if Properties.Orientation = tboHorizontal then + begin + if (FThumbSize mod 2) = 1 then Inc(FThumbSize); + end + else + begin + if (FThumbSize mod 2) = 1 then Dec(FThumbSize); + end; + FThumbLargeSize := FThumbSize * 2 - 1; + end + else + begin + FThumbSize := AViewInfo.ThumbWidth; + FThumbLargeSize := AViewInfo.ThumbHeight - 1; + end; + end; + + if Properties.Orientation = tboHorizontal then + FTickOffset := (RectWidth(AViewInfo.TrackRect) - FThumbSize) / FMinMaxDiff + else + FTickOffset := (RectHeight(AViewInfo.TrackRect) - FThumbSize) / FMinMaxDiff; + AViewInfo.ThumbSize := FThumbSize; + AViewInfo.ThumbLargeSize := FThumbLargeSize; + AViewInfo.TickOffset := FTickOffset; + Properties.FTickOffset := FTickOffset; +end; + +procedure TcxCustomTrackBarViewData.CalculateThumbRect(ACanvas: TcxCanvas; + AViewInfo: TcxCustomTrackBarViewInfo); +var + FCurrentTickOffset: Integer; + FDelta: Integer; +begin + if Properties.Orientation = tboHorizontal then + begin + FCurrentTickOffset := Trunc((AViewInfo.TickOffset * (AViewInfo.Position - Properties.Min)) + + AViewInfo.TrackRect.Left) + (AViewInfo.ThumbSize div 2); + AViewInfo.ThumbRect.Left := FCurrentTickOffset - (AViewInfo.ThumbSize div 2); + AViewInfo.ThumbRect.Right := FCurrentTickOffset + (AViewInfo.ThumbSize div 2); + AViewInfo.ThumbRect.Top := AViewInfo.TrackRect.Top + (AViewInfo.TrackSize div 2) - + (AViewInfo.ThumbLargeSize div 2); + AViewInfo.ThumbRect.Bottom := AViewInfo.ThumbRect.Top + AViewInfo.ThumbLargeSize; + end + else + begin + FCurrentTickOffset := Trunc((AViewInfo.TickOffset * (AViewInfo.Position - Properties.Min)) + + AViewInfo.TrackRect.Top) + (AViewInfo.ThumbSize div 2); + AViewInfo.ThumbRect.Top := FCurrentTickOffset - (AViewInfo.ThumbSize div 2); + AViewInfo.ThumbRect.Bottom := FCurrentTickOffset + (AViewInfo.ThumbSize div 2); + case Properties.TickMarks of + cxtmTopLeft: + if AViewInfo.Painter = nil then + FDelta := -1 + else + FDelta := 0; + else + FDelta := 0; + end; + AViewInfo.ThumbRect.Left := AViewInfo.TrackRect.Left + (AViewInfo.TrackSize - + AViewInfo.ThumbLargeSize) div 2 + FDelta; + AViewInfo.ThumbRect.Right := AViewInfo.ThumbRect.Left + AViewInfo.ThumbLargeSize + FDelta; + end; + if NativeStyle then + begin + if Properties.Orientation = tboHorizontal then + InflateRectEx(AViewInfo.ThumbRect, 1, 0, 1, 0) + else + InflateRectEx(AViewInfo.ThumbRect, 0, 1, 0, 1); + end; + Properties.FThumbRect := AViewInfo.DrawingThumbRectToRealThumbRect(ACanvas); +end; + +procedure TcxCustomTrackBarViewData.CalculateSelectionRect( + AViewInfo: TcxCustomTrackBarViewInfo); +begin + if AViewInfo.SelectionStart < Properties.Min then + AViewInfo.SelectionStart := Properties.Min; + if AViewInfo.SelectionEnd < Properties.Min then + AViewInfo.SelectionEnd := Properties.Min; + if AViewInfo.SelectionStart > Properties.Max then + AViewInfo.SelectionStart := Properties.Max; + if AViewInfo.SelectionEnd > Properties.Max then + AViewInfo.SelectionEnd := Properties.Max; + AViewInfo.FShowSelection := (AViewInfo.SelectionStart < AViewInfo.SelectionEnd); + if AViewInfo.FShowSelection then + begin + if Properties.Orientation = tboHorizontal then + begin + AViewInfo.SelectionRect.Left := Trunc((AViewInfo.TickOffset * (AViewInfo.SelectionStart - Properties.Min)) + + AViewInfo.TrackRect.Left) + (AViewInfo.ThumbSize div 2); + AViewInfo.SelectionRect.Right := Trunc((AViewInfo.TickOffset * (AViewInfo.SelectionEnd - Properties.Min)) + + AViewInfo.TrackRect.Left) + (AViewInfo.ThumbSize div 2) + 1; + AViewInfo.SelectionRect.Top := AViewInfo.TrackRect.Top; + AViewInfo.SelectionRect.Bottom := AViewInfo.TrackRect.Bottom; + if AViewInfo.Painter = nil then + begin + Inc(AViewInfo.SelectionRect.Top, 2); + Dec(AViewInfo.SelectionRect.Bottom); + end; + end + else + begin + AViewInfo.SelectionRect.Top := Trunc((AViewInfo.TickOffset * (AViewInfo.SelectionStart - Properties.Min)) + + AViewInfo.TrackRect.Top) + (AViewInfo.ThumbSize div 2); + AViewInfo.SelectionRect.Bottom := Trunc((AViewInfo.TickOffset * (AViewInfo.SelectionEnd - Properties.Min)) + + AViewInfo.TrackRect.Top) + (AViewInfo.ThumbSize div 2) + 1; + AViewInfo.SelectionRect.Left := AViewInfo.TrackRect.Left; + AViewInfo.SelectionRect.Right := AViewInfo.TrackRect.Right; + if AViewInfo.Painter = nil then + begin + Inc(AViewInfo.SelectionRect.Left, 2); + Dec(AViewInfo.SelectionRect.Right, 2); + end; + end; + end; +end; + +procedure TcxCustomTrackBarViewData.DoOnGetThumbRect(var ARect: TRect); +var + AOnGetThumbRect: TcxGetThumbRectEvent; +begin + GetOnGetThumbRect(AOnGetThumbRect); + AOnGetThumbRect(Properties, ARect); +end; + +function TcxCustomTrackBarViewData.IsOnGetThumbRectEventAssigned: Boolean; +var + AOnGetThumbRect: TcxGetThumbRectEvent; +begin + GetOnGetThumbRect(AOnGetThumbRect); + Result := Assigned(AOnGetThumbRect); +end; + +procedure TcxCustomTrackBarViewData.CalculateCustomTrackBarRects(ACanvas: TcxCanvas; + AViewInfo: TcxCustomTrackBarViewInfo); +begin + CalculateTrackBarRect(AViewInfo); + CalculateTrackZoneRect(ACanvas, AViewInfo); + CalculateTrackRect(AViewInfo); + CalculateThumbSize(AViewInfo); + CalculateThumbRect(ACanvas, AViewInfo); + CalculateSelectionRect(AViewInfo); +end; + +procedure TcxCustomTrackBarViewData.Calculate(ACanvas: TcxCanvas; const ABounds: TRect; + const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; AViewInfo: TcxCustomEditViewInfo; + AIsMouseEvent: Boolean); +var + FViewInfo : TcxCustomTrackBarViewInfo; + FDisplayValue: TcxEditValue; +begin + inherited Calculate(ACanvas, ABounds, P, Button, Shift, AViewInfo, AIsMouseEvent); + + FViewInfo := TcxCustomTrackBarViewInfo(AViewInfo); + + {Standart properties} + FViewInfo.LookAndFeel.Assign(Style.LookAndFeel); + FViewInfo.IsEditClass := False; + FViewInfo.DrawSelectionBar := False; + FViewInfo.HasPopupWindow := False; + FViewInfo.DrawTextFlags := 0; + FViewInfo.DrawSelectionBar := False; + if not FViewInfo.Enabled then + FViewInfo.TrackBarState := TUS_DISABLED + else + begin + if tbmpSliding in FViewInfo.MouseStates then + FViewInfo.TrackBarState := TUS_PRESSED + else + if tbmpUnderThumb in FViewInfo.MouseStates then + FViewInfo.TrackBarState := TUS_HOT + else + FViewInfo.TrackBarState := TUS_NORMAL; + end; + {TrackBar properties} + if Assigned(Edit) and not FViewInfo.IsDBEditPaintCopyDrawing then + begin + Properties.PrepareDisplayValue(Edit.EditValue, FDisplayValue, Focused); + FViewInfo.Position := FDisplayValue; + end; + CalculateTBViewInfoProps(AViewInfo); + CalculateCustomTrackBarViewInfo(ACanvas, Self, FViewInfo); + CalculateCustomTrackBarRects(ACanvas, FViewInfo); +end; + +procedure TcxCustomTrackBarViewData.EditValueToDrawValue(ACanvas: TcxCanvas; + const AEditValue: TcxEditValue; AViewInfo: TcxCustomEditViewInfo); +var + ADisplayValue: TcxEditValue; +begin + Properties.PrepareDisplayValue(AEditValue, ADisplayValue, InternalFocused); + TcxCustomTrackBarViewInfo(AViewInfo).Position := ADisplayValue; +end; + +function TcxCustomTrackBarViewData.InternalGetEditConstantPartSize(ACanvas: TcxCanvas; + AIsInplace: Boolean; AEditSizeProperties: TcxEditSizeProperties; + var MinContentSize: TSize; AViewInfo: TcxCustomEditViewInfo): TSize; +var + ASize1: TSize; +begin + Result := inherited InternalGetEditConstantPartSize(ACanvas, AIsInplace, + AEditSizeProperties, MinContentSize, AViewInfo); + + ASize1.cx := RectWidth(TcxCustomTrackBarViewInfo(AViewInfo).ThumbRect); + ASize1.cy := GetTextEditContentSize(ACanvas, Self, 'Wg', 0, + AEditSizeProperties, 0, False).cy; + Result.cx := Result.cx + ASize1.cx; + Result.cy := Result.cy + ASize1.cy; +end; + +procedure TcxCustomTrackBarViewData.GetOnGetThumbRect(out AValue: TcxGetThumbRectEvent); +begin + if Edit = nil then + AValue := Properties.OnGetThumbRect + else + TcxCustomTrackBar(Edit).GetOnGetThumbRect(AValue); +end; + +function TcxCustomTrackBarViewData.GetProperties: TcxCustomTrackBarProperties; +begin + Result := TcxCustomTrackBarProperties(FProperties); +end; + +{ TcxCustomTrackBarProperties } + +constructor TcxCustomTrackBarProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FAutoSize := True; + FBorderWidth := 0; + FFrequency := 1; + FMin := 0; + FMax := 10; + FOrientation := tboHorizontal; + FTextOrientation := tbtoHorizontal; + FPageSize := 1; + FTrackColor := clWindow; + FTrackSize := 5; + FTickColor := clWindowText; + FSelectionStart := 0; + FSelectionEnd := 0; + FSelectionColor := clHighlight; + FShowTicks := True; + FThumbType := cxttRegular; + FShowTrack := True; + FTickType := tbttTicks; + FTickMarks := cxtmBottomRight; + FTickSize := 3; + FThumbHeight := 12; + FThumbWidth := 7; + FThumbColor := clBtnFace; + FThumbHighlightColor := clSilver; + FThumbStep := cxtsNormal; +end; + +destructor TcxCustomTrackBarProperties.Destroy; +begin + inherited Destroy; +end; + +procedure TcxCustomTrackBarProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomTrackBarProperties then + begin + BeginUpdate; + try + inherited Assign(Source); + with Source as TcxCustomTrackBarProperties do + begin + Self.AutoSize := AutoSize; + Self.BorderWidth := BorderWidth; + Self.Frequency := Frequency; + Self.Min := Min; + Self.Max := Max; + Self.Orientation := Orientation; + Self.TextOrientation := TextOrientation; + Self.PageSize := PageSize; + Self.SelectionStart := SelectionStart; + Self.SelectionEnd := SelectionEnd; + Self.SelectionColor := SelectionColor; + Self.ShowTicks := ShowTicks; + Self.ThumbStep := ThumbStep; + Self.ThumbType := ThumbType; + Self.ShowTrack := ShowTrack; + Self.TickColor := TickColor; + Self.TickType := TickType; + Self.TickMarks := TickMarks; + Self.TickSize := TickSize; + Self.TrackColor := TrackColor; + Self.TrackSize := TrackSize; + Self.ThumbHeight := ThumbHeight; + Self.ThumbWidth := ThumbWidth; + Self.ThumbColor := ThumbColor; + Self.ThumbHighlightColor := ThumbHighlightColor; + Self.OnGetThumbRect := OnGetThumbRect; + Self.OnDrawThumb := OnDrawThumb; + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +function TcxCustomTrackBarProperties.CanCompareEditValue: Boolean; +begin + Result := True; +end; + +class function TcxCustomTrackBarProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxTrackBar; +end; + +function TcxCustomTrackBarProperties.GetDisplayText(const AEditValue: TcxEditValue; + AFullText: Boolean = False; AIsInplace: Boolean = True): WideString; +var + ADisplayValue: TcxEditValue; +begin + PrepareDisplayValue(AEditValue, ADisplayValue, False); + Result := ADisplayValue; +end; + +class function TcxCustomTrackBarProperties.GetStyleClass: TcxCustomEditStyleClass; +begin + Result := TcxTrackBarStyle; +end; + +function TcxCustomTrackBarProperties.GetSupportedOperations: TcxEditSupportedOperations; +begin + Result := [esoAlwaysHotTrack, esoEditing, esoFiltering, esoSorting, + esoTransparency]; +end; + +class function TcxCustomTrackBarProperties.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxCustomTrackBarViewInfo; +end; + +function TcxCustomTrackBarProperties.IsEditValueValid(var EditValue: TcxEditValue; + AEditFocused: Boolean): Boolean; +begin + Result := inherited IsEditValueValid(EditValue, AEditFocused); +end; + +procedure TcxCustomTrackBarProperties.PrepareDisplayValue(const AEditValue: + TcxEditValue; var DisplayValue: TcxEditValue; AEditFocused: Boolean); +begin + LockUpdate(True); + try + DisplayValue := FixPosition(EditValueToPosition(AEditValue)); + finally + LockUpdate(False); + end; +end; + +function TcxCustomTrackBarProperties.EditValueToPosition( + const AEditValue: TcxEditValue): Integer; +begin + if IsVarEmpty(AEditValue) or + not (VarIsOrdinal(AEditValue) or VarIsStr(AEditValue)) then + Result := FMin + else + begin + if VarIsOrdinal(AEditValue) then + Result := VarAsType(AEditValue, varInteger) + else + begin + if IsValidStringForInt(VarToStr(AEditValue)) then + Result := cxStrToInt(VarToStr(AEditValue), False) + else + Result := FMin; + end; + end; +end; + +class function TcxCustomTrackBarProperties.GetViewDataClass: TcxCustomEditViewDataClass; +begin + Result := TcxCustomTrackBarViewData; +end; + +function TcxCustomTrackBarProperties.HasDisplayValue: Boolean; +begin + Result := False; +end; + +procedure TcxCustomTrackBarProperties.SetTrackColor(Value: TColor); +begin + if FTrackColor <> Value then + begin + FTrackColor := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetPageSize(Value: TcxNaturalNumber); +begin + if Value <> FPageSize then + begin + FPageSize := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetSelectionStart(Value: Integer); +begin + if FSelectionStart <> Value then + begin + FSelectionStart := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetSelectionEnd(Value: Integer); +begin + if FSelectionEnd <> Value then + begin + FSelectionEnd := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetSelectionColor(Value: TColor); +begin + if FSelectionColor <> Value then + begin + FSelectionColor := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetBorderWidth(Value: Integer); +begin + if FBorderWidth <> Value then + begin + if Value < 0 then + FBorderWidth := 0 + else + FBorderWidth := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetFrequency(Value: Integer); +begin + if FFrequency <> Value then + begin + if Value < 0 then + FFrequency := 0 + else + FFrequency := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetMin(Value: Integer); +begin + if FMin <> Value then + begin + FMin := Value; + if FMax < FMin then FMax := FMin; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetMax(Value: Integer); +begin + if FMax <> Value then + begin + FMax := Value; + if FMin > FMax then FMin := FMax; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetOrientation(Value: TcxTrackBarOrientation); +begin + if FOrientation <> Value then + begin + FOrientation := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetTextOrientation(Value: TcxTrackBarTextOrientation); +begin + if FTextOrientation <> Value then + begin + FTextOrientation := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetShowTrack(Value: Boolean); +begin + if FShowTrack <> Value then + begin + FShowTrack := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetShowTicks(Value: Boolean); +begin + if FShowTicks <> Value then + begin + FShowTicks := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetThumbType(Value: TcxTrackBarThumbType); +begin + if FThumbType <> Value then + begin + FThumbType := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetTickColor(Value: TColor); +begin + if FTickColor <> Value then + begin + FTickColor := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetTickType(Value: TcxTrackBarTickType); +begin + if FTickType <> Value then + begin + FTickType := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetTickMarks(Value: TcxTrackBarTickMarks); +begin + if FTickMarks <> Value then + begin + FTickMarks := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetTickSize(Value: TcxNaturalNumber); +begin + if FTickSize <> Value then + begin + FTickSize := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetTrackSize(Value: Integer); +begin + if FTrackSize <> Value then + begin + FTrackSize := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetThumbHeight(Value: Integer); +begin + if FThumbHeight <> Value then + begin + FThumbHeight := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetThumbWidth(Value: Integer); +begin + if FThumbWidth <> Value then + begin + FThumbWidth := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetAutoSize(Value: Boolean); +begin + if FAutoSize <> Value then + begin + FAutoSize := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetThumbColor(Value: TColor); +begin + if FThumbColor <> Value then + begin + FThumbColor := Value; + Changed; + end; +end; + +procedure TcxCustomTrackBarProperties.SetThumbHighlightColor(Value: TColor); +begin + if FThumbHighlightColor <> Value then + begin + FThumbHighlightColor := Value; + Changed; + end; +end; + +function TcxCustomTrackBarProperties.FixPosition(const APosition: Integer): Integer; +begin + Result := APosition; + if Result < Min then Result := Min + else + begin + if Result > Max then Result := Max; + end; +end; + +procedure TcxCustomTrackBarProperties.DoDrawThumb(Sender: TObject; ACanvas: TcxCanvas; + const ARect: TRect); +begin + if Assigned(OnDrawThumb) then + OnDrawThumb(Self, ACanvas, ARect); +end; + +{ TcxCustomTrackBar } + +class function TcxCustomTrackBar.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomTrackBarProperties; +end; + +function TcxCustomTrackBar.GetStyle: TcxTrackBarStyle; +begin + Result := TcxTrackBarStyle(FStyles.Style); +end; + +procedure TcxCustomTrackBar.SetStyle(Value: TcxTrackBarStyle); +begin + FStyles.Style := Value; +end; + +procedure TcxCustomTrackBar.SetNewSelectionPosition(const ANewPosition: Integer); +begin + if ANewPosition < FStartSelectionPosition then + begin + ActiveProperties.FSelectionStart := ANewPosition; + ActiveProperties.FSelectionEnd := FStartSelectionPosition; + end + else + begin + ActiveProperties.FSelectionStart := FStartSelectionPosition; + ActiveProperties.FSelectionEnd := ANewPosition; + end; +end; + +function TcxCustomTrackBar.DefaultParentColor: Boolean; +begin + Result := True; +end; + +procedure TcxCustomTrackBar.FillSizeProperties(var AEditSizeProperties: TcxEditSizeProperties); +begin + AEditSizeProperties := DefaultcxEditSizeProperties; + AEditSizeProperties.MaxLineCount := 1; + AEditSizeProperties.Width := ViewInfo.TextRect.Right - ViewInfo.TextRect.Left; +end; + +procedure TcxCustomTrackBar.Initialize; +begin + inherited Initialize; + FEditValue := 0; + FSlideState := tbksNormal; + AutoSize := False; + ControlStyle := ControlStyle - [csDoubleClicks, csClickEvents]; + Width := 196; + Height := 76; +end; + +procedure TcxCustomTrackBar.KeyDown(var Key: Word; Shift: TShiftState); + + function GetNewPosition: Integer; + begin + case Key of + VK_PRIOR: + Result := ActiveProperties.FixPosition(Position - ActiveProperties.PageSize); + VK_NEXT: + Result := ActiveProperties.FixPosition(Position + ActiveProperties.PageSize); + VK_END: + Result := ActiveProperties.Max; + VK_HOME: + Result := ActiveProperties.Min; + VK_LEFT, VK_UP: + Result := ActiveProperties.FixPosition(Pred(Position)); + VK_RIGHT, VK_DOWN: + Result := ActiveProperties.FixPosition(Succ(Position)); + else + Result := Position; + end; + end; + +var + ANewPosition: Integer; +begin + inherited KeyDown(Key, Shift); + + if Key = VK_SHIFT then + begin + if not IsInplace and (FSlideState <> tbksIncludeSelection) then + begin + FSlideState := tbksIncludeSelection; + FStartSelectionPosition := Position; + end; + Exit; + end; + + ANewPosition := GetNewPosition; + if ANewPosition <> Position then + begin + if FSlideState = tbksIncludeSelection then + SetNewSelectionPosition(ANewPosition); + InternalSetPosition(ANewPosition); + end; +end; + +procedure TcxCustomTrackBar.KeyUp(var Key: Word; Shift: TShiftState); +begin + inherited KeyUp(Key, Shift); + if not IsInplace and (Key = VK_SHIFT) then + FSlideState := tbksNormal; +end; + +procedure TcxCustomTrackBar.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + + function GetPositionAfterJump: Integer; + var + FX, FY: Integer; + begin + if ActiveProperties.Orientation = tboHorizontal then + begin + FX := X - ActiveProperties.FTrackRect.Left; + Result := Trunc(FX / ActiveProperties.FTickOffset) + ActiveProperties.Min; + end + else + begin + FY := Y - ActiveProperties.FTrackRect.Top; + Result := Trunc(FY / ActiveProperties.FTickOffset) + ActiveProperties.Min; + end; + end; + + function GetNewHorizontalPosition: Integer; + begin + Result := Position; + if X > ActiveProperties.FThumbRect.Right then + begin + if ActiveProperties.ThumbStep = cxtsNormal then + Result := Position + 1 + else + Result := GetPositionAfterJump; + end + else + if X < ActiveProperties.FThumbRect.Left then + begin + if ActiveProperties.ThumbStep = cxtsNormal then + Result := Position - 1 + else + Result := GetPositionAfterJump; + end; + end; + + function GetNewVerticalPosition: Integer; + begin + Result := Position; + if Y > ActiveProperties.FThumbRect.Bottom then + begin + if ActiveProperties.ThumbStep = cxtsNormal then + Result := Position + 1 + else + Result := GetPositionAfterJump; + end + else + if Y < ActiveProperties.FThumbRect.Top then + begin + if ActiveProperties.ThumbStep = cxtsNormal then + Result := Position - 1 + else + Result := GetPositionAfterJump; + end; + end; + + function GetNewPosition: Integer; + begin + if ActiveProperties.Orientation = tboHorizontal then + Result := GetNewHorizontalPosition + else + Result := GetNewVerticalPosition; + Result := ActiveProperties.FixPosition(Result); + end; + +var + ANewPosition: Integer; +begin + inherited MouseDown(Button, Shift, X, Y); + if Button <> mbLeft then + Exit; + + if PtInRect(ActiveProperties.FThumbRect, Point(X, Y)) then + begin + Include(ViewInfo.MouseStates, tbmpSliding); + if ssCtrl in Shift then + begin + FSlideState := tbksNormal; + ActiveProperties.FSelectionStart := 0; + ActiveProperties.FSelectionEnd := 0; + end; + ShortRefreshContainer(False); + end + else + begin + ANewPosition := GetNewPosition; + if ANewPosition <> Position then + InternalSetPosition(ANewPosition); + end; +end; + +procedure TcxCustomTrackBar.MouseEnter(AControl: TControl); +begin + inherited; + Include(ViewInfo.MouseStates, tbmpInControl); + if (tbmpSliding in ViewInfo.MouseStates) and + not (ssLeft in CurrentShiftState) then + begin + Exclude(ViewInfo.MouseStates, tbmpSliding); + Exclude(ViewInfo.MouseStates, tbmpUnderThumb); + end; +end; + +procedure TcxCustomTrackBar.MouseLeave(AControl: TControl); +begin + Exclude(ViewInfo.MouseStates, tbmpInControl); + Exclude(ViewInfo.MouseStates, tbmpUnderThumb); + inherited; + ShortRefreshContainer(False); +end; + +procedure TcxCustomTrackBar.MouseMove(Shift: TShiftState; X, Y: Integer); +var + FThumbOffset: Double; + NewPos: Integer; + FOldMouseStates: TcxTrackBarMouseStates; + FNewPosition: Integer; +begin + inherited MouseMove(Shift, X, Y); + if (tbmpSliding in ViewInfo.MouseStates) and (ssLeft in CurrentShiftState) then + begin + if ActiveProperties.Orientation = tboVertical then + begin + FThumbOffset := (ActiveProperties.FMax - ActiveProperties.FMin) / Height; + NewPos := Round((Y - ActiveProperties.FThumbRect.Top - + ((ActiveProperties.FThumbRect.Bottom - ActiveProperties.FThumbRect.Top) div 2)) * FThumbOffset); + FNewPosition := ActiveProperties.FixPosition(Position + NewPos); + end + else + begin + FThumbOffset := (ActiveProperties.Max - ActiveProperties.Min) / Width; + NewPos := Round((X - ActiveProperties.FThumbRect.Left - + ((ActiveProperties.FThumbRect.Right - ActiveProperties.FThumbRect.Left) div 2)) * FThumbOffset); + FNewPosition := ActiveProperties.FixPosition(Position + NewPos); + end; + if FNewPosition <> Position then + begin + if (ssShift in CurrentShiftState) and + (FSlideState = tbksIncludeSelection) then + SetNewSelectionPosition(FNewPosition); + InternalSetPosition(FNewPosition); + end; + end + else + begin + FOldMouseStates := ViewInfo.MouseStates; + if PtInRect(ActiveProperties.FThumbRect, Point(X, Y)) then + Include(ViewInfo.MouseStates, tbmpUnderThumb) + else + Exclude(ViewInfo.MouseStates, tbmpUnderThumb); + if ViewInfo.MouseStates <> FOldMouseStates then + ShortRefreshContainer(False); +// ActiveProperties.ThumbChanged; + end; +end; + +procedure TcxCustomTrackBar.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + FOldMouseStates: TcxTrackBarMouseStates; +begin + inherited MouseUp(Button, Shift, X, Y); + FOldMouseStates := ViewInfo.MouseStates; + Exclude(ViewInfo.MouseStates, tbmpSliding); + if PtInRect(ActiveProperties.FThumbRect, Point(X, Y)) then + Include(ViewInfo.MouseStates, tbmpUnderThumb) + else + Exclude(ViewInfo.MouseStates, tbmpUnderThumb); + if FOldMouseStates <> ViewInfo.MouseStates then + ShortRefreshContainer(False); +// ActiveProperties.ThumbChanged; + SetCaptureControl(nil); +end; + +procedure TcxCustomTrackBar.SynchronizeDisplayValue; +begin + ShortRefreshContainer(False); +end; + +function TcxCustomTrackBar.WantNavigationKeys: Boolean; +begin + Result := True; +end; + +procedure TcxCustomTrackBar.InternalSetPosition(Value: Integer); +begin + Value := ActiveProperties.FixPosition(Value); + if (Value <> Position) and DoEditing then + begin + InternalEditValue := Value; + ActiveProperties.Changed; + ModifiedAfterEnter := True; + InternalPostEditValue; + end; +end; + +function TcxCustomTrackBar.GetProperties: TcxCustomTrackBarProperties; +begin + Result := TcxCustomTrackBarProperties(FProperties); +end; + +function TcxCustomTrackBar.GetActiveProperties: TcxCustomTrackBarProperties; +begin + Result := TcxCustomTrackBarProperties(InternalGetActiveProperties); +end; + +procedure TcxCustomTrackBar.GetOnGetThumbRect(out AValue: TcxGetThumbRectEvent); +begin + AValue := Properties.OnGetThumbRect; + if not Assigned(AValue) then + AValue := ActiveProperties.OnGetThumbRect; +end; + +function TcxCustomTrackBar.GetViewInfo: TcxCustomTrackBarViewInfo; +begin + Result := TcxCustomTrackBarViewInfo(FViewInfo); +end; + +procedure TcxCustomTrackBar.SetProperties(Value: TcxCustomTrackBarProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomTrackBar.WMLButtonUp(var Message: TWMLButtonUp); +begin + ControlState := ControlState - [csClicked]; + inherited; +end; + +procedure TcxCustomTrackBar.WMGetDlgCode(var Message: TWMGetDlgCode); +begin + Message.Result := DLGC_WANTARROWS; + if IsInplace then + Message.Result := Message.Result or DLGC_WANTTAB; +end; + +function TcxCustomTrackBar.GetPosition: Integer; +begin + Result := ActiveProperties.FixPosition( + ActiveProperties.EditValueToPosition(FEditValue)); +end; + +procedure TcxCustomTrackBar.SetPosition(Value: Integer); +begin + if not IsLoading then + Value := ActiveProperties.FixPosition(Value); + if Value <> Position then + InternalEditValue := Value; +end; + +{ TcxCustomTrackBar } + +class function TcxTrackBar.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxTrackBarProperties; +end; + +function TcxTrackBar.GetActiveProperties: TcxTrackBarProperties; +begin + Result := TcxTrackBarProperties(InternalGetActiveProperties); +end; + +function TcxTrackBar.GetProperties: TcxTrackBarProperties; +begin + Result := TcxTrackBarProperties(FProperties); +end; + +procedure TcxTrackBar.SetProperties(Value: TcxTrackBarProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxFilterTrackBarHelper } + +class procedure TcxFilterTrackBarHelper.InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); +begin + inherited InitializeProperties(AProperties, AEditProperties, AHasButtons); + with TcxCustomSpinEditProperties(AProperties) do + begin + Buttons.Add; + Buttons.Add; + MinValue := TcxCustomTrackBarProperties(AEditProperties).Min; + MaxValue := TcxCustomTrackBarProperties(AEditProperties).Max; + LargeIncrement := TcxCustomTrackBarProperties(AEditProperties).PageSize; + end; +end; + +initialization + GetRegisteredEditProperties.Register(TcxTrackBarProperties, scxSEditRepositoryTrackBarItem); + FilterEditsController.Register(TcxTrackBarProperties, TcxFilterTrackBarHelper); + +finalization + FilterEditsController.Unregister(TcxTrackBarProperties, TcxFilterTrackBarHelper); + GetRegisteredEditProperties.Unregister(TcxTrackBarProperties); + +end. + diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxTreeView.pas b/official/x.35/ExpressEditors Library 5/Sources/cxTreeView.pas new file mode 100644 index 00000000..6fb817a3 --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxTreeView.pas @@ -0,0 +1,1526 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +{$DEFINE USETCXSCROLLBAR} + +unit cxTreeView; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, ComCtrls, CommCtrl, Controls, Forms, ImgList, Menus, + Messages, StdCtrls, SysUtils, cxClasses, cxContainer, cxControls, + cxExtEditConsts, cxGraphics, cxLookAndFeels, cxScrollBar; + +type + { TcxCustomInnerTreeView } + + TcxCustomTreeView = class; + + TcxCustomInnerTreeView = class(TTreeView, IUnknown, + IcxContainerInnerControl) + private + FCanvas: TcxCanvas; + FContainer: TcxCustomTreeView; + FIsRedrawLocked: Boolean; + FItemHeight: Integer; + FLookAndFeel: TcxLookAndFeel; + function GetControl: TWinControl; + function GetControlContainer: TcxContainer; + procedure HScrollHandler(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer); + procedure SetItemHeight(Value: Integer); + procedure SetLookAndFeel(Value: TcxLookAndFeel); + procedure VScrollHandler(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer); +{$IFNDEF DELPHI6} + function GetScrollWidth: Integer; + procedure SetScrollWidth(const Value: Integer); +{$ENDIF} + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + procedure WMKillFocus(var Message: TWMKillFocus); message WM_KILLFOCUS; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure WMSetFocus(var Message: TWMSetFocus); message WM_SETFOCUS; + procedure WMSetRedraw(var Message: TWMSetRedraw); message WM_SETREDRAW; + procedure WMWindowPosChanged(var Message: TWMWindowPosChanged); message WM_WINDOWPOSCHANGED; + procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure CNNotify(var Message: TWMNotify); message CN_NOTIFY; + procedure WMFontChange(var Message: TMessage); message WM_FONTCHANGE; + procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; + protected + procedure Click; override; + procedure DblClick; override; + procedure DestroyWindowHandle; override; + function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure CreateWindowHandle(const Params: TCreateParams); override; + procedure WndProc(var Message: TMessage); override; + procedure MouseEnter(AControl: TControl); dynamic; + procedure MouseLeave(AControl: TControl); dynamic; + property Container: TcxCustomTreeView read FContainer; + property LookAndFeel: TcxLookAndFeel read FLookAndFeel write SetLookAndFeel; + procedure Expand(Node: TTreeNode); override; + procedure Change(Node: TTreeNode); override; + procedure Collapse(Node: TTreeNode); override; + procedure UpdateItemHeight; + property IsRedrawLocked: Boolean read FIsRedrawLocked; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure DefaultHandler(var Message); override; + procedure DragDrop(Source: TObject; X, Y: Integer); override; + property Canvas: TcxCanvas read FCanvas; + property ItemHeight: Integer read FItemHeight write SetItemHeight default -1; +{$IFNDEF DELPHI6} + property ScrollWidth: Integer read GetScrollWidth write SetScrollWidth default 0; +{$ENDIF} + end; + + TcxCustomInnerTreeViewClass = class of TcxCustomInnerTreeView; + + { TcxCustomTreeView } + + TcxCustomTreeView = class(TcxContainer) + private + FTreeView: TcxCustomInnerTreeView; + function GetAutoExpand: Boolean; + function GetChangeDelay: Integer; + function GetHideSelection: Boolean; + function GetHotTrack: Boolean; + function GetImages: TCustomImageList; + function GetItemHeight: Integer; + function GetTreeNodes: TTreeNodes; + function GetIndent: Integer; +{$IFDEF DELPHI6} + function GetMultiSelect: Boolean; + function GetMultiSelectStyle: TMultiSelectStyle; + function GetOnCreateNodeClass: TTVCreateNodeClassEvent; + procedure SetMultiSelectStyle(Value: TMultiSelectStyle); + procedure SetOnCreateNodeClass(Value: TTVCreateNodeClassEvent); + function GetOnAddition: TTVExpandedEvent; + function GetOnCancelEdit: TTVChangedEvent; +{$ENDIF} + function GetReadOnly: Boolean; + function GetRightClickSelect: Boolean; + function GetRowSelect: Boolean; + function GetShowButtons: Boolean; + function GetShowLines: Boolean; + function GetShowRoot: Boolean; + function GetSortType: TSortType; + function GetStateImages: TCustomImageList; + function GetToolTips: Boolean; + function GetTreeViewCanvas: TcxCanvas; +{$IFDEF DELPHI5} + function GetOnAdvancedCustomDraw: TTVAdvancedCustomDrawEvent; + function GetOnAdvancedCustomDrawItem: TTVAdvancedCustomDrawItemEvent; +{$ENDIF} + function GetOnChange: TTVChangedEvent; + function GetOnChanging: TTVChangingEvent; + function GetOnCollapsed: TTVExpandedEvent; + function GetOnCollapsing: TTVCollapsingEvent; + function GetOnCompare: TTVCompareEvent; + function GetOnCustomDraw: TTVCustomDrawEvent; + function GetOnCustomDrawItem: TTVCustomDrawItemEvent; + function GetOnDeletion: TTVExpandedEvent; + function GetOnEditing: TTVEditingEvent; + function GetOnEdited: TTVEditedEvent; + function GetOnExpanding: TTVExpandingEvent; + function GetOnExpanded: TTVExpandedEvent; + function GetOnGetImageIndex: TTVExpandedEvent; + function GetOnGetSelectedIndex: TTVExpandedEvent; + function GetDropTarget: TTreeNode; + function GetSelected: TTreeNode; + function GetTopItem: TTreeNode; +{$IFDEF DELPHI6} + function GetSelectionCount: Cardinal; + function GetSelection(Index: Integer): TTreeNode; + procedure SetMultiSelect(Value: Boolean); +{$ENDIF} + procedure SetAutoExpand(Value: Boolean); + procedure SetChangeDelay(Value: Integer); + procedure SetHideSelection(Value: Boolean); + procedure SetHotTrack(Value: Boolean); + procedure SetImages(Value: TCustomImageList); + procedure SetTreeNodes(Value: TTreeNodes); + procedure SetIndent(Value: Integer); + procedure SetItemHeight(Value: Integer); + procedure SetRightClickSelect(Value: Boolean); + procedure SetReadOnly(Value: Boolean); + procedure SetRowSelect(Value: Boolean); + procedure SetShowButtons(Value: Boolean); + procedure SetShowLines(Value: Boolean); + procedure SetShowRoot(Value: Boolean); + procedure SetSortType(Value: TSortType); + procedure SetStateImages(Value: TCustomImageList); + procedure SetToolTips(Value: Boolean); +{$IFDEF DELPHI6} + procedure SetOnAddition(Value: TTVExpandedEvent); + procedure SetOnCancelEdit(Value: TTVChangedEvent); +{$ENDIF} +{$IFDEF DELPHI5} + procedure SetOnAdvancedCustomDraw(Value: TTVAdvancedCustomDrawEvent); + procedure SetOnAdvancedCustomDrawItem(Value: TTVAdvancedCustomDrawItemEvent); +{$ENDIF} + procedure SetOnChange(Value: TTVChangedEvent); + procedure SetOnChanging(Value: TTVChangingEvent); + procedure SetOnCollapsed(Value: TTVExpandedEvent); + procedure SetOnCollapsing(Value: TTVCollapsingEvent); + procedure SetOnCompare(Value: TTVCompareEvent); + procedure SetOnCustomDraw(Value: TTVCustomDrawEvent); + procedure SetOnCustomDrawItem(Value: TTVCustomDrawItemEvent); + procedure SetOnDeletion(Value: TTVExpandedEvent); + procedure SetOnEditing(Value: TTVEditingEvent); + procedure SetOnEdited(Value: TTVEditedEvent); + procedure SetOnExpanding(Value: TTVExpandingEvent); + procedure SetOnExpanded(Value: TTVExpandedEvent); + procedure SetOnGetImageIndex(Value: TTVExpandedEvent); + procedure SetOnGetSelectedIndex(Value: TTVExpandedEvent); + procedure SetDropTarget(Value: TTreeNode); + procedure SetSelected(Value: TTreeNode); + procedure SetTopItem(Value: TTreeNode); + procedure CNNotify(var Message: TWMNotify); message CN_NOTIFY; + protected + { Protected declarations } + function CanResize(var NewWidth, NewHeight: Integer): Boolean; override; + procedure FontChanged; override; + function IsReadOnly: Boolean; override; + function NeedsScrollBars: Boolean; override; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); override; + procedure SetSize; override; + procedure WriteState(Writer: TWriter); override; + + function GetInnerTreeView: TcxCustomInnerTreeView; virtual; + class function GetTreeViewClass: TcxCustomInnerTreeViewClass; virtual; + procedure InternalInitTreeView; virtual; + {TreeView} + function CanEdit(Node: TTreeNode): Boolean; + function CanChange(Node: TTreeNode): Boolean; + function CanCollapse(Node: TTreeNode): Boolean; + function CanExpand(Node: TTreeNode): Boolean; + procedure Collapse(Node: TTreeNode); + procedure Expand(Node: TTreeNode); + property AutoExpand: Boolean read GetAutoExpand write SetAutoExpand; + property ChangeDelay: Integer read GetChangeDelay write SetChangeDelay default 0; + property HideSelection: Boolean read GetHideSelection write SetHideSelection default True; + property HotTrack: Boolean read GetHotTrack write SetHotTrack; + property Images: TCustomImageList read GetImages write SetImages; + property ItemHeight: Integer read GetItemHeight write SetItemHeight default -1; + property Items: TTreeNodes read GetTreeNodes write SetTreeNodes; + property Indent: Integer read GetIndent write SetIndent default 19; +{$IFDEF DELPHI6} + property MultiSelect: Boolean read GetMultiSelect write SetMultiSelect; + property MultiSelectStyle: TMultiSelectStyle read GetMultiSelectStyle + write SetMultiSelectStyle default [msControlSelect]; +{$ENDIF} + property ReadOnly: Boolean read GetReadOnly write SetReadOnly default False; + property RightClickSelect: Boolean read GetRightClickSelect write SetRightClickSelect; + property RowSelect: Boolean read GetRowSelect write SetRowSelect; + property ShowButtons: Boolean read GetShowButtons write SetShowButtons; + property ShowLines: Boolean read GetShowLines write SetShowLines; + property ShowRoot: Boolean read GetShowRoot write SetShowRoot; + property SortType: TSortType read GetSortType write SetSortType; + property StateImages: TCustomImageList read GetStateImages write SetStateImages; + property ToolTips: Boolean read GetToolTips write SetToolTips; +{$IFDEF DELPHI6} + property OnAddition: TTVExpandedEvent read GetOnAddition write SetOnAddition; + property OnCancelEdit: TTVChangedEvent read GetOnCancelEdit write SetOnCancelEdit; +{$ENDIF} +{$IFDEF DELPHI5} + property OnAdvancedCustomDraw: TTVAdvancedCustomDrawEvent read GetOnAdvancedCustomDraw write SetOnAdvancedCustomDraw; + property OnAdvancedCustomDrawItem: TTVAdvancedCustomDrawItemEvent read GetOnAdvancedCustomDrawItem write SetOnAdvancedCustomDrawItem; +{$ENDIF} + property OnChange: TTVChangedEvent read GetOnChange write SetOnChange; + property OnChanging: TTVChangingEvent read GetOnChanging write SetOnChanging; + property OnCollapsed: TTVExpandedEvent read GetOnCollapsed write SetOnCollapsed; + property OnCollapsing: TTVCollapsingEvent read GetOnCollapsing write SetOnCollapsing; + property OnCompare: TTVCompareEvent read GetOnCompare write SetOnCompare; + property OnCustomDraw: TTVCustomDrawEvent read GetOnCustomDraw write SetOnCustomDraw; + property OnCustomDrawItem: TTVCustomDrawItemEvent read GetOnCustomDrawItem write SetOnCustomDrawItem; + property OnDeletion: TTVExpandedEvent read GetOnDeletion write SetOnDeletion; + property OnEditing: TTVEditingEvent read GetOnEditing write SetOnEditing; + property OnEdited: TTVEditedEvent read GetOnEdited write SetOnEdited; + property OnExpanding: TTVExpandingEvent read GetOnExpanding write SetOnExpanding; + property OnExpanded: TTVExpandedEvent read GetOnExpanded write SetOnExpanded; + property OnGetImageIndex: TTVExpandedEvent read GetOnGetImageIndex write SetOnGetImageIndex; + property OnGetSelectedIndex: TTVExpandedEvent read GetOnGetSelectedIndex write SetOnGetSelectedIndex; +{$IFDEF DELPHI6} + property OnCreateNodeClass: TTVCreateNodeClassEvent read GetOnCreateNodeClass write SetOnCreateNodeClass; +{$ENDIF} + public + { Public declarations } + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function AlphaSort{$IFDEF DELPHI6}( + ARecurse: Boolean = True){$ENDIF}: Boolean; + function CustomSort(SortProc: TTVCompare; Data: Longint{$IFDEF DELPHI6}; + ARecurse: Boolean = True{$ENDIF}): Boolean; + procedure FullCollapse; + procedure FullExpand; + function GetHitTestInfoAt(X, Y: Integer): THitTests; + function GetNodeAt(X, Y: Integer): TTreeNode; + function IsEditing: Boolean; + procedure LoadFromFile(const FileName: string); + procedure LoadFromStream(Stream: TStream); + procedure SaveToFile(const FileName: string); + procedure SaveToStream(Stream: TStream); + procedure SetScrollBarsParameters(AIsScrolling: Boolean = False); override; + property DropTarget: TTreeNode read GetDropTarget write SetDropTarget; + property Selected: TTreeNode read GetSelected write SetSelected; + property TopItem: TTreeNode read GetTopItem write SetTopItem; + property TreeViewCanvas: TcxCanvas read GetTreeViewCanvas; +{$IFDEF DELPHI6} + procedure Select(Node: TTreeNode; ShiftState: TShiftState = []); overload; virtual; + procedure Select(const Nodes: array of TTreeNode); overload; virtual; + procedure Select(Nodes: TList); overload; virtual; + procedure Deselect(Node: TTreeNode); virtual; + procedure Subselect(Node: TTreeNode; Validate: Boolean = False); virtual; + property SelectionCount: Cardinal read GetSelectionCount; + property Selections[Index: Integer]: TTreeNode read GetSelection; + procedure ClearSelection(KeepPrimary: Boolean = False); virtual; + function GetSelections(AList: TList): TTreeNode; + function FindNextToSelect: TTreeNode; virtual; +{$ENDIF} + property InnerTreeView: TcxCustomInnerTreeView read GetInnerTreeView; + end; + + { TcxTreeView } + + TcxTreeView = class(TcxCustomTreeView) + public + property TreeViewCanvas; + published + property Align; + property Anchors; + property BiDiMode; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property Height default 100; + property ParentBiDiMode; + property ParentColor default False; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property Width default 120; + property OnClick; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property AutoExpand default False; + property ChangeDelay default 0; + property HideSelection default True; + property HotTrack default False; + property Images; + property ItemHeight; + property Items; + property Indent; +{$IFDEF DELPHI6} + property MultiSelect default False; + property MultiSelectStyle; +{$ENDIF} + property ReadOnly; + property RightClickSelect default False; + property RowSelect default False; + property ShowButtons default True; + property ShowLines default True; + property ShowRoot default True; + property SortType default stNone; + property StateImages; + property ToolTips default True; +{$IFDEF DELPHI6} + property OnAddition; + property OnCancelEdit; +{$ENDIF} +{$IFDEF DELPHI5} + property OnAdvancedCustomDraw; + property OnAdvancedCustomDrawItem; +{$ENDIF} + property OnChange; + property OnChanging; + property OnCollapsed; + property OnCollapsing; + property OnCompare; + property OnCustomDraw; + property OnCustomDrawItem; + property OnDeletion; + property OnEditing; + property OnEdited; + property OnExpanding; + property OnExpanded; + property OnGetImageIndex; + property OnGetSelectedIndex; +{$IFDEF DELPHI6} + property OnCreateNodeClass; +{$ENDIF} + end; + +implementation + +uses + Graphics; + +{ TcxCustomInnerTreeView } + +constructor TcxCustomInnerTreeView.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FCanvas := TcxCanvas.Create(inherited Canvas); + FItemHeight := -1; + FLookAndFeel := TcxLookAndFeel.Create(Self); + BorderStyle := bsNone; + ControlStyle := ControlStyle + [csDoubleClicks]; + ParentColor := False; + ParentFont := True; +end; + +destructor TcxCustomInnerTreeView.Destroy; +begin + FreeAndNil(FLookAndFeel); + FreeAndNil(FCanvas); + inherited Destroy; +end; + +procedure TcxCustomInnerTreeView.DefaultHandler(var Message); +begin + if (Container = nil) or + not Container.InnerControlDefaultHandler(TMessage(Message)) then + inherited DefaultHandler(Message); +end; + +procedure TcxCustomInnerTreeView.DragDrop(Source: TObject; X, Y: Integer); +begin + if Container <> nil then + Container.DragDrop(Source, Left + X, Top + Y); +end; + +procedure TcxCustomInnerTreeView.Click; +begin + inherited Click; + if Container <> nil then + _TcxContainerAccess.Click(Container); +end; + +procedure TcxCustomInnerTreeView.DblClick; +begin + inherited DblClick; + if Container <> nil then + _TcxContainerAccess.DblClick(Container); +end; + +procedure TcxCustomInnerTreeView.DestroyWindowHandle; +begin + FIsRedrawLocked := False; + inherited DestroyWindowHandle; +end; + +function TcxCustomInnerTreeView.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; +begin + Result := (Container <> nil) and + _TcxContainerAccess.DoMouseWheel(Container, Shift, WheelDelta, MousePos); + if not Result then + inherited DoMouseWheel(Shift, WheelDelta, MousePos); +end; + +procedure TcxCustomInnerTreeView.DragOver(Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); +begin + if Container <> nil then + _TcxContainerAccess.DragOver(Container, Source, Left + X, Top + Y, State, Accept); +end; + +procedure TcxCustomInnerTreeView.KeyDown(var Key: Word; Shift: TShiftState); +begin + if Container <> nil then + _TcxContainerAccess.KeyDown(Container, Key, Shift); + if Key <> 0 then + inherited KeyDown(Key, Shift); +end; + +procedure TcxCustomInnerTreeView.KeyPress(var Key: Char); +begin + if (Key = Char(VK_TAB)) then + Key := #0; + if Container <> nil then + _TcxContainerAccess.KeyPress(Container, Key); + if Word(Key) = VK_RETURN then + Key := #0; + if Key <> #0 then + inherited KeyPress(Key); +end; + +procedure TcxCustomInnerTreeView.KeyUp(var Key: Word; Shift: TShiftState); +begin + if (Key = VK_TAB) then + Key := 0; + if Container <> nil then + _TcxContainerAccess.KeyUp(Container, Key, Shift); + if Key <> 0 then + inherited KeyUp(Key, Shift); +end; + +procedure TcxCustomInnerTreeView.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + if Container <> nil then + with Container do + begin + InnerControlMouseDown := True; + try + MouseDown(Button, Shift, X + Self.Left, Y + Self.Top); + finally + InnerControlMouseDown := False; + end; + end; +end; + +procedure TcxCustomInnerTreeView.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + if Container <> nil then + _TcxContainerAccess.MouseMove(Container, Shift, X + Left, Y + Top); +end; + +procedure TcxCustomInnerTreeView.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + if Container <> nil then + _TcxContainerAccess.MouseUp(Container, Button, Shift, X + Left, Y + Top); +end; + +procedure TcxCustomInnerTreeView.CreateWindowHandle(const Params: TCreateParams); +begin + inherited CreateWindowHandle(Params); + UpdateItemHeight; + Container.SetScrollBarsParameters; +end; + +procedure TcxCustomInnerTreeView.WndProc(var Message: TMessage); +begin + if (Container <> nil) and Container.InnerControlMenuHandler(Message) then + Exit; + + if Message.Msg = WM_RBUTTONUP then + begin + Container.LockPopupMenu(True); + try + inherited WndProc(Message); + finally + Container.LockPopupMenu(False); + end; + Exit; + end; + + if ((Message.Msg = WM_LBUTTONDOWN) or (Message.Msg = WM_LBUTTONDBLCLK)) and + (Container.DragMode = dmAutomatic) and (Container.DragKind = dkDock) and + not Container.IsDesigning then + begin + _TcxContainerAccess.BeginAutoDrag(Container); + Exit; + end; + + inherited WndProc(Message); + case Message.Msg of + WM_HSCROLL, + WM_MOUSEWHEEL, + WM_VSCROLL, + CM_WININICHANGE, + TVM_ENSUREVISIBLE, + TVM_EXPAND, + TVM_INSERTITEM, + TVM_SELECTITEM: + Container.SetScrollBarsParameters; + end; +end; + +procedure TcxCustomInnerTreeView.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + inherited; + if not Container.ScrollBarsCalculating then + Container.SetScrollBarsParameters; +end; + +procedure TcxCustomInnerTreeView.WMFontChange(var Message: TMessage); +begin + inherited; + if not Container.ScrollBarsCalculating then + Container.SetScrollBarsParameters; +end; + +procedure TcxCustomInnerTreeView.WMLButtonDown(var Message: TWMLButtonDown); +begin + inherited; + if Dragging then + begin + CancelDrag; + Container.BeginDrag(False); + end; +end; + +procedure TcxCustomInnerTreeView.MouseEnter(AControl: TControl); +begin +end; + +procedure TcxCustomInnerTreeView.MouseLeave(AControl: TControl); +begin + if Container <> nil then + Container.ShortRefreshContainer(True); +end; + +function TcxCustomInnerTreeView.GetControl: TWinControl; +begin + Result := Self; +end; + +function TcxCustomInnerTreeView.GetControlContainer: TcxContainer; +begin + Result := FContainer; +end; + +procedure TcxCustomInnerTreeView.HScrollHandler(Sender: TObject; ScrollCode: TScrollCode; + var ScrollPos: Integer); +begin + CallWindowProc(DefWndProc, Handle, WM_HSCROLL, Word(ScrollCode) + + Word(ScrollPos) shl 16, Container.HScrollBar.Handle); + ScrollPos := GetScrollPos(Handle, SB_HORZ); +end; + +procedure TcxCustomInnerTreeView.SetItemHeight(Value: Integer); +begin + if Value <> FItemHeight then + begin + FItemHeight := Value; + UpdateItemHeight; + end; +end; + +procedure TcxCustomInnerTreeView.SetLookAndFeel(Value: TcxLookAndFeel); +begin + FLookAndFeel.Assign(Value); +end; + +procedure TcxCustomInnerTreeView.VScrollHandler(Sender: TObject; ScrollCode: TScrollCode; + var ScrollPos: Integer); +var + AScrollInfo: TScrollInfo; +begin + if (ScrollCode in [scPosition, scTrack]) and (Win32MajorVersion >= 6) then + begin + AScrollInfo.cbSize := SizeOf(AScrollInfo); + AScrollInfo.fMask := SIF_POS; + AScrollInfo.nPos := ScrollPos; + SetScrollInfo(Handle, SB_VERT, AScrollInfo, True); + end; + CallWindowProc(DefWndProc, Handle, WM_VSCROLL, Word(ScrollCode) + + Word(ScrollPos) shl 16, Container.VScrollBar.Handle); + ScrollPos := GetScrollPos(Handle, SB_VERT); +end; + +{$IFNDEF DELPHI6} +function TcxCustomInnerTreeView.GetScrollWidth: Integer; +begin + Result := SendMessage(Handle, LB_GETHORIZONTALEXTENT, 0, 0); +end; + +procedure TcxCustomInnerTreeView.SetScrollWidth(const Value: Integer); +begin + if Value <> ScrollWidth then + SendMessage(Handle, LB_SETHORIZONTALEXTENT, Value, 0); +end; +{$ENDIF} + +procedure TcxCustomInnerTreeView.WMGetDlgCode(var Message: TWMGetDlgCode); +begin + inherited; + if Container <> nil then + with Message do + begin + Result := Result or DLGC_WANTCHARS; + if GetKeyState(VK_CONTROL) >= 0 then + Result := Result or DLGC_WANTTAB; + end; +end; + +procedure TcxCustomInnerTreeView.WMKillFocus(var Message: TWMKillFocus); +begin + inherited; + if (Container <> nil) and not Container.IsDestroying then + Container.FocusChanged; +end; + +procedure TcxCustomInnerTreeView.WMNCPaint(var Message: TWMNCPaint); +var + DC: HDC; + ABrush: HBRUSH; +begin + if UsecxScrollBars and Container.HScrollBar.Visible and + Container.VScrollBar.Visible then + begin + DC := GetWindowDC(Handle); + ABrush := 0; + try + with Container.LookAndFeel do + ABrush := CreateSolidBrush(ColorToRGB(Painter.DefaultSizeGripAreaColor)); + FillRect(DC, GetSizeGripRect(Self), ABrush); + finally + if ABrush <> 0 then + DeleteObject(ABrush); + ReleaseDC(Handle, DC); + end; + end; + if UsecxScrollBars then + begin + if Container.HScrollBar.Visible then + Container.HScrollBar.Repaint; + if Container.VScrollBar.Visible then + Container.VScrollBar.Repaint; + end; +end; + +procedure TcxCustomInnerTreeView.WMSetFocus(var Message: TWMSetFocus); +begin + inherited; + if (Container <> nil) and not Container.IsDestroying and + not(csDestroying in ComponentState) and + (Message.FocusedWnd <> Container.Handle) then + Container.FocusChanged; +end; + +procedure TcxCustomInnerTreeView.WMSetRedraw(var Message: TWMSetRedraw); +begin + inherited; + FIsRedrawLocked := Message.Redraw = 0; + if not (csDestroying in ComponentState) and not FIsRedrawLocked then + Container.SetScrollBarsParameters; +end; + +procedure TcxCustomInnerTreeView.WMWindowPosChanged( + var Message: TWMWindowPosChanged); +var + ARgn: HRGN; +begin + inherited; + if csDestroying in ComponentState then + Exit; + Container.SetScrollBarsParameters; + if Container.HScrollBar.Visible and Container.VScrollBar.Visible then + begin + ARgn := CreateRectRgnIndirect(GetSizeGripRect(Self)); + SendMessage(Handle, WM_NCPAINT, ARgn, 0); + DeleteObject(ARgn); + end; +end; + +procedure TcxCustomInnerTreeView.CMMouseEnter(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseEnter(Self) + else + MouseEnter(TControl(Message.lParam)); +end; + +procedure TcxCustomInnerTreeView.CNNotify( + var Message: TWMNotify); +begin + inherited; + if Message.NMHdr.code = TVN_DELETEITEM then + Container.SetScrollBarsParameters; +end; + +procedure TcxCustomInnerTreeView.CMMouseLeave(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseLeave(Self) + else + MouseLeave(TControl(Message.lParam)); +end; + +procedure TcxCustomInnerTreeView.Expand(Node: TTreeNode); +begin + inherited; + Container.SetScrollBarsParameters; +end; + +procedure TcxCustomInnerTreeView.Change(Node: TTreeNode); +begin + inherited; + Container.SetScrollBarsParameters; +end; + +procedure TcxCustomInnerTreeView.Collapse(Node: TTreeNode); +begin + inherited; + Container.SetScrollBarsParameters; +end; + +procedure TcxCustomInnerTreeView.UpdateItemHeight; +begin + if HandleAllocated then + TreeView_SetItemHeight(Handle, ItemHeight); +end; + +{ TcxCustomTreeView } + +constructor TcxCustomTreeView.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + InternalInitTreeView; + InnerTreeView.AutoSize := False; + InnerTreeView.Align := alClient; + InnerTreeView.BorderStyle := bsNone; + InnerTreeView.Parent := Self; + InnerTreeView.FContainer := Self; + InnerControl := InnerTreeView; + InnerTreeView.LookAndFeel.MasterLookAndFeel := Style.LookAndFeel; + Width := 120; + Height := 100; +end; + +destructor TcxCustomTreeView.Destroy; +begin + FreeAndNil(FTreeView); + inherited Destroy; +end; + +function TcxCustomTreeView.GetInnerTreeView: TcxCustomInnerTreeView; +begin + Result := FTreeView; +end; + +procedure TcxCustomTreeView.InternalInitTreeView; +begin + FTreeView := GetTreeViewClass.Create(Self); +end; + +class function TcxCustomTreeView.GetTreeViewClass: TcxCustomInnerTreeViewClass; +begin + Result := TcxCustomInnerTreeView; +end; + +function TcxCustomTreeView.CanResize(var NewWidth, NewHeight: Integer): Boolean; +begin + Result := True; + if not Result or IsLoading then Exit; + if Align in [alLeft, alRight, alClient] then Exit; +end; + +procedure TcxCustomTreeView.FontChanged; +begin + inherited FontChanged; + SetSize; + InnerTreeView.Invalidate; +end; + +function TcxCustomTreeView.IsReadOnly: Boolean; +begin + Result := ReadOnly; +end; + +function TcxCustomTreeView.NeedsScrollBars: Boolean; +begin + Result := True; +end; + +procedure TcxCustomTreeView.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +begin + inherited Scroll(AScrollBarKind, AScrollCode, AScrollPos); +{$IFDEF USETCXSCROLLBAR} + if AScrollBarKind = sbHorizontal then + InnerTreeView.HScrollHandler(Self, AScrollCode, AScrollPos) + else + InnerTreeView.VScrollHandler(Self, AScrollCode, AScrollPos); + SetScrollBarsParameters; +{$ENDIF} +end; + +procedure TcxCustomTreeView.SetSize; +var + APrevBoundsRect: TRect; +begin + if IsLoading then + Exit; + APrevBoundsRect := InnerTreeView.BoundsRect; + inherited SetSize; + if not EqualRect(APrevBoundsRect, InnerTreeView.BoundsRect) and + InnerTreeView.HandleAllocated then + KillMessages(InnerTreeView.Handle, WM_MOUSEMOVE, WM_MOUSEMOVE); +end; + +procedure TcxCustomTreeView.WriteState(Writer: TWriter); +begin + FTreeView.HandleNeeded; + inherited; +end; + +procedure TcxCustomTreeView.CNNotify(var Message: TWMNotify); +begin + if InnerTreeView <> nil then + begin + InnerTreeView.CNNotify(Message); + Exit; + end; + inherited; +end; + +function TcxCustomTreeView.AlphaSort{$IFDEF DELPHI6}( + ARecurse: Boolean = True){$ENDIF}: Boolean; +begin + Result := InnerTreeView.AlphaSort({$IFDEF DELPHI6}ARecurse{$ENDIF}); +end; + +function TcxCustomTreeView.CustomSort(SortProc: TTVCompare; + Data: Longint{$IFDEF DELPHI6}; ARecurse: Boolean = True{$ENDIF}): Boolean; +begin + Result := InnerTreeView.CustomSort(SortProc, Data{$IFDEF DELPHI6}, + ARecurse{$ENDIF}); +end; + +procedure TcxCustomTreeView.FullCollapse; +begin + InnerTreeView.FullCollapse; +end; + +procedure TcxCustomTreeView.FullExpand; +begin + InnerTreeView.FullExpand; +end; + +function TcxCustomTreeView.GetHitTestInfoAt(X, Y: Integer): THitTests; +begin + Result := InnerTreeView.GetHitTestInfoAt(X - InnerTreeView.Left, + Y - InnerTreeView.Top); +end; + +function TcxCustomTreeView.GetNodeAt(X, Y: Integer): TTreeNode; +begin + Result := InnerTreeView.GetNodeAt(X - InnerTreeView.Left, Y - InnerTreeView.Top); +end; + +function TcxCustomTreeView.IsEditing: Boolean; +begin + Result := InnerTreeView.IsEditing; +end; + +procedure TcxCustomTreeView.LoadFromFile(const FileName: string); +begin + InnerTreeView.LoadFromFile(FileName); +end; + +procedure TcxCustomTreeView.LoadFromStream(Stream: TStream); +begin + InnerTreeView.LoadFromStream(Stream); +end; + +procedure TcxCustomTreeView.SaveToFile(const FileName: string); +begin + InnerTreeView.SaveToFile(FileName); +end; + +procedure TcxCustomTreeView.SaveToStream(Stream: TStream); +begin + InnerTreeView.SaveToStream(Stream); +end; + +procedure TcxCustomTreeView.SetScrollBarsParameters(AIsScrolling: Boolean = False); +begin + if (InnerTreeView <> nil) and not InnerTreeView.IsRedrawLocked then + inherited SetScrollBarsParameters(AIsScrolling); +end; + +{$IFDEF DELPHI6} +procedure TcxCustomTreeView.Select(Node: TTreeNode; ShiftState: TShiftState = []); +begin + InnerTreeView.Select(Node, ShiftState); +end; + +procedure TcxCustomTreeView.Select(const Nodes: array of TTreeNode); +begin + InnerTreeView.Select(Nodes); +end; + +procedure TcxCustomTreeView.Select(Nodes: TList); +begin + InnerTreeView.Select(Nodes); +end; + +procedure TcxCustomTreeView.Deselect(Node: TTreeNode); +begin + InnerTreeView.Deselect(Node); +end; + +procedure TcxCustomTreeView.Subselect(Node: TTreeNode; Validate: Boolean = False); +begin + InnerTreeView.Subselect(Node, Validate); +end; + +procedure TcxCustomTreeView.ClearSelection(KeepPrimary: Boolean = False); +begin + InnerTreeView.ClearSelection(KeepPrimary); +end; + +function TcxCustomTreeView.GetSelections(AList: TList): TTreeNode; +begin + Result := InnerTreeView.GetSelections(AList); +end; + +function TcxCustomTreeView.FindNextToSelect: TTreeNode; +begin + Result := InnerTreeView.FindNextToSelect; +end; +{$ENDIF} + +function TcxCustomTreeView.GetAutoExpand: Boolean; +begin + Result := InnerTreeView.AutoExpand; +end; + +function TcxCustomTreeView.GetChangeDelay: Integer; +begin + Result := InnerTreeView.ChangeDelay; +end; + +function TcxCustomTreeView.GetHideSelection: Boolean; +begin + Result := InnerTreeView.HideSelection; +end; + +function TcxCustomTreeView.GetHotTrack: Boolean; +begin + Result := InnerTreeView.HotTrack; +end; + +function TcxCustomTreeView.GetImages: TCustomImageList; +begin + Result := InnerTreeView.Images; +end; + +function TcxCustomTreeView.GetItemHeight: Integer; +begin + Result := InnerTreeView.ItemHeight; +end; + +function TcxCustomTreeView.GetTreeNodes: TTreeNodes; +begin + Result := InnerTreeView.Items; +end; + +function TcxCustomTreeView.GetIndent: Integer; +begin + Result := InnerTreeView.Indent; +end; + +{$IFDEF DELPHI6} +function TcxCustomTreeView.GetMultiSelect: Boolean; +begin + Result := InnerTreeView.MultiSelect; +end; + +function TcxCustomTreeView.GetMultiSelectStyle: TMultiSelectStyle; +begin + Result := InnerTreeView.MultiSelectStyle; +end; +{$ENDIF} + +function TcxCustomTreeView.GetReadOnly: Boolean; +begin + Result := InnerTreeView.ReadOnly; +end; + +function TcxCustomTreeView.GetRightClickSelect: Boolean; +begin + Result := InnerTreeView.RightClickSelect; +end; + +function TcxCustomTreeView.GetRowSelect: Boolean; +begin + Result := InnerTreeView.RowSelect; +end; + +function TcxCustomTreeView.GetShowButtons: Boolean; +begin + Result := InnerTreeView.ShowButtons; +end; + +function TcxCustomTreeView.GetShowLines: Boolean; +begin + Result := InnerTreeView.ShowLines; +end; + +function TcxCustomTreeView.GetShowRoot: Boolean; +begin + Result := InnerTreeView.ShowRoot; +end; + +function TcxCustomTreeView.GetSortType: TSortType; +begin + Result := InnerTreeView.SortType; +end; + +function TcxCustomTreeView.GetStateImages: TCustomImageList; +begin + Result := InnerTreeView.StateImages; +end; + +function TcxCustomTreeView.GetToolTips: Boolean; +begin + Result := InnerTreeView.ToolTips; +end; + +function TcxCustomTreeView.GetTreeViewCanvas: TcxCanvas; +begin + Result := InnerTreeView.Canvas; +end; + +{$IFDEF DELPHI6} +function TcxCustomTreeView.GetOnAddition: TTVExpandedEvent; +begin + Result := InnerTreeView.OnAddition; +end; +{$ENDIF} + +{$IFDEF DELPHI5} +function TcxCustomTreeView.GetOnAdvancedCustomDraw: TTVAdvancedCustomDrawEvent; +begin + Result := InnerTreeView.OnAdvancedCustomDraw; +end; + +function TcxCustomTreeView.GetOnAdvancedCustomDrawItem: TTVAdvancedCustomDrawItemEvent; +begin + Result := InnerTreeView.OnAdvancedCustomDrawItem; +end; +{$ENDIF} + +{$IFDEF DELPHI6} +function TcxCustomTreeView.GetOnCancelEdit: TTVChangedEvent; +begin + Result := InnerTreeView.OnCancelEdit; +end; +{$ENDIF} + +function TcxCustomTreeView.GetOnChange: TTVChangedEvent; +begin + Result := InnerTreeView.OnChange; +end; + +function TcxCustomTreeView.GetOnChanging: TTVChangingEvent; +begin + Result := InnerTreeView.OnChanging; +end; + +function TcxCustomTreeView.GetOnCollapsed: TTVExpandedEvent; +begin + Result := InnerTreeView.OnCollapsed; +end; + +function TcxCustomTreeView.GetOnCollapsing: TTVCollapsingEvent; +begin + Result := InnerTreeView.OnCollapsing; +end; + +function TcxCustomTreeView.GetOnCompare: TTVCompareEvent; +begin + Result := InnerTreeView.OnCompare; +end; + +function TcxCustomTreeView.GetOnCustomDraw: TTVCustomDrawEvent; +begin + Result := InnerTreeView.OnCustomDraw; +end; + +function TcxCustomTreeView.GetOnCustomDrawItem: TTVCustomDrawItemEvent; +begin + Result := InnerTreeView.OnCustomDrawItem; +end; + +function TcxCustomTreeView.GetOnDeletion: TTVExpandedEvent; +begin + Result := InnerTreeView.OnDeletion; +end; + +function TcxCustomTreeView.GetOnEditing: TTVEditingEvent; +begin + Result := InnerTreeView.OnEditing; +end; + +function TcxCustomTreeView.GetOnEdited: TTVEditedEvent; +begin + Result := InnerTreeView.OnEdited; +end; + +function TcxCustomTreeView.GetOnExpanding: TTVExpandingEvent; +begin + Result := InnerTreeView.OnExpanding; +end; + +function TcxCustomTreeView.GetOnExpanded: TTVExpandedEvent; +begin + Result := InnerTreeView.OnExpanded; +end; + +function TcxCustomTreeView.GetOnGetImageIndex: TTVExpandedEvent; +begin + Result := InnerTreeView.OnGetImageIndex; +end; + +function TcxCustomTreeView.GetOnGetSelectedIndex: TTVExpandedEvent; +begin + Result := InnerTreeView.OnGetSelectedIndex; +end; + +{$IFDEF DELPHI6} +function TcxCustomTreeView.GetOnCreateNodeClass: TTVCreateNodeClassEvent; +begin + Result := InnerTreeView.OnCreateNodeClass; +end; +{$ENDIF} + +function TcxCustomTreeView.GetDropTarget: TTreeNode; +begin + Result := InnerTreeView.DropTarget; +end; + +function TcxCustomTreeView.GetSelected: TTreeNode; +begin + Result := InnerTreeView.Selected; +end; + +function TcxCustomTreeView.GetTopItem: TTreeNode; +begin + Result := InnerTreeView.TopItem; +end; + +{$IFDEF DELPHI6} +function TcxCustomTreeView.GetSelectionCount: Cardinal; +begin + Result := InnerTreeView.SelectionCount; +end; + +function TcxCustomTreeView.GetSelection(Index: Integer): TTreeNode; +begin + Result := InnerTreeView.Selections[Index]; +end; +{$ENDIF} + +procedure TcxCustomTreeView.SetAutoExpand(Value: Boolean); +begin + InnerTreeView.AutoExpand := Value; +end; + +procedure TcxCustomTreeView.SetChangeDelay(Value: Integer); +begin + InnerTreeView.ChangeDelay := Value; +end; + +procedure TcxCustomTreeView.SetHideSelection(Value: Boolean); +begin + InnerTreeView.HideSelection := Value; +end; + +procedure TcxCustomTreeView.SetHotTrack(Value: Boolean); +begin + InnerTreeView.HotTrack := Value; +end; + +procedure TcxCustomTreeView.SetImages(Value: TCustomImageList); +begin + InnerTreeView.Images := Value; +end; + +procedure TcxCustomTreeView.SetTreeNodes(Value: TTreeNodes); +begin + InnerTreeView.Items := Value; +end; + +procedure TcxCustomTreeView.SetIndent(Value: Integer); +begin + InnerTreeView.Indent := Value; +end; + +procedure TcxCustomTreeView.SetItemHeight(Value: Integer); +begin + InnerTreeView.ItemHeight := Value; +end; + +{$IFDEF DELPHI6} +procedure TcxCustomTreeView.SetMultiSelect(Value: Boolean); +begin + InnerTreeView.MultiSelect := Value; +end; + +procedure TcxCustomTreeView.SetMultiSelectStyle(Value: TMultiSelectStyle); +begin + InnerTreeView.MultiSelectStyle := Value; +end; +{$ENDIF} + +procedure TcxCustomTreeView.SetRightClickSelect(Value: Boolean); +begin + InnerTreeView.RightClickSelect := Value; +end; + +procedure TcxCustomTreeView.SetReadOnly(Value: Boolean); +begin + if Value <> ReadOnly then + begin + InnerTreeView.ReadOnly := Value; + DataSetChange; + end; +end; + +procedure TcxCustomTreeView.SetRowSelect(Value: Boolean); +begin + InnerTreeView.RowSelect := Value; +end; + +procedure TcxCustomTreeView.SetShowButtons(Value: Boolean); +begin + InnerTreeView.ShowButtons := Value; +end; + +procedure TcxCustomTreeView.SetShowLines(Value: Boolean); +begin + InnerTreeView.ShowLines := Value; +end; + +procedure TcxCustomTreeView.SetShowRoot(Value: Boolean); +begin + InnerTreeView.ShowRoot := Value; +end; + +procedure TcxCustomTreeView.SetSortType(Value: TSortType); +begin + InnerTreeView.SortType := Value; +end; + +procedure TcxCustomTreeView.SetStateImages(Value: TCustomImageList); +begin + InnerTreeView.StateImages := Value; +end; + +procedure TcxCustomTreeView.SetToolTips(Value: Boolean); +begin + InnerTreeView.ToolTips := Value; +end; + +{$IFDEF DELPHI6} +procedure TcxCustomTreeView.SetOnAddition(Value: TTVExpandedEvent); +begin + InnerTreeView.OnAddition := Value; +end; +{$ENDIF} + +{$IFDEF DELPHI5} +procedure TcxCustomTreeView.SetOnAdvancedCustomDraw(Value: TTVAdvancedCustomDrawEvent); +begin + InnerTreeView.OnAdvancedCustomDraw := Value; +end; + +procedure TcxCustomTreeView.SetOnAdvancedCustomDrawItem(Value: TTVAdvancedCustomDrawItemEvent); +begin + InnerTreeView.OnAdvancedCustomDrawItem := Value; +end; +{$ENDIF} + +{$IFDEF DELPHI6} +procedure TcxCustomTreeView.SetOnCancelEdit(Value: TTVChangedEvent); +begin + InnerTreeView.OnCancelEdit := Value; +end; +{$ENDIF} + +procedure TcxCustomTreeView.SetOnChange(Value: TTVChangedEvent); +begin + InnerTreeView.OnChange := Value; +end; + +procedure TcxCustomTreeView.SetOnChanging(Value: TTVChangingEvent); +begin + InnerTreeView.OnChanging := Value; +end; + +procedure TcxCustomTreeView.SetOnCollapsed(Value: TTVExpandedEvent); +begin + InnerTreeView.OnCollapsed := Value; +end; + +procedure TcxCustomTreeView.SetOnCollapsing(Value: TTVCollapsingEvent); +begin + InnerTreeView.OnCollapsing := Value; +end; + +procedure TcxCustomTreeView.SetOnCompare(Value: TTVCompareEvent); +begin + InnerTreeView.OnCompare := Value; +end; + +procedure TcxCustomTreeView.SetOnCustomDraw(Value: TTVCustomDrawEvent); +begin + InnerTreeView.OnCustomDraw := Value; +end; + +procedure TcxCustomTreeView.SetOnCustomDrawItem(Value: TTVCustomDrawItemEvent); +begin + InnerTreeView.OnCustomDrawItem := Value; +end; + +procedure TcxCustomTreeView.SetOnDeletion(Value: TTVExpandedEvent); +begin + InnerTreeView.OnDeletion := Value; +end; + +procedure TcxCustomTreeView.SetOnEditing(Value: TTVEditingEvent); +begin + InnerTreeView.OnEditing := Value; +end; + +procedure TcxCustomTreeView.SetOnEdited(Value: TTVEditedEvent); +begin + InnerTreeView.OnEdited := Value; +end; + +procedure TcxCustomTreeView.SetOnExpanding(Value: TTVExpandingEvent); +begin + InnerTreeView.OnExpanding := Value; +end; + +procedure TcxCustomTreeView.SetOnExpanded(Value: TTVExpandedEvent); +begin + InnerTreeView.OnExpanded := Value; +end; + +procedure TcxCustomTreeView.SetOnGetImageIndex(Value: TTVExpandedEvent); +begin + InnerTreeView.OnGetImageIndex := Value; +end; + +procedure TcxCustomTreeView.SetOnGetSelectedIndex(Value: TTVExpandedEvent); +begin + InnerTreeView.OnGetSelectedIndex := Value; +end; + +{$IFDEF DELPHI6} +procedure TcxCustomTreeView.SetOnCreateNodeClass(Value: TTVCreateNodeClassEvent); +begin + InnerTreeView.OnCreateNodeClass := Value; +end; +{$ENDIF} + +procedure TcxCustomTreeView.SetDropTarget(Value: TTreeNode); +begin + InnerTreeView.DropTarget := Value; +end; + +procedure TcxCustomTreeView.SetSelected(Value: TTreeNode); +begin + InnerTreeView.Selected := Value; +end; + +procedure TcxCustomTreeView.SetTopItem(Value: TTreeNode); +begin + InnerTreeView.TopItem := Value; +end; + +function TcxCustomTreeView.CanEdit(Node: TTreeNode): Boolean; +begin + Result := InnerTreeView.CanEdit(Node); +end; + +function TcxCustomTreeView.CanChange(Node: TTreeNode): Boolean; +begin + Result := InnerTreeView.CanChange(Node); +end; + +function TcxCustomTreeView.CanCollapse(Node: TTreeNode): Boolean; +begin + Result := InnerTreeView.CanCollapse(Node); +end; + +function TcxCustomTreeView.CanExpand(Node: TTreeNode): Boolean; +begin + Result := InnerTreeView.CanExpand(Node); +end; + +procedure TcxCustomTreeView.Collapse(Node: TTreeNode); +begin + InnerTreeView.Collapse(Node); +end; + +procedure TcxCustomTreeView.Expand(Node: TTreeNode); +begin + InnerTreeView.Expand(Node); +end; + +end. diff --git a/official/x.35/ExpressEditors Library 5/Sources/cxVer.inc b/official/x.35/ExpressEditors Library 5/Sources/cxVer.inc new file mode 100644 index 00000000..a26364cc --- /dev/null +++ b/official/x.35/ExpressEditors Library 5/Sources/cxVer.inc @@ -0,0 +1,172 @@ +{$B-} { Complete Boolean Evaluation } +{$R-} { Range-Checking } +{$T-} { Typed @ operator } +{$X+} { Extended syntax } +{$P+} { Open string params } +{$J+} { Writeable structured consts } +{$H+} { Use long strings by default } +{$Q-} { Overflow checking } + +{$DEFINE DXVER500} + +{$IFNDEF CLR} + {$DEFINE OLEDRAGANDDROP} + {$IFNDEF DONTUSEJPEGIMAGE} + {$DEFINE USEJPEGIMAGE} + {$ENDIF} +{$ENDIF} + +{$DEFINE EXPRESSBARS5} + +{$DEFINE VCL} + +{$IFNDEF VER80} + {$IFNDEF VER90} + {$IFNDEF VER93} + {$DEFINE DELPHI3} { Borland Delphi 3.0 } + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER110} { Borland C++Builder 3.0 } + {$DEFINE CBUILDER3} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE DELPHI4} +{$ENDIF} + +{$IFDEF VER125} { Borland C++Builder 4.0 } + {$DEFINE CBUILDER3} + {$DEFINE DELPHI4} + {$DEFINE CBUILDER4} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$IFDEF BCB} { Borland C++Builder 5.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$IFDEF BCB} { Borland C++Builder 6.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} +{$ENDIF} + +{$IFNDEF DELPHI6} + {$DEFINE MSWINDOWS} +{$ENDIF} +{$IFDEF LINUX} + {$UNDEF MSWINDOWS} +{$ENDIF} + +{$IFDEF LINUX} + {$DEFINE KYLIX1} { Borland Kylix 1 } + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF CompilerVersion >= 14} + {$DEFINE KYLIX2} { Borland Kylix 2 } + {$IFEND} + {$IF CompilerVersion >= 14.50} + {$DEFINE KYLIX3} { Borland Kylix 3 } + {$IFEND} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} { Borland Delphi.Net } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} +{$ENDIF} + +{$IFDEF VER170} { Borland Delphi 9.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} +{$ENDIF} + +{$IFDEF VER180} { Borland Delphi 10 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$IFDEF BCB} { Borland C++Builder 10 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Borland Delphi 11 //CodeGear} + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$DEFINE DELPHI11} + {$IFDEF BCB} { Borland C++Builder 11 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$DEFINE CBUILDER11} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFNDEF CLR} + {$IFNDEF BCB} + {$IFDEF DELPHI6} + {$DEFINE REGISTERSHELLCTRLS} + {$ENDIF} + {$ENDIF} + {$IFDEF DELPHI7} + {$WARN UNSAFE_CAST OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_TYPE OFF} + {$ENDIF} +{$ENDIF} + +{$IFDEF REGISTERSHELLCTRLS} + {$DEFINE REGISTERCXSHELLCTRLS} +{$ENDIF} + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} diff --git a/official/x.35/ExpressExport Library/Packages/cxExportC10.bpk b/official/x.35/ExpressExport Library/Packages/cxExportC10.bpk new file mode 100644 index 00000000..a6866ab2 --- /dev/null +++ b/official/x.35/ExpressExport Library/Packages/cxExportC10.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = cxExportC10.bpl +OBJFILES = cxExportC10.obj cxXLSExport.obj \ + cxHtmlXmlTxtExport.obj cxExport.obj cxExportStrs.obj +RESFILES = cxExportC10.res +MAINSOURCE = cxExportC10.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi cxLibraryC10.bpi +SPARELIBS = rtl.lib vcl.bpi +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express Cross Platform Export Library (VCL Edition) by Developer Express Inc." \ + -aa -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressExport Library/Packages/cxExportC10.cpp b/official/x.35/ExpressExport Library/Packages/cxExportC10.cpp new file mode 100644 index 00000000..6971123e --- /dev/null +++ b/official/x.35/ExpressExport Library/Packages/cxExportC10.cpp @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxExportC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEUNIT("cxXLSExport.pas"); +USEUNIT("cxHtmlXmlTxtExport.pas"); +USEUNIT("cxExport.pas"); +USEUNIT("cxExportStrs.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressExport Library/Packages/cxExportC10.res b/official/x.35/ExpressExport Library/Packages/cxExportC10.res new file mode 100644 index 00000000..7074c335 Binary files /dev/null and b/official/x.35/ExpressExport Library/Packages/cxExportC10.res differ diff --git a/official/x.35/ExpressExport Library/Packages/cxExportC11.bpk b/official/x.35/ExpressExport Library/Packages/cxExportC11.bpk new file mode 100644 index 00000000..bd7030fc --- /dev/null +++ b/official/x.35/ExpressExport Library/Packages/cxExportC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = cxExportC11.bpl +OBJFILES = cxExportC11.obj cxXLSExport.obj \ + cxHtmlXmlTxtExport.obj cxExport.obj cxExportStrs.obj +RESFILES = cxExportC11.res +MAINSOURCE = cxExportC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi cxLibraryC11.bpi +SPARELIBS = rtl.lib vcl.bpi +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express Cross Platform Export Library (VCL Edition) by Developer Express Inc." \ + -aa -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressExport Library/Packages/cxExportC11.cpp b/official/x.35/ExpressExport Library/Packages/cxExportC11.cpp new file mode 100644 index 00000000..b4496101 --- /dev/null +++ b/official/x.35/ExpressExport Library/Packages/cxExportC11.cpp @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxExportC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEUNIT("cxXLSExport.pas"); +USEUNIT("cxHtmlXmlTxtExport.pas"); +USEUNIT("cxExport.pas"); +USEUNIT("cxExportStrs.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressExport Library/Packages/cxExportC11.res b/official/x.35/ExpressExport Library/Packages/cxExportC11.res new file mode 100644 index 00000000..02ccc72a Binary files /dev/null and b/official/x.35/ExpressExport Library/Packages/cxExportC11.res differ diff --git a/official/x.35/ExpressExport Library/Packages/cxExportC5.bpk b/official/x.35/ExpressExport Library/Packages/cxExportC5.bpk new file mode 100644 index 00000000..5339763d --- /dev/null +++ b/official/x.35/ExpressExport Library/Packages/cxExportC5.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = cxExportC5.bpl +OBJFILES = cxExportC5.obj cxXLSExport.obj \ + cxHtmlXmlTxtExport.obj cxExport.obj cxExportStrs.obj +RESFILES = cxExportC5.res +MAINSOURCE = cxExportC5.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = vcl50.bpi vcldb50.bpi cxLibraryVCLC5.bpi +SPARELIBS = vcl50.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express Cross Platform Export Library (VCL Edition) by Developer Express Inc." \ + -aa -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressExport Library/Packages/cxExportC5.cpp b/official/x.35/ExpressExport Library/Packages/cxExportC5.cpp new file mode 100644 index 00000000..7218e8b8 --- /dev/null +++ b/official/x.35/ExpressExport Library/Packages/cxExportC5.cpp @@ -0,0 +1,25 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxExportC5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEUNIT("cxXLSExport.pas"); +USEUNIT("cxHtmlXmlTxtExport.pas"); +USEUNIT("cxExport.pas"); +USEUNIT("cxExportStrs.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressExport Library/Packages/cxExportC5.res b/official/x.35/ExpressExport Library/Packages/cxExportC5.res new file mode 100644 index 00000000..b6f49f35 Binary files /dev/null and b/official/x.35/ExpressExport Library/Packages/cxExportC5.res differ diff --git a/official/x.35/ExpressExport Library/Packages/cxExportD10.dpk b/official/x.35/ExpressExport Library/Packages/cxExportD10.dpk new file mode 100644 index 00000000..ead63ce0 --- /dev/null +++ b/official/x.35/ExpressExport Library/Packages/cxExportD10.dpk @@ -0,0 +1,41 @@ +package cxExportD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'Express Cross Platform Export Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dbrtl, + cxLibraryD10; + +contains + cxExport, + cxHtmlXmlTxtExport, + cxXLSExport, + cxExportStrs; + +end. diff --git a/official/x.35/ExpressExport Library/Packages/cxExportD10.res b/official/x.35/ExpressExport Library/Packages/cxExportD10.res new file mode 100644 index 00000000..bcf3b887 Binary files /dev/null and b/official/x.35/ExpressExport Library/Packages/cxExportD10.res differ diff --git a/official/x.35/ExpressExport Library/Packages/cxExportD11.dpk b/official/x.35/ExpressExport Library/Packages/cxExportD11.dpk new file mode 100644 index 00000000..ae7556f6 --- /dev/null +++ b/official/x.35/ExpressExport Library/Packages/cxExportD11.dpk @@ -0,0 +1,41 @@ +package cxExportD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'Express Cross Platform Export Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dbrtl, + cxLibraryD11; + +contains + cxExport, + cxHtmlXmlTxtExport, + cxXLSExport, + cxExportStrs; + +end. diff --git a/official/x.35/ExpressExport Library/Packages/cxExportD11.res b/official/x.35/ExpressExport Library/Packages/cxExportD11.res new file mode 100644 index 00000000..e031ab5e Binary files /dev/null and b/official/x.35/ExpressExport Library/Packages/cxExportD11.res differ diff --git a/official/x.35/ExpressExport Library/Packages/cxExportD5.dpk b/official/x.35/ExpressExport Library/Packages/cxExportD5.dpk new file mode 100644 index 00000000..a963e4e1 --- /dev/null +++ b/official/x.35/ExpressExport Library/Packages/cxExportD5.dpk @@ -0,0 +1,39 @@ +package cxExportD5; + +{$R *.RES} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'Express Cross Platform Export Library (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcldb50, + cxLibraryVCLD5; + +contains + cxExport, + cxHtmlXmlTxtExport, + cxXLSExport, + cxExportStrs; + +end. diff --git a/official/x.35/ExpressExport Library/Packages/cxExportD5.res b/official/x.35/ExpressExport Library/Packages/cxExportD5.res new file mode 100644 index 00000000..fb257de1 Binary files /dev/null and b/official/x.35/ExpressExport Library/Packages/cxExportD5.res differ diff --git a/official/x.35/ExpressExport Library/Packages/cxExportD9.dpk b/official/x.35/ExpressExport Library/Packages/cxExportD9.dpk new file mode 100644 index 00000000..1d6d3649 --- /dev/null +++ b/official/x.35/ExpressExport Library/Packages/cxExportD9.dpk @@ -0,0 +1,41 @@ +package cxExportD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'Express Cross Platform Export Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dbrtl, + cxLibraryD9; + +contains + cxExport, + cxHtmlXmlTxtExport, + cxXLSExport, + cxExportStrs; + +end. diff --git a/official/x.35/ExpressExport Library/Packages/cxExportD9.res b/official/x.35/ExpressExport Library/Packages/cxExportD9.res new file mode 100644 index 00000000..5a142835 Binary files /dev/null and b/official/x.35/ExpressExport Library/Packages/cxExportD9.res differ diff --git a/official/x.35/ExpressExport Library/Packages/cxExportVCLC6.bpk b/official/x.35/ExpressExport Library/Packages/cxExportVCLC6.bpk new file mode 100644 index 00000000..7d84c77c --- /dev/null +++ b/official/x.35/ExpressExport Library/Packages/cxExportVCLC6.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = cxExportVCLC6.bpl +OBJFILES = cxExportVCLC6.obj cxXLSExport.obj \ + cxHtmlXmlTxtExport.obj cxExport.obj cxExportStrs.obj +RESFILES = cxExportVCLC6.res +MAINSOURCE = cxExportVCLC6.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi cxLibraryVCLC6.bpi +SPARELIBS = rtl.lib vcl.bpi +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express Cross Platform Export Library (VCL Edition) by Developer Express Inc." \ + -aa -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressExport Library/Packages/cxExportVCLC6.cpp b/official/x.35/ExpressExport Library/Packages/cxExportVCLC6.cpp new file mode 100644 index 00000000..dfe1a870 --- /dev/null +++ b/official/x.35/ExpressExport Library/Packages/cxExportVCLC6.cpp @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxExportVCLC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEUNIT("cxXLSExport.pas"); +USEUNIT("cxHtmlXmlTxtExport.pas"); +USEUNIT("cxExport.pas"); +USEUNIT("cxExportStrs.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressExport Library/Packages/cxExportVCLC6.res b/official/x.35/ExpressExport Library/Packages/cxExportVCLC6.res new file mode 100644 index 00000000..6c35bd91 Binary files /dev/null and b/official/x.35/ExpressExport Library/Packages/cxExportVCLC6.res differ diff --git a/official/x.35/ExpressExport Library/Packages/cxExportVCLD6.dpk b/official/x.35/ExpressExport Library/Packages/cxExportVCLD6.dpk new file mode 100644 index 00000000..c9b3c5b7 --- /dev/null +++ b/official/x.35/ExpressExport Library/Packages/cxExportVCLD6.dpk @@ -0,0 +1,41 @@ +package cxExportVCLD6; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'Express Cross Platform Export Library (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dbrtl, + cxLibraryVCLD6; + +contains + cxExport, + cxHtmlXmlTxtExport, + cxXLSExport, + cxExportStrs; + +end. diff --git a/official/x.35/ExpressExport Library/Packages/cxExportVCLD6.res b/official/x.35/ExpressExport Library/Packages/cxExportVCLD6.res new file mode 100644 index 00000000..5d2b3098 Binary files /dev/null and b/official/x.35/ExpressExport Library/Packages/cxExportVCLD6.res differ diff --git a/official/x.35/ExpressExport Library/Packages/cxExportVCLD7.dpk b/official/x.35/ExpressExport Library/Packages/cxExportVCLD7.dpk new file mode 100644 index 00000000..782836a2 --- /dev/null +++ b/official/x.35/ExpressExport Library/Packages/cxExportVCLD7.dpk @@ -0,0 +1,41 @@ +package cxExportVCLD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'Express Cross Platform Export Library (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dbrtl, + cxLibraryVCLD7; + +contains + cxExport, + cxHtmlXmlTxtExport, + cxXLSExport, + cxExportStrs; + +end. diff --git a/official/x.35/ExpressExport Library/Packages/cxExportVCLD7.res b/official/x.35/ExpressExport Library/Packages/cxExportVCLD7.res new file mode 100644 index 00000000..751efba1 Binary files /dev/null and b/official/x.35/ExpressExport Library/Packages/cxExportVCLD7.res differ diff --git a/official/x.35/ExpressExport Library/Sources/cxExport.pas b/official/x.35/ExpressExport Library/Sources/cxExport.pas new file mode 100644 index 00000000..fd4d9f7c --- /dev/null +++ b/official/x.35/ExpressExport Library/Sources/cxExport.pas @@ -0,0 +1,1044 @@ +{*******************************************************************} +{ } +{ Developer Express Cross Platform Component Library } +{ ExpressExport } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEXPORT AND ALL } +{ ACCOMPANYING VCL AND CLX CONTROLS AS PART OF AN EXECUTABLE } +{ PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit cxExport; + +{$I cxVer.inc} + +interface + +uses + Classes, SysUtils, Math, + {$IFDEF WIN32} + Windows, + {$ENDIF} + Graphics, cxExportStrs; + +type + EcxExportData = class(Exception); + TcxExportProviderClass = class of TcxCustomExportProvider; + TcxCustomExportProvider = class; + IcxCellInternalCache = interface; + + PWord =^Word; + PInteger =^Integer; + PIntArray = ^TIntArray; + TIntArray = array[0..MaxInt div SizeOf(Integer) - 1] of Integer; + + { Define CX style items } + TcxAlignText = (catLeft, catCenter, catRight); + TcxBrushStyle = (cbsClear, cbsSolid); + TcxFontStyle = (cfsBold, cfsItalic, cfsUnderline, cfsStrikeOut); + TcxFontStyles = set of TcxFontStyle; + + { TcxCellBorders } + TcxCellBorders = packed record + IsDefault: Boolean; + Width: Integer; + Color: Integer; + end; + + { TcxCacheCellStyle } + PcxCacheCellStyle = ^TcxCacheCellStyle; + TcxCacheCellStyle = packed record + AlignText: TcxAlignText; + FontName: array[0..32] of Char; + FontStyle: TcxFontStyles; + FontColor: Integer; + FontSize: Integer; + FontCharset: Integer; + Borders: array[0..3] of TcxCellBorders; + BrushStyle: TcxBrushStyle; + BrushBkColor: Integer; + BrushFgColor: Integer; + HashCode: Integer; + end; + + { TcxCellInternalCache } + TcxCellInternalCache = record + Cache: IcxCellInternalCache; + Index: Integer; + end; + + { TcxCacheItem } + TcxCacheItem = record + InternalCache: TcxCellInternalCache; + Data: Pointer; + DataSize: Integer; + DataType: Integer; + StyleIndex: Integer; + IsHidden: Boolean; + case IsUnion: Boolean of + False:(); + True: (Width, Height: Integer); + end; + + TcxEnumExportTypes = procedure(const AExportType: Integer; const AExportName: string); + TcxEnumTypes = procedure(const AExportType: Integer); + + { IcxCellInternalCache } + IcxCellInternalCache = interface + ['{DEF62C25-0B11-4BD0-AE25-BABF7EDD7883}'] + procedure CommitCache(AStream: TStream; AParam: Pointer); + procedure CommitStyle(AStream: TStream; AParam: Pointer); + procedure DeleteCacheFromCell(const ACol, ARow: Integer); + procedure SetCacheIntoCell(const ACol, ARow: Integer; ACache: IcxCellInternalCache); + end; + + { TcxExportProvider } + IcxExportProvider = interface + ['{442A08A8-CDDA-4FD6-8E15-9D8BD34554F6}'] + procedure Commit; + function GetCellStyle(const ACol, ARow: Integer): PcxCacheCellStyle; + function GetStyle(AStyleIndex: Integer): PcxCacheCellStyle; + function RegisterStyle(const AStyle: TcxCacheCellStyle): Integer; + procedure SetCellDataDouble(const ACol, ARow: Integer; const AValue: Double); + procedure SetCellDataInteger(const ACol, ARow: Integer; const AValue: Integer); + procedure SetCellDataString(const ACol, ARow: Integer; const AText: string); + procedure SetCellDataWideString(const ACol, ARow: Integer; const AText: Widestring); + procedure SetCellStyle(const ACol, ARow, AStyleIndex: Integer); overload; + procedure SetCellStyle(const ACol, ARow, AExampleCol, AExampleRow: Integer); overload; + procedure SetCellStyle(const ACol, ARow: Integer; const AStyle: TcxCacheCellStyle); overload; + procedure SetCellStyleEx(const ACol, ARow, H, W: Integer; const AStyleIndex: Integer); + procedure SetCellUnion(const ACol, ARow: Integer; H, W: Integer); + procedure SetCellValue(const ACol, ARow: Integer; const AValue: Variant); + procedure SetColumnWidth(const ACol, AWidth: Integer); + procedure SetDefaultStyle(const AStyle: TcxCacheCellStyle); + procedure SetRange(const AColCount, ARowCount: Integer; IsVisible: Boolean = True); + procedure SetRowHeight(const ARow, AHeight: Integer); + // export graphic extension + procedure SetCellDataGraphic(const ACol, ARow: Integer; var AGraphic: TGraphic); + function SupportGraphic: Boolean; + end; + + { IcxExportWithSeparators } + IcxExportWithSeparators = interface + ['{0E2919A6-8B49-49D7-B55B-B44B6DECF2E5}'] + procedure AddSeparator(const ASeparator: string); + end; + + { TcxCustomExportProvider } + TcxCustomExportProvider = class(TInterfacedObject) + private + FFileName: WideString; + protected + procedure Clear; dynamic; + property FileName: WideString read FFileName; + public + constructor Create(const AFileName: string); virtual; + procedure BeforeDestruction; override; + class function ExportType: Integer; virtual; + class function ExportName: string; virtual; + end; + + { TcxExport } + TcxExport = class + protected + class function GetExportClassByType( + AExportType: Integer): TcxExportProviderClass; virtual; + public + class function Provider(AExportType: Integer; + const AFileName: string): TcxCustomExportProvider; + class procedure SupportExportTypes(EnumSupportTypes: TcxEnumExportTypes); + class procedure SupportTypes(EnumFunc: TcxEnumTypes); + class function RegisterProviderClass(AProviderClass: TcxExportProviderClass): Boolean; + end; + + { TcxExportStyleManager } + TcxExportStyleManager = class + private + FRefCount: Integer; + FStyles: TList; + FFileName: string; + constructor CreateInstance(const AFileName: string); + function GetCount: Integer; + function GetItem(AIndex: Integer): TcxCacheCellStyle; + function StyleCompare(const AStyle1, AStyle2: PcxCacheCellStyle): Boolean; + public + constructor Create; + destructor Destroy; override; + procedure Clear; + class function GetInstance(const AFileName: string): TcxExportStyleManager; + function GetStyle(const AIndex: Integer): PcxCacheCellStyle; + function RegisterStyle(const AStyle: TcxCacheCellStyle): Integer; + property Items[AIndex: Integer]: TcxCacheCellStyle read GetItem; default; + property Count: Integer read GetCount; + end; + + { TFileStreamEx } + + TFileStreamEx = class(TFileStream) + public + constructor Create(const FileName: string; Mode: Word); overload; + end; + + TFileStreamClass = class of TFileStream; + + { TcxExportIntList } + + TcxExportIntList = class(TList) + private + function GetItem(AIndex: Integer): Integer; + procedure SetItem(AIndex, AValue: Integer); + public + procedure Add(AValue: Integer); + procedure AddPairs(AValue1, AValue2: Integer); + function Last: Integer; + function First: Integer; + + property Items[Index: Integer]: Integer read GetItem write SetItem; default; + end; + + { TcxExportScale } + + TcxExportScale = class(TcxExportIntList) + private + function GetVisibleCount: Integer; + function GetDelta(AIndex: Integer): Integer; + public + procedure Arrange; + function IndexOf(AItem: Integer): Integer; + function IndexOfEx(AValue, AFirstIndex, ALastIndex: Integer): Integer; + procedure GetPosition(AValue1, AValue2: Integer; out AIndex1, AIndex2: Integer); + procedure GetPositionEx(AValue1, AValue2, AFirstIndex, ALastIndex: Integer; out AIndex1, AIndex2: Integer); + + property Delta[Index: Integer]: Integer read GetDelta; + property VisibleCount: Integer read GetVisibleCount; + end; + + TcxColorToRgbProc = function(AColor: Integer): Integer; + TcxGetResourceStringProc = function(const ResString: Pointer): string; + +// unicode supported function prototypes + +function cxUnicodeToStr(const AText: WideString; ACharset: Integer = 0): string; +function cxStrToUnicode(const AText: string; ACharset: Integer = 0): Widestring; +function cxStrUnicodeNeeded(const AText: string; ACheckNormal: Boolean = False): Boolean; + +function cxChangeFileExtExW(const AFileName: WideString; const ANewExt: string): WideString; +function cxExtractFileNameEx(const AFileName: string): WideString; +function cxExtractFileNameExW(const AFileName: WideString): WideString; +function cxExtractFilePathExW(const AFileName: WideString): WideString; +function cxValidateFileName(const AFileName: string): WideString; +function cxValidateFileNameW(const AFileName: WideString): WideString; + +{$IFNDEF DELPHI5} +procedure FreeAndNil(var Obj); +function Supports(Instance: TObject; const Intf: TGUID; out Inst): Boolean; +{$ENDIF} + +function cxColorToRGB(const AColor: Integer): Integer; +function GetHashCode(const Buffer; Count: Integer): Integer; + +function SupportGraphic(AGraphic: TGraphic): Boolean; overload; +function SupportGraphic(AGraphicClass: TGraphicClass): Boolean; overload; + +procedure GetGraphicAsText(const AFileName: string; + var AGraphic: TGraphic; var AGraphicText: string); +procedure GetTextAsGraphicStream(const AText: string; var AFileName, AStream: string); + +procedure cxExportInit(AGetResString: TcxGetResourceStringProc; + AColorProc: Pointer; AIsNativeColor: Boolean); + +procedure UseGraphicImages(AUse: Boolean); + +var + DefaultCellStyle: TcxCacheCellStyle; + cxFileStreamClass: TFileStreamClass = TFileStreamEx; + cxBlackColor: Integer; + cxWindowColor: Integer; + cxBtnTextColor: Integer; + cxBtnShadowColor: Integer; + cxBtnFaceColor: Integer; + cxGetResString: TcxGetResourceStringProc; + cxUnicodeSupported: Boolean; + +const + cxExportGraphicClass: TGraphicClass = TBitmap; + cxExportToBinary = Integer($FFFFFFFF); + cxExportToHtml = Integer($00000002); + cxExportToXml = Integer($00000003); + cxExportToText = Integer($00000004); + cxExportToExcel = Integer($00000001); + + cxExportCurrencyFormat: string = ''; + cxDataTypeString = Integer($00000001); + cxDataTypeWideString = Integer($00000002); + cxDataTypeDouble = Integer($00000003); + cxDataTypeInteger = Integer($00000004); + cxDataTypeGraphic = Integer($00000005); + +resourcestring + cxExportListIndexError = 'List index out of bounds (%d)'; +implementation +var + StylesCache: TStringList; + RegisteredClasses: array of TcxExportProviderClass; + cxGetRgbColor: TcxColorToRgbProc; + IsNativeColor: Boolean; + GraphicCount: Integer; + GraphicRef: Integer; + +function CopyEx(const ASource: WideString; AFrom: Integer; ACount: Integer = MaxInt): WideString; +begin + Result := ''; + ACount := Min(Length(ASource) - AFrom + 1, ACount); + if ACount <= 0 then Exit; + SetLength(Result, ACount); + Move(ASource[AFrom], Result[1], ACount * SizeOf(WideChar)); +end; + +function GetLastDelimiterPos(const AFileName: WideString; ADelimiter: WideChar): Integer; +begin + Result := Length(AFileName); + if Result = 0 then Exit; + while (Result > 1) and (AFileName[Result] <> ADelimiter) do + Dec(Result); + if AFileName[Result] = ADelimiter then + Inc(Result); +end; + +function cxChangeFileExtExW(const AFileName: WideString; const ANewExt: string): WideString; +var + APos: Integer; +begin + APos := GetLastDelimiterPos(AFileName, '.'); + if APos <= 1 then + Result := AFileName + else + Result := CopyEx(AFileName, 1, APos - 2); + Result := Result + cxStrToUnicode(ANewExt); +end; + +function cxExtractFileNameEx(const AFileName: string): Widestring; +begin + Result := cxExtractFileNameExW(cxStrToUnicode(AFileName)); +end; + +function cxExtractFileNameExW(const AFileName: WideString): WideString; +begin + Result := CopyEx(AFileName, GetLastDelimiterPos(AFileName, '\')); +end; + +function cxExtractFilePathExW(const AFileName: WideString): WideString; +begin + Result := CopyEx(AFileName, 1, GetLastDelimiterPos(AFileName, '\') - 1); +end; + +function cxValidateFileName(const AFileName: string): WideString; +begin + Result := cxValidateFileNameW(cxStrToUnicode(AFileName)); +end; + +function cxValidateFileNameW(const AFileName: WideString): WideString; +begin + Result := AFileName; + while Pos('/', Result) <> 0 do + Result[Pos('/', Result)] := '\'; +end; + +procedure UseGraphicImages(AUse: Boolean); +begin + if AUse then + Inc(GraphicRef) + else + Dec(GraphicRef); + if GraphicRef = 0 then + GraphicCount := 0; +end; + +function CreateDefaultCellStyle: TcxCacheCellStyle; +var + I: Integer; +begin + with Result do + begin + AlignText := catCenter; + FillChar(FontName, SizeOf(FontName), 0); + FontName := 'Tahoma'; + FontStyle := []; + FontColor := cxBtnTextColor; + FontSize := 8; + FontCharSet := 0; + for I := 0 to 3 do + begin + Borders[I].IsDefault := False; + Borders[I].Width := 1; + Borders[I].Color := cxBtnShadowColor; + end; + BrushStyle := cbsSolid; + BrushBkColor := cxWindowColor; + BrushFgColor := cxBlackColor; + end; +end; + +function cxColorToRGB(const AColor: Integer): Integer; +type + TRGB = packed record + R, G, B, A: Byte; + end; + +begin + Result := cxGetRgbColor(AColor); + if IsNativeColor then Exit; + with TRGB(cxGetRgbColor(AColor)) do + begin + if AColor < 0 then + Result := R shl 16 + G shl 8 + B; + end; +end; + +{$IFDEF WIN32} +function cxUnicodeToStr(const AText: WideString; ACharset: Integer = 0): string; +var + APage, ALen: Integer; +begin + case ACharset of + THAI_CHARSET: + APage := 874; + SHIFTJIS_CHARSET: + APage := 932; + GB2312_CHARSET: + APage := 936; + HANGEUL_CHARSET, JOHAB_CHARSET: + APage := 949; + CHINESEBIG5_CHARSET: + APage := 950; + EASTEUROPE_CHARSET: + APage := 1250; + RUSSIAN_CHARSET: + APage := 1251; + GREEK_CHARSET: + APage := 1253; + TURKISH_CHARSET: + APage := 1254; + HEBREW_CHARSET: + APage := 1255; + ARABIC_CHARSET: + APage := 1256; + BALTIC_CHARSET: + APage := 1257; + else + APage := 0 + end; + ALen := WideCharToMultiByte(APage, 0, PWideChar(AText), Length(AText), nil, 0, nil, nil); + SetLength(Result, ALen); + WideCharToMultiByte(APage, 0, PWideChar(AText), Length(AText), PChar(Result), ALen, nil, nil); +end; + +function cxStrToUnicode(const AText: string; ACharset: Integer = 0): Widestring; +var + APage, ALen: Integer; +begin + case ACharset of + THAI_CHARSET: + APage := 874; + SHIFTJIS_CHARSET: + APage := 932; + GB2312_CHARSET: + APage := 936; + HANGEUL_CHARSET, JOHAB_CHARSET: + APage := 949; + CHINESEBIG5_CHARSET: + APage := 950; + EASTEUROPE_CHARSET: + APage := 1250; + RUSSIAN_CHARSET: + APage := 1251; + GREEK_CHARSET: + APage := 1253; + TURKISH_CHARSET: + APage := 1254; + HEBREW_CHARSET: + APage := 1255; + ARABIC_CHARSET: + APage := 1256; + BALTIC_CHARSET: + APage := 1257; + else + APage := 0 + end; + ALen := MultiByteToWideChar(APage, 0, PChar(AText), Length(AText), nil, 0); + SetLength(Result, ALen); + MultiByteToWideChar(APage, 0, PChar(AText), Length(AText), PWideChar(Result), ALen); +end; +{$ELSE} +function cxStrToUnicode(const AText: string; ACharset: Integer = 0): Widestring; +begin + Result := AText; +end; +{$ENDIF} + +function cxStrUnicodeNeeded(const AText: string; ACheckNormal: Boolean = False): Boolean; +var + I: Integer; +const + ANormal = ['0'..'9', ':', ';', '*', '+', ',', '-', '.', '/', '!', ' ', + 'A'..'Z', 'a'..'z', '_', '(', ')']; +begin + Result := False; + for I := 1 to Length(AText) do + if (Byte(AText[I]) > $7F) or (ACheckNormal and not (AText[I] in ANormal)) then + begin + Result := True; + Break; + end +end; + +function GetHashCode(const Buffer; Count: Integer): Integer; assembler; +asm + MOV ECX, EDX + MOV EDX, EAX + XOR EAX, EAX +@@1: ROL EAX, 5 + XOR AL, [EDX] + INC EDX + DEC ECX + JNE @@1 +end; + +function GetGraphicFileName(const AFileName, AExt: string): string; +begin + Result := ChangeFileExt(AFileName, '.images') + '\' + ChangeFileExt( + ExtractFileName(AFileName), '') + '_' + IntToStr(GraphicCount) + '.' + AExt; + Inc(GraphicCount); +end; + +function PrepareGraphic(AGraphic: TGraphic): TGraphic; +begin + Result := AGraphic; + if not SupportGraphic(cxExportGraphicClass) then + begin + Result := cxExportGraphicClass.Create; + try + try + Result.Assign(AGraphic); + except + Result.Free; + Result := AGraphic; + end; + finally + if Result <> AGraphic then + AGraphic.Free; + end; + end; +end; + +function SupportGraphic(AGraphic: TGraphic): Boolean; +begin + Result := SupportGraphic(TGraphicClass(AGraphic.ClassType)); +end; + +function SupportGraphic(AGraphicClass: TGraphicClass): Boolean; +begin + Result := (AGraphicClass <> nil) and + (AGraphicClass.InheritsFrom(TBitmap) or + AGraphicClass.InheritsFrom(TMetaFile)); +end; + +procedure GetGraphicAsText(const AFileName: string; + var AGraphic: TGraphic; var AGraphicText: string); +var + L: Integer; + AName: string; + AMemStream: TMemoryStream; +begin + AGraphic := PrepareGraphic(AGraphic); + AName := GetGraphicFileName(AFileName, + GraphicExtension(TGraphicClass(AGraphic.ClassType))); + AMemStream := TMemoryStream.Create; + try + AGraphic.SaveToStream(AMemStream); + L := Length(AName); + SetLength(AGraphicText, AMemStream.Size + L + SizeOf(L)); + Move(L, AGraphicText[1], SizeOf(L)); + Move(AName[1], AGraphicText[1 + SizeOf(L)], L); + Move(AMemStream.Memory^, AGraphicText[1 + SizeOf(L) + L], AMemStream.Size); + finally + AMemStream.Free; + end; +end; + +procedure GetTextAsGraphicStream(const AText: string; var AFileName, AStream: string); +var + L: Integer; +begin + Move(AText[1], L, SizeOf(L)); + SetLength(AFileName, L); + Move(AText[1 + SizeOf(L)], AFileName[1], L); + SetLength(AStream, Length(AText) - SizeOf(L) - L); + Move(AText[1 + SizeOf(L) + L], AStream[1], Length(AStream)); +end; + +{$IFNDEF DELPHI5} +procedure FreeAndNil(var Obj); +var + Temp: TObject; +begin + Temp := TObject(Obj); + Pointer(Obj) := nil; + Temp.Free; +end; + +function Supports(Instance: TObject; const Intf: TGUID; out Inst): Boolean; +begin + Result := (Instance <> nil) and Instance.GetInterface(Intf, Inst); +end; +{$ENDIF} + +{ TcxExport } +class function TcxExport.Provider(AExportType: Integer; + const AFileName: string): TcxCustomExportProvider; +begin + Result := GetExportClassByType(AExportType).Create(AFileName); +end; + +class procedure TcxExport.SupportExportTypes( + EnumSupportTypes: TcxEnumExportTypes); +var + I: Integer; +begin + for I := 0 to Length(RegisteredClasses) - 1 do + begin + with RegisteredClasses[I] do + EnumSupportTypes(ExportType, ExportName); + end; +end; + +class procedure TcxExport.SupportTypes(EnumFunc: TcxEnumTypes); +var + I: Integer; +begin + for I := 0 to Length(RegisteredClasses) - 1 do + EnumFunc(RegisteredClasses[I].ExportType); +end; + +class function TcxExport.RegisterProviderClass(AProviderClass: TcxExportProviderClass): Boolean; +var + I: Integer; +begin + Result := False; + if AProviderClass = nil then + Exit; + for I := 0 to Length(RegisteredClasses) - 1 do + begin + if (AProviderClass.ExportType = RegisteredClasses[I].ExportType) or + (AProviderClass = RegisteredClasses[I]) then Exit; + end; + I := Length(RegisteredClasses); + SetLength(RegisteredClasses, I + 1); + RegisteredClasses[I] := AProviderClass; + Result := True; +end; + +class function TcxExport.GetExportClassByType( + AExportType: Integer): TcxExportProviderClass; +var + I: Integer; +begin + for I := 0 to Length(RegisteredClasses) - 1 do + begin + if RegisteredClasses[I].ExportType = AExportType then + begin + Result := RegisteredClasses[I]; + Exit; + end; + end; + raise EcxExportData.CreateFmt(cxGetResString(@scxUnsupportedExport), [AExportType]); +end; + +{ TcxCustomExportProvider } +constructor TcxCustomExportProvider.Create(const AFileName: string); +begin + FFileName := cxValidateFileName(AFileName); +end; + +procedure TcxCustomExportProvider.BeforeDestruction; +begin + Clear; +end; + +class function TcxCustomExportProvider.ExportType: Integer; +begin + Result := -1; +end; + +class function TcxCustomExportProvider.ExportName: string; +begin + Result := ''; +end; + +procedure TcxCustomExportProvider.Clear; +begin +end; + +{ TcxExportStyleManager } +constructor TcxExportStyleManager.Create; +begin + raise EcxExportData.Create(cxGetResString(@scxStyleManagerCreate)); +end; + +destructor TcxExportStyleManager.Destroy; +begin + if FRefCount <> 0 then + raise EcxExportData.Create(cxGetResString(@scxStyleManagerKill)); + inherited Destroy; +end; + +procedure TcxExportStyleManager.Clear; +var + I: Integer; +begin + Dec(FRefCount); + if FRefCount = 0 then + begin + try + for I := 0 to FStyles.Count - 1 do + FreeMem(PcxCacheCellStyle(FStyles[I])); + if StylesCache.Find(FFileName, I) then + StylesCache.Delete(I); + finally + FStyles.Free; + Destroy; + end; + end; +end; + +class function TcxExportStyleManager.GetInstance( + const AFileName: string): TcxExportStyleManager; +var + AIndex: Integer; +begin + if StylesCache.Find(AFileName, AIndex) then + begin + Result := TcxExportStyleManager(StylesCache.Objects[AIndex]); + Result.RegisterStyle(DefaultCellStyle); + Inc(Result.FRefCount); + end + else + Result := CreateInstance(AFileName); +end; + +function TcxExportStyleManager.GetStyle(const AIndex: Integer): PcxCacheCellStyle; +begin + Result := FStyles[AIndex]; +end; + +function TcxExportStyleManager.RegisterStyle( + const AStyle: TcxCacheCellStyle): Integer; +var + I: Integer; + NewStyleItem, AStylePtr: PcxCacheCellStyle; +begin + AStylePtr := @AStyle; + AStylePtr^.HashCode := + cxExport.GetHashCode(AStyle, SizeOf(TcxCacheCellStyle) - SizeOf(Integer)); + for I := 0 to FStyles.Count - 1 do + if StyleCompare(FStyles[I], @AStyle) then + begin + Result := I; + Exit; + end; + New(NewStyleItem); + NewStyleItem^ := AStylePtr^; + Result := FStyles.Add(NewStyleItem); +end; + +function TcxExportStyleManager.GetCount: Integer; +begin + Result := FStyles.Count; +end; + +function TcxExportStyleManager.GetItem(AIndex: Integer): TcxCacheCellStyle; +begin + Result := GetStyle(AIndex)^; +end; + +constructor TcxExportStyleManager.CreateInstance(const AFileName: string); +begin + FStyles := TList.Create; + StylesCache.AddObject(AFileName, Self); + FFileName := AFileName; + FRefCount := 1; +end; + +function TcxExportStyleManager.StyleCompare( + const AStyle1, AStyle2: PcxCacheCellStyle): Boolean; +begin + Result := (AStyle1.HashCode = AStyle2.HashCode) and + CompareMem(AStyle1, AStyle2, SizeOf(TcxCacheCellStyle) - SizeOf(Integer)); +end; + +constructor TFileStreamEx.Create(const FileName: string; Mode: Word); +{$IFDEF DELPHI6} +var + AName: WideString; +{$ENDIF} +begin +{$IFDEF DELPHI6} + if cxUnicodeSupported then + begin + AName := cxStrToUnicode(FileName); + FHandle := Integer(CreateFileW(PWideChar(AName), GENERIC_READ or GENERIC_WRITE, + 0, nil, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)); + end + else +{$ENDIF} + inherited Create(FileName, Mode); +end; + +function CompareValues(AItem1, AItem2: Pointer): Integer; +begin + Result := Integer(AItem1) - Integer(AItem2); +end; + +{ TcxExportIntList } + +procedure TcxExportIntList.Add(AValue: Integer); +begin + if Capacity - Count < 2 then + if Count * 2 < 1024 then + Capacity := 1024 + else + Capacity := Count * 2; + inherited Add(Pointer(AValue)); +end; + +procedure TcxExportIntList.AddPairs(AValue1, AValue2: Integer); +begin + if Capacity - Count < 2 then + if Count * 2 < 1024 then + Capacity := 1024 + else + Capacity := Count * 2; + inherited Add(Pointer(AValue1)); + inherited Add(Pointer(AValue2)); +end; + +function TcxExportIntList.Last: Integer; +begin + Result := Integer(inherited Last); +end; + +function TcxExportIntList.First: Integer; +begin + Result := Integer(inherited First); +end; + +function TcxExportIntList.GetItem(AIndex: Integer): Integer; +begin + Result := Integer(List^[AIndex]); +end; + +procedure TcxExportIntList.SetItem(AIndex, AValue: Integer); +begin + Integer(List^[AIndex]) := AValue +end; + +{ TcxExportScale } + +procedure TcxExportScale.Arrange; +var + AIndex, I: Integer; +begin + Sort(@CompareValues); + AIndex := 0; + for I := 1 to Count - 1 do + begin + if List^[AIndex] <> List^[I] then + Inc(AIndex); + List^[AIndex] := List^[I]; + end; + if Count > 0 then + Count := AIndex + 1; +end; + +function TcxExportScale.IndexOf(AItem: Integer): Integer; +begin + Result := IndexOfEx(AItem, 0, VisibleCount); +end; + +function TcxExportScale.IndexOfEx(AValue, AFirstIndex, ALastIndex: Integer): Integer; +var + L, H, I, C: Integer; +begin + Result := -1; + // binary search + L := AFirstIndex; + H := ALastIndex; + while L <= H do + begin + I := (L + H) shr 1; + C := Integer(List^[I]) - AValue; + if C < 0 then + L := I + 1 + else + begin + H := I - 1; + if C = 0 then + begin + Result := I; + Break; + end; + end; + end; + if Result = - 1 then + Error(@cxExportListIndexError, AValue); +end; + +procedure TcxExportScale.GetPosition( + AValue1, AValue2: Integer; out AIndex1, AIndex2: Integer); +begin + AIndex1 := IndexOf(AValue1); + AIndex2 := IndexOfEx(AValue2, AIndex1, Count - 1); +end; + +procedure TcxExportScale.GetPositionEx(AValue1, AValue2, + AFirstIndex, ALastIndex: Integer; out AIndex1, AIndex2: Integer); +begin + AIndex1 := IndexOfEx(AValue1, AFirstIndex, ALastIndex); + AIndex2 := IndexOfEx(AValue2, AIndex1, ALastIndex); +end; + +function TcxExportScale.GetVisibleCount: Integer; +begin + Result := Count; + Dec(Result); +end; + +function TcxExportScale.GetDelta(AIndex: Integer): Integer; +begin + Result := Integer(List^[AIndex + 1]) - Integer(List^[AIndex]); +end; + +function GetCurrencyFormat: string; + + function GetCharString(C: Char; ACount: Integer): string; + var + I: Integer; + begin + Result := ''; + for I := 1 to ACount do + Result := Result + C; + end; + + function GetPositiveCurrencyFormat(const AFormat, ACurrStr: string): string; + begin + if Length(ACurrStr) > 0 then + case Sysutils.CurrencyFormat of + 0: Result := ACurrStr + AFormat; { '$1' } + 1: Result := AFormat + ACurrStr; { '1$' } + 2: Result := ACurrStr + ' ' + AFormat; { '$ 1' } + 3: Result := AFormat + ' ' + ACurrStr; { '1 $' } + end; + end; + + function GetNegativeCurrencyFormat(const AFormat, ACurrStr: string): string; + begin + case Sysutils.NegCurrFormat of + 0: Result := '(' + ACurrStr + AFormat + ')'; + 1: Result := '-' + ACurrStr + AFormat; + 2: Result := ACurrStr + '-' + AFormat; + 3: Result := ACurrStr + AFormat + '-'; + 4: Result := '(' + AFormat + ACurrStr + ')'; + 5: Result := '-' + AFormat + ACurrStr; + 6: Result := AFormat + '-' + ACurrStr; + 7: Result := AFormat + ACurrStr + '-'; + 8: Result := '-' + AFormat + ' ' + ACurrStr; + 9: Result := '-' + ACurrStr + ' ' + AFormat; + 10: Result := AFormat + ' ' + ACurrStr + '-'; + 11: Result := ACurrStr + ' ' + AFormat + '-'; + 12: Result := ACurrStr + ' ' + '-' + AFormat; + 13: Result := AFormat + '-' + ' ' + ACurrStr; + 14: Result := '(' + ACurrStr + ' ' + AFormat + ')'; + 15: Result := '(' + AFormat + ' ' + ACurrStr + ')'; + end; + end; + +var + ACurrStr: string; + I: Integer; + C: Char; +begin + if CurrencyDecimals > 0 then + Result := GetCharString('0', CurrencyDecimals) + else + Result := ''; + Result := ',0.' + Result; + ACurrStr := ''; + for I := 1 to Length(CurrencyString) do + begin + C := CurrencyString[I]; + if (C = ',') or (C = '.') then + ACurrStr := ACurrStr + '''' + C + '''' + else + ACurrStr := ACurrStr + C; + end; + Result := GetPositiveCurrencyFormat(Result, ACurrStr) + ';' + + GetNegativeCurrencyFormat(Result, ACurrStr); +end; + +procedure cxExportInit(AGetResString: TcxGetResourceStringProc; + AColorProc: Pointer; AIsNativeColor: Boolean); +begin + cxGetResString := AGetResString; + cxGetRgbColor := AColorProc; + IsNativeColor := AIsNativeColor; + cxUnicodeSupported := (Win32Platform = VER_PLATFORM_WIN32_NT) and + (Win32MajorVersion >= 5); +{$IFDEF WIN32} + cxWindowColor := Windows.GetSysColor(COLOR_WINDOW); + cxBtnTextColor := Windows.GetSysColor(COLOR_BTNTEXT); + cxBtnFaceColor := Windows.GetSysColor(COLOR_BTNFACE); + cxBtnShadowColor := Windows.GetSysColor(COLOR_BTNSHADOW); +{$ELSE} + cxWindowColor := cxColorToRGB(clWindow); + cxBtnTextColor := cxColorToRGB(clBtnText); + cxBtnFaceColor := cxColorToRGB(clBtnFace); + cxBtnShadowColor := ColorToRGB(clBtnShadow); +{$ENDIF} + FreeAndNil(StylesCache); + StylesCache := TStringList.Create; + DefaultCellStyle := CreateDefaultCellStyle; + cxExportCurrencyFormat := GetCurrencyFormat; +end; + +initialization + StylesCache := nil; + +finalization + FreeAndNil(StylesCache); + +end. diff --git a/official/x.35/ExpressExport Library/Sources/cxExportStrs.pas b/official/x.35/ExpressExport Library/Sources/cxExportStrs.pas new file mode 100644 index 00000000..dae0fb0d --- /dev/null +++ b/official/x.35/ExpressExport Library/Sources/cxExportStrs.pas @@ -0,0 +1,66 @@ +{*******************************************************************} +{ } +{ Developer Express Cross Platform Component Library } +{ ExpressExport } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEXPORT AND ALL } +{ ACCOMPANYING VCL AND CLX CONTROLS AS PART OF AN EXECUTABLE } +{ PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit cxExportStrs; + +interface + +resourcestring + scxUnsupportedExport = 'Unsupported export type: %1'; + scxStyleManagerKill = 'The Style Manager is currently being used elsewhere and can not be released at this stage'; + scxStyleManagerCreate = 'Can''t create style manager'; + + scxExportToHtml = 'Export to Web page (*.html)'; + scxExportToXml = 'Export to XML document (*.xml)'; + scxExportToText = 'Export to text format (*.txt)'; + + scxEmptyExportCache = 'Export cache is empty'; + scxIncorrectUnion = 'Incorrect union of cells'; + scxIllegalWidth = 'Illegal width of the column'; + scxInvalidColumnRowCount = 'Invalid column or row count'; + scxIllegalHeight = 'Illegal height of the row'; + scxInvalidColumnIndex = 'The column index %d out of bounds'; + scxInvalidRowIndex = 'The row index %d out of bounds'; + scxInvalidStyleIndex = 'Invalid style index %d'; + + scxExportToExcel = 'Export to MS Excel (*.xls)'; + scxWorkbookWrite = 'Error write XLS file'; + scxInvalidCellDimension = 'Invalid cell dimension'; + scxBoolTrue = 'True'; + scxBoolFalse = 'False'; + +implementation + +end. diff --git a/official/x.35/ExpressExport Library/Sources/cxHtmlXmlTxtExport.pas b/official/x.35/ExpressExport Library/Sources/cxHtmlXmlTxtExport.pas new file mode 100644 index 00000000..7d2fcff9 --- /dev/null +++ b/official/x.35/ExpressExport Library/Sources/cxHtmlXmlTxtExport.pas @@ -0,0 +1,1749 @@ +{*******************************************************************} +{ } +{ Developer Express Cross Platform Component Library } +{ ExpressExport } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEXPORT AND ALL } +{ ACCOMPANYING VCL AND CLX CONTROLS AS PART OF AN EXECUTABLE } +{ PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} +unit cxHtmlXmlTxtExport; + +{$I cxVer.inc} + +interface +uses + SysUtils, Math, Classes, + Windows, +{$IFDEF DELPHI6} Variants, {$IFNDEF NONDB} FMTBcd, SqlTimSt, {$ENDIF} {$ENDIF} + cxExport, cxExportStrs, Graphics; + +type + { TcxCustomHtmlXmlTXTExportProvider } + TcxCustomHtmlXmlTXTExportProvider = class(TcxCustomExportProvider, IcxExportProvider) + private + FCache: array of array of TcxCacheItem; + FColumns: array of Integer; + FDefaultStyle: TcxCacheCellStyle; + FInternalCacheList: TInterfaceList; + FName: string; + FRows: array of Integer; + FStyleManager: TcxExportStyleManager; + function GetCacheItem(ACol, ARow: Integer): TcxCacheItem; + function GetCellHeight(ACol, ARow: Integer): Integer; + function GetCellWidth(ACol, ARow: Integer): Integer; + function GetColumns(ACol: Integer): Integer; + function GetDefaultStyle: PcxCacheCellStyle; + function GetHeight: Integer; + function GetInternalCacheCount: Integer; + function GetInternalCacheItems(AIndex: Integer): IcxCellInternalCache; + function GetRows(ARow: Integer): Integer; + function GetStyleCount: Integer; + function GetWidth: Integer; + procedure TestIndex(ACol, ARow: Integer); + procedure TestCol(ACol: Integer); + procedure TestRow(ARow: Integer); + procedure TestStyleIndex(AStyleIndex: Integer); + protected + procedure Clear; override; + function GetCellData(const ACol, ARow: Integer; var AData): Boolean; + procedure SetData(const ACol, ARow, ADataSize, ADataType: Integer; const AData); + procedure SetEmptyData(const ACol, ARow, ADataType: Integer); + procedure Commit; dynamic; + function GetCacheName: string; + function GetCellStyle(const ACol, ARow: Integer): PcxCacheCellStyle; + function GetExportType: Integer; + function GetExportName: string; + function GetStyle(AStyleIndex: Integer): PcxCacheCellStyle; + function RegisterStyle(const AStyle: TcxCacheCellStyle): Integer; + procedure SetCellDataString(const ACol, ARow: Integer; const AText: string); virtual; + procedure SetCellDataWideString(const ACol, ARow: Integer; const AText: Widestring); virtual; + procedure SetCellDataDouble(const ACol, ARow: Integer; const AValue: Double); virtual; + procedure SetCellDataInteger(const ACol, ARow: Integer; const AValue: Integer); virtual; + procedure SetCellStyle(const ACol, ARow, AStyleIndex: Integer); overload; virtual; + procedure SetCellStyle(const ACol, ARow, AExampleCol, AExampleRow: Integer); overload; virtual; + procedure SetCellStyle(const ACol, ARow: Integer; const AStyle: TcxCacheCellStyle); overload; virtual; + procedure SetCellStyleEx(const ACol, ARow, H, W: Integer; const AStyleIndex: Integer); + procedure SetCellUnion(const ACol, ARow: Integer; H, W: Integer); + procedure SetCellValue(const ACol, ARow: Integer; const AValue: Variant); + procedure SetColumnWidth(const ACol, AWidth: Integer); + procedure SetDefaultStyle(const AStyle: TcxCacheCellStyle); + procedure SetRange(const AColCount, ARowCount: Integer; IsVisible: Boolean = True); + procedure SetRowHeight(const ARow, AHeight: Integer); + // export graphic extension + procedure SetCellDataGraphic(const ACol, ARow: Integer; var AGraphic: TGraphic); + function SupportGraphic: Boolean; virtual; + + property Cache[ACol, ARow: Integer]: TcxCacheItem read GetCacheItem; + property Columns[ACol: Integer]: Integer read GetColumns; + property DefaultStyle: PcxCacheCellStyle read GetDefaultStyle; + property RowCount: Integer read GetHeight; + property InternalCacheCount: Integer read GetInternalCacheCount; + property InternalCacheItems[AIndex: Integer]: IcxCellInternalCache read GetInternalCacheItems; + property Name: string read FName write FName; + property Rows[ARow: Integer]: Integer read GetRows; + property StyleCount: Integer read GetStyleCount; + property Styles[AIndex: Integer]: PcxCacheCellStyle read GetStyle; + property CellHeight[ACol, ARow: Integer]: Integer read GetCellHeight; + property CellWidth[ACol, ARow: Integer]: Integer read GetCellWidth; + property ColCount: Integer read GetWidth; + public + constructor Create(const AFileName: string); override; + destructor Destroy; override; + end; + + { TcxCustomExportProviderSupportedCellInternalChache } + TcxCustomExportProviderSupportedCellInternalChache = class(TcxCustomHtmlXmlTXTExportProvider, IcxCellInternalCache) + protected + procedure CommitCache(AStream: TStream; AParam: Pointer); virtual; + procedure CommitStyle(AStream: TStream; AParam: Pointer); virtual; + procedure DeleteCacheFromCell(const ACol, ARow: Integer); + procedure SetCacheIntoCell(const ACol, ARow: Integer; ACache: IcxCellInternalCache); + procedure SetEmptyCellsStyle; + end; + + { TcxHTMLExportProvider } + TcxHTMLExportProvider = class(TcxCustomExportProviderSupportedCellInternalChache) + private + procedure CommitHTML(AStream: TStream); + function GetStyle(AStyle: TcxCacheCellStyle): string; + function GetScaleRow: string; + protected + procedure CommitCache(AStream: TStream; AParam: Pointer); override; + procedure CommitStyle(AStream: TStream; AParam: Pointer); override; + function GetContentWidth: Integer; + public + procedure Commit; override; + class function ExportType: Integer; override; + class function ExportName: string; override; + end; + + { TcxXMLExportProvider } + TcxXMLExportProvider = class(TcxCustomExportProviderSupportedCellInternalChache) + private + FHideDotsOn: Boolean; + FXSLFileName: WideString; + procedure CommitXML(AStream: TStream); + procedure CommitXSL(AStream: TStream); + function ConvertTextToXML(const AText: string; ACol, ARow: Integer): string; + function GetBorderStyle(AStyle: TcxCacheCellStyle): string; + function GetCellParams(ACol, ARow: Integer): string; + function GetData(ACol, ARow: Integer): string; + function GetStyle(AStyle: TcxCacheCellStyle): string; + procedure HideDots; + function GetScaleLine: string; + protected + procedure CommitCache(AStream: TStream; AParam: Pointer); override; + procedure CommitStyle(AStream: TStream; AParam: Pointer); override; + public + constructor Create(const AFileName: string); override; + procedure Commit; override; + class function ExportType: Integer; override; + class function ExportName: string; override; + end; + + { TcxTXTExportProvider } + TcxTXTExportProvider = class(TcxCustomExportProviderSupportedCellInternalChache, IcxExportWithSeparators) + private + FBeginString: string; + FColMaxWidth: array of Integer; + FEndString: string; + FIndex: Integer; + FSeparator: string; + procedure CalculateColMaxWidth; + function GetData(ACol, ARow: Integer): string; + protected + procedure AddSeparator(const ASeparator: string); + procedure CommitCache(AStream: TStream; AParam: Pointer); override; + function SupportGraphic: Boolean; override; + public + constructor Create(const AFileName: string); override; + procedure Commit; override; + class function ExportType: Integer; override; + class function ExportName: string; override; + end; + +const + cxXMLEmptyChar = '.'; + cxExportDefaultEmptyString: string = ' '; + +implementation + +function HasBorders(ACellStyle: PcxCacheCellStyle): Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to 3 do + Result := Result or (ACellStyle.Borders[I].Width > 0); +end; + +function DirExist(const ADirectory: string): Boolean; +{$IFNDEF DELPHI6} +var + ACode: Integer; +{$ENDIF} +begin +{$IFDEF DELPHI6} + Result := DirectoryExists(ADirectory); +{$ELSE} + ACode := GetFileAttributes(PChar(ADirectory)); + Result := (ACode <> -1) and (FILE_ATTRIBUTE_DIRECTORY and ACode <> 0); +{$ENDIF} +end; + +function GraphicNeeded(const ADir, AGraphicData: string; AddTags: Boolean = True): string; +var + F: File; + AGraphicStream: string; +begin + GetTextAsGraphicStream(AGraphicData, Result, AGraphicStream); + if not DirExist(ExtractFileDir(Result)) then + CreateDir(ExtractFileDir(Result)); + AssignFile(F, Result); + Rewrite(F, 1); + try + BlockWrite(F, AGraphicStream[1], Length(AGraphicStream)); + finally + CloseFile(F); + end; + Delete(Result, 1, Length(ADir)); + while Pos('\', Result) <> 0 do + Result[Pos('\', Result)] := '/'; + if AddTags then + Result := ''; +end; + +function GetHTMLColor(AColor: Integer): string; +begin + Result := 'rgb(' + IntToStr(AColor and $FF) + ',' + + IntToStr(Byte(AColor shr 8)) + ',' + IntToStr(Byte(AColor shr 16)) + ')'; +end; + +function ConvertCRLFSymbols(const AString: string): string; +var + I: Integer; +begin + Result := ''; + for I := 1 to Length(AString) do + begin + if AString[I] = #13 then + begin + if I < Length(AString) then + if AString[I + 1] = #10 then + begin + Result := Result + '
'; + Continue; + end; + end + else if AString[I] = #10 then + begin + if I > 1 then + begin + if AString[I - 1] <> #13 then + Result := Result + '
'; + end + else + Result := Result + '
'; + Continue; + end; + Result := Result + AString[I]; + end; +end; + +function ConvertSpecialCharacters(const AString: string): string; +var + I: Integer; +begin + Result := ''; + for I := 1 to Length(AString) do + begin + if AString[I] = '<' then + Result := Result + '<' + else if AString[I] = '>' then + Result := Result + '>' + else if AString[I] = '&' then + Result := Result + '&' + else if AString[I] = '"' then + Result := Result + '"' + else + Result := Result + AString[I]; + end; +end; + +function CheckedUnicodeString(const S: string; ACharset: Integer = 0): string; +var + I: Integer; + W: WideString; +begin + if cxStrUnicodeNeeded(S, True) then + begin + W := cxStrToUnicode(S, ACharset); + Result := ''; + for I := 1 to Length(W) do + Result := Result + '&#' + IntToStr(Integer(W[I])) + ';'; + end + else + Result := S; +end; + +function CheckedUnicodeStringW(const S: WideString): string; +var + I: Integer; +begin + if cxUnicodeSupported then + begin + Result := ''; + for I := 1 to Length(S) do + Result := Result + '&#' + IntToStr(Integer(S[I])) + ';'; + end + else + Result := cxUnicodeToStr(S); +end; + +{ TcxCustomHtmlXmlTXTExportProvider } +constructor TcxCustomHtmlXmlTXTExportProvider.Create(const AFileName: string); +begin + inherited Create(AFileName); + FDefaultStyle := DefaultCellStyle; + FInternalCacheList := TInterfaceList.Create; + FStyleManager := TcxExportStyleManager.GetInstance(AFileName); + FName := ''; + UseGraphicImages(True); +end; + +destructor TcxCustomHtmlXmlTXTExportProvider.Destroy; +begin + UseGraphicImages(False); + FInternalCacheList.Free; + FStyleManager.Clear; + inherited Destroy; +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.Clear; +var + I, J: Integer; +begin + for I := 0 to Length(FCache) - 1 do + for J := 0 to Length(FCache[I]) - 1 do + try + with FCache[I, J] do + ReallocMem(FCache[I, J].Data, 0); + finally + FCache[I, J].Data := nil; + FCache[I, J].InternalCache.Cache := nil; + FCache[I, J].InternalCache.Index := -1; + end; + + FInternalCacheList.Clear; + SetLength(FCache, 0, 0); + SetLength(FColumns, 0); + SetLength(FRows, 0); +end; + +function TcxCustomHtmlXmlTXTExportProvider.GetCacheName: string; +begin + Result := FName; +end; + +function TcxCustomHtmlXmlTXTExportProvider.GetCellData(const ACol, ARow: Integer; var AData): Boolean; +begin + TestIndex(ACol, ARow); + + with FCache[ACol, ARow] do + begin + Result := Data <> nil; + if Result then + Move(Data^, AData, DataSize); + end; +end; + +function TcxCustomHtmlXmlTXTExportProvider.GetCellStyle(const ACol, + ARow: Integer): PcxCacheCellStyle; +begin + TestIndex(ACol, ARow); + with FCache[ACol, ARow] do + begin + if StyleIndex < 0 then + Result := @FDefaultStyle + else + Result := FStyleManager.GetStyle(StyleIndex); + end; +end; + +function TcxCustomHtmlXmlTXTExportProvider.GetExportType: Integer; +begin + Result := ExportType; +end; + +function TcxCustomHtmlXmlTXTExportProvider.GetExportName: string; +begin + Result := ExportName; +end; + +function TcxCustomHtmlXmlTXTExportProvider.RegisterStyle(const AStyle: TcxCacheCellStyle): Integer; +begin + Result := FStyleManager.RegisterStyle(AStyle) +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.SetCellDataString(const ACol, ARow: Integer; const AText: string); +begin + if AText <> '' then + SetData(ACol, ARow, Length(AText), cxDataTypeString, AText[1]) + else + SetEmptyData(ACol, ARow, cxDataTypeString); +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.SetCellDataWideString(const ACol, ARow: Integer; const AText: Widestring); +begin + if AText <> '' then + SetData(ACol, ARow, Length(AText)*2, cxDataTypeWideString, AText[1]) + else + SetEmptyData(ACol, ARow, cxDataTypeWideString); +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.SetCellDataDouble(const ACol, ARow: Integer; const AValue: Double); +begin + SetData(ACol, ARow, Sizeof(Double), cxDataTypeDouble, AValue); +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.SetCellDataInteger(const ACol, ARow: Integer; const AValue: Integer); +begin + SetData(ACol, ARow, Sizeof(Integer), cxDataTypeInteger, AValue); +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.SetCellStyle(const ACol, ARow, AStyleIndex: Integer); +begin + TestIndex(ACol, ARow); + TestStyleIndex(AStyleIndex); + + FCache[ACol, ARow].StyleIndex := AStyleIndex; +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.SetCellStyle(const ACol, ARow, AExampleCol, + AExampleRow: Integer); +begin + TestIndex(ACol, ARow); + TestIndex(AExampleCol, AExampleRow); + + FCache[ACol, ARow].StyleIndex := FCache[AExampleCol, AExampleRow].StyleIndex; +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.SetCellStyle(const ACol, ARow: Integer; + const AStyle: TcxCacheCellStyle); +begin + TestIndex(ACol, ARow); + + FCache[ACol, ARow].StyleIndex := RegisterStyle(AStyle); +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.SetCellStyleEx( + const ACol, ARow, H, W: Integer; const AStyleIndex: Integer); +begin + SetCellStyle(ACol, ARow, AStyleIndex); + SetCellUnion(ACol, ARow, H, W); +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.SetCellUnion(const ACol, ARow: Integer; + H, W: Integer); +var + I, J: Integer; +begin + TestIndex(ACol, ARow); + W := Min(W, Length(FCache) - ACol); + if W < 1 then + W := 1; + H := Min(H, Length(FCache[ACol]) - ARow); + if H < 1 then + H := 1; + with FCache[ACol, ARow] do + begin + IsUnion := True; + Height := H; + Width := W; + for I := ACol to ACol + Width - 1 do + for J := ARow to ARow + Height - 1 do + FCache[I, J].IsHidden := not ((I = ACol) and (J = ARow)); + end; +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.SetCellValue(const ACol, + ARow: Integer; const AValue: Variant); +var +{$IFDEF DELPHI6} + {$IFNDEF NONDB} + ACurr: Currency; + {$ENDIF} +{$ENDIF} + AText: string; +begin + if VarIsNull(AValue) then + AText := '' + else + if TVarData(AValue).VType = varCurrency then + AText := FormatFloat(cxExportCurrencyFormat, Currency(AValue)) + else +{$IFDEF DELPHI6} + {$IFNDEF NONDB} + if TVarData(AValue).VType = VarSQLTimeStamp then + AText := DateTimeToStr(AValue) + else + if TVarData(AValue).VType = VarFMTBcd then + begin + if BcdToCurr(VarToBcd(AValue), ACurr) then + AText := FormatFloat(cxExportCurrencyFormat, ACurr) + else + AText := FloatToStr(Double(BcdToDouble(VarToBcd(AValue)))); + end + else + {$ENDIF} +{$ENDIF} + AText := AValue; + SetCellDataString(ACol, ARow, AText); +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.SetColumnWidth(const ACol, AWidth: Integer); +begin + TestCol(ACol); + if AWidth < 0 then + raise EcxExportData.Create(cxGetResString(@scxIllegalWidth)); + FColumns[ACol] := Abs(AWidth); +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.SetDefaultStyle(const AStyle: TcxCacheCellStyle); +begin + FDefaultStyle := AStyle; +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.SetData(const ACol, ARow, ADataSize, + ADataType: Integer; const AData); +begin + TestIndex(ACol, ARow); + + with FCache[ACol, ARow] do + begin + ReallocMem(Data, ADataSize); + Move(AData, Data^, ADataSize); + DataSize := ADataSize; + DataType := ADataType; + end; +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.SetEmptyData(const ACol, ARow, ADataType: Integer); +begin + TestIndex(ACol, ARow); + + with FCache[ACol, ARow] do + begin + ReallocMem(Data, 0); + Data := nil; + DataSize := 0; + DataType := ADataType; + end; +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.Commit; +begin +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.SetRange(const AColCount, ARowCount: Integer; + IsVisible: Boolean); +var + I, J, K: Integer; + ABorderWidth: Integer; +begin + if (AColCount <= 0) or (ARowCount <= 0) then + raise EcxExportData.Create(cxGetResString(@scxInvalidColumnRowCount)); + + SetLength(FCache, AColCount, ARowCount); + SetLength(FColumns, AColCount); + SetLength(FRows, ARowCount); + for I := 0 to ColCount - 1 do + begin + FColumns[I] := 0; + for J := 0 to RowCount - 1 do + begin + with FCache[I, J] do + begin + IsHidden := False; + IsUnion := False; + Height := 1; + Width := 1; + Data := nil; + InternalCache.Cache := nil; + InternalCache.Index := -1; + SetCellStyle(I, J, -1); + end; + end; + end; + if IsVisible then + ABorderWidth := 1 + else + ABorderWidth := 0; + for K := 0 to 3 do + FDefaultStyle.Borders[K].Width := ABorderWidth; + for I := 0 to RowCount - 1 do + FRows[I] := 0; +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.SetRowHeight(const ARow, AHeight: Integer); +begin + TestRow(ARow); + if AHeight < 0 then + raise EcxExportData.Create(cxGetResString(@scxIllegalHeight)); + + FRows[ARow] := AHeight; +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.SetCellDataGraphic( + const ACol, ARow: Integer; var AGraphic: TGraphic); +var + AGraphicText: string; +begin + GetGraphicAsText(cxUnicodeToStr(FileName), AGraphic, AGraphicText); + SetData(ACol, ARow, Length(AGraphicText), cxDataTypeGraphic, AGraphicText[1]); +end; + +function TcxCustomHtmlXmlTXTExportProvider.SupportGraphic: Boolean; +begin + Result := True; +end; + +function TcxCustomHtmlXmlTXTExportProvider.GetCacheItem(ACol, ARow: Integer): TcxCacheItem; +begin + TestIndex(ACol, ARow); + + Result := FCache[ACol, ARow]; +end; + +function TcxCustomHtmlXmlTXTExportProvider.GetCellHeight(ACol, ARow: Integer): Integer; +var + I: Integer; +begin + TestIndex(ACol, ARow); + + if FCache[ACol, ARow].IsUnion then + begin + Result := 0; + for I := 0 to FCache[ACol, ARow].Height - 1 do + Inc(Result, Rows[ARow + I]); + end + else + Result := Rows[ARow]; +end; + +function TcxCustomHtmlXmlTXTExportProvider.GetCellWidth(ACol, ARow: Integer): Integer; +var + I: Integer; +begin + TestIndex(ACol, ARow); + + if FCache[ACol, ARow].IsUnion then + begin + Result := 0; + for I := 0 to FCache[ACol, ARow].Width - 1 do + Inc(Result, Columns[ACol + I]); + end + else + Result := Columns[ACol]; +end; + +function TcxCustomHtmlXmlTXTExportProvider.GetColumns(ACol: Integer): Integer; +begin + TestCol(ACol); + + Result := FColumns[ACol]; +end; + +function TcxCustomHtmlXmlTXTExportProvider.GetDefaultStyle: PcxCacheCellStyle; +begin + Result := @FDefaultStyle; +end; + +function TcxCustomHtmlXmlTXTExportProvider.GetHeight: Integer; +begin + Result := Length(FRows); +end; + +function TcxCustomHtmlXmlTXTExportProvider.GetInternalCacheCount: Integer; +begin + Result := FInternalCacheList.Count; +end; + +function TcxCustomHtmlXmlTXTExportProvider.GetInternalCacheItems( + AIndex: Integer): IcxCellInternalCache; +begin + Result := FInternalCacheList[AIndex] as IcxCellInternalCache; +end; + +function TcxCustomHtmlXmlTXTExportProvider.GetRows(ARow: Integer): Integer; +begin + TestRow(ARow); + + Result := FRows[ARow]; +end; + +function TcxCustomHtmlXmlTXTExportProvider.GetStyle(AStyleIndex: Integer): PcxCacheCellStyle; +begin + TestStyleIndex(AStyleIndex); + if AStyleIndex < 0 then + Result := @FDefaultStyle + else + Result := FStyleManager.GetStyle(AStyleIndex); +end; + +function TcxCustomHtmlXmlTXTExportProvider.GetWidth: Integer; +begin + Result := Length(FColumns); +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.TestIndex(ACol, ARow: Integer); +begin + TestCol(ACol); + TestRow(ARow); +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.TestCol(ACol: Integer); +begin + if (ACol < 0) or (ACol >= Length(FCache)) then + raise EcxExportData.CreateFmt(cxGetResString(@scxInvalidColumnIndex), [ACol]); +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.TestRow(ARow: Integer); +begin + if (ARow < 0) or (ARow >= Length(FCache[0])) then + raise EcxExportData.CreateFmt(cxGetResString(@scxInvalidRowIndex), [ARow]); +end; + +procedure TcxCustomHtmlXmlTXTExportProvider.TestStyleIndex(AStyleIndex: Integer); +begin + if AStyleIndex >= FStyleManager.Count then + raise EcxExportData.CreateFmt(cxGetResString(@scxInvalidStyleIndex), [AStyleIndex]); +end; + +function TcxCustomHtmlXmlTXTExportProvider.GetStyleCount: Integer; +begin + Result := FStyleManager.Count; +end; + +{ TcxCustomExportProviderSupportedCellInternalChache } + +procedure TcxCustomExportProviderSupportedCellInternalChache.CommitCache( + AStream: TStream; AParam: Pointer); +begin + SetEmptyCellsStyle; +end; + +procedure TcxCustomExportProviderSupportedCellInternalChache.CommitStyle( + AStream: TStream; AParam: Pointer); +begin +end; + +procedure TcxCustomExportProviderSupportedCellInternalChache.DeleteCacheFromCell( + const ACol, ARow: Integer); +begin + SetCacheIntoCell(ACol, ARow, nil); +end; + +procedure TcxCustomExportProviderSupportedCellInternalChache.SetCacheIntoCell( + const ACol, ARow: Integer; ACache: IcxCellInternalCache); +begin + TestIndex(ACol, ARow); + if ACache <> nil then + begin + if FCache[ACol, ARow].InternalCache.Cache <> nil then + SetCacheIntoCell(ACol, ARow, nil); + FCache[ACol, ARow].InternalCache.Cache := ACache; + FCache[ACol, ARow].InternalCache.Index := FInternalCacheList.Add(ACache); + end + else + begin + if FCache[ACol, ARow].InternalCache.Cache <> nil then + begin + FCache[ACol, ARow].InternalCache.Cache := nil; + FInternalCacheList.Delete(FCache[ACol, ARow].InternalCache.Index); + FCache[ACol, ARow].InternalCache.Index := -1; + end; + end; +end; + +procedure TcxCustomExportProviderSupportedCellInternalChache.SetEmptyCellsStyle; +var + I, J: Integer; + ACell: TcxCacheItem; + ANewStyle: TcxCacheCellStyle; +begin + for I := 0 to RowCount - 1 do + for J := 0 to ColCount - 1 do + begin + ACell := Cache[J, I]; + if not (ACell.DataType in [0,1]) or (ACell.DataSize <> 0) or (GetCellStyle(J, I) = nil) then Continue; + begin + ANewStyle := GetCellStyle(J, I)^; + ANewStyle.FontSize := 1; + SetCellStyle(J, I, ANewStyle); + end; + end; +end; + +{ TcxHTMLExportProvider } +procedure TcxHTMLExportProvider.Commit; +var + AStream: TFileStream; +begin + AStream := cxFileStreamClass.Create(cxUnicodeToStr(FileName), fmCreate); + try + CommitHTML(AStream); + finally + AStream.Free; + end; +end; + +class function TcxHTMLExportProvider.ExportType: Integer; +begin + Result := cxExportToHTML; +end; + +class function TcxHTMLExportProvider.ExportName: string; +begin + Result := cxGetResString(@scxExportToHTML); +end; + +procedure TcxHTMLExportProvider.CommitCache(AStream: TStream; AParam: Pointer); +var + ABuffer: string; + ADisplayValue: string; + AStringValue: string; + AWideStringValue: WideString; + ADoubleValue: Double; + AIntegerValue: Integer; + I, J: Integer; + ACellStyle: PcxCacheCellStyle; +begin + inherited CommitCache(AStream, AParam); + ABuffer := ABuffer + Format(''#13#10, [GetContentWidth]); + ABuffer := ABuffer + GetScaleRow + #13#10; + for I := 0 to RowCount - 1 do + begin + ABuffer := ABuffer + ''#13#10; + for J := 0 to ColCount - 1 do + begin + ACellStyle := GetCellStyle(J, I); + ADisplayValue := ''; + with Cache[J, I] do + begin + if IsHidden then + Continue; + + if IsUnion then + begin + ABuffer := ABuffer + ' 1 then + ABuffer := ABuffer + ' COLSPAN=' + IntToStr(Width); + if Height > 1 then + ABuffer := ABuffer + ' ROWSPAN=' + IntToStr(Height); + end + else + ABuffer := ABuffer + ''; + + if Cache[J, I].InternalCache.Cache <> nil then + begin + AStream.WriteBuffer(ABuffer[1], Length(ABuffer)); + ABuffer := ''; + ADisplayValue := ''; + Cache[J, I].InternalCache.Cache.CommitCache(AStream, nil); + end + else + begin + if Cache[J, I].DataType = cxDataTypeGraphic then + begin + SetLength(AStringValue, Cache[J, I].DataSize); + GetCellData(J, I, AStringValue[1]); + ADisplayValue := GraphicNeeded(ExtractFilePath(FileName), AStringValue); + end + else + if Cache[J, I].DataType = cxDataTypeString then + begin + if Cache[J, I].DataSize > 0 then + begin + SetLength(AStringValue, Cache[J, I].DataSize); + if GetCellData(J, I, AStringValue[1]) then + ADisplayValue := ConvertCRLFSymbols(ConvertSpecialCharacters(AStringValue)) + end + end + else if Cache[J, I].DataType = cxDataTypeWideString then + begin + if Cache[J, I].DataSize > 0 then + begin + SetLength(AWideStringValue, Cache[J, I].DataSize shr 1); + if GetCellData(J, I, AWideStringValue[1]) then + ADisplayValue := ConvertCRLFSymbols(ConvertSpecialCharacters(AWideStringValue)) + end + end + else if Cache[J, I].DataType = cxDataTypeDouble then + begin + if GetCellData(J, I, ADoubleValue) then + ADisplayValue := FloatToStr(ADoubleValue) + end + else if Cache[J, I].DataType = cxDataTypeInteger then + begin + if GetCellData(J, I, AIntegerValue) then + ADisplayValue := IntToStr(AIntegerValue) + end + end; + end; + if ADisplayValue = '' then + ADisplayValue := cxExportDefaultEmptyString; + ABuffer := ABuffer + ADisplayValue + ''#13#10; + AStream.WriteBuffer(ABuffer[1], Length(ABuffer)); + ABuffer := ''; + end; + ABuffer := ABuffer + ''#13#10; + + AStream.WriteBuffer(ABuffer[1], Length(ABuffer)); + ABuffer := ''; + end; + ABuffer := ABuffer + '
'#13#10; + AStream.WriteBuffer(ABuffer[1], Length(ABuffer)); +end; + +procedure TcxHTMLExportProvider.CommitStyle(AStream: TStream; AParam: Pointer); +var + ABuffer: string; + I: Integer; +begin + SetEmptyCellsStyle; + for I := 0 to FStyleManager.Count - 1 do + begin + ABuffer := ABuffer + '.Style' + IntToStr(I) + ' {' + + GetStyle(FStyleManager[I]) + '}' + #13#10#13#10 ; + end; + AStream.WriteBuffer(ABuffer[1], Length(ABuffer)); +end; + +function TcxHTMLExportProvider.GetContentWidth: Integer; +var + J: Integer; +begin + Result := 0; + for J := 0 to ColCount - 1 do + Inc(Result, Columns[J]); +end; + +procedure TcxHTMLExportProvider.CommitHTML(AStream: TStream); +var + ABuffer: string; +begin + ABuffer := ''#13#10 + + ''#13#10 + '' + FileName + ''#13#10 + + ''#13#10 + + ''#13#10 + ''#13#10; + AStream.WriteBuffer(ABuffer[1], Length(ABuffer)); + ABuffer := ''; + + CommitCache(AStream, nil); + + ABuffer := ABuffer + ''#13#10 + ''; + AStream.WriteBuffer(ABuffer[1], Length(ABuffer)); +end; + +function TcxHTMLExportProvider.GetStyle(AStyle: TcxCacheCellStyle): string; +var + ABorderWidth: array[0..3] of Integer; + ABorderColor: array[0..3] of Integer; + I: Integer; +begin + Result := ''; + with AStyle do + begin + for I := 0 to 3 do + begin + if Borders[I].IsDefault then + begin + ABorderWidth[I] := 0; + ABorderColor[I] := 0; + end + else + begin + ABorderWidth[I] := Borders[I].Width; + ABorderColor[I] := Borders[I].Color; + end; + end; + Result := Result + ' border-style: solid;'; + if FontSize = 1 then + Result := Result + 'padding:0px;' + else + Result := Result + ' padding:3;'; + Result := Result + ' border-left-width: ' + IntToStr(ABorderWidth[0]) + ';'; + Result := Result + ' border-top-width: ' + IntToStr(ABorderWidth[1]) + ';'; + Result := Result + ' border-right-width: ' + IntToStr(ABorderWidth[2]) + ';'; + Result := Result + ' border-bottom-width: ' + IntToStr(ABorderWidth[3]) + ';'; + Result := Result + ' border-left-color: ' + GetHTMLColor(ABorderColor[0]) + ';'; + Result := Result + ' border-top-color: ' + GetHTMLColor(ABorderColor[1]) + ';'; + Result := Result + ' border-right-color: ' + GetHTMLColor(ABorderColor[2]) + ';'; + Result := Result + ' border-bottom-color: ' + GetHTMLColor(ABorderColor[3]) + ';'; + Result := Result + ' font-family: ''' + FontName + ''';'; + Result := Result + ' mso-font-charset: ' + IntToStr(FontCharset) + ';'; + if cfsBold in FontStyle then + Result := Result + ' font-weight: bold;'; + if cfsItalic in FontStyle then + Result := Result + ' font-style: italic;'; + if cfsUnderline in FontStyle then + Result := Result + ' text-decoration: underline;' + else if cfsStrikeOut in FontStyle then + Result := Result + ' text-decoration: line-through;'; + Result := Result + ' font-size: ' + IntToStr(FontSize) + 'pt;'; + Result := Result + ' color: ' + GetHTMLColor(FontColor) + ';'; + Result := Result + ' background-color: ' + GetHTMLColor(BrushBkColor); + end; +end; + +function TcxHTMLExportProvider.GetScaleRow: string; +var + J: Integer; +begin + Result := ''#13#10; + for J := 0 to ColCount - 1 do + begin + Result := Result + ''; + Result := Result + ''#13#10; + end; + Result := Result + ''; +end; + +{ TcxXMLExportProvider } + +constructor TcxXMLExportProvider.Create(const AFileName: string); +begin + inherited Create(AFileName); + FHideDotsOn := True; + FXSLFileName := '_'; +end; + +procedure TcxXMLExportProvider.Commit; +var + AXMLStream: TFileStream; + AXSLStream: TFileStream; +begin + AXMLStream := cxFileStreamClass.Create(cxUnicodeToStr(FileName), fmCreate); + FXSLFileName := cxChangeFileExtExW(FileName, '.xsl'); + AXSlStream := cxFileStreamClass.Create(cxUnicodeToStr(FXSLFileName), fmCreate); + try + CommitXML(AXMLStream); + CommitXSL(AXSLStream); + finally + AXSlStream.Free; + AXMLStream.Free; + end; +end; + +class function TcxXMLExportProvider.ExportType: Integer; +begin + Result := cxExportToXML; +end; + +class function TcxXMLExportProvider.ExportName: string; +begin + Result := cxGetResString(@scxExportToXML); +end; + +procedure TcxXMLExportProvider.CommitCache(AStream: TStream; AParam: Pointer); +var + ABuffer: string; + I, J: Integer; + AValue: string; +begin + inherited CommitCache(AStream, AParam); + if FHideDotsOn then + begin + HideDots; + FHideDotsOn := False; + Exit; + end; + + ABuffer := ''#13#10; + + ABuffer := ABuffer + GetScaleLine; + for I := 0 to RowCount - 1 do + begin + AStream.WriteBuffer(ABuffer[1], Length(ABuffer)); + ABuffer := ''#13#10; + for J := 0 to ColCount - 1 do + begin + if Cache[J, I].IsHidden then + Continue; + + ABuffer := ABuffer + ''; + + with Cache[J, I] do + begin + if DataType = cxDataTypeGraphic then + begin + SetLength(AValue, DataSize); + GetCellData(J, I, AValue[1]); + AValue := GraphicNeeded(ExtractFilePath(FileName), AValue, False); + ABuffer := ABuffer + ''; + end; + end; + + if Cache[J, I].InternalCache.Cache <> nil then + begin + AStream.WriteBuffer(ABuffer[1], Length(ABuffer)); + ABuffer := ''; + Cache[J, I].InternalCache.Cache.CommitCache(AStream, nil); + end + else + ABuffer := ABuffer + {''}; + ABuffer := ABuffer + ''#13#10; + end; + ABuffer := ABuffer + ''; + end; + + ABuffer := ABuffer + ''; + AStream.WriteBuffer(ABuffer[1], Length(ABuffer)); +end; + +procedure TcxXMLExportProvider.CommitStyle(AStream: TStream; AParam: Pointer); +var + I: Integer; + ABuffer: string; +begin + SetEmptyCellsStyle; + ABuffer := ''#13#10; + + for I := 0 to FStyleManager.Count - 1 do + begin + AStream.WriteBuffer(ABuffer[1], Length(ABuffer)); + ABuffer := ''#13#10 + end; + + ABuffer := ABuffer + ''#13#10; + AStream.WriteBuffer(ABuffer[1], Length(ABuffer)) +end; + +procedure TcxXMLExportProvider.CommitXML(AStream: TStream); +var + ABuffer: string; + AFileExt: string; + AFileName: string; +begin + AFileName := FileName; + AFileExt := ExtractFileExt(AFileName); + if AFileExt <> '' then + Delete(AFileName, Length(AFileName) - Length(AFileExt) + 1, Length(AFileExt)); + + ABuffer := ''#13#10; + ABuffer := ABuffer + ''#13#10; +// CheckedUnicodeStringW(cxExtractFileNameExW(FXSLFileName)) + '"?>'#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + '' + + CheckedUnicodeStringW(cxExtractFileNameExW(cxChangeFileExtExW(FXSLFileName, ''))) + ''#13#10; + AStream.WriteBuffer(ABuffer[1], Length(ABuffer)); + + CommitCache(nil, nil); + CommitStyle(AStream, nil); + CommitCache(AStream, nil); + + ABuffer := ''; + AStream.WriteBuffer(ABuffer[1], Length(ABuffer)); +end; + +procedure TcxXMLExportProvider.CommitXSL(AStream: TStream); +var + ABuffer: string; +begin + ABuffer := ''#13#10#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10#13#10; + + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10#13#10; + + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + '<xsl:value-of select="." />'#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10#13#10; + + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10#13#10; + + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + '.Style'#13#10; + ABuffer := ABuffer + '{ border-style: solid;'#13#10; + ABuffer := ABuffer + ' padding: ;'#13#10; + ABuffer := ABuffer + ' font-family: ;'#13#10; + ABuffer := ABuffer + ' mso-font-charset: ;'#13#10; + ABuffer := ABuffer + ' font-size: pt;'#13#10; + ABuffer := ABuffer + ' color: ;'#13#10; + ABuffer := ABuffer + ' background-color: ;'#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ' font-weight: bold;'#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ' font-style: italic;'#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ' text-decoration: underline;'#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ' text-decoration: line-through;'#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + '}'#13#10; + ABuffer := ABuffer + ''#13#10#13#10; + + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + 'border-left-width: px;'#13#10; + ABuffer := ABuffer + 'border-left-color: ;'#13#10; + ABuffer := ABuffer + ''#13#10#13#10; + + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + 'border-top-width: px;'#13#10; + ABuffer := ABuffer + 'border-top-color: ;'#13#10; + ABuffer := ABuffer + ''#13#10#13#10; + + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + 'border-right-width: px;'#13#10; + ABuffer := ABuffer + 'border-right-color: ;'#13#10; + ABuffer := ABuffer + ''#13#10#13#10; + + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + 'border-bottom-width: px;'#13#10; + ABuffer := ABuffer + 'border-bottom-color: ;'#13#10; + ABuffer := ABuffer + ''#13#10#13#10; + + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + '
'#13#10; + ABuffer := ABuffer + '
'#13#10#13#10; + + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10#13#10; + + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + 'Style'#13#10; + + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10#13#10; + + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10; + ABuffer := ABuffer + ''#13#10#13#10; + + ABuffer := ABuffer + '
'#13#10; + AStream.WriteBuffer(ABuffer[1], Length(ABuffer)); +end; + +function TcxXMLExportProvider.ConvertTextToXML(const AText: string; ACol, ARow: Integer): string; +var + I: Integer; + W: WideString; +begin + Result := ''; + if not cxStrUnicodeNeeded(AText, True) then + Result := AText + else + begin + W := cxStrToUnicode(AText, GetCellStyle(ACol, ARow)^.FontCharset); + for I := 1 to Length(W) do + Result := Result + '&#' + IntToStr(Integer(W[I])) + ';'; + end; +end; + +function TcxXMLExportProvider.GetBorderStyle(AStyle: TcxCacheCellStyle): string; + + function GetBorderStyle(AIndex: Integer): string; + begin + with AStyle.Borders[AIndex] do + begin + Result := ''; + if IsDefault then + Result := Result + ' IsDefault="True"' + else + Result := Result + ' IsDefault="False"'; + Result := Result + ' Width="' + IntToStr(Width) + '"'; + Result := Result + ' Color="' + GetHTMLColor(Color) + '"'; + end; + end; + +begin + Result := ''#13#10; + Result := Result + ''#13#10; + Result := Result + ''#13#10; + Result := Result + ''#13#10; +end; + +function TcxXMLExportProvider.GetCellParams(ACol, ARow: Integer): string; +var + ACellWidth: Integer; + ACellStyle: PcxCacheCellStyle; +begin + Result := ''; + + with Cache[ACol, ARow] do + begin + ACellWidth := CellWidth[ACol, ARow]; + if ACellWidth > 0 then + Result := Result + ' Width="' + IntToStr(ACellWidth) + '"'; + ACellStyle := GetCellStyle(ACol, ARow); + Result := Result + ' Align="'; + case ACellStyle^.AlignText of + catLeft: + Result := Result + 'left"'; + catCenter: + Result := Result + 'center"'; + catRight: + Result := Result + 'right"'; + end; + if IsUnion then + begin + if Width > 1 then + Result := Result + ' ColSpan="' + IntToStr(Width) + '"'; + if Height > 1 then + Result := Result + ' RowSpan="' + IntToStr(Height) + '"'; + end; + Result := Result + ' StyleClass="' + IntToStr(StyleIndex) + '"'; + end; +end; + +function TcxXMLExportProvider.GetData(ACol, ARow: Integer): string; +var + AStringValue: string; + AWideStringValue: WideString; + ADoubleValue: Double; + AIntegerValue: Integer; +begin + if Cache[ACol, ARow].InternalCache.Cache <> nil then + Result := '' + else + begin + if Cache[ACol, ARow].DataType = cxDataTypeGraphic then + begin + Result := cxXMLEmptyChar; + end + else if Cache[ACol, ARow].DataType = cxDataTypeString then + begin + if Cache[ACol, ARow].DataSize > 0 then + begin + SetLength(AStringValue, Cache[ACol, ARow].DataSize); + if GetCellData(ACol, ARow, AStringValue[1]) then + Result := AStringValue + else + Result := cxXMLEmptyChar; + end + else + Result := cxXMLEmptyChar; + end + else if Cache[ACol, ARow].DataType = cxDataTypeWideString then + begin + if Cache[ACol, ARow].DataSize > 0 then + begin + SetLength(AWideStringValue, Cache[ACol, ARow].DataSize shr 1); + if GetCellData(ACol, ARow, AWideStringValue[1]) then + Result := AWideStringValue + else + Result := cxXMLEmptyChar; + end + else + Result := cxXMLEmptyChar; + end + else if Cache[ACol, ARow].DataType = cxDataTypeDouble then + begin + if GetCellData(ACol, ARow, ADoubleValue) then + Result := FloatToStr(ADoubleValue) + else + Result := cxXMLEmptyChar; + end + else if Cache[ACol, ARow].DataType = cxDataTypeInteger then + begin + if GetCellData(ACol, ARow, AIntegerValue) then + Result := IntToStr(AIntegerValue) + else + Result := cxXMLEmptyChar; + end + else + Result := cxXMLEmptyChar; + end; +end; + +function TcxXMLExportProvider.GetStyle(AStyle: TcxCacheCellStyle): string; + function GetAlignText(AAlign: TcxAlignText): string; + begin + case AAlign of + catLeft: + Result := 'Left'; + catCenter: + Result := 'Center'; + catRight: + Result := 'Right'; + end; + end; + + function GetFontStyles(AStyles: TcxFontStyles): string; + begin + Result := ''; + + if cfsBold in AStyles then + Result := Result + ' Bold="True"' + else + Result := Result + ' Bold="False"'; + + if cfsItalic in AStyles then + Result := Result + ' Italic="True"' + else + Result := Result + ' Italic="False"'; + + if cfsUnderline in AStyles then + Result := Result + ' Underline="True"' + else + Result := Result + ' Underline="False"'; + + if cfsStrikeOut in AStyles then + Result := Result + ' StrikeOut="True"' + else + Result := Result + ' StrikeOut="False"'; + end; + + function GetBrushStyle(AStyle: TcxBrushStyle): string; + begin + case AStyle of + cbsSolid: + Result := 'Solid'; + cbsClear: + Result := 'Clear'; + end; + end; + +begin + with AStyle do + begin + Result := 'AlignText="' + GetAlignText(AlignText) + '"'; + if FontSize = 1 then + Result := Result + ' CellPadding="0px"' + else + Result := Result + ' CellPadding=" 3"'; + Result := Result + ' FontName="' + CheckedUnicodeString(FontName, AStyle.FontCharset) + '"'; + Result := Result + ' FontCharset="' + IntToStr(FontCharset) + '"'; + Result := Result + GetFontStyles(FontStyle); + Result := Result + ' FontColor="' + GetHTMLColor(FontColor) + '"'; + Result := Result + ' FontSize="' + IntToStr(FontSize) + '"'; + Result := Result + ' BrushStyle="' + GetBrushStyle(BrushStyle) + '"'; + Result := Result + ' BrushBkColor="' + GetHTMLColor(BrushBkColor) + '"'; + Result := Result + ' BrushFgColor="' + GetHTMLColor(BrushFgColor) + '"'; + end; +end; + +procedure TcxXMLExportProvider.HideDots; +var + I, J: Integer; + AData: string; + AStyle: TcxCacheCellStyle; +begin + for J := 0 to RowCount - 1 do + begin + for I := 0 to ColCount - 1 do + begin + if Cache[I, J].InternalCache.Cache <> nil then + Cache[I, J].InternalCache.Cache.CommitCache(nil, nil) + else + begin + AData := GetData(I, J); + if AData = cxXMLEmptyChar then + begin + AStyle := GetCellStyle(I, J)^; + AStyle.FontColor := AStyle.BrushBkColor; + SetCellStyle(I, J, AStyle); + end; + end; + end; + end; +end; + +function TcxXMLExportProvider.GetScaleLine: string; +var + J: Integer; +begin + Result := ''#13#10; + for J := 0 to ColCount - 1 do + begin + Result := Result + ''#13#10; + Result := Result + ''#13#10; + end; + Result := Result + ''#13#10; +end; + +{ TcxTXTExportProvider } + +constructor TcxTXTExportProvider.Create(const AFileName: string); +begin + inherited Create(AFileName); + FSeparator := ''; + FBeginString := ''; + FEndString := ''; + FIndex := 0; +end; + +procedure TcxTXTExportProvider.CommitCache(AStream: TStream; AParam: Pointer); +var + I, J, K: Integer; + ABuffer: string; + ASpace: string; + AData: string; +begin + SetLength(FColMaxWidth, ColCount); + + CalculateColMaxWidth; + for J := 0 to RowCount - 1 do + begin + ABuffer := ''; + for I := 0 to ColCount - 1 do + begin + AData := GetData(I, J); + ASpace := ' '; + for K := 1 to FColMaxWidth[I] - Length(AData) do + ASpace := ASpace + ' '; + if FSeparator <> '' then + ASpace := ''; +{ if AData = '' then + ABuffer := ABuffer + ASpace + else + begin} + if I < (ColCount - 1) then + ABuffer := ABuffer + FBeginString + AData + FEndString + FSeparator + ASpace + else + ABuffer := ABuffer + FBeginString + AData + FEndString + ASpace; +// end; + end; + ABuffer := ABuffer + #13#10; + AStream.WriteBuffer(ABuffer[1], Length(ABuffer)); + end; + + SetLength(FColMaxWidth, 0); +end; + +function TcxTXTExportProvider.SupportGraphic: Boolean; +begin + Result := False; +end; + +procedure TcxTXTExportProvider.AddSeparator(const ASeparator: string); +begin + case FIndex of + 0: + FSeparator := ASeparator; + 1: + FBeginString := ASeparator; + 2: + FEndString := ASeparator; + end; + Inc(FIndex); +end; + +class function TcxTXTExportProvider.ExportType: Integer; +begin + Result := cxExportToText; +end; + +class function TcxTXTExportProvider.ExportName: string; +begin + Result := cxGetResString(@scxExportToText); +end; + +procedure TcxTXTExportProvider.Commit; +var + AStream: TFileStream; +begin + AStream := cxFileStreamClass.Create(cxUnicodeToStr(FileName), fmCreate); + try + CommitCache(AStream, Pointer(0)); + finally + AStream.Free; + end; +end; + +procedure TcxTXTExportProvider.CalculateColMaxWidth; +var + I, J, K: Integer; + AMaxWidth: Integer; + ACurrentWidth: Integer; +begin + for I := 0 to ColCount - 1 do + begin + AMaxWidth := 0; + for J := 0 to RowCount - 1 do + if Cache[I, J].IsUnion then + begin + ACurrentWidth := Length(GetData(I, J)) div Cache[I, J].Width; + for K := 1 to Cache[I, J].Width - 1 do + FColMaxWidth[I + K] := Max(FColMaxWidth[I + K], ACurrentWidth); + AMaxWidth := Max(AMaxWidth, ACurrentWidth); + end + else + AMaxWidth := Max(AMaxWidth, Length(GetData(I, J))); + + FColMaxWidth[I] := AMaxWidth; + end; +end; + +function TcxTXTExportProvider.GetData(ACol, ARow: Integer): string; +var + AStringValue: string; + AWideStringValue: WideString; + ADoubleValue: Double; + AIntegerValue: Integer; +begin + if Cache[ACol, ARow].InternalCache.Cache <> nil then + Result := '' + else + begin + if Cache[ACol, ARow].DataType = cxDataTypeString then + begin + if Cache[ACol, ARow].DataSize > 0 then + begin + SetLength(AStringValue, Cache[ACol, ARow].DataSize); + if GetCellData(ACol, ARow, AStringValue[1]) then + Result := AStringValue + else + Result := ''; + end + else + Result := ''; + end + else if Cache[ACol, ARow].DataType = cxDataTypeWideString then + begin + if Cache[ACol, ARow].DataSize > 0 then + begin + SetLength(AWideStringValue, Cache[ACol, ARow].DataSize shr 1); + if GetCellData(ACol, ARow, AWideStringValue[1]) then + Result := AWideStringValue + else + Result := ''; + end + else + Result := ''; + end + else if Cache[ACol, ARow].DataType = cxDataTypeDouble then + begin + if GetCellData(ACol, ARow, ADoubleValue) then + Result := FloatToStr(ADoubleValue) + else + Result := ''; + end + else if Cache[ACol, ARow].DataType = cxDataTypeInteger then + begin + if GetCellData(ACol, ARow, AIntegerValue) then + Result := IntToStr(AIntegerValue) + else + Result := ''; + end + else + Result := ''; + end; +end; + +initialization + TcxExport.RegisterProviderClass(TcxHTMLExportProvider); + TcxExport.RegisterProviderClass(TcxTXTExportProvider); + TcxExport.RegisterProviderClass(TcxXMLExportProvider); + +end. diff --git a/official/x.35/ExpressExport Library/Sources/cxVer.inc b/official/x.35/ExpressExport Library/Sources/cxVer.inc new file mode 100644 index 00000000..a26364cc --- /dev/null +++ b/official/x.35/ExpressExport Library/Sources/cxVer.inc @@ -0,0 +1,172 @@ +{$B-} { Complete Boolean Evaluation } +{$R-} { Range-Checking } +{$T-} { Typed @ operator } +{$X+} { Extended syntax } +{$P+} { Open string params } +{$J+} { Writeable structured consts } +{$H+} { Use long strings by default } +{$Q-} { Overflow checking } + +{$DEFINE DXVER500} + +{$IFNDEF CLR} + {$DEFINE OLEDRAGANDDROP} + {$IFNDEF DONTUSEJPEGIMAGE} + {$DEFINE USEJPEGIMAGE} + {$ENDIF} +{$ENDIF} + +{$DEFINE EXPRESSBARS5} + +{$DEFINE VCL} + +{$IFNDEF VER80} + {$IFNDEF VER90} + {$IFNDEF VER93} + {$DEFINE DELPHI3} { Borland Delphi 3.0 } + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER110} { Borland C++Builder 3.0 } + {$DEFINE CBUILDER3} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE DELPHI4} +{$ENDIF} + +{$IFDEF VER125} { Borland C++Builder 4.0 } + {$DEFINE CBUILDER3} + {$DEFINE DELPHI4} + {$DEFINE CBUILDER4} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$IFDEF BCB} { Borland C++Builder 5.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$IFDEF BCB} { Borland C++Builder 6.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} +{$ENDIF} + +{$IFNDEF DELPHI6} + {$DEFINE MSWINDOWS} +{$ENDIF} +{$IFDEF LINUX} + {$UNDEF MSWINDOWS} +{$ENDIF} + +{$IFDEF LINUX} + {$DEFINE KYLIX1} { Borland Kylix 1 } + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF CompilerVersion >= 14} + {$DEFINE KYLIX2} { Borland Kylix 2 } + {$IFEND} + {$IF CompilerVersion >= 14.50} + {$DEFINE KYLIX3} { Borland Kylix 3 } + {$IFEND} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} { Borland Delphi.Net } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} +{$ENDIF} + +{$IFDEF VER170} { Borland Delphi 9.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} +{$ENDIF} + +{$IFDEF VER180} { Borland Delphi 10 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$IFDEF BCB} { Borland C++Builder 10 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Borland Delphi 11 //CodeGear} + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$DEFINE DELPHI11} + {$IFDEF BCB} { Borland C++Builder 11 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$DEFINE CBUILDER11} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFNDEF CLR} + {$IFNDEF BCB} + {$IFDEF DELPHI6} + {$DEFINE REGISTERSHELLCTRLS} + {$ENDIF} + {$ENDIF} + {$IFDEF DELPHI7} + {$WARN UNSAFE_CAST OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_TYPE OFF} + {$ENDIF} +{$ENDIF} + +{$IFDEF REGISTERSHELLCTRLS} + {$DEFINE REGISTERCXSHELLCTRLS} +{$ENDIF} + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} diff --git a/official/x.35/ExpressExport Library/Sources/cxXLSExport.pas b/official/x.35/ExpressExport Library/Sources/cxXLSExport.pas new file mode 100644 index 00000000..66837727 --- /dev/null +++ b/official/x.35/ExpressExport Library/Sources/cxXLSExport.pas @@ -0,0 +1,2356 @@ +{*******************************************************************} +{ } +{ Developer Express Cross Platform Component Library } +{ ExpressExport } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEXPORT AND ALL } +{ ACCOMPANYING VCL AND CLX CONTROLS AS PART OF AN EXECUTABLE } +{ PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit cxXLSExport; + +{$I cxVer.inc} + +interface + +uses + Classes, SysUtils, Math, +{$IFDEF WIN32} + Windows, +{$ELSE} + Types, +{$ENDIF} +{$IFDEF DELPHI6} Variants, {$IFNDEF NONDB} FMTBcd, SqlTimSt, {$ENDIF} {$ENDIF} + cxExport, cxExportStrs, Graphics; +type + TxlsExportOptimization = (optBySize, optBySpeed); + { TcxColorItemType } + TcxColorItemType = (ciFontColor, ciBrushBKColor, ciBrushFGColor, ciBorderColor); + + TcxXLSCellsData = class; + TcxXLSRecordsList = class; + TcxXLSSharedStringTable = class; + TcxXLSWorkBookWriter = class; + + TcxMergeRect = packed record + Top, Bottom, Left, Right: Word; + end; + + { TcxXLSCell } + PcxXLSCell = ^TcxXLSCell; + TcxXLSCell = packed record + RecType: Word; + RecSize: Word; + Row: Word; + Col: Word; + XF: Word; + case Integer of + 1: (VarWords: array[0..$FFFF shr 1 - 1] of Word); + 2: (VarBytes: array[0..$FFFF - 1] of Byte); + 3: (SSTIndex: Integer); + 4: (Num: Double); + 5: (StrLen: Word; case StrType: Boolean of + False: (StrDataA: array[0..255] of Char); + True: (StrDataW: array[0..255 shr 1] of WideChar)); + 6: (BoolErrValue, ErrFlag: Boolean); + end; + + PcxUnionCellsArray = ^TcxUnionCellsArray; + TcxUnionCellsArray = array[0..MaxInt div SizeOf(TcxMergeRect) - 1] of TcxMergeRect; + + {SST block types} + TSSTBlock = packed record + StringCount: Word; + StringOffset: Word; + RecType: Word; + DataSize: Word; + Data: array[0..8191] of Byte; + end; + + TExtSSTBlock = packed record + StreamOffset: Integer; + StringOffset: Word; + Reserved: Word; + end; + + TExtSST = packed record + RecType: Word; + DataSize: Word; + StringPerBlock: Word; + Data: array[0..255] of TExtSSTBlock; + end; + + TSSSTStringInfo = packed record + HashCode: Word; + StrSize: Word; + Block: Word; + Offset: Word; + end; + + TSSTList = array of TSSTBlock; + TSSSTStringsInfo = array of TSSSTStringInfo; + + { TSSTStringTable } + TcxXLSSharedStringTable = class + private + FExtSST: TExtSST; + FSST: TSSTList; + FOptimaze: Boolean; + FStringsInfo: TSSSTStringsInfo; + function GetStringCount: Integer; + function GetUniqueStringCount: Integer; + protected + procedure AddStringToBlock(ASource: Pointer; var ADest: TSSTBlock; ASize: Word); + procedure CreateExtSST(ASSTOffset: Integer); + function GetPackedSize: Integer; + function IndexOf(const AString: WideString): Integer; + procedure InsertStr(const AString: WideString); + property ExtSST: TExtSST read FExtSST; + property SST: TSSTList read FSST; + property StringsInfo: TSSSTStringsInfo read FStringsInfo; + public + constructor Create; virtual; + destructor Destroy; override; + function Add(AString: WideString): Integer; + procedure Clear; + procedure SaveToStream(AStream: TStream; APosition: Integer = -1); virtual; + property PackedSize: Integer read GetPackedSize; + property TotalStringCount: Integer read GetStringCount; + property UniqueStringCount: Integer read GetUniqueStringCount; + end; + + { TcxOLEFileHeader } + PcxOLEFileHeader = ^TcxOLEFileHeader; + TcxOLEFileHeader = packed record + Signature : Int64; + CLSID : array[0..1] of Int64; + OLEVersion : Integer; + ByteOrder : Word; + SectorShift : Word; + MiniSectorShift : Word; + Reserved : Word; + Reserved1 : LongInt; + Reserved2 : LongInt; + CountSectFAT : LongInt; + SectDIRStart : LongInt; + TransSignature : LongInt; + MiniSectorCutOff: LongInt; + SectMiniFATStart: LongInt; + CountSectMiniFAT: LongInt; + SectDIFStart : Longint; + CountSectDIF : LongInt; + SectFAT : array[0..108] of Integer; + end; + + { TcxOLEDIREntryType } + TcxOLEDIREntryType = (ET_INVALID, ET_STORAGE, ET_STREAM, ET_LOCKBYTES, ET_PROPERTY, ET_ROOT); + + { TcxOLEDIREntry } + PcxOLEDIREntry = ^TcxOLEDIREntry; + TcxOLEDIREntry = packed record + Name : array[0..64 div SizeOf(WideChar) - 1] of WideChar; + NameLen : Word; + EntryType : TcxOLEDIREntryType; + BFlag : Byte; + LeftSib : LongWord; + RightSib : LongWord; + ChildSib : LongWord; + Guid : TGUID; + UserFlag : LongInt; + C_M_Time : array[0..1] of TTimeStamp; + StartSector: LongInt; + Size : LongInt; + Reserved : LongInt + end; + + { TcxFATSector } + PcxFATSector = ^TcxFATSector; + TcxFATSector = packed array[0..512 div SizeOf(Integer) - 1] of Integer; + + PcxFATSectors = ^TcxFATSectors; + TcxFATSectors = packed array[0..MaxInt div SizeOf(TcxFATSector) - 1] of TcxFATSector; + + { TcxWorkBookReader } + TcxXLSWorkBookWriter = class + protected + FBuffer: PByteArray; + FBufferSize: Integer; + FCapacity: Integer; + FFATBlockCount: Integer; + FIsSmallFile: Boolean; + FSectCount: Integer; + FStreamSize: Integer; + procedure CreateLocalFAT; + function GetDIFSector(ASector: Integer): PcxFATSector; + function GetDIREntry(AIndex: Integer): PcxOLEDIREntry; + function GetHeader: PcxOleFileHeader; + function GetFATSector(ASector: Integer): PcxFATSector; + protected + procedure Check(ACondition: Boolean); + procedure CreateDIF; virtual; + procedure CreateDIR; virtual; + procedure CreateFAT; virtual; + procedure CreateHeader; virtual; + procedure CreateSmallFAT; virtual; + procedure ReallocBuffer(const ASize: Integer); + property IsSmallFile: Boolean read FIsSmallFile; + property DIR[AEntry: Integer]: PcxOLEDIREntry read GetDIREntry; + property DIF[ASector: Integer]: PcxFATSector read GetDIFSector; + property FAT[ASector: Integer]: PcxFATSector read GetFATSector; + property Header: PcxOleFileHeader read GetHeader; + property Memory: PByteArray read FBuffer; + property Size: Integer read FBufferSize; + public + procedure CreateOLEStream(ADataSize: Integer; ADstStream: TStream); + end; + + { IcxNamedExportProvider } + + IcxNameExportProvider = interface + ['{FC69194E-E3C7-41F4-98AE-5948813210AE}'] + procedure SetName(const AName: string); + procedure SetRangeName(const AName: string; const ARange: TRect); + end; + + { TcxCacheExportXLS } + TcxXLSExportProvider = class(TcxCustomExportProvider, IcxExportProvider, IcxNameExportProvider) + private + FCells: TcxXLSCellsData; + FColStyles: TcxXLSRecordsList; + FFonts: TcxXLSRecordsList; + FMaxCol: Integer; + FMaxRow: Integer; + FStyles: TcxXLSRecordsList; + FStyleCache: TcxExportStyleManager; + FUnionCells: PcxUnionCellsArray; + FUnionCellsCapacity: Integer; + FUnionCellsCount: Integer; + FUsedColors: Integer; + FPalette: array[0..55] of Integer; + FRowStyles: TcxXLSRecordsList; + FSheetName: WideString; + FSST: TcxXLSSharedStringTable; + FStream: TStream; + FVisibleGrid: Boolean; + FWorkBookWriter: TcxXLSWorkBookWriter; + // + FRangeNameBytes: array of Byte; + FRangeName: string; + FNamedRange: TRect; + protected + procedure Commit; virtual; + function GetCellStyle(const ACol, ARow: Integer): PcxCacheCellStyle; + function GetStyle(AStyleIndex: Integer): PcxCacheCellStyle; + function PlaceParsedString(const ACol, ARow: Integer; const AText: string): Boolean; + function RegisterStyle(const AStyle: TcxCacheCellStyle): Integer; + procedure SetCellDataBoolean(const ACol, ARow: Integer; const AValue: Boolean); virtual; + procedure SetCellDataCurrency(const ACol, ARow: Integer; const AValue: Currency); virtual; + procedure SetCellDataDateTime(const ACol, ARow: Integer; const AValue: TDateTime); virtual; + procedure SetCellDataDouble(const ACol, ARow: Integer; const AValue: Double); virtual; + procedure SetCellDataInteger(const ACol, ARow: Integer; const AValue: Integer); virtual; + procedure SetCellDataString(const ACol, ARow: Integer; const AText: string); virtual; + procedure SetCellDataWideString(const ACol, ARow: Integer; const AText: Widestring); virtual; + procedure SetCellStyle(const ACol, ARow, AStyleIndex: Integer); overload; + procedure SetCellStyle(const ACol, ARow, AExampleCol, AExampleRow: Integer); overload; + procedure SetCellStyle(const ACol, ARow: Integer; const AStyle: TcxCacheCellStyle); overload; + procedure SetCellStyleEx(const ACol, ARow, H, W: Integer; const AStyleIndex: Integer); + procedure SetCellUnion(const ACol, ARow: Integer; H, W: Integer); + procedure SetCellValue(const ACol, ARow: Integer; const AValue: Variant); + procedure SetColumnWidth(const ACol, AWidth: Integer); + procedure SetDefaultStyle(const AStyle: TcxCacheCellStyle); + procedure SetRange(const AColCount, ARowCount: Integer; IsVisible: Boolean = True); + procedure SetRowHeight(const ARow, AHeight: Integer); + // export graphic extension + procedure SetCellDataGraphic(const ACol, ARow: Integer; var AGraphic: TGraphic); + function SupportGraphic: Boolean; + // IcxNameExportProvider + procedure SetName(const AName: string); + procedure SetRangeName(const AName: string; const ARange: TRect); + protected + function CalculateStoredSize: Integer; dynamic; +// function xlsCellIsMerge(ACol, ARow: Integer; var XFStyle: Word): Boolean; + function xlsCheckColor(const AColor: Integer; AItemType: TcxColorItemType): Word; + function xlsCheckPos(const ACol, ARow: Integer): Boolean; + procedure xlsCreateStyles; + function xlsRegisterFont(const AStyle: TcxCacheCellStyle): Integer; + function xlsRegisterStyle(const AStyle: TcxCacheCellStyle; + var AType: Word; IsMerge: Boolean = False): Integer; + procedure xlsWriteBuf(const RecData: array of Byte); overload; + procedure xlsWriteBuf(const RecID: Word; const RecData: array of Byte); overload; + procedure xlsWriteBuf(const RecID, DataSize: Word; const RecData: array of Byte); overload; + procedure xlsWriteBuffer(const ARecData: array of Word); overload; + procedure xlsWriteBuffer(const RecID, DataSize: Word; const RecData); overload; + procedure xlsWriteHeader; + procedure xlsWriteWorkBook; + property DataStream: TStream read FStream; + public + constructor Create(const AFileName: string); override; + destructor Destroy; override; + class function ExportType: Integer; override; + class function ExportName: string; override; + end; + + { TxlsCellsData } + TcxXLSCellsData = class + private + FCellsList: array of PcxXLSCell; + FCellPerCol: Integer; + function GetFullSize: Integer; + protected + function GetCell(const ACol, ARow: Integer): PcxXLSCell; + function PrepareCellStyle(var AType: Word): Word; + function ReallocCellData(const ACol, ARow: Integer; AVarDataSize: Integer = 0): PcxXLSCell; + procedure SetCellDataBoolean(const ACol, ARow: Integer; const AValue: Boolean); + procedure SetCellDataBlank(const ACol, ARow: Integer); + procedure SetCellDataCurrency(const ACol, ARow: Integer; const AValue: Currency); + procedure SetCellDataDateTime(const ACol, ARow: Integer; const AValue: TDateTime); + procedure SetCellDataDouble(const ACol, ARow: Integer; const AValue: Double); + procedure SetCellDataInteger(const ACol, ARow: Integer; const AValue: Integer); + procedure SetCellDataStringA(const ACol, ARow: Integer; const AText: string); + procedure SetCellDataStringW(const ACol, ARow: Integer; const AText: Widestring); + procedure SetCellDataSSTString(const ACol, ARow, AIndex: Integer); + procedure SetRange(const AColCount, ARowCount: Integer); + property FullSize: Integer read GetFullSize; + public + destructor Destroy; override; + procedure SaveToStream(AStream: TStream); + end; + + { TxlsRecordList } + TcxXLSRecordsList = class(TList) + private + FID: Word; + function GetFullSize: Integer; + function GetItem(AIndex: Integer): Pointer; + function GetItemSize(AIndex: Integer): Integer; + function GetRealItem(AIndex: Integer): Pointer; + public + constructor Create(const RecordID: Word); + destructor Destroy; override; + function AddData(const AData; DataSize: Word): Integer; + function AddUniqueData(var AData: PByteArray): Integer; + procedure Clear; override; + procedure SaveToStream(AStream: TStream); + property Items[AIndex: Integer]: Pointer read GetItem; + property ItemSize[AIndex: Integer]: Integer read GetItemSize; + property FullSize: Integer read GetFullSize; + end; + +const + Optimization: TxlsExportOptimization = optBySpeed; + NeedStringParse: Boolean = False; + +implementation + +var + cxBlankCharCode: Integer; + cxThousandCharCode: Integer; + cxDecimalCharCode: Integer; + +const + ScaledFactor: Double = 1; + + cxXLSMaxColumn = $FF; + cxXLSMaxRow = $FFFF; + cxXLSMaxBlockSize = 8192; + cxXLSBlankCellSize = 10; + cxXLSMaxLenShortStringA = $FF; + cxXLSMaxLenShortStringW = cxXLSMaxLenShortStringA shr 1; + + XLS_Font = $0031; // Font Description + XLS_XF = $00E0; // Extended Format + XLS_COLINFO = $007D; // Column Formatting Information + XLS_Row = $0208; // Describes a Row + XLS_Palette = $0092; // Color Palette Definition + XLS_BoundSheet = $0085; // Sheet Information + XLS_MergeCells = $00E5; // Merged Cells + XLS_Currency = $1003; // not native Excel constant for currency + XLS_DateTime = $1000; // not native Excel constant for datetime + XLS_Date = $1001; // not native Excel constant for datetime + XLS_Time = $1002; // not native Excel constant for datetime + XLS_MergeState = $2000; // not native Excel constant for merged cell + XLS_BoolErr = $0205; // Cell Value - Boolean + XLS_Blank = $0201; // Cell Value, Blank Cell + XLS_Number = $0203; // Cell Value, Floating-Point Number + XLS_Label = $0204; // Cell Value, String Constant + XLS_LabelSST = $00FD; // Cell Value, String Constant/SST + XLS_ExtSST = $00FF; // Extended Shared String Table + XLS_SST = $00FC; // Shared String Table + XLS_Continue = $003C; // Continues Long Records + XLS_NAME = $0018; // Named cells range + + ptgArea3d = $3B; + + cxXLS_BOF: array[0..19] of Byte = + ($09, $08, $10, $00, $00, $06, $05, $00, $BB, $0D, + $CC, $07, $00, $00, $00, $00, $06, $00, $00, $00); + cxXLS_EOF: array[0..3] of Byte = + ($0A, $00, $00, $00); + cxXLS_WINDOW1: array[0..21] of Byte = + ($3D, $00, $12, $00, $E0, $01, $69, $00, $CC, $42, $7F, + $26, $38, $00, $00, $00, $00, $00, $01, $00, $58, $02); + cxXLS_WINDOW2: array[0..21] of Byte = + ($3E, $02, $12, $00, $B6, $06, $00, $00, $00, $00, $40, + $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00); + cxXLS_Font: array[0..29] of Byte = + ($31, $00, $1A, $00, $C8, 00, $00, $00, $FF, $7F, $90, $01, $00, $00, $00, + $00, $00, $00, $05, $01, $41, $00, $72, $00, $69, $00, $61, $00, $6C, $00); + cxXLS_TabID: array[0..5] of Byte = + ($3D, $01, $02, $00, $00, $00); + cxXLS_SupBook: array[0..7] of Byte = + ($AE, $01, $04, $00, $01, $00, $01, $04); + cxXLS_ExternSheet: array[0..11] of Byte = + ($17, $00, $08, $00, $01, $00, $00, $00, $00, $00, $00, $00); + cxXLS_Dimension: array[0..17] of Byte = + ($00, $02, $0E, $00, $00, $00, $00, $00, $01, + $00, $00, $00, $00, $00, $01, $00, $00, $00); + + cxXLS_STYLE: array[0..48 - 1] of Byte = + ($93, $02, $04, $00, $10, $80, $03, $FF, $93, $02, $04, $00, $11, $80, $06, $FF, + $93, $02, $04, $00, $10, $80, $04, $FF, $93, $02, $04, $00, $10, $80, $07, $FF, + $93, $02, $04, $00, $00, $80, $00, $FF, $93, $02, $04, $00, $10, $80, $05, $FF); + + cxXLS_XF: packed array[0..16, 0..23] of Byte = + (($E0, $00, $14, $00, $00, $00, $00, $00, $F5, $FF, $20, $00, + $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $C0, $20), + ($E0, $00, $14, $00, $01, $00, $00, $00, $F5, $FF, $20, $00, + $00, $F4, $00, $00, $00, $00, $00, $00, $00, $00, $C0, $20), + ($E0, $00, $14, $00, $01, $00, $00, $00, $F5, $FF, $20, $00, + $00, $F4, $00, $00, $00, $00, $00, $00, $00, $00, $C0, $20), + ($E0, $00, $14, $00, $02, $00, $00, $00, $F5, $FF, $20, $00, + $00, $F4, $00, $00, $00, $00, $00, $00, $00, $00, $C0, $20), + ($E0, $00, $14, $00, $02, $00, $00, $00, $F5, $FF, $20, $00, + $00, $F4, $00, $00, $00, $00, $00, $00, $00, $00, $C0, $20), + ($E0, $00, $14, $00, $00, $00, $00, $00, $F5, $FF, $20, $00, + $00, $F4, $00, $00, $00, $00, $00, $00, $00, $00, $C0, $20), + ($E0, $00, $14, $00, $00, $00, $00, $00, $F5, $FF, $20, $00, + $00, $F4, $00, $00, $00, $00, $00, $00, $00, $00, $C0, $20), + ($E0, $00, $14, $00, $00, $00, $00, $00, $F5, $FF, $20, $00, + $00, $F4, $00, $00, $00, $00, $00, $00, $00, $00, $C0, $20), + ($E0, $00, $14, $00, $00, $00, $00, $00, $F5, $FF, $20, $00, + $00, $F4, $00, $00, $00, $00, $00, $00, $00, $00, $C0, $20), + ($E0, $00, $14, $00, $00, $00, $00, $00, $F5, $FF, $20, $00, + $00, $F4, $00, $00, $00, $00, $00, $00, $00, $00, $C0, $20), + ($E0, $00, $14, $00, $00, $00, $00, $00, $F5, $FF, $20, $00, + $00, $F4, $00, $00, $00, $00, $00, $00, $00, $00, $C0, $20), + ($E0, $00, $14, $00, $00, $00, $00, $00, $F5, $FF, $20, $00, + $00, $F4, $00, $00, $00, $00, $00, $00, $00, $00, $C0, $20), + ($E0, $00, $14, $00, $00, $00, $00, $00, $F5, $FF, $20, $00, + $00, $F4, $00, $00, $00, $00, $00, $00, $00, $00, $C0, $20), + ($E0, $00, $14, $00, $00, $00, $00, $00, $F5, $FF, $20, $00, + $00, $F4, $00, $00, $00, $00, $00, $00, $00, $00, $C0, $20), + ($E0, $00, $14, $00, $00, $00, $00, $00, $F5, $FF, $20, $00, + $00, $F4, $00, $00, $00, $00, $00, $00, $00, $00, $C0, $20), + ($E0, $00, $14, $00, $00, $00, $00, $00, $01, $00, $20, $00, + $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $C0, $20), + ($E0, $00, $14, $00, $01, $00, $2b, $00, $F5, $FF, $20, $00, + $00, $F8, $00, $00, $00, $00, $00, $00, $00, $00, $C0, $20)); + + cxXLS_Palette: array[0..55] of Integer = + ($000000, $FFFFFF, $0000FF, $00FF00, $FF0000, $00FFFF, $FF00FF, $FFFF00, + $000080, $008000, $800000, $008080, $800080, $808000, $C0C0C0, $808080, + $FF9999, $663399, $CCFFFF, $FFFFCC, $660066, $8080FF, $CC6600, $FFCCCC, + $800000, $FF00FF, $00FFFF, $FFFF00, $800080, $000080, $808000, $FF0000, + $FFCC00, $FFFFCC, $CCFFCC, $99FFFF, $FFCC99, $CC99FF, $FF99CC, $99CCFF, + $FF6633, $CCCC33, $00CC99, $00CCFF, $0099FF, $0066FF, $996666, $969696, + $663300, $669933, $003300, $003333, $003399, $663399, $993333, $333333); + + cxXLSDefaultDataSize = SizeOf(cxXLS_BOF) * 2 + SizeOf(cxXLS_EOF) * 2 + + SizeOf(cxXLS_WINDOW1) + SizeOf(cxXLS_WINDOW2) + SizeOf(cxXLS_Font) * 5 + + SizeOf(cxXLS_TabID) + SizeOf(cxXLS_SupBook) + SizeOf(cxXLS_ExternSheet) + + (SizeOf(cxXLS_Palette) + 6) + SizeOf(cxXLS_STYLE) + SizeOf(cxXLS_Dimension) + 12 + + SizeOf(cxXLS_XF); + +// OLE data control codes + oleSignature = Int64($E11AB1A1E011CFD0); // header signature + oleDIFBlock = Integer($FFFFFFFC); // double inDIRect FAT + oleSpecBlock = Integer($FFFFFFFD); // special block begining + oleEndOfChain = Integer($FFFFFFFE); // end of chain + oleUnused = Integer($FFFFFFFF); // unused + oleEmpty = Integer($00000000); // empty + oleDLLVersion = Integer($0003003E); // specification version + olePlatformOrder = Word($FFFE); // order for intel platform + oleSectorsInMasterFAT = 109; // sectors in master FAT from header + oleBlockIDPerBigBlock = 128; // id cound in big block + oleMaxBlockIdInBigBlock = 127; // id cound in big block + oleContinueFATItem = 126; // id continue DIF block item + oleBigBlockShift = 9; // big block shift + oleSmallBlockShift = 6; // small block shift + oleReservedSectorCount = 2; // header and DIRecotry sectors + oleMiniSectorMaxSize = Integer($000001000);// max minisector size + oleSmallBlockSize = 1 shl oleSmallBlockShift; // size of small block + oleBigBlockSize = 1 shl oleBigBlockShift; // size of big block in bytes + oleDIRBlockSize = SizeOf(TcxOLEDIREntry); // size of DIRectory block in bytes + oleIndexSize = SizeOf(Integer); // size of index + + oleRoot : WideString = 'Root Entry'; + oleWorkbook : WideString = 'Workbook'; + oleInvalidName: WideString = ''; + + cxNegInfinity = -1/0; + + // Default OLE Storage header template + oleHeaderTemplate: TcxOLEFileHeader = + (Signature : oleSignature; + CLSID : (oleEmpty, oleEmpty); + OLEVersion : oleDLLVersion; + ByteOrder : olePlatformOrder; + SectorShift : oleBigBlockShift; + MiniSectorShift : oleSmallBlockShift; + Reserved : oleEmpty; + Reserved1 : oleEmpty; + Reserved2 : oleEmpty; + CountSectFAT : 1; + SectDIRStart : 1; + TransSignature : oleEmpty; + MiniSectorCutOff: oleMiniSectorMaxSize; + SectMiniFATStart: oleEndOfChain; + CountSectMiniFAT: oleEmpty; + SectDIFStart : oleEndOfChain; + CountSectDIF : oleEmpty); + +function cxValidateStr(const AValue: string): string; +var + I: Integer; +begin + Result := AValue; + I := 1; + while I <= Length(Result) do + begin + if Result[I] = #13 then + Delete(Result, I, 1) + else + Inc(I) + end; +end; + +function GetDateTimeFormat(var AValue: Double): Word; +begin + if (Int(AValue) <> 0) and (Round(Int(AValue)) <= 60) then + AValue := AValue - 1; + Result := XLS_DateTime; + if Int(AValue) = 0 then + Result := XLS_Time + else + if (Frac(AValue) = 0) then + Result := XLS_Date; +end; + +function RoundDiv(const Number, Denominator: Integer): Integer; +begin + Result := Number div Denominator; + if (Number mod Denominator) <> 0 then + Inc(Result); +end; + +procedure FixSetRecType(var AType: Word; NewType: Word); +begin + if (AType and XLS_MergeState) = XLS_MergeState then + AType := NewType or XLS_MergeState + else + AType := NewType; +end; + +// string conversion routines +procedure SetControlCodes; +begin + if ThousandSeparator = '' then + ThousandSeparator := ','; + cxBlankCharCode := Integer(' ') - Integer('0'); + cxThousandCharCode := Integer(ThousandSeparator) - Integer('0'); + cxDecimalCharCode := Integer(DecimalSeparator) - Integer('0'); +end; + +function cxTryStrToFloat(const AString: string; out Value: Double): Boolean; +var + ARet: Extended; +begin + Result := TextToFloat(PChar(AString), ARet, fvExtended) and + (ARet > MinDouble) and (ARet < MaxDouble); + if Result then + Value := ARet + else + Value := 0; +end; +{ +function cxTryStrToInt(const AString: string; out Value: Integer): Boolean; +var + ErrCode: Integer; + S: string; +begin + S := Trim(AString); + Val(S, Value, ErrCode); + Result := ErrCode = 0; + if not Result then Value := 0; +end; +} + +{$IFNDEF DELPHI6} +function DateTimeFromStr(const strIn: WideString; lcid: DWORD; dwFlags: Longint; + out dateOut: TDateTime): HRESULT; stdcall; external 'oleaut32.dll' name 'VarDateFromStr'; +{$ENDIF} + +function cxTryStrToDateTime(const S: string; out ADateTime: TDateTime): Boolean; +begin + {$IFNDEF DELPHI6} + Result := DateTimeFromStr(S, $400, 0, ADateTime) = 0; + {$ELSE} + Result := TryStrToDateTime(S, ADateTime); + {$ENDIF} +end; + +function cxTryStrToBool(const AString: string; var Value: Boolean): Boolean; +var + AStr: string; +begin + AStr := AnsiUpperCase(AString); + Value := AStr = cxGetResString(@scxBoolTrue); + Result := (AStr = cxGetResString(@scxBoolTrue)) or (AStr = cxGetResString(@scxBoolTrue)); +end; + +function cxTryStrToCurr(const S: string; var Value: Currency): Boolean; +var + APos, Code: Integer; + IntPart, FrucPart: Double; + HasCurrencyStr: Boolean; + HasThousandSeparator: Boolean; + + function CheckCurrencyStr: Boolean; + var + CharCount: Integer; + begin + Result := not HasCurrencyStr and (Length(CurrencyString) > 0); + CharCount := 0; + while Result and (APos <= Length(S)) do + begin + if CharCount < Length(CurrencyString) then + begin + Result := S[APos + CharCount] = CurrencyString[CharCount + 1]; + if Result then + Inc(CharCount); + end + else + begin + HasCurrencyStr := CharCount = Length(CurrencyString); + Result := HasCurrencyStr; + if Result then + Inc(APos, CharCount - 1); + Break; + end; + end; + end; + + function ScanIntPart: Boolean; + var + NumCount: Integer; + begin + Result := APos <= Length(S); + if Result then + begin + NumCount := 0; + HasThousandSeparator := False; + IntPart := 0; + while Result and (APos <= Length(S)) do + begin + Code := Integer(S[APos]) - Integer('0'); + if (Code >= 0) and (Code <= 9) then + begin + IntPart := IntPart * 10 + Code; + if HasThousandSeparator then Inc(NumCount); + end + else + begin + if Code = cxDecimalCharCode then + Break + else + if Code = cxThousandCharCode then + begin + Result := not HasThousandSeparator or (NumCount = 3); + HasThousandSeparator := True; + NumCount := 0; + end + else + Result := (Code = cxBlankCharCode) or CheckCurrencyStr; + end; + Inc(APos); + end; + end; + end; + + function ScanFrucPart: Boolean; + var + C: Double; + begin + Result := True; + Inc(APos); + FrucPart := 0; + C := 0.1; + while Result and (APos <= Length(S)) do + begin + Code := Integer(S[APos]) - Integer('0'); + if (Code >= 0) and (Code <= 9) then + begin + FrucPart := FrucPart + Code * C; + C := C / 10; + end + else + Result := (Code = cxBlankCharCode) or + (CheckCurrencyStr and (APos = Length(S))); + Inc(APos); + end; + end; + +begin + APos := 1; + HasCurrencyStr := False; + Result := ScanIntPart and ScanFrucPart and + (((ThousandSeparator <> '') and HasThousandSeparator) or HasCurrencyStr); + if Result then + Value := IntPart + FrucPart + else + Value := 0; +end; + +{ TcxCacheExportXLS } +constructor TcxXLSExportProvider.Create(const AFileName: string); +begin + FSheetName := cxExtractFileNameEx(ChangeFileExt(AFileName, '')); + inherited Create(AFileName); + SetControlCodes; + if FileExists(AFileName) then + SysUtils.DeleteFile(AFileName); + FStream := cxFileStreamClass.Create(cxUnicodeToStr(FileName), fmCreate); + FFonts := TcxXLSRecordsList.Create(XLS_Font); + FStyles := TcxXLSRecordsList.Create(XLS_XF); + FCells := TcxXLSCellsData.Create; + FColStyles := TcxXLSRecordsList.Create(XLS_ColInfo); + FRowStyles := TcxXLSRecordsList.Create(XLS_Row); + FStyleCache := TcxExportStyleManager.GetInstance(AFileName); + FSST := TcxXLSSharedStringTable.Create; + FWorkBookWriter := TcxXLSWorkBookWriter.Create; + FMaxCol := -1; + FMaxRow := -1; + FUsedColors := High(FPalette); + Move(cxXLS_Palette, FPalette[0], SizeOf(cxXLS_Palette)); +end; + +destructor TcxXLSExportProvider.Destroy; +begin + FCells.Free; + FWorkBookWriter.Free; + FStream.Free; + FColStyles.Free; + FRowStyles.Free; + FSST.Free; + FFonts.Free; + if Assigned(FStyleCache) then + FStyleCache.Clear; + FStyles.Free; + FreeMem(FUnionCells); + inherited Destroy; +end; + +class function TcxXLSExportProvider.ExportType: Integer; +begin + Result := cxExportToExcel; +end; + +class function TcxXLSExportProvider.ExportName: string; +begin + Result := cxGetResString(@scxExportToExcel); +end; + +procedure TcxXLSExportProvider.Commit; +begin + xlsWriteHeader; + xlsWriteWorkBook; + FreeAndNil(FStream); +end; + +function TcxXLSExportProvider.GetCellStyle(const ACol, ARow: Integer): PcxCacheCellStyle; +begin + Result := nil; + if xlsCheckPos(ACol, ARow) then + begin + with FCells.GetCell(ACol, ARow)^ do + begin + if XF > $10 then + Result := FStyleCache.GetStyle(XF - $10) + else + Result := FStyleCache.GetStyle(0); + end; + end; +end; + +function TcxXLSExportProvider.PlaceParsedString(const ACol, ARow: Integer; + const AText: string): Boolean; +var + AFloat: Double; + ACur: Currency; + ABool: Boolean; + ADT: TDateTime; +begin + Result := True; + if cxTryStrToFloat(AText, AFloat) then + SetCellDataDouble(ACol, ARow, AFloat) + else + if cxTryStrToDateTime(AText, ADT) then + SetCellDataDateTime(ACol, ARow, ADt) + else + if cxTryStrToCurr(AText, ACur) then + SetCellDataCurrency(ACol, ARow, ACur) + else + if cxTryStrToBool(AText, ABool) then + SetCellDataBoolean(ACol, ARow, ABool) + else + Result := False; +end; + +function TcxXLSExportProvider.GetStyle(AStyleIndex: Integer): PcxCacheCellStyle; +begin + Result := FStyleCache.GetStyle(AStyleIndex); +end; + +function TcxXLSExportProvider.RegisterStyle(const AStyle: TcxCacheCellStyle): Integer; +begin + Result := FStyleCache.RegisterStyle(AStyle); +end; + +procedure TcxXLSExportProvider.SetCellDataBoolean(const ACol, ARow: Integer; const AValue: Boolean); +begin + if xlsCheckPos(ACol, ARow) then + FCells.SetCellDataBoolean(ACol, ARow, AValue); +end; + +procedure TcxXLSExportProvider.SetCellDataCurrency(const ACol, ARow: Integer; + const AValue: Currency); +begin + if xlsCheckPos(ACol, ARow) then + FCells.SetCellDataCurrency(ACol, ARow, AValue); +end; + +procedure TcxXLSExportProvider.SetCellDataDateTime(const ACol, ARow: Integer; + const AValue: TDateTime); +begin + if xlsCheckPos(ACol, ARow) then + FCells.SetCellDataDateTime(ACol, ARow, AValue); +end; + +procedure TcxXLSExportProvider.SetCellDataDouble(const ACol, ARow: Integer; + const AValue: Double); +begin + if xlsCheckPos(ACol, ARow) then + FCells.SetCellDataDouble(ACol, ARow, AValue); +end; + +procedure TcxXLSExportProvider.SetCellDataInteger(const ACol, ARow: Integer; + const AValue: Integer); +begin + if xlsCheckPos(ACol, ARow) then + FCells.SetCellDataInteger(ACol, ARow, AValue); +end; + +procedure TcxXLSExportProvider.SetCellDataString(const ACol, ARow: Integer; + const AText: string); + + function TextToUnicode: WideString; + begin + Result := cxStrToUnicode(cxValidateStr(AText), GetCellStyle(ACol, ARow)^.FontCharset); + end; + +var + ALen: Integer; + +begin + ALen := Length(AText); + if xlsCheckPos(ACol, ARow) and (ALen <> 0) then + begin + if not (NeedStringParse and PlaceParsedString(ACol, ARow, AText)) then + begin + if (Optimization = optBySize) or (cxStrUnicodeNeeded(AText)) then + begin + if (Optimization <> optBySize) and (ALen <= cxXLSMaxLenShortStringW) then + FCells.SetCellDataStringW(ACol, ARow, TextToUnicode) + else + FCells.SetCellDataSSTString(ACol, ARow, FSST.Add(TextToUnicode)); + end + else + begin + if ALen <= cxXLSMaxLenShortStringA then + begin + if ALen = 0 then + FCells.SetCellDataBlank(ACol, ARow) + else + FCells.SetCellDataStringA(ACol, ARow, cxValidateStr(AText)); + end + else + FCells.SetCellDataSSTString(ACol, ARow, FSST.Add(cxValidateStr(AText))); + end; + end; + end; +end; + +procedure TcxXLSExportProvider.SetCellDataWideString(const ACol, ARow: Integer; + const AText: Widestring); +var + ALen: Integer; +begin + ALen := Length(AText); + if xlsCheckPos(ACol, ARow) and (ALen <> 0) then + begin + if not (NeedStringParse and PlaceParsedString(ACol, ARow, AText)) then + begin + if (Optimization <> optBySize) and (ALen <= cxXLSMaxLenShortStringW) then + begin + if ALen = 0 then + FCells.SetCellDataBlank(ACol, ARow) + else + FCells.SetCellDataStringW(ACol, ARow, cxValidateStr(AText)); + end + else + FCells.SetCellDataSSTString(ACol, ARow, FSST.Add(cxValidateStr(AText))); + end; + end; +end; + +procedure TcxXLSExportProvider.SetCellStyle(const ACol, ARow, AStyleIndex: Integer); +begin + if xlsCheckPos(ACol, ARow) then + with FCells.GetCell(ACol, ARow)^ do + begin + if RecType and XLS_MergeState <> XLS_MergeState then + XF := AStyleIndex + $10; + end; +end; + +procedure TcxXLSExportProvider.SetCellStyle(const ACol, ARow, AExampleCol, AExampleRow: Integer); +begin + if xlsCheckPos(AExampleCol, AExampleRow) then + SetCellStyle(ACol, ARow, GetCellStyle(AExampleCol, AExampleRow)^); +end; + +procedure TcxXLSExportProvider.SetCellStyle(const ACol, ARow: Integer; const AStyle: TcxCacheCellStyle); +begin + if xlsCheckPos(ACol, ARow) then + SetCellStyle(ACol, ARow, RegisterStyle(AStyle)); +end; + +// TODO: grid export optimization +procedure TcxXLSExportProvider.SetCellStyleEx( + const ACol, ARow, H, W: Integer; const AStyleIndex: Integer); +var + I, J, AUnionStyleID, AW, AH: Integer; +begin + if (ACol >= cxXLSMaxColumn) or (ARow >= cxXLSMaxRow) then Exit; + AW := Min(W, cxXLSMaxColumn + 1 - ACol); + AH := Min(H, cxXLSMaxRow + 1 - ARow); + if (H = 1) and (W = 1) then + SetCellStyle(ACol, ARow, AStyleIndex) + else + begin + SetCellUnion(ACol, ARow, H, W); + with FCells.GetCell(ACol, ARow)^ do + begin + AUnionStyleID := xlsRegisterStyle(FStyleCache.Items[AStyleIndex], RecType, True); + RecType := RecType or XLS_MergeState; + XF := AUnionStyleID; + end; + for I := ACol to ACol + AW - 1 do + for J := ARow to ARow + AH - 1 do + if (I = ACol) and (J = ARow) then + Continue + else + with FCells.GetCell(I, J)^ do + begin + RecType := RecType or XLS_MergeState; + XF := AUnionStyleID; + end; + end; +end; + +procedure TcxXLSExportProvider.SetCellUnion(const ACol, ARow: Integer; H, W: Integer); +begin + W := Min(W, cxXLSMaxColumn + 1 - ACol); + H := Min(H, cxXLSMaxRow + 1 - ARow); + if FUnionCellsCount = FUnionCellsCapacity then + begin + FUnionCellsCapacity := (FUnionCellsCapacity shr 1 + 1) shl 2; + ReallocMem(FUnionCells, FUnionCellsCapacity * SizeOf(TcxMergeRect)); + end; + with FUnionCells^[FUnionCellsCount] do + begin + Top := ARow and $FFFF; + Bottom := (ARow + H - 1) and $FFFF; + Left := ACol and $00FF; + Right := (ACol + W - 1) and $00FF; + end; + Inc(FUnionCellsCount); +end; + +procedure TcxXLSExportProvider.SetCellValue(const ACol, ARow: Integer; const AValue: Variant); +{$IFDEF DELPHI6} +var + ACurr: Currency; +{$ENDIF} +begin + case TVarData(AValue).VType of + varSingle, + {$IFDEF DELPHI6} + VarInt64, + {$ENDIF} + varDouble: + SetCellDataDouble(ACol, ARow, AValue); + varCurrency: + SetCellDataCurrency(ACol, ARow, AValue); + varDate: + SetCellDataDateTime(ACol, ARow, AValue); + varOleStr: + SetCellDataWideString(ACol, ARow, AValue); + varSmallInt, varInteger, + {$IFDEF DELPHI6} + varWord, varShortInt, varLongWord, + {$ENDIF} + varByte: + SetCellDataInteger(ACol, ARow, AValue); + varBoolean: + SetCellDataBoolean(ACol, ARow, AValue); + varString: + SetCellDataString(ACol, ARow, cxValidateStr(AValue)); +{$IFDEF DELPHI6} + {$IFNDEF NONDB} + else + if TVarData(AValue).VType = VarSQLTimeStamp then + SetCellDataDateTime(ACol, ARow, AValue) + else + if TVarData(AValue).VType = VarFMTBcd then + begin + if BcdToCurr(VarToBcd(AValue), ACurr) then + SetCellValue(ACol, ARow, Currency(ACurr)) + else + SetCellValue(ACol, ARow, Double(BcdToDouble(VarToBcd(AValue)))); + end; + {$ENDIF} +{$ENDIF} + end; +end; + +procedure TcxXLSExportProvider.SetColumnWidth(const ACol, AWidth: Integer); +var + AColInfo: PWordArray; +const + ColRecSize = 11; +begin + if ACol > cxXLSMaxColumn then Exit; + AColInfo := AllocMem(ColRecSize + SizeOf(Word) + 1); + AColInfo^[0] := ColRecSize; + AColInfo^[1] := ACol; + AColInfo^[2] := ACol; + AColInfo^[3] := Round(AWidth * 36.6 / ScaledFactor); + AColInfo^[4] := $000F; + FColStyles.Add(AColInfo); +end; + +procedure TcxXLSExportProvider.SetDefaultStyle(const AStyle: TcxCacheCellStyle); +begin + RegisterStyle(AStyle); +end; + +procedure TcxXLSExportProvider.SetRange(const AColCount, ARowCount: Integer; IsVisible: Boolean = True); +begin + FMaxCol := Min(AColCount, cxXLSMaxColumn + 1); + FMaxRow := Min(ARowCount, cxXLSMaxRow + 1); + FColStyles.Capacity := FMaxCol; + FRowStyles.Capacity := FMaxRow; + FVisibleGrid := IsVisible; + FCells.SetRange(FMaxCol, FMaxRow); +end; + +procedure TcxXLSExportProvider.SetRowHeight(const ARow, AHeight: Integer); +var + ARowInfo: PWordArray; +const + RowRecSize = 16; +begin + if ARow >= cxXLSMaxRow then Exit; + ARowInfo := AllocMem(RowRecSize + SizeOf(Word)); + ARowInfo^[0] := RowRecSize; + ARowInfo^[1] := ARow; + ARowInfo^[3] := $0100; + ARowInfo^[4] := Round(AHeight * 20 / (1.325 * ScaledFactor)); + ARowInfo^[7] := $01C0; + ARowInfo^[8] := $0F; + FRowStyles.Add(ARowInfo); +end; + +procedure TcxXLSExportProvider.SetCellDataGraphic( + const ACol, ARow: Integer; var AGraphic: TGraphic); +begin +end; + +function TcxXLSExportProvider.SupportGraphic: Boolean; +begin + Result := False; +end; + +procedure TcxXLSExportProvider.SetName(const AName: string); +begin + FSheetName := cxStrToUnicode(AName); +end; + +procedure TcxXLSExportProvider.SetRangeName(const AName: string; const ARange: TRect); +var + I: Integer; + ANameDef: array of Byte; + + procedure CreateNameDef; + begin + SetLength(ANameDef, 11); + ANameDef[0] := ptgArea3D; + PWord(@ANameDef[1])^ := 0; + PWord(@ANameDef[3])^ := ARange.Top and $FFFF; + PWord(@ANameDef[5])^ := ARange.Bottom and $FFFF; + PWord(@ANameDef[7])^ := ARange.Left and $FF; + PWord(@ANameDef[9])^ := ARange.Right and $FF; + end; + +begin + FRangeName := AName; + FNamedRange := ARange; + if AName <> '' then + begin + SetLength(FRangeNameBytes, 19 + Length(AName) + 11); + FillChar(FRangeNameBytes[0], Length(FRangeNameBytes), 0); + PWordArray(@FRangeNameBytes[0])^[0] := XLS_NAME; + PWordArray(@FRangeNameBytes[0])^[1] := Length(FRangeNameBytes) - 4; + PWordArray(@FRangeNameBytes[0])^[2] := 0; + FRangeNameBytes[7] := Length(AName); + PWordArray(@FRangeNameBytes[8])^[0] := 11; + FRangeNameBytes[18] := 0; + Move(AName[1], FRangeNameBytes[19], Length(AName)); + I := 18 + Length(AName) + 2; + + FRangeNameBytes[I - 1] := ptgArea3d; + PWordArray(@FRangeNameBytes[I])^[0] := 0; + PWordArray(@FRangeNameBytes[I])^[1] := ARange.Top and $FFFF; + PWordArray(@FRangeNameBytes[I])^[2] := ARange.Bottom and $FFFF; + PWordArray(@FRangeNameBytes[I])^[3] := ARange.Left and $FF; + PWordArray(@FRangeNameBytes[I])^[4] := ARange.Right and $FF; + end + else + SetLength(FRangeNameBytes, 0); +end; + +function TcxXLSExportProvider.CalculateStoredSize: Integer; +var + ASize: Integer; +begin + Result := cxXLSDefaultDataSize; + Inc(Result, FStyles.GetFullSize); + Inc(Result, FFonts.GetFullSize); + Inc(Result, Length(FRangeNameBytes)); + Inc(Result, Length(FSheetName) * 2); + Inc(Result, FSST.PackedSize); + Inc(Result, FColStyles.FullSize); + Inc(Result, FRowStyles.FullSize); + Inc(Result, FCells.FullSize); + if FUnionCellsCount > 0 then + begin + ASize := FUnionCellsCount shl 3; + Result := Result + ASize + (Ceil(ASize / $2000) * 6); + end; +end; + +function TcxXLSExportProvider.xlsCheckColor(const AColor: Integer; + AItemType: TcxColorItemType): Word; +var + I, C: Integer; +const + DefaultColorValue: array[TcxColorItemType] of Word = ($7FFF, $40, $40, $40); +begin + Result := 0; + case AItemType of + ciFontColor: + if AColor = 0 then + Result := $7FFF; + ciBrushBKColor: + if AColor = cxWindowColor then + Result := $40; + ciBrushFGColor, ciBorderColor: + if AColor = 0 then + Result := $40; + end; + if Result > 0 then Exit; + for I := High(FPalette) downto 0 do + begin + if FPalette[I] = AColor then + begin + if I <= FUsedColors then + begin + if I <> FUsedColors then + begin + C := FPalette[FUsedColors]; + FPalette[FUsedColors] := FPalette[I]; + FPalette[I] := C; + end; + Result := FUsedColors + 8; + Dec(FUsedColors); + end + else + Result := I + 8; + Exit; + end; + end; + if FUsedColors >= 0 then + begin + FPalette[FUsedColors] := AColor; + Result := FUsedColors + 8; + Dec(FUsedColors); + end + else + Result := DefaultColorValue[AItemType]; +end; + +function TcxXLSExportProvider.xlsCheckPos(const ACol, ARow: Integer): Boolean; +begin + if (FMaxCol < 0) or (FMaxRow < 0) then + raise EcxExportData.Create(cxGetResString(@scxInvalidCellDimension)); + Result := (ACol < FMaxCol) and (ARow < FMaxRow) and (ACol >= 0) and (ARow >= 0); +end; + +procedure TcxXLSExportProvider.xlsCreateStyles; +var + I: Integer; +begin + for I := 0 to Length(FCells.FCellsList) - 1 do + begin + with FCells.FCellsList[I]^ do + begin + if (XF >= $10) and ((RecType and XLS_MergeState) <> XLS_MergeState) then + XF := xlsRegisterStyle(FStyleCache.Items[XF - $10], RecType); + end; + end; +end; + +function TcxXLSExportProvider.xlsRegisterFont(const AStyle: TcxCacheCellStyle): Integer; +var + AFont: PByteArray; + AWName: WideString; + ASize: Integer; +const + ABold: array[Boolean] of Word = ($190, $2BC); + AItalic: array[Boolean] of Word = (0, $02); + AStrikeOut: array[Boolean] of Word = (0, $08); +begin + with AStyle do + begin + ASize := StrLen(AStyle.FontName) shl 1 + 16; + AWName := AStyle.FontName; + AFont := AllocMem(ASize + 6); + PWord(AFont)^ := ASize; + PWord(@AFont^[2])^ := FontSize * 20; + PWord(@AFont^[4])^ := AItalic[cfsItalic in FontStyle] or AStrikeOut[cfsStrikeOut in FontStyle]; + PWord(@AFont^[6])^ := xlsCheckColor(FontColor, ciFontColor); + PWord(@AFont^[8])^ := ABold[cfsBold in FontStyle]; + AFont^[12] := Byte(cfsUnderLine in FontStyle); + AFont^[14] := Byte(FontCharset); + AFont^[16] := Length(AWName); + AFont^[17] := 1; + Move(AWName[1], AFont^[18], AFont^[16] shl 1); + PInteger(@AFont^[ASize + 2])^ := cxExport.GetHashCode(AFont^[2], ASize); + end; + Result := FFonts.AddUniqueData(AFont) + 6; +end; + +function TcxXLSExportProvider.xlsRegisterStyle(const AStyle: TcxCacheCellStyle; + var AType: Word; IsMerge: Boolean = False): Integer; + + function GetPackedFillStyle(AStyle: Byte; AFgColor, ABkColor: Integer): Integer; + begin + Result := 0; + AFgColor := xlsCheckColor(AFGColor, ciBrushBKColor); + ABkColor := $41; + if AFgColor <> $40 then + PWordArray(@Result)^[0] := AStyle shl 10; + PWordArray(@Result)^[1] := (ABkColor and $7F shl 7) or (AFgColor and $7F); + end; + +var + XF: PByteArray; + I, W: Byte; +const + AColorShift: array[0..3] of Byte = (0, 7, 16, 23); + ALeftRightBorders: array[0..3] of Byte = (0, 2, 1, 3); + BordersWidth: array[Boolean] of Byte = (1, 5); + XFStyleState = $0400 or $0800 or $1000 or $2000 or $4000 or $8000; + XFSize = 20; +begin + XF := AllocMem(26); + Move(cxXLS_XF[15, 2], XF^, 22); + PWord(@XF^[2])^ := xlsRegisterFont(AStyle) and $FFFF; + PWord(@XF^[4])^ := FCells.PrepareCellStyle(AType); + PWord(@XF^[10])^ := PWord(@XF^[10])^ or XFStyleState; + with AStyle do + begin + PWord(@XF^[8])^ := (Byte(AlignText) + 1) or $8; + PWord(@XF^[10])^ := PWord(@XF^[10])^ or (Byte(IsMerge) shl 5); + for I := 0 to 3 do + begin + with Borders[ALeftRightBorders[I]] do + begin + if not IsDefault and (Width > 0) then + begin + if Width = 2 then + W := 2 + else + W := BordersWidth[Width > 2]; + PWord(@XF^[12])^ := PWord(@XF^[12])^ or (W shl (4 * I)); + PInteger(@XF^[14])^ := PInteger(@XF^[14])^ or + xlsCheckColor(Color, ciBorderColor) shl AColorShift[I]; + end; + end; + end; + if Byte(BrushStyle) <> 0 then + PInteger(@XF[18])^ := GetPackedFillStyle(Byte(BrushStyle), BrushBkColor, BrushFGColor); + end; + PInteger(@XF^[22])^ := cxExport.GetHashCode(XF^[2], 20); + Result := FStyles.AddUniqueData(XF); + Inc(Result, $11); +end; + +procedure TcxXLSExportProvider.xlsWriteBuf(const RecData: array of Byte); +begin + FStream.Write(RecData[0], Length(RecData)); +end; + +procedure TcxXLSExportProvider.xlsWriteBuf(const RecID: Word; + const RecData: array of Byte); +begin + FStream.WriteBuffer(RecID, SizeOf(RecID)); + FStream.Write(RecData[0], Length(RecData)); +end; + +procedure TcxXLSExportProvider.xlsWriteBuf(const RecID, DataSize: Word; + const RecData: array of Byte); +begin + FStream.WriteBuffer(RecID, SizeOf(RecID)); + FStream.WriteBuffer(DataSize, SizeOf(DataSize)); + FStream.WriteBuffer(RecData, DataSize); +end; + +procedure TcxXLSExportProvider.xlsWriteBuffer(const ARecData: array of Word); +begin + FStream.WriteBuffer(ARecData[0], Length(ARecData) shl 1); +end; + +procedure TcxXLSExportProvider.xlsWriteBuffer(const RecID, DataSize: Word; const RecData); +begin + FStream.WriteBuffer(RecID, SizeOf(RecID)); + FStream.Write(RecData, DataSize); +end; + +procedure TcxXLSExportProvider.xlsWriteHeader; +var + B: Byte; + I, APos: Integer; + ASheetPos: Integer; +begin + xlsCreateStyles; + FWorkBookWriter.CreateOLEStream(CalculateStoredSize, FStream); + APos := FStream.Position; + cxXLS_BOF[6] := $05; + xlsWriteBuf(cxXLS_BOF); + xlsWriteBuf(cxXLS_TabID); + xlsWriteBuf(cxXLS_Window1); + for I := 0 to 4 do + xlsWriteBuf(cxXLS_Font); + FFonts.SaveToStream(FStream); + FStream.WriteBuffer(cxXLS_XF, SizeOf(cxXLS_XF)); + FStyles.SaveToStream(FStream); + xlsWriteBuffer([XLS_Palette, SizeOf(FPalette) + 2, 56]); + FStream.WriteBuffer(FPalette, SizeOf(FPalette)); + FStream.WriteBuffer(cxXLS_STYLE[0], SizeOf(cxXLS_STYLE)); + ASheetPos := FStream.Position + 4; + xlsWriteBuffer([XLS_BoundSheet, Length(FSheetName) * 2 + 8, 0, 0, 0]); + B := Length(FSheetName); + FStream.WriteBuffer(B, SizeOf(B)); + B := 1; + FStream.WriteBuffer(B, SizeOf(B)); + FStream.WriteBuffer(FSheetName[1], Length(FSheetName) * 2); + // + FSST.SaveToStream(FStream); + xlsWriteBuf(cxXLS_SupBook); + xlsWriteBuf(cxXLS_ExternSheet); +// define range name + if Length(FRangeNameBytes) > 0 then + FStream.WriteBuffer(FRangeNameBytes[0], Length(FRangeNameBytes)); +// + xlsWriteBuf(cxXLS_EOF); + // + FStream.Seek(ASheetPos, soFrombeginning); + ASheetPos := FStream.Size - APos; + FStream.WriteBuffer(ASheetPos, SizeOf(ASheetPos)); + FStream.Seek(0, soFromEnd); +end; + +procedure TcxXLSExportProvider.xlsWriteWorkBook; +var + I: Integer; + C, ASize: Word; +const + VisibleGridState: array[Boolean] of Word = ($6B4, $6B6); +begin + // bof + cxXLS_BOF[6] := $10; + xlsWriteBuf(cxXLS_BOF); + // dimension + PIntArray(@cxXLS_Dimension)^[2] := FMaxRow{ + 1}; + PWordArray(@cxXLS_Dimension)^[7] := FMaxCol{ + 1}; + xlsWriteBuf(cxXLS_Dimension); + // window 2 + PWordArray(@cxXLS_WINDOW2)^[2] := VisibleGridState[FVisibleGrid]; + xlsWriteBuf(cxXLS_WINDOW2); + // Column, Row formatting and cells data + FColStyles.SaveToStream(FStream); + FRowStyles.SaveToStream(FStream); + FCells.SaveToStream(FStream); + if FUnionCellsCount > 0 then + begin + C := Min(FUnionCellsCount, 1024); + ASize := C shl 3 + 2; + xlsWriteBuffer([XLS_MergeCells, ASize, C]); + for I := 1 to FUnionCellsCount do + begin + FStream.WriteBuffer(FUnionCells^[I - 1], SizeOf(TcxMergeRect)); + if (I mod 1024) = 0 then + begin + C := Min(FUnionCellsCount - I, 1024); + ASize := C shl 3 + 2; + xlsWriteBuffer([XLS_MergeCells, ASize, C]); + end; + end; + end; + xlsWriteBuf(cxXLS_EOF); +end; + +{ TxlsCellsData } +destructor TcxXLSCellsData.Destroy; +var + I: Integer; +begin + try + for I := 0 to Length(FCellsList) - 1 do + FreeMem(FCellsList[I]); + finally + inherited Destroy; + end; +end; + +procedure TcxXLSCellsData.SaveToStream(AStream: TStream); +var + I: Integer; + ACell: PcxXLSCell; +begin + for I := 0 to Length(FCellsList) - 1 do + begin + ACell := FCellsList[I]; + ACell^.RecType := ACell^.RecType and not XLS_MergeState; + if ACell^.RecType <> 0 then + AStream.WriteBuffer(ACell^, ACell^.RecSize + 4); + end; +end; + +function TcxXLSCellsData.GetCell(const ACol, ARow: Integer): PcxXLSCell; +begin + Result := FCellsList[FCellPerCol * ACol + ARow]; +end; + +function TcxXLSCellsData.PrepareCellStyle(var AType: Word): Word; +const + AFormats: array[0..3] of Word = ($16, $0E, $15, $07); +begin + if (AType and $1000) <> 0 then + begin + Result := AFormats[AType xor $1000]; + AType := XLS_Number; + end + else + Result := 0; +end; + +function TcxXLSCellsData.ReallocCellData(const ACol, ARow: Integer; AVarDataSize: Integer = 0): PcxXLSCell; +var + AIndex: Integer; +begin + AIndex := FCellPerCol * ACol + ARow; + Result := FCellsList[AIndex]; + ReallocMem(Result, cxXLSBlankCellSize + AVarDataSize); + FCellsList[AIndex] := Result; + Result^.RecSize := AVarDataSize + 6; +end; + +procedure TcxXLSCellsData.SetCellDataBoolean(const ACol, ARow: Integer; + const AValue: Boolean); +begin + with GetCell(ACol, ARow)^ do + begin + FixSetRecType(RecType, XLS_BoolErr); + RecSize := cxXLSBlankCellSize + 2; + BoolErrValue := AValue; + ErrFlag := False; + end; +end; + +procedure TcxXLSCellsData.SetCellDataBlank(const ACol, ARow: Integer); +begin + with GetCell(ACol, ARow)^ do + begin + if RecType <> XLS_Blank then + begin + FixSetRecType(RecType, XLS_Blank); + RecSize := cxXLSBlankCellSize + end; + end; +end; + +procedure TcxXLSCellsData.SetCellDataCurrency(const ACol, ARow: Integer; + const AValue: Currency); +begin + with GetCell(ACol, ARow)^ do + begin + FixSetRecType(RecType, XLS_Currency); + RecSize := cxXLSBlankCellSize + SizeOf(Double); + Num := AValue; + end; +end; + +procedure TcxXLSCellsData.SetCellDataDateTime(const ACol, ARow: Integer; + const AValue: TDateTime); +var + V: Double; +begin + with GetCell(ACol, ARow)^ do + begin + V := AValue; + FixSetRecType(RecType, GetDateTimeFormat(V)); + RecSize := cxXLSBlankCellSize + SizeOf(Double); + Num := V; + end; +end; + +procedure TcxXLSCellsData.SetCellDataDouble( + const ACol, ARow: Integer; const AValue: Double); +begin + with GetCell(ACol, ARow)^ do + begin + FixSetRecType(RecType, XLS_Number); + RecSize := cxXLSBlankCellSize + SizeOf(Double); + Num := AValue; + end; +end; + +procedure TcxXLSCellsData.SetCellDataInteger( + const ACol, ARow: Integer; const AValue: Integer); +begin + SetCellDataDouble(ACol, ARow, AValue); +end; + +procedure TcxXLSCellsData.SetCellDataStringA( + const ACol, ARow: Integer; const AText: string); +begin + with ReallocCellData(ACol, ARow, Length(AText) + 3)^ do + begin + FixSetRecType(RecType, XLS_Label); + StrLen := Length(AText); + StrType := False; + Move(AText[1], StrDataA[0], StrLen); + end; +end; + +procedure TcxXLSCellsData.SetCellDataStringW( + const ACol, ARow: Integer; const AText: Widestring); +begin + with ReallocCellData(ACol, ARow, Length(AText) shl 1 + 3)^ do + begin + FixSetRecType(RecType, XLS_Label); + StrLen := Length(AText); + StrType := True; + Move(AText[1], StrDataA[0], StrLen shl 1); + end; +end; + +procedure TcxXLSCellsData.SetCellDataSSTString(const ACol, ARow, AIndex: Integer); +begin + with GetCell(ACol, ARow)^ do + begin + FixSetRecType(RecType, XLS_LabelSST); + Inc(RecSize, SizeOf(Integer)); + SSTIndex := AIndex; + end; +end; + +procedure TcxXLSCellsData.SetRange(const AColCount, ARowCount: Integer); +var + I, J, AIndex: Integer; +begin + SetLength(FCellsList, AColCount * ARowCount); + AIndex := 0; + FCellPerCol := ARowCount; + for I := 0 to AColCount - 1 do + for J := 0 to ARowCount - 1 do + begin + GetMem(FCellsList[AIndex], cxXLSBlankCellSize + SizeOf(Double)); + with FCellsList[AIndex]^ do + begin + RecType := XLS_Blank; + RecSize := 6; + Col := I; + Row := J; + XF := $10; + end; + Inc(AIndex); + end; +end; + +function TcxXLSCellsData.GetFullSize: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Length(FCellsList) - 1 do + begin + with FCellsList[I]^ do + begin + if RecType <> 0 then + begin + Inc(Result, RecSize); + Inc(Result, 4); + end; + end; + end; +end; + +{ TSSTStringTable } +constructor TcxXLSSharedStringTable.Create; +begin + FOptimaze := Optimization = optBySize; + Clear; +end; + +destructor TcxXLSSharedStringTable.Destroy; +begin + Clear; + inherited Destroy; +end; + +function TcxXLSSharedStringTable.Add(AString: WideString): Integer; +begin + if Length(AString) > 4096 then + SetLength(AString, 4096); + Result := IndexOf(AString); + if Result = -1 then + begin + Result := UniqueStringCount; + InsertStr(AString); + Inc(PInteger(@FSST[0].Data[4])^); + end; + Inc(PInteger(@FSST[0].Data[0])^); +end; + +procedure TcxXLSSharedStringTable.Clear; +begin + SetLength(FSST, 0); + SetLength(FStringsInfo, 0); + FillChar(FExtSST, SizeOf(FExtSST), 0); + FExtSST.RecType := XLS_ExtSST; +end; + +procedure TcxXLSSharedStringTable.SaveToStream(AStream: TStream; APosition: Integer = -1); +var + I: Integer; +begin + if APosition = -1 then + APosition := AStream.Position; + CreateExtSST(APosition); + with AStream do + begin + for I := 0 to Length(FSST) - 1 do + if FExtSST.DataSize > 0 then + WriteBuffer(FSST[I].RecType, FSST[I].DataSize + 4); + if FExtSST.DataSize > 0 then + WriteBuffer(FExtSST.RecType, FExtSST.DataSize + 4); + end; +end; + +procedure TcxXLSSharedStringTable.AddStringToBlock(ASource: Pointer; var ADest: TSSTBlock; ASize: Word); +begin + with ADest do + begin + Data[DataSize] := 1; + Inc(DataSize, 1); + Move(ASource^, Data[DataSize], ASize); + Inc(DataSize, ASize); + end; +end; + +procedure TcxXLSSharedStringTable.CreateExtSST(ASSTOffset: Integer); + + function GetSkipSize(ABlock: Word): Integer; + var + I: Integer; + begin + Result := 4; + for I := 1 to ABlock - 1 do + Result := Result + FSST[I].DataSize; + end; + +var + ABlocksCount: Integer; + AStringCount: Word; + I: Integer; +begin + if Length(FSST) = 0 then Exit; + AStringCount := 8; + ABlocksCount := 1; + while (UniqueStringCount - AStringCount * ABlocksCount) > 0 do + begin + Inc(AStringCount, 8); + if ABlocksCount < 127 then + if (UniqueStringCount - AStringCount * ABlocksCount) > 0 then Inc(ABlocksCount); + end; + while ((ABlocksCount - 1)* AStringCount) > UniqueStringCount do + Dec(ABlocksCount); + FExtSST.DataSize := 2 + ABlocksCount * 8; + FExtSST.StringPerBlock := AStringCount; + for I := 0 to ABlocksCount - 1 do + with FStringsInfo[I * AStringCount] do + FExtSST.Data[I].StreamOffset := ASSTOffset + GetSkipSize(Block) + Offset; +end; + +function TcxXLSSharedStringTable.GetPackedSize: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Length(FSST) - 1 do + Inc(Result, FSST[I].DataSize + 4); + if Result <> 0 then + begin + CreateExtSST(0); + Inc(Result, FExtSST.DataSize + 4); + end; +end; + +function TcxXLSSharedStringTable.IndexOf(const AString: WideString): Integer; + + function CheckString(ABlock, AOffset, ASize: Word): Boolean; + var + AStrPtr: PByteArray; + ALen: Integer; + AStrPos: Integer; + begin + AStrPtr := @AString[1]; + if (ASize + AOffset) <= FSST[ABlock].DataSize then + Result := CompareMem(@FSST[ABlock].Data[AOffset], AStrPtr, ASize) + else + begin + Result := True; + AStrPos := 0; + while ASize > 0 do + begin + with FSST[ABlock] do + begin + ALen := (DataSize - AOffset); + if ALen < ASize then + begin + Result := Result and CompareMem(@Data[AOffset], @AStrPtr^[AStrPos], ALen); + Dec(ASize, ALen); + Inc(AStrPos, ALen); + AOffset := 1; + Inc(ABlock); + end + else + begin + Result := Result and CompareMem(@Data[AOffset], @AStrPtr^[AStrPos], ASize); + Break; + end; + end; + end; + end; + end; + +var + I: Integer; + ASrcLen: Word; + AHashCode: Word; + +begin + if not FOptimaze then + begin + Result := -1; + Exit; + end; + ASrcLen := Length(AString); + if ASrcLen > 32768 then + ASrcLen := 32768; + Result := -1; + ASrcLen := ASrcLen shl 1; + AHashCode := cxExport.GetHashCode(Pointer(@AString[1])^, ASrcLen); + for I := 0 to UniqueStringCount - 1 do + begin + with FStringsInfo[I] do + begin + if (HashCode = AHashCode) and (ASrcLen = StrSize) then + if CheckString(Block, Offset + 3, StrSize) then + begin + Result := I; + Break; + end; + end; + end; +end; + +procedure TcxXLSSharedStringTable.InsertStr(const AString: WideString); + + function AddBlock: Integer; + begin + Result := Length(FSST); + SetLength(FSST, Result + 1); + FillChar(FSST[Result], SizeOf(TSSTBlock), 0); + FSST[Result].RecType := XLS_Continue; + end; + + procedure AddStringInfo(ABlock, AOffset, ASize: Word); + var + AInfoCount: Integer; + AInfoIndex: Integer; + begin + AInfoCount := Length(FStringsInfo); + AInfoIndex := UniqueStringCount; + if AInfoCount <= UniqueStringCount then + SetLength(FStringsInfo, AInfoCount + 512); + with FStringsInfo[AInfoIndex] do + begin + HashCode := cxExport.GetHashCode(Pointer(@AString[1])^, ASize); + StrSize := ASize; + Block := ABlock; + Offset := AOffset; + end; + end; + +var + AEndBlock: SmallInt; + AStrSize: Word; + AWriteSize: Word; + AOffset: Word; + +begin + AEndBlock := Length(FSST) - 1; + if AEndBlock < 0 then + begin + AEndBlock := AddBlock; + with FSST[AEndBlock] do + begin + RecType := XLS_SST; + DataSize := 8; + StringOffset := 8; + end; + end; + AStrSize := Length(AString); + if AStrSize > 32768 then + AStrSize := 32768; + AStrSize := AStrSize shl 1; + + if (FSST[AEndBlock].DataSize + 4) > cxXLSMaxBlockSize then + AEndBlock := AddBlock; + AWriteSize := cxXLSMaxBlockSize - (FSST[AEndBlock].DataSize + 3); + if AWriteSize > AStrSize then + AWriteSize := AStrSize + else + begin + if (AWriteSize and $1) <> 0 then + Dec(AWriteSize); + end; + with FSST[AEndBlock] do + begin + if StringCount = 0 then + StringOffset := DataSize; + AddStringInfo(AEndBlock, DataSize, AStrSize); + Inc(StringCount); + PWord(@Data[DataSize])^ := AStrSize shr 1; + Inc(DataSize, 2); + end; + AddStringToBlock(@AString[1], FSST[AEndBlock], AWriteSize); + AOffset := 0; + while (AStrSize - AWriteSize) > 0 do + begin + Inc(AOffset, AWriteSize); + Dec(AStrSize, AWriteSize); + AEndBlock := AddBlock; + if AStrSize > (cxXLSMaxBlockSize - 1) then + AWriteSize := cxXLSMaxBlockSize - 1 + else + AWriteSize := AStrSize; + AddStringToBlock(@PByteArray(@AString[1])^[AOffset], FSST[AEndBlock], AWriteSize); + end; +end; + +function TcxXLSSharedStringTable.GetStringCount: Integer; +begin + if Length(FSST) > 0 then + Result := PIntArray(@FSST[0].Data)^[0] + else + Result := 0; +end; + +function TcxXLSSharedStringTable.GetUniqueStringCount: Integer; +begin + if Length(FSST) > 0 then + Result := PIntArray(@FSST[0].Data)^[1] + else + Result := 0; +end; + +{ TxlsRecordList } + +constructor TcxXLSRecordsList.Create(const RecordID: Word); +begin + inherited Create; + FID := RecordID; +end; + +destructor TcxXLSRecordsList.Destroy; +begin + Clear; + inherited Destroy; +end; + +function TcxXLSRecordsList.AddData(const AData; DataSize: Word): Integer; +var + NewData: PByteArray; +begin + GetMem(NewData, DataSize + SizeOf(Word) + SizeOf(Integer)); + PWord(NewData)^ := DataSize; + PInteger(@NewData[DataSize + SizeOf(Word)])^ := cxExport.GetHashCode(AData, DataSize); + System.Move(AData, NewData^[SizeOf(Word)], DataSize); + Result := Add(NewData); +end; + +function TcxXLSRecordsList.AddUniqueData(var AData: PByteArray): Integer; +var + I: Integer; + Item: PByteArray; + AHashCode: Integer; + ASize: Word; +begin + AHashCode := PInteger(@AData^[PWord(AData)^ + 2])^; + ASize := PWord(AData)^; + for I := 0 to Count - 1 do + begin + Item := inherited Items[I]; + if (AHashCode = PInteger(@Item^[PWord(Item)^ + 2])^) and + CompareMem(Item, AData, ASize) then + begin + Result := I; + FreeMem(AData); + AData := nil; + Exit; + end; + end; + Result := Add(AData); +end; + +procedure TcxXLSRecordsList.Clear; +var + I: Integer; +begin + try + for I := 0 to Count - 1 do + FreeMem(inherited Items[I]); + finally + inherited Clear; + end; +end; + +procedure TcxXLSRecordsList.SaveToStream(AStream: TStream); +var + I: Integer; + AItem: Pointer; +begin + for I := 0 to Count - 1 do + begin + AStream.WriteBuffer(FID, SizeOf(Word)); + AItem := GetRealItem(I); + AStream.WriteBuffer(AItem^, PWord(AItem)^ + SizeOf(Word)); + end; +end; + +function TcxXLSRecordsList.GetFullSize: Integer; +var + I: Integer; +begin + Result := Count shl 2; + for I := 0 to Count - 1 do + Inc(Result, PWord(inherited Items[I])^); +end; + +function TcxXLSRecordsList.GetItem(AIndex: Integer): Pointer; +begin + Result := inherited Items[AIndex]; + Inc(Integer(Result), SizeOf(Word)); +end; + +function TcxXLSRecordsList.GetItemSize(AIndex: Integer): Integer; +begin + Result := PWord(inherited Items[AIndex])^; +end; + +function TcxXLSRecordsList.GetRealItem(AIndex: Integer): Pointer; +begin + Result := inherited Items[AIndex]; +end; + +{ TcxWorkBookReader } +procedure TcxXLSWorkBookWriter.CreateOLEStream(ADataSize: Integer; + ADstStream: TStream); +var + ASize: Integer; +begin + FBuffer := nil; + Check((ADataSize > 0) and (ADstStream <> nil)); + FStreamSize := ADataSize; + FSectCount := RoundDIV(FStreamSize, oleBigBlockSize); + ASize := RoundDIV(FSectCount, oleBlockIDPerBigBlock) + 3; + FIsSmallFile := FStreamSize < oleMiniSectorMaxSize; + if not IsSmallFile then + ReallocBuffer(oleBigBlockSize * (ASize + RoundDiv(ASize, oleMaxBlockIDInBigBlock))) + else + ReallocBuffer(4 shl oleBigBlockShift); + CreateHeader; + CreateDIR; + CreateFAT; + try + ADstStream.WriteBuffer(FBuffer^, Size); + finally + ReallocBuffer(oleEmpty); + end; +end; + +procedure TcxXLSWorkBookWriter.Check(ACondition: Boolean); +begin + if not ACondition then + raise EcxExportData.Create(cxGetResString(@scxWorkbookWrite)); +end; + +procedure TcxXLSWorkBookWriter.CreateDIF; +var + I, AId: Integer; + ACurDIF: PcxFATSector; + ACurSect: Integer; + AIndex, ASectorID: Integer; +begin + AIndex := 0; + ACurSect := 0; + ACurDIF := DIF[ACurSect]; + AId := 0; + with Header^ do + begin + for I := oleSectorsInMasterFAT - 1 to CountSectFAT - 2 do + begin + ASectorID := I - 108; + if AIndex = oleMaxBlockIdInBigBlock then + begin + ACurDIF^[oleMaxBlockIdInBigBlock] := ASectorID + 111 + AId; + ACurDIF := DIF[ACurSect + 1]; + AIndex := 0; + Inc(ACurSect); + end; + if ((ASectorID + AId - 1) mod oleBlockIDPerBigBlock) = 0 then + Inc(AId); + ACurDIF^[AIndex] := ASectorID + 110 + AId; + Inc(AIndex); + end; + FillChar(ACurDIF^[AIndex], (oleBlockIDPerBigBlock - AIndex) * oleIndexSize, oleUnused); + end; +end; + +procedure TcxXLSWorkBookWriter.CreateDIR; + + procedure CreateEntry(const AName: WideString; + AType: TcxOLEDIREntryType; AEntry: PcxOLEDIREntry); + begin + with AEntry^ do + begin + EntryType := AType; + BFlag := Byte(AType = ET_STREAM); + LeftSib := LongWord(oleUnused); + RightSib := LongWord(oleUnused); + ChildSib := LongWord(oleUnused); + if AType in [ET_STREAM, ET_ROOT] then + begin + NameLen := (Length(AName) + 1) shl 1; + if NameLen <> 1 then + Move(AName[1], Name, NameLen - 2); + end; + end; + end; + +begin + FillChar(DIR[0]^, oleBigBlockSize, oleEmpty); + CreateEntry(oleRoot, ET_ROOT, DIR[0]); + CreateEntry(oleWorkBook, ET_STREAM, DIR[1]); + DIR[0]^.ChildSib := 1; + if not IsSmallFile then + begin + DIR[0]^.StartSector := oleEndOfChain; + with Header^ do + DIR[1]^.StartSector := CountSectFAT + CountSectDIF + 1; + end + else + begin + DIR[0]^.StartSector := 3; + DIR[0]^.Size := FSectCount shl oleBigBlockShift; + end; + DIR[1]^.Size := FStreamSize; +end; + +procedure TcxXLSWorkBookWriter.CreateFAT; +var + I: Integer; +begin + with Header^ do + begin + if not FIsSmallFile then + begin + for I := 0 to Min(CountSectFAT, oleSectorsInMasterFAT) - 1 do + begin + if I = 0 then + Header^.SectFAT[0] := 0 + else + Header^.SectFAT[I] := I + 1; + end; + if CountSectDIF > 0 then + CreateDIF; + CreateLocalFAT; + end + else + begin + SectFAT[0] := 0; + CreateSmallFAT; + end; + end; +end; + +procedure TcxXLSWorkBookWriter.CreateHeader; +var + ACount: Integer; +begin + with Header^ do + begin + Move(oleHeaderTemplate, Header^, oleBigBlockSize - SizeOf(SectFAT)); + FillChar(SectFAT, SizeOf(SectFAT), oleUnused); + if not FIsSmallFile then + begin + CountSectFAT := RoundDIV(FSectCount + 3, oleMaxBlockIdInBigBlock); + if CountSectFAT > oleSectorsInMasterFAT then + begin + ACount := CountSectFAT - oleSectorsInMasterFAT; + CountSectDIF := RoundDIV(ACount, oleMaxBlockIdInBigBlock); + SectDIFStart := oleSectorsInMasterFAT + oleReservedSectorCount; + end; + ReallocBuffer((CountSectFAT + CountSectDIF + oleReservedSectorCount) shl oleBigBlockShift); + end + else + begin + SectMiniFATStart := 2; + CountSectMiniFAT := 1; + end; + end; +end; + +procedure TcxXLSWorkBookWriter.CreateSmallFAT; +var + ABigFAT: PcxFATSector; + ASmallFAT: PcxFATSector; + ABlockCount: Integer; + I: Integer; +begin + ABigFAT := @FBuffer^[oleBigBlockSize]; + ASmallFAT := @FBuffer^[3 shl oleBigBlockShift]; + ABlockCount := RoundDiv(FStreamSize, oleSmallBlockSize); + FillChar(ABigFAT^, oleBigBlockSize, oleUnused); + ABigFAT^[0] := oleSpecBlock; + ABigFAT^[1] := oleEndOfChain; + ABigFAT^[2] := oleEndOfChain; + I := 3; + while (I - 3) < (FSectCount - 1) do + begin + ABigFAT^[I] := I + 1; + Inc(I); + end; + ABigFAT^[I] := oleEndOfChain; + for I := 0 to ABlockCount - 2 do + ASmallFAT^[I] := I + 1; + ASmallFAT^[ABlockCount - 1] := oleEndOfChain; + FillChar(ASmallFAT^[ABlockCount], + (oleBlockIDPerBigBlock - ABlockCount) * oleIndexSize, oleUnused); +end; + +procedure TcxXLSWorkBookWriter.ReallocBuffer(const ASize: Integer); +begin + FBufferSize := (RoundDIV(ASize, oleMiniSectorMaxSize) + 1) * oleMiniSectorMaxSize; + try + if FBufferSize > FCapacity then + begin + FCapacity := FBufferSize; + ReallocMem(FBuffer, FCapacity); + end + finally + if ASize = 0 then + begin + FreeMem(FBuffer, FCapacity); + FBuffer := nil; + end; + FBufferSize := ASize; + end; +end; + +procedure TcxXLSWorkBookWriter.CreateLocalFAT; +var + I: Integer; + AIndex: Integer; + ASector: Integer; + ACurSector: PcxFATSector; + ADIF: Integer; + + procedure IncCurrentIndexAndSetValue(const Value: Integer); + begin + ACurSector^[AIndex] := Value; + if AIndex = oleMaxBlockIdInBigBlock then + begin + Inc(ASector); + ACurSector := FAT[ASector]; + AIndex := 0; + end + else + Inc(AIndex); + end; + +begin + AIndex := 0; + ASector := 0; + ADIF := 0; + ACurSector := FAT[ASector]; + IncCurrentIndexAndSetValue(oleSpecBlock); + IncCurrentIndexAndSetValue(oleEndOfChain); + with Header^ do + begin + for I := 1 to CountSectFAT + CountSectDIF - 1 do + begin + if CountSectDIF > 0 then + if (ADIF + SectDIFStart - 1) = I then + begin + Inc(ADIF, oleBlockIDPerBigBlock); + IncCurrentIndexAndSetValue(oleDIFBlock); + Continue; + end; + IncCurrentIndexAndSetValue(oleSpecBlock); + end; + end; + with DIR[1]^ do + for I := StartSector + 1 to StartSector + FSectCount - 1 do + IncCurrentIndexAndSetValue(I); + IncCurrentIndexAndSetValue(oleEndOfChain); + if AIndex <> 0 then + begin + I := oleBlockIDPerBigBlock - AIndex; + if I > 0 then + FillChar(ACurSector^[AIndex], I * 4, oleUnused); + end; +end; + +function TcxXLSWorkBookWriter.GetDIFSector(ASector: Integer): PcxFATSector; +begin + Result := @PcxFATSectors(FBuffer)^[Header^.SectDIFStart + + (ASector * oleBlockIDPerBigBlock) + 1]; +end; + +function TcxXLSWorkBookWriter.GetDIREntry(AIndex: Integer): PcxOLEDIREntry; +begin + Result := @FBuffer[oleReservedSectorCount shl oleBigBlockShift + + AIndex * oleDIRBlockSize]; +end; + +function TcxXLSWorkBookWriter.GetHeader: PcxOleFileHeader; +begin + Result := PcxOleFileHeader(FBuffer); +end; + +function TcxXLSWorkBookWriter.GetFATSector(ASector: Integer): PcxFATSector; +var + ADIFBlock: Integer; +begin + if ASector = 0 then + Result := @PcxFATSectors(FBuffer)^[1] + else + begin + if ASector < oleSectorsInMasterFAT then + Result := @PcxFATSectors(FBuffer)^[ASector + 2] + else + begin + ASector := ASector - oleSectorsInMasterFAT; + ADIFBlock := 0; + while (ASector - oleMaxBlockIdInBigBlock) >= 0 do + begin + Dec(ASector, oleMaxBlockIdInBigBlock); + Inc(ADIFBlock); + end; + Result := @PcxFATSectors(FBuffer)^[DIF[ADIFBlock]^[ASector] + 1]; + end; + end; +end; + +{$IFDEF WIN32} +var + DC: HDC; +{$ENDIF} + +initialization + TcxExport.RegisterProviderClass(TcxXLSExportProvider); + +{$IFDEF WIN32} + DC := GetDC(0); + try + ScaledFactor := GetDeviceCaps(DC, LOGPIXELSY) / 96; + if ScaledFactor < 1 then ScaledFactor := 1; + finally + ReleaseDC(0, DC) + end; +{$ENDIF} + +end. diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC10.bpk b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC10.bpk new file mode 100644 index 00000000..ae29ff08 --- /dev/null +++ b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC10.bpk @@ -0,0 +1,192 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxGDIPlusC10.bpl +OBJFILES = dxGDIPlusClasses.obj dxGDIPlusAPI.obj dxGDIPlusC10.obj +RESFILES = dxGDIPlusC10.res +MAINSOURCE = dxGDIPlusC10.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressGDI+ Library by Developer Express Inc." -aa -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC10.cpp b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC10.cpp new file mode 100644 index 00000000..c7334c71 --- /dev/null +++ b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC10.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dxGDIPlusC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEUNIT("dxGDIPlusClasses.pas"); +USEUNIT("dxGDIPlusAPI.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC10.res b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC10.res new file mode 100644 index 00000000..6ffae188 Binary files /dev/null and b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC10.res differ diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC11.bpk b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC11.bpk new file mode 100644 index 00000000..da16fc04 --- /dev/null +++ b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC11.bpk @@ -0,0 +1,192 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxGDIPlusC11.bpl +OBJFILES = dxGDIPlusClasses.obj dxGDIPlusAPI.obj dxGDIPlusC11.obj +RESFILES = dxGDIPlusC11.res +MAINSOURCE = dxGDIPlusC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressGDI+ Library by Developer Express Inc." -aa -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC11.cpp b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC11.cpp new file mode 100644 index 00000000..bdc6ddeb --- /dev/null +++ b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC11.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dxGDIPlusC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEUNIT("dxGDIPlusClasses.pas"); +USEUNIT("dxGDIPlusAPI.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC11.res b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC11.res new file mode 100644 index 00000000..d794e778 Binary files /dev/null and b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC11.res differ diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC5.bpk b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC5.bpk new file mode 100644 index 00000000..f6c7dfd2 --- /dev/null +++ b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC5.bpk @@ -0,0 +1,193 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxGDIPlusC5.bpl +OBJFILES = dxGDIPlusClasses.obj dxGDIPlusAPI.obj dxGDIPlusC5.obj +RESFILES = dxGDIPlusC5.res +MAINSOURCE = dxGDIPlusC5.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = vcl50.bpi +SPARELIBS = vcl50.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressGDI+ Library by Developer Express Inc." -aa -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC5.cpp b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC5.cpp new file mode 100644 index 00000000..afb66ffd --- /dev/null +++ b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC5.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dxGDIPlusC5.res"); +USEPACKAGE("vcl50.bpi"); +USEUNIT("dxGDIPlusClasses.pas"); +USEUNIT("dxGDIPlusAPI.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC5.res b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC5.res new file mode 100644 index 00000000..54e68d81 Binary files /dev/null and b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC5.res differ diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC6.bpk b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC6.bpk new file mode 100644 index 00000000..aaa72565 --- /dev/null +++ b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC6.bpk @@ -0,0 +1,192 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxGDIPlusC6.bpl +OBJFILES = dxGDIPlusClasses.obj dxGDIPlusAPI.obj dxGDIPlusC6.obj +RESFILES = dxGDIPlusC6.res +MAINSOURCE = dxGDIPlusC6.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressGDI+ Library by Developer Express Inc." -aa -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC6.cpp b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC6.cpp new file mode 100644 index 00000000..7062e37b --- /dev/null +++ b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC6.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dxGDIPlusC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEUNIT("dxGDIPlusClasses.pas"); +USEUNIT("dxGDIPlusAPI.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC6.res b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC6.res new file mode 100644 index 00000000..9b2b3dac Binary files /dev/null and b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusC6.res differ diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD10.dpk b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD10.dpk new file mode 100644 index 00000000..432ff83e --- /dev/null +++ b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD10.dpk @@ -0,0 +1,37 @@ +package dxGDIPlusD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressGDI+ Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl; + +contains + dxGDIPlusAPI, + dxGDIPlusClasses; + +end. + diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD10.res b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD10.res new file mode 100644 index 00000000..f9c1d540 Binary files /dev/null and b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD10.res differ diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD11.dpk b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD11.dpk new file mode 100644 index 00000000..6b679771 --- /dev/null +++ b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD11.dpk @@ -0,0 +1,37 @@ +package dxGDIPlusD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressGDI+ Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl; + +contains + dxGDIPlusAPI, + dxGDIPlusClasses; + +end. + diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD11.res b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD11.res new file mode 100644 index 00000000..f9b4aa78 Binary files /dev/null and b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD11.res differ diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD5.dpk b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD5.dpk new file mode 100644 index 00000000..aa78cb48 --- /dev/null +++ b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD5.dpk @@ -0,0 +1,37 @@ +package dxGDIPlusD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressGDI+ Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50; + +contains + dxGDIPlusAPI, + dxGDIPlusClasses; + +end. + diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD5.res b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD5.res new file mode 100644 index 00000000..22f1b80c Binary files /dev/null and b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD5.res differ diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD6.dpk b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD6.dpk new file mode 100644 index 00000000..7c7df563 --- /dev/null +++ b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD6.dpk @@ -0,0 +1,37 @@ +package dxGDIPlusD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressGDI+ Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl; + +contains + dxGDIPlusAPI, + dxGDIPlusClasses; + +end. + diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD6.res b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD6.res new file mode 100644 index 00000000..1d720093 Binary files /dev/null and b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD6.res differ diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD7.dpk b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD7.dpk new file mode 100644 index 00000000..c84c7ea3 --- /dev/null +++ b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD7.dpk @@ -0,0 +1,37 @@ +package dxGDIPlusD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressGDI+ Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl; + +contains + dxGDIPlusAPI, + dxGDIPlusClasses; + +end. + diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD7.res b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD7.res new file mode 100644 index 00000000..0ffc8832 Binary files /dev/null and b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD7.res differ diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD9.dpk b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD9.dpk new file mode 100644 index 00000000..f348dfcd --- /dev/null +++ b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD9.dpk @@ -0,0 +1,37 @@ +package dxGDIPlusD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressGDI+ Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl; + +contains + dxGDIPlusAPI, + dxGDIPlusClasses; + +end. + diff --git a/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD9.res b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD9.res new file mode 100644 index 00000000..0ff39075 Binary files /dev/null and b/official/x.35/ExpressGDI+ Library/Packages/dxGDIPlusD9.res differ diff --git a/official/x.35/ExpressGDI+ Library/Sources/cxVer.inc b/official/x.35/ExpressGDI+ Library/Sources/cxVer.inc new file mode 100644 index 00000000..a26364cc --- /dev/null +++ b/official/x.35/ExpressGDI+ Library/Sources/cxVer.inc @@ -0,0 +1,172 @@ +{$B-} { Complete Boolean Evaluation } +{$R-} { Range-Checking } +{$T-} { Typed @ operator } +{$X+} { Extended syntax } +{$P+} { Open string params } +{$J+} { Writeable structured consts } +{$H+} { Use long strings by default } +{$Q-} { Overflow checking } + +{$DEFINE DXVER500} + +{$IFNDEF CLR} + {$DEFINE OLEDRAGANDDROP} + {$IFNDEF DONTUSEJPEGIMAGE} + {$DEFINE USEJPEGIMAGE} + {$ENDIF} +{$ENDIF} + +{$DEFINE EXPRESSBARS5} + +{$DEFINE VCL} + +{$IFNDEF VER80} + {$IFNDEF VER90} + {$IFNDEF VER93} + {$DEFINE DELPHI3} { Borland Delphi 3.0 } + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER110} { Borland C++Builder 3.0 } + {$DEFINE CBUILDER3} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE DELPHI4} +{$ENDIF} + +{$IFDEF VER125} { Borland C++Builder 4.0 } + {$DEFINE CBUILDER3} + {$DEFINE DELPHI4} + {$DEFINE CBUILDER4} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$IFDEF BCB} { Borland C++Builder 5.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$IFDEF BCB} { Borland C++Builder 6.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} +{$ENDIF} + +{$IFNDEF DELPHI6} + {$DEFINE MSWINDOWS} +{$ENDIF} +{$IFDEF LINUX} + {$UNDEF MSWINDOWS} +{$ENDIF} + +{$IFDEF LINUX} + {$DEFINE KYLIX1} { Borland Kylix 1 } + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF CompilerVersion >= 14} + {$DEFINE KYLIX2} { Borland Kylix 2 } + {$IFEND} + {$IF CompilerVersion >= 14.50} + {$DEFINE KYLIX3} { Borland Kylix 3 } + {$IFEND} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} { Borland Delphi.Net } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} +{$ENDIF} + +{$IFDEF VER170} { Borland Delphi 9.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} +{$ENDIF} + +{$IFDEF VER180} { Borland Delphi 10 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$IFDEF BCB} { Borland C++Builder 10 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Borland Delphi 11 //CodeGear} + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$DEFINE DELPHI11} + {$IFDEF BCB} { Borland C++Builder 11 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$DEFINE CBUILDER11} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFNDEF CLR} + {$IFNDEF BCB} + {$IFDEF DELPHI6} + {$DEFINE REGISTERSHELLCTRLS} + {$ENDIF} + {$ENDIF} + {$IFDEF DELPHI7} + {$WARN UNSAFE_CAST OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_TYPE OFF} + {$ENDIF} +{$ENDIF} + +{$IFDEF REGISTERSHELLCTRLS} + {$DEFINE REGISTERCXSHELLCTRLS} +{$ENDIF} + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} diff --git a/official/x.35/ExpressGDI+ Library/Sources/dxGDIPlusAPI.pas b/official/x.35/ExpressGDI+ Library/Sources/dxGDIPlusAPI.pas new file mode 100644 index 00000000..b9a22f93 --- /dev/null +++ b/official/x.35/ExpressGDI+ Library/Sources/dxGDIPlusAPI.pas @@ -0,0 +1,1126 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ GDI+ Library } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE GDIPLUS LIBRARY AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxGDIPlusAPI; + +{$ALIGN ON} +{$MINENUMSIZE 4} + +{$I cxVer.inc} + +interface + +(**************************************************************************\ +* +* GDI+ public header file +* +\**************************************************************************) + +uses + Windows, Graphics, Classes, SysUtils, ActiveX; + +const + QualityModeInvalid = -1; + QualityModeDefault = 0; + QualityModeLow = 1; // Best performance + QualityModeHigh = 2; // Best rendering quality + + InterpolationModeInvalid = QualityModeInvalid; + InterpolationModeDefault = QualityModeDefault; + InterpolationModeLowQuality = QualityModeLow; + InterpolationModeHighQuality = QualityModeHigh; + InterpolationModeBilinear = 3; + InterpolationModeBicubic = 4; + InterpolationModeNearestNeighbor = 5; + InterpolationModeHighQualityBilinear = 6; + InterpolationModeHighQualityBicubic = 7; + +// Alpha Compositing mode constants + CompositingModeSourceOver = 0; + CompositingModeSourceCopy = 1; + +// Alpha Compositing quality constants + CompositingQualityInvalid = QualityModeInvalid; + CompositingQualityDefault = QualityModeDefault; + CompositingQualityHighSpeed = QualityModeLow; + CompositingQualityHighQuality = QualityModeHigh; + CompositingQualityGammaCorrected = 3; + CompositingQualityAssumeLinear = 4; + + PixelFormat32bppPARGB = $E200B; + +type + TSingleDynArray = array of Single; + + // GDI+ base memory allocation class + TdxGPBase = class + public + class function NewInstance: TObject; override; + procedure FreeInstance; override; + end; + + TgpImageAbort = function: Bool; + +// Unit constants + Unit_ = ( + UnitWorld, // 0 -- World coordinate (non-physical unit) + UnitDisplay, // 1 -- Variable -- for PageTransform only + UnitPixel, // 2 -- Each unit is one device pixel. + UnitPoint, // 3 -- Each unit is a printer's point, or 1/72 inch. + UnitInch, // 4 -- Each unit is 1 inch. + UnitDocument, // 5 -- Each unit is 1/300 inch. + UnitMillimeter // 6 -- Each unit is 1 millimeter. + ); + TdxGPUnit = Unit_; + +// Fill mode constants + FillMode = ( + FillModeAlternate, // 0 + FillModeWinding // 1 + ); + TdxGPFillMode = FillMode; + +// Various wrap modes for brushes + WrapMode = ( + WrapModeTile, // 0 + WrapModeTileFlipX, // 1 + WrapModeTileFlipY, // 2 + WrapModeTileFlipXY, // 3 + WrapModeClamp // 4 + ); + TdxGPWrapMode = WrapMode; + +// Various hatch styles + HatchStyle = ( + HatchStyleHorizontal, // = 0, + HatchStyleVertical, // = 1, + HatchStyleForwardDiagonal, // = 2, + HatchStyleBackwardDiagonal, // = 3, + HatchStyleCross, // = 4, + HatchStyleDiagonalCross, // = 5, + HatchStyle05Percent, // = 6, + HatchStyle10Percent, // = 7, + HatchStyle20Percent, // = 8, + HatchStyle25Percent, // = 9, + HatchStyle30Percent, // = 10, + HatchStyle40Percent, // = 11, + HatchStyle50Percent, // = 12, + HatchStyle60Percent, // = 13, + HatchStyle70Percent, // = 14, + HatchStyle75Percent, // = 15, + HatchStyle80Percent, // = 16, + HatchStyle90Percent, // = 17, + HatchStyleLightDownwardDiagonal, // = 18, + HatchStyleLightUpwardDiagonal, // = 19, + HatchStyleDarkDownwardDiagonal, // = 20, + HatchStyleDarkUpwardDiagonal, // = 21, + HatchStyleWideDownwardDiagonal, // = 22, + HatchStyleWideUpwardDiagonal, // = 23, + HatchStyleLightVertical, // = 24, + HatchStyleLightHorizontal, // = 25, + HatchStyleNarrowVertical, // = 26, + HatchStyleNarrowHorizontal, // = 27, + HatchStyleDarkVertical, // = 28, + HatchStyleDarkHorizontal, // = 29, + HatchStyleDashedDownwardDiagonal, // = 30, + HatchStyleDashedUpwardDiagonal, // = 31, + HatchStyleDashedHorizontal, // = 32, + HatchStyleDashedVertical, // = 33, + HatchStyleSmallConfetti, // = 34, + HatchStyleLargeConfetti, // = 35, + HatchStyleZigZag, // = 36, + HatchStyleWave, // = 37, + HatchStyleDiagonalBrick, // = 38, + HatchStyleHorizontalBrick, // = 39, + HatchStyleWeave, // = 40, + HatchStylePlaid, // = 41, + HatchStyleDivot, // = 42, + HatchStyleDottedGrid, // = 43, + HatchStyleDottedDiamond, // = 44, + HatchStyleShingle, // = 45, + HatchStyleTrellis, // = 46, + HatchStyleSphere, // = 47, + HatchStyleSmallGrid, // = 48, + HatchStyleSmallCheckerBoard, // = 49, + HatchStyleLargeCheckerBoard, // = 50, + HatchStyleOutlinedDiamond, // = 51, + HatchStyleSolidDiamond, // = 52, + + HatchStyleTotal // = 53, + ); + +const + HatchStyleLargeGrid = HatchStyleCross; // 4 + HatchStyleMin = HatchStyleHorizontal; + HatchStyleMax = HatchStyleSolidDiamond; + +type + TdxGPHatchStyle = HatchStyle; + +// Dash style constants + DashStyle = ( + DashStyleSolid, // 0 + DashStyleDash, // 1 + DashStyleDot, // 2 + DashStyleDashDot, // 3 + DashStyleDashDotDot, // 4 + DashStyleCustom // 5 + ); + TdxGPDashStyle = DashStyle; + +// WarpMode constants + WarpMode = ( + WarpModePerspective, // 0 + WarpModeBilinear // 1 + ); + TdxGPWarpMode = WarpMode; + +// LineGradient Mode + LinearGradientMode = ( + LinearGradientModeHorizontal, // 0 + LinearGradientModeVertical, // 1 + LinearGradientModeForwardDiagonal, // 2 + LinearGradientModeBackwardDiagonal // 3 + ); + TdxGPLinearGradientMode = LinearGradientMode; + +// Pen types + PenAlignment = ( + PenAlignmentCenter, // = 0, + PenAlignmentInset // = 1 + ); + TdxGPPenAlignment = PenAlignment; + +// Brush types + BrushType = ( + BrushTypeSolidColor, // = 0, + BrushTypeHatchFill, // = 1, + BrushTypeTextureFill, // = 2, + BrushTypePathGradient, // = 3, + BrushTypeLinearGradient // = 4 + ); + TdxGPBrushType = BrushType; + +// Pen's Fill types + {$EXTERNALSYM PenType} + PenType = Integer; +const + PenTypeSolidColor = 0; + PenTypeHatchFill = 1; + PenTypeTextureFill = 2; + PenTypePathGradient = 3; + PenTypeLinearGradient = 4; + PenTypeUnknown = -1; + +type + TdxGPPenType = PenType; + +// Status return values from GDI+ methods +type + Status = ( + Ok, + GenericError, + InvalidParameter, + OutOfMemory, + ObjectBusy, + InsufficientBuffer, + NotImplemented, + Win32Error, + WrongState, + Aborted, + FileNotFound, + ValueOverflow, + AccessDenied, + UnknownImageFormat, + FontFamilyNotFound, + FontStyleNotFound, + NotTrueTypeFont, + UnsupportedGdiplusVersion, + GdiplusNotInitialized, + PropertyNotFound, + PropertyNotSupported + ); + TdxGPStatus = Status; + +type + // Represents a dimension in a 2D coordinate system (floating-point coordinates) + PdxGPSizeF = ^TdxGPSizeF; + TdxGPSizeF = packed record + Width : Single; + Height : Single; + end; + + // Represents a dimension in a 2D coordinate system (integer coordinates) + PdxGPSize = ^TdxGPSize; + TdxGPSize = packed record + Width : Integer; + Height : Integer; + end; + + // Represents a location in a 2D coordinate system (floating-point coordinates) + PdxGPPointF = ^TdxGPPointF; + TdxGPPointF = packed record + X : Single; + Y : Single; + end; + TdxGPPointFDynArray = array of TdxGPPointF; + + // Represents a location in a 2D coordinate system (integer coordinates) + PdxGPPoint = ^TdxGPPoint; + TdxGPPoint = packed record + X : Integer; + Y : Integer; + end; + TdxGPPointDynArray = array of TdxGPPoint; + + // Represents a rectangle in a 2D coordinate system (floating-point coordinates) + PdxGPRectF = ^TdxGPRectF; + TdxGPRectF = packed record + X : Single; + Y : Single; + Width : Single; + Height: Single; + end; + TdxGPRectFDynArray = array of TdxGPRectF; + + PdxGPRect = ^TdxGPRect; + TdxGPRect = packed record + X : Integer; + Y : Integer; + Width : Integer; + Height: Integer; + end; + TdxGPRectDynArray = array of TdxGPRect; + + PdxGPImageCodecInfo = ^TdxGPImageCodecInfo; + + TdxGPImageCodecInfo = packed record + Clsid: TGUID; + FormatID: TGUID; + CodecName: PWCHAR; + DllName: PWCHAR; + FormatDescription: PWCHAR; + FilenameExtension: PWCHAR; + MimeType: PWCHAR; + Flags: DWORD; + Version: DWORD; + SigCount: DWORD; + SigSize: DWORD; + SigPattern: PBYTE; + SigMask: PBYTE; + end; + + TEncoderParameter = packed record + Guid : TGUID; // GUID of the parameter + NumberOfValues : ULONG; // Number of the parameter values + Type_ : ULONG; // Value type, like ValueTypeLONG etc. + Value : Pointer; // A pointer to the parameter values + end; + PEncoderParameter = ^TEncoderParameter; + + TEncoderParameters = packed record + Count : UINT; // Number of parameters in this structure + Parameter : array[0..0] of TEncoderParameter; // Parameter values + end; + PEncoderParameters = ^TEncoderParameters; + + DebugEventLevel = ( + DebugEventLevelFatal, + DebugEventLevelWarning + ); + TDebugEventLevel = DebugEventLevel; + + DebugEventProc = procedure(level: DebugEventLevel; message: PChar); stdcall; + + NotificationHookProc = function(out token: ULONG): Status; stdcall; + NotificationUnhookProc = procedure(token: ULONG); stdcall; + + // Input structure for GdiplusStartup + GdiplusStartupInput = packed record + GdiplusVersion : Cardinal; // Must be 1 + DebugEventCallback : DebugEventProc; // Ignored on free builds + SuppressBackgroundThread: BOOL; // FALSE unless you're prepared to call + // the hook/unhook functions properly + SuppressExternalCodecs : BOOL; // FALSE unless you want GDI+ only to use + end; // its internal image codecs. + TGdiplusStartupInput = GdiplusStartupInput; + PGdiplusStartupInput = ^TGdiplusStartupInput; + + // Output structure for GdiplusStartup() + GdiplusStartupOutput = packed record + NotificationHook : NotificationHookProc; + NotificationUnhook: NotificationUnhookProc; + end; + TGdiplusStartupOutput = GdiplusStartupOutput; + PGdiplusStartupOutput = ^TGdiplusStartupOutput; + +// Private GDI+ classes for internal type checking + GpGraphics = Pointer; + ARGB = DWORD; + PARGB = ^ARGB; + + GpBrush = Pointer; + GpTexture = Pointer; + GpSolidFill = Pointer; + GpLineGradient = Pointer; + GpPathGradient = Pointer; + GpHatch = Pointer; + GpPen = Pointer; + GpImage = Pointer; + GpBitmap = Pointer; + GpCachedBitmap = Pointer; + + GPStatus = TdxGPStatus; + GpFillMode = TdxGPFillMode; + GpWrapMode = TdxGPWrapMode; + GpUnit = TdxGPUnit; + GpPointF = PdxGPPointF; + GpPoint = PdxGPPoint; + GpRectF = PdxGPRectF; + GpRect = PdxGPRect; + GpSizeF = PdxGPSizeF; + GpHatchStyle = TdxGPHatchStyle; + GpDashStyle = TdxGPDashStyle; + GpPenAlignment = TdxGPPenAlignment; + GpPenType = TdxGPPenType; + GpBrushType = TdxGPBrushType; + + BitmapData = packed record + Width : UINT; + Height : UINT; + Stride : Integer; + PixelFormat : Integer; + Scan0 : Pointer; + Reserved : UINT; + end; + TBitmapData = BitmapData; + PBitmapData = ^TBitmapData; + +type + TdxProc = procedure; + + TdxUnitsLoader = class + protected + FinalizeList: TList; + InitializeList: TList; + public + constructor Create(); + destructor Destroy; override; + procedure AddUnit(const AInitializeProc, AFinalizeProc: Pointer); + procedure RemoveUnit(const AFinalizeProc: Pointer); + procedure Finalize; + procedure Initialize; + end; + +var + // codecs + PNGCodec: TGUID; + // GDI+ Memory managment methods + GdipAlloc: function(size: ULONG): pointer; stdcall; + GdipFree: procedure(ptr: pointer); stdcall; + // GDI+ initialization/finalization methods + GdiplusStartup: function(out token: DWORD; const input: GdiplusStartupInput; output: PGdiplusStartupOutput): Status; stdcall; + GdiplusShutdown: procedure(token: DWORD); stdcall; + // GDI+ Brush methods + GdipCloneBrush: function(brush :GpBrush; var clonebrush :GpBrush) :GPStatus; stdcall; + GdipDeleteBrush: function(brush :GpBrush) :GPStatus; stdcall; + GdipGetBrushType: function(brush :GpBrush; var bt :GpBrushType) :GPStatus; stdcall; + // GDI+ Solid Brush methods + GdipCreateSolidFill: function(color :ARGB; var brush :GpSolidFill) :GPStatus; stdcall; + GdipSetSolidFillColor: function(brush :GpSolidFill; color :ARGB) :GPStatus; stdcall; + GdipGetSolidFillColor: function(brush :GpSolidFill; var color :ARGB) :GPStatus; stdcall; + // GDI+ Gradient Brush methods + GdipCreateLineBrushFromRectI: function(const rect :GpRect; color1,color2 :ARGB; mode :LinearGradientMode; + wrapmode :GpWrapMode; var lineGradient :GpLineGradient) :GPStatus; stdcall; + GdipGetLineRectI: function(brush :GpLineGradient; var rect :GpRect) :GPStatus; stdcall; + GdipSetLineColors: function(brush :GpLineGradient; color1,color2 :ARGB) :GPStatus; stdcall; + GdipGetLineColors: function(brush :GpLineGradient; colors :PARGB) :GPStatus; stdcall; + GdipSetLineWrapMode: function(brush :GpLineGradient; wrapmode :GpWrapMode) :GPStatus; stdcall; + GdipGetLineWrapMode: function(brush :GpLineGradient; wrapmode :GpWrapMode) :GPStatus; stdcall; + // GDI+ Hatch Brush methods + GdipCreateHatchBrush: function(hatchstyle :GpHatchStyle; forecol,backcol :ARGB; var brush :GpHatch) :GPStatus; stdcall; + GdipGetHatchStyle: function(brush :GpHatch; var hatchstyle :GpHatchStyle) :GPStatus; stdcall; + GdipGetHatchForegroundColor: function(brush :GpHatch; var forecol :ARGB) :GPStatus; stdcall; + GdipGetHatchBackgroundColor: function(brush :GpHatch; var backcol :ARGB) :GPStatus; stdcall; + // GDI+ Pen methods + GdipCreatePen1: function(color :ARGB; width :single; u :GpUnit; var pen :GpPen) :GPStatus; stdcall; + GdipCreatePen2: function(brush :GpBrush; width :single; u :GpUnit; var pen :GpPen) :GPStatus; stdcall; + GdipClonePen: function(pen :GpPen; var clonepen :GpPen) :GPStatus; stdcall; + GdipDeletePen: function(pen :GpPen) :GPStatus; stdcall; + GdipGetPenFillType: function(pen :GpPen; var penType :GpPenType) :GPStatus; stdcall; + GdipSetPenBrushFill: function(pen :GpPen; brush :GpBrush) :GPStatus; stdcall; + GdipGetPenBrushFill: function(pen :GpPen; var brush :GpBrush) :GPStatus; stdcall; + GdipSetPenColor: function(pen :GpPen; color :ARGB) :GPStatus; stdcall; + GdipGetPenColor: function(pen :GpPen; var color :ARGB) :GPStatus; stdcall; + GdipSetPenMode: function(pen :GpPen; penMode :GpPenAlignment) :GPStatus; stdcall; + GdipGetPenMode: function(pen :GpPen; var penMode :GpPenAlignment) :GPStatus; stdcall; + GdipSetPenWidth: function(pen :GpPen; width :single) :GPStatus; stdcall; + GdipGetPenWidth: function(pen :GpPen; var width :single) :GPStatus; stdcall; + // GDI+ Graphis methods + GdipCreateFromHDC: function(hdc :HDC; var graphics :GpGraphics) :GPStatus; stdcall; + GdipDeleteGraphics: function(graphics :GpGraphics) :GPStatus; stdcall; + GdipGetDC: function(graphics :GpGraphics; var hdc :HDC) :GPStatus; stdcall; + GdipReleaseDC: function(graphics :GpGraphics; hdc :HDC) :GPStatus; stdcall; + GdipGraphicsClear: function(graphics :GpGraphics; color :ARGB) :GPStatus; stdcall; + GdipDrawLineI: function(graphics :GpGraphics; pen :GpPen; x1,y1,x2,y2 :integer) :GPStatus; stdcall; + GdipFillRectangleI: function(graphics :GpGraphics; brush :GpBrush; x,y,width,height :integer) :GPStatus; stdcall; + GdipDrawArcI: function(graphics :GpGraphics; pen :GpPen; x,y,width,height :integer; + startAngle,sweepAngle :single) :GPStatus; stdcall; + GdipDrawBezierI: function(graphics :GpGraphics; pen :GpPen; x1,y1,x2,y2,x3,y3,x4,y4 :integer) :GPStatus; stdcall; + GdipDrawRectangleI: function(graphics :GpGraphics; pen :GpPen; x,y,width,height :integer) :GPStatus; stdcall; + GdipDrawEllipseI: function(graphics :GpGraphics; pen :GpPen; x,y,width,height :integer) :GPStatus; stdcall; + GdipDrawPieI: function(graphics :GpGraphics; pen :GpPen; x,y,width,height :integer; + startAngle,sweepAngle :single) :GPStatus; stdcall; + GdipDrawPolygonI: function(graphics :GpGraphics; pen :GpPen; const points :GpPoint; + count :integer) :GPStatus; stdcall; + GdipDrawCurve2I: function(graphics :GpGraphics; pen :GpPen; const points :GpPoint; + count :integer; tension :single) :GPStatus; stdcall; + GdipDrawClosedCurve2I: function(graphics :GpGraphics; pen :GpPen; const points :GpPoint; + count :integer; tension :single) :GPStatus; stdcall; + GdipFillPolygonI: function(graphics :GpGraphics; brush :GpBrush; const points :GpPoint; + count :integer; fillmode :GpFillMode) :GPStatus; stdcall; + GdipFillEllipseI: function(graphics :GpGraphics; brush :GpBrush; x,y,width,height :integer) :GPStatus; stdcall; + GdipFillPieI: function(graphics :GpGraphics; brush :GpBrush; x,y,width,height :integer; + startAngle,sweepAngle :single) :GPStatus; stdcall; + GdipFillClosedCurveI: function(graphics :GpGraphics; brush :GpBrush; const points :GpPoint; + count :integer) :GPStatus; stdcall; + // added from MSN + GdipLoadImageFromStream: function(stream: IStream; var image: GpImage): GPStatus; stdcall; + GdipCreateHBITMAPFromBitmap: function(image: GpBitmap; var bitmap: HBitmap; color :ARGB): GPStatus; stdcall; + GdipCreateBitmapFromFile: function(filename: PWideChar; var bitmap: GpBitmap): GPStatus; stdcall; + GdipCreateBitmapFromStream: function(stream: IStream; var bitmap: GpBitmap): GPStatus; stdcall; + GdipCreateBitmapFromStreamICM: function (stream: ISTREAM; out bitmap: GpBitmap): GPStatus; stdcall; + GdipLoadImageFromFile: function(filename: PWideChar; var image: GpImage): GPStatus; stdcall; + GdipGetImageDimension: function(image: GpImage; var weidth, height: Single): GPStatus; stdcall; + GdipDrawImageRectI: function(graphics: GpGraphics; image: GpImage; + x, y: Integer; width, height: Integer): GPStatus; stdcall; + GdipDisposeImage: function(image: GpImage): GPStatus; stdcall; + GdipGetImageEncodersSize: function(out numEncoders: Integer; out size: Integer): GPStatus; stdcall; + GdipGetImageEncoders: function(numEncoders: Integer; size: Integer; encoders: PdxGPImageCodecInfo): GPStatus; stdcall; + GdipGetEncoderParameterListSize: function(image: GpImage; clsidEncoder: PGUID; out size: UINT): GPStatus; stdcall; + GdipGetEncoderParameterList: function(image: GpImage; clsidEncoder: PGUID; + size: UINT; buffer: PENCODERPARAMETERS): GPStatus; stdcall; + GdipCreateBitmapFromGdiDib: function (gdiBitmapInfo: PBitmapInfo; + gdiBitmapData: Pointer; out bitmap: GpBitmap): GPStatus; stdcall; + GdipCreateBitmapFromScan0: function (width: Integer; height: Integer; + stride: Integer; format: integer; scan0: PBYTE; + out bitmap: GpImage): GPStatus; stdcall; + GdipBitmapLockBits: function (bitmap: GpBitmap; rect: GPRECT; flags: UINT; + format: Integer; lockedBitmapData: PBITMAPDATA): GPStatus; stdcall; + GdipBitmapUnlockBits: function(bitmap: GpBitmap; + lockedBitmapData: PBITMAPDATA): GPStatus; stdcall; + GdipDrawImageRectRectI: function(graphics: GpGraphics; image: GpImage; + dstx, dsty, dstwidth, dstheight: Integer; srcx, srcy, srcwidth, srcheight: Integer; + srcUnit: GPUNIT; imageAttributes: Pointer; callback: TgpImageAbort; callbackData: Pointer): GPStatus; stdcall; + GdipDrawImageRectRect: function(graphics: GPGRAPHICS; image: GPIMAGE; + dstx: Single; dsty: Single; dstwidth: Single; dstheight: Single; + srcx: Single; srcy: Single; srcwidth: Single; srcheight: Single; + srcUnit: GPUNIT; imageAttributes: Pointer; callback: TgpImageAbort; callbackData: Pointer): GPSTATUS; stdcall; + GdipDrawImagePointRect: function(graphics: GPGRAPHICS; image: GPIMAGE; + x: Single; y: Single; srcx: Single; srcy: Single; srcwidth: Single; + srcheight: Single; srcUnit: GPUNIT): GPSTATUS; stdcall; + GdipCloneImage: function(image: GPIMAGE; out cloneImage: GPIMAGE): GPSTATUS; stdcall; + + //lcm + GdipSetInterpolationMode: function(graphics: GpGraphics; imode: Integer): GpStatus; stdcall; + GdipGetInterpolationMode: function(graphics: GpGraphics; out imode: Integer): GpStatus; stdcall; + GdipCreateCachedBitmap: function(bitmap: GpBitmap; graphics: GpGraphics; out cachedBitmap: GpCachedBitmap): GpStatus; stdcall; + GdipDeleteCachedBitmap: function(cachedBitmap: GpCachedBitmap): GpStatus; stdcall; + GdipDrawCachedBitmap: function(graphics: GpGraphics; cachedBitmap: GpCachedBitmap; x, y: Integer): GpStatus; stdcall; + GdipCreateBitmapFromGraphics: function(width, height: Integer; target: GpGraphics; var bitmap: GpBitmap): GpStatus; stdcall; + GdipGetImageGraphicsContext: function(image: GpImage; out graphics: GpGraphics): GpStatus; stdcall; + GdipGetImageWidth: function(image: GpImage; out width: Integer): GpStatus; stdcall; + GdipGetImageHeight: function(image: GpImage; out height: Integer): GpStatus; stdcall; + GdipSetCompositingMode: function(graphics: GpGraphics; cmode: Integer): GpStatus; stdcall; + GdipGetCompositingMode: function(graphics: GpGraphics; out cmode: Integer): GpStatus; stdcall; + GdipSetCompositingQuality: function(graphics: GpGraphics; cq: Integer): GpStatus; stdcall; + GdipGetCompositingQuality: function(graphics: GpGraphics; out cq: Integer): GpStatus; stdcall; + GdipSetSmoothingMode: function(graphics: GpGraphics; sm: Integer): GpStatus; stdcall; + GdipGetSmoothingMode: function(graphics: GpGraphics; out sm: Integer): GpStatus; stdcall; + GdipCloneBitmapAreaI: function(x: Integer; y: Integer; width: Integer; + height: Integer; format: Cardinal; srcBitmap: GPBITMAP; out dstBitmap: GPBITMAP): GPSTATUS; stdcall; + + {$EXTERNALSYM GdipBitmapUnlockBits} + + GdipSaveImageToStream: function(image: GpImage; stream: ISTREAM; clsidEncoder: PGUID; encoderParams: pointer): GPStatus; stdcall; + GdipCreateBitmapFromHBITMAP: function(hbm: HBITMAP; hpal: HPALETTE; out bitmap: GpImage): GPStatus; stdcall; + +function MakePoint(X, Y: Integer): TdxGPPoint; overload; +function MakePoint(X, Y: Single): TdxGPPointF; overload; +function MakeRect(x, y, width, height: Integer): TdxGPRect; overload; +function MakeRect(location: TdxGPPoint; size: TdxGPSize): TdxGPRect; overload; +function MakeRect(Rect: TRect): TdxGPRect; overload; +function MakeRect(x, y, width, height: Single): TdxGPRectF; overload; +function MakeRect(location: TdxGPPointF; size: TdxGPSizeF): TdxGPRectF; overload; +function MakeSize(Width, Height: Single): TdxGPSizeF; overload; +function MakeSize(Width, Height: Integer): TdxGPSize; overload; + +// image conversion +function DifferentImage2Bitmap(AStream: TStream): TBitmap; overload; +function DifferentImage2Bitmap(const AFileName: string): TBitmap; overload; +procedure Bitmap2PNG(ABitmap: TBitmap; AStream: TStream); overload; +procedure Bitmap2PNG(ABitmap: TBitmap; const AFileName: string); overload; +// codecs +function GetCodecID(const CodecName: string; out Clsid: TGUID): GPStatus; +procedure CheckPngCodec; +// check errors +procedure GdipCheck(AStatus: Boolean); overload; +procedure GdipCheck(AStatus: GPStatus); overload; + + // CLR + +procedure dxInitializeGDIPlus; stdcall; +procedure dxFinalizeGDIPlus; stdcall; + +function dxUnitsLoader: TdxUnitsLoader; +function CheckGdiPlus: Boolean; + +resourcestring + scxGdipInvalidOperation = 'Invalid operation in GDI+'; + +implementation + +const + GDIPlusLibraryName = 'gdiplus.dll'; + +var + FGDIPlusLibrary: Integer; + FGDIPlusToken: DWORD; + FGdiPlusHook: TGdiplusStartupOutput; + FGDIPresent: Boolean; + FGDIInitialized: Boolean; + UnitsLoader: TdxUnitsLoader; + +function IsDLL: Boolean; +begin + Result := ModuleIsLib and not ModuleIsPackage; +end; + +{ TdxLoader } + +constructor TdxUnitsLoader.Create(); +begin + FinalizeList := TList.Create; + InitializeList := TList.Create; +end; + +destructor TdxUnitsLoader.Destroy; +begin + Finalize; + FinalizeList.Free; + InitializeList.Free; + inherited Destroy; +end; + +procedure TdxUnitsLoader.AddUnit(const AInitializeProc, AFinalizeProc: Pointer); +var + AProc: TdxProc; +begin + if AInitializeProc <> nil then + begin + AProc := AInitializeProc; + if not IsDLL then + begin + FGDIInitialized := True; + AProc; + end + else + InitializeList.Add(AInitializeProc); + end; + if AFinalizeProc <> nil then + FinalizeList.Add(AFinalizeProc); +end; + +procedure TdxUnitsLoader.RemoveUnit(const AFinalizeProc: Pointer); +var + AProc: TdxProc; +begin + AProc := AFinalizeProc; + if (FinalizeList.Remove(AFinalizeProc) >=0) and (AFinalizeProc <> nil) then + AProc; +end; + +procedure TdxUnitsLoader.Finalize; +var + I: Integer; + AProc: TdxProc; +begin + if FGDIInitialized then + for I := FinalizeList.Count - 1 downto 0 do + begin + AProc := TdxProc(FinalizeList[I]); + if Assigned(AProc) then AProc; + end; + FGDIInitialized := False; + FinalizeList.Clear; +end; + +procedure TdxUnitsLoader.Initialize; +var + I: Integer; + AProc: TdxProc; +begin + for I := 0 to InitializeList.Count - 1 do + begin + AProc := TdxProc(InitializeList[I]); + if Assigned(AProc) then AProc; + end; + InitializeList.Clear; + FGDIInitialized := True; +end; + +{ GDI+ loading } + +procedure GdiPlusLoad; +const + DefaultStartup: GdiplusStartupInput = + (GdiplusVersion: 1; + DebugEventCallback: nil; + SuppressBackgroundThread: True; + SuppressExternalCodecs: False); + + function LoadGdiPlusMethod(const ProcName: string): Pointer; + begin + Result := nil; + if FGDIPresent then + Result := GetProcAddress(FGDIPlusLibrary, PChar(ProcName)); + FGDIPresent := Result <> nil; + end; + +begin + if FGDIPresent then + Exit; + FGDIPlusLibrary := SafeLoadLibrary(GDIPlusLibraryName); + FGDIPresent := FGDIPlusLibrary <> 0; + if FGDIPresent then + begin + // GDI+ Memory managment methods loading + GdipAlloc := LoadGdiPlusMethod('GdipAlloc'); + GdipFree := LoadGdiPlusMethod('GdipFree'); + // GDI+ initialization/finalization methods loading + GdiplusStartup := LoadGdiPlusMethod('GdiplusStartup'); + GdiplusShutdown := LoadGdiPlusMethod('GdiplusShutdown'); + // GDI+ Brush methods loading + GdipCloneBrush := LoadGdiPlusMethod('GdipCloneBrush'); + GdipDeleteBrush := LoadGdiPlusMethod('GdipDeleteBrush'); + GdipGetBrushType := LoadGdiPlusMethod('GdipGetBrushType'); + // GDI+ Solid Brush methods loading + GdipCreateSolidFill := LoadGdiPlusMethod('GdipCreateSolidFill'); + GdipSetSolidFillColor := LoadGdiPlusMethod('GdipSetSolidFillColor'); + GdipGetSolidFillColor := LoadGdiPlusMethod('GdipGetSolidFillColor'); + // GDI+ Gradient Brush methods loading + GdipCreateLineBrushFromRectI := LoadGdiPlusMethod('GdipCreateLineBrushFromRectI'); + GdipGetLineRectI := LoadGdiPlusMethod('GdipGetLineRectI'); + GdipSetLineColors := LoadGdiPlusMethod('GdipSetLineColors'); + GdipGetLineColors := LoadGdiPlusMethod('GdipGetLineColors'); + GdipSetLineWrapMode := LoadGdiPlusMethod('GdipSetLineWrapMode'); + GdipGetLineWrapMode := LoadGdiPlusMethod('GdipGetLineWrapMode'); + // GDI+ Hatch Brush methods loading + GdipCreateHatchBrush := LoadGdiPlusMethod('GdipCreateHatchBrush'); + GdipGetHatchStyle := LoadGdiPlusMethod('GdipGetHatchStyle'); + GdipGetHatchForegroundColor := LoadGdiPlusMethod('GdipGetHatchForegroundColor'); + GdipGetHatchBackgroundColor := LoadGdiPlusMethod('GdipGetHatchBackgroundColor'); + // GDI+ Pen methods loading + GdipCreatePen1 := LoadGdiPlusMethod('GdipCreatePen1'); + GdipCreatePen2 := LoadGdiPlusMethod('GdipCreatePen2'); + GdipClonePen := LoadGdiPlusMethod('GdipClonePen'); + GdipDeletePen := LoadGdiPlusMethod('GdipDeletePen'); + GdipGetPenFillType := LoadGdiPlusMethod('GdipGetPenFillType'); + GdipSetPenBrushFill := LoadGdiPlusMethod('GdipSetPenBrushFill'); + GdipGetPenBrushFill := LoadGdiPlusMethod('GdipGetPenBrushFill'); + GdipSetPenColor := LoadGdiPlusMethod('GdipSetPenColor'); + GdipGetPenColor := LoadGdiPlusMethod('GdipGetPenColor'); + GdipSetPenMode := LoadGdiPlusMethod('GdipSetPenMode'); + GdipGetPenMode := LoadGdiPlusMethod('GdipGetPenMode'); + GdipSetPenWidth := LoadGdiPlusMethod('GdipSetPenWidth'); + GdipGetPenWidth := LoadGdiPlusMethod('GdipGetPenWidth'); + // GDI+ Graphis methods loading + GdipCreateFromHDC := LoadGdiPlusMethod('GdipCreateFromHDC'); + GdipDeleteGraphics := LoadGdiPlusMethod('GdipDeleteGraphics'); + GdipGetDC := LoadGdiPlusMethod('GdipGetDC'); + GdipReleaseDC := LoadGdiPlusMethod('GdipReleaseDC'); + GdipGraphicsClear := LoadGdiPlusMethod('GdipGraphicsClear'); + GdipDrawLineI := LoadGdiPlusMethod('GdipDrawLineI'); + GdipFillRectangleI := LoadGdiPlusMethod('GdipFillRectangleI'); + GdipDrawArcI := LoadGdiPlusMethod('GdipDrawArcI'); + GdipDrawBezierI := LoadGdiPlusMethod('GdipDrawBezierI'); + GdipDrawRectangleI := LoadGdiPlusMethod('GdipDrawRectangleI'); + GdipDrawEllipseI := LoadGdiPlusMethod('GdipDrawEllipseI'); + GdipDrawPieI := LoadGdiPlusMethod('GdipDrawPieI'); + GdipDrawPolygonI := LoadGdiPlusMethod('GdipDrawPolygonI'); + GdipDrawCurve2I := LoadGdiPlusMethod('GdipDrawCurve2I'); + GdipDrawClosedCurve2I := LoadGdiPlusMethod('GdipDrawClosedCurve2I'); + GdipFillPolygonI := LoadGdiPlusMethod('GdipFillPolygonI'); + GdipFillEllipseI := LoadGdiPlusMethod('GdipFillEllipseI'); + GdipFillPieI := LoadGdiPlusMethod('GdipFillPieI'); + GdipFillClosedCurveI := LoadGdiPlusMethod('GdipFillClosedCurveI'); + // added from MSN + GdipLoadImageFromStream := LoadGdiPlusMethod('GdipLoadImageFromStream'); + GdipCreateBitmapFromFile := LoadGdiPlusMethod('GdipCreateBitmapFromFile'); + GdipCreateBitmapFromStream := LoadGdiPlusMethod('GdipCreateBitmapFromStream'); + GdipCreateBitmapFromStreamICM := LoadGdiPlusMethod('GdipCreateBitmapFromStreamICM'); + GdipCreateHBITMAPFromBitmap := LoadGdiPlusMethod('GdipCreateHBITMAPFromBitmap'); + GdipLoadImageFromFile := LoadGdiPlusMethod('GdipLoadImageFromFile'); + GdipGetImageDimension := LoadGdiPlusMethod('GdipGetImageDimension'); + GdipDrawImageRectI := LoadGdiPlusMethod('GdipDrawImageRectI'); + GdipDisposeImage := LoadGdiPlusMethod('GdipDisposeImage'); + GdipGetImageEncodersSize := LoadGdiPlusMethod('GdipGetImageEncodersSize'); + GdipGetImageEncoders := LoadGdiPlusMethod('GdipGetImageEncoders'); + GdipSaveImageToStream := LoadGdiPlusMethod('GdipSaveImageToStream'); + GdipCreateBitmapFromHBITMAP := LoadGdiPlusMethod('GdipCreateBitmapFromHBITMAP'); + GdipGetEncoderParameterListSize := LoadGdiPlusMethod('GdipGetEncoderParameterListSize'); + GdipGetEncoderParameterList := LoadGdiPlusMethod('GdipGetEncoderParameterList'); + GdipCreateBitmapFromGdiDib := LoadGdiPlusMethod('GdipCreateBitmapFromGdiDib'); + GdipCreateBitmapFromScan0 := LoadGdiPlusMethod('GdipCreateBitmapFromScan0'); + GdipBitmapLockBits := LoadGdiPlusMethod('GdipBitmapLockBits'); + GdipBitmapUnlockBits := LoadGdiPlusMethod('GdipBitmapUnlockBits'); + GdipDrawImageRectRectI := LoadGdiPlusMethod('GdipDrawImageRectRectI'); + GdipDrawImageRectRect := LoadGdiPlusMethod('GdipDrawImageRectRect'); + GdipDrawImagePointRect := LoadGdiPlusMethod('GdipDrawImagePointRect'); + GdipCloneImage := LoadGdiPlusMethod('GdipCloneImage'); + //lcm + GdipSetInterpolationMode := LoadGdiPlusMethod('GdipSetInterpolationMode'); + GdipGetInterpolationMode := LoadGdiPlusMethod('GdipGetInterpolationMode'); + GdipCreateCachedBitmap := LoadGdiPlusMethod('GdipCreateCachedBitmap'); + GdipDeleteCachedBitmap := LoadGdiPlusMethod('GdipDeleteCachedBitmap'); + GdipDrawCachedBitmap := LoadGdiPlusMethod('GdipDrawCachedBitmap'); + GdipCreateBitmapFromGraphics := LoadGdiPlusMethod('GdipCreateBitmapFromGraphics'); + GdipGetImageGraphicsContext := LoadGdiPlusMethod('GdipGetImageGraphicsContext'); + GdipGetImageWidth := LoadGdiPlusMethod('GdipGetImageWidth'); + GdipGetImageHeight := LoadGdiPlusMethod('GdipGetImageHeight'); + GdipSetCompositingMode := LoadGdiPlusMethod('GdipSetCompositingMode'); + GdipGetCompositingMode := LoadGdiPlusMethod('GdipGetCompositingMode'); + GdipSetCompositingQuality := LoadGdiPlusMethod('GdipSetCompositingQuality'); + GdipGetCompositingQuality := LoadGdiPlusMethod('GdipGetCompositingQuality'); + GdipSetSmoothingMode := LoadGdiPlusMethod('GdipSetSmoothingMode'); + GdipGetSmoothingMode := LoadGdiPlusMethod('GdipGetSmoothingMode'); + GdipCloneBitmapAreaI := LoadGdiPlusMethod('GdipCloneBitmapAreaI'); + // + if (GdiPlusStartup(FGDIPlusToken, DefaultStartup, @FGdiPlusHook) <> OK) or + (FGdiPlusHook.NotificationHook(FGDIPlusToken) <> Ok) then + begin + FGDIPresent := False; + FillChar(FGdiPlusHook, SizeOf(FGdiPlusHook), 0); + end; + end; +end; + +function CheckGdiPlus: Boolean; +begin + if not FGDIPresent then + GdiPlusLoad; + Result := FGDIPresent; +end; + +function dxUnitsLoader: TdxUnitsLoader; +begin + if UnitsLoader = nil then + UnitsLoader := TdxUnitsLoader.Create; + Result := UnitsLoader; +end; + +procedure dxInitializeGDIPlus; +begin + dxUnitsLoader.Initialize; +end; + +procedure dxFinalizeGDIPlus; +begin + dxUnitsLoader.Finalize; +end; + +procedure GdiPlusUnload; +begin + if FGDIPresent then + begin + FGdiPlusHook.NotificationUnhook(FGDIPlusToken); + GdiPlusShutdown(FGDIPlusToken); + end; + if FGDIPlusLibrary <> 0 then + FreeLibrary(FGDIPlusLibrary); + FGDIPresent := False; +end; + +{ TGdiplusBase } + +class function TdxGPBase.NewInstance: TObject; +begin + Result := InitInstance(GdipAlloc(ULONG(instanceSize))); +end; + +procedure TdxGPBase.FreeInstance; +begin + CleanupInstance; + GdipFree(Self); +end; + +{ TdxGPPoint } + +function MakePoint(X, Y: Integer): TdxGPPoint; +begin + result.X := X; + result.Y := Y; +end; + +function MakePoint(X, Y: Single): TdxGPPointF; +begin + Result.X := X; + result.Y := Y; +end; + +{ TdxGPSizeF } + +function MakeSize(Width, Height: Single): TdxGPSizeF; +begin + result.Width := Width; + result.Height := Height; +end; + +function MakeSize(Width, Height: Integer): TdxGPSize; +begin + result.Width := Width; + result.Height := Height; +end; + +{ TdxGPRectF } + +function MakeRect(x, y, width, height: Single): TdxGPRectF; overload; +begin + Result.X := x; + Result.Y := y; + Result.Width := width; + Result.Height := height; +end; + +function MakeRect(location: TdxGPPointF; size: TdxGPSizeF): TdxGPRectF; overload; +begin + Result.X := location.X; + Result.Y := location.Y; + Result.Width := size.Width; + Result.Height := size.Height; +end; + +{ TdxGPRect } + +function MakeRect(x, y, width, height: Integer): TdxGPRect; overload; +begin + Result.X := x; + Result.Y := y; + Result.Width := width; + Result.Height := height; +end; + +function MakeRect(location: TdxGPPoint; size: TdxGPSize): TdxGPRect; overload; +begin + Result.X := location.X; + Result.Y := location.Y; + Result.Width := size.Width; + Result.Height := size.Height; +end; + +function MakeRect(Rect: TRect): TdxGPRect; overload; +begin + Result.X := Rect.Left; + Result.Y := Rect.Top; + Result.Width := Rect.Right - Rect.Left; + Result.Height := Rect.Bottom - Rect.Top; +end; + +function GetCodecID(const CodecName: string; out Clsid: TGUID): GPStatus; +var + Count, Size, Index: Integer; + CodecInfo, StartInfo: PdxGPImageCodecInfo; +begin + Count := 0; + Size := 0; + Result := GenericError; + if not CheckGdiPlus or (GdipGetImageEncodersSize(Count, Size) <> Ok) or (Size <= 0) then Exit; + GetMem(StartInfo, Size); + CodecInfo := StartInfo; + try + if GdipGetImageEncoders(Count, Size, CodecInfo) = Ok then + for Index := 0 to Count - 1 do + begin + if SameText(CodecInfo^.MimeType, CodecName) then + begin + Clsid := CodecInfo^.Clsid; + Result := Ok; + Break; + end; + Inc(Integer(CodecInfo), SizeOf(TdxGPImageCodecInfo)); + end; + finally + FreeMem(StartInfo, Size); + end; +end; + +procedure CheckPngCodec; +begin + if (PngCodec.D1 = 0) and (PngCodec.D2 = 0) and (PngCodec.D3 = 0) then + GetCodecID('image/png', PngCodec); +end; + +procedure GdipCheck(AStatus: GPStatus); +begin + GdipCheck(AStatus = Ok); +end; + +procedure GdipCheck(AStatus: Boolean); +begin + Assert(AStatus, scxGdipInvalidOperation); +end; + +function DifferentImage2Bitmap(AStream: TStream): TBitmap; +var + Data: HGlobal; + DataPtr: Pointer; + Image: GpImage; + AccessStream: IStream; + Handle: HBitmap; + Header: TBitmapFileHeader; +begin + Result := TBitmap.Create; + try + if AStream.Size > SizeOf(Header) then + begin + AStream.ReadBuffer(Header, SizeOf(Header)); + if Header.bfType = $4D42 then + begin + AStream.Position := 0; + Result.LoadFromStream(AStream); + Result.PixelFormat := pf32Bit; + Exit; + end; + end; + if not CheckGdiPlus then Exit; + Data := GlobalAlloc(GMEM_MOVEABLE+GMEM_DDESHARE, AStream.Size); + try + DataPtr := GlobalLock(Data); + try + AStream.Position := 0; + AStream.Read(DataPtr^, AStream.Size); + Image := nil; + GdipCheck(CreateStreamOnHGlobal(Data, False, AccessStream) = s_OK); + GdipCheck(GdipCreateBitmapFromStream(AccessStream, Image)); + GdipCheck(GdipCreateHBITMAPFromBitmap(Image, Handle, 0)); + Result.Handle := Handle; + GdipCheck(GdipDisposeImage(Image)); + + finally + GlobalUnlock(Data); + AccessStream := nil; + end; + finally + GlobalFree(Data); + end; + Result.PixelFormat := pf32Bit; + except + Result.Free; + end; +end; + +function DifferentImage2Bitmap(const AFileName: string): TBitmap; overload; +var + AStream: TStream; +begin + AStream := TFileStream.Create(AFileName, fmOpenRead or fmShareDenyNone); + try + Result := DifferentImage2Bitmap(AStream); + finally + AStream.Free; + end; +end; + +procedure Bitmap2PNG(ABitmap: TBitmap; AStream: TStream); +var + Image: GpImage; + Picture: Pointer; + RowSize, Row: Integer; +const + PixelFormat32bppPARGB = $E200B; +begin + CheckPngCodec; + Picture := nil; + try + if ABitmap.PixelFormat = pf32bit then + begin + RowSize := ABitmap.Width * 4; + GetMem(Picture, RowSize * ABitmap.Height); + for Row := 0 to ABitmap.Height - 1 do + Move(ABitmap.ScanLine[Row]^, PByteArray(Picture)^[Row * RowSize], RowSize); + GdipCheck(GdipCreateBitmapFromScan0(ABitmap.Width, + ABitmap.Height, ABitmap.Width * 4, PixelFormat32bppPARGB, Picture, Image)); + end + else + GdipCheck(GdipCreateBitmapFromHBITMAP(ABitmap.Handle, ABitmap.Palette, Image)); + GdipCheck(GdipSaveImageToStream(Image, + TStreamAdapter.Create(AStream, soReference), @PngCodec, nil)); + GdipCheck(GdipDisposeImage(Image)); + finally + FreeMem(Picture); + end; +end; + +procedure Bitmap2PNG(ABitmap: TBitmap; const AFileName: string); +var + AStream: TStream; +begin + AStream := TFileStream.Create(AFileName, fmCreate); + try + Bitmap2PNG(ABitmap, AStream); + finally + AStream.Free; + end; +end; + +procedure RegisterAssistants; +begin + FGDIPresent := False; +end; + +procedure UnregisterAssistants; +begin + GdiPlusUnload; +end; + +initialization + dxUnitsLoader.AddUnit(@RegisterAssistants, @UnregisterAssistants); + +finalization + if FGDIPresent and IsDLL and (UnitsLoader.FinalizeList.Count > 0) then + raise Exception.Create('Need call dxFinalizeGDIPlus before free library!'); + FreeAndNil(UnitsLoader); + +end. + diff --git a/official/x.35/ExpressGDI+ Library/Sources/dxGDIPlusClasses.pas b/official/x.35/ExpressGDI+ Library/Sources/dxGDIPlusClasses.pas new file mode 100644 index 00000000..adb14d65 --- /dev/null +++ b/official/x.35/ExpressGDI+ Library/Sources/dxGDIPlusClasses.pas @@ -0,0 +1,1163 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ GDI+ Library } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE GDIPLUS LIBRARY AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxGDIPlusClasses; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, SysUtils, Graphics, dxGDIPlusAPI, ActiveX; + +type + TdxGPBrush = class(TdxGPBase) + private + FNativeBrush: GpBrush; + FLastResult: TdxGPStatus; + protected + constructor CreateNative (nativeBrush: GpBrush; AStatus: Status); + procedure SetNativeBrush(ANativeBrush: GpBrush); + function SetStatus(AStatus: TdxGPStatus): TdxGPStatus; + public + constructor Create; + destructor Destroy; override; + function Clone: TdxGPBrush; virtual; + function GetType: BrushType; + function GetLastStatus: Status; + end; + + TdxGPSolidBrush = class(TdxGPBrush) + private + function GetColor: DWORD; + procedure SetColor(const Value: DWORD); + public + constructor Create; overload; + constructor Create(color: TColor); overload; + property Color: DWORD read GetColor write SetColor; + end; + + TdxGPTextureBrush = class(TdxGPBrush) + end; + + TdxGPLinearGradientBrush = class(TdxGPBrush) + private + procedure SetWrapMode(const Value: TdxGPWrapMode); + function GetWrapMode: TdxGPWrapMode; + public + constructor Create; overload; + constructor Create(rect: TdxGPRect; color1, color2: DWORD; mode: TdxGPLinearGradientMode); overload; + function SetLinearColors(color1, color2: DWORD): TdxGPStatus; + function GetLinearColors(out color1, color2: DWORD): TdxGPStatus; + function GetRectangle: TdxGPRect; overload; + property WrapMode: TdxGPWrapMode read GetWrapMode write SetWrapMode; + end; + + TdxGPHatchBrush = class(TdxGPBrush) + public + constructor Create; overload; + constructor Create(hatchStyle: TdxGPHatchStyle; foreColor: DWORD; backColor: DWORD); overload; + function GetHatchStyle: TdxGPHatchStyle; + function GetForegroundColor: DWORD; + function GetBackgroundColor: DWORD; + end; + + TdxGPPen = class(TdxGPBase) + private + FNativePen: GpPen; + FLastResult: TdxGPStatus; + + function GetAlignment: TdxGPPenAlignment; + function GetColor: DWORD; + function GetBrush: TdxGPBrush; + function GetWidth: Single; + procedure SetAlignment(const Value: TdxGPPenAlignment); + procedure SetColor(const Value: DWORD); + procedure SetBrush(const Value: TdxGPBrush); + procedure SetWidth(const Value: Single); + protected + procedure SetNativePen(ANativePen: GpPen); + function SetStatus(status: TdxGPStatus): TdxGPStatus; + public + constructor Create(color: DWORD; width: Single = 1.0); overload; + constructor Create(brush: TdxGPBrush; width: Single = 1.0); overload; + destructor Destroy; override; + function GetLastStatus: TdxGPStatus; + function GetPenType: TdxGPPenType; + property ALignment: TdxGPPenAlignment read GetAlignment write SetAlignment; + property Brush: TdxGPBrush read GetBrush write SetBrush; + property Color: DWORD read GetColor write SetColor; + property Width: Single read GetWidth write SetWidth; + end; + + TdxGPGraphics = class(TdxGPBase) + private + FNativeGraphics: GpGraphics; + FLastResult: TdxGPStatus; + protected + procedure SetNativeGraphics(AGraphics: GpGraphics); + function SetStatus(status: TdxGPStatus): TdxGPStatus; + function GetNativeGraphics: GpGraphics; + function GetNativePen(pen: TdxGPPen): GpPen; + public + constructor Create(hdc: HDC); overload; + destructor Destroy; override; + function GetHDC: HDC; + procedure ReleaseHDC(hdc: HDC); + function GetLastStatus: TdxGPStatus; + + function DrawLine(pen: TdxGPPen; x1, y1, x2, y2: Integer): TdxGPStatus; overload; + function DrawLine(pen: TdxGPPen; const pt1, pt2: TdxGPPoint): TdxGPStatus; overload; + function DrawArc(pen: TdxGPPen; const rect: TdxGPRect; startAngle, sweepAngle: Single): TdxGPStatus; overload; + function DrawBezier(pen: TdxGPPen; x1, y1, x2, y2, x3, y3, x4, y4: Integer): TdxGPStatus; overload; + function DrawBezier(pen: TdxGPPen; const pt1, pt2, pt3, pt4: TdxGPPoint): TdxGPStatus; overload; + function DrawRectangle(pen: TdxGPPen; const rect: TdxGPRect): TdxGPStatus; overload; + function DrawEllipse(pen: TdxGPPen; const rect: TdxGPRect): TdxGPStatus; overload; + function DrawPie(pen: TdxGPPen; const rect: TdxGPRect; startAngle, sweepAngle: Single): TdxGPStatus; overload; + function DrawPolygon(pen: TdxGPPen; points: PdxGPPoint; count: Integer): TdxGPStatus; overload; + function DrawCurve(pen: TdxGPPen; points: PdxGPPoint; count: Integer; tension: Single): TdxGPStatus; overload; + function DrawClosedCurve(pen: TdxGPPen; points: PdxGPPoint; count: Integer; tension: Single): TdxGPStatus; overload; + function Clear(color: TColor): TdxGPStatus; + procedure FillRectangle(brush: TdxGPBrush; const rect: TdxGPRect); + function FillPolygon(brush: TdxGPBrush; points: PdxGPPoint; count: Integer): TdxGPStatus; overload; + function FillEllipse(brush: TdxGPBrush; const rect: TdxGPRect): TdxGPStatus; overload; + function FillPie(brush: TdxGPBrush; const rect: TdxGPRect; startAngle, sweepAngle: Single): TdxGPStatus; overload; + function FillClosedCurve(brush: TdxGPBrush; points: PdxGPPoint; count: Integer): TdxGPStatus; overload; + end; + + TdxRGBColors = array of TRGBQuad; + + TdxGPImage = class(TdxGPBase) + private + FBits: TdxRGBColors; + FHandle: GpImage; + private + procedure LoadFromDataStream(AStream: TStream); virtual; + public + constructor CreateFromBitmap(ABitmap: TBitmap); virtual; + constructor CreateFromPattern(const AWidth, AHeight: Integer; + const ABits: TdxRGBColors; AHasAlphaChannel: Boolean); virtual; + constructor CreateFromStream(AStream: TStream); virtual; + destructor Destroy; override; + function Clone: TdxGPImage; + procedure Draw(DC: HDC; const R: TRect); + function GetBitmapBits(ABitmap: TBitmap): TdxRGBColors; + function MakeComposition(AOverlay: TdxGPImage; AAlpha: Byte): TdxGPImage; + procedure SaveToStream(AStream: TStream); + + property Handle: GpImage read FHandle; + end; + + TdxGPImageClass = class of TdxGPImage; + + TdxGPNullImage = class(TdxGPImage) + public + class function NewInstance: TObject; override; + procedure FreeInstance; override; + end; + + TdxPNGImage = class(TGraphic) + private + FHandle: TdxGPImage; + FIsAlphaUsed: Boolean; + FIsAlphaUsedAssigned: Boolean; + procedure SetHandle(AHandle: TdxGPImage); + protected + procedure AssignTo(Dest: TPersistent); override; + procedure Changed(Sender: TObject); override; + function CheckAlphaUsed: Boolean; + procedure Draw(ACanvas: TCanvas; const ARect: TRect); override; + function GetEmpty: Boolean; override; + function GetHeight: Integer; override; + function GetIsAlphaUsed: Boolean; + function GetSize: TSize; + function GetTransparent: Boolean; override; + function GetWidth: Integer; override; + procedure SetHeight(Value: Integer); override; + procedure SetWidth(Value: Integer); override; + public + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + class function CreateFromBitmap(ASource: TBitmap): TdxGPImage; + function Compare(AImage: TdxPngImage): Boolean; virtual; + procedure DrawEx(Graphics: GpGraphics; const ADest, ASource: TRect); + function GetAsBitmap: TBitmap; virtual; + procedure SetBitmap(ABitmap: TBitmap); virtual; + procedure LoadFromStream(Stream: TStream); override; + procedure SaveToStream(Stream: TStream); override; + procedure LoadFromClipboardFormat(AFormat: Word; AData: THandle; + APalette: HPALETTE); override; + procedure SaveToClipboardFormat(var AFormat: Word; var AData: THandle; + var APalette: HPALETTE); override; + procedure StretchDraw(DC: HDC; const ADest: TRect); overload; virtual; + procedure StretchDraw(DC: HDC; const ADest, ASource: TRect); overload; virtual; + procedure StretchDrawEx(Graphics: GpGraphics; const ADest, ASource: TRect); virtual; + + property Handle: TdxGPImage read FHandle write SetHandle; + property IsAlphaUsed: Boolean read GetIsAlphaUsed; + end; + +var + dxGPImageClass: TdxGPImageClass; + +implementation + +{ TdxGPBrush } + +constructor TdxGPBrush.Create; +begin + SetStatus(NotImplemented); + FNativeBrush := nil; +end; + +destructor TdxGPBrush.Destroy; +begin + GdipDeleteBrush(FNativeBrush); + inherited; +end; + +constructor TdxGPBrush.CreateNative(nativeBrush: GpBrush; AStatus: Status); +begin + inherited Create; + FLastResult := AStatus; + SetNativeBrush(FNativeBrush); +end; + +function TdxGPBrush.Clone: TdxGPBrush; +var + gpB: GpBrush; +begin + gpB := nil; + Result := nil; + SetStatus (GdipCloneBrush(FNativeBrush, gpB)); + try + Result := TdxGPBrush.CreateNative(gpB, FLastResult); + except + GdipDeleteBrush(gpB); + end; +end; + +function TdxGPBrush.GetLastStatus: Status; +begin + Result := FLastResult; + FLastResult := Ok; +end; + +function TdxGPBrush.GetType: BrushType; +begin + SetStatus(GdipGetBrushType (FNativeBrush, Result)); +end; + +procedure TdxGPBrush.SetNativeBrush(ANativeBrush: GpBrush); +begin + FNativeBrush := ANativeBrush; +end; + +function TdxGPBrush.SetStatus(AStatus: TdxGPStatus): TdxGPStatus; +begin + Result := AStatus; + if (AStatus <> Ok) and (FLastResult <> AStatus) then + Result := GenericError; +end; + +{ TdxGPSolidBrush } + +constructor TdxGPSolidBrush.Create(color: TColor); +var + ABrush: GpSolidFill; +begin + ABrush := nil; + FLastResult := GdipCreateSolidFill(color, ABrush); + SetNativeBrush(ABrush); +end; + +constructor TdxGPSolidBrush.Create; +begin +// hide parent method +end; + +function TdxGPSolidBrush.GetColor: DWORD; +begin + SetStatus(GdipGetSolidFillColor(GPSOLIDFILL(FNativeBrush), Result)); +end; + +procedure TdxGPSolidBrush.SetColor(const Value: DWORD); +begin + SetStatus(GdipSetSolidFillColor(GpSolidFill(FNativeBrush), Value)); +end; + +{ TdxGPLinearGradientBrush } + +constructor TdxGPLinearGradientBrush.Create(rect: TdxGPRect; color1, color2: DWORD; mode: TdxGPLinearGradientMode); +var + ABrush: GpLineGradient; +begin + ABrush := nil; + FLastResult := GdipCreateLineBrushFromRectI(@rect, color1, color2, mode, WrapModeTile, ABrush); + SetNativeBrush(ABrush); +end; + +constructor TdxGPLinearGradientBrush.Create; +begin +// hide parent method +end; + +function TdxGPLinearGradientBrush.GetLinearColors(out color1, color2: DWORD): TdxGPStatus; +var + AColors: array[0..1] of DWORD; +begin + SetStatus(GdipGetLineColors(GpLineGradient(FNativeBrush), PARGB(@AColors))); + if (FLastResult = Ok) then + begin + color1 := AColors[0]; + color2 := AColors[1]; + end; + Result := FLastResult; +end; + +function TdxGPLinearGradientBrush.GetRectangle: TdxGPRect; +var + ARect: PdxGPRect; +begin + ARect := @Result; + SetStatus(GdipGetLineRectI(GpLineGradient(FNativeBrush), ARect)); +end; + +function TdxGPLinearGradientBrush.GetWrapMode: TdxGPWrapMode; +begin + Result := WrapModeTile; + SetStatus(GdipGetLineWrapMode(GpLineGradient(FNativeBrush), Result)); +end; + +function TdxGPLinearGradientBrush.SetLinearColors(color1, color2: DWORD): TdxGPStatus; +begin + Result := SetStatus(GdipSetLineColors(GpLineGradient(FNativeBrush), color1, color2)); +end; + +procedure TdxGPLinearGradientBrush.SetWrapMode(const Value: TdxGPWrapMode); +begin + SetStatus(GdipSetLineWrapMode(GpLineGradient(FNativeBrush), Value)); +end; + +{ TdxGPHatchBrush } + +constructor TdxGPHatchBrush.Create; +begin +// hide parent method +end; + +constructor TdxGPHatchBrush.Create(hatchStyle: TdxGPHatchStyle; foreColor, + backColor: DWORD); +var + ABrush: GpHatch; +begin + ABrush := nil; + FLastResult := GdipCreateHatchBrush(hatchStyle, foreColor, backColor, ABrush); + SetNativeBrush(ABrush); +end; + +function TdxGPHatchBrush.GetBackgroundColor: DWORD; +begin + SetStatus(GdipGetHatchBackgroundColor(GpHatch(FNativeBrush), Result)); +end; + +function TdxGPHatchBrush.GetForegroundColor: DWORD; +begin + SetStatus(GdipGetHatchForegroundColor(GpHatch(FNativeBrush), Result)); +end; + +function TdxGPHatchBrush.GetHatchStyle: TdxGPHatchStyle; +begin + SetStatus(GdipGetHatchStyle(GpHatch(FNativeBrush), Result)); +end; + +{ TdxGPPen } + +constructor TdxGPPen.Create(brush: TdxGPBrush; width: Single); +var + unit_: TdxGPUnit; +begin + unit_ := UnitWorld; + FNativePen := nil; + FLastResult := GdipCreatePen2(brush.FNativeBrush, width, unit_, FNativePen); +end; + +constructor TdxGPPen.Create(color: DWORD; width: Single); +var + unit_: TdxGPUnit; +begin + unit_ := UnitWorld; + FNativePen := nil; + FLastResult := GdipCreatePen1(color, width, unit_, FNativePen); +end; + +destructor TdxGPPen.Destroy; +begin + GdipDeletePen(FNativePen); + inherited; +end; + +function TdxGPPen.GetAlignment: TdxGPPenAlignment; +begin + SetStatus(GdipGetPenMode(FNativePen, Result)); +end; + +function TdxGPPen.GetBrush: TdxGPBrush; +var + type_: TdxGPPenType; + ABrush: TdxGPBrush; + ANativeBrush: GpBrush; +begin + type_ := GetPenType; + ABrush := nil; + case type_ of + PenTypeSolidColor : ABrush := TdxGPSolidBrush.Create; + PenTypeHatchFill : ABrush := TdxGPHatchBrush.Create; + PenTypeTextureFill : ABrush := TdxGPTextureBrush.Create; + PenTypePathGradient : ABrush := TdxGPBrush.Create; + PenTypeLinearGradient : ABrush := TdxGPLinearGradientBrush.Create; + end; + if ABrush <> nil then + begin + SetStatus(GdipGetPenBrushFill(FNativePen, ANativeBrush)); + brush.SetNativeBrush(ANativeBrush); + end; + Result := ABrush; +end; + +function TdxGPPen.GetColor: DWORD; +var + type_: TdxGPPenType; + argb: DWORD; +begin + type_ := GetPenType; + Result := 0; + if (type_ = PenTypeSolidColor) then + begin + SetStatus(GdipGetPenColor(FNativePen, argb)); + if FLastResult = Ok then Result := argb; + end; +end; + +function TdxGPPen.GetLastStatus: TdxGPStatus; +begin + Result := FLastResult; + FLastResult := Ok; +end; + +function TdxGPPen.GetPenType: TdxGPPenType; +begin + SetStatus(GdipGetPenFillType(FNativePen, Result)); +end; + +function TdxGPPen.GetWidth: Single; +begin + SetStatus(GdipGetPenWidth(FNativePen, Result)); +end; + +procedure TdxGPPen.SetAlignment(const Value: TdxGPPenAlignment); +begin + SetStatus(GdipSetPenMode(FNativePen, Value)); +end; + +procedure TdxGPPen.SetBrush(const Value: TdxGPBrush); +begin + SetStatus(GdipSetPenBrushFill(FNativePen, Value.FNativeBrush)); +end; + +procedure TdxGPPen.SetColor(const Value: DWORD); +begin + SetStatus(GdipSetPenColor(FNativePen, Value)); +end; + +procedure TdxGPPen.SetNativePen(ANativePen: GpPen); +begin + FNativePen := ANativePen; +end; + +function TdxGPPen.SetStatus(status: TdxGPStatus): TdxGPStatus; +begin + if (status <> Ok) then FLastResult := status; + Result := status; +end; + +procedure TdxGPPen.SetWidth(const Value: Single); +begin + SetStatus(GdipSetPenWidth(FNativePen, Value)); +end; + +{ TdxGPGraphics } + +constructor TdxGPGraphics.Create(hdc: HDC); +var + AGraphics :GpGraphics; +begin + inherited Create; + AGraphics := nil; + FLastResult := GdipCreateFromHDC(hdc, AGraphics); + SetNativeGraphics(AGraphics); +end; + +destructor TdxGPGraphics.Destroy; +begin + GdipDeleteGraphics(FNativeGraphics); + inherited; +end; + +procedure TdxGPGraphics.FillRectangle(brush: TdxGPBrush; const rect: TdxGPRect); +begin + SetStatus(GdipFillRectangleI(FNativeGraphics, brush.FNativeBrush, rect.X, rect.Y, rect.Width, rect.Height)); +end; + +procedure TdxGPGraphics.SetNativeGraphics(AGraphics: GpGraphics); +begin + FNativeGraphics := AGraphics +end; + +function TdxGPGraphics.Clear(color: TColor): TdxGPStatus; +begin + Result := SetStatus(GdipGraphicsClear(FNativeGraphics, color)); +end; + +function TdxGPGraphics.DrawArc(pen: TdxGPPen; const rect: TdxGPRect; + startAngle, sweepAngle: Single): TdxGPStatus; +begin + Result := SetStatus(GdipDrawArcI(FNativeGraphics, pen.FNativePen, + rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); +end; + +function TdxGPGraphics.DrawBezier(pen: TdxGPPen; const pt1, pt2, pt3, + pt4: TdxGPPoint): TdxGPStatus; +begin + Result := SetStatus(GdipDrawBezierI(FNativeGraphics, pen.FNativePen, + pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt1.Y)); +end; + +function TdxGPGraphics.DrawBezier(pen: TdxGPPen; x1, y1, x2, y2, x3, y3, + x4, y4: Integer): TdxGPStatus; +begin + Result := SetStatus(GdipDrawBezierI(FNativeGraphics, pen.FNativePen, + x1, y1, x2, y2, x3, y3, x4, y4)); +end; + +function TdxGPGraphics.DrawClosedCurve(pen: TdxGPPen; points: PdxGPPoint; + count: Integer; tension: Single): TdxGPStatus; +begin + Result := SetStatus(GdipDrawClosedCurve2I(FNativeGraphics, pen.FNativePen, + points, count, tension)); +end; + +function TdxGPGraphics.DrawCurve(pen: TdxGPPen; points: PdxGPPoint; + count: Integer; tension: Single): TdxGPStatus; +begin + Result := SetStatus(GdipDrawCurve2I(FNativeGraphics, pen.FNativePen, + points, count, tension)); +end; + +function TdxGPGraphics.DrawEllipse(pen: TdxGPPen; + const rect: TdxGPRect): TdxGPStatus; +begin + Result := SetStatus(GdipDrawEllipseI(FNativeGraphics, pen.FNativePen, + rect.X, rect.Y, rect.Width, rect.Height)); +end; + +function TdxGPGraphics.DrawLine(pen: TdxGPPen; x1, y1, x2, y2: Integer): TdxGPStatus; +begin + Result := SetStatus(GdipDrawLineI(FNativeGraphics, pen.FNativePen, x1, y1, x2, y2)); +end; + +function TdxGPGraphics.DrawLine(pen: TdxGPPen; const pt1, pt2: TdxGPPoint): TdxGPStatus; +begin + Result := SetStatus(GdipDrawLineI(FNativeGraphics, pen.FNativePen, pt1.X, pt1.Y, pt2.X, pt2.Y)); +end; + +function TdxGPGraphics.DrawPie(pen: TdxGPPen; const rect: TdxGPRect; + startAngle, sweepAngle: Single): TdxGPStatus; +begin + Result := SetStatus(GdipDrawPieI(FNativeGraphics, pen.FNativePen, + rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); +end; + +function TdxGPGraphics.DrawPolygon(pen: TdxGPPen; points: PdxGPPoint; + count: Integer): TdxGPStatus; +begin + Result := SetStatus(GdipDrawPolygonI(FNativeGraphics, pen.FNativePen, points, count)); +end; + +function TdxGPGraphics.DrawRectangle(pen: TdxGPPen; + const rect: TdxGPRect): TdxGPStatus; +begin + Result := SetStatus(GdipDrawRectangleI(FNativeGraphics, pen.FNativePen, + rect.X, rect.Y, rect.Width, rect.Height)); +end; + +function TdxGPGraphics.FillClosedCurve(brush: TdxGPBrush; points: PdxGPPoint; + count: Integer): TdxGPStatus; +begin + Result := SetStatus(GdipFillClosedCurveI(FNativeGraphics, brush.FNativeBrush, + points, count)); +end; + +function TdxGPGraphics.FillEllipse(brush: TdxGPBrush; + const rect: TdxGPRect): TdxGPStatus; +begin + Result := SetStatus(GdipFillEllipseI(FNativeGraphics, brush.FNativeBrush, + rect.X, rect.Y, rect.Width, rect.Height)); +end; + +function TdxGPGraphics.FillPie(brush: TdxGPBrush; const rect: TdxGPRect; + startAngle, sweepAngle: Single): TdxGPStatus; +begin + Result := SetStatus(GdipFillPieI(FNativeGraphics, brush.FNativeBrush, + rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)); +end; + +function TdxGPGraphics.FillPolygon(brush: TdxGPBrush; points: PdxGPPoint; + count: Integer): TdxGPStatus; +begin + Result := SetStatus(GdipFillPolygonI(FNativeGraphics, brush.FNativeBrush, + points, count, FillModeAlternate)); +end; + +function TdxGPGraphics.GetHDC: HDC; +begin + SetStatus(GdipGetDC(FNativeGraphics, Result)); +end; + +function TdxGPGraphics.GetLastStatus: TdxGPStatus; +begin + Result := FLastResult; + FLastResult := Ok; +end; + +function TdxGPGraphics.GetNativeGraphics: GpGraphics; +begin + Result := FNativeGraphics; +end; + +function TdxGPGraphics.GetNativePen(pen: TdxGPPen): GpPen; +begin + Result := pen.FNativePen; +end; + +procedure TdxGPGraphics.ReleaseHDC(hdc: HDC); +begin + SetStatus(GdipReleaseDC(FNativeGraphics, hdc)); +end; + +function TdxGPGraphics.SetStatus(status: TdxGPStatus): TdxGPStatus; +begin + if (status <> Ok) then FLastResult := status; + Result := status; +end; + +{ TdxGPImage } + +constructor TdxGPImage.CreateFromBitmap(ABitmap: TBitmap); +begin + CheckPngCodec; + CreateFromPattern(ABitmap.Width, ABitmap.Height, + GetBitmapBits(ABitmap), ABitmap.PixelFormat = pf32Bit); +end; + +constructor TdxGPImage.CreateFromPattern(const AWidth, AHeight: Integer; + const ABits: TdxRGBColors; AHasAlphaChannel: Boolean); +var + I: Integer; +begin + FBits := ABits; + if not AHasAlphaChannel then + for I := 0 to Length(FBits) - 1 do + FBits[I].rgbReserved := 255; + GdipCheck(GdipCreateBitmapFromScan0(AWidth, AHeight, + AWidth * 4, PixelFormat32bppPARGB, @FBits[0], FHandle)); +end; + +constructor TdxGPImage.CreateFromStream(AStream: TStream); +var + Bitmap: TBitmap; + Header: TBitmapFileHeader; +begin + if not CheckGdiPlus or (AStream.Size < SizeOf(Header)) then Exit; + AStream.ReadBuffer(Header, SizeOf(Header)); + AStream.Seek(-SizeOf(Header), soFromCurrent); + if Header.bfType = $4D42 then + begin + Bitmap := TBitmap.Create; + try + Bitmap.LoadFromStream(AStream); + CreateFromBitmap(Bitmap); + finally + Bitmap.Free; + end; + end + else + LoadFromDataStream(AStream); +end; + +destructor TdxGPImage.Destroy; +begin + if Handle <> nil then + GdipCheck(GdipDisposeImage(Handle)); + FBits := nil; + inherited Destroy; +end; + +function TdxGPImage.Clone: TdxGPImage; +var + W, H: Single; +begin + if Length(FBits) > 0 then + begin + GdipCheck(GdipGetImageDimension(Handle, W, H)); + Result := dxGpImageClass.CreateFromPattern(Trunc(W), Trunc(H), FBits, True); + end + else + begin + Result := dxGpImageClass.Create; + GdipCheck(GdipCloneImage(Handle, Result.FHandle)); + end; +end; + +procedure TdxGPImage.SaveToStream(AStream: TStream); +begin + GdipCheck(GdipSaveImageToStream(Handle, + TStreamAdapter.Create(AStream, soReference), @PngCodec, nil)); +end; + +function TdxGPImage.MakeComposition(AOverlay: TdxGPImage; AAlpha: Byte): TdxGPImage; +var + A: Single; + ABits: TdxRGBColors; + ADest: TRGBQuad; + AImageHeight: Single; + AImageWidth: Single; + ASource: TRGBQuad; + I, ACount: Integer; +begin + Result := nil; + if Length(FBits) > 0 then + begin + GdipCheck(GdipGetImageDimension(Handle, AImageWidth, AImageHeight)); + ACount := Trunc(AImageWidth) * Trunc(AImageHeight); + A := AAlpha / 255; + SetLength(ABits, ACount); + for I := 0 to ACount - 1 do + begin + ADest := FBits[I]; + ASource := AOverlay.FBits[I]; + ADest.rgbBlue := Round(ADest.rgbBlue * (1 - A) + ASource.rgbBlue * A); + ADest.rgbGreen := Round(ADest.rgbGreen * (1 - A) + ASource.rgbGreen * A); + ADest.rgbRed := Round(ADest.rgbRed * (1 - A) + ASource.rgbRed * A); + ADest.rgbReserved := Round(ADest.rgbReserved * (1 - A) + ASource.rgbReserved * A); + ABits[I] := ADest; + end; + Result := dxGpImageClass.CreateFromPattern(Trunc(AImageWidth), + Trunc(AImageHeight), ABits, True); + end; +end; + +procedure TdxGPImage.Draw(DC: HDC; const R: TRect); +var + AGraphics: GpGraphics; + AImageWidth, AImageHeight: Single; +begin + if GdipCreateFromHDC(DC, AGraphics) = Ok then + begin + GdipCheck(GdipGetImageDimension(Handle, AImageWidth, AImageHeight)); + GdipCheck(GdipDrawImageRectRectI(AGraphics, Handle, R.Left, R.Top, + R.Right - R.Left, R.Bottom - R.Top, 0, 0, + Trunc(AImageWidth), Trunc(AImageHeight), UnitPixel, nil, nil, nil)); + GdipCheck(GdipDeleteGraphics(AGraphics)); + end; +end; + +function TdxGPImage.GetBitmapBits(ABitmap: TBitmap): TdxRGBColors; +var + ScreenDC: HDC; + AInfo: TBitmapInfo; +begin + SetLength(Result, ABitmap.Width * ABitmap.Height); + AInfo.bmiHeader.biSize := SizeOf(TBitmapInfoHeader); + AInfo.bmiHeader.biWidth := ABitmap.Width; + AInfo.bmiHeader.biHeight := -ABitmap.Height; + AInfo.bmiHeader.biPlanes := 1; + AInfo.bmiHeader.biBitCount := 32; + AInfo.bmiHeader.biCompression := BI_RGB; + ScreenDC := GetDC(0); + GetDIBits(ScreenDC, ABitmap.Handle, 0, ABitmap.Height, Result, + AInfo, DIB_RGB_COLORS); + ReleaseDC(0, ScreenDC); +end; + +procedure TdxGPImage.LoadFromDataStream(AStream: TStream); +var + Data: HGlobal; + DataPtr: Pointer; + AccessStream: IStream; +begin + Data := GlobalAlloc(GMEM_MOVEABLE + GMEM_DDESHARE, AStream.Size); + try + DataPtr := GlobalLock(Data); + try + AStream.Read(DataPtr^, AStream.Size); + GdipCheck(CreateStreamOnHGlobal(Data, False, AccessStream) = s_OK); + GdipCheck(GdipCreateBitmapFromStream(AccessStream, FHandle)); + finally + GlobalUnlock(Data); + AccessStream := nil; + end; + finally + GlobalFree(Data); + end; +end; + +{ TdxGPNullImage } + +class function TdxGPNullImage.NewInstance: TObject; +begin + Result := InitInstance(AllocMem(InstanceSize)); +end; + +procedure TdxGPNullImage.FreeInstance; +var + P: Pointer; +begin + CleanupInstance; + P := Self; + FreeMem(P); +end; + +{ TdxPNGImage } + +destructor TdxPNGImage.Destroy; +begin + Handle := nil; + inherited Destroy; +end; + +procedure TdxPNGImage.Assign(Source: TPersistent); +begin + if Source is TBitmap then + Handle := CreateFromBitmap(TBitmap(Source)) + else + if (Source is TdxPNGImage) and (TdxPNGImage(Source).Handle <> nil) then + Handle := TdxPNGImage(Source).Handle.Clone + else + inherited Assign(Source); +end; + +function TdxPNGImage.Compare(AImage: TdxPngImage): Boolean; + + function GetColors(AImage: TdxPNGImage): TdxRGBColors; + var + ABitmap: TBitmap; + begin + ABitmap := AImage.GetAsBitmap; + try + Result := AImage.Handle.GetBitmapBits(ABitmap); + finally + ABitmap.Free; + end; + end; + + function CompareColors(Color1, Color2: TRGBQuad): Boolean; + begin + Result := (Color1.rgbBlue = Color2.rgbBlue) and + (Color1.rgbGreen = Color2.rgbGreen) and + (Color1.rgbRed = Color2.rgbRed) and + (Color1.rgbReserved = Color2.rgbReserved); + end; + +var + AColors: TdxRGBColors; + AColors2: TdxRGBColors; + I: Integer; +begin + AColors := nil; + AColors2 := nil; + Result := (AImage.Height = Height) and (AImage.Width = Width); + if Result and not (AImage.Empty or Empty) then + begin + AColors := GetColors(AImage); + AColors2 := GetColors(Self); + for I := 0 to High(AColors) do + begin + Result := CompareColors(AColors[I], AColors2[I]); + if not Result then + Exit; + end; + end; +end; + +procedure TdxPNGImage.DrawEx( + Graphics: GpGraphics; const ADest, ASource: TRect); +begin + if Handle = nil then Exit; + StretchDrawEx(Graphics, ADest, ASource); +end; + +function TdxPNGImage.GetAsBitmap: TBitmap; +var + AHandle: HBitmap; +begin + Result := TBitmap.Create; + Result.PixelFormat := pf32Bit; + GdipCheck(GdipCreateHBITMAPFromBitmap(Handle.Handle, AHandle, 0)); + Result.Handle := AHandle; +end; + +class function TdxPNGImage.CreateFromBitmap(ASource: TBitmap): TdxGPImage; +begin + CheckGdiPlus; + Result := dxGPImageClass.CreateFromBitmap(ASource); +end; + +procedure TdxPNGImage.LoadFromStream(Stream: TStream); +begin + if Stream.Size = 0 then + Handle := nil + else + Handle := dxGPImageClass.CreateFromStream(Stream) +end; + +procedure TdxPNGImage.SaveToStream(Stream: TStream); +var + ADest: TMemoryStream; +begin + if Handle <> nil then + begin + ADest := TMemoryStream.Create(); + try + Handle.SaveToStream(ADest); + ADest.Position := 0; + Stream.CopyFrom(ADest, ADest.Size); + finally + ADest.Free; + end; + end; +end; + +procedure TdxPNGImage.LoadFromClipboardFormat(AFormat: Word; AData: THandle; + APalette: HPALETTE); +begin +end; + +procedure TdxPNGImage.SaveToClipboardFormat(var AFormat: Word; var AData: THandle; + var APalette: HPALETTE); +begin +end; + +procedure TdxPNGImage.SetBitmap(ABitmap: TBitmap); +begin + Handle := CreateFromBitmap(ABitmap); +end; + +procedure TdxPNGImage.StretchDraw(DC: HDC; const ADest: TRect); +begin + StretchDraw(DC, ADest, Rect(0, 0, Width, Height)); +end; + +procedure TdxPNGImage.StretchDraw(DC: HDC; const ADest, ASource: TRect); +var + Gp: GpGraphics; +begin + if Handle = nil then Exit; + GdipCheck(GdipCreateFromHDC(DC, Gp)); + StretchDrawEx(Gp, ADest, ASource); + GdipCheck(GdipDeleteGraphics(Gp)); +end; + +procedure TdxPNGImage.StretchDrawEx( + Graphics: GpGraphics; const ADest, ASource: TRect); +var + DstH, DstW, SrcH, SrcW: Single; +begin + if Handle = nil then Exit; + SrcW := ASource.Right - ASource.Left; + SrcH := ASource.Bottom - ASource.Top; + DstW := ADest.Right - ADest.Left; + DstH := ADest.Bottom - ADest.Top; + if (SrcW < 1) or (SrcH < 1) or (DstW < 1) or (DstH < 1) then Exit; + if (DstW > SrcW) and (SrcW > 1) then + SrcW := SrcW - 1; + if (DstH > SrcH) and (SrcH > 1) then + SrcH := SrcH - 1; + GdipCheck(GdipDrawImageRectRect(Graphics, Handle.Handle, ADest.Left, ADest.Top, + DstW, DstH, ASource.Left, ASource.Top, SrcW, SrcH, UnitPixel, nil, nil, nil)) +end; + +procedure TdxPNGImage.AssignTo(Dest: TPersistent); +var + ABitmap: TBitmap; +begin + if Dest is TdxPNGImage then + (Dest as TdxPNGImage).Assign(Self) + else + if Dest is TBitmap then + begin + ABitmap := GetAsBitmap; + try + (Dest as TBitmap).Assign(ABitmap); + finally + ABitmap.Free; + end; + end + else + inherited AssignTo(Dest); +end; + +procedure TdxPNGImage.Changed(Sender: TObject); +begin + FIsAlphaUsedAssigned := False; + inherited Changed(Sender); +end; + +function TdxPNGImage.CheckAlphaUsed: Boolean; +var + ABitmap: TBitmap; + AColors: TdxRGBColors; + I: Integer; +begin + Result := False; + ABitmap := GetAsBitmap; + try + AColors := Handle.GetBitmapBits(ABitmap); + for I := Low(AColors) to High(AColors) do + begin + Result := AColors[I].rgbReserved <> 255; + if Result then + Break; + end; + finally + ABitmap.Free; + end; +end; + +procedure TdxPNGImage.Draw(ACanvas: TCanvas; const ARect: TRect); +begin + StretchDraw(ACanvas.Handle, ARect, Rect(0, 0, Width, Height)); +end; + +function TdxPNGImage.GetEmpty: Boolean; +begin + with GetSize do + Result := (cx <= 0) or (cy <= 0) +end; + +function TdxPNGImage.GetHeight: Integer; +begin + Result := GetSize.cy; +end; + +function TdxPNGImage.GetIsAlphaUsed: Boolean; +begin + if FIsAlphaUsedAssigned then + Result := FIsAlphaUsed + else + begin + FIsAlphaUsed := CheckAlphaUsed; + FIsAlphaUsedAssigned := True; + Result := FIsAlphaUsed; + end; +end; + +function TdxPNGImage.GetSize: TSize; +var + W, H: Single; +begin + if Handle <> nil then + GdipCheck(GdipGetImageDimension(Handle.Handle, W, H)) + else + begin + W := 0; + H := 0; + end; + Result.cx := Trunc(W); + Result.cy := Trunc(H); +end; + +function TdxPNGImage.GetTransparent: Boolean; +begin + Result := True; +end; + +function TdxPNGImage.GetWidth: Integer; +begin + Result := GetSize.cx; +end; + +procedure TdxPNGImage.SetWidth(Value: Integer); +begin +end; + +procedure TdxPNGImage.SetHeight(Value: Integer); +begin +end; + +procedure TdxPNGImage.SetHandle(AHandle: TdxGPImage); +begin + if AHandle <> FHandle then + begin + if FHandle <> nil then + FHandle.Free; + FHandle := AHandle; + end; +end; + +procedure RegisterAssistants; +begin + dxGPImageClass := TdxGPNullImage; + if CheckGdiPlus then + begin + CheckPngCodec; + dxGPImageClass := TdxGPImage; + RegisterClasses([TdxPNGImage]); + TPicture.RegisterFileFormat('PNG', 'PNG graphics from DevExpress', TdxPNGImage); + end; +end; + +procedure UnregisterAssistants; +begin + TPicture.UnregisterGraphicClass(TdxPNGImage); + UnregisterClasses([TdxPNGImage]); +end; + +initialization + dxUnitsLoader.AddUnit(@RegisterAssistants, @UnregisterAssistants); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterAssistants); + +end. diff --git a/official/x.35/ExpressLayout Control/EULA.txt b/official/x.35/ExpressLayout Control/EULA.txt new file mode 100644 index 00000000..857c3d4f --- /dev/null +++ b/official/x.35/ExpressLayout Control/EULA.txt @@ -0,0 +1,119 @@ +DEVELOPER EXPRESS INC +ExpressLayout Control(tm) COMPONENT SUITE +Copyright (C) 1999-2008 Developer Express Inc. + +END-USER LICENSE AGREEMENT +FOR ALL SOFTWARE COMPONENT PRODUCT(S) + +IMPORTANT- READ CAREFULLY: This DEVELOPER EXPRESS INC ("DEVEXPRESS") End-User License Agreement ("EULA") is a legal agreement between you, a developer of software applications, ("Developer End User") and DEVEXPRESS for all DEVEXPRESS products, controls, source code, demos, intermediate files, media, printed materials, and "online" or electronic documentation ("SOFTWARE COMPONENT PRODUCT(S)") contained in this installation file. + +DEVEXPRESS grants to you as an individual, a personal, nonexclusive license to install and use the SOFTWARE COMPONENT PRODUCT(S) for the sole purposes of designing, developing, testing, and deploying application programs which you create. By installing, copying, or otherwise using the SOFTWARE COMPONENT PRODUCT(S), you agree to be bound by the terms of this EULA. If you do not agree to any part of the terms of this EULA, DO NOT INSTALL, USE, EVALUATE, OR REPLICATE IN ANY MANNER, ANY PART, FILE OR PORTION OF THE SOFTWARE COMPONENT PRODUCT(S). + +All SOFTWARE COMPONENT PRODUCT(S) is licensed, not sold. If you are an individual, you must acquire an individual license for the SOFTWARE COMPONENT PRODUCT(S) from DEVEXPRESS or its authorized resellers. If you are an entity, you must acquire and assign an individual license for each Developer End User within your organization using and or developing with the SOFTWARE COMPONENT PRODUCT(S) from DEVEXPRESS or its authorized resellers. + +If the SOFTWARE COMPONENT PRODUCT(S) you have obtained is marked as a "TRIAL" or "EVALUATION," you may install one copy of the SOFTWARE COMPONENT PRODUCT(S) for testing purposes for a period of 30 calendar days from the date of installation ("Evaluation Period"). Upon expiration of the Evaluation Period, the SOFTWARE COMPONENT PRODUCT(S) must be uninstalled and all copies destroyed. + +RIGOROUS ENFORCEMENT OF INTELLECTUAL PROPERTY RIGHTS. If the licensed right of use for this SOFTWARE COMPONENT PRODUCT(S) is purchased by you with any intent to reverse engineer, decompile, create derivative works, and the exploitation or unauthorized transfer of, any DEVEXPRESS intellectual property and trade secrets, to include any exposed methods or source code where provided, no licensed right of use shall exist, and any PRODUCT(s) created as a result shall be judged illegal by definition of all applicable law. Any sale or resale of intellectual property or created derivatives so obtained will be prosecuted to the fullest extent of all local, federal and international law. + +1. GRANT OF LICENSE. + +This EULA, if legally executed as defined herein, licenses and so grants the single individual Developer End User the following rights: + +SOFTWARE COMPONENT PRODUCT(S) - Developer End User may install and use the SOFTWARE COMPONENT PRODUCT(S) on a single computer. Developer End User may also install and use the SOFTWARE COMPONENT PRODUCT(S) on a portable computer. + +2. LIMITATIONS ON REVERSE ENGINEERING, DECOMPILATION, AND DISASSEMBLY. + +You may not reverse engineer, decompile, create derivative works, translate, or disassemble the SOFTWARE COMPONENT PRODUCT(S), and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation. You agree to take all reasonable, legal and appropriate measures to prohibit the illegal dissemination of the SOFTWARE COMPONENT PRODUCT(S) or any of its constituent parts and redistributables to the fullest extent of all applicable local, US Codes and International Laws and Treaties regarding anti-circumvention, including but not limited to, the Geneva and Berne World Intellectual Property Organization (WIPO) Diplomatic Conferences. + +3. SEPARATION OF COMPONENTS. + +The SOFTWARE COMPONENT PRODUCT(S) is licensed as a single PRODUCT(s). The SOFTWARE COMPONENT PRODUCT(S) and its constituent parts and any provided redistributables may not be reverse engineered, decompiled, disassembled or separated for use on more than one computer, nor placed for distribution, sale, or resale as individual creations by Developer End User. The provision of source code, if included with the SOFTWARE COMPONENT PRODUCT(S), does not constitute transfer of any legal rights to such code, and resale or distribution of all or any portion of all source code and intellectual property will be prosecuted to the fullest extent of all applicable local, federal and international laws. All DEVEXPRESS libraries, source code, redistributables and other files remain DEVEXPRESS's exclusive property. You may not distribute any files, except those that DEVEXPRESS has expressly designated as Redistributable. + +4. RENTAL. + +You may not rent, lease, or lend the SOFTWARE COMPONENT PRODUCT(S). + +5. TRANSFER. + +You may NOT permanently or temporarily transfer ANY of your rights under this EULA to any individual or entity without prior written approval from DEVEXPRESS. Regardless of any modifications which you make and regardless of how you might compile, link, and/or package your programs, under no circumstances may the libraries, Redistributables, and/or other files of the SOFTWARE COMPONENT PRODUCT(S) (including any portions thereof) be used for developing programs by anyone other than you. Only you as the licensed Developer End User have the right to use the libraries, redistributables, or other files of the SOFTWARE COMPONENT PRODUCT(S) (or any portions thereof) for developing programs created with the SOFTWARE COMPONENT PRODUCT(S). In particular, you may not share copies of the Redistributables with other co-developers. You may not reproduce or distribute any DEVEXPRESS documentation without DEVEXPRESS's explicit permission. + +If you are an entity (Company), you must acquire and assign a license to each Developer End User within your organization using and or developing with the SOFTWARE COMPONENT PRODUCT(S). With written notification to DEVEXPRESS, Company may transfer the license obtained for a Developer End User to another Developer End User employed or otherwise engaged by Company if the initial Developer End User is no longer employed or engaged by Company or is reassigned to another function within Company and no longer develops software applications using the SOFTWARE COMPONENT PRODUCT(S). In addition, with written notification to DEVEXPRESS, Company may transfer its license of the SOFTWARE COMPONENT PRODUCT(S) to a successor Company. + +6. ROYALTY FREE REDISTRIBUTION. + +DEVEXPRESS PRODUCT(s) may include certain files ("Redistributable(s)") intended for distribution by you to the users of software applications which you create. Redistributables include, for example, those files identified in printed or on-line documentation as redistributable files, or those files preselected for deployment by an install utility provided with the SOFTWARE COMPONENT PRODUCT(S) (if any). In all circumstances, the Redistributables for the SOFTWARE COMPONENT PRODUCT(S) are only those files specifically designated as such by DEVEXPRESS. + +Subject to all of the terms and conditions in this EULA, you may reproduce and distribute copies of the Redistributables, provided that such copies are made from the original copy of the Redistributables included with the SOFTWARE COMPONENT PRODUCT(S) or modified versions of the Redistributables which are provided to you by DEVEXPRESS or those which you create. Copies of Redistributables may only be distributed with and for the sole purpose of executing application programs permitted under this EULA that you have created using the SOFTWARE COMPONENT PRODUCT(S). + +REDISTRIBUTABLES. To obtain a list of redistributables that apply under this EULA, contact support@devexpress.com + +AT NO TIME MAY DEVELOPER END USER CREATE ANY TOOL, REDISTRIBUTABLE, OR SOFTWARE COMPONENT PRODUCT(S) THAT DIRECTLY OR INDIRECTLY COMPETES WITH DEVEXPRESS SOFTWARE COMPONENT PRODUCT(S) WHICH UTILIZES ALL OR ANY PORTION OF THE SOFTWARE COMPONENT PRODUCT(S) contained within this installation. + +Distribution by the Developer End User of any design-time tools (EXE's OCX's or DLL's), executables, and source code distributed to Developer End User by DEVEXPRESS as part of this SOFTWARE COMPONENT PRODUCT(S) and not explicitly identified as a redistributable file is strictly prohibited. The Developer End User shall not develop software applications that provide an application programming interface to the SOFTWARE COMPONENT PRODUCT(S) or the SOFTWARE COMPONENT PRODUCT(S) as modified. + +The Developer End User may NOT distribute the SOFTWARE COMPONENT PRODUCT(S), in any format, to other users for development or application compilation purposes. Specifically, if Developer End User creates a control using the SOFTWARE COMPONENT PRODUCT(S) as a constituent control, Developer End User may NOT distribute the control created with the SOFTWARE COMPONENT PRODUCT(S) (in any format) to users to be used used at design time and or for ANY development purposes. + +Developer End User MAY NOT REDISTRIBUTE any SOFTWARE COMPONENT PRODUCT(s) files if using an evaluation, trial, Not for Resale, or demo version of the SOFTWARE COMPONENT PRODUCT(s). + +7. UPGRADES. + +If the SOFTWARE COMPONENT PRODUCT(S) is labeled as an upgrade, you must be properly licensed to use the SOFTWARE COMPONENT PRODUCT(S) identified by DEVEXPRESS as being eligible for the upgrade in order to use the SOFTWARE COMPONENT PRODUCT(S). A SOFTWARE COMPONENT PRODUCT(S) labeled as an upgrade replaces and/or supplements the SOFTWARE COMPONENT PRODUCT(S) that formed the basis for your eligibility for the upgrade, and together constitutes a single PRODUCT(S). You may use the resulting upgraded PRODUCT(S) only in accordance with all the terms of this EULA. + +8. COPYRIGHT. + +All title and copyrights in and to the SOFTWARE COMPONENT PRODUCT(S) (including but not limited to any copywritten images, demos, source code, intermediate files, packages, photographs, redistributables, animations, video, audio, music, text, and "applets" incorporated into the SOFTWARE COMPONENT PRODUCT(S) the accompanying printed materials, and any copies of the SOFTWARE COMPONENT PRODUCT(S)) are owned by DEVEXPRESS or its subsidiaries. The SOFTWARE COMPONENT PRODUCT(S) is protected by copyright laws and international treaty provisions and therefore, you must treat the SOFTWARE COMPONENT PRODUCT(S) like any other copyrighted material except that you may install the SOFTWARE COMPONENT PRODUCT(S) as described in this EULA. + +9. DUAL-MEDIA SOFTWARE COMPONENT PRODUCT(S). + +You may receive the SOFTWARE COMPONENT PRODUCT(S) in more than one medium. Regardless of the medium, you may use only one medium that is appropriate for your single computer. You may not loan, sell, rent, lease, or otherwise transfer in any manner the other medium to another user or entity. + +10. U.S. GOVERNMENT RESTRICTED RIGHTS. + +The Licensed Software is Commercial Computer Software provided with RESTRICTED RIGHTS under Federal Acquisition Regulations and agency supplements to them. Use, duplication or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFAR 255.227-7013 et. seq. or 252.211-7015, or subparagraphs (a) through (d) of the Commercial Computer Software Restricted Rights at FAR 52.227-19, as applicable, or similar clauses in the NASA FAR Supplement. Contractor-manufacturer is Developer Express Inc. / 6375 S. Pecos Rd Suite 118, Las Vegas NV 89120. + +11. EXPORT RESTRICTIONS. + +DEVEXPRESS expressly complies with all export restrictions imposed by the government of the United States of America. You, as Developer End User, must agree not to export or re-export the SOFTWARE COMPONENT PRODUCT(S) within any created application to any country, person, entity or end user subject to U.S.A. export restrictions. Restricted countries currently include, but are not necessarily limited to Cuba, Iran, Iraq, Libya, North Korea, Sudan, and Syria. You warrant and represent that neither the U.S.A. Bureau of Export Administration nor any other federal agency has suspended, revoked or denied your export privileges. + +12. NOTE ON JAVA SUPPORT. + +Certain SOFTWARE COMPONENT PRODUCT(S) may contain support for programs written in Java. Java technology is not fault tolerant and is not designed, manufactured, or intended for use or resale as on-line control equipment in hazardous environments requiring fail-safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines, or weapons systems, in which the failure of Java technology could lead directly to death, personal injury, or severe physical or environmental damage. + +13. DISCLAIMER OF WARRANTY. + +DEVEXPRESS expressly disclaims any warranty for the SOFTWARE COMPONENT PRODUCT(S). THE SOFTWARE COMPONENT PRODUCT(S) AND ANY RELATED DOCUMENTATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. DEVEXPRESS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY REPRESENTATIONS REGARDING THE USE, OR THE RESULTS OF THE USE, OF THE SOFTWARE COMPONENT PRODUCT(S) IN TERMS OF CORRECTNESS, ACCURACY, RELIABILITY, OR OTHERWISE. THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE COMPONENT PRODUCT(S) REMAINS WITH YOU. No oral or written information or advice given by DEVEXPRESS or its employees shall create a warranty or in any way increase the scope of this warranty. + +14. LIMITATIONS ON LIABILITY. + +To the maximum extent permitted by applicable law, in no event shall DEVEXPRESS be liable for any special, incidental, indirect, or consequential damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use the SOFTWARE COMPONENT PRODUCT(S) or the provision of or failure to provide Support Services, even if DEVEXPRESS has been advised of the possibility of such damages. + +Developer End User understands that the SOFTWARE COMPONENT PRODUCT(S) may produce inaccurate results because of a failure or fault within the SOFTWARE COMPONENT PRODUCT(S) or failure by Developer End User to properly use and or deploy the SOFTWARE COMPONENT PRODUCT(S). Developer End User assumes full and sole responsibility for any use of the SOFTWARE COMPONENT PRODUCT(S), and bears the entire risk for failures or faults within the SOFTWARE COMPONENT PRODUCT(S). You agree that regardless of the cause of failure or fault or the form of any claim, YOUR SOLE REMEDY AND DEVEXPRESS'S SOLE OBLIGATION SHALL BE GOVERNED BY THIS AGREEMENT AND IN NO EVENT SHALL DEVEXPRESS'S LIABILITY EXCEED THE PRICE PAID TO DEVEXPRESS FOR THE SOFTWARE COMPONENT PRODUCT(S). This Limited Warranty is void if failure of the SOFTWARE COMPONENT PRODUCT(S) has resulted from accident, abuse, alteration, unauthorized use or misapplication of the SOFTWARE COMPONENT PRODUCT(S). + +15. INDEMNIFICATION. + +You hereby agree to indemnify DEVEXPRESS and its officers, directors, employees, agents, and representatives from each and every demand, claim, loss, liability, or damage of any kind, including actual attorneys fees, whether in tort or contract, that it or any of them may incur by reason of, or arising out of, any claim which is made by any third party with respect to any breach or violation of this Agreement by you or any claims based on the Applications and the SOFTWARE COMPONENT PRODUCT(S) included herein. + +16. SUPPORT SERVICES. + +DEVEXPRESS may provide you with support services related to the SOFTWARE COMPONENT PRODUCT(S) ("Support Services"). Use of Support Services is governed by DEVEXPRESS policies and programs described in the user manual, in "on line" documentation and/or other DEVEXPRESS provided materials. Any supplemental SOFTWARE COMPONENT PRODUCT(S) provided to you as part of the Support Services shall be considered part of the SOFTWARE COMPONENT PRODUCT(S) and subject to the terms and conditions of this EULA. With respect to technical information you provide to DEVEXPRESS as part of the Support Services, DEVEXPRESS may use such information for its business purposes, including for SOFTWARE COMPONENT PRODUCT(s) support and development. DEVEXPRESS will not utilize such technical information in a form that personally identifies you. + +17. TERMINATION. + +Without prejudice to any other rights or remedies, DEVEXPRESS will terminate this EULA upon your failure to comply with all the terms and conditions of this EULA. In such events, you must destroy all copies of the SOFTWARE COMPONENT PRODUCT(S) and all of its component parts including any related documentation, and must remove ANY and ALL use of such technology immediately from any applications using technology contained in the SOFTWARE COMPONENT PRODUCT(S) developed by you, whether in native, altered or compiled state. + +18. TAX. + +DEVEXPRESS delivers its software electronically and does not collect sales or use tax for residents of US states in which it operates. You should confirm that your local, state, or federal government does not impose any sales or use tax on electronically delivered software. You are entirely liable for any such sales or use tax. + +19. MISCELLANEOUS. + +This EULA shall be construed, interpreted and governed by the laws of the State of Nevada, U.S.A. This EULA gives you specific legal rights; you may have others that vary from state to state and from country to country. + +This EULA may only be modified in writing signed by you and an authorized officer of DEVELOPER EXPRESS INC. If any provision of this EULA is found void or unenforceable, the remainder will remain valid and enforceable according to its terms. If any remedy provided is determined to have failed for its essential purpose, all limitations of liability and exclusions of damages set forth in the Limited Warranty shall remain in effect. + +DEVEXPRESS reserves all rights not specifically granted in this EULA. + +ACKNOWLEDGEMENTS. Developer End User acknowledges that he or she has read this Agreement, understands it, and agrees to be bound by its terms and conditions. + +Should you have any questions concerning this EULA, or if you desire to contact DEVEXPRESS for any reason, please contact us directly at us in the United States of America at 702-262-0609, or write: Developer Express Inc. Legal department / 6330 McLeod Dr Suite 1, Las Vegas NV 89120. + diff --git a/official/x.35/ExpressLayout Control/Help/LayoutControl.cnt b/official/x.35/ExpressLayout Control/Help/LayoutControl.cnt new file mode 100644 index 00000000..43339cd3 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Help/LayoutControl.cnt @@ -0,0 +1,77 @@ +:Base LayoutControl.hlp +:Title ExpressLayout Control +:Index ExpressLayout Control=LayoutControl.hlp +1 ExpressLayout Control +2 How To Get Support=IDH_Support +2 Base Concepts +3 Groups=ExpressLayoutControl_Groups +3 Items=ExpressLayoutControl_Items +3 Changing Layouts=Layout_Changing +3 Layout Alignment Constraint=LayoutAlignmentConstraint +3 Look and Feel Styles=Look_and_Feel_Styles +3 Look and Feel Offsets=LookAndFeelOffsets +2 Reference +3 Units +4 dxLayoutCommon Unit Overview=IDH_Unit_dxLayoutCommon +4 dxLayoutControl Unit Overview=IDH_Unit_dxLayoutControl +4 dxLayoutLookAndFeels Unit Overview=IDH_Unit_dxLayoutLookAndFeels +3 Components +4 TdxLayoutControl=IDH_Class_TdxLayoutControl +4 TdxLayoutLookAndFeelList=IDH_Class_TdxLayoutLookAndFeelList +3 Controls +4 TdxCustomLayoutControl=IDH_Class_TdxCustomLayoutControl +4 TdxLayoutControl=IDH_Class_TdxLayoutControl +3 Groups And Items +4 TdxCustomLayoutItem=IDH_Class_TdxCustomLayoutItem +4 TdxLayoutItem=IDH_Class_TdxLayoutItem +4 TdxLayoutGroup=IDH_Class_TdxLayoutGroup +4 Options +5 TdxCustomLayoutItemOptions=IDH_Class_TdxCustomLayoutItemOptions +5 TdxCustomLayoutItemCaptionOptions=IDH_Class_TdxCustomLayoutItemCaptionOptions +5 TdxLayoutItemCaptionOptions=IDH_Class_TdxLayoutItemCaptionOptions +5 TdxLayoutItemControlOptions=IDH_Class_TdxLayoutItemControlOptions +5 TdxLayoutOffsets=IDH_Class_TdxLayoutOffsets +3 HitTests +4 TdxCustomLayoutHitTest=IDH_Class_TdxCustomLayoutHitTest +4 TdxCustomLayoutItemHitTest=IDH_Class_TdxCustomLayoutItemHitTest +4 TdxLayoutGroupHitTest=IDH_Class_TdxLayoutGroupHitTest +4 TdxLayoutItemHitTest=IDH_Class_TdxLayoutItemHitTest +4 TdxLayoutClientAreaHitTest=IDH_Class_TdxLayoutClientAreaHitTest +4 TdxLayoutCustomizeFormHitTest=IDH_Class_TdxLayoutCustomizeFormHitTest +4 TdxLayoutNoneHitTest=IDH_Class_TdxLayoutNoneHitTest +4 Constants +5 htClientArea constant=IDH_Const_htClientArea +5 htGroup constant=IDH_Const_htGroup +5 htItem constant=IDH_Const_htItem +5 htCustomizeForm constant=IDH_Const_htCustomizeForm +5 htNone constant=IDH_Const_htNone +5 htError constant=IDH_Const_htError +3 Look and Feel +4 TdxCustomLayoutLookAndFeel=IDH_Class_TdxCustomLayoutLookAndFeel +4 TdxLayoutStandardLookAndFeel=IDH_Class_TdxLayoutStandardLookAndFeel +4 TdxLayoutOfficeLookAndFeel=IDH_Class_TdxLayoutOfficeLookAndFeel +4 TdxLayoutWebLookAndFeel=IDH_Class_TdxLayoutWebLookAndFeel +4 TdxLayoutLookAndFeelDefs=IDH_Class_TdxLayoutLookAndFeelDefs +4 TdxLayoutLookAndFeelOffsets=IDH_Class_TdxLayoutLookAndFeelOffsets +4 Options +5 Group And Item Options +6 TdxCustomLayoutLookAndFeelOptions=IDH_Class_TdxCustomLayoutLookAndFeelOptions +6 Group Options +7 TdxLayoutLookAndFeelGroupOptions=IDH_Class_TdxLayoutLookAndFeelGroupOptions +7 TdxLayoutStandardLookAndFeelGroupOptions=IDH_Class_TdxLayoutStandardLookAndFeelGroupOptions +7 TdxLayoutWebLookAndFeelGroupOptions=IDH_Class_TdxLayoutWebLookAndFeelGroupOptions +6 Item Options +7 TdxLayoutLookAndFeelItemOptions=IDH_Class_TdxLayoutLookAndFeelItemOptions +7 TdxLayoutStandardLookAndFeelItemOptions=IDH_Class_TdxLayoutStandardLookAndFeelItemOptions +7 TdxLayoutWebLookAndFeelItemOptions=IDH_Class_TdxLayoutWebLookAndFeelItemOptions +5 Caption Options +6 TdxLayoutLookAndFeelCaptionOptions=IDH_Class_TdxLayoutLookAndFeelCaptionOptions +6 TdxLayoutStandardLookAndFeelGroupCaptionOptions=IDH_Class_TdxLayoutStandardLookAndFeelGroupCaptionOptions +6 TdxLayoutStandardLookAndFeelItemCaptionOptions=IDH_Class_TdxLayoutStandardLookAndFeelItemCaptionOptions +6 TdxLayoutWebLookAndFeelGroupCaptionOptions=IDH_Class_TdxLayoutWebLookAndFeelGroupCaptionOptions +6 TdxLayoutWebLookAndFeelItemCaptionOptions=IDH_Class_TdxLayoutWebLookAndFeelItemCaptionOptions +3 Alignment Constraint +4 TdxLayoutAlignmentConstraint=IDH_Class_TdxLayoutAlignmentConstraint +3 Common Functions +4 GetPlainString=IDH_dxLayoutCommon_GetPlainString +4 GetHotTrackColor=IDH_dxLayoutCommon_GetHotTrackColor diff --git a/official/x.35/ExpressLayout Control/Help/LayoutControl.hlp b/official/x.35/ExpressLayout Control/Help/LayoutControl.hlp new file mode 100644 index 00000000..97d5bd01 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Help/LayoutControl.hlp differ diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC10.bpk b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC10.bpk new file mode 100644 index 00000000..25dd02ea --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC10.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxLayoutControlC10.bpl +OBJFILES = dxLayoutDesignCommon.obj dxLayoutDesignForm.obj dxLayoutLookAndFeelListDesignForm.obj \ + dxLayoutControlReg.obj dcldxLayoutControlC10.obj +MAINSOURCE = dcldxLayoutControlC10.cpp +RESFILES = dcldxLayoutControlC10.res dxLayoutControlReg.dcr +RESDEPEN = $(RESFILES) dxLayoutDesignForm.dfm dxLayoutLookAndFeelListDesignForm.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dxLayoutControlC10.bpi cxLibraryC10.bpi dxComnC10.bpi dclcxLibraryC10.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressLayout Control by Developer Express Inc." -aa -Tpp -x -Gn -Gpd -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC10.cpp b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC10.cpp new file mode 100644 index 00000000..25e89597 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC10.cpp @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxLayoutControlReg.dcr"); +USERES("dcldxLayoutControlC10.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxComnC10.bpi"); +USEPACKAGE("dxLayoutControlC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("dclcxLibraryC10.bpi"); +USEUNIT("dxLayoutDesignCommon.pas"); +USEFORMNS("dxLayoutDesignForm.pas", dxLayoutDesignForm, DesignForm); +USEFORMNS("dxLayoutLookAndFeelListDesignForm.pas", dxLayoutLookAndFeelListDesignForm, LookAndFeelListDesignForm); +USEUNIT("dxLayoutControlReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC10.res b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC10.res new file mode 100644 index 00000000..f5b8b1a9 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC10.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC11.bpk b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC11.bpk new file mode 100644 index 00000000..68425be0 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC11.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxLayoutControlC11.bpl +OBJFILES = dxLayoutDesignCommon.obj dxLayoutDesignForm.obj dxLayoutLookAndFeelListDesignForm.obj \ + dxLayoutControlReg.obj dcldxLayoutControlC11.obj +MAINSOURCE = dcldxLayoutControlC11.cpp +RESFILES = dcldxLayoutControlC11.res dxLayoutControlReg.dcr +RESDEPEN = $(RESFILES) dxLayoutDesignForm.dfm dxLayoutLookAndFeelListDesignForm.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dxLayoutControlC11.bpi cxLibraryC11.bpi dxComnC11.bpi dclcxLibraryC11.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressLayout Control by Developer Express Inc." -aa -Tpp -x -Gn -Gpd -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC11.cpp b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC11.cpp new file mode 100644 index 00000000..ddbf4ea7 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC11.cpp @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxLayoutControlReg.dcr"); +USERES("dcldxLayoutControlC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxComnC11.bpi"); +USEPACKAGE("dxLayoutControlC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEUNIT("dxLayoutDesignCommon.pas"); +USEFORMNS("dxLayoutDesignForm.pas", dxLayoutDesignForm, DesignForm); +USEFORMNS("dxLayoutLookAndFeelListDesignForm.pas", dxLayoutLookAndFeelListDesignForm, LookAndFeelListDesignForm); +USEUNIT("dxLayoutControlReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC11.res b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC11.res new file mode 100644 index 00000000..ac01137d Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC11.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC5.bpk b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC5.bpk new file mode 100644 index 00000000..5e451652 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC5.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dcldxLayoutControlC5.bpl +OBJFILES = dxLayoutDesignCommon.obj dxLayoutDesignForm.obj dxLayoutLookAndFeelListDesignForm.obj \ + dxLayoutControlReg.obj dcldxLayoutControlC5.obj +RESFILES = dcldxLayoutControlC5.res dxLayoutControlReg.dcr +RESDEPEN = $(RESFILES) dxLayoutDesignForm.dfm dxLayoutLookAndFeelListDesignForm.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = Vcl50.lib +PACKAGES = vcl50.bpi dxLayoutControlC5.bpi cxLibraryVCLC5.bpi dxComnC5.bpi dclcxLibraryVCLC5.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressLayout Control by Developer Express Inc." -aa -Tpp -x -Gn -Gpd -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC5.cpp b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC5.cpp new file mode 100644 index 00000000..dd213f43 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC5.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxLayoutControlC5.res"); +USERES("dxLayoutControlReg.dcr"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("dxComnC5.bpi"); +USEPACKAGE("dxLayoutControlC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("dclcxLibraryVCLC5.bpi"); +USEUNIT("dxLayoutDesignCommon.pas"); +USEFORMNS("dxLayoutDesignForm.pas", dxLayoutDesignForm, DesignForm); +USEFORMNS("dxLayoutLookAndFeelListDesignForm.pas", dxLayoutLookAndFeelListDesignForm, LookAndFeelListDesignForm); +USEUNIT("dxLayoutControlReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC5.res b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC5.res new file mode 100644 index 00000000..c2a0334f Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC5.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC6.bpk b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC6.bpk new file mode 100644 index 00000000..2db1f8c1 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC6.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxLayoutControlC6.bpl +OBJFILES = dxLayoutDesignCommon.obj dxLayoutDesignForm.obj dxLayoutLookAndFeelListDesignForm.obj \ + dxLayoutControlReg.obj dcldxLayoutControlC6.obj +RESFILES = dcldxLayoutControlC6.res dxLayoutControlReg.dcr +RESDEPEN = $(RESFILES) dxLayoutDesignForm.dfm dxLayoutLookAndFeelListDesignForm.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dxLayoutControlC6.bpi cxLibraryVCLC6.bpi dxComnC6.bpi dclcxLibraryVCLC6.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressLayout Control by Developer Express Inc." -aa -Tpp -x -Gn -Gpd -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC6.cpp b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC6.cpp new file mode 100644 index 00000000..5e121c05 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC6.cpp @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxLayoutControlReg.dcr"); +USERES("dcldxLayoutControlC6.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxComnC6.bpi"); +USEPACKAGE("dxLayoutControlC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("dclcxLibraryVCLC6.bpi"); +USEUNIT("dxLayoutDesignCommon.pas"); +USEFORMNS("dxLayoutDesignForm.pas", dxLayoutDesignForm, DesignForm); +USEFORMNS("dxLayoutLookAndFeelListDesignForm.pas", dxLayoutLookAndFeelListDesignForm, LookAndFeelListDesignForm); +USEUNIT("dxLayoutControlReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC6.res b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC6.res new file mode 100644 index 00000000..d9eb032a Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlC6.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD10.dpk b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD10.dpk new file mode 100644 index 00000000..ed2eef82 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD10.dpk @@ -0,0 +1,42 @@ +package dcldxLayoutControlD10; + +{$R *.res} +{$R dxLayoutControlReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressLayout Control by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxLayoutControlD10, + dclcxLibraryD10; + +contains + dxLayoutLookAndFeelListDesignForm, + dxLayoutDesignCommon, + dxLayoutDesignForm, + dxLayoutControlReg; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD10.res b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD10.res new file mode 100644 index 00000000..59f3164c Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD10.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD11.dpk b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD11.dpk new file mode 100644 index 00000000..13acc46e --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD11.dpk @@ -0,0 +1,42 @@ +package dcldxLayoutControlD11; + +{$R *.res} +{$R dxLayoutControlReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressLayout Control by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxLayoutControlD11, + dclcxLibraryD11; + +contains + dxLayoutLookAndFeelListDesignForm, + dxLayoutDesignCommon, + dxLayoutDesignForm, + dxLayoutControlReg; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD11.res b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD11.res new file mode 100644 index 00000000..36b2fabf Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD11.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD5.dpk b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD5.dpk new file mode 100644 index 00000000..c1eb0a01 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD5.dpk @@ -0,0 +1,41 @@ +package dcldxLayoutControlD5; + +{$R *.RES} +{$R dxLayoutControlReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressLayout Control by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxLayoutControlD5, + dclcxLibraryVCLD5; + +contains + dxLayoutDesignCommon, + dxLayoutDesignForm, + dxLayoutLookAndFeelListDesignForm, + dxLayoutControlReg; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD5.res b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD5.res new file mode 100644 index 00000000..ba4f496b Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD5.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD6.dpk b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD6.dpk new file mode 100644 index 00000000..62ce78ad --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD6.dpk @@ -0,0 +1,42 @@ +package dcldxLayoutControlD6; + +{$R *.RES} +{$R dxLayoutControlReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressLayout Control by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxLayoutControlD6, + dclcxLibraryVCLD6; + +contains + dxLayoutDesignCommon, + dxLayoutDesignForm, + dxLayoutLookAndFeelListDesignForm, + dxLayoutControlReg; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD6.res b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD6.res new file mode 100644 index 00000000..1184242c Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD6.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD7.dpk b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD7.dpk new file mode 100644 index 00000000..c6ca9c4b --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD7.dpk @@ -0,0 +1,42 @@ +package dcldxLayoutControlD7; + +{$R *.res} +{$R dxLayoutControlReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressLayout Control by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxLayoutControlD7, + dclcxLibraryVCLD7; + +contains + dxLayoutLookAndFeelListDesignForm, + dxLayoutDesignCommon, + dxLayoutDesignForm, + dxLayoutControlReg; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD7.res b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD7.res new file mode 100644 index 00000000..1e93b780 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD7.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD9.dpk b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD9.dpk new file mode 100644 index 00000000..4c3bac99 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD9.dpk @@ -0,0 +1,42 @@ +package dcldxLayoutControlD9; + +{$R *.res} +{$R dxLayoutControlReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressLayout Control by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxLayoutControlD9, + dclcxLibraryD9; + +contains + dxLayoutLookAndFeelListDesignForm, + dxLayoutDesignCommon, + dxLayoutDesignForm, + dxLayoutControlReg; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD9.res b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD9.res new file mode 100644 index 00000000..ae40f6d8 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dcldxLayoutControlD9.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC10.bpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC10.bpk new file mode 100644 index 00000000..18cf21c5 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC10.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxLayoutControlC10.bpl +OBJFILES = dxLayoutCommon.obj dxLayoutControl.obj dxLayoutControlAdapters.obj \ + dxLayoutCustomizeForm.obj dxLayoutEditForm.obj dxLayoutLookAndFeels.obj dxLayoutControlC10.obj +MAINSOURCE = dxLayoutControlC10.cpp +RESFILES = dxLayoutControlC10.res +RESDEPEN = $(RESFILES) dxLayoutCustomizeForm.dfm dxLayoutEditForm.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dxComnC10.bpi cxLibraryC10.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressLayout Control by Developer Express Inc." -aa -Tpp -x -Gn -Gpr -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC10.cpp b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC10.cpp new file mode 100644 index 00000000..090f1ead --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC10.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxLayoutControlC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxComnC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEUNIT("dxLayoutCommon.pas"); +USEUNIT("dxLayoutControl.pas"); +USEUNIT("dxLayoutControlAdapters.pas"); +USEFORMNS("dxLayoutCustomizeForm.pas", dxLayoutCustomizeForm, LayoutCustomizeForm); +USEFORMNS("dxLayoutEditForm.pas", dxLayoutEditForm, LayoutEditForm); +USEUNIT("dxLayoutLookAndFeels.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC10.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC10.res new file mode 100644 index 00000000..4a013b1e Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC10.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC11.bpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC11.bpk new file mode 100644 index 00000000..2cf455e5 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC11.bpk @@ -0,0 +1,139 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxLayoutControlC11.bpl +OBJFILES = dxLayoutCommon.obj dxLayoutControl.obj dxLayoutControlAdapters.obj \ + dxLayoutCustomizeForm.obj dxLayoutEditForm.obj dxLayoutLookAndFeels.obj dxLayoutControlC11.obj +MAINSOURCE = dxLayoutControlC11.cpp +RESFILES = dxLayoutControlC11.res +RESDEPEN = $(RESFILES) dxLayoutCustomizeForm.dfm dxLayoutEditForm.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dxComnC11.bpi cxLibraryC11.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressLayout Control by Developer Express Inc." -aa -Tpp -x -Gn -Gpr -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC11.cpp b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC11.cpp new file mode 100644 index 00000000..a2a5d30a --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC11.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxLayoutControlC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxComnC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEUNIT("dxLayoutCommon.pas"); +USEUNIT("dxLayoutControl.pas"); +USEUNIT("dxLayoutControlAdapters.pas"); +USEFORMNS("dxLayoutCustomizeForm.pas", dxLayoutCustomizeForm, LayoutCustomizeForm); +USEFORMNS("dxLayoutEditForm.pas", dxLayoutEditForm, LayoutEditForm); +USEUNIT("dxLayoutLookAndFeels.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC11.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC11.res new file mode 100644 index 00000000..8d9d7ef7 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC11.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC5.bpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC5.bpk new file mode 100644 index 00000000..e8545740 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC5.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxLayoutControlC5.bpl +OBJFILES = dxLayoutCommon.obj dxLayoutControl.obj dxLayoutControlAdapters.obj \ + dxLayoutCustomizeForm.obj dxLayoutEditForm.obj dxLayoutLookAndFeels.obj dxLayoutControlC5.obj +RESFILES = dxLayoutControlC5.res +RESDEPEN = $(RESFILES) dxLayoutCustomizeForm.dfm dxLayoutEditForm.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = Vcl50.lib +PACKAGES = vcl50.bpi dxComnC5.bpi cxLibraryVCLC5.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressLayout Control by Developer Express Inc." -aa -Tpp -x -Gn -Gpr -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC5.cpp b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC5.cpp new file mode 100644 index 00000000..8fddc6bd --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC5.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxLayoutControlC5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("dxComnC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEUNIT("dxLayoutCommon.pas"); +USEUNIT("dxLayoutControl.pas"); +USEUNIT("dxLayoutControlAdapters.pas"); +USEFORMNS("dxLayoutCustomizeForm.pas", dxLayoutCustomizeForm, LayoutCustomizeForm); +USEFORMNS("dxLayoutEditForm.pas", dxLayoutEditForm, LayoutEditForm); +USEUNIT("dxLayoutLookAndFeels.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC5.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC5.res new file mode 100644 index 00000000..c0234520 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC5.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC6.bpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC6.bpk new file mode 100644 index 00000000..aacd1d9e --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC6.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxLayoutControlC6.bpl +OBJFILES = dxLayoutCommon.obj dxLayoutControl.obj dxLayoutControlAdapters.obj \ + dxLayoutCustomizeForm.obj dxLayoutEditForm.obj dxLayoutLookAndFeels.obj dxLayoutControlC6.obj +RESFILES = dxLayoutControlC6.res +RESDEPEN = $(RESFILES) dxLayoutCustomizeForm.dfm dxLayoutEditForm.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dxComnC6.bpi cxLibraryVCLC6.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressLayout Control by Developer Express Inc." -aa -Tpp -x -Gn -Gpr -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC6.cpp b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC6.cpp new file mode 100644 index 00000000..e38fe47b --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC6.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxLayoutControlC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxComnC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEUNIT("dxLayoutCommon.pas"); +USEUNIT("dxLayoutControl.pas"); +USEUNIT("dxLayoutControlAdapters.pas"); +USEFORMNS("dxLayoutCustomizeForm.pas", dxLayoutCustomizeForm, LayoutCustomizeForm); +USEFORMNS("dxLayoutEditForm.pas", dxLayoutEditForm, LayoutEditForm); +USEUNIT("dxLayoutLookAndFeels.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC6.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC6.res new file mode 100644 index 00000000..0203501c Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlC6.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD10.dpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD10.dpk new file mode 100644 index 00000000..e7425366 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD10.dpk @@ -0,0 +1,42 @@ +package dxLayoutControlD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressLayout Control by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxComnD10, + cxLibraryD10; + +contains + dxLayoutLookAndFeels, + dxLayoutControl, + dxLayoutControlAdapters, + dxLayoutCustomizeForm, + dxLayoutEditForm, + dxLayoutCommon; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD10.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD10.res new file mode 100644 index 00000000..f9f7ed40 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD10.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD11.dpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD11.dpk new file mode 100644 index 00000000..af096c5e --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD11.dpk @@ -0,0 +1,42 @@ +package dxLayoutControlD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressLayout Control by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxComnD11, + cxLibraryD11; + +contains + dxLayoutLookAndFeels, + dxLayoutControl, + dxLayoutControlAdapters, + dxLayoutCustomizeForm, + dxLayoutEditForm, + dxLayoutCommon; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD11.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD11.res new file mode 100644 index 00000000..fb066ba0 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD11.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD5.dpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD5.dpk new file mode 100644 index 00000000..b0003497 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD5.dpk @@ -0,0 +1,42 @@ +package dxLayoutControlD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressLayout Control by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxComnD5, + cxLibraryVCLD5; + +contains + dxLayoutCommon, + dxLayoutControl, + dxLayoutControlAdapters, + dxLayoutCustomizeForm, + dxLayoutEditForm, + dxLayoutLookAndFeels; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD5.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD5.res new file mode 100644 index 00000000..a3cca502 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD5.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD6.dpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD6.dpk new file mode 100644 index 00000000..158b07b3 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD6.dpk @@ -0,0 +1,42 @@ +package dxLayoutControlD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressLayout Control by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxComnD6, + cxLibraryVCLD6; + +contains + dxLayoutLookAndFeels, + dxLayoutControl, + dxLayoutControlAdapters, + dxLayoutCustomizeForm, + dxLayoutEditForm, + dxLayoutCommon; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD6.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD6.res new file mode 100644 index 00000000..529bf69c Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD6.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD7.dpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD7.dpk new file mode 100644 index 00000000..52703ef6 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD7.dpk @@ -0,0 +1,42 @@ +package dxLayoutControlD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressLayout Control by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxComnD7, + cxLibraryVCLD7; + +contains + dxLayoutLookAndFeels, + dxLayoutControl, + dxLayoutControlAdapters, + dxLayoutCustomizeForm, + dxLayoutEditForm, + dxLayoutCommon; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD7.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD7.res new file mode 100644 index 00000000..aedb6bf7 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD7.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD9.dpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD9.dpk new file mode 100644 index 00000000..b2cbaf86 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD9.dpk @@ -0,0 +1,42 @@ +package dxLayoutControlD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressLayout Control by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxComnD9, + cxLibraryD9; + +contains + dxLayoutLookAndFeels, + dxLayoutControl, + dxLayoutControlAdapters, + dxLayoutCustomizeForm, + dxLayoutEditForm, + dxLayoutCommon; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD9.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD9.res new file mode 100644 index 00000000..07a89071 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlD9.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC10.bpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC10.bpk new file mode 100644 index 00000000..eb428166 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC10.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxLayoutControlcxEditAdaptersC10.bpl +OBJFILES = dxLayoutcxEditAdapters.obj dxLayoutControlcxEditAdaptersC10.obj +MAINSOURCE = dxLayoutControlcxEditAdaptersC10.cpp +RESFILES = dxLayoutControlcxEditAdaptersC10.res +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dxLayoutControlC10.bpi cxLibraryC10.bpi cxEditorsC10.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressLayoutControl Adapters for ExpressEditors Library 5 by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC10.cpp b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC10.cpp new file mode 100644 index 00000000..a1b49adc --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC10.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxLayoutControlcxEditAdaptersC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxComnC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("dxLayoutControlC10.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEUNIT("dxLayoutcxEditAdapters.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC10.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC10.res new file mode 100644 index 00000000..fd7a3491 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC10.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC11.bpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC11.bpk new file mode 100644 index 00000000..93811a8c --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC11.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxLayoutControlcxEditAdaptersC11.bpl +OBJFILES = dxLayoutcxEditAdapters.obj dxLayoutControlcxEditAdaptersC11.obj +MAINSOURCE = dxLayoutControlcxEditAdaptersC11.cpp +RESFILES = dxLayoutControlcxEditAdaptersC11.res +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dxLayoutControlC11.bpi cxLibraryC11.bpi cxEditorsC11.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressLayoutControl Adapters for ExpressEditors Library 5 by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC11.cpp b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC11.cpp new file mode 100644 index 00000000..4d1b3fd7 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxLayoutControlcxEditAdaptersC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxComnC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxLayoutControlC11.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEUNIT("dxLayoutcxEditAdapters.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC11.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC11.res new file mode 100644 index 00000000..6db904fe Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC11.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC5.bpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC5.bpk new file mode 100644 index 00000000..086f7efd --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC5.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxLayoutControlcxEditAdaptersC5.bpl +OBJFILES = dxLayoutcxEditAdapters.obj dxLayoutControlcxEditAdaptersC5.obj +RESFILES = dxLayoutControlcxEditAdaptersC5.res +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = Vcl50.lib +PACKAGES = vcl50.bpi dxLayoutControlC5.bpi cxLibraryVCLC5.bpi cxEditorsC5.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressLayoutControl Adapters for ExpressEditors Library 5 by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC5.cpp b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC5.cpp new file mode 100644 index 00000000..f2578912 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC5.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxLayoutControlcxEditAdaptersC5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("dxComnC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("dxLayoutControlC5.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEUNIT("dxLayoutcxEditAdapters.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC5.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC5.res new file mode 100644 index 00000000..0744b1e2 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC5.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC6.bpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC6.bpk new file mode 100644 index 00000000..3dbdedbc --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC6.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxLayoutControlcxEditAdaptersC6.bpl +OBJFILES = dxLayoutcxEditAdapters.obj dxLayoutControlcxEditAdaptersC6.obj +RESFILES = dxLayoutControlcxEditAdaptersC6.res +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dxLayoutControlC6.bpi cxLibraryVCLC6.bpi cxEditorsVCLC6.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressLayoutControl Adapters for ExpressEditors Library 5 by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC6.cpp b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC6.cpp new file mode 100644 index 00000000..7b5569bb --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC6.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxLayoutControlcxEditAdaptersC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxComnC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("dxLayoutControlC6.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEUNIT("dxLayoutcxEditAdapters.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC6.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC6.res new file mode 100644 index 00000000..81d7d0dc Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersC6.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD10.dpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD10.dpk new file mode 100644 index 00000000..9cbff119 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD10.dpk @@ -0,0 +1,36 @@ +package dxLayoutControlcxEditAdaptersD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressLayoutControl Adapters for ExpressEditors Library 5 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxLayoutControlD10, + cxEditorsD10; + +contains + dxLayoutcxEditAdapters; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD10.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD10.res new file mode 100644 index 00000000..89eb1585 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD10.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD11.dpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD11.dpk new file mode 100644 index 00000000..e1b5f3a3 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD11.dpk @@ -0,0 +1,36 @@ +package dxLayoutControlcxEditAdaptersD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressLayoutControl Adapters for ExpressEditors Library 5 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxLayoutControlD11, + cxEditorsD11; + +contains + dxLayoutcxEditAdapters; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD11.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD11.res new file mode 100644 index 00000000..bedb2b1c Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD11.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD5.dpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD5.dpk new file mode 100644 index 00000000..6953f412 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD5.dpk @@ -0,0 +1,36 @@ +package dxLayoutControlcxEditAdaptersD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressLayoutControl Adapters for ExpressEditors Library 5 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxLayoutControlD5, + cxEditorsD5; + +contains + dxLayoutcxEditAdapters; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD5.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD5.res new file mode 100644 index 00000000..5f4239ae Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD5.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD6.dpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD6.dpk new file mode 100644 index 00000000..0d13b7be --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD6.dpk @@ -0,0 +1,36 @@ +package dxLayoutControlcxEditAdaptersD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressLayoutControl Adapters for ExpressEditors Library 5 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxLayoutControlD6, + cxEditorsVCLD6; + +contains + dxLayoutcxEditAdapters; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD6.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD6.res new file mode 100644 index 00000000..ba187e03 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD6.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD7.dpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD7.dpk new file mode 100644 index 00000000..5dca3de5 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD7.dpk @@ -0,0 +1,36 @@ +package dxLayoutControlcxEditAdaptersD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressLayoutControl Adapters for ExpressEditors Library 5 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxLayoutControlD7, + cxEditorsVCLD7; + +contains + dxLayoutcxEditAdapters; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD7.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD7.res new file mode 100644 index 00000000..69a40d9c Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD7.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD9.dpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD9.dpk new file mode 100644 index 00000000..3a13c70c --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD9.dpk @@ -0,0 +1,36 @@ +package dxLayoutControlcxEditAdaptersD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressLayoutControl Adapters for ExpressEditors Library 5 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxLayoutControlD9, + cxEditorsD9; + +contains + dxLayoutcxEditAdapters; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD9.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD9.res new file mode 100644 index 00000000..ace41e5e Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControlcxEditAdaptersD9.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersC5.bpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersC5.bpk new file mode 100644 index 00000000..f93b432d --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersC5.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxLayoutControldxEditAdaptersC5.bpl +OBJFILES = dxLayoutdxEditAdapters.obj dxLayoutControldxEditAdaptersC5.obj +RESFILES = dxLayoutControldxEditAdaptersC5.res +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = Vcl50.lib +PACKAGES = vcl50.bpi dxLayoutControlC5.bpi dxEdtrC5.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressLayoutControl Adapters for ExpressEditors Library by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersC5.cpp b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersC5.cpp new file mode 100644 index 00000000..894d8350 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersC5.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxLayoutControldxEditAdaptersC5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("dxComnC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("dxLayoutControlC5.bpi"); +USEPACKAGE("dxEdtrC5.bpi"); +USEUNIT("dxLayoutdxEditAdapters.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersC5.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersC5.res new file mode 100644 index 00000000..1bac3f78 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersC5.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersC6.bpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersC6.bpk new file mode 100644 index 00000000..ab4aa7a8 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersC6.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxLayoutControldxEditAdaptersC6.bpl +OBJFILES = dxLayoutdxEditAdapters.obj dxLayoutControldxEditAdaptersC6.obj +RESFILES = dxLayoutControldxEditAdaptersC6.res +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dxLayoutControlC6.bpi dxEdtrC6.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressLayoutControl Adapters for ExpressEditors Library by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersC6.cpp b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersC6.cpp new file mode 100644 index 00000000..d868da09 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersC6.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxLayoutControldxEditAdaptersC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxComnC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("dxLayoutControlC6.bpi"); +USEPACKAGE("dxEdtrC6.bpi"); +USEUNIT("dxLayoutdxEditAdapters.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersC6.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersC6.res new file mode 100644 index 00000000..31d59744 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersC6.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersD5.dpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersD5.dpk new file mode 100644 index 00000000..fc5f3cb7 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersD5.dpk @@ -0,0 +1,36 @@ +package dxLayoutControldxEditAdaptersD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressLayoutControl Adapters for ExpressEditors Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxLayoutControlD5, + dxEdtrD5; + +contains + dxLayoutdxEditAdapters; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersD5.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersD5.res new file mode 100644 index 00000000..2acfffc4 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersD5.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersD6.dpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersD6.dpk new file mode 100644 index 00000000..1f46e18f --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersD6.dpk @@ -0,0 +1,36 @@ +package dxLayoutControldxEditAdaptersD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressLayoutControl Adapters for ExpressEditors Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxLayoutControlD6, + dxEdtrD6; + +contains + dxLayoutdxEditAdapters; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersD6.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersD6.res new file mode 100644 index 00000000..892c7263 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersD6.res differ diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersD7.dpk b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersD7.dpk new file mode 100644 index 00000000..b9d7985a --- /dev/null +++ b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersD7.dpk @@ -0,0 +1,36 @@ +package dxLayoutControldxEditAdaptersD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressLayoutControl Adapters for ExpressEditors Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxLayoutControlD7, + dxEdtrD7; + +contains + dxLayoutdxEditAdapters; + +end. diff --git a/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersD7.res b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersD7.res new file mode 100644 index 00000000..9da643db Binary files /dev/null and b/official/x.35/ExpressLayout Control/Packages/dxLayoutControldxEditAdaptersD7.res differ diff --git a/official/x.35/ExpressLayout Control/Sources/cxVer.inc b/official/x.35/ExpressLayout Control/Sources/cxVer.inc new file mode 100644 index 00000000..a26364cc --- /dev/null +++ b/official/x.35/ExpressLayout Control/Sources/cxVer.inc @@ -0,0 +1,172 @@ +{$B-} { Complete Boolean Evaluation } +{$R-} { Range-Checking } +{$T-} { Typed @ operator } +{$X+} { Extended syntax } +{$P+} { Open string params } +{$J+} { Writeable structured consts } +{$H+} { Use long strings by default } +{$Q-} { Overflow checking } + +{$DEFINE DXVER500} + +{$IFNDEF CLR} + {$DEFINE OLEDRAGANDDROP} + {$IFNDEF DONTUSEJPEGIMAGE} + {$DEFINE USEJPEGIMAGE} + {$ENDIF} +{$ENDIF} + +{$DEFINE EXPRESSBARS5} + +{$DEFINE VCL} + +{$IFNDEF VER80} + {$IFNDEF VER90} + {$IFNDEF VER93} + {$DEFINE DELPHI3} { Borland Delphi 3.0 } + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER110} { Borland C++Builder 3.0 } + {$DEFINE CBUILDER3} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE DELPHI4} +{$ENDIF} + +{$IFDEF VER125} { Borland C++Builder 4.0 } + {$DEFINE CBUILDER3} + {$DEFINE DELPHI4} + {$DEFINE CBUILDER4} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$IFDEF BCB} { Borland C++Builder 5.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$IFDEF BCB} { Borland C++Builder 6.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} +{$ENDIF} + +{$IFNDEF DELPHI6} + {$DEFINE MSWINDOWS} +{$ENDIF} +{$IFDEF LINUX} + {$UNDEF MSWINDOWS} +{$ENDIF} + +{$IFDEF LINUX} + {$DEFINE KYLIX1} { Borland Kylix 1 } + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF CompilerVersion >= 14} + {$DEFINE KYLIX2} { Borland Kylix 2 } + {$IFEND} + {$IF CompilerVersion >= 14.50} + {$DEFINE KYLIX3} { Borland Kylix 3 } + {$IFEND} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} { Borland Delphi.Net } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} +{$ENDIF} + +{$IFDEF VER170} { Borland Delphi 9.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} +{$ENDIF} + +{$IFDEF VER180} { Borland Delphi 10 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$IFDEF BCB} { Borland C++Builder 10 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Borland Delphi 11 //CodeGear} + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$DEFINE DELPHI11} + {$IFDEF BCB} { Borland C++Builder 11 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$DEFINE CBUILDER11} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFNDEF CLR} + {$IFNDEF BCB} + {$IFDEF DELPHI6} + {$DEFINE REGISTERSHELLCTRLS} + {$ENDIF} + {$ENDIF} + {$IFDEF DELPHI7} + {$WARN UNSAFE_CAST OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_TYPE OFF} + {$ENDIF} +{$ENDIF} + +{$IFDEF REGISTERSHELLCTRLS} + {$DEFINE REGISTERCXSHELLCTRLS} +{$ENDIF} + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} diff --git a/official/x.35/ExpressLayout Control/Sources/dxLayoutCommon.pas b/official/x.35/ExpressLayout Control/Sources/dxLayoutCommon.pas new file mode 100644 index 00000000..66be3033 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Sources/dxLayoutCommon.pas @@ -0,0 +1,146 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressLayoutControl common routines } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSLAYOUTCONTROL AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxLayoutCommon; + +{$I cxVer.inc} + +interface + +uses + SysUtils, TypInfo, Windows, Classes, Graphics, Forms; + +type + TdxLayoutSide = (sdLeft, sdRight, sdTop, sdBottom); + + IdxLayoutComponent = interface + ['{F31C9078-5732-44D8-9347-3EA7B93837E3}'] + procedure SelectionChanged; stdcall; + end; + + TdxLayoutDesigner = class(TComponent) + public + procedure RegisterComponent(AComponent: TComponent); virtual; abstract; + procedure UnregisterComponent(AComponent: TComponent); virtual; abstract; + + procedure ComponentNameChanged(AComponent: TComponent); virtual; abstract; + function GetDesigner(AComponent: TComponent): TCustomForm; virtual; abstract; + function GetUniqueName(AComponent: TComponent; const ABaseName: string): string; virtual; abstract; + function IsComponentSelected(AComponent: TComponent; + APersistent: TPersistent): Boolean; virtual; abstract; + function IsToolSelected: Boolean; virtual; abstract; + procedure ItemsChanged(AComponent: TComponent); virtual; abstract; + procedure SelectComponent(AComponent: TComponent; APersistent: TPersistent; + AInvertSelection: Boolean); virtual; abstract; + end; + +function GetHotTrackColor: TColor; +function GetPlainString(const S: string): string; +procedure SetComponentName(AComponent: TComponent; const ABaseName: string; + AIsDesigning, AIsLoading: Boolean); + +var + IsWin98Or2000: Boolean; + +var + dxLayoutDesigner: TdxLayoutDesigner; + +resourcestring + dxLayoutNewGroupCaption = 'New Group'; + dxLayoutNewGroupDialogCaption = 'New Group'; + dxLayoutNewGroupDialogEditCaption = 'Enter a new group caption:'; + + dxLayoutNewItemCaption = 'New Item'; + dxLayoutNewItemDialogCaption = 'New Item'; + dxLayoutNewItemDialogEditCaption = 'Enter a new item caption:'; + +implementation + +uses + cxClasses; + +{ routines } + +function GetHotTrackColor: TColor; +const + Colors: array[Boolean] of Integer = (COLOR_HIGHLIGHT, COLOR_HOTLIGHT); +begin + Result := GetSysColor(Colors[IsWin98Or2000]); +end; + +function GetPlainString(const S: string): string; +const + SpecialChars = [#10, #13]; +var + I: Integer; +begin + Result := S; + for I := Length(Result) downto 1 do + if Result[I] in SpecialChars then + Delete(Result, I, 1); +end; + +procedure SetComponentName(AComponent: TComponent; const ABaseName: string; + AIsDesigning, AIsLoading: Boolean); + + function GetName: string; + begin + if AIsDesigning and not AIsLoading then + Result := dxLayoutDesigner.GetUniqueName(AComponent, ABaseName) + else + Result := GetValidName(AComponent, ABaseName, True); + end; + +begin + AComponent.Name := GetName; +end; + +procedure RetrieveWindowsVersion; +var + AInfo: TOSVersionInfo; +begin + AInfo.dwOSVersionInfoSize := SizeOf(AInfo); + GetVersionEx(AInfo); + with AInfo do + IsWin98Or2000 := + (dwPlatformId = VER_PLATFORM_WIN32_WINDOWS) and (dwMinorVersion <> 0) or + (dwPlatformId = VER_PLATFORM_WIN32_NT) and (dwMajorVersion = 5); +end; + +initialization + RetrieveWindowsVersion; + +end. diff --git a/official/x.35/ExpressLayout Control/Sources/dxLayoutControl.pas b/official/x.35/ExpressLayout Control/Sources/dxLayoutControl.pas new file mode 100644 index 00000000..7aa9f22d --- /dev/null +++ b/official/x.35/ExpressLayout Control/Sources/dxLayoutControl.pas @@ -0,0 +1,9329 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressLayoutControl main components } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSLAYOUTCONTROL AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxLayoutControl; + +{$I cxVer.inc} + +interface + +uses + Messages, Windows, SysUtils, Classes, Controls, Graphics, Forms, StdCtrls, ExtCtrls, IniFiles, + cxClasses, cxGraphics, cxControls, cxLookAndFeels, dxLayoutLookAndFeels, cxLibraryConsts, + dxLayoutCommon; + +const + htError = -1; + htNone = 0; + htCustomizeForm = 1; + htItem = 10; + htGroup = 20; + htClientArea = 30; + + dxLayoutItemControlDefaultMinHeight = 20; + dxLayoutItemControlDefaultMinWidth = 20; + +// CM_FREEITEM = WM_DX + 25; + CM_PLACECONTROLS = WM_DX + 26; + +type + TdxCustomLayoutItem = class; + TdxLayoutItem = class; + TdxLayoutGroupClass = class of TdxLayoutGroup; + TdxLayoutGroup = class; + TdxLayoutAlignmentConstraint = class; + TdxCustomLayoutControl = class; + TdxCustomLayoutHitTest = class; + + TdxLayoutItemPainterClass = class of TdxLayoutItemPainter; + TdxLayoutItemPainter = class; + TdxLayoutGroupPainterClass = class of TdxLayoutGroupPainter; + TdxLayoutGroupPainter = class; + TdxLayoutControlPainterClass = class of TdxLayoutControlPainter; + TdxLayoutControlPainter = class; + + TdxCustomLayoutItemElementViewInfo = class; + TdxCustomLayoutItemCaptionViewInfo = class; + TdxCustomLayoutItemViewInfoClass = class of TdxCustomLayoutItemViewInfo; + TdxCustomLayoutItemViewInfo = class; + TdxLayoutItemControlViewInfo = class; + TdxLayoutItemViewInfoClass = class of TdxLayoutItemViewInfo; + TdxLayoutItemViewInfo = class; + TdxLayoutGroupViewInfoClass = class of TdxLayoutGroupViewInfo; + TdxLayoutGroupViewInfo = class; + TdxLayoutGroupStandardViewInfo = class; + TdxLayoutGroupWebViewInfo = class; + TdxLayoutControlViewInfoClass = class of TdxLayoutControlViewInfo; + TdxLayoutControlViewInfo = class; + + // custom item + + TdxLayoutAlignHorz = (ahLeft, ahCenter, ahRight, ahClient); + TdxLayoutAlignVert = (avTop, avCenter, avBottom, avClient); + TdxLayoutAutoAlign = (aaHorizontal, aaVertical); + TdxLayoutAutoAligns = set of TdxLayoutAutoAlign; + TdxLayoutDirection = (ldHorizontal, ldVertical); + + TdxCustomLayoutItemOptions = class(TPersistent) + private + FItem: TdxCustomLayoutItem; + protected + procedure Changed; virtual; + property Item: TdxCustomLayoutItem read FItem; + public + constructor Create(AItem: TdxCustomLayoutItem); virtual; + end; + + TdxCustomLayoutItemCaptionOptionsClass = class of TdxCustomLayoutItemCaptionOptions; + + TdxCustomLayoutItemCaptionOptions = class(TdxCustomLayoutItemOptions) + private + FAlignHorz: TAlignment; + FShowAccelChar: Boolean; + procedure SetAlignHorz(Value: TAlignment); + procedure SetShowAccelChar(Value: Boolean); + public + constructor Create(AItem: TdxCustomLayoutItem); override; + published + property AlignHorz: TAlignment read FAlignHorz write SetAlignHorz default taLeftJustify; + property ShowAccelChar: Boolean read FShowAccelChar write SetShowAccelChar default True; + end; + + TdxLayoutOffsets = class(TdxCustomLayoutItemOptions) + private + FBottom: Integer; + FLeft: Integer; + FRight: Integer; + FTop: Integer; + function GetValue(Index: Integer): Integer; + procedure SetValue(Index: Integer; Value: Integer); + published + property Bottom: Integer index 1 read GetValue write SetValue default 0; + property Left: Integer index 2 read GetValue write SetValue default 0; + property Right: Integer index 3 read GetValue write SetValue default 0; + property Top: Integer index 4 read GetValue write SetValue default 0; + end; + + TdxCustomLayoutItemClass = class of TdxCustomLayoutItem; + + TdxCustomLayoutItem = class(TComponent, IdxLayoutLookAndFeelUser) + private + FAlignHorz: TdxLayoutAlignHorz; + FAlignmentConstraint: TdxLayoutAlignmentConstraint; + FAlignVert: TdxLayoutAlignVert; + FAllowRemove: Boolean; + FAutoAligns: TdxLayoutAutoAligns; + FCachedTextHeight: Integer; + FCaption: string; + FCaptionOptions: TdxCustomLayoutItemCaptionOptions; + FContainer: TdxCustomLayoutControl; + FEnabled: Boolean; + FLookAndFeel: TdxCustomLayoutLookAndFeel; + FOffsets: TdxLayoutOffsets; + FParent: TdxLayoutGroup; + FShowCaption: Boolean; + FViewInfo: TdxCustomLayoutItemViewInfo; + FVisible: Boolean; + + FOnCaptionClick: TNotifyEvent; + + function GetActuallyVisible: Boolean; + function GetAlignHorz: TdxLayoutAlignHorz; + function GetAlignVert: TdxLayoutAlignVert; + function GetCaptionForCustomizeForm: string; + function GetHasMouse: Boolean; + function GetIndex: Integer; + function GetIsDesigning: Boolean; + function GetIsDestroying: Boolean; + function GetIsLoading: Boolean; + function GetIsRoot: Boolean; + function GetVisibleIndex: Integer; + procedure SetAlignHorz(Value: TdxLayoutAlignHorz); + procedure SetAlignmentConstraint(Value: TdxLayoutAlignmentConstraint); + procedure SetAlignVert(Value: TdxLayoutAlignVert); + procedure SetAutoAligns(Value: TdxLayoutAutoAligns); + procedure SetCaption(const Value: string); + procedure SetContainer(Value: TdxCustomLayoutControl); + procedure SetEnabled(Value: Boolean); + procedure SetLookAndFeel(Value: TdxCustomLayoutLookAndFeel); + procedure SetHasMouse(Value: Boolean); + procedure SetIndex(Value: Integer); + procedure SetParent(Value: TdxLayoutGroup); + procedure SetShowCaption(Value: Boolean); + procedure SetVisible(Value: Boolean); + procedure SetVisibleIndex(Value: Integer); + + procedure CheckActuallyVisible(APrevActuallyVisible: Boolean); + function IsAlignHorzStored: Boolean; + function IsAlignVertStored: Boolean; + protected + procedure SetName(const Value: TComponentName); override; + procedure SetParentComponent(Value: TComponent); override; + + procedure LookAndFeelChanged; virtual; + procedure LookAndFeelChanging; virtual; + // IdxLayoutLookAndFeelUser + procedure BeginLookAndFeelDestroying; stdcall; + procedure EndLookAndFeelDestroying; stdcall; + procedure IdxLayoutLookAndFeelUser.LookAndFeelChanged = LookAndFeelChangedImpl; + procedure LookAndFeelChangedImpl; stdcall; + procedure LookAndFeelDestroyed; stdcall; + + procedure ActuallyVisibleChanged; virtual; + function CanProcessAccel(out AItem: TdxCustomLayoutItem): Boolean; virtual; abstract; + function CanRemove: Boolean; virtual; + procedure DoCaptionClick; dynamic; + function DoProcessAccel: Boolean; dynamic; + procedure EnabledChanged; virtual; + function GetAutoAlignHorz: TdxLayoutAlignHorz; virtual; abstract; + function GetAutoAlignVert: TdxLayoutAlignVert; virtual; abstract; + function GetBaseName: string; virtual; + function GetCursor(X, Y: Integer): TCursor; virtual; + function GetEnabledForWork: Boolean; virtual; + function GetLookAndFeel: TdxCustomLayoutLookAndFeel; + function GetShowCaption: Boolean; virtual; + function GetViewInfoClass: TdxCustomLayoutItemViewInfoClass; virtual; abstract; + function GetVisible: Boolean; + function HasAsParent(AGroup: TdxLayoutGroup): Boolean; + function HasCaption: Boolean; virtual; + procedure Init; virtual; + procedure MouseEnter; dynamic; + procedure MouseLeave; dynamic; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); dynamic; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); dynamic; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); dynamic; + procedure ParentChanged(APrevParent: TdxLayoutGroup); virtual; + procedure ProcessAccel; dynamic; + function ProcessDialogChar(ACharCode: Word): Boolean; virtual; + procedure RestoreItemControlSize; virtual; abstract; + procedure SelectionChanged; virtual; + procedure VisibleChanged; virtual; + + function GetCaptionOptionsClass: TdxCustomLayoutItemCaptionOptionsClass; virtual; + + procedure ResetCachedTextHeight; + property CachedTextHeight: Integer read FCachedTextHeight write FCachedTextHeight; + + property EnabledForWork: Boolean read GetEnabledForWork; + property HasMouse: Boolean read GetHasMouse write SetHasMouse; + property IsDesigning: Boolean read GetIsDesigning; + property IsDestroying: Boolean read GetIsDestroying; + property IsLoading: Boolean read GetIsLoading; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure BeforeDestruction; override; + function GetParentComponent: TComponent; override; + function HasParent: Boolean; override; + + procedure Changed(AHardRefresh: Boolean = True); virtual; + + function CanMoveTo(AParent: TdxCustomLayoutItem): Boolean; virtual; + procedure MakeVisible; + function Move(AParent: TdxLayoutGroup; AIndex: Integer; APack: Boolean = False): Boolean; + function MoveTo(AParent: TdxLayoutGroup; AVisibleIndex: Integer; APack: Boolean = False): Boolean; + procedure Pack; virtual; + function PutIntoHiddenGroup(ALayoutDirection: TdxLayoutDirection): TdxLayoutGroup; + + property ActuallyVisible: Boolean read GetActuallyVisible; + property CaptionForCustomizeForm: string read GetCaptionForCustomizeForm; + property Container: TdxCustomLayoutControl read FContainer write SetContainer; + property Index: Integer read GetIndex write SetIndex; + property IsRoot: Boolean read GetIsRoot; + property Parent: TdxLayoutGroup read FParent write SetParent; + property ViewInfo: TdxCustomLayoutItemViewInfo read FViewInfo; + property VisibleIndex: Integer read GetVisibleIndex write SetVisibleIndex; + published + property AutoAligns: TdxLayoutAutoAligns read FAutoAligns write SetAutoAligns + default [aaHorizontal, aaVertical]; // must be loaded before AlignHorz/Vert + property AlignHorz: TdxLayoutAlignHorz read GetAlignHorz write SetAlignHorz + stored IsAlignHorzStored; + property AlignmentConstraint: TdxLayoutAlignmentConstraint read FAlignmentConstraint + write SetAlignmentConstraint; + property AlignVert: TdxLayoutAlignVert read GetAlignVert write SetAlignVert + stored IsAlignVertStored; + property AllowRemove: Boolean read FAllowRemove write FAllowRemove default True; + property Caption: string read FCaption write SetCaption; + property CaptionOptions: TdxCustomLayoutItemCaptionOptions read FCaptionOptions + write FCaptionOptions; + property Enabled: Boolean read FEnabled write SetEnabled default True; + property LookAndFeel: TdxCustomLayoutLookAndFeel read FLookAndFeel + write SetLookAndFeel; + property Offsets: TdxLayoutOffsets read FOffsets write FOffsets; + property ShowCaption: Boolean read GetShowCaption write SetShowCaption default True; + property Visible: Boolean read FVisible write SetVisible default True; + + property OnCaptionClick: TNotifyEvent read FOnCaptionClick write FOnCaptionClick; + end; + + // item + + TdxCustomLayoutControlAdapterClass = class of TdxCustomLayoutControlAdapter; + + TdxCustomLayoutControlAdapter = class + private + FItem: TdxLayoutItem; + function GetControl: TControl; + function GetLookAndFeel: TdxCustomLayoutLookAndFeel; + protected + function AllowCheckSize: Boolean; virtual; + procedure HideControlBorder; virtual; + procedure Init; virtual; + function ShowBorder: Boolean; virtual; + function ShowItemCaption: Boolean; virtual; + function UseItemColor: Boolean; virtual; + + property Control: TControl read GetControl; + property Item: TdxLayoutItem read FItem; + property LookAndFeel: TdxCustomLayoutLookAndFeel read GetLookAndFeel; + public + constructor Create(AItem: TdxLayoutItem); virtual; + procedure LookAndFeelChanged; virtual; + class procedure Register(AControlClass: TControlClass); + class procedure Unregister(AControlClass: TControlClass); + end; + + TdxCaptionLayout = (clLeft, clTop, clRight, clBottom); + + TdxAlignmentVert = (tavTop, tavCenter, tavBottom); + + TdxLayoutItemCaptionOptions = class(TdxCustomLayoutItemCaptionOptions) + private + FAlignVert: TdxAlignmentVert; + FLayout: TdxCaptionLayout; + FWidth: Integer; + procedure SetAlignVert(Value: TdxAlignmentVert); + procedure SetLayout(Value: TdxCaptionLayout); + procedure SetWidth(Value: Integer); + published + constructor Create(AItem: TdxCustomLayoutItem); override; + property AlignVert: TdxAlignmentVert read FAlignVert write SetAlignVert default tavCenter; + property Layout: TdxCaptionLayout read FLayout write SetLayout default clLeft; + property Width: Integer read FWidth write SetWidth default 0; + end; + + TdxLayoutItemControlOptionsClass = class of TdxLayoutItemControlOptions; + + TdxLayoutItemControlOptions = class(TdxCustomLayoutItemOptions) + private + FAutoAlignment: Boolean; + FAutoColor: Boolean; + FFixedSize: Boolean; + FMinHeight: Integer; + FMinWidth: Integer; + FOpaque: Boolean; + FShowBorder: Boolean; + procedure SetAutoAlignment(Value: Boolean); + procedure SetAutoColor(Value: Boolean); + procedure SetFixedSize(Value: Boolean); + procedure SetMinHeight(Value: Integer); + procedure SetMinWidth(Value: Integer); + procedure SetOpaque(Value: Boolean); + procedure SetShowBorder(Value: Boolean); + public + constructor Create(AItem: TdxCustomLayoutItem); override; + published + property AutoAlignment: Boolean read FAutoAlignment write SetAutoAlignment default True; + property AutoColor: Boolean read FAutoColor write SetAutoColor default False; + property FixedSize: Boolean read FFixedSize write SetFixedSize default False; + property MinHeight: Integer read FMinHeight write SetMinHeight default dxLayoutItemControlDefaultMinHeight; + property MinWidth: Integer read FMinWidth write SetMinWidth default dxLayoutItemControlDefaultMinWidth; + property Opaque: Boolean read FOpaque write SetOpaque default False; + property ShowBorder: Boolean read FShowBorder write SetShowBorder default True; + end; + + TdxLayoutItemClass = class of TdxLayoutItem; + + TdxLayoutItem = class(TdxCustomLayoutItem) + private + FControl: TControl; + FControlAdapter: TdxCustomLayoutControlAdapter; + FControlOptions: TdxLayoutItemControlOptions; + FOriginalControlSize: TPoint; + FPrevControlWndProc: TWndMethod; + + function GetCaptionOptions: TdxLayoutItemCaptionOptions; + function GetViewInfo: TdxLayoutItemViewInfo; + procedure SetCaptionOptions(Value: TdxLayoutItemCaptionOptions); + procedure SetControl(Value: TControl); + + procedure CreateControlAdapter; + //procedure PostFree; + protected + procedure ActuallyVisibleChanged; override; + function CanProcessAccel(out AItem: TdxCustomLayoutItem): Boolean; override; + procedure EnabledChanged; override; + function GetAutoAlignHorz: TdxLayoutAlignHorz; override; + function GetAutoAlignVert: TdxLayoutAlignVert; override; + function GetBaseName: string; override; + function GetViewInfoClass: TdxCustomLayoutItemViewInfoClass; override; + function HasCaption: Boolean; override; + procedure Init; override; + procedure Loaded; override; + procedure LookAndFeelChanged; override; + //procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure ParentChanged(APrevParent: TdxLayoutGroup); override; + procedure ProcessAccel; override; + procedure RestoreItemControlSize; override; + + function GetCaptionOptionsClass: TdxCustomLayoutItemCaptionOptionsClass; override; + function GetControlOptionsClass: TdxLayoutItemControlOptionsClass; virtual; + + function CanFocusControl: Boolean; virtual; + procedure ControlWndProc(var Message: TMessage); virtual; + function HasControl: Boolean; + function HasWinControl: Boolean; + procedure SaveOriginalControlSize; + procedure SetControlEnablement; + procedure SetControlVisibility; + + property ControlAdapter: TdxCustomLayoutControlAdapter read FControlAdapter; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + property OriginalControlSize: TPoint read FOriginalControlSize write FOriginalControlSize; + property ViewInfo: TdxLayoutItemViewInfo read GetViewInfo; + published + property CaptionOptions: TdxLayoutItemCaptionOptions read GetCaptionOptions + write SetCaptionOptions; + property Control: TControl read FControl write SetControl; + property ControlOptions: TdxLayoutItemControlOptions read FControlOptions + write FControlOptions; + end; + + // group + + TdxLayoutGroup = class(TdxCustomLayoutItem) + private + FHidden: Boolean; + FIsPacking: Boolean; + FIsUserDefined: Boolean; + FItems: TList; + FLayoutDirection: TdxLayoutDirection; + FLocked: Boolean; + FLookAndFeelException: Boolean; + FShowBorder: Boolean; + FUseIndent: Boolean; + FVisibleItems: TList; + + function GetCount: Integer; + function GetItem(Index: Integer): TdxCustomLayoutItem; + function GetShowBorder: Boolean; + function GetViewInfo: TdxLayoutGroupViewInfo; + function GetVisibleCount: Integer; + function GetVisibleItem(Index: Integer): TdxCustomLayoutItem; + procedure SetHidden(Value: Boolean); + procedure SetLayoutDirection(Value: TdxLayoutDirection); + procedure SetLocked(Value: Boolean); + procedure SetLookAndFeelException(Value: Boolean); + procedure SetShowBorder(Value: Boolean); + procedure SetUseIndent(Value: Boolean); + + procedure AddItem(AItem: TdxCustomLayoutItem); + procedure RemoveItem(AItem: TdxCustomLayoutItem); + procedure DestroyItems; + protected + procedure ActuallyVisibleChanged; override; + function CanProcessAccel(out AItem: TdxCustomLayoutItem): Boolean; override; + function CanRemove: Boolean; override; + procedure EnabledChanged; override; + function GetAutoAlignHorz: TdxLayoutAlignHorz; override; + function GetAutoAlignVert: TdxLayoutAlignVert; override; + function GetBaseName: string; override; + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + function GetShowCaption: Boolean; override; + function GetViewInfoClass: TdxCustomLayoutItemViewInfoClass; override; + procedure Loaded; override; + procedure LookAndFeelChanged; override; + procedure LookAndFeelChanging; override; + function ProcessDialogChar(ACharCode: Word): Boolean; override; + procedure RestoreItemControlSize; override; + procedure SelectionChanged; override; + procedure SetChildOrder(Child: TComponent; Order: Integer); override; + procedure SetParentComponent(Value: TComponent); override; + + function CanDestroy: Boolean; virtual; + procedure BuildVisibleItemsList; + function GetLookAndFeelAsParent: TdxCustomLayoutLookAndFeel; + + procedure ChangeItemIndex(AItem: TdxCustomLayoutItem; Value: Integer); + procedure ChangeItemVisibleIndex(AItem: TdxCustomLayoutItem; Value: Integer); + function GetItemIndex(AItemVisibleIndex: Integer): Integer; + function IndexOf(AItem: TdxCustomLayoutItem): Integer; + function VisibleIndexOf(AItem: TdxCustomLayoutItem): Integer; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + function CreateGroup(AGroupClass: TdxLayoutGroupClass = nil): TdxLayoutGroup; + function CreateItem(AItemClass: TdxCustomLayoutItemClass = nil): TdxCustomLayoutItem; + function CreateItemForControl(AControl: TControl): TdxLayoutItem; + + function CanMoveTo(AParent: TdxCustomLayoutItem): Boolean; override; + procedure MoveChildrenToParent; + procedure Pack; override; + function PutChildrenIntoHiddenGroup: TdxLayoutGroup; + + property Count: Integer read GetCount; + property Items[Index: Integer]: TdxCustomLayoutItem read GetItem; default; + property IsUserDefined: Boolean read FIsUserDefined; + property ViewInfo: TdxLayoutGroupViewInfo read GetViewInfo; + property VisibleCount: Integer read GetVisibleCount; + property VisibleItems[Index: Integer]: TdxCustomLayoutItem read GetVisibleItem; + published + property Hidden: Boolean read FHidden write SetHidden default False; + property LayoutDirection: TdxLayoutDirection read FLayoutDirection + write SetLayoutDirection default ldVertical; + property Locked: Boolean read FLocked write SetLocked default False; + property LookAndFeelException: Boolean read FLookAndFeelException + write SetLookAndFeelException default False; + property ShowBorder: Boolean read GetShowBorder write SetShowBorder default True; + property UseIndent: Boolean read FUseIndent write SetUseIndent default True; + end; + + // alignment constraint + + TdxLayoutAlignmentConstraintKind = (ackLeft, ackTop, ackRight, ackBottom); + + TdxLayoutAlignmentConstraintClass = class of TdxLayoutAlignmentConstraint; + + TdxLayoutAlignmentConstraint = class(TComponent) + private + FControl: TdxCustomLayoutControl; + FItems: TList; + FKind: TdxLayoutAlignmentConstraintKind; + function GetCount: Integer; + function GetItem(Index: Integer): TdxCustomLayoutItem; + procedure SetKind(Value: TdxLayoutAlignmentConstraintKind); + procedure CreateItems; + procedure DestroyItems; + protected + procedure SetParentComponent(Value: TComponent); override; + + procedure BeginUpdate; + function CanAddItem(AItem: TdxCustomLayoutItem): Boolean; virtual; + procedure Changed; virtual; + procedure EndUpdate; + + property Control: TdxCustomLayoutControl read FControl; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function GetParentComponent: TComponent; override; + function HasParent: Boolean; override; + + procedure AddItem(AItem: TdxCustomLayoutItem); + procedure RemoveItem(AItem: TdxCustomLayoutItem); + + property Count: Integer read GetCount; + property Items[Index: Integer]: TdxCustomLayoutItem read GetItem; + published + property Kind: TdxLayoutAlignmentConstraintKind read FKind write SetKind default ackLeft; + end; + + { controls } + + TdxLayoutAreaPart = (apNone, apLeft, apTop, apRight, apBottom, apCenter, + apBeforeContent, apAfterContent); + TdxLayoutDragSource = (dsControl, dsCustomizeForm); + + TdxLayoutControlDragAndDropObject = class(TcxDragAndDropObject) + private + FAreaPart: TdxLayoutAreaPart; + FDestItem: TdxCustomLayoutItem; + FSource: TdxLayoutDragSource; + FSourceItem: TdxCustomLayoutItem; + FSourceItemBounds: TRect; + + function GetControl: TdxCustomLayoutControl; + procedure SetAreaPart(Value: TdxLayoutAreaPart); + procedure SetDestItem(Value: TdxCustomLayoutItem); + procedure SetSourceItem(Value: TdxCustomLayoutItem); + + procedure HideSourceItemMark; + procedure ShowSourceItemMark; + protected + procedure DirtyChanged; override; + function GetDragAndDropCursor(Accepted: Boolean): TCursor; override; + + function GetCenterAreaBounds(const AItemBounds: TRect): TRect; + property Control: TdxCustomLayoutControl read GetControl; + + property AreaPart: TdxLayoutAreaPart read FAreaPart write SetAreaPart; + property DestItem: TdxCustomLayoutItem read FDestItem write SetDestItem; + property Source: TdxLayoutDragSource read FSource write FSource; + property SourceItemBounds: TRect read FSourceItemBounds; + public + destructor Destroy; override; + procedure BeginDragAndDrop; override; + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); override; + procedure EndDragAndDrop(Accepted: Boolean); override; + procedure Init(ASource: TdxLayoutDragSource; ASourceItem: TdxCustomLayoutItem); virtual; + property SourceItem: TdxCustomLayoutItem read FSourceItem write SetSourceItem; + end; + + TdxLayoutAutoContentSize = (acsWidth, acsHeight); + TdxLayoutAutoContentSizes = set of TdxLayoutAutoContentSize; + + TdxCustomLayoutControl = class(TcxControl, IdxLayoutLookAndFeelUser, IdxLayoutComponent, IdxSkinSupport) + private + FAbsoluteItems: TList; + FAlignmentConstraints: TList; + FAutoContentSizes: TdxLayoutAutoContentSizes; + FAutoControlAlignment: Boolean; + FAutoControlTabOrders: Boolean; + FAvailableItems: TList; + FBoldFont: TFont; + FCustomization: Boolean; + FCustomizeForm: TCustomForm; + FCustomizeFormBounds: TRect; + FCustomizeFormClass: TFormClass; + FDesignFormBounds: TRect; + FIniFileName: string; + FItems: TdxLayoutGroup; + FIsPlaceControlsNeeded: Boolean; + FIsPlacingControls: Boolean; + FItemWithMouse: TdxCustomLayoutItem; + FLeftPos: Integer; + FLookAndFeel: TdxCustomLayoutLookAndFeel; + FMayPack: Boolean; + FPainter: TdxLayoutControlPainter; + FRegistryPath: string; + FRightButtonPressed: Boolean; + FShowHiddenGroupsBounds: Boolean; + FStoreInIniFile: Boolean; + FStoreInRegistry: Boolean; + FTopPos: Integer; + FUpdateLockCount: Integer; + FViewInfo: TdxLayoutControlViewInfo; + + FOnCustomization: TNotifyEvent; + + function GetAbsoluteItem(Index: Integer): TdxCustomLayoutItem; + function GetAbsoluteItemCount: Integer; + function GetAlignmentConstraint(Index: Integer): TdxLayoutAlignmentConstraint; + function GetAlignmentConstraintCount: Integer; + function GetAvailableItem(Index: Integer): TdxCustomLayoutItem; + function GetAvailableItemCount: Integer; + function GetIsCustomizationMode: Boolean; + function GetLayoutDirection: TdxLayoutDirection; + procedure SetAutoContentSizes(Value: TdxLayoutAutoContentSizes); + procedure SetAutoControlAlignment(Value: Boolean); + procedure SetAutoControlTabOrders(Value: Boolean); + procedure SetCustomization(Value: Boolean); + procedure SetCustomizationModeForm(Value: TCustomForm); + procedure SetIsCustomizationMode(Value: Boolean); + procedure SetIsPlaceControlsNeeded(Value: Boolean); + procedure SetItems(Value: TdxLayoutGroup); + procedure SetItemWithMouse(Value: TdxCustomLayoutItem); + procedure SetLayoutDirection(Value: TdxLayoutDirection); + procedure SetLeftPos(Value: Integer); + procedure SetLookAndFeel(Value: TdxCustomLayoutLookAndFeel); + procedure SetShowHiddenGroupsBounds(Value: Boolean); + procedure SetTopPos(Value: Integer); + + procedure CreateHandlers; + procedure DestroyHandlers; + + procedure CreateConstraints; + procedure DestroyConstraints; + procedure AddAlignmentConstraint(AConstraint: TdxLayoutAlignmentConstraint); + procedure RemoveAlignmentConstraint(AConstraint: TdxLayoutAlignmentConstraint); + + procedure RefreshBoldFont; + + procedure AddAbsoluteItem(AItem: TdxCustomLayoutItem); + procedure RemoveAbsoluteItem(AItem: TdxCustomLayoutItem); + + procedure AddAvailableItem(AItem: TdxCustomLayoutItem); + procedure RemoveAvailableItem(AItem: TdxCustomLayoutItem); + procedure DestroyAvailableItems; + + {$IFNDEF DELPHI7} + procedure WMPrintClient(var Message: TWMPrintClient); message WM_PRINTCLIENT; + {$ENDIF} + procedure CMControlChange(var Message: TCMControlChange); message CM_CONTROLCHANGE; + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + //procedure CMFreeItem(var Message: TMessage); message CM_FREEITEM; + procedure CMPlaceControls(var Message: TMessage); message CM_PLACECONTROLS; + protected + procedure AlignControls(AControl: TControl; var Rect: TRect); override; + function AllowAutoDragAndDropAtDesignTime(X, Y: Integer; + Shift: TShiftState): Boolean; override; + function AllowDragAndDropWithoutFocus: Boolean; override; + procedure BoundsChanged; override; + function CanDrag(X, Y: Integer): Boolean; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure DestroyWindowHandle; override; + procedure FontChanged; override; + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + function GetCursor(X, Y: Integer): TCursor; override; + function GetDesignHitTest(X, Y: Integer; Shift: TShiftState): Boolean; override; + function HasBackground: Boolean; override; + procedure Loaded; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseLeave(AControl: TControl); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure Paint; override; + procedure SetName(const Value: TComponentName); override; + {$IFDEF DELPHI7} + procedure SetParentBackground(Value: Boolean); override; + {$ENDIF} + procedure WndProc(var Message: TMessage); override; + procedure WriteState(Writer: TWriter); override; + + procedure InitScrollBarsParameters; override; + function NeedsToBringInternalControlsToFront: Boolean; override; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); override; + + function CanDragAndDrop: Boolean; + function StartDragAndDrop(const P: TPoint): Boolean; override; + + function GetLookAndFeel: TdxCustomLayoutLookAndFeel; + // IdxLayoutLookAndFeelUser + procedure BeginLookAndFeelDestroying; stdcall; + procedure EndLookAndFeelDestroying; stdcall; + procedure LookAndFeelChanged; reintroduce; stdcall; + procedure LookAndFeelDestroyed; stdcall; + + // IdxLayoutComponent + procedure SelectionChanged; stdcall; + + function GetPainterClass: TdxLayoutControlPainterClass; virtual; + function GetViewInfoClass: TdxLayoutControlViewInfoClass; virtual; + + procedure AssignItemWithMouse(X, Y: Integer); + procedure AvailableItemListChanged(AItem: TdxCustomLayoutItem; + AIsItemAdded: Boolean); dynamic; + function CalculateCustomizeFormBounds(const AFormBounds: TRect): TRect; + function CanMultiSelect: Boolean; virtual; + function CanShowSelection: Boolean; virtual; + procedure CheckLeftPos(var Value: Integer); + procedure CheckPositions; + procedure CheckTopPos(var Value: Integer); + procedure DoCustomization; dynamic; + procedure DragAndDropBegan; dynamic; + function GetAlignmentConstraintClass: TdxLayoutAlignmentConstraintClass; dynamic; + function GetDefaultGroupClass: TdxLayoutGroupClass; virtual; + function GetDefaultItemClass: TdxLayoutItemClass; virtual; + function IsCustomization: Boolean; + function IsUpdateLocked: Boolean; + procedure LayoutChanged; virtual; + //procedure PostFree(AObject: TObject); + procedure ScrollContent(APrevPos, ACurPos: Integer; AHorzScrolling: Boolean); + + procedure LoadFromCustomIniFile(AIniFile: TCustomIniFile; const ARootSection: string); virtual; + procedure SaveToCustomIniFile(AIniFile: TCustomIniFile; const ARootSection: string); virtual; + + property BoldFont: TFont read FBoldFont; + property CustomizationModeForm: TCustomForm write SetCustomizationModeForm; + property DesignFormBounds: TRect read FDesignFormBounds write FDesignFormBounds; + property IsCustomizationMode: Boolean read GetIsCustomizationMode + write SetIsCustomizationMode; + property IsPlaceControlsNeeded: Boolean read FIsPlaceControlsNeeded write SetIsPlaceControlsNeeded; + property ItemWithMouse: TdxCustomLayoutItem read FItemWithMouse + write SetItemWithMouse; + property MayPack: Boolean read FMayPack write FMayPack; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Clear; + function CreateAlignmentConstraint: TdxLayoutAlignmentConstraint; + function FindItem(AControl: TControl): TdxLayoutItem; overload; + function FindItem(const AName: string): TdxCustomLayoutItem; overload; + function GetHitTest(const P: TPoint): TdxCustomLayoutHitTest; overload; + function GetHitTest(X, Y: Integer): TdxCustomLayoutHitTest; overload; + + procedure BeginUpdate; + procedure EndUpdate; + + function CreateGroup(AGroupClass: TdxLayoutGroupClass = nil; + AParent: TdxLayoutGroup = nil): TdxLayoutGroup; + function CreateItem(AItemClass: TdxCustomLayoutItemClass = nil; + AParent: TdxLayoutGroup = nil): TdxCustomLayoutItem; + function CreateItemForControl(AControl: TControl; + AParent: TdxLayoutGroup = nil): TdxLayoutItem; + + procedure LoadFromIniFile(const AFileName: string); + procedure LoadFromRegistry(const ARegistryPath: string); + procedure LoadFromStream(AStream: TStream); + procedure SaveToIniFile(const AFileName: string); + procedure SaveToRegistry(const ARegistryPath: string); + procedure SaveToStream(AStream: TStream); + + property AbsoluteItemCount: Integer read GetAbsoluteItemCount; + property AbsoluteItems[Index: Integer]: TdxCustomLayoutItem read GetAbsoluteItem; + property AlignmentConstraintCount: Integer read GetAlignmentConstraintCount; + property AlignmentConstraints[Index: Integer]: TdxLayoutAlignmentConstraint + read GetAlignmentConstraint; + property AutoContentSizes: TdxLayoutAutoContentSizes read FAutoContentSizes + write SetAutoContentSizes default []; + property AutoControlAlignment: Boolean read FAutoControlAlignment + write SetAutoControlAlignment default True; + property AutoControlTabOrders: Boolean read FAutoControlTabOrders + write SetAutoControlTabOrders default True; + property AvailableItemCount: Integer read GetAvailableItemCount; + property AvailableItems[Index: Integer]: TdxCustomLayoutItem read GetAvailableItem; + property Customization: Boolean read FCustomization write SetCustomization; + property CustomizeForm: TCustomForm read FCustomizeForm; + property CustomizeFormBounds: TRect read FCustomizeFormBounds + write FCustomizeFormBounds; + property CustomizeFormClass: TFormClass read FCustomizeFormClass write FCustomizeFormClass; // must be descendant of TLayoutCustomizeForm + property Items: TdxLayoutGroup read FItems; + property IsPlacingControls: Boolean read FIsPlacingControls; + property LayoutDirection: TdxLayoutDirection read GetLayoutDirection + write SetLayoutDirection; + property LeftPos: Integer read FLeftPos write SetLeftPos; + property LookAndFeel: TdxCustomLayoutLookAndFeel read FLookAndFeel + write SetLookAndFeel; + property ShowHiddenGroupsBounds: Boolean read FShowHiddenGroupsBounds + write SetShowHiddenGroupsBounds; + property TopPos: Integer read FTopPos write SetTopPos; + + property IniFileName: string read FIniFileName write FIniFileName; + property RegistryPath: string read FRegistryPath write FRegistryPath; + property StoreInIniFile: Boolean read FStoreInIniFile write FStoreInIniFile default False; + property StoreInRegistry: Boolean read FStoreInRegistry write FStoreInRegistry default False; + + property Painter: TdxLayoutControlPainter read FPainter; + property ViewInfo: TdxLayoutControlViewInfo read FViewInfo; + + property OnCustomization: TNotifyEvent read FOnCustomization write FOnCustomization; + end; + + TdxLayoutControl = class(TdxCustomLayoutControl) + published + property Align; + property Anchors; + {$IFDEF DELPHI6} + property BevelEdges; + property BevelInner; + property BevelOuter; + property BevelKind; + property BevelWidth; + property BorderWidth; + {$ENDIF} + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property FocusOnClick; + property Font; + {$IFDEF DELPHI7} + property ParentBackground default False; + {$ENDIF} + property ParentFont; + property ParentShowHint; + property PopupMenu; + property ShowHint; + property TabOrder; + property TabStop; + property Visible; + + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnMouseWheel; + property OnMouseWheelDown; + property OnMouseWheelUp; + property OnResize; + property OnStartDock; + property OnStartDrag; + + property AutoContentSizes; + property AutoControlAlignment; + property AutoControlTabOrders; + property IniFileName; + property LayoutDirection stored False; + property LookAndFeel; + property RegistryPath; + property StoreInIniFile; + property StoreInRegistry; + + property OnCustomization; + property OnMouseEnter; + property OnMouseLeave; + end; + + { hit tests } + + TdxCustomLayoutHitTestClass = class of TdxCustomLayoutHitTest; + + TdxCustomLayoutHitTest = class + public + function Cursor: TCursor; dynamic; + class function HitTestCode: Integer; virtual; + class function Instance: TdxCustomLayoutHitTest; + end; + + TdxLayoutNoneHitTest = class(TdxCustomLayoutHitTest) + public + class function HitTestCode: Integer; override; + end; + + TdxCustomLayoutItemHitTestClass = class of TdxCustomLayoutItemHitTest; + + TdxCustomLayoutItemHitTest = class(TdxCustomLayoutHitTest) + private + FItem: TdxCustomLayoutItem; + public + property Item: TdxCustomLayoutItem read FItem write FItem; + end; + + TdxLayoutItemHitTest = class(TdxCustomLayoutItemHitTest) + private + function GetItem: TdxLayoutItem; + procedure SetItem(Value: TdxLayoutItem); + public + class function HitTestCode: Integer; override; + property Item: TdxLayoutItem read GetItem write SetItem; + end; + + TdxLayoutGroupHitTest = class(TdxCustomLayoutItemHitTest) + private + function GetItem: TdxLayoutGroup; + procedure SetItem(Value: TdxLayoutGroup); + public + class function HitTestCode: Integer; override; + property Item: TdxLayoutGroup read GetItem write SetItem; + end; + + TdxLayoutCustomizeFormHitTest = class(TdxCustomLayoutHitTest) + public + class function HitTestCode: Integer; override; + end; + + TdxLayoutClientAreaHitTest = class(TdxCustomLayoutHitTest) + private + FControl: TdxCustomLayoutControl; + public + class function HitTestCode: Integer; override; + property Control: TdxCustomLayoutControl read FControl write FControl; + end; + + { custom handler } + + TdxCustomLayoutControlHandler = class + private + FControl: TdxCustomLayoutControl; + function GetViewInfo: TdxLayoutControlViewInfo; + protected + property Control: TdxCustomLayoutControl read FControl; + property ViewInfo: TdxLayoutControlViewInfo read GetViewInfo; + public + constructor Create(AControl: TdxCustomLayoutControl); virtual; + end; + + { painters } + + // custom + + TdxCustomLayoutItemElementPainter = class + private + FCanvas: TcxCanvas; + FViewInfo: TdxCustomLayoutItemElementViewInfo; + function GetLookAndFeel: TdxCustomLayoutLookAndFeel; + protected + property Canvas: TcxCanvas read FCanvas; + property LookAndFeel: TdxCustomLayoutLookAndFeel read GetLookAndFeel; + property ViewInfo: TdxCustomLayoutItemElementViewInfo read FViewInfo; + public + constructor Create(ACanvas: TcxCanvas; + AViewInfo: TdxCustomLayoutItemElementViewInfo); virtual; + procedure Paint; virtual; abstract; + end; + + TdxCustomLayoutItemCaptionPainterClass = class of TdxCustomLayoutItemCaptionPainter; + + TdxCustomLayoutItemCaptionPainter = class(TdxCustomLayoutItemElementPainter) + private + function GetViewInfo: TdxCustomLayoutItemCaptionViewInfo; + protected + procedure AfterDrawText; virtual; + procedure BeforeDrawText; virtual; + procedure DrawBackground; virtual; + procedure DrawText; virtual; + property ViewInfo: TdxCustomLayoutItemCaptionViewInfo read GetViewInfo; + public + procedure Paint; override; + end; + + TdxCustomLayoutItemPainterClass = class of TdxCustomLayoutItemPainter; + + TdxCustomLayoutItemPainter = class + private + FCanvas: TcxCanvas; + FViewInfo: TdxCustomLayoutItemViewInfo; + function GetLookAndFeel: TdxCustomLayoutLookAndFeel; + protected + function GetCaptionPainterClass: TdxCustomLayoutItemCaptionPainterClass; virtual; abstract; + procedure DrawCaption; virtual; + procedure DrawSelection; virtual; + procedure InternalDrawSelection; + + property Canvas: TcxCanvas read FCanvas; + property LookAndFeel: TdxCustomLayoutLookAndFeel read GetLookAndFeel; + property ViewInfo: TdxCustomLayoutItemViewInfo read FViewInfo; + public + constructor Create(ACanvas: TcxCanvas; AViewInfo: TdxCustomLayoutItemViewInfo); virtual; + procedure DrawSelections; virtual; + procedure Paint; virtual; + end; + + // item + + TdxLayoutItemCaptionPainter = class(TdxCustomLayoutItemCaptionPainter); + + TdxLayoutItemControlPainterClass = class of TdxLayoutItemControlPainter; + + TdxLayoutItemControlPainter = class(TdxCustomLayoutItemElementPainter) + private + function GetViewInfo: TdxLayoutItemControlViewInfo; + protected + procedure DrawBorders; virtual; + property ViewInfo: TdxLayoutItemControlViewInfo read GetViewInfo; + public + procedure Paint; override; + end; + + TdxLayoutItemPainter = class(TdxCustomLayoutItemPainter) + private + function GetViewInfo: TdxLayoutItemViewInfo; + protected + function GetCaptionPainterClass: TdxCustomLayoutItemCaptionPainterClass; override; + function GetControlPainterClass: TdxLayoutItemControlPainterClass; virtual; + + procedure DrawControl; virtual; + + property ViewInfo: TdxLayoutItemViewInfo read GetViewInfo; + public + procedure Paint; override; + end; + + // group + + TdxLayoutGroupCaptionPainter = class(TdxCustomLayoutItemCaptionPainter); + + TdxLayoutGroupPainter = class(TdxCustomLayoutItemPainter) + private + function GetViewInfo: TdxLayoutGroupViewInfo; + protected + function GetCaptionPainterClass: TdxCustomLayoutItemCaptionPainterClass; override; + + procedure DrawBorders; virtual; + procedure DrawBoundsFrame; virtual; + procedure DrawItems; virtual; + procedure DrawItemsArea; virtual; + + property ViewInfo: TdxLayoutGroupViewInfo read GetViewInfo; + public + procedure DrawSelections; override; + procedure Paint; override; + end; + + TdxLayoutGroupCaptionStandardPainter = class(TdxLayoutGroupCaptionPainter) + protected + procedure DrawText; override; + end; + + TdxLayoutGroupStandardPainter = class(TdxLayoutGroupPainter) + private + function GetViewInfo: TdxLayoutGroupStandardViewInfo; + protected + function GetCaptionPainterClass: TdxCustomLayoutItemCaptionPainterClass; override; + procedure DrawBorders; override; + procedure DrawFrame; virtual; + property ViewInfo: TdxLayoutGroupStandardViewInfo read GetViewInfo; + end; + + TdxLayoutGroupOfficePainter = class(TdxLayoutGroupStandardPainter) + protected + function GetCaptionPainterClass: TdxCustomLayoutItemCaptionPainterClass; override; + procedure DrawFrame; override; + end; + + TdxLayoutGroupWebPainter = class(TdxLayoutGroupPainter) + private + function GetLookAndFeel: TdxLayoutWebLookAndFeel; + function GetViewInfo: TdxLayoutGroupWebViewInfo; + protected + procedure DrawBorders; override; + procedure DrawCaptionSeparator; virtual; + procedure DrawFrame; virtual; + property LookAndFeel: TdxLayoutWebLookAndFeel read GetLookAndFeel; + property ViewInfo: TdxLayoutGroupWebViewInfo read GetViewInfo; + end; + + // control + + TdxLayoutControlPainter = class(TdxCustomLayoutControlHandler) + private + FCanvas: TcxCanvas; + protected + function GetInternalCanvas: TcxCanvas; virtual; + procedure MakeCanvasClipped(ACanvas: TcxCanvas); + + procedure DrawEmptyArea; virtual; + procedure DrawItems; virtual; + procedure PlaceControls; virtual; + + property InternalCanvas: TcxCanvas read GetInternalCanvas; + property Canvas: TcxCanvas read FCanvas; + public + function GetCanvas: TcxCanvas; virtual; + function GetCustomizationCanvas: TcxCanvas; + procedure DrawSelections; virtual; + procedure Paint; virtual; + end; + + { view infos } + + // custom item + + TdxCustomLayoutItemElementViewInfo = class + private + FItemViewInfo: TdxCustomLayoutItemViewInfo; + FHeight: Integer; + FPressed: Boolean; + FWidth: Integer; + function GetHeight: Integer; + function GetItem: TdxCustomLayoutItem; + function GetLookAndFeel: TdxCustomLayoutLookAndFeel; + function GetWidth: Integer; + procedure SetHeight(Value: Integer); + procedure SetWidth(Value: Integer); + protected + function GetEnabled: Boolean; virtual; + function GetEnabledForWork: Boolean; virtual; + function GetCursor(X, Y: Integer): TCursor; virtual; + function GetVisible: Boolean; virtual; + procedure Invalidate(const ABounds: TRect); virtual; + procedure MouseEnter; dynamic; + procedure MouseLeave; dynamic; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); dynamic; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); dynamic; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); dynamic; + function WantsMouse(X, Y: Integer): Boolean; + + property Item: TdxCustomLayoutItem read GetItem; + property ItemViewInfo: TdxCustomLayoutItemViewInfo read FItemViewInfo; + property LookAndFeel: TdxCustomLayoutLookAndFeel read GetLookAndFeel; + property Pressed: Boolean read FPressed write FPressed; + property Visible: Boolean read GetVisible; + public + Bounds: TRect; + constructor Create(AItemViewInfo: TdxCustomLayoutItemViewInfo); virtual; + procedure Calculate(const ABounds: TRect); virtual; + function CalculateHeight: Integer; virtual; abstract; + function CalculateWidth: Integer; virtual; abstract; + + property Enabled: Boolean read GetEnabled; + property EnabledForWork: Boolean read GetEnabledForWork; + property Height: Integer read GetHeight write SetHeight; + property Width: Integer read GetWidth write SetWidth; + end; + + TdxCustomLayoutItemCaptionViewInfoClass = class of TdxCustomLayoutItemCaptionViewInfo; + + TdxCustomLayoutItemCaptionViewInfo = class(TdxCustomLayoutItemElementViewInfo) + private + FHotTracked: Boolean; + function GetCanvas: TcxCanvas; + function GetIsCustomization: Boolean; + function GetTextHeight: Integer; + function GetTextWidth: Integer; + procedure SetHotTracked(Value: Boolean); + protected + function GetCursor(X, Y: Integer): TCursor; override; + function GetVisible: Boolean; override; + procedure MouseLeave; override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + + function CalculateTextFlags: Integer; virtual; + function CanDoCaptionClick(X, Y: Integer): Boolean; virtual; + function GetAlignHorz: TAlignment; virtual; + function GetAlignVert: TdxAlignmentVert; virtual; abstract; + function GetColor: TColor; virtual; + function GetFont: TFont; virtual; + function GetHotTrackBounds: TRect; virtual; + function GetHotTrackStyles: TdxLayoutHotTrackStyles; virtual; + function GetIsDefaultColor: Boolean; virtual; + function GetIsHotTrackable: Boolean; virtual; + function GetIsTextUnderlined: Boolean; virtual; + function GetIsTransparent: Boolean; virtual; + function GetMultiLine: Boolean; virtual; abstract; + function GetOptions: TdxLayoutLookAndFeelCaptionOptions; virtual; + function GetText: string; virtual; + function GetTextAreaBounds: TRect; virtual; + function GetTextColor: TColor; virtual; + function GetTextHotColor: TColor; virtual; + function GetTextNormalColor: TColor; virtual; + function GetVisibleText: string; virtual; + function IsPointInHotTrackBounds(const P: TPoint): Boolean; virtual; + procedure PrepareCanvas; virtual; + + property AlignHorz: TAlignment read GetAlignHorz; + property AlignVert: TdxAlignmentVert read GetAlignVert; + property Canvas: TcxCanvas read GetCanvas; + property HotTrackBounds: TRect read GetHotTrackBounds; + property HotTrackStyles: TdxLayoutHotTrackStyles read GetHotTrackStyles; + property IsCustomization: Boolean read GetIsCustomization; + property IsDefaultColor: Boolean read GetIsDefaultColor; + property IsHotTrackable: Boolean read GetIsHotTrackable; + property IsTransparent: Boolean read GetIsTransparent; + property MultiLine: Boolean read GetMultiLine; + property Options: TdxLayoutLookAndFeelCaptionOptions read GetOptions; + property TextHeight: Integer read GetTextHeight; + property TextWidth: Integer read GetTextWidth; + public + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + + property Color: TColor read GetColor; + property Font: TFont read GetFont; + property HotTracked: Boolean read FHotTracked write SetHotTracked; + property IsTextUnderlined: Boolean read GetIsTextUnderlined; + property Text: string read GetText; + property TextAreaBounds: TRect read GetTextAreaBounds; + property TextColor: TColor read GetTextColor; + property VisibleText: string read GetVisibleText; + end; + + TdxCustomLayoutItemViewInfo = class + private + FCaptionViewInfo: TdxCustomLayoutItemCaptionViewInfo; + FContainerViewInfo: TdxLayoutControlViewInfo; + FElementWithMouse: TdxCustomLayoutItemElementViewInfo; + FItem: TdxCustomLayoutItem; + FOffsets: array[TdxLayoutSide] of Integer; + FParentViewInfo: TdxLayoutGroupViewInfo; + + function GetAlignHorz: TdxLayoutAlignHorz; + function GetAlignVert: TdxLayoutAlignVert; + function GetIsCustomization: Boolean; + function GetIsParentLocked: Boolean; + function GetLookAndFeel: TdxCustomLayoutLookAndFeel; + function GetMinHeight: Integer; + function GetMinWidth: Integer; + function GetOffset(ASide: TdxLayoutSide): Integer; + function GetOffsetsHeight: Integer; + function GetOffsetsWidth: Integer; + function GetSelected: Boolean; + procedure SetElementWithMouse(Value: TdxCustomLayoutItemElementViewInfo); + procedure SetOffset(ASide: TdxLayoutSide; Value: Integer); + protected + procedure CreateViewInfos; virtual; + procedure DestroyViewInfos; virtual; + + function GetCaptionViewInfoClass: TdxCustomLayoutItemCaptionViewInfoClass; virtual; abstract; + function GetHitTestClass: TdxCustomLayoutItemHitTestClass; virtual; abstract; + function GetPainterClass: TdxCustomLayoutItemPainterClass; virtual; abstract; + + function CalculateMinHeight: Integer; + function CalculateMinWidth: Integer; + function CalculateOffset(ASide: TdxLayoutSide): Integer; virtual; + function DoCalculateHeight(AIsMinHeight: Boolean = False): Integer; virtual; + function DoCalculateWidth(AIsMinWidth: Boolean = False): Integer; virtual; + function GetColor: TColor; virtual; abstract; + function GetCursor(X, Y: Integer): TCursor; virtual; + function GetElement(Index: Integer): TdxCustomLayoutItemElementViewInfo; virtual; + function GetElementCount: Integer; virtual; + function GetEnabled: Boolean; virtual; + function GetEnabledForWork: Boolean; virtual; + function GetIsDefaultColor: Boolean; virtual; abstract; + function GetIsTransparent: Boolean; virtual; + function GetOptions: TdxCustomLayoutLookAndFeelOptions; virtual; abstract; + function GetSelectionAreaBounds(Index: Integer): TRect; virtual; + function GetSelectionAreaCount: Integer; virtual; + function HasCaption: Boolean; virtual; + procedure MouseEnter; dynamic; + procedure MouseLeave; dynamic; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); dynamic; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); dynamic; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); dynamic; + + property ContainerViewInfo: TdxLayoutControlViewInfo read FContainerViewInfo; + property ElementCount: Integer read GetElementCount; + property Elements[Index: Integer]: TdxCustomLayoutItemElementViewInfo read GetElement; + property ElementWithMouse: TdxCustomLayoutItemElementViewInfo read FElementWithMouse + write SetElementWithMouse; + property IsCustomization: Boolean read GetIsCustomization; + property IsDefaultColor: Boolean read GetIsDefaultColor; + property IsParentLocked: Boolean read GetIsParentLocked; + property IsTransparent: Boolean read GetIsTransparent; + property Item: TdxCustomLayoutItem read FItem; + property LookAndFeel: TdxCustomLayoutLookAndFeel read GetLookAndFeel; + property OffsetsHeight: Integer read GetOffsetsHeight; + property OffsetsWidth: Integer read GetOffsetsWidth; + property Options: TdxCustomLayoutLookAndFeelOptions read GetOptions; + property ParentViewInfo: TdxLayoutGroupViewInfo read FParentViewInfo; + public + Bounds: TRect; + constructor Create(AContainerViewInfo: TdxLayoutControlViewInfo; + AParentViewInfo: TdxLayoutGroupViewInfo; AItem: TdxCustomLayoutItem); virtual; + destructor Destroy; override; + procedure Calculate(const ABounds: TRect); virtual; + function CalculateHeight: Integer; + function CalculateWidth: Integer; + procedure CalculateTabOrders(var AAvailTabOrder: Integer); virtual; abstract; + function GetHitTest(const P: TPoint): TdxCustomLayoutHitTest; virtual; + procedure ResetOffset(ASide: TdxLayoutSide); + + property AlignHorz: TdxLayoutAlignHorz read GetAlignHorz; + property AlignVert: TdxLayoutAlignVert read GetAlignVert; + property CaptionViewInfo: TdxCustomLayoutItemCaptionViewInfo read FCaptionViewInfo; + property Color: TColor read GetColor; + property Enabled: Boolean read GetEnabled; + property EnabledForWork: Boolean read GetEnabledForWork; + property MinWidth: Integer read GetMinWidth; + property MinHeight: Integer read GetMinHeight; + property Offsets[ASide: TdxLayoutSide]: Integer read GetOffset write SetOffset; + property Selected: Boolean read GetSelected; + property SelectionAreaBounds[Index: Integer]: TRect read GetSelectionAreaBounds; + property SelectionAreaCount: Integer read GetSelectionAreaCount; + end; + + // item + + TdxLayoutItemCaptionViewInfo = class(TdxCustomLayoutItemCaptionViewInfo) + private + function GetItem: TdxLayoutItem; + function GetItemViewInfo: TdxLayoutItemViewInfo; + protected + function GetAlignVert: TdxAlignmentVert; override; + function GetIsFixedWidth: Boolean; virtual; + function GetMinWidth: Integer; virtual; + function GetMultiLine: Boolean; override; + function GetTextAreaBounds: TRect; override; + + property IsFixedWidth: Boolean read GetIsFixedWidth; + property Item: TdxLayoutItem read GetItem; + property ItemViewInfo: TdxLayoutItemViewInfo read GetItemViewInfo; + public + function CalculateWidth: Integer; override; + property MinWidth: Integer read GetMinWidth; + end; + + TdxLayoutItemControlViewInfoClass = class of TdxLayoutItemControlViewInfo; + + TdxLayoutItemControlViewInfo = class(TdxCustomLayoutItemElementViewInfo) + private + FControlBounds: TRect; + function GetBorderColor: TColor; + function GetBorderStyle: TdxLayoutBorderStyle; + function GetControl: TControl; + function GetHasBorder: Boolean; + function GetItem: TdxLayoutItem; + function GetItemViewInfo: TdxLayoutItemViewInfo; + function GetOpaqueControl: Boolean; + protected + function GetVisible: Boolean; override; + + function CalculateControlBounds: TRect; virtual; + function GetBorderWidth(ASide: TdxLayoutSide): Integer; virtual; + function GetHeight(AControlHeight: Integer): Integer; virtual; + function GetWidth(AControlWidth: Integer): Integer; virtual; + + property BorderWidths[ASide: TdxLayoutSide]: Integer read GetBorderWidth; + property Item: TdxLayoutItem read GetItem; + property ItemViewInfo: TdxLayoutItemViewInfo read GetItemViewInfo; + public + procedure Calculate(const ABounds: TRect); override; + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function CalculateMinHeight: Integer; virtual; + function CalculateMinWidth: Integer; virtual; + procedure CalculateTabOrder(var AAvailTabOrder: Integer); virtual; + + property BorderColor: TColor read GetBorderColor; + property BorderStyle: TdxLayoutBorderStyle read GetBorderStyle; + property Control: TControl read GetControl; + property ControlBounds: TRect read FControlBounds; + property HasBorder: Boolean read GetHasBorder; + property OpaqueControl: Boolean read GetOpaqueControl; + end; + + TdxLayoutItemViewInfo = class(TdxCustomLayoutItemViewInfo) + private + FControlViewInfo: TdxLayoutItemControlViewInfo; + function GetCaptionViewInfo: TdxLayoutItemCaptionViewInfo; + function GetItem: TdxLayoutItem; + function GetOptionsEx: TdxLayoutLookAndFeelItemOptions; + protected + procedure CreateViewInfos; override; + procedure DestroyViewInfos; override; + + function GetCaptionViewInfoClass: TdxCustomLayoutItemCaptionViewInfoClass; override; + function GetControlViewInfoClass: TdxLayoutItemControlViewInfoClass; virtual; + function GetHitTestClass: TdxCustomLayoutItemHitTestClass; override; + function GetPainterClass: TdxCustomLayoutItemPainterClass; override; + + procedure CalculateViewInfosBounds(var ACaptionBounds, AControlBounds: TRect); virtual; + function DoCalculateHeight(AIsMinHeight: Boolean = False): Integer; override; + function DoCalculateWidth(AIsMinWidth: Boolean = False): Integer; override; + function GetAutoControlAlignment: Boolean; virtual; + function GetCaptionLayout: TdxCaptionLayout; virtual; + function GetColor: TColor; override; + function GetContentBounds: TRect; virtual; + function GetControlOffsetHorz: Integer; virtual; + function GetControlOffsetVert: Integer; virtual; + function GetElement(Index: Integer): TdxCustomLayoutItemElementViewInfo; override; + function GetElementCount: Integer; override; + function GetIsDefaultColor: Boolean; override; + function GetOptions: TdxCustomLayoutLookAndFeelOptions; override; + function HasControl: Boolean; virtual; + + property ControlOffsetHorz: Integer read GetControlOffsetHorz; + property ControlOffsetVert: Integer read GetControlOffsetVert; + property Item: TdxLayoutItem read GetItem; + property Options: TdxLayoutLookAndFeelItemOptions read GetOptionsEx; + public + procedure Calculate(const ABounds: TRect); override; + procedure CalculateTabOrders(var AAvailTabOrder: Integer); override; + + property AutoControlAlignment: Boolean read GetAutoControlAlignment; + property CaptionLayout: TdxCaptionLayout read GetCaptionLayout; + property CaptionViewInfo: TdxLayoutItemCaptionViewInfo read GetCaptionViewInfo; + property ContentBounds: TRect read GetContentBounds; + property ControlViewInfo: TdxLayoutItemControlViewInfo read FControlViewInfo; + end; + + // group + + TdxLayoutGroupCaptionViewInfo = class(TdxCustomLayoutItemCaptionViewInfo) + protected + function GetAlignVert: TdxAlignmentVert; override; + function GetMultiLine: Boolean; override; + + function GetMinWidth: Integer; virtual; + public + property MinWidth: Integer read GetMinWidth; + end; + + TdxLayoutGroupViewInfoGetItemSizeEvent = + function(AViewInfo: TdxCustomLayoutItemViewInfo): Integer of object; + + TdxLayoutGroupViewInfoSpecificClass = class of TdxLayoutGroupViewInfoSpecific; + + TdxLayoutGroupViewInfoSpecific = class + private + FGroupViewInfo: TdxLayoutGroupViewInfo; + function GetItemOffset: Integer; + function GetItemViewInfo(Index: Integer): TdxCustomLayoutItemViewInfo; + function GetItemViewInfoCount: Integer; + function GetLayoutDirection: TdxLayoutDirection; + protected + function DoCalculateHeight: Integer; + function DoCalculateWidth: Integer; + function DoCalculateMinHeight: Integer; + function DoCalculateMinWidth: Integer; + function GetCustomHeight(AGetItemCustomHeight: TdxLayoutGroupViewInfoGetItemSizeEvent): Integer; + function GetCustomWidth(AGetItemCustomWidth: TdxLayoutGroupViewInfoGetItemSizeEvent): Integer; + + procedure ConvertCoords(var R: TRect); virtual; + function GetItemAlignHorz(AViewInfo: TdxCustomLayoutItemViewInfo): TdxLayoutAlignHorz; virtual; abstract; + function GetItemAlignVert(AViewInfo: TdxCustomLayoutItemViewInfo): TdxLayoutAlignVert; virtual; abstract; + function GetItemHeight(AViewInfo: TdxCustomLayoutItemViewInfo): Integer; virtual; abstract; + function GetItemMinHeight(AViewInfo: TdxCustomLayoutItemViewInfo): Integer; virtual; abstract; + function GetItemMinWidth(AViewInfo: TdxCustomLayoutItemViewInfo): Integer; virtual; abstract; + function GetItemWidth(AViewInfo: TdxCustomLayoutItemViewInfo): Integer; virtual; abstract; + + property GroupViewInfo: TdxLayoutGroupViewInfo read FGroupViewInfo; + property ItemOffset: Integer read GetItemOffset; + property ItemViewInfoCount: Integer read GetItemViewInfoCount; + property ItemViewInfos[Index: Integer]: TdxCustomLayoutItemViewInfo read GetItemViewInfo; + property LayoutDirection: TdxLayoutDirection read GetLayoutDirection; + public + constructor Create(AGroupViewInfo: TdxLayoutGroupViewInfo); virtual; + procedure CalculateItemsBounds(AItemsAreaBounds: TRect); + function CalculateHeight(AIsMinHeight: Boolean = False): Integer; virtual; + function CalculateWidth(AIsMinWidth: Boolean = False): Integer; virtual; + function IsAtInsertionPos(const R: TRect; const P: TPoint): Boolean; virtual; abstract; + end; + + TdxLayoutGroupViewInfoHorizontalSpecific = class(TdxLayoutGroupViewInfoSpecific) + protected + function GetItemAlignHorz(AViewInfo: TdxCustomLayoutItemViewInfo): TdxLayoutAlignHorz; override; + function GetItemAlignVert(AViewInfo: TdxCustomLayoutItemViewInfo): TdxLayoutAlignVert; override; + function GetItemHeight(AViewInfo: TdxCustomLayoutItemViewInfo): Integer; override; + function GetItemMinHeight(AViewInfo: TdxCustomLayoutItemViewInfo): Integer; override; + function GetItemMinWidth(AViewInfo: TdxCustomLayoutItemViewInfo): Integer; override; + function GetItemWidth(AViewInfo: TdxCustomLayoutItemViewInfo): Integer; override; + public + function IsAtInsertionPos(const R: TRect; const P: TPoint): Boolean; override; + end; + + TdxLayoutGroupViewInfoVerticalSpecific = class(TdxLayoutGroupViewInfoSpecific) + protected + procedure ConvertCoords(var R: TRect); override; + function GetItemAlignHorz(AViewInfo: TdxCustomLayoutItemViewInfo): TdxLayoutAlignHorz; override; + function GetItemAlignVert(AViewInfo: TdxCustomLayoutItemViewInfo): TdxLayoutAlignVert; override; + function GetItemHeight(AViewInfo: TdxCustomLayoutItemViewInfo): Integer; override; + function GetItemMinHeight(AViewInfo: TdxCustomLayoutItemViewInfo): Integer; override; + function GetItemMinWidth(AViewInfo: TdxCustomLayoutItemViewInfo): Integer; override; + function GetItemWidth(AViewInfo: TdxCustomLayoutItemViewInfo): Integer; override; + public + function CalculateHeight(AIsMinHeight: Boolean = False): Integer; override; + function CalculateWidth(AIsMinWidth: Boolean = False): Integer; override; + function IsAtInsertionPos(const R: TRect; const P: TPoint): Boolean; override; + end; + + TdxLayoutGroupViewInfo = class(TdxCustomLayoutItemViewInfo) + private + FConstsCalculated: Boolean; + FItemOffset: Integer; + FItemsAreaBounds: TRect; + FItemsAreaOffsetHorz: Integer; + FItemsAreaOffsetVert: Integer; + FItemViewInfos: TList; + FSpecific: TdxLayoutGroupViewInfoSpecific; + + function GetBorderBounds(ASide: TdxLayoutSide): TRect; + function GetBorderRestSpaceBounds(ASide: TdxLayoutSide): TRect; + function GetBordersHeight: Integer; + function GetBordersWidth: Integer; + function GetCaptionViewInfo: TdxLayoutGroupCaptionViewInfo; + function GetGroup: TdxLayoutGroup; + function GetIsLocked: Boolean; + function GetItemViewInfo(Index: Integer): TdxCustomLayoutItemViewInfo; + function GetItemViewInfoCount: Integer; + function GetLayoutDirection: TdxLayoutDirection; + function GetOptionsEx: TdxLayoutLookAndFeelGroupOptions; + + procedure CreateItemViewInfos; + procedure CreateSpecific; + procedure DestroyItemViewInfos; + procedure DestroySpecific; + protected + function GetCaptionViewInfoClass: TdxCustomLayoutItemCaptionViewInfoClass; override; + function GetHitTestClass: TdxCustomLayoutItemHitTestClass; override; + function GetPainterClass: TdxCustomLayoutItemPainterClass; override; + + function DoCalculateHeight(AIsMinHeight: Boolean = False): Integer; override; + function DoCalculateWidth(AIsMinWidth: Boolean = False): Integer; override; + + function CalculateCaptionViewInfoBounds: TRect; virtual; + function CalculateItemsAreaBounds: TRect; virtual; + procedure CalculateConsts; virtual; + function GetBorderWidth(ASide: TdxLayoutSide): Integer; virtual; + function GetClientBounds: TRect; virtual; + function GetColor: TColor; override; + function GetConst(Index: Integer): Integer; virtual; + function GetHeight(AItemsAreaHeight: Integer): Integer; virtual; + function GetIsDefaultColor: Boolean; override; + function GetItemViewInfoClass(AItem: TdxCustomLayoutItem): TdxCustomLayoutItemViewInfoClass; virtual; + function GetMinVisibleWidth: Integer; virtual; + function GetOptions: TdxCustomLayoutLookAndFeelOptions; override; + function GetRestSpaceBounds: TRect; virtual; + function GetSpecificClass: TdxLayoutGroupViewInfoSpecificClass; virtual; + function GetWidth(AItemsAreaWidth: Integer): Integer; virtual; + function HasBorder: Boolean; virtual; + function HasBoundsFrame: Boolean; virtual; + function UseItemOffset: Boolean; virtual; + function UseItemsAreaOffsets: Boolean; virtual; + + property ItemOffset: Integer index 2 read GetConst write FItemOffset; + property ItemsAreaOffsetHorz: Integer index 3 read GetConst write FItemsAreaOffsetHorz; + property ItemsAreaOffsetVert: Integer index 4 read GetConst write FItemsAreaOffsetVert; + property MinVisibleWidth: Integer read GetMinVisibleWidth; + property RestSpaceBounds: TRect read GetRestSpaceBounds; + + property Group: TdxLayoutGroup read GetGroup; + property LayoutDirection: TdxLayoutDirection read GetLayoutDirection; + property Options: TdxLayoutLookAndFeelGroupOptions read GetOptionsEx; + property Specific: TdxLayoutGroupViewInfoSpecific read FSpecific; + public + constructor Create(AControlViewInfo: TdxLayoutControlViewInfo; + AParentViewInfo: TdxLayoutGroupViewInfo; AItem: TdxCustomLayoutItem); override; + destructor Destroy; override; + procedure Calculate(const ABounds: TRect); override; + procedure CalculateTabOrders(var AAvailTabOrder: Integer); override; + function GetHitTest(const P: TPoint): TdxCustomLayoutHitTest; override; + function GetInsertionPos(const P: TPoint): Integer; virtual; + + property BorderBounds[ASide: TdxLayoutSide]: TRect read GetBorderBounds; + property BorderRestSpaceBounds[ASide: TdxLayoutSide]: TRect read GetBorderRestSpaceBounds; + property BorderWidths[ASide: TdxLayoutSide]: Integer read GetBorderWidth; + property BordersHeight: Integer read GetBordersHeight; + property BordersWidth: Integer read GetBordersWidth; + property CaptionViewInfo: TdxLayoutGroupCaptionViewInfo read GetCaptionViewInfo; + property ClientBounds: TRect read GetClientBounds; + property IsLocked: Boolean read GetIsLocked; + property ItemsAreaBounds: TRect read FItemsAreaBounds; + property ItemViewInfoCount: Integer read GetItemViewInfoCount; + property ItemViewInfos[Index: Integer]: TdxCustomLayoutItemViewInfo read GetItemViewInfo; + end; + + // standard + + TdxLayoutGroupStandardCaptionViewInfo = class(TdxLayoutGroupCaptionViewInfo) + private + function GetItemViewInfo: TdxLayoutGroupStandardViewInfo; + protected + function GetAlignHorz: TAlignment; override; + property ItemViewInfo: TdxLayoutGroupStandardViewInfo read GetItemViewInfo; + public + function CalculateWidth: Integer; override; + end; + + TdxLayoutGroupStandardViewInfo = class(TdxLayoutGroupViewInfo) + private + function GetLookAndFeel: TdxLayoutStandardLookAndFeel; + protected + function CalculateCaptionViewInfoBounds: TRect; override; + function GetCaptionViewInfoClass: TdxCustomLayoutItemCaptionViewInfoClass; override; + function GetMinVisibleWidth: Integer; override; + + function GetCaptionViewInfoOffset: Integer; virtual; + function GetFrameBounds: TRect; virtual; + + property CaptionViewInfoOffset: Integer read GetCaptionViewInfoOffset; + property LookAndFeel: TdxLayoutStandardLookAndFeel read GetLookAndFeel; + public + property FrameBounds: TRect read GetFrameBounds; + end; + + // office + + TdxLayoutGroupOfficeCaptionViewInfo = class(TdxLayoutGroupCaptionViewInfo) + public + function CalculateWidth: Integer; override; + end; + + TdxLayoutGroupOfficeViewInfo = class(TdxLayoutGroupStandardViewInfo) + protected + function GetCaptionViewInfoClass: TdxCustomLayoutItemCaptionViewInfoClass; override; + function GetCaptionViewInfoOffset: Integer; override; + function GetFrameBounds: TRect; override; + function GetMinVisibleWidth: Integer; override; + end; + + // web + + TdxLayoutGroupWebCaptionViewInfo = class(TdxLayoutGroupCaptionViewInfo) + private + function GetItemViewInfo: TdxLayoutGroupWebViewInfo; + function GetLookAndFeel: TdxLayoutWebLookAndFeel; + function GetOptionsEx: TdxLayoutWebLookAndFeelGroupCaptionOptions; + function GetSeparatorWidth: Integer; + protected + function GetAlignVert: TdxAlignmentVert; override; + function GetColor: TColor; override; + function GetIsDefaultColor: Boolean; override; + function GetMinWidth: Integer; override; + function GetTextAreaBounds: TRect; override; + + function GetTextOffset: Integer; virtual; + + property ItemViewInfo: TdxLayoutGroupWebViewInfo read GetItemViewInfo; + property LookAndFeel: TdxLayoutWebLookAndFeel read GetLookAndFeel; + property Options: TdxLayoutWebLookAndFeelGroupCaptionOptions read GetOptionsEx; + property TextOffset: Integer read GetTextOffset; + public + function CalculateHeight: Integer; override; + property SeparatorWidth: Integer read GetSeparatorWidth; + end; + + TdxLayoutGroupWebViewInfo = class(TdxLayoutGroupViewInfo) + private + function GetCaptionViewInfo: TdxLayoutGroupWebCaptionViewInfo; + function GetInsideFrameBounds: TRect; + function GetLookAndFeel: TdxLayoutWebLookAndFeel; + function GetOptionsEx: TdxLayoutWebLookAndFeelGroupOptions; + protected + function CalculateCaptionViewInfoBounds: TRect; override; + function GetCaptionViewInfoClass: TdxCustomLayoutItemCaptionViewInfoClass; override; + function GetMinVisibleWidth: Integer; override; + function GetRestSpaceBounds: TRect; override; + + function GetCaptionSeparatorAreaBounds: TRect; virtual; + function GetCaptionSeparatorBounds: TRect; virtual; + + property LookAndFeel: TdxLayoutWebLookAndFeel read GetLookAndFeel; + property InsideFrameBounds: TRect read GetInsideFrameBounds; + property Options: TdxLayoutWebLookAndFeelGroupOptions read GetOptionsEx; + public + property CaptionSeparatorAreaBounds: TRect read GetCaptionSeparatorAreaBounds; + property CaptionSeparatorBounds: TRect read GetCaptionSeparatorBounds; + property CaptionViewInfo: TdxLayoutGroupWebCaptionViewInfo read GetCaptionViewInfo; + end; + + // control + + TdxLayoutControlViewInfo = class(TdxCustomLayoutControlHandler) + private + FCanvas: TcxCanvas; + FContentBounds: TRect; + FHideHiddenGroupsFromHitTest: Boolean; + FItemsViewInfo: TdxLayoutGroupViewInfo; + function GetClientHeight: Integer; + function GetClientWidth: Integer; + function GetContentHeight: Integer; + function GetContentWidth: Integer; + function GetLookAndFeel: TdxCustomLayoutLookAndFeel; + protected + procedure CreateViewInfos; virtual; + procedure DestroyViewInfos; virtual; + function GetItemsViewInfoClass: TdxLayoutGroupViewInfoClass; virtual; + procedure RecreateViewInfos; + + procedure AlignItems; virtual; + procedure AutoAlignControls; virtual; + procedure CalculateItemsViewInfo; virtual; + procedure CalculateTabOrders; virtual; + function GetIsTransparent: Boolean; virtual; + function HasBackground: Boolean; + procedure PrepareData; virtual; + procedure ResetContentBounds; + + function GetCanvas: TcxCanvas; virtual; + function GetClientBounds: TRect; virtual; + function GetContentBounds: TRect; virtual; + + property Canvas: TcxCanvas read GetCanvas; + property IsTransparent: Boolean read GetIsTransparent; + public + constructor Create(AControl: TdxCustomLayoutControl); override; + destructor Destroy; override; + procedure Calculate; virtual; + procedure DoCalculateTabOrders; virtual; + function GetHitTest(const P: TPoint): TdxCustomLayoutHitTest; overload; virtual; + function GetHitTest(X, Y: Integer): TdxCustomLayoutHitTest; overload; + + property ClientBounds: TRect read GetClientBounds; + property ClientHeight: Integer read GetClientHeight; + property ClientWidth: Integer read GetClientWidth; + property ContentBounds: TRect read GetContentBounds; + property ContentHeight: Integer read GetContentHeight; + property ContentWidth: Integer read GetContentWidth; + property HideHiddenGroupsFromHitTest: Boolean read FHideHiddenGroupsFromHitTest + write FHideHiddenGroupsFromHitTest; + property ItemsViewInfo: TdxLayoutGroupViewInfo read FItemsViewInfo; + property LookAndFeel: TdxCustomLayoutLookAndFeel read GetLookAndFeel; + end; + + { other } + + TdxLayoutCustomizeListBox = class(TcxCustomizeListBox) + private + FControl: TdxCustomLayoutControl; + function GetDragAndDropItemObject: TdxCustomLayoutItem; + protected + procedure BeginDragAndDrop; override; + property DragAndDropItemObject: TdxCustomLayoutItem read GetDragAndDropItemObject; + public + property Control: TdxCustomLayoutControl read FControl write FControl; + end; + +implementation + +{$R *.res} + +uses + TypInfo, Menus, Registry, +{$IFDEF DELPHI6} + Variants, +{$ENDIF} +{$IFDEF DELPHI7} + UxTheme, Themes, +{$ENDIF} + dxLayoutControlAdapters, dxLayoutCustomizeForm; + +const + ScrollStep = 10; + +type + TControlAccess = class(TControl); + TLookAndFeelAccess = class(TdxCustomLayoutLookAndFeel); + +resourcestring + sContainerCannotBeControl = 'Container cannot be a control for its item.'; + sControlIsUsed = 'The %s control is already used by %s item.'; + +function GetOrthogonalDirection(ADirection: TdxLayoutDirection): TdxLayoutDirection; +begin + if ADirection = ldHorizontal then + Result := ldVertical + else + Result := ldHorizontal; +end; + +{ TCustomizationCanvas } + +type + TCustomizationCanvas = class(TCanvas) + private + FControl: TcxControl; + procedure FreeHandle; + protected + procedure CreateHandle; override; + public + constructor Create(AControl: TcxControl); reintroduce; + destructor Destroy; override; + end; + +constructor TCustomizationCanvas.Create(AControl: TcxControl); +begin + inherited Create; + FControl := AControl; +end; + +destructor TCustomizationCanvas.Destroy; +begin + FreeHandle; + inherited; +end; + +procedure TCustomizationCanvas.FreeHandle; +begin + ReleaseDC(FControl.Handle, Handle); + Handle := 0; +end; + +procedure TCustomizationCanvas.CreateHandle; +begin + Handle := GetDCEx(FControl.Handle, 0, DCX_CACHE or DCX_CLIPSIBLINGS); +end; + +{ TcxCustomizationCanvas } + +type + TcxCustomizationCanvas = class(TcxCanvas) + public + constructor Create(AControl: TcxControl); reintroduce; + destructor Destroy; override; + end; + +constructor TcxCustomizationCanvas.Create(AControl: TcxControl); +begin + inherited Create(TCustomizationCanvas.Create(AControl)); +end; + +destructor TcxCustomizationCanvas.Destroy; +begin + Canvas.Free; + inherited; +end; + +{ TdxCustomLayoutItemOptions } + +constructor TdxCustomLayoutItemOptions.Create(AItem: TdxCustomLayoutItem); +begin + inherited Create; + FItem := AItem; +end; + +procedure TdxCustomLayoutItemOptions.Changed; +begin + FItem.Changed; +end; + +{ TdxCustomLayoutItemCaptionOptions } + +constructor TdxCustomLayoutItemCaptionOptions.Create(AItem: TdxCustomLayoutItem); +begin + inherited; + FShowAccelChar := True; +end; + +procedure TdxCustomLayoutItemCaptionOptions.SetAlignHorz(Value: TAlignment); +begin + if FAlignHorz <> Value then + begin + FAlignHorz := Value; + Changed; + end; +end; + +procedure TdxCustomLayoutItemCaptionOptions.SetShowAccelChar(Value: Boolean); +begin + if FShowAccelChar <> Value then + begin + FShowAccelChar := Value; + Changed; + end; +end; + +{ TdxLayoutOffsets } + +function TdxLayoutOffsets.GetValue(Index: Integer): Integer; +begin + case Index of + 1: Result := FBottom; + 2: Result := FLeft; + 3: Result := FRight; + 4: Result := FTop; + else + Result := 0; + end; +end; + +procedure TdxLayoutOffsets.SetValue(Index: Integer; Value: Integer); +begin + if Value < 0 then Value := 0; + if GetValue(Index) <> Value then + begin + case Index of + 1: FBottom := Value; + 2: FLeft := Value; + 3: FRight := Value; + 4: FTop := Value; + end; + Changed; + end; +end; + +{ TdxCustomLayoutItem } + +constructor TdxCustomLayoutItem.Create(AOwner: TComponent); +begin + inherited; + FAllowRemove := True; + FAutoAligns := [aaHorizontal, aaVertical]; + FCaptionOptions := GetCaptionOptionsClass.Create(Self); + FEnabled := True; + FOffsets := TdxLayoutOffsets.Create(Self); + FShowCaption := True; + FVisible := True; +end; + +destructor TdxCustomLayoutItem.Destroy; +begin + HasMouse := False; + Parent := nil; + FContainer.RemoveAvailableItem(Self); + FContainer.RemoveAbsoluteItem(Self); + LookAndFeel := nil; + FOffsets.Free; + FCaptionOptions.Free; + inherited; +end; + +function TdxCustomLayoutItem.GetActuallyVisible: Boolean; +begin + Result := GetVisible and (IsRoot or (FParent <> nil) and FParent.ActuallyVisible); +end; + +function TdxCustomLayoutItem.GetAlignHorz: TdxLayoutAlignHorz; +begin + if aaHorizontal in FAutoAligns then + Result := GetAutoAlignHorz + else + Result := FAlignHorz; +end; + +function TdxCustomLayoutItem.GetAlignVert: TdxLayoutAlignVert; +begin + if aaVertical in FAutoAligns then + Result := GetAutoAlignVert + else + Result := FAlignVert; +end; + +function TdxCustomLayoutItem.GetCaptionForCustomizeForm: string; +begin + Result := StripHotKey(FCaption); +end; + +function TdxCustomLayoutItem.GetHasMouse: Boolean; +begin + Result := FContainer.ItemWithMouse = Self; +end; + +function TdxCustomLayoutItem.GetIndex: Integer; +begin + if FParent = nil then + Result := -1 + else + Result := FParent.IndexOf(Self); +end; + +function TdxCustomLayoutItem.GetIsDesigning: Boolean; +begin + Result := csDesigning in ComponentState; +end; + +function TdxCustomLayoutItem.GetIsDestroying: Boolean; +begin + Result := csDestroying in ComponentState; +end; + +function TdxCustomLayoutItem.GetIsLoading: Boolean; +begin + Result := csLoading in ComponentState; +end; + +function TdxCustomLayoutItem.GetIsRoot: Boolean; +begin + Result := (FContainer <> nil) and (FContainer.Items = Self); +end; + +function TdxCustomLayoutItem.GetVisibleIndex: Integer; +begin + if FParent = nil then + Result := -1 + else + Result := FParent.VisibleIndexOf(Self); +end; + +procedure TdxCustomLayoutItem.SetAlignHorz(Value: TdxLayoutAlignHorz); +begin + if AlignHorz <> Value then + begin + FAlignHorz := Value; + Exclude(FAutoAligns, aaHorizontal); + Changed; + end; +end; + +procedure TdxCustomLayoutItem.SetAlignmentConstraint(Value: TdxLayoutAlignmentConstraint); +begin + if FAlignmentConstraint <> Value then + begin + if FAlignmentConstraint <> nil then + FAlignmentConstraint.RemoveItem(Self); + if Value <> nil then + Value.AddItem(Self); + end; +end; + +procedure TdxCustomLayoutItem.SetAlignVert(Value: TdxLayoutAlignVert); +begin + if AlignVert <> Value then + begin + FAlignVert := Value; + Exclude(FAutoAligns, aaVertical); + Changed; + end; +end; + +procedure TdxCustomLayoutItem.SetAutoAligns(Value: TdxLayoutAutoAligns); +begin + if FAutoAligns <> Value then + begin + FAutoAligns := Value; + Changed; + end; +end; + +procedure TdxCustomLayoutItem.SetCaption(const Value: string); +begin + if FCaption <> Value then + begin + FCaption := Value; + ResetCachedTextHeight; + Changed; + end; +end; + +procedure TdxCustomLayoutItem.SetContainer(Value: TdxCustomLayoutControl); +begin + if FContainer <> Value then + begin + if not IsRoot and (FContainer <> nil) then + FContainer.RemoveAbsoluteItem(Self); + FContainer := Value; + if not IsRoot then + begin + if FContainer <> nil then + FContainer.AddAbsoluteItem(Self); + SetComponentName(Self, GetBaseName, IsDesigning, IsLoading); + end + else + Name := GetValidName(Self, GetBaseName + '_Root'); + end; +end; + +procedure TdxCustomLayoutItem.SetEnabled(Value: Boolean); +begin + if FEnabled <> Value then + begin + FEnabled := Value; + EnabledChanged; + end; +end; + +procedure TdxCustomLayoutItem.SetLookAndFeel(Value: TdxCustomLayoutLookAndFeel); +begin + if FLookAndFeel <> Value then + begin + if FLookAndFeel <> nil then + FLookAndFeel.RemoveUser(Self); + FLookAndFeel := Value; + if FLookAndFeel <> nil then + FLookAndFeel.AddUser(Self); + LookAndFeelChangedImpl; + end; +end; + +procedure TdxCustomLayoutItem.SetHasMouse(Value: Boolean); +begin + if HasMouse <> Value then + if Value then + FContainer.ItemWithMouse := Self + else + FContainer.ItemWithMouse := nil; +end; + +procedure TdxCustomLayoutItem.SetIndex(Value: Integer); +begin + if FParent <> nil then + FParent.ChangeItemIndex(Self, Value); +end; + +procedure TdxCustomLayoutItem.SetParent(Value: TdxLayoutGroup); +var + APrevParent: TdxLayoutGroup; + APrevActuallyVisible: Boolean; +begin + if (FParent <> Value) and CanMoveTo(Value) then + begin + APrevParent := FParent; + APrevActuallyVisible := ActuallyVisible; + if FParent <> nil then + FParent.RemoveItem(Self) + else + if FContainer <> nil then + FContainer.RemoveAvailableItem(Self); + if Value <> nil then + Value.AddItem(Self) + else + FContainer.AddAvailableItem(Self); + CheckActuallyVisible(APrevActuallyVisible); + ParentChanged(APrevParent); + end; +end; + +procedure TdxCustomLayoutItem.SetShowCaption(Value: Boolean); +begin + if FShowCaption <> Value then + begin + FShowCaption := Value; + Changed; + end; +end; + +procedure TdxCustomLayoutItem.SetVisible(Value: Boolean); +var + APrevActuallyVisible: Boolean; +begin + if FVisible <> Value then + begin + APrevActuallyVisible := ActuallyVisible; + FVisible := Value; + FContainer.BeginUpdate; + try + VisibleChanged; + CheckActuallyVisible(APrevActuallyVisible); + finally + FContainer.EndUpdate; + end; + end; +end; + +procedure TdxCustomLayoutItem.SetVisibleIndex(Value: Integer); +begin + if FParent <> nil then + FParent.ChangeItemVisibleIndex(Self, Value); +end; + +procedure TdxCustomLayoutItem.CheckActuallyVisible(APrevActuallyVisible: Boolean); +begin + if not IsDestroying and (ActuallyVisible <> APrevActuallyVisible) then + ActuallyVisibleChanged; +end; + +function TdxCustomLayoutItem.IsAlignHorzStored: Boolean; +begin + Result := not (aaHorizontal in FAutoAligns) and (FAlignHorz <> ahLeft); +end; + +function TdxCustomLayoutItem.IsAlignVertStored: Boolean; +begin + Result := not (aaVertical in FAutoAligns) and (FAlignVert <> avTop); +end; + +procedure TdxCustomLayoutItem.SetName(const Value: TComponentName); +begin + inherited; + if IsDesigning and not IsRoot then + dxLayoutDesigner.ItemsChanged(FContainer); +end; + +procedure TdxCustomLayoutItem.SetParentComponent(Value: TComponent); +begin + inherited; + if Value is TdxLayoutGroup then + Parent := TdxLayoutGroup(Value) + else + if Value is TdxCustomLayoutControl then + TdxCustomLayoutControl(Value).AddAvailableItem(Self); +end; + +procedure TdxCustomLayoutItem.LookAndFeelChanged; +begin +end; + +procedure TdxCustomLayoutItem.LookAndFeelChanging; +begin + ResetCachedTextHeight; +end; + +procedure TdxCustomLayoutItem.BeginLookAndFeelDestroying; +begin + FContainer.BeginUpdate; +end; + +procedure TdxCustomLayoutItem.EndLookAndFeelDestroying; +begin + FContainer.EndUpdate; +end; + +procedure TdxCustomLayoutItem.LookAndFeelChangedImpl; +begin + if IsDestroying or not ActuallyVisible then Exit; + LookAndFeelChanging; + Changed; + LookAndFeelChanged; +end; + +procedure TdxCustomLayoutItem.LookAndFeelDestroyed; +begin + LookAndFeel := nil; +end; + +procedure TdxCustomLayoutItem.ActuallyVisibleChanged; +begin + if not ActuallyVisible then HasMouse := False; + LookAndFeelChangedImpl; + if IsDesigning then + dxLayoutDesigner.ItemsChanged(FContainer); +end; + +function TdxCustomLayoutItem.CanRemove: Boolean; +begin + Result := FAllowRemove; +end; + +procedure TdxCustomLayoutItem.DoCaptionClick; +begin + if Assigned(FOnCaptionClick) then FOnCaptionClick(Self); +end; + +function TdxCustomLayoutItem.DoProcessAccel: Boolean; +var + AItem: TdxCustomLayoutItem; +begin + Result := CanProcessAccel(AItem); + if Result then AItem.ProcessAccel; +end; + +procedure TdxCustomLayoutItem.EnabledChanged; +begin + Changed(False); +end; + +function TdxCustomLayoutItem.GetBaseName: string; +begin + Result := FContainer.Name; +end; + +function TdxCustomLayoutItem.GetCursor(X, Y: Integer): TCursor; +begin + Result := ViewInfo.GetCursor(X, Y); +end; + +function TdxCustomLayoutItem.GetEnabledForWork: Boolean; +begin + Result := FEnabled and ((FParent = nil) or FParent.EnabledForWork); +end; + +function TdxCustomLayoutItem.GetLookAndFeel: TdxCustomLayoutLookAndFeel; +begin + Result := FLookAndFeel; + if Result = nil then + if FParent <> nil then + Result := FParent.GetLookAndFeelAsParent + else + if IsRoot then + Result := FContainer.GetLookAndFeel; +end; + +function TdxCustomLayoutItem.GetShowCaption: Boolean; +begin + Result := FShowCaption; +end; + +function TdxCustomLayoutItem.GetVisible: Boolean; +begin + Result := FVisible or IsDesigning; +end; + +function TdxCustomLayoutItem.HasAsParent(AGroup: TdxLayoutGroup): Boolean; +var + AParent: TdxLayoutGroup; +begin + AParent := FParent; + repeat + Result := AParent = AGroup; + if Result or (AParent = nil) then Break; + AParent := AParent.Parent; + until False; +end; + +function TdxCustomLayoutItem.HasCaption: Boolean; +begin + Result := ShowCaption; +end; + +procedure TdxCustomLayoutItem.Init; +begin + if GetLookAndFeel <> nil then LookAndFeelChanged; +end; + +procedure TdxCustomLayoutItem.MouseEnter; +begin + ViewInfo.MouseEnter; +end; + +procedure TdxCustomLayoutItem.MouseLeave; +begin + if FViewInfo <> nil then FViewInfo.MouseLeave; +end; + +procedure TdxCustomLayoutItem.MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + ViewInfo.MouseDown(Button, Shift, X, Y); + if IsDesigning and not IsRoot then + dxLayoutDesigner.SelectComponent(Container, Self, + (ssShift in Shift) and Container.CanMultiSelect); +end; + +procedure TdxCustomLayoutItem.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + ViewInfo.MouseMove(Shift, X, Y); +end; + +procedure TdxCustomLayoutItem.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + ViewInfo.MouseUp(Button, Shift, X, Y); +end; + +procedure TdxCustomLayoutItem.ParentChanged(APrevParent: TdxLayoutGroup); +begin + if not IsLoading and (APrevParent <> nil) and not APrevParent.IsDestroying then + FContainer.Items.Pack; +end; + +procedure TdxCustomLayoutItem.ProcessAccel; +begin +end; + +function TdxCustomLayoutItem.ProcessDialogChar(ACharCode: Word): Boolean; +begin + Result := HasCaption and FCaptionOptions.ShowAccelChar and + IsAccel(ACharCode, Caption) and DoProcessAccel; +end; + +procedure TdxCustomLayoutItem.SelectionChanged; +var + I: Integer; + R: TRect; +begin + if ViewInfo <> nil then + for I := 0 to ViewInfo.SelectionAreaCount - 1 do + begin + R := ViewInfo.SelectionAreaBounds[I]; + RedrawWindow(FContainer.Handle, @R, 0, + RDW_ERASE or RDW_FRAME or RDW_INVALIDATE or RDW_ALLCHILDREN); + end; +end; + +procedure TdxCustomLayoutItem.VisibleChanged; +begin + if FParent <> nil then + with FParent do + begin + BuildVisibleItemsList; + Changed; + end; +end; + +function TdxCustomLayoutItem.GetCaptionOptionsClass: TdxCustomLayoutItemCaptionOptionsClass; +begin + Result := TdxCustomLayoutItemCaptionOptions; +end; + +procedure TdxCustomLayoutItem.ResetCachedTextHeight; +begin + FCachedTextHeight := 0; +end; + +procedure TdxCustomLayoutItem.BeforeDestruction; +begin + inherited; + Container.FinishDragAndDrop(False); + AlignmentConstraint := nil; +end; + +function TdxCustomLayoutItem.GetParentComponent: TComponent; +begin + if FParent = nil then + Result := FContainer + else + Result := FParent; +end; + +function TdxCustomLayoutItem.HasParent: Boolean; +begin + Result := True; +end; + +procedure TdxCustomLayoutItem.Changed(AHardRefresh: Boolean = True); +begin + if Container.IsLoading or Container.IsDestroying or + Container.IsUpdateLocked or not ActuallyVisible then Exit; + if AHardRefresh then + begin + Container.ViewInfo.Calculate; + Container.Invalidate; + end + else + if ViewInfo <> nil then + Container.InvalidateRect(ViewInfo.Bounds, False); +end; + +function TdxCustomLayoutItem.CanMoveTo(AParent: TdxCustomLayoutItem): Boolean; +begin + Result := AParent <> Self; +end; + +procedure TdxCustomLayoutItem.MakeVisible; +var + R, AClientR: TRect; + + procedure MakeVisibleInOneDirection(AItemMin, AItemMax, + AClientMin, AClientMax: Integer; AIsHorizontal: Boolean); + var + AOffset: Integer; + + procedure ChangeOffset(ADelta: Integer); + begin + Inc(AOffset, ADelta); + Dec(AItemMin, ADelta); + Dec(AItemMax, ADelta); + end; + + procedure ApplyOffset; + begin + with FContainer do + if AIsHorizontal then + LeftPos := LeftPos + AOffset + else + TopPos := TopPos + AOffset; + end; + + begin + AOffset := 0; + if AItemMax > AClientMax then + ChangeOffset(AItemMax - AClientMax); + if AItemMin < AClientMin then + ChangeOffset(-(AClientMin - AItemMin)); + ApplyOffset; + end; + +begin + if not ActuallyVisible then Exit; + R := ViewInfo.Bounds; + AClientR := FContainer.ClientBounds; + MakeVisibleInOneDirection(R.Left, R.Right, AClientR.Left, AClientR.Right, True); + MakeVisibleInOneDirection(R.Top, R.Bottom, AClientR.Top, AClientR.Bottom, False); +end; + +function TdxCustomLayoutItem.Move(AParent: TdxLayoutGroup; AIndex: Integer; + APack: Boolean = False): Boolean; +var + APrevMayPack: Boolean; + AContainer: TdxCustomLayoutControl; +begin + Result := CanMoveTo(AParent); + if not Result then Exit; + APrevMayPack := Container.MayPack; + Container.MayPack := False; + try + Parent := AParent; + finally + Container.MayPack := APrevMayPack; + end; + Index := AIndex; + AContainer := Container; + if APack then Container.Items.Pack; + AContainer.Changed; +end; + +function TdxCustomLayoutItem.MoveTo(AParent: TdxLayoutGroup; AVisibleIndex: Integer; + APack: Boolean = False): Boolean; +var + AIndex: Integer; +begin + if AParent = nil then + AIndex := -1 + else + AIndex := AParent.GetItemIndex(AVisibleIndex); + Result := Move(AParent, AIndex, APack); +end; + +procedure TdxCustomLayoutItem.Pack; +begin +end; + +function TdxCustomLayoutItem.PutIntoHiddenGroup(ALayoutDirection: TdxLayoutDirection): TdxLayoutGroup; +var + AIndex: Integer; +begin + if FParent = nil then + Result := nil + else + begin + AIndex := Index; + Result := FParent.CreateGroup; + with Result do + begin + Hidden := True; + LayoutDirection := ALayoutDirection; + Index := AIndex; + end; + Move(Result, 0); + end; +end; + +{ TdxLayoutControlAdapterDefs } + +type + PControlAdapterRecord = ^TControlAdapterRecord; + TControlAdapterRecord = record + ControlClass: TControlClass; + AdapterClass: TdxCustomLayoutControlAdapterClass; + end; + + TdxLayoutControlAdapterDefs = class + private + FItems: TList; + function GetCount: Integer; + function GetItem(Index: Integer): TControlAdapterRecord; + procedure ClearItems; + protected + procedure Delete(AIndex: Integer); + property Count: Integer read GetCount; + property Items[Index: Integer]: TControlAdapterRecord read GetItem; + public + constructor Create; + destructor Destroy; override; + function GetAdapterClass(AControl: TControl): TdxCustomLayoutControlAdapterClass; + procedure Register(AControlClass: TControlClass; + AAdapterClass: TdxCustomLayoutControlAdapterClass); + procedure Unregister(AControlClass: TControlClass; + AAdapterClass: TdxCustomLayoutControlAdapterClass); + end; + +var + FdxLayoutControlAdapterDefs: TdxLayoutControlAdapterDefs; + +function dxLayoutControlAdapterDefs: TdxLayoutControlAdapterDefs; +begin + if FdxLayoutControlAdapterDefs = nil then + FdxLayoutControlAdapterDefs := TdxLayoutControlAdapterDefs.Create; + Result := FdxLayoutControlAdapterDefs; +end; + +constructor TdxLayoutControlAdapterDefs.Create; +begin + inherited; + FItems := TList.Create; +end; + +destructor TdxLayoutControlAdapterDefs.Destroy; +begin + ClearItems; + FItems.Free; + inherited; +end; + +function TdxLayoutControlAdapterDefs.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxLayoutControlAdapterDefs.GetItem(Index: Integer): TControlAdapterRecord; +begin + Result := PControlAdapterRecord(FItems[Index])^; +end; + +procedure TdxLayoutControlAdapterDefs.ClearItems; +var + I: Integer; +begin + for I := Count - 1 downto 0 do + Delete(I); +end; + +procedure TdxLayoutControlAdapterDefs.Delete(AIndex: Integer); +begin + Dispose(PControlAdapterRecord(FItems[AIndex])); + FItems.Delete(AIndex); +end; + +function TdxLayoutControlAdapterDefs.GetAdapterClass(AControl: TControl): TdxCustomLayoutControlAdapterClass; +var + I: Integer; + AControlAdapterRecord: TControlAdapterRecord; +begin + for I := Count - 1 downto 0 do + begin + AControlAdapterRecord := Items[I]; + if AControl.InheritsFrom(AControlAdapterRecord.ControlClass) then + begin + Result := AControlAdapterRecord.AdapterClass; + Exit; + end; + end; + Result := TdxCustomLayoutControlAdapter; +end; + +procedure TdxLayoutControlAdapterDefs.Register(AControlClass: TControlClass; + AAdapterClass: TdxCustomLayoutControlAdapterClass); +var + AControlAdapterRecord: PControlAdapterRecord; +begin + New(AControlAdapterRecord); + with AControlAdapterRecord^ do + begin + ControlClass := AControlClass; + AdapterClass := AAdapterClass; + end; + FItems.Add(AControlAdapterRecord); +end; + +procedure TdxLayoutControlAdapterDefs.Unregister(AControlClass: TControlClass; + AAdapterClass: TdxCustomLayoutControlAdapterClass); +var + I: Integer; + AControlAdapterRecord: TControlAdapterRecord; +begin + for I := 0 to Count - 1 do + begin + AControlAdapterRecord := Items[I]; + with AControlAdapterRecord do + if (ControlClass = AControlClass) and (AdapterClass = AAdapterClass) then + begin + Delete(I); + Break; + end; + end; + if Count = 0 then + FreeAndNil(FdxLayoutControlAdapterDefs); +end; + +{ TdxCustomLayoutControlAdapter } + +constructor TdxCustomLayoutControlAdapter.Create(AItem: TdxLayoutItem); +begin + inherited Create; + FItem := AItem; + if not FItem.IsLoading then + begin + Init; + if FItem.ActuallyVisible then LookAndFeelChanged; + end; +end; + +function TdxCustomLayoutControlAdapter.GetControl: TControl; +begin + Result := FItem.Control; +end; + +function TdxCustomLayoutControlAdapter.GetLookAndFeel: TdxCustomLayoutLookAndFeel; +begin + Result := FItem.GetLookAndFeel; +end; + +function TdxCustomLayoutControlAdapter.AllowCheckSize: Boolean; +begin + Result := True; +end; + +procedure TdxCustomLayoutControlAdapter.HideControlBorder; +begin + SetEnumProp(Control, 'BorderStyle', 'bsNone'); +end; + +procedure TdxCustomLayoutControlAdapter.Init; +var + AHeight: Integer; +begin + FItem.ControlOptions.AutoColor := UseItemColor; + if FItem.IsDesigning and (FItem.Caption = '') then + FItem.Caption := Control.Name;//GetPlainString(TControlAccess(Control).Caption); + FItem.SetControlEnablement; + FItem.SetControlVisibility; + if FItem.IsDesigning then + FItem.ShowCaption := ShowItemCaption; + FItem.ControlOptions.ShowBorder := ShowBorder; + if ShowBorder then + begin + AHeight := Control.ClientHeight; + HideControlBorder; + Control.Height := AHeight; + end; +end; + +function TdxCustomLayoutControlAdapter.ShowBorder: Boolean; +begin + Result := + IsPublishedProp(Control, 'BorderStyle') and + (GetPropInfo(Control, 'BorderStyle').PropType^ = TypeInfo(Forms.TBorderStyle)); +end; + +function TdxCustomLayoutControlAdapter.ShowItemCaption: Boolean; +begin + Result := not IsPublishedProp(Control, 'Caption'); +end; + +function TdxCustomLayoutControlAdapter.UseItemColor: Boolean; +begin + Result := + TControlAccess(Control).ParentColor and IsPublishedProp(Control, 'Color'); +end; + +procedure TdxCustomLayoutControlAdapter.LookAndFeelChanged; +begin + if Item.ControlOptions.AutoColor and (Item.ViewInfo <> nil) then + TControlAccess(Control).Color := Item.ViewInfo.Color; +end; + +class procedure TdxCustomLayoutControlAdapter.Register(AControlClass: TControlClass); +begin + dxLayoutControlAdapterDefs.Register(AControlClass, Self); +end; + +class procedure TdxCustomLayoutControlAdapter.Unregister(AControlClass: TControlClass); +begin + dxLayoutControlAdapterDefs.Unregister(AControlClass, Self); +end; + +{ TdxLayoutItemCaptionOptions } + +constructor TdxLayoutItemCaptionOptions.Create(AItem: TdxCustomLayoutItem); +begin + inherited; + FAlignVert := tavCenter; +end; + +procedure TdxLayoutItemCaptionOptions.SetAlignVert(Value: TdxAlignmentVert); +begin + if FAlignVert <> Value then + begin + FAlignVert := Value; + Changed; + end; +end; + +procedure TdxLayoutItemCaptionOptions.SetLayout(Value: TdxCaptionLayout); +begin + if FLayout <> Value then + begin + FLayout := Value; + Changed; + end; +end; + +procedure TdxLayoutItemCaptionOptions.SetWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FWidth <> Value then + begin + FWidth := Value; + Item.ResetCachedTextHeight; + Changed; + end; +end; + +{ TdxLayoutItemControlOptions } + +constructor TdxLayoutItemControlOptions.Create(AItem: TdxCustomLayoutItem); +begin + inherited; + FAutoAlignment := True; + FMinHeight := dxLayoutItemControlDefaultMinHeight; + FMinWidth := dxLayoutItemControlDefaultMinWidth; + FShowBorder := True; +end; + +procedure TdxLayoutItemControlOptions.SetAutoAlignment(Value: Boolean); +begin + if FAutoAlignment <> Value then + begin + FAutoAlignment := Value; + Changed; + end; +end; + +procedure TdxLayoutItemControlOptions.SetAutoColor(Value: Boolean); +begin + if FAutoColor <> Value then + begin + FAutoColor := Value; + Item.LookAndFeelChangedImpl; + end; +end; + +procedure TdxLayoutItemControlOptions.SetFixedSize(Value: Boolean); +begin + if FFixedSize <> Value then + begin + FFixedSize := Value; + Changed; + end; +end; + +procedure TdxLayoutItemControlOptions.SetMinHeight(Value: Integer); +begin + if Value < 0 then Value := 0; + if FMinHeight <> Value then + begin + FMinHeight := Value; + Changed; + end; +end; + +procedure TdxLayoutItemControlOptions.SetMinWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FMinWidth <> Value then + begin + FMinWidth := Value; + Changed; + end; +end; + +procedure TdxLayoutItemControlOptions.SetOpaque(Value: Boolean); +begin + if FOpaque <> Value then + begin + FOpaque := Value; + Changed; + end; +end; + +procedure TdxLayoutItemControlOptions.SetShowBorder(Value: Boolean); +begin + if FShowBorder <> Value then + begin + FShowBorder := Value; + Changed; + end; +end; + +{ TdxLayoutItem } + +constructor TdxLayoutItem.Create(AOwner: TComponent); +begin + inherited; + FControlOptions := GetControlOptionsClass.Create(Self); +end; + +destructor TdxLayoutItem.Destroy; +begin + Control := nil; + FControlOptions.Free; + inherited; +end; + +function TdxLayoutItem.GetCaptionOptions: TdxLayoutItemCaptionOptions; +begin + Result := TdxLayoutItemCaptionOptions(inherited CaptionOptions); +end; + +function TdxLayoutItem.GetViewInfo: TdxLayoutItemViewInfo; +begin + Result := TdxLayoutItemViewInfo(inherited ViewInfo); +end; + +procedure TdxLayoutItem.SetCaptionOptions(Value: TdxLayoutItemCaptionOptions); +begin + inherited CaptionOptions := Value; +end; + +procedure TdxLayoutItem.SetControl(Value: TControl); + + procedure CheckValue; + var + AItem: TdxLayoutItem; + begin + if Value <> nil then + begin + if Value = Container then + raise Exception.Create(sContainerCannotBeControl); + AItem := FContainer.FindItem(Value); + if AItem <> nil then + raise Exception.Create(Format(sControlIsUsed, [Value.Name, AItem.Name])) + end; + end; + + procedure UnprepareControl; + begin + FreeAndNil(FControlAdapter); + if IsDesigning then + with FControl do + ControlStyle := ControlStyle - [csNoDesignVisible]; + //FControl.RemoveFreeNotification(Self); + FControl.WindowProc := FPrevControlWndProc; + if IsDesigning and not (csDestroying in FControl.ComponentState) then + begin + FControl.Left := 0; + FControl.Top := 0; + end; + end; + + procedure PrepareControl; + begin + //FPrevControlWndProc := FControl.WindowProc; + //FControl.WindowProc := ControlWndProc; + //FControl.FreeNotification(Self); + if IsDesigning then + with FControl do + ControlStyle := ControlStyle + [csNoDesignVisible]; + FControl.Parent := Container; + SaveOriginalControlSize; + CreateControlAdapter; + SaveOriginalControlSize; + FPrevControlWndProc := FControl.WindowProc; + FControl.WindowProc := ControlWndProc; + end; + +begin + if FControl <> Value then + begin + CheckValue; + if FControl <> nil then UnprepareControl; + FControl := Value; + if FControl <> nil then PrepareControl; + Changed; + end; +end; + +procedure TdxLayoutItem.CreateControlAdapter; +begin + FControlAdapter := + dxLayoutControlAdapterDefs.GetAdapterClass(FControl).Create(Self); +end; + +{procedure TdxLayoutItem.PostFree; +begin + Container.PostFree(Self); +end;} + +procedure TdxLayoutItem.ActuallyVisibleChanged; +begin + SetControlVisibility; + inherited; +end; + +function TdxLayoutItem.CanProcessAccel(out AItem: TdxCustomLayoutItem): Boolean; +begin + Result := CanFocusControl; + if Result then AItem := Self; +end; + +procedure TdxLayoutItem.EnabledChanged; +begin + inherited; + SetControlEnablement; +end; + +function TdxLayoutItem.GetAutoAlignHorz: TdxLayoutAlignHorz; +begin + if (FParent = nil) or (FParent.LayoutDirection = ldHorizontal) then + Result := ahLeft + else + Result := ahClient; +end; + +function TdxLayoutItem.GetAutoAlignVert: TdxLayoutAlignVert; +begin + Result := avTop; +end; + +function TdxLayoutItem.GetBaseName: string; +begin + Result := inherited GetBaseName + 'Item'; +end; + +function TdxLayoutItem.GetViewInfoClass: TdxCustomLayoutItemViewInfoClass; +begin + Result := TdxCustomLayoutItemViewInfoClass(GetLookAndFeel.GetItemViewInfoClass); +end; + +function TdxLayoutItem.HasCaption: Boolean; +begin + Result := inherited HasCaption and (Caption <> ''); +end; + +procedure TdxLayoutItem.Init; +var + ACommonValue: Variant; + + function IsCommonValue(AValueIndex: Integer; var ACommonValue: Variant): Boolean; + var + I: Integer; + AValue: Variant; + + function CheckValue(AItem: TdxCustomLayoutItem): Boolean; + begin + if AItem <> Self then + case AValueIndex of + 0..2: Result := AItem is TdxLayoutItem; + 3..4: Result := True; + else + Result := False; + end + else + Result := False; + end; + + function GetValue(AItem: TdxCustomLayoutItem): Variant; + begin + case AValueIndex of + 0: Result := TdxLayoutItem(AItem).CaptionOptions.Layout; + 1: Result := TdxLayoutItem(AItem).CaptionOptions.AlignHorz; + 2: Result := TdxLayoutItem(AItem).CaptionOptions.AlignVert; + 3: Result := AItem.AlignHorz; + 4: Result := AItem.AlignVert; + else + Result := Null; + end; + end; + + begin + Result := Parent <> nil; + if not Result then Exit; + Result := False; + ACommonValue := Unassigned; + for I := 0 to Parent.VisibleCount - 1 do + if CheckValue(Parent.VisibleItems[I]) then + begin + AValue := GetValue(Parent.VisibleItems[I]); + if VarIsEmpty(ACommonValue) then + ACommonValue := AValue; + Result := AValue = ACommonValue; + if not Result then Break; + end; + end; + +begin + inherited; + if IsCommonValue(0, ACommonValue) then + CaptionOptions.Layout := ACommonValue; + if IsCommonValue(1, ACommonValue) then + CaptionOptions.AlignHorz := ACommonValue; + if IsCommonValue(2, ACommonValue) then + CaptionOptions.AlignVert := ACommonValue; + + {if IsCommonValue(3, ACommonValue) then + AlignHorz := ACommonValue; - items lose client alignment} + {if IsCommonValue(4, ACommonValue) then + AlignVert := ACommonValue; - because some controls cannot be made client aligned } +end; + +procedure TdxLayoutItem.Loaded; +begin + inherited; + if HasControl then + begin + SaveOriginalControlSize; + SetControlVisibility; + end; +end; + +procedure TdxLayoutItem.LookAndFeelChanged; +begin + inherited; + if FControlAdapter <> nil then + FControlAdapter.LookAndFeelChanged; +end; + +{procedure TdxLayoutItem.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if (Operation = opRemove) and (AComponent = FControl) then + begin + Control := nil; + PostFree; + end; +end;} + +procedure TdxLayoutItem.ParentChanged(APrevParent: TdxLayoutGroup); +begin + inherited; + SetControlEnablement; +end; + +procedure TdxLayoutItem.ProcessAccel; +begin + TWinControl(FControl).SetFocus; +end; + +procedure TdxLayoutItem.RestoreItemControlSize; +begin + if HasControl then + with Control, FOriginalControlSize do + SetBounds(Left, Top, X, Y); +end; + +function TdxLayoutItem.GetCaptionOptionsClass: TdxCustomLayoutItemCaptionOptionsClass; +begin + Result := TdxLayoutItemCaptionOptions; +end; + +function TdxLayoutItem.GetControlOptionsClass: TdxLayoutItemControlOptionsClass; +begin + Result := TdxLayoutItemControlOptions; +end; + +function TdxLayoutItem.CanFocusControl: Boolean; +begin + Result := HasWinControl and TWinControl(FControl).CanFocus; +end; + +procedure TdxLayoutItem.ControlWndProc(var Message: TMessage); + + function CanProcessWindowPosChange: Boolean; + begin + Result := (Message.LParam = 0) or + (PWindowPos(Message.LParam)^.flags and (SWP_NOMOVE or SWP_NOSIZE) <> SWP_NOMOVE or SWP_NOSIZE); + end; + + function ControlSizeChanged: Boolean; + begin + with Control, FOriginalControlSize do + Result := (Width <> X) or (Height <> Y); + end; + +begin + FPrevControlWndProc(Message); + with Message do + case Msg of + WM_PAINT, WM_NCPAINT: + if IsDesigning and not Container.IsDestroying then + Container.Painter.DrawSelections; + WM_SETFOCUS: + MakeVisible; + WM_WINDOWPOSCHANGED: + if not Container.IsPlacingControls and + (CanProcessWindowPosChange or ControlSizeChanged) then + begin + if FControlAdapter.AllowCheckSize and ControlSizeChanged then + SaveOriginalControlSize; + Changed; + end; + CM_TABSTOPCHANGED: + Container.ViewInfo.DoCalculateTabOrders; + end; +end; + +function TdxLayoutItem.HasControl: Boolean; +begin + Result := FControl <> nil; +end; + +function TdxLayoutItem.HasWinControl: Boolean; +begin + Result := HasControl and (FControl is TWinControl); +end; + +procedure TdxLayoutItem.SaveOriginalControlSize; +begin + if HasWinControl and CanAllocateHandle(TWinControl(FControl)) then + TWinControl(FControl).HandleNeeded; // for cxEditors + FOriginalControlSize := Point(FControl.Width, FControl.Height); +end; + +procedure TdxLayoutItem.SetControlEnablement; +begin + if HasControl then Control.Enabled := EnabledForWork; +end; + +procedure TdxLayoutItem.SetControlVisibility; +begin + if HasControl then + with Control do + begin + Visible := ActuallyVisible; + // to make the control invisible on showing + if not Visible then + SetBounds(10000, 10000, FOriginalControlSize.X, FOriginalControlSize.Y); + end; +end; + +{ TdxLayoutGroup } + +constructor TdxLayoutGroup.Create(AOwner: TComponent); +begin + inherited; + FIsUserDefined := True; + FItems := TList.Create; + FLayoutDirection := ldVertical; + FShowBorder := True; + FUseIndent := True; + FVisibleItems := TList.Create; +end; + +destructor TdxLayoutGroup.Destroy; +begin + if IsRoot then Container.FItems := nil; + DestroyItems; + FreeAndNil(FVisibleItems); + FreeAndNil(FItems); + inherited; +end; + +function TdxLayoutGroup.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxLayoutGroup.GetItem(Index: Integer): TdxCustomLayoutItem; +begin + Result := TdxCustomLayoutItem(FItems[Index]); +end; + +function TdxLayoutGroup.GetShowBorder: Boolean; +begin + if FHidden then + Result := False + else + Result := FShowBorder; +end; + +function TdxLayoutGroup.GetViewInfo: TdxLayoutGroupViewInfo; +begin + Result := TdxLayoutGroupViewInfo(inherited ViewInfo); +end; + +function TdxLayoutGroup.GetVisibleCount: Integer; +begin + Result := FVisibleItems.Count; +end; + +function TdxLayoutGroup.GetVisibleItem(Index: Integer): TdxCustomLayoutItem; +begin + Result := TdxCustomLayoutItem(FVisibleItems[Index]); +end; + +procedure TdxLayoutGroup.SetHidden(Value: Boolean); +begin + if FHidden <> Value then + begin + FHidden := Value; + if not IsRoot then + begin + Changed; + if IsDesigning then + dxLayoutDesigner.ItemsChanged(Container); + end; + end; +end; + +procedure TdxLayoutGroup.SetLayoutDirection(Value: TdxLayoutDirection); +begin + if FLayoutDirection <> Value then + begin + FLayoutDirection := Value; + Changed; + end; +end; + +procedure TdxLayoutGroup.SetLocked(Value: Boolean); +begin + if FLocked <> Value then + begin + FLocked := Value; + end; +end; + +procedure TdxLayoutGroup.SetLookAndFeelException(Value: Boolean); +begin + if FLookAndFeelException <> Value then + begin + FLookAndFeelException := Value; + LookAndFeelChangedImpl; + end; +end; + +procedure TdxLayoutGroup.SetShowBorder(Value: Boolean); +begin + if FShowBorder <> Value then + begin + FShowBorder := Value; + Changed; + end; +end; + +procedure TdxLayoutGroup.SetUseIndent(Value: Boolean); +begin + if FUseIndent <> Value then + begin + FUseIndent := Value; + Changed; + end; +end; + +procedure TdxLayoutGroup.AddItem(AItem: TdxCustomLayoutItem); +begin + FItems.Add(AItem); + AItem.FParent := Self; + AItem.Container := FContainer; + if AItem.GetVisible then BuildVisibleItemsList; + Changed; + if not IsLoading then AItem.Init; +end; + +procedure TdxLayoutGroup.RemoveItem(AItem: TdxCustomLayoutItem); +begin + FItems.Remove(AItem); + AItem.FParent := nil; + if AItem.GetVisible then BuildVisibleItemsList; + Changed; +end; + +procedure TdxLayoutGroup.DestroyItems; +var + I: Integer; +begin + for I := Count - 1 downto 0 do + Items[I].Free; +end; + +procedure TdxLayoutGroup.ActuallyVisibleChanged; +var + I: Integer; +begin + inherited; + for I := 0 to VisibleCount - 1 do + VisibleItems[I].ActuallyVisibleChanged; +end; + +function TdxLayoutGroup.CanProcessAccel(out AItem: TdxCustomLayoutItem): Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to VisibleCount - 1 do + begin + AItem := VisibleItems[I]; + Result := AItem.CanProcessAccel(AItem); + if Result then Break; + end; +end; + +function TdxLayoutGroup.CanRemove: Boolean; +var + I: Integer; +begin + Result := inherited CanRemove; + if Result then + for I := 0 to Count - 1 do + begin + Result := Items[I].CanRemove; + if not Result then Break; + end; +end; + +procedure TdxLayoutGroup.EnabledChanged; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].EnabledChanged; + inherited; +end; + +function TdxLayoutGroup.GetAutoAlignHorz: TdxLayoutAlignHorz; +begin + if IsRoot then + if acsWidth in Container.AutoContentSizes then + Result := ahClient + else + Result := ahLeft + else + if (Parent = nil) or (Parent.LayoutDirection = ldHorizontal) then + Result := ahLeft + else + Result := ahClient; +end; + +function TdxLayoutGroup.GetAutoAlignVert: TdxLayoutAlignVert; +begin + if IsRoot then + if acsHeight in Container.AutoContentSizes then + Result := avClient + else + Result := avTop + else + if (Parent <> nil) and (Parent.LayoutDirection = ldHorizontal) then + Result := avClient + else + Result := avTop; +end; + +function TdxLayoutGroup.GetBaseName: string; +begin + Result := inherited GetBaseName + 'Group'; +end; + +procedure TdxLayoutGroup.GetChildren(Proc: TGetChildProc; Root: TComponent); +var + I: Integer; +begin + inherited; + for I := 0 to Count - 1 do + if Items[I].Owner = Root then Proc(Items[I]); +end; + +function TdxLayoutGroup.GetShowCaption: Boolean; +begin + if FHidden then + Result := False + else + Result := ShowBorder and inherited GetShowCaption; +end; + +function TdxLayoutGroup.GetViewInfoClass: TdxCustomLayoutItemViewInfoClass; +begin + Result := TdxCustomLayoutItemViewInfoClass(GetLookAndFeel.GetGroupViewInfoClass); +end; + +procedure TdxLayoutGroup.Loaded; +begin + inherited; + FIsUserDefined := False; +end; + +procedure TdxLayoutGroup.LookAndFeelChanged; +var + I: Integer; +begin + inherited; + for I := 0 to VisibleCount - 1 do + VisibleItems[I].LookAndFeelChanged; +end; + +procedure TdxLayoutGroup.LookAndFeelChanging; +var + I: Integer; +begin + inherited; + for I := 0 to VisibleCount - 1 do + VisibleItems[I].LookAndFeelChanging; +end; + +function TdxLayoutGroup.ProcessDialogChar(ACharCode: Word): Boolean; +var + I: Integer; +begin + Result := inherited ProcessDialogChar(ACharCode); + if not Result then + for I := 0 to VisibleCount - 1 do + begin + Result := VisibleItems[I].ProcessDialogChar(ACharCode); + if Result then Break; + end; +end; + +procedure TdxLayoutGroup.RestoreItemControlSize; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].RestoreItemControlSize; +end; + +procedure TdxLayoutGroup.SelectionChanged; +var + I: Integer; +begin + inherited; + for I := 0 to VisibleCount - 1 do + VisibleItems[I].SelectionChanged; +end; + +procedure TdxLayoutGroup.SetChildOrder(Child: TComponent; Order: Integer); +begin + inherited; + (Child as TdxCustomLayoutItem).Index := Order; +end; + +procedure TdxLayoutGroup.SetParentComponent(Value: TComponent); +begin + if Value is TdxCustomLayoutControl and + not TdxCustomLayoutControl(Value).Items.IsLoading and + not (csAncestor in ComponentState) then + TdxCustomLayoutControl(Value).SetItems(Self) + else + inherited; +end; + +function TdxLayoutGroup.CanDestroy: Boolean; +begin + Result := Hidden and not IsRoot and not Locked; +end; + +procedure TdxLayoutGroup.BuildVisibleItemsList; +var + I: Integer; +begin + FVisibleItems.Clear; + for I := 0 to Count - 1 do + if Items[I].GetVisible then + FVisibleItems.Add(Items[I]); +end; + +function TdxLayoutGroup.GetLookAndFeelAsParent: TdxCustomLayoutLookAndFeel; +begin + if FLookAndFeelException and (Parent <> nil) then + Result := Parent.GetLookAndFeelAsParent + else + Result := GetLookAndFeel; +end; + +procedure TdxLayoutGroup.ChangeItemIndex(AItem: TdxCustomLayoutItem; + Value: Integer); +begin + if AItem.Index <> Value then + begin + FItems.Move(AItem.Index, Value); + if AItem.GetVisible then + begin + BuildVisibleItemsList; + Changed; + end; + end; +end; + +procedure TdxLayoutGroup.ChangeItemVisibleIndex(AItem: TdxCustomLayoutItem; + Value: Integer); +begin + ChangeItemIndex(AItem, GetItemIndex(Value)); +end; + +function TdxLayoutGroup.GetItemIndex(AItemVisibleIndex: Integer): Integer; +begin + if (0 <= AItemVisibleIndex) and (AItemVisibleIndex < VisibleCount) then + Result := VisibleItems[AItemVisibleIndex].Index + else + Result := Count; +end; + +function TdxLayoutGroup.IndexOf(AItem: TdxCustomLayoutItem): Integer; +begin + Result := FItems.IndexOf(AItem); +end; + +function TdxLayoutGroup.VisibleIndexOf(AItem: TdxCustomLayoutItem): Integer; +begin + Result := FVisibleItems.IndexOf(AItem); +end; + +function TdxLayoutGroup.CreateGroup(AGroupClass: TdxLayoutGroupClass = nil): TdxLayoutGroup; +begin + Result := Container.CreateGroup(AGroupClass, Self); +end; + +function TdxLayoutGroup.CreateItem(AItemClass: TdxCustomLayoutItemClass = nil): TdxCustomLayoutItem; +begin + Result := Container.CreateItem(AItemClass, Self); +end; + +function TdxLayoutGroup.CreateItemForControl(AControl: TControl): TdxLayoutItem; +begin + Result := Container.CreateItemForControl(AControl, Self); +end; + +function TdxLayoutGroup.CanMoveTo(AParent: TdxCustomLayoutItem): Boolean; +begin + Result := (AParent = nil) or + inherited CanMoveTo(AParent) and not AParent.HasAsParent(Self); +end; + +procedure TdxLayoutGroup.MoveChildrenToParent; +var + AInsertionIndex, I: Integer; +begin + AInsertionIndex := Index; + for I := Count - 1 downto 0 do + Items[I].Move(Parent, AInsertionIndex); +end; + +procedure TdxLayoutGroup.Pack; +var + I: Integer; + ASomethingDone: Boolean; + AGroup: TdxLayoutGroup; +begin + if FIsPacking or not Container.MayPack then Exit; + FIsPacking := True; + for I := Count - 1 downto 0 do + Items[I].Pack; + repeat + ASomethingDone := False; + if (Count = 0) and CanDestroy then + begin + Free; + Exit; + end; + if Count = 1 then + begin + if Items[0] is TdxLayoutGroup then + begin + AGroup := TdxLayoutGroup(Items[0]); + if AGroup.CanDestroy then + begin + LayoutDirection := AGroup.LayoutDirection; + AGroup.MoveChildrenToParent; + AGroup.Free; + ASomethingDone := True; + end; + end; + if not ASomethingDone and CanDestroy then + begin + Items[0].Move(Parent, Index); + ASomethingDone := True; + end; + end; + until not ASomethingDone; + FIsPacking := False; +end; + +function TdxLayoutGroup.PutChildrenIntoHiddenGroup: TdxLayoutGroup; +var + I: Integer; +begin + Result := CreateGroup; + Result.Hidden := True; + Result.LayoutDirection := LayoutDirection; + for I := Count - 2 downto 0 do + Items[I].Move(Result, 0); +end; + +{ TdxLayoutAlignmentConstraint } + +constructor TdxLayoutAlignmentConstraint.Create(AOwner: TComponent); +begin + inherited; + CreateItems; +end; + +destructor TdxLayoutAlignmentConstraint.Destroy; +begin + DestroyItems; + if FControl <> nil then + FControl.RemoveAlignmentConstraint(Self); + inherited; +end; + +function TdxLayoutAlignmentConstraint.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxLayoutAlignmentConstraint.GetItem(Index: Integer): TdxCustomLayoutItem; +begin + Result := FItems[Index]; +end; + +procedure TdxLayoutAlignmentConstraint.SetKind(Value: TdxLayoutAlignmentConstraintKind); +begin + if FKind <> Value then + begin + FKind := Value; + Changed; + end; +end; + +procedure TdxLayoutAlignmentConstraint.CreateItems; +begin + FItems := TList.Create; +end; + +procedure TdxLayoutAlignmentConstraint.DestroyItems; +var + I: Integer; +begin + BeginUpdate; + try + for I := Count - 1 downto 0 do + RemoveItem(Items[I]); + finally + EndUpdate; + end; + FItems.Free; +end; + +procedure TdxLayoutAlignmentConstraint.SetParentComponent(Value: TComponent); +begin + inherited; + if Value is TdxCustomLayoutControl then + TdxCustomLayoutControl(Value).AddAlignmentConstraint(Self); +end; + +procedure TdxLayoutAlignmentConstraint.BeginUpdate; +begin + FControl.BeginUpdate; +end; + +function TdxLayoutAlignmentConstraint.CanAddItem(AItem: TdxCustomLayoutItem): Boolean; +begin + Result := (AItem <> nil) and (AItem.Container = Control); +end; + +procedure TdxLayoutAlignmentConstraint.Changed; +begin + FControl.LayoutChanged; +end; + +procedure TdxLayoutAlignmentConstraint.EndUpdate; +begin + FControl.EndUpdate; +end; + +function TdxLayoutAlignmentConstraint.GetParentComponent: TComponent; +begin + Result := FControl; +end; + +function TdxLayoutAlignmentConstraint.HasParent: Boolean; +begin + Result := FControl <> nil; +end; + +procedure TdxLayoutAlignmentConstraint.AddItem(AItem: TdxCustomLayoutItem); +begin + if not CanAddItem(AItem) then Exit; + AItem.AlignmentConstraint := nil; + FItems.Add(AItem); + AItem.FAlignmentConstraint := Self; + Changed; +end; + +procedure TdxLayoutAlignmentConstraint.RemoveItem(AItem: TdxCustomLayoutItem); +begin + if (AItem <> nil) and (FItems.Remove(AItem) <> -1) then + begin + AItem.FAlignmentConstraint := nil; + Changed; + if not (csDestroying in ComponentState) and (Count < 2) then + Free; + end; +end; + +{ TdxLayoutControlDragAndDropObject } + +destructor TdxLayoutControlDragAndDropObject.Destroy; +begin + SourceItem := nil; + inherited; +end; + +function TdxLayoutControlDragAndDropObject.GetControl: TdxCustomLayoutControl; +begin + Result := TdxCustomLayoutControl(inherited Control); +end; + +procedure TdxLayoutControlDragAndDropObject.SetAreaPart(Value: TdxLayoutAreaPart); +begin + if FAreaPart <> Value then + begin + Dirty := True; + FAreaPart := Value; + end; +end; + +procedure TdxLayoutControlDragAndDropObject.SetDestItem(Value: TdxCustomLayoutItem); +begin + if FDestItem <> Value then + begin + Dirty := True; + FDestItem := Value; + end; +end; + +procedure TdxLayoutControlDragAndDropObject.SetSourceItem(Value: TdxCustomLayoutItem); +begin + if FSourceItem <> Value then + begin + if Value = nil then HideSourceItemMark; + FSourceItem := Value; + if Value <> nil then ShowSourceItemMark; + end; +end; + +procedure TdxLayoutControlDragAndDropObject.HideSourceItemMark; +begin + if Control.HandleAllocated and (FSourceItem.ViewInfo <> nil) then + RedrawWindow(Control.Handle, @FSourceItemBounds, 0, + RDW_ERASE or RDW_FRAME or RDW_INVALIDATE or RDW_ALLCHILDREN); +end; + +procedure TdxLayoutControlDragAndDropObject.ShowSourceItemMark; +var + AMaskBounds: TRect; + AMaskBitmap: TBitmap; + + function CreatePatternBitmap: TBitmap; + var + I, J: Integer; + begin + Result := TBitmap.Create; + with Result do + begin + Monochrome := True; + Width := 8; + Height := 8; + for I := 0 to Width - 1 do + for J := 0 to Height - 1 do + Canvas.Pixels[I, J] := clWhite * Byte(Odd(I) xor Odd(J)) + end; + end; + + function CreateMask: TBitmap; + begin + Result := TBitmap.Create; + Result.Width := AMaskBounds.Right; + Result.Height := AMaskBounds.Bottom; + Result.Canvas.Brush.Bitmap := CreatePatternBitmap; + end; + + function MaskCanvas: TCanvas; + begin + Result := AMaskBitmap.Canvas; + end; + +begin + if SourceItem.ViewInfo = nil then Exit; + FSourceItemBounds := SourceItem.ViewInfo.Bounds; + AMaskBounds := FSourceItemBounds; + OffsetRect(AMaskBounds, -AMaskBounds.Left, -AMaskBounds.Top); + with Control.Painter.GetCustomizationCanvas do + try + AMaskBitmap := CreateMask; + try + SetTextColor(MaskCanvas.Handle, 0); + SetBkColor(MaskCanvas.Handle, $FFFFFF); + MaskCanvas.FillRect(AMaskBounds); + + CopyMode := cmSrcAnd; + Draw(FSourceItemBounds.Left, FSourceItemBounds.Top, AMaskBitmap); + + SetTextColor(MaskCanvas.Handle, ColorToRGB(clHighlight)); + SetBkColor(MaskCanvas.Handle, 0); + MaskCanvas.FillRect(AMaskBounds); + + CopyMode := cmSrcPaint; + Draw(FSourceItemBounds.Left, FSourceItemBounds.Top, AMaskBitmap); + finally + CopyMode := cmSrcCopy; + + MaskCanvas.Brush.Bitmap.Free; + MaskCanvas.Brush.Bitmap := nil; + + AMaskBitmap.Free; + end; + finally + Free; + end; +end; + +procedure TdxLayoutControlDragAndDropObject.DirtyChanged; + + function GetAreaPartBounds: TRect; + + procedure CalculatePartBounds(AHorizontal, AFirstPart: Boolean); + var + AMiddle: Integer; + begin + with Result do + if AHorizontal then + begin + AMiddle := (Left + Right) div 2; + if AFirstPart then + Right := AMiddle + else + Left := AMiddle; + end + else + begin + AMiddle := (Top + Bottom) div 2; + if AFirstPart then + Bottom := AMiddle + else + Top := AMiddle; + end; + end; + + begin + if AreaPart in [apBeforeContent, apAfterContent] then + with TdxLayoutGroup(DestItem) do + begin + Result := ViewInfo.ClientBounds; + CalculatePartBounds(GetOrthogonalDirection(LayoutDirection) = ldHorizontal, + AreaPart = apBeforeContent); + end + else + begin + Result := DestItem.ViewInfo.Bounds; + if AreaPart = apCenter then + Result := GetCenterAreaBounds(Result) + else + CalculatePartBounds(AreaPart in [apLeft, apRight], AreaPart in [apLeft, apTop]); + end; + end; + + procedure ShowAreaPartMark; + const + FrameBorderSize = 3; + begin + with Control.Painter.GetCustomizationCanvas do + try + InvertFrame(GetAreaPartBounds, FrameBorderSize); + finally + Free; + end; + end; + + procedure HideAreaPartMark; + begin + ShowAreaPartMark; + end; + +begin + inherited; + if (DestItem = nil) or (AreaPart = apNone) then Exit; + if Dirty then + HideAreaPartMark + else + ShowAreaPartMark; +end; + +function TdxLayoutControlDragAndDropObject.GetDragAndDropCursor(Accepted: Boolean): TCursor; +begin + if Accepted or + (Control.ViewInfo.GetHitTest(CurMousePos).HitTestCode = htCustomizeForm) and + SourceItem.CanRemove then + Result := crdxLayoutControlDrag + else + if (Source = dsCustomizeForm) or not SourceItem.CanRemove then + Result := crcxNoDrop + else + Result := crcxRemove; +end; + +function TdxLayoutControlDragAndDropObject.GetCenterAreaBounds(const AItemBounds: TRect): TRect; +begin + Result := AItemBounds; + with Result do + InflateRect(Result, -(Right - Left) div 4, -(Bottom - Top) div 4); +end; + +procedure TdxLayoutControlDragAndDropObject.BeginDragAndDrop; +begin + inherited; + Control.DragAndDropBegan; +end; + +procedure TdxLayoutControlDragAndDropObject.DragAndDrop(const P: TPoint; + var Accepted: Boolean); +var + AHitTest: TdxCustomLayoutHitTest; + + function GetAreaPart(AItem: TdxCustomLayoutItem; const P: TPoint): TdxLayoutAreaPart; + const + ContentParts: array[Boolean] of TdxLayoutAreaPart = + (apBeforeContent, apAfterContent); + Parts: array[Boolean, Boolean] of TdxLayoutAreaPart = + ((apBottom, apRight), (apLeft, apTop)); + var + AGroup: TdxLayoutGroup; + ASign1, ASign2: Integer; + + function GetSign(const P1, P2, P: TPoint): Integer; + begin + Result := (P.X - P1.X) * (P2.Y - P1.Y) - (P.Y - P1.Y) * (P2.X - P1.X); + end; + + begin + Result := apNone; + + if AItem is TdxLayoutGroup and not TdxLayoutGroup(AItem).ViewInfo.IsLocked then + begin + AGroup := TdxLayoutGroup(AItem); + if AGroup.VisibleCount = 0 then + if PtInRect(GetCenterAreaBounds(AItem.ViewInfo.Bounds), P) then + Result := apCenter + else + else + if PtInRect(AGroup.ViewInfo.ClientBounds, P) then + with AGroup.ViewInfo.ClientBounds do + if AGroup.LayoutDirection = ldHorizontal then + Result := ContentParts[P.Y >= (Top + Bottom) div 2] + else + Result := ContentParts[P.X >= (Left + Right) div 2]; + end; + + if Result = apNone then + begin + with AItem.ViewInfo.Bounds do + begin + ASign1 := GetSign(Point(Left, Bottom), Point(Right, Top), P); + ASign2 := GetSign(TopLeft, BottomRight, P); + end; + Result := Parts[ASign1 >= 0, ASign2 >= 0]; + end; + end; + +begin + if IsWindowVisible(Control.Handle) then + AHitTest := Control.ViewInfo.GetHitTest(P) + else + AHitTest := nil; + Accepted := AHitTest is TdxCustomLayoutItemHitTest; + if Accepted then + begin + DestItem := TdxCustomLayoutItemHitTest(AHitTest).Item; + if SourceItem.CanMoveTo(DestItem) then + AreaPart := GetAreaPart(DestItem, P) + else + AreaPart := apNone; + end + else + if (AHitTest <> nil) and (AHitTest.HitTestCode = htClientArea) then + begin + Accepted := True; + DestItem := Control.Items; + if P.Y >= Control.ViewInfo.ContentBounds.Bottom then + AreaPart := apBottom + else + AreaPart := apRight; + end + else + DestItem := nil; + inherited; +end; + +procedure TdxLayoutControlDragAndDropObject.EndDragAndDrop(Accepted: Boolean); +type + TActionType = (atNone, atInsert, atCreateGroup, atContentInsert); + + function GetDestParent: TdxLayoutGroup; + begin + if AreaPart in [apCenter, apBeforeContent, apAfterContent] then + Result := TdxLayoutGroup(DestItem) + else + begin + Result := DestItem.Parent; + if Result = nil then + Result := DestItem as TdxLayoutGroup; + end; + end; + + function GetDestPosition: Integer; + begin + case AreaPart of + apCenter: + Result := 0; + apBeforeContent: + Result := 0; + apAfterContent: + Result := 1; + else + if DestItem.IsRoot then + Result := 0 + else + Result := DestItem.VisibleIndex; + if AreaPart in [apRight, apBottom] then Inc(Result); + if (SourceItem.Parent <> nil) and + (SourceItem.Parent = DestItem.Parent) and + (SourceItem.VisibleIndex < Result) then + Dec(Result); + end; + end; + + function GetLayoutDirection: TdxLayoutDirection; + begin + Result := GetDestParent.LayoutDirection; + end; + + function IsHorizontalAreaPart: Boolean; + begin + Result := AreaPart in [apLeft, apRight]; + end; + + function GetActionType: TActionType; + begin + if AreaPart = apNone then + Result := atNone + else + if AreaPart in [apBeforeContent, apAfterContent] then + Result := atContentInsert + else + if (AreaPart = apCenter) or not DestItem.IsRoot and + ((GetLayoutDirection = ldHorizontal) and IsHorizontalAreaPart or + (GetLayoutDirection = ldVertical) and not IsHorizontalAreaPart) then + Result := atInsert + else + Result := atCreateGroup; + end; + + procedure DoInsert; + begin + SourceItem.MoveTo(GetDestParent, GetDestPosition, True); + end; + + procedure DoCreateGroup; + const + LayoutDirections: array[Boolean] of TdxLayoutDirection = + (ldVertical, ldHorizontal); + var + AGroup: TdxLayoutGroup; + begin + if DestItem.IsRoot then + begin + GetDestParent.PutChildrenIntoHiddenGroup; + GetDestParent.LayoutDirection := LayoutDirections[IsHorizontalAreaPart]; + SourceItem.MoveTo(GetDestParent, GetDestPosition, True); + end + else + begin + AGroup := DestItem.PutIntoHiddenGroup(GetOrthogonalDirection(GetLayoutDirection)); + SourceItem.MoveTo(AGroup, GetDestPosition, True); + end; + end; + + procedure DoContentInsert; + begin + GetDestParent.PutChildrenIntoHiddenGroup; + GetDestParent.LayoutDirection := GetOrthogonalDirection(GetLayoutDirection); + SourceItem.MoveTo(GetDestParent, GetDestPosition, True); + end; + +begin + Dirty := True; + if Accepted then + begin + if DestItem <> nil then + case GetActionType of + atInsert: + DoInsert; + atCreateGroup: + DoCreateGroup; + atContentInsert: + DoContentInsert; + end + else + if (Source = dsControl) and SourceItem.CanRemove then + SourceItem.Parent := nil; + Control.Update; + Control.Modified; + end; + inherited; +end; + +procedure TdxLayoutControlDragAndDropObject.Init(ASource: TdxLayoutDragSource; + ASourceItem: TdxCustomLayoutItem); +begin + Control.Update; // to update selections + Source := ASource; + SourceItem := ASourceItem; +end; + +{ TCustomizedControls } + +type + TCustomizedControls = class + private + FForms: TList; + FItems: TList; + FPrevEnableds: TList; + function GetCount: Integer; + function GetForm(Index: Integer): TCustomForm; + function GetItem(Index: Integer): TdxCustomLayoutControl; + protected + function IndexOf(AItem: TdxCustomLayoutControl): Integer; + procedure InternalAddItem(AItem: TdxCustomLayoutControl); + procedure InternalRemoveItem(AItem: TdxCustomLayoutControl); + procedure InternalSetForm(AControl: TdxCustomLayoutControl; AForm: TCustomForm); + property Count: Integer read GetCount; + property Forms[Index: Integer]: TCustomForm read GetForm; + property Items[Index: Integer]: TdxCustomLayoutControl read GetItem; + public + constructor Create; + destructor Destroy; override; + function ProcessMouseMessage(AMessage: WPARAM; AMessageData: TMouseHookStruct): Boolean; + procedure ProcessWndProcMessage(AMessageData: TCWPStruct); + + class procedure AddItem(AItem: TdxCustomLayoutControl); + class procedure RemoveItem(AItem: TdxCustomLayoutControl); + class procedure SetForm(AControl: TdxCustomLayoutControl; AForm: TCustomForm); + class function IsCustomized(AControl: TdxCustomLayoutControl): Boolean; + end; + +var + CustomizedControls: TCustomizedControls; + MouseHookHandle: HHOOK; + WndProcHookHandle: HHOOK; + +function MouseHookProc(Code: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall; +var + AProcessed: Boolean; +begin + if Code = HC_ACTION then + AProcessed := + CustomizedControls.ProcessMouseMessage(wParam, PMouseHookStruct(lParam)^) + else + AProcessed := False; + Result := CallNextHookEx(MouseHookHandle, Code, wParam, lParam); + if AProcessed then Result := 1; +end; + +function WndProcHookProc(Code: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall; +begin + if Code = HC_ACTION then + CustomizedControls.ProcessWndProcMessage(PCWPStruct(lParam)^); + Result := CallNextHookEx(WndProcHookHandle, Code, wParam, lParam); +end; + +constructor TCustomizedControls.Create; +begin + inherited; + FForms := TList.Create; + FItems := TList.Create; + FPrevEnableds := TList.Create; + MouseHookHandle := SetWindowsHookEx(WH_MOUSE, MouseHookProc, 0, GetCurrentThreadId); + WndProcHookHandle := SetWindowsHookEx(WH_CALLWNDPROC, WndProcHookProc, 0, GetCurrentThreadId); +end; + +destructor TCustomizedControls.Destroy; +begin + UnhookWindowsHookEx(WndProcHookHandle); + UnhookWindowsHookEx(MouseHookHandle); + FPrevEnableds.Free; + FItems.Free; + FForms.Free; + inherited; +end; + +function TCustomizedControls.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TCustomizedControls.GetForm(Index: Integer): TCustomForm; +begin + Result := FForms[Index]; +end; + +function TCustomizedControls.GetItem(Index: Integer): TdxCustomLayoutControl; +begin + Result := TdxCustomLayoutControl(FItems[Index]); +end; + +function TCustomizedControls.IndexOf(AItem: TdxCustomLayoutControl): Integer; +begin + Result := FItems.IndexOf(AItem); +end; + +procedure TCustomizedControls.InternalAddItem(AItem: TdxCustomLayoutControl); +begin + FPrevEnableds.Add(Pointer(not EnableWindow(AItem.Handle, False))); + FItems.Add(AItem); + FForms.Count := Count; +end; + +procedure TCustomizedControls.InternalRemoveItem(AItem: TdxCustomLayoutControl); +var + AIndex: Integer; +begin + AIndex := FItems.Remove(AItem); + if AItem.HandleAllocated then + EnableWindow(AItem.Handle, Boolean(FPrevEnableds[AIndex])); + FPrevEnableds.Delete(AIndex); +end; + +procedure TCustomizedControls.InternalSetForm(AControl: TdxCustomLayoutControl; + AForm: TCustomForm); +begin + FForms[IndexOf(AControl)] := AForm; +end; + +function TCustomizedControls.ProcessMouseMessage(AMessage: WPARAM; + AMessageData: TMouseHookStruct): Boolean; +var + I: Integer; + AItem: TdxCustomLayoutControl; + P: TPoint; + AControl: TWinControl; +begin + Result := False; + for I := 0 to Count - 1 do + begin + AItem := Items[I]; + if (AItem.Handle = AMessageData.hwnd) or + (AItem.Parent.Handle = AMessageData.hwnd) and (GetCapture = 0) and + PtInRect(AItem.BoundsRect, AItem.Parent.ScreenToClient(AMessageData.pt)) then + begin + Result := AMessage <> WM_MOUSEMOVE; // to provide normal cursor processing (to call WM_SETCURSOR) + P := AItem.ScreenToClient(AMessageData.pt); + if GetCapture = AItem.Handle then + AControl := AItem + else + if AItem.HScrollBarVisible and PtInRect(AItem.HScrollBar.BoundsRect, P) then + AControl := AItem.HScrollBar + else + if AItem.VScrollBarVisible and PtInRect(AItem.VScrollBar.BoundsRect, P) then + AControl := AItem.VScrollBar + else + AControl := AItem; + P := AControl.ScreenToClient(AMessageData.pt); + AControl.Perform(AMessage, GetMouseKeys, LPARAM(PointToSmallPoint(P))); + Break; + end; + end; +end; + +procedure TCustomizedControls.ProcessWndProcMessage(AMessageData: TCWPStruct); +var + I: Integer; + AParentForm: TWinControl; + AHidden: Boolean; + + procedure CheckWindow(AWindow: HWND); + const + SetWindowPosParams: array[Boolean] of Integer = (SWP_SHOWWINDOW, SWP_HIDEWINDOW); + begin + SetWindowPos(AWindow, 0, 0, 0, 0, 0, + SWP_NOZORDER or SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE or + SetWindowPosParams[AHidden]); + end; + +begin + with AMessageData do + if message = WM_SIZE then + for I := 0 to Count - 1 do + begin + AParentForm := GetParentForm(Items[I]); + if (AParentForm <> nil) and (Forms[I] <> nil) and Forms[I].Visible then + begin + AHidden := IsIconic(AParentForm.Handle) or IsIconic(Application.Handle); + CheckWindow(Forms[I].Handle); + end; + end; +end; + +class procedure TCustomizedControls.AddItem(AItem: TdxCustomLayoutControl); +begin + if CustomizedControls = nil then + CustomizedControls := Self.Create; + CustomizedControls.InternalAddItem(AItem); +end; + +class procedure TCustomizedControls.RemoveItem(AItem: TdxCustomLayoutControl); +begin + CustomizedControls.InternalRemoveItem(AItem); + if CustomizedControls.Count = 0 then + FreeAndNil(CustomizedControls); +end; + +class procedure TCustomizedControls.SetForm(AControl: TdxCustomLayoutControl; + AForm: TCustomForm); +begin + CustomizedControls.InternalSetForm(AControl, AForm); +end; + +class function TCustomizedControls.IsCustomized(AControl: TdxCustomLayoutControl): Boolean; +begin + Result := + (CustomizedControls <> nil) and (CustomizedControls.IndexOf(AControl) <> -1); +end; + +{ TdxCustomLayoutControl } + +constructor TdxCustomLayoutControl.Create(AOwner: TComponent); +begin + inherited; + ControlStyle := ControlStyle + [csAcceptsControls, csOpaque]; +{$IFDEF DELPHI7} + ParentBackground := False; +{$ENDIF} + with inherited LookAndFeel do + begin + Kind := lfStandard; + NativeStyle := True; + end; + TabStop := False; + Width := 300; + Height := 250; + FAbsoluteItems := TList.Create; + FAutoControlAlignment := True; + FAutoControlTabOrders := True; + FAvailableItems := TList.Create; + FBoldFont := TFont.Create; + RefreshBoldFont; + FCustomizeFormClass := TLayoutCustomizeForm; + GetLookAndFeel.AddUser(Self); + SetItems(GetDefaultGroupClass.Create(Owner{nil})); + FItems.Hidden := True; + FMayPack := True; + //FGroups.UseIndent := False; + CreateConstraints; + if IsDesigning then dxLayoutDesigner.RegisterComponent(Self); +end; + +destructor TdxCustomLayoutControl.Destroy; +begin + if IsDesigning then dxLayoutDesigner.UnregisterComponent(Self); + Customization := False; + if not IsDesigning then + begin + if FStoreInIniFile then + SaveToIniFile(FIniFileName); + if FStoreInRegistry then + SaveToRegistry(FRegistryPath); + end; + SetItems(nil); + DestroyAvailableItems; + FAvailableItems.Free; + LookAndFeel := nil; + GetLookAndFeel.RemoveUser(Self); + DestroyConstraints; + dxLayoutTextMetrics.Unregister(FBoldFont); + dxLayoutTextMetrics.Unregister(Font); + FBoldFont.Free; + FAbsoluteItems.Free; + inherited; +end; + +function TdxCustomLayoutControl.GetAbsoluteItem(Index: Integer): TdxCustomLayoutItem; +begin + Result := FAbsoluteItems[Index]; +end; + +function TdxCustomLayoutControl.GetAbsoluteItemCount: Integer; +begin + Result := FAbsoluteItems.Count; +end; + +function TdxCustomLayoutControl.GetAlignmentConstraint(Index: Integer): TdxLayoutAlignmentConstraint; +begin + Result := FAlignmentConstraints[Index]; +end; + +function TdxCustomLayoutControl.GetAlignmentConstraintCount: Integer; +begin + Result := FAlignmentConstraints.Count; +end; + +function TdxCustomLayoutControl.GetAvailableItem(Index: Integer): TdxCustomLayoutItem; +begin + Result := FAvailableItems[Index]; +end; + +function TdxCustomLayoutControl.GetAvailableItemCount: Integer; +begin + Result := FAvailableItems.Count; +end; + +function TdxCustomLayoutControl.GetIsCustomizationMode: Boolean; +begin + Result := TCustomizedControls.IsCustomized(Self); +end; + +function TdxCustomLayoutControl.GetLayoutDirection: TdxLayoutDirection; +begin + Result := FItems.LayoutDirection; +end; + +procedure TdxCustomLayoutControl.SetAutoContentSizes(Value: TdxLayoutAutoContentSizes); +begin + if FAutoContentSizes <> Value then + begin + FAutoContentSizes := Value; + LayoutChanged; + end; +end; + +procedure TdxCustomLayoutControl.SetAutoControlAlignment(Value: Boolean); +begin + if FAutoControlAlignment <> Value then + begin + FAutoControlAlignment := Value; + LayoutChanged; + end; +end; + +procedure TdxCustomLayoutControl.SetAutoControlTabOrders(Value: Boolean); +begin + if FAutoControlTabOrders <> Value then + begin + FAutoControlTabOrders := Value; + LayoutChanged; + end; +end; + +procedure TdxCustomLayoutControl.SetCustomization(Value: Boolean); +begin + if (FCustomization <> Value) and (not Value or HandleAllocated) then + begin + FCustomization := Value; + LayoutChanged; + if FCustomization then + begin + IsCustomizationMode := True; + FCustomizeForm := TLayoutCustomizeFormClass(CustomizeFormClass).Create(Self); + FCustomizeForm.Show; + CustomizationModeForm := FCustomizeForm; + end + else + begin + with FCustomizeForm do + if not (csDestroying in ComponentState) then + Free; + FCustomizeForm := nil; + IsCustomizationMode := False; + end; + DoCustomization; + end; +end; + +procedure TdxCustomLayoutControl.SetCustomizationModeForm(Value: TCustomForm); +begin + TCustomizedControls.SetForm(Self, Value); +end; + +procedure TdxCustomLayoutControl.SetIsCustomizationMode(Value: Boolean); +begin + if IsCustomizationMode <> Value then + if Value then + TCustomizedControls.AddItem(Self) + else + TCustomizedControls.RemoveItem(Self); +end; + +procedure TdxCustomLayoutControl.SetIsPlaceControlsNeeded(Value: Boolean); +begin + if FIsPlaceControlsNeeded <> Value then + begin + FIsPlaceControlsNeeded := Value; + if Value then + if (LookAndFeel <> nil) and TLookAndFeelAccess(LookAndFeel).ForceControlArrangement then + SendMessage(Handle, CM_PLACECONTROLS, 0, 0) + else + PostMessage(Handle, CM_PLACECONTROLS, 0, 0); + end; +end; + +procedure TdxCustomLayoutControl.SetItems(Value: TdxLayoutGroup); +begin + ItemWithMouse := nil; + DestroyHandlers; + FItems.Free; + FItems := Value; + if Value = nil then Exit; + FItems.Container := Self; + CreateHandlers; +end; + +procedure TdxCustomLayoutControl.SetItemWithMouse(Value: TdxCustomLayoutItem); +begin + if FItemWithMouse <> Value then + begin + if FItemWithMouse <> nil then + FItemWithMouse.MouseLeave; + FItemWithMouse := Value; + if FItemWithMouse <> nil then + FItemWithMouse.MouseEnter; + end; +end; + +procedure TdxCustomLayoutControl.SetLayoutDirection(Value: TdxLayoutDirection); +begin + FItems.LayoutDirection := Value; +end; + +procedure TdxCustomLayoutControl.SetLeftPos(Value: Integer); +var + APrevLeftPos: Integer; +begin + CheckLeftPos(Value); + if FLeftPos <> Value then + begin + Update; + APrevLeftPos := FLeftPos; + FLeftPos := Value; + LayoutChanged; + ScrollContent(APrevLeftPos, FLeftPos, True); + end; +end; + +procedure TdxCustomLayoutControl.SetLookAndFeel(Value: TdxCustomLayoutLookAndFeel); +begin + if FLookAndFeel <> Value then + begin + GetLookAndFeel.RemoveUser(Self); + FLookAndFeel := Value; + GetLookAndFeel.AddUser(Self); + LookAndFeelChanged; + end; +end; + +procedure TdxCustomLayoutControl.SetShowHiddenGroupsBounds(Value: Boolean); +begin + if FShowHiddenGroupsBounds <> Value then + begin + FShowHiddenGroupsBounds := Value; + LayoutChanged; + end; +end; + +procedure TdxCustomLayoutControl.SetTopPos(Value: Integer); +var + APrevTopPos: Integer; +begin + CheckTopPos(Value); + if FTopPos <> Value then + begin + Update; + APrevTopPos := FTopPos; + FTopPos := Value; + LayoutChanged; + ScrollContent(APrevTopPos, FTopPos, False); + end; +end; + +procedure TdxCustomLayoutControl.CreateHandlers; +begin + FPainter := GetPainterClass.Create(Self); + FViewInfo := GetViewInfoClass.Create(Self); +end; + +procedure TdxCustomLayoutControl.DestroyHandlers; +begin + FreeAndNil(FViewInfo); + FreeAndNil(FPainter); +end; + +procedure TdxCustomLayoutControl.CreateConstraints; +begin + FAlignmentConstraints := TList.Create; +end; + +procedure TdxCustomLayoutControl.DestroyConstraints; +var + I: Integer; +begin + for I := AlignmentConstraintCount - 1 downto 0 do + AlignmentConstraints[I].Free; + FreeAndNil(FAlignmentConstraints); +end; + +procedure TdxCustomLayoutControl.AddAlignmentConstraint(AConstraint: TdxLayoutAlignmentConstraint); +begin + FAlignmentConstraints.Add(AConstraint); + AConstraint.FControl := Self; + SetComponentName(AConstraint, Name + 'AlignmentConstraint', IsDesigning, IsLoading); +end; + +procedure TdxCustomLayoutControl.RemoveAlignmentConstraint(AConstraint: TdxLayoutAlignmentConstraint); +begin + FAlignmentConstraints.Remove(AConstraint); + AConstraint.FControl := nil; +end; + +procedure TdxCustomLayoutControl.RefreshBoldFont; +begin + FBoldFont.Assign(Font); + with FBoldFont do + Style := Style + [fsBold]; + dxLayoutTextMetrics.Unregister(FBoldFont); +end; + +procedure TdxCustomLayoutControl.AddAbsoluteItem(AItem: TdxCustomLayoutItem); +begin + FAbsoluteItems.Add(AItem); +end; + +procedure TdxCustomLayoutControl.RemoveAbsoluteItem(AItem: TdxCustomLayoutItem); +begin + FAbsoluteItems.Remove(AItem); +end; + +procedure TdxCustomLayoutControl.AddAvailableItem(AItem: TdxCustomLayoutItem); +begin + FAvailableItems.Add(AItem); + AItem.Container := Self; + AvailableItemListChanged(AItem, True); +end; + +procedure TdxCustomLayoutControl.RemoveAvailableItem(AItem: TdxCustomLayoutItem); +begin + FAvailableItems.Remove(AItem); + AvailableItemListChanged(AItem, False); +end; + +procedure TdxCustomLayoutControl.DestroyAvailableItems; +var + I: Integer; +begin + for I := AvailableItemCount - 1 downto 0 do + AvailableItems[I].Free; +end; + +{$IFNDEF DELPHI7} + +procedure TdxCustomLayoutControl.WMPrintClient(var Message: TWMPrintClient); +begin + with Message do + if Result <> 1 then + if ((Flags and PRF_CHECKVISIBLE) = 0) or Visible then + PaintHandler(TWMPaint(Message)) + else + inherited + else + inherited; +end; + +{$ENDIF} + +procedure TdxCustomLayoutControl.CMControlChange(var Message: TCMControlChange); +var + AControl: TControl; + P: TPoint; + AHitTest: TdxCustomLayoutHitTest; + AGroup: TdxLayoutGroup; + AIndex: Integer; +begin + inherited; + if not (IsLoading or IsDestroying) then + begin + AControl := Message.Control; + if Message.Inserting then + begin + if (csAncestor in AControl.ComponentState) or + IsInternalControl(AControl) or (FindItem(AControl) <> nil) then + Exit; + P := AControl.BoundsRect.TopLeft; + AHitTest := ViewInfo.GetHitTest(P); + if AHitTest is TdxCustomLayoutItemHitTest then + if AHitTest is TdxLayoutGroupHitTest then + AGroup := TdxLayoutGroupHitTest(AHitTest).Item + else + AGroup := TdxCustomLayoutItemHitTest(AHitTest).Item.Parent + else + AGroup := Items; + AIndex := AGroup.ViewInfo.GetInsertionPos(P); + AGroup.CreateItemForControl(AControl).VisibleIndex := AIndex; + end + else + FindItem(AControl).Free; + end; +end; + +procedure TdxCustomLayoutControl.CMDialogChar(var Message: TCMDialogChar); +begin + if FItems.ProcessDialogChar(Message.CharCode) then + Message.Result := 1 + else + inherited; +end; + +{procedure TdxCustomLayoutControl.CMFreeItem(var Message: TMessage); +begin + TObject(Message.WParam).Free; +end;} + +procedure TdxCustomLayoutControl.CMPlaceControls(var Message: TMessage); +begin + IsPlaceControlsNeeded := False; + Painter.PlaceControls; +end; + +procedure TdxCustomLayoutControl.AlignControls(AControl: TControl; var Rect: TRect); +begin +end; + +function TdxCustomLayoutControl.AllowAutoDragAndDropAtDesignTime(X, Y: Integer; + Shift: TShiftState): Boolean; +begin + Result := not GetDesignHitTest(X, Y, Shift); +end; + +function TdxCustomLayoutControl.AllowDragAndDropWithoutFocus: Boolean; +begin + Result := FCustomization; +end; + +procedure TdxCustomLayoutControl.BoundsChanged; +begin + inherited; + LayoutChanged; +end; + +function TdxCustomLayoutControl.CanDrag(X, Y: Integer): Boolean; +begin + Result := inherited CanDrag(X, Y) and not IsDesigning; +end; + +procedure TdxCustomLayoutControl.CreateParams(var Params: TCreateParams); +begin + inherited; + with Params do + WindowClass.style := WindowClass.style and not (CS_HREDRAW or CS_VREDRAW); +end; + +procedure TdxCustomLayoutControl.DestroyWindowHandle; +begin + inherited; + IsPlaceControlsNeeded := False; +end; + +procedure TdxCustomLayoutControl.FontChanged; +begin + inherited; + dxLayoutTextMetrics.Unregister(Font); + RefreshBoldFont; + LookAndFeelChanged; +end; + +procedure TdxCustomLayoutControl.GetChildren(Proc: TGetChildProc; Root: TComponent); +var + I: Integer; +begin + inherited; + if Owner = Root then + begin + Proc(FItems); + for I := 0 to AvailableItemCount - 1 do + Proc(AvailableItems[I]); + for I := 0 to AlignmentConstraintCount - 1 do + Proc(AlignmentConstraints[I]); + end; +end; + +function TdxCustomLayoutControl.GetCursor(X, Y: Integer): TCursor; +var + AHitTest: TdxCustomLayoutHitTest; +begin + AHitTest := ViewInfo.GetHitTest(X, Y); + if AHitTest is TdxCustomLayoutItemHitTest then + Result := TdxCustomLayoutItemHitTest(AHitTest).Item.GetCursor(X, Y) + else + Result := crDefault; + if Result = crDefault then + Result := inherited GetCursor(X, Y); +end; + +function TdxCustomLayoutControl.GetDesignHitTest(X, Y: Integer; Shift: TShiftState): Boolean; +var + AHitTest: TdxCustomLayoutHitTest; +begin + Result := inherited GetDesignHitTest(X, Y, Shift); + if not Result then + begin + AHitTest := ViewInfo.GetHitTest(X, Y); + Result := + not (ssRight in Shift) and not FRightButtonPressed and + (AHitTest is TdxCustomLayoutItemHitTest) and + not TdxCustomLayoutItemHitTest(AHitTest).Item.IsRoot and + not dxLayoutDesigner.IsToolSelected; + end; + FRightButtonPressed := ssRight in Shift; +end; + +function TdxCustomLayoutControl.HasBackground: Boolean; +begin + Result := {$IFDEF DELPHI7}ThemeServices.ThemesEnabled and ParentBackground{$ELSE}inherited HasBackground{$ENDIF}; +end; + +procedure TdxCustomLayoutControl.Loaded; +begin + inherited; + if not IsDesigning then + begin + if FStoreInIniFile then + LoadFromIniFile(FIniFileName); + if FStoreInRegistry then + LoadFromRegistry(FRegistryPath); + end; + LookAndFeelChanged; +end; + +procedure TdxCustomLayoutControl.MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + AssignItemWithMouse(X, Y); + if ItemWithMouse <> nil then + ItemWithMouse.MouseDown(Button, Shift, X, Y); + inherited; +end; + +procedure TdxCustomLayoutControl.MouseLeave(AControl: TControl); +begin + inherited; + ItemWithMouse := nil; +end; + +procedure TdxCustomLayoutControl.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + AssignItemWithMouse(X, Y); + if ItemWithMouse <> nil then + ItemWithMouse.MouseMove(Shift, X, Y); + inherited; +end; + +procedure TdxCustomLayoutControl.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited; + AssignItemWithMouse(X, Y); + if ItemWithMouse <> nil then + ItemWithMouse.MouseUp(Button, Shift, X, Y); +end; + +procedure TdxCustomLayoutControl.Paint; +begin + inherited; + if not IsUpdateLocked then Painter.Paint; +end; + +procedure TdxCustomLayoutControl.SetName(const Value: TComponentName); +var + AOldName: string; + + function GetItem(ACaller: TComponent; Index: Integer): TComponent; + begin + with TdxCustomLayoutControl(ACaller) do + if Index = 0 then + Result := Items + else + Result := AbsoluteItems[Index - 1]; + end; + + function GetAlignmentConstraint(ACaller: TComponent; Index: Integer): TComponent; + begin + Result := TdxCustomLayoutControl(ACaller).AlignmentConstraints[Index]; + end; + +begin + AOldName := Name; + inherited; + RenameComponents(Self, Owner, Name, AOldName, 1 + AbsoluteItemCount, @GetItem); + RenameComponents(Self, Owner, Name, AOldName, + AlignmentConstraintCount, @GetAlignmentConstraint); + if IsDesigning then + dxLayoutDesigner.ComponentNameChanged(Self); +end; + +{$IFDEF DELPHI7} + +procedure TdxCustomLayoutControl.SetParentBackground(Value: Boolean); +begin + if Value then + ControlStyle := ControlStyle - [csOpaque] + else + ControlStyle := ControlStyle + [csOpaque]; + inherited; +end; + +{$ENDIF} + +procedure TdxCustomLayoutControl.WndProc(var Message: TMessage); +begin + if (WM_MOUSEFIRST <= Message.Msg) and (Message.Msg <= WM_MOUSELAST) and + IsCustomizationMode then + Dispatch(Message) + else + inherited; +end; + +procedure TdxCustomLayoutControl.WriteState(Writer: TWriter); +begin + if HandleAllocated then + SendMessage(Handle, WM_SETREDRAW, 0, 0); + try + Items.RestoreItemControlSize; + inherited; + finally + if HandleAllocated then + SendMessage(Handle, WM_SETREDRAW, 1, 0); + LayoutChanged; + end; +end; + +procedure TdxCustomLayoutControl.InitScrollBarsParameters; +begin + inherited; + SetScrollBarInfo(sbHorizontal, 0, ViewInfo.ContentWidth - 1, + ScrollStep, ViewInfo.ClientWidth, LeftPos, True, True); + SetScrollBarInfo(sbVertical, 0, ViewInfo.ContentHeight - 1, + ScrollStep, ViewInfo.ClientHeight, TopPos, True, True); +end; + +function TdxCustomLayoutControl.NeedsToBringInternalControlsToFront: Boolean; +begin + Result := True; +end; + +procedure TdxCustomLayoutControl.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); + + function GetContentPos: Integer; + begin + if AScrollBarKind = sbHorizontal then + Result := LeftPos + else + Result := TopPos; + end; + + procedure SetContentPos(Value: Integer); + begin + if AScrollBarKind = sbHorizontal then + LeftPos := Value + else + TopPos := Value; + end; + + function GetPageScrollStep: Integer; + begin + if AScrollBarKind = sbHorizontal then + Result := ClientWidth + else + Result := ClientHeight; + end; + +begin + inherited; + case AScrollCode of + scLineUp: + SetContentPos(GetContentPos - ScrollStep); + scLineDown: + SetContentPos(GetContentPos + ScrollStep); + scPageUp: + SetContentPos(GetContentPos - GetPageScrollStep); + scPageDown: + SetContentPos(GetContentPos + GetPageScrollStep); + scTrack: + SetContentPos(AScrollPos); + end; + AScrollPos := GetContentPos; +end; + +function TdxCustomLayoutControl.CanDragAndDrop: Boolean; +begin + Result := not IsDesigning or not (csInline in Owner.ComponentState); +end; + +function TdxCustomLayoutControl.StartDragAndDrop(const P: TPoint): Boolean; +var + AHideHiddenGroupsFromHitTest: Boolean; + AHitTest: TdxCustomLayoutHitTest; + AItem: TdxCustomLayoutItem; +begin + Result := False; + if IsCustomization and CanDragAndDrop then + begin + AHideHiddenGroupsFromHitTest := ViewInfo.HideHiddenGroupsFromHitTest; + ViewInfo.HideHiddenGroupsFromHitTest := not IsDesigning; + try + AHitTest := ViewInfo.GetHitTest(P); + finally + ViewInfo.HideHiddenGroupsFromHitTest := AHideHiddenGroupsFromHitTest; + end; + if AHitTest is TdxCustomLayoutItemHitTest then + begin + AItem := TdxCustomLayoutItemHitTest(AHitTest).Item; + if not AItem.IsRoot then + begin + DragAndDropObjectClass := TdxLayoutControlDragAndDropObject; + TdxLayoutControlDragAndDropObject(DragAndDropObject).Init(dsControl, AItem); + Result := True; + end + end; + end; +end; + +function TdxCustomLayoutControl.GetLookAndFeel: TdxCustomLayoutLookAndFeel; +begin + Result := FLookAndFeel; + if Result = nil then + Result := dxLayoutDefaultLookAndFeel; +end; + +procedure TdxCustomLayoutControl.BeginLookAndFeelDestroying; +begin + BeginUpdate; +end; + +procedure TdxCustomLayoutControl.EndLookAndFeelDestroying; +begin + EndUpdate; +end; + +procedure TdxCustomLayoutControl.LookAndFeelChanged; +var + ASkinName: string; +begin + {if LookAndFeel <> nil then + Color := LookAndFeel.GetEmptyAreaColor;} + + ASkinName := ''; + if LookAndFeel <> nil then + ASkinName := LookAndFeel.InternalName; + + with inherited LookAndFeel do + begin + NativeStyle := ASkinName = ''; + SkinName := ASkinName; + end; + + if (LookAndFeel <> nil) and not DoubleBuffered then + DoubleBuffered := LookAndFeel.NeedDoubleBuffered; + if (FItems <> nil) and (GetLookAndFeel <> nil) then + FItems.LookAndFeelChangedImpl; +end; + +procedure TdxCustomLayoutControl.LookAndFeelDestroyed; +begin + LookAndFeel := nil; +end; + +procedure TdxCustomLayoutControl.SelectionChanged; +begin + Items.SelectionChanged; +end; + +function TdxCustomLayoutControl.GetPainterClass: TdxLayoutControlPainterClass; +begin + Result := TdxLayoutControlPainter; +end; + +function TdxCustomLayoutControl.GetViewInfoClass: TdxLayoutControlViewInfoClass; +begin + Result := TdxLayoutControlViewInfo; +end; + +procedure TdxCustomLayoutControl.AssignItemWithMouse(X, Y: Integer); +var + AHitTest: TdxCustomLayoutHitTest; +begin + AHitTest := ViewInfo.GetHitTest(X, Y); + if AHitTest is TdxCustomLayoutItemHitTest then + ItemWithMouse := TdxCustomLayoutItemHitTest(AHitTest).Item + else + ItemWithMouse := nil; +end; + +procedure TdxCustomLayoutControl.AvailableItemListChanged(AItem: TdxCustomLayoutItem; + AIsItemAdded: Boolean); +begin + if FCustomization then + TLayoutCustomizeForm(FCustomizeForm).AvailableItemListChanged(Aitem, AIsItemAdded); +end; + +function TdxCustomLayoutControl.CalculateCustomizeFormBounds(const AFormBounds: TRect): TRect; +var + AControlBounds, ADesktopBounds: TRect; +begin + AControlBounds := BoundsRect; + MapWindowPoints(Parent.Handle, 0, AControlBounds, 2); + ADesktopBounds := GetDesktopWorkArea(AControlBounds.TopLeft); + + Result := AFormBounds; + with AControlBounds do + begin + if (ADesktopBounds.Right - Right >= Result.Right - Result.Left) or + (ADesktopBounds.Right - Right >= Left - ADesktopBounds.Left) then + OffsetRect(Result, Right - Result.Left, 0) + else + OffsetRect(Result, Left - Result.Right, 0); + OffsetRect(Result, 0, + (Top + Bottom - (Result.Bottom - Result.Top)) div 2 - Result.Top); + end; + with ADesktopBounds do + begin + if Result.Left < Left then + OffsetRect(Result, Left - Result.Left, 0); + if Result.Right > Right then + OffsetRect(Result, Right - Result.Right, 0); + if Result.Top < Top then + OffsetRect(Result, 0, Top - Result.Top); + end; +end; + +function TdxCustomLayoutControl.CanMultiSelect: Boolean; +begin + Result := dxLayoutDesigner.GetDesigner(Self) <> nil; +end; + +function TdxCustomLayoutControl.CanShowSelection: Boolean; +begin + Result := {$IFDEF DELPHI6}True{$ELSE}CanMultiSelect{$ENDIF}; +end; + +procedure TdxCustomLayoutControl.CheckLeftPos(var Value: Integer); +begin + if Value > ViewInfo.ContentWidth - ViewInfo.ClientWidth then + Value := ViewInfo.ContentWidth - ViewInfo.ClientWidth; + if Value < 0 then Value := 0; +end; + +procedure TdxCustomLayoutControl.CheckPositions; +begin + LeftPos := LeftPos; + TopPos := TopPos; +end; + +procedure TdxCustomLayoutControl.CheckTopPos(var Value: Integer); +begin + if Value > ViewInfo.ContentHeight - ViewInfo.ClientHeight then + Value := ViewInfo.ContentHeight - ViewInfo.ClientHeight; + if Value < 0 then Value := 0; +end; + +procedure TdxCustomLayoutControl.DoCustomization; +begin + if Assigned(FOnCustomization) then FOnCustomization(Self); +end; + +procedure TdxCustomLayoutControl.DragAndDropBegan; +begin + if FCustomization then + TLayoutCustomizeForm(FCustomizeForm).DragAndDropBegan; +end; + +function TdxCustomLayoutControl.GetAlignmentConstraintClass: TdxLayoutAlignmentConstraintClass; +begin + Result := TdxLayoutAlignmentConstraint; +end; + +function TdxCustomLayoutControl.GetDefaultGroupClass: TdxLayoutGroupClass; +begin + Result := TdxLayoutGroup; +end; + +function TdxCustomLayoutControl.GetDefaultItemClass: TdxLayoutItemClass; +begin + Result := TdxLayoutItem; +end; + +function TdxCustomLayoutControl.IsCustomization: Boolean; +begin + Result := Customization or IsDesigning; +end; + +function TdxCustomLayoutControl.IsUpdateLocked: Boolean; +begin + Result := FUpdateLockCount <> 0; +end; + +procedure TdxCustomLayoutControl.LayoutChanged; +begin + if FItems <> nil then FItems.Changed; +end; + +{procedure TdxCustomLayoutControl.PostFree(AObject: TObject); +begin + if HandleAllocated then + PostMessage(Handle, CM_FREEITEM, WParam(AObject), 0); +end;} + +procedure TdxCustomLayoutControl.ScrollContent(APrevPos, ACurPos: Integer; + AHorzScrolling: Boolean); +var + ADelta: Integer; + AScrollBounds: TRect; +begin + if not HandleAllocated then Exit; + ADelta := -(ACurPos - APrevPos); + AScrollBounds := ViewInfo.ClientBounds; + //ValidateRect(Handle, @AScrollBounds); + ScrollWindowEx(Handle, Ord(AHorzScrolling) * ADelta, Ord(not AHorzScrolling) * ADelta, + @AScrollBounds, nil, 0, nil, SW_INVALIDATE or SW_ERASE{ or SW_SCROLLCHILDREN bug in WinAPI}); + UpdateWindow(Handle); +end; + +type + PdxLayoutItemPosition = ^TdxLayoutItemPosition; + TdxLayoutItemPosition = record + Item: TdxCustomLayoutItem; + ParentName: string; + Index: Integer; + end; + +function ComparePositions(Item1, Item2: Pointer): Integer; +begin + Result := PdxLayoutItemPosition(Item1).Index - PdxLayoutItemPosition(Item2).Index; +end; + +procedure TdxCustomLayoutControl.LoadFromCustomIniFile(AIniFile: TCustomIniFile; + const ARootSection: string); +var + AItems: TList; + APositions: TList; + AItemCount, I: Integer; + + function CreateItemsList: TList; + begin + Result := TList.Create; + Result.Count := AbsoluteItemCount; + Move(FAbsoluteItems.List^, Result.List^, Result.Count * SizeOf(Pointer)); + end; + + procedure PrepareItems; + var + I: Integer; + begin + for I := 0 to AbsoluteItemCount - 1 do + AbsoluteItems[I].Parent := nil; + end; + + function GetItemSection(AIndex: Integer): string; + begin + Result := 'Item' + IntToStr(AIndex); + if ARootSection <> '' then + Result := ARootSection + '\' + Result; + end; + + procedure AddPosition(AItem: TdxCustomLayoutItem; const AParentName: string; + AIndex: Integer); + var + APosition: PdxLayoutItemPosition; + begin + New(APosition); + with APosition^ do + begin + Item := AItem; + ParentName := AParentName; + Index := AIndex; + end; + APositions.Add(APosition); + end; + + procedure LoadItem(const ASection: string); + var + AName, AParentName: string; + AItem: TdxCustomLayoutItem; + AIndex: Integer; + AGroup: TdxLayoutGroup; + begin + AName := AIniFile.ReadString(ASection, 'Name', ''); + if AName = '' then Exit; + AItem := FindItem(AName); + AItems.Remove(AItem); + if AItem = nil then + begin + AItem := CreateGroup; + AItem.Name := AName; + end; + + AParentName := AIniFile.ReadString(ASection, 'ParentName', ''); + AIndex := AIniFile.ReadInteger(ASection, 'Index', -1); + AddPosition(AItem, AParentName, AIndex); + + if AItem is TdxLayoutGroup then + begin + AGroup := TdxLayoutGroup(AItem); + AGroup.Hidden := AIniFile.ReadBool(ASection, 'Hidden', False); + AGroup.LayoutDirection := + TdxLayoutDirection(AIniFile.ReadInteger(ASection, 'LayoutDirection', 0)); + if AGroup.IsUserDefined and not AGroup.Hidden then + AGroup.Caption := AIniFile.ReadString(ASection, 'Caption', ''); + end; + end; + + procedure DestroyNonLoadedItems; + var + I: Integer; + + function CanDestroy(AItem: TdxCustomLayoutItem): Boolean; + + function ItemExists(AItem: Pointer): Boolean; + var + I: Integer; + begin + for I := 0 to AbsoluteItemCount - 1 do + begin + Result := AbsoluteItems[I] = AItem; + if Result then Exit; + end; + Result := False; + end; + + begin + Result := ItemExists(AItem) and + (AItem is TdxLayoutGroup) and TdxLayoutGroup(AItem).CanDestroy; + end; + + begin + for I := 0 to AItems.Count - 1 do + if CanDestroy(AItems[I]) then + TObject(AItems[I]).Free; + end; + + procedure UpdatePositions; + var + I: Integer; + APosition: PdxLayoutItemPosition; + begin + APositions.Sort(ComparePositions); + for I := 0 to APositions.Count - 1 do + begin + APosition := PdxLayoutItemPosition(APositions[I]); + with APosition^ do + begin + Item.Parent := FindItem(ParentName) as TdxLayoutGroup; + Item.Index := Index; + end; + end; + end; + +begin + AItems := CreateItemsList; + APositions := TList.Create; + try + AItemCount := AIniFile.ReadInteger(ARootSection, 'ItemCount', -1); + if AItemCount = -1 then Exit; + BeginUpdate; + try + MayPack := False; + try + PrepareItems; + for I := 0 to AItemCount - 1 do + LoadItem(GetItemSection(I)); + DestroyNonLoadedItems; + UpdatePositions; + finally + MayPack := True; + Items.Pack; + end; + finally + EndUpdate; + end; + finally + for I := 0 to APositions.Count - 1 do + Dispose(PdxLayoutItemPosition(APositions[I])); + APositions.Free; + AItems.Free; + end; +end; + +function CompareItemsByIsUserDefined(Item1, Item2: Pointer): Integer; +var + AItem1, AItem2: TdxCustomLayoutItem; +begin + AItem1 := TdxCustomLayoutItem(Item1); + AItem2 := TdxCustomLayoutItem(Item2); + if (AItem1 is TdxLayoutGroup) and (AItem2 is TdxLayoutGroup) then + Result := + Ord(TdxLayoutGroup(AItem2).IsUserDefined) - Ord(TdxLayoutGroup(AItem1).IsUserDefined) + else + Result := Ord(AItem2 is TdxLayoutGroup) - Ord(AItem1 is TdxLayoutGroup); + if Result = 0 then + Result := Integer(Item1) - Integer(Item2); +end; + +procedure TdxCustomLayoutControl.SaveToCustomIniFile(AIniFile: TCustomIniFile; + const ARootSection: string); +var + AItems: TList; + I: Integer; + + function CreateItemsList: TList; + begin + Result := TList.Create; + Result.Count := AbsoluteItemCount; + Move(FAbsoluteItems.List^, Result.List^, Result.Count * SizeOf(Pointer)); + Result.Sort(CompareItemsByIsUserDefined); + Result.Insert(0, Items); + end; + + function GetItemSection(AIndex: Integer): string; + begin + Result := 'Item' + IntToStr(AIndex); + if ARootSection <> '' then + Result := ARootSection + '\' + Result; + end; + + procedure DeletePrevSettings; + var + ABaseSectionName: string; + ASections: TStringList; + I: Integer; + begin + ABaseSectionName := ARootSection; + if ABaseSectionName <> '' then + ABaseSectionName := ABaseSectionName + '\'; + ASections := TStringList.Create; + try + AIniFile.ReadSections(ASections); + for I := 0 to ASections.Count - 1 do + if Copy(ASections[I], 1, Length(ABaseSectionName)) = ABaseSectionName then + AIniFile.EraseSection(ASections[I]); + finally + ASections.Free; + end; + end; + + procedure SaveItem(const ASection: string; AItem: TdxCustomLayoutItem); + var + AGroup: TdxLayoutGroup; + + function GetParentName: string; + begin + if AItem.Parent <> nil then + Result := AItem.Parent.Name + else + Result := ''; + end; + + begin + AIniFile.WriteString(ASection, 'Name', AItem.Name); + AIniFile.WriteString(ASection, 'ParentName', GetParentName); + AIniFile.WriteInteger(ASection, 'Index', AItem.Index); + + if AItem is TdxLayoutGroup then + begin + AGroup := TdxLayoutGroup(AItem); + AIniFile.WriteBool(ASection, 'Hidden', AGroup.Hidden); + AIniFile.WriteInteger(ASection, 'LayoutDirection', Integer(AGroup.LayoutDirection)); + if AGroup.IsUserDefined and not AGroup.Hidden then + AIniFile.WriteString(ASection, 'Caption', AItem.Caption); + end; + end; + +begin + DeletePrevSettings; + AItems := CreateItemsList; + try + AIniFile.WriteInteger(ARootSection, 'ItemCount', AItems.Count); + for I := 0 to AItems.Count - 1 do + SaveItem(GetItemSection(I), AItems[I]); + finally + AItems.Free; + end; +end; + +procedure TdxCustomLayoutControl.Clear; +var + I: Integer; + AItem: TdxCustomLayoutItem; +begin + MayPack := False; + BeginUpdate; + try + for I := AbsoluteItemCount - 1 downto 0 do + begin + AItem := AbsoluteItems[I]; + if (AItem is TdxLayoutItem) and (TdxLayoutItem(AItem).Control <> nil) then + TdxLayoutItem(AItem).Control.Free; + end; + + while AbsoluteItemCount <> 0 do + AbsoluteItems[0].Free; + finally + EndUpdate; + MayPack := True; + end; +end; + +function TdxCustomLayoutControl.CreateAlignmentConstraint: TdxLayoutAlignmentConstraint; +begin + Result := GetAlignmentConstraintClass.Create(Owner); + AddAlignmentConstraint(Result); +end; + +function TdxCustomLayoutControl.FindItem(AControl: TControl): TdxLayoutItem; +var + I: Integer; + AItem: TdxCustomLayoutItem; +begin + for I := 0 to AbsoluteItemCount - 1 do + begin + AItem := AbsoluteItems[I]; + if AItem is TdxLayoutItem then + begin + Result := TdxLayoutItem(AItem); + if Result.Control = AControl then Exit; + end; + end; + Result := nil; +end; + +function TdxCustomLayoutControl.FindItem(const AName: string): TdxCustomLayoutItem; +var + I: Integer; +begin + if AName <> '' then + begin + Result := Items; + if SameText(Result.Name, AName) then Exit; + for I := 0 to AbsoluteItemCount - 1 do + begin + Result := AbsoluteItems[I]; + if SameText(Result.Name, AName) then Exit; + end; + end; + Result := nil; +end; + +function TdxCustomLayoutControl.GetHitTest(const P: TPoint): TdxCustomLayoutHitTest; +begin + Result := ViewInfo.GetHitTest(P); +end; + +function TdxCustomLayoutControl.GetHitTest(X, Y: Integer): TdxCustomLayoutHitTest; +begin + Result := ViewInfo.GetHitTest(X, Y); +end; + +procedure TdxCustomLayoutControl.BeginUpdate; +begin + Inc(FUpdateLockCount); + if (FUpdateLockCount = 1) and (FViewInfo <> nil) then + FViewInfo.DestroyViewInfos; +end; + +procedure TdxCustomLayoutControl.EndUpdate; +begin + if FUpdateLockCount <> 0 then + begin + Dec(FUpdateLockCount); + if not IsUpdateLocked then + begin + if FViewInfo <> nil then + FViewInfo.CreateViewInfos; + LookAndFeelChanged; //LayoutChanged; + end; + end; +end; + +function TdxCustomLayoutControl.CreateGroup(AGroupClass: TdxLayoutGroupClass = nil; + AParent: TdxLayoutGroup = nil): TdxLayoutGroup; +begin + if AGroupClass = nil then + AGroupClass := GetDefaultGroupClass; + Result := TdxLayoutGroup(CreateItem(AGroupClass, AParent)); +end; + +function TdxCustomLayoutControl.CreateItem(AItemClass: TdxCustomLayoutItemClass = nil; + AParent: TdxLayoutGroup = nil): TdxCustomLayoutItem; +begin + if AItemClass = nil then + AItemClass := GetDefaultItemClass; + Result := AItemClass.Create(Owner); + AddAvailableItem(Result); + Result.Parent := AParent; + Modified; + if IsDesigning then + dxLayoutDesigner.ItemsChanged(Self); +end; + +function TdxCustomLayoutControl.CreateItemForControl(AControl: TControl; + AParent: TdxLayoutGroup = nil): TdxLayoutItem; +begin + Result := TdxLayoutItem(CreateItem(GetDefaultItemClass, AParent)); + Result.Control := AControl; +end; + +procedure TdxCustomLayoutControl.LoadFromIniFile(const AFileName: string); +var + AIniFile: TMemIniFile; +begin + if AFileName = '' then Exit; + AIniFile := TMemIniFile.Create(AFileName); + try + LoadFromCustomIniFile(AIniFile, Name); + finally + AIniFile.Free; + end; +end; + +procedure TdxCustomLayoutControl.LoadFromRegistry(const ARegistryPath: string); +var + AIniFile: TRegistryIniFile; +begin + if ARegistryPath = '' then Exit; + AIniFile := TRegistryIniFile.Create(ARegistryPath); + try + LoadFromCustomIniFile(AIniFile, ''); + finally + AIniFile.Free; + end; +end; + +procedure TdxCustomLayoutControl.LoadFromStream(AStream: TStream); +var + AIniFile: TMemIniFile; + AStrings: TStringList; +begin + AIniFile := TMemIniFile.Create(''); + AStrings := TStringList.Create; + try + AStrings.LoadFromStream(AStream); + AIniFile.SetStrings(AStrings); + LoadFromCustomIniFile(AIniFile, ''); + finally + AStrings.Free; + AIniFile.Free; + end; +end; + +procedure TdxCustomLayoutControl.SaveToIniFile(const AFileName: string); +var + AIniFile: TMemIniFile; +begin + if AFileName = '' then Exit; + AIniFile := TMemIniFile.Create(AFileName); + try + SaveToCustomIniFile(AIniFile, Name); + AIniFile.UpdateFile; + finally + AIniFile.Free; + end; +end; + +procedure TdxCustomLayoutControl.SaveToRegistry(const ARegistryPath: string); +var + AIniFile: TRegistryIniFile; +begin + if ARegistryPath = '' then Exit; + AIniFile := TRegistryIniFile.Create(ARegistryPath); + try + SaveToCustomIniFile(AIniFile, ''); + finally + AIniFile.Free; + end; +end; + +procedure TdxCustomLayoutControl.SaveToStream(AStream: TStream); +var + AIniFile: TMemIniFile; + AStrings: TStringList; +begin + AIniFile := TMemIniFile.Create(''); + AStrings := TStringList.Create; + try + SaveToCustomIniFile(AIniFile, ''); + AIniFile.GetStrings(AStrings); + AStrings.SaveToStream(AStream); + finally + AStrings.Free; + AIniFile.Free; + end; +end; + +{ THitTests } + +type + THitTests = class + private + FItems: TList; + function GetCount: Integer; + function GetInstance(AClass: TdxCustomLayoutHitTestClass): TdxCustomLayoutHitTest; + function GetItem(Index: Integer): TdxCustomLayoutHitTest; + protected + function GetObjectByClass(AClass: TdxCustomLayoutHitTestClass): TdxCustomLayoutHitTest; + property Count: Integer read GetCount; + property Items[Index: Integer]: TdxCustomLayoutHitTest read GetItem; + public + constructor Create; + destructor Destroy; override; + property Instances[AClass: TdxCustomLayoutHitTestClass]: TdxCustomLayoutHitTest read GetInstance; default; + end; + +var + HitTests: THitTests; + +constructor THitTests.Create; +begin + inherited; + FItems := TList.Create; +end; + +destructor THitTests.Destroy; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].Free; + FItems.Free; + inherited; +end; + +function THitTests.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function THitTests.GetInstance(AClass: TdxCustomLayoutHitTestClass): TdxCustomLayoutHitTest; +begin + Result := GetObjectByClass(AClass); + if Result = nil then + begin + Result := AClass.Create; + FItems.Add(Result); + end; +end; + +function THitTests.GetItem(Index: Integer): TdxCustomLayoutHitTest; +begin + Result := FItems[Index]; +end; + +function THitTests.GetObjectByClass(AClass: TdxCustomLayoutHitTestClass): TdxCustomLayoutHitTest; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I]; + if Result.ClassType = AClass then Exit; + end; + Result := nil; +end; + +{ TdxCustomLayoutHitTest } + +function TdxCustomLayoutHitTest.Cursor: TCursor; +begin + Result := crDefault; +end; + +class function TdxCustomLayoutHitTest.HitTestCode: Integer; +begin + Result := htError; +end; + +class function TdxCustomLayoutHitTest.Instance: TdxCustomLayoutHitTest; +begin + Result := HitTests.Instances[Self]; +end; + +{ TdxLayoutNoneHitTest } + +class function TdxLayoutNoneHitTest.HitTestCode: Integer; +begin + Result := htNone; +end; + +{ TdxLayoutItemHitTest } + +function TdxLayoutItemHitTest.GetItem: TdxLayoutItem; +begin + Result := TdxLayoutItem(inherited Item); +end; + +procedure TdxLayoutItemHitTest.SetItem(Value: TdxLayoutItem); +begin + inherited Item := Value; +end; + +class function TdxLayoutItemHitTest.HitTestCode: Integer; +begin + Result := htItem; +end; + +{ TdxLayoutGroupHitTest } + +function TdxLayoutGroupHitTest.GetItem: TdxLayoutGroup; +begin + Result := TdxLayoutGroup(inherited Item); +end; + +procedure TdxLayoutGroupHitTest.SetItem(Value: TdxLayoutGroup); +begin + inherited Item := Value; +end; + +class function TdxLayoutGroupHitTest.HitTestCode: Integer; +begin + Result := htGroup; +end; + +{ TdxLayoutCustomizeFormHitTest } + +class function TdxLayoutCustomizeFormHitTest.HitTestCode: Integer; +begin + Result := htCustomizeForm; +end; + +{ TdxLayoutClientAreaHitTest } + +class function TdxLayoutClientAreaHitTest.HitTestCode: Integer; +begin + Result := htClientArea; +end; + +{ TdxCustomLayoutControlHandler } + +constructor TdxCustomLayoutControlHandler.Create(AControl: TdxCustomLayoutControl); +begin + inherited Create; + FControl := AControl; +end; + +function TdxCustomLayoutControlHandler.GetViewInfo: TdxLayoutControlViewInfo; +begin + Result := FControl.ViewInfo; +end; + +{ TdxCustomLayoutItemElementPainter } + +constructor TdxCustomLayoutItemElementPainter.Create(ACanvas: TcxCanvas; + AViewInfo: TdxCustomLayoutItemElementViewInfo); +begin + inherited Create; + FCanvas := ACanvas; + FViewInfo := AViewInfo; +end; + +function TdxCustomLayoutItemElementPainter.GetLookAndFeel: TdxCustomLayoutLookAndFeel; +begin + Result := FViewInfo.LookAndFeel; +end; + +{ TdxCustomLayoutItemCaptionPainter } + +function TdxCustomLayoutItemCaptionPainter.GetViewInfo: TdxCustomLayoutItemCaptionViewInfo; +begin + Result := TdxCustomLayoutItemCaptionViewInfo(inherited ViewInfo); +end; + +procedure TdxCustomLayoutItemCaptionPainter.AfterDrawText; +begin +{$IFDEF DELPHI7} + with Canvas do + Brush.Style := bsSolid; +{$ENDIF} +end; + +procedure TdxCustomLayoutItemCaptionPainter.BeforeDrawText; +{$IFDEF DELPHI7} +var + R: TRect; +{$ENDIF} +begin + with Canvas do + begin + {$IFDEF DELPHI7} + if ViewInfo.IsTransparent then + begin + R := ViewInfo.TextAreaBounds; + ThemeServices.DrawParentBackground(ViewInfo.Item.Container.Handle, + Handle, nil, True, @R); + Brush.Style := bsClear; + end + else + Brush.Color := ViewInfo.Color; + {$ELSE} + Brush.Color := ViewInfo.Color; + {$ENDIF} + Font := ViewInfo.Font; + Font.Color := ViewInfo.TextColor; + if ViewInfo.IsTextUnderlined then + Font.Style := Font.Style + [fsUnderline]; + end; +end; + +procedure TdxCustomLayoutItemCaptionPainter.DrawBackground; +begin + if not ViewInfo.IsTransparent then + with Canvas do + begin + Brush.Color := ViewInfo.Color; + FillRect(ViewInfo.Bounds); + end; +end; + +procedure TdxCustomLayoutItemCaptionPainter.DrawText; +begin + with ViewInfo do + Canvas.DrawText(Text, TextAreaBounds, CalculateTextFlags, Enabled); +end; + +procedure TdxCustomLayoutItemCaptionPainter.Paint; +begin + DrawBackground; + if ViewInfo.Text <> '' then + begin + BeforeDrawText; + DrawText; + AfterDrawText; + end; +end; + +{ TdxCustomLayoutItemPainter } + +constructor TdxCustomLayoutItemPainter.Create(ACanvas: TcxCanvas; + AViewInfo: TdxCustomLayoutItemViewInfo); +begin + inherited Create; + FCanvas := ACanvas; + FViewInfo := AViewInfo; +end; + +function TdxCustomLayoutItemPainter.GetLookAndFeel: TdxCustomLayoutLookAndFeel; +begin + Result := FViewInfo.LookAndFeel; +end; + +procedure TdxCustomLayoutItemPainter.DrawCaption; +begin + with GetCaptionPainterClass.Create(Canvas, ViewInfo.CaptionViewInfo) do + try + Paint; + finally + Free; + end; +end; + +procedure TdxCustomLayoutItemPainter.DrawSelection; +begin + with ViewInfo.Item.Container.Painter.GetCustomizationCanvas do + try + Brush.Style := bsClear; + Pen.Color := clHighlight; + Pen.Style := psDot; + with ViewInfo.Bounds do + Polyline([TopLeft, Point(Right - 1, Top), Point(Right - 1, Bottom - 1), + Point(Left, Bottom - 1), TopLeft]); + Pen.Style := psSolid; + Brush.Style := bsSolid; + finally + Free; + end; +end; + +procedure TdxCustomLayoutItemPainter.InternalDrawSelection; +begin + if ViewInfo.Selected and ViewInfo.Item.Container.CanShowSelection then + DrawSelection; +end; + +procedure TdxCustomLayoutItemPainter.DrawSelections; +begin + InternalDrawSelection; +end; + +procedure TdxCustomLayoutItemPainter.Paint; +begin + if ViewInfo.HasCaption then DrawCaption; + InternalDrawSelection; + Canvas.ExcludeClipRect(ViewInfo.Bounds); +end; + +{ TdxLayoutItemControlPainter } + +function TdxLayoutItemControlPainter.GetViewInfo: TdxLayoutItemControlViewInfo; +begin + Result := TdxLayoutItemControlViewInfo(inherited ViewInfo); +end; + +procedure TdxLayoutItemControlPainter.DrawBorders; +var + R: TRect; + + procedure DrawSingleBorder; + begin + Canvas.FrameRect(ViewInfo.Bounds, ViewInfo.BorderColor); + end; + + procedure DrawStandardBorder; + begin + Canvas.DrawEdge(R, True, True); + InflateRect(R, -1, -1); + Canvas.DrawEdge(R, True, False); + end; + + procedure DrawFlatBorder; + begin + Canvas.DrawEdge(R, True, True); + InflateRect(R, -1, -1); + Canvas.FrameRect(R, clBtnFace); + end; + +begin + R := ViewInfo.Bounds; + case ViewInfo.BorderStyle of + lbsSingle: + DrawSingleBorder; + lbsFlat: + DrawFlatBorder; + lbsStandard: + DrawStandardBorder; + end; +end; + +procedure TdxLayoutItemControlPainter.Paint; +begin + if ViewInfo.HasBorder then DrawBorders; +end; + +{ TdxLayoutItemPainter } + +function TdxLayoutItemPainter.GetViewInfo: TdxLayoutItemViewInfo; +begin + Result := TdxLayoutItemViewInfo(inherited ViewInfo); +end; + +function TdxLayoutItemPainter.GetCaptionPainterClass: TdxCustomLayoutItemCaptionPainterClass; +begin + Result := TdxLayoutItemCaptionPainter; +end; + +function TdxLayoutItemPainter.GetControlPainterClass: TdxLayoutItemControlPainterClass; +begin + Result := TdxLayoutItemControlPainter; +end; + +procedure TdxLayoutItemPainter.DrawControl; +begin + with GetControlPainterClass.Create(Canvas, ViewInfo.ControlViewInfo) do + try + Paint; + finally + Free; + end; +end; + +procedure TdxLayoutItemPainter.Paint; +begin + if ViewInfo.HasControl and ViewInfo.ControlViewInfo.OpaqueControl then + Canvas.ExcludeClipRect(ViewInfo.ControlViewInfo.ControlBounds); + if not ViewInfo.IsTransparent then + with Canvas do + begin + Brush.Color := ViewInfo.Color; + FillRect(ViewInfo.Bounds); + end; + if ViewInfo.HasControl then DrawControl; + inherited; +end; + +{ TdxLayoutGroupPainter } + +function TdxLayoutGroupPainter.GetViewInfo: TdxLayoutGroupViewInfo; +begin + Result := TdxLayoutGroupViewInfo(inherited ViewInfo); +end; + +function TdxLayoutGroupPainter.GetCaptionPainterClass: TdxCustomLayoutItemCaptionPainterClass; +begin + Result := TdxLayoutGroupCaptionPainter; +end; + +procedure TdxLayoutGroupPainter.DrawBorders; +var + ASide: TdxLayoutSide; +begin + if not ViewInfo.IsTransparent then + with Canvas do + begin + Brush.Color := ViewInfo.Color; + for ASide := Low(ASide) to High(ASide) do + FillRect(ViewInfo.BorderRestSpaceBounds[ASide]); + end; +end; + +procedure TdxLayoutGroupPainter.DrawBoundsFrame; +var + R: TRect; + ARgn1, ARgn2: HRGN; +begin + Canvas.Pen.Style := psDashDot; + Canvas.Pen.Color := ViewInfo.CaptionViewInfo.TextColor; + Canvas.Brush.Style := bsClear; + with ViewInfo.ClientBounds do + begin + R := ViewInfo.ClientBounds; + ARgn1 := CreateRectRgnIndirect(R); + InflateRect(R, -1, -1); + ARgn2 := CreateRectRgnIndirect(R); + CombineRgn(ARgn1, ARgn1, ARgn2, RGN_DIFF); + DeleteObject(ARgn2); + ExtSelectClipRgn(Canvas.Handle, ARgn1, RGN_OR); + + Canvas.Polyline([Point(Left, Top), Point(Right - 1, Top), + Point(Right - 1, Bottom - 1), Point(Left, Bottom - 1), Point(Left, Top)]); + + ExtSelectClipRgn(Canvas.Handle, ARgn1, RGN_DIFF); + DeleteObject(ARgn1); + end; + Canvas.Brush.Style := bsSolid; +end; + +procedure TdxLayoutGroupPainter.DrawItems; +var + I: Integer; + AItemViewInfo: TdxCustomLayoutItemViewInfo; +begin + for I := 0 to ViewInfo.ItemViewInfoCount - 1 do + begin + AItemViewInfo := ViewInfo.ItemViewInfos[I]; + with AItemViewInfo.GetPainterClass.Create(Canvas, AItemViewInfo) do + try + Paint; + finally + Free; + end; + end; +end; + +procedure TdxLayoutGroupPainter.DrawItemsArea; +begin + if not ViewInfo.IsTransparent then + with Canvas do + begin + Brush.Color := ViewInfo.Color; + FillRect(ViewInfo.ClientBounds); + end; +end; + +procedure TdxLayoutGroupPainter.DrawSelections; +var + I: Integer; + AItemViewInfo: TdxCustomLayoutItemViewInfo; +begin + inherited; + for I := 0 to ViewInfo.ItemViewInfoCount - 1 do + begin + AItemViewInfo := ViewInfo.ItemViewInfos[I]; + with AItemViewInfo.GetPainterClass.Create(Canvas, AItemViewInfo) do + try + DrawSelections; + finally + Free; + end; + end; +end; + +procedure TdxLayoutGroupPainter.Paint; +begin + if ViewInfo.HasBorder then DrawBorders; + DrawItems; + DrawItemsArea; + if ViewInfo.HasBoundsFrame then DrawBoundsFrame; + inherited; +end; + +{ TdxLayoutGroupCaptionStandardPainter } + +procedure TdxLayoutGroupCaptionStandardPainter.DrawText; +{$IFDEF DELPHI7} +const + Enableds: array[Boolean] of Integer = (DTT_GRAYED, 0); +{$ENDIF} +begin +{$IFDEF DELPHI7} + if ThemeServices.ThemesEnabled then + with ViewInfo do + ThemeServices.DrawText(Canvas.Handle, ThemeServices.GetElementDetails(tbGroupBoxNormal), + Text, TextAreaBounds, cxFlagsToDTFlags(CalculateTextFlags), Enableds[Enabled]) + else + inherited; +{$ELSE} + inherited; +{$ENDIF} +end; + +{ TdxLayoutGroupStandardPainter } + +function TdxLayoutGroupStandardPainter.GetViewInfo: TdxLayoutGroupStandardViewInfo; +begin + Result := TdxLayoutGroupStandardViewInfo(inherited ViewInfo); +end; + +function TdxLayoutGroupStandardPainter.GetCaptionPainterClass: TdxCustomLayoutItemCaptionPainterClass; +begin + Result := TdxLayoutGroupCaptionStandardPainter; +end; + +procedure TdxLayoutGroupStandardPainter.DrawBorders; +begin + inherited; + DrawFrame; +end; + +procedure TdxLayoutGroupStandardPainter.DrawFrame; +var + R: TRect; +begin +{$IFDEF DELPHI7} + if ThemeServices.ThemesEnabled then + begin + ThemeServices.DrawElement(Canvas.Handle, ThemeServices.GetElementDetails(tbGroupBoxNormal), + ViewInfo.FrameBounds); + Exit; + end; +{$ENDIF} + R := ViewInfo.FrameBounds; + with Canvas do + begin + DrawEdge(R, True, True); + InflateRect(R, -1, -1); + DrawEdge(R, False, False); + end; +end; + +{ TdxLayoutGroupOfficePainter } + +function TdxLayoutGroupOfficePainter.GetCaptionPainterClass: TdxCustomLayoutItemCaptionPainterClass; +begin + Result := TdxLayoutGroupCaptionPainter; +end; + +procedure TdxLayoutGroupOfficePainter.DrawFrame; +var + R: TRect; +begin + R := ViewInfo.FrameBounds; + with Canvas do + begin + DrawEdge(R, True, True, [bTop]); + Inc(R.Top); + DrawEdge(R, False, False, [bTop]); + end; +end; + +{ TdxLayoutGroupWebPainter } + +function TdxLayoutGroupWebPainter.GetLookAndFeel: TdxLayoutWebLookAndFeel; +begin + Result := TdxLayoutWebLookAndFeel(inherited LookAndFeel); +end; + +function TdxLayoutGroupWebPainter.GetViewInfo: TdxLayoutGroupWebViewInfo; +begin + Result := TdxLayoutGroupWebViewInfo(inherited ViewInfo); +end; + +procedure TdxLayoutGroupWebPainter.DrawBorders; +begin + DrawFrame; + DrawCaptionSeparator; + inherited; +end; + +procedure TdxLayoutGroupWebPainter.DrawCaptionSeparator; +begin + with Canvas do + begin + Brush.Color := ViewInfo.Color; + FillRect(ViewInfo.CaptionSeparatorAreaBounds); + Brush.Color := ViewInfo.Options.GetFrameColor; + FillRect(ViewInfo.CaptionSeparatorBounds); + end; +end; + +procedure TdxLayoutGroupWebPainter.DrawFrame; +var + R: TRect; + I: Integer; +begin + R := ViewInfo.Bounds; + for I := 1 to ViewInfo.Options.FrameWidth do + begin + Canvas.FrameRect(R, ViewInfo.Options.GetFrameColor); + InflateRect(R, -1, -1); + end; +end; + +{ TdxLayoutControlPainter } + +function TdxLayoutControlPainter.GetInternalCanvas: TcxCanvas; +begin + Result := FControl.Canvas; +end; + +procedure TdxLayoutControlPainter.MakeCanvasClipped(ACanvas: TcxCanvas); +begin + ACanvas.IntersectClipRect(ViewInfo.ClientBounds); +end; + +procedure TdxLayoutControlPainter.DrawEmptyArea; +var + AContentR, AClientR: TRect; +begin + if not ViewInfo.IsTransparent then + with Canvas do + begin + Brush.Color := ViewInfo.LookAndFeel.GetEmptyAreaColor; + AContentR := ViewInfo.ContentBounds; + AClientR := ViewInfo.ClientBounds; + FillRect(Rect(AContentR.Right, AClientR.Top, AClientR.Right, AClientR.Bottom)); + FillRect(Rect(AClientR.Left, AContentR.Bottom, AContentR.Right, AClientR.Bottom)); + end; +end; + +procedure TdxLayoutControlPainter.DrawItems; +var + AItemsViewInfo: TdxLayoutGroupViewInfo; +begin + AItemsViewInfo := ViewInfo.ItemsViewInfo; + with AItemsViewInfo.GetPainterClass.Create(Canvas, AItemsViewInfo) do + try + Paint; + finally + Free; + end; +end; + +procedure TdxLayoutControlPainter.PlaceControls; +var + AControlViewInfos, AWinControlViewInfos: TList; + + procedure RetrieveControlViewInfos(AItemViewInfo: TdxCustomLayoutItemViewInfo); + var + I: Integer; + AControlViewInfo: TdxLayoutItemControlViewInfo; + begin + if AItemViewInfo is TdxLayoutGroupViewInfo then + with TdxLayoutGroupViewInfo(AItemViewInfo) do + for I := 0 to ItemViewInfoCount - 1 do + RetrieveControlViewInfos(ItemViewInfos[I]) + else + begin + AControlViewInfo := TdxLayoutItemViewInfo(AItemViewInfo).ControlViewInfo; + if AControlViewInfo.Control <> nil then + if AControlViewInfo.Control is TWinControl then + AWinControlViewInfos.Add(AControlViewInfo) + else + AControlViewInfos.Add(AControlViewInfo); + end; + end; + + procedure ProcessControls; + var + I: Integer; + begin + for I := 0 to AControlViewInfos.Count - 1 do + with TdxLayoutItemControlViewInfo(AControlViewInfos[I]) do + begin + Control.BoundsRect := ControlBounds; + //ValidateRect(Self.Control.Handle, @ControlBounds); + end; + end; + + procedure ProcessWinControls; + var + AWindowsStruct: HDWP; + I: Integer; + begin + AWindowsStruct := BeginDeferWindowPos(AWinControlViewInfos.Count); + try + for I := 0 to AWinControlViewInfos.Count - 1 do + with TdxLayoutItemControlViewInfo(AWinControlViewInfos[I]), ControlBounds do + DeferWindowPos(AWindowsStruct, (Control as TWinControl).Handle, 0, + Left, Top, Right - Left, Bottom - Top, SWP_NOZORDER or SWP_NOACTIVATE); + finally + EndDeferWindowPos(AWindowsStruct); + end; + end; + + function CheckControlSizes(AControlViewInfos: TList): Boolean; + var + I: Integer; + begin + Result := True; + for I := 0 to AControlViewInfos.Count - 1 do + with TdxLayoutItemControlViewInfo(AControlViewInfos[I]) do + begin + Result := + ((ItemViewInfo.AlignHorz = ahClient) or + (Control.Width = ControlBounds.Right - ControlBounds.Left)) and + ((ItemViewInfo.AlignVert = avClient) or + (Control.Height = ControlBounds.Bottom - ControlBounds.Top)); + if not Result then + begin + Item.SaveOriginalControlSize; + Break; + end; + end; + end; + +begin + AControlViewInfos := TList.Create; + AWinControlViewInfos := TList.Create; + try + Control.FIsPlacingControls := True; + try + RetrieveControlViewInfos(ViewInfo.ItemsViewInfo); + ProcessControls; + ProcessWinControls; + finally + Control.FIsPlacingControls := False; + end; + if not CheckControlSizes(AControlViewInfos) or + not CheckControlSizes(AWinControlViewInfos) then + Control.LayoutChanged; + finally + AWinControlViewInfos.Free; + AControlViewInfos.Free; + end; +end; + +function TdxLayoutControlPainter.GetCanvas: TcxCanvas; +begin + Result := InternalCanvas; + MakeCanvasClipped(Result); +end; + +function TdxLayoutControlPainter.GetCustomizationCanvas: TcxCanvas; +begin + Result := TcxCustomizationCanvas.Create(Control); + MakeCanvasClipped(Result); +end; + +procedure TdxLayoutControlPainter.DrawSelections; +var + AItemsViewInfo: TdxLayoutGroupViewInfo; +begin + if Control.IsUpdateLocked then Exit; + AItemsViewInfo := ViewInfo.ItemsViewInfo; + with AItemsViewInfo.GetPainterClass.Create(Canvas, AItemsViewInfo) do + try + DrawSelections; + finally + Free; + end; +end; + +procedure TdxLayoutControlPainter.Paint; +var + APrevClipRegion: TcxRegion; +begin + FCanvas := GetCanvas; + APrevClipRegion := FCanvas.GetClipRegion; + { moved to TdxLayoutControlViewInfo.Calculate }//PlaceControls; // because of selection drawing + DrawItems; + DrawEmptyArea; +// PlaceControls; + FCanvas.SetClipRegion(APrevClipRegion, roSet); +end; + +{ TdxCustomLayoutItemElementViewInfo } + +constructor TdxCustomLayoutItemElementViewInfo.Create(AItemViewInfo: TdxCustomLayoutItemViewInfo); +begin + inherited Create; + FItemViewInfo := AItemViewInfo; +end; + +function TdxCustomLayoutItemElementViewInfo.GetHeight: Integer; +begin + Result := FHeight; + if Result = 0 then + begin + Result := Bounds.Bottom - Bounds.Top; + if Result = 0 then + Result := CalculateHeight; + end; +end; + +function TdxCustomLayoutItemElementViewInfo.GetItem: TdxCustomLayoutItem; +begin + Result := FItemViewInfo.Item; +end; + +function TdxCustomLayoutItemElementViewInfo.GetLookAndFeel: TdxCustomLayoutLookAndFeel; +begin + Result := FItemViewInfo.LookAndFeel; +end; + +function TdxCustomLayoutItemElementViewInfo.GetWidth: Integer; +begin + Result := FWidth; + if Result = 0 then + begin + Result := Bounds.Right - Bounds.Left; + if Result = 0 then + Result := CalculateWidth; + end; +end; + +procedure TdxCustomLayoutItemElementViewInfo.SetHeight(Value: Integer); +begin + FHeight := Value; +end; + +procedure TdxCustomLayoutItemElementViewInfo.SetWidth(Value: Integer); +begin + FWidth := Value; +end; + +function TdxCustomLayoutItemElementViewInfo.GetEnabled: Boolean; +begin + Result := FItemViewInfo.Enabled; +end; + +function TdxCustomLayoutItemElementViewInfo.GetEnabledForWork: Boolean; +begin + Result := FItemViewInfo.EnabledForWork; +end; + +function TdxCustomLayoutItemElementViewInfo.GetCursor(X, Y: Integer): TCursor; +begin + Result := crDefault; +end; + +function TdxCustomLayoutItemElementViewInfo.GetVisible: Boolean; +begin + Result := False; +end; + +procedure TdxCustomLayoutItemElementViewInfo.Invalidate(const ABounds: TRect); +begin + Item.Container.InvalidateRect(ABounds, False); +end; + +procedure TdxCustomLayoutItemElementViewInfo.MouseEnter; +begin +end; + +procedure TdxCustomLayoutItemElementViewInfo.MouseLeave; +begin + Pressed := False; +end; + +procedure TdxCustomLayoutItemElementViewInfo.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + Pressed := True; +end; + +procedure TdxCustomLayoutItemElementViewInfo.MouseMove(Shift: TShiftState; + X, Y: Integer); +begin +end; + +procedure TdxCustomLayoutItemElementViewInfo.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + Pressed := False; +end; + +function TdxCustomLayoutItemElementViewInfo.WantsMouse(X, Y: Integer): Boolean; +begin + Result := Visible and PtInRect(Bounds, Point(X, Y)); +end; + +procedure TdxCustomLayoutItemElementViewInfo.Calculate(const ABounds: TRect); +begin + Bounds := ABounds; +end; + +{ TdxCustomLayoutItemCaptionViewInfo } + +function TdxCustomLayoutItemCaptionViewInfo.GetCanvas: TcxCanvas; +begin + Result := ItemViewInfo.ContainerViewInfo.Canvas; +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetIsCustomization: Boolean; +begin + Result := FItemViewInfo.IsCustomization; +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetTextHeight: Integer; +var + R: TRect; +begin + if Item.CachedTextHeight = 0 then + begin + PrepareCanvas; + if MultiLine then + begin + R := Rect(0, 0, CalculateWidth - 1 {for disabling}, 0); + Canvas.TextExtent(Text, R, CalculateTextFlags); + Result := R.Bottom - R.Top; + end + else + Result := Canvas.TextHeight(Text); + Item.CachedTextHeight := Result; + end + else + Result := Item.CachedTextHeight; + if Text <> '' then Inc(Result); // for disabling +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetTextWidth: Integer; +var + AText: string; +begin + AText := VisibleText; + PrepareCanvas; + Result := Canvas.TextWidth(AText); + if AText <> '' then Inc(Result); // for disabling +end; + +procedure TdxCustomLayoutItemCaptionViewInfo.SetHotTracked(Value: Boolean); +begin + if FHotTracked <> Value then + begin + FHotTracked := Value; + Invalidate(HotTrackBounds); + end; +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetCursor(X, Y: Integer): TCursor; +begin + if HotTracked and (htsHandPoint in HotTrackStyles) then + Result := crcxHandPoint + else + Result := inherited GetCursor(X, Y); +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetVisible: Boolean; +begin + Result := ItemViewInfo.HasCaption; +end; + +procedure TdxCustomLayoutItemCaptionViewInfo.MouseLeave; +begin + inherited; + HotTracked := False; +end; + +procedure TdxCustomLayoutItemCaptionViewInfo.MouseMove(Shift: TShiftState; + X, Y: Integer); +begin + inherited; + if IsHotTrackable then + HotTracked := IsPointInHotTrackBounds(Point(X, Y)); +end; + +procedure TdxCustomLayoutItemCaptionViewInfo.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +var + APressed: Boolean; +begin + APressed := Pressed; + inherited; + if CanDoCaptionClick(X, Y) and APressed then + Item.DoCaptionClick; +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetColor: TColor; +begin + Result := ItemViewInfo.Color; +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetFont: TFont; +begin + Result := Options.GetFont(Item.Container); +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetHotTrackBounds: TRect; +begin + Result := TextAreaBounds; +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetHotTrackStyles: TdxLayoutHotTrackStyles; +begin + Result := Options.HotTrackStyles; +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetIsDefaultColor: Boolean; +begin + Result := ItemViewInfo.IsDefaultColor; +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetIsHotTrackable: Boolean; +begin + Result := not IsCustomization and EnabledForWork and Options.HotTrack; +end; + +function TdxCustomLayoutItemCaptionViewInfo.CalculateTextFlags: Integer; +const + MultiLines: array[Boolean] of Integer = (cxSingleLine, cxWordBreak); + AlignsVert: array[TdxAlignmentVert] of Integer = + (cxAlignTop, cxAlignVCenter, cxAlignBottom); +begin + Result := MultiLines[MultiLine] or cxAlignmentsHorz[AlignHorz] or AlignsVert[AlignVert]; + if Item.CaptionOptions.ShowAccelChar then + Inc(Result, cxShowPrefix); +end; + +function TdxCustomLayoutItemCaptionViewInfo.CanDoCaptionClick(X, Y: Integer): Boolean; +begin + Result := EnabledForWork and IsPointInHotTrackBounds(Point(X, Y)); +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetAlignHorz: TAlignment; +begin + Result := Item.CaptionOptions.AlignHorz; +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetIsTextUnderlined: Boolean; +begin + Result := + IsHotTrackable and not HotTracked and (htsUnderlineCold in HotTrackStyles) or + HotTracked and (htsUnderlineHot in HotTrackStyles); +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetIsTransparent: Boolean; +begin + Result := ItemViewInfo.ContainerViewInfo.HasBackground and IsDefaultColor; +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetOptions: TdxLayoutLookAndFeelCaptionOptions; +begin + Result := ItemViewInfo.Options.CaptionOptions; +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetText: string; +begin + Result := Item.Caption; +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetTextAreaBounds: TRect; +begin + Result := Bounds; + if Enabled and (Text <> '') then + with Result do + begin + Dec(Right); + Dec(Bottom); + end; +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetTextColor: TColor; +begin + if HotTracked then + Result := GetTextHotColor + else + Result := GetTextNormalColor; +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetTextHotColor: TColor; +begin + Result := Options.GetTextHotColor; +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetTextNormalColor: TColor; +begin + Result := Options.GetTextColor; +end; + +function TdxCustomLayoutItemCaptionViewInfo.GetVisibleText: string; +begin + Result := Text; + if Item.CaptionOptions.ShowAccelChar then + Result := StripHotKey(Result); +end; + +function TdxCustomLayoutItemCaptionViewInfo.IsPointInHotTrackBounds(const P: TPoint): Boolean; +var + ABounds: TRectArray; + I: Integer; +begin + Result := False; + PrepareCanvas; + Canvas.GetTextStringsBounds(Text, TextAreaBounds, + CalculateTextFlags, Enabled, ABounds); + try + for I := 0 to High(ABounds) do + begin + Result := PtInRect(ABounds[I], P); + if Result then Break; + end; + finally + ABounds := nil; + end; +end; + +procedure TdxCustomLayoutItemCaptionViewInfo.PrepareCanvas; +begin + Canvas.Font := Font; +end; + +function TdxCustomLayoutItemCaptionViewInfo.CalculateHeight: Integer; +begin + if Visible then + Result := TextHeight + else + Result := 0; +end; + +function TdxCustomLayoutItemCaptionViewInfo.CalculateWidth: Integer; +begin + if Visible then + Result := TextWidth + else + Result := 0; +end; + +{ TdxCustomLayoutItemViewInfo } + +constructor TdxCustomLayoutItemViewInfo.Create(AContainerViewInfo: TdxLayoutControlViewInfo; + AParentViewInfo: TdxLayoutGroupViewInfo; AItem: TdxCustomLayoutItem); +begin + inherited Create; + FContainerViewInfo := AContainerViewInfo; + FParentViewInfo := AParentViewInfo; + FItem := AItem; + FItem.FViewInfo := Self; + CreateViewInfos; +end; + +destructor TdxCustomLayoutItemViewInfo.Destroy; +begin + DestroyViewInfos; + FItem.FViewInfo := nil; + inherited; +end; + +function TdxCustomLayoutItemViewInfo.GetAlignHorz: TdxLayoutAlignHorz; +begin + Result := Item.AlignHorz; +end; + +function TdxCustomLayoutItemViewInfo.GetAlignVert: TdxLayoutAlignVert; +begin + Result := Item.AlignVert; +end; + +function TdxCustomLayoutItemViewInfo.GetIsCustomization: Boolean; +begin + Result := FItem.Container.IsCustomization; +end; + +function TdxCustomLayoutItemViewInfo.GetIsParentLocked: Boolean; +begin + Result := (ParentViewInfo <> nil) and ParentViewInfo.IsLocked; +end; + +function TdxCustomLayoutItemViewInfo.GetLookAndFeel: TdxCustomLayoutLookAndFeel; +begin + Result := Item.GetLookAndFeel; +end; + +function TdxCustomLayoutItemViewInfo.GetMinHeight: Integer; +begin + if AlignVert = avClient then + Result := CalculateMinHeight + else + Result := CalculateHeight; +end; + +function TdxCustomLayoutItemViewInfo.GetMinWidth: Integer; +begin + if AlignHorz = ahClient then + Result := CalculateMinWidth + else + Result := CalculateWidth; +end; + +function TdxCustomLayoutItemViewInfo.GetOffset(ASide: TdxLayoutSide): Integer; +begin + Result := FOffsets[ASide]; + if Result = 0 then + Result := CalculateOffset(ASide); +end; + +function TdxCustomLayoutItemViewInfo.GetOffsetsHeight: Integer; +begin + Result := Offsets[sdTop] + Offsets[sdBottom]; +end; + +function TdxCustomLayoutItemViewInfo.GetOffsetsWidth: Integer; +begin + Result := Offsets[sdLeft] + Offsets[sdRight]; +end; + +function TdxCustomLayoutItemViewInfo.GetSelected: Boolean; +begin + Result := Item.IsDesigning and + dxLayoutDesigner.IsComponentSelected(Item.Container, Item); +end; + +procedure TdxCustomLayoutItemViewInfo.SetElementWithMouse(Value: TdxCustomLayoutItemElementViewInfo); +begin + if FElementWithMouse <> Value then + begin + if FElementWithMouse <> nil then + FElementWithMouse.MouseLeave; + FElementWithMouse := Value; + if FElementWithMouse <> nil then + FElementWithMouse.MouseEnter; + end; +end; + +procedure TdxCustomLayoutItemViewInfo.SetOffset(ASide: TdxLayoutSide; Value: Integer); +begin + FOffsets[ASide] := Value; +end; + +procedure TdxCustomLayoutItemViewInfo.CreateViewInfos; +begin + FCaptionViewInfo := GetCaptionViewInfoClass.Create(Self); +end; + +procedure TdxCustomLayoutItemViewInfo.DestroyViewInfos; +begin + FreeAndNil(FCaptionViewInfo); +end; + +function TdxCustomLayoutItemViewInfo.CalculateMinHeight: Integer; +begin + Result := DoCalculateHeight(True); +end; + +function TdxCustomLayoutItemViewInfo.CalculateMinWidth: Integer; +begin + Result := DoCalculateWidth(True); +end; + +function TdxCustomLayoutItemViewInfo.CalculateOffset(ASide: TdxLayoutSide): Integer; +begin + case ASide of + sdLeft: + Result := Item.Offsets.Left; + sdRight: + Result := Item.Offsets.Right; + sdTop: + Result := Item.Offsets.Top; + sdBottom: + Result := Item.Offsets.Bottom; + else + Result := 0; + end; +end; + +function TdxCustomLayoutItemViewInfo.DoCalculateHeight(AIsMinHeight: Boolean = False): Integer; +begin + Result := OffsetsHeight; +end; + +function TdxCustomLayoutItemViewInfo.DoCalculateWidth(AIsMinWidth: Boolean = False): Integer; +begin + Result := OffsetsWidth; +end; + +function TdxCustomLayoutItemViewInfo.GetCursor(X, Y: Integer): TCursor; +var + I: Integer; +begin + for I := 0 to ElementCount - 1 do + if Elements[I].WantsMouse(X, Y) then + begin + Result := Elements[I].GetCursor(X, Y); + Exit; + end; + Result := crDefault; +end; + +function TdxCustomLayoutItemViewInfo.GetElement(Index: Integer): TdxCustomLayoutItemElementViewInfo; +begin + if Index = 0 then + Result := CaptionViewInfo + else + Result := nil; +end; + +function TdxCustomLayoutItemViewInfo.GetElementCount: Integer; +begin + Result := 1; +end; + +function TdxCustomLayoutItemViewInfo.GetEnabled: Boolean; +begin + Result := Item.Enabled; +end; + +function TdxCustomLayoutItemViewInfo.GetEnabledForWork: Boolean; +begin + Result := Item.EnabledForWork; +end; + +function TdxCustomLayoutItemViewInfo.GetIsTransparent: Boolean; +begin + Result := ContainerViewInfo.HasBackground and IsDefaultColor; +end; + +function TdxCustomLayoutItemViewInfo.GetSelectionAreaBounds(Index: Integer): TRect; +const + SelectionSize = 2;//1; +begin + with Bounds do + case Index of + 0: Result := Rect(Left, Top, Left + SelectionSize, Bottom); + 1: Result := Rect(Left, Top, Right, Top + SelectionSize); + 2: Result := Rect(Right - SelectionSize, Top, Right, Bottom); + 3: Result := Rect(Left, Bottom - SelectionSize, Right, Bottom); + end; +end; + +function TdxCustomLayoutItemViewInfo.GetSelectionAreaCount: Integer; +begin + Result := 4; +end; + +function TdxCustomLayoutItemViewInfo.HasCaption: Boolean; +begin + Result := Item.HasCaption; +end; + +procedure TdxCustomLayoutItemViewInfo.MouseEnter; +begin +end; + +procedure TdxCustomLayoutItemViewInfo.MouseLeave; +begin + ElementWithMouse := nil; +end; + +procedure TdxCustomLayoutItemViewInfo.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + if ElementWithMouse <> nil then + ElementWithMouse.MouseDown(Button, Shift, X, Y); +end; + +procedure TdxCustomLayoutItemViewInfo.MouseMove(Shift: TShiftState; X, Y: Integer); +var + I: Integer; +begin + for I := 0 to ElementCount - 1 do + if Elements[I].WantsMouse(X, Y) then + begin + ElementWithMouse := Elements[I]; + Elements[I].MouseMove(Shift, X, Y); + Exit; + end; + ElementWithMouse := nil; +end; + +procedure TdxCustomLayoutItemViewInfo.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + if ElementWithMouse <> nil then + ElementWithMouse.MouseUp(Button, Shift, X, Y); +end; + +procedure TdxCustomLayoutItemViewInfo.Calculate(const ABounds: TRect); +begin + Bounds := ABounds; + Inc(Bounds.Left, Offsets[sdLeft]); + Inc(Bounds.Top, Offsets[sdTop]); + Dec(Bounds.Right, Offsets[sdRight]); + Dec(Bounds.Bottom, Offsets[sdBottom]); +end; + +function TdxCustomLayoutItemViewInfo.CalculateHeight: Integer; +begin + Result := DoCalculateHeight; +end; + +function TdxCustomLayoutItemViewInfo.CalculateWidth: Integer; +begin + Result := DoCalculateWidth; +end; + +function TdxCustomLayoutItemViewInfo.GetHitTest(const P: TPoint): TdxCustomLayoutHitTest; +begin + if not IsParentLocked and PtInRect(Bounds, P) then + begin + Result := GetHitTestClass.Instance; + TdxCustomLayoutItemHitTest(Result).Item := Item; + end + else + Result := nil; +end; + +procedure TdxCustomLayoutItemViewInfo.ResetOffset(ASide: TdxLayoutSide); +begin + FOffsets[ASide] := 0; +end; + +{ TdxLayoutItemCaptionViewInfo } + +function TdxLayoutItemCaptionViewInfo.GetItem: TdxLayoutItem; +begin + Result := TdxLayoutItem(inherited GetItem); +end; + +function TdxLayoutItemCaptionViewInfo.GetItemViewInfo: TdxLayoutItemViewInfo; +begin + Result := TdxLayoutItemViewInfo(inherited ItemViewInfo); +end; + +function TdxLayoutItemCaptionViewInfo.GetAlignVert: TdxAlignmentVert; +begin + Result := Item.CaptionOptions.AlignVert; +end; + +function TdxLayoutItemCaptionViewInfo.GetIsFixedWidth: Boolean; +begin + Result := Item.CaptionOptions.Width <> 0; +end; + +function TdxLayoutItemCaptionViewInfo.GetMinWidth: Integer; +begin + if FWidth = 0 then + Result := CalculateWidth + else + Result := Width; +end; + +function TdxLayoutItemCaptionViewInfo.GetMultiLine: Boolean; +begin + Result := IsFixedWidth; +end; + +function TdxLayoutItemCaptionViewInfo.GetTextAreaBounds: TRect; +var + ADelta: Integer; +begin + Result := inherited GetTextAreaBounds; + if IsFixedWidth then + with Result do + begin + ADelta := Width - CalculateWidth; + case AlignHorz of + taLeftJustify: + Dec(Right, ADelta); + taRightJustify: + Inc(Left, ADelta); + taCenter: + begin + Inc(Left, ADelta div 2); + Dec(Right, ADelta - ADelta div 2); + end; + end; + end; +end; + +function TdxLayoutItemCaptionViewInfo.CalculateWidth: Integer; +begin + if Visible and IsFixedWidth then + Result := Item.CaptionOptions.Width + else + Result := inherited CalculateWidth; +end; + +{ TdxLayoutItemControlViewInfo } + +function TdxLayoutItemControlViewInfo.GetBorderColor: TColor; +begin + Result := ItemViewInfo.Options.GetControlBorderColor; +end; + +function TdxLayoutItemControlViewInfo.GetBorderStyle: TdxLayoutBorderStyle; +begin + Result := ItemViewInfo.Options.ControlBorderStyle; +end; + +function TdxLayoutItemControlViewInfo.GetControl: TControl; +begin + Result := Item.Control; +end; + +function TdxLayoutItemControlViewInfo.GetHasBorder: Boolean; +begin + Result := Item.ControlOptions.ShowBorder; +end; + +function TdxLayoutItemControlViewInfo.GetItem: TdxLayoutItem; +begin + Result := TdxLayoutItem(inherited Item); +end; + +function TdxLayoutItemControlViewInfo.GetItemViewInfo: TdxLayoutItemViewInfo; +begin + Result := TdxLayoutItemViewInfo(inherited ItemViewInfo); +end; + +function TdxLayoutItemControlViewInfo.GetOpaqueControl: Boolean; +begin + Result := Item.ControlOptions.Opaque; +end; + +function TdxLayoutItemControlViewInfo.GetVisible: Boolean; +begin + Result := ItemViewInfo.HasControl; +end; + +function TdxLayoutItemControlViewInfo.CalculateControlBounds: TRect; +begin + Result := Bounds; + Inc(Result.Left, BorderWidths[sdLeft]); + Dec(Result.Right, BorderWidths[sdRight]); + Inc(Result.Top, BorderWidths[sdTop]); + Dec(Result.Bottom, BorderWidths[sdBottom]); +end; + +function TdxLayoutItemControlViewInfo.GetBorderWidth(ASide: TdxLayoutSide): Integer; +begin + if HasBorder then + Result := LookAndFeel.ItemControlBorderWidths[ASide] + else + Result := 0 +end; + +function TdxLayoutItemControlViewInfo.GetHeight(AControlHeight: Integer): Integer; +begin + Result := BorderWidths[sdTop] + AControlHeight + BorderWidths[sdBottom]; +end; + +function TdxLayoutItemControlViewInfo.GetWidth(AControlWidth: Integer): Integer; +begin + Result := BorderWidths[sdLeft] + AControlWidth + BorderWidths[sdRight]; +end; + +procedure TdxLayoutItemControlViewInfo.Calculate(const ABounds: TRect); +begin + inherited; + FControlBounds := CalculateControlBounds; +end; + +function TdxLayoutItemControlViewInfo.CalculateHeight: Integer; +begin + if Visible then + Result := GetHeight(Item.OriginalControlSize.Y) + else + Result := 0; +end; + +function TdxLayoutItemControlViewInfo.CalculateWidth: Integer; +begin + if Visible then + Result := GetWidth(Item.OriginalControlSize.X) + else + Result := 0; +end; + +function TdxLayoutItemControlViewInfo.CalculateMinHeight: Integer; +begin + if Item.ControlOptions.FixedSize then + Result := CalculateHeight + else + if Visible then + Result := GetHeight(Item.ControlOptions.MinHeight) + else + Result := 0; +end; + +function TdxLayoutItemControlViewInfo.CalculateMinWidth: Integer; +begin + if Item.ControlOptions.FixedSize then + Result := CalculateWidth + else + if Visible then + Result := GetWidth(Item.ControlOptions.MinWidth) + else + Result := 0; +end; + +procedure TdxLayoutItemControlViewInfo.CalculateTabOrder(var AAvailTabOrder: Integer); +begin + if Item.HasWinControl then + begin + TWinControl(Control).TabOrder := AAvailTabOrder; + Inc(AAvailTabOrder); + end; +end; + +{ TdxLayoutItemViewInfo } + +function TdxLayoutItemViewInfo.GetCaptionViewInfo: TdxLayoutItemCaptionViewInfo; +begin + Result := TdxLayoutItemCaptionViewInfo(inherited CaptionViewInfo); +end; + +function TdxLayoutItemViewInfo.GetItem: TdxLayoutItem; +begin + Result := TdxLayoutItem(inherited Item); +end; + +function TdxLayoutItemViewInfo.GetOptionsEx: TdxLayoutLookAndFeelItemOptions; +begin + Result := TdxLayoutLookAndFeelItemOptions(inherited Options); +end; + +procedure TdxLayoutItemViewInfo.CreateViewInfos; +begin + inherited; + FControlViewInfo := GetControlViewInfoClass.Create(Self); +end; + +procedure TdxLayoutItemViewInfo.DestroyViewInfos; +begin + FreeAndNil(FControlViewInfo); + inherited; +end; + +function TdxLayoutItemViewInfo.GetCaptionViewInfoClass: TdxCustomLayoutItemCaptionViewInfoClass; +begin + Result := TdxLayoutItemCaptionViewInfo; +end; + +function TdxLayoutItemViewInfo.GetControlViewInfoClass: TdxLayoutItemControlViewInfoClass; +begin + Result := TdxLayoutItemControlViewInfo; +end; + +function TdxLayoutItemViewInfo.GetHitTestClass: TdxCustomLayoutItemHitTestClass; +begin + Result := TdxLayoutItemHitTest; +end; + +function TdxLayoutItemViewInfo.GetPainterClass: TdxCustomLayoutItemPainterClass; +begin + Result := TdxCustomLayoutItemPainterClass(LookAndFeel.GetItemPainterClass); +end; + +procedure TdxLayoutItemViewInfo.CalculateViewInfosBounds(var ACaptionBounds, + AControlBounds: TRect); +var + ACaptionSize, AControlSize: TPoint; + ACaptionVisible, AControlVisible: Boolean; + + procedure CalculateElementViewInfoSize(AElementViewInfo: TdxCustomLayoutItemElementViewInfo; + var ASize: TPoint; var AVisible: Boolean); + begin + AVisible := AElementViewInfo.Visible; + with ASize do + if AVisible then + begin + X := AElementViewInfo.Width; + Y := AElementViewInfo.Height; + end + else + begin + X := 0; + Y := 0; + end; + AVisible := AVisible and ((ASize.X <> 0) or (ASize.Y <> 0)); + //AVisible := AVisible and (ASize.X <> 0) and (ASize.Y <> 0); + end; + + procedure CalculateMainBounds; + + procedure InitBounds(var ABounds: TRect; const ASize: TPoint; AVisible: Boolean); + begin + if AVisible then + ABounds := ContentBounds + else + SetRectEmpty(ABounds); + end; + + procedure CalculateWithFixedControl; + begin + case CaptionLayout of + clLeft: + begin + AControlBounds.Left := AControlBounds.Right - AControlSize.X; + ACaptionBounds.Right := AControlBounds.Left - ControlOffsetHorz; + end; + clTop: + begin + AControlBounds.Top := AControlBounds.Bottom - AControlSize.Y; + ACaptionBounds.Bottom := AControlBounds.Top - ControlOffsetVert; + end; + clRight: + begin + AControlBounds.Right := AControlBounds.Left + AControlSize.X; + ACaptionBounds.Left := AControlBounds.Right + ControlOffsetHorz; + end; + clBottom: + begin + AControlBounds.Bottom := AControlBounds.Top + AControlSize.Y; + ACaptionBounds.Top := AControlBounds.Bottom + ControlOffsetVert; + end; + end + end; + + procedure CalculateWithFixedCaption; + begin + case CaptionLayout of + clLeft: + begin + ACaptionBounds.Right := ACaptionBounds.Left + ACaptionSize.X; + AControlBounds.Left := ACaptionBounds.Right + ControlOffsetHorz; + end; + clTop: + begin + ACaptionBounds.Bottom := ACaptionBounds.Top + ACaptionSize.Y; + AControlBounds.Top := ACaptionBounds.Bottom + ControlOffsetVert; + end; + clRight: + begin + ACaptionBounds.Left := ACaptionBounds.Right - ACaptionSize.X; + AControlBounds.Right := ACaptionBounds.Left - ControlOffsetHorz; + end; + clBottom: + begin + ACaptionBounds.Top := ACaptionBounds.Bottom - ACaptionSize.Y; + AControlBounds.Bottom := ACaptionBounds.Top - ControlOffsetVert; + end; + end; + end; + + begin + InitBounds(ACaptionBounds, ACaptionSize, ACaptionVisible); + InitBounds(AControlBounds, AControlSize, AControlVisible); + if ACaptionVisible and AControlVisible then + if Item.ControlOptions.FixedSize then + CalculateWithFixedControl + else + CalculateWithFixedCaption + else + if AControlVisible and Item.ControlOptions.FixedSize then + with AControlBounds, AControlSize do + begin + Right := Left + X; + Bottom := Top + Y; + end; + end; + + procedure CalculateRestBounds(var ABounds: TRect; const ASize: TPoint; + AAlignHorz: TAlignment; AAlignVert: TdxAlignmentVert); + begin + with ABounds, ASize do + case CaptionLayout of + clLeft, clRight: + case AAlignVert of + tavTop: + Bottom := Top + Y; + tavCenter: + begin + Top := (Top + Bottom - Y) div 2; + Bottom := Top + Y; + end; + tavBottom: + Top := Bottom - Y; + end; + clTop, clBottom: + case AAlignHorz of + taLeftJustify: + Right := Left + X; + taCenter: + begin + Left := (Left + Right - X) div 2; + Right := Left + X; + end; + taRightJustify: + Left := Right - X; + end; + end; + end; + +begin + CalculateElementViewInfoSize(CaptionViewInfo, ACaptionSize, ACaptionVisible); + CalculateElementViewInfoSize(ControlViewInfo, AControlSize, AControlVisible); + CalculateMainBounds; + if ACaptionVisible then + begin + CalculateRestBounds(ACaptionBounds, ACaptionSize, + Item.CaptionOptions.AlignHorz, Item.CaptionOptions.AlignVert); + if AControlVisible and + ((AlignHorz <> ahClient) or (CaptionLayout in [clLeft, clRight])) and + ((AlignVert <> avClient) or (CaptionLayout in [clTop, clBottom])) then + CalculateRestBounds(AControlBounds, AControlSize, taLeftJustify, tavTop); + end; +end; + +function TdxLayoutItemViewInfo.DoCalculateHeight(AIsMinHeight: Boolean = False): Integer; +var + AHeight: Integer; +begin + Result := CaptionViewInfo.Height; + if AIsMinHeight then + AHeight := ControlViewInfo.CalculateMinHeight + else + AHeight := ControlViewInfo.CalculateHeight; + + case CaptionLayout of + clLeft, clRight: + if AHeight > Result then Result := AHeight; + clTop, clBottom: + begin + if (Result <> 0) and ControlViewInfo.Visible{(AHeight <> 0)} then + Inc(Result, ControlOffsetVert); + Inc(Result, AHeight); + end; + else + Result := 0; + end; + + Inc(Result, inherited DoCalculateHeight(AIsMinHeight)); +end; + +function TdxLayoutItemViewInfo.DoCalculateWidth(AIsMinWidth: Boolean = False): Integer; +var + AWidth: Integer; +begin + if AIsMinWidth then + begin + Result := CaptionViewInfo.MinWidth; + AWidth := ControlViewInfo.CalculateMinWidth; + end + else + begin + Result := CaptionViewInfo.Width; + AWidth := ControlViewInfo.CalculateWidth; + end; + + case CaptionLayout of + clLeft, clRight: + begin + if (Result <> 0) and ControlViewInfo.Visible{(AWidth <> 0)} then + Inc(Result, ControlOffsetHorz); + Inc(Result, AWidth); + end; + clTop, clBottom: + if AWidth > Result then Result := AWidth; + else + Result := 0; + end; + + Inc(Result, inherited DoCalculateWidth(AIsMinWidth)); +end; + +function TdxLayoutItemViewInfo.GetAutoControlAlignment: Boolean; + + function AreAlignmentAndCaptionLayoutLinked: Boolean; + begin + case CaptionLayout of + clLeft: + Result := AlignHorz in [ahLeft, ahClient]; + clTop: + Result := AlignVert in [avTop, avClient]; + clRight: + Result := AlignHorz in [ahRight, ahClient]; + clBottom: + Result := AlignVert in [avBottom, avClient]; + else + Result := False; + end; + end; + +begin + Result := + Item.ControlOptions.AutoAlignment and HasCaption and HasControl and + AreAlignmentAndCaptionLayoutLinked; +end; + +function TdxLayoutItemViewInfo.GetCaptionLayout: TdxCaptionLayout; +begin + Result := Item.CaptionOptions.Layout; +end; + +function TdxLayoutItemViewInfo.GetColor: TColor; +begin + Result := ParentViewInfo.GetColor; +end; + +function TdxLayoutItemViewInfo.GetContentBounds: TRect; +begin + Result := Bounds; +end; + +function TdxLayoutItemViewInfo.GetControlOffsetHorz: Integer; +begin + Result := LookAndFeel.GetControlOffsetHorz(Item.Container); +end; + +function TdxLayoutItemViewInfo.GetControlOffsetVert: Integer; +begin + Result := LookAndFeel.GetControlOffsetVert(Item.Container); +end; + +function TdxLayoutItemViewInfo.GetElement(Index: Integer): TdxCustomLayoutItemElementViewInfo; +begin + Result := inherited GetElement(Index); + if Index - inherited GetElementCount = 0 then + Result := FControlViewInfo; +end; + +function TdxLayoutItemViewInfo.GetElementCount: Integer; +begin + Result := inherited GetElementCount + 1; +end; + +function TdxLayoutItemViewInfo.GetIsDefaultColor: Boolean; +begin + Result := ParentViewInfo.IsDefaultColor; +end; + +function TdxLayoutItemViewInfo.GetOptions: TdxCustomLayoutLookAndFeelOptions; +begin + Result := LookAndFeel.ItemOptions; +end; + +function TdxLayoutItemViewInfo.HasControl: Boolean; +begin + Result := Item.HasControl; +end; + +procedure TdxLayoutItemViewInfo.Calculate(const ABounds: TRect); +var + ACaptionViewInfoBounds, AControlViewInfoBounds: TRect; +begin + inherited; + CalculateViewInfosBounds(ACaptionViewInfoBounds, AControlViewInfoBounds); + CaptionViewInfo.Calculate(ACaptionViewInfoBounds); + ControlViewInfo.Calculate(AControlViewInfoBounds); +end; + +procedure TdxLayoutItemViewInfo.CalculateTabOrders(var AAvailTabOrder: Integer); +begin + ControlViewInfo.CalculateTabOrder(AAvailTabOrder); +end; + +{ TdxLayoutGroupCaptionViewInfo } + +function TdxLayoutGroupCaptionViewInfo.GetAlignVert: TdxAlignmentVert; +begin + Result := tavTop; +end; + +function TdxLayoutGroupCaptionViewInfo.GetMultiLine: Boolean; +begin + Result := False; +end; + +function TdxLayoutGroupCaptionViewInfo.GetMinWidth: Integer; +begin + Result := CalculateWidth; +end; + +{ TdxLayoutGroupViewInfoSpecific } + +constructor TdxLayoutGroupViewInfoSpecific.Create(AGroupViewInfo: TdxLayoutGroupViewInfo); +begin + inherited Create; + FGroupViewInfo := AGroupViewInfo; +end; + +function TdxLayoutGroupViewInfoSpecific.GetItemOffset: Integer; +begin + Result := FGroupViewInfo.ItemOffset; +end; + +function TdxLayoutGroupViewInfoSpecific.GetItemViewInfo(Index: Integer): TdxCustomLayoutItemViewInfo; +begin + Result := FGroupViewInfo.ItemViewInfos[Index]; +end; + +function TdxLayoutGroupViewInfoSpecific.GetItemViewInfoCount: Integer; +begin + Result := FGroupViewInfo.ItemViewInfoCount; +end; + +function TdxLayoutGroupViewInfoSpecific.GetLayoutDirection: TdxLayoutDirection; +begin + Result := FGroupViewInfo.LayoutDirection; +end; + +function TdxLayoutGroupViewInfoSpecific.DoCalculateHeight: Integer; +begin + Result := GetCustomHeight(GetItemHeight); +end; + +function TdxLayoutGroupViewInfoSpecific.DoCalculateWidth: Integer; +begin + Result := GetCustomWidth(GetItemWidth); +end; + +function TdxLayoutGroupViewInfoSpecific.DoCalculateMinHeight: Integer; +begin + Result := GetCustomHeight(GetItemMinHeight); +end; + +function TdxLayoutGroupViewInfoSpecific.DoCalculateMinWidth: Integer; +begin + Result := GetCustomWidth(GetItemMinWidth); +end; + +function TdxLayoutGroupViewInfoSpecific.GetCustomHeight(AGetItemCustomHeight: TdxLayoutGroupViewInfoGetItemSizeEvent): Integer; +var + I, AItemHeight: Integer; +begin + Result := 0; + for I := 0 to ItemViewInfoCount - 1 do + begin + AItemHeight := AGetItemCustomHeight(ItemViewInfos[I]); + if AItemHeight > Result then Result := AItemHeight; + end; +end; + +function TdxLayoutGroupViewInfoSpecific.GetCustomWidth(AGetItemCustomWidth: TdxLayoutGroupViewInfoGetItemSizeEvent): Integer; +var + AIsFirstItem: Boolean; + I, AItemWidth: Integer; + AItemViewInfo: TdxCustomLayoutItemViewInfo; +begin + Result := 0; + AIsFirstItem := True; + for I := 0 to ItemViewInfoCount - 1 do + begin + AItemViewInfo := ItemViewInfos[I]; + if GetItemAlignHorz(AItemViewInfo) <> ahCenter then + begin + if not AIsFirstItem then + Inc(Result, ItemOffset); + AItemWidth := AGetItemCustomWidth(AItemViewInfo); + Inc(Result, AItemWidth); + AIsFirstItem := False; + end; + end; + for I := 0 to ItemViewInfoCount - 1 do + begin + AItemViewInfo := ItemViewInfos[I]; + if GetItemAlignHorz(AItemViewInfo) = ahCenter then + begin + AItemWidth := AGetItemCustomWidth(AItemViewInfo); + if AItemWidth > Result then + Result := AItemWidth; + end; + end; +end; + +procedure TdxLayoutGroupViewInfoSpecific.ConvertCoords(var R: TRect); +begin +end; + +procedure TdxLayoutGroupViewInfoSpecific.CalculateItemsBounds(AItemsAreaBounds: TRect); +type + TItemInfo = record + ViewInfo: TdxCustomLayoutItemViewInfo; + AlignHorz: TdxLayoutAlignHorz; + CalculatedWidth, MinWidth, Width, Height: Integer; + Bounds: TRect; + Calculated: Boolean; + end; + PItemInfos = ^TItemInfos; + TItemInfos = array[0..MaxInt div SizeOf(TItemInfo) - 1] of TItemInfo; +var + AItemInfos: PItemInfos; + + procedure PrepareItemInfos; + var + I: Integer; + begin + for I := 0 to ItemViewInfoCount - 1 do + with AItemInfos^[I] do + begin + ViewInfo := ItemViewInfos[I]; + AlignHorz := GetItemAlignHorz(ViewInfo); + CalculatedWidth := GetItemWidth(ViewInfo); + Height := GetItemHeight(ViewInfo); + MinWidth := GetItemMinWidth(ViewInfo); + Calculated := False; + end; + end; + + procedure CalculateItemsHorizontalBounds; + var + ASpace, AAvailableSpace: Integer; + + procedure CalculateSpaces; + var + AItemOffsets, I: Integer; + AIsFirstItem: Boolean; + begin + AItemOffsets := 0; + ASpace := 0; + AIsFirstItem := True; + for I := 0 to ItemViewInfoCount - 1 do + with AItemInfos^[I] do + if AlignHorz <> ahCenter then + begin + if not AIsFirstItem then + Inc(AItemOffsets, ItemOffset); + Inc(ASpace, CalculatedWidth); + AIsFirstItem := False; + end; + with AItemsAreaBounds do + AAvailableSpace := Right - Left - AItemOffsets; + end; + + procedure RemoveNonClientItemsFromCalculating; + var + I: Integer; + begin + for I := 0 to ItemViewInfoCount - 1 do + with AItemInfos^[I] do + if AlignHorz <> ahClient then + begin + Width := CalculatedWidth; + if AlignHorz <> ahCenter then + begin + Dec(ASpace, Width); + Dec(AAvailableSpace, Width); + end; + Calculated := True; + end; + end; + + procedure CalculateClientItemsVisibleSizes; + var + ANeedRecalculating: Boolean; + ANextSpace, ANextAvailableSpace, AOffset, I: Integer; + begin + repeat + ANeedRecalculating := False; + ANextSpace := ASpace; + ANextAvailableSpace := AAvailableSpace; + AOffset := 0; + + for I := 0 to ItemViewInfoCount - 1 do + with AItemInfos^[I] do + if not Calculated then + begin + Width := + MulDiv(AAvailableSpace, AOffset + CalculatedWidth, ASpace) - + MulDiv(AAvailableSpace, AOffset, ASpace); + if Width < MinWidth then + begin + Width := MinWidth; + Dec(ANextSpace, CalculatedWidth); + Dec(ANextAvailableSpace, Width); + Calculated := True; + ANeedRecalculating := True; + end; + end; + + ASpace := ANextSpace; + AAvailableSpace := ANextAvailableSpace; + until not ANeedRecalculating; + end; + + procedure CalculateItemsBounds; + + procedure ProcessLeftAlignedItems; + var + AOffset, I: Integer; + begin + AOffset := AItemsAreaBounds.Left; + for I := 0 to ItemViewInfoCount - 1 do + with AItemInfos^[I] do + case AlignHorz of + ahLeft, ahClient: + begin + Bounds.Left := AOffset; + Bounds.Right := AOffset + Width; + Inc(AOffset, Width + ItemOffset); + end; + ahCenter: + begin + Bounds.Left := + (AItemsAreaBounds.Left + AItemsAreaBounds.Right - Width) div 2; + Bounds.Right := Bounds.Left + Width; + end; + end; + end; + + procedure ProcessRightAlignedItems; + var + AOffset, I: Integer; + begin + AOffset := AItemsAreaBounds.Right; + for I := ItemViewInfoCount - 1 downto 0 do + with AItemInfos^[I] do + if AlignHorz = ahRight then + begin + Bounds.Right := AOffset; + Bounds.Left := AOffset - Width; + Dec(AOffset, Width + ItemOffset); + end; + end; + + begin + ProcessLeftAlignedItems; + ProcessRightAlignedItems; + end; + + begin + CalculateSpaces; + RemoveNonClientItemsFromCalculating; + CalculateClientItemsVisibleSizes; + CalculateItemsBounds; + end; + + procedure CalculateItemsVerticalBounds; + var + I: Integer; + begin + for I := 0 to ItemViewInfoCount - 1 do + with AItemInfos^[I] do + case GetItemAlignVert(ViewInfo) of + avTop: + begin + Bounds.Top := AItemsAreaBounds.Top; + Bounds.Bottom := Bounds.Top + Height; + end; + avCenter: + begin + Bounds.Top := + (AItemsAreaBounds.Top + AItemsAreaBounds.Bottom - Height) div 2; + Bounds.Bottom := Bounds.Top + Height; + end; + avBottom: + begin + Bounds.Bottom := AItemsAreaBounds.Bottom; + Bounds.Top := Bounds.Bottom - Height; + end; + avClient: + begin + Bounds.Top := AItemsAreaBounds.Top; + Bounds.Bottom := AItemsAreaBounds.Bottom; + end; + end; + end; + + procedure CalculateItemViewInfos; + var + I: Integer; + begin + for I := 0 to ItemViewInfoCount - 1 do + with AItemInfos^[I] do + begin + ConvertCoords(Bounds); + ViewInfo.Calculate(Bounds); + end; + end; + +begin + GetMem(AItemInfos, ItemViewInfoCount * SizeOf(TItemInfo)); + try + ConvertCoords(AItemsAreaBounds); + PrepareItemInfos; + CalculateItemsHorizontalBounds; + CalculateItemsVerticalBounds; + CalculateItemViewInfos; + finally + FreeMem(AItemInfos); + end; +end; + +function TdxLayoutGroupViewInfoSpecific.CalculateHeight(AIsMinHeight: Boolean = False): Integer; +begin + if AIsMinHeight then + Result := DoCalculateMinHeight + else + Result := DoCalculateHeight; +end; + +function TdxLayoutGroupViewInfoSpecific.CalculateWidth(AIsMinWidth: Boolean = False): Integer; +begin + if AIsMinWidth then + Result := DoCalculateMinWidth + else + Result := DoCalculateWidth; +end; + +{ TdxLayoutGroupHorizontalSpecific } + +function TdxLayoutGroupViewInfoHorizontalSpecific.GetItemAlignHorz(AViewInfo: TdxCustomLayoutItemViewInfo): TdxLayoutAlignHorz; +begin + Result := AViewInfo.AlignHorz; +end; + +function TdxLayoutGroupViewInfoHorizontalSpecific.GetItemAlignVert(AViewInfo: TdxCustomLayoutItemViewInfo): TdxLayoutAlignVert; +begin + Result := AViewInfo.AlignVert; +end; + +function TdxLayoutGroupViewInfoHorizontalSpecific.GetItemHeight(AViewInfo: TdxCustomLayoutItemViewInfo): Integer; +begin + Result := AViewInfo.CalculateHeight; +end; + +function TdxLayoutGroupViewInfoHorizontalSpecific.GetItemMinHeight(AViewInfo: TdxCustomLayoutItemViewInfo): Integer; +begin + Result := AViewInfo.MinHeight; +end; + +function TdxLayoutGroupViewInfoHorizontalSpecific.GetItemMinWidth(AViewInfo: TdxCustomLayoutItemViewInfo): Integer; +begin + Result := AViewInfo.MinWidth; +end; + +function TdxLayoutGroupViewInfoHorizontalSpecific.GetItemWidth(AViewInfo: TdxCustomLayoutItemViewInfo): Integer; +begin + Result := AViewInfo.CalculateWidth; +end; + +function TdxLayoutGroupViewInfoHorizontalSpecific.IsAtInsertionPos(const R: TRect; + const P: TPoint): Boolean; +begin + Result := P.X < (R.Left + R.Right) div 2; +end; + +{ TdxLayoutGroupViewInfoVerticalSpecific } + +procedure TdxLayoutGroupViewInfoVerticalSpecific.ConvertCoords(var R: TRect); +var + Temp: Integer; +begin + with R do + begin + Temp := Left; + Left := Top; + Top := Temp; + Temp := Right; + Right := Bottom; + Bottom := Temp; + end; +end; + +function TdxLayoutGroupViewInfoVerticalSpecific.GetItemAlignHorz(AViewInfo: TdxCustomLayoutItemViewInfo): TdxLayoutAlignHorz; +begin + Result := TdxLayoutAlignHorz(AViewInfo.AlignVert); +end; + +function TdxLayoutGroupViewInfoVerticalSpecific.GetItemAlignVert(AViewInfo: TdxCustomLayoutItemViewInfo): TdxLayoutAlignVert; +begin + Result := TdxLayoutAlignVert(AViewInfo.AlignHorz); +end; + +function TdxLayoutGroupViewInfoVerticalSpecific.GetItemHeight(AViewInfo: TdxCustomLayoutItemViewInfo): Integer; +begin + Result := AViewInfo.CalculateWidth; +end; + +function TdxLayoutGroupViewInfoVerticalSpecific.GetItemMinHeight(AViewInfo: TdxCustomLayoutItemViewInfo): Integer; +begin + Result := AViewInfo.MinWidth; +end; + +function TdxLayoutGroupViewInfoVerticalSpecific.GetItemMinWidth(AViewInfo: TdxCustomLayoutItemViewInfo): Integer; +begin + Result := AViewInfo.MinHeight; +end; + +function TdxLayoutGroupViewInfoVerticalSpecific.GetItemWidth(AViewInfo: TdxCustomLayoutItemViewInfo): Integer; +begin + Result := AViewInfo.CalculateHeight; +end; + +function TdxLayoutGroupViewInfoVerticalSpecific.CalculateHeight(AIsMinHeight: Boolean = False): Integer; +begin + Result := inherited CalculateWidth(AIsMinHeight); +end; + +function TdxLayoutGroupViewInfoVerticalSpecific.CalculateWidth(AIsMinWidth: Boolean = False): Integer; +begin + Result := inherited CalculateHeight(AIsMinWidth); +end; + +function TdxLayoutGroupViewInfoVerticalSpecific.IsAtInsertionPos(const R: TRect; + const P: TPoint): Boolean; +begin + Result := P.Y < (R.Top + R.Bottom) div 2; +end; + +{ TdxLayoutGroupViewInfo } + +constructor TdxLayoutGroupViewInfo.Create(AControlViewInfo: TdxLayoutControlViewInfo; + AParentViewInfo: TdxLayoutGroupViewInfo; AItem: TdxCustomLayoutItem); +begin + inherited; + CreateSpecific; + CreateItemViewInfos; +end; + +destructor TdxLayoutGroupViewInfo.Destroy; +begin + DestroyItemViewInfos; + DestroySpecific; + inherited; +end; + +function TdxLayoutGroupViewInfo.GetBorderBounds(ASide: TdxLayoutSide): TRect; +begin + Result := Bounds; + with ClientBounds do + case ASide of + sdLeft: + Result.Right := Left; + sdTop: + Result.Bottom := Top; + sdRight: + Result.Left := Right; + sdBottom: + Result.Top := Bottom; + end; +end; + +function TdxLayoutGroupViewInfo.GetBorderRestSpaceBounds(ASide: TdxLayoutSide): TRect; +begin + Result := RestSpaceBounds; + with ClientBounds do + case ASide of + sdLeft: + Result.Right := Left; + sdTop: + Result.Bottom := Top; + sdRight: + Result.Left := Right; + sdBottom: + Result.Top := Bottom; + end; +end; + +function TdxLayoutGroupViewInfo.GetBordersHeight: Integer; +begin + Result := BorderWidths[sdLeft] + BorderWidths[sdRight]; +end; + +function TdxLayoutGroupViewInfo.GetBordersWidth: Integer; +begin + Result := BorderWidths[sdTop] + BorderWidths[sdBottom]; +end; + +function TdxLayoutGroupViewInfo.GetCaptionViewInfo: TdxLayoutGroupCaptionViewInfo; +begin + Result := TdxLayoutGroupCaptionViewInfo(inherited CaptionViewInfo); +end; + +function TdxLayoutGroupViewInfo.GetGroup: TdxLayoutGroup; +begin + Result := TdxLayoutGroup(inherited Item); +end; + +function TdxLayoutGroupViewInfo.GetIsLocked: Boolean; +begin + Result := Group.Locked and IsCustomization or IsParentLocked; +end; + +function TdxLayoutGroupViewInfo.GetItemViewInfo(Index: Integer): TdxCustomLayoutItemViewInfo; +begin + Result := TdxCustomLayoutItemViewInfo(FItemViewInfos[Index]); +end; + +function TdxLayoutGroupViewInfo.GetItemViewInfoCount: Integer; +begin + Result := FItemViewInfos.Count; +end; + +function TdxLayoutGroupViewInfo.GetLayoutDirection: TdxLayoutDirection; +begin + Result := Group.LayoutDirection; +end; + +function TdxLayoutGroupViewInfo.GetOptionsEx: TdxLayoutLookAndFeelGroupOptions; +begin + Result := TdxLayoutLookAndFeelGroupOptions(inherited Options); +end; + +procedure TdxLayoutGroupViewInfo.CreateItemViewInfos; +var + I: Integer; + AItem: TdxCustomLayoutItem; + AItemViewInfo: TdxCustomLayoutItemViewInfo; +begin + FItemViewInfos := TList.Create; + for I := 0 to Group.VisibleCount - 1 do + begin + AItem := Group.VisibleItems[I]; + AItemViewInfo := + GetItemViewInfoClass(AItem).Create(FContainerViewInfo, Self, AItem); + FItemViewInfos.Add(AItemViewInfo); + end; +end; + +procedure TdxLayoutGroupViewInfo.CreateSpecific; +begin + FSpecific := GetSpecificClass.Create(Self); +end; + +procedure TdxLayoutGroupViewInfo.DestroyItemViewInfos; +var + I: Integer; +begin + for I := 0 to ItemViewInfoCount - 1 do + ItemViewInfos[I].Free; + FreeAndNil(FItemViewInfos); +end; + +procedure TdxLayoutGroupViewInfo.DestroySpecific; +begin + FreeAndNil(FSpecific); +end; + +function TdxLayoutGroupViewInfo.GetCaptionViewInfoClass: TdxCustomLayoutItemCaptionViewInfoClass; +begin + Result := TdxLayoutGroupCaptionViewInfo; +end; + +function TdxLayoutGroupViewInfo.GetHitTestClass: TdxCustomLayoutItemHitTestClass; +begin + Result := TdxLayoutGroupHitTest; +end; + +function TdxLayoutGroupViewInfo.GetPainterClass: TdxCustomLayoutItemPainterClass; +begin + Result := TdxCustomLayoutItemPainterClass(LookAndFeel.GetGroupPainterClass); +end; + +function TdxLayoutGroupViewInfo.DoCalculateHeight(AIsMinHeight: Boolean = False): Integer; +begin + Result := inherited DoCalculateHeight(AIsMinHeight) + + GetHeight(Specific.CalculateHeight(AIsMinHeight)); +end; + +function TdxLayoutGroupViewInfo.DoCalculateWidth(AIsMinWidth: Boolean = False): Integer; +begin + Result := inherited DoCalculateWidth(AIsMinWidth) + + GetWidth(Specific.CalculateWidth(AIsMinWidth)); +end; + +function TdxLayoutGroupViewInfo.CalculateCaptionViewInfoBounds: TRect; +begin + Result := Rect(0, 0, 0, 0); +end; + +function TdxLayoutGroupViewInfo.CalculateItemsAreaBounds: TRect; +begin + Result := Bounds; + Inc(Result.Left, BorderWidths[sdLeft]); + Inc(Result.Top, BorderWidths[sdTop]); + Dec(Result.Right, BorderWidths[sdRight]); + Dec(Result.Bottom, BorderWidths[sdBottom]); +end; + +procedure TdxLayoutGroupViewInfo.CalculateConsts; +begin + if UseItemsAreaOffsets then + if Group.IsRoot then + begin + ItemsAreaOffsetHorz := LookAndFeel.GetRootItemsAreaOffsetHorz(Item.Container); + ItemsAreaOffsetVert := LookAndFeel.GetRootItemsAreaOffsetVert(Item.Container); + end + else + begin + ItemsAreaOffsetHorz := LookAndFeel.GetItemsAreaOffsetHorz(Item.Container); + ItemsAreaOffsetVert := LookAndFeel.GetItemsAreaOffsetVert(Item.Container); + end + else + begin + ItemsAreaOffsetHorz := 0; + ItemsAreaOffsetVert := 0; + end; + + if UseItemOffset then + ItemOffset := LookAndFeel.GetItemOffset(Item.Container) + else + ItemOffset := 0; +end; + +function TdxLayoutGroupViewInfo.GetBorderWidth(ASide: TdxLayoutSide): Integer; +begin + case ASide of + sdLeft, sdRight: + Result := ItemsAreaOffsetHorz; + sdTop, sdBottom: + Result := ItemsAreaOffsetVert; + else + Result := 0; + end; + if HasBorder then + Inc(Result, LookAndFeel.GetGroupBorderWidth(Item.Container, ASide, HasCaption)); +end; + +function TdxLayoutGroupViewInfo.GetClientBounds: TRect; +begin + Result := Bounds; + if HasBorder then + with LookAndFeel, Result do + begin + Inc(Left, GetGroupBorderWidth(Item.Container, sdLeft, HasCaption)); + Dec(Right, GetGroupBorderWidth(Item.Container, sdRight, HasCaption)); + Inc(Top, GetGroupBorderWidth(Item.Container, sdTop, HasCaption)); + Dec(Bottom, GetGroupBorderWidth(Item.Container, sdBottom, HasCaption)); + end; +end; + +function TdxLayoutGroupViewInfo.GetColor: TColor; +begin + Result := Options.GetColor; +end; + +function TdxLayoutGroupViewInfo.GetConst(Index: Integer): Integer; +begin + if not FConstsCalculated then + begin + CalculateConsts; + FConstsCalculated := True; + end; + case Index of + 2: Result := FItemOffset; + 3: Result := FItemsAreaOffsetHorz; + 4: Result := FItemsAreaOffsetVert; + else + Result := -1; + end; +end; + +function TdxLayoutGroupViewInfo.GetHeight(AItemsAreaHeight: Integer): Integer; +begin + Result := BorderWidths[sdTop] + AItemsAreaHeight + BorderWidths[sdBottom]; +end; + +function TdxLayoutGroupViewInfo.GetIsDefaultColor: Boolean; +begin + Result := Options.Color = clDefault; +end; + +function TdxLayoutGroupViewInfo.GetItemViewInfoClass(AItem: TdxCustomLayoutItem): TdxCustomLayoutItemViewInfoClass; +begin + Result := AItem.GetViewInfoClass; +end; + +function TdxLayoutGroupViewInfo.GetMinVisibleWidth: Integer; +begin + if HasCaption then + Result := CaptionViewInfo.MinWidth + else + Result := 0; +end; + +function TdxLayoutGroupViewInfo.GetOptions: TdxCustomLayoutLookAndFeelOptions; +begin + Result := LookAndFeel.GroupOptions; +end; + +function TdxLayoutGroupViewInfo.GetRestSpaceBounds: TRect; +begin + Result := Bounds; +end; + +function TdxLayoutGroupViewInfo.GetSpecificClass: TdxLayoutGroupViewInfoSpecificClass; +begin + case LayoutDirection of + ldHorizontal: + Result := TdxLayoutGroupViewInfoHorizontalSpecific; + ldVertical: + Result := TdxLayoutGroupViewInfoVerticalSpecific; + else + Result := nil; + end; +end; + +function TdxLayoutGroupViewInfo.GetWidth(AItemsAreaWidth: Integer): Integer; +begin + Result := BorderWidths[sdLeft] + AItemsAreaWidth + BorderWidths[sdRight]; + if Result < MinVisibleWidth then Result := MinVisibleWidth; +end; + +function TdxLayoutGroupViewInfo.HasBorder: Boolean; +begin + Result := Group.ShowBorder; +end; + +function TdxLayoutGroupViewInfo.HasBoundsFrame: Boolean; +begin + Result := Group.Hidden and Group.Container.ShowHiddenGroupsBounds; +end; + +function TdxLayoutGroupViewInfo.UseItemOffset: Boolean; +begin + Result := Group.UseIndent; +end; + +function TdxLayoutGroupViewInfo.UseItemsAreaOffsets: Boolean; +begin + Result := Group.ShowBorder or Group.IsRoot; +end; + +procedure TdxLayoutGroupViewInfo.Calculate(const ABounds: TRect); +begin + inherited; + FItemsAreaBounds := CalculateItemsAreaBounds; + CaptionViewInfo.Calculate(CalculateCaptionViewInfoBounds); + Specific.CalculateItemsBounds(ItemsAreaBounds); +end; + +procedure TdxLayoutGroupViewInfo.CalculateTabOrders(var AAvailTabOrder: Integer); +var + I: Integer; +begin + for I := 0 to ItemViewInfoCount - 1 do + ItemViewInfos[I].CalculateTabOrders(AAvailTabOrder); +end; + +function TdxLayoutGroupViewInfo.GetHitTest(const P: TPoint): TdxCustomLayoutHitTest; +var + I: Integer; +begin + for I := 0 to ItemViewInfoCount - 1 do + begin + Result := ItemViewInfos[I].GetHitTest(P); + if Result <> nil then Exit; + end; + if ContainerViewInfo.HideHiddenGroupsFromHitTest and + Group.Hidden and not IsLocked then + Result := nil + else + Result := inherited GetHitTest(P); +end; + +function TdxLayoutGroupViewInfo.GetInsertionPos(const P: TPoint): Integer; +var + R: TRect; +begin + if PtInRect(Bounds, P) then + for Result := 0 to ItemViewInfoCount - 1 do + begin + R := ItemViewInfos[Result].Bounds; + if Specific.IsAtInsertionPos(R, P) then Exit; + end; + Result := ItemViewInfoCount; +end; + +{ TdxLayoutGroupStandardCaptionViewInfo } + +function TdxLayoutGroupStandardCaptionViewInfo.GetItemViewInfo: TdxLayoutGroupStandardViewInfo; +begin + Result := TdxLayoutGroupStandardViewInfo(inherited ItemViewInfo); +end; + +function TdxLayoutGroupStandardCaptionViewInfo.GetAlignHorz: TAlignment; +begin + Result := taCenter; +end; + +function TdxLayoutGroupStandardCaptionViewInfo.CalculateWidth: Integer; +begin + Result := inherited CalculateWidth; + if Visible then + Inc(Result, 2 + 2); +end; + +{ TdxLayoutGroupStandardViewInfo } + +function TdxLayoutGroupStandardViewInfo.GetLookAndFeel: TdxLayoutStandardLookAndFeel; +begin + Result := TdxLayoutStandardLookAndFeel(inherited LookAndFeel); +end; + +function TdxLayoutGroupStandardViewInfo.CalculateCaptionViewInfoBounds: TRect; +var + ACaptionWidth: Integer; +begin + Result := BorderBounds[sdTop]; + ACaptionWidth := CaptionViewInfo.CalculateWidth; + with Result do + begin + case Item.CaptionOptions.AlignHorz of + taLeftJustify: + begin + Inc(Left, CaptionViewInfoOffset); + Right := Left + ACaptionWidth; + end; + taRightJustify: + begin + Dec(Right, CaptionViewInfoOffset); + Left := Right - ACaptionWidth; + end; + taCenter: + begin + Left := (Left + Right - ACaptionWidth) div 2; + Right := Left + ACaptionWidth; + end; + end; + Bottom := Top + CaptionViewInfo.CalculateHeight; + end; +end; + +function TdxLayoutGroupStandardViewInfo.GetCaptionViewInfoClass: TdxCustomLayoutItemCaptionViewInfoClass; +begin + Result := TdxLayoutGroupStandardCaptionViewInfo; +end; + +function TdxLayoutGroupStandardViewInfo.GetMinVisibleWidth: Integer; +begin + Result := inherited GetMinVisibleWidth; + if HasCaption then + Inc(Result, 2 * CaptionViewInfoOffset); +end; + +function TdxLayoutGroupStandardViewInfo.GetCaptionViewInfoOffset: Integer; +begin + Result := LookAndFeel.HDLUToPixels(CaptionViewInfo.Font, 7) - 2; +end; + +function TdxLayoutGroupStandardViewInfo.GetFrameBounds: TRect; +begin + Result := Bounds; + Inc(Result.Top, LookAndFeel.VDLUToPixels(CaptionViewInfo.Font, 4) - + LookAndFeel.FrameWidths[sdTop] div 2); +end; + +{ TdxLayoutGroupOfficeCaptionViewInfo } + +function TdxLayoutGroupOfficeCaptionViewInfo.CalculateWidth: Integer; +var + AOffset: Integer; +begin + Result := inherited CalculateWidth; + if Visible then + begin + AOffset := LookAndFeel.HDLUToPixels(Font, 5); + if AlignHorz = taCenter then + AOffset := 2 * AOffset; + Inc(Result, AOffset); + end; +end; + +{ TdxLayoutGroupOfficeViewInfo } + +function TdxLayoutGroupOfficeViewInfo.GetCaptionViewInfoClass: TdxCustomLayoutItemCaptionViewInfoClass; +begin + Result := TdxLayoutGroupOfficeCaptionViewInfo; +end; + +function TdxLayoutGroupOfficeViewInfo.GetCaptionViewInfoOffset: Integer; +begin + Result := 0; +end; + +function TdxLayoutGroupOfficeViewInfo.GetFrameBounds: TRect; +begin + Result := inherited GetFrameBounds; + with Result do + Bottom := Top + 2; +end; + +function TdxLayoutGroupOfficeViewInfo.GetMinVisibleWidth: Integer; +begin + Result := inherited GetMinVisibleWidth; + if HasCaption then Inc(Result, 20); +end; + +{ TdxLayoutGroupWebCaptionViewInfo } + +function TdxLayoutGroupWebCaptionViewInfo.GetItemViewInfo: TdxLayoutGroupWebViewInfo; +begin + Result := TdxLayoutGroupWebViewInfo(inherited ItemViewInfo); +end; + +function TdxLayoutGroupWebCaptionViewInfo.GetLookAndFeel: TdxLayoutWebLookAndFeel; +begin + Result := TdxLayoutWebLookAndFeel(inherited LookAndFeel); +end; + +function TdxLayoutGroupWebCaptionViewInfo.GetOptionsEx: TdxLayoutWebLookAndFeelGroupCaptionOptions; +begin + Result := TdxLayoutWebLookAndFeelGroupCaptionOptions(inherited Options); +end; + +function TdxLayoutGroupWebCaptionViewInfo.GetSeparatorWidth: Integer; +begin + Result := Options.SeparatorWidth; +end; + +function TdxLayoutGroupWebCaptionViewInfo.GetAlignVert: TdxAlignmentVert; +begin + Result := tavCenter; +end; + +function TdxLayoutGroupWebCaptionViewInfo.GetColor: TColor; +begin + Result := Options.GetColor; +end; + +function TdxLayoutGroupWebCaptionViewInfo.GetIsDefaultColor: Boolean; +begin + Result := Options.Color = clDefault; +end; + +function TdxLayoutGroupWebCaptionViewInfo.GetMinWidth: Integer; +begin + Result := 2 * TextOffset + inherited GetMinWidth; +end; + +function TdxLayoutGroupWebCaptionViewInfo.GetTextAreaBounds: TRect; +begin + Result := inherited GetTextAreaBounds; + Inc(Result.Left, TextOffset); +end; + +function TdxLayoutGroupWebCaptionViewInfo.GetTextOffset: Integer; +begin + if ItemViewInfo.Options.OffsetCaption then + Result := LookAndFeel.VDLUToPixels(Font, 5) + else + Result := LookAndFeel.DLUToPixels(Font, 2); +end; + +function TdxLayoutGroupWebCaptionViewInfo.CalculateHeight: Integer; +begin + if Visible then + Result := LookAndFeel.VDLUToPixels(Font, 11{12}) + else + Result := inherited CalculateHeight; +end; + +{ TdxLayoutGroupWebViewInfo } + +function TdxLayoutGroupWebViewInfo.GetCaptionViewInfo: TdxLayoutGroupWebCaptionViewInfo; +begin + Result := TdxLayoutGroupWebCaptionViewInfo(inherited CaptionViewInfo); +end; + +function TdxLayoutGroupWebViewInfo.GetInsideFrameBounds: TRect; +begin + Result := Bounds; + with Options do + InflateRect(Result, -FrameWidth, -FrameWidth); +end; + +function TdxLayoutGroupWebViewInfo.GetLookAndFeel: TdxLayoutWebLookAndFeel; +begin + Result := TdxLayoutWebLookAndFeel(inherited LookAndFeel); +end; + +function TdxLayoutGroupWebViewInfo.GetOptionsEx: TdxLayoutWebLookAndFeelGroupOptions; +begin + Result := TdxLayoutWebLookAndFeelGroupOptions(inherited Options); +end; + +function TdxLayoutGroupWebViewInfo.CalculateCaptionViewInfoBounds: TRect; +begin + Result := InsideFrameBounds; + Result.Bottom := Result.Top + CaptionViewInfo.CalculateHeight; +end; + +function TdxLayoutGroupWebViewInfo.GetCaptionViewInfoClass: TdxCustomLayoutItemCaptionViewInfoClass; +begin + Result := TdxLayoutGroupWebCaptionViewInfo; +end; + +function TdxLayoutGroupWebViewInfo.GetMinVisibleWidth: Integer; +begin + Result := inherited GetMinVisibleWidth; + Inc(Result, 2 * Options.FrameWidth); +end; + +function TdxLayoutGroupWebViewInfo.GetRestSpaceBounds: TRect; +begin + Result := inherited GetRestSpaceBounds; + with Options do + InflateRect(Result, -FrameWidth, -FrameWidth); + if HasCaption then + Result.Top := CaptionViewInfo.Bounds.Bottom; + if Options.HasCaptionSeparator(HasCaption) then + Inc(Result.Top, CaptionViewInfo.SeparatorWidth); +end; + +function TdxLayoutGroupWebViewInfo.GetCaptionSeparatorAreaBounds: TRect; +begin + Result := RestSpaceBounds; + Result.Bottom := Result.Top; + Dec(Result.Top, CaptionViewInfo.SeparatorWidth); +end; + +function TdxLayoutGroupWebViewInfo.GetCaptionSeparatorBounds: TRect; +begin + Result := CaptionSeparatorAreaBounds; + if not Options.OffsetCaption and not Options.OffsetItems and + (Options.FrameWidth = 0) and (CaptionViewInfo.Color = Color) then + with ClientBounds do + begin + Result.Left := Left; + Result.Right := Right; + end; +end; + +{ TdxLayoutControlViewInfo } + +constructor TdxLayoutControlViewInfo.Create(AControl: TdxCustomLayoutControl); +begin + inherited; + CreateViewInfos; +end; + +destructor TdxLayoutControlViewInfo.Destroy; +begin + DestroyViewInfos; + FCanvas.Free; + inherited; +end; + +function TdxLayoutControlViewInfo.GetClientHeight: Integer; +begin + with ClientBounds do + Result := Bottom - Top; +end; + +function TdxLayoutControlViewInfo.GetClientWidth: Integer; +begin + with ClientBounds do + Result := Right - Left; +end; + +function TdxLayoutControlViewInfo.GetContentHeight: Integer; +begin + with ContentBounds do + Result := Bottom - Top; +end; + +function TdxLayoutControlViewInfo.GetContentWidth: Integer; +begin + with ContentBounds do + Result := Right - Left; +end; + +function TdxLayoutControlViewInfo.GetLookAndFeel: TdxCustomLayoutLookAndFeel; +begin + Result := FControl.GetLookAndFeel; +end; + +procedure TdxLayoutControlViewInfo.CreateViewInfos; +begin + if LookAndFeel <> nil then + FItemsViewInfo := GetItemsViewInfoClass.Create(Self, nil, FControl.Items); +end; + +procedure TdxLayoutControlViewInfo.DestroyViewInfos; +begin + FreeAndNil(FItemsViewInfo); +end; + +function TdxLayoutControlViewInfo.GetItemsViewInfoClass: TdxLayoutGroupViewInfoClass; +begin + Result := TdxLayoutGroupViewInfoClass(FControl.Items.GetViewInfoClass); +end; + +procedure TdxLayoutControlViewInfo.RecreateViewInfos; +begin + DestroyViewInfos; + CreateViewInfos; +end; + +procedure TdxLayoutControlViewInfo.AlignItems; +var + I: Integer; + + procedure ProcessConstraint(AConstraint: TdxLayoutAlignmentConstraint); + var + AItemViewInfos: TList; + + procedure RetrieveItemViewInfos; + var + I: Integer; + AViewInfo: TdxCustomLayoutItemViewInfo; + begin + for I := 0 to AConstraint.Count - 1 do + begin + AViewInfo := AConstraint.Items[I].ViewInfo; + if AViewInfo <> nil then + AItemViewInfos.Add(AViewInfo); + end; + end; + + function GetSide: TdxLayoutSide; + begin + if AConstraint.Kind in [ackLeft, ackRight] then + Result := sdLeft + else + Result := sdTop; + end; + + function AlignItemViewInfos: Boolean; + var + AMaxBorderValue, I: Integer; + + function GetBorderValue(AItemViewInfoIndex: Integer): Integer; + begin + with TdxCustomLayoutItemViewInfo(AItemViewInfos[AItemViewInfoIndex]), Bounds do + case AConstraint.Kind of + ackLeft: + Result := Left - CalculateOffset(sdLeft); + ackTop: + Result := Top - CalculateOffset(sdTop); + ackRight: + Result := Right + CalculateOffset(sdRight); + ackBottom: + Result := Bottom + CalculateOffset(sdBottom); + else + Result := 0; + end; + end; + + function FindMaxBorderValue: Integer; + var + I: Integer; + begin + Result := -MaxInt; + for I := 0 to AItemViewInfos.Count - 1 do + if Result < GetBorderValue(I) then Result := GetBorderValue(I); + end; + + procedure ChangeOffset(AItemViewInfoIndex, ADelta: Integer); + begin + with TdxCustomLayoutItemViewInfo(AItemViewInfos[AItemViewInfoIndex]) do + Offsets[GetSide] := Offsets[GetSide] + ADelta; + end; + + function AreItemViewInfosAligned: Boolean; + var + I, ABorderValue: Integer; + begin + ABorderValue := 0; + for I := 0 to AItemViewInfos.Count - 1 do + if I = 0 then + ABorderValue := GetBorderValue(I) + else + begin + Result := GetBorderValue(I) = ABorderValue; + if not Result then Exit; + end; + Result := True; + end; + + begin + AMaxBorderValue := FindMaxBorderValue; + for I := 0 to AItemViewInfos.Count - 1 do + ChangeOffset(I, AMaxBorderValue - GetBorderValue(I)); + CalculateItemsViewInfo; + Result := AreItemViewInfosAligned; + end; + + procedure ResetOffsets; + var + I: Integer; + begin + for I := 0 to AItemViewInfos.Count - 1 do + TdxCustomLayoutItemViewInfo(AItemViewInfos[I]).ResetOffset(GetSide); + CalculateItemsViewInfo; + end; + + begin + AItemViewInfos := TList.Create; + try + RetrieveItemViewInfos; + while not AlignItemViewInfos do //!!! to think about invisible items if items will be deleted + begin + ResetOffsets; + if AItemViewInfos.Count > 2 then + AItemViewInfos.Count := AItemViewInfos.Count - 1 + else + Break; + end; + finally + AItemViewInfos.Free; + end; + end; + +begin + for I := 0 to FControl.AlignmentConstraintCount - 1 do + ProcessConstraint(FControl.AlignmentConstraints[I]); +end; + +function CompareAllItemViewInfos(Item1, Item2: TdxLayoutItemViewInfo): Integer; +begin + Result := Ord(Item2.CaptionLayout) - Ord(Item1.CaptionLayout); +end; + +function CompareItemViewInfos(Item1, Item2: TdxLayoutItemViewInfo): Integer; +begin + case Item1.CaptionLayout of + clLeft: + Result := Item1.Bounds.Left - Item2.Bounds.Left; + clTop: + Result := Item1.Bounds.Top - Item2.Bounds.Top; + clRight: + Result := Item1.Bounds.Right - Item2.Bounds.Right; + clBottom: + Result := Item1.Bounds.Bottom - Item2.Bounds.Bottom; + else + Result := 0; + end; +end; + +procedure TdxLayoutControlViewInfo.AutoAlignControls; +var + AAllItemViewInfos: TList; + ACaptionLayout: TdxCaptionLayout; + + procedure FindAllItemViewInfos(ACustomItemViewInfo: TdxCustomLayoutItemViewInfo); + var + I: Integer; + begin + if ACustomItemViewInfo is TdxLayoutGroupViewInfo then + with TdxLayoutGroupViewInfo(ACustomItemViewInfo) do + for I := 0 to ItemViewInfoCount - 1 do + FindAllItemViewInfos(ItemViewInfos[I]) + else + if TdxLayoutItemViewInfo(ACustomItemViewInfo).AutoControlAlignment then + AAllItemViewInfos.Add(ACustomItemViewInfo); + end; + + procedure SortAllItemViewInfos; + begin + AAllItemViewInfos.Sort(@CompareAllItemViewInfos); + end; + + procedure ProcessItemViewInfos(ACaptionLayout: TdxCaptionLayout); + var + AItemViewInfos: TList; + AGroupedCount: Integer; + + procedure ExtractItemViewInfos; + var + I, ACount: Integer; + begin + I := AAllItemViewInfos.Count - 1; + while (I <> -1) and + (TdxLayoutItemViewInfo(AAllItemViewInfos[I]).CaptionLayout = ACaptionLayout) do + Dec(I); + ACount := AAllItemViewInfos.Count - 1 - I; + + AItemViewInfos.Count := ACount; + Move(AAllItemViewInfos.List^[I + 1], AItemViewInfos.List^[0], + ACount * SizeOf(Pointer)); + + AAllItemViewInfos.Count := I + 1; + end; + + procedure SortItemViewInfos; + begin + AItemViewInfos.Sort(@CompareItemViewInfos); + end; + + function FindGroup: Boolean; + var + AItemViewInfo1, AItemViewInfo2: TdxLayoutItemViewInfo; + begin + AItemViewInfo1 := AItemViewInfos[0]; + AGroupedCount := 1; + while AGroupedCount < AItemViewInfos.Count do + begin + AItemViewInfo2 := AItemViewInfos[AGroupedCount]; + if CompareItemViewInfos(AItemViewInfo1, AItemViewInfo2) <> 0 then + Break; + Inc(AGroupedCount); + end; + Result := AGroupedCount <> 1; + end; + + procedure AlignControls; + + function IsCaptionLayoutHorizontal: Boolean; + begin + Result := ACaptionLayout in [clLeft, clRight]; + end; + + function GetMaxCaptionSize: Integer; + var + I, ACaptionSize: Integer; + begin + Result := 0; + for I := 0 to AGroupedCount - 1 do + begin + with TdxLayoutItemViewInfo(AItemViewInfos[I]).CaptionViewInfo do + if IsCaptionLayoutHorizontal then + ACaptionSize := Width + else + ACaptionSize := Height; + if Result < ACaptionSize then Result := ACaptionSize; + end; + end; + + procedure AssignCaptionSizes(AMaxCaptionSize: Integer); + var + I: Integer; + begin + for I := 0 to AGroupedCount - 1 do + with TdxLayoutItemViewInfo(AItemViewInfos[I]).CaptionViewInfo do + if IsCaptionLayoutHorizontal then + Width := AMaxCaptionSize + else + Height := AMaxCaptionSize; + end; + + begin + AssignCaptionSizes(GetMaxCaptionSize); + CalculateItemsViewInfo; + end; + + procedure RemoveProcessedItemViewInfos; + begin + Move(AItemViewInfos.List^[AGroupedCount], AItemViewInfos.List^[0], + (AItemViewInfos.Count - AGroupedCount) * SizeOf(Pointer)); + AItemViewInfos.Count := AItemViewInfos.Count - AGroupedCount; + end; + + begin + AItemViewInfos := TList.Create; + try + ExtractItemViewInfos; + while AItemViewInfos.Count <> 0 do + begin + SortItemViewInfos; + if FindGroup then AlignControls; + RemoveProcessedItemViewInfos; + end; + finally + AItemViewInfos.Free; + end; + end; + +begin + AAllItemViewInfos := TList.Create; + try + FindAllItemViewInfos(ItemsViewInfo); + SortAllItemViewInfos; + for ACaptionLayout := Low(ACaptionLayout) to High(ACaptionLayout) do + ProcessItemViewInfos(ACaptionLayout); + finally + AAllItemViewInfos.Free; + end; +end; + +procedure TdxLayoutControlViewInfo.CalculateItemsViewInfo; +begin + ResetContentBounds; + ItemsViewInfo.Calculate(ContentBounds); +end; + +procedure TdxLayoutControlViewInfo.CalculateTabOrders; +var + AAvailTabOrder: Integer; +begin + AAvailTabOrder := 0; + ItemsViewInfo.CalculateTabOrders(AAvailTabOrder); +end; + +function TdxLayoutControlViewInfo.GetIsTransparent: Boolean; +begin + Result := HasBackground; +end; + +function TdxLayoutControlViewInfo.HasBackground: Boolean; +begin + Result := Control.HasBackground; +end; + +procedure TdxLayoutControlViewInfo.PrepareData; +begin + RecreateViewInfos; +end; + +procedure TdxLayoutControlViewInfo.ResetContentBounds; +begin + SetRectEmpty(FContentBounds); +end; + +function TdxLayoutControlViewInfo.GetCanvas: TcxCanvas; +begin + if Control.HandleAllocated then + begin + if FCanvas <> nil then FreeAndNil(FCanvas); + Result := Control.Canvas; + end + else + begin + if FCanvas = nil then + FCanvas := TcxScreenCanvas.Create; + Result := FCanvas; + end; +end; + +function TdxLayoutControlViewInfo.GetClientBounds: TRect; +begin + Result := FControl.ClientBounds; +end; + +function TdxLayoutControlViewInfo.GetContentBounds: TRect; + + function CalculateContentWidth: Integer; + var + AMinWidth: Integer; + begin + if acsWidth in Control.AutoContentSizes then + begin + with ClientBounds do + Result := Right - Left; + AMinWidth := ItemsViewInfo.MinWidth; + if Result < AMinWidth then Result := AMinWidth; + end + else + Result := ItemsViewInfo.CalculateWidth; + end; + + function CalculateContentHeight: Integer; + var + AMinHeight: Integer; + begin + if acsHeight in Control.AutoContentSizes then + begin + with ClientBounds do + Result := Bottom - Top; + AMinHeight := ItemsViewInfo.MinHeight; + if Result < AMinHeight then Result := AMinHeight; + end + else + Result := ItemsViewInfo.CalculateHeight; + end; + +begin + if IsRectEmpty(FContentBounds) then + with FContentBounds do + begin + Left := -Control.LeftPos; + Top := -Control.TopPos; + Right := Left + CalculateContentWidth; + Bottom := Top + CalculateContentHeight; + end; + Result := FContentBounds; +end; + +procedure TdxLayoutControlViewInfo.Calculate; +begin + PrepareData; + CalculateItemsViewInfo; + AlignItems; + if Control.AutoControlAlignment then + begin + AutoAlignControls; + AlignItems; + end; + Control.CheckPositions; + Control.UpdateScrollBars; + DoCalculateTabOrders; + if Control.HandleAllocated then + Control.IsPlaceControlsNeeded := True; +end; + +procedure TdxLayoutControlViewInfo.DoCalculateTabOrders; +begin + if Control.AutoControlTabOrders then CalculateTabOrders; +end; + +function TdxLayoutControlViewInfo.GetHitTest(const P: TPoint): TdxCustomLayoutHitTest; +var + ADesigner: TCustomForm; +begin + if Control.IsDesigning then + ADesigner := dxLayoutDesigner.GetDesigner(Control) + else + ADesigner := nil; + if Control.Customization and + PtInRect(Control.CustomizeForm.BoundsRect, Control.ClientToScreen(P)) or + (ADesigner <> nil) and PtInRect(ADesigner.BoundsRect, Control.ClientToScreen(P)) then + Result := TdxLayoutCustomizeFormHitTest.Instance + else + if PtInRect(ClientBounds, P) then + begin + Result := ItemsViewInfo.GetHitTest(P); + if Result = nil then + Result := TdxLayoutClientAreaHitTest.Instance; + end + else + Result := nil; + if Result = nil then + Result := TdxLayoutNoneHitTest.Instance; +end; + +function TdxLayoutControlViewInfo.GetHitTest(X, Y: Integer): TdxCustomLayoutHitTest; +begin + Result := GetHitTest(Point(X, Y)); +end; + +{ TdxLayoutCustomizeListBox } + +function TdxLayoutCustomizeListBox.GetDragAndDropItemObject: TdxCustomLayoutItem; +begin + Result := TdxCustomLayoutItem(inherited DragAndDropItemObject); +end; + +procedure TdxLayoutCustomizeListBox.BeginDragAndDrop; +begin + inherited; + with Control do + if CanDragAndDrop then + begin + DragAndDropObjectClass := TdxLayoutControlDragAndDropObject; + TdxLayoutControlDragAndDropObject(DragAndDropObject).Init(dsCustomizeForm, + Self.DragAndDropItemObject); + BeginDragAndDrop; + end; +end; + +initialization + Screen.Cursors[crdxLayoutControlDrag] := LoadCursor(HInstance, 'DXLAYOUTCONTROLDRAGCURSOR'); + + RegisterClasses([TdxLayoutItem, TdxLayoutGroup, TdxLayoutAlignmentConstraint]); + + HitTests := THitTests.Create; + +finalization + FreeAndNil(HitTests); + +end. diff --git a/official/x.35/ExpressLayout Control/Sources/dxLayoutControl.res b/official/x.35/ExpressLayout Control/Sources/dxLayoutControl.res new file mode 100644 index 00000000..5f97ae84 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Sources/dxLayoutControl.res differ diff --git a/official/x.35/ExpressLayout Control/Sources/dxLayoutControlAdapters.pas b/official/x.35/ExpressLayout Control/Sources/dxLayoutControlAdapters.pas new file mode 100644 index 00000000..9b6f4c77 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Sources/dxLayoutControlAdapters.pas @@ -0,0 +1,96 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressLayoutControl control adapters } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSLAYOUTCONTROL AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxLayoutControlAdapters; + +{$I cxVer.inc} + +interface + +uses + dxLayoutControl; + +type + TdxLayoutComboAdapter = class(TdxCustomLayoutControlAdapter) + protected + function AllowCheckSize: Boolean; override; + end; + + TdxLayoutPanelAdapter = class(TdxCustomLayoutControlAdapter) + protected + function ShowBorder: Boolean; override; + function UseItemColor: Boolean; override; + end; + +implementation + +uses + StdCtrls, ExtCtrls; + +type +{$IFNDEF DELPHI6} + TCustomCombo = TCustomComboBox; +{$ENDIF} + TCustomComboAccess = class(TCustomCombo); + +{ TdxLayoutComboAdapter } + +function TdxLayoutComboAdapter.AllowCheckSize: Boolean; +begin + Result := {$IFDEF DELPHI6}not TCustomComboAccess(Control).FDroppingDown{$ELSE}True{$ENDIF}; +end; + +{ TdxLayoutPanelAdapter } + +function TdxLayoutPanelAdapter.ShowBorder: Boolean; +begin + Result := False; +end; + +function TdxLayoutPanelAdapter.UseItemColor: Boolean; +begin + Result := True; +end; + +initialization + TdxLayoutComboAdapter.Register(TCustomCombo); + TdxLayoutPanelAdapter.Register(TCustomPanel); + +finalization + TdxLayoutPanelAdapter.Unregister(TCustomPanel); + TdxLayoutComboAdapter.Unregister(TCustomCombo); + +end. diff --git a/official/x.35/ExpressLayout Control/Sources/dxLayoutControlReg.dcr b/official/x.35/ExpressLayout Control/Sources/dxLayoutControlReg.dcr new file mode 100644 index 00000000..1de5e202 Binary files /dev/null and b/official/x.35/ExpressLayout Control/Sources/dxLayoutControlReg.dcr differ diff --git a/official/x.35/ExpressLayout Control/Sources/dxLayoutControlReg.pas b/official/x.35/ExpressLayout Control/Sources/dxLayoutControlReg.pas new file mode 100644 index 00000000..32366005 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Sources/dxLayoutControlReg.pas @@ -0,0 +1,518 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressLayoutControl registering unit } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSLAYOUTCONTROL AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxLayoutControlReg; + +{$I cxVer.inc} + +interface + +procedure Register; + +implementation + +uses + Windows, SysUtils, Classes, Graphics, Controls, Forms, StdCtrls, ExtCtrls, + {$IFDEF DELPHI6} + DesignIntf, DesignEditors, DesignMenus, VCLEditors, + {$ELSE} + DsgnIntf, DsgnWnds, Menus, + {$ENDIF} + dxRegEd, cxLibraryReg, + dxLayoutCommon, dxLayoutControl, dxLayoutLookAndFeels, dxLayoutDesignCommon, dxLayoutEditForm; + +const + dxLayoutControlMajorVersion = '1'; + dxLayoutControlProductName = 'ExpressLayoutControl'; + +type + TControlAccess = class(TControl); + TLabelAccess = class(TCustomLabel); + TStaticTextAccess = class(TCustomStaticText); + +{ TdxLayoutControlEditor } + +type + TdxLayoutControlEditor = class(TcxComponentEditor) + private + function GetControl: TdxLayoutControl; + protected + function GetProductMajorVersion: string; override; + function GetProductName: string; override; + function InternalGetVerb(AIndex: Integer): string; override; + function InternalGetVerbCount: Integer; override; + procedure InternalExecuteVerb(AIndex: Integer); override; + + procedure DoImport; + property Control: TdxLayoutControl read GetControl; + public + procedure PrepareItem(Index: Integer; const AItem: {$IFDEF DELPHI6}IMenuItem{$ELSE}TMenuItem{$ENDIF}); override; + end; + +function TdxLayoutControlEditor.GetControl: TdxLayoutControl; +begin + Result := TdxLayoutControl(Component); +end; + +function TdxLayoutControlEditor.GetProductMajorVersion: string; +begin + Result := dxLayoutControlMajorVersion; +end; + +function TdxLayoutControlEditor.GetProductName: string; +begin + Result := dxLayoutControlProductName; +end; + +function TdxLayoutControlEditor.InternalGetVerb(AIndex: Integer): string; +begin + case AIndex of + 0: Result := 'Designer...'; + 1: Result := 'Customize...'; + 2: Result := 'Import...'; + end; +end; + +function TdxLayoutControlEditor.InternalGetVerbCount: Integer; +begin + Result := 3; +end; + +procedure TdxLayoutControlEditor.InternalExecuteVerb(AIndex: Integer); +begin + case AIndex of + 0: TdxLayoutRealDesigner(dxLayoutDesigner).ShowDesignForm(Control, Designer); + 1: Control.Customization := True; + 2: DoImport; + end; +end; + +procedure TdxLayoutControlEditor.DoImport; +var + AControlName: string; + AControlCaptions: TStringList; + ACaptionLayouts: TList; + R: TRect; + + function GetRoot: TWinControl; + begin + Result := Control.Owner as TWinControl; + end; + + function CanExport(AControl: TControl): Boolean; + begin + Result := (AControl <> Control) and + not (csNoDesignVisible in AControl.ControlStyle){$IFDEF DELPHI6} and + not (csSubComponent in AControl.ComponentStyle){$ENDIF}; + end; + + function GetControlsCombo: TComboBox; + + function AddItems(AControl: TWinControl; AStrings: TStrings; + AInsertionIndex: Integer): Boolean; + var + I: Integer; + begin + with AControl do + begin + Result := CanExport(AControl) and (csAcceptsControls in ControlStyle); + if Result then + begin + AStrings.Insert(AInsertionIndex, Name); + AInsertionIndex := AStrings.Count; + for I := 0 to ControlCount - 1 do + if Controls[I] is TWinControl then + if AddItems(TWinControl(Controls[I]), AStrings, AInsertionIndex) then + Inc(AInsertionIndex); + end; + end; + end; + + begin + Result := TComboBox.Create(nil); + with Result do + begin + Visible := False; + Parent := GetParentForm(Control); + DropDownCount := 15; + Style := csDropDownList; + AddItems(GetRoot, Items, 0); + if Items.Count <> 0 then + ItemIndex := 0; + end; + end; + + function GetControl: TWinControl; + begin + if GetRoot.Name = AControlName then + Result := GetRoot + else + Result := GetRoot.FindComponent(AControlName) as TWinControl; + end; + + function ExportControl(AControl: TControl; AGroup: TdxLayoutGroup; + out AControlBounds: TRect): Boolean; + var + AControlCaption: string; + AItem: TdxCustomLayoutItem; + + function IsControlGroup: Boolean; + begin + Result := (AControl = GetRoot) or + (AControl is TCustomGroupBox) or (AControl is TCustomPanel); + end; + + procedure ExportGroupControl; + + procedure ExportChildren; + var + AFirstBounds, ABounds: TRect; + AIsLayoutDirectionAssigned: Boolean; + I: Integer; + + function GetLayoutDirection(const R1, R2: TRect): TdxLayoutDirection; + begin + if (R1.Right <= R2.Left) or (R2.Right <= R1.Left) then + Result := ldHorizontal + else + Result := ldVertical; + end; + + begin + SetRectEmpty(AFirstBounds); + AIsLayoutDirectionAssigned := False; + I := 0; + while I < TWinControl(AControl).ControlCount do + begin + if not ExportControl(TWinControl(AControl).Controls[I], TdxLayoutGroup(AItem), ABounds) then + Inc(I); + if not IsRectEmpty(ABounds) then + if IsRectEmpty(AFirstBounds) then + AFirstBounds := ABounds + else + if not AIsLayoutDirectionAssigned then + begin + TdxLayoutGroup(AItem).LayoutDirection := GetLayoutDirection(AFirstBounds, ABounds); + AIsLayoutDirectionAssigned := True; + end; + end; + end; + + begin + if AControl = GetRoot then + AItem := AGroup + else + begin + AItem := AGroup.CreateGroup; + TdxLayoutGroup(AItem).Hidden := AControl is TCustomPanel; + AItem.Caption := AControlCaption; + end; + ExportChildren; + end; + + procedure ExportNonGroupControl; + var + AFocusControl: TWinControl; + ACaptionIndex: Integer; + AControlItem: TdxLayoutItem; + ACaptionLayout: TdxCaptionLayout; + + function GetFocusControl: TWinControl; + begin + if AControl is TCustomLabel then + Result := TLabelAccess(AControl).FocusControl + else + if AControl is TCustomStaticText then + Result := TStaticTextAccess(AControl).FocusControl + else + Result := nil; + end; + + function IsLabel: Boolean; + begin + Result := (AControl is TCustomLabel) or (AControl is TCustomStaticText); + end; + + function GetCaptionLayout: TdxCaptionLayout; + begin + if AControl.BoundsRect.Right <= AFocusControl.BoundsRect.Left then + Result := clLeft + else + if AControl.BoundsRect.Left >= AFocusControl.BoundsRect.Right then + Result := clRight + else + if AControl.BoundsRect.Bottom <= AFocusControl.BoundsRect.Top then + Result := clTop + else + Result := clBottom; + end; + + procedure AssignItemCaptionData(AItem: TdxLayoutItem; + const ACaption: string; ACaptionLayout: TdxCaptionLayout); + begin + AItem.Caption := ACaption; + AItem.CaptionOptions.Layout := ACaptionLayout; + end; + + begin + if IsLabel then + SetRectEmpty(AControlBounds); + AFocusControl := GetFocusControl; + if AFocusControl = nil then + begin + if {$IFDEF DELPHI6}(AControl is TCustomLabeledEdit) or {$ENDIF}IsLabel then Exit; + Result := True; + AItem := AGroup.CreateItemForControl(AControl); + ACaptionIndex := AControlCaptions.IndexOfObject(AControl); + if ACaptionIndex <> -1 then + AssignItemCaptionData(TdxLayoutItem(AItem), AControlCaptions[ACaptionIndex], + TdxCaptionLayout(ACaptionLayouts[ACaptionIndex])); + end + else + begin + AControlItem := Control.FindItem(AFocusControl); + ACaptionLayout := GetCaptionLayout; + if AControlItem <> nil then + AssignItemCaptionData(AControlItem, AControlCaption, ACaptionLayout) + else + begin + AControlCaptions.AddObject(AControlCaption, AFocusControl); + ACaptionLayouts.Add(Pointer(ACaptionLayout)); + end; + end; + end; + + procedure ProcessAnchors; + const + AlignHorzs: array[Boolean, Boolean] of TdxLayoutAlignHorz = + ((ahLeft, ahRight), (ahLeft, ahClient)); + AlignVerts: array[Boolean, Boolean] of TdxLayoutAlignVert = + ((avTop, avBottom), (avTop, avClient)); + begin + if (AItem = nil) or AItem.IsRoot then Exit; + with AControl do + begin + AItem.AlignHorz := AlignHorzs[akLeft in Anchors, akRight in Anchors]; + AItem.AlignVert := AlignVerts[akTop in Anchors, akBottom in Anchors]; + end; + end; + + begin + Result := False; + SetRectEmpty(AControlBounds); + if not CanExport(AControl) then Exit; + AControlCaption := TControlAccess(AControl).Caption; + AControlBounds := AControl.BoundsRect; + AItem := nil; + if IsControlGroup then + ExportGroupControl + else + ExportNonGroupControl; + ProcessAnchors; + end; + +begin + AControlName := ''; + if not TLayoutEditForm.Run('Import', 'Choose a control to import data from:', + AControlName, GetControlsCombo) then Exit; + AControlCaptions := TStringList.Create; + ACaptionLayouts := TList.Create; + try + Control.BeginUpdate; + try + ExportControl(GetControl, Control.Items, R); + Control.Items.Pack; + finally + Control.EndUpdate; + end; + finally + ACaptionLayouts.Free; + AControlCaptions.Free; + end; +end; + +procedure TdxLayoutControlEditor.PrepareItem(Index: Integer; + const AItem: {$IFDEF DELPHI6}IMenuItem{$ELSE}TMenuItem{$ENDIF}); +begin + inherited; + if Index in [1, 2] then + AItem.Enabled := not IsInInlined; +end; + +{ TdxLayoutLookAndFeelListEditor } + +type + TdxLayoutLookAndFeelListEditor = class(TComponentEditor) + private + function GetLookAndFeelList: TdxLayoutLookAndFeelList; + protected + property LookAndFeelList: TdxLayoutLookAndFeelList read GetLookAndFeelList; + public + procedure ExecuteVerb(Index: Integer); override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + end; + +function TdxLayoutLookAndFeelListEditor.GetLookAndFeelList: TdxLayoutLookAndFeelList; +begin + Result := TdxLayoutLookAndFeelList(Component); +end; + +procedure TdxLayoutLookAndFeelListEditor.ExecuteVerb(Index: Integer); +begin + case Index of + 0: TdxLayoutRealDesigner(dxLayoutDesigner).ShowDesignForm(LookAndFeelList, Designer); + end; +end; + +function TdxLayoutLookAndFeelListEditor.GetVerb(Index: Integer): string; +begin + case Index of + 0: Result := 'Designer...'; + end; +end; + +function TdxLayoutLookAndFeelListEditor.GetVerbCount: Integer; +begin + Result := 1; +end; + +{ TdxLayoutColorProperty } + +const + DefaultColorText = 'clDefault'; + +type + TdxLayoutColorProperty = class(TColorProperty) + public + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + procedure ListDrawValue(const Value: string; ACanvas: TCanvas; + const ARect: TRect; ASelected: Boolean); {$IFNDEF DELPHI6}override;{$ENDIF} + procedure PropDrawValue(ACanvas: TCanvas; const ARect: TRect; + ASelected: Boolean); {$IFNDEF DELPHI6}override;{$ENDIF} + end; + +function TdxLayoutColorProperty.GetValue: string; +begin + if GetOrdValue = clDefault then + Result := DefaultColorText + else + Result := inherited GetValue; +end; + +procedure TdxLayoutColorProperty.GetValues(Proc: TGetStrProc); +begin + Proc(DefaultColorText); + inherited; +end; + +procedure TdxLayoutColorProperty.SetValue(const Value: string); +begin + if SameText(Value, DefaultColorText) then + SetOrdValue(clDefault) + else + inherited; +end; + +procedure TdxLayoutColorProperty.ListDrawValue(const Value: string; + ACanvas: TCanvas; const ARect: TRect; ASelected: Boolean); +begin + if Value = DefaultColorText then + with ARect do + ACanvas.TextRect(ARect, Left + (Bottom - Top) + 1, Top + 1, Value) + else + inherited; +end; + +procedure TdxLayoutColorProperty.PropDrawValue(ACanvas: TCanvas; + const ARect: TRect; ASelected: Boolean); +begin + if GetVisualValue = DefaultColorText then + with ARect do + ACanvas.TextRect(ARect, Left + 1, Top + 1, GetVisualValue) + else + inherited; +end; + +{ TdxLayoutRegistryPathProperty } + +type + TdxLayoutRegistryPathProperty = class(TStringProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + +procedure TdxLayoutRegistryPathProperty.Edit; +var + AControl: TdxLayoutControl; + S: string; +begin + AControl := TdxLayoutControl(GetComponent(0)); + S := AControl.RegistryPath; + if dxGetRegistryPath(S) then + begin + AControl.RegistryPath := S; + Designer.Modified; + end; +end; + +function TdxLayoutRegistryPathProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog]; +end; + +procedure Register; +begin + RegisterComponentEditor(TdxLayoutControl, TdxLayoutControlEditor); + RegisterComponentEditor(TdxLayoutLookAndFeelList, TdxLayoutLookAndFeelListEditor); + + RegisterPropertyEditor(TypeInfo(TColor), TdxCustomLayoutLookAndFeelOptions, '', + TdxLayoutColorProperty); + RegisterPropertyEditor(TypeInfo(TColor), TdxLayoutLookAndFeelCaptionOptions, '', + TdxLayoutColorProperty); + + RegisterPropertyEditor(TypeInfo(string), TdxLayoutControl, 'RegistryPath', + TdxLayoutRegistryPathProperty); + + RegisterNoIcon([TdxLayoutItem, TdxLayoutGroup, TdxLayoutAlignmentConstraint, + TdxLayoutStandardLookAndFeel, TdxLayoutOfficeLookAndFeel, TdxLayoutWebLookAndFeel]); + RegisterComponents('ExpressLayoutControl', [TdxLayoutControl, TdxLayoutLookAndFeelList]) +end; + +end. diff --git a/official/x.35/ExpressLayout Control/Sources/dxLayoutCustomizeForm.dfm b/official/x.35/ExpressLayout Control/Sources/dxLayoutCustomizeForm.dfm new file mode 100644 index 00000000..17fc09db --- /dev/null +++ b/official/x.35/ExpressLayout Control/Sources/dxLayoutCustomizeForm.dfm @@ -0,0 +1,172 @@ +object LayoutCustomizeForm: TLayoutCustomizeForm + Left = 219 + Top = 183 + BorderStyle = bsSizeToolWin + Caption = 'LayoutCustomizeForm' + ClientHeight = 297 + ClientWidth = 223 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnClose = FormClose + PixelsPerInch = 96 + TextHeight = 13 + object LayoutControl: TdxLayoutControl + Left = 0 + Top = 0 + Width = 223 + Height = 297 + Align = alClient + TabOrder = 0 + AutoContentSizes = [acsWidth, acsHeight] + LookAndFeel = lfStandard + object pcMain: TPageControl + Left = 4 + Top = 4 + Width = 217 + Height = 241 + ActivePage = tshItems + TabOrder = 0 + object tshItems: TTabSheet + Caption = 'Items' + object lcItems: TdxLayoutControl + Left = 0 + Top = 0 + Width = 209 + Height = 213 + Align = alClient + TabOrder = 0 + AutoContentSizes = [acsWidth, acsHeight] + LookAndFeel = lfStandard + object lbItems: TListBox + Left = 6 + Top = 6 + Width = 129 + Height = 145 + Style = lbOwnerDrawFixed + BorderStyle = bsNone + Color = clBtnFace + ItemHeight = 13 + TabOrder = 0 + OnDrawItem = lbItemsDrawItem + OnMeasureItem = lbItemsMeasureItem + end + object lcItemsGroup_Root: TdxLayoutGroup + ShowCaption = False + Hidden = True + ShowBorder = False + object lcItemsItem1: TdxLayoutItem + AutoAligns = [aaHorizontal] + AlignVert = avClient + Control = lbItems + end + end + end + end + object tshGroups: TTabSheet + Caption = 'Groups' + ImageIndex = 1 + object lcGroups: TdxLayoutControl + Left = 0 + Top = 0 + Width = 209 + Height = 213 + Align = alClient + TabOrder = 0 + AutoContentSizes = [acsWidth, acsHeight] + LookAndFeel = lfStandard + object lbGroups: TListBox + Left = 6 + Top = 6 + Width = 145 + Height = 149 + Style = lbOwnerDrawFixed + BorderStyle = bsNone + Color = clBtnFace + ItemHeight = 13 + TabOrder = 0 + OnClick = lbGroupsClick + OnDrawItem = lbGroupsDrawItem + OnMeasureItem = lbGroupsMeasureItem + end + object btnGroupsCreate: TButton + Left = 25 + Top = 234 + Width = 75 + Height = 23 + Caption = 'Create' + TabOrder = 1 + OnClick = btnGroupsCreateClick + end + object btnGroupsDelete: TButton + Left = 106 + Top = 234 + Width = 75 + Height = 23 + Caption = 'Delete' + TabOrder = 2 + OnClick = btnGroupsDeleteClick + end + object lcGroupsGroup_Root: TdxLayoutGroup + ShowCaption = False + Hidden = True + ShowBorder = False + object lcGroupsItem1: TdxLayoutItem + AutoAligns = [aaHorizontal] + AlignVert = avClient + Control = lbGroups + end + object lcGroupsGroup1: TdxLayoutGroup + AutoAligns = [aaVertical] + AlignHorz = ahCenter + ShowCaption = False + Hidden = True + LayoutDirection = ldHorizontal + ShowBorder = False + object lcGroupsItem4: TdxLayoutItem + AutoAligns = [aaVertical] + AlignHorz = ahClient + Caption = 'Button1' + ShowCaption = False + Control = btnGroupsCreate + ControlOptions.ShowBorder = False + end + object lcGroupsItem2: TdxLayoutItem + AutoAligns = [aaVertical] + AlignHorz = ahClient + Caption = 'Button2' + ShowCaption = False + Control = btnGroupsDelete + ControlOptions.ShowBorder = False + end + end + end + end + end + end + object LayoutControlGroup_Root: TdxLayoutGroup + ShowCaption = False + Hidden = True + ShowBorder = False + object LayoutControlItem1: TdxLayoutItem + AutoAligns = [aaHorizontal] + AlignVert = avClient + Control = pcMain + ControlOptions.ShowBorder = False + end + end + end + object LookAndFeels: TdxLayoutLookAndFeelList + Left = 154 + Top = 66 + object lfStandard: TdxLayoutStandardLookAndFeel + ItemOptions.ControlBorderStyle = lbsFlat + Offsets.RootItemsAreaOffsetHorz = 3 + Offsets.RootItemsAreaOffsetVert = 3 + end + end +end diff --git a/official/x.35/ExpressLayout Control/Sources/dxLayoutCustomizeForm.pas b/official/x.35/ExpressLayout Control/Sources/dxLayoutCustomizeForm.pas new file mode 100644 index 00000000..e3f6eff3 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Sources/dxLayoutCustomizeForm.pas @@ -0,0 +1,391 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressLayoutControl customize form } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSLAYOUTCONTROL AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxLayoutCustomizeForm; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + ComCtrls, dxLayoutControl, StdCtrls, dxLayoutLookAndFeels, cxControls; + +type + TLayoutCustomizeFormClass = class of TLayoutCustomizeForm; + + TLayoutCustomizeForm = class(TForm) + LayoutControl: TdxLayoutControl; + pcMain: TPageControl; + LayoutControlItem1: TdxLayoutItem; + tshItems: TTabSheet; + tshGroups: TTabSheet; + lcItems: TdxLayoutControl; + lbItems: TListBox; + lcItemsItem1: TdxLayoutItem; + lcGroups: TdxLayoutControl; + lbGroups: TListBox; + lcGroupsItem1: TdxLayoutItem; + btnGroupsCreate: TButton; + lcGroupsItem4: TdxLayoutItem; + btnGroupsDelete: TButton; + lcGroupsItem2: TdxLayoutItem; + lcGroupsGroup1: TdxLayoutGroup; + LookAndFeels: TdxLayoutLookAndFeelList; + lfStandard: TdxLayoutStandardLookAndFeel; + LayoutControlGroup_Root: TdxLayoutGroup; + lcGroupsGroup_Root: TdxLayoutGroup; + lcItemsGroup_Root: TdxLayoutGroup; + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure lbGroupsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure lbGroupsMeasureItem(Control: TWinControl; Index: Integer; + var Height: Integer); + procedure lbItemsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure lbItemsMeasureItem(Control: TWinControl; Index: Integer; + var Height: Integer); + procedure lbGroupsClick(Sender: TObject); + procedure btnGroupsCreateClick(Sender: TObject); + procedure btnGroupsDeleteClick(Sender: TObject); + private + FControl: TdxCustomLayoutControl; + FOriginalBoundsRect: TRect; + procedure CalculateBounds; + protected + procedure CreateParams(var Params: TCreateParams); override; + + procedure AssignCaptions; virtual; + procedure CheckGroupsButtons; virtual; + procedure FillGroupsListBox; virtual; + procedure FillItemsListBox; virtual; + procedure FillListBox(AListBox: TCustomListBox; AFillWithGroups: Boolean); virtual; + function GetGroupsItemHeight: Integer; virtual; + function GetItemsItemHeight: Integer; virtual; + function IsItemVisibleInListBox(AItem: TdxCustomLayoutItem): Boolean; virtual; + + property Control: TdxCustomLayoutControl read FControl; + public + constructor Create(AControl: TdxCustomLayoutControl); reintroduce; virtual; + destructor Destroy; override; + procedure AvailableItemListChanged(AItem: TdxCustomLayoutItem; + AIsItemAdded: Boolean); virtual; + procedure DragAndDropBegan; virtual; + end; + +resourcestring + dxLayoutCustomizeFormCaption = 'Customize'; + dxLayoutCustomizeFormItemsCaption = 'Items'; + dxLayoutCustomizeFormGroupsCaption = 'Groups'; + dxLayoutCustomizeFormGroupsCreateCaption = 'Create...'; + dxLayoutCustomizeFormGroupsDeleteCaption = 'Delete'; + +implementation + +{$R *.DFM} + +uses + cxClasses, dxLayoutCommon, dxLayoutEditForm; + +type + TLayoutControlAccess = class(TdxCustomLayoutControl); + +{ TLayoutCustomizeForm } + +constructor TLayoutCustomizeForm.Create(AControl: TdxCustomLayoutControl); + + procedure ReplaceListBox(var AControl: TListBox; AItem: TdxLayoutItem); + var + AListBox: TListBox; + begin + AListBox := TdxLayoutCustomizeListBox.Create(Owner); + TdxLayoutCustomizeListBox(AListBox).Control := FControl; + AListBox.Style := AControl.Style; + AListBox.OnClick := AControl.OnClick; + AListBox.OnDrawItem := AControl.OnDrawItem; + AListBox.OnMeasureItem := AControl.OnMeasureItem; + + AItem.Control := AListBox; + AItem.ControlOptions.AutoColor := True; + + AControl.Free; + AControl := AListBox; + end; + +begin + FControl := AControl; + inherited Create(nil); +{$IFDEF DELPHI7} + LayoutControl.ParentBackground := True; + lcItems.ParentBackground := True; + lcGroups.ParentBackground := True; +{$ENDIF} + AssignCaptions; + + ReplaceListBox(lbItems, lcItemsItem1); + lbItems.ItemHeight := GetItemsItemHeight; + ReplaceListBox(lbGroups, lcGroupsItem1); + lbGroups.ItemHeight := GetGroupsItemHeight; + + CalculateBounds; + FOriginalBoundsRect := BoundsRect; + + AvailableItemListChanged(nil, False); +end; + +destructor TLayoutCustomizeForm.Destroy; +var + R: TRect; +begin + R := BoundsRect; + if not CompareMem(@R, @FOriginalBoundsRect, SizeOf(TRect)) then + FControl.CustomizeFormBounds := R; + FControl.Customization := False; + inherited; +end; + +procedure TLayoutCustomizeForm.CalculateBounds; +var + R: TRect; +begin + R := BoundsRect; + with TLayoutControlAccess(FControl) do + if IsRectEmpty(CustomizeFormBounds) then + R := CalculateCustomizeFormBounds(R) + else + R := CustomizeFormBounds; + BoundsRect := R; +end; + +procedure TLayoutCustomizeForm.CreateParams(var Params: TCreateParams); +begin + inherited; + Params.WndParent := FControl.Handle; +end; + +procedure TLayoutCustomizeForm.AssignCaptions; +begin + Caption := cxGetResourceString(@dxLayoutCustomizeFormCaption); + tshItems.Caption := cxGetResourceString(@dxLayoutCustomizeFormItemsCaption); + tshGroups.Caption := cxGetResourceString(@dxLayoutCustomizeFormGroupsCaption); + btnGroupsCreate.Caption := cxGetResourceString(@dxLayoutCustomizeFormGroupsCreateCaption); + btnGroupsDelete.Caption := cxGetResourceString(@dxLayoutCustomizeFormGroupsDeleteCaption); +end; + +procedure TLayoutCustomizeForm.CheckGroupsButtons; +begin + with TdxLayoutCustomizeListBox(lbGroups) do + btnGroupsDelete.Enabled := + (ItemObject <> nil) and TdxLayoutGroup(ItemObject).IsUserDefined; +end; + +procedure TLayoutCustomizeForm.FillGroupsListBox; +begin + FillListBox(lbGroups, True); + CheckGroupsButtons; +end; + +procedure TLayoutCustomizeForm.FillItemsListBox; +begin + FillListBox(lbItems, False); +end; + +procedure TLayoutCustomizeForm.FillListBox(AListBox: TCustomListBox; + AFillWithGroups: Boolean); +var + AItemIndex, I: Integer; + AItem: TdxCustomLayoutItem; +begin + with AListBox, Items do + begin + AItemIndex := ItemIndex; + BeginUpdate; + try + Clear; + for I := 0 to Control.AvailableItemCount - 1 do + begin + AItem := Control.AvailableItems[I]; + if (AFillWithGroups and (AItem is TdxLayoutGroup) or + not AFillWithGroups and (AItem is TdxLayoutItem)) and + IsItemVisibleInListBox(AItem) then + AddObject(AItem.CaptionForCustomizeForm, AItem); + end; + if AItemIndex < Count then + ItemIndex := AItemIndex + else + ItemIndex := Count - 1; + finally + EndUpdate; + end; + end; +end; + +function TLayoutCustomizeForm.GetGroupsItemHeight: Integer; +begin + Result := lbGroups.Canvas.TextHeight('Qq') + 5 + 5; +end; + +function TLayoutCustomizeForm.GetItemsItemHeight: Integer; +begin + Result := lbItems.Canvas.TextHeight('Qq') + 4 + 4;; +end; + +type + TdxCustomLayoutItemAccess = class(TdxCustomLayoutItem); + +function TLayoutCustomizeForm.IsItemVisibleInListBox(AItem: TdxCustomLayoutItem): Boolean; +begin + Result := TdxCustomLayoutItemAccess(AItem).GetVisible; +end; + +procedure TLayoutCustomizeForm.AvailableItemListChanged(AItem: TdxCustomLayoutItem; + AIsItemAdded: Boolean); + + function GetListBox: TListBox; + begin + if AItem is TdxLayoutItem then + Result := lbItems + else + Result := lbGroups; + end; + +begin + if (AItem = nil) or (AItem is TdxLayoutGroup) then + FillGroupsListBox; + if (AItem = nil) or (AItem is TdxLayoutItem) then + FillItemsListBox; + if AIsItemAdded then + TdxLayoutCustomizeListBox(GetListBox).ItemObject := AItem; +end; + +procedure TLayoutCustomizeForm.DragAndDropBegan; +begin + if TdxLayoutControlDragAndDropObject(Control.DragAndDropObject).SourceItem is TdxLayoutItem then + pcMain.ActivePage := tshItems + else + pcMain.ActivePage := tshGroups; +end; + +procedure TLayoutCustomizeForm.FormClose(Sender: TObject; + var Action: TCloseAction); +begin + Action := caFree; +end; + +procedure TLayoutCustomizeForm.lbGroupsDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +begin + with TCustomListBox(Control), Canvas do + begin + DrawEdge(Handle, Rect, BDR_RAISEDINNER, BF_RECT); + if odFocused in State then DrawFocusRect(Rect); + InflateRect(Rect, -1, -1); + TextRect(Rect, Rect.Left + 4, Rect.Top + 4, Items[Index]); + end; +end; + +procedure TLayoutCustomizeForm.lbGroupsMeasureItem(Control: TWinControl; + Index: Integer; var Height: Integer); +begin + Height := TCustomListBox(Control).Canvas.TextHeight('Qq') + 5 + 5; +end; + +procedure TLayoutCustomizeForm.lbItemsDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +var + ABrushColor: TColor; +begin + with TCustomListBox(Control), Canvas do + begin + TextRect(Rect, Rect.Left + 4, Rect.Top + 4, Items[Index]); + if odFocused in State then DrawFocusRect(Rect); + + Inc(Rect.Left, 4 + TextWidth(Items[Index])); + InflateRect(Rect, -4, -2); + if Rect.Right - Rect.Left > 0 then + begin + ABrushColor := Brush.Color; + Brush.Color := Font.Color; + FrameRect(Rect); + InflateRect(Rect, -1, -1); + Brush.Style := bsBDiagonal; + SetBkColor(Handle, ColorToRGB(ABrushColor)); + FillRect(Rect); + Brush.Style := bsSolid; + end; + end; +end; + +procedure TLayoutCustomizeForm.lbItemsMeasureItem(Control: TWinControl; + Index: Integer; var Height: Integer); +begin + Height := TCustomListBox(Control).Canvas.TextHeight('Qq') + 4 + 4; +end; + +procedure TLayoutCustomizeForm.lbGroupsClick(Sender: TObject); +begin + CheckGroupsButtons; +end; + +procedure TLayoutCustomizeForm.btnGroupsCreateClick(Sender: TObject); +var + AGroupCaption: string; + AGroup: TdxLayoutGroup; +begin + AGroupCaption := cxGetResourceString(@dxLayoutNewGroupCaption); + if TLayoutEditForm.Run(cxGetResourceString(@dxLayoutNewGroupDialogCaption), + cxGetResourceString(@dxLayoutNewGroupDialogEditCaption), AGroupCaption) then + begin + AGroup := Control.CreateGroup; + AGroup.Caption := AGroupCaption; + FillGroupsListBox; + TdxLayoutCustomizeListBox(lbGroups).ItemObject := AGroup; + end; +end; + +procedure TLayoutCustomizeForm.btnGroupsDeleteClick(Sender: TObject); +var + I: Integer; +begin + with TdxLayoutGroup(TdxLayoutCustomizeListBox(lbGroups).ItemObject) do + begin + for I := Count - 1 downto 0 do + Items[I].Parent := nil; + Free; + end; +end; + +end. diff --git a/official/x.35/ExpressLayout Control/Sources/dxLayoutDesignCommon.pas b/official/x.35/ExpressLayout Control/Sources/dxLayoutDesignCommon.pas new file mode 100644 index 00000000..fd03a9bc --- /dev/null +++ b/official/x.35/ExpressLayout Control/Sources/dxLayoutDesignCommon.pas @@ -0,0 +1,664 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressLayoutControl design-time common classes } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSLAYOUTCONTROL AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxLayoutDesignCommon; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, Forms, StdCtrls, dxLayoutCommon, dxLayoutControl, dxLayoutLookAndFeels, + {$IFDEF DELPHI6}DesignIntf, DesignEditors, ComponentDesigner, VCLEditors, DesignWindows{$ELSE} + DsgnIntf, LibIntf, DsgnWnds{$ENDIF}; + +type + TFormDesigner = {$IFDEF DELPHI6}IDesigner{$ELSE}IFormDesigner{$ENDIF}; +{$IFDEF DELPHI6} + TDesignerSelectionList = TDesignerSelections; +{$ENDIF} + TDesignerSelectionListAccess = class(TDesignerSelectionList) + public + property Count; + property Items; + end; + + TdxLayoutDesignFormClass = class of TdxLayoutDesignForm; + + TdxLayoutDesignForm = class(TDesignWindow) + private + FComponent: TComponent; + FDeletingComponents: Boolean; + FSelectingComponents: Boolean; + protected + procedure DoClose(var Action: TCloseAction); override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + function UniqueName(Component: TComponent): string; override; + + function CalculateListBoxItemHeight(AListBox: TListBox = nil): Integer; + function CanModify: Boolean; virtual; + procedure DeleteItemsButtonClick(Sender: TObject); + function GetAddItemsButton(AIndex: Integer): TButton; virtual; abstract; + function GetAddItemsButtonCount: Integer; virtual; abstract; + function GetDeleteItemsButton: TButton; virtual; abstract; + function GetItemsListBox: TListBox; virtual; abstract; + function GetSelectedItems(AListBox: TListBox = nil): TDesignerSelectionListAccess; + procedure ItemsListBoxClick(Sender: TObject); virtual; + function NeedRefreshItemsAfterDeleting(AComponent: TPersistent): Boolean; virtual; + procedure RefreshEnableds; virtual; + procedure RefreshItemsListBox; virtual; abstract; + procedure SetComponent(Value: TComponent); virtual; + + property DeletingComponents: Boolean read FDeletingComponents write FDeletingComponents; + property SelectingComponents: Boolean read FSelectingComponents write FSelectingComponents; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure AfterConstruction; override; + + {$IFDEF DELPHI6} + procedure ItemDeleted(const ADesigner: IDesigner; Item: TPersistent); override; + {$ELSE} + procedure ComponentDeleted(Component: IPersistent); override; + {$ENDIF} + {$IFDEF DELPHI6} + procedure SelectionChanged(const ADesigner: IDesigner; const ASelection: IDesignerSelections); override; + {$ELSE} + procedure SelectionChanged(ASelection: TDesignerSelectionList); override; + {$ENDIF} + + procedure RefreshCaption; virtual; + procedure RefreshItems; virtual; + property Component: TComponent read FComponent write SetComponent; + end; + + PDesignFormRecord = ^TDesignFormRecord; + TDesignFormRecord = record + Component: TComponent; + Form: TdxLayoutDesignForm; + end; + + TdxLayoutRealDesigner = class(TdxLayoutDesigner{$IFDEF DELPHI6}, IDesignNotification{$ENDIF}) + private + FComponents: TList; + FDesignFormRecords: TList; + function GetComponent(Index: Integer): TComponent; + function GetComponentCount: Integer; + function GetDesignFormRecordCount: Integer; + function GetDesignFormRecord(Index: Integer): PDesignFormRecord; + //procedure ClearDesignFormRecords; + procedure DeleteDesignFormRecord(ADesignFormRecord: PDesignFormRecord); + protected + {$IFDEF DELPHI6} + // IDesignNotification + procedure ItemDeleted(const ADesigner: IDesigner; AItem: TPersistent); + procedure ItemInserted(const ADesigner: IDesigner; AItem: TPersistent); + procedure ItemsModified(const ADesigner: IDesigner); + procedure SelectionChanged(const ADesigner: IDesigner; + const ASelection: IDesignerSelections); + procedure DesignerOpened(const ADesigner: IDesigner; AResurrecting: Boolean); + procedure DesignerClosed(const ADesigner: IDesigner; AGoingDormant: Boolean); + {$ENDIF} + + function FindDesignFormRecord(AComponent: TComponent): PDesignFormRecord; + function GetFormDesigner(AComponent: TComponent): TFormDesigner; + function GetDesignForm(AComponent: TComponent): TdxLayoutDesignForm; + function GetDesignFormClass(AComponent: TComponent): TdxLayoutDesignFormClass; + + property ComponentCount: Integer read GetComponentCount; + property Components[Index: Integer]: TComponent read GetComponent; + property DesignFormRecordCount: Integer read GetDesignFormRecordCount; + property DesignFormRecords[Index: Integer]: PDesignFormRecord read GetDesignFormRecord; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + procedure RegisterComponent(AComponent: TComponent); override; + procedure UnregisterComponent(AComponent: TComponent); override; + + procedure ComponentNameChanged(AComponent: TComponent); override; + function GetDesigner(AComponent: TComponent): TCustomForm; override; + function GetUniqueName(AComponent: TComponent; const ABaseName: string): string; override; + function IsComponentSelected(AComponent: TComponent; APersistent: TPersistent): Boolean; override; + function IsToolSelected: Boolean; override; + procedure ItemsChanged(AComponent: TComponent); override; + procedure SelectComponent(AComponent: TComponent; APersistent: TPersistent; + AInvertSelection: Boolean); override; + + procedure HideDesignForm(AComponent: TComponent); + procedure ShowDesignForm(AComponent: TComponent; AFormDesigner: TFormDesigner); + end; + +implementation + +uses + SysUtils, Controls, Graphics, dxLayoutDesignForm, dxLayoutLookAndFeelListDesignForm; + +{ TdxLayoutDesignForm } + +constructor TdxLayoutDesignForm.Create(AOwner: TComponent); +begin + inherited; + BorderIcons := [biSystemMenu]; +end; + +destructor TdxLayoutDesignForm.Destroy; +begin + if not (csDestroying in Component.ComponentState) then + Designer.SelectComponent(Component); + TdxLayoutRealDesigner(dxLayoutDesigner).HideDesignForm(Component); + inherited; +end; + +procedure TdxLayoutDesignForm.DoClose(var Action: TCloseAction); +begin + Action := caFree; + inherited; +end; + +procedure TdxLayoutDesignForm.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited; + if (Operation = opRemove) and (AComponent = Component) then + Free; +end; + +function TdxLayoutDesignForm.UniqueName(Component: TComponent): string; +begin + Result := Designer.UniqueName(Component.ClassName); +end; + +function TdxLayoutDesignForm.CalculateListBoxItemHeight(AListBox: TListBox): Integer; +begin + if AListBox = nil then + AListBox := GetItemsListBox; + Result := 2 + AListBox.Canvas.TextHeight('Qq') + 2; +end; + +function TdxLayoutDesignForm.CanModify: Boolean; +begin + Result := not Designer.IsSourceReadOnly and + not (csInline in FComponent.Owner.ComponentState); +end; + +procedure TdxLayoutDesignForm.DeleteItemsButtonClick(Sender: TObject); +var + ASelections: TDesignerSelectionListAccess; + I: Integer; +begin + FDeletingComponents := True; + try + ASelections := GetSelectedItems; + try + if ASelections.Count <> 0 then + try + Designer.SelectComponent(Component); + for I := 0 to ASelections.Count - 1 do + ASelections[I].Free; + finally + RefreshItemsListBox; + Designer.Modified; + end; + finally + ASelections.Free; + end; + finally + FDeletingComponents := False; + end; +end; + +function TdxLayoutDesignForm.GetSelectedItems(AListBox: TListBox): TDesignerSelectionListAccess; +var + I: Integer; +begin + if AListBox = nil then + AListBox := GetItemsListBox; + Result := TDesignerSelectionListAccess.Create; + with AListBox, Items do + for I := 0 to Count - 1 do + if Selected[I] and (Objects[I] <> nil) then + Result.Add(TPersistent(Objects[I])); +end; + +procedure TdxLayoutDesignForm.ItemsListBoxClick(Sender: TObject); +var + ASelections: TDesignerSelectionListAccess; +begin + ASelections := GetSelectedItems(Sender as TListBox); + with ASelections do + if Count = 0 then Add(Component); + FSelectingComponents := True; + try + Designer.SetSelections(ASelections); + finally + FSelectingComponents := False; + RefreshEnableds; + end; +end; + +function TdxLayoutDesignForm.NeedRefreshItemsAfterDeleting(AComponent: TPersistent): Boolean; +begin + Result := not (csDestroying in Component.ComponentState); +end; + +procedure TdxLayoutDesignForm.RefreshEnableds; +var + ASelections: TDesignerSelectionListAccess; + I: Integer; +begin + ASelections := GetSelectedItems; + try + for I := 0 to GetAddItemsButtonCount - 1 do + GetAddItemsButton(I).Enabled := CanModify; + GetDeleteItemsButton.Enabled := CanModify and (ASelections.Count <> 0); + finally + ASelections.Free; + end; +end; + +procedure TdxLayoutDesignForm.SetComponent(Value: TComponent); +begin + FComponent := Value; + FComponent.FreeNotification(Self); + RefreshCaption; + RefreshItemsListBox; + RefreshEnableds; +end; + +procedure TdxLayoutDesignForm.AfterConstruction; +begin + inherited; + with GetItemsListBox do + begin + ItemHeight := CalculateListBoxItemHeight; + OnClick := ItemsListBoxClick; + end; + GetDeleteItemsButton.OnClick := DeleteItemsButtonClick; +end; + +{$IFDEF DELPHI6} +procedure TdxLayoutDesignForm.ItemDeleted(const ADesigner: IDesigner; Item: TPersistent); +{$ELSE} +procedure TdxLayoutDesignForm.ComponentDeleted(Component: IPersistent); +{$ENDIF} +var + AComponent: TPersistent; +begin + inherited; + if FDeletingComponents then Exit; +{$IFDEF DELPHI6} + AComponent := Item; +{$ELSE} + AComponent := ExtractPersistent(Component); +{$ENDIF} + if NeedRefreshItemsAfterDeleting(AComponent) then + RefreshItems; +end; + +{$IFDEF DELPHI6} +procedure TdxLayoutDesignForm.SelectionChanged(const ADesigner: IDesigner; const ASelection: IDesignerSelections); +{$ELSE} +procedure TdxLayoutDesignForm.SelectionChanged(ASelection: TDesignerSelectionList); +{$ENDIF} +var + I, AIndex: Integer; +{$IFNDEF DELPHI6} + ALayoutComponent: IdxLayoutComponent; +{$ENDIF} +begin + inherited; +{$IFNDEF DELPHI6} + if Component.GetInterface(IdxLayoutComponent, ALayoutComponent) then + ALayoutComponent.SelectionChanged; +{$ENDIF} + if FSelectingComponents then Exit; + with GetItemsListBox, Items do + begin + BeginUpdate; + try + for I := 0 to Count - 1 do + Selected[I] := False; + if ASelection <> nil then + for I := 0 to ASelection.Count - 1 do + begin + AIndex := IndexOfObject(ASelection[I]); + if AIndex <> -1 then + Selected[AIndex] := True; + end; + finally + EndUpdate; + RefreshEnableds; + end; + end; +end; + +procedure TdxLayoutDesignForm.RefreshCaption; +begin + Caption := 'Designer - ' + FComponent.Name; +end; + +procedure TdxLayoutDesignForm.RefreshItems; +var + ASelections: IDesignerSelections; +begin + ASelections := CreateSelectionList; + Designer.GetSelections(ASelections); + RefreshItemsListBox; +{$IFDEF DELPHI6} + SelectionChanged(Designer, ASelections); +{$ELSE} + SelectionChanged(ASelections); +{$ENDIF} +end; + +{ TdxLayoutRealDesigner } + +constructor TdxLayoutRealDesigner.Create(AOwner: TComponent); +begin + inherited; + FComponents := TList.Create; + FDesignFormRecords := TList.Create; +{$IFDEF DELPHI6} + RegisterDesignNotification(Self); +{$ENDIF} +end; + +destructor TdxLayoutRealDesigner.Destroy; +begin +{$IFDEF DELPHI6} + UnregisterDesignNotification(Self); +{$ENDIF} + FComponents.Free; + //ClearDesignFormRecords; + FDesignFormRecords.Free; + inherited; +end; + +function TdxLayoutRealDesigner.GetComponent(Index: Integer): TComponent; +begin + Result := FComponents[Index]; +end; + +function TdxLayoutRealDesigner.GetComponentCount: Integer; +begin + Result := FComponents.Count; +end; + +function TdxLayoutRealDesigner.GetDesignFormRecordCount: Integer; +begin + Result := FDesignFormRecords.Count; +end; + +function TdxLayoutRealDesigner.GetDesignFormRecord(Index: Integer): PDesignFormRecord; +begin + Result := FDesignFormRecords[Index]; +end; + +{procedure TdxLayoutRealDesigner.ClearDesignFormRecords; +var + I: Integer; +begin + for I := DesignFormRecordCount - 1 downto 0 do + DeleteDesignFormRecord(DesignFormRecords[I]); +end;} + +procedure TdxLayoutRealDesigner.DeleteDesignFormRecord(ADesignFormRecord: PDesignFormRecord); +begin + FDesignFormRecords.Remove(ADesignFormRecord); + Dispose(ADesignFormRecord); +end; + +{$IFDEF DELPHI6} + +procedure TdxLayoutRealDesigner.ItemDeleted(const ADesigner: IDesigner; AItem: TPersistent); +begin +end; + +procedure TdxLayoutRealDesigner.ItemInserted(const ADesigner: IDesigner; AItem: TPersistent); +begin +end; + +procedure TdxLayoutRealDesigner.ItemsModified(const ADesigner: IDesigner); +begin +end; + +procedure TdxLayoutRealDesigner.SelectionChanged(const ADesigner: IDesigner; + const ASelection: IDesignerSelections); +var + I: Integer; + ALayoutComponent: IdxLayoutComponent; + + function HasAsOwner(AComponent, AOwner: TComponent): Boolean; + begin + repeat + Result := AComponent.Owner = AOwner; + AComponent := AComponent.Owner; + until Result or (AComponent = nil); + end; + +begin + for I := 0 to ComponentCount - 1 do + if ((ADesigner = nil) or HasAsOwner(Components[I], ADesigner.GetRoot)) and + Components[I].GetInterface(IdxLayoutComponent, ALayoutComponent) then + ALayoutComponent.SelectionChanged; +end; + +procedure TdxLayoutRealDesigner.DesignerOpened(const ADesigner: IDesigner; + AResurrecting: Boolean); +begin +end; + +procedure TdxLayoutRealDesigner.DesignerClosed(const ADesigner: IDesigner; + AGoingDormant: Boolean); +begin +end; + +{$ENDIF} + +function TdxLayoutRealDesigner.FindDesignFormRecord(AComponent: TComponent): PDesignFormRecord; +var + I: Integer; +begin + for I := 0 to DesignFormRecordCount - 1 do + begin + Result := DesignFormRecords[I]; + if Result^.Component = AComponent then Exit; + end; + Result := nil; +end; + +function TdxLayoutRealDesigner.GetFormDesigner(AComponent: TComponent): TFormDesigner; +begin + Result := FindRootDesigner(AComponent) as TFormDesigner; +end; + +function TdxLayoutRealDesigner.GetDesignForm(AComponent: TComponent): TdxLayoutDesignForm; +var + ADesignFormRecord: PDesignFormRecord; +begin + ADesignFormRecord := FindDesignFormRecord(AComponent); + if ADesignFormRecord = nil then + Result := nil + else + Result := ADesignFormRecord^.Form; +end; + +function TdxLayoutRealDesigner.GetDesignFormClass(AComponent: TComponent): TdxLayoutDesignFormClass; +begin + if AComponent is TdxCustomLayoutControl then + Result := TDesignForm + else + if AComponent is TdxLayoutLookAndFeelList then + Result := TLookAndFeelListDesignForm + else + Result := nil; +end; + +procedure TdxLayoutRealDesigner.RegisterComponent(AComponent: TComponent); +begin + FComponents.Add(AComponent); +end; + +procedure TdxLayoutRealDesigner.UnregisterComponent(AComponent: TComponent); +begin + FComponents.Remove(AComponent); +end; + +procedure TdxLayoutRealDesigner.ComponentNameChanged(AComponent: TComponent); +var + ADesignForm: TdxLayoutDesignForm; +begin + ADesignForm := GetDesignForm(AComponent); + if ADesignForm <> nil then ADesignForm.RefreshCaption; +end; + +function TdxLayoutRealDesigner.GetDesigner(AComponent: TComponent): TCustomForm; +begin + Result := GetDesignForm(AComponent); +end; + +function TdxLayoutRealDesigner.GetUniqueName(AComponent: TComponent; + const ABaseName: string): string; +begin + Result := GetFormDesigner(AComponent).UniqueName(ABaseName); +end; + +function TdxLayoutRealDesigner.IsComponentSelected(AComponent: TComponent; + APersistent: TPersistent): Boolean; +var + ASelections: IDesignerSelections; + I: Integer; +begin + if GetFormDesigner(AComponent) = nil then + Result := False + else + begin + ASelections := CreateSelectionList; + GetFormDesigner(AComponent).GetSelections(ASelections); + for I := 0 to ASelections.Count - 1 do + begin + Result := + {$IFNDEF DELPHI6}ExtractPersistent{$ENDIF}(ASelections[I]) = APersistent; + if Result then Exit; + end; + Result := False; + end; +end; + +function TdxLayoutRealDesigner.IsToolSelected: Boolean; +begin + Result := {$IFDEF DELPHI9}(ActiveDesigner <> nil) and{$ENDIF} + {$IFDEF DELPHI6}ActiveDesigner.Environment{$ELSE}DelphiIDE{$ENDIF}.GetToolSelected; +end; + +procedure TdxLayoutRealDesigner.ItemsChanged(AComponent: TComponent); +var + ADesignForm: TdxLayoutDesignForm; +begin + ADesignForm := GetDesignForm(AComponent); + if ADesignForm <> nil then ADesignForm.RefreshItems; +end; + +procedure TdxLayoutRealDesigner.SelectComponent(AComponent: TComponent; + APersistent: TPersistent; AInvertSelection: Boolean); +var + ASelections, ANewSelections: IDesignerSelections; + I: Integer; + ASelection: TPersistent; +begin + if AInvertSelection then + begin + ASelections := CreateSelectionList; + GetFormDesigner(AComponent).GetSelections(ASelections); + ANewSelections := CreateSelectionList; + for I := 0 to ASelections.Count - 1 do + begin + ASelection := {$IFNDEF DELPHI6}ExtractPersistent{$ENDIF}(ASelections[I]); + if (ASelection <> AComponent) and (ASelection <> APersistent) then + ANewSelections.Add(ASelections[I]); + end; + if IsComponentSelected(AComponent, APersistent) then + if ANewSelections.Count = 0 then + ANewSelections.Add({$IFNDEF DELPHI6}MakeIPersistent{$ENDIF}(AComponent)) + else + else + ANewSelections.Add({$IFNDEF DELPHI6}MakeIPersistent{$ENDIF}(APersistent)); + GetFormDesigner(AComponent).SetSelections(ANewSelections); + end + else + GetFormDesigner(AComponent).SelectComponent(APersistent); +end; + +procedure TdxLayoutRealDesigner.HideDesignForm(AComponent: TComponent); +begin + DeleteDesignFormRecord(FindDesignFormRecord(AComponent)); +end; + +procedure TdxLayoutRealDesigner.ShowDesignForm(AComponent: TComponent; + AFormDesigner: TFormDesigner); +var + ADesignForm: TdxLayoutDesignForm; + ADesignFormRecord: PDesignFormRecord; +begin + ADesignForm := GetDesignForm(AComponent); + if ADesignForm = nil then + begin + ADesignForm := GetDesignFormClass(AComponent).Create(nil); + ADesignForm.Designer := AFormDesigner; + ADesignForm.Component := AComponent; + + New(ADesignFormRecord); + with ADesignFormRecord^ do + begin + Component := AComponent; + Form := ADesignForm; + end; + FDesignFormRecords.Add(ADesignFormRecord); + + ADesignForm.Show; + end + else + ADesignForm.BringToFront; +end; + +initialization + dxLayoutDesigner := TdxLayoutRealDesigner.Create(nil); + +finalization + FreeAndNil(dxLayoutDesigner); + +end. diff --git a/official/x.35/ExpressLayout Control/Sources/dxLayoutDesignForm.dfm b/official/x.35/ExpressLayout Control/Sources/dxLayoutDesignForm.dfm new file mode 100644 index 00000000..9a9a7a6b --- /dev/null +++ b/official/x.35/ExpressLayout Control/Sources/dxLayoutDesignForm.dfm @@ -0,0 +1,221 @@ +object DesignForm: TDesignForm + Left = 423 + Top = 176 + AutoScroll = False + BorderIcons = [biSystemMenu] + ClientHeight = 291 + ClientWidth = 306 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object lcMain: TdxLayoutControl + Left = 0 + Top = 0 + Width = 306 + Height = 291 + Align = alClient + TabOrder = 0 + TabStop = False + AutoContentSizes = [acsWidth, acsHeight] + LookAndFeel = lfStandard + object lbItems: TListBox + Left = 8 + Top = 8 + Width = 173 + Height = 245 + Style = lbOwnerDrawFixed + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + TabOrder = 0 + OnDrawItem = lbItemsDrawItem + end + object btnAddGroup: TButton + Left = 191 + Top = 6 + Width = 85 + Height = 23 + Caption = 'Add Group...' + TabOrder = 1 + OnClick = btnAddGroupClick + end + object btnAddItem: TButton + Left = 191 + Top = 35 + Width = 85 + Height = 23 + Caption = 'Add Item...' + TabOrder = 2 + OnClick = btnAddItemClick + end + object btnDelete: TButton + Left = 191 + Top = 64 + Width = 85 + Height = 23 + Caption = 'Delete' + TabOrder = 3 + end + object btnClose: TButton + Left = 191 + Top = 262 + Width = 85 + Height = 23 + Cancel = True + Caption = 'Close' + Default = True + TabOrder = 6 + OnClick = btnCloseClick + end + object btnAlign: TButton + Left = 191 + Top = 93 + Width = 109 + Height = 23 + Caption = 'Align by...' + TabOrder = 4 + OnClick = btnAlignClick + end + object chbShowHiddenGroupsBounds: TCheckBox + Left = 191 + Top = 122 + Width = 7 + Height = 26 + TabOrder = 5 + OnClick = chbShowHiddenGroupsBoundsClick + end + object TdxLayoutGroup + ShowCaption = False + Hidden = True + LayoutDirection = ldHorizontal + ShowBorder = False + object dxLayoutControl1Item1: TdxLayoutItem + AutoAligns = [] + AlignHorz = ahClient + AlignVert = avClient + Control = lbItems + end + object dxLayoutControl1Group2: TdxLayoutGroup + ShowCaption = False + Hidden = True + ShowBorder = False + object dxLayoutControl1Item2: TdxLayoutItem + Caption = 'Button1' + ShowCaption = False + Control = btnAddGroup + ControlOptions.ShowBorder = False + end + object dxLayoutControl1Item3: TdxLayoutItem + Caption = 'Button2' + ShowCaption = False + Control = btnAddItem + ControlOptions.ShowBorder = False + end + object dxLayoutControl1Item4: TdxLayoutItem + Caption = 'Button3' + ShowCaption = False + Control = btnDelete + ControlOptions.ShowBorder = False + end + object lcMainItem1: TdxLayoutItem + Caption = 'Button1' + ShowCaption = False + Control = btnAlign + ControlOptions.ShowBorder = False + end + object lcMainItem4: TdxLayoutItem + Caption = 'Show Hidden Groups Bounds' + CaptionOptions.Layout = clRight + CaptionOptions.Width = 96 + OnCaptionClick = lcMainItem4CaptionClick + Control = chbShowHiddenGroupsBounds + ControlOptions.ShowBorder = False + end + object lcMainGroup1: TdxLayoutGroup + AutoAligns = [aaHorizontal] + Caption = 'Legend' + LookAndFeel = lfStandardLegend + object lcMainItem2: TdxLayoutItem + Caption = 'Actually Invisible Group/Item' + CaptionOptions.Width = 80 + LookAndFeel = lfStandardBtnFace + end + object lcMainItem3: TdxLayoutItem + Caption = 'Hidden Group ' + LookAndFeel = lfStandardBoldItalic + end + end + object dxLayoutControl1Item5: TdxLayoutItem + AutoAligns = [aaHorizontal] + AlignVert = avBottom + Caption = 'Button4' + ShowCaption = False + Control = btnClose + ControlOptions.ShowBorder = False + end + end + end + end + object lflMain: TdxLayoutLookAndFeelList + Left = 164 + Top = 24 + object lfStandard: TdxLayoutStandardLookAndFeel + Offsets.RootItemsAreaOffsetHorz = 4 + Offsets.RootItemsAreaOffsetVert = 4 + end + object lfStandardBtnFace: TdxLayoutStandardLookAndFeel + ItemOptions.CaptionOptions.TextColor = clBtnFace + end + object lfStandardBoldItalic: TdxLayoutStandardLookAndFeel + ItemOptions.CaptionOptions.Font.Charset = DEFAULT_CHARSET + ItemOptions.CaptionOptions.Font.Color = clWindowText + ItemOptions.CaptionOptions.Font.Height = -11 + ItemOptions.CaptionOptions.Font.Name = 'MS Sans Serif' + ItemOptions.CaptionOptions.Font.Style = [fsBold, fsItalic] + ItemOptions.CaptionOptions.UseDefaultFont = False + end + object lfStandardLegend: TdxLayoutStandardLookAndFeel + GroupOptions.Color = clInfoBk + end + end + object pmAlign: TPopupMenu + Left = 272 + Top = 224 + object Left1: TMenuItem + Caption = 'Left Side' + OnClick = pmAlignItemClick + end + object Right1: TMenuItem + Tag = 2 + Caption = 'Right Side' + OnClick = pmAlignItemClick + end + object N1: TMenuItem + Caption = '-' + end + object op1: TMenuItem + Tag = 1 + Caption = 'Top Side' + OnClick = pmAlignItemClick + end + object Bottom1: TMenuItem + Tag = 3 + Caption = 'Bottom Side' + OnClick = pmAlignItemClick + end + object N2: TMenuItem + Caption = '-' + end + object None1: TMenuItem + Tag = -1 + Caption = 'None' + OnClick = pmAlignItemClick + end + end +end diff --git a/official/x.35/ExpressLayout Control/Sources/dxLayoutDesignForm.pas b/official/x.35/ExpressLayout Control/Sources/dxLayoutDesignForm.pas new file mode 100644 index 00000000..e8bff6b0 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Sources/dxLayoutDesignForm.pas @@ -0,0 +1,424 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressLayoutControl design-time form } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSLAYOUTCONTROL AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxLayoutDesignForm; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + {$IFDEF DELPHI6}DesignIntf, DesignWindows,{$ELSE}DsgnIntf, DsgnWnds,{$ENDIF} + StdCtrls, Menus, cxControls, dxLayoutControl, dxLayoutLookAndFeels, dxLayoutDesignCommon; + +type + TDesignForm = class(TdxLayoutDesignForm) + lcMain: TdxLayoutControl; + lbItems: TListBox; + dxLayoutControl1Item1: TdxLayoutItem; + btnAddGroup: TButton; + dxLayoutControl1Item2: TdxLayoutItem; + btnAddItem: TButton; + dxLayoutControl1Item3: TdxLayoutItem; + btnDelete: TButton; + dxLayoutControl1Item4: TdxLayoutItem; + btnClose: TButton; + dxLayoutControl1Item5: TdxLayoutItem; + dxLayoutControl1Group2: TdxLayoutGroup; + lflMain: TdxLayoutLookAndFeelList; + lfStandard: TdxLayoutStandardLookAndFeel; + lcMainGroup1: TdxLayoutGroup; + lcMainItem2: TdxLayoutItem; + lcMainItem3: TdxLayoutItem; + lfStandardBtnFace: TdxLayoutStandardLookAndFeel; + lfStandardBoldItalic: TdxLayoutStandardLookAndFeel; + lfStandardLegend: TdxLayoutStandardLookAndFeel; + btnAlign: TButton; + lcMainItem1: TdxLayoutItem; + pmAlign: TPopupMenu; + Left1: TMenuItem; + Right1: TMenuItem; + op1: TMenuItem; + Bottom1: TMenuItem; + N1: TMenuItem; + N2: TMenuItem; + None1: TMenuItem; + chbShowHiddenGroupsBounds: TCheckBox; + lcMainItem4: TdxLayoutItem; + procedure btnCloseClick(Sender: TObject); + procedure lbItemsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure btnAddGroupClick(Sender: TObject); + procedure btnAddItemClick(Sender: TObject); + procedure btnAlignClick(Sender: TObject); + procedure pmAlignItemClick(Sender: TObject); + procedure chbShowHiddenGroupsBoundsClick(Sender: TObject); + procedure lcMainItem4CaptionClick(Sender: TObject); + private + FOriginalBoundsRect: TRect; + function GetControl: TdxCustomLayoutControl; + procedure CalculateBounds; + protected + procedure CreateParams(var Params: TCreateParams); override; + function GetAddItemsButton(AIndex: Integer): TButton; override; + function GetAddItemsButtonCount: Integer; override; + function GetDeleteItemsButton: TButton; override; + function GetItemsListBox: TListBox; override; + function NeedRefreshItemsAfterDeleting(AComponent: TPersistent): Boolean; override; + procedure SetComponent(Value: TComponent); override; + + procedure RefreshEnableds; override; + procedure RefreshItemsListBox; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property Control: TdxCustomLayoutControl read GetControl; + end; + +implementation + +{$R *.DFM} + +uses + cxClasses, dxLayoutCommon, dxLayoutEditForm; + +type + TControlAccess = class(TControl); + TLayoutControlAccess = class(TdxCustomLayoutControl); + +constructor TDesignForm.Create(AOwner: TComponent); +var + AListBox: TdxLayoutCustomizeListBox; +begin + inherited; + AListBox := TdxLayoutCustomizeListBox.Create(Self); + AListBox.BoundsRect := lbItems.BoundsRect; + AListBox.MultiSelect := lbItems.MultiSelect; + AListBox.Style := lbItems.Style; + AListBox.OnDrawItem := lbItems.OnDrawItem; + + dxLayoutControl1Item1.Control := AListBox; + lbItems.Free; + lbItems := AListBox; + ActiveControl := lbItems; +end; + +destructor TDesignForm.Destroy; +var + R: TRect; +begin + TLayoutControlAccess(Control).IsCustomizationMode := False; + R := BoundsRect; + if not CompareMem(@R, @FOriginalBoundsRect, SizeOf(TRect)) then + TLayoutControlAccess(Control).DesignFormBounds := R; + inherited; +end; + +function TDesignForm.GetControl: TdxCustomLayoutControl; +begin + Result := TdxCustomLayoutControl(Component); +end; + +procedure TDesignForm.CalculateBounds; +var + R: TRect; +begin + R := BoundsRect; + with TLayoutControlAccess(Control) do + if IsRectEmpty(DesignFormBounds) then + R := CalculateCustomizeFormBounds(R) + else + R := DesignFormBounds; + BoundsRect := R; +end; + +procedure TDesignForm.CreateParams(var Params: TCreateParams); +begin + inherited; + if Control <> nil then + Params.WndParent := Control.Handle; +end; + +function TDesignForm.GetAddItemsButton(AIndex: Integer): TButton; +begin + if AIndex = 0 then + Result := btnAddGroup + else + Result := btnAddItem; +end; + +function TDesignForm.GetAddItemsButtonCount: Integer; +begin + Result := 2; +end; + +function TDesignForm.GetDeleteItemsButton: TButton; +begin + Result := btnDelete; +end; + +function TDesignForm.GetItemsListBox: TListBox; +begin + Result := lbItems; +end; + +function TDesignForm.NeedRefreshItemsAfterDeleting(AComponent: TPersistent): Boolean; +begin + Result := inherited NeedRefreshItemsAfterDeleting(AComponent) and + (AComponent is TdxCustomLayoutItem) and + (TdxCustomLayoutItem(AComponent).Container = Control); +end; + +procedure TDesignForm.SetComponent(Value: TComponent); +begin + inherited; + with TLayoutControlAccess(Control) do + begin + IsCustomizationMode := True; + CustomizationModeForm := Self; + end; + + TdxLayoutCustomizeListBox(lbItems).Control := Control; + chbShowHiddenGroupsBounds.Checked := Control.ShowHiddenGroupsBounds; + + CalculateBounds; + FOriginalBoundsRect := BoundsRect; + + RecreateWnd; +end; + +function CompareItems(Item1, Item2: Pointer): Integer; +var + AName1, AName2: TComponentName; +begin + AName1 := TComponent(Item1).Name; + AName2 := TComponent(Item2).Name; + Result := Length(AName1) - Length(AName2); + if Result = 0 then + Result := CompareText(AName1, AName2); +end; + +procedure TDesignForm.RefreshEnableds; +var + ASelections: TDesignerSelectionListAccess; +begin + inherited; + ASelections := GetSelectedItems; + try + btnAlign.Enabled := CanModify and (ASelections.Count > 1); + finally + ASelections.Free; + end; +end; + +procedure TDesignForm.RefreshItemsListBox; +var + AItems, AGroups: TList; + + procedure ProcessAbsoluteItems; + var + I: Integer; + AItem: TdxCustomLayoutItem; + begin + for I := 0 to Control.AbsoluteItemCount - 1 do + begin + AItem := Control.AbsoluteItems[I]; + if AItem is TdxLayoutItem then + AItems.Add(AItem) + else + AGroups.Add(AItem); + end; + end; + + procedure AddItems(AItems: TList); + var + I: Integer; + AItem: TdxCustomLayoutItem; + begin + for I := 0 to AItems.Count - 1 do + begin + AItem := TdxCustomLayoutItem(AItems[I]); + lbItems.Items.AddObject(AItem.Name, AItem); + end; + end; + +begin + AItems := TList.Create; + AGroups := TList.Create; + try + ProcessAbsoluteItems; + AItems.Sort(CompareItems); + AGroups.Sort(CompareItems); + with lbItems.Items do + begin + BeginUpdate; + try + Clear; + Add('< Groups >'); + AddItems(AGroups); + Add('< Items >'); + AddItems(AItems); + finally + EndUpdate; + end; + end; + finally + AGroups.Free; + AItems.Free; + end; +end; + +procedure TDesignForm.btnCloseClick(Sender: TObject); +begin + Close; +end; + +procedure TDesignForm.lbItemsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); +var + S: string; + AItem: TdxCustomLayoutItem; +begin + with Control as TListBox do + begin + S := Items[Index]; + AItem := TdxCustomLayoutItem(Items.Objects[Index]); + if AItem = nil then + begin + Canvas.Brush.Color := clBtnFace; + Canvas.Font.Color := Font.Color; + Canvas.TextRect(Rect, + (Rect.Left + Rect.Right - Canvas.TextWidth(S)) div 2, Rect.Top + 2, S); + if odFocused in State then + Canvas.DrawFocusRect(Rect); + end + else + begin + if AItem is TdxLayoutGroup then + begin + Canvas.Font.Style := [fsBold]; + if TdxLayoutGroup(AItem).Hidden then + Canvas.Font.Style := Canvas.Font.Style + [fsItalic]; + end; + if not AItem.ActuallyVisible then + Canvas.Font.Color := clBtnFace; + Canvas.TextRect(Rect, Rect.Left + 4, Rect.Top + 2, S); + end; + end; +end; + +procedure TDesignForm.btnAddGroupClick(Sender: TObject); +var + AGroupCaption: string; + AGroup: TdxLayoutGroup; +begin + AGroupCaption := cxGetResourceString(@dxLayoutNewGroupCaption); + if TLayoutEditForm.Run(cxGetResourceString(@dxLayoutNewGroupDialogCaption), + cxGetResourceString(@dxLayoutNewGroupDialogEditCaption), AGroupCaption) then + begin + AGroup := Control.CreateGroup; + AGroup.Caption := AGroupCaption; + Designer.SelectComponent(AGroup); + end; +end; + +procedure TDesignForm.btnAddItemClick(Sender: TObject); +var + AItemCaption: string; + AItem: TdxCustomLayoutItem; +begin + AItemCaption := cxGetResourceString(@dxLayoutNewItemCaption); + if TLayoutEditForm.Run(cxGetResourceString(@dxLayoutNewItemDialogCaption), + cxGetResourceString(@dxLayoutNewItemDialogEditCaption), AItemCaption) then + begin + AItem := Control.CreateItem; + AItem.Caption := AItemCaption; + Designer.SelectComponent(AItem); + end; +end; + +procedure TDesignForm.btnAlignClick(Sender: TObject); +var + P: TPoint; +begin + with btnAlign.BoundsRect do + P := Point(Left, Bottom); +// P := Point(Right, Top); + P := btnAlign.Parent.ClientToScreen(P); + pmAlign.Popup(P.X, P.Y); +end; + +procedure TDesignForm.pmAlignItemClick(Sender: TObject); +var + ASelections: TDesignerSelectionListAccess; + I: Integer; +begin + ASelections := GetSelectedItems; + try + Control.BeginUpdate; + try + if TMenuItem(Sender).Tag = -1 then + for I := 0 to ASelections.Count - 1 do + TdxCustomLayoutItem(ASelections[I]).AlignmentConstraint := nil + else + with Control.CreateAlignmentConstraint do + begin + Kind := TdxLayoutAlignmentConstraintKind(TMenuItem(Sender).Tag); + for I := 0 to ASelections.Count - 1 do + AddItem(TdxCustomLayoutItem(ASelections[I])); + end; + finally + Control.EndUpdate; + end; + finally + ASelections.Free; + Designer.Modified; + end; +end; + +procedure TDesignForm.chbShowHiddenGroupsBoundsClick(Sender: TObject); +begin + Control.ShowHiddenGroupsBounds := chbShowHiddenGroupsBounds.Checked; +end; + +procedure TDesignForm.lcMainItem4CaptionClick(Sender: TObject); +begin + with chbShowHiddenGroupsBounds do + Checked := not Checked; +end; + +end. diff --git a/official/x.35/ExpressLayout Control/Sources/dxLayoutEditForm.dfm b/official/x.35/ExpressLayout Control/Sources/dxLayoutEditForm.dfm new file mode 100644 index 00000000..48863de4 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Sources/dxLayoutEditForm.dfm @@ -0,0 +1,86 @@ +object LayoutEditForm: TLayoutEditForm + Left = 233 + Top = 209 + BorderStyle = bsDialog + Caption = 'LayoutEditForm' + ClientHeight = 88 + ClientWidth = 282 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object LayoutControl: TdxLayoutControl + Left = 0 + Top = 0 + Width = 282 + Height = 88 + Align = alClient + TabOrder = 0 + TabStop = False + AutoContentSizes = [acsWidth] + object edMain: TEdit + Left = 12 + Top = 30 + Width = 121 + Height = 17 + BorderStyle = bsNone + TabOrder = 0 + Text = 'edMain' + end + object btnOK: TButton + Left = 116 + Top = 55 + Width = 75 + Height = 23 + Caption = 'btnOK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 197 + Top = 55 + Width = 75 + Height = 23 + Cancel = True + Caption = 'btnCancel' + ModalResult = 2 + TabOrder = 2 + end + object TdxLayoutGroup + ShowCaption = False + Hidden = True + ShowBorder = False + object LayoutControlItemEdit: TdxLayoutItem + Caption = 'Edit1' + CaptionOptions.Layout = clTop + Control = edMain + end + object dxLayoutControl1Group1: TdxLayoutGroup + AutoAligns = [aaVertical] + AlignHorz = ahRight + ShowCaption = False + LayoutDirection = ldHorizontal + ShowBorder = False + object dxLayoutControl1Item2: TdxLayoutItem + Caption = 'Button1' + ShowCaption = False + Control = btnOK + ControlOptions.ShowBorder = False + end + object dxLayoutControl1Item3: TdxLayoutItem + Caption = 'Button2' + ShowCaption = False + Control = btnCancel + ControlOptions.ShowBorder = False + end + end + end + end +end diff --git a/official/x.35/ExpressLayout Control/Sources/dxLayoutEditForm.pas b/official/x.35/ExpressLayout Control/Sources/dxLayoutEditForm.pas new file mode 100644 index 00000000..fdae71c1 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Sources/dxLayoutEditForm.pas @@ -0,0 +1,116 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressLayoutControl edit form } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSLAYOUTCONTROL AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxLayoutEditForm; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, dxLayoutControl, cxControls; + +type + TLayoutEditForm = class(TForm) + LayoutControl: TdxLayoutControl; + edMain: TEdit; + LayoutControlItemEdit: TdxLayoutItem; + dxLayoutControl1Group1: TdxLayoutGroup; + btnOK: TButton; + dxLayoutControl1Item2: TdxLayoutItem; + btnCancel: TButton; + dxLayoutControl1Item3: TdxLayoutItem; + public + constructor Create(AOwner: TComponent); override; + class function Run(const ACaption, AEditCaption: string; var Value: string; + AEditControl: TWinControl = nil): Boolean; + end; + +var + LayoutEditForm: TLayoutEditForm; + +resourcestring + dxLayoutEditFormOK = 'OK'; + dxLayoutEditFormCancel = 'Cancel'; + +implementation + +{$R *.DFM} + +uses + cxClasses; + +type + TControlAccess = class(TControl); + +constructor TLayoutEditForm.Create(AOwner: TComponent); +begin + inherited; + btnOK.Caption := cxGetResourceString(@dxLayoutEditFormOK); + btnCancel.Caption := cxGetResourceString(@dxLayoutEditFormCancel); +end; + +class function TLayoutEditForm.Run(const ACaption, AEditCaption: string; + var Value: string; AEditControl: TWinControl = nil): Boolean; +begin + with Self.Create(nil) do + try + Caption := ACaption; + LayoutControlItemEdit.Caption := AEditCaption; + + if AEditControl = nil then + edMain.Text := Value + else + begin + LayoutControlItemEdit.Control := AEditControl; + edMain.Visible := False; + ActiveControl := AEditControl; + TControlAccess(AEditControl).Text := Value; + end; + + Result := ShowModal = mrOk; + + if AEditControl = nil then + Value := edMain.Text + else + Value := TControlAccess(AEditControl).Text; + finally + Free; + end; +end; + +end. diff --git a/official/x.35/ExpressLayout Control/Sources/dxLayoutLookAndFeelListDesignForm.dfm b/official/x.35/ExpressLayout Control/Sources/dxLayoutLookAndFeelListDesignForm.dfm new file mode 100644 index 00000000..0f16912c --- /dev/null +++ b/official/x.35/ExpressLayout Control/Sources/dxLayoutLookAndFeelListDesignForm.dfm @@ -0,0 +1,247 @@ +object LookAndFeelListDesignForm: TLookAndFeelListDesignForm + Left = 532 + Top = 129 + Width = 326 + Height = 441 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object lcMain: TdxLayoutControl + Left = 0 + Top = 0 + Width = 318 + Height = 407 + Align = alClient + TabOrder = 0 + TabStop = False + AutoContentSizes = [acsWidth, acsHeight] + LookAndFeel = dxLayoutOfficeLookAndFeel1 + object lbItems: TListBox + Left = 12 + Top = 12 + Width = 401 + Height = 264 + Style = lbOwnerDrawFixed + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + TabOrder = 0 + end + object btnAdd: TButton + Left = 233 + Top = 10 + Width = 75 + Height = 23 + Caption = 'Add...' + TabOrder = 1 + OnClick = btnAddClick + end + object btnDelete: TButton + Left = 233 + Top = 39 + Width = 75 + Height = 23 + Caption = 'Delete' + TabOrder = 2 + end + object btnClose: TButton + Left = 233 + Top = 68 + Width = 75 + Height = 23 + Cancel = True + Caption = 'Close' + Default = True + TabOrder = 3 + OnClick = btnCloseClick + end + object pnlPreview: TPanel + Left = 20 + Top = 193 + Width = 278 + Height = 200 + BevelOuter = bvLowered + TabOrder = 4 + object lcPreview: TdxLayoutControl + Left = 1 + Top = 1 + Width = 276 + Height = 198 + Align = alClient + TabOrder = 0 + TabStop = False + Visible = False + AutoContentSizes = [acsWidth, acsHeight] + object Edit1: TEdit + Left = 53 + Top = 30 + Width = 90 + Height = 17 + BorderStyle = bsNone + TabOrder = 0 + Text = 'Edit1' + end + object Edit2: TEdit + Left = 53 + Top = 57 + Width = 90 + Height = 17 + BorderStyle = bsNone + TabOrder = 1 + Text = 'Edit2' + end + object CheckBox1: TCheckBox + Left = 22 + Top = 112 + Width = 97 + Height = 17 + Caption = 'CheckBox1' + TabOrder = 2 + end + object CheckBox2: TCheckBox + Left = 22 + Top = 135 + Width = 97 + Height = 17 + Caption = 'CheckBox2' + TabOrder = 3 + end + object ListBox1: TListBox + Left = 172 + Top = 30 + Width = 80 + Height = 120 + BorderStyle = bsNone + ItemHeight = 13 + Items.Strings = ( + 'Item 1' + 'Item 2' + 'Item 3' + 'Item 4' + 'Item 5' + 'Item 6' + 'Item 7' + 'Item 8' + 'Item 9') + TabOrder = 4 + end + object TdxLayoutGroup + ShowCaption = False + Hidden = True + LayoutDirection = ldHorizontal + ShowBorder = False + object dxLayoutControl1Group4: TdxLayoutGroup + AutoAligns = [aaVertical] + AlignHorz = ahClient + ShowCaption = False + Hidden = True + ShowBorder = False + object dxLayoutGroup1: TdxLayoutGroup + AutoAligns = [aaVertical] + AlignHorz = ahClient + Caption = 'Group 1' + object dxLayoutItem1: TdxLayoutItem + Caption = 'Edit1' + Control = Edit1 + end + object dxLayoutControl1Item2: TdxLayoutItem + Caption = 'Edit2' + Control = Edit2 + end + end + object dxLayoutControl1Group2: TdxLayoutGroup + Caption = 'Group2' + object dxLayoutControl1Item3: TdxLayoutItem + Caption = 'CheckBox1' + ShowCaption = False + Control = CheckBox1 + ControlOptions.AutoColor = True + ControlOptions.ShowBorder = False + end + object dxLayoutControl1Item4: TdxLayoutItem + Caption = 'CheckBox2' + ShowCaption = False + Control = CheckBox2 + ControlOptions.AutoColor = True + ControlOptions.ShowBorder = False + end + end + end + object dxLayoutControl1Group3: TdxLayoutGroup + AutoAligns = [aaHorizontal] + AlignVert = avClient + Caption = 'Group3' + object dxLayoutControl1Item5: TdxLayoutItem + AutoAligns = [aaHorizontal] + AlignVert = avClient + Control = ListBox1 + end + end + end + end + end + object TdxLayoutGroup + ShowCaption = False + Hidden = True + ShowBorder = False + object lcMainGroup4: TdxLayoutGroup + AutoAligns = [aaHorizontal] + AlignVert = avClient + ShowCaption = False + Hidden = True + LayoutDirection = ldHorizontal + ShowBorder = False + object lcMainItem1: TdxLayoutItem + AutoAligns = [] + AlignHorz = ahClient + AlignVert = avClient + Control = lbItems + end + object lcMainGroup2: TdxLayoutGroup + ShowCaption = False + Hidden = True + ShowBorder = False + object lcMainItem2: TdxLayoutItem + Caption = 'Button1' + ShowCaption = False + Control = btnAdd + ControlOptions.ShowBorder = False + end + object lcMainItem3: TdxLayoutItem + Caption = 'Button2' + ShowCaption = False + Control = btnDelete + ControlOptions.ShowBorder = False + end + object lcMainItem4: TdxLayoutItem + Caption = 'Button3' + ShowCaption = False + Control = btnClose + ControlOptions.ShowBorder = False + end + end + end + object lcMainGroup3: TdxLayoutGroup + Caption = 'Preview' + object lcMainItem6: TdxLayoutItem + Caption = 'Panel1' + ShowCaption = False + Control = pnlPreview + ControlOptions.ShowBorder = False + end + end + end + end + object lflMain: TdxLayoutLookAndFeelList + Left = 256 + Top = 116 + object dxLayoutOfficeLookAndFeel1: TdxLayoutOfficeLookAndFeel + end + end +end diff --git a/official/x.35/ExpressLayout Control/Sources/dxLayoutLookAndFeelListDesignForm.pas b/official/x.35/ExpressLayout Control/Sources/dxLayoutLookAndFeelListDesignForm.pas new file mode 100644 index 00000000..eaf14475 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Sources/dxLayoutLookAndFeelListDesignForm.pas @@ -0,0 +1,230 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressLayoutControl Look & Feel design-time form } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSLAYOUTCONTROL AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxLayoutLookAndFeelListDesignForm; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, ExtCtrls, + cxControls, dxLayoutControl, dxLayoutLookAndFeels, dxLayoutDesignCommon, + {$IFDEF DELPHI6}Variants, DesignIntf{$ELSE}DsgnIntf{$ENDIF}; + +type + TLookAndFeelListDesignForm = class(TdxLayoutDesignForm) + lcMain: TdxLayoutControl; + lbItems: TListBox; + lcMainItem1: TdxLayoutItem; + btnAdd: TButton; + lcMainItem2: TdxLayoutItem; + btnDelete: TButton; + lcMainItem3: TdxLayoutItem; + btnClose: TButton; + lcMainItem4: TdxLayoutItem; + lcMainGroup2: TdxLayoutGroup; + lcMainGroup3: TdxLayoutGroup; + lflMain: TdxLayoutLookAndFeelList; + dxLayoutOfficeLookAndFeel1: TdxLayoutOfficeLookAndFeel; + pnlPreview: TPanel; + lcMainItem6: TdxLayoutItem; + lcPreview: TdxLayoutControl; + Edit1: TEdit; + Edit2: TEdit; + CheckBox1: TCheckBox; + CheckBox2: TCheckBox; + ListBox1: TListBox; + dxLayoutControl1Group4: TdxLayoutGroup; + dxLayoutGroup1: TdxLayoutGroup; + dxLayoutItem1: TdxLayoutItem; + dxLayoutControl1Item2: TdxLayoutItem; + dxLayoutControl1Group2: TdxLayoutGroup; + dxLayoutControl1Item3: TdxLayoutItem; + dxLayoutControl1Item4: TdxLayoutItem; + dxLayoutControl1Group3: TdxLayoutGroup; + dxLayoutControl1Item5: TdxLayoutItem; + lcMainGroup4: TdxLayoutGroup; + procedure btnCloseClick(Sender: TObject); + procedure btnAddClick(Sender: TObject); + private + function GetList: TdxLayoutLookAndFeelList; + protected + function GetAddItemsButton(AIndex: Integer): TButton; override; + function GetAddItemsButtonCount: Integer; override; + function GetDeleteItemsButton: TButton; override; + function GetItemsListBox: TListBox; override; + function NeedRefreshItemsAfterDeleting(AComponent: TPersistent): Boolean; override; + + procedure RefreshItemsListBox; override; + public + constructor Create(AOwner: TComponent); override; + {$IFDEF DELPHI6} + procedure SelectionChanged(const ADesigner: IDesigner; const ASelection: IDesignerSelections); override; + {$ELSE} + procedure SelectionChanged(ASelection: TDesignerSelectionList); override; + {$ENDIF} + property List: TdxLayoutLookAndFeelList read GetList; + end; + +implementation + +{$R *.dfm} + +uses + dxLayoutEditForm; + +constructor TLookAndFeelListDesignForm.Create(AOwner: TComponent); +begin + inherited; +{$IFDEF DELPHI9} + PopupMode := pmExplicit; +{$ENDIF} +end; + +function TLookAndFeelListDesignForm.GetList: TdxLayoutLookAndFeelList; +begin + Result := TdxLayoutLookAndFeelList(Component); +end; + +function TLookAndFeelListDesignForm.GetAddItemsButton(AIndex: Integer): TButton; +begin + Result := btnAdd; +end; + +function TLookAndFeelListDesignForm.GetAddItemsButtonCount: Integer; +begin + Result := 1; +end; + +function TLookAndFeelListDesignForm.GetDeleteItemsButton: TButton; +begin + Result := btnDelete; +end; + +function TLookAndFeelListDesignForm.GetItemsListBox: TListBox; +begin + Result := lbItems; +end; + +function TLookAndFeelListDesignForm.NeedRefreshItemsAfterDeleting(AComponent: TPersistent): Boolean; +begin + Result := inherited NeedRefreshItemsAfterDeleting(AComponent) and + (AComponent is TdxCustomLayoutLookAndFeel) and + (TdxCustomLayoutLookAndFeel(AComponent).List = List); +end; + +procedure TLookAndFeelListDesignForm.RefreshItemsListBox; +var + I: Integer; + AItem: TdxCustomLayoutLookAndFeel; +begin + with lbItems.Items do + begin + BeginUpdate; + try + Clear; + for I := 0 to List.Count - 1 do + begin + AItem := List[I]; + AddObject(AItem.Name, AItem); + end; + finally + EndUpdate; + end; + end; +end; + +{$IFDEF DELPHI6} +procedure TLookAndFeelListDesignForm.SelectionChanged(const ADesigner: IDesigner; + const ASelection: IDesignerSelections); +{$ELSE} +procedure TLookAndFeelListDesignForm.SelectionChanged(ASelection: TDesignerSelectionList); +{$ENDIF} +var + ASelections: TDesignerSelectionListAccess; +begin + inherited; + ASelections := GetSelectedItems; + try + lcPreview.Visible := ASelections.Count = 1; + if lcPreview.Visible then + lcPreview.LookAndFeel := TdxCustomLayoutLookAndFeel(ASelections[0]); + finally + ASelections.Free; + end; +end; + +procedure TLookAndFeelListDesignForm.btnCloseClick(Sender: TObject); +begin + Close; +end; + +procedure TLookAndFeelListDesignForm.btnAddClick(Sender: TObject); +var + ADescription: string; + ALookAndFeel: TdxCustomLayoutLookAndFeel; + ALookAndFeelClass: TdxCustomLayoutLookAndFeelClass; + + function GetDescriptionsComboBox: TComboBox; + var + I: Integer; + begin + Result := TComboBox.Create(nil); + with Result do + begin + Style := csDropDownList; + Visible := False; + Parent := Self; + for I := 0 to dxLayoutLookAndFeelDefs.Count - 1 do + Items.Add(dxLayoutLookAndFeelDefs[I].Description); + if Items.Count <> 0 then ItemIndex := 0; + end; + end; + +begin + ADescription := ''; + if TLayoutEditForm.Run('New Look & Feel', + 'Choose a new look && feel style:', ADescription, GetDescriptionsComboBox) then + begin + ALookAndFeelClass := dxLayoutLookAndFeelDefs.GetItemByDescription(ADescription); + ALookAndFeel := List.CreateItem(ALookAndFeelClass); + Designer.SelectComponent(ALookAndFeel); + end; +end; + +end. diff --git a/official/x.35/ExpressLayout Control/Sources/dxLayoutLookAndFeels.pas b/official/x.35/ExpressLayout Control/Sources/dxLayoutLookAndFeels.pas new file mode 100644 index 00000000..d224cdc4 --- /dev/null +++ b/official/x.35/ExpressLayout Control/Sources/dxLayoutLookAndFeels.pas @@ -0,0 +1,1678 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressLayoutControl Look & Feel components } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSLAYOUTCONTROL AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxLayoutLookAndFeels; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, Controls, Graphics, cxGraphics, dxLayoutCommon; + +type + TdxCustomLayoutLookAndFeelOptions = class; + TdxCustomLayoutLookAndFeel = class; + TdxLayoutWebLookAndFeelGroupOptions = class; + TdxLayoutLookAndFeelList = class; + + // custom + + IdxLayoutLookAndFeelUser = interface + ['{651F19FE-CBCB-4C16-8615-BBD57ED7255A}'] + procedure BeginLookAndFeelDestroying; stdcall; + procedure EndLookAndFeelDestroying; stdcall; + procedure LookAndFeelChanged; stdcall; + procedure LookAndFeelDestroyed; stdcall; + end; + + TdxCustomLayoutLookAndFeelPart = class(TPersistent) + private + FLookAndFeel: TdxCustomLayoutLookAndFeel; + protected + procedure Changed; virtual; + property LookAndFeel: TdxCustomLayoutLookAndFeel read FLookAndFeel; + public + constructor Create(ALookAndFeel: TdxCustomLayoutLookAndFeel); virtual; + end; + + TdxLayoutHotTrackStyle = (htsHandPoint, htsUnderlineCold, htsUnderlineHot); + TdxLayoutHotTrackStyles = set of TdxLayoutHotTrackStyle; + + TdxLayoutLookAndFeelCaptionOptionsClass = class of TdxLayoutLookAndFeelCaptionOptions; + + TdxLayoutLookAndFeelCaptionOptions = class(TPersistent) + private + FFont: TFont; + FHotTrack: Boolean; + FHotTrackStyles: TdxLayoutHotTrackStyles; + FOptions: TdxCustomLayoutLookAndFeelOptions; + FTextColor: TColor; + FTextHotColor: TColor; + FUseDefaultFont: Boolean; + + procedure SetFont(Value: TFont); + procedure SetHotTrack(Value: Boolean); + procedure SetHotTrackStyles(Value: TdxLayoutHotTrackStyles); + procedure SetTextColor(Value: TColor); + procedure SetTextHotColor(Value: TColor); + procedure SetUseDefaultFont(Value: Boolean); + + procedure FontChanged(Sender: TObject); + function IsFontStored: Boolean; + protected + procedure Changed; virtual; + // colors + function GetDefaultTextColor: TColor; virtual; abstract; + function GetDefaultTextHotColor: TColor; virtual; + // font + function GetDefaultFont(AControl: TControl): TFont; virtual; + + property Options: TdxCustomLayoutLookAndFeelOptions read FOptions; + public + constructor Create(AOptions: TdxCustomLayoutLookAndFeelOptions); virtual; + destructor Destroy; override; + // colors + function GetTextColor: TColor; virtual; + function GetTextHotColor: TColor; virtual; + // font + function GetFont(AControl: TControl): TFont; virtual; + published + property Font: TFont read FFont write SetFont stored IsFontStored; + property HotTrack: Boolean read FHotTrack write SetHotTrack default False; + property HotTrackStyles: TdxLayoutHotTrackStyles read FHotTrackStyles + write SetHotTrackStyles default [htsHandPoint, htsUnderlineHot]; + property TextColor: TColor read FTextColor write SetTextColor default clDefault; + property TextHotColor: TColor read FTextHotColor write SetTextHotColor + default clDefault; + property UseDefaultFont: Boolean read FUseDefaultFont write SetUseDefaultFont + default True; + end; + + TdxCustomLayoutLookAndFeelOptions = class(TdxCustomLayoutLookAndFeelPart) + private + FCaptionOptions: TdxLayoutLookAndFeelCaptionOptions; + protected + function GetCaptionOptionsClass: TdxLayoutLookAndFeelCaptionOptionsClass; virtual; + public + constructor Create(ALookAndFeel: TdxCustomLayoutLookAndFeel); override; + destructor Destroy; override; + published + property CaptionOptions: TdxLayoutLookAndFeelCaptionOptions read FCaptionOptions + write FCaptionOptions; + end; + + TdxLayoutLookAndFeelGroupOptionsClass = class of TdxLayoutLookAndFeelGroupOptions; + + TdxLayoutLookAndFeelGroupOptions = class(TdxCustomLayoutLookAndFeelOptions) + private + FColor: TColor; + procedure SetColor(Value: TColor); + protected + // colors + function GetDefaultColor: TColor; virtual; abstract; + public + constructor Create(ALookAndFeel: TdxCustomLayoutLookAndFeel); override; + // colors + function GetColor: TColor; virtual; + published + property Color: TColor read FColor write SetColor default clDefault; + end; + + TdxLayoutBorderStyle = (lbsNone, lbsSingle, lbsFlat, lbsStandard); + + TdxLayoutLookAndFeelItemOptionsClass = class of TdxLayoutLookAndFeelItemOptions; + + TdxLayoutLookAndFeelItemOptions = class(TdxCustomLayoutLookAndFeelOptions) + private + FControlBorderColor: TColor; + FControlBorderStyle: TdxLayoutBorderStyle; + procedure SetControlBorderColor(Value: TColor); + procedure SetControlBorderStyle(Value: TdxLayoutBorderStyle); + protected + // colors + function GetDefaultControlBorderColor: TColor; virtual; + public + constructor Create(ALookAndFeel: TdxCustomLayoutLookAndFeel); override; + // colors + function GetControlBorderColor: TColor; virtual; + published + property ControlBorderColor: TColor read FControlBorderColor + write SetControlBorderColor default clDefault; + property ControlBorderStyle: TdxLayoutBorderStyle read FControlBorderStyle + write SetControlBorderStyle default lbsStandard; + end; + + TdxLayoutLookAndFeelOffsetsClass = class of TdxLayoutLookAndFeelOffsets; + + TdxLayoutLookAndFeelOffsets = class(TdxCustomLayoutLookAndFeelPart) + private + FControlOffsetHorz: Integer; + FControlOffsetVert: Integer; + FItemOffset: Integer; + FItemsAreaOffsetHorz: Integer; + FItemsAreaOffsetVert: Integer; + FRootItemsAreaOffsetHorz: Integer; + FRootItemsAreaOffsetVert: Integer; + protected + function GetDefaultValue(Index: Integer): Integer; virtual; + function GetValue(Index: Integer): Integer; virtual; + function IsValueStored(Index: Integer): Boolean; + procedure SetValue(Index: Integer; Value: Integer); virtual; + public + constructor Create(ALookAndFeel: TdxCustomLayoutLookAndFeel); override; + published + property ControlOffsetHorz: Integer index 0 read GetValue write SetValue stored IsValueStored; + property ControlOffsetVert: Integer index 1 read GetValue write SetValue stored IsValueStored; + property ItemOffset: Integer index 2 read GetValue write SetValue stored IsValueStored; + property ItemsAreaOffsetHorz: Integer index 3 read GetValue write SetValue stored IsValueStored; + property ItemsAreaOffsetVert: Integer index 4 read GetValue write SetValue stored IsValueStored; + property RootItemsAreaOffsetHorz: Integer index 5 read GetValue write SetValue stored IsValueStored; + property RootItemsAreaOffsetVert: Integer index 6 read GetValue write SetValue stored IsValueStored; + end; + + TdxCustomLayoutLookAndFeelClass = class of TdxCustomLayoutLookAndFeel; + + TdxCustomLayoutLookAndFeel = class(TComponent) + private + FGroupOptions: TdxLayoutLookAndFeelGroupOptions; + FItemOptions: TdxLayoutLookAndFeelItemOptions; + FList: TdxLayoutLookAndFeelList; + FNotifyingAboutDestroying: Boolean; + FOffsets: TdxLayoutLookAndFeelOffsets; + FUsers: TList; + + function GetIsDesigning: Boolean; + function GetUser(Index: Integer): IdxLayoutLookAndFeelUser; + function GetUserCount: Integer; + protected + procedure SetName(const Value: TComponentName); override; + procedure SetParentComponent(Value: TComponent); override; + + procedure Changed; + function ForceControlArrangement: Boolean; virtual; + class function GetBaseName: string; virtual; + procedure GetTextMetric(AFont: TFont; var ATextMetric: TTextMetric); + function GetGroupCaptionFont(AControl: TControl): TFont; + function GetItemCaptionFont(AControl: TControl): TFont; + procedure NotifyUsersAboutDestroying; + + // options classes + function GetGroupOptionsClass: TdxLayoutLookAndFeelGroupOptionsClass; virtual; + function GetItemOptionsClass: TdxLayoutLookAndFeelItemOptionsClass; virtual; + function GetOffsetsClass: TdxLayoutLookAndFeelOffsetsClass; virtual; + + // dimensions + function GetItemControlBorderWidth(ASide: TdxLayoutSide): Integer; virtual; + + // internal name + function GetInternalName: string; virtual; + procedure SetInternalName(const Value: string); virtual; + + property IsDesigning: Boolean read GetIsDesigning; + property UserCount: Integer read GetUserCount; + property Users[Index: Integer]: IdxLayoutLookAndFeelUser read GetUser; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + function GetParentComponent: TComponent; override; + function HasParent: Boolean; override; + function NeedDoubleBuffered: Boolean; virtual; + + procedure AddUser(AUser: TComponent); + procedure RemoveUser(AUser: TComponent); + + class function Description: string; virtual; + function DLUToPixels(AFont: TFont; ADLU: Integer): Integer; + function HDLUToPixels(AFont: TFont; ADLU: Integer): Integer; + function VDLUToPixels(AFont: TFont; ADLU: Integer): Integer; + + // painter classes + function GetGroupPainterClass: TClass{TdxLayoutGroupPainterClass}; virtual; abstract; + function GetItemPainterClass: TClass{TdxLayoutItemPainterClass}; virtual; + + // viewinfo classes + function GetGroupViewInfoClass: TClass{TdxLayoutGroupViewInfoClass}; virtual; + function GetItemViewInfoClass: TClass{TdxLayoutItemViewInfoClass}; virtual; + + // dimensions + function GetControlOffsetHorz(AControl: TControl): Integer; virtual; + function GetControlOffsetVert(AControl: TControl): Integer; virtual; + function GetGroupBorderWidth(AControl: TControl; ASide: TdxLayoutSide; + AHasCaption: Boolean): Integer; virtual; + function GetItemOffset(AControl: TControl): Integer; virtual; + function GetItemsAreaOffsetHorz(AControl: TControl): Integer; virtual; + function GetItemsAreaOffsetVert(AControl: TControl): Integer; virtual; + function GetRootItemsAreaOffsetHorz(AControl: TControl): Integer; virtual; + function GetRootItemsAreaOffsetVert(AControl: TControl): Integer; virtual; + + property ItemControlBorderWidths[ASide: TdxLayoutSide]: Integer + read GetItemControlBorderWidth; + + // colors + function GetEmptyAreaColor: TColor; virtual; + + property InternalName: string read GetInternalName write SetInternalName; + property List: TdxLayoutLookAndFeelList read FList; + published + property GroupOptions: TdxLayoutLookAndFeelGroupOptions read FGroupOptions + write FGroupOptions; + property ItemOptions: TdxLayoutLookAndFeelItemOptions read FItemOptions + write FItemOptions; + property Offsets: TdxLayoutLookAndFeelOffsets read FOffsets write FOffsets; + end; + + // standard + + TdxLayoutStandardLookAndFeelGroupCaptionOptions = class(TdxLayoutLookAndFeelCaptionOptions) + protected + function GetDefaultTextColor: TColor; override; + end; + + TdxLayoutStandardLookAndFeelGroupOptions = class(TdxLayoutLookAndFeelGroupOptions) + protected + function GetCaptionOptionsClass: TdxLayoutLookAndFeelCaptionOptionsClass; override; + function GetDefaultColor: TColor; override; + end; + + TdxLayoutStandardLookAndFeelItemCaptionOptions = class(TdxLayoutLookAndFeelCaptionOptions) + protected + function GetDefaultTextColor: TColor; override; + end; + + TdxLayoutStandardLookAndFeelItemOptions = class(TdxLayoutLookAndFeelItemOptions) + protected + function GetCaptionOptionsClass: TdxLayoutLookAndFeelCaptionOptionsClass; override; + end; + + TdxLayoutStandardLookAndFeel = class(TdxCustomLayoutLookAndFeel) + protected + function GetGroupOptionsClass: TdxLayoutLookAndFeelGroupOptionsClass; override; + function GetItemOptionsClass: TdxLayoutLookAndFeelItemOptionsClass; override; + function GetFrameWidth(ASide: TdxLayoutSide): Integer; virtual; + public + class function Description: string; override; + + function GetGroupPainterClass: TClass{TdxLayoutGroupPainterClass}; override; + function GetGroupViewInfoClass: TClass{TdxLayoutGroupViewInfoClass}; override; + + function GetGroupBorderWidth(AControl: TControl; ASide: TdxLayoutSide; + AHasCaption: Boolean): Integer; override; + + property FrameWidths[ASide: TdxLayoutSide]: Integer read GetFrameWidth; + end; + + // office + + TdxLayoutOfficeLookAndFeel = class(TdxLayoutStandardLookAndFeel) + protected + function GetFrameWidth(ASide: TdxLayoutSide): Integer; override; + public + class function Description: string; override; + + function GetGroupPainterClass: TClass{TdxLayoutGroupPainterClass}; override; + function GetGroupViewInfoClass: TClass{TdxLayoutGroupViewInfoClass}; override; + + function GetGroupBorderWidth(AControl: TControl; ASide: TdxLayoutSide; + AHasCaption: Boolean): Integer; override; + end; + + // web + + TdxLayoutWebLookAndFeelGroupCaptionOptions = class(TdxLayoutLookAndFeelCaptionOptions) + private + FColor: TColor; + FSeparatorWidth: Integer; + function GetOptions: TdxLayoutWebLookAndFeelGroupOptions; + procedure SetColor(Value: TColor); + procedure SetSeparatorWidth(Value: Integer); + protected + // colors + function GetDefaultColor: TColor; virtual; + function GetDefaultTextColor: TColor; override; + // font + function GetDefaultFont(AControl: TControl): TFont; override; + + property Options: TdxLayoutWebLookAndFeelGroupOptions read GetOptions; + public + constructor Create(AOptions: TdxCustomLayoutLookAndFeelOptions); override; + // colors + function GetColor: TColor; virtual; + published + property Color: TColor read FColor write SetColor default clDefault; + property SeparatorWidth: Integer read FSeparatorWidth write SetSeparatorWidth + default 0; + end; + + TdxLayoutWebLookAndFeelGroupOptions = class(TdxLayoutLookAndFeelGroupOptions) + private + FFrameColor: TColor; + FFrameWidth: Integer; + FOffsetCaption: Boolean; + FOffsetItems: Boolean; + + function GetCaptionOptions: TdxLayoutWebLookAndFeelGroupCaptionOptions; + procedure SetCaptionOptions(Value: TdxLayoutWebLookAndFeelGroupCaptionOptions); + procedure SetFrameColor(Value: TColor); + procedure SetFrameWidth(Value: Integer); + procedure SetOffsetCaption(Value: Boolean); + procedure SetOffsetItems(Value: Boolean); + protected + function GetCaptionOptionsClass: TdxLayoutLookAndFeelCaptionOptionsClass; override; + // colors + function GetDefaultColor: TColor; override; + function GetDefaultFrameColor: TColor; virtual; + public + constructor Create(ALookAndFeel: TdxCustomLayoutLookAndFeel); override; + // colors + function GetFrameColor: TColor; virtual; + + function HasCaptionSeparator(AHasCaption: Boolean): Boolean; + published + property CaptionOptions: TdxLayoutWebLookAndFeelGroupCaptionOptions + read GetCaptionOptions write SetCaptionOptions; + property FrameColor: TColor read FFrameColor write SetFrameColor + default clDefault; + property FrameWidth: Integer read FFrameWidth write SetFrameWidth default 1; + property OffsetCaption: Boolean read FOffsetCaption write SetOffsetCaption + default True; + property OffsetItems: Boolean read FOffsetItems write SetOffsetItems + default True; + end; + + TdxLayoutWebLookAndFeelItemCaptionOptions = class(TdxLayoutLookAndFeelCaptionOptions) + protected + function GetDefaultTextColor: TColor; override; + end; + + TdxLayoutWebLookAndFeelItemOptions = class(TdxLayoutLookAndFeelItemOptions) + protected + function GetCaptionOptionsClass: TdxLayoutLookAndFeelCaptionOptionsClass; override; + public + constructor Create(ALookAndFeel: TdxCustomLayoutLookAndFeel); override; + published + property ControlBorderStyle default lbsSingle; + end; + + TdxLayoutWebLookAndFeel = class(TdxCustomLayoutLookAndFeel) + private + function GetGroupOptions: TdxLayoutWebLookAndFeelGroupOptions; + procedure SetGroupOptions(Value: TdxLayoutWebLookAndFeelGroupOptions); + protected + function GetGroupOptionsClass: TdxLayoutLookAndFeelGroupOptionsClass; override; + function GetItemOptionsClass: TdxLayoutLookAndFeelItemOptionsClass; override; + public + class function Description: string; override; + + function GetGroupPainterClass: TClass{TdxLayoutGroupPainterClass}; override; + function GetGroupViewInfoClass: TClass{TdxLayoutGroupViewInfoClass}; override; + + function GetGroupBorderWidth(AControl: TControl; ASide: TdxLayoutSide; + AHasCaption: Boolean): Integer; override; + published + property GroupOptions: TdxLayoutWebLookAndFeelGroupOptions read GetGroupOptions + write SetGroupOptions; + end; + + // list and definitions + + TdxLayoutLookAndFeelList = class(TComponent) + private + FItems: TList; + function GetCount: Integer; + function GetIsDesigning: Boolean; + function GetItem(Index: Integer): TdxCustomLayoutLookAndFeel; + + procedure AddItem(AItem: TdxCustomLayoutLookAndFeel); + procedure RemoveItem(AItem: TdxCustomLayoutLookAndFeel); + procedure ClearItems; + protected + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + procedure Modified; + procedure SetName(const Value: TComponentName); override; + property IsDesigning: Boolean read GetIsDesigning; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function CreateItem(AClass: TdxCustomLayoutLookAndFeelClass): TdxCustomLayoutLookAndFeel; + property Count: Integer read GetCount; + property Items[Index: Integer]: TdxCustomLayoutLookAndFeel read GetItem; default; + end; + + TdxLayoutLookAndFeelDefs = class + private + FItems: TList; + function GetCount: Integer; + function GetItem(Index: Integer): TdxCustomLayoutLookAndFeelClass; + public + constructor Create; + destructor Destroy; override; + function GetItemByDescription(const Value: string): TdxCustomLayoutLookAndFeelClass; + procedure Register(AClass: TdxCustomLayoutLookAndFeelClass); + procedure Unregister(AClass: TdxCustomLayoutLookAndFeelClass); + property Count: Integer read GetCount; + property Items[Index: Integer]: TdxCustomLayoutLookAndFeelClass read GetItem; default; + end; + + // text metric manager + + PdxLayoutTextMetric = ^TdxLayoutTextMetric; + TdxLayoutTextMetric = record + Font: TFont; + TextMetric: TTextMetric; + end; + + TdxLayoutTextMetrics = class + private + FItems: TList; + function GetCount: Integer; + function GetItem(AIndex: Integer): PdxLayoutTextMetric; + procedure DestroyItems; + protected + procedure CalculateItem(AIndex: Integer); + procedure Delete(AIndex: Integer); + function IndexOf(AFont: TFont): Integer; + property Count: Integer read GetCount; + property Items[AIndex: Integer]: PdxLayoutTextMetric read GetItem; + public + constructor Create; + destructor Destroy; override; + procedure Get(AFont: TFont; var ATextMetric: TTextMetric); + //procedure Update(AFont: TFont); + procedure Unregister(AFont: TFont); + end; + +var + dxLayoutTextMetrics: TdxLayoutTextMetrics; + dxLayoutLookAndFeelDefs: TdxLayoutLookAndFeelDefs; + dxLayoutDefaultLookAndFeel: TdxCustomLayoutLookAndFeel; + +implementation + +uses + SysUtils, Forms, cxClasses, dxLayoutControl; + +type + TControlAccess = class(TControl); + TdxLayoutControlAccess = class(TdxCustomLayoutControl); + +{ TdxCustomLayoutLookAndFeelPart } + +constructor TdxCustomLayoutLookAndFeelPart.Create(ALookAndFeel: TdxCustomLayoutLookAndFeel); +begin + inherited Create; + FLookAndFeel := ALookAndFeel; +end; + +procedure TdxCustomLayoutLookAndFeelPart.Changed; +begin + FLookAndFeel.Changed; +end; + +{ TdxLayoutLookAndFeelCaptionOptions } + +constructor TdxLayoutLookAndFeelCaptionOptions.Create(AOptions: TdxCustomLayoutLookAndFeelOptions); +begin + inherited Create; + FOptions := AOptions; + FFont := TFont.Create; + FFont.OnChange := FontChanged; + FHotTrackStyles := [htsHandPoint, htsUnderlineHot]; + FTextColor := clDefault; + FTextHotColor := clDefault; + FUseDefaultFont := True; +end; + +destructor TdxLayoutLookAndFeelCaptionOptions.Destroy; +begin + dxLayoutTextMetrics.Unregister(FFont); + FFont.Free; + inherited; +end; + +procedure TdxLayoutLookAndFeelCaptionOptions.SetFont(Value: TFont); +begin + FFont.Assign(Value) +end; + +procedure TdxLayoutLookAndFeelCaptionOptions.SetHotTrack(Value: Boolean); +begin + if FHotTrack <> Value then + begin + FHotTrack := Value; + Changed; + end; +end; + +procedure TdxLayoutLookAndFeelCaptionOptions.SetHotTrackStyles(Value: TdxLayoutHotTrackStyles); +begin + if FHotTrackStyles <> Value then + begin + FHotTrackStyles := Value; + Changed; + end; +end; + +procedure TdxLayoutLookAndFeelCaptionOptions.SetTextColor(Value: TColor); +begin + if FTextColor <> Value then + begin + FTextColor := Value; + Changed; + end; +end; + +procedure TdxLayoutLookAndFeelCaptionOptions.SetTextHotColor(Value: TColor); +begin + if FTextHotColor <> Value then + begin + FTextHotColor := Value; + Changed; + end; +end; + +procedure TdxLayoutLookAndFeelCaptionOptions.SetUseDefaultFont(Value: Boolean); +begin + if FUseDefaultFont <> Value then + begin + FUseDefaultFont := Value; + Changed; + end; +end; + +procedure TdxLayoutLookAndFeelCaptionOptions.FontChanged(Sender: TObject); +begin + FUseDefaultFont := False; + dxLayoutTextMetrics.Unregister(FFont); + Changed; +end; + +function TdxLayoutLookAndFeelCaptionOptions.IsFontStored: Boolean; +begin + Result := not FUseDefaultFont; +end; + +procedure TdxLayoutLookAndFeelCaptionOptions.Changed; +begin + FOptions.Changed; +end; + +function TdxLayoutLookAndFeelCaptionOptions.GetDefaultTextHotColor: TColor; +begin + Result := GetHotTrackColor; +end; + +function TdxLayoutLookAndFeelCaptionOptions.GetDefaultFont(AControl: TControl): TFont; +begin + Result := TControlAccess(AControl).Font; +end; + +function TdxLayoutLookAndFeelCaptionOptions.GetTextColor: TColor; +begin + Result := FTextColor; + if Result = clDefault then + Result := GetDefaultTextColor; +end; + +function TdxLayoutLookAndFeelCaptionOptions.GetTextHotColor: TColor; +begin + Result := FTextHotColor; + if Result = clDefault then + Result := GetDefaultTextHotColor; +end; + +function TdxLayoutLookAndFeelCaptionOptions.GetFont(AControl: TControl): TFont; +begin + if FUseDefaultFont then + Result := GetDefaultFont(AControl) + else + Result := FFont; +end; + +{ TdxCustomLayoutLookAndFeelOptions } + +constructor TdxCustomLayoutLookAndFeelOptions.Create(ALookAndFeel: TdxCustomLayoutLookAndFeel); +begin + inherited; + FCaptionOptions := GetCaptionOptionsClass.Create(Self); +end; + +destructor TdxCustomLayoutLookAndFeelOptions.Destroy; +begin + FCaptionOptions.Free; + inherited; +end; + +function TdxCustomLayoutLookAndFeelOptions.GetCaptionOptionsClass: TdxLayoutLookAndFeelCaptionOptionsClass; +begin + Result := TdxLayoutLookAndFeelCaptionOptions; +end; + +{ TdxLayoutLookAndFeelGroupOptions } + +constructor TdxLayoutLookAndFeelGroupOptions.Create(ALookAndFeel: TdxCustomLayoutLookAndFeel); +begin + inherited; + FColor := clDefault; +end; + +procedure TdxLayoutLookAndFeelGroupOptions.SetColor(Value: TColor); +begin + if FColor <> Value then + begin + FColor := Value; + Changed; + end; +end; + +function TdxLayoutLookAndFeelGroupOptions.GetColor: TColor; +begin + Result := FColor; + if Result = clDefault then + Result := GetDefaultColor; +end; + +{ TdxLayoutLookAndFeelItemOptions } + +constructor TdxLayoutLookAndFeelItemOptions.Create(ALookAndFeel: TdxCustomLayoutLookAndFeel); +begin + inherited; + FControlBorderColor := clDefault; + FControlBorderStyle := lbsStandard; +end; + +procedure TdxLayoutLookAndFeelItemOptions.SetControlBorderColor(Value: TColor); +begin + if FControlBorderColor <> Value then + begin + FControlBorderColor := Value; + Changed; + end; +end; + +procedure TdxLayoutLookAndFeelItemOptions.SetControlBorderStyle(Value: TdxLayoutBorderStyle); +begin + if FControlBorderStyle <> Value then + begin + FControlBorderStyle := Value; + Changed; + end; +end; + +function TdxLayoutLookAndFeelItemOptions.GetDefaultControlBorderColor: TColor; +begin + Result := clWindowFrame; +end; + +function TdxLayoutLookAndFeelItemOptions.GetControlBorderColor: TColor; +begin + Result := FControlBorderColor; + if Result = clDefault then + Result := GetDefaultControlBorderColor; +end; + +{ TdxLayoutLookAndFeelOffsets } + +constructor TdxLayoutLookAndFeelOffsets.Create(ALookAndFeel: TdxCustomLayoutLookAndFeel); +begin + inherited; + FControlOffsetHorz := GetDefaultValue(0); + FControlOffsetVert := GetDefaultValue(1); + FItemOffset := GetDefaultValue(2); + FItemsAreaOffsetHorz := GetDefaultValue(3); + FItemsAreaOffsetVert := GetDefaultValue(4); + FRootItemsAreaOffsetHorz := GetDefaultValue(5); + FRootItemsAreaOffsetVert := GetDefaultValue(6); +end; + +function TdxLayoutLookAndFeelOffsets.GetDefaultValue(Index: Integer): Integer; +begin + case Index of + 0: Result := 3; + 1: Result := 3; + 2: Result := 4; + 3: Result := 0; + 4: Result := 0; + 5: Result := 7; + 6: Result := 7; + else + Result := 0; + end; +end; + +function TdxLayoutLookAndFeelOffsets.GetValue(Index: Integer): Integer; +begin + case Index of + 0: Result := FControlOffsetHorz; + 1: Result := FControlOffsetVert; + 2: Result := FItemOffset; + 3: Result := FItemsAreaOffsetHorz; + 4: Result := FItemsAreaOffsetVert; + 5: Result := FRootItemsAreaOffsetHorz; + 6: Result := FRootItemsAreaOffsetVert; + else + Result := 0; + end; +end; + +function TdxLayoutLookAndFeelOffsets.IsValueStored(Index: Integer): Boolean; +begin + Result := GetValue(Index) <> GetDefaultValue(Index); +end; + +procedure TdxLayoutLookAndFeelOffsets.SetValue(Index: Integer; Value: Integer); +begin + if Value < 0 then Value := 0; + if GetValue(Index) <> Value then + begin + case Index of + 0: FControlOffsetHorz := Value; + 1: FControlOffsetVert := Value; + 2: FItemOffset := Value; + 3: FItemsAreaOffsetHorz := Value; + 4: FItemsAreaOffsetVert := Value; + 5: FRootItemsAreaOffsetHorz := Value; + 6: FRootItemsAreaOffsetVert := Value; + end; + Changed; + end; +end; + +{ TdxCustomLayoutLookAndFeel } + +constructor TdxCustomLayoutLookAndFeel.Create(AOwner: TComponent); +begin + inherited; + FUsers := TList.Create; + FGroupOptions := GetGroupOptionsClass.Create(Self); + FItemOptions := GetItemOptionsClass.Create(Self); + FOffsets := GetOffsetsClass.Create(Self); +end; + +destructor TdxCustomLayoutLookAndFeel.Destroy; +begin + NotifyUsersAboutDestroying; + if FList <> nil then FList.RemoveItem(Self); + FUsers.Free; + FOffsets.Free; + FItemOptions.Free; + FGroupOptions.Free; + inherited; +end; + +function TdxCustomLayoutLookAndFeel.GetIsDesigning: Boolean; +begin + Result := csDesigning in ComponentState; +end; + +function TdxCustomLayoutLookAndFeel.GetUser(Index: Integer): IdxLayoutLookAndFeelUser; +begin + TComponent(FUsers[Index]).GetInterface(IdxLayoutLookAndFeelUser, Result); +end; + +function TdxCustomLayoutLookAndFeel.GetUserCount: Integer; +begin + Result := FUsers.Count; +end; + +procedure TdxCustomLayoutLookAndFeel.SetName(const Value: TComponentName); +begin + inherited; + if IsDesigning then + dxLayoutDesigner.ItemsChanged(FList); +end; + +procedure TdxCustomLayoutLookAndFeel.SetParentComponent(Value: TComponent); +begin + inherited; + if Value is TdxLayoutLookAndFeelList then + TdxLayoutLookAndFeelList(Value).AddItem(Self); +end; + +procedure TdxCustomLayoutLookAndFeel.Changed; +var + I: Integer; +begin + for I := 0 to UserCount - 1 do + Users[I].LookAndFeelChanged; +end; + +function TdxCustomLayoutLookAndFeel.ForceControlArrangement: Boolean; +begin + Result := False; +end; + +class function TdxCustomLayoutLookAndFeel.GetBaseName: string; +begin + Result := ClassName; + Delete(Result, 1, 1); +end; + +procedure TdxCustomLayoutLookAndFeel.GetTextMetric(AFont: TFont; + var ATextMetric: TTextMetric); +begin + dxLayoutTextMetrics.Get(AFont, ATextMetric); +end; + +function TdxCustomLayoutLookAndFeel.GetGroupCaptionFont(AControl: TControl): TFont; +begin + Result := FGroupOptions.CaptionOptions.GetFont(AControl); +end; + +function TdxCustomLayoutLookAndFeel.GetItemCaptionFont(AControl: TControl): TFont; +begin + Result := FItemOptions.CaptionOptions.GetFont(AControl); +end; + +procedure TdxCustomLayoutLookAndFeel.NotifyUsersAboutDestroying; + + procedure BeginNotification; + var + I: Integer; + begin + FNotifyingAboutDestroying := True; + for I := 0 to UserCount - 1 do + Users[I].BeginLookAndFeelDestroying; + end; + + procedure Notify; + var + I: Integer; + begin + for I := 0 to UserCount - 1 do + Users[I].LookAndFeelDestroyed; + end; + + procedure EndNotification; + var + I: Integer; + begin + for I := 0 to UserCount - 1 do + Users[I].EndLookAndFeelDestroying; + FNotifyingAboutDestroying := False; + end; + +begin + BeginNotification; + try + Notify; + finally + EndNotification; + end; +end; + +function TdxCustomLayoutLookAndFeel.GetGroupOptionsClass: TdxLayoutLookAndFeelGroupOptionsClass; +begin + Result := TdxLayoutLookAndFeelGroupOptions; +end; + +function TdxCustomLayoutLookAndFeel.GetItemOptionsClass: TdxLayoutLookAndFeelItemOptionsClass; +begin + Result := TdxLayoutLookAndFeelItemOptions; +end; + +function TdxCustomLayoutLookAndFeel.GetOffsetsClass: TdxLayoutLookAndFeelOffsetsClass; +begin + Result := TdxLayoutLookAndFeelOffsets; +end; + +function TdxCustomLayoutLookAndFeel.GetParentComponent: TComponent; +begin + Result := FList; +end; + +function TdxCustomLayoutLookAndFeel.HasParent: Boolean; +begin + Result := True; +end; + +function TdxCustomLayoutLookAndFeel.NeedDoubleBuffered: Boolean; +begin + Result := False; +end; + +procedure TdxCustomLayoutLookAndFeel.AddUser(AUser: TComponent); +begin + FUsers.Add(AUser); +end; + +procedure TdxCustomLayoutLookAndFeel.RemoveUser(AUser: TComponent); +begin + if FNotifyingAboutDestroying then Exit; + FUsers.Remove(AUser); +end; + +class function TdxCustomLayoutLookAndFeel.Description: string; +begin + Result := ''; +end; + +function TdxCustomLayoutLookAndFeel.DLUToPixels(AFont: TFont; ADLU: Integer): Integer; +var + ATextMetric: TTextMetric; +begin + GetTextMetric(AFont, ATextMetric); + Result := + (MulDiv(ADLU, ATextMetric.tmAveCharWidth, 4) + + MulDiv(ADLU, ATextMetric.tmHeight, 8)) div 2; +end; + +function TdxCustomLayoutLookAndFeel.HDLUToPixels(AFont: TFont; ADLU: Integer): Integer; +var + ATextMetric: TTextMetric; +begin + GetTextMetric(AFont, ATextMetric); + Result := MulDiv(ADLU, ATextMetric.tmAveCharWidth, 4); +end; + +function TdxCustomLayoutLookAndFeel.VDLUToPixels(AFont: TFont; ADLU: Integer): Integer; +var + ATextMetric: TTextMetric; +begin + GetTextMetric(AFont, ATextMetric); + Result := MulDiv(ADLU, ATextMetric.tmHeight, 8); +end; + +function TdxCustomLayoutLookAndFeel.GetItemPainterClass: TClass{TdxLayoutItemPainterClass}; +begin + Result := TdxLayoutItemPainter; +end; + +function TdxCustomLayoutLookAndFeel.GetGroupViewInfoClass: TClass{TdxLayoutGroupViewInfoClass}; +begin + Result := TdxLayoutGroupViewInfo; +end; + +function TdxCustomLayoutLookAndFeel.GetItemViewInfoClass: TClass{TdxLayoutItemViewInfoClass}; +begin + Result := TdxLayoutItemViewInfo; +end; + +function TdxCustomLayoutLookAndFeel.GetControlOffsetHorz(AControl: TControl): Integer; +begin + Result := DLUToPixels(GetItemCaptionFont(AControl), Offsets.ControlOffsetHorz); +end; + +function TdxCustomLayoutLookAndFeel.GetControlOffsetVert(AControl: TControl): Integer; +begin + Result := DLUToPixels(GetItemCaptionFont(AControl), Offsets.ControlOffsetVert); +end; + +function TdxCustomLayoutLookAndFeel.GetGroupBorderWidth(AControl: TControl; + ASide: TdxLayoutSide; AHasCaption: Boolean): Integer; +begin + Result := 0; +end; + +function TdxCustomLayoutLookAndFeel.GetInternalName: string; +begin + Result := ''; +end; + +function TdxCustomLayoutLookAndFeel.GetItemControlBorderWidth(ASide: TdxLayoutSide): Integer; +begin + case FItemOptions.ControlBorderStyle of + lbsSingle: + Result := 1; + lbsFlat: + Result := 2; + lbsStandard: + Result := 2; + else + Result := 0; + end +end; + +function TdxCustomLayoutLookAndFeel.GetItemOffset(AControl: TControl): Integer; +begin + Result := DLUToPixels(GetItemCaptionFont(AControl), Offsets.ItemOffset); +end; + +function TdxCustomLayoutLookAndFeel.GetItemsAreaOffsetHorz(AControl: TControl): Integer; +begin + Result := DLUToPixels(GetGroupCaptionFont(AControl), Offsets.ItemsAreaOffsetHorz); +end; + +function TdxCustomLayoutLookAndFeel.GetItemsAreaOffsetVert(AControl: TControl): Integer; +begin + Result := DLUToPixels(GetGroupCaptionFont(AControl), Offsets.ItemsAreaOffsetVert); +end; + +function TdxCustomLayoutLookAndFeel.GetRootItemsAreaOffsetHorz(AControl: TControl): Integer; +begin + Result := DLUToPixels(GetGroupCaptionFont(AControl), Offsets.RootItemsAreaOffsetHorz); +end; + +function TdxCustomLayoutLookAndFeel.GetRootItemsAreaOffsetVert(AControl: TControl): Integer; +begin + Result := DLUToPixels(GetGroupCaptionFont(AControl), Offsets.RootItemsAreaOffsetVert); +end; + +function TdxCustomLayoutLookAndFeel.GetEmptyAreaColor: TColor; +begin + Result := FGroupOptions.GetColor; +end; + +procedure TdxCustomLayoutLookAndFeel.SetInternalName(const Value: string); +begin +end; + +{ TdxLayoutStandardLookAndFeelGroupCaptionOptions } + +function TdxLayoutStandardLookAndFeelGroupCaptionOptions.GetDefaultTextColor: TColor; +begin + Result := clBtnText; +end; + +{ TdxLayoutStandardLookAndFeelGroupOptions } + +function TdxLayoutStandardLookAndFeelGroupOptions.GetCaptionOptionsClass: TdxLayoutLookAndFeelCaptionOptionsClass; +begin + Result := TdxLayoutStandardLookAndFeelGroupCaptionOptions; +end; + +function TdxLayoutStandardLookAndFeelGroupOptions.GetDefaultColor: TColor; +begin + Result := clBtnFace; +end; + +{ TdxLayoutStandardLookAndFeelItemCaptionOptions } + +function TdxLayoutStandardLookAndFeelItemCaptionOptions.GetDefaultTextColor: TColor; +begin + Result := clBtnText; +end; + +{ TdxLayoutStandardLookAndFeelItemOptions } + +function TdxLayoutStandardLookAndFeelItemOptions.GetCaptionOptionsClass: TdxLayoutLookAndFeelCaptionOptionsClass; +begin + Result := TdxLayoutStandardLookAndFeelItemCaptionOptions; +end; + +{ TdxLayoutStandardLookAndFeel } + +function TdxLayoutStandardLookAndFeel.GetGroupOptionsClass: TdxLayoutLookAndFeelGroupOptionsClass; +begin + Result := TdxLayoutStandardLookAndFeelGroupOptions; +end; + +function TdxLayoutStandardLookAndFeel.GetItemOptionsClass: TdxLayoutLookAndFeelItemOptionsClass; +begin + Result := TdxLayoutStandardLookAndFeelItemOptions; +end; + +function TdxLayoutStandardLookAndFeel.GetFrameWidth(ASide: TdxLayoutSide): Integer; +begin + Result := 2; +end; + +class function TdxLayoutStandardLookAndFeel.Description: string; +begin + Result := 'Standard'; +end; + +function TdxLayoutStandardLookAndFeel.GetGroupPainterClass: TClass{TdxLayoutGroupPainterClass}; +begin + Result := TdxLayoutGroupStandardPainter; +end; + +function TdxLayoutStandardLookAndFeel.GetGroupViewInfoClass: TClass{TdxLayoutGroupViewInfoClass}; +begin + Result := TdxLayoutGroupStandardViewInfo; +end; + +function TdxLayoutStandardLookAndFeel.GetGroupBorderWidth(AControl: TControl; + ASide: TdxLayoutSide; AHasCaption: Boolean): Integer; +var + AFont: TFont; +begin + AFont := GetGroupCaptionFont(AControl); + if ASide = sdTop then + Result := VDLUToPixels(AFont, 4) + FrameWidths[ASide] div 2 + DLUToPixels(AFont, 7) + else + Result := FrameWidths[ASide] + DLUToPixels(AFont, 7); +end; + +{ TdxLayoutOfficeLookAndFeel } + +function TdxLayoutOfficeLookAndFeel.GetFrameWidth(ASide: TdxLayoutSide): Integer; +begin + if ASide = sdTop then + Result := inherited GetFrameWidth(ASide) + else + Result := 0; +end; + +class function TdxLayoutOfficeLookAndFeel.Description: string; +begin + Result := 'Office'; +end; + +function TdxLayoutOfficeLookAndFeel.GetGroupPainterClass: TClass{TdxLayoutGroupPainterClass}; +begin + Result := TdxLayoutGroupOfficePainter; +end; + +function TdxLayoutOfficeLookAndFeel.GetGroupViewInfoClass: TClass{TdxLayoutGroupViewInfoClass}; +begin + Result := TdxLayoutGroupOfficeViewInfo; +end; + +function TdxLayoutOfficeLookAndFeel.GetGroupBorderWidth(AControl: TControl; + ASide: TdxLayoutSide; AHasCaption: Boolean): Integer; +begin + if ASide = sdBottom then + Result := DLUToPixels(GetGroupCaptionFont(AControl), 3) + else + Result := inherited GetGroupBorderWidth(AControl, ASide, AHasCaption); +end; + +{ TdxLayoutWebLookAndFeelGroupCaptionOptions } + +constructor TdxLayoutWebLookAndFeelGroupCaptionOptions.Create(AOptions: TdxCustomLayoutLookAndFeelOptions); +begin + inherited; + FColor := clDefault; +end; + +function TdxLayoutWebLookAndFeelGroupCaptionOptions.GetOptions: TdxLayoutWebLookAndFeelGroupOptions; +begin + Result := TdxLayoutWebLookAndFeelGroupOptions(inherited Options); +end; + +procedure TdxLayoutWebLookAndFeelGroupCaptionOptions.SetColor(Value: TColor); +begin + if FColor <> Value then + begin + FColor := Value; + Changed; + end; +end; + +procedure TdxLayoutWebLookAndFeelGroupCaptionOptions.SetSeparatorWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FSeparatorWidth <> Value then + begin + FSeparatorWidth := Value; + Changed; + end; +end; + +function TdxLayoutWebLookAndFeelGroupCaptionOptions.GetDefaultColor: TColor; +begin + Result := Options.GetColor; +end; + +function TdxLayoutWebLookAndFeelGroupCaptionOptions.GetDefaultTextColor: TColor; +begin + Result := clWindowText; +end; + +function TdxLayoutWebLookAndFeelGroupCaptionOptions.GetDefaultFont(AControl: TControl): TFont; +begin + Result := TdxLayoutControlAccess(AControl).BoldFont; +end; + +function TdxLayoutWebLookAndFeelGroupCaptionOptions.GetColor: TColor; +begin + Result := FColor; + if Result = clDefault then + Result := GetDefaultColor; +end; + +{ TdxLayoutWebLookAndFeelGroupOptions } + +constructor TdxLayoutWebLookAndFeelGroupOptions.Create(ALookAndFeel: TdxCustomLayoutLookAndFeel); +begin + inherited; + FFrameColor := clDefault; + FFrameWidth := 1; + FOffsetCaption := True; + FOffsetItems := True; +end; + +function TdxLayoutWebLookAndFeelGroupOptions.GetCaptionOptions: TdxLayoutWebLookAndFeelGroupCaptionOptions; +begin + Result := TdxLayoutWebLookAndFeelGroupCaptionOptions(inherited CaptionOptions); +end; + +procedure TdxLayoutWebLookAndFeelGroupOptions.SetCaptionOptions(Value: TdxLayoutWebLookAndFeelGroupCaptionOptions); +begin + inherited CaptionOptions := Value; +end; + +procedure TdxLayoutWebLookAndFeelGroupOptions.SetFrameColor(Value: TColor); +begin + if FFrameColor <> Value then + begin + FFrameColor := Value; + Changed; + end; +end; + +procedure TdxLayoutWebLookAndFeelGroupOptions.SetFrameWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FFrameWidth <> Value then + begin + FFrameWidth := Value; + Changed; + end; +end; + +procedure TdxLayoutWebLookAndFeelGroupOptions.SetOffsetCaption(Value: Boolean); +begin + if FOffsetCaption <> Value then + begin + FOffsetCaption := Value; + Changed; + end; +end; + +procedure TdxLayoutWebLookAndFeelGroupOptions.SetOffsetItems(Value: Boolean); +begin + if FOffsetItems <> Value then + begin + FOffsetItems := Value; + Changed; + end; +end; + +function TdxLayoutWebLookAndFeelGroupOptions.GetCaptionOptionsClass: TdxLayoutLookAndFeelCaptionOptionsClass; +begin + Result := TdxLayoutWebLookAndFeelGroupCaptionOptions; +end; + +function TdxLayoutWebLookAndFeelGroupOptions.GetDefaultColor: TColor; +begin + Result := clWindow; +end; + +function TdxLayoutWebLookAndFeelGroupOptions.GetDefaultFrameColor: TColor; +begin + Result := clBtnFace; +end; + +function TdxLayoutWebLookAndFeelGroupOptions.GetFrameColor: TColor; +begin + Result := FFrameColor; + if Result = clDefault then + Result := GetDefaultFrameColor; +end; + +function TdxLayoutWebLookAndFeelGroupOptions.HasCaptionSeparator(AHasCaption: Boolean): Boolean; +begin + Result := AHasCaption or (FFrameWidth = 0); +end; + +{ TdxLayoutWebLookAndFeelItemCaptionOptions } + +function TdxLayoutWebLookAndFeelItemCaptionOptions.GetDefaultTextColor: TColor; +begin + Result := clWindowText; +end; + +{ TdxLayoutWebLookAndFeelItemOptions } + +constructor TdxLayoutWebLookAndFeelItemOptions.Create(ALookAndFeel: TdxCustomLayoutLookAndFeel); +begin + inherited; + ControlBorderStyle := lbsSingle; +end; + +function TdxLayoutWebLookAndFeelItemOptions.GetCaptionOptionsClass: TdxLayoutLookAndFeelCaptionOptionsClass; +begin + Result := TdxLayoutWebLookAndFeelItemCaptionOptions; +end; + +{ TdxLayoutWebLookAndFeel } + +function TdxLayoutWebLookAndFeel.GetGroupOptions: TdxLayoutWebLookAndFeelGroupOptions; +begin + Result := TdxLayoutWebLookAndFeelGroupOptions(inherited GroupOptions); +end; + +procedure TdxLayoutWebLookAndFeel.SetGroupOptions(Value: TdxLayoutWebLookAndFeelGroupOptions); +begin + inherited GroupOptions := Value; +end; + +function TdxLayoutWebLookAndFeel.GetGroupOptionsClass: TdxLayoutLookAndFeelGroupOptionsClass; +begin + Result := TdxLayoutWebLookAndFeelGroupOptions; +end; + +function TdxLayoutWebLookAndFeel.GetItemOptionsClass: TdxLayoutLookAndFeelItemOptionsClass; +begin + Result := TdxLayoutWebLookAndFeelItemOptions; +end; + +class function TdxLayoutWebLookAndFeel.Description: string; +begin + Result := 'Web'; +end; + +function TdxLayoutWebLookAndFeel.GetGroupPainterClass: TClass{TdxLayoutGroupPainterClass}; +begin + Result := TdxLayoutGroupWebPainter; +end; + +function TdxLayoutWebLookAndFeel.GetGroupViewInfoClass: TClass{TdxLayoutGroupViewInfoClass}; +begin + Result := TdxLayoutGroupWebViewInfo; +end; + +function TdxLayoutWebLookAndFeel.GetGroupBorderWidth(AControl: TControl; + ASide: TdxLayoutSide; AHasCaption: Boolean): Integer; +var + AFont: TFont; +begin + AFont := GetGroupCaptionFont(AControl); + if ASide in [sdTop, sdBottom] then + begin + Result := DLUToPixels(AFont, 4); + if ASide = sdTop then + begin + if AHasCaption then + Inc(Result, VDLUToPixels(AFont, 11{12})); + if GroupOptions.HasCaptionSeparator(AHasCaption) then + Inc(Result, GroupOptions.CaptionOptions.SeparatorWidth); + end; + end + else + if GroupOptions.OffsetItems then + Result := DLUToPixels(AFont, 7) + else + Result := DLUToPixels(AFont, 2); + Inc(Result, GroupOptions.FrameWidth); +end; + +{ TdxLayoutLookAndFeelList } + +constructor TdxLayoutLookAndFeelList.Create(AOwner: TComponent); +begin + inherited; + FItems := TList.Create; +end; + +destructor TdxLayoutLookAndFeelList.Destroy; +begin + ClearItems; + FItems.Free; + inherited; +end; + +function TdxLayoutLookAndFeelList.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxLayoutLookAndFeelList.GetIsDesigning: Boolean; +begin + Result := csDesigning in ComponentState; +end; + +function TdxLayoutLookAndFeelList.GetItem(Index: Integer): TdxCustomLayoutLookAndFeel; +begin + Result := FItems[Index]; +end; + +procedure TdxLayoutLookAndFeelList.AddItem(AItem: TdxCustomLayoutLookAndFeel); +begin + FItems.Add(AItem); + AItem.FList := Self; +end; + +procedure TdxLayoutLookAndFeelList.RemoveItem(AItem: TdxCustomLayoutLookAndFeel); +begin + FItems.Remove(AItem); + AItem.FList := nil; +end; + +procedure TdxLayoutLookAndFeelList.ClearItems; +var + I: Integer; +begin + for I := Count - 1 downto 0 do + Items[I].Free; +end; + +procedure TdxLayoutLookAndFeelList.GetChildren(Proc: TGetChildProc; Root: TComponent); +var + I: Integer; +begin + inherited; + if Owner = Root then + for I := 0 to Count - 1 do Proc(Items[I]); +end; + +procedure TdxLayoutLookAndFeelList.Modified; +var + AForm: TCustomForm; +begin + if Owner is TCustomForm then + begin + AForm := TCustomForm(Owner); + if AForm.Designer <> nil then AForm.Designer.Modified; + end; +end; + +procedure TdxLayoutLookAndFeelList.SetName(const Value: TComponentName); +begin + inherited; + if IsDesigning then + dxLayoutDesigner.ComponentNameChanged(Self); +end; + +function TdxLayoutLookAndFeelList.CreateItem(AClass: TdxCustomLayoutLookAndFeelClass): TdxCustomLayoutLookAndFeel; +begin + Result := AClass.Create(Owner); + AddItem(Result); + SetComponentName(Result, AClass.GetBaseName, IsDesigning, False); + Modified; +end; + +{ TdxLayoutLookAndFeelDefs } + +constructor TdxLayoutLookAndFeelDefs.Create; +begin + inherited; + FItems := TList.Create; +end; + +destructor TdxLayoutLookAndFeelDefs.Destroy; +begin + FItems.Free; + inherited; +end; + +function TdxLayoutLookAndFeelDefs.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxLayoutLookAndFeelDefs.GetItem(Index: Integer): TdxCustomLayoutLookAndFeelClass; +begin + Result := TdxCustomLayoutLookAndFeelClass(FItems[Index]); +end; + +function TdxLayoutLookAndFeelDefs.GetItemByDescription(const Value: string): TdxCustomLayoutLookAndFeelClass; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I]; + if Result.Description = Value then Exit; + end; + Result := nil; +end; + +procedure TdxLayoutLookAndFeelDefs.Register(AClass: TdxCustomLayoutLookAndFeelClass); +begin + FItems.Add(AClass); + RegisterClass(AClass); +end; + +procedure TdxLayoutLookAndFeelDefs.Unregister(AClass: TdxCustomLayoutLookAndFeelClass); +begin + FItems.Remove(AClass); +end; + +{ TdxLayoutTextMetrics } + +constructor TdxLayoutTextMetrics.Create; +begin + inherited; + FItems := TList.Create; +end; + +destructor TdxLayoutTextMetrics.Destroy; +begin + DestroyItems; + FItems.Free; + inherited; +end; + +function TdxLayoutTextMetrics.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxLayoutTextMetrics.GetItem(AIndex: Integer): PdxLayoutTextMetric; +begin + Result := FItems[AIndex]; +end; + +procedure TdxLayoutTextMetrics.DestroyItems; +var + I: Integer; +begin + for I := Count - 1 downto 0 do + Delete(I); +end; + +procedure TdxLayoutTextMetrics.CalculateItem(AIndex: Integer); +var + ADC: HDC; + APrevFont: HFONT; +begin + ADC := GetDC(0); + try + APrevFont := SelectObject(ADC, Items[AIndex]^.Font.Handle); + GetTextMetrics(ADC, Items[AIndex]^.TextMetric); + SelectObject(ADC, APrevFont); + finally + ReleaseDC(0, ADC); + end; +end; + +procedure TdxLayoutTextMetrics.Delete(AIndex: Integer); +begin + Dispose(Items[AIndex]); + FItems.Delete(AIndex); +end; + +function TdxLayoutTextMetrics.IndexOf(AFont: TFont): Integer; +begin + for Result := 0 to Count - 1 do + if Items[Result]^.Font = AFont then Exit; + Result := -1; +end; + +procedure TdxLayoutTextMetrics.Get(AFont: TFont; var ATextMetric: TTextMetric); +var + AIndex: Integer; + + function CreateItem: Integer; + var + AItem: PdxLayoutTextMetric; + begin + New(AItem); + AItem^.Font := AFont; + Result := FItems.Add(AItem); + CalculateItem(Result); + end; + +begin + AIndex := IndexOf(AFont); + if AIndex = -1 then + AIndex := CreateItem; + ATextMetric := Items[AIndex]^.TextMetric; +end; + +{procedure TdxLayoutTextMetrics.Update(AFont: TFont); +var + AIndex: Integer; +begin + AIndex := IndexOf(AFont); + if AIndex <> -1 then + CalculateItem(AIndex); +end;} + +procedure TdxLayoutTextMetrics.Unregister(AFont: TFont); +var + AIndex: Integer; +begin + AIndex := IndexOf(AFont); + if AIndex <> -1 then Delete(AIndex); +end; + +initialization + dxLayoutTextMetrics := TdxLayoutTextMetrics.Create; + + dxLayoutLookAndFeelDefs := TdxLayoutLookAndFeelDefs.Create; + + dxLayoutLookAndFeelDefs.Register(TdxLayoutStandardLookAndFeel); + dxLayoutLookAndFeelDefs.Register(TdxLayoutOfficeLookAndFeel); + dxLayoutLookAndFeelDefs.Register(TdxLayoutWebLookAndFeel); + + dxLayoutDefaultLookAndFeel := dxLayoutLookAndFeelDefs[0].Create(nil); + +finalization + FreeAndNil(dxLayoutDefaultLookAndFeel); + + dxLayoutLookAndFeelDefs.Unregister(TdxLayoutWebLookAndFeel); + dxLayoutLookAndFeelDefs.Unregister(TdxLayoutOfficeLookAndFeel); + dxLayoutLookAndFeelDefs.Unregister(TdxLayoutStandardLookAndFeel); + + FreeAndNil(dxLayoutLookAndFeelDefs); + + FreeAndNil(dxLayoutTextMetrics); +end. diff --git a/official/x.35/ExpressLayout Control/Sources/dxLayoutcxEditAdapters.pas b/official/x.35/ExpressLayout Control/Sources/dxLayoutcxEditAdapters.pas new file mode 100644 index 00000000..066022ea --- /dev/null +++ b/official/x.35/ExpressLayout Control/Sources/dxLayoutcxEditAdapters.pas @@ -0,0 +1,113 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressLayoutControl cxEditors adapters } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSLAYOUTCONTROL AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxLayoutcxEditAdapters; + +interface + +uses + dxLayoutControl, cxEdit; + +type + TdxLayoutcxEditAdapter = class(TdxCustomLayoutControlAdapter) + private + function GetControl: TcxCustomEdit; + function GetControlStyle: TcxCustomEditStyle; + protected + procedure Init; override; + property Control: TcxCustomEdit read GetControl; + property ControlStyle: TcxCustomEditStyle read GetControlStyle; + public + procedure LookAndFeelChanged; override; + end; + +implementation + +uses + cxContainer, dxLayoutLookAndFeels; + +type + TcxCustomEditAccess = class(TcxCustomEdit); + TcxCustomEditStyleAccess = class(TcxCustomEditStyle); + +{ TdxLayoutcxEditAdapter } + +function TdxLayoutcxEditAdapter.GetControl: TcxCustomEdit; +begin + Result := TcxCustomEdit(inherited Control); +end; + +function TdxLayoutcxEditAdapter.GetControlStyle: TcxCustomEditStyle; +begin + Result := TcxCustomEditAccess(Control).Style; +end; + +procedure TdxLayoutcxEditAdapter.Init; +begin + inherited; + TcxCustomEditStyleAccess(ControlStyle).HotTrack := False; +end; + +procedure TdxLayoutcxEditAdapter.LookAndFeelChanged; +const + BorderStyles: array[TdxLayoutBorderStyle] of TcxEditBorderStyle = + (ebsNone, ebsSingle, ebsFlat, ebs3D); + ButtonStyles: array[TdxLayoutBorderStyle] of TcxEditButtonStyle = + (btsHotFlat, btsHotFlat, btsFlat, bts3D); + PopupBorderStyles: array[TdxLayoutBorderStyle] of TcxEditPopupBorderStyle = + (epbsSingle, epbsSingle, epbsFlat, epbsFrame3D); +begin + inherited; + with LookAndFeel.ItemOptions, TcxCustomEditStyleAccess(ControlStyle) do + begin + if DefaultBorderStyle <> cbsNone then + begin + BorderColor := GetControlBorderColor; + BorderStyle := BorderStyles[ControlBorderStyle]; + end; + ButtonStyle := ButtonStyles[ControlBorderStyle]; + PopupBorderStyle := PopupBorderStyles[ControlBorderStyle]; + LookAndFeel.SkinName := Self.LookAndFeel.InternalName; + end; +end; + +initialization + TdxLayoutcxEditAdapter.Register(TcxCustomEdit); + +finalization + TdxLayoutcxEditAdapter.Unregister(TcxCustomEdit); + +end. diff --git a/official/x.35/ExpressLayout Control/Sources/dxLayoutdxEditAdapters.pas b/official/x.35/ExpressLayout Control/Sources/dxLayoutdxEditAdapters.pas new file mode 100644 index 00000000..11313f0e --- /dev/null +++ b/official/x.35/ExpressLayout Control/Sources/dxLayoutdxEditAdapters.pas @@ -0,0 +1,130 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressLayoutControl dxEditors adapters } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSLAYOUTCONTROL AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxLayoutdxEditAdapters; + +interface + +uses + dxLayoutControl, dxLayoutLookAndFeels, dxCntner, dxExEdtr; + +type + TdxLayoutdxEditAdapter = class(TdxCustomLayoutControlAdapter) + private + function GetControl: TdxInplaceEdit; + function GetControlStyle: TdxEditStyle; + protected + property Control: TdxInplaceEdit read GetControl; + property ControlStyle: TdxEditStyle read GetControlStyle; + public + procedure LookAndFeelChanged; override; + end; + + TdxLayoutdxDropDownEditAdapter = class(TdxLayoutdxEditAdapter) + private + function GetControl: TdxInplaceDropDownEdit; + protected + property Control: TdxInplaceDropDownEdit read GetControl; + public + procedure LookAndFeelChanged; override; + end; + +implementation + +type + TdxInplaceDropDownEditAccess = class(TdxInplaceDropDownEdit); + +{ TdxLayoutdxEditAdapter } + +function TdxLayoutdxEditAdapter.GetControl: TdxInplaceEdit; +begin + Result := TdxInplaceEdit(inherited Control); +end; + +function TdxLayoutdxEditAdapter.GetControlStyle: TdxEditStyle; +begin + Result := Control.Style; +end; + +procedure TdxLayoutdxEditAdapter.LookAndFeelChanged; +const + BorderStyles: array[TdxLayoutBorderStyle] of TdxEditBorderStyle = + (xbsNone, xbsSingle, xbsFlat, xbs3D); + ButtonStyles: array[TdxLayoutBorderStyle] of TdxEditButtonViewStyle = + (btsSimple, btsSimple, btsFlat, bts3D); +begin + inherited; + with LookAndFeel.ItemOptions, ControlStyle do + begin + if DefaultBorderStyle <> xbsNone then + begin + BorderColor := GetControlBorderColor; + BorderStyle := BorderStyles[ControlBorderStyle]; + end; + ButtonStyle := ButtonStyles[ControlBorderStyle]; + end; +end; + +{ TdxLayoutdxDropDownEditAdapter } + +function TdxLayoutdxDropDownEditAdapter.GetControl: TdxInplaceDropDownEdit; +begin + Result := TdxInplaceDropDownEdit(inherited Control); +end; + +procedure TdxLayoutdxDropDownEditAdapter.LookAndFeelChanged; +const + PopupBorders: array[TdxLayoutBorderStyle] of TdxPopupBorder = + (pbSingle, pbSingle, pbFlat, pbFrame3D); +begin + inherited; + with LookAndFeel.ItemOptions do + begin + if ControlBorderStyle in [lbsNone, lbsSingle] then + ControlStyle.ButtonStyle := btsHotFlat; + TdxInplaceDropDownEditAccess(Control).PopupBorder := PopupBorders[ControlBorderStyle]; + end; +end; + +initialization + TdxLayoutdxEditAdapter.Register(TdxInplaceEdit); + TdxLayoutdxDropDownEditAdapter.Register(TdxInplaceDropDownEdit); + +finalization + TdxLayoutdxDropDownEditAdapter.Unregister(TdxInplaceDropDownEdit); + TdxLayoutdxEditAdapter.Unregister(TdxInplaceEdit); + +end. diff --git a/official/x.35/ExpressLibrary/Help/cxLibrary.cnt b/official/x.35/ExpressLibrary/Help/cxLibrary.cnt new file mode 100644 index 00000000..730147cd --- /dev/null +++ b/official/x.35/ExpressLibrary/Help/cxLibrary.cnt @@ -0,0 +1,72 @@ +:Base cxLibrary.hlp +:Title Express Cross Platform Library +:Index Express Cross Platform Library=cxLibrary.hlp +1 Express Cross Platform Library +2 Known Issues and Important Changes List=CD_Known_Issues_and_Important_Changes_List +2 Concepts +3 Using the cxPropertiesStore Component=IDH_tbh_Using_cxPropertiesStore_component +3 Using the Image List Editor=CD_Using_the_Image_List_Editor +2 Reference +3 Classes +4 TcxCanvas=IDH_Class_TcxCanvas +4 TcxCustomContainerStyle=IDH_Class_TcxCustomContainerStyle +4 TcxCustomLookAndFeelPainter=IDH_Class_TcxCustomLookAndFeelPainter +4 TcxCustomPropertiesStore=IDH_Class_TcxCustomPropertiesStore +4 TcxCustomStyle=IDH_Class_TcxCustomStyle +4 TcxCustomStyles=IDH_Class_TcxCustomStyles +4 TcxCustomStyleSheet=IDH_Class_TcxCustomStyleSheet +4 TcxDialogMetricsInfo=IDH_Class_TcxDialogMetricsInfo>Main +4 TcxDialogsMetricsStore=IDH_Class_TcxDialogsMetricsStore>Main +4 TcxInterfacedPersistent=IDH_Class_TcxInterfacedPersistent +4 TcxLookAndFeel=IDH_Class_TcxLookAndFeel +4 TcxStyle=IDH_Class_TcxStyle +4 TcxStyleController=IDH_Class_TcxStyleController +4 TcxStyles=IDH_Class_TcxStyles +4 TcxComponentCollection=IDH_Class_TcxComponentCollection +4 TcxComponentCollectionItem=IDH_Class_TcxComponentCollectionItem +4 TdxPNGImage=IDH_Class_TdxPNGImage +3 Components +4 TcxImageList=IDH_Class_TcxImageList +4 TcxLookAndFeelController=IDH_Class_TcxLookAndFeelController +4 TcxPropertiesStore=IDH_Class_TcxPropertiesStore +4 TcxStyleRepository=IDH_Class_TcxStyleRepository +3 Cross Platform Controls Ancestors +4 TcxContainer=IDH_Class_TcxContainer +4 TcxControl=IDH_Class_TcxControl +4 TcxControlChildComponent=IDH_Class_TcxControlChildComponent +3 Global Functions & Constants +4 cxContainerShadowWidth constant=IDH_Const_cxContainerShadowWidth +4 cxDefaultAutoCompleteDelay constant=IDH_Const_cxDefaultAutoCompleteDelay +4 cxDefaultLookAndFeelKind constant=IDH_Const_cxDefaultLookAndFeelKind +4 cxDefaultLookAndFeelNativeStyle constant=IDH_Const_cxDefaultLookAndFeelNativeStyle +4 cxDefaultLookAndFeelSkinName constant=IDH_Const_cxDefaultLookAndFeelSkinName +4 cxDialogsMetricsStore=IDH_cxClasses_cxDialogsMetricsStore>Main +4 cxExportGraphicClass constant=IDH_Const_cxExportGraphicClass +4 cxGetResourceString=IDH_cxClasses_cxGetResourceString +4 cxSetResourceString=IDH_cxClasses_cxSetResourceString +4 GetcxContainer=IDH_cxContainer_GetcxContainer +4 LoadStyleSheetsFromIniFile=IDH_cxStyles_LoadStyleSheetsFromIniFile +4 SaveStyleSheetsToIniFile=IDH_cxStyles_SaveStyleSheetsToIniFile +3 Interfaces +4 IcxContainerInnerControl=IDH_Interface_IcxContainerInnerControl +4 IcxDialogMetricsInfoData=IDH_Interface_IcxDialogMetricsInfoData>Main +4 IcxLookAndFeelNotificationListener=IDH_Interface_IcxLookAndFeelNotificationListener +3 Types +4 TcxBorder type=IDH_type_TcxBorder +4 TcxBorders type=IDH_type_TcxBorders +4 TcxCheckBoxState=IDH_Type_TcxCheckBoxState +4 TcxContainerBorderStyle type=IDH_type_TcxContainerBorderStyle +4 TcxContainerStateItem type=IDH_type_TcxContainerStateItem +4 TcxContainerStyleValue type=IDH_Type_TcxContainerStyleValue +4 TcxContainerStyleValues type=IDH_Type_TcxContainerStyleValues +4 TdxSkinName type=IDH_Type_TdxSkinName +3 Units +4 cxClasses=IDH_Unit_cxClasses +4 cxContainer=IDH_Unit_cxContainer +4 cxControls=IDH_Unit_cxControls +4 cxExport=IDH_Unit_cxExport +4 cxGraphics=IDH_Unit_cxGraphics +4 cxLookAndFeels=IDH_Unit_cxLookAndFeels +4 cxPropertiesStore=IDH_Unit_cxPropertiesStore +4 cxStyles=IDH_Unit_cxStyles +4 dxGDIPlusClasses=IDH_Unit_dxGDIPlusClasses diff --git a/official/x.35/ExpressLibrary/Help/cxLibrary.hlp b/official/x.35/ExpressLibrary/Help/cxLibrary.hlp new file mode 100644 index 00000000..d1182a42 Binary files /dev/null and b/official/x.35/ExpressLibrary/Help/cxLibrary.hlp differ diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryC10.bpk b/official/x.35/ExpressLibrary/Packages/cxLibraryC10.bpk new file mode 100644 index 00000000..c5b557d2 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/cxLibraryC10.bpk @@ -0,0 +1,203 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = cxLibraryC10.bpl +OBJFILES = cxLibraryC10.obj cxStyleSheetEditor.obj \ + cxContainer.obj cxControls.obj \ + cxGraphics.obj cxLookAndFeelPainters.obj \ + cxLookAndFeels.obj cxScrollBar.obj \ + cxStorage.obj cxStyles.obj cxDateUtils.obj cxFormats.obj \ + cxClasses.obj cxLibraryStrs.obj cxPropertiesStore.obj \ + cxConverterUtils.obj cxCustomConverter.obj cxLibraryConsts.obj \ + cxGeometry.obj cxDrawTextUtils.obj cxAccessibility.obj cxDWMApi.obj \ + dxSkinInfo.obj dxSkinsCore.obj dxSkinsStrs.obj +RESFILES = cxLibraryC10.res +MAINSOURCE = cxLibraryC10.cpp +RESDEPEN = $(RESFILES) cxStyleSheetEditor.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = dxThemeC10.bpi dxGDIPlusC10.bpi rtl.bpi vcl.bpi +SPARELIBS = dxThemeC10.lib dxGDIPlusC10.lib rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express Cross Platform Library by Developer Express Inc." \ + -aa -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryC10.cpp b/official/x.35/ExpressLibrary/Packages/cxLibraryC10.cpp new file mode 100644 index 00000000..5345751c --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/cxLibraryC10.cpp @@ -0,0 +1,46 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxLibraryC10.res"); +USEPACKAGE("dxGDIPlusC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEFORMNS("cxStyleSheetEditor.pas", Cxstylesheeteditor, frmcxStyleSheetEditor); +USEUNIT("cxContainer.pas"); +USEUNIT("cxControls.pas"); +USEUNIT("cxGraphics.pas"); +USEUNIT("cxLookAndFeelPainters.pas"); +USEUNIT("cxLookAndFeels.pas"); +USEUNIT("cxScrollBar.pas"); +USEUNIT("cxStorage.pas"); +USEUNIT("cxStyles.pas"); +USEUNIT("cxClasses.pas"); +USEUNIT("cxLibraryStrs.pas"); +USEUNIT("cxPropertiesStore.pas"); +USEUNIT("cxConverterUtils.pas"); +USEUNIT("cxCustomConverter.pas"); +USEUNIT("cxGeometry.pas"); +USEUNIT("cxDrawTextUtils.pas"); +USEUNIT("cxAccessibility.pas"); +USEUNIT("cxDWMApi.pas"); +USEUNIT("cxDateUtils.pas"); +USEUNIT("cxFormats.pas"); +USEUNIT("cxLibraryConsts.pas"); +USEUNIT("dxSkinInfo.pas"); +USEUNIT("dxSkinsCore.pas"); +USEUNIT("dxSkinsStrs.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryC10.res b/official/x.35/ExpressLibrary/Packages/cxLibraryC10.res new file mode 100644 index 00000000..0aaac774 Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/cxLibraryC10.res differ diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryC11.bpk b/official/x.35/ExpressLibrary/Packages/cxLibraryC11.bpk new file mode 100644 index 00000000..307b2733 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/cxLibraryC11.bpk @@ -0,0 +1,203 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = cxLibraryC11.bpl +OBJFILES = cxLibraryC11.obj cxStyleSheetEditor.obj \ + cxContainer.obj cxControls.obj \ + cxGraphics.obj cxLookAndFeelPainters.obj \ + cxLookAndFeels.obj cxScrollBar.obj \ + cxStorage.obj cxStyles.obj cxDateUtils.obj cxFormats.obj \ + cxClasses.obj cxLibraryStrs.obj cxPropertiesStore.obj \ + cxConverterUtils.obj cxCustomConverter.obj cxLibraryConsts.obj \ + cxGeometry.obj cxDrawTextUtils.obj cxAccessibility.obj cxDWMApi.obj \ + dxSkinInfo.obj dxSkinsCore.obj dxSkinsStrs.obj +RESFILES = cxLibraryC11.res +MAINSOURCE = cxLibraryC11.cpp +RESDEPEN = $(RESFILES) cxStyleSheetEditor.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = dxThemeC11.bpi dxGDIPlusC11.bpi rtl.bpi vcl.bpi +SPARELIBS = dxThemeC11.lib dxGDIPlusC11.lib rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express Cross Platform Library by Developer Express Inc." \ + -aa -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryC11.cpp b/official/x.35/ExpressLibrary/Packages/cxLibraryC11.cpp new file mode 100644 index 00000000..96588c2d --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/cxLibraryC11.cpp @@ -0,0 +1,46 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxLibraryC11.res"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEFORMNS("cxStyleSheetEditor.pas", Cxstylesheeteditor, frmcxStyleSheetEditor); +USEUNIT("cxContainer.pas"); +USEUNIT("cxControls.pas"); +USEUNIT("cxGraphics.pas"); +USEUNIT("cxLookAndFeelPainters.pas"); +USEUNIT("cxLookAndFeels.pas"); +USEUNIT("cxScrollBar.pas"); +USEUNIT("cxStorage.pas"); +USEUNIT("cxStyles.pas"); +USEUNIT("cxClasses.pas"); +USEUNIT("cxLibraryStrs.pas"); +USEUNIT("cxPropertiesStore.pas"); +USEUNIT("cxConverterUtils.pas"); +USEUNIT("cxCustomConverter.pas"); +USEUNIT("cxGeometry.pas"); +USEUNIT("cxDrawTextUtils.pas"); +USEUNIT("cxAccessibility.pas"); +USEUNIT("cxDWMApi.pas"); +USEUNIT("cxDateUtils.pas"); +USEUNIT("cxFormats.pas"); +USEUNIT("cxLibraryConsts.pas"); +USEUNIT("dxSkinInfo.pas"); +USEUNIT("dxSkinsCore.pas"); +USEUNIT("dxSkinsStrs.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryC11.res b/official/x.35/ExpressLibrary/Packages/cxLibraryC11.res new file mode 100644 index 00000000..cb45dac7 Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/cxLibraryC11.res differ diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryD10.dpk b/official/x.35/ExpressLibrary/Packages/cxLibraryD10.dpk new file mode 100644 index 00000000..a1c193d4 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/cxLibraryD10.dpk @@ -0,0 +1,61 @@ +package cxLibraryD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dxGDIPlusD10, + dxThemeD10; + +contains + cxClasses, + cxControls, + cxGraphics, + cxLookAndFeelPainters, + cxLookAndFeels, + cxStorage, + cxStyles, + cxScrollBar, + cxStyleSheetEditor, + cxContainer, + cxLibraryStrs, + cxPropertiesStore, + cxConverterUtils, + cxCustomConverter, + cxGeometry, + cxDrawTextUtils, + cxAccessibility, + cxDateUtils, + cxFormats, + cxDWMApi, + cxLibraryConsts, + dxSkinInfo, + dxSkinsCore, + dxSkinsStrs; + +end. diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryD10.res b/official/x.35/ExpressLibrary/Packages/cxLibraryD10.res new file mode 100644 index 00000000..95dc2c4d Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/cxLibraryD10.res differ diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryD10NET.dpk b/official/x.35/ExpressLibrary/Packages/cxLibraryD10NET.dpk new file mode 100644 index 00000000..2ac7d7b2 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/cxLibraryD10NET.dpk @@ -0,0 +1,109 @@ +package cxLibraryD10NET; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxThemeD10NET, + System.Drawing; + +contains + cxGraphics, + cxClasses, + cxControls, + cxLibraryStrs, + cxLookAndFeelPainters, + cxLookAndFeels, + cxScrollBar, + cxStorage, + cxStyles, + cxStyleSheetEditor, + cxContainer, + cxGeometry, + cxDrawTextUtils, + cxDateUtils, + cxFormats, + cxAccessibility, + cxDWMApi; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryD10NET.res b/official/x.35/ExpressLibrary/Packages/cxLibraryD10NET.res new file mode 100644 index 00000000..53547796 Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/cxLibraryD10NET.res differ diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryD11.dpk b/official/x.35/ExpressLibrary/Packages/cxLibraryD11.dpk new file mode 100644 index 00000000..b62afecf --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/cxLibraryD11.dpk @@ -0,0 +1,61 @@ +package cxLibraryD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dxGDIPlusD11, + dxThemeD11; + +contains + cxClasses, + cxControls, + cxGraphics, + cxLookAndFeelPainters, + cxLookAndFeels, + cxStorage, + cxStyles, + cxScrollBar, + cxStyleSheetEditor, + cxContainer, + cxLibraryStrs, + cxPropertiesStore, + cxConverterUtils, + cxCustomConverter, + cxGeometry, + cxDrawTextUtils, + cxAccessibility, + cxDateUtils, + cxFormats, + cxDWMApi, + cxLibraryConsts, + dxSkinInfo, + dxSkinsCore, + dxSkinsStrs; + +end. diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryD11.res b/official/x.35/ExpressLibrary/Packages/cxLibraryD11.res new file mode 100644 index 00000000..025d514d Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/cxLibraryD11.res differ diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryD8.dpk b/official/x.35/ExpressLibrary/Packages/cxLibraryD8.dpk new file mode 100644 index 00000000..d99d7c08 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/cxLibraryD8.dpk @@ -0,0 +1,109 @@ +package cxLibraryD8; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxThemeD8, + System.Drawing; + +contains + cxGraphics, + cxClasses, + cxControls, + cxLibraryStrs, + cxLookAndFeelPainters, + cxLookAndFeels, + cxScrollBar, + cxStorage, + cxStyles, + cxStyleSheetEditor, + cxContainer, + cxGeometry, + cxDrawTextUtils, + cxDateUtils, + cxFormats, + cxAccessibility, + cxDWMApi; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryD8.res b/official/x.35/ExpressLibrary/Packages/cxLibraryD8.res new file mode 100644 index 00000000..23ce9684 Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/cxLibraryD8.res differ diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryD9.dpk b/official/x.35/ExpressLibrary/Packages/cxLibraryD9.dpk new file mode 100644 index 00000000..e0efd03c --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/cxLibraryD9.dpk @@ -0,0 +1,61 @@ +package cxLibraryD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dxGDIPlusD9, + dxThemeD9; + +contains + cxClasses, + cxControls, + cxGraphics, + cxLookAndFeelPainters, + cxLookAndFeels, + cxStorage, + cxStyles, + cxScrollBar, + cxStyleSheetEditor, + cxContainer, + cxLibraryStrs, + cxPropertiesStore, + cxConverterUtils, + cxCustomConverter, + cxGeometry, + cxDrawTextUtils, + cxAccessibility, + cxDateUtils, + cxFormats, + cxDWMApi, + cxLibraryConsts, + dxSkinInfo, + dxSkinsCore, + dxSkinsStrs; + +end. diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryD9.res b/official/x.35/ExpressLibrary/Packages/cxLibraryD9.res new file mode 100644 index 00000000..7c46055a Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/cxLibraryD9.res differ diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryD9NET.dpk b/official/x.35/ExpressLibrary/Packages/cxLibraryD9NET.dpk new file mode 100644 index 00000000..8f439adf --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/cxLibraryD9NET.dpk @@ -0,0 +1,109 @@ +package cxLibraryD9NET; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + dxThemeD9NET, + System.Drawing; + +contains + cxGraphics, + cxClasses, + cxControls, + cxLibraryStrs, + cxLookAndFeelPainters, + cxLookAndFeels, + cxScrollBar, + cxStorage, + cxStyles, + cxStyleSheetEditor, + cxContainer, + cxGeometry, + cxDrawTextUtils, + cxDateUtils, + cxFormats, + cxAccessibility, + cxDWMApi; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryD9NET.res b/official/x.35/ExpressLibrary/Packages/cxLibraryD9NET.res new file mode 100644 index 00000000..95758be5 Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/cxLibraryD9NET.res differ diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryVCLC5.bpk b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLC5.bpk new file mode 100644 index 00000000..db51384f --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLC5.bpk @@ -0,0 +1,202 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = cxLibraryVCLC5.bpl +OBJFILES = cxLibraryVCLC5.obj cxStyleSheetEditor.obj \ + cxContainer.obj cxControls.obj \ + cxGraphics.obj cxLookAndFeelPainters.obj \ + cxLookAndFeels.obj cxScrollBar.obj \ + cxStorage.obj cxStyles.obj cxDateUtils.obj cxFormats.obj \ + cxClasses.obj cxLibraryStrs.obj cxPropertiesStore.obj \ + cxConverterUtils.obj cxCustomConverter.obj \ + cxGeometry.obj cxDrawTextUtils.obj cxAccessibility.obj cxDWMApi.obj +RESFILES = cxLibraryVCLC5.res +MAINSOURCE = cxLibraryVCLC5.cpp +RESDEPEN = $(RESFILES) cxStyleSheetEditor.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = dxThemeC5.bpi dxGDIPlusC5.bpi vcl50.bpi +SPARELIBS = dxThemeC5.lib dxGDIPlusC5.lib vcl50.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express Cross Platform Library (VCL Edition) by Developer Express Inc." \ + -aa -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryVCLC5.cpp b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLC5.cpp new file mode 100644 index 00000000..c4273c66 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLC5.cpp @@ -0,0 +1,41 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxLibraryVCLC5.res"); +USEPACKAGE("dxGDIPlusC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEPACKAGE("vcl50.bpi"); +USEFORMNS("cxStyleSheetEditor.pas", Cxstylesheeteditor, frmcxStyleSheetEditor); +USEUNIT("cxContainer.pas"); +USEUNIT("cxControls.pas"); +USEUNIT("cxGraphics.pas"); +USEUNIT("cxLookAndFeelPainters.pas"); +USEUNIT("cxLookAndFeels.pas"); +USEUNIT("cxScrollBar.pas"); +USEUNIT("cxStorage.pas"); +USEUNIT("cxStyles.pas"); +USEUNIT("cxClasses.pas"); +USEUNIT("cxLibraryStrs.pas"); +USEUNIT("cxPropertiesStore.pas"); +USEUNIT("cxConverterUtils.pas"); +USEUNIT("cxCustomConverter.pas"); +USEUNIT("cxGeometry.pas"); +USEUNIT("cxDrawTextUtils.pas"); +USEUNIT("cxAccessibility.pas"); +USEUNIT("cxDWMApi.pas"); +USEUNIT("cxDateUtils.pas"); +USEUNIT("cxFormats.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryVCLC5.res b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLC5.res new file mode 100644 index 00000000..e57e2d60 Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLC5.res differ diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryVCLC6.bpk b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLC6.bpk new file mode 100644 index 00000000..d2326a32 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLC6.bpk @@ -0,0 +1,202 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = cxLibraryVCLC6.bpl +OBJFILES = cxLibraryVCLC6.obj cxStyleSheetEditor.obj \ + cxContainer.obj cxControls.obj \ + cxGraphics.obj cxLookAndFeelPainters.obj \ + cxLookAndFeels.obj cxScrollBar.obj \ + cxStorage.obj cxStyles.obj cxDateUtils.obj cxFormats.obj \ + cxClasses.obj cxLibraryStrs.obj cxPropertiesStore.obj \ + cxConverterUtils.obj cxCustomConverter.obj cxLibraryConsts.obj \ + cxGeometry.obj cxDrawTextUtils.obj cxAccessibility.obj cxDWMApi.obj +RESFILES = cxLibraryVCLC6.res +MAINSOURCE = cxLibraryVCLC6.cpp +RESDEPEN = $(RESFILES) cxStyleSheetEditor.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = dxThemeC6.bpi dxGDIPlusC6.bpi rtl.bpi vcl.bpi +SPARELIBS = dxThemeC6.lib dxGDIPlusC6.lib rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express Cross Platform Library (VCL Edition) by Developer Express Inc." \ + -aa -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryVCLC6.cpp b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLC6.cpp new file mode 100644 index 00000000..d076c1e4 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLC6.cpp @@ -0,0 +1,43 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxLibraryVCLC6.res"); +USEPACKAGE("dxThemeC6.bpi"); +USEPACKAGE("dxGDIPlusC6.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEFORMNS("cxStyleSheetEditor.pas", Cxstylesheeteditor, frmcxStyleSheetEditor); +USEUNIT("cxContainer.pas"); +USEUNIT("cxControls.pas"); +USEUNIT("cxGraphics.pas"); +USEUNIT("cxLookAndFeelPainters.pas"); +USEUNIT("cxLookAndFeels.pas"); +USEUNIT("cxScrollBar.pas"); +USEUNIT("cxStorage.pas"); +USEUNIT("cxStyles.pas"); +USEUNIT("cxClasses.pas"); +USEUNIT("cxLibraryStrs.pas"); +USEUNIT("cxPropertiesStore.pas"); +USEUNIT("cxConverterUtils.pas"); +USEUNIT("cxCustomConverter.pas"); +USEUNIT("cxGeometry.pas"); +USEUNIT("cxDrawTextUtils.pas"); +USEUNIT("cxAccessibility.pas"); +USEUNIT("cxDWMApi.pas"); +USEUNIT("cxDateUtils.pas"); +USEUNIT("cxFormats.pas"); +USEUNIT("cxLibraryConsts.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryVCLC6.res b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLC6.res new file mode 100644 index 00000000..f227b2fa Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLC6.res differ diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryVCLD5.dpk b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLD5.dpk new file mode 100644 index 00000000..3373c90e --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLD5.dpk @@ -0,0 +1,56 @@ +package cxLibraryVCLD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform Library (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxGDIPlusD5, + dxThemeD5; + +contains + cxClasses, + cxControls, + cxGraphics, + cxLookAndFeelPainters, + cxLookAndFeels, + cxStorage, + cxStyles, + cxScrollBar, + cxStyleSheetEditor, + cxContainer, + cxLibraryStrs, + cxPropertiesStore, + cxConverterUtils, + cxCustomConverter, + cxGeometry, + cxDrawTextUtils, + cxAccessibility, + cxDateUtils, + cxFormats, + cxDWMApi; + +end. diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryVCLD5.res b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLD5.res new file mode 100644 index 00000000..81e9bf0a Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLD5.res differ diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryVCLD6.dpk b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLD6.dpk new file mode 100644 index 00000000..33836bcd --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLD6.dpk @@ -0,0 +1,61 @@ +package cxLibraryVCLD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform Library (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dxGDIPlusD6, + dxThemeD6; + +contains + cxClasses, + cxControls, + cxGraphics, + cxLookAndFeelPainters, + cxLookAndFeels, + cxStorage, + cxStyles, + cxScrollBar, + cxStyleSheetEditor, + cxContainer, + cxLibraryStrs, + cxPropertiesStore, + cxConverterUtils, + cxCustomConverter, + cxGeometry, + cxDrawTextUtils, + cxAccessibility, + cxDateUtils, + cxFormats, + cxDWMApi, + cxLibraryConsts, + dxSkinInfo, + dxSkinsCore, + dxSkinsStrs; + +end. diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryVCLD6.res b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLD6.res new file mode 100644 index 00000000..d2fa7cdd Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLD6.res differ diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryVCLD7.dpk b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLD7.dpk new file mode 100644 index 00000000..8060a471 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLD7.dpk @@ -0,0 +1,61 @@ +package cxLibraryVCLD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform Library (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dxGDIPlusD7, + dxThemeD7; + +contains + cxClasses, + cxControls, + cxGraphics, + cxLookAndFeelPainters, + cxLookAndFeels, + cxStorage, + cxStyles, + cxScrollBar, + cxStyleSheetEditor, + cxContainer, + cxLibraryStrs, + cxPropertiesStore, + cxConverterUtils, + cxCustomConverter, + cxGeometry, + cxDrawTextUtils, + cxAccessibility, + cxDateUtils, + cxFormats, + cxDWMApi, + cxLibraryConsts, + dxSkinInfo, + dxSkinsCore, + dxSkinsStrs; + +end. diff --git a/official/x.35/ExpressLibrary/Packages/cxLibraryVCLD7.res b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLD7.res new file mode 100644 index 00000000..ea76b198 Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/cxLibraryVCLD7.res differ diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryC10.bpk b/official/x.35/ExpressLibrary/Packages/dclcxLibraryC10.bpk new file mode 100644 index 00000000..b6210ce5 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/dclcxLibraryC10.bpk @@ -0,0 +1,205 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxLibraryC10.bpl +OBJFILES = dclcxLibraryC10.obj cxClassesReg.obj \ + cxDesignWindows.obj \ + cxPropEditors.obj \ + cxStyleRepositoryEditor.obj \ + cxStyleSheetsLoad.obj cxLibraryReg.obj cxPropertiesStoreEditor.obj \ + cxImportDialog.obj cxConverterFactory.obj \ + cxComponentCollectionEditor.obj cxImageListEditor.obj cxImageListEditorView.obj +RESFILES = dclcxLibraryC10.res cxLibraryReg.dcr +MAINSOURCE = dclcxLibraryC10.cpp +RESDEPEN = $(RESFILES) cxDesignWindows.dfm \ + cxStyleRepositoryEditor.dfm \ + cxStyleSheetsLoad.dfm cxPropertiesStoreEditor.dfm \ + cxComponentCollectionEditor.dfm cxImageListEditorView.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = designide.bpi dxGDIPlusC10.bpi cxLibraryC10.bpi dxThemeC10.bpi rtl.bpi vcl.bpi dbrtl.bpi \ + vcldb.bpi +SPARELIBS = rtl.lib vcl.lib CXLIBRARYC10.lib dxGDIPlusC10.lib dbrtl.lib vcldb.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M -LUdclstd +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express Cross Platform Library by Developer Express Inc." \ + -aa -Tpp -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryC10.cpp b/official/x.35/ExpressLibrary/Packages/dclcxLibraryC10.cpp new file mode 100644 index 00000000..7c8d3601 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/dclcxLibraryC10.cpp @@ -0,0 +1,39 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxLibraryC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("Vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEPACKAGE("dxGDIPlusC10.bpi"); +USEUNIT("cxClassesReg.pas"); +USEFORMNS("cxDesignWindows.pas", Cxdesignwindows, cxDesignFormEditor); +USEUNIT("cxPropEditors.pas"); +USEFORMNS("cxStyleRepositoryEditor.pas", Cxstylerepositoryeditor, cxStyleRepositoryEditor); +USEFORMNS("cxStyleSheetsLoad.pas", Cxstylesheetsload, frmcxStyleSheetsLoad); +USEUNIT("cxLibraryReg.pas"); +USERES("cxLibraryReg.dcr"); +USEUNIT("cxPropertiesStoreEditor.pas"); +USEUNIT("cxImportDialog.pas"); +USEUNIT("cxConverterFactory.pas"); +USEFORMNS("cxComponentCollectionEditor.pas", Cxcomponentcollectioneditor, cxComponentCollectionEditor); +USEUNIT("cxImageListEditor.pas"); +USEFORMNS("cxImageListEditorView.pas", Cximagelisteditorview, cxImageListEditorView); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryC10.res b/official/x.35/ExpressLibrary/Packages/dclcxLibraryC10.res new file mode 100644 index 00000000..a2cb3347 Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/dclcxLibraryC10.res differ diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryC11.bpk b/official/x.35/ExpressLibrary/Packages/dclcxLibraryC11.bpk new file mode 100644 index 00000000..e443c0fb --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/dclcxLibraryC11.bpk @@ -0,0 +1,205 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxLibraryC11.bpl +OBJFILES = dclcxLibraryC11.obj cxClassesReg.obj \ + cxDesignWindows.obj \ + cxPropEditors.obj \ + cxStyleRepositoryEditor.obj \ + cxStyleSheetsLoad.obj cxLibraryReg.obj cxPropertiesStoreEditor.obj \ + cxImportDialog.obj cxConverterFactory.obj \ + cxComponentCollectionEditor.obj cxImageListEditor.obj cxImageListEditorView.obj +RESFILES = dclcxLibraryC11.res cxLibraryReg.dcr +MAINSOURCE = dclcxLibraryC11.cpp +RESDEPEN = $(RESFILES) cxDesignWindows.dfm \ + cxStyleRepositoryEditor.dfm \ + cxStyleSheetsLoad.dfm cxPropertiesStoreEditor.dfm \ + cxComponentCollectionEditor.dfm cxImageListEditorView.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = designide.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxThemeC11.bpi rtl.bpi vcl.bpi dbrtl.bpi \ + vcldb.bpi +SPARELIBS = rtl.lib vcl.lib CXLIBRARYC11.lib dxGDIPlusC11.lib dbrtl.lib vcldb.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M -LUdclstd +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express Cross Platform Library by Developer Express Inc." \ + -aa -Tpp -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryC11.cpp b/official/x.35/ExpressLibrary/Packages/dclcxLibraryC11.cpp new file mode 100644 index 00000000..8c7e56bc --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/dclcxLibraryC11.cpp @@ -0,0 +1,39 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxLibraryC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("Vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEUNIT("cxClassesReg.pas"); +USEFORMNS("cxDesignWindows.pas", Cxdesignwindows, cxDesignFormEditor); +USEUNIT("cxPropEditors.pas"); +USEFORMNS("cxStyleRepositoryEditor.pas", Cxstylerepositoryeditor, cxStyleRepositoryEditor); +USEFORMNS("cxStyleSheetsLoad.pas", Cxstylesheetsload, frmcxStyleSheetsLoad); +USEUNIT("cxLibraryReg.pas"); +USERES("cxLibraryReg.dcr"); +USEUNIT("cxPropertiesStoreEditor.pas"); +USEUNIT("cxImportDialog.pas"); +USEUNIT("cxConverterFactory.pas"); +USEFORMNS("cxComponentCollectionEditor.pas", Cxcomponentcollectioneditor, cxComponentCollectionEditor); +USEUNIT("cxImageListEditor.pas"); +USEFORMNS("cxImageListEditorView.pas", Cximagelisteditorview, cxImageListEditorView); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryC11.res b/official/x.35/ExpressLibrary/Packages/dclcxLibraryC11.res new file mode 100644 index 00000000..823619d8 Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/dclcxLibraryC11.res differ diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryD10.dpk b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD10.dpk new file mode 100644 index 00000000..5f4239e8 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD10.dpk @@ -0,0 +1,52 @@ +package dclcxLibraryD10; + +{$R *.res} +{$R cxLibraryReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES ON} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform Library by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + cxLibraryD10, + dxGDIPlusD10, + dbrtl; + +contains + cxDesignWindows, + cxStyleRepositoryEditor, + cxPropEditors, + cxLibraryReg, + cxStyleSheetsLoad, + cxPropertiesStoreEditor, + cxImportDialog, + cxConverterFactory, + cxComponentCollectionEditor, + cxImageListEditor, + cxImageListEditorView, + cxClassesReg; + +end. diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryD10.res b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD10.res new file mode 100644 index 00000000..a3154d97 Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD10.res differ diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryD10NET.dpk b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD10NET.dpk new file mode 100644 index 00000000..27a2da25 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD10NET.dpk @@ -0,0 +1,104 @@ +package dclcxLibraryD10NET; + + +{$R cxLibraryReg.dcr} +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform Library by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Studio.Vcl.Design, + Borland.Vcl.Design.Standard, + cxLibraryD10NET, + System.Drawing; + +contains + cxStyleSheetsLoad, + cxClassesReg, + cxDesignWindows, + cxLibraryReg, + cxPropEditors, + cxComponentCollectionEditor, + cxImageListEditor, + cxImageListEditorView, + cxStyleRepositoryEditor; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryD10NET.res b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD10NET.res new file mode 100644 index 00000000..10447f0a Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD10NET.res differ diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryD11.dpk b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD11.dpk new file mode 100644 index 00000000..98e7ce98 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD11.dpk @@ -0,0 +1,52 @@ +package dclcxLibraryD11; + +{$R *.res} +{$R cxLibraryReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES ON} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform Library by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + cxLibraryD11, + dxGDIPlusD11, + dbrtl; + +contains + cxDesignWindows, + cxStyleRepositoryEditor, + cxPropEditors, + cxLibraryReg, + cxStyleSheetsLoad, + cxPropertiesStoreEditor, + cxImportDialog, + cxConverterFactory, + cxComponentCollectionEditor, + cxImageListEditor, + cxImageListEditorView, + cxClassesReg; + +end. diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryD11.res b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD11.res new file mode 100644 index 00000000..48c852bf Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD11.res differ diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryD8.dpk b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD8.dpk new file mode 100644 index 00000000..35e31ae0 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD8.dpk @@ -0,0 +1,104 @@ +package dclcxLibraryD8; + + +{$R cxLibraryReg.dcr} +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform Library by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Studio.Vcl.Design, + Borland.Vcl.Design.Standard, + cxLibraryD8, + System.Drawing; + +contains + cxStyleSheetsLoad, + cxClassesReg, + cxDesignWindows, + cxLibraryReg, + cxPropEditors, + cxComponentCollectionEditor, + cxImageListEditor, + cxImageListEditorView, + cxStyleRepositoryEditor; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryD8.res b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD8.res new file mode 100644 index 00000000..0524c9e1 Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD8.res differ diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryD9.dpk b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD9.dpk new file mode 100644 index 00000000..9c6de1d2 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD9.dpk @@ -0,0 +1,51 @@ +package dclcxLibraryD9; + +{$R *.res} +{$R cxLibraryReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES ON} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform Library by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + cxLibraryD9, + dxGDIPlusD9, + dbrtl; + +contains + cxDesignWindows, + cxStyleRepositoryEditor, + cxPropEditors, + cxLibraryReg, + cxStyleSheetsLoad, + cxPropertiesStoreEditor, + cxImportDialog, + cxConverterFactory, + cxImageListEditor, + cxImageListEditorView, + cxClassesReg; + +end. diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryD9.res b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD9.res new file mode 100644 index 00000000..6af82907 Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD9.res differ diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryD9NET.dpk b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD9NET.dpk new file mode 100644 index 00000000..f1db8220 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD9NET.dpk @@ -0,0 +1,104 @@ +package dclcxLibraryD9NET; + + +{$R cxLibraryReg.dcr} +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform Library by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Studio.Vcl.Design, + Borland.Vcl.Design.Standard, + cxLibraryD9NET, + System.Drawing; + +contains + cxStyleSheetsLoad, + cxClassesReg, + cxDesignWindows, + cxLibraryReg, + cxPropEditors, + cxComponentCollectionEditor, + cxImageListEditor, + cxImageListEditorView, + cxStyleRepositoryEditor; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryD9NET.res b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD9NET.res new file mode 100644 index 00000000..867003a8 Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/dclcxLibraryD9NET.res differ diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLC5.bpk b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLC5.bpk new file mode 100644 index 00000000..a979b701 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLC5.bpk @@ -0,0 +1,203 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dclcxLibraryVCLC5.bpl +OBJFILES = dclcxLibraryVCLC5.obj cxClassesReg.obj \ + cxDesignWindows.obj \ + cxPropEditors.obj cxStyleRepositoryEditor.obj \ + cxStyleSheetsLoad.obj cxLibraryReg.obj cxPropertiesStoreEditor.obj \ + cxImportDialog.obj cxConverterFactory.obj \ + cxComponentCollectionEditor.obj cxImageListEditor.obj cxImageListEditorView.obj + +RESFILES = dclcxLibraryVCLC5.res cxLibraryReg.dcr +MAINSOURCE = dclcxLibraryVCLC5.cpp +RESDEPEN = $(RESFILES) cxDesignWindows.dfm \ + cxStyleRepositoryEditor.dfm cxPropertiesStoreEditor.dfm \ + cxStyleSheetsLoad.dfm cxComponentCollectionEditor.dfm cxImageListEditorView.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = dsnide50.bpi cxLibraryVCLC5.bpi dxGDIPlusC5.bpi dxThemeC5.bpi vcl50.bpi vcldb50.bpi +SPARELIBS = vcl50.lib CXLIBRARYVCLC5.lib dxGDIPlusC5.lib vcldb50.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M -LUdclstd50 +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express Cross Platform Library (VCL Edition) by Developer Express Inc." \ + -aa -Tpp -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLC5.cpp b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLC5.cpp new file mode 100644 index 00000000..eacb6995 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLC5.cpp @@ -0,0 +1,37 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxLibraryVCLC5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("dsnide50.bpi"); +USEPACKAGE("Vcldb50.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("dxGDIPlusC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEUNIT("cxClassesReg.pas"); +USEFORMNS("cxDesignWindows.pas", Cxdesignwindows, cxDesignFormEditor); +USEUNIT("cxPropEditors.pas"); +USEFORMNS("cxStyleRepositoryEditor.pas", Cxstylerepositoryeditor, cxStyleRepositoryEditor); +USEFORMNS("cxStyleSheetsLoad.pas", Cxstylesheetsload, frmcxStyleSheetsLoad); +USEUNIT("cxLibraryReg.pas"); +USERES("cxLibraryReg.dcr"); +USEUNIT("cxPropertiesStoreEditor.pas"); +USEUNIT("cxImportDialog.pas"); +USEUNIT("cxConverterFactory.pas"); +USEFORMNS("cxComponentCollectionEditor.pas", Cxcomponentcollectioneditor, cxComponentCollectionEditor); +USEUNIT("cxImageListEditor.pas"); +USEFORMNS("cxImageListEditorView.pas", Cximagelisteditorview, cxImageListEditorView); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLC5.res b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLC5.res new file mode 100644 index 00000000..651e8e43 Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLC5.res differ diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLC6.bpk b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLC6.bpk new file mode 100644 index 00000000..2f937034 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLC6.bpk @@ -0,0 +1,204 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxLibraryVCLC6.bpl +OBJFILES = dclcxLibraryVCLC6.obj cxClassesReg.obj \ + cxDesignWindows.obj \ + cxPropEditors.obj cxStyleRepositoryEditor.obj \ + cxStyleSheetsLoad.obj cxLibraryReg.obj cxPropertiesStoreEditor.obj \ + cxImportDialog.obj cxConverterFactory.obj \ + cxComponentCollectionEditor.obj cxImageListEditor.obj cxImageListEditorView.obj +RESFILES = dclcxLibraryVCLC6.res cxLibraryReg.dcr +MAINSOURCE = dclcxLibraryVCLC6.cpp +RESDEPEN = $(RESFILES) cxDesignWindows.dfm \ + cxStyleRepositoryEditor.dfm \ + cxStyleSheetsLoad.dfm cxPropertiesStoreEditor.dfm \ + cxComponentCollectionEditor.dfm cxImageListEditorView.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = designide.bpi cxLibraryVCLC6.bpi dxGDIPlusC6.bpi dxThemeC6.bpi rtl.bpi vcl.bpi dbrtl.bpi \ + vcldb.bpi +SPARELIBS = rtl.lib vcl.lib CXLIBRARYVCLC6.lib dxGDIPlusC6.lib dbrtl.lib vcldb.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M -LUdclstd +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express Cross Platform Library (VCL Edition) by Developer Express Inc." \ + -aa -Tpp -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLC6.cpp b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLC6.cpp new file mode 100644 index 00000000..34c38ef4 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLC6.cpp @@ -0,0 +1,39 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxLibraryVCLC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("Vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("dxGDIPlusC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEUNIT("cxClassesReg.pas"); +USEFORMNS("cxDesignWindows.pas", Cxdesignwindows, cxDesignFormEditor); +USEUNIT("cxPropEditors.pas"); +USEFORMNS("cxStyleRepositoryEditor.pas", Cxstylerepositoryeditor, cxStyleRepositoryEditor); +USEFORMNS("cxStyleSheetsLoad.pas", Cxstylesheetsload, frmcxStyleSheetsLoad); +USEUNIT("cxLibraryReg.pas"); +USERES("cxLibraryReg.dcr"); +USEUNIT("cxPropertiesStoreEditor.pas"); +USEUNIT("cxImportDialog.pas"); +USEUNIT("cxConverterFactory.pas"); +USEFORMNS("cxComponentCollectionEditor.pas", Cxcomponentcollectioneditor, cxComponentCollectionEditor); +USEUNIT("cxImageListEditor.pas"); +USEFORMNS("cxImageListEditorView.pas", Cximagelisteditorview, cxImageListEditorView); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLC6.res b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLC6.res new file mode 100644 index 00000000..8d3e1bf4 Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLC6.res differ diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLD5.dpk b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLD5.dpk new file mode 100644 index 00000000..8cf52772 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLD5.dpk @@ -0,0 +1,51 @@ +package dclcxLibraryVCLD5; + +{$R *.RES} +{$R cxLibraryReg.dcr} +{$ALIGN OFF} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA OFF} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES ON} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform Library (VCL Edition) by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + cxLibraryVCLD5, + dxGDIPlusD5, + dsnide50, + Vcldb50; + +contains + cxDesignWindows, + cxStyleRepositoryEditor, + cxPropEditors, + cxLibraryReg, + cxStyleSheetsLoad, + cxPropertiesStoreEditor, + cxImportDialog, + cxConverterFactory, + cxComponentCollectionEditor, + cxImageListEditor, + cxImageListEditorView, + cxClassesReg; + +end. diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLD5.res b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLD5.res new file mode 100644 index 00000000..fbe25ba3 Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLD5.res differ diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLD6.dpk b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLD6.dpk new file mode 100644 index 00000000..a97f4b91 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLD6.dpk @@ -0,0 +1,52 @@ +package dclcxLibraryVCLD6; + +{$R *.res} +{$R cxLibraryReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES ON} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform Library (VCL Edition) by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + cxLibraryVCLD6, + dxGDIPlusD6, + dbrtl; + +contains + cxDesignWindows, + cxStyleRepositoryEditor, + cxPropEditors, + cxLibraryReg, + cxStyleSheetsLoad, + cxPropertiesStoreEditor, + cxImportDialog, + cxConverterFactory, + cxComponentCollectionEditor, + cxImageListEditor, + cxImageListEditorView, + cxClassesReg; + +end. diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLD6.res b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLD6.res new file mode 100644 index 00000000..d3d4e7de Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLD6.res differ diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLD7.dpk b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLD7.dpk new file mode 100644 index 00000000..13758118 --- /dev/null +++ b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLD7.dpk @@ -0,0 +1,52 @@ +package dclcxLibraryVCLD7; + +{$R *.res} +{$R cxLibraryReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES ON} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform Library (VCL Edition) by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + cxLibraryVCLD7, + dxGDIPlusD7, + dbrtl; + +contains + cxDesignWindows, + cxStyleRepositoryEditor, + cxPropEditors, + cxLibraryReg, + cxStyleSheetsLoad, + cxPropertiesStoreEditor, + cxImportDialog, + cxConverterFactory, + cxComponentCollectionEditor, + cxImageListEditor, + cxImageListEditorView, + cxClassesReg; + +end. diff --git a/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLD7.res b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLD7.res new file mode 100644 index 00000000..a6ba77bf Binary files /dev/null and b/official/x.35/ExpressLibrary/Packages/dclcxLibraryVCLD7.res differ diff --git a/official/x.35/ExpressLibrary/Sources/TcxImageList.bmp b/official/x.35/ExpressLibrary/Sources/TcxImageList.bmp new file mode 100644 index 00000000..37b7a605 Binary files /dev/null and b/official/x.35/ExpressLibrary/Sources/TcxImageList.bmp differ diff --git a/official/x.35/ExpressLibrary/Sources/TcxLookAndFeelController.bmp b/official/x.35/ExpressLibrary/Sources/TcxLookAndFeelController.bmp new file mode 100644 index 00000000..4aad7998 Binary files /dev/null and b/official/x.35/ExpressLibrary/Sources/TcxLookAndFeelController.bmp differ diff --git a/official/x.35/ExpressLibrary/Sources/TcxPropertiesStore.bmp b/official/x.35/ExpressLibrary/Sources/TcxPropertiesStore.bmp new file mode 100644 index 00000000..d7f5e928 Binary files /dev/null and b/official/x.35/ExpressLibrary/Sources/TcxPropertiesStore.bmp differ diff --git a/official/x.35/ExpressLibrary/Sources/TcxStyleRepository.bmp b/official/x.35/ExpressLibrary/Sources/TcxStyleRepository.bmp new file mode 100644 index 00000000..9f1488a8 Binary files /dev/null and b/official/x.35/ExpressLibrary/Sources/TcxStyleRepository.bmp differ diff --git a/official/x.35/ExpressLibrary/Sources/cxAccessibility.pas b/official/x.35/ExpressLibrary/Sources/cxAccessibility.pas new file mode 100644 index 00000000..422bd65f --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxAccessibility.pas @@ -0,0 +1,1047 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library graphics classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxAccessibility; + +interface + +{$I cxVer.inc} + +uses + Windows, ActiveX, Classes, OleServer, Messages, cxClasses; + +(*$HPPEMIT '#include *) + +const + cxAccessibleObjectSelfID = 0; + + SID_IcxAccessible = '{618736E0-3C3D-11CF-810C-00AA00389B71}'; + IID_IcxAccessible: TGUID = SID_IcxAccessible; + +type + TcxAccessibilityHelper = class; + + TcxAccessibleSimpleChildElementID = 0..MaxInt; + + TcxAccessibleObjectProperty = (aopDefaultAction, aopDescription, aopFocus, + aopLocation, aopShortcut, aopValue); + TcxAccessibleObjectProperties = set of TcxAccessibleObjectProperty; + + TcxAccessibleObjectHitTest = (aohtNone, aohtSelf, aohtChild); + + TcxAccessibilityNavigationDirection = (andLeft, andUp, andRight, andDown, + andPrev, andNext); + + { IcxAccessible } + + IcxAccessible = interface(IDispatch) + [SID_IcxAccessible] + function Get_accParent(out ppdispParent: IDispatch): HResult; stdcall; + function Get_accChildCount(out pcountChildren: Integer): HResult; stdcall; + function Get_accChild(varChild: OleVariant; out ppdispChild: IDispatch): HResult; stdcall; + function Get_accName(varChild: OleVariant; out pszName: WideString): HResult; stdcall; + function Get_accValue(varChild: OleVariant; out pszValue: WideString): HResult; stdcall; + function Get_accDescription(varChild: OleVariant; out pszDescription: WideString): HResult; stdcall; + function Get_accRole(varChild: OleVariant; out pvarRole: OleVariant): HResult; stdcall; + function Get_accState(varChild: OleVariant; out pvarState: OleVariant): HResult; stdcall; + function Get_accHelp(varChild: OleVariant; out pszHelp: WideString): HResult; stdcall; + function Get_accHelpTopic(out pszHelpFile: WideString; varChild: OleVariant; + out pidTopic: Integer): HResult; stdcall; + function Get_accKeyboardShortcut(varChild: OleVariant; out pszKeyboardShortcut: WideString): HResult; stdcall; + function Get_accFocus(out pvarChild: OleVariant): HResult; stdcall; + function Get_accSelection(out pvarChildren: OleVariant): HResult; stdcall; + function Get_accDefaultAction(varChild: OleVariant; out pszDefaultAction: WideString): HResult; stdcall; + function accSelect(flagsSelect: Integer; varChild: OleVariant): HResult; stdcall; + function accLocation(out pxLeft: Integer; out pyTop: Integer; out pcxWidth: Integer; + out pcyHeight: Integer; varChild: OleVariant): HResult; stdcall; + function accNavigate(navDir: Integer; varStart: OleVariant; out pvarEndUpAt: OleVariant): HResult; stdcall; + function accHitTest(xLeft: Integer; yTop: Integer; out pvarChild: OleVariant): HResult; stdcall; + function accDoDefaultAction(varChild: OleVariant): HResult; stdcall; + function Set_accName(varChild: OleVariant; const pszName: WideString): HResult; stdcall; + function Set_accValue(varChild: OleVariant; const pszValue: WideString): HResult; stdcall; + end; + + IcxAccessibilityHelper = interface + ['{D4890860-09B2-4648-BD9E-DFFBD140E5F1}'] + function GetHelper: TcxAccessibilityHelper; + procedure OwnerObjectDestroyed; + end; + + TcxAccessibilityHelper = class(TInterfacedObject, IDispatch, IOleWindow, + IcxAccessible, IcxAccessibilityHelper) + private + FIsOwnerObjectLive: Boolean; + + // IDispatch + function GetIDsOfNames(const IID: TGUID; Names: Pointer; + NameCount, LocaleID: Integer; DispIDs: Pointer): HResult; stdcall; + function GetTypeInfo(Index, LocaleID: Integer; out TypeInfo): HResult; stdcall; + function GetTypeInfoCount(out Count: Integer): HResult; stdcall; + function Invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer; + Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult; stdcall; + // IOleWindow + function ContextSensitiveHelp(fEnterMode: BOOL): HResult; stdcall; + function GetWindow(out wnd: HWnd): HResult; stdcall; + // IcxAccessible + function accDoDefaultAction(varChild: OleVariant): HResult; stdcall; + function accHitTest(xLeft: Integer; yTop: Integer; out pvarChild: OleVariant): HResult; stdcall; + function accLocation(out pxLeft: Integer; out pyTop: Integer; out pcxWidth: Integer; + out pcyHeight: Integer; varChild: OleVariant): HResult; stdcall; + function accNavigate(navDir: Integer; varStart: OleVariant; out pvarEndUpAt: OleVariant): HResult; stdcall; + function accSelect(flagsSelect: Integer; varChild: OleVariant): HResult; stdcall; + function Get_accChild(varChild: OleVariant; out ppdispChild: IDispatch): HResult; stdcall; + function Get_accChildCount(out pcountChildren: Integer): HResult; stdcall; + function Get_accDefaultAction(varChild: OleVariant; out pszDefaultAction: WideString): HResult; stdcall; + function Get_accDescription(varChild: OleVariant; out pszDescription: WideString): HResult; stdcall; + function Get_accFocus(out pvarChild: OleVariant): HResult; stdcall; + function Get_accHelp(varChild: OleVariant; out pszHelp: WideString): HResult; stdcall; + function Get_accHelpTopic(out pszHelpFile: WideString; varChild: OleVariant; + out pidTopic: Integer): HResult; stdcall; + function Get_accKeyboardShortcut(varChild: OleVariant; out pszKeyboardShortcut: WideString): HResult; stdcall; + function Get_accName(varChild: OleVariant; out pszName: WideString): HResult; stdcall; + function Get_accParent(out ppdispParent: IDispatch): HResult; stdcall; + function Get_accRole(varChild: OleVariant; out pvarRole: OleVariant): HResult; stdcall; + function Get_accSelection(out pvarChildren: OleVariant): HResult; stdcall; + function Get_accState(varChild: OleVariant; out pvarState: OleVariant): HResult; stdcall; + function Get_accValue(varChild: OleVariant; out pszValue: WideString): HResult; stdcall; + function Set_accName(varChild: OleVariant; const pszName: WideString): HResult; stdcall; + function Set_accValue(varChild: OleVariant; const pszValue: WideString): HResult; stdcall; + + function CheckIsOwnerObjectLive(out AErrorCode: HResult): Boolean; + procedure CheckSimpleChildElementToBeReturned(var AVarChild: OleVariant); + procedure CheckStringToBeReturned(const AStr: WideString; out AResult: HResult); + function GetSimpleChildElementID(AChildID: OleVariant; + out ASimpleChildElementID: TcxAccessibleSimpleChildElementID; + out AErrorCode: HResult): Boolean; + function GetVisible: Boolean; + protected + FOwnerObject: TObject; + + // IcxAccessibilityHelper + function GetHelper: TcxAccessibilityHelper; + procedure OwnerObjectDestroyed; virtual; + + function ChildIsSimpleElement(AIndex: Integer): Boolean; virtual; + procedure DoDefaultAction(AChildID: TcxAccessibleSimpleChildElementID); virtual; + function Focused(out AIsChildFocused: Boolean; + out AFocusedChildIndex: Integer): Boolean; virtual; + function GetChild(AIndex: Integer): TcxAccessibilityHelper; virtual; + function GetChildCount: Integer; virtual; + function GetChildIndex(AChild: TcxAccessibilityHelper): Integer; virtual; + function GetDefaultActionDescription(AChildID: TcxAccessibleSimpleChildElementID): string; virtual; + function GetDescription(AChildID: TcxAccessibleSimpleChildElementID): string; virtual; + function GetHitTest(AScreenX, AScreenY: Integer; out AChildIndex: Integer): TcxAccessibleObjectHitTest; virtual; + procedure GetKeyboardAccessParameters(AChildID: TcxAccessibleSimpleChildElementID; + out AShortCut: TShortCut; out ACaptionWithAccelChars: string); virtual; + function GetName(AChildID: TcxAccessibleSimpleChildElementID): string; virtual; + function GetOwnerObjectWindow: HWND; virtual; + function GetParent: TcxAccessibilityHelper; virtual; + function GetRole(AChildID: TcxAccessibleSimpleChildElementID): Integer; virtual; + function GetScreenBounds(AChildID: TcxAccessibleSimpleChildElementID): TRect; virtual; + function GetSelectable: Boolean; virtual; + function GetState(AChildID: TcxAccessibleSimpleChildElementID): Integer; virtual; + function GetSupportedProperties(AChildID: TcxAccessibleSimpleChildElementID): TcxAccessibleObjectProperties; virtual; + function GetValue(AChildID: TcxAccessibleSimpleChildElementID): string; virtual; + function NavigateToChild(ACurrentChildIndex: Integer; ADirection: TcxAccessibilityNavigationDirection): Integer; virtual; // andPrev, andNext must prevent looping + procedure SetValue(AChildID: TcxAccessibleSimpleChildElementID; const Value: string); virtual; + + function GetRootHelper: TcxAccessibilityHelper; + public + constructor Create(AOwnerObject: TObject); virtual; + function GetNextSelectableChildIndex(AStartIndex: Integer; + AGoForward: Boolean): Integer; + property Childs[AIndex: Integer]: TcxAccessibilityHelper read GetChild; + property ChildCount: Integer read GetChildCount; + property IsOwnerObjectLive: Boolean read FIsOwnerObjectLive; + property OwnerObject: TObject read FOwnerObject; + property OwnerObjectWindow: HWND read GetOwnerObjectWindow; + property Parent: TcxAccessibilityHelper read GetParent; + property Selectable: Boolean read GetSelectable; + property States[AChildID: TcxAccessibleSimpleChildElementID]: Integer read GetState; + property Visible: Boolean read GetVisible; + end; + + TcxAccessibilityHelperClass = class of TcxAccessibilityHelper; + +const + cxROLE_SYSTEM_TITLEBAR = $1; + cxROLE_SYSTEM_MENUBAR = $2; + cxROLE_SYSTEM_SCROLLBAR = $3; + cxROLE_SYSTEM_GRIP = $4; + cxROLE_SYSTEM_SOUND = $5; + cxROLE_SYSTEM_CURSOR = $6; + cxROLE_SYSTEM_CARET = $7; + cxROLE_SYSTEM_ALERT = $8; + cxROLE_SYSTEM_WINDOW = $9; + cxROLE_SYSTEM_CLIENT = $a; + cxROLE_SYSTEM_MENUPOPUP = $b; + cxROLE_SYSTEM_MENUITEM = $c; + cxROLE_SYSTEM_TOOLTIP = $d; + cxROLE_SYSTEM_APPLICATION = $e; + cxROLE_SYSTEM_DOCUMENT = $f; + cxROLE_SYSTEM_PANE = $10; + cxROLE_SYSTEM_CHART = $11; + cxROLE_SYSTEM_DIALOG = $12; + cxROLE_SYSTEM_BORDER = $13; + cxROLE_SYSTEM_GROUPING = $14; + cxROLE_SYSTEM_SEPARATOR = $15; + cxROLE_SYSTEM_TOOLBAR = $16; + cxROLE_SYSTEM_STATUSBAR = $17; + cxROLE_SYSTEM_TABLE = $18; + cxROLE_SYSTEM_COLUMNHEADER = $19; + cxROLE_SYSTEM_ROWHEADER = $1a; + cxROLE_SYSTEM_COLUMN = $1b; + cxROLE_SYSTEM_ROW = $1c; + cxROLE_SYSTEM_CELL = $1d; + cxROLE_SYSTEM_LINK = $1e; + cxROLE_SYSTEM_HELPBALLOON = $1f; + cxROLE_SYSTEM_CHARACTER = $20; + cxROLE_SYSTEM_LIST = $21; + cxROLE_SYSTEM_LISTITEM = $22; + cxROLE_SYSTEM_OUTLINE = $23; + cxROLE_SYSTEM_OUTLINEITEM = $24; + cxROLE_SYSTEM_PAGETAB = $25; + cxROLE_SYSTEM_PROPERTYPAGE = $26; + cxROLE_SYSTEM_INDICATOR = $27; + cxROLE_SYSTEM_GRAPHIC = $28; + cxROLE_SYSTEM_STATICTEXT = $29; + cxROLE_SYSTEM_TEXT = $2a; + cxROLE_SYSTEM_PUSHBUTTON = $2b; + cxROLE_SYSTEM_CHECKBUTTON = $2c; + cxROLE_SYSTEM_RADIOBUTTON = $2d; + cxROLE_SYSTEM_COMBOBOX = $2e; + cxROLE_SYSTEM_DROPLIST = $2f; + cxROLE_SYSTEM_PROGRESSBAR = $30; + cxROLE_SYSTEM_DIAL = $31; + cxROLE_SYSTEM_HOTKEYFIELD = $32; + cxROLE_SYSTEM_SLIDER = $33; + cxROLE_SYSTEM_SPINBUTTON = $34; + cxROLE_SYSTEM_DIAGRAM = $35; + cxROLE_SYSTEM_ANIMATION = $36; + cxROLE_SYSTEM_EQUATION = $37; + cxROLE_SYSTEM_BUTTONDROPDOWN = $38; + cxROLE_SYSTEM_BUTTONMENU = $39; + cxROLE_SYSTEM_BUTTONDROPDOWNGRID = $3a; + cxROLE_SYSTEM_WHITESPACE = $3b; + cxROLE_SYSTEM_PAGETABLIST = $3c; + cxROLE_SYSTEM_CLOCK = $3d; + cxROLE_SYSTEM_SPLITBUTTON = $3e; + cxROLE_SYSTEM_IPADDRESS = $3f; + cxROLE_SYSTEM_OUTLINEBUTTON = $40; + + cxSTATE_SYSTEM_NORMAL = $0; + cxSTATE_SYSTEM_UNAVAILABLE = $1; + cxSTATE_SYSTEM_SELECTED = $2; + cxSTATE_SYSTEM_FOCUSED = $4; + cxSTATE_SYSTEM_PRESSED = $8; + cxSTATE_SYSTEM_CHECKED = $10; + cxSTATE_SYSTEM_MIXED = $20; + cxSTATE_SYSTEM_INDETERMINATE = cxSTATE_SYSTEM_MIXED; + cxSTATE_SYSTEM_READONLY = $40; + cxSTATE_SYSTEM_HOTTRACKED = $80; + cxSTATE_SYSTEM_DEFAULT = $100; + cxSTATE_SYSTEM_EXPANDED = $200; + cxSTATE_SYSTEM_COLLAPSED = $400; + cxSTATE_SYSTEM_BUSY = $800; + cxSTATE_SYSTEM_FLOATING = $1000; + cxSTATE_SYSTEM_MARQUEED = $2000; + cxSTATE_SYSTEM_ANIMATED = $4000; + cxSTATE_SYSTEM_INVISIBLE = $8000; + cxSTATE_SYSTEM_OFFSCREEN = $10000; + cxSTATE_SYSTEM_SIZEABLE = $20000; + cxSTATE_SYSTEM_MOVEABLE = $40000; + cxSTATE_SYSTEM_SELFVOICING = $80000; + cxSTATE_SYSTEM_FOCUSABLE = $100000; + cxSTATE_SYSTEM_SELECTABLE = $200000; + cxSTATE_SYSTEM_LINKED = $400000; + cxSTATE_SYSTEM_TRAVERSED = $800000; + cxSTATE_SYSTEM_MULTISELECTABLE = $1000000; + cxSTATE_SYSTEM_EXTSELECTABLE = $2000000; + cxSTATE_SYSTEM_ALERT_LOW = $4000000; + cxSTATE_SYSTEM_ALERT_MEDIUM = $8000000; + cxSTATE_SYSTEM_ALERT_HIGH = $10000000; + cxSTATE_SYSTEM_PROTECTED = $20000000; + cxSTATE_SYSTEM_VALID = $7fffffff; + cxSTATE_SYSTEM_HASPOPUP = $40000000; + +function WMGetObjectResultFromIAccessibilityHelper( + const AWMGetObjectMessage: TMessage; AIHelper: IcxAccessibilityHelper): LRESULT; + +function CanReturnAccessibleObject(const AWMGetObjectMessage: TMessage): Boolean; +function IsAccessibilitySupported: Boolean; + +implementation + +uses + Menus, SysUtils, cxControls; + +const + NAVDIR_UP = $1 ; + NAVDIR_DOWN = $2 ; + NAVDIR_LEFT = $3 ; + NAVDIR_RIGHT = $4 ; + NAVDIR_NEXT = $5 ; + NAVDIR_PREVIOUS = $6 ; + NAVDIR_FIRSTCHILD = $7 ; + NAVDIR_LASTCHILD = $8 ; + + CO_E_OBJECTNOTCONNECTED = 0; // TODO + + OleaccLibraryName = 'oleacc.dll'; + +var + FcxAccessibleObjectFromWindow: function(hwnd: THandle; dwId: DWORD; + const riid: TGUID; out ppvObject): HRESULT; stdcall = nil; + FcxLResultFromObject: function(const riid: TGUID; + wParam: WPARAM; punk: IUnknown): LRESULT; stdcall = nil; + FOleaccLibrary: HMODULE; + +function WMGetObjectResultFromIAccessibilityHelper( + const AWMGetObjectMessage: TMessage; AIHelper: IcxAccessibilityHelper): LRESULT; +begin + Result := FcxLResultFromObject(IID_IcxAccessible, AWMGetObjectMessage.WParam, + AIHelper as IcxAccessible); +end; + +function CanReturnAccessibleObject(const AWMGetObjectMessage: TMessage): Boolean; +begin + Result := IsAccessibilitySupported and + (Cardinal(AWMGetObjectMessage.LParam) = OBJID_CLIENT); +end; + +function IsAccessibilitySupported: Boolean; +begin + Result := Assigned(FcxLResultFromObject); +end; + +function cxGetAccessibleObjectFromWindow(hwnd: THandle; dwId: DWORD; + const riid: TGUID; out ppvObject): HRESULT; +begin + Result := FcxAccessibleObjectFromWindow(hwnd, dwId, riid, ppvObject); +end; + +{ TcxAccessibilityHelper } + +constructor TcxAccessibilityHelper.Create(AOwnerObject: TObject); +begin + inherited Create; + FIsOwnerObjectLive := True; + FOwnerObject := AOwnerObject; +end; + +function TcxAccessibilityHelper.GetNextSelectableChildIndex(AStartIndex: Integer; + AGoForward: Boolean): Integer; +var + ACount, AStep, I: Integer; +begin + Result := -1; + + ACount := ChildCount; + if AStartIndex < 0 then + if AGoForward then + AStartIndex := -1 + else + AStartIndex := ACount + else + if AStartIndex >= ACount then + raise Exception.Create(''); + I := AStartIndex; + + if AGoForward then + AStep := 1 + else + AStep := -1; + + repeat + Inc(I, AStep); + if (I < 0) or (I = ACount) then + Break; + if Childs[I].Selectable then + Result := I; + until Result <> -1; +end; + +// IcxAccessibilityHelper +function TcxAccessibilityHelper.GetHelper: TcxAccessibilityHelper; +begin + Result := Self; +end; + +procedure TcxAccessibilityHelper.OwnerObjectDestroyed; +begin + FIsOwnerObjectLive := False; +end; + +function TcxAccessibilityHelper.ChildIsSimpleElement(AIndex: Integer): Boolean; +begin + raise Exception.Create(''); +end; + +procedure TcxAccessibilityHelper.DoDefaultAction( + AChildID: TcxAccessibleSimpleChildElementID); +begin +end; + +function TcxAccessibilityHelper.Focused(out AIsChildFocused: Boolean; + out AFocusedChildIndex: Integer): Boolean; +begin + Result := False; +end; + +function TcxAccessibilityHelper.GetChild( + AIndex: Integer): TcxAccessibilityHelper; +begin + Result := nil; +end; + +function TcxAccessibilityHelper.GetChildCount: Integer; +begin + Result := 0; +end; + +function TcxAccessibilityHelper.GetChildIndex( + AChild: TcxAccessibilityHelper): Integer; +begin + raise Exception.Create(''); +end; + +function TcxAccessibilityHelper.GetDefaultActionDescription( + AChildID: TcxAccessibleSimpleChildElementID): string; +begin + Result := ''; +end; + +function TcxAccessibilityHelper.GetDescription( + AChildID: TcxAccessibleSimpleChildElementID): string; +begin + Result := ''; +end; + +function TcxAccessibilityHelper.GetHitTest(AScreenX, AScreenY: Integer; + out AChildIndex: Integer): TcxAccessibleObjectHitTest; +begin + Result := aohtNone; +end; + +procedure TcxAccessibilityHelper.GetKeyboardAccessParameters( + AChildID: TcxAccessibleSimpleChildElementID; out AShortCut: TShortCut; + out ACaptionWithAccelChars: string); +begin + AShortCut := 0; + ACaptionWithAccelChars := ''; +end; + +function TcxAccessibilityHelper.GetName( + AChildID: TcxAccessibleSimpleChildElementID): string; +begin + Result := ''; +end; + +function TcxAccessibilityHelper.GetOwnerObjectWindow: HWND; +begin + Result := 0; +end; + +function TcxAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := nil; +end; + +function TcxAccessibilityHelper.GetRole( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := 0; +end; + +function TcxAccessibilityHelper.GetScreenBounds( + AChildID: TcxAccessibleSimpleChildElementID): TRect; +begin + Result := Rect(0, 0, 0, 0); +end; + +function TcxAccessibilityHelper.GetSelectable: Boolean; +begin + Result := False; +end; + +function TcxAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := cxSTATE_SYSTEM_NORMAL; +end; + +function TcxAccessibilityHelper.GetSupportedProperties( + AChildID: TcxAccessibleSimpleChildElementID): TcxAccessibleObjectProperties; +begin + Result := []; +end; + +function TcxAccessibilityHelper.GetValue( + AChildID: TcxAccessibleSimpleChildElementID): string; +begin + raise Exception.Create(''); +end; + +function TcxAccessibilityHelper.NavigateToChild( + ACurrentChildIndex: Integer; ADirection: TcxAccessibilityNavigationDirection): Integer; +begin + raise Exception.Create(''); +end; + +procedure TcxAccessibilityHelper.SetValue( + AChildID: TcxAccessibleSimpleChildElementID; const Value: string); +begin +end; + +function TcxAccessibilityHelper.GetRootHelper: TcxAccessibilityHelper; +var + AParent: TcxAccessibilityHelper; +begin + Result := Self; + repeat + AParent := Result.Parent; + if AParent <> nil then + Result := AParent; + until (AParent = nil); +end; + +// IDispatch +function TcxAccessibilityHelper.GetIDsOfNames(const IID: TGUID; Names: Pointer; + NameCount, LocaleID: Integer; DispIDs: Pointer): HResult; +begin + Result := E_NOTIMPL; +end; + +function TcxAccessibilityHelper.GetTypeInfo(Index, LocaleID: Integer; + out TypeInfo): HResult; +begin + Result := E_NOTIMPL; +end; + +function TcxAccessibilityHelper.GetTypeInfoCount(out Count: Integer): HResult; +begin + Result := E_NOTIMPL; +end; + +function TcxAccessibilityHelper.Invoke(DispID: Integer; const IID: TGUID; + LocaleID: Integer; Flags: Word; var Params; + VarResult, ExcepInfo, ArgErr: Pointer): HResult; +begin + Result := E_NOTIMPL; +end; + +// IOleWindow +function TcxAccessibilityHelper.ContextSensitiveHelp(fEnterMode: BOOL): HResult; +begin + Result := S_OK; +end; + +function TcxAccessibilityHelper.GetWindow(out wnd: HWnd): HResult; +begin + if CheckIsOwnerObjectLive(Result) then + begin + wnd := GetOwnerObjectWindow; + Result := S_OK; // TODO + end; +end; + +// IcxAccessible +function TcxAccessibilityHelper.accDoDefaultAction( + varChild: OleVariant): HResult; +var + ASimpleChildElementID: TcxAccessibleSimpleChildElementID; +begin + if GetSimpleChildElementID(varChild, ASimpleChildElementID, Result) then + if aopDefaultAction in GetSupportedProperties(ASimpleChildElementID) then + begin + DoDefaultAction(ASimpleChildElementID); + Result := S_OK; + end + else + Result := DISP_E_MEMBERNOTFOUND; +end; + +function TcxAccessibilityHelper.accHitTest(xLeft: Integer; yTop: Integer; + out pvarChild: OleVariant): HResult; +var + AChildIndex: Integer; +begin + VariantInit(pvarChild); + if CheckIsOwnerObjectLive(Result) then + if aopLocation in GetSupportedProperties(cxAccessibleObjectSelfID) then + begin + if PtInRect(GetScreenBounds(cxAccessibleObjectSelfID), Point(xLeft, yTop)) then + begin + case GetHitTest(xLeft, yTop, AChildIndex) of + aohtSelf: + begin + TVarData(pvarChild).VType := VT_I4; + pvarChild := CHILDID_SELF; + end; + aohtChild: + begin + TVarData(pvarChild).VType := VT_I4; + pvarChild := AChildIndex + 1; + CheckSimpleChildElementToBeReturned(pvarChild); + end; + end; + end; + if TVarData(pvarChild).VType <> VT_EMPTY then + Result := S_OK + else + Result := S_FALSE; + end + else + Result := DISP_E_MEMBERNOTFOUND; +end; + +function TcxAccessibilityHelper.accLocation(out pxLeft: Integer; + out pyTop: Integer; out pcxWidth: Integer; out pcyHeight: Integer; + varChild: OleVariant): HResult; +var + ASimpleChildElementID: TcxAccessibleSimpleChildElementID; +begin + if GetSimpleChildElementID(varChild, ASimpleChildElementID, Result) then + if aopLocation in GetSupportedProperties(cxAccessibleObjectSelfID) then + with GetScreenBounds(ASimpleChildElementID) do + begin + pxLeft := Left; + pyTop := Top; + pcxWidth := Right - Left; + pcyHeight := Bottom - Top; + Result := S_OK; + end + else + Result := DISP_E_MEMBERNOTFOUND; +end; + +function TcxAccessibilityHelper.accNavigate(navDir: Integer; + varStart: OleVariant; out pvarEndUpAt: OleVariant): HResult; + + procedure NavigateToFirstOrLastChild; + var + AChildCount: Integer; + begin + if varStart <> CHILDID_SELF then + Result := E_INVALIDARG + else + if not (aopLocation in GetSupportedProperties(cxAccessibleObjectSelfID)) then + Result := DISP_E_MEMBERNOTFOUND + else + begin + AChildCount := GetChildCount; + if AChildCount = 0 then + Result := S_FALSE + else + begin + TVarData(pvarEndUpAt).VType := VT_I4; + if navDir = NAVDIR_FIRSTCHILD then + pvarEndUpAt := 1 + else + pvarEndUpAt := AChildCount; + Result := S_OK; + end; + end; + end; + + procedure NavigateToNeighboringChildViaParent; + var + AParent: TcxAccessibilityHelper; + AStartChildID: OleVariant; + begin + Result := S_FALSE; + AParent := GetParent; // TODO get_accParent + if (AParent <> nil) and AParent.CheckIsOwnerObjectLive(Result) and + (aopLocation in AParent.GetSupportedProperties(cxAccessibleObjectSelfID)) then + begin + TVarData(AStartChildID).VType := VT_I4; + AStartChildID := AParent.GetChildIndex(Self) + 1; + if (AParent as IcxAccessible).accNavigate(navDir, AStartChildID, pvarEndUpAt) = S_OK then + Result := S_OK; + end; + end; + + procedure NavigateToNeighboringChild; + + function GetNavigationDirection: TcxAccessibilityNavigationDirection; + begin + case navDir of + NAVDIR_DOWN: Result := andDown; + NAVDIR_LEFT: Result := andLeft; + NAVDIR_NEXT: Result := andNext; + NAVDIR_PREVIOUS: Result := andPrev; + NAVDIR_RIGHT: Result := andRight; + else + Result := andUp; + end; + end; + + var + AChildIndex: Integer; + begin + if varStart > GetChildCount then + Result := E_INVALIDARG + else + if not (aopLocation in GetSupportedProperties(cxAccessibleObjectSelfID)) then + Result := DISP_E_MEMBERNOTFOUND + else + begin + AChildIndex := NavigateToChild(varStart - 1, GetNavigationDirection); + if AChildIndex <> varStart - 1 then + begin + TVarData(pvarEndUpAt).VType := VT_I4; + pvarEndUpAt := AChildIndex + 1; + Result := S_OK; + end + else + Result := S_FALSE; + end; + end; + +begin + VariantInit(pvarEndUpAt); + if not CheckIsOwnerObjectLive(Result) then + Exit; + if (navDir = NAVDIR_FIRSTCHILD) or (navDir = NAVDIR_LASTCHILD) then + NavigateToFirstOrLastChild + else + if varStart = CHILDID_SELF then + NavigateToNeighboringChildViaParent + else + NavigateToNeighboringChild; + + if Result = S_OK then + CheckSimpleChildElementToBeReturned(pvarEndUpAt); +end; + +function TcxAccessibilityHelper.accSelect(flagsSelect: Integer; + varChild: OleVariant): HResult; +begin + Result := DISP_E_MEMBERNOTFOUND; // TODO +end; + +function TcxAccessibilityHelper.Get_accChild(varChild: OleVariant; + out ppdispChild: IDispatch): HResult; +begin + if not CheckIsOwnerObjectLive(Result) then + Exit; + if (TVarData(varChild).VType = VT_EMPTY) or (varChild > GetChildCount) then + Result := E_INVALIDARG + else + if ChildIsSimpleElement(varChild - 1) then + Result := S_FALSE + else + begin + ppdispChild := GetChild(varChild - 1); + Result := S_OK; + end; +end; + +function TcxAccessibilityHelper.Get_accChildCount( + out pcountChildren: Integer): HResult; +begin + if CheckIsOwnerObjectLive(Result) then + begin + pcountChildren := GetChildCount; + Result := S_OK; + end; +end; + +function TcxAccessibilityHelper.Get_accDefaultAction(varChild: OleVariant; + out pszDefaultAction: WideString): HResult; +var + ASimpleChildElementID: TcxAccessibleSimpleChildElementID; +begin + if GetSimpleChildElementID(varChild, ASimpleChildElementID, Result) then + if aopDefaultAction in GetSupportedProperties(ASimpleChildElementID) then + begin + pszDefaultAction := GetDefaultActionDescription(ASimpleChildElementID); +// CheckStringToBeReturned(pszDefaultAction, Result); + Result := S_OK; + end + else + Result := DISP_E_MEMBERNOTFOUND; +end; + +function TcxAccessibilityHelper.Get_accDescription(varChild: OleVariant; + out pszDescription: WideString): HResult; +var + ASimpleChildElementID: TcxAccessibleSimpleChildElementID; +begin + if GetSimpleChildElementID(varChild, ASimpleChildElementID, Result) then + if aopDescription in GetSupportedProperties(ASimpleChildElementID) then + begin + pszDescription := GetDescription(ASimpleChildElementID); + CheckStringToBeReturned(pszDescription, Result); + end + else + Result := DISP_E_MEMBERNOTFOUND; +end; + +function TcxAccessibilityHelper.Get_accFocus( + out pvarChild: OleVariant): HResult; +var + AFocusedChildIndex: Integer; + AIsChildFocused: Boolean; +begin + VariantInit(pvarChild); + if CheckIsOwnerObjectLive(Result) then + if aopFocus in GetSupportedProperties(cxAccessibleObjectSelfID) then + begin + if not Focused(AIsChildFocused, AFocusedChildIndex) then + Result := S_FALSE + else + begin + TVarData(pvarChild).VType := VT_I4; + if not AIsChildFocused then + pvarChild := CHILDID_SELF + else + pvarChild := AFocusedChildIndex + 1; + CheckSimpleChildElementToBeReturned(pvarChild); + Result := S_OK; + end; + end + else + Result := DISP_E_MEMBERNOTFOUND; +end; + +function TcxAccessibilityHelper.Get_accHelp(varChild: OleVariant; + out pszHelp: WideString): HResult; +begin + Result := DISP_E_MEMBERNOTFOUND; +end; + +function TcxAccessibilityHelper.Get_accHelpTopic(out pszHelpFile: WideString; + varChild: OleVariant; out pidTopic: Integer): HResult; +begin + Result := DISP_E_MEMBERNOTFOUND; +end; + +function TcxAccessibilityHelper.Get_accKeyboardShortcut(varChild: OleVariant; + out pszKeyboardShortcut: WideString): HResult; +var + ACaption: string; + AShortCut: TShortCut; + ASimpleChildElementID: TcxAccessibleSimpleChildElementID; +begin + if GetSimpleChildElementID(varChild, ASimpleChildElementID, Result) then + if aopShortcut in GetSupportedProperties(ASimpleChildElementID) then + begin + GetKeyboardAccessParameters(ASimpleChildElementID, AShortCut, ACaption); + if GetHotKey(ACaption) <> '' then + pszKeyboardShortcut := UpperCase(GetHotKey(ACaption)) + else + pszKeyboardShortcut := ShortCutToText(AShortCut); + CheckStringToBeReturned(pszKeyboardShortcut, Result); + end + else + Result := DISP_E_MEMBERNOTFOUND; +end; + +function TcxAccessibilityHelper.Get_accName(varChild: OleVariant; + out pszName: WideString): HResult; +var + ASimpleChildElementID: TcxAccessibleSimpleChildElementID; +begin + if GetSimpleChildElementID(varChild, ASimpleChildElementID, Result) then + begin + pszName := GetName(ASimpleChildElementID); + CheckStringToBeReturned(pszName, Result); + end; +end; + +function TcxAccessibilityHelper.Get_accParent( + out ppdispParent: IDispatch): HResult; +var + AParentWnd: HWND; +begin + if CheckIsOwnerObjectLive(Result) then + begin + ppdispParent := GetParent; + if (ppdispParent = nil) and (GetOwnerObjectWindow <> 0) then + begin + if IsChildClassWindow(GetOwnerObjectWindow) then + AParentWnd := Windows.GetParent(GetOwnerObjectWindow) + else + AParentWnd := GetDesktopWindow; + if cxGetAccessibleObjectFromWindow(AParentWnd, OBJID_WINDOW, + IID_IcxAccessible, ppdispParent) <> S_OK then + ppdispParent := nil; + end; + if ppdispParent <> nil then + Result := S_OK + else + Result := S_FALSE; + end; +end; + +function TcxAccessibilityHelper.Get_accRole(varChild: OleVariant; + out pvarRole: OleVariant): HResult; +var + ASimpleChildElementID: TcxAccessibleSimpleChildElementID; +begin + if GetSimpleChildElementID(varChild, ASimpleChildElementID, Result) then + begin + TVarData(pvarRole).VType := VT_I4; + pvarRole := GetRole(ASimpleChildElementID); + Result := S_OK; + end; +end; + +function TcxAccessibilityHelper.Get_accSelection( + out pvarChildren: OleVariant): HResult; +begin + Result := DISP_E_MEMBERNOTFOUND; // TODO +end; + +function TcxAccessibilityHelper.Get_accState(varChild: OleVariant; + out pvarState: OleVariant): HResult; +var + ASimpleChildElementID: TcxAccessibleSimpleChildElementID; +begin + if GetSimpleChildElementID(varChild, ASimpleChildElementID, Result) then + begin + TVarData(pvarState).VType := VT_I4; + pvarState := GetState(ASimpleChildElementID); + Result := S_OK; + end; +end; + +function TcxAccessibilityHelper.Get_accValue(varChild: OleVariant; + out pszValue: WideString): HResult; +var + ASimpleChildElementID: TcxAccessibleSimpleChildElementID; +begin + if GetSimpleChildElementID(varChild, ASimpleChildElementID, Result) then + if aopValue in GetSupportedProperties(ASimpleChildElementID) then + begin + pszValue := GetValue(ASimpleChildElementID); + Result := S_OK; + end + else + Result := DISP_E_MEMBERNOTFOUND; +end; + +function TcxAccessibilityHelper.Set_accName(varChild: OleVariant; + const pszName: WideString): HResult; +begin + Result := DISP_E_MEMBERNOTFOUND; +end; + +function TcxAccessibilityHelper.Set_accValue(varChild: OleVariant; + const pszValue: WideString): HResult; +var + ASimpleChildElementID: TcxAccessibleSimpleChildElementID; +begin + if GetSimpleChildElementID(varChild, ASimpleChildElementID, Result) then + if aopValue in GetSupportedProperties(ASimpleChildElementID) then + begin + SetValue(ASimpleChildElementID, pszValue); + Result := S_OK; + end + else + Result := DISP_E_MEMBERNOTFOUND; +end; + +function TcxAccessibilityHelper.CheckIsOwnerObjectLive( + out AErrorCode: HResult): Boolean; +begin + Result := FIsOwnerObjectLive; + if not Result then + AErrorCode := CO_E_OBJECTNOTCONNECTED; +end; + +procedure TcxAccessibilityHelper.CheckSimpleChildElementToBeReturned( + var AVarChild: OleVariant); +var + AChild: TcxAccessibilityHelper; +begin + if (AVarChild <> CHILDID_SELF) and + not ChildIsSimpleElement(AVarChild - 1) then + begin + AChild := GetChild(AVarChild - 1); + VariantInit(AVarChild); + AVarChild := AChild as IDispatch; + TVarData(AVarChild).VType := VT_DISPATCH; + end; +end; + +procedure TcxAccessibilityHelper.CheckStringToBeReturned(const AStr: WideString; + out AResult: HResult); +begin + if Length(AStr) <> 0 then + AResult := S_OK + else + AResult := S_FALSE; +end; + +function TcxAccessibilityHelper.GetSimpleChildElementID(AChildID: OleVariant; + out ASimpleChildElementID: TcxAccessibleSimpleChildElementID; + out AErrorCode: HResult): Boolean; +begin + Result := CheckIsOwnerObjectLive(AErrorCode); + if not Result then + Exit; + if AChildID = CHILDID_SELF then + ASimpleChildElementID := cxAccessibleObjectSelfID + else + if (AChildID > GetChildCount) or not ChildIsSimpleElement(AChildID - 1) then + begin + AErrorCode := E_INVALIDARG; + Result := False; + end + else + ASimpleChildElementID := AChildID - 1; +end; + +function TcxAccessibilityHelper.GetVisible: Boolean; +begin + Result := States[cxAccessibleObjectSelfID] and cxSTATE_SYSTEM_INVISIBLE = 0; +end; + +initialization + FOleaccLibrary := LoadLibrary(OleaccLibraryName); + if FOleaccLibrary <> 0 then + begin + FcxAccessibleObjectFromWindow := GetProcAddress(FOleaccLibrary, 'AccessibleObjectFromWindow'); + FcxLResultFromObject := GetProcAddress(FOleaccLibrary, 'LresultFromObject'); + end; + +finalization + if FOleaccLibrary <> 0 then + FreeLibrary(FOleaccLibrary); + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxClasses.pas b/official/x.35/ExpressLibrary/Sources/cxClasses.pas new file mode 100644 index 00000000..2499ad70 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxClasses.pas @@ -0,0 +1,2575 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxClasses; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, ShellAPI, TypInfo, Classes, Forms; + +const + dxBuildNumber = 35; + WM_DX = WM_APP + 100; + + dxEndOfLine = #13#10; + cxE_NOINTERFACE = HResult($80004002); + +type + PBytes = ^TBytes; + TBytes = array of Byte; + + TcxAlignmentVert = (vaTop, vaBottom, vaCenter); + TcxTopBottom = vaTop..vaBottom; + TcxCollectionOperation = (copAdd, copDelete, copChanged); + TcxDirection = (dirNone, dirLeft, dirRight, dirUp, dirDown); + TcxGetComponent = function(ACaller: TComponent; Index: Integer): TComponent; + TcxGetCaptionForIntegerItemFunc = function(AItem: Integer): string; + TcxPosition = (posNone, posLeft, posRight, posTop, posBottom); + TdxSkinName = type string; + +{$IFNDEF DELPHI5} + TImageIndex = Integer; +{$ENDIF} + + TcxTag = Longint; + + TcxResourceStringID = Pointer; + + IcxDesignSelectionChanged = interface + ['{66B3AA59-1EBD-4135-AB18-E980F9C970F3}'] + procedure DesignSelectionChanged(ASelection: TList); + end; + + IcxDesignHelper = interface + ['{4C78CC4F-699B-43BD-94AC-E3BD2233F7A1}'] + procedure AddSelectionChangedListener(AObject: TPersistent); + function CanAddComponent(AOwner: TComponent): Boolean; + function CanDeleteComponent(AOwner: TComponent; AComponent: TComponent): Boolean; + procedure ChangeSelection(AOwner: TComponent; AObject: TPersistent); + function IsObjectSelected(AOwner: TComponent; AObject: TPersistent): Boolean; + procedure Modified; + procedure RemoveSelectionChangedListener(AObject: TPersistent); + procedure SelectObject(AOwner: TComponent; AObject: TPersistent; AClearSelection: Boolean = True; + AActivateOwner: Boolean = True); + procedure ShowComponentDefaultEventHandler(AComponent: TComponent); + function UniqueName(const ABaseName: string): string; + procedure UnselectObject(AOwner: TComponent; AObject: TPersistent); + end; + + { TcxIUnknownObject } + + TcxIUnknownObject = class(TObject, IUnknown) + protected + // IUnknown + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + end; + + { TcxInterfacedPersistent } + + TcxInterfacedPersistentClass = class of TcxInterfacedPersistent; + + TcxInterfacedPersistent = class({$IFDEF DELPHI6}TInterfacedPersistent{$ELSE}TPersistent, IUnknown{$ENDIF}) + private + FOwner: TPersistent; + {$IFNDEF DELPHI6} + FOwnerInterface: IUnknown; + {$ENDIF} + protected + function GetOwner: TPersistent; override; + {$IFNDEF DELPHI6} + { IUnknown } + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall; + {$ENDIF} + public + constructor Create(AOwner: TPersistent); virtual; + {$IFNDEF DELPHI6} + procedure AfterConstruction; override; + {$ENDIF} + property Owner: TPersistent read FOwner; + end; + + { TcxOwnedPersistent } + + TcxOwnedPersistent = class(TPersistent) + private + FOwner: TPersistent; + protected + function GetOwner: TPersistent; override; + property Owner: TPersistent read FOwner write FOwner; + public + constructor Create(AOwner: TPersistent); virtual; + end; + + { TcxOwnedInterfacedPersistent } + + TcxOwnedInterfacedPersistent = class(TcxOwnedPersistent, IUnknown) + protected + // IUnknown + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall; + end; + + { TcxComponent} + + TcxComponent = class(TComponent{$IFNDEF DELPHI6}, IUnknown{$ENDIF}) + private + FFakeComponentLink1: TComponent; + FFakeComponentLink2: TComponent; + FFakeComponentLink3: TComponent; + function GetFakeComponentLinkCount: Integer; + function GetIsDesigning: Boolean; + function GetIsDestroying: Boolean; + procedure SetFakeComponentLink(Index: Integer; Value: TComponent); + protected + procedure GetFakeComponentLinks(AList: TList); virtual; + procedure Loaded; override; + procedure UpdateFakeLinks; + public + destructor Destroy; override; + procedure BeforeDestruction; override; + property IsDesigning: Boolean read GetIsDesigning; + property IsDestroying: Boolean read GetIsDestroying; + published + property FakeComponentLink1: TComponent read FFakeComponentLink1 write FFakeComponentLink1 stored False; + property FakeComponentLink2: TComponent read FFakeComponentLink2 write FFakeComponentLink2 stored False; + property FakeComponentLink3: TComponent read FFakeComponentLink3 write FFakeComponentLink3 stored False; + end; + + { TcxCollection } + + TcxCollection = class(TCollection) + public + procedure Assign(Source: TPersistent); override; + {$IFNDEF DELPHI6} + function Owner: TPersistent; + {$ENDIF} + end; + + { TcxObjectList } + + TcxObjectList = class(TList) + private + function GetItem(Index: Integer): TObject; + public + procedure Clear; override; + property Items[Index: Integer]: TObject read GetItem; default; + end; + + { TcxEventHandlerCollection } + + TcxEventHandler = procedure (Sender: TObject; const AEventArgs) of object; + + TcxEventHandlerCollection = class(TObject) + private + FEvents: array of TcxEventHandler; + procedure Delete(AIndex: Integer); + function IndexOf(AEvent: TcxEventHandler): Integer; + public + procedure Add(AEvent: TcxEventHandler); + procedure CallEvents(Sender: TObject; const AEventArgs); + procedure Remove(AEvent: TcxEventHandler); + end; + + { TcxRegisteredClassList } + + TcxRegisteredClassListItemData = class + ItemClass: TClass; + RegisteredClass: TClass; + end; + + TcxRegisteredClassList = class + private + FItems: TList; + function GetCount: Integer; + function GetItem(Index: Integer): TcxRegisteredClassListItemData; + protected + function Find(AItemClass: TClass; var AIndex: Integer): Boolean; virtual; + public + constructor Create; + destructor Destroy; override; + procedure Clear; + function FindClass(AItemClass: TClass): TClass; + procedure Register(AItemClass, ARegisteredClass: TClass); virtual; + procedure Unregister(AItemClass, ARegisteredClass: TClass); virtual; + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxRegisteredClassListItemData read GetItem; default; + end; + + { TcxRegisteredClasses } // TODO: Name + + TcxRegisteredClasses = class + private + FItems: TStringList; + FRegisterClasses: Boolean; + FSorted: Boolean; + function GetCount: Integer; + function GetDescription(Index: Integer): string; + function GetHint(Index: Integer): string; + function GetItem(Index: Integer): TClass; + procedure SetSorted(Value: Boolean); + protected + function CompareItems(AIndex1, AIndex2: Integer): Integer; virtual; + procedure Sort; virtual; + public + constructor Create(ARegisterClasses: Boolean = False); + destructor Destroy; override; + procedure Clear; + function FindByClassName(const AClassName: string): TClass; + function FindByDescription(const ADescription: string): TClass; + function GetDescriptionByClass(AClass: TClass): string; + function GetHintByClass(AClass: TClass): string; + function GetIndexByClass(AClass: TClass): Integer; + procedure Register(AClass: TClass; const ADescription: string); + procedure Unregister(AClass: TClass); + property Count: Integer read GetCount; + property Descriptions[Index: Integer]: string read GetDescription; + property Hints[Index: Integer]: string read GetHint; + property Items[Index: Integer]: TClass read GetItem; default; + property RegisterClasses: Boolean read FRegisterClasses write FRegisterClasses; + property Sorted: Boolean read FSorted write SetSorted; + end; + + { TcxAutoWidthObject } + + TcxAutoWidthItem = class + public + MinWidth: Integer; + Width: Integer; + Fixed: Boolean; + AutoWidth: Integer; + constructor Create; + end; + + TcxAutoWidthObject = class + private + FAvailableWidth: Integer; + FItems: TList; + function GetCount: Integer; + function GetItem(Index: Integer): TcxAutoWidthItem; + function GetWidth: Integer; + protected + procedure Clear; + public + constructor Create(ACount: Integer); + destructor Destroy; override; + function AddItem: TcxAutoWidthItem; + procedure Calculate; + property AvailableWidth: Integer read FAvailableWidth write FAvailableWidth; + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxAutoWidthItem read GetItem; default; + property Width: Integer read GetWidth; + end; + + { TcxAlignment } + + TcxAlignment = class(TPersistent) + private + FDefaultHorz: TAlignment; + FDefaultVert: TcxAlignmentVert; + FHorz: TAlignment; + FIsHorzAssigned: Boolean; + FIsVertAssigned: Boolean; + FOwner: TPersistent; + FUseAssignedValues: Boolean; + FVert: TcxAlignmentVert; + FOnChanged: TNotifyEvent; + function IsHorzStored: Boolean; + function IsVertStored: Boolean; + procedure SetHorz(const Value: TAlignment); + procedure SetVert(const Value: TcxAlignmentVert); + protected + procedure DoChanged; + function GetOwner: TPersistent; override; + public + constructor Create(AOwner: TPersistent; AUseAssignedValues: Boolean = False; + ADefaultHorz: TAlignment = taLeftJustify; + ADefaultVert: TcxAlignmentVert = vaTop); virtual; + procedure Assign(Source: TPersistent); override; + procedure Reset; + property OnChanged: TNotifyEvent read FOnChanged write FOnChanged; + published + property Horz: TAlignment read FHorz write SetHorz stored IsHorzStored; + property Vert: TcxAlignmentVert read FVert write SetVert stored IsVertStored; + end; + + { Object Links } + + TcxObjectLink = class + Ref: TObject; + end; + + TcxObjectLinkController = class + private + FLinks: TList; + public + constructor Create; + destructor Destroy; override; + + function AddLink(AObject: TObject): TcxObjectLink; + procedure RemoveLink(ALink: TcxObjectLink); + procedure ClearLinks(AObject: TObject); + end; + + { TcxFreeNotificator } + + TcxFreeNotificationEvent = procedure(Sender: TComponent) of object; + + TcxFreeNotificator = class(TComponent) + private + FOnFreeNotification: TcxFreeNotificationEvent; + protected + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + public + procedure AddSender(ASender: TComponent); + procedure RemoveSender(ASender: TComponent); + property OnFreeNotification: TcxFreeNotificationEvent read FOnFreeNotification write FOnFreeNotification; + end; + + { MRU items support } + + TcxMRUItemClass = class of TcxMRUItem; + + TcxMRUItem = class + public + function Equals(AItem: TcxMRUItem): Boolean; virtual; abstract; + end; + + TcxMRUItems = class + private + FItems: TList; + FMaxCount: Integer; + function GetCount: Integer; + function GetItem(Index: Integer): TcxMRUItem; + procedure SetCount(Value: Integer); + procedure SetMaxCount(Value: Integer); + protected + procedure Delete(AIndex: Integer); + procedure UpdateCount; + public + constructor Create; virtual; + destructor Destroy; override; + procedure Add(AItem: TcxMRUItem); + procedure ClearItems; + function IndexOf(AItem: TcxMRUItem): Integer; + + property Count: Integer read GetCount write SetCount; + property Items[Index: Integer]: TcxMRUItem read GetItem; default; + property MaxCount: Integer read FMaxCount write SetMaxCount; + end; + + { Open list } + + TcxOpenList = class(TList) + private + function GetItem(Index: Integer): TObject; + procedure SetItem(Index: Integer; Value: TObject); + public + property Items[Index: Integer]: TObject read GetItem write SetItem; default; + end; + + { TcxComponentCollectionItem } + + TcxComponentCollection = class; + + TcxComponentCollectionItem = class(TComponent) + private + FCollection: TcxComponentCollection; + FID: Integer; + procedure AddToCollection(ACollection: TcxComponentCollection); + function GetIndex: Integer; + procedure RemoveFromCollection(ACollection: TcxComponentCollection); + protected + procedure Changed(AAllItems: Boolean); + function GetCollectionFromParent(AParent: TComponent): TcxComponentCollection; virtual; abstract; + function GetDisplayName: string; virtual; + procedure SetCollection(AValue: TcxComponentCollection); virtual; + procedure SetIndex(AValue: Integer); virtual; + public + destructor Destroy; override; + function GetParentComponent: TComponent; override; + function HasParent: Boolean; override; + procedure SetParentComponent(Value: TComponent); override; + + property Collection: TcxComponentCollection read FCollection write SetCollection; + property DisplayName: string read GetDisplayName; + property ID: Integer read FID; + property Index: Integer read GetIndex write SetIndex; + end; + + TcxComponentCollectionItemClass = class of TcxComponentCollectionItem; + + { TcxComponentCollection } + + TcxComponentCollectionNotification = (ccnAdded, ccnChanged, ccnExtracting, ccnExtracted, ccnDeleting); + TcxComponentCollectionChangeEvent = procedure(Sender: TObject; + AItem: TcxComponentCollectionItem; AAction: TcxComponentCollectionNotification) of object; + + TcxComponentCollection = class(TPersistent) + private + FItemClass: TcxComponentCollectionItemClass; + FItems: TList; + FNextID: Integer; + FParentComponent: TComponent; + FUpdateCount: Integer; + FOnChange: TcxComponentCollectionChangeEvent; + function GetCount: Integer; + procedure InsertItem(AItem: TcxComponentCollectionItem); + procedure RemoveItem(AItem: TcxComponentCollectionItem); + protected + procedure Changed(AItem: TcxComponentCollectionItem = nil; + AAction: TcxComponentCollectionNotification = ccnChanged); + function GetItem(AIndex: Integer): TcxComponentCollectionItem; + function GetOwner: TPersistent; override; + procedure Notify(AItem: TcxComponentCollectionItem; + AAction: TcxComponentCollectionNotification); virtual; + procedure SetItem(AIndex: Integer; Value: TcxComponentCollectionItem); + procedure SetItemName(AItem: TcxComponentCollectionItem); virtual; + procedure Update(AItem: TcxComponentCollectionItem; + AAction: TcxComponentCollectionNotification); virtual; + + property NextID: Integer read FNextID; + property UpdateCount: Integer read FUpdateCount; + public + constructor Create(AParentComponent: TComponent; AItemClass: TcxComponentCollectionItemClass); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function Add: TcxComponentCollectionItem; + procedure BeginUpdate; virtual; + procedure Clear; + procedure Delete(AIndex: Integer); + procedure EndUpdate(AForceUpdate: Boolean = True); virtual; + function FindItemByID(ID: Integer): TcxComponentCollectionItem; + function Insert(AIndex: Integer): TcxComponentCollectionItem; + procedure Remove(AItem: TcxComponentCollectionItem); + + property Count: Integer read GetCount; + property ParentComponent: TComponent read FParentComponent; + property Items[AIndex: Integer]: TcxComponentCollectionItem read GetItem write SetItem; default; + property OnChange: TcxComponentCollectionChangeEvent read FOnChange write FOnChange; + end; + + { TcxDialogMetricsInfo } + + IcxDialogMetricsInfoData = interface + ['{DBFB3040-4677-4C9D-913C-45A1EE41E35A}'] + function GetInfoData: Pointer; + function GetInfoDataSize: Integer; + procedure SetInfoData(AData: Pointer); + end; + + TcxDialogMetricsInfo = class + private + FClientHeight: Integer; + FClientWidth: Integer; + FData: Pointer; + FDialogClass: TClass; + FLeft: Integer; + FTop: Integer; + FMaximized: Boolean; + procedure FreeCustomData; + protected + procedure Restore(AForm: TForm); + procedure Store(AForm: TForm); + public + constructor Create(AForm: TForm); + destructor Destroy; override; + property ClientHeight: Integer read FClientHeight; + property ClientWidth: Integer read FClientWidth; + property Data: Pointer read FData; + property DialogClass: TClass read FDialogClass; + property Left: Integer read FLeft; + property Maximized: Boolean read FMaximized; + property Top: Integer read FTop; + end; + + { TcxDialogsMetricsStore } + + TcxDialogsMetricsStore = class + private + FDefaultPosition: TPosition; + FMetrics: TcxObjectList; + protected + function CreateMetrics(AForm: TForm): TcxDialogMetricsInfo; + function FindMetrics(AForm: TForm): Integer; + property Metrics: TcxObjectList read FMetrics; + public + constructor Create; virtual; + destructor Destroy; override; + procedure InitDialog(AForm: TForm); + procedure StoreMetrics(AForm: TForm); + + property DefaultPosition: TPosition read FDefaultPosition write FDefaultPosition default poMainFormCenter; + end; + + TcxNotifyProcedure = procedure(Sender: TObject); + +// component dialogs metrics storage +function cxDialogsMetricsStore: TcxDialogsMetricsStore; + +function cxAddObjectLink(AObject: TObject): TcxObjectLink; +procedure cxRemoveObjectLink(ALink: TcxObjectLink); +procedure cxClearObjectLinks(AObject: TObject); + +procedure CallNotify(ANotifyEvent: TNotifyEvent; ASender: TObject); +function ClassInheritsFrom(AClass: TClass; const AParentClassName: string): Boolean; +procedure CopyList(ASource, ADestination: TList); +function EqualMethods(const AMethod1, AMethod2: TMethod): Boolean; +procedure FillStringsWithEnumTypeValues(AStrings: TStrings; ATypeInfo: PTypeInfo; + AGetTypeItemCaption: TcxGetCaptionForIntegerItemFunc); +function GetPersistentOwner(APersistent: TPersistent): TPersistent; +function GetSubobjectName(AObject, ASubobject: TPersistent): string; +function GetValidName(AComponent: TComponent; const AName: string; + AIsBaseName: Boolean = False): string; +function HexToByte(const AHex: string): Byte; +procedure RenameComponents(ACaller, AOwner: TComponent; + ANewName, AOldName: TComponentName; + AComponentCount: Integer; AGetComponent: TcxGetComponent); +function RoundDiv(I1, I2: Integer): Integer; +function Size(cx, cy: Longint): TSize; +procedure SwapIntegers(var I1, I2: Integer); +function GetRangeCenter(ABound1, ABound2: Integer): Integer; +function StreamsEqual(AStream1, AStream2: TMemoryStream): Boolean; +procedure OpenWebPage(const AWebAddress: string); +function GetCorrectPath(const S: string): string; + +{$IFNDEF DELPHI6} +function IfThen(AValue: Boolean; ATrue: Integer; AFalse: Integer = 0): Integer; +function InRange(AValue, AMin, AMax: Integer): Boolean; +function Supports(const Instance: TObject; const IID: TGUID): Boolean; overload; +{$IFNDEF DELPHI5} +function Supports(const Instance: IUnknown; const Intf: TGUID; out Inst): Boolean; overload; +function Supports(Instance: TObject; const Intf: TGUID; out Inst): Boolean; overload; +procedure FreeAndNil(var Obj); +{$ENDIF} +{$ENDIF} + +function cxGetLocaleInfo(ALocale, ALocaleType: Integer; const ADefaultValue: string): string; +function cxStrCharLength(const AStr: string; AIndex: Integer = 1): Integer; +function cxNextCharPos(const AStr: string; AIndex: Integer): Integer; +function cxPrevCharPos(const AStr: string; AIndex: Integer): Integer; + +function cxGetResourceString(AResString: TcxResourceStringID): string; overload; +procedure cxSetResourceString(AResString: TcxResourceStringID; const Value: string); +function cxGetResourceString(const AResString: string): string; overload;{$IFDEF DELPHI6} deprecated;{$ENDIF} +function cxGetResourceStringNet(const AResString: string): string;{$IFDEF DELPHI6} deprecated;{$ENDIF} +procedure cxSetResourceStringNet(const AResString, Value: string);{$IFDEF DELPHI6} deprecated;{$ENDIF} + +function CreateUniqueName(AOwnerForm, AOwnerComponent, AComponent: TComponent; + const APrefixName, ASuffixName: string): string; + +procedure cxZeroMemory(ADestination: Pointer; ACount: Integer); +function cxAllocMem(Size: Cardinal): Pointer; +procedure cxFreeMem(P: Pointer); + +procedure cxCopyData(Source, Dest: Pointer; Count: Integer); overload; +procedure cxCopyData(Source, Dest: Pointer; ASourceOffSet, ADestOffSet, Count: Integer); overload; +function ReadBoolean(ASource: Pointer; AOffset: Integer = 0): WordBool; +function ReadByte(ASource: Pointer; AOffset: Integer = 0): Byte; +function ReadInteger(ASource: Pointer; AOffset: Integer = 0): Integer; +function ReadWord(ASource: Pointer; AOffset: Integer = 0): Word; +procedure WriteBoolean(ADest: Pointer; AValue: WordBool; AOffset: Integer = 0); +procedure WriteByte(ADest: Pointer; AValue: Byte; AOffset: Integer = 0); +procedure WriteInteger(ADest: Pointer; AValue: Integer; AOffset: Integer = 0); +procedure WriteWord(ADest: Pointer; AValue: Word; AOffset: Integer = 0); + +function cxSign(const AValue: Double): Integer; + +implementation + +uses + SysUtils, Math, Graphics, Controls; + +type + TPersistentAccess = class(TPersistent); + +var + FObjectLinkController: TcxObjectLinkController; + FObjectLinkControllerRefCount: Integer; + FDialogsMetrics: TcxDialogsMetricsStore; + +function GetShortHint(const Hint: string): string; +var + I: Integer; +begin + I := AnsiPos('|', Hint); + if I = 0 then + Result := Hint else + Result := Copy(Hint, 1, I - 1); +end; + +function GetLongHint(const Hint: string): string; +var + I: Integer; +begin + I := AnsiPos('|', Hint); + if I = 0 then + Result := Hint else + Result := Copy(Hint, I + 1, Maxint); +end; + +{$IFNDEF DELPHI6} +function IfThen(AValue: Boolean; ATrue, AFalse: Integer): Integer; +begin + if AValue then + Result := ATrue + else + Result := AFalse; +end; + +function InRange(AValue, AMin, AMax: Integer): Boolean; +begin + Result := (AValue <= AMax) and (AValue >= AMin); +end; + +function Supports(const Instance: TObject; const IID: TGUID): Boolean; +var + Temp: IUnknown; +begin + Result := Supports(Instance, IID, Temp); +end; +{$IFNDEF DELPHI5} +function Supports(const Instance: IUnknown; const Intf: TGUID; out Inst): Boolean; overload; +begin + Result := (Instance <> nil) and (Instance.QueryInterface(Intf, Inst) = 0); +end; + +function Supports(Instance: TObject; const Intf: TGUID; out Inst): Boolean; overload; +var + Unk: IUnknown; +begin + Result := (Instance <> nil) and Instance.GetInterface(IUnknown, Unk) and + Supports(Unk, Intf, Inst); +end; + +procedure FreeAndNil(var Obj); +var + Temp: TObject; +begin + Temp := TObject(Obj); + Pointer(Obj) := nil; + Temp.Free; +end; +{$ENDIF} +{$ENDIF} + +function cxGetLocaleInfo(ALocale, ALocaleType: Integer; const ADefaultValue: string): string; +var + ABuffer: string; + ABufferSize: Integer; +begin + ABufferSize := GetLocaleInfo(ALocale, ALocaleType, nil, 0); + if ABufferSize = 0 then + Result := ADefaultValue + else + begin + SetLength(ABuffer, ABufferSize); + GetLocaleInfo(ALocale, ALocaleType, PChar(ABuffer), ABufferSize); + Result := Copy(ABuffer, 1, ABufferSize - 1) + end; +end; + +function GetPChar(const AStr: string; AIndex: Integer): PChar; +begin + Result := PChar(AStr) + AIndex - 1; +end; + +function cxStrCharLength(const AStr: string; AIndex: Integer = 1): Integer; +begin + Result := Integer(CharNext(GetPChar(AStr, AIndex))) - Integer(GetPChar(AStr, AIndex)); +end; + +function cxNextCharPos(const AStr: string; AIndex: Integer): Integer; +begin + Result := Integer(CharNext(GetPChar(AStr, AIndex))) - Integer(GetPChar(AStr, 1)) + 1; +end; + +function cxPrevCharPos(const AStr: string; AIndex: Integer): Integer; +begin + Result := Integer(CharPrev(GetPChar(AStr, 1), GetPChar(AStr, AIndex))) - Integer(GetPChar(AStr, 1)) + 1; +end; + +{ TcxIUnknownObject } + +function TcxIUnknownObject.QueryInterface(const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then + Result := S_OK + else + Result := E_NOINTERFACE; +end; + +function TcxIUnknownObject._AddRef: Integer; +begin + Result := -1; +end; + +function TcxIUnknownObject._Release: Integer; +begin + Result := -1; +end; + +{ TcxInterfacedPersistent } + +constructor TcxInterfacedPersistent.Create(AOwner: TPersistent); +begin + inherited Create; + FOwner := AOwner; +end; + +function TcxInterfacedPersistent.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +{$IFNDEF DELPHI6} + +function TcxInterfacedPersistent._AddRef: Integer; +begin + if FOwnerInterface <> nil then + Result := FOwnerInterface._AddRef + else + Result := -1; +end; + +function TcxInterfacedPersistent._Release: Integer; +begin + if FOwnerInterface <> nil then + Result := FOwnerInterface._Release + else + Result := -1; +end; + +function TcxInterfacedPersistent.QueryInterface(const IID: TGUID; out Obj): HResult; +const + E_NOINTERFACE = HResult($80004002); +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +procedure TcxInterfacedPersistent.AfterConstruction; +begin + inherited; + if GetOwner <> nil then + GetOwner.GetInterface(IUnknown, FOwnerInterface); +end; +{$ENDIF} + +{ TcxOwnedPersistent } + +constructor TcxOwnedPersistent.Create(AOwner: TPersistent); +begin + inherited Create; + FOwner := AOwner; +end; + +function TcxOwnedPersistent.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +{ TcxOwnedInterfacedPersistent } + +function TcxOwnedInterfacedPersistent._AddRef: Integer; +begin + Result := -1; +end; + +function TcxOwnedInterfacedPersistent._Release: Integer; +begin + Result := -1; +end; + +function TcxOwnedInterfacedPersistent.QueryInterface( + const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then Result := 0 else Result := cxE_NOINTERFACE; +end; + +{ TcxComponent } + +destructor TcxComponent.Destroy; +begin + cxClearObjectLinks(Self); + inherited Destroy; +end; + +procedure TcxComponent.Loaded; +begin + inherited Loaded; + UpdateFakeLinks; +end; + +procedure TcxComponent.BeforeDestruction; +begin + if not IsDestroying then Destroying; +end; + +procedure TcxComponent.GetFakeComponentLinks(AList: TList); +begin +end; + +procedure TcxComponent.UpdateFakeLinks; +var + I: Integer; + AList: TList; +begin + if not IsDesigning or IsDestroying or (Owner = nil) then Exit; + AList := TList.Create; + try + GetFakeComponentLinks(AList); + for I := 0 to GetFakeComponentLinkCount - 1 do + if I < AList.Count then + SetFakeComponentLink(I, TComponent(AList[I])) + else + SetFakeComponentLink(I, nil); + finally + AList.Free; + end; +end; + +function TcxComponent.GetFakeComponentLinkCount: Integer; +begin + Result := 3; +end; + +function TcxComponent.GetIsDesigning: Boolean; +begin + Result := csDesigning in ComponentState; +end; + +function TcxComponent.GetIsDestroying: Boolean; +begin + Result := csDestroying in ComponentState; +end; + +procedure TcxComponent.SetFakeComponentLink(Index: Integer; Value: TComponent); +begin + case Index of + 0: FFakeComponentLink1 := Value; + 1: FFakeComponentLink2 := Value; + 2: FFakeComponentLink3 := Value; + end; +end; + +{ TcxCollection } + +procedure TcxCollection.Assign(Source: TPersistent); +var + I: Integer; + AItem: TCollectionItem; +begin + if Source is TCollection then + begin + if (Count = 0) and (TCollection(Source).Count = 0) then Exit; + BeginUpdate; + try + for I := 0 to TCollection(Source).Count - 1 do + begin + if I > Count - 1 then + AItem := Add + else + AItem := Items[I]; + AItem.Assign(TCollection(Source).Items[I]); + end; + for I := Count - 1 downto TCollection(Source).Count do + Delete(I); + finally + EndUpdate; + end; + end + else + inherited; +end; + +{$IFNDEF DELPHI6} +function TcxCollection.Owner: TPersistent; +begin + Result := GetOwner; +end; +{$ENDIF} + +{ TcxObjectList } + +procedure TcxObjectList.Clear; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].Free; + inherited Clear; +end; + +function TcxObjectList.GetItem(Index: Integer): TObject; +begin + Result := inherited Items[Index]; +end; + +{ TcxEventHandlerCollection } + +procedure TcxEventHandlerCollection.Add(AEvent: TcxEventHandler); +var + ALength: Integer; +begin + if IndexOf(AEvent) <> -1 then Exit; + ALength := Length(FEvents); + SetLength(FEvents, ALength + 1); + FEvents[ALength] := AEvent; +end; + +procedure TcxEventHandlerCollection.CallEvents(Sender: TObject; const AEventArgs); +var + I: Integer; +begin + for I := Low(FEvents) to High(FEvents) do + FEvents[I](Sender, AEventArgs); +end; + +procedure TcxEventHandlerCollection.Delete(AIndex: Integer); +var + ALength, I: Integer; +begin + ALength := Length(FEvents); + if (AIndex < 0) or (AIndex >= ALength) then Exit; + for I := AIndex to ALength - 2 do + FEvents[I] := FEvents[I + 1]; + SetLength(FEvents, ALength - 1); +end; + +function TcxEventHandlerCollection.IndexOf(AEvent: TcxEventHandler): Integer; +var + I: Integer; +begin + Result := -1; + for I := Low(FEvents) to High(FEvents) do + if EqualMethods(TMethod(AEvent), TMethod(FEvents[I])) then + begin + Result := I; + Break; + end; +end; + +procedure TcxEventHandlerCollection.Remove(AEvent: TcxEventHandler); +begin + Delete(IndexOf(AEvent)); +end; + +{ TcxRegisteredClassList } + +constructor TcxRegisteredClassList.Create; +begin + inherited Create; + FItems := TList.Create; +end; + +destructor TcxRegisteredClassList.Destroy; +begin + Clear; + FreeAndNil(FItems); + inherited Destroy; +end; + +procedure TcxRegisteredClassList.Clear; +var + I: Integer; +begin + for I := 0 to FItems.Count - 1 do + TcxRegisteredClassListItemData(FItems[I]).Free; + FItems.Clear; +end; + +function TcxRegisteredClassList.FindClass(AItemClass: TClass): TClass; +var + AIndex: Integer; +begin + if Find(AItemClass, AIndex) then + Result := Items[AIndex].RegisteredClass + else + Result := nil; +end; + +procedure TcxRegisteredClassList.Register(AItemClass, ARegisteredClass: TClass); +var + AIndex: Integer; + AData: TcxRegisteredClassListItemData; +begin + AIndex := -1; + AData := TcxRegisteredClassListItemData.Create; + AData.ItemClass := AItemClass; + AData.RegisteredClass := ARegisteredClass; + if Find(AItemClass, AIndex) then + FItems.Insert(AIndex + 1, AData) + else + if AIndex <> -1 then + FItems.Insert(AIndex, AData) + else + FItems.Add(AData); +end; + +procedure TcxRegisteredClassList.Unregister(AItemClass, ARegisteredClass: TClass); +var + I: Integer; + AData: TcxRegisteredClassListItemData; +begin + for I := FItems.Count - 1 downto 0 do + begin + AData := Items[I]; + if (AData.ItemClass = AItemClass) and (AData.RegisteredClass = ARegisteredClass) then + begin + AData.Free; + FItems.Delete(I); + end; + end; +end; + +function TcxRegisteredClassList.Find(AItemClass: TClass; var AIndex: Integer): Boolean; +var + I: Integer; + AData: TcxRegisteredClassListItemData; +begin + Result := False; + for I := FItems.Count - 1 downto 0 do + begin + AData := Items[I]; + if AItemClass.InheritsFrom(AData.ItemClass) then + begin + AIndex := I; + Result := True; + Break; + end + else + if AData.ItemClass.InheritsFrom(AItemClass) then + AIndex := I; + end; +end; + +function TcxRegisteredClassList.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxRegisteredClassList.GetItem(Index: Integer): TcxRegisteredClassListItemData; +begin + Result := TcxRegisteredClassListItemData(FItems[Index]); +end; + +{ TcxRegisteredClasses } + +type + TcxRegisteredClassesStringList = class(TStringList) + public + Owner: TcxRegisteredClasses; + end; + +constructor TcxRegisteredClasses.Create(ARegisterClasses: Boolean = False); +begin + inherited Create; + FRegisterClasses := ARegisterClasses; + FItems := TcxRegisteredClassesStringList.Create; + TcxRegisteredClassesStringList(FItems).Owner := Self; +end; + +destructor TcxRegisteredClasses.Destroy; +begin + Clear; + FItems.Free; + inherited Destroy; +end; + +function TcxRegisteredClasses.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxRegisteredClasses.GetDescription(Index: Integer): string; +begin + Result := GetShortHint(FItems[Index]); +end; + +function TcxRegisteredClasses.GetHint(Index: Integer): string; +begin + Result := GetLongHint(FItems[Index]); +end; + +function TcxRegisteredClasses.GetItem(Index: Integer): TClass; +begin + Result := TClass(FItems.Objects[Index]); +end; + +procedure TcxRegisteredClasses.SetSorted(Value: Boolean); +begin + if FSorted <> Value then + begin + FSorted := Value; + if FSorted then Sort; + end; +end; + +function TcxRegisteredClasses.CompareItems(AIndex1, AIndex2: Integer): Integer; +begin + Result := AnsiCompareText(Descriptions[AIndex1], Descriptions[AIndex2]); +end; + +function SortClasses(List: TStringList; Index1, Index2: Integer): Integer; +begin + Result := TcxRegisteredClassesStringList(List).Owner.CompareItems(Index1, Index2); +end; + +procedure TcxRegisteredClasses.Sort; +begin + FItems.CustomSort(SortClasses); +end; + +procedure TcxRegisteredClasses.Clear; +begin + FItems.Clear; +end; + +function TcxRegisteredClasses.FindByClassName(const AClassName: string): TClass; +var + I: Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + begin + if Items[I].ClassName = AClassName then + begin + Result := Items[I]; + Break; + end; + end; +end; + +function TcxRegisteredClasses.FindByDescription(const ADescription: string): TClass; +var + I: Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + begin + if Descriptions[I] = ADescription then + begin + Result := Items[I]; + Break; + end; + end; +end; + +function TcxRegisteredClasses.GetDescriptionByClass(AClass: TClass): string; +var + AIndex: Integer; +begin + AIndex := GetIndexByClass(AClass); + if AIndex = -1 then + Result := '' + else + Result := Descriptions[AIndex]; +end; + +function TcxRegisteredClasses.GetHintByClass(AClass: TClass): string; +var + AIndex: Integer; +begin + AIndex := GetIndexByClass(AClass); + if AIndex = -1 then + Result := '' + else + Result := Hints[AIndex]; +end; + +function TcxRegisteredClasses.GetIndexByClass(AClass: TClass): Integer; +begin + Result := FItems.IndexOfObject(TObject(AClass)); +end; + +procedure TcxRegisteredClasses.Register(AClass: TClass; const ADescription: string); +begin + if GetIndexByClass(AClass) = -1 then + begin + FItems.AddObject(ADescription, TObject(AClass)); + if FSorted then Sort; + if FRegisterClasses then RegisterClass(TPersistentClass(AClass)); + end; +end; + +procedure TcxRegisteredClasses.Unregister(AClass: TClass); +var + I: Integer; +begin + I := GetIndexByClass(AClass); + if I <> -1 then + FItems.Delete(I); +end; + +{ TcxAutoWidthItem } + +constructor TcxAutoWidthItem.Create; +begin + inherited; + AutoWidth := -1; +end; + +{ TcxAutoWidthObject } + +constructor TcxAutoWidthObject.Create(ACount: Integer); +begin + inherited Create; + FItems := TList.Create; + FItems.Capacity := ACount; +end; + +destructor TcxAutoWidthObject.Destroy; +begin + Clear; + FItems.Free; + inherited; +end; + +function TcxAutoWidthObject.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxAutoWidthObject.GetItem(Index: Integer): TcxAutoWidthItem; +begin + Result := TcxAutoWidthItem(FItems[Index]); +end; + +function TcxAutoWidthObject.GetWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + Inc(Result, Items[I].Width); +end; + +procedure TcxAutoWidthObject.Clear; +var + I: Integer; +begin + for I := Count - 1 downto 0 do Items[I].Free; +end; + +function TcxAutoWidthObject.AddItem: TcxAutoWidthItem; +begin + Result := TcxAutoWidthItem.Create; + FItems.Add(Result); +end; + +procedure TcxAutoWidthObject.Calculate; +var + AAvailableWidth, AWidth, ANewAvailableWidth, ANewWidth, AOffset, I, + AItemAutoWidth: Integer; + AAssignAllWidths, AItemWithMinWidthFound: Boolean; + + procedure RemoveItemFromCalculation(AItem: TcxAutoWidthItem); + begin + with AItem do + begin + Dec(ANewAvailableWidth, AutoWidth); + Dec(ANewWidth, Width); + end; + end; + + procedure ProcessFixedItems; + var + I: Integer; + + procedure ProcessItem(AItem: TcxAutoWidthItem); + begin + with AItem do + if Fixed then + begin + AutoWidth := Width; + RemoveItemFromCalculation(AItem); + end; + end; + + begin + for I := 0 to Count - 1 do ProcessItem(Items[I]); + end; + + {procedure ProcessFixedColumns; + var + AFixedIndex, I: Integer; + begin + if not (gcsColumnSizing in GridDefinition.Controller.State) then Exit; + AFixedIndex := + (GridDefinition.Controller.DragAndDropObject as TcxGridColumnHeaderSizingObject).Column.VisibleIndex; + if AFixedIndex = Count - 1 then Exit; + for I := 0 to Count - 1 do + if I <= AFixedIndex then + begin + AColumnWidth := Items[I].CalculateWidth; + Items[I].Width := AColumnWidth; + Dec(AAvailableWidth, AColumnWidth); + Dec(AWidth, AColumnWidth); + end; + end;} + + procedure ProcessItem(AItem: TcxAutoWidthItem); + + function CalculateItemAutoWidth: Integer; + begin + Result := + MulDiv(AOffset + AItem.Width, AAvailableWidth, AWidth) - + MulDiv(AOffset, AAvailableWidth, AWidth); + end; + + begin + AItemAutoWidth := CalculateItemAutoWidth; + if AAssignAllWidths then + AItem.AutoWidth := AItemAutoWidth + else + if AItemAutoWidth <= AItem.MinWidth then + begin + AItem.AutoWidth := AItem.MinWidth; + RemoveItemFromCalculation(AItem); + AItemWithMinWidthFound := True; + end; + Inc(AOffset, AItem.Width); + end; + +begin + AAvailableWidth := FAvailableWidth; + AWidth := Width; + + ANewAvailableWidth := AAvailableWidth; + ANewWidth := AWidth; + ProcessFixedItems; + AAssignAllWidths := False; + repeat + AAvailableWidth := ANewAvailableWidth; + AWidth := ANewWidth; + AOffset := 0; + AItemWithMinWidthFound := False; + + for I := 0 to Count - 1 do + if Items[I].AutoWidth = -1 then ProcessItem(Items[I]); + + if not AItemWithMinWidthFound then + AAssignAllWidths := not AAssignAllWidths; + until (ANewWidth = 0) or not AItemWithMinWidthFound and not AAssignAllWidths; +end; + +{ TcxAlignment } + +constructor TcxAlignment.Create(AOwner: TPersistent; AUseAssignedValues: Boolean = False; + ADefaultHorz: TAlignment = taLeftJustify; ADefaultVert: TcxAlignmentVert = vaTop); +begin + inherited Create; + FOwner := AOwner; + FUseAssignedValues := AUseAssignedValues; + FDefaultHorz := ADefaultHorz; + FDefaultVert := ADefaultVert; + FHorz := FDefaultHorz; + FVert := FDefaultVert; +end; + +procedure TcxAlignment.Assign(Source: TPersistent); +var + AChanged: Boolean; +begin + if Source is TcxAlignment then + with Source as TcxAlignment do + begin + AChanged := Self.FHorz <> FHorz; + Self.FHorz := FHorz; + AChanged := AChanged or (Self.FVert <> FVert); + Self.FVert := FVert; + Self.FIsHorzAssigned := FIsHorzAssigned; + Self.FIsVertAssigned := FIsVertAssigned; + if AChanged then + Self.DoChanged; + end + else + inherited Assign(Source); +end; + +procedure TcxAlignment.Reset; +var + AChanged: Boolean; +begin + FIsHorzAssigned := False; + FIsVertAssigned := False; + AChanged := FHorz <> FDefaultHorz; + FHorz := FDefaultHorz; + AChanged := AChanged or (FVert <> FDefaultVert); + FVert := FDefaultVert; + if AChanged then + DoChanged; +end; + +procedure TcxAlignment.DoChanged; +begin + if Assigned(FOnChanged) then + FOnChanged(Self); +end; + +function TcxAlignment.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +function TcxAlignment.IsHorzStored: Boolean; +begin + if FUseAssignedValues then + Result := FIsHorzAssigned + else + Result := FHorz <> FDefaultHorz; +end; + +function TcxAlignment.IsVertStored: Boolean; +begin + if FUseAssignedValues then + Result := FIsVertAssigned + else + Result := FVert <> FDefaultVert; +end; + +procedure TcxAlignment.SetHorz(const Value: TAlignment); +begin + FIsHorzAssigned := True; + if Value <> FHorz then + begin + FHorz := Value; + DoChanged; + end; +end; + +procedure TcxAlignment.SetVert(const Value: TcxAlignmentVert); +begin + FIsVertAssigned := True; + if Value <> FVert then + begin + FVert := Value; + DoChanged; + end; +end; + +{ TcxObjectLinkController } + +constructor TcxObjectLinkController.Create; +begin + inherited Create; + FLinks := TList.Create; +end; + +destructor TcxObjectLinkController.Destroy; +begin + FreeAndNil(FLinks); + inherited Destroy; +end; + +function TcxObjectLinkController.AddLink(AObject: TObject): TcxObjectLink; +begin + Result := TcxObjectLink.Create; + Result.Ref := AObject; + FLinks.Add(Result); +end; + +procedure TcxObjectLinkController.RemoveLink(ALink: TcxObjectLink); +begin + if ALink.Ref <> nil then + FLinks.Remove(ALink); + ALink.Free; +end; + +procedure TcxObjectLinkController.ClearLinks(AObject: TObject); +var + I: Integer; + ALink: TcxObjectLink; +begin + for I := FLinks.Count - 1 downto 0 do + begin + ALink := TcxObjectLink(FLinks[I]); + if ALink.Ref = AObject then + begin + ALink.Ref := nil; + FLinks.Delete(I); + end; + end; +end; + +{ TcxFreeNotificator } + +procedure TcxFreeNotificator.AddSender(ASender: TComponent); +begin + if ASender <> nil then + ASender.FreeNotification(Self); +end; + +procedure TcxFreeNotificator.RemoveSender(ASender: TComponent); +begin +{$IFDEF DELPHI5} + if ASender <> nil then + ASender.RemoveFreeNotification(Self); +{$ENDIF} +end; + +procedure TcxFreeNotificator.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and Assigned(FOnFreeNotification) then + FOnFreeNotification(AComponent); +end; + +procedure AddObjectLinkControllerRefCount; +begin + Inc(FObjectLinkControllerRefCount); + if FObjectLinkController = nil then + FObjectLinkController := TcxObjectLinkController.Create; +end; + +procedure ReleaseObjectLinkControllerRefCount; +begin + Dec(FObjectLinkControllerRefCount); + if FObjectLinkControllerRefCount = 0 then + FreeAndNil(FObjectLinkController); +end; + +function cxAddObjectLink(AObject: TObject): TcxObjectLink; +begin + if AObject <> nil then + begin + AddObjectLinkControllerRefCount; + Result := FObjectLinkController.AddLink(AObject); + end + else + Result := nil; +end; + +procedure cxRemoveObjectLink(ALink: TcxObjectLink); +begin + if ALink <> nil then + begin + FObjectLinkController.RemoveLink(ALink); + ReleaseObjectLinkControllerRefCount; + end; +end; + +procedure cxClearObjectLinks(AObject: TObject); +begin + if FObjectLinkController <> nil then + FObjectLinkController.ClearLinks(AObject); +end; + +{ TcxMRUItems } + +constructor TcxMRUItems.Create; +begin + inherited Create; + FItems := TList.Create; +end; + +destructor TcxMRUItems.Destroy; +begin + ClearItems; + FItems.Free; + inherited; +end; + +function TcxMRUItems.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxMRUItems.GetItem(Index: Integer): TcxMRUItem; +begin + Result := TcxMRUItem(FItems[Index]); +end; + +procedure TcxMRUItems.SetCount(Value: Integer); +var + I: Integer; +begin + if Value < Count then + for I := Count - 1 downto Value do + Delete(I); +end; + +procedure TcxMRUItems.SetMaxCount(Value: Integer); +begin + if Value < 0 then Value := 0; + if FMaxCount <> Value then + begin + FMaxCount := Value; + UpdateCount; + end; +end; + +procedure TcxMRUItems.Delete(AIndex: Integer); +begin + Items[AIndex].Free; + FItems.Delete(AIndex); +end; + +procedure TcxMRUItems.UpdateCount; +begin + if MaxCount <> 0 then Count := MaxCount; +end; + +procedure TcxMRUItems.Add(AItem: TcxMRUItem); +var + AIndex: Integer; +begin + AIndex := IndexOf(AItem); + if AIndex = -1 then + begin + FItems.Insert(0, AItem); + UpdateCount; + end + else + begin + FItems.Move(AIndex, 0); + AItem.Free; + end; +end; + +procedure TcxMRUItems.ClearItems; +var + I: Integer; +begin + for I := Count - 1 downto 0 do + Delete(I); +end; + +function TcxMRUItems.IndexOf(AItem: TcxMRUItem): Integer; +begin + for Result := 0 to Count - 1 do + if Items[Result].Equals(AItem) then Exit; + Result := -1; +end; + +{ TcxOpenList } + +function TcxOpenList.GetItem(Index: Integer): TObject; +begin + Result := TObject(inherited Items[Index]); +end; + +procedure TcxOpenList.SetItem(Index: Integer; Value: TObject); +begin + Count := Max(Count, 1 + Index); + inherited Items[Index] := Value; +end; + +{ TcxComponentCollectionItem } + +destructor TcxComponentCollectionItem.Destroy; +begin + SetCollection(nil); + inherited Destroy; +end; + +procedure TcxComponentCollectionItem.Changed(AAllItems: Boolean); +begin + if not (csDestroying in ComponentState) and (Collection <> nil) then + if AAllItems then + Collection.Changed + else + Collection.Changed(Self); +end; + +function TcxComponentCollectionItem.GetDisplayName: string; +begin + Result := Name; +end; + +function TcxComponentCollectionItem.GetParentComponent: TComponent; +begin + if Collection <> nil then + Result := Collection.ParentComponent + else + Result := inherited GetParentComponent; +end; + +function TcxComponentCollectionItem.HasParent: Boolean; +begin + Result := GetParentComponent <> nil; +end; + +procedure TcxComponentCollectionItem.SetParentComponent(Value: TComponent); +begin + Collection := GetCollectionFromParent(Value); +end; + +procedure TcxComponentCollectionItem.SetCollection(AValue: TcxComponentCollection); +begin + if Collection <> AValue then + begin + RemoveFromCollection(Collection); + AddToCollection(AValue); + end; +end; + +procedure TcxComponentCollectionItem.SetIndex(AValue: Integer); +var + ACurIndex: Integer; +begin + ACurIndex := GetIndex; + if (ACurIndex >= 0) and (ACurIndex <> AValue) then + begin + Collection.FItems.Move(ACurIndex, AValue); + Changed(True); + end; +end; + +procedure TcxComponentCollectionItem.AddToCollection(ACollection: TcxComponentCollection); +begin + if ACollection <> nil then + ACollection.InsertItem(Self); +end; + +function TcxComponentCollectionItem.GetIndex: Integer; +begin + if Collection <> nil then + Result := Collection.FItems.IndexOf(Self) + else + Result := -1; +end; + +procedure TcxComponentCollectionItem.RemoveFromCollection(ACollection: TcxComponentCollection); +begin + if ACollection <> nil then + ACollection.RemoveItem(Self); +end; + +{ TcxComponentCollection } + +constructor TcxComponentCollection.Create(AParentComponent: TComponent; AItemClass: TcxComponentCollectionItemClass); +begin + inherited Create; + FParentComponent := AParentComponent; + FItemClass := AItemClass; + FItems := TList.Create; +end; + +destructor TcxComponentCollection.Destroy; +begin + FUpdateCount := 1; + if FItems <> nil then + Clear; + FItems.Free; + inherited Destroy; +end; + +procedure TcxComponentCollection.Assign(Source: TPersistent); +var + I: Integer; +begin + if Source is TcxComponentCollection then + begin + BeginUpdate; + try + Clear; + for I := 0 to TcxComponentCollection(Source).Count - 1 do + Add.Assign(TcxComponentCollection(Source).Items[I]); + finally + EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +function TcxComponentCollection.Add: TcxComponentCollectionItem; +begin + Result := FItemClass.Create(ParentComponent.Owner); + Result.SetParentComponent(ParentComponent); + SetItemName(Result); +end; + +procedure TcxComponentCollection.BeginUpdate; +begin + Inc(FUpdateCount); +end; + +procedure TcxComponentCollection.Clear; +begin + if FItems.Count = 0 then Exit; + BeginUpdate; + try + while FItems.Count > 0 do + TObject(FItems.Last).Free; + finally + EndUpdate; + end; +end; + +procedure TcxComponentCollection.Delete(AIndex: Integer); +begin + Notify(Items[AIndex], ccnDeleting); + Items[AIndex].Free; +end; + +procedure TcxComponentCollection.EndUpdate(AForceUpdate: Boolean = True); +begin + Dec(FUpdateCount); + if AForceUpdate then + Changed; +end; + +function TcxComponentCollection.FindItemByID(ID: Integer): TcxComponentCollectionItem; +var + I: Integer; +begin + for I := 0 to FItems.Count-1 do + begin + Result := Items[I]; + if Result.ID = ID then + Exit; + end; + Result := nil; +end; + +function TcxComponentCollection.Insert(AIndex: Integer): TcxComponentCollectionItem; +begin + Result := Add; + Result.Index := AIndex; +end; + +procedure TcxComponentCollection.Remove(AItem: TcxComponentCollectionItem); +var + AIndex: Integer; +begin + AIndex := FItems.IndexOf(AItem); + if AIndex > -1 then + Delete(AIndex); +end; + +procedure TcxComponentCollection.InsertItem(AItem: TcxComponentCollectionItem); +begin + if not (AItem is FItemClass) then + Exit; + FItems.Add(AItem); + AItem.FCollection := Self; + AItem.FID := FNextID; + Inc(FNextID); + Notify(AItem, ccnAdded); + Changed(AItem, ccnAdded); +end; + +procedure TcxComponentCollection.RemoveItem(AItem: TcxComponentCollectionItem); +begin + Notify(AItem, ccnExtracting); + FItems.Remove(AItem); + AItem.FCollection := nil; + Notify(AItem, ccnExtracted); + Changed(AItem, ccnExtracted); +end; + +procedure TcxComponentCollection.Changed(AItem: TcxComponentCollectionItem = nil; + AAction: TcxComponentCollectionNotification = ccnChanged); +begin + if FUpdateCount = 0 then + Update(AItem, AAction); +end; + +function TcxComponentCollection.GetItem(AIndex: Integer): TcxComponentCollectionItem; +begin + Result := TcxComponentCollectionItem(FItems[AIndex]); +end; + +function TcxComponentCollection.GetOwner: TPersistent; +begin + Result := ParentComponent; +end; + +procedure TcxComponentCollection.Notify(AItem: TcxComponentCollectionItem; + AAction: TcxComponentCollectionNotification); +begin +end; + +procedure TcxComponentCollection.SetItem(AIndex: Integer; Value: TcxComponentCollectionItem); +begin + Items[AIndex].Assign(Value); +end; + +procedure TcxComponentCollection.SetItemName(AItem: TcxComponentCollectionItem); +begin + +end; + +procedure TcxComponentCollection.Update(AItem: TcxComponentCollectionItem; + AAction: TcxComponentCollectionNotification); +begin + if Assigned(OnChange) then + OnChange(Self, AItem, AAction); +end; + +function TcxComponentCollection.GetCount: Integer; +begin + Result := FItems.Count; +end; + +{ functions } + +procedure CallNotify(ANotifyEvent: TNotifyEvent; ASender: TObject); +begin + if Assigned(ANotifyEvent) then + ANotifyEvent(ASender); +end; + +function ClassInheritsFrom(AClass: TClass; const AParentClassName: string): Boolean; +var + AParentClass: TClass; +begin + AParentClass := AClass; + repeat + Result := AParentClass.ClassName = AParentClassName; + if Result then Break; + AParentClass := AParentClass.ClassParent; + until AParentClass = nil; +end; + +procedure CopyList(ASource, ADestination: TList); +begin + ADestination.Count := ASource.Count; + Move(ASource.List^, ADestination.List^, ASource.Count * SizeOf(Pointer)); +end; + +function EqualMethods(const AMethod1, AMethod2: TMethod): Boolean; +begin + Result := (AMethod1.Code = AMethod2.Code) and (AMethod1.Data = AMethod2.Data); +end; + +procedure FillStringsWithEnumTypeValues(AStrings: TStrings; ATypeInfo: PTypeInfo; + AGetTypeItemCaption: TcxGetCaptionForIntegerItemFunc); +var + ATypeData: PTypeData; + I: Integer; + S: string; +begin + ATypeData := GetTypeData(ATypeInfo); + AStrings.BeginUpdate; + try + for I := ATypeData.MinValue to ATypeData.MaxValue do + begin + S := AGetTypeItemCaption(I); + if S <> '' then + AStrings.AddObject(S, TObject(I)); + end; + finally + AStrings.EndUpdate; + end; +end; + +function GetPersistentOwner(APersistent: TPersistent): TPersistent; +begin + Result := TPersistentAccess(APersistent).GetOwner; +end; + +function GetSubobjectName(AObject, ASubobject: TPersistent): string; +var + APropList: PPropList; + I: Integer; +begin + Result := ''; + I := GetPropList(AObject.ClassInfo, [tkClass], nil); + GetMem(APropList, I * SizeOf(PPropInfo)); + GetPropList(AObject.ClassInfo, [tkClass], APropList); + try + for I := 0 to I - 1 do + if APropList[I].PropType^ = ASubobject.ClassInfo then + begin + Result := APropList[I].Name; + Break; + end; + finally + FreeMem(APropList); + end; +end; + +function GetValidName(AComponent: TComponent; const AName: string; + AIsBaseName: Boolean = False): string; +var + AOwner: TComponent; + I: Integer; + + function GetNextName: string; + begin + Result := AName + IntToStr(I); + Inc(I); + end; + +begin + Result := AName; + AOwner := AComponent.Owner; + if AOwner = nil then Exit; + I := 1; + if AIsBaseName then Result := GetNextName; + while AOwner.FindComponent(Result) <> nil do + Result := GetNextName; +end; + +function HexToByte(const AHex: string): Byte; + + function CharToByte(C: Char): Byte; + begin + if C <= '9' then + Result := Ord(C) - Ord('0') + else + Result := 10 + Ord(Upcase(C)) - Ord('A'); + end; + +begin + Result := 16 * CharToByte(AHex[1]) + CharToByte(AHex[2]); +end; + +procedure RenameComponents(ACaller, AOwner: TComponent; + ANewName, AOldName: TComponentName; + AComponentCount: Integer; AGetComponent: TcxGetComponent); +var + I: Integer; + AComponent: TComponent; + AComponentName, ANamePrefix: TComponentName; +begin + // Components introduced in an ancestor will be renamed by IDE. + // We cannot rename components introduced in a successor because + // IDE will not refresh source code in a successor. + if csAncestor in ACaller.ComponentState then Exit; + for I := 0 to AComponentCount - 1 do + begin + AComponent := AGetComponent(ACaller, I); + if (AComponent.Owner = AOwner) {and not (csAncestor in AComponent.ComponentState)} then + begin + AComponentName := AComponent.Name; + if Length(AComponentName) > Length(AOldName) then + begin + ANamePrefix := Copy(AComponentName, 1, Length(AOldName)); + if CompareText(AOldName, ANamePrefix) = 0 then + begin + Delete(AComponentName, 1, Length(AOldName)); + Insert(ANewName, AComponentName, 1); + try + AComponent.Name := AComponentName; + except + on EComponentError do { Ignore rename errors }; + end; + end; + end; + end; + end; +end; + +function RoundDiv(I1, I2: Integer): Integer; +begin + Result := I1 div I2 + Ord(I1 mod I2 <> 0); +end; + +function Size(cx, cy: Longint): TSize; +begin + Result.cx := cx; + Result.cy := cy; +end; + +procedure SwapIntegers(var I1, I2: Integer); +var + I: Integer; +begin + I := I1; + I1 := I2; + I2 := I; +end; + +function GetRangeCenter(ABound1, ABound2: Integer): Integer; +begin + if ABound1 + ABound2 > 0 then + Result := (ABound1 + ABound2) div 2 + else + Result := (ABound1 + ABound2 - 1) div 2; +end; + +function StreamsEqual(AStream1, AStream2: TMemoryStream): Boolean; +begin + Result := (AStream1.Size = AStream2.Size) and + CompareMem(AStream1.Memory, AStream2.Memory, AStream1.Size); +end; + +procedure OpenWebPage(const AWebAddress: string); +begin + ShellExecute(0, 'OPEN', PChar(string(AWebAddress)), nil, nil, SW_SHOWMAXIMIZED); +end; + +function GetCorrectPath(const S: string): string; +var + I: Integer; +begin + Result := S; + for I := 1 to Length(Result) do + if Result[I] = '/' then + Result[I] := {$IFDEF DELPHI6}PathDelim{$ELSE}'\'{$ENDIF}; +end; + +type + TcxResourceStringsModificationMode = (rmmByResStringValue, rmmByResStringID, rmmUndefined); + + TcxResOriginalStrings = class(TStringList) + public + {$IFNDEF DELPHI6} + function IndexOf(const S: string): Integer; override; + {$ELSE} + constructor Create; + {$ENDIF} + end; + +{$IFNDEF DELPHI6} +function TcxResOriginalStrings.IndexOf(const S: string): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Count - 1 do + if AnsiCompareStr(Get(I), S) = 0 then + begin + Result := I; + Break; + end; +end; +{$ELSE} +constructor TcxResOriginalStrings.Create; +begin + inherited Create; + CaseSensitive := True; +end; +{$ENDIF} + +var + FResOriginalStrings: TcxResOriginalStrings; + FResStrings: TStringList; + FResStringsModificationMode: TcxResourceStringsModificationMode = rmmUndefined; + +procedure CreateResStringLists( + AResStringsModificationMode: TcxResourceStringsModificationMode); +begin + if AResStringsModificationMode = rmmUndefined then + raise Exception.Create(''); + if (FResStringsModificationMode <> rmmUndefined) and + (AResStringsModificationMode <> FResStringsModificationMode) then + raise Exception.Create('You cannot mix cxSetResourceString and cxSetResourceStringNet calls'); + + if FResStringsModificationMode = rmmUndefined then + begin + FResStringsModificationMode := AResStringsModificationMode; + FResOriginalStrings := TcxResOriginalStrings.Create; + FResStrings := TStringList.Create; + end; +end; + +procedure DestroyResStringLists; +begin + FResStringsModificationMode := rmmUndefined; + FreeAndNil(FResOriginalStrings); + FreeAndNil(FResStrings); +end; + +function GetResOriginalStringIndex(AResString: TcxResourceStringID): Integer; +begin + case FResStringsModificationMode of + rmmByResStringValue: + Result := FResOriginalStrings.IndexOf(LoadResString(AResString)); + rmmByResStringID: + Result := FResOriginalStrings.IndexOfObject(TObject(AResString)); + else + Result := -1; + end; +end; + +function cxGetResourceString(AResString: TcxResourceStringID): string; +var + AIndex: Integer; +begin + AIndex := GetResOriginalStringIndex(AResString); + if AIndex <> -1 then + Result := FResStrings[AIndex] + else + Result := LoadResString(AResString); +end; + +procedure cxSetResourceString(AResString: TcxResourceStringID; + const Value: string); +var + AIndex: Integer; +begin + CreateResStringLists(rmmByResStringID); + AIndex := GetResOriginalStringIndex(AResString); + if AIndex <> -1 then + FResStrings[AIndex] := Value + else + begin + FResOriginalStrings.AddObject(LoadResString(AResString), TObject(AResString)); + FResStrings.Add(Value); + end; +end; + +function cxGetResourceString(const AResString: string): string;{$IFDEF DELPHI6} deprecated;{$ENDIF} +begin + Result := cxGetResourceStringNet(AResString); +end; + +function cxGetResourceStringNet(const AResString: string): string;{$IFDEF DELPHI6} deprecated;{$ENDIF} +var + AIndex: Integer; +begin + Result := AResString; + if FResOriginalStrings <> nil then + begin + AIndex := FResOriginalStrings.IndexOf(AResString); + if AIndex <> -1 then + Result := FResStrings[AIndex]; + end +end; + +procedure cxSetResourceStringNet(const AResString, Value: string);{$IFDEF DELPHI6} deprecated;{$ENDIF} +var + AIndex: Integer; +begin + CreateResStringLists(rmmByResStringValue); + AIndex := FResOriginalStrings.IndexOf(AResString); + if AIndex <> -1 then + FResStrings[AIndex] := Value + else + begin + FResOriginalStrings.Add(AResString); + FResStrings.Add(Value); + end; +end; + +function CreateUniqueName(AOwnerForm, AOwnerComponent, AComponent: TComponent; + const APrefixName, ASuffixName: string): string; +var + I, J: Integer; + + function GenerateName(AOwnerComponent: TComponent; + const AClassName, APrefixName, ASuffixName: string; ANumber: Integer): string; + var + S: string; + + procedure CheckName(var AName: string); + var + I: Integer; + begin + I := 1; + while I <= Length(AName) do + if AName[I] in ['A'..'Z','a'..'z','_','0'..'9'] then + Inc(I) + else + if AName[I] in LeadBytes then + Delete(AName, I, 2) + else + Delete(AName, I, 1); + end; + + begin + S := ASuffixName; + CheckName(S); + if ((S = '') or (S[1] in ['0'..'9'])) and (AClassName <> '') then + if (APrefixName <> '') and + (CompareText(APrefixName, Copy(AClassName, 1, Length(APrefixName))) = 0) then + S := Copy(AClassName, Length(APrefixName) + 1, Length(AClassName)) + S + else + begin + S := AClassName + S; + if S[1] = 'T' then Delete(S, 1, 1); + end; + if AOwnerComponent <> nil then + Result := AOwnerComponent.Name + S + else + Result := S; + if ANumber > 0 then + Result := Result + IntToStr(ANumber); + end; + + function IsUnique(const AName: string): Boolean; + var + I: Integer; + begin + Result := True; + with AOwnerForm do + for I := 0 to ComponentCount - 1 do + if (Components[I] <> AComponent) and + (CompareText(Components[I].Name, AName) = 0) then + begin + Result := False; + Break; + end; + end; + +begin + if ASuffixName <> '' then + J := 0 + else + J := 1; + for I := J to MaxInt do + begin + Result := GenerateName(AOwnerComponent, AComponent.ClassName, + APrefixName, ASuffixName, I); + if IsUnique(Result) then + Break; + end; +end; + +procedure cxZeroMemory(ADestination: Pointer; ACount: Integer); +begin + ZeroMemory(ADestination, ACount); +end; + +function cxAllocMem(Size: Cardinal): Pointer; +begin + GetMem(Result, Size); + cxZeroMemory(Result, Size); +end; + +procedure cxFreeMem(P: Pointer); +begin + FreeMem(P); +end; + +procedure cxCopyData(Source, Dest: Pointer; Count: Integer); +begin + Move(Source^, Dest^, Count); +end; + +procedure cxCopyData(Source, Dest: Pointer; ASourceOffSet, ADestOffSet, Count: Integer); overload; +begin + if ASourceOffSet > 0 then + Source := Pointer(Integer(Source) + ASourceOffSet); + if ADestOffSet > 0 then + Dest := Pointer(Integer(Dest) + ADestOffSet); + cxCopyData(Source, Dest, Count); +end; + +function ReadBoolean(ASource: Pointer; AOffset: Integer = 0): WordBool; +begin + cxCopyData(ASource, @Result, AOffset, 0, SizeOf(WordBool)); +end; + +function ReadByte(ASource: Pointer; AOffset: Integer = 0): Byte; +begin + cxCopyData(ASource, @Result, AOffset, 0, SizeOf(Byte)); +end; + +function ReadInteger(ASource: Pointer; AOffset: Integer = 0): Integer; +begin + cxCopyData(ASource, @Result, AOffset, 0, SizeOf(Integer)); +end; + +function ReadPointer(ASource: Pointer): Pointer; +begin + Result := Pointer(ASource^); +end; + +function ReadWord(ASource: Pointer; AOffset: Integer = 0): Word; +begin + cxCopyData(ASource, @Result, AOffset, 0, SizeOf(Word)); +end; + +procedure WriteBoolean(ADest: Pointer; AValue: WordBool; AOffset: Integer = 0); +begin + cxCopyData(@AValue, ADest, 0, AOffset, SizeOf(WordBool)); +end; + +procedure WriteByte(ADest: Pointer; AValue: Byte; AOffset: Integer = 0); +begin + cxCopyData(@AValue, ADest, 0, AOffset, SizeOf(Byte)); +end; + +procedure WriteInteger(ADest: Pointer; AValue: Integer; AOffset: Integer = 0); +begin + cxCopyData(@AValue, ADest, 0, AOffset, SizeOf(Integer)); +end; + +procedure WritePointer(ADest: Pointer; AValue: Pointer); +begin + Pointer(ADest^) := AValue; +end; + +procedure WriteWord(ADest: Pointer; AValue: Word; AOffset: Integer = 0); +begin + cxCopyData(@AValue, ADest, 0, AOffset, SizeOf(Word)); +end; + +function cxSign(const AValue: Double): Integer; +begin + Result := IfThen(AValue >= 0, 1, -1); +end; + +{ TcxDialogMetricsInfo } + +constructor TcxDialogMetricsInfo.Create(AForm: TForm); +begin + Store(AForm); +end; + +destructor TcxDialogMetricsInfo.Destroy; +begin + FreeCustomData; + inherited Destroy; +end; + +procedure TcxDialogMetricsInfo.Restore(AForm: TForm); +var + AIntf: IcxDialogMetricsInfoData; +begin + if FMaximized then + begin + ShowWindow(AForm.Handle, WS_MAXIMIZE); + AForm.WindowState := wsMaximized; + end + else + begin + AForm.Left := FLeft; + AForm.Top := FTop; + if AForm.BorderStyle in [bsSizeable, bsSizeToolWin] then + begin + AForm.ClientHeight := FClientHeight; + AForm.ClientWidth := FClientWidth; + end; + end; + if Supports(TObject(AForm), IcxDialogMetricsInfoData, AIntf) and (FData <> nil) then + AIntf.SetInfoData(FData); +end; + +procedure TcxDialogMetricsInfo.Store(AForm: TForm); +var + AIntf: IcxDialogMetricsInfoData; +begin + FDialogClass := AForm.ClassType; + FLeft := AForm.Left; + FTop := AForm.Top; + FClientHeight := AForm.ClientHeight; + FClientWidth := AForm.ClientWidth; + FMaximized := AForm.WindowState = wsMaximized; + FreeCustomData; + if Supports(TObject(AForm), IcxDialogMetricsInfoData, AIntf) and (AIntf.GetInfoDataSize > 0) then + begin + GetMem(FData, AIntf.GetInfoDataSize); + Move(AIntf.GetInfoData^, FData^, AIntf.GetInfoDataSize); + end; +end; + +procedure TcxDialogMetricsInfo.FreeCustomData; +begin + if FData <> nil then + begin + FreeMem(FData); + FData := nil; + end; +end; + +{ TcxDialogsMetricsStore } + +constructor TcxDialogsMetricsStore.Create; +begin + inherited; + FMetrics := TcxObjectList.Create; + FDefaultPosition := poMainFormCenter; +end; + +destructor TcxDialogsMetricsStore.Destroy; +begin + FMetrics.Free; + inherited Destroy; +end; + +procedure TcxDialogsMetricsStore.InitDialog(AForm: TForm); +begin + if FindMetrics(AForm) >= 0 then + begin + AForm.Position := poDesigned; + TcxDialogMetricsInfo(FMetrics[FindMetrics(AForm)]).Restore(AForm) + end + else + begin + AForm.Position := DefaultPosition; + FMetrics.Add(CreateMetrics(AForm)); + end; +end; + +procedure TcxDialogsMetricsStore.StoreMetrics(AForm: TForm); +begin + if FindMetrics(AForm) >= 0 then + TcxDialogMetricsInfo(FMetrics[FindMetrics(AForm)]).Store(AForm) +end; + +function TcxDialogsMetricsStore.CreateMetrics( + AForm: TForm): TcxDialogMetricsInfo; +begin + Result := TcxDialogMetricsInfo.Create(AForm); +end; + +function TcxDialogsMetricsStore.FindMetrics( + AForm: TForm): Integer; +begin + Result := FMetrics.Count - 1; + while Result >= 0 do + begin + if TcxDialogMetricsInfo(FMetrics[Result]).DialogClass = AForm.ClassType then + Break; + Dec(Result); + end; +end; + +function cxDialogsMetricsStore: TcxDialogsMetricsStore; +begin + if FDialogsMetrics = nil then + FDialogsMetrics := TcxDialogsMetricsStore.Create; + Result := FDialogsMetrics; +end; + +initialization +{$IFDEF DELPHI6} + StartClassGroup(TControl); + GroupDescendentsWith(TcxComponent, TControl); +{$ENDIF} + +finalization + FreeAndNil(FDialogsMetrics); + DestroyResStringLists; + +end. + diff --git a/official/x.35/ExpressLibrary/Sources/cxClassesReg.pas b/official/x.35/ExpressLibrary/Sources/cxClassesReg.pas new file mode 100644 index 00000000..a5ac0a9b --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxClassesReg.pas @@ -0,0 +1,64 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxClassesReg; + +{$I cxVer.inc} + +interface + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI6} + DesignIntf, DesignEditors, +{$ELSE} + DsgnIntf, +{$ENDIF} + Classes, cxClasses, cxComponentCollectionEditor; + +procedure Register; +begin + RegisterPropertyEditor(TypeInfo(TComponent), TcxComponent, 'FakeComponentLink1', nil); + RegisterPropertyEditor(TypeInfo(TComponent), TcxComponent, 'FakeComponentLink2', nil); + RegisterPropertyEditor(TypeInfo(TComponent), TcxComponent, 'FakeComponentLink3', nil); + + RegisterPropertyEditor(TypeInfo(TcxComponentCollection), nil, '', TcxComponentCollectionProperty); +end; + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxComponentCollectionEditor.dfm b/official/x.35/ExpressLibrary/Sources/cxComponentCollectionEditor.dfm new file mode 100644 index 00000000..05bd2458 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxComponentCollectionEditor.dfm @@ -0,0 +1,470 @@ +object frmComponentCollectionEditor: TfrmComponentCollectionEditor + Left = 534 + Top = 162 + HelpContext = 26150 + HorzScrollBar.Increment = 10 + VertScrollBar.Increment = 11 + BorderIcons = [biSystemMenu] + BorderStyle = bsSizeToolWin + Caption = 'CollectionEditor' + ClientHeight = 152 + ClientWidth = 183 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + KeyPreview = True + OldCreateOrder = True + Position = poDesigned + ShowHint = True + OnClose = FormClose + OnDestroy = FormDestroy + OnKeyDown = FormKeyDown + OnKeyPress = FormKeyPress + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object ToolBar1: TToolBar + Left = 0 + Top = 0 + Width = 183 + Height = 28 + AutoSize = True + ButtonHeight = 24 + ButtonWidth = 24 + EdgeBorders = [ebTop, ebBottom] + Images = ImageList + PopupMenu = PopupMenu2 + TabOrder = 1 + Wrapable = False + object ToolButton1: TToolButton + Left = 0 + Top = 0 + Action = acAdd + end + object ToolButton2: TToolButton + Left = 24 + Top = 0 + Action = acDelete + end + object ToolButton3: TToolButton + Left = 48 + Top = 0 + Width = 8 + Caption = 'ToolButton3' + ImageIndex = 2 + Style = tbsSeparator + end + object ToolButton4: TToolButton + Left = 56 + Top = 0 + Action = acMoveUp + end + object ToolButton5: TToolButton + Left = 80 + Top = 0 + Action = acMoveDown + end + end + object Panel: TPanel + Left = 0 + Top = 28 + Width = 183 + Height = 124 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object ListView1: TListView + Left = 0 + Top = 0 + Width = 183 + Height = 124 + Align = alClient + Columns = < + item + AutoSize = True + end> + ColumnClick = False + DragMode = dmAutomatic + HideSelection = False + MultiSelect = True + ReadOnly = True + RowSelect = True + PopupMenu = PopupMenu1 + ShowColumnHeaders = False + TabOrder = 0 + ViewStyle = vsReport + OnChange = ListView1Change + OnDragDrop = ListView1DragDrop + OnDragOver = ListView1DragOver + OnKeyDown = ListView1KeyDown + OnKeyPress = ListView1KeyPress + end + end + object ImageList: TImageList + Left = 40 + Top = 40 + Bitmap = { + 494C010104000500040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000002000000001002000000000000020 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840084848400848484000000000000000000848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840084848400848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 0000FFFFFF0000FFFF0000000000848484000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 0000FFFFFF0000FFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000000000C6C6 + C60000000000FFFFFF000000000084848400848484000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000000000C6C6 + C60000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000FF + FF00C6C6C6000000000000000000848484000000840000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000FF + FF00C6C6C6000000000000000000848484000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848400000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000 + 000000000000000000000000000084848400000084000000840000FFFF00FFFF + FF0000FFFF00FFFFFF00848484000000840000FFFF00FFFFFF00000000000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000000000FFFFFF008484 + 840000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00000000008484840084848400000084008484840000FF + FF00FFFFFF00848484000000840084848400FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000848484000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008484000084840000848400008484000084840000000000000000 + 0000000000000000000000000000000000008484840000FFFF0000FFFF008484 + 8400FFFFFF0000FFFF008484840000FFFF00FFFFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000848484000000000000008400000084008484 + 840000FFFF000000840000008400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000848400008484000084840000848400008484000084840000848400000000 + 0000000000000000000000000000000000000000000084848400FFFFFF008484 + 840000FFFF008484840000FFFF00FFFFFF0000FFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000848484000000000084848400000084000000 + 84000000840000008400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000848484000000000000000000000000000000 + 0000848400008484000084840000848400008484000084840000848400000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000848484008484840084848400FFFF + FF0084848400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000848484000000000084848400000084000000 + 840000008400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000008484000084840000848400008484000084840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000FFFF008484840000FF + FF00FFFFFF008484840084848400848484008484840000000000000000000000 + 0000000000000000000000000000000000008484840000008400000084000000 + 8400000084008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000000000008484840000FFFF008484 + 840000FFFF008484840000FFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000840000008400848484000000 + 0000000084000000840084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848400000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000008484840000FFFF00000000008484 + 8400FFFFFF00000000008484840000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000840000008400848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF0000000000000000008484 + 840000FFFF000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000008400000084008484840000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFC000C000FFFFFFFF + 80008000FFFFFFFF80008000FFFFFFFF80000000F83FFEFF80000000F83FFC7F + 80000000F83FF83F00000000F83FF01F00008000C007E00F80008000E00FC007 + 00008000F01FF83F00010001F83FF83F81FF11FFFC7FF83F24FFF8FFFEFFF83F + 66FFFC7FFFFFFFFFE7FFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end + object ActionList: TActionList + Images = ImageList + Left = 8 + Top = 40 + object acAdd: TAction + Caption = '&Add' + Hint = 'Add New' + ImageIndex = 0 + ShortCut = 45 + OnExecute = acAddExecute + end + object acDelete: TAction + Caption = '&Delete' + Enabled = False + Hint = 'Delete Selected' + ImageIndex = 1 + ShortCut = 46 + OnExecute = acDeleteExecute + OnUpdate = SelectionUpdate + end + object acMoveUp: TAction + Caption = 'Move &Up' + Enabled = False + Hint = 'Move Selected Up' + ImageIndex = 2 + ShortCut = 16422 + OnExecute = acMoveUpExecute + OnUpdate = SelectionUpdate + end + object acMoveDown: TAction + Caption = 'Move Dow&n' + Enabled = False + Hint = 'Move Selected Down' + ImageIndex = 3 + ShortCut = 16424 + OnExecute = acMoveDownExecute + OnUpdate = SelectionUpdate + end + object acSelectAll: TAction + Caption = '&Select All' + Enabled = False + ShortCut = 16449 + OnExecute = acSelectAllExecute + OnUpdate = SelectAllCommandUpdate + end + object acToolbar: TAction + Caption = '&Toolbar' + Checked = True + OnExecute = acToolbarExecute + OnUpdate = acToolbarUpdate + end + object acTextLabels: TAction + Caption = 'Text &Labels' + OnExecute = acTextLabelsExecute + end + end + object PopupMenu1: TPopupMenu + Images = ImageList + Left = 72 + Top = 40 + object miAdd: TMenuItem + Action = acAdd + end + object miDelete: TMenuItem + Action = acDelete + end + object miMoveUp: TMenuItem + Action = acMoveUp + end + object miMoveDown: TMenuItem + Action = acMoveDown + end + object SelectAll1: TMenuItem + Action = acSelectAll + end + object N1: TMenuItem + Caption = '-' + end + object miToolbar: TMenuItem + Action = acToolbar + end + end + object PopupMenu2: TPopupMenu + Left = 104 + Top = 40 + object miTextLabels: TMenuItem + Action = acTextLabels + end + end +end diff --git a/official/x.35/ExpressLibrary/Sources/cxComponentCollectionEditor.pas b/official/x.35/ExpressLibrary/Sources/cxComponentCollectionEditor.pas new file mode 100644 index 00000000..cdaa4cab --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxComponentCollectionEditor.pas @@ -0,0 +1,823 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressCommonLibrary } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCOMMONLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxComponentCollectionEditor; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, + DesignIntf, DesignWindows, ComponentDesigner, DesignConst, DesignEditors, ColnEdit, +{$ELSE} + DsgnWnds, DsgnIntf, LibIntf, DesignConst, ColnEdit, +{$ENDIF} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + StdCtrls, Menus, ExtCtrls, ComCtrls, ImgList, ActnList, ToolWin, + cxClasses, cxDesignWindows; + +type + + { TfrmComponentCollectionEditor } + + TfrmComponentCollectionEditor = class(TcxDesignFormEditor) + acAdd: TAction; + acDelete: TAction; + acMoveDown: TAction; + acMoveUp: TAction; + acSelectAll: TAction; + acTextLabels: TAction; + acToolbar: TAction; + ImageList: TImageList; + ListView1: TListView; + miAdd: TMenuItem; + miDelete: TMenuItem; + miMoveDown: TMenuItem; + miMoveUp: TMenuItem; + miTextLabels: TMenuItem; + miToolbar: TMenuItem; + N1: TMenuItem; + Panel: TPanel; + PopupMenu1: TPopupMenu; + PopupMenu2: TPopupMenu; + Toolbar1: TToolbar; + ToolButton1: TToolButton; + ToolButton2: TToolButton; + ToolButton3: TToolButton; + ToolButton4: TToolButton; + ToolButton5: TToolButton; + ActionList: TActionList; + SelectAll1: TMenuItem; + procedure acAddExecute(Sender: TObject); + procedure acDeleteExecute(Sender: TObject); + procedure acMoveDownExecute(Sender: TObject); + procedure acMoveUpExecute(Sender: TObject); + procedure acSelectAllExecute(Sender: TObject); + procedure acTextLabelsExecute(Sender: TObject); + procedure acToolbarExecute(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormDestroy(Sender: TObject); + procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure FormKeyPress(Sender: TObject; var Key: Char); + procedure FormShow(Sender: TObject); + procedure ListView1Change(Sender: TObject; Item: TListItem; Change: TItemChange); + procedure ListView1DragDrop(Sender, Source: TObject; X, Y: Integer); + procedure ListView1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); + procedure ListView1KeyDown(Sender: TObject; var Key: word; Shift: TShiftState); + procedure ListView1KeyPress(Sender: TObject; var Key: Char); + procedure SelectAllCommandUpdate(Sender: TObject); + procedure SelectionUpdate(Sender: TObject); + procedure acToolbarUpdate(Sender: TObject); + private + FAddedItemIDList: TList; + FCollectionClassName: string; + FSelectionError: Boolean; + FColOptions: TColOptions; + procedure AMDeferUpdate(var Msg); message AM_DeferUpdate; + function GetCollection: TcxComponentCollection; + function GetRegKey: string; + procedure SetColOptions(Value: TColOptions); + procedure WMActivate(var Message: TWMActivate); message WM_ACTIVATE; + protected + procedure Activated; override; + function CanAdd(Index: Integer): Boolean; virtual; + procedure InitFormEditor; override; + procedure SelectAll(DoUpdate: Boolean = True); + procedure SelectNone(DoUpdate: Boolean = True); + procedure UpdateCaption; override; + procedure UpdateContent; override; + public + constructor Create(AOwner: TComponent); override; + procedure DoItemsModified; override; + function GetItemName(ItemIndex: Integer): string; + procedure GetSelection; + procedure SelectionsChanged(const ASelection: TDesignerSelectionList); override; + procedure SetSelection; + procedure UpdateListbox; + + property Collection: TcxComponentCollection read GetCollection; + property CollectionPropertyName: string read ComponentPropertyName; + property Options: TColOptions read FColOptions write SetColOptions + default [coAdd, coDelete, coMove]; + end; + + { TcxComponentCollectionProperty } + + TcxComponentCollectionEditorClass = class of TfrmComponentCollectionEditor; + + TcxComponentCollectionProperty = class(TClassProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + function GetEditorClass: TcxComponentCollectionEditorClass; virtual; + function GetColOptions: TColOptions; virtual; + end; + +implementation + +{$R *.dfm} + +uses + Registry, TypInfo; + +type + TPersistentAccess = class(TPersistent); // used for protected method access + +{ TcxComponentCollectionProperty } + +procedure TcxComponentCollectionProperty.Edit; +var + Obj: TPersistent; +begin + Obj := GetComponent(0); + while (Obj <> nil) and not (Obj is TComponent) do + Obj := TPersistentAccess(Obj).GetOwner; + TfrmComponentCollectionEditor(ShowFormEditorClass(Designer, TComponent(Obj), + TcxComponentCollection(GetOrdValue), GetName, GetEditorClass)).Options := GetColOptions; +end; + +function TcxComponentCollectionProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paDialog, paReadOnly]; +end; + +function TcxComponentCollectionProperty.GetEditorClass: TcxComponentCollectionEditorClass; +begin + Result := TfrmComponentCollectionEditor; +end; + +function TcxComponentCollectionProperty.GetColOptions: TColOptions; +begin + Result := [coAdd, coDelete, coMove]; +end; + +{ TfrmComponentCollectionEditor } + +constructor TfrmComponentCollectionEditor.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FColOptions := [coAdd, coDelete, coMove]; +end; + +procedure TfrmComponentCollectionEditor.acAddExecute(Sender: TObject); +var + Item: TListItem; + PrevCount, PrevListCount: Integer; +begin + BeginUpdate; + SelectNone(False); + Collection.BeginUpdate; + try + PrevCount := Collection.Count + 1; + PrevListCount := ListView1.Items.Count; + Collection.Add; + { Take into account collections that free items } + if (PrevCount <> Collection.Count) then + UpdateListBox + else + if ListView1.Items.Count > PrevListCount then + ListView1.Items[ListView1.Items.Count - 1].Selected := True + else + ListView1.Selected := ListView1.Items.Add; + finally + Collection.EndUpdate; + end; + CancelUpdate; + SetSelection; + if csAncestor in Component.ComponentState then + begin + if FAddedItemIDList = nil then + FAddedItemIDList := TList.Create; + FAddedItemIDList.Add(Pointer(Collection.Items[Collection.Count - 1].ID)); + end; + Item := ListView1.Items[ListView1.Items.Count-1]; + Item.Focused := True; + Item.MakeVisible(False); +end; + +procedure TfrmComponentCollectionEditor.acDeleteExecute(Sender: TObject); +var + I, J, K: Integer; + Item: TcxComponentCollectionItem; + Found: Boolean; +begin + BeginUpdate; + Collection.BeginUpdate; + try + Designer.SetSelections(nil); + if ListView1.Selected <> nil then + J := ListView1.Selected.Index + else + J := -1; + if (ListView1.SelCount = Collection.Count) and ((csAncestor in Component.ComponentState) = False) then + Collection.Clear + else if ListView1.SelCount > 0 then + for I := ListView1.Items.Count - 1 downto 0 do + if ListView1.Items[I].Selected then + begin + Found := False; + if (FAddedItemIDList <> nil) and (FAddedItemIDList.Count > 0) then + for K := 0 to FAddedItemIDList.Count -1 do + begin + Item := Collection.FindItemByID(Integer(FAddedItemIDList[K])); + if Item = Collection.Items[i] then + begin + FAddedItemIDList.Delete(K); + Found := True; + Break; + end + else Found := False; + end; + if (not Found) and (csAncestor in Component.ComponentState) then + raise Exception.Create(SCantDeleteAncestor) + else + Collection.Items[I].Free; + end; + finally + Collection.EndUpdate; + CancelUpdate; + end; + UpdateListbox; + if J >= ListView1.Items.Count then + J := ListView1.Items.Count - 1; + if (J > -1) and (J < ListView1.Items.Count) then + ListView1.Selected := ListView1.Items[J]; + SetSelection; +end; + +procedure TfrmComponentCollectionEditor.acMoveDownExecute(Sender: TObject); +var + I, InsPos: Integer; +begin + if (ListView1.SelCount = 0) or + (ListView1.SelCount = Collection.Count) then Exit; + + InsPos := ListView1.Items.Count - 1; + while not ListView1.Items[InsPos].Selected do + Dec(InsPos); + if InsPos < (ListView1.Items.Count -1) then Inc(InsPos); + + Collection.BeginUpdate; + try + for I := ListView1.Items.Count - 1 downto 0 do + if ListView1.Items[I].Selected then + begin + Collection.Items[I].Index := InsPos; + Dec(InsPos); + end; + finally + Collection.EndUpdate; + end; + Designer.Modified; + UpdateContent; +end; + +procedure TfrmComponentCollectionEditor.acMoveUpExecute(Sender: TObject); +var + I, InsPos: Integer; +begin + if (ListView1.SelCount = 0) or + (ListView1.SelCount = Collection.Count) then Exit; + + InsPos := 0; + while not ListView1.Items[InsPos].Selected do + Inc(InsPos); + if InsPos > 0 then Dec(InsPos); + + Collection.BeginUpdate; + try + for I := 0 to ListView1.Items.Count - 1 do + if ListView1.Items[I].Selected then + begin + Collection.Items[I].Index := InsPos; + Inc(InsPos); + end; + finally + Collection.EndUpdate; + end; + Designer.Modified; + UpdateContent; +end; + +procedure TfrmComponentCollectionEditor.acSelectAllExecute(Sender: TObject); +begin + SelectAll; +end; + +procedure TfrmComponentCollectionEditor.acTextLabelsExecute(Sender: TObject); +begin + with acTextLabels do + begin + Checked := not Checked; + Toolbar1.ShowCaptions := Checked; + if not Checked then + begin + Toolbar1.ButtonHeight := 24; + Toolbar1.ButtonWidth := 24; + end; + end; +end; + +procedure TfrmComponentCollectionEditor.acToolbarExecute(Sender: TObject); +begin + with acToolbar do + begin + Checked := not Checked; + Toolbar1.Visible := Checked; + end; +end; + +procedure TfrmComponentCollectionEditor.acToolbarUpdate(Sender: TObject); +begin + (Sender as TAction).Checked := Toolbar1.Visible; +end; + +procedure TfrmComponentCollectionEditor.SetColOptions(Value: TColOptions); +begin + FColOptions := Value; + acAdd.Enabled := coAdd in Value; +end; + +procedure TfrmComponentCollectionEditor.WMActivate(var Message: TWMActivate); +begin + inherited; + if (Message.Active <> WA_INACTIVE) and (Collection <> nil) then + SetSelection; +end; + +procedure TfrmComponentCollectionEditor.DoItemsModified; +begin + if Collection <> nil then + begin + UpdateListbox; + GetSelection; + end; +end; + +function TfrmComponentCollectionEditor.GetItemName(ItemIndex: Integer): string; +var + AName: string; +begin + AName := Collection.Items[ItemIndex].DisplayName; + if AName = '' then + AName := ''; + Result := Format('%d - %s',[ItemIndex, AName]) +end; + +function TfrmComponentCollectionEditor.GetCollection: TcxComponentCollection; +begin + Result := TcxComponentCollection(ComponentProperty); +end; + +function TfrmComponentCollectionEditor.GetRegKey: string; +begin + Result := GetBaseRegKey + '\ComponentCollection Editor'; +end; + +procedure TfrmComponentCollectionEditor.GetSelection; +var + I: Integer; + Item: TcxComponentCollectionItem; + List: {$IFDEF DELPHI6}IDesignerSelections{$ELSE}TDesignerSelectionList{$ENDIF}; +begin + BeginUpdate; + try + ListView1.Selected := nil; + finally + CancelUpdate; + end; +{$IFDEF DELPHI6} + List := CreateSelectionList; +{$ELSE} + List := TDesignerSelectionList.Create; + try +{$ENDIF} + Designer.GetSelections(List); + if (List.Count = 0) or (List.Count > Collection.Count) then Exit; + if not ((List[0] = Component) or (List[0] = Collection) + or (TcxComponentCollectionItem(List[0]).Collection = Collection)) then Exit; + if List.Count > ListView1.Items.Count then + UpdateListbox; + BeginUpdate; + try + {$IFDEF DELPHI6} + ListView1.ClearSelection; + {$ELSE} + for I := 0 to ListView1.Items.Count - 1 do + ListView1.Items[I].Selected := False; + {$ENDIF} + for I := 0 to List.Count - 1 do + begin + if List[I] is TcxComponentCollectionItem then + begin + Item := TcxComponentCollectionItem(List[I]); + ListView1.Items[Item.Index].Selected := True + end; + end; + finally + CancelUpdate; + end; +{$IFNDEF DELPHI6} + finally + List.Free; + end; +{$ENDIF} +end; + +procedure TfrmComponentCollectionEditor.SelectionsChanged(const ASelection: TDesignerSelectionList); +begin + UpdateContent; +end; + +procedure TfrmComponentCollectionEditor.SetSelection; +var + I: Integer; + List: {$IFDEF DELPHI6}IDesignerSelections{$ELSE}TDesignerSelectionList{$ENDIF}; +begin + if csAncestor in Component.ComponentState then + UpdateListBox; + if FSelectionError then Exit; + try + if ListView1.SelCount > 0 then + begin + {$IFDEF DELPHI6} + List := CreateSelectionList; + {$ELSE} + List := TDesignerSelectionList.Create; + try + {$ENDIF} + for I := 0 to ListView1.Items.Count - 1 do + if ListView1.Items[I].Selected then + List.Add(Collection.Items[I]); + Designer.SetSelections(List); + {$IFNDEF DELPHI6} + finally + List.Free; + end; + {$ENDIF} + end + else + Designer.SelectComponent(Collection); + except + FSelectionError := True; + Application.HandleException(ExceptObject); + Close; + end; +end; + +procedure TfrmComponentCollectionEditor.UpdateListbox; + + procedure FetchItems(List: TStrings); + var + I: Integer; + begin + if Collection <> nil then + for I := 0 to Collection.Count - 1 do + if CanAdd(I) then + List.AddObject(GetItemName(I), nil); + end; + + function ItemsEqual(ListItems: TListItems; Items: TStrings): Boolean; + var + I: Integer; + begin + Result := False; + if ListItems.Count <> Items.Count then Exit; + for I := 0 to ListItems.Count - 1 do + begin + if ListItems[I].Caption <> Items[I] then + Exit; + end; + Result := True; + end; + +var + I: Integer; + TmpItems: TStringList; +begin + if Collection = nil then Exit; + BeginUpdate; + try + TmpItems := TStringList.Create; + FetchItems(TmpItems); + try + if (TmpItems.Count = 0) or not ItemsEqual(ListView1.Items, TmpItems) then + begin + ListView1.Items.BeginUpdate; + try + ListView1.Items.Clear; + for I := 0 to TmpItems.Count - 1 do + with ListView1.Items.Add do + Caption := TmpItems[I]; + finally + ListView1.Items.EndUpdate; + end; + end; + finally + TmpItems.Free; + end; + finally + CancelUpdate; + end; +end; + +procedure TfrmComponentCollectionEditor.FormClose(Sender: TObject; + var Action: TCloseAction); +begin + if Component <> nil then + Designer.SelectComponent(Component); + with TRegIniFile.Create(GetRegKey) do + try + EraseSection(FCollectionClassName); + WriteInteger(FCollectionClassName, 'Left', Left); + WriteInteger(FCollectionClassName, 'Top', Top); + WriteInteger(FCollectionClassName, 'Width', Width); + WriteInteger(FCollectionClassName, 'Height', Height); + WriteBool(FCollectionClassName, 'TextLabels', acTextLabels.Checked); + WriteBool(FCollectionClassName, 'Toolbar', ToolBar1.Visible); + finally + Free; + end; + BeginUpdate; + inherited; +end; + +procedure TfrmComponentCollectionEditor.FormDestroy(Sender: TObject); +begin + if FAddedItemIDList <> nil then + FreeAndNil(FAddedItemIDList); + inherited; +end; + +procedure TfrmComponentCollectionEditor.FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if Key = VK_PROCESSKEY then + {$IFDEF DELPHI6} + ComponentDesigner.Environment.ModalEdit(#0,Self); + {$ELSE} + DelphiIDE.ModalEdit(#0, Self); + {$ENDIF} +end; + +procedure TfrmComponentCollectionEditor.FormKeyPress(Sender: TObject; var Key: Char); +begin + if Key = #13 then + {$IFDEF DELPHI6} + ComponentDesigner.Environment.ModalEdit(#0,Self); + {$ELSE} + DelphiIDE.ModalEdit(#0, Self); + {$ENDIF} +end; + +procedure TfrmComponentCollectionEditor.FormShow(Sender: TObject); + + procedure UpdateSizes; + begin + with TRegIniFile.Create(GetRegKey) do + try + Top := ReadInteger(FCollectionClassName, 'Top', 100); + Left := ReadInteger(FCollectionClassName, 'Left', 100); + Width := ReadInteger(FCollectionClassName, 'Width', Width); + Height := ReadInteger(FCollectionClassName, 'Height', Height); + ToolBar1.Visible := ReadBool(FCollectionClassName, 'Toolbar', True); + acTextLabels.Checked := ReadBool(FCollectionClassName, 'TextLabels', False); + finally + Free; + end; + end; + +{$IFNDEF DELPHI6} +var + ALeft: Integer; + ATop: Integer; +{$ENDIF} +begin + UpdateSizes; +{$IFNDEF DELPHI6} + ALeft := Left; + ATop := Top; + if Left + Width > Monitor.Left + Monitor.Width then + ALeft := Monitor.Left + Monitor.Width - Width; + if Left < Monitor.Left then + ALeft := Monitor.Left; + if Top + Height > Monitor.Top + Monitor.Height then + ATop := Monitor.Top + Monitor.Height - Height; + if Top < Monitor.Top then + ATop := Monitor.Top; + SetBounds(ALeft, ATop, Width, Height); +{$ELSE} + MakeFullyVisible; +{$ENDIF} +end; + +procedure TfrmComponentCollectionEditor.ListView1Change(Sender: TObject; + Item: TListItem; Change: TItemChange); +var + Msg: TMsg; +begin + if (Change = ctState) and (LockCount = 0) then + if not PeekMessage(Msg, Handle, AM_DeferUpdate, AM_DeferUpdate, PM_NOREMOVE) then + PostMessage(Handle, AM_DeferUpdate, 0, 0); +end; + +procedure TfrmComponentCollectionEditor.ListView1DragDrop(Sender, Source: TObject; X, + Y: Integer); +var + Item: TListItem; + I, J, InsPos: Integer; + L: TList; +begin + Item := ListView1.GetItemAt(X, Y); + if Item <> nil then + InsPos := Item.Index + else Exit; + L := TList.Create; + try + for I := 0 to ListView1.Items.Count - 1 do + if ListView1.Items[I].Selected then + L.Add(Collection.Items[I]); + + Collection.BeginUpdate; + try + for I := 0 to L.Count - 1 do + with TcxComponentCollectionItem(L[I]) do + begin + J := Index; + Index := InsPos; + if (J > InsPos) and (InsPos < Collection.Count) then + Inc(InsPos); + end; + finally + Collection.EndUpdate; + end; + finally + L.Free; + end; + GetSelection; +end; + +procedure TfrmComponentCollectionEditor.ListView1DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); +var + Item: TListItem; +begin + Item := ListView1.GetItemAt(X, Y); + Accept := (Item <> nil) and (Source = ListView1) and + (not Item.Selected); +end; + +procedure TfrmComponentCollectionEditor.ListView1KeyDown(Sender: TObject; var Key: word; + Shift: TShiftState); +begin + if Key = VK_PROCESSKEY then + {$IFDEF DELPHI6} + ComponentDesigner.Environment.ModalEdit(#0,Self); + {$ELSE} + DelphiIDE.ModalEdit(#0, Self); + {$ENDIF} +end; + +procedure TfrmComponentCollectionEditor.ListView1KeyPress(Sender: TObject; + var Key: Char); +begin + if Key in ['!'..'~'] then + begin + {$IFDEF DELPHI6} + ComponentDesigner.Environment.ModalEdit(Key,Self); + {$ELSE} + DelphiIDE.ModalEdit(Key, Self); + {$ENDIF} + Key := #0; + end; +end; + +procedure TfrmComponentCollectionEditor.SelectAllCommandUpdate(Sender: TObject); +begin + (Sender as TAction).Enabled := (ListView1.Items.Count > 0) and + (ListView1.SelCount <> ListView1.Items.Count); +end; + +procedure TfrmComponentCollectionEditor.AMDeferUpdate(var Msg); +begin + if LockCount = 0 then + begin + if TMessage(Msg).WParam = 0 then + SetSelection + else + ItemsModified(nil); + end + else + PostMessage(Handle, AM_DeferUpdate, TMessage(Msg).WParam, TMessage(Msg).LParam); +end; + +procedure TfrmComponentCollectionEditor.SelectionUpdate(Sender: TObject); +var + Enabled: Boolean; +begin + Enabled := ListView1.Selected <> nil; + if Enabled then + if Sender = acDelete then + Enabled := coDelete in Options + else + if (Sender = acMoveUp) or (Sender = acMoveDown) then + Enabled := coMove in Options; + (Sender as TAction).Enabled := Enabled; +end; + +procedure TfrmComponentCollectionEditor.SelectAll(DoUpdate: Boolean); +var + I: Integer; +begin + BeginUpdate; + ListView1.Items.BeginUpdate; + try + for I := 0 to Listview1.Items.Count-1 do + Listview1.Items[I].Selected := True; + finally + ListView1.Items.EndUpdate; + CancelUpdate; + if DoUpdate then SetSelection; + end; +end; + +procedure TfrmComponentCollectionEditor.SelectNone(DoUpdate: Boolean); +var + I: Integer; +begin + BeginUpdate; + ListView1.Items.BeginUpdate; + try + for I := 0 to Listview1.Items.Count-1 do + Listview1.Items[I].Selected := False; + finally + ListView1.Items.EndUpdate; + CancelUpdate; + if DoUpdate then SetSelection; + end; +end; + +procedure TfrmComponentCollectionEditor.UpdateCaption; +begin + Caption := Format('Editing %s%s%s', [Component.Name, DotSep, ComponentPropertyName]); +end; + +procedure TfrmComponentCollectionEditor.UpdateContent; +begin + UpdateListbox; + GetSelection; +end; + +procedure TfrmComponentCollectionEditor.Activated; +begin + inherited; + SetSelection; +end; + +function TfrmComponentCollectionEditor.CanAdd(Index: Integer): Boolean; +begin + Result := True; +end; + +procedure TfrmComponentCollectionEditor.InitFormEditor; +begin + FCollectionClassName := Collection.ClassName; + UpdateListbox; + inherited InitFormEditor; + Options := FColOptions; //refresh +end; + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxContainer.pas b/official/x.35/ExpressLibrary/Sources/cxContainer.pas new file mode 100644 index 00000000..2d068fb5 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxContainer.pas @@ -0,0 +1,6304 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressCommonLibrary } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCOMMONLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +{$DEFINE USETCXSCROLLBAR} + +unit cxContainer; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, + dxThemeManager, dxUxTheme, + Classes, Controls, Forms, Graphics, Menus, StdCtrls, SysUtils, cxClasses, + cxControls, cxGraphics, cxLookAndFeels, cxScrollBar, cxLookAndFeelPainters; + +const + CM_CLOSEPOPUPWINDOW = WM_DX + 25; + CM_SHOWPOPUPWINDOW = WM_DX + 26; + CM_SHORTREFRESHCONTAINER = WM_DX + 27; + CM_UPDATESCROLLBARS = WM_DX + 28; + CM_BUFFEREDPAINTONGLASS = WM_DX + 29; + + cxDefaultAutoCompleteDelay = 500; + + cxContainerMaxBorderWidth = 2; + cxContainerShadowWidth = 3; + + cxEmptyBrush: TBrushHandle = 0; + + cxContainerDefaultBorderExtent: TRect = ( + Left: cxContainerMaxBorderWidth; + Top: cxContainerMaxBorderWidth; + Right: cxContainerMaxBorderWidth; + Bottom: cxContainerMaxBorderWidth + ); + +type + TcxContainerBorderStyle = (cbsNone, cbsSingle, cbsThick, cbsFlat, cbs3D, + cbsUltraFlat, cbsOffice11); + TcxContainerHotState = (chsNoHotTrack, chsNormal, chsSelected); + TcxContainerStateItem = (csNormal, csActive, csDisabled, csHotTrack); + TcxContainerState = set of TcxContainerStateItem; + TcxMouseButton = (cxmbNone, cxmbLeft, cxmbRight, cxmbMiddle); + TcxNativeHandle = HWND; + + TcxContainerStyleValue = 0..SizeOf(Integer) * 8 - 1; + TcxContainerStyleValues = set of TcxContainerStyleValue; + +const + csvBorderColor = 0; + csvBorderStyle = 1; + csvColor = 2; + csvEdges = 3; + csvFont = 4; + csvHotTrack = 5; + csvShadow = 6; + csvTextColor = 7; + csvTextStyle = 8; + csvTransparentBorder = 9; + + cxContainerStyleValueCount = 10; + + cxContainerStyleValueNameA: array[0..cxContainerStyleValueCount - 1] of string = ( + 'BorderColor', + 'BorderStyle', + 'Color', + 'Edges', + 'Font', + 'HotTrack', + 'Shadow', + 'TextColor', + 'TextStyle', + 'TransparentBorder' + ); + +type + TcxContainer = class; + TcxContainerClass = class of TcxContainer; + + { TcxContainerViewInfo } + + TcxContainerViewInfo = class + private + FBackgroundColor: TColor; + protected + procedure DrawBorder(ACanvas: TcxCanvas; R: TRect); virtual; + function GetContainerBorderStyle: TcxContainerBorderStyle; virtual; + procedure InternalPaint(ACanvas: TcxCanvas); virtual; + procedure SetBackgroundColor(Value: TColor); virtual; + public + BorderColor: TColor; + BorderRect: TRect; + BorderStyle: TcxContainerBorderStyle; + BorderWidth: Integer; + Bounds: TRect; + ClientRect: TRect; + ContainerState: TcxContainerState; + Edges: TcxBorders; + HotState: TcxContainerHotState; + NativePart: Integer; + NativeState: Integer; + NativeStyle: Boolean; + Painter: TcxCustomLookAndFeelPainterClass; + Shadow: Boolean; + ThemedObjectType: TdxThemedObjectType; + property BackgroundColor: TColor read FBackgroundColor write SetBackgroundColor; + constructor Create; virtual; + procedure Assign(Source: TObject); virtual; + function GetUpdateRegion(AViewInfo: TcxContainerViewInfo): TcxRegion; virtual; + procedure Offset(DX, DY: Integer); virtual; + procedure Paint(ACanvas: TcxCanvas); virtual; + end; + + TcxContainerViewInfoClass = class of TcxContainerViewInfo; + + { TcxContainerStyle } + + TcxStyleController = class; + + TcxContainerStyleData = record + Color: TColor; + Font: TFont; + FontColor: TColor; + end; + + TcxContainerStyle = class(TcxInterfacedPersistent, IUnknown, IdxSkinSupport) + private + FBorderColor: TColor; + FBorderStyle: TcxContainerBorderStyle; + FEdges: TcxBorders; + FHotTrack: Boolean; + FShadow: Boolean; + FTransparentBorder: Boolean; + + FDirectAccessMode: Boolean; + FFontAssignedValueLockCount: Integer; + FIsDestroying: Boolean; + FLookAndFeel: TcxLookAndFeel; + FModified: Boolean; + FOwner: TPersistent; + FParentStyle: TcxContainerStyle; + FState: TcxContainerStateItem; + FTextStyle: TFontStyles; + FUpdateCount: Integer; + FVisibleFont: TFont; + FOnChanged: TNotifyEvent; + + function GetAssignedValues: TcxContainerStyleValues; + function GetBorderColor: TColor; + function GetBorderStyle: TcxContainerBorderStyle; + function GetEdges: TcxBorders; + function GetFont: TFont; + function GetHotTrack: Boolean; + function GetShadow: Boolean; + function GetTransparentBorder: Boolean; + + function InternalGetBorderColor(var BorderColor: TColor): Boolean; + function InternalGetBorderStyle(var BorderStyle: TcxContainerBorderStyle): Boolean; + function InternalGetEdges(var Edges: TcxBorders): Boolean; + function InternalGetFont(var Font: TFont): Boolean; + function InternalGetHotTrack(var HotTrack: Boolean): Boolean; + function InternalGetShadow(var Shadow: Boolean): Boolean; + function InternalGetTextColor(var TextColor: TColor): Boolean; + function InternalGetTextStyle(var TextStyle: TFontStyles): Boolean; + function InternalGetTransparentBorder(var TransparentBorder: Boolean): Boolean; + + function IsBorderColorStored: Boolean; + function IsBorderStyleStored: Boolean; + function IsColorStored: Boolean; + function IsEdgesStored: Boolean; + function IsFontStored: Boolean; + function IsHotTrackStored: Boolean; + function IsShadowStored: Boolean; + function IsStyleControllerStored: Boolean; + function IsTextColorStored: Boolean; + function IsTextStyleStored: Boolean; + function IsTransparentBorderStored: Boolean; + + procedure SetAssignedValues(Value: TcxContainerStyleValues); + procedure SetBorderColor(Value: TColor); + procedure SetBorderStyle(Value: TcxContainerBorderStyle); + procedure SetColor(Value: TColor); + procedure SetEdges(Value: TcxBorders); + procedure SetFont(Value: TFont); + procedure SetHotTrack(Value: Boolean); + procedure SetShadow(Value: Boolean); + procedure SetTextColor(Value: TColor); + procedure SetTextStyle(Value: TFontStyles); + procedure SetTransparentBorder(Value: Boolean); + + procedure CheckChanges; + procedure CreateFont; + function GetActiveStyleController: TcxStyleController; + function GetBaseStyle: TcxContainerStyle; + function GetContainer: TcxContainer; + function GetLookAndFeel: TcxLookAndFeel; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); + procedure ReadIsFontAssigned(Reader: TReader); + procedure RestoreFont(AFont: TFont); + procedure SetLookAndFeel(Value: TcxLookAndFeel); + procedure UpdateVisibleFont; + procedure WriteIsFontAssigned(Writer: TWriter); + protected + FAssignedValues: TcxContainerStyleValues; + FStyleController: TcxStyleController; + procedure DefineProperties(Filer: TFiler); override; + function BaseGetStyleController: TcxStyleController; + procedure BaseSetStyleController(Value: TcxStyleController); + procedure Changed; virtual; + procedure ControllerChangedNotification(AStyleController: TcxStyleController); virtual; + procedure ControllerFreeNotification(AStyleController: TcxStyleController); virtual; + + function DefaultBorderColor: TColor; virtual; + function DefaultBorderStyle: TcxContainerBorderStyle; virtual; + function DefaultColor: TColor; virtual; + function DefaultEdges: TcxBorders; virtual; + function DefaultHotTrack: Boolean; virtual; + function DefaultShadow: Boolean; virtual; + function DefaultTextColor: TColor; virtual; + function DefaultTextStyle: TFontStyles; virtual; + function DefaultTransparentBorder: Boolean; virtual; + + procedure FontChanged(Sender: TObject); virtual; + function GetColor: TColor; virtual; + function GetDefaultStyleController: TcxStyleController; virtual; + function GetStyleColor: TColor; virtual; + function GetTextColor: TColor; virtual; + function GetTextStyle: TFontStyles; virtual; + function InternalGetColor(var Color: TColor): Boolean; + function InternalGetNotPublishedExtendedStyleValues: TcxContainerStyleValues; virtual; + function IsBaseStyle: Boolean; + function IsDestroying: Boolean; + function IsFontAssignedValueLocked: Boolean; + procedure LockFontAssignedValue(ALock: Boolean); + procedure UpdateFont; + property ParentStyle: TcxContainerStyle read FParentStyle; + property OnChanged: TNotifyEvent read FOnChanged write FOnChanged; + public + StyleData: TcxContainerStyleData; + constructor Create(AOwner: TPersistent; ADirectAccessMode: Boolean; + AParentStyle: TcxContainerStyle = nil; + AState: TcxContainerStateItem = csNormal); reintroduce; virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure BeginUpdate; + procedure EndUpdate; + function GetStyleValue(const APropertyName: string; + out StyleValue: TcxContainerStyleValue): Boolean; + function GetStyleValueCount: Integer; virtual; + function GetStyleValueName(AStyleValue: TcxContainerStyleValue; + out StyleValueName: string): Boolean; virtual; + function GetVisibleFont: TFont; + function HasBorder: Boolean; virtual; + function IsExtendedStylePropertyPublished( + const APropertyName: string): Boolean; + function IsValueAssigned(AValue: TcxContainerStyleValue): Boolean; virtual; + procedure RestoreDefaults; virtual; + property ActiveStyleController: TcxStyleController read GetActiveStyleController; + property BaseStyle: TcxContainerStyle read GetBaseStyle; + property Container: TcxContainer read GetContainer; + property DirectAccessMode: Boolean read FDirectAccessMode; + property State: TcxContainerStateItem read FState; + published + property AssignedValues: TcxContainerStyleValues read GetAssignedValues + write SetAssignedValues stored False; + property BorderColor: TColor read GetBorderColor write SetBorderColor + stored IsBorderColorStored; + property BorderStyle: TcxContainerBorderStyle read GetBorderStyle + write SetBorderStyle stored IsBorderStyleStored; + property Color: TColor read GetColor write SetColor stored IsColorStored; + property Edges: TcxBorders read GetEdges write SetEdges stored IsEdgesStored; + property Font: TFont read GetFont write SetFont stored IsFontStored; + property HotTrack: Boolean read GetHotTrack write SetHotTrack stored IsHotTrackStored; + property LookAndFeel: TcxLookAndFeel read GetLookAndFeel + write SetLookAndFeel; + property Shadow: Boolean read GetShadow write SetShadow stored IsShadowStored; + property StyleController: TcxStyleController read BaseGetStyleController + write BaseSetStyleController stored IsStyleControllerStored; + property TextColor: TColor read GetTextColor write SetTextColor + stored IsTextColorStored; + property TextStyle: TFontStyles read GetTextStyle write SetTextStyle + stored IsTextStyleStored; + property TransparentBorder: Boolean read GetTransparentBorder + write SetTransparentBorder stored IsTransparentBorderStored; + end; + + TcxCustomContainerStyle = TcxContainerStyle; // TODO Remove + + TcxContainerStyleClass = class of TcxContainerStyle; + + { TcxContainerStyles } + + TcxContainerStyles = class + private + FStyles: array[TcxContainerStateItem] of TcxContainerStyle; + function GetStyle(AState: TcxContainerStateItem): TcxContainerStyle; + function GetStyleDisabled: TcxContainerStyle; + function GetStyleFocused: TcxContainerStyle; + function GetStyleHot: TcxContainerStyle; + function GetStyleNormal: TcxContainerStyle; + procedure SetOnChanged(Value: TNotifyEvent); + procedure SetStyle(AState: TcxContainerStateItem; Value: TcxContainerStyle); + procedure SetStyleDisabled(Value: TcxContainerStyle); + procedure SetStyleFocused(Value: TcxContainerStyle); + procedure SetStyleHot(Value: TcxContainerStyle); + procedure SetStyleNormal(Value: TcxContainerStyle); + public + constructor Create(AOwner: TPersistent; + AStyleClass: TcxContainerStyleClass); virtual; + destructor Destroy; override; + procedure RestoreDefaults; + property Style: TcxContainerStyle read GetStyleNormal write SetStyleNormal; + property StyleDisabled: TcxContainerStyle read GetStyleDisabled + write SetStyleDisabled; + property StyleFocused: TcxContainerStyle read GetStyleFocused + write SetStyleFocused; + property StyleHot: TcxContainerStyle read GetStyleHot + write SetStyleHot; + property Styles[AState: TcxContainerStateItem]: TcxContainerStyle + read GetStyle write SetStyle; default; + property OnChanged: TNotifyEvent write SetOnChanged; + end; + + TcxContainerStylesClass = class of TcxContainerStyles; + + { TcxStyleController } + + TcxStyleController = class(TComponent) + private + FIsDestruction: Boolean; + FIsFontScaled: Boolean; + FListeners: TList; + FOnStyleChanged: TNotifyEvent; + function GetFakeStyleController: TcxStyleController; + function GetStyle: TcxContainerStyle; + function GetInternalStyle(AState: TcxContainerStateItem): TcxContainerStyle; + procedure SetFakeStyleController(Value: TcxStyleController); + procedure SetInternalStyle(AState: TcxContainerStateItem; Value: TcxContainerStyle); + procedure StyleChanged(Sender: TObject); + protected + FStyles: TcxContainerStyles; + procedure Loaded; override; + procedure AddListener(AListener: TcxContainerStyle); virtual; + procedure Changed; + procedure ChangeFontScale(M, D: Integer); + function GetStyleClass: TcxContainerStyleClass; virtual; + function GetStylesClass: TcxContainerStylesClass; virtual; + function IsDestruction: Boolean; + procedure RemoveListener(AListener: TcxContainerStyle); virtual; + property Style: TcxContainerStyle read GetStyle; + property Listeners: TList read FListeners; + property OnStyleChanged: TNotifyEvent read FOnStyleChanged write FOnStyleChanged; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure RestoreStyles; + property Styles[AState: TcxContainerStateItem]: TcxContainerStyle + read GetInternalStyle write SetInternalStyle; + published + property FakeStyleController: TcxStyleController read GetFakeStyleController + write SetFakeStyleController stored False; + end; + + { IcxContainerInnerControl } + + IcxContainerInnerControl = interface + ['{1B111318-D9C9-4C35-9EFF-5D95793C0106}'] + function GetControl: TWinControl; + function GetControlContainer: TcxContainer; + property Control: TWinControl read GetControl; + property ControlContainer: TcxContainer read GetControlContainer; + end; + + TcxScrollBarInfo = TScrollBarInfo; + + { TcxContainer } + + TcxContainerActiveStyleData = record + ContainerState: TcxContainerState; + ActiveStyle: TcxContainerStyle; + end; + + TcxContainerInnerControlBounds = record + IsEmpty: Boolean; + Rect: TRect; + end; + + TcxContainerSizeGripData = record + Bounds: TRect; + Visible: Boolean; + end; + + TcxContainer = class(TcxControl, IUnknown, + IcxCompoundControl, IcxMouseTrackingCaller) + private + FActiveStyleData: TcxContainerActiveStyleData; + FInnerControl: TWinControl; + FInnerControlBounds: TcxContainerInnerControlBounds; + FInnerControlMouseDown: Boolean; + FInnerControlBufferedPaint: Boolean; + FSaveInnerControlWndProc: TWndMethod; + FIsDestroying: Boolean; + FIsRefreshLocked: Boolean; + FIsViewInfoCalculated: Boolean; + FLockAlignControlsCount: Integer; + FOnGlass: Boolean; + FRepaintOnGlass: Boolean; + FPopupMenuLockCount: Integer; + FRefreshingContainer: Boolean; + FScrollBarsCalculating: Boolean; + FSizeGripData: TcxContainerSizeGripData; + function GetActiveControl: TWinControl; + function GetFakeStyleController: TcxStyleController; + function GetInternalStyle(AState: TcxContainerStateItem): TcxContainerStyle; + function GetIsDestroying: Boolean; + function GetStyle: TcxContainerStyle; + function GetStyleDisabled: TcxContainerStyle; + function GetStyleFocused: TcxContainerStyle; + function GetStyleHot: TcxContainerStyle; + procedure SetFakeStyleController(Value: TcxStyleController); + procedure SetInnerControl(Value: TWinControl); + procedure SetStyle(Value: TcxContainerStyle); + procedure SetStyleDisabled(Value: TcxContainerStyle); + procedure SetStyleFocused(Value: TcxContainerStyle); + procedure SetStyleHot(Value: TcxContainerStyle); + procedure SetInternalStyle(AState: TcxContainerStateItem; + Value: TcxContainerStyle); + function GetDragKind: TDragKind; + procedure WMKillFocus(var Message: TWMKillFocus); message WM_KILLFOCUS; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure WMSetCursor(var Message: TWMSetCursor); message WM_SETCURSOR; + procedure WMSetFocus(var Message: TWMSetFocus); message WM_SETFOCUS; + procedure WMWindowPosChanged(var Message: TWMWindowPosChanged); + message WM_WINDOWPOSCHANGED; + procedure WMWindowPosChanging(var Message: TWMWindowPosChanging); + message WM_WINDOWPOSCHANGING; + procedure CMCtl3DChanged(var Message: TMessage); message CM_CTL3DCHANGED; + procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED; + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; + procedure CMParentColorChanged(var Message: TMessage); message CM_PARENTCOLORCHANGED; + procedure CMShortRefreshContainer(var Message: TMessage); message CM_SHORTREFRESHCONTAINER; + procedure CMParentFontChanged(var Message: TMessage); message CM_PARENTFONTCHANGED; + procedure CMSysColorChange(var Message: TMessage); message CM_SYSCOLORCHANGE; + procedure CMUpdateScrollBars(var Message: TMessage); message CM_UPDATESCROLLBARS; + protected + FInternalSetting: Boolean; + FIsCreating: Boolean; + FStyles: TcxContainerStyles; + FViewInfo: TcxContainerViewInfo; + + // IcxMouseTrackingCaller + procedure IcxMouseTrackingCaller.MouseLeave = MouseTrackingCallerMouseLeave; + procedure MouseTrackingCallerMouseLeave; + + // IcxLookAndFeelContainer + function GetLookAndFeelValue: TcxLookAndFeel; override; + + procedure AdjustClientRect(var Rect: TRect); override; + procedure AlignControls(AControl: TControl; var Rect: TRect); override; + function AllowAutoDragAndDropAtDesignTime(X, Y: Integer; + Shift: TShiftState): Boolean; override; + function CanFocusOnClick: Boolean; override; + procedure ChangeScale(M, D: Integer); override; + procedure ColorChanged; override; + procedure CursorChanged; override; + procedure DoContextPopup(MousePos: TPoint; + var Handled: Boolean); override; + procedure DragCanceled; override; + procedure FocusChanged; override; + function FocusWhenChildIsClicked(AChild: TControl): Boolean; override; + function GetClientBounds: TRect; override; + function IsContainerFocused: Boolean; virtual; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure Loaded; override; + function MayFocus: Boolean; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseEnter(AControl: TControl); override; + procedure MouseLeave(AControl: TControl); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + function NeedsScrollBars: Boolean; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure Paint; override; + procedure Resize; override; + procedure SetDragMode(Value: TDragMode); override; + procedure CreateHandle; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWindowHandle(const Params: TCreateParams); override; + procedure WndProc(var Message: TMessage); override; + procedure AdjustInnerControl; virtual; + procedure CalculateViewInfo(const P: TPoint; AMouseTracking: Boolean); virtual; + function CanContainerHandleTabs: Boolean; virtual; + function CanHaveTransparentBorder: Boolean; virtual; + function CanShowPopupMenu(const P: TPoint): Boolean; virtual; + procedure CheckIsViewInfoCalculated; + procedure ContainerStyleChanged(Sender: TObject); virtual; + procedure DataChange; virtual; + procedure DataSetChange; virtual; + function DefaultParentColor: Boolean; virtual; + procedure EnabledChanged; dynamic; + procedure EndMouseTracking; virtual; + function GetActiveStyle: TcxContainerStyle; virtual; + function GetBorderExtent: TRect; virtual; + function GetInnerControlBounds(const AInnerControlsRegion: TRect; + AInnerControl: TControl): TcxContainerInnerControlBounds; virtual; + function GetShadowBounds: TRect; virtual; + function GetStyleClass: TcxContainerStyleClass; virtual; + function GetStylesClass: TcxContainerStylesClass; virtual; + function GetViewInfoClass: TcxContainerViewInfoClass; virtual; + function HasShadow: Boolean; virtual; + procedure InnerControlWndProc(var Message: TMessage); virtual; + function InternalGetActiveStyle: TcxContainerStyle; virtual; + function InternalGetNotPublishedStyleValues: TcxContainerStyleValues; virtual; + function IsAlignControlsLocked: Boolean; + function IsInnerControlBoundsChanged(AControl: TWinControl; + const ABounds: TcxContainerInnerControlBounds): Boolean; + function IsContainerClass: Boolean; virtual; + function IsPopupMenuLocked: Boolean; + function IsReadOnly: Boolean; virtual; + function IsTransparentBackground: Boolean; virtual; + function RefreshContainer(const P: TPoint; Button: TcxMouseButton; Shift: TShiftState; + AIsMouseEvent: Boolean): Boolean; virtual; + procedure SaveInnerControlBounds(AControl: TWinControl; + const ABounds: TcxContainerInnerControlBounds); + procedure SetShadowRegion; virtual; + procedure SetSize; virtual; + procedure SetVisibleBoundsClipRect; virtual; + procedure UpdateData; virtual; + procedure AdjustScrollBarPosition(AScrollBar: TcxScrollBar); virtual; + function GetBackgroundThemedObjectType: TdxThemedObjectType; virtual; + function GetBackgroundNativePart: Integer; virtual; + function GetBackgroundNativeState: Integer; virtual; + function GetScrollBarBounds(const AScrollBarRect: TRect): TRect; virtual; + function GetScrollBarEnabled(AScrollBar: TcxScrollBar; + const AScrollBarinfo: TcxScrollBarInfo): Boolean; virtual; + function GetScrollBarInfo(var AScrollBarInfo: TcxScrollBarInfo; + const AKind: TScrollBarKind): Boolean; virtual; + function IsAdjustingScrollBarPositionNeeded( + const AScrollBarInfo: TcxScrollBarInfo): Boolean; virtual; + function IsNativeStyle: Boolean; virtual; + procedure SafeSelectionFocusInnerControl; virtual; + procedure SetDragKind(Value: TDragKind); virtual; + procedure SetScrollBarVisible(AScrollBar: TcxScrollBar; + AVisible: Boolean); virtual; + property ActiveStyle: TcxContainerStyle read GetActiveStyle; + property DragKind: TDragKind read GetDragKind write SetDragKind default dkDrag; + property IsViewInfoCalculated: Boolean read FIsViewInfoCalculated + write FIsViewInfoCalculated; + property ScrollBarsCalculating: Boolean read FScrollBarsCalculating; + property Style: TcxContainerStyle read GetStyle write SetStyle; + property StyleDisabled: TcxContainerStyle read GetStyleDisabled + write SetStyleDisabled; + property StyleFocused: TcxContainerStyle read GetStyleFocused + write SetStyleFocused; + property StyleHot: TcxContainerStyle read GetStyleHot write SetStyleHot; + property ViewInfo: TcxContainerViewInfo read FViewInfo; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function Focused: Boolean; override; + function GetDragImages: TDragImageList; override; + procedure GetTabOrderList(List: TList); override; + procedure SetFocus; override; + procedure ClearSavedChildControlRegions; virtual; + function GetVisibleBounds: TRect; virtual; + function HasPopupWindow: Boolean; virtual; + function InnerControlDefaultHandler(var Message: TMessage): Boolean; virtual; + function InnerControlMenuHandler(var Message: TMessage): Boolean; virtual; + procedure Invalidate; override; + function IsInplace: Boolean; virtual; + function IsStylePropertyPublished(const APropertyName: string; + AExtendedStyle: Boolean): Boolean; + procedure LockAlignControls(ALock: Boolean); + procedure LockPopupMenu(ALock: Boolean); + procedure RestoreStyles; + procedure SetScrollBarsParameters(AIsScrolling: Boolean = False); virtual; + function ShortRefreshContainer(AIsMouseEvent: Boolean): Boolean; + procedure Update; override; + procedure UpdateScrollBarsParameters; + property InnerControl: TWinControl read FInnerControl write SetInnerControl; + property InnerControlMouseDown: Boolean read FInnerControlMouseDown + write FInnerControlMouseDown; + property IsDestroying: Boolean read GetIsDestroying; + property OnGlass: Boolean read FOnGlass write FOnGlass; + property ParentColor; + property ParentFont; + property Styles[AState: TcxContainerStateItem]: TcxContainerStyle + read GetInternalStyle write SetInternalStyle; + property VisibleBounds: TRect read GetVisibleBounds; + published + property FakeStyleController: TcxStyleController read GetFakeStyleController + write SetFakeStyleController stored False; + property TabStop default True; + end; + + { TcxCustomPopupWindow } + + TcxCustomPopupWindow = class(TcxPopupWindow) + private + FCaptureFocus: Boolean; + FDeactivateLockCount: Integer; + FDeactivation: Boolean; + FFocusedControl: TWinControl; + FIsTopMost: Boolean; + FJustClosed: Boolean; + FModalMode: Boolean; + FTerminateOnDestroy: Boolean; + FOwnerControl: TWinControl; + FOnClosed: TNotifyEvent; + FOnClosing: TNotifyEvent; + FOnShowed: TNotifyEvent; + FOnShowing: TNotifyEvent; + function GetJustClosed: Boolean; + procedure SetCaptureFocus(Value: Boolean); + procedure SetIsTopMost(Value: Boolean); + procedure WMActivateApp(var Message: TWMActivateApp); message WM_ACTIVATEAPP; + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND; + procedure CMClosePopupWindow(var Message: TMessage); message CM_CLOSEPOPUPWINDOW; + procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure CMShowPopupWindow(var Message: TMessage); message CM_SHOWPOPUPWINDOW; + protected + FStyle: TcxContainerStyle; + FViewInfo: TcxContainerViewInfo; + procedure AdjustClientRect(var Rect: TRect); override; + procedure Deactivate; override; + function GetOwnerScreenBounds: TRect; override; + procedure InitPopup; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure Paint; override; + procedure VisibleChanged; override; + procedure CreateHandle; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + function AcceptsAnySize: Boolean; virtual; + procedure DoClosed; virtual; + procedure DoClosing; virtual; + procedure DoShowed; virtual; + procedure DoShowing; virtual; + function GetFirstFocusControl(AControl: TWinControl): TWinControl; + function HasBackground: Boolean; virtual; + function IsDeactivateLocked: Boolean; + function IsOwnerControlVisible: Boolean; + function IsSysKeyAccepted(Key: Word): Boolean; virtual; + procedure ModalCloseUp; virtual; + procedure MouseEnter(AControl: TControl); dynamic; + procedure MouseLeave(AControl: TControl); dynamic; + function NeedIgnoreMouseMessageAfterCloseUp(AWnd: THandle; AMsg: Cardinal; + AShift: TShiftState; const APos: TPoint): Boolean; virtual; + procedure PopupWindowStyleChanged(Sender: TObject); virtual; + procedure RecreateWindow; + property Style: TcxContainerStyle read FStyle; + property ViewInfo: TcxContainerViewInfo read FViewInfo; + public + constructor Create(AOwnerControl: TWinControl); reintroduce; virtual; + destructor Destroy; override; + function Focused: Boolean; override; +{$IFDEF DELPHI5} + function CanFocus: Boolean; override; +{$ENDIF} + procedure ClosePopup; + procedure CloseUp; override; + procedure CorrectBoundsWithDesktopWorkArea(var APosition: TPoint); virtual; + function GetStyleClass: TcxContainerStyleClass; virtual; + function GetViewInfoClass: TcxContainerViewInfoClass; virtual; + function HasCapture: Boolean; + function IsShortCut(var Message: TWMKey): Boolean; override; + function IsVisible: Boolean; + procedure LockDeactivate(ALock: Boolean); + procedure Popup(AFocusedControl: TWinControl); reintroduce; virtual; + function SetFocusedControl(Control: TWinControl): Boolean; override; + property CaptureFocus: Boolean read FCaptureFocus write SetCaptureFocus default True; + property FocusedControl: TWinControl read FFocusedControl write FFocusedControl; + property IsTopMost: Boolean read FIsTopMost write SetIsTopMost; + property JustClosed: Boolean read GetJustClosed; + property ModalMode: Boolean read FModalMode write FModalMode default True; + property OwnerControl: TWinControl read FOwnerControl; + property TerminateOnDestroy: Boolean read FTerminateOnDestroy write FTerminateOnDestroy; + property OnClosed: TNotifyEvent read FOnClosed write FOnClosed; + property OnClosing: TNotifyEvent read FOnClosing write FOnClosing; + property OnCloseQuery; + property OnShowed: TNotifyEvent read FOnShowed write FOnShowed; + property OnShowing: TNotifyEvent read FOnShowing write FOnShowing; + end; + + { TcxCustomInnerListBox } + + TcxCustomInnerListBox = class(TListBox, IUnknown, + IcxContainerInnerControl) + private + {$IFNDEF DELPHI6} + FAutoComplete: Boolean; + {$ENDIF} + {$IFNDEF DELPHI8} + FAutoCompleteDelay: Cardinal; + {$ENDIF} + FAutoCompleteFilter: string; + FCanvas: TcxCanvas; + FHScrollBar: TcxScrollBar; + FIsRedrawLocked: Boolean; + FLookAndFeel: TcxLookAndFeel; + FPrevBrushColor: TColor; + FPrevFontColor: TColor; + FPrevKeyPressTime: DWORD; + FScrollBarsCalculating: Boolean; + FScrollBarsLockCount: Integer; + FVScrollBar: TcxScrollBar; + procedure CreateScrollBars; + function FindAutoCompleteString(const S: string): Integer; + function GetControlContainer: TcxContainer; + function GetControl: TWinControl; + procedure HScrollHandler(Sender: TObject; ScrollCode: TScrollCode; + var ScrollPos: Integer); + procedure SetLookAndFeel(Value: TcxLookAndFeel); + procedure VScrollHandler(Sender: TObject; ScrollCode: TScrollCode; + var ScrollPos: Integer); +{$IFNDEF DELPHI6} + function GetScrollWidth: Integer; + procedure SetScrollWidth(const Value: Integer); +{$ENDIF} + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + procedure WMKillFocus(var Message: TWMKillFocus); message WM_KILLFOCUS; + procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure WMPrint(var Message: TWMPrint); message WM_PRINT; + procedure WMPrintClient(var Message: TWMPrintClient); message WM_PRINTCLIENT; + procedure WMSetFocus(var Message: TWMSetFocus); message WM_SETFOCUS; + procedure WMSetRedraw(var Message: TWMSetRedraw); message WM_SETREDRAW; + procedure WMWindowPosChanged(var Message: TWMWindowPosChanged); message WM_WINDOWPOSCHANGED; + procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure CNDrawItem(var Message: TWMDrawItem); message CN_DRAWITEM; + protected + FContainer: TcxContainer; + procedure Click; override; + procedure DblClick; override; + procedure DestroyWindowHandle; override; + procedure DoAutoComplete(var Key: Char); virtual; + function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); override; + function GetPopupMenu: TPopupMenu; override; + function GetSizeGripRect: TRect; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); virtual; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseEnter(AControl: TControl); dynamic; + procedure MouseLeave(AControl: TControl); dynamic; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure DrawSizeGrip(ADC: HDC); + function NeedDrawFocusRect: Boolean; virtual; + procedure Notification(AComponent: TComponent; + Operation: TOperation); override; + procedure RestoreCanvasParametersForFocusRect; + procedure SaveCanvasParametersForFocusRect; + procedure WndProc(var Message: TMessage); override; + property Container: TcxContainer read FContainer write FContainer; + property IsRedrawLocked: Boolean read FIsRedrawLocked; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure DefaultHandler(var Message); override; + procedure DragDrop(Source: TObject; X, Y: Integer); override; + procedure SetExternalScrollBarsParameters; virtual; +{$IFNDEF DELPHI6} + procedure AddItem(AItem: string; AObject: TObject); + procedure ClearSelection; + procedure DeleteSelected; + procedure SelectAll; +{$ENDIF} + function ItemVisible(Index: Integer): Boolean; + property Canvas: TcxCanvas read FCanvas; + property HScrollBar: TcxScrollBar read FHScrollBar; + property LookAndFeel: TcxLookAndFeel read FLookAndFeel write SetLookAndFeel; + property VScrollBar: TcxScrollBar read FVScrollBar; +{$IFNDEF DELPHI6} + property ScrollWidth: Integer read GetScrollWidth write SetScrollWidth default 0; +{$ENDIF} + published + {$IFNDEF DELPHI6} + property AutoComplete: Boolean read FAutoComplete write FAutoComplete default True; + {$ENDIF} + {$IFNDEF DELPHI8} + property AutoCompleteDelay: Cardinal read FAutoCompleteDelay + write FAutoCompleteDelay default cxDefaultAutoCompleteDelay; + {$ENDIF} + end; + + TcxCustomListBox = TcxCustomInnerListBox; // TODO Remove + + { _TWinControlAccess } + + _TWinControlAccess = class + public + class procedure _RecreateWnd(AInstance: TWinControl); + end; + + { _TcxContainerAccess } + + _TcxContainerAccess = class + public + class procedure BeginAutoDrag(AInstance: TcxContainer); + class procedure Click(AInstance: TcxContainer); + class procedure DblClick(AInstance: TcxContainer); + class function DoMouseWheel(AInstance: TcxContainer; Shift: TShiftState; + WheelDelta: Integer; MousePos: TPoint): Boolean; + class procedure DragOver(AInstance: TcxContainer; Source: TObject; + X, Y: Integer; State: TDragState; var Accept: Boolean); + class procedure KeyDown(AInstance: TcxContainer; var Key: Word; + Shift: TShiftState); + class procedure KeyPress(AInstance: TcxContainer; var Key: Char); + class procedure KeyUp(AInstance: TcxContainer; var Key: Word; + Shift: TShiftState); + class procedure MouseDown(AInstance: TcxContainer; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + class procedure MouseMove(AInstance: TcxContainer; Shift: TShiftState; + X, Y: Integer); + class procedure MouseUp(AInstance: TcxContainer; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + end; + +procedure AssignFonts(AFont1, AFont2: TFont); +function ButtonTocxButton(Button: TMouseButton): TcxMouseButton; +function CanShowHint(AControl: TWinControl): Boolean; +function CheckParentsNativeHandle(AControl: TWinControl; + ANativeHandle: TcxNativeHandle): Boolean; +function cxGetScrollBarInfo(hwnd: HWND; idObject: Longint; + var psbi: TcxScrollBarInfo): BOOL; +function DefaultContainerStyleController: TcxStyleController; +procedure DrawContainerShadow(ACanvas: TcxCanvas; const ARect: TRect); +procedure ExtendRectByBorders(var R: TRect; ABorderWidth: Integer; AEdges: TcxBorders); +function FindFirstNonChildParentWindow(AWnd: HWND): HWND; +function GetContainerBorderWidth(ABorderStyle: TcxContainerBorderStyle): Integer; overload; +function GetContainerBorderWidth(ALookAndFeelKind: TcxLookAndFeelKind): Integer; overload; +function GetControlRect(AControl: TControl): TRect; +function GetcxContainer(AControl: TWinControl): TcxContainer; +function GetPopupOwnerControl(AWnd: HWND): HWND; +function HasHandle(AControl: TWinControl; AHandle: TcxHandle): Boolean; +function HasNativeHandle(AControl: TWinControl; + ANativeHandle: TcxNativeHandle; ACheckChildren: Boolean = False): Boolean; +function HasOpenedPopupWindow(AControl: TWinControl): Boolean; +procedure InflateRectByBorders(var R: TRect; ABorderWidth: Integer; + AEdges: TcxBorders); +function InternalCompareString(const S1, S2: TCaption; + ACaseSensitive: Boolean): Boolean; +function InternalGetCursorPos: TPoint; +function InternalGetShiftState: TShiftState; +procedure InternalInvalidate(AHandle: TcxHandle; const AOuterRect, AInternalRect: TRect; + AEraseBackground: Boolean = False); +procedure InternalInvalidateRect(AControl: TWinControl; const R: TRect; + AEraseBackground: Boolean); +function InternalIsWindowVisible(AControl: TWinControl): Boolean; +function IsChildWindow(AParent: TWinControl; AChildHandle: TcxNativeHandle): Boolean; +function KillMessages(AWnd: HWND; AMsgFilterMin, AMsgFilterMax: UINT; + AKillAllMessages: Boolean = True): Boolean; +procedure LockCMActivateMessages(ALock: Boolean); +function MouseButtonToShift(Button: TMouseButton): TShiftState; +function NativeHandle(Handle: TcxHandle): TcxNativeHandle; +procedure SetWindowRegion(AControl: TWinControl; + const ABounds: TcxContainerInnerControlBounds); +procedure SetWindowShadowRegion(AWindowHandle: TcxHandle; const R: TRect; + ANativeStyle, AShadow: Boolean; const AExcludeRect: TRect); +function UsecxScrollBars: Boolean; +function AreVisualStylesMustBeUsed(ANativeStyle: Boolean; AThemedObjectType: + TdxThemedObjectType): Boolean; +function GetSizeGripRect(AControl: IcxContainerInnerControl): TRect; +procedure SetHooksSettingMode(ASetHooksOnlyWhenPopupsAreVisible: Boolean); + +procedure DisableWindow(AWindowList: TList; AWnd: HWND); +procedure EnableWindows(AWindowList: TList); + +procedure DisableAppWindows(ANeedDisable: Boolean = True); +procedure EnableAppWindows; +function IsInternalWindowsDisabled: Boolean; +function IsInternalWindowsDisabling: Boolean; + +//vista extension +procedure DrawWindowOnGlass(ADC: HDC; const ABounds: TRect; AWnd: HWND); +procedure RepaintWindowOnGlass(AWnd: HWND); +procedure WMPaintWindowOnGlass(AWnd: HWND); + +var + cxContainerDefaultStyleController: TcxStyleController; + cxContainerShadowColor: TColor = clBtnShadow; + TopMostComboBoxes: Boolean = True; + +implementation + +uses + dxThemeConsts, dxOffice11, cxDWMApi; + +const + cxContainerBorderWidthA1: array [TcxContainerBorderStyle] of Integer = + (0, 1, 2, 2, 2, 1, 1); + cxContainerBorderWidthA2: array [TcxLookAndFeelKind] of Integer = + (2, 2, 1, 1); + +type + TCanvasAccess = class(TCanvas); + TCustomFormAccess = class(TCustomForm); + TWinControlAccess = class(TWinControl); + + TGetScrollBarInfo = function(hwnd: HWND; idObject: Longint; + var psbi: TScrollBarInfo): BOOL; stdcall; + +var + FBeingShownPopupWindow: TcxPopupWindow; + FCMActivateMessagesLockCount: Integer = 0; + FPopupWindowShowing: Boolean = False; + FShiftState: TShiftState; + FUsecxScrollBars: Boolean; + FVisiblePopupWindowList: TList; + FApplicationCallWndProcHook: HHOOK = 0; + FApplicationGetMessageMsgHook: HHOOK = 0; + FApplicationMouseMsgHook: HHOOK = 0; + FCaptionInactivationLocked: Boolean; + FOldWndProc: Pointer; + FSetHooksOnlyWhenPopupsAreVisible: Boolean; + GetScrollBarInfoProc: TGetScrollBarInfo = nil; + +procedure RemoveHooks; forward; +procedure SetHooks; forward; + +procedure RegisterVisiblePopupWindow(AWindow: TcxCustomPopupWindow); +begin + // Requires + Assert((AWindow <> nil) and (FVisiblePopupWindowList.IndexOf(AWindow) = -1)); + // + FVisiblePopupWindowList.Add(AWindow); + if FSetHooksOnlyWhenPopupsAreVisible and (FVisiblePopupWindowList.Count = 1) then + SetHooks; +end; + +procedure UnregisterVisiblePopupWindow(AWindow: TcxCustomPopupWindow); +begin + // Requires + Assert((AWindow <> nil) and (FVisiblePopupWindowList.IndexOf(AWindow) <> -1)); + // + FVisiblePopupWindowList.Remove(AWindow); + if FSetHooksOnlyWhenPopupsAreVisible and (FVisiblePopupWindowList.Count = 0) then + RemoveHooks; +end; + +{ _TWinControlAccess } + +class procedure _TWinControlAccess._RecreateWnd(AInstance: TWinControl); +begin + TWinControlAccess(AInstance).RecreateWnd; +end; + +{ _TcxContainerAccess } + +class procedure _TcxContainerAccess.BeginAutoDrag(AInstance: TcxContainer); +begin + AInstance.BeginAutoDrag; +end; + +class procedure _TcxContainerAccess.Click(AInstance: TcxContainer); +begin + AInstance.Click; +end; + +class procedure _TcxContainerAccess.DblClick(AInstance: TcxContainer); +begin + AInstance.DblClick; +end; + +class function _TcxContainerAccess.DoMouseWheel(AInstance: TcxContainer; + Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; +begin + Result := AInstance.DoMouseWheel(Shift, WheelDelta, MousePos); +end; + +class procedure _TcxContainerAccess.DragOver(AInstance: TcxContainer; + Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); +begin + AInstance.DragOver(Source, X, Y, State, Accept); +end; + +class procedure _TcxContainerAccess.KeyDown(AInstance: TcxContainer; + var Key: Word; Shift: TShiftState); +begin + AInstance.KeyDown(Key, Shift); +end; + +class procedure _TcxContainerAccess.KeyPress(AInstance: TcxContainer; + var Key: Char); +begin + AInstance.KeyPress(Key); +end; + +class procedure _TcxContainerAccess.KeyUp(AInstance: TcxContainer; var Key: Word; + Shift: TShiftState); +begin + AInstance.KeyUp(Key, Shift); +end; + +class procedure _TcxContainerAccess.MouseDown(AInstance: TcxContainer; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + AInstance.MouseDown(Button, Shift, X, Y); +end; + +class procedure _TcxContainerAccess.MouseMove(AInstance: TcxContainer; + Shift: TShiftState; X, Y: Integer); +begin + AInstance.MouseMove(Shift, X, Y); +end; + +class procedure _TcxContainerAccess.MouseUp(AInstance: TcxContainer; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + AInstance.MouseUp(Button, Shift, X, Y); +end; + +procedure AssignFonts(AFont1, AFont2: TFont); +begin +{$IFDEF DELPHI9} +{$ENDIF} + AFont1.Assign(AFont2); +end; + +function ButtonTocxButton(Button: TMouseButton): TcxMouseButton; +const + AButtonMap: array[TMouseButton] of TcxMouseButton = (cxmbLeft, cxmbRight, cxmbMiddle); +begin + Result := AButtonMap[Button]; +end; + +function CanShowHint(AControl: TWinControl): Boolean; + + function GetForm(AWnd: HWND; out AForm: TCustomForm; + out AFormStyle: TFormStyle): Boolean; + var + AControl: TWinControl; + begin + AControl := FindControl(AWnd); + Result := AControl is TCustomForm; + if Result then + begin + AForm := TCustomForm(AControl); + AFormStyle := TCustomFormAccess(AForm).FormStyle; + end; + end; + + function GetRootParent(AWnd: HWND): HWND; + var + AFormStyle: TFormStyle; + AParentForm: TCustomForm; + begin + repeat + Result := GetParent(AWnd); + if Result = 0 then + Break; + AWnd := Result; + if GetForm(AWnd, AParentForm, AFormStyle) and + (AFormStyle = fsMDIChild) then + Break; + until False; + Result := AWnd; + end; + +var + AForm: TCustomForm; + AFormStyle: TFormStyle; + ARootParent: HWND; +begin + Result := Application.Active and AControl.HandleAllocated and + IsWindowVisible(AControl.Handle) and + (FindVCLWindow(GetMouseCursorPos) = AControl); + if Result then + begin + ARootParent := GetRootParent(AControl.Handle); + Result := not GetForm(ARootParent, AForm, AFormStyle) or + AForm.Active or (AFormStyle = fsMDIForm) or (FVisiblePopupWindowList.Count > 0) and + IsChild(ARootParent, TcxCustomPopupWindow(FVisiblePopupWindowList[0]).OwnerControl.Handle); + end; +end; + +function CheckParentsNativeHandle(AControl: TWinControl; + ANativeHandle: TcxNativeHandle): Boolean; +var + AParentForm: TCustomForm; + AParentHandle, AParentHandle1: HWND; +begin + Result := False; + if AControl = nil then + Exit; + AParentForm := GetParentForm(AControl); + if AParentForm = nil then + Exit; + Result := HasNativeHandle(AParentForm, ANativeHandle, True); + if not Result and (AParentForm.Parent = nil) then + begin + AParentHandle := AParentForm.Handle; + repeat + AParentHandle1 := GetParent(AParentHandle); + if (AParentHandle1 = 0) or not IsChild(AParentHandle1, AParentHandle) then + Break; + AParentHandle := AParentHandle1; + until False; + if AParentHandle <> AParentForm.Handle then + Result := (AParentHandle = ANativeHandle) or IsChild(AParentHandle, ANativeHandle); + end; +end; + +function cxGetScrollBarInfo(hwnd: HWND; idObject: Longint; + var psbi: TcxScrollBarInfo): BOOL; +begin + psbi.cbSize := SizeOf(psbi); + Result := GetScrollBarInfoProc(hwnd, idObject, psbi); +end; + +function DefaultContainerStyleController: TcxStyleController; +begin + Result := cxContainerDefaultStyleController; +end; + +procedure DrawContainerShadow(ACanvas: TcxCanvas; const ARect: TRect); +var + R: TRect; +begin + with ACanvas do + begin + Brush.Color := cxContainerShadowColor; + with R do + begin + Left := ARect.Left + cxContainerShadowWidth; + Top := ARect.Bottom; + Right := ARect.Right; + Bottom := Top + cxContainerShadowWidth; + FillRect(R); + ExcludeClipRect(R); + + Left := ARect.Right; + Top := ARect.Top + cxContainerShadowWidth; + Right := Left + cxContainerShadowWidth; + Bottom := ARect.Bottom + cxContainerShadowWidth; + FillRect(R); + ExcludeClipRect(R); + end; + end; +end; + +procedure ExtendRectByBorders(var R: TRect; ABorderWidth: Integer; AEdges: TcxBorders); +begin + if bLeft in AEdges then + Dec(R.Left, ABorderWidth); + if bTop in AEdges then + Dec(R.Top, ABorderWidth); + if bRight in AEdges then + Inc(R.Right, ABorderWidth); + if bBottom in AEdges then + Inc(R.Bottom, ABorderWidth); +end; + +function FindFirstNonChildParentWindow(AWnd: HWND): HWND; +begin + Result := 0; + while (AWnd <> 0) and (Result = 0) do + begin + if (GetWindowLong(AWnd, GWL_STYLE) and WS_CHILD) = 0 then + Result := AWnd; + AWnd := GetParent(AWnd); + end; +end; + +function GetContainerBorderWidth(ABorderStyle: TcxContainerBorderStyle): Integer; +begin + Result := cxContainerBorderWidthA1[ABorderStyle]; +end; + +function GetContainerBorderWidth(ALookAndFeelKind: TcxLookAndFeelKind): Integer; +begin + Result := cxContainerBorderWidthA2[ALookAndFeelKind]; +end; + +function GetControlRect(AControl: TControl): TRect; +begin + Result := Rect(0, 0, AControl.Width, AControl.Height); +end; + +function GetcxContainer(AControl: TWinControl): TcxContainer; +var + AIContainerInnerControl: IcxContainerInnerControl; +begin + Result := nil; + if AControl is TcxContainer then + Result := TcxContainer(AControl) + else + if (AControl <> nil) and Supports(AControl, IcxContainerInnerControl, AIContainerInnerControl) then + Result := AIContainerInnerControl.ControlContainer; +end; + +function GetWindowShadowRegion(AWindowHandle: TcxHandle; + R: TRect; ANativeStyle, AShadow: Boolean; + const AExcludeRect: TRect): TcxRegionHandle; +var + ATempRegion: TcxRegionHandle; +begin + if ANativeStyle then + Result := 0 + else + begin + Result := CreateRectRgnIndirect(R); + if AShadow then + begin + OffsetRect(R, cxContainerShadowWidth, cxContainerShadowWidth); + ATempRegion := CreateRectRgnIndirect(R); + CombineRgn(Result, Result, ATempRegion, RGN_OR); + DeleteObject(ATempRegion); + end; + if not IsRectEmpty(AExcludeRect) then + begin + ATempRegion := CreateRectRgnIndirect(AExcludeRect); + CombineRgn(Result, Result, ATempRegion, RGN_DIFF); + DeleteObject(ATempRegion); + end; + end; +end; + +function GetPopupOwnerControl(AWnd: HWND): HWND; +var + AControl: TWinControl; +begin + Result := AWnd; + while AWnd <> 0 do + begin + AControl := FindControl(AWnd); + if AControl is TcxCustomPopupWindow then + begin + if TcxCustomPopupWindow(AControl).OwnerControl.HandleAllocated then + Result := TcxCustomPopupWindow(AControl).OwnerControl.Handle; + Break; + end; + AWnd := GetParent(AWnd); + end; +end; + +function HasHandle(AControl: TWinControl; AHandle: TcxHandle): Boolean; +begin + Result := HasNativeHandle(AControl, NativeHandle(AHandle)); +end; + +function HasNativeHandle(AControl: TWinControl; ANativeHandle: TcxNativeHandle; + ACheckChildren: Boolean = False): Boolean; +begin + Result := (AControl <> nil) and ((AControl.Handle = ANativeHandle) or + ACheckChildren and IsChildWindow(AControl, ANativeHandle)); +end; + +function HasOpenedPopupWindow(AControl: TWinControl): Boolean; +var + AContainer: TcxContainer; +begin + AContainer := GetcxContainer(AControl); + Result := (AContainer <> nil) and AContainer.HasPopupWindow; +end; + +procedure InflateRectByBorders(var R: TRect; ABorderWidth: Integer; + AEdges: TcxBorders); +begin + if not(bLeft in AEdges) then + Inc(R.Left, ABorderWidth); + if not(bTop in AEdges) then + Inc(R.Top, ABorderWidth); + if not(bRight in AEdges) then + Dec(R.Right, ABorderWidth); + if not(bBottom in AEdges) then + Dec(R.Bottom, ABorderWidth); +end; + +function InternalCompareString(const S1, S2: TCaption; ACaseSensitive: Boolean): Boolean; +begin + if ACaseSensitive then + Result := AnsiCompareStr(S1, S2) = 0 + else + Result := AnsiUpperCase(S1) = AnsiUpperCase(S2); +end; + +procedure InternalFillRect(ACanvas: TcxCanvas; const AOuterRect, AInternalRect: TRect; + AColor: TColor); +begin + if IsRectEmpty(AOuterRect) or EqualRect(AOuterRect, AInternalRect) then + Exit; + with ACanvas do + begin + Brush.Color := AColor; + if IsRectEmpty(AInternalRect) then + FillRect(AOuterRect) + else + begin + FillRect(Rect(AOuterRect.Left, AOuterRect.Top, + AInternalRect.Left, AOuterRect.Bottom)); + FillRect(Rect(AInternalRect.Left, AOuterRect.Top, + AInternalRect.Right, AInternalRect.Top)); + FillRect(Rect(AInternalRect.Right, AOuterRect.Top, + AOuterRect.Right, AOuterRect.Bottom)); + FillRect(Rect(AInternalRect.Left, AInternalRect.Bottom, + AInternalRect.Right, AOuterRect.Bottom)); + end; + end; +end; + +function InternalGetCursorPos: TPoint; +begin + GetCursorPos(Result); +end; + +function InternalGetShiftState: TShiftState; +var + AKeyState: TKeyBoardState; +begin + GetKeyboardState(AKeyState); + Result := KeyboardStateToShiftState(AKeyState); +end; + +procedure InternalInvalidate(AHandle: TcxHandle; const AOuterRect, AInternalRect: TRect; + AEraseBackground: Boolean = False); + + procedure InternalInvalidateRect(const R: TRect); + begin + InvalidateRect(AHandle, @R, AEraseBackground); + end; + +begin + if IsRectEmpty(AInternalRect) then + InternalInvalidateRect(AOuterRect) + else + begin + InternalInvalidateRect(Rect(AOuterRect.Left, AOuterRect.Top, AInternalRect.Left, + AOuterRect.Bottom)); + InternalInvalidateRect(Rect(AInternalRect.Left, AOuterRect.Top, AInternalRect.Right, + AInternalRect.Top)); + InternalInvalidateRect(Rect(AInternalRect.Right, AOuterRect.Top, AOuterRect.Right, + AOuterRect.Bottom)); + InternalInvalidateRect(Rect(AInternalRect.Left, AInternalRect.Bottom, AInternalRect.Right, + AOuterRect.Bottom)); + end; +end; + +procedure InternalInvalidateRect(AControl: TWinControl; const R: TRect; + AEraseBackground: Boolean); +begin + if AControl.HandleAllocated then + InvalidateRect(AControl.Handle, @R, AEraseBackground); +end; + +function InternalIsWindowVisible(AControl: TWinControl): Boolean; +begin + with AControl do + begin + Result := HandleAllocated; + Result := Result and IsWindowVisible(Handle); + end; +end; + +function IsChildWindow(AParent: TWinControl; AChildHandle: TcxNativeHandle): Boolean; + + function InternalNativeIsChildWindow(AParent: TWinControl): Boolean; + begin + Result := IsChild(NativeHandle(AParent.Handle), AChildHandle); + end; + + function InternalIsChildWindow(AParent: TWinControl): Boolean; + var + I: Integer; + APopupWindow: TcxCustomPopupWindow; + begin + with AParent do + for I := 0 to ControlCount - 1 do + if Controls[I] is TWinControl then + begin + if HasNativeHandle(TWinControl(Controls[I]), AChildHandle) then + begin + Result := True; + Exit; + end else + begin + Result := InternalIsChildWindow(TWinControl(Controls[I])); + if Result then + Exit; + end; + Result := InternalNativeIsChildWindow(TWinControl(Controls[I])); + if Result then + Exit; + end; + if AParent is TcxCustomPopupWindow then + for I := 0 to FVisiblePopupWindowList.Count - 1 do + begin + APopupWindow := TcxCustomPopupWindow(FVisiblePopupWindowList[I]); + if (APopupWindow = AParent) or (GetParentForm(APopupWindow.OwnerControl) <> AParent) then + Continue; + if HasNativeHandle(APopupWindow, AChildHandle) then + begin + Result := True; + Exit; + end else + begin + Result := InternalIsChildWindow(APopupWindow); + if Result then Exit; + end; + end; + for I := 0 to FVisiblePopupWindowList.Count - 1 do + begin + APopupWindow := TcxCustomPopupWindow(FVisiblePopupWindowList[I]); + if APopupWindow.OwnerControl = AParent then + begin + Result := HasNativeHandle(APopupWindow, AChildHandle) or + InternalIsChildWindow(APopupWindow); + if Result then Exit; + end; + end; + Result := False; + end; + +begin + Result := False; + if (AParent = nil) or (AChildHandle = 0) or HasNativeHandle(AParent, AChildHandle) then + Exit; + Result := InternalNativeIsChildWindow(AParent); + if not Result then + Result := InternalIsChildWindow(AParent); +end; + +function KillMessages(AWnd: HWND; AMsgFilterMin, AMsgFilterMax: UINT; + AKillAllMessages: Boolean = True): Boolean; +var + AMsg: TMsg; +begin + Result := False; + while PeekMessage(AMsg, AWnd, AMsgFilterMin, AMsgFilterMax, PM_REMOVE) do + if AMsg.message = WM_QUIT then + begin + PostQuitMessage(AMsg.wParam); + Break; + end + else + begin + Result := True; + if not AKillAllMessages then + Break; + end; +end; + +procedure LockCMActivateMessages(ALock: Boolean); +begin + if ALock then + Inc(FCMActivateMessagesLockCount) + else + Dec(FCMActivateMessagesLockCount); +end; + +function MouseButtonToShift(Button: TMouseButton): TShiftState; +begin + case Button of + mbLeft: + Result := [ssLeft]; + mbMiddle: + Result := [ssMiddle]; + mbRight: + Result := [ssRight]; + end; +end; + +function NativeHandle(Handle: TcxHandle): TcxNativeHandle; +begin + Result := Handle; +end; + +procedure SetUsecxScrollBars; +var + ALibrary: HMODULE; +begin +{$IFDEF USETCXSCROLLBAR} + ALibrary := GetModuleHandle('User32'); + if ALibrary <> 0 then + begin + @GetScrollBarInfoProc := GetProcAddress(ALibrary, 'GetScrollBarInfo'); + FUsecxScrollBars := Assigned(GetScrollBarInfoProc); + end; +{$ELSE} + FUsecxScrollBars := False; +{$ENDIF} +end; + +procedure SetWindowRegion(AControl: TWinControl; + const ABounds: TcxContainerInnerControlBounds); +begin + if ABounds.IsEmpty then + Windows.SetWindowRgn(AControl.Handle, 0, True) + else + Windows.SetWindowRgn(AControl.Handle, CreateRectRgnIndirect(ABounds.Rect), True); +end; + +procedure SetWindowShadowRegion(AWindowHandle: TcxHandle; const R: TRect; + ANativeStyle: Boolean; AShadow: Boolean; const AExcludeRect: TRect); +var + ARgnChanged: Boolean; + ARgnType: Integer; + ATempRegion, AWindowRegion: HRGN; +begin + AWindowRegion := GetWindowShadowRegion(AWindowHandle, R, ANativeStyle, + AShadow, AExcludeRect); + ATempRegion := CreateRectRgn(0, 0, 0, 0); + ARgnType := Integer(GetWindowRgn(AWindowHandle, ATempRegion)); + ARgnChanged := not((AWindowRegion = 0) and ((ARgnType = NULLREGION) or + (ARgnType = ERROR))) and not EqualRgn(AWindowRegion, ATempRegion); + DeleteObject(ATempRegion); + if ARgnChanged then + SetWindowRgn(AWindowHandle, AWindowRegion, True) + else + if AWindowRegion <> 0 then + DeleteObject(AWindowRegion); +end; + +function UsecxScrollBars: Boolean; +begin + Result := FUsecxScrollBars; +end; + +function AreVisualStylesMustBeUsed(ANativeStyle: Boolean; + AThemedObjectType: TdxThemedObjectType): Boolean; +begin + Result := ANativeStyle and (OpenTheme(AThemedObjectType) <> 0); +end; + +function GetSizeGripRect(AControl: IcxContainerInnerControl): TRect; +var + R: TRect; +begin + with AControl.ControlContainer do + if HScrollBar.Visible and VScrollBar.Visible then + begin + Result.TopLeft := ClientToScreen(Point(VScrollBar.Left, HScrollBar.Top)); + GetWindowRect(AControl.Control.Handle, R); + Dec(Result.Left, R.Left); + Dec(Result.Top, R.Top); + Result.Right := Result.Left + VScrollBar.Width; + Result.Bottom := Result.Top + HScrollBar.Height; + end + else + Result := cxEmptyRect; +end; + +procedure SetHooksSettingMode(ASetHooksOnlyWhenPopupsAreVisible: Boolean); +begin + if ASetHooksOnlyWhenPopupsAreVisible <> FSetHooksOnlyWhenPopupsAreVisible then + begin + FSetHooksOnlyWhenPopupsAreVisible := ASetHooksOnlyWhenPopupsAreVisible; + if FVisiblePopupWindowList.Count = 0 then + if ASetHooksOnlyWhenPopupsAreVisible then + RemoveHooks + else + SetHooks; + end; +end; + +var + FDisablingWindowsCounter: Integer; + FTopLevelWindowList: TList; + FInternalWindowsEnabling: Boolean; + +procedure DisableWindow(AWindowList: TList; AWnd: HWND); +begin + if IsWindowEnabled(AWnd) then + begin + AWindowList.Add(Pointer(AWnd)); + EnableWindow(AWnd, False); + end; +end; + +procedure EnableWindows(AWindowList: TList); +var + I: Integer; + AWnd: HWND; +begin + if AWindowList <> nil then + for I := 0 to AWindowList.Count - 1 do + begin + AWnd := HWND(AWindowList[I]); + if IsWindow(AWnd) then + EnableWindow(AWnd, True); + end; +end; + +function DisableTopLevelWindow(AWnd: HWND; AInfo: Pointer): BOOL; stdcall; +var + AProcessId: Cardinal; +begin + Result := True; + GetWindowThreadProcessId(AWnd, @AProcessId); + if (AProcessId = GetCurrentProcessId) then + DisableWindow(FTopLevelWindowList, AWnd); +end; + +procedure DisableAppWindows(ANeedDisable: Boolean = True); +begin + Inc(FDisablingWindowsCounter); + + if (FDisablingWindowsCounter = 1) and ANeedDisable then + try + FInternalWindowsEnabling := True; + FTopLevelWindowList := TList.Create; + EnumWindows(@DisableTopLevelWindow, 0); + finally + FInternalWindowsEnabling := False; + end; +end; + +procedure EnableAppWindows; +begin + Dec(FDisablingWindowsCounter); + + if FDisablingWindowsCounter = 0 then + try + FInternalWindowsEnabling := True; + EnableWindows(FTopLevelWindowList); + FreeAndNil(FTopLevelWindowList); + finally + FInternalWindowsEnabling := False; + end; +end; + +function IsInternalWindowsDisabled: Boolean; +begin + Result := FDisablingWindowsCounter > 0; +end; + +function IsInternalWindowsDisabling: Boolean; +begin + Result := FInternalWindowsEnabling; +end; + +procedure DrawWindowOnGlass(ADC: HDC; const ABounds: TRect; AWnd: HWND); +var + AMemDC: HDC; + APaintBuffer: THandle; +begin + APaintBuffer := BeginBufferedPaint(ADC, @ABounds, BPBF_COMPOSITED, nil, AMemDC); + try + SendMessage(AWnd, WM_ERASEBKGND, AMemDC, AMemDC); + SendMessage(AWnd, WM_PRINTCLIENT, AMemDC, PRF_CLIENT); + BufferedPaintSetAlpha(APaintBuffer, @ABounds, 255); + finally + HideCaret(AWnd); + EndBufferedPaint(APaintBuffer, True); + ShowCaret(AWnd); + end; +end; + +procedure RepaintWindowOnGlass(AWnd: HWND); +var + R: TRect; + DC: HDC; +begin + DC := GetDC(AWnd); + try + Windows.GetClientRect(AWnd, R); + DrawWindowOnGlass(DC, R, AWnd); + finally + ReleaseDC(AWnd, DC); + end; +end; + +procedure WMPaintWindowOnGlass(AWnd: HWND); +var + DC: HDC; + PS: TPaintStruct; +begin + DC := BeginPaint(AWnd, PS); + try + DrawWindowOnGlass(DC, PS.rcPaint, AWnd); + finally + EndPaint(AWnd, PS); + end; +end; + +function IsCMActivateMessagesLocked: Boolean; +begin + Result := FCMActivateMessagesLockCount <> 0; +end; + +{ TcxContainerViewInfo } + +constructor TcxContainerViewInfo.Create; +begin + inherited Create; + ContainerState := [csNormal]; +end; + +procedure TcxContainerViewInfo.Assign(Source: TObject); +begin + if Source is TcxContainerViewInfo then + with Source as TcxContainerViewInfo do + Self.ClientRect := ClientRect; +end; + +function TcxContainerViewInfo.GetUpdateRegion(AViewInfo: TcxContainerViewInfo): TcxRegion; +begin + Result := TcxRegion.Create; +end; + +procedure TcxContainerViewInfo.Offset(DX, DY: Integer); +begin + OffsetRect(BorderRect, DX, DY); + OffsetRect(Bounds, DX, DY); + OffsetRect(ClientRect, DX, DY); +end; + +procedure TcxContainerViewInfo.Paint(ACanvas: TcxCanvas); +begin + InternalPaint(ACanvas); +end; + +procedure TcxContainerViewInfo.DrawBorder(ACanvas: TcxCanvas; R: TRect); +begin + if Painter <> nil then + ACanvas.FrameRect(R, BorderColor, BorderWidth) + else + begin + if BorderStyle = cbsNone then + Exit; + case BorderStyle of + cbsSingle, cbsThick: + ACanvas.FrameRect(R, BorderColor, BorderWidth); + cbsFlat: + begin + ACanvas.DrawEdge(R, True, True, Edges); + InflateRect(R, -1, -1); + ACanvas.FrameRect(R, clBtnFace); + end; + cbs3D: + begin + ACanvas.DrawEdge(R, True, True, Edges); + InflateRect(R, -1, -1); + ACanvas.DrawComplexFrame(R, cl3DDkShadow, cl3DLight, Edges); + end; + end; + end; +end; + +function TcxContainerViewInfo.GetContainerBorderStyle: TcxContainerBorderStyle; +begin + Result := BorderStyle; +end; + +procedure TcxContainerViewInfo.InternalPaint(ACanvas: TcxCanvas); + + procedure DrawBackground; + var + R: TRect; + begin + R := BorderRect; + Dec(R.Left, BorderWidth); + Dec(R.Top, BorderWidth); + if bRight in Edges then Inc(R.Right, BorderWidth); + if bBottom in Edges then Inc(R.Bottom, BorderWidth); + if Shadow then + DrawContainerShadow(ACanvas, R); + if not(bRight in Edges) then Inc(R.Right, BorderWidth); + if not(bBottom in Edges) then Inc(R.Bottom, BorderWidth); + DrawBorder(ACanvas, R); + with ACanvas do + begin + Brush.Color := BackgroundColor; + FillRect(BorderRect); + end; + end; + + procedure DrawNativeStyleBackground; + + function IsBorderNeeded: Boolean; + begin + Result := BorderStyle <> cbsNone; + end; + + var + AThemedObjectType: TdxThemedObjectType; + APart, AState: Integer; + R: TRect; + AColor: COLORREF; + begin + if not IsBorderNeeded then + begin + ACanvas.Brush.Color := BackgroundColor; + ACanvas.FillRect(Bounds); + end + else + begin + GetThemeBackgroundContentRect(OpenTheme(ThemedObjectType), ACanvas.Handle, EP_EDITTEXT, + NativeState, Bounds, R); + ACanvas.Brush.Color := BackgroundColor; + ACanvas.FillRect(R); + if IsCompositionEnabled then + begin + AThemedObjectType := totListBox; + APart := LBCP_BORDER_NOSCROLL; + AState := LBPSN_NORMAL; + end + else + begin + AThemedObjectType := totComboBox; + APart := CP_DROPDOWNBUTTON; + AState := CBXS_NORMAL; + end; + GetThemeColor(OpenTheme(AThemedObjectType), APart, AState, TMT_BORDERCOLOR, AColor); + InternalFillRect(ACanvas, Bounds, R, AColor); + end; + end; + +begin + if NativeStyle then + DrawNativeStyleBackground + else + DrawBackground; +end; + +procedure TcxContainerViewInfo.SetBackgroundColor(Value: TColor); +begin + FBackgroundColor := Value; +end; + +{ TcxContainerStyles } + +constructor TcxContainerStyles.Create(AOwner: TPersistent; + AStyleClass: TcxContainerStyleClass); + + function CreateStyle(AState: TcxContainerStateItem): TcxContainerStyle; + begin + if AState = csNormal then + Result := AStyleClass.Create(AOwner, False, nil, AState) + else + Result := AStyleClass.Create(AOwner, False, FStyles[csNormal], AState); + end; + +var + AState: TcxContainerStateItem; +begin + inherited Create; + for AState := Low(TcxContainerStateItem) to High(TcxContainerStateItem) do + FStyles[AState] := CreateStyle(AState); +end; + +destructor TcxContainerStyles.Destroy; +var + AState: TcxContainerStateItem; +begin + for AState := High(TcxContainerStateItem) downto Low(TcxContainerStateItem) do + FreeAndNil(FStyles[AState]); + inherited Destroy; +end; + +procedure TcxContainerStyles.RestoreDefaults; +var + AState: TcxContainerStateItem; +begin + for AState := Low(TcxContainerStateItem) to High(TcxContainerStateItem) do + FStyles[AState].RestoreDefaults; +end; + +function TcxContainerStyles.GetStyle(AState: TcxContainerStateItem): TcxContainerStyle; +begin + Result := FStyles[AState]; +end; + +function TcxContainerStyles.GetStyleDisabled: TcxContainerStyle; +begin + Result := FStyles[csDisabled]; +end; + +function TcxContainerStyles.GetStyleFocused: TcxContainerStyle; +begin + Result := FStyles[csActive]; +end; + +function TcxContainerStyles.GetStyleHot: TcxContainerStyle; +begin + Result := FStyles[csHotTrack]; +end; + +function TcxContainerStyles.GetStyleNormal: TcxContainerStyle; +begin + Result := FStyles[csNormal]; +end; + +procedure TcxContainerStyles.SetOnChanged(Value: TNotifyEvent); +var + AState: TcxContainerStateItem; +begin + for AState := Low(TcxContainerStateItem) to High(TcxContainerStateItem) do + FStyles[AState].OnChanged := Value; +end; + +procedure TcxContainerStyles.SetStyle(AState: TcxContainerStateItem; Value: TcxContainerStyle); +begin + FStyles[AState].Assign(Value); +end; + +procedure TcxContainerStyles.SetStyleDisabled(Value: TcxContainerStyle); +begin + FStyles[csDisabled].Assign(Value); +end; + +procedure TcxContainerStyles.SetStyleFocused(Value: TcxContainerStyle); +begin + FStyles[csActive].Assign(Value); +end; + +procedure TcxContainerStyles.SetStyleHot(Value: TcxContainerStyle); +begin + FStyles[csHotTrack].Assign(Value); +end; + +procedure TcxContainerStyles.SetStyleNormal(Value: TcxContainerStyle); +begin + FStyles[csNormal].Assign(Value); +end; + +{ TcxStyleController } + +constructor TcxStyleController.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FListeners := TList.Create; + FStyles := TcxContainerStyles.Create(Self, GetStyleClass); + FStyles.OnChanged := StyleChanged; +end; + +destructor TcxStyleController.Destroy; +var + I: Integer; +begin + FIsDestruction := True; + for I := FListeners.Count - 1 downto 0 do + TcxContainerStyle(FListeners[I]).ControllerFreeNotification(Self); + FreeAndNil(FStyles); + FreeAndNil(FListeners); + inherited Destroy; +end; + +procedure TcxStyleController.RestoreStyles; +begin + FStyles.RestoreDefaults; +end; + +procedure TcxStyleController.Loaded; +begin + inherited Loaded; + Changed; +end; + +procedure TcxStyleController.AddListener(AListener: TcxContainerStyle); +begin + if (AListener = nil) or (FListeners.IndexOf(AListener) >= 0) then + Exit; + FListeners.Add(AListener); + AListener.LookAndFeel.MasterLookAndFeel := Style.LookAndFeel; +end; + +procedure TcxStyleController.Changed; +var + I: Integer; +begin + if Assigned(FOnStyleChanged) then + FOnStyleChanged(Self); + if not IsDestruction then + for I := 0 to Listeners.Count - 1 do + TcxContainerStyle(Listeners[I]).ControllerChangedNotification(Self); +end; + +procedure TcxStyleController.ChangeFontScale(M, D: Integer); +begin + if not (csvFont in Style.AssignedValues) then + Style.ActiveStyleController.ChangeFontScale(M, D) + else + if not FIsFontScaled then + begin + FIsFontScaled := True; + Style.Font.Size := MulDiv(Style.Font.Size, M, D); + end; +end; + +function TcxStyleController.GetStyleClass: TcxContainerStyleClass; +begin + Result := TcxContainerStyle; +end; + +function TcxStyleController.GetStylesClass: TcxContainerStylesClass; +begin + Result := TcxContainerStyles; +end; + +function TcxStyleController.IsDestruction: Boolean; +begin + Result := FIsDestruction; +end; + +procedure TcxStyleController.RemoveListener(AListener: TcxContainerStyle); +begin + if (AListener = nil) or (FListeners.IndexOf(AListener) < 0) then + Exit; + FListeners.Remove(AListener); + AListener.LookAndFeel.MasterLookAndFeel := nil; +end; + +function TcxStyleController.GetFakeStyleController: TcxStyleController; +begin + Result := Style.StyleController; +end; + +function TcxStyleController.GetStyle: TcxContainerStyle; +begin + Result := FStyles.Style; +end; + +function TcxStyleController.GetInternalStyle(AState: TcxContainerStateItem): TcxContainerStyle; +begin + Result := FStyles[AState]; +end; + +procedure TcxStyleController.SetFakeStyleController(Value: TcxStyleController); +begin +end; + +procedure TcxStyleController.SetInternalStyle(AState: TcxContainerStateItem; + Value: TcxContainerStyle); +begin + FStyles[AState].Assign(Value); +end; + +procedure TcxStyleController.StyleChanged(Sender: TObject); +begin + Changed; +end; + +{ TcxContainerStyle } + +constructor TcxContainerStyle.Create(AOwner: TPersistent; + ADirectAccessMode: Boolean; AParentStyle: TcxContainerStyle = nil; + AState: TcxContainerStateItem = csNormal); +begin + inherited Create(AOwner); + FDirectAccessMode := ADirectAccessMode; + FOwner := AOwner; + if AState <> csNormal then + FParentStyle := AParentStyle; + FState := AState; + if DirectAccessMode then + FAssignedValues := [csvColor, csvFont, csvTextColor, csvTextStyle]; // TODO ??? + CreateFont; + FVisibleFont := TFont.Create; + if IsBaseStyle then + begin + FLookAndFeel := TcxLookAndFeel.Create(Self); + FLookAndFeel.OnChanged := LookAndFeelChanged; + StyleController := GetDefaultStyleController; + end; +end; + +destructor TcxContainerStyle.Destroy; +begin + FIsDestroying := True; + if IsBaseStyle and (ActiveStyleController <> nil) then + ActiveStyleController.RemoveListener(Self); + FreeAndNil(FLookAndFeel); + FreeAndNil(FVisibleFont); + if not DirectAccessMode and IsBaseStyle then + FreeAndNil(StyleData.Font); + inherited Destroy; +end; + +procedure TcxContainerStyle.Assign(Source: TPersistent); +begin + if Source is TcxContainerStyle then + begin + BeginUpdate; + try + with Source as TcxContainerStyle do + begin + if Self.IsBaseStyle then + begin + Self.StyleController := StyleController; + Self.LookAndFeel := LookAndFeel; + end; + + Self.FBorderColor := FBorderColor; + Self.FBorderStyle := FBorderStyle; + Self.FEdges := FEdges; + Self.FHotTrack := FHotTrack; + Self.FShadow := FShadow; + Self.FTransparentBorder := FTransparentBorder; + Self.StyleData.Color := StyleData.Color; + + if Self.DirectAccessMode then + begin + Self.StyleData.Font := Font; + Self.StyleData.FontColor := TextColor; + end + else + begin + Self.StyleData.Font.Assign(Font); + if DirectAccessMode then + Self.StyleData.Font.Color := TextColor; + Self.StyleData.FontColor := TextColor; + Self.FTextStyle := TextStyle; + end; + + Self.FAssignedValues := FAssignedValues; + + Self.Changed; + end; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +procedure TcxContainerStyle.BeginUpdate; +begin + Inc(FUpdateCount); +end; + +procedure TcxContainerStyle.EndUpdate; +begin + if FUpdateCount > 0 then + begin + Dec(FUpdateCount); + CheckChanges; + end; +end; + +function TcxContainerStyle.GetStyleValue(const APropertyName: string; + out StyleValue: TcxContainerStyleValue): Boolean; +var + I: TcxContainerStyleValue; + S: string; +begin + Result := False; + for I := 0 to GetStyleValueCount - 1 do + begin + GetStyleValueName(I, S); + if InternalCompareString(S, APropertyName, False) then + begin + StyleValue := I; + Result := True; + Break; + end; + end; +end; + +function TcxContainerStyle.GetStyleValueCount: Integer; +begin + Result := cxContainerStyleValueCount; +end; + +function TcxContainerStyle.GetStyleValueName(AStyleValue: TcxContainerStyleValue; + out StyleValueName: string): Boolean; +begin + Result := AStyleValue < cxContainerStyleValueCount; + if Result then + StyleValueName := cxContainerStyleValueNameA[AStyleValue]; +end; + +function TcxContainerStyle.GetVisibleFont: TFont; +begin + UpdateVisibleFont; + Result := FVisibleFont; +end; + +function TcxContainerStyle.HasBorder: Boolean; +begin + if IsBaseStyle then + Result := True + else + Result := ParentStyle.HasBorder; +end; + +function TcxContainerStyle.IsExtendedStylePropertyPublished( + const APropertyName: string): Boolean; +var + AStyleValue: TcxContainerStyleValue; +begin + if (APropertyName = 'LookAndFeel') or (APropertyName = 'StyleController') then + begin + Result := False; + Exit; + end; + Result := True; + if GetStyleValue(APropertyName, AStyleValue) then + Result := not(AStyleValue in InternalGetNotPublishedExtendedStyleValues); +end; + +function TcxContainerStyle.IsValueAssigned(AValue: TcxContainerStyleValue): Boolean; +var + ABorderStyle: TcxContainerBorderStyle; + AColor: TColor; + AEdges: TcxBorders; + AFont: TFont; + ATempBool: Boolean; + ATextStyle: TFontStyles; +begin + Result := False; + case AValue of + csvBorderColor: + Result := InternalGetBorderColor(AColor); + csvBorderStyle: + Result := InternalGetBorderStyle(ABorderStyle); + csvColor: + Result := InternalGetColor(AColor); + csvEdges: + Result := InternalGetEdges(AEdges); + csvFont: + Result := InternalGetFont(AFont); + csvHotTrack: + Result := InternalGetHotTrack(ATempBool); + csvShadow: + Result := InternalGetShadow(ATempBool); + csvTextColor: + Result := InternalGetTextColor(AColor); + csvTextStyle: + Result := InternalGetTextStyle(ATextStyle); + end; +end; + +procedure TcxContainerStyle.RestoreDefaults; +begin + BeginUpdate; + try + AssignedValues := []; + if IsBaseStyle then + begin + LookAndFeel.Reset; + if Container <> nil then + begin + Container.ParentColor := False; + Container.ParentFont := True; + end + else + if not DirectAccessMode then + RestoreFont(StyleData.Font); + if (Container <> nil) and Container.DefaultParentColor and + ((ActiveStyleController = nil) or not ActiveStyleController.Style.IsValueAssigned(csvColor)) then + Container.ParentColor := True; + end; + finally + EndUpdate; + end; +end; + +procedure TcxContainerStyle.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('IsFontAssigned', ReadIsFontAssigned, + WriteIsFontAssigned, IsFontStored); +end; + +function TcxContainerStyle.BaseGetStyleController: TcxStyleController; +begin + if IsBaseStyle then + if FStyleController = GetDefaultStyleController then + Result := nil + else + Result := FStyleController + else + Result := ParentStyle.StyleController; +end; + +procedure TcxContainerStyle.BaseSetStyleController(Value: TcxStyleController); + + function CheckStyleController(AStyleController: TcxStyleController): Boolean; + begin + Result := False; + if AStyleController.Style = Self then + Exit; + repeat + AStyleController := AStyleController.Style.StyleController; + if AStyleController = nil then + Break; + if AStyleController.Style = Self then + Exit; + until False; + Result := True; + end; + +begin + if not IsBaseStyle then + ParentStyle.StyleController := Value + else + begin + if FOwner = GetDefaultStyleController then + Exit; + if Value = nil then + Value := GetDefaultStyleController; + if (Value <> nil) and (not CheckStyleController(Value)) then + Exit; + + if Value <> FStyleController then + begin + if FStyleController <> nil then + FStyleController.RemoveListener(Self); + FStyleController := Value; + if FStyleController <> nil then + FStyleController.AddListener(Self); + ControllerChangedNotification(FStyleController); + end; + end; +end; + +procedure TcxContainerStyle.Changed; +begin + FModified := True; + CheckChanges; +end; + +procedure TcxContainerStyle.ControllerChangedNotification(AStyleController: TcxStyleController); +begin + UpdateFont; + Changed; +end; + +procedure TcxContainerStyle.ControllerFreeNotification(AStyleController: TcxStyleController); +begin + if AStyleController = ActiveStyleController then + StyleController := nil; +end; + +function TcxContainerStyle.DefaultBorderColor: TColor; +begin + if State = csDisabled then + Result := clBtnShadow + else + if IsBaseStyle then + Result := clWindowFrame + else + Result := ParentStyle.BorderColor; +end; + +function TcxContainerStyle.DefaultBorderStyle: TcxContainerBorderStyle; +const + AStyleBorderStyles: array [TcxLookAndFeelKind] of TcxContainerBorderStyle = + (cbsFlat, cbs3D, cbsUltraFlat, cbsOffice11); + ABorderStyles: array [TcxContainerStateItem, TcxContainerBorderStyle] of TcxContainerBorderStyle = ( + (cbsNone, cbsSingle, cbsThick, cbsFlat, cbs3D, cbsUltraFlat, cbsOffice11), + (cbsFlat, cbsThick, cbsThick, cbs3D, cbs3D, cbsUltraFlat, cbsOffice11), + (cbsNone, cbsSingle, cbsThick, cbsFlat, cbs3D, cbsUltraFlat, cbsOffice11), + (cbsFlat, cbsThick, cbsThick, cbs3D, cbs3D, cbsUltraFlat, cbsOffice11) + ); +var + AState: TcxContainerStateItem; +begin + if IsBaseStyle then + Result := AStyleBorderStyles[LookAndFeel.Kind] + else + begin + if HotTrack or (State = csDisabled) then + AState := State + else + AState := csNormal; + Result := ABorderStyles[AState, ParentStyle.BorderStyle]; + end; +end; + +function TcxContainerStyle.DefaultColor: TColor; +var + AIsDefaultParentColor: Boolean; +begin + AIsDefaultParentColor := (Container = nil) or Container.DefaultParentColor; + if IsBaseStyle then + begin + if AIsDefaultParentColor then + Result := clBtnFace + else + Result := clWindow; + end + else + if (State = csDisabled) and not AIsDefaultParentColor then + Result := clBtnFace + else + Result := ParentStyle.Color; +end; + +function TcxContainerStyle.DefaultEdges: TcxBorders; +begin + Result := [bLeft, bTop, bRight, bBottom]; +end; + +function TcxContainerStyle.DefaultHotTrack: Boolean; +begin + Result := True; +end; + +function TcxContainerStyle.DefaultShadow: Boolean; +begin + Result := False; +end; + +function TcxContainerStyle.DefaultTextColor: TColor; +begin + if State = csDisabled then + Result := clBtnShadow + else + if IsBaseStyle then + Result := StyleData.Font.Color + else + Result := ParentStyle.TextColor; +end; + +function TcxContainerStyle.DefaultTextStyle: TFontStyles; +begin + if IsBaseStyle then + Result := StyleData.Font.Style + else + Result := ParentStyle.TextStyle; +end; + +function TcxContainerStyle.DefaultTransparentBorder: Boolean; +begin + Result := True; +end; + +procedure TcxContainerStyle.FontChanged(Sender: TObject); +begin + if not IsFontAssignedValueLocked then + Include(FAssignedValues, csvFont); + Changed; +end; + +function TcxContainerStyle.GetColor: TColor; +var + AContainer: TcxContainer; +begin + if DirectAccessMode then + Result := StyleData.Color + else + begin + AContainer := Container; + if IsBaseStyle and (AContainer <> nil) and + AContainer.ParentColor and (AContainer.Parent <> nil) then + Result := TWinControlAccess(AContainer.Parent).Color + else + if not InternalGetColor(Result) then + Result := DefaultColor; + end; +end; + +function TcxContainerStyle.GetDefaultStyleController: TcxStyleController; +begin + Result := DefaultContainerStyleController; +end; + +function TcxContainerStyle.GetStyleColor: TColor; +var + AContainer: TcxContainer; +begin + if FDirectAccessMode then + Result := StyleData.Color + else + if not InternalGetColor(Result) then + if not IsBaseStyle then + Result := DefaultColor + else + begin + AContainer := Container; + if (AContainer <> nil) and not AContainer.IsInplace and + AContainer.ParentColor and (AContainer.Parent <> nil) then + Result := TWinControlAccess(AContainer.Parent).Color + else + Result := DefaultColor; + end; +end; + +function TcxContainerStyle.GetTextColor: TColor; +begin + if DirectAccessMode then + Result := StyleData.FontColor + else + if not InternalGetTextColor(Result) then + Result := DefaultTextColor; +end; + +function TcxContainerStyle.GetTextStyle: TFontStyles; +begin + if DirectAccessMode then + Result := StyleData.Font.Style + else + if not InternalGetTextStyle(Result) then + Result := DefaultTextStyle; +end; + +function TcxContainerStyle.InternalGetColor(var Color: TColor): Boolean; +begin + Result := csvColor in FAssignedValues; + if Result then + Color := StyleData.Color + else + if ActiveStyleController <> nil then + Result := ActiveStyleController.Styles[State].InternalGetColor(Color); +end; + +function TcxContainerStyle.InternalGetNotPublishedExtendedStyleValues: TcxContainerStyleValues; +begin + Result := [csvEdges, csvFont, csvHotTrack, csvShadow, csvTransparentBorder]; +end; + +function TcxContainerStyle.IsBaseStyle: Boolean; +begin + Result := ParentStyle = nil; +end; + +function TcxContainerStyle.IsDestroying: Boolean; +begin + Result := FIsDestroying; +end; + +function TcxContainerStyle.IsFontAssignedValueLocked: Boolean; +begin + Result := FFontAssignedValueLockCount > 0; +end; + +procedure TcxContainerStyle.LockFontAssignedValue(ALock: Boolean); +begin + if ALock then + Inc(FFontAssignedValueLockCount) + else + if FFontAssignedValueLockCount > 0 then + Dec(FFontAssignedValueLockCount); +end; + +procedure TcxContainerStyle.UpdateFont; +var + AFont: TFont; +begin + if DirectAccessMode or (csvFont in AssignedValues) then + Exit; + LockFontAssignedValue(True); + try + if InternalGetFont(AFont) then + StyleData.Font.Assign(AFont) + else + if (Container = nil) or not Container.ParentFont then + RestoreFont(StyleData.Font); + finally + LockFontAssignedValue(False); + end; +end; + +function TcxContainerStyle.GetAssignedValues: TcxContainerStyleValues; +begin + if DirectAccessMode then + Result := [0..GetStyleValueCount - 1] + else + Result := FAssignedValues; +end; + +function TcxContainerStyle.GetBorderColor: TColor; +begin + if DirectAccessMode then + Result := clDefault + else + if not InternalGetBorderColor(Result) then + Result := DefaultBorderColor; +end; + +function TcxContainerStyle.GetBorderStyle: TcxContainerBorderStyle; +begin + if DirectAccessMode then + if csvBorderStyle in FAssignedValues then + Result := FBorderStyle + else + Result := DefaultBorderStyle + else + if not InternalGetBorderStyle(Result) then + Result := DefaultBorderStyle; +end; + +function TcxContainerStyle.GetEdges: TcxBorders; +begin + if DirectAccessMode then + Result := [] + else + if not IsBaseStyle then + Result := ParentStyle.Edges + else + if not InternalGetEdges(Result) then + Result := DefaultEdges; +end; + +function TcxContainerStyle.GetFont: TFont; +begin + if IsBaseStyle then + Result := StyleData.Font + else + Result := ParentStyle.Font; +end; + +function TcxContainerStyle.GetHotTrack: Boolean; +begin + if DirectAccessMode then + begin + if csvHotTrack in FAssignedValues then + Result := FHotTrack + else + Result := DefaultHotTrack; + end + else + if not IsBaseStyle then + Result := ParentStyle.HotTrack + else + if not InternalGetHotTrack(Result) then + Result := DefaultHotTrack; +end; + +function TcxContainerStyle.GetShadow: Boolean; +begin + if DirectAccessMode then + Result := False + else + if not IsBaseStyle then + Result := ParentStyle.Shadow + else + if not InternalGetShadow(Result) then + Result := DefaultShadow; +end; + +function TcxContainerStyle.GetTransparentBorder: Boolean; +begin + if DirectAccessMode then + Result := True + else + if not IsBaseStyle then + Result := ParentStyle.TransparentBorder + else + if not InternalGetTransparentBorder(Result) then + Result := DefaultTransparentBorder; +end; + +function TcxContainerStyle.InternalGetBorderColor(var BorderColor: TColor): Boolean; +begin + Result := csvBorderColor in FAssignedValues; + if Result then + BorderColor := FBorderColor + else + if ActiveStyleController <> nil then + Result := ActiveStyleController.Styles[State].InternalGetBorderColor(BorderColor); +end; + +function TcxContainerStyle.InternalGetBorderStyle( + var BorderStyle: TcxContainerBorderStyle): Boolean; +begin + Result := csvBorderStyle in FAssignedValues; + if Result then + BorderStyle := FBorderStyle + else + if ActiveStyleController <> nil then + Result := ActiveStyleController.Styles[State].InternalGetBorderStyle(BorderStyle); +end; + +function TcxContainerStyle.InternalGetEdges(var Edges: TcxBorders): Boolean; +begin + Result := csvEdges in FAssignedValues; + if Result then + Edges := FEdges + else + if ActiveStyleController <> nil then + Result := ActiveStyleController.Styles[State].InternalGetEdges(Edges); +end; + +function TcxContainerStyle.InternalGetFont(var Font: TFont): Boolean; +begin + Result := csvFont in FAssignedValues; + if Result then + Font := StyleData.Font + else + if ActiveStyleController <> nil then + Result := ActiveStyleController.Styles[State].InternalGetFont(Font); +end; + +function TcxContainerStyle.InternalGetHotTrack(var HotTrack: Boolean): Boolean; +begin + Result := csvHotTrack in FAssignedValues; + if Result then + HotTrack := FHotTrack + else + if ActiveStyleController <> nil then + Result := ActiveStyleController.Styles[State].InternalGetHotTrack(HotTrack); +end; + +function TcxContainerStyle.InternalGetShadow(var Shadow: Boolean): Boolean; +begin + Result := csvShadow in FAssignedValues; + if Result then + Shadow := FShadow + else + if ActiveStyleController <> nil then + Result := ActiveStyleController.Styles[State].InternalGetShadow(Shadow); +end; + +function TcxContainerStyle.InternalGetTextColor(var TextColor: TColor): Boolean; +begin + Result := csvTextColor in FAssignedValues; + if Result then + TextColor := StyleData.FontColor + else + if ActiveStyleController <> nil then + Result := ActiveStyleController.Styles[State].InternalGetTextColor(TextColor); +end; + +function TcxContainerStyle.InternalGetTextStyle(var TextStyle: TFontStyles): Boolean; +begin + Result := csvTextStyle in FAssignedValues; + if Result then + TextStyle := FTextStyle + else + if ActiveStyleController <> nil then + Result := ActiveStyleController.Styles[State].InternalGetTextStyle(TextStyle); +end; + +function TcxContainerStyle.InternalGetTransparentBorder( + var TransparentBorder: Boolean): Boolean; +begin + Result := csvTransparentBorder in FAssignedValues; + if Result then + TransparentBorder := FTransparentBorder + else + if ActiveStyleController <> nil then + Result := ActiveStyleController.Styles[State].InternalGetTransparentBorder(TransparentBorder); +end; + +function TcxContainerStyle.IsBorderColorStored: Boolean; +begin + Result := (csvBorderColor in FAssignedValues) and ((Container = nil) or + Container.IsStylePropertyPublished('BorderColor', State <> csNormal)); +end; + +function TcxContainerStyle.IsBorderStyleStored: Boolean; +begin + Result := (csvBorderStyle in FAssignedValues) and ((Container = nil) or + Container.IsStylePropertyPublished('BorderStyle', State <> csNormal)); +end; + +function TcxContainerStyle.IsColorStored: Boolean; +begin + Result := (csvColor in FAssignedValues) and ((Container = nil) or + Container.IsStylePropertyPublished('Color', State <> csNormal)); +end; + +function TcxContainerStyle.IsEdgesStored: Boolean; +begin + Result := (csvEdges in FAssignedValues) and ((Container = nil) or + Container.IsStylePropertyPublished('Edges', State <> csNormal)); +end; + +function TcxContainerStyle.IsFontStored: Boolean; +begin + Result := (csvFont in FAssignedValues) and ((Container = nil) or + Container.IsStylePropertyPublished('Font', State <> csNormal)); +end; + +function TcxContainerStyle.IsHotTrackStored: Boolean; +begin + Result := (csvHotTrack in FAssignedValues) and ((Container = nil) or + Container.IsStylePropertyPublished('HotTrack', State <> csNormal)); +end; + +function TcxContainerStyle.IsShadowStored: Boolean; +begin + Result := (csvShadow in FAssignedValues) and ((Container = nil) or + Container.IsStylePropertyPublished('Shadow', State <> csNormal)); +end; + +function TcxContainerStyle.IsStyleControllerStored: Boolean; +begin + Result := (State = csNormal); +end; + +function TcxContainerStyle.IsTextColorStored: Boolean; +begin + Result := (csvTextColor in FAssignedValues) and ((Container = nil) or + Container.IsStylePropertyPublished('TextColor', State <> csNormal)); +end; + +function TcxContainerStyle.IsTextStyleStored: Boolean; +begin + Result := (csvTextStyle in FAssignedValues) and ((Container = nil) or + Container.IsStylePropertyPublished('TextStyle', State <> csNormal)); +end; + +function TcxContainerStyle.IsTransparentBorderStored: Boolean; +begin + Result := (csvTransparentBorder in FAssignedValues) and ((Container = nil) or + Container.IsStylePropertyPublished('TransparentBorder', State <> csNormal)); +end; + +procedure TcxContainerStyle.SetAssignedValues(Value: TcxContainerStyleValues); +begin + if FAssignedValues <> Value then + begin + FAssignedValues := Value; + if IsBaseStyle then + UpdateFont; + Changed; + end; +end; + +procedure TcxContainerStyle.SetBorderColor(Value: TColor); +begin + if (csvBorderColor in FAssignedValues) and (Value = FBorderColor) then + Exit; + FBorderColor := Value; + Include(FAssignedValues, csvBorderColor); + Changed; +end; + +procedure TcxContainerStyle.SetBorderStyle(Value: TcxContainerBorderStyle); +begin + if (csvBorderStyle in FAssignedValues) and (Value = FBorderStyle) then + Exit; + FBorderStyle := Value; + Include(FAssignedValues, csvBorderStyle); + Changed; +end; + +procedure TcxContainerStyle.SetColor(Value: TColor); +begin + if (csvColor in FAssignedValues) and (Value = StyleData.Color) then + Exit; + StyleData.Color := Value; + Include(FAssignedValues, csvColor); + Changed; +end; + +procedure TcxContainerStyle.SetEdges(Value: TcxBorders); +begin + if not IsBaseStyle then + ParentStyle.Edges := Value + else + begin + if (csvEdges in FAssignedValues) and (Value = FEdges) then + Exit; + FEdges := Value; + Include(FAssignedValues, csvEdges); + Changed; + end; +end; + +procedure TcxContainerStyle.SetFont(Value: TFont); +begin + if DirectAccessMode then + StyleData.Font := Value + else + if not IsBaseStyle then + ParentStyle.Font := Value + else + begin + StyleData.Font.Assign(Value); + Include(FAssignedValues, csvFont); + Changed; + end; +end; + +procedure TcxContainerStyle.SetHotTrack(Value: Boolean); +begin + if not IsBaseStyle then + ParentStyle.HotTrack := Value + else + begin + if (csvHotTrack in FAssignedValues) and (Value = FHotTrack) then + Exit; + FHotTrack := Value; + Include(FAssignedValues, csvHotTrack); + Changed; + end; +end; + +procedure TcxContainerStyle.SetShadow(Value: Boolean); +begin + if not IsBaseStyle then + ParentStyle.Shadow := Value + else + begin + if (csvShadow in FAssignedValues) and (Value = FShadow) then + Exit; + FShadow := Value; + Include(FAssignedValues, csvShadow); + Changed; + end; +end; + +procedure TcxContainerStyle.SetTextColor(Value: TColor); +begin + if (csvTextColor in FAssignedValues) and (Value = TextColor) then + Exit; + StyleData.FontColor := Value; + Include(FAssignedValues, csvTextColor); + Changed; +end; + +procedure TcxContainerStyle.SetTextStyle(Value: TFontStyles); +begin + if (csvTextStyle in FAssignedValues) and (Value = TextStyle) then + Exit; + FTextStyle := Value; + Include(FAssignedValues, csvTextStyle); + Changed; +end; + +procedure TcxContainerStyle.SetTransparentBorder(Value: Boolean); +begin + if not IsBaseStyle then + ParentStyle.TransparentBorder := Value + else + begin + if (csvTransparentBorder in FAssignedValues) and (Value = FTransparentBorder) then + Exit; + FTransparentBorder := Value; + Include(FAssignedValues, csvTransparentBorder); + Changed; + end; +end; + +procedure TcxContainerStyle.CheckChanges; +begin + if FModified and (FUpdateCount = 0) then + begin + FModified := False; + if not IsDestroying and not DirectAccessMode and Assigned(FOnChanged) then + FOnChanged(Self); + end; +end; + +procedure TcxContainerStyle.CreateFont; +begin + if not DirectAccessMode and IsBaseStyle then + begin + StyleData.Font := TFont.Create; + StyleData.Font.OnChange := FontChanged; + end + else + StyleData.Font := nil; +end; + +function TcxContainerStyle.GetActiveStyleController: TcxStyleController; +begin + if IsBaseStyle then + Result := FStyleController + else + Result := ParentStyle.FStyleController; +end; + +function TcxContainerStyle.GetBaseStyle: TcxContainerStyle; +begin + if IsBaseStyle then + Result := Self + else + Result := ParentStyle; +end; + +function TcxContainerStyle.GetContainer: TcxContainer; +begin + if FOwner is TcxContainer then + Result := TcxContainer(FOwner) + else + Result := nil; +end; + +function TcxContainerStyle.GetLookAndFeel: TcxLookAndFeel; +begin + if IsBaseStyle then + Result := FLookAndFeel + else + Result := ParentStyle.LookAndFeel; +end; + +procedure TcxContainerStyle.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + Changed; +end; + +procedure TcxContainerStyle.ReadIsFontAssigned(Reader: TReader); +begin + Reader.ReadBoolean; + AssignedValues := AssignedValues + [csvFont]; +end; + +procedure TcxContainerStyle.RestoreFont(AFont: TFont); +var + ATempFont: TFont; +begin + ATempFont := TFont.Create; + try + AFont.Assign(ATempFont); + finally + ATempFont.Free; + end; +end; + +procedure TcxContainerStyle.SetLookAndFeel(Value: TcxLookAndFeel); +begin + if IsBaseStyle then + FLookAndFeel.Assign(Value) + else + ParentStyle.LookAndFeel := Value; +end; + +procedure TcxContainerStyle.UpdateVisibleFont; +begin + FVisibleFont.Assign(Font); + FVisibleFont.Color := TextColor; + FVisibleFont.Style := TextStyle; +end; + +procedure TcxContainerStyle.WriteIsFontAssigned(Writer: TWriter); +begin + Writer.WriteBoolean(True); +end; + +{ TcxContainer } + +constructor TcxContainer.Create(AOwner: TComponent); +var + AColor: TColor; +begin + inherited Create(AOwner); + FIsCreating := True; + + FSizeGripData.Visible := False; + + FStyles := GetStylesClass.Create(Self, GetStyleClass); + FStyles.OnChanged := ContainerStyleChanged; + + FActiveStyleData.ContainerState := [csNormal]; + FActiveStyleData.ActiveStyle := FStyles.Style; + + FViewInfo := GetViewInfoClass.Create; + LookAndFeel.MasterLookAndFeel := FStyles.Style.LookAndFeel; + + ControlStyle := ControlStyle + [csSetCaption, csCaptureMouse]; + TabStop := True; + ParentColor := DefaultParentColor and not IsInplace and + not Style.InternalGetColor(AColor); + if not ParentColor then + Color := clWindow; + ClearSavedChildControlRegions; + + FIsCreating := False; +end; + +destructor TcxContainer.Destroy; +begin + cxControls.EndMouseTracking(Self); + FIsDestroying := True; + FreeAndNil(FViewInfo); + FStyles.OnChanged := nil; + FreeAndNil(FStyles); + inherited Destroy; +end; + +function TcxContainer.Focused: Boolean; +begin + if IsDesigning or (csDestroyingHandle in ControlState) then + Result := False + else + begin + Result := inherited Focused; + Result := Result or (InnerControl <> nil) and + InnerControl.Focused; + end; +end; + +function TcxContainer.GetDragImages: TDragImageList; +begin + if InnerControl = nil then + Result := inherited GetDragImages + else + Result := TWinControlAccess(InnerControl).GetDragImages; +end; + +procedure TcxContainer.GetTabOrderList(List: TList); +var + AActiveControl: TWinControl; +begin + if IsContainerClass then + inherited GetTabOrderList(List) + else + begin + AActiveControl := GetParentForm(Self).ActiveControl; + if (AActiveControl <> Self) and CanFocus and (InnerControl <> nil) and + (InnerControl = AActiveControl) then + begin + List.Add(InnerControl); + List.Remove(Self); + end; + end; +end; + +procedure TcxContainer.SetFocus; +var + AParentForm: TCustomForm; +begin + if IsDesigning or IsContainerFocused then + Exit; + inherited SetFocus; + if (InnerControl <> nil) and InnerControl.HandleAllocated and (GetFocus = Handle) then + begin + AParentForm := GetParentForm(Self); + SafeSelectionFocusInnerControl; + AParentForm.FocusControl(InnerControl); + end; +end; + +procedure TcxContainer.ClearSavedChildControlRegions; +begin + FInnerControlBounds.IsEmpty := True; +end; + +function TcxContainer.GetVisibleBounds: TRect; +var + ABorderWidth, ABorderMaskedPartWidth: Integer; +begin + Result := GetControlRect(Self); + if IsInplace then + Exit; + try + if ViewInfo.Shadow then + begin + Dec(Result.Right, cxContainerShadowWidth); + Dec(Result.Bottom, cxContainerShadowWidth); + end; + + if not Style.HasBorder then + begin + if Style.TransparentBorder then + InflateRect(Result, -cxContainerMaxBorderWidth, -cxContainerMaxBorderWidth); + Exit; + end; + if ViewInfo.NativeStyle then + begin + if Style.TransparentBorder and (Style.BorderStyle = cbsNone) then + InflateRect(Result, -cxContainerMaxBorderWidth, -cxContainerMaxBorderWidth); + Exit; + end; + if not Style.TransparentBorder then + Exit; + + ABorderWidth := GetContainerBorderWidth(ViewInfo.BorderStyle); + ABorderMaskedPartWidth := cxContainerMaxBorderWidth - ABorderWidth; + InflateRect(Result, -ABorderMaskedPartWidth, -ABorderMaskedPartWidth); + InflateRectByBorders(Result, ABorderWidth, ViewInfo.Edges); + finally + if Result.Top > Result.Bottom then + Result := Rect(Result.Left, 0, Result.Right, 0); + end; +end; + +function TcxContainer.HasPopupWindow: Boolean; +begin + Result := False; +end; + +function TcxContainer.InnerControlDefaultHandler(var Message: TMessage): Boolean; + + procedure DoBufferedPaint(DC: HDC; Rect: TRect); + var + MemDC: HDC; + PaintBuffer: THandle;//HPAINTBUFFER; + begin + PaintBuffer := BeginBufferedPaint(DC, @Rect, BPBF_TOPDOWNDIB, nil, MemDC); + try + SendMessage(InnerControl.Handle, WM_PRINTCLIENT, MemDC, PRF_CLIENT); + BufferedPaintSetAlpha(PaintBuffer, @Rect, 255); + finally + EndBufferedPaint(PaintBuffer, True); + end; + end; + + procedure BufferedPaintOnGlass; + var + DC: HDC; + begin + DC := GetDC(InnerControl.Handle); + try + DoBufferedPaint(DC, InnerControl.ClientRect); + finally + ReleaseDC(InnerControl.Handle, DC); + end; + end; + +begin + Result := False; + case Message.Msg of + WM_CONTEXTMENU: + begin + with Message do + Result := Perform(Msg, WParam, LParam); + Result := Message.Result <> 0; + end; + CN_CTLCOLOREDIT: + if OnGlass and IsCompositionEnabled and not FInnerControlBufferedPaint then + begin + FInnerControlBufferedPaint := True; + PostMessage(InnerControl.Handle, CM_BUFFEREDPAINTONGLASS, 0, 0); + end; + CM_BUFFEREDPAINTONGLASS: + if FInnerControlBufferedPaint then + try + BufferedPaintOnGlass; + finally + FInnerControlBufferedPaint := False; + end; + end; +end; + +function TcxContainer.InnerControlMenuHandler(var Message: TMessage): Boolean; +var + AKeyMessage: TWMKey; +begin + Result := False; + if (Message.Msg = CN_KEYDOWN) or (Message.Msg = CN_SYSKEYDOWN) then + begin + AKeyMessage := TWMKey(Message); + Result := IsMenuKey(AKeyMessage); + if Result then + Message.Result := 1; + end; +end; + +procedure TcxContainer.Invalidate; +begin + inherited Invalidate; + if InnerControl <> nil then + InnerControl.Invalidate; +end; + +function TcxContainer.IsInplace: Boolean; +begin + Result := False; +end; + +function TcxContainer.IsStylePropertyPublished(const APropertyName: string; + AExtendedStyle: Boolean): Boolean; +var + AStyleValue: TcxContainerStyleValue; +begin + if AExtendedStyle then + Result := Style.IsExtendedStylePropertyPublished(APropertyName) + else + Result := True; + if Result and Style.GetStyleValue(APropertyName, AStyleValue) then + Result := not(AStyleValue in InternalGetNotPublishedStyleValues); +end; + +procedure TcxContainer.LockAlignControls(ALock: Boolean); +begin + if ALock then + Inc(FLockAlignControlsCount) + else + if FLockAlignControlsCount > 0 then + Dec(FLockAlignControlsCount); +end; + +procedure TcxContainer.LockPopupMenu(ALock: Boolean); +begin + if ALock then + Inc(FPopupMenuLockCount) + else + if FPopupMenuLockCount > 0 then + Dec(FPopupMenuLockCount); +end; + +procedure TcxContainer.RestoreStyles; +begin + FStyles.RestoreDefaults; +end; + +procedure TcxContainer.SetScrollBarsParameters(AIsScrolling: Boolean = False); + + procedure SetScrollBarParameters(AScrollBar: TcxScrollBar); + const + ABarFlags: array [TScrollBarKind] of Integer = (SB_HORZ, SB_VERT); + var + AScrollInfo: TScrollInfo; + begin + if not AIsScrolling then + AdjustScrollBarPosition(AScrollBar); + if not AScrollBar.Visible then + Exit; + + AScrollInfo.cbSize := SizeOf(AScrollInfo); + AScrollInfo.fMask := SIF_ALL; + GetScrollInfo(FInnerControl.Handle, ABarFlags[AScrollBar.Kind], AScrollInfo); + with AScrollInfo do + begin + if Integer(nPage) > nMax then + Integer(nPage) := nMax; + AScrollBar.SetScrollParams(nMin, nMax, nPos, nPage, True); + end; + end; + + procedure GetSizeGripData(out ASizeGripData: TcxContainerSizeGripData); + var + AIContainerInnerControl: IcxContainerInnerControl; + begin + ASizeGripData.Visible := HScrollBar.Visible and VScrollBar.Visible and + (InnerControl <> nil) and InnerControl.HandleAllocated and + Supports(InnerControl, IcxContainerInnerControl, AIContainerInnerControl); + if ASizeGripData.Visible then + ASizeGripData.Bounds := GetSizeGripRect(AIContainerInnerControl); + end; + + function NeedsRepaintSizeGrip( + const APrevSizeGripData, ASizeGripData: TcxContainerSizeGripData): Boolean; + begin + Result := not APrevSizeGripData.Visible and ASizeGripData.Visible or + APrevSizeGripData.Visible and ASizeGripData.Visible and + not EqualRect(APrevSizeGripData.Bounds, ASizeGripData.Bounds); + end; + + procedure RepaintSizeGrip(const ASizeGripRect: TRect); + var + ARgn: HRGN; + begin + ARgn := CreateRectRgnIndirect(ASizeGripRect); + SendMessage(InnerControl.Handle, WM_NCPAINT, ARgn, 0); + DeleteObject(ARgn); + end; + +var + ASizeGripData: TcxContainerSizeGripData; +begin +{$IFDEF USETCXSCROLLBAR} + if (FInnerControl = nil) or not NeedsScrollBars or IsDestroying or not UsecxScrollBars then + Exit; + FScrollBarsCalculating := True; + try + SetScrollBarParameters(HScrollBar); + SetScrollBarParameters(VScrollBar); + GetSizeGripData(ASizeGripData); + if NeedsRepaintSizeGrip(FSizeGripData, ASizeGripData) then + RepaintSizeGrip(ASizeGripData.Bounds); + FSizeGripData := ASizeGripData; + finally + FScrollBarsCalculating := False; + end; +{$ENDIF} +end; + +function TcxContainer.ShortRefreshContainer(AIsMouseEvent: Boolean): Boolean; +var + ACursorPos: TPoint; + AWindowFromPoint: THandle; +begin + Result := False; + if not HandleAllocated or IsDestroying or FRefreshingContainer then Exit; + FRefreshingContainer := True; + try + AWindowFromPoint := WindowFromPoint(InternalGetCursorPos); + if HandleAllocated and IsChildEx(Handle, AWindowFromPoint) then + ACursorPos := ScreenToClient(InternalGetCursorPos) + else + ACursorPos := Point(-1, -1); + Result := RefreshContainer(ACursorPos, cxmbNone, InternalGetShiftState, AIsMouseEvent); + finally + FRefreshingContainer := False; + end; +end; + +procedure TcxContainer.Update; +begin + inherited Update; + if InnerControl <> nil then + InnerControl.Update; +end; + +procedure TcxContainer.UpdateScrollBarsParameters; +begin + if not IsDestroying and HandleAllocated and (InnerControl <> nil) then + PostMessage(Handle, CM_UPDATESCROLLBARS, 0, 0); +end; + +procedure TcxContainer.MouseTrackingCallerMouseLeave; +begin + EndMouseTracking; +end; + +function TcxContainer.GetLookAndFeelValue: TcxLookAndFeel; +begin + Result := Style.LookAndFeel; +end; + +procedure TcxContainer.AdjustClientRect(var Rect: TRect); +begin + if not IsDestroying then + Rect := ViewInfo.ClientRect; +end; + +procedure TcxContainer.AlignControls(AControl: TControl; var Rect: TRect); +var + AInnerControlBounds: TcxContainerInnerControlBounds; +begin + if IsContainerClass then + begin + inherited AlignControls(AControl, Rect); + Exit; + end; + + if IsAlignControlsLocked or IsInternalControl(AControl) then // ??? !!! + Exit; + if AControl = nil then + inherited AlignControls(AControl, Rect); + if FIsCreating or (AControl = nil) then + Exit; + if (AControl is TWinControl) and TWinControl(AControl).HandleAllocated then + begin + AInnerControlBounds := GetInnerControlBounds(Rect, AControl); + if IsInnerControlBoundsChanged(TWinControl(AControl), AInnerControlBounds) then + begin + SetWindowRegion(TWinControl(AControl), AInnerControlBounds); + SaveInnerControlBounds(TWinControl(AControl), AInnerControlBounds); + end; + end; +end; + +function TcxContainer.AllowAutoDragAndDropAtDesignTime(X, Y: Integer; + Shift: TShiftState): Boolean; +begin + Result := False; +end; + +function TcxContainer.CanFocusOnClick: Boolean; +begin + Result := inherited CanFocusOnClick and not((FInnerControl <> nil) and + FInnerControl.HandleAllocated and FInnerControl.Focused or + InnerControlMouseDown); +end; + +procedure TcxContainer.ChangeScale(M, D: Integer); + + function NeedFontScaling: Boolean; + begin + Result := (M <> D) and Style.IsValueAssigned(csvFont) and + (not IsLoading or (sfFont in ScalingFlags)); + end; + +var + ANeedFontScaling: Boolean; +begin + ANeedFontScaling := NeedFontScaling; + + FInternalSetting := not ParentFont; + try + inherited ChangeScale(M, D); + finally + FInternalSetting := False; + end; + + if ANeedFontScaling then + if csvFont in Style.AssignedValues then + Style.Font.Size := MulDiv(Style.Font.Size, M, D) + else + if IsLoading then + Style.ActiveStyleController.ChangeFontScale(M, D); +end; + +procedure TcxContainer.ColorChanged; +begin + if not FInternalSetting then + FStyles.Style.Color := Color + else + begin + inherited ColorChanged; + ShortRefreshContainer(False); + end; +end; + +procedure TcxContainer.CursorChanged; +begin + inherited CursorChanged; + if FInnerControl <> nil then + begin + FInnerControl.Cursor := Cursor; + end; +end; + +procedure TcxContainer.DoContextPopup(MousePos: TPoint; + var Handled: Boolean); +begin + if not IsPopupMenuLocked and ((MousePos.X = -1) and (MousePos.Y = -1) or + CanShowPopupMenu(MousePos)) then + inherited DoContextPopup(MousePos, Handled) + else + Handled := True; +end; + +procedure TcxContainer.DragCanceled; +begin + inherited DragCanceled; + if InnerControl <> nil then + TWinControlAccess(InnerControl).DragCanceled; +end; + +procedure TcxContainer.FocusChanged; +begin + inherited FocusChanged; + ShortRefreshContainer(False); +end; + +function TcxContainer.FocusWhenChildIsClicked(AChild: TControl): Boolean; +begin + Result := False; +end; + +function TcxContainer.GetClientBounds: TRect; +begin + Result := ViewInfo.ClientRect; +end; + +function TcxContainer.IsContainerFocused: Boolean; +begin + Result := Focused; +end; + +procedure TcxContainer.KeyDown(var Key: Word; Shift: TShiftState); +var + AParentForm: TCustomForm; +begin + inherited KeyDown(Key, Shift); + case Key of + VK_TAB: + if Focused and (Shift * [ssAlt, ssCtrl] = []) and CanContainerHandleTabs then + begin + Key := 0; + AParentForm := GetParentForm(Self); + TWinControlAccess(AParentForm).SelectNext(AParentForm.ActiveControl, + not(ssShift in Shift), True); + if HandleAllocated and (InnerControl <> nil) then + if GetFocus = Handle then + InnerControl.SetFocus; + end; + end; +end; + +procedure TcxContainer.Loaded; +begin + inherited Loaded; + ContainerStyleChanged(FStyles.Style); +end; + +function TcxContainer.MayFocus: Boolean; +begin + Result := not((InnerControl <> nil) and InnerControl.Focused); +end; + +procedure TcxContainer.MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + FShiftState := Shift; + RefreshContainer(Point(X, Y), ButtonTocxButton(Button), FShiftState, True); +end; + +procedure TcxContainer.MouseEnter(AControl: TControl); +begin + inherited MouseEnter(AControl); + ShortRefreshContainer(True); + BeginMouseTracking(Self, VisibleBounds, Self); +end; + +procedure TcxContainer.MouseLeave(AControl: TControl); +begin + inherited MouseLeave(AControl); + FShiftState := []; + ShortRefreshContainer(True); + cxControls.EndMouseTracking(Self); +end; + +procedure TcxContainer.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + RefreshContainer(Point(X, Y), cxmbNone, Shift, True); + BeginMouseTracking(Self, VisibleBounds, Self); +end; + +procedure TcxContainer.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + FShiftState := Shift; + RefreshContainer(Point(X, Y), ButtonTocxButton(Button), FShiftState, True); +end; + +function TcxContainer.NeedsScrollBars: Boolean; +begin + Result := False; +end; + +procedure TcxContainer.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (AComponent = InnerControl) then + InnerControl := nil; +end; + +procedure TcxContainer.Paint; + + procedure DrawBackgroundByPainter; + begin + Canvas.SaveClipRegion; + try + Canvas.ExcludeClipRect(ViewInfo.BorderRect); + cxDrawTransparentControlBackground(Self, Canvas, ViewInfo.Bounds, False); + finally + Canvas.RestoreClipRegion; + end; + end; + +begin + if RectVisible(Canvas.Handle, ViewInfo.Bounds) then + begin + if csPaintCopy in ControlState then + SetVisibleBoundsClipRect; + CheckIsViewInfoCalculated; + if ViewInfo.Painter <> nil then + DrawBackgroundByPainter; + ViewInfo.Paint(Canvas); + end; +end; + +procedure TcxContainer.Resize; +begin + inherited Resize; + if not FIsCreating then + begin + FRefreshingContainer := False; + ShortRefreshContainer(False); + end; +end; + +procedure TcxContainer.SetDragMode(Value: TDragMode); +begin + inherited SetDragMode(Value); + if InnerControl <> nil then + TWinControlAccess(InnerControl).DragMode := Value; +end; + +procedure TcxContainer.CreateHandle; +begin + inherited CreateHandle; + PostMessage(Handle, CM_SHORTREFRESHCONTAINER, 0, 0); +end; + +procedure TcxContainer.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params.WindowClass do + style := style and not(CS_HREDRAW or CS_VREDRAW); +end; + +procedure TcxContainer.CreateWindowHandle(const Params: TCreateParams); +var + AParams: TCreateParams; +begin + AParams := Params; + AParams.Caption := ''; + inherited CreateWindowHandle(AParams); + if HandleAllocated then + CallWindowProc(DefWndProc, Handle, WM_SETTEXT, 0, Integer(WindowText)); +end; + +procedure TcxContainer.WndProc(var Message: TMessage); +begin + case Message.Msg of + WM_CHAR, WM_KEYDOWN, WM_KEYUP, CN_CHAR, CN_KEYDOWN, CN_KEYUP: + if InnerControl <> nil then + begin + with TMessage(Message) do + Result := SendMessage(InnerControl.Handle, Msg, WParam, LParam); + Exit; + end; + WM_SETFOCUS: + if not Visible then + Exit; + WM_LBUTTONDOWN, WM_LBUTTONDBLCLK: + if (DragMode = dmAutomatic) and not IsDesigning then + begin + BeginAutoDrag; + Exit; + end; + WM_PAINT: + begin + if OnGlass and IsCompositionEnabled then + begin + WMPaintWindowOnGlass(Handle); + Message.Result := 0; + end + else + inherited WndProc(Message); + end; + CN_CTLCOLOREDIT, CN_CTLCOLORSTATIC: + begin + inherited WndProc(Message); + if not FRepaintOnGlass and OnGlass and + IsCompositionEnabled then + begin + FRepaintOnGlass := True; + PostMessage(Handle, CM_BUFFEREDPAINTONGLASS, 0, 0); + end; + end; + CM_BUFFEREDPAINTONGLASS: + if FRepaintOnGlass then + begin + RepaintWindowOnGlass(Handle); + FRepaintOnGlass := False; + end; + end; + inherited WndProc(Message); +end; + +procedure TcxContainer.AdjustInnerControl; +begin + if FInnerControl <> nil then + with TWinControlAccess(FInnerControl) do + begin + Color := ViewInfo.BackgroundColor; + AssignFonts(Font, ActiveStyle.GetVisibleFont); + end; +end; + +procedure TcxContainer.CalculateViewInfo(const P: TPoint; AMouseTracking: Boolean); + + function GetContainerState: TcxContainerState; + begin + if Enabled then + if IsDesigning then + Result := [csNormal] + else + begin + if Focused then + Result := [csActive] + else + Result := [csNormal]; + if PtInRect(GetVisibleBounds, P) and AMouseTracking then + Include(Result, csHotTrack); + end + else + Result := [csDisabled]; + end; + + function GetBorderColor: TColor; + var + AIsHighlightBorder: Boolean; + begin + if Style.LookAndFeel.SkinPainter <> nil then + begin + AIsHighlightBorder := (csActive in ViewInfo.ContainerState) or + (csHotTrack in ViewInfo.ContainerState) and ActiveStyle.HotTrack or + IsDesigning and Enabled; + Result := Style.LookAndFeel.SkinPainter.GetContainerBorderColor(AIsHighlightBorder); + end + else + if ActiveStyle.BorderStyle in [cbsUltraFlat, cbsOffice11] then + begin + AIsHighlightBorder := (csActive in ViewInfo.ContainerState) or + (csHotTrack in ViewInfo.ContainerState) and ActiveStyle.HotTrack or + IsDesigning and Enabled; + if AIsHighlightBorder then + if ActiveStyle.BorderStyle = cbsOffice11 then + Result := dxOffice11SelectedBorderColor + else + Result := clHighlight + else + Result := clBtnShadow; + end + else + Result := ActiveStyle.BorderColor; + end; + + procedure CalculateColorSettings; + var + AColor: COLORREF; + begin + ViewInfo.BorderColor := GetBorderColor; + if ViewInfo.NativeStyle then + if Enabled or ActiveStyle.IsValueAssigned(csvColor) then + AColor := ActiveStyle.Color +// if not (ViewInfo.NativeState in [ETS_DISABLED, ETS_READONLY]) or +// ActiveStyle.IsValueAssigned(csvColor) then +// ViewInfo.BackgroundColor := ActiveStyle.Color + else + GetThemeColor(OpenTheme(ViewInfo.ThemedObjectType), ViewInfo.NativePart, ViewInfo.NativeState, + TMT_FILLCOLOR, AColor) + else + AColor := ActiveStyle.Color; + ViewInfo.BackgroundColor := AColor; + end; + + procedure CalculateContainerState; + var + ASelected: Boolean; + begin + ViewInfo.ContainerState := GetContainerState; + + ASelected := ViewInfo.ContainerState * [csActive, csHotTrack] <> []; + if not ActiveStyle.HotTrack then + ViewInfo.HotState := chsNoHotTrack + else + if ASelected then + ViewInfo.HotState := chsSelected + else + ViewInfo.HotState := chsNormal; + + if ViewInfo.NativeStyle then + ViewInfo.BorderStyle := Style.BorderStyle + else + begin + ViewInfo.BorderStyle := ActiveStyle.BorderStyle; + if ViewInfo.BorderStyle in [cbsUltraFlat, cbsOffice11] then + ViewInfo.BorderStyle := cbsSingle; + end; + end; + +var + APrevBorderWidth: Integer; +begin + ViewInfo.NativeStyle := IsNativeStyle; + ViewInfo.Painter := Style.LookAndFeel.SkinPainter; + + APrevBorderWidth := GetContainerBorderWidth(ViewInfo.BorderStyle); + CalculateContainerState; + if not ViewInfo.NativeStyle and + (GetContainerBorderWidth(ViewInfo.BorderStyle) < APrevBorderWidth) then + CalculateContainerState; + + if ViewInfo.NativeStyle then + begin + ViewInfo.ThemedObjectType := GetBackgroundThemedObjectType; + ViewInfo.NativePart := GetBackgroundNativePart; + ViewInfo.NativeState := GetBackgroundNativeState; + end; + + ViewInfo.Bounds := GetControlRect(Self); + ViewInfo.BorderRect := ViewInfo.Bounds; + with ViewInfo do + ExtendRect(BorderRect, GetBorderExtent); + ViewInfo.ClientRect := ViewInfo.BorderRect; + if ViewInfo.Painter <> nil then + ViewInfo.BorderWidth := 1 + else + ViewInfo.BorderWidth := GetContainerBorderWidth(ViewInfo.BorderStyle); + ViewInfo.Edges := ActiveStyle.Edges; + ViewInfo.Shadow := HasShadow; + CalculateColorSettings; +end; + +function TcxContainer.CanContainerHandleTabs: Boolean; +begin + Result := True; +end; + +function TcxContainer.CanHaveTransparentBorder: Boolean; +begin + Result := not (ViewInfo.NativeStyle and (ViewInfo.BorderStyle <> cbsNone)); +end; + +function TcxContainer.CanShowPopupMenu(const P: TPoint): Boolean; +begin + Result := True;//PtInRect(ViewInfo.ClientRect, P); +end; + +procedure TcxContainer.CheckIsViewInfoCalculated; +begin + if not IsViewInfoCalculated then + ShortRefreshContainer(False); +end; + +procedure TcxContainer.ContainerStyleChanged(Sender: TObject); +begin + if FIsCreating or IsLoading then + Exit; + ShortRefreshContainer(False); + + if not ParentColor or (csvColor in Style.AssignedValues) then + begin + FInternalSetting := True; + try + Color := Style.GetStyleColor; + finally + FInternalSetting := False; + end; + end; + + FInternalSetting := True; + try + Font := Style.Font; + finally + FInternalSetting := False; + end; + + if Style.IsValueAssigned(csvFont) then + ParentFont := False; +end; + +procedure TcxContainer.DataChange; +begin +end; + +procedure TcxContainer.DataSetChange; +begin + ShortRefreshContainer(False); +end; + +function TcxContainer.DefaultParentColor: Boolean; +begin + Result := False; +end; + +procedure TcxContainer.EnabledChanged; +var + I: Integer; +begin + for I := 0 to ControlCount - 1 do + if Controls[I] is TcxScrollBar then + TcxScrollBar(Controls[I]).Enabled := Enabled; + ShortRefreshContainer(False); +end; + +procedure TcxContainer.EndMouseTracking; +begin + MouseLeave(nil); + cxControls.EndMouseTracking(Self); +end; + +function TcxContainer.GetActiveStyle: TcxContainerStyle; +begin + if FActiveStyleData.ContainerState = ViewInfo.ContainerState then + Result := FActiveStyleData.ActiveStyle + else + begin + FActiveStyleData.ContainerState := ViewInfo.ContainerState; + FActiveStyleData.ActiveStyle := InternalGetActiveStyle; + Result := FActiveStyleData.ActiveStyle; + end; +end; + +function TcxContainer.GetBorderExtent: TRect; +var + ABorderWidth: Integer; + ANativeStyle: Boolean; +begin + ANativeStyle := IsNativeStyle; + if ActiveStyle.TransparentBorder and (Style.LookAndFeel.SkinPainter = nil) then + Result := cxContainerDefaultBorderExtent + else + if not ActiveStyle.HasBorder or ANativeStyle and (Style.BorderStyle = cbsNone) then + Result := cxEmptyRect + else + if ANativeStyle then + Result := cxContainerDefaultBorderExtent + else + begin + ABorderWidth := GetContainerBorderWidth(ViewInfo.BorderStyle); + Result := cxEmptyRect; + if bLeft in ActiveStyle.Edges then + Result.Left := ABorderWidth; + if bTop in ActiveStyle.Edges then + Result.Top := ABorderWidth; + if bRight in ActiveStyle.Edges then + Result.Right := ABorderWidth; + if bBottom in ActiveStyle.Edges then + Result.Bottom := ABorderWidth; + end; + if HasShadow then + begin + Inc(Result.Right, cxContainerShadowWidth); + Inc(Result.Bottom, cxContainerShadowWidth); + end; +end; + +function TcxContainer.GetInnerControlBounds(const AInnerControlsRegion: TRect; + AInnerControl: TControl): TcxContainerInnerControlBounds; +var + R: TRect; +begin + if AInnerControl = nil then + begin + Result.IsEmpty := True; + Exit; + end; + + Result.IsEmpty := False; + Result.Rect := GetControlRect(AInnerControl); + R := Result.Rect; + with AInnerControl.BoundsRect do + begin + if Left < AInnerControlsRegion.Left then + Result.Rect.Left := AInnerControlsRegion.Left - Left; + if Top < AInnerControlsRegion.Top then + Result.Rect.Top := AInnerControlsRegion.Top - Top; + if Right > AInnerControlsRegion.Right then + Dec(Result.Rect.Right, Right - AInnerControlsRegion.Right); + if Bottom > AInnerControlsRegion.Bottom then + Dec(Result.Rect.Bottom, Bottom - AInnerControlsRegion.Bottom); + end; + if EqualRect(Result.Rect, R) then + Result.IsEmpty := True; +end; + +function TcxContainer.GetShadowBounds: TRect; +var + ABorderWidth: Integer; +begin + Result := ViewInfo.Bounds; + ExtendRect(Result, GetBorderExtent); + ABorderWidth := GetContainerBorderWidth(ViewInfo.GetContainerBorderStyle); + InflateRect(Result, ABorderWidth, ABorderWidth); + InflateRectByBorders(Result, ABorderWidth, ActiveStyle.Edges); +end; + +function TcxContainer.GetStyleClass: TcxContainerStyleClass; +begin + Result := TcxContainerStyle; +end; + +function TcxContainer.GetStylesClass: TcxContainerStylesClass; +begin + Result := TcxContainerStyles; +end; + +function TcxContainer.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxContainerViewInfo; +end; + +function TcxContainer.HasShadow: Boolean; +begin + Result := ActiveStyle.Shadow and not IsNativeStyle; +end; + +procedure TcxContainer.InnerControlWndProc(var Message: TMessage); +begin + FSaveInnerControlWndProc(Message); +end; + +function TcxContainer.InternalGetActiveStyle: TcxContainerStyle; +begin + if csDisabled in ViewInfo.ContainerState then + Result := FStyles.StyleDisabled + else if csActive in ViewInfo.ContainerState then + Result := FStyles.StyleFocused + else if Style.HotTrack and (csHotTrack in ViewInfo.ContainerState) then + Result := FStyles.StyleHot + else + Result := FStyles.Style; +end; + +function TcxContainer.InternalGetNotPublishedStyleValues: TcxContainerStyleValues; +begin + Result := []; +end; + +function TcxContainer.IsAlignControlsLocked: Boolean; +begin + Result := FLockAlignControlsCount > 0; +end; + +function TcxContainer.IsInnerControlBoundsChanged(AControl: TWinControl; + const ABounds: TcxContainerInnerControlBounds): Boolean; +begin + Result := (AControl = nil) or (AControl <> FInnerControl); + if not Result and not (FInnerControlBounds.IsEmpty and ABounds.IsEmpty) then + begin + Result := FInnerControlBounds.IsEmpty or ABounds.IsEmpty; + if not Result then + Result := not EqualRect(FInnerControlBounds.Rect, ABounds.Rect); + end; +end; + +function TcxContainer.IsContainerClass: Boolean; +begin + Result := False; +end; + +function TcxContainer.IsPopupMenuLocked: Boolean; +begin + Result := FPopupMenuLockCount > 0; +end; + +function TcxContainer.IsReadOnly: Boolean; +begin + Result := False; +end; + +function TcxContainer.IsTransparentBackground: Boolean; +begin + Result := False; +end; + +function TcxContainer.RefreshContainer(const P: TPoint; Button: TcxMouseButton; + Shift: TShiftState; AIsMouseEvent: Boolean): Boolean; +begin + Result := True; + if FIsRefreshLocked or IsDestroying then + Exit; + IsViewInfoCalculated := True; + CalculateViewInfo(P, (Shift = []) and ActiveStyle.HotTrack); + SetSize; + AdjustInnerControl; + SetShadowRegion; + if FInnerControl = nil then + InvalidateRect(GetControlRect(Self), False) + else + InternalInvalidate(Handle, GetControlRect(Self), ViewInfo.BorderRect, False); + + if csHotTrack in ViewInfo.ContainerState then + BeginMouseTracking(Self, VisibleBounds, Self); +end; + +procedure TcxContainer.SaveInnerControlBounds(AControl: TWinControl; + const ABounds: TcxContainerInnerControlBounds); +begin + FInnerControlBounds := ABounds; +end; + +procedure TcxContainer.SetShadowRegion; +begin + if HandleAllocated then + SetWindowShadowRegion(Handle, GetShadowBounds, not CanHaveTransparentBorder, + ViewInfo.Shadow, cxEmptyRect); +end; + +procedure TcxContainer.SetSize; +begin + if InnerControl = nil then + Exit; + if not EqualRect(InnerControl.BoundsRect, ViewInfo.ClientRect) then + begin + FIsRefreshLocked := True; + try + with ViewInfo.ClientRect do + InnerControl.SetBounds(Left, Top, Right - Left, Bottom - Top); + finally + FIsRefreshLocked := False; + end; + end; +end; + +procedure TcxContainer.SetVisibleBoundsClipRect; +var + AClipRgn: TcxRegionHandle; +begin + AClipRgn := GetWindowShadowRegion(Handle, GetShadowBounds, + not CanHaveTransparentBorder, ViewInfo.Shadow, cxEmptyRect); + if AClipRgn <> 0 then + Canvas.SetClipRegion(TcxRegion.Create(AClipRgn), roIntersect); +end; + +procedure TcxContainer.UpdateData; +begin +end; + +procedure TcxContainer.AdjustScrollBarPosition(AScrollBar: TcxScrollBar); +var + AScrollBarInfo: TcxScrollBarInfo; + R: TRect; +begin + if GetScrollBarInfo(AScrollBarInfo, AScrollBar.Kind) and + IsAdjustingScrollBarPositionNeeded(AScrollBarInfo) then + begin + AScrollBar.Enabled := GetScrollBarEnabled(AScrollBar, AScrollBarInfo); + R := GetScrollBarBounds(AScrollBarInfo.rcScrollBar); + AScrollBar.SetBounds(R.Left, R.Top, R.Right, R.Bottom); + SetScrollBarVisible(AScrollBar, (R.Right > 0) and (R.Bottom > 0)); + end + else + SetScrollBarVisible(AScrollBar, False); +end; + +function TcxContainer.GetBackgroundThemedObjectType: TdxThemedObjectType; +begin + Result := totEdit; +end; + +function TcxContainer.GetBackgroundNativePart: Integer; +begin + if IsCompositionEnabled then + Result := EP_BACKGROUND + else + Result := EP_EDITTEXT; +end; + +function TcxContainer.GetBackgroundNativeState: Integer; +begin + with ViewInfo do + begin + if not Enabled then + Result := ETS_DISABLED + else if IsReadOnly then + Result := ETS_READONLY + else if Focused then + Result := ETS_FOCUSED + else if csHotTrack in ContainerState then + Result := ETS_HOT + else + Result := ETS_NORMAL; + end; +end; + +function TcxContainer.GetScrollBarBounds(const AScrollBarRect: TRect): TRect; +begin + with AScrollBarRect do + begin + Result.TopLeft := ScreenToClient(TopLeft); + Result.Right := Right - Left; + Result.Bottom := Bottom - Top; + end; + if (Result.Left < 0) or (Result.Right > Width) or + (Result.Top < 0) or (Result.Bottom > Height) then + Result := cxEmptyRect; +end; + +function TcxContainer.GetScrollBarEnabled(AScrollBar: TcxScrollBar; + const AScrollBarinfo: TcxScrollBarInfo): Boolean; +begin + Result := (AScrollBar.Parent <> nil) and + AScrollBar.Parent.Enabled and + (AScrollBarInfo.rgstate[0] and STATE_SYSTEM_UNAVAILABLE = 0); +end; + +function TcxContainer.GetScrollBarInfo(var AScrollBarInfo: TcxScrollBarInfo; + const AKind: TScrollBarKind): Boolean; +const + AScrollBarObjects: array [TScrollBarKind] of Longword = (OBJID_HSCROLL, OBJID_VSCROLL); +begin + Result := not IsDestroying and (Parent <> nil) and HandleAllocated and + FInnerControl.HandleAllocated; + if Result then + begin + Result := cxGetScrollBarInfo(FInnerControl.Handle, + Integer(AScrollBarObjects[AKind]), AScrollBarInfo); + end; +end; + +function TcxContainer.IsAdjustingScrollBarPositionNeeded( + const AScrollBarInfo: TcxScrollBarInfo): Boolean; +begin + Result := AScrollBarInfo.rgstate[0] and + (STATE_SYSTEM_INVISIBLE or STATE_SYSTEM_OFFSCREEN) = 0; +end; + +function TcxContainer.IsNativeStyle: Boolean; +begin + Result := AreVisualStylesMustBeUsed(Style.LookAndFeel.NativeStyle, + GetBackgroundThemedObjectType); +end; + +procedure TcxContainer.SafeSelectionFocusInnerControl; +begin + InnerControl.SetFocus; +end; + +procedure TcxContainer.SetDragKind(Value: TDragKind); +begin + inherited DragKind := Value; + if InnerControl <> nil then + TWinControlAccess(InnerControl).DragKind := Value; +end; + +procedure TcxContainer.SetScrollBarVisible(AScrollBar: TcxScrollBar; + AVisible: Boolean); +begin + AScrollBar.Visible := AVisible; + if AVisible then + begin + AScrollBar.Ctl3D := False; + AScrollBar.BringToFront; + end; +end; + +function TcxContainer.GetActiveControl: TWinControl; +begin + if FInnerControl = nil then + Result := Self + else + Result := FInnerControl; +end; + +function TcxContainer.GetFakeStyleController: TcxStyleController; +begin + Result := Style.StyleController; +end; + +function TcxContainer.GetInternalStyle(AState: TcxContainerStateItem): TcxContainerStyle; +begin + Result := FStyles[AState]; +end; + +function TcxContainer.GetIsDestroying: Boolean; +begin + Result := (csDestroying in ComponentState) or FIsDestroying; +end; + +function TcxContainer.GetStyle: TcxContainerStyle; +begin + Result := TcxContainerStyle(FStyles.Style); +end; + +function TcxContainer.GetStyleDisabled: TcxContainerStyle; +begin + Result := TcxContainerStyle(FStyles.StyleDisabled); +end; + +function TcxContainer.GetStyleFocused: TcxContainerStyle; +begin + Result := TcxContainerStyle(FStyles.StyleFocused); +end; + +function TcxContainer.GetStyleHot: TcxContainerStyle; +begin + Result := TcxContainerStyle(FStyles.StyleHot); +end; + +procedure TcxContainer.SetFakeStyleController(Value: TcxStyleController); +begin +end; + +procedure TcxContainer.SetInnerControl(Value: TWinControl); +begin + if FInnerControl <> Value then + begin + if FInnerControl <> nil then + FInnerControl.RemoveFreeNotification(Self); + FInnerControl := Value; + if FInnerControl <> nil then + FInnerControl.FreeNotification(Self); + end; +end; + +procedure TcxContainer.SetStyle(Value: TcxContainerStyle); +begin + FStyles.Style := Value; +end; + +procedure TcxContainer.SetStyleDisabled(Value: TcxContainerStyle); +begin + FStyles.StyleDisabled := Value; +end; + +procedure TcxContainer.SetStyleFocused(Value: TcxContainerStyle); +begin + FStyles.StyleFocused := Value; +end; + +procedure TcxContainer.SetStyleHot(Value: TcxContainerStyle); +begin + FStyles.StyleHot := Value; +end; + +procedure TcxContainer.SetInternalStyle(AState: TcxContainerStateItem; + Value: TcxContainerStyle); +begin + FStyles[AState] := Value; +end; + +function TcxContainer.GetDragKind: TDragKind; +begin + Result := inherited DragKind; +end; + +procedure TcxContainer.WMKillFocus(var Message: TWMKillFocus); +begin + if InnerControl <> nil then + begin + if not InnerControl.HandleAllocated or (Message.FocusedWnd <> InnerControl.Handle) then + begin + inherited; + Exit; + end; + Message.Msg := 0; + Message.Result := 0; + end + else + inherited; +end; + +procedure TcxContainer.WMNCPaint(var Message: TWMNCPaint); +begin + Message.Result := 0; +end; + +procedure TcxContainer.WMSetCursor(var Message: TWMSetCursor); +begin + with Message do + if (FInnerControl <> nil) and (CursorWnd = Handle) and + (Smallint(HitTest) = HTCLIENT) and not PtInRect(ViewInfo.ClientRect, ScreenToClient(InternalGetCursorPos)) then + begin + Windows.SetCursor(Screen.Cursors[crArrow]); + Result := 1; + Exit; + end; + inherited; +end; + +procedure TcxContainer.WMSetFocus(var Message: TWMSetFocus); +begin + if not IsDestroying and HandleAllocated and (InnerControl <> nil) and + InnerControl.HandleAllocated then + begin + if Message.FocusedWnd <> InnerControl.Handle then + begin + inherited; + if InnerControl.CanFocus then + InnerControl.SetFocus; + Exit; + end; + Message.Msg := 0; + Message.Result := 0; + end + else + inherited; +end; + +procedure TcxContainer.WMWindowPosChanged(var Message: TWMWindowPosChanged); +begin + inherited; + if not IsDestroying and IsTransparentBackground then + ShortRefreshContainer(False); +end; + +procedure TcxContainer.WMWindowPosChanging(var Message: TWMWindowPosChanging); +var + AParentForm: TCustomForm; +begin + if IsDestroying then + begin + Message.Result := 0; + Exit; + end + else + inherited; + if (GetFocus = Handle) and (InnerControl <> nil) and InnerControl.HandleAllocated and + InnerControl.CanFocus then + begin + AParentForm := GetParentForm(Self); + AParentForm.FocusControl(InnerControl); + end; +end; + +procedure TcxContainer.CMCtl3DChanged(var Message: TMessage); +begin + inherited; + ShortRefreshContainer(False); +end; + +procedure TcxContainer.CMEnabledChanged(var Message: TMessage); +begin + inherited; + EnabledChanged; +end; + +procedure TcxContainer.CMFontChanged(var Message: TMessage); +var + APrevIsFontAssigned: Boolean; +begin + if not FInternalSetting then + begin + APrevIsFontAssigned := csvFont in Style.FAssignedValues; + Style.Font := Font; + if not APrevIsFontAssigned then + Exclude(Style.FAssignedValues, csvFont); + inherited; + end + else + begin + inherited; + SetSize; + SetScrollBarsParameters; + ShortRefreshContainer(False); + end; +end; + +procedure TcxContainer.CMParentColorChanged(var Message: TMessage); +var + APrevIsStyleColorAssigned: Boolean; +begin + APrevIsStyleColorAssigned := csvColor in FStyles.Style.FAssignedValues; + inherited; // TODO CLX ??? + if not APrevIsStyleColorAssigned or ParentColor then + Exclude(FStyles.Style.FAssignedValues, csvColor); + if Color <> Style.Color then + ContainerStyleChanged(Style); + + if IsTransparentBackground and not ParentColor then + Invalidate; +end; + +procedure TcxContainer.CMShortRefreshContainer(var Message: TMessage); +begin + ShortRefreshContainer(False); +end; + +procedure TcxContainer.CMParentFontChanged(var Message: TMessage); +var + APrevIsStyleFontAssigned: Boolean; +begin + APrevIsStyleFontAssigned := csvFont in FStyles.Style.FAssignedValues; + inherited; // TODO CLX ??? + if not ParentFont then + FStyles.Style.UpdateFont; + if not APrevIsStyleFontAssigned or ParentFont then + Exclude(FStyles.Style.FAssignedValues, csvFont); +end; + +procedure TcxContainer.CMSysColorChange(var Message: TMessage); +begin + inherited; + ShortRefreshContainer(False); +end; + +procedure TcxContainer.CMUpdateScrollBars(var Message: TMessage); +begin + SetScrollBarsParameters; +end; + +{ TcxCustomPopupWindow } + +constructor TcxCustomPopupWindow.Create(AOwnerControl: TWinControl); +begin + inherited Create; + FormStyle := fsNormal; + Visible := False; + + FStyle := GetStyleClass.Create(Self, False); + FStyle.OnChanged := PopupWindowStyleChanged; + FViewInfo := GetViewInfoClass.Create; + + FCaptureFocus := True; + FOwnerControl := AOwnerControl; + + KeyPreview := True; + FModalMode := True; +end; + +destructor TcxCustomPopupWindow.Destroy; +begin + cxClearObjectLinks(Self); +{$IFDEF DELPHI9} + PopupMode := pmNone; // to set FInternalPopupParent to nil +// PopupParent := nil; +{$ENDIF} + if IsVisible and (FVisiblePopupWindowList.IndexOf(Self) <> -1) then + UnregisterVisiblePopupWindow(Self); + FreeAndNil(FViewInfo); + FStyle.OnChanged := nil; + FreeAndNil(FStyle); + inherited Destroy; +end; + +function TcxCustomPopupWindow.Focused: Boolean; +var + AFocusedControl: TcxNativeHandle; + AIndex: Integer; +begin + Result := False; + AIndex := FVisiblePopupWindowList.IndexOf(Self); + if AIndex = -1 then + Exit; + if CaptureFocus then + begin + AFocusedControl := GetFocus; + Result := HasNativeHandle(Self, AFocusedControl, True); + end; +end; + +{$IFDEF DELPHI5} +function TcxCustomPopupWindow.CanFocus: Boolean; +begin + Result := Visible; +end; +{$ENDIF} + +procedure TcxCustomPopupWindow.ClosePopup; +begin + PostMessage(NativeHandle(Handle), CM_CLOSEPOPUPWINDOW, 0, 0); +end; + +procedure TcxCustomPopupWindow.CloseUp; + + procedure CorrectScreenActiveForm; + var + AFocusedControl: TWinControl; + AParentForm: TCustomForm; + begin + if Screen.ActiveForm = Self then + begin + AFocusedControl := FindControl(GetFocus); + if AFocusedControl <> nil then + begin + AParentForm := GetParentForm(AFocusedControl); + if (AParentForm <> nil) and (AParentForm <> Self) then + AParentForm.SetFocusedControl(AFocusedControl); + end; + end; + end; + +var + AParentForm: TCustomForm; +begin + if FVisiblePopupWindowList.IndexOf(Self) = -1 then + Exit; + + LockCMActivateMessages(True); + try + UnregisterVisiblePopupWindow(Self); + DoClosing; + + FPopupWindowShowing := True; + FBeingShownPopupWindow := Self; + ShowWindow(NativeHandle(Handle), SW_HIDE); + Hide; + DoClosed; + if HandleAllocated and HasNativeHandle(Self, GetCapture, True) then + SetCaptureControl(nil); + CorrectScreenActiveForm; + finally + FPopupWindowShowing := False; + LockCMActivateMessages(False); + end; + + if FVisiblePopupWindowList.Count = 0 then + begin + AParentForm := GetParentForm(OwnerControl); + if (AParentForm <> nil) and AParentForm.HandleAllocated and not AParentForm.Active then + SendMessage(AParentForm.Handle, WM_NCACTIVATE, 0, 0); + end; +end; + +procedure TcxCustomPopupWindow.CorrectBoundsWithDesktopWorkArea( + var APosition: TPoint); +var + ADesktopWorkArea: TRect; + AWidth, AHeight: Integer; +begin + if not AcceptsAnySize then + Exit; + + AWidth := Width; + AHeight := Height; + ADesktopWorkArea := GetDesktopWorkArea(APosition); + with APosition do + begin + if X < ADesktopWorkArea.Left then + begin + AWidth := AWidth + X - ADesktopWorkArea.Left; + X := ADesktopWorkArea.Left; + end; + if Y < ADesktopWorkArea.Top then + begin + AHeight := AHeight + Y - ADesktopWorkArea.Top; + Y := ADesktopWorkArea.Top; + end; + if AWidth > ADesktopWorkArea.Right - X then + AWidth := ADesktopWorkArea.Right - X; + if AHeight > ADesktopWorkArea.Bottom - Y then + AHeight := ADesktopWorkArea.Bottom - Y; + Width := AWidth; + Height := AHeight; + if (Height <> AHeight) and (Y = ADesktopWorkArea.Top) then + Inc(APosition.Y, AHeight - Height); + end; +end; + +function TcxCustomPopupWindow.GetStyleClass: TcxContainerStyleClass; +begin + Result := TcxContainerStyle; +end; + +function TcxCustomPopupWindow.GetViewInfoClass: TcxContainerViewInfoClass; +begin + Result := TcxContainerViewInfo; +end; + +function TcxCustomPopupWindow.HasCapture: Boolean; +begin + Result := HasNativeHandle(Self, GetCapture); +end; + +function TcxCustomPopupWindow.IsShortCut(var Message: TWMKey): Boolean; +var + AParentForm: TCustomForm; +begin + Result := inherited IsShortCut(Message); + if not Result then + begin + AParentForm := GetParentForm(OwnerControl); + if AParentForm <> nil then + Result := AParentForm.IsShortCut(Message); + end; +end; + +function TcxCustomPopupWindow.IsVisible: Boolean; +begin + Result := (FVisiblePopupWindowList <> nil) and + (FVisiblePopupWindowList.IndexOf(Self) <> -1); +end; + +procedure TcxCustomPopupWindow.LockDeactivate(ALock: Boolean); +begin + if ALock then + Inc(FDeactivateLockCount) + else + Dec(FDeactivateLockCount); +end; + +procedure TcxCustomPopupWindow.AdjustClientRect(var Rect: TRect); +begin + Rect := ViewInfo.ClientRect; +end; + +procedure TcxCustomPopupWindow.Deactivate; +var + AActiveWnd: TcxHandle; + APopupWindow: TcxCustomPopupWindow; + I: Integer; +begin + FDeactivation := False; + if IsDeactivateLocked then + Exit; + + if FVisiblePopupWindowList.Count > 0 then + begin + AActiveWnd := GetActiveWindow; + for I := FVisiblePopupWindowList.Count - 1 downto 0 do + begin + APopupWindow := TcxCustomPopupWindow(FVisiblePopupWindowList[I]); + if HasHandle(APopupWindow, AActiveWnd) then + Exit; + if IsWindowEnabled(APopupWindow.Handle) and not APopupWindow.IsDeactivateLocked then + APopupWindow.CloseUp; + end; + end; + if FVisiblePopupWindowList.Count > 0 then CloseUp; +end; + +function TcxCustomPopupWindow.GetOwnerScreenBounds: TRect; +begin + Result := OwnerBounds; + if IsChildClassWindow(OwnerControl.Handle) then + with Result do + begin + TopLeft := OwnerParent.ClientToScreen(TopLeft); + BottomRight := OwnerParent.ClientToScreen(BottomRight); + end; +end; + +procedure TcxCustomPopupWindow.InitPopup; +begin +end; + +procedure TcxCustomPopupWindow.KeyDown(var Key: Word; Shift: TShiftState); +begin + if IsVisible and HasCapture and (Key = VK_ESCAPE) then + begin + SetCaptureControl(nil); + Key := 0; + end + else + inherited KeyDown(Key, Shift); +end; + +procedure TcxCustomPopupWindow.Paint; +begin + ViewInfo.Paint(Canvas); +end; + +procedure TcxCustomPopupWindow.VisibleChanged; +var + AParentForm: TCustomForm; +begin + inherited VisibleChanged; + if CaptureFocus and (OwnerControl <> nil) and HandleAllocated and + not IsWindowVisible(NativeHandle(Handle)) then + begin + AParentForm := GetParentForm(FOwnerControl); + if (AParentForm <> nil) and HasNativeHandle(AParentForm, GetFocus) and + OwnerControl.CanFocus and not (csDesigning in AParentForm.ComponentState) then + OwnerControl.SetFocus; + end; +end; + +procedure TcxCustomPopupWindow.CreateHandle; +var + AIsInVisiblePopupWindowList: Boolean; +begin + AIsInVisiblePopupWindowList := False; + if FVisiblePopupWindowList.IndexOf(Self) = -1 then + RegisterVisiblePopupWindow(Self) + else + AIsInVisiblePopupWindowList := True; + try + inherited CreateHandle; + finally + if not AIsInVisiblePopupWindowList then + UnregisterVisiblePopupWindow(Self); + end; +end; + +procedure TcxCustomPopupWindow.CreateParams(var Params: TCreateParams); +var + AParentForm: TCustomForm; +begin + inherited CreateParams(Params); + with Params do + begin + if CaptureFocus then + begin + AParentForm := GetParentForm(OwnerControl); + if AParentForm <> nil then + WndParent := AParentForm.Handle; + Style := Style and not WS_CHILD; + Style := Style or WS_POPUP; +// ExStyle := ExStyle or WS_EX_TOOLWINDOW; + if FIsTopMost and ((AParentForm = nil) or (GetWindowLong(AParentForm.Handle, + GWL_EXSTYLE) and WS_EX_TOPMOST <> 0)) then + ExStyle := ExStyle or WS_EX_TOPMOST; + end else + begin + Style := WS_CHILD; + ExStyle := ExStyle or WS_EX_TOOLWINDOW; + if Params.WndParent = 0 then + Params.WndParent := cxMessageWindow.Handle; + end; + Style := Style or WS_CLIPCHILDREN; + end; +end; + +procedure TcxCustomPopupWindow.CreateWnd; +begin +{$IFDEF DELPHI9} + if CaptureFocus then + PopupParent := GetParentForm(FOwnerControl) + else + PopupParent := nil; +{$ENDIF} + inherited CreateWnd; + if not CaptureFocus then + Windows.SetParent(Handle, 0); +end; + +procedure TcxCustomPopupWindow.PopupWindowStyleChanged(Sender: TObject); +begin +end; + +procedure TcxCustomPopupWindow.RecreateWindow; +begin + if HandleAllocated then + RecreateWnd; +end; + +procedure TcxCustomPopupWindow.Popup(AFocusedControl: TWinControl); + + function IsTopMostPopupWindow: Boolean; + var + I: Integer; + AParentForm: TCustomForm; + begin + AParentForm := GetParentForm(OwnerControl); + Result := (AParentForm = nil) or + (GetWindowLong(AParentForm.Handle, GWL_EXSTYLE) and WS_EX_TOPMOST <> 0); + if not Result and not CaptureFocus then + for I := 0 to Screen.FormCount - 1 do + if (Screen.Forms[I].FormStyle = fsStayOnTop) and not Screen.Forms[I].Visible then + begin + Result := True; + Break; + end; + end; + + function GetPopupWindowShowingFlags: UINT; + begin + if IsTopMostPopupWindow or (not CaptureFocus and TopMostComboBoxes) then + Result := HWND_TOPMOST + else + Result := 0; + end; + + procedure ShowPopupWindow; + var + P: TPoint; + begin + InitPopup; + CalculateSize; + P := CalculatePosition; + CorrectBoundsWithDesktopWorkArea(P); + FPopupWindowShowing := True; + FCaptionInactivationLocked := True; + FBeingShownPopupWindow := Self; + try + RegisterVisiblePopupWindow(Self); + DoShowing; + SetBounds(P.X, P.Y, Width, Height); + Show; + {$IFDEF DELPHI8} + SetBounds(P.X, P.Y, Width, Height); + {$ENDIF} + if CaptureFocus then + FFocusedControl := GetFirstFocusControl(AFocusedControl) + else + FFocusedControl := AFocusedControl; + if FFocusedControl = nil then + SetFocus + else + FFocusedControl.SetFocus; + SetWindowPos(NativeHandle(Handle), GetPopupWindowShowingFlags, 0, 0, 0, 0, + SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE or SWP_SHOWWINDOW); + finally + FPopupWindowShowing := False; + FCaptionInactivationLocked := False; + end; + end; + +var + Msg: TMsg; + ALinkSelf: TcxObjectLink; +begin + if (FVisiblePopupWindowList.IndexOf(Self) <> -1) or not IsOwnerControlVisible then + Exit; + + ShowPopupWindow; + ModalResult := mrNone; + DoShowed; + if FCaptureFocus and ModalMode then + begin + ALinkSelf := cxAddObjectLink(Self); + try + while (ALinkSelf.Ref <> nil) and Visible and not Application.Terminated do + begin + if PeekMessage(Msg, 0, WM_SYSKEYDOWN, WM_SYSKEYDOWN, PM_NOREMOVE) then + case Msg.wParam of + Windows.VK_MENU, Windows.VK_RETURN, Windows.VK_SPACE: + PeekMessage(Msg, 0, Msg.message, Msg.message, PM_REMOVE); + end; + if ModalResult <> mrNone then + if CloseQuery then + ModalCloseUp + else + ModalResult := mrNone; + Application.HandleMessage; + end; + finally + cxRemoveObjectLink(ALinkSelf); + end; + end; +end; + +function TcxCustomPopupWindow.SetFocusedControl(Control: TWinControl): Boolean; +begin + LockCMActivateMessages(True); + try + Result := inherited SetFocusedControl(Control); + finally + LockCMActivateMessages(False); + end; +end; + +function TcxCustomPopupWindow.AcceptsAnySize: Boolean; +begin + Result := False; +end; + +procedure TcxCustomPopupWindow.DoClosed; +begin + if Assigned(FOnClosed) then + FOnClosed(Self); +end; + +procedure TcxCustomPopupWindow.DoClosing; +begin + if Assigned(FOnClosing) then + FOnClosing(Self); +end; + +procedure TcxCustomPopupWindow.DoShowed; +begin + if Assigned(FOnShowed) then + FOnShowed(Self); +end; + +procedure TcxCustomPopupWindow.DoShowing; +begin + if Assigned(FOnShowing) then + FOnShowing(Self); +end; + +function TcxCustomPopupWindow.GetFirstFocusControl(AControl: TWinControl): TWinControl; +begin + if AControl = nil then + Result := Self + else + if AControl.CanFocus and AControl.TabStop then + Result := AControl + else + begin + Result := FindNextControl(nil, True, True, False); + if Result = nil then + Result := Self; + end; +end; + +function TcxCustomPopupWindow.HasBackground; +begin + Result := False; +end; + +function TcxCustomPopupWindow.IsDeactivateLocked: Boolean; +begin + Result := FDeactivateLockCount <> 0; +end; + +function TcxCustomPopupWindow.IsOwnerControlVisible: Boolean; +begin + Result := OwnerControl.HandleAllocated and IsWindowVisible(OwnerControl.Handle); +end; + +function TcxCustomPopupWindow.IsSysKeyAccepted(Key: Word): Boolean; +begin + case Key of + Windows.VK_F4, Windows.VK_LEFT, Windows.VK_RIGHT, Windows.VK_UP, + Windows.VK_DOWN, Windows.VK_PRIOR, Windows.VK_NEXT, Windows.VK_HOME, + Windows.VK_END: + Result := True; + else + Result := False; + end; +end; + +procedure TcxCustomPopupWindow.ModalCloseUp; +begin + CloseUp; +end; + +procedure TcxCustomPopupWindow.MouseEnter(AControl: TControl); +begin +end; + +procedure TcxCustomPopupWindow.MouseLeave(AControl: TControl); +begin +end; + +function TcxCustomPopupWindow.NeedIgnoreMouseMessageAfterCloseUp(AWnd: THandle; + AMsg: Cardinal; AShift: TShiftState; const APos: TPoint): Boolean; +begin + Result := False; +end; + +function TcxCustomPopupWindow.GetJustClosed: Boolean; +begin + Result := FJustClosed; + FJustClosed := False; +end; + +procedure TcxCustomPopupWindow.SetCaptureFocus(Value: Boolean); +begin + if Value <> FCaptureFocus then + begin + FCaptureFocus := Value; + RecreateWindow; + if IsVisible then + begin + CloseUp; + Popup(FocusedControl); + end; + end; +end; + +procedure TcxCustomPopupWindow.SetIsTopMost(Value: Boolean); +begin + if Value <> FIsTopMost then + begin + FIsTopMost := Value; + RecreateWindow; + if IsVisible then + begin + CloseUp; + Popup(FocusedControl); + end; + end; +end; + +procedure TcxCustomPopupWindow.WMActivateApp(var Message: TWMActivateApp); +begin +end; + +procedure TcxCustomPopupWindow.WMEraseBkgnd(var Message: TWMEraseBkgnd); +begin + if HasBackground then + inherited + else + Message.Result := 1; +end; + +procedure TcxCustomPopupWindow.CMClosePopupWindow(var Message: TMessage); +begin + LockDeactivate(True); + try + CloseUp; + finally + LockDeactivate(False); + end; + if OwnerControl.HandleAllocated then + SendMessage(OwnerControl.Handle, WM_SETFOCUS, 0, 0); +end; + +procedure TcxCustomPopupWindow.CMMouseEnter(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseEnter(Self) + else + MouseEnter(TControl(Message.lParam)); +end; + +procedure TcxCustomPopupWindow.CMMouseLeave(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseLeave(Self) + else + MouseLeave(TControl(Message.lParam)); +end; + +procedure TcxCustomPopupWindow.CMShowPopupWindow(var Message: TMessage); +begin + Popup(FocusedControl); +end; + +{ TcxCustomInnerListBox } + +constructor TcxCustomInnerListBox.Create(AOwner: TComponent); +begin + inherited Create(AOwner); +{$IFNDEF DELPHI6} + FAutoComplete := True; +{$ENDIF} +{$IFNDEF DELPHI8} + FAutoCompleteDelay := cxDefaultAutoCompleteDelay; +{$ENDIF} + FCanvas := TcxCanvas.Create(inherited Canvas); + CreateScrollBars; + FLookAndFeel := TcxLookAndFeel.Create(Self); + FLookAndFeel.OnChanged := LookAndFeelChanged; + FHScrollBar.LookAndFeel.MasterLookAndFeel := FLookAndFeel; + FVScrollBar.LookAndFeel.MasterLookAndFeel := FLookAndFeel; + BorderStyle := bsNone; + ControlStyle := ControlStyle + [csDoubleClicks] - [csOpaque]; + ParentColor := False; + ParentFont := True; +end; + +destructor TcxCustomInnerListBox.Destroy; +begin + if (FHScrollBar <> nil) and (FHScrollBar.Parent = nil) then + FreeAndNil(FHScrollBar); + if (FVScrollBar <> nil) and (FVScrollBar.Parent = nil) then + FreeAndNil(FVScrollBar); + FreeAndNil(FLookAndFeel); + FreeAndNil(FCanvas); + inherited Destroy; +end; + +procedure TcxCustomInnerListBox.DefaultHandler(var Message); +begin + if (Container = nil) or + not Container.InnerControlDefaultHandler(TMessage(Message)) then + inherited DefaultHandler(Message); +end; + +procedure TcxCustomInnerListBox.DragDrop(Source: TObject; X, Y: Integer); +begin + if Container <> nil then + Container.DragDrop(Source, Left + X, Top + Y); +end; + +procedure TcxCustomInnerListBox.SetExternalScrollBarsParameters; + + procedure AdjustScrollBarPosition(AScrollBar: TcxScrollBar); + const + AScrollBarObjects: array [TScrollBarKind] of Longword = (OBJID_HSCROLL, OBJID_VSCROLL); + var + AScrollBarInfo: TcxScrollBarInfo; + AScrollBarState: DWORD; + AScrollBarVisible: Boolean; + R: TRect; + begin + AScrollBarVisible := False; + repeat + if Parent = nil then + Break; + if not cxGetScrollBarInfo(Handle, Integer(AScrollBarObjects[AScrollBar.Kind]), AScrollBarInfo) then + Break; + AScrollBarState := AScrollBarInfo.rgstate[0]; + if AScrollBarState and (STATE_SYSTEM_INVISIBLE or STATE_SYSTEM_OFFSCREEN) <> 0 then + Break; + AScrollBarVisible := True; + AScrollBar.Enabled := (AScrollBarState and STATE_SYSTEM_UNAVAILABLE = 0) and + (AScrollBar.Parent <> nil) and AScrollBar.Parent.Enabled; + with AScrollBarInfo.rcScrollBar do + begin + R.TopLeft := Parent.ScreenToClient(TopLeft); + R.Right := Right - Left; + R.Bottom := Bottom - Top; + end; + with R do + begin + if (Left < 0) or (Right > Width) or (Top < 0) or (Bottom > Height) then + AScrollBarVisible := False + else + AScrollBar.SetBounds(Left, Top, Right, Bottom); + end; + until True; + if AScrollBarVisible then + begin + Inc(FScrollBarsLockCount); + try + AScrollBar.Parent := Parent; + finally + Dec(FScrollBarsLockCount); + end; + AScrollBar.Ctl3D := False; + AScrollBar.BringToFront; + end + else + AScrollBar.SetBounds(0, 0, 0, 0); + AScrollBar.Visible := AScrollBarVisible; + end; + + procedure SetScrollBarParameters(AScrollBar: TcxScrollBar); + const + ABarFlags: array [TScrollBarKind] of Integer = (SB_HORZ, SB_VERT); + var + AScrollInfo: TScrollInfo; + begin + AdjustScrollBarPosition(AScrollBar); + if not AScrollBar.Visible then + Exit; + + AScrollInfo.cbSize := SizeOf(AScrollInfo); + AScrollInfo.fMask := SIF_ALL; + GetScrollInfo(Handle, ABarFlags[AScrollBar.Kind], AScrollInfo); + with AScrollInfo do + begin + if Integer(nPage) > nMax then + Integer(nPage) := nMax; + AScrollBar.SetScrollParams(nMin, nMax, nPos, nPage, True); + end; + end; + +begin + if (csDestroying in ComponentState) or (FScrollBarsLockCount > 0) or + not UsecxScrollBars or IsRedrawLocked then + Exit; + FScrollBarsCalculating := True; + try + SetScrollBarParameters(FHScrollBar); + SetScrollBarParameters(FVScrollBar); + finally + FScrollBarsCalculating := False; + end; +end; + +{$IFNDEF DELPHI6} +procedure TcxCustomInnerListBox.AddItem(AItem: string; AObject: TObject); +var + S: string; +begin + SetString(S, PChar(AItem), StrLen(PChar(AItem))); + Items.AddObject(S, AObject); +end; + +procedure TcxCustomInnerListBox.ClearSelection; +var + I: Integer; +begin + if MultiSelect then + for I := 0 to Items.Count - 1 do + Selected[I] := False + else + ItemIndex := -1; +end; + +procedure TcxCustomInnerListBox.DeleteSelected; +var + I: Integer; +begin + if MultiSelect then + for I := Items.Count - 1 downto 0 do + begin + if Selected[I] then + Items.Delete(I); + end + else + if ItemIndex <> -1 then + Items.Delete(ItemIndex); +end; + +procedure TcxCustomInnerListBox.SelectAll; +var + I: Integer; +begin + if MultiSelect then + for I := 0 to Items.Count - 1 do + Selected[I] := True; +end; +{$ENDIF} + +function TcxCustomInnerListBox.ItemVisible(Index: Integer): Boolean; +var + R: TRect; +begin + R := GetControlRect(Self); + with ItemRect(Index) do + begin + Result := PtInRect(R, TopLeft); + Result := Result or PtInRect(R, Point(Right - 1, Top)); + Result := Result or PtInRect(R, Point(Left, Bottom - 1)); + Result := Result or PtInRect(R, Point(Right - 1, Bottom - 1)); + end; +end; + +procedure TcxCustomInnerListBox.Click; +begin + inherited Click; + FVScrollBar.Position := TopIndex; + if Container <> nil then + Container.Click; +end; + +procedure TcxCustomInnerListBox.DblClick; +begin + inherited DblClick; + if Container <> nil then + Container.DblClick; +end; + +procedure TcxCustomInnerListBox.DestroyWindowHandle; +begin + FIsRedrawLocked := False; + inherited DestroyWindowHandle; +end; + +procedure TcxCustomInnerListBox.DoAutoComplete(var Key: Char); +var + AIndex: Integer; + AMsg: TMsg; +begin + if not AutoComplete then + Exit; + if GetTickCount - FPrevKeyPressTime >= AutoCompleteDelay then + FAutoCompleteFilter := ''; + FPrevKeyPressTime := GetTickCount; + + if Key = Char(VK_BACK) then + begin + AIndex := Length(FAutoCompleteFilter); + while ByteType(FAutoCompleteFilter, AIndex) = mbTrailByte do + Dec(AIndex); + Delete(FAutoCompleteFilter, AIndex, Length(FAutoCompleteFilter) - AIndex + 1); + end + else + if Key in LeadBytes then + begin + if PeekMessage(AMsg, Handle, WM_CHAR, WM_CHAR, PM_REMOVE) then + begin + FAutoCompleteFilter := FAutoCompleteFilter + Key + Chr(AMsg.wParam); + Key := #0; + end; + end + else + FAutoCompleteFilter := FAutoCompleteFilter + Key; + + if Length(FAutoCompleteFilter) > 0 then + begin + AIndex := FindAutoCompleteString(FAutoCompleteFilter); + if AIndex <> -1 then + begin + if MultiSelect then + begin + ClearSelection; + SendMessage(Handle, LB_SELITEMRANGE, 1, MakeLParam(AIndex, AIndex)); + end; + ItemIndex := AIndex; + Click; + end; + if not (Ord(Key) in [VK_RETURN, VK_BACK, VK_ESCAPE]) then + Key := #0; + end + else + begin + ItemIndex := 0; + Click; + end; +end; + +function TcxCustomInnerListBox.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; +begin + Result := (Container <> nil) and Container.DoMouseWheel(Shift, + WheelDelta, MousePos); + if not Result then + Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos); +end; + +procedure TcxCustomInnerListBox.DragOver(Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); +begin + if Container <> nil then + Container.DragOver(Source, Left + X, Top + Y, State, Accept); +end; + +function TcxCustomInnerListBox.GetPopupMenu: TPopupMenu; +begin + if Container = nil then + Result := inherited GetPopupMenu + else + Result := Container.GetPopupMenu; +end; + +function TcxCustomInnerListBox.GetSizeGripRect: TRect; +var + R: TRect; +begin + if FHScrollBar.Visible and FVScrollBar.Visible then + begin + Result.TopLeft := Parent.ClientToScreen(Point(FVScrollBar.Left, FHScrollBar.Top)); + GetWindowRect(Handle, R); + Dec(Result.Left, R.Left); + Dec(Result.Top, R.Top); + Result.Right := Result.Left + FVScrollBar.Width; + Result.Bottom := Result.Top + FHScrollBar.Height; + end + else + Result := cxEmptyRect; +end; + +procedure TcxCustomInnerListBox.KeyDown(var Key: Word; Shift: TShiftState); +begin + if Container <> nil then + Container.KeyDown(Key, Shift); + if Key <> 0 then + inherited KeyDown(Key, Shift); +end; + +procedure TcxCustomInnerListBox.KeyPress(var Key: Char); +begin + if Key = Char(VK_TAB) then + Key := #0; + if (Key <> #0) and (Container <> nil) then + Container.KeyPress(Key); + if Key = Char(VK_RETURN) then + Key := #0; + if Key <> #0 then + begin + if Assigned(OnKeyPress) then + OnKeyPress(Self, Key); + if Key <> #0 then + DoAutoComplete(Key); + end; +end; + +procedure TcxCustomInnerListBox.KeyUp(var Key: Word; Shift: TShiftState); +begin + if (Key = VK_TAB) then + Key := 0; + if Container <> nil then + Container.KeyUp(Key, Shift); + if Key <> 0 then + inherited KeyUp(Key, Shift); +end; + +procedure TcxCustomInnerListBox.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + if HandleAllocated then + Invalidate; +end; + +procedure TcxCustomInnerListBox.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + if Container <> nil then + with Container do + begin + InnerControlMouseDown := True; + try + MouseDown(Button, Shift, X + Self.Left, Y + Self.Top); + finally + InnerControlMouseDown := False; + end; + end; +end; + +procedure TcxCustomInnerListBox.MouseEnter(AControl: TControl); +begin +end; + +procedure TcxCustomInnerListBox.MouseLeave(AControl: TControl); +begin + if Container <> nil then + Container.ShortRefreshContainer(True); +end; + +procedure TcxCustomInnerListBox.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + if Container <> nil then + Container.MouseMove(Shift, X + Left, Y + Top); +end; + +procedure TcxCustomInnerListBox.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + if Container <> nil then + Container.MouseUp(Button, Shift, X + Left, Y + Top); +end; + +procedure TcxCustomInnerListBox.DrawSizeGrip(ADC: HDC); +var + ABrush: HBRUSH; + AColor: TColor; +begin + if UsecxScrollBars and HScrollBar.Visible and VScrollBar.Visible then + begin + if Container = nil then + AColor := clBtnFace + else + AColor := Container.LookAndFeel.Painter.DefaultSizeGripAreaColor; + ABrush := CreateSolidBrush(ColorToRGB(AColor)); + try + FillRect(ADC, GetSizeGripRect, ABrush); + finally + DeleteObject(ABrush); + end; + end; +end; + +function TcxCustomInnerListBox.NeedDrawFocusRect: Boolean; +begin + Result := not Assigned(OnDrawItem); +end; + +procedure TcxCustomInnerListBox.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if Operation = opRemove then + if AComponent = FHScrollBar then + FHScrollBar := nil + else if AComponent = FVScrollBar then + FVScrollBar := nil; +end; + +procedure TcxCustomInnerListBox.RestoreCanvasParametersForFocusRect; +begin + Canvas.Brush.Color := FPrevBrushColor; + Canvas.Font.Color := FPrevFontColor; + TCanvasAccess(Canvas.Canvas).RequiredState([csHandleValid, csBrushValid]); +end; + +procedure TcxCustomInnerListBox.SaveCanvasParametersForFocusRect; +begin + FPrevBrushColor := Canvas.Brush.Color; + FPrevFontColor := Canvas.Font.Color; +end; + +procedure TcxCustomInnerListBox.WndProc(var Message: TMessage); +begin + if (Container <> nil) and Container.InnerControlMenuHandler(Message) then + Exit; + inherited WndProc(Message); + case Message.Msg of + CM_WININICHANGE, + LB_ADDSTRING, + LB_DELETESTRING, + LB_INSERTSTRING, + LB_RESETCONTENT, + LB_SETCARETINDEX, + LB_SETCURSEL, + LB_SETHORIZONTALEXTENT, + LB_SETTOPINDEX, + WM_HSCROLL, + WM_MOUSEWHEEL, + WM_VSCROLL, + WM_WINDOWPOSCHANGED: + SetExternalScrollBarsParameters; + WM_SETREDRAW: + if Message.WParam <> 0 then + SetExternalScrollBarsParameters; + end; +end; + +procedure TcxCustomInnerListBox.CreateScrollBars; + + procedure InitializeScrollBar(AScrollBar: TcxScrollBar); + begin + AScrollBar.SmallChange := 1; + AScrollBar.Visible := False; + end; + +begin + FHScrollBar := TcxScrollBar.Create(Self); + FHScrollBar.FreeNotification(Self); + FHScrollBar.Kind := sbHorizontal; + FHScrollBar.OnScroll := HScrollHandler; + InitializeScrollBar(FHScrollBar); + + FVScrollBar := TcxScrollBar.Create(Self); + FVScrollBar.FreeNotification(Self); + FVScrollBar.Kind := sbVertical; + FVScrollBar.OnScroll := VScrollHandler; + InitializeScrollBar(FVScrollBar); +end; + +function TcxCustomInnerListBox.FindAutoCompleteString(const S: string): Integer; +begin +{$IFDEF DELPHI6} + if Style in [lbVirtual, lbVirtualOwnerDraw] then + Result := DoFindData(S) + else +{$ENDIF} + Result := SendMessage(Handle, LB_FINDSTRING, -1, LPARAM(PChar(S))); +end; + +function TcxCustomInnerListBox.GetControlContainer: TcxContainer; +begin + Result := FContainer; +end; + +function TcxCustomInnerListBox.GetControl: TWinControl; +begin + Result := Self; +end; + +procedure TcxCustomInnerListBox.HScrollHandler(Sender: TObject; ScrollCode: TScrollCode; + var ScrollPos: Integer); +begin + if FHScrollBar.HandleAllocated then + begin + CallWindowProc(DefWndProc, Handle, WM_HSCROLL, Word(ScrollCode) + + Word(ScrollPos) shl 16, FHScrollBar.Handle); + ScrollPos := GetScrollPos(Handle, SB_HORZ); + end; +end; + +procedure TcxCustomInnerListBox.SetLookAndFeel(Value: TcxLookAndFeel); +begin + FLookAndFeel.Assign(Value); +end; + +procedure TcxCustomInnerListBox.VScrollHandler(Sender: TObject; ScrollCode: TScrollCode; + var ScrollPos: Integer); +begin + if FVScrollBar.HandleAllocated then + if ScrollCode in [scLineUp, scLineDown] then + TopIndex := ScrollPos + else + begin + if ScrollCode in [scPosition, scTrack] then + TopIndex := ScrollPos + else + CallWindowProc(DefWndProc, Handle, WM_VSCROLL, Word(ScrollCode) + + Word(ScrollPos) shl 16, FVScrollBar.Handle); + ScrollPos := GetScrollPos(Handle, SB_VERT); + end; +end; + +{$IFNDEF DELPHI6} +function TcxCustomInnerListBox.GetScrollWidth: Integer; +begin + Result := SendMessage(Handle, LB_GETHORIZONTALEXTENT, 0, 0); +end; + +procedure TcxCustomInnerListBox.SetScrollWidth(const Value: Integer); +begin + if Value <> ScrollWidth then + SendMessage(Handle, LB_SETHORIZONTALEXTENT, Value, 0); +end; +{$ENDIF} + +procedure TcxCustomInnerListBox.WMGetDlgCode(var Message: TWMGetDlgCode); +begin + inherited; + if Container <> nil then + with Message do + begin + Result := Result or DLGC_WANTCHARS; + if GetKeyState(VK_CONTROL) >= 0 then + Result := Result or DLGC_WANTTAB; + end; +end; + +procedure TcxCustomInnerListBox.WMKillFocus(var Message: TWMKillFocus); +begin + inherited; + if (Container <> nil) and not Container.IsDestroying then + Container.FocusChanged; +end; + +procedure TcxCustomInnerListBox.WMLButtonDown(var Message: TWMLButtonDown); + + function NeedImmediateBeginDrag: Boolean; + var + AItemIndex : Integer; + AShiftState: TShiftState; + begin + Result := False; + AShiftState := KeysToShiftState(Message.Keys); + if MultiSelect then + if not(ssShift in AShiftState) or (ssCtrl in AShiftState) then + begin + AItemIndex := ItemAtPos(SmallPointToPoint(Message.Pos), True); + Result := (AItemIndex >= 0) and Selected[AItemIndex]; + end; + end; + + function NeedBeginDrag: Boolean; + var + AShiftState: TShiftState; + begin + AShiftState := KeysToShiftState(Message.Keys); + Result := not(MultiSelect and ((ssCtrl in AShiftState) or + (ssShift in AShiftState))); + end; + +var + APrevDragMode: TDragMode; +begin + if not((Container <> nil) and (DragMode = dmAutomatic) and + not Container.IsDesigning) then + begin + inherited; + Exit; + end; + + APrevDragMode := DragMode; + try + DragMode := dmManual; + if NeedImmediateBeginDrag then + begin + Container.BeginDrag(False); + Exit; + end; + inherited; + if NeedBeginDrag then + Container.BeginDrag(False); + finally + DragMode := APrevDragMode; + end; +end; + +procedure TcxCustomInnerListBox.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + inherited; + if not FScrollBarsCalculating then + SetExternalScrollBarsParameters; +end; + +procedure TcxCustomInnerListBox.WMNCPaint(var Message: TWMNCPaint); +var + ADC: HDC; +begin + inherited; + if UsecxScrollBars and HScrollBar.Visible and VScrollBar.Visible then + begin + ADC := GetWindowDC(Handle); + try + DrawSizeGrip(ADC); + finally + ReleaseDC(Handle, ADC); + end; + end; +end; + +procedure TcxCustomInnerListBox.WMPrint(var Message: TWMPrint); +begin + if UsecxScrollBars and (Message.Flags and PRF_NONCLIENT <> 0) then + begin + Message.Flags := Message.Flags and not PRF_NONCLIENT; + DrawSizeGrip(Message.DC); + end; + inherited; +end; + +procedure TcxCustomInnerListBox.WMPrintClient(var Message: TWMPrintClient); +begin + DefaultHandler(Message); +end; + +procedure TcxCustomInnerListBox.WMSetFocus(var Message: TWMSetFocus); +begin + inherited; + if (Container <> nil) and not Container.IsDestroying and not(csDestroying in ComponentState) + and (Message.FocusedWnd <> Container.Handle) then + Container.FocusChanged; +end; + +procedure TcxCustomInnerListBox.WMSetRedraw(var Message: TWMSetRedraw); +begin + inherited; + FIsRedrawLocked := Message.Redraw = 0; + if not (csDestroying in ComponentState) and not FIsRedrawLocked then + SetExternalScrollBarsParameters; +end; + +procedure TcxCustomInnerListBox.WMWindowPosChanged(var Message: TWMWindowPosChanged); +var + ARgn: HRGN; +begin + inherited; + if csDestroying in ComponentState then + Exit; + if FHScrollBar.Visible and FVScrollBar.Visible then + begin + ARgn := CreateRectRgnIndirect(GetSizeGripRect); + SendMessage(Handle, WM_NCPAINT, ARgn, 0); + DeleteObject(ARgn); + end; +end; + +procedure TcxCustomInnerListBox.CMMouseEnter(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseEnter(Self) + else + MouseEnter(TControl(Message.lParam)); +end; + +procedure TcxCustomInnerListBox.CMMouseLeave(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseLeave(Self) + else + MouseLeave(TControl(Message.lParam)); +end; + +procedure TcxCustomInnerListBox.CNDrawItem(var Message: TWMDrawItem); +var + ACanvas: TCanvas; + AItemState: TOwnerDrawState; +begin + with Message.DrawItemStruct^ do + begin + AItemState := TOwnerDrawState(LongRec(itemState).Lo); + ACanvas := inherited Canvas; + ACanvas.Handle := hDC; + ACanvas.Font := Font; + ACanvas.Brush := Brush; + if (Integer(itemID) >= 0) and (odSelected in AItemState) then + begin + ACanvas.Brush.Color := clHighlight; + ACanvas.Font.Color := clHighlightText + end; + if Integer(itemID) >= 0 then + DrawItem(itemID, rcItem, AItemState) + else + ACanvas.FillRect(rcItem); + if (odFocused in AItemState) and NeedDrawFocusRect then + DrawFocusRect(hDC, rcItem); + ACanvas.Handle := 0; + end; +end; + +function WndProc(hWnd: HWND; Msg: Windows.UINT; WParam: WPARAM; LParam: LPARAM): LRESULT stdcall; +begin + SetWindowLong(hwnd, GWL_WNDPROC, Longint(FOldWndProc)); + Result := 1; +end; + +function ApplicationCallWndProcHookProc(Code: Integer; + WParam, LParam: Longint): Longint stdcall; + + procedure LockMessage(AWnd: HWND); + begin + FOldWndProc := Pointer(GetWindowLong(AWnd, GWL_WNDPROC)); + SetWindowLong(AWnd, GWL_WNDPROC, Longint(@WndProc)); + end; + +var + AParentForm: TCustomForm; + AParentWindow: HWND; + APopupWindow: TcxCustomPopupWindow; + I, J: Integer; +begin + if Code <> HC_ACTION then + begin + Result := CallNextHookEx(FApplicationCallWndProcHook, Code, WParam, LParam); + Exit; + end; + + with Windows.PCWPStruct(LParam)^ do + if ((message = CM_ACTIVATE) or (message = CM_DEACTIVATE)) and IsCMActivateMessagesLocked then + LockMessage(hwnd); + + if FVisiblePopupWindowList.Count = 0 then + begin + Result := CallNextHookEx(FApplicationCallWndProcHook, Code, WParam, LParam); + Exit; + end; + + with Windows.PCWPStruct(LParam)^ do + case message of + WM_NCACTIVATE: + if wParam = 0 then + if FCaptionInactivationLocked then + LockMessage(hwnd) + else + for I := 0 to FVisiblePopupWindowList.Count - 1 do + begin + APopupWindow := TcxCustomPopupWindow(FVisiblePopupWindowList[I]); + if csDestroying in APopupWindow.ComponentState then + Continue; + AParentForm := GetParentForm(APopupWindow.OwnerControl); + if (AParentForm <> nil) and (NativeHandle(AParentForm.Handle) = hwnd) then + LockMessage(hwnd); + end; + + WM_ACTIVATEAPP: + if wParam = 0 then + begin + I := 0; + while I < FVisiblePopupWindowList.Count do + begin + APopupWindow := TcxCustomPopupWindow(FVisiblePopupWindowList[I]); + AParentForm := GetParentForm(APopupWindow.OwnerControl); + if AParentForm <> nil then + PostMessage(NativeHandle(AParentForm.Handle), WM_NCACTIVATE, 0, 0); + if APopupWindow.CaptureFocus and APopupWindow.Active or not IsWindowEnabled(APopupWindow.Handle) then + begin + Inc(I); + Continue; + end; + APopupWindow.CloseUp; + if APopupWindow.OwnerControl is TcxContainer then + TcxContainer(APopupWindow.OwnerControl).FocusChanged; + I := 0; + end; + end; + + WM_DESTROY: + for I := 0 to FVisiblePopupWindowList.Count - 1 do + begin + APopupWindow := TcxCustomPopupWindow(FVisiblePopupWindowList[I]); + if csDestroying in APopupWindow.ComponentState then + Continue; + if HasNativeHandle(APopupWindow, hwnd) then + begin + APopupWindow.Close; + if FVisiblePopupWindowList.IndexOf(APopupWindow) = -1 then + with APopupWindow do + if not (csDestroying in ComponentState) and FTerminateOnDestroy then + Application.Terminate; + Break; + end; + end; + + WM_CLOSE: + for I := 0 to FVisiblePopupWindowList.Count - 1 do + begin + APopupWindow := TcxCustomPopupWindow(FVisiblePopupWindowList[I]); + if csDestroying in APopupWindow.ComponentState then + Continue; + if HasNativeHandle(APopupWindow, hwnd) then + begin + if APopupWindow.CloseQuery then + APopupWindow.CloseUp; + if (FVisiblePopupWindowList.IndexOf(APopupWindow) = -1) and + APopupWindow.CaptureFocus and not(csDestroying in APopupWindow.OwnerControl.ComponentState) then + begin + AParentWindow := FindFirstNonChildParentWindow(APopupWindow.OwnerControl.Handle); + SendMessage(AParentWindow, WM_CLOSE, 0, 0); + end; + Break; + end; + if not APopupWindow.CaptureFocus and not(csDestroying in APopupWindow.OwnerControl.ComponentState) then + begin + AParentForm := GetParentForm(APopupWindow.OwnerControl); + if not AParentForm.HandleAllocated or HasNativeHandle(AParentForm, hwnd) then + APopupWindow.CloseUp; + Break; + end; + end; + + WM_SHOWWINDOW: + if wParam = 0 then + for I := FVisiblePopupWindowList.Count - 1 downto 0 do + begin + APopupWindow := TcxCustomPopupWindow(FVisiblePopupWindowList[I]); + if csDestroying in APopupWindow.ComponentState then + Continue; + with APopupWindow.OwnerControl do + if (csDestroying in ComponentState) or not HandleAllocated then + Continue; + if HasNativeHandle(APopupWindow.OwnerControl, hwnd) then + begin + for J := FVisiblePopupWindowList.Count - 1 downto I do + TcxCustomPopupWindow(FVisiblePopupWindowList[J]).CloseUp; + Break; + end; + end; + + WM_WINDOWPOSCHANGED: + begin + I := 0; + while I < FVisiblePopupWindowList.Count do + begin + APopupWindow := TcxCustomPopupWindow(FVisiblePopupWindowList[I]); + if (csDestroying in APopupWindow.ComponentState) or not APopupWindow.HandleAllocated then + begin + Inc(I); + Continue; + end; + with APopupWindow.OwnerControl do + if (csDestroying in ComponentState) or not HandleAllocated then + begin + Inc(I); + Continue; + end; + if not HasNativeHandle(APopupWindow.OwnerControl, hwnd) then + begin + Inc(I); + Continue; + end; + if InternalIsWindowVisible(APopupWindow.OwnerControl) then + Inc(I) + else + begin + APopupWindow.CloseUp; + I := 0; + Continue; + end; + end; + end; + end; + Result := CallNextHookEx(FApplicationCallWndProcHook, Code, WParam, LParam); +end; + +function ApplicationGetMessageMsgHookProc(Code: Integer; + WParam, LParam: Longint):Longint stdcall; +var + APMsg: Windows.PMSG; + APopupWindow: TcxCustomPopupWindow; +begin + if (FVisiblePopupWindowList.Count > 0) and (Code = HC_ACTION) and (WParam = PM_REMOVE) then + begin + APMsg := Windows.PMSG(LParam); + if (APMsg^.message = WM_SYSKEYDOWN) and (FVisiblePopupWindowList.Count > 0) then + with FVisiblePopupWindowList do + begin + APopupWindow := TcxCustomPopupWindow(Items[Count - 1]); + if (not APopupWindow.CaptureFocus or not APopupWindow.ModalMode) and + not APopupWindow.IsSysKeyAccepted(APMsg^.wParam) then + APMsg^.message := 0; + end; + end; + Result := CallNextHookEx(FApplicationGetMessageMsgHook, Code, WParam, LParam); +end; + +function ApplicationMouseMsgHookProc(Code: Integer; + WParam, LParam: Longint): Longint stdcall; + + function MDIParentOrAnotherMDIChild(APopupWindow: TcxCustomPopupWindow; AWnd: HWND): Boolean; + var + AMDIChildForm, AMDIParentForm: TCustomForm; + AMDIClientNativeHandle, AParentNativeHandle: HWND; + AParentForm: TCustomForm; + I, J: Integer; + begin + AParentForm := GetParentForm(APopupWindow.OwnerControl); + AParentNativeHandle := GetParent(NativeHandle(AParentForm.Handle)); + Result := AParentNativeHandle = AWnd; + if Result then + Exit; + for I := 0 to Screen.FormCount - 1 do + begin + AMDIParentForm := Screen.Forms[I]; + if (TCustomFormAccess(AMDIParentForm).FormStyle = fsMDIForm) and (TCustomFormAccess(AMDIParentForm).ClientHandle <> 0) then + begin + AMDIClientNativeHandle := NativeHandle(TCustomFormAccess(AMDIParentForm).ClientHandle); + if AParentNativeHandle = AMDIClientNativeHandle then // TODO Check CLX + begin + Result := HasNativeHandle(AMDIParentForm, AWnd, True); + if Result then + Break; + + for J := 0 to TCustomFormAccess(AMDIParentForm).MDIChildCount - 1 do + begin + AMDIChildForm := TCustomFormAccess(AMDIParentForm).MDIChildren[J]; + if AMDIChildForm = AParentForm then + Continue; + Result := HasNativeHandle(AMDIChildForm, AWnd, True); + if Result then + Break; + end; + + Break; + end; + end; + end; + end; + + function InternalNeedIgnoreMouseMessageAfterCloseUp(AWnd: THandle; + APopupWindow: TcxCustomPopupWindow): Boolean; + var + P: TPoint; + begin + P := PMouseHookStruct(LParam)^.pt; + Result := APopupWindow.NeedIgnoreMouseMessageAfterCloseUp(AWnd, WParam, + InternalGetShiftState, P); + end; + + function CheckWindow(AWnd: HWND): Boolean; + var + I: Integer; + ACallNextHook, ANeedCheckIgnoreMouseMessage: Boolean; + APopupWindow: TcxCustomPopupWindow; + AParentForm: TCustomForm; + begin + Result := True; + ACallNextHook := True; + I := 0; + while I < FVisiblePopupWindowList.Count do + begin + ANeedCheckIgnoreMouseMessage := True; + APopupWindow := TcxCustomPopupWindow(FVisiblePopupWindowList[I]); + if APopupWindow.CaptureFocus and not APopupWindow.Active then + begin + Inc(I); + Continue; + end; + with APopupWindow do + begin + if HasNativeHandle(APopupWindow, AWnd, True) then + begin + Inc(I); + Continue; + end; + AParentForm := GetParentForm(OwnerControl); +// if HasNativeHandle(AParentForm, AWnd, True) then + if CheckParentsNativeHandle(OwnerControl, AWnd) or ((AParentForm is TcxCustomPopupWindow) and not TcxCustomPopupWindow(AParentForm).IsVisible) then + begin + if HasNativeHandle(OwnerControl, AWnd, True) then + if (WParam = WM_LBUTTONDOWN) or (WParam = WM_LBUTTONDBLCLK) then + begin + if PtInRect(OwnerScreenBounds, PMouseHookStruct(LParam)^.pt) then + begin + ACallNextHook := False; + if InternalNeedIgnoreMouseMessageAfterCloseUp(AWnd, APopupWindow) then + FJustClosed := True; + ANeedCheckIgnoreMouseMessage := False; + end; + end; + + FCaptionInactivationLocked := True; + LockDeactivate(True); + try + if Result and ANeedCheckIgnoreMouseMessage then + Result := not InternalNeedIgnoreMouseMessageAfterCloseUp(AWnd, APopupWindow); + APopupWindow.CloseUp; + if not ACallNextHook and ((csDestroying in OwnerControl.ComponentState) + or not OwnerControl.Visible) then + Result := False; + finally + LockDeactivate(False); + FCaptionInactivationLocked := False; + end; + I := 0; + end + else + begin + AParentForm := GetParentForm(OwnerControl); + if (TCustomFormAccess(AParentForm).FormStyle = fsMDIChild) and MDIParentOrAnotherMDIChild(APopupWindow, AWnd) then + begin + Result := Result and not InternalNeedIgnoreMouseMessageAfterCloseUp(AWnd, APopupWindow); + APopupWindow.CloseUp; + I := 0; + end + else + begin + Inc(I); + Continue; + end; + end; + end; + end; + end; + +begin + if (FVisiblePopupWindowList.Count > 0) and (Code = HC_ACTION) then + case WParam of + WM_NCLBUTTONDOWN, WM_NCLBUTTONDBLCLK, WM_LBUTTONDOWN, WM_LBUTTONDBLCLK, + WM_NCRBUTTONDOWN, WM_NCRBUTTONDBLCLK, WM_RBUTTONDOWN, WM_RBUTTONDBLCLK, + WM_NCMBUTTONDOWN, WM_NCMBUTTONDBLCLK, WM_MBUTTONDOWN, WM_MBUTTONDBLCLK: + if not CheckWindow(PMouseHookStruct(LParam)^.hwnd) then + begin + Result := 1; + Exit; + end; + end; + Result := CallNextHookEx(FApplicationMouseMsgHook, Code, WParam, LParam); +end; + +procedure RemoveHooks; +begin + if FApplicationMouseMsgHook <> 0 then + UnhookWindowsHookEx(FApplicationMouseMsgHook); + FApplicationMouseMsgHook := 0; + if FApplicationGetMessageMsgHook <> 0 then + UnhookWindowsHookEx(FApplicationGetMessageMsgHook); + FApplicationGetMessageMsgHook := 0; + if FApplicationCallWndProcHook <> 0 then + UnhookWindowsHookEx(FApplicationCallWndProcHook); + FApplicationCallWndProcHook := 0; +end; + +procedure SetHooks; +begin + // Requires + Assert(FApplicationMouseMsgHook = 0); + // + FApplicationCallWndProcHook := SetWindowsHookEx(WH_CALLWNDPROC, + @ApplicationCallWndProcHookProc, 0, GetCurrentThreadID); + FApplicationGetMessageMsgHook := SetWindowsHookEx(WH_GETMESSAGE, + @ApplicationGetMessageMsgHookProc, 0, GetCurrentThreadID); + FApplicationMouseMsgHook := SetWindowsHookEx(WH_MOUSE, + @ApplicationMouseMsgHookProc, 0, GetCurrentThreadID); +end; + +initialization + SetUsecxScrollBars; +{$IFDEF DELPHI6} + StartClassGroup(TControl); + GroupDescendentsWith(TcxStyleController, TControl); +{$ENDIF} + FVisiblePopupWindowList := TList.Create; + if not FSetHooksOnlyWhenPopupsAreVisible then + SetHooks; + cxControls.cxGetParentWndForDocking := GetPopupOwnerControl; + +finalization + cxControls.cxGetParentWndForDocking := nil; + RemoveHooks; + FreeAndNil(FVisiblePopupWindowList); + +end. + diff --git a/official/x.35/ExpressLibrary/Sources/cxControls.pas b/official/x.35/ExpressLibrary/Sources/cxControls.pas new file mode 100644 index 00000000..4153a932 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxControls.pas @@ -0,0 +1,5007 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library controls } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +{$DEFINE USETCXSCROLLBAR} + +unit cxControls; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Controls, Graphics, Forms, Classes, StdCtrls, Menus, cxGraphics, +{$IFDEF USETCXSCROLLBAR} + cxScrollBar, +{$ENDIF} + cxClasses, + cxLookAndFeels, + cxLookAndFeelPainters; + +const + CM_NCSIZECHANGED = WM_DX + 1; + + {$IFNDEF DELPHI7} + WM_APPCOMMAND = $0319; + {$EXTERNALSYM WM_APPCOMMAND} + {$ENDIF} + + FAPPCOMMAND_MASK = $0000F000; + {$EXTERNALSYM FAPPCOMMAND_MASK} + APPCOMMAND_BROWSER_BACKWARD = 1; + {$EXTERNALSYM APPCOMMAND_BROWSER_BACKWARD} + APPCOMMAND_BROWSER_FORWARD = 2; + {$EXTERNALSYM APPCOMMAND_BROWSER_FORWARD} + +type + TcxHandle = HWND; + + TcxDragDetect = (ddNone, ddDrag, ddCancel); + + TcxNumberType = (ntInteger, ntFloat, ntExponent); + +{$IFNDEF DELPHI7} + TWMPrint = packed record + Msg: Cardinal; + DC: HDC; + Flags: Cardinal; + Result: Integer; + end; + + TWMPrintClient = TWMPrint; +{$ENDIF} + + TLBGetItemRect = packed record + Msg: Cardinal; + ItemIndex: Integer; + Rect: PRect; + Result: Longint; + end; + + TcxControl = class; + + TDragControlObjectClass = class of TDragControlObject; + + IcxMouseCaptureObject = interface + ['{ACB73657-6066-4564-9A3D-D4D0273AA82F}'] + procedure DoCancelMode; + end; + + IcxMouseTrackingCaller = interface + ['{84A4BCBE-E001-4D60-B7A6-75E2B0DCD3E9}'] + procedure MouseLeave; + end; + + IcxMouseTrackingCaller2 = interface(IcxMouseTrackingCaller) + ['{3A5D973B-F016-4F22-80B6-1D35668D7743}'] + function PtInCaller(const P: TPoint): Boolean; + end; + + { IcxCompoundControl } + + IcxCompoundControl = interface + ['{A4A77F28-1D03-425B-9A83-0B853B5D8DEF}'] + function GetActiveControl: TWinControl; + property ActiveControl: TWinControl read GetActiveControl; + end; + + { IcxPopupMenu } + + IcxPopupMenu = interface + ['{61EEDA7D-88CC-45BF-8A00-5C25174D6501}'] + function IsShortCutKey(var Message: TWMKey): Boolean; + procedure Popup(X, Y: Integer); + end; + + { control child component } + + TcxControlChildComponent = class(TcxComponent) + private + FControl: TcxControl; + function GetIsLoading: Boolean; + protected + function GetIsDestroying: Boolean; virtual; + procedure Initialize; virtual; + procedure SetControl(Value: TcxControl); virtual; + public + constructor Create(AOwner: TComponent); override; + constructor CreateEx(AControl: TcxControl; + AAssignOwner: Boolean = True); virtual; + destructor Destroy; override; + function GetParentComponent: TComponent; override; + function HasParent: Boolean; override; + procedure SetParentComponent(Value: TComponent); override; + property Control: TcxControl read FControl write SetControl; + property IsDestroying: Boolean read GetIsDestroying; + property IsLoading: Boolean read GetIsLoading; + end; + + { scrollbar and size grip } + + TcxScrollBarData = record + Min: Integer; + Max: Integer; + Position: Integer; + PageSize: Integer; + SmallChange: TScrollBarInc; + LargeChange: TScrollBarInc; + Enabled: Boolean; + Visible: Boolean; + AllowShow: Boolean; + AllowHide: Boolean; + end; + + TcxControlScrollBar = class({$IFDEF USETCXSCROLLBAR}TcxScrollBar{$ELSE}TScrollBar{$ENDIF}) + private + function GetVisible: Boolean; + procedure SetVisible(Value: Boolean); + procedure CMDesignHitTest(var Message: TCMDesignHitTest); message CM_DESIGNHITTEST; + protected + procedure WndProc(var Message: TMessage); override; + procedure FocusParent; virtual; + public + Data: TcxScrollBarData; + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure ApplyData; + property Visible: Boolean read GetVisible write SetVisible; + end; + + TcxSizeGrip = class(TCustomControl) + private + FLookAndFeel: TcxLookAndFeel; + procedure WMEraseBkgnd(var AMessage: TWMEraseBkgnd); message WM_ERASEBKGND; + protected + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); + procedure Paint; override; + property LookAndFeel: TcxLookAndFeel read FLookAndFeel; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + end; + + { drag & drop objects } + + TcxDragAndDropObjectClass = class of TcxDragAndDropObject; + + TcxDragAndDropObject = class + private + FCanvas: TcxCanvas; + FControl: TcxControl; + FDirty: Boolean; + procedure SetDirty(Value: Boolean); + protected + procedure ChangeMousePos(const P: TPoint); + procedure DirtyChanged; virtual; + function GetDragAndDropCursor(Accepted: Boolean): TCursor; virtual; + function GetImmediateStart: Boolean; virtual; + + procedure AfterDragAndDrop(Accepted: Boolean); virtual; + procedure BeginDragAndDrop; virtual; + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); virtual; + procedure EndDragAndDrop(Accepted: Boolean); virtual; + + property Canvas: TcxCanvas read FCanvas write FCanvas; + property Control: TcxControl read FControl; + property Dirty: Boolean read FDirty write SetDirty; + public + CurMousePos: TPoint; + PrevMousePos: TPoint; + constructor Create(AControl: TcxControl); virtual; + + procedure DoBeginDragAndDrop; + procedure DoDragAndDrop(const P: TPoint; var Accepted: Boolean); + procedure DoEndDragAndDrop(Accepted: Boolean); + + property ImmediateStart: Boolean read GetImmediateStart; + end; + + TcxDragControlObject = class(TDragControlObject) + protected + procedure Finished(Target: TObject; X, Y: Integer; Accepted: Boolean); override; + function GetDragCursor(Accepted: Boolean; X, Y: Integer): TCursor; override; + end; + + TcxDragImageListClass = class of TcxDragImageList; + + TcxDragImageList = class(TDragImageList); + + { control } + + TcxControlBorderStyle = (cxcbsNone, cxcbsDefault); + TcxDragAndDropState = (ddsNone, ddsStarting, ddsInProcess); + + TcxKey = (kAll, kArrows, kChars, kTab); + TcxKeys = set of TcxKey; + + TcxMouseWheelScrollingKind = (mwskNone, mwskHorizontal, mwskVertical); + + TcxControlListernerLink = class + Ref: TcxControl; + end; + + TcxControl = class(TCustomControl{$IFNDEF DELPHI6}, IUnknown{$ENDIF}, + IcxLookAndFeelContainer) + private + FActiveCanvas: TcxCanvas; + FBorderStyle: TcxControlBorderStyle; + FCalculatingScrollBarsParams: Boolean; + FCanvas: TcxCanvas; + FCreatingWindow: Boolean; + FDefaultCursor: TCursor; + FDragAndDropObject: TcxDragAndDropObject; + FDragAndDropObjectClass: TcxDragAndDropObjectClass; + FDragAndDropPrevCursor: TCursor; + FDragAndDropState: TcxDragAndDropState; + FDragImages: TcxDragImageList; + FFinishingDragAndDrop: Boolean; + FFocusOnClick: Boolean; + FFontListenerList: IInterfaceList; + FHScrollBar: TcxControlScrollBar; + FInitialHScrollBarVisible: Boolean; + FInitialVScrollBarVisible: Boolean; + FIsInitialScrollBarsParams: Boolean; + FKeys: TcxKeys; + FLookAndFeel: TcxLookAndFeel; + FMouseButtonPressed: Boolean; + FMouseCaptureObject: TObject; + FMouseDownPos: TPoint; + FMouseRightButtonReleased: Boolean; + FPopupMenu: TComponent; + FScrollBars: TScrollStyle; + FScrollBarsLockCount: Integer; + FScrollBarsUpdateNeeded: Boolean; + FSizeGrip: TcxSizeGrip; + FUpdatingScrollBars: Boolean; + FVScrollBar: TcxControlScrollBar; + FIsScrollingContent: Boolean; + FLastParentBackground: Boolean; + {$IFNDEF DELPHI7} + FParentBackground: Boolean; + {$ENDIF} + FOnFocusChanged: TNotifyEvent; + FOnMouseEnter: TNotifyEvent; + FOnMouseLeave: TNotifyEvent; + + function GetActiveCanvas: TcxCanvas; + function GetDragAndDropObject: TcxDragAndDropObject; + function GetHScrollBarVisible: Boolean; + function GetIsDestroying: Boolean; + function GetIsLoading: Boolean; + function GetVScrollBarVisible: Boolean; + procedure SetBorderStyle(Value: TcxControlBorderStyle); + procedure SetDragAndDropState(Value: TcxDragAndDropState); + procedure SetLookAndFeel(Value: TcxLookAndFeel); + procedure SetKeys(Value: TcxKeys); + procedure SetMouseCaptureObject(Value: TObject); + procedure SetPopupMenu(Value: TComponent); + procedure SetScrollBars(Value: TScrollStyle); + {$IFNDEF DELPHI7} + procedure SetParentBackground(Value: Boolean); + {$ENDIF} + + procedure WMCancelMode(var Message: TWMCancelMode); message WM_CANCELMODE; + procedure WMContextMenu(var Message: TWMContextMenu); message WM_CONTEXTMENU; + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND; + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMPaint(var Message: TWMPaint); message WM_PAINT; + procedure WMSetCursor(var Message: TWMSetCursor); message WM_SETCURSOR; + procedure CMColorChanged(var Message: TMessage); message CM_COLORCHANGED; + procedure CMCursorChanged(var Message: TMessage); message CM_CURSORCHANGED; + procedure CMDesignHitTest(var Message: TCMDesignHitTest); message CM_DESIGNHITTEST; + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; + procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure CMNCSizeChanged(var Message: TMessage); message CM_NCSIZECHANGED; + procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED; + procedure CMVisibleChanged(var Message: TMessage); message CM_VISIBLECHANGED; + procedure CNKeyDown(var Message: TWMKeyDown); message CN_KEYDOWN; + procedure CNSysKeyDown(var Message: TWMKeyDown); message CN_SYSKEYDOWN; + procedure CreateScrollBars; + procedure DestroyScrollBars; + procedure ScrollEvent(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer); + protected + FBounds: TRect; + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + procedure Resize; override; + procedure WndProc(var Message: TMessage); override; + procedure DestroyWindowHandle; override; + procedure DoContextPopup(MousePos: TPoint; + var Handled: Boolean); override; + function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; override; + function DoShowPopupMenu(AMenu: TComponent; X, Y: Integer): Boolean; virtual; + function GetPopupMenu: TPopupMenu; override; + function IsMenuKey(var Message: TWMKey): Boolean; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure Modified; virtual; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure Paint; override; + + procedure ColorChanged; dynamic; + procedure DoScrolling; + procedure ParentBackgroundChanged; virtual; + procedure VisibleChanged; dynamic; + procedure AddChildComponent(AComponent: TcxControlChildComponent); dynamic; + procedure RemoveChildComponent(AComponent: TcxControlChildComponent); dynamic; + + property FontListenerList: IInterfaceList read FFontListenerList; + + procedure AfterMouseDown(AButton: TMouseButton; X, Y: Integer); virtual; + function AllowAutoDragAndDropAtDesignTime(X, Y: Integer; + Shift: TShiftState): Boolean; virtual; + function AllowDragAndDropWithoutFocus: Boolean; dynamic; + procedure BeforeMouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); virtual; + procedure BoundsChanged; dynamic; + procedure BringInternalControlsToFront; virtual; + procedure CancelMouseOperations; virtual; + function CanDrag(X, Y: Integer): Boolean; dynamic; + function CanFocusOnClick: Boolean; overload; virtual; + function CanFocusOnClick(X, Y: Integer): Boolean; overload; virtual; + procedure CursorChanged; dynamic; + procedure DoCancelMode; dynamic; + procedure FocusChanged; dynamic; + function FocusWhenChildIsClicked(AChild: TControl): Boolean; virtual; + procedure FontChanged; dynamic; + function GetBorderSize: Integer; virtual; + function GetBounds: TRect; virtual; + function GetClientBounds: TRect; virtual; + function GetCursor(X, Y: Integer): TCursor; virtual; + function GetDesignHitTest(X, Y: Integer; Shift: TShiftState): Boolean; dynamic; + function GetDragObjectClass: TDragControlObjectClass; dynamic; + function GetIsDesigning: Boolean; virtual; + function GetIsFocused: Boolean; virtual; + function GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; virtual; + function HasBackground: Boolean; virtual; + procedure InitControl; virtual; + function IsInternalControl(AControl: TControl): Boolean; virtual; + function MayFocus: Boolean; dynamic; + procedure MouseEnter(AControl: TControl); dynamic; + procedure MouseLeave(AControl: TControl); dynamic; + procedure TextChanged; dynamic; + + // IcxLookAndFeelContainer + function IcxLookAndFeelContainer.GetLookAndFeel = GetLookAndFeelValue; + function GetLookAndFeelValue: TcxLookAndFeel; virtual; + + // look&feel + function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; virtual; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); virtual; + property LookAndFeel: TcxLookAndFeel read FLookAndFeel write SetLookAndFeel; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter; + + // scrollbars + function CanScrollLineWithoutScrollBars(ADirection: TcxDirection): Boolean; virtual; + procedure CheckNeedsScrollBars; + function GetHScrollBarBounds: TRect; virtual; + function GetSizeGripBounds: TRect; virtual; + function GetVScrollBarBounds: TRect; virtual; + procedure InitScrollBars; + procedure InitScrollBarsParameters; virtual; + function IsPixelScrollBar(AKind: TScrollBarKind): Boolean; virtual; + function NeedsScrollBars: Boolean; virtual; + function NeedsToBringInternalControlsToFront: Boolean; virtual; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); virtual; + procedure SetInternalControlsBounds; virtual; + procedure UpdateInternalControlsState; virtual; + procedure UpdateScrollBars; virtual; + + property CalculatingScrollBarsParams: Boolean read FCalculatingScrollBarsParams; + property HScrollBar: TcxControlScrollBar read FHScrollBar; + property HScrollBarVisible: Boolean read GetHScrollBarVisible; + property ScrollBars: TScrollStyle read FScrollBars write SetScrollBars default ssBoth; + property SizeGrip: TcxSizeGrip read FSizeGrip; + property UpdatingScrollBars: Boolean read FUpdatingScrollBars; + property VScrollBar: TcxControlScrollBar read FVScrollBar; + property VScrollBarVisible: Boolean read GetVScrollBarVisible; + + // internal drag and drop (columns moving, ...) + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); dynamic; + procedure EndDragAndDrop(Accepted: Boolean); dynamic; + function GetDragAndDropObjectClass: TcxDragAndDropObjectClass; virtual; + function StartDragAndDrop(const P: TPoint): Boolean; dynamic; + + // delphi drag and drop + procedure DoStartDrag(var DragObject: TDragObject); override; + procedure DoEndDrag(Target: TObject; X, Y: Integer); override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); override; + procedure DrawDragImage(ACanvas: TcxCanvas; const R: TRect); virtual; + function GetDragImagesClass: TcxDragImageListClass; virtual; + function GetDragImagesSize: TPoint; virtual; + function GetIsCopyDragDrop: Boolean; virtual; + function HasDragImages: Boolean; virtual; + procedure HideDragImage; + procedure InitDragImages(ADragImages: TcxDragImageList); virtual; + procedure ShowDragImage; + property DragImages: TcxDragImageList read FDragImages; + property IsCopyDragDrop: Boolean read GetIsCopyDragDrop; + + property BorderSize: Integer read GetBorderSize; + property BorderStyle: TcxControlBorderStyle read FBorderStyle write SetBorderStyle; + property CreatingWindow: Boolean read FCreatingWindow; + property FocusOnClick: Boolean read FFocusOnClick write FFocusOnClick default True; + property Keys: TcxKeys read FKeys write SetKeys; + property MouseRightButtonReleased: Boolean read FMouseRightButtonReleased; + property MouseWheelScrollingKind: TcxMouseWheelScrollingKind read GetMouseWheelScrollingKind; + property PopupMenu: TComponent read FPopupMenu write SetPopupMenu; + property IsScrollingContent: Boolean read FIsScrollingContent; + property ParentBackground{$IFNDEF DELPHI7}: Boolean read FParentBackground + write SetParentBackground{$ENDIF} default True; + + property OnFocusChanged: TNotifyEvent read FOnFocusChanged write FOnFocusChanged; + property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter; + property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function GetDragImages: TDragImageList; override; + {$IFDEF DELPHI4} + procedure BeforeDestruction; override; + {$ENDIF} + function CanFocusEx: Boolean; virtual; + function AcceptMousePosForClick(X, Y: Integer): Boolean; virtual; + procedure InvalidateRect(const R: TRect; EraseBackground: Boolean); + procedure InvalidateRgn(ARegion: TcxRegion; EraseBackground: Boolean); + procedure InvalidateWithChildren; + function IsMouseInPressedArea(X, Y: Integer): Boolean; + procedure PostMouseMove(AMousePos: TPoint); overload; + procedure PostMouseMove; overload; + procedure ScrollContent(ADirection: TcxDirection); + procedure ScrollWindow(DX, DY: Integer; const AScrollRect: TRect); + procedure SetScrollBarInfo(AScrollBarKind: TScrollBarKind; + AMin, AMax, AStep, APage, APos: Integer; AAllowShow, AAllowHide: Boolean); + function StartDrag(DragObject: TDragObject): Boolean; dynamic; + procedure UpdateWithChildren; + + // internal drag and drop (columns moving, ...) + procedure BeginDragAndDrop; dynamic; + procedure FinishDragAndDrop(Accepted: Boolean); + property DragAndDropObject: TcxDragAndDropObject read GetDragAndDropObject; + property DragAndDropObjectClass: TcxDragAndDropObjectClass read GetDragAndDropObjectClass + write FDragAndDropObjectClass; + property DragAndDropState: TcxDragAndDropState read FDragAndDropState + write SetDragAndDropState; + + procedure AddFontListener(AListener: IcxFontListener); + procedure RemoveFontListener(AListener: IcxFontListener); + + procedure LockScrollBars; + procedure UnlockScrollBars; + + property ActiveCanvas: TcxCanvas read GetActiveCanvas; + property Bounds: TRect read GetBounds; + property Canvas: TcxCanvas read FCanvas; + property ClientBounds: TRect read GetClientBounds; + property IsDesigning: Boolean read GetIsDesigning; + property IsDestroying: Boolean read GetIsDestroying; + property IsLoading: Boolean read GetIsLoading; + property IsFocused: Boolean read GetIsFocused; + property MouseCaptureObject: TObject read FMouseCaptureObject write SetMouseCaptureObject; + property MouseDownPos: TPoint read FMouseDownPos write FMouseDownPos; + + property TabStop default True; // MayFocus = True + end; + + { customize listbox } + + TcxCustomizeListBox = class(TListBox) + private + FDragAndDropItemIndex: Integer; + FMouseDownPos: TPoint; + function GetDragAndDropItemObject: TObject; + function GetItemObject: TObject; + procedure SetItemObject(Value: TObject); + procedure WMCancelMode(var Message: TWMCancelMode); message WM_CANCELMODE; + procedure WMMouseMove(var Message: TWMMouseMove); message WM_MOUSEMOVE; + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + + procedure BeginDragAndDrop; dynamic; + + property DragAndDropItemIndex: Integer read FDragAndDropItemIndex; + property DragAndDropItemObject: TObject read GetDragAndDropItemObject; + public + constructor Create(AOwner: TComponent); override; + property ItemObject: TObject read GetItemObject write SetItemObject; + end; + + { messagewindow } + + TcxMessageWindow = class + private + FHandle: HWND; + protected + procedure WndProc(var Message: TMessage); virtual; + public + constructor Create; virtual; + destructor Destroy; override; + property Handle: HWND read FHandle; + end; + + { TcxBaseHintWindow } + + TcxHintAnimationStyle = (cxhaSlideFromLeft, cxhaSlideFromRight, cxhaSlideDownward, cxhaSlideUpward, + cxhaSlideFromCenter, cxhaHide, cxhaActivate, cxhaFadeIn, cxhaAuto, cxhaNone); + + TcxBaseHintWindow = class(THintWindow) + private + FAnimationStyle: TcxHintAnimationStyle; + FAnimationDelay: Integer; + FBorderStyle: TBorderStyle; + FNeedEraseBackground: Boolean; + procedure WMEraseBkgnd(var Message: TWmEraseBkgnd); message WM_ERASEBKGND; + protected + FStandardHint: Boolean; + procedure CreateParams(var Params: TCreateParams); override; + + function GetAnimationStyle: TcxHintAnimationStyle; + procedure DisableRegion; virtual; + procedure EnableRegion; virtual; + procedure Show; virtual; + public + constructor Create(AOwner: TComponent); override; + procedure ActivateHint(ARect: TRect; const AHint: string); override; + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; + + property AnimationStyle: TcxHintAnimationStyle read FAnimationStyle write FAnimationStyle; + property AnimationDelay: Integer read FAnimationDelay write FAnimationDelay; + property BorderStyle: TBorderStyle read FBorderStyle write FBorderStyle; + property NeedEraseBackground: Boolean read FNeedEraseBackground write FNeedEraseBackground; + end; + + { popup } + + TcxPopupAlignHorz = (pahLeft, pahCenter, pahRight); + TcxPopupAlignVert = (pavTop, pavCenter, pavBottom); + TcxPopupDirection = (pdHorizontal, pdVertical); + + TcxPopupWindow = class(TForm) + private + FAdjustable: Boolean; + FAlignHorz: TcxPopupAlignHorz; + FAlignVert: TcxPopupAlignVert; + FBorderSpace: Integer; + FBorderStyle: TcxPopupBorderStyle; + FCanvas: TcxCanvas; + FDirection: TcxPopupDirection; + FFrameColor: TColor; + FOwnerBounds: TRect; + FOwnerParent: TControl; + FPrevActiveWindow: HWND; + function GetNCHeight: Integer; + function GetNCWidth: Integer; + procedure SetBorderSpace(Value: Integer); + procedure SetBorderStyle(Value: TcxPopupBorderStyle); + procedure WMActivate(var Message: TWMActivate); message WM_ACTIVATE; + procedure WMActivateApp(var Message: TWMActivateApp); message WM_ACTIVATEAPP; + procedure CMVisibleChanged(var Message: TMessage); message CM_VISIBLECHANGED; + protected + procedure Deactivate; override; + procedure Paint; override; + procedure VisibleChanged; dynamic; + + function CalculatePosition: TPoint; virtual; + procedure CalculateSize; virtual; + function GetBorderWidth(ABorder: TcxBorder): Integer; virtual; + function GetClientBounds: TRect; virtual; + function GetFrameWidth(ABorder: TcxBorder): Integer; virtual; + function GetOwnerScreenBounds: TRect; virtual; + procedure InitPopup; virtual; + procedure RestoreControlsBounds; + + procedure DrawFrame; virtual; + + property BorderWidths[ABorder: TcxBorder]: Integer read GetBorderWidth; + property Canvas: TcxCanvas read FCanvas; + property FrameWidths[ABorder: TcxBorder]: Integer read GetFrameWidth; + property NCHeight: Integer read GetNCHeight; + property NCWidth: Integer read GetNCWidth; + public + constructor Create; reintroduce; virtual; + destructor Destroy; override; + procedure CloseUp; virtual; + procedure Popup; virtual; + + property Adjustable: Boolean read FAdjustable write FAdjustable; + property AlignHorz: TcxPopupAlignHorz read FAlignHorz write FAlignHorz; + property AlignVert: TcxPopupAlignVert read FAlignVert write FAlignVert; + property BorderSpace: Integer read FBorderSpace write SetBorderSpace; + property BorderStyle: TcxPopupBorderStyle read FBorderStyle write SetBorderStyle; + property ClientBounds: TRect read GetClientBounds; + property Direction: TcxPopupDirection read FDirection write FDirection; + property FrameColor: TColor read FFrameColor write FFrameColor; + property OwnerBounds: TRect read FOwnerBounds write FOwnerBounds; + property OwnerParent: TControl read FOwnerParent write FOwnerParent; + property OwnerScreenBounds: TRect read GetOwnerScreenBounds; + end; + + { drag image } + + TcxCustomDragImage = class(TcxPopupWindow) + private + {$IFNDEF DELPHI9} + FPopupParent: TCustomForm; + {$ENDIF} + FPositionOffset: TPoint; + function GetAlphaBlended: Boolean; + function GetVisible: Boolean; + procedure SetVisible(Value: Boolean); + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND; + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + protected + procedure CreateParams(var Params: TCreateParams); override; + public + constructor Create; override; + {$IFDEF DELPHI9} + destructor Destroy; override; + {$ENDIF} + procedure Init(const ASourceBounds: TRect; const ASourcePoint: TPoint); + procedure MoveTo(const APosition: TPoint); + procedure Show; + procedure Hide; + + property AlphaBlended: Boolean read GetAlphaBlended; + {$IFNDEF DELPHI9} + property PopupParent: TCustomForm read FPopupParent write FPopupParent; + {$ENDIF} + property PositionOffset: TPoint read FPositionOffset write FPositionOffset; + property Visible: Boolean read GetVisible write SetVisible; + end; + + TcxDragImage = class(TcxCustomDragImage) + private + FImage: TBitmap; + FImageCanvas: TcxCanvas; + function GetWindowCanvas: TcxCanvas; + protected + procedure Paint; override; + property Image: TBitmap read FImage; + property WindowCanvas: TcxCanvas read GetWindowCanvas; + public + constructor Create; override; + destructor Destroy; override; + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; + property Canvas: TcxCanvas read FImageCanvas; + end; + + TcxDragImageClass = class of TcxDragImage; + + { TcxSizeFrame } + + TcxSizeFrame = class(TcxCustomDragImage) + private + FFillSelection: Boolean; + FFrameWidth: Integer; + FRegion: TcxRegion; + + procedure InitializeFrameRegion; + procedure SetWindowRegion; + protected + procedure Paint; override; + + property FrameWidth: Integer read FFrameWidth; + public + constructor Create(AFrameWidth: Integer = 2); reintroduce; virtual; + destructor Destroy; override; + + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; + + procedure DrawSizeFrame(const ARect: TRect); overload; + procedure DrawSizeFrame(const ARect: TRect; const ARegion: TcxRegion); overload; + + property FillSelection: Boolean read FFillSelection write FFillSelection; + end; + + { TcxDragAndDropArrow } + + TcxArrowPlace = (apLeft, apTop, apRight, apBottom); + + TcxDragAndDropArrowClass = class of TcxDragAndDropArrow; + + TcxDragAndDropArrow = class(TcxDragImage) + private + FTransparent: Boolean; + function GetTransparent: Boolean; + protected + function GetImageBackColor: TColor; virtual; + property ImageBackColor: TColor read GetImageBackColor; + public + constructor Create(ATransparent: Boolean); reintroduce; virtual; + procedure Init(AOwner: TControl; const AAreaBounds, AClientRect: TRect; + APlace: TcxArrowPlace); + property Transparent: Boolean read GetTransparent; + end; + + { TcxTimer } + + TcxTimer = class (TComponent) + private + FEnabled: Boolean; + FEventID: Cardinal; + FInterval: Cardinal; + FTimerOn: Boolean; + FOnTimer: TNotifyEvent; + function CanSetTimer: Boolean; + procedure KillTimer; + procedure SetEnabled(Value: Boolean); + procedure SetInterval(Value: Cardinal); + procedure SetOnTimer(Value: TNotifyEvent); + procedure SetTimer; + procedure SetTimerOn(Value: Boolean); + procedure UpdateTimer; + property TimerOn: Boolean read FTimerOn write SetTimerOn; + protected + procedure TimeOut; dynamic; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + published + property Enabled: Boolean read FEnabled write SetEnabled default True; + property Interval: Cardinal read FInterval write SetInterval default 1000; + property OnTimer: TNotifyEvent read FOnTimer write SetOnTimer; + end; + + { TcxDesignController } + + TcxDesignState = (dsDesignerModifying); + TcxDesignStates = set of TcxDesignState; + + TcxDesignController = class + private + FLockDesignerModifiedCount: Integer; + protected + FState: TcxDesignStates; + public + procedure DesignerModified(AForm: TCustomForm); overload; + function IsDesignerModifiedLocked: Boolean; + procedure LockDesignerModified; + procedure UnLockDesignerModified; + end; + +function CanAllocateHandle(AControl: TWinControl): Boolean; +function cxMessageWindow: TcxMessageWindow; +function DragDetect(Wnd: HWND): TcxDragDetect; +function GetMouseKeys: WPARAM; +function GetDblClickInterval: Integer; +function GetDesktopWorkArea(const P: TPoint): TRect; +function GetMonitorWorkArea(const AMonitor: Integer): TRect; +function GetMouseCursorPos: TPoint; +function GetPointPosition(const ARect: TRect; const P: TPoint; + AHorzSeparation, AVertSeparation: Boolean): TcxPosition; +function IsChildClassWindow(AWnd: HWND): Boolean; +function IsChildEx(AParentWnd, AWnd: HWND): Boolean; +function IsCtrlPressed: Boolean; +function IsOwner(AOwnerWnd, AWnd: HWND): Boolean; +function IsOwnerEx(AOwnerWnd, AWnd: HWND): Boolean; +function IsPointInDragDetectArea(const AMouseDownPos: TPoint; X, Y: Integer): Boolean; +function IsNumericChar(C: Char; AType: TcxNumberType): Boolean; +function IsTextChar(C: Char): Boolean; +procedure MakeVisibleOnDesktop(var ABounds: TRect; const ADesktopPoint: TPoint); overload; +procedure MakeVisibleOnDesktop(AControl: TControl); overload; +procedure MapWindowPoint(AHandleFrom, AHandleTo: TcxHandle; var P: TPoint); +procedure MapWindowRect(AHandleFrom, AHandleTo: TcxHandle; var R: TRect); +procedure RecreateControlWnd(AControl: TWinControl); +function RemoveAccelChars(const S: string; AAppendTerminatingUnderscore: Boolean = True): string; +procedure SetDesignerModified(AComponent: TComponent); +function ShiftStateToKeys(AShift: TShiftState): WORD; +function TranslateKey(Key: Word): Word; + +// mouse tracking +procedure BeginMouseTracking(AControl: TWinControl; const ABounds: TRect; + ACaller: IcxMouseTrackingCaller); +procedure EndMouseTracking(ACaller: IcxMouseTrackingCaller); +function IsMouseTracking(ACaller: IcxMouseTrackingCaller): Boolean; + +// hourglass cursor showing +procedure HideHourglassCursor; +procedure ShowHourglassCursor; + +// popup menu routines +function GetPopupMenuHeight(APopupMenu: TPopupMenu): Integer; +function IsPopupMenuShortCut(APopupMenu: TComponent; + var Message: TWMKey): Boolean; +function ShowPopupMenu(ACaller, AComponent: TComponent; X, Y: Integer): Boolean; +function ShowPopupMenuFromCursorPos(ACaller, AComponent: TComponent): Boolean; + +// delphi drag and drop +function GetDragObject: TDragObject; + +// drag and drop arrow +function GetDragAndDropArrowBounds(const AAreaBounds, AClientRect: TRect; APlace: TcxArrowPlace): TRect; +procedure GetDragAndDropArrowPoints(const ABounds: TRect; APlace: TcxArrowPlace; + out P: TPointArray; AForRegion: Boolean); +procedure DrawDragAndDropArrow(ACanvas: TcxCanvas; const ABounds: TRect; APlace: TcxArrowPlace); + +procedure DialogApplyFont(ADialog: TCustomForm; AFont: TFont); + +function DesignController: TcxDesignController; + +function GET_APPCOMMAND_LPARAM(lParam: LPARAM): Integer; +{$EXTERNALSYM GET_APPCOMMAND_LPARAM} + +{$IFNDEF DELPHI6} +function CheckWin32Version(AMajor: Integer; AMinor: Integer = 0): Boolean; +{$ENDIF} + +type + TcxGetParentFormForDockingFunc = function (AControl: TControl): TCustomForm; + TcxGetParentWndForDockingFunc = function (AWnd: HWND): HWND; + +var + cxDragAndDropWindowTransparency: Byte = 180; + cxGetParentFormForDocking: TcxGetParentFormForDockingFunc = nil; + cxGetParentWndForDocking: TcxGetParentWndForDockingFunc = nil; + // platform info + IsWin95X: Boolean; + IsWin2KOrXP: Boolean; + IsWinXP: Boolean; + IsWinNT: Boolean; + IsWinVista: Boolean; + dxWMGetSkinnedMessage: WORD; + dxWMSetSkinnedMessage: WORD; + +implementation + +{$R cxControls.res} + +uses + dxUxTheme, + dxThemeConsts, + SysUtils, Math, cxGeometry, cxLibraryConsts; + +const + crFullScroll = crBase + 1; + crHorScroll = crBase + 2; + crVerScroll = crBase + 3; + crUpScroll = crBase + 4; + crRightScroll = crBase + 5; + crDownScroll = crBase + 6; + crLeftScroll = crBase + 7; + + ScreenHandle = 0; + dxWMGetSkinnedMessageID = '{B2CE3777-44D8-4998-9701-47BBBC10B656}'; + dxWMSetSkinnedMessageID = '{B2CE3777-44D8-1321-4656-12C54AA613BB}'; + +type + TControlAccess = class(TControl); + TCustomFormAccess = class(TCustomForm); + TMenuItemAccess = class(TMenuItem); + + TcxTimerWindow = class(TcxMessageWindow) + protected + procedure WndProc(var Message: TMessage); override; + end; + +var + FUnitIsFinalized: Boolean; + FDragObject: TDragObject; + FUser32DLL: HMODULE; + FcxMessageWindow: TcxMessageWindow; + FcxTimerWindow: TcxTimerWindow; + FActiveTimerList: TList; + FDesignController: TcxDesignController; + +{$IFNDEF DELPHI7} + +type + TSetLayeredWindowAttributes = function(Hwnd: THandle; crKey: COLORREF; bAlpha: Byte; dwFlags: DWORD): Boolean; stdcall; + +var + SetLayeredWindowAttributes: TSetLayeredWindowAttributes = nil; + +procedure InitSetLayeredWindowAttributes; +var + AModule: HMODULE; +begin + AModule := GetModuleHandle('User32.dll'); + if AModule <> 0 then + @SetLayeredWindowAttributes := GetProcAddress(AModule, 'SetLayeredWindowAttributes'); +end; + +{$ENDIF} + +function CanAllocateHandle(AControl: TWinControl): Boolean; +begin + Result := AControl.HandleAllocated or + not (csDestroying in AControl.ComponentState) and + ((AControl.ParentWindow <> 0) or + (AControl.Parent <> nil) and CanAllocateHandle(AControl.Parent) or + ((AControl is TCustomForm) or (AControl is TCustomFrame)) and (Application <> nil) and (Application.Handle <> 0)); +end; + +function cxMessageWindow: TcxMessageWindow; +begin + if (FcxMessageWindow = nil) and not FUnitIsFinalized then + FcxMessageWindow := TcxMessageWindow.Create; + Result := FcxMessageWindow; +end; + +function DragDetect(Wnd: HWND): TcxDragDetect; +var + NoDragZone: TRect; + P: TPoint; + Msg: TMsg; +begin + Result := ddCancel; + + P := GetMouseCursorPos; + NoDragZone.Right := 2 * Mouse.DragThreshold;//GetSystemMetrics(SM_CXDRAG); + NoDragZone.Bottom := 2 * Mouse.DragThreshold;//GetSystemMetrics(SM_CYDRAG); + NoDragZone.Left := P.X - NoDragZone.Right div 2; + NoDragZone.Top := P.Y - NoDragZone.Bottom div 2; + Inc(NoDragZone.Right, NoDragZone.Left); + Inc(NoDragZone.Bottom, NoDragZone.Top); + + SetCapture(Wnd); + try + while GetCapture = Wnd do + begin + case Integer(GetMessage(Msg, 0, 0, 0)) of + -1: Break; + 0: begin + PostQuitMessage(Msg.wParam); + Break; + end; + end; + try + case Msg.message of + WM_KEYDOWN, WM_KEYUP: + if Msg.wParam = VK_ESCAPE then Break; + WM_MOUSEMOVE: + if Msg.hwnd = Wnd then + begin + P := Point(LoWord(Msg.lParam), HiWord(Msg.lParam)); + ClientToScreen(Msg.hwnd, P); + if not PtInRect(NoDragZone, P) then + begin + Result := ddDrag; + Break; + end; + end; + WM_LBUTTONUP, WM_RBUTTONUP, WM_MBUTTONUP: + begin + Result := ddNone; + Break; + end; + end; + finally + TranslateMessage(Msg); + DispatchMessage(Msg); + end; + end; + finally + if GetCapture = Wnd then ReleaseCapture; + end; +end; + +function GetMouseKeys: WPARAM; +begin + Result := 0; + if GetAsyncKeyState(VK_LBUTTON) < 0 then Inc(Result, MK_LBUTTON); + if GetAsyncKeyState(VK_MBUTTON) < 0 then Inc(Result, MK_MBUTTON); + if GetAsyncKeyState(VK_RBUTTON) < 0 then Inc(Result, MK_RBUTTON); + if GetAsyncKeyState(VK_CONTROL) < 0 then Inc(Result, MK_CONTROL); + if GetAsyncKeyState(VK_SHIFT) < 0 then Inc(Result, MK_SHIFT); +end; + +function GetDblClickInterval: Integer; +begin + Result := GetDoubleClickTime; +end; + +type + HMONITOR = type Integer; + PMonitorInfo = ^TMonitorInfo; + TMonitorInfo = packed record + cbSize: DWORD; + rcMonitor: TRect; + rcWork: TRect; + dwFalgs: DWORD; + end; + +function GetDesktopWorkArea(const P: TPoint): TRect; +const + MONITOR_DEFAULTTONEAREST = $2; +var + AMonitor: Integer; + MonitorFromPoint: function(ptScreenCoords: TPoint; dwFlags: DWORD): HMONITOR; stdcall; +begin + AMonitor := 0; + if FUser32DLL > 32 then + begin + MonitorFromPoint := GetProcAddress(FUser32DLL, 'MonitorFromPoint'); + if Assigned(MonitorFromPoint) then + begin + AMonitor := MonitorFromPoint(P, MONITOR_DEFAULTTONEAREST); + end; + end; + Result := GetMonitorWorkArea(AMonitor); +end; + +function GetMonitorWorkArea(const AMonitor: Integer): TRect; +var + Info: TMonitorInfo; + GetMonitorInfo: function(hMonitor: HMONITOR; + lpMonitorInfo: PMonitorInfo): Boolean; stdcall; +begin + if FUser32DLL > 32 then + GetMonitorInfo := GetProcAddress(FUser32DLL, 'GetMonitorInfoA') + else + GetMonitorInfo := nil; + if (AMonitor = 0) or not Assigned(GetMonitorInfo) then + SystemParametersInfo(SPI_GETWORKAREA, 0, @Result, 0) + else + begin + Info.cbSize := SizeOf(Info); + GetMonitorInfo(AMonitor, @Info); + Result := Info.rcWork; + end; +end; + +function GetMouseCursorPos: TPoint; +begin + if not Windows.GetCursorPos(Result) then + Result := cxInvalidPoint; +end; + +function GetPointPosition(const ARect: TRect; const P: TPoint; + AHorzSeparation, AVertSeparation: Boolean): TcxPosition; +const + Positions: array[Boolean, Boolean] of TcxPosition = + ((posBottom, posRight), (posLeft, posTop)); +type + TCorner = (BottomLeft, TopLeft, TopRight, BottomRight); + + function GetCornerCoords(ACorner: TCorner): TPoint; + begin + case ACorner of + BottomLeft: + Result := Point(ARect.Left, ARect.Bottom); + TopLeft: + Result := ARect.TopLeft; + TopRight: + Result := Point(ARect.Right, ARect.Top); + BottomRight: + Result := ARect.BottomRight; + end; + end; + + function GetSign(const P1, P2, P: TPoint): Integer; + begin + Result := (P.X - P1.X) * (P2.Y - P1.Y) - (P.Y - P1.Y) * (P2.X - P1.X); + end; + +var + ASign1, ASign2: Integer; +begin + if AHorzSeparation and AVertSeparation then + begin + ASign1 := GetSign(GetCornerCoords(BottomLeft), GetCornerCoords(TopRight), P); + ASign2 := GetSign(GetCornerCoords(TopLeft), GetCornerCoords(BottomRight), P); + Result := Positions[ASign1 >= 0, ASign2 >= 0]; + end + else + if AHorzSeparation then + if P.X < GetRangeCenter(ARect.Left, ARect.Right) then + Result := posLeft + else + Result := posRight + else + if AVertSeparation then + if P.Y < GetRangeCenter(ARect.Top, ARect.Bottom) then + Result := posTop + else + Result := posBottom + else + Result := posNone; +end; + +function IsChildClassWindow(AWnd: HWND): Boolean; +begin + Result := GetWindowLong(AWnd, GWL_STYLE) and WS_CHILD = WS_CHILD; +end; + +function IsChildEx(AParentWnd, AWnd: HWND): Boolean; +begin + Result := (AParentWnd <> 0) and ((AParentWnd = AWnd) or IsChild(AParentWnd, AWnd)); +end; + +function IsCtrlPressed: Boolean; +begin + Result := GetAsyncKeyState(VK_CONTROL) < 0; +end; + +function IsOwner(AOwnerWnd, AWnd: HWND): Boolean; +begin + if AOwnerWnd <> 0 then + repeat + AWnd := GetParent(AWnd); + Result := AWnd = AOwnerWnd; + until Result or (AWnd = 0) + else + Result := False; +end; + +function IsOwnerEx(AOwnerWnd, AWnd: HWND): Boolean; +begin + Result := (AOwnerWnd <> 0) and ((AOwnerWnd = AWnd) or IsOwner(AOwnerWnd, AWnd)); +end; + +function IsPointInDragDetectArea(const AMouseDownPos: TPoint; X, Y: Integer): Boolean; +begin + Result := + (Abs(X - AMouseDownPos.X) < Mouse.DragThreshold) and + (Abs(Y - AMouseDownPos.Y) < Mouse.DragThreshold); +end; + +function IsNumericChar(C: Char; AType: TcxNumberType): Boolean; +begin + Result := C in ['-', '+', '0'..'9']; + if AType in [ntFloat, ntExponent] then + begin + Result := Result or (C = DecimalSeparator); + if AType = ntExponent then + Result := Result or (C = 'e') or (C = 'E'); + end; +end; + +function IsTextChar(C: Char): Boolean; +begin + Result := C in [#32..#255]; +end; + +procedure MakeVisibleOnDesktop(var ABounds: TRect; const ADesktopPoint: TPoint); +var + ADesktopBounds: TRect; +begin + ADesktopBounds := GetDesktopWorkArea(ADesktopPoint); + if ABounds.Right > ADesktopBounds.Right then + Offsetrect(ABounds, ADesktopBounds.Right - ABounds.Right, 0); + if ABounds.Bottom > ADesktopBounds.Bottom then + OffsetRect(ABounds, 0, ADesktopBounds.Bottom - ABounds.Bottom); + if ABounds.Left < ADesktopBounds.Left then + OffsetRect(ABounds, ADesktopBounds.Left - ABounds.Left, 0); + if ABounds.Top < ADesktopBounds.Top then + OffsetRect(ABounds, 0, ADesktopBounds.Top - ABounds.Top); +end; + +procedure MakeVisibleOnDesktop(AControl: TControl); +var + ABounds: TRect; +begin + ABounds := AControl.BoundsRect; + MakeVisibleOnDesktop(ABounds, ABounds.TopLeft); + AControl.BoundsRect := ABounds; +end; + +procedure MapWindowPoint(AHandleFrom, AHandleTo: TcxHandle; var P: TPoint); +begin {10} + MapWindowPoints(AHandleFrom, AHandleTo, P, 1); +end; + +procedure MapWindowRect(AHandleFrom, AHandleTo: TcxHandle; var R: TRect); +var + p: TPoint; +begin + p := R.TopLeft; + MapWindowPoint(AHandleFrom, AHandleTo, p); + R.TopLeft := p; + p := R.BottomRight; + MapWindowPoint(AHandleFrom, AHandleTo, p); + R.BottomRight := p; +end; + +procedure RecreateControlWnd(AControl: TWinControl); +begin + if AControl.HandleAllocated then + AControl.Perform(CM_RECREATEWND, 0, 0); +end; + +function RemoveAccelChars(const S: string; AAppendTerminatingUnderscore: Boolean): string; +const + AAccelChar: Char = '&'; +var + ALastIndex, I: Integer; +begin + Result := ''; + I := 1; + ALastIndex := Length(S); + while I <= ALastIndex do + begin + if S[I] = AAccelChar then + if (I < ALastIndex) or not AAppendTerminatingUnderscore then + Inc(I) + else + begin + Result := Result + '_'; + Break; + end; + Result := Result + S[I]; + Inc(I); + end; +end; + +procedure SetDesignerModified(AComponent: TComponent); +var + ADesigner: IDesignerNotify; + //AParentForm: TCustomForm; +begin + if (AComponent is TcxControl) and not TcxControl(AComponent).IsDesigning or + not (AComponent is TcxControl) and not (csDesigning in AComponent.ComponentState) then + Exit; + ADesigner := nil; + {if AComponent is TControl then + begin + AParentForm := GetParentForm(TControl(AComponent)); + if AParentForm <> nil then + ADesigner := AParentForm.Designer; + end + else} + ADesigner := FindRootDesigner(AComponent); + if ADesigner <> nil then + ADesigner.Modified; +end; + +function ShiftStateToKeys(AShift: TShiftState): WORD; +begin + Result := 0; + if ssShift in AShift then Inc(Result, MK_SHIFT); + if ssCtrl in AShift then Inc(Result, MK_CONTROL); + if ssLeft in AShift then Inc(Result, MK_LBUTTON); + if ssRight in AShift then Inc(Result, MK_RBUTTON); + if ssMiddle in AShift then Inc(Result, MK_MBUTTON); +end; + +function TranslateKey(Key: Word): Word; +begin + Result := Key; +end; + + {$IFDEF USETCXSCROLLBAR} + +{ TcxSettingsController } + +type + TcxSettingsController = class + private + FList: TList; + protected + FWindow: HWND; + procedure MainWndProc(var Message: TMessage); + procedure WndProc(var Message: TMessage); virtual; + public + constructor Create; + destructor Destroy; override; + procedure AddListener(AListener: TcxControl); + procedure NotifyListeners; + procedure RemoveListener(AListener: TcxControl); + end; + +constructor TcxSettingsController.Create; +begin + inherited Create; + FList := TList.Create; +end; + +destructor TcxSettingsController.Destroy; +begin + FList.Free; + inherited Destroy; +end; + +procedure TcxSettingsController.AddListener(AListener: TcxControl); +begin + with FList do + if IndexOf(AListener) = -1 then + begin + if Count = 0 then + FWindow := AllocateHWnd(MainWndProc); + Add(AListener); + end; +end; + +procedure TcxSettingsController.RemoveListener(AListener: TcxControl); +begin + FList.Remove(AListener); + if FList.Count = 0 then + DeallocateHWnd(FWindow); +end; + +procedure TcxSettingsController.NotifyListeners; +var + I: Integer; +begin + for I := 0 to FList.Count - 1 do + if TCustomControl(FList[I]).HandleAllocated then + SendNotifyMessage(TCustomControl(FList[I]).Handle, CM_NCSIZECHANGED, 0, 0); +end; + +procedure TcxSettingsController.MainWndProc(var Message: TMessage); +begin + try + WndProc(Message); + except + Application.HandleException(Self); + end; +end; + +procedure TcxSettingsController.WndProc(var Message: TMessage); +begin + if (Message.Msg = WM_SETTINGCHANGE) and (Message.WParam = SPI_SETNONCLIENTMETRICS) then + begin + NotifyListeners; + Message.Result := 0; + Exit; + end; + with Message do Result := DefWindowProc(FWindow, Msg, wParam, lParam); +end; + +var + FSettingsController: TcxSettingsController; + +function cxSettingsController: TcxSettingsController; +begin + if FSettingsController = nil then + FSettingsController := TcxSettingsController.Create; + Result := FSettingsController; +end; + {$ENDIF} + +{ mouse tracking } + +var + FMouseTrackingTimerList: TList; + +function MouseTrackingTimerList: TList; +begin + if not FUnitIsFinalized and (FMouseTrackingTimerList = nil) then + FMouseTrackingTimerList := TList.Create; + Result := FMouseTrackingTimerList; +end; + +type + TMouseTrackingTimer = class(TcxTimer) + protected + procedure TimerHandler(Sender: TObject); + public + Caller: IcxMouseTrackingCaller; + Control: TWinControl; + Bounds: TRect; + constructor Create(AOwner: TComponent); override; + end; + +constructor TMouseTrackingTimer.Create(AOwner: TComponent); +begin + inherited; + Interval := 10; + OnTimer := TimerHandler; +end; + +procedure TMouseTrackingTimer.TimerHandler(Sender: TObject); +var + ACaller: IcxMouseTrackingCaller; + + function PtInCaller: Boolean; + var + ACaller2: IcxMouseTrackingCaller2; + begin + if Supports(Caller, IcxMouseTrackingCaller2, ACaller2) then + Result := Control.HandleAllocated and + (Caller as IcxMouseTrackingCaller2).PtInCaller(Control.ScreenToClient(GetMouseCursorPos)) + else + Result := PtInRect(Bounds, GetMouseCursorPos); + end; + +begin + if not PtInCaller then + begin + ACaller := Caller; + if (Control <> nil) and Control.HandleAllocated and + not PtInRect(Control.ClientRect, Control.ScreenToClient(GetMouseCursorPos)) then + SendMessage(Control.Handle, CM_MOUSELEAVE, 0, LPARAM(Control)); + if ACaller <> nil then ACaller.MouseLeave; + EndMouseTracking(ACaller); + end; +end; + +procedure BeginMouseTracking(AControl: TWinControl; const ABounds: TRect; + ACaller: IcxMouseTrackingCaller); +var + ATimer: TMouseTrackingTimer; +begin + if FUnitIsFinalized or IsMouseTracking(ACaller) then Exit; + ATimer := TMouseTrackingTimer.Create(nil); + with ATimer do + begin + Control := AControl; + Bounds := ABounds; + if Control <> nil then + MapWindowRect(Control.Handle, ScreenHandle, Bounds); + Caller := ACaller; + end; + MouseTrackingTimerList.Add(ATimer); +end; + +function GetMouseTrackingTimer(ACaller: IcxMouseTrackingCaller): TMouseTrackingTimer; +var + I: Integer; +begin + if not FUnitIsFinalized then + begin + for I := 0 to MouseTrackingTimerList.Count - 1 do + begin + Result := TMouseTrackingTimer(MouseTrackingTimerList[I]); + if Result.Caller = ACaller then Exit; + end; + end; + Result := nil; +end; + +procedure EndMouseTracking(ACaller: IcxMouseTrackingCaller); +var + ATimer: TMouseTrackingTimer; +begin + ATimer := GetMouseTrackingTimer(ACaller); + if ATimer <> nil then + begin + MouseTrackingTimerList.Remove(ATimer); + ATimer.Free; + end; +end; + +{ hourglass cursor showing } + +var + FPrevScreenCursor: TCursor; + FHourglassCursorUseCount: Integer; + +function IsMouseTracking(ACaller: IcxMouseTrackingCaller): Boolean; +begin + Result := not FUnitIsFinalized and (GetMouseTrackingTimer(ACaller) <> nil); +end; + +procedure HideHourglassCursor; +begin + if FHourglassCursorUseCount <> 0 then + begin + Dec(FHourglassCursorUseCount); + if FHourglassCursorUseCount = 0 then + Screen.Cursor := FPrevScreenCursor; + end; +end; + +procedure ShowHourglassCursor; +begin + if FHourglassCursorUseCount = 0 then + begin + FPrevScreenCursor := Screen.Cursor; + Screen.Cursor := crHourglass; + end; + Inc(FHourglassCursorUseCount); +end; + +{ popup menu routines } + +function GetPopupMenuHeight(APopupMenu: TPopupMenu): Integer; + + function IsOwnerDrawItem(AMenuItem: TMenuItem): Boolean; + begin + Result := APopupMenu.OwnerDraw or (AMenuItem.GetImageList <> nil) or + not AMenuItem.Bitmap.Empty; + end; + +const + AMenuItemHeightCorrection = 4; + APopupMenuHeightCorrection = 4; +var + ACanvas: TcxScreenCanvas; + AMenuItemDefaultHeight, AMenuItemHeight, AMenuItemWidth, I: Integer; +begin + ACanvas := TcxScreenCanvas.Create; + try + ACanvas.Font.Assign(Screen.MenuFont); + AMenuItemDefaultHeight := ACanvas.TextHeight('Qg') + AMenuItemHeightCorrection; + + Result := 0; + for I := 0 to APopupMenu.Items.Count - 1 do + if APopupMenu.Items[I].Visible then + begin + AMenuItemHeight := AMenuItemDefaultHeight; + if IsOwnerDrawItem(APopupMenu.Items[I]) then + TMenuItemAccess(APopupMenu.Items[I]).MeasureItem(ACanvas.Canvas, + AMenuItemWidth, AMenuItemHeight); + Inc(Result, AMenuItemHeight); + end; + Inc(Result, APopupMenuHeightCorrection); + finally + ACanvas.Free; + end; +end; + +function IsPopupMenuShortCut(APopupMenu: TComponent; + var Message: TWMKey): Boolean; +var + AIcxPopupMenu: IcxPopupMenu; +begin + Result := False; + if APopupMenu = nil then + Exit; + + if Supports(APopupMenu, IcxPopupMenu, AIcxPopupMenu) then + Result := AIcxPopupMenu.IsShortCutKey(Message) + else + Result := (APopupMenu is TPopupMenu) and (TPopupMenu(APopupMenu).WindowHandle <> 0) and + TPopupMenu(APopupMenu).IsShortCut(Message); +end; + +function ShowPopupMenu(ACaller, AComponent: TComponent; X, Y: Integer): Boolean; +var + AIcxPopupMenu: IcxPopupMenu; +begin + Result := False; + if AComponent <> nil then + begin + Result := True; + if Supports(AComponent, IcxPopupMenu, AIcxPopupMenu) then + AIcxPopupMenu.Popup(X, Y) + else + if (AComponent is TPopupMenu) and TPopupMenu(AComponent).AutoPopup then + with TPopupMenu(AComponent) do + begin + PopupComponent := ACaller; + Popup(X, Y); + end + else + Result := False; + end; +end; + +function ShowPopupMenuFromCursorPos(ACaller, AComponent: TComponent): Boolean; +var + P: TPoint; +begin + GetCursorPos(P); + Result := ShowPopupMenu(ACaller, AComponent, P.X, P.Y); +end; + +function GetDragObject: TDragObject; +begin + Result := FDragObject; +end; + +{ drag and drop arrow } + +const + DragAndDropArrowWidth = 11; + DragAndDropArrowHeight = 9; + DragAndDropArrowBorderColor = clBlack; + DragAndDropArrowColor = clLime; + +function GetDragAndDropArrowBounds(const AAreaBounds, AClientRect: TRect; + APlace: TcxArrowPlace): TRect; + + procedure CheckResult; + begin + if IsRectEmpty(AClientRect) then Exit; + with AClientRect do + begin + Result.Left := Max(Result.Left, Left); + Result.Right := Max(Result.Right, Left); + Result.Left := Min(Result.Left, Right - 1); + Result.Right := Min(Result.Right, Right - 1); + + Result.Top := Max(Result.Top, Top); + Result.Bottom := Max(Result.Bottom, Top); + Result.Top := Min(Result.Top, Bottom - 1); + Result.Bottom := Min(Result.Bottom, Bottom - 1); + end; + end; + + procedure CalculateHorizontalArrowBounds; + begin + Result.Bottom := Result.Top + 1; + InflateRect(Result, 0, DragAndDropArrowWidth div 2); + if APlace = apLeft then + begin + Result.Right := Result.Left; + Dec(Result.Left, DragAndDropArrowHeight); + end + else + begin + Result.Left := Result.Right; + Inc(Result.Right, DragAndDropArrowHeight); + end; + end; + + procedure CalculateVerticalArrowBounds; + begin + Result.Right := Result.Left + 1; + InflateRect(Result, DragAndDropArrowWidth div 2, 0); + if APlace = apTop then + begin + Result.Bottom := Result.Top; + Dec(Result.Top, DragAndDropArrowHeight); + end + else + begin + Result.Top := Result.Bottom; + Inc(Result.Bottom, DragAndDropArrowHeight); + end; + end; + +begin + Result := AAreaBounds; + CheckResult; + if APlace in [apLeft, apRight] then + CalculateHorizontalArrowBounds + else + CalculateVerticalArrowBounds; +end; + +procedure GetDragAndDropArrowPoints(const ABounds: TRect; APlace: TcxArrowPlace; + out P: TPointArray; AForRegion: Boolean); + + procedure CalculatePointsForLeftArrow; + begin + with ABounds do + begin + P[0] := Point(Left + 3, Top - Ord(AForRegion)); + P[1] := Point(Left + 3, Top + 3); + P[2] := Point(Left, Top + 3); + P[3] := Point(Left, Bottom - 4 + Ord(AForRegion)); + P[4] := Point(Left + 3, Bottom - 4 + Ord(AForRegion)); + P[5] := Point(Left + 3, Bottom - 1 + Ord(AForRegion)); + P[6] := Point(Right - 1 + Ord(AForRegion), Top + 5); + end; + end; + + procedure CalculatePointsForTopArrow; + begin + with ABounds do + begin + P[0] := Point(Left + 3, Top); + P[1] := Point(Right - 4 + Ord(AForRegion), Top); + P[2] := Point(Right - 4 + Ord(AForRegion), Top + 3); + P[3] := Point(Right - 1 + Ord(AForRegion), Top + 3); + P[4] := Point(Left + 5, Bottom - 1 + Ord(AForRegion)); + P[5] := Point(Left, Top + 3); + P[6] := Point(Left + 3, Top + 3); + end; + end; + + procedure CalculatePointsForRightArrow; + begin + with ABounds do + begin + P[0] := Point(Right - 4 + Ord(AForRegion), Top - Ord(AForRegion)); + P[1] := Point(Right - 4 + Ord(AForRegion), Top + 3); + P[2] := Point(Right - 1 + Ord(AForRegion), Top + 3); + P[3] := Point(Right - 1 + Ord(AForRegion), Bottom - 4 + Ord(AForRegion)); + P[4] := Point(Right - 4 + Ord(AForRegion), Bottom - 4 + Ord(AForRegion)); + P[5] := Point(Right - 4 + Ord(AForRegion), Bottom - 1 + Ord(AForRegion)); + P[6] := Point(Left, Top + 5); + end; + end; + + procedure CalculatePointsForBottomArrow; + begin + with ABounds do + begin + P[0] := Point(Left + 3, Bottom - 1 + Ord(AForRegion)); + P[1] := Point(Right - 4 + Ord(AForRegion), Bottom - 1 + Ord(AForRegion)); + P[2] := Point(Right - 4 + Ord(AForRegion), Bottom - 4 + Ord(AForRegion)); + P[3] := Point(Right - 1 + Ord(AForRegion), Bottom - 4 + Ord(AForRegion)); + P[4] := Point(Left + 5, Top - Ord(AForRegion)); + P[5] := Point(Left - Ord(AForRegion), Bottom - 4 + Ord(AForRegion)); + P[6] := Point(Left + 3, Bottom - 4); + end; + end; + +begin + SetLength(P, 7); + case APlace of + apLeft: + CalculatePointsForLeftArrow; + apTop: + CalculatePointsForTopArrow; + apRight: + CalculatePointsForRightArrow; + apBottom: + CalculatePointsForBottomArrow; + end; +end; + +procedure DrawDragAndDropArrow(ACanvas: TcxCanvas; const ABounds: TRect; + APlace: TcxArrowPlace); +var + P: TPointArray; +begin + GetDragAndDropArrowPoints(ABounds, APlace, P, False); + ACanvas.Brush.Color := DragAndDropArrowColor; + ACanvas.Pen.Color := DragAndDropArrowBorderColor; + ACanvas.Polygon(P); +end; + +{ other } + +procedure DialogApplyFont(ADialog: TCustomForm; AFont: TFont); + + function GetTextHeight: Integer; + begin + Result := ADialog.Canvas.TextHeight('Qq'); + end; + +var + AOldTextHeight, ANewTextHeight: Integer; +begin + with ADialog do + begin + AOldTextHeight := GetTextHeight; + Font := AFont; + ANewTextHeight := GetTextHeight; + TCustomFormAccess(ADialog).ScaleControls(ANewTextHeight, AOldTextHeight); + ClientWidth := MulDiv(ClientWidth, ANewTextHeight, AOldTextHeight); + ClientHeight := MulDiv(ClientHeight, ANewTextHeight, AOldTextHeight); + end; +end; + +function DesignController: TcxDesignController; +begin + if (FDesignController = nil) and not FUnitIsFinalized then + FDesignController := TcxDesignController.Create; + Result := FDesignController; +end; + +function GET_APPCOMMAND_LPARAM(lParam: LPARAM): Integer; +begin + Result := Short(HiWord(lParam) and not FAPPCOMMAND_MASK); +end; + +{$IFNDEF DELPHI6} +function CheckWin32Version(AMajor: Integer; AMinor: Integer = 0): Boolean; +begin + Result := (Win32MajorVersion > AMajor) or + ((Win32MajorVersion = AMajor) and (Win32MinorVersion >= AMinor)); +end; +{$ENDIF} + +{ TcxControlChildComponent } + +constructor TcxControlChildComponent.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Initialize; +end; + +constructor TcxControlChildComponent.CreateEx(AControl: TcxControl; AAssignOwner: Boolean = True); +begin + //FControl := AControl; + if AAssignOwner then + Create(AControl.Owner) + else + Create(nil); + Control := AControl; +end; + +destructor TcxControlChildComponent.Destroy; +begin + if FControl <> nil then + FControl.RemoveChildComponent(Self); + inherited; +end; + +function TcxControlChildComponent.GetIsLoading: Boolean; +begin + Result := csLoading in ComponentState; +end; + +function TcxControlChildComponent.GetIsDestroying: Boolean; +begin + Result := csDestroying in ComponentState; +end; + +procedure TcxControlChildComponent.Initialize; +begin +end; + +procedure TcxControlChildComponent.SetControl(Value: TcxControl); +begin + FControl := Value; +end; + +procedure TcxControlChildComponent.SetParentComponent(Value: TComponent); +begin + inherited; + if Value is TcxControl then + TcxControl(Value).AddChildComponent(Self); +end; + +function TcxControlChildComponent.GetParentComponent: TComponent; +begin + Result := FControl; +end; + +function TcxControlChildComponent.HasParent: Boolean; +begin + Result := FControl <> nil; +end; + +{ TcxControlScrollBar } + +constructor TcxControlScrollBar.Create(AOwner: TComponent); +begin + inherited; + Color := clBtnFace; + ControlStyle := ControlStyle - [csFramed] + [csNoDesignVisible]; + TabStop := False; + Visible := False; +end; + +destructor TcxControlScrollBar.Destroy; +begin + cxClearObjectLinks(Self); + inherited Destroy; +end; + +function TcxControlScrollBar.GetVisible: boolean; +begin + Result := inherited Visible; +end; + +procedure TcxControlScrollBar.SetVisible(Value: boolean); +begin + inherited Visible := Value; +end; + +procedure TcxControlScrollBar.CMDesignHitTest(var Message: TCMDesignHitTest); +begin + Message.Result := 1; +end; + +procedure TcxControlScrollBar.WndProc(var Message: TMessage); +var + ALink: TcxObjectLink; +begin + ALink := cxAddObjectLink(Self); + try + if Message.Msg = WM_LBUTTONDOWN then + FocusParent; + if ALink.Ref <> nil then + inherited; + finally + cxRemoveObjectLink(ALink); + end; +end; + +procedure TcxControlScrollBar.FocusParent; +begin + if Parent = nil then Exit; + if (Parent is TcxControl) and TcxControl(Parent).FocusWhenChildIsClicked(Self) or + not (Parent is TcxControl) and Parent.CanFocus then + Parent.SetFocus; +end; + +procedure TcxControlScrollBar.ApplyData; +begin + if Data.Visible then + begin +{$IFNDEF USETCXSCROLLBAR} + PageSize := Data.PageSize; + SetParams(Data.Position, Data.Min, Data.Max); + PageSize := Data.PageSize; // to resetup +{$ELSE} + SetScrollParams(Data.Min, Data.Max, Data.Position, Data.PageSize, True); +{$ENDIF} + SmallChange := Data.SmallChange; + LargeChange := Data.LargeChange; + end; + Enabled := Data.Enabled; + if Visible <> Data.Visible then + begin + Visible := Data.Visible; + {$IFDEF DELPHI11} + Perform(CM_SHOWINGCHANGED, 0, 0); + {$ENDIF} + end; +end; + +{ TcxSizeGrip } + +constructor TcxSizeGrip.Create(AOwner: TComponent); +begin + inherited; + Color := clBtnFace; + ControlStyle := ControlStyle + [csNoDesignVisible]; + FLookAndFeel := TcxLookAndFeel.Create(Self); + FLookAndFeel.OnChanged := LookAndFeelChanged; +end; + +destructor TcxSizeGrip.Destroy; +begin + FreeAndNil(FLookAndFeel); + inherited Destroy; +end; + +procedure TcxSizeGrip.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + Invalidate; +end; + +procedure TcxSizeGrip.WMEraseBkgnd(var AMessage: TWMEraseBkgnd); +begin + AMessage.Result := 1; +end; + +procedure TcxSizeGrip.Paint; +begin + Canvas.Brush.Color := LookAndFeel.Painter.DefaultSizeGripAreaColor; + Canvas.FillRect(ClientRect); +end; + +{ TcxDragAndDropObject } + +constructor TcxDragAndDropObject.Create(AControl: TcxControl); +begin + inherited Create; + FControl := AControl; + FCanvas := Control.Canvas; + CurMousePos := cxInvalidPoint; + PrevMousePos := cxInvalidPoint; +end; + +procedure TcxDragAndDropObject.SetDirty(Value: Boolean); +begin + if FDirty <> Value then + begin + FDirty := Value; + DirtyChanged; + end; +end; + +procedure TcxDragAndDropObject.ChangeMousePos(const P: TPoint); +begin + PrevMousePos := CurMousePos; + CurMousePos := P; +end; + +procedure TcxDragAndDropObject.DirtyChanged; +begin +end; + +function TcxDragAndDropObject.GetDragAndDropCursor(Accepted: Boolean): TCursor; +const + Cursors: array[Boolean] of TCursor = (crNoDrop, crDrag); +begin + Result := Cursors[Accepted]; +end; + +function TcxDragAndDropObject.GetImmediateStart: Boolean; +begin + Result := False; +end; + +procedure TcxDragAndDropObject.AfterDragAndDrop(Accepted: Boolean); +begin +end; + +procedure TcxDragAndDropObject.BeginDragAndDrop; +begin + DirtyChanged; +end; + +procedure TcxDragAndDropObject.DragAndDrop(const P: TPoint; var Accepted: Boolean); +begin + Dirty := False; + Screen.Cursor := GetDragAndDropCursor(Accepted); +end; + +procedure TcxDragAndDropObject.EndDragAndDrop(Accepted: Boolean); +begin + Dirty := True; +end; + +procedure TcxDragAndDropObject.DoBeginDragAndDrop; +begin + CurMousePos := Control.ScreenToClient(GetMouseCursorPos); + PrevMousePos := CurMousePos; + BeginDragAndDrop; +end; + +procedure TcxDragAndDropObject.DoDragAndDrop(const P: TPoint; var Accepted: Boolean); +begin + ChangeMousePos(P); + DragAndDrop(P, Accepted); +end; + +procedure TcxDragAndDropObject.DoEndDragAndDrop(Accepted: Boolean); +begin + EndDragAndDrop(Accepted); + AfterDragAndDrop(Accepted); +end; + +{ TcxDragControlObject } + +procedure TcxDragControlObject.Finished(Target: TObject; X, Y: Integer; Accepted: Boolean); +begin + inherited; + Free; +end; + +function TcxDragControlObject.GetDragCursor(Accepted: Boolean; X, Y: Integer): TCursor; +begin + if Accepted and (Control as TcxControl).IsCopyDragDrop then + Result := crDragCopy + else + Result := inherited GetDragCursor(Accepted, X, Y); +end; + +{ TcxControl } + +constructor TcxControl.Create(AOwner: TComponent); +begin + inherited; + if HasDragImages then + ControlStyle := ControlStyle + [csDisplayDragImage]; + FCanvas := TcxCanvas.Create(inherited Canvas); + FDefaultCursor := Cursor; + FFocusOnClick := True; + FFontListenerList := TInterfaceList.Create; + FLookAndFeel := TcxLookAndFeel.Create(Self); + FLookAndFeel.OnChanged := LookAndFeelChanged; + FScrollBars := ssBoth; + CreateScrollBars; + TabStop := MayFocus; + FLastParentBackground := True; + ParentBackground := True; +end; + +destructor TcxControl.Destroy; +begin + EndDrag(False); + DestroyScrollBars; + FFontListenerList := nil; + FreeAndNil(FActiveCanvas); + FCanvas.Free; + FreeAndNil(FLookAndFeel); + cxClearObjectLinks(Self); + inherited; +end; + +{$IFDEF DELPHI4} +procedure TcxControl.BeforeDestruction; +begin + if not (csDestroying in ComponentState) then + Destroying; +end; +{$ENDIF} + +function TcxControl.GetActiveCanvas: TcxCanvas; +begin + if HandleAllocated then + begin + if FActiveCanvas <> nil then FreeAndNil(FActiveCanvas); + Result := Canvas; + end + else + begin + if FActiveCanvas = nil then + FActiveCanvas := TcxScreenCanvas.Create; + Result := FActiveCanvas; + end; +end; + +function TcxControl.GetDragAndDropObject: TcxDragAndDropObject; +begin + if FDragAndDropObject = nil then + FDragAndDropObject := GetDragAndDropObjectClass.Create(Self); + Result := FDragAndDropObject; +end; + +function TcxControl.GetHScrollBarVisible: Boolean; +begin + if NeedsScrollBars then + if FCalculatingScrollBarsParams then + Result := FHScrollBar.Data.Visible + else + Result := FHScrollBar.Visible + else + Result := False; +end; + +function TcxControl.GetIsDestroying: Boolean; +begin + Result := csDestroying in ComponentState; +end; + +function TcxControl.GetIsLoading: Boolean; +begin + Result := csLoading in ComponentState; +end; + +function TcxControl.GetVScrollBarVisible: Boolean; +begin + if NeedsScrollBars then + if FCalculatingScrollBarsParams then + Result := FVScrollBar.Data.Visible + else + Result := FVScrollBar.Visible + else + Result := False; +end; + +procedure TcxControl.SetBorderStyle(Value: TcxControlBorderStyle); +begin + if FBorderStyle <> Value then + begin + FBorderStyle := Value; + BoundsChanged; + end; +end; + +procedure TcxControl.SetDragAndDropState(Value: TcxDragAndDropState); +begin + if FDragAndDropState <> Value then + begin + FDragAndDropState := Value; + if (Value = ddsNone) and not FFinishingDragAndDrop then DoCancelMode; + end; +end; + +procedure TcxControl.SetLookAndFeel(Value: TcxLookAndFeel); +begin + LookAndFeel.Assign(Value); +end; + +procedure TcxControl.SetKeys(Value: TcxKeys); +begin + if FKeys <> Value then + begin + FKeys := Value; + end; +end; + +procedure TcxControl.SetMouseCaptureObject(Value: TObject); +var + AIMouseCaptureObject: IcxMouseCaptureObject; + AMouseWasCaught: Boolean; +begin + if FMouseCaptureObject <> Value then + begin + if (FMouseCaptureObject <> nil) and + Supports(FMouseCaptureObject, IcxMouseCaptureObject, AIMouseCaptureObject) then + AIMouseCaptureObject.DoCancelMode; + FMouseCaptureObject := Value; + AMouseWasCaught := MouseCapture; + MouseCapture := FMouseCaptureObject <> nil; + if AMouseWasCaught and not MouseCapture and (DragAndDropState = ddsStarting) then + Perform(WM_CANCELMODE, 0, 0); + end; +end; + +procedure TcxControl.SetPopupMenu(Value: TComponent); +var + AIcxPopupMenu: IcxPopupMenu; +begin + // check Value + if (Value <> nil) and not ((Value is TPopupMenu) or + Supports(Value, IcxPopupMenu, AIcxPopupMenu)) then + Value := nil; + if FPopupMenu <> Value then + begin + if FPopupMenu <> nil then + FPopupMenu.RemoveFreeNotification(Self); + FPopupMenu := Value; + if FPopupMenu <> nil then + FPopupMenu.FreeNotification(Self); + end; +end; + +procedure TcxControl.SetScrollBars(Value: TScrollStyle); +begin + if FScrollBars <> Value then + begin + FScrollBars := Value; + BoundsChanged; + end; +end; + +{$IFNDEF DELPHI7} +procedure TcxControl.SetParentBackground(Value: Boolean); +begin + if FParentBackground <> Value then + begin + FParentBackground := Value; + Invalidate; + end; +end; +{$ENDIF} + +procedure TcxControl.WMCancelMode(var Message: TWMCancelMode); +begin + inherited; + FinishDragAndDrop(False); + DoCancelMode; +end; + +procedure TcxControl.WMContextMenu(var Message: TWMContextMenu); +var + Pt, Temp: TPoint; + Handled: Boolean; +begin + if Message.Result <> 0 then Exit; + if csDesigning in ComponentState then + begin + inherited; + Exit; + end; + + Pt := SmallPointToPoint(Message.Pos); + if (Pt.x = -1) and (Pt.y = -1) then + Temp := Pt + else + begin + Temp := ScreenToClient(Pt); + if not PtInRect(ClientRect, Temp) then + begin + inherited; + Exit; + end; + end; + + Handled := False; + DoContextPopup(Temp, Handled); + Message.Result := Ord(Handled); + if Handled then Exit; + + inherited; +end; + +procedure TcxControl.WMEraseBkgnd(var Message: TWMEraseBkgnd); +begin + if HasBackground then + inherited + else + Message.Result := 1; +end; + +procedure TcxControl.WMGetDlgCode(var Message: TWMGetDlgCode); +const + DlgCodes: array[TcxKey] of Integer = + (DLGC_WANTALLKEYS, DLGC_WANTARROWS, DLGC_WANTCHARS, DLGC_WANTTAB); +var + I: TcxKey; + Res: Integer; +begin + Res := 0; + for I := Low(TcxKey) to High(TcxKey) do + if (I in FKeys) and ((I <> kTab) or (GetAsyncKeyState(VK_CONTROL) >= 0)) then + Inc(Res, DlgCodes[I]); + Message.Result := Res; +end; + +procedure TcxControl.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + inherited; + PostMessage(Handle, CM_NCSIZECHANGED, 0, 0); +end; + +procedure TcxControl.WMPaint(var Message: TWMPaint); +begin + HideDragImage; + inherited; + ShowDragImage; +end; + +procedure TcxControl.WMSetCursor(var Message: TWMSetCursor); +var + P: TPoint; +begin + P := ScreenToClient(GetMouseCursorPos); + with P do + if IsDesigning and (DragAndDropState = ddsNone) and GetDesignHitTest(X, Y, [ssLeft]) then + SetCursor(Screen.Cursors[GetCursor(X, Y)]) + else + inherited; +end; + +procedure TcxControl.CMColorChanged(var Message: TMessage); +begin + ColorChanged; + inherited; +end; + +procedure TcxControl.CMCursorChanged(var Message: TMessage); +begin + CursorChanged; + inherited; +end; + +procedure TcxControl.CMDesignHitTest(var Message: TCMDesignHitTest); +begin + inherited; + with Message do + if Result = 0 then + Result := Integer(GetDesignHitTest(XPos, YPos, KeysToShiftState(Keys))); +end; + +procedure TcxControl.CMFontChanged(var Message: TMessage); +begin + inherited; + FontChanged; +end; + +procedure TcxControl.CMMouseEnter(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseEnter(Self) + else + MouseEnter(TControl(Message.lParam)); +end; + +procedure TcxControl.CMMouseLeave(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseLeave(Self) + else + MouseLeave(TControl(Message.lParam)); +end; + +procedure TcxControl.CMNCSizeChanged(var Message: TMessage); +var + ANewHeight, ANewWidth: Integer; +begin + if not NeedsScrollBars then Exit; + ANewHeight := GetSystemMetrics(SM_CYHSCROLL); + ANewWidth := GetSystemMetrics(SM_CXVSCROLL); + if (FHScrollBar.Height <> ANewHeight) or (FVScrollBar.Width <> ANewWidth) then + begin + FHScrollBar.Height := ANewHeight; + FVScrollBar.Width := ANewWidth; + BoundsChanged; + end; +end; + +procedure TcxControl.CMTextChanged(var Message: TMessage); +begin + inherited; + TextChanged; +end; + +procedure TcxControl.CMVisibleChanged(var Message: TMessage); +begin + inherited; + VisibleChanged; +end; + +procedure TcxControl.CNKeyDown(var Message: TWMKeyDown); +begin + // TODO: for D7 UpdateUIState(Message.CharCode);? + if IsMenuKey(Message) then + begin + Message.Result := 1; + Exit; + end; + if DragAndDropState <> ddsNone then + begin + if Message.CharCode = VK_ESCAPE then + SendMessage(Handle, WM_KEYDOWN, Message.CharCode, Message.KeyData); + Message.Result := 1; + Exit; + end; + inherited; +end; + +procedure TcxControl.CNSysKeyDown(var Message: TWMKeyDown); +begin + if IsMenuKey(Message) then + begin + Message.Result := 1; + Exit; + end; + inherited; +end; + +procedure TcxControl.CreateScrollBars; + + procedure SetControlsReplicatable(const AControls: array of TControl); + var + I: Integer; + begin + for I := Low(AControls) to High(AControls) do + with AControls[I] do + ControlStyle := ControlStyle + [csReplicatable]; + end; + +begin + if not NeedsScrollBars or (FSizeGrip <> nil) then Exit; + FHScrollBar := TcxControlScrollBar.Create(nil); + FHScrollBar.Kind := sbHorizontal; + FHScrollBar.OnScroll := ScrollEvent; + FVScrollBar := TcxControlScrollBar.Create(nil); + FVScrollBar.Kind := sbVertical; + FVScrollBar.OnScroll := ScrollEvent; + FSizeGrip := TcxSizeGrip.Create(nil); + FSizeGrip.LookAndFeel.MasterLookAndFeel := LookAndFeel; + SetControlsReplicatable([FHScrollBar, FVScrollBar, FSizeGrip]); +{$IFDEF USETCXSCROLLBAR} + FHScrollBar.LookAndFeel.MasterLookAndFeel := LookAndFeel; + FVScrollBar.LookAndFeel.MasterLookAndFeel := LookAndFeel; + cxSettingsController.AddListener(Self); +{$ENDIF} +end; + +procedure TcxControl.DestroyScrollBars; +begin + if FSizeGrip = nil then Exit; +{$IFDEF USETCXSCROLLBAR} + cxSettingsController.RemoveListener(Self); +{$ENDIF} + FreeAndNil(FSizeGrip); + FreeAndNil(FVScrollBar); + FreeAndNil(FHScrollBar); +end; + +procedure TcxControl.ScrollEvent(Sender: TObject; ScrollCode: TScrollCode; + var ScrollPos: Integer); +begin + Scroll(TcxControlScrollBar(Sender).Kind, ScrollCode, ScrollPos); +end; + +procedure TcxControl.CreateParams(var Params: TCreateParams); +begin + inherited; + with Params do + Style := Style or WS_CLIPCHILDREN; +end; + +procedure TcxControl.CreateWnd; +begin + FCreatingWindow := True; + try + inherited; + CheckNeedsScrollBars; + InitControl; + finally + FCreatingWindow := False; + end; +end; + +procedure TcxControl.Resize; +begin + inherited; + BoundsChanged; +end; + +procedure TcxControl.WndProc(var Message: TMessage); + + function GetMousePos: TPoint; + begin + if HandleAllocated and ((Width > 32768) or (Height > 32768)) then + Result := ScreenToClient(GetMouseCursorPos) + else + Result := SmallPointToPoint(TWMMouse(Message).Pos); + end; + + function GetMouseButton: TMouseButton; + begin + case Message.Msg of + WM_LBUTTONDOWN: + Result := mbLeft; + WM_RBUTTONDOWN: + Result := mbRight; + else + Result := mbMiddle; + end; + end; + + procedure DoAfterMouseDown; + begin + case Message.Msg of + WM_LBUTTONDOWN, WM_RBUTTONDOWN, WM_MBUTTONDOWN: + with GetMousePos do + AfterMouseDown(GetMouseButton, X, Y); + end; + end; + +var + ALink: TcxObjectLink; +begin + ALink := cxAddObjectLink(Self); + try + if ((Message.Msg = WM_LBUTTONDOWN) or (Message.Msg = WM_LBUTTONDBLCLK)) and not Dragging and + (IsDesigning and GetDesignHitTest(GetMousePos.X, GetMousePos.Y, [ssLeft]) or + not IsDesigning and (DragMode = dmAutomatic)) then + begin + if not IsControlMouseMsg(TWMMouse(Message)) then + begin + ControlState := ControlState + [csLButtonDown]; + Dispatch(Message); + ControlState := ControlState - [csLButtonDown]; + end; + Exit; + end; + if Message.Msg = WM_RBUTTONUP then + FMouseRightButtonReleased := True; + inherited; + finally + try + if ALink.Ref <> nil then + begin + case Message.Msg of + (*WM_KEYDOWN: + if Message.wParam = VK_ESCAPE then FinishDragAndDrop(False);//!!!*) + WM_RBUTTONUP: + FMouseRightButtonReleased := False; + WM_SETFOCUS, WM_KILLFOCUS: + FocusChanged; + WM_PAINT: + if ParentBackground <> FLastParentBackground then + begin + FLastParentBackground := ParentBackground; + ParentBackgroundChanged; + end; + end; + DoAfterMouseDown; + end; + finally + cxRemoveObjectLink(ALink); + end; + end; +end; + +procedure TcxControl.DestroyWindowHandle; +begin + inherited DestroyWindowHandle; + ControlState := ControlState - [csClicked]; +end; + +procedure TcxControl.DoContextPopup(MousePos: TPoint; + var Handled: Boolean); +var + P: TPoint; +begin + inherited; + if not Handled then + begin + if (MousePos.X = -1) and (MousePos.Y = -1) then + P := ClientToScreen(Point(0, 0)) // TODO: GetOffsetPos method + else + P := ClientToScreen(MousePos); + Handled := DoShowPopupMenu(PopupMenu, P.X, P.Y); + end; +end; + +function TcxControl.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; +const + ADirections: array[Boolean, Boolean] of TcxDirection = ((dirLeft, dirRight), (dirUp, dirDown)); +var + I: Integer; +begin + Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos); + if not Result and (MouseWheelScrollingKind <> mwskNone) then + begin + for I := 0 to Mouse.WheelScrollLines - 1 do + ScrollContent(ADirections[MouseWheelScrollingKind = mwskVertical, WheelDelta < 0]); + Result := True; + end; +end; + +function TcxControl.DoShowPopupMenu(AMenu: TComponent; X, Y: Integer): Boolean; +begin + Result := ShowPopupMenu(Self, AMenu, X, Y); +end; + +function TcxControl.GetPopupMenu: TPopupMenu; +begin + if FPopupMenu is TPopupMenu then + Result := TPopupMenu(FPopupMenu) + else + Result := nil; +end; + +function TcxControl.IsMenuKey(var Message: TWMKey): Boolean; +var + AControl: TWinControl; +begin + Result := False; + if not IsDesigning then + begin + AControl := Self; + repeat + if (AControl is TcxControl) and + IsPopupMenuShortCut(TcxControl(AControl).PopupMenu, Message) then + begin + Result := True; + Break; + end; + AControl := AControl.Parent; + until AControl = nil; + end; +end; + +procedure TcxControl.KeyDown(var Key: Word; Shift: TShiftState); +begin + if Key = VK_ESCAPE then FinishDragAndDrop(False); + inherited; +end; + +procedure TcxControl.Modified; + + function IsValidComponentState(AComponent: TComponent): Boolean; + begin + Result := AComponent.ComponentState * [csLoading, csWriting, csDestroying] = []; + end; + +var + AControl: TWinControl; + ACanSetModified: Boolean; +begin + if not IsDesigning then Exit; + ACanSetModified := False; + AControl := Self; + while AControl is TWinControl do + begin + ACanSetModified := IsValidComponentState(AControl); + if not ACanSetModified then Break; + AControl := AControl.Parent; + end; + if ACanSetModified then + SetDesignerModified(Self); +end; + +procedure TcxControl.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + + procedure ProcessDragAndDrop; + begin + if (Button = mbLeft) and not (ssDouble in Shift) and StartDragAndDrop(Point(X, Y)) then + if DragAndDropObject.ImmediateStart then + BeginDragAndDrop + else + DragAndDropState := ddsStarting + else + FinishDragAndDrop(False); + end; + +var + ALink: TcxObjectLink; + AOriginalBounds: TRect; +begin + FMouseDownPos := Point(X, Y); + ALink := cxAddObjectLink(Self); + try + if CanFocusOnClick(X, Y) and not (ssDouble in Shift) then // to allow form showing on dbl click + begin + AOriginalBounds := BoundsRect; + SetFocus; + if ALink.Ref = nil then Exit; + // to workaround the bug in VCL with parented forms + if (GetParentForm(Self) <> nil) and (GetParentForm(Self).ActiveControl = Self) and + not IsFocused then + Windows.SetFocus(Handle); + if not IsFocused and not AllowDragAndDropWithoutFocus then + begin + MouseCapture := False; + Exit; + end; + Inc(X, AOriginalBounds.Left - Left); + Inc(Y, AOriginalBounds.Top - Top); + end; + ProcessDragAndDrop; + if ALink.Ref = nil then Exit; + BeforeMouseDown(Button, Shift, X, Y); + if ALink.Ref = nil then Exit; + inherited; + finally + if ALink.Ref <> nil then + if MouseCapture then FMouseButtonPressed := True; + cxRemoveObjectLink(ALink); + end; +end; + +procedure TcxControl.MouseMove(Shift: TShiftState; X, Y: Integer); +var + AAccepted: Boolean; + + procedure SetCursor; + var + ACursor: TCursor; + begin + ACursor := FDefaultCursor; + Cursor := GetCursor(X, Y); + FDefaultCursor := ACursor; + end; + +begin + SetCursor; + inherited; + if (DragAndDropState = ddsStarting) and not IsMouseInPressedArea(X, Y) then + BeginDragAndDrop; + if DragAndDropState = ddsInProcess then + begin + AAccepted := False; + DragAndDrop(Point(X, Y), AAccepted); + end; +end; + +procedure TcxControl.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FMouseButtonPressed := False; + CancelMouseOperations; + inherited; +end; + +procedure TcxControl.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if (Operation = opRemove) and (AComponent = PopupMenu) then + PopupMenu := nil; +end; + +procedure TcxControl.Paint; +begin + if FBorderStyle = cxcbsDefault then + begin + LookAndFeelPainter.DrawBorder(Canvas, Bounds); + Canvas.IntersectClipRect(ClientBounds); + end; + inherited; + // CB9021 - bug in VCL: to actually show internal controls + // if they were made visible when one of the parent's Showing was False + UpdateInternalControlsState; +end; + +procedure TcxControl.ColorChanged; +begin +end; + +procedure TcxControl.DoScrolling; +const + ScrollTimeStep = 20; + ScrollValueStep = 5; + MaxSpeed = 12; +var + BreakOnMouseUp: Boolean; + AllowHorScrolling, AllowVerScrolling: Boolean; + P, PrevP, AnchorPos: TPoint; + AnchorSize, Speed, TimerHits: Integer; + AnchorWnd, CaptureWnd: HWND; + Direction: TcxDirection; + Timer: UINT; + Msg: TMsg; + + function CreateScrollingAnchorWnd: HWND; + var + B: TBitmap; + W, H: Integer; + Rgn: HRGN; + DC: HDC; + + function GetResourceBitmapName: string; + begin + if AllowHorScrolling and AllowVerScrolling then + Result := 'CX_FULLSCROLLBITMAP' + else + if AllowHorScrolling then + Result := 'CX_HORSCROLLBITMAP' + else + Result := 'CX_VERSCROLLBITMAP'; + end; + + begin + B := TBitmap.Create; + B.LoadFromResourceName(HInstance, GetResourceBitmapName); + + W := B.Width; + H := B.Height; + AnchorSize := W; + with AnchorPos do + Result := CreateWindowEx(WS_EX_TOPMOST, 'STATIC', nil, WS_POPUP, + X - W div 2, Y - H div 2, W, H, Handle, 0, HInstance, nil); + Rgn := CreateEllipticRgn(0, 0, W + 1, H + 1); + SetWindowRgn(Result, Rgn, True); + SetWindowPos(Result, 0, 0, 0, 0, 0, + SWP_NOZORDER or SWP_NOMOVE or SWP_NOSIZE or SWP_SHOWWINDOW or SWP_NOACTIVATE); + + DC := GetWindowDC(Result); + BitBlt(DC, 0, 0, W, H, B.Canvas.Handle, 0, 0, SRCCOPY); + Rgn := CreateEllipticRgn(0, 0, W + 1, H + 1); + FrameRgn(DC, Rgn, GetSysColorBrush(COLOR_WINDOWTEXT), 1, 1); + DeleteObject(Rgn); + ReleaseDC(Result, DC); + + B.Free; + end; + + procedure CalcDirectionAndSpeed(const P: TPoint); + var + DeltaX, DeltaY, SpeedValue: Integer; + + function GetNeutralZone: TRect; + begin + Result := Classes.Bounds(AnchorPos.X - AnchorSize div 2, AnchorPos.Y - AnchorSize div 2, AnchorSize, AnchorSize); + if not AllowHorScrolling then + begin + Result.Left := 0; + Result.Right := Screen.Width; + end; + if not AllowVerScrolling then + begin + Result.Top := 0; + Result.Bottom := Screen.Height; + end; + end; + + begin + if PtInRect(GetNeutralZone, P) then + begin + Direction := dirNone; + Speed := 0; + Exit; + end + else + begin + BreakOnMouseUp := True; + DeltaX := P.X - AnchorPos.X; + DeltaY := P.Y - AnchorPos.Y; + if AllowHorScrolling and (not AllowVerScrolling or (Abs(DeltaX) > Abs(DeltaY))) then + begin + if DeltaX < 0 then + Direction := dirLeft + else + Direction := dirRight; + SpeedValue := Abs(DeltaX); + end + else + begin + if DeltaY < 0 then + Direction := dirUp + else + Direction := dirDown; + SpeedValue := Abs(DeltaY); + end; + end; + Dec(SpeedValue, AnchorSize div 2); + Speed := 1 + SpeedValue div ScrollValueStep; + if Speed > MaxSpeed then Speed := MaxSpeed; + end; + + procedure SetMouseCursor; + var + Cursor: TCursor; + begin + case Direction of + dirLeft: + Cursor := crLeftScroll; + dirUp: + Cursor := crUpScroll; + dirRight: + Cursor := crRightScroll; + dirDown: + Cursor := crDownScroll; + else + if AllowHorScrolling and AllowVerScrolling then + Cursor := crFullScroll + else + if AllowHorScrolling then + Cursor := crHorScroll + else + Cursor := crVerScroll; + end; + SetCursor(Screen.Cursors[Cursor]); + end; + +begin + AllowHorScrolling := HScrollBarVisible; + AllowVerScrolling := VScrollBarVisible; + if not (AllowHorScrolling or AllowVerScrolling) then Exit; + FIsScrollingContent := True; + BreakOnMouseUp := False; + PrevP := GetMouseCursorPos; + AnchorPos := PrevP; + AnchorWnd := CreateScrollingAnchorWnd; + Direction := dirNone; + SetMouseCursor; + Speed := 1; + TimerHits := 0; + Timer := SetTimer(0, 0, ScrollTimeStep, nil); + + CaptureWnd := Handle; + SetCapture(CaptureWnd); + try + while GetCapture = CaptureWnd do + begin + case Integer(GetMessage(Msg, 0, 0, 0)) of + -1: Break; + 0: begin + PostQuitMessage(Msg.wParam); + Break; + end; + end; + if (Msg.message = WM_PAINT) and (Msg.hwnd = AnchorWnd) then + begin + ValidateRect(AnchorWnd, nil); + Continue; + end; + if (Msg.message >= WM_MOUSEFIRST) and (Msg.message <= WM_MOUSELAST) and + (Msg.message <> WM_MOUSEMOVE) and (Msg.message <> WM_MBUTTONUP) then + Break; + try + case Msg.message of + WM_KEYDOWN, WM_KEYUP: + if Msg.wParam = VK_ESCAPE then Break; + WM_MOUSEMOVE: + begin + P := SmallPointToPoint(TSmallPoint(Msg.lParam)); + Windows.ClientToScreen(Msg.hwnd, P); + if (P.X <> PrevP.X) or (P.Y <> PrevP.Y) then + begin + CalcDirectionAndSpeed(P); + SetMouseCursor; + PrevP := P; + end; + end; + WM_LBUTTONDOWN, WM_RBUTTONDOWN: + Break; + WM_MBUTTONUP: + if BreakOnMouseUp then Break; + WM_TIMER: + if UINT(Msg.wParam) = Timer then + begin + Inc(TimerHits); + if TimerHits mod (MaxSpeed - Speed + 1) = 0 then + ScrollContent(Direction); + end; + end; + finally + TranslateMessage(Msg); + DispatchMessage(Msg); + end; + end; + finally + if GetCapture = CaptureWnd then ReleaseCapture; + + KillTimer(0, Timer); + DestroyWindow(AnchorWnd); + FIsScrollingContent := False; + end; +end; + +procedure TcxControl.ParentBackgroundChanged; +begin +end; + +procedure TcxControl.VisibleChanged; +begin +end; + +procedure TcxControl.AddChildComponent(AComponent: TcxControlChildComponent); +begin + AComponent.Control := Self; +end; + +procedure TcxControl.RemoveChildComponent(AComponent: TcxControlChildComponent); +begin + AComponent.Control := nil; +end; + +procedure TcxControl.AfterMouseDown(AButton: TMouseButton; X, Y: Integer); +begin + if (DragMode = dmAutomatic) and (AButton = mbLeft) and + MouseCapture and { to prevent drag and drop when mouse button is released already } + (not IsDesigning or AllowAutoDragAndDropAtDesignTime(X, Y, [])) and + CanDrag(X, Y) and (DragDetect(Handle) = ddDrag) then + BeginDrag(True{False}); + if AButton = mbMiddle then DoScrolling; +end; + +function TcxControl.AllowAutoDragAndDropAtDesignTime(X, Y: Integer; + Shift: TShiftState): Boolean; +begin + Result := True; +end; + +function TcxControl.AllowDragAndDropWithoutFocus: Boolean; +begin + Result := False; +end; + +procedure TcxControl.BeforeMouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin +end; + +procedure TcxControl.BoundsChanged; +begin + UpdateScrollBars; +end; + +procedure TcxControl.BringInternalControlsToFront; +begin + FHScrollBar.BringToFront; + FVScrollBar.BringToFront; + FSizeGrip.BringToFront; +end; + +procedure TcxControl.CancelMouseOperations; +begin + FinishDragAndDrop(True); + MouseCaptureObject := nil; +end; + +function TcxControl.CanDrag(X, Y: Integer): Boolean; +begin + Result := DragAndDropState = ddsNone; +end; + +function TcxControl.CanFocusOnClick: Boolean; +begin + Result := not IsDesigning and FFocusOnClick and MayFocus and CanFocus; +end; + +function TcxControl.CanFocusOnClick(X, Y: Integer): Boolean; +begin + Result := CanFocusOnClick; +end; + +procedure TcxControl.CursorChanged; +begin + FDefaultCursor := Cursor; +end; + +procedure TcxControl.DoCancelMode; +begin + FMouseButtonPressed := False; + MouseCaptureObject := nil; +end; + +procedure TcxControl.FocusChanged; +begin + if Assigned(FOnFocusChanged) then FOnFocusChanged(Self); +end; + +function TcxControl.FocusWhenChildIsClicked(AChild: TControl): Boolean; +begin + Result := CanFocusOnClick; +end; + +procedure TcxControl.FontChanged; +var + I: Integer; +begin + for I := 0 to FFontListenerList.Count - 1 do + IcxFontListener(FFontListenerList[I]).Changed(Self, Font); + Invalidate; +end; + +function TcxControl.GetBorderSize: Integer; +begin + if FBorderStyle = cxcbsNone then + Result := 0 + else + Result := LookAndFeelPainter.BorderSize; +end; + +function TcxControl.GetBounds: TRect; +begin + if IsRectEmpty(FBounds) then + if HandleAllocated then + Result := ClientRect + else + Result := Rect(0, 0, Width, Height) + else + Result := FBounds; +end; + +function TcxControl.GetClientBounds: TRect; +begin + Result := Bounds; + InflateRect(Result, -BorderSize, -BorderSize); + if HScrollBarVisible then + Dec(Result.Bottom, FHScrollBar.Height); + if VScrollBarVisible then + Dec(Result.Right, FVScrollBar.Width); +end; + +function TcxControl.GetCursor(X, Y: Integer): TCursor; +begin + Result := FDefaultCursor; +end; + +function TcxControl.GetDesignHitTest(X, Y: Integer; Shift: TShiftState): Boolean; +begin + Result := (DragAndDropState <> ddsNone) or FMouseButtonPressed; +end; + +function TcxControl.GetDragObjectClass: TDragControlObjectClass; +begin + Result := TcxDragControlObject; +end; + +function TcxControl.GetIsDesigning: Boolean; +begin + Result := csDesigning in ComponentState; +end; + +function TcxControl.GetIsFocused: Boolean; +begin {7} + Result := Focused; +end; + +function TcxControl.GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; +begin + if VScrollBarVisible then + Result := mwskVertical + else + Result := mwskNone; +end; + +function TcxControl.HasBackground: Boolean; +begin + Result := False; +end; + +procedure TcxControl.InitControl; +begin + InitScrollBars; +end; + +function TcxControl.IsInternalControl(AControl: TControl): Boolean; +begin + Result := (AControl = FHScrollBar) or (AControl = FVScrollBar) or + (AControl = FSizeGrip); +end; + +function TcxControl.MayFocus: Boolean; +begin + Result := True; +end; + +procedure TcxControl.MouseEnter(AControl: TControl); +begin + CallNotify(FOnMouseEnter, Self); +end; + +procedure TcxControl.MouseLeave(AControl: TControl); +begin + CallNotify(FOnMouseLeave, Self); +end; + +procedure TcxControl.TextChanged; +begin +end; + +function TcxControl.GetLookAndFeelValue: TcxLookAndFeel; +begin + Result := LookAndFeel; +end; + +function TcxControl.GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := LookAndFeel.Painter; +end; + +procedure TcxControl.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin +end; + +procedure TcxControl.InitScrollBarsParameters; +begin +end; + +function TcxControl.IsPixelScrollBar(AKind: TScrollBarKind): Boolean; +begin + Result := False; +end; + +function TcxControl.NeedsScrollBars: Boolean; +begin + Result := True; +end; + +function TcxControl.NeedsToBringInternalControlsToFront: Boolean; +begin +{$IFDEF DELPHI9} + Result := not IsDesigning; +{$ELSE} + Result := True; +{$ENDIF} +end; + +procedure TcxControl.Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); +begin +end; + +function TcxControl.CanScrollLineWithoutScrollBars(ADirection: TcxDirection): Boolean; +begin + Result := False; +end; + +procedure TcxControl.CheckNeedsScrollBars; +begin + if NeedsScrollBars then + begin + CreateScrollBars; + if HandleAllocated then + InitScrollBars; + end + else + DestroyScrollBars; +end; + +function TcxControl.GetHScrollBarBounds: TRect; +begin + Result := ClientBounds; + Result.Top := Result.Bottom; + Result.Bottom := Result.Top + FHScrollBar.Height; +end; + +function TcxControl.GetSizeGripBounds: TRect; +begin + with Result do + begin + Left := FVScrollBar.Left; + Right := Left + FVScrollBar.Width; + Top := FHScrollBar.Top; + Bottom := Top + FHScrollBar.Height; + end; +end; + +function TcxControl.GetVScrollBarBounds: TRect; +begin + Result := ClientBounds; + Result.Left := Result.Right; + Result.Right := Result.Left + FVScrollBar.Width; +end; + +procedure TcxControl.InitScrollBars; +begin + if NeedsScrollBars then + begin + FHScrollBar.Parent := Self; + FVScrollBar.Parent := Self; + FSizeGrip.Parent := Self; + end; +end; + +procedure TcxControl.SetInternalControlsBounds; +begin + if FHScrollBar.Visible then + FHScrollBar.BoundsRect := GetHScrollBarBounds; + if FVScrollBar.Visible then + FVScrollBar.BoundsRect := GetVScrollBarBounds; + if FSizeGrip.Visible then + FSizeGrip.BoundsRect := GetSizeGripBounds; +end; + +procedure TcxControl.UpdateInternalControlsState; +begin + if not NeedsScrollBars then Exit; + if FHScrollBar.Visible then + FHScrollBar.UpdateControlState; + if FVScrollBar.Visible then + FVScrollBar.UpdateControlState; + if FSizeGrip.Visible then + FSizeGrip.UpdateControlState; +end; + +procedure TcxControl.UpdateScrollBars; +var + APrevUpdatingScrollBars, APrevHScrollBarVisible, APrevVScrollBarVisible: Boolean; + + procedure CalculateScrollBarsParams; + var + APrevHScrollBarVisible, APrevVScrollBarVisible: Boolean; + + procedure CheckPixelScrollBars; + var + AHideScrollBar: array[TScrollBarKind] of Boolean; + I: TScrollBarKind; + + function GetScrollBar(AScrollBarKind: TScrollBarKind): TcxControlScrollBar; + begin + if AScrollBarKind = sbHorizontal then + Result := FHScrollBar + else + Result := FVScrollBar; + end; + + function CanHide(AScrollBarKind: TScrollBarKind): Boolean; + begin + with GetScrollBar(AScrollBarKind).Data do + Result := Visible and Enabled and AllowHide; + end; + + function GetOppositeScrollBarSize(AScrollBarKind: TScrollBarKind): Integer; + begin + if AScrollBarKind = sbHorizontal then + Result := FVScrollBar.Width + else + Result := FHScrollBar.Height; + end; + + procedure CheckPixelScrollBar(AScrollBarKind: TScrollBarKind); + begin + if IsPixelScrollBar(AScrollBarKind) then + with GetScrollBar(AScrollBarKind).Data do + if PageSize + GetOppositeScrollBarSize(AScrollBarKind) >= Max - Min + 1 then + AHideScrollBar[AScrollBarKind] := True; + end; + + begin + if not CanHide(sbHorizontal) or not CanHide(sbVertical) then Exit; + AHideScrollBar[sbHorizontal] := False; + AHideScrollBar[sbVertical] := False; + CheckPixelScrollBar(sbHorizontal); + CheckPixelScrollBar(sbVertical); + if AHideScrollBar[sbHorizontal] and AHideScrollBar[sbVertical] then + for I := Low(TScrollBarKind) to High(TScrollBarKind) do + with GetScrollBar(I).Data do + SetScrollBarInfo(I, Min, Max, SmallChange, PageSize + GetOppositeScrollBarSize(I), + Position, AllowShow, AllowHide); + end; + + begin + if FCalculatingScrollBarsParams then Exit; + FCalculatingScrollBarsParams := True; + try + FHScrollBar.Data.Visible := False; + FVScrollBar.Data.Visible := False; + repeat + APrevHScrollBarVisible := HScrollBarVisible; + APrevVScrollBarVisible := VScrollBarVisible; + //BoundsChanged; - causes things like Left/TopPos to be recalculated during scrolling + InitScrollBarsParameters; + until (HScrollBarVisible = APrevHScrollBarVisible) and + (VScrollBarVisible = APrevVScrollBarVisible); + CheckPixelScrollBars; + finally + FCalculatingScrollBarsParams := False; + end; + end; + + function GetIsInitialScrollBarsParams: Boolean; + begin + Result := APrevUpdatingScrollBars and + (FHScrollBar.Data.Visible = FInitialHScrollBarVisible) and + (FVScrollBar.Data.Visible = FInitialVScrollBarVisible); + end; + + procedure CheckScrollBarParams(AScrollBar: TcxControlScrollBar; AInitialVisible: Boolean); + begin + with AScrollBar do + if Visible <> AInitialVisible then + begin + Enabled := False; + Visible := True; + end; + end; + + function IsBoundsChangeNeeded: Boolean; + begin + Result := + (FHScrollBar.Visible <> APrevHScrollBarVisible) or + (FVScrollBar.Visible <> APrevVScrollBarVisible); + end; + +begin + if not NeedsScrollBars then Exit; + if FScrollBarsLockCount > 0 then + begin + FScrollBarsUpdateNeeded := True; + Exit; + end; + if not FUpdatingScrollBars then + begin + FInitialHScrollBarVisible := FHScrollBar.Visible; + FInitialVScrollBarVisible := FVScrollBar.Visible; + end; + APrevUpdatingScrollBars := FUpdatingScrollBars; + FUpdatingScrollBars := True; + try + APrevHScrollBarVisible := FHScrollBar.Visible; + APrevVScrollBarVisible := FVScrollBar.Visible; + if not FIsInitialScrollBarsParams then + begin + CalculateScrollBarsParams; + FIsInitialScrollBarsParams := GetIsInitialScrollBarsParams; + if FIsInitialScrollBarsParams then + begin + CheckScrollBarParams(FHScrollBar, FInitialHScrollBarVisible); + CheckScrollBarParams(FVScrollBar, FInitialVScrollBarVisible); + end + else + begin + FHScrollBar.ApplyData; + FVScrollBar.ApplyData; + end; + end; + if IsBoundsChangeNeeded then + BoundsChanged + else + begin + FSizeGrip.Visible := FHScrollBar.Visible and FVScrollBar.Visible; + SetInternalControlsBounds; + if NeedsToBringInternalControlsToFront then + BringInternalControlsToFront; + end; + finally + if not APrevUpdatingScrollBars then + FIsInitialScrollBarsParams := False; + FUpdatingScrollBars := APrevUpdatingScrollBars; + end; +end; + +procedure TcxControl.DragAndDrop(const P: TPoint; var Accepted: Boolean); +begin + DragAndDropObject.DoDragAndDrop(P, Accepted); +end; + +procedure TcxControl.EndDragAndDrop(Accepted: Boolean); +begin + DragAndDropState := ddsNone; + Screen.Cursor := FDragAndDropPrevCursor; + MouseCapture := False; + MouseCaptureObject := nil; + DragAndDropObject.DoEndDragAndDrop(Accepted); + {DragAndDropObject.DoEndDragAndDrop(Accepted); + SetCaptureControl(nil); + DragAndDropState := ddsNone; + Screen.Cursor := FDragAndDropPrevCursor;} +end; + +function TcxControl.GetDragAndDropObjectClass: TcxDragAndDropObjectClass; +begin + Result := FDragAndDropObjectClass; + if Result = nil then + Result := TcxDragAndDropObject; +end; + +function TcxControl.StartDragAndDrop(const P: TPoint): Boolean; +begin + Result := False; +end; + +procedure TcxControl.DoStartDrag(var DragObject: TDragObject); +begin + Update; + inherited; + if (DragObject = nil) and (GetDragObjectClass <> nil) then + DragObject := GetDragObjectClass.Create(Self); + if not StartDrag(DragObject) then + begin + DragObject.Free; + DragObject := nil; + CancelDrag; + end; +end; + +procedure TcxControl.DoEndDrag(Target: TObject; X, Y: Integer); +begin + inherited; + FreeAndNil(FDragImages); +end; + +procedure TcxControl.DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); +begin + if Source is TDragObject then + if State = dsDragLeave then + FDragObject := nil + else + FDragObject := TDragObject(Source); + inherited; +end; + +procedure TcxControl.DrawDragImage(ACanvas: TcxCanvas; const R: TRect); +begin +end; + +function TcxControl.GetDragImages: TDragImageList; +begin + if HasDragImages then + begin + if FDragImages = nil then + begin + FDragImages := GetDragImagesClass.Create(nil); + InitDragImages(FDragImages); + end; + if FDragImages.Count = 0 then + Result := nil + else + Result := FDragImages; + end + else + Result := nil; +end; + +function TcxControl.GetDragImagesClass: TcxDragImageListClass; +begin + Result := TcxDragImageList; +end; + +function TcxControl.GetDragImagesSize: TPoint; +begin + Result := Point(0, 0); +end; + +function TcxControl.GetIsCopyDragDrop: Boolean; +begin + Result := IsCtrlPressed; +end; + +function TcxControl.HasDragImages: Boolean; +begin + Result := False; +end; + +procedure TcxControl.HideDragImage; +begin + if GetDragObject <> nil then + GetDragObject.HideDragImage; +end; + +procedure TcxControl.InitDragImages(ADragImages: TcxDragImageList); +var + B: TBitmap; + ACanvas: TcxCanvas; +begin + with ADragImages, GetDragImagesSize do + begin + Width := X; + Height := Y; + if (X = 0) or (Y = 0) then Exit; + end; + + B := TBitmap.Create; + try + with B do + begin + Width := ADragImages.Width; + Height := ADragImages.Height; + ACanvas := TcxCanvas.Create(Canvas); + try + DrawDragImage(ACanvas, Rect(0, 0, Width, Height)); + finally + ACanvas.Free; + end; + end; + ADragImages.AddMasked(B, B.TransparentColor); + finally + B.Free; + end; +end; + +procedure TcxControl.ShowDragImage; +begin + if GetDragObject <> nil then + GetDragObject.ShowDragImage; +end; + +function TcxControl.CanFocusEx: Boolean; +var + AParentForm: TCustomForm; +begin + AParentForm := GetParentForm(Self); + Result := CanFocus and ((AParentForm = nil) or + AParentForm.CanFocus and AParentForm.Enabled and AParentForm.Visible); +end; + +function TcxControl.AcceptMousePosForClick(X, Y: Integer): Boolean; +begin + Result := (DragMode = dmManual) or IsMouseInPressedArea(X, Y); +end; + +procedure TcxControl.InvalidateRect(const R: TRect; EraseBackground: Boolean); +begin + if HandleAllocated then + cxInvalidateRect(Handle, R, EraseBackground); +end; + +procedure TcxControl.InvalidateRgn(ARegion: TcxRegion; EraseBackground: Boolean); +begin + if HandleAllocated and (ARegion <> nil) and not ARegion.IsEmpty then + Windows.InvalidateRgn(Handle, ARegion.Handle, EraseBackground); +end; + +procedure TcxControl.InvalidateWithChildren; +begin + if HandleAllocated then + RedrawWindow(Handle, nil, 0, RDW_ALLCHILDREN or RDW_INVALIDATE or RDW_NOERASE); +end; + +function TcxControl.IsMouseInPressedArea(X, Y: Integer): Boolean; +begin + Result := IsPointInDragDetectArea(MouseDownPos, X, Y); +end; + +procedure TcxControl.PostMouseMove; +begin + if HandleAllocated then + PostMouseMove(ScreenToClient(GetMouseCursorPos)); +end; + +procedure TcxControl.PostMouseMove(AMousePos: TPoint); +begin + if not HandleAllocated then Exit; + with AMousePos do + PostMessage(Handle, WM_MOUSEMOVE, 0, MakeLParam(X, Y)); +end; + +procedure TcxControl.ScrollContent(ADirection: TcxDirection); + + function GetScrollBarKind: TScrollBarKind; + begin + if ADirection in [dirLeft, dirRight] then + Result := sbHorizontal + else + Result := sbVertical; + end; + + function GetScrollCode: TScrollCode; + begin + if ADirection in [dirLeft, dirUp] then + Result := scLineUp + else + Result := scLineDown; + end; + + function GetScrollPos: Integer; + begin + if not NeedsScrollBars then + Result := 0 + else + if GetScrollBarKind = sbHorizontal then + Result := FHScrollBar.Position + else + Result := FVScrollBar.Position; + end; + +var + AScrollPos: Integer; +begin + if (ADirection = dirNone) or + not NeedsScrollBars and not CanScrollLineWithoutScrollBars(ADirection) then + Exit; + AScrollPos := GetScrollPos; + Scroll(GetScrollBarKind, GetScrollCode, AScrollPos); + Update; +end; + +procedure TcxControl.ScrollWindow(DX, DY: Integer; const AScrollRect: TRect); +begin + HideDragImage; + try + ScrollWindowEx(Handle, DX, DY, @AScrollRect, nil, 0, nil, SW_ERASE or SW_INVALIDATE); + finally + ShowDragImage; + end; +end; + +procedure TcxControl.SetScrollBarInfo(AScrollBarKind: TScrollBarKind; + AMin, AMax, AStep, APage, APos: Integer; AAllowShow, AAllowHide: Boolean); + + function GetScrollBar: TcxControlScrollBar; + begin + if AScrollBarKind = sbHorizontal then + Result := FHScrollBar + else + Result := FVScrollBar; + end; + +var + AScrollBarData: TcxScrollBarData; +begin + AScrollBarData := GetScrollBar.Data; + if AScrollBarKind = sbHorizontal then + AScrollBarData.AllowShow := AAllowShow and (FScrollBars in [ssHorizontal, ssBoth]) + else + AScrollBarData.AllowShow := AAllowShow and (FScrollBars in [ssVertical, ssBoth]); + AScrollBarData.AllowHide := AAllowHide; + if AScrollBarData.AllowShow then + if (AMax < AMin) or (AMax - AMin + 1 <= APage) or (APos < AMin) then + if AScrollBarData.AllowHide then + AScrollBarData.Visible := False + else + begin + AScrollBarData.Enabled := False; + AScrollBarData.Visible := True; + end + else + begin + AScrollBarData.PageSize := APage; + AScrollBarData.Min := AMin; + AScrollBarData.Max := AMax; + AScrollBarData.SmallChange := AStep; + AScrollBarData.LargeChange := APage; + AScrollBarData.Position := APos; + AScrollBarData.Enabled := True; + AScrollBarData.Visible := True; + end + else + AScrollBarData.Visible := False; + GetScrollBar.Data := AScrollBarData; +end; + +function TcxControl.StartDrag(DragObject: TDragObject): Boolean; +begin + Result := True; +end; + +procedure TcxControl.UpdateWithChildren; +begin + if HandleAllocated then + RedrawWindow(Handle, nil, 0, RDW_UPDATENOW or RDW_ALLCHILDREN); +end; + +procedure TcxControl.BeginDragAndDrop; +begin + DragAndDropObject.DoBeginDragAndDrop; + MouseCapture := True; + FDragAndDropPrevCursor := Screen.Cursor; + DragAndDropState := ddsInProcess; +end; + +procedure TcxControl.FinishDragAndDrop(Accepted: Boolean); +begin + if FFinishingDragAndDrop then Exit; + FFinishingDragAndDrop := True; + try + if DragAndDropState = ddsInProcess then + EndDragAndDrop(Accepted) + else + DragAndDropState := ddsNone; + FreeAndNil(FDragAndDropObject); + finally + FFinishingDragAndDrop := False; + end; +end; + +procedure TcxControl.AddFontListener(AListener: IcxFontListener); +begin + FFontListenerList.Add(AListener); +end; + +procedure TcxControl.RemoveFontListener(AListener: IcxFontListener); +begin + FFontListenerList.Remove(AListener); +end; + +procedure TcxControl.LockScrollBars; +begin + if FScrollBarsLockCount = 0 then + FScrollBarsUpdateNeeded := False; + Inc(FScrollBarsLockCount); +end; + +procedure TcxControl.UnlockScrollBars; +begin + if FScrollBarsLockCount > 0 then + begin + Dec(FScrollBarsLockCount); + if (FScrollBarsLockCount = 0) and FScrollBarsUpdateNeeded then + UpdateScrollBars; + end; +end; + +{ TcxCustomizeListBox } + +constructor TcxCustomizeListBox.Create(AOwner: TComponent); +begin + inherited; + FDragAndDropItemIndex := -1; +end; + +function TcxCustomizeListBox.GetDragAndDropItemObject: TObject; +begin + Result := Items.Objects[FDragAndDropItemIndex]; +end; + +function TcxCustomizeListBox.GetItemObject: TObject; +begin + if ItemIndex = -1 then + Result := nil + else + Result := Items.Objects[ItemIndex]; +end; + +procedure TcxCustomizeListBox.SetItemObject(Value: TObject); +begin + if ItemObject <> Value then + begin + ItemIndex := Items.IndexOfObject(Value); + Click; + end; +end; + +procedure TcxCustomizeListBox.WMCancelMode(var Message: TWMCancelMode); +begin + inherited; + FDragAndDropItemIndex := -1; +end; + +procedure TcxCustomizeListBox.WMMouseMove(var Message: TWMMouseMove); +begin + if FDragAndDropItemIndex = -1 then + inherited + else + with Message do + MouseMove(KeysToShiftState(Keys), XPos, YPos); +end; + +procedure TcxCustomizeListBox.CreateParams(var Params: TCreateParams); +begin + inherited; + with Params.WindowClass do + style := style or CS_HREDRAW; +end; + +procedure TcxCustomizeListBox.MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + inherited; + if (Button = mbLeft) and (ItemAtPos(Point(X, Y), True) <> -1) and + (ItemObject <> nil) then + begin + FDragAndDropItemIndex := ItemIndex; + FMouseDownPos := Point(X, Y); + end; +end; + +procedure TcxCustomizeListBox.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited; + if (FDragAndDropItemIndex <> -1) and + (not IsPointInDragDetectArea(FMouseDownPos, X, Y) or + (ItemAtPos(Point(X, Y), True) <> FDragAndDropItemIndex)) then + begin + ItemIndex := FDragAndDropItemIndex; + BeginDragAndDrop; + FDragAndDropItemIndex := -1; + end; +end; + +procedure TcxCustomizeListBox.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + inherited; + FDragAndDropItemIndex := -1; +end; + +procedure TcxCustomizeListBox.BeginDragAndDrop; +var + I: Integer; +begin + if MultiSelect then + with Items do + begin + BeginUpdate; + try + for I := 0 to Count - 1 do + Selected[I] := I = ItemIndex; + finally + EndUpdate; + end; + end; +end; + +{ TcxMessageWindow } + +constructor TcxMessageWindow.Create; +begin + inherited Create; + FHandle := AllocateHWnd(WndProc); +end; + +destructor TcxMessageWindow.Destroy; +begin + DeallocateHWnd(FHandle); + inherited Destroy; +end; + +procedure TcxMessageWindow.WndProc(var Message: TMessage); +begin + Message.Result := DefWindowProc(Handle, Message.Msg, Message.wParam, Message.lParam); +end; + +{ TcxBaseHintWindow } + +constructor TcxBaseHintWindow.Create(AOwner: TComponent); +begin + inherited; + FAnimationStyle := cxhaAuto; + FAnimationDelay := 100; +end; + +procedure TcxBaseHintWindow.ActivateHint(ARect: TRect; const AHint: string); + + procedure ExecuteAnimation; + const + AAnimationStyleMap: array[TcxHintAnimationStyle] of Integer = (AW_HOR_POSITIVE, AW_HOR_NEGATIVE, + AW_VER_POSITIVE, AW_VER_NEGATIVE, AW_CENTER, AW_HIDE, AW_ACTIVATE, + AW_BLEND, AW_ACTIVATE, AW_ACTIVATE); + var + AAnimationStyle: TcxHintAnimationStyle; + begin + {MSDN.AnimateWindow: Function fails, if the window uses the window region. + Windows XP: This does not cause the function to fail. } + AAnimationStyle := GetAnimationStyle; + if AAnimationStyle <> cxhaNone then + begin + if not IsWinXP then + DisableRegion; + AnimateWindowProc(Handle, AnimationDelay, AAnimationStyleMap[AAnimationStyle] or AW_SLIDE); + end; + end; + +begin + if FStandardHint then + inherited + else + begin + Caption := AHint; + SetBounds(ARect.Left, ARect.Top, cxRectWidth(ARect), cxRectHeight(ARect)); + UpdateBoundsRect(ARect); + + if IsWinXP then + EnableRegion; + if (Length(AHint) < 100) and Assigned(AnimateWindowProc) then + ExecuteAnimation; + if not IsWinXP then + EnableRegion; + + Show; + Invalidate; + end; +end; + +procedure TcxBaseHintWindow.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); + + procedure CorrectPosition; + var + AWorkArea: TRect; + begin + AWorkArea := GetDesktopWorkArea(Point(ALeft, ATop)); + ALeft := Max(Min(ALeft, AWorkArea.Right - AWidth), AWorkArea.Left); + ATop := Max(Min(ATop, AWorkArea.Bottom - Height), AWorkArea.Top); + end; + +begin + CorrectPosition; + inherited; +end; + +procedure TcxBaseHintWindow.CreateParams(var Params: TCreateParams); +{$IFNDEF DELPHI7} +const + CS_DROPSHADOW = $20000; + AShadowMap: array [Boolean] of UINT = (0, CS_DROPSHADOW); +{$ENDIF} +begin + inherited CreateParams(Params); + if not FStandardHint then + with Params do + begin + if BorderStyle = bsNone then + Style := Style and not WS_BORDER; + {$IFNDEF DELPHI7} + WindowClass.Style := WindowClass.Style or AShadowMap[IsWinXP]; + {$ENDIF} + ExStyle := ExStyle or WS_EX_TOPMOST; + end; +end; + +function TcxBaseHintWindow.GetAnimationStyle: TcxHintAnimationStyle; +var + AAnimationEnabled, AFadeEffectAnimation: BOOL; +begin + Result := FAnimationStyle; + if Result = cxhaNone then + Exit; + SystemParametersInfo(SPI_GETTOOLTIPANIMATION, 0, @AAnimationEnabled, 0); + if not AAnimationEnabled then + Result := cxhaNone + else + if Result = cxhaAuto then + begin + SystemParametersInfo(SPI_GETTOOLTIPFADE, 0, @AFadeEffectAnimation, 0); + if AFadeEffectAnimation then + Result := cxhaFadeIn + else + Result := cxhaSlideDownward; + end; +end; + +procedure TcxBaseHintWindow.DisableRegion; +begin + SetWindowRgn(Handle, 0, True); +end; + +procedure TcxBaseHintWindow.EnableRegion; +begin +// do nothing +end; + +procedure TcxBaseHintWindow.Show; +begin + ShowWindow(Handle, SW_SHOWNOACTIVATE); +end; + +procedure TcxBaseHintWindow.WMEraseBkgnd(var Message: TWmEraseBkgnd); +begin + if NeedEraseBackground then + inherited + else + Message.Result := 1; +end; + +{ TcxPopupWindow } + +constructor TcxPopupWindow.Create; +begin + CreateNew(nil); + inherited BorderStyle := bsNone; + DefaultMonitor := dmDesktop; + FormStyle := fsStayOnTop; + FAdjustable := True; + FAlignVert := pavBottom; + FCanvas := TcxCanvas.Create(inherited Canvas); + FDirection := pdVertical; + FFrameColor := clWindowText; +end; + +destructor TcxPopupWindow.Destroy; +begin + FCanvas.Free; + inherited; +end; + +function TcxPopupWindow.GetNCHeight: Integer; +begin + Result := BorderWidths[bTop] + BorderWidths[bBottom]; +end; + +function TcxPopupWindow.GetNCWidth: Integer; +begin + Result := BorderWidths[bLeft] + BorderWidths[bRight]; +end; + +procedure TcxPopupWindow.SetBorderSpace(Value: Integer); +begin + RestoreControlsBounds; + FBorderSpace := Value; +end; + +procedure TcxPopupWindow.SetBorderStyle(Value: TcxPopupBorderStyle); +begin + RestoreControlsBounds; + FBorderStyle := Value; +end; + +procedure TcxPopupWindow.WMActivate(var Message: TWMActivate); +begin + inherited; + if Message.Active <> WA_INACTIVE then + begin + FPrevActiveWindow := Message.ActiveWindow; + SendMessage(FPrevActiveWindow, WM_NCACTIVATE, WPARAM(True), 0); + end; +end; + +procedure TcxPopupWindow.WMActivateApp(var Message: TWMActivateApp); +begin + inherited; + if not Message.Active then + begin + SendMessage(FPrevActiveWindow, WM_NCACTIVATE, WPARAM(False), 0); + CloseUp; + end; +end; + +procedure TcxPopupWindow.CMVisibleChanged(var Message: TMessage); +begin + inherited; + VisibleChanged; +end; + +procedure TcxPopupWindow.Deactivate; +begin + inherited; + CloseUp; +end; + +procedure TcxPopupWindow.Paint; +begin + inherited; + DrawFrame; +end; + +procedure TcxPopupWindow.VisibleChanged; +begin +end; + +function TcxPopupWindow.CalculatePosition: TPoint; +var + AAlignHorz: TcxPopupAlignHorz; + AAlignVert: TcxPopupAlignVert; + AOwnerScreenBounds: TRect; + AOrigin: TPoint; + + procedure CalculateCommonPosition; + begin + with AOwnerScreenBounds do + begin + if AAlignHorz = pahCenter then + begin + Result.X := (Left + Right - Width) div 2; + AOrigin.X := Result.X; + end; + if AAlignVert = pavCenter then + begin + Result.Y := (Top + Bottom - Height) div 2; + AOrigin.Y := Result.Y; + end; + end; + end; + + procedure CalculateHorizontalPosition; + begin + with AOwnerScreenBounds do + begin + case AAlignHorz of + pahLeft: + begin + Result.X := Left - Width; + AOrigin.X := Left; + end; + pahRight: + begin + Result.X := Right; + AOrigin.X := Right; + end; + end; + case AAlignVert of + pavTop: + begin + Result.Y := Top; + AOrigin.Y := Top; + end; + pavBottom: + begin + Result.Y := Bottom - Height; + AOrigin.Y := Bottom; + end; + end; + end; + end; + + procedure CalculateVerticalPosition; + begin + with Result, AOwnerScreenBounds do + begin + case AAlignHorz of + pahLeft: + begin + X := Left; + AOrigin.X := Left; + end; + pahRight: + begin + X := Right - Width; + AOrigin.X := Right; + end; + end; + case AAlignVert of + pavTop: + begin + Y := Top - Height; + AOrigin.Y := Top; + end; + pavBottom: + begin + Y := Bottom; + AOrigin.Y := Bottom; + end; + end; + end; + end; + + procedure CheckPosition; + var + ADesktopWorkArea: TRect; + + procedure CheckCommonPosition; + begin + with Result, ADesktopWorkArea do + begin + if (FDirection = pdVertical) or (AAlignHorz = pahCenter) then + begin + if X + Width > Right then X := Right - Width; + if X < Left then X := Left; + end; + if (FDirection = pdHorizontal) or (AAlignVert = pavCenter) then + begin + if Y + Height > Bottom then Y := Bottom - Height; + if Y < Top then Y := Top; + end; + end; + end; + + procedure CheckHorizontalPosition; + + function MoreSpaceOnLeft: Boolean; + begin + with ADesktopWorkArea do + Result := AOwnerScreenBounds.Left - Left > Right - AOwnerScreenBounds.Right; + end; + + begin + with Result, ADesktopWorkArea do + case AAlignHorz of + pahLeft: + if (X < Left) and not MoreSpaceOnLeft then + AAlignHorz := pahRight; + pahRight: + if (X + Width > Right) and MoreSpaceOnLeft then + AAlignHorz := pahLeft; + end; + CalculateHorizontalPosition; + end; + + procedure CheckVerticalPosition; + + function MoreSpaceOnTop: Boolean; + begin + with ADesktopWorkArea do + Result := AOwnerScreenBounds.Top - Top > Bottom - AOwnerScreenBounds.Bottom; + end; + + begin + with Result, ADesktopWorkArea do + case AAlignVert of + pavTop: + if (Y < Top) and not MoreSpaceOnTop then + AAlignVert := pavBottom; + pavBottom: + if (Y + Height > Bottom) and MoreSpaceOnTop then + AAlignVert := pavTop; + end; + CalculateVerticalPosition; + end; + + begin + ADesktopWorkArea := GetDesktopWorkArea(AOrigin); + if FDirection = pdHorizontal then + CheckHorizontalPosition + else + CheckVerticalPosition; + CheckCommonPosition; + end; + +begin + AAlignHorz := FAlignHorz; + AAlignVert := FAlignVert; + AOwnerScreenBounds := OwnerScreenBounds; + CalculateCommonPosition; + if FDirection = pdHorizontal then + CalculateHorizontalPosition + else + CalculateVerticalPosition; + CheckPosition; +end; + +procedure TcxPopupWindow.CalculateSize; +var + AClientWidth, AClientHeight, I: Integer; + ABounds: TRect; + + procedure CheckClientSize; + begin + with ABounds do + begin + if Right > AClientWidth then AClientWidth := Right; + if Bottom > AClientHeight then AClientHeight := Bottom; + end; + end; + +begin + if not FAdjustable then Exit; + + AClientWidth := 0; + AClientHeight := 0; + for I := 0 to ControlCount - 1 do + begin + ABounds := Controls[I].BoundsRect; + CheckClientSize; + OffsetRect(ABounds, BorderWidths[bLeft], BorderWidths[bTop]); + Controls[I].BoundsRect := ABounds; + end; + + if (AClientWidth <> 0) or (ControlCount <> 0) then + Width := BorderWidths[bLeft] + AClientWidth + BorderWidths[bRight]; + if (AClientHeight <> 0) or (ControlCount <> 0) then + Height := BorderWidths[bTop] + AClientHeight + BorderWidths[bBottom]; +end; + +function TcxPopupWindow.GetBorderWidth(ABorder: TcxBorder): Integer; +begin + Result := FBorderSpace + FrameWidths[ABorder]; +end; + +function TcxPopupWindow.GetClientBounds: TRect; +var + ABorder: TcxBorder; +begin + Result := ClientRect; + for ABorder := Low(ABorder) to High(ABorder) do + case ABorder of + bLeft: + Inc(Result.Left, BorderWidths[ABorder]); + bTop: + Inc(Result.Top, BorderWidths[ABorder]); + bRight: + Dec(Result.Right, BorderWidths[ABorder]); + bBottom: + Dec(Result.Bottom, BorderWidths[ABorder]); + end; +end; + +function TcxPopupWindow.GetFrameWidth(ABorder: TcxBorder): Integer; +begin + case FBorderStyle of + pbsUltraFlat: + Result := 1; + pbsFlat: + Result := 1; + pbs3D: + Result := 2; + else + Result := 0; + end; +end; + +function TcxPopupWindow.GetOwnerScreenBounds: TRect; +begin + Result := OwnerBounds; + with Result do + begin + TopLeft := OwnerParent.ClientToScreen(TopLeft); + BottomRight := OwnerParent.ClientToScreen(BottomRight); + end; +end; + +procedure TcxPopupWindow.InitPopup; +begin + if FOwnerParent <> nil then + Font := TControlAccess(FOwnerParent).Font; +end; + +procedure TcxPopupWindow.RestoreControlsBounds; +var + I: Integer; + ABounds: TRect; +begin + for I := 0 to ControlCount - 1 do + begin + ABounds := Controls[I].BoundsRect; + OffsetRect(ABounds, -BorderWidths[bLeft], -BorderWidths[bTop]); + Controls[I].BoundsRect := ABounds; + end; +end; + +procedure TcxPopupWindow.DrawFrame; +var + R: TRect; + + procedure DrawUltraFlatBorder; + begin + Canvas.FrameRect(R, FrameColor); + end; + + procedure DrawFlatBorder; + begin + Canvas.DrawEdge(R, False, False); + end; + + procedure Draw3DBorder; + begin + Canvas.DrawEdge(R, False, True); + InflateRect(R, -1, -1); + Canvas.DrawEdge(R, False, False); + end; + +begin + R := Bounds(0, 0, Width, Height); + case FBorderStyle of + pbsUltraFlat: + DrawUltraFlatBorder; + pbsFlat: + DrawFlatBorder; + pbs3D: + Draw3DBorder; + end; +end; + +procedure TcxPopupWindow.CloseUp; +begin + Hide; +end; + +procedure TcxPopupWindow.Popup; + +begin + InitPopup; + CalculateSize; + Left := CalculatePosition.X; + Top := CalculatePosition.Y; + Show; +end; + +{ TcxCustomDragImage } + +constructor TcxCustomDragImage.Create; +begin + inherited; + SetBounds(0, 0, 0, 0); +{$IFDEF DELPHI6} + AlphaBlend := True; + AlphaBlendValue := cxDragAndDropWindowTransparency; +{$IFDEF DELPHI9} + PopupMode := pmExplicit; +{$ENDIF} +{$ENDIF} +end; + +{$IFDEF DELPHI9} +destructor TcxCustomDragImage.Destroy; +begin + PopupMode := pmNone; + inherited; +end; +{$ENDIF} + +function TcxCustomDragImage.GetAlphaBlended: Boolean; +begin +{$IFDEF DELPHI6} + Result := AlphaBlend and + Assigned(SetLayeredWindowAttributes); +{$ELSE} + Result := False; +{$ENDIF} +end; + +function TcxCustomDragImage.GetVisible: Boolean; +begin + Result := HandleAllocated and IsWindowVisible(Handle); +end; + +procedure TcxCustomDragImage.SetVisible(Value: Boolean); +begin + if Visible <> Value then + if Value then + Show + else + Hide; +end; + +procedure TcxCustomDragImage.WMEraseBkgnd(var Message: TWMEraseBkgnd); +begin + Message.Result := 1; +end; + +procedure TcxCustomDragImage.WMNCHitTest(var Message: TWMNCHitTest); +begin + Message.Result := HTTRANSPARENT; +end; + +procedure TcxCustomDragImage.CreateParams(var Params: TCreateParams); +begin + inherited; + if PopupParent <> nil then + Params.WndParent := PopupParent.Handle + else + if Screen.ActiveForm <> nil then + Params.WndParent := Screen.ActiveForm.Handle; + with Params.WindowClass do + Style := Style or CS_SAVEBITS; +end; + +procedure TcxCustomDragImage.Init(const ASourceBounds: TRect; const ASourcePoint: TPoint); + + function CalculatePositionOffset: TPoint; + begin + Result.X := ASourcePoint.X - ASourceBounds.Left; + Result.Y := ASourcePoint.Y - ASourceBounds.Top; + end; + +begin + Width := ASourceBounds.Right - ASourceBounds.Left; + Height := ASourceBounds.Bottom - ASourceBounds.Top; + PositionOffset := CalculatePositionOffset; +end; + +procedure TcxCustomDragImage.MoveTo(const APosition: TPoint); +begin + HandleNeeded; // so that later CreateHandle won't reset Left and Top + SetBounds(APosition.X - PositionOffset.X, APosition.Y - PositionOffset.Y, Width, Height); +end; + +procedure TcxCustomDragImage.Show; +begin + ShowWindow(Handle, SW_SHOWNA); + Update; +end; + +procedure TcxCustomDragImage.Hide; +begin + if HandleAllocated then + ShowWindow(Handle, SW_HIDE); +end; + +{ TcxDragImage } + +constructor TcxDragImage.Create; +begin + inherited; + FImage := TBitmap.Create; + FImageCanvas := TcxCanvas.Create(Image.Canvas); +end; + +destructor TcxDragImage.Destroy; +begin + FreeAndNil(FImageCanvas); + FreeAndNil(FImage); + inherited; +end; + +function TcxDragImage.GetWindowCanvas: TcxCanvas; +begin + Result := inherited Canvas; +end; + +procedure TcxDragImage.Paint; +begin + inherited; + WindowCanvas.Draw(0, 0, Image); +end; + +procedure TcxDragImage.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); +begin + inherited; + if Image <> nil then + begin + Image.Width := Width; + Image.Height := Height; + end; +end; + +{ TcxSizeFrame } + +constructor TcxSizeFrame.Create(AFrameWidth: Integer = 2); +begin + inherited Create; +{$IFDEF DELPHI6} + AlphaBlend := False; +{$ENDIF} + FFrameWidth := AFrameWidth; + FRegion := TcxRegion.Create; + Canvas.Brush.Bitmap := AllocPatternBitmap(clBlack, clWhite); +end; + +destructor TcxSizeFrame.Destroy; +begin + FreeAndNil(FRegion); + inherited; +end; + +procedure TcxSizeFrame.Paint; +begin + Canvas.Canvas.FillRect(ClientRect); +end; + +procedure TcxSizeFrame.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); +begin + inherited SetBounds(ALeft, ATop, AWidth, AHeight); + if HandleAllocated and (AWidth > FrameWidth * 2) and (AHeight > FrameWidth * 2) then + begin + if not FillSelection then + InitializeFrameRegion; + SetWindowRegion; + end; +end; + +procedure TcxSizeFrame.DrawSizeFrame(const ARect: TRect); +begin + FRegion.Combine(TcxRegion.Create(cxRectBounds(0, 0, cxRectWidth(ARect), cxRectHeight(ARect))), roSet); + SetBounds(ARect.Left, ARect.Top, cxRectWidth(ARect), cxRectHeight(ARect)); +end; + +procedure TcxSizeFrame.DrawSizeFrame(const ARect: TRect; const ARegion: TcxRegion); +begin + FRegion.Combine(ARegion, roSet, False); + SetBounds(ARect.Left, ARect.Top, cxRectWidth(ARect), cxRectHeight(ARect)); +end; + +procedure TcxSizeFrame.InitializeFrameRegion; + + procedure OffsetFrameRegion(AFrameRegion: TcxRegion; AOffsetX, AOffsetY: Integer); + var + ARegion: TcxRegion; + begin + ARegion := TcxRegion.Create; + try + ARegion.Combine(AFrameRegion, roSet, False); + ARegion.Offset(AOffsetX, AOffsetY); + AFrameRegion.Combine(ARegion, roIntersect, False); + finally + ARegion.Free; + end; + end; + +var + AFrameRegion: TcxRegion; +begin + AFrameRegion := TcxRegion.Create; + try + AFrameRegion.Combine(FRegion, roSet, False); + + OffsetFrameRegion(AFrameRegion, FrameWidth, 0); + OffsetFrameRegion(AFrameRegion, 0, FrameWidth); + OffsetFrameRegion(AFrameRegion, -FrameWidth, 0); + OffsetFrameRegion(AFrameRegion, 0, -FrameWidth); + + FRegion.Combine(AFrameRegion, roSubtract, False); + finally + AFrameRegion.Free; + end; +end; + +procedure TcxSizeFrame.SetWindowRegion; +var + ANewWindowRegion, AOldWindowRegion: TcxRegion; +begin + ANewWindowRegion := TcxRegion.Create; + AOldWindowRegion := TcxRegion.Create; + try + ANewWindowRegion.Combine(FRegion, roSet, False); + GetWindowRgn(Handle, AOldWindowRegion.Handle); + if not ANewWindowRegion.IsEqual(AOldWindowRegion) then + begin + SetWindowRgn(Handle, ANewWindowRegion.Handle, True); + ANewWindowRegion.Handle := 0; + end; + finally + AOldWindowRegion.Free; + ANewWindowRegion.Free; + end; +end; + +{ TcxDragDropArrow } + +constructor TcxDragAndDropArrow.Create(ATransparent: Boolean); +begin + inherited Create; + FTransparent := ATransparent; +{$IFDEF DELPHI6} + AlphaBlend := False; + if Transparent then + begin + TransparentColorValue := ImageBackColor; + TransparentColor := True; + end; +{$ENDIF} +end; + +function TcxDragAndDropArrow.GetTransparent: Boolean; +begin +{$IFDEF DELPHI6} + Result := FTransparent and + Assigned(SetLayeredWindowAttributes); +{$ELSE} + Result := False; +{$ENDIF} +end; + +function TcxDragAndDropArrow.GetImageBackColor: TColor; +begin + Result := clFuchsia; +end; + +procedure TcxDragAndDropArrow.Init(AOwner: TControl; const AAreaBounds, AClientRect: TRect; + APlace: TcxArrowPlace); + + procedure DrawArrow; + begin + Canvas.Brush.Color := ImageBackColor; + Canvas.FillRect(ClientRect); + DrawDragAndDropArrow(Canvas, ClientRect, APlace); + end; + + procedure SetArrowRegion; + var + APoints: TPointArray; + ARegion: HRGN; + begin + GetDragAndDropArrowPoints(ClientRect, APlace, APoints, True); + ARegion := CreatePolygonRgn(APoints[0], Length(APoints), WINDING); + SetWindowRgn(Handle, ARegion, True); + end; + +var + R: TRect; +begin + R := GetDragAndDropArrowBounds(AAreaBounds, AClientRect, APlace); + if AOwner <> nil then + begin + R.TopLeft := AOwner.ClientToScreen(R.TopLeft); + R.BottomRight := AOwner.ClientToScreen(R.BottomRight); + end; + HandleNeeded; // so that later CreateHandle won't reset Left and Top + BoundsRect := R; + DrawArrow; + if not Transparent then + SetArrowRegion; +end; + +{ TcxDesignController } + +procedure TcxDesignController.DesignerModified(AForm: TCustomForm); +begin + if not (IsDesignerModifiedLocked or (dsDesignerModifying in FState)) then + begin + Include(FState, dsDesignerModifying); + try + if (AForm <> nil) and (AForm.Designer <> nil) then + AForm.Designer.Modified; + finally + Exclude(FState, dsDesignerModifying); + end; + end; +end; + +function TcxDesignController.IsDesignerModifiedLocked: Boolean; +begin + Result := FLockDesignerModifiedCount > 0; +end; + +procedure TcxDesignController.LockDesignerModified; +begin + Inc(FLockDesignerModifiedCount); +end; + +procedure TcxDesignController.UnLockDesignerModified; +begin + if FLockDesignerModifiedCount > 0 then + Dec(FLockDesignerModifiedCount); +end; + +{ TcxTimer } + +function ActiveTimerList: TList; +begin + if (FActiveTimerList = nil) and not FUnitIsFinalized then + FActiveTimerList := TList.Create; + Result := FActiveTimerList; +end; + +function cxTimerWindow: TcxTimerWindow; +begin + if (FcxTimerWindow = nil) and not FUnitIsFinalized then + FcxTimerWindow := TcxTimerWindow.Create; + Result := FcxTimerWindow; +end; + +procedure TcxTimerWindow.WndProc(var Message: TMessage); + + function cxTimer(APointer: Integer): TcxTimer; + begin + Result := TcxTimer(APointer); + end; + +begin + if Message.Msg = WM_TIMER then + begin + if ActiveTimerList.IndexOf(Pointer(Message.WParam)) <> -1 then + cxTimer(Message.WParam).TimeOut; + end + else + inherited WndProc(Message); +end; + +constructor TcxTimer.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FEnabled := True; + FInterval := 1000; + FEventID := Cardinal(Self); +end; + +destructor TcxTimer.Destroy; +begin + KillTimer; + inherited Destroy; +end; + +procedure TcxTimer.TimeOut; +begin + if Assigned(FOnTimer) then + FOnTimer(Self); +end; + +function TcxTimer.CanSetTimer: Boolean; +begin + Result := FEnabled and not TimerOn and Assigned(FOnTimer); +end; + +procedure TcxTimer.KillTimer; +begin + if TimerOn then + begin + Windows.KillTimer(cxTimerWindow.FHandle, FEventID); + TimerOn := False; + end; +end; + +procedure TcxTimer.SetEnabled(Value: Boolean); +begin + if FEnabled <> Value then + begin + FEnabled := Value; + UpdateTimer; + end; +end; + +procedure TcxTimer.SetInterval(Value: Cardinal); +begin + if (FInterval <> Value) and (Value > 0) then + begin + FInterval := Value; + UpdateTimer; + end; +end; + +procedure TcxTimer.SetOnTimer(Value: TNotifyEvent); +begin + FOnTimer := Value; + UpdateTimer; +end; + +procedure TcxTimer.SetTimer; +begin + if CanSetTimer then + TimerOn := Windows.SetTimer(cxTimerWindow.FHandle, FEventID, FInterval, nil) <> 0; +end; + +procedure TcxTimer.SetTimerOn(Value: Boolean); +begin + if FTimerOn <> Value then + begin + if Value then + ActiveTimerList.Add(Pointer(FEventID)) + else + ActiveTimerList.Remove(Pointer(FEventID)); + FTimerOn := Value; + end; +end; + +procedure TcxTimer.UpdateTimer; +begin + KillTimer; + SetTimer; +end; + +procedure InitPlatformInfo; +begin + IsWin95X := (Win32Platform = VER_PLATFORM_WIN32_WINDOWS) or + (Win32Platform = VER_PLATFORM_WIN32s); + IsWin2KOrXP := (Win32Platform = VER_PLATFORM_WIN32_NT) and + (Win32MajorVersion >= 5); + IsWinXP := (Win32Platform = VER_PLATFORM_WIN32_NT) and + (Win32MajorVersion >= 5) and (Win32MinorVersion > 0); + IsWinNT := (Win32Platform = VER_PLATFORM_WIN32_NT) and + (Win32MajorVersion >= 4); + IsWinVista := Win32MajorVersion >= 6; +end; + +initialization + InitPlatformInfo; + Screen.Cursors[crDragCopy] := LoadCursor(HInstance, 'CX_DRAGCOPYCURSOR'); + Screen.Cursors[crFullScroll] := LoadCursor(HInstance, 'CX_FULLSCROLLCURSOR'); + Screen.Cursors[crHorScroll] := LoadCursor(HInstance, 'CX_HORSCROLLCURSOR'); + Screen.Cursors[crVerScroll] := LoadCursor(HInstance, 'CX_VERSCROLLCURSOR'); + Screen.Cursors[crUpScroll] := LoadCursor(HInstance, 'CX_UPSCROLLCURSOR'); + Screen.Cursors[crRightScroll] := LoadCursor(HInstance, 'CX_RIGHTSCROLLCURSOR'); + Screen.Cursors[crDownScroll] := LoadCursor(HInstance, 'CX_DOWNSCROLLCURSOR'); + Screen.Cursors[crLeftScroll] := LoadCursor(HInstance, 'CX_LEFTSCROLLCURSOR'); + Screen.Cursors[crcxRemove] := LoadCursor(HInstance, 'CX_REMOVECURSOR'); + Screen.Cursors[crcxVertSize] := LoadCursor(HInstance, 'CX_VERTSIZECURSOR'); + Screen.Cursors[crcxHorzSize] := LoadCursor(HInstance, 'CX_HORZSIZECURSOR'); + Screen.Cursors[crcxDragMulti] := LoadCursor(HInstance, 'CX_MULTIDRAGCURSOR'); + Screen.Cursors[crcxNoDrop] := LoadCursor(HInstance, 'CX_NODROPCURSOR'); + Screen.Cursors[crcxDrag] := LoadCursor(HInstance, 'CX_DRAGCURSOR'); + Screen.Cursors[crcxHandPoint] := LoadCursor(0{HInstance}, IDC_HAND{'CX_HANDPOINTCURSOR'}); + Screen.Cursors[crcxColorPicker] := LoadCursor(HInstance, 'CX_COLORPICKERCURSOR'); + FUser32DLL := LoadLibrary('USER32'); + dxWMGetSkinnedMessage := RegisterWindowMessage(dxWMGetSkinnedMessageID); + dxWMSetSkinnedMessage := RegisterWindowMessage(dxWMSetSkinnedMessageID); + +{$IFDEF DELPHI6} + //StartClassGroup(TControl); + GroupDescendentsWith(TcxControlChildComponent, TControl); +{$ENDIF} +{$IFNDEF DELPHI7} + InitSetLayeredWindowAttributes; +{$ENDIF} + +finalization + FUnitIsFinalized := True; + FreeAndNil(FDesignController); + if FMouseTrackingTimerList <> nil then + begin + if FMouseTrackingTimerList.Count <> 0 then + raise Exception.Create('MouseTrackingTimerList.Count <> 0'); + FreeAndNil(FMouseTrackingTimerList); + end; + if FUser32DLL > 32 then FreeLibrary(FUser32DLL); + + {$IFDEF USETCXSCROLLBAR} + FreeAndNil(FSettingsController); + {$ENDIF} + FreeAndNil(FcxTimerWindow); + FreeAndNil(FActiveTimerList); + FreeAndNil(FcxMessageWindow); + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxControls.res b/official/x.35/ExpressLibrary/Sources/cxControls.res new file mode 100644 index 00000000..ea812551 Binary files /dev/null and b/official/x.35/ExpressLibrary/Sources/cxControls.res differ diff --git a/official/x.35/ExpressLibrary/Sources/cxConverterFactory.pas b/official/x.35/ExpressLibrary/Sources/cxConverterFactory.pas new file mode 100644 index 00000000..ad7f5456 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxConverterFactory.pas @@ -0,0 +1,278 @@ +{*******************************************************************} +{ } +{ Developer Express Cross Platform Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL AND CLX CONTROLS AS PART OF AN EXECUTABLE } +{ PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} +unit cxConverterFactory; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + DesignIntf, +{$ELSE} + DsgnIntf, +{$ENDIF} + Forms, SysUtils, cxStyles, Classes, cxClasses, cxLibraryStrs, cxDesignWindows, + cxCustomConverter; + +type + TcxCustomConverterWithStyles = class; + TcxCustomConverterWithStylesClass = class of TcxCustomConverterWithStyles; + + { TcxCustomConverterWithStyles } + TcxCustomConverterWithStyles = class(TcxCustomConverter) + private + FConvertWithStyles: Boolean; + FDesigner: IDesigner; + FNameOfNewStyleRepository: string; + FStyleRepository: TcxStyleRepository; + function GetStyleRepository: TcxStyleRepository; + protected + function CreateStyleItem: TcxCustomStyle; + procedure DoImport; override; + procedure DoImportStyles; virtual; + public + property ConvertWithStyles: Boolean read FConvertWithStyles write FConvertWithStyles; + property Designer_: IDesigner read FDesigner write FDesigner; + property NameOfNewStyleRepository: string read FNameOfNewStyleRepository write FNameOfNewStyleRepository; + property StyleRepository: TcxStyleRepository read GetStyleRepository write FStyleRepository; + end; + + { TcxConverterFactoryItem } + PcxConverterFactoryItem = ^TcxConverterFactoryItem; + TcxConverterFactoryItem = record + Class_: TcxCustomConverterWithStylesClass; + Name: string; + end; + + { TcxConverterFactory } + TcxConverterFactory = class + private + FItems: TList; + constructor CreateInstance(AParam: Integer); + function GetCount: Integer; + function GetItems(AIndex: Integer): TcxConverterFactoryItem; + function IndexOf(AClass: TcxCustomConverterWithStylesClass): Integer; + public + constructor Create; + destructor Destroy; override; + function FindConverter(ASource: TObject): TcxCustomConverterWithStylesClass; + class function Instance(AConverterGroupName: string): TcxConverterFactory; + procedure RegisterConverter(const AName: string; const AClass: TcxCustomConverterWithStylesClass); + procedure UnregisterConverter(const AClass: TcxCustomConverterWithStylesClass); + property Count: Integer read GetCount; + property Items[AIndex: Integer]: TcxConverterFactoryItem read GetItems; default; + end; + + function ConverterFactory(AConverterGroupName: string): TcxConverterFactory; + +implementation + +function ConverterFactory(AConverterGroupName: string): TcxConverterFactory; +begin + Result := TcxConverterFactory.Instance(AConverterGroupName); +end; + +{ TcxCustomConverterWithStyles } + +function TcxCustomConverterWithStyles.CreateStyleItem: TcxCustomStyle; +var + AStyleRepository: TcxStyleRepository; +begin + AStyleRepository := StyleRepository; + if AStyleRepository = nil then + raise EcxConverterError.Create(cxGetResourceString(@scxConverterCantCreateStyleRepository)); + Result := AStyleRepository.CreateItemEx(TcxStyle, AStyleRepository.Owner); + Result.Name := CreateUniqueName(AStyleRepository.Owner, nil, Result, '', ''); + Designer_.Modified; +end; + +procedure TcxCustomConverterWithStyles.DoImport; +begin + if ConvertWithStyles then + begin + EnablePropertyException; + try + DoImportStyles; + finally + DisablePropertyException; + end; + end; + inherited DoImport; +end; + +procedure TcxCustomConverterWithStyles.DoImportStyles; +begin +end; + +function TcxCustomConverterWithStyles.GetStyleRepository: TcxStyleRepository; +begin + if FStyleRepository = nil then + begin + FStyleRepository := TcxStyleRepository.Create(Designer_.GetRoot); + FStyleRepository.Name := FNameOfNewStyleRepository; + Designer_.Modified; + end; + Result := FStyleRepository; +end; + +{ TcxConverterFactory } + +var + ConverterFactories: TStringList; + +procedure CreateConverterFactories; +begin + ConverterFactories := TStringList.Create; +end; + +procedure FreeConverterFactories; +var + I: Integer; +begin + for I := 0 to ConverterFactories.Count - 1 do + ConverterFactories.Objects[I].Free; + ConverterFactories.Free; +end; + +constructor TcxConverterFactory.Create; +begin + raise Exception.CreateFmt('Access class %s through Instance only', [ClassName]); +end; + +destructor TcxConverterFactory.Destroy; +var + I: Integer; +begin + for I := 0 to FItems.Count - 1 do + Dispose(PcxConverterFactoryItem(FItems[I])); + FItems.Free; + + inherited Destroy; +end; + +function TcxConverterFactory.FindConverter(ASource: TObject): TcxCustomConverterWithStylesClass; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I].Class_; + if ClassInheritsFrom(ASource.ClassType, Result.GetSourceClassName) then Exit; + end; + Result := nil; +end; + +class function TcxConverterFactory.Instance(AConverterGroupName: string): TcxConverterFactory; +var + I: Integer; +begin + Result := nil; + for I := 0 to ConverterFactories.Count - 1 do + begin + if ConverterFactories[I] = AConverterGroupName then + begin + Result := ConverterFactories.Objects[I] as TcxConverterFactory; + Break; + end; + end; + if Result = nil then + begin + Result := CreateInstance(0); + ConverterFactories.AddObject(AConverterGroupName, Result); + end; +end; + +procedure TcxConverterFactory.RegisterConverter(const AName: string; const AClass: TcxCustomConverterWithStylesClass); +var + AP: PcxConverterFactoryItem; +begin + if IndexOf(AClass) = -1 then + begin + New(AP); + AP^.Name := AName; + AP^.Class_ := AClass; + FItems.Add(AP); + end; +end; + +procedure TcxConverterFactory.UnregisterConverter(const AClass: TcxCustomConverterWithStylesClass); +var + AIndex: Integer; +begin + AIndex := IndexOf(AClass); + if AIndex <> -1 then + begin + Dispose(PcxConverterFactoryItem(FItems[AIndex])); + FItems.Delete(AIndex); + end; +end; + +constructor TcxConverterFactory.CreateInstance; +begin + FItems := TList.Create; +end; + +function TcxConverterFactory.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxConverterFactory.GetItems(AIndex: Integer): TcxConverterFactoryItem; +begin + Result := PcxConverterFactoryItem(FItems[AIndex])^; +end; + +function TcxConverterFactory.IndexOf(AClass: TcxCustomConverterWithStylesClass): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Count - 1 do + if Items[I].Class_ = AClass then + begin + Result := I; + Break; + end; +end; + +initialization + CreateConverterFactories; + +finalization + FreeConverterFactories; + +end. + diff --git a/official/x.35/ExpressLibrary/Sources/cxConverterUtils.pas b/official/x.35/ExpressLibrary/Sources/cxConverterUtils.pas new file mode 100644 index 00000000..7bd0a9b0 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxConverterUtils.pas @@ -0,0 +1,128 @@ +{*******************************************************************} +{ } +{ Developer Express Cross Platform Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL AND CLX CONTROLS AS PART OF AN EXECUTABLE } +{ PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} +unit cxConverterUtils; + +{$I cxVer.inc} + +interface + +uses + Classes, Graphics, StdCtrls; + + function CompareFonts(AFont1, AFont2: TFont): Boolean; + function ConvertAlignment(const AValue: string): TAlignment; + function ConvertCharCase(const AValue: string): TEditCharCase; + function ConvertScrollStyle(const AValue: string): TScrollStyle; + function DefaultFont(AFont: TFont): Boolean; + +implementation + +function CompareFonts(AFont1, + AFont2: TFont): Boolean; +begin + if (AFont1 = nil) or (AFont2 = nil) then + begin + Result := True; + Exit; + end; + with AFont1 do + begin + Result := + (Charset = AFont2.Charset) and + (Color = AFont2.Color) and + (Height = AFont2.Height) and + (Name = AFont2.Name) and + (Pitch = AFont2.Pitch) and + (Size = AFont2.Size) and + (Style = AFont2.Style); + end; +end; + +function ConvertAlignment(const AValue: string): TAlignment; +begin + if AValue = 'taLeftJustify' then + Result := taLeftJustify + else if AValue = 'taRightJustify' then + Result := taRightJustify + else if AValue = 'taCenter' then + Result := taCenter + else + Result := taLeftJustify; +end; + +function ConvertCharCase(const AValue: string): TEditCharCase; +begin + if AValue = 'ecNormal' then + Result := ecNormal + else if AValue = 'ecUpperCase' then + Result := ecUpperCase + else if AValue = 'ecLowerCase' then + Result := ecLowerCase + else + Result := ecNormal; +end; + +function ConvertScrollStyle(const AValue: string): TScrollStyle; +begin + if AValue = 'ssNone' then + Result := ssNone + else if AValue = 'ssHorizontal' then + Result := ssHorizontal + else if AValue = 'ssVertical' then + Result := ssVertical + else if AValue = 'ssBoth' then + Result := ssBoth + else + Result := ssNone; +end; + +function DefaultFont(AFont: TFont): Boolean; +begin + if AFont = nil then + begin + Result := True; + Exit; + end; + with AFont do + Result := + (Pitch = DefFontData.Pitch) and + (Style = DefFontData.Style) and + (Charset = DefFontData.Charset) and + (Name = DefFontData.Name) and + (Color = clWindowText) and + (Size = 8); +end; + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxCustomConverter.pas b/official/x.35/ExpressLibrary/Sources/cxCustomConverter.pas new file mode 100644 index 00000000..32012356 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxCustomConverter.pas @@ -0,0 +1,405 @@ +{*******************************************************************} +{ } +{ Developer Express Cross Platform Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL AND CLX CONTROLS AS PART OF AN EXECUTABLE } +{ PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} +unit cxCustomConverter; + +{$I cxVer.inc} + +interface + +uses + TypInfo, Classes, SysUtils; + +type + EcxUnknownProperty = class(Exception); + EcxConverterError = class(Exception); + + TcxCustomConverter = class; + TcxCustomConverterClass = class of TcxCustomConverter; + + { TcxCustomConverter } + TcxCustomConverter = class + private + FDestination: TObject; + FPropertyExceptionEnabled: Boolean; + FSource: TObject; + function GetObject(AObject: TObject): TObject; + function GetPropInfo_(AObject: TObject; const AName: string): PPropInfo; + function TestProperty(AObject: TObject; const AName: string; ATypeKind: TTypeKind): Boolean; + protected + function CanConvert: Boolean; virtual; + procedure DisablePropertyException; + procedure DoImport; virtual; + procedure EnablePropertyException; + function GetBooleanProperty(AObject: TObject; const AName: string; + const ADefaultValue: Boolean = False): Boolean; + function GetCharProperty(AObject: TObject; const AName: string; + const ADefaultValue: Char = #0): Char; + function GetClassProperty(AObject: TObject; const AName: string; + const ADefaultValue: TObject = nil): TObject; + function GetEnumProperty(AObject: TObject; const AName: string; + const ADefaultValue: string = ''): string; + function GetFloatProperty(AObject: TObject; const AName: string; + const ADefaultValue: Extended = 0): Extended; + function GetIntegerProperty(AObject: TObject; const AName: string; + const ADefaultValue: Integer = 0): Integer; + {$IFDEF DELPHI6} + function GetInterfaceProperty(AObject: TObject; const AName: string; + const ADefaultValue: IUnknown): IUnknown; + {$ENDIF} + function GetMethodProperty(AObject: TObject; const AName: string; + const ADefaultValue: TMethod): TMethod; + procedure GetSetProperty(AObject: TObject; const AName: string; AValues: TStrings); + function GetStringProperty(AObject: TObject; const AName: string; + const ADefaultValue: string = ''): string; + function GetVariantProperty(AObject: TObject; const AName: string; + const ADefaultValue: Variant): Variant; + function GetWideCharProperty(AObject: TObject; const AName: string; + const ADefaultValue: WideChar = #0): WideChar; + function GetWideStringProperty(AObject: TObject; const AName: string; + const ADefaultValue: WideString = ''): WideString; + procedure PostImport; virtual; + procedure PreImport; virtual; + public + constructor Create(ADestination: TObject); virtual; + class function GetSourceClassName: string; virtual; + procedure ImportFrom(ASource: TObject); + + property Destination: TObject read FDestination; + property Source: TObject read FSource write FSource; + end; + +implementation + +{ TcxCustomConverter } + +constructor TcxCustomConverter.Create(ADestination: TObject); +begin + FDestination := ADestination; +end; + +class function TcxCustomConverter.GetSourceClassName: string; +begin + Result := 'TObject'; +end; + +procedure TcxCustomConverter.ImportFrom(ASource: TObject); +begin + FSource := ASource; + if CanConvert then + begin + PreImport; + try + DoImport; + finally + PostImport; + end; + end; +end; + +function TcxCustomConverter.CanConvert: Boolean; +begin + Result := True; +end; + +procedure TcxCustomConverter.DisablePropertyException; +begin + FPropertyExceptionEnabled := False; +end; + +procedure TcxCustomConverter.DoImport; +begin +end; + +procedure TcxCustomConverter.EnablePropertyException; +begin + FPropertyExceptionEnabled := True; +end; + +function TcxCustomConverter.GetBooleanProperty(AObject: TObject; const AName: string; + const ADefaultValue: Boolean): Boolean; +begin + if TestProperty(AObject, AName, tkEnumeration) then + {$IFDEF DELPHI5} + Result := Boolean(GetOrdProp(GetObject(AObject), AName)) + {$ELSE} + Result := Boolean(GetOrdProp(GetObject(AObject), GetPropInfo_(AObject, AName))) + {$ENDIF} + else + Result := ADefaultValue; +end; + +function TcxCustomConverter.GetCharProperty(AObject: TObject; const AName: string; + const ADefaultValue: Char): Char; +begin + if TestProperty(AObject, AName, tkChar) then + {$IFDEF DELPHI5} + Result := Char(GetOrdProp(GetObject(AObject), AName)) + {$ELSE} + Result := Char(GetOrdProp(GetObject(AObject), GetPropInfo_(AObject, AName))) + {$ENDIF} + else + Result := ADefaultValue; +end; + +function TcxCustomConverter.GetClassProperty(AObject: TObject; const AName: string; + const ADefaultValue: TObject = nil): TObject; +begin + if TestProperty(AObject, AName, tkClass) then + {$IFDEF DELPHI5} + Result := GetObjectProp(GetObject(AObject), AName) + {$ELSE} + Result := TObject(GetOrdProp(GetObject(AObject), GetPropInfo_(AObject, AName))) + {$ENDIF} + else + Result := ADefaultValue; +end; + +function TcxCustomConverter.GetEnumProperty(AObject: TObject; const AName: string; + const ADefaultValue: string): string; +begin + if TestProperty(AObject, AName, tkEnumeration) then + {$IFDEF DELPHI5} + Result := GetEnumProp(GetObject(AObject), AName) + {$ELSE} + Result := GetEnumName(GetPropInfo_(AObject, AName).PropType^, + GetOrdProp(GetObject(AObject), GetPropInfo_(AObject, AName))) + {$ENDIF} + else + Result := ADefaultValue; +end; + +function TcxCustomConverter.GetFloatProperty(AObject: TObject; const AName: string; + const ADefaultValue: Extended): Extended; +begin + if TestProperty(AObject, AName, tkFloat) then + {$IFDEF DELPHI5} + Result := GetFloatProp(GetObject(AObject), AName) + {$ELSE} + Result := GetFloatProp(GetObject(AObject), GetPropInfo_(AObject, AName)) + {$ENDIF} + else + Result := ADefaultValue; +end; + +function TcxCustomConverter.GetIntegerProperty(AObject: TObject; const AName: string; + const ADefaultValue: Integer): Integer; +begin + if TestProperty(AObject, AName, tkInteger) then + {$IFDEF DELPHI5} + Result := GetOrdProp(GetObject(AObject), AName) + {$ELSE} + Result := GetOrdProp(GetObject(AObject), GetPropInfo_(AObject, AName)) + {$ENDIF} + else + Result := ADefaultValue; +end; + +{$IFDEF DELPHI6} +function TcxCustomConverter.GetInterfaceProperty(AObject: TObject; const AName: string; + const ADefaultValue: IUnknown): IUnknown; +begin + if TestProperty(AObject, AName, tkInterface) then + Result := GetInterfaceProp(GetObject(AObject), AName) + else + Result := ADefaultValue; +end; +{$ENDIF} + +function TcxCustomConverter.GetMethodProperty(AObject: TObject; const AName: string; + const ADefaultValue: TMethod): TMethod; +begin + if TestProperty(AObject, AName, tkMethod) then + {$IFDEF DELPHI5} + Result := GetMethodProp(GetObject(AObject), AName) + {$ELSE} + Result := GetMethodProp(GetObject(AObject), GetPropInfo_(AObject, AName)) + {$ENDIF} + else + Result := ADefaultValue; +end; + +procedure TcxCustomConverter.GetSetProperty(AObject: TObject; const AName: string; AValues: TStrings); +{$IFNDEF DELPHI5} +type + TIntegerSet = set of 0..SizeOf(Integer) * 8 - 1; +{$ENDIF} +var +{$IFDEF DELPHI5} + AString: string; +{$ELSE} + AIS: TIntegerSet; + ATypeInfo: PTypeInfo; + APropInfo: PPropInfo; +{$ENDIF} + I: Integer; +begin + if TestProperty(AObject, AName, tkSet) then + begin + if AValues <> nil then + begin + {$IFDEF DELPHI5} + AString := GetSetProp(GetObject(AObject), AName); + if AString <> '' then + begin + AValues.Add(''); + for I := 1 to Length(AString) do + begin + if AString[I] = ',' then + AValues.Add('') + else + AValues[AValues.Count - 1] := AValues[AValues.Count - 1] + AString[I]; + end; + end; + {$ELSE} + APropInfo := GetPropInfo_(AObject, AName); + Integer(AIS) := GetOrdProp(GetObject(AObject), APropInfo); + ATypeInfo := GetTypeData(APropInfo^.PropType^)^.CompType^; + for I := 0 to SizeOf(Integer) * 8 - 1 do + if I in AIS then + AValues.Add(GetEnumName(ATypeInfo, I)); + {$ENDIF} + end; + end; +end; + +function TcxCustomConverter.GetStringProperty(AObject: TObject; const AName: string; + const ADefaultValue: string): string; +begin + try + if not TestProperty(AObject, AName, tkString) then + if not TestProperty(AObject, AName, tkLString) then + begin + Result := ADefaultValue; + Exit; + end; + except + on EcxUnknownProperty do + TestProperty(AObject, AName, tkLString); + end; + + {$IFDEF DELPHI5} + Result := GetStrProp(GetObject(AObject), AName); + {$ELSE} + Result := GetStrProp(GetObject(AObject), GetPropInfo_(AObject, AName)); + {$ENDIF} +end; + +function TcxCustomConverter.GetVariantProperty(AObject: TObject; const AName: string; + const ADefaultValue: Variant): Variant; +begin + if TestProperty(AObject, AName, tkVariant) then + {$IFDEF DELPHI5} + Result := GetVariantProp(GetObject(AObject), AName) + {$ELSE} + Result := GetVariantProp(GetObject(AObject), GetPropInfo_(AObject, AName)) + {$ENDIF} + else + Result := ADefaultValue; +end; + +function TcxCustomConverter.GetWideCharProperty(AObject: TObject; const AName: string; + const ADefaultValue: WideChar): WideChar; +begin + if TestProperty(AObject, AName, tkWChar) then + {$IFDEF DELPHI5} + Result := WideChar(GetOrdProp(GetObject(AObject), AName)) + {$ELSE} + Result := WideChar(GetOrdProp(GetObject(AObject), GetPropInfo_(AObject, AName))) + {$ENDIF} + else + Result := ADefaultValue; +end; + +function TcxCustomConverter.GetWideStringProperty(AObject: TObject; const AName: string; + const ADefaultValue: WideString): WideString; +begin + if TestProperty(AObject, AName, tkWString) then + {$IFDEF DELPHI5} + Result := GetStrProp(GetObject(AObject), AName) + {$ELSE} + Result := GetStrProp(GetObject(AObject), GetPropInfo_(AObject, AName)) + {$ENDIF} + else + Result := ADefaultValue; +end; + +procedure TcxCustomConverter.PostImport; +begin +end; + +procedure TcxCustomConverter.PreImport; +begin +end; + +function TcxCustomConverter.GetObject(AObject: TObject): TObject; +begin + if AObject <> nil then + Result := AObject + else + Result := FSource; +end; + +function TcxCustomConverter.GetPropInfo_(AObject: TObject; const AName: string): PPropInfo; +begin + Result := GetPropInfo(GetObject(AObject).ClassInfo, AName); +end; + +function TcxCustomConverter.TestProperty(AObject: TObject; const AName: string; + ATypeKind: TTypeKind): Boolean; +var + APPropInfo: PPropInfo; +begin + Result := True; + APPropInfo := GetPropInfo_(AObject, AName); + if APPropInfo <> nil then + begin + if APPropInfo^.PropType^.Kind <> ATypeKind then + begin + if FPropertyExceptionEnabled then + raise EcxUnknownProperty.Create('Invalid property type') + else + Result := False; + end; + end + else + begin + if FPropertyExceptionEnabled then + raise EcxUnknownProperty.Create('Invalid property name') + else + Result := False; + end; +end; + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxDWMApi.pas b/official/x.35/ExpressLibrary/Sources/cxDWMApi.pas new file mode 100644 index 00000000..043a9f63 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxDWMApi.pas @@ -0,0 +1,173 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDWMApi; + +{$I cxVer.inc} + +interface + +uses + Windows, dxUxTheme; + +const +{$IFDEF CBUILDER11} + {$EXTERNALSYM WM_DWMCOMPOSITIONCHANGED} +{$ENDIF} + WM_DWMCOMPOSITIONCHANGED = $0031E; +{$IFDEF CBUILDER11} + {$EXTERNALSYM WM_DWMNCRENDERINGCHANGED} +{$ENDIF} + WM_DWMNCRENDERINGCHANGED = $0031F; +{$IFDEF CBUILDER11} + {$EXTERNALSYM WM_DWMCOLORIZATIONCOLORCHANGED} +{$ENDIF} + WM_DWMCOLORIZATIONCOLORCHANGED = $00320; +{$IFDEF CBUILDER11} + {$EXTERNALSYM WM_DWMWINDOWMAXIMIZEDCHANGE} +{$ENDIF} + WM_DWMWINDOWMAXIMIZEDCHANGE = $00321; + + DWM_EC_DISABLECOMPOSITION = 0; + DWM_EC_ENABLECOMPOSITION = 1; + + // Blur behind data structures + DWM_BB_ENABLE = $00000001; // fEnable has been specified + DWM_BB_BLURREGION = $00000002; // hRgnBlur has been specified} + DWM_BB_TRANSITIONONMAXIMIZED = $00000004; // fTransitionOnMaximized has been specified + + // Window attributes + DWMWA_NCRENDERING_ENABLED = 1; // [get] Is non-client rendering enabled/disabled + DWMWA_NCRENDERING_POLICY = 2; // [set] Non-client rendering policy + DWMWA_TRANSITIONS_FORCEDISABLED = 3; // [set] Potentially enable/forcibly disable transitions + DWMWA_ALLOW_NCPAINT = 4; // [set] Allow contents rendered in the non-client area to be visible on the DWM-drawn frame. + DWMWA_CAPTION_BUTTON_BOUNDS = 5; // [get] Bounds of the caption button area in window-relative space. + DWMWA_NONCLIENT_RTL_LAYOUT = 6; // [set] Is non-client content RTL mirrored + DWMWA_FORCE_ICONIC_REPRESENTATION = 7; // [set] Force this window to display iconic thumbnails. + DWMWA_FLIP3D_POLICY = 8; // [set] Designates how Flip3D will treat the window. + DWMWA_EXTENDED_FRAME_BOUNDS = 9; // [get] Gets the extended frame bounds rectangle in screen space + DWMWA_LAST = 10; + +type + _DWM_BLURBEHIND = packed record + dwFlags: DWORD; + fEnable: Bool; + hRgnBlur: HRGN; + fTransitionOnMaximized: Bool; + end; + DWM_BLURBEHIND = _DWM_BLURBEHIND; + PDWM_BLURBEHIND = ^_DWM_BLURBEHIND; + + // Non-client rendering policy attribute values + TDWMNCRENDERINGPOLICY = ( + DWMNCRP_USEWINDOWSTYLE, // Enable/disable non-client rendering based on window style + DWMNCRP_DISABLED, // Disabled non-client rendering; window style is ignored + DWMNCRP_ENABLED, // Enabled non-client rendering; window style is ignored + DWMNCRP_LAST); + +var + DwmDefWindowProc: function (wnd: HWND; msg: UINT; wParam: WPARAM; + lParam: LPARAM; plResult: LRESULT): HRESULT; stdcall; + DwmEnableBlurBehindWindow: function (wnd: HWND; + pBlurBehind: PDWM_BLURBEHIND): HRESULT; stdcall; + DwmEnableComposition: function (uCompositionAction: Boolean): HRESULT; stdcall; + DwmEnableMMCSS: function (fEnableMMCSS: Boolean): HRESULT; stdcall; + DwmExtendFrameIntoClientArea: function (wnd: HWND; + pMarInset: PdxMargins): HRESULT; stdcall; + DwmGetColorizationColor: function (out pcrColorization: DWORD; + out pfOpaqueBlend: BOOL): HRESULT; stdcall; + DwmGetWindowAttribute: function(hwnd: HWND; dwAttribute: DWORD; + pvAttribute: Pointer; cbAttribute: DWORD): HRESULT; stdcall; + DwmIsCompositionEnabled: function(out pfEnabled: BOOL): HRESULT; stdcall; + DwmSetWindowAttribute: function(hwnd: HWND; dwAttribute: DWORD; + pvAttribute: Pointer; cbAttribute: DWORD): HRESULT; stdcall; + +function IsDwmPresent: Boolean; +function IsCompositionEnabled: Boolean; + +implementation + +uses + SysUtils; + +var + dwmapiDLL: THandle; + dwmPresent: Boolean; + +function IsDwmPresent: Boolean; +begin + Result := dwmPresent; +end; + +function IsCompositionEnabled: Boolean; +var + B: BOOL; +begin + Result := IsDwmPresent; + if Result then + begin + DwmIsCompositionEnabled(B); + Result := B; + end; +end; + +function InitDWM: Boolean; +begin + Result := False; + if Win32MajorVersion < 6 then Exit; + dwmapiDLL := LoadLibrary('dwmapi.dll'); + if dwmapiDLL <> 0 then + begin + DwmDefWindowProc := GetProcAddress(dwmapiDLL, 'DwmDefWindowProc'); + DwmEnableBlurBehindWindow := GetProcAddress(dwmapiDLL, 'DwmEnableBlurBehindWindow'); + DwmEnableComposition := GetProcAddress(dwmapiDLL, 'DwmEnableComposition'); + DwmEnableMMCSS := GetProcAddress(dwmapiDLL, 'DwmEnableMMCSS'); + DwmExtendFrameIntoClientArea := GetProcAddress(dwmapiDLL, 'DwmExtendFrameIntoClientArea'); + DwmGetColorizationColor := GetProcAddress(dwmapiDLL, 'DwmGetColorizationColor'); + DwmGetWindowAttribute := GetProcAddress(dwmapiDLL, 'DwmGetWindowAttribute'); + DwmIsCompositionEnabled := GetProcAddress(dwmapiDLL, 'DwmIsCompositionEnabled'); + DwmSetWindowAttribute := GetProcAddress(dwmapiDLL, 'DwmSetWindowAttribute'); + Result := True; + end; +end; + +initialization + dwmPresent := InitDWM; + +finalization + if dwmapiDLL <> 0 then + FreeLibrary(dwmapiDLL); + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxDateUtils.pas b/official/x.35/ExpressLibrary/Sources/cxDateUtils.pas new file mode 100644 index 00000000..6275c263 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxDateUtils.pas @@ -0,0 +1,3919 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDateUtils; + +{$I cxVer.inc} + +interface + +uses + Variants, SysUtils, + Windows, Controls, Classes, Graphics, cxClasses; + +type + TDay = (dSunday, dMonday, dTuesday, dWednesday, dThursday, dFriday, dSaturday); + TDays = set of TDay; + TDayOfWeek = 0..6; + TcxDateElement = (deYear, deMonth, deDay); + TcxFirstWeekOfYear = (fwySystem, fwyJan1, fwyFirstFullWeek, fwyFirstFourDays); + +const + DATE_YEARMONTH = $00000008; // use year month picture + {$EXTERNALSYM DATE_YEARMONTH} + DATE_LTRREADING = $00000010; // add marks for left to right reading order layout + {$EXTERNALSYM DATE_LTRREADING} + DATE_RTLREADING = $00000020; // add marks for right to left reading order layout + {$EXTERNALSYM DATE_RTLREADING} + + NullDate = -700000; + InvalidDate = NullDate + 1; + SmartTextToDateFunc: function(const AText: string; var ADate: TDateTime): Boolean = nil; + +{$IFNDEF DELPHI7} + ApproxDaysPerMonth: Double = 30.4375; + ApproxDaysPerYear: Double = 365.25; + DaysPerWeek = 7; + WeeksPerFortnight = 2; + MonthsPerYear = 12; + YearsPerDecade = 10; + YearsPerCentury = 100; + YearsPerMillennium = 1000; + HoursPerDay = 24; + MinsPerHour = 60; + SecsPerMin = 60; + MSecsPerSec = 1000; + MinsPerDay = HoursPerDay * MinsPerHour; + SecsPerDay = MinsPerDay * SecsPerMin; + MSecsPerDay = SecsPerDay * MSecsPerSec; + DayMonday = 1; + DayTuesday = 2; + DayWednesday = 3; + DayThursday = 4; + DayFriday = 5; + DaySaturday = 6; + DaySunday = 7; +{$ENDIF} + +const + CAL_GREGORIAN = 1; //Gregorian (localized) calendar + {$EXTERNALSYM CAL_GREGORIAN} + CAL_GREGORIAN_US = 2; //Gregorian (U.S.) calendar + {$EXTERNALSYM CAL_GREGORIAN_US} + CAL_JAPAN = 3; // Japanese Emperor Era calendar + {$EXTERNALSYM CAL_JAPAN} + CAL_TAIWAN = 4; // Republic of China Era calendar + {$EXTERNALSYM CAL_TAIWAN} + CAL_KOREA = 5; // Korean Tangun Era calendar + {$EXTERNALSYM CAL_KOREA} + CAL_HIJRI = 6; // Hijri (Arabic Lunar) calendar + {$EXTERNALSYM CAL_HIJRI} + CAL_THAI = 7; // Thai calendar + {$EXTERNALSYM CAL_THAI} + CAL_HEBREW = 8; // Hebrew calendar + {$EXTERNALSYM CAL_HEBREW} + CAL_GREGORIAN_ME_FRENCH = 9; // Gregorian Middle East French calendar + {$EXTERNALSYM CAL_GREGORIAN_ME_FRENCH} + CAL_GREGORIAN_ARABIC = 10; // Gregorian Arabic calendar + {$EXTERNALSYM CAL_GREGORIAN_ARABIC} + CAL_GREGORIAN_XLIT_ENGLISH = 11; // Gregorian Transliterated English calendar + {$EXTERNALSYM CAL_GREGORIAN_XLIT_ENGLISH} + CAL_GREGORIAN_XLIT_FRENCH = 12; // Gregorian Transliterated French calendar + {$EXTERNALSYM CAL_GREGORIAN_XLIT_FRENCH} + CAL_JULIAN = 13; // Julian calendar + {$EXTERNALSYM CAL_JULIAN} + CAL_JAPANESELUNISOLAR = 14; // Japanes Lunar/Solar calendar + {$EXTERNALSYM CAL_JAPANESELUNISOLAR} + CAL_CHINESELUNISOLAR = 15; // Chinese Lunar/Solar calendar + {$EXTERNALSYM CAL_CHINESELUNISOLAR} + CAL_SAKA = 16; // reserved to match Office but not implemented in our code + {$EXTERNALSYM CAL_SAKA} + CAL_LUNAR_ETO_CHN = 17; // reserved to match Office but not implemented in our code + {$EXTERNALSYM CAL_LUNAR_ETO_CHN} + CAL_LUNAR_ETO_KOR = 18; // reserved to match Office but not implemented in our code + {$EXTERNALSYM CAL_LUNAR_ETO_KOR} + CAL_LUNAR_ETO_ROKUYOU = 19; // reserved to match Office but not implemented in our code + {$EXTERNALSYM CAL_LUNAR_ETO_ROKUYOU} + CAL_KOREANLUNISOLAR = 20; // Korean Lunar/Solar calendar + {$EXTERNALSYM CAL_KOREANLUNISOLAR} + CAL_TAIWANLUNISOLAR = 21; // Taiwan Lunar/Solar calendar + {$EXTERNALSYM CAL_TAIWANLUNISOLAR} + CAL_PERSIAN = 22; // Persian calendar + {$EXTERNALSYM CAL_PERSIAN} + CAL_UMALQURA = 23; // UmAlQura Hijri (Arabic Lunar) calendar } + {$EXTERNALSYM CAL_UMALQURA} + + CAL_SSHORTESTDAYNAME1 = $00000060; // Windows Vista or later: Short native name of the first day of the week. + {$EXTERNALSYM CAL_SSHORTESTDAYNAME1} + CAL_SSHORTESTDAYNAME2 = $00000061; // Windows Vista or later: Short native name of the second day of the week. + {$EXTERNALSYM CAL_SSHORTESTDAYNAME2} + CAL_SSHORTESTDAYNAME3 = $00000062; // Windows Vista or later: Short native name of the third day of the week.\ + {$EXTERNALSYM CAL_SSHORTESTDAYNAME3} + CAL_SSHORTESTDAYNAME4 = $00000063; // Windows Vista or later: Short native name of the fourth day of the week. + {$EXTERNALSYM CAL_SSHORTESTDAYNAME4} + CAL_SSHORTESTDAYNAME5 = $00000064; // Windows Vista or later: Short native name of the fifth day of the week. + {$EXTERNALSYM CAL_SSHORTESTDAYNAME5} + CAL_SSHORTESTDAYNAME6 = $00000065; // Windows Vista or later: Short native name of the sixth day of the week. + {$EXTERNALSYM CAL_SSHORTESTDAYNAME6} + CAL_SSHORTESTDAYNAME7 = $00000066; // Windows Vista or later: Short native name of the seventh day of the week. + {$EXTERNALSYM CAL_SSHORTESTDAYNAME7} + + CAL_RETURN_NUMBER = $20000000; // Windows 98/Me, Windows 2000 and later: Returns the result from GetCalendarInfo as a number instead of a string. This is only valid for CALTYPES beginning with CAL_I. + {$EXTERNALSYM CAL_RETURN_NUMBER} + CAL_ITWODIGITYEARMAX = $00000030; // Windows 98/Me, Windows 2000 and later: An integer value indicating the upper boundary of the two-digit year range. + {$EXTERNALSYM CAL_ITWODIGITYEARMAX} + CAL_SYEARMONTH = $0000002F; // Windows 98/Me, Windows 2000 and later: Enumerates the year/month formats for the specified calendars. + {$EXTERNALSYM CAL_SYEARMONTH} + +type +{$IFNDEF DELPHI7} + TFormatSettings = record + CurrencyFormat: Byte; + NegCurrFormat: Byte; + ThousandSeparator: Char; + DecimalSeparator: Char; + CurrencyDecimals: Byte; + DateSeparator: Char; + TimeSeparator: Char; + ListSeparator: Char; + CurrencyString: string; + ShortDateFormat: string; + LongDateFormat: string; + TimeAMString: string; + TimePMString: string; + ShortTimeFormat: string; + LongTimeFormat: string; + ShortMonthNames: array[1..12] of string; + LongMonthNames: array[1..12] of string; + ShortDayNames: array[1..7] of string; + LongDayNames: array[1..7] of string; + TwoDigitYearCenturyWindow: Word; + end; +{$ENDIF} + + {$EXTERNALSYM TcxCALID} + TcxCALID = DWORD; { Calendar ID. } + + TcxCalendarAlgorithmType = (catUnknown, catSolarCalendar, catLunarCalendar, + catLunarSolarCalendar); + + TcxDateTime = record + Era: Integer; + Year: Cardinal; + Month: Cardinal; + Day: Cardinal; + Hours: Byte; + Minutes: Byte; + Seconds: Byte; + Milliseconds: Word; + end; + + TcxDate = record + Era: Integer; + Year: Cardinal; + Month: Cardinal; + Day: Cardinal; + end; + + TcxTime = record + Hours: Cardinal; + Minutes: Cardinal; + Seconds: Cardinal; + Miliseconds: Cardinal; + end; + + TcxEra = class(TPersistent) + private + FEra: Integer; + FMaxEraYear: Integer; + FMinEraYear: Integer; + FStartDate: TDateTime; + FYearOffset: Integer; + public + procedure Assign(Source: TPersistent); override; + + property Era: Integer read FEra write FEra; + property MaxEraYear: Integer read FMaxEraYear write FMaxEraYear; + property MinEraYear: Integer read FMinEraYear write FMinEraYear; + property StartDate: TDateTime read FStartDate write FStartDate; + property YearOffset: Integer read FYearOffset write FYearOffset; + end; + + TcxEras = class(TcxObjectList) + private + function GetItem(AIndex: Integer): TcxEra; + procedure SetItem(AIndex: Integer; AValue: TcxEra); + public + property Items[Index: Integer]: TcxEra read GetItem write SetItem; default; + end; + + { TcxCustomCalendarTable } + + TcxCustomCalendarTable = class + protected + FEras: TcxEras; + procedure AdjustYear(var AYear, AEra: Integer); overload; virtual; + procedure AdjustYear(var AYear, AEra: Integer; AMonth, ADay: Integer); overload; virtual; + function GetCalendarAlgorithmType: TcxCalendarAlgorithmType; virtual; abstract; + function GetCalendarID: TcxCALID; virtual; abstract; + function GetDefaultEra: TcxEra; virtual; abstract; + function GetMaxSupportedDate: TDateTime; virtual; abstract; + function GetMinSupportedDate: TDateTime; virtual; abstract; + procedure CheckDateTime(var ADateTime: TDateTime); virtual; + function GetMaxSupportedYear: Integer; virtual; abstract; + function GetMinSupportedYear: Integer; virtual; abstract; + function IsNotValid(ADate: TcxDateTime; out AResult: TDateTime): Boolean; + procedure YearToGregorianYear(var AYear: Cardinal; AEra: Integer); + public + constructor Create; virtual; + destructor Destroy; override; + + function AddDays(ADate: TcxDateTime; ACountDays: Integer): TDateTime; overload; virtual; + + function AddMonths(ADate: TDateTime; ACountMonths: Integer): TDateTime; overload; virtual; + function AddMonths(ADate: TcxDateTime; ACountMonths: Integer): TDateTime; overload; virtual; + + function AddYears(ADate: TDateTime; ACountYears: Integer): TDateTime; overload; virtual; + function AddYears(ADate: TcxDateTime; ACountYears: Integer): TDateTime; overload; virtual; + + function AddWeeks(ADate: TDateTime; ACountWeeks: Integer): TDateTime; overload; virtual; + function AddWeeks(ADate: TcxDateTime; ACountWeeks: Integer): TDateTime; overload; virtual; + + function FromDateTime(ADate: TDateTime): TcxDateTime; overload; virtual; abstract; + function FromDateTime(AYear, AMonth, ADay: Cardinal): TcxDateTime; overload; virtual; + function FromDateTime(AYear, AMonth, ADay: Cardinal; AHours, AMinutes, ASeconds: Byte; + AMilliseconds: Word): TcxDateTime; overload; virtual; + function GetDayOfYear(ADate: TDateTime): Cardinal; overload; virtual; + function GetDayOfYear(ADate: TcxDateTime): Cardinal; overload; virtual; + function GetDaysInMonth(AYear, AMonth: Cardinal): Cardinal; overload; virtual; + function GetDaysInMonth(AEra: Integer; AYear, AMonth: Cardinal): Cardinal; overload; virtual; abstract; + function GetDaysInYear(AYear: Cardinal): Cardinal; overload; virtual; + function GetDaysInYear(AEra: Integer; AYear: Cardinal): Cardinal; overload; virtual; abstract; + function GetEra(AYear: Integer): Integer; overload; virtual; + function GetEra(AYear, AMonth, ADay: Integer): Integer; overload; virtual; + function GetFirstDayOfWeek(ADate: TDateTime): TDateTime; overload; virtual; + function GetFirstDayOfWeek(ADate: TDateTime; AStartDayOfWeek: TDay): TDateTime; overload; virtual; + function GetFirstDayOfWeek(ADate: TcxDateTime): TcxDateTime; overload; virtual; + function GetFirstDayOfWeek(ADate: TcxDateTime; AStartDayOfWeek: TDay): TcxDateTime; overload; virtual; + function GetFirstWeekDay: Byte; virtual; abstract; + function GetFullWeeksInYear(AYear: Cardinal): Cardinal; virtual; abstract; + function GetMonthsInYear(AYear: Cardinal): Cardinal; overload; virtual; + function GetMonthsInYear(AEra: Integer; AYear: Cardinal): Cardinal; overload; virtual; abstract; + function GetYear(ADate: TDateTime): Cardinal; overload; virtual; + function GetYear(ADate: TcxDate): Cardinal; overload; virtual; + function GetYear(ADate: TcxDateTime): Cardinal; overload; virtual; + function GetWeekDay(ADate: TDateTime): Byte; overload; virtual; + function GetWeekDay(ADate: TcxDateTime): Byte; overload; virtual; + function GetWeekNumber(ADate: TDateTime; AStartOfWeek: TDay; + AFirstWeekOfYear: TcxFirstWeekOfYear): Cardinal; overload; virtual; + function GetWeekNumber(ADate: TcxDateTime; AStartOfWeek: TDay; + AFirstWeekOfYear: TcxFirstWeekOfYear): Cardinal; overload; virtual; abstract; + function IsLeapDay(AYear, AMonth, ADay: Cardinal): Boolean; overload; virtual; + function IsLeapDay(AEra: Integer; AYear, AMonth, ADay: Cardinal): Boolean; overload; virtual; abstract; + function IsLeapMonth(AYear, AMonth: Cardinal): Boolean; overload; virtual; + function IsLeapMonth(AEra: Integer; AYear, AMonth: Cardinal): Boolean; overload; virtual; abstract; + function IsLeapYear(AYear: Cardinal): Boolean; overload; virtual; + function IsLeapYear(AEra: Integer; Year: Cardinal): Boolean; overload; virtual; abstract; + + function IsValidYear(AYear: Cardinal): Boolean; overload; virtual; + function IsValidYear(AEra: Integer; AYear: Cardinal): Boolean; overload; virtual; + function IsValidMonth(AYear, AMonth: Cardinal): Boolean; overload; virtual; + function IsValidMonth(AEra: Integer; AYear, AMonth: Cardinal): Boolean; overload; virtual; + function IsValidDay(AYear, AMonth, ADay: Cardinal): Boolean; overload; virtual; + function IsValidDay(AEra: Integer; AYear, AMonth, ADay: Cardinal): Boolean; overload; virtual; + function IsValidDate(ADate: TDateTime): Boolean; virtual; + + function ToDateTime(ADate: TcxDate): TDateTime; overload; virtual; + function ToDateTime(AYear, AMonth, ADay: Cardinal): TDateTime; overload; virtual; + function ToDateTime(AYear, AMonth, ADay: Cardinal; AHours, AMinutes, ASeconds: Byte; + AMilliseconds: Word): TDateTime; overload; virtual; + function ToDateTime(ADateTime: TcxDateTime): TDateTime; overload; virtual; abstract; + + function GetDayNumber(const S: string): Integer; virtual; + function GetMonthNumber(AYear: Integer; const S: string): Integer; virtual; + function GetYearNumber(const S: string): Integer; virtual; + + property AlgorithmType: TcxCalendarAlgorithmType read GetCalendarAlgorithmType; + property CalendarID: TcxCALID read GetCalendarID; + property DefaultEra: TcxEra read GetDefaultEra; + property Eras: TcxEras read FEras; + property MaxSupportedDate: TDateTime read GetMaxSupportedDate; + property MinSupportedDate: TDateTime read GetMinSupportedDate; + end; + + { TcxGregorianCalendarTable } + + TcxGregorianCalendarTableType = (gctLocalized = 1, gctUSEnglish = 2, gctMiddleEastFrench = 9, + gctArabic = 10, gctTransliteratedEnglish = 11, gctTransliteratedFrench = 12); + + TcxGregorianCalendarTable = class(TcxCustomCalendarTable) + private + FDefaultEra: TcxEra; + FGregorianCalendarType: TcxGregorianCalendarTableType; + protected + function GetCalendarAlgorithmType: TcxCalendarAlgorithmType; override; + function GetCalendarID: TcxCALID; override; + function GetDefaultEra: TcxEra; override; + function GetMaxSupportedDate: TDateTime; override; + function GetMinSupportedDate: TDateTime; override; + function GetMaxSupportedYear: Integer; override; + function GetMinSupportedYear: Integer; override; + public + constructor Create; override; + destructor Destroy; override; + + function FromDateTime(ADate: TDateTime): TcxDateTime; overload; override; + function GetFirstWeekDay: Byte; override; + function GetWeekNumber(ADate: TcxDateTime; AStartOfWeek: TDay; + AFirstWeekOfYear: TcxFirstWeekOfYear): Cardinal; overload; override; + function GetDaysInMonth(AEra: Integer; AYear, AMonth: Cardinal): Cardinal; override; + function GetDaysInYear(AEra: Integer; AYear: Cardinal): Cardinal; override; + function GetFullWeeksInYear(AYear: Cardinal): Cardinal; override; + function GetMonthsInYear(AEra: Integer; AYear: Cardinal): Cardinal; override; + function IsLeapDay(AEra: Integer; AYear, AMonth, ADay: Cardinal): Boolean; override; + function IsLeapMonth(AEra: Integer; AYear, AMonth: Cardinal): Boolean; override; + function IsLeapYear(AEra: Integer; AYear: Cardinal): Boolean; override; + function ToDateTime(ADateTime: TcxDateTime): TDateTime; overload; override; + + property GregorianCalendarType: TcxGregorianCalendarTableType read + FGregorianCalendarType write FGregorianCalendarType; + end; + + { TcxJapaneseCalendarTable } + + TcxJapaneseCalendarTable = class(TcxGregorianCalendarTable) + protected + function GetCalendarAlgorithmType: TcxCalendarAlgorithmType; override; + function GetCalendarID: TcxCALID; override; + function GetDefaultEra: TcxEra; override; + function GetMaxSupportedDate: TDateTime; override; + function GetMinSupportedDate: TDateTime; override; + function GetMaxSupportedYear: Integer; override; + function GetMinSupportedYear: Integer; override; + public + constructor Create; override; + + function FromDateTime(ADate: TDateTime): TcxDateTime; overload; override; + function GetFirstWeekDay: Byte; override; + function ToDateTime(ADateTime: TcxDateTime): TDateTime; overload; override; + end; + + { TcxTaiwanCalendarTable } + + TcxTaiwanCalendarTable = class(TcxJapaneseCalendarTable) + protected + function GetCalendarAlgorithmType: TcxCalendarAlgorithmType; override; + function GetCalendarID: TcxCALID; override; + function GetDefaultEra: TcxEra; override; + function GetMinSupportedDate: TDateTime; override; + function GetMaxSupportedYear: Integer; override; + function GetMinSupportedYear: Integer; override; + public + constructor Create; override; + end; + + { TcxKoreanCalendarTable } + + TcxKoreanCalendarTable = class(TcxJapaneseCalendarTable) + protected + function GetCalendarAlgorithmType: TcxCalendarAlgorithmType; override; + function GetCalendarID: TcxCALID; override; + function GetDefaultEra: TcxEra; override; + function GetMinSupportedDate: TDateTime; override; + function GetMaxSupportedYear: Integer; override; + function GetMinSupportedYear: Integer; override; + public + constructor Create; override; + end; + + { TcxHijriCalendarTable } + + TcxHijriCalendarTable = class(TcxCustomCalendarTable) + private + FDefaultEra: TcxEra; + protected + function GetCalendarAlgorithmType: TcxCalendarAlgorithmType; override; + function GetCalendarID: TcxCALID; override; + function GetDefaultEra: TcxEra; override; + function GetMaxSupportedDate: TDateTime; override; + function GetMinSupportedDate: TDateTime; override; + function GetMaxSupportedYear: Integer; override; + function GetMinSupportedYear: Integer; override; + public + constructor Create; override; + destructor Destroy; override; + + function FromDateTime(ADate: TDateTime): TcxDateTime; overload; override; + function GetFirstWeekDay: Byte; override; + function GetWeekNumber(ADate: TcxDateTime; AStartOfWeek: TDay; + AFirstWeekOfYear: TcxFirstWeekOfYear): Cardinal; overload; override; + function GetDaysInMonth(AEra: Integer; AYear, AMonth: Cardinal): Cardinal; override; + function GetDaysInYear(AEra: Integer; AYear: Cardinal): Cardinal; override; + function GetFullWeeksInYear(AYear: Cardinal): Cardinal; override; + function GetMonthsInYear(AEra: Integer; AYear: Cardinal): Cardinal; override; + function IsLeapDay(AEra: Integer; AYear, AMonth, ADay: Cardinal): Boolean; override; + function IsLeapMonth(AEra: Integer; AYear, AMonth: Cardinal): Boolean; override; + function IsLeapYear(AEra: Integer; AYear: Cardinal): Boolean; override; + function ToDateTime(ADateTime: TcxDateTime): TDateTime; overload; override; + + function GetMonthNumber(AYear: Integer; const S: string): Integer; override; + end; + + { TcxThaiCalendarTable } + + TcxThaiCalendarTable = class(TcxJapaneseCalendarTable) + protected + function GetCalendarAlgorithmType: TcxCalendarAlgorithmType; override; + function GetCalendarID: TcxCALID; override; + function GetDefaultEra: TcxEra; override; + function GetMinSupportedDate: TDateTime; override; + function GetMaxSupportedYear: Integer; override; + function GetMinSupportedYear: Integer; override; + public + constructor Create; override; + end; + + { TcxHebrewCalendar } + + TcxHebrewCalendarTableTypeYear = (hctyDeficient = 1, hctyNormal = 2, hctyPerfect = 3); + + TcxHebrewCalendarTable = class(TcxCustomCalendarTable) + private + FDefaultEra: TcxEra; + function GetDayDifference(ALunarYearType, AMonth, ADay, + ALunarMonth, ALunarDay: Integer): Integer; + function HebrewNumber(const S: string): Integer; + procedure GetLunarMonthDay(AYear: Integer; var ADate: TcxDate); + protected + function GetCalendarAlgorithmType: TcxCalendarAlgorithmType; override; + function GetCalendarID: TcxCALID; override; + function GetDefaultEra: TcxEra; override; + function GetMaxSupportedDate: TDateTime; override; + function GetMinSupportedDate: TDateTime; override; + function GetMaxSupportedYear: Integer; override; + function GetMinSupportedYear: Integer; override; + public + constructor Create; override; + destructor Destroy; override; + + function FromDateTime(ADate: TDateTime): TcxDateTime; overload; override; + function GetFirstWeekDay: Byte; override; + function GetYearType(AYear: Cardinal): TcxHebrewCalendarTableTypeYear; + function GetWeekNumber(ADate: TcxDateTime; AStartOfWeek: TDay; + AFirstWeekOfYear: TcxFirstWeekOfYear): Cardinal; overload; override; + function GetDaysInMonth(AEra: Integer; AYear, AMonth: Cardinal): Cardinal; override; + function GetDaysInYear(AEra: Integer; AYear: Cardinal): Cardinal; override; + function GetFullWeeksInYear(AYear: Cardinal): Cardinal; override; + function GetMonthsInYear(AEra: Integer; AYear: Cardinal): Cardinal; override; + function IsLeapDay(AEra: Integer; AYear, AMonth, ADay: Cardinal): Boolean; override; + function IsLeapMonth(AEra: Integer; AYear, AMonth: Cardinal): Boolean; override; + function IsLeapYear(AEra: Integer; AYear: Cardinal): Boolean; override; + function ToDateTime(ADateTime: TcxDateTime): TDateTime; overload; override; + + function GetDayNumber(const S: string): Integer; override; + function GetMonthNumber(AYear: Integer; const S: string): Integer; override; + function GetYearNumber(const S: string): Integer; override; + end; + + TcxGetCalendarInfo = function (Locale: LCID; Calendar: CALID; + CalendType: CALTYPE; lpCalData : lpStr; + cchData: Integer; lpValue: lpDWord): Integer; stdcall; + +function cxGetCalendarInfo(Locale: LCID; Calendar: CALID; + CalendType: CALTYPE; lpCalData: lpStr; cchData: Integer; + lpValue: PDWORD): Integer; + +function cxDateToLocalFormatStr(ADate: TDateTime): string; +function cxDateToStr(ADate: TDateTime): string; overload; +function cxDateToStr(ADate: TDateTime; AFormat: TFormatSettings): string; overload; +function cxDayNumberToLocalFormatStr(ADate: TDateTime): string; overload; +function cxDayNumberToLocalFormatStr(ADay: Integer; ACalendar: TcxCustomCalendarTable = nil): string; overload; +function cxGetCalendar(ACalendType: CALTYPE): TcxCustomCalendarTable; +function cxGetLocalCalendarID: TcxCALID; +function cxGetLocalCalendar: TcxCustomCalendarTable; +function cxGetLocalFormatSettings: TFormatSettings; +function cxGetLocalLongDateFormat: string; +function cxGetLocalMonthName(ADate: TDateTime; ACalendar: TcxCustomCalendarTable): string; overload; +function cxGetLocalMonthName(AYear, AMonth: Integer; ACalendar: TcxCustomCalendarTable): string; overload; +function cxGetLocalMonthYear(ADate: TDateTime; ACalendar: TcxCustomCalendarTable = nil): string; +function cxGetLocalShortDateFormat: string; +function cxGetLocalYear(ADate: TDateTime; ACalendar: TcxCustomCalendarTable = nil): string; +function cxGetDayOfWeekName(I: Integer; AFontCharset: TFontCharset): string; +function cxIsGregorianCalendar(ACalendar: TcxCustomCalendarTable = nil): Boolean; +function cxLocalFormatStrToDate(const ADateStr: string): TDateTime; +function cxStrToDate(const ADateStr: string; + ACalendar: TcxCustomCalendarTable = nil): TcxDateTime; overload; +function cxStrToDate(const ADateStr: string; + AFormat: TFormatSettings; + ACalendar: TcxCustomCalendarTable = nil): TcxDateTime; overload; +function cxStrToDate(const ADateString: string; const AFormat: TFormatSettings; + ACALTYPE: CALTYPE): TDate; overload; + +var + MinYear: Integer = 100; + MaxYear: Integer = 9999; + cxMaxDateTime: Double = 2958465.99999; // 12/31/9999 11:59:59.999 PM + cxUseSingleCharWeekNames: Boolean = True; + +procedure AddDateRegExprMaskSmartInput(var AMask: string; ACanEnterTime: Boolean); +procedure DecMonth(var AYear, AMonth: Word); +procedure IncMonth(var AYear, AMonth: Word); overload; +procedure ChangeMonth(var AYear, AMonth: Word; Delta: Integer); +function GetMonthNumber(const ADate: TDateTime): Integer; +function GetDateElement(ADate: TDateTime; AElement: TcxDateElement; + ACalendar: TcxCustomCalendarTable = nil): Integer; +function IsLeapYear(AYear: Integer): Boolean; +function DaysPerMonth(AYear, AMonth: Integer): Integer; +function CheckDay(AYear, AMonth, ADay: Integer): Integer; +function TimeOf(const AValue: TDateTime): TDateTime; +function DateOf(const AValue: TDateTime): TDateTime; +function DayOfWeekOffset(const AValue: TDateTime): TDayOfWeek; + +function GetStartDateOfMonth(const ADate: TDateTime): TDateTime; +function GetStartOfWeek: Integer; +function GetEndDateOfMonth(const ADate: TDateTime; AIgnoreTime: Boolean): TDateTime; +function GetStartDateOfYear(const ADate: TDateTime): TDateTime; +function GetEndDateOfYear(const ADate: TDateTime; AIgnoreTime: Boolean): TDateTime; + +{!!! TODO: adapt to .net} +function cxGetDateFormat(ADate: TDateTime; out AFormatDate: string; AFlags: Integer; AFormat: string = ''): Boolean; +function DateToLongDateStr(ADate: TDateTime): string; +function GetWeekNumber(ADate: TDateTime; AStartOfWeek: TDay; + AFirstWeekOfYear: TcxFirstWeekOfYear): Integer; + +{$IFNDEF DELPHI6} +function HourOf(ADateTime: TDateTime): Word; +function IsPM(const AValue: TDateTime): Boolean; +function EncodeDateWeek(const AYear, AWeekOfYear: Word; + const ADayOfWeek: Word): TDateTime; +procedure DecodeDateWeek(const AValue: TDateTime; out AYear, AWeekOfYear, + ADayOfWeek: Word); +function DaysInAMonth(const AYear, AMonth: Word): Word; +function DaysInMonth(const AValue: TDateTime): Word; +function DayOf(const AValue: TDateTime): Word; +function DayOfTheMonth(const AValue: TDateTime): Word; +function DayOfTheWeek(const AValue: TDateTime): Word; +procedure DecodeDateTime(const AValue: TDateTime; out AYear, AMonth, ADay, + AHour, AMinute, ASecond, AMilliSecond: Word); +function EncodeDateTime(const AYear, AMonth, ADay, AHour, AMinute, ASecond, + AMilliSecond: Word): TDateTime; +procedure IncAMonth(var Year, Month, Day: Word; NumberOfMonths: Integer = 1); +function MinuteOf(const AValue: TDateTime): Word; +function MonthOf(const AValue: TDateTime): Word; +function StartOfTheYear(const AValue: TDateTime): TDateTime; +function StartOfTheMonth(const AValue: TDateTime): TDateTime; +function YearOf(const AValue: TDateTime): Word; +function YearsBetween(const ANow, AThen: TDateTime): Integer; +function MonthsBetween(const ANow, AThen: TDateTime): Integer; +function WeeksBetween(const ANow, AThen: TDateTime): Integer; +function DaysBetween(const ANow, AThen: TDateTime): Integer; +function IncYear(const AValue: TDateTime; + const ANumberOfYears: Integer = 1): TDateTime; +function IncMonth(const DateTime: TDateTime; NumberOfMonths: Integer): TDateTime; overload; +function IncWeek(const AValue: TDateTime; + const ANumberOfWeeks: Integer = 1): TDateTime; +function IncDay(const AValue: TDateTime; + const ANumberOfDays: Integer = 1): TDateTime; +function IncHour(const AValue: TDateTime; const ANumberOfHours: Int64 = 1): TDateTime; +function IncMinute(const AValue: TDateTime; const ANumberOfMinutes: Int64 = 1): TDateTime; +function WeekOfTheMonth(const AValue: TDateTime): Word; +function WeekOf(AValue: TDateTime): Word; +function WeekOfTheYear(const AValue: TDateTime): Word; +function DayOfTheYear(AValue: TDateTime): Word; +function EndOfTheYear(AValue: TDateTime): TDateTime; +{$ENDIF} + +function StrToDateDef(const ADateStr: string; ADefDate: TDateTime): TDateTime; +function SmartTextToDate(const AText: string; var ADate: TDateTime): Boolean; +function TextToDateEx(AText: string; var ADate: TDateTime): Boolean; +function cxDateTimeToText(ADate: TDateTime; AFourDigitYearNeeded: Boolean = False; AUseDelphiDateTimeFormats: Boolean = False): string; +function DateTimeToText(ADate: TDateTime; AFourDigitYearNeeded: Boolean = False): string; +function DateTimeToTextEx(const ADate: TDateTime; AIsMasked: Boolean; + AIsDateTimeEdit: Boolean = False; AFourDigitYearNeeded: Boolean = False): string; +function cxMinDateTime: Double; +function cxStrToDateTime(S: string; AUseOleDateFormat: Boolean; + out ADate: TDateTime): Boolean; + +implementation + +uses + DateUtils, cxFormats, cxLibraryStrs, cxControls, cxGraphics; + +type + TcxDateEditSmartInput = (deiToday, deiYesterday, deiTomorrow, + deiSunday, deiMonday, deiTuesday, deiWednesday, deiThursday, deiFriday, deiSaturday, + deiFirst, deiSecond, deiThird, deiFourth, deiFifth, deiSixth, deiSeventh, + deiBOM, deiEOM, deiNow); + +var + scxDateEditSmartInput: array [TcxDateEditSmartInput] of string; + +const + cxHebrewTable: array [0..1315] of Integer = + (7,3,17,3, // 1583-1584 (Hebrew year: 5343 - 5344) + 0,4,11,2,21,6,1,3,13,2, // 1585-1589 + 25,4,5,3,16,2,27,6,9,1, // 1590-1594 + 20,2,0,6,11,3,23,4,4,2, // 1595-1599 + 14,3,27,4,8,2,18,3,28,6, // 1600 + 11,1,22,5,2,3,12,3,25,4, // 1605 + 6,2,16,3,26,6,8,2,20,1, // 1610 + 0,6,11,2,24,4,4,3,15,2, // 1615 + 25,6,8,1,19,2,29,6,9,3, // 1620 + 22,4,3,2,13,3,25,4,6,3, // 1625 + 17,2,27,6,7,3,19,2,31,4, // 1630 + 11,3,23,4,5,2,15,3,25,6, // 1635 + 6,2,19,1,29,6,10,2,22,4, // 1640 + 3,3,14,2,24,6,6,1,17,3, // 1645 + 28,5,8,3,20,1,32,5,12,3, // 1650 + 22,6,4,1,16,2,26,6,6,3, // 1655 + 17,2,0,4,10,3,22,4,3,2, // 1660 + 14,3,24,6,5,2,17,1,28,6, // 1665 + 9,2,19,3,31,4,13,2,23,6, // 1670 + 3,3,15,1,27,5,7,3,17,3, // 1675 + 29,4,11,2,21,6,3,1,14,2, // 1680 + 25,6,5,3,16,2,28,4,9,3, // 1685 + 20,2,0,6,12,1,23,6,4,2, // 1690 + 14,3,26,4,8,2,18,3,0,4, // 1695 + 10,3,21,5,1,3,13,1,24,5, // 1700 + 5,3,15,3,27,4,8,2,19,3, // 1705 + 29,6,10,2,22,4,3,3,14,2, // 1710 + 26,4,6,3,18,2,28,6,10,1, // 1715 + 20,6,2,2,12,3,24,4,5,2, // 1720 + 16,3,28,4,8,3,19,2,0,6, // 1725 + 12,1,23,5,3,3,14,3,26,4, // 1730 + 7,2,17,3,28,6,9,2,21,4, // 1735 + 1,3,13,2,25,4,5,3,16,2, // 1740 + 27,6,9,1,19,3,0,5,11,3, // 1745 + 23,4,4,2,14,3,25,6,7,1, // 1750 + 18,2,28,6,9,3,21,4,2,2, // 1755 + 12,3,25,4,6,2,16,3,26,6, // 1760 + 8,2,20,1,0,6,11,2,22,6, // 1765 + 4,1,15,2,25,6,6,3,18,1, // 1770 + 29,5,9,3,22,4,2,3,13,2, // 1775 + 23,6,4,3,15,2,27,4,7,3, // 1780 + 19,2,31,4,11,3,21,6,3,2, // 1785 + 15,1,25,6,6,2,17,3,29,4, // 1790 + 10,2,20,6,3,1,13,3,24,5, // 1795 + 4,3,16,1,27,5,7,3,17,3, // 1800 + 0,4,11,2,21,6,1,3,13,2, // 1805 + 25,4,5,3,16,2,29,4,9,3, // 1810 + 19,6,30,2,13,1,23,6,4,2, // 1815 + 14,3,27,4,8,2,18,3,0,4, // 1820 + 11,3,22,5,2,3,14,1,26,5, // 1825 + 6,3,16,3,28,4,10,2,20,6, // 1830 + 30,3,11,2,24,4,4,3,15,2, // 1835 + 25,6,8,1,19,2,29,6,9,3, // 1840 + 22,4,3,2,13,3,25,4,7,2, // 1845 + 17,3,27,6,9,1,21,5,1,3, // 1850 + 11,3,23,4,5,2,15,3,25,6, // 1855 + 6,2,19,1,29,6,10,2,22,4, // 1860 + 3,3,14,2,24,6,6,1,18,2, // 1865 + 28,6,8,3,20,4,2,2,12,3, // 1870 + 24,4,4,3,16,2,26,6,6,3, // 1875 + 17,2,0,4,10,3,22,4,3,2, // 1880 + 14,3,24,6,5,2,17,1,28,6, // 1885 + 9,2,21,4,1,3,13,2,23,6, // 1890 + 5,1,15,3,27,5,7,3,19,1, // 1895 + 0,5,10,3,22,4,2,3,13,2, // 1900 + 24,6,4,3,15,2,27,4,8,3, // 1905 + 20,4,1,2,11,3,22,6,3,2, // 1910 + 15,1,25,6,7,2,17,3,29,4, // 1915 + 10,2,21,6,1,3,13,1,24,5, // 1920 + 5,3,15,3,27,4,8,2,19,6, // 1925 + 1,1,12,2,22,6,3,3,14,2, // 1930 + 26,4,6,3,18,2,28,6,10,1, // 1935 + 20,6,2,2,12,3,24,4,5,2, // 1940 + 16,3,28,4,9,2,19,6,30,3, // 1945 + 12,1,23,5,3,3,14,3,26,4, // 1950 + 7,2,17,3,28,6,9,2,21,4, // 1955 + 1,3,13,2,25,4,5,3,16,2, // 1960 + 27,6,9,1,19,6,30,2,11,3, // 1965 + 23,4,4,2,14,3,27,4,7,3, // 1970 + 18,2,28,6,11,1,22,5,2,3, // 1975 + 12,3,25,4,6,2,16,3,26,6, // 1980 + 8,2,20,4,30,3,11,2,24,4, // 1985 + 4,3,15,2,25,6,8,1,18,3, // 1990 + 29,5,9,3,22,4,3,2,13,3, // 1995 + 23,6,6,1,17,2,27,6,7,3, // 2000 - 2004 + 20,4,1,2,11,3,23,4,5,2, // 2005 - 2009 + 15,3,25,6,6,2,19,1,29,6, // 2010 + 10,2,20,6,3,1,14,2,24,6, // 2015 + 4,3,17,1,28,5,8,3,20,4, // 2020 + 1,3,12,2,22,6,2,3,14,2, // 2025 + 26,4,6,3,17,2,0,4,10,3, // 2030 + 20,6,1,2,14,1,24,6,5,2, // 2035 + 15,3,28,4,9,2,19,6,1,1, // 2040 + 12,3,23,5,3,3,15,1,27,5, // 2045 + 7,3,17,3,29,4,11,2,21,6, // 2050 + 1,3,12,2,25,4,5,3,16,2, // 2055 + 28,4,9,3,19,6,30,2,12,1, // 2060 + 23,6,4,2,14,3,26,4,8,2, // 2065 + 18,3,0,4,10,3,22,5,2,3, // 2070 + 14,1,25,5,6,3,16,3,28,4, // 2075 + 9,2,20,6,30,3,11,2,23,4, // 2080 + 4,3,15,2,27,4,7,3,19,2, // 2085 + 29,6,11,1,21,6,3,2,13,3, // 2090 + 25,4,6,2,17,3,27,6,9,1, // 2095 + 20,5,30,3,10,3,22,4,3,2, // 2100 + 14,3,24,6,5,2,17,1,28,6, // 2105 + 9,2,21,4,1,3,13,2,23,6, // 2110 + 5,1,16,2,27,6,7,3,19,4, // 2115 + 30,2,11,3,23,4,3,3,14,2, // 2120 + 25,6,5,3,16,2,28,4,9,3, // 2125 + 21,4,2,2,12,3,23,6,4,2, // 2130 + 16,1,26,6,8,2,20,4,30,3, // 2135 + 11,2,22,6,4,1,14,3,25,5, // 2140 + 6,3,18,1,29,5,9,3,22,4, // 2145 + 2,3,13,2,23,6,4,3,15,2, // 2150 + 27,4,7,3,20,4,1,2,11,3, // 2155 + 21,6,3,2,15,1,25,6,6,2, // 2160 + 17,3,29,4,10,2,20,6,3,1, // 2165 + 13,3,24,5,4,3,17,1,28,5, // 2170 + 8,3,18,6,1,1,12,2,22,6, // 2175 + 2,3,14,2,26,4,6,3,17,2, // 2180 + 28,6,10,1,20,6,1,2,12,3, // 2185 + 24,4,5,2,15,3,28,4,9,2, // 2190 + 19,6,33,3,12,1,23,5,3,3, // 2195 + 13,3,25,4,6,2,16,3,26,6, // 2200 + 8,2,20,4,30,3,11,2,24,4, // 2205 + 4,3,15,2,25,6,8,1,18,6, // 2210 + 33,2,9,3,22,4,3,2,13,3, // 2215 + 25,4,6,3,17,2,27,6,9,1, // 2220 + 21,5,1,3,11,3,23,4,5,2, // 2225 + 15,3,25,6,6,2,19,4,33,3, // 2230 + 10,2,22,4,3,3,14,2,24,6, // 2235 + 6,1); // 2240 (Hebrew year: 6000) + + cxHebrewLunarMonthLen: array [0..6,0..13] of Integer = ( + (0,00,00,00,00,00,00,00,00,00,00,00,00,0), + (0,30,29,29,29,30,29,30,29,30,29,30,29,0), // 3 common year variations + (0,30,29,30,29,30,29,30,29,30,29,30,29,0), + (0,30,30,30,29,30,29,30,29,30,29,30,29,0), + (0,30,29,29,29,30,30,29,30,29,30,29,30,29), // 3 leap year variations + (0,30,29,30,29,30,30,29,30,29,30,29,30,29), + (0,30,30,30,29,30,30,29,30,29,30,29,30,29)); + + cxHebrewYearOf1AD = 3760; + cxHebrewFirstGregorianTableYear = 1583; + cxHebrewLastGregorianTableYear = 2239; + cxHebrewTableYear = cxHebrewLastGregorianTableYear - cxHebrewFirstGregorianTableYear; + +type + TcxDateOrder = (doMDY, doDMY, doYMD); + TcxMonthView = (mvName, mvDigital); + TcxYearView = (yvFourDigitals, yvTwoDigitals); + +function GetDateOrder(const ADateFormat: string): TcxDateOrder; +var + I: Integer; +begin + Result := doMDY; + I := 1; + while I <= Length(ADateFormat) do + begin + case Chr(Ord(ADateFormat[I]) and $DF) of + 'E': Result := doYMD; + 'Y': Result := doYMD; + 'M': Result := doMDY; + 'D': Result := doDMY; + else + Inc(I); + Continue; + end; + Exit; + end; + Result := doMDY; +end; + +function cxDateToStrByFormat(const ADate: TDateTime; const ADateFormat: string; const ADateSeparator: Char): string; + + function AddZeros(const S: string; ALength: Integer): string; + begin + Result := S; + if ALength <= Length(S) then + Exit; + Result := StringOfChar('0', ALength - Length(Result)) + Result; + end; + + function GetCountChar(const S: string; Ch: Char): Integer; + var + I: Integer; + AFind: Boolean; + begin + Result := 0; + AFind := False; + for I := 1 to Length(S) do + if S[I] = Ch then + begin + Inc(Result); + AFind := True; + end + else + if AFind then + Break; + end; + + function GetMonthView(const ADateFormat: string): TcxMonthView; + begin + if GetCountChar(AnsiLowerCase(ADateFormat), 'm') = 4 then + Result := mvName + else + Result := mvDigital; + end; + + function GetYearView(const ADateFormat: string): TcxYearView; + begin + if GetCountChar(AnsiLowerCase(ADateFormat), 'y') = 4 then + Result := yvFourDigitals + else + Result := yvTwoDigitals; + end; + + function MonthToStr(AMonth: Integer; AView: TcxMonthView): string; + begin + case AView of + mvName: + Result := LongMonthNames[AMonth]; + else + Result := AddZeros(IntToStr(AMonth), 2); + end; + end; + + function YearToStr(AYear: Integer; AView: TcxYearView): string; + begin + Result := IntToStr(AYear); + if Length(Result) > 4 then + Result := Copy(Result, Length(Result) - 3, 4); + Result := AddZeros(Result, 4); + if AView = yvTwoDigitals then + Result := Copy(Result, Length(Result) - 1, 2); + end; + +var + Y, M, D: Word; + AYear, AMonth, ADay: string; +begin + DecodeDate(ADate, Y, M, D); + ADay := AddZeros(IntToStr(D), 2); + AMonth := MonthToStr(M, GetMonthView(ADateFormat)); + AYear := YearToStr(Y, GetYearView(ADateFormat)); + case GetDateOrder(ADateFormat) of + doMDY: + Result := AMonth + ADateSeparator + + ADay + ADateSeparator + AYear; + doDMY: + Result := ADay + ADateSeparator + + AMonth + ADateSeparator + AYear; + doYMD: + Result := AYear + ADateSeparator + + AMonth + ADateSeparator + ADay; + end; +end; + +procedure ScanBlanks(const S: string; var APos: Integer); +var + I: Integer; +begin + I := APos; + while (I <= Length(S)) and (S[I] = ' ') do Inc(I); + APos := I; +end; + +function cxInitEra(AEra: Integer; AStartDate: TDateTime; + AYearOffset, AMinEraYear, AMaxEraYear: Integer): TcxEra; +begin + Result := TcxEra.Create; + with Result do + begin + Era := AEra; + StartDate := AStartDate; + YearOffset := AYearOffset; + MinEraYear := AMinEraYear; + MaxEraYear := AMaxEraYear; + end; +end; + +function cxDateToLocalFormatStr(ADate: TDateTime): string; +var + ATime: TTime; +begin + cxGetDateFormat(ADate, Result, 0, cxGetLocalShortDateFormat); + ATime := TimeOf(ADate); + if ATime > 0 then + Result := Result + ' ' + TimeToStr(ATime); +end; + +function cxDateToStr(ADate: TDateTime): string; +begin + Result := cxDateToStrByFormat(ADate, ShortDateFormat, DateSeparator); +end; + +function cxDateToStr(ADate: TDateTime; AFormat: TFormatSettings): string; +begin + Result := cxDateToStrByFormat(ADate, AFormat.ShortDateFormat, AFormat.DateSeparator); +end; + +function cxDayNumberToLocalFormatStr(ADate: TDateTime): string; +var + AOldFormatShortDate: string; +begin + if not cxGetDateFormat(ADate, Result, 0, 'd') then + begin + AOldFormatShortDate := ShortDateFormat; + ShortDateFormat := 'd'; + try + Result := DateToStr(ADate); + finally + ShortDateFormat := AOldFormatShortDate; + end; + end; +end; + +function cxDayNumberToLocalFormatStr(ADay: Integer; ACalendar: TcxCustomCalendarTable = nil): string; +var + ADate: TcxDate; + ANeedFreeAndNilCalendar: Boolean; +begin + if ACalendar = nil then + begin + ACalendar := cxGetLocalCalendar; + ANeedFreeAndNilCalendar := True; + end + else + ANeedFreeAndNilCalendar := False; + try + with ADate do + begin + Year := ACalendar.GetMinSupportedYear; + Month := 1; + Day := ADay; + end; + Result := cxDayNumberToLocalFormatStr(ACalendar.ToDateTime(ADate)); + finally + if ANeedFreeAndNilCalendar then + FreeAndNil(ACalendar); + end; +end; + +function cxGetCalendar(ACalendType: CALTYPE): TcxCustomCalendarTable; +begin + case ACalendType of + CAL_GREGORIAN, CAL_GREGORIAN_US, CAL_GREGORIAN_ME_FRENCH, CAL_GREGORIAN_ARABIC, + CAL_GREGORIAN_XLIT_ENGLISH, CAL_GREGORIAN_XLIT_FRENCH: + begin + Result := TcxGregorianCalendarTable.Create; + TcxGregorianCalendarTable(Result).GregorianCalendarType := TcxGregorianCalendarTableType(ACalendType); + end; + CAL_JAPAN: + Result := TcxJapaneseCalendarTable.Create; + CAL_TAIWAN: + Result := TcxTaiwanCalendarTable.Create; + CAL_KOREA: + Result := TcxKoreanCalendarTable.Create; + CAL_HIJRI: + Result := TcxHijriCalendarTable.Create; + CAL_THAI: + Result := TcxThaiCalendarTable.Create; + CAL_HEBREW: + Result := TcxHebrewCalendarTable.Create; + else + begin + Result := TcxGregorianCalendarTable.Create; + end; + end; +end; + +function cxGetLocalCalendarID: TcxCALID; +begin + GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ICALENDARTYPE or CAL_RETURN_NUMBER, + @Result, SizeOf(Result)); +end; + +function cxGetLocalCalendar: TcxCustomCalendarTable; +begin + Result := cxGetCalendar(cxGetLocalCalendarID); +end; + +function cxGetLocalFormatSettings: TFormatSettings; +begin + Result.DateSeparator := DateSeparator; + Result.TimeSeparator := TimeSeparator; + Result.ShortDateFormat := cxGetLocalShortDateFormat; + Result.ShortTimeFormat := ShortTimeFormat; + Result.ListSeparator := ListSeparator; +end; + +function cxGetLocalLongDateFormat: string; +var + ABuf: array [0..255] of Char; +begin + GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLONGDATE, + @ABuf, SizeOf(ABuf)); + Result := ABuf; +end; + +function cxGetLocalMonthName(ADate: TDateTime; ACalendar: TcxCustomCalendarTable): string; +var + AFormat: string; + AConvertDate: TcxDateTime; +begin + AConvertDate := ACalendar.FromDateTime(ADate); + AConvertDate.Day := 1; + AFormat := 'MMMM'; + if not cxGetDateFormat(ACalendar.ToDateTime(AConvertDate), Result, + 0, AFormat) then + Result := LongMonthNames[AConvertDate.Month]; +end; + +function cxGetLocalMonthName(AYear, AMonth: Integer; ACalendar: TcxCustomCalendarTable): string; +var + ADate: TcxDate; +begin + ADate.Year := AYear; + ADate.Month := AMonth; + ADate.Day := 1; + if ACalendar.IsValidMonth(ADate.Year, ADate.Month) then + Result := cxGetLocalMonthName(ACalendar.ToDateTime(ADate), ACalendar) + else + Result := ''; +end; + +function cxGetLocalMonthYear(ADate: TDateTime; ACalendar: TcxCustomCalendarTable = nil): string; +var + AFormat: string; + AConvertDate: TcxDateTime; + ABuf: array [0..255] of Char; + ANeedFreeAndNilCalendar: Boolean; +begin + if ACalendar = nil then + begin + ACalendar := cxGetLocalCalendar; + ANeedFreeAndNilCalendar := True; + end + else + ANeedFreeAndNilCalendar := False; + try + AConvertDate := ACalendar.FromDateTime(ADate); + AConvertDate.Day := 1; + cxGetCalendarInfo(LOCALE_USER_DEFAULT, ACalendar.GetCalendarID, CAL_SYEARMONTH, + ABuf, SizeOf(ABuf), nil); + AFormat := ABuf; + if not cxGetDateFormat(ACalendar.ToDateTime(AConvertDate), Result, + 0, AFormat) then + Result := cxGetLocalMonthName(AConvertDate.Year, AConvertDate.Month, ACalendar) + ' ' + + cxGetLocalYear(ADate, ACalendar); + finally + if ANeedFreeAndNilCalendar then + FreeAndNil(ACalendar); + end; +end; + +function cxGetLocalShortDateFormat: string; +var + ABuf: array [0..255] of Char; +begin + GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SSHORTDATE, + @ABuf, SizeOf(ABuf)); + Result := ABuf; +end; + +function cxGetLocalYear(ADate: TDateTime; ACalendar: TcxCustomCalendarTable = nil): string; +var + AFormat: string; + AConvertDate: TcxDateTime; + ANeedFreeAndNilCalendar: Boolean; +begin + if ACalendar = nil then + begin + ACalendar := cxGetLocalCalendar; + ANeedFreeAndNilCalendar := True; + end + else + ANeedFreeAndNilCalendar := False; + try + AConvertDate := ACalendar.FromDateTime(ADate); + AConvertDate.Day := 1; + AFormat := 'yyyy'; + if not cxGetDateFormat(ACalendar.ToDateTime(AConvertDate), Result, + 0, AFormat) then + Result := IntToStr(AConvertDate.Year); + finally + if ANeedFreeAndNilCalendar then + FreeAndNil(ACalendar); + end; +end; + +function cxGetDayOfWeekName(I: Integer; AFontCharset: TFontCharset): string; +const + cxDayNameLCType: array [Boolean, 1..7] of Cardinal = + ((LOCALE_SABBREVDAYNAME1, LOCALE_SABBREVDAYNAME2, LOCALE_SABBREVDAYNAME3, + LOCALE_SABBREVDAYNAME4, LOCALE_SABBREVDAYNAME5, LOCALE_SABBREVDAYNAME6, + LOCALE_SABBREVDAYNAME7), + (CAL_SSHORTESTDAYNAME1, CAL_SSHORTESTDAYNAME2, CAL_SSHORTESTDAYNAME3, + CAL_SSHORTESTDAYNAME4, CAL_SSHORTESTDAYNAME5, CAL_SSHORTESTDAYNAME6, + CAL_SSHORTESTDAYNAME7)); +var + ABuf: array [0..255] of Char; +begin + if (I < 1) or (I > 7) then + begin + Result := ''; + Exit; + end; + GetLocaleInfo(GetThreadLocale, cxDayNameLCType[IsWinVista, I], ABuf, SizeOf(ABuf)); + Result := ABuf; + if cxUseSingleCharWeekNames then + if cxGetWritingDirection(AFontCharset, Result) = coRightToLeft then + Result := AnsiLastChar(Result) + else + begin + Result := WideString(Result)[1]; + end; +end; + +function cxIsGregorianCalendar(ACalendar: TcxCustomCalendarTable = nil): Boolean; +var + ANeedFreeAndNilCalendar: Boolean; +begin + if ACalendar = nil then + begin + ACalendar := cxGetLocalCalendar; + ANeedFreeAndNilCalendar := True; + end + else + ANeedFreeAndNilCalendar := False; + try + Result := ACalendar.GetCalendarID in [CAL_GREGORIAN, CAL_GREGORIAN_US, CAL_GREGORIAN_ME_FRENCH, + CAL_GREGORIAN_ARABIC, CAL_GREGORIAN_XLIT_ENGLISH, CAL_GREGORIAN_XLIT_FRENCH]; + finally + if ANeedFreeAndNilCalendar then + FreeAndNil(ACalendar); + end; +end; + +function cxLocalFormatStrToDate(const ADateStr: string): TDateTime; +var + D: TcxDateTime; + ACalendar: TcxCustomCalendarTable; +begin + case cxGetLocalCalendarID of + CAL_JAPAN, CAL_TAIWAN, CAL_KOREA, CAL_HIJRI, CAL_THAI, CAL_HEBREW: + begin + ACalendar := cxGetLocalCalendar; + try + D := cxStrToDate(ADateStr, ACalendar); + Result := ACalendar.ToDateTime(D); + finally + FreeAndNil(ACalendar); + end; + end; + else + TextToDateEx(ADateStr, Result); + end; +end; + +function cxStrToDate(const ADateStr: string; + ACalendar: TcxCustomCalendarTable = nil): TcxDateTime; +begin + Result := cxStrToDate(ADateStr, cxGetLocalFormatSettings, ACalendar); +end; + +function cxStrToDate(const ADateStr: string; + AFormat: TFormatSettings; + ACalendar: TcxCustomCalendarTable = nil): TcxDateTime; overload; +var + APart1, APart2, APart3: string; + H, M, S, MS: Word; + ATime: TTime; + APos: Integer; + ANeedFreeAndNilCalendar: Boolean; + AEraName : string; + AEraYearOffset: Integer; + + function GetEraYearOffset(const Name: string): Integer; + var + I: Integer; + begin + Result := 0; + for I := Low(EraNames) to High(EraNames) do + begin + if EraNames[I] = '' then Break; + if AnsiStrPos(PChar(EraNames[I]), PChar(Name)) <> nil then + begin + Result := EraYearOffsets[I]; + Exit; + end; + end; + end; + + procedure ScanToNumber(const S: string; var Pos: Integer); + begin + while (Pos <= Length(S)) and not (S[Pos] in ['0'..'9']) do + begin + if S[Pos] in LeadBytes then + Pos := NextCharIndex(S, Pos) + else + Inc(Pos); + end; + end; + + function ScanPart(AEndScan: Char): string; + begin + Result := ''; + Inc(APos); + while (APos <= Length(ADateStr)) and (ADateStr[APos] <> AEndScan) do + begin + Result := Result + ADateStr[APos]; + Inc(APos); + end; + end; + + function NeedMoreScanMonthStr: Boolean; + begin + ScanBlanks(ADateStr, APos); + Result := (AFormat.DateSeparator = ' ') and + ((APos < Length(ADateStr)) and not (ADateStr[APos] in ['0'..'9'])); + end; + +begin + APos := 0; + AEraYearOffset := 0; + if (AFormat.ShortDateFormat <> '') and (AFormat.ShortDateFormat[1] = 'g') then // skip over prefix text + begin + ScanToNumber(ADateStr, APos); + AEraName := Trim(Copy(ADateStr, 1, APos-1)); + AEraYearOffset := GetEraYearOffset(AEraName); + Dec(APos); + end + else + if AnsiPos('e', AFormat.ShortDateFormat) > 0 then + AEraYearOffset := EraYearOffsets[1]; + APart1 := ScanPart(AFormat.DateSeparator); + APart2 := ScanPart(AFormat.DateSeparator); + APart3 := ScanPart(' '); + Result.Era := -1; + if ACalendar = nil then + begin + ACalendar := cxGetLocalCalendar; + ANeedFreeAndNilCalendar := True; + end + else + ANeedFreeAndNilCalendar := False; + try + case GetDateOrder(AFormat.ShortDateFormat) of + doMDY: + begin + if NeedMoreScanMonthStr then + begin + APart1 := APart1 + ' ' + APart2; + APart2 := APart3; + Dec(APos); + APart3 := ScanPart(' '); + end; + Result.Year := ACalendar.GetYearNumber(APart3); + Result.Month := ACalendar.GetMonthNumber(Result.Year, APart1); + Result.Day := ACalendar.GetDayNumber(APart2); + end; + doDMY: + begin + if NeedMoreScanMonthStr then + begin + APart2 := APart2 + ' ' + APart3; + Dec(APos); + APart3 := ScanPart(' '); + end; + Result.Year := ACalendar.GetYearNumber(APart3); + Result.Month := ACalendar.GetMonthNumber(Result.Year, APart2); + Result.Day := ACalendar.GetDayNumber(APart1); + end; + doYMD: + begin + if NeedMoreScanMonthStr then + begin + APart2 := APart2 + ' ' + APart3; + Dec(APos); + APart3 := ScanPart(' '); + end; + Result.Year := ACalendar.GetYearNumber(APart1); + Result.Month := ACalendar.GetMonthNumber(Result.Year, APart2); + Result.Day := ACalendar.GetDayNumber(APart3); + end; + end; + Result.Era := ACalendar.GetEra(AEraYearOffset + 1); + finally + if ANeedFreeAndNilCalendar then + FreeAndNil(ACalendar); + end; + H := 0; + M := 0; + S := 0; + MS := 0; + if APos < Length(ADateStr) then + begin + ATime := StrToTime(Copy(ADateStr, APos, Length(ADateStr) - APos + 1)); + DecodeTime(ATime, H, M, S, MS); + end; + with Result do + begin + Hours := H; + Minutes := M; + Seconds := S; + Milliseconds := MS; + end; +end; + +function cxStrToDate(const ADateString: string; const AFormat: TFormatSettings; + ACALTYPE: CALTYPE): TDate; +var + ACalendar: TcxCustomCalendarTable; + ADate: TcxDateTime; +begin + ACalendar := cxGetCalendar(ACALTYPE); + try + ADate := cxStrToDate(ADateString, AFormat, ACalendar); + Result := ACalendar.ToDateTime(ADate); + finally + FreeAndNil(ACalendar); + end; +end; + +function cxGetCalendarInfo(Locale: LCID; Calendar: CALID; + CalendType: CALTYPE; lpCalData: lpStr; cchData: Integer; + lpValue: PDWORD): Integer; +var + AKernelDLL : Integer; + AGetCalendarInfo: TcxGetCalendarInfo; +begin + Result:= 0; + AKernelDLL:= LoadLibrary('Kernel32'); + if AKernelDLL <> 0 then + try + AGetCalendarInfo := GetProcAddress(AKernelDll,'GetCalendarInfoA'); + if Assigned(AGetCalendarInfo) then + Result:= AGetCalendarInfo(Locale, Calendar, CalendType, + lpCalData, cchData, lpValue); + finally + FreeLibrary(AKernelDLL); + end; +end; + +function cxGetLocaleChar(ALocaleType: Integer; const ADefaultValue: Char): string; +begin + Result := cxGetLocaleInfo(GetThreadLocale, ALocaleType, ADefaultValue)[1]; +end; + +function cxGetLocaleStr(ALocaleType: Integer; const ADefaultValue: string = ''): string; +begin + Result := cxGetLocaleInfo(GetThreadLocale, ALocaleType, ADefaultValue); +end; + +procedure CorrectTextForDateTimeConversion(var AText: string; + AOleConversion: Boolean); + + procedure InternalStringReplace(var S: WideString; ASubStr: WideString); + begin + S := StringReplace(S, ASubStr, GetCharString(' ', Length(ASubStr)), + [rfIgnoreCase, rfReplaceAll]); + end; + + procedure GetSpecialStrings(AList: TStringList); + var + I: Integer; + begin + if AOleConversion then + begin + AList.Add(cxGetLocaleStr(LOCALE_SDATE)[1]); + AList.Add(cxGetLocaleStr(LOCALE_STIME)[1]); + AList.Add(cxGetLocaleStr(LOCALE_S1159, 'am')); + AList.Add(cxGetLocaleStr(LOCALE_S2359, 'pm')); + end + else + begin + AList.Add(DateSeparator); + AList.Add(TimeSeparator); + AList.Add(TimeAMString); + AList.Add(TimePMString); + end; + for I := 0 to AList.Count - 1 do + AList[I] := AnsiUpperCase(Trim(AList[I])); + end; + + procedure RemoveStringsThatInFormatInfo(var S: WideString; + const ADateTimeFormatInfo: TcxDateTimeFormatInfo); + var + ASpecialStrings: TStringList; + ASubStr: string; + I: Integer; + begin + ASpecialStrings := TStringList.Create; + try + GetSpecialStrings(ASpecialStrings); + for I := 0 to High(ADateTimeFormatInfo.Items) do + if ADateTimeFormatInfo.Items[I].Kind = dtikString then + begin + ASubStr := AnsiUpperCase(Trim(ADateTimeFormatInfo.Items[I].Data)); + if (ASubStr <> '') and (ASpecialStrings.IndexOf(ASubStr) = -1) then + InternalStringReplace(S, ASubStr); + end; + finally + ASpecialStrings.Free; + end; + end; + + procedure RemoveUnnecessarySpaces(var S: WideString); + var + I: Integer; + begin + S := Trim(S); + I := 2; + while I < Length(S) - 1 do + if (S[I] <= ' ') and (S[I + 1] <= ' ') then + Delete(S, I, 1) + else + Inc(I); + end; + +var + S: WideString; +begin + S := AText; + RemoveStringsThatInFormatInfo(S, cxFormatController.DateFormatInfo); + RemoveStringsThatInFormatInfo(S, cxFormatController.TimeFormatInfo); + RemoveUnnecessarySpaces(S); + if AOleConversion then + InternalStringReplace(S, cxGetLocaleStr(LOCALE_SDATE)[1]); + AText := S; +end; + +procedure InitSmartInputConsts; +begin + scxDateEditSmartInput[deiToday] := cxGetResourceString(@cxSDateToday); + scxDateEditSmartInput[deiYesterday] := cxGetResourceString(@cxSDateYesterday); + scxDateEditSmartInput[deiTomorrow] := cxGetResourceString(@cxSDateTomorrow); + scxDateEditSmartInput[deiSunday] := cxGetResourceString(@cxSDateSunday); + scxDateEditSmartInput[deiMonday] := cxGetResourceString(@cxSDateMonday); + scxDateEditSmartInput[deiTuesday] := cxGetResourceString(@cxSDateTuesday); + scxDateEditSmartInput[deiWednesday] := cxGetResourceString(@cxSDateWednesday); + scxDateEditSmartInput[deiThursday] := cxGetResourceString(@cxSDateThursday); + scxDateEditSmartInput[deiFriday] := cxGetResourceString(@cxSDateFriday); + scxDateEditSmartInput[deiSaturday] := cxGetResourceString(@cxSDateSaturday); + scxDateEditSmartInput[deiFirst] := cxGetResourceString(@cxSDateFirst); + scxDateEditSmartInput[deiSecond] := cxGetResourceString(@cxSDateSecond); + scxDateEditSmartInput[deiThird] := cxGetResourceString(@cxSDateThird); + scxDateEditSmartInput[deiFourth] := cxGetResourceString(@cxSDateFourth); + scxDateEditSmartInput[deiFifth] := cxGetResourceString(@cxSDateFifth); + scxDateEditSmartInput[deiSixth] := cxGetResourceString(@cxSDateSixth); + scxDateEditSmartInput[deiSeventh] := cxGetResourceString(@cxSDateSeventh); + scxDateEditSmartInput[deiBOM] := cxGetResourceString(@cxSDateBOM); + scxDateEditSmartInput[deiEOM] := cxGetResourceString(@cxSDateEOM); + scxDateEditSmartInput[deiNow] := cxGetResourceString(@cxSDateNow); +end; + +procedure AddDateRegExprMaskSmartInput(var AMask: string; ACanEnterTime: Boolean); + + procedure AddString(var AMask: string; const S: string); + var + I: Integer; + begin + I := 1; + while I <= Length(S) do + if S[I] = '''' then + begin + AMask := AMask + '\'''; + Inc(I); + end + else + begin + AMask := AMask + ''''; + repeat + AMask := AMask + S[I]; + Inc(I); + until (I > Length(S)) or (S[I] = ''''); + AMask := AMask + ''''; + end; + end; + +var + I: TcxDateEditSmartInput; +begin + InitSmartInputConsts; + AMask := '(' + AMask + ')|('; + I := Low(TcxDateEditSmartInput); + if not ACanEnterTime and (I = deiNow) then + Inc(I); + AddString(AMask, scxDateEditSmartInput[I]); + while I < High(TcxDateEditSmartInput) do + begin + Inc(I); + if not(not ACanEnterTime and (I = deiNow)) then + begin + AMask := AMask + '|'; + AddString(AMask, scxDateEditSmartInput[I]); + end; + end; + AMask := AMask + ')((\+|-)\d(\d(\d\d?)?)?)?'; +end; + +procedure DecMonth(var AYear, AMonth: Word); +begin + if AMonth = 1 then + begin + Dec(AYear); + AMonth := 12; + end + else Dec(AMonth); +end; + +procedure IncMonth(var AYear, AMonth: Word); +begin + if AMonth = 12 then + begin + Inc(AYear); + AMonth := 1; + end + else Inc(AMonth); +end; + +procedure ChangeMonth(var AYear, AMonth: Word; Delta: Integer); +var + Month: Integer; +begin + Inc(AYear, Delta div 12); + Month := AMonth; + Inc(Month, Delta mod 12); + if Month < 1 then + begin + Dec(AYear); + Month := 12 + Month; + end; + if Month > 12 then + begin + Inc(AYear); + Month := Month - 12; + end; + AMonth := Month; +end; + +function GetMonthNumber(const ADate: TDateTime): Integer; +var + AYear, AMonth, ADay: Word; +begin + DecodeDate(ADate, AYear, AMonth, ADay); + Result := (AYear - 1) * 12 + AMonth; +end; + +function GetDateElement(ADate: TDateTime; AElement: TcxDateElement; + ACalendar: TcxCustomCalendarTable = nil): Integer; +var + ACalendarDate: TcxDateTime; + AYear, AMonth, ADay: Word; +begin + if ACalendar = nil then + DecodeDate(ADate, AYear, AMonth, ADay) + else + begin + ACalendarDate := ACalendar.FromDateTime(ADate); + with ACalendarDate do + begin + AYear := Year; + AMonth := Month; + ADay := Day; + end; + end; + case AElement of + deYear: + Result := AYear; + deMonth: + Result := AMonth; + else + Result := ADay; + end; +end; + +function IsLeapYear(AYear: Integer): Boolean; +begin + Result := (AYear mod 4 = 0) and ((AYear mod 100 <> 0) or (AYear mod 400 = 0)); +end; + +function DaysPerMonth(AYear, AMonth: Integer): Integer; +const + ADaysInMonth: array[1..12] of Integer = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); +begin + Result := ADaysInMonth[AMonth]; + if (AMonth = 2) and IsLeapYear(AYear) then Inc(Result); +end; + +function CheckDay(AYear, AMonth, ADay: Integer): Integer; +begin + if ADay < 1 then + Result := 1 + else + if ADay > DaysPerMonth(AYear, AMonth) then + Result := DaysPerMonth(AYear, AMonth) + else + Result := ADay; +end; + +function TimeOf(const AValue: TDateTime): TDateTime; +//to avoid problem +//var +// Hour, Min, Sec, MSec: Word; +begin +// DecodeTime(ADateTime, Hour, Min, Sec, MSec); +// Result := EncodeTime(Hour, Min, Sec, MSec); + Result := Frac(AValue); +end; + +function DateOf(const AValue: TDateTime): TDateTime; +begin +//to avoid problem +// Result := Trunc(ADateTime + (2 * Byte(ADateTime >= 0) - 1) * 1E-11); + Result := Trunc(AValue); +end; + +function DayOfWeekOffset(const AValue: TDateTime): TDayOfWeek; +var + AOffset: Integer; +begin + AOffset := DayOfWeek(AValue) - 1 - cxFormatController.StartOfWeek; + if AOffset < 0 then + Inc(AOffset, 7); + Result := AOffset; +end; + +function GetStartDateOfMonth(const ADate: TDateTime): TDateTime; +var + AYear, AMonth, ADay: Word; +begin + DecodeDate(ADate, AYear, AMonth, ADay); + Result := EncodeDate(AYear, AMonth, 1); +end; + +function GetStartOfWeek: Integer; +begin + Result := StrToInt(cxGetLocaleInfo(GetThreadLocale, LOCALE_IFIRSTDAYOFWEEK, '0')) + 1; + if Result > 6 then + Result := 0; +end; + +function GetEndDateOfMonth(const ADate: TDateTime; AIgnoreTime: Boolean): TDateTime; +var + AYear, AMonth, ADay: Word; +begin + DecodeDate(ADate, AYear, AMonth, ADay); + Result := EncodeDate(AYear, AMonth, MonthDays[IsLeapYear(AYear), AMonth]); + if not AIgnoreTime then + Result := Result + EncodeTime(23, 59, 59, 999); +end; + +function GetStartDateOfYear(const ADate: TDateTime): TDateTime; +begin + Result := EncodeDate(GetDateElement(ADate, deYear), 1, 1); +end; + +function GetEndDateOfYear(const ADate: TDateTime; AIgnoreTime: Boolean): TDateTime; +begin + Result := EncodeDate(GetDateElement(ADate, deYear), 12, 31); + if not AIgnoreTime then + Result := Result + EncodeTime(23, 59, 59, 999); +end; + +{!!! TODO: adapt to .net} +function cxGetDateFormat(ADate: TDateTime; out AFormatDate: string; AFlags: Integer; AFormat: string = ''): Boolean; +var + L: Integer; + P: PChar; + ASystemDate: TSystemTime; + Buffer: array[0..255] of Char; +begin + DateTimeToSystemTime(ADate, ASystemDate); + if Length(AFormat) = 0 then P := nil else P := PChar(AFormat); + L := GetDateFormat(GetThreadLocale, AFlags, @ASystemDate, P, Buffer, SizeOf(Buffer)); + Result := L > 0; + if Result then SetString(AFormatDate, Buffer, L - 1) else AFormatDate := ''; +end; + +function DateToLongDateStr(ADate: TDateTime): string; +begin + if not cxGetDateFormat(ADate, Result, DATE_LONGDATE) then + Result := FormatDateTime('dddddd', Date); +end; + +function GetWeekNumber(ADate: TDateTime; AStartOfWeek: TDay; + AFirstWeekOfYear: TcxFirstWeekOfYear): Integer; + + function FindFirstDayOfWeekDate(ADate: TDateTime): TDateTime; + var + ADayOfWeek: TDay; + ADelta: Integer; + begin + ADayOfWeek := TDay(DayOfWeek(ADate) - 1); + ADelta := Ord(ADayOfWeek) - Ord(AStartOfWeek); + if ADelta < 0 then Inc(ADelta, 7); + Result := Trunc(ADate) - ADelta; + end; + +var + AYear, AMonth, ADay: Word; + AStartWeekDate: TDateTime; + AStart: TDateTime; +begin + if AFirstWeekOfYear = fwySystem then + AFirstWeekOfYear := TcxFirstWeekOfYear( + StrToInt(cxGetLocaleChar(LOCALE_IFIRSTWEEKOFYEAR, '0')) + 1); + AStart := FindFirstDayOfWeekDate(StartOfTheYear(ADate)); + DecodeDate(ADate, AYear, AMonth, ADay); + case AFirstWeekOfYear of + fwyFirstFourDays: + if YearOf(AStart + 3) < AYear then AStart := AStart + 7; + fwyFirstFullWeek: + if YearOf(AStart) < AYear then AStart := AStart + 7; + end; + //DELPHI8! check Trunc() + Result := Trunc(Trunc(ADate) - AStart) div 7 + 1; + if AMonth = 12 then + begin + AStartWeekDate := FindFirstDayOfWeekDate(ADate); + case AFirstWeekOfYear of + fwyJan1: + if MonthOf(AStartWeekDate + 6) = 1 then + Result := 1; + fwyFirstFourDays: + if MonthOf(AStartWeekDate + 3) = 1 then + Result := 1; + end; + end; +end; + +{$IFNDEF DELPHI6} +function HourOf(ADateTime: TDateTime): Word; +var + AMin, ASec, AMilliSec: Word; +begin + DecodeTime(ADateTime, Result, AMin, ASec, AMilliSec); +end; + +function IsPM(const AValue: TDateTime): Boolean; +begin + Result := HourOf(AValue) >= 12; +end; + +function DaysInAMonth(const AYear, AMonth: Word): Word; +begin + Result := MonthDays[(AMonth = 2) and IsLeapYear(AYear), AMonth]; +end; + +function DaysInMonth(const AValue: TDateTime): Word; +begin + Result := DaysInAMonth(YearOf(AValue), MonthOf(AValue)); +end; + +function DayOf(const AValue: TDateTime): Word; +var + AYear, AMonth: Word; +begin + DecodeDate(AValue, AYear, AMonth, Result); +end; + +function DayOfTheMonth(const AValue: TDateTime): Word; +begin + Result := DayOf(AValue); +end; + +function DayOfTheWeek(const AValue: TDateTime): Word; +begin + Result := (DateTimeToTimeStamp(AValue).Date - 1) mod 7 + 1; +end; + +procedure DecodeDateTime(const AValue: TDateTime; out AYear, AMonth, ADay, + AHour, AMinute, ASecond, AMilliSecond: Word); +begin + DecodeDate(AValue, AYear, AMonth, ADay); + DecodeTime(AValue, AHour, AMinute, ASecond, AMilliSecond); +end; + +function EncodeDateTime(const AYear, AMonth, ADay, AHour, AMinute, ASecond, + AMilliSecond: Word): TDateTime; +begin + Result := EncodeDate(AYear, AMonth, ADay) + + EncodeTime(AHour, AMinute, ASecond, AMilliSecond); +end; + +procedure IncAMonth(var Year, Month, Day: Word; NumberOfMonths: Integer = 1); +var + DayTable: PDayTable; + Sign: Integer; +begin + if NumberOfMonths >= 0 then Sign := 1 else Sign := -1; + Year := Year + (NumberOfMonths div 12); + NumberOfMonths := NumberOfMonths mod 12; + Inc(Month, NumberOfMonths); + if Word(Month-1) > 11 then // if Month <= 0, word(Month-1) > 11) + begin + Inc(Year, Sign); + Inc(Month, -12 * Sign); + end; + DayTable := @MonthDays[IsLeapYear(Year)]; + if Day > DayTable^[Month] then Day := DayTable^[Month]; +end; + +function MinuteOf(const AValue: TDateTime): Word; +var + AHour, ASecond, AMilliSecond: Word; +begin + DecodeTime(AValue, AHour, Result, ASecond, AMilliSecond); +end; + +function MonthOf(const AValue: TDateTime): Word; +var + AYear, ADay: Word; +begin + DecodeDate(AValue, AYear, Result, ADay); +end; + +function StartOfTheYear(const AValue: TDateTime): TDateTime; +begin + Result := EncodeDate(YearOf(AValue), 1, 1); +end; + +function StartOfTheMonth(const AValue: TDateTime): TDateTime; +begin + Result := EncodeDate(YearOf(AValue), MonthOf(AValue), 1); +end; + +function YearOf(const AValue: TDateTime): Word; +var + AMonth, ADay: Word; +begin + DecodeDate(AValue, Result, AMonth, ADay); +end; + +const + DayMap: array [1..7] of Word = (7, 1, 2, 3, 4, 5, 6); + +procedure DivMod(Dividend: Integer; Divisor: Word; + var Result, Remainder: Word); +asm + PUSH EBX + MOV EBX,EDX + MOV EDX,EAX + SHR EDX,16 + DIV BX + MOV EBX,Remainder + MOV [ECX],AX + MOV [EBX],DX + POP EBX +end; + +function DecodeDateFully(const DateTime: TDateTime; var Year, Month, Day, DOW: Word): Boolean; +const + D1 = 365; + D4 = D1 * 4 + 1; + D100 = D4 * 25 - 1; + D400 = D100 * 4 + 1; +var + Y, M, D, I: Word; + T: Integer; + DayTable: PDayTable; +begin + T := DateTimeToTimeStamp(DateTime).Date; + if T <= 0 then + begin + Year := 0; + Month := 0; + Day := 0; + DOW := 0; + Result := False; + end else + begin + DOW := T mod 7 + 1; + Dec(T); + Y := 1; + while T >= D400 do + begin + Dec(T, D400); + Inc(Y, 400); + end; + DivMod(T, D100, I, D); + if I = 4 then + begin + Dec(I); + Inc(D, D100); + end; + Inc(Y, I * 100); + DivMod(D, D4, I, D); + Inc(Y, I * 4); + DivMod(D, D1, I, D); + if I = 4 then + begin + Dec(I); + Inc(D, D1); + end; + Inc(Y, I); + Result := IsLeapYear(Y); + DayTable := @MonthDays[Result]; + M := 1; + while True do + begin + I := DayTable^[M]; + if D < I then Break; + Dec(D, I); + Inc(M); + end; + Year := Y; + Month := M; + Day := D + 1; + end; +end; + +procedure DecodeDateWeek(const AValue: TDateTime; out AYear, AWeekOfYear, + ADayOfWeek: Word); +var + ADayOfYear: Integer; + AMonth, ADay: Word; + AStart: TDateTime; + AStartDayOfWeek, AEndDayOfWeek: Word; + ALeap: Boolean; +begin + ALeap := DecodeDateFully(AValue, AYear, AMonth, ADay, ADayOfWeek); + ADayOfWeek := DayMap[ADayOfWeek]; + AStart := EncodeDate(AYear, 1, 1); + ADayOfYear := Trunc(AValue - AStart + 1); + AStartDayOfWeek := DayOfTheWeek(AStart); + if AStartDayOfWeek in [DayFriday, DaySaturday, DaySunday] then + Dec(ADayOfYear, 8 - AStartDayOfWeek) + else + Inc(ADayOfYear, AStartDayOfWeek - 1); + if ADayOfYear <= 0 then + DecodeDateWeek(AStart - 1, AYear, AWeekOfYear, ADay) + else + begin + AWeekOfYear := ADayOfYear div 7; + if ADayOfYear mod 7 <> 0 then + Inc(AWeekOfYear); + if AWeekOfYear > 52 then + begin + AEndDayOfWeek := AStartDayOfWeek; + if ALeap then + begin + if AEndDayOfWeek = DaySunday then + AEndDayOfWeek := DayMonday + else + Inc(AEndDayOfWeek); + end; + if AEndDayOfWeek in [DayMonday, DayTuesday, DayWednesday] then + begin + Inc(AYear); + AWeekOfYear := 1; + end; + end; + end; +end; + +function EncodeDateWeek(const AYear, AWeekOfYear: Word; + const ADayOfWeek: Word): TDateTime; +var + ADayOfYear: Integer; + AStartDayOfWeek: Word; +begin + Result := EncodeDate(AYear, 1, 1); + AStartDayOfWeek := DayOfTheWeek(Result); + ADayOfYear := (AWeekOfYear - 1) * 7 + ADayOfWeek - 1; + if AStartDayOfWeek in [DayFriday, DaySaturday, DaySunday] then + Inc(ADayOfYear, 8 - AStartDayOfWeek) + else + Dec(ADayOfYear, AStartDayOfWeek - 1); + Result := Result + ADayOfYear; +end; + +function SpanOfNowAndThen(const ANow, AThen: TDateTime): TDateTime; +begin + if ANow < AThen then + Result := AThen - ANow + else + Result := ANow - AThen; +end; + +function DaySpan(const ANow, AThen: TDateTime): Double; +begin + Result := SpanOfNowAndThen(ANow, AThen); +end; + +function YearSpan(const ANow, AThen: TDateTime): Double; +begin + Result := DaySpan(ANow, AThen) / ApproxDaysPerYear; +end; + +function MonthSpan(const ANow, AThen: TDateTime): Double; +begin + Result := DaySpan(ANow, AThen) / ApproxDaysPerMonth; +end; + +function WeekSpan(const ANow, AThen: TDateTime): Double; +begin + Result := DaySpan(ANow, AThen) / DaysPerWeek; +end; + +function YearsBetween(const ANow, AThen: TDateTime): Integer; +begin + Result := Trunc(YearSpan(ANow, AThen)); +end; + +function MonthsBetween(const ANow, AThen: TDateTime): Integer; +begin + Result := Trunc(MonthSpan(ANow, AThen)); +end; + +function WeeksBetween(const ANow, AThen: TDateTime): Integer; +begin + Result := Trunc(WeekSpan(ANow, AThen)); +end; + +function DaysBetween(const ANow, AThen: TDateTime): Integer; +begin + Result := Trunc(DaySpan(ANow, AThen)); +end; + +function IncMonth(const DateTime: TDateTime; NumberOfMonths: Integer): TDateTime; +var + Year, Month, Day: Word; +begin + DecodeDate(DateTime, Year, Month, Day); + IncAMonth(Year, Month, Day, NumberOfMonths); + Result := EncodeDate(Year, Month, Day); + ReplaceTime(Result, DateTime); +end; + +function IncYear(const AValue: TDateTime; + const ANumberOfYears: Integer): TDateTime; +begin + Result := IncMonth(AValue, ANumberOfYears * MonthsPerYear); +end; + +function IncWeek(const AValue: TDateTime; + const ANumberOfWeeks: Integer): TDateTime; +begin + Result := AValue + ANumberOfWeeks * DaysPerWeek; +end; + +function IncDay(const AValue: TDateTime; + const ANumberOfDays: Integer): TDateTime; +begin + Result := AValue + ANumberOfDays; +end; + +function IncHour(const AValue: TDateTime; const ANumberOfHours: Int64): TDateTime; +begin + Result := ((AValue * HoursPerDay) + ANumberOfHours) / HoursPerDay; +end; + +function IncMinute(const AValue: TDateTime; const ANumberOfMinutes: Int64): TDateTime; +begin + Result := ((AValue * MinsPerDay) + ANumberOfMinutes) / MinsPerDay; +end; + +procedure DecodeDateMonthWeek(const AValue: TDateTime; + out AYear, AMonth, AWeekOfMonth, ADayOfWeek: Word); +var + LDay, LDaysInMonth: Word; + LDayOfMonth: Integer; + LStart: TDateTime; + LStartDayOfWeek, LEndOfMonthDayOfWeek: Word; +begin + DecodeDateFully(AValue, AYear, AMonth, LDay, ADayOfWeek); + ADayOfWeek := DayMap[ADayOfWeek]; + LStart := EncodeDate(AYear, AMonth, 1); + LStartDayOfWeek := DayOfTheWeek(LStart); + LDayOfMonth := LDay; + if LStartDayOfWeek in [DayFriday, DaySaturday, DaySunday] then + Dec(LDayOfMonth, 8 - LStartDayOfWeek) + else + Inc(LDayOfMonth, LStartDayOfWeek - 1); + if LDayOfMonth <= 0 then + DecodeDateMonthWeek(LStart - 1, AYear, AMonth, AWeekOfMonth, LDay) + else + begin + AWeekOfMonth := LDayOfMonth div 7; + if LDayOfMonth mod 7 <> 0 then + Inc(AWeekOfMonth); + LDaysInMonth := DaysInAMonth(AYear, AMonth); + LEndOfMonthDayOfWeek := DayOfTheWeek(EncodeDate(AYear, AMonth, LDaysInMonth)); + if (LEndOfMonthDayOfWeek in [DayMonday, DayTuesday, DayWednesday]) and + (LDaysInMonth - LDay < LEndOfMonthDayOfWeek) then + begin + Inc(AMonth); + if AMonth = 13 then + begin + AMonth := 1; + Inc(AYear); + end; + AWeekOfMonth := 1; + end; + end; +end; + +function WeekOfTheMonth(const AValue: TDateTime): Word; +var + LYear, LMonth, LDayOfWeek: Word; +begin + DecodeDateMonthWeek(AValue, LYear, LMonth, Result, LDayOfWeek); +end; + +function WeekOf(AValue: TDateTime): Word; +var + AYear, ADay: Word; +begin + DecodeDateWeek(AValue, AYear, Result, ADay); +end; + +function WeekOfTheYear(const AValue: TDateTime): Word; +var + AYear, ADayOfWeek: Word; +begin + DecodeDateWeek(AValue, AYear, Result, ADayOfWeek); +end; + +function DayOfTheYear(AValue: TDateTime): Word; +begin + Result := Trunc(AValue - StartOfTheYear(AValue)) + 1; +end; + +function EndOfTheYear(AValue: TDateTime): TDateTime; +begin + Result := EncodeDateTime(YearOf(AValue), 12, 31, 23, 59, 59, 999) +end; +{$ENDIF} + +function StrToDateDef(const ADateStr: string; ADefDate: TDateTime): TDateTime; +begin + try + Result := StrToDate(ADateStr) + except + Result := ADefDate + end; +end; + +function SICompare(List: TStringList; Index1, Index2: Integer): Integer; +var + S1, S2: string; +begin + S1 := List[Index1]; + S2 := List[Index2]; + if Length(S1) > Length(S2) then + Result := -1 + else + if Length(S1) < Length(S2) then + Result := 1 + else + Result := -AnsiCompareText(S1, S2); +end; + +function SmartTextToDate(const AText: string; var ADate: TDateTime): Boolean; + + function GetSmartInputKind(const AText: string; + var Kind: TcxDateEditSmartInput): Boolean; + var + I: TcxDateEditSmartInput; + J: Integer; + S: string; + begin + Result := False; + with TStringList.Create do + try + for I := Low(TcxDateEditSmartInput) to High(TcxDateEditSmartInput) do + AddObject(scxDateEditSmartInput[I], TObject(I)); + CustomSort(SICompare); + for J := 0 to Count - 1 do + begin + S := Strings[J]; + if AnsiCompareText(S, Copy(AText, 1, Length(S))) = 0 then + begin + Kind := TcxDateEditSmartInput(Objects[J]); + Result := True; + Break; + end; + end; + finally + Free; + end; + end; + +var + I: TcxDateEditSmartInput; + L, Delta: Integer; + S: string; + Y, M, D: Word; + +begin + InitSmartInputConsts; + Result := False; + S := Trim(AText); + if GetSmartInputKind(S, I) then + begin + case I of + deiToday: + ADate := Date; + deiYesterday: + ADate := Date - 1; + deiTomorrow: + ADate := Date + 1; + deiSunday, deiMonday, deiTuesday, deiWednesday, deiThursday, deiFriday, deiSaturday: + begin + ADate := Date; + Delta := Integer(I) - Integer(deiSunday) + 1 - DayOfWeek(ADate); + if Delta >= 0 then + ADate := ADate + Delta + else + ADate := ADate + 7 + Delta; + end; + deiFirst..deiSeventh: + begin + ADate := Date; + Delta := DayOfWeekOffset(ADate) - (Integer(I) - Integer(deiFirst)); + ADate := ADate - Delta; + end; + deiBOM: + begin + DecodeDate(Date, Y, M, D); + ADate := EncodeDate(Y, M, 1); + end; + deiEOM: + begin + DecodeDate(Date, Y, M, D); + ADate := EncodeDate(Y, M, MonthDays[IsLeapYear(Y), M]); + end; + deiNow: + ADate := Now; + end; + L := Length(scxDateEditSmartInput[I]); + S := Trim(Copy(AText, L + 1, Length(AText))); + if (Length(S) >= 2) and ((S[1] = '+') or (S[1] = '-')) then + begin + if S[1] = '+' then L := 1 + else L := -1; + S := Trim(Copy(S, 2, Length(S))); + try + ADate := ADate + L * StrToInt(S); + except + on EConvertError do; + end; + end; + Result := True; + end; + if not Result and Assigned(SmartTextToDateFunc) then + Result := SmartTextToDateFunc(AText, ADate); +end; + +function TextToDateEx(AText: string; var ADate: TDateTime): Boolean; +var + ADay, AMonth, AYear: Word; +begin + try + AText := Trim(AText); + if AText = '' then + Result := False + else + begin + if cxIsGregorianCalendar then + begin + // Smart Date + if not SmartTextToDate(AText, ADate) then + begin + CorrectTextForDateTimeConversion(AText, + not cxFormatController.UseDelphiDateTimeFormats); + if cxFormatController.UseDelphiDateTimeFormats then + ADate := StrToDateTime(AText) + else + ADate := VarToDateTime(AText); + end; + Result := (ADate < MaxInt) and (ADate > -MaxInt - 1); + if Result then + begin + DecodeDate(ADate, AYear, AMonth, ADay); + Result := (ADay > 0) and (AYear <= MaxYear); + end + end + else + begin + ADate := cxLocalFormatStrToDate(AText); + Result := True; + end; + end; + except + Result := False; + ADate := NullDate; + end; +end; + +function cxDateTimeToText(ADate: TDateTime; AFourDigitYearNeeded: Boolean = False; AUseDelphiDateTimeFormats: Boolean = False): string; + + function GetDateTimeFormat: string; + var + I: Integer; + S: string; + begin + if AUseDelphiDateTimeFormats then + begin + Result := ShortDateFormat; + if TimeOf(ADate) <> 0 then + Result := Result + ' ' + LongTimeFormat; + end + else + Result := cxGetLocaleStr(LOCALE_SSHORTDATE); + if AFourDigitYearNeeded then + begin + S := LowerCase(Result); + if (Pos('yyy', S) = 0) and (Pos('yy', S) > 0) then + begin + I := Pos('yy', S); + Insert(Result[I], Result, I + 2); + Insert(Result[I], Result, I + 3); + end; + end; + end; + +var + SystemTime: TSystemTime; + PS: PChar; +begin + if ADate = NullDate then + Result := '' + else + if AUseDelphiDateTimeFormats then + DateTimeToString(Result, GetDateTimeFormat, ADate) + else + begin + DateTimeToSystemTime(ADate, SystemTime); + GetMem(PS, 100); + try + if GetDateFormat(GetThreadLocale, 0, @SystemTime, + PAnsiChar(GetDateTimeFormat), PS, 100) <> 0 then + begin + Result := PS; + if TimeOf(ADate) <> 0 then + begin + GetTimeFormat(GetThreadLocale, 0, @SystemTime, nil, PS, 100); + Result := Result + ' ' + PS; + end; + end + else + try + Result := VarFromDateTime(ADate); + except + on EVariantError do + Result := ''; + end; + finally + FreeMem(PS, 100); + end; + end; +end; + +function DateTimeToText(ADate: TDateTime; AFourDigitYearNeeded: Boolean = False): string; +begin + Result := cxDateTimeToText(ADate, AFourDigitYearNeeded, cxFormatController.UseDelphiDateTimeFormats); +end; + +function DateTimeToTextEx(const ADate: TDateTime; AIsMasked: Boolean; + AIsDateTimeEdit: Boolean = False; AFourDigitYearNeeded: Boolean = False): string; +begin + if ADate = NullDate then + Result := '' + else + begin + if cxIsGregorianCalendar then + begin + if AIsMasked then + begin + if AIsDateTimeEdit then + Result := FormatDateTime(cxFormatController.MaskedDateTimeEditFormat, ADate) + else + Result := FormatDateTime(cxFormatController.MaskedDateEditFormat, DateOf(ADate)); + end + else + Result := DateTimeToText(ADate, AFourDigitYearNeeded); + end + else + Result := cxDateToLocalFormatStr(ADate); + end; +end; + +function cxMinDateTime: Double; +begin + Result := EncodeDate(MinYear, 1, 1); +end; + +function cxStrToDateTime(S: string; AUseOleDateFormat: Boolean; + out ADate: TDateTime): Boolean; +begin + Result := False; + ADate := NullDate; + try + if cxIsGregorianCalendar then + begin + CorrectTextForDateTimeConversion(S, AUseOleDateFormat); + if AUseOleDateFormat then + ADate := VarToDateTime(S) + else + ADate := StrToDateTime(S); + end + else + ADate := cxLocalFormatStrToDate(S); + Result := True; + except + on Exception(*EConvertError*) do + ADate := NullDate; + end; +end; + +{ TcxEra } + +procedure TcxEra.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxEra then + with Source as TcxEra do + begin + Self.Era := Era; + Self.FMaxEraYear := MaxEraYear; + Self.FMinEraYear := MinEraYear; + Self.FStartDate := StartDate; + Self.FYearOffset := YearOffset; + end; +end; + +{ TcxEras } + +function TcxEras.GetItem(AIndex: Integer): TcxEra; +begin + Result := TcxEra(inherited Items[AIndex]); +end; + +procedure TcxEras.SetItem(AIndex: Integer; AValue: TcxEra); +begin + TcxEra(inherited Items[AIndex]).Assign(AValue); +end; + +{ TcxCustomCalendarTable } + +constructor TcxCustomCalendarTable.Create; +begin + FEras := TcxEras.Create; +end; + +destructor TcxCustomCalendarTable.Destroy; +begin + FEras.Clear; + FreeAndNil(FEras); + inherited Destroy; +end; + +procedure TcxCustomCalendarTable.AdjustYear(var AYear, AEra: Integer); +begin + AdjustYear(AYear, AEra, 1, 1); +end; + +procedure TcxCustomCalendarTable.AdjustYear(var AYear, AEra: Integer; AMonth, ADay: Integer); +var + ACurrentYear: Cardinal; +begin + ACurrentYear := AYear; + YearToGregorianYear(ACurrentYear, AEra); + AEra := GetEra(ACurrentYear, AMonth, ADay); + if AEra > 0 then + AYear := Integer(ACurrentYear) - Eras[AEra].YearOffset; +end; + +procedure TcxCustomCalendarTable.CheckDateTime(var ADateTime: TDateTime); +begin + if ADateTime < MinSupportedDate then + ADateTime := MinSupportedDate; + if ADateTime > MaxSupportedDate then + ADateTime := MaxSupportedDate; +end; + +function TcxCustomCalendarTable.IsNotValid(ADate: TcxDateTime; out AResult: TDateTime): Boolean; +begin + with ADate do + Result := not IsValidDay(Era, Year, Month, Day); + if Result then + AResult := MinSupportedDate; +end; + +procedure TcxCustomCalendarTable.YearToGregorianYear(var AYear: Cardinal; + AEra: Integer); +begin + if AEra = -1 then + AYear := Integer(AYear) + DefaultEra.YearOffset + else + if (AEra >= 0) and (AEra < Eras.Count) then + AYear := Integer(AYear) + Eras[AEra].YearOffset; +end; + +function TcxCustomCalendarTable.AddDays(ADate: TcxDateTime; + ACountDays: Integer): TDateTime; +begin + Result := ToDateTime(ADate) + ACountDays; + CheckDateTime(Result); +end; + +function TcxCustomCalendarTable.AddMonths(ADate: TDateTime; + ACountMonths: Integer): TDateTime; +begin + Result := AddMonths(FromDateTime(ADate), ACountMonths); +end; + +function TcxCustomCalendarTable.AddMonths(ADate: TcxDateTime; + ACountMonths: Integer): TDateTime; +var + ASwap: Integer; + ACurrentMonth: Integer; + ACurrentYear: Integer; + ACurrentEra: Integer; +begin + if IsNotValid(ADate, Result) then + Exit; + ACurrentEra := ADate.Era; + ACurrentMonth := ADate.Month; + ACurrentYear := ADate.Year; + Inc(ACurrentMonth, ACountMonths); + if ACurrentMonth > Integer(GetMonthsInYear(ACurrentEra, ACurrentYear)) then + ASwap := -1 + else + ASwap := 1; + while (ACurrentMonth > Integer(GetMonthsInYear(ACurrentEra, ACurrentYear))) or (ACurrentMonth <= 0) do + begin + if ASwap > 0 then + Inc(ACurrentMonth, ASwap * Integer(GetMonthsInYear(ACurrentEra, ACurrentYear - 1))) + else + Inc(ACurrentMonth, ASwap * Integer(GetMonthsInYear(ACurrentEra, ACurrentYear))); + Inc(ACurrentYear, -ASwap); + end; + if not IsValidDay(ACurrentEra, ACurrentYear, ACurrentMonth, ADate.Day) then + ADate.Day := GetDaysInMonth(ACurrentEra, ACurrentYear, ACurrentMonth); + AdjustYear(ACurrentYear, ACurrentEra, ACurrentMonth, ADate.Day); + ADate.Era := ACurrentEra; + ADate.Year := ACurrentYear; + ADate.Month := ACurrentMonth; + if IsNotValid(ADate, Result) then + Exit; + Result := ToDateTime(ADate); + CheckDateTime(Result); +end; + +function TcxCustomCalendarTable.AddWeeks(ADate: TDateTime; + ACountWeeks: Integer): TDateTime; +begin + Result := AddWeeks(FromDateTime(ADate), ACountWeeks); +end; + +function TcxCustomCalendarTable.AddWeeks(ADate: TcxDateTime; + ACountWeeks: Integer): TDateTime; +begin + Result := AddDays(ADate, ACountWeeks * 7); + CheckDateTime(Result); +end; + +function TcxCustomCalendarTable.AddYears(ADate: TDateTime; + ACountYears: Integer): TDateTime; +begin + Result := AddYears(FromDateTime(ADate), ACountYears); +end; + +function TcxCustomCalendarTable.AddYears(ADate: TcxDateTime; + ACountYears: Integer): TDateTime; +var + ACurrentYaer: Integer; + ACurrentEra: Integer; +begin + if IsNotValid(ADate, Result) then + Exit; + ACurrentYaer := Integer(ADate.Year) + ACountYears; + ACurrentEra := ADate.Era; + AdjustYear(ACurrentYaer, ACurrentEra); + if not IsValidYear(ACurrentEra, ACurrentYaer) then + begin + Result := MinSupportedDate; + Exit; + end; + if not IsValidMonth(ACurrentEra, ACurrentYaer, ADate.Month) then + ADate.Month := GetMonthsInYear(ACurrentEra, ACurrentYaer); + if not IsValidDay(ACurrentEra, ACurrentYaer, ADate.Month, ADate.Day) then + ADate.Day := GetDaysInMonth(ACurrentEra, ACurrentYaer, ADate.Month); + AdjustYear(ACurrentYaer, ACurrentEra, ADate.Month, ADate.Day); + ADate.Year := ACurrentYaer; + ADate.Era := ACurrentEra; + Result := ToDateTime(ADate); + CheckDateTime(Result); +end; + +function TcxCustomCalendarTable.FromDateTime(AYear, AMonth, + ADay: Cardinal): TcxDateTime; +begin + Result := FromDateTime(AYear, AMonth, ADay, 0, 0, 0, 0); +end; + +function TcxCustomCalendarTable.FromDateTime(AYear, AMonth, + ADay: Cardinal; AHours, AMinutes, ASeconds: Byte; + AMilliseconds: Word): TcxDateTime; +begin + Result := FromDateTime(EncodeDateTime(AYear, AMonth, ADay, AHours, AMinutes, ASeconds, AMilliseconds)); +end; + +function TcxCustomCalendarTable.GetDayOfYear(ADate: TDateTime): Cardinal; +begin + Result := GetDayOfYear(FromDateTime(ADate)); +end; + +function TcxCustomCalendarTable.GetDayOfYear(ADate: TcxDateTime): Cardinal; +var + I: Integer; +begin + Result := 0; + for I := 1 to ADate.Month - 1 do + Result := Result + GetDaysInMonth(ADate.Year, I); + Inc(Result, ADate.Day); +end; + +function TcxCustomCalendarTable.GetDaysInMonth(AYear, AMonth: Cardinal): Cardinal; +begin + Result := GetDaysInMonth(-1, AYear, AMonth); +end; + +function TcxCustomCalendarTable.GetDaysInYear(AYear: Cardinal): Cardinal; +begin + Result := GetDaysInYear(-1, AYear); +end; + +function TcxCustomCalendarTable.GetEra(AYear: Integer): Integer; +begin + Result := GetEra(AYear, 1, 1); +end; + +function TcxCustomCalendarTable.GetEra(AYear, AMonth, ADay: Integer): Integer; +var + I: Integer; + ADate: TDateTime; +begin + Result := -1; + if Eras.Count = 0 then + Exit; + ADate := EncodeDate(AYear, AMonth, ADay); + for I := 0 to Eras.Count - 1 do + with Eras[I] do + if (ADate >= StartDate) then + Result := I; +end; + +function TcxCustomCalendarTable.GetFirstDayOfWeek(ADate: TDateTime): TDateTime; +begin + Result := ToDateTime(GetFirstDayOfWeek(FromDateTime(ADate))); +end; + +function TcxCustomCalendarTable.GetFirstDayOfWeek(ADate: TDateTime; AStartDayOfWeek: TDay): TDateTime; +var + ADays: Integer; +begin + ADays := Byte(AStartDayOfWeek) - GetWeekDay(ADate); + if ADays > 0 then + Dec(ADays, 7); + Result := ADate + ADays; +end; + +function TcxCustomCalendarTable.GetFirstDayOfWeek( + ADate: TcxDateTime): TcxDateTime; +var + I: Integer; +begin + I := GetFirstWeekDay - GetWeekDay(ADate); + if I > 0 then + Dec(I, 7); + Result := FromDateTime(AddDays(ADate, I)); +end; + +function TcxCustomCalendarTable.GetFirstDayOfWeek(ADate: TcxDateTime; AStartDayOfWeek: TDay): TcxDateTime; +begin + Result := FromDateTime(GetFirstDayOfWeek(ToDateTime(ADate), AStartDayOfWeek)); +end; + +function TcxCustomCalendarTable.GetMonthsInYear(AYear: Cardinal): Cardinal; +begin + Result := GetMonthsInYear(-1, AYear); +end; + +function TcxCustomCalendarTable.GetYear(ADate: TDateTime): Cardinal; +begin + Result := FromDateTime(ADate).Year; +end; + +function TcxCustomCalendarTable.GetYear(ADate: TcxDate): Cardinal; +begin + Result := ADate.Year; +end; + +function TcxCustomCalendarTable.GetYear(ADate: TcxDateTime): Cardinal; +begin + Result := ADate.Year; +end; + +function TcxCustomCalendarTable.GetWeekDay(ADate: TDateTime): Byte; +begin + Result := DayOfWeek(ADate) - 1; +end; + +function TcxCustomCalendarTable.GetWeekDay(ADate: TcxDateTime): Byte; +begin + Result := GetWeekDay(ToDateTime(ADate)); +end; + +function TcxCustomCalendarTable.GetWeekNumber(ADate: TDateTime; AStartOfWeek: TDay; + AFirstWeekOfYear: TcxFirstWeekOfYear): Cardinal; +begin + Result := GetWeekNumber(FromDateTime(ADate), AStartOfWeek, AFirstWeekOfYear); +end; + +function TcxCustomCalendarTable.IsLeapDay(AYear, AMonth, ADay: Cardinal): Boolean; +begin + Result := IsLeapDay(-1, AYear, AMonth, ADay); +end; + +function TcxCustomCalendarTable.IsLeapMonth(AYear, AMonth: Cardinal): Boolean; +begin + Result := IsLeapMonth(-1, AYear, AMonth); +end; + +function TcxCustomCalendarTable.IsLeapYear(AYear: Cardinal): Boolean; +begin + Result := IsLeapYear(-1, AYear); +end; + +function TcxCustomCalendarTable.IsValidDay(AYear, AMonth, + ADay: Cardinal): Boolean; +begin + Result := IsValidDay(-1, AYear, AMonth, ADay); +end; + +function TcxCustomCalendarTable.IsValidDay(AEra: Integer;AYear, AMonth, + ADay: Cardinal): Boolean; +begin + Result := IsValidMonth(AEra, AYear, AMonth) and + (ADay > 0) and (ADay <= GetDaysInMonth(AEra, AYear, AMonth)); +end; + +function TcxCustomCalendarTable.IsValidDate(ADate: TDateTime): Boolean; +var + AConvertDate: TcxDateTime; +begin + AConvertDate := FromDateTime(ADate); + with AConvertDate do + Result := IsValidDay(Year, Month, Day); +end; + +function TcxCustomCalendarTable.IsValidMonth(AYear, + AMonth: Cardinal): Boolean; +begin + Result := IsValidMonth(-1, AYear, AMonth); +end; + +function TcxCustomCalendarTable.IsValidMonth(AEra: Integer; AYear, + AMonth: Cardinal): Boolean; +begin + Result := IsValidYear(AEra, AYear) and + (AMonth > 0) and (AMonth <= GetMonthsInYear(AEra, AYear)); +end; + +function TcxCustomCalendarTable.IsValidYear(AYear: Cardinal): Boolean; +begin + Result := IsValidYear(-1, AYear); +end; + +function TcxCustomCalendarTable.IsValidYear(AEra: Integer; AYear: Cardinal): Boolean; +begin + Result := (Integer(AYear) >= GetMinSupportedYear) and + (Integer(AYear) <= GetMaxSupportedYear); +end; + +function TcxCustomCalendarTable.ToDateTime(ADate: TcxDate): TDateTime; +var + ADateTime: TcxDateTime; +begin + with ADateTime do + begin + Year := ADate.Year; + Month := ADate.Month; + Day := ADate.Day; + Hours := 0; + Minutes := 0; + Seconds := 0; + Milliseconds := 0; + end; + Result := ToDateTime(ADateTime); +end; + +function TcxCustomCalendarTable.ToDateTime(AYear, AMonth, + ADay: Cardinal): TDateTime; +begin + Result := ToDateTime(AYear, AMonth, ADay, 0, 0, 0, 0); +end; + +function TcxCustomCalendarTable.ToDateTime(AYear, AMonth, ADay: Cardinal; + AHours, AMinutes, ASeconds: Byte; AMilliseconds: Word): TDateTime; +var + ADateTime: TcxDateTime; +begin + with ADateTime do + begin + Era := -1; + Year := AYear; + Month := AMonth; + Day := ADay; + Hours := AHours; + Minutes := AMinutes; + Seconds := ASeconds; + Milliseconds := AMilliseconds; + end; + Result := ToDateTime(ADateTime); +end; + +function TcxCustomCalendarTable.GetDayNumber(const S: string): Integer; +begin + Result := StrToInt(S); +end; + +function TcxCustomCalendarTable.GetMonthNumber(AYear: Integer; const S: string): Integer; +var + I: Integer; +begin + for I := 1 to 12 do + begin + if (AnsiCompareText(S, LongMonthNames[I]) = 0) or + (AnsiCompareText(S, ShortMonthNames[I]) = 0) then + begin + Result := I; + Exit; + end; + end; + Result := StrToInt(S); +end; + +function TcxCustomCalendarTable.GetYearNumber(const S: string): Integer; +var + ATwoDigitYearMax: Integer; + ARightDigitYear: Integer; + AAge: Integer; +begin + Result := StrToInt(S); + if Length(S) <= 2 then + begin + cxGetCalendarInfo(LOCALE_USER_DEFAULT, GetCalendarID, CAL_ITWODIGITYEARMAX or + CAL_RETURN_NUMBER, nil, 0, @ATwoDigitYearMax); + AAge := ATwoDigitYearMax div 100; + ARightDigitYear := ATwoDigitYearMax - AAge * 100; + if Result <= ARightDigitYear then + Result := Result + AAge * 100 + else + Result := Result + (AAge - 1) * 100 + end; +end; + +{ TcxGregorianCalendarTable } + +constructor TcxGregorianCalendarTable.Create; +begin + inherited Create; + FDefaultEra := cxInitEra(-1, NullDate, 0, 1, 9999); + FGregorianCalendarType := gctLocalized; +end; + +destructor TcxGregorianCalendarTable.Destroy; +begin + FreeAndNil(FDefaultEra); + inherited Destroy; +end; + +function TcxGregorianCalendarTable.GetCalendarAlgorithmType: TcxCalendarAlgorithmType; +begin + Result := catSolarCalendar; +end; + +function TcxGregorianCalendarTable.GetCalendarID: TcxCALID; +begin + Result := TcxCALID(FGregorianCalendarType); +end; + +function TcxGregorianCalendarTable.GetDefaultEra: TcxEra; +begin + Result := FDefaultEra; +end; + +function TcxGregorianCalendarTable.GetMaxSupportedDate: TDateTime; +begin + Result := MaxDateTime; +end; + +function TcxGregorianCalendarTable.GetMinSupportedDate: TDateTime; +begin + Result := MinDateTime; +end; + +function TcxGregorianCalendarTable.GetMaxSupportedYear: Integer; +begin + Result := 9999; +end; + +function TcxGregorianCalendarTable.GetMinSupportedYear: Integer; +begin + Result := 1 +end; + +function TcxGregorianCalendarTable.FromDateTime(ADate: TDateTime): TcxDateTime; +var + Y, M, D: Word; + H, MN, S, MS: Word; +begin + DecodeDateTime(ADate, Y, M, D, H, MN, S, MS); + with Result do + begin + Year := Y; + Month := M; + Day := D; + Hours := H; + Minutes := MN; + Seconds := S; + Milliseconds := MS; + end; +end; + +function TcxGregorianCalendarTable.GetFirstWeekDay: Byte; +var + ADay: TDay; +begin + case FGregorianCalendarType of + gctArabic: + ADay := dSaturday; + gctMiddleEastFrench, gctTransliteratedEnglish, + gctTransliteratedFrench: + ADay := dMonday; + else + ADay := dSunday; + end; + Result := Byte(ADay); +end; + +function TcxGregorianCalendarTable.GetWeekNumber(ADate: TcxDateTime; AStartOfWeek: TDay; + AFirstWeekOfYear: TcxFirstWeekOfYear): Cardinal; +begin + Result := cxDateUtils.GetWeekNumber(ToDateTime(ADate), AStartOfWeek, AFirstWeekOfYear); +end; + +function TcxGregorianCalendarTable.GetDaysInMonth(AEra: Integer; AYear, + AMonth: Cardinal): Cardinal; +begin + case AMonth of + 2: + begin + if IsLeapYear(AEra, AYear) then + Result := 29 + else + Result := 28; + end; + 4, 6, 9, 11: + Result := 30; + else + Result := 31; + end; +end; + +function TcxGregorianCalendarTable.GetDaysInYear(AEra: Integer; AYear: Cardinal): Cardinal; +begin + if IsLeapYear(AEra, AYear) then + Result := 366 + else + Result := 365; +end; + +function TcxGregorianCalendarTable.GetFullWeeksInYear(AYear: Cardinal): Cardinal; +var + ADate: TcxDateTime; + ADay: Integer; +begin + Result := 52; + ADate.Year := AYear; + ADate.Month := 1; + ADate.Day := 1; + ADate.Hours := 0; + ADate.Minutes := 0; + ADate.Seconds := 0; + ADate.Milliseconds := 0; + ADay := GetWeekDay(ADate) - GetFirstWeekDay; + if ADay < 0 then + Inc(ADay, 7); + if (IsLeapYear(AYear) and (ADay >= 5)) or (ADay >= 6) then + Result := 53; +end; + +function TcxGregorianCalendarTable.GetMonthsInYear(AEra: Integer; AYear: Cardinal): Cardinal; +begin + Result := 12; +end; + +function TcxGregorianCalendarTable.IsLeapDay(AEra: Integer; AYear, AMonth, + ADay: Cardinal): Boolean; +begin + Result := IsLeapMonth(AEra, AYear, ADay) and (ADay = 29); +end; + +function TcxGregorianCalendarTable.IsLeapMonth(AEra: Integer; AYear, AMonth: Cardinal): Boolean; +begin + Result := IsLeapYear(AEra, AYear) and (AMonth = 2); +end; + +function TcxGregorianCalendarTable.IsLeapYear(AEra: Integer; AYear: Cardinal): Boolean; +begin + YearToGregorianYear(AYear, AEra); + Result := (AYear mod 4 = 0) and ((AYear mod 100 <> 0) or (AYear mod 400 = 0)); +end; + +function TcxGregorianCalendarTable.ToDateTime(ADateTime: TcxDateTime): TDateTime; +begin + with ADateTime do + Result := EncodeDateTime(Year, Month, Day, Hours, Minutes, Seconds, Milliseconds); +end; + +{ TcxJapaneseCalendarTable } + +constructor TcxJapaneseCalendarTable.Create; +begin + FEras := TcxEras.Create; + FEras.Add(cxInitEra(1, EncodeDate(1868, 9, 8), 1867, 1, 1912 - 1867)); // Meiji + FEras.Add(cxInitEra(2, EncodeDate(1912, 7, 30), 1911, 1, 1926 - 1911)); // Taisho + FEras.Add(cxInitEra(3, EncodeDate(1926, 12, 25), 1925, 1, 1989 - 1925)); // Showa + FEras.Add(cxInitEra(4, EncodeDate(1989, 1, 8), 1988, 1, 9999 - 1988)); // Heisei. Most recent +end; + +function TcxJapaneseCalendarTable.GetCalendarAlgorithmType: TcxCalendarAlgorithmType; +begin + Result := catSolarCalendar; +end; + +function TcxJapaneseCalendarTable.GetCalendarID: TcxCALID; +begin + Result := CAL_JAPAN; +end; + +function TcxJapaneseCalendarTable.GetDefaultEra: TcxEra; +begin + Result := Eras[3]; +end; + +function TcxJapaneseCalendarTable.GetMaxSupportedDate: TDateTime; +begin + Result := EncodeDate(9999, 12, 31); +end; + +function TcxJapaneseCalendarTable.GetMinSupportedDate: TDateTime; +begin + Result := EncodeDate(1868, 09, 08); +end; + +function TcxJapaneseCalendarTable.GetMaxSupportedYear: Integer; +begin + Result := 8011; // Heisei 8011/12/31 +end; + +function TcxJapaneseCalendarTable.GetMinSupportedYear: Integer; +begin + Result := 1; +end; + +function TcxJapaneseCalendarTable.FromDateTime(ADate: TDateTime): TcxDateTime; +var + Y, M, D, H, Mn, S, MS: Word; +begin + DecodeDate(ADate, Y, M, D); + DecodeTime(ADate, H, Mn, S, MS); + with Result do + begin + Era := GetEra(Y, M, D); + if Era = -1 then + Year := Y - DefaultEra.YearOffset + else + Year := Y - Eras[Era].YearOffset; + Month := M; + Day := D; + Hours := H; + Minutes := Mn; + Seconds := S; + Milliseconds := MS; + end; +end; + +function TcxJapaneseCalendarTable.GetFirstWeekDay: Byte; +begin + Result := 0; +end; + +function TcxJapaneseCalendarTable.ToDateTime(ADateTime: TcxDateTime): TDateTime; +var + AYear: Cardinal; +begin + with ADateTime do + begin + if IsNotValid(ADateTime, Result) then + Exit; + AYear := Year; + YearToGregorianYear(AYear, Era); + Result := EncodeDate(AYear, Month, Day) + + EncodeTime(Hours, Minutes, Seconds, Milliseconds); + end; +end; + +{ TcxTaiwanCalendarTable } + +constructor TcxTaiwanCalendarTable.Create; +begin + FEras := TcxEras.Create; + FEras.Add(cxInitEra(1, EncodeDate(1912, 1, 1), 1911, 1, 9999 - 1911)); // +end; + +function TcxTaiwanCalendarTable.GetCalendarAlgorithmType: TcxCalendarAlgorithmType; +begin + Result := catSolarCalendar; +end; + +function TcxTaiwanCalendarTable.GetCalendarID: TcxCALID; +begin + Result := CAL_TAIWAN; +end; + +function TcxTaiwanCalendarTable.GetDefaultEra: TcxEra; +begin + Result := FEras[0]; +end; + +function TcxTaiwanCalendarTable.GetMinSupportedDate: TDateTime; +begin + Result := DefaultEra.StartDate; +end; + +function TcxTaiwanCalendarTable.GetMaxSupportedYear: Integer; +begin + Result := DefaultEra.MaxEraYear; +end; + +function TcxTaiwanCalendarTable.GetMinSupportedYear: Integer; +begin + Result := DefaultEra.MinEraYear; +end; + +{ TcxKoreanCalendarTable } + +constructor TcxKoreanCalendarTable.Create; +begin + FEras := TcxEras.Create; + FEras.Add(cxInitEra(0, EncodeDate(1, 1, 1), -2333, 2334, 9999 + 2333)); +end; + +function TcxKoreanCalendarTable.GetCalendarAlgorithmType: TcxCalendarAlgorithmType; +begin + Result := catSolarCalendar; +end; + +function TcxKoreanCalendarTable.GetCalendarID: TcxCALID; +begin + Result := CAL_KOREA; +end; + +function TcxKoreanCalendarTable.GetDefaultEra: TcxEra; +begin + Result := Eras[0]; +end; + +function TcxKoreanCalendarTable.GetMinSupportedDate: TDateTime; +begin + Result := DefaultEra.StartDate; +end; + +function TcxKoreanCalendarTable.GetMaxSupportedYear: Integer; +begin + Result := DefaultEra.MaxEraYear; +end; + +function TcxKoreanCalendarTable.GetMinSupportedYear: Integer; +begin + Result := DefaultEra.MinEraYear; +end; + +{ TcxHijriCalendarTable } + +constructor TcxHijriCalendarTable.Create; +begin + inherited Create; + FDefaultEra := cxInitEra(-1, NullDate, 0, 1, 9999); +end; + +destructor TcxHijriCalendarTable.Destroy; +begin + FreeAndNil(FDefaultEra); + inherited Destroy; +end; + +function TcxHijriCalendarTable.FromDateTime( + ADate: TDateTime): TcxDateTime; +var + I: Integer; + H, M, S, MS: Word; + ACountDays: Integer; + ACurrentYear: Integer; +begin + with Result do + begin + DecodeTime(ADate, H, M, S, MS); + Hours := H; + Minutes := M; + Seconds := S; + Milliseconds := MS; + ACountDays := Trunc(ADate - EncodeDate(1, 1, 1) + 1) - 227013; + Year := ((ACountDays * 30) div 10631) + 1; + ACurrentYear := Year; + ACountDays := ACountDays - (ACurrentYear - 1) * 354; + ACountDays := ACountDays - ((ACurrentYear - 1) div 30) * 11; + for I := 1 to (ACurrentYear - 1) mod 30 do + if IsLeapYear(I) then + ACountDays := ACountDays - 1; + Year := ACurrentYear; + Month := 1; + while ACountDays > Integer(GetDaysInMonth(Year, Month)) do + begin + ACountDays := ACountDays - Integer(GetDaysInMonth(Year, Month)); + Month := Month + 1; + if Month > GetMonthsInYear(Year) then + begin + Month := 1; + Year := Year + 1; + end; + end; + if ACountDays = 0 then + begin + Year := Year - 1; + Month := GetMonthsInYear(Year); + Day := GetDaysInMonth(Year, Month); + end + else + Day := ACountDays; + end; +end; + +function TcxHijriCalendarTable.GetCalendarAlgorithmType: TcxCalendarAlgorithmType; +begin + Result := catLunarCalendar; +end; + +function TcxHijriCalendarTable.GetCalendarID: TcxCALID; +begin + Result := CAL_HIJRI; +end; + +function TcxHijriCalendarTable.GetDefaultEra: TcxEra; +begin + Result := FDefaultEra; +end; + +function TcxHijriCalendarTable.GetFirstWeekDay: Byte; +begin + Result := 6; +end; + +function TcxHijriCalendarTable.GetDaysInMonth(AEra: Integer; AYear, + AMonth: Cardinal): Cardinal; +begin + if IsLeapMonth(AYear, AMonth) then + Result := 30 + else + if AMonth in [2, 4, 6, 8, 10, 12] then + Result := 29 + else + Result := 30; +end; + +function TcxHijriCalendarTable.GetDaysInYear(AEra: Integer; AYear: Cardinal): Cardinal; +begin + if IsLeapYear(AYear) then + Result := 355 + else + Result := 354; +end; + +function TcxHijriCalendarTable.GetFullWeeksInYear( + AYear: Cardinal): Cardinal; +begin + Result := 50; +end; + +function TcxHijriCalendarTable.GetMaxSupportedDate: TDateTime; +begin + Result := EncodeDate(9666, 4, 3); +end; + +function TcxHijriCalendarTable.GetMinSupportedDate: TDateTime; +begin + Result := EncodeDate(0622, 7, 16); +end; + +function TcxHijriCalendarTable.GetMaxSupportedYear: Integer; +begin + Result := 9666; +end; + +function TcxHijriCalendarTable.GetMinSupportedYear: Integer; +begin + Result := 1; +end; + +function TcxHijriCalendarTable.GetMonthsInYear(AEra: Integer; AYear: Cardinal): Cardinal; +begin + Result := 12; +end; + +function TcxHijriCalendarTable.GetWeekNumber(ADate: TcxDateTime; AStartOfWeek: TDay; + AFirstWeekOfYear: TcxFirstWeekOfYear): Cardinal; +var + AStartWeekDate: TDateTime; + AStart: TDateTime; + ATmpDate: TcxDateTime; +begin + if AFirstWeekOfYear = fwySystem then + AFirstWeekOfYear := TcxFirstWeekOfYear( + StrToInt(cxGetLocaleInfo(GetThreadLocale, LOCALE_IFIRSTWEEKOFYEAR, '0')) + 1); + with ATmpDate do + begin + Year := ADate.Year; + Month := 1; + Day := 1; + Hours := 0; + Minutes := 0; + Seconds := 0; + Milliseconds := 0; + end; + AStart := GetFirstDayOfWeek(ToDateTime(ATmpDate)); + case AFirstWeekOfYear of + fwyFirstFourDays: + if FromDateTime(AStart + 3).Year < ADate.Year then AStart := AStart + 7; + fwyFirstFullWeek: + if FromDateTime(AStart).Year < ADate.Year then AStart := AStart + 7; + end; + Result := Trunc(Trunc(ToDateTime(ADate)) - AStart) div 7 + 1; + if ADate.Month = GetMonthsInYear(ADate.Year) then + begin + AStartWeekDate := ToDateTime(GetFirstDayOfWeek(ADate)); + case AFirstWeekOfYear of + fwyJan1: + if FromDateTime(AStartWeekDate + 6).Month = 1 then + Result := 1; + fwyFirstFourDays: + if FromDateTime(AStartWeekDate + 3).Month = 1 then + Result := 1; + end; + end; +end; + +function TcxHijriCalendarTable.IsLeapDay(AEra: Integer; AYear, AMonth, + ADay: Cardinal): Boolean; +begin + Result := IsLeapMonth(AYear, AMonth) and (ADay = 30); +end; + +function TcxHijriCalendarTable.IsLeapMonth(AEra: Integer; AYear, + AMonth: Cardinal): Boolean; +begin + Result := IsLeapYear(AYear) and (AMonth = 12); +end; + +function TcxHijriCalendarTable.IsLeapYear(AEra: Integer; AYear: Cardinal): Boolean; +begin + Result := (AYear mod 30) in [2, 5, 7, 10, 13, 15, 18, 21, 24, 26, 29]; +end; + +function TcxHijriCalendarTable.ToDateTime( + ADateTime: TcxDateTime): TDateTime; +var + I: Integer; +begin + Result := 227013; + Result := Result + (ADateTime.Year - 1) * 354; + Result := Result + ((ADateTime.Year - 1) div 30) * 11; + for I := 1 to (ADateTime.Year - 1) mod 30 do + if IsLeapYear(I) then + Result := Result + 1; + Result := Result + GetDayOfYear(ADateTime); + Result := Result + EncodeDate(1, 1, 1) - 1; + Result := Result + EncodeTime(ADateTime.Hours, ADateTime.Minutes, ADateTime.Seconds, ADateTime.Milliseconds); +end; + +function TcxHijriCalendarTable.GetMonthNumber(AYear: Integer; const S: string): Integer; +var + I: Integer; +begin + for I := 1 to 12 do + begin + if AnsiCompareText(S, cxGetLocalMonthName(AYear, I, Self)) = 0 then + begin + Result := I; + Exit; + end; + end; + Result := inherited GetMonthNumber(AYear, S); +end; + +{ TcxThaiCalendarTable } + +constructor TcxThaiCalendarTable.Create; +begin + FEras := TcxEras.Create; + FEras.Add(cxInitEra(0, EncodeDate(1, 1, 1), -543, 544, 9999 + 543)); +end; + +function TcxThaiCalendarTable.GetCalendarAlgorithmType: TcxCalendarAlgorithmType; +begin + Result := catSolarCalendar; +end; + +function TcxThaiCalendarTable.GetCalendarID: TcxCALID; +begin + Result := CAL_THAI; +end; + +function TcxThaiCalendarTable.GetDefaultEra: TcxEra; +begin + Result := Eras[0]; +end; + +function TcxThaiCalendarTable.GetMinSupportedDate: TDateTime; +begin + Result := DefaultEra.StartDate; +end; + +function TcxThaiCalendarTable.GetMaxSupportedYear: Integer; +begin + Result := DefaultEra.MaxEraYear; +end; + +function TcxThaiCalendarTable.GetMinSupportedYear: Integer; +begin + Result := DefaultEra.MinEraYear; +end; + +{ TcxHebrewCalendarTable } + +constructor TcxHebrewCalendarTable.Create; +begin + inherited Create; + FDefaultEra := cxInitEra(-1, NullDate, 0, 1, 9999); +end; + +destructor TcxHebrewCalendarTable.Destroy; +begin + FreeAndNil(FDefaultEra); + inherited Destroy; +end; + +function TcxHebrewCalendarTable.FromDateTime(ADate: TDateTime): TcxDateTime; +var + AYear, AMonth, ADay: Word; + H, M, S, MS: Word; + ADays: Integer; +begin + if ADate > MaxSupportedDate then + begin + Result := FromDateTime(MaxSupportedDate); + Exit; + end; + if ADate < MinSupportedDate then + begin + Result := FromDateTime(MinSupportedDate); + Exit; + end; + DecodeDateTime(ADate, AYear, AMonth, ADay, H, M, S, MS); + AYear := AYear + 3760; + AMonth := 1; + ADays := Trunc(ADate - ToDateTime(AYear, AMonth, 1)) + 1; + with Result do + begin + Year := AYear; + Month := AMonth; + Day := 1; + Hours := H; + Minutes := M; + Seconds := S; + Milliseconds := MS; + end; + if ADays = 0 then + Exit; + while (ADays < 0) or (ADays > Integer(GetDaysInMonth(AYear, AMonth))) do + begin + if ADays < 0 then + begin + Dec(AMonth); + if AMonth <= 0 then + begin + Dec(AYear); + AMonth := GetMonthsInYear(AYear); + end; + end + else + begin + Inc(AMonth); + if AMonth > GetMonthsInYear(AYear) then + begin + AMonth := 1; + Inc(AYear); + end; + end; + ADays := Trunc(ADate - ToDateTime(AYear, AMonth, 1)) + 1; + end; + with Result do + begin + Year := AYear; + Month := AMonth; + Day := ADays; + end; +end; + +function TcxHebrewCalendarTable.GetCalendarAlgorithmType: TcxCalendarAlgorithmType; +begin + Result := catLunarSolarCalendar; +end; + +function TcxHebrewCalendarTable.GetCalendarID: TcxCALID; +begin + Result := CAL_HEBREW; +end; + +function TcxHebrewCalendarTable.GetDefaultEra: TcxEra; +begin + Result := FDefaultEra; +end; + +function TcxHebrewCalendarTable.GetDaysInMonth(AEra: Integer; AYear, + AMonth: Cardinal): Cardinal; +var + AYearIndex: Integer; +begin + if not IsValidMonth(AYear, AMonth) then + begin + Result := 0; + Exit; + end; + AYearIndex := Integer(GetYearType(AYear)); + if IsLeapYear(AYear) then + Inc(AYearIndex, 3); + Result := cxHebrewLunarMonthLen[AYearIndex, AMonth]; +end; + +function TcxHebrewCalendarTable.GetDaysInYear(AEra: Integer; AYear: Cardinal): Cardinal; +begin + if not IsValidYear(AYear) then + begin + Result := 0; + Exit; + end; + Result := 353; + case GetYearType(AYear) of + hctyNormal: + Result := 354; + hctyPerfect: + Result := 355; + end; + if IsLeapYear(AYear) then + Inc(Result, 30); +end; + +function TcxHebrewCalendarTable.GetFirstWeekDay: Byte; +begin + Result := 0; +end; + +function TcxHebrewCalendarTable.GetYearType( + AYear: Cardinal): TcxHebrewCalendarTableTypeYear; +var + AIndex: Integer; + ATypeYear: Integer; +begin + AIndex := AYear - cxHebrewFirstGregorianTableYear - cxHebrewYearOf1AD; + if (AIndex < 0) or (AIndex > cxHebrewTableYear) then + begin + Result := TcxHebrewCalendarTableTypeYear(0); + Exit; + end; + AIndex := AIndex * 2 + 1; + ATypeYear := cxHebrewTable[AIndex]; + if IsLeapYear(AYear) then + Dec(ATypeYear, 3); + Result := TcxHebrewCalendarTableTypeYear(ATypeYear); +end; + +function TcxHebrewCalendarTable.GetFullWeeksInYear(AYear: Cardinal): Cardinal; +begin + Result := GetDaysInYear(AYear) div 7; +end; + +function TcxHebrewCalendarTable.GetMaxSupportedDate: TDateTime; +begin + Result := EncodeDateTime(2239, 9, 29, 23, 59, 59, 999); +end; + +function TcxHebrewCalendarTable.GetMinSupportedDate: TDateTime; +begin + Result := EncodeDate(1583, 1, 1); +end; + +function TcxHebrewCalendarTable.GetMaxSupportedYear: Integer; +begin + Result := 5999; +end; + +function TcxHebrewCalendarTable.GetMinSupportedYear: Integer; +begin + Result := 5343; +end; + +function TcxHebrewCalendarTable.GetMonthsInYear(AEra: Integer; AYear: Cardinal): Cardinal; +begin + if IsLeapYear(AYear) then + Result := 13 + else + Result := 12; +end; + +function TcxHebrewCalendarTable.GetWeekNumber(ADate: TcxDateTime; + AStartOfWeek: TDay; AFirstWeekOfYear: TcxFirstWeekOfYear): Cardinal; +var + AStartWeekDate: TDateTime; + AStart: TDateTime; + ATmpDate: TcxDateTime; +begin + if AFirstWeekOfYear = fwySystem then + AFirstWeekOfYear := TcxFirstWeekOfYear( + StrToInt(cxGetLocaleInfo(GetThreadLocale, LOCALE_IFIRSTWEEKOFYEAR, '0')) + 1); + with ATmpDate do + begin + Year := ADate.Year; + Month := 1; + Day := 1; + Hours := 0; + Minutes := 0; + Seconds := 0; + Milliseconds := 0; + end; + AStart := GetFirstDayOfWeek(ToDateTime(ATmpDate)); + case AFirstWeekOfYear of + fwyFirstFourDays: + if FromDateTime(AStart + 3).Year < ADate.Year then AStart := AStart + 7; + fwyFirstFullWeek: + if FromDateTime(AStart).Year < ADate.Year then AStart := AStart + 7; + end; + Result := Trunc(Trunc(ToDateTime(ADate)) - AStart) div 7 + 1; + if ADate.Month = GetMonthsInYear(ADate.Year) then + begin + AStartWeekDate := ToDateTime(GetFirstDayOfWeek(ADate)); + case AFirstWeekOfYear of + fwyJan1: + if FromDateTime(AStartWeekDate + 6).Month = 1 then + Result := 1; + fwyFirstFourDays: + if FromDateTime(AStartWeekDate + 3).Month = 1 then + Result := 1; + end; + end; +end; + +function TcxHebrewCalendarTable.IsLeapDay(AEra: Integer; AYear, AMonth, + ADay: Cardinal): Boolean; +begin + Result := IsValidDay(AYear, AMonth, ADay) and IsLeapMonth(AYear, AMonth); +end; + +function TcxHebrewCalendarTable.IsLeapMonth(AEra: Integer; AYear, AMonth: Cardinal): Boolean; +begin + Result := IsValidMonth(AYear, AMonth) and IsLeapYear(AYear) and (AMonth = 7); +end; + +function TcxHebrewCalendarTable.IsLeapYear(AEra: Integer; AYear: Cardinal): Boolean; +var + AIndex: Integer; +begin + AIndex := AYear - cxHebrewFirstGregorianTableYear - cxHebrewYearOf1AD; + if (AIndex < 0) or (AIndex > cxHebrewTableYear) then + begin + Result := False; + Exit; + end; + AIndex := AIndex * 2 + 1; + Result := cxHebrewTable[AIndex] >= 4; +end; + +function TcxHebrewCalendarTable.ToDateTime(ADateTime: TcxDateTime): TDateTime; +var + AYear, ADays: Integer; + ALunarDate: TcxDate; + ALunarYearType: Integer; +begin + if IsNotValid(ADateTime, Result) then + Exit; + ALunarYearType := Integer(GetYearType(ADateTime.Year)); + if IsLeapYear(ADateTime.Year) then + Inc(ALunarYearType, 3); + AYear := ADateTime.Year - cxHebrewYearOf1AD; + GetLunarMonthDay(AYear, ALunarDate); + Result := EncodeDateTime(AYear, 1, 1, ADateTime.Hours, ADateTime.Minutes, + ADateTime.Seconds, ADateTime.Milliseconds); + if (ADateTime.Month = ALunarDate.Month) and (ADateTime.Day = ALunarDate.Day) then + Exit; + ADays := GetDayDifference(ALunarYearType, ADateTime.Month, ADateTime.Day, + ALunarDate.Month, ALunarDate.Day); + Result := Result + ADays; +end; + +function TcxHebrewCalendarTable.GetDayNumber(const S: string): Integer; +begin + Result := HebrewNumber(S); + if Result = 0 then + Result := inherited GetYearNumber(S); +end; + +function TcxHebrewCalendarTable.GetMonthNumber(AYear: Integer; const S: string): Integer; +var + I: Integer; +begin + Result := HebrewNumber(S); + if IsValidMonth(AYear, Result) then + Exit; + for I := 1 to 13 do + begin + if (AnsiCompareText(S, cxGetLocalMonthName(AYear, I, Self)) = 0) or + (AnsiCompareText(S, cxDayNumberToLocalFormatStr(I, Self)) = 0) then + begin + Result := I; + Exit; + end; + end; + Result := inherited GetMonthNumber(AYear, S); +end; + +function TcxHebrewCalendarTable.GetYearNumber(const S: string): Integer; +begin + Result := HebrewNumber(S); + if Result = 0 then + Result := inherited GetYearNumber(S) + else + Result := Result + 5000; +end; + +function TcxHebrewCalendarTable.GetDayDifference(ALunarYearType, AMonth, ADay, + ALunarMonth, ALunarDay: Integer): Integer; +var + ASwap: Boolean; + ATmpDay, ATmpMonth: Integer; +begin + if AMonth = ALunarMonth then + begin + Result := ADay - ALunarDay; + Exit; + end; + ASwap := AMonth > ALunarMonth; + if ASwap then + begin + ATmpMonth := AMonth; + AMonth := ALunarMonth; + ALunarMonth := ATmpMonth; + ATmpDay := ADay; + ADay := ALunarDay; + ALunarDay := ATmpDay; + end; + Result := cxHebrewLunarMonthLen[ALunarYearType, AMonth] - ADay; + Inc(AMonth); + while AMonth < ALunarMonth do + begin + Result := Result + cxHebrewLunarMonthLen[ALunarYearType, AMonth]; + Inc(AMonth); + end; + Result := Result + ALunarDay; + if not ASwap then + Result := - Result; +end; + +function TcxHebrewCalendarTable.HebrewNumber(const S: string): Integer; +var + I, AOrd: Integer; + ACh: Char; +begin + Result := 0; + for I := 1 to Length(S) do + begin + ACh := S[I]; + AOrd := Ord(ACh); + AOrd := AOrd - 223; + if AOrd <= 0 then + AOrd := 0; + case AOrd of + 12: + AOrd := 20; + 13: + AOrd := 30; + 14, 15: + AOrd := 40; + 16, 17: + AOrd := 50; + 18: + AOrd := 60; + 19: + AOrd := 70; + 21, 22: + AOrd := 80; + 23: + AOrd := 90; + 24: + AOrd := 100; + 25: + AOrd := 200; + 26: + AOrd := 300; + 27: + AOrd := 400; + else + if AOrd > 10 then + AOrd := 0; + end; + Result := Result + AOrd; + end; +end; + +procedure TcxHebrewCalendarTable.GetLunarMonthDay(AYear: Integer; var ADate: TcxDate); +var + AIndex: Integer; +begin + AIndex := AYear - cxHebrewFirstGregorianTableYear; + AIndex := AIndex * 2; + ADate.Day := cxHebrewTable[AIndex]; + case (ADate.Day) of + 0: + begin + ADate.Day := 1; + ADate.Month := 5; + end; + 30: + ADate.Month := 3; + 31: + begin + ADate.Day := 2; + ADate.Month := 5; + end; + 32: + begin + ADate.Day := 3; + ADate.Month := 5; + end; + 33: + begin + ADate.Day := 29; + ADate.Month := 3; + end; + else + ADate.Month := 4; + end; +end; + +end. + diff --git a/official/x.35/ExpressLibrary/Sources/cxDesignWindow.dfm b/official/x.35/ExpressLibrary/Sources/cxDesignWindow.dfm new file mode 100644 index 00000000..5bb23dc0 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxDesignWindow.dfm @@ -0,0 +1,15 @@ +object cxDesignWindow: TcxDesignWindow + Left = 612 + Top = 120 + Width = 320 + Height = 240 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + PixelsPerInch = 96 + TextHeight = 13 +end diff --git a/official/x.35/ExpressLibrary/Sources/cxDesignWindows.dfm b/official/x.35/ExpressLibrary/Sources/cxDesignWindows.dfm new file mode 100644 index 00000000..125d288d --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxDesignWindows.dfm @@ -0,0 +1,18 @@ +object cxDesignFormEditor: TcxDesignFormEditor + Left = 612 + Top = 120 + Width = 320 + Height = 240 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + OnClose = FormClose + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 +end diff --git a/official/x.35/ExpressLibrary/Sources/cxDesignWindows.pas b/official/x.35/ExpressLibrary/Sources/cxDesignWindows.pas new file mode 100644 index 00000000..8613a756 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxDesignWindows.pas @@ -0,0 +1,1432 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressCommonLibrary } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCOMMONLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDesignWindows; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, + DesignIntf, DesignWindows, ComponentDesigner, DesignConst, +{$ELSE} + DsgnWnds, DsgnIntf, LibIntf, DesignConst, +{$ENDIF} + Windows, Math, TypInfo, Classes, SysUtils, Controls, Graphics, Menus, Forms, StdCtrls, ExtCtrls, + cxClasses; + +type +{$IFNDEF DELPHI6} + IDesigner = IFormDesigner; +{$ENDIF} + +{$IFDEF DELPHI6} + TDesignerSelectionList = IDesignerSelections; +{$ENDIF} + + TcxDesignWindow = class; + + { TcxDesignHelper } + + TcxDesignHelper = class(TObject, IUnknown, IcxDesignHelper) + private + FComponent: TComponent; + FDesigner: IDesigner; + FList: TList; + FRefCount: Integer; + FWindow: TcxDesignWindow; + function GetDesigner: IDesigner; + protected + // IUnknown + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + procedure NotifyListeners(AList: TList); + procedure SelectionsChanged(Sender: TObject; const ASelection: TDesignerSelectionList); + public + constructor Create(AComponent: TComponent); virtual; + destructor Destroy; override; + procedure ChangeSelection(AObject: TPersistent); overload; + procedure GetSelection(AList: TList); + function IsObjectSelected(AObject: TPersistent): Boolean; overload; + procedure SelectObject(AObject: TPersistent; AClearSelection: Boolean = True; + AActivateOwner: Boolean = True); overload; + procedure SetSelection(AList: TList); + procedure UnselectObject(AObject: TPersistent); overload; + // IcxDesignHelper + procedure AddSelectionChangedListener(AListener: TPersistent); + function CanAddComponent(AOwner: TComponent): Boolean; + function CanDeleteComponent(AOwner: TComponent; AComponent: TComponent): Boolean; + procedure ChangeSelection(AOwner: TComponent; AObject: TPersistent); overload; + function IsObjectSelected(AOwner: TComponent; AObject: TPersistent): Boolean; overload; + procedure Modified; virtual; + procedure RemoveSelectionChangedListener(AListener: TPersistent); + procedure SelectObject(AOwner: TComponent; AObject: TPersistent; AClearSelection: Boolean = True; + AActivateOwner: Boolean = True); overload; + procedure ShowComponentDefaultEventHandler(AComponent: TComponent); + function UniqueName(const ABaseName: string): string; + procedure UnselectObject(AOwner: TComponent; AObject: TPersistent); overload; + + property Component: TComponent read FComponent write FComponent; + property Designer: IDesigner read GetDesigner; + end; + + { TcxDesignWindow } + + TcxSelectionsChanged = procedure(Sender: TObject; const ASelection: TDesignerSelectionList) of object; + + TcxDesignWindow = class(TDesignWindow) + private + FLockCount: Integer; + FOnSelectionsChanged: TcxSelectionsChanged; + protected + procedure Activated; override; + function UniqueName(Component: TComponent): string; override; + public + constructor Create(AOwner: TComponent); override; + procedure BeginUpdate; + procedure CancelUpdate; + procedure EndUpdate; + class function GetBaseRegKey{$IFDEF DELPHI6}(ADesigner: IComponentDesigner = nil){$ENDIF}: string; + procedure GetSelectionList(AList: TList); + procedure SelectionChanged({$IFDEF DELPHI6}const ADesigner: IDesigner;{$ENDIF} + {$IFDEF DELPHI6}const{$ENDIF}ASelection: TDesignerSelectionList); override; + procedure SelectionsChanged(const ASelection: TDesignerSelectionList); virtual; + procedure SetSelectionList(AList: TList); + procedure UpdateSelection; + property LockCount: Integer read FLockCount; + property OnSelectionsChanged: TcxSelectionsChanged + read FOnSelectionsChanged write FOnSelectionsChanged; + end; + + { TcxDesignFormEditor } + + TcxDesignFormEditor = class(TcxDesignWindow) + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormDestroy(Sender: TObject); + procedure FormCreate(Sender: TObject); + private + FClosing: Boolean; + protected + ComponentProperty: TPersistent; + ComponentPropertyName: string; + {$IFDEF DELPHI9} + procedure CreateParams(var Params: TCreateParams); override; + {$ENDIF} + procedure CloseEditor; virtual; + procedure InitFormEditor; virtual; + procedure UpdateCaption; virtual; + procedure UpdateContent; virtual; + public + Component: TComponent; + ComponentClassName: string; + function CanAddComponent: Boolean; + function CanDeleteComponent(AComponent: TComponent): Boolean; + {$IFDEF DELPHI6} + procedure DesignerClosed(const ADesigner: IDesigner; AGoingDormant: Boolean); override; + {$ELSE} + procedure FormClosed(AForm: TCustomForm); override; + procedure ComponentDeleted(Component: IPersistent); override; + procedure FormModified; override; + {$ENDIF} + procedure DoItemsModified; virtual; + procedure ItemDeleted(const ADesigner: IDesigner; AItem: TPersistent); {$IFNDEF DELPHI6}virtual;{$ELSE}override;{$ENDIF} + procedure ItemsModified(const Designer: IDesigner); {$IFNDEF DELPHI6}virtual;{$ELSE}override;{$ENDIF} + procedure SelectComponent(AComponent: TPersistent); + procedure SelectComponents(AList: TList; ADefaultComponent: TPersistent); virtual; + + procedure ListBoxApplySelection(AListBox: TListBox; ADefaultComponent: TPersistent); + procedure ListBoxSynchronizeSelection(AListBox: TListBox); + + property Closing: Boolean read FClosing; + end; + + TcxDesignFormEditorClass = class of TcxDesignFormEditor; + +function ShowFormEditorClass(ADesigner: IDesigner; AComponent: TComponent; + AFormEditorClass: TcxDesignFormEditorClass): TcxDesignFormEditor; overload; +function ShowFormEditorClass(ADesigner: IDesigner; AComponent: TComponent; + AProperty: TPersistent; const APropertyName: string; + AFormEditorClass: TcxDesignFormEditorClass): TcxDesignFormEditor; overload; +procedure UpdateDesignFormEditors(AComponent: TComponent); + +function CanAddComponent(AOwner: TComponent; const ADesigner: IDesigner = nil): Boolean; +function CanDeleteComponent(AOwner, AComponent: TComponent; const ADesigner: IDesigner = nil): Boolean; +function CanChangeComponentList(AOwner: TComponent; ADesigner: IDesigner = nil): Boolean; +function GetObjectDesigner(AObject: TPersistent): IDesigner; + +function CreateDesignerSelectionList: TDesignerSelectionList; +procedure DeleteDesignerSelectionList(var ASelection: TDesignerSelectionList); + +procedure ConvertSelectionToList(const ASelectionList: TDesignerSelectionList; AList: TList); + +// ListBox routines + +type + TcxListBoxReindexProc = procedure(AList: TList; ANewIndex: Integer) of object; + +function LockListBox(AListBox: TListBox): TNotifyEvent; +procedure UnlockListBox(AListBox: TListBox; APrevOnClick: TNotifyEvent); + +procedure ListBoxSetItemIndex(AListBox: TListBox; AItemIndex: Integer); +procedure ListBoxSetSelected(AListBox: TListBox; AItemIndex: Integer; + ASelected: Boolean); + +procedure ListBoxRestoreSelection(AListBox: TListBox; var ASelection: TStringList; + AItemIndex, ATopIndex: Integer); +procedure ListBoxSaveSelection(AListBox: TListBox; var ASelection: TStringList; + var AItemIndex, ATopIndex: Integer); + +procedure ListBoxRestorePos(AListBox: TListBox; AItemIndex, ATopIndex: Integer); +procedure ListBoxSavePos(AListBox: TListBox; var AItemIndex, ATopIndex: Integer); + +function ListBoxGetFirstSelectedIndex(AListBox: TListBox): Integer; +function ListBoxGetLastSelectedIndex(AListBox: TListBox): Integer; + +procedure ListBoxDeleteSelection(AListBox: TListBox; ASetFocus: Boolean); +procedure ListBoxGetSelection(AListBox: TListBox; AList: TList); +procedure ListBoxLoadCollection(AListBox: TListBox; ACollection: TCollection); +procedure ListBoxSelectByObject(AListBox: TListBox; AObject: TObject); +procedure ListBoxSyncSelection(AListBox: TListBox; AList: TList); +procedure ListBoxClearSelection(AListBox: TListBox); +procedure ListBoxSelectAll(AListBox: TListBox); + +procedure ListBoxMoveItems(AListBox: TListBox; AIndex: Integer; + var APrevDragIndex: Integer; AReindexProc: TcxListBoxReindexProc); +procedure ListBoxMoveUpItems(AListBox: TListBox; var APrevDragIndex: Integer; + AReindexProc: TcxListBoxReindexProc); +procedure ListBoxMoveDownItems(AListBox: TListBox; var APrevDragIndex: Integer; + AReindexProc: TcxListBoxReindexProc); + +procedure ListBoxDragOver(AListBox: TListBox; Sender, Source: TObject; + X, Y: Integer; State: TDragState; var Accept: Boolean; var APrevDragIndex: Integer); +procedure ListBoxDragDrop(AListBox: TListBox; Sender, Source: TObject; + X, Y: Integer; var APrevDragIndex: Integer; AReindexProc: TcxListBoxReindexProc); +procedure ListBoxEndDrag(AListBox: TListBox; Sender, Target: TObject; + X, Y: Integer; var APrevDragIndex: Integer); + +// component rename routines + +function CreateUniqueName(AOwnerForm, AOwnerComponent, AChildComponent: TComponent; + const ATruncateClassName, AFieldName: string): string; + +// menu routines + +function CreateMenuItem(AOwner: TComponent; const ACaption: string; + AOnClick: TNotifyEvent = nil; AEnabled: Boolean = True; ATag: Integer = -1; + AChecked: Boolean = False): TMenuItem; + +// themed IDE routines + +{$IFDEF DELPHI10} // should be DELPHI105 +procedure MakeColoredControlsOpaque(ARoot: TControl); +{$ENDIF} + +implementation + +{$R cxDesignWindow.dfm} +{$R *.dfm} + +var + Editors: TList; + +function ShowFormEditorClass(ADesigner: IDesigner; AComponent: TComponent; + AProperty: TPersistent; const APropertyName: string; + AFormEditorClass: TcxDesignFormEditorClass): TcxDesignFormEditor; +var + I: Integer; +begin + if Editors = nil then + Editors := TList.Create; + for I := 0 to Editors.Count - 1 do + begin + Result := TcxDesignFormEditor(Editors[I]); + with Result do + if (Designer = ADesigner) and (Component = AComponent) and + (AProperty = ComponentProperty) and + (CompareText(APropertyName, ComponentPropertyName) = 0) then + begin + Show; + BringToFront; + Exit; + end; + end; + Result := AFormEditorClass.Create(Application); + with Result do + try + Designer := ADesigner; + Component := AComponent; + ComponentClassName := AComponent.ClassName; + ComponentProperty := AProperty; + ComponentPropertyName := APropertyName; + InitFormEditor; + Show; + except + Free; + end; +end; + +function ShowFormEditorClass(ADesigner: IDesigner; AComponent: TComponent; + AFormEditorClass: TcxDesignFormEditorClass): TcxDesignFormEditor; +begin + Result := ShowFormEditorClass(ADesigner, AComponent, nil, '', AFormEditorClass); +end; + +procedure UpdateDesignFormEditors(AComponent: TComponent); +var + I: Integer; + ADesignFormEditor: TcxDesignFormEditor; +begin + if Editors = nil then + Editors := TList.Create; + for I := 0 to Editors.Count - 1 do + begin + ADesignFormEditor := TcxDesignFormEditor(Editors[I]); + if ADesignFormEditor.Component = AComponent then + ADesignFormEditor.UpdateContent; + end; +end; + +function CanAddComponent(AOwner: TComponent; const ADesigner: IDesigner = nil): Boolean; +begin + Result := CanChangeComponentList(AOwner, ADesigner); +end; + +function CanDeleteComponent(AOwner, AComponent: TComponent; const ADesigner: IDesigner = nil): Boolean; +begin + Result := CanChangeComponentList(AOwner, ADesigner) and + ((AComponent = nil) or not (csAncestor in AComponent.ComponentState)); +end; + +function CanChangeComponentList(AOwner: TComponent; ADesigner: IDesigner = nil): Boolean; +begin + if ADesigner = nil then + ADesigner := GetObjectDesigner(AOwner); + Result := not ADesigner.IsSourceReadOnly and not (csInline in AOwner.ComponentState); +end; + +function GetObjectDesigner(AObject: TPersistent): IDesigner; +begin + Result := FindRootDesigner(AObject) as IDesigner; +end; + +function CreateDesignerSelectionList: TDesignerSelectionList; +begin +{$IFDEF DELPHI6} + Result := CreateSelectionList; +{$ELSE} + Result := TDesignerSelectionList.Create; +{$ENDIF} +end; + +procedure DeleteDesignerSelectionList(var ASelection: TDesignerSelectionList); +begin +{$IFNDEF DELPHI6} + FreeAndNil(ASelection); +{$ELSE} + ASelection := nil; +{$ENDIF} +end; + +procedure ConvertSelectionToList(const ASelectionList: TDesignerSelectionList; AList: TList); +var + I: Integer; +begin + AList.Clear; + if ASelectionList <> nil then + begin + AList.Capacity := ASelectionList.Count; + for I := 0 to ASelectionList.Count - 1 do + AList.Add(ASelectionList[I]); + end; +end; + +// ListBox Routines + +function LockListBox(AListBox: TListBox): TNotifyEvent; +begin + Result := AListBox.OnClick; + AListBox.OnClick := nil; +end; + +procedure UnlockListBox(AListBox: TListBox; APrevOnClick: TNotifyEvent); +begin + AListBox.OnClick := APrevOnClick; +end; + +procedure ListBoxSetItemIndex(AListBox: TListBox; AItemIndex: Integer); +var + APrevOnClick: TNotifyEvent; +begin + APrevOnClick := LockListBox(AListBox); + try + AListBox.ItemIndex := AItemIndex; + finally + UnlockListBox(AListBox, APrevOnClick); + end; +end; + +procedure ListBoxSetSelected(AListBox: TListBox; AItemIndex: Integer; + ASelected: Boolean); +var + APrevOnClick: TNotifyEvent; +begin + APrevOnClick := LockListBox(AListBox); + try + if AListBox.Selected[AItemIndex] <> ASelected then + AListBox.Selected[AItemIndex] := ASelected; + finally + UnlockListBox(AListBox, APrevOnClick); + end; +end; + +procedure ListBoxRestoreSelection(AListBox: TListBox; var ASelection: TStringList; + AItemIndex, ATopIndex: Integer); +var + I: Integer; + APrevOnClick: TNotifyEvent; +begin + try + APrevOnClick := LockListBox(AListBox); + try + with AListBox do + for I := 0 to Items.Count - 1 do + Selected[I] := ASelection.IndexOfObject(Items.Objects[I]) <> -1; + if ATopIndex <> -1 then AListBox.TopIndex := ATopIndex; + if AItemIndex <> -1 then AListBox.ItemIndex := AItemIndex; + finally + UnlockListBox(AListBox, APrevOnClick); + end; + finally + AListBox.Items.EndUpdate; + FreeAndNil(ASelection); + end; +end; + +procedure ListBoxSaveSelection(AListBox: TListBox; var ASelection: TStringList; + var AItemIndex, ATopIndex: Integer); +var + I: Integer; +begin + ASelection := TStringList.Create; + try + AItemIndex := AListBox.ItemIndex; + ATopIndex := AListBox.TopIndex; + with AListBox do + for I := 0 to Items.Count - 1 do + if Selected[I] then ASelection.AddObject(Items[I], Items.Objects[I]); + AListBox.Items.BeginUpdate; + except + ASelection.Free; + ASelection := nil; + end; +end; + +procedure ListBoxRestorePos(AListBox: TListBox; AItemIndex, ATopIndex: Integer); +var + APrevOnClick: TNotifyEvent; +begin + APrevOnClick := LockListBox(AListBox); + try + if ATopIndex <> -1 then AListBox.TopIndex := ATopIndex; + if AItemIndex <> -1 then AListBox.ItemIndex := AItemIndex; + finally + UnlockListBox(AListBox, APrevOnClick); + end; +// AListBox.Items.EndUpdate; +end; + +procedure ListBoxSavePos(AListBox: TListBox; var AItemIndex, ATopIndex: Integer); +begin + AItemIndex := AListBox.ItemIndex; + ATopIndex := AListBox.TopIndex; +// AListBox.Items.BeginUpdate; +end; + +function ListBoxGetFirstSelectedIndex(AListBox: TListBox): Integer; +begin + for Result := 0 to AListBox.Items.Count - 1 do + if AListBox.Selected[Result] then Exit; + Result := -1; +end; + +function ListBoxGetLastSelectedIndex(AListBox: TListBox): Integer; +begin + for Result := AListBox.Items.Count - 1 downto 0 do + if AListBox.Selected[Result] then Exit; + Result := -1; +end; + +procedure ListBoxDeleteSelection(AListBox: TListBox; ASetFocus: Boolean); +var + I, AIndex: Integer; + AObject: TObject; + + function CanDeleteObject(AObject: TObject): Boolean; + begin + if AObject is TComponent then + Result := not (csAncestor in TComponent(AObject).ComponentState) + else + Result := True; + end; + +begin + AIndex := -1; + for I := AListBox.Items.Count - 1 downto 0 do + if AListBox.Selected[I] then + begin + with AListBox.Items do + begin + AObject := Objects[I]; + if not CanDeleteObject(AObject) then Continue; + Delete(I); + end; + AObject.Free; + AIndex := I; + end; + {for I := 0 to AListBox.Items.Count - 1 do + if AListBox.Selected[I] then + begin + if AIndex = -1 then AIndex := I; + AListBox.Items.Objects[I].Free; + end;} + // Show Last Item + if AIndex >= AListBox.Items.Count then + AIndex := AListBox.Items.Count - 1; + if AIndex >= 0 then + begin + ListBoxSetItemIndex(AListBox, AIndex); + if ASetFocus and AListBox.CanFocus then + AListBox.SetFocus; + end; +end; + +procedure ListBoxGetSelection(AListBox: TListBox; AList: TList); +var + I: Integer; +begin + for I := 0 to AListBox.Items.Count - 1 do + if AListBox.Selected[I] then + AList.Add(AListBox.Items.Objects[I]); +end; + +procedure ListBoxLoadCollection(AListBox: TListBox; ACollection: TCollection); +var + I, AItemIndex, ATopIndex: Integer; + ASelection: TStringList; + S: string; +begin + ListBoxSaveSelection(AListBox, ASelection, AItemIndex, ATopIndex); + try + AListBox.Items.Clear; + for I := 0 to ACollection.Count - 1 do + begin + S := Format('%d - %s',[I, ACollection.Items[I].DisplayName]); + AListBox.Items.AddObject(S, ACollection.Items[I]); + end; + finally + ListBoxRestoreSelection(AListBox, ASelection, AItemIndex, ATopIndex); + end; +end; + +procedure ListBoxSelectByObject(AListBox: TListBox; AObject: TObject); +var + AIndex: Integer; +begin + AIndex := AListBox.Items.IndexOfObject(AObject); + if AIndex <> -1 then + ListBoxSetSelected(AListBox, AIndex, True); +end; + +procedure ListBoxSyncSelection(AListBox: TListBox; AList: TList); +var + I, AItemIndex, ATopIndex: Integer; + ASelected: Boolean; + APrevOnClick: TNotifyEvent; +begin + ListBoxSavePos(AListBox, AItemIndex, ATopIndex); + try + APrevOnClick := LockListBox(AListBox); + try + for I := 0 to AListBox.Items.Count - 1 do + begin + ASelected := AList.IndexOf(AListBox.Items.Objects[I]) <> -1; + if AListBox.Selected[I] <> ASelected then + AListBox.Selected[I] := ASelected; + end; + finally + UnlockListBox(AListBox, APrevOnClick); + end; + if AListBox.SelCount = 1 then + for I := 0 to AListBox.Items.Count - 1 do + if AListBox.Selected[I] then + begin + AItemIndex := I; + Break; + end; + finally + ListBoxRestorePos(AListBox, AItemIndex, ATopIndex); + end; +end; + +procedure ListBoxClearSelection(AListBox: TListBox); +var + APrevOnClick: TNotifyEvent; +{$IFNDEF DELPHI6} + I: Integer; +begin + APrevOnClick := LockListBox(AListBox); + try + if AListBox.MultiSelect then + for I := 0 to AListBox.Items.Count - 1 do + AListBox.Selected[I] := False + else + AListBox.ItemIndex := -1; + finally + UnlockListBox(AListBox, APrevOnClick); + end; +end; +{$ELSE} +begin + APrevOnClick := LockListBox(AListBox); + try + AListBox.ClearSelection; + finally + UnlockListBox(AListBox, APrevOnClick); + end; +end; +{$ENDIF} + +procedure ListBoxSelectAll(AListBox: TListBox); +var + I: Integer; + APrevOnClick: TNotifyEvent; +begin + APrevOnClick := LockListBox(AListBox); + try + with AListBox do + for I := 0 to Items.Count - 1 do + Selected[I] := True; + finally + UnlockListBox(AListBox, APrevOnClick); + end; +end; + +procedure ListBoxMoveItems(AListBox: TListBox; AIndex: Integer; + var APrevDragIndex: Integer; AReindexProc: TcxListBoxReindexProc); +var + I: Integer; + APrevOnClick: TNotifyEvent; + AList: TList; +begin + APrevOnClick := LockListBox(AListBox); + try + with AListBox do + begin + if (0 <= APrevDragIndex) and (APrevDragIndex < Items.Count) then + begin + Selected[APrevDragIndex] := False; + APrevDragIndex := -1; + end; + if AIndex <> -1 then + begin + AList := TList.Create; + try + for I := 0 to Items.Count - 1 do + if Selected[I] then + AList.Add(Items.Objects[I]); + AReindexProc(AList, AIndex); + finally + AList.Free; + end; + end; + AIndex := Max(ListBoxGetFirstSelectedIndex(AListBox), AIndex); + AIndex := Min(ListBoxGetLastSelectedIndex(AListBox), AIndex); + ItemIndex := AIndex; + end; + finally + UnlockListBox(AListBox, APrevOnClick); + end; +end; + +procedure ListBoxMoveUpItems(AListBox: TListBox; var APrevDragIndex: Integer; + AReindexProc: TcxListBoxReindexProc); +begin + ListBoxMoveItems(AListBox, Max(0, ListBoxGetFirstSelectedIndex(AListBox) - 1), + APrevDragIndex, AReindexProc); +end; + +procedure ListBoxMoveDownItems(AListBox: TListBox; var APrevDragIndex: Integer; + AReindexProc: TcxListBoxReindexProc); +begin + ListBoxMoveItems(AListBox, Min(AListBox.Items.Count - 1, ListBoxGetLastSelectedIndex(AListBox) + 1), + APrevDragIndex, AReindexProc); +end; + +procedure ListBoxDragOver(AListBox: TListBox; Sender, Source: TObject; + X, Y: Integer; State: TDragState; var Accept: Boolean; var APrevDragIndex: Integer); +var + AIndex: Integer; + APrevOnClick: TNotifyEvent; +begin + if Source <> AListBox then + Accept := False + else + begin + APrevOnClick := LockListBox(AListBox); + try + with AListBox do + begin + Accept := True; + AIndex := ItemAtPos(Point(X, Y), True); + if APrevDragIndex <> AIndex then + begin + if (0 <= APrevDragIndex) and (APrevDragIndex < Items.Count) then + Selected[APrevDragIndex] := False; + if AIndex <> -1 then + if not Selected[AIndex] then + begin + Selected[AIndex] := True; + APrevDragIndex := AIndex; + end + else + APrevDragIndex := -1; + end; + ItemIndex := AIndex; + end; + finally + UnlockListBox(AListBox, APrevOnClick); + end; + end; +end; + +procedure ListBoxDragDrop(AListBox: TListBox; Sender, Source: TObject; + X, Y: Integer; var APrevDragIndex: Integer; AReindexProc: TcxListBoxReindexProc); +var + AIndex: Integer; +begin + AIndex := AListBox.ItemAtPos(Point(X, Y), True); + if (AIndex = -1) and PtInRect(AListBox.ClientRect, Point(X, Y)) then + AIndex := AListBox.Items.Count; + if AIndex <> -1 then + ListBoxMoveItems(AListBox, AIndex, APrevDragIndex, AReindexProc); +end; + +procedure ListBoxEndDrag(AListBox: TListBox; Sender, Target: TObject; + X, Y: Integer; var APrevDragIndex: Integer); +begin + if (0 <= APrevDragIndex) and (APrevDragIndex < AListBox.Items.Count) then + begin + ListBoxSetSelected(AListBox, APrevDragIndex, False); + APrevDragIndex := -1; + end; +end; + +// component rename routines + +procedure CrunchFieldName(var AFieldName: string); +var + I: Integer; +begin + I := 1; + while I <= Length(AFieldName) do + begin + if AFieldName[I] in ['A'..'Z','a'..'z','_','0'..'9'] then + Inc(I) + else + if AFieldName[I] in LeadBytes then + Delete(AFieldName, I, 2) + else + Delete(AFieldName, I, 1); + end; +end; + +function GenerateName(AOwnerComponent: TComponent; + const AClassName, ATruncateClassName, AFieldName: string; ANumber: Integer): string; +var + S: string; +begin + S := AFieldName; + CrunchFieldName(S); + if (S = '') or (S[1] in ['0'..'9']) then + begin + if AClassName <> '' then + begin + if (ATruncateClassName <> '') and + (CompareText(ATruncateClassName, Copy(AClassName, 1, Length(ATruncateClassName))) = 0) then + begin + S := Copy(AClassName, Length(ATruncateClassName) + 1, Length(AClassName)) + S; + end + else + begin + S := AClassName + S; + if S[1] = 'T' then Delete(S, 1, 1); + end; + end; + end; + if AOwnerComponent <> nil then + Result := AOwnerComponent.Name + S + else + Result := S; + if ANumber > 0 then + Result := Result + IntToStr(ANumber); +end; + +function CreateUniqueName(AOwnerForm, AOwnerComponent, AChildComponent: TComponent; + const ATruncateClassName, AFieldName: string): string; + + function IsUnique(const AName: string): Boolean; + var + I: Integer; + begin + Result := True; + with AOwnerForm do + for I := 0 to ComponentCount - 1 do + if (Components[I] <> AChildComponent) and + (CompareText(Components[I].Name, AName) = 0) then + begin + Result := False; + Break; + end; + end; + +var + I, J: Integer; +begin + if GetObjectDesigner(AOwnerForm) <> nil then + begin + Result := GenerateName(AOwnerComponent, AChildComponent.ClassName, + ATruncateClassName, AFieldName, 0); + Result := GetObjectDesigner(AOwnerForm).UniqueName(Result); + end + else + begin + if AFieldName <> '' then + J := 0 + else + J := 1; + for I := J to MaxInt do + begin + Result := GenerateName(AOwnerComponent, AChildComponent.ClassName, + ATruncateClassName, AFieldName, I); + if IsUnique(Result) then + Break; + end; + end; +end; + +function CreateMenuItem(AOwner: TComponent; const ACaption: string; + AOnClick: TNotifyEvent = nil; AEnabled: Boolean = True; ATag: Integer = -1; + AChecked: Boolean = False): TMenuItem; +begin + Result := TMenuItem.Create(AOwner); + Result.Caption := ACaption; + Result.Checked := AChecked; + Result.Enabled := AEnabled; + Result.Tag := ATag; + Result.OnClick := AOnClick; +end; + +{$IFDEF DELPHI10} // should be DELPHI105 + +procedure MakeColoredControlsOpaque(ARoot: TControl); +var + I: Integer; +begin + if (ARoot is TPanel) and (TPanel(ARoot).Color <> clBtnFace) then + TPanel(ARoot).ParentBackground := False; + if ARoot is TWinControl then + for I := 0 to TWinControl(ARoot).ControlCount - 1 do + MakeColoredControlsOpaque(TWinControl(ARoot).Controls[I]); +end; + +{$ENDIF} + +{ TcxDesignHelper } + +constructor TcxDesignHelper.Create(AComponent: TComponent); +begin + inherited Create; + FComponent := AComponent; + FList := TList.Create; +end; + +destructor TcxDesignHelper.Destroy; +begin + FWindow.Free; + FList.Free; + inherited Destroy; +end; + +procedure TcxDesignHelper.ChangeSelection(AObject: TPersistent); +begin + if IsObjectSelected(AObject) then + UnselectObject(AObject) + else + SelectObject(AObject, False); +end; + +procedure TcxDesignHelper.GetSelection(AList: TList); +var + ASelectionList: TDesignerSelectionList; + I: Integer; +begin + if Designer = nil then Exit; + ASelectionList := CreateDesignerSelectionList; + try + Designer.GetSelections(ASelectionList); + AList.Capacity := ASelectionList.Count; + for I := 0 to ASelectionList.Count - 1 do + AList.Add(ASelectionList[I]); + finally + DeleteDesignerSelectionList(ASelectionList); + end; +end; + +function TcxDesignHelper.IsObjectSelected(AObject: TPersistent): Boolean; +var + AList: TList; +begin + AList := TList.Create; + try + GetSelection(AList); + Result := AList.IndexOf(AObject) <> -1; + finally + AList.Free; + end; +end; + +procedure TcxDesignHelper.SelectObject(AObject: TPersistent; AClearSelection: Boolean = True; + AActivateOwner: Boolean = True); +var + AList: TList; +begin + if AClearSelection and AActivateOwner then + Designer.SelectComponent(AObject) + else + begin + AList := TList.Create; + try + if not AClearSelection then GetSelection(AList); + if AList.IndexOf(AObject) = -1 then + begin + AList.Add(AObject); + SetSelection(AList); + end; + finally + AList.Free; + end; + end; +end; + +procedure TcxDesignHelper.SetSelection(AList: TList); +var + ASelectionList: TDesignerSelectionList; + I: Integer; +begin + if Designer = nil then Exit; + ASelectionList := CreateDesignerSelectionList; + try + for I := 0 to AList.Count - 1 do + ASelectionList.Add(TPersistent(AList[I])); + Designer.SetSelections(ASelectionList); + finally + DeleteDesignerSelectionList(ASelectionList); + end; +end; + +procedure TcxDesignHelper.UnselectObject(AObject: TPersistent); +var + AList: TList; +begin + if not IsObjectSelected(AObject) then Exit; + AList := TList.Create; + try + GetSelection(AList); + AList.Remove(AObject); + SetSelection(AList); + finally + AList.Free; + end; +end; + +procedure TcxDesignHelper.AddSelectionChangedListener(AListener: TPersistent); +begin + if (AListener <> nil) and Supports(AListener, IcxDesignSelectionChanged) and + (FList.IndexOf(AListener) < 0) then + begin + if FWindow = nil then + begin + FWindow := TcxDesignWindow.Create(nil); + FWindow.OnSelectionsChanged := SelectionsChanged; + end; + FList.Add(AListener); + end; +end; + +procedure TcxDesignHelper.RemoveSelectionChangedListener(AListener: TPersistent); +begin + FList.Remove(AListener); + if FList.Count = 0 then + FreeAndNil(FWindow); +end; + +function TcxDesignHelper.CanAddComponent(AOwner: TComponent): Boolean; +begin + Result := cxDesignWindows.CanAddComponent(AOwner.Owner); +end; + +function TcxDesignHelper.CanDeleteComponent(AOwner, + AComponent: TComponent): Boolean; +begin + Result := cxDesignWindows.CanDeleteComponent(AOwner.Owner, AComponent); +end; + +procedure TcxDesignHelper.ChangeSelection(AOwner: TComponent; AObject: TPersistent); +begin + Component := AOwner; + ChangeSelection(AObject); +end; + +function TcxDesignHelper.IsObjectSelected(AOwner: TComponent; AObject: TPersistent): Boolean; +begin + Component := AOwner; + Result := IsObjectSelected(AObject); +end; + +procedure TcxDesignHelper.Modified; +begin + Designer.Modified; +end; + +procedure TcxDesignHelper.SelectObject(AOwner: TComponent; + AObject: TPersistent; AClearSelection: Boolean = True; + AActivateOwner: Boolean = True); +begin + Component := AOwner; + SelectObject(AObject, AClearSelection, AActivateOwner); +end; + +procedure TcxDesignHelper.ShowComponentDefaultEventHandler(AComponent: TComponent); +var + APropInfo: PPropInfo; + AMethod: TMethod; + AMethodName: string; +begin + Component := AComponent; + APropInfo := GetPropInfo(Component.ClassInfo, 'OnChange'); + if APropInfo = nil then + begin + APropInfo := GetPropInfo(Component.ClassInfo, 'OnClick'); + if APropInfo = nil then + Exit + else + AMethodName := 'Click'; + end + else + AMethodName := 'Change'; + AMethod := GetMethodProp(Component, APropInfo); + if AMethod.Code <> nil then + AMethodName := Designer.GetMethodName(AMethod) + else + begin + AMethodName := AComponent.Name + AMethodName; + AMethod := GetObjectDesigner(Component).CreateMethod(AMethodName, GetTypeData(APropInfo.PropType^)); + SetMethodProp(Component, APropInfo, AMethod); + Designer.Modified; + end; + Designer.ShowMethod(AMethodName); +end; + +function TcxDesignHelper.UniqueName(const ABaseName: string): string; +begin + Result := Designer.UniqueName(ABaseName); +end; + +procedure TcxDesignHelper.UnselectObject(AOwner: TComponent; AObject: TPersistent); +begin + Component := AOwner; + UnselectObject(AObject); +end; + +function TcxDesignHelper.QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +function TcxDesignHelper._AddRef: Integer; stdcall; +begin + Result := InterlockedIncrement(FRefCount); +end; + +function TcxDesignHelper._Release: Integer; stdcall; +begin + Result := InterlockedDecrement(FRefCount); + if FRefCount = 0 then + Destroy; +end; + +procedure TcxDesignHelper.NotifyListeners(AList: TList); +var + I: Integer; + AIntf: IcxDesignSelectionChanged; +begin + for I := 0 to FList.Count - 1 do + begin + if Supports(TObject(FList[I]), IcxDesignSelectionChanged, AIntf) then + begin + AIntf.DesignSelectionChanged(AList); + AIntf := nil; + end; + end; +end; + +procedure TcxDesignHelper.SelectionsChanged(Sender: TObject; + const ASelection: TDesignerSelectionList); +var + L: TList; +begin + L := TList.Create; + try + ConvertSelectionToList(ASelection, L); + NotifyListeners(L); + finally + L.Free; + end; +end; + +function TcxDesignHelper.GetDesigner: IDesigner; +begin + if FDesigner = nil then + FDesigner := GetObjectDesigner(FComponent); + Result := FDesigner; +end; + +{ TcxDesignWindow } + +constructor TcxDesignWindow.Create(AOwner: TComponent); +begin + inherited; + Font.Name := DefFontData.Name; +end; + +procedure TcxDesignWindow.BeginUpdate; +begin + Inc(FLockCount); +end; + +procedure TcxDesignWindow.CancelUpdate; +begin + Dec(FLockCount); +end; + +procedure TcxDesignWindow.EndUpdate; +begin + Dec(FLockCount); + if FLockCount = 0 then + UpdateSelection; +end; + +class function TcxDesignWindow.GetBaseRegKey{$IFDEF DELPHI6}(ADesigner: IComponentDesigner = nil){$ENDIF}: string; +begin +{$IFDEF DELPHI6} + if ADesigner = nil then + ADesigner := ActiveDesigner; + if ADesigner = nil then + Result := '' + else + Result := ADesigner.Environment.GetBaseRegKey + '\' + SIniEditorsName; +{$ELSE} + Result := DelphiIDE.GetBaseRegKey + '\' + SIniEditorsName; +{$ENDIF} +end; + +procedure TcxDesignWindow.GetSelectionList(AList: TList); +var + ASelectionList: TDesignerSelectionList; +begin + ASelectionList := CreateDesignerSelectionList; + try + Designer.GetSelections(ASelectionList); + ConvertSelectionToList(ASelectionList, AList); + finally + DeleteDesignerSelectionList(ASelectionList); + end; +end; + +procedure TcxDesignWindow.SelectionChanged({$IFDEF DELPHI6}const ADesigner: IDesigner;{$ENDIF} + {$IFDEF DELPHI6}const{$ENDIF}ASelection: TDesignerSelectionList); +begin + if LockCount <> 0 then Exit; + if Assigned(FOnSelectionsChanged) then + FOnSelectionsChanged(Self, ASelection); + {$IFDEF DELPHI6} + if ADesigner = Designer then + {$ENDIF} + SelectionsChanged(ASelection); +end; + +procedure TcxDesignWindow.SelectionsChanged(const ASelection: TDesignerSelectionList); +begin +end; + +procedure TcxDesignWindow.SetSelectionList(AList: TList); +var + ASelectionList: TDesignerSelectionList; + I: Integer; +begin + ASelectionList := CreateDesignerSelectionList; + try + for I := 0 to AList.Count - 1 do + ASelectionList.Add(TPersistent(AList[I])); + Designer.SetSelections(ASelectionList); + finally + DeleteDesignerSelectionList(ASelectionList); + end; +end; + +procedure TcxDesignWindow.UpdateSelection; +var + ASelectionList: TDesignerSelectionList; +begin + ASelectionList := CreateDesignerSelectionList; + try + Designer.GetSelections(ASelectionList); + SelectionChanged({$IFDEF DELPHI6}Designer, {$ENDIF}ASelectionList); + finally + DeleteDesignerSelectionList(ASelectionList); + end; +end; + +procedure TcxDesignWindow.Activated; +begin +{$IFDEF DELPHI6} + Designer.Activate; +{$ENDIF} +// UpdateSelection; // TODO: +end; + +function TcxDesignWindow.UniqueName(Component: TComponent): string; +begin + Result := ''; //inherited UniqueName(Component); +end; + +{ TcxDesignFormEditor } + +{$IFDEF DELPHI6} + +procedure TcxDesignFormEditor.DesignerClosed(const ADesigner: IDesigner; AGoingDormant: Boolean); +begin + if Designer = ADesigner then + CloseEditor; + inherited; +end; + +{$ELSE} + +procedure TcxDesignFormEditor.FormClosed(AForm: TCustomForm); +begin + if Designer.Form = AForm then + CloseEditor; + inherited; +end; + +procedure TcxDesignFormEditor.ComponentDeleted(Component: IPersistent); +var + AItem: TPersistent; +begin + AItem := TryExtractPersistent(Component); + if AItem <> nil then + ItemDeleted(Designer, AItem); +end; + +procedure TcxDesignFormEditor.FormModified; +begin + ItemsModified(Designer); +end; + +{$ENDIF} + +procedure TcxDesignFormEditor.DoItemsModified; +begin +end; + +procedure TcxDesignFormEditor.ItemDeleted(const ADesigner: IDesigner; AItem: TPersistent); +begin + if (AItem = nil) or Closing then Exit; + if (Component = nil) or (csDestroying in Component.ComponentState) or + (AItem = Component) then + CloseEditor; +end; + +procedure TcxDesignFormEditor.ItemsModified(const Designer: IDesigner); +begin + if Closing or (Component = nil) or (csDestroying in Component.ComponentState) then + Exit; + UpdateCaption; + DoItemsModified; +end; + +procedure TcxDesignFormEditor.SelectComponent(AComponent: TPersistent); +begin + Designer.SelectComponent(AComponent); +end; + +procedure TcxDesignFormEditor.SelectComponents(AList: TList; ADefaultComponent: TPersistent); +begin + if not Active then Exit; + if AList.Count > 0 then + SetSelectionList(AList) + else + if Component <> nil then + begin + if ADefaultComponent <> nil then + SelectComponent(ADefaultComponent) + else + SelectComponent(Component); + end; +end; + +procedure TcxDesignFormEditor.ListBoxApplySelection(AListBox: TListBox; + ADefaultComponent: TPersistent); +var + AList: TList; +begin + BeginUpdate; + try + AList := TList.Create; + try + ListBoxGetSelection(AListBox, AList); + SelectComponents(AList, ADefaultComponent); + finally + AList.Free; + end; + finally + EndUpdate; + end; +end; + +procedure TcxDesignFormEditor.ListBoxSynchronizeSelection(AListBox: TListBox); +var + AList: TList; +begin + AList := TList.Create; + try + GetSelectionList(AList); + ListBoxSyncSelection(AListBox, AList); + finally + AList.Free; + end; +end; + +{$IFDEF DELPHI9} +procedure TcxDesignFormEditor.CreateParams(var Params: TCreateParams); +begin + inherited; + Params.WndParent := Application.MainForm.Handle; +end; +{$ENDIF} + +procedure TcxDesignFormEditor.CloseEditor; +begin + FClosing := True; + Component := nil; + ComponentProperty := nil; + ComponentPropertyName := ''; + Close; +end; + +procedure TcxDesignFormEditor.UpdateCaption; +var + S: string; +begin + if (Component <> nil) and (Component.Name <> '') then + begin + S := Component.Name; + if Component.Owner <> nil then + S := Component.Owner.Name + '.' + S; + Caption := S; + end; +end; + +procedure TcxDesignFormEditor.InitFormEditor; +begin + UpdateCaption; +end; + +procedure TcxDesignFormEditor.UpdateContent; +begin +end; + +function TcxDesignFormEditor.CanAddComponent: Boolean; +begin + Result := cxDesignWindows.CanAddComponent(Component.Owner, Designer); +end; + +function TcxDesignFormEditor.CanDeleteComponent(AComponent: TComponent): Boolean; +begin + Result := cxDesignWindows.CanDeleteComponent(Component.Owner, AComponent, Designer); +end; + +procedure TcxDesignFormEditor.FormCreate(Sender: TObject); +begin + if Editors <> nil then + Editors.Add(Self); +end; + +procedure TcxDesignFormEditor.FormClose(Sender: TObject; + var Action: TCloseAction); +begin + // TODO: save pos + Action := caFree; +end; + +procedure TcxDesignFormEditor.FormDestroy(Sender: TObject); +begin + if Editors <> nil then + Editors.Remove(Self); +end; + +initialization + +finalization + FreeAndNil(Editors); + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxDrawTextUtils.pas b/official/x.35/ExpressLibrary/Sources/cxDrawTextUtils.pas new file mode 100644 index 00000000..0ca0042d --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxDrawTextUtils.pas @@ -0,0 +1,993 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDrawTextUtils; + +{$I cxVer.inc} + +interface + +uses + Windows, Controls, +{$IFDEF DELPHI6} + Types, +{$ELSE} + Classes, +{$ENDIF} + SysUtils, Graphics; + +const + CXTO_LEFT = $00000000; + CXTO_CENTER_HORIZONTALLY = $00000001; + CXTO_RIGHT = $00000002; + CXTO_JUSTIFY_HORIZONTALLY = $00000003; + CXTO_DISTRIBUTE_HORIZONTALLY = $00000004; + + CXTO_TOP = $00000000; + CXTO_CENTER_VERTICALLY = $00000010; + CXTO_BOTTOM = $00000020; + CXTO_DISTRIBUTE_VERTICALLY = $00000030; + + CXTO_PREVENT_LEFT_EXCEED = $00000040; + CXTO_PREVENT_TOP_EXCEED = $00000080; + + CXTO_WORDBREAK = $00000100; + CXTO_SINGLELINE = $00000200; + CXTO_EXPANDTABS = $00000400; + CXTO_END_ELLIPSIS = $00000800; + + CXTO_PATTERNEDTEXT = $00001000; + CXTO_EXTERNALLEADING = $00002000; + CXTO_EDITCONTROL = $00004000; + CXTO_NOCLIP = $00008000; + + CXTO_AUTOINDENTS = $00010000; + CXTO_CHARBREAK = $00020000; + + CXTO_CALCRECT = $00100000; + CXTO_CALCROWCOUNT = $00200000; + + CXTO_DEFAULT_FORMAT = CXTO_LEFT or CXTO_TOP or CXTO_SINGLELINE; + + cxTextSpace = 2; + +type + TCaptionChar = Char; + TcxCaptionChar = TCaptionChar; + PcxCaptionChar = PChar; + TcxTextOutFormat = DWORD; + TcxTextAlignX = (taLeft, taCenterX, taRight, taJustifyX, taDistributeX); + TcxTextAlignY = (taTop, taCenterY, taBottom, taDistributeY); + + PcxTextParams = ^TcxTextParams; + TcxTextParams = packed record + RowHeight: Integer; + tmExternalLeading: Integer; + FullRowHeight: Integer; + EndEllipsisWidth: Integer; + BreakChar: TcxCaptionChar; + TextAlignX: TcxTextAlignX; + TextAlignY: TcxTextAlignY; + WordBreak: Boolean; + SingleLine: Boolean; + ExpandTabs: Boolean; + EndEllipsis: Boolean; + ExternalLeading: Boolean; + EditControl: Boolean; + NoClip: Boolean; + AutoIndents: Boolean; + PreventLeftExceed: Boolean; + PreventTopExceed: Boolean; + CharBreak: Boolean; + CalcRowCount: Boolean; + CalcRect: Boolean; + MaxCharWidth: Integer; + CharSet: Byte; + end; + + TcxTextRow = record + Text: PcxCaptionChar; + TextLength: Integer; + TextExtents: TSize; + BreakCount: Integer; + TextOriginX: Integer; + TextOriginY: Integer; + StartOffset: Integer; + end; + TcxTextRows = array of TcxTextRow; + + TCanvasHandle = HDC; + +function cxCalcTextParams(AHandle: TCanvasHandle; AFormat: DWORD): TcxTextParams; overload; +function cxCalcTextParams(ACanvas: TCanvas; AFormat: DWORD): TcxTextParams; overload; + +function cxCalcTextExtents(AHandle: TCanvasHandle; AText: PcxCaptionChar; + ATextLength: Integer; AExpandTabs: Boolean): TSize; +function cxGetLongestTextRowWidth(const ATextRows: TcxTextRows; ARowCount: Integer): Integer; + +procedure cxCalcTextRowExtents(AHandle: TCanvasHandle; var ATextRow: TcxTextRow; + const ATextParams: TcxTextParams); + +function cxMakeTextRows(AHandle: TCanvasHandle; + AText: PcxCaptionChar; const R: TRect; + const ATextParams: TcxTextParams; out ATextRows: TcxTextRows; + out ACount: Integer; AMaxLineCount: Integer = 0): Boolean; overload; +function cxMakeTextRows(ACanvas: TCanvas; + AText: PcxCaptionChar; const R: TRect; + const ATextParams: TcxTextParams; out ATextRows: TcxTextRows; + out ACount: Integer; AMaxLineCount: Integer = 0): Boolean; overload; + +procedure cxPlaceTextRows(AHandle: TCanvasHandle; const R: TRect; + var ATextParams: TcxTextParams; const ATextRows: TcxTextRows; ARowCount: Integer); + +function cxMakeFormat(ATextAlignX: TcxTextAlignX; ATextAlignY: TcxTextAlignY): DWORD; + +function cxPrepareRect(const R: TRect; const ATextParams: TcxTextParams; + ALeftIndent, ARightIndent: Integer): TRect; + +function cxTextOut(AHandle: TCanvasHandle; AText: PcxCaptionChar; var R: TRect; + AFormat: TcxTextOutFormat = CXTO_DEFAULT_FORMAT; AMaxLineCount: Integer = 0; + ALeftIndent: Integer = 0; ARightIndent: Integer = 0): Integer; overload; + +function cxTextOut(AHandle: TCanvasHandle; AText: PcxCaptionChar; var R: TRect; + AFormat: TcxTextOutFormat; ASelStart, ASelLength: Integer; + AColor, ATextColor: TColor; AMaxLineCount: Integer = 0; + ALeftIndent: Integer = 0; ARightIndent: Integer = 0): Integer; overload; + +// for TCanvas +function cxTextOut(ACanvas: TCanvas; AText: PcxCaptionChar; var R: TRect; + AFormat: TcxTextOutFormat = CXTO_DEFAULT_FORMAT; AMaxLineCount: Integer = 0; + ALeftIndent: Integer = 0; ARightIndent: Integer = 0): Integer; overload; + +function cxTextOut(ACanvas: TCanvas; AText: PcxCaptionChar; var R: TRect; + AFormat: TcxTextOutFormat; ASelStart, ASelLength: Integer; + AColor, ATextColor: TColor; AMaxLineCount: Integer = 0; + ALeftIndent: Integer = 0; ARightIndent: Integer = 0): Integer; overload; + +procedure cxTextRowsOutHighlight(AHandle: TCanvasHandle; const R: TRect; + const ATextParams: TcxTextParams; const ATextRows: TcxTextRows; ARowCount, + ASelStart, ASelLength: Integer; AColor, ATextColor: TColor; AForceEndEllipsis: Boolean); + +implementation + +uses + Math, + cxClasses, cxGraphics; + +type + TCanvasAccess = class(TControlCanvas); + +const + CXTO_VERT_ALIGN_OFFSET = 4; + CXTO_HORZ_ALIGN_MASK = CXTO_CENTER_HORIZONTALLY or CXTO_RIGHT or CXTO_JUSTIFY_HORIZONTALLY or CXTO_DISTRIBUTE_HORIZONTALLY; + CXTO_VERT_ALIGN_MASK = CXTO_CENTER_VERTICALLY or CXTO_BOTTOM or CXTO_DISTRIBUTE_VERTICALLY; + + Tab: TcxCaptionChar = #9; + LF: TcxCaptionChar = #10; + CR: TcxCaptionChar = #13; + Space: TcxCaptionChar = ' '; + + cxEndEllipsisChars: PcxCaptionChar = '...'; + +var + cxEndEllipsisCharsLength: Integer; + +function cxMakeFormat(ATextAlignX: TcxTextAlignX; ATextAlignY: TcxTextAlignY): DWORD; +begin + Result := Byte(ATextAlignX) or (Byte(ATextAlignY) shl CXTO_VERT_ALIGN_OFFSET); +end; + +function cxCalcTextExtents(AHandle: TCanvasHandle; AText: PcxCaptionChar; + ATextLength: Integer; AExpandTabs: Boolean): TSize; +var + ATextExtent: DWORD; + R: TRect; +begin + if AExpandTabs then + begin + if ATextLength <= 4096 then + begin + ATextExtent := GetTabbedTextExtent(AHandle, AText, ATextLength, 0, Result); + Result.cx := LoWord(ATextExtent); + Result.cy := HiWord(ATextExtent); + end + else + begin + R := cxEmptyRect; + Result.cy := DrawText(AHandle, AText, ATextLength, R, + DT_SINGLELINE or DT_NOPREFIX or DT_CALCRECT or DT_EXPANDTABS); + Result.cx := R.Right - R.Left; + end; + end + else + GetTextExtentPoint32(AHandle, AText, ATextLength, Result); +end; + +function IntersectClipRect(AHandle: TCanvasHandle; const R: TRect): HRGN; +begin + Result := CreateRectRgn(0, 0, 0, 0); + if GetClipRgn(AHandle, Result) <> 1 then + begin + DeleteObject(Result); + Result := 0; + end; + with R do + Windows.IntersectClipRect(AHandle, Left, Top, Right, Bottom); +end; + +procedure RestoreClipRgn(AHandle: TCanvasHandle; var ARgn: HRGN); +begin + SelectClipRgn(AHandle, ARgn); + if ARgn <> 0 then + begin + DeleteObject(ARgn); + ARgn := 0 + end; +end; + +procedure cxCalcTextRowExtents(AHandle: TCanvasHandle; var ATextRow: TcxTextRow; const ATextParams: TcxTextParams); +begin + with ATextRow do + TextExtents := cxCalcTextExtents(AHandle, Text, TextLength, ATextParams.ExpandTabs); +end; + +function cxCalcMinStringLength(AHandle: TCanvasHandle; const ATextParams: TcxTextParams; + AText: PcxCaptionChar; ATextLength, AWidth: Integer; var ATotalLength: Integer): Integer; +var + L, H, C: Integer; +begin + Result := 1; + H := ATextLength; + L := H; + + ATotalLength := cxCalcTextExtents(AHandle, AText, L, False).cx; + + if ATotalLength / AWidth > 8 then + begin + Result := 1; + ATotalLength := 0;; + Exit; + end + else + ATotalLength := cxCalcTextExtents(AHandle, AText, L, ATextParams.ExpandTabs).cx; + + while (L > 1) and (ATotalLength > AWidth) do + begin + L := L div 2; + ATotalLength := cxCalcTextExtents(AHandle, AText, L, ATextParams.ExpandTabs).cx; + end; + while L <= H do + begin + Result := (L + H) shr 1; + ATotalLength := cxCalcTextExtents(AHandle, AText, Result, ATextParams.ExpandTabs).cx; + if L = H then + C := 0 + else + C := ATotalLength - AWidth; + if C < 0 then + L := Result + 1 + else + begin + H := Result - 1; + if C = 0 then + Break; + end; + end; + if (ATotalLength > AWidth) and (Result > 1) then + begin + Dec(Result); + ATotalLength := cxCalcTextExtents(AHandle, AText, Result, ATextParams.ExpandTabs).cx; + end; +end; + +procedure cxGetTextRow(AHandle: TCanvasHandle; + var S: PcxCaptionChar; + var ALength: Integer; AWidth: Integer; AIsLastRow: Boolean; + const ATextParams: TcxTextParams; var ATextRow: TcxTextRow); + +var + AMinStrLen, ATotalTextWidth, I, ABreakPos: Integer; + ASize: TSize; + ABreakByWords, ABreakByChars, AIsSpecialProcessedRow, ACRExists: Boolean; + ACharLen: Integer; + AChar: PChar; +begin + FillChar(ATextRow, SizeOf(ATextRow), 0); + if S = nil then Exit; + + ABreakPos := -1; + AMinStrLen := cxCalcMinStringLength(AHandle, ATextParams, S, + ALength, Max(AWidth, 1), ATotalTextWidth); + with ATextParams do + begin + ABreakByWords := + not SingleLine and (WordBreak or (TextAlignX in [taJustifyX, taDistributeX])); + ABreakByChars := ABreakByWords and CharBreak; + AIsSpecialProcessedRow := not EditControl and + not NoClip and not (TextAlignX in [taJustifyX, taDistributeX]) and AIsLastRow and EndEllipsis; + end; + + AChar := S; + with ATextRow do + begin + for I := 0 to ALength - 1 do + begin + if SysLocale.FarEast then + begin + ACharLen := cxStrCharLength(AChar); + if StrByteType(S, I) = mbTrailByte then Continue; + Inc(AChar, ACharLen); + end + else + ACharLen := 1; + TextLength := I + ACharLen; + + if (S[I] = Space) or (S[I] = Tab) then //Q99343 don't use ATextParams.BreakChar (bug with Segoe UI) + begin + Inc(BreakCount); + ABreakPos := I; + end; + + if ((S[I] = CR) or (S[I] = LF)) and not AIsSpecialProcessedRow and + not ATextParams.SingleLine then + begin + Dec(TextLength); + if ATextParams.TextAlignX = taJustifyX then BreakCount := 0; + Break; + end; + + if ABreakByWords or AIsSpecialProcessedRow or ATextParams.SingleLine then + begin + if I >= AMinStrLen then + begin + if ATextParams.ExpandTabs then + ATotalTextWidth := cxCalcTextExtents(AHandle, S, TextLength, True).cx + else + begin + ASize := cxCalcTextExtents(AHandle, @S[I], ACharLen, False); + Inc(ATotalTextWidth, ASize.cx); + end; + end; + + if ATotalTextWidth > AWidth then + begin + if AIsSpecialProcessedRow or ATextParams.SingleLine then + Break + else + begin + if ABreakPos <> -1 then + begin + TextLength := ABreakPos + 1; + Break; + end + else + if ABreakByChars then + begin + if TextLength > cxStrCharLength(S) then Dec(TextLength, ACharLen); + Break; + end; + end; + end; + end; + end; + ATextRow.Text := S; + + // truncate trailing spaces + if ATextParams.TextAlignX in [taJustifyX, taDistributeX] then + while (TextLength > 0) and + ((S[TextLength - 1] = Space) or (S[TextLength - 1] = Tab)) do //Q99343 don't use ATextParams.BreakChar (bug with Segoe UI) + begin + if BreakCount > 0 then Dec(BreakCount); + Dec(TextLength); + end; + end; + + cxCalcTextRowExtents(AHandle, ATextRow, ATextParams); + + ACRExists := False; + // correct source string + Inc(S, ATextRow.TextLength); + Dec(ALength, ATextRow.TextLength); + + I := 0; + while (I < ALength) and (S[I] = Space) do //Q99343 don't use ATextParams.BreakChar (bug with Segoe UI) + Inc(I); + if (I < ALength) and (S[I] = Tab) then + Inc(I); + if (I < ALength) and (S[I] = CR) then + begin + Inc(I); + ACRExists := True; + end; + if (I < ALength) and (S[I] = LF) then + Inc(I); + Inc(S, I); + Dec(ALength, I); + // doesn't justify last row (like Excel ?) + if ((ALength = 0) or ACRExists) and (ATextParams.TextAlignX = taJustifyX) then + ATextRow.BreakCount := 0; +end; + +function cxCalcTextParams(AHandle: TCanvasHandle; AFormat: TcxTextOutFormat): TcxTextParams; +var + ATextMetric: TTextMetric; +begin + FillChar(Result, SizeOf(Result), 0); + with Result do + begin + GetTextMetrics(AHandle, ATextMetric); + BreakChar := ATextMetric.tmBreakChar; + MaxCharWidth := ATextMetric.tmMaxCharWidth; + RowHeight := ATextMetric.tmHeight; + CharSet := ATextMetric.tmCharSet; + + TextAlignX := TcxTextAlignX(AFormat and CXTO_HORZ_ALIGN_MASK); + TextAlignY := TcxTextAlignY(AFormat and CXTO_VERT_ALIGN_MASK shr CXTO_VERT_ALIGN_OFFSET); + + AutoIndents := AFormat and CXTO_AUTOINDENTS <> 0; + CalcRect := AFormat and CXTO_CALCRECT <> 0; + CalcRowCount := AFormat and CXTO_CALCROWCOUNT <> 0; + CharBreak := (AFormat and CXTO_CHARBREAK <> 0) or SysLocale.FarEast; + EditControl := AFormat and CXTO_EDITCONTROL <> 0; + EndEllipsis := AFormat and CXTO_END_ELLIPSIS <> 0; + ExternalLeading := AFormat and CXTO_EXTERNALLEADING <> 0; + ExpandTabs := AFormat and CXTO_EXPANDTABS <> 0; + NoClip := AFormat and CXTO_NOCLIP <> 0; + PreventLeftExceed := AFormat and CXTO_PREVENT_LEFT_EXCEED <> 0; + PreventTopExceed := AFormat and CXTO_PREVENT_TOP_EXCEED <> 0; + SingleLine := AFormat and CXTO_SINGLELINE <> 0; + WordBreak := AFormat and CXTO_WORDBREAK <> 0; + + if ExternalLeading then tmExternalLeading := ATextMetric.tmExternalLeading; + FullRowHeight := RowHeight + tmExternalLeading; + if AFormat and CXTO_END_ELLIPSIS = CXTO_END_ELLIPSIS then + EndEllipsisWidth := cxCalcTextExtents(AHandle, cxEndEllipsisChars, cxEndEllipsisCharsLength, False).cX + else EndEllipsisWidth := 0; + end; +end; + +function cxCalcTextParams(ACanvas: TCanvas; AFormat: DWORD): TcxTextParams; +begin + TCanvasAccess(ACanvas).RequiredState([csHandleValid, csFontValid]); + Result := cxCalcTextParams(ACanvas.Handle, AFormat); +end; + +function cxMakeTextRows(AHandle: TCanvasHandle; + AText: PcxCaptionChar; + const R: TRect; const ATextParams: TcxTextParams; out ATextRows: TcxTextRows; + out ACount: Integer; AMaxLineCount: Integer = 0): Boolean; + + function CheckIsLastRow(ATotalHeight, H: Integer): Boolean; + begin + with ATextParams do + if SingleLine then + Result := True + else + if (TextAlignY = taTop) and not CalcRect then + begin + if (EditControl{ or EndEllipsis}) and not NoClip then + Result := ATotalHeight + FullRowHeight > H + else + Result := ATotalHeight > H + end + else + Result := (AMaxLineCount > 0) and (ACount = AMaxLineCount); + end; + + procedure ExpandTextRows(var ACapacity: Integer); + const + Delta: Integer = 4; + begin + if ACount > ACapacity then + begin + Inc(ACapacity, Delta); + SetLength(ATextRows, ACapacity); + end; + end; + +var + P: PcxCaptionChar; + AIsLastRow, ARectIsSmall: Boolean; + ATotalHeight, ACapacity, H, W, L, AOffset: Integer; +begin + ARectIsSmall := False; + ATextRows := nil; + ACount := 0; + if AText <> nil then + begin + P := AText; + AOffset := 0; + if ATextParams.CalcRect and ATextParams.SingleLine then + begin + ACount := 1; + SetLength(ATextRows, ACount); + ATextRows[0].Text := P; + ATextRows[0].TextLength := Length(P); + cxCalcTextRowExtents(AHandle, ATextRows[0], ATextParams); + end + else + begin + AIsLastRow := False; + ATotalHeight := 0; + ACapacity := 0; + L := Length(P); + W := R.Right - R.Left; + H := R.Bottom - R.Top; + while (Length(P) <> 0) and not AIsLastRow do + begin + Inc(ACount); + ExpandTextRows(ACapacity); + Inc(ATotalHeight, ATextParams.FullRowHeight); + AIsLastRow := CheckIsLastRow(ATotalHeight, H); + cxGetTextRow(AHandle, P, L, W, AIsLastRow, ATextParams, ATextRows[ACount - 1]); + ATextRows[ACount - 1].StartOffset := AOffset; + AOffset := Integer(Pointer(P)) - Integer(Pointer(AText)); + if not AIsLastRow then + AIsLastRow := L = 0; + if (AMaxLineCount > 0) and (ACount = AMaxLineCount) then + Break; + end; + with ATextParams do + ARectIsSmall := not SingleLine and not CalcRect and + (AMaxLineCount > 0) and (ACount = AMaxLineCount) and (L > 0); + if ACapacity > ACount then + SetLength(ATextRows, ACount); + end; + end; + Result := not ARectIsSmall; +end; + +function cxMakeTextRows(ACanvas: TCanvas; + AText: PcxCaptionChar; + const R: TRect; const ATextParams: TcxTextParams; out ATextRows: TcxTextRows; + out ACount: Integer; AMaxLineCount: Integer = 0): Boolean; +begin + Result := cxMakeTextRows(ACanvas.Handle, AText, R, ATextParams, ATextRows, + ACount, AMaxLineCount); +end; + +procedure cxPlaceTextRows(AHandle: TCanvasHandle; const R: TRect; var ATextParams: TcxTextParams; + const ATextRows: TcxTextRows; ARowCount: Integer); + + procedure CalcExtraAndTopRowOffset(out AExtra, ATopRowOffset: Integer); + var + H: Integer; + begin + AExtra := 0; + with ATextParams do + begin + if (ARowCount > 1) and (TextAlignY = taDistributeY) then + begin + H := R.Bottom - R.Top; + Dec(H, RowHeight); + if H / (ARowCount - 1) > RowHeight then + begin + FullRowHeight := H div (ARowCount - 1); + AExtra := H mod (ARowCount - 1); + end; + end; + + case TextAlignY of + taCenterY: + ATopRowOffset := R.Top + (R.Bottom - R.Top - ARowCount * FullRowHeight) div 2; + taBottom: + ATopRowOffset := R.Bottom - ARowCount * FullRowHeight + tmExternalLeading; + else + ATopRowOffset := R.Top; + end; + + if PreventTopExceed and (ATopRowOffset < R.Top) then + ATopRowOffset := R.Top; + end; + end; + + procedure PlaceRows(AExtra, ATopRowOffset: Integer); + var + I: Integer; + begin + for I := 0 to ARowCount - 1 do + with ATextRows[I] do + begin + // Horizontally + case ATextParams.TextAlignX of + taCenterX: + TextOriginX := R.Left + (R.Right - R.Left - TextExtents.cx) div 2; + taRight: + TextOriginX := R.Right - TextExtents.cx; + else + TextOriginX := R.Left; + end; + if ATextParams.PreventLeftExceed and (TextOriginX < R.Left) then + TextOriginX := R.Left; + + // Vertically + TextOriginY := ATopRowOffset; + Inc(ATopRowOffset, ATextParams.FullRowHeight); + if AExtra > 0 then + begin + Inc(ATopRowOffset); + Dec(AExtra); + end; + end; + end; + +var + Extra, TopRowOffset: Integer; +begin + CalcExtraAndTopRowOffset(Extra, TopRowOffset); + PlaceRows(Extra, TopRowOffset); +end; + +function cxPrepareRect(const R: TRect; const ATextParams: TcxTextParams; + ALeftIndent, ARightIndent: Integer): TRect; +begin + Result := R; + with Result do + begin + Inc(Left, ALeftIndent); + Dec(Right, ARightIndent); + end; +end; + +function cxUnprepareRect(const R: TRect; const ATextParams: TcxTextParams; + ALeftIndent: Integer = 0; ARightIndent: Integer = 0): TRect; +begin + Result := R; + with Result do + begin + Dec(Left, ALeftIndent); + Inc(Right, ARightIndent); + end; +end; + +{$WARNINGS OFF} +procedure cxTextRowsOutHighlight(AHandle: TCanvasHandle; const R: TRect; + const ATextParams: TcxTextParams; const ATextRows: TcxTextRows; ARowCount, + ASelStart, ASelLength: Integer; AColor, ATextColor: TColor; AForceEndEllipsis: Boolean); + + procedure OutTextRow(const ATextRow: TcxTextRow); + var + Stub: Integer; + begin + with ATextRow do + if ATextParams.ExpandTabs then + begin + Stub := 0; + TabbedTextOut(AHandle, TextOriginX, TextOriginY, Text, TextLength, 0, Stub, TextOriginX); + end + else + TextOut(AHandle, TextOriginX, TextOriginY, Text, TextLength); + end; + + procedure PrepareEndEllipsis(var ATextRow: TcxTextRow; var AWidth: Integer); + var + ACharNumber: Integer; + ASize: TSize; + begin + Dec(AWidth, ATextParams.EndEllipsisWidth); + if AWidth < 0 then AWidth := 0; + with ATextRow do + begin + if not GetTextExtentExPoint(AHandle, Text, TextLength, AWidth, + @ACharNumber, nil, ASize) then + ACharNumber := 0; + if ACharNumber = 0 then + ACharNumber := cxStrCharLength(Text); + TextLength := ACharNumber; + end; + cxCalcTextRowExtents(AHandle, ATextRow, ATextParams); + end; + + procedure OutEndEllipsis(const ATextRow: TcxTextRow; var ARowRect: TRect); + const + ClipTexts: array[Boolean] of UINT = (0, ETO_CLIPPED); + var + fuOptions: UINT; + begin + Inc(ARowRect.Left, ATextRow.TextExtents.cx); + if ARowRect.Left < ARowRect.Right then + begin + fuOptions := ClipTexts[not ATextParams.NoClip and (ARowRect.Left + ATextParams.EndEllipsisWidth > ARowRect.Right)]; + ExtTextOut(AHandle, ARowRect.Left, ATextRow.TextOriginY, fuOptions, + @ARowRect, PChar(cxEndEllipsisChars), + Length(cxEndEllipsisChars), nil); + end; + end; + + function GetSubstringWidth(AText: PcxCaptionChar; ATextLength, ASubstringLength: Integer): Integer; + var + ACharExtents: array of Integer; + ATextSize: TSize; + begin + if ASubstringLength = 0 then + Result := 0 + else + begin + SetLength(ACharExtents, ATextLength); + GetTextExtentExPoint(AHandle, AText, ATextLength, 0, nil, @ACharExtents[0], ATextSize); + Result := ACharExtents[ASubstringLength - 1]; + end; + end; + +var + ARowRect, AHighlightRect: TRect; + W, I, F, L: Integer; + ABreakExtra: Integer; + APrevBkMode: Integer; + ASaveTextColor: TColor; + ANeedClip, ANeedEndEllipsis: Boolean; + ATextRow: TcxTextRow; + AHighlightStart, AHighlightEnd: Integer; + ARgn, ASaveClipRgn: HRGN; + ABrush: HBRUSH; +begin + AColor := ColorToRGB(AColor); + ATextColor := ColorToRGB(ATextColor); + W := R.Right - R.Left; + ARowRect := R; + APrevBkMode := SetBkMode(AHandle, Windows.TRANSPARENT); + + if (ASelLength > 0) and (AColor <> clNone) then + ABrush := CreateSolidBrush(AColor); + + for I := 0 to ARowCount - 1 do + begin + ATextRow := ATextRows[I]; + with ATextRow do + begin + if TextLength <> 0 then + begin + ARowRect.Top := TextOriginY; + ARowRect.Bottom := ARowRect.Top + ATextParams.FullRowHeight; + ANeedEndEllipsis := ATextParams.EndEllipsis and (I = ARowCount - 1) and + ((TextExtents.cx > W) or AForceEndEllipsis); + ABreakExtra := 0; + if (ATextParams.TextAlignX in [taJustifyX, taDistributeX]) and not ANeedEndEllipsis then + begin + ABreakExtra := W - TextExtents.cX; + if (BreakCount <> 0) and (ABreakExtra > 0) then + SetTextJustification(AHandle, ABreakExtra, BreakCount); + end; + + ANeedClip := not ATextParams.NoClip and ((TextExtents.cX > W) or + (ARowRect.Top < R.Top) or (ARowRect.Bottom > R.Bottom)); + if ANeedClip then + begin + if ARowRect.Top < R.Top then ARowRect.Top := R.Top; + if ARowRect.Bottom > R.Bottom then ARowRect.Bottom := R.Bottom; + ARgn := IntersectClipRect(AHandle, ARowRect); + end; + + if ANeedEndEllipsis then + PrepareEndEllipsis(ATextRow, W); + + if ASelLength > 0 then + begin + if not ((ASelStart >= StartOffset + TextLength) or + (ASelStart + ASelLength <= StartOffset)) then + begin + F := Max(ASelStart, StartOffset); + L := Min(ASelStart + ASelLength, StartOffset + TextLength); + Dec(F, StartOffset); + Dec(L, StartOffset); + if L > F then + begin + AHighlightStart := GetSubstringWidth(Text, TextLength, F); + AHighlightEnd := GetSubstringWidth(Text, TextLength, L); + if cxGetWritingDirection(ATextParams.CharSet, Text) = coRightToLeft then + begin + AHighlightRect.Left := TextOriginX + TextExtents.cx - AHighlightEnd; + AHighlightRect.Right := TextOriginX + TextExtents.cx - AHighlightStart; + end + else + begin + AHighlightRect.Left := TextOriginX + AHighlightStart; + AHighlightRect.Right := TextOriginX + AHighlightEnd; + end; + AHighlightRect.Top := ARowRect.Top; + AHighlightRect.Bottom := ARowRect.Bottom; + if not IsRectEmpty(AHighlightRect) then + begin + ASaveClipRgn := IntersectClipRect(AHandle, AHighlightRect); + if AColor <> clNone then + FillRect(AHandle, AHighlightRect, ABrush); + ASaveTextColor := SetTextColor(AHandle, ATextColor); + OutTextRow(ATextRow); + SetTextColor(AHandle, ASaveTextColor); + RestoreClipRgn(AHandle, ASaveClipRgn); + with AHighlightRect do + ExcludeClipRect(AHandle, Left, Top, Right, Bottom); + if ANeedEndEllipsis and (ASelStart + ASelLength >= StartOffset + TextLength) then + begin + ANeedEndEllipsis := False; + ASaveTextColor := SetTextColor(AHandle, ATextColor); + OutEndEllipsis(ATextRow, ARowRect); + SetTextColor(AHandle, ASaveTextColor); + end; + end; + end; + end + end; + OutTextRow(ATextRow); + + if ANeedEndEllipsis then + OutEndEllipsis(ATextRow, ARowRect); + + if ANeedClip then + RestoreClipRgn(AHandle, ARgn); + if ABreakExtra > 0 then SetTextJustification(AHandle, 0, 0); + end + else + if AForceEndEllipsis and ATextParams.EndEllipsis and (I = ARowCount - 1) then + begin + ARowRect.Top := TextOriginY; + ARowRect.Bottom := ARowRect.Top + ATextParams.FullRowHeight; + PrepareEndEllipsis(ATextRow, W); + OutEndEllipsis(ATextRow, ARowRect); + end; + end; + end; + + if (ASelLength > 0) and (AColor <> clNone) then + DeleteObject(ABrush); + SetBkMode(AHandle, APrevBkMode); +end; +{$WARNINGS ON} + +function cxGetLongestTextRowWidth(const ATextRows: TcxTextRows; ARowCount: Integer): Integer; +var + I, V: Integer; +begin + if ARowCount > Length(ATextRows) then ARowCount := Length(ATextRows); + if ARowCount = 0 then + Result := 0 + else + begin + Result := ATextRows[0].TextExtents.cx; + for I := 1 to ARowCount - 1 do + begin + V := ATextRows[I].TextExtents.cx; + if V > Result then Result := V; + end; + end; +end; + +function cxTextOut(AHandle: TCanvasHandle; AText: PcxCaptionChar; var R: TRect; + AFormat: TcxTextOutFormat; ASelStart, ASelLength: Integer; + AColor, ATextColor: TColor; AMaxLineCount: Integer = 0; + ALeftIndent: Integer = 0; ARightIndent: Integer = 0): Integer; + + function ProcessText(const ATextParams: TcxTextParams; const ATextRect: TRect): Boolean; + begin + if ATextParams.CalcRect then + Result := (ATextRect.Right - ATextRect.Left) > 0 + else + Result := not IsRectEmpty(ATextRect); + end; + +var + ATextHeight, ARowCount, ATextLength: Integer; + ATextParams: TcxTextParams; + ATextRect: TRect; + ATextRows: TcxTextRows; + AForceEndEllipsis: Boolean; +begin + Result := 0; + ATextLength := StrLen(AText); + if ATextLength = 0 then Exit; + ATextParams := cxCalcTextParams(AHandle, AFormat); + ATextRect := cxPrepareRect(R, ATextParams, ALeftIndent, ARightIndent); + + ATextHeight := 0; + if ProcessText(ATextParams, ATextRect) then + begin + ATextRows := nil; + AForceEndEllipsis := not cxMakeTextRows(AHandle, (AText), ATextRect, ATextParams, ATextRows, ARowCount, AMaxLineCount); + if ARowCount <> 0 then + try + if ATextParams.CalcRect then + begin + if (AMaxLineCount > 0) and (AMaxLineCount < ARowCount) then + ARowCount := AMaxLineCount; + ATextRect.Right := ATextRect.Left + cxGetLongestTextRowWidth(ATextRows, ARowCount); + if not ATextParams.SingleLine then + begin + ATextRows := nil; + cxMakeTextRows(AHandle, (AText), ATextRect, ATextParams, ATextRows, ARowCount, AMaxLineCount); + end; + cxPlaceTextRows(AHandle, ATextRect, ATextParams, ATextRows, ARowCount); + ATextRect.Bottom := ATextRows[ARowCount - 1].TextOriginY + ATextParams.RowHeight; + R := cxUnprepareRect(ATextRect, ATextParams, ALeftIndent, ARightIndent); + end + else + begin + if (AMaxLineCount > 0) and (ARowCount >= AMaxLineCount) then + begin + ARowCount := AMaxLineCount; + with ATextParams do + AForceEndEllipsis := AForceEndEllipsis and EndEllipsis and EditControl and not SingleLine; + end + else + AForceEndEllipsis := False; + + cxPlaceTextRows(AHandle, ATextRect, ATextParams, ATextRows, ARowCount); + if (ASelStart < 0) or (ASelStart >= ATextLength) then + ASelLength := 0 + else + if (ASelLength + ASelStart) > ATextLength then + ASelLength := ATextLength - ASelStart; + cxTextRowsOutHighlight(AHandle, ATextRect, ATextParams, ATextRows, + ARowCount, ASelStart, ASelLength, AColor, ATextColor, AForceEndEllipsis); + end; + ATextHeight := ATextRows[ARowCount - 1].TextOriginY + ATextParams.RowHeight - ATextRect.Top; + finally + ATextRows := nil; + end; + end; + if ATextParams.CalcRowCount or (ATextHeight = 0) then + Result := ARowCount + else + Result := ATextHeight; +end; + +function cxTextOut(ACanvas: TCanvas; AText: PcxCaptionChar; var R: TRect; + AFormat: TcxTextOutFormat; ASelStart, ASelLength: Integer; + AColor, ATextColor: TColor; AMaxLineCount: Integer = 0; + ALeftIndent: Integer = 0; ARightIndent: Integer = 0): Integer; +begin + Result := cxTextOut(ACanvas.Handle, AText, R, AFormat, ASelStart, ASelLength, + AColor, ATextColor, AMaxLineCount, ALeftIndent, ARightIndent); +end; + +function cxTextOut(ACanvas: TCanvas; AText: PcxCaptionChar; var R: TRect; + AFormat: TcxTextOutFormat = CXTO_DEFAULT_FORMAT; AMaxLineCount: Integer = 0; + ALeftIndent: Integer = 0; ARightIndent: Integer = 0): Integer; +begin + Result := cxTextOut(ACanvas, AText, R, AFormat, 0, 0, ACanvas.Font.Color, clBlack, + AMaxLineCount, ALeftIndent, ARightIndent); +end; + +function cxTextOut(AHandle: TCanvasHandle; AText: PcxCaptionChar; var R: TRect; + AFormat: TcxTextOutFormat = CXTO_DEFAULT_FORMAT; AMaxLineCount: Integer = 0; + ALeftIndent: Integer = 0; ARightIndent: Integer = 0): Integer; +begin + Result := cxTextOut(AHandle, AText, R, AFormat, 0, 0, GetTextColor(AHandle), clBlack, + AMaxLineCount, ALeftIndent, ARightIndent); +end; + +initialization + cxEndEllipsisCharsLength := Length(cxEndEllipsisChars); + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxFormats.pas b/official/x.35/ExpressLibrary/Sources/cxFormats.pas new file mode 100644 index 00000000..cb50cd69 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxFormats.pas @@ -0,0 +1,1255 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxFormats; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, + Classes, cxDateUtils; + +type + IcxFormatControllerListener = interface + ['{A7F2F6D3-1A7D-4295-A6E6-9297BD83D0DE}'] + procedure FormatChanged; + end; + + IcxFormatControllerListener2 = interface + ['{5E33A2A7-0C77-415F-A359-112103E54937}'] + procedure TimeChanged; + end; + + TcxDateTimeEditMaskKind = (dtmkDate, dtmkTime, dtmkDateTime); + + TcxDateTimeFormatItemKind = ( + dtikString, + dtikYear, // YY YYYY + dtikMonth, // M MM MMM MMMM + dtikDay, // D DD DDD DDDD + dtikHour, // 12H 12HH 24H 24HH + dtikMin, // N NN + dtikSec, // S SS + dtikMSec, // Z ZZ ZZZ + dtikTimeSuffix, // A/P AM/PM AMPM (lower, upper, or mixed case) + dtikDateSeparator, + dtikTimeSeparator + ); + + TcxTimeSuffixKind = (tskAP, tskAMPM, tskAMPMString); + + TcxDateTimeFormatItem = record + Kind: TcxDateTimeFormatItemKind; + Data: string; + end; + + TcxDateTimeFormatInfo = record + DefinedItems: array[TcxDateTimeFormatItemKind] of Boolean; + Items: array of TcxDateTimeFormatItem; + end; + + TcxDateTimeFormatItemInfo = record + Kind: TcxDateTimeFormatItemKind; + ItemZoneStart, ItemZoneLength: Integer; + TimeSuffixKind: TcxTimeSuffixKind; + end; + + { TcxFormatController } + + TcxFormatController = class + private + FAssignedCurrencyFormat: Boolean; + FAssignedRegExprDateEditMask: Boolean; + FAssignedRegExprDateTimeEditMask: Boolean; + FAssignedStandardDateEditMask: Boolean; + FAssignedStandardDateTimeEditMask: Boolean; + FAssignedStartOfWeek: Boolean; + FCurrencyFormat: string; + FDateEditFormat: string; + FDateEditMask: string; + FDateFormatInfo: TcxDateTimeFormatInfo; + FDateTimeFormatInfo: TcxDateTimeFormatInfo; + FFirstWeekOfYear: TcxFirstWeekOfYear; + FList: TList; + FLockCount: Integer; + FMaskedDateEditFormat: string; + FMaskedDateTimeEditFormat: string; + FRegExprDateEditMask: string; + FRegExprDateTimeEditMask: string; + FStandardDateEditMask: string; + FStandardDateTimeEditMask: string; + FStartOfWeek: TDayOfWeek; + FTimeFormatInfo: TcxDateTimeFormatInfo; + FUseDelphiDateTimeFormats: Boolean; + procedure CalculateDateEditMasks(AUseSmartInputWhenRegExpr: Boolean); + function GetCurrencyFormat: string; + function GetDateEditFormat(AIsMasked: Boolean): string; + function GetDateTimeDisplayFormat(AMaskKind: TcxDateTimeEditMaskKind): string; + class function GetDateTimeFormatItemStandardMaskZoneLength( + const AItem: TcxDateTimeFormatItem): Integer; + function GetStartOfWeek: TDayOfWeek; + function InternalGetDateTimeEditRegExprMask( + AFormatInfo: TcxDateTimeFormatInfo; + AMaskKind: TcxDateTimeEditMaskKind): string; + function InternalGetDateTimeEditStandardMask( + AFormatInfo: TcxDateTimeFormatInfo; + AMaskKind: TcxDateTimeEditMaskKind): string; + function InternalGetMaskedDateEditFormat( + AFormatInfo: TcxDateTimeFormatInfo): string; + procedure SetAssignedCurrencyFormat(Value: Boolean); + procedure SetAssignedRegExprDateEditMask(Value: Boolean); + procedure SetAssignedRegExprDateTimeEditMask(Value: Boolean); + procedure SetAssignedStandardDateEditMask(Value: Boolean); + procedure SetAssignedStandardDateTimeEditMask(Value: Boolean); + procedure SetAssignedStartOfWeek(Value: Boolean); + procedure SetCurrencyFormat(const Value: string); + procedure SetFirstWeekOfYear(Value: TcxFirstWeekOfYear); + procedure SetRegExprDateEditMask(const Value: string); + procedure SetRegExprDateTimeEditMask(const Value: string); + procedure SetStandardDateEditMask(const Value: string); + procedure SetStandardDateTimeEditMask(const Value: string); + procedure SetStartOfWeek(Value: TDayOfWeek); + procedure SetUseDelphiDateTimeFormats(Value: Boolean); + protected + FWindow: HWND; + procedure MainWndProc(var Message: TMessage); + procedure WndProc(var Message: TMessage); virtual; + procedure FormatChanged; + procedure TimeChanged; + public + constructor Create; + destructor Destroy; override; + procedure AddListener(AListener: IcxFormatControllerListener); virtual; + procedure BeginUpdate; + procedure EndUpdate; + procedure GetFormats; + class function GetDateTimeFormatItemStandardMaskInfo( + const AFormatInfo: TcxDateTimeFormatInfo; APos: Integer; + out AItemInfo: TcxDateTimeFormatItemInfo): Boolean; + function GetDateTimeStandardMaskStringLength( + const AFormatInfo: TcxDateTimeFormatInfo): Integer; + procedure NotifyListeners; + procedure RemoveListener(AListener: IcxFormatControllerListener); virtual; + property AssignedCurrencyFormat: Boolean read FAssignedCurrencyFormat write SetAssignedCurrencyFormat; + property AssignedRegExprDateEditMask: Boolean read FAssignedRegExprDateEditMask write SetAssignedRegExprDateEditMask; + property AssignedRegExprDateTimeEditMask: Boolean read FAssignedRegExprDateTimeEditMask write SetAssignedRegExprDateTimeEditMask; + property AssignedStandardDateEditMask: Boolean read FAssignedStandardDateEditMask write SetAssignedStandardDateEditMask; + property AssignedStandardDateTimeEditMask: Boolean read FAssignedStandardDateTimeEditMask write SetAssignedStandardDateTimeEditMask; + property AssignedStartOfWeek: Boolean read FAssignedStartOfWeek write SetAssignedStartOfWeek; + property CurrencyFormat: string read FCurrencyFormat write SetCurrencyFormat; + property DateEditFormat: string read FDateEditFormat; + property DateEditMask: string read FDateEditMask; + property DateFormatInfo: TcxDateTimeFormatInfo read FDateFormatInfo; + property DateTimeFormatInfo: TcxDateTimeFormatInfo read FDateTimeFormatInfo; + property FirstWeekOfYear: TcxFirstWeekOfYear read FFirstWeekOfYear write SetFirstWeekOfYear; + property MaskedDateEditFormat: string read FMaskedDateEditFormat; + property MaskedDateTimeEditFormat: string read FMaskedDateTimeEditFormat; + property RegExprDateEditMask: string read FRegExprDateEditMask write SetRegExprDateEditMask; + property RegExprDateTimeEditMask: string read FRegExprDateTimeEditMask write SetRegExprDateTimeEditMask; + property StandardDateEditMask: string read FStandardDateEditMask write SetStandardDateEditMask; + property StandardDateTimeEditMask: string read FStandardDateTimeEditMask write SetStandardDateTimeEditMask; + property StartOfWeek: TDayOfWeek read FStartOfWeek write SetStartOfWeek; + property TimeFormatInfo: TcxDateTimeFormatInfo read FTimeFormatInfo; + property UseDelphiDateTimeFormats: Boolean read FUseDelphiDateTimeFormats write SetUseDelphiDateTimeFormats; + end; + +function cxFormatController: TcxFormatController; +function GetCharString(C: Char; ACount: Integer): string; + +implementation + +uses + SysUtils, Forms, cxClasses; + +var + FcxFormatController: TcxFormatController; + +function GetCharString(C: Char; ACount: Integer): string; +var + I: Integer; +begin + Result := ''; + for I := 1 to ACount do + Result := Result + C; +end; + +function CharLength(const S: string; Index: Integer): Integer; +begin + Result := 1; + assert((Index > 0) and (Index <= Length(S))); + if SysLocale.FarEast and (S[Index] in LeadBytes) then + Result := cxStrCharLength(S, Index); +end; + +procedure GetDateTimeFormatInfo(const AFormat: string; + var AFormatInfo: TcxDateTimeFormatInfo); +var + A12HourFormat: Boolean; + + procedure AddFormatItem(AItemKind: TcxDateTimeFormatItemKind; + const AItemData: string); + begin + if not(AItemKind in [dtikString, dtikDateSeparator, dtikTimeSeparator]) and + AFormatInfo.DefinedItems[AItemKind] then + Exit; + AFormatInfo.DefinedItems[AItemKind] := True; + SetLength(AFormatInfo.Items, Length(AFormatInfo.Items) + 1); + with AFormatInfo.Items[Length(AFormatInfo.Items) - 1] do + begin + Kind := AItemKind; + Data := AItemData; + end; + end; + + procedure AppendChars(const S: string; AStartIndex, ACount: Integer); + begin + if (Length(AFormatInfo.Items) = 0) or + (AFormatInfo.Items[Length(AFormatInfo.Items) - 1].Kind <> dtikString) then + AddFormatItem(dtikString, ''); + with AFormatInfo.Items[Length(AFormatInfo.Items) - 1] do + Data := Data + Copy(S, AStartIndex, ACount); + end; + + function GetCount(const AFormat: string; var AStartIndex: Integer; + AStartSymbol: Char): Integer; + begin + Result := 1; + while (AStartIndex <= Length(AFormat)) and (AFormat[AStartIndex] = AStartSymbol) do + begin + Inc(AStartIndex); + Inc(Result); + end; + end; + + function ParseFormat(const AFormat: string; ARecursionDepth: Integer): Boolean; + var + ACount, APrevI, I: Integer; + AFormatItemData: string; + ALastToken, AStartSymbol, AToken: Char; + AThereIsHourItem, AThereIsTimeSuffixItem: Boolean; + begin + Result := True; + if (AFormat = '') or (ARecursionDepth = 2) then + Exit; + Inc(ARecursionDepth); + ALastToken := ' '; + AThereIsHourItem := False; + AThereIsTimeSuffixItem := False; + I := 1; + while I <= Length(AFormat) do + begin + AStartSymbol := AFormat[I]; + if AStartSymbol in LeadBytes then + begin + AppendChars(AFormat, I, CharLength(AFormat, I)); + Inc(I, CharLength(AFormat, I)); + ALastToken := ' '; + Continue; + end; + Inc(I, CharLength(AFormat, I)); + AToken := AStartSymbol; + if AToken in ['a'..'z'] then + Dec(AToken, 32); + if AToken in ['A'..'Z'] then + begin + if (AToken = 'M') and (ALastToken = 'H') then + AToken := 'N'; + ALastToken := AToken; + end; + case AToken of + 'E', 'Y': + begin + ACount := GetCount(AFormat, I, AStartSymbol); + if ACount <= 2 then + AFormatItemData := 'YY' + else + AFormatItemData := 'YYYY'; + AddFormatItem(dtikYear, AFormatItemData); + end; + 'G': + begin + Result := False; + Break; + end; + 'M': + begin + ACount := GetCount(AFormat, I, AStartSymbol); + if ACount > 4 then + ACount := 4; + AddFormatItem(dtikMonth, GetCharString('M', ACount)); + end; + 'D': + begin + ACount := GetCount(AFormat, I, AStartSymbol); + case ACount of + 1..4: + AddFormatItem(dtikDay, GetCharString('D', ACount)); + 5: + Result := ParseFormat(ShortDateFormat, ARecursionDepth); + else + Result := ParseFormat(LongDateFormat, ARecursionDepth); + end; + if not Result then + Break; + end; + 'H': + begin + ACount := GetCount(AFormat, I, AStartSymbol); + if ACount > 2 then + ACount := 2; + AddFormatItem(dtikHour, GetCharString('H', ACount)); + AThereIsHourItem := True; + end; + 'N': + begin + ACount := GetCount(AFormat, I, AStartSymbol); + if ACount > 2 then + ACount := 2; + AddFormatItem(dtikMin, GetCharString('N', ACount)); + end; + 'S': + begin + ACount := GetCount(AFormat, I, AStartSymbol); + if ACount > 2 then + ACount := 2; + AddFormatItem(dtikSec, GetCharString('S', ACount)); + end; + 'T': + begin + ACount := GetCount(AFormat, I, AStartSymbol); + if ACount = 1 then + Result := ParseFormat(ShortTimeFormat, ARecursionDepth) + else + Result := ParseFormat(LongTimeFormat, ARecursionDepth); + if not Result then + Break; + end; + 'Z': + begin + ACount := GetCount(AFormat, I, AStartSymbol); + if ACount > 3 then + ACount := 3; + AddFormatItem(dtikMSec, GetCharString('Z', ACount)); + end; + 'A': + begin + if SameText(Copy(AFormat, I - 1, 5), 'AM/PM') then + begin + AddFormatItem(dtikTimeSuffix, Copy(AFormat, I - 1, 5)); + Inc(I, 4); + AThereIsTimeSuffixItem := True; + end + else if SameText(Copy(AFormat, I - 1, 3), 'A/P') then + begin + AddFormatItem(dtikTimeSuffix, Copy(AFormat, I - 1, 3)); + Inc(I, 2); + AThereIsTimeSuffixItem := True; + end + else if SameText(Copy(AFormat, I - 1, 4), 'AMPM') then + begin + AddFormatItem(dtikTimeSuffix, 'AMPM'); + Inc(I, 3); + AThereIsTimeSuffixItem := True; + end + else if SameText(Copy(AFormat, I - 1, 3), 'AAA') then + begin + if SameText(Copy(AFormat, I - 1, 4), 'AAAA') then + ACount := 4 + else + ACount := 3; + AddFormatItem(dtikDay, GetCharString('D', ACount)); + Inc(I, ACount - 1); + end + else + AppendChars(AStartSymbol, 1, 1); + end; + 'C': + begin + GetCount(AFormat, I, AStartSymbol); + Result := ParseFormat(ShortDateFormat, ARecursionDepth); + if not Result then + Break; + AppendChars(' ', 1, 1); + Result := ParseFormat(LongTimeFormat, ARecursionDepth); + if not Result then + Break; + end; + '/': + AddFormatItem(dtikDateSeparator, ''); + ':': + AddFormatItem(dtikTimeSeparator, ''); + '''', '"': + begin + APrevI := I; + while (I <= Length(AFormat)) and (AFormat[I] <> AStartSymbol) do + if AFormat[I] in LeadBytes then + Inc(I, CharLength(AFormat, I)) + else + Inc(I); + AppendChars(AFormat, APrevI, I - APrevI); + if I <= Length(AFormat) then + Inc(I); + end; + else + AppendChars(AStartSymbol, 1, 1); + end; + end; + if AThereIsHourItem then + A12HourFormat := AThereIsTimeSuffixItem; + end; + + procedure ClearFormatInfo; + var + AFormatItemKind: TcxDateTimeFormatItemKind; + begin + SetLength(AFormatInfo.Items, 0); + for AFormatItemKind := Low(TcxDateTimeFormatItemKind) to High(TcxDateTimeFormatItemKind) do + AFormatInfo.DefinedItems[AFormatItemKind] := False; + end; + + procedure ProcessHourItem; + var + I: Integer; + begin + if AFormatInfo.DefinedItems[dtikHour] then + begin + for I := 0 to Length(AFormatInfo.Items) - 1 do + if AFormatInfo.Items[I].Kind = dtikHour then + with AFormatInfo.Items[I] do + begin + if A12HourFormat then + Data := '12' + Data + else + Data := '24' + Data; + Break; + end; + end + else + if AFormatInfo.DefinedItems[dtikTimeSuffix] then + for I := 0 to Length(AFormatInfo.Items) - 1 do + if AFormatInfo.Items[I].Kind = dtikTimeSuffix then + begin + AFormatInfo.DefinedItems[dtikTimeSuffix] := False; + if I < Length(AFormatInfo.Items) - 1 then + Move(AFormatInfo.Items[I + 1], AFormatInfo.Items[I], + SizeOf(TcxDateTimeFormatItem) * Length(AFormatInfo.Items) - 1 - I); + Break; + end; + end; + +var + ARes: Boolean; +begin + ClearFormatInfo; + if AFormat <> '' then + ARes := ParseFormat(AFormat, 0) + else + ARes := ParseFormat('C', 0); + if not ARes then + ClearFormatInfo + else + ProcessHourItem; +end; + +{ TcxFormatController } + +constructor TcxFormatController.Create; +begin + inherited Create; + FList := TList.Create; + FFirstWeekOfYear := fwySystem; + FUseDelphiDateTimeFormats := False; + GetFormats; +end; + +destructor TcxFormatController.Destroy; +begin + FList.Free; + if FWindow <> 0 then + {$IFDEF DELPHI6} + Classes.DeallocateHWnd(FWindow); + {$ELSE} + Forms.DeallocateHWnd(FWindow); + {$ENDIF} + inherited Destroy; +end; + +procedure TcxFormatController.CalculateDateEditMasks( + AUseSmartInputWhenRegExpr: Boolean); +begin + GetDateTimeFormatInfo(GetDateTimeDisplayFormat(dtmkDate), FDateFormatInfo); + GetDateTimeFormatInfo(GetDateTimeDisplayFormat(dtmkTime), FTimeFormatInfo); + GetDateTimeFormatInfo(GetDateTimeDisplayFormat(dtmkDateTime), + FDateTimeFormatInfo); + + FDateEditMask := InternalGetDateTimeEditStandardMask(FDateFormatInfo, + dtmkDate); + if not FAssignedStandardDateEditMask then + FStandardDateEditMask := FDateEditMask; + + if not FAssignedRegExprDateEditMask then + begin + FRegExprDateEditMask := InternalGetDateTimeEditRegExprMask(FDateFormatInfo, dtmkDate); + if AUseSmartInputWhenRegExpr then + AddDateRegExprMaskSmartInput(FRegExprDateEditMask, False); + end; + + if not FAssignedRegExprDateTimeEditMask then + begin + FRegExprDateTimeEditMask := InternalGetDateTimeEditRegExprMask( + FDateFormatInfo, dtmkDate); + FRegExprDateTimeEditMask := FRegExprDateTimeEditMask + ' '' ''(' + + InternalGetDateTimeEditRegExprMask(FTimeFormatInfo, dtmkTime) + ')?'; + if AUseSmartInputWhenRegExpr then + AddDateRegExprMaskSmartInput(FRegExprDateTimeEditMask, True); + end; + + if not FAssignedStandardDateTimeEditMask then + FStandardDateTimeEditMask := InternalGetDateTimeEditStandardMask( + FDateTimeFormatInfo, dtmkDateTime); + + FMaskedDateEditFormat := InternalGetMaskedDateEditFormat(FDateFormatInfo); + FMaskedDateTimeEditFormat := InternalGetMaskedDateEditFormat(FDateTimeFormatInfo); +end; + +function TcxFormatController.GetCurrencyFormat: string; + + function GetPositiveCurrencyFormat(const AFormat, ACurrStr: string): string; + begin + if Length(ACurrStr) > 0 then + case Sysutils.CurrencyFormat of + 0: Result := ACurrStr + AFormat; { '$1' } + 1: Result := AFormat + ACurrStr; { '1$' } + 2: Result := ACurrStr + ' ' + AFormat; { '$ 1' } + 3: Result := AFormat + ' ' + ACurrStr; { '1 $' } + end; + end; + + function GetNegativeCurrencyFormat(const AFormat, ACurrStr: string): string; + begin + case Sysutils.NegCurrFormat of + 0: Result := '(' + ACurrStr + AFormat + ')'; + 1: Result := '-' + ACurrStr + AFormat; + 2: Result := ACurrStr + '-' + AFormat; + 3: Result := ACurrStr + AFormat + '-'; + 4: Result := '(' + AFormat + ACurrStr + ')'; + 5: Result := '-' + AFormat + ACurrStr; + 6: Result := AFormat + '-' + ACurrStr; + 7: Result := AFormat + ACurrStr + '-'; + 8: Result := '-' + AFormat + ' ' + ACurrStr; + 9: Result := '-' + ACurrStr + ' ' + AFormat; + 10: Result := AFormat + ' ' + ACurrStr + '-'; + 11: Result := ACurrStr + ' ' + AFormat + '-'; + 12: Result := ACurrStr + ' ' + '-' + AFormat; + 13: Result := AFormat + '-' + ' ' + ACurrStr; + 14: Result := '(' + ACurrStr + ' ' + AFormat + ')'; + 15: Result := '(' + AFormat + ' ' + ACurrStr + ')'; + end; + end; + +var + ACurrStr: string; + I: Integer; + C: Char; +begin + if CurrencyDecimals > 0 then + Result := GetCharString('0', CurrencyDecimals) + else + Result := ''; + Result := ',0.' + Result; + ACurrStr := ''; + for I := 1 to Length(CurrencyString) do + begin + C := CurrencyString[I]; + if (C = ',') or (C = '.') then + ACurrStr := ACurrStr + '''' + C + '''' + else + ACurrStr := ACurrStr + C; + end; + Result := GetPositiveCurrencyFormat(Result, ACurrStr) + ';' + + GetNegativeCurrencyFormat(Result, ACurrStr); +end; + +function TcxFormatController.GetDateEditFormat(AIsMasked: Boolean): string; + + procedure CorrectForMaskEdit(var S: string); + var + APos, AStartPos: Integer; + begin + APos := Pos('M', S); + if APos <> 0 then + begin + AStartPos := APos; + while APos <= Length(S) do + if S[APos] = 'M' then + Inc(APos) + else + Break; + if APos - AStartPos > 3 then + Delete(S, AStartPos + 3, APos - AStartPos - 3); + end; + end; + +var + Format: string; + I: Integer; + ExistFirst: Boolean; +begin + Format := ShortDateFormat; + Result := ''; + for I := 1 to Length(Format) do + begin + if (Format[I] = 'd') then + begin + ExistFirst := True; + if (1 < I) and (Format[I - 1] = 'd') then ExistFirst := False; + if (I < Length(Format)) and (Format[I + 1] = 'd') then ExistFirst := False; + if ExistFirst then Result := Result + 'd'; + end; + if (Format[I] = 'M') then + begin + ExistFirst := True; + if (1 < I) and (Format[I - 1] = 'M') then ExistFirst := False; + if (I < Length(Format)) and (Format[I + 1] = 'M') then ExistFirst := False; + if ExistFirst then Result := Result + 'M'; + end; + Result := Result + Format[I]; + end; + if AIsMasked then CorrectForMaskEdit(Result); +end; + +function TcxFormatController.GetDateTimeDisplayFormat( + AMaskKind: TcxDateTimeEditMaskKind): string; +begin + case AMaskKind of + dtmkDate: + Result := ShortDateFormat; + dtmkTime: + Result := LongTimeFormat; + dtmkDateTime: + Result := ShortDateFormat + ' ' + LongTimeFormat; + end; +end; + +class function TcxFormatController.GetDateTimeFormatItemStandardMaskZoneLength( + const AItem: TcxDateTimeFormatItem): Integer; +begin + case AItem.Kind of + dtikString: + Result := Length(AItem.Data); + dtikYear: + if Length(AItem.Data) = 2 then + Result := 2 + else + Result := 4; + dtikMonth, dtikDay: + if Length(AItem.Data) < 3 then + Result := 2 + else + Result := 3; + dtikHour, dtikMin, dtikSec: + Result := 2; +// dtikMSec: + dtikTimeSuffix: + begin + if UpperCase(AItem.Data) = 'A/P' then + Result := 1 + else if UpperCase(AItem.Data) = 'AM/PM' then + Result := 2 + else + begin + Result := Length(TimeAMString); + if Length(TimePMString) > Result then + Result := Length(TimePMString); + end; + end; + dtikDateSeparator, dtikTimeSeparator: + Result := 1; + else + Result := 0; + end; +end; + +function TcxFormatController.GetStartOfWeek: TDayOfWeek; +begin + Result := cxDateUtils.GetStartOfWeek; +end; + +function TcxFormatController.InternalGetDateTimeEditRegExprMask( + AFormatInfo: TcxDateTimeFormatInfo; + AMaskKind: TcxDateTimeEditMaskKind): string; + + procedure AddChar(var S: string; C: Char); + begin + if C = ' ' then + S := S + ''' ''' + else + S := S + '\' + C; + end; + + procedure AddString(var ADst: string; const ASrc: string); + begin + ADst := ADst + '''' + ASrc + ''''; + end; + + procedure ProcessDateItem(var S: string; + const AFormatItem: TcxDateTimeFormatItem); + const + reTwoDigitYearMask = '\d\d'; + reFourDigitYearMask = '\d\d\d\d'; + reMonthMask = '(0?[1-9]|1[012])'; + reDayMask = '([012]?[1-9]|[123]0|31)'; + var + AUseLongMonthNames: Boolean; + I: Integer; + begin + with AFormatItem do + case Kind of + dtikString: + AddString(S, Data); + dtikYear: + if Length(Data) = 2 then + Result := S + reTwoDigitYearMask + else + Result := S + reFourDigitYearMask; + dtikMonth: + begin + S := S + '(' + reMonthMask + '|('; + AUseLongMonthNames := Length(Data) = 4; + if AUseLongMonthNames then + AddString(S, LongMonthNames[1]) + else + AddString(S, ShortMonthNames[1]); + for I := 2 to 12 do + begin + S := S + '|'; + if AUseLongMonthNames then + AddString(S, LongMonthNames[I]) + else + AddString(S, ShortMonthNames[I]); + end; + S := S + '))'; + end; + dtikDay: + S := S + reDayMask; + dtikDateSeparator: + if DateSeparator <> #0 then + AddChar(S, DateSeparator); + end; + end; + + procedure ProcessTimeItem(var S: string; + const AFormatItem: TcxDateTimeFormatItem); + begin + with AFormatItem do + case Kind of + dtikString: + AddString(S, Data); + dtikHour: + begin + if Copy(Data, 1, 2) = '12' then + S := S + '(0?[1-9]|1[012])' + else + S := S + '([01]?\d|2[0-3])'; + end; + dtikMin: + S := S + '[0-5]?\d'; + dtikSec: + S := S + '[0-5]?\d'; +// dtikMSec: + dtikTimeSuffix: + begin + if UpperCase(Data) = 'A/P' then + S := S + '(A|P)?' + else if UpperCase(Data) = 'AM/PM' then + S := S + '(AM|PM)?' + else + if (TimeAMString <> '') or (TimePMString <> '') then + begin + S := S + '('''; + if (TimeAMString <> '') and (TimePMString <> '') then + S := S + TimeAMString + '''|''' + TimePMString + else + if TimeAMString <> '' then + S := S + TimeAMString + else + S := S + TimePMString; + S := S + ''')?'; + end; + end; + dtikTimeSeparator: + if TimeSeparator <> #0 then + AddChar(S, TimeSeparator); + end; + end; + +var + I: Integer; +begin + Result := ''; + if (AMaskKind = dtmkDateTime) or (Length(AFormatInfo.Items) = 0) then + Exit; + for I := 0 to Length(AFormatInfo.Items) - 1 do + if AMaskKind = dtmkDate then + ProcessDateItem(Result, AFormatInfo.Items[I]) + else + ProcessTimeItem(Result, AFormatInfo.Items[I]); +end; + +function TcxFormatController.InternalGetDateTimeEditStandardMask( + AFormatInfo: TcxDateTimeFormatInfo; + AMaskKind: TcxDateTimeEditMaskKind): string; + + procedure AddChar(var S: string; C: Char); + begin + S := S + '\' + C; + end; + +var + I, J: Integer; +begin + Result := ''; + if Length(AFormatInfo.Items) = 0 then + Exit; + if AMaskKind <> dtmkTime then + Result := '!'; + for I := 0 to Length(AFormatInfo.Items) - 1 do + with AFormatInfo.Items[I] do + case Kind of + dtikString: + for J := 1 to Length(Data) do + AddChar(Result, Data[J]); + dtikYear: + if Length(Data) = 2 then + Result := Result + '99' + else + Result := Result + '9999'; + dtikMonth: + if Length(Data) < 3 then + Result := Result + '99' + else + Result := Result + 'lll'; + dtikDay: + if Length(Data) < 3 then + Result := Result + '99' + else + Result := Result + 'lll'; + dtikHour, dtikMin, dtikSec: + if AMaskKind = dtmkTime then + Result := Result + '00' + else + Result := Result + '99'; +// dtikMSec: + dtikTimeSuffix: + begin + if UpperCase(Data) = 'A/P' then + Result := Result + 'c' + else if UpperCase(Data) = 'AM/PM' then + Result := Result + 'cc' + else + begin + J := Length(TimeAMString); + if Length(TimePMString) > J then + J := Length(TimePMString); + Result := Result + GetCharString('c', J); + end; + end; + dtikDateSeparator: + Result := Result + '/'; + dtikTimeSeparator: + Result := Result + ':'; + end; + if AMaskKind = dtmkTime then + Result := Result + ';1;0' + else + Result := Result + ';1; '; +end; + +function TcxFormatController.InternalGetMaskedDateEditFormat( + AFormatInfo: TcxDateTimeFormatInfo): string; +var + I: Integer; +begin + Result := ''; + for I := 0 to Length(AFormatInfo.Items) - 1 do + with AFormatInfo.Items[I] do + case Kind of + dtikString: + Result := Result + '''' + Data + ''''; + dtikYear: + Result := Result + LowerCase(Data); + dtikMonth: + if Length(Data) < 3 then + Result := Result + 'mm' + else + Result := Result + 'mmm'; + dtikDay: + if Length(Data) < 3 then + Result := Result + 'dd' + else + Result := Result + 'ddd'; + dtikHour: + Result := Result + 'hh'; + dtikMin: + Result := Result + 'nn'; + dtikSec: + Result := Result + 'ss'; +// dtikMSec: + dtikTimeSuffix: + Result := Result + LowerCase(Data); + dtikDateSeparator: + Result := Result + '/'; + dtikTimeSeparator: + Result := Result + ':'; + end; +end; + +procedure TcxFormatController.AddListener( + AListener: IcxFormatControllerListener); +begin + with FList do + if IndexOf(Pointer(AListener)) = -1 then + begin + if Count = 0 then + {$IFDEF DELPHI6} + FWindow := Classes.AllocateHWnd(MainWndProc); + {$ELSE} + FWindow := Forms.AllocateHWnd(MainWndProc); + {$ENDIF} + Add(Pointer(AListener)); + end; +end; + +procedure TcxFormatController.RemoveListener( + AListener: IcxFormatControllerListener); +begin + FList.Remove(Pointer(AListener)); + if FList.Count = 0 then + begin + {$IFDEF DELPHI6} + Classes.DeallocateHWnd(FWindow); + {$ELSE} + Forms.DeallocateHWnd(FWindow); + {$ENDIF} + FWindow := 0; + end; +end; + +procedure TcxFormatController.GetFormats; +begin + if FcxFormatController = nil then // to avoid stack overflow + FcxFormatController := Self; + if not FAssignedCurrencyFormat then + FCurrencyFormat := GetCurrencyFormat; + if not FAssignedStartOfWeek then + FStartOfWeek := GetStartOfWeek; + + CalculateDateEditMasks(True); + FDateEditFormat := GetDateEditFormat(False); +end; + +class function TcxFormatController.GetDateTimeFormatItemStandardMaskInfo( + const AFormatInfo: TcxDateTimeFormatInfo; APos: Integer; + out AItemInfo: TcxDateTimeFormatItemInfo): Boolean; + + function GetTimeSuffixKind(const AFormatItemData: string): TcxTimeSuffixKind; + begin + if UpperCase(AFormatItemData) = 'A/P' then + Result := tskAP + else if UpperCase(AFormatItemData) = 'AM/PM' then + Result := tskAMPM + else + Result := tskAMPMString; + end; + +var + AItemZoneStart, I: Integer; + AItemZoneStarts: array of Integer; +begin + Result := False; + if (APos < 1) or (Length(AFormatInfo.Items) = 0) then + Exit; + SetLength(AItemZoneStarts, Length(AFormatInfo.Items)); + AItemZoneStart := 1; + for I := 0 to Length(AFormatInfo.Items) - 1 do + begin + AItemZoneStarts[I] := AItemZoneStart; + Inc(AItemZoneStart, GetDateTimeFormatItemStandardMaskZoneLength(AFormatInfo.Items[I])); + if APos < AItemZoneStart then + begin + AItemInfo.Kind := AFormatInfo.Items[I].Kind; + AItemInfo.ItemZoneStart := AItemZoneStarts[I]; + AItemInfo.ItemZoneLength := AItemZoneStart - AItemZoneStarts[I]; + if AItemInfo.Kind = dtikTimeSuffix then + AItemInfo.TimeSuffixKind := GetTimeSuffixKind(AFormatInfo.Items[I].Data); + Result := True; + Break; + end; + end; +end; + +function TcxFormatController.GetDateTimeStandardMaskStringLength( + const AFormatInfo: TcxDateTimeFormatInfo): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Length(AFormatInfo.Items) - 1 do + Inc(Result, GetDateTimeFormatItemStandardMaskZoneLength(AFormatInfo.Items[I])); +end; + +procedure TcxFormatController.NotifyListeners; +var + I: Integer; +begin + for I := 0 to FList.Count - 1 do + IcxFormatControllerListener(FList[I]).FormatChanged; +end; + +procedure TcxFormatController.MainWndProc(var Message: TMessage); +begin + try + WndProc(Message); + except + Application.HandleException(Self); + end; +end; + +procedure TcxFormatController.WndProc(var Message: TMessage); +begin + if (Message.Msg = WM_SETTINGCHANGE) and ((Message.WParam = 0) and + (PChar(Message.LParam) = 'intl')) and + Application.UpdateFormatSettings then + begin + SysUtils.GetFormatSettings; + GetFormats; + NotifyListeners; + Message.Result := 0; + Exit; + end; + if Message.Msg = WM_TIMECHANGE then + begin + TimeChanged; + Message.Result := 0; + Exit; + end; + with Message do Result := DefWindowProc(FWindow, Msg, wParam, lParam); +end; + +procedure TcxFormatController.BeginUpdate; +begin + Inc(FLockCount); +end; + +procedure TcxFormatController.EndUpdate; +begin + Dec(FLockCount); + if FLockCount = 0 then + NotifyListeners; +end; + +procedure TcxFormatController.FormatChanged; +begin + if FLockCount = 0 then + begin + GetFormats; + NotifyListeners; + end; +end; + +procedure TcxFormatController.TimeChanged; +var + I: Integer; + AIntf: IcxFormatControllerListener2; +begin + for I := 0 to FList.Count - 1 do + if Supports(IcxFormatControllerListener(FList[I]), + IcxFormatControllerListener2, AIntf) then + AIntf.TimeChanged; +end; + +function cxFormatController: TcxFormatController; +begin + if FcxFormatController = nil then + FcxFormatController := TcxFormatController.Create; + Result := FcxFormatController; +end; + +procedure TcxFormatController.SetAssignedCurrencyFormat(Value: Boolean); +begin + if FAssignedCurrencyFormat <> Value then + begin + FAssignedCurrencyFormat := Value; + FormatChanged; + end; +end; + +procedure TcxFormatController.SetAssignedRegExprDateEditMask(Value: Boolean); +begin + if FAssignedRegExprDateEditMask <> Value then + begin + FAssignedRegExprDateEditMask := Value; + FormatChanged; + end; +end; + +procedure TcxFormatController.SetAssignedRegExprDateTimeEditMask(Value: Boolean); +begin + if FAssignedRegExprDateTimeEditMask <> Value then + begin + FAssignedRegExprDateTimeEditMask := Value; + FormatChanged; + end; +end; + +procedure TcxFormatController.SetAssignedStandardDateEditMask(Value: Boolean); +begin + if FAssignedStandardDateEditMask <> Value then + begin + FAssignedStandardDateEditMask := Value; + FormatChanged; + end; +end; + +procedure TcxFormatController.SetAssignedStandardDateTimeEditMask(Value: Boolean); +begin + if FAssignedStandardDateTimeEditMask <> Value then + begin + FAssignedStandardDateTimeEditMask := Value; + FormatChanged; + end; +end; + +procedure TcxFormatController.SetAssignedStartOfWeek(Value: Boolean); +begin + if FAssignedStartOfWeek <> Value then + begin + FAssignedStartOfWeek := Value; + FormatChanged; + end; +end; + +procedure TcxFormatController.SetCurrencyFormat(const Value: string); +begin + FAssignedCurrencyFormat := True; + if FCurrencyFormat <> Value then + begin + FCurrencyFormat := Value; + FormatChanged; + end; +end; + +procedure TcxFormatController.SetFirstWeekOfYear(Value: TcxFirstWeekOfYear); +begin + if Value <> FFirstWeekOfYear then + begin + FFirstWeekOfYear := Value; + FormatChanged; + end; +end; + +procedure TcxFormatController.SetRegExprDateEditMask(const Value: string); +begin + FAssignedRegExprDateEditMask := True; + if FRegExprDateEditMask <> Value then + begin + FRegExprDateEditMask := Value; + FormatChanged; + end; +end; + +procedure TcxFormatController.SetRegExprDateTimeEditMask(const Value: string); +begin + FAssignedRegExprDateTimeEditMask := True; + if FRegExprDateTimeEditMask <> Value then + begin + FRegExprDateTimeEditMask := Value; + FormatChanged; + end; +end; + +procedure TcxFormatController.SetStandardDateEditMask(const Value: string); +begin + FAssignedStandardDateEditMask := True; + if FStandardDateEditMask <> Value then + begin + FStandardDateEditMask := Value; + FormatChanged; + end; +end; + +procedure TcxFormatController.SetStandardDateTimeEditMask(const Value: string); +begin + FAssignedStandardDateTimeEditMask := True; + if FStandardDateTimeEditMask <> Value then + begin + FStandardDateTimeEditMask := Value; + FormatChanged; + end; +end; + +procedure TcxFormatController.SetStartOfWeek(Value: TDayOfWeek); +begin + FAssignedStartOfWeek := True; + if FStartOfWeek <> Value then + begin + FStartOfWeek := Value; + FormatChanged; + end; +end; + +procedure TcxFormatController.SetUseDelphiDateTimeFormats(Value: Boolean); +begin + if FUseDelphiDateTimeFormats <> Value then + begin + FUseDelphiDateTimeFormats := Value; + FormatChanged; + if Value then + MinYear := 1 + else + MinYear := 100; + end; +end; + +initialization + +finalization + FcxFormatController.Free; + FcxFormatController := nil; + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxGeometry.pas b/official/x.35/ExpressLibrary/Sources/cxGeometry.pas new file mode 100644 index 00000000..681c5c3b --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxGeometry.pas @@ -0,0 +1,1063 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Common Editing Library } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE COMMONEDITINGLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGeometry; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes; + +type + TcxPtInRectType = (ptrtNone, ptrtArea, ptrtLeft, ptrtTop, ptrtRight, ptrtBottom); + + { TcxRect } + + TcxRect = class(TPersistent) + private + FOwner: TPersistent; + FRect: TRect; + FOnChange: TNotifyEvent; + function GetData: Pointer; + function GetHeight: Integer; + function GetVertex(AIndex: Integer): TPoint; + function GetWidth: Integer; + procedure SetHeight(AValue: Integer); + procedure SetRect(const AValue: TRect); + procedure SetVertex(AIndex: Integer; const AValue: TPoint); + procedure SetWidth(AValue: Integer); + protected + procedure DoChange; + function GetOwner: TPersistent; override; + public + constructor Create(AOwner: TPersistent); virtual; + procedure Assign(Source: TPersistent); override; + + function GetValue(AIndex: Integer): Integer; + procedure SetValue(AIndex, AValue: Integer); + + function IsEmpty: Boolean; + function IsEqual(const ARect: TRect): Boolean; overload; + function IsEqual(ARect: TcxRect): Boolean; overload; + + property BottomLeft: TPoint index 2 read GetVertex write SetVertex; + property BottomRight: TPoint index 3 read GetVertex write SetVertex; + property Data: Pointer read GetData; + property Height: Integer read GetHeight write SetHeight; + property Rect: TRect read FRect write SetRect; + property TopLeft: TPoint index 0 read GetVertex write SetVertex; + property TopRight: TPoint index 1 read GetVertex write SetVertex; + property Width: Integer read GetWidth write SetWidth; + published + property Left: Integer index 0 read GetValue write SetValue default 0; + property Top: Integer index 1 read GetValue write SetValue default 0; + property Right: Integer index 2 read GetValue write SetValue default 0; + property Bottom: Integer index 3 read GetValue write SetValue default 0; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + end; + + { TcxSize } + + TcxSize = class(TPersistent) + private + FOwner: TPersistent; + FSize: TSize; + FOnChange: TNotifyEvent; + function GetData: Pointer; + function GetSize: TSize; + procedure SetValue(Index, Value: Integer); + protected + procedure DoChange; virtual; + function GetOwner: TPersistent; override; + function GetValue(Index: Integer): Integer; virtual; + function IsSizeStored(Index: Integer): Boolean; virtual; + procedure SetSize(const Value: TSize); virtual; + public + constructor Create(AOwner: TPersistent); + procedure Assign(Source: TPersistent); override; + + function IsEmpty: Boolean; + function IsEqual(const ASize: TSize): Boolean; overload; + function IsEqual(ASize: TcxSize): Boolean; overload; + + property Data: Pointer read GetData; + property Size: TSize read GetSize write SetSize; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + published + property Height: Integer index 0 read GetValue write SetValue stored IsSizeStored; + property Width: Integer index 1 read GetValue write SetValue stored IsSizeStored; + end; + +// rect helper routines +function cxRectCompare(const R1, R2: TRect): Boolean; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectCenter(const R: TRect): TPoint; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectCenter(const Bounds: TRect; const ASize: TSize): TRect; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectCenter(const Bounds: TRect; Width, Height: Integer): TRect; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectContain(const ABounds, AInner: TRect): Boolean; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectContent(const R, Margins: TRect): TRect; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectHeight(const R: TRect): Integer; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectIntersect(const R1, R2: TRect): Boolean; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectIntersect(out R: TRect; const R1, R2: TRect): Boolean; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectInflate(const R: TRect; DX, DY: Integer): TRect; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectInflate(const R: TRect; DX1, DY1, DX2, DY2: Integer): TRect; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectInvert(const R: TRect): TRect; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectIsEmpty(const R: TRect): Boolean; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectIsEqual(const R, R1: TRect): Boolean; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectIsInvalid(const R: TRect): Boolean; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectIsNull(const R: TRect): Boolean; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectGetItem(const ARect: TRect; AIndex: Integer): Integer; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectGetSize(const ARect: TRect; AIndex: Integer): Integer; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectLeftBottom(const R: TRect): TPoint; {$IFDEF DELPHI9} inline; {$ENDIF} +procedure cxRectMinMaxHeight(const R: TRect; var AMax, AMin: Integer); {$IFDEF DELPHI9} inline; {$ENDIF} +procedure cxRectMinMaxInit(var AMin, AMax: Integer); {$IFDEF DELPHI9} inline; {$ENDIF} +procedure cxRectMinMaxWidth(const R: TRect; var AMax, AMin: Integer); {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectOffset(const R: TRect; const P: TPoint): TRect; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectOffset(const R: TRect; const Ps: array of TPoint): TRect; overload; +function cxRectOffset(const R: TRect; DX, DY: Integer): TRect; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectOffsetHorz(const R: TRect; DX: Integer): TRect; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectOffsetVert(const R: TRect; DY: Integer): TRect; {$IFDEF DELPHI9} inline; {$ENDIF} +procedure cxRectOverlapped(const Src, Dst: TRect; out SrcH, SrcV, DstH, DstV: TRect); +function cxRectPtIn(const R: TRect; const P: TPoint): Boolean; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectPtIn(const R: TRect; const X, Y: Integer): Boolean; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectPtInEx(const R: TRect; X, Y, Delta: Integer): TcxPtInRectType; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectPtInEx(const R: TRect; X, Y, DeltaX, DeltaY: Integer): TcxPtInRectType; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectPtInEx(const R: TRect; const X, Y: Integer; DL, DT, DR, DB: Integer): TcxPtInRectType; overload; +function cxRectRotate(const R: TRect): TRect; +function cxRect(const Left, Top, Right, Bottom: Integer): TRect; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRect(const TopLeft, BottomRight: TPoint): TRect; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectBounds(Left, Top, Width, Height: Integer): TRect; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectRightTop(const R: TRect): TPoint; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectScaleHeight(const R: TRect; Y1, Y2, H1, H2: Integer): TRect; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectScaleWidth(const R: TRect; X1, X2, W1, W2: Integer): TRect; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectSetBottom(const R: TRect; Y: Integer): TRect; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectSetBottom(const R: TRect; Y, H: Integer): TRect; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectSetHeight(const R: TRect; H: Integer): TRect; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectSetLeft(const R: TRect; X: Integer): TRect; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectSetLeft(const R: TRect; X, W: Integer): TRect; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectSetTop(const R: TRect; Y: Integer): TRect; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectSetTop(const R: TRect; Y, H: Integer): TRect; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectSetRight(const R: TRect; X: Integer): TRect; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectSetRight(const R: TRect; X, W: Integer): TRect; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectSetSize(const R: TRect; W, H: Integer): TRect; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectSetWidth(const R: TRect; W: Integer): TRect; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectSetWidth(const R: TRect; X, W: Integer): TRect; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectSetXPos(const R: TRect; X1, X2: Integer): TRect; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectSetYPos(const R: TRect; Y1, Y2: Integer): TRect; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectSize(const R: TRect): TSize; {$IFDEF DELPHI9} inline; {$ENDIF} +procedure cxRectSplitHorz(const ABounds: TRect; var ARect1, ARect2: TRect); {$IFDEF DELPHI9} inline; {$ENDIF} +procedure cxRectSplitVert(const ABounds: TRect; var ARect1, ARect2: TRect); {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectUnion(const R1, R2: TRect): TRect; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxRectWidth(const R: TRect): Integer; {$IFDEF DELPHI9} inline; {$ENDIF} + +// point helper routines +function cxPointInvert(const P: TPoint): TPoint; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxPointIsEqual(const P1, P2: TPoint): Boolean; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxPointIsNull(const P: TPoint): Boolean; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxPointGetItem(const P: TPoint; AIndex: Integer): Integer; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxPoint(X, Y: Integer): TPoint; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxPoint(const ASize: TSize): TPoint; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxPointOffset(const P, DP: TPoint): TPoint; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxPointOffset(const P: TPoint; const Ps: array of TPoint): TPoint; overload; +function cxPointOffset(const P: TPoint; X, Y: Integer): TPoint; overload; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxPointReplaceItem(const P: TPoint; const AIndex, AValue: Integer): TPoint; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxPointSum(const Ps: array of TPoint): TPoint; + +function cxSize(DX, DY: Integer): TSize; {$IFDEF DELPHI9} inline; {$ENDIF} +function cxSizeIsEqual(const S1, S2: TSize): Boolean; {$IFDEF DELPHI9} inline; {$ENDIF} + +const + cxInvalidRect: TRect = (Left: -1; Top: -1; Right: -1; Bottom: -1); + cxSimpleRect: TRect = (Left: 1; Top: 1; Right: 1; Bottom: 1); + cxInvalidPoint: TPoint = (X: -1; Y: -1); + +var + cxNullRect: TRect; + cxNullSize: TSize; + cxNullPoint: TPoint; + +implementation + +uses + Math; + +{ TcxRect } + +constructor TcxRect.Create(AOwner: TPersistent); +begin + inherited Create; + FOwner := AOwner; +end; + +procedure TcxRect.Assign(Source: TPersistent); +begin + if Source is TcxRect then + Rect := TcxRect(Source).Rect; +end; + +procedure TcxRect.DoChange; +begin + if Assigned(FOnChange) then + FOnChange(Self); +end; + +function TcxRect.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +function TcxRect.IsEmpty: Boolean; +begin + Result := cxRectIsEmpty(FRect); +end; + +function TcxRect.IsEqual(const ARect: TRect): Boolean; +begin + Result := cxRectIsEqual(ARect, FRect); +end; + +function TcxRect.IsEqual(ARect: TcxRect): Boolean; +begin + Result := IsEqual(ARect.Rect); +end; + +function TcxRect.GetData: Pointer; +begin + Result := @FRect; +end; + +function TcxRect.GetHeight: Integer; +begin + Result := FRect.Bottom - FRect.Top; +end; + +function TcxRect.GetValue(AIndex: Integer): Integer; +begin + case AIndex of + 0: + Result := FRect.Left; + 1: + Result := FRect.Top; + 2: + Result := FRect.Right; + else + Result := FRect.Bottom; + end; +end; + +function TcxRect.GetVertex(AIndex: Integer): TPoint; +begin + case AIndex of + 0: + Result := FRect.TopLeft; + 1: + Result := Point(FRect.Right, FRect.Top); + 2: + Result := Point(FRect.Left, FRect.Bottom); + else + Result := FRect.BottomRight; + end; +end; + +function TcxRect.GetWidth: Integer; +begin + Result := FRect.Right - FRect.Left; +end; + +procedure TcxRect.SetHeight(AValue: Integer); +begin + Bottom := Top + AValue; +end; + +procedure TcxRect.SetRect(const AValue: TRect); +begin + if not IsEqual(AValue) then + begin + FRect := AValue; + DoChange; + end; +end; + +procedure TcxRect.SetValue(AIndex, AValue: Integer); +var + ARect: TRect; +begin + ARect := Rect; + case AIndex of + 0: + ARect.Left := AValue; + 1: + ARect.Top := AValue; + 2: + ARect.Right := AValue; + 3: + ARect.Bottom := AValue; + end; + Rect := ARect; +end; + +procedure TcxRect.SetVertex(AIndex: Integer; const AValue: TPoint); +var + ARect: TRect; +begin + ARect := Rect; + case AIndex of + 0: + ARect.TopLeft := AValue; + 1: + begin + ARect.Right := AValue.X; + ARect.Top := AValue.Y; + end; + 2: + begin + ARect.Left := AValue.X; + ARect.Bottom := AValue.Y; + end; + 3: + ARect.BottomRight := AValue; + end; + Rect := ARect; +end; + +procedure TcxRect.SetWidth(AValue: Integer); +begin + Right := Left + AValue; +end; + +{ TcxSize } + +constructor TcxSize.Create(AOwner: TPersistent); +begin + inherited Create; + FOwner := AOwner; +end; + +procedure TcxSize.Assign(Source: TPersistent); +begin + if Source is TcxSize then + Size := TcxSize(Source).Size + else + inherited Assign(Source); +end; + +function TcxSize.GetValue(Index: Integer): Integer; +begin + if Index = 0 then + Result := FSize.cy + else + Result := FSize.cx; +end; + +function TcxSize.GetSize: TSize; +begin + Result.cx := Width; + Result.cy := Height; +end; + +procedure TcxSize.SetValue(Index, Value: Integer); +var + ASize: TSize; +begin + ASize := Size; + if Index = 0 then + ASize.cy := Value + else + ASize.cx := Value; + Size := ASize; +end; + +function TcxSize.IsEmpty: Boolean; +begin + Result := (FSize.cx = 0) and (FSize.cy = 0); +end; + +function TcxSize.IsEqual(const ASize: TSize): Boolean; +begin + Result := cxSizeIsEqual(ASize, FSize); +end; + +function TcxSize.IsEqual(ASize: TcxSize): Boolean; +begin + Result := IsEqual(ASize.Size); +end; + +procedure TcxSize.DoChange; +begin + if Assigned(FOnChange) then + FOnChange(Self); +end; + +function TcxSize.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +function TcxSize.GetData: Pointer; +begin + Result := @FSize; +end; + +function TcxSize.IsSizeStored(Index: Integer): Boolean; +begin + if Index = 0 then + Result := FSize.cy <> 0 + else + Result := FSize.cx <> 0; +end; + +procedure TcxSize.SetSize(const Value: TSize); +var + ASize: TSize; +begin + ASize.cx := Max(0, Value.cx); + ASize.cy := Max(0, Value.cy); + if not IsEqual(ASize) then + begin + FSize := ASize; + DoChange; + end; +end; + +function cxRectHeight(const R: TRect): Integer; +begin + Result := R.Bottom - R.Top; +end; + +function cxRectIntersect(const R1, R2: TRect): Boolean; +var + R: TRect; +begin + Result := cxRectIntersect(R, R1, R2); +end; + +function cxRectIntersect(out R: TRect; const R1, + R2: TRect): Boolean; +begin + R := R1; + with R do + begin + if R2.Left > R1.Left then Left := R2.Left; + if R2.Top > R1.Top then Top := R2.Top; + if R2.Right < R1.Right then Right := R2.Right; + if R2.Bottom < R1.Bottom then Bottom := R2.Bottom; + Result := not ((Right <= Left) or (Bottom <= Top)); + end; + if not Result then R := cxNullRect; +end; + +function cxRectInflate(const R: TRect; DX, DY: Integer): TRect; +begin + Result := cxRectInflate(R, DX, DY, DX, DY); +end; + +function cxRectInflate(const R: TRect; DX1, DY1, DX2, DY2: Integer): TRect; +begin + Result := R; + with Result do + begin + Dec(Left, DX1); + Dec(Top, DY1); + Inc(Right, DX2); + Inc(Bottom, DY2); + end; +end; + +function cxRectInvert(const R: TRect): TRect; +begin + Result.TopLeft := cxPointInvert(R.TopLeft); + Result.BottomRight := cxPointInvert(R.BottomRight); +end; + +function cxRectIsEmpty(const R: TRect): Boolean; +begin + with R do + Result := (Right <= Left) or (Bottom <= Top); +end; + +function cxRectIsEqual(const R, R1: TRect): Boolean; +begin + Result := (R.Left = R1.Left) and (R.Top = R1.Top) and + (R.Right = R1.Right) and (R.Bottom = R1.Bottom); +end; + +function cxRectIsInvalid(const R: TRect): Boolean; +begin + Result := cxRectIsEqual(R, cxInvalidRect); +end; + +function cxRectIsNull(const R: TRect): Boolean; +begin + Result := (R.Left = 0) and (R.Top = 0) and (R.Right = 0) and (R.Bottom = 0); +end; + +function cxRectGetItem(const ARect: TRect; AIndex: Integer): Integer; +begin + case AIndex of + 0: + Result := ARect.Left; + 1: + Result := ARect.Top; + 2: + Result := ARect.Right; + 3: + Result := ARect.Bottom; + else + Result := 0 + end; +end; + +function cxRectGetSize(const ARect: TRect; AIndex: Integer): Integer; +begin + if AIndex = 0 then + Result := ARect.Right - ARect.Left + else + Result := ARect.Bottom - ARect.Top; +end; + +function cxRectLeftBottom(const R: TRect): TPoint; +begin + Result := cxPoint(R.Left, R.Bottom); +end; + +procedure cxRectMinMaxHeight(const R: TRect; var AMax, AMin: Integer); +begin + with R do + begin + if AMax < Bottom then AMax := Bottom; + if AMin > Top then AMin := Top; + end; +end; + +procedure cxRectMinMaxInit(var AMin, AMax: Integer); +begin + AMin := MaxInt; + AMax := -1; +end; + +procedure cxRectMinMaxWidth(const R: TRect; var AMax, AMin: Integer); +begin + with R do + begin + if AMax < Right then AMax := Right; + if AMin > Left then AMin := Left; + end; +end; + +function cxRectOffset(const R: TRect; const P: TPoint): TRect; +begin + Result := cxRectOffset(R, P.X, P.Y); +end; + +function cxRectOffset(const R: TRect; DX, DY: Integer): TRect; +begin + Result := R; + with Result do + begin + Inc(Left, DX); + Inc(Top, DY); + Inc(Right, DX); + Inc(Bottom, DY); + end; +end; + +function cxRectOffset(const R: TRect; const Ps: array of TPoint): TRect; +begin + with cxPointSum(Ps) do + Result := cxRectOffset(R, X, Y); +end; + +function cxRectOffsetHorz(const R: TRect; DX: Integer): TRect; +begin + Result := R; + Inc(Result.Left, DX); + Inc(Result.Right, DX); +end; + +function cxRectOffsetVert(const R: TRect; DY: Integer): TRect; +begin + Result := R; + Inc(Result.Top, DY); + Inc(Result.Bottom, DY); +end; + +function GetRectCoordinate(const R: TRect; ABottomRight, AVertCoordinate: Boolean): Integer; +begin + if ABottomRight then + if AVertCoordinate then + Result := R.Bottom + else + Result := R.Right + else + if AVertCoordinate then + Result := R.Top + else + Result := R.Left; +end; + +procedure SetRectCoordinate(var R: TRect; ABottomRight, AVertCoordinate: Boolean; AValue: Integer); +begin + if ABottomRight then + if AVertCoordinate then + R.Bottom := AValue + else + R.Right := AValue + else + if AVertCoordinate then + R.Top := AValue + else + R.Left := AValue; +end; + +procedure cxRectOverlapped(const Src, Dst: TRect; out SrcH, SrcV, DstH, DstV: TRect); +var + H, W: Integer; + + procedure IncV(const ARect: TRect; AVertCoordinate, ABottomRight: Boolean; + Value: Integer; out AResult: TRect); + begin + if Value <> 0 then + begin + AResult := ARect; + SetRectCoordinate(AResult, ABottomRight, AVertCoordinate, + GetRectCoordinate(AResult, not ABottomRight, AVertCoordinate) + Value); + end + else + AResult := cxNullRect; + end; + +begin + H := Src.Bottom - Dst.Bottom; + W := Src.Right - Dst.Right; + IncV(Src, True, H < 0, -H, SrcH); + IncV(Dst, True, H > 0, H, DstH); + IncV(Src, False, W < 0, -W, SrcV); + IncV(Dst, False, W > 0, W, DstV); +end; + +function cxRectPtIn(const R: TRect; const P: TPoint): Boolean; +begin + Result := cxRectPtIn(R, P.X, P.Y); +end; + +function cxRectPtIn(const R: TRect; const X, Y: Integer): Boolean; +begin + with R do + Result := (X >= Left) and (X < Right) and (Y >= Top) and (Y < Bottom); +end; + +function cxRectPtInEx(const R: TRect; + const X, Y: Integer; DL, DT, DR, DB: Integer): TcxPtInRectType; + + function InRange(V, V1, V2: Integer): Boolean; + begin + V := V - V1; + Result := (V >= -V2) and (V < V2); + end; + +begin + if cxRectPtIn(R, X, Y) then + Result := ptrtArea + else + if cxRectPtIn(cxRectInflate(R, DL, DT, DR, DB), X, Y) then + begin + with R do + begin + if InRange(X, Right, DR) then + Result := ptrtRight + else + if InRange(Y, Bottom, DB) then + Result := ptrtBottom + else + if InRange(X, Left, DL) then + Result := ptrtLeft + else + Result := ptrtTop; + end; + end + else + Result := ptrtNone; +end; + +function cxRectRotate(const R: TRect): TRect; +begin + Result := Rect(R.Top, R.Left, R.Bottom, R.Right); +end; + +function cxRectPtInEx(const R: TRect; X, Y, Delta: Integer): TcxPtInRectType; +begin + Result := cxRectPtInEx(R, X, Y, Delta, Delta, Delta, Delta); +end; + +function cxRectPtInEx(const R: TRect; + X, Y, DeltaX, DeltaY: Integer): TcxPtInRectType; +begin + Result := cxRectPtInEx(R, X, Y, DeltaX, DeltaY, DeltaX, DeltaY); +end; + +function cxRect(const Left, Top, Right, Bottom: Integer): TRect; +begin + Result.Left := Left; + Result.Top := Top; + Result.Right := Right; + Result.Bottom := Bottom; +end; + +function cxRect(const TopLeft, BottomRight: TPoint): TRect; +begin + Result.TopLeft := TopLeft; + Result.BottomRight := BottomRight; +end; + +function cxRectBounds(Left, Top, Width, Height: Integer): TRect; +begin + Result.Left := Left; + Result.Top := Top; + Result.Right := Left + Width; + Result.Bottom := Top + Height; +end; + +function cxRectRightTop(const R: TRect): TPoint; +begin + Result := cxPoint(R.Right, R.Top); +end; + +function cxRectScaleHeight(const R: TRect; Y1, Y2, H1, H2: Integer): TRect; +var + H: Integer; +begin + Result := R; + with Result do + begin + H := MulDiv(Bottom - Top, H2, H1); + Top := MulDiv(Y1 - Top, H2, H1) + Y2; + Bottom := Top + H; + end; +end; + +function cxRectScaleWidth(const R: TRect; X1, X2, W1, + W2: Integer): TRect; +var + L: Integer; +begin + Result := R; + with Result do + begin + L := MulDiv(Right - Left, W2, W1); + Left := MulDiv(X1 - Left, W2, W1) + X2; + Right := Left + L; + end; +end; + +function cxRectSetBottom(const R: TRect; Y: Integer): TRect; +begin + Result := cxRectSetBottom(R, Y, R.Bottom - R.Top); +end; + +function cxRectSetBottom(const R: TRect; Y, H: Integer): TRect; +begin + Result := R; + Result.Bottom := Y; + Result.Top := Y - H; +end; + +function cxRectSetHeight(const R: TRect; H: Integer): TRect; +begin + Result := R; + Result.Bottom := Result.Top + H; +end; + +function cxRectSetLeft(const R: TRect; X: Integer): TRect; +begin + Result := cxRectSetLeft(R, X, R.Right - R.Left); +end; + +function cxRectSetLeft(const R: TRect; X, W: Integer): TRect; +begin + Result := R; + Result.Left := X; + Result.Right := X + W; +end; + +function cxRectSetTop(const R: TRect; Y: Integer): TRect; +begin + Result := cxRectSetTop(R, Y, R.Bottom - R.Top); +end; + +function cxRectSetTop(const R: TRect; Y, H: Integer): TRect; +begin + Result := R; + Result.Top := Y; + Result.Bottom := Y + H; +end; + +function cxRectSetRight(const R: TRect; X: Integer): TRect; +begin + Result := cxRectSetRight(R, X, R.Right - R.Left); +end; + +function cxRectSetRight(const R: TRect; X, W: Integer): TRect; +begin + Result := R; + Result.Right := X; + Result.Left := X - W; +end; + +function cxRectSetSize(const R: TRect; W, H: Integer): TRect; +begin + Result := R; + with R do + begin + Result.Right := Left + W; + Result.Bottom := Top + H; + end; +end; + +function cxRectSetWidth(const R: TRect; W: Integer): TRect; +begin + Result := R; + Result.Right := R.Left + W; +end; + +function cxRectSetWidth(const R: TRect; X, W: Integer): TRect; +begin + Result := R; + Result.Left := X; + Result.Right := X + W; +end; + +function cxRectSetXPos(const R: TRect; X1, X2: Integer): TRect; +begin + with R do + Result := cxRect(X1, Top, X2, Bottom); +end; + +function cxRectSetYPos(const R: TRect; Y1, Y2: Integer): TRect; +begin + with R do + Result := cxRect(Left, Y1, Right, Y2); +end; + +function cxRectSize(const R: TRect): TSize; +begin + with R do + begin + Result.cx := Right - Left; + Result.cy := Bottom - Top; + end; +end; + +procedure cxRectSplitHorz(const ABounds: TRect; var ARect1, ARect2: TRect); +begin + ARect1 := ABounds; + ARect2 := ABounds; + ARect1.Right := (ABounds.Right + ABounds.Left) div 2; + ARect2.Left := ARect1.Right; +end; + +procedure cxRectSplitVert(const ABounds: TRect; var ARect1, ARect2: TRect); +begin + ARect1 := ABounds; + ARect2 := ABounds; + ARect1.Bottom := (ABounds.Bottom + ABounds.Top) div 2; + ARect2.Top := ARect1.Bottom; +end; + +function cxRectUnion(const R1, R2: TRect): TRect; +begin + Result := R1; + if (R2.Right - R2.Left <= 0) or (R2.Bottom - R2.Top <= 0) then Exit; + if R2.Left < R1.Left then + Result.Left := R2.Left; + if R2.Top < R1.Top then + Result.Top := R2.Top; + if R2.Right > R1.Right then + Result.Right := R2.Right; + if R2.Bottom > R1.Bottom then + Result.Bottom := R2.Bottom; +end; + +function cxRectWidth(const R: TRect): Integer; +begin + Result := R.Right - R.Left; +end; + +function cxRectCompare(const R1, R2: TRect): Boolean; +begin + Result := cxRectIsEqual(R1, R2); +end; + +function cxRectCenter(const R: TRect): TPoint; +begin + with R do + Result := cxPoint((Right + Left) div 2, (Bottom + Top) div 2); +end; + +function cxRectCenter(const Bounds: TRect; const ASize: TSize): TRect; +begin + Result := cxRectCenter(Bounds, ASize.cx, ASize.cy) +end; + +function cxRectCenter(const Bounds: TRect; Width, Height: Integer): TRect; +begin + with Bounds do + begin + Result.Left := (Left + Right - Width) div 2; + Result.Top := (Top + Bottom - Height) div 2; + Result.Right := Result.Left + Width; + Result.Bottom := Result.Top + Height; + end; +end; + +function cxRectContain(const ABounds, AInner: TRect): Boolean; +begin + with ABounds do + Result := (Left <= AInner.Left) and (Right >= AInner.Right) and + (Top <= AInner.Top) and (Bottom >= AInner.Bottom); +end; + +function cxRectContent(const R, Margins: TRect): TRect; +begin + with Result do + begin + Left := R.Left + Margins.Left; + Top := R.Top + Margins.Top; + Right := R.Right - Margins.Right; + Bottom := R.Bottom - Margins.Bottom; + end; +end; + +function cxPointInvert(const P: TPoint): TPoint; +begin + Result.X := -P.X; + Result.Y := -P.Y; +end; + +function cxPointIsEqual(const P1, P2: TPoint): Boolean; +begin + Result := (P1.X = P2.X) and (P1.Y = P2.Y); +end; + +function cxPointIsNull(const P: TPoint): Boolean; +begin + Result := (P.X = cxNullPoint.X) and (P.Y = cxNullPoint.Y); +end; + +function cxPointGetItem(const P: TPoint; AIndex: Integer): Integer; +begin + if AIndex = 0 then + Result := P.X + else + Result := P.Y; +end; + +function cxPointOffset(const P: TPoint; const Ps: array of TPoint): TPoint; +begin + with cxPointSum(Ps) do + Result := cxPointOffset(P, X, Y); +end; + +function cxPointOffset(const P: TPoint; X, Y: Integer): TPoint; +begin + Result.X := P.X + X; + Result.Y := P.Y + Y; +end; + +function cxPointReplaceItem(const P: TPoint; const AIndex, AValue: Integer): TPoint; +begin + if AIndex = 0 then + Result.X := AValue + else + Result.Y := AValue; +end; + +function cxPoint(X, Y: Integer): TPoint; +begin + Result.X := X; + Result.Y := Y; +end; + +function cxPoint(const ASize: TSize): TPoint; +begin + with Result do + begin + X := ASize.cx; + Y := ASize.cy; + end; +end; + +function cxPointOffset(const P, DP: TPoint): TPoint; +begin + Result := cxPointOffset(P, DP.X, DP.Y); +end; + +function cxPointSum(const Ps: array of TPoint): TPoint; +var + I: Integer; +begin + if Length(Ps) >= 1 then + begin + Result := Ps[Low(Ps)]; + for I := Low(Ps) + 1 to High(Ps) do + with Ps[I] do + begin + Inc(Result.X, X); + Inc(Result.Y, Y); + end; + end + else + Result := cxNullPoint; +end; + +function cxSize(DX, DY: Integer): TSize; +begin + Result.cx := DX; + Result.cy := DY; +end; + +function cxSizeIsEqual(const S1, S2: TSize): Boolean; +begin + Result := (S1.cx = S2.cx) and (S1.cy = S2.cy); +end; + +initialization + RegisterClasses([TcxRect]); + +finalization + UnregisterClasses([TcxRect]); + +end. + diff --git a/official/x.35/ExpressLibrary/Sources/cxGraphics.pas b/official/x.35/ExpressLibrary/Sources/cxGraphics.pas new file mode 100644 index 00000000..58b04dbf --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxGraphics.pas @@ -0,0 +1,5844 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library graphics classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGraphics; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Windows, + Classes, SysUtils, Controls, Graphics, CommCtrl, ComCtrls, ImgList, cxClasses; + +const + cxAlignLeft = 1; + cxAlignRight = 2; + cxAlignHCenter = 4; + cxAlignTop = 8; + cxAlignBottom = 16; + cxAlignVCenter = 32; + cxAlignCenter = 36; + cxSingleLine = 64; + cxDontClip = 128; + cxExpandTabs = 256; + cxShowPrefix = 512; + cxWordBreak = 1024; + cxShowEndEllipsis = 2048; + cxDontPrint = 4096; + cxShowPathEllipsis = 8192; + cxDontBreakChars = 16384; + + SystemAlignmentsHorz: array[TAlignment] of Integer = (DT_LEFT, DT_RIGHT, DT_CENTER); + SystemAlignmentsVert: array[TcxAlignmentVert] of Integer = (DT_TOP, DT_BOTTOM, DT_VCENTER); + cxAlignmentsHorz: array[TAlignment] of Integer = (cxAlignLeft, cxAlignRight, cxAlignHCenter); + cxAlignmentsVert: array[TcxAlignmentVert] of Integer = (cxAlignTop, cxAlignBottom, cxAlignVCenter); + +{$IFNDEF DELPHI6} + clMoneyGreen = TColor($C0DCC0); + clSkyBlue = TColor($F0CAA6); + clCream = TColor($F0FBFF); + clMedGray = TColor($A4A0A0); +{$ENDIF} + clcxLightGray = $CFCFCF; + + cxEmptyRect: TRect = (Left: 0; Top: 0; Right: 0; Bottom: 0); + + cxDesignSelectionWidth = 2; + + cxDefaultAlphaValue = 200; + + cxHalfToneBrush: TBrush = nil; + +type + IcxFontListener = interface + ['{B144DD7E-0B27-439A-B908-FC3ACFE6A2D3}'] + procedure Changed(Sender: TObject; AFont: TFont); + end; + + TcxBorder = (bLeft, bTop, bRight, bBottom); + TcxBorders = set of TcxBorder; + +const + cxBordersAll = [bLeft, bTop, bRight, bBottom]; + +type + TBrushHandle = HBRUSH; + + TPointArray = array of TPoint; + TRectArray = array of TRect; + + TcxColorPart = -100..100; + + TcxGridLines = (glBoth, glNone, glVertical, glHorizontal); + + PcxViewParams = ^TcxViewParams; + TcxViewParams = record + Bitmap: TBitmap; + Color: TColor; + Font: TFont; + TextColor: TColor; + end; + + { TcxRegion } + + TcxRegionHandle = HRGN; + TcxRegionOperation = (roSet, roAdd, roSubtract, roIntersect); + + TcxRegion = class {6} + private + FHandle: TcxRegionHandle; + function GetBoundsRect: TRect; + function GetIsEmpty: Boolean; + protected + procedure DestroyHandle; + public + constructor Create(AHandle: TcxRegionHandle); overload; + constructor Create(const ABounds: TRect); overload; + constructor Create; overload; + constructor Create(ALeft, ATop, ARight, ABottom: Integer); overload; + constructor CreateRoundCorners(const ABounds: TRect; AWidthEllepse, AHeightEllepse: Integer); overload; + constructor CreateRoundCorners(ALeft, ATop, ARight, ABottom, AWidthEllepse, AHeightEllepse: Integer); overload; + destructor Destroy; override; + + procedure Combine(ARegion: TcxRegion; AOperation: TcxRegionOperation; + ADestroyRegion: Boolean = True); + function IsEqual(ARegion: TcxRegion): Boolean; overload; + function IsEqual(ARegionHandle: TcxRegionHandle): Boolean; overload; + procedure Offset(DX, DY: Integer); + function PtInRegion(const Pt: TPoint): Boolean; overload; + function PtInRegion(X, Y: Integer): Boolean; overload; + function RectInRegion(const R: TRect): Boolean; overload; + function RectInRegion(ALeft, ATop, ARight, ABottom: Integer): Boolean; overload; + + property BoundsRect: TRect read GetBoundsRect; + property Handle: TcxRegionHandle read FHandle write FHandle; + property IsEmpty: Boolean read GetIsEmpty; + end; + + { TcxCanvas } + + TcxRotationAngle = (ra0, raPlus90, raMinus90, ra180); + TcxCanvasState = record + Font: TFont; + Brush: TBrush; + Pen: TPen; + end; + TcxCanvasStates = array of TcxCanvasState; + + TcxCanvas = class + private + FCanvas: TCanvas; + FSavedDCs: TList; + FSavedRegions: TList; + FSavedStates: TcxCanvasStates; + + function GetBrush: TBrush; + function GetCopyMode: TCopyMode; + function GetDCOrigin: TPoint; + function GetFont: TFont; + function GetHandle: HDC; + function GetPen: TPen; + function GetViewportOrg: TPoint; + function GetWindowOrg: TPoint; + procedure SetBrush(Value: TBrush); + procedure SetCopyMode(Value: TCopyMode); + procedure SetFont(Value: TFont); + procedure SetPen(Value: TPen); + procedure SetPixel(X, Y: Integer; Value: TColor); + procedure SetViewportOrg(const P: TPoint); + procedure SetWindowOrg(const P: TPoint); + protected + procedure SynchronizeObjects(ADC: THandle); + public + constructor Create(ACanvas: TCanvas); virtual; + destructor Destroy; override; + + procedure AlignMultiLineTextRectVertically(var R: TRect; const AText: string; + AAlignmentVert: TcxAlignmentVert; AWordBreak, AShowPrefix: Boolean; + AEnabled: Boolean = True; ADontBreakChars: Boolean = False); + procedure CopyRect(const Dest: TRect; ACanvas: TCanvas; const Source: TRect); + procedure Draw(X, Y: Integer; Graphic: TGraphic); + procedure DrawComplexFrame(const R: TRect; ALeftTopColor, ARightBottomColor: TColor; + ABorders: TcxBorders = [bLeft, bTop, bRight, bBottom]; ABorderWidth: Integer = 1); + procedure DrawEdge(const R: TRect; ASunken, AOuter: Boolean; + ABorders: TcxBorders = [bLeft, bTop, bRight, bBottom]); + procedure DrawFocusRect(const R: TRect); + procedure DrawGlyph(X, Y: Integer; AGlyph: TBitmap; AEnabled: Boolean = True; + ABackgroundColor: TColor = clNone{; ATempCanvas: TCanvas = nil}); + procedure DrawImage(Images: TCustomImageList; X, Y, Index: Integer; + Enabled: Boolean = True); + procedure DrawTexT(const Text: string; R: TRect; Flags: Integer; + Enabled: Boolean = True); + procedure FillRect(const R: TRect; AColor: TColor); overload; + procedure FillRect(const R: TRect; ABitmap: TBitmap = nil; + AExcludeRect: Boolean = False); overload; + procedure FillRect(R: TRect; const AParams: TcxViewParams; + ABorders: TcxBorders = []; ABorderColor: TColor = clDefault; + ALineWidth: Integer = 1; AExcludeRect: Boolean = False); overload; + procedure DrawDesignSelection(ARect: TRect; AWidth: Integer = cxDesignSelectionWidth); + procedure DrawRegion(ARegion: TcxRegion; AContentColor: TColor = clDefault; + ABorderColor: TColor = clDefault; ABorderWidth: Integer = 1; ABorderHeight: Integer = 1); overload; + procedure DrawRegion(ARegion: TcxRegionHandle; AContentColor: TColor = clDefault; + ABorderColor: TColor = clDefault; ABorderWidth: Integer = 1; ABorderHeight: Integer = 1); overload; + procedure FillRegion(ARegion: TcxRegion; AColor: TColor = clDefault); overload; + procedure FillRegion(ARegion: TcxRegionHandle; AColor: TColor = clDefault); overload; + procedure FlipHorizontally(ABitmap: TBitmap); + procedure FrameRegion(ARegion: TcxRegion; AColor: TColor = clDefault; + ABorderWidth: Integer = 1; ABorderHeight: Integer = 1); overload; + procedure FrameRegion(ARegion: TcxRegionHandle; AColor: TColor = clDefault; + ABorderWidth: Integer = 1; ABorderHeight: Integer = 1); overload; + procedure Pie(const R: TRect; const ARadial1, ARadial2: TPoint); overload; + procedure Pie(const R: TRect; AStartAngle, ASweepAngle: Integer); overload; + function FontHeight(AFont: TFont): Integer; + procedure FrameRect(const R: TRect; Color: TColor = clDefault; + ALineWidth: Integer = 1; ABorders: TcxBorders = cxBordersAll; + AExcludeFrame: Boolean = False); + procedure InvertFrame(const R: TRect; ABorderSize: Integer); + procedure InvertRect(const R: TRect); + procedure LineTo(X, Y: Integer); + procedure MoveTo(X, Y: Integer); + procedure Polygon(const Points: array of TPoint); + procedure Polyline(const Points: array of TPoint); + procedure RotateBitmap(ABitmap: TBitmap; ARotationAngle: TcxRotationAngle; + AFlipVertically: Boolean = False); + function TextExtent(const Text: string): TSize; overload; + procedure TextExtent(const Text: string; var R: TRect; Flags: Integer); overload; + function TextHeight(const Text: string): Integer; + function TextWidth(const Text: string): Integer; + procedure TransparentDraw(X, Y: Integer; ABitmap: TBitmap; AAlpha: Byte; + ABackground: TBitmap = nil); + + procedure RestoreDC; + procedure SaveDC; + procedure RestoreClipRegion; + procedure SaveClipRegion; + procedure RestoreState; + procedure SaveState; + + procedure GetParams(var AParams: TcxViewParams); + procedure SetParams(AParams: TcxViewParams); + procedure SetBrushColor(Value: TColor); + procedure SetFontAngle(Value: Integer); + + procedure GetTextStringsBounds(Text: string; R: TRect; Flags: Integer; + Enabled: Boolean; var ABounds: TRectArray); + + procedure BeginPath; + procedure EndPath; + function PathToRegion: TcxRegion; + procedure WidenPath; + + // clipping + procedure ExcludeClipRect(const R: TRect); + procedure IntersectClipRect(const R: TRect); + function GetClipRegion(AConsiderOrigin: Boolean = True): TcxRegion; + procedure SetClipRegion(ARegion: TcxRegion; AOperation: TcxRegionOperation; + ADestroyRegion: Boolean = True; AConsiderOrigin: Boolean = True); + function RectFullyVisible(const R: TRect): Boolean; + function RectVisible(const R: TRect): Boolean; + + property Brush: TBrush read GetBrush write SetBrush; + property Canvas: TCanvas read FCanvas write FCanvas; + property CopyMode: TCopyMode read GetCopyMode write SetCopyMode; + property DCOrigin: TPoint read GetDCOrigin; + property Font: TFont read GetFont write SetFont; + property Handle: HDC read GetHandle; + property Pen: TPen read GetPen write SetPen; + property Pixels[X, Y: Integer]: TColor write SetPixel; + property ViewportOrg: TPoint read GetViewportOrg write SetViewportOrg; + property WindowOrg: TPoint read GetWindowOrg write SetWindowOrg; + end; + + { TcxScreenCanvas } + + TcxScreenCanvas = class(TcxCanvas) + public + constructor Create; reintroduce; virtual; + destructor Destroy; override; + end; + + { TcxCustomBitmap } + + TcxCustomBitmap = class(TBitmap) + private + FCompressData: Boolean; + FcxCanvas: TcxCanvas; + FLockCount: Integer; + FModified: Boolean; + + function GetClientRect: TRect; + + procedure Compress(ASourceStream, ADestStream: TStream; ASize: Integer); + procedure Decompress(ASourceStream, ADestStream: TStream; ASize: Integer); + protected + procedure Changed(Sender: TObject); override; + function ChangeLocked: Boolean; + procedure Initialize(AWidth, AHeight: Integer; APixelFormat: TPixelFormat); virtual; + procedure Update; virtual; + + procedure ReadData(Stream: TStream); override; + procedure WriteData(Stream: TStream); override; + public + constructor Create; override; + constructor CreateSize(const ARect: TRect); overload; + constructor CreateSize(AWidth, AHeight: Integer); overload; + constructor CreateSize(const ARect: TRect; APixelFormat: TPixelFormat); overload; + constructor CreateSize(AWidth, AHeight: Integer; APixelFormat: TPixelFormat); overload; virtual; + destructor Destroy; override; + + procedure BeginUpdate; + procedure EndUpdate(AForceUpdate: Boolean = True); + + procedure CopyBitmap(ABitmap: TBitmap; ACopyMode: DWORD = SRCCOPY); overload; + procedure CopyBitmap(ABitmap: TBitmap; const ADestRect: TRect; const ASrcTopLeft: TPoint; ACopyMode: DWORD = SRCCOPY); overload; + procedure Clear; virtual; + procedure Rotate(ARotationAngle: TcxRotationAngle; AFlipVertically: Boolean = False); + procedure SetSize(AWidth, AHeight: Integer); {$IFDEF DELPHI10}override;{$ELSE}virtual;{$ENDIF} + + property CompressData: Boolean read FCompressData write FCompressData; + property ClientRect: TRect read GetClientRect; + property cxCanvas: TcxCanvas read FcxCanvas; + end; + + { TcxBitmap } + + TRGBColors = array of TRGBQuad; + TcxImageDrawMode = (idmNormal, idmDisabled, idmFaded, idmGrayScale, idmDingy, idmShadowed); + TcxBitmapTransformationMode = (btmDingy, btmDirty, btmGrayScale, btmSetOpaque, btmMakeMask, btmFade, btmDisable, btmCorrectBlend, btmHatch, btmClear); + TcxBitmapTransformationProc = procedure(var AColor: TRGBQuad) of object; + TcxDrawImageProc = function (ACanvas: TCanvas; AImages: TCustomImageList; AImageIndex: Integer; AGlyph: TBitmap; ARect: TRect; ADrawMode: TcxImageDrawMode): Boolean; + + TcxColorTransitionMap = record + RedScale: Single; + GreenScale: Single; + BlueScale: Single; + SrcAlpha: Byte; + SrcConstantAlpha: Byte; + end; + + TcxHatchData = record + Color1: TRGBQuad; + Alpha1: Byte; + Color2: TRGBQuad; + Alpha2: Byte; + Step: Byte; + end; + + TcxColorList = class(TList) + public + function Add(AColor: TColor): Integer; + end; + + TcxBitmap = class(TcxCustomBitmap) + private + FBitmapInfo: TBitmapInfo; + FDC: HDC; + FTransparentBkColor: TRGBQuad; + FTransparentPixels: TcxColorList; + + FCurrentColorIndex: TPoint; + FHatchData: TcxHatchData; + + function GetIsAlphaUsed: Boolean; + + procedure CorrectBlend(var AColor: TRGBQuad); + procedure ClearColor(var AColor: TRGBQuad); + procedure Dingy(var AColor: TRGBQuad); + procedure Dirty(var AColor: TRGBQuad); + procedure Disable(var AColor: TRGBQuad); + procedure Fade(var AColor: TRGBQuad); + procedure GrayScale(var AColor: TRGBQuad); + procedure Hatch(var AColor: TRGBQuad); + procedure MakeMask(var AColor: TRGBQuad); + procedure SetOpaque(var AColor: TRGBQuad); + + procedure Scale(var AColor: TRGBQuad; const AColorMap: TcxColorTransitionMap); + + procedure UpdateBitmapInfo; + + function IsColorTransparent(const AColor: TRGBQuad): Boolean; + protected + procedure Initialize(AWidth, AHeight: Integer; APixelFormat: TPixelFormat); override; + procedure Update; override; + + property HatchData: TcxHatchData read FHatchData write FHatchData; + property TransparentBkColor: TRGBQuad read FTransparentBkColor write FTransparentBkColor; + property TransparentPixels: TcxColorList read FTransparentPixels; + public + constructor CreateSize(AWidth, AHeight: Integer; APixelFormat: TPixelFormat); override; + constructor CreateSize(AWidth, AHeight: Integer; ATransparentBkColor: TRGBQuad); overload; + destructor Destroy; override; + + procedure GetBitmapColors(out AColors: TRGBColors); + procedure SetBitmapColors(const AColors: TRGBColors); + + procedure AlphaBlend(ABitmap: TcxBitmap; const ARect: TRect; ASmoothImage: Boolean; AConstantAlpha: Byte = $FF); + procedure Clear; override; + procedure DrawHatch(const AHatchData: TcxHatchData); overload; + procedure DrawHatch(AColor1, AColor2: TColor; AStep: Byte; AAlpha1: Byte = $FF; AAlpha2: Byte = $FF); overload; + procedure DrawShadow(AMaskBitmap: TcxBitmap; AShadowSize: Integer; AShadowColor: TColor; AInflateSize: Boolean = False); + procedure Filter(AMaskBitmap: TcxBitmap); + procedure Invert; + procedure MakeOpaque; + procedure RecoverAlphaChannel(ATransparentColor: TColor); + procedure SetSize(AWidth, AHeight: Integer); override; + procedure Shade(AMaskBitmap: TcxBitmap); + + procedure TransformBitmap(AMode: TcxBitmapTransformationMode); + + property IsAlphaUsed: Boolean read GetIsAlphaUsed; + end; + + TcxImageInfo = class(TPersistent) + private + FImage: TBitmap; + FMask: TBitmap; + FMaskColor: TColor; + + procedure AssignBitmap(ASourceBitmap, ADestBitmap: TBitmap); + protected + procedure SetImage(Value: TBitmap); virtual; + procedure SetMask(Value: TBitmap); virtual; + public + constructor Create; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + property Image: TBitmap read FImage write SetImage; + property Mask: TBitmap read FMask write SetMask; + property MaskColor: TColor read FMaskColor write FMaskColor; + end; + + TcxImageList = class(TDragImageList) + private + FAlphaBlending: Boolean; + FFormatVersion: Integer; + FImages: TCollection; + FLockCount: Integer; + FSynchronization: Boolean; + + function GetCompressData: Boolean; + procedure SetCompressData(Value: Boolean); + + function GetHandle: HImageList; + procedure SetHandle(Value: HImageList); + + procedure ReadFormatVersion(AReader: TReader); + procedure WriteFormatVersion(AWriter: TWriter); + procedure ReadImageInfo(AReader: TReader); + procedure WriteImageInfo(AWriter: TWriter); + procedure ReadDesignInfo(AReader: TReader); + procedure WriteDesignInfo(AWriter: TWriter); + function NeedSynchronizeImageInfo: Boolean; + procedure SynchronizeImageInfo; + procedure SynchronizeHanle; + + procedure AddToInternalCollection(AImage, AMask: TBitmap; AMaskColor: TColor = clNone); + procedure DormantImage(AIndex: Integer); + function GetImageHandle(AImage: TBitmap): Integer; + class function GetPixelFormat(AHandle: HIMAGELIST): Integer; + protected + function ChangeLocked: Boolean; + procedure Change; override; + procedure DoDraw(Index: Integer; Canvas: TCanvas; X, Y: Integer; + Style: Cardinal; Enabled: Boolean = True); override; + procedure DoDrawEx(AIndex: Integer; ACanvas: TCanvas; + const ARect: TRect; AStyle: Cardinal; AStretch, ASmoothResize, AEnabled: Boolean); + + procedure Initialize; override; + procedure Finalize; + procedure DefineProperties(Filer: TFiler); override; + procedure Dormant; + + // for cxImageListEditor + procedure AddImageInfo(AImageInfo: TcxImageInfo); + procedure InternalCopyImageInfos(AImageList: TcxImageList; AStartIndex, AEndIndex: Integer); + procedure InternalCopyImages(AImageList: TCustomImageList; AStartIndex, AEndIndex: Integer); + procedure GetImageInfo(AIndex: Integer; AImageInfo: TcxImageInfo); overload; + public + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + // BaseFunctions + function Add(AImage, AMask: TBitmap): Integer; + function AddIcon(AIcon: TIcon): Integer; + function AddMasked(AImage: TBitmap; AMaskColor: TColor): Integer; + procedure Move(ACurIndex, ANewIndex: Integer); + procedure Delete(AIndex: Integer); + + // SubsidiaryFunctions + function AddImage(AValue: TCustomImageList; AIndex: Integer): Integer; + procedure AddImages(AImageList: TCustomImageList); + procedure CopyImages(AImageList: TCustomImageList; AStartIndex: Integer = 0; AEndIndex: Integer = -1); + procedure Clear; + procedure Insert(AIndex: Integer; AImage, AMask: TBitmap); + procedure InsertIcon(AIndex: Integer; AIcon: TIcon); + procedure InsertMasked(AIndex: Integer; AImage: TBitmap; AMaskColor: TColor); + procedure Replace(AIndex: Integer; AImage, AMask: TBitmap); + procedure ReplaceIcon(AIndex: Integer; AIcon: TIcon); + procedure ReplaceMasked(AIndex: Integer; AImage: TBitmap; AMaskColor: TColor); + + function LoadImage(AInstance: THandle; const AResourceName: string; + AMaskColor: TColor = clDefault; AWidth: Integer = 0; AFlags: TLoadResources = []): Boolean; + function GetResource(AResType: TResType; const AName: string; + AWidth: Integer; ALoadFlags: TLoadResources; AMaskColor: TColor): Boolean; + function GetInstRes(AInstance: THandle; AResType: TResType; const AName: string; + AWidth: Integer; ALoadFlags: TLoadResources; AMaskColor: TColor): Boolean; overload; + function GetInstRes(AInstance: THandle; AResType: TResType; AResID: DWORD; + AWidth: Integer; ALoadFlags: TLoadResources; AMaskColor: TColor): Boolean; overload; + function ResourceLoad(AResType: TResType; const AName: string; + AMaskColor: TColor): Boolean; + function ResInstLoad(AInstance: THandle; AResType: TResType; + const AName: string; AMaskColor: TColor): Boolean; + + procedure BeginUpdate; + procedure EndUpdate(AForceUpdate: Boolean = True); + + {$IFNDEF DELPHI6} + procedure Draw(ACanvas: TCanvas; X, Y, AIndex: Integer; + ADrawingStyle: TDrawingStyle; AImageType: TImageType; + AEnabled: Boolean = True); overload; + {$ENDIF} + procedure Draw(ACanvas: TCanvas; const ARect: TRect; AIndex: Integer; + AStretch: Boolean = True; ASmoothResize: Boolean = False; AEnabled: Boolean = True); overload; + + procedure GetImageInfo(AIndex: Integer; AImage, AMask: TBitmap); overload; + procedure GetImage(AIndex: Integer; AImage: TBitmap); + procedure GetMask(AIndex: Integer; AMask: TBitmap); + + class procedure GetImageInfo(AHandle: HIMAGELIST; AIndex: Integer; AImage, AMask: TBitmap); overload; + property AlphaBlending: Boolean read FAlphaBlending write FAlphaBlending; + property Handle: HImageList read GetHandle write SetHandle; + published + property BlendColor; + property BkColor; + property CompressData: Boolean read GetCompressData write SetCompressData default False; + property DrawingStyle; + property Height; + property ImageType; + property ShareImages; + property Width; + property OnChange; + end; + + { TcxBrushCache } + + TcxBrushData = record + Brush: TBrush; + Color: TColor; + RefCount: Integer; + end; + + TcxBrushesData = array of TcxBrushData; + + EBrushCache = class(Exception); + + TcxBrushCache = class + private + FCapacity: Integer; + FCount: Integer; + FData: TcxBrushesData; + FDeletedCount: Integer; + FLockRef: Integer; + protected + function Add(AColor: TColor): TBrush; + function AddItemAt(AIndex: Integer; AColor: TColor): TBrush; + procedure CacheCheck(Value: Boolean; const AMessage: string); + procedure Delete(AIndex: Integer); + function IndexOf(AColor: TColor; out AIndex: Integer): Boolean; + procedure InitItem(var AItem: TcxBrushData; AColor: TColor); + function IsSystemBrush(ABrush: TBrush): Boolean; + function FindNearestItem(AColor: TColor): Integer; + procedure Move(ASrc, ADst, ACount: Integer); + procedure Pack; + procedure Recreate; + procedure Release(AIndex: Integer); + public + destructor Destroy; override; + procedure BeginUpdate; + procedure EndUpdate; + procedure ReleaseBrush(var ABrush: TBrush); + procedure SetBrushColor(var ABrush: TBrush; AColor: TColor); + end; + +const + DisableMap: TcxColorTransitionMap = (RedScale: 0.0729; GreenScale: 0.7146; BlueScale: 0.2125; SrcAlpha: 105; SrcConstantAlpha: 151); + FadeMap: TcxColorTransitionMap = (RedScale: 0.299; GreenScale: 0.587; BlueScale: 0.114; SrcAlpha: 192; SrcConstantAlpha: 64); + GrayMap: TcxColorTransitionMap = (RedScale: 0.299; GreenScale: 0.587; BlueScale: 0.114; SrcAlpha: $FF; SrcConstantAlpha: $FF); + +type + TcxColorInfo = record + Name: string; + Color: TColor; + end; + +const + cxColorsByName: array[0..168] of TcxColorInfo = ( + (Name: 'aliceblue'; Color: $00FFF8F0), + (Name: 'antiquewhite'; Color: $00D7EBFA), + (Name: 'aqua'; Color: clAqua), + (Name: 'aquamarine'; Color: $007FD4FF), + (Name: 'azure'; Color: $00FFFFF0), + (Name: 'beige'; Color: $00DCF5F5), + (Name: 'bisque'; Color: $00C4E4FF), + (Name: 'black'; Color: clBlack), + (Name: 'blanchedalmond'; Color: $00CDFFFF), + (Name: 'blue'; Color: clBlue), + (Name: 'blueviolet'; Color: $00E22B8A), + (Name: 'brown'; Color: $002A2AA5), + (Name: 'burlywood'; Color: $0087B8DE), + (Name: 'cadetblue'; Color: $00A09E5F), + (Name: 'chartreuse'; Color: $0000FF7F), + (Name: 'chocolate'; Color: $001E69D2), + (Name: 'coral'; Color: $00507FFF), + (Name: 'cornflowerblue'; Color: $00ED9564), + (Name: 'cornsilk'; Color: $00DCF8FF), + (Name: 'crimson'; Color: $003C14DC), + (Name: 'cyan'; Color: $00FFFF00), + (Name: 'darkblue'; Color: $008B0000), + (Name: 'darkcyan'; Color: $008B8B00), + (Name: 'darkgoldenrod'; Color: $000B86B8), + (Name: 'darkgray'; Color: $00A9A9A9), + (Name: 'darkgreen'; Color: $00006400), + (Name: 'darkkhaki'; Color: $006BB7BD), + (Name: 'darkmagenta'; Color: $008B008B), + (Name: 'darkolivegreen'; Color: $002F6B55), + (Name: 'darkorange'; Color: $00008CFF), + (Name: 'darkorchid'; Color: $00CC3299), + (Name: 'darkred'; Color: $0000008B), + (Name: 'darksalmon'; Color: $007A96E9), + (Name: 'darkseagreen'; Color: $008FBC8F), + (Name: 'darkslateblue'; Color: $008B3D48), + (Name: 'darkslategray'; Color: $004F4F2F), + (Name: 'darkturquoise'; Color: $00D1CE00), + (Name: 'darkviolet'; Color: $00D30094), + (Name: 'deeppink'; Color: $009314FF), + (Name: 'deepskyblue'; Color: $00FFBF00), + (Name: 'dimgray'; Color: $00696969), + (Name: 'dodgerblue'; Color: $00FF901E), + (Name: 'firebrick'; Color: $002222B2), + (Name: 'floralwhite'; Color: $00F0FAFF), + (Name: 'forestgreen'; Color: $00228B22), + (Name: 'fuchsia'; Color: $00FF00FF), + (Name: 'gainsboro'; Color: $00DCDCDC), + (Name: 'ghostwhite'; Color: $00FFF8F8), + (Name: 'gold'; Color: $0000D7FF), + (Name: 'goldenrod'; Color: $0020A5DA), + (Name: 'gray'; Color: clGray), + (Name: 'green'; Color: clGreen), + (Name: 'greenyellow'; Color: $002FFFAD), + (Name: 'honeydew'; Color: $00F0FFF0), + (Name: 'hotpink'; Color: $00B469FF), + (Name: 'indianred'; Color: $005C5CCD), + (Name: 'indigo'; Color: $0082004B), + (Name: 'ivory'; Color: $00F0F0FF), + (Name: 'khaki'; Color: $008CE6F0), + (Name: 'lavender'; Color: $00FAE6E6), + (Name: 'lavenderblush'; Color: $00F5F0FF), + (Name: 'lawngreen'; Color: $0000FC7C), + (Name: 'lemonchiffon'; Color: $00CDFAFF), + (Name: 'lightblue'; Color: $00E6D8AD), + (Name: 'lightcoral'; Color: $008080F0), + (Name: 'lightcyan'; Color: $00FFFFE0), + (Name: 'lightgoldenrodyellow'; Color: $00D2FAFA), + (Name: 'lightgreen'; Color: $0090EE90), + (Name: 'lightgrey'; Color: $00D3D3D3), + (Name: 'lightpink'; Color: $00C1B6FF), + (Name: 'lightsalmon'; Color: $007AA0FF), + (Name: 'lightseagreen'; Color: $00AAB220), + (Name: 'lightskyblue'; Color: $00FACE87), + (Name: 'lightslategray'; Color: $00998877), + (Name: 'lightsteelblue'; Color: $00DEC4B0), + (Name: 'lightyellow'; Color: $00E0FFFF), + (Name: 'lime'; Color: clLime), + (Name: 'limegreen'; Color: $0032CD32), + (Name: 'linen'; Color: $00E6F0FA), + (Name: 'magenta'; Color: $00FF00FF), + (Name: 'maroon'; Color: clMaroon), + (Name: 'mediumaquamarine'; Color: $00AACD66), + (Name: 'mediumblue'; Color: $00CD0000), + (Name: 'mediumorchid'; Color: $00D355BA), + (Name: 'mediumpurple'; Color: $00DB7093), + (Name: 'mediumseagreen'; Color: $0071B33C), + (Name: 'mediumpurple'; Color: $00DB7093), + (Name: 'mediumslateblue'; Color: $00EE687B), + (Name: 'mediumspringgreen'; Color: $009AFA00), + (Name: 'mediumturquoise'; Color: $00CCD148), + (Name: 'mediumvioletred'; Color: $008515C7), + (Name: 'midnightblue'; Color: $00701919), + (Name: 'mintcream'; Color: $00FAFFF5), + (Name: 'mistyrose'; Color: $00E1E4FF), + (Name: 'moccasin'; Color: $00B5E4FF), + (Name: 'navajowhite'; Color: $00ADDEFF), + (Name: 'navy'; Color: clNavy), + (Name: 'oldlace'; Color: $00E6F5FD), + (Name: 'olive'; Color: $00008080), + (Name: 'olivedrab'; Color: $00238E6B), + (Name: 'orange'; Color: $0000A5FF), + (Name: 'orangered'; Color: $000045FF), + (Name: 'orchid'; Color: $00D670DA), + (Name: 'palegoldenrod'; Color: $00AAE8EE), + (Name: 'palegreen'; Color: $0098FB98), + (Name: 'paleturquoise'; Color: $00EEEEAF), + (Name: 'palevioletred'; Color: $009370DB), + (Name: 'papayawhip'; Color: $00D5EFFF), + (Name: 'peachpuff'; Color: $00BDDBFF), + (Name: 'peru'; Color: $003F85CD), + (Name: 'pink'; Color: $00CBC0FF), + (Name: 'plum'; Color: $00DDA0DD), + (Name: 'powderblue'; Color: $00E6E0B0), + (Name: 'purple'; Color: $00800080), + (Name: 'red'; Color: clRed), + (Name: 'rosybrown'; Color: $008F8FBC), + (Name: 'royalblue'; Color: $00E16941), + (Name: 'saddlebrown'; Color: $0013458B), + (Name: 'salmon'; Color: $007280FA), + (Name: 'sandybrown'; Color: $0060A4F4), + (Name: 'seagreen'; Color: $00578B2E), + (Name: 'seashell'; Color: $00EEF5FF), + (Name: 'sienna'; Color: $002D52A0), + (Name: 'silver'; Color: $00C0C0C0), + (Name: 'skyblue'; Color: $00EBCE87), + (Name: 'slateblue'; Color: $00CD5A6A), + (Name: 'slategray'; Color: $00908070), + (Name: 'snow'; Color: $00FAFAFF), + (Name: 'springgreen'; Color: $007FFF00), + (Name: 'steelblue'; Color: $00B48246), + (Name: 'tan'; Color: $008CB4D2), + (Name: 'teal'; Color: clTeal), + (Name: 'thistle'; Color: $00D8BFD8), + (Name: 'tomato'; Color: $004763FD), + (Name: 'turquoise'; Color: $00D0E040), + (Name: 'violet'; Color: $00EE82EE), + (Name: 'wheat'; Color: $00B3DEF5), + (Name: 'white'; Color: clWhite), + (Name: 'whitesmoke'; Color: $00F5F5F5), + (Name: 'yellow'; Color: clYellow), + (Name: 'yellowgreen'; Color: $0032CD9A), + + (Name: 'activeborder'; Color: clActiveBorder), + (Name: 'activecaption'; Color: clActiveCaption), + (Name: 'appworkspace'; Color: clAppWorkSpace), + (Name: 'background'; Color: clBackground), + (Name: 'buttonface'; Color: clBtnFace), + (Name: 'buttonhighlight'; Color: clBtnHighlight), + (Name: 'buttonshadow'; Color: clBtnShadow), + (Name: 'buttontext'; Color: clBtnText), + (Name: 'captiontext'; Color: clCaptionText), + (Name: 'graytext'; Color: clGrayText), + (Name: 'highlight'; Color: clHighlight), + (Name: 'highlighttext'; Color: clHighlightText), + (Name: 'inactiveborder'; Color: clInactiveBorder), + (Name: 'inactivecaption'; Color: clInactiveCaption), + (Name: 'inactivecaptiontext'; Color: clInactiveCaptionText), + (Name: 'infobackground'; Color: clInfoBk), + (Name: 'infotext'; Color: clInfoText), + (Name: 'menu'; Color: clMenu), + (Name: 'menutext'; Color: clMenuText), + (Name: 'scrollbar'; Color: clScrollBar), + (Name: 'threeddarkshadow'; Color: cl3DDkShadow), + (Name: 'threedface'; Color: clBtnFace), + (Name: 'threedhighlight'; Color: clHighlightText), + (Name: 'threedlightshadow'; Color: cl3DLight), + (Name: 'threedshadow'; Color: clBtnShadow), + (Name: 'window'; Color: clWindow), + (Name: 'windowframe'; Color: clWindowFrame), + (Name: 'windowtext'; Color: clWindowText) + ); + +var + CustomDrawImageProc: TcxDrawImageProc = nil; + +function cxFlagsToDTFlags(Flags: Integer): Integer; + +procedure cxSetImageList(const AValue: TCustomImageList; var AFieldValue: TCustomImageList; const AChangeLink: TChangeLink; ANotifyComponent: TComponent); +procedure ExtendRect(var Rect: TRect; const AExtension: TRect); +function IsGlyphAssigned(AGlyph: TBitmap): Boolean; +function IsImageAssigned(AImageList: TCustomImageList; AImageIndex: Integer): Boolean; + +function IsXPManifestEnabled: Boolean; + +function GetRealColor(AColor: TColor): TColor; + +// light colors +function GetLightColor(ABtnFaceColorPart, AHighlightColorPart, AWindowColorPart: TcxColorPart): TColor; +function GetLightBtnFaceColor: TColor; +function GetLightDownedColor: TColor; +function GetLightDownedSelColor: TColor; +function GetLightSelColor: TColor; + +function GetBitmapBits(ABitmap: TBitmap; ATopDownDIB: Boolean): TRGBColors; +procedure SetBitmapBits(ABitmap: TBitmap; var AColors: TRGBColors; + ATopDownDIB: Boolean); +function SystemAlphaBlend(ADestDC, ASrcDC: HDC; const ADestRect, ASrcRect: TRect; AConstantAlpha: Byte = $FF): Boolean; + +function cxColorByName(const AText: string; var AColor: TColor): Boolean; +function cxNameByColor(AColor: TColor; var AText: string): Boolean; +function cxColorToRGBQuad(AColor: TColor; AReserved: Byte = 0): TRGBQuad; + +procedure cxAlphaBlend(ADestBitmap, ASrcBitmap: TBitmap; const ADestRect, ASrcRect: TRect; ASmoothImage: Boolean = False; AConstantAlpha: Byte = $FF); overload; +procedure cxAlphaBlend(ADestDC: HDC; ASrcBitmap: TBitmap; const ADestRect, ASrcRect: TRect; ASmoothImage: Boolean = False; AConstantAlpha: Byte = $FF); overload; +procedure cxAlphaBlend(ADestDC, ASrcDC: HDC; const ADestRect, ASrcRect: TRect; ASmoothImage: Boolean = False; AConstantAlpha: Byte = $FF); overload; +procedure cxBitBlt(ADestDC, ASrcDC: HDC; const ADestRect: TRect; const ASrcTopLeft: TPoint; ROP: DWORD); +//procedure cxBitmapToTrueColorBitmap(ABitmap: TBitmap); -> cxMakeTrueColorBitmap +procedure cxBlendFunction(const ASource: TRGBQuad; var ADest: TRGBQuad; ASourceConstantAlpha: Byte); +function cxCreateBitmap(const ASize: TSize; AFormat: TPixelFormat = pf24bit): TBitmap; overload; +function cxCreateBitmap(const ARect: TRect; AFormat: TPixelFormat = pf24bit): TBitmap; overload; +function cxCreateBitmap(AWidth, AHeight: Integer; AFormat: TPixelFormat = pf24bit): TBitmap; overload; +function cxCreateTrueColorBitmap(const ASize: TSize): TBitmap; overload; +function cxCreateTrueColorBitmap(AWidth, AHeight: Integer): TBitmap; overload; +function cxCreateTrueColorBitmapHandle(AWidth, AHeight: Integer; ABPP: Integer = 32): HBitmap; +procedure cxDrawDesignRect(ACanvas: TcxCanvas; const ARect: TRect; ASelected: Boolean); +procedure cxDrawBitmap(ADestDC: THandle; ASourceBitmap: TBitmap; const ADestRect: TRect; const ASourcePoint: TPoint; AMode: Integer = SRCCOPY); +procedure cxDrawImage(ADC: THandle; AGlyphRect, ABackgroundRect: TRect; AGlyph: TBitmap; + AImages: TCustomImageList; AImageIndex: Integer; ADrawMode: TcxImageDrawMode; + ASmoothImage: Boolean = False; ABrush: THandle = 0; + ATransparentColor: TColor = clNone; AUseLeftBottomPixelAsTransparent: Boolean = True); +procedure cxDrawImageList(AImageListHandle: HIMAGELIST; AImageIndex: Integer; + ADC: HDC; APoint: TPoint; ADrawingStyle: TDrawingStyle; AImageType: TImageType); +procedure cxDrawHatch(ADC: HDC; const ARect: TRect; AColor1, AColor2: TColor; AStep: Byte; AAlpha1: Byte = $FF; AAlpha2: Byte = $FF); +procedure cxSmoothResizeBitmap(ASource, ADestination: TBitmap; AForceUseLanczos3Filter: Boolean = False); + +procedure cxMakeTrueColorBitmap(ASourceBitmap, ATrueColorBitmap: TBitmap); +procedure cxMakeMaskBitmap(ASourceBitmap, AMaskBitmap: TBitmap); + +{!!! TODO: adapt to .net} +// mouse cursor size +function cxGetCursorSize: TSize; + +// image helper routines +procedure cxAlphaBlend(ASource: TBitmap; ARect: TRect; const ASelColor: TColor; Alpha: Byte = 170); overload; +procedure cxAlphaBlend(ADest, ABkSource, ASource: TBitmap; Alpha: Byte = cxDefaultAlphaValue); overload; +procedure cxApplyViewParams(ACanvas: TcxCanvas; const AViewParams: TcxViewParams); +procedure cxCopyImage(ASource, ADest: TBitmap; const ASrcOffset, ADstOffset: TPoint; const ARect: TRect); overload; +procedure cxCopyImage(ASource, ADest: TCanvas; const ASrcOffset, ADstOffset: TPoint; const ARect: TRect); overload; +procedure cxDrawArrows(ACanvas: TCanvas; const ARect: TRect; + ASide: TcxBorder; AColor: TColor; APenColor: TColor = clDefault); +procedure cxFillHalfToneRect(Canvas: TCanvas; const ARect: TRect; ABkColor, AColor: TColor); +procedure cxSetCanvasOrg(ACanvas: TCanvas; var AOrg: TRect); + +function cxGetTextExtentPoint32(ADC: THandle; const AText: string; out ASize: TSize; ACharCount: Integer = -1): Boolean; +procedure cxGetTextLines(const AText: string; ACanvas: TcxCanvas; const ARect: TRect; ALines: TStrings); +function cxDrawText(ADC: THandle; const AText: string; var ARect: TRect; + AFormat: UINT; ACharCount: Integer = - 1): Integer; +function cxExtTextOut(ADC: THandle; const AText: string; const APoint: TPoint; + const ARect: TRect; AOptions: UINT; ACharCount: Integer = -1): Boolean; overload; +function cxExtTextOut(ADC: THandle; const AText: string; const APoint: TPoint; + AOptions: UINT; ACharCount: Integer = -1): Boolean; overload; +procedure cxInvalidateRect(AHandle: THandle; const ARect: TRect; AEraseBackground: Boolean = True); overload; +procedure cxInvalidateRect(AHandle: THandle; AEraseBackground: Boolean = True); overload; + +function cxTextHeight(AFont: TFont; const S: string = 'Wg'; AFontSize: Integer = 0): Integer; +function cxTextWidth(AFont: TFont; const S: string; AFontSize: Integer = 0): Integer; +function cxTextExtent(AFont: TFont; const S: string; AFontSize: Integer = 0): TSize; +function cxTextSize(ADC: THandle; const AText: string): TSize; +function cxGetTextRect(ADC: THandle; const AText: string; ARowCount: Integer; + AReturnMaxRectHeight: Boolean = False): TRect; overload; +function cxGetTextRect(AFont: TFont; const AText: string; ARowCount: Integer): TRect; overload; +function cxGetScreenPixelsPerInch(AHorizontal: Boolean = False): Integer; +function cxGetStringAdjustedToWidth(ADC: HDC; AFontHandle: HFONT; const S: string; AWidth: Integer): string; overload; +function cxGetStringAdjustedToWidth(AFont: TFont; const S: string; AWidth: Integer): string; overload; + +function cxGetBitmapData(ABitmapHandle: HBITMAP; out ABitmapData: Windows.TBitmap): Boolean; +function cxGetBrushData(ABrushHandle: HBRUSH; out ALogBrush: TLogBrush): Boolean; overload; +function cxGetBrushData(ABrushHandle: HBRUSH): TLogBrush; overload; +function cxGetFontData(AFontHandle: HFONT; out ALogFont: TLogFont): Boolean; +function cxGetPenData(APenHandle: HPEN; out ALogPen: TLogPen): Boolean; + +function cxGetWritingDirection(AFontCharset: TFontCharset; const AText: string): TCanvasOrientation; +procedure cxDrawThemeParentBackground(AControl: TWinControl; ACanvas: TcxCanvas; const ARect: TRect); overload; +procedure cxDrawThemeParentBackground(AControl: TWinControl; ACanvas: TCanvas; const ARect: TRect); overload; +procedure cxDrawTransparentControlBackground(AControl: TWinControl; + ACanvas: TcxCanvas; ARect: TRect; APaintParentWithChildren: Boolean = True); overload; +procedure cxDrawTransparentControlBackground(AControl: TWinControl; + ACanvas: TCanvas; const ARect: TRect; APaintParentWithChildren: Boolean = True); overload; +function cxScreenCanvas: TcxScreenCanvas; + +implementation + +uses + Messages, Math, Menus, cxControls, cxGeometry, dxUxTheme, dxOffice11; + +type + TCanvasAccess = class(TCanvas); + TBitmapAccess = class(TBitmap); + + TContributor = record + Pixel: Integer; + Weight: Integer; + end; + TContributorArray = array of TContributor; + + TContributors = record + Count: Integer; + Contributors: TContributorArray; + end; + TContributorList = array of TContributors; + +const +{!!! TODO: adapt to .net} + BaseRgns: array[0..3, 0..6, 0..1] of Integer = + (((0, -1), (-5, -6),(-2, -6), (-2, -9), (2, -9), (2, -6), (5, -6)), + ((0, 0), (5, 5), (2, 5), (2, 8), (-2, 8), (-2, 5), (-5, 5)), + ((-1, 0), (-6, -5), (-6, -2), (-9, -2), (-9, 2), (-6, 2), (-6, 5)), + ((0, 0), (5, 5), (5, 2), (8, 2), (8, -2), (5, -2), (5, -5))); + DefaultBlendFunction: TBlendFunction = + (BlendOp: AC_SRC_OVER; + BlendFlags: 0; + SourceConstantAlpha: cxDefaultAlphaValue; + AlphaFormat: $0); + +var + VCLAlphaBlend: function(DC: LongWord; p2, p3, p4, p5: Integer; DC6: LongWord; + p7, p8, p9, p10: Integer; p11: TBlendFunction): BOOL; stdcall; + ScreenCanvas: TcxScreenCanvas = nil; + DrawBitmap, ImageBitmap, MaskBitmap: TcxBitmap; + +procedure cxBitmapInit(var ABitmap: TcxBitmap; AWidth, AHeight: Integer); +begin + if ABitmap = nil then + ABitmap := TcxBitmap.CreateSize(AWidth, AHeight) + else + begin + ABitmap.TransparentPixels.Clear; + ABitmap.SetSize(AWidth, AHeight); + end; +end; + +function GetDrawBitmap(AWidth, AHeight: Integer): TcxBitmap; +begin + cxBitmapInit(DrawBitmap, AWidth, AHeight); + Result := DrawBitmap; +end; + +function GetImageBitmap(AWidth, AHeight: Integer): TcxBitmap; +begin + cxBitmapInit(ImageBitmap, AWidth, AHeight); + Result := ImageBitmap; +end; + +function GetMaskBitmap(AWidth, AHeight: Integer): TcxBitmap; +begin + cxBitmapInit(MaskBitmap, AWidth, AHeight); + Result := MaskBitmap; +end; + +function cxFlagsToDTFlags(Flags: Integer): Integer; +begin + Result := DT_NOPREFIX; + if cxAlignLeft and Flags <> 0 then + Result := Result or DT_LEFT; + if cxAlignRight and Flags <> 0 then + Result := Result or DT_RIGHT; + if cxAlignHCenter and Flags <> 0 then + Result := Result or DT_CENTER; + if cxAlignTop and Flags <> 0 then + Result := Result or DT_TOP; + if cxAlignBottom and Flags <> 0 then + Result := Result or DT_BOTTOM; + if cxAlignVCenter and Flags <> 0 then + Result := Result or DT_VCENTER; + if cxSingleLine and Flags <> 0 then + Result := Result or DT_SINGLELINE; + if cxDontClip and Flags <> 0 then + Result := Result or DT_NOCLIP; + if cxExpandTabs and Flags <> 0 then + Result := Result or DT_EXPANDTABS; + if cxShowPrefix and Flags <> 0 then + Result := Result and not DT_NOPREFIX; + if cxWordBreak and Flags <> 0 then + begin + Result := Result or DT_WORDBREAK; + if cxDontBreakChars and Flags = 0 then + Result := Result or DT_EDITCONTROL; + end; + if cxShowEndEllipsis and Flags <> 0 then + Result := Result or DT_END_ELLIPSIS; + if cxDontPrint and Flags <> 0 then + Result := Result or DT_CALCRECT; + if cxShowPathEllipsis and Flags <> 0 then + Result := Result or DT_PATH_ELLIPSIS; +end; + +procedure cxSetImageList(const AValue: TCustomImageList; var AFieldValue: TCustomImageList; const AChangeLink: TChangeLink; ANotifyComponent: TComponent); +begin + if AValue <> AFieldValue then + begin + if AFieldValue <> nil then + begin + AFieldValue.RemoveFreeNotification(ANotifyComponent); + if AChangeLink <> nil then + AFieldValue.UnRegisterChanges(AChangeLink); + end; + AFieldValue := AValue; + if AValue <> nil then + begin + if AChangeLink <> nil then + AValue.RegisterChanges(AChangeLink); + AValue.FreeNotification(ANotifyComponent); + end; + if AChangeLink <> nil then + AChangeLink.Change; + end; +end; + +procedure ExtendRect(var Rect: TRect; const AExtension: TRect); +begin + with AExtension do + begin + Inc(Rect.Left, Left); + Inc(Rect.Top, Top); + Dec(Rect.Right, Right); + Dec(Rect.Bottom, Bottom); + end; +end; + +function IsGlyphAssigned(AGlyph: TBitmap): Boolean; +begin + Result := (AGlyph <> nil) and not AGlyph.Empty; +end; + +function IsImageAssigned(AImageList: TCustomImageList; AImageIndex: Integer): Boolean; +begin + Result := (AImageList <> nil) and (0 <= AImageIndex) and (AImageIndex < AImageList.Count); +end; + +function IsXPManifestEnabled: Boolean; +{$IFNDEF DELPHI7} +const + ComCtlVersionIE6 = $00060000; +{$ENDIF} +begin + Result := GetComCtlVersion >= ComCtlVersionIE6 +end; + +function GetRealColor(AColor: TColor): TColor; +var + DC: HDC; +begin + DC := GetDC(0); + Result := GetNearestColor(DC, AColor); + ReleaseDC(0, DC); +end; + +function GetChannelValue(AValue: Integer): Byte; +begin + if AValue < 0 then + Result := 0 + else + if AValue > 255 then + Result := 255 + else + Result := AValue; +end; + +function GetLightColor(ABtnFaceColorPart, AHighlightColorPart, AWindowColorPart: TcxColorPart): TColor; +var + ABtnFaceColor, AHighlightColor, AWindowColor: TColor; + + function GetLightIndex(ABtnFaceValue, AHighlightValue, AWindowValue: Byte): Integer; + begin + Result := GetChannelValue( + MulDiv(ABtnFaceValue, ABtnFaceColorPart, 100) + + MulDiv(AHighlightValue, AHighlightColorPart, 100) + + MulDiv(AWindowValue, AWindowColorPart, 100)); + end; + +begin + ABtnFaceColor := ColorToRGB(clBtnFace); + AHighlightColor := ColorToRGB(clHighlight); + AWindowColor := ColorToRGB(clWindow); + if (ABtnFaceColor = 0) or (ABtnFaceColor = $FFFFFF) then + Result := AHighlightColor + else + Result := RGB( + GetLightIndex(GetRValue(ABtnFaceColor), GetRValue(AHighlightColor), GetRValue(AWindowColor)), + GetLightIndex(GetGValue(ABtnFaceColor), GetGValue(AHighlightColor), GetGValue(AWindowColor)), + GetLightIndex(GetBValue(ABtnFaceColor), GetBValue(AHighlightColor), GetBValue(AWindowColor))); +end; + +function GetLightBtnFaceColor: TColor; + + function GetLightValue(Value: Byte): Byte; + begin + Result := GetChannelValue(Value + MulDiv(255 - Value, 16, 100)); + end; + +begin + Result := ColorToRGB(clBtnFace); + Result := RGB( + GetLightValue(GetRValue(Result)), + GetLightValue(GetGValue(Result)), + GetLightValue(GetBValue(Result))); + Result := GetRealColor(Result); +end; + +function GetLightDownedColor: TColor; +begin + Result := GetRealColor(GetLightColor(11, 9, 73)); +end; + +function GetLightDownedSelColor: TColor; +begin + Result := GetRealColor(GetLightColor(14, 44, 40)); +end; + +function GetLightSelColor: TColor; +begin + Result := GetRealColor(GetLightColor(-2, 30, 72)); +end; + +procedure FillBitmapInfoHeader(out AHeader: TBitmapInfoHeader; AWidth, AHeight: Integer; + ATopDownDIB: Boolean); overload; +begin + AHeader.biSize := SizeOf(TBitmapInfoHeader); + AHeader.biWidth := AWidth; + if ATopDownDIB then + AHeader.biHeight := -AHeight + else + AHeader.biHeight := AHeight; + AHeader.biPlanes := 1; + AHeader.biBitCount := 32; + AHeader.biCompression := BI_RGB; +end; + +procedure FillBitmapInfoHeader(out AHeader: TBitmapInfoHeader; ABitmap: TBitmap; + ATopDownDIB: Boolean); overload; +begin + FillBitmapInfoHeader(AHeader, ABitmap.Width, ABitmap.Height, ATopDownDIB); +end; + +function GetBitmapBits(ABitmap: TBitmap; ATopDownDIB: Boolean): TRGBColors; +var + AInfo: TBitmapInfo; +begin + SetLength(Result, ABitmap.Width * ABitmap.Height); + FillBitmapInfoHeader(AInfo.bmiHeader, ABitmap, ATopDownDIB); +// GetDIBits(ABitmap.Canvas.Handle, ABitmap.Handle, 0, ABitmap.Height, nil, AInfo, +// DIB_RGB_COLORS); + GetDIBits(cxScreenCanvas.Handle, ABitmap.Handle, 0, ABitmap.Height, Result, + AInfo, DIB_RGB_COLORS); +end; + +procedure SetBitmapBits(ABitmap: TBitmap; var AColors: TRGBColors; + ATopDownDIB: Boolean); +var + AInfo: TBitmapInfo; +begin + FillBitmapInfoHeader(AInfo.bmiHeader, ABitmap, ATopDownDIB); + SetDIBits(cxScreenCanvas.Handle, ABitmap.Handle, 0, ABitmap.Height, + AColors, AInfo, DIB_RGB_COLORS); + AColors := nil; +end; + +function SystemAlphaBlend(ADestDC, ASrcDC: HDC; const ADestRect, ASrcRect: TRect; AConstantAlpha: Byte = $FF): Boolean; +{$IFNDEF DELPHI6} +const + AC_SRC_ALPHA = 1; +{$ENDIF} +var + ABlendFunction: TBlendFunction; +begin + ABlendFunction.BlendOp := AC_SRC_OVER; + ABlendFunction.BlendFlags := 0; + ABlendFunction.SourceConstantAlpha := AConstantAlpha; + ABlendFunction.AlphaFormat := AC_SRC_ALPHA; + Result := Assigned(VCLAlphaBlend) and VCLAlphaBlend( + ADestDC, ADestRect.Left, ADestRect.Top, cxRectWidth(ADestRect), cxRectHeight(ADestRect), + ASrcDC, ASrcRect.Left, ASrcRect.Top, cxRectWidth(ASrcRect), cxRectHeight(ASrcRect), ABlendFunction); +end; + +function cxColorByName(const AText: string; var AColor: TColor): Boolean; +var + I: Integer; +begin + Result := False; + for I := Low(cxColorsByName) to High(cxColorsByName) do + if SameText(AText, cxColorsByName[I].Name) then + begin + AColor := cxColorsByName[I].Color; + Result := True; + Break; + end; +end; + +function cxNameByColor(AColor: TColor; var AText: string): Boolean; +var + I: Integer; +begin + Result := False; + for I := Low(cxColorsByName) to High(cxColorsByName) do + if AColor = cxColorsByName[I].Color then + begin + AText := cxColorsByName[I].Name; + Result := True; + Break; + end; +end; + +function cxColorToRGBQuad(AColor: TColor; AReserved: Byte = 0): TRGBQuad; +begin + DWORD(Result) := ColorToRGB(AColor); + + //#DG exchange values + Result.rgbBlue := Result.rgbBlue xor Result.rgbRed; + Result.rgbRed := Result.rgbBlue xor Result.rgbRed; + Result.rgbBlue := Result.rgbBlue xor Result.rgbRed; + Result.rgbReserved := AReserved; +end; + +procedure CommonAlphaBlend(ADestDC, ASrcDC: HDC; const ADestRect, ASrcRect: TRect; ASmoothImage: Boolean; AConstantAlpha: Byte = $FF); + + function CreateDirectBitmap(ASrcDC: HDC; const ASrcRect: TRect): TBitmap; + var + ARect: TRect; + begin + ARect := Rect(0, 0, cxRectWidth(ASrcRect), cxRectHeight(ASrcRect)); + Result := cxCreateBitmap(ARect, pf32bit); + Result.Canvas.Brush.Color := 0; + Result.Canvas.FillRect(ARect); + cxBitBlt(Result.Canvas.Handle, ASrcDC, ARect, ASrcRect.TopLeft, SRCCOPY); + end; + + function cxRectIdentical(const ARect1, ARect2: TRect): Boolean; + begin + Result := (cxRectWidth(ARect1) = cxRectWidth(ARect2)) and (cxRectHeight(ARect1) = cxRectHeight(ARect2)); + end; + + procedure ResizeBitmap(ADestBitmap, ASrcBitmap: TBitmap); + begin + StretchBlt(ADestBitmap.Canvas.Handle, 0, 0, ADestBitmap.Width, ADestBitmap.Height, + ASrcBitmap.Canvas.Handle, 0, 0, ASrcBitmap.Width, ASrcBitmap.Height, SRCCOPY); + end; + + procedure InternalAlphaBlend(ADestBitmap, ASrcBitmap: TBitmap); + + procedure SoftwareAlphaBlend(AWidth, AHeight: Integer); + var + ASourceColors, ADestColors: TRGBColors; + I: Integer; + begin + ASourceColors := GetBitmapBits(ASrcBitmap, False); + ADestColors := GetBitmapBits(ADestBitmap, False); + for I := 0 to AWidth * AHeight - 1 do + cxBlendFunction(ASourceColors[I], ADestColors[I], AConstantAlpha); + SetBitmapBits(ADestBitmap, ADestColors, False); + end; + + var + AClientRect: TRect; + begin + AClientRect := Rect(0, 0, ADestBitmap.Width, ADestBitmap.Height); + if not SystemAlphaBlend(ADestBitmap.Canvas.Handle, ASrcBitmap.Canvas.Handle, AClientRect, AClientRect, AConstantAlpha) then + SoftwareAlphaBlend(AClientRect.Right, AClientRect.Bottom); + end; + + procedure ComplexAlphaBlend; + var + ADirectDestBitmap, ADirectSrcBitmap, AStretchedSrcBitmap: TBitmap; + begin + ADirectSrcBitmap := CreateDirectBitmap(ASrcDC, ASrcRect); + ADirectDestBitmap := CreateDirectBitmap(ADestDC, ADestRect); + AStretchedSrcBitmap := cxCreateBitmap(ADestRect, pf32bit); + try + if ASmoothImage then + cxSmoothResizeBitmap(ADirectSrcBitmap, AStretchedSrcBitmap, True) + else + ResizeBitmap(AStretchedSrcBitmap, ADirectSrcBitmap); + InternalAlphaBlend(ADirectDestBitmap, AStretchedSrcBitmap); + cxBitBlt(ADestDC, ADirectDestBitmap.Canvas.Handle, ADestRect, cxNullPoint, SRCCOPY); + finally + AStretchedSrcBitmap.Free; + ADirectDestBitmap.Free; + ADirectSrcBitmap.Free; + end; + end; + +begin + ASmoothImage := ASmoothImage and not cxRectIdentical(ADestRect, ASrcRect); + if IsWin95X or not Assigned(VCLAlphaBlend) or ASmoothImage then + ComplexAlphaBlend + else + SystemAlphaBlend(ADestDC, ASrcDC, ADestRect, ASrcRect, AConstantAlpha); +end; + +procedure cxAlphaBlend(ADestBitmap, ASrcBitmap: TBitmap; const ADestRect, ASrcRect: TRect; ASmoothImage: Boolean = False; AConstantAlpha: Byte = $FF); overload; +begin + CommonAlphaBlend(ADestBitmap.Canvas.Handle, ASrcBitmap.Canvas.Handle, ADestRect, ASrcRect, ASmoothImage, AConstantAlpha); +end; + +procedure cxAlphaBlend(ADestDC: HDC; ASrcBitmap: TBitmap; const ADestRect, ASrcRect: TRect; ASmoothImage: Boolean = False; AConstantAlpha: Byte = $FF); overload; +begin + CommonAlphaBlend(ADestDC, ASrcBitmap.Canvas.Handle, ADestRect, ASrcRect, ASmoothImage, AConstantAlpha); +end; + +procedure cxAlphaBlend(ADestDC, ASrcDC: HDC; const ADestRect, ASrcRect: TRect; ASmoothImage: Boolean = False; AConstantAlpha: Byte = $FF); overload; +begin + CommonAlphaBlend(ADestDC, ASrcDC, ADestRect, ASrcRect, ASmoothImage, AConstantAlpha); +end; + +procedure cxBitBlt(ADestDC, ASrcDC: HDC; const ADestRect: TRect; const ASrcTopLeft: TPoint; ROP: DWORD); +begin + BitBlt(ADestDC, ADestRect.Left, ADestRect.Top, cxRectWidth(ADestRect), cxRectHeight(ADestRect), + ASrcDC, ASrcTopLeft.X, ASrcTopLeft.Y, ROP); +end; + +procedure cxBlendFunction(const ASource: TRGBQuad; var ADest: TRGBQuad; ASourceConstantAlpha: Byte); + + function GetValue(AValue: Single): Byte; + begin + Result := GetChannelValue(Round(AValue)); + end; + +var + ASCA, ASrcAlpha: Single; +begin + ASCA := ASourceConstantAlpha / 255; + ASrcAlpha := 1 - ASource.rgbReserved * ASCA / 255; + + ADest.rgbRed := GetValue(ASource.rgbRed * ASCA + ASrcAlpha * ADest.rgbRed); + ADest.rgbGreen := GetValue(ASource.rgbGreen * ASCA + ASrcAlpha * ADest.rgbGreen); + ADest.rgbBlue := GetValue(ASource.rgbBlue * ASCA + ASrcAlpha * ADest.rgbBlue); + ADest.rgbReserved := GetValue(ASource.rgbReserved * ASCA + ASrcAlpha * ADest.rgbReserved); +end; + +procedure cxSetBitmapParams(ABitmap: TBitmap; AWidth, AHeight: Integer; AFormat: TPixelFormat); +begin +{$IFDEF DELPHI6} + ABitmap.PixelFormat := AFormat; +{$ENDIF} + ABitmap.Width := AWidth; + ABitmap.Height := AHeight; +{$IFNDEF DELPHI6} + ABitmap.PixelFormat := AFormat; +{$ENDIF} +end; + +function cxCreateBitmap(const ASize: TSize; AFormat: TPixelFormat = pf24bit): TBitmap; +begin + Result := cxCreateBitmap(ASize.cx, ASize.cy, AFormat); +end; + +function cxCreateBitmap(const ARect: TRect; AFormat: TPixelFormat = pf24bit): TBitmap; +begin + Result := cxCreateBitmap(cxRectWidth(ARect), cxRectHeight(ARect), AFormat); +end; + +function cxCreateBitmap(AWidth, AHeight: Integer; AFormat: TPixelFormat = pf24bit): TBitmap; +begin + Result := TBitmap.Create; + cxSetBitmapParams(Result, AWidth, AHeight, AFormat); +end; + +function cxCreateTrueColorBitmap(const ASize: TSize): TBitmap; +begin + Result := cxCreateTrueColorBitmap(ASize.cx, ASize.cy); +end; + +function cxCreateTrueColorBitmap(AWidth, AHeight: Integer): TBitmap; +begin + Result := TBitmap.Create; + Result.Handle := cxCreateTrueColorBitmapHandle(AWidth, AHeight); +end; + +function cxCreateTrueColorBitmapHandle(AWidth, AHeight: Integer; ABPP: Integer = 32): HBitmap; +begin + Result := CreateBitmap(AWidth, AHeight, 1, ABPP, nil); +end; + +procedure cxDrawDesignRect(ACanvas: TcxCanvas; const ARect: TRect; ASelected: Boolean); +const + Colors: array[Boolean] of TColor = ($A0FFA0, $9090FF); +var + AColor: TColor; + I: Integer; + AShadowRect: TRect; +begin + if not IsRectEmpty(ARect) then + begin + ACanvas.SaveState; + try + ACanvas.SetClipRegion(TcxRegion.Create(ARect), roSet); + AColor := Colors[ASelected]; + ACanvas.FillRect(ARect, AColor); + ACanvas.Pen.Color := Dark(AColor, 75); + for I := 1 to MulDiv(ARect.Right, 3, 2) do + ACanvas.Polyline([Point(ARect.Right - I * 3, ARect.Top), Point(ARect.Right, ARect.Top + I * 3)]); + ACanvas.FrameRect(ARect, Dark(AColor, 50)); + finally + ACanvas.RestoreState; + end; + ACanvas.ExcludeClipRect(ARect); + AShadowRect := cxRectOffset(ARect, 1, 1); + ACanvas.FillRect(AShadowRect, clBtnShadow); + ACanvas.ExcludeClipRect(AShadowRect); + end; +end; + +procedure cxDrawBitmap(ADestDC: THandle; ASourceBitmap: TBitmap; + const ADestRect: TRect; const ASourcePoint: TPoint; AMode: Integer); + + procedure InternalDrawBitmap; + begin + cxBitBlt(ADestDC, ASourceBitmap.Canvas.Handle, ADestRect, ASourcePoint, AMode); + end; + +var + APrevPalette: HPALETTE; +begin + if GetDeviceCaps(cxScreenCanvas.Handle, BITSPIXEL) <= 8 then + begin + APrevPalette := SelectPalette(ADestDC, ASourceBitmap.Palette, True); + RealizePalette(ADestDC); + InternalDrawBitmap; + SelectPalette(ADestDC, APrevPalette, True); + end + else + InternalDrawBitmap; +end; + +procedure cxDrawImage(ADC: THandle; AGlyphRect, ABackgroundRect: TRect; AGlyph: TBitmap; + AImages: TCustomImageList; AImageIndex: Integer; ADrawMode: TcxImageDrawMode; + ASmoothImage: Boolean = False; ABrush: THandle = 0; + ATransparentColor: TColor = clNone; AUseLeftBottomPixelAsTransparent: Boolean = True); + + procedure DrawBackGround(ABitmap: TcxBitmap); + begin + if ABrush = 0 then + cxBitBlt(ABitmap.Canvas.Handle, ADC, ABitmap.ClientRect, ABackgroundRect.TopLeft, SRCCOPY) + else + FillRect(ABitmap.Canvas.Handle, ABitmap.ClientRect, ABrush); + end; + + procedure DrawImage(ABitmap: TcxBitmap; ADrawMode: TcxImageDrawMode); + + procedure MakeImage(AImageBitmap: TcxBitmap; out AIsAlphaUsed: Boolean); + begin + if not IsGlyphAssigned(AGlyph) then + begin + if AImages is TcxImageList then + TcxImageList(AImages).GetImageInfo(AImageIndex, AImageBitmap, nil) + else + TcxImageList.GetImageInfo(AImages.Handle, AImageIndex, AImageBitmap, nil); + +// cxDrawImageList(AImages.Handle, AImageIndex, AImageBitmap.Canvas.Handle, +// cxNullPoint, AImages.DrawingStyle, AImages.ImageType) +//#DG can break destination AImages.Draw(AImageBitmap.Canvas, 0, 0, AImageIndex) + AIsAlphaUsed := TcxImageList.GetPixelFormat(AImages.Handle) >= 32; + end + else + begin + AImageBitmap.CopyBitmap(AGlyph); + AIsAlphaUsed := (AGlyph.PixelFormat = pf32bit) or + ((AGlyph.PixelFormat = pfDevice) and (GetDeviceCaps(cxScreenCanvas.Handle, BITSPIXEL) >= 32)); + end; + AIsAlphaUsed := AIsAlphaUsed and AImageBitmap.IsAlphaUsed; + if not AIsAlphaUsed then + AImageBitmap.TransformBitmap(btmSetOpaque); + end; + + procedure MakeMask(AImageBitmap, AMaskBitmap: TcxBitmap; AIsAlphaUsed: Boolean); + var + AImageListMask: TcxBitmap; + begin + AMaskBitmap.CopyBitmap(AImageBitmap); + if not AIsAlphaUsed then + begin + if not IsGlyphAssigned(AGlyph) then + begin + AImageListMask := TcxBitmap.CreateSize(AMaskBitmap.ClientRect); + try + TcxImageList.GetImageInfo(AImages.Handle, AImageIndex, nil, AImageListMask); + AImageListMask.TransformBitmap(btmCorrectBlend); + AMaskBitmap.Filter(AImageListMask); + finally + AImageListMask.Free; + end; + end; + if ATransparentColor <> clNone then + AMaskBitmap.TransparentPixels.Add(ATransparentColor); + if AUseLeftBottomPixelAsTransparent and IsGlyphAssigned(AGlyph) then + AMaskBitmap.TransparentPixels.Add(AMaskBitmap.TransparentColor); + end; + AMaskBitmap.TransformBitmap(btmMakeMask); + end; + + const + AImageShadowSize = 2; + var + BW, BH: Integer; + AImageBitmap, AMaskBitmap: TcxBitmap; + AConstantAlpha: Byte; + AIsAlphaUsed: Boolean; + begin + OffsetRect(AGlyphRect, -ABackgroundRect.Left, -ABackgroundRect.Top); + if not Assigned(CustomDrawImageProc) or not CustomDrawImageProc(ABitmap.Canvas, AImages, AImageIndex, AGlyph, AGlyphRect, ADrawMode) then + begin + if not IsGlyphAssigned(AGlyph) then + begin + BW := AImages.Width; + BH := AImages.Height; + end + else + begin + BW := AGlyph.Width; + BH := AGlyph.Height; + end; + + AImageBitmap := GetImageBitmap(BW, BH); + MakeImage(AImageBitmap, AIsAlphaUsed); + + AMaskBitmap := GetMaskBitmap(BW, BH); + MakeMask(AImageBitmap, AMaskBitmap, AIsAlphaUsed); + AImageBitmap.Filter(AMaskBitmap); + AConstantAlpha := $FF; + case ADrawMode of + idmFaded: + begin + AImageBitmap.TransformBitmap(btmFade); + AConstantAlpha := FadeMap.SrcConstantAlpha; + end; + idmGrayScale: + AImageBitmap.TransformBitmap(btmGrayScale); + idmDingy: + AImageBitmap.TransformBitmap(btmDingy); + idmShadowed: + begin + AImageBitmap.DrawShadow(AMaskBitmap, AImageShadowSize, clBtnShadow, True); + AGlyphRect := cxRectInflate(AGlyphRect, 0, 0, AImageShadowSize, AImageShadowSize); + OffsetRect(AGlyphRect, -AImageShadowSize div 2, -AImageShadowSize div 2); + end; + idmDisabled: + begin + if AIsAlphaUsed then + begin + AImageBitmap.TransformBitmap(btmDisable); + AConstantAlpha := DisableMap.SrcConstantAlpha; + end + else + begin + AImageBitmap.TransformBitmap(btmDirty); + AImageBitmap.DrawShadow(AMaskBitmap, 1, clBtnHighlight); + end; + end; + end; + AImageBitmap.AlphaBlend(ABitmap, AGlyphRect, ASmoothImage, AConstantAlpha); + end; + end; + +var + ADrawBitmap: TcxBitmap; +begin + if not (IsGlyphAssigned(AGlyph) or IsImageAssigned(AImages, AImageIndex)) then + Exit; + + ADrawBitmap := GetDrawBitmap(cxRectWidth(ABackgroundRect), cxRectHeight(ABackgroundRect)); + DrawBackGround(ADrawBitmap); + DrawImage(ADrawBitmap, ADrawMode); + cxDrawBitmap(ADC, ADrawBitmap, ABackgroundRect, cxNullPoint); +end; + +function GetImageListStyle(ADrawingStyle: TDrawingStyle; AImageType: TImageType): DWORD; +const + ADrawingStyles: array[TDrawingStyle] of DWORD = (ILD_FOCUS, ILD_SELECTED, ILD_NORMAL, ILD_TRANSPARENT); + AImageTypes: array[TImageType] of DWORD = (0, ILD_MASK); +begin + Result := ADrawingStyles[ADrawingStyle] or AImageTypes[AImageType]; +end; + +procedure cxDrawImageList(AImageListHandle: HIMAGELIST; AImageIndex: Integer; + ADC: HDC; APoint: TPoint; ADrawingStyle: TDrawingStyle; AImageType: TImageType); +begin + ImageList_Draw(AImageListHandle, AImageIndex, ADC, APoint.X, APoint.Y, GetImageListStyle(ADrawingStyle, AImageType)); +end; + +procedure cxDrawHatch(ADC: HDC; const ARect: TRect; AColor1, AColor2: TColor; AStep: Byte; AAlpha1: Byte = $FF; AAlpha2: Byte = $FF); +var + ADrawBitmap: TcxBitmap; +begin + ADrawBitmap := TcxBitmap.CreateSize(ARect); + try + cxBitBlt(ADrawBitmap.Canvas.Handle, ADC, ADrawBitmap.ClientRect, ARect.TopLeft, SRCCOPY); + ADrawBitmap.DrawHatch(AColor1, AColor2, AStep, AAlpha1, AAlpha2); + cxBitBlt(ADC, ADrawBitmap.Canvas.Handle, ARect, cxNullPoint, SRCCOPY); + finally + ADrawBitmap.Free; + end; +end; + +function Lanczos3Filter(Value: Single): Single; + + function SinC(Value: Single): Single; + begin + if (Value <> 0.0) then + begin + Value := Value * PI; + Result := Sin(Value) / Value + end + else Result := 1.0; + end; + +begin + if (Value < 0.0) then Value := -Value; + if (Value < 3.0) then + Result := SinC(Value) * SinC(Value / 3.0) + else + Result := 0.0; +end; + +procedure BuildFilter(out AContributorList: TContributorList; AScale: Single; ASrcSize, ADestSize: Integer); +var + I, J, APixel, AMaxContributors, AWeight: Integer; + ACenter, ARadius, AScaleFactor: Single; +begin + SetLength(AContributorList, ADestSize); + if AScale < 1.0 then AScaleFactor := 1.0 / AScale else AScaleFactor := 1.0; + ARadius := 3 * AScaleFactor; + AMaxContributors := Trunc(ARadius * 2.0 + 1); + for I := 0 to ADestSize - 1 do + with AContributorList[I] do + begin + SetLength(Contributors, AMaxContributors); + Count := 0; + ACenter := I / AScale; + for J := Floor(ACenter - ARadius) to Ceil(ACenter + ARadius) do + begin + AWeight := Round(Lanczos3Filter((ACenter - J) / AScaleFactor) / AScaleFactor * 256); + if AWeight = 0 then continue; + if J < 0 then + APixel := -J + else + if (J >= ASrcSize) then + APixel := ASrcSize - J + ASrcSize - 1 + else + APixel := J; + Contributors[Count].Pixel := APixel; + Contributors[Count].Weight := AWeight; + Inc(Count); + end; + end; +end; + +procedure ApplyFilter(var AContributorList: TContributorList; + var ASource: TRGBColors; ASrcSize, ASrcLineLength: Integer; + var ADest: TRGBColors; ADestSize, ADestLineLength: Integer; + AHorizontal: Boolean); + + function GetColorPart(Value: Integer): Integer; + begin + if Value < 0 then + Result := 0 + else + begin + Value := Value shr 8; + Result := Min(255, Value); + end; + end; + +var + AWeight: Integer; + AColor: TRGBQuad; + R, G, B, A: Integer; + K, I, J: Integer; +begin + for I := 0 to ASrcSize - 1 do + for J := 0 to ADestSize - 1 do + with AContributorList[J] do + begin + R := 0; G := 0; B := 0; A := 0; + for K := 0 to Count - 1 do + begin + if AHorizontal then + AColor := ASource[Contributors[K].Pixel + (I * ASrcLineLength)] + else + AColor := ASource[I + (Contributors[K].Pixel * ASrcLineLength)]; + AWeight := Contributors[K].Weight; + if AWeight = 0 then continue; + Inc(R, AColor.rgbRed * AWeight); + Inc(G, AColor.rgbGreen * AWeight); + Inc(B, AColor.rgbBlue * AWeight); + Inc(A, AColor.rgbReserved * AWeight); + end; + AColor.rgbRed := GetColorPart(R); + AColor.rgbGreen := GetColorPart(G); + AColor.rgbBlue := GetColorPart(B); + AColor.rgbReserved := GetColorPart(A); + if AHorizontal then + ADest[J + (I * ADestLineLength)] := AColor + else + ADest[I + (J * ADestLineLength)] := AColor; + end; + //dispose contributors and source buffer + for I := 0 to HIGH(AContributorList) do + AContributorList[I].Contributors := nil; + AContributorList := nil; + ASource := nil; +end; + +procedure cxSmoothResizeBitmap(ASource, ADestination: TBitmap; AForceUseLanczos3Filter: Boolean = False); +var + AContributorList: TContributorList; + ASrcWidth, ASrcHeight, ADestWidth, ADestHeight: Integer; + ABuffer1, ABuffer2: TRGBColors; + AOldMode: Cardinal; + AScale: Single; +begin + ADestWidth := ADestination.Width; + ADestHeight := ADestination.Height; + ASrcWidth := ASource.Width; + ASrcHeight := ASource.Height; + if (ADestWidth = 0) or (ADestHeight = 0) or (ASrcWidth = 0) or (ASrcHeight = 0) then Exit; + ASource.Canvas.Lock; + ADestination.Canvas.Lock; + try + if IsWinNT and not AForceUseLanczos3Filter then + begin + AOldMode := SetStretchBltMode(ADestination.Canvas.Handle, HALFTONE); + StretchBlt(ADestination.Canvas.Handle, 0, 0, ADestWidth, ADestHeight, + ASource.Canvas.Handle, 0, 0, ASrcWidth, ASrcHeight, srcCopy); + SetStretchBltMode(ADestination.Canvas.Handle, AOldMode); + end + else + begin + ABuffer1 := GetBitmapBits(ASource, False); + SetLength(ABuffer2, ADestWidth * ASrcHeight); + if ASrcWidth = 1 then + AScale := ADestWidth / ASrcWidth + else + AScale := (ADestWidth - 1) / (ASrcWidth - 1); + BuildFilter(AContributorList, AScale, ASrcWidth, ADestWidth); + ApplyFilter(AContributorList, ABuffer1, ASrcHeight, ASrcWidth, ABuffer2, ADestWidth, ADestWidth, True); + ABuffer1 := GetBitmapBits(ADestination, False); + if (ASrcHeight = 1) or (ADestHeight = 1) then + AScale := ADestHeight / ASrcHeight + else + AScale := (ADestHeight - 1) / (ASrcHeight - 1); + BuildFilter(AContributorList, AScale, ASrcHeight, ADestHeight); + ApplyFilter(AContributorList, ABuffer2, ADestWidth, ADestWidth, ABuffer1, ADestHeight, ADestWidth, False); + SetBitmapBits(ADestination, ABuffer1, False); + end; + finally + ASource.Canvas.Unlock; + ADestination.Canvas.Unlock; + end; +end; + +function cxCreateBitmapCopy(ASourceBitmap: TBitmap): TcxBitmap; +begin + Result := TcxBitmap.CreateSize(ASourceBitmap.Width, ASourceBitmap.Height); + Result.CopyBitmap(ASourceBitmap); +end; + +procedure cxMakeTrueColorBitmap(ASourceBitmap, ATrueColorBitmap: TBitmap); +var + AcxBitmap, AcxMask: TcxBitmap; +begin + AcxBitmap := cxCreateBitmapCopy(ASourceBitmap); + try + AcxBitmap.TransformBitmap(btmSetOpaque); + AcxMask := cxCreateBitmapCopy(ASourceBitmap); + try + AcxMask.TransparentPixels.Add(ASourceBitmap.TransparentColor); + AcxMask.TransformBitmap(btmMakeMask); + AcxBitmap.Filter(AcxMask); + ATrueColorBitmap.Assign(AcxBitmap); + finally + AcxMask.Free; + end; + finally + AcxBitmap.Free; + end; +end; + +procedure cxMakeMaskBitmap(ASourceBitmap, AMaskBitmap: TBitmap); +var + ABitmap: TcxBitmap; +begin + ABitmap := cxCreateBitmapCopy(ASourceBitmap); + try + if not ABitmap.IsAlphaUsed then + ABitmap.RecoverAlphaChannel(ASourceBitmap.TransparentColor); + ABitmap.TransformBitmap(btmMakeMask); + cxBitBlt(AMaskBitmap.Canvas.Handle, ABitmap.Canvas.Handle, ABitmap.ClientRect, cxNullPoint, SRCCOPY); + finally + ABitmap.Free; + end; +end; + +{!!! TODO: adapt to .net} + +function cxGetCursorSize: TSize; +var + IconInfo: TIconInfo; + BitmapInfoSize, BitmapBitsSize, ImageSize: DWORD; + Bitmap: PBitmapInfoHeader; + Bits: Pointer; + BytesPerScanline: Integer; + + function FindScanline(Source: Pointer; MaxLen: Cardinal; + Value: Cardinal): Cardinal; assembler; + asm + PUSH ECX + MOV ECX,EDX + MOV EDX,EDI + MOV EDI,EAX + POP EAX + REPE SCASB + MOV EAX,ECX + MOV EDI,EDX + end; + +begin + { Default value is entire icon height } + Result.cy := GetSystemMetrics(SM_CYCURSOR); + Result.cx := GetSystemMetrics(SM_CXCURSOR); + + if GetIconInfo(GetCursor, IconInfo) then + try + GetDIBSizes(IconInfo.hbmMask, BitmapInfoSize, BitmapBitsSize); + Bitmap := AllocMem(DWORD(BitmapInfoSize) + BitmapBitsSize); + try + Bits := Pointer(DWORD(Bitmap) + BitmapInfoSize); + if GetDIB(IconInfo.hbmMask, 0, Bitmap^, Bits^) and + (Bitmap^.biBitCount = 1) then + begin + { Point Bits to the end of this bottom-up bitmap } + with Bitmap^ do + begin + Result.cx := biWidth; + BytesPerScanline := ((biWidth * biBitCount + 31) and not 31) div 8; + ImageSize := biWidth * BytesPerScanline; + Bits := Pointer(DWORD(Bits) + BitmapBitsSize - ImageSize); + { Use the width to determine the height since another mask bitmap + may immediately follow } + Result.cy := FindScanline(Bits, ImageSize, $FF); + { In case the and mask is blank, look for an empty scanline in the + xor mask. } + if (Result.cy = 0) and (biHeight >= 2 * biWidth) then + Result.cy := FindScanline(Pointer(DWORD(Bits) - ImageSize), + ImageSize, $00); + Result.cy := Result.cy div BytesPerScanline; + end; + Dec(Result.cy, IconInfo.yHotSpot); + end; + finally + FreeMem(Bitmap); + end; + finally + if IconInfo.hbmColor <> 0 then DeleteObject(IconInfo.hbmColor); + if IconInfo.hbmMask <> 0 then DeleteObject(IconInfo.hbmMask); + end; +end; + +procedure cxAlphaBlend(ASource: TBitmap; ARect: TRect; + const ASelColor: TColor; Alpha: Byte = 170); +var + ARow, ACol: Integer; + SrcLine: Pointer; + C1, C2: Double; + AColorValues: array[0..3] of Byte; + P: TPoint; +begin + C1 := Alpha / 255; + C2 := 1.0 - C1; + AColorValues[0] := Round(GetBValue(ASelColor) * C1); + AColorValues[1] := Round(GetGValue(ASelColor) * C1); + AColorValues[2] := Round(GetRValue(ASelColor) * C1); + AColorValues[3] := 0; + GetWindowOrgEx(ASource.Canvas.Handle, P); + OffsetRect(ARect, -P.X, -P.Y); + for ARow := Max(ARect.Top, 0) to Min(ARect.Bottom, ASource.Height - 1) do + begin + SrcLine := ASource.ScanLine[ARow]; + ACol := Max(0, ARect.Left * 4); + while ACol < Min(ARect.Right * 4, ASource.Width * 4 - 1) do + begin + WriteByte(SrcLine, AColorValues[ACol mod 4] + Round(ReadByte(SrcLine, ACol) * C2), ACol); + Inc(ACol); + end; + end; +end; + +procedure cxAlphaBlend( + ADest, ABkSource, ASource: TBitmap; Alpha: Byte = cxDefaultAlphaValue); + + function SystemAlphaPaint: Boolean; + var + ABlendFunction: TBlendFunction; + begin + if not Assigned(VCLAlphaBlend) then + begin + Result := False; + Exit; + end; + ABlendFunction := DefaultBlendFunction; + ABlendFunction.SourceConstantAlpha := Alpha; + with ADest do + begin + Canvas.Draw(0, 0, ABkSource); // Assign(ABkSource); todo: graphics bug image not copying but _AddRef called + Result := VCLAlphaBlend(Canvas.Handle, + 0, 0, Width, Height, ASource.Canvas.Handle, 0, 0, Width, Height, ABlendFunction); + end; + end; + + procedure AlphaPaint; + var + ACount, K: Integer; + DstLine, BkSrcLine, SrcLine: Pointer; + C1, C2: Double; + begin + C1 := Alpha / 255; + C2 := 1.0 - C1; + with ASource do + begin + K := Height; + ACount := ((Width * 24 + 31) and not 31) shr 3 * K; + end; + BkSrcLine := ABkSource.ScanLine[K - 1]; + SrcLine := ASource.ScanLine[K - 1]; + DstLine := ADest.ScanLine[K - 1]; + for K := 0 to ACount - 1 do + WriteByte(DstLine, + Round(ReadByte(SrcLine, K) * C1) + Round(ReadByte(BkSrcLine, K) * C2), K); + end; + + procedure DoAlphaPaint; + begin + if GetDeviceCaps(cxScreenCanvas.Handle, BITSPIXEL) in [16, 24, 32] then + AlphaPaint + else + ADest.Canvas.Draw(0, 0, ASource); // .Assign(ASource); + end; + +begin + if not SystemAlphaPaint then DoAlphaPaint; +end; + +procedure cxApplyViewParams(ACanvas: TcxCanvas; + const AViewParams: TcxViewParams); +begin + with ACanvas do + begin + Font := AViewParams.Font; + Font.Color := AViewParams.TextColor; + Brush.Color := AViewParams.Color; + end; +end; + +procedure cxCopyImage(ASource, ADest: TBitmap; + const ASrcOffset, ADstOffset: TPoint; const ARect: TRect); +var + ADstRect, ASrcRect: TRect; +begin + ADstRect := ARect; + ASrcRect := ARect; + OffsetRect(ASrcRect, ASrcOffset.X, ASrcOffset.Y); + OffsetRect(ADstRect, ADstOffset.X, ADstOffset.Y); + ADest.Canvas.CopyRect(ASrcRect, ASource.Canvas, ADstRect); +end; + +procedure cxCopyImage(ASource, ADest: TCanvas; + const ASrcOffset, ADstOffset: TPoint; const ARect: TRect); +var + ADstRect, ASrcRect: TRect; +begin + ADstRect := ARect; + ASrcRect := ARect; + OffsetRect(ASrcRect, ASrcOffset.X, ASrcOffset.Y); + OffsetRect(ADstRect, ADstOffset.X, ADstOffset.Y); + ADest.CopyRect(ADstRect, ASource, ASrcRect); +end; + +procedure cxDrawArrows(ACanvas: TCanvas; const ARect: TRect; + ASide: TcxBorder; AColor: TColor; APenColor: TColor = clDefault); +type + TArrowPolygon = array[0..6] of TPoint; +var + ArrowRgns: array[0..1, 0..6, 0..1] of Integer; + BaseLine: array[0..1, 0..1] of Integer; + I, J, K: Integer; +begin + with ARect do + begin + BaseLine[0, 0] := Left; + BaseLine[0, 1] := Top; + BaseLine[1, 0] := Right; + BaseLine[1, 1] := Bottom; + end; + if ASide in [bLeft, bBottom] then + begin + BaseLine[Byte(ASide = bLeft), 0] := ARect.Left; + BaseLine[Byte(ASide = bLeft), 1] := ARect.Bottom; + end + else + begin + BaseLine[Byte(ASide = bTop), 0] := ARect.Right; + BaseLine[Byte(ASide = bTop), 1] := ARect.Top; + end; + Move(BaseRgns[Byte(ASide in [bTop, bBottom]) shl 1], ArrowRgns, SizeOf(ArrowRgns)); + for I := 0 to 1 do + for J := 0 to 6 do + for K := 0 to 1 do + Inc(ArrowRgns[I, J, K], BaseLine[I, K]); + ACanvas.Brush.Color := AColor; + if APenColor = clDefault then + ACanvas.Pen.Color := $FFFFFF xor ColorToRgb(AColor) + else + ACanvas.Pen.Color := APenColor; + for I := 0 to 1 do + ACanvas.Polygon(TArrowPolygon(ArrowRgns[I])); +end; + +procedure cxFillHalfToneRect( + Canvas: TCanvas; const ARect: TRect; ABkColor, AColor: TColor); +begin + with Canvas do + begin + ABkColor := SetBkColor(Handle, ColorToRgb(ABkColor)); + AColor := SetTextColor(Handle, ColorToRgb(AColor)); + Windows.FillRect(Handle, ARect, cxHalfToneBrush.Handle); + SetBkColor(Handle, ABkColor); + SetTextColor(Handle, AColor); + end; +end; + +procedure cxSetCanvasOrg(ACanvas: TCanvas; var AOrg: TRect); +begin + with AOrg do + SetWindowOrgEx(ACanvas.Handle, Left, Top, @TopLeft); +end; + +function cxGetTextExtentPoint32(ADC: THandle; const AText: string; out ASize: TSize; ACharCount: Integer = -1): Boolean; +begin + if ACharCount = -1 then + ACharCount := Length(AText); + Result := GetTextExtentPoint32(ADC, PChar(AText), ACharCount, ASize); +end; + +type + TcxPosition = record + Start: Integer; + Finish: Integer; + end; + +procedure cxGetTextLines(const AText: string; ACanvas: TcxCanvas; const ARect: TRect; ALines: TStrings); + + procedure GetNextWordPos(const AText: string; ALength: Integer; const ACurrentWord: TcxPosition; var ANextWord: TcxPosition); + + function IsDelimiter(AIndex: Integer): Boolean; + begin + Result := (cxStrCharLength(AText, AIndex) = 1) and (AText[AIndex] <= ' '); + end; + + function IsDoubleDelimiter(AIndex: Integer): Boolean; + begin + Result := (AIndex > 1) and IsDelimiter(AIndex) and IsDelimiter(cxPrevCharPos(AText, AIndex)); + end; + + function IsWordStart(AIndex: Integer): Boolean; + begin + Result := not IsDelimiter(AIndex); + end; + + function IsWordEnd(AIndex: Integer): Boolean; + begin + Result := {SysLocale.FarEast and (cxStrCharLength(AText, AIndex) > 1) or }IsDelimiter(AIndex); + end; + + var + ACharPos: Integer; + begin + ANextWord.Start := ACurrentWord.Finish + 1; + + while (ANextWord.Start < ALength) and not IsWordStart(ANextWord.Start) and not IsDoubleDelimiter(ANextWord.Start) do + ANextWord.Start := cxNextCharPos(AText, ANextWord.Start); + ACharPos := ANextWord.Start; + while (ACharPos + 1 <= ALength) and not IsWordEnd(cxNextCharPos(AText, ACharPos)) and not IsDoubleDelimiter(ACharPos) do + ACharPos := cxNextCharPos(AText, ACharPos); + ANextWord.Finish := ACharPos + cxStrCharLength(AText, ACharPos) - 1; + end; + +var + ADrawText: string; + ACurrentWord, ANextWord: TcxPosition; + ALineStart, ALength, ARectWidth: Integer; +begin + ARectWidth := cxRectWidth(ARect); + ACurrentWord.Finish := 0; + ALineStart := 1; + ALength := Length(AText); + repeat + GetNextWordPos(AText, ALength, ACurrentWord, ANextWord); + + ADrawText := Copy(AText, ALineStart, ANextWord.Finish - ALineStart + 1); + if cxTextSize(ACanvas.Handle, ADrawText).cx > ARectWidth then + begin + ALines.Add(Copy(AText, ALineStart, ACurrentWord.Finish - ALineStart + 1)); + ALineStart := ANextWord.Start; + end; + ACurrentWord := ANextWord; + until ACurrentWord.Finish >= ALength; + ALines.Add(Copy(AText, ALineStart, ALength)); +end; + +function cxDrawText(ADC: THandle; const AText: string; var ARect: TRect; AFormat: UINT; ACharCount: Integer = - 1): Integer; +begin + Result := Windows.DrawText(ADC, PChar(AText), ACharCount, ARect, AFormat); +end; + +function cxExtTextOut(ADC: THandle; const AText: string; const APoint: TPoint; + const ARect: TRect; AOptions: UINT; ACharCount: Integer = -1): Boolean; +begin + if ACharCount = -1 then + ACharCount := Length(AText); + Result := ExtTextOut(ADC, APoint.X, APoint.Y, AOptions, + @ARect, PChar(AText), ACharCount, nil); +end; + +function cxExtTextOut(ADC: THandle; const AText: string; const APoint: TPoint; + AOptions: UINT; ACharCount: Integer = -1): Boolean; overload; +begin + if ACharCount = -1 then + ACharCount := Length(AText); + Result := ExtTextOut(ADC, APoint.X, APoint.Y, AOptions, + nil, PChar(AText), ACharCount, nil); +end; + +procedure cxInvalidateRect(AHandle: THandle; const ARect: TRect; AEraseBackground: Boolean = True); +begin + InvalidateRect(AHandle, @ARect, AEraseBackground); +end; + +procedure cxInvalidateRect(AHandle: THandle; AEraseBackground: Boolean = True); +begin + InvalidateRect(AHandle, nil, AEraseBackground); +end; + +function cxTextHeight(AFont: TFont; const S: string = 'Wg'; AFontSize: Integer = 0): Integer; +begin + Result := cxTextExtent(AFont, S, AFontSize).cy; +end; + +function cxTextWidth(AFont: TFont; const S: string; AFontSize: Integer = 0): Integer; +begin + Result := cxTextExtent(AFont, S, AFontSize).cx; +end; + +function cxTextExtent(AFont: TFont; const S: string; AFontSize: Integer = 0): TSize; +begin + with cxScreenCanvas do + begin + Font.Assign(AFont); + if AFontSize <> 0 then Font.Size := AFontSize; + Result := TextExtent(S); + end; +end; + +function cxTextSize(ADC: THandle; const AText: string): TSize; // differs from cxTextExtent +var + ARect: TRect; +begin + ARect := cxGetTextRect(ADC, AText, 1); + Result := Size(ARect.Right, ARect.Bottom); +end; + +function cxGetTextRect(ADC: THandle; const AText: string; ARowCount: Integer; AReturnMaxRectHeight: Boolean = False): TRect; + +const + DT_NOFULLWIDTHCHARBREAK = $80000; + ASingleLineTextFlag = DT_SINGLELINE or DT_CALCRECT; + AMultiLineTextFlag = DT_WORDBREAK or DT_NOFULLWIDTHCHARBREAK or DT_CALCRECT; + + function GetMaxWidth: Integer; + var + R: TRect; + begin + R := cxEmptyRect; + cxDrawText(ADC, AText, R, ASingleLineTextFlag); + Result := R.Right; + end; + + function GetMinWidth: Integer; + var + R: TRect; + begin + R := Rect(0, 0, 1, 1); + cxDrawText(ADC, AText, R, AMultiLineTextFlag); + Result := R.Right; + end; + + function GetTextSize(AWidth: Integer): TRect; + begin + Result := Rect(0, 0, AWidth, 1); + cxDrawText(ADC, AText, Result, AMultiLineTextFlag); + end; + +var + AMaxTextHeight, AMaxWidth, AMinWidth, AWidth: Integer; +begin + Result := cxEmptyRect; + if ARowCount <= 0 then + Exit; + if ARowCount = 1 then + cxDrawText(ADC, AText, Result, ASingleLineTextFlag) + else + begin + AMaxTextHeight := cxTextSize(ADC, 'Wg').cy * ARowCount; + AMinWidth := GetMinWidth; + AMaxWidth := GetMaxWidth; + AWidth := (AMinWidth + AMaxWidth) div 2; + while AMaxWidth - AMinWidth > 1 do + begin + if GetTextSize(AWidth).Bottom > AMaxTextHeight then + AMinWidth := AWidth + else + AMaxWidth := AWidth; + AWidth := (AMinWidth + AMaxWidth) div 2; + end; + Result := GetTextSize(AMinWidth); + if Result.Bottom > AMaxTextHeight then + Result := GetTextSize(AMaxWidth); + if AReturnMaxRectHeight then + Result.Bottom := AMaxTextHeight; + end; +end; + +function cxGetTextRect(AFont: TFont; const AText: string; ARowCount: Integer): TRect; +begin + cxScreenCanvas.Font := AFont; + Result := cxGetTextRect(cxScreenCanvas.Handle, AText, ARowCount); +end; + +function cxGetScreenPixelsPerInch(AHorizontal: Boolean): Integer; +const + ADirectionMap: array [Boolean] of DWORD = (LOGPIXELSY, LOGPIXELSX); +begin + Result := GetDeviceCaps(cxScreenCanvas.Handle, ADirectionMap[AHorizontal]); +end; + +function cxGetStringAdjustedToWidth(ADC: HDC; AFontHandle: HFONT; const S: string; AWidth: Integer): string; overload; +var + ABuffer: packed array[0..4095] of Char; + R: TRect; + L: Integer; + ACalcDC: HDC; +begin + if (Length(S) = 0) or (AWidth < 1) then + begin + Result := ''; + Exit; + end; + FillChar(ABuffer, SizeOf(ABuffer), 0); + Move(S[1], ABuffer, Length(S)); + R := Rect(0, 0, AWidth, 32); + if ADC = 0 then ACalcDC := GetDC(0) else ACalcDC := ADC; + if AFontHandle <> 0 then + SelectObject(ACalcDC, AFontHandle); + DrawText(ACalcDC, @ABuffer, Length(S), R, DT_SINGLELINE or + DT_CALCRECT or DT_END_ELLIPSIS or DT_MODIFYSTRING); + L := StrLen(@ABuffer); + SetString(Result, PChar(@ABuffer), L); + if ADC = 0 then + ReleaseDC(0, ACalcDC); +end; + +function cxGetStringAdjustedToWidth(AFont: TFont; const S: string; AWidth: Integer): string; overload; +begin + Result := cxGetStringAdjustedToWidth(0, AFont.Handle, S, AWidth); +end; + +function cxGetBitmapData(ABitmapHandle: HBITMAP; out ABitmapData: Windows.TBitmap): Boolean; +begin + Result := GetObject(ABitmapHandle, SizeOf(Windows.TBitmap), @ABitmapData) <> 0; +end; + +function cxGetBrushData(ABrushHandle: HBRUSH; out ALogBrush: TLogBrush): Boolean; +begin + Result := GetObject(ABrushHandle, SizeOf(TLogBrush), @ALogBrush) <> 0; +end; + +function cxGetBrushData(ABrushHandle: HBRUSH): TLogBrush; +begin + cxGetBrushData(ABrushHandle, Result); +end; + +function cxGetFontData(AFontHandle: HFONT; out ALogFont: TLogFont): Boolean; +begin + Result := GetObject(AFontHandle, SizeOf(TLogFont), @ALogFont) <> 0; +end; + +function cxGetPenData(APenHandle: HPEN; out ALogPen: TLogPen): Boolean; +begin + Result := GetObject(APenHandle, SizeOf(TLogPen), @ALogPen) <> 0; +end; + +function cxGetWritingDirection(AFontCharset: TFontCharset; const AText: string): TCanvasOrientation; + + function IsStandardASCIIChar: Boolean; + begin + Result := (Length(AText) > 0) and (cxStrCharLength(AText) = 1) and (Integer(AText[1]) < 128); + end; + +begin + if AFontCharset = DEFAULT_CHARSET then + AFontCharset := GetDefFontCharset; + if not IsStandardASCIIChar and (AFontCharset in [ARABIC_CHARSET, CHINESEBIG5_CHARSET, GB2312_CHARSET]) then + Result := coRightToLeft + else + Result := coLeftToRight; +end; + +procedure cxDrawThemeParentBackground(AControl: TWinControl; ACanvas: TcxCanvas; const ARect: TRect); +begin + if AControl.Parent.DoubleBuffered or not IsThemeLibraryLoaded then + cxDrawTransparentControlBackground(AControl, ACanvas, ARect, False) + else + DrawThemeParentBackground(AControl.Handle, ACanvas.Handle, ARect); +end; + +procedure cxDrawThemeParentBackground(AControl: TWinControl; ACanvas: TCanvas; const ARect: TRect); +var + AcxCanvas: TcxCanvas; +begin + AcxCanvas := TcxCanvas.Create(ACanvas); + try + cxDrawThemeParentBackground(AControl, AcxCanvas, ARect); + finally + AcxCanvas.Free; + end; +end; + +procedure cxDrawTransparentControlBackground(AControl: TWinControl; + ACanvas: TcxCanvas; ARect: TRect; APaintParentWithChildren: Boolean = True); + + procedure cxPaintControlTo(ADrawControl: TWinControl; + AOffsetX, AOffsetY: Integer; ADrawRect: TRect); + + procedure DrawEdgesAndBorders; + var + AEdgeFlags, ABorderFlags: Integer; + ABorderRect: TRect; + begin + ABorderFlags := 0; + AEdgeFlags := 0; + if GetWindowLong(ADrawControl.Handle, GWL_EXSTYLE) and WS_EX_CLIENTEDGE <> 0 then + begin + AEdgeFlags := EDGE_SUNKEN; + ABorderFlags := BF_RECT or BF_ADJUST + end + else + if GetWindowLong(ADrawControl.Handle, GWL_STYLE) and WS_BORDER <> 0 then + begin + AEdgeFlags := BDR_OUTER; + ABorderFlags := BF_RECT or BF_ADJUST or BF_MONO; + end; + if ABorderFlags <> 0 then + begin + ABorderRect := Rect(0, 0, ADrawControl.Width, ADrawControl.Height); + DrawEdge(ACanvas.Handle, ABorderRect, AEdgeFlags, ABorderFlags); + ACanvas.SetClipRegion(TcxRegion.Create(ABorderRect), roIntersect); + MoveWindowOrg(ACanvas.Handle, ABorderRect.Left, ABorderRect.Top); + end; + end; + + var + I: Integer; + AChildControl: TControl; + begin + ACanvas.SaveDC; + try + MoveWindowOrg(ACanvas.Handle, AOffsetX, AOffsetY); + if not RectVisible(ACanvas.Handle, ADrawRect) then Exit; + + ADrawControl.ControlState := ADrawControl.ControlState + [csPaintCopy]; + try + if ADrawControl <> AControl.Parent then + DrawEdgesAndBorders; + ACanvas.Canvas.Lock; + try + ADrawControl.Perform(WM_ERASEBKGND, ACanvas.Handle, ACanvas.Handle); + ADrawControl.Perform(WM_PAINT, ACanvas.Handle, 0); + finally + ACanvas.Canvas.Unlock; + end; + if APaintParentWithChildren then + for I := 0 to ADrawControl.ControlCount - 1 do + begin + AChildControl := ADrawControl.Controls[I]; + if AChildControl = AControl then + Break; + if (AChildControl is TWinControl) and TWinControl(AChildControl).Visible then + cxPaintControlTo(TWinControl(AChildControl), AChildControl.Left, AChildControl.Top, Rect(0, 0, AChildControl.Width, AChildControl.Height)); + end; + finally + ADrawControl.ControlState := ADrawControl.ControlState - [csPaintCopy]; + end; + finally + ACanvas.RestoreDC; + end; + end; + +begin + if AControl.Parent <> nil then + begin + OffsetRect(ARect, AControl.Left, AControl.Top); + cxPaintControlTo(AControl.Parent, -ARect.Left, -ARect.Top, ARect); +// wrong cxLabel painting cxPaintControlTo(AControl.Parent, -AControl.Left, -AControl.Top, ARect); + end; +end; + +procedure cxDrawTransparentControlBackground(AControl: TWinControl; + ACanvas: TCanvas; const ARect: TRect; APaintParentWithChildren: Boolean = True); +var + AcxCanvas: TcxCanvas; +begin + AcxCanvas := TcxCanvas.Create(ACanvas); + try + cxDrawTransparentControlBackground(AControl, AcxCanvas, ARect, APaintParentWithChildren); + finally + AcxCanvas.Free; + end; +end; + +function cxScreenCanvas: TcxScreenCanvas; +begin + if ScreenCanvas = nil then + ScreenCanvas := TcxScreenCanvas.Create; + Result := ScreenCanvas; +end; + +{ TcxRegion } + +constructor TcxRegion.Create(AHandle: TcxRegionHandle); +begin + inherited Create; + FHandle := AHandle; +end; + +constructor TcxRegion.Create(const ABounds: TRect); +var + AHandle: TcxRegionHandle; +begin + AHandle := CreateRectRgnIndirect(ABounds); + Create(AHandle); +end; + +constructor TcxRegion.Create; +begin + Create(0, 0, 0, 0); +end; + +constructor TcxRegion.Create(ALeft, ATop, ARight, ABottom: Integer); +begin + Create(Rect(ALeft, ATop, ARight, ABottom)); +end; + +constructor TcxRegion.CreateRoundCorners(const ABounds: TRect; AWidthEllepse, AHeightEllepse: Integer); +begin + CreateRoundCorners(ABounds.Left, ABounds.Top, ABounds.Right, ABounds.Bottom, AWidthEllepse, AHeightEllepse); +end; + +constructor TcxRegion.CreateRoundCorners(ALeft, ATop, ARight, ABottom, AWidthEllepse, AHeightEllepse: Integer); +var + AHandle: TcxRegionHandle; +begin + AHandle := CreateRoundRectRgn(ALeft + 1, ATop + 1, ARight, ABottom, AWidthEllepse, AHeightEllepse); + Create(AHandle); +end; + +destructor TcxRegion.Destroy; +begin + DestroyHandle; + inherited; +end; + +function TcxRegion.GetBoundsRect: TRect; +begin + if GetRgnBox(FHandle, Result) = NULLREGION then + Result := cxNullRect; +end; + +function TcxRegion.GetIsEmpty: Boolean; +var + R: TRect; +begin + Result := GetRgnBox(FHandle, R) = NULLREGION; +end; + +procedure TcxRegion.DestroyHandle; +begin + if FHandle <> 0 then + begin + DeleteObject(FHandle); + FHandle := 0; + end; +end; + +procedure TcxRegion.Combine(ARegion: TcxRegion; AOperation: TcxRegionOperation; + ADestroyRegion: Boolean = True); +const + Modes: array[TcxRegionOperation] of Integer = (RGN_COPY, RGN_OR, RGN_DIFF, RGN_AND); +begin + if AOperation = roSet then + CombineRgn(FHandle, ARegion.Handle, 0, Modes[AOperation]) + else + CombineRgn(FHandle, FHandle, ARegion.Handle, Modes[AOperation]); + if ADestroyRegion then ARegion.Free; +end; + +function TcxRegion.IsEqual(ARegion: TcxRegion): Boolean; +begin + Result := (ARegion <> nil) and ((IsEmpty and ARegion.IsEmpty) or IsEqual(ARegion.Handle)); +end; + +function TcxRegion.IsEqual(ARegionHandle: TcxRegionHandle): Boolean; +begin + Result := EqualRgn(Handle, ARegionHandle); +end; + +procedure TcxRegion.Offset(DX, DY: Integer); +begin + OffsetRgn(FHandle, DX, DY); +end; + +function TcxRegion.PtInRegion(const Pt: TPoint): Boolean; +begin + Result := Windows.PtInRegion(Handle, Pt.X, Pt.Y); +end; + +function TcxRegion.PtInRegion(X, Y: Integer): Boolean; +begin + Result := PtInRegion(Point(X, Y)); +end; + +function TcxRegion.RectInRegion(const R: TRect): Boolean; +begin + Result := Windows.RectInRegion(Handle, R); +end; + +function TcxRegion.RectInRegion(ALeft, ATop, ARight, ABottom: Integer): Boolean; +begin + Result := RectInRegion(Rect(ALeft, ATop, ARight, ABottom)); +end; + +{ TcxCanvas } + +constructor TcxCanvas.Create(ACanvas: TCanvas); +begin + inherited Create; + FCanvas := ACanvas; + FSavedDCs := TList.Create; + FSavedRegions := TList.Create; +end; + +destructor TcxCanvas.Destroy; +begin + FreeAndNil(FSavedRegions); + FreeAndNil(FSavedDCs); + inherited; +end; + +function TcxCanvas.GetBrush: TBrush; +begin + Result := Canvas.Brush; +end; + +function TcxCanvas.GetCopyMode: TCopyMode; +begin + Result := Canvas.CopyMode; +end; + +function TcxCanvas.GetDCOrigin: TPoint; +var + AWindowOrg, AViewportOrg: TPoint; +begin + AWindowOrg := WindowOrg; + AViewportOrg := ViewportOrg; + Result := Point(AViewportOrg.X - AWindowOrg.X, AViewportOrg.Y - AWindowOrg.Y); +end; + +function TcxCanvas.GetFont: TFont; +begin + Result := Canvas.Font; +end; + +function TcxCanvas.GetHandle: HDC; +begin + Result := Canvas.Handle; +end; + +function TcxCanvas.GetPen: TPen; +begin + Result := Canvas.Pen; +end; + +function TcxCanvas.GetViewportOrg: TPoint; +begin + GetViewportOrgEx(Handle, Result); +end; + +function TcxCanvas.GetWindowOrg: TPoint; +begin + GetWindowOrgEx(Handle, Result); +end; + +procedure TcxCanvas.SetBrush(Value: TBrush); +begin + Canvas.Brush := Value; +end; + +procedure TcxCanvas.SetCopyMode(Value: TCopyMode); +begin + Canvas.CopyMode := Value; +end; + +procedure TcxCanvas.SetFont(Value: TFont); +begin + Canvas.Font := Value; +end; + +procedure TcxCanvas.SetPen(Value: TPen); +begin + Canvas.Pen := Value; +end; + +procedure TcxCanvas.SetPixel(X, Y: Integer; Value: TColor); +begin + Canvas.Pixels[X, Y] := Value; +end; + +procedure TcxCanvas.SetViewportOrg(const P: TPoint); +begin + SetViewportOrgEx(Handle, P.X, P.Y, nil); +end; + +procedure TcxCanvas.SetWindowOrg(const P: TPoint); +begin + SetWindowOrgEx(Handle, P.X, P.Y, nil); +end; + +procedure TcxCanvas.SynchronizeObjects(ADC: THandle); + + procedure AssignFont; + var + ALogFont: TLogFont; + begin + cxGetFontData(GetCurrentObject(ADC, OBJ_FONT), ALogFont); + Font.Handle := CreateFontIndirect(ALogFont); + Font.Color := GetTextColor(ADC); + end; + + procedure AssignBrush; + + function GetBrushStyle(const ALogBrush: TLogBrush): TBrushStyle; + begin + Result := bsSolid; + case ALogBrush.lbStyle of // TODO lbStyle = BS_PATTERN + BS_HATCHED: + case ALogBrush.lbHatch of + HS_BDIAGONAL: Result := bsBDiagonal; + HS_CROSS: Result := bsCross; + HS_DIAGCROSS: Result := bsDiagCross; + HS_FDIAGONAL: Result := bsFDiagonal; + HS_HORIZONTAL: Result := bsHorizontal; + HS_VERTICAL: Result := bsVertical; + end; + BS_HOLLOW: + Result := bsClear; + end; + end; + + var + ALogBrush: TLogBrush; + begin + cxGetBrushData(GetCurrentObject(ADC, OBJ_BRUSH), ALogBrush); + Brush.Handle := CreateBrushIndirect(ALogBrush); + Brush.Color := ALogBrush.lbColor; // required: set Color before Style + Brush.Style := GetBrushStyle(ALogBrush) + end; + + procedure AssignPen; + + function GetPenStyle(const ALogPen: TLogPen): TPenStyle; + begin + Result := TPenStyle(ALogPen.lopnStyle); + end; + + function GetPenMode: TPenMode; + const + PenModes: array[TPenMode] of Integer = + (R2_BLACK, R2_WHITE, R2_NOP, R2_NOT, R2_COPYPEN, R2_NOTCOPYPEN, R2_MERGEPENNOT, + R2_MASKPENNOT, R2_MERGENOTPEN, R2_MASKNOTPEN, R2_MERGEPEN, R2_NOTMERGEPEN, + R2_MASKPEN, R2_NOTMASKPEN, R2_XORPEN, R2_NOTXORPEN); + var + I: TPenMode; + ADrawMode: Integer; + begin + Result := pmCopy; + ADrawMode := GetROP2(ADC); + for I := Low(TPenMode) to High(TPenMode) do + if PenModes[I] = ADrawMode then + Result := I; + end; + + var + ALogPen: TLogPen; + begin + cxGetPenData(GetCurrentObject(ADC, OBJ_PEN), ALogPen); + Pen.Handle := CreatePenIndirect(ALogPen); + Pen.Color := ALogPen.lopnColor; + Pen.Style := GetPenStyle(ALogPen); + Pen.Mode := GetPenMode; + Pen.Width := ALogPen.lopnWidth.X; + end; + +begin + AssignFont; + AssignBrush; + AssignPen; +end; + +procedure TcxCanvas.AlignMultiLineTextRectVertically(var R: TRect; + const AText: string; AAlignmentVert: TcxAlignmentVert; + AWordBreak, AShowPrefix: Boolean; AEnabled: Boolean = True; + ADontBreakChars: Boolean = False); +var + ASizeR: TRect; + AFlags: Integer; +begin + if AAlignmentVert = vaTop then Exit; + ASizeR := Rect(0, 0, R.Right - R.Left - Ord(not AEnabled), 0); + AFlags := cxAlignLeft or cxAlignTop; + if AWordBreak then + AFlags := AFlags or cxWordBreak; + if AShowPrefix then + AFlags := AFlags or cxShowPrefix; + if ADontBreakChars then + AFlags := AFlags or cxDontBreakChars; + TextExtent(AText, ASizeR, AFlags); + case AAlignmentVert of + vaCenter: + R.Top := (R.Top + R.Bottom - (ASizeR.Bottom - ASizeR.Top)) div 2; + vaBottom: + R.Top := R.Bottom - (ASizeR.Bottom - ASizeR.Top + Ord(not AEnabled)); + end; +end; + +procedure TcxCanvas.CopyRect(const Dest: TRect; ACanvas: TCanvas; + const Source: TRect); +begin + Canvas.CopyRect(Dest, ACanvas, Source); +end; + +procedure TcxCanvas.Draw(X, Y: Integer; Graphic: TGraphic); +begin + Canvas.Draw(X, Y, Graphic); +end; + +procedure TcxCanvas.DrawComplexFrame(const R: TRect; + ALeftTopColor, ARightBottomColor: TColor; ABorders: TcxBorders; + ABorderWidth: Integer); +var + ABorder: TcxBorder; + + function GetBorderColor: TColor; + begin + if ABorder in [bLeft, bTop] then + Result := ALeftTopColor + else + Result := ARightBottomColor; + end; + + function GetBorderBounds: TRect; + begin + Result := R; + with Result do + case ABorder of + bLeft: + Right := Left + ABorderWidth; + bTop: + Bottom := Top + ABorderWidth; + bRight: + Left := Right - ABorderWidth; + bBottom: + Top := Bottom - ABorderWidth; + end; + end; + +begin + for ABorder := Low(ABorder) to High(ABorder) do + if ABorder in ABorders then + begin + SetBrushColor(GetBorderColor); + FillRect(GetBorderBounds); + end; +end; + +procedure TcxCanvas.DrawEdge(const R: TRect; ASunken, AOuter: Boolean; + ABorders: TcxBorders); +begin + if ASunken then + if AOuter then + DrawComplexFrame(R, clBtnShadow, clBtnHighlight, ABorders) + else + DrawComplexFrame(R, cl3DDkShadow{clBtnText}, cl3DLight{clBtnFace}, ABorders) + else + if AOuter then + DrawComplexFrame(R, cl3DLight{clBtnFace}, cl3DDkShadow{clBtnText}, ABorders) + else + DrawComplexFrame(R, clBtnHighlight, clBtnShadow, ABorders); +end; + +procedure TcxCanvas.DrawFocusRect(const R: TRect); +begin + SetBrushColor(clWhite); + Canvas.Font.Color := clBlack; + TCanvasAccess(Canvas).RequiredState([csFontValid]); + Canvas.DrawFocusRect(R); +end; + +procedure TcxCanvas.DrawGlyph(X, Y: Integer; AGlyph: TBitmap; AEnabled: Boolean = True; + ABackgroundColor: TColor = clNone{; ATempCanvas: TCanvas = nil}); +var + APrevBrushStyle: TBrushStyle; + AImageList: TImageList; + ABitmap: TBitmap; +begin + if AEnabled {and (ATempCanvas = nil)} then + begin + APrevBrushStyle := Brush.Style; + if ABackgroundColor = clNone then + Brush.Style := bsClear + else + Brush.Color := ABackgroundColor; + Canvas.BrushCopy(Bounds(X, Y, AGlyph.Width, AGlyph.Height), AGlyph, + Rect(0, 0, AGlyph.Width, AGlyph.Height), AGlyph.TransparentColor); + Brush.Style := APrevBrushStyle; + Exit; + end; + + AImageList := nil; + ABitmap := nil; + try + AImageList := TImageList.Create(nil); + AImageList.Width := AGlyph.Width; + AImageList.Height := AGlyph.Height; + if ABackgroundColor <> clNone then + //if ATempCanvas = nil then + begin + ABitmap := TBitmap.Create; + ABitmap.Width := AImageList.Width; + ABitmap.Height := AImageList.Height; + with ABitmap.Canvas do + begin + Brush.Color := ABackgroundColor; + FillRect(Rect(0, 0, ABitmap.Width, ABitmap.Height)); + end; + end + {else + with ATempCanvas do + begin + Brush.Color := ABackgroundColor; + FillRect(Bounds(X, Y, AGlyph.Width, AGlyph.Height)); + end}; + + if AGlyph.TransparentMode = tmFixed then + AImageList.AddMasked(AGlyph, AGlyph.TransparentColor) + else + AImageList.AddMasked(AGlyph, clDefault); + + if ABitmap <> nil then + begin + AImageList.Draw(ABitmap.Canvas, 0, 0, 0, AEnabled); // ??? itMask TODO + Draw(X, Y, ABitmap); + end + else + (*if ATempCanvas <> nil then + AImageList.Draw(ATempCanvas, X, Y, 0, AEnabled) // ??? itMask TODO + else*) + AImageList.Draw(Canvas, X, Y, 0, AEnabled); // ??? itMask TODO + finally + ABitmap.Free; + AImageList.Free; + end; +end; + +procedure TcxCanvas.DrawImage(Images: TCustomImageList; X, Y, Index: Integer; + Enabled: Boolean = True); +begin + if (0 <= Index) and (Index < Images.Count) then + begin + SaveDC; + Images.Draw(Canvas, X, Y, Index, Enabled); + RestoreDC; + end; +end; + +procedure TcxCanvas.DrawText(const Text: string; R: TRect; Flags: Integer; + Enabled: Boolean); +var + AUseDrawText: Boolean; + PrevBrushStyle: TBrushStyle; + PrevFontColor: TColor; + + procedure ProcessFlags; + var + ASize: TSize; + AAlignmentVert: TcxAlignmentVert; + begin + ASize := TextExtent(Text); + if (ASize.cx <= R.Right - R.Left) and (ASize.cy <= R.Bottom - R.Top) then + Flags := Flags or cxDontClip; + if AUseDrawText then + begin + if (Flags and cxSingleLine = 0) and (Flags and (cxAlignBottom or cxAlignVCenter) <> 0) then + begin + if Flags and cxAlignBottom <> 0 then + AAlignmentVert := vaBottom + else + AAlignmentVert := vaCenter; + AlignMultiLineTextRectVertically(R, Text, AAlignmentVert, + cxWordBreak and Flags <> 0, cxShowPrefix and Flags <> 0, Enabled, + cxDontBreakChars and Flags <> 0); + end; + Flags := cxFlagsToDTFlags(Flags); + end + else + begin + if ASize.cx < R.Right - R.Left then + case Flags and (cxAlignLeft or cxAlignRight or cxAlignHCenter) of + cxAlignRight: + R.Left := R.Right - ASize.cx - Ord(not Enabled); + cxAlignHCenter: + R.Left := (R.Left + R.Right - ASize.cx) div 2; + end; + if ASize.cy < R.Bottom - R.Top then + case Flags and (cxAlignTop or cxAlignBottom or cxAlignVCenter) of + cxAlignBottom: + R.Top := R.Bottom - ASize.cy - Ord(not Enabled); + cxAlignVCenter: + R.Top := (R.Top + R.Bottom - ASize.cy) div 2; + end; + if Flags and cxDontClip = 0 then + Flags := ETO_CLIPPED + else + Flags := 0; + end; + end; + + procedure DoDrawText; + begin + if AUseDrawText then + cxDrawText(Canvas.Handle, Text, R, Flags) + else + cxExtTextOut(Canvas.Handle, Text, R.TopLeft, R, Flags); + end; + +begin + if Length(Text) = 0 then Exit; + AUseDrawText := (Flags and cxSingleLine = 0) or + (Flags and (cxShowPrefix or cxShowEndEllipsis or cxShowPathEllipsis) <> 0); + ProcessFlags; + PrevBrushStyle := Brush.Style; + PrevFontColor := Font.Color; + if not Enabled then + begin + with R do + begin + Inc(Left); + Inc(Top); + end; + Brush.Style := bsClear; + Font.Color := clBtnHighlight; + DoDrawText; + OffsetRect(R, -1, -1); + Font.Color := clBtnShadow; + end; + DoDrawText; + if Brush.Style <> PrevBrushStyle then + Brush.Style := PrevBrushStyle; + Font.Color := PrevFontColor; +end; + +procedure TcxCanvas.FillRect(const R: TRect; AColor: TColor); +begin + if AColor = clNone then Exit; + if AColor <> clDefault then + SetBrushColor(AColor); + Canvas.FillRect(R); +end; + +procedure TcxCanvas.FillRect(const R: TRect; ABitmap: TBitmap = nil; + AExcludeRect: Boolean = False); +var + ABitmapSize, AOffset: TPoint; + AFirstCol, AFirstRow, ALastCol, ALastRow, I, J: Integer; + ABitmapRect, ACellRect: TRect; +begin + if IsRectEmpty(R) then Exit; + if not IsGlyphAssigned(ABitmap) then + Canvas.FillRect(R) + else + with ABitmapSize do + begin + X := ABitmap.Width; + Y := ABitmap.Height; + AFirstCol := R.Left div X; + AFirstRow := R.Top div Y; + ALastCol := R.Right div X - Ord(R.Right mod X = 0); + ALastRow := R.Bottom div Y - Ord(R.Bottom mod Y = 0); + for J := AFirstRow to ALastRow do + for I := AFirstCol to ALastCol do + begin + AOffset.X := I * X; + AOffset.Y := J * Y; + ACellRect := Bounds(AOffset.X, AOffset.Y, X, Y); + IntersectRect(ACellRect, ACellRect, R); + ABitmapRect := ACellRect; + OffsetRect(ABitmapRect, -AOffset.X, -AOffset.Y); + CopyRect(ACellRect, ABitmap.Canvas, ABitmapRect); + end; + end; + if AExcludeRect then + SetClipRegion(TcxRegion.Create(R), roSubtract); +end; + +procedure TcxCanvas.FillRect(R: TRect; const AParams: TcxViewParams; + ABorders: TcxBorders = []; ABorderColor: TColor = clDefault; + ALineWidth: Integer = 1; AExcludeRect: Boolean = False); +begin + FrameRect(R, ABorderColor, ALineWidth, ABorders, AExcludeRect); + with R do + begin + if bLeft in ABorders then + Inc(Left, ALineWidth); + if bRight in ABorders then + Dec(Right, ALineWidth); + if bTop in ABorders then + Inc(Top, ALineWidth); + if bBottom in ABorders then + Dec(Bottom, ALineWidth); + end; + SetBrushColor(AParams.Color); + FillRect(R, AParams.Bitmap, AExcludeRect); +end; + +procedure TcxCanvas.DrawDesignSelection(ARect: TRect; AWidth: Integer = cxDesignSelectionWidth); +var + I: Integer; +begin + for I := 0 to AWidth - 1 do + begin + DrawFocusRect(ARect); + InflateRect(ARect, -1, -1); + end; +end; + +procedure TcxCanvas.DrawRegion(ARegion: TcxRegion; AContentColor: TColor = clDefault; + ABorderColor: TColor = clDefault; ABorderWidth: Integer = 1; ABorderHeight: Integer = 1); +begin + DrawRegion(ARegion.Handle, AContentColor, ABorderColor, ABorderWidth, ABorderHeight); +end; + +procedure TcxCanvas.DrawRegion(ARegion: TcxRegionHandle; AContentColor: TColor = clDefault; + ABorderColor: TColor = clDefault; ABorderWidth: Integer = 1; ABorderHeight: Integer = 1); +begin + FillRegion(ARegion, AContentColor); + FrameRegion(ARegion, ABorderColor, ABorderWidth, ABorderHeight); +end; + +procedure TcxCanvas.FillRegion(ARegion: TcxRegion; AColor: TColor = clDefault); +begin + FillRegion(ARegion.Handle, AColor); +end; + +procedure TcxCanvas.FillRegion(ARegion: TcxRegionHandle; AColor: TColor = clDefault); +begin + SetBrushColor(AColor); + FillRgn(Handle, ARegion, Brush.Handle); +end; + +procedure TcxCanvas.FlipHorizontally(ABitmap: TBitmap); +var + Bits: TRGBColors; + ARow, ACol, W, H, ARowStart: Integer; + AValue: TRGBQuad; +begin + W := ABitmap.Width; + H := ABitmap.Height; + + Bits := GetBitmapBits(ABitmap, True); + ARowStart := 0; + for ARow := 0 to H - 1 do + begin + for ACol := 0 to (W - 1) div 2 do + begin + AValue := Bits[ARowStart + ACol]; + Bits[ARowStart + ACol] := Bits[ARowStart + W - 1 - ACol]; + Bits[ARowStart + W - 1 - ACol] := AValue; + end; + Inc(ARowStart, W); + end; + SetBitmapBits(ABitmap, Bits, True); +end; + +procedure TcxCanvas.FrameRegion(ARegion: TcxRegion; AColor: TColor = clDefault; + ABorderWidth: Integer = 1; ABorderHeight: Integer = 1); +begin + FrameRegion(ARegion.Handle, AColor, ABorderWidth, ABorderHeight); +end; + +procedure TcxCanvas.FrameRegion(ARegion: TcxRegionHandle; AColor: TColor = clDefault; + ABorderWidth: Integer = 1; ABorderHeight: Integer = 1); +begin + SetBrushColor(AColor); + FrameRgn(Handle, ARegion, Brush.Handle, ABorderWidth, ABorderHeight); +end; + +procedure TcxCanvas.Pie(const R: TRect; const ARadial1, ARadial2: TPoint); +begin + with R do + Canvas.Pie(Left, Top, Right, Bottom, ARadial1.X, ARadial1.Y, ARadial2.X, ARadial2.Y); +end; + +procedure TcxCanvas.Pie(const R: TRect; AStartAngle, ASweepAngle: Integer); + +{ + A * B + V = --------------------------------------------- + Sqrt(A^2 * Sin^2(Alpha) + B^2 * Cos^2(Alpha)) + + Radial.X = V * Cos(Alpha) + Radial.Y = V * Sin(Alpha) + + where: + A - horizontal ellipse semiaxis + B - vertical ellipse semiaxis + Angle - an angle between Radius-Vector and A calculated in counterclockwise direction +} + + function CalculateRadial(A, B: Integer; const ACenter: TPoint; AnAngle: Integer): TPoint; + var + Sin, Cos, V: Extended; + begin + SinCos(DegToRad(AnAngle), Sin, Cos); + if (A <> 0) and (B <> 0) then + V := A * B / Sqrt(A * A * Sin * Sin + B * B * Cos * Cos) + else + V := 0; + Result.X := ACenter.X + Round(V * Cos); + Result.Y := ACenter.Y - Round(V * Sin); + end; + +var + A, B: Integer; + Center, Radial1, Radial2: TPoint; +begin + if IsRectEmpty(R) or (ASweepAngle = 0) then Exit; + with R do + begin + A := (Right - Left) div 2; + B := (Bottom - Top) div 2; + Center.X := Left + A; + Center.Y := Top + B; + end; + Radial1 := CalculateRadial(A, B, Center, AStartAngle); + if ASweepAngle = 360 then + Radial2 := Radial1 + else + Radial2 := CalculateRadial(A, B, Center, AStartAngle + ASweepAngle); + if (Radial1.X <> Radial2.X) or (Radial1.Y <> Radial2.Y) or (ASweepAngle > 180) then + Pie(R, Radial1, Radial2); +end; + +function TcxCanvas.FontHeight(AFont: TFont): Integer; +begin + Font := AFont; + Result := TextHeight('Qq'); +end; + +procedure TcxCanvas.FrameRect(const R: TRect; Color: TColor = clDefault; + ALineWidth: Integer = 1; ABorders: TcxBorders = cxBordersAll; + AExcludeFrame: Boolean = False); +begin + if IsRectEmpty(R) then Exit; + if Color <> clDefault then + begin + SetBrushColor(Color); + end; + with R do + begin + if bLeft in ABorders then + FillRect(Rect(Left, Top, Min(Left + ALineWidth, Right), Bottom), nil, AExcludeFrame); + if bRight in ABorders then + FillRect(Rect(Max(Right - ALineWidth, Left), Top, Right, Bottom), nil, AExcludeFrame); + if bTop in ABorders then + FillRect(Rect(Left, Top, Right, Min(Top + ALineWidth, Bottom)), nil, AExcludeFrame); + if bBottom in ABorders then + FillRect(Rect(Left, Max(Bottom - ALineWidth, Top), Right, Bottom), nil, AExcludeFrame); + end; +end; + +procedure TcxCanvas.InvertFrame(const R: TRect; ABorderSize: Integer); +begin + with R do + begin + InvertRect(Rect(Left, Top, Left + ABorderSize, Bottom)); + InvertRect(Rect(Right - ABorderSize, Top, Right, Bottom)); + InvertRect(Rect(Left + ABorderSize, Top, + Right - ABorderSize, Top + ABorderSize)); + InvertRect(Rect(Left + ABorderSize, Bottom - ABorderSize, + Right - ABorderSize, Bottom)); + end; +end; + +procedure TcxCanvas.InvertRect(const R: TRect); +begin + with Canvas do + begin + CopyMode := cmDstInvert; + CopyRect(R, Canvas, R); + CopyMode := cmSrcCopy; + end; +end; + +procedure TcxCanvas.LineTo(X, Y: Integer); +begin + Canvas.LineTo(X, Y); +end; + +procedure TcxCanvas.MoveTo(X, Y: Integer); +begin + Canvas.MoveTo(X, Y); +end; + +procedure TcxCanvas.Polygon(const Points: array of TPoint); +begin + Canvas.Polygon(Points); +end; + +procedure TcxCanvas.Polyline(const Points: array of TPoint); +begin + Canvas.Polyline(Points); +end; + +procedure TcxCanvas.RotateBitmap(ABitmap: TBitmap; ARotationAngle: TcxRotationAngle; + AFlipVertically: Boolean = False); +var + SourceRGBs, DestRGBs: TRGBColors; + ARow, ACol, H, W, ASourceI, ADestI: Integer; +begin + SourceRGBs := nil; // to remove compiler's warning + if (ARotationAngle = ra0) and not AFlipVertically then exit; + H := ABitmap.Height; + W := ABitmap.Width; + + SourceRGBs := GetBitmapBits(ABitmap, True); + SetLength(DestRGBs, Length(SourceRGBs)); + + for ARow := 0 to H - 1 do + for ACol := 0 to W - 1 do + begin + ASourceI := ARow * W + ACol; + case ARotationAngle of + raPlus90: + if AFlipVertically then + ADestI := ACol * H + ARow + else + ADestI := (W - ACol - 1) * H + ARow; + ra0: + ADestI := (H - 1 - ARow) * W + ACol; + ra180: + if AFlipVertically then + ADestI := ARow * W + W - ACol - 1 + else + ADestI := (H - ARow - 1) * W + W - ACol - 1; + else + if AFlipVertically then + ADestI := (W - ACol - 1) * H + H - ARow - 1 + else + ADestI := H - 1 + ACol * H - ARow; + end; + DestRGBs[ADestI] := SourceRGBs[ASourceI]; + end; + + if ARotationAngle in [raPlus90, raMinus90] then + begin + ABitmap.Height := 0; + ABitmap.Width := H; + ABitmap.Height := W; + end; + SetBitmapBits(ABitmap, DestRGBs, True); +end; + +function TcxCanvas.TextExtent(const Text: string): TSize; +begin + TCanvasAccess(Canvas).RequiredState([csHandleValid, csFontValid]); + Result.cX := 0; + Result.cY := 0; + cxGetTextExtentPoint32(Handle, Text, Result); +end; + +procedure TcxCanvas.TextExtent(const Text: string; var R: TRect; Flags: Integer); +var + RWidth, RHeight, TextWidth, TextHeight: Integer; + + procedure CalcRSizes(var AWidth, AHeight: Integer); + begin + with R do + begin + AWidth := Right - Left; + AHeight := Bottom - Top; + end; + end; + + procedure AlignR; + begin + if Flags and DT_CENTER <> 0 then + OffsetRect(R, (RWidth - TextWidth) div 2, 0) + else + if Flags and DT_RIGHT <> 0 then + OffsetRect(R, RWidth - TextWidth, 0); + if Flags and DT_VCENTER <> 0 then + OffsetRect(R, 0, (RHeight - TextHeight) div 2) + else + if Flags and DT_BOTTOM <> 0 then + OffsetRect(R, 0, RHeight - TextHeight); + end; + +begin + CalcRSizes(RWidth, RHeight); + Flags := cxFlagsToDTFlags(Flags); + if (RWidth <= 0) and (Text <> '') then // A2079 + R.Right := R.Left + 1; + if cxDrawText(Canvas.Handle, Text, R, Flags and not DT_VCENTER or DT_CALCRECT) = 0 then + begin + R.Right := R.Left; + R.Bottom := R.Top; + end; + CalcRSizes(TextWidth, TextHeight); + AlignR; +end; + +function TcxCanvas.TextHeight(const Text: string): Integer; +begin + Result := TextExtent(Text).cy; +end; + +function TcxCanvas.TextWidth(const Text: string): Integer; +begin + Result := TextExtent(Text).cx; +end; + +procedure TcxCanvas.TransparentDraw(X, Y: Integer; ABitmap: TBitmap; AAlpha: Byte; + ABackground: TBitmap = nil); + + function BlendValues(ASource, ADestination: DWORD): DWORD; + begin + Result := MulDiv(ASource, AAlpha, 255) + MulDiv(ADestination, 255 - AAlpha, 255); + end; + + procedure BlendValue(const ASource: TRGBQuad; var ADestination: TRGBQuad); + begin + ADestination.rgbBlue := BlendValues(ASource.rgbBlue, ADestination.rgbBlue); + ADestination.rgbGreen := BlendValues(ASource.rgbGreen, ADestination.rgbGreen); + ADestination.rgbRed := BlendValues(ASource.rgbRed, ADestination.rgbRed); + end; + +var + W, H, ARow, ACol: Integer; + ABackgroundBitmap: TBitmap; + ABlendFunction: TBlendFunction; + ABits, ABackgroundBits: TRGBColors; +begin + ABits := nil; // to remove compiler's warning + W := ABitmap.Width; + H := ABitmap.Height; + + ABackgroundBitmap := TBitmap.Create; + ABackgroundBitmap.Width := W; + ABackgroundBitmap.Height := H; + + if ABackground = nil then + ABackgroundBitmap.Canvas.CopyRect(Rect(0, 0, W, H), Canvas, Bounds(X, Y, W, H)) + else + ABackgroundBitmap.Canvas.Draw(0, 0, ABackground); + + if Assigned(VCLAlphaBlend) then + begin + ABlendFunction := DefaultBlendFunction; + ABlendFunction.SourceConstantAlpha := AAlpha; + VCLAlphaBlend(ABackgroundBitmap.Canvas.Handle, + 0, 0, W, H, ABitmap.Canvas.Handle, 0, 0, W, H, ABlendFunction); + end + else + begin + ABits := GetBitmapBits(ABitmap, True); + ABackgroundBits := GetBitmapBits(ABackgroundBitmap, True); + + for ARow := 0 to H - 1 do + for ACol := 0 to W - 1 do + BlendValue(ABits[ACol * H + ARow], ABackgroundBits[ACol * H + ACol]); + + SetBitmapBits(ABackgroundBitmap, ABackgroundBits, True); + end; + + Draw(X, Y, ABackgroundBitmap); + + ABackgroundBitmap.Free; +end; + +procedure TcxCanvas.RestoreDC; +var + ALastSavedDCIndex: Integer; +begin + ALastSavedDCIndex := FSavedDCs.Count - 1; + if ALastSavedDCIndex >= 0 then + begin + Windows.RestoreDC(Handle, Integer(FSavedDCs[ALastSavedDCIndex])); + FSavedDCs.Delete(ALastSavedDCIndex); + end; +end; + +procedure TcxCanvas.SaveDC; +begin + FSavedDCs.Add(TObject(Windows.SaveDC(Handle))); +end; + +procedure TcxCanvas.RestoreClipRegion; +var + ALastSavedRegionIndex: Integer; +begin + ALastSavedRegionIndex := FSavedRegions.Count - 1; + if ALastSavedRegionIndex >= 0 then + begin + SetClipRegion(TcxRegion(FSavedRegions[ALastSavedRegionIndex]), roSet); + FSavedRegions.Delete(ALastSavedRegionIndex); + end; +end; + +procedure TcxCanvas.SaveClipRegion; +begin + FSavedRegions.Add(GetClipRegion); +end; + +procedure TcxCanvas.RestoreState; + + procedure InternalRestoreState(var ACurrentState: TcxCanvasState); + begin + Font.Assign(ACurrentState.Font); + ACurrentState.Font.Free; + Brush.Assign(ACurrentState.Brush); + ACurrentState.Brush.Free; + Pen.Assign(ACurrentState.Pen); + ACurrentState.Pen.Free; + end; + +begin + if Length(FSavedStates) > 0 then + begin + InternalRestoreState(FSavedStates[High(FSavedStates)]); + SetLength(FSavedStates, Length(FSavedStates) - 1); + RestoreDC; + end; +end; + +procedure TcxCanvas.SaveState; + + procedure InternalSaveState(var ACurrentState: TcxCanvasState); + begin + ACurrentState.Font := TFont.Create; + ACurrentState.Font.Assign(Font); + ACurrentState.Brush := TBrush.Create; + ACurrentState.Brush.Assign(Brush); + ACurrentState.Pen := TPen.Create; + ACurrentState.Pen.Assign(Pen); + end; + +begin + SaveDC; + SetLength(FSavedStates, Length(FSavedStates) + 1); + InternalSaveState(FSavedStates[High(FSavedStates)]); +end; + +procedure TcxCanvas.GetParams(var AParams: TcxViewParams); +begin + AParams.Color := Brush.Color; + AParams.Font := Font; + AParams.TextColor := Font.Color; +end; + +procedure TcxCanvas.SetParams(AParams: TcxViewParams); +begin + SetBrushColor(AParams.Color); + Font := AParams.Font; + Font.Color := AParams.TextColor; +end; + +procedure TcxCanvas.SetBrushColor(Value: TColor); +begin + if Brush.Color <> Value then + Brush.Color := Value; +end; + +procedure TcxCanvas.SetFontAngle(Value: Integer); +var + ALogFont: TLogFont; +begin + cxGetFontData(Font.Handle, ALogFont); + ALogFont.lfEscapement := Value * 10; + if Value <> 0 then + ALogFont.lfOutPrecision := OUT_TT_ONLY_PRECIS; + Font.Handle := CreateFontIndirect(ALogFont); +end; + +procedure TcxCanvas.GetTextStringsBounds(Text: string; R: TRect; Flags: Integer; + Enabled: Boolean; var ABounds: TRectArray); +var + AAlignHorz, AAlignVert, AMaxCharCount: Integer; + ATextR: TRect; + AStringSize: TSize; + + procedure PrepareRects; + begin + if not Enabled then + with R do + begin + Dec(Right); + Dec(Bottom); + end; + ATextR := R; + TextExtent(Text, ATextR, Flags); + case AAlignVert of + cxAlignBottom: + OffsetRect(ATextR, 0, R.Bottom - ATextR.Bottom); + cxAlignVCenter: + OffsetRect(ATextR, 0, (R.Bottom - ATextR.Bottom) div 2); + end; + end; + + procedure CheckMaxCharCount; + + function ProcessSpecialChars: Boolean; + const + SpecialChars = [#10, #13]; + var + I, ACharCount: Integer; + begin + Result := False; + for I := 1 to AMaxCharCount do + if Text[I] in SpecialChars then + begin + AMaxCharCount := I - 1; + ACharCount := 1; + if (I < Length(Text)) and + (Text[I + 1] in SpecialChars) and (Text[I] <> Text[I + 1]) then + Inc(ACharCount); + Delete(Text, I, ACharCount); + Result := True; + Break; + end; + end; + + procedure ProcessSpaces; + var + I: Integer; + begin + if AMaxCharCount < Length(Text) then + for I := AMaxCharCount + 1 downto 1 do + if Text[I] = ' ' then + begin + if I < AMaxCharCount then + begin + AMaxCharCount := I; + if AAlignHorz <> cxAlignLeft then + begin + Delete(Text, I, 1); + Dec(AMaxCharCount); + end; + end; + Break; + end; + end; + + begin + if not ProcessSpecialChars then + ProcessSpaces; + end; + + procedure GetStringSize; + begin + if AMaxCharCount = 0 then + AStringSize.cx := 0 + else + cxGetTextExtentPoint32(Handle, Copy(Text, 1, AMaxCharCount), AStringSize, AMaxCharCount); + end; + + function GetBounds: TRect; + begin + Result := ATextR; + with Result, AStringSize do + begin + case AAlignHorz of + cxAlignLeft: + Right := Left + cx; + cxAlignRight: + Left := Right - cx; + cxAlignHCenter: + begin + Left := (Left + Right - cx) div 2; + Right := Left + cx; + end; + end; + Bottom := Top + cy; + end; + ATextR.Top := Result.Bottom; + end; + +begin + if Text = '' then Exit; + if Flags and cxShowPrefix <> 0 then + begin + Text := StripHotKey(Text); + Flags := Flags and not cxShowPrefix; + end; + AAlignHorz := Flags and (cxAlignLeft or cxAlignRight or cxAlignHCenter); + AAlignVert := Flags and (cxAlignTop or cxAlignBottom or cxAlignVCenter); + PrepareRects; + repeat + GetTextExtentExPoint(Handle, PChar(Text), Length(Text), R.Right - R.Left, + @AMaxCharCount, nil, AStringSize); + CheckMaxCharCount; + GetStringSize; + SetLength(ABounds, High(ABounds) + 2); + ABounds[High(ABounds)] := GetBounds; + Delete(Text, 1, AMaxCharCount); + until Text = ''; +end; + +procedure TcxCanvas.BeginPath; +begin + Windows.BeginPath(Handle); +end; + +procedure TcxCanvas.EndPath; +begin + Windows.EndPath(Handle); +end; + +function TcxCanvas.PathToRegion: TcxRegion; +begin + Result := TcxRegion.Create(Windows.PathToRegion(Handle)); +end; + +procedure TcxCanvas.WidenPath; +begin + Windows.WidenPath(Handle); +end; + +procedure TcxCanvas.ExcludeClipRect(const R: TRect); +begin + with R do + Windows.ExcludeClipRect(Handle, Left, Top, Right, Bottom); +end; + +procedure TcxCanvas.IntersectClipRect(const R: TRect); +begin + with R do + Windows.IntersectClipRect(Canvas.Handle, Left, Top, Right, Bottom); +end; + +function TcxCanvas.GetClipRegion(AConsiderOrigin: Boolean = True): TcxRegion; +const + MaxRegionSize = 30000; +begin + Result := TcxRegion.Create; + if GetClipRgn(Handle, Result.Handle) = 0 then + SetRectRgn(Result.Handle, 0, 0, MaxRegionSize, MaxRegionSize); + if AConsiderOrigin then + Result.Offset(-DCOrigin.X, -DCOrigin.Y); +end; + +procedure TcxCanvas.SetClipRegion(ARegion: TcxRegion; AOperation: TcxRegionOperation; + ADestroyRegion: Boolean = True; AConsiderOrigin: Boolean = True); +var + AClipRegion: TcxRegion; + ARegionOrigin: TPoint; +begin + if AOperation = roSet then + begin + if AConsiderOrigin then + begin + ARegionOrigin := DCOrigin; + ARegion.Offset(ARegionOrigin.X, ARegionOrigin.Y); + end; + SelectClipRgn(Handle, ARegion.Handle); + if ADestroyRegion then + ARegion.Free + else + if AConsiderOrigin then + ARegion.Offset(-ARegionOrigin.X, -ARegionOrigin.Y); + end + else + begin + AClipRegion := GetClipRegion(AConsiderOrigin); + AClipRegion.Combine(ARegion, AOperation, ADestroyRegion); + SetClipRegion(AClipRegion, roSet, True, AConsiderOrigin); + end; +end; + +function TcxCanvas.RectFullyVisible(const R: TRect): Boolean; +var + AClipRegion, ARegion: TcxRegion; +begin + AClipRegion := GetClipRegion; + ARegion := TcxRegion.Create(R); + try + CombineRgn(AClipRegion.Handle, AClipRegion.Handle, ARegion.Handle, RGN_AND); + Result := AClipRegion.IsEqual(ARegion); + finally + ARegion.Free; + AClipRegion.Free; + end; +end; + +function TcxCanvas.RectVisible(const R: TRect): Boolean; +begin + Result := Windows.RectVisible(Handle, R); +end; + +{ TcxScreen } + +type + TcxScreenControl = class(TControl) + protected + function GetDeviceContext(var WindowHandle: HWnd): HDC; override; + end; + +function TcxScreenControl.GetDeviceContext(var WindowHandle: HWnd): HDC; +begin + WindowHandle := GetDesktopWindow; + Result := GetDCEx(WindowHandle, 0, DCX_CACHE or DCX_LOCKWINDOWUPDATE); +end; + +{ TScreenCanvas } + +type + TScreenCanvas = class(TControlCanvas) + public + constructor Create; + destructor Destroy; override; + end; + +constructor TScreenCanvas.Create; +begin + inherited; + Control := TcxScreenControl.Create(nil); +end; + +destructor TScreenCanvas.Destroy; +begin + FreeHandle; + Control.Free; + Control := nil; + inherited; +end; + +{ TcxScreenCanvas } + +constructor TcxScreenCanvas.Create; +begin + inherited Create(TScreenCanvas.Create); +end; + +destructor TcxScreenCanvas.Destroy; +begin + FreeAndNil(FCanvas); + inherited; +end; + +{ TcxCustomBitmap } + +constructor TcxCustomBitmap.Create; +begin + CreateSize(0, 0); +end; + +constructor TcxCustomBitmap.CreateSize(const ARect: TRect); +begin + CreateSize(cxRectWidth(ARect), cxRectHeight(ARect)); +end; + +constructor TcxCustomBitmap.CreateSize(AWidth, AHeight: Integer); +begin + CreateSize(AWidth, AHeight, pf24bit); +end; + +constructor TcxCustomBitmap.CreateSize(const ARect: TRect; APixelFormat: TPixelFormat); +begin + CreateSize(cxRectWidth(ARect), cxRectHeight(ARect), APixelFormat); +end; + +constructor TcxCustomBitmap.CreateSize(AWidth, AHeight: Integer; APixelFormat: TPixelFormat); +begin + inherited Create; + + Initialize(AWidth, AHeight, APixelFormat); +end; + +destructor TcxCustomBitmap.Destroy; +begin + FreeAndNil(FcxCanvas); + inherited; +end; + +procedure TcxCustomBitmap.BeginUpdate; +begin + Inc(FLockCount); +end; + +procedure TcxCustomBitmap.EndUpdate(AForceUpdate: Boolean = True); +begin + if FLockCount > 0 then + begin + Dec(FLockCount); + if AForceUpdate or FModified then + Changed(Self); + end; +end; + +procedure TcxCustomBitmap.CopyBitmap(ABitmap: TBitmap; ACopyMode: DWORD = SRCCOPY); +begin + CopyBitmap(ABitmap, ClientRect, cxNullPoint, ACopyMode); +end; + +procedure TcxCustomBitmap.CopyBitmap(ABitmap: TBitmap; const ADestRect: TRect; const ASrcTopLeft: TPoint; ACopyMode: DWORD); +begin + cxBitBlt(Canvas.Handle, ABitmap.Canvas.Handle, ADestRect, ASrcTopLeft, ACopyMode); +end; + +procedure TcxCustomBitmap.Clear; +begin + Canvas.Brush.Color := 0; + Canvas.FillRect(ClientRect); +end; + +procedure TcxCustomBitmap.Rotate(ARotationAngle: TcxRotationAngle; AFlipVertically: Boolean); +begin + cxCanvas.RotateBitmap(Self, ARotationAngle, AFlipVertically); +end; + +procedure TcxCustomBitmap.SetSize(AWidth, AHeight: Integer); +begin + BeginUpdate; + try +{$IFDEF DELPHI10} + inherited; +{$ELSE} + Width := AWidth; + Height := AHeight; +{$ENDIF} + finally + EndUpdate(False); + end; +end; + +procedure TcxCustomBitmap.Changed(Sender: TObject); +begin + if not ChangeLocked then + begin + inherited; + Update; + FModified := False; + end + else + FModified := True; +end; + +function TcxCustomBitmap.ChangeLocked: Boolean; +begin + Result := FLockCount > 0; +end; + +procedure TcxCustomBitmap.Initialize(AWidth, AHeight: Integer; APixelFormat: TPixelFormat); +begin + FcxCanvas := TcxCanvas.Create(Canvas); + + BeginUpdate; + try + Width := AWidth; + Height := AHeight; + PixelFormat := APixelFormat; + finally + EndUpdate; + end; +end; + +procedure TcxCustomBitmap.Update; +begin +// do nothing +end; + +const + ADXBMSignature: Integer = $4D424458; //DXBM + ADXBMVersion: Word = 1; + +procedure TcxCustomBitmap.ReadData(Stream: TStream); +var + ASize: Integer; + ASignature: Integer; + AVersion: Word; + AStreamPos: Integer; + AMemoryStream: TMemoryStream; +begin + AStreamPos := Stream.Position; + Stream.Read(ASize, SizeOf(ASize)); + Stream.Read(ASignature, SizeOf(ASignature)); + Stream.Read(AVersion, SizeOf(AVersion)); + if ASignature <> ADXBMSignature then + begin + Stream.Position := AStreamPos; + inherited ReadData(Stream); + end + else + begin + AMemoryStream := TMemoryStream.Create; + try + Decompress(Stream, AMemoryStream, ASize); + AMemoryStream.Position := 0; + inherited ReadData(AMemoryStream); + finally + AMemoryStream.Free; + end; + end; +end; + +procedure TcxCustomBitmap.WriteData(Stream: TStream); + + procedure WriteSignature(AStream: TStream; ASize, ASignaturePosition: Integer); + var + ACurrentPos: Integer; + begin + ACurrentPos := AStream.Position; + AStream.Position := ASignaturePosition; + AStream.Write(ASize, SizeOf(ASize)); + AStream.Write(ADXBMSignature, SizeOf(ADXBMSignature)); + AStream.Write(ADXBMVersion, SizeOf(ADXBMVersion)); + AStream.Position := ACurrentPos; + end; + +var + AMemoryStream: TMemoryStream; + ASignaturePosition, ADataOffset: Integer; + ASize: Integer; +begin + if CompressData then + begin + AMemoryStream := TMemoryStream.Create; + try + inherited WriteData(AMemoryStream); + AMemoryStream.Position := 0; + ASignaturePosition := Stream.Position; + ADataOffset := SizeOf(ASize) + SizeOf(ADXBMSignature) + SizeOf(ADXBMVersion); + Stream.Position := Stream.Position + ADataOffset; + Compress(AMemoryStream, Stream, AMemoryStream.Size); + finally + AMemoryStream.Free; + end; + ASize := Stream.Position - ADataOffset; + WriteSignature(Stream, ASize, ASignaturePosition); + end + else + inherited; +end; + +type + TSeekMode = (smDup, smUnique); +const + AModeMap: array[Boolean] of TSeekMode = (smDup, smUnique); + AModeMask: array[TSeekMode] of Byte = (0, 128); + +function ReadByte(AStream: TStream; AMaxPos: Integer; var AByte: Byte): Boolean; +begin + Result := AStream.Position < AMaxPos; + if Result then + AStream.Read(AByte, SizeOf(Byte)); +end; + +procedure WriteByte(AStream: TStream; AByte: Byte); +begin + AStream.Write(AByte, SizeOf(Byte)); +end; + +procedure TcxCustomBitmap.Compress(ASourceStream, ADestStream: TStream; ASize: Integer); + + function GetCounter(ASeekByte: Byte; AMode: TSeekMode; AMaxPos: Integer): Integer; + var + AByte: Byte; + begin + Result := 1; + while (Result < 125) and ReadByte(ASourceStream, AMaxPos, AByte) do + begin + if (AMode = smDup) and (AByte = ASeekByte) or (AMode = smUnique) and (AByte <> ASeekByte) then + Inc(Result) + else + begin + if AMode = smUnique then + Dec(Result); + Break; + end; + ASeekByte := AByte; + end; + end; + +var + AReadByte1, AReadByte2, AWriteByte1, AWriteByte2: Byte; + ACounter, AReadedCount: Integer; + AStreamPos, AMaxPos: Integer; + AMode: TSeekMode; +begin + AMaxPos := ASourceStream.Position + ASize; + while ReadByte(ASourceStream, AMaxPos, AReadByte1) do + begin + AReadedCount := 1; + AStreamPos := ASourceStream.Position - 1; + if ReadByte(ASourceStream, AMaxPos, AReadByte2) then + Inc(AReadedCount); + AMode := AModeMap[(AReadedCount = 1) or (AReadByte1 <> AReadByte2)]; + ASourceStream.Position := ASourceStream.Position - (AReadedCount - 1); + + ACounter := GetCounter(AReadByte1, AMode, AMaxPos); + AWriteByte1 := ACounter or AModeMask[AMode]; + WriteByte(ADestStream, AWriteByte1); + case AMode of + smUnique: + begin + ASourceStream.Position := AStreamPos; + ADestStream.CopyFrom(ASourceStream, ACounter); + end; + smDup: + begin + AWriteByte2 := AReadByte2; + WriteByte(ADestStream, AWriteByte2); + end; + end; + ASourceStream.Position := AStreamPos + ACounter; + end; +end; + +procedure TcxCustomBitmap.Decompress(ASourceStream, ADestStream: TStream; ASize: Integer); +var + AReadByte1, AReadByte2: Byte; + AMaxPos: Integer; + I: Integer; + ACounter: Integer; +begin + AMaxPos := ASourceStream.Position + ASize; + while ReadByte(ASourceStream, AMaxPos, AReadByte1) do + begin + ACounter := AReadByte1 and 127; + if (AReadByte1 and AModeMask[smUnique]) <> 0 then + ADestStream.CopyFrom(ASourceStream, ACounter) + else + begin + ReadByte(ASourceStream, AMaxPos, AReadByte2); + for I := 0 to ACounter - 1 do + WriteByte(ADestStream, AReadByte2); + end; + end; +end; + +function TcxCustomBitmap.GetClientRect: TRect; +begin + Result := Rect(0, 0, Width, Height); +end; + +{ TcxBitmap } + +const + ClrNone: TRGBQuad = (rgbBlue: $FF; rgbGreen: $FF; rgbRed: $FF; rgbReserved: $FF); + ClrTransparent: TRGBQuad = (rgbBlue: 0; rgbGreen: 0; rgbRed: 0; rgbReserved: 0); + +function cxColorIsEqual(const AColor1, AColor2: TRGBQuad): Boolean; +begin + Result := DWORD(AColor1) = DWORD(AColor2); +end; + +function cxColorEssence(const AColor: TRGBQuad): DWORD; +begin + Result := DWORD(AColor) and $00FFFFFF; +end; + +function TcxColorList.Add(AColor: TColor): Integer; +begin + Result := inherited Add(Pointer(cxColorEssence(cxColorToRGBQuad(AColor)))); +end; + +constructor TcxBitmap.CreateSize(AWidth, AHeight: Integer; APixelFormat: TPixelFormat); +begin + inherited CreateSize(AWidth, AHeight, pf32bit); + Clear; +end; + +constructor TcxBitmap.CreateSize(AWidth, AHeight: Integer; ATransparentBkColor: TRGBQuad); +begin + inherited CreateSize(AWidth, AHeight, pf32bit); + + TransparentBkColor := ATransparentBkColor; + Clear; +end; + +destructor TcxBitmap.Destroy; +begin + FreeAndNil(FTransparentPixels); + DeleteDC(FDC); + inherited; +end; + +procedure TcxBitmap.GetBitmapColors(out AColors: TRGBColors); +begin + SetLength(AColors, Width * Height); + GetDIBits(FDC, Handle, 0, Height, AColors, FBitmapInfo, DIB_RGB_COLORS); +end; + +procedure TcxBitmap.SetBitmapColors(const AColors: TRGBColors); +begin + SetDIBits(FDC, Handle, 0, Height, AColors, FBitmapInfo, DIB_RGB_COLORS); +end; + +procedure TcxBitmap.AlphaBlend(ABitmap: TcxBitmap; const ARect: TRect; ASmoothImage: Boolean; AConstantAlpha: Byte = $FF); +begin + cxAlphaBlend(ABitmap, Self, ARect, ClientRect, ASmoothImage, AConstantAlpha); +end; + +procedure TcxBitmap.Clear; +begin + if FTransparentBkColor.rgbReserved <> 0 then + TransformBitmap(btmClear) + else + inherited; +end; + +procedure TcxBitmap.DrawHatch(const AHatchData: TcxHatchData); +begin + HatchData := AHatchData; + TransformBitmap(btmHatch); +end; + +procedure TcxBitmap.DrawHatch(AColor1, AColor2: TColor; AStep, AAlpha1, AAlpha2: Byte); +var + AHatchData: TcxHatchData; +begin + AHatchData.Color1 := cxColorToRGBQuad(AColor1, $FF); + AHatchData.Alpha1 := AAlpha1; + AHatchData.Color2 := cxColorToRGBQuad(AColor2, $FF); + AHatchData.Alpha2 := AAlpha2; + AHatchData.Step := AStep; + DrawHatch(AHatchData); +end; + +procedure TcxBitmap.DrawShadow(AMaskBitmap: TcxBitmap; AShadowSize: Integer; AShadowColor: TColor; AInflateSize: Boolean); +const + DPSnaa = $00200F09; +var + AShadowBitmap, ASelfCopy: TcxBitmap; +begin + AShadowBitmap := TcxBitmap.CreateSize(Width + AShadowSize * 2, Height + AShadowSize * 2, ClrNone); + try + AShadowBitmap.CopyBitmap(AMaskBitmap, cxRectOffset(ClientRect, AShadowSize, AShadowSize), cxNullPoint); + AShadowBitmap.Canvas.Brush.Color := AShadowColor; + AShadowBitmap.Canvas.CopyMode := DPSnaa; + AShadowBitmap.Canvas.Draw(AShadowSize, AShadowSize, AShadowBitmap); + + AShadowBitmap.TransparentBkColor := ClrTransparent; + AShadowBitmap.TransformBitmap(btmCorrectBlend); + + ASelfCopy := TcxBitmap.CreateSize(Width + AShadowSize, Height + AShadowSize); + try + ASelfCopy.CopyBitmap(Self); + ASelfCopy.CopyBitmap(AShadowBitmap, ASelfCopy.ClientRect, Point(AShadowSize, AShadowSize), SRCPAINT); + if AInflateSize then + SetSize(Width + AShadowSize, Height + AShadowSize); + CopyBitmap(ASelfCopy); + finally + ASelfCopy.Free; + end; + finally + AShadowBitmap.Free; + end; +end; + +procedure TcxBitmap.Filter(AMaskBitmap: TcxBitmap); +const + DSna = $00220326; +begin + CopyBitmap(AMaskBitmap, DSna); +end; + +procedure TcxBitmap.Invert; +begin + CopyBitmap(Self, NOTSRCCOPY); +end; + +procedure TcxBitmap.MakeOpaque; +var + AColors: TRGBColors; + I: Integer; +begin + GetBitmapColors(AColors); + for I := 0 to Length(AColors) - 1 do + AColors[I].rgbReserved := $FF; + SetBitmapColors(AColors); +end; + +procedure TcxBitmap.RecoverAlphaChannel(ATransparentColor: TColor); +begin + TransparentPixels.Clear; + TransparentPixels.Add(ATransparentColor); + TransparentBkColor := cxColorToRGBQuad(ATransparentColor); + TransformBitmap(btmCorrectBlend); +end; + +procedure TcxBitmap.SetSize(AWidth, AHeight: Integer); +begin + inherited; + Clear; +end; + +procedure TcxBitmap.Shade(AMaskBitmap: TcxBitmap); +const + DSPDxax = $00E20746; +begin + AMaskBitmap.Canvas.CopyMode := cmPatInvert; + AMaskBitmap.Canvas.Draw(0, 0, AMaskBitmap); + + Canvas.CopyMode := cmSrcCopy; + Canvas.Draw(1, 1, AMaskBitmap); + + Canvas.CopyMode := DSPDxax; + Canvas.Brush.Color := clBtnShadow; + Canvas.Draw(0, 0, AMaskBitmap); + + TransformBitmap(btmCorrectBlend); +end; + +procedure TcxBitmap.TransformBitmap(AMode: TcxBitmapTransformationMode); +var + AColors: TRGBColors; + I, J: Integer; + ATransformProc: TcxBitmapTransformationProc; +begin + case AMode of + btmDingy: + ATransformProc := Dingy; + btmDirty: + ATransformProc := Dirty; + btmGrayScale: + ATransformProc := GrayScale; + btmSetOpaque: + ATransformProc := SetOpaque; + btmMakeMask: + ATransformProc := MakeMask; + btmFade: + ATransformProc := Fade; + btmDisable: + ATransformProc := Disable; + btmCorrectBlend: + ATransformProc := CorrectBlend; + btmHatch: + ATransformProc := Hatch; + btmClear: + ATransformProc := ClearColor; + else + Exit; + end; + + GetBitmapColors(AColors); + + for I := 0 to Width - 1 do + for J := 0 to Height - 1 do + begin + FCurrentColorIndex.X := I; + FCurrentColorIndex.Y := J; + + ATransformProc(AColors[J * Width + I]); + end; + + SetBitmapColors(AColors); + Changed(Self); +end; + +procedure TcxBitmap.Initialize(AWidth, AHeight: Integer; APixelFormat: TPixelFormat); +begin + FillBitmapInfoHeader(FBitmapInfo.bmiHeader, Self, False); + FDC := CreateCompatibleDC(0); + FTransparentPixels := TcxColorList.Create; + inherited; +end; + +procedure TcxBitmap.Update; +begin + UpdateBitmapInfo; +end; + +function TcxBitmap.GetIsAlphaUsed: Boolean; +var + AColors: TRGBColors; + I: Integer; +begin + Result := False; + GetBitmapColors(AColors); + for I := Low(AColors) to High(AColors) do + begin + Result := AColors[I].rgbReserved <> 0; + if Result then + Break; + end; +end; + +procedure TcxBitmap.CorrectBlend(var AColor: TRGBQuad); +begin + if not IsColorTransparent(AColor) and (AColor.rgbReserved = 0) then + AColor.rgbReserved := $FF; +end; + +procedure TcxBitmap.ClearColor(var AColor: TRGBQuad); +begin + AColor := TransparentBkColor; +end; + +procedure TcxBitmap.Dingy(var AColor: TRGBQuad); + + procedure LightColor(var AColor: Byte); + begin + AColor := GetChannelValue(AColor + MulDiv(255 - AColor, 3, 10)); + end; + + procedure BlendColor(var AColor: Byte); + begin + AColor := GetChannelValue(MulDiv(AColor, 200, 255)); + end; + +begin + if not IsColorTransparent(AColor) then + begin + if AColor.rgbReserved = $FF then + begin + LightColor(AColor.rgbRed); + LightColor(AColor.rgbGreen); + LightColor(AColor.rgbBlue); + end + else + begin + BlendColor(AColor.rgbRed); + BlendColor(AColor.rgbGreen); + BlendColor(AColor.rgbBlue); + BlendColor(AColor.rgbReserved); + end; + end; +end; + +procedure TcxBitmap.Dirty(var AColor: TRGBQuad); +var + ADirtyScreen:TRGBQuad; +begin + if not IsColorTransparent(AColor) then + begin + Scale(AColor, GrayMap); + + ADirtyScreen := cxColorToRGBQuad(clBtnShadow); + ADirtyScreen.rgbReserved := $C0; + + cxBlendFunction(ADirtyScreen, AColor, $EE); + end; +end; + +procedure TcxBitmap.Disable(var AColor: TRGBQuad); +begin + if not IsColorTransparent(AColor) then + Scale(AColor, DisableMap); +end; + +procedure TcxBitmap.Fade(var AColor: TRGBQuad); +begin + if not IsColorTransparent(AColor) then + Scale(AColor, FadeMap); +end; + +procedure TcxBitmap.GrayScale(var AColor: TRGBQuad); +var + AValue: Byte; +begin + if not IsColorTransparent(AColor) then + begin + AValue := (AColor.rgbRed + AColor.rgbGreen + AColor.rgbBlue) div 3; + AColor.rgbRed := AValue; + AColor.rgbGreen := AValue; + AColor.rgbBlue := AValue; + end; +end; + +procedure TcxBitmap.Hatch(var AColor: TRGBQuad); +begin + if Odd(FCurrentColorIndex.X div FHatchData.Step + FCurrentColorIndex.Y div FHatchData.Step) then + cxBlendFunction(FHatchData.Color2, AColor, FHatchData.Alpha2) + else + cxBlendFunction(FHatchData.Color1, AColor, FHatchData.Alpha1); +end; + +procedure TcxBitmap.MakeMask(var AColor: TRGBQuad); +begin + if IsColorTransparent(AColor) then + AColor := ClrNone + else + AColor := ClrTransparent; +end; + +procedure TcxBitmap.SetOpaque(var AColor: TRGBQuad); +begin + AColor.rgbReserved := $FF; +end; + +procedure TcxBitmap.Scale(var AColor: TRGBQuad; const AColorMap: TcxColorTransitionMap); +var + AResultValue: Byte; +begin + AResultValue := Round(AColorMap.RedScale * AColor.rgbRed + AColorMap.GreenScale * AColor.rgbGreen + AColorMap.BlueScale * AColor.rgbBlue); + AColor.rgbBlue := AResultValue; + AColor.rgbGreen := AResultValue; + AColor.rgbRed := AResultValue; +end; + +procedure TcxBitmap.UpdateBitmapInfo; +begin + FBitmapInfo.bmiHeader.biHeight := Height; + FBitmapInfo.bmiHeader.biWidth := Width; +end; + +function TcxBitmap.IsColorTransparent(const AColor: TRGBQuad): Boolean; + + function IsTransparentPixel(AColor: DWORD): Boolean; + begin + Result := TransparentPixels.IndexOf(Pointer(AColor)) <> -1; + end; + +begin + Result := cxColorIsEqual(AColor, TransparentBkColor) or IsTransparentPixel(cxColorEssence(AColor)); +end; + +{ TcxImageInfo } + +constructor TcxImageInfo.Create; +begin + inherited Create; + FImage := TcxCustomBitmap.Create; + FMask := TcxCustomBitmap.Create; + FMaskColor := clNone; +end; + +destructor TcxImageInfo.Destroy; +begin + FreeAndNil(FMask); + FreeAndNil(FImage); + inherited; +end; + +procedure TcxImageInfo.Assign(Source: TPersistent); +begin + if Source is TcxImageInfo then + begin + Image := TcxImageInfo(Source).Image; + Mask := TcxImageInfo(Source).Mask; + MaskColor := TcxImageInfo(Source).MaskColor; + end + else + inherited; +end; + +procedure TcxImageInfo.SetImage(Value: TBitmap); +begin + AssignBitmap(Value, Image); +end; + +procedure TcxImageInfo.SetMask(Value: TBitmap); +begin + AssignBitmap(Value, Mask); +end; + +procedure TcxImageInfo.AssignBitmap(ASourceBitmap, ADestBitmap: TBitmap); +begin + ADestBitmap.Assign(ASourceBitmap); + ADestBitmap.Handle; // HandleNeeded +end; + +{ TcxImageList } + +type + TcxImageInfoItem = class(TCollectionItem) + private + FImageInfo: TcxImageInfo; + + function GetCompressData: Boolean; + function GetImage: TBitmap; + function GetMask: TBitmap; + function GetMaskColor: TColor; + procedure SetCompressData(Value: Boolean); + procedure SetImage(Value: TBitmap); + procedure SetMask(Value: TBitmap); + procedure SetMaskColor(Value: TColor); + public + constructor Create(ACollection: TCollection); overload; override; + constructor Create(ACollection: TCollection; AImage, AMask: TBitmap; AMaskColor: TColor = clNone); reintroduce; overload; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + property CompressData: Boolean read GetCompressData write SetCompressData; + property ImageInfo: TcxImageInfo read FImageInfo; + published + property Image: TBitmap read GetImage write SetImage; + property Mask: TBitmap read GetMask write SetMask; + property MaskColor: TColor read GetMaskColor write SetMaskColor default clNone; + end; + + TcxImageInfoCollection = class(TCollection) + private + FCompressData: Boolean; + FImageList: TcxImageList; + procedure SetCompressData(Value: Boolean); + protected + function GetOwner: TPersistent; override; + public + constructor Create(AImageList: TcxImageList); + function Add(AImage, AMask: TBitmap; AMaskColor: TColor = clNone): TCollectionItem; + procedure Move(ACurrentIndex, ANewIndex: Integer); + procedure Delete(AIndex: Integer); + + property CompressData: Boolean read FCompressData write SetCompressData; + end; + +constructor TcxImageInfoItem.Create(ACollection: TCollection); +begin + inherited; + FImageInfo := TcxImageInfo.Create; + CompressData := TcxImageInfoCollection(ACollection).CompressData; +end; + +constructor TcxImageInfoItem.Create(ACollection: TCollection; AImage, AMask: TBitmap; AMaskColor: TColor); +begin + Create(ACollection); + Image := AImage; + Mask := AMask; + MaskColor := AMaskColor; +end; + +destructor TcxImageInfoItem.Destroy; +begin + FreeAndNil(FImageInfo); + inherited; +end; + +procedure TcxImageInfoItem.Assign(Source: TPersistent); +begin + if Source is TcxImageInfoItem then + FImageInfo.Assign(TcxImageInfoItem(Source).ImageInfo) + else + inherited; +end; + +function TcxImageInfoItem.GetCompressData: Boolean; +begin + Result := TcxCustomBitmap(Image).CompressData and TcxCustomBitmap(Mask).CompressData; +end; + +function TcxImageInfoItem.GetImage: TBitmap; +begin + Result := FImageInfo.Image; +end; + +function TcxImageInfoItem.GetMask: TBitmap; +begin + Result := FImageInfo.Mask; +end; + +function TcxImageInfoItem.GetMaskColor: TColor; +begin + Result := FImageInfo.MaskColor; +end; + +procedure TcxImageInfoItem.SetCompressData(Value: Boolean); +begin + if CompressData <> Value then + begin + TcxCustomBitmap(Image).CompressData := Value; + TcxCustomBitmap(Mask).CompressData := Value; + end; +end; + +procedure TcxImageInfoItem.SetImage(Value: TBitmap); +begin + FImageInfo.Image := Value; +end; + +procedure TcxImageInfoItem.SetMask(Value: TBitmap); +begin + FImageInfo.Mask := Value; +end; + +procedure TcxImageInfoItem.SetMaskColor(Value: TColor); +begin + FImageInfo.MaskColor := Value; +end; + +constructor TcxImageInfoCollection.Create(AImageList: TcxImageList); +begin + inherited Create(TcxImageInfoItem); + FImageList := AImageList; +end; + +function TcxImageInfoCollection.Add(AImage, AMask: TBitmap; AMaskColor: TColor = clNone): TCollectionItem; +begin + Result := TcxImageInfoItem.Create(Self, AImage, AMask, AMaskColor); +end; + +procedure TcxImageInfoCollection.Move(ACurrentIndex, ANewIndex: Integer); +begin + Items[ACurrentIndex].Index := ANewIndex; +end; + +procedure TcxImageInfoCollection.Delete(AIndex: Integer); +begin + if AIndex = -1 then + Clear + else + inherited Delete(AIndex); +end; + +function TcxImageInfoCollection.GetOwner: TPersistent; +begin + Result := FImageList; +end; + +procedure TcxImageInfoCollection.SetCompressData(Value: Boolean); +var + I: Integer; +begin + if CompressData <> Value then + begin + FCompressData := Value; + for I := 0 to Count - 1 do + TcxImageInfoItem(Items[I]).CompressData := Value; + end; +end; + +procedure cxCopyBitmap(ADestBitmap, ASrcBitmap: TBitmap); +begin + cxBitBlt(ADestBitmap.Canvas.Handle, ASrcBitmap.Canvas.Handle, + Rect(0, 0, ADestBitmap.Width, ADestBitmap.Height), cxNullPoint, SRCCOPY); +end; + +function cxCloneBitmap(ABitmap: TBitmap): TBitmap; +begin + Result := TBitmap.Create; + Result.Assign(ABitmap); +end; + +function cxCopyImage(ASrcHandle: THandle): HBITMAP; overload; + + function SystemCopyImage: HBITMAP; + begin + Result := CopyImage(ASrcHandle, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION); + end; + + function SoftwareCopyImage: HBITMAP; + var + ABitmapData: Windows.TBitmap; + AInfo: TBitmapInfo; + ADestinationBits: Pointer; + ABits: TBytes; + begin + cxGetBitmapData(ASrcHandle, ABitmapData); + if ABitmapData.bmBitsPixel = 32 then + begin + FillBitmapInfoHeader(AInfo.bmiHeader, ABitmapData.bmWidth, ABitmapData.bmHeight, False); + if ABitmapData.bmBits = nil then + begin + SetLength(ABits, ABitmapData.bmWidth * ABitmapData.bmHeight * 4); + GetDIBits(cxScreenCanvas.Handle, ASrcHandle, 0, ABitmapData.bmHeight, ABits, AInfo, 0); + ABitmapData.bmBits := ABits; + end; + Result := CreateDIBSection(cxScreenCanvas.Handle, AInfo, DIB_RGB_COLORS, ADestinationBits, 0, 0); + cxCopyData(ABitmapData.bmBits, ADestinationBits, ABitmapData.bmWidth * ABitmapData.bmHeight * 4); + end + else + Result := SystemCopyImage; + end; + +begin + if IsWin95X then + Result := SoftwareCopyImage + else + Result := SystemCopyImage; +end; + +function IsImageListsEqual(AImages1, AImages2: TCustomImageList): Boolean; +var + AStream1, AStream2: TMemoryStream; + AnAdapter1, AnAdapter2: TStreamAdapter; +begin + if AImages1.Count <> AImages2.Count then + Result := False + else + if AImages1.Count = 0 then + Result := True + else + begin + AStream1 := TMemoryStream.Create; + AStream2 := TMemoryStream.Create; + AnAdapter1 := TStreamAdapter.Create(AStream1); + AnAdapter2 := TStreamAdapter.Create(AStream2); + try + ImageList_Write(AImages1.Handle, AnAdapter1); + ImageList_Write(AImages2.Handle, AnAdapter2); + Result := (AStream1.Size = AStream2.Size) and CompareMem(AStream1.Memory, AStream2.Memory, AStream1.Size); + finally + AnAdapter2.Free; + AnAdapter1.Free; + AStream2.Free; + AStream1.Free; + end; + end; +end; + +function GetImageCount(ABitmap: TBitmap; AWidth, AHeight: Integer): Integer; +begin + if (ABitmap.Width mod AWidth) + (ABitmap.Height mod AHeight) = 0 then + Result := (ABitmap.Width div AWidth) * (ABitmap.Height div AHeight) + else + Result := 1; +end; + +destructor TcxImageList.Destroy; +begin + Finalize; + inherited; +end; + +procedure TcxImageList.Assign(Source: TPersistent); +var + AImages: TCustomImageList; +begin + if Source is TCustomImageList then + begin + BeginUpdate; + try + inherited; + Clear; + AImages := TCustomImageList(Source); + if AImages is TcxImageList then + InternalCopyImageInfos(TcxImageList(AImages), 0, AImages.Count - 1) + else + InternalCopyImages(AImages, 0, AImages.Count - 1); + finally + EndUpdate; + end; + end; +end; + +function TcxImageList.Add(AImage, AMask: TBitmap): Integer; +var + AImageHandle, AMaskHandle: HBITMAP; + AMaskBits: TBytes; +begin + AImageHandle := GetImageHandle(AImage); + if AMask = nil then + begin + SetLength(AMaskBits, AImage.Width * AImage.Height); + AMaskHandle := CreateBitmap(Width, Height, 1, 1, AMaskBits); + end + else + AMaskHandle := AMask.Handle; + Result := ImageList_Add(Handle, AImageHandle, AMaskHandle); + if NeedSynchronizeImageInfo and (Result <> -1) then + AddToInternalCollection(AImage, AMask); + if AMask = nil then + DeleteObject(AMaskHandle); + Change; +end; + +function TcxImageList.AddIcon(AIcon: TIcon): Integer; +var + AImage, AMask: TBitmap; +begin + BeginUpdate; + try + Result := inherited AddIcon(AIcon); + if NeedSynchronizeImageInfo and (Result <> -1) then + begin + AImage := cxCreateBitmap(Width, Height, pf32bit); + AMask := cxCreateBitmap(Width, Height, pf1bit); + try + GetImageInfo(Handle, Count - 1, AImage, AMask); + AddToInternalCollection(AImage, AMask); + finally + AMask.Free; + AImage.Free + end; + end; + finally + EndUpdate; + end; +end; + +function TcxImageList.AddMasked(AImage: TBitmap; AMaskColor: TColor): Integer; +var + ACloneImage: TBitmap; +begin + BeginUpdate; + try + if AMaskColor = clNone then + Result := Add(AImage, nil) + else + begin + ACloneImage := cxCloneBitmap(AImage); + try + Result := ImageList_AddMasked(Handle, ACloneImage.Handle, ColorToRGB(AMaskColor)); + finally + ACloneImage.Free; + end; + if NeedSynchronizeImageInfo and (Result <> -1) then + AddToInternalCollection(AImage, nil, AMaskColor); + end; + finally + EndUpdate; + end; +end; + +procedure TcxImageList.Move(ACurIndex, ANewIndex: Integer); +var + AStep, AIndex: Integer; +begin + BeginUpdate; + try + AStep := cxSign(ANewIndex - ACurIndex); + AIndex := ACurIndex; + while AIndex <> ANewIndex do + begin + ImageList_Copy(Handle, AIndex + AStep, Handle, AIndex, ILCF_SWAP); + Inc(AIndex, AStep); + end; + if NeedSynchronizeImageInfo then + TcxImageInfoCollection(FImages).Move(ACurIndex, ANewIndex); + finally + EndUpdate; + end; +end; + +procedure TcxImageList.Delete(AIndex: Integer); +begin + BeginUpdate; + try + inherited; + if NeedSynchronizeImageInfo then + TcxImageInfoCollection(FImages).Delete(AIndex); + finally + EndUpdate; + end; +end; + +function TcxImageList.AddImage(AValue: TCustomImageList; AIndex: Integer): Integer; +begin + if (AValue <> nil) and (AIndex < AValue.Count) then + begin + Result := Count; + CopyImages(AValue, AIndex, AIndex); + end + else + Result := -1; +end; + +procedure TcxImageList.AddImages(AImageList: TCustomImageList); +begin + if AImageList <> nil then + begin + BeginUpdate; + try + CopyImages(AImageList); + finally + EndUpdate; + end; + end; +end; + +procedure TcxImageList.CopyImages(AImageList: TCustomImageList; AStartIndex, AEndIndex: Integer); +var + AcxImageList: TcxImageList; +begin + BeginUpdate; + try + AcxImageList := TcxImageList.Create(nil); + try + AcxImageList.Assign(AImageList); + if AEndIndex < 0 then + AEndIndex := AImageList.Count - 1 + else + AEndIndex := Min(AImageList.Count - 1, AEndIndex); + InternalCopyImageInfos(AcxImageList, AStartIndex, AEndIndex); + finally + AcxImageList.Free; + end; + finally + EndUpdate; + end; +end; + +procedure TcxImageList.Clear; +begin + Delete(-1); +end; + +procedure TcxImageList.Insert(AIndex: Integer; AImage, AMask: TBitmap); +var + I, ACurIndex: Integer; +begin + if (AIndex >= 0) and (AIndex <= Count) then + begin + BeginUpdate; + try + ACurIndex := Add(AImage, AMask); + for I := 0 to GetImageCount(AImage, Width, Height) - 1 do + Move(ACurIndex + I, AIndex + I); + finally + EndUpdate; + end; + end; +end; + +procedure TcxImageList.InsertIcon(AIndex: Integer; AIcon: TIcon); +begin + if (AIndex >= 0) and (AIndex <= Count) then + begin + BeginUpdate; + try + Move(AddIcon(AIcon), AIndex); + finally + EndUpdate; + end; + end; +end; + +procedure TcxImageList.InsertMasked(AIndex: Integer; AImage: TBitmap; AMaskColor: TColor); +var + I, ACurIndex: Integer; +begin + if (AIndex >= 0) and (AIndex <= Count) then + begin + BeginUpdate; + try + ACurIndex := AddMasked(AImage, AMaskColor); + for I := 0 to GetImageCount(AImage, Width, Height) - 1 do + Move(ACurIndex + I, AIndex + I); + finally + EndUpdate; + end; + end; +end; + +procedure TcxImageList.Replace(AIndex: Integer; AImage, AMask: TBitmap); +begin + BeginUpdate; + try + Delete(AIndex); + Insert(AIndex, AImage, AMask); + finally + EndUpdate; + end; +end; + +procedure TcxImageList.ReplaceIcon(AIndex: Integer; AIcon: TIcon); +begin + BeginUpdate; + try + Delete(AIndex); + InsertIcon(AIndex, AIcon); + finally + EndUpdate; + end; +end; + +procedure TcxImageList.ReplaceMasked(AIndex: Integer; AImage: TBitmap; AMaskColor: TColor); +begin + BeginUpdate; + try + Delete(AIndex); + InsertMasked(AIndex, AImage, AMaskColor); + finally + EndUpdate; + end; +end; + +function TcxImageList.LoadImage(AInstance: THandle; const AResourceName: string; + AMaskColor: TColor = clDefault; AWidth: Integer = 0; AFlags: TLoadResources = []): Boolean; +const + AFlagMap: array [TLoadResource] of DWORD = (LR_DEFAULTCOLOR, LR_DEFAULTSIZE, LR_LOADFROMFILE, + LR_LOADMAP3DCOLORS, LR_LOADTRANSPARENT, LR_MONOCHROME); +var + I: TLoadResource; + ALoadFlags: DWORD; + AHandle: HImageList; + ARGBColor: DWORD; + AImageList: TImageList; +begin + if AMaskColor = clNone then + ARGBColor := CLR_NONE + else + if AMaskColor = clDefault then + ARGBColor := CLR_DEFAULT + else + ARGBColor := ColorToRGB(AMaskColor); + ALoadFlags := LR_CREATEDIBSECTION; + for I := Low(TLoadResource) to High(TLoadResource) do + if I in AFlags then + ALoadFlags := ALoadFlags or AFlagMap[I]; + AHandle := ImageList_LoadImage(AInstance, PChar(AResourceName), AWidth, AllocBy, ARGBColor, + IMAGE_BITMAP, ALoadFlags); + Result := AHandle <> 0; + if Result then + begin + AImageList := TImageList.Create(Self); + try + AImageList.Handle := AHandle; + CopyImages(AImageList); + finally + AImageList.Free; + end; + end; +end; + +function TcxImageList.GetResource(AResType: TResType; const AName: string; + AWidth: Integer; ALoadFlags: TLoadResources; AMaskColor: TColor): Boolean; +begin + Result := inherited GetResource(AResType, AName, AWidth, ALoadFlags, AMaskColor); + SynchronizeImageInfo; +end; + +function TcxImageList.GetInstRes(AInstance: THandle; AResType: TResType; const AName: string; + AWidth: Integer; ALoadFlags: TLoadResources; AMaskColor: TColor): Boolean; +begin + Result := inherited GetInstRes(AInstance, AResType, AName, AWidth, ALoadFlags, AMaskColor); + SynchronizeImageInfo; +end; + +function TcxImageList.GetInstRes(AInstance: THandle; AResType: TResType; AResID: DWORD; + AWidth: Integer; ALoadFlags: TLoadResources; AMaskColor: TColor): Boolean; +begin + Result := inherited GetInstRes(AInstance, AResType, AResID, AWidth, ALoadFlags, AMaskColor); + SynchronizeImageInfo; +end; + +function TcxImageList.ResourceLoad(AResType: TResType; const AName: string; AMaskColor: TColor): Boolean; +begin + Result := inherited ResourceLoad(AResType, AName, AMaskColor); + SynchronizeImageInfo; +end; + +function TcxImageList.ResInstLoad(AInstance: THandle; AResType: TResType; + const AName: string; AMaskColor: TColor): Boolean; +begin + Result := inherited ResInstLoad(AInstance, AResType, AName, AMaskColor); + SynchronizeImageInfo; +end; + +procedure TcxImageList.BeginUpdate; +begin + Inc(FLockCount); +end; + +procedure TcxImageList.EndUpdate(AForceUpdate: Boolean = True); +begin + if FLockCount > 0 then + begin + Dec(FLockCount); + if AForceUpdate then + Change; + end; +end; + +{$IFNDEF DELPHI6} +procedure TcxImageList.Draw(ACanvas: TCanvas; X, Y, AIndex: Integer; + ADrawingStyle: TDrawingStyle; AImageType: TImageType; AEnabled: Boolean); +begin + if HandleAllocated then + DoDraw(AIndex, ACanvas, X, Y, GetImageListStyle(ADrawingStyle, AImageType), AEnabled); +end; +{$ENDIF} + +procedure TcxImageList.Draw(ACanvas: TCanvas; const ARect: TRect; AIndex: Integer; + AStretch, ASmoothResize, AEnabled: Boolean); +begin + DoDrawEx(AIndex, ACanvas, ARect, GetImageListStyle(DrawingStyle, ImageType), AStretch, ASmoothResize, AEnabled); +end; + +procedure TcxImageList.GetImageInfo(AIndex: Integer; AImage, AMask: TBitmap); + + procedure GetBitmap(ADestBitmap, ASrcBitmap: TBitmap); + begin + ADestBitmap.Width := ASrcBitmap.Width; + ADestBitmap.Height := ASrcBitmap.Height; + cxCopyBitmap(ADestBitmap, ASrcBitmap); + end; + +var + ASourceImage: TBitmap; +begin + if (0 <= AIndex) and (AIndex < Count) then + begin + ASourceImage := TcxImageInfoItem(FImages.Items[AIndex]).ImageInfo.Image; + if ASourceImage.PixelFormat = pf32bit then + begin + if AImage <> nil then + GetBitmap(AImage, ASourceImage); + if AMask <> nil then + GetBitmap(AMask, TcxImageInfoItem(FImages.Items[AIndex]).ImageInfo.Mask); + end + else + GetImageInfo(Handle, AIndex, AImage, AMask); + ASourceImage.Dormant; + end; +end; + +procedure TcxImageList.GetImage(AIndex: Integer; AImage: TBitmap); +begin + GetImageInfo(AIndex, AImage, nil); +end; + +procedure TcxImageList.GetMask(AIndex: Integer; AMask: TBitmap); +begin + GetImageInfo(AIndex, nil, AMask); +end; + +class procedure TcxImageList.GetImageInfo(AHandle: HIMAGELIST; AIndex: Integer; AImage, AMask: TBitmap); + + procedure GetBitmap(ASrcHandle: HBITMAP; ADestBitmap: TBitmap; ACopyAll: Boolean; const ARect: TRect); + + procedure CopyRect; + var + ASrcBitmap: TBitmap; + AWidth, AHeight: Integer; + begin + ASrcBitmap := TBitmap.Create; + try + ASrcBitmap.Handle := cxCopyImage(ASrcHandle); + AWidth := cxRectWidth(ARect); + AHeight := cxRectHeight(ARect); + ADestBitmap.Width := AWidth; + ADestBitmap.Height := AHeight; + cxBitBlt(ADestBitmap.Canvas.Handle, ASrcBitmap.Canvas.Handle, + cxRect(0, 0, AWidth, AHeight), ARect.TopLeft, SRCCOPY); + TBitmapAccess(ADestBitmap).Changed(ADestBitmap); + finally + ASrcBitmap.Free; + end; + end; + + begin + if ACopyAll then + ADestBitmap.Handle := cxCopyImage(ASrcHandle) + else + CopyRect; + end; + +var + AImageInfo: TImageInfo; + ACopyAll: Boolean; +begin + ACopyAll := AIndex = -1; + if ACopyAll then + AIndex := 0; + if ImageList_GetImageInfo(AHandle, AIndex, AImageInfo) then + begin + if AMask <> nil then + GetBitmap(AImageInfo.hbmMask, AMask, ACopyAll, AImageInfo.rcImage); + if AImage <> nil then + GetBitmap(AImageInfo.hbmImage, AImage, ACopyAll, AImageInfo.rcImage); + DeleteObject(AImageInfo.hbmImage); + DeleteObject(AImageInfo.hbmMask); + end; +end; + +function TcxImageList.ChangeLocked: Boolean; +begin + Result := FLockCount > 0; +end; + +procedure TcxImageList.Change; +begin + if not ChangeLocked then + inherited Change; +end; + +procedure TcxImageList.DoDraw(Index: Integer; Canvas: TCanvas; X, Y: Integer; + Style: Cardinal; Enabled: Boolean = True); +begin + DoDrawEx(Index, Canvas, cxRectBounds(X, Y, Width, Height), Style, False, False, Enabled); +end; + +procedure TcxImageList.DoDrawEx(AIndex: Integer; ACanvas: TCanvas; + const ARect: TRect; AStyle: Cardinal; AStretch, ASmoothResize, AEnabled: Boolean); +const + ADrawModes: array [Boolean] of TcxImageDrawMode = (idmDisabled, idmNormal); +var + AGlyphRect: TRect; + ADrawBitmap: TBitmap; +begin + if AStretch then + AGlyphRect := ARect + else + AGlyphRect := cxRectCenter(ARect, Width, Height); + if AlphaBlending then + cxDrawImage(ACanvas.Handle, AGlyphRect, ARect, nil, Self, AIndex, ADrawModes[AEnabled], ASmoothResize) + else + begin + if AStretch then + begin + ADrawBitmap := cxCreateBitmap(Width, Height, pfDevice); + try + inherited DoDraw(AIndex, ADrawBitmap.Canvas, 0, 0, AStyle, AEnabled); + cxDrawImage(ACanvas.Handle, AGlyphRect, ARect, ADrawBitmap, nil, 0, ADrawModes[AEnabled], ASmoothResize); + finally + ADrawBitmap.Free; + end; + end + else + inherited DoDraw(AIndex, ACanvas, AGlyphRect.Left, AGlyphRect.Top, AStyle, AEnabled); + end; +end; + +procedure TcxImageList.Initialize; +begin + inherited; + FImages := TcxImageInfoCollection.Create(Self); + FAlphaBlending := True; + inherited Handle := ImageList_Create(Width, Height, ILC_COLOR32 or ILC_MASK, AllocBy, AllocBy); +end; + +procedure TcxImageList.Finalize; +begin + FreeAndNil(FImages); +end; + +const + ADXILSignature: Integer = $494C4458; //DXIL + ADXILVersion: Word = 1; + +procedure TcxImageList.DefineProperties(Filer: TFiler); + + function DoWriteImageInfo: Boolean; + begin + if (Filer.Ancestor <> nil) and (Filer.Ancestor is TCustomImageList) then + Result := not IsImageListsEqual(TCustomImageList(Filer.Ancestor), Self) + else + Result := Count > 0; + end; + + function DoWriteDesignInfo: Boolean; + begin + Result := (Filer.Ancestor = nil) or not (Filer.Ancestor is TCustomImageList) or + (TCustomImageList(Filer.Ancestor).DesignInfo <> DesignInfo); + end; + +var + AOldSaveFormat: Boolean; +begin +{$IFDEF cxImageListOldSaveFormat} + AOldSaveFormat := True; +{$ELSE} + AOldSaveFormat := False; +{$ENDIF} + + Filer.DefineProperty('FormatVersion', ReadFormatVersion, WriteFormatVersion, not AOldSaveFormat); + + + if (csReading in ComponentState) or AOldSaveFormat and (csWriting in ComponentState) then + begin + inherited; + if csReading in ComponentState then + SynchronizeImageInfo; + end; + + Filer.DefineProperty('DesignInfo', ReadDesignInfo, WriteDesignInfo, not AOldSaveFormat and DoWriteDesignInfo); + Filer.DefineProperty('ImageInfo', ReadImageInfo, WriteImageInfo, not AOldSaveFormat and DoWriteImageInfo); +end; + +procedure TcxImageList.Dormant; +var + I: Integer; +begin + for I := 0 to FImages.Count - 1 do + DormantImage(I); +end; + +procedure TcxImageList.AddImageInfo(AImageInfo: TcxImageInfo); +begin + if IsGlyphAssigned(AImageInfo.Mask) then + Add(AImageInfo.Image, AImageInfo.Mask) + else + AddMasked(AImageInfo.Image, AImageInfo.MaskColor); +end; + +procedure TcxImageList.InternalCopyImageInfos(AImageList: TcxImageList; AStartIndex, AEndIndex: Integer); +var + I: Integer; + AImageInfo: TcxImageInfo; +begin + AImageInfo := TcxImageInfo.Create; + try + for I := Max(AStartIndex, 0) to AEndIndex do + begin + AImageList.GetImageInfo(I, AImageInfo); + AddImageInfo(AImageInfo); + end; + finally + AImageInfo.Free; + end; +end; + +procedure TcxImageList.InternalCopyImages(AImageList: TCustomImageList; AStartIndex, AEndIndex: Integer); +var + I: Integer; + AImage, AMask: TBitmap; +begin + AImage := cxCreateBitmap(Width, Height, pf32bit); + AMask := cxCreateBitmap(Width, Height, pf1bit); + try + for I := Max(AStartIndex, 0) to AEndIndex do + begin + GetImageInfo(AImageList.Handle, I, AImage, AMask); + Add(AImage, AMask); + end; + finally + AImage.Free; + AMask.Free; + end; +end; + +procedure TcxImageList.GetImageInfo(AIndex: Integer; AImageInfo: TcxImageInfo); +begin + if (0 <= AIndex) and (AIndex < Count) then + AImageInfo.Assign(TcxImageInfoItem(FImages.Items[AIndex]).ImageInfo) + else + begin + AImageInfo.Image := nil; + AImageInfo.Mask := nil; + AImageInfo.MaskColor := clNone; + end; +end; + +function TcxImageList.GetCompressData: Boolean; +begin + Result := TcxImageInfoCollection(FImages).CompressData; +end; + +procedure TcxImageList.SetCompressData(Value: Boolean); +begin + TcxImageInfoCollection(FImages).CompressData := Value; +end; + +function TcxImageList.GetHandle: HImageList; +begin + Result := inherited Handle; +end; + +procedure TcxImageList.SetHandle(Value: HImageList); +var + AImageList: TCustomImageList; +begin + AImageList := TCustomImageList.Create(Self); + try + AImageList.Handle := Value; + Assign(AImageList); + ImageList_Destroy(Value); + finally + AImageList.Free; + end; +end; + +procedure TcxImageList.ReadFormatVersion(AReader: TReader); +begin + FFormatVersion := AReader.ReadInteger; +end; + +procedure TcxImageList.WriteFormatVersion(AWriter: TWriter); +begin + FFormatVersion := ADXILVersion; + AWriter.WriteInteger(FFormatVersion); +end; + +procedure TcxImageList.ReadImageInfo(AReader: TReader); +begin + FImages.Clear; + AReader.ReadValue; + AReader.ReadCollection(FImages); + SynchronizeHanle; +end; + +procedure TcxImageList.WriteImageInfo(AWriter: TWriter); +begin + AWriter.WriteCollection(FImages); +end; + +procedure TcxImageList.ReadDesignInfo(AReader: TReader); +begin + DesignInfo := AReader.ReadInteger; +end; + +procedure TcxImageList.WriteDesignInfo(AWriter: TWriter); +begin + AWriter.WriteInteger(DesignInfo); +end; + +function TcxImageList.NeedSynchronizeImageInfo: Boolean; +begin + Result := not FSynchronization; +end; + +procedure TcxImageList.SynchronizeImageInfo; +var + I: Integer; + AImage, AMask: TBitmap; +begin + FImages.BeginUpdate; + try + FImages.Clear; + AImage := cxCreateBitmap(Width, Height, pf32bit); + AMask := cxCreateBitmap(Width, Height, pf1bit); + try + for I := 0 to Count - 1 do + begin + GetImageInfo(Handle, I, AImage, AMask); + TcxImageInfoCollection(FImages).Add(AImage, AMask); + end; + finally + AMask.Free; + AImage.Free; + end; + finally + FImages.EndUpdate; + end; +end; + +procedure TcxImageList.SynchronizeHanle; +var + I: Integer; + AImageInfoItem: TcxImageInfoItem; +begin + BeginUpdate; + try + FSynchronization := True; + try + Clear; + for I := 0 to FImages.Count - 1 do + begin + AImageInfoItem := TcxImageInfoItem(FImages.Items[I]); + AddImageInfo(AImageInfoItem.ImageInfo); + DormantImage(I); + end; + finally + FSynchronization := False; + end; + finally + EndUpdate; + end; +end; + +procedure TcxImageList.AddToInternalCollection(AImage, AMask: TBitmap; AMaskColor: TColor); + + procedure InternalAddToInternalCollection(AImage, AMask: TBitmap; AMaskColor: TColor); + var + AItem: TCollectionItem; + begin + AItem := TcxImageInfoCollection(FImages).Add(AImage, AMask, AMaskColor); + DormantImage(AItem.Index); + end; + +var + AColCount, ARowCount, AColIndex, ARowIndex: Integer; + ASourceRect: TRect; + ADestBitmap, ADestMask: TcxCustomBitmap; +begin + if (((AImage.Width mod Width) + (AImage.Height mod Height)) = 0) and + ((AImage.Width <> Width) or (AImage.Height <> Height)) then + begin + AColCount := AImage.Width div Width; + ARowCount := AImage.Height div Height; + + ADestBitmap := TcxCustomBitmap.CreateSize(Width, Height, AImage.PixelFormat); + if IsGlyphAssigned(AMask) then + ADestMask := TcxCustomBitmap.CreateSize(Width, Height, AMask.PixelFormat) + else + ADestMask := nil; + try + for ARowIndex := 0 to ARowCount - 1 do + for AColIndex := 0 to AColCount - 1 do + begin + ASourceRect := Rect(AColIndex * Width, ARowIndex * Height, (AColIndex + 1) * Width, (ARowIndex + 1) * Height); + ADestBitmap.Canvas.CopyRect(ADestBitmap.ClientRect, AImage.Canvas, ASourceRect); + if IsGlyphAssigned(AMask) then + begin + ADestMask.Clear; + ADestMask.Canvas.CopyRect(ADestMask.ClientRect, AMask.Canvas, ASourceRect); + end; + InternalAddToInternalCollection(ADestBitmap, ADestMask, AMaskColor); + end; + finally + ADestMask.Free; + ADestBitmap.Free; + end; + end + else + InternalAddToInternalCollection(AImage, AMask, AMaskColor); +end; + +procedure TcxImageList.DormantImage(AIndex: Integer); +begin + TcxImageInfoItem(FImages.Items[AIndex]).ImageInfo.Image.Dormant; +end; + +function TcxImageList.GetImageHandle(AImage: TBitmap): Integer; +begin + if AImage <> nil then + Result := AImage.Handle + else + Result := 0; +end; + +class function TcxImageList.GetPixelFormat(AHandle: HIMAGELIST): Integer; +var + AImageInfo: TImageInfo; + ABitmap: Windows.TBitmap; +begin + Result := 0; + if ImageList_GetImageInfo(AHandle, 0, AImageInfo) then + begin + cxGetBitmapData(AImageInfo.hbmImage, ABitmap); + Result := ABitmap.bmBitsPixel; + DeleteObject(AImageInfo.hbmImage); + DeleteObject(AImageInfo.hbmMask); + end; +end; + +const + SystemBrushes: TList = nil; + SysColorPrefix = {$IFDEF DELPHI7} clSystemColor {$ELSE} $80000000 {$ENDIF}; + BrushDataSize = SizeOf(TcxBrushData); + scxBrushCacheReleaseUnusedBrush = 'Release unused brush'; + +destructor TcxBrushCache.Destroy; +var + I: Integer; +begin + try + for I := 0 to FCount - 1 do + FData[I].Brush.Free; + finally + inherited Destroy; + end; +end; + +procedure TcxBrushCache.BeginUpdate; +begin + Inc(FLockRef); +end; + +procedure TcxBrushCache.EndUpdate; +begin + Inc(FLockRef); + if (FLockRef = 0) and (FDeletedCount <> 0) then Pack; +end; + +procedure TcxBrushCache.ReleaseBrush(var ABrush: TBrush); +var + AIndex: Integer; +begin + if ABrush <> nil then + begin + if not IsSystemBrush(ABrush) and IndexOf(ABrush.Color, AIndex) then + begin + with FData[AIndex] do + begin + Dec(RefCount); + CacheCheck(RefCount < 0, scxBrushCacheReleaseUnusedBrush); + if RefCount <= 0 then Delete(AIndex); + end; + end; + end; +end; + +procedure TcxBrushCache.SetBrushColor(var ABrush: TBrush; AColor: TColor); +begin + ReleaseBrush(ABrush); + ABrush := Add(AColor); +end; + +function TcxBrushCache.Add(AColor: TColor): TBrush; +begin + if AColor and SysColorPrefix <> 0 then + Result := TBrush(SystemBrushes[AColor and not SysColorPrefix]) + else + Result := AddItemAt(FindNearestItem(AColor), AColor); + Result.Color := AColor; +end; + +function TcxBrushCache.AddItemAt(AIndex: Integer; AColor: TColor): TBrush; +var + Delta: Integer; +begin + if (AIndex >= FCount) or (FData[AIndex].Color <> AColor) then + begin + if FCapacity <= FCount then + begin + Delta := FCapacity shr 2; + if Delta < 8 then Delta := 8; + Inc(FCapacity, Delta); + SetLength(FData, FCapacity); + end; + if AIndex < FCount then Move(AIndex, AIndex + 1, FCount - AIndex); + InitItem(FData[AIndex], AColor); + Inc(FCount); + end + else + if FData[AIndex].RefCount = 0 then Dec(FDeletedCount); + Inc(FData[AIndex].RefCount); + Result := FData[AIndex].Brush; +end; + +procedure TcxBrushCache.CacheCheck(Value: Boolean; const AMessage: string); +begin + if Value then + raise EBrushCache.Create(AMessage); +end; + +procedure TcxBrushCache.Delete(AIndex: Integer); +begin + if FLockRef = 0 then + begin + FData[AIndex].Brush.Free; + Dec(FCount); + if AIndex < FCount then + Move(AIndex + 1, AIndex, FCount - AIndex); + end + else + Inc(FDeletedCount); +end; + +function TcxBrushCache.IndexOf(AColor: TColor; out AIndex: Integer): Boolean; +begin + AIndex := -1; + if (AColor and SysColorPrefix = 0) then + AIndex := FindNearestItem(AColor); + Result := (AIndex >= 0) and (AIndex < FCount) and (FData[AIndex].Color = AColor); +end; + +procedure TcxBrushCache.InitItem(var AItem: TcxBrushData; AColor: TColor); +begin + FillChar(AItem, BrushDataSize, 0); + AItem.Brush := TBrush.Create; + AItem.Brush.Color := AColor; +end; + +function TcxBrushCache.IsSystemBrush(ABrush: TBrush): Boolean; +begin + Result := ABrush = nil; + Result := Result or ((ABrush.Color and SysColorPrefix) <> 0); +end; + +function TcxBrushCache.FindNearestItem(AColor: TColor): Integer; + + function Check(Min, Max: Integer): Integer; + begin + Result := Max; + if AColor <= FData[Min].Color then + Result := Min + else + if AColor > FData[Max].Color then + AColor := Max + 1; + end; + +var + A, B, C: Integer; +begin + if FCount > 0 then + begin + A := 0; + B := FCount - 1; + if (FData[0].Color >= AColor) or (FData[B].Color <= AColor) then + Result := Check(A, B) + else + begin + while A < B do + begin + C := (A + B) shr 1; + with FData[C] do + begin + if Color < AColor then + A := C + else + if Color > AColor then + B := C + else + B := A; + end; + end; + Result := Check(A, B); + end; + end + else + Result := 0; +end; + +procedure TcxBrushCache.Move(ASrc, ADst, ACount: Integer); +begin + System.Move(FData[ASrc], FData[ADst], ACount * BrushDataSize); +end; + +procedure TcxBrushCache.Pack; +var + I, ACount: Integer; +begin + try + ACount := 0; + I := FCount - 1; + while (ACount < FDeletedCount) and (I >= 0) do + begin + if FData[I].RefCount < 0 then + begin + Delete(I); + Inc(ACount); + end; + Dec(I); + end; + finally + FDeletedCount := 0; + end; +end; + +procedure TcxBrushCache.Recreate; +var + I: Integer; +begin + for I := 0 to FCount - 1 do + with FData[I] do Brush.Color := Color; +end; + +procedure TcxBrushCache.Release(AIndex: Integer); +begin + Dec(FData[AIndex].RefCount); + if FData[AIndex].RefCount = 0 then Delete(AIndex); +end; + +procedure InitSystemBrushes; +var + I: Word; + ABrush: TBrush; +begin + SystemBrushes := TList.Create; + for I := COLOR_SCROLLBAR to COLOR_ENDCOLORS do + begin + ABrush := TBrush.Create; + ABrush.Handle := GetSysColorBrush(I); + SystemBrushes.Add(ABrush); + end; +end; + +procedure DestroySystemBrushes; +var + I: Integer; +begin + try + for I := 0 to SystemBrushes.Count - 1 do + TBrush(SystemBrushes[I]).Free; + finally + SystemBrushes.Free; + end; +end; + +procedure InitPredefinedBrushes; +var + ABitmap: HBitmap ; +const + APattern: array[0..7] of Word = + ($00AA, $0055, $00AA, $0055, $00AA, $0055, $00AA, $0055); +begin + cxHalfToneBrush := TBrush.Create; + InitSystemBrushes; + ABitmap := CreateBitmap(8, 8, 1, 1, @APattern); + cxHalfToneBrush.Handle := CreatePatternBrush(ABitmap); + DeleteObject(ABitmap); +end; + +procedure DestroyPredefinedBrushes; +begin + DestroySystemBrushes; +{$IFDEF DELPHI9} +{$IFNDEF DELPHI10} + cxHalfToneBrush.Bitmap.Free; +{$ENDIF} +{$ENDIF} + cxHalfToneBrush.Free; +end; + +var + ALib: Integer; + +initialization + InitPredefinedBrushes; + ALib := LoadLibrary('msimg32.dll'); + if ALib <> 0 then + VCLAlphaBlend := GetProcAddress(ALib, 'AlphaBlend') + else + VCLAlphaBlend := nil; + +finalization + if ALib <> 0 then FreeLibrary(ALib); + DestroyPredefinedBrushes; + FreeAndNil(ScreenCanvas); + FreeAndNil(MaskBitmap); + FreeAndNil(ImageBitmap); + FreeAndNil(DrawBitmap); + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxImageListEditor.pas b/official/x.35/ExpressLibrary/Sources/cxImageListEditor.pas new file mode 100644 index 00000000..9d839e27 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxImageListEditor.pas @@ -0,0 +1,1120 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxImageListEditor; + +{$I cxVer.inc} + +interface + +uses + dxGDIPlusAPI, dxGDIPlusClasses, + Windows, SysUtils, Classes, ImgList, ComCtrls, Controls, Graphics, Forms, Dialogs, + cxClasses, cxGeometry, cxGraphics; + +type + TcxEditorImageInfo = class(TcxImageInfo) + private + FAlphaUsed: Boolean; + protected + procedure SetImage(Value: TBitmap); override; + public + property AlphaUsed: Boolean read FAlphaUsed; + end; + + TcxImageFileFormat = record + Name: string; + Ext: string; + GraphicClass: TGraphicClass; + end; + + TcxImageFileFormatList = array of TcxImageFileFormat; + + TcxImageFileFormats = class + private + FList: TcxImageFileFormatList; + + function Count: Integer; + function GetItem(Index: Integer): TcxImageFileFormat; + + property Items[Index: Integer]: TcxImageFileFormat read GetItem; + public + procedure Register(const AName, AExt: string; AGraphicClass: TGraphicClass); +//TODO: procedure UnRegister(AGraphicClass: TGraphicClass); + function GetGraphicClass(const AFileName: string): TGraphicClass; + function GetFilter: string; + end; + + TcxImageListEditorAddMode = (amAdd, amInsert, amReplace); + + TcxImageListEditor = class + private + FChanged: Boolean; + FImageListModified: Boolean; + + FDataControl: TListView; + FImageList: TcxImageList; + FOriginalImageList: TcxImageList; + + FImportList: TStrings; + FVisibleImportList: TStrings; + + FEditorForm: TForm; + FSplitBitmaps: TModalResult; + FUpdateCount: Integer; + + FOnChange: TNotifyEvent; + + procedure AddDataItems(AImageList: TcxImagelist); + procedure AddImage(AImage, AMask: TBitmap; AMaskColor: TColor; var AInsertedImageIndex: Integer); + procedure Change; + procedure ClearSelection; + procedure DeleteDataItem(Sender: TObject; Item: TListItem); + procedure DeleteImage(AIndex: Integer); + function GetImagesCount: Integer; + function GetDataItems: TListItems; + function GetDefaultTransparentColor(AImage, AMask: TBitmap): TColor; + function GetFocusedImageIndex: Integer; + function GetImageHeight: Integer; + function GetImagesInfo(Index: Integer): TcxEditorImageInfo; + function GetImageWidth: Integer; + procedure ImageListChanged; + procedure SelectDataItem(Sender: TObject; Item: TListItem; Selected: Boolean); + procedure SetFocusedImageIndex(AValue: Integer); + procedure SetImageList(AValue: TcxImageList); + procedure SetImagesInfo(Index: Integer; AValue: TcxEditorImageInfo); + procedure SetImportList(AValue: TStrings); + + procedure UpdateImageList; + procedure UpdateVisibleImportList; + public + constructor Create; + destructor Destroy; override; + + function Edit(AImageList: TcxImagelist): Boolean; + + procedure AddImages(AFiles: TStrings; AAddMode: TcxImageListEditorAddMode); + procedure ClearImages; + procedure DeleteSelectedImages; + procedure ExportImages(const AFileName: string); + function InternalAddImage(AImage, AMask: TBitmap; AFileName: string; + var AInsertedItemIndex: Integer; AMultiSelect: Boolean): Integer; + procedure ImportImages(AImageList: TCustomImageList); + procedure MoveImage(ASourceImageIndex, ADestImageIndex: Integer); + + function IsAnyImageSelected: Boolean; + + procedure BeginUpdate; + procedure EndUpdate; + function IsUpdateLocked: Boolean; + + procedure ApplyChanges; + function IsChanged: Boolean; + procedure UpdateTransparentColor(AColor: TColor); + function ChangeImagesSize(AValue: TSize): Boolean; + procedure SynchronizeData(AStartIndex, ACount: Integer); + + property DataControl: TListView read FDataControl; + property DataItems: TListItems read GetDataItems; + property FocusedImageIndex: Integer read GetFocusedImageIndex write SetFocusedImageIndex; + property ImageHeight: Integer read GetImageHeight; + property ImageList: TcxImageList read FImageList write SetImageList; + property ImageListModified: Boolean read FImageListModified; + property ImagesCount: Integer read GetImagesCount; + property ImagesInfo[Index: Integer]: TcxEditorImageInfo read GetImagesInfo write SetImagesInfo; + property ImageWidth: Integer read GetImageWidth; + property ImportList: TStrings read FImportList write SetImportList; + property OriginalImageList: TcxImageList read FOriginalImageList; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + end; + +function cxImageFileFormats: TcxImageFileFormats; +function cxEditImageList(AImageList: TcxImageList; AImportList: TStrings): Boolean; +procedure PngImageListTocxImageList(APngImages: TComponent; AImages: TcxImageList); + +implementation + +uses + Types, Math, cxImageListEditorView; + +var + FImageFileFormats: TcxImageFileFormats; + +type + TcxImageListAccess = class(TcxImageList); + + TcxIcon = class(TIcon) + public + procedure GetImageInfo(AImageInfo: TcxImageInfo); + procedure HandleNeeded; + end; + +procedure TcxIcon.GetImageInfo(AImageInfo: TcxImageInfo); +var + AImages: TcxImageListAccess; +begin + HandleNeeded; + AImages := TcxImageListAccess.CreateSize(Width, Height); + try + AImages.AddIcon(Self); + AImages.GetImageInfo(0, AImageInfo); + finally + AImages.Free; + end; +end; + +procedure TcxIcon.HandleNeeded; +begin + Handle; +end; + +function cxImageFileFormats: TcxImageFileFormats; +begin + Result := FImageFileFormats; +end; + +function cxEditImageList(AImageList: TcxImageList; AImportList: TStrings): Boolean; +var + AImageListEditor: TcxImageListEditor; +begin + Result := False; + if AImageList = nil then + Exit; + AImageListEditor := TcxImageListEditor.Create; + try + AImageListEditor.ImportList := AImportList; + Result := AImageListEditor.Edit(AImageList); + finally + AImageListEditor.Free; + end; +end; + +function IsIndexValid(AIndex, ACount: Integer): Boolean; +begin + Result := (AIndex >= 0) and (AIndex < ACount); +end; + +function IsBitmapAlphaUsed(AImage: TBitmap): Boolean; +var + ATempBitmap: TcxBitmap; +begin + ATempBitmap := TcxBitmap.Create; + ATempBitmap.Assign(AImage); + try + Result := ATempBitmap.IsAlphaUsed; + finally + ATempBitmap.Free; + end; +end; + +procedure AddImageFromBinaryData(WriteData: TStreamProc; AImages: TcxImageList); +var + AStream: TMemoryStream; + ACount: Longint; + B: TBitmap; +begin + AStream := TMemoryStream.Create; + try + WriteData(AStream); + ACount := AStream.Size; + if ACount > 0 then + begin + AStream.Write(AStream.Memory^, ACount); + AStream.Position := 0; + with TdxPNGImage.Create do + try + LoadFromStream(AStream); + B := GetAsBitmap; + try + AImages.Add(B, nil); + finally + B.Free; + end; + finally + Free; + end; + end; + finally + AStream.Free; + end; +end; + +procedure ProcessPngImageList(AInputSteram: TMemoryStream; AImages: TcxImageList); +var + ASaveSeparator: Char; + AParser: TParser; + + function ConvertOrderModifier: Integer; + begin + Result := -1; + if AParser.Token = '[' then + begin + AParser.NextToken; + AParser.CheckToken(toInteger); + Result := AParser.TokenInt; + AParser.NextToken; + AParser.CheckToken(']'); + AParser.NextToken; + end; + end; + + procedure ConvertHeader(AIsInherited, AIsInline: Boolean); + var + AClassName, AObjectName: string; + begin + AParser.CheckToken(toSymbol); + AClassName := AParser.TokenString; + AObjectName := ''; + if AParser.NextToken = ':' then + begin + AParser.NextToken; + AParser.CheckToken(toSymbol); + AObjectName := AClassName; + AClassName := AParser.TokenString; + AParser.NextToken; + end; + ConvertOrderModifier; + end; + + procedure ConvertProperty; forward; + + procedure ConvertValue(const APropName: string); + + procedure SkipString; + begin + while AParser.NextToken = '+' do + begin + AParser.NextToken; + if not (AParser.Token in [toString, toWString]) then + AParser.CheckToken(toString); + end; + end; + + procedure SkipBinaryData; + var + S: TMemoryStream; + begin + S := TMemoryStream.Create; + try + AParser.HexToBinary(S); + finally + S.Free; + end; + end; + + begin + if AParser.Token in [toString, toWString] then + SkipString + else + begin + case AParser.Token of + toSymbol, toInteger, toFloat:; + '[': + begin + AParser.NextToken; + if AParser.Token <> ']' then + while True do + begin + if AParser.NextToken = ']' then Break; + AParser.CheckToken(','); + AParser.NextToken; + end; + end; + '(': + begin + AParser.NextToken; + while AParser.Token <> ')' do + ConvertValue(''); + end; + '{': + begin + if APropName = 'PngImage.Data' then + AddImageFromBinaryData(AParser.HexToBinary, AImages) + else + SkipBinaryData; + end; + '<': + begin + AParser.NextToken; + while AParser.Token <> '>' do + begin + AParser.CheckTokenSymbol('item'); + AParser.NextToken; + ConvertOrderModifier; + AParser.TokenString; + while not AParser.TokenSymbolIs('end') do ConvertProperty; + AParser.NextToken; + end; + end; + else + raise Exception.Create('Convert error'); + end; + AParser.NextToken; + end; + end; + + procedure ConvertProperty; + var + APropName: string; + begin + AParser.CheckToken(toSymbol); + APropName := AParser.TokenString; + AParser.NextToken; + while AParser.Token = '.' do + begin + AParser.NextToken; + AParser.CheckToken(toSymbol); + APropName := APropName + '.' + AParser.TokenString; + AParser.NextToken; + end; + AParser.CheckToken('='); + AParser.NextToken; + ConvertValue(APropName); + end; + + procedure ConvertObject; + var + AInheritedObject: Boolean; + AInlineObject: Boolean; + begin + AInheritedObject := False; + AInlineObject := False; + if AParser.TokenSymbolIs('INHERITED') then + AInheritedObject := True + else if AParser.TokenSymbolIs('INLINE') then + AInlineObject := True + else + AParser.CheckTokenSymbol('OBJECT'); + AParser.NextToken; + ConvertHeader(AInheritedObject, AInlineObject); + while not AParser.TokenSymbolIs('END') and + not AParser.TokenSymbolIs('OBJECT') and + not AParser.TokenSymbolIs('INHERITED') and + not AParser.TokenSymbolIs('INLINE') do + ConvertProperty; + while not AParser.TokenSymbolIs('END') do + ConvertObject; + end; + +begin + AParser := TParser.Create(AInputSteram); + ASaveSeparator := DecimalSeparator; + DecimalSeparator := '.'; + try + ConvertObject; + finally + DecimalSeparator := ASaveSeparator; + AParser.Free; + end; +end; + +procedure PngImageListTocxImageList(APngImages: TComponent; AImages: TcxImageList); +var + S, D: TMemoryStream; +begin + S := TMemoryStream.Create; + try + S.WriteComponent(APngImages); + S.Position := 0; + D := TMemoryStream.Create; + try + ObjectBinaryToText(S, D); + S.Position := 0; + D.Position := 0; + ProcessPngImageList(D, AImages); + finally + D.Free; + end; + finally + S.Free; + end; +end; + +{ TcxEditorImageInfo } + +procedure TcxEditorImageInfo.SetImage(Value: TBitmap); +begin + inherited; + FAlphaUsed := IsBitmapAlphaUsed(Image); +end; + +{ TcxImageFileFormats } + +procedure TcxImageFileFormats.Register(const AName, AExt: string; AGraphicClass: TGraphicClass); +begin + SetLength(FList, Count + 1); + FList[Count - 1].Name := AName; + FList[Count - 1].Ext := AExt; + FList[Count - 1].GraphicClass := AGraphicClass; +end; + +function TcxImageFileFormats.GetGraphicClass(const AFileName: string): TGraphicClass; +var + I: Integer; + AExt: string; +begin + Result := nil; + AExt := ExtractFileExt(AFileName); + for I := 0 to Count - 1 do + if SameText(AExt, Items[I].Ext) then + Result := Items[I].GraphicClass; +end; + +function TcxImageFileFormats.GetFilter: string; +var + I: Integer; + AAllExtentions, AAllImages: string; +begin + AAllExtentions := ''; + AAllImages := ''; + for I := 0 to Count - 1 do + begin + if AAllExtentions = '' then + AAllExtentions := '*' + Items[I].Ext + else + AAllExtentions := AAllExtentions + ';*' + Items[I].Ext; + if AAllImages = '' then + AAllImages := Items[I].Name + '|*' + Items[I].Ext + else + AAllImages := AAllImages + '|' + Items[I].Name + '|*' + Items[I].Ext; + end; + Result := 'All supported image types|' + AAllExtentions + '|' + AAllImages; +end; + +function TcxImageFileFormats.Count: Integer; +begin + Result := Length(FList); +end; + +function TcxImageFileFormats.GetItem(Index: Integer): TcxImageFileFormat; +begin + Result := FList[Index]; +end; + +{ TcxImageListEditor } + +constructor TcxImageListEditor.Create; +begin + inherited Create; + FImageList := TcxImageList.Create(nil); + FEditorForm := TcxImageListEditorForm.Create(Self); + FImportList := TStringList.Create; + FVisibleImportList := TStringList.Create; + + FDataControl := TcxImageListEditorForm(FEditorForm).GetVisualDataControl; + FDataControl.SmallImages := ImageList; + FDataControl.LargeImages := ImageList; + FDataControl.OnDeletion := DeleteDataItem; + FDataControl.OnSelectItem := SelectDataItem; +end; + +destructor TcxImageListEditor.Destroy; +begin + ClearImages; + FDataControl.OnSelectItem := nil; + FDataControl.OnDeletion := nil; + FDataControl := nil; + FreeAndNil(FVisibleImportList); + FreeAndNil(FImportList); + FreeAndNil(FEditorForm); + FreeAndNil(FImageList); + inherited; +end; + +function TcxImageListEditor.Edit(AImageList: TcxImagelist): Boolean; +var + ACaption: string; +begin + ImageList := AImageList; + ACaption := AImageList.Name; + if AImageList.Owner <> nil then + ACaption := AImageList.Owner.Name + '.' + ACaption; + FEditorForm.Caption := ACaption; + FEditorForm.ShowModal; + Result := FImageListModified; +end; + +procedure TcxImageListEditor.AddImages(AFiles: TStrings; AAddMode: TcxImageListEditorAddMode); + + function GetImageInfoFromFile(const AFileName: string; AImageInfo: TcxImageInfo): Boolean; + var + AGraphic: TGraphic; + AGraphicClass: TGraphicClass; + begin + AImageInfo.Image := nil; + AImageInfo.Mask := nil; + AImageInfo.MaskColor := clNone; + AGraphicClass := cxImageFileFormats.GetGraphicClass(AFileName); + Result := AGraphicClass <> nil; + if Result then + begin + AGraphic := AGraphicClass.Create; + try + AGraphic.LoadFromFile(AFileName); + if AGraphic is TdxPNGImage then // TODO: + AImageInfo.Image := TdxPNGImage(AGraphic).GetAsBitmap + else + if AGraphic is TcxIcon then + begin + AGraphic.Width := ImageWidth; + AGraphic.Height := ImageHeight; + TcxIcon(AGraphic).GetImageInfo(AImageInfo) + end + else //TBitmap + AImageInfo.Image := TBitmap(AGraphic); + finally + AGraphic.Free; + end; + end; + end; + +var + AImageInfo: TcxImageInfo; + I, AInsertedItemIndex: Integer; +begin + case AAddMode of + amAdd: + AInsertedItemIndex := ImagesCount; + amInsert: + AInsertedItemIndex := Max(0, FocusedImageIndex); + else {amReplace} + AInsertedItemIndex := FocusedImageIndex; + DeleteImage(AInsertedItemIndex); + end; + + FSplitBitmaps := mrNone; + ClearSelection; + Application.ProcessMessages; + AImageInfo := TcxImageInfo.Create; + try + for I := 0 to AFiles.Count - 1 do + if GetImageInfoFromFile(AFiles[I], AImageInfo) then + InternalAddImage(AImageInfo.Image, AImageInfo.Mask, AFiles[I], AInsertedItemIndex, AFiles.Count > 1); + finally + AImageInfo.Free; + end; + FocusedImageIndex := AInsertedItemIndex - 1; +end; + +procedure TcxImageListEditor.ClearImages; +begin + DataItems.Clear; + UpdateImageList; +end; + +procedure TcxImageListEditor.DeleteSelectedImages; +var + ASelectedIndex: Integer; + I: Integer; +begin + if not IsAnyImageSelected then + Exit; + ASelectedIndex := FocusedImageIndex; + for I := ImagesCount - 1 downto 0 do + if DataItems[I].Selected then + DeleteImage(I); + FocusedImageIndex := Min(ASelectedIndex, ImagesCount - 1); +end; + +procedure TcxImageListEditor.ExportImages(const AFileName: string); + + function CanReplace: Boolean; + begin + Result := MessageDlg(Format('File %s is already exists.' + dxEndOfLine + + 'Do you want to replace it?', + [AFileName]), mtWarning, [mbYes, mbNo], 0) = mrYes; + end; + + procedure SelectAllImages; + var + I: Integer; + begin + for I := 0 to ImagesCount - 1 do + DataItems[I].Selected := True; + end; + + function GetSelectionCount: Integer; + var + I: Integer; + begin + Result := 0; + for I := 0 to ImagesCount - 1 do + if DataItems[I].Selected then + Inc(Result); + end; + +var + AImageIndex: Integer; + ASelectedItem: TListItem; + AExportImage: TcxBitmap; + ARect: TRect; +begin + if not FileExists(AFileName) or CanReplace then + begin + Application.ProcessMessages; + ASelectedItem := FDataControl.Selected; + if not IsAnyImageSelected then + SelectAllImages; + AExportImage := TcxBitmap.CreateSize(ImageList.Width * GetSelectionCount, ImageList.Height); + try + ARect := cxRect(0, 0, ImageList.Width, ImageList.Height); + for AImageIndex := 0 to ImagesCount - 1 do + if DataItems[AImageIndex].Selected then + begin + AExportImage.CopyBitmap(ImagesInfo[AImageIndex].Image, ARect, cxNullPoint); + ARect := cxRectOffset(ARect, ImageList.Width, 0); + end; + AExportImage.SaveToFile(AFileName); + + FDataControl.Selected := ASelectedItem; + finally + AExportImage.Free; + end; + end; +end; + +procedure TcxImageListEditor.ImportImages(AImageList: TCustomImageList); +begin + if AImageList.Count <> 0 then + begin + if (AImageList.ClassName = 'TPngImageList') and CheckGdiPlus then + PngImageListTocxImageList(AImageList, ImageList) + else + ImageList.CopyImages(AImageList); + SynchronizeData(ImagesCount, AImageList.Count); + FChanged := True; + FocusedImageIndex := ImagesCount - 1; + end; + Change; +end; + +function TcxImageListEditor.InternalAddImage(AImage, AMask: TBitmap; AFileName: string; + var AInsertedItemIndex: Integer; AMultiSelect: Boolean): Integer; + + function GetUserPermissionForSplit(AFileName: string; AMultiSelect: Boolean): Boolean; + const + scxBitmapSplitQuery = 'The bitmap in the file %s is too large.' + dxEndOfLine + + 'Do you want to split it into smaller bitmaps?'; + var + APossibleAnswers: TMsgDlgButtons; + begin + APossibleAnswers := [mbYes, mbNo]; + if AMultiSelect then + APossibleAnswers := APossibleAnswers + [mbNoToAll, mbYesToAll]; + FSplitBitmaps := MessageDlg(Format(scxBitmapSplitQuery, [AFileName]), mtConfirmation, APossibleAnswers, 0); + Result := FSplitBitmaps in [mrYes, mrYesToAll, mrCancel]; + end; + +var + AColCount, ARowCount, AColIndex, ARowIndex: Integer; + ASourceImageSize: TSize; + ASplitImages: Boolean; + ADestBitmap, ADestMask: TBitmap; + ASourceRect, ADestRect: TRect; +begin + Result := -1; + + ASplitImages := ((AImage.Width mod ImageWidth) + (AImage.Height mod ImageHeight)) = 0; + + if ((AImage.Width = ImageWidth) and (AImage.Height = ImageHeight)) or + ASplitImages and + (FSplitBitmaps <> mrNoToAll) and + ((FSplitBitmaps = mrYesToAll) or GetUserPermissionForSplit(AFileName, AMultiSelect)) then + ASourceImageSize := cxSize(ImageWidth, ImageHeight) + else + ASourceImageSize := cxSize(AImage.Width, AImage.Height); + + AColCount := AImage.Width div ASourceImageSize.cx; + ARowCount := AImage.Height div ASourceImageSize.cy; + + ADestBitmap := cxCreateBitmap(ImageWidth, ImageHeight, pf32bit); + + if IsGlyphAssigned(AMask) then + ADestMask := cxCreateBitmap(ImageWidth, ImageHeight, pf1bit) + else + ADestMask := nil; + try + ADestRect := Rect(0, 0, ImageWidth, ImageHeight); + for ARowIndex := 0 to ARowCount - 1 do + for AColIndex := 0 to AColCount - 1 do + begin + ASourceRect := Rect(AColIndex * ASourceImageSize.cx, ARowIndex * ASourceImageSize.cy, (AColIndex + 1) * ASourceImageSize.cx, (ARowIndex + 1) * ASourceImageSize.cy); + ADestBitmap.Canvas.CopyRect(ADestRect, AImage.Canvas, ASourceRect); + if IsGlyphAssigned(AMask) then + ADestMask.Canvas.CopyRect(ADestRect, AMask.Canvas, ASourceRect); + AddImage(ADestBitmap, ADestMask, GetDefaultTransparentColor(ADestBitmap, ADestMask), AInsertedItemIndex); + end; + finally + ADestMask.Free; + ADestBitmap.Free; + end; +end; + +procedure TcxImageListEditor.MoveImage(ASourceImageIndex, ADestImageIndex: Integer); +var + AList: TList; + I: Integer; +begin + if ADestImageIndex <> ASourceImageIndex then + begin + AList := TList.Create; + try + for I := 0 to ImagesCount - 1 do + AList.Add(DataItems[I].Data); + AList.Move(ASourceImageIndex, ADestImageIndex); + for I := 0 to ImagesCount - 1 do + DataItems[I].Data := AList[I]; + finally + AList.Free; + end; + FocusedImageIndex := ADestImageIndex; + end; + UpdateImageList; +end; + +function TcxImageListEditor.IsAnyImageSelected: Boolean; +begin + Result := (FocusedImageIndex <> -1) and (FDataControl.SelCount > 0); +end; + +procedure TcxImageListEditor.BeginUpdate; +begin + Inc(FUpdateCount); +end; + +procedure TcxImageListEditor.EndUpdate; +begin + if FUpdateCount > 0 then + Dec(FUpdateCount); +end; + +function TcxImageListEditor.IsUpdateLocked: Boolean; +begin + Result := FUpdateCount > 0; +end; + +procedure TcxImageListEditor.ApplyChanges; +begin + if IsChanged then + begin + FOriginalImageList.Width := ImageWidth; + FOriginalImageList.Height := ImageHeight; + AddDataItems(FOriginalImageList); + //FOriginalImageList.Assign(ImageList); + FImageListModified := True; + FChanged := False; + end; + Change; +end; + +function TcxImageListEditor.IsChanged: Boolean; +begin + Result := FChanged; +end; + +procedure TcxImageListEditor.UpdateTransparentColor(AColor: TColor); +var + I: Integer; +begin + for I := 0 to ImagesCount - 1 do + if DataItems[I].Selected and (ImagesInfo[I].MaskColor <> AColor) then + begin + ImagesInfo[I].MaskColor := AColor; + UpdateImageList; + end; +end; + +function TcxImageListEditor.ChangeImagesSize(AValue: TSize): Boolean; + + function CanChangeImagesSize: Boolean; + begin + Result := MessageDlg('This will change the image dimensions and remove all the existing images from the list. Do you want to proceed?', + mtWarning, [mbYes, mbNo], 0) = mrYes; + end; + +begin + Result := False; + if ((ImageWidth <> AValue.cx) or (ImageHeight <> AValue.cy)) and + ((ImagesCount = 0) or CanChangeImagesSize) then + begin + Result := True; + ImageList.Width := AValue.cx; + ImageList.Height := AValue.cy; + UpdateVisibleImportList; + ClearImages; + end; +end; + +procedure TcxImageListEditor.SynchronizeData(AStartIndex, ACount: Integer); +var + I: Integer; + AImageInfo: TcxEditorImageInfo; +begin + for I := AStartIndex to AStartIndex + ACount - 1 do + begin + AImageInfo := TcxEditorImageInfo.Create; + TcxImageListAccess(ImageList).GetImageInfo(I, AImageInfo); + DataItems.Add.Data := AImageInfo; + end; + UpdateImageList; +end; + +procedure TcxImageListEditor.AddDataItems(AImageList: TcxImagelist); +var + I: Integer; +begin + AImageList.BeginUpdate; + try + AImageList.Clear; + for I := 0 to ImagesCount - 1 do + TcxImageListAccess(AImageList).AddImageInfo(ImagesInfo[I]); + finally + AImageList.EndUpdate; + end; +end; + +procedure TcxImageListEditor.AddImage(AImage, AMask: TBitmap; AMaskColor: TColor; var AInsertedImageIndex: Integer); +var + AImageInfo: TcxEditorImageInfo; +begin + AImageInfo := TcxEditorImageInfo.Create; + AImageInfo.Image := AImage; + AImageInfo.Mask := AMask; + AImageInfo.MaskColor := AMaskColor; + DataItems.Add.Data := AImageInfo; + MoveImage(ImagesCount - 1, AInsertedImageIndex); + Inc(AInsertedImageIndex); +end; + +procedure TcxImageListEditor.Change; +begin + if Assigned(FOnChange) then + FOnChange(Self); +end; + +procedure TcxImageListEditor.ClearSelection; +var + I: Integer; +begin + for I := 0 to ImagesCount - 1 do + DataItems[I].Selected := False; +end; + +procedure TcxImageListEditor.DeleteDataItem(Sender: TObject; Item: TListItem); +begin + TObject(Item.Data).Free; +end; + +procedure TcxImageListEditor.DeleteImage(AIndex: Integer); +begin + if IsIndexValid(AIndex, ImagesCount) then + begin + DataItems.Delete(AIndex); + UpdateImageList; + end; +end; + +function TcxImageListEditor.GetImagesCount: Integer; +begin + Result := DataItems.Count; +end; + +function TcxImageListEditor.GetDefaultTransparentColor(AImage, AMask: TBitmap): TColor; +begin + if IsGlyphAssigned(AMask) or IsBitmapAlphaUsed(AImage) then + Result := clNone + else + Result := AImage.Canvas.Pixels[0, AImage.Height - 1]; +end; + +function TcxImageListEditor.GetFocusedImageIndex: Integer; +begin + Result := -1; + if FDataControl.ItemFocused <> nil then + Result := FDataControl.ItemFocused.Index; +end; + +function TcxImageListEditor.GetImageHeight: Integer; +begin + Result := ImageList.Height; +end; + +function TcxImageListEditor.GetImagesInfo(Index: Integer): TcxEditorImageInfo; +begin + Result := nil; + if IsIndexValid(Index, ImagesCount) then + Result := TcxEditorImageInfo(DataItems[Index].Data); +end; + +procedure TcxImageListEditor.SetImageList(AValue: TcxImageList); +begin + FOriginalImageList := AValue; + ImageList.Assign(AValue); + SynchronizeData(0, ImageList.Count); + FChanged := False; + FocusedImageIndex := 0; + UpdateVisibleImportList; +end; + +function TcxImageListEditor.GetImageWidth: Integer; +begin + Result := ImageList.Width; +end; + +procedure TcxImageListEditor.ImageListChanged; + + procedure InitializeListViewItem(AIndex: Integer); + begin + DataItems[AIndex].Caption := IntToStr(AIndex); + DataItems[AIndex].ImageIndex := AIndex; + end; + +var + I: Integer; +begin + for I := 0 to ImagesCount - 1 do + InitializeListViewItem(I); + FChanged := True; + Change; +end; + +procedure TcxImageListEditor.SelectDataItem(Sender: TObject; + Item: TListItem; Selected: Boolean); +begin + if Selected then + FDataControl.ItemFocused := Item; +end; + +function TcxImageListEditor.GetDataItems: TListItems; +begin + Result := FDataControl.Items; +end; + +procedure TcxImageListEditor.SetFocusedImageIndex(AValue: Integer); +begin + if IsIndexValid(AValue, ImagesCount) then + begin + ClearSelection; + DataItems[AValue].Selected := True; + FDataControl.Selected.MakeVisible(True); + end; +end; + +procedure TcxImageListEditor.SetImagesInfo(Index: Integer; + AValue: TcxEditorImageInfo); +begin + if DataItems[Index].Data <> AValue then + DataItems[Index].Data := AValue; +end; + +procedure TcxImageListEditor.SetImportList(AValue: TStrings); +begin + if AValue <> nil then + FImportList.Assign(AValue) + else + FImportList.Clear; +end; + +procedure TcxImageListEditor.UpdateImageList; + + procedure MakeSystemBackground(ASource, ADestination: TBitmap); + var + R: TRect; + begin + R := Rect(0, 0, ADestination.Width, ADestination.Height); + ADestination.Canvas.Brush.Color := clWindow; + ADestination.Canvas.FillRect(R); + cxAlphaBlend(ADestination, ASource, R, R); + end; + +var + I: Integer; + AImageInfo: TcxImageInfo; + AEditorImageInfo: TcxEditorImageInfo; +begin + ImageList.BeginUpdate; + try + ImageList.Clear; + AImageInfo := TcxImageInfo.Create; + try + for I := 0 to ImagesCount - 1 do + begin + AEditorImageInfo := ImagesInfo[I]; + if AEditorImageInfo.AlphaUsed and not IsXPManifestEnabled then + begin + AImageInfo.Assign(AEditorImageInfo); + MakeSystemBackground(AEditorImageInfo.Image, AImageInfo.Image); + TcxImageListAccess(ImageList).AddImageInfo(AImageInfo); + end + else + TcxImageListAccess(ImageList).AddImageInfo(AEditorImageInfo); + end; + finally + AImageInfo.Free; + end; + finally + ImageList.EndUpdate; + end; + ImageListChanged; +end; + +procedure TcxImageListEditor.UpdateVisibleImportList; +var + I: Integer; + ACustomImageList: TCustomImageList; +begin + FVisibleImportList.Clear; + for I := 0 to FImportList.Count - 1 do + begin + ACustomImageList := TCustomImageList(FImportList.Objects[I]); + if (ACustomImageList.Width = ImageWidth) and (ACustomImageList.Height = ImageHeight) then + FVisibleImportList.AddObject(FImportList[I], FImportList.Objects[I]); + end; + TcxImageListEditorForm(FEditorForm).SetImportList(FVisibleImportList); + Change; +end; + +initialization + FImageFileFormats := TcxImageFileFormats.Create; + cxImageFileFormats.Register('Bitmaps (*.bmp)', '.bmp', TBitmap); + cxImageFileFormats.Register('Icons (*.ico)', '.ico', TcxIcon); + if GetClass(TdxPNGImage.ClassName) <> nil then + cxImageFileFormats.Register('DevExpress PNG (*.png)', '.png', TdxPNGImage); + +finalization + FreeAndNil(FImageFileFormats); + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxImageListEditorView.dfm b/official/x.35/ExpressLibrary/Sources/cxImageListEditorView.dfm new file mode 100644 index 00000000..18d02c08 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxImageListEditorView.dfm @@ -0,0 +1,647 @@ +object cxImageListEditorForm: TcxImageListEditorForm + Left = 327 + Top = 272 + Anchors = [akLeft, akTop, akRight, akBottom] + AutoScroll = False + BorderIcons = [biSystemMenu] + Caption = 'cxImageListEditorForm' + ClientHeight = 287 + ClientWidth = 550 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -10 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object lblManifestWarning: TLabel + Left = 51 + Top = 249 + Width = 246 + Height = 32 + Anchors = [akLeft, akBottom] + AutoSize = False + Caption = 'Manifest Warning' + Transparent = True + Visible = False + WordWrap = True + end + object imgWarning: TImage + Left = 13 + Top = 249 + Width = 32 + Height = 32 + Anchors = [akLeft, akBottom] + AutoSize = True + Picture.Data = { + 055449636F6E0000010001002020000001002000A81000001600000028000000 + 2000000040000000010020000000000080100000000000000000000000000000 + 00000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + FFFFFF00414141003B3B3B5D383838B2343434CA313131CA2D2D2DCA292929CA + 262626CA222222CA1F1F1FCA1D1D1DCA191919CA161616CA141414CA101010CA + 0E0E0ECA0B0B0BCA090909CA070707CA050505CA030303CA010101CA000000CA + 000000CA000000CA000000CA000000CA000000CA000000CA000000B20000005D + 00000000434343403F3F3FE83B3B3BFF373737FF343434FF313131FF2D2D2DFF + 292929FF252525FF222222FF1F1F1FFF1B1B1BFF191919FF161616FF121212FF + 101010FF0D0D0DFF0B0B0BFF080808FF060606FF040404FF020202FF000000FF + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000E8 + 00000040484848BC434343FF404040FF3C3C3CFF363332FF302927FF2C2523FF + 29221FFF251D1BFF221A18FF1F1714FF1B1310FF18100DFF140C09FF120A06FF + 0F0703FF0C0400FF090000FF070000FF050000FF020000FF000000FF000000FF + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF + 000000BC4C4C4CEA484848FF454545FF3F3D3DFF70AABAFF86DBF3FF89E4FFFF + 85E2FFFF81E0FFFF7FDEFFFF7BDDFFFF79DCFFFF76DAFFFF73D9FFFF71D7FFFF + 6FD6FFFF6CD4FFFF6BD4FFFF68D3FFFF68D2FFFF67D1FFFF67D1FFFF67D0FFFF + 66D0FFFF66CFFFFF65CFFFFF63CBFAFF5492A5FF000000FF000000FF000000FF + 000000EA515151CA4C4C4CFF494949FF443F3DFF73B8C9FF63EEFFFF56E5FFFF + 52E3FFFF4CE0FFFF48DCFFFF43DAFFFF3ED8FFFF39D5FFFF34D3FFFF48DDFFFF + 4ED4FFFF4AD3FFFF3ED8FFFF21C9FFFF20C8FFFF20C7FFFF20C7FFFF1FC6FFFF + 1FC5FFFF1EC5FFFF1DC4FFFF25CBFFFF398FB6FF000000FF000000FF000000FF + 000000CA5252526B4F4F4FFF4C4C4CFF444140FF8EB4BDFF96F1FFFF74E2FFFF + 5FDDFFFF4FD8FFFF40D3FFFF3BCFFFFF38CEFFFF31CAFFFF48D4FFFF559DB7FF + 2D3A3FFF2A373CFF4D98B5FF35CBFFFF14BAFFFF16BAFFFF15B9FFFF14B8FFFF + 14B7FFFF13B6FFFF10B5FFFF1EC2FFFF3582A5FF000000FF000000FF000000FF + 0000006B6B6B6B0B696969D5646464FF585756FF7A7E7FFFD4F7FCFFC2F5FFFF + AFEEFFFF98EAFFFF79E1FFFF5AD9FFFF41D2FFFF37D1FFFF55C5ECFF32393CFF + 1F1714FF1B1310FF283135FF44BCEAFF1BC0FFFF17BBFFFF17BAFFFF17B9FFFF + 16B9FFFF15B8FFFF11B7FFFF35C1FCFF1B333EFF000000FF000000FF000000D5 + 0000000B7B7B7B007B7B7B5C757575FF6E6E6EFF656363FFB0C6CCFFC9FCFFFF + BAF2FFFFB3EFFFFFAAECFFFF9BE9FFFF7EE2FFFF5BDDFFFF59C0E3FF303537FF + 24201EFF211C1AFF292D2FFF44B6E3FF1FC3FFFF1ABDFFFF18BBFFFF17BAFFFF + 17BAFFFF14B8FFFF1FC4FFFF3A8AAEFF040302FF030202FF020202FF0000005C + 000000007D7D7D007D7D7D087A7A7AC7747474FF696868FF818688FFCCF4FBFF + BCF4FFFFB3F0FFFFABEDFFFFA1EBFFFF98E9FFFF8BE5FFFF8CE8FDFF5C808DFF + 2C3031FF2A2D2EFF4B7C8DFF48D2FEFF1FC0FFFF1EBFFFFF1ABDFFFF18BBFFFF + 17BBFFFF13BBFFFF39C1FAFF1E343EFF050100FF050606FF040404C702020208 + 0202020080808000808080007F7F7F4C7A7A7AFE737373FF6A6868FFADC2C6FF + C8FCFFFFB7F1FFFFAFF0FFFFA5EDFFFF9BEAFFFF8FE7FFFF89E6FFFF91E8FFFF + 75BCD3FF5DB2CEFF54D5FFFF2EC9FFFF24C3FFFF22C2FFFF1EBFFFFF1ABDFFFF + 16BBFFFF23C7FFFF3C86A5FF0C0705FF0A0909FF090909FE0606064C05050500 + 05050500828282008282820082828200808080B67A7A7AFF6F6F6EFF818687FF + C9F1F9FFBCF5FFFFB3F1FFFFAAEFFFFF9FECFFFF95E9FFFF88E5FFFF8CF0FFFF + 6D929DFF537581FF4FD7FFFF2AC9FFFF2AC7FFFF26C5FFFF21C1FFFF1DBFFFFF + 16BFFFFF3DC1F5FF25363CFF0E0A08FF0E0E0EFF0B0B0BB60909090009090900 + 09090900838383008383830083838300838383397F7F7FFA797979FF6F6D6CFF + ACC0C5FFC7FCFFFFB5F2FFFFAEF0FFFFA4EDFFFF9AEBFFFF8FE8FFFF97F0FFFF + 5A6E73FF4A5558FF71DAFBFF38D0FFFF2EC9FFFF2AC7FFFF26C4FFFF1EC1FFFF + 2ACCFFFF4087A2FF160F0DFF141514FF111111FA0E0E0E390B0B0B000B0B0B00 + 0B0B0B0086868600868686008686860086868600858585A37F7F7FFF757474FF + 838788FFC8F0F6FFBCF5FFFFB2F1FFFFA9EFFFFF9FECFFFF95EDFFFF9AE3F6FF + 515C5FFF434748FF80D3ECFF55DBFFFF36CDFFFF2FCAFFFF2AC8FFFF23C7FFFF + 45C4F1FF2D3A3FFF181412FF181818FF141414A3121212001212120012121200 + 12121200888888008888880088888800888888008888882B858585F17F7F7FFF + 747171FFABBFC3FFC6FBFFFFB5F2FFFFADF1FFFFA4EEFFFF9DF1FFFF9CD8E6FF + 484A4AFF3D3938FF80C1D4FF6BE3FFFF49D4FFFF34CEFFFF2DC9FFFF38D4FFFF + 4A89A0FF201916FF1F1F1FFF1B1B1BF11818182B171717001717170017171700 + 171717008B8B8B008B8B8B008B8B8B008B8B8B008B8B8B008A8A8A94848484FF + 7C7B7AFF86898AFFC7EEF6FFBBF6FFFFB0F1FFFFA8EFFFFFA7F6FFFF93BFC9FF + 43403FFF403C3AFF739EAAFF7AE8FFFF59D9FFFF3ED2FFFF33D0FFFF53CAF1FF + 364145FF242120FF232323FF202020941D1D1D001D1D1D001D1D1D001D1D1D00 + 1D1D1D008C8C8C008C8C8C008C8C8C008C8C8C008C8C8C008D8D8D1D898989EB + 848484FF797877FFABBDC0FFC6FCFFFFB5F3FFFFACF1FFFFB1F9FFFF7E979CFF + 474444FF43403FFF64787DFF87EDFFFF64DDFFFF4BD6FFFF4BDDFFFF558D9FFF + 2B2624FF2A2A2AFF272727EB2323231D22222200222222002222220022222200 + 222222008F8F8F008F8F8F008F8F8F008F8F8F008F8F8F008F8F8F008F8F8F7C + 898989FF818080FF8B8E8EFFC6EEF5FFBAF6FFFFB0F2FFFFB8F8FFFF6E787AFF + 4B4948FF494645FF596264FF8DE2F6FF6DE3FFFF57DEFFFF63D1F1FF414C4FFF + 312E2DFF2F2F2FFF2C2C2C7C2929290029292900292929002929290029292900 + 2929290092929200929292009292920092929200929292009292920092929214 + 8E8E8EDE898989FF7F7D7DFFADBFC2FFC6FCFFFFB6F7FFFFB4E8F2FF666B6CFF + 51504FFF4F4D4DFF545656FF8ACEDEFF76E8FFFF71EAFFFF6196A3FF393331FF + 373737FF333333DE303030143030300030303000303030003030300030303000 + 3030300093939300939393009393930093939300939393009393930093939300 + 929292698E8E8EFF868585FF8D8F90FFC6EEF3FFBEFDFFFFB0DDE6FF646667FF + 565555FF545353FF52514FFF88C3D1FF80F2FFFF83DAEEFF4C5457FF3D3A39FF + 3C3C3CFF37373769333333003333330033333300333333003333330033333300 + 3333330095959500959595009595950095959500959595009595950095959500 + 95959509939393D28E8E8EFF848181FFADBEC2FFC8FEFFFFBEEEF5FF6F7475FF + 585656FF565454FF5C5E5FFF96D7E4FF90F6FFFF759DA6FF433E3DFF444444FF + 404040D23C3C3C093B3B3B003B3B3B003B3B3B003B3B3B003B3B3B003B3B3B00 + 3B3B3B0097979700979797009797970097979700979797009797970097979700 + 9797970097979759929292FF8B8A8AFF909292FFC6EBF2FFC9FFFFFFA5BFC3FF + 656565FF5F5E5DFF8DA9B0FFA5F8FFFF98DFEFFF5E6264FF4B4949FF484848FF + 4444445943434300434343004343430043434300434343004343430043434300 + 4343430099999900999999009999990099999900999999009999990099999900 + 9999990099999906979797C2929292FF898786FFADBDC0FFC8FBFFFFC3FAFFFF + B7E7EFFFB0E3EDFFAEF3FFFFA4F7FFFF86A5ABFF585553FF525252FF4C4C4CC2 + 4949490649494900494949004949490049494900494949004949490049494900 + 494949009A9A9A009A9A9A009A9A9A009A9A9A009A9A9A009A9A9A009A9A9A00 + 9A9A9A009A9A9A009A9A9A45969797FC909090FF929393FFC6E9EFFFBEF9FFFF + B6F8FFFFAEF7FFFFA6F6FFFFA8E0EBFF6E7071FF616160FF575757FC50505045 + 4F4F4F004F4F4F004F4F4F004F4F4F004F4F4F004F4F4F004F4F4F004F4F4F00 + 4F4F4F009C9C9C009C9C9C009C9C9C009C9C9C009C9C9C009C9C9C009C9C9C00 + 9C9C9C009C9C9C009C9C9C009B9B9BAF969696FF8E8C8CFFADBABDFFCAFCFFFF + B9F5FFFFB1F4FFFFB6FAFFFF93A9ACFF6A6665FF686869FF5C5C5CAF54545400 + 5555550055555500555555005555550055555500555555005555550055555500 + 555555009E9E9E009E9E9E009E9E9E009E9E9E009E9E9E009E9E9E009E9E9E00 + 9E9E9E009E9E9E009E9E9E009D9D9D359A9A9AF8949494FF959595FFC7E8EDFF + C0F9FFFFB9F9FFFFB7E4EBFF7C7E7DFF717070FF6D6D6DF85F5F5F355A5A5A00 + 5B5B5B005B5B5B005B5B5B005B5B5B005B5B5B005B5B5B005B5B5B005B5B5B00 + 5B5B5B00A0A0A000A0A0A000A0A0A000A0A0A000A0A0A000A0A0A000A0A0A000 + A0A0A000A0A0A000A0A0A000A0A0A0009E9E9EA09A9A9AFF918F8FFFADB9BBFF + D0FFFFFFCAFFFFFF9EAFB2FF797676FF787878FF717171A06666660066666600 + 6767670067676700676767006767670067676700676767006767670067676700 + 67676700A0A0A000A0A0A000A0A0A000A0A0A000A0A0A000A0A0A000A0A0A000 + A0A0A000A0A0A000A0A0A000A0A0A000A0A0A0289D9D9DF0999898FF979797FF + ACB7B8FFA7B3B5FF888989FF818181FF7D7D7DF0747474286B6B6B006C6C6C00 + 6C6C6C006C6C6C006C6C6C006C6C6C006C6C6C006C6C6C006C6C6C006C6C6C00 + 6C6C6C00A2A2A200A2A2A200A2A2A200A2A2A200A2A2A200A2A2A200A2A2A200 + A2A2A200A2A2A200A2A2A200A2A2A200A2A2A200A1A1A18D9E9E9EFF989898FF + 908E8EFF8C8A8AFF8C8B8BFF878787FF8181818D7E7E7E007D7D7D007D7D7D00 + 7D7D7D007D7D7D007D7D7D007D7D7D007D7D7D007D7D7D007D7D7D007D7D7D00 + 7D7D7D00A3A3A300A3A3A300A3A3A300A3A3A300A3A3A300A3A3A300A3A3A300 + A3A3A300A3A3A300A3A3A300A3A3A300A3A3A300A3A3A31AA1A1A1DE9D9D9DFF + 989898FF949494FF909090FF8B8B8BDE8686861A868686008686860086868600 + 8686860086868600868686008686860086868600868686008686860086868600 + 86868600A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400 + A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400A3A3A342A1A1A1EA + 9D9D9DFF989898FF959595EA8F8F8F428D8D8D008E8E8E008E8E8E008E8E8E00 + 8E8E8E008E8E8E008E8E8E008E8E8E008E8E8E008E8E8E008E8E8E008E8E8E00 + 8E8E8E00A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400 + A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400A2A2A25F + 9F9F9FB59B9B9BB59797975F9292920091919100919191009191910091919100 + 9191910091919100919191009191910091919100919191009191910091919100 + 91919100FFFFFFFF800000010000000000000000000000000000000000000000 + 000000008000000180000001C0000003E0000007E0000007F000000FF000000F + F800001FF800001FFC00003FFC00003FFE00007FFE00007FFF0000FFFF0000FF + FF8001FFFFC003FFFFC003FFFFE007FFFFE007FFFFF00FFFFFF00FFFFFF81FFF + FFFC3FFF} + Visible = False + end + object btnOK: TButton + Left = 303 + Top = 250 + Width = 75 + Height = 25 + Action = actOK + Anchors = [akRight, akBottom] + Default = True + ModalResult = 1 + TabOrder = 0 + end + object btnCancel: TButton + Left = 383 + Top = 250 + Width = 75 + Height = 25 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + object btnApply: TButton + Left = 463 + Top = 250 + Width = 75 + Height = 25 + Action = actApply + Anchors = [akRight, akBottom] + TabOrder = 2 + end + object gbSelectedImage: TGroupBox + Left = 359 + Top = 7 + Width = 180 + Height = 231 + Anchors = [akTop, akRight, akBottom] + Caption = 'Selected Image' + TabOrder = 3 + object pbPreview: TPaintBox + Left = 10 + Top = 15 + Width = 160 + Height = 160 + Anchors = [akLeft, akTop, akRight] + OnMouseDown = pbPreviewMouseDown + OnMouseMove = pbPreviewMouseMove + OnMouseUp = pbPreviewMouseUp + OnPaint = pbPreviewPaint + end + object lbTransparentColor: TLabel + Left = 9 + Top = 186 + Width = 87 + Height = 13 + Anchors = [akLeft, akBottom] + Caption = 'Transparent Color:' + end + object cbTransparentColor: TComboBox + Left = 10 + Top = 201 + Width = 161 + Height = 21 + Anchors = [akLeft, akRight, akBottom] + ItemHeight = 13 + TabOrder = 0 + OnChange = cbTransparentColorChange + OnExit = cbTransparentColorExit + end + end + object gbImages: TGroupBox + Left = 12 + Top = 7 + Width = 340 + Height = 231 + Anchors = [akLeft, akTop, akRight, akBottom] + Caption = 'Images' + TabOrder = 4 + object lvImages: TListView + Left = 10 + Top = 15 + Width = 320 + Height = 178 + Hint = 'Add image' + Anchors = [akLeft, akTop, akRight, akBottom] + Columns = <> + Constraints.MinHeight = 150 + Constraints.MinWidth = 228 + DragMode = dmAutomatic + HideSelection = False + IconOptions.AutoArrange = True + MultiSelect = True + ReadOnly = True + PopupMenu = pmCommands + ShowColumnHeaders = False + TabOrder = 0 + OnEndDrag = lvImagesEndDrag + OnDragOver = lvImagesDragOver + OnKeyDown = lvImagesKeyDown + OnStartDrag = lvImagesStartDrag + end + object pnlToolBarSubstrate: TPanel + Left = 10 + Top = 200 + Width = 151 + Height = 22 + Anchors = [akLeft, akBottom] + BevelOuter = bvNone + TabOrder = 1 + object tbCommands: TToolBar + Left = 0 + Top = 0 + Width = 151 + Height = 22 + Align = alClient + Caption = 'tbCommands' + EdgeBorders = [] + Flat = True + Images = imglSmall + ParentShowHint = False + ShowHint = True + TabOrder = 0 + object tbbAdd: TToolButton + Left = 0 + Top = 0 + Action = actAdd + end + object tbbReplace: TToolButton + Left = 23 + Top = 0 + Action = actReplace + end + object tbbDelete: TToolButton + Left = 46 + Top = 0 + Action = actDelete + end + object tbbClear: TToolButton + Left = 69 + Top = 0 + Action = actClear + end + object tbbExport: TToolButton + Left = 92 + Top = 0 + Action = actExport + end + object tbbImport: TToolButton + Left = 115 + Top = 0 + Action = actImport + DropdownMenu = pmImageLists + end + end + end + object cbImagesSize: TComboBox + Left = 260 + Top = 200 + Width = 70 + Height = 21 + Style = csDropDownList + Anchors = [akRight, akBottom] + ItemHeight = 13 + TabOrder = 2 + OnChange = cbImagesSizeChange + Items.Strings = ( + '16x16' + '24x24' + '32x32' + '48x48' + '64x64' + '128x128') + end + end + object pmImageLists: TPopupMenu + Left = 64 + Top = 40 + end + object pmCommands: TPopupMenu + Images = imglSmall + Left = 152 + Top = 40 + object miAdd: TMenuItem + Action = actAdd + end + object miReplace: TMenuItem + Action = actReplace + end + object miDelete: TMenuItem + Action = actDelete + end + object miClear: TMenuItem + Action = actClear + end + object miExport: TMenuItem + Action = actExport + end + object miImport: TMenuItem + Action = actImport + end + end + object imglSmall: TcxImageList + CompressData = True + FormatVersion = 1 + DesignInfo = 1572992 + ImageInfo = < + item + Image.Data = { + 860200005844424D0100823604020084424D3604060081360300812803008110 + 03008110030083010020060081045200034E8100034D8100034D8100034B8100 + 034B810003488100034781000347810003458100034381000343810003431100 + 0351A9006BCE7D006BCE7D0069CF7F0068CF800068D0810067D1830067D18400 + 65D2860065D2860064D38800034511000354A90064D388002FC562002EC76500 + 2EC765002DC869002DC869002ECA6D002ECA6D0030CB700064D9950003471100 + 0357A90068D9960041CF7A004CD181005CD68C0072DB9C0085E1A900A1E7BB00 + BDEDCD00E4F1DB00F2F5E600034B11000359A900D1EFD400E4F1DB00F6F1DD00 + F9F2DF00FDF3E100FDF3E100FDF4E200FFF4E600FFF4E600FFF8EE00034D1100 + 035CB000FFF6EA00FFF3E300FFF3E300FFF3E100FFF2DF00FFF1DE00FFF1DE00 + FFF1DD00FFF1DD0003531900034F1800034F180D00035EB000FFF0DA00FFEBCE + 00FFEACC00FFEACC00FFE9CA00FFE9C800FFE8C700FFE7C400FFE7C40002591B + 000FCD69000353190D000361B000FFE8C700FFDFB300FFDEB000FFDEB000FFDD + AE00FFDDAD00FFDCAB00FFDBAA00FFDAA600025E1D000FCD690002561A0D0003 + 64BD00FFDEB000FFDDAE00FFDDAD00FFDDAD00FFDCAB00FFDBAA000375280003 + 7025000269220002641F0027D87C00025E1D0002591B0002561A000353190003 + 66810003668100036481000363810003638100036181000361A400037C2C006F + F0B0006FF0B00053E89C003CE08A0027D87C000FCD69000FCD690002561A1D00 + A30387330003873300037C2C000375280053E89C000269220002641F00025E1D + 0002591B29008B037C2C006FF0B00003702535008B0387330087F6C100037C2C + 35008B04943A00038733000387334D00} + Mask.Data = { + 670000005844424D0100817E030083424D7E0700813E03008128030081100300 + 8110030083010001050081400B0081020B0003FF810002FF0300810F0300810F + 0300810F0300810F0300810F0300810703008107030081070A0081FE030082FF + C7020082FFC7020082FFC7020002FF0200} + end + item + Image.Data = { + 580300005844424D0100823604020084424D3604060081360300812803008110 + 0300811003008301002006008104460083A559060900037A8100037A81000377 + 8100037781000377810003758100037581000375810003738100037081000370 + 050090A5590600A5590600A5590600CCB59200037DA5008FDA9D008FDA9D008F + DA9D008EDBA0008DDCA1008DDCA1008CDDA4008CDDA4008CDDA400037309008C + A5590600D3CFC200A5590600037DA5008BDEA50062D3890062D3890062D58C00 + 62D58C0061D7900061D7900061D790008CE3AF000375110084A55906000381A5 + 008CE3AF0072DB9C0078DCA00085E1A90095E4B400A1E7BB00BDEDCD00D1EFD4 + 00EDF6E7000377150003819100E4F1DB00EDF6E700F9F5E600F9F5E600034E81 + 00034D8100034D8100034B8100034B8100034881000347810003478100034581 + 00034381000343810003859100FFF8EE00FFF6EA00FFF6EA00FFF6EA000351A5 + 006BCE7D006BCE7D0069CF7F0068CF800068D0810067D1830067D1840065D286 + 0065D286000345810003859100FFF3E300FFF0DA00FFF0DA00FFF0DA000354A5 + 0064D388002FC562002EC765002EC765002DC869002DC869002ECA6D002ECA6D + 0064D995000348810003899100FFEDD300FFE7C600FFE7C400FFE7C4000357A5 + 0068D9960041CF7A004CD181005CD68C0072DB9C0085E1A900A1E7BB00BDEDCD + 00EDF6E700034B8100038A9100FFE6C200FFE6C200FFE6C200FFE6C2000359A5 + 00D1EFD400E4F1DB00F6F1DD00F9F2DF00FDF3E100FDF3E100FDF4E200FFF4E6 + 00FFF8EE00034E8100038D8100038A8100038A8100038A810003898100035CA5 + 00FFF6EA00FFF3E300FFF3E300FFF3E100FFF2DF00FFF1DE00FFF1DE00FFF1DD + 00FFF4E60003511500035EA500FFF0DA00FFEBCE00FFEACC00FFEACC00FFE9CA + 00FFE9C800FFE8C700FFE7C400FFEDD30003548400C6731B11000361A500FFE8 + C700FFDFB300FFDEB000FFDEB000FFDDAE00FFDDAD00FFDCAB00FFDBAA00FFE4 + BB0003578C00C9761D00DAD4C600C6731B09000364A500FFDEB000FFDDAE00FF + DDAD00FFDDAD00FFDCAB00FFDBAA00FFDBAA00FFDAA600FFDAA60003599000D8 + C3A600CB781E00C9761D00C6731B050003668100036681000364810003638100 + 036381000361810003618100035E8100035E8100035E8100035C090083CB781E + 3500} + Mask.Data = { + 550000005844424D0100817E030083424D7E0700813E03008128030081100300 + 8110030083010001050081400B0081020B0003FF8300FFFB0300811003008118 + 0300811E0300811F1A0081F8030081780300811803008108030082DFFF0200} + end + item + Image.Data = { + AE0200005844424D0100823604020084424D3604060081360300812803008110 + 03008110030083010020060081045200034E8100034D8100034D8100034B8100 + 034B810003488100034781000347810003458100034381000343810003431100 + 0351A9006BCE7D006BCE7D0069CF7F0068CF800068D0810067D1830067D18400 + 65D2860065D2860064D38800034511000354A90064D388002FC562002EC76500 + 2EC765002DC869002DC869002ECA6D002ECA6D0030CB700064D9950003471100 + 0357A90068D9960041CF7A004CD181005CD68C0072DB9C0085E1A900A1E7BB00 + BDEDCD00E4F1DB00F2F5E600034B11000359A900D1EFD400E4F1DB00F6F1DD00 + F9F2DF00FDF3E100FDF3E100FDF4E200FFF4E600FFF4E600FFF8EE00034D0900 + 83969FD30500035CA900FFF6EA00FFF3E300FFF3E300FFF3E100FFF2DF00EFE2 + DC00FFF1DE00FFF1DD00FFF1DD00FFF3E300034E050087969FD300929BD10500 + 035EA900FFF0DA00FFEBCE00FFEACC00FFEACC00FFE9CA00B7A8CA00E7D3C600 + FFE7C400FFE7C400FFEDD30003538800C9D5EB005B60BD09000361A900FFE8C7 + 00FFDFB300FFDEB000FFDEB000FFDDAE00C4ABB6008B78B700FADAAB00FFDAA6 + 00FFE4BB00035388006469CA00969FD309000364A900FFDEB000FFDDAE00FFDD + AD00FFDDAD00FFDBAA00FADAAB008B78B7008B78B700FFDAA600FFDAA600022A + 8594006469CA0D00036681000366810003648100036381000363810003618100 + 036181000259826600022A829400022A829400022A829400022A8194310088AE + B8E5000A0BCC00020585C9007C84D92900A7C9D5EB007D84E4002C2FD7006D73 + DD006D73DD001011CA001F21CD005D62D6008991DA00C9D5EB19008B7D84E400 + 383AD6009BA4E309008CAEB8E5004E52D9001011CA00020585C500474BD31900 + 87C9D5EB00C9D5EB15008BB5C0E7007D84E4008B93E24100} + Mask.Data = { + 6F0000005844424D0100817E030083424D7E0700813E03008128030081100300 + 8110030083010001050081400B0081020B0003FF810002FF0300810F0300810F + 0300810F0300810F0300810D030081090300810303008103030081070300810F + 020082FF0F020081FC030082FC60020082FCF8020002FF0200} + end + item + Image.Data = { + DB0100005844424D0100823604020084424D3604060081360300812803008110 + 03008110030083010020060081044600835B60BD39008799A2D3005B60BD0900 + 83C9D5EB2D00874B4FB40099A2D30900838991DA2900878A92CF004B4FB40D00 + 877C84D900A4ADE421008BB5C0E7002C2EAF00929BD10D0087AEB8E5005D62D6 + 2100875B60BD005B60BD1500876D73DD005D62D619008B7178CF002C2EAF00AE + B8E51900873F42D200646AD81100847C84D900021585BC008991DA1D008B9BA4 + E3001F21CD00585CD60900847C84D900021585BC007177D4250090858DE10010 + 11CA00383AD600474BD300020B85C500646AD82D0088646AD8000A0BCC000205 + 89C9002E30CE00A4ADE4290090858DE1002C2FD7000A0BCC001A1BCD0002058D + C9001A1BCD005D62D6009BA4E3190088A4ADE4004E52D900020892D5003033D5 + 008B93E200A4ADE4004E52D900020582C900020582C600020591C6002E30CE00 + 5D62D600838ADB00A4ADE40500845D63E200020882D500020889D5005E63DF00 + B5C0E70D0088858DE100383AD600020582C900020582C600020582C500020582 + C500020591C0007C84D9007D84E4005D63E200959EE71D008C858DE100474BD3 + 001011CA00020582C600020585C5001F21C7310090B5C0E700858DE1005D62D6 + 009BA4E300} + Mask.Data = { + 7A0000005844424D0100817E030083424D7E0700813E03008128030081100300 + 8110030083010001050081400B0081020B0003FF8300FFFB020082FFF3020082 + 7FF30200827FE70200823FC70200823FCF0200829F8F020082CF1F020082C63F + 020082E07F020082F07F020082E01F0200828001020081070300821FC0020082 + FFF00200} + end + item + Image.Data = { + 520300005844424D0100823604020084424D3604060081360300812803008110 + 030081100300830100200600810456008CC5A67B00B26C3400CA8B5800032481 + 0003248100031981000319810003198100030F8100030F8100030F8C00BA7743 + 00A1551A00B78E5D09008CBA774300EFCA9100EBC58800033481000332810003 + 2C8100032C810003248900E2B97A00E2B97A0003198C00E2B97A00DAA65600A1 + 551A09008CC17E4800F2CE9600EFCA91000345810003418100033C8100033781 + 0003348900E5BD7D00E4BA7C0003248C00E2B97A00DAA65600A1551A09008CC6 + 834E00F4D19D00F2CE96000359810003538100034E81000348810003458900E7 + BD8300E5BD7D0003378C00E2B97A00DAA65600A85E2409008CCA8B5800F6D5A5 + 00F4D19D00036B81000366810003618100035C81000357810003538100034D81 + 0003488C00E5BD7D00DAA65600A85E240900B7CA8B5800FADAAB00F6D5A500F4 + D19D00EFCA9100EFCA9100EBC58800EBC58800EBC58800E7BD8300E7BD8300E7 + BD8300E1AE5F00A85E240900B7D1915D00FBDDB100F2CE9600F3C88600F3C886 + 00EDC07A00ECBC7200E9B86D00E6B56900E6B56900E3B16400E3B16400E1AE5F + 00B26C340900B7D99B6800FFE4BB00E3AF7900E3AF7900E3B27500E3B27500E4 + AF6E00E4AF6E00E2AD6800E2AD6800E2AD6800E2AD6800E3B16400B26C340900 + 8CD99B6800FFE4BB00E3AF790003FC810003FC810003FA810003FA810003F881 + 0003F8810003F6810003F68C00E2AD6800E6B56900B26C3409008CDFA47100FF + E6C200DFA4710003FE810003D6810003D6810003D6810003D6810003D2810003 + D2810003F88C00E0A96A00E6B56900BA774309008CDFA47100FFECC900DFA471 + 0003FF810003FF810003FE810003FE810003FC810003FC810003FA810003FA8C + 00E0A96A00E9B86D00BA774309008CE4A77500FFEFCF00D99B680003FF810003 + D9810003D9810003D9810003D9810003D6810003D6810003FC8C00E0A96A00EC + BC7200C17E4809008CE4A77500FFF4D400DFAE850003FF810003FF810003FF81 + 0003FF810003FF810003FF810003FF810003FC8C00E7BD8300EFCA9100C6834E + 09008CE2CFB000E4A77500E4A7750003D9810003D9810003D9810003D9810003 + D9810003D9810003D9810003D98C00D1915D00CA8B5800CCB5924500} + Mask.Data = { + 7A0000005844424D0100817E030083424D7E0700813E03008128030081100300 + 8110030083010001050081400B0081020B0003FF810002FF0200828001020082 + 8001020082800102008280010200828001020082800102008280010200828001 + 0200828001020082800102008280010200828001020082800102008280010200 + 02FF0200} + end + item + Image.Data = { + E10200005844424D0100823604020084424D3604060081360300812803008110 + 03008110030083010020060081045E000366810003618100035C810003578100 + 03518100034D81000347810003418100033C81000337810003348100032C1100 + 036B810003E3810003FF810003FF810003FF810003FF810003FF810003FF8100 + 03FF810003FF810003FF810003321100036B810003E3810003FF810003FF8100 + 03FF810003FF810003FF810003FF810003FF810003FF810003FF810003341100 + 0370810003E3810003FF810003FF8500BF611B0003FF810003FF810003FF8100 + 03FF810003FF810003FF8100033711000373810003E3810003FF810003FF8900 + C5631B00C5631B0003FF810003FF810003FF810003FF810003FF8100033C0900 + A4E07A2E00DD762A00DA722600D6712600D46C2200D16B1F00CB661C00CB661C + 00C5631B0003FF810003FF810003FF810003FF8100033C0900A8E8833A00E37E + 3400E37E3400E07A2E00DD762A00DA722600D6712600D16B1F00CE691F00CB66 + 1C0003FF810003FF810003FF810003410900A4EE8D4600EE8D4600E8833A00E8 + 833A00E37E3400E37E3400E07A2E00DD762A00D671260003FF810003FF810003 + FF810003FF8100034511000381810003E3810003FF810003FF8900E8833A00E3 + 7E340003FF810003FF810003FF810003FF810003FF8100034811000381810003 + E3810003FF810003FF8500EE8D460003FF810003FF810003FF810003FF810003 + FF810003FF8100034B11000385810003E3810003FF810003FF810003FF810003 + FF810003FF810003FF810003FF810003FF810003FF8100034E11000389810003 + E3810003FF810003FF810003FF810003FF810003FF810003FF810003FF810003 + FF810003FF810003531100038A810003E3810003E3810003E3810003E3810003 + E3810003E3810003E3810003E3810003E3810003E3810003571100038D810003 + 8981000385810003818100037D81000377810003738100037081000366810003 + 648100035E810003594500} + Mask.Data = { + 7A0000005844424D0100817E030083424D7E0700813E03008128030081100300 + 8110030083010001050081400B0081020B0003FF810002FF020082E001020082 + E001020082E001020082E001020082E001020082800102008280010200828001 + 020082E001020082E001020082E001020082E001020082E001020082E0010200 + 02FF0200} + end> + end + object spdSave: TSavePictureDialog + DefaultExt = '*.bmp' + Filter = 'Bitmaps (*.bmp)|*.bmp' + Left = 201 + Top = 24 + end + object actlCommands: TActionList + Images = imglSmall + Left = 128 + Top = 80 + object actAdd: TAction + Caption = '&Add' + Hint = 'Add image' + ImageIndex = 0 + ShortCut = 45 + OnExecute = actAddExecute + end + object actInsert: TAction + Caption = 'Insert' + ShortCut = 8237 + OnExecute = actInsertExecute + end + object actReplace: TAction + Caption = '&Replace' + Hint = 'Replace image' + ImageIndex = 1 + ShortCut = 16466 + OnExecute = actReplaceExecute + end + object actDelete: TAction + Caption = '&Delete' + Hint = 'Delete image' + ImageIndex = 2 + ShortCut = 46 + OnExecute = actDeleteExecute + end + object actClear: TAction + Caption = '&Clear' + Hint = 'Clear' + ImageIndex = 3 + ShortCut = 16430 + OnExecute = actClearExecute + end + object actExport: TAction + Caption = '&Export' + Hint = 'Export images' + ImageIndex = 4 + ShortCut = 16453 + OnExecute = actExportExecute + end + object actImport: TAction + Caption = '&Import' + Hint = 'Import images' + ImageIndex = 5 + OnExecute = actImportExecute + end + object actApply: TAction + Caption = 'Apply' + OnExecute = actApplyExecute + end + object actOK: TAction + Caption = 'OK' + OnExecute = actOKExecute + end + end + object opdOpen: TOpenPictureDialog + Filter = + 'All (*.bmp, *.ico)|*.bmp;*.ico|Bitmaps (*.bmp)|*.bmp|Icons (*.ic' + + 'o)|*.ico' + FilterIndex = 0 + Options = [ofHideReadOnly, ofAllowMultiSelect, ofEnableSizing] + Left = 198 + Top = 80 + end +end diff --git a/official/x.35/ExpressLibrary/Sources/cxImageListEditorView.pas b/official/x.35/ExpressLibrary/Sources/cxImageListEditorView.pas new file mode 100644 index 00000000..cf1edcda --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxImageListEditorView.pas @@ -0,0 +1,535 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxImageListEditorView; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + StdCtrls, ExtCtrls, ComCtrls, CommCtrl, Menus, ImgList, ToolWin, cxGraphics, + cxClasses, cxImageListEditor, ActnList, Dialogs, ExtDlgs; + +type + TcxImageListEditorFormInternalState = (eisSelectingTransparentColor); + TcxImageListEditorFormInternalStates = set of TcxImageListEditorFormInternalState; + + TcxImageListEditorForm = class(TForm) + btnOK: TButton; + btnCancel: TButton; + btnApply: TButton; + gbSelectedImage: TGroupBox; + pbPreview: TPaintBox; + lbTransparentColor: TLabel; + cbTransparentColor: TComboBox; + gbImages: TGroupBox; + lvImages: TListView; + pnlToolBarSubstrate: TPanel; + tbCommands: TToolBar; + tbbAdd: TToolButton; + tbbDelete: TToolButton; + tbbClear: TToolButton; + tbbExport: TToolButton; + tbbReplace: TToolButton; + tbbImport: TToolButton; + pmImageLists: TPopupMenu; + pmCommands: TPopupMenu; + miAdd: TMenuItem; + miReplace: TMenuItem; + miDelete: TMenuItem; + miClear: TMenuItem; + miExport: TMenuItem; + miImport: TMenuItem; + lblManifestWarning: TLabel; + imgWarning: TImage; + imglSmall: TcxImageList; + spdSave: TSavePictureDialog; + actlCommands: TActionList; + actAdd: TAction; + actInsert: TAction; + actReplace: TAction; + actDelete: TAction; + actClear: TAction; + actExport: TAction; + actImport: TAction; + actApply: TAction; + actOK: TAction; + opdOpen: TOpenPictureDialog; + cbImagesSize: TComboBox; + + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + + procedure cbImagesSizeChange(Sender: TObject); + procedure cbTransparentColorChange(Sender: TObject); + procedure cbTransparentColorExit(Sender: TObject); + + procedure lvImagesChange(Sender: TObject; Item: TListItem; + Change: TItemChange); + procedure lvImagesDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure lvImagesEndDrag(Sender, Target: TObject; X, Y: Integer); + procedure lvImagesStartDrag(Sender: TObject; + var DragObject: TDragObject); + procedure lvImagesKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + + procedure pbPreviewMouseDown(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + procedure pbPreviewMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure pbPreviewMouseUp(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + procedure pbPreviewPaint(Sender: TObject); + + procedure actAddExecute(Sender: TObject); + procedure actInsertExecute(Sender: TObject); + procedure actReplaceExecute(Sender: TObject); + procedure actDeleteExecute(Sender: TObject); + procedure actClearExecute(Sender: TObject); + procedure actExportExecute(Sender: TObject); + procedure actImportExecute(Sender: TObject); + procedure actApplyExecute(Sender: TObject); + procedure actOKExecute(Sender: TObject); + private + FImageListEditor: TcxImageListEditor; + FImportList: TStrings; + FDragImageIndex: Integer; + FPreviewImageList: TcxImageList; + FInternalState: TcxImageListEditorFormInternalStates; + + procedure AddColor(const AColor: string); + function ChangeImagesSize: Boolean; + procedure DrawFocusedItem(ACanvas: TCanvas; ARect: TRect); + function GetColorFromCursorPos(X, Y: Integer): TColor; + function GetFocusedImageIndex: Integer; + function IsValidImagesSize(ADisplayImagesSizeValue: string; out ASize: TSize): Boolean; + procedure SetFocusedImageIndex(AValue: Integer); + + procedure AddImages(AAddMode: TcxImageListEditorAddMode); + procedure ImportImageList(Sender: TObject); + procedure PopulateImportItems; + + procedure DataChanged(Sender: TObject); + + procedure UpdateActions; reintroduce; + procedure UpdateControls; + procedure UpdateImagesSizeIndicator; + procedure UpdateTransparentColor(AColor: TColor); overload; + procedure UpdateTransparentColor(X, Y: Integer); overload; + procedure UpdateTransparentColorIndicator(AColor: TColor); + + property FocusedImageIndex: Integer read GetFocusedImageIndex write SetFocusedImageIndex; + public + constructor Create(AImageListEditor: TcxImageListEditor); reintroduce; + destructor Destroy; override; + + function GetVisualDataControl: TListView; + procedure SetImportList(AValue: TStrings); + end; + +implementation + +{$R *.dfm} + +uses + Types, Math, cxGeometry, cxControls, dxOffice11, cxLibraryConsts; + +type + TcxImageListAccess = class(TcxImageList); + +{ TcxImageListEditorForm } + +constructor TcxImageListEditorForm.Create(AImageListEditor: TcxImageListEditor); +begin + inherited Create(nil); + FImageListEditor := AImageListEditor; + FImageListEditor.OnChange := DataChanged; + + FPreviewImageList := TcxImageList.Create(Self); + +{$IFDEF DELPHI9} + PopupMode := pmAuto; +{$ENDIF} + + if IsXPManifestEnabled then + begin + imgWarning.Visible := True; + lblManifestWarning.Caption := 'These images may be distorted if used in standard Windows UI controls with XPManifest enabled.'; + lblManifestWarning.Visible := True; + Width := Width + MulDiv(6{Rows} * 3{Pixel}, Screen.PixelsPerInch, 96); + end; +end; + +destructor TcxImageListEditorForm.Destroy; +begin + FreeAndNil(FPreviewImageList); + inherited; +end; + +function TcxImageListEditorForm.GetVisualDataControl: TListView; +begin + Result := lvImages; +end; + +procedure TcxImageListEditorForm.SetImportList(AValue: TStrings); +begin + FImportList := AValue; + PopulateImportItems; +end; + +procedure TcxImageListEditorForm.FormCreate(Sender: TObject); +begin + lvImages.OnChange := lvImagesChange; + + pbPreview.Cursor := crcxColorPicker; + GetColorValues(AddColor); + FDragImageIndex := -1; + + Constraints.MinWidth := Width; + Constraints.MinHeight := Height; +end; + +procedure TcxImageListEditorForm.FormDestroy(Sender: TObject); +begin + lvImages.OnChange := nil; +end; + +procedure TcxImageListEditorForm.cbImagesSizeChange(Sender: TObject); +begin + if not ChangeImagesSize then + UpdateImagesSizeIndicator; +end; + +procedure TcxImageListEditorForm.cbTransparentColorChange(Sender: TObject); +begin + if cbTransparentColor.Items.IndexOf(cbTransparentColor.Text) <> -1 then + UpdateTransparentColor(StringToColor(cbTransparentColor.Text)); +end; + +procedure TcxImageListEditorForm.cbTransparentColorExit(Sender: TObject); +begin + UpdateTransparentColor(StringToColor(cbTransparentColor.Text)); +end; + +procedure TcxImageListEditorForm.lvImagesChange(Sender: TObject; + Item: TListItem; Change: TItemChange); +begin + UpdateControls; +end; + +procedure TcxImageListEditorForm.lvImagesDragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); +begin + Accept := lvImages.GetItemAt(X, Y) <> nil; +end; + +procedure TcxImageListEditorForm.lvImagesEndDrag(Sender, Target: TObject; X, + Y: Integer); +var + ATargetItem: TListItem; +begin + FImageListEditor.EndUpdate; + ATargetItem := lvImages.GetItemAt(X, Y); + if ATargetItem <> nil then + FImageListEditor.MoveImage(FDragImageIndex, ATargetItem.ImageIndex) + else + FocusedImageIndex := FDragImageIndex; + FDragImageIndex := -1; +end; + +procedure TcxImageListEditorForm.lvImagesStartDrag(Sender: TObject; + var DragObject: TDragObject); +begin + FImageListEditor.BeginUpdate; + FDragImageIndex := FImageListEditor.FocusedImageIndex; +end; + +procedure TcxImageListEditorForm.lvImagesKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if Key = VK_DELETE then + FImageListEditor.DeleteSelectedImages; +end; + +procedure TcxImageListEditorForm.pbPreviewMouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + if ssLeft in Shift then + begin + Include(FInternalState, eisSelectingTransparentColor); + UpdateTransparentColor(X, Y); + end; +end; + +procedure TcxImageListEditorForm.pbPreviewMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +begin + if eisSelectingTransparentColor in FInternalState then + UpdateTransparentColor(X, Y); +end; + +procedure TcxImageListEditorForm.pbPreviewMouseUp(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + Exclude(FInternalState, eisSelectingTransparentColor); +end; + +procedure TcxImageListEditorForm.pbPreviewPaint(Sender: TObject); +var + ARect: TRect; +begin + ARect := pbPreview.ClientRect; + FrameRectByColor(pbPreview.Canvas.Handle, ARect, clNavy); + InflateRect(ARect, -1, -1); + cxDrawHatch(pbPreview.Canvas.Handle, ARect, $BFBFBF, clWhite, 8); + DrawFocusedItem(pbPreview.Canvas, ARect); +end; + +procedure TcxImageListEditorForm.AddColor(const AColor: string); +begin + cbTransparentColor.Items.Add(AColor); +end; + +function TcxImageListEditorForm.ChangeImagesSize: Boolean; +var + ASize: TSize; +begin + Result := IsValidImagesSize(cbImagesSize.Text, ASize) and FImageListEditor.ChangeImagesSize(ASize); +end; + +procedure TcxImageListEditorForm.DrawFocusedItem(ACanvas: TCanvas; ARect: TRect); +begin + if FImageListEditor.IsAnyImageSelected then + begin + FPreviewImageList.Width := FImageListEditor.ImageWidth; + FPreviewImageList.Height := FImageListEditor.ImageHeight; + TcxImageListAccess(FPreviewImageList).AddImageInfo(FImageListEditor.ImagesInfo[FocusedImageIndex]); + FPreviewImageList.Draw(ACanvas, ARect, 0); + FPreviewImageList.Clear; + end; +end; + +function TcxImageListEditorForm.GetColorFromCursorPos(X, Y: Integer): TColor; +begin + if cxRectPtIn(Rect(0, 0, pbPreview.Width, pbPreview.Height), X, Y) then + begin + X := X * FImageListEditor.ImageWidth div pbPreview.Width; + Y := Y * FImageListEditor.ImageHeight div pbPreview.Height; + Result := FImageListEditor.ImagesInfo[FocusedImageIndex].Image.Canvas.Pixels[X, Y]; + end + else + Result := FImageListEditor.ImagesInfo[FocusedImageIndex].MaskColor; +end; + +function TcxImageListEditorForm.GetFocusedImageIndex: Integer; +begin + Result := FImageListEditor.FocusedImageIndex; +end; + +function TcxImageListEditorForm.IsValidImagesSize(ADisplayImagesSizeValue: string; out ASize: TSize): Boolean; +var + APosition: Integer; +begin + APosition := Pos('x', ADisplayImagesSizeValue); + Result := (APosition <> 0) and + TryStrToInt(Copy(ADisplayImagesSizeValue, 1, APosition - 1), ASize.cx) and + TryStrToInt(Copy(ADisplayImagesSizeValue, APosition + 1, Length(ADisplayImagesSizeValue) - APosition), ASize.cy); +end; + +procedure TcxImageListEditorForm.SetFocusedImageIndex(AValue: Integer); +begin + FImageListEditor.FocusedImageIndex := AValue; +end; + +procedure TcxImageListEditorForm.AddImages(AAddMode: TcxImageListEditorAddMode); +begin + opdOpen.Filter := cxImageFileFormats.GetFilter; + if opdOpen.Execute then + FImageListEditor.AddImages(opdOpen.Files, AAddMode); +end; + +procedure TcxImageListEditorForm.ImportImageList(Sender: TObject); +begin + FImageListEditor.ImportImages(FImportList.Objects[TMenuItem(Sender).Tag] as TCustomImageList); +end; + +procedure TcxImageListEditorForm.PopulateImportItems; + + procedure PopulateItem(AParentItem: TMenuItem); + var + AMenuItem: TMenuItem; + I: Integer; + begin + AParentItem.Clear; + for I := 0 to FImportList.Count - 1 do + begin + AMenuItem := TMenuItem.Create(Self); + AMenuItem.OnClick := ImportImageList; + AMenuItem.Caption := FImportList[I]; + AMenuItem.Tag := I; + AParentItem.Add(AMenuItem); + end; + end; + +begin + PopulateItem(pmImageLists.Items); + PopulateItem(miImport); +end; + +procedure TcxImageListEditorForm.DataChanged(Sender: TObject); +begin + UpdateControls; +end; + +procedure TcxImageListEditorForm.UpdateActions; +begin + actDelete.Enabled := FImageListEditor.IsAnyImageSelected; + actClear.Enabled := FImageListEditor.ImagesCount > 0; + actExport.Enabled := FImageListEditor.ImagesCount > 0; + actReplace.Enabled := FImageListEditor.IsAnyImageSelected; + actInsert.Enabled := FImageListEditor.IsAnyImageSelected; + actApply.Enabled := FImageListEditor.IsChanged; + actImport.Enabled := (FImportList <> nil) and (FImportList.Count <> 0); +end; + +procedure TcxImageListEditorForm.UpdateControls; +var + AAllowSelectTransparentColor: Boolean; +begin + if FImageListEditor.IsUpdateLocked then + Exit; + + AAllowSelectTransparentColor := FImageListEditor.IsAnyImageSelected and + not IsGlyphAssigned(FImageListEditor.ImagesInfo[FocusedImageIndex].Mask) and + not FImageListEditor.ImagesInfo[FocusedImageIndex].AlphaUsed; + + //gbSelectedImage + pbPreview.Enabled := AAllowSelectTransparentColor; + cbTransparentColor.Enabled := AAllowSelectTransparentColor; + lbTransparentColor.Enabled := AAllowSelectTransparentColor; + + pbPreview.Invalidate; + + if AAllowSelectTransparentColor then + UpdateTransparentColorIndicator(FImageListEditor.ImagesInfo[FocusedImageIndex].MaskColor) + else + UpdateTransparentColorIndicator(clNone); + + UpdateImagesSizeIndicator; + UpdateActions; +end; + +procedure TcxImageListEditorForm.UpdateImagesSizeIndicator; +var + AImagesSizeDisplayText: string; + ASizeIndex: Integer; +begin + AImagesSizeDisplayText := Format('%dx%d', [FImageListEditor.ImageWidth, FImageListEditor.ImageHeight]); + ASizeIndex := cbImagesSize.Items.IndexOf(AImagesSizeDisplayText); + if ASizeIndex <> -1 then + cbImagesSize.ItemIndex := ASizeIndex + else + cbImagesSize.Items.Add(AImagesSizeDisplayText); +end; + +procedure TcxImageListEditorForm.UpdateTransparentColor(AColor: TColor); +begin + FImageListEditor.UpdateTransparentColor(AColor); +end; + +procedure TcxImageListEditorForm.UpdateTransparentColor(X, Y: Integer); +begin + UpdateTransparentColor(GetColorFromCursorPos(X, Y)); +end; + +procedure TcxImageListEditorForm.UpdateTransparentColorIndicator(AColor: TColor); +begin + cbTransparentColor.Text := ColorToString(AColor); +end; + +procedure TcxImageListEditorForm.actAddExecute(Sender: TObject); +begin + AddImages(amAdd); +end; + +procedure TcxImageListEditorForm.actInsertExecute(Sender: TObject); +begin + AddImages(amInsert); +end; + +procedure TcxImageListEditorForm.actReplaceExecute(Sender: TObject); +begin + AddImages(amReplace); +end; + +procedure TcxImageListEditorForm.actDeleteExecute(Sender: TObject); +begin + FImageListEditor.DeleteSelectedImages; +end; + +procedure TcxImageListEditorForm.actClearExecute(Sender: TObject); +begin + FImageListEditor.ClearImages; +end; + +procedure TcxImageListEditorForm.actExportExecute(Sender: TObject); +begin + if spdSave.Execute then + FImageListEditor.ExportImages(spdSave.FileName); +end; + +procedure TcxImageListEditorForm.actImportExecute(Sender: TObject); +begin + // (don't remove this method) +end; + +procedure TcxImageListEditorForm.actApplyExecute(Sender: TObject); +begin + FImageListEditor.ApplyChanges; +end; + +procedure TcxImageListEditorForm.actOKExecute(Sender: TObject); +begin + FImageListEditor.ApplyChanges; +end; + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxImportDialog.dfm b/official/x.35/ExpressLibrary/Sources/cxImportDialog.dfm new file mode 100644 index 00000000..440d9d29 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxImportDialog.dfm @@ -0,0 +1,150 @@ +object cxImportDialogForm: TcxImportDialogForm + Left = 288 + Top = 203 + BorderIcons = [biSystemMenu] + BorderStyle = bsSingle + Caption = 'Import' + ClientHeight = 367 + ClientWidth = 546 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 141 + Top = 0 + Width = 113 + Height = 367 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object Button1: TButton + Left = 12 + Top = 8 + Width = 89 + Height = 25 + Caption = 'Import' + Enabled = False + TabOrder = 0 + OnClick = Button1Click + end + object Button2: TButton + Left = 12 + Top = 40 + Width = 89 + Height = 25 + Cancel = True + Caption = 'Close' + ModalResult = 2 + TabOrder = 1 + end + object Button3: TButton + Left = 12 + Top = 332 + Width = 89 + Height = 25 + Caption = 'Options >>' + TabOrder = 2 + OnClick = Button3Click + end + end + object ListBox1: TListBox + Left = 0 + Top = 0 + Width = 141 + Height = 367 + Align = alLeft + ItemHeight = 13 + TabOrder = 1 + OnClick = ListBox1Click + OnDblClick = ListBox1DblClick + end + object StylesPane: TPanel + Left = 254 + Top = 0 + Width = 292 + Height = 367 + Align = alClient + TabOrder = 2 + object PageControl1: TPageControl + Left = 1 + Top = 1 + Width = 290 + Height = 365 + ActivePage = TabSheet2 + Align = alClient + TabOrder = 0 + TabStop = False + object TabSheet2: TTabSheet + Caption = 'Styles' + ImageIndex = 1 + OnShow = TabSheet2Show + object GroupBox2: TGroupBox + Left = 0 + Top = 36 + Width = 282 + Height = 301 + Align = alBottom + Caption = ' StyleRepository Options ' + TabOrder = 1 + object RadioButton1: TRadioButton + Left = 16 + Top = 28 + Width = 169 + Height = 17 + Caption = 'Create New StyleRepository' + Checked = True + TabOrder = 0 + TabStop = True + OnClick = RadioButton1Click + end + object RadioButton2: TRadioButton + Left = 16 + Top = 100 + Width = 173 + Height = 17 + Caption = 'Use Existing StyleRepository' + TabOrder = 2 + OnClick = RadioButton2Click + end + object Edit1: TEdit + Left = 36 + Top = 52 + Width = 229 + Height = 21 + TabOrder = 1 + end + object ComboBox1: TComboBox + Left = 36 + Top = 124 + Width = 229 + Height = 21 + Style = csDropDownList + Color = clBtnFace + Enabled = False + ItemHeight = 13 + TabOrder = 3 + end + end + object cbImportStyles: TCheckBox + Left = 4 + Top = 8 + Width = 97 + Height = 17 + Caption = 'Import Styles' + Checked = True + State = cbChecked + TabOrder = 0 + OnClick = cbImportStylesClick + end + end + end + end +end diff --git a/official/x.35/ExpressLibrary/Sources/cxImportDialog.pas b/official/x.35/ExpressLibrary/Sources/cxImportDialog.pas new file mode 100644 index 00000000..e9a832b0 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxImportDialog.pas @@ -0,0 +1,392 @@ +{*******************************************************************} +{ } +{ Developer Express Cross Platform Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL AND CLX CONTROLS AS PART OF AN EXECUTABLE } +{ PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} +unit cxImportDialog; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + DesignIntf, Variants, +{$ELSE} + DsgnIntf, +{$ENDIF} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, ComCtrls, ExtCtrls, cxConverterFactory, TypInfo, cxStyles, + cxDesignWindows; + +type + TcxImportDialogForm = class(TForm) + Panel1: TPanel; + Button1: TButton; + Button2: TButton; + Button3: TButton; + ListBox1: TListBox; + StylesPane: TPanel; + PageControl1: TPageControl; + TabSheet2: TTabSheet; + GroupBox2: TGroupBox; + RadioButton1: TRadioButton; + RadioButton2: TRadioButton; + Edit1: TEdit; + ComboBox1: TComboBox; + cbImportStyles: TCheckBox; + procedure Button3Click(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure ListBox1Click(Sender: TObject); + procedure Button1Click(Sender: TObject); + procedure ListBox1DblClick(Sender: TObject); + procedure cbImportStylesClick(Sender: TObject); + procedure RadioButton1Click(Sender: TObject); + procedure RadioButton2Click(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure TabSheet2Show(Sender: TObject); + private + FDesigner: IDesigner; + FDestination: TObject; + FGroupConverterName: string; + FStyleOptionsFirstShow: Boolean; + FStylePaneWidth: Integer; + procedure DisableStylesOptions; + procedure DoImport; + procedure EnableStylesOptions; + function GetStylePaneWidth: Integer; + function GetConverterIndex(ASource: TObject): Integer; + function IsParent(ASource: TObject; const AParentClassName: string): Boolean; + procedure LoadComponent(const S: string); + procedure LoadStyleRepositories(const S: string); + procedure ShowStyleOptions; + procedure UpdateComboBox; + protected + function GetConverterClass(ASource: TObject): TcxCustomConverterWithStylesClass; + function GetConverterName(ASource: TObject): string; + procedure InitializeConverter(AConverter: TcxCustomConverterWithStyles); virtual; + procedure InitializeOptions; virtual; + public + constructor Create(AOwner: TComponent); override; + property Designer_: IDesigner read FDesigner write FDesigner; + property Destination: TObject read FDestination write FDestination; + property GroupConverterName: string read FGroupConverterName write FGroupConverterName; + end; + + procedure ShowImportDialog(ADesigner: IDesigner; + ADestination: TObject; const AGroupConverterName: string; AShowOptionsButton: Boolean = True); + +implementation + +{$R *.dfm} + +const + scxStyleRepositoryClassName = 'TcxStyleRepository'; + +procedure ShowImportDialog(ADesigner: IDesigner; + ADestination: TObject; const AGroupConverterName: string; AShowOptionsButton: Boolean); +begin + with TcxImportDialogForm.Create(Application) do + try + Button3.Visible := AShowOptionsButton; + Width := Width - GetStylePaneWidth; + Destination := ADestination; + GroupConverterName := AGroupConverterName; + Designer_ := ADesigner; + ShowModal; + ADesigner.Modified; + finally + Free; + end; +end; + +{ TcxImportDialogForm } + +constructor TcxImportDialogForm.Create(AOwner: TComponent); +begin + inherited; + FStylePaneWidth := StylesPane.Width; +end; + +procedure TcxImportDialogForm.Button3Click(Sender: TObject); +begin + InitializeOptions; + Width := Width + GetStylePaneWidth; + Button3.Enabled := False; +end; + +function TcxImportDialogForm.GetConverterClass(ASource: TObject): TcxCustomConverterWithStylesClass; +var + AIndex: Integer; +begin + AIndex := GetConverterIndex(ASource); + if AIndex <> -1 then + Result := ConverterFactory(FGroupConverterName).Items[AIndex].Class_ + else + Result := TcxCustomConverterWithStyles; +end; + +function TcxImportDialogForm.GetConverterName(ASource: TObject): string; +var + AIndex: Integer; +begin + AIndex := GetConverterIndex(ASource); + if AIndex <> -1 then + Result := ConverterFactory(FGroupConverterName).Items[AIndex].Name + else + Result := ''; +end; + +procedure TcxImportDialogForm.InitializeConverter(AConverter: TcxCustomConverterWithStyles); +begin +end; + +procedure TcxImportDialogForm.InitializeOptions; +begin + ShowStyleOptions; +end; + +procedure TcxImportDialogForm.DisableStylesOptions; +begin + RadioButton1.Enabled := False; + RadioButton2.Enabled := False; + Edit1.Enabled := False; + Edit1.Color := clBtnFace; + ComboBox1.Enabled := False; + ComboBox1.Color := clBtnFace; +end; + +procedure TcxImportDialogForm.DoImport; +var + AConverter: TcxCustomConverterWithStyles; +begin + if (ListBox1.ItemIndex <> -1) and (FDestination <> nil) then + begin + AConverter := GetConverterClass(ListBox1.Items.Objects[ListBox1.ItemIndex]).Create(FDestination); + try + AConverter.Designer_ := Designer_; + AConverter.ConvertWithStyles := cbImportStyles.Checked; + if cbImportStyles.Checked then + begin + if RadioButton1.Checked then + AConverter.NameOfNewStyleRepository := Edit1.Text + else + AConverter.StyleRepository := ComboBox1.Items.Objects[ComboBox1.ItemIndex] as TcxStyleRepository; + end; + InitializeConverter(AConverter); + Button1.Enabled := False; + AConverter.ImportFrom(ListBox1.Items.Objects[ListBox1.ItemIndex]); + finally + Button1.Enabled := True; + AConverter.Free; + if RadioButton1.Checked then + UpdateComboBox; + if cbImportStyles.Checked then + EnableStylesOptions; + end; + end; +end; + +procedure TcxImportDialogForm.EnableStylesOptions; +begin + RadioButton1.Enabled := True; + if ComboBox1.Items.Count > 0 then + begin + RadioButton2.Enabled := True; + if RadioButton1.Checked then + begin + Edit1.Enabled := True; + Edit1.Color := clWindow; + ComboBox1.Enabled := False; + ComboBox1.Color := clBtnFace; + end + else + begin + Edit1.Enabled := False; + Edit1.Color := clBtnFace; + ComboBox1.Enabled := True; + ComboBox1.Color := clWindow; + end; + end + else + begin + RadioButton2.Enabled := False; + RadioButton1.Checked := True; + Edit1.Enabled := True; + Edit1.Color := clWindow; + ComboBox1.Enabled := False; + ComboBox1.Color := clBtnFace; + end; +end; + +function TcxImportDialogForm.GetStylePaneWidth: Integer; +begin + Result := FStylePaneWidth; +end; + +function TcxImportDialogForm.GetConverterIndex(ASource: TObject): Integer; +var + I: Integer; + ASourceClassName: string; +begin + Result := -1; + ASourceClassName := ASource.ClassName; + with ConverterFactory(FGroupConverterName) do + begin + for I := 0 to Count - 1 do + begin + if (Items[I].Class_.GetSourceClassName = ASourceClassName) or + IsParent(ASource, Items[I].Class_.GetSourceClassName) then + begin + Result := I; + Break; + end; + end; + end; +end; + +function TcxImportDialogForm.IsParent(ASource: TObject; const AParentClassName: string): Boolean; +var + AParentClass: TClass; +begin + Result := False; + AParentClass := ASource.ClassParent; + while AParentClass <> nil do + begin + if AParentClass.ClassName = AParentClassName then + begin + Result := True; + Exit; + end; + AParentClass := AParentClass.ClassParent; + end; +end; + +procedure TcxImportDialogForm.LoadComponent(const S: string); +var + AComponent: TComponent; +begin + if FDesigner <> nil then + begin + AComponent := FDesigner.GetComponent(S); + if AComponent <> nil then + if GetConverterIndex(AComponent) <> -1 then + ListBox1.Items.AddObject(S, AComponent); + end; +end; + +procedure TcxImportDialogForm.LoadStyleRepositories(const S: string); +var + AComponent: TComponent; +begin + AComponent := FDesigner.GetComponent(S); + if AComponent <> nil then + if AComponent.ClassName = scxStyleRepositoryClassName then + ComboBox1.Items.AddObject(S, AComponent); +end; + +procedure TcxImportDialogForm.ShowStyleOptions; +begin + if FStyleOptionsFirstShow then + begin + UpdateComboBox; + EnableStylesOptions; + FStyleOptionsFirstShow := False; + end; +end; + +procedure TcxImportDialogForm.UpdateComboBox; +var + AIndex: Integer; +begin + AIndex := 0; + if ComboBox1.Items.Count > 0 then + AIndex := ComboBox1.ItemIndex; + ComboBox1.Clear; + FDesigner.GetComponentNames(GetTypeData(PTypeInfo(TComponent.ClassInfo)), LoadStyleRepositories); + if ComboBox1.Items.Count > 0 then + ComboBox1.ItemIndex := AIndex; + Edit1.Text := FDesigner.UniqueName(scxStyleRepositoryClassName); +end; + +procedure TcxImportDialogForm.FormShow(Sender: TObject); +begin + ListBox1.Items.Clear; + Edit1.Text := FDesigner.UniqueName(scxStyleRepositoryClassName); + FDesigner.GetComponentNames(GetTypeData(PTypeInfo(TComponent.ClassInfo)), LoadComponent); +end; + +procedure TcxImportDialogForm.ListBox1Click(Sender: TObject); +begin + if ListBox1.ItemIndex <> -1 then + Button1.Enabled := True; +end; + +procedure TcxImportDialogForm.Button1Click(Sender: TObject); +begin + DoImport; +end; + +procedure TcxImportDialogForm.ListBox1DblClick(Sender: TObject); +begin + DoImport; +end; + +procedure TcxImportDialogForm.cbImportStylesClick(Sender: TObject); +begin + if cbImportStyles.Checked then + EnableStylesOptions + else + DisableStylesOptions; +end; + +procedure TcxImportDialogForm.RadioButton1Click(Sender: TObject); +begin + EnableStylesOptions; +end; + +procedure TcxImportDialogForm.RadioButton2Click(Sender: TObject); +begin + EnableStylesOptions; +end; + +procedure TcxImportDialogForm.FormCreate(Sender: TObject); +begin + FStyleOptionsFirstShow := True; +end; + +procedure TcxImportDialogForm.TabSheet2Show(Sender: TObject); +begin + ShowStyleOptions; +end; + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxLibraryConsts.pas b/official/x.35/ExpressLibrary/Sources/cxLibraryConsts.pas new file mode 100644 index 00000000..acf318ec --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxLibraryConsts.pas @@ -0,0 +1,146 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxLibraryConsts; + +{$I cxVer.inc} + +interface + +const + // Cursors + // cxControls + crBase = 2100; + crDragCopy = crBase; + crcxRemove = crBase + 8; + crcxVertSize = crBase + 9; + crcxHorzSize = crBase + 10; + crcxDragMulti = crBase + 11; + crcxNoDrop = crBase + 12; + crcxDrag = crBase + 13; + crcxColorPicker = crBase + 14; + crcxHandPoint = -crBase + 1; + + // dxNavBar + dxNavBarDragCursor = -1120; + dxNavBarDragCopyCursor = -1119; + dxNavBarLinksCursor = -1118; + + // dxBars + crdxBarDrag = 1041; + crdxBarDragCopy = 1042; + crdxBarDragNoDrop = 1043; + crdxBarEditSizing = 1044; + + // dxSideBar + dxSideBarDragCursor = -1121; + dxSideBarDragCopyCursor = -1122; + dxSideBarDragDeleteCursor = -1123; + dxSideBarGroupCursor = -1125; + + // dxLayout + dxLayoutControlCursorBase = 3000; + crdxLayoutControlDrag = dxLayoutControlCursorBase + 1; + + // cxEdit + crcxEditBase = 4101; + crcxEditMouseWheel = crcxEditBase; + + // cxGrid + crcxGridBase = 4000; + crcxGridHorzSize: Integer = crcxGridBase + 1; + crcxGridVertSize: Integer = crcxGridBase + 2; + crcxGridRemove: Integer = crcxGridBase + 3; + crcxGridNoDrop: Integer = crcxGridBase + 4; + crcxGridDrag: Integer = crcxGridBase + 5; + crcxGridMultiDrag: Integer = crcxGridBase + 6; + crcxGridSelectRow: Integer = crcxGridBase + 7; + crcxGridMagnifier = crcxGridBase + 50; +// crcxGridDrag = crcxGridBase + 51; + + // cxScheduler + crSchedulerCopyEvent = 4201; + crSchedulerMoveEvent = 4202; + crSchedulerHorzSplit = 4203; + crSchedulerVertSplit = 4204; + crSchedulerSplitAll = 4205; + crSchedulerVertResize = 4206; + crSchedulerHorzResize = 4207; + crCalendarMirrorArrow = 4208; + crTaskLink = 4209; + + // cxPivotGrid + crcxPivotGridBase = 4300; + crcxPivotGridArrow: Integer = crcxPivotGridBase + 1; + crcxPivotGridHorzSize: Integer = crcxPivotGridBase + 2; + crcxPivotGridNoDrop: Integer = crcxPivotGridBase + 3; + crcxPivotGridRemove: Integer = crcxPivotGridBase + 4; + + // cxSpreadSheet + crSSSelect = 3200; + + // cxVerticalGrid + crcxInspectorInsert = -1228; + crcxInspectorAddChild = -1229; + crcxInspectorAdd = -1230; + crcxInspectorHide = -1241; + crcxInspectorNoDrag = -1242; + + // dxTree + crdxTreeDrag = -1011; + + // dxFlowChart + crFlChartZoomIn = 2001; + crFlChartZoomOut = 2002; + + // dxMasterView + crdxMasterViewMirror = 1501; + crdxMasterViewFullScroll = 1502; + crdxMasterViewHorScroll = 1503; + crdxMasterViewVerScroll = 1504; + crdxMasterViewUpScroll = 1505; + crdxMasterViewRightScroll = 1506; + crdxMasterViewDownScroll = 1507; + crdxMasterViewLeftScroll = 1508; + crdxMasterViewHorSize = 1509; + crdxMasterViewVerSize = 1512; + crdxMasterViewRemove = 1510; + crdxMasterViewNoDrop = 1511; + +implementation + +end. + diff --git a/official/x.35/ExpressLibrary/Sources/cxLibraryReg.dcr b/official/x.35/ExpressLibrary/Sources/cxLibraryReg.dcr new file mode 100644 index 00000000..8e8077c5 Binary files /dev/null and b/official/x.35/ExpressLibrary/Sources/cxLibraryReg.dcr differ diff --git a/official/x.35/ExpressLibrary/Sources/cxLibraryReg.pas b/official/x.35/ExpressLibrary/Sources/cxLibraryReg.pas new file mode 100644 index 00000000..0e162a15 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxLibraryReg.pas @@ -0,0 +1,1375 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxLibraryReg; + +{$I cxVer.inc} + +interface + +uses + SysUtils, Forms, Classes, Controls, Menus, TypInfo, +{$IFDEF DELPHI6} + DesignIntf, DesignEditors, DesignConst, DesignMenus, +{$ELSE} + DsgnIntf, SysConst, +{$ENDIF} + cxPropertiesStore, cxPropertiesStoreEditor, + PicEdit, dxGDIPlusAPI, dxGDIPlusClasses, + cxContainer, cxLookAndFeels, + cxDesignWindows, cxStyleRepositoryEditor, cxImageListEditor, cxStyles, + cxControls, cxLookAndFeelPainters; + +const + dxCompanyName = 'Developer Express Inc.'; + dxCompanyURL = 'www.devexpress.com'; + dxLibraryProductPage = 'Dev Express'; + + sdxBitmapAndPNGFilter = 'All (*.bmp;*.png)|*.bmp;*.png|Bitmaps (*.bmp)|*.bmp|PNG graphics from DevExpress (*.png)|*.png'; + +type + TDesignMenuItem = {$IFDEF DELPHI6}DesignMenus.IMenuItem{$ELSE}TMenuItem{$ENDIF}; +{$IFNDEF DELPHI6} + TGetPropProc = TGetPropEditProc; +{$ENDIF} + + { TcxComponentEditorHelper } + + TcxComponentEditorHelper = class + private + FComponentEditor: TComponentEditor; + FProductName: string; + FProductMajorVersion: string; + FProductMinorVersion: string; + public + constructor Create(AComponentEditor: TComponentEditor; const AProductName, AProductMajorVersion, AProductMinorVersion: string); + function GetVerb(Index: Integer): string; + function GetVerbCount: Integer; + end; + + { TcxComponentEditor } + + TcxComponentEditor = class(TComponentEditor) + private + FHelper: TcxComponentEditorHelper; + protected + function GetProductMajorVersion: string; virtual; abstract; + function GetProductMinorVersion: string; virtual; + function GetProductName: string; virtual; abstract; + function InternalGetVerb(AIndex: Integer): string; virtual; + function InternalGetVerbCount: Integer; virtual; + procedure InternalExecuteVerb(AIndex: Integer); virtual; + public + constructor Create(AComponent: TComponent; ADesigner: IDesigner); override; + destructor Destroy; override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + procedure ExecuteVerb(Index: Integer); override; + end; + + TcxDefaultEditor = class(TDefaultEditor) + private + FHelper: TcxComponentEditorHelper; + protected + function GetProductMajorVersion: string; virtual; abstract; + function GetProductMinorVersion: string; virtual; + function GetProductName: string; virtual; abstract; + function InternalGetVerb(AIndex: Integer): string; virtual; + function InternalGetVerbCount: Integer; virtual; + public + constructor Create(AComponent: TComponent; ADesigner: IDesigner); override; + destructor Destroy; override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + end; + + { TcxControlPopupMenuProperty } + + TcxControlPopupMenuProperty = class(TComponentProperty) + private + FProc: TGetStrProc; + procedure CheckComponent(const Value: string); + public + procedure GetValues(Proc: TGetStrProc); override; + end; + + { TcxBitmapGraphicProperty } + + TcxBitmapGraphicProperty = class(TGraphicProperty) + private + procedure OnShowPicEdit(Sender: TObject); + protected + function BuildFilter: string; virtual; + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure SetValue(const Value: string); override; + end; + + TcxBitmapProperty = class(TcxBitmapGraphicProperty) + protected + function BuildFilter: string; override; + end; + +procedure HideClassProperties(AClass: TClass; APropertyNames: array of string); +procedure Register; + +implementation + +uses +{$IFDEF DELPHI6} + VCLEditors, + Types, +{$ENDIF} + Windows, Math, Graphics, Dialogs, ImgList, cxGraphics, cxPropEditors, + cxClasses; + +const +// cxLibraryVersion = '6.24'; + cxLibraryMajorVersion = '6'; + +type + TcxContainerAccess = class(TcxContainer); + + { TcxLibraryComponentEditor } + + TcxLibraryComponentEditor = class(TcxComponentEditor) + protected + function GetProductMajorVersion: string; override; + function GetProductName: string; override; + end; + + { TcxLookAndFeelControllerEditor } + + TcxLookAndFeelControllerEditor = class(TcxLibraryComponentEditor) + private + function GetLookAndFeelController: TcxLookAndFeelController; + public + procedure Edit; override; + procedure ExecuteVerb(Index: Integer); override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + end; + + { TcxStyleRepositoryComponentEditor } + + TcxStyleRepositoryComponentEditor = class(TcxLibraryComponentEditor) + private + function GetStyleRepository: TcxStyleRepository; + public + procedure ExecuteVerb(Index: Integer); override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + end; + + { TcxPropertiesStoreComponentEditor } + + TcxPropertiesStoreComponentEditor = class(TcxLibraryComponentEditor) + private + function GetPropertiesStore: TcxPropertiesStore; + public + procedure ExecuteVerb(Index: Integer); override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + end; + + { TcxImageListComponentEditor } + + TcxImageListComponentEditor = class(TcxLibraryComponentEditor) + private + FAssignableImageLists: TStringList; + FImageLists: TStringList; + procedure AssignClick(Sender: TObject); + procedure CheckAddImageList(const AImageListName: string; + AList: TStringList); + procedure CheckImageListForImport(const AImageListName: string); + procedure CheckImageListForAssign(const AImageListName: string); + function GetImageList: TcxImageList; + procedure UpdateAssignableList; + public + constructor Create(AComponent: TComponent; ADesigner: IDesigner); override; + destructor Destroy; override; + procedure ExecuteVerb(Index: Integer); override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + procedure PrepareItem(Index: Integer; const AItem: TDesignMenuItem); override; + + property ImageList: TcxImageList read GetImageList; + end; + + { TcxContainerStyleProperty } + + TcxContainerStyleProperty = class(TClassProperty) + private + FProc: TGetPropProc; + procedure GetPropProc({$IFNDEF DELPHI6}Prop: TPropertyEditor{$ELSE}const Prop: IProperty{$ENDIF}); + public + procedure GetProperties(Proc: TGetPropProc); override; + end; + + { TcxContainerStyleAssignedValuesProperty } + + TcxContainerStyleAssignedValuesProperty = class(TSetProperty) + protected + procedure FillVisiblePropertiesList(AList: TStringList); + public + procedure GetProperties(Proc: TGetPropProc); override; + function GetValue: string; override; + end; + + { TcxContainerStyleAssignedValuesElementProperty } + + TcxContainerStyleAssignedValuesElementProperty = class(TSetElementProperty) +{$IFNDEF DELPHI6} + private + FElement: Integer; + protected + constructor Create(Parent: TPropertyEditor; AElement: Integer); + property Element: Integer read FElement; +{$ENDIF} + public + function GetName: string; override; + end; + + { TcxLookAndFeelProperty } + + TcxLookAndFeelProperty = class(TClassProperty) + private + FProc: TGetPropProc; + procedure GetPropProc({$IFNDEF DELPHI6}Prop: TPropertyEditor{$ELSE}const Prop: IProperty{$ENDIF}); + public + procedure GetProperties(Proc: TGetPropProc); override; + end; + + { TcxLookAndFeelAssignedValuesProperty } + + TcxLookAndFeelAssignedValuesProperty = class(TSetProperty) + protected + FProc: TGetPropProc; + procedure GetPropProc({$IFNDEF DELPHI6}Prop: TPropertyEditor{$ELSE}const Prop: IProperty{$ENDIF}); + public + procedure GetProperties(Proc: TGetPropProc); override; + end; + +{ TcxLibraryComponentEditor } + +function TcxLibraryComponentEditor.GetProductMajorVersion: string; +begin + Result := cxLibraryMajorVersion; +end; + +function TcxLibraryComponentEditor.GetProductName: string; +begin + Result := 'ExpressLibrary'; +end; + +{ TcxLookAndFeelControllerEditor } + +procedure TcxLookAndFeelControllerEditor.Edit; +begin +end; + +procedure TcxLookAndFeelControllerEditor.ExecuteVerb(Index: Integer); +begin + case Index of + 0: + begin + with GetLookAndFeelController do + begin + Kind := cxDefaultLookAndFeelKind; + NativeStyle := cxDefaultLookAndFeelNativeStyle; + end; + Designer.Modified; + end; + end; +end; + +function TcxLookAndFeelControllerEditor.GetVerb(Index: Integer): string; +begin + if Index = 0 then + Result := 'Reset' + else + Result := inherited GetVerb(Index); +end; + +function TcxLookAndFeelControllerEditor.GetVerbCount: Integer; +begin + Result := 1 + inherited GetVerbCount; +end; + +function TcxLookAndFeelControllerEditor.GetLookAndFeelController: TcxLookAndFeelController; +begin + Result := Component as TcxLookAndFeelController; +end; + +{ TcxStyleRepositoryComponentEditor } + +procedure TcxStyleRepositoryComponentEditor.ExecuteVerb(Index: Integer); +begin + if Index = 0 then + ShowStyleRepositoryEditor(Designer, GetStyleRepository); +end; + +function TcxStyleRepositoryComponentEditor.GetVerb(Index: Integer): string; +begin + if Index = 0 then + Result := 'Edit...' + else + Result := inherited GetVerb(Index); +end; + +function TcxStyleRepositoryComponentEditor.GetVerbCount: Integer; +begin + Result := 1 + inherited GetVerbCount; +end; + +function TcxStyleRepositoryComponentEditor.GetStyleRepository: TcxStyleRepository; +begin + Result := Component as TcxStyleRepository; +end; + +{ TcxStyleSheetComponentProperty } + +type + TcxStyleSheetComponentProperty = class(TComponentProperty) + private + FStrProc: TGetStrProc; + procedure StrProc(const S: string); + public + procedure GetValues(Proc: TGetStrProc); override; + end; + +procedure TcxStyleSheetComponentProperty.StrProc(const S: string); +begin + if TcxStyles(GetComponent(0)).IsValidStyleSheet(TcxCustomStyleSheet(Designer.GetComponent(S))) then + FStrProc(S); +end; + +procedure TcxStyleSheetComponentProperty.GetValues(Proc: TGetStrProc); +begin + FStrProc := Proc; + Designer.GetComponentNames(GetTypeData(GetPropType), StrProc); +end; + +{ TcxPropertiesStoreComponentEditor } + +procedure TcxPropertiesStoreComponentEditor.ExecuteVerb(Index: Integer); +var + AActive: Boolean; + APropertiesStore: TcxPropertiesStore; + + procedure DsgnStoreTo; + begin + APropertiesStore := TcxPropertiesStore(Component); + AActive := APropertiesStore.Active; + APropertiesStore.Active := True; + APropertiesStore.StoreTo; + APropertiesStore.Active := AActive; + end; + + procedure DsgnRestoreFrom; + begin + APropertiesStore := TcxPropertiesStore(Component); + AActive := APropertiesStore.Active; + APropertiesStore.Active := True; + APropertiesStore.RestoreFrom; + APropertiesStore.Active := AActive; + end; + +begin + case Index of + 0: ShowPropertiesStoreEditor(GetPropertiesStore, + {$IFNDEF DELPHI6}Designer.GetRoot{$ELSE}Designer.Root{$ENDIF}, Designer); + 2: DsgnStoreTo; + 3: DsgnRestoreFrom; + end; +end; + +function TcxPropertiesStoreComponentEditor.GetVerb(Index: Integer): string; +begin + case Index of + 0: Result := 'Edit...'; + 1: Result := '-'; + 2: Result := 'Store'; + 3: Result := 'Restore'; + else + Result := inherited GetVerb(Index); + end; +end; + +function TcxPropertiesStoreComponentEditor.GetVerbCount: Integer; +begin + Result := 1 + 3 + inherited GetVerbCount; +end; + +function TcxPropertiesStoreComponentEditor.GetPropertiesStore: TcxPropertiesStore; +begin + Result := Component as TcxPropertiesStore; +end; + +{ TcxImageListComponentEditor } + +constructor TcxImageListComponentEditor.Create(AComponent: TComponent; + ADesigner: IDesigner); +begin + inherited Create(AComponent, ADesigner); + FAssignableImageLists := TStringList.Create; + FAssignableImageLists.Sorted := True; +end; + +destructor TcxImageListComponentEditor.Destroy; +begin + FreeAndNil(FAssignableImageLists); + inherited Destroy; +end; + +procedure TcxImageListComponentEditor.ExecuteVerb(Index: Integer); + + procedure Edit; + begin + FImageLists := TStringList.Create; + try + Designer.GetComponentNames(GetTypeData(TCustomImageList.ClassInfo), CheckImageListForImport); + if cxEditImageList(ImageList, FImageLists) then + Designer.Modified; + finally + FreeAndNil(FImageLists); + end; + end; + +begin + if (Index = 0) then + Edit + else + inherited +end; + +function TcxImageListComponentEditor.GetVerb(Index: Integer): string; +begin + if Index = 0 then + Result := 'Edit...' + else + if (Index = 1) and (FAssignableImageLists.Count > 0) then + Result := 'Assign From' + else + Result := inherited GetVerb(Index); +end; + +function TcxImageListComponentEditor.GetVerbCount: Integer; +var + ACount: Integer; +begin + ACount := 1; + UpdateAssignableList; + if FAssignableImageLists.Count > 0 then + Inc(ACount); + Result := ACount + inherited GetVerbCount; +end; + +procedure TcxImageListComponentEditor.PrepareItem(Index: Integer; + const AItem: TDesignMenuItem); +var + I: Integer; + +{$IFNDEF DELPHI6} + function CreateMenuItem(const ACaption: string): TMenuItem; + begin + Result := TMenuItem.Create(AItem.Owner); + with Result do + begin + Caption := ACaption; + Checked := False; + OnClick := AssignClick; + end; + end; +{$ENDIF} + +begin + inherited; + if (FAssignableImageLists.Count > 0) and (Index = 1) then + begin + for I := 0 to FAssignableImageLists.Count - 1 do + {$IFDEF DELPHI6} + AItem.AddItem(FAssignableImageLists[I], 0, False, True, AssignClick); + {$ELSE} + AItem.Add(CreateMenuItem(FAssignableImageLists[I])); + {$ENDIF} + end; +end; + +function TcxImageListComponentEditor.GetImageList: TcxImageList; +begin + Result := Component as TcxImageList; +end; + +procedure TcxImageListComponentEditor.UpdateAssignableList; +begin + FAssignableImageLists.Clear; + Designer.GetComponentNames(GetTypeData(TCustomImageList.ClassInfo), CheckImageListForAssign); +end; + +procedure TcxImageListComponentEditor.AssignClick(Sender: TObject); +var + AImages: TCustomImageList; +begin + AImages := FAssignableImageLists.Objects[((Sender as TMenuItem).MenuIndex)] as TCustomImageList; + if AImages.Count > 0 then + begin + ImageList.Assign(AImages); + if (AImages.ClassName = 'TPngImageList') and CheckGdiPlus then + begin + ImageList.Clear; + PngImageListTocxImageList(AImages, ImageList); + end; + Designer.Modified; + end; +end; + +procedure TcxImageListComponentEditor.CheckAddImageList( + const AImageListName: string; AList: TStringList); +var + AImageList: TCustomImageList; +begin + AImageList := TCustomImageList(Designer.GetComponent(AImageListName)); + if AImageList <> ImageList then + AList.AddObject(AImageListName, AImageList); +end; + +procedure TcxImageListComponentEditor.CheckImageListForImport(const AImageListName: string); +begin + CheckAddImageList(AImageListName, FImageLists); +end; + +procedure TcxImageListComponentEditor.CheckImageListForAssign(const AImageListName: string); +begin + CheckAddImageList(AImageListName, FAssignableImageLists); +end; + +{ TcxContainerStyleProperty } + +procedure TcxContainerStyleProperty.GetProperties(Proc: TGetPropProc); +begin + FProc := Proc; + inherited GetProperties(GetPropProc); +end; + +procedure TcxContainerStyleProperty.GetPropProc({$IFNDEF DELPHI6}Prop: TPropertyEditor{$ELSE}const Prop: IProperty{$ENDIF}); +var + I: Integer; +begin + for I := 0 to PropCount - 1 do + if not TcxContainer(GetComponent(I)).IsStylePropertyPublished(Prop.GetName, GetName <> 'Style') then + Exit; + FProc(Prop); +end; + +{ TcxContainerStyleAssignedValuesProperty } + +procedure TcxContainerStyleAssignedValuesProperty.GetProperties(Proc: TGetPropProc); +var + AStyleValueList: TStringList; + I, AValue: Integer; +begin + AStyleValueList := TStringList.Create; + try + FillVisiblePropertiesList(AStyleValueList); + for I := 0 to AStyleValueList.Count - 1 do + begin + AValue := TcxContainerStyleValue(AStyleValueList.Objects[I]); + Proc(TcxContainerStyleAssignedValuesElementProperty.Create(Self, AValue)); + end; + finally + AStyleValueList.Free; + end; +end; + +function TcxContainerStyleAssignedValuesProperty.GetValue: string; +var + AStyleValues: TcxContainerStyleValues; + AStyleValueList: TStringList; + I: Integer; +begin + Integer(AStyleValues) := GetOrdValue; + Result := ''; + AStyleValueList := TStringList.Create; + try + FillVisiblePropertiesList(AStyleValueList); + for I := 0 to AStyleValueList.Count - 1 do + if TcxContainerStyleValue(AStyleValueList.Objects[I]) in AStyleValues then + Result := Result + AStyleValueList[I] + ','; + Delete(Result, Length(Result), 1); + Result := '[' + Result + ']'; + finally + AStyleValueList.Free; + end; +end; + +procedure TcxContainerStyleAssignedValuesProperty.FillVisiblePropertiesList( + AList: TStringList); + + procedure FillStyleValueList(AStyle: TcxContainerStyle; + AStyleValueList: TStringList); + var + APropertyCount, AStyleValueIndex, I: Integer; + APPropList: PPropList; + AStyleValue: TcxContainerStyleValue; + begin + APropertyCount := GetPropList(PTypeInfo(AStyle.ClassInfo), [tkUnknown..tkDynArray], nil); + if APropertyCount = 0 then Exit; + GetMem(APPropList, APropertyCount * SizeOf(Pointer)); + try + GetPropList(PTypeInfo(AStyle.ClassInfo), [tkUnknown..tkDynArray], APPropList); + for I := 0 to APropertyCount - 1 do + begin + if not AStyle.GetStyleValue(APPropList[I].Name, AStyleValue) then + Continue; + if (AStyle.Container = nil) and ((AStyle.State = csNormal) or AStyle.IsExtendedStylePropertyPublished(APPropList[I].Name)) or + (AStyle.Container <> nil) and AStyle.Container.IsStylePropertyPublished(APPropList[I].Name, AStyle.State <> csNormal) then + begin + AStyleValueIndex := AStyleValueList.IndexOf(APPropList[I].Name); + if AStyleValueIndex = -1 then + AStyleValueList.AddObject(APPropList[I].Name, TObject(1)) + else + AStyleValueList.Objects[AStyleValueIndex] := + TObject(Integer(AStyleValueList.Objects[AStyleValueIndex]) + 1); + end; + end; + finally + FreeMem(APPropList); + end; + end; + +var + AStyleValue: TcxContainerStyleValue; + I: Integer; +begin + for I := 0 to PropCount - 1 do + FillStyleValueList(TcxContainerStyle(GetComponent(I)), AList); + AList.Sort; + + for I := AList.Count - 1 downto 0 do + if Integer(AList.Objects[I]) <> PropCount then + AList.Delete(I) + else + begin + TcxContainerStyle(GetComponent(0)).GetStyleValue(AList[I], AStyleValue); + AList.Objects[I] := TObject(AStyleValue); + end; +end; + +{ TcxContainerStyleAssignedValuesElementProperty } + +function TcxContainerStyleAssignedValuesElementProperty.GetName: string; +begin + TcxContainerStyle(GetComponent(0)).GetStyleValueName(Element, Result); +end; + +{$IFNDEF DELPHI6} +constructor TcxContainerStyleAssignedValuesElementProperty.Create(Parent: TPropertyEditor; + AElement: Integer); +begin + inherited Create(Parent, AElement); + FElement := AElement; +end; +{$ENDIF} + + { TcxComponentEditorHelper } + +constructor TcxComponentEditorHelper.Create(AComponentEditor: TComponentEditor; + const AProductName, AProductMajorVersion, AProductMinorVersion: string); +begin + inherited Create; + FComponentEditor := AComponentEditor; + FProductName := AProductName; + FProductMajorVersion := AProductMajorVersion; + FProductMinorVersion := AProductMinorVersion; +end; + +function TcxComponentEditorHelper.GetVerb(Index: Integer): string; +begin + Index := Index - (FComponentEditor.GetVerbCount - GetVerbCount); + case Index of + 0: Result := '-'; + 1: Result := FProductName + ' ' + Format('%s.%s', [FProductMajorVersion, FProductMinorVersion]); + 2: Result := dxCompanyName; + 3: Result := dxCompanyURL; + end; +end; + +function TcxComponentEditorHelper.GetVerbCount: Integer; +begin + Result := 4; +end; + +{ TcxComponentEditor } + +constructor TcxComponentEditor.Create(AComponent: TComponent; ADesigner: IDesigner); +begin + inherited; + FHelper := TcxComponentEditorHelper.Create(Self, GetProductName, GetProductMajorVersion, GetProductMinorVersion); +end; + +destructor TcxComponentEditor.Destroy; +begin + FreeAndNil(FHelper); + inherited; +end; + +function TcxComponentEditor.GetVerb(Index: Integer): string; +begin + if Index < InternalGetVerbCount then + Result := InternalGetVerb(Index) + else + Result := FHelper.GetVerb(Index); +end; + +function TcxComponentEditor.GetVerbCount: Integer; +begin + Result := FHelper.GetVerbCount + InternalGetVerbCount; +end; + +procedure TcxComponentEditor.ExecuteVerb(Index: Integer); +begin + if Index < InternalGetVerbCount then + InternalExecuteVerb(Index); +end; + +function TcxComponentEditor.InternalGetVerb(AIndex: Integer): string; +begin + Result := ''; +end; + +function TcxComponentEditor.GetProductMinorVersion: string; +begin + Result := IntToStr(dxBuildNumber); +end; + +function TcxComponentEditor.InternalGetVerbCount: Integer; +begin + Result := 0; +end; + +procedure TcxComponentEditor.InternalExecuteVerb(AIndex: Integer); +begin +// do nothing +end; + +{ TcxDefaultEditor } + +constructor TcxDefaultEditor.Create(AComponent: TComponent; ADesigner: IDesigner); +begin + inherited; + FHelper := TcxComponentEditorHelper.Create(Self, GetProductName, GetProductMajorVersion, GetProductMinorVersion); +end; + +destructor TcxDefaultEditor.Destroy; +begin + FreeAndNil(FHelper); + inherited; +end; + +function TcxDefaultEditor.GetVerb(Index: Integer): string; +begin + if Index < InternalGetVerbCount then + Result := InternalGetVerb(Index) + else + Result := FHelper.GetVerb(Index); +end; + +function TcxDefaultEditor.GetVerbCount: Integer; +begin + Result := FHelper.GetVerbCount + InternalGetVerbCount; +end; + +function TcxDefaultEditor.InternalGetVerb(AIndex: Integer): string; +begin + Result := ''; +end; + +function TcxDefaultEditor.GetProductMinorVersion: string; +begin + Result := IntToStr(dxBuildNumber); +end; + +function TcxDefaultEditor.InternalGetVerbCount: Integer; +begin + Result := 0; +end; + +{ TcxControlPopupMenuProperty } + +procedure TcxControlPopupMenuProperty.GetValues(Proc: TGetStrProc); +begin + FProc := Proc; + inherited GetValues(CheckComponent); +end; + +procedure TcxControlPopupMenuProperty.CheckComponent(const Value: string); +var + AComponent: TComponent; + AIcxPopupMenu: IcxPopupMenu; +begin + AComponent := Designer.GetComponent(Value); + if AComponent <> nil then + begin + if (AComponent is TPopupMenu) or + Supports(AComponent, IcxPopupMenu, AIcxPopupMenu) then + FProc(Value); + end; +end; + +{ TcxLookAndFeelProperty } + +procedure TcxLookAndFeelProperty.GetProperties(Proc: TGetPropProc); +begin + FProc := Proc; + inherited GetProperties(GetPropProc); +end; + +procedure TcxLookAndFeelProperty.GetPropProc( + {$IFNDEF DELPHI6}Prop: TPropertyEditor{$ELSE}const Prop: IProperty{$ENDIF}); +var + I: Integer; +begin + for I := 0 to PropCount - 1 do + if SameText(Prop.GetName, 'SkinName') and + (not ClassSupportsSkinProc(GetComponent(0)) or (GetExtendedStylePainters.Count = 0)) then Exit; + FProc(Prop); +end; + +{ TcxLookAndFeelAssignedValuesProperty } + +procedure TcxLookAndFeelAssignedValuesProperty.GetProperties(Proc: TGetPropProc); +begin + FProc := Proc; + inherited GetProperties(GetPropProc); +end; + +procedure TcxLookAndFeelAssignedValuesProperty.GetPropProc( + {$IFNDEF DELPHI6}Prop: TPropertyEditor{$ELSE}const Prop: IProperty{$ENDIF}); +var + I: Integer; +begin + for I := 0 to PropCount - 1 do + if SameText(Prop.GetName, 'lfvSkinName') and + (not ClassSupportsSkinProc(TcxLookAndFeel(GetComponent(0)).Owner) or + (GetExtendedStylePainters.Count = 0)) then Exit; + FProc(Prop); +end; + +{ TcxStyleProperty } + +const + sCreateNewStyleInRepositoryBegin = ' nil then + Inc(AWidth, StylePreviewAreaWidth + StylePreviewAreaOffset); +end; + +procedure TcxStyleProperty.ListMeasureHeight(const Value: string; ACanvas: TCanvas; + var AHeight: Integer); +var + AComponent: TComponent; + AStyle: TcxStyle; + APrevFont: TFont; + + function GetItemHeight: Integer; + begin + Result := ACanvas.TextHeight('Qq') + + 2 * (StylePreviewOffset + StylePreviewBorderSize + StyleTextOffset); + end; + +begin + AComponent := Designer.GetComponent(Value); + if AComponent = nil then + Inc(AHeight) + else + if AComponent is TcxStyle then + begin + AStyle := TcxStyle(AComponent); + AHeight := GetItemHeight; + if svFont in AStyle.AssignedValues then + begin + APrevFont := TFont.Create; + APrevFont.Assign(ACanvas.Font); + ACanvas.Font := AStyle.Font; + AHeight := Max(AHeight, GetItemHeight); + ACanvas.Font := APrevFont; + APrevFont.Free; + end; + end; +end; + +procedure TcxStyleProperty.ListDrawValue(const Value: string; ACanvas: TCanvas; + const ARect: TRect; ASelected: Boolean); +const + PreviewText = 'Text Text Text Text Text'; +var + AStyle: TcxStyle; + APrevBkColor, APrevTextColor: COLORREF; + APrevFont: TFont; + + procedure SaveCanvasParams; + begin + APrevBkColor := GetBkColor(ACanvas.Handle); + APrevTextColor := GetTextColor(ACanvas.Handle); + APrevFont := TFont.Create; + APrevFont.Assign(ACanvas.Font); + end; + + procedure RestoreCanvasParams; + begin + ACanvas.Font := APrevFont; + APrevFont.Free; + SetBkColor(ACanvas.Handle, APrevBkColor); + SetTextColor(ACanvas.Handle, APrevTextColor); + end; + + function GetStyleNameRect: TRect; + begin + Result := ARect; + Inc(Result.Left, StylePreviewAreaWidth + StylePreviewAreaOffset + StyleTextOffset); + Result.Top := (Result.Top + Result.Bottom - ACanvas.TextHeight(Value)) div 2; + end; + + (*procedure DrawStyleAssignedValuesInfo; + const + StyleValuesText = 'BCFT'; + var + AInfoItemWidth, I, ATextX, ATextY: Integer; + AStyleValue: TcxStyleValue; + begin //!!! + //ACanvas.Font.Style := [fsBold]; + AInfoItemWidth := 0; + for I := 1 to Length(StyleValuesText) do + AInfoItemWidth := Max(AInfoItemWidth, ACanvas.TextWidth(StyleValuesText[I])); + + with GetStyleNameRect do + begin + ATextX := Left - 40; //!!! + ATextY := Top; + end; + + for AStyleValue := Low(TcxStyleValue) to High(TcxStyleValue) do + begin + if AStyleValue in AStyle.AssignedValues then + //ACanvas.Font.Style := [fsBold] + ACanvas.Font.Color := APrevFont.Color + else + ACanvas.Font.Color := clBtnFace; + //ACanvas.Font.Style := []; + ACanvas.TextOut(ATextX, ATextY, StyleValuesText[1 + Ord(AStyleValue)]); + Inc(ATextX, AInfoItemWidth); + end; + + //ACanvas.Font.Style := []; + end;*) + + function GetPreviewBounds: TRect; + begin + Result := ARect; + Result.Right := Result.Left + StylePreviewAreaWidth; + InflateRect(Result, -StylePreviewOffset, -StylePreviewOffset); + end; + + function GetPreviewClientBounds: TRect; + begin + Result := GetPreviewBounds; + InflateRect(Result, -StylePreviewBorderSize, -StylePreviewBorderSize); + end; + + procedure DrawPreviewBorder; + + function GetBorderColor: TColor; + begin + if AStyle.AssignedValues * [svBitmap, svColor] = [] then + if ColorToRGB(ACanvas.Brush.Color) = ColorToRGB(clBtnFace) then + Result := clBtnShadow + else + Result := clBtnFace + else + Result := clWindowText; + end; + + begin + ACanvas.Brush.Color := GetBorderColor; + ACanvas.FrameRect(GetPreviewBounds); + end; + + procedure DrawPreviewBackground; + var + R, ABitmapR: TRect; + AcxCanvas: TcxCanvas; + begin + R := GetPreviewClientBounds; + if svBitmap in AStyle.AssignedValues then + begin + ABitmapR := R; + if svColor in AStyle.AssignedValues then + ABitmapR.Right := (R.Left + R.Right) div 2; + AcxCanvas := TcxCanvas.Create(ACanvas); + AcxCanvas.FillRect(ABitmapR, AStyle.Bitmap); + AcxCanvas.Free; + R.Left := ABitmapR.Right; + end; + if svColor in AStyle.AssignedValues then + begin + ACanvas.Brush.Color := AStyle.Color; + ACanvas.FillRect(R); + end; + end; + + procedure DrawPreviewText; + var + ATextR: TRect; + + function GetTextColor: TColor; + begin + if svTextColor in AStyle.AssignedValues then + Result := AStyle.TextColor + else + {if svColor in AStyle.AssignedValues then + Result := ColorToRGB(AStyle.Color) xor clWhite //!!! + else} + Result := APrevFont.Color; + end; + + function GetTextTopBound: Integer; + begin + Result := (ATextR.Top + ATextR.Bottom - ACanvas.TextHeight(PreviewText)) div 2; + end; + + begin + if AStyle.AssignedValues * [svFont, svTextColor] = [] then Exit; + if svFont in AStyle.AssignedValues then + ACanvas.Font := AStyle.Font; + ACanvas.Font.Color := GetTextColor; + ATextR := GetPreviewClientBounds; + ACanvas.Brush.Style := bsClear; + ACanvas.TextRect(ATextR, ATextR.Left + StyleTextOffset, GetTextTopBound, PreviewText); + ACanvas.Brush.Style := bsSolid; + end; + +begin + AStyle := Designer.GetComponent(Value) as TcxStyle; + if AStyle = nil then + {$IFDEF DELPHI6} + DefaultPropertyListDrawValue(Value, ACanvas, ARect, ASelected) + {$ELSE} + inherited + {$ENDIF} + else + begin + SaveCanvasParams; // for correct focus rect drawing and height measurement + with GetStyleNameRect do + ACanvas.TextRect(ARect, Left, Top, Value); + //DrawStyleAssignedValuesInfo; + DrawPreviewBorder; + DrawPreviewBackground; + DrawPreviewText; + RestoreCanvasParams; + end; +end; + +function TcxStyleProperty.GetStyleRepositories: TList; +begin + Result := TList.Create; + FStyleRepositories := Result; + Designer.GetComponentNames(GetTypeData(TcxStyleRepository.ClassInfo), GetStyleRepositoryNameProc); +end; + +function TcxStyleProperty.AutoFill: Boolean; +begin + Result := False; +end; + +procedure TcxStyleProperty.GetValues(Proc: TGetStrProc); +var + AStyleRepositories: TList; + I: Integer; + S: string; +begin + AStyleRepositories := GetStyleRepositories; + try + for I := 0 to AStyleRepositories.Count - 1 do + begin + S := Designer.GetComponentName(TComponent(AStyleRepositories[I])); + Proc(sCreateNewStyleInRepositoryBegin + S + sCreateNewStyleInRepositoryEnd); + end; + finally + AStyleRepositories.Free; + end; + Proc(sCreateNewStyleInNewRepository); + inherited; +end; + +procedure TcxStyleProperty.SetValue(const Value: string); +var + AName: string; + AStyleRepository: TcxStyleRepository; + + procedure CreateAndAssignNewStyle(AStyleRepository: TcxStyleRepository); + var + AStyle: TcxStyle; + + function GetStyleDesigner: IDesigner; + begin + Result := FindRootDesigner(AStyle) as IDesigner; + //FindRootDesigner(AStyle).QueryInterface(IDesigner, Result); + end; + + begin + AStyle := AStyleRepository.CreateItemEx(TcxStyle, AStyleRepository.Owner) as TcxStyle; + AStyle.Name := CreateUniqueName(AStyle.Owner, nil, AStyle, '', ''); + if GetStyleDesigner <> Designer then + FindRootDesigner(AStyle).Modified; + SetOrdValue(Integer(AStyle)); + end; + +begin + if Value = sCreateNewStyleInNewRepository then + begin + AStyleRepository := TcxStyleRepository.Create(Designer.{$IFDEF DELPHI6}Root{$ELSE}GetRoot{$ENDIF}); + AStyleRepository.Name := Designer.UniqueName( + Copy(TcxStyleRepository.ClassName, 2, Length(TcxStyleRepository.ClassName) - 1)); + CreateAndAssignNewStyle(AStyleRepository); + end + else + if Copy(Value, 1, Length(sCreateNewStyleInRepositoryBegin)) = sCreateNewStyleInRepositoryBegin then + begin + AName := Copy(Value, Length(sCreateNewStyleInRepositoryBegin) + 1, + Length(Value) - (Length(sCreateNewStyleInRepositoryBegin) + Length(sCreateNewStyleInRepositoryEnd))); + CreateAndAssignNewStyle(Designer.GetComponent(AName) as TcxStyleRepository); + end + else + inherited; +end; + +{ TcxBitmapGraphicProperty } + +procedure TcxBitmapGraphicProperty.Edit; +var + PictureEditor: TPictureEditor; + PictureEditorDlg: TWinControl; +begin + PictureEditor := TPictureEditor.Create(nil); + try + PictureEditor.GraphicClass := TGraphicClass(GetTypeData(GetPropType)^.ClassType); + PictureEditor.Picture.Graphic := TGraphic(Pointer(GetOrdValue)); + with PictureEditor do + begin + if BuildFilter <> '' then + begin + PictureEditorDlg := FindControl(FindWindow('TPictureEditorDlg', nil)); + if PictureEditorDlg is TPictureEditorDlg then + TPictureEditorDlg(PictureEditorDlg).OnShow := OnShowPicEdit; + end; + if Execute then + if (Picture.Graphic = nil) or (Picture.Graphic is GraphicClass) then + SetOrdValue(LongInt(Picture.Graphic)) + else + if Picture.Graphic is TdxPNGImage then + SetOrdValue(LongInt(TdxPNGImage(Picture.Graphic).GetAsBitmap)) + else + raise Exception.CreateRes(@SInvalidFormat) + end; + finally + PictureEditor.Free; + end; +end; + +function TcxBitmapGraphicProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paDialog]; +end; + +function TcxBitmapGraphicProperty.GetValue: string; +var + Graphic: TGraphic; +begin + Graphic := TGraphic(GetOrdValue); + if (Graphic = nil) or Graphic.Empty then + Result := 'None' + else + Result := '(' + Graphic.ClassName + ')'; +end; + +procedure TcxBitmapGraphicProperty.SetValue(const Value: string); +begin + if Value = '' then SetOrdValue(0); +end; + +procedure TcxBitmapGraphicProperty.OnShowPicEdit(Sender: TObject); +begin + if Sender is TPictureEditorDlg then + TPictureEditorDlg(Sender).OpenDialog.Filter := BuildFilter; +end; + +function TcxBitmapGraphicProperty.BuildFilter: string; +begin + Result := ''; +end; + +{ TcxBitmapProperty } + +function TcxBitmapProperty.BuildFilter: string; +begin + if CheckGdiPlus then + Result := sdxBitmapAndPNGFilter + else + Result := ''; +end; + +procedure HideClassProperties(AClass: TClass; APropertyNames: array of string); +var + I: Integer; +begin + for I := Low(APropertyNames) to High(APropertyNames) do + RegisterPropertyEditor(GetPropInfo(AClass, APropertyNames[I]).PropType^, + AClass, APropertyNames[I], nil); +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterComponentEditor(TcxLookAndFeelController, TcxLookAndFeelControllerEditor); + RegisterPropertyEditor(TypeInfo(TcxCustomStyleSheet), TcxStyles, 'StyleSheet', TcxStyleSheetComponentProperty); + RegisterComponentEditor(TcxStyleRepository, TcxStyleRepositoryComponentEditor); + RegisterComponentEditor(TcxImageList, TcxImageListComponentEditor); + RegisterComponentEditor(TcxPropertiesStore, TcxPropertiesStoreComponentEditor); + RegisterComponents(dxLibraryProductPage, [TcxPropertiesStore, TcxImageList]); + RegisterPropertyEditor(TypeInfo(TBitmap), nil, '', TcxBitmapGraphicProperty); + RegisterComponents(dxLibraryProductPage, [TcxLookAndFeelController, TcxStyleRepository]); + + RegisterPropertyEditor(TypeInfo(TcxStyleController), TcxStyleController, 'FakeStyleController', nil); + RegisterPropertyEditor(TypeInfo(TcxStyleController), TcxContainer, 'FakeStyleController', nil); + RegisterPropertyEditor(TypeInfo(TcxContainerStyle), TcxContainer, '', TcxContainerStyleProperty); + RegisterPropertyEditor(TypeInfo(TcxContainerStyle), TcxStyleController, '', + TcxStyleControllerStyleProperty); + + RegisterPropertyEditor(TypeInfo(TComponent), TcxControl, 'PopupMenu', TcxControlPopupMenuProperty); + RegisterPropertyEditor(TypeInfo(TcxStyle), nil, '', TcxStyleProperty); + + RegisterClasses([TcxStyle]); + RegisterNoIcon([TcxStyle]); + + RegisterPropertyEditor(TypeInfo(TcxContainerStyleValues), TcxContainerStyle, + 'AssignedValues', TcxContainerStyleAssignedValuesProperty); + + RegisterPropertyEditor(TypeInfo(TcxLookAndFeel), nil, '', TcxLookAndFeelProperty); + RegisterPropertyEditor(TypeInfo(TdxSkinName), nil, 'SkinName', nil); + RegisterPropertyEditor(TypeInfo(TcxLookAndFeelValues), TcxLookAndFeel, + 'AssignedValues', TcxLookAndFeelAssignedValuesProperty); +end; + +{$IFDEF DELPHI6} +initialization + StartClassGroup(TControl); + GroupDescendentsWith(TcxCustomPropertiesStore, TControl); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxLibraryStrs.pas b/official/x.35/ExpressLibrary/Sources/cxLibraryStrs.pas new file mode 100644 index 00000000..10bb36e9 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxLibraryStrs.pas @@ -0,0 +1,74 @@ +{*******************************************************************} +{ } +{ Developer Express Cross Platform Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL AND CLX CONTROLS AS PART OF AN EXECUTABLE } +{ PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit cxLibraryStrs; + +interface + +resourcestring + scxCantCreateRegistryKey = 'Can''t create the registry key: \%s'; + scxCantOpenRegistryKey = 'Can''t open the registry key: \%s'; + scxErrorStoreObject = 'Error store %s object'; + + {$IFNDEF DELPHI5} + scxInvalidPropertyElement = 'Invalid property element: %s'; + {$ENDIF} + scxConverterCantCreateStyleRepository = 'Can''t create the Style Repository'; + + // date smart input consts + cxSDateToday = 'today'; + cxSDateYesterday = 'yesterday'; + cxSDateTomorrow = 'tomorrow'; + cxSDateSunday = 'Sunday'; + cxSDateMonday = 'Monday'; + cxSDateTuesday = 'Tuesday'; + cxSDateWednesday = 'Wednesday'; + cxSDateThursday = 'Thursday'; + cxSDateFriday = 'Friday'; + cxSDateSaturday = 'Saturday'; + cxSDateFirst = 'first'; + cxSDateSecond = 'second'; + cxSDateThird = 'third'; + cxSDateFourth = 'fourth'; + cxSDateFifth = 'fifth'; + cxSDateSixth = 'sixth'; + cxSDateSeventh = 'seventh'; + cxSDateBOM = 'bom'; + cxSDateEOM = 'eom'; + cxSDateNow = 'now'; + +implementation + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxLocalization.pas b/official/x.35/ExpressLibrary/Sources/cxLocalization.pas new file mode 100644 index 00000000..e7c4aff4 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxLocalization.pas @@ -0,0 +1,209 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxLocalization; + +interface + +uses + Classes; + +type + TcxLanguage = class(TCollectionItem) + private + FName: string; + FDictionary: TStrings; + FResStringNames: TStrings; + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + + procedure AddResString(const AResStringName, ATranslation: string); + function GetTranslation(const AResStringName: string): string; + published + property Name: string read FName write FName; + end; + + TcxLanguages = class(TCollection) + private + FActiveLanguage: Integer; + FOwner: TPersistent; + protected + function GetOwner: TPersistent; override; + property ActiveLanguage: Integer read FActiveLanguage write FActiveLanguage; + public + constructor Create(AOwner: TPersistent); + function Add: TcxLanguage; + procedure Translate; + end; + + TcxLocalizer = class(TComponent) + private + FLanguages: TcxLanguages; + function GetLanguage: Integer; + procedure SetLanguage(AValue: Integer); + procedure SetLanguages(AValue: TcxLanguages); + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + procedure Translate; + published + property Languages: TcxLanguages read FLanguages write SetLanguages; + property Language: Integer read GetLanguage write SetLanguage; + end; + +var + FcxResourceStrings: TStrings; + +implementation + +uses + SysUtils, cxClasses; + +{ TcxLanguage } + +constructor TcxLanguage.Create(Collection: TCollection); +begin + inherited; + FDictionary := TStringList.Create; + FResStringNames := TStringList.Create; +end; + +destructor TcxLanguage.Destroy; +begin + FreeAndNil(FResStringNames); + FreeAndNil(FDictionary); + inherited; +end; + +procedure TcxLanguage.AddResString(const AResStringName, ATranslation: string); +begin + FResStringNames.AddObject(AResStringName, TObject(ATranslation)); +// FDictionary.Add(ATranslation); +end; + +function TcxLanguage.GetTranslation(const AResStringName: string): string; +var + AIndex: Integer; +begin + AIndex := FResStringNames.IndexOf(AResStringName); + if AIndex > -1 then +// Result := FDictionary[AIndex] + Result := string(FResStringNames.Objects[AIndex]) + else + Result := ''; +end; + +{ TcxLanguages } + +constructor TcxLanguages.Create(AOwner: TPersistent); +begin + inherited Create(TcxLanguage); + FActiveLanguage := -1; + FOwner := AOwner; +end; + +function TcxLanguages.Add: TcxLanguage; +begin + Result := TcxLanguage(inherited Add); +end; + +procedure TcxLanguages.Translate; + + procedure InternalSetResourceString(AResString: Pointer; const AValue: string); + begin + if AValue <> '' then + cxSetResourceString(AResString, AValue); + end; + +var + I: Integer; +begin + if (ActiveLanguage > -1) and (ActiveLanguage < Count) then + begin + for I := 0 to FcxResourceStrings.Count - 1 do + InternalSetResourceString(FcxResourceStrings.Objects[I], + TcxLanguage(Items[ActiveLanguage]).GetTranslation(FcxResourceStrings[I])); + end; +end; + +function TcxLanguages.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +{ TcxLocalizer } + +constructor TcxLocalizer.Create(AOwner: TComponent); +begin + inherited; + FLanguages := TcxLanguages.Create(Self); +end; + +destructor TcxLocalizer.Destroy; +begin + FreeAndNil(FLanguages); + inherited; +end; + +procedure TcxLocalizer.Translate; +begin + FLanguages.Translate; +end; + +function TcxLocalizer.GetLanguage: Integer; +begin + Result := FLanguages.ActiveLanguage; +end; + +procedure TcxLocalizer.SetLanguage(AValue: Integer); +begin + FLanguages.ActiveLanguage := AValue; +end; + +procedure TcxLocalizer.SetLanguages(AValue: TcxLanguages); +begin + if FLanguages <> AValue then + FLanguages.Assign(Avalue) +end; + +initialization + FcxResourceStrings := TStringList.Create; + +finalization + FreeAndNil(FcxResourceStrings); + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxLookAndFeelPainters.pas b/official/x.35/ExpressLibrary/Sources/cxLookAndFeelPainters.pas new file mode 100644 index 00000000..47da6867 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxLookAndFeelPainters.pas @@ -0,0 +1,6608 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressCommonLibrary } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCOMMONLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxLookAndFeelPainters; + +{$I cxVer.inc} + +interface + +uses + Windows, dxUxTheme, dxThemeManager, dxOffice11, +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Classes, Graphics, Controls, ImgList, cxClasses, cxGraphics, cxGeometry; + +const + cxTextOffset = 2; + cxHeaderTextOffset = cxTextOffset; + + cxArrowLeftBasePointIndex = 0; + cxArrowTopPointIndex = 1; + cxArrowRightBasePointIndex = 2; + + cxStdThumbnailMinimalSize = 8; + +type + TcxLookAndFeelStyle = (lfsFlat, lfsStandard, lfsUltraFlat, + lfsNative, lfsOffice11); + + TcxArrowDirection = (adUp, adDown, adLeft, adRight); + TcxArrowPoints = array[0..2] of TPoint; + TcxEditBtnKind = (cxbkCloseBtn, cxbkComboBtn, cxbkEditorBtn, cxbkEllipsisBtn, + cxbkSpinUpBtn, cxbkSpinDownBtn, cxbkSpinLeftBtn, cxbkSpinRightBtn); + TcxButtonState = (cxbsDefault, cxbsNormal, cxbsHot, cxbsPressed, cxbsDisabled); + TcxCheckBoxState = (cbsUnchecked, cbsChecked, cbsGrayed); + TcxGroupBoxCaptionPosition = (cxgpTop, cxgpBottom, cxgpLeft, cxgpRight, cxgpCenter); + TcxHeaderArrows = (haNone, haLeft, haRight, haBoth); + TcxIndicatorKind = (ikNone, ikArrow, ikEdit, ikInsert, ikMultiDot, ikMultiArrow, ikFilter); + TcxNeighbor = (nLeft, nTop, nRight, nBottom); + TcxNeighbors = set of TcxNeighbor; + TcxScrollBarPart = (sbpNone, sbpLineUp, sbpLineDown, sbpThumbnail, + sbpPageUp, sbpPageDown); + TcxPopupBorderStyle = (pbsNone, pbsUltraFlat, pbsFlat, pbs3D); + TcxTrackBarTicksAlign = (tbtaUp, tbtaDown, tbtaBoth); + + TcxDrawBackgroundEvent = function(ACanvas: TcxCanvas; const ABounds: TRect): Boolean of object; + TcxCustomLookAndFeelPainterClass = class of TcxCustomLookAndFeelPainter; + + IcxLookAndFeelPainterListener = interface + ['{7665EF58-2C4B-48B9-E1BE-BD5E135CA88F}'] + procedure PainterChanged(APainter: TcxCustomLookAndFeelPainterClass); + end; + + TcxCustomLookAndFeelPainter = class + protected + class procedure DrawBackground(ACanvas: TcxCanvas; const ARect: TRect; + ATransparent: Boolean; ABackgroundColor: TColor; const ABackgroundBitmap: TBitmap); virtual; + class procedure DrawButtonArrow(ACanvas: TcxCanvas; const R: TRect; AColor: TColor); virtual; + class procedure DrawContent(ACanvas: TcxCanvas; const ABounds, ATextAreaBounds: TRect; AState: Integer; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil; AIsFooter: Boolean = False); virtual; + class procedure DrawExpandButtonCross(ACanvas: TcxCanvas; const R: TRect; + AExpanded: Boolean; AColor: TColor); + class procedure DrawGroupExpandButtonMark(ACanvas: TcxCanvas; const R: TRect; + AExpanded: Boolean; AState: TcxButtonState); + class procedure DrawMonthHeaderArrows(ACanvas: TcxCanvas; const ABounds: TRect; + AArrows: TcxHeaderArrows; ASideWidth: Integer; AColor: TColor); + class procedure DrawSortingArrow(ACanvas: TcxCanvas; const R: TRect; + AColor1, AColor2: TColor; AAscendingSorting: Boolean); + class procedure DrawSchedulerNavigationButtonContent(ACanvas: TcxCanvas; + const ARect: TRect; const AArrowRect: TRect; AIsNextButton: Boolean; + AState: TcxButtonState); virtual; + class function FooterCellContentBounds(const ABounds: TRect): TRect; virtual; + class function FooterCellTextAreaBounds(const ABounds: TRect): TRect; virtual; + class function GetArrowDirection(AHorizontal: Boolean; APart: TcxScrollBarPart): TcxArrowDirection; + public + class function LookAndFeelStyle: TcxLookAndFeelStyle; virtual; + // colors + class function DefaultContentColor: TColor; virtual; + class function DefaultContentEvenColor: TColor; virtual; + class function DefaultContentOddColor: TColor; virtual; + class function DefaultContentTextColor: TColor; virtual; + class function DefaultEditorBackgroundColor(AIsDisabled: Boolean): TColor; virtual; + class function DefaultEditorTextColor(AIsDisabled: Boolean): TColor; virtual; + class function DefaultFilterBoxColor: TColor; virtual; + class function DefaultFilterBoxTextColor: TColor; virtual; + class function DefaultFixedSeparatorColor: TColor; virtual; + class function DefaultFooterColor: TColor; virtual; + class function DefaultFooterTextColor: TColor; virtual; + class function DefaultGridLineColor: TColor; virtual; + class function DefaultGroupByBoxColor: TColor; virtual; + class function DefaultGroupByBoxTextColor: TColor; virtual; + class function DefaultGroupColor: TColor; virtual; + class function DefaultGroupTextColor: TColor; virtual; + class function DefaultHeaderBackgroundColor: TColor; virtual; + class function DefaultHeaderBackgroundTextColor: TColor; virtual; + class function DefaultHeaderColor: TColor; virtual; + class function DefaultHeaderTextColor: TColor; virtual; + class function DefaultHyperlinkTextColor: TColor; virtual; + class function DefaultInactiveColor: TColor; virtual; + class function DefaultInactiveTextColor: TColor; virtual; + class function DefaultPreviewTextColor: TColor; virtual; + class function DefaultRecordSeparatorColor: TColor; virtual; + class function DefaultSizeGripAreaColor: TColor; virtual; + + class function DefaultVGridCategoryColor: TColor; virtual; + class function DefaultVGridCategoryTextColor: TColor; virtual; + class function DefaultVGridLineColor: TColor; virtual; + class function DefaultVGridBandLineColor: TColor; virtual; + + class function DefaultDateNavigatorHeaderColor: TColor; virtual; + class function DefaultDateNavigatorSelectionColor: TColor; virtual; + class function DefaultDateNavigatorSelectionTextColor: TColor; virtual; + + class function DefaultSchedulerBackgroundColor: TColor; virtual; + class function DefaultSchedulerTextColor: TColor; virtual; + class function DefaultSchedulerBorderColor: TColor; virtual; + class function DefaultSchedulerControlColor: TColor; virtual; + class function DefaultSchedulerNavigatorColor: TColor; virtual; + class function DefaultSchedulerViewContentColor: TColor; virtual; + class function DefaultSchedulerViewSelectedTextColor: TColor; virtual; + class function DefaultSchedulerViewTextColor: TColor; virtual; + class function DefaultSelectionColor: TColor; virtual; + class function DefaultSelectionTextColor: TColor; virtual; + class function DefaultSeparatorColor: TColor; virtual; + class function DefaultTabColor: TColor; virtual; + class function DefaultTabTextColor: TColor; virtual; + class function DefaultTabsBackgroundColor: TColor; virtual; + + class function DefaultTimeGridMajorScaleColor: TColor; virtual; + class function DefaultTimeGridMajorScaleTextColor: TColor; virtual; + class function DefaultTimeGridMinorScaleColor: TColor; virtual; + class function DefaultTimeGridMinorScaleTextColor: TColor; virtual; + class function DefaultTimeGridSelectionBarColor: TColor; virtual; + + class function DefaultChartDiagramValueBorderColor: TColor; virtual; + class function DefaultChartDiagramValueCaptionTextColor: TColor; virtual; + class function DefaultChartHistogramAxisColor: TColor; virtual; + class function DefaultChartHistogramGridLineColor: TColor; virtual; + class function DefaultChartHistogramPlotColor: TColor; virtual; + class function DefaultChartPieDiagramSeriesSiteBorderColor: TColor; virtual; + class function DefaultChartPieDiagramSeriesSiteCaptionColor: TColor; virtual; + class function DefaultChartPieDiagramSeriesSiteCaptionTextColor: TColor; virtual; + class function DefaultChartToolBoxDataLevelInfoBorderColor: TColor; virtual; + class function DefaultChartToolBoxItemSeparatorColor: TColor; virtual; + + // arrow + class procedure CalculateArrowPoints(R: TRect; var P: TcxArrowPoints; AArrowDirection: TcxArrowDirection; AProportional: Boolean; AArrowSize: Integer = 0); + class procedure DrawArrow(ACanvas: TcxCanvas; const R: TRect; AArrowDirection: TcxArrowDirection; AColor: TColor); overload; virtual; + class procedure DrawArrow(ACanvas: TcxCanvas; const R: TRect; AState: TcxButtonState; AArrowDirection: TcxArrowDirection; ADrawBorder: Boolean = True); overload; virtual; + class procedure DrawArrowBorder(ACanvas: TcxCanvas; const R: TRect; AState: TcxButtonState); virtual; + class procedure DrawScrollBarArrow(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState; AArrowDirection: TcxArrowDirection); virtual; + // border + class function BorderSize: Integer; virtual; + class procedure DrawBorder(ACanvas: TcxCanvas; R: TRect); virtual; + // buttons + class function AdjustGroupButtonDisplayRect(const R: TRect; AButtonCount, AButtonIndex: Integer): TRect; virtual; + class function ButtonBorderSize(AState: TcxButtonState = cxbsNormal): Integer; virtual; // abstract; + class function ButtonColor(AState: TcxButtonState): TColor; virtual; + class function ButtonFocusRect(ACanvas: TcxCanvas; R: TRect): TRect; virtual; + class function ButtonGroupBorderSizes(AButtonCount, AButtonIndex: Integer): TRect; virtual; + class function ButtonTextOffset: Integer; virtual; // abstract; + class function ButtonTextShift: Integer; virtual; // abstract; + class function ButtonSymbolColor(AState: TcxButtonState; + ADefaultColor: TColor = clDefault): TColor; virtual; + class function ButtonSymbolState(AState: TcxButtonState): TcxButtonState; virtual; + class procedure DrawButton(ACanvas: TcxCanvas; R: TRect; const ACaption: string; + AState: TcxButtonState; ADrawBorder: Boolean = True; AColor: TColor = clDefault; + ATextColor: TColor = clDefault; AWordWrap: Boolean = False); virtual; + class procedure DrawButtonCross(ACanvas: TcxCanvas; const R: TRect; AColor: TColor; + AState: TcxButtonState); + class procedure DrawButtonInGroup(ACanvas: TcxCanvas; R: TRect; + AState: TcxButtonState; AButtonCount, AButtonIndex: Integer; + ABackgroundColor: TColor); virtual; + class procedure DrawButtonBorder(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); virtual; // abstract; + class procedure DrawButtonGroupBorder(ACanvas: TcxCanvas; R: TRect; AInplace, ASelected: Boolean); virtual; + class procedure DrawExpandButton(ACanvas: TcxCanvas; const R: TRect; AExpanded: Boolean; AColor: TColor = clDefault); virtual; // abstract; + class function DrawExpandButtonFirst: Boolean; virtual; + class procedure DrawGroupExpandButton(ACanvas: TcxCanvas; const R: TRect; AExpanded: Boolean; AState: TcxButtonState); virtual; // abstract + class procedure DrawSmallExpandButton(ACanvas: TcxCanvas; R: TRect; AExpanded: Boolean; + ABorderColor: TColor; AColor: TColor = clDefault); virtual; + class function ExpandButtonSize: Integer; virtual; // abstract; + class function GroupExpandButtonSize: Integer; virtual; // abstract; + class function IsButtonHotTrack: Boolean; virtual; // abstract; + class function IsPointOverGroupExpandButton(const R: TRect; const P: TPoint): Boolean; virtual; + class function SmallExpandButtonSize: Integer; virtual; + // checkbox + class function CheckBorderSize: Integer; virtual; + class function CheckButtonColor(AState: TcxButtonState): TColor; virtual; + class function CheckButtonSize: TSize; virtual; + class procedure DrawCheck(ACanvas: TcxCanvas; const R: TRect; AState: TcxButtonState; + AChecked: Boolean; AColor: TColor); virtual; + class procedure DrawCheckBorder(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); virtual; // abstract; + class procedure DrawCheckButton(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState; + AChecked: Boolean); overload; virtual; + class procedure DrawCheckButton(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState; + ACheckState: TcxCheckBoxState); overload; virtual; + // RadioButton + class procedure DrawRadioButton(ACanvas: TcxCanvas; X, Y: Integer; + AButtonState: TcxButtonState; AChecked, AFocused: Boolean; + ABrushColor: TColor; AIsDesigning: Boolean = False); virtual; + class function RadioButtonSize: TSize; virtual; + // header + class procedure DrawHeader(ACanvas: TcxCanvas; const ABounds, ATextAreaBounds: TRect; + ANeighbors: TcxNeighbors; ABorders: TcxBorders; AState: TcxButtonState; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil; AIsLast: Boolean = False; + AIsGroup: Boolean = False); virtual; + class procedure DrawHeaderEx(ACanvas: TcxCanvas; const ABounds, ATextAreaBounds: TRect; + ANeighbors: TcxNeighbors; ABorders: TcxBorders; AState: TcxButtonState; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil); virtual; + class procedure DrawHeaderBorder(ACanvas: TcxCanvas; const R: TRect; + ANeighbors: TcxNeighbors; ABorders: TcxBorders); virtual; + class procedure DrawHeaderPressed(ACanvas: TcxCanvas; const ABounds: TRect); virtual; + class procedure DrawHeaderControlSection(ACanvas: TcxCanvas; const ABounds, ATextAreaBounds: TRect; + ANeighbors: TcxNeighbors; ABorders: TcxBorders; AState: TcxButtonState; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; AMultiLine, + AShowEndEllipsis: Boolean; const AText: string; AFont: TFont; ATextColor, + ABkColor: TColor); virtual; + class procedure DrawHeaderControlSectionBorder(ACanvas: TcxCanvas; const R: TRect; + ABorders: TcxBorders; AState: TcxButtonState); virtual; + class procedure DrawHeaderControlSectionContent(ACanvas: TcxCanvas; const ABounds, + ATextAreaBounds: TRect; AState: TcxButtonState; AAlignmentHorz: TAlignment; + AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor); virtual; + class procedure DrawHeaderControlSectionText(ACanvas: TcxCanvas; + const ATextAreaBounds: TRect; AState: TcxButtonState; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; AMultiLine, + AShowEndEllipsis: Boolean; const AText: string; AFont: TFont; ATextColor: TColor); virtual; + class procedure DrawHeaderSeparator(ACanvas: TcxCanvas; const ABounds: TRect; + AIndentSize: Integer; AColor: TColor; AViewParams: TcxViewParams); virtual; + class procedure DrawSortingMark(ACanvas: TcxCanvas; const R: TRect; AAscendingSorting: Boolean); virtual; // abstract; + class function HeaderBorders(ANeighbors: TcxNeighbors): TcxBorders; virtual; + class function HeaderBorderSize: Integer; virtual; + class function HeaderBounds(const ABounds: TRect; ANeighbors: TcxNeighbors; + ABorders: TcxBorders = cxBordersAll): TRect; virtual; + class function HeaderContentBounds(const ABounds: TRect; ABorders: TcxBorders): TRect; virtual; + class function HeaderDrawCellsFirst: Boolean; virtual; + class function HeaderHeight(AFontHeight: Integer): Integer; virtual; + class function HeaderControlSectionBorderSize( + AState: TcxButtonState = cxbsNormal): Integer; virtual; + class function HeaderControlSectionTextAreaBounds(ABounds: TRect; + AState: TcxButtonState): TRect; virtual; + class function HeaderControlSectionContentBounds(const ABounds: TRect; + AState: TcxButtonState): TRect; virtual; + class function HeaderWidth(ACanvas: TcxCanvas; ABorders: TcxBorders; + const AText: string; AFont: TFont): Integer; virtual; + class function IsHeaderHotTrack: Boolean; virtual; + class function SortingMarkAreaSize: TPoint; virtual; + class function SortingMarkSize: TPoint; virtual; // abstract; + // grid + class procedure DrawGroupByBox(ACanvas: TcxCanvas; const ARect: TRect; + ATransparent: Boolean; ABackgroundColor: TColor; const ABackgroundBitmap: TBitmap); virtual; + // footer + class function FooterBorders: TcxBorders; virtual; + class function FooterBorderSize: Integer; virtual; // abstract; + class function FooterCellBorderSize: Integer; virtual; // abstract; + class function FooterCellOffset: Integer; virtual; // abstract; + class function FooterDrawCellsFirst: Boolean; virtual; + class function FooterSeparatorColor: TColor; virtual; + class function FooterSeparatorSize: Integer; virtual; + class procedure DrawFooterCell(ACanvas: TcxCanvas; const ABounds: TRect; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; AMultiLine: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil); virtual; + class procedure DrawFooterBorder(ACanvas: TcxCanvas; const R: TRect); virtual; // abstract; + class procedure DrawFooterCellBorder(ACanvas: TcxCanvas; const R: TRect); virtual; // abstract; + class procedure DrawFooterContent(ACanvas: TcxCanvas; const ARect: TRect; + const AViewParams: TcxViewParams); virtual; + class procedure DrawFooterSeparator(ACanvas: TcxCanvas; const R: TRect); virtual; + // filter + class procedure DrawFilterActivateButton(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState; AChecked: Boolean); virtual; + class procedure DrawFilterCloseButton(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); virtual; + class procedure DrawFilterDropDownButton(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState; AIsFilterActive: Boolean); virtual; // abstract; + class procedure DrawFilterPanel(ACanvas: TcxCanvas; const ARect: TRect; + ATransparent: Boolean; ABackgroundColor: TColor; const ABackgroundBitmap: TBitmap); virtual; + class function FilterActivateButtonSize: TPoint; virtual; + class function FilterCloseButtonSize: TPoint; virtual; + class function FilterDropDownButtonSize: TPoint; virtual; + // popup + class procedure DrawWindowContent(ACanvas: TcxCanvas; const ARect: TRect); virtual; + class function PopupBorderStyle: TcxPopupBorderStyle; virtual; + // tabs + class procedure DrawTab(ACanvas: TcxCanvas; R: TRect; ABorders: TcxBorders; + const AText: string; AState: TcxButtonState; AVertical: Boolean; AFont: TFont; + ATextColor, ABkColor: TColor; AShowPrefix: Boolean = False); virtual; + class procedure DrawTabBorder(ACanvas: TcxCanvas; R: TRect; ABorder: TcxBorder; ABorders: TcxBorders; AVertical: Boolean); virtual; // abstract; + class procedure DrawTabsRoot(ACanvas: TcxCanvas; const R: TRect; ABorders: TcxBorders; AVertical: Boolean); virtual; // abstract; + class function IsDrawTabImplemented(AVertical: Boolean): Boolean; virtual; + class function IsTabHotTrack(AVertical: Boolean): Boolean; virtual; + class function TabBorderSize(AVertical: Boolean): Integer; virtual; + // indicator + class procedure DrawIndicatorCustomizationMark(ACanvas: TcxCanvas; + const R: TRect; AColor: TColor); virtual; + class procedure DrawIndicatorImage(ACanvas: TcxCanvas; const R: TRect; AKind: TcxIndicatorKind); virtual; + class procedure DrawIndicatorItem(ACanvas: TcxCanvas; const R: TRect; + AKind: TcxIndicatorKind; AColor: TColor; AOnDrawBackground: TcxDrawBackgroundEvent = nil); virtual; + class procedure DrawIndicatorItemEx(ACanvas: TcxCanvas; const R: TRect; + AKind: TcxIndicatorKind; AColor: TColor; AOnDrawBackground: TcxDrawBackgroundEvent = nil); virtual; + class function IndicatorDrawItemsFirst: Boolean; virtual; + // scrollbars + class function ScrollBarMinimalThumbSize(AVertical: Boolean): Integer; virtual; + class procedure DrawScrollBarPart(ACanvas: TcxCanvas; AHorizontal: Boolean; + R: TRect; APart: TcxScrollBarPart; AState: TcxButtonState); virtual; + // size grip + class function SizeGripSize: TSize; virtual; + class procedure DrawSizeGrip(ACanvas: TcxCanvas; const ARect: TRect; ABackgroundColor: TColor = clDefault); virtual; + // ms outlook + class procedure CalculateSchedulerNavigationButtonRects(AIsNextButton: Boolean; + ACollapsed: Boolean; APrevButtonTextSize: TSize; ANextButtonTextSize: TSize; + var ABounds: TRect; out ATextRect: TRect; out AArrowRect: TRect); virtual; + class procedure DrawMonthHeader(ACanvas: TcxCanvas; const ABounds: TRect; + const AText: string; ANeighbors: TcxNeighbors; const AViewParams: TcxViewParams; + AArrows: TcxHeaderArrows; ASideWidth: Integer; AOnDrawBackground: TcxDrawBackgroundEvent = nil); virtual; + class procedure DrawSchedulerBorder(ACanvas: TcxCanvas; R: TRect); virtual; + class procedure DrawSchedulerEventProgress(ACanvas: TcxCanvas; + const ABounds, AProgress: TRect; AViewParams: TcxViewParams; ATransparent: Boolean); virtual; + class procedure DrawSchedulerNavigationButton(ACanvas: TcxCanvas; + const ARect: TRect; AIsNextButton: Boolean; AState: TcxButtonState; + const AText: string; const ATextRect: TRect; const AArrowRect: TRect); virtual; + class procedure DrawSchedulerNavigationButtonArrow(ACanvas: TcxCanvas; + const ARect: TRect; AIsNextButton: Boolean; AColor: TColor); virtual; + class procedure DrawSchedulerNavigatorButton(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); virtual; + class procedure DrawSchedulerSplitterBorder(ACanvas: TcxCanvas; R: TRect; const AViewParams: TcxViewParams; AIsHorizontal: Boolean); virtual; + class function SchedulerEventProgressOffsets: TRect; virtual; + class procedure SchedulerNavigationButtonSizes(AIsNextButton: Boolean; + var ABorders: TRect; var AArrowSize: TSize); virtual; + // chart view + class function ChartToolBoxDataLevelInfoBorderSize: Integer; virtual; + // editors + class procedure DrawClock(ACanvas: TcxCanvas; const ARect: TRect; + ADateTime: TDateTime; ABackgroundColor: TColor); virtual; + class procedure DrawEditorButton(ACanvas: TcxCanvas; const ARect: TRect; + AButtonKind: TcxEditBtnKind; AState: TcxButtonState); virtual; + class function EditButtonTextOffset: Integer; virtual; + class function EditButtonSize: TSize; virtual; + class function EditButtonTextColor: TColor; virtual; + class function GetContainerBorderColor(AIsHighlightBorder: Boolean): TColor; virtual; + // navigator + class procedure DrawNavigatorGlyph(ACanvas: TcxCanvas; AImageList: TCustomImageList; + AImageIndex: TImageIndex; AButtonIndex: Integer; const AGlyphRect: TRect; + AEnabled: Boolean; AUserGlyphs: Boolean); virtual; + class function NavigatorGlyphSize: TSize; virtual; + // ProgressBar + class procedure DrawProgressBarBorder(ACanvas: TcxCanvas; ARect: TRect; AVertical: Boolean); virtual; + class procedure DrawProgressBarChunk(ACanvas: TcxCanvas; ARect: TRect; AVertical: Boolean); virtual; + class function ProgressBarBorderSize(AVertical: Boolean): TRect; virtual; + class function ProgressBarTextColor: TColor; virtual; + // GroupBox + class procedure DrawGroupBoxBackground(ACanvas: TcxCanvas; ABounds: TRect; + ARect: TRect); virtual; + class procedure DrawGroupBoxCaption(ACanvas: TcxCanvas; ACaptionRect: TRect; + ACaptionPosition: TcxGroupBoxCaptionPosition); virtual; + class procedure DrawGroupBoxContent(ACanvas: TcxCanvas; ABorderRect: TRect; + ACaptionPosition: TcxGroupBoxCaptionPosition); virtual; + class function GroupBoxBorderSize(ACaption: Boolean; + ACaptionPosition: TcxGroupBoxCaptionPosition): TRect; virtual; + class function GroupBoxTextColor(ACaptionPosition: TcxGroupBoxCaptionPosition): TColor; virtual; + class function IsGroupBoxTransparent(AIsCaption: Boolean; + ACaptionPosition: TcxGroupBoxCaptionPosition): Boolean; virtual; + // Panel + class procedure DrawPanelBackground(ACanvas: TcxCanvas; AControl: TWinControl; ABounds: TRect; + AColorFrom: TColor = clDefault; AColorTo: TColor = clDefault); virtual; + class procedure DrawPanelBorders(ACanvas: TcxCanvas; const ABorderRect: TRect); virtual; + class procedure DrawPanelCaption(ACanvas: TcxCanvas; const ACaptionRect: TRect; + ACaptionPosition: TcxGroupBoxCaptionPosition); virtual; + class procedure DrawPanelContent(ACanvas: TcxCanvas; const ABorderRect: TRect; + ABorder: Boolean); virtual; + class function PanelBorderSize: TRect; virtual; + class function PanelTextColor: TColor; virtual; + // TrackBar + class procedure DrawTrackBar(ACanvas: TcxCanvas; const ARect: TRect; + const ASelection: TRect; AShowSelection: Boolean; AEnabled: Boolean; + AHorizontal: Boolean); virtual; + class procedure DrawTrackBarThumb(ACanvas: TcxCanvas; ARect: TRect; AState: TcxButtonState; + AHorizontal: Boolean; ATicks: TcxTrackBarTicksAlign); virtual; + class function TrackBarThumbSize(AHorizontal: Boolean): TSize; virtual; + class function TrackBarTicksColor(AText: Boolean): TColor; virtual; + class function TrackBarTrackSize: Integer; virtual; + // Splitter + class procedure DrawSplitter(ACanvas: TcxCanvas; const ARect: TRect; + AHighlighted: Boolean; AClicked: Boolean; AHorizontal: Boolean); virtual; + class function GetSplitterSize(AHorizontal: Boolean): TSize; virtual; + end; + + TcxStandardLookAndFeelPainter = class(TcxCustomLookAndFeelPainter) + public + class function LookAndFeelStyle: TcxLookAndFeelStyle; override; + // border + class function BorderSize: Integer; override; + class procedure DrawBorder(ACanvas: TcxCanvas; R: TRect); override; + // buttons + class function ButtonBorderSize(AState: TcxButtonState = cxbsNormal): Integer; override; + class function ButtonTextOffset: Integer; override; + class function ButtonTextShift: Integer; override; + class procedure DrawButtonBorder(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); override; + class procedure DrawGroupExpandButton(ACanvas: TcxCanvas; const R: TRect; AExpanded: Boolean; AState: TcxButtonState); override; + class function ExpandButtonSize: Integer; override; + class procedure DrawExpandButton(ACanvas: TcxCanvas; const R: TRect; AExpanded: Boolean; AColor: TColor = clDefault); override; + class function IsButtonHotTrack: Boolean; override; + // checkbox + class procedure DrawCheckBorder(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); override; + // header + class procedure DrawHeaderBorder(ACanvas: TcxCanvas; const R: TRect; ANeighbors: TcxNeighbors; ABorders: TcxBorders); override; + class procedure DrawHeaderControlSectionBorder(ACanvas: TcxCanvas; const R: TRect; + ABorders: TcxBorders; AState: TcxButtonState); override; + class procedure DrawSortingMark(ACanvas: TcxCanvas; const R: TRect; AAscendingSorting: Boolean); override; + class function HeaderBorderSize: Integer; override; + class function HeaderControlSectionBorderSize( + AState: TcxButtonState = cxbsNormal): Integer; override; + class function SortingMarkSize: TPoint; override; + // footer + class function FooterBorderSize: Integer; override; + class function FooterCellBorderSize: Integer; override; + class function FooterCellOffset: Integer; override; + class procedure DrawFooterBorder(ACanvas: TcxCanvas; const R: TRect); override; + class procedure DrawFooterCellBorder(ACanvas: TcxCanvas; const R: TRect); override; + // filter + class procedure DrawFilterDropDownButton(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState; AIsFilterActive: Boolean); override; + // tabs + class procedure DrawTabBorder(ACanvas: TcxCanvas; R: TRect; ABorder: TcxBorder; ABorders: TcxBorders; AVertical: Boolean); override; + class procedure DrawTabsRoot(ACanvas: TcxCanvas; const R: TRect; ABorders: TcxBorders; AVertical: Boolean); override; + class function TabBorderSize(AVertical: Boolean): Integer; override; + // scrollbars + class procedure DrawScrollBarPart(ACanvas: TcxCanvas; AHorizontal: Boolean; + R: TRect; APart: TcxScrollBarPart; AState: TcxButtonState); override; + // ms outlook + class function DefaultSchedulerViewContentColor: TColor; override; + class procedure DrawMonthHeader(ACanvas: TcxCanvas; const ABounds: TRect; + const AText: string; ANeighbors: TcxNeighbors; const AViewParams: TcxViewParams; + AArrows: TcxHeaderArrows; ASideWidth: Integer; AOnDrawBackground: TcxDrawBackgroundEvent = nil); override; + class procedure DrawSchedulerSplitterBorder(ACanvas: TcxCanvas; R: TRect; const AViewParams: TcxViewParams; AIsHorizontal: Boolean); override; + end; + + TcxFlatLookAndFeelPainter = class(TcxCustomLookAndFeelPainter) + public + class function LookAndFeelStyle: TcxLookAndFeelStyle; override; + // border + class function BorderSize: Integer; override; + class procedure DrawBorder(ACanvas: TcxCanvas; R: TRect); override; + // buttons + class function ButtonBorderSize(AState: TcxButtonState = cxbsNormal): Integer; override; + class function ButtonTextOffset: Integer; override; + class function ButtonTextShift: Integer; override; + class procedure DrawButtonBorder(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); override; + class procedure DrawExpandButton(ACanvas: TcxCanvas; const R: TRect; AExpanded: Boolean; AColor: TColor = clDefault); override; + class function ExpandButtonSize: Integer; override; + class function IsButtonHotTrack: Boolean; override; + // checkbox + class procedure DrawCheckBorder(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); override; + // header + class procedure DrawHeaderBorder(ACanvas: TcxCanvas; const R: TRect; ANeighbors: TcxNeighbors; ABorders: TcxBorders); override; + class procedure DrawHeaderControlSectionBorder(ACanvas: TcxCanvas; const R: TRect; + ABorders: TcxBorders; AState: TcxButtonState); override; + class procedure DrawSortingMark(ACanvas: TcxCanvas; const R: TRect; AAscendingSorting: Boolean); override; + class function HeaderBorderSize: Integer; override; + class function SortingMarkSize: TPoint; override; + // footer + class function FooterBorderSize: Integer; override; + class function FooterCellBorderSize: Integer; override; + class function FooterCellOffset: Integer; override; + class procedure DrawFooterBorder(ACanvas: TcxCanvas; const R: TRect); override; + class procedure DrawFooterCellBorder(ACanvas: TcxCanvas; const R: TRect); override; + // filter + class procedure DrawFilterDropDownButton(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState; AIsFilterActive: Boolean); override; + // tabs + class procedure DrawTabBorder(ACanvas: TcxCanvas; R: TRect; ABorder: TcxBorder; ABorders: TcxBorders; AVertical: Boolean); override; + class procedure DrawTabsRoot(ACanvas: TcxCanvas; const R: TRect; ABorders: TcxBorders; AVertical: Boolean); override; + class function TabBorderSize(AVertical: Boolean): Integer; override; + // scrollbars + class procedure DrawScrollBarPart(ACanvas: TcxCanvas; AHorizontal: Boolean; + R: TRect; APart: TcxScrollBarPart; AState: TcxButtonState); override; + // ms outlook + class procedure DrawSchedulerSplitterBorder(ACanvas: TcxCanvas; R: TRect; const AViewParams: TcxViewParams; AIsHorizontal: Boolean); override; + end; + + TcxUltraFlatLookAndFeelPainter = class(TcxCustomLookAndFeelPainter) + protected + // filter + class function FilterDropDownButtonBorderColor(AState: TcxButtonState): TColor; virtual; + // Scheduler + class procedure DrawSchedulerNavigationButtonContent(ACanvas: TcxCanvas; + const ARect: TRect; const AArrowRect: TRect; AIsNextButton: Boolean; + AState: TcxButtonState); override; + // tabs + class function TabBorderHighlightColor: TColor; virtual; + class function TabBorderDarkColor: TColor; virtual; + public + class function LookAndFeelStyle: TcxLookAndFeelStyle; override; + // default + class function DefaultSchedulerBorderColor: TColor; override; + // border + class function BorderHighlightColor: TColor; virtual; + class function BorderSize: Integer; override; + class procedure DrawBorder(ACanvas: TcxCanvas; R: TRect); override; + // buttons + class function ButtonBorderSize(AState: TcxButtonState = cxbsNormal): Integer; override; + class function ButtonColor(AState: TcxButtonState): TColor; override; + class function ButtonFocusRect(ACanvas: TcxCanvas; R: TRect): TRect; override; + class function ButtonGroupBorderSizes(AButtonCount, AButtonIndex: Integer): TRect; override; + class function ButtonSymbolColor(AState: TcxButtonState; + ADefaultColor: TColor = clDefault): TColor; override; + class function ButtonSymbolState(AState: TcxButtonState): TcxButtonState; override; + class function ButtonTextOffset: Integer; override; + class function ButtonTextShift: Integer; override; + class procedure DrawButtonBorder(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); override; + class procedure DrawButtonInGroup(ACanvas: TcxCanvas; R: TRect; + AState: TcxButtonState; AButtonCount, AButtonIndex: Integer; + ABackgroundColor: TColor); override; + class procedure DrawButtonGroupBorder(ACanvas: TcxCanvas; R: TRect; AInplace, ASelected: Boolean); override; + class procedure DrawExpandButton(ACanvas: TcxCanvas; const R: TRect; AExpanded: Boolean; AColor: TColor = clDefault); override; + class procedure DrawHeaderControlSectionBorder(ACanvas: TcxCanvas; const R: TRect; + ABorders: TcxBorders; AState: TcxButtonState); override; + class procedure DrawHeaderControlSectionContent(ACanvas: TcxCanvas; const ABounds, + ATextAreaBounds: TRect; AState: TcxButtonState; AAlignmentHorz: TAlignment; + AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor); override; + class function ExpandButtonSize: Integer; override; + class function IsButtonHotTrack: Boolean; override; + // checkbox + class procedure DrawCheckBorder(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); override; + // header + class procedure DrawHeaderBorder(ACanvas: TcxCanvas; const R: TRect; ANeighbors: TcxNeighbors; ABorders: TcxBorders); override; + class procedure DrawHeaderEx(ACanvas: TcxCanvas; const ABounds, ATextAreaBounds: TRect; + ANeighbors: TcxNeighbors; ABorders: TcxBorders; AState: TcxButtonState; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil); override; + class procedure DrawSortingMark(ACanvas: TcxCanvas; const R: TRect; AAscendingSorting: Boolean); override; + class function HeaderBorders(ANeighbors: TcxNeighbors): TcxBorders; override; + class function HeaderBorderSize: Integer; override; + class function SortingMarkSize: TPoint; override; + // footer + class procedure DrawFooterBorder(ACanvas: TcxCanvas; const R: TRect); override; + class procedure DrawFooterCellBorder(ACanvas: TcxCanvas; const R: TRect); override; + class function FooterBorders: TcxBorders; override; + class function FooterBorderSize: Integer; override; + class function FooterCellBorderSize: Integer; override; + class function FooterCellOffset: Integer; override; + // filter + class procedure DrawFilterDropDownButton(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState; AIsFilterActive: Boolean); override; + class function FilterCloseButtonSize: TPoint; override; + // tabs + class procedure DrawTabBorder(ACanvas: TcxCanvas; R: TRect; ABorder: TcxBorder; ABorders: TcxBorders; AVertical: Boolean); override; + class procedure DrawTabsRoot(ACanvas: TcxCanvas; const R: TRect; ABorders: TcxBorders; AVertical: Boolean); override; + class function TabBorderSize(AVertical: Boolean): Integer; override; + // scrollbars + class procedure DrawScrollBarPart(ACanvas: TcxCanvas; AHorizontal: Boolean; + R: TRect; APart: TcxScrollBarPart; AState: TcxButtonState); override; + // ms outlook + class procedure DrawSchedulerNavigatorButton(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); override; + class procedure DrawSchedulerSplitterBorder(ACanvas: TcxCanvas; R: TRect; const AViewParams: TcxViewParams; AIsHorizontal: Boolean); override; + end; + + TcxOffice11LookAndFeelPainter = class(TcxUltraFlatLookAndFeelPainter) + protected + class procedure DrawContent(ACanvas: TcxCanvas; const ABounds, ATextAreaBounds: TRect; AState: Integer; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil; AIsFooter: Boolean = False); override; + class function HeaderBottomColor: TColor; virtual; + class function HeaderDarkEdgeColor: TColor; virtual; + class function HeaderHighlightEdgeColor: TColor; virtual; + class function HeaderTopColor: TColor; virtual; + // filter + class function FilterDropDownButtonBorderColor(AState: TcxButtonState): TColor; override; + // tabs + class function TabBorderHighlightColor: TColor; override; + class function TabBorderDarkColor: TColor; override; + // scheduler3 + class procedure DrawSchedulerNavigationButtonContent(ACanvas: TcxCanvas; + const ARect: TRect; const AArrowRect: TRect; AIsNextButton: Boolean; + AState: TcxButtonState); override; + public + class function LookAndFeelStyle: TcxLookAndFeelStyle; override; + // colors + class function DefaultDateNavigatorHeaderColor: TColor; override; + class function DefaultDateNavigatorSelectionColor: TColor; override; + class function DefaultDateNavigatorSelectionTextColor: TColor; override; + class function DefaultFilterBoxColor: TColor; override; + class function DefaultFilterBoxTextColor: TColor; override; + class function DefaultFooterColor: TColor; override; + class function DefaultFooterTextColor: TColor; override; + class function DefaultGroupColor: TColor; override; + class function DefaultGroupByBoxColor: TColor; override; + class function DefaultGroupByBoxTextColor: TColor; override; + class function DefaultHeaderColor: TColor; override; + class function DefaultHeaderBackgroundColor: TColor; override; + class function DefaultSchedulerBorderColor: TColor; override; + class function DefaultSchedulerControlColor: TColor; override; + class function DefaultTabColor: TColor; override; + class function DefaultTabsBackgroundColor: TColor; override; + class function DefaultTimeGridMinorScaleColor: TColor; override; + class function DefaultTimeGridSelectionBarColor: TColor; override; + // border + class function BorderHighlightColor: TColor; override; + class procedure DrawBorder(ACanvas: TcxCanvas; R: TRect); override; + // buttons + class function ButtonColor(AState: TcxButtonState): TColor; override; + class function ButtonSymbolColor(AState: TcxButtonState; + ADefaultColor: TColor = clDefault): TColor; override; + class procedure DrawButtonBorder(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); override; + class procedure DrawExpandButton(ACanvas: TcxCanvas; const R: TRect; AExpanded: Boolean; + AColor: TColor = clDefault); override; + class function DrawExpandButtonFirst: Boolean; override; + class procedure DrawSmallExpandButton(ACanvas: TcxCanvas; R: TRect; AExpanded: Boolean; + ABorderColor: TColor; AColor: TColor = clDefault); override; + class function ExpandButtonSize: Integer; override; + class function SmallExpandButtonSize: Integer; override; + // checkbox + class function CheckButtonColor(AState: TcxButtonState): TColor; override; + // filter + class procedure DrawFilterDropDownButton(ACanvas: TcxCanvas; + R: TRect; AState: TcxButtonState; AIsFilterActive: Boolean); override; + // header + class procedure DrawHeader(ACanvas: TcxCanvas; const ABounds, ATextAreaBounds: TRect; + ANeighbors: TcxNeighbors; ABorders: TcxBorders; AState: TcxButtonState; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil; AIsLast: Boolean = False; + AInGroupByBox: Boolean = False); override; + class procedure DrawHeaderBorder(ACanvas: TcxCanvas; const R: TRect; ANeighbors: TcxNeighbors; ABorders: TcxBorders); override; + class procedure DrawHeaderControlSection(ACanvas: TcxCanvas; const ABounds, ATextAreaBounds: TRect; + ANeighbors: TcxNeighbors; ABorders: TcxBorders; AState: TcxButtonState; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; AMultiLine, + AShowEndEllipsis: Boolean; const AText: string; AFont: TFont; ATextColor, + ABkColor: TColor); override; + class procedure DrawSortingMark(ACanvas: TcxCanvas; const R: TRect; AAscendingSorting: Boolean); override; + class function HeaderBorders(ANeighbors: TcxNeighbors): TcxBorders; override; + class function HeaderBorderSize: Integer; override; + class function IsHeaderHotTrack: Boolean; override; + // footer + class function FooterSeparatorColor: TColor; override; + // tabs + // scrollbars + class procedure DrawScrollBarPart(ACanvas: TcxCanvas; AHorizontal: Boolean; + R: TRect; APart: TcxScrollBarPart; AState: TcxButtonState); override; + // ms outlook + class procedure DrawMonthHeader(ACanvas: TcxCanvas; const ABounds: TRect; + const AText: string; ANeighbors: TcxNeighbors; const AViewParams: TcxViewParams; + AArrows: TcxHeaderArrows; ASideWidth: Integer; AOnDrawBackground: TcxDrawBackgroundEvent = nil); override; + class procedure DrawSchedulerNavigatorButton(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); override; + class procedure DrawSchedulerBorder(ACanvas: TcxCanvas; R: TRect); override; + // SizeGrip + class procedure DrawSizeGrip(ACanvas: TcxCanvas; const ARect: TRect; ABackgroundColor: TColor = clDefault); override; + // Panel + class procedure DrawPanelBackground(ACanvas: TcxCanvas; AControl: TWinControl; ABounds: TRect; + AColorFrom: TColor = clDefault; AColorTo: TColor = clDefault); override; + end; + + TcxWinXPLookAndFeelPainter = class(TcxStandardLookAndFeelPainter) + protected + class procedure DrawContent(ACanvas: TcxCanvas; ATheme: TdxTheme; APartId, AStateId: Integer; + const ABounds, ATextAreaBounds: TRect; AAlignmentHorz: TAlignment; + AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis, AShowPrefix: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor); reintroduce; virtual; + class procedure DrawSchedulerNavigationButtonContent(ACanvas: TcxCanvas; + const ARect: TRect; const AArrowRect: TRect; AIsNextButton: Boolean; + AState: TcxButtonState); override; + public + class function LookAndFeelStyle: TcxLookAndFeelStyle; override; + // colors + class function DefaultSchedulerBorderColor: TColor; override; + // arrow + class procedure DrawArrow(ACanvas: TcxCanvas; const R: TRect; AArrowDirection: TcxArrowDirection; AColor: TColor); override; + class procedure DrawArrow(ACanvas: TcxCanvas; const R: TRect; AState: TcxButtonState; AArrowDirection: TcxArrowDirection; ADrawBorder: Boolean = True); override; + class procedure DrawArrowBorder(ACanvas: TcxCanvas; const R: TRect; AState: TcxButtonState); override; + // border + class function BorderSize: Integer; override; + class procedure DrawBorder(ACanvas: TcxCanvas; R: TRect); override; + // buttons + class function AdjustGroupButtonDisplayRect(const R: TRect; AButtonCount, AButtonIndex: Integer): TRect; override; + class function ButtonBorderSize(AState: TcxButtonState = cxbsNormal): Integer; override; + class function ButtonColor(AState: TcxButtonState): TColor; override; + class function ButtonFocusRect(ACanvas: TcxCanvas; R: TRect): TRect; override; + class function ButtonGroupBorderSizes(AButtonCount, AButtonIndex: Integer): TRect; override; + class function ButtonSymbolColor(AState: TcxButtonState; + ADefaultColor: TColor = clDefault): TColor; override; + class function ButtonTextOffset: Integer; override; + class function ButtonTextShift: Integer; override; + class procedure DrawButton(ACanvas: TcxCanvas; R: TRect; const ACaption: string; + AState: TcxButtonState; ADrawBorder: Boolean = True; AColor: TColor = clDefault; + ATextColor: TColor = clDefault; AWordWrap: Boolean = False); override; + class procedure DrawExpandButton(ACanvas: TcxCanvas; const R: TRect; AExpanded: Boolean; AColor: TColor = clDefault); override; + class function DrawExpandButtonFirst: Boolean; override; + class procedure DrawGroupExpandButton(ACanvas: TcxCanvas; const R: TRect; AExpanded: Boolean; AState: TcxButtonState); override; + class procedure DrawSmallExpandButton(ACanvas: TcxCanvas; R: TRect; AExpanded: Boolean; + ABorderColor: TColor; AColor: TColor = clDefault); override; + class function ExpandButtonSize: Integer; override; + class function GroupExpandButtonSize: Integer; override; + class function SmallExpandButtonSize: Integer; override; + class function IsButtonHotTrack: Boolean; override; + class function IsPointOverGroupExpandButton(const R: TRect; const P: TPoint): Boolean; override; + // checkbox + class function CheckBorderSize: Integer; override; + class function CheckButtonSize: TSize; override; + class procedure DrawCheck(ACanvas: TcxCanvas; const R: TRect; AState: TcxButtonState; + AChecked: Boolean; AColor: TColor); override; + class procedure DrawCheckBorder(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); override; + // RadioGroup + class procedure DrawRadioButton(ACanvas: TcxCanvas; X, Y: Integer; + AButtonState: TcxButtonState; AChecked: Boolean; AFocused: Boolean; ABrushColor: TColor; AIsDesigning: Boolean = False); override; + class function RadioButtonSize: TSize; override; + // header + class procedure DrawHeader(ACanvas: TcxCanvas; const ABounds, ATextAreaBounds: TRect; + ANeighbors: TcxNeighbors; ABorders: TcxBorders; AState: TcxButtonState; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil; AIsLast: Boolean = False; + AInGroupByBox: Boolean = False); override; + class procedure DrawHeaderPressed(ACanvas: TcxCanvas; const ABounds: TRect); override; + class procedure DrawHeaderControlSection(ACanvas: TcxCanvas; const ABounds, ATextAreaBounds: TRect; + ANeighbors: TcxNeighbors; ABorders: TcxBorders; AState: TcxButtonState; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; AMultiLine, + AShowEndEllipsis: Boolean; const AText: string; AFont: TFont; ATextColor, + ABkColor: TColor); override; + class procedure DrawSortingMark(ACanvas: TcxCanvas; const R: TRect; AAscendingSorting: Boolean); override; + class function HeaderBorderSize: Integer; override; + class function HeaderControlSectionBorderSize( + AState: TcxButtonState = cxbsNormal): Integer; override; + class function HeaderControlSectionContentBounds(const ABounds: TRect; + AState: TcxButtonState): TRect; override; +// class function HeaderDrawCellsFirst: Boolean; override; + class function IsHeaderHotTrack: Boolean; override; + class function SortingMarkSize: TPoint; override; + // footer + class procedure DrawFooterBorder(ACanvas: TcxCanvas; const R: TRect); override; + class procedure DrawFooterCell(ACanvas: TcxCanvas; const ABounds: TRect; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; AMultiLine: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil); override; + class function FooterBorderSize: Integer; override; + class function FooterCellBorderSize: Integer; override; + class function FooterCellOffset: Integer; override; + class function FooterDrawCellsFirst: Boolean; override; + // filter + class procedure DrawFilterCloseButton(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); override; + class procedure DrawFilterDropDownButton(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState; AIsFilterActive: Boolean); override; + class function FilterActivateButtonSize: TPoint; override; + class function FilterCloseButtonSize: TPoint; override; + // tabs + class procedure DrawTab(ACanvas: TcxCanvas; R: TRect; ABorders: TcxBorders; + const AText: string; AState: TcxButtonState; AVertical: Boolean; AFont: TFont; + ATextColor, ABkColor: TColor; AShowPrefix: Boolean = False); override; + class procedure DrawTabBorder(ACanvas: TcxCanvas; R: TRect; ABorder: TcxBorder; ABorders: TcxBorders; AVertical: Boolean); override; + class procedure DrawTabsRoot(ACanvas: TcxCanvas; const R: TRect; ABorders: TcxBorders; AVertical: Boolean); override; + class function IsDrawTabImplemented(AVertical: Boolean): Boolean; override; + class function IsTabHotTrack(AVertical: Boolean): Boolean; override; + class function TabBorderSize(AVertical: Boolean): Integer; override; + // indicator + class procedure DrawIndicatorItem(ACanvas: TcxCanvas; const R: TRect; + AKind: TcxIndicatorKind; AColor: TColor; AOnDrawBackground: TcxDrawBackgroundEvent = nil); override; + //class function IndicatorDrawItemsFirst: Boolean; override; + // scrollbars + class function ScrollBarMinimalThumbSize(AVertical: Boolean): Integer; override; + class procedure DrawScrollBarPart(ACanvas: TcxCanvas; AHorizontal: Boolean; + R: TRect; APart: TcxScrollBarPart; AState: TcxButtonState); override; + // ms outlook + class function DefaultSchedulerViewContentColor: TColor; override; + class procedure DrawMonthHeader(ACanvas: TcxCanvas; const ABounds: TRect; + const AText: string; ANeighbors: TcxNeighbors; const AViewParams: TcxViewParams; + AArrows: TcxHeaderArrows; ASideWidth: Integer; AOnDrawBackground: TcxDrawBackgroundEvent = nil); override; + class procedure DrawSchedulerEventProgress(ACanvas: TcxCanvas; + const ABounds, AProgressChunk: TRect; AViewParams: TcxViewParams; + ATransparent: Boolean); override; + class procedure DrawSchedulerNavigatorButton(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); override; + class procedure DrawSchedulerSplitterBorder(ACanvas: TcxCanvas; R: TRect; const AViewParams: TcxViewParams; AIsHorizontal: Boolean); override; + class function SchedulerEventProgressOffsets: TRect; override; + // size grip + class procedure DrawSizeGrip(ACanvas: TcxCanvas; const ARect: TRect; ABackgroundColor: TColor = clDefault); override; + // Panel + class procedure DrawPanelBackground(ACanvas: TcxCanvas; AControl: TWinControl; ABounds: TRect; + AColorFrom: TColor = clDefault; AColorTo: TColor = clDefault); override; + end; + + { TcxExtendedStylePainters } + + TcxExtendedStylePainterInfo = class + public + Data: TObject; + Name: string; + Painter: TcxCustomLookAndFeelPainterClass; + constructor Create(const AName: string; + APainter: TcxCustomLookAndFeelPainterClass; AData: TObject); virtual; + destructor Destroy; override; + end; + + TcxExtendedStylePainters = class(TcxObjectList) + private + FListeners: TInterfaceList; + function GetData(AIndex: Integer): TObject; + function GetItem(AIndex: Integer): TcxExtendedStylePainterInfo; + function GetName(AIndex: Integer): string; + function GetPainter(AIndex: Integer): TcxCustomLookAndFeelPainterClass; + protected + procedure Changed(APainter: TcxCustomLookAndFeelPainterClass); + function FindInfoByName(const AName: string; var AInfo: TcxExtendedStylePainterInfo): Integer; + procedure SortPainters; + public + constructor Create; virtual; + destructor Destroy; override; + procedure AddListener(AListener: IcxLookAndFeelPainterListener); + procedure RemoveListener(AListener: IcxLookAndFeelPainterListener); + + function Register(const AName: string; + APainter: TcxCustomLookAndFeelPainterClass; AData: TObject): Boolean; + function GetNameByPainter(APainter: TcxCustomLookAndFeelPainterClass; + out AName: string): Boolean; + function GetPainterData(APainter: TcxCustomLookAndFeelPainterClass; var Data): Boolean; + function GetPainterByName(const AName: string; + out Painter: TcxCustomLookAndFeelPainterClass): Boolean; + function Unregister(const AName: string): Boolean; + + property Data[Index: Integer]: TObject read GetData; + property Listeners: TInterfaceList read FListeners write FListeners; + property Names[Index: Integer]: string read GetName; + property Items[Index: Integer]: TcxExtendedStylePainterInfo read GetItem; + property Painters[Index: Integer]: TcxCustomLookAndFeelPainterClass read GetPainter; + end; + +function BtnStateToXPBtnState(AState: TcxButtonState): Integer; + +function GetCurrentPainterClass: TcxCustomLookAndFeelPainterClass; +function GetExtendedStylePainters: TcxExtendedStylePainters; +procedure PrepareRadioButtonImageList; +procedure UpdateScrollBarBitmaps; + +function cxTextRect(const R: TRect): TRect; + +var + cxIndicatorImages: TImageList; + +implementation + +{$R cxLookAndFeelPainters.res} + +uses + Messages, + Forms, SysUtils, dxThemeConsts, cxControls, cxLookAndFeels, Math; + +const + FilterDropDownButtonWidth = 15; + + SortingMarkAreaWidth = 16; + FilterActiveButtonWidth = 13; + FilterActiveButtonHeight = 13; + FilterCloseButtonWidth = 16; + FilterCloseButtonHeight = 14; + + ActiveFilterButtonArrowColor = clBlue; + +type + { TSystemPaletteChangedNotifier } + + TSystemPaletteChangedNotifier = class(TcxSystemPaletteChangedNotifier) + protected + procedure DoChanged; override; + end; + + { TcxRadioButtonImageList } + + TcxRadioButtonImageList = class + private + FButtonMask: TBitmap; + FList: TImageList; + function GetImageIndex(ALookAndFeelKind: TcxLookAndFeelKind; + AButtonState: TcxButtonState; + AChecked, AFocused, AIsDesigning: Boolean): Integer; + function GetImageListIndexMapIndex(ALookAndFeelKind: TcxLookAndFeelKind; + AButtonState: TcxButtonState; + AChecked, AFocused, AIsDesigning: Boolean): Integer; + public + constructor Create; + destructor Destroy; override; + procedure Draw(ACanvas: TcxCanvas; X, Y: Integer; ABrushColor: TColor; + ALookAndFeelKind: TcxLookAndFeelKind; AButtonState: TcxButtonState; + AChecked, AFocused, AIsDesigning: Boolean); + function GetSize: TSize; + procedure Prepare; + procedure Reset; + end; + +var + ExtendedStylePainters: TcxExtendedStylePainters; + FCheckButtonSize: TSize; + FRadioButtonImageList: TcxRadioButtonImageList; + FRadioButtonImageListIndexes: array of Integer; + FSystemPaletteChangedNotifier: TSystemPaletteChangedNotifier; + StdScrollBitmaps: array[Boolean] of TBitmap; + +function LookAndFeelStyleToLookAndFeelKind( + ALookAndFeelStyle: TcxLookAndFeelStyle): TcxLookAndFeelKind; +begin + case ALookAndFeelStyle of + lfsFlat: + Result := lfFlat; + lfsStandard: + Result := lfStandard; + lfsUltraFlat: + Result := lfUltraFlat; + lfsOffice11: + Result := lfOffice11; + else + Result := lfStandard; + end; +end; + +function MulDiv(nNumber, nNumerator, nDenominator: Integer): Integer; +begin + Result := Windows.MulDiv(nNumber, nNumerator, nDenominator) +end; + +function cxExtendedStylePaintersSortProc(Item1: TcxExtendedStylePainterInfo; + Item2: TcxExtendedStylePainterInfo): Integer; +begin + Result := AnsiCompareStr(Item1.Name, Item2.Name); +end; + +{ TSystemPaletteChangedNotifier } + +procedure TSystemPaletteChangedNotifier.DoChanged; +begin + if FRadioButtonImageList <> nil then + FRadioButtonImageList.Reset; +end; + +{ TcxCustomLookAndFeelPainter } + +class procedure TcxCustomLookAndFeelPainter.DrawBackground(ACanvas: TcxCanvas; + const ARect: TRect; ATransparent: Boolean; ABackgroundColor: TColor; + const ABackgroundBitmap: TBitmap); +begin + if not ATransparent then + begin + ACanvas.Brush.Color := ABackgroundColor; + ACanvas.FillRect(ARect); + end + else + if ABackgroundBitmap <> nil then + ACanvas.FillRect(ARect, ABackgroundBitmap); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawButtonArrow(ACanvas: TcxCanvas; + const R: TRect; AColor: TColor); +var + P: array[0..2] of TPoint; + + procedure CalculatePoints; + var + ASize: TPoint; + + function _GetSize: TPoint; + begin + Result.X := (R.Right - R.Left) div 2; + if not Odd(Result.X) then Inc(Result.X); + Result.Y := Result.X div 2 + 1; + end; + + begin + with R do + begin + ASize := _GetSize; + P[0] := Point((Left + Right - ASize.X) div 2, MulDiv(Top + Bottom - ASize.Y, 1, 2)); + P[1] := Point(P[0].X + ASize.X - 1, P[0].Y); + P[2] := Point(P[0].X + ASize.X div 2, P[0].Y + ASize.Y - 1); + end; + end; + +begin + CalculatePoints; + with ACanvas do + begin + Brush.Color := AColor; + Pen.Color := AColor; + Polygon(P); + end; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawContent(ACanvas: TcxCanvas; + const ABounds, ATextAreaBounds: TRect; AState: Integer; AAlignmentHorz: TAlignment; + AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil; AIsFooter: Boolean = False); +const + MultiLines: array[Boolean] of Integer = (cxSingleLine, cxWordBreak); + ShowEndEllipsises: array[Boolean] of Integer = (0, cxShowEndEllipsis); +begin + with ACanvas do + begin + if not Assigned(AOnDrawBackground) or not AOnDrawBackground(ACanvas, ABounds) then + begin + SetBrushColor(ABkColor); + FillRect(ABounds); + end; + if AText <> '' then + begin + Brush.Style := bsClear; + Font := AFont; + Font.Color := ATextColor; + DrawText(AText, ATextAreaBounds, cxAlignmentsHorz[AAlignmentHorz] or + cxAlignmentsVert[AAlignmentVert] or MultiLines[AMultiLine] or + ShowEndEllipsises[AShowEndEllipsis]); + Brush.Style := bsSolid; + end; + end; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawExpandButtonCross(ACanvas: TcxCanvas; + const R: TRect; AExpanded: Boolean; AColor: TColor); +var + ASize, X, Y: Integer; +begin + with R do + begin + ASize := Right - Left - 2 * 2; + X := GetRangeCenter(Left, Right); + Y := GetRangeCenter(Top, Bottom); + end; + ACanvas.Brush.Color := AColor; + ACanvas.FillRect(Rect(X - ASize div 2, Y, X + ASize div 2 + 1, Y + 1)); + if not AExpanded then + ACanvas.FillRect(Rect(X, Y - ASize div 2, X + 1, Y + ASize div 2 + 1)); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawGroupExpandButtonMark(ACanvas: TcxCanvas; + const R: TRect; AExpanded: Boolean; AState: TcxButtonState); +var + Size, X, MainY, I: Integer; + + procedure DrawOneMark(Y: Integer); + var + ASign, ADelta: Integer; + begin + if AExpanded then Inc(Y, Size); + ASign := 2 * Ord(AExpanded) - 1; + ADelta := Ord(Odd(I - MainY)); + if not AExpanded then + ADelta := Ord(not Boolean(ADelta)); + ACanvas.MoveTo(X + ADelta, Y - ASign * ADelta); + ACanvas.LineTo(X + Size, Y - ASign * Size); + ACanvas.LineTo(X + 2 * Size + 1 - ADelta, Y + ASign * (1 - ADelta)); + end; + +begin + Size := 3; + ACanvas.Pen.Color := ButtonSymbolColor(AState); + with R do + begin + X := (Left + Right - (2 * Size + 1)) div 2; + MainY := (Top + Bottom - 2 * (Size + 1)) div 2; + for I := MainY to MainY + 4 - 1 do + DrawOneMark(I + Ord(I >= MainY + 2) * (Size - 1)); + end; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawIndicatorCustomizationMark( + ACanvas: TcxCanvas; const R: TRect; AColor: TColor); +const + LineOffset = 3; + LineCount = 5; +var + X, Y, AWidth, I: Integer; + + procedure DrawLine(X, Y: Integer; AChecked: Boolean); + begin + with ACanvas do + begin + if AChecked then + Pixels[X, Y] := Pen.Color; + MoveTo(X + 2, Y); + LineTo(X + AWidth, Y); + end; + end; + +begin + X := R.Left + LineOffset; + AWidth := R.Right - R.Left - 2 * LineOffset; + Y := (R.Top + R.Bottom - (2 * LineCount - 1)) div 2; + ACanvas.Pen.Color := AColor; + for I := 0 to LineCount - 1 do + begin + DrawLine(X, Y, not Odd(I)); + Inc(Y, 2); + end; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawIndicatorImage(ACanvas: TcxCanvas; + const R: TRect; AKind: TcxIndicatorKind); +var + X, Y: Integer; +begin + if AKind = ikNone then Exit; + with cxIndicatorImages, R do + begin + X := (Left + Right - Width) div 2; + Y := (Top + Bottom - Height) div 2; + end; + cxIndicatorImages.Draw(ACanvas.Canvas, X, Y, Ord(AKind) - 1); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawMonthHeaderArrows( + ACanvas: TcxCanvas; const ABounds: TRect; AArrows: TcxHeaderArrows; + ASideWidth: Integer; AColor: TColor); +var + R: TRect; + + procedure InternalDrawArrow(LeftArrow: Boolean); + var + X, Sign, ArrowHeight: Integer; + P: array[1..3] of TPoint; + begin + with R do + begin + ArrowHeight := (Bottom - Top) div 2; + if not Odd(ArrowHeight) then Inc(ArrowHeight); + if LeftArrow then X := Left + else X := Right; + Sign := 2 * Byte(LeftArrow) - 1; + P[1] := Point(X + Sign * (ASideWidth - 1), (Top + Bottom - ArrowHeight) div 2 - 1); + P[2] := Point(P[1].X, P[1].Y + ArrowHeight + 1); + P[3] := Point(P[1].X - Sign * (ArrowHeight div 2 + 1), P[1].Y + ArrowHeight div 2 + 1); + ACanvas.SetBrushColor(AColor); + ACanvas.Pen.Color := AColor; + ACanvas.Polygon(P); + end; + end; + +begin + R := ABounds; + Inc(R.Top, BorderSize); + InflateRect(R, 0, -1); + if AArrows in [haLeft, haBoth] then + InternalDrawArrow(True); + if AArrows in [haRight, haBoth] then + InternalDrawArrow(False); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawSortingArrow(ACanvas: TcxCanvas; + const R: TRect; AColor1, AColor2: TColor; AAscendingSorting: Boolean); +var + Sign, AWidth, AHeight, X, Y, ALeftSide, ARightSide: Integer; +begin + Sign := 2 * Byte(AAscendingSorting) - 1; + with SortingMarkSize do + begin + AWidth := X; + AHeight := Y; + end; + + X := (R.Left + R.Right) div 2; + if not Odd(AWidth) then Dec(X); + if AAscendingSorting then + Y := (R.Top + R.Bottom - AHeight) div 2 + else + Y := (R.Top + R.Bottom + AHeight) div 2 - 1; + + ALeftSide := AWidth div 2; + if not Odd(AWidth) then Dec(ALeftSide); + ARightSide := AWidth div 2; + + ACanvas.Pen.Color := AColor2; + ACanvas.MoveTo(X + ARightSide, Y + Sign * (AHeight - 2)); + ACanvas.LineTo(X + ARightSide - ALeftSide, + Y); + ACanvas.LineTo(X + ARightSide, + Y + Sign * (AHeight - 1)); + if not AAscendingSorting then + ACanvas.Pen.Color := AColor1; + ACanvas.LineTo(X - ALeftSide, Y + Sign * (AHeight - 1)); + if AAscendingSorting then + ACanvas.Pen.Color := AColor1; + ACanvas.LineTo(X, + Y); + ACanvas.LineTo(X - ALeftSide, Y + Sign * (AHeight - Ord(Odd(AWidth)) + )); +end; + +class function TcxCustomLookAndFeelPainter.FooterCellContentBounds(const ABounds: TRect): TRect; +begin + Result := ABounds; + InflateRect(Result, -FooterCellBorderSize, -FooterCellBorderSize); +end; + +class function TcxCustomLookAndFeelPainter.FooterCellTextAreaBounds(const ABounds: TRect): TRect; +begin + Result := FooterCellContentBounds(ABounds); + InflateRect(Result, -cxTextOffset, -cxTextOffset); +end; + +class function TcxCustomLookAndFeelPainter.GetArrowDirection(AHorizontal: Boolean; + APart: TcxScrollBarPart): TcxArrowDirection; +const + ArrowKind: array[Boolean, Boolean] of TcxArrowDirection = + ((adUp, adDown), (adLeft, adRight)); +begin + Result := ArrowKind[AHorizontal, APart <> sbpLineUp]; +end; + +class function TcxCustomLookAndFeelPainter.LookAndFeelStyle: TcxLookAndFeelStyle; +begin + Result := lfsStandard; +end; + +class function TcxCustomLookAndFeelPainter.DefaultContentColor: TColor; +begin + Result := clWindow; +end; + +class function TcxCustomLookAndFeelPainter.DefaultContentOddColor: TColor; +begin + Result := DefaultContentColor; +end; + +class function TcxCustomLookAndFeelPainter.DefaultContentEvenColor: TColor; +begin + Result := DefaultContentColor; +end; + +class function TcxCustomLookAndFeelPainter.DefaultContentTextColor: TColor; +begin + Result := clWindowText; +end; + +class function TcxCustomLookAndFeelPainter.DefaultSchedulerBackgroundColor: TColor; +begin + Result := clWindow; +end; + +class function TcxCustomLookAndFeelPainter.DefaultSchedulerTextColor: TColor; +begin + Result := clWindowText; +end; + +class function TcxCustomLookAndFeelPainter.DefaultDateNavigatorHeaderColor: TColor; +begin + Result := clBtnFace; +end; + +class function TcxCustomLookAndFeelPainter.DefaultDateNavigatorSelectionColor: TColor; +begin + Result := clHighlight; +end; + +class function TcxCustomLookAndFeelPainter.DefaultDateNavigatorSelectionTextColor: TColor; +begin + Result := clHighlightText; +end; + +class function TcxCustomLookAndFeelPainter.DefaultEditorBackgroundColor( + AIsDisabled: Boolean): TColor; +begin + Result := clDefault; +end; + +class function TcxCustomLookAndFeelPainter.DefaultEditorTextColor( + AIsDisabled: Boolean): TColor; +begin + Result := clDefault; +end; + +class function TcxCustomLookAndFeelPainter.DefaultFilterBoxColor: TColor; +begin + Result := clBtnShadow; +end; + +class function TcxCustomLookAndFeelPainter.DefaultFilterBoxTextColor: TColor; +begin + Result := clBtnHighlight; +end; + +class function TcxCustomLookAndFeelPainter.DefaultFixedSeparatorColor: TColor; +begin + Result := clBtnText; +end; + +class function TcxCustomLookAndFeelPainter.DefaultFooterColor: TColor; +begin + Result := clBtnFace; +end; + +class function TcxCustomLookAndFeelPainter.DefaultFooterTextColor: TColor; +begin + Result := clBtnText; +end; + +class function TcxCustomLookAndFeelPainter.DefaultGridLineColor: TColor; +begin + Result := clBtnShadow; +end; + +class function TcxCustomLookAndFeelPainter.DefaultGroupColor: TColor; +begin + Result := clBtnFace; +end; + +class function TcxCustomLookAndFeelPainter.DefaultGroupTextColor: TColor; +begin + Result := clBtnText; +end; + +class function TcxCustomLookAndFeelPainter.DefaultGroupByBoxColor: TColor; +begin + Result := clBtnShadow; +end; + +class function TcxCustomLookAndFeelPainter.DefaultGroupByBoxTextColor: TColor; +begin + Result := clBtnFace; +end; + +class function TcxCustomLookAndFeelPainter.DefaultHeaderColor: TColor; +begin + Result := clBtnFace; +end; + +class function TcxCustomLookAndFeelPainter.DefaultHeaderTextColor: TColor; +begin + Result := clBtnText; +end; + +class function TcxCustomLookAndFeelPainter.DefaultHeaderBackgroundColor: TColor; +begin + Result := clBtnShadow; +end; + +class function TcxCustomLookAndFeelPainter.DefaultHeaderBackgroundTextColor: TColor; +begin + Result := clBtnFace; +end; + +class function TcxCustomLookAndFeelPainter.DefaultHyperlinkTextColor: TColor; +begin + Result := clBlue; +end; + +class function TcxCustomLookAndFeelPainter.DefaultInactiveColor: TColor; +begin + Result := clBtnFace; +end; + +class function TcxCustomLookAndFeelPainter.DefaultInactiveTextColor: TColor; +begin + Result := clBtnText; +end; + +class function TcxCustomLookAndFeelPainter.DefaultPreviewTextColor: TColor; +begin + Result := clBlue; +end; + +class function TcxCustomLookAndFeelPainter.DefaultRecordSeparatorColor: TColor; +begin + Result := DefaultGridLineColor; +end; + +class function TcxCustomLookAndFeelPainter.DefaultSizeGripAreaColor: TColor; +begin + Result := clBtnFace; +end; + +class function TcxCustomLookAndFeelPainter.DefaultVGridCategoryColor: TColor; +begin + Result := DefaultHeaderColor; +end; + +class function TcxCustomLookAndFeelPainter.DefaultVGridCategoryTextColor: TColor; +begin + Result := clDefault; +end; + +class function TcxCustomLookAndFeelPainter.DefaultVGridLineColor: TColor; +begin + Result := clBlack; //todo +end; + +class function TcxCustomLookAndFeelPainter.DefaultVGridBandLineColor: TColor; +begin + Result := DefaultVGridLineColor; +end; + +class function TcxCustomLookAndFeelPainter.DefaultSchedulerBorderColor: TColor; +begin + Result := $9D9DA1; +end; + +class function TcxCustomLookAndFeelPainter.DefaultSchedulerControlColor: TColor; +begin + Result := clBtnFace; +end; + +class function TcxCustomLookAndFeelPainter.DefaultSchedulerViewContentColor: TColor; +begin + Result := $D5FFFF; +end; + +class function TcxCustomLookAndFeelPainter.DefaultSchedulerNavigatorColor: TColor; +begin + Result := clBtnFace; +end; + +class function TcxCustomLookAndFeelPainter.DefaultSchedulerViewSelectedTextColor: TColor; +begin + Result := DefaultSelectionTextColor; +end; + +class function TcxCustomLookAndFeelPainter.DefaultSchedulerViewTextColor: TColor; +begin + Result := clWindowText; +end; + +class function TcxCustomLookAndFeelPainter.DefaultSelectionColor: TColor; +begin + Result := clHighlight; +end; + +class function TcxCustomLookAndFeelPainter.DefaultSelectionTextColor: TColor; +begin + Result := clHighlightText; +end; + +class function TcxCustomLookAndFeelPainter.DefaultSeparatorColor: TColor; +begin + Result := clBtnFace; +end; + +class function TcxCustomLookAndFeelPainter.DefaultTabColor: TColor; +begin + Result := clBtnFace; +end; + +class function TcxCustomLookAndFeelPainter.DefaultTabTextColor: TColor; +begin + Result := clBtnText; +end; + +class function TcxCustomLookAndFeelPainter.DefaultTabsBackgroundColor: TColor; +begin + Result := clBtnFace; +end; + +class function TcxCustomLookAndFeelPainter.DefaultTimeGridMajorScaleColor: TColor; +begin + Result := clWhite; +end; + +class function TcxCustomLookAndFeelPainter.DefaultTimeGridMajorScaleTextColor: TColor; +begin + Result := clBlack; +end; + +class function TcxCustomLookAndFeelPainter.DefaultTimeGridMinorScaleColor: TColor; +begin + Result := clBtnFace; +end; + +class function TcxCustomLookAndFeelPainter.DefaultTimeGridMinorScaleTextColor: TColor; +begin + Result := clBtnText; +end; + +class function TcxCustomLookAndFeelPainter.DefaultTimeGridSelectionBarColor: TColor; +begin + Result := clWhite; +end; + +class function TcxCustomLookAndFeelPainter.DefaultChartDiagramValueBorderColor: TColor; +begin + Result := clBlack; +end; + +class function TcxCustomLookAndFeelPainter.DefaultChartDiagramValueCaptionTextColor: TColor; +begin + Result := clBlack; +end; + +class function TcxCustomLookAndFeelPainter.DefaultChartHistogramAxisColor: TColor; +begin + Result := clBlack; +end; + +class function TcxCustomLookAndFeelPainter.DefaultChartHistogramGridLineColor: TColor; +begin + Result := clcxLightGray; +end; + +class function TcxCustomLookAndFeelPainter.DefaultChartHistogramPlotColor: TColor; +begin + Result := clWhite; +end; + +class function TcxCustomLookAndFeelPainter.DefaultChartPieDiagramSeriesSiteBorderColor: TColor; +begin + Result := clBtnShadow; +end; + +class function TcxCustomLookAndFeelPainter.DefaultChartPieDiagramSeriesSiteCaptionColor: TColor; +begin + Result := clSkyBlue; +end; + +class function TcxCustomLookAndFeelPainter.DefaultChartPieDiagramSeriesSiteCaptionTextColor: TColor; +begin + Result := clNavy; +end; + +class function TcxCustomLookAndFeelPainter.DefaultChartToolBoxDataLevelInfoBorderColor: TColor; +begin + Result := clBtnShadow; +end; + +class function TcxCustomLookAndFeelPainter.DefaultChartToolBoxItemSeparatorColor: TColor; +begin + Result := clBtnShadow; +end; + +class procedure TcxCustomLookAndFeelPainter.CalculateArrowPoints(R: TRect; + var P: TcxArrowPoints; AArrowDirection: TcxArrowDirection; AProportional: Boolean; AArrowSize: Integer = 0); + + function _GetSize: TSize; + begin + if AArrowDirection in [adUp, adDown] then + begin + if AArrowSize = 0 then + AArrowSize := (R.Right - R.Left - 1) div 4 + 1; + Result.cy := AArrowSize; + Result.cx := AArrowSize * 2 - 1; + end + else + begin + if AArrowSize = 0 then + AArrowSize := (R.Bottom - R.Top - 1) div 4 + 1; + Result.cx := AArrowSize; + Result.cy := AArrowSize * 2 - 1; + end + end; + +var + ASize: TSize; + ADelta: Integer; +begin + with R do + begin + if AProportional then + begin + ADelta := (Right - Left) - (Bottom - Top); + if ADelta > 0 then + InflateRect(R, -ADelta div 2, 0) + else + InflateRect(R, 0, ADelta div 2); + end; + ASize := _GetSize; + case AArrowDirection of + adUp: + begin + P[cxArrowTopPointIndex] := Point((Left + Right - 1) div 2, MulDiv(Top + Bottom - ASize.cy, 1, 2){ - 1}); + P[cxArrowLeftBasePointIndex] := Point((Left + Right - ASize.cx) div 2, P[cxArrowTopPointIndex].Y + ASize.cy - 1); + P[cxArrowRightBasePointIndex] := Point(P[cxArrowLeftBasePointIndex].X + ASize.cx - 1, P[cxArrowLeftBasePointIndex].Y); + end; + adDown: + begin + P[cxArrowRightBasePointIndex] := Point((Left + Right - ASize.cx) div 2, MulDiv(Top + Bottom - ASize.cy, 1, 2)); + P[cxArrowLeftBasePointIndex] := Point(P[cxArrowRightBasePointIndex].X + ASize.cx - 1, P[cxArrowRightBasePointIndex].Y); + P[cxArrowTopPointIndex] := Point((Left + Right - 1) div 2, P[cxArrowRightBasePointIndex].Y + ASize.cy - 1); + end; + adLeft: + begin + P[cxArrowTopPointIndex] := Point((Left + Right - ASize.cx) div 2, (Top + Bottom (**)) div 2); + P[cxArrowRightBasePointIndex] := Point(P[cxArrowTopPointIndex].X + ASize.cx - 1, MulDiv(Top + Bottom - ASize.cy, 1, 2)); + P[cxArrowLeftBasePointIndex] := Point(P[cxArrowRightBasePointIndex].X, P[cxArrowRightBasePointIndex].Y + ASize.cy - 1); + end; + adRight: + begin + P[cxArrowLeftBasePointIndex] := Point((Left + Right - ASize.cx) div 2, MulDiv(Top + Bottom - ASize.cy, 1, 2)); + P[cxArrowTopPointIndex] := Point(P[cxArrowLeftBasePointIndex].X + ASize.cx - 1, (Top + Bottom (**)) div 2); + P[cxArrowRightBasePointIndex] := Point(P[cxArrowLeftBasePointIndex].X, P[cxArrowLeftBasePointIndex].Y + ASize.cy - 1); + end; + end; + end; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawArrow(ACanvas: TcxCanvas; const R: TRect; AArrowDirection: TcxArrowDirection; AColor: TColor); +var + P: TcxArrowPoints; +begin + CalculateArrowPoints(R, P, AArrowDirection, True); + with ACanvas do + begin + Brush.Style := bsSolid; + SetBrushColor(AColor); + Pen.Color := AColor; + Polygon(P); + end; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawArrow(ACanvas: TcxCanvas; const R: TRect; + AState: TcxButtonState; AArrowDirection: TcxArrowDirection; ADrawBorder: Boolean = True); +var + P: TcxArrowPoints; +begin + CalculateArrowPoints(R, P, AArrowDirection, False); + with ACanvas do + begin + Brush.Style := bsSolid; + if ADrawBorder then + DrawArrowBorder(ACanvas, R, AState) + else + begin + SetBrushColor(ButtonColor(AState)); + FillRect(R); + end; + SetBrushColor(ButtonSymbolColor(AState)); + Pen.Color := Brush.Color; + Polygon(P); + end; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawArrowBorder(ACanvas: TcxCanvas; + const R: TRect; AState: TcxButtonState); +begin + with ACanvas do + begin + Brush.Color := ButtonColor(AState); + Brush.Style := bsSolid; + FillRect(R); + end; + DrawButtonBorder(ACanvas, R, AState); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawScrollBarArrow(ACanvas: TcxCanvas; + R: TRect; AState: TcxButtonState; AArrowDirection: TcxArrowDirection); +var + P: TcxArrowPoints; + + procedure OffsetPoints(ADelta: Integer); + var + I: Integer; + begin + for I := 0 to 2 do + begin + Inc(P[I].X, ADelta); + Inc(P[I].Y, ADelta); + end; + end; + +begin + if AState = cxbsPressed then + OffsetRect(R, ButtonTextShift, ButtonTextShift); + CalculateArrowPoints(R, P, AArrowDirection, True); + with ACanvas do + begin + Brush.Style := bsSolid; + if AState <> cxbsDisabled then + Brush.Color := ButtonSymbolColor(AState) + else + begin + OffsetPoints(1); + Brush.Color := clBtnHighlight; + Pen.Color := Brush.Color; + Polygon(P); + {$IFDEF KYLIX3} + case AArrowDirection of + adUp: ACanvas.Canvas.Pixels[P[cxArrowRightBasePointIndex].X, P[cxArrowRightBasePointIndex].Y] := Pen.Color; + adLeft: ACanvas.Canvas.Pixels[P[cxArrowLeftBasePointIndex].X, P[cxArrowLeftBasePointIndex].Y] := Pen.Color; + end; + {$ENDIF} + OffsetPoints(-1); + Brush.Color := clBtnShadow; + end; + Pen.Color := Brush.Color; + Polygon(P); + {$IFDEF KYLIX3} + case AArrowDirection of + adUp: ACanvas.Canvas.Pixels[P[cxArrowRightBasePointIndex].X, P[cxArrowRightBasePointIndex].Y] := Pen.Color; + adLeft: ACanvas.Canvas.Pixels[P[cxArrowLeftBasePointIndex].X, P[cxArrowLeftBasePointIndex].Y] := Pen.Color; + end; + {$ENDIF} + end; +end; + +class function TcxCustomLookAndFeelPainter.BorderSize: Integer; +begin + Result := 0; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawBorder(ACanvas: TcxCanvas; R: TRect); +begin +end; + +class function TcxCustomLookAndFeelPainter.AdjustGroupButtonDisplayRect( + const R: TRect; AButtonCount, AButtonIndex: Integer): TRect; +begin + Result := R; +end; + +class function TcxCustomLookAndFeelPainter.ButtonBorderSize(AState: TcxButtonState = cxbsNormal): Integer; +begin + Result := 0; +end; + +class function TcxCustomLookAndFeelPainter.ButtonColor(AState: TcxButtonState): TColor; +begin + Result := clBtnFace; +end; + +class function TcxCustomLookAndFeelPainter.ButtonFocusRect(ACanvas: TcxCanvas; R: TRect): TRect; +begin + Result := R; + InflateRect(Result, -4, -4); + if IsRectEmpty(Result) then + Result := R; +end; + +class function TcxCustomLookAndFeelPainter.ButtonGroupBorderSizes(AButtonCount, + AButtonIndex: Integer): TRect; +var + AButtonBorderWidth: Integer; +begin + AButtonBorderWidth := ButtonBorderSize; + Result := Rect(AButtonBorderWidth, AButtonBorderWidth, AButtonBorderWidth, + AButtonBorderWidth); +end; + +class function TcxCustomLookAndFeelPainter.ButtonTextOffset: Integer; +begin + Result := 0; +end; + +class function TcxCustomLookAndFeelPainter.ButtonTextShift: Integer; +begin + Result := 0; +end; + +class function TcxCustomLookAndFeelPainter.ButtonSymbolColor( + AState: TcxButtonState; ADefaultColor: TColor = clDefault): TColor; +begin + if AState = cxbsDisabled then + Result := clBtnShadow + else + if ADefaultColor = clDefault then + Result := clBtnText + else + Result := ADefaultColor; +end; + +class function TcxCustomLookAndFeelPainter.ButtonSymbolState(AState: TcxButtonState): TcxButtonState; +begin + Result := AState; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawButton(ACanvas: TcxCanvas; + R: TRect; const ACaption: string; AState: TcxButtonState; ADrawBorder: Boolean = True; + AColor: TColor = clDefault; ATextColor: TColor = clDefault; AWordWrap: Boolean = False); +var + AFlags: Integer; +begin + with ACanvas do + begin + if ADrawBorder then + begin + DrawButtonBorder(ACanvas, R, AState); + InflateRect(R, -ButtonBorderSize(AState), -ButtonBorderSize(AState)); + end; + if AColor = clDefault then + Brush.Color := ButtonColor(AState) + else + Brush.Color := AColor; + FillRect(R); + if ATextColor = clDefault then + Font.Color := ButtonSymbolColor(AState) + else + Font.Color := ATextColor; + Brush.Style := bsClear; + with R do // for compatible with standard buttons + begin + Dec(Bottom, Ord(Odd(Bottom - Top))); + if (Bottom - Top) < 18 then Dec(Top); + end; + if AState = cxbsPressed then + OffsetRect(R, ButtonTextShift, ButtonTextShift); + if Length(ACaption) > 0 then + begin + AFlags := cxAlignVCenter or cxShowPrefix or cxAlignHCenter; + if AWordWrap then + AFlags := AFlags or cxWordBreak + else + AFlags := AFlags or cxSingleLine; + DrawText(ACaption, R, AFlags, AState <> cxbsDisabled); + end; + Brush.Style := bsSolid; + end; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawButtonCross(ACanvas: TcxCanvas; + const R: TRect; AColor: TColor; AState: TcxButtonState); +var + ASize: TPoint; + + function GetSize: TPoint; + begin + Result.X := FilterCloseButtonSize.X div 2; + if not Odd(Result.X) then Dec(Result.X); + Result.Y := Result.X; + end; + + procedure DrawOneMark(ADelta: Integer); + var + P: TPoint; + AFix: Integer; + begin + with R do + P := Point((Left + Right - ASize.X) div 2 + ADelta, (Top + Bottom - ASize.Y) div 2); + if AState = cxbsPressed then + begin + Inc(P.X); + Inc(P.Y); + end; + AFix := 0; + {$IFDEF WIN32} + {$ENDIF} + with ACanvas, P do + begin + MoveTo(X, Y); + LineTo(X + ASize.X - AFix, Y + ASize.Y - AFix); + MoveTo(X, Y + ASize.Y - 1); + LineTo(X + ASize.X - AFix, Y - 1 + AFix); + end; + end; + +begin + ASize := GetSize; + ACanvas.Pen.Color := AColor; + DrawOneMark(0); + DrawOneMark(1); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawButtonInGroup(ACanvas: TcxCanvas; + R: TRect; AState: TcxButtonState; AButtonCount, AButtonIndex: Integer; + ABackgroundColor: TColor); +begin + DrawButton(ACanvas, R, '', AState); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawButtonBorder(ACanvas: TcxCanvas; + R: TRect; AState: TcxButtonState); +begin +end; + +class procedure TcxCustomLookAndFeelPainter.DrawButtonGroupBorder(ACanvas: TcxCanvas; + R: TRect; AInplace, ASelected: Boolean); +begin +end; + +class procedure TcxCustomLookAndFeelPainter.DrawExpandButton(ACanvas: TcxCanvas; + const R: TRect; AExpanded: Boolean; AColor: TColor = clDefault); +begin +end; + +class function TcxCustomLookAndFeelPainter.DrawExpandButtonFirst: Boolean; +begin + Result := True; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawGroupExpandButton(ACanvas: TcxCanvas; + const R: TRect; AExpanded: Boolean; AState: TcxButtonState); +begin + DrawButton(ACanvas, R, '', AState); + DrawGroupExpandButtonMark(ACanvas, R, AExpanded, AState); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawSmallExpandButton(ACanvas: TcxCanvas; + R: TRect; AExpanded: Boolean; ABorderColor: TColor; AColor: TColor = clDefault); +begin + ACanvas.Brush.Color := ABorderColor; + ACanvas.FrameRect(R); + if AColor <> clDefault then + begin + InflateRect(R, -1, -1); + ACanvas.Brush.Color := AColor; + ACanvas.FillRect(R); + InflateRect(R, 1, 1); + end; + DrawExpandButtonCross(ACanvas, R, AExpanded, clBtnText); +end; + +class function TcxCustomLookAndFeelPainter.ExpandButtonSize: Integer; +begin + Result := 0; +end; + +class function TcxCustomLookAndFeelPainter.GroupExpandButtonSize: Integer; +begin + Result := 15; +end; + +class function TcxCustomLookAndFeelPainter.IsButtonHotTrack: Boolean; +begin + Result := False; +end; + +class function TcxCustomLookAndFeelPainter.IsPointOverGroupExpandButton(const R: TRect; + const P: TPoint): Boolean; +begin + Result := PtInRect(R, P); +end; + +class function TcxCustomLookAndFeelPainter.SmallExpandButtonSize: Integer; +begin + Result := 9; +end; + +class function TcxCustomLookAndFeelPainter.CheckBorderSize: Integer; +begin + Result := 2; +end; + +class function TcxCustomLookAndFeelPainter.CheckButtonColor(AState: TcxButtonState): TColor; +const + Colors: array[TcxButtonState] of TColor = (clWindow, clWindow, clWindow, clBtnFace, clBtnFace); +begin + Result := Colors[AState]; +end; + +class function TcxCustomLookAndFeelPainter.CheckButtonSize: TSize; +begin + Result := FCheckButtonSize; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawCheck(ACanvas: TcxCanvas; const R: TRect; + AState: TcxButtonState; AChecked: Boolean; AColor: TColor); +var + ASize: TPoint; + + function GetSize: TPoint; + begin + with R do + begin + Result.X := Right - Left - 2; + Result.Y := Bottom - Top - 2 - 2; + end; + end; + + procedure DrawOneCheck(ADelta: Integer); + var + ARoot: TPoint; + AFix: Integer; + begin + with R do + begin + ARoot.X := (Left + Right) div 2 - 1; + ARoot.Y := (Top + Bottom + ASize.Y) div 2 - 2 + ADelta; + end; + AFix := 0; + with ACanvas do + begin + MoveTo(ARoot.X - (ASize.X div 2 - 1), ARoot.Y - ASize.Y div 2); + LineTo(ARoot.X, ARoot.Y); + LineTo(ARoot.X + ASize.X div 2 + 2 - AFix, ARoot.Y - ASize.Y + AFix); + end; + end; + +begin + if ACanvas.Brush.Style = bsSolid then + begin + ACanvas.Brush.Color := CheckButtonColor(AState); + ACanvas.FillRect(R); + end; + if not AChecked then Exit; + ASize := GetSize; + ACanvas.Pen.Color := AColor; + DrawOneCheck(0); + DrawOneCheck(1); + DrawOneCheck(2); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawCheckBorder(ACanvas: TcxCanvas; + R: TRect; AState: TcxButtonState); +begin +end; + +class procedure TcxCustomLookAndFeelPainter.DrawCheckButton(ACanvas: TcxCanvas; + R: TRect; AState: TcxButtonState; ACheckState: TcxCheckBoxState); +const + ColorMap: array[Boolean] of TColor = (clBtnText, clGrayText); +begin + DrawCheckBorder(ACanvas, R, AState); + InflateRect(R, -CheckBorderSize, -CheckBorderSize); + DrawCheck(ACanvas, R, AState, ACheckState = cbsChecked, + ColorMap[(AState = cxbsDisabled) or (ACheckState = cbsGrayed)]); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawCheckButton(ACanvas: TcxCanvas; + R: TRect; AState: TcxButtonState; AChecked: Boolean); +const + CheckStates: array[Boolean] of TcxCheckBoxState = (cbsUnchecked, cbsChecked); +begin + DrawCheckButton(ACanvas, R, AState, CheckStates[AChecked]); +end; + +var + FRadioButtonMaskSize: TSize; + FRadioButtonSize: TSize; + FRadioButtonRect: TRect; + FRadioButtonCheckRect: TRect; + FRadioButtonCheckSize: TSize; + FRadioButtonPattern: array of array of Integer; + +procedure CalculateRadioButtonSize; +var + B: Windows.TBitmap; + HB: HBITMAP; + ABitmap: TBitmap; + I, J: Integer; +begin + HB := LoadBitmap(0, PChar(OBM_CHECKBOXES)); + try + cxGetBitmapData(HB, B); + finally + DeleteObject(HB); + end; + FRadioButtonMaskSize.cx := B.bmWidth div 4; + FRadioButtonMaskSize.cy := B.bmHeight div 3; + ABitmap := TBitmap.Create; + try + ABitmap.Width := FRadioButtonMaskSize.cx; + ABitmap.Height := FRadioButtonMaskSize.cy; + ABitmap.Canvas.Brush.Color := 0; + ABitmap.Canvas.FillRect(Rect(0, 0, FRadioButtonMaskSize.cx, FRadioButtonMaskSize.cy)); + DrawFrameControl(ABitmap.Canvas.Handle, Rect(0, 0, FRadioButtonMaskSize.cx, + FRadioButtonMaskSize.cy), DFC_BUTTON, DFCS_BUTTONRADIOMASK + DFCS_FLAT); + FRadioButtonSize.cX := 0; + FRadioButtonSize.cY := 0; + FRadioButtonRect.Left := -1; + FRadioButtonRect.Top := -1; + for J := 0 to FRadioButtonMaskSize.cx - 1 do + for I := 0 to FRadioButtonMaskSize.cy - 1 do + if ABitmap.Canvas.Pixels[J, I] = 0 then + begin + if FRadioButtonRect.Left = -1 then + FRadioButtonRect.Left := J; + Inc(FRadioButtonSize.cX); + Break; + end; + for I := 0 to FRadioButtonMaskSize.cy - 1 do + for J := 0 to FRadioButtonMaskSize.cx - 1 do + if ABitmap.Canvas.Pixels[J, I] = 0 then + begin + if FRadioButtonRect.Top = -1 then + FRadioButtonRect.Top := I; + Inc(FRadioButtonSize.cY); + Break; + end; + FRadioButtonRect.Right := FRadioButtonRect.Left + FRadioButtonSize.cx; + FRadioButtonRect.Bottom := FRadioButtonRect.Top + FRadioButtonSize.cy; + ABitmap.Canvas.Brush.Color := 0; + ABitmap.Canvas.FillRect(Rect(0, 0, FRadioButtonMaskSize.cx, FRadioButtonMaskSize.cy)); + DrawFrameControl(ABitmap.Canvas.Handle, Rect(0, 0, FRadioButtonMaskSize.cx, + FRadioButtonMaskSize.cy), DFC_BUTTON, DFCS_BUTTONRADIOIMAGE + DFCS_FLAT + DFCS_CHECKED); + I := FRadioButtonRect.Top + (FRadioButtonSize.cy div 2) - 2; + J := FRadioButtonRect.Left + (FRadioButtonSize.cx div 2) - 1; + while ABitmap.Canvas.Pixels[J, I] = ColorToRGB(clWindowText) do + Dec(I); + Inc(I); + FRadioButtonCheckRect.Top := I; + repeat + Inc(I); + until ABitmap.Canvas.Pixels[J, I] <> ColorToRGB(clWindowText); + FRadioButtonCheckRect.Bottom := I; + FRadioButtonCheckSize.cy := FRadioButtonCheckRect.Bottom - FRadioButtonCheckRect.Top; + + I := FRadioButtonRect.Top + (FRadioButtonSize.cy div 2) - 1; + J := FRadioButtonRect.Left + (FRadioButtonSize.cx div 2) - 2; + while ABitmap.Canvas.Pixels[J, I] = ColorToRGB(clWindowText) do + Dec(J); + Inc(J); + FRadioButtonCheckRect.Left := J; + repeat + Inc(J); + until ABitmap.Canvas.Pixels[J, I] <> ColorToRGB(clWindowText); + FRadioButtonCheckRect.Right := J; + FRadioButtonCheckSize.cx := FRadioButtonCheckRect.Right - FRadioButtonCheckRect.Left; + finally + ABitmap.Free; + end; +end; + +const +// FilledRadioButtonListSize = 48; + cxPixelColorMask = $FFFFFF; + +procedure InternalRoundRect(ACanvas: TCanvas; const R: TRect); +begin + with ACanvas, R do + RoundRect(Left, Top, Right, Bottom, Right - Left - 1, Bottom - Top - 1); +end; + +procedure PrepareRadioButtonPattern; + + procedure PrepareOuterCircle; + var + ABitmap: TBitmap; + I, J: Integer; + begin + ABitmap := TBitmap.Create; + try + ABitmap.Width := FRadioButtonSize.cx; + ABitmap.Height := FRadioButtonSize.cy; + ABitmap.PixelFormat := pf32bit; + with ABitmap.Canvas do + begin + Brush.Color := clWhite; + FillRect(Rect(0, 0, FRadioButtonSize.cx, FRadioButtonSize.cy)); + Pen.Color := clBlack; + with FRadioButtonSize do + InternalRoundRect(ABitmap.Canvas, Rect(0, 0, cx, cy)); + end; + SetLength(FRadioButtonPattern, FRadioButtonSize.cy, FRadioButtonSize.cx); + for I := 0 to FRadioButtonSize.cy - 1 do + begin + for J := 0 to FRadioButtonSize.cx - 1 do + begin + if ABitmap.Canvas.Pixels[J, I] and cxPixelColorMask <> 0 then + FRadioButtonPattern[I, J] := 0 + else + if (FRadioButtonSize.cy - 1) * (FRadioButtonSize.cx - 1 - J) < I * (FRadioButtonSize.cx - 1) then + FRadioButtonPattern[I, J] := 2 + else + FRadioButtonPattern[I, J] := 1; + end; + end; + finally + ABitmap.Free; + end; + end; + + procedure PrepareInnerCircle; + var + I, I1, J, J1: Integer; + AFirstColumn, ALastColumn, AFirstRow, ALastRow: Integer; + + procedure FillPoint; + var + ASign: Integer; + begin + ASign := (FRadioButtonSize.cy - 1) * (FRadioButtonSize.cx - 1 - J) - I * (FRadioButtonSize.cx - 1); + if ASign = 0 then + if J <= FRadioButtonSize.cx div 2 - 1 then + FRadioButtonPattern[I, J] := 3 + else + FRadioButtonPattern[I, J] := 4 + else + if ASign < 0 then + FRadioButtonPattern[I, J] := 4 + else + FRadioButtonPattern[I, J] := 3; + end; + + begin + AFirstRow := 1; + ALastRow := FRadioButtonSize.cy - 2; + J1 := FRadioButtonSize.cx div 2 - 1; + + for I := AFirstRow to ALastRow do + begin + J := J1; + while FRadioButtonPattern[I, J] = 0 do + begin + FRadioButtonPattern[I, J] := 5; + Dec(J); + end; + J := J1 + 1; + while FRadioButtonPattern[I, J] = 0 do + begin + FRadioButtonPattern[I, J] := 5; + Inc(J); + end; + end; + + for I := AFirstRow to ALastRow do + begin + J := J1; + while not(FRadioButtonPattern[I, J] in [1, 2]) do + begin + if (I = AFirstRow) or (I = ALastRow) then + FillPoint; + Dec(J); + end; + Inc(J); + FillPoint; + J := J1 + 1; + while not(FRadioButtonPattern[I, J] in [1, 2]) do + begin + if (I = AFirstRow) or (I = ALastRow) then + FillPoint; + Inc(J); + end; + Dec(J); + FillPoint; + end; + + AFirstColumn := 1; + ALastColumn := FRadioButtonSize.cx - 2; + I1 := FRadioButtonSize.cy div 2 - 1; + for J := AFirstColumn to ALastColumn do + begin + I := I1; + while not(FRadioButtonPattern[I, J] in [1, 2]) do + begin + if (J = AFirstColumn) or (J = ALastColumn) then + FillPoint; + Dec(I); + end; + Inc(I); + FillPoint; + I := I1 + 1; + while not(FRadioButtonPattern[I, J] in [1, 2]) do + begin + if (J = AFirstColumn) or (J = ALastColumn) then + FillPoint; + Inc(I); + end; + Dec(I); + FillPoint; + end; + end; + + procedure PrepareCheck; + var + ABitmap: TBitmap; + I, J: Integer; + R: TRect; + begin + ABitmap := TBitmap.Create; + try + ABitmap.Width := FRadioButtonSize.cx; + ABitmap.Height := FRadioButtonSize.cy; + ABitmap.PixelFormat := pf32Bit; + with ABitmap.Canvas do + begin + Brush.Color := clWhite; + FillRect(Rect(0, 0, FRadioButtonSize.cx, FRadioButtonSize.cy)); + Pen.Color := clBlack; + Brush.Color := clBlack; + R := FRadioButtonCheckRect; + OffsetRect(R, -FRadioButtonRect.Left, -FRadioButtonRect.Top); + InternalRoundRect(ABitmap.Canvas, R); + for I := 0 to FRadioButtonSize.cy - 1 do + begin + for J := 0 to FRadioButtonSize.cx - 1 do + begin + if ABitmap.Canvas.Pixels[J, I] and cxPixelColorMask = 0 then + FRadioButtonPattern[I, J] := 6; + end; + end; + end; + finally + ABitmap.Free; + end; + end; + +begin + PrepareOuterCircle; + PrepareInnerCircle; + PrepareCheck; +end; + +constructor TcxRadioButtonImageList.Create; + + procedure PrepareButtonMask; + var + R: TRect; + begin + FButtonMask := TBitmap.Create; + FButtonMask.Monochrome := True; + FButtonMask.Width := FRadioButtonSize.cx; + FButtonMask.Height := FRadioButtonSize.cy; + + with FButtonMask.Canvas do + begin + Brush.Color := clWhite; + R := Rect(0, 0, FRadioButtonSize.cx, FRadioButtonSize.cy); + FillRect(R); + Brush.Color := clBlack; + Pen.Color := clBlack; + InternalRoundRect(FButtonMask.Canvas, R); + end; + end; + +begin + inherited Create; + CalculateRadioButtonSize; + FList := TImageList.Create(nil); + with FList do + begin + Width := FRadioButtonSize.cx; + Height := FRadioButtonSize.cy; + Masked := True; + ImageType := itImage; + end; + PrepareButtonMask; + PrepareRadioButtonPattern; +end; + +destructor TcxRadioButtonImageList.Destroy; +begin + FreeAndNil(FList); + FreeAndNil(FButtonMask); + inherited Destroy; +end; + +procedure TcxRadioButtonImageList.Draw(ACanvas: TcxCanvas; X, Y: Integer; + ABrushColor: TColor; ALookAndFeelKind: TcxLookAndFeelKind; + AButtonState: TcxButtonState; AChecked, AFocused, AIsDesigning: Boolean); + + procedure DrawGlyph(ACanvas: TcxCanvas; AImageList: TCustomImageList; + AImageIndex: TImageIndex; const AGlyphRect: TRect; ABrushColor: TColor; + AEnabled: Boolean; ABackgroundBitmap: TBitmap = nil); + var + ABitmap: TBitmap; + ABrush: HBRUSH; + begin + ABitmap := nil; + try + if ABackgroundBitmap = nil then + begin + ABitmap := TBitmap.Create; + ABitmap.Width := AImageList.Width; + ABitmap.Height := AImageList.Height; + ABrush := CreateSolidBrush(ColorToRGB(ABrushColor)); + Windows.FillRect(ABitmap.Canvas.Handle, Rect(0, 0, ABitmap.Width, ABitmap.Height), ABrush); + DeleteObject(ABrush); + end; + if ABackgroundBitmap <> nil then + begin + AImageList.Draw(ABackgroundBitmap.Canvas, 0, 0, AImageIndex, AEnabled); // ??? itMask TODO + ACanvas.Draw(AGlyphRect.Left, AGlyphRect.Top, ABackgroundBitmap); + end else + begin + AImageList.Draw(ABitmap.Canvas, 0, 0, AImageIndex, AEnabled); // ??? itMask TODO + ACanvas.Draw(AGlyphRect.Left, AGlyphRect.Top, ABitmap); + end; + finally + if ABitmap <> nil then + ABitmap.Free; + end; + end; + +var + AImageIndex: Integer; +begin + AImageIndex := GetImageIndex(ALookAndFeelKind, AButtonState, AChecked, + AFocused, AIsDesigning); + if ABrushColor = clDefault then + FList.Draw(ACanvas.Canvas, X, Y, AImageIndex) + else + DrawGlyph(ACanvas, FList, AImageIndex, Rect(X, Y, X + FList.Width, + Y + FList.Height), ABrushColor, True); +end; + +function TcxRadioButtonImageList.GetSize: TSize; +begin + Result := Size(FList.Width, FList.Height); +end; + +procedure TcxRadioButtonImageList.Prepare; +var + AColorMap: array[0 .. 6] of TColor; + + function GetRadioButtonBodyColor(ALookAndFeelKind: TcxLookAndFeelKind; AButtonState: TcxButtonState): TColor; + begin + // TODO: to method + if ALookAndFeelKind = lfOffice11 then + begin + if AButtonState = cxbsNormal then + Result := clWindow + else + Result := TcxOffice11LookAndFeelPainter.ButtonColor(AButtonState); + end + else + if AButtonState <> cxbsDisabled then + begin + if ALookAndFeelKind = lfUltraFlat then + begin + Result := clBtnFace; + case AButtonState of + cxbsHot: + Result := GetLightSelColor; + cxbsNormal: + Result := clWindow{clBtnFace}; + cxbsPressed: + Result := GetLightDownedSelColor; + end; + end + else + if AButtonState = cxbsPressed then + Result := clBtnFace + else + Result := clWindow; + end + else + Result := clBtnFace; + end; + + procedure PrepareColorMap(ALookAndFeelKind: TcxLookAndFeelKind; + AButtonState: TcxButtonState; AChecked, AFocused, AIsDesigning: Boolean); + var + I: Integer; + begin + AColorMap[0] := clBlack; + AColorMap[5] := GetRadioButtonBodyColor(ALookAndFeelKind, AButtonState); + case ALookAndFeelKind of + lfStandard: + begin + AColorMap[1] := clBtnShadow; + AColorMap[2] := clBtnHighlight; + AColorMap[3] := cl3DDkShadow; + AColorMap[4] := cl3DLight; + end; + lfFlat: + begin + AColorMap[1] := clBtnShadow; + AColorMap[2] := clBtnHighlight; + AColorMap[3] := cl3DLight; + AColorMap[4] := cl3DLight; + end; + lfUltraFlat: + begin + if AFocused or (AButtonState in [cxbsHot, cxbsPressed]) or (AIsDesigning and + (AButtonState <> cxbsDisabled)) then + AColorMap[1] := clHighlight + else + AColorMap[1] := clBtnShadow; + AColorMap[2] := AColorMap[1]; + AColorMap[3] := AColorMap[5]; + AColorMap[4] := AColorMap[5]; + end; + lfOffice11: // TODO: to method + begin + if AButtonState = cxbsDisabled then + AColorMap[1] := dxOffice11TextDisabledColor + else + if AFocused or (AButtonState in [cxbsHot, cxbsPressed]) or AIsDesigning then + AColorMap[1] := dxOffice11SelectedBorderColor + else + AColorMap[1] := clBtnText;//dxOffice11BarFloatingBorderColor1; //clBtnShadow; + AColorMap[2] := AColorMap[1]; + AColorMap[3] := AColorMap[5]; + AColorMap[4] := AColorMap[5]; + end; + end; + + if not AChecked then + AColorMap[6] := AColorMap[5] + else + if AButtonState <> cxbsDisabled then + AColorMap[6] := clWindowText + else + if ALookAndFeelKind = lfOffice11 then + AColorMap[6] := dxOffice11TextDisabledColor + else + AColorMap[6] := clBtnShadow; + + for I := 0 to 6 do + begin + AColorMap[I] := ColorToRGB(AColorMap[I]); + AColorMap[I] := RGB(GetBValue(AColorMap[I]), GetGValue(AColorMap[I]), GetRValue(AColorMap[I])); + end; + end; + +var + ABitmap: TBitmap; + AButtonState: TcxButtonState; + AChecked, AFocused, AIsDesigning: Boolean; + AImageListIndexMapIndex, I, J: Integer; + ALookAndFeelKind: TcxLookAndFeelKind; + ABitmapInfo: TBitmapInfo; + RGBs: array of Integer; +begin + if FList.Count > 0 then exit; + ABitmap := TBitmap.Create; + try + ABitmap.Width := FRadioButtonSize.cx; + ABitmap.Height := FRadioButtonSize.cy; + ABitmap.PixelFormat := pf32bit; + ABitmap.HandleType := bmDDB; + SetLength(RGBs, ABitmap.Width * ABitmap.Height); + ABitmapInfo.bmiHeader.biSize := SizeOf(ABitmapInfo.bmiHeader); + ABitmapInfo.bmiHeader.biWidth := ABitmap.Width; + ABitmapInfo.bmiHeader.biHeight := -ABitmap.Height; + ABitmapInfo.bmiHeader.biPlanes := 1; + ABitmapInfo.bmiHeader.biBitCount := 32; + ABitmapInfo.bmiHeader.biCompression := BI_RGB; + + for AFocused := False to True do + for AIsDesigning := False to True do + for ALookAndFeelKind := Low(TcxLookAndFeelKind) to High(TcxLookAndFeelKind) do + for AChecked := False to True do + for AButtonState := Succ(Low(TcxButtonState)) to High(TcxButtonState) do + begin + PrepareColorMap(ALookAndFeelKind, AButtonState, AChecked, + AFocused, AIsDesigning); + for I := 0 to FRadioButtonSize.cy - 1 do + for J := 0 to FRadioButtonSize.cx - 1 do + RGBs[I * ABitmap.Width + J] := AColorMap[FRadioButtonPattern[I, J]]; + SetDIBits(ABitmap.Canvas.Handle, ABitmap.Handle, 0, ABitmap.Height, RGBs, ABitmapInfo, DIB_RGB_COLORS); + FList.Add(ABitmap, FButtonMask); + AImageListIndexMapIndex := GetImageListIndexMapIndex( + ALookAndFeelKind, AButtonState, AChecked, AFocused, AIsDesigning); + if AImageListIndexMapIndex + 1 > Length(FRadioButtonImageListIndexes) then + SetLength(FRadioButtonImageListIndexes, AImageListIndexMapIndex + 1); + FRadioButtonImageListIndexes[AImageListIndexMapIndex] := FList.Count - 1; + end; + finally + ABitmap.Free; + end; +end; + +procedure TcxRadioButtonImageList.Reset; +begin + FList.Clear; + Prepare; +end; + +function TcxRadioButtonImageList.GetImageIndex( + ALookAndFeelKind: TcxLookAndFeelKind; AButtonState: TcxButtonState; + AChecked, AFocused, AIsDesigning: Boolean): Integer; +begin + Result := FRadioButtonImageListIndexes[ + GetImageListIndexMapIndex(ALookAndFeelKind, AButtonState, AChecked, + AFocused, AIsDesigning)]; +end; + +function TcxRadioButtonImageList.GetImageListIndexMapIndex( + ALookAndFeelKind: TcxLookAndFeelKind; AButtonState: TcxButtonState; + AChecked, AFocused, AIsDesigning: Boolean): Integer; +var + AButtonStateIndex: Integer; + ALookAndFeelKindCount: Integer; +begin + AButtonStateIndex := Integer(AButtonState) - 1; + ALookAndFeelKindCount := Integer(High(TcxLookAndFeelKind)) - + Integer(Low(TcxLookAndFeelKind)) + 1; + + Result := (Integer(AFocused) * 2 * ALookAndFeelKindCount + Integer(AIsDesigning) * ALookAndFeelKindCount + + Integer(ALookAndFeelKind)) * 8 + Integer(AChecked) * 4 + AButtonStateIndex; +end; + +function RadioButtonImageList: TcxRadioButtonImageList; +begin + if FRadioButtonImageList = nil then + begin + FRadioButtonImageList := TcxRadioButtonImageList.Create; + FRadioButtonImageList.Prepare; + end; + Result := FRadioButtonImageList; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawRadioButton(ACanvas: TcxCanvas; + X, Y: Integer; AButtonState: TcxButtonState; AChecked, AFocused: Boolean; + ABrushColor: TColor; AIsDesigning: Boolean = False); +begin + RadioButtonImageList.Draw(ACanvas, X, Y, ABrushColor, + LookAndFeelStyleToLookAndFeelKind(LookAndFeelStyle), AButtonState, AChecked, + AFocused, AIsDesigning); +end; + +class function TcxCustomLookAndFeelPainter.RadioButtonSize: TSize; +begin + Result := RadioButtonImageList.GetSize; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawHeader(ACanvas: TcxCanvas; + const ABounds, ATextAreaBounds: TRect; ANeighbors: TcxNeighbors; ABorders: TcxBorders; + AState: TcxButtonState; AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; + AMultiLine, AShowEndEllipsis: Boolean; const AText: string; AFont: TFont; + ATextColor, ABkColor: TColor; AOnDrawBackground: TcxDrawBackgroundEvent = nil; + AIsLast: Boolean = False; AIsGroup: Boolean = False); +begin + DrawHeaderBorder(ACanvas, ABounds, ANeighbors, ABorders); + DrawContent(ACanvas, HeaderContentBounds(ABounds, ABorders), ATextAreaBounds, Integer(AState), + AAlignmentHorz, AAlignmentVert, AMultiLine, AShowEndEllipsis, AText, + AFont, ATextColor, ABkColor, AOnDrawBackground); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawHeaderEx(ACanvas: TcxCanvas; + const ABounds, ATextAreaBounds: TRect; ANeighbors: TcxNeighbors; ABorders: TcxBorders; + AState: TcxButtonState; AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; + AMultiLine, AShowEndEllipsis: Boolean; const AText: string; AFont: TFont; + ATextColor, ABkColor: TColor; AOnDrawBackground: TcxDrawBackgroundEvent = nil); +begin + DrawHeader(ACanvas, ABounds, ATextAreaBounds, ANeighbors, + ABorders, AState, AAlignmentHorz, AAlignmentVert, AMultiLine, + AShowEndEllipsis, AText, AFont, ATextColor, ABkColor, AOnDrawBackground); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawHeaderBorder(ACanvas: TcxCanvas; + const R: TRect; ANeighbors: TcxNeighbors; ABorders: TcxBorders); +begin +end; + +class procedure TcxCustomLookAndFeelPainter.DrawHeaderPressed(ACanvas: TcxCanvas; + const ABounds: TRect); +begin + ACanvas.InvertRect(ABounds); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawHeaderControlSection(ACanvas: TcxCanvas; + const ABounds, ATextAreaBounds: TRect; ANeighbors: TcxNeighbors; + ABorders: TcxBorders; AState: TcxButtonState; AAlignmentHorz: TAlignment; + AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor); +begin + DrawHeaderControlSectionBorder(ACanvas, ABounds, ABorders, AState); + DrawHeaderControlSectionContent(ACanvas, + HeaderControlSectionContentBounds(ABounds, AState), ATextAreaBounds, AState, + AAlignmentHorz, AAlignmentVert, AMultiLine, AShowEndEllipsis, AText, + AFont, ATextColor, ABkColor); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawHeaderControlSectionBorder( + ACanvas: TcxCanvas; const R: TRect; ABorders: TcxBorders; AState: TcxButtonState); +begin +end; + +class procedure TcxCustomLookAndFeelPainter.DrawHeaderControlSectionContent( + ACanvas: TcxCanvas; const ABounds, ATextAreaBounds: TRect; + AState: TcxButtonState; AAlignmentHorz: TAlignment; + AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor); +begin + ACanvas.SetBrushColor(ABkColor); + ACanvas.FillRect(ABounds); + DrawHeaderControlSectionText(ACanvas, + HeaderControlSectionTextAreaBounds(ATextAreaBounds, AState), AState, AAlignmentHorz, + AAlignmentVert, AMultiLine, AShowEndEllipsis, AText, AFont, ATextColor); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawHeaderControlSectionText( + ACanvas: TcxCanvas; const ATextAreaBounds: TRect; AState: TcxButtonState; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; AMultiLine, + AShowEndEllipsis: Boolean; const AText: string; AFont: TFont; ATextColor: TColor); + + procedure DoDrawText(ATextRect: TRect; ATextColor: TColor); + const + MultiLines: array[Boolean] of Integer = (cxSingleLine, cxWordBreak); + ShowEndEllipsises: array[Boolean] of Integer = (0, cxShowEndEllipsis); + begin + with ACanvas do + begin + if AText <> '' then + begin + Font := AFont; + Font.Color := ATextColor; + DrawText(AText, ATextRect, cxAlignmentsHorz[AAlignmentHorz] or + cxAlignmentsVert[AAlignmentVert] or MultiLines[AMultiLine] or + ShowEndEllipsises[AShowEndEllipsis]); + end; + end; + end; +var + R: TRect; + AColor: TColor; +begin + R := ATextAreaBounds; + ACanvas.Brush.Style := bsClear; + AColor := ATextColor; + if AState = cxbsDisabled then + begin + OffsetRect(R, 1, 1); + DoDrawText(R, clBtnHighlight); + OffsetRect(R, -1, -1); + AColor := clBtnShadow; + end; + DoDrawText(R, AColor); + ACanvas.Brush.Style := bsSolid; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawHeaderSeparator(ACanvas: TcxCanvas; + const ABounds: TRect; AIndentSize: Integer; AColor: TColor; + AViewParams: TcxViewParams); +begin + ACanvas.FillRect(cxRectSetWidth(ABounds, AIndentSize), AViewParams); + ACanvas.Brush.Color := AColor; + ACanvas.FillRect(cxRectInflate(ABounds, -AIndentSize, 0)); + ACanvas.FillRect(cxRectSetLeft(ABounds, ABounds.Right - AIndentSize), AViewParams); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawSortingMark(ACanvas: TcxCanvas; + const R: TRect; AAscendingSorting: Boolean); +begin +end; + +class function TcxCustomLookAndFeelPainter.HeaderBorders(ANeighbors: TcxNeighbors): TcxBorders; +begin + Result := cxBordersAll; +end; + +class function TcxCustomLookAndFeelPainter.HeaderBorderSize: Integer; +begin + Result := 0; +end; + +class function TcxCustomLookAndFeelPainter.HeaderBounds(const ABounds: TRect; + ANeighbors: TcxNeighbors; ABorders: TcxBorders = cxBordersAll): TRect; +begin + Result := ABounds; + ABorders := ABorders - HeaderBorders(ANeighbors); + if bLeft in ABorders then + Dec(Result.Left, HeaderBorderSize); + if bTop in ABorders then + Dec(Result.Top, HeaderBorderSize); + if bRight in ABorders then + Inc(Result.Right, HeaderBorderSize); + if bBottom in ABorders then + Inc(Result.Bottom, HeaderBorderSize); +end; + +class function TcxCustomLookAndFeelPainter.HeaderContentBounds(const ABounds: TRect; + ABorders: TcxBorders): TRect; +begin + Result := ABounds; + if bLeft in ABorders then + Inc(Result.Left, HeaderBorderSize); + if bTop in ABorders then + Inc(Result.Top, HeaderBorderSize); + if bRight in ABorders then + Dec(Result.Right, HeaderBorderSize); + if bBottom in ABorders then + Dec(Result.Bottom, HeaderBorderSize); +end; + +class function TcxCustomLookAndFeelPainter.HeaderDrawCellsFirst: Boolean; +begin + Result := True; +end; + +class function TcxCustomLookAndFeelPainter.HeaderHeight(AFontHeight: Integer): Integer; +begin + Result := AFontHeight + 2 * (HeaderBorderSize + cxHeaderTextOffset); +end; + +class function TcxCustomLookAndFeelPainter.HeaderControlSectionBorderSize( + AState: TcxButtonState = cxbsNormal): Integer; +begin + Result := 1; +end; + +class function TcxCustomLookAndFeelPainter.HeaderControlSectionTextAreaBounds( + ABounds: TRect; AState: TcxButtonState): TRect; +begin + Result := ABounds; + if AState = cxbsPressed then + OffsetRect(Result, 1, 1); +end; + +class function TcxCustomLookAndFeelPainter.HeaderControlSectionContentBounds( + const ABounds: TRect; AState: TcxButtonState): TRect; +begin + Result := ABounds; + InflateRect(Result, -HeaderControlSectionBorderSize(AState), + -HeaderControlSectionBorderSize(AState)); +end; + +class function TcxCustomLookAndFeelPainter.HeaderWidth(ACanvas: TcxCanvas; + ABorders: TcxBorders; const AText: string; AFont: TFont): Integer; +begin + ACanvas.Font := AFont; + Result := ACanvas.TextWidth(AText) + 2 * cxHeaderTextOffset; + if bLeft in ABorders then + Inc(Result, HeaderBorderSize); + if bRight in ABorders then + Dec(Result, HeaderBorderSize); +end; + +class function TcxCustomLookAndFeelPainter.IsHeaderHotTrack: Boolean; +begin + Result := False; +end; + +class function TcxCustomLookAndFeelPainter.SortingMarkAreaSize: TPoint; +begin + Result := Point(SortingMarkAreaWidth, SortingMarkSize.Y); +end; + +class function TcxCustomLookAndFeelPainter.SortingMarkSize: TPoint; +begin + Result := Point(0, 0); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawFooterCell(ACanvas: TcxCanvas; + const ABounds: TRect; AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; + AMultiLine: Boolean; const AText: string; AFont: TFont; ATextColor, ABkColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil); +begin + DrawFooterCellBorder(ACanvas, ABounds); + DrawContent(ACanvas, FooterCellContentBounds(ABounds), FooterCellTextAreaBounds(ABounds), 0, + AAlignmentHorz, AAlignmentVert, AMultiLine, False, AText, AFont, ATextColor, ABkColor, + AOnDrawBackground, True); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawGroupByBox(ACanvas: TcxCanvas; + const ARect: TRect; ATransparent: Boolean; ABackgroundColor: TColor; + const ABackgroundBitmap: TBitmap); +begin + DrawBackground(ACanvas, ARect, ATransparent, ABackgroundColor, ABackgroundBitmap); +end; + +class function TcxCustomLookAndFeelPainter.FooterBorders: TcxBorders; +begin + Result := cxBordersAll; +end; + +class function TcxCustomLookAndFeelPainter.FooterBorderSize: Integer; +begin + Result := 0; +end; + +class function TcxCustomLookAndFeelPainter.FooterCellBorderSize: Integer; +begin + Result := 0; +end; + +class function TcxCustomLookAndFeelPainter.FooterCellOffset: Integer; +begin + Result := 0; +end; + +class function TcxCustomLookAndFeelPainter.FooterDrawCellsFirst: Boolean; +begin + Result := True; +end; + +class function TcxCustomLookAndFeelPainter.FooterSeparatorColor: TColor; +begin + Result := clBtnShadow; +end; + +class function TcxCustomLookAndFeelPainter.FooterSeparatorSize: Integer; +begin + Result := 1; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawFooterBorder(ACanvas: TcxCanvas; const R: TRect); +begin +end; + +class procedure TcxCustomLookAndFeelPainter.DrawFooterCellBorder(ACanvas: TcxCanvas; const R: TRect); +begin +end; + +class procedure TcxCustomLookAndFeelPainter.DrawFooterContent(ACanvas: TcxCanvas; + const ARect: TRect; const AViewParams: TcxViewParams); +begin + if IsRectEmpty(ARect) then Exit; + ACanvas.FillRect(ARect, AViewParams); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawFooterSeparator(ACanvas: TcxCanvas; + const R: TRect); +begin + ACanvas.Brush.Color := FooterSeparatorColor; + ACanvas.FillRect(R); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawFilterActivateButton(ACanvas: TcxCanvas; + R: TRect; AState: TcxButtonState; AChecked: Boolean); +begin + DrawCheckButton(ACanvas, R, AState, AChecked); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawFilterCloseButton(ACanvas: TcxCanvas; + R: TRect; AState: TcxButtonState); +begin + DrawButtonBorder(ACanvas, R, AState); + InflateRect(R, -ButtonBorderSize, -ButtonBorderSize); + ACanvas.Brush.Color := ButtonColor(AState); + ACanvas.FillRect(R); + DrawButtonCross(ACanvas, R, ButtonSymbolColor(AState), ButtonSymbolState(AState)); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawFilterDropDownButton(ACanvas: TcxCanvas; + R: TRect; AState: TcxButtonState; AIsFilterActive: Boolean); +begin +end; + +class procedure TcxCustomLookAndFeelPainter.DrawFilterPanel(ACanvas: TcxCanvas; + const ARect: TRect; ATransparent: Boolean; ABackgroundColor: TColor; + const ABackgroundBitmap: TBitmap); +begin + DrawBackground(ACanvas, ARect, ATransparent, ABackgroundColor, ABackgroundBitmap); +end; + +class function TcxCustomLookAndFeelPainter.FilterActivateButtonSize: TPoint; +begin + Result := Point(FilterActiveButtonWidth, FilterActiveButtonHeight); +end; + +class function TcxCustomLookAndFeelPainter.FilterCloseButtonSize: TPoint; +begin + Result := Point(FilterCloseButtonWidth, FilterCloseButtonHeight); +end; + +class function TcxCustomLookAndFeelPainter.FilterDropDownButtonSize: TPoint; +begin + Result := Point(FilterDropDownButtonWidth, 0); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawWindowContent(ACanvas: TcxCanvas; + const ARect: TRect); +begin + ACanvas.FillRect(ARect, clBtnFace); +end; + +class function TcxCustomLookAndFeelPainter.PopupBorderStyle: TcxPopupBorderStyle; +begin + Result := pbsUltraFlat; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawTab(ACanvas: TcxCanvas; R: TRect; + ABorders: TcxBorders; const AText: string; AState: TcxButtonState; + AVertical: Boolean; AFont: TFont; ATextColor, ABkColor: TColor; AShowPrefix: Boolean = False); +begin +end; + +class procedure TcxCustomLookAndFeelPainter.DrawTabBorder(ACanvas: TcxCanvas; + R: TRect; ABorder: TcxBorder; ABorders: TcxBorders; AVertical: Boolean); +begin +end; + +class procedure TcxCustomLookAndFeelPainter.DrawTabsRoot(ACanvas: TcxCanvas; + const R: TRect; ABorders: TcxBorders; AVertical: Boolean); +begin +end; + +class function TcxCustomLookAndFeelPainter.IsDrawTabImplemented(AVertical: Boolean): Boolean; +begin + Result := False; +end; + +class function TcxCustomLookAndFeelPainter.IsTabHotTrack(AVertical: Boolean): Boolean; +begin + Result := False; +end; + +class function TcxCustomLookAndFeelPainter.TabBorderSize(AVertical: Boolean): Integer; +begin + Result := 0; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawIndicatorItem(ACanvas: TcxCanvas; + const R: TRect; AKind: TcxIndicatorKind; AColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil); +begin + DrawHeader(ACanvas, R, R, [], HeaderBorders([nTop, nBottom]), cxbsNormal, + taLeftJustify, vaTop, False, False, '', nil, clNone, AColor, AOnDrawBackground); + DrawIndicatorImage(ACanvas, R, AKind); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawIndicatorItemEx(ACanvas: TcxCanvas; + const R: TRect; AKind: TcxIndicatorKind; AColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil); +begin + DrawHeaderEx(ACanvas, R, R, [], cxBordersAll, cxbsNormal, + taLeftJustify, vaTop, False, False, '', nil, clNone, AColor, AOnDrawBackground); + DrawIndicatorImage(ACanvas, R, AKind); +end; + +class function TcxCustomLookAndFeelPainter.IndicatorDrawItemsFirst: Boolean; +begin + Result := True; +end; + +class function TcxCustomLookAndFeelPainter.ScrollBarMinimalThumbSize( + AVertical: Boolean): Integer; +begin + Result := cxStdThumbnailMinimalSize; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawScrollBarPart(ACanvas: TcxCanvas; + AHorizontal: Boolean; R: TRect; APart: TcxScrollBarPart; AState: TcxButtonState); +begin +end; + +class function TcxCustomLookAndFeelPainter.SizeGripSize: TSize; +begin + Result := Size(GetSystemMetrics(SM_CXVSCROLL), + GetSystemMetrics(SM_CYHSCROLL)); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawSizeGrip(ACanvas: TcxCanvas; + const ARect: TRect; ABackgroundColor: TColor = clDefault); +begin + ACanvas.FillRect(ARect, ABackgroundColor); + DrawFrameControl(ACanvas.Handle, ARect, DFC_SCROLL, DFCS_SCROLLSIZEGRIP); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawMonthHeader(ACanvas: TcxCanvas; + const ABounds: TRect; const AText: string; ANeighbors: TcxNeighbors; + const AViewParams: TcxViewParams; AArrows: TcxHeaderArrows; + ASideWidth: Integer; AOnDrawBackground: TcxDrawBackgroundEvent = nil); +begin + DrawHeader(ACanvas, ABounds, ABounds, ANeighbors, HeaderBorders(ANeighbors), + cxbsNormal, taCenter, vaCenter, False, False, AText, AViewParams.Font, + AViewParams.TextColor, AViewParams.Color, AOnDrawBackground); + DrawMonthHeaderArrows(ACanvas, ABounds, AArrows, ASideWidth, clWindowText); +end; + +class procedure TcxCustomLookAndFeelPainter.CalculateSchedulerNavigationButtonRects( + AIsNextButton: Boolean; ACollapsed: Boolean; APrevButtonTextSize: TSize; + ANextButtonTextSize: TSize; var ABounds: TRect; out ATextRect: TRect; + out AArrowRect: TRect); +const + cxTextOffset = 5; +var + AArrowSize: TSize; + AArrowZoneHeight: Integer; + ABorders: TRect; + AContent: TRect; + ADelta: Integer; +begin + SchedulerNavigationButtonSizes(AIsNextButton, ABorders, AArrowSize); + AArrowZoneHeight := 3 * AArrowSize.cy; + if ACollapsed then + begin + ATextRect := cxNullRect; + with ABorders do + begin + ABounds.Top := (ABounds.Top + ABounds.Bottom - Top - Bottom - AArrowZoneHeight) div 2; + ABounds.Bottom := ABounds.Top + AArrowZoneHeight + Bottom + Top; + end; + AArrowRect := cxRectCenter(ABounds, AArrowSize); + end + else + begin + AContent := cxRectContent(ABounds, ABorders); + AArrowRect := cxRectCenter(cxRectSetHeight(AContent, AArrowZoneHeight), AArrowSize); + ATextRect := AContent; + Inc(ATextRect.Top, AArrowZoneHeight + cxTextOffset); + Dec(ATextRect.Bottom, 2 * AArrowSize.cy); + ADelta := Max(ANextButtonTextSize.cx, APrevButtonTextSize.cx) - + (ATextRect.Bottom - ATextRect.Top); + if ADelta > 0 then + begin + OffsetRect(AArrowRect, 0, -ADelta); + InflateRect(ATextRect, 0, ADelta); + InflateRect(ABounds, 0, ADelta); + end; + end; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawSchedulerBorder( + ACanvas: TcxCanvas; R: TRect); +begin + DrawBorder(ACanvas, R); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawSchedulerEventProgress( + ACanvas: TcxCanvas; const ABounds, AProgress: TRect; AViewParams: TcxViewParams; + ATransparent: Boolean); +begin + if ATransparent then + ACanvas.FrameRect(ABounds, clGray) + else + ACanvas.FillRect(ABounds, AViewParams, cxBordersAll, clGray); + ACanvas.FillRect(AProgress, clNavy); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawSchedulerNavigationButton( + ACanvas: TcxCanvas; const ARect: TRect; AIsNextButton: Boolean; + AState: TcxButtonState; const AText: string; const ATextRect: TRect; + const AArrowRect: TRect); +var + ABitmap: TcxBitmap; + R: TRect; + + function RotateTextRect(const ATextRect: TRect): TRect; + begin + Result.Left := ARect.Bottom - ATextRect.Bottom; + Result.Top := ATextRect.Left - ARect.Left; + Result.Right := Result.Left + ATextRect.Bottom - ATextRect.Top; + Result.Bottom := Result.Top + ATextRect.Right - ATextRect.Left; + end; + +begin + if IsRectEmpty(ATextRect) then + DrawSchedulerNavigationButtonContent(ACanvas, ARect, AArrowRect, AIsNextButton, AState) + else + begin + ABitmap := TcxBitmap.CreateSize(ARect); + try + BitBlt(ABitmap.Canvas.Handle, 0, 0, ARect.Right - ARect.Left, + ARect.Bottom - ARect.Top, ACanvas.Handle, ARect.Left, ARect.Top, SRCCOPY); + DrawSchedulerNavigationButtonContent(ABitmap.cxCanvas, + cxRectOffset(ARect, -ARect.Left, -ARect.Top), + cxRectOffset(AArrowRect, -ARect.Left, -ARect.Top), AIsNextButton, AState); + ABitmap.Rotate(raMinus90); + with ABitmap.Canvas do + begin + Brush.Style := bsClear; + Font.Assign(ACanvas.Font); + Font.Color := ButtonSymbolColor(AState, Font.Color); + R := RotateTextRect(ATextRect); + cxDrawText(Handle, AText, R, DT_CENTER or DT_VCENTER or DT_SINGLELINE); + end; + ABitmap.Rotate(raPlus90); + BitBlt(ACanvas.Handle, ARect.Left, ARect.Top, ARect.Right - ARect.Left, + ARect.Bottom - ARect.Top, ABitmap.Canvas.Handle, 0, 0, SRCCOPY); + finally + ABitmap.Free; + end; + end; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawSchedulerNavigationButtonArrow( + ACanvas: TcxCanvas; const ARect: TRect; AIsNextButton: Boolean; AColor: TColor); +const + ASigns: array[Boolean] of Integer = (-1, 1); +var + ACount: Integer; + I: Integer; + R1, R2: TRect; +begin + ACanvas.Brush.Color := AColor; + ACount := (ARect.Bottom - ARect.Top) div 2 + Integer(Odd(ARect.Bottom - ARect.Top)); + with ARect do + if AIsNextButton then + begin + R1 := Rect(Left, Top, Left + 2, Top + 1); + R2 := Rect(Left, Bottom - 1, Left + 2, Bottom); + end + else + begin + R1 := Rect(Right - 2, Top, Right, Top + 1); + R2 := Rect(Right - 2, Bottom - 1, Right, Bottom); + end; + + for I := 0 to ACount - 1 do + begin + ACanvas.FillRect(R1); + OffsetRect(R1, ASigns[AIsNextButton], 1); + ACanvas.FillRect(R2); + OffsetRect(R2, ASigns[AIsNextButton], -1); + end; + + if AIsNextButton then + ACanvas.FillRect(cxRectSetLeft(ARect, ARect.Right - 1, 1)) + else + ACanvas.FillRect(cxRectSetRight(ARect, ARect.Left + 1, 1)); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawSchedulerNavigationButtonContent( + ACanvas: TcxCanvas; const ARect: TRect; const AArrowRect: TRect; + AIsNextButton: Boolean; AState: TcxButtonState); +const + Borders: array[Boolean] of TcxBorders = + ([bRight, bTop, bBottom], [bLeft, bTop, bBottom]); + BottomRightColors: array[Boolean] of TColor = + (clBtnFace, clBtnHighlight); + TopLeftColors: array[Boolean] of TColor = + (clBtnHighlight, clBtnShadow); +var + R: TRect; +begin + R := ARect; + ACanvas.FillRect(R, clBtnFace); + ACanvas.DrawComplexFrame(R, clBtnShadow, clBtnShadow, Borders[AIsNextButton]); + InflateRect(R, 0, -1); + if AIsNextButton then + Inc(R.Left) + else + Dec(R.Right); + ACanvas.DrawComplexFrame(R, TopLeftColors[AState = cxbsPressed], + BottomRightColors[AState = cxbsPressed], Borders[AIsNextButton]); + DrawSchedulerNavigationButtonArrow(ACanvas, AArrowRect, AIsNextButton, + ButtonSymbolColor(AState)); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawSchedulerNavigatorButton( + ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); +begin + DrawButton(ACanvas, R, '', AState); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawSchedulerSplitterBorder( + ACanvas: TcxCanvas; R: TRect; const AViewParams: TcxViewParams; AIsHorizontal: Boolean); +begin +end; + +class procedure TcxCustomLookAndFeelPainter.SchedulerNavigationButtonSizes( + AIsNextButton: Boolean; var ABorders: TRect; var AArrowSize: TSize); +const + AButtonBorders: array[Boolean] of TRect = + ((Left: 0; Top: 6; Right: 2; Bottom: 6), + (Left: 2; Top: 6; Right: 0; Bottom: 6)); +begin + ABorders := AButtonBorders[AIsNextButton]; + AArrowSize.cx := 7; + AArrowSize.cy := 7; +end; + +class function TcxCustomLookAndFeelPainter.SchedulerEventProgressOffsets: TRect; +begin + Result := Rect(2, 2, 2, 2); +end; + +class function TcxCustomLookAndFeelPainter.ChartToolBoxDataLevelInfoBorderSize: Integer; +begin + Result := 1; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawClock(ACanvas: TcxCanvas; + const ARect: TRect; ADateTime: TDateTime; ABackgroundColor: TColor); + + procedure DrawDot(X, Y: Integer; AHourDot: Boolean); + begin + if AHourDot then + begin + ACanvas.Pixels[X, Y] := clTeal; + ACanvas.Pen.Color := clAqua; + ACanvas.Polyline([Point(X - 1, Y + 1), Point(X - 1, Y - 1), Point(X, Y - 1)]); + ACanvas.Pen.Color := clBtnText; + ACanvas.Polyline([Point(X, Y + 1), Point(X + 1, Y + 1), Point(X + 1, Y - 1)]); + ACanvas.ExcludeClipRect(Rect(X - 1, Y - 1, X + 2, Y + 2)); + end; + end; + + procedure DrawHand(ACenter: TPoint; AAngle, L1X, L1Y, L2X, L2Y, L3: Extended); + begin + with ACanvas.Canvas do + begin + Brush.Color := clTeal; + BeginPath(Handle); + Pixels[Round(ACenter.X + L1X * cos(AAngle)), + Round(ACenter.Y + L1Y * sin(AAngle))] := clTeal; + Pen.Color := clTeal; + MoveTo(Round(ACenter.X + L1X * cos(AAngle)), + Round(ACenter.Y + L1Y * sin(AAngle))); + LineTo(Round(ACenter.X + L3 / 2 * cos(AAngle + Pi / 2)), + Round(ACenter.Y + L3 / 2 * sin(AAngle + Pi / 2))); + LineTo(Round(ACenter.X + L2X * cos(AAngle + Pi)), + Round(ACenter.Y + L2Y * sin(AAngle + Pi))); + LineTo(Round(ACenter.X + L3 / 2 * cos(AAngle + Pi * 3 / 2)), + Round(ACenter.Y + L3 / 2 * sin(AAngle + Pi * 3 / 2))); + LineTo(Round(ACenter.X + L1X * cos(AAngle)), + Round(ACenter.Y + L1Y * sin(AAngle))); + EndPath(Handle); + FillPath(Handle); + end; + end; + + procedure DrawHands; + var + AAngle: Extended; + ACenter: TPoint; + AHandRadiusX, AHandRadiusY: Extended; + AHour, AMin, AMSec, ASec: Word; + begin + DecodeTime(ADateTime, AHour, AMin, ASec, AMSec); + ACenter.X := (ARect.Right + ARect.Left) div 2; + ACenter.Y := (ARect.Bottom + ARect.Top) div 2; + AHandRadiusX := (ARect.Right - ARect.Left) / 2 - 2; + AHandRadiusY := (ARect.Bottom - ARect.Top) / 2 - 2; + with ACanvas.Canvas do + begin + AAngle := Pi * 2 * ((AHour mod 12) * 60 * 60 + AMin * 60 + ASec - 3 * 60 * 60) / 12 / 60 / 60; + DrawHand(ACenter, AAngle, AHandRadiusX * 0.75, AHandRadiusY * 0.75, + AHandRadiusX * 0.15, AHandRadiusY * 0.15, 9); + + AAngle := Pi * 2 * (AMin * 60 + ASec - 15 * 60) / 60 / 60; + DrawHand(ACenter, AAngle, AHandRadiusX * 0.85, AHandRadiusY * 0.85, + AHandRadiusX * 0.2, AHandRadiusY * 0.2, 7); + + Pen.Color := clRed; + MoveTo(ACenter.X, ACenter.Y); + AAngle := Pi * 2 * (ASec - 15) / 60; + LineTo(Round(ACenter.X + AHandRadiusX * 0.9 * cos(AAngle)), + Round(ACenter.Y + AHandRadiusY * 0.9 * sin(AAngle))); + end; + end; + +var + AAngle: Extended; + ACenter: TPoint; + I: Integer; + RX, RY: Extended; +begin + ACenter.X := (ARect.Right + ARect.Left) div 2; + ACenter.Y := (ARect.Bottom + ARect.Top) div 2; + RX := (ARect.Right - ARect.Left) / 2 - 2; + RY := (ARect.Bottom - ARect.Top) / 2 - 2; + for I := 0 to 59 do + begin + AAngle := 2 * Pi * I / 60; + DrawDot(Round(ACenter.X + RX * cos(AAngle)), Round(ACenter.Y + RY * sin(AAngle)), I mod 5 = 0); + end; + with ACanvas do + FillRect(ARect, ABackgroundColor); + DrawHands; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawEditorButton(ACanvas: TcxCanvas; + const ARect: TRect; AButtonKind: TcxEditBtnKind; AState: TcxButtonState); +begin + +end; + +class function TcxCustomLookAndFeelPainter.EditButtonTextOffset: Integer; +begin + Result := 0; +end; + +class function TcxCustomLookAndFeelPainter.EditButtonSize: TSize; +begin + Result := Size(0, 0); +end; + +class function TcxCustomLookAndFeelPainter.EditButtonTextColor: TColor; +begin + Result := clDefault; +end; + +class function TcxCustomLookAndFeelPainter.GetContainerBorderColor( + AIsHighlightBorder: Boolean): TColor; +begin + Result := clDefault; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawNavigatorGlyph(ACanvas: TcxCanvas; + AImageList: TCustomImageList; AImageIndex: TImageIndex; AButtonIndex: Integer; + const AGlyphRect: TRect; AEnabled: Boolean; AUserGlyphs: Boolean); +begin + if AImageList <> nil then + AImageList.Draw(ACanvas.Canvas, AGlyphRect.Left, AGlyphRect.Top, + AImageIndex, AEnabled); // ??? itMask TODO +end; + +class function TcxCustomLookAndFeelPainter.NavigatorGlyphSize: TSize; +begin + Result := Size(0, 0); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawProgressBarChunk(ACanvas: TcxCanvas; + ARect: TRect; AVertical: Boolean); +begin +end; + +class procedure TcxCustomLookAndFeelPainter.DrawProgressBarBorder(ACanvas: TcxCanvas; + ARect: TRect; AVertical: Boolean); +begin +end; + +class function TcxCustomLookAndFeelPainter.ProgressBarBorderSize(AVertical: Boolean): TRect; +begin + Result := cxEmptyRect; +end; + +class function TcxCustomLookAndFeelPainter.ProgressBarTextColor: TColor; +begin + Result := clDefault; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawGroupBoxBackground(ACanvas: TcxCanvas; + ABounds: TRect; ARect: TRect); +begin +end; + +class procedure TcxCustomLookAndFeelPainter.DrawGroupBoxCaption(ACanvas: TcxCanvas; + ACaptionRect: TRect; ACaptionPosition: TcxGroupBoxCaptionPosition); +begin +end; + +class procedure TcxCustomLookAndFeelPainter.DrawGroupBoxContent(ACanvas: TcxCanvas; + ABorderRect: TRect; ACaptionPosition: TcxGroupBoxCaptionPosition); +begin +end; + +class function TcxCustomLookAndFeelPainter.GroupBoxBorderSize(ACaption: Boolean; + ACaptionPosition: TcxGroupBoxCaptionPosition): TRect; +begin + Result := cxEmptyRect; +end; + +class function TcxCustomLookAndFeelPainter.GroupBoxTextColor( + ACaptionPosition: TcxGroupBoxCaptionPosition): TColor; +begin + Result := clDefault; +end; + +class function TcxCustomLookAndFeelPainter.IsGroupBoxTransparent(AIsCaption: Boolean; + ACaptionPosition: TcxGroupBoxCaptionPosition): Boolean; +begin + Result := False; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawPanelBorders(ACanvas: TcxCanvas; + const ABorderRect: TRect); +begin +end; + +class procedure TcxCustomLookAndFeelPainter.DrawPanelCaption( + ACanvas: TcxCanvas; const ACaptionRect: TRect; + ACaptionPosition: TcxGroupBoxCaptionPosition); +begin + DrawGroupBoxCaption(ACanvas, ACaptionRect, ACaptionPosition); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawPanelBackground(ACanvas: TcxCanvas; AControl: TWinControl; ABounds: TRect; + AColorFrom: TColor = clDefault; AColorTo: TColor = clDefault); +begin + DrawGroupBoxBackground(ACanvas, ABounds, ABounds); +end; + +class procedure TcxCustomLookAndFeelPainter.DrawPanelContent( + ACanvas: TcxCanvas; const ABorderRect: TRect; ABorder: Boolean); +begin +end; + +class function TcxCustomLookAndFeelPainter.PanelBorderSize: TRect; +begin + Result := cxEmptyRect; +end; + +class function TcxCustomLookAndFeelPainter.PanelTextColor: TColor; +begin + Result := clDefault; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawTrackBar(ACanvas: TcxCanvas; + const ARect: TRect; const ASelection: TRect; AShowSelection: Boolean; + AEnabled: Boolean; AHorizontal: Boolean); +begin +end; + +class procedure TcxCustomLookAndFeelPainter.DrawTrackBarThumb(ACanvas: TcxCanvas; + ARect: TRect; AState: TcxButtonState; AHorizontal: Boolean; + ATicks: TcxTrackBarTicksAlign); +begin +end; + +class function TcxCustomLookAndFeelPainter.TrackBarThumbSize(AHorizontal: Boolean): TSize; +begin + Result := Size(0, 0); +end; + +class function TcxCustomLookAndFeelPainter.TrackBarTicksColor(AText: Boolean): TColor; +begin + Result := clDefault; +end; + +class function TcxCustomLookAndFeelPainter.TrackBarTrackSize: Integer; +begin + Result := 0; +end; + +class procedure TcxCustomLookAndFeelPainter.DrawSplitter(ACanvas: TcxCanvas; + const ARect: TRect; AHighlighted: Boolean; AClicked: Boolean; AHorizontal: Boolean); +begin + +end; + +class function TcxCustomLookAndFeelPainter.GetSplitterSize(AHorizontal: Boolean): TSize; +begin + Result := Size(0, 0); +end; + +{ TcxStandardLookAndFeelPainter } + +class function TcxStandardLookAndFeelPainter.LookAndFeelStyle: TcxLookAndFeelStyle; +begin + Result := lfsStandard; +end; + +class function TcxStandardLookAndFeelPainter.BorderSize: Integer; +begin + Result := 2; +end; + +class procedure TcxStandardLookAndFeelPainter.DrawBorder(ACanvas: TcxCanvas; R: TRect); +begin + ACanvas.DrawComplexFrame(R, clBtnShadow, clBtnHighlight); + InflateRect(R, -1, -1); + ACanvas.DrawComplexFrame(R, cl3DDkShadow, cl3DLight); +end; + +class function TcxStandardLookAndFeelPainter.ButtonBorderSize(AState: TcxButtonState = cxbsNormal): Integer; +begin + if AState = cxbsDefault then Result := 3 else Result := 2; +end; + +class function TcxStandardLookAndFeelPainter.ButtonTextOffset: Integer; +begin + Result := 1; +end; + +class function TcxStandardLookAndFeelPainter.ButtonTextShift: Integer; +begin + Result := 1; +end; + +class procedure TcxStandardLookAndFeelPainter.DrawButtonBorder(ACanvas: TcxCanvas; R: TRect; + AState: TcxButtonState); +begin + if AState <> cxbsPressed then + begin + if AState = cxbsDefault then + begin + ACanvas.FrameRect(R, clBlack); + InflateRect(R, -1, -1); + end; + ACanvas.DrawComplexFrame(R, clBtnHighlight, cl3DDkShadow); + InflateRect(R, -1, -1); + ACanvas.DrawComplexFrame(R, cl3DLight, clBtnShadow); + end + else + begin + ACanvas.FrameRect(R, clBlack); + InflateRect(R, -1, -1); + ACanvas.DrawComplexFrame(R, clBtnShadow, clBtnShadow); + end; +end; + +class procedure TcxStandardLookAndFeelPainter.DrawGroupExpandButton(ACanvas: TcxCanvas; + const R: TRect; AExpanded: Boolean; AState: TcxButtonState); +begin + TcxFlatLookAndFeelPainter.DrawGroupExpandButton(ACanvas, R, AExpanded, AState); +end; + +class function TcxStandardLookAndFeelPainter.ExpandButtonSize: Integer; +begin + Result := 12; +end; + +class procedure TcxStandardLookAndFeelPainter.DrawExpandButton(ACanvas: TcxCanvas; + const R: TRect; AExpanded: Boolean; AColor: TColor = clDefault); +var + ARect: TRect; + + procedure DrawButton; + begin + ACanvas.DrawEdge(ARect, False, False, [bLeft, bTop]); + ACanvas.DrawEdge(ARect, False, True, [bRight, bBottom]); + InflateRect(ARect, -1, -1); + ACanvas.DrawEdge(ARect, False, False, [bRight, bBottom]); + Dec(ARect.Right); + Dec(ARect.Bottom); + if AColor = clDefault then + ACanvas.Brush.Color := clBtnFace + else + ACanvas.Brush.Color := AColor; + ACanvas.FillRect(ARect); + end; + +begin + ARect := R; + DrawButton; + DrawExpandButtonCross(ACanvas, ARect, AExpanded, clBtnText); + ACanvas.ExcludeClipRect(R); +end; + +class function TcxStandardLookAndFeelPainter.IsButtonHotTrack: Boolean; +begin + Result := False; +end; + +class procedure TcxStandardLookAndFeelPainter.DrawCheckBorder(ACanvas: TcxCanvas; R: TRect; + AState: TcxButtonState); +begin + ACanvas.DrawEdge(R, True, False{True}); + InflateRect(R, -1, -1); + ACanvas.DrawEdge(R, True, True{False}); +end; + +class procedure TcxStandardLookAndFeelPainter.DrawHeaderBorder(ACanvas: TcxCanvas; + const R: TRect; ANeighbors: TcxNeighbors; ABorders: TcxBorders); +var + I: TcxNeighbor; +begin + with ACanvas do + begin + DrawEdge(R, False, False); + for I := Low(I) to High(I) do + if I in ANeighbors then + case I of + nLeft: + begin + Pixels[R.Left, R.Top + 1] := clBtnFace; //!!! + Pixels[R.Left, R.Bottom - 2] := clBtnFace; //!!! + end; + nRight: + begin + Pixels[R.Right - 1, R.Top] := clBtnHighlight; + Pixels[R.Right - 1, R.Top + 1] := clBtnFace; //!!! + Pixels[R.Right - 1, R.Bottom - 2] := clBtnFace; //!!! + end; + nTop:; + nBottom:; + end; + end; +end; + +class procedure TcxStandardLookAndFeelPainter.DrawHeaderControlSectionBorder( + ACanvas: TcxCanvas; const R: TRect; + ABorders: TcxBorders; AState: TcxButtonState); +var + ARect: TRect; +begin + ARect := R; + if AState <> cxbsPressed then + begin + ACanvas.DrawComplexFrame(ARect, clBtnHighlight, + cl3DDkShadow, ABorders); + InflateRect(ARect, -1, -1); + ACanvas.DrawComplexFrame(ARect, cl3DLight, clBtnShadow, ABorders); + end + else + ACanvas.DrawComplexFrame(ARect, clBtnShadow, clBtnShadow, ABorders); +end; + +class procedure TcxStandardLookAndFeelPainter.DrawSortingMark(ACanvas: TcxCanvas; + const R: TRect; AAscendingSorting: Boolean); +begin + DrawSortingArrow(ACanvas, R, clBtnShadow, clBtnHighlight, AAscendingSorting); +end; + +class function TcxStandardLookAndFeelPainter.HeaderBorderSize: Integer; +begin + Result := 1; +end; + +class function TcxStandardLookAndFeelPainter.HeaderControlSectionBorderSize( + AState: TcxButtonState = cxbsNormal): Integer; +begin + if AState = cxbsPressed then + Result := 1 + else + Result := 2; +end; + +class function TcxStandardLookAndFeelPainter.SortingMarkSize: TPoint; +begin + Result := Point(8, 7); +end; + +class function TcxStandardLookAndFeelPainter.FooterBorderSize: Integer; +begin + Result := 1; +end; + +class function TcxStandardLookAndFeelPainter.FooterCellBorderSize: Integer; +begin + Result := 1; +end; + +class function TcxStandardLookAndFeelPainter.FooterCellOffset: Integer; +begin + Result := 1; +end; + +class procedure TcxStandardLookAndFeelPainter.DrawFooterBorder(ACanvas: TcxCanvas; const R: TRect); +begin + ACanvas.DrawEdge(R, False, False); +end; + +class procedure TcxStandardLookAndFeelPainter.DrawFooterCellBorder(ACanvas: TcxCanvas; const R: TRect); +begin + ACanvas.DrawEdge(R, True, True); +end; + +class procedure TcxStandardLookAndFeelPainter.DrawFilterDropDownButton(ACanvas: TcxCanvas; R: TRect; + AState: TcxButtonState; AIsFilterActive: Boolean); + + class function GetArrowColor: TColor; + begin + if AIsFilterActive then + Result := ActiveFilterButtonArrowColor + else + Result := clBtnText; + end; + +begin + if AState <> cxbsPressed then + ACanvas.DrawEdge(R, False, False) + else + ACanvas.DrawEdge(R, True, True); + InflateRect(R, -1, -1); + ACanvas.Brush.Color := clBtnFace; + ACanvas.FillRect(R); + DrawButtonArrow(ACanvas, R, GetArrowColor); +end; + +class procedure TcxStandardLookAndFeelPainter.DrawTabBorder(ACanvas: TcxCanvas; R: TRect; + ABorder: TcxBorder; ABorders: TcxBorders; AVertical: Boolean); +const + Colors: array[Boolean] of TColor = (clBtnShadow, clBtnHighlight); + + procedure ProcessVerticalTabBorder; + begin + case ABorder of + bLeft: + begin + Inc(R.Top); + if bTop in ABorders then Inc(R.Top); + Dec(R.Bottom); + if bBottom in ABorders then Dec(R.Bottom); + end; + bTop, bBottom: + if bLeft in ABorders then Inc(R.Left); + end; + if ABorder = bLeft then + begin + ACanvas.Pixels[R.Left + 1, R.Top - 1] := Colors[True]; + ACanvas.Pixels[R.Left + 1, R.Bottom] := Colors[True]; + end; + ACanvas.Brush.Color := Colors[ABorder <> bBottom]; + end; + + procedure ProcessHorizontalTabBorder; + begin + case ABorder of + bTop: + begin + Inc(R.Left); + Dec(R.Right); + end; + bLeft, bRight: + begin + if bTop in ABorders then Inc(R.Top, 2); + if bBottom in ABorders then Dec(R.Bottom); + end; + end; + if ABorder = bTop then + begin + ACanvas.Pixels[R.Left - 1, R.Top + 1] := Colors[True]; + ACanvas.Pixels[R.Right, R.Top + 1] := Colors[True]; + end; + ACanvas.Brush.Color := Colors[ABorder <> bRight]; + end; + +begin + if AVertical then + ProcessVerticalTabBorder + else + ProcessHorizontalTabBorder; + ACanvas.FillRect(R); +end; + +class procedure TcxStandardLookAndFeelPainter.DrawTabsRoot(ACanvas: TcxCanvas; const R: TRect; + ABorders: TcxBorders; AVertical: Boolean); +begin + ACanvas.DrawEdge(R, False, False, ABorders); +end; + +class function TcxStandardLookAndFeelPainter.TabBorderSize(AVertical: Boolean): Integer; +begin + Result := 1; +end; + +class procedure TcxStandardLookAndFeelPainter.DrawScrollBarPart(ACanvas: TcxCanvas; + AHorizontal: Boolean; R: TRect; APart: TcxScrollBarPart; AState: TcxButtonState); + + function GetArrowState: Integer; + const + States: array[Boolean, Boolean] of Integer = ((DFCS_SCROLLUP, DFCS_SCROLLDOWN), + (DFCS_SCROLLLEFT, DFCS_SCROLLRIGHT)); + begin + Result := States[AHorizontal, APart = sbpLineDown]; + if AState = cxbsDisabled then Result := Result or DFCS_INACTIVE + else if AState = cxbsPressed then Result := Result or DFCS_FLAT; + end; + + procedure DrawScrollBarButtonBorder(R: TRect); + begin + if (AState <> cxbsPressed) or (APart = sbpThumbnail) then + begin + ACanvas.DrawComplexFrame(R, clBtnFace, cl3DDkShadow); + InflateRect(R, -1, -1); + ACanvas.DrawComplexFrame(R, clBtnHighlight, clBtnShadow); + end + else + begin + ACanvas.DrawComplexFrame(R, clBtnShadow, clBtnShadow); + InflateRect(R, -1, -1); + ACanvas.DrawComplexFrame(R, clBtnFace, clBtnFace); + end; + end; + +begin + if IsRectEmpty(R) or ((APart = sbpThumbnail) and (AState = cxbsDisabled)) then Exit; + if AState = cxbsHot then AState := cxbsNormal; + case APart of + sbpThumbnail, sbpLineUp, sbpLineDown: + begin + // for compatibility with standard painting + if APart <> sbpThumbnail then + begin + if AState = cxbsPressed then OffsetRect(R, 1, 1); + DrawFrameControl(ACanvas.Canvas.Handle, R, DFC_SCROLL, GetArrowState); + if AState = cxbsPressed then OffsetRect(R, -1, -1); + DrawScrollBarButtonBorder(R); + end + else + begin + DrawScrollBarButtonBorder(R); + InflateRect(R, -ButtonBorderSize, -ButtonBorderSize); + ACanvas.Brush.Color := clBtnFace; + ACanvas.FillRect(R); + end; + end; + sbpPageUp, sbpPageDown: + begin + ACanvas.Brush.Bitmap := StdScrollBitmaps[AState = cxbsPressed]; + ACanvas.FillRect(R); + ACanvas.Brush.Bitmap := nil; + ACanvas.Brush.Style := bsSolid; + end; + end; +end; + +class procedure TcxStandardLookAndFeelPainter.DrawMonthHeader(ACanvas: TcxCanvas; + const ABounds: TRect; const AText: string; ANeighbors: TcxNeighbors; + const AViewParams: TcxViewParams; AArrows: TcxHeaderArrows; + ASideWidth: Integer; AOnDrawBackground: TcxDrawBackgroundEvent = nil); +const + Borders: array[Boolean, Boolean] of TcxBorders = + ((cxBordersAll, [bTop, bBottom, bLeft]), ([bTop, bBottom, bRight], [bTop, bBottom])); +var + ABorders: TcxBorders; + R: TRect; +begin + ABorders := Borders[nLeft in ANeighbors, nRight in ANeighbors]; + ACanvas.FrameRect(ABounds, clBlack, 1, ABorders); + R := HeaderContentBounds(ABounds, ABorders); + DrawHeader(ACanvas, R, R, ANeighbors, cxBordersAll, cxbsNormal, taCenter, + vaCenter, False, False, AText, AViewParams.Font, AViewParams.TextColor, + AViewParams.Color, AOnDrawBackground); + DrawMonthHeaderArrows(ACanvas, ABounds, AArrows, ASideWidth, clWindowText); +end; + +class function TcxStandardLookAndFeelPainter.DefaultSchedulerViewContentColor: TColor; +begin + Result := clWindow; +end; + +class procedure TcxStandardLookAndFeelPainter.DrawSchedulerSplitterBorder( + ACanvas: TcxCanvas; R: TRect; const AViewParams: TcxViewParams; + AIsHorizontal: Boolean); + + procedure DrawHorzBorders(const R: TRect; ATopColor, ABottomColor: TColor); + begin + ACanvas.SetBrushColor(ATopColor); + ACanvas.FillRect(Rect(R.Left, R.Top, R.Right, R.Top + 1)); + ACanvas.SetBrushColor(ABottomColor); + ACanvas.FillRect(Rect(R.Left, R.Bottom - 1, R.Right, R.Bottom)); + end; + + procedure DrawVertBorders(const R: TRect; ALeftColor, ARightColor: TColor); + begin + ACanvas.SetBrushColor(ALeftColor); + ACanvas.FillRect(Rect(R.Left, R.Top, R.Left + 1, R.Bottom)); + ACanvas.SetBrushColor(ARightColor); + ACanvas.FillRect(Rect(R.Right - 1, R.Top, R.Right, R.Bottom)); + end; + +begin + if AIsHorizontal then + begin + DrawHorzBorders(R, clBtnFace, cl3DDkShadow); + InflateRect(R, 1, -1); + DrawHorzBorders(R, clBtnHighlight, clBtnShadow); + InflateRect(R, 1, -1); + end + else + begin + DrawVertBorders(R, clBtnFace, cl3DDkShadow); + InflateRect(R, -1, 1); + DrawVertBorders(R, clBtnHighlight, clBtnShadow); + InflateRect(R, -1, 1); + end; + ACanvas.FillRect(R, AViewParams); +end; + +{ TcxFlatLookAndFeelPainter } + +class function TcxFlatLookAndFeelPainter.LookAndFeelStyle: TcxLookAndFeelStyle; +begin + Result := lfsFlat; +end; + +class function TcxFlatLookAndFeelPainter.BorderSize: Integer; +begin + Result := 1; +end; + +class procedure TcxFlatLookAndFeelPainter.DrawBorder(ACanvas: TcxCanvas; R: TRect); +begin + ACanvas.DrawEdge(R, True, True); +end; + +class function TcxFlatLookAndFeelPainter.ButtonBorderSize(AState: TcxButtonState = cxbsNormal): Integer; +begin + if AState = cxbsDefault then Result := 2 else Result := 1; +end; + +class function TcxFlatLookAndFeelPainter.ButtonTextOffset: Integer; +begin + Result := 1; +end; + +class function TcxFlatLookAndFeelPainter.ButtonTextShift: Integer; +begin + Result := 1; +end; + +class procedure TcxFlatLookAndFeelPainter.DrawButtonBorder(ACanvas: TcxCanvas; R: TRect; + AState: TcxButtonState); +begin + if AState <> cxbsPressed then + begin + if AState = cxbsDefault then + begin + ACanvas.FrameRect(R, clBlack); + InflateRect(R, -1, -1); + end; + ACanvas.DrawComplexFrame(R, clBtnHighlight, clBtnShadow) + end + else + ACanvas.DrawComplexFrame(R, clBtnShadow, clBtnHighlight); +end; + +class procedure TcxFlatLookAndFeelPainter.DrawExpandButton(ACanvas: TcxCanvas; + const R: TRect; AExpanded: Boolean; AColor: TColor = clDefault); +var + ARect: TRect; +begin + ARect := R; + DrawButton(ACanvas, ARect, '', cxbsNormal, True, AColor); + InflateRect(ARect, -1, -1); + DrawExpandButtonCross(ACanvas, ARect, AExpanded, clBtnText); + ACanvas.ExcludeClipRect(R); +end; + +class function TcxFlatLookAndFeelPainter.ExpandButtonSize: Integer; +begin + Result := 11; +end; + +class function TcxFlatLookAndFeelPainter.IsButtonHotTrack: Boolean; +begin + Result := False; +end; + +class procedure TcxFlatLookAndFeelPainter.DrawCheckBorder(ACanvas: TcxCanvas; R: TRect; + AState: TcxButtonState); +begin + ACanvas.DrawEdge(R, True, True); + InflateRect(R, -1, -1); + ACanvas.FrameRect(R, CheckButtonColor(AState)); +end; + +class procedure TcxFlatLookAndFeelPainter.DrawHeaderBorder(ACanvas: TcxCanvas; + const R: TRect; ANeighbors: TcxNeighbors; ABorders: TcxBorders); +var + I: TcxNeighbor; +begin + with ACanvas do + begin + DrawEdge(R, False, False); + for I := Low(I) to High(I) do + if I in ANeighbors then + case I of + nLeft: + begin + Pixels[R.Left, R.Top + 1] := clBtnFace; //!!! + Pixels[R.Left, R.Bottom - 2] := clBtnFace; //!!! + end; + nRight: + begin + Pixels[R.Right - 1, R.Top] := clBtnHighlight; + Pixels[R.Right - 1, R.Top + 1] := clBtnFace; //!!! + Pixels[R.Right - 1, R.Bottom - 2] := clBtnFace; //!!! + end; + nTop:; + nBottom:; + end; + end; +end; + +class procedure TcxFlatLookAndFeelPainter.DrawHeaderControlSectionBorder( + ACanvas: TcxCanvas; const R: TRect; ABorders: TcxBorders; AState: TcxButtonState); +begin + if AState <> cxbsPressed then + ACanvas.DrawComplexFrame(R, clBtnHighlight, clBtnShadow, ABorders) + else + ACanvas.DrawComplexFrame(R, clBtnShadow, clBtnHighlight, ABorders); +end; + +class procedure TcxFlatLookAndFeelPainter.DrawSortingMark(ACanvas: TcxCanvas; + const R: TRect; AAscendingSorting: Boolean); +begin + DrawSortingArrow(ACanvas, R, clBtnShadow, clBtnHighlight, AAscendingSorting); +end; + +class function TcxFlatLookAndFeelPainter.HeaderBorderSize: Integer; +begin + Result := 1; +end; + +class function TcxFlatLookAndFeelPainter.SortingMarkSize: TPoint; +begin + Result := Point(8, 7); +end; + +class function TcxFlatLookAndFeelPainter.FooterBorderSize: Integer; +begin + Result := 1; +end; + +class function TcxFlatLookAndFeelPainter.FooterCellBorderSize: Integer; +begin + Result := 1; +end; + +class function TcxFlatLookAndFeelPainter.FooterCellOffset: Integer; +begin + Result := 1; +end; + +class procedure TcxFlatLookAndFeelPainter.DrawFooterBorder(ACanvas: TcxCanvas; const R: TRect); +begin + ACanvas.DrawEdge(R, False, False); +end; + +class procedure TcxFlatLookAndFeelPainter.DrawFooterCellBorder(ACanvas: TcxCanvas; const R: TRect); +begin + ACanvas.DrawEdge(R, True, True); +end; + +class procedure TcxFlatLookAndFeelPainter.DrawFilterDropDownButton(ACanvas: TcxCanvas; R: TRect; + AState: TcxButtonState; AIsFilterActive: Boolean); + + class function GetArrowColor: TColor; + begin + if AIsFilterActive then + Result := ActiveFilterButtonArrowColor + else + Result := clBtnText; + end; + +begin + if AState <> cxbsPressed then + ACanvas.DrawEdge(R, False, False) + else + ACanvas.DrawEdge(R, True, True); + InflateRect(R, -1, -1); + ACanvas.Brush.Color := clBtnFace; + ACanvas.FillRect(R); + DrawButtonArrow(ACanvas, R, GetArrowColor); +end; + +class procedure TcxFlatLookAndFeelPainter.DrawTabBorder(ACanvas: TcxCanvas; R: TRect; + ABorder: TcxBorder; ABorders: TcxBorders; AVertical: Boolean); +const + Colors: array[Boolean] of TColor = (clBtnShadow, clBtnHighlight); + + procedure ProcessVerticalTabBorder; + begin + case ABorder of + bLeft: + begin + Inc(R.Top); + if bTop in ABorders then Inc(R.Top); + Dec(R.Bottom); + if bBottom in ABorders then Dec(R.Bottom); + end; + bTop, bBottom: + if bLeft in ABorders then Inc(R.Left); + end; + if ABorder = bLeft then + begin + ACanvas.Pixels[R.Left + 1, R.Top - 1] := Colors[True]; + ACanvas.Pixels[R.Left + 1, R.Bottom] := Colors[True]; + end; + ACanvas.Brush.Color := Colors[ABorder <> bBottom]; + end; + + procedure ProcessHorizontalTabBorder; + begin + case ABorder of + bTop: + begin + Inc(R.Left); + Dec(R.Right); + end; + bLeft, bRight: + begin + if bTop in ABorders then Inc(R.Top, 2); + if bBottom in ABorders then Dec(R.Bottom); + end; + end; + if ABorder = bTop then + begin + ACanvas.Pixels[R.Left - 1, R.Top + 1] := Colors[True]; + ACanvas.Pixels[R.Right, R.Top + 1] := Colors[True]; + end; + ACanvas.Brush.Color := Colors[ABorder <> bRight]; + end; + +begin + if AVertical then + ProcessVerticalTabBorder + else + ProcessHorizontalTabBorder; + ACanvas.FillRect(R); +end; + +class procedure TcxFlatLookAndFeelPainter.DrawTabsRoot(ACanvas: TcxCanvas; const R: TRect; + ABorders: TcxBorders; AVertical: Boolean); +begin + ACanvas.DrawEdge(R, False, False, ABorders); +end; + +class function TcxFlatLookAndFeelPainter.TabBorderSize(AVertical: Boolean): Integer; +begin + Result := 1; +end; + +class procedure TcxFlatLookAndFeelPainter.DrawScrollBarPart(ACanvas: TcxCanvas; AHorizontal: Boolean; + R: TRect; APart: TcxScrollBarPart; AState: TcxButtonState); +begin + if IsRectEmpty(R) or ((APart = sbpThumbnail) and (AState = cxbsDisabled)) then Exit; + if AState = cxbsHot then AState := cxbsNormal; + case APart of + sbpThumbnail, sbpLineUp, sbpLineDown: + begin + DrawButton(ACanvas, R, '', AState); + InflateRect(R, -ButtonBorderSize, -ButtonBorderSize); + if APart <> sbpThumbnail then + DrawScrollBarArrow(ACanvas, R, AState, GetArrowDirection(AHorizontal, APart)); + end; + sbpPageUp, sbpPageDown: + begin + ACanvas.Brush.Bitmap := StdScrollBitmaps[AState = cxbsPressed]; + ACanvas.FillRect(R); + ACanvas.Brush.Bitmap := nil; + ACanvas.Brush.Style := bsSolid; + end; + end; +end; + +class procedure TcxFlatLookAndFeelPainter.DrawSchedulerSplitterBorder( + ACanvas: TcxCanvas; R: TRect; const AViewParams: TcxViewParams; + AIsHorizontal: Boolean); +begin + if AIsHorizontal then + begin + ACanvas.SetBrushColor(clBtnHighlight); + ACanvas.FillRect(Rect(R.Left, R.Top, R.Right, R.Top + 1)); + ACanvas.SetBrushColor(clBtnShadow); + ACanvas.FillRect(Rect(R.Left, R.Bottom - 1, R.Right, R.Bottom)); + InflateRect(R, 1, -1); + end + else + begin + ACanvas.SetBrushColor(clBtnHighlight); + ACanvas.FillRect(Rect(R.Left, R.Top, R.Left + 1, R.Bottom)); + ACanvas.SetBrushColor(clBtnShadow); + ACanvas.FillRect(Rect(R.Right - 1, R.Top, R.Right, R.Bottom)); + InflateRect(R, -1, 1); + end; + ACanvas.FillRect(R, AViewParams); +end; + +{ TcxUltraFlatLookAndFeelPainter } + +class function TcxUltraFlatLookAndFeelPainter.LookAndFeelStyle: TcxLookAndFeelStyle; +begin + Result := lfsUltraFlat; +end; + +class function TcxUltraFlatLookAndFeelPainter.DefaultSchedulerBorderColor: TColor; +begin + Result := clBtnShadow; +end; + +class function TcxUltraFlatLookAndFeelPainter.BorderHighlightColor: TColor; +begin + Result := clHighlight; +end; + +class function TcxUltraFlatLookAndFeelPainter.BorderSize: Integer; +begin + Result := 1; +end; + +class procedure TcxUltraFlatLookAndFeelPainter.DrawBorder(ACanvas: TcxCanvas; R: TRect); +begin + ACanvas.FrameRect(R, clBtnShadow); +end; + +class function TcxUltraFlatLookAndFeelPainter.ButtonBorderSize(AState: TcxButtonState = cxbsNormal): Integer; +begin + if AState = cxbsDefault then Result := 2 else Result := 1; +end; + +class function TcxUltraFlatLookAndFeelPainter.ButtonColor(AState: TcxButtonState): TColor; +begin + case AState of + cxbsHot: + Result := GetLightSelColor; + cxbsPressed: + Result := GetLightDownedSelColor; + else + Result := inherited ButtonColor(AState); + end; +end; + +class function TcxUltraFlatLookAndFeelPainter.ButtonFocusRect(ACanvas: TcxCanvas; R: TRect): TRect; +begin + Result := R; + InflateRect(Result, -3, -3); + if IsRectEmpty(Result) then + Result := R; +end; + +class function TcxUltraFlatLookAndFeelPainter.ButtonGroupBorderSizes(AButtonCount, + AButtonIndex: Integer): TRect; +begin + Result := Rect(1, 2, 1, 2); + if AButtonIndex = 0 then + Inc(Result.Left) + else + if AButtonIndex = AButtonCount - 1 then + Inc(Result.Right); +end; + +class function TcxUltraFlatLookAndFeelPainter.ButtonSymbolColor( + AState: TcxButtonState; ADefaultColor: TColor = clDefault): TColor; +begin + if AState = cxbsPressed then + Result := clHighlightText + else + Result := inherited ButtonSymbolColor(AState, ADefaultColor); +end; + +class function TcxUltraFlatLookAndFeelPainter.ButtonSymbolState(AState: TcxButtonState): TcxButtonState; +begin + Result := cxbsNormal; +end; + +class function TcxUltraFlatLookAndFeelPainter.ButtonTextOffset: Integer; +begin + Result := 2; +end; + +class function TcxUltraFlatLookAndFeelPainter.ButtonTextShift: Integer; +begin + Result := 0; +end; + +class procedure TcxUltraFlatLookAndFeelPainter.DrawButtonBorder(ACanvas: TcxCanvas; R: TRect; + AState: TcxButtonState); + + function GetBorderColor: TColor; + begin + case AState of +// cxbsDefault: +// Result := clNavy; + cxbsDisabled: + Result := clBtnShadow; + cxbsNormal: + Result := clBtnText; + else + Result := clHighlight; + end; + end; + +begin + if AState = cxbsDefault then + begin + ACanvas.FrameRect(R, clWindowFrame); + InflateRect(R, -1, -1); + ACanvas.FrameRect(R, clWindowFrame); + end + else + ACanvas.FrameRect(R, GetBorderColor); +end; + +class procedure TcxUltraFlatLookAndFeelPainter.DrawButtonInGroup(ACanvas: TcxCanvas; + R: TRect; AState: TcxButtonState; AButtonCount, AButtonIndex: Integer; + ABackgroundColor: TColor); +begin + Inc(R.Top); + Dec(R.Bottom); + if AButtonIndex = 0 then + Inc(R.Left); + if AButtonIndex = AButtonCount - 1 then + Dec(R.Right); + with ACanvas do + begin + if AState in [cxbsDisabled, cxbsNormal] then + begin + FrameRect(R, ABackgroundColor); + InflateRect(R, -1, -1); + end else + begin + Brush.Color := BorderHighlightColor; + if AButtonIndex > 0 then + begin + FillRect(Rect(R.Left, R.Top, R.Left + 1, R.Bottom)); + Inc(R.Left); + end; + if AButtonIndex < AButtonCount - 1 then + begin + FillRect(Rect(R.Right - 1, R.Top, R.Right, R.Bottom)); + Dec(R.Right); + end; + end; + Brush.Color := ButtonColor(AState); + FillRect(R); + end; +end; + +class procedure TcxUltraFlatLookAndFeelPainter.DrawButtonGroupBorder(ACanvas: TcxCanvas; + R: TRect; AInplace, ASelected: Boolean); +var + AColor: TColor; +begin + if AInplace then + AColor := clBtnText + else + if ASelected then + AColor := BorderHighlightColor + else + AColor := clBtnShadow; + ACanvas.FrameRect(R, AColor); +end; + +class procedure TcxUltraFlatLookAndFeelPainter.DrawExpandButton(ACanvas: TcxCanvas; + const R: TRect; AExpanded: Boolean; AColor: TColor = clDefault); +var + ARect: TRect; +begin + ARect := R; + ACanvas.FrameRect(ARect, clBtnShadow); + InflateRect(ARect, -1, -1); + if AColor = clDefault then + ACanvas.Brush.Color := clBtnFace + else + ACanvas.Brush.Color := AColor; + ACanvas.FillRect(ARect); + DrawExpandButtonCross(ACanvas, ARect, AExpanded, clBtnText); + ACanvas.ExcludeClipRect(R); +end; + +class procedure TcxUltraFlatLookAndFeelPainter.DrawHeaderControlSectionBorder( + ACanvas: TcxCanvas; const R: TRect; ABorders: TcxBorders; AState: TcxButtonState); +begin + if AState <> cxbsDisabled then + ACanvas.DrawComplexFrame(R, clBlack, clBlack, ABorders) + else + ACanvas.DrawComplexFrame(R, clBtnShadow, clBtnShadow, ABorders); +end; + +class procedure TcxUltraFlatLookAndFeelPainter.DrawHeaderControlSectionContent( + ACanvas: TcxCanvas; const ABounds, ATextAreaBounds: TRect; + AState: TcxButtonState; AAlignmentHorz: TAlignment; + AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor); +begin + if AState in [cxbsDefault, cxbsNormal] then + ACanvas.SetBrushColor(ABkColor) + else + ACanvas.SetBrushColor(ButtonColor(AState)); + ACanvas.FillRect(ABounds); + ACanvas.Font.Color := ATextColor; + DrawHeaderControlSectionText(ACanvas, ATextAreaBounds, AState, AAlignmentHorz, + AAlignmentVert, AMultiLine, AShowEndEllipsis, AText, AFont, ATextColor); +end; + +class function TcxUltraFlatLookAndFeelPainter.ExpandButtonSize: Integer; +begin + Result := 11; +end; + +class function TcxUltraFlatLookAndFeelPainter.IsButtonHotTrack: Boolean; +begin + Result := True; +end; + +class procedure TcxUltraFlatLookAndFeelPainter.DrawCheckBorder(ACanvas: TcxCanvas; R: TRect; + AState: TcxButtonState); +begin + ACanvas.FrameRect(R, clBtnText); + InflateRect(R, -1, -1); + ACanvas.FrameRect(R, CheckButtonColor(AState)); +end; + +class procedure TcxUltraFlatLookAndFeelPainter.DrawHeaderBorder(ACanvas: TcxCanvas; + const R: TRect; ANeighbors: TcxNeighbors; ABorders: TcxBorders); +begin + ACanvas.Brush.Color := clBtnText; + with R do + begin + if bLeft in ABorders then + ACanvas.FillRect(Rect(Left, Top, Left + 1, Bottom)); + if bTop in ABorders then + ACanvas.FillRect(Rect(Left, Top, Right, Top + 1)); + ACanvas.FillRect(Rect(Right - 1, Top, Right, Bottom)); + ACanvas.FillRect(Rect(Left, Bottom - 1, Right, Bottom)); + end; +end; + +class procedure TcxUltraFlatLookAndFeelPainter.DrawHeaderEx(ACanvas: TcxCanvas; + const ABounds, ATextAreaBounds: TRect; ANeighbors: TcxNeighbors; ABorders: TcxBorders; + AState: TcxButtonState; AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; + AMultiLine, AShowEndEllipsis: Boolean; const AText: string; AFont: TFont; + ATextColor, ABkColor: TColor; AOnDrawBackground: TcxDrawBackgroundEvent = nil); +var + R: TRect; +begin + R := ATextAreaBounds; + InflateRect(R, -1, -1); + DrawContent(ACanvas, ABounds, R, Integer(AState), + AAlignmentHorz, AAlignmentVert, AMultiLine, AShowEndEllipsis, AText, + AFont, ATextColor, ABkColor, AOnDrawBackground); + R := ABounds; + InflateRect(R, -1, -1); + DrawHeaderBorder(ACanvas, R, ANeighbors, ABorders); +end; + +class procedure TcxUltraFlatLookAndFeelPainter.DrawSortingMark(ACanvas: TcxCanvas; + const R: TRect; AAscendingSorting: Boolean); +begin + DrawSortingArrow(ACanvas, R, clBtnShadow, clBtnShadow, AAscendingSorting); +end; + +class function TcxUltraFlatLookAndFeelPainter.HeaderBorders(ANeighbors: TcxNeighbors): TcxBorders; +begin + Result := inherited HeaderBorders(ANeighbors); + if nLeft in ANeighbors then Exclude(Result, bLeft); + if nTop in ANeighbors then Exclude(Result, bTop); +end; + +class function TcxUltraFlatLookAndFeelPainter.HeaderBorderSize: Integer; +begin + Result := 1; +end; + +class function TcxUltraFlatLookAndFeelPainter.SortingMarkSize: TPoint; +begin + Result := Point(7, 8); +end; + +class procedure TcxUltraFlatLookAndFeelPainter.DrawFooterBorder(ACanvas: TcxCanvas; + const R: TRect); +begin + ACanvas.Brush.Color := FooterSeparatorColor; + with R do + begin + ACanvas.FillRect(Rect(Right - 1, Top, Right, Bottom)); + ACanvas.FillRect(Rect(Left, Bottom - 1, Right, Bottom)); + end; +end; + +class procedure TcxUltraFlatLookAndFeelPainter.DrawFooterCellBorder(ACanvas: TcxCanvas; + const R: TRect); +begin + ACanvas.FrameRect(R, FooterSeparatorColor); +end; + +class function TcxUltraFlatLookAndFeelPainter.FooterBorders: TcxBorders; +begin + Result := [bRight, bBottom]; +end; + +class function TcxUltraFlatLookAndFeelPainter.FooterBorderSize: Integer; +begin + Result := 1; +end; + +class function TcxUltraFlatLookAndFeelPainter.FooterCellBorderSize: Integer; +begin + Result := 1; +end; + +class function TcxUltraFlatLookAndFeelPainter.FooterCellOffset: Integer; +begin + Result := 2; +end; + +class procedure TcxUltraFlatLookAndFeelPainter.DrawFilterDropDownButton(ACanvas: TcxCanvas; + R: TRect; AState: TcxButtonState; AIsFilterActive: Boolean); + + function GetArrowColor: TColor; + begin + if AIsFilterActive then + Result := ActiveFilterButtonArrowColor + else + Result := ButtonSymbolColor(AState); + end; + +begin + ACanvas.FrameRect(R, FilterDropDownButtonBorderColor(AState)); + InflateRect(R, -1, -1); + ACanvas.Brush.Color := ButtonColor(AState); + ACanvas.FillRect(R); + DrawButtonArrow(ACanvas, R, GetArrowColor); +end; + +class function TcxUltraFlatLookAndFeelPainter.FilterCloseButtonSize: TPoint; +begin + Result := inherited FilterCloseButtonSize; + Inc(Result.Y); +end; + +class procedure TcxUltraFlatLookAndFeelPainter.DrawTabBorder(ACanvas: TcxCanvas; R: TRect; + ABorder: TcxBorder; ABorders: TcxBorders; AVertical: Boolean); +begin + if AVertical and (ABorder = bBottom) or not AVertical and (ABorder = bRight) then + begin + if not AVertical then + Dec(R.Bottom, TabBorderSize(AVertical)); + ACanvas.Brush.Color := TabBorderDarkColor; + end + else + ACanvas.Brush.Color := TabBorderHighlightColor; + ACanvas.FillRect(R); +end; + +class procedure TcxUltraFlatLookAndFeelPainter.DrawTabsRoot(ACanvas: TcxCanvas; + const R: TRect; ABorders: TcxBorders; AVertical: Boolean); +begin + ACanvas.DrawComplexFrame(R, TabBorderHighlightColor, TabBorderHighlightColor, ABorders, TabBorderSize(AVertical)); +end; + +class function TcxUltraFlatLookAndFeelPainter.TabBorderSize(AVertical: Boolean): Integer; +begin + Result := 1; +end; + +class procedure TcxUltraFlatLookAndFeelPainter.DrawScrollBarPart(ACanvas: TcxCanvas; + AHorizontal: Boolean; R: TRect; APart: TcxScrollBarPart; AState: TcxButtonState); +begin + if IsRectEmpty(R) or ((APart = sbpThumbnail) and (AState = cxbsDisabled)) then Exit; + case APart of + sbpThumbnail, sbpLineUp, sbpLineDown: + begin + DrawButton(ACanvas, R, '', AState); + if APart <> sbpThumbnail then + DrawScrollBarArrow(ACanvas, R, AState, GetArrowDirection(AHorizontal, APart)); + end; + sbpPageUp, sbpPageDown: + begin + ACanvas.Brush.Bitmap := StdScrollBitmaps[AState = cxbsPressed]; + ACanvas.FillRect(R); + ACanvas.Brush.Bitmap := nil; + ACanvas.Brush.Style := bsSolid; + end; + end; +end; + +class procedure TcxUltraFlatLookAndFeelPainter.DrawSchedulerNavigationButtonContent( + ACanvas: TcxCanvas; const ARect: TRect; const AArrowRect: TRect; AIsNextButton: Boolean; + AState: TcxButtonState); +const + Borders: array[Boolean] of TcxBorders = + ([bRight, bTop, bBottom], [bLeft, bTop, bBottom]); +var + AColor: TColor; + R: TRect; +begin + R := ARect; + ACanvas.FillRect(R, clBtnFace); + if AState = cxbsHot then + AColor := TabBorderHighlightColor + else + AColor := TabBorderDarkColor; + ACanvas.DrawComplexFrame(R, AColor, AColor, Borders[AIsNextButton]); + DrawSchedulerNavigationButtonArrow(ACanvas, AArrowRect, AIsNextButton, + ButtonSymbolColor(AState)); +end; + +class function TcxUltraFlatLookAndFeelPainter.FilterDropDownButtonBorderColor(AState: TcxButtonState): TColor; +begin + if AState = cxbsNormal then + Result := clBtnShadow + else + Result := clHighlight; +end; + +class function TcxUltraFlatLookAndFeelPainter.TabBorderHighlightColor: TColor; +begin + Result := clBtnShadow; +end; + +class function TcxUltraFlatLookAndFeelPainter.TabBorderDarkColor: TColor; +begin + Result := clBtnText; +end; + +class procedure TcxUltraFlatLookAndFeelPainter.DrawSchedulerNavigatorButton( + ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); +begin + DrawButton(ACanvas, R, '', AState, AState in [cxbsHot, cxbsPressed]); +end; + +class procedure TcxUltraFlatLookAndFeelPainter.DrawSchedulerSplitterBorder( + ACanvas: TcxCanvas; R: TRect; const AViewParams: TcxViewParams; + AIsHorizontal: Boolean); +begin + ACanvas.SetBrushColor(DefaultSchedulerBorderColor); + if AIsHorizontal then + begin + ACanvas.FillRect(Rect(R.Left, R.Top, R.Right, R.Top + 1)); + ACanvas.FillRect(Rect(R.Left, R.Bottom - 1, R.Right, R.Bottom)); + InflateRect(R, 1, -1); + end + else + begin + ACanvas.FillRect(Rect(R.Left, R.Top, R.Left + 1, R.Bottom)); + ACanvas.FillRect(Rect(R.Right - 1, R.Top, R.Right, R.Bottom)); + InflateRect(R, -1, 1); + end; + ACanvas.FillRect(R, AViewParams); +end; + +{ TcxOffice11LookAndFeelPainter } + +class function TcxOffice11LookAndFeelPainter.LookAndFeelStyle: TcxLookAndFeelStyle; +begin + Result := lfsOffice11; +end; + +class function TcxOffice11LookAndFeelPainter.DefaultDateNavigatorHeaderColor: TColor; +begin + Result := dxOffice11DockColor1; +end; + +class function TcxOffice11LookAndFeelPainter.DefaultDateNavigatorSelectionColor: TColor; +begin + Result := dxOffice11DayNavigatorSelectedColor; +end; + +class function TcxOffice11LookAndFeelPainter.DefaultDateNavigatorSelectionTextColor: TColor; +begin + Result := clWindowText; +end; + +class function TcxOffice11LookAndFeelPainter.DefaultFilterBoxColor: TColor; +begin + Result := dxOffice11BarFloatingBorderColor1; +end; + +class function TcxOffice11LookAndFeelPainter.DefaultFilterBoxTextColor: TColor; +begin + Result := dxOffice11BarFloatingCaptionTextColor1; +end; + +class function TcxOffice11LookAndFeelPainter.DefaultFooterColor: TColor; +begin + Result := dxOffice11DockColor1; //DefaultHeaderColor; +end; + +class function TcxOffice11LookAndFeelPainter.DefaultFooterTextColor: TColor; +begin + Result := DefaultHeaderTextColor; +end; + +class function TcxOffice11LookAndFeelPainter.DefaultGroupColor: TColor; +begin + Result := dxOffice11GroupColor; +end; + +class function TcxOffice11LookAndFeelPainter.DefaultGroupByBoxColor: TColor; +begin + Result := dxOffice11InPlaceSubItemColor{dxOffice11DockColor2}; +end; + +class function TcxOffice11LookAndFeelPainter.DefaultGroupByBoxTextColor: TColor; +begin + Result := dxOffice11ToolbarsColor1{dxOffice11TextEnabledColor}; +end; + +class function TcxOffice11LookAndFeelPainter.DefaultHeaderColor: TColor; +begin + Result := HeaderTopColor; //dxOffice11DockColor1; +end; + +class function TcxOffice11LookAndFeelPainter.DefaultHeaderBackgroundColor: TColor; +begin + Result := DefaultGroupByBoxColor; +end; + +class function TcxOffice11LookAndFeelPainter.DefaultSchedulerBorderColor: TColor; +begin + Result := dxOffice11OutlookBorderColor; +end; + +class function TcxOffice11LookAndFeelPainter.DefaultSchedulerControlColor: TColor; +begin + Result := dxOffice11OutlookControlColor; +end; + +class function TcxOffice11LookAndFeelPainter.DefaultTabColor: TColor; +begin + Result := dxOffice11DockColor2; +end; + +class function TcxOffice11LookAndFeelPainter.DefaultTabsBackgroundColor: TColor; +begin + Result := DefaultTabColor; +end; + +class function TcxOffice11LookAndFeelPainter.DefaultTimeGridMinorScaleColor: TColor; +begin + Result := dxOffice11DockColor1; +end; + +class function TcxOffice11LookAndFeelPainter.DefaultTimeGridSelectionBarColor: TColor; +begin + Result := DefaultSchedulerControlColor; +end; + +class function TcxOffice11LookAndFeelPainter.BorderHighlightColor: TColor; +begin + Result := dxOffice11SelectedBorderColor; +end; + +class procedure TcxOffice11LookAndFeelPainter.DrawBorder(ACanvas: TcxCanvas; R: TRect); +begin + ACanvas.FrameRect(R, dxOffice11ControlBorderColor); +end; + +class function TcxOffice11LookAndFeelPainter.ButtonColor(AState: TcxButtonState): TColor; +begin + case AState of + cxbsHot: + Result := dxOffice11SelectedColor1; + cxbsPressed: + Result := dxOffice11SelectedDownColor1; + cxbsDisabled: + Result := {dxOffice11ToolbarsColor2}clBtnFace; + else + Result := dxOffice11DockColor1{inherited ButtonColor(AState)}; + end; +end; + +class function TcxOffice11LookAndFeelPainter.ButtonSymbolColor( + AState: TcxButtonState; ADefaultColor: TColor = clDefault): TColor; +begin + if (AState = cxbsPressed) and not IsXPStandardScheme then + Result := clHighlightText + else + if AState = cxbsDisabled then + Result := dxOffice11TextDisabledColor + else + Result := dxOffice11TextEnabledColor; +end; + +class procedure TcxOffice11LookAndFeelPainter.DrawButtonBorder(ACanvas: TcxCanvas; + R: TRect; AState: TcxButtonState); + + function GetBorderColor: TColor; + begin + case AState of + cxbsNormal: + Result := clBtnText; + cxbsDisabled: + Result := dxOffice11TextDisabledColor; + else + Result := dxOffice11SelectedBorderColor; + end; + end; + +begin + if AState = cxbsDefault then + inherited + else + ACanvas.FrameRect(R, GetBorderColor); +end; + +class procedure TcxOffice11LookAndFeelPainter.DrawExpandButton(ACanvas: TcxCanvas; + const R: TRect; AExpanded: Boolean; AColor: TColor = clDefault); +var + AColor2: TColor; + ABitmap: TBitmap; +begin + if AExpanded then + ABitmap := dxOffice11ExpandButtonBitmap1 + else + ABitmap := dxOffice11ExpandButtonBitmap2; + AColor2 := GetMiddleRGB(dxOffice11ExpandButtonColor1, ACanvas.Canvas.Pixels[R.Left, R.Top], 25); + ABitmap.Canvas.Pixels[0, 0] := AColor2; + AColor2 := GetMiddleRGB(dxOffice11ExpandButtonColor2, ACanvas.Canvas.Pixels[R.Right - 1, R.Bottom - 1], 25); + ABitmap.Canvas.Pixels[10, 10] := AColor2; + ABitmap.Canvas.Pixels[0, 10] := AColor2; + ABitmap.Canvas.Pixels[10, 0] := AColor2; + ACanvas.Draw(R.Left, R.Top, ABitmap); +// ACanvas.ExcludeClipRect(R); +end; + +class function TcxOffice11LookAndFeelPainter.DrawExpandButtonFirst: Boolean; +begin + Result := False; +end; + +class procedure TcxOffice11LookAndFeelPainter.DrawSmallExpandButton(ACanvas: TcxCanvas; + R: TRect; AExpanded: Boolean; ABorderColor: TColor; AColor: TColor = clDefault); +begin + DrawExpandButton(ACanvas, R, AExpanded, AColor); +end; + +class function TcxOffice11LookAndFeelPainter.ExpandButtonSize: Integer; +begin + Result := 11; +end; + +class function TcxOffice11LookAndFeelPainter.SmallExpandButtonSize: Integer; +begin + Result := ExpandButtonSize; +end; + +class function TcxOffice11LookAndFeelPainter.CheckButtonColor(AState: TcxButtonState): TColor; +begin + case AState of + cxbsHot, cxbsPressed, cxbsDisabled: + Result := ButtonColor(AState); + else + Result := inherited CheckButtonColor(AState); + end; +end; + +class procedure TcxOffice11LookAndFeelPainter.DrawFilterDropDownButton(ACanvas: TcxCanvas; + R: TRect; AState: TcxButtonState; AIsFilterActive: Boolean); + + function GetArrowColor: TColor; + begin + if AIsFilterActive then + Result := ActiveFilterButtonArrowColor + else + Result := ButtonSymbolColor(AState); + end; + +begin +// inherited; + ACanvas.FrameRect(R, FilterDropDownButtonBorderColor(AState)); + InflateRect(R, -1, -1); + ACanvas.Brush.Color := ButtonColor(AState); + ACanvas.FillRect(R); + DrawButtonArrow(ACanvas, R, GetArrowColor); +end; + +class procedure TcxOffice11LookAndFeelPainter.DrawHeader(ACanvas: TcxCanvas; + const ABounds, ATextAreaBounds: TRect; ANeighbors: TcxNeighbors; ABorders: TcxBorders; + AState: TcxButtonState; AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; + AMultiLine, AShowEndEllipsis: Boolean; const AText: string; AFont: TFont; ATextColor, + ABkColor: TColor; AOnDrawBackground: TcxDrawBackgroundEvent = nil; AIsLast: Boolean = False; + AInGroupByBox: Boolean = False); +begin + inherited DrawHeader(ACanvas, ABounds, ATextAreaBounds, ANeighbors, ABorders, + AState, AAlignmentHorz, AAlignmentVert, AMultiLine, AShowEndEllipsis, AText, + AFont, ATextColor, ABkColor, nil, AIsLast); +end; + +class procedure TcxOffice11LookAndFeelPainter.DrawHeaderBorder(ACanvas: TcxCanvas; + const R: TRect; ANeighbors: TcxNeighbors; ABorders: TcxBorders); +var + AColor1, AColor2: TColor; + Y1, Y2: Integer; +begin + AColor1 := HeaderTopColor; + AColor2 := HeaderBottomColor; + if bTop in ABorders then + begin + ACanvas.Brush.Color := AColor1; + ACanvas.FillRect(Rect(R.Left, R.Top, R.Right, R.Top + 1)); + end; + if bBottom in ABorders then + begin + ACanvas.Brush.Color := HeaderDarkEdgeColor; + ACanvas.FillRect(Rect(R.Left, R.Bottom - 1, R.Right, R.Bottom)); + end; + if bLeft in ABorders then + begin + ACanvas.Pixels[R.Left, R.Top + 1] := AColor1; + if nLeft in ANeighbors then + begin + Y1 := R.Top + 2; + Y2 := R.Bottom - 3; + ACanvas.Pixels[R.Left, Y1] := AColor1; + ACanvas.Pixels[R.Left, Y2] := GetMiddleRGB(AColor1, AColor2, 25); + ACanvas.Pixels[R.Left, R.Bottom - 2] := AColor2; + end + else + begin + Y1 := R.Top + 1; + Y2 := R.Bottom - 2; + ACanvas.Pixels[R.Left, R.Bottom - 2] := AColor2; + end; + ACanvas.Brush.Color := HeaderHighlightEdgeColor; + ACanvas.FillRect(Rect(R.Left, Y1, R.Left + 1, Y2)); + end; + if bRight in ABorders then + begin + if nRight in ANeighbors then + begin + Y1 := R.Top + 2; + Y2 := R.Bottom - 3; + ACanvas.Pixels[R.Right - 1, R.Top + 1] := AColor1; + ACanvas.Pixels[R.Right - 1, Y1] := AColor1; + ACanvas.Pixels[R.Right - 1, Y2] := GetMiddleRGB(AColor1, AColor2, 25); + ACanvas.Pixels[R.Right - 1, R.Bottom - 2] := AColor2; + end + else + begin + Y1 := R.Top + 1; + ACanvas.Pixels[R.Right - 1, R.Top] := GetMiddleRGB(AColor1, HeaderDarkEdgeColor, 50); + Y2 := R.Bottom - 2; + ACanvas.Pixels[R.Right - 1, R.Bottom - 2] := GetMiddleRGB(AColor2, HeaderDarkEdgeColor, 50); + end; + ACanvas.Brush.Color := HeaderDarkEdgeColor; + ACanvas.FillRect(Rect(R.Right - 1, Y1, R.Right, Y2)); + end; +end; + +class procedure TcxOffice11LookAndFeelPainter.DrawHeaderControlSection( + ACanvas: TcxCanvas; const ABounds, ATextAreaBounds: TRect; + ANeighbors: TcxNeighbors; ABorders: TcxBorders; AState: TcxButtonState; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; AMultiLine, + AShowEndEllipsis: Boolean; const AText: string; AFont: TFont; ATextColor, + ABkColor: TColor); +begin + DrawHeader(ACanvas, ABounds, ATextAreaBounds, ANeighbors, ABorders, + AState, AAlignmentHorz, AAlignmentVert, AMultiLine, AShowEndEllipsis, AText, + AFont, ATextColor, ABkColor); + if AState = cxbsPressed then + DrawHeaderPressed(ACanvas, ABounds); +end; + +class procedure TcxOffice11LookAndFeelPainter.DrawSortingMark(ACanvas: TcxCanvas; + const R: TRect; AAscendingSorting: Boolean); +begin + DrawSortingArrow(ACanvas, R, HeaderDarkEdgeColor, HeaderHighlightEdgeColor, AAscendingSorting); +end; + +class function TcxOffice11LookAndFeelPainter.HeaderBorders(ANeighbors: TcxNeighbors): TcxBorders; +begin + Result := cxBordersAll; +end; + +class function TcxOffice11LookAndFeelPainter.HeaderBorderSize: Integer; +begin + Result := 1; +end; + +class function TcxOffice11LookAndFeelPainter.IsHeaderHotTrack: Boolean; +begin + Result := True; +end; + +class function TcxOffice11LookAndFeelPainter.FooterSeparatorColor: TColor; +begin + Result := HeaderDarkEdgeColor; +end; + +class procedure TcxOffice11LookAndFeelPainter.DrawScrollBarPart(ACanvas: TcxCanvas; + AHorizontal: Boolean; R: TRect; APart: TcxScrollBarPart; AState: TcxButtonState); +begin + if AreVisualStylesAvailable([totScrollBar]) then + TcxWinXPLookAndFeelPainter.DrawScrollBarPart(ACanvas, AHorizontal, R, APart, AState) + else + TcxStandardLookAndFeelPainter.DrawScrollBarPart(ACanvas, AHorizontal, R, APart, AState); +end; + +class procedure TcxOffice11LookAndFeelPainter.DrawSizeGrip(ACanvas: TcxCanvas; + const ARect: TRect; ABackgroundColor: TColor); +begin + ACanvas.FillRect(ARect, ABackgroundColor); + Office11DrawSizeGrip(ACanvas.Handle, ARect); +end; + +class procedure TcxOffice11LookAndFeelPainter.DrawMonthHeader( + ACanvas: TcxCanvas; const ABounds: TRect; const AText: string; + ANeighbors: TcxNeighbors; const AViewParams: TcxViewParams; + AArrows: TcxHeaderArrows; ASideWidth: Integer; + AOnDrawBackground: TcxDrawBackgroundEvent = nil); +var + R: TRect; +begin + R := ABounds; + InflateRect(R, -1, -1); + with ACanvas do + begin + if not Assigned(AOnDrawBackground) or not AOnDrawBackground(ACanvas, R) then + FillRect(R, AViewParams); + if AText <> '' then + begin + Brush.Style := bsClear; + Font := AViewParams.Font; + Font.Color := AViewParams.TextColor; + DrawText(AText, R, cxAlignCenter or cxSingleLine); + Brush.Style := bsSolid; + end; + end; + DrawMonthHeaderArrows(ACanvas, ABounds, AArrows, ASideWidth, clWindowText); +end; + +class procedure TcxOffice11LookAndFeelPainter.DrawSchedulerNavigationButtonContent( + ACanvas: TcxCanvas; const ARect: TRect; const AArrowRect: TRect; + AIsNextButton: Boolean; AState: TcxButtonState); +const + Borders: array[Boolean] of TcxBorders = + ([bRight, bTop, bBottom], [bLeft, bTop, bBottom]); +var + ABackgroundColor: TColor; +begin + case AState of + cxbsPressed: + ABackgroundColor := dxOffice11SelectedDownColor1; + cxbsHot: + ABackgroundColor := dxOffice11SelectedColor1; + else + ABackgroundColor := dxOffice11DockColor1; + end; + ACanvas.FillRect(ARect, ABackgroundColor); + ACanvas.DrawComplexFrame(ARect, dxOffice11OutlookBorderColor, + dxOffice11OutlookBorderColor, Borders[AIsNextButton]); + DrawSchedulerNavigationButtonArrow(ACanvas, AArrowRect, AIsNextButton, + ButtonSymbolColor(AState)); +end; + +class procedure TcxOffice11LookAndFeelPainter.DrawSchedulerNavigatorButton( + ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); +begin + TcxWinXPLookAndFeelPainter.DrawSchedulerNavigatorButton(ACanvas, R, AState); +end; + +class procedure TcxOffice11LookAndFeelPainter.DrawSchedulerBorder( + ACanvas: TcxCanvas; R: TRect); +begin + ACanvas.FrameRect(R, DefaultSchedulerBorderColor); +end; + +class procedure TcxOffice11LookAndFeelPainter.DrawContent(ACanvas: TcxCanvas; + const ABounds, ATextAreaBounds: TRect; AState: Integer; AAlignmentHorz: TAlignment; + AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil; AIsFooter: Boolean = False); +const + MultiLines: array[Boolean] of Integer = (cxSingleLine, cxWordBreak); + ShowEndEllipsises: array[Boolean] of Integer = (0, cxShowEndEllipsis); +var + R: TRect; + AColor1, AColor2: TColor; +begin + with ACanvas do + begin + R := ABounds; + if not Assigned(AOnDrawBackground) or not AOnDrawBackground(ACanvas, ABounds) then + begin + if AState = Integer(cxbsHot) then + begin + AColor1 := dxOffice11ToolbarsColor1; + AColor2 := dxOffice11ToolbarsColor1; + end + else + begin + AColor1 := HeaderTopColor; + AColor2 := HeaderBottomColor; + end; + with ABounds do + begin + if AIsFooter then + FillRectByColor(ACanvas.Handle, Rect(Left, Top, Right, Bottom), AColor1) + else + begin + FillRectByColor(ACanvas.Handle, Rect(Left, Top, Right, Bottom - 3), AColor1); + FillGradientRect(ACanvas.Handle, Rect(Left, Bottom - 4, Right, Bottom), AColor1, AColor2, False); + end; + end; + end; + if AText <> '' then + begin + Brush.Style := bsClear; + Font := AFont; + Font.Color := ATextColor; + DrawText(AText, ATextAreaBounds, cxAlignmentsHorz[AAlignmentHorz] or + cxAlignmentsVert[AAlignmentVert] or MultiLines[AMultiLine] or + ShowEndEllipsises[AShowEndEllipsis]); + Brush.Style := bsSolid; + end; + if AState = Integer(cxbsHot) then + with ABounds do + FillGradientRect(ACanvas.Handle, Rect(Left - 1, Bottom - 2, Right, Bottom + 1), + dxOffice11SelectedColor1, dxOffice11SelectedColor2, False); + end; +end; + +class function TcxOffice11LookAndFeelPainter.HeaderBottomColor: TColor; +begin + Result := dxOffice11ToolbarsColor2; +end; + +class function TcxOffice11LookAndFeelPainter.HeaderDarkEdgeColor: TColor; +begin + Result := dxOffice11BarSeparatorColor1; +end; + +class function TcxOffice11LookAndFeelPainter.HeaderHighlightEdgeColor: TColor; +begin + Result := dxOffice11BarSeparatorColor2; +end; + +class function TcxOffice11LookAndFeelPainter.HeaderTopColor: TColor; +begin + Result := GetMiddleRGB(dxOffice11ToolbarsColor1, dxOffice11ToolbarsColor2, 50); +end; + +class function TcxOffice11LookAndFeelPainter.FilterDropDownButtonBorderColor(AState: TcxButtonState): TColor; +begin + if AState = cxbsNormal then + Result := HeaderDarkEdgeColor + else + Result := dxOffice11SelectedBorderColor; +end; + +class function TcxOffice11LookAndFeelPainter.TabBorderHighlightColor: TColor; +begin + Result := HeaderDarkEdgeColor; +end; + +class function TcxOffice11LookAndFeelPainter.TabBorderDarkColor: TColor; +begin + Result := inherited TabBorderDarkColor; +end; + +function BtnStateToXPBtnState(AState: TcxButtonState): Integer; +const + ButtonStates: array[TcxButtonState] of Integer =(PBS_DEFAULTED, PBS_NORMAL, + PBS_HOT, PBS_PRESSED, PBS_DISABLED); +begin + Result := ButtonStates[AState]; +end; + +class procedure TcxOffice11LookAndFeelPainter.DrawPanelBackground( + ACanvas: TcxCanvas; AControl: TWinControl; ABounds: TRect; AColorFrom, + AColorTo: TColor); +begin + if AColorFrom = clDefault then + cxDrawTransparentControlBackground(AControl, ACanvas, ABounds) + else + if AColorTo = clDefault then + ACanvas.FillRect(ABounds, AColorFrom) + else + with ABounds do + FillGradientRect(ACanvas.Handle, ABounds, AColorFrom, AColorTo, False); +end; + +{ TcxWinXPLookAndFeelPainter } + +class procedure TcxWinXPLookAndFeelPainter.DrawContent(ACanvas: TcxCanvas; + ATheme: TdxTheme; APartId, AStateId: Integer; const ABounds, ATextAreaBounds: TRect; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; + AMultiLine, AShowEndEllipsis, AShowPrefix: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor); +const + MultiLines: array[Boolean] of Integer = (DT_SINGLELINE, DT_WORDBREAK); + ShowEndEllipsises: array[Boolean] of Integer = (0, DT_END_ELLIPSIS); + ShowPrefixes: array[Boolean] of Integer = (DT_NOPREFIX, 0); +var + R: TRect; +begin + if AText = '' then Exit; + R := ATextAreaBounds; + ACanvas.Font := AFont; + ACanvas.Font.Color := ATextColor; + if AMultiLine then + ACanvas.AlignMultiLineTextRectVertically(R, AText, AAlignmentVert, True, AShowPrefix); + DrawThemeText(ATheme, ACanvas.Handle, APartId, AStateId, AText, + -1, DT_EDITCONTROL or SystemAlignmentsHorz[AAlignmentHorz] or SystemAlignmentsVert[AAlignmentVert] or + ShowEndEllipsises[AShowEndEllipsis] or ShowPrefixes[AShowPrefix] or + MultiLines[AMultiLine], 0, R); +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawSchedulerNavigationButtonContent( + ACanvas: TcxCanvas; const ARect: TRect; const AArrowRect: TRect; + AIsNextButton: Boolean; AState: TcxButtonState); +const + ARotationAngle: array[Boolean] of TcxRotationAngle = (raMinus90, raPlus90); + AStates: array[TcxButtonState] of Integer = + (TIS_NORMAL, TIS_NORMAL, TIS_HOT, TIS_SELECTED, TIS_DISABLED); +var + ABitmap: TcxBitmap; + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totTab); + if ATheme = 0 then + inherited DrawSchedulerNavigationButtonContent(ACanvas, ARect, AArrowRect, + AIsNextButton, AState) + else + begin + ABitmap := TcxBitmap.CreateSize(ARect); + try + BitBlt(ABitmap.Canvas.Handle, 0, 0, ARect.Right - ARect.Left, ARect.Bottom - ARect.Top, + ACanvas.Handle, ARect.Left, ARect.Top, SRCCOPY); + ABitmap.Rotate(ARotationAngle[not AIsNextButton]); + DrawThemeBackground(ATheme, ABitmap.Canvas.Handle, TABP_TABITEM, AStates[AState], + Rect(0, 0, ABitmap.Width, ABitmap.Height)); + ABitmap.Rotate(ARotationAngle[AIsNextButton]); + BitBlt(ACanvas.Handle, ARect.Left, ARect.Top, ARect.Right - ARect.Left, + ARect.Bottom - ARect.Top, ABitmap.Canvas.Handle, 0, 0, SRCCOPY); + DrawSchedulerNavigationButtonArrow(ACanvas, AArrowRect, AIsNextButton, + ButtonSymbolColor(AState)); + finally + ABitmap.Free; + end; + end; +end; + +class function TcxWinXPLookAndFeelPainter.LookAndFeelStyle: TcxLookAndFeelStyle; +begin + Result := lfsNative; +end; + +class function TcxWinXPLookAndFeelPainter.DefaultSchedulerBorderColor: TColor; +var + AColor: TColorRef; +begin + GetThemeColor(OpenTheme(totComboBox), CP_DROPDOWNBUTTON, CBXS_NORMAL, TMT_BORDERCOLOR, AColor); + Result := AColor; +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawArrow(ACanvas: TcxCanvas; + const R: TRect; AArrowDirection: TcxArrowDirection; AColor: TColor); +begin + inherited; // for BCB6 conversion +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawArrow(ACanvas: TcxCanvas; + const R: TRect; AState: TcxButtonState; AArrowDirection: TcxArrowDirection; + ADrawBorder: Boolean = True); + +{$WARNINGS OFF} + function GetState: Integer; + begin + case AArrowDirection of + adUp: + case AState of + cxbsDefault, cxbsNormal: + Result := ABS_UPNORMAL; + cxbsHot: + Result := ABS_UPHOT; + cxbsPressed: + Result := ABS_UPPRESSED; + cxbsDisabled: + Result := ABS_UPDISABLED; + end; + adDown: + case AState of + cxbsDefault, cxbsNormal: + Result := ABS_DOWNNORMAL; + cxbsHot: + Result := ABS_DOWNHOT; + cxbsPressed: + Result := ABS_DOWNPRESSED; + cxbsDisabled: + Result := ABS_DOWNDISABLED; + end; + adLeft: + case AState of + cxbsDefault, cxbsNormal: + Result := ABS_LEFTNORMAL; + cxbsHot: + Result := ABS_LEFTHOT; + cxbsPressed: + Result := ABS_LEFTPRESSED; + cxbsDisabled: + Result := ABS_LEFTDISABLED; + end; + adRight: + case AState of + cxbsDefault, cxbsNormal: + Result := ABS_RIGHTNORMAL; + cxbsHot: + Result := ABS_RIGHTHOT; + cxbsPressed: + Result := ABS_RIGHTPRESSED; + cxbsDisabled: + Result := ABS_RIGHTDISABLED; + end; + end; + end; +{$WARNINGS ON} + +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totScrollBar); + if ATheme <> 0 then + DrawThemeBackground(ATheme, ACanvas.Handle, SBP_ARROWBTN, GetState, @R) + else + inherited +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawArrowBorder(ACanvas: TcxCanvas; + const R: TRect; AState: TcxButtonState); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totButton); + if ATheme <> 0 then + DrawThemeBackground(ATheme, ACanvas.Handle, BP_PUSHBUTTON, BtnStateToXPBtnState(AState), @R) + else + inherited; +end; + +class function TcxWinXPLookAndFeelPainter.BorderSize: Integer; +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totListView); + if ATheme <> 0 then + Result := 1 //!!! lcm corrected + else + Result := inherited BorderSize; +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawBorder(ACanvas: TcxCanvas; R: TRect); +var + ATheme: TdxTheme; + ASavedDC: HDC; +begin + ATheme := OpenTheme(totListView); + if ATheme <> 0 then + begin + //DrawThemeEdge(ATheme, ACanvas.Handle, 0, 0, @R, EDGE_SUNKEN, BF_RECT, nil) + ASavedDC := SaveDC(ACanvas.Handle); + InflateRect(R, -1, -1); + ACanvas.ExcludeClipRect(R); + InflateRect(R, 1, 1); + DrawThemeBackground(ATheme, ACanvas.Handle, LVP_EMPTYTEXT, 0, @R); + RestoreDC(ACanvas.Handle, ASavedDC); + end + else + inherited; +end; + +class function TcxWinXPLookAndFeelPainter.AdjustGroupButtonDisplayRect( + const R: TRect; AButtonCount, AButtonIndex: Integer): TRect; +begin + Result := inherited AdjustGroupButtonDisplayRect(R, AButtonCount, AButtonIndex); + if IsThemeBackgroundPartiallyTransparent(OpenTheme(totButton), BP_PUSHBUTTON, PBS_NORMAL) then + InflateRect(Result, 1, 1); +end; + +class function TcxWinXPLookAndFeelPainter.ButtonBorderSize(AState: TcxButtonState = cxbsNormal): Integer; +var + ATheme: TdxTheme; + R: TRect; +begin + ATheme := OpenTheme(totButton); + if ATheme <> 0 then + begin + R := Rect(0, 0, 100, 100); + GetThemeBackgroundContentRect(ATheme, 0, BP_PUSHBUTTON, BtnStateToXPBtnState(AState), R, R); + Result := R.Left; + end + else + Result := inherited ButtonBorderSize; +end; + +class function TcxWinXPLookAndFeelPainter.ButtonColor(AState: TcxButtonState): TColor; +var + ATheme: TdxTheme; + AColorRef: TColorRef; +begin + ATheme := OpenTheme(totButton); + if ATheme <> 0 then + begin + GetThemeColor(ATheme, BP_PUSHBUTTON, BtnStateToXPBtnState(AState), + TMT_COLOR, AColorRef); + Result := AColorRef; + end + else + Result := inherited ButtonColor(AState); +end; + +class function TcxWinXPLookAndFeelPainter.ButtonFocusRect(ACanvas: TcxCanvas; R: TRect): TRect; +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totButton); + if (ATheme <> 0) and (GetThemeBackgroundContentRect(ATheme, ACanvas.Canvas.Handle, BP_PUSHBUTTON, PBS_NORMAL, R, R) = S_OK) then + Result := R + else + Result := inherited ButtonFocusRect(ACanvas, R); +end; + +class function TcxWinXPLookAndFeelPainter.ButtonGroupBorderSizes(AButtonCount, + AButtonIndex: Integer): TRect; +var + ATheme: TdxTheme; + CR, R: TRect; +begin + ATheme := OpenTheme(totButton); + R := Rect(0, 0, 100, 100); + GetThemeBackgroundContentRect(ATheme, 0, BP_PUSHBUTTON, PBS_NORMAL, R, CR); + Result := Rect(CR.Left, CR.Top, R.Right - CR.Right, R.Bottom - CR.Bottom); + if IsThemeBackgroundPartiallyTransparent(ATheme, BP_PUSHBUTTON, PBS_NORMAL) then + OffsetRect(Result, -1, -1); +end; + +class function TcxWinXPLookAndFeelPainter.ButtonSymbolColor( + AState: TcxButtonState; ADefaultColor: TColor = clDefault): TColor; +var + ATheme: TdxTheme; + AColorRef: TColorRef; +begin + ATheme := OpenTheme(totButton); + if ATheme <> 0 then + begin + GetThemeColor(ATheme, BP_PUSHBUTTON, BtnStateToXPBtnState(AState), + TMT_TEXTCOLOR, AColorRef); + Result := AColorRef; + end + else + Result := inherited ButtonSymbolColor(AState, ADefaultColor); +end; + +class function TcxWinXPLookAndFeelPainter.ButtonTextOffset: Integer; +begin + Result := cxTextOffset; +end; + +class function TcxWinXPLookAndFeelPainter.ButtonTextShift: Integer; +begin + Result := 0; +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawButton(ACanvas: TcxCanvas; R: TRect; + const ACaption: string; AState: TcxButtonState; ADrawBorder: Boolean = True; + AColor: TColor = clDefault; ATextColor: TColor = clDefault; + AWordWrap: Boolean = False); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totButton); + if ATheme <> 0 then + begin + //DrawThemeParentBackground(0, ACanvas.Handle, @R); + DrawThemeBackground(ATheme, ACanvas.Handle, BP_PUSHBUTTON, + BtnStateToXPBtnState(AState), R); + DrawThemeText(ATheme, ACanvas.Handle, BP_PUSHBUTTON, BtnStateToXPBtnState(AState), + ACaption, -1, DT_CENTER or DT_VCENTER or DT_SINGLELINE, 0, R); + end + else + inherited; +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawExpandButton(ACanvas: TcxCanvas; + const R: TRect; AExpanded: Boolean; AColor: TColor = clDefault); +const + States: array[Boolean] of Integer = (GLPS_CLOSED, GLPS_OPENED); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totTreeview); + if ATheme <> 0 then + begin + DrawThemeBackground(ATheme, ACanvas.Handle, TVP_GLYPH, States[AExpanded], @R); + ACanvas.ExcludeClipRect(R); + end + else + inherited; +end; + +class function TcxWinXPLookAndFeelPainter.DrawExpandButtonFirst: Boolean; +begin + Result := False; +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawGroupExpandButton(ACanvas: TcxCanvas; + const R: TRect; AExpanded: Boolean; AState: TcxButtonState); +const + Buttons: array[Boolean] of Integer = (EBP_NORMALGROUPEXPAND, EBP_NORMALGROUPCOLLAPSE); + States: array[cxbsNormal..cxbsPressed] of Integer = (EBNGE_NORMAL, EBNGE_HOT, EBNGE_PRESSED); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totExplorerBar); + if ATheme <> 0 then + DrawThemeBackground(ATheme, ACanvas.Handle, Buttons[AExpanded], States[AState], @R) + else + inherited; +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawSmallExpandButton(ACanvas: TcxCanvas; R: TRect; + AExpanded: Boolean; ABorderColor: TColor; AColor: TColor = clDefault); +begin + if OpenTheme(totTreeview) <> 0 then + DrawExpandButton(ACanvas, R, AExpanded) + else + inherited DrawSmallExpandButton(ACanvas, R, AExpanded, AColor); +end; + +class function TcxWinXPLookAndFeelPainter.ExpandButtonSize: Integer; +var + ATheme: TdxTheme; + ASize: TSize; +begin + ATheme := OpenTheme(totTreeview); + if ATheme <> 0 then + begin + GetThemePartSize(ATheme, 0, TVP_GLYPH, GLPS_OPENED, nil, TS_TRUE, @ASize); + Result := ASize.cx; + end + else + Result := inherited ExpandButtonSize; +end; + +class function TcxWinXPLookAndFeelPainter.GroupExpandButtonSize: Integer; +var + ATheme: TdxTheme; + ASize: TSize; +begin + ATheme := OpenTheme(totExplorerBar); + if ATheme <> 0 then + begin + GetThemePartSize(ATheme, 0, EBP_NORMALGROUPEXPAND, EBNGE_NORMAL, nil, TS_TRUE, @ASize); + Result := ASize.cx; + end + else + Result := inherited GroupExpandButtonSize; +end; + +class function TcxWinXPLookAndFeelPainter.SmallExpandButtonSize: Integer; +begin + if OpenTheme(totTreeview) <> 0 then + Result := ExpandButtonSize + else + Result := inherited SmallExpandButtonSize; +end; + +class function TcxWinXPLookAndFeelPainter.IsButtonHotTrack: Boolean; +begin + Result := True; +end; + +class function TcxWinXPLookAndFeelPainter.IsPointOverGroupExpandButton(const R: TRect; + const P: TPoint): Boolean; +var + ATheme: TdxTheme; + ARegion: HRGN; +begin + ATheme := OpenTheme(totExplorerBar); + if ATheme <> 0 then + begin + GetThemeBackgroundRegion(ATheme, 0, EBP_NORMALGROUPEXPAND, EBNGE_NORMAL, @R, ARegion); + Result := PtInRegion(ARegion, P.X, P.Y); + DeleteObject(ARegion); + end + else + Result := inherited IsPointOverGroupExpandButton(R, P); +end; + +class function TcxWinXPLookAndFeelPainter.CheckBorderSize: Integer; +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totButton); + if ATheme <> 0 then + Result := 0 + else + Result := inherited CheckBorderSize; +end; + +class function TcxWinXPLookAndFeelPainter.CheckButtonSize: TSize; +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totButton); + if ATheme <> 0 then + GetThemePartSize(ATheme, 0, BP_CHECKBOX, CBS_CHECKEDNORMAL, TS_TRUE, Result) + else + Result := inherited CheckButtonSize; +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawCheck(ACanvas: TcxCanvas; const R: TRect; + AState: TcxButtonState; AChecked: Boolean; AColor: TColor); +const + States: array[Boolean, TcxButtonState] of Integer = + ((CBS_UNCHECKEDNORMAL, CBS_UNCHECKEDNORMAL, CBS_UNCHECKEDHOT, CBS_UNCHECKEDPRESSED, CBS_UNCHECKEDDISABLED), + (CBS_CHECKEDNORMAL, CBS_CHECKEDNORMAL, CBS_CHECKEDHOT, CBS_CHECKEDPRESSED, CBS_CHECKEDDISABLED)); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totButton); + if ATheme <> 0 then + begin + //DrawThemeParentBackground(0, ACanvas.Handle, @R); + DrawThemeBackground(ATheme, ACanvas.Handle, BP_CHECKBOX, States[AChecked, AState], @R); + end + else + inherited; +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawCheckBorder(ACanvas: TcxCanvas; R: TRect; + AState: TcxButtonState); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totButton); + if ATheme = 0 then inherited; +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawRadioButton(ACanvas: TcxCanvas; X, Y: Integer; + AButtonState: TcxButtonState; AChecked: Boolean; AFocused: Boolean; ABrushColor: TColor; AIsDesigning: Boolean = False); + + function GetNativeState: Integer; + const + ANativeStateMap: array [Boolean, TcxButtonState] of Integer = ( + (RBS_UNCHECKEDNORMAL, RBS_UNCHECKEDNORMAL, RBS_UNCHECKEDHOT, + RBS_UNCHECKEDPRESSED, RBS_UNCHECKEDDISABLED), + (RBS_CHECKEDNORMAL,RBS_CHECKEDNORMAL, RBS_CHECKEDHOT, + RBS_CHECKEDPRESSED, RBS_CHECKEDDISABLED) + ); + begin + Result := ANativeStateMap[AChecked, AButtonState]; + end; + +var + ARadioButtonSize: TSize; +begin + ARadioButtonSize := RadioButtonSize; + DrawThemeBackground(OpenTheme(totButton), ACanvas.Handle, BP_RADIOBUTTON, + GetNativeState, Rect(X, Y, X + ARadioButtonSize.cx, Y + ARadioButtonSize.cy)); +end; + +class function TcxWinXPLookAndFeelPainter.RadioButtonSize: TSize; +begin + GetThemePartSize(OpenTheme(totButton), 0, BP_RADIOBUTTON, RBS_UNCHECKEDNORMAL, + TS_TRUE, Result); +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawHeader(ACanvas: TcxCanvas; + const ABounds, ATextAreaBounds: TRect; ANeighbors: TcxNeighbors; ABorders: TcxBorders; + AState: TcxButtonState; AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; + AMultiLine, AShowEndEllipsis: Boolean; const AText: string; AFont: TFont; + ATextColor, ABkColor: TColor; AOnDrawBackground: TcxDrawBackgroundEvent = nil; + AIsLast: Boolean = False; AInGroupByBox: Boolean = False); +const + States: array[TcxButtonState] of Integer = (HIS_NORMAL, HIS_NORMAL, HIS_HOT, HIS_PRESSED, HIS_NORMAL); + + function GetHeaderItem: Integer; + begin + if AIsLast and (States[AState] = HIS_NORMAL) and + (GetOffice11Scheme in [schNormalColor, schHomestead]) then + Result := HP_HEADERITEMRIGHT + else + Result := HP_HEADERITEM; + end; + +var + ATheme: TdxTheme; + R: TRect; + AItem: Integer; +begin + ATheme := OpenTheme(totHeader); + if ATheme <> 0 then + begin + AItem := GetHeaderItem; + // DrawThemeParentBackground(0, ACanvas.Handle, @ABounds); + DrawThemeBackground(ATheme, ACanvas.Handle, AItem, States[AState], @ABounds); + R := ATextAreaBounds; + if AState = cxbsPressed then OffsetRect(R, 1, 1); + DrawContent(ACanvas, ATheme, AItem, States[AState], ABounds, R, + AAlignmentHorz, AAlignmentVert, AMultiLine, AShowEndEllipsis, False, AText, + AFont, ATextColor, ABkColor); + end + else + inherited; +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawHeaderPressed(ACanvas: TcxCanvas; + const ABounds: TRect); +begin +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawHeaderControlSection( + ACanvas: TcxCanvas; const ABounds, ATextAreaBounds: TRect; + ANeighbors: TcxNeighbors; ABorders: TcxBorders; AState: TcxButtonState; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; AMultiLine, + AShowEndEllipsis: Boolean; const AText: string; AFont: TFont; ATextColor, + ABkColor: TColor); +begin + ACanvas.Brush.Color := clBtnFace; + ACanvas.FillRect(ABounds); + DrawHeader(ACanvas, ABounds, ATextAreaBounds, ANeighbors, ABorders, + AState, AAlignmentHorz, AAlignmentVert, AMultiLine, AShowEndEllipsis, AText, + AFont, ATextColor, ABkColor); +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawSortingMark(ACanvas: TcxCanvas; + const R: TRect; AAscendingSorting: Boolean); +begin + TcxUltraFlatLookAndFeelPainter.DrawSortingMark(ACanvas, R, AAscendingSorting); +end; + +class function TcxWinXPLookAndFeelPainter.HeaderBorderSize: Integer; +var + ATheme: TdxTheme; + R: TRect; +begin + ATheme := OpenTheme(totHeader); + if ATheme <> 0 then + begin + R := Rect(0, 0, 100, 100); + GetThemeBackgroundContentRect(ATheme, 0, HP_HEADERITEM, HIS_NORMAL, R, R); + Result := (R.Left + R.Top) div 2; + end + else + Result := inherited HeaderBorderSize; +end; + +class function TcxWinXPLookAndFeelPainter.HeaderControlSectionBorderSize( + AState: TcxButtonState = cxbsNormal): Integer; +begin + Result := HeaderBorderSize; +end; + +class function TcxWinXPLookAndFeelPainter.HeaderControlSectionContentBounds( + const ABounds: TRect; AState: TcxButtonState): TRect; +var + ABorderWidth: Integer; + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totHeader); + if ATheme <> 0 then + begin + ABorderWidth := HeaderBorderSize; + Result := ABounds; + InflateRect(Result, -ABorderWidth, -ABorderWidth); + end + else + Result := inherited HeaderControlSectionContentBounds(ABounds, AState); +end; + +{class function TcxWinXPLookAndFeelPainter.HeaderDrawCellsFirst: Boolean; +begin + Result := False; +end;} + +class function TcxWinXPLookAndFeelPainter.IsHeaderHotTrack: Boolean; +begin + Result := True; +end; + +class function TcxWinXPLookAndFeelPainter.SortingMarkSize: TPoint; +begin + Result := TcxUltraFlatLookAndFeelPainter.SortingMarkSize; +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawFooterBorder(ACanvas: TcxCanvas; + const R: TRect); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totEdit); + if ATheme <> 0 then + DrawThemeEdge(ATheme, ACanvas.Handle, 0, 0, @R, BDR_RAISEDINNER, BF_RECT, nil) + else + inherited; +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawFooterCell(ACanvas: TcxCanvas; + const ABounds: TRect; AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; + AMultiLine: Boolean; const AText: string; AFont: TFont; ATextColor, ABkColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totTrackBar); + if ATheme <> 0 then + begin + //DrawThemeParentBackground(0, ACanvas.Handle, @ABounds); + DrawThemeBackground(ATheme, ACanvas.Handle, TKP_TRACK, TRS_NORMAL, @ABounds); + DrawContent(ACanvas, ATheme, TKP_TRACK, TRS_NORMAL, ABounds, FooterCellTextAreaBounds(ABounds), + AAlignmentHorz, AAlignmentVert, AMultiLine, False, False, AText, AFont, + ATextColor, ABkColor); + end + else + inherited; +end; + +class function TcxWinXPLookAndFeelPainter.FooterBorderSize: Integer; +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totEdit); + if ATheme <> 0 then + Result := 1 //!!! + else + Result := inherited FooterBorderSize; +end; + +class function TcxWinXPLookAndFeelPainter.FooterCellBorderSize: Integer; +var + ATheme: TdxTheme; + R: TRect; +begin + ATheme := OpenTheme(totTrackBar); + if ATheme <> 0 then + begin + R := Rect(0, 0, 100, 100); + GetThemeBackgroundContentRect(ATheme, 0, TKP_TRACK, TRS_NORMAL, R, R); + Result := R.Left; + end + else + Result := inherited FooterCellBorderSize; +end; + +class function TcxWinXPLookAndFeelPainter.FooterCellOffset: Integer; +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totTrackBar); + if ATheme <> 0 then + Result := 1 + else + Result := inherited FooterCellOffset; +end; + +class function TcxWinXPLookAndFeelPainter.FooterDrawCellsFirst: Boolean; +begin + Result := False; +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawFilterCloseButton(ACanvas: TcxCanvas; + R: TRect; AState: TcxButtonState); +const + States: array[TcxButtonState] of Integer = (CBS_NORMAL, CBS_NORMAL, CBS_HOT, + CBS_PUSHED, CBS_DISABLED); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totWindow); + if ATheme <> 0 then + begin + //DrawThemeParentBackground(0, ACanvas.Handle, @R); + DrawThemeBackground(ATheme, ACanvas.Handle, WP_SMALLCLOSEBUTTON, States[AState], @R); + end + else + inherited; +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawFilterDropDownButton(ACanvas: TcxCanvas; + R: TRect; AState: TcxButtonState; AIsFilterActive: Boolean); +const + States: array[TcxButtonState] of Integer =(CBXS_NORMAL, CBXS_NORMAL, CBXS_HOT, + CBXS_PRESSED, CBXS_DISABLED); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totComboBox); + if ATheme <> 0 then + begin + //DrawThemeParentBackground(0, ACanvas.Handle, @R); + DrawThemeBackground(ATheme, ACanvas.Handle, CP_DROPDOWNBUTTON, States[AState], @R); + end + else + inherited; +end; + +class function TcxWinXPLookAndFeelPainter.FilterActivateButtonSize: TPoint; +var + ATheme: TdxTheme; + ASize: TSize; +begin + ATheme := OpenTheme(totButton); + if ATheme <> 0 then + begin + GetThemePartSize(ATheme, 0, BP_CHECKBOX, CBS_CHECKEDNORMAL, nil, TS_TRUE, @ASize); + Result.X := ASize.cx; Result.Y := ASize.cy; + end + else + Result := inherited FilterActivateButtonSize; +end; + +class function TcxWinXPLookAndFeelPainter.FilterCloseButtonSize: TPoint; +var + ATheme: TdxTheme; + ASize: TSize; +begin + ATheme := OpenTheme(totWindow); + if ATheme <> 0 then + begin + GetThemePartSize(ATheme, 0, WP_SMALLCLOSEBUTTON, CBXS_NORMAL, nil, TS_TRUE, @ASize); + Result := Point(ASize.cx + 4, ASize.cy + 4); + end + else + Result := inherited FilterCloseButtonSize +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawTab(ACanvas: TcxCanvas; R: TRect; + ABorders: TcxBorders; const AText: string; AState: TcxButtonState; AVertical: Boolean; + AFont: TFont; ATextColor, ABkColor: TColor; AShowPrefix: Boolean = False); +const + States: array[TcxButtonState] of Integer = + (TIS_NORMAL, TIS_NORMAL, TIS_HOT, TIS_SELECTED, TIS_DISABLED); +var + ATheme: TdxTheme; + AOriginalR, ADrawR: TRect; + B: TBitmap; + DC: HDC; + + procedure RotateRect(var R: TRect); + var + I: Integer; + begin + with R do + begin + I := Right; + Right := Bottom; + Bottom := I; + end; + end; + + procedure PrepareRects; + begin + ADrawR := R; + if AVertical then + begin + if not (bTop in ABorders) then Dec(ADrawR.Left, 2); + if not (bBottom in ABorders) then Inc(ADrawR.Right, 2); + end + else + begin + if not (bLeft in ABorders) then Dec(ADrawR.Left, 2); + if not (bRight in ABorders) then Inc(ADrawR.Right, 2); + end; + if AState = cxbsPressed then + Inc(ADrawR.Bottom) + else + Dec(R.Bottom); + end; + +begin + ATheme := OpenTheme(totTab); + if ATheme <> 0 then + begin + if AVertical then + begin + AOriginalR := R; + OffsetRect(R, -R.Left, -R.Top); + RotateRect(R); + B := TBitmap.Create; + B.PixelFormat := pf32bit; + B.HandleType := bmDDB; + B.Width := R.Right; + B.Height := R.Bottom; + DC := B.Canvas.Handle; + end + else + begin + B := nil; + DC := ACanvas.Handle; + end; + + PrepareRects; + DrawThemeBackground(ATheme, DC, TABP_TABITEM, States[AState], @ADrawR, @R); + + if AVertical then + begin + ACanvas.RotateBitmap(B, raPlus90, True); + RotateRect(R); + RotateRect(ADrawR); + ACanvas.CopyRect(Bounds(AOriginalR.Left, AOriginalR.Top, R.Right, R.Bottom), + B.Canvas, R); + B.Free; + OffsetRect(R, AOriginalR.Left, AOriginalR.Top); + OffsetRect(ADrawR, AOriginalR.Left, AOriginalR.Top); + end; + + if AState = cxbsPressed then + if AVertical then + Dec(ADrawR.Right, 2) + else + Dec(ADrawR.Bottom, 2); + DrawContent(ACanvas, ATheme, TABP_TABITEM, States[AState], R, ADrawR, + taCenter, vaCenter, False, False, AShowPrefix, AText, AFont, ATextColor, ABkColor); + end + else + inherited; +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawTabBorder(ACanvas: TcxCanvas; R: TRect; + ABorder: TcxBorder; ABorders: TcxBorders; AVertical: Boolean); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totTab); + if ATheme <> 0 then + begin + // + end + else + inherited; +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawTabsRoot(ACanvas: TcxCanvas; + const R: TRect; ABorders: TcxBorders; AVertical: Boolean); +var + ATheme: TdxTheme; + AContentR, AFullR: TRect; +begin + ATheme := OpenTheme(totTab); + if ATheme <> 0 then + begin + //DrawThemeParentBackground(0, ACanvas.Handle, @R); + GetThemeBackgroundContentRect(ATheme, 0, TABP_PANE, 0, R, AContentR); + AFullR := R; + if AVertical then + begin + Inc(AFullR.Bottom, (R.Bottom - AContentR.Bottom) - (AContentR.Top - R.Top)); + Inc(AFullR.Right, 10); + end + else + begin + Inc(AFullR.Right, (R.Right - AContentR.Right) - (AContentR.Left - R.Left)); + Inc(AFullR.Bottom, 10); + end; + DrawThemeBackground(ATheme, ACanvas.Handle, TABP_PANE, 0, @AFullR, @R); + end + else + inherited; +end; + +class function TcxWinXPLookAndFeelPainter.IsDrawTabImplemented(AVertical: Boolean): Boolean; +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totTab); + if ATheme <> 0 then + Result := True + else + Result := inherited IsDrawTabImplemented(AVertical); +end; + +class function TcxWinXPLookAndFeelPainter.IsTabHotTrack(AVertical: Boolean): Boolean; +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totTab); + if ATheme <> 0 then + Result := True + else + Result := inherited IsTabHotTrack(AVertical); +end; + +class function TcxWinXPLookAndFeelPainter.TabBorderSize(AVertical: Boolean): Integer; +var + ATheme: TdxTheme; + //R: TRect; +begin + ATheme := OpenTheme(totTab); + if ATheme <> 0 then + begin + {R := Rect(0, 0, 100, 100); + GetThemeBackgroundContentRect(ATheme, 0, TABP_TABITEM, TIS_NORMAL, @R, R);} + Result := 1;//R.Left; + end + else + Result := inherited TabBorderSize(AVertical); +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawIndicatorItem(ACanvas: TcxCanvas; + const R: TRect; AKind: TcxIndicatorKind; AColor: TColor; AOnDrawBackground: TcxDrawBackgroundEvent = nil); +begin + TcxFlatLookAndFeelPainter.DrawIndicatorItem(ACanvas, R, AKind, AColor, AOnDrawBackground); +end; + +{class function TcxWinXPLookAndFeelPainter.IndicatorDrawItemsFirst: Boolean; +begin + Result := False; +end;} + +class function TcxWinXPLookAndFeelPainter.ScrollBarMinimalThumbSize( + AVertical: Boolean): Integer; +const + ThumbnailGripKind: array[Boolean] of Integer = (SBP_GRIPPERVERT, SBP_GRIPPERHORZ); + ThumbnailKind: array[Boolean] of Integer = (SBP_THUMBBTNVERT, SBP_THUMBBTNHORZ); +var + ATheme: TdxTheme; + AThumbSize, AGripSize: TSize; +begin + ATheme := OpenTheme(totScrollBar); + if (ATheme <> 0) and (GetThemePartSize(ATheme, 0, ThumbnailGripKind[AVertical], + SCRBS_NORMAL, TS_MIN, AGripSize) = S_OK) then + begin + if (GetThemePartSize(ATheme, 0, ThumbnailGripKind[AVertical], + SCRBS_NORMAL, TS_TRUE, AThumbSize) = S_OK) then + begin + if AVertical then + Result := Max(AGripSize.cy, AThumbSize.cy + 4) + else + Result := Max(AGripSize.cx, AThumbSize.cx + 4); + end else + if AVertical then + Result := AGripSize.cy + else + Result := AGripSize.cx; + Result := Max(Result, cxStdThumbnailMinimalSize); + end else + Result := cxStdThumbnailMinimalSize; +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawScrollBarPart(ACanvas: TcxCanvas; AHorizontal: Boolean; + R: TRect; APart: TcxScrollBarPart; AState: TcxButtonState); +const + ThumbnailKind: array[Boolean] of Integer = (SBP_THUMBBTNVERT, SBP_THUMBBTNHORZ); + ThumbnailGripperKind: array[Boolean] of Integer = (SBP_GRIPPERVERT, SBP_GRIPPERHORZ); + ThumbnailPage: array[Boolean, Boolean] of Integer = + ((SBP_UPPERTRACKVERT, SBP_LOWERTRACKVERT), (SBP_UPPERTRACKHORZ, SBP_LOWERTRACKHORZ)); + + function GetThumbnailState: Integer; + begin + case AState of + cxbsHot: Result := SCRBS_HOT; + cxbsPressed: Result := SCRBS_PRESSED; + cxbsDisabled: Result := SCRBS_DISABLED; + else + Result := SCRBS_NORMAL; + end; + end; + +var + ATheme: TdxTheme; +begin + if IsRectEmpty(R) then Exit; + case APart of + sbpLineUp, sbpLineDown: + begin + ATheme := OpenTheme(totScrollBar); + if ATheme <> 0 then + DrawArrow(ACanvas, R, AState, GetArrowDirection(AHorizontal, APart)) + else + inherited; + end; + sbpThumbnail: + begin + ATheme := OpenTheme(totScrollBar); + if ATheme <> 0 then + begin + DrawThemeBackground(ATheme, ACanvas.Handle, ThumbnailKind[AHorizontal], + GetThumbnailState, @R); + DrawThemeBackground(ATheme, ACanvas.Handle, ThumbnailGripperKind[AHorizontal], 0, @R); + end + else + inherited; + end; + sbpPageUp, sbpPageDown: + begin + ATheme := OpenTheme(totScrollBar); + if ATheme <> 0 then + DrawThemeBackground(ATheme, ACanvas.Handle, + ThumbnailPage[AHorizontal, APart = sbpPageUp], GetThumbnailState, @R) + else + inherited; + end; + end; +end; + +class function TcxWinXPLookAndFeelPainter.DefaultSchedulerViewContentColor: TColor; +begin + Result := $D5FFFF; +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawMonthHeader( + ACanvas: TcxCanvas; const ABounds: TRect; const AText: string; + ANeighbors: TcxNeighbors; const AViewParams: TcxViewParams; + AArrows: TcxHeaderArrows; ASideWidth: Integer; + AOnDrawBackground: TcxDrawBackgroundEvent = nil); +begin + DrawHeader(ACanvas, ABounds, ABounds, ANeighbors, cxBordersAll, cxbsNormal, taCenter, + vaCenter, False, False, AText, AViewParams.Font, AViewParams.TextColor, + AViewParams.Color, AOnDrawBackground, not (nRight in ANeighbors)); + DrawMonthHeaderArrows(ACanvas, ABounds, AArrows, ASideWidth, clWindowText); +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawSchedulerEventProgress( + ACanvas: TcxCanvas; const ABounds, AProgressChunk: TRect; + AViewParams: TcxViewParams; ATransparent: Boolean); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totProgress); + if ATheme = 0 then + inherited DrawSchedulerEventProgress(ACanvas, ABounds, AProgressChunk, + AViewParams, ATransparent) + else + begin + DrawThemeBackground(ATheme, ACanvas.Handle, PP_BAR, 0, ABounds); + DrawThemeBackground(ATheme, ACanvas.Handle, PP_CHUNK, 0, AProgressChunk); + end; +end; + +class function TcxWinXPLookAndFeelPainter.SchedulerEventProgressOffsets: TRect; +begin + Result := Rect(3, 3, 3, 3); +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawSchedulerNavigatorButton( + ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); +const + ButtonStates: array[TcxButtonState] of Integer = + (TS_HOT, TS_HOT, TS_CHECKED, TS_PRESSED, TS_DISABLED); +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totToolBar); + if ATheme <> 0 then + DrawThemeBackground(ATheme, ACanvas.Handle, TP_BUTTON, + ButtonStates[AState], @R) + else + inherited; +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawSchedulerSplitterBorder( + ACanvas: TcxCanvas; R: TRect; const AViewParams: TcxViewParams; + AIsHorizontal: Boolean); +var + ATheme: TdxTheme; + AColor: TColorRef; +begin + ATheme := OpenTheme(totComboBox); + if (OpenTheme(totListView) <> 0) and (ATheme <> 0) then + begin + GetThemeColor(ATheme, CP_DROPDOWNBUTTON, CBXS_NORMAL, TMT_BORDERCOLOR, AColor); + ACanvas.SetBrushColor(AColor); + if AIsHorizontal then + begin + ACanvas.FillRect(Rect(R.Left, R.Top, R.Right, R.Top + 1)); + ACanvas.FillRect(Rect(R.Left, R.Bottom - 1, R.Right, R.Bottom)); + InflateRect(R, 1, -1); + end + else + begin + ACanvas.FillRect(Rect(R.Left, R.Top, R.Left + 1, R.Bottom)); + ACanvas.FillRect(Rect(R.Right - 1, R.Top, R.Right, R.Bottom)); + InflateRect(R, -1, 1); + end; + ACanvas.FillRect(R, AViewParams); + end + else + TcxStandardLookAndFeelPainter.DrawSchedulerSplitterBorder(ACanvas, R, + AViewParams, AIsHorizontal); +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawSizeGrip(ACanvas: TcxCanvas; + const ARect: TRect; ABackgroundColor: TColor = clDefault); +var + ATheme: Cardinal; +begin + ACanvas.FillRect(ARect, ABackgroundColor); + ATheme := OpenTheme(totScrollBar); + if ATheme <> 0 then + DrawThemeBackground(ATheme, ACanvas.Handle, SBP_SIZEBOX, SZB_RIGHTALIGN, ARect) + else + inherited DrawSizeGrip(ACanvas, ARect); +end; + +class procedure TcxWinXPLookAndFeelPainter.DrawPanelBackground(ACanvas: TcxCanvas; AControl: TWinControl; + ABounds: TRect; AColorFrom, AColorTo: TColor); +begin + if AColorFrom = clDefault then + cxDrawTransparentControlBackground(AControl, ACanvas, ABounds) + else + ACanvas.FillRect(ABounds, AColorFrom); +end; + +{ TcxExtendedStylePainterInfo } + +constructor TcxExtendedStylePainterInfo.Create(const AName: string; + APainter: TcxCustomLookAndFeelPainterClass; AData: TObject); +begin + inherited Create; + Data := AData; + Name := AName; + Painter := APainter; +end; + +destructor TcxExtendedStylePainterInfo.Destroy; +begin + FreeAndNil(Data); + inherited Destroy; +end; + +{ TcxExtendedStylePainters } + +constructor TcxExtendedStylePainters.Create; +begin + inherited Create; + FListeners := TInterfaceList.Create; +end; + +destructor TcxExtendedStylePainters.Destroy; +begin + FListeners.Free; + inherited Destroy; +end; + +procedure TcxExtendedStylePainters.AddListener( + AListener: IcxLookAndFeelPainterListener); +begin + if Listeners.IndexOf(AListener) < 0 then + Listeners.Add(AListener); +end; + +procedure TcxExtendedStylePainters.RemoveListener( + AListener: IcxLookAndFeelPainterListener); +begin + Listeners.Remove(AListener); +end; + +function TcxExtendedStylePainters.Register(const AName: string; + APainter: TcxCustomLookAndFeelPainterClass; AData: TObject): Boolean; +begin + Result := not GetPainterByName(AName, APainter); + if Result then + begin + Add(TcxExtendedStylePainterInfo.Create(AName, APainter, AData)); + SortPainters; + Changed(APainter); + end; +end; + +procedure TcxExtendedStylePainters.SortPainters; +begin + Sort(TListSortCompare(@cxExtendedStylePaintersSortProc)); +end; + +function TcxExtendedStylePainters.GetNameByPainter( + APainter: TcxCustomLookAndFeelPainterClass; out AName: string): Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to Count - 1 do + begin + Result := Painters[I] = APainter; + if Result then + begin + AName := Names[I]; + Break; + end; + end; +end; + +function TcxExtendedStylePainters.GetPainterData( + APainter: TcxCustomLookAndFeelPainterClass; var Data): Boolean; + + procedure AssignData(AValue: TObject); + begin + TObject(Data) := AValue; + end; + +var + I: Integer; + AInfo: TcxExtendedStylePainterInfo; +begin + Result := False; + AssignData(nil); + for I := 0 to Count - 1 do + begin + AInfo := Items[I]; + Result := APainter = AInfo.Painter; + if Result then + begin + AssignData(AInfo.Data); + Break; + end; + end; +end; + +function TcxExtendedStylePainters.GetPainterByName(const AName: string; + out Painter: TcxCustomLookAndFeelPainterClass): Boolean; +var + AInfo: TcxExtendedStylePainterInfo; +begin + Result := FindInfoByName(AName, AInfo) >= 0; + if Result then + Painter := AInfo.Painter; +end; + +function TcxExtendedStylePainters.Unregister(const AName: string): Boolean; +var + AIndex: Integer; + AInfo: TcxExtendedStylePainterInfo; +begin + AIndex := FindInfoByName(AName, AInfo); + Result := AIndex >= 0; + if Result then + begin + Delete(AIndex); + Changed(AInfo.Painter); + AInfo.Free; + end; +end; + +procedure TcxExtendedStylePainters.Changed(APainter: TcxCustomLookAndFeelPainterClass); +var + I: Integer; +begin + for I := Listeners.Count - 1 downto 0 do + IcxLookAndFeelPainterListener(Listeners[I]).PainterChanged(APainter); +end; + +function TcxExtendedStylePainters.FindInfoByName( + const AName: string; var AInfo: TcxExtendedStylePainterInfo): Integer; +begin + for Result := 0 to Count - 1 do + begin + AInfo := Items[Result]; + if SameText(AName, AInfo.Name) then Exit; + end; + Result := -1; +end; + +function TcxExtendedStylePainters.GetData(AIndex: Integer): TObject; +begin + Result := Items[AIndex].Data; +end; + +function TcxExtendedStylePainters.GetItem(AIndex: Integer): TcxExtendedStylePainterInfo; +begin + Result := TcxExtendedStylePainterInfo(inherited Items[AIndex]); +end; + +function TcxExtendedStylePainters.GetName(AIndex: Integer): string; +begin + Result := Items[AIndex].Name; +end; + +function TcxExtendedStylePainters.GetPainter(AIndex: Integer): TcxCustomLookAndFeelPainterClass; +begin + Result := Items[AIndex].Painter; +end; + +function GetCurrentPainterClass: TcxCustomLookAndFeelPainterClass; +begin + Result := TcxUltraFlatLookAndFeelPainter; +end; + +function GetExtendedStylePainters: TcxExtendedStylePainters; +begin + Result := ExtendedStylePainters; +end; + +procedure PrepareRadioButtonImageList; +begin + RadioButtonImageList; +end; + +procedure CalculateCheckButtonSize; +var + AButtonsBitmap: HBITMAP; + B: Windows.TBitmap; +begin + AButtonsBitmap := LoadBitmap(0, PChar(OBM_CHECKBOXES)); + try + cxGetBitmapData(AButtonsBitmap, B); + FCheckButtonSize := Size(B.bmWidth div 4, B.bmHeight div 3); + finally + DeleteObject(AButtonsBitmap); + end; +end; + +procedure CreateIndicatorImages; +var + B: TBitmap; + + procedure AddImage(const AResourceName: string); + begin + B.LoadFromResourceName(HInstance, AResourceName); + if cxIndicatorImages = nil then + cxIndicatorImages := TImageList.CreateSize(B.Width, B.Height); + cxIndicatorImages.AddMasked(B, clWhite); + end; + +begin + B := TBitmap.Create; + try + AddImage('CX_ARROWBITMAP'); + AddImage('CX_EDITBITMAP'); + AddImage('CX_INSERTBITMAP'); + AddImage('CX_MULTIDOTBITMAP'); + AddImage('CX_MULTIARROWBITMAP'); + AddImage('CX_FILTERBITMAP'); + finally + B.Free; + end; +end; + +procedure DestroyIndicatorImages; +begin + FreeAndNil(cxIndicatorImages); +end; + +procedure CreateStdScrollBarBitmaps; +begin + StdScrollBitmaps[False] := TBitmap.Create; + with StdScrollBitmaps[False] do + begin + Width := 8; + Height := 8; + end; + StdScrollBitmaps[True] := TBitmap.Create; + with StdScrollBitmaps[True] do + begin + Width := 8; + Height := 8; + end; + UpdateScrollBarBitmaps; +end; + +procedure UpdateScrollBarBitmaps; +var + X, Y: Integer; +begin + if StdScrollBitmaps[False] = nil then + CreateStdScrollBarBitmaps; + for X := 0 to 7 do + for Y := 0 to 7 do + if (Y mod 2) = (X mod 2) then + begin + StdScrollBitmaps[False].Canvas.Pixels[X, Y] := clBtnFace; + StdScrollBitmaps[True].Canvas.Pixels[X, Y] := clBlack; + end + else + begin + StdScrollBitmaps[False].Canvas.Pixels[X, Y] := clBtnHighlight; + StdScrollBitmaps[True].Canvas.Pixels[X, Y] := cl3DDkShadow; + end; +end; + +function cxTextRect(const R: TRect): TRect; +begin + Result := R; + InflateRect(Result, -cxTextOffset, -cxTextOffset); +end; + +procedure DestroyStdScrollBarBitmaps; +begin + FreeAndNil(StdScrollBitmaps[False]); + FreeAndNil(StdScrollBitmaps[True]); +end; + +initialization + ExtendedStylePainters := TcxExtendedStylePainters.Create; + CreateIndicatorImages; + CreateStdScrollBarBitmaps; + FSystemPaletteChangedNotifier := TSystemPaletteChangedNotifier.Create(True); + CalculateCheckButtonSize; + +finalization + FreeAndNil(FSystemPaletteChangedNotifier); + DestroyStdScrollBarBitmaps; + DestroyIndicatorImages; + FreeAndNil(FRadioButtonImageList); + FreeAndNil(ExtendedStylePainters); + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxLookAndFeelPainters.res b/official/x.35/ExpressLibrary/Sources/cxLookAndFeelPainters.res new file mode 100644 index 00000000..f380b79f Binary files /dev/null and b/official/x.35/ExpressLibrary/Sources/cxLookAndFeelPainters.res differ diff --git a/official/x.35/ExpressLibrary/Sources/cxLookAndFeels.pas b/official/x.35/ExpressLibrary/Sources/cxLookAndFeels.pas new file mode 100644 index 00000000..166fac73 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxLookAndFeels.pas @@ -0,0 +1,1008 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressCommonLibrary } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCOMMONLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxLookAndFeels; + +{$I cxVer.inc} + +interface + +uses + dxThemeManager, Messages, dxOffice11, + SysUtils, Controls, Forms, Classes, cxClasses, cxLookAndFeelPainters; + +type + { TcxLookAndFeel } + + TcxLookAndFeelKind = (lfFlat, lfStandard, lfUltraFlat, lfOffice11); + TcxLookAndFeelValue = (lfvKind, lfvNativeStyle, lfvSkinName); + TcxLookAndFeelValues = set of TcxLookAndFeelValue; + +const + cxDefaultLookAndFeelKind = lfUltraFlat; + cxDefaultLookAndFeelNativeStyle = False; + cxDefaultLookAndFeelSkinName = ''; + cxUseSkins: Boolean = True; + +type + TcxLookAndFeel = class; + TcxSystemPaletteChangedNotifier = class; + + IcxLookAndFeelNotificationListener = interface + ['{205538BF-F19E-4285-B11F-B182D9635881}'] + function GetObject: TObject; + procedure MasterLookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); + procedure MasterLookAndFeelDestroying(Sender: TcxLookAndFeel); + end; + + IdxSkinSupport = interface + ['{EF3FF483-9B69-46DF-95A4-D3A3810F63A5}'] + end; + + { IcxLookAndFeelContainer } + + IcxLookAndFeelContainer = interface + ['{6065B58B-C557-4464-A67D-64183FD13F25}'] + function GetLookAndFeel: TcxLookAndFeel; + end; + + { TcxLookAndFeel } + + TcxLookAndFeelChangedEvent = procedure(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues) of object; + + TcxLookAndFeelData = record + Kind: TcxLookAndFeelKind; + NativeStyle: Boolean; + SkinName: string; + Painter: TcxCustomLookAndFeelPainterClass; + end; + + TcxLookAndFeel = class(TcxInterfacedPersistent, IcxLookAndFeelNotificationListener, IcxLookAndFeelPainterListener) + private + FAssignedValues: TcxLookAndFeelValues; + FChangeListenerList: TList; + FCurrentState: TcxLookAndFeelData; + FData: TcxLookAndFeelData; + FIsDestruction: Boolean; + FIsRootLookAndFeel: Boolean; + FMasterLookAndFeel: TcxLookAndFeel; + FPainter: TcxCustomLookAndFeelPainterClass; + FSkinPainter: TcxCustomLookAndFeelPainterClass; + FPrevState: TcxLookAndFeelData; + FSystemPaletteChangedNotifier: TcxSystemPaletteChangedNotifier; + FOnChanged: TcxLookAndFeelChangedEvent; + function GetActiveStyle: TcxLookAndFeelStyle; + function GetKind: TcxLookAndFeelKind; + function GetMasterLookAndFeel: TcxLookAndFeel; + function GetNativeStyle: Boolean; + function GetPainter: TcxCustomLookAndFeelPainterClass; + function GetSkinName: TdxSkinName; + procedure SetAssignedValues(Value: TcxLookAndFeelValues); + procedure SetKind(Value: TcxLookAndFeelKind); + procedure SetMasterLookAndFeel(Value: TcxLookAndFeel); + procedure SetNativeStyle(Value: Boolean); + procedure SetPainter(Value: TcxCustomLookAndFeelPainterClass); + procedure SetSkinName(const Value: TdxSkinName); + + procedure CheckStateChanges; + function GetDefaultKind: TcxLookAndFeelKind; + function GetDefaultNativeStyle: Boolean; + function GetDefaultSkinName: string; + function GetDefaultSkinPainter: TcxCustomLookAndFeelPainterClass; + function IsKindStored: Boolean; + function IsNativeStyleStored: Boolean; + function IsSkinNameStored: Boolean; + procedure ReadSkinNameData(Reader: TReader); + procedure SaveState; + procedure WriteSkinNameData(Writer: TWriter); + + { IcxLookAndFeelNotificationListener } + function GetObject: TObject; + procedure MasterLookAndFeelDestroying(Sender: TcxLookAndFeel); + { IcxLookAndFeelPainterListener } + procedure PainterChanged(APainter: TcxCustomLookAndFeelPainterClass); + protected + procedure Changed(AChangedValues: TcxLookAndFeelValues); + procedure DefineProperties(Filer: TFiler); override; + function InternalGetKind: TcxLookAndFeelKind; virtual; + function InternalGetNativeStyle: Boolean; virtual; + function InternalGetSkinName: string; virtual; + function InternalGetSkinPainter: TcxCustomLookAndFeelPainterClass; virtual; + function IsVisualSkinAvailable(const ASkinName: string; + out Painter: TcxCustomLookAndFeelPainterClass): Boolean; virtual; + procedure MasterLookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); + procedure NotifyChanged; + procedure SystemPaletteChanged; virtual; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure AddChangeListener(AListener: IcxLookAndFeelNotificationListener); + function GetAvailablePainter(ANeededThemedObjectType: + TdxThemedObjectType): TcxCustomLookAndFeelPainterClass; overload; + function GetAvailablePainter(ANeededThemedObjectTypes: + TdxThemedObjectTypes = []): TcxCustomLookAndFeelPainterClass; overload; + procedure Refresh; + procedure RemoveChangeListener(AListener: IcxLookAndFeelNotificationListener); + procedure Reset; + procedure SetStyle(Value: TcxLookAndFeelStyle); + property ActiveStyle: TcxLookAndFeelStyle read GetActiveStyle; + property MasterLookAndFeel: TcxLookAndFeel read GetMasterLookAndFeel write SetMasterLookAndFeel; + property Painter: TcxCustomLookAndFeelPainterClass read GetPainter write SetPainter; + property SkinPainter: TcxCustomLookAndFeelPainterClass read FSkinPainter write FSkinPainter; + property OnChanged: TcxLookAndFeelChangedEvent read FOnChanged write FOnChanged; + published + property AssignedValues: TcxLookAndFeelValues read FAssignedValues write SetAssignedValues stored False; + property Kind: TcxLookAndFeelKind read GetKind write SetKind stored IsKindStored; + property NativeStyle: Boolean read GetNativeStyle write SetNativeStyle stored IsNativeStyleStored; + property SkinName: TdxSkinName read GetSkinName write SetSkinName stored IsSkinNameStored; + end; + + { TcxLookAndFeelController } + + TcxLookAndFeelController = class(TComponent, IcxLookAndFeelNotificationListener) + private + function GetKind: TcxLookAndFeelKind; + function GetNativeStyle: Boolean; + function GetSkinName: TdxSkinName; + function IsSkinNameStored: Boolean; + procedure SetKind(Value: TcxLookAndFeelKind); + procedure SetNativeStyle(Value: Boolean); + procedure SetSkinName(const Value: TdxSkinName); + procedure Modified; + { IcxLookAndFeelNotificationListener } + function GetObject: TObject; + protected + procedure MasterLookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); virtual; + procedure MasterLookAndFeelDestroying(Sender: TcxLookAndFeel); virtual; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + published + property Kind: TcxLookAndFeelKind read GetKind write SetKind default cxDefaultLookAndFeelKind; + property NativeStyle: Boolean read GetNativeStyle write SetNativeStyle default cxDefaultLookAndFeelNativeStyle; + property SkinName: TdxSkinName read GetSkinName write SetSkinName stored IsSkinNameStored; + end; + + { TcxSystemPaletteChangedNotifier } + + TcxSystemPaletteChangedEvent = procedure of object; + + TcxSystemPaletteChangedNotifier = class + private + FIsPrimary: Boolean; + FOnSystemPaletteChanged: TcxSystemPaletteChangedEvent; + protected + procedure DoChanged; virtual; + public + constructor Create(AIsPrimary: Boolean = False); virtual; + destructor Destroy; override; + property OnSystemPaletteChanged: TcxSystemPaletteChangedEvent + read FOnSystemPaletteChanged write FOnSystemPaletteChanged; + end; + + TdxClassSupportsSkinProc = function(AClass: TPersistent): Boolean; + +function RootLookAndFeel: TcxLookAndFeel; +procedure SetControlLookAndFeel(AControl: TWinControl; AMasterLookAndFeel: TcxLookAndFeel); overload; +procedure SetControlLookAndFeel(AControl: TWinControl; AKind: TcxLookAndFeelKind; + ANativeStyle: Boolean); overload; + +var + ClassSupportsSkinProc: TdxClassSupportsSkinProc; + +implementation + +uses +{$IFDEF WIN32} + Windows, +{$ENDIF} + cxControls; + +const + LookAndFeelValueAll = [lfvKind, lfvNativeStyle, lfvSkinName]; + LookAndFeelPainterMap: array[TcxLookAndFeelKind] of TcxCustomLookAndFeelPainterClass = ( + TcxFlatLookAndFeelPainter, + TcxStandardLookAndFeelPainter, + TcxUltraFlatLookAndFeelPainter, + TcxOffice11LookAndFeelPainter + ); + LookAndFeelStyleMap: array[TcxLookAndFeelKind] of TcxLookAndFeelStyle = + (lfsFlat, lfsStandard, lfsUltraFlat, lfsOffice11); + LookAndFeelKindMap: array[TcxLookAndFeelStyle] of TcxLookAndFeelKind = + (lfFlat, lfStandard, lfUltraFlat, lfStandard, lfOffice11); + +type + { TcxSystemPaletteChangedListener } + + TcxSystemPaletteChangedListener = class + private + FNotifierList: TList; + FPrimaryNotifierList: TList; + FWindowHandle: TcxHandle; + procedure DoChange; + procedure WndProc(var Msg: TMessage); + public + constructor Create; + destructor Destroy; override; + procedure AddNotifier(ANotifier: TcxSystemPaletteChangedNotifier; + AIsPrimary: Boolean); + procedure RemoveNotifier(ANotifier: TcxSystemPaletteChangedNotifier; + AIsPrimary: Boolean); + end; + +var + FLookAndFeelControllerCount: Integer; + FRootLookAndFeel: TcxLookAndFeel; + FSystemPaletteChangedListener: TcxSystemPaletteChangedListener; + FSystemPaletteChangedListenerRefCount: Integer; + +procedure SetControlLookAndFeel(AControl: TWinControl; AMasterLookAndFeel: TcxLookAndFeel); +var + AIntf: IcxLookAndFeelContainer; + I: Integer; +begin + if Supports(AControl, IcxLookAndFeelContainer, AIntf) then + AIntf.GetLookAndFeel.MasterLookAndFeel := AMasterLookAndFeel; + for I := 0 to AControl.ControlCount - 1 do + if AControl.Controls[I] is TWinControl then + SetControlLookAndFeel(TWinControl(AControl.Controls[I]), AMasterLookAndFeel); +end; + +procedure SetControlLookAndFeel(AControl: TWinControl; AKind: TcxLookAndFeelKind; + ANativeStyle: Boolean); +var + AIntf: IcxLookAndFeelContainer; + I: Integer; +begin + if Supports(AControl, IcxLookAndFeelContainer, AIntf) then + with AIntf.GetLookAndFeel do + begin + Kind := AKind; + NativeStyle := ANativeStyle; + end; + for I := 0 to AControl.ControlCount - 1 do + if AControl.Controls[I] is TWinControl then + SetControlLookAndFeel(TWinControl(AControl.Controls[I]), AKind, ANativeStyle); +end; + +procedure AddRefSystemPaletteChangedListener; +begin + if FSystemPaletteChangedListenerRefCount = 0 then + FSystemPaletteChangedListener := TcxSystemPaletteChangedListener.Create; + Inc(FSystemPaletteChangedListenerRefCount); +end; + +procedure ReleaseRefSystemPaletteChangedListener; +begin + Dec(FSystemPaletteChangedListenerRefCount); + if FSystemPaletteChangedListenerRefCount = 0 then + FreeAndNil(FSystemPaletteChangedListener); +end; + +function RootLookAndFeel: TcxLookAndFeel; +begin + Result := FRootLookAndFeel; +end; + +{ TcxSystemPaletteChangedListener } + +constructor TcxSystemPaletteChangedListener.Create; +begin + inherited Create; + CreateOffice11Colors; + FWindowHandle := AllocateHWnd(WndProc); + FNotifierList := TList.Create; + FPrimaryNotifierList := TList.Create; +end; + +destructor TcxSystemPaletteChangedListener.Destroy; +begin + FreeAndNil(FPrimaryNotifierList); + FreeAndNil(FNotifierList); + DeallocateHWnd(FWindowHandle); + ReleaseOffice11Colors; + inherited Destroy; +end; + +procedure TcxSystemPaletteChangedListener.AddNotifier( + ANotifier: TcxSystemPaletteChangedNotifier; AIsPrimary: Boolean); +begin + if AIsPrimary then + begin + if FPrimaryNotifierList <> nil then + FPrimaryNotifierList.Add(ANotifier); + end + else + if FNotifierList <> nil then + FNotifierList.Add(ANotifier); +end; + +procedure TcxSystemPaletteChangedListener.RemoveNotifier( + ANotifier: TcxSystemPaletteChangedNotifier; AIsPrimary: Boolean); +begin + if AIsPrimary then + begin + if FPrimaryNotifierList <> nil then + FPrimaryNotifierList.Remove(ANotifier); + end + else + if FNotifierList <> nil then + FNotifierList.Remove(ANotifier); +end; + +procedure TcxSystemPaletteChangedListener.DoChange; +var + I: Integer; +begin + RefreshOffice11Colors; + for I := FPrimaryNotifierList.Count - 1 downto 0 do + //for I := 0 to FPrimaryNotifierList.Count - 1 do + TcxSystemPaletteChangedNotifier(FPrimaryNotifierList[I]).DoChanged; + for I := FNotifierList.Count - 1 downto 0 do + //for I := 0 to FNotifierList.Count - 1 do + TcxSystemPaletteChangedNotifier(FNotifierList[I]).DoChanged; +end; + +procedure TcxSystemPaletteChangedListener.WndProc(var Msg: TMessage); +begin + with Msg do + try + if Msg = WM_SYSCOLORCHANGE then + DoChange; + finally + Result := DefWindowProc(FWindowHandle, Msg, wParam, lParam); + end; +end; + +{ TcxLookAndFeel } + +constructor TcxLookAndFeel.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FChangeListenerList := TList.Create; + FData.Kind := cxDefaultLookAndFeelKind; + FData.NativeStyle := cxDefaultLookAndFeelNativeStyle; + FCurrentState := FData; + FSystemPaletteChangedNotifier := TcxSystemPaletteChangedNotifier.Create; + FSystemPaletteChangedNotifier.OnSystemPaletteChanged := SystemPaletteChanged; + if FRootLookAndFeel <> nil then + begin + FRootLookAndFeel.AddChangeListener(Self); + FCurrentState.Kind := InternalGetKind; + FCurrentState.NativeStyle := InternalGetNativeStyle; + FCurrentState.SkinName := InternalGetSkinName; + FSkinPainter := nil; + if not FCurrentState.NativeStyle then + FSkinPainter := InternalGetSkinPainter; + end; + FCurrentState.Painter := GetAvailablePainter(); +end; + +destructor TcxLookAndFeel.Destroy; +var + I: Integer; +begin + if GetExtendedStylePainters <> nil then + GetExtendedStylePainters.RemoveListener(Self); + FreeAndNil(FSystemPaletteChangedNotifier); + FIsDestruction := True; + for I := 0 to FChangeListenerList.Count - 1 do + begin + IcxLookAndFeelNotificationListener(FChangeListenerList.Items[I]).MasterLookAndFeelDestroying(Self); + end; + FIsDestruction := False; + FreeAndNil(FChangeListenerList); + + if MasterLookAndFeel <> nil then + MasterLookAndFeel.RemoveChangeListener(Self); + + if FIsRootLookAndFeel then + begin + FRootLookAndFeel := nil; + FIsRootLookAndFeel := False; + end; + inherited Destroy; +end; + +procedure TcxLookAndFeel.AddChangeListener(AListener: IcxLookAndFeelNotificationListener); +var + AIsLookAndFeelController: Boolean; +begin + if AListener = nil then + Exit; + AIsLookAndFeelController := AListener.GetObject is TcxLookAndFeelController; + if not FIsRootLookAndFeel and AIsLookAndFeelController then + Exit; + if FChangeListenerList.IndexOf(TObject(AListener)) >= 0 then + Exit; + + if FIsRootLookAndFeel and AIsLookAndFeelController then + Inc(FLookAndFeelControllerCount); + FChangeListenerList.Add(TObject(AListener)); +end; + +function TcxLookAndFeel.GetAvailablePainter(ANeededThemedObjectType: + TdxThemedObjectType): TcxCustomLookAndFeelPainterClass; +begin + if NativeStyle and AreVisualStylesAvailable(ANeededThemedObjectType) then + Result := TcxWinXPLookAndFeelPainter + else + if FSkinPainter <> nil then + Result := FSkinPainter + else + Result := LookAndFeelPainterMap[Kind]; +end; + +function TcxLookAndFeel.GetAvailablePainter(ANeededThemedObjectTypes: + TdxThemedObjectTypes = []): TcxCustomLookAndFeelPainterClass; +begin + if NativeStyle and AreVisualStylesAvailable(ANeededThemedObjectTypes) then + Result := TcxWinXPLookAndFeelPainter + else + if FSkinPainter <> nil then + Result := FSkinPainter + else + Result := LookAndFeelPainterMap[Kind]; +end; + +procedure TcxLookAndFeel.Assign(Source: TPersistent); +begin + if Source is TcxLookAndFeel then + with Source as TcxLookAndFeel do + begin + Self.SaveState; + Self.FData := FData; + Self.FAssignedValues := FAssignedValues; + Self.MasterLookAndFeel := MasterLookAndFeel; + Self.CheckStateChanges; + end + else + inherited Assign(Source); +end; + +procedure TcxLookAndFeel.Refresh; +begin + Changed(LookAndFeelValueAll); +end; + +procedure TcxLookAndFeel.RemoveChangeListener(AListener: IcxLookAndFeelNotificationListener); +var + AIsLookAndFeelController: Boolean; +begin + if AListener = nil then + Exit; + AIsLookAndFeelController := AListener.GetObject is TcxLookAndFeelController; + if FChangeListenerList.IndexOf(TObject(AListener)) < 0 then + Exit; + + if not FIsDestruction then + FChangeListenerList.Remove(TObject(AListener)); + + if FIsRootLookAndFeel and AIsLookAndFeelController then + begin + Dec(FLookAndFeelControllerCount); + if FLookAndFeelControllerCount = 0 then + Reset; + end; +end; + +procedure TcxLookAndFeel.Reset; +begin + AssignedValues := []; +end; + +procedure TcxLookAndFeel.SetStyle(Value: TcxLookAndFeelStyle); +begin + NativeStyle := Value = lfsNative; + if not NativeStyle then + Kind := LookAndFeelKindMap[Value]; +end; + +procedure TcxLookAndFeel.Changed(AChangedValues: TcxLookAndFeelValues); +var + I, APrevCount: Integer; +begin + if (AChangedValues = []) or FIsDestruction then Exit; + FCurrentState.Kind := InternalGetKind; + FCurrentState.NativeStyle := InternalGetNativeStyle; + FCurrentState.SkinName := InternalGetSkinName; + FSkinPainter := nil; + if not FCurrentState.NativeStyle then + FSkinPainter := InternalGetSkinPainter; + FCurrentState.Painter := GetAvailablePainter; + if GetExtendedStylePainters <> nil then + begin + if FSkinPainter <> nil then + GetExtendedStylePainters.AddListener(Self) + else + GetExtendedStylePainters.RemoveListener(Self); + end; + I := 0; + while I < FChangeListenerList.Count do + begin + APrevCount := FChangeListenerList.Count; + IcxLookAndFeelNotificationListener(FChangeListenerList.Items[I]).MasterLookAndFeelChanged(Self, AChangedValues); + if APrevCount = FChangeListenerList.Count then + Inc(I); + end; + if Assigned(FOnChanged) then + FOnChanged(Self, AChangedValues); +end; + +procedure TcxLookAndFeel.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('SkinName', ReadSkinNameData, WriteSkinNameData, + IsSkinNameStored); +end; + +function TcxLookAndFeel.InternalGetKind: TcxLookAndFeelKind; +begin + if lfvKind in FAssignedValues then + Result := FData.Kind + else + Result := GetDefaultKind; +end; + +function TcxLookAndFeel.InternalGetNativeStyle: Boolean; +begin + if lfvNativeStyle in FAssignedValues then + Result := FData.NativeStyle + else + Result := GetDefaultNativeStyle; +end; + +function TcxLookAndFeel.InternalGetSkinName: string; +begin + if lfvSkinName in FAssignedValues then + Result := FData.SkinName + else + Result := GetDefaultSkinName; +end; + +function TcxLookAndFeel.InternalGetSkinPainter: TcxCustomLookAndFeelPainterClass; +begin + if lfvSkinName in FAssignedValues then + IsVisualSkinAvailable(FData.SkinName, Result) + else + Result := GetDefaultSkinPainter; +end; + +function TcxLookAndFeel.IsVisualSkinAvailable(const ASkinName: string; + out Painter: TcxCustomLookAndFeelPainterClass): Boolean; +begin + Result := (ASkinName <> '') and + GetExtendedStylePainters.GetPainterByName(ASkinName, Painter); + if not Result or not cxUseSkins then + Painter := nil; +end; + +procedure TcxLookAndFeel.MasterLookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); +var + AOwnChangedValues: TcxLookAndFeelValues; +begin + AOwnChangedValues := (LookAndFeelValueAll - FAssignedValues) * AChangedValues; + Changed(AOwnChangedValues); +end; + +procedure TcxLookAndFeel.NotifyChanged; +var + AListener: TObject; + APrevCount, I: Integer; +begin + if FIsDestruction then + Exit; + I := 0; + while I < FChangeListenerList.Count do + begin + APrevCount := FChangeListenerList.Count; + AListener := IcxLookAndFeelNotificationListener(FChangeListenerList.Items[I]).GetObject; + if AListener is TcxLookAndFeel then + TcxLookAndFeel(AListener).NotifyChanged; + if APrevCount = FChangeListenerList.Count then + Inc(I); + end; + if Assigned(FOnChanged) then + FOnChanged(Self, []); +end; + +procedure TcxLookAndFeel.SystemPaletteChanged; +begin + Changed([lfvNativeStyle]); +end; + +function TcxLookAndFeel.GetActiveStyle: TcxLookAndFeelStyle; +begin + if NativeStyle and AreVisualStylesAvailable then + Result := lfsNative + else + Result := LookAndFeelStyleMap[Kind]; +end; + +function TcxLookAndFeel.GetKind: TcxLookAndFeelKind; +begin + Result := FCurrentState.Kind; +end; + +function TcxLookAndFeel.GetMasterLookAndFeel: TcxLookAndFeel; +begin + if FIsRootLookAndFeel then + Result := nil + else + if FMasterLookAndFeel = nil then + Result := FRootLookAndFeel + else + Result := FMasterLookAndFeel; +end; + +function TcxLookAndFeel.GetNativeStyle: Boolean; +begin + Result := FCurrentState.NativeStyle; +end; + +function TcxLookAndFeel.GetPainter: TcxCustomLookAndFeelPainterClass; +begin + if FPainter = nil then + Result := FCurrentState.Painter + else + Result := FPainter; +end; + +function TcxLookAndFeel.GetSkinName: TdxSkinName; +begin + Result := FCurrentState.SkinName; +end; + +procedure TcxLookAndFeel.SetAssignedValues(Value: TcxLookAndFeelValues); +begin + if Value <> FAssignedValues then + begin + SaveState; + FAssignedValues := Value; + CheckStateChanges; + end; +end; + +procedure TcxLookAndFeel.SetKind(Value: TcxLookAndFeelKind); +var + AOldKind: TcxLookAndFeelKind; +begin + AOldKind := Kind; + Include(FAssignedValues, lfvKind); + FData.Kind := Value; + if AOldKind <> InternalGetKind then + Changed([lfvKind]); +end; + +procedure TcxLookAndFeel.SetMasterLookAndFeel(Value: TcxLookAndFeel); +begin + if FIsRootLookAndFeel or (Value = Self) then Exit; + if Value <> MasterLookAndFeel then + begin + SaveState; + if MasterLookAndFeel <> nil then + MasterLookAndFeel.RemoveChangeListener(Self); + FMasterLookAndFeel := Value; + if MasterLookAndFeel <> nil then + MasterLookAndFeel.AddChangeListener(Self); + CheckStateChanges; + end; +end; + +procedure TcxLookAndFeel.SetNativeStyle(Value: Boolean); +var + AOldNativeStyle: Boolean; +begin + AOldNativeStyle := NativeStyle; + Include(FAssignedValues, lfvNativeStyle); + FData.NativeStyle := Value; + if AOldNativeStyle <> InternalGetNativeStyle then + Changed([lfvNativeStyle]); +end; + +procedure TcxLookAndFeel.SetPainter(Value: TcxCustomLookAndFeelPainterClass); +begin + if Painter <> Value then + begin + FPainter := Value; + Changed([lfvKind, lfvNativeStyle]); + end; +end; + +procedure TcxLookAndFeel.SetSkinName(const Value: TdxSkinName); +var + AOldSkinName: string; +begin + AOldSkinName := SkinName; + Include(FAssignedValues, lfvSkinName); + FData.SkinName := Value; + if AOldSkinName <> InternalGetSkinName then + Changed([lfvSkinName]); +end; + +procedure TcxLookAndFeel.CheckStateChanges; +var + AChangedValues: TcxLookAndFeelValues; +begin + AChangedValues := []; + if FPrevState.Kind <> InternalGetKind then + Include(AChangedValues, lfvKind); + if FPrevState.NativeStyle <> InternalGetNativeStyle then + Include(AChangedValues, lfvNativeStyle); + if FPrevState.SkinName <> InternalGetSkinName then + Include(AChangedValues, lfvSkinName); + Changed(AChangedValues); +end; + +function TcxLookAndFeel.GetDefaultKind: TcxLookAndFeelKind; +begin + if FIsRootLookAndFeel then + Result := cxDefaultLookAndFeelKind + else + if FMasterLookAndFeel = nil then + if FRootLookAndFeel = nil then + Result := cxDefaultLookAndFeelKind + else + Result := FRootLookAndFeel.Kind + else + Result := FMasterLookAndFeel.Kind; +end; + +function TcxLookAndFeel.GetDefaultNativeStyle: Boolean; +begin + if FIsRootLookAndFeel then + Result := cxDefaultLookAndFeelNativeStyle + else + if FMasterLookAndFeel = nil then + if FRootLookAndFeel = nil then + Result := cxDefaultLookAndFeelNativeStyle + else + Result := FRootLookAndFeel.NativeStyle + else + Result := FMasterLookAndFeel.NativeStyle; +end; + +function TcxLookAndFeel.GetDefaultSkinName: string; +begin + if FIsRootLookAndFeel then + Result := cxDefaultLookAndFeelSkinName + else + if FMasterLookAndFeel = nil then + if FRootLookAndFeel = nil then + Result := cxDefaultLookAndFeelSkinName + else + Result := FRootLookAndFeel.SkinName + else + Result := FMasterLookAndFeel.SkinName; +end; + +function TcxLookAndFeel.GetDefaultSkinPainter: TcxCustomLookAndFeelPainterClass; +begin + if FIsRootLookAndFeel then + Result := nil + else + if FMasterLookAndFeel = nil then + if FRootLookAndFeel = nil then + Result := nil + else + FRootLookAndFeel.IsVisualSkinAvailable(FRootLookAndFeel.SkinName, Result) + else + FMasterLookAndFeel.IsVisualSkinAvailable(FMasterLookAndFeel.SkinName, Result); +end; + +function TcxLookAndFeel.IsKindStored: Boolean; +begin + Result := lfvKind in FAssignedValues; +end; + +function TcxLookAndFeel.IsNativeStyleStored: Boolean; +begin + Result := lfvNativeStyle in FAssignedValues; +end; + +function TcxLookAndFeel.IsSkinNameStored: Boolean; +begin + Result := lfvSkinName in FAssignedValues; +end; + +procedure TcxLookAndFeel.ReadSkinNameData(Reader: TReader); +begin + SkinName := Reader.ReadString; +end; + +procedure TcxLookAndFeel.SaveState; +begin + FPrevState.Kind := Kind; + FPrevState.NativeStyle := NativeStyle; + FPrevState.SkinName := SkinName; +end; + +procedure TcxLookAndFeel.WriteSkinNameData(Writer: TWriter); +begin + Writer.WriteString(SkinName); +end; + +function TcxLookAndFeel.GetObject: TObject; +begin + Result := Self; +end; + +procedure TcxLookAndFeel.MasterLookAndFeelDestroying(Sender: TcxLookAndFeel); +begin + MasterLookAndFeel := nil; +end; + +procedure TcxLookAndFeel.PainterChanged(APainter: TcxCustomLookAndFeelPainterClass); +begin + Changed(LookAndFeelValueAll); +end; + +{ TcxLookAndFeelController } + +constructor TcxLookAndFeelController.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + if RootLookAndFeel <> nil then + RootLookAndFeel.AddChangeListener(Self); +end; + +destructor TcxLookAndFeelController.Destroy; +begin + if RootLookAndFeel <> nil then + RootLookAndFeel.RemoveChangeListener(Self); + inherited Destroy; +end; + +function TcxLookAndFeelController.GetKind: TcxLookAndFeelKind; +begin + if RootLookAndFeel = nil then + Result := cxDefaultLookAndFeelKind + else + Result := RootLookAndFeel.Kind; +end; + +function TcxLookAndFeelController.GetNativeStyle: Boolean; +begin + if RootLookAndFeel = nil then + Result := cxDefaultLookAndFeelNativeStyle + else + Result := RootLookAndFeel.NativeStyle; +end; + +function TcxLookAndFeelController.GetSkinName: TdxSkinName; +begin + if RootLookAndFeel = nil then + Result := cxDefaultLookAndFeelSkinName + else + Result := RootLookAndFeel.SkinName; +end; + +function TcxLookAndFeelController.IsSkinNameStored: Boolean; +begin + Result := SkinName <> ''; +end; + +procedure TcxLookAndFeelController.SetKind(Value: TcxLookAndFeelKind); +begin + if RootLookAndFeel <> nil then + RootLookAndFeel.Kind := Value; +end; + +procedure TcxLookAndFeelController.SetNativeStyle(Value: Boolean); +begin + if RootLookAndFeel <> nil then + RootLookAndFeel.NativeStyle := Value; +end; + +procedure TcxLookAndFeelController.SetSkinName(const Value: TdxSkinName); +begin + if RootLookAndFeel <> nil then + RootLookAndFeel.SkinName := Value; +end; + +procedure TcxLookAndFeelController.Modified; +begin +end; + +function TcxLookAndFeelController.GetObject: TObject; +begin + Result := Self; +end; + +procedure TcxLookAndFeelController.MasterLookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); +begin + if csDesigning in ComponentState then + Modified; +end; + +procedure TcxLookAndFeelController.MasterLookAndFeelDestroying(Sender: TcxLookAndFeel); +var + AOwnerForm: TCustomForm; +begin + AOwnerForm := nil; +{$IFDEF DELPHI6} + if (Owner is TFrame) and (TFrame(Owner).Owner is TForm) then + AOwnerForm := TForm(TFrame(Owner).Owner) + else +{$ENDIF} + if Owner is TForm then + AOwnerForm := TForm(Owner); + if AOwnerForm = nil then + Exit; + if AOwnerForm.Designer <> nil then + AOwnerForm.Designer.Modified; +end; + +{ TcxSystemPaletteChangedNotifier } + +constructor TcxSystemPaletteChangedNotifier.Create(AIsPrimary: Boolean = False); +begin + inherited Create; + FIsPrimary := AIsPrimary; + AddRefSystemPaletteChangedListener; + FSystemPaletteChangedListener.AddNotifier(Self, AIsPrimary); +end; + +destructor TcxSystemPaletteChangedNotifier.Destroy; +begin + FSystemPaletteChangedListener.RemoveNotifier(Self, FIsPrimary); + ReleaseRefSystemPaletteChangedListener; +end; + +procedure TcxSystemPaletteChangedNotifier.DoChanged; +begin + if Assigned(FOnSystemPaletteChanged) then + FOnSystemPaletteChanged; +end; + +function ClassSupportsSkinHandler(AClass: TPersistent): Boolean; +begin + Result := Supports(AClass, IdxSkinSupport); +end; + +initialization +{$IFDEF DELPHI6} + GroupDescendentsWith(TcxLookAndFeelController, TForm); +{$ENDIF} + FRootLookAndFeel := TcxLookAndFeel.Create(nil); + FRootLookAndFeel.FIsRootLookAndFeel := True; + ClassSupportsSkinProc := ClassSupportsSkinHandler; + +finalization + FreeAndNil(FRootLookAndFeel); + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxPropEditors.pas b/official/x.35/ExpressLibrary/Sources/cxPropEditors.pas new file mode 100644 index 00000000..89782fd0 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxPropEditors.pas @@ -0,0 +1,563 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxPropEditors; + +interface + +{$I cxVer.inc} + +uses +{$IFDEF DELPHI6} + DesignIntf, DesignEditors, VCLEditors, + Types, +{$ELSE} + DsgnIntf, +{$ENDIF} + Windows, Messages, SysUtils, Classes, Graphics, Controls, TypInfo, cxContainer, + ImgList; + +type + TcxNestedEventProperty = class(TMethodProperty) + protected + function GetInstance: TPersistent; virtual; abstract; + public + function GetAttributes: TPropertyAttributes; override; + function GetName: string; override; + procedure GetProperties(Proc: {$IFDEF DELPHI6}TGetPropProc{$ELSE}TGetPropEditProc{$ENDIF}); override; + function GetValue: string; override; + + property Instance: TPersistent read GetInstance; + end; + + TcxNestedParentElementEventProperty = class(TNestedProperty) + private + FOwner: TPersistent; + FPropInfo: PPropInfo; + FParent: TPropertyEditor; + + function GetInstance: TPersistent; + protected + constructor Create(Parent: TPropertyEditor; AOwner: TPersistent; APropInfo: PPropInfo); reintroduce; + public + function GetAttributes: TPropertyAttributes; override; + procedure GetProperties(Proc: {$IFDEF DELPHI6}TGetPropProc{$ELSE}TGetPropEditProc{$ENDIF}); override; + function GetValue: string; override; + function GetName: string; override; + + property Instance: TPersistent read GetInstance; + end; + + TcxNestedElementEventProperty = class(TNestedProperty) + private + FParent: TPropertyEditor; + FPropInfo: PPropInfo; + + function GetTrimmedEventName: string; + function GetPersistentClassNames: string; + function GetInstance: TPersistent; + protected + constructor Create(Parent: TPropertyEditor; APropInfo: PPropInfo); reintroduce; + + function GetFormMethodName: string; virtual; + property Instance: TPersistent read GetInstance; + public + function AllEqual: Boolean; override; + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + function GetEditLimit: Integer; override; + function GetName: string; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const AValue: string); override; + end; + + { TImageIndexProperty } + + TImageIndexProperty = class(TIntegerProperty{$IFDEF DELPHI6}, ICustomPropertyListDrawing{$ENDIF}) + public + function GetImages: TCustomImageList; virtual; abstract; + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + procedure ListMeasureHeight(const Value: string; ACanvas: TCanvas; + var AHeight: Integer); {$IFDEF DELPHI6}virtual{$ELSE}override{$ENDIF}; + procedure ListMeasureWidth(const Value: string; ACanvas: TCanvas; + var AWidth: Integer); {$IFDEF DELPHI6}virtual{$ELSE}override{$ENDIF}; + procedure ListDrawValue(const Value: string; ACanvas: TCanvas; + const ARect: TRect; ASelected: Boolean); {$IFDEF DELPHI6}virtual{$ELSE}override{$ENDIF}; + end; + + { TcxStyleControllerStyleProperty } + + TcxStyleControllerStyleProperty = class(TClassProperty) + private + FProc: {$IFNDEF DELPHI6}TGetPropEditProc{$ELSE}TGetPropProc{$ENDIF}; + procedure GetPropProc({$IFNDEF DELPHI6}Prop: TPropertyEditor{$ELSE}const Prop: IProperty{$ENDIF}); + protected + function GetStyle: TcxContainerStyle; virtual; + function IsPropertyVisible(const APropertyName: string): Boolean; virtual; + public + procedure GetProperties(Proc: {$IFNDEF DELPHI6}TGetPropEditProc{$ELSE}TGetPropProc{$ENDIF}); override; + end; + +procedure ObjectInspectorCollapseProperty; + +implementation + +uses +{$IFDEF DELPHI6} + DesignConst, +{$ELSE} + Consts, +{$ENDIF} + cxClasses; + +function EnumChildProc(WND: HWND; LParam: Integer): BOOL; stdcall +var + AName: array[0..255] of Char; +const + S: string = 'TPropSelection'; +begin + Result := True; + if (GetClassName(WND, @AName[0], 255) <> 0) and (AName = S) then + begin + SendMessage(WND, WM_CHAR, $2D, $4A0001); + InvalidateRect(WND, nil, True); + SendMessage(GetParent(WND), WM_SIZE, 0, 0); + end; +end; + +function EnumWnd(WND: HWND; LParam: Integer): BOOL; stdcall; +begin + Result := True; + EnumChildWindows(WND, @EnumChildProc, 0); +end; + +procedure ObjectInspectorCollapseProperty; +begin + EnumWindows(@EnumWnd, 0); +end; + +function cxNestedEventProperty_GetAttributes: TPropertyAttributes; +begin + Result := [paMultiSelect, paSubProperties, paReadOnly, paRevertable]; +end; + +procedure cxNestedEventProperty_GetProperties(APropertyEditor: TPropertyEditor; + AInstance: TPersistent; Proc: {$IFDEF DELPHI6}TGetPropProc{$ELSE}TGetPropEditProc{$ENDIF}); +var + APropList: TPropList; + I, ACount : Integer; + AClassType: TClass; +begin + if AInstance = nil then Exit; + ACount := GetPropList(AInstance.ClassInfo, [tkMethod], @APropList); + for I := 0 to ACount - 1 do + Proc(TcxNestedElementEventProperty.Create(APropertyEditor, APropList[I])); + ACount := GetPropList(AInstance.ClassInfo, [tkClass], @APropList); + for I := 0 to ACount - 1 do + begin + AClassType := GetTypeData(APropList[I].PropType^).ClassType; + if not AClassType.InheritsFrom(TComponent) and AClassType.InheritsFrom(TPersistent) and + (GetPropList(AClassType.ClassInfo, [tkMethod], nil) <> 0) then + Proc(TcxNestedParentElementEventProperty.Create(APropertyEditor, AInstance, APropList[I])); + end; +end; + +function cxNestedEventProperty_GetValue(AInstance: TPersistent): string; +begin + if AInstance = nil then + Result := '(None)' + else + Result := '(' + AInstance.ClassName + ')'; +end; + +{ TcxNestedEventProperty } + +function TcxNestedEventProperty.GetAttributes: TPropertyAttributes; +begin + Result := cxNestedEventProperty_GetAttributes; +end; + +function TcxNestedEventProperty.GetName: string; +begin + Result := inherited GetName; + Result := Copy(Result, 1, Pos('Events', Result) - 1); +end; + +procedure TcxNestedEventProperty.GetProperties(Proc: {$IFDEF DELPHI6}TGetPropProc{$ELSE}TGetPropEditProc{$ENDIF}); +begin + cxNestedEventProperty_GetProperties(Self, Instance, Proc); +end; + +function TcxNestedEventProperty.GetValue: string; +begin + Result := cxNestedEventProperty_GetValue(Instance); +end; + +{ TcxNestedParentElementEventProperty } + +constructor TcxNestedParentElementEventProperty.Create(Parent: TPropertyEditor; + AOwner: TPersistent; APropInfo: PPropInfo); +begin + inherited Create(Parent); + FParent := Parent; + FOwner := AOwner; + FPropInfo := APropInfo; +end; + +function TcxNestedParentElementEventProperty.GetInstance: TPersistent; +begin + {$IFNDEF DELPHI5} + Result := TPersistent(GetOrdProp(FOwner, FPropInfo)) + {$ELSE} + Result := TPersistent(GetObjectProp(FOwner, FPropInfo)); + {$ENDIF} +end; + +function TcxNestedParentElementEventProperty.GetAttributes: TPropertyAttributes; +begin + Result := cxNestedEventProperty_GetAttributes; +end; + +procedure TcxNestedParentElementEventProperty.GetProperties(Proc: {$IFDEF DELPHI6}TGetPropProc{$ELSE}TGetPropEditProc{$ENDIF}); +begin + cxNestedEventProperty_GetProperties(Self, Instance, Proc); +end; + +function TcxNestedParentElementEventProperty.GetValue: string; +begin + Result := cxNestedEventProperty_GetValue(Instance); +end; + +function TcxNestedParentElementEventProperty.GetName: string; +begin + Result := FPropInfo.Name; +end; + +{ TNestedElementEventProperty } +constructor TcxNestedElementEventProperty.Create(Parent: TPropertyEditor; APropInfo: PPropInfo); +begin + inherited Create(Parent); + FPropInfo := APropInfo; + FParent := Parent; +end; + +function TcxNestedElementEventProperty.AllEqual: Boolean; +var + I: Integer; + V, T: TMethod; +begin + Result := False; + if PropCount > 1 then + begin + V := GetMethodValue; + for I := 1 to PropCount - 1 do + begin + T := GetMethodValueAt(I); + if (T.Code <> V.Code) or (T.Data <> V.Data) then Exit; + end; + end; + Result := True; +end; + +procedure TcxNestedElementEventProperty.Edit; +var + FormMethodName: string; +begin + FormMethodName := GetValue; + if (FormMethodName = '') or + Designer.MethodFromAncestor(GetMethodValue) then + begin + if FormMethodName = '' then + FormMethodName := GetFormMethodName; + if FormMethodName = '' then + raise EPropertyError.Create(SCannotCreateName); + SetValue(FormMethodName); + end; + Designer.ShowMethod(FormMethodName); +end; + +function TcxNestedElementEventProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paMultiSelect, paValueList, paSortList, paRevertable]; +end; + +function TcxNestedElementEventProperty.GetEditLimit: Integer; +begin + Result := MaxIdentLength; +end; + +function TcxNestedElementEventProperty.GetName: string; +begin + Result := FPropInfo.Name; +end; + +function TcxNestedElementEventProperty.GetValue: string; +begin + Result := Designer.GetMethodName(GetMethodProp(Instance, FPropInfo)); +end; + +procedure TcxNestedElementEventProperty.GetValues(Proc: TGetStrProc); +begin + Designer.GetMethods(GetTypeData(FPropInfo.PropType^), Proc); +end; + +procedure TcxNestedElementEventProperty.SetValue(const AValue: string); + + {$IFDEF DELPHI5} + procedure CheckChainCall(const MethodName: string; Method: TMethod); + var + Persistent: TPersistent; + Component: TComponent; + InstanceMethod: string; + Instance: TComponent; + begin + Persistent := GetComponent(0); + if Persistent is TComponent then + begin + Component := TComponent(Persistent); + if (Component.Name <> '') and (Method.Data <> Designer.GetRoot) and + (TObject(Method.Data) is TComponent) then + begin + Instance := TComponent(Method.Data); + InstanceMethod := Instance.MethodName(Method.Code); + if InstanceMethod <> '' then + Designer.ChainCall(MethodName, Instance.Name, InstanceMethod, + GetTypeData(GetPropType)); + end; + end; + end; + {$ENDIF} +var + NewMethod: Boolean; + CurValue: string; + OldMethod: TMethod; +begin + CurValue:= GetValue; + if (CurValue <> '') and (AValue <> '') and ((CompareText(CurValue, AValue) = 0) or + not Designer.MethodExists(AValue)) and not Designer.MethodFromAncestor(GetMethodValue) then + Designer.RenameMethod(CurValue, AValue) + else + begin + NewMethod := (AValue <> '') and not Designer.MethodExists(AValue); + OldMethod := GetMethodValue; + SetMethodProp(Instance, FPropInfo, + Designer.CreateMethod(AValue, GetTypeData(FPropInfo.PropType^))); + if NewMethod then + begin + {$IFDEF DELPHI5} + if (PropCount = 1) and (OldMethod.Data <> nil) and (OldMethod.Code <> nil) then + CheckChainCall(AValue, OldMethod); + {$ENDIF} + Designer.ShowMethod(AValue); + end; + Designer.Modified; + end; +end; + +function TcxNestedElementEventProperty.GetFormMethodName: string; +var + I: Integer; +begin + if GetComponent(0) = Designer.GetRoot then + begin + {$IFNDEF DELPHI5} + if Designer.GetRoot <> nil then + Result := Designer.GetRoot.ClassName + else Result := ''; + {$ELSE} + Result := Designer.GetRootClassName; + {$ENDIF} + if (Result <> '') and (Result[1] = 'T') then + Delete(Result, 1, 1); + end + else + begin + Result := Designer.GetObjectName(GetComponent(0)); + for I := Length(Result) downto 1 do + if Result[I] in ['.','[',']','-','>'] then + Delete(Result, I, 1); + end; + if Result = '' then + raise EPropertyError.Create(SCannotCreateName); + Result := Result + GetPersistentClassNames + GetTrimmedEventName; +end; + +function TcxNestedElementEventProperty.GetTrimmedEventName: string; +begin + Result := GetName; + if (Length(Result) >= 2) and (Result[1] in ['O', 'o']) and + (Result[2] in ['N', 'n']) then + Delete(Result, 1, 2); +end; + +function TcxNestedElementEventProperty.GetPersistentClassNames: string; +var + APropertyEditor: TPropertyEditor; +begin + Result := ''; + APropertyEditor := self; + while APropertyEditor <> nil do + begin + if APropertyEditor is TcxNestedParentElementEventProperty then + APropertyEditor := TcxNestedParentElementEventProperty(APropertyEditor).FParent + else + if APropertyEditor is TcxNestedElementEventProperty then + APropertyEditor := TcxNestedElementEventProperty(APropertyEditor).FParent + else APropertyEditor := nil; + if APropertyEditor <> nil then + Result := APropertyEditor.GetName + Result; + end; +end; + +function TcxNestedElementEventProperty.GetInstance: TPersistent; +begin + Result := nil; + if FParent is TcxNestedEventProperty then + Result := TcxNestedEventProperty(FParent).Instance; + if FParent is TcxNestedParentElementEventProperty then + Result := TcxNestedParentElementEventProperty(FParent).Instance; +end; + +{ TImageIndexProperty } + +function TImageIndexProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList, paRevertable]; +end; + +function TImageIndexProperty.GetValue: string; +begin + Result := IntToStr(GetOrdValue); +end; + +procedure TImageIndexProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + Proc('-1'); + if GetImages <> nil then + for I := 0 to GetImages.Count - 1 do Proc(IntToStr(I)); +end; + +procedure TImageIndexProperty.ListDrawValue(const Value: string; + ACanvas: TCanvas; const ARect: TRect; ASelected: Boolean); +var + AImageWidth: Integer; +begin + with ACanvas do + begin + if GetImages <> nil then + begin + FillRect(ARect); + if ASelected then DrawFocusRect(ARect); + AImageWidth := GetImages.Width + 2 * 2; + GetImages.Draw(ACanvas, ARect.Left + 2, + (ARect.Top + ARect.Bottom - GetImages.Height) div 2, StrToInt(Value)); + end + else + AImageWidth := 0; + TextOut(ARect.Left + AImageWidth + 2, + (ARect.Top + ARect.Bottom - TextHeight(Value)) div 2, Value); + end; +end; + +procedure TImageIndexProperty.ListMeasureHeight(const Value: string; + ACanvas: TCanvas; var AHeight: Integer); +var + AImageHeight, AStringHeight: Integer; +begin + if GetImages <> nil then + AImageHeight := GetImages.Height + 2 * 2 + else + AImageHeight := 0; + AStringHeight := ACanvas.TextHeight(Value); + if AStringHeight > AImageHeight then + AHeight := AStringHeight + else + AHeight := AImageHeight; +end; + +procedure TImageIndexProperty.ListMeasureWidth(const Value: string; + ACanvas: TCanvas; var AWidth: Integer); +var + AImageWidth, AStringWidth: Integer; +begin + if GetImages <> nil then + AImageWidth := GetImages.Width + 2 * 2 + else + AImageWidth := 0; + AStringWidth := ACanvas.TextWidth(Value) + 2 * 2; + AWidth := AImageWidth + AStringWidth; +end; + +procedure TImageIndexProperty.SetValue(const Value: string); +begin + SetOrdValue(StrToInt(Value)); +end; + +{ TcxStyleControllerStyleProperty } + +procedure TcxStyleControllerStyleProperty.GetProperties( + Proc: {$IFNDEF DELPHI6}TGetPropEditProc{$ELSE}TGetPropProc{$ENDIF}); +begin + FProc := Proc; + inherited GetProperties(GetPropProc); +end; + +function TcxStyleControllerStyleProperty.GetStyle: TcxContainerStyle; +begin + Result := TcxStyleController(GetComponent(0)).Styles[csNormal]; +end; + +function TcxStyleControllerStyleProperty.IsPropertyVisible( + const APropertyName: string): Boolean; +begin + Result := not((GetName <> 'Style') and + not GetStyle.IsExtendedStylePropertyPublished(APropertyName)); +end; + +procedure TcxStyleControllerStyleProperty.GetPropProc( + {$IFNDEF DELPHI6}Prop: TPropertyEditor{$ELSE}const Prop: IProperty{$ENDIF}); +begin + if IsPropertyVisible(Prop.GetName) then + FProc(Prop); +end; + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxPropertiesStore.pas b/official/x.35/ExpressLibrary/Sources/cxPropertiesStore.pas new file mode 100644 index 00000000..5867d1d8 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxPropertiesStore.pas @@ -0,0 +1,1014 @@ +{*******************************************************************} +{ } +{ Developer Express Cross Platform Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL AND CLX CONTROLS AS PART OF AN EXECUTABLE } +{ PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} +unit cxPropertiesStore; + +{$I cxVer.inc} + +interface + +uses + Classes, SysUtils, TypInfo, Controls, Forms, +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + cxStorage; + +type + TcxCustomPropertiesStore = class; + + { TcxPropertiesStoreComponent } + TcxPropertiesStoreComponent = class(TCollectionItem, + {$IFNDEF DELPHI6}IUnknown, {$ENDIF}IcxStoredObject, IcxStoredParent) + private + FComponent: TComponent; + FProperties: TStrings; + FPropertiesEx: TStrings; + + procedure ExtractProperties; + function ExtractPersistentAndPropertyName(AStartPersistent: TPersistent; + const AStartName: string; var AResultName: string): TPersistent; + function GetCollectionItemByName(ACollection: TCollection; + const AName: string): TCollectionItem; + function GetPersistentAndPropertyName(const AStartName: string; + var AResultName: string): TPersistent; + function GetStorageModes: TcxStorageModes; + function GetComponentByName(const AName: string): TComponent; + function GetUseInterfaceOnly: Boolean; + procedure InternalGetPropertyValue(const AName: string; var AValue: Variant); + procedure InternalSetPropertyValue(const AName: string; const AValue: Variant); + procedure SetComponent(const Value: TComponent); + procedure SetProperties(const Value: TStrings); + function TestClassProperty(const AName: string; AObject: TObject): Boolean; + procedure AssignStorageProperties(AStorage: TcxStorage); + protected + // IcxStoredParent + function CreateChild(const AObjectName, AClassName: string): TObject; + procedure DeleteChild(const AObjectName: string; AObject: TObject); + procedure GetChildren(AChildren: TStringList); + // IcxStoredObject + function GetObjectName: string; + function GetProperties(AProperties: TStrings): Boolean; + procedure GetPropertyValue(const AName: string; var AValue: Variant); + procedure SetPropertyValue(const AName: string; const AValue: Variant); + // IInterface + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + + function GetPropertiesStore: TcxCustomPropertiesStore; + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + procedure RestoreFrom(AStorage: TcxStorage; AReader: TcxCustomReader); + procedure RestoreFromIniFile(const AStorageName: string); + procedure RestoreFromRegistry(const AStorageName: string); + procedure RestoreFromStream(const AStream: TStream); + procedure StoreTo(AStorage: TcxStorage; AWriter: TcxCustomWriter); + procedure StoreToIniFile(const AStorageName: string; const AReCreate: Boolean); + procedure StoreToRegistry(const AStorageName: string; const AReCreate: Boolean); + procedure StoreToStream(const AStream: TStream; const AReCreate: Boolean); + published + property Component: TComponent read FComponent write SetComponent; + property Properties: TStrings read FProperties write SetProperties; + end; + + { TcxPropertiesStoreComponents } + TcxPropertiesStoreComponents = class(TOwnedCollection) + private + function GetComponentItem(Index: Integer): TcxPropertiesStoreComponent; + procedure SetComponentItem(Index: Integer; + const Value: TcxPropertiesStoreComponent); + protected + function GetPropertiesStore: TcxCustomPropertiesStore; + procedure RemoveComponent(const AComponent: TComponent); + public + property ComponentItems[Index: Integer]: TcxPropertiesStoreComponent read + GetComponentItem write SetComponentItem; default; + end; + + { TcxStorageType } + TcxStorageType = (stIniFile, stRegistry, stStream); + + { TcxCustomPropertiesStore } + TcxCustomPropertiesStore = class(TComponent) + private + FActive: Boolean; + FComponents: TcxPropertiesStoreComponents; + FStorageName: string; + FStorageStream: TStream; + FStorageType: TcxStorageType; + FOnCreateHandler: TNotifyEvent; + FOnDestroyHandler: TNotifyEvent; + + function GetStorageName: string; + procedure SetComponents(const Value: TcxPropertiesStoreComponents); + protected + procedure Loaded; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure OwnerCreate(Sender: TObject); + procedure OwnerDestroy(Sender: TObject); + function CreateReader: TcxCustomReader; + function CreateWriter(AReCreate: Boolean = True): TcxCustomWriter; + function CreateStorage: TcxStorage; + + property Active: Boolean read FActive write FActive default True; + property Components: TcxPropertiesStoreComponents read FComponents write SetComponents; + property StorageName: string read GetStorageName write FStorageName; + property StorageType: TcxStorageType read FStorageType write FStorageType default stIniFile; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + procedure RestoreFrom; + procedure StoreTo(const AReCreate: Boolean = True); + + property StorageStream: TStream read FStorageStream write FStorageStream; + end; + + { TcxPropertiesStore } + TcxPropertiesStore = class(TcxCustomPropertiesStore) + published + property Active; + property Components; + property StorageName; + property StorageType; + end; + +implementation + +{ TcxPropertiesStoreComponent } + +constructor TcxPropertiesStoreComponent.Create(Collection: TCollection); +begin + inherited Create(Collection); + FProperties := TStringList.Create; + FPropertiesEx := TStringList.Create; +end; + +destructor TcxPropertiesStoreComponent.Destroy; +begin + FPropertiesEx.Free; + FProperties.Free; + inherited Destroy; +end; + +procedure TcxPropertiesStoreComponent.Assign(Source: TPersistent); +begin + if Source is TcxPropertiesStoreComponent then + with TcxPropertiesStoreComponent(Source) do + begin + Self.Component := Component; + Self.Properties := Properties; + end + else + inherited; +end; + +procedure TcxPropertiesStoreComponent.RestoreFrom(AStorage: TcxStorage; AReader: TcxCustomReader); +begin + ExtractProperties; + with AStorage do + begin + AssignStorageProperties(AStorage); + RestoreWithExistingReader(Self, AReader); + end; +end; + +procedure TcxPropertiesStoreComponent.RestoreFromIniFile(const AStorageName: string); +var + AStorage: TcxStorage; +begin + ExtractProperties; + AStorage := TcxStorage.Create(AStorageName); + try + AssignStorageProperties(AStorage); + AStorage.RestoreFromIni(Self); + finally + AStorage.Free; + end; +end; + +procedure TcxPropertiesStoreComponent.RestoreFromRegistry(const AStorageName: string); +var + AStorage: TcxStorage; +begin + ExtractProperties; + AStorage := TcxStorage.Create(AStorageName); + try + AssignStorageProperties(AStorage); + AStorage.RestoreFromRegistry(Self); + finally + AStorage.Free; + end; +end; + +procedure TcxPropertiesStoreComponent.RestoreFromStream(const AStream: TStream); +var + AStorage: TcxStorage; +begin + ExtractProperties; + AStorage := TcxStorage.Create(AStream); + try + AssignStorageProperties(AStorage); + AStorage.RestoreFromStream(Self); + finally + AStorage.Free; + end; +end; + +procedure TcxPropertiesStoreComponent.StoreTo(AStorage: TcxStorage; AWriter: TcxCustomWriter); +begin + ExtractProperties; + with AStorage do + begin + AssignStorageProperties(AStorage); + ReCreate := AWriter.ReCreate; + StoreWithExistingWriter(Self, AWriter); + end; +end; + +procedure TcxPropertiesStoreComponent.StoreToIniFile(const AStorageName: string; const AReCreate: Boolean); +var + AStorage: TcxStorage; +begin + ExtractProperties; + AStorage := TcxStorage.Create(AStorageName); + try + AssignStorageProperties(AStorage); + AStorage.ReCreate := AReCreate; + AStorage.StoreToIni(Self); + finally + AStorage.Free; + end; +end; + +procedure TcxPropertiesStoreComponent.StoreToRegistry(const AStorageName: string; const AReCreate: Boolean); +var + AStorage: TcxStorage; +begin + ExtractProperties; + AStorage := TcxStorage.Create(AStorageName); + try + AssignStorageProperties(AStorage); + AStorage.ReCreate := AReCreate; + AStorage.StoreToRegistry(Self); + finally + AStorage.Free; + end; +end; + +procedure TcxPropertiesStoreComponent.StoreToStream(const AStream: TStream; const AReCreate: Boolean); +var + AStorage: TcxStorage; +begin + ExtractProperties; + AStorage := TcxStorage.Create(AStream); + try + AssignStorageProperties(AStorage); + AStorage.ReCreate := AReCreate; + AStorage.StoreToStream(Self); + finally + AStorage.Free; + end; +end; + +function TcxPropertiesStoreComponent.CreateChild(const AObjectName, + AClassName: string): TObject; +begin + Result := nil; +end; + +procedure TcxPropertiesStoreComponent.DeleteChild(const AObjectName: string; AObject: TObject); +begin + if AObject is TCollectionItem then + AObject.Free; +end; + +procedure TcxPropertiesStoreComponent.GetChildren(AChildren: TStringList); +var + ATypeInfo: PTypeInfo; + APropInfo: PPropInfo; + I: Integer; + APersistent: TPersistent; + APropName: string; + AChild: TObject; +begin + AChildren.Clear; + for I := 0 to FProperties.Count - 1 do + begin + APersistent := GetPersistentAndPropertyName(FProperties[I], APropName); + if (APersistent <> nil) and (APropName <> '') then + begin + ATypeInfo := APersistent.ClassInfo; + APropInfo := GetPropInfo(ATypeInfo, APropName); + if APropInfo <> nil then + begin + if APropInfo^.PropType^.Kind = tkClass then + begin + AChild := GetObjectProp(APersistent, APropInfo); + if (AChild is TPersistent) and not (AChild is TComponent) then + AChildren.AddObject(FProperties[I]{APropName}, AChild); + end; + end + else + begin + if APersistent is TCollection then + begin + AChild := GetCollectionItemByName(APersistent as TCollection, APropName); + if AChild <> nil then + AChildren.AddObject(FProperties[I]{APropName}, AChild); + end; + end; + end; + end; +end; + +function TcxPropertiesStoreComponent.GetObjectName: string; +begin + if FComponent <> nil then + Result := FComponent.Name + else + Result := ''; + if Result = '' then + Result := 'Component' + IntToStr(Index); +end; + +function TcxPropertiesStoreComponent.GetProperties( + AProperties: TStrings): Boolean; +var + I: Integer; +begin + for I := 0 to FProperties.Count - 1 do + AProperties.Add(FProperties[I]); + Result := True; +end; + +procedure TcxPropertiesStoreComponent.GetPropertyValue(const AName: string; + var AValue: Variant); +begin + if FComponent <> nil then + InternalGetPropertyValue(AName, AValue) + else + AValue := Null; +end; + +procedure TcxPropertiesStoreComponent.SetPropertyValue(const AName: string; + const AValue: Variant); +begin + if FComponent <> nil then + InternalSetPropertyValue(AName, AValue); +end; + +function TcxPropertiesStoreComponent.QueryInterface(const IID: TGUID; + out Obj): HResult; +const + E_NOINTERFACE = HResult($80004002); +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +function TcxPropertiesStoreComponent._AddRef: Integer; +begin + Result := -1; +end; + +function TcxPropertiesStoreComponent._Release: Integer; +begin + Result := -1; +end; + +function TcxPropertiesStoreComponent.GetPropertiesStore: TcxCustomPropertiesStore; +begin + Result := TcxPropertiesStoreComponents(Collection).GetPropertiesStore; +end; + +procedure TcxPropertiesStoreComponent.ExtractProperties; +var + I: Integer; + APersistent: TPersistent; + AName: string; +begin + FPropertiesEx.Clear; + for I := 0 to FProperties.Count - 1 do + begin + APersistent := ExtractPersistentAndPropertyName(FComponent, FProperties[I], AName); + FPropertiesEx.AddObject(AName, APersistent); + end; +end; + +function TcxPropertiesStoreComponent.ExtractPersistentAndPropertyName( + AStartPersistent: TPersistent; const AStartName: string; + var AResultName: string): TPersistent; + + function ExtractName(var AFName: string): string; + var + AIndex: Integer; + begin + Result := ''; + AIndex := Pos('.', AFName); + if AIndex > 0 then + begin + if AIndex > 1 then + Result := Copy(AFName, 1, AIndex - 1); + Delete(AFName, 1, AIndex); + end + else + begin + Result := AFName; + AFName := ''; + end; + end; + + function GetPersistentByName(const AName: string): TPersistent; + var + ATypeInfo: PTypeInfo; + APropInfo: PPropInfo; + AObject: TObject; + begin + Result := nil; + ATypeInfo := AStartPersistent.ClassInfo; + APropInfo := GetPropInfo(ATypeInfo, AName); + if APropInfo <> nil then + begin + if APropInfo^.PropType^.Kind = tkClass then + begin + AObject := GetObjectProp(AStartPersistent, APropInfo); + if (AObject is TPersistent) and not (AObject is TComponent)then + Result := AObject as TPersistent; + end; + end + else + if AStartPersistent is TCollection then + Result := GetCollectionItemByName(AStartPersistent as TCollection, AName); + end; +var + AFullName: string; + APersistent: TPersistent; +begin + Result := nil; + AFullName := AStartName; + AResultName := ExtractName(AFullName); + if AResultName <> '' then + begin + if AFullName = '' then + Result := AStartPersistent + else + begin + APersistent := GetPersistentByName(AResultName); + if APersistent <> nil then + Result := ExtractPersistentAndPropertyName(APersistent, AFullName, AResultName); + end; + end; +end; + +function TcxPropertiesStoreComponent.GetCollectionItemByName(ACollection: TCollection; + const AName: string): TCollectionItem; +var + AInteger: Integer; + ACode: Integer; +begin + Result := nil; + Val(AName, AInteger, ACode); + if ACode = 0 then + if (AInteger >= 0) and (AInteger < ACollection.Count) then + Result := ACollection.Items[AInteger]; +end; + +function TcxPropertiesStoreComponent.GetPersistentAndPropertyName( + const AStartName: string; var AResultName: string): TPersistent; + + function GetPropIndex: Integer; + var + I: Integer; + begin + Result := -1; + for I := 0 to FProperties.Count - 1 do + if FProperties[I] = AStartName then + begin + Result := I; + Break; + end; + end; +var + AIndex: Integer; +begin + Result := nil; + AResultName := ''; + AIndex := GetPropIndex; + if (AIndex >= 0) and (AIndex < FProperties.Count) then + if FPropertiesEx.Objects[AIndex] <> nil then + begin + Result := FPropertiesEx.Objects[AIndex] as TPersistent; + AResultName := FPropertiesEx[AIndex]; + end; +end; + +function TcxPropertiesStoreComponent.GetStorageModes: TcxStorageModes; +begin + Result := [smChildrenCreating, smChildrenDeleting]; +end; + +function TcxPropertiesStoreComponent.GetComponentByName(const AName: string): TComponent; +var + AComponent: TComponent; +begin + Result := nil; + AComponent := GetPropertiesStore.GetParentComponent; + if AComponent <> nil then + Result := AComponent.FindComponent(AName); + if Result = nil then + begin + AComponent := GetPropertiesStore.Owner; + if AComponent <> nil then + Result := AComponent.FindComponent(AName); + end; +end; + +function TcxPropertiesStoreComponent.GetUseInterfaceOnly: Boolean; +begin + Result := True; +end; + +procedure TcxPropertiesStoreComponent.InternalGetPropertyValue(const AName: string; + var AValue: Variant); +var + APersistent: TPersistent; + +{$IFNDEF DELPHI5} +type + TIntegerSet = set of 0..SizeOf(Integer) * 8 - 1; + + function GetSetProp_(APropInfo: PPropInfo): string; + var + AIS: TIntegerSet; + ATypeInfo: PTypeInfo; + I: Integer; + begin + Result := ''; + Integer(AIS) := GetOrdProp(APersistent, APropInfo); + ATypeInfo := GetTypeData(APropInfo^.PropType^)^.CompType^; + for I := 0 to SizeOf(Integer) * 8 - 1 do + if I in AIS then + begin + if Result <> '' then + Result := Result + ','; + if ATypeInfo^.Kind = tkInteger then + Result := Result + IntToStr(I) + else + Result := Result + GetEnumName(ATypeInfo, I); + end; + Result := '[' + Result + ']'; + end; +{$ENDIF} + +var + ATypeInfo: PTypeInfo; + APropInfo: PPropInfo; + APropName: string; + AObject: TObject; +begin + AValue := Null; + APersistent := GetPersistentAndPropertyName(AName, APropName); + if (APersistent <> nil) and (APropName <> '') then + begin + ATypeInfo := APersistent.ClassInfo; + if ATypeInfo <> nil then + begin + APropInfo := GetPropInfo(ATypeInfo, APropName); + if APropInfo <> nil then + begin + case APropInfo^.PropType^.Kind of + tkInteger, tkChar, tkWChar: + AValue := GetOrdProp(APersistent, APropInfo); + tkEnumeration: + {$IFDEF DELPHI5} + AValue := GetEnumProp(APersistent, APropInfo); + {$ELSE} + if APropInfo^.PropType^.Kind = tkInteger then + AValue := IntToStr(GetOrdProp(APersistent, APropInfo)) + else + AValue := GetEnumName(APropInfo^.PropType^, GetOrdProp(APersistent, APropInfo)); + {$ENDIF} + tkFloat: + AValue := GetFloatProp(APersistent, APropInfo); + tkString, tkLString: + AValue := GetStrProp(APersistent, APropInfo); + {$IFDEF DELPHI6} + tkWString: + AValue := GetWideStrProp(APersistent, APropInfo); + {$ENDIF} + tkSet: + {$IFDEF DELPHI5} + AValue := GetSetProp(APersistent, APropInfo, True); + {$ELSE} + AValue := GetSetProp_(APropInfo); + {$ENDIF} + tkVariant: + AValue := GetVariantProp(APersistent, APropInfo); + {$IFDEF DELPHI6} + tkInt64: + AValue := GetInt64Prop(APersistent, APropInfo); + {$ENDIF} + tkClass: + begin + AObject := GetObjectProp(APersistent, APropInfo); + if AObject = nil then + AValue := '' + else if AObject is TComponent then + AValue := TComponent(AObject).Name; + end; + end; + end; + end; + end; +end; + +procedure TcxPropertiesStoreComponent.InternalSetPropertyValue(const AName: string; + const AValue: Variant); +var + ATypeInfo: PTypeInfo; + APropInfo: PPropInfo; + {$IFDEF DELPHI6} + AInt64: Int64; + {$ENDIF} + APersistent: TPersistent; + APropName: string; + AComponent: TComponent; + AParentComponent: TComponent; + AOwner: TComponent; + AComponentName: string; +begin + if not VarIsNull(AValue) then + begin + APersistent := GetPersistentAndPropertyName(AName, APropName); + if (APersistent <> nil) and (APropName <> '') then + begin + ATypeInfo := APersistent.ClassInfo; + if ATypeInfo <> nil then + begin + APropInfo := GetPropInfo(ATypeInfo, APropName); + if APropInfo <> nil then + begin + case APropInfo^.PropType^.Kind of + tkInteger, tkChar, tkWChar: + SetOrdProp(APersistent, APropInfo, AValue); + tkEnumeration: + {$IFDEF DELPHI6} + SetEnumProp(APersistent, APropInfo, AValue); + {$ELSE} + {$IFDEF DELPHI5} + SetEnumProp(APersistent, APropName, VarToStr(AValue)); + {$ELSE} + SetOrdProp(APersistent, APropInfo, GetEnumValue(APropInfo^.PropType^, AValue)); + {$ENDIF} + {$ENDIF} + tkFloat: + SetFloatProp(APersistent, APropInfo, AValue); + tkString, tkLString: + {$IFDEF DELPHI5} + SetStrProp(APersistent, APropName, VarToStr(AValue)); + {$ELSE} + SetStrProp(APersistent, APropInfo, AValue); + {$ENDIF} + {$IFDEF DELPHI6} + tkWString: + SetWideStrProp(APersistent, APropInfo, AValue); + {$ENDIF} + tkSet: + {$IFDEF DELPHI6} + SetSetProp(APersistent, APropInfo, AValue); + {$ELSE} + {$IFDEF DELPHI5} + SetSetProp(APersistent, APropName, VarToStr(AValue)); + {$ELSE} + SetOrdProp(APersistent, APropInfo, SetSetProp(APropInfo, AValue)); + {$ENDIF} + {$ENDIF} + tkVariant: + SetVariantProp(APersistent, APropInfo, AValue); + {$IFDEF DELPHI6} + tkInt64: + begin + AInt64 := AValue; + SetInt64Prop(APersistent, APropInfo, AInt64); + end; + {$ENDIF} + tkClass: + begin + AComponentName := AValue; + if AComponentName = '' then + SetObjectProp(APersistent, APropInfo, nil) + else + begin + AComponent := nil; + if FComponent is TControl then + AComponent := GetParentForm(FComponent as TControl).FindComponent(AComponentName); + if AComponent = nil then + begin + AParentComponent := FComponent.GetParentComponent; + if AParentComponent <> nil then + AComponent := AParentComponent.FindComponent(AComponentName); + if AComponent = nil then + begin + AOwner := FComponent.Owner; + if AOwner <> nil then + AComponent := AOwner.FindComponent(AComponentName); + end; + end; + if AComponent <> nil then + SetObjectProp(APersistent, APropInfo, AComponent); + end; + end; + end; + end; + end; + end; + end; +end; + +procedure TcxPropertiesStoreComponent.SetComponent(const Value: TComponent); +begin + if Component <> Value then + begin + {$IFDEF DELPHI5} + if (Component <> nil) and not (csDestroying in Component.ComponentState) then + Component.RemoveFreeNotification(GetPropertiesStore); + {$ENDIF} + FComponent := Value; + if (Component <> nil) then + Component.FreeNotification(GetPropertiesStore); + end; +end; + +procedure TcxPropertiesStoreComponent.SetProperties(const Value: TStrings); +begin + FProperties.Assign(Value); +end; + +function TcxPropertiesStoreComponent.TestClassProperty(const AName: string; + AObject: TObject): Boolean; +begin + Result := (AObject is TPersistent) and not (AObject is TComponent); +end; + +procedure TcxPropertiesStoreComponent.AssignStorageProperties(AStorage: TcxStorage); +begin + with AStorage do + begin + Modes := [smSavePublishedClassProperties, smChildrenCreating, smChildrenDeleting]; + OnGetStorageModes := GetStorageModes; + OnTestClassProperty := TestClassProperty; + OnGetComponentByName := GetComponentByName; + OnGetUseInterfaceOnly := GetUseInterfaceOnly; + SaveComponentPropertiesByName := True; + end; +end; + +{ TcxPropertiesStoreComponents } + +function TcxPropertiesStoreComponents.GetPropertiesStore: TcxCustomPropertiesStore; +begin + Result := TcxPropertiesStore({$IFDEF DELPHI6}Owner{$ELSE}GetOwner{$ENDIF}); +end; + +procedure TcxPropertiesStoreComponents.RemoveComponent( + const AComponent: TComponent); +var + AList: TList; + I: Integer; +begin + AList := TList.Create; + try + for I := 0 to Count - 1 do + if ComponentItems[I].Component = AComponent then + AList.Add(ComponentItems[I]); + for I := 0 to AList.Count - 1 do + TcxPropertiesStoreComponent(AList[I]).Free; + finally + AList.Free; + end; +end; + +function TcxPropertiesStoreComponents.GetComponentItem( + Index: Integer): TcxPropertiesStoreComponent; +begin + Result := Items[Index] as TcxPropertiesStoreComponent; +end; + +procedure TcxPropertiesStoreComponents.SetComponentItem(Index: Integer; + const Value: TcxPropertiesStoreComponent); +begin + ComponentItems[Index].Assign(Value); +end; + +{ TcxCustomPropertiesStore } + +constructor TcxCustomPropertiesStore.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FComponents := TcxPropertiesStoreComponents.Create(self, TcxPropertiesStoreComponent); + FStorageName := ''; + FStorageType := stIniFile; + FStorageStream := nil; + FActive := True; +end; + +destructor TcxCustomPropertiesStore.Destroy; +begin + FComponents.Free; + inherited Destroy; +end; + +procedure TcxCustomPropertiesStore.RestoreFrom; +var + I: Integer; + AReader: TcxCustomReader; + AStorage: TcxStorage; +begin + AReader := CreateReader; + AStorage := CreateStorage; + try + for I := 0 to Components.Count - 1 do + Components[I].RestoreFrom(AStorage, AReader); + finally + AStorage.Free; + AReader.Free; + end; +end; + +procedure TcxCustomPropertiesStore.StoreTo(const AReCreate: Boolean); +var + I: Integer; + AWriter: TcxCustomWriter; + AStorage: TcxStorage; +begin + AStorage := CreateStorage; + try + if Components.Count > 0 then + begin + AWriter := CreateWriter(AReCreate); + try + Components[0].StoreTo(AStorage, AWriter); + AWriter.ReCreate := False; + for I := 1 to Components.Count - 1 do + Components[I].StoreTo(AStorage, AWriter); + finally + AWriter.Free; + end; + end; + finally + AStorage.Free; + end; +end; + +procedure TcxCustomPropertiesStore.Loaded; +var + AMyOwnerCreate: TNotifyEvent; +begin + inherited Loaded; + if not (csDesigning in ComponentState) then + begin + if Owner <> nil then + begin + AMyOwnerCreate := OwnerCreate; + if Owner is TForm then + begin + FOnCreateHandler := TForm(Owner).OnCreate; + FOnDestroyHandler := TForm(Owner).OnDestroy; + TForm(Owner).OnCreate := OwnerCreate; + TForm(Owner).OnDestroy := OwnerDestroy; + end + else if Owner is TDataModule then + begin + FOnCreateHandler := TDataModule(Owner).OnCreate; + FOnDestroyHandler := TDataModule(Owner).OnDestroy; + TDataModule(Owner).OnCreate := OwnerCreate; + TDataModule(Owner).OnDestroy := OwnerDestroy; + end; + end; + end; +end; + +procedure TcxCustomPropertiesStore.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if Operation = opRemove then + if (AComponent <> Self) and (AComponent <> Owner) then + Components.RemoveComponent(AComponent); +end; + +procedure TcxCustomPropertiesStore.OwnerCreate(Sender: TObject); +begin + if FActive then + RestoreFrom; + if Assigned(FOnCreateHandler) then + FOnCreateHandler(Sender); +end; + +procedure TcxCustomPropertiesStore.OwnerDestroy(Sender: TObject); +begin + if Assigned(FOnDestroyHandler) then + FOnDestroyHandler(Sender); + if FActive then + begin + if StorageType <> stStream then + StoreTo; + end; +end; + +function TcxCustomPropertiesStore.CreateReader: TcxCustomReader; +begin + Result := nil; + case FStorageType of + stIniFile: + Result := TcxIniFileReader.Create(StorageName); + stRegistry: + Result := TcxRegistryReader.Create(StorageName); + stStream: + begin + Result := TcxStreamReader.Create(StorageName); + (Result as TcxStreamReader).SetStream(FStorageStream); + end; + end; +end; + +function TcxCustomPropertiesStore.CreateWriter(AReCreate: Boolean): TcxCustomWriter; +begin + Result := nil; + case FStorageType of + stIniFile: + Result := TcxIniFileWriter.Create(StorageName, AReCreate); + stRegistry: + Result := TcxRegistryWriter.Create(StorageName, AReCreate); + stStream: + begin + Result := TcxStreamWriter.Create(StorageName, AReCreate); + (Result as TcxStreamWriter).SetStream(FStorageStream); + end; + end; +end; + +function TcxCustomPropertiesStore.CreateStorage: TcxStorage; +begin + Result := nil; + case FStorageType of + stIniFile, stRegistry: + Result := TcxStorage.Create(StorageName); + stStream: + Result := TcxStorage.Create(FStorageStream); + end; +end; + +function TcxCustomPropertiesStore.GetStorageName: string; +begin + if FStorageName <> '' then + Result := FStorageName + else + Result := Name; +end; + +procedure TcxCustomPropertiesStore.SetComponents( + const Value: TcxPropertiesStoreComponents); +begin + Components.Assign(Value); +end; + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxPropertiesStoreEditor.dfm b/official/x.35/ExpressLibrary/Sources/cxPropertiesStoreEditor.dfm new file mode 100644 index 00000000..6b6e7ab3 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxPropertiesStoreEditor.dfm @@ -0,0 +1,1117 @@ +object frmPropertiesStoreEditor: TfrmPropertiesStoreEditor + Left = 412 + Top = 178 + Width = 393 + Height = 553 + Caption = 'PropertiesStore Editor' + Color = clBtnFace + Constraints.MinHeight = 553 + Constraints.MinWidth = 393 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -10 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object pnlClient: TPanel + Left = 0 + Top = 33 + Width = 385 + Height = 486 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object pnlLeftTree: TPanel + Left = 0 + Top = 0 + Width = 272 + Height = 486 + Align = alClient + BevelOuter = bvNone + BorderWidth = 4 + TabOrder = 0 + object pnlLeftTreeTop: TPanel + Left = 4 + Top = 4 + Width = 264 + Height = 29 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object lblFindComponent: TLabel + Left = 7 + Top = 6 + Width = 80 + Height = 13 + Caption = 'Find Component:' + end + object edFindComponent: TEdit + Left = 96 + Top = 4 + Width = 165 + Height = 21 + TabOrder = 0 + OnKeyDown = edFindComponentKeyDown + end + end + object Tree: TTreeView + Left = 4 + Top = 33 + Width = 264 + Height = 449 + Align = alClient + Indent = 19 + ReadOnly = True + RightClickSelect = True + TabOrder = 0 + OnContextPopup = TreeContextPopup + OnCustomDrawItem = TreeCustomDrawItem + OnDeletion = TreeDeletion + OnKeyDown = TreeKeyDown + end + end + object pnlButtons: TPanel + Left = 272 + Top = 0 + Width = 113 + Height = 486 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object Panel1: TPanel + Left = 0 + Top = 348 + Width = 113 + Height = 138 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 113 + Height = 348 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + object btnOK: TButton + Left = 4 + Top = 32 + Width = 105 + Height = 25 + Caption = 'OK' + TabOrder = 0 + OnClick = btnOKClick + end + object btnCancel: TButton + Left = 4 + Top = 64 + Width = 105 + Height = 25 + Caption = 'Cancel' + TabOrder = 1 + OnClick = btnCancelClick + end + end + end + end + object ToolBar: TToolBar + Left = 0 + Top = 0 + Width = 385 + Height = 33 + ButtonHeight = 30 + ButtonWidth = 31 + Caption = 'ToolBar' + Flat = True + Images = ImageList1 + TabOrder = 1 + object btnGroupByComponents: TToolButton + Left = 0 + Top = 0 + Hint = 'Group by components' + Action = actGroupByComponents + ImageIndex = 0 + ParentShowHint = False + ShowHint = True + end + object btnGroupByProperties: TToolButton + Left = 31 + Top = 0 + Hint = 'Group by properties' + Action = actGroupByProperties + ImageIndex = 1 + ParentShowHint = False + ShowHint = True + end + object ToolButton3: TToolButton + Left = 62 + Top = 0 + Width = 8 + Caption = 'ToolButton3' + ImageIndex = 2 + Style = tbsSeparator + end + object btnReset: TToolButton + Left = 70 + Top = 0 + Hint = 'Reset' + Caption = 'btnReset' + ImageIndex = 2 + ParentShowHint = False + ShowHint = True + OnClick = btnResetClick + end + object btnCheckAll: TToolButton + Left = 101 + Top = 0 + Hint = 'Check all' + Caption = 'btnCheckAll' + ImageIndex = 3 + ParentShowHint = False + ShowHint = True + OnClick = btnCheckAllClick + end + object btnUncheckAll: TToolButton + Left = 132 + Top = 0 + Hint = 'Uncheck all' + Caption = 'btnUncheckAll' + ImageIndex = 4 + ParentShowHint = False + ShowHint = True + OnClick = btnUncheckAllClick + end + object btnInvertChecking: TToolButton + Left = 163 + Top = 0 + Hint = 'Invert checking' + Caption = 'btnInvertChecking' + ImageIndex = 5 + ParentShowHint = False + ShowHint = True + OnClick = btnInvertCheckingClick + end + end + object ActionList1: TActionList + Left = 356 + Top = 4 + object actGroupByComponents: TAction + Caption = 'GroupByComponents' + OnExecute = actGroupByComponentsExecute + end + object actGroupByProperties: TAction + Caption = 'GroupByProperties' + OnExecute = actGroupByPropertiesExecute + end + end + object ImageList1: TImageList + Height = 24 + Width = 24 + Left = 324 + Top = 4 + Bitmap = { + 494C010106000900040018001800FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 000000000000360000002800000060000000480000000100200000000000006C + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF0000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF008000 + 0000800000008000000080000000800000008000000080000000800000008000 + 00008000000080000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080800000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000008080800000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF008000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF008000 + 0000800000008000000080000000800000008000000080000000800000008000 + 00008000000080000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00800000008000 + 0000800000008000000080000000FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000080808000FFFFFF00800000008000 + 0000800000008000000080000000FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0080000000FFFF + FF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000080808000FFFFFF0080000000FFFF + FF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00800000008000 + 0000800000008000000080000000800000008000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000080808000FFFFFF00800000008000 + 0000800000008000000080000000FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0080000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00800000008000 + 0000800000008000000080000000800000008000000080808000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF000000FF0000000000000080808000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000080808000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF000000FF000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0080000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FFFFFF00FF0000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FFFFFF00FF000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00800000008000 + 0000800000008000000080000000800000008000000080808000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF000000FF0000000000000080808000FFFFFF00800000008000 + 0000800000008000000080000000800000008000000080808000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF000000FF000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0080000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 80008080800080808000808080000000000080808000FFFFFF0080000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00800000008000 + 0000800000008000000080000000800000008000000080000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 00000080000000000000000000000000000080808000FFFFFF00800000008000 + 0000800000008000000080000000800000008000000080000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000008000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000080 + 00000080000000800000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000080 + 0000008000000080000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF00000000000000000000000000000000000000008000000080 + 00000080000000800000008000000000000080808000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF00000000000000000000000000000000000000008000000080 + 0000008000000080000000800000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FFFFFF00FF00000000000000000000000000000000000000000000000000 + 00000080000000000000000000000000000080808000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FFFFFF00FF00000000000000000000000000000000000000000000000000 + 0000008000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF00000000000000008000000000000000000000000000000080 + 00000000000000000000000000000000000080808000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF00000000000000008000000000000000000000000000000080 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800000000000000000000080000000800000008000000000 + 0000000000000000000000000000000000008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800000000000000000000080000000800000008000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FF0000000000000000000000000000000000 + 00000000000000FFFF0000FFFF0000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000FF0000000000000000000000000000000000 + 0000FFFFFF0000000000FFFFFF000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FF000000FF00000000000000000000000000 + 000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF008000 + 000080000000800000008000000080000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000FF000000FF00000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000C0C0 + C00000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000000000000000 + 000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF008000 + 0000FFFFFF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000FF000000FF000000FF000000FF000000FF000000FF000000000000000000 + 0000FFFFFF0000000000FFFFFF000000000000000000FFFFFF0000000000C0C0 + C00000000000000000000000000000000000000000000000000000000000FF00 + 0000000000000000000000000000FF000000FF00000000000000000000000000 + 000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000000000C0C0 + C000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF008000 + 0000800000008000000080000000800000008000000080000000800000008000 + 0000FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000FF0000000000000000000000FF000000FF00000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000C0C0 + C00000000000808080000000000000000000000000000000000000000000FF00 + 0000000000000000000000000000FF0000000000000000000000000000000000 + 000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000000000C0C0 + C000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF008000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008000 + 0000FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000FF0000000000000000000000FF0000000000000000000000000000000000 + 0000FFFFFF00FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000C0C0 + C00000000000808080000000000000000000000000000000000000000000FF00 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000FFFF0000FFFF0000FFFF0000FFFF0000000000C0C0C000C0C0 + C000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080800000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF008000 + 0000800000008000000080000000800000008000000080000000800000008000 + 00008000000080000000FFFFFF00000000000000000000000000000000000000 + 0000FF0000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF0000000000FFFFFF0000000000FFFFFF000000000000000000C0C0 + C00080000000808080000000000000000000000000000000000000000000FF00 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000C0C0C000C0C0C000C0C0 + C000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000800000C0C0C000C0C0C00000800000008000000080 + 00000080000000800000C0C0C000C0C0C0000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF008000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080000000FFFFFF00000000000000000000000000000000000000 + 0000FF0000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF0000000000FFFFFF00FFFFFF000000 + 0000800000008000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000C0C0C000C0C0C000C0C0C000C0C0C0000000 + 0000808080008080800000000000000000000000000000000000000000000000 + 0000000000000000000000800000008000000080000000800000008000000000 + 0000000000000000000000800000C0C0C000C0C0C00000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF008000 + 0000800000008000000080000000800000008000000080000000800000008000 + 00008000000080000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000C0C0C00000000000FFFFFF00FFFFFF00FFFFFF000000 + 0000800000008000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800000000000000000000000000000000000000000000000 + 0000000000000000000000800000008000000080000000800000000000000000 + 0000000000000000000000000000008000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF008000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000800000008000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000080808000808080008080 + 8000808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000800000008000000080000000800000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF008000 + 000080000000800000008000000080000000800000008000000080000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 00000000000000FFFF0000FFFF0000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000008080800080808000808080008080 + 8000808080008080800000000000000000000000000000000000FFFFFF000000 + 000000000000FFFFFF0000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000800000008000000080000000800000008000000000 + 00000000000000000000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C0000000000000000000000000000000000080808000FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000000000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080000000800000008000000080000000800000C0C0C000C0C0 + C0000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF000000FF0000000000000000000000000000000000000000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 000000000000FFFFFF0000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000800000008000000080000000800000C0C0C000C0C0 + C0000000000000000000000000000000000080808000FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000080808000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FFFFFF00FF00000000000000000000000000000000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000080000000000000000000000000 + 0000000000000000000000800000008000000080000000800000C0C0C0000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF000000FF00000000000000000000000000000000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000800000000000000000 + 0000000000000080000000800000008000000080000000800000C0C0C0000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 800080808000808080008080800000000000000000000000000000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF0000000000FFFFFF0000000000FFFFFF0000000000FFFFFF00000000000000 + 0000000000008000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008000000080 + 0000008000000080000000800000C0C0C0000000000000800000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 000000800000000000000000000000000000000000000000000000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFFFF00FFFF + FF00000000008000000080000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000080 + 00000080000000800000000000000000000000000000000000000000000000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF0000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF008000000080000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF00000000000000000000000000000000000000008000000080 + 00000080000000800000008000000000000000000000000000000000000000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000008000000080000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FFFFFF00FF00000000000000000000000000000000000000000000000000 + 0000008000000000000000000000000000000000000000000000000000000000 + 00000000000000FFFF0000FFFF0000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008000000080000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF00000000000000008000000000000000000000000000000080 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800000000000000000000080000000800000008000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000060000000480000000100010000000000600300000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFF000000000000FF8000FF + 8000000000000000FF8000FF8000000000000000FF8000FF8000000000000000 + FF8000FF8000000000000000FF8000FF8000000000000000FF8000FF80000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000001F700 + 01F70000000000000001E30001E30000000000000001C10001C1000000000000 + 0001F70001F70000000000000000EF0000EF00000000000000011F00011F0000 + 00000000FFFFFFFFFFFF000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFE01FFF + F87FFFFFFFFF8000FFE01FFEF03FFFFFFFFF8000FEE007FE601FFFFFFFFF8000 + FE6007E0200FFFFFFFFF8000F02001EE6007FFFFFFFF8000F66001EEE003FFFF + FFFF8000F6E001EFF001FFC1FF000000F7E001EFF801FC00FF000000F7E001FF + FC01FC1C7F000000FFF801800E01FC3EFF000000F87801800F03FC3FFF000000 + E01E01800F87FC1C0F000000C00E01800FFFFFF80F000000C00FFF800FFFFFFC + 0F0000008007FF800FFFFF7C1F0000008007FF800FFFFFB81F0000008007FF80 + 0BFFFFC0BF0001F78007FF8001FFFFFFFF0001E3C00FFF8001FFFFFFFF0001C1 + C00FFFFE01FFFFFFFF0001F7E01FFFFF09FFFFFFFF0000EFF87FFFFFFFFFFFFF + FF00011FFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressLibrary/Sources/cxPropertiesStoreEditor.pas b/official/x.35/ExpressLibrary/Sources/cxPropertiesStoreEditor.pas new file mode 100644 index 00000000..f3de6a26 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxPropertiesStoreEditor.pas @@ -0,0 +1,1001 @@ +{*******************************************************************} +{ } +{ Developer Express Cross Platform Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL AND CLX CONTROLS AS PART OF AN EXECUTABLE } +{ PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} +unit cxPropertiesStoreEditor; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + ComCtrls, ToolWin, ExtCtrls, StdCtrls, cxPropertiesStore, cxStorage, ActnList, + {$IFDEF DELPHI6} + DesignIntf, + {$ELSE} + DsgnIntf, + {$ENDIF} + cxControls, ImgList, cxDesignWindows; + +type + TfrmPropertiesStoreFilter = (psfNone, psfStored, psfUnStored); + TfrmPropertiesStoreGrouping = (psgComponents, psgProperties); + + PfrmPropertiesStoreRecord = ^TfrmPropertiesStoreRecord; + TfrmPropertiesStoreRecord = record + Persistent: TPersistent; + PropertyName: string; + Stored: Boolean; + end; + + TfrmPropertiesStoreEditor = class(TForm) + pnlClient: TPanel; + ToolBar: TToolBar; + pnlLeftTree: TPanel; + pnlLeftTreeTop: TPanel; + Tree: TTreeView; + pnlButtons: TPanel; + lblFindComponent: TLabel; + edFindComponent: TEdit; + btnGroupByComponents: TToolButton; + btnGroupByProperties: TToolButton; + ToolButton3: TToolButton; + btnReset: TToolButton; + btnCheckAll: TToolButton; + btnUncheckAll: TToolButton; + ActionList1: TActionList; + actGroupByComponents: TAction; + actGroupByProperties: TAction; + Panel1: TPanel; + Panel2: TPanel; + btnOK: TButton; + btnCancel: TButton; + btnInvertChecking: TToolButton; + ImageList1: TImageList; + procedure TreeDeletion(Sender: TObject; Node: TTreeNode); + procedure TreeCustomDrawItem(Sender: TCustomTreeView; Node: TTreeNode; + State: TCustomDrawState; var DefaultDraw: Boolean); + procedure FormCreate(Sender: TObject); + procedure actGroupByComponentsExecute(Sender: TObject); + procedure actGroupByPropertiesExecute(Sender: TObject); + procedure btnOKClick(Sender: TObject); + procedure btnCancelClick(Sender: TObject); + procedure TreeKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure btnCheckAllClick(Sender: TObject); + procedure btnUncheckAllClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure btnResetClick(Sender: TObject); + procedure btnInvertCheckingClick(Sender: TObject); + procedure edFindComponentKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure TreeContextPopup(Sender: TObject; MousePos: TPoint; + var Handled: Boolean); + private + FFilter: TfrmPropertiesStoreFilter; + FGrouping: TfrmPropertiesStoreGrouping; + FPropertiesStore: TcxPropertiesStore; + FOwnerComponent: TComponent; + FDesigner: IDesigner; + procedure SetOwnerComponent(const Value: TComponent); + procedure SetFilter(const Value: TfrmPropertiesStoreFilter); + procedure SetGrouping(const Value: TfrmPropertiesStoreGrouping); + procedure SetFindText; + procedure ChangeCheckState(ANode: TTreeNode); + procedure CheckNode(ANode: TTreeNode; AWithChildren: Boolean = True; AWithParents: Boolean = True); + procedure UncheckNode(ANode: TTreeNode; AWithChildren: Boolean = True; AWithParents: Boolean = True); + procedure InvertCheck; + procedure LoadFromPropertiesStore(APropertiesStore: TcxPropertiesStore); + procedure SaveToPropertiesStore(APropertiesStore: TcxPropertiesStore); + function IsNodeChecked(ANode: TTreeNode): Boolean; + function IsNodeFullChecked(ANode: TTreeNode): Boolean; + procedure BeginUpdate; + procedure EndUpdate; + function FindNode(const AText: string): TTreeNode; + procedure Reset; + procedure CheckAll; + procedure UncheckAll; + procedure InvertChecking; + protected + procedure RefreshTree; + public + property Filter: TfrmPropertiesStoreFilter read FFilter write SetFilter; + property Grouping: TfrmPropertiesStoreGrouping read FGrouping write SetGrouping; + property OwnerComponent: TComponent read FOwnerComponent write SetOwnerComponent; + property PropertiesStore: TcxPropertiesStore read FPropertiesStore write FPropertiesStore; + Property Designer: IDesigner read FDesigner write FDesigner; + end; + +const + scxFindComponent = 'Find Component:'; + scxFindProperty = 'Find Property:'; + +procedure ShowPropertiesStoreEditor(APropertiesStore: TcxPropertiesStore; + AOwnerComponent: TComponent; ADesigner: IDesigner); + +implementation + +{$R *.dfm} + +uses + TypInfo; + +procedure ShowPropertiesStoreEditor(APropertiesStore: TcxPropertiesStore; + AOwnerComponent: TComponent; ADesigner: IDesigner); +var + AForm: TfrmPropertiesStoreEditor; +begin + AForm := TfrmPropertiesStoreEditor.Create(nil); + {$IFDEF DELPHI9} + AForm.PopupMode := pmAuto; + {$ENDIF} + AForm.OwnerComponent := AOwnerComponent; + AForm.PropertiesStore := APropertiesStore; + AForm.Designer := ADesigner; + try + AForm.ShowModal; + finally + AForm.Free; + end; +end; + +{ TfrmPropertiesStoreEditor } + +procedure TfrmPropertiesStoreEditor.RefreshTree; +var + ANullLevelNodeList: TList; + + function AddPropertyNode(const APropertyName: string; AParentNode: TTreeNode = nil): TTreeNode; + var + I: Integer; + ANode: TTreeNode; + AUpperCasePropertyName: string; + AData: PfrmPropertiesStoreRecord; + begin + Result := nil; + AUpperCasePropertyName := UpperCase(APropertyName); + for I := 0 to ANullLevelNodeList.Count - 1 do + begin + ANode := TTreeNode(ANullLevelNodeList[I]); + if UpperCase(ANode.Text) = AUpperCasePropertyName then + begin + Result := ANode; + Break; + end; + end; + if Result = nil then + begin + Result := Tree.Items.AddChild(nil, APropertyName); + New(AData); + Result.Data := AData; + AData.Stored := False; + ANullLevelNodeList.Add(Result); + end; + end; + + procedure AddPersistent(APersistent: TPersistent; const AName: string; + AParentNode: TTreeNode = nil; APersistentObject: TPersistent = nil); + var + APersistentNode, ANode: TTreeNode; + APropList: PPropList; + APropCount, I: Integer; + AData: PfrmPropertiesStoreRecord; + AObject: TObject; + begin + {$IFDEF DELPHI6} + APropCount := GetPropList(APersistent, APropList); + {$ELSE} + APropCount := GetTypeData(PTypeInfo(APersistent.ClassInfo))^.PropCount; + GetMem(APropList, APropCount * SizeOf(Pointer)); + GetPropInfos(PTypeInfo(APersistent.ClassInfo), APropList); + {$ENDIF} + try + if Grouping = psgComponents then + begin + APersistentNode := Tree.Items.AddChild(AParentNode, AName); + New(AData); + APersistentNode.Data := AData; + if APersistentObject = nil then + AData.Persistent := APersistent + else + AData.Persistent := APersistentObject; + AData.PropertyName := ''; + AData.Stored := False; +// if APersistent is TCollection then +// with TCollection(APersistent) do +// for I := 0 to Count - 1 do +// AddPersistent(Items[I], IntToStr(I), APersistentNode); + for I := 0 to APropCount - 1 do + if APropList[I].PropType^.Kind <> tkMethod then + begin + if APropList[I].PropType^.Kind = tkClass then + begin + AObject := GetObjectProp(APersistent, APropList[I]); + if (AObject is TPersistent) and not (AObject is TComponent) then + begin + AddPersistent(AObject as TPersistent, APropList[I].Name, + APersistentNode); + Continue; + end; + end; + ANode := Tree.Items.AddChild(APersistentNode, APropList[I].Name); + New(AData); + ANode.Data := AData; + AData.Persistent := APersistent; + AData.PropertyName := APropList[I].Name; + AData.Stored := False; + end + end + else if Grouping = psgProperties then + begin + for I := 0 to APropCount - 1 do + if APropList[I].PropType^.Kind <> tkMethod then + begin + ANode := AddPropertyNode(APropList[I].Name); + if APropList[I].PropType^.Kind = tkClass then + begin + AObject := GetObjectProp(APersistent, APropList[I]); + if (AObject is TPersistent) and not (AObject is TComponent) then + begin + FGrouping := psgComponents; + try + AddPersistent(AObject as TPersistent, AName, ANode, APersistent); + finally + FGrouping := psgProperties; + end; + Continue; + end; + end; + APersistentNode := Tree.Items.AddChild(ANode, AName); + New(AData); + APersistentNode.Data := AData; + AData.Persistent := APersistent; + AData.PropertyName := APropList[I].Name; + AData.Stored := False; + end; + end; + finally + if APropCount > 0 then + {$IFNDEF DELPHI5} + FreeMem(APropList, APropCount * SizeOf(Pointer)); + {$ELSE} + FreeMem(APropList); + {$ENDIF} + end; + end; + +var + I: Integer; +begin + Tree.Items.Clear; + ANullLevelNodeList := TList.Create; + try + Tree.SortType := stNone; + if FOwnerComponent <> nil then + begin + AddPersistent(FOwnerComponent, FOwnerComponent.Name); + for I := 0 to FOwnerComponent.ComponentCount - 1 do + AddPersistent(FOwnerComponent.Components[I], FOwnerComponent.Components[I].Name); + end; + Tree.SortType := stText; + finally + ANullLevelNodeList.Free; + end; +end; + +procedure TfrmPropertiesStoreEditor.SetFilter( + const Value: TfrmPropertiesStoreFilter); +begin + if Filter <> Value then + begin + FFilter := Value; + RefreshTree; + end; +end; + +procedure TfrmPropertiesStoreEditor.SetGrouping( + const Value: TfrmPropertiesStoreGrouping); +var + APropertiesStore: TcxPropertiesStore; + ALastValue: TfrmPropertiesStoreGrouping; +begin + if Grouping <> Value then + begin + APropertiesStore := TcxPropertiesStore.Create(nil); + try + SaveToPropertiesStore(APropertiesStore); + ALastValue := FGrouping; + FGrouping := Value; + try + RefreshTree; + LoadFromPropertiesStore(APropertiesStore); + SetFindText; + except + FGrouping := ALastValue; + raise; + end; + finally + APropertiesStore.Free; + end; + end; +end; + +procedure TfrmPropertiesStoreEditor.ChangeCheckState(ANode: TTreeNode); +begin + if ANode.Data <> nil then + begin + if PfrmPropertiesStoreRecord(ANode.Data)^.Stored then + UnCheckNode(ANode) + else + CheckNode(ANode); + end; +end; + +procedure TfrmPropertiesStoreEditor.CheckNode(ANode: TTreeNode; + AWithChildren: Boolean; AWithParents: Boolean); +var + I: Integer; + AParentNode: TTreeNode; +begin + PfrmPropertiesStoreRecord(ANode.Data)^.Stored := True; + if AWithChildren then + for I := 0 to ANode.Count - 1 do + CheckNode(ANode[I], True, False); + if AWithParents then + begin + AParentNode := ANode.Parent; + if AParentNode <> nil then + CheckNode(AParentNode, False, True); + end; +end; + +procedure TfrmPropertiesStoreEditor.UncheckNode(ANode: TTreeNode; + AWithChildren: Boolean; AWithParents: Boolean); +var + I: Integer; + AParentNode: TTreeNode; + ANeedUncheckParent: Boolean; +begin + PfrmPropertiesStoreRecord(ANode.Data)^.Stored := False; + if AWithChildren then + for I := 0 to ANode.Count - 1 do + UncheckNode(ANode[I], True, False); + if AWithParents then + begin + AParentNode := ANode.Parent; + if AParentNode <> nil then + begin + ANeedUncheckParent := True; + for I := 0 to AParentNode.Count - 1 do + if AParentNode[I].Data <> nil then + if PfrmPropertiesStoreRecord(AParentNode[I].Data)^.Stored then + begin + ANeedUncheckParent := False; + Break; + end; + if ANeedUncheckParent then + UncheckNode(AParentNode, False, True); + end; + end; +end; + +procedure TfrmPropertiesStoreEditor.SetOwnerComponent( + const Value: TComponent); +begin + if FOwnerComponent <> Value then + begin + FOwnerComponent := Value; + try + BeginUpdate; + RefreshTree; + finally + EndUpdate; + end; + end; +end; + +procedure TfrmPropertiesStoreEditor.TreeDeletion(Sender: TObject; + Node: TTreeNode); +begin + if (Node.Data <> nil) then + Dispose(PfrmPropertiesStoreRecord(Node.Data)); +end; + +procedure TfrmPropertiesStoreEditor.TreeCustomDrawItem( + Sender: TCustomTreeView; Node: TTreeNode; State: TCustomDrawState; + var DefaultDraw: Boolean); +begin + with Tree.Canvas do + begin + if Node.Data <> nil then + begin + if PfrmPropertiesStoreRecord(Node.Data)^.Stored then + begin + if Node.Selected and Tree.Focused then + Font.Color := RGB(255, 255, 255) + else + Font.Color := RGB(0, 0, 255); + Font.Style := [fsBold]; + end; + end; + end; +end; + +procedure TfrmPropertiesStoreEditor.FormCreate(Sender: TObject); +begin + FGrouping := psgComponents; +end; + +procedure TfrmPropertiesStoreEditor.actGroupByComponentsExecute( + Sender: TObject); +begin + BeginUpdate; + try + Grouping := psgComponents; + finally + EndUpdate; + end; +end; + +procedure TfrmPropertiesStoreEditor.actGroupByPropertiesExecute( + Sender: TObject); +begin + BeginUpdate; + try + Grouping := psgProperties; + finally + EndUpdate; + end; +end; + +procedure TfrmPropertiesStoreEditor.btnOKClick(Sender: TObject); +begin + SaveToPropertiesStore(nil); + Designer.Modified; + Close; +end; + +procedure TfrmPropertiesStoreEditor.btnCancelClick(Sender: TObject); +begin + Close; +end; + +procedure TfrmPropertiesStoreEditor.TreeKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if TranslateKey(Key) = VK_RETURN then + if Tree.Selected <> nil then + begin + BeginUpdate(); + try + ChangeCheckState(Tree.Selected); + finally + EndUpdate(); + end; + end; +end; + +procedure TfrmPropertiesStoreEditor.btnCheckAllClick(Sender: TObject); +begin + CheckAll; +end; + +procedure TfrmPropertiesStoreEditor.btnUncheckAllClick(Sender: TObject); +begin + UncheckAll; +end; + +procedure TfrmPropertiesStoreEditor.LoadFromPropertiesStore( + APropertiesStore: TcxPropertiesStore); + + function ExtractName(var AName: string): string; + var + AIndex: Integer; + begin + Result := ''; + AIndex := Pos('.', AName); + if AIndex > 0 then + begin + if AIndex > 1 then + Result := Copy(AName, 1, AIndex - 1); + Delete(AName, 1, AIndex); + end + else + begin + Result := AName; + AName := ''; + end; + end; + + function GetPropertyNode(APersistentNode: TTreeNode; const APropertyName: string): TTreeNode; + var + AName: string; + AUpperCaseCurrentName: string; + ACurrentName: string; + I: Integer; + begin + Result := nil; + AName := APropertyName; + ACurrentName := ExtractName(AName); + if ACurrentName <> '' then + begin + AUpperCaseCurrentName := UpperCase(ACurrentName); + for I := 0 to APersistentNode.Count - 1 do + if UpperCase(APersistentNode[I].Text) = AUpperCaseCurrentName then + begin + Result := APersistentNode[I]; + Break; + end; + if Result <> nil then + begin + if AName <> '' then + Result := GetPropertyNode(Result, AName); + end; + end; + end; + + function GetPersistentNode(APersistent: TPersistent): TTreeNode; + var + ANode: TTreeNode; + begin + Result := nil; + ANode := Tree.Items.GetFirstNode; + while ANode <> nil do + begin + if ANode.Data <> nil then + with PfrmPropertiesStoreRecord(ANode.Data)^ do + if (Persistent = APersistent) and (PropertyName = '') then + begin + Result := ANode; + Break; + end; + ANode := ANode.getNextSibling; + end; + end; + + function GetPersistentNodeByProperty(var APropertyName: string; APersistent: TPersistent): TTreeNode; + var + APropertyNode: TTreeNode; + AName: string; + AUpperCaseName: string; + I: Integer; + begin + Result := nil; + if (APropertyName = '') or (APersistent = nil) then + Exit; + AName := ExtractName(APropertyName); + if AName <> '' then + begin + AUpperCaseName := UpperCase(AName); + APropertyNode := Tree.Items.GetFirstNode; + while APropertyNode <> nil do + begin + if AUpperCaseName = UpperCase(APropertyNode.Text) then + for I := 0 to APropertyNode.Count - 1 do + if APropertyNode[I].Data <> nil then + if PfrmPropertiesStoreRecord(APropertyNode[I].Data)^.Persistent = APersistent then + begin + Result := APropertyNode[I]; + Exit; + end; + APropertyNode := APropertyNode.getNextSibling; + end; + end; + end; + +var + APS: TcxPropertiesStore; + I, J: Integer; + APersistentNode: TTreeNode; + APropertyNode: TTreeNode; + APropertyName: string; +begin + if APropertiesStore = nil then + APS := PropertiesStore + else + APS := APropertiesStore; + if APS <> nil then + begin + for I := 0 to APS.Components.Count - 1 do + with APS.Components[I] do + begin + if Grouping = psgComponents then + begin + APersistentNode := GetPersistentNode(Component); + if APersistentNode <> nil then + begin + for J := 0 to Properties.Count - 1 do + begin + APropertyNode := GetPropertyNode(APersistentNode, Properties[J]); + if APropertyNode <> nil then + if APropertyNode.Data <> nil then + CheckNode(APropertyNode); + end; + end; + end + else if Grouping = psgProperties then + begin + for J := 0 to Properties.Count - 1 do + begin + APropertyName := Properties[J]; + APersistentNode := GetPersistentNodeByProperty(APropertyName, Component); + if APersistentNode <> nil then + begin + if APropertyName <> '' then + begin + APropertyNode := GetPropertyNode(APersistentNode, APropertyName); + if APropertyNode <> nil then + CheckNode(APropertyNode); + end + else + CheckNode(APersistentNode); + end; + end; + end; + end; + end; +end; + +procedure TfrmPropertiesStoreEditor.FormShow(Sender: TObject); +begin + LoadFromPropertiesStore(nil); +end; + +procedure TfrmPropertiesStoreEditor.btnResetClick(Sender: TObject); +begin + Reset; +end; + +procedure TfrmPropertiesStoreEditor.SaveToPropertiesStore( + APropertiesStore: TcxPropertiesStore); +var + APS: TcxPropertiesStore; + + procedure SaveComponentProperties(APSC: TcxPropertiesStoreComponent; + ANode: TTreeNode; const AName: string); + var + I: Integer; + begin + for I := 0 to ANode.Count - 1 do + begin + if IsNodeFullChecked(ANode[I]) then + APSC.Properties.Add(AName + '.' + ANode[I].Text) + else + begin + if IsNodeChecked(ANode[I]) then + SaveComponentProperties(APSC, ANode[I], AName + '.' + ANode[I].Text); + end; + end; + end; + + procedure SaveComponent(APersistentNode: TTreeNode); + var + APSC: TcxPropertiesStoreComponent; + APersistent: TPersistent; + I: Integer; + begin + APersistent := PfrmPropertiesStoreRecord(APersistentNode.Data)^.Persistent; + if APersistent is TComponent then + begin + APSC := APS.Components.Add as TcxPropertiesStoreComponent; + APSC.Component := APersistent as TComponent; + for I := 0 to APersistentNode.Count - 1 do + begin + if IsNodeFullChecked(APersistentNode[I]) then + APSC.Properties.Add(APersistentNode[I].Text) + else + begin + if IsNodeChecked(APersistentNode[I]) then + SaveComponentProperties(APSC, APersistentNode[I], APersistentNode[I].Text); + end; + end; + end; + end; + + function GetPropertiesStoreComponent(AComponent: TComponent): TcxPropertiesStoreComponent; + var + I: Integer; + begin + Result := nil; + for I := 0 to APS.Components.Count - 1 do + if APS.Components[I].Component = AComponent then + begin + Result := APS.Components[I]; + Break; + end; + if Result = nil then + begin + Result := APS.Components.Add as TcxPropertiesStoreComponent; + Result.Component := AComponent; + end; + end; + + procedure SaveComponentByProperty(APropertyNode: TTreeNode); + var + APropertyName: string; + I: Integer; + APSC: TcxPropertiesStoreComponent; + APersistent: TPersistent; + begin + APropertyName := APropertyNode.Text; + for I := 0 to APropertyNode.Count - 1 do + begin + if IsNodeChecked(APropertyNode[I]) then + begin + APersistent := PfrmPropertiesStoreRecord(APropertyNode[I].Data)^.Persistent; + if APersistent is TComponent then + begin + APSC := GetPropertiesStoreComponent(APersistent as TComponent); + if IsNodeFullChecked(APropertyNode[I]) then + APSC.Properties.Add(APropertyName) + else + SaveComponentProperties(APSC, APropertyNode[I], APropertyName); + end; + end; + end; + end; + +var + ANode: TTreeNode; +begin + if APropertiesStore = nil then + APS := PropertiesStore + else + APS := APropertiesStore; + if APS <> nil then + begin + APS.Components.Clear; + ANode := Tree.Items.GetFirstNode; + while ANode <> nil do + begin + if IsNodeChecked(ANode) then + begin + if ANode.Data <> nil then + begin + if Grouping = psgComponents then + SaveComponent(ANode) + else if Grouping = psgProperties then + SaveComponentByProperty(ANode); + end; + end; + ANode := ANode.getNextSibling; + end; + end; +end; + +function TfrmPropertiesStoreEditor.IsNodeFullChecked( + ANode: TTreeNode): Boolean; +var + I: Integer; +begin + Result := PfrmPropertiesStoreRecord(ANode.Data)^.Stored; + if Result then + begin + for I := 0 to ANode.Count - 1 do + Result := Result and IsNodeFullChecked(ANode[I]); + end; +end; + +function TfrmPropertiesStoreEditor.IsNodeChecked( + ANode: TTreeNode): Boolean; +begin + Result := PfrmPropertiesStoreRecord(ANode.Data)^.Stored; +end; + +procedure TfrmPropertiesStoreEditor.BeginUpdate; +begin + Tree.Items.BeginUpdate; +end; + +procedure TfrmPropertiesStoreEditor.EndUpdate; +begin + Tree.Items.EndUpdate; +end; + +procedure TfrmPropertiesStoreEditor.InvertCheck; + + procedure InvertCheckNode(ANode: TTreeNode); + var + I: Integer; + begin + for I := 0 to ANode.Count - 1 do + begin + if IsNodeChecked(ANode[I]) then + begin + if IsNodeFullChecked(ANode[I]) then + UncheckNode(ANode[I]) + else + InvertCheckNode(ANode[I]); + end + else + CheckNode(ANode[I]); + end; + end; + +var + ANode: TTreeNode; +begin + ANode := Tree.Items.GetFirstNode; + while ANode <> nil do + begin + if IsNodeChecked(ANode) then + begin + if IsNodeFullChecked(ANode) then + UncheckNode(ANode) + else + InvertCheckNode(ANode); + end + else + CheckNode(ANode); + ANode := ANode.getNextSibling; + end; +end; + +procedure TfrmPropertiesStoreEditor.btnInvertCheckingClick(Sender: TObject); +begin + InvertChecking; +end; + +procedure TfrmPropertiesStoreEditor.SetFindText; +begin + if Grouping = psgComponents then + lblFindComponent.Caption := scxFindComponent + else if Grouping = psgProperties then + lblFindComponent.Caption := scxFindProperty; + edFindComponent.Left := lblFindComponent.Left + lblFindComponent.Width + 9; + edFindComponent.Width := Tree.Left + Tree.Width - edFindComponent.Left - 7; +end; + +procedure TfrmPropertiesStoreEditor.edFindComponentKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +var + ANode: TTreeNode; +begin + if TranslateKey(Key) = VK_RETURN then + begin + ANode := FindNode(edFindComponent.Text); + if ANode <> nil then + begin + Tree.Selected := ANode; + Tree.SetFocus; + end; + end; +end; + +function TfrmPropertiesStoreEditor.FindNode(const AText: string): TTreeNode; +var + I: Integer; + ANode: TTreeNode; + ANodeText: string; + AFindText: string; + ACount, ACount1: Integer; +begin + AFindText := UpperCase(AText); + ANode := Tree.Items.GetFirstNode; + ACount1 := -1; + Result := nil; + while ANode <> nil do + begin + ACount := 0; + ANodeText := UpperCase(ANode.Text); + for I := 1 to Length(AFindText) do + begin + if I > Length(ANodeText) then + Break; + if AFindText[I] = ANodeText[I] then + Inc(ACount) + else + Break; + end; + if ACount > ACount1 then + begin + ACount1 := ACount; + Result := ANode; + end; + ANode := ANode.getNextSibling; + end; +end; + +procedure TfrmPropertiesStoreEditor.CheckAll; +var + ANode: TTreeNode; +begin + BeginUpdate; + try + ANode := Tree.Items.GetFirstNode; + while ANode <> nil do + begin + CheckNode(ANode, True, False); + ANode := ANode.getNextSibling; + end; + finally + EndUpdate; + end; +end; + +procedure TfrmPropertiesStoreEditor.InvertChecking; +begin + BeginUpdate; + try + InvertCheck; + finally + EndUpdate; + end; +end; + +procedure TfrmPropertiesStoreEditor.Reset; +begin + BeginUpdate; + try + RefreshTree; + LoadFromPropertiesStore(nil); + finally + EndUpdate; + end; +end; + +procedure TfrmPropertiesStoreEditor.UncheckAll; +var + ANode: TTreeNode; +begin + BeginUpdate; + try + ANode := Tree.Items.GetFirstNode; + while ANode <> nil do + begin + if PfrmPropertiesStoreRecord(ANode.Data)^.Stored then + UncheckNode(ANode, True, False); + ANode := ANode.getNextSibling; + end; + finally + EndUpdate; + end; + +end; + +procedure TfrmPropertiesStoreEditor.TreeContextPopup(Sender: TObject; + MousePos: TPoint; var Handled: Boolean); +begin + if Tree.Selected <> nil then + begin + BeginUpdate; + try + ChangeCheckState(Tree.Selected); + finally + EndUpdate; + end; + end; +end; + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxScrollBar.pas b/official/x.35/ExpressLibrary/Sources/cxScrollBar.pas new file mode 100644 index 00000000..f749389e --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxScrollBar.pas @@ -0,0 +1,1041 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressCommonLibrary } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCOMMONLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxScrollBar; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, dxThemeManager, +{$IFDEF DELPHI6} + Types, +{$ENDIF} +{$IFNDEF DELPHI5} + cxClasses, +{$ENDIF} + SysUtils, Classes, Controls, StdCtrls, + Graphics, cxGraphics, Forms, cxLookAndFeels, cxLookAndFeelPainters; + +type + TcxScrollBar = class; + + TcxScrollBarState = record + PressedPart: TcxScrollBarPart; + HotPart: TcxScrollBarPart; + end; + + { TcxScrollBarViewInfo } + + TcxScrollBarViewInfo = class + protected + FBottomRightArrowRect: TRect; + FPageDownRect: TRect; + FPageUpRect: TRect; + FScrollBar: TcxScrollBar; + FThumbnailRect: TRect; + FThumbnailSize: Integer; + FTopLeftArrowRect: TRect; + procedure CalculateRects; virtual; + property ScrollBar: TcxScrollBar read FScrollBar; + public + constructor Create(AScrollBar: TcxScrollBar); virtual; + procedure AdjustPageRects; + procedure Calculate; virtual; + procedure CalculateMinThumnailSize; + procedure CalculateThumbnailRect; + procedure SetThumbnailPos(APos: Integer); + property BottomRightArrowRect: TRect read FBottomRightArrowRect; + property PageDownRect: TRect read FPageDownRect; + property PageUpRect: TRect read FPageUpRect; + property ThumbnailRect: TRect read FThumbnailRect; + property ThumbnailSize: Integer read FThumbnailSize; + property TopLeftArrowRect: TRect read FTopLeftArrowRect; + end; + + TcxScrollBarViewInfoClass = class of TcxScrollBarViewInfo; + + TcxScrollBar = class(TCustomControl, {$IFNDEF DELPHI6}IUnknown,{$ENDIF} IdxSkinSupport) + private + FBitmap: TBitmap; + FCanvas: TcxCanvas; + FDownMousePos: TPoint; + FKind: TScrollBarKind; + FLargeChange: TScrollBarInc; + FLookAndFeel: TcxLookAndFeel; + FMax: Integer; + FMin: Integer; + FPageSize: Integer; + FPosition: Integer; + FRealCtl3D: Boolean; + FSavePosition: Integer; + FSaveThumbnailPos: TPoint; + FSmallChange: TScrollBarInc; + FThemeChangedNotificator: TdxThemeChangedNotificator; + FTimer: TComponent; + FUnlimitedTracking: Boolean; + FOnChange: TNotifyEvent; + FOnScroll: TScrollEvent; + procedure CancelScroll; + procedure DoScroll(APart: TcxScrollBarPart); + function GetCtr3D: Boolean; + function GetInternalCtl3D: Boolean; + function GetPositionFromThumbnail: Integer; + function GetScrollBarPart(P: TPoint): TcxScrollBarPart; + procedure InternalScroll(AScrollCode: TScrollCode); + function IsCtl3DStored: Boolean; + procedure OnTimer(Sender: TObject); + procedure SetCtl3D(Value: Boolean); + procedure SetInternalCtl3D(Value: Boolean); + procedure SetKind(Value: TScrollBarKind); + procedure SetLookAndFeel(Value: TcxLookAndFeel); + procedure SetMax(Value: Integer); + procedure SetMin(Value: Integer); + procedure SetPageSize(Value: Integer); + procedure SetPosition(Value: Integer); + procedure ThemeChanged; + procedure CMCtl3DChanged(var Message: TMessage); message CM_CTL3DCHANGED; + procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED; + procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure CMSysColorChange(var Message: TMessage); message CM_SYSCOLORCHANGE; + procedure CMVisibleChanged(var Message: TMessage); message CM_VISIBLECHANGED; + procedure CNHScroll(var Message: TWMHScroll); message CN_HSCROLL; + procedure CNVScroll(var Message: TWMVScroll); message CN_VSCROLL; + procedure CNCtlColorScrollBar(var Message: TMessage); message CN_CTLCOLORSCROLLBAR; + procedure WMCancelMode(var Message: TWMCancelMode); message WM_CANCELMODE; + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND; + protected + FState: TcxScrollBarState; + FViewInfo: TcxScrollBarViewInfo; + procedure Change; virtual; + function GetPainter: TcxCustomLookAndFeelPainterClass; + function GetViewInfoClass: TcxScrollBarViewInfoClass; virtual; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseEnter(AControl: TControl); dynamic; + procedure MouseLeave(AControl: TControl); dynamic; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + + procedure DoPaint(ACanvas: TcxCanvas); virtual; + procedure DrawScrollBarPart(ACanvas: TcxCanvas; const R: TRect; + APart: TcxScrollBarPart; AState: TcxButtonState); virtual; + function IsButtonHotTrack: Boolean; virtual; + procedure Paint; override; + procedure Scroll(ScrollCode: TScrollCode; var ScrollPos: Integer); virtual; + function ScrollBarMinimalThumbSize: Integer; virtual; + + property InternalCtl3D: Boolean read GetInternalCtl3D write SetInternalCtl3D; + property Painter: TcxCustomLookAndFeelPainterClass read GetPainter; + property ViewInfo: TcxScrollBarViewInfo read FViewInfo; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; + procedure SetScrollParams(AMin, AMax, APosition, APageSize: Integer; ARedraw: Boolean = True); + procedure SetParams(APosition, AMin, AMax: Integer); + published + property Align; + property Anchors; + property Constraints; + property Ctl3D read GetCtr3D write SetCtl3D stored IsCtl3DStored; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property Kind: TScrollBarKind read FKind write SetKind default sbHorizontal; + property LargeChange: TScrollBarInc + read FLargeChange write FLargeChange + default 1; + property LookAndFeel: TcxLookAndFeel read FLookAndFeel write SetLookAndFeel; + property Max: Integer read FMax write SetMax default 100; + property Min: Integer read FMin write SetMin default 0; + property PageSize: Integer read FPageSize write SetPageSize; + property ParentCtl3D; + property ParentShowHint; + property PopupMenu; + property Position: Integer + read FPosition write SetPosition + default 0; + property ShowHint; + property SmallChange: TScrollBarInc + read FSmallChange write FSmallChange + default 1; + property UnlimitedTracking: Boolean read FUnlimitedTracking write FUnlimitedTracking default False; + property Visible; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnChange: TNotifyEvent read FOnChange write FOnChange; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnScroll: TScrollEvent read FOnScroll write FOnScroll; + property OnStartDock; + property OnStartDrag; + end; + TcxScrollBarClass = class of TcxScrollBar; + +function GetScrollBarSize: TSize; + +implementation + +uses + dxuxTheme, + dxThemeConsts, + Consts, cxControls; + +const + EmptyRect: TRect = (Left: 0; Top: 0; Right: 0; Bottom: 0); + cxScrollInitialInterval = 400; + cxScrollInterval = 60; + cxScrollMinDistance: Integer = 34; + cxScrollMaxDistance: Integer = 136; + cxMinStdThumbnailSize = 8; + cxTimerParts = [sbpLineUp, sbpLineDown, sbpPageUp, sbpPageDown]; + +function GetScrollBarSize: TSize; +begin + Result.cx := GetSystemMetrics(SM_CXVSCROLL); + Result.cy := GetSystemMetrics(SM_CYHSCROLL); +end; + +function MaxInt(A, B: Integer): Integer; +begin + if A > B then Result := A else Result := B; +end; + +function MinInt(A, B: Integer): Integer; +begin + if A < B then Result := A else Result := B; +end; + +{$IFNDEF DELPHI6} + +function Bounds(ALeft, ATop, AWidth, AHeight: Integer): TRect; +begin + with Result do + begin + Left := ALeft; + Top := ATop; + Right := ALeft + AWidth; + Bottom := ATop + AHeight; + end; +end; + +{$ENDIF} + +{ TcxScrollBarViewInfo } + +constructor TcxScrollBarViewInfo.Create(AScrollBar: TcxScrollBar); +begin + inherited Create; + FScrollBar := AScrollBar; +end; + +procedure TcxScrollBarViewInfo.AdjustPageRects; +begin + if not IsRectEmpty(FThumbnailRect) then + begin + if ScrollBar.Kind = sbHorizontal then + begin + FPageUpRect := Rect(FTopLeftArrowRect.Right, 0, FThumbnailRect.Left, ScrollBar.Height); + FPageDownRect := Rect(FThumbnailRect.Right, 0, FBottomRightArrowRect.Left, ScrollBar.Height); + end + else + begin + FPageUpRect := Rect(0, FTopLeftArrowRect.Bottom, ScrollBar.Width, FThumbnailRect.Top); + FPageDownRect := Rect(0, FThumbnailRect.Bottom, ScrollBar.Width, FBottomRightArrowRect.Top); + end + end + else + begin + FPageUpRect := EmptyRect; + FPageDownRect := EmptyRect; + end; +end; + +procedure TcxScrollBarViewInfo.Calculate; +begin + CalculateRects; +end; + +procedure TcxScrollBarViewInfo.CalculateMinThumnailSize; +begin + FThumbnailSize := ScrollBar.ScrollBarMinimalThumbSize; +end; + +procedure TcxScrollBarViewInfo.CalculateThumbnailRect; +var + ADelta, ASize: Integer; +begin + FThumbnailRect := EmptyRect; + AdjustPageRects; + if not ScrollBar.Enabled then + Exit; + if ScrollBar.Kind = sbHorizontal then + begin + ADelta := FBottomRightArrowRect.Left - FTopLeftArrowRect.Right; + if ScrollBar.PageSize = 0 then + begin + ASize := GetSystemMetrics(SM_CXHTHUMB); + if ASize > ADelta then + Exit; + Dec(ADelta, ASize); + if (ADelta <= 0) or (ScrollBar.Max = ScrollBar.Min) then + FThumbnailRect := Bounds(FTopLeftArrowRect.Right, 0, ASize, ScrollBar.Height) + else + FThumbnailRect := Bounds(FTopLeftArrowRect.Right + + MulDiv(ADelta, ScrollBar.Position - ScrollBar.Min, ScrollBar.Max - ScrollBar.Min), 0, ASize, ScrollBar.Height); + end + else + begin + ASize := MinInt(ADelta, MulDiv(ScrollBar.PageSize, ADelta, ScrollBar.Max - ScrollBar.Min + 1)); + if (ADelta < FThumbnailSize) or (ScrollBar.Max = ScrollBar.Min) then + Exit; + if ASize < FThumbnailSize then + ASize := FThumbnailSize; + Dec(ADelta, ASize); + FThumbnailRect := Bounds(FTopLeftArrowRect.Right, 0, ASize, ScrollBar.Height); + ASize := (ScrollBar.Max - ScrollBar.Min) - (ScrollBar.PageSize - 1); + OffsetRect(FThumbnailRect, MulDiv(ADelta, MinInt(ScrollBar.Position - ScrollBar.Min, ASize), ASize), 0); + end; + end + else + begin + ADelta := FBottomRightArrowRect.Top - FTopLeftArrowRect.Bottom; + if ScrollBar.PageSize = 0 then + begin + ASize := GetSystemMetrics(SM_CYVTHUMB); + if ASize > ADelta then + Exit; + Dec(ADelta, ASize); + if (ADelta <= 0) or (ScrollBar.Max = ScrollBar.Min) then + FThumbnailRect := Bounds(0, FTopLeftArrowRect.Bottom, ScrollBar.Width, ASize) + else + FThumbnailRect := Bounds(0, FTopLeftArrowRect.Bottom + + MulDiv(ADelta, ScrollBar.Position - ScrollBar.Min, ScrollBar.Max - ScrollBar.Min), ScrollBar.Width, ASize); + end + else + begin + ASize := MinInt(ADelta, MulDiv(ScrollBar.PageSize, ADelta, ScrollBar.Max - ScrollBar.Min + 1)); + if (ADelta < FThumbnailSize) or (ScrollBar.Max = ScrollBar.Min) then + Exit; + if ASize < FThumbnailSize then + ASize := FThumbnailSize; + Dec(ADelta, ASize); + FThumbnailRect := Bounds(0, FTopLeftArrowRect.Bottom, ScrollBar.Width, ASize); + ASize := (ScrollBar.Max - ScrollBar.Min) - (ScrollBar.PageSize - 1); + OffsetRect(FThumbnailRect, 0, MulDiv(ADelta, MinInt(ScrollBar.Position - ScrollBar.Min, ASize), ASize)); + end; + end; + AdjustPageRects; +end; + +procedure TcxScrollBarViewInfo.SetThumbnailPos(APos: Integer); +begin + if ScrollBar.Kind = sbHorizontal then + OffsetRect(FThumbnailRect, -FThumbnailRect.Left + APos, 0) + else + OffsetRect(FThumbnailRect, 0, -FThumbnailRect.Top + APos); +end; + +procedure TcxScrollBarViewInfo.CalculateRects; +var + ASize, H, W: Integer; +begin + if ScrollBar.Kind = sbHorizontal then + begin + ASize := GetScrollBarSize.cy; + if ScrollBar.Width div 2 < ASize then + W := ScrollBar.Width div 2 + else + W := ASize; + FTopLeftArrowRect := Bounds(0, 0, W, ScrollBar.Height); + FBottomRightArrowRect := Bounds(ScrollBar.Width - W, 0, W, ScrollBar.Height); + end + else + begin + ASize := GetScrollBarSize.cx; + if ScrollBar.Height div 2 < ASize then + H := ScrollBar.Height div 2 + else + H := ASize; + FTopLeftArrowRect := Bounds(0, 0, ScrollBar.Width, H); + FBottomRightArrowRect := Bounds(0, ScrollBar.Height - H, ScrollBar.Width, H); + end; + CalculateThumbnailRect; +end; + +{ TcxScrollBar } + +constructor TcxScrollBar.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FBitmap := TBitmap.Create; + FBitmap.PixelFormat := pfDevice; + FCanvas := TcxCanvas.Create(FBitmap.Canvas); + FLookAndFeel := TcxLookAndFeel.Create(Self); + FLookAndFeel.OnChanged := LookAndFeelChanged; + FViewInfo := GetViewInfoClass.Create(Self); + Width := 121; + ControlStyle := [csFramed, csOpaque, csCaptureMouse]; + FKind := sbHorizontal; + Height := GetScrollBarSize.cy; + FThemeChangedNotificator := TdxThemeChangedNotificator.Create; + FThemeChangedNotificator.OnThemeChanged := ThemeChanged; + FPosition := 0; + FMin := 0; + FMax := 100; + FSmallChange := 1; + FLargeChange := 1; + + FTimer := TcxTimer.Create(nil); + TcxTimer(FTimer).Enabled := False; + TcxTimer(FTimer).Interval:= cxScrollInitialInterval; + TcxTimer(FTimer).OnTimer := OnTimer; + ViewInfo.CalculateMinThumnailSize; + ViewInfo.Calculate; +end; + +destructor TcxScrollBar.Destroy; +begin + FreeAndNil(FTimer); + FreeAndNil(FThemeChangedNotificator); + FreeAndNil(FViewInfo); + FreeAndNil(FLookAndFeel); + FreeAndNil(FCanvas); + FreeAndNil(FBitmap); + inherited Destroy; +end; + +procedure TcxScrollBar.SetCtl3D(Value: Boolean); +begin + FRealCtl3D := Value; + InternalCtl3D := Value; +end; + +procedure TcxScrollBar.SetInternalCtl3D(Value: Boolean); +begin + if InternalCtl3D <> Value then + inherited Ctl3D := Value; +end; + +function TcxScrollBar.IsCtl3DStored: Boolean; +begin + Result := not ParentCtl3D; +end; + +procedure TcxScrollBar.OnTimer(Sender: TObject); + + function CheckHotPart: Boolean; + var + P: TPoint; + begin + GetCursorPos(P); + Result := GetScrollBarPart(ScreenToClient(P)) = FState.PressedPart; + end; + +begin + if (GetCaptureControl = Self) and (FState.PressedPart in cxTimerParts) then + begin + if TcxTimer(FTimer).Interval = cxScrollInitialInterval then + TcxTimer(FTimer).Interval := cxScrollInterval; + DoScroll(FState.PressedPart); + TcxTimer(FTimer).Enabled := CheckHotPart; + end + else + CancelScroll; +end; + +procedure TcxScrollBar.SetKind(Value: TScrollBarKind); +begin + if FKind <> Value then + begin + FKind := Value; + if not (csLoading in ComponentState) then + SetBounds(Left, Top, Height, Width) + else + ViewInfo.Calculate; + Invalidate; + end; +end; + +procedure TcxScrollBar.SetLookAndFeel(Value: TcxLookAndFeel); +begin + FLookAndFeel.Assign(Value); +end; + +procedure TcxScrollBar.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); +var + ABoundsChanged: Boolean; +begin + ABoundsChanged := (ALeft <> Left) or (ATop <> Top) or + (AWidth <> Width) or (AHeight <> Height); + inherited SetBounds(ALeft, ATop, AWidth, AHeight); + if ABoundsChanged and (AWidth > 0) and (AHeight > 0) then + begin + FBitmap.Width := AWidth; + FBitmap.Height := AHeight; + ViewInfo.Calculate; + end; +end; + +procedure TcxScrollBar.SetScrollParams(AMin, AMax, APosition, + APageSize: Integer; ARedraw: Boolean = True); +begin + if (AMax < AMin) or (AMax < APageSize) then + raise EInvalidOperation.Create(SScrollBarRange); + ARedraw := ARedraw and HandleAllocated; + + if APosition < AMin then APosition := AMin; + if APosition > AMax then APosition := AMax; + + if (Min <> AMin) or (Max <> AMax) or (FPageSize <> APageSize) or + (Position <> APosition) then + begin + FMin := AMin; + FMax := AMax; + FPageSize := APageSize; + end + else + ARedraw := False; + if Position <> APosition then + begin + Enabled := True; + FPosition := APosition; + ViewInfo.CalculateThumbnailRect; + if ARedraw then Repaint; + Change; + end + else + begin + ViewInfo.CalculateThumbnailRect; + if ARedraw then Repaint; + end; +end; + +procedure TcxScrollBar.SetParams(APosition, AMin, AMax: Integer); +begin + SetScrollParams(AMin, AMax, APosition, FPageSize); +end; + +procedure TcxScrollBar.SetMax(Value: Integer); +begin + SetScrollParams(FMin, Value, FPosition, FPageSize); +end; + +procedure TcxScrollBar.SetMin(Value: Integer); +begin + SetScrollParams(Value, FMax, FPosition, FPageSize); +end; + +procedure TcxScrollBar.SetPageSize(Value: Integer); +begin + SetScrollParams(FMin, FMax, FPosition, Value); +end; + +procedure TcxScrollBar.SetPosition(Value: Integer); +begin + SetScrollParams(FMin, FMax, Value, FPageSize); +end; + +procedure TcxScrollBar.Change; +begin + inherited Changed; + if Assigned(FOnChange) then FOnChange(Self); +end; + +function TcxScrollBar.GetPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := LookAndFeel.GetAvailablePainter(totScrollBar); +end; + +function TcxScrollBar.GetViewInfoClass: TcxScrollBarViewInfoClass; +begin + Result := TcxScrollBarViewInfo; +end; + +procedure TcxScrollBar.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +var + ASaveValue: Boolean; +begin + if (LookAndFeel.SkinPainter <> nil) and Ctl3D then + begin + ASaveValue := Ctl3D; + InternalCtl3D := False; + FRealCtl3D := ASaveValue; + end + else + InternalCtl3D := FRealCtl3D; + ViewInfo.CalculateMinThumnailSize; + ViewInfo.Calculate; + Invalidate; +end; + +procedure TcxScrollBar.MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +var + APart: TcxScrollBarPart; +begin + inherited; + if (Button <> mbLeft) then Exit; + APart := GetScrollBarPart(Point(X, Y)); + if APart <> sbpNone then + begin + if APart = sbpThumbnail then + begin + FDownMousePos := Point(X, Y); + FSavePosition := FPosition; + FSaveThumbnailPos := ViewInfo.ThumbnailRect.TopLeft; + InternalScroll(scTrack); + end; + FState.PressedPart := APart; + FState.HotPart := APart; + if APart in cxTimerParts then + begin + DoScroll(APart); + TcxTimer(FTimer).Interval := cxScrollInitialInterval; + TcxTimer(FTimer).Enabled := True; + end; + Repaint; + end; +end; + +procedure TcxScrollBar.MouseEnter(AControl: TControl); +begin + if IsButtonHotTrack or (FState.PressedPart in cxTimerParts) then + Repaint; +end; + +procedure TcxScrollBar.MouseLeave(AControl: TControl); +begin + if FState.PressedPart <> sbpThumbnail then + FState.HotPart := sbpNone; + if IsButtonHotTrack or (FState.PressedPart in cxTimerParts) then + Invalidate; +end; + +procedure TcxScrollBar.MouseMove(Shift: TShiftState; X, Y: Integer); +var + APart: TcxScrollBarPart; + R: TRect; + ADelta, ANewPos, ASize: Integer; + + procedure UpdateThumbnail(ADeltaX, ADeltaY: Integer); + begin + if FKind = sbHorizontal then + ViewInfo.SetThumbnailPos(FSaveThumbnailPos.X + ADeltaX) + else + ViewInfo.SetThumbnailPos(FSaveThumbnailPos.Y + ADeltaY); + ViewInfo.AdjustPageRects; + Repaint; + end; + +begin + inherited MouseMove(Shift, X, Y); + APart := GetScrollBarPart(Point(X, Y)); + if FState.PressedPart = sbpThumbnail then + begin + if FKind = sbHorizontal then + begin + ASize := ViewInfo.ThumbnailRect.Right - ViewInfo.ThumbnailRect.Left; + R := Rect(-cxScrollMinDistance, -cxScrollMaxDistance, + Width + cxScrollMinDistance, Height + cxScrollMaxDistance); + end + else + begin + ASize := ViewInfo.ThumbnailRect.Bottom - ViewInfo.ThumbnailRect.Top; + R := Rect(-cxScrollMaxDistance, -cxScrollMinDistance, + Width + cxScrollMaxDistance, Height + cxScrollMinDistance); + end; + if not (FUnlimitedTracking or PtInRect(R, Point(X, Y))) then + begin + if Position <> FSavePosition then + begin + Position := FSavePosition; + DoScroll(sbpThumbnail); + end; + end + else + begin + if FKind = sbHorizontal then + begin + ADelta := X - FDownMousePos.X; + if ADelta = 0 then Exit; + if (ADelta < 0) and (FSaveThumbnailPos.X + ADelta < ViewInfo.TopLeftArrowRect.Right) then + ADelta := ViewInfo.TopLeftArrowRect.Right - FSaveThumbnailPos.X + else + if (ADelta > 0) and (FSaveThumbnailPos.X + ASize + ADelta > ViewInfo.BottomRightArrowRect.Left) then + ADelta := ViewInfo.BottomRightArrowRect.Left - (FSaveThumbnailPos.X + ASize); + UpdateThumbnail(ADelta, 0); + end + else + begin + ADelta := Y - FDownMousePos.Y; + if ADelta = 0 then Exit; + if (ADelta < 0) and (FSaveThumbnailPos.Y + ADelta < ViewInfo.TopLeftArrowRect.Bottom) then + ADelta := ViewInfo.TopLeftArrowRect.Bottom - FSaveThumbnailPos.Y + else + if (ADelta > 0) and (FSaveThumbnailPos.Y + ASize + ADelta > ViewInfo.BottomRightArrowRect.Top) then + ADelta := ViewInfo.BottomRightArrowRect.Top - (FSaveThumbnailPos.Y + ASize); + UpdateThumbnail(0, ADelta); + end; + ANewPos := GetPositionFromThumbnail; + if ANewPos <> FPosition then + begin + FPosition := ANewPos; + DoScroll(sbpThumbnail); + end; + end; + end + else + begin + if FState.PressedPart <> sbpNone then + TcxTimer(FTimer).Enabled := FState.PressedPart = APart; + if (FState.HotPart <> APart) and IsButtonHotTrack then + begin + FState.HotPart := APart; + Repaint; + end + else + FState.HotPart := APart; + end; +end; + +procedure TcxScrollBar.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + inherited; + begin + CancelScroll; + FState.HotPart := GetScrollBarPart(Point(X, Y)); + end; +end; + +procedure TcxScrollBar.DoPaint(ACanvas: TcxCanvas); + + function GetButtonStateFromPartState(APart: TcxScrollBarPart): TcxButtonState; + begin + if not Enabled then + Result := cxbsDisabled + else + if (APart <> sbpThumbnail) or ((APart = sbpThumbnail) and + IsButtonHotTrack) then + begin + if FState.PressedPart <> sbpNone then + if (APart = FState.PressedPart) and (APart = FState.HotPart) then + Result := cxbsPressed + else + Result := cxbsNormal + else + if (APart = FState.HotPart) and not (csDesigning in ComponentState) then + Result := cxbsHot + else + Result := cxbsNormal + end + else + Result := cxbsNormal; + end; + +begin + if not IsRectEmpty(ViewInfo.ThumbnailRect) then + DrawScrollBarPart(ACanvas, ViewInfo.ThumbnailRect, sbpThumbnail, + GetButtonStateFromPartState(sbpThumbnail)) + else + DrawScrollBarPart(ACanvas, Bounds(0, 0, Width, Height), sbpPageUp, cxbsNormal); + DrawScrollBarPart(ACanvas, ViewInfo.TopLeftArrowRect, sbpLineUp, + GetButtonStateFromPartState(sbpLineUp)); + DrawScrollBarPart(ACanvas, ViewInfo.BottomRightArrowRect, sbpLineDown, + GetButtonStateFromPartState(sbpLineDown)); + if not IsRectEmpty(ViewInfo.PageUpRect) then + DrawScrollBarPart(ACanvas, ViewInfo.PageUpRect, sbpPageUp, + GetButtonStateFromPartState(sbpPageUp)); + if not IsRectEmpty(ViewInfo.PageDownRect) then + DrawScrollBarPart(ACanvas, ViewInfo.PageDownRect, sbpPageDown, + GetButtonStateFromPartState(sbpPageDown)); +end; + +procedure TcxScrollBar.DrawScrollBarPart(ACanvas: TcxCanvas; const R: TRect; + APart: TcxScrollBarPart; AState: TcxButtonState); +begin + Painter.DrawScrollBarPart(ACanvas, Kind = sbHorizontal, R, APart, AState); +end; + +function TcxScrollBar.IsButtonHotTrack: Boolean; +begin + Result := Painter.IsButtonHotTrack; +end; + +procedure TcxScrollBar.Paint; +begin + DoPaint(FCanvas); + BitBlt(Canvas.Handle, 0, 0, FBitmap.Width, FBitmap.Height, + FCanvas.Handle, 0, 0, SRCCOPY); +end; + +procedure TcxScrollBar.Scroll(ScrollCode: TScrollCode; var ScrollPos: Integer); +begin + if Assigned(FOnScroll) then FOnScroll(Self, ScrollCode, ScrollPos); +end; + +function TcxScrollBar.ScrollBarMinimalThumbSize: Integer; +begin + Result := Painter.ScrollBarMinimalThumbSize(Kind = sbVertical); +end; + +procedure TcxScrollBar.CancelScroll; +begin + if FState.PressedPart <> sbpNone then + begin + if FState.PressedPart = sbpThumbnail then + begin + FPosition := GetPositionFromThumbnail; + InternalScroll(scPosition); + end; + TcxTimer(FTimer).Enabled := False; + FState.PressedPart := sbpNone; + FState.HotPart := sbpNone; + InternalScroll(scEndScroll); + ViewInfo.CalculateThumbnailRect; + Invalidate; + end; +end; + +procedure TcxScrollBar.DoScroll(APart: TcxScrollBarPart); +begin + case APart of + sbpLineUp: InternalScroll(scLineUp); + sbpLineDown: InternalScroll(scLineDown); + sbpPageUp: InternalScroll(scPageUp); + sbpPageDown: InternalScroll(scPageDown); + sbpThumbnail: InternalScroll(scTrack); + end; +end; + +function TcxScrollBar.GetCtr3D: Boolean; +begin + Result := InternalCtl3D or FRealCtl3D; +end; + +function TcxScrollBar.GetInternalCtl3D: Boolean; +begin + Result := inherited Ctl3D; +end; + +function TcxScrollBar.GetPositionFromThumbnail: Integer; +var + ATotal, AThumbnailSize, ADistance: Integer; +begin + ATotal := FMax - FMin; + if FPageSize > 0 then Dec(ATotal, FPageSize - 1); + if FKind = sbHorizontal then + begin + AThumbnailSize := ViewInfo.ThumbnailRect.Right - ViewInfo.ThumbnailRect.Left; + ADistance := ViewInfo.BottomRightArrowRect.Left - ViewInfo.TopLeftArrowRect.Right - AThumbnailSize; + Result := FMin + MulDiv(ATotal, ViewInfo.ThumbnailRect.Left - ViewInfo.TopLeftArrowRect.Right, + ADistance); + end + else + begin + AThumbnailSize := ViewInfo.ThumbnailRect.Bottom - ViewInfo.ThumbnailRect.Top; + ADistance := ViewInfo.BottomRightArrowRect.Top - ViewInfo.TopLeftArrowRect.Bottom - AThumbnailSize; + Result := FMin + MulDiv(ATotal, ViewInfo.ThumbnailRect.Top - ViewInfo.TopLeftArrowRect.Bottom, + ADistance); + end; +end; + +function TcxScrollBar.GetScrollBarPart(P: TPoint): TcxScrollBarPart; +begin + Result := sbpNone; + if not PtInRect(ClientRect, P) then + Exit; + if PtInRect(ViewInfo.TopLeftArrowRect, P) then + Result := sbpLineUp + else if PtInRect(ViewInfo.BottomRightArrowRect, P) then + Result := sbpLineDown + else if IsRectEmpty(ViewInfo.ThumbnailRect) then + Exit + else if PtInRect(ViewInfo.ThumbnailRect, P) then + Result := sbpThumbnail + else if PtInRect(ViewInfo.PageUpRect, P) then + Result := sbpPageUp + else if PtInRect(ViewInfo.PageDownRect, P) then + Result := sbpPageDown +end; + +procedure TcxScrollBar.InternalScroll(AScrollCode: TScrollCode); +var + ScrollPos: Integer; + NewPos: Longint; + + procedure CorrectPos(var APos: Integer); + begin + if APos < Min then APos := Min; + if APos > Max then APos := Max; + end; + +begin + NewPos := Position; + case AScrollCode of + scLineUp: + Dec(NewPos, SmallChange); + scLineDown: + Inc(NewPos, SmallChange); + scPageUp: + Dec(NewPos, LargeChange); + scPageDown: + Inc(NewPos, LargeChange); + scTop: + NewPos := FMin; + scBottom: + NewPos := FMax; + end; + CorrectPos(NewPos); + ScrollPos := NewPos; + Scroll(AScrollCode, ScrollPos); + begin + CorrectPos(ScrollPos); + if ScrollPos <> FPosition then + begin + if AScrollCode <> scTrack then + SetPosition(ScrollPos) + else + begin + FPosition := ScrollPos; + Repaint; + end; + end; + end; +end; + +procedure TcxScrollBar.ThemeChanged; +begin + ViewInfo.CalculateMinThumnailSize; + ViewInfo.Calculate; + UpdateScrollBarBitmaps; + Invalidate; + if Parent <> nil then + Parent.Realign; +end; + +procedure TcxScrollBar.CMCtl3DChanged( + var Message: TMessage); +begin + inherited; + FRealCtl3D := InternalCtl3D; + LookAndFeelChanged(LookAndFeel, []); +end; + +procedure TcxScrollBar.CMEnabledChanged(var Message: TMessage); +begin + inherited; + ViewInfo.Calculate; + if not Enabled then + CancelScroll; + Invalidate; +end; + +procedure TcxScrollBar.CNHScroll(var Message: TWMHScroll); +begin + InternalScroll(TScrollCode(Message.ScrollCode)); +end; + +procedure TcxScrollBar.CMMouseEnter(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseEnter(Self) + else + MouseEnter(TControl(Message.lParam)); +end; + +procedure TcxScrollBar.CMMouseLeave(var Message: TMessage); +begin + inherited; + if Message.lParam = 0 then + MouseLeave(Self) + else + MouseLeave(TControl(Message.lParam)); +end; + +procedure TcxScrollBar.CMSysColorChange(var Message: TMessage); +begin + UpdateScrollBarBitmaps; + inherited; +end; + +procedure TcxScrollBar.CMVisibleChanged(var Message: TMessage); +begin + if not Visible then CancelScroll; + inherited; +end; + +procedure TcxScrollBar.CNVScroll(var Message: TWMVScroll); +begin + InternalScroll(TScrollCode(Message.ScrollCode)); +end; + +procedure TcxScrollBar.CNCtlColorScrollBar(var Message: TMessage); +begin + UpdateScrollBarBitmaps; + with Message do + CallWindowProc(DefWndProc, Handle, Msg, WParam, LParam); +end; + +procedure TcxScrollBar.WMEraseBkgnd(var Message: TWMEraseBkgnd); +begin + Message.Result := 1; +end; + +procedure TcxScrollBar.WMCancelMode(var Message: TWMCancelMode); +begin + CancelScroll; + inherited; +end; + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxStorage.pas b/official/x.35/ExpressLibrary/Sources/cxStorage.pas new file mode 100644 index 00000000..b15e0b76 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxStorage.pas @@ -0,0 +1,2226 @@ +{*******************************************************************} +{ } +{ Developer Express Cross Platform Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL AND CLX CONTROLS AS PART OF AN EXECUTABLE } +{ PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} +unit cxStorage; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Registry, SysUtils, Classes, TypInfo, IniFiles, cxClasses, cxLibraryStrs; + +type + { IcxStoredObject } + IcxStoredObject = interface + ['{79A05009-CAC3-47E8-B454-F6F3D91F495D}'] + function GetObjectName: string; + function GetProperties(AProperties: TStrings): Boolean; + procedure GetPropertyValue(const AName: string; var AValue: Variant); + procedure SetPropertyValue(const AName: string; const AValue: Variant); + end; + + { IcxStoredParent } + IcxStoredParent = interface + ['{6AF48CD0-3A0B-4BEC-AC88-5D323432A686}'] + function CreateChild(const AObjectName, AClassName: string): TObject; + procedure DeleteChild(const AObjectName: string; AObject: TObject); + procedure GetChildren(AChildren: TStringList); + end; + + {$IFNDEF DELPHI5} + EPropertyConvertError = class(Exception); + EPropertyError = class(Exception); + {$ENDIF} + EcxStorage = class(Exception); + EcxHexStringConvertError = class(Exception); + TcxStorageMode = (smChildrenCreating, smChildrenDeleting, smSavePublishedClassProperties); + TcxStorageModes = set of TcxStorageMode; + TcxCustomReader = class; + TcxCustomWriter = class; + TcxCustomReaderClass = class of TcxCustomReader; + TcxCustomWriterClass = class of TcxCustomWriter; + TcxGetStorageModesEvent = function: TcxStorageModes of object; + TcxTestClassPropertyEvent = function(const AName: string; AObject: TObject): Boolean of object; + TcxGetComponentByNameEvent = function(const AName: string): TComponent of object; + TcxGetUseInterfaceOnlyEvent = function: Boolean of object; + + { TcxStorage } + TcxStorage = class + private + FNamePrefix: string; + FModes: TcxStorageModes; + FObjectNamePrefix: string; + FReCreate: Boolean; + FStorageName: string; + FStream: TStream; + FStoredObject: TObject; + FSaveComponentPropertiesByName: Boolean; + FUseInterfaceOnly: Boolean; + FOnGetStorageModes: TcxGetStorageModesEvent; + FOnGetComponentByName: TcxGetComponentByNameEvent; + FOnTestClassProperty: TcxTestClassPropertyEvent; + FOnGetUseInterfaceOnly: TcxGetUseInterfaceOnlyEvent; + function CreateChild(const AObjectName, AClassName: string): TObject; + procedure CreateChildrenNames(AChildren: TStringList); + procedure DeleteChild(const AObjectName: string; AObject: TObject); + procedure GetAllPublishedClassProperties(AProperties: TStrings); + procedure GetAllPublishedProperties(AProperties: TStrings); + procedure GetChildren(AChildren: TStringList); + function GetClassProperty(const AName: string): TObject; + function GetComponentByName(const AName: string): TComponent; + function GetObjectName(AObject: TObject): string; + procedure GetProperties(AProperties: TStrings); + function GetPropertyValue(AName: string): Variant; + function GetStorageModes: TcxStorageModes; + function GetUseInterfaceOnly: Boolean; + procedure SetPropertyValue(AName: string; AValue: Variant); + function TestClassProperty(const AName: string; AObject: TObject): Boolean; + protected + procedure InternalRestoreFrom(AReader: TcxCustomReader; const ADefaultObjectName: string = ''); virtual; + procedure InternalStoreTo(AWriter: TcxCustomWriter; const ADefaultObjectName: string = ''); virtual; + procedure SetStoredObject(AObject: TObject); + public + constructor Create(const AStorageName: string); overload; + constructor Create(AStream: TStream); overload; + procedure RestoreFrom(AObject: TObject; AReaderClass: TcxCustomReaderClass); virtual; + procedure RestoreWithExistingReader(AObject: TObject; AReader: TcxCustomReader); virtual; + procedure RestoreFromIni(AObject: TObject); + procedure RestoreFromRegistry(AObject: TObject); + procedure RestoreFromStream(AObject: TObject); + procedure StoreTo(AObject: TObject; AWriterClass: TcxCustomWriterClass); virtual; + procedure StoreWithExistingWriter(AObject: TObject; AWriter: TcxCustomWriter); virtual; + procedure StoreToIni(AObject: TObject); + procedure StoreToRegistry(AObject: TObject); + procedure StoreToStream(AObject: TObject); + property NamePrefix: string read FNamePrefix write FNamePrefix; + property Modes: TcxStorageModes read FModes write FModes; + property ReCreate: Boolean read FReCreate write FReCreate; + property SaveComponentPropertiesByName: Boolean read FSaveComponentPropertiesByName write FSaveComponentPropertiesByName; + property StoredObject: TObject read FStoredObject; + property StorageName: string read FStorageName write FStorageName; + property UseInterfaceOnly: Boolean read FUseInterfaceOnly write FUseInterfaceOnly; + property OnGetComponentByName: TcxGetComponentByNameEvent read FOnGetComponentByName write FOnGetComponentByName; + property OnGetStorageModes: TcxGetStorageModesEvent read FOnGetStorageModes write FOnGetStorageModes; + property OnGetUseInterfaceOnly: TcxGetUseInterfaceOnlyEvent read FOnGetUseInterfaceOnly write FOnGetUseInterfaceOnly; + property OnTestClassProperty: TcxTestClassPropertyEvent read FOnTestClassProperty write FOnTestClassProperty; + end; + + { TcxCustomReader } + TcxCustomReader = class + protected + StorageName: string; + public + constructor Create(const AStorageName: string); virtual; + procedure ReadProperties(const AObjectName, AClassName: string; AProperties: TStrings); virtual; + function ReadProperty(const AObjectName, AClassName, AName: string): Variant; virtual; + procedure ReadChildren(const AObjectName, AClassName: string; AChildrenNames, + AChildrenClassNames: TStrings); virtual; + end; + + { TcxCustomWriter } + TcxCustomWriter = class + protected + FReCreate: Boolean; + FStorageName: string; + public + constructor Create(const AStorageName: string; AReCreate: Boolean = True); virtual; + procedure BeginWriteObject(const AObjectName, AClassName: string); virtual; + procedure EndWriteObject(const AObjectName, AClassName: string); virtual; + procedure WriteProperty(const AObjectName, AClassName, AName: string; AValue: Variant); virtual; + + property ReCreate: Boolean read FReCreate write FReCreate; + property StorageName: string read FStorageName; + end; + + { TcxRegistryReader } + TcxRegistryReader = class(TcxCustomReader) + private + FRegistry: TRegistry; + public + constructor Create(const AStorageName: string); override; + destructor Destroy; override; + procedure ReadProperties(const AObjectName, AClassName: string; AProperties: TStrings); override; + function ReadProperty(const AObjectName, AClassName, AName: string): Variant; override; + procedure ReadChildren(const AObjectName, AClassName: string; AChildrenNames, + AChildrenClassNames: TStrings); override; + end; + + { TcxRegistryWriter } + TcxRegistryWriter = class(TcxCustomWriter) + private + FRegistry: TRegistry; + FRootKeyCreated: Boolean; + FRootKeyOpened: Boolean; + procedure CreateRootKey; + public + constructor Create(const AStorageName: string; AReCreate: Boolean = True); override; + destructor Destroy; override; + procedure BeginWriteObject(const AObjectName, AClassName: string); override; + procedure EndWriteObject(const AObjectName, AClassName: string); override; + procedure WriteProperty(const AObjectName, AClassName, AName: string; AValue: Variant); override; + end; + + { TcxIniFileReader } + TcxIniFileReader = class(TcxCustomReader) + private + FIniFile: TMemIniFile; + FPathList: TStringList; + FObjectNameList: TStringList; + FClassNameList: TStringList; + procedure CreateLists; + procedure GetSectionDetail(const ASection: string; var APath, AObjectName, AClassName: string); + public + constructor Create(const AStorageName: string); override; + destructor Destroy; override; + procedure ReadProperties(const AObjectName, AClassName: string; AProperties: TStrings); override; + function ReadProperty(const AObjectName, AClassName, AName: string): Variant; override; + procedure ReadChildren(const AObjectName, AClassName: string; AChildrenNames, + AChildrenClassNames: TStrings); override; + end; + + { TcxIniFileWriter } + TcxIniFileWriter = class(TcxCustomWriter) + private + FIniFile: TMemIniFile; + public + constructor Create(const AStorageName: string; AReCreate: Boolean = True); override; + destructor Destroy; override; + procedure BeginWriteObject(const AObjectName, AClassName: string); override; + procedure WriteProperty(const AObjectName, AClassName, AName: string; AValue: Variant); override; + end; + +type + TcxStreamObjectData = class; + TcxStreamPropertyData = class; + + { TcxStreamReader } + TcxStreamReader = class(TcxCustomReader) + private + FCurrentObject: TcxStreamObjectData; + FCurrentObjectFullName: string; + FRootObject: TcxStreamObjectData; + FReader: TReader; + FStorageStream: TStream; + function GetObject(const AObjectFullName: string): TcxStreamObjectData; + function GetProperty(AObject: TcxStreamObjectData; const AName: string): TcxStreamPropertyData; + function InternalGetObject(const AObjectName: string; AParents: TStrings): TcxStreamObjectData; + public + constructor Create(const AStorageName: string); override; + destructor Destroy; override; + procedure Read; + procedure ReadProperties(const AObjectName, AClassName: string; AProperties: TStrings); override; + function ReadProperty(const AObjectName, AClassName, AName: string): Variant; override; + procedure ReadChildren(const AObjectName, AClassName: string; AChildrenNames, + AChildrenClassNames: TStrings); override; + procedure SetStream(AStream: TStream); + end; + + { TcxStreamWriter } + TcxStreamWriter = class(TcxCustomWriter) + private + FCurrentObject: TcxStreamObjectData; + FRootObject: TcxStreamObjectData; + FWriter: TWriter; + procedure CreateObject(const AObjectName, AClassName: string; AParents: TStrings); + public + constructor Create(const AStorageName: string; AReCreate: Boolean = True); override; + destructor Destroy; override; + procedure BeginWriteObject(const AObjectName, AClassName: string); override; + procedure SetStream(AStream: TStream); + procedure Write; + procedure WriteProperty(const AObjectName, AClassName, AName: string; AValue: Variant); override; + end; + + { TcxStreamPropertyData } + TcxStreamPropertyData = class + private + FName: string; + FValue: Variant; + procedure ReadValue(AReader: TReader); + procedure WriteValue(AWriter: TWriter); + public + constructor Create(AName: string; AValue: Variant); + procedure Read(AReader: TReader); + procedure Write(AWriter: TWriter); + property Name: string read FName; + property Value: Variant read FValue; + end; + + { TcxStreamObjectData } + TcxStreamObjectData = class + private + FClassName: string; + FChildren: TList; + FName: string; + FProperties: TList; + procedure Clear; + function GetChildCount: Integer; + function GetChildren(AIndex: Integer): TcxStreamObjectData; + function GetProperties(AIndex: Integer): TcxStreamPropertyData; + function GetPropertyCount: Integer; + public + constructor Create(const AName, AClassName: string); + destructor Destroy; override; + procedure AddChild(AChild: TcxStreamObjectData); + procedure AddProperty(AProperty: TcxStreamPropertyData); + procedure Read(AReader: TReader); + procedure Write(AWriter: TWriter); + property ChildCount: Integer read GetChildCount; + property Children[AIndex: Integer]: TcxStreamObjectData read GetChildren; + property Name: string read FName; + property ClassName_: string read FClassName; + property Properties[AIndex: Integer]: TcxStreamPropertyData read GetProperties; + property PropertyCount: Integer read GetPropertyCount; + end; + + function StreamToString(AStream: TStream): string; + procedure StringToStream(AValue: string; AStream: TStream); + function StringToHexString(const AString: string): string; + function HexStringToString(const AHexString: string): string; + function StringToBoolean(const AString: string): Boolean; + function EnumerationToString(const AValue: Integer; AEnumNames: array of string): string; + function StringToEnumeration(const AValue: string; AEnumNames: array of string): Integer; + function SetToString(const ASet; ASize: Integer; AEnumNames: array of string): string; + procedure StringToSet(AString: string; var ASet; ASize: Integer; AEnumNames: array of string); + {$IFNDEF DELPHI5} + function SetSetProp(APropInfo: PPropInfo; const AValue: string): Integer; + function GetObjectProp(AObject: TObject; APropInfo: PPropInfo): TObject; + procedure SetObjectProp(AObject: TObject; APropInfo: PPropInfo; AValue: TObject); + function GetObjectPropClass(AObject: TObject; APropInfo: PPropInfo): TClass; + {$ENDIF} + +const + cxBufferSize: Integer = 500000; + + cxStreamBoolean = 1; + cxStreamChar = 2; + cxStreamCurrency = 3; + cxStreamDate = 4; + cxStreamFloat = 5; + cxStreamInteger = 6; + cxStreamSingle = 7; + cxStreamString = 8; + cxStreamWideString = 9; + +implementation + +function StreamToString(AStream: TStream): string; +begin + if (AStream = nil) or (AStream.Size = 0) then + begin + Result := ''; + Exit; + end; + SetLength(Result, AStream.Size); + AStream.Position := 0; + AStream.ReadBuffer(Result[1], AStream.Size); + Result := 'Hex:' + StringToHexString(Result); +end; + +procedure StringToStream(AValue: string; AStream: TStream); +begin + if (AStream = nil) or (Length(AValue) < 6) then Exit; + Delete(AValue, 1, 4); + if Length(AValue) > 0 then + begin + AValue := HexStringToString(AValue); + AStream.WriteBuffer(AValue[1], Length(AValue)); + end; +end; + +function StringToHexString(const AString: string): string; +var + I: Integer; +begin + Result := ''; + for I := 1 to Length(AString) do + Result := Result + IntToHex(Ord(AString[I]), 2); +end; + +function HexStringToString(const AHexString: string): string; + function HexToByte(AHex: Char): Byte; + begin + case AHex of + '0'..'9': + Result := Byte(AHex) - Byte('0'); + 'a'..'f': + Result := Byte(AHex) - Byte('a') + 10; + 'A'..'F': + Result := Byte(AHex) - Byte('A') + 10; + else + raise EcxHexStringConvertError.Create(''); + end; + end; +var + I: Integer; +begin + Result := ''; + I := 1; + while I < Length(AHexString) do + begin + Result := Result + Char((HexToByte(AHexString[I]) shl 4) + HexToByte(AHexString[I + 1])); + Inc(I, 2); + end; +end; + +function StringToBoolean(const AString: string): Boolean; +begin + if UpperCase(AString) = 'TRUE' then + Result := True + else if UpperCase(AString) = 'FALSE' then + Result := False + else + raise EPropertyConvertError.Create(''); +end; + +function EnumerationToString(const AValue: Integer; AEnumNames: array of string): string; +begin + if (AValue >= 0) and (AValue <= High(AEnumNames)) then + Result := AEnumNames[AValue] + else + raise EPropertyConvertError.Create(''); +end; + +function StringToEnumeration(const AValue: string; AEnumNames: array of string): Integer; +var + I: Integer; + AUpperCaseValue: string; +begin + AUpperCaseValue := UpperCase(AValue); + for I := 0 to High(AEnumNames) do + if AUpperCaseValue = UpperCase(AEnumNames[I]) then + begin + Result := I; + Exit; + end; + raise EPropertyConvertError.Create(''); +end; + +function SetToString(const ASet; ASize: Integer; AEnumNames: array of string): string; +var + AInt: Integer; + I: Integer; +begin + AInt := Integer(ASet); + if ASize < SizeOf(Integer) then + AInt := AInt and (1 shl (ASize * 8) - 1); + Result := ''; + for I := 0 to SizeOf(Integer) * 8 - 1 do + begin + if AInt and 1 <> 0 then + begin + if I > High(AEnumNames) then + raise EPropertyConvertError.Create(''); + if Result <> '' then + Result := Result + ','; + Result := Result + AEnumNames[I]; + end; + AInt := AInt shr 1; + end; + Result := '[' + Result + ']'; +end; + +procedure StringToSet(AString: string; var ASet; ASize: Integer; AEnumNames: array of string); + + function FindEnum(const AStr: string): Integer; + var + I: Integer; + AUpperCaseStr: string; + begin + Result := -1; + AUpperCaseStr := UpperCase(AStr); + for I := 0 to High(AEnumNames) do + if AUpperCaseStr = UpperCase(AEnumNames[I]) then + begin + Result := I; + Break; + end; + end; + +var + AInt: Integer; + + procedure AddBit(const AStr: string); + var + AIndex: Integer; + begin + AIndex := FindEnum(AStr); + if AIndex <> -1 then + begin + AIndex := 1 shl AIndex; + AInt := AInt or AIndex; + end; + end; + +var + I: Integer; + AEnumString: string; +begin + if (AString <> '') and (AString[1] = '[') and (AString[Length(AString)] = ']') then + begin + AInt := 0; + AEnumString := ''; + Delete(AString, 1, 1); + Delete(AString, Length(AString), 1); + for I := 1 to Length(AString) do + begin + if AString[I] = ',' then + begin + AddBit(AEnumString); + AEnumString := ''; + end + else + AEnumString := AEnumString + AString[I]; + end; + if AEnumString <> '' then + AddBit(AEnumString); + Move(AInt, ASet, ASize); + end + else + raise EPropertyConvertError.Create(''); +end; + +{$IFNDEF DELPHI5} +function SetSetProp(APropInfo: PPropInfo; const AValue: string): Integer; +type + TIntegerSet = set of 0..SizeOf(Integer) * 8 - 1; +var + P: PChar; + AEnumName: string; + AEnumValue: Longint; + AEnumInfo: PTypeInfo; + + function NextWord(var P: PChar): string; + var + I: Integer; + begin + I := 0; + while not (P[I] in [',', ' ', #0, ']']) do + Inc(I); + SetString(Result, P, I); + while P[I] in [',', ' ', ']'] do + Inc(I); + Inc(P, I); + end; + +begin + Result := 0; + if AValue = '' then + Exit; + P := PChar(AValue); + while P^ in ['[', ' '] do + Inc(P); + AEnumInfo := GetTypeData(APropInfo^.PropType^)^.CompType^; + AEnumName := NextWord(P); + while AEnumName <> '' do + begin + if AEnumInfo^.Kind = tkInteger then + AEnumValue := StrToInt(AEnumName) + else + AEnumValue := GetEnumValue(AEnumInfo, AEnumName); + if AEnumValue < 0 then + raise EPropertyConvertError.CreateFmt(cxGetResourceString(@scxInvalidPropertyElement), [AEnumName]); + Include(TIntegerSet(Result), AEnumValue); + AEnumName := NextWord(P); + end; +end; + +function GetObjectProp(AObject: TObject; APropInfo: PPropInfo): TObject; +begin + Result := TObject(GetOrdProp(AObject, APropInfo)); +end; + +procedure SetObjectProp(AObject: TObject; APropInfo: PPropInfo; AValue: TObject); +begin + if AValue is GetObjectPropClass(AObject, APropInfo) then + SetOrdProp(AObject, APropInfo, Integer(AValue)); +end; + +function GetObjectPropClass(AObject: TObject; APropInfo: PPropInfo): TClass; +var + ATypeData: PTypeData; +begin + ATypeData := GetTypeData(APropInfo^.PropType^); + if ATypeData = nil then + raise EPropertyError.Create(''); + Result := ATypeData^.ClassType; +end; +{$ENDIF} + +function GenRegistryPath(const ARoot: string): string; +begin + Result := ARoot; + if Length(Result) > 0 then + if Result[1] <> '\' then + Result := '\' + Result; +end; + +function DateTimeOrStr(AValue: string): Variant; +var + ADateTimeValue: TDateTime; +begin + {$IFDEF DELPHI6} + if TryStrToDateTime(AValue, ADateTimeValue) then + Result := ADateTimeValue + else + Result := AValue; + {$ELSE} + try + ADateTimeValue := StrToDateTime(AValue); + Result := ADateTimeValue; + except + on EConvertError do + Result := AValue; + end; + {$ENDIF} +end; + +procedure ExtractObjectFullName(const AObjectFullName: string; AParents: TStrings; var AObjectName: string); +var + I: Integer; + AName: string; +begin + if AParents <> nil then + begin + AObjectName := ''; + AName := ''; + for I := 1 to Length(AObjectFullName) do + begin + if AObjectFullName[I] = '/' then + begin + AParents.Add(AName); + AName := ''; + end + else + AName := AName + AObjectFullName[I]; + end; + AObjectName := AName; + end; +end; + +function CorrectStringValue(AValue: string): string; +begin + Result := '"' + AValue + '"'; +end; + +function IsStringValue(var AValue: string): Boolean; +begin + Result := False; + if (Length(AValue) >= 2) and (AValue[1] = '"') and (AValue[Length(AValue)] = '"') then + begin + Delete(AValue, 1, 1); + Delete(AValue, Length(AValue), 1); + Result := True; + end; +end; + +{ TcxStorage } + +constructor TcxStorage.Create(const AStorageName: string); +begin + inherited Create; + FStorageName := AStorageName; + FReCreate := True; +end; + +constructor TcxStorage.Create(AStream: TStream); +begin + inherited Create; + FStream := AStream; + FReCreate := True; +end; + +procedure TcxStorage.RestoreFrom(AObject: TObject; AReaderClass: TcxCustomReaderClass); +var + AReader: TcxCustomReader; +begin + SetStoredObject(AObject); + AReader := AReaderClass.Create(FStorageName); + try + InternalRestoreFrom(AReader); + finally + AReader.Free; + end; +end; + +procedure TcxStorage.RestoreWithExistingReader(AObject: TObject; AReader: TcxCustomReader); +begin + if AReader <> nil then + begin + SetStoredObject(AObject); + if AReader is TcxStreamReader then + TcxStreamReader(AReader).Read; + InternalRestoreFrom(AReader); + end; +end; + +procedure TcxStorage.RestoreFromIni(AObject: TObject); +begin + if not FileExists(FStorageName) then + Exit; + RestoreFrom(AObject, TcxIniFileReader); +end; + +procedure TcxStorage.RestoreFromRegistry(AObject: TObject); +begin + RestoreFrom(AObject, TcxRegistryReader); +end; + +procedure TcxStorage.RestoreFromStream(AObject: TObject); +var + AReader: TcxStreamReader; +begin + if (FStream = nil) or (FStream.Size = 0) then + Exit; + + SetStoredObject(AObject); + AReader := TcxStreamReader.Create(FStorageName); + AReader.SetStream(FStream); + try + AReader.Read; + InternalRestoreFrom(AReader); + finally + AReader.Free; + end; +end; + +procedure TcxStorage.StoreTo(AObject: TObject; AWriterClass: TcxCustomWriterClass); +var + AWriter: TcxCustomWriter; +begin + SetStoredObject(AObject); + AWriter := AWriterClass.Create(FStorageName, ReCreate); + try + InternalStoreTo(AWriter); + finally + AWriter.Free; + end; +end; + +procedure TcxStorage.StoreWithExistingWriter(AObject: TObject; AWriter: TcxCustomWriter); +begin + if AWriter <> nil then + begin + SetStoredObject(AObject); + InternalStoreTo(AWriter); + if AWriter is TcxStreamWriter then + TcxStreamWriter(AWriter).Write; + end; +end; + +procedure TcxStorage.StoreToIni(AObject: TObject); +begin + StoreTo(AObject, TcxIniFileWriter); +end; + +procedure TcxStorage.StoreToRegistry(AObject: TObject); +begin + StoreTo(AObject, TcxRegistryWriter); +end; + +procedure TcxStorage.StoreToStream(AObject: TObject); +var + AWriter: TcxStreamWriter; +begin + if FStream = nil then + Exit; + SetStoredObject(AObject); + + AWriter := TcxStreamWriter.Create(FStorageName); + AWriter.SetStream(FStream); + try + InternalStoreTo(AWriter); + AWriter.Write; + finally + AWriter.Free; + end; +end; + +function TcxStorage.CreateChild(const AObjectName, AClassName: string): TObject; +var + AInterface: IcxStoredParent; +begin + Result := nil; + if Supports(FStoredObject, IcxStoredParent, AInterface) then + Result := AInterface.CreateChild(AObjectName, AClassName); + if Result = nil then + begin + if FStoredObject is TCollection then + Result := (FStoredObject as TCollection).Add + end; +end; + +procedure TcxStorage.CreateChildrenNames(AChildren: TStringList); +var + I: Integer; +begin + for I := 0 to AChildren.Count - 1 do + if AChildren[I] = '' then + AChildren[I] := GetObjectName(AChildren.Objects[I]); +end; + +procedure TcxStorage.DeleteChild(const AObjectName: string; AObject: TObject); +var + AInterface: IcxStoredParent; +begin + if Supports(FStoredObject, IcxStoredParent, AInterface) then + AInterface.DeleteChild(AObjectName, AObject) + else + if FStoredObject is TCollection then + AObject.Free; +end; + +procedure TcxStorage.GetAllPublishedClassProperties(AProperties: TStrings); +var + APropList: PPropList; + ATypeInfo: PTypeInfo; + ATypeData: PTypeData; + I: Integer; +begin + ATypeInfo := FStoredObject.ClassInfo; + if ATypeInfo = nil then + Exit; + ATypeData := GetTypeData(ATypeInfo); + + if ATypeData.PropCount > 0 then + begin + GetMem(APropList, SizeOf(PPropInfo) * ATypeData.PropCount); + try + GetPropInfos(ATypeInfo, APropList); + for I := 0 to ATypeData.PropCount - 1 do + if APropList[I].PropType^.Kind = tkClass then + AProperties.Add(APropList[I].Name); + finally + FreeMem(APropList, SizeOf(PPropInfo) * ATypeData.PropCount); + end; + end; +end; + +procedure TcxStorage.GetAllPublishedProperties(AProperties: TStrings); +var + APropList: PPropList; + ATypeInfo: PTypeInfo; + ATypeData: PTypeData; + I: Integer; +begin + ATypeInfo := FStoredObject.ClassInfo; + if ATypeInfo = nil then + Exit; + ATypeData := GetTypeData(ATypeInfo); + + if ATypeData.PropCount > 0 then + begin + GetMem(APropList, SizeOf(PPropInfo) * ATypeData.PropCount); + try + GetPropInfos(ATypeInfo, APropList); + for I := 0 to ATypeData.PropCount - 1 do + if APropList[I].PropType^.Kind <> tkMethod then + AProperties.Add(APropList[I].Name); + finally + FreeMem(APropList, SizeOf(PPropInfo) * ATypeData.PropCount); + end; + end; +end; + +procedure TcxStorage.GetChildren(AChildren: TStringList); +var + AInterface: IcxStoredParent; + I: Integer; + AClassProperties: TStringList; + AClassProperty: TObject; +begin + if Supports(FStoredObject, IcxStoredParent, AInterface) then + AInterface.GetChildren(AChildren); + if smSavePublishedClassProperties in GetStorageModes then + begin + AClassProperties := TStringList.Create; + try + if (FStoredObject is TCollection) and + not Supports(FStoredObject, IcxStoredParent) then + with TCollection(FStoredObject) do + for I := 0 to Count - 1 do + AChildren.AddObject(IntToStr(I), Items[I]); + GetAllPublishedClassProperties(AClassProperties); + for I := 0 to AClassProperties.Count - 1 do + begin + AClassProperty := GetClassProperty(AClassProperties[I]); + if AClassProperty <> nil then + if TestClassProperty(AClassProperties[I], AClassProperty) then + AChildren.AddObject(AClassProperties[I], AClassProperty); + end; + finally + AClassProperties.Free; + end; + end; +end; + +function TcxStorage.GetClassProperty(const AName: string): TObject; +var + ATypeInfo: PTypeInfo; + APropInfo: PPropInfo; +begin + Result := nil; + ATypeInfo := FStoredObject.ClassInfo; + if ATypeInfo = nil then + Exit; + APropInfo := GetPropInfo(ATypeInfo, AName); + if APropInfo <> nil then + if APropInfo^.PropType^.Kind = tkClass then + Result := GetObjectProp(FStoredObject, APropInfo); +end; + +function TcxStorage.GetComponentByName(const AName: string): TComponent; +begin + if Assigned(FOnGetComponentByName) then + Result := FOnGetComponentByName(AName) + else + Result := nil; +end; + +function TcxStorage.GetObjectName(AObject: TObject): string; +var + AInterface: IcxStoredObject; + AObj: TObject; +begin + if AObject <> nil then + AObj := AObject + else + AObj := FStoredObject; + + if Supports(AObj, IcxStoredObject, AInterface) then + Result := AInterface.GetObjectName + else + if AObj is TComponent then + Result := (AObj as TComponent).Name + else + Result := 'Object'; +end; + +procedure TcxStorage.GetProperties(AProperties: TStrings); +var + AInterface: IcxStoredObject; +begin + if Supports(FStoredObject, IcxStoredObject, AInterface) then + begin + if not AInterface.GetProperties(AProperties) then + GetAllPublishedProperties(AProperties); + end + else + GetAllPublishedProperties(AProperties); +end; + +function TcxStorage.GetPropertyValue(AName: string): Variant; + + procedure GetPropertyValueByInterface; + var + AInterface: IcxStoredObject; + begin + if Supports(FStoredObject, IcxStoredObject, AInterface) then + AInterface.GetPropertyValue(AName, Result); + end; + + procedure BooleanVariantToStringVariant(var AValue: Variant); + begin + if VarType(AValue) = varBoolean then + begin + if AValue then + AValue := 'True' + else + AValue := 'False'; + end; + end; + +var + ATypeInfo: PTypeInfo; + APropInfo: PPropInfo; + AObject: TObject; +begin + Result := Null; + if not GetUseInterfaceOnly then + begin + ATypeInfo := FStoredObject.ClassInfo; + if ATypeInfo <> nil then + begin + APropInfo := GetPropInfo(ATypeInfo, AName); + if APropInfo <> nil then + begin + case APropInfo^.PropType^.Kind of + tkInteger, tkChar, tkWChar: + Result := GetOrdProp(FStoredObject, APropInfo); + tkEnumeration: + {$IFDEF DELPHI5} + Result := GetEnumProp(FStoredObject, APropInfo); + {$ELSE} + if APropInfo^.PropType^.Kind = tkInteger then + Result := IntToStr(GetOrdProp(FStoredObject, APropInfo)) + else + Result := GetEnumName(APropInfo^.PropType^, GetOrdProp(FStoredObject, APropInfo)); + {$ENDIF} + tkFloat: + Result := GetFloatProp(FStoredObject, APropInfo); + tkString, tkLString: + Result := GetStrProp(FStoredObject, APropInfo); + {$IFDEF DELPHI6} + tkWString: + Result := GetWideStrProp(FStoredObject, APropInfo); + {$ENDIF} + tkSet: + {$IFDEF DELPHI5} + Result := GetSetProp(FStoredObject, APropInfo, True); + {$ELSE} + Result := GetSetProp_(APropInfo); + {$ENDIF} + tkVariant: + Result := GetVariantProp(FStoredObject, APropInfo); + {$IFDEF DELPHI6} + tkInt64: + Result := GetInt64Prop(FStoredObject, APropInfo); + {$ENDIF} + tkClass: + begin + if FSaveComponentPropertiesByName then + begin + AObject := GetObjectProp(FStoredObject, APropInfo); + if AObject is TComponent then + Result := (AObject as TComponent).Name; + end + else + GetPropertyValueByInterface; + end; + else + GetPropertyValueByInterface; + end; + end + else + GetPropertyValueByInterface; + end + else + GetPropertyValueByInterface; + end + else + GetPropertyValueByInterface; + BooleanVariantToStringVariant(Result); +end; + +function TcxStorage.GetStorageModes: TcxStorageModes; +begin + if Assigned(FOnGetStorageModes) then + Result := FOnGetStorageModes + else + Result := FModes; +end; + +function TcxStorage.GetUseInterfaceOnly: Boolean; +begin + if Assigned(FOnGetUseInterfaceOnly) then + Result := FOnGetUseInterfaceOnly + else + Result := FUseInterfaceOnly; +end; + +procedure TcxStorage.InternalRestoreFrom(AReader: TcxCustomReader; + const ADefaultObjectName: string); +var + AProperties: TStringList; + AChildrenNames: TStringList; + AChildrenClassNames: TStringList; + AObjectFullName: string; + AValue: Variant; + AIndex: Integer; + AStorage: TcxStorage; + AChildObject: TObject; + AChildObjectName: string; + AObjectName: string; + I: Integer; + AChildren: TStringList; +begin + AProperties := TStringList.Create; + AChildrenNames := TStringList.Create; + AChildrenClassNames := TStringList.Create; + try + if ADefaultObjectName <> '' then + AObjectName := ADefaultObjectName + else + AObjectName := GetObjectName(nil); + if FNamePrefix <> '' then + AObjectName := FNamePrefix + '.' + AObjectName; + + AObjectFullName := FObjectNamePrefix + AObjectName; + AReader.ReadProperties(AObjectFullName, FStoredObject.ClassName, AProperties); + for I := 0 to AProperties.Count - 1 do + begin + if AProperties[I] = '' then + Continue; + AValue := AReader.ReadProperty(AObjectFullName, FStoredObject.ClassName, AProperties[I]); + if not VarIsNull(AValue) then + SetPropertyValue(AProperties[I], AValue); + end; + + AReader.ReadChildren(AObjectFullName, FStoredObject.ClassName, AChildrenNames, AChildrenClassNames); + + AChildren := TStringList.Create; + try + GetChildren(AChildren); + CreateChildrenNames(AChildren); + for I := 0 to AChildrenNames.Count - 1 do + begin + AIndex := AChildren.IndexOf(AChildrenNames[I]); + if AIndex >= 0 then + begin + AChildObject := AChildren.Objects[AIndex]; + AChildObjectName := AChildren[AIndex]; + AChildren.Delete(AIndex); + end + else + begin + if smChildrenCreating in GetStorageModes then + begin + AChildObject := CreateChild(AChildrenNames[I], AChildrenClassNames[I]); + AChildObjectName := AChildrenNames[I]; + end + else + AChildObject := nil; + end; + + if AChildObject <> nil then + begin + AStorage := TcxStorage.Create(''); + AStorage.FObjectNamePrefix := AObjectFullName + '/'; + AStorage.FNamePrefix := ''; + AStorage.FStoredObject := AChildObject; + AStorage.OnTestClassProperty := FOnTestClassProperty; + AStorage.OnGetComponentByName := FOnGetComponentByName; + AStorage.FModes := Modes; + AStorage.SaveComponentPropertiesByName := FSaveComponentPropertiesByName; + try + AStorage.InternalRestoreFrom(AReader, AChildObjectName); + finally + AStorage.Free; + end; + end; + end; + + if smChildrenDeleting in GetStorageModes then + begin + if AChildren.Count > 0 then + begin + for I := 0 to AChildren.Count - 1 do + DeleteChild(AChildren[I], AChildren.Objects[I]); + end; + end; + finally + AChildren.Free; + end; + finally + AProperties.Free; + AChildrenNames.Free; + AChildrenClassNames.Free; + end; +end; + +procedure TcxStorage.InternalStoreTo(AWriter: TcxCustomWriter; const ADefaultObjectName: string); +var + AProperties: TStringList; + AStorage: TcxStorage; + I: Integer; + AObjectFullName: string; + AObjectName: string; + APropertyValue: Variant; + AChildren: TStringList; +begin + AProperties := TStringList.Create; + try + if ADefaultObjectName <> '' then + AObjectName := ADefaultObjectName + else + AObjectName := GetObjectName(nil); + if FNamePrefix <> '' then + AObjectName := FNamePrefix + '.' + AObjectName; + + AObjectFullName := FObjectNamePrefix + AObjectName; + AWriter.BeginWriteObject(AObjectFullName, FStoredObject.ClassName); + + GetProperties(AProperties); + for I := 0 to AProperties.Count - 1 do + begin + APropertyValue := GetPropertyValue(AProperties[I]); + if not (VarIsEmpty(APropertyValue) or VarIsNull(APropertyValue)) then + AWriter.WriteProperty(AObjectFullName, FStoredObject.ClassName, AProperties[I], APropertyValue); + end; + + AChildren := TStringList.Create; + try + GetChildren(AChildren); + for I := 0 to AChildren.Count - 1 do + begin + AStorage := TcxStorage.Create(''); + AStorage.FObjectNamePrefix := AObjectFullName + '/'; + AStorage.FNamePrefix := ''; + AStorage.FStoredObject := AChildren.Objects[I]; + AStorage.OnTestClassProperty := FOnTestClassProperty; + AStorage.OnGetComponentByName := FOnGetComponentByName; + AStorage.Modes := Modes; + AStorage.SaveComponentPropertiesByName := FSaveComponentPropertiesByName; + try + AStorage.InternalStoreTo(AWriter, AChildren[I]); + finally + AStorage.Free; + end; + end; + finally + AChildren.Free; + end; + AWriter.EndWriteObject(AObjectFullName, FStoredObject.ClassName); + finally + AProperties.Free; + end; +end; + +procedure TcxStorage.SetPropertyValue(AName: string; AValue: Variant); + + procedure SetPropertyValueByInterface; + var + AInterface: IcxStoredObject; + begin + if Supports(FStoredObject, IcxStoredObject, AInterface) then + AInterface.SetPropertyValue(AName, AValue); + end; + +var + ATypeInfo: PTypeInfo; + APropInfo: PPropInfo; +{$IFDEF DELPHI6} + AInt64: Int64; +{$ENDIF} + AClass: TClass; + AComponent: TComponent; +begin + if not VarIsNull(AValue) then + begin + if not GetUseInterfaceOnly then + begin + ATypeInfo := FStoredObject.ClassInfo; + if ATypeInfo <> nil then + begin + APropInfo := GetPropInfo(ATypeInfo, AName); + if APropInfo <> nil then + begin + case APropInfo^.PropType^.Kind of + tkInteger, tkChar, tkWChar: + SetOrdProp(FStoredObject, APropInfo, AValue); + tkEnumeration: + {$IFDEF DELPHI6} + SetEnumProp(FStoredObject, APropInfo, AValue); + {$ELSE} + {$IFDEF DELPHI5} + SetEnumProp(FStoredObject, AName, VarToStr(AValue)); + {$ELSE} + SetOrdProp(FStoredObject, APropInfo, GetEnumValue(APropInfo^.PropType^, AValue)); + {$ENDIF} + {$ENDIF} + tkFloat: + SetFloatProp(FStoredObject, APropInfo, AValue); + tkString, tkLString: + {$IFDEF DELPHI5} + SetStrProp(FStoredObject, AName, VarToStr(AValue)); + {$ELSE} + SetStrProp(FStoredObject, APropInfo, AValue); + {$ENDIF} + {$IFDEF DELPHI6} + tkWString: + SetWideStrProp(FStoredObject, APropInfo, AValue); + {$ENDIF} + tkSet: + {$IFDEF DELPHI6} + SetSetProp(FStoredObject, APropInfo, AValue); + {$ELSE} + {$IFDEF DELPHI5} + SetSetProp(FStoredObject, AName, VarToStr(AValue)); + {$ELSE} + SetOrdProp(FStoredObject, APropInfo, SetSetProp(APropInfo, AValue)); + {$ENDIF} + {$ENDIF} + tkVariant: + SetVariantProp(FStoredObject, APropInfo, AValue); + {$IFDEF DELPHI6} + tkInt64: + begin + AInt64 := AValue; + SetInt64Prop(FStoredObject, APropInfo, AInt64); + end; + {$ENDIF} + tkClass: + begin + if FSaveComponentPropertiesByName then + begin + if VarType(AValue) = varString then + begin + AClass := GetObjectPropClass(FStoredObject, APropInfo); + if (AClass = TComponent) or (AClass.InheritsFrom(TComponent)) then + begin + AComponent := GetComponentByName(VarToStr(AValue)); + if AComponent <> nil then + SetObjectProp(FStoredObject, APropInfo, AComponent); + end + else + SetPropertyValueByInterface; + end + else + SetPropertyValueByInterface; + end + else + SetPropertyValueByInterface; + end; + else + SetPropertyValueByInterface; + end; + end + else + SetPropertyValueByInterface; + end + else + SetPropertyValueByInterface; + end + else + SetPropertyValueByInterface; + end; +end; + +procedure TcxStorage.SetStoredObject(AObject: TObject); +begin + FStoredObject := AObject; +end; + +function TcxStorage.TestClassProperty(const AName: string; + AObject: TObject): Boolean; +begin + if Assigned(FOnTestClassProperty) then + Result := FOnTestClassProperty(AName, AObject) + else + Result := True; +end; + +{ TcxCustomReader } + +constructor TcxCustomReader.Create(const AStorageName: string); +begin + inherited Create; + StorageName := AStorageName; +end; + +procedure TcxCustomReader.ReadChildren(const AObjectName, AClassName: string; + AChildrenNames, AChildrenClassNames: TStrings); +begin +end; + +procedure TcxCustomReader.ReadProperties(const AObjectName, AClassName: string; AProperties: TStrings); +begin +end; + +function TcxCustomReader.ReadProperty(const AObjectName, AClassName, AName: string): Variant; +begin + Result := Null; +end; + +{ TcxCustomWriter } + +constructor TcxCustomWriter.Create(const AStorageName: string; AReCreate: Boolean); +begin + inherited Create; + FStorageName := AStorageName; + FReCreate := AReCreate; +end; + +procedure TcxCustomWriter.BeginWriteObject(const AObjectName, AClassName: string); +begin +end; + +procedure TcxCustomWriter.EndWriteObject(const AObjectName, AClassName: string); +begin +end; + +procedure TcxCustomWriter.WriteProperty(const AObjectName, AClassName, AName: string; AValue: Variant); +begin +end; + +{ TcxStreamReader } + +constructor TcxStreamReader.Create(const AStorageName: string); +begin + inherited Create(AStorageName); + + FReader := nil; + FRootObject := nil; + FCurrentObjectFullName := ''; +end; + +destructor TcxStreamReader.Destroy; +begin + FReader.Free; + FRootObject.Free; + + inherited Destroy; +end; + +procedure TcxStreamReader.Read; +begin + FRootObject.Free; + FRootObject := TcxStreamObjectData.Create('', ''); + + if (FStorageStream <> nil) and (FReader.Position < FStorageStream.Size) then + FRootObject.Read(FReader); +end; + +procedure TcxStreamReader.ReadChildren(const AObjectName, AClassName: string; + AChildrenNames, AChildrenClassNames: TStrings); +var + I: Integer; + AObject: TcxStreamObjectData; +begin + AObject := GetObject(AObjectName); + if AObject <> nil then + begin + for I := 0 to AObject.ChildCount - 1 do + begin + AChildrenNames.Add(AObject.Children[I].Name); + AChildrenClassNames.Add(AObject.Children[I].ClassName_); + end; + end; +end; + +procedure TcxStreamReader.ReadProperties(const AObjectName, AClassName: string; AProperties: TStrings); +var + AObject: TcxStreamObjectData; + I: Integer; +begin + AObject := GetObject(AObjectName); + if AObject <> nil then + begin + for I := 0 to AObject.PropertyCount - 1 do + AProperties.Add(AObject.Properties[I].Name); + end; +end; + +function TcxStreamReader.ReadProperty(const AObjectName, AClassName, AName: string): Variant; +var + AProperty: TcxStreamPropertyData; +begin + AProperty := GetProperty(GetObject(AObjectName), AName); + if AProperty <> nil then + Result := AProperty.Value + else + Result := Null; +end; + +procedure TcxStreamReader.SetStream(AStream: TStream); +begin + if FStorageStream <> AStream then + begin + FStorageStream := AStream; + FReader.Free; + FReader := TReader.Create(AStream, cxBufferSize); + end; +end; + +function TcxStreamReader.GetObject(const AObjectFullName: string): TcxStreamObjectData; +var + AObjectName: string; + AParents: TStringList; +begin + if AObjectFullName = FCurrentObjectFullName then + Result := FCurrentObject + else + begin + AParents := TStringList.Create; + try + ExtractObjectFullName(AObjectFullName, AParents, AObjectName); + Result := InternalGetObject(AObjectName, AParents); + if Result <> nil then + begin + FCurrentObjectFullName := AObjectFullName; + FCurrentObject := Result; + end; + finally + AParents.Free; + end; + end; +end; + +function TcxStreamReader.GetProperty(AObject: TcxStreamObjectData; const AName: string): TcxStreamPropertyData; +var + I: Integer; +begin + Result := nil; + + for I := 0 to AObject.PropertyCount - 1 do + if AObject.Properties[I].Name = AName then + begin + Result := AObject.Properties[I]; + Break; + end; +end; + +function TcxStreamReader.InternalGetObject(const AObjectName: string; AParents: TStrings): TcxStreamObjectData; +var + I, J: Integer; + AObject: TcxStreamObjectData; +begin + AParents.Add(AObjectName); + AObject := FRootObject; + for I := 1 to AParents.Count - 1 do + begin + for J := 0 to AObject.ChildCount - 1 do + begin + if AParents[I] = AObject.Children[J].Name then + begin + AObject := AObject.Children[J]; + Break; + end; + end; + end; + + if AObject.Name = AObjectName then + Result := AObject + else + Result := nil; +end; + +{ TcxStreamWriter } + +constructor TcxStreamWriter.Create(const AStorageName: string; AReCreate: Boolean); +begin + inherited Create(AStorageName, AReCreate); + + FWriter := nil; + FRootObject := nil; + FCurrentObject := nil; +end; + +destructor TcxStreamWriter.Destroy; +begin + FWriter.Free; + FRootObject.Free; + inherited Destroy; +end; + +procedure TcxStreamWriter.BeginWriteObject(const AObjectName, AClassName: string); +var + AName: string; + AParents: TStringList; +begin + AParents := TStringList.Create; + try + ExtractObjectFullName(AObjectName, AParents, AName); + CreateObject(AName, AClassName, AParents); + finally + AParents.Free; + end; +end; + +procedure TcxStreamWriter.SetStream(AStream: TStream); +begin + FWriter.Free; + FWriter := TWriter.Create(AStream, cxBufferSize); +end; + +procedure TcxStreamWriter.Write; +begin + if FRootObject <> nil then + FRootObject.Write(FWriter); + FRootObject.Free; + FRootObject := nil; + FCurrentObject := nil; +end; + +procedure TcxStreamWriter.WriteProperty(const AObjectName, AClassName, AName: string; AValue: Variant); +begin + if FCurrentObject <> nil then + FCurrentObject.AddProperty(TcxStreamPropertyData.Create(AName, AValue)); +end; + +procedure TcxStreamWriter.CreateObject(const AObjectName, AClassName: string; AParents: TStrings); +var + I, J: Integer; + AObject: TcxStreamObjectData; + ANewObject: TcxStreamObjectData; +begin + if (FRootObject = nil) and (FCurrentObject = nil) then + begin + if AParents.Count = 0 then + begin + FRootObject := TcxStreamObjectData.Create(AObjectName, AClassName); + FCurrentObject := FRootObject; + end; + end + else + begin + AObject := FRootObject; + for I := 1 to AParents.Count - 1 do + begin + for J := 0 to AObject.ChildCount - 1 do + begin + if AParents[I] = AObject.Children[J].Name then + begin + AObject := AObject.Children[J]; + Break; + end; + end; + end; + ANewObject := TcxStreamObjectData.Create(AObjectName, AClassName); + FCurrentObject := ANewObject; + AObject.AddChild(ANewObject); + end; +end; + +{ TcxRegistryReader } + +constructor TcxRegistryReader.Create(const AStorageName: string); +begin + inherited Create(AStorageName); + + FRegistry := TRegistry.Create(KEY_READ); + if not FRegistry.OpenKey(GenRegistryPath(AStorageName), False) then + // raise ERegistryException.CreateFmt(cxGetResourceString(@scxCantOpenRegistryKey), [AStorageName]); + +end; + +destructor TcxRegistryReader.Destroy; +begin + FRegistry.Free; + + inherited Destroy; +end; + +procedure TcxRegistryReader.ReadChildren(const AObjectName, AClassName: string; + AChildrenNames, AChildrenClassNames: TStrings); +var + I: Integer; + APath: string; +begin + FRegistry.GetKeyNames(AChildrenNames); + for I := 0 to AChildrenNames.Count - 1 do + if AChildrenNames[I] = '[ClassName]' then + begin + AChildrenNames.Delete(I); + Break; + end; + + APath := FRegistry.CurrentPath; + for I := 0 to AChildrenNames.Count - 1 do + begin + FRegistry.OpenKey(AChildrenNames[I] + '\[ClassName]', False); + AChildrenClassNames.Add(FRegistry.ReadString('ClassName')); + FRegistry.CloseKey; + FRegistry.OpenKey(APath, False); + end; +end; + +procedure TcxRegistryReader.ReadProperties(const AObjectName, AClassName: string; AProperties: TStrings); +var + AName: string; + AParents: TStringList; + ANewPath: string; + I: Integer; +begin + AParents := TStringList.Create; + try + ExtractObjectFullName(AObjectName, AParents, AName); + ANewPath := GenRegistryPath(StorageName); + for I := 0 to AParents.Count - 1 do + ANewPath := ANewPath + '\' + AParents[I]; + if FRegistry.OpenKey(ANewPath + '\' + AName, False) then + FRegistry.GetValueNames(AProperties); + finally + AParents.Free; + end; +end; + +function TcxRegistryReader.ReadProperty(const AObjectName, AClassName, AName: string): Variant; +var + AValue: string; + ARealValue: Double; + ACode: Integer; +begin + case FRegistry.GetDataType(AName) of + rdString, rdExpandString: + begin + AValue := FRegistry.ReadString(AName); + + if IsStringValue(AValue) then + begin + Result := AValue; + Exit; + end; + + Val(AValue, ARealValue, ACode); + if ACode = 0 then + Result := ARealValue + else + Result := DateTimeOrStr(AValue); + end; + rdInteger: + Result := FRegistry.ReadInteger(AName); + rdBinary: + Result := FRegistry.ReadFloat(AName); + else + Result := Null; + end; +end; + +{ TcxRegistryWriter } + +constructor TcxRegistryWriter.Create(const AStorageName: string; AReCreate: Boolean); +begin + inherited Create(AStorageName, AReCreate); + + FRegistry := TRegistry.Create; + + if FReCreate then + begin + if AStorageName <> '' then + FRegistry.DeleteKey(GenRegistryPath(AStorageName)); + FRootKeyCreated := False; + end; + + FRootKeyCreated := FRegistry.KeyExists(GenRegistryPath(AStorageName)); + FRootKeyOpened := False; +end; + +destructor TcxRegistryWriter.Destroy; +begin + FRegistry.Free; + + inherited Destroy; +end; + +procedure TcxRegistryWriter.BeginWriteObject(const AObjectName, AClassName: string); +var + AParents: TStringList; + AName, APath: string; + AResult: Boolean; +begin + CreateRootKey; + AParents := TStringList.Create; + try + ExtractObjectFullName(AObjectName, AParents, AName); + AResult := FRegistry.CreateKey(AName) and FRegistry.OpenKey(AName, False); + APath := FRegistry.CurrentPath; + if AResult then + begin + AResult := FRegistry.CreateKey('[ClassName]') and FRegistry.OpenKey('[ClassName]', False); + if AResult then + begin + FRegistry.WriteString('ClassName', AClassName); + FRegistry.CloseKey; + end; + end; + AResult := AResult and FRegistry.OpenKey(APath, False); + if not AResult then + raise ERegistryException.CreateFmt(scxErrorStoreObject, [AObjectName]); + finally + AParents.Free; + end; +end; + +procedure TcxRegistryWriter.EndWriteObject(const AObjectName, AClassName: string); +var + AName: string; + AParents: TStringList; + ANewKey: string; + I: Integer; +begin + FRegistry.CloseKey; + + AParents := TStringList.Create; + try + ExtractObjectFullName(AObjectName, AParents, AName); + ANewKey := GenRegistryPath(FStorageName); + for I := 0 to AParents.Count - 1 do + ANewKey := ANewKey + '\' + AParents[I]; + FRegistry.OpenKey(ANewKey, False); + finally + AParents.Free; + end; +end; + +procedure TcxRegistryWriter.WriteProperty(const AObjectName, AClassName, AName: string; AValue: Variant); +begin + case VarType(AValue) of + // CLR: varDecimal TODO + {$IFDEF DELPHI6} + varInt64, varLongWord, varWord, varShortInt, + {$ENDIF} + varInteger, varSmallInt, varByte: + FRegistry.WriteInteger(AName, AValue); + varSingle, varDouble: + FRegistry.WriteFloat(AName, AValue); + varCurrency: + FRegistry.WriteCurrency(AName, AValue); + varString, varOleStr: + FRegistry.WriteString(AName, CorrectStringValue(AValue)); + varDate: + FRegistry.WriteDateTime(AName, AValue); + varBoolean: + FRegistry.WriteBool(AName, AValue); + end; +end; + +procedure TcxRegistryWriter.CreateRootKey; +begin + if not FRootKeyCreated then + begin + if not FRegistry.CreateKey(GenRegistryPath(FStorageName)) then + raise ERegistryException.CreateFmt(cxGetResourceString(@scxCantCreateRegistryKey), [FStorageName]); + FRootKeyCreated := True; + end; + + if not FRootKeyOpened then + begin + if not FRegistry.OpenKey(GenRegistryPath(FStorageName), False) then + raise ERegistryException.CreateFmt(cxGetResourceString(@scxCantOpenRegistryKey), [FStorageName]); + + FRootKeyOpened := True; + end; +end; + +{ TcxIniFileReader } + +constructor TcxIniFileReader.Create(const AStorageName: string); +//var +// AFileName: string; +begin + inherited Create(AStorageName); + +// AFileName := ChangeFileExt(AStorageName, '.ini'); + FIniFile := TMemIniFile.Create(AStorageName); + FPathList := nil; + FObjectNameList := nil; + FClassNameList := nil; +end; + +destructor TcxIniFileReader.Destroy; +begin + FIniFile.Free; + FPathList.Free; + FObjectNameList.Free; + FClassNameList.Free; + + inherited Destroy; +end; + +procedure TcxIniFileReader.ReadChildren(const AObjectName, AClassName: string; + AChildrenNames, AChildrenClassNames: TStrings); +var + I: Integer; + AParentPath: string; +begin + CreateLists; + + if AObjectName <> '' then + AParentPath := UpperCase(AObjectName) + '/' + else + AParentPath := UpperCase(AObjectName); + + for I := 0 to FPathList.Count - 1 do + begin + if FPathList[I] = AParentPath then + begin + AChildrenNames.Add(FObjectNameList[I]); + AChildrenClassNames.Add(FClassNameList[I]); + end; + end; +end; + +procedure TcxIniFileReader.ReadProperties(const AObjectName, AClassName: string; AProperties: TStrings); +var + ASectionName: string; +begin + ASectionName := AObjectName + ': ' + AClassName; + FIniFile.ReadSection(ASectionName, AProperties); +end; + +function TcxIniFileReader.ReadProperty(const AObjectName, AClassName, AName: string): Variant; +var + ASectionName: string; + AValue: string; + AIntegerValue: Integer; + ARealValue: Double; + ACode: Integer; +begin + ASectionName := AObjectName + ': ' + AClassName; + AValue := FIniFile.ReadString(ASectionName, AName, ''); + + if IsStringValue(AValue) then + begin + Result := AValue; + Exit; + end; + + Val(AValue, AIntegerValue, ACode); + if ACode = 0 then + Result := AIntegerValue + else + begin + Val(AValue, ARealValue, ACode); + if ACode = 0 then + Result := ARealValue + else + Result := DateTimeOrStr(AValue); + end; +end; + +procedure TcxIniFileReader.CreateLists; +var + ASectionList: TStringList; + I: Integer; + APath: string; + AObjectName: string; + AClassName: string; +begin + if (FPathList = nil) or (FObjectNameList = nil) or (FClassNameList = nil) then + begin + FPathList := TStringList.Create; + FObjectNameList := TStringList.Create; + FClassNameList := TStringList.Create; + ASectionList := TStringList.Create; + try + FIniFile.ReadSections(ASectionList); + for I := 0 to ASectionList.Count - 1 do + begin + GetSectionDetail(ASectionList[I], APath, AObjectName, AClassName); + FPathList.Add(UpperCase(APath)); + FObjectNameList.Add(AObjectName); + FClassNameList.Add(AClassName); + end; + finally + ASectionList.Free; + end; + end; +end; + +procedure TcxIniFileReader.GetSectionDetail(const ASection: string; var APath, AObjectName, AClassName: string); +var + I: Integer; + AName: string; +begin + AName := ''; + APath := ''; + AObjectName := ''; + AClassName := ''; + + for I := 1 to Length(ASection) do + if ASection[I] = '/' then + begin + APath := APath + AName + '/'; + AName := ''; + end + else + if ASection[I] = ':' then + begin + AObjectName := AName; + AName := ''; + end + else + AName := AName + ASection[I]; + AClassName := Trim(AName); +end; + +{ TcxIniFileWriter } + +constructor TcxIniFileWriter.Create(const AStorageName: string; AReCreate: Boolean); +//var +// AFileName: string; +begin + inherited Create(AStorageName, AReCreate); + +// AFileName := ChangeFileExt(AStorageName, '.ini'); + FIniFile := TMemIniFile.Create(AStorageName); + + if FReCreate then + FIniFile.Clear; + + {$IFDEF DELPHI6} + FIniFile.CaseSensitive := False; + {$ENDIF} +end; + +destructor TcxIniFileWriter.Destroy; +begin + FIniFile.UpdateFile; + FIniFile.Free; + + inherited Destroy; +end; + +procedure TcxIniFileWriter.BeginWriteObject(const AObjectName, AClassName: string); +begin + FIniFile.WriteString(AObjectName + ': ' + AClassName, '', ''); +end; + +procedure TcxIniFileWriter.WriteProperty(const AObjectName, AClassName, AName: string; + AValue: Variant); +var + ASectionName: string; +begin + ASectionName := AObjectName + ': ' + AClassName; + case VarType(AValue) of + // CLR: varDecimal TODO + varSmallInt, varInteger, varByte + {$IFDEF DELPHI6}, varShortInt, varWord, varLongWord, varInt64{$ENDIF} + : + FIniFile.WriteInteger(ASectionName, AName, AValue); + varSingle, varDouble, varCurrency: + FIniFile.WriteFloat(ASectionName, AName, AValue); + varString + , varOleStr: + FIniFile.WriteString(ASectionName, AName, CorrectStringValue(AValue)); + varDate + : + FIniFile.WriteDateTime(ASectionName, AName, AValue); + end; +end; + +{ TcxStreamPropertyData } + +constructor TcxStreamPropertyData.Create(AName: string; AValue: Variant); +begin + inherited Create; + FName := AName; + FValue := AValue; +end; + +procedure TcxStreamPropertyData.Read(AReader: TReader); +begin + with AReader do + FName := ReadString; + ReadValue(AReader); +end; + +procedure TcxStreamPropertyData.Write(AWriter: TWriter); +begin + with AWriter do + WriteString(FName); + WriteValue(AWriter); +end; + +procedure TcxStreamPropertyData.ReadValue(AReader: TReader); +var + AStreamType: Integer; +begin + AStreamType := AReader.ReadInteger; + case AStreamType of + cxStreamBoolean: + FValue := AReader.ReadBoolean; + cxStreamChar: + FValue := Byte(AReader.ReadChar); + cxStreamCurrency: + FValue := AReader.ReadCurrency; + cxStreamDate: + FValue := AReader.ReadDate; + cxStreamFloat: + FValue := AReader.ReadFloat; + cxStreamInteger: + FValue := AReader.ReadInteger; + cxStreamSingle: + FValue := AReader.ReadSingle; + cxStreamString: + FValue := AReader.ReadString; + cxStreamWideString: + FValue := AReader.ReadWideString; + end; +end; + +procedure TcxStreamPropertyData.WriteValue(AWriter: TWriter); +begin + // CLR: varChar, varDateTime, varDecimal TODO + case VarType(FValue) of + varSmallInt, varInteger + {$IFDEF DELPHI6}, varShortInt, varWord, varLongWord, varInt64{$ENDIF} + : + begin + AWriter.WriteInteger(cxStreamInteger); + AWriter.WriteInteger(FValue); + end; + varSingle: + begin + AWriter.WriteInteger(cxStreamSingle); + AWriter.WriteSingle(FValue); + end; + varDouble: + begin + AWriter.WriteInteger(cxStreamFloat); + AWriter.WriteFloat(FValue); + end; + varCurrency: + begin + AWriter.WriteInteger(cxStreamCurrency); + AWriter.WriteCurrency(FValue); + end; + varDate: + begin + AWriter.WriteInteger(cxStreamDate); + AWriter.WriteDate(FValue); + end; + varOleStr: + begin + AWriter.WriteInteger(cxStreamWideString); + AWriter.WriteWideString(FValue); + end; + varBoolean: + begin + AWriter.WriteInteger(cxStreamBoolean); + AWriter.WriteBoolean(FValue); + end; + varByte: + begin + AWriter.WriteInteger(cxStreamChar); + AWriter.WriteChar(Char(Byte(FValue))); + end; + varString: + begin + AWriter.WriteInteger(cxStreamString); + AWriter.WriteString(FValue); + end; + end; +end; + +{ TcxStreamObjectData } + +constructor TcxStreamObjectData.Create(const AName, AClassName: string); +begin + inherited Create; + FName := AName; + FClassName := AClassName; + FChildren := TList.Create; + FProperties := TList.Create; +end; + +destructor TcxStreamObjectData.Destroy; +begin + Clear; + FChildren.Free; + FProperties.Free; + + inherited Destroy; +end; + +procedure TcxStreamObjectData.Clear; +var + I: Integer; +begin + for I := 0 to FProperties.Count - 1 do + TcxStreamPropertyData(FProperties[I]).Free; + FProperties.Clear; + + for I := 0 to FChildren.Count - 1 do + TcxStreamObjectData(FChildren[I]).Free; + FChildren.Clear; +end; + +procedure TcxStreamObjectData.AddChild(AChild: TcxStreamObjectData); +begin + FChildren.Add(AChild); +end; + +procedure TcxStreamObjectData.AddProperty(AProperty: TcxStreamPropertyData); +begin + FProperties.Add(AProperty); +end; + +procedure TcxStreamObjectData.Read(AReader: TReader); +var + ACount: Integer; + I: Integer; +begin + with AReader do + begin + FName := ReadString; + FClassName := ReadString; + ACount := ReadInteger; + for I := 0 to ACount - 1 do + begin + AddProperty(TcxStreamPropertyData.Create('', Null)); + TcxStreamPropertyData(FProperties.Last).Read(AReader); + end; + ACount := ReadInteger; + for I := 0 to ACount - 1 do + begin + AddChild(TcxStreamObjectData.Create('', '')); + TcxStreamObjectData(FChildren.Last).Read(AReader); + end; + end; +end; + +procedure TcxStreamObjectData.Write(AWriter: TWriter); +var + I: Integer; +begin + with AWriter do + begin + WriteString(FName); + WriteString(FClassName); + WriteInteger(PropertyCount); + for I := 0 to PropertyCount - 1 do + Properties[I].Write(AWriter); + WriteInteger(ChildCount); + for I := 0 to ChildCount - 1 do + Children[I].Write(AWriter); + end; +end; + +function TcxStreamObjectData.GetChildCount: Integer; +begin + Result := FChildren.Count; +end; + +function TcxStreamObjectData.GetChildren(AIndex: Integer): TcxStreamObjectData; +begin + Result := TcxStreamObjectData(FChildren[AIndex]); +end; + +function TcxStreamObjectData.GetProperties(AIndex: Integer): TcxStreamPropertyData; +begin + Result := TcxStreamPropertyData(FProperties[AIndex]); +end; + +function TcxStreamObjectData.GetPropertyCount: Integer; +begin + Result := FProperties.Count; +end; + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxStyleRepositoryEditor.dfm b/official/x.35/ExpressLibrary/Sources/cxStyleRepositoryEditor.dfm new file mode 100644 index 00000000..febda142 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxStyleRepositoryEditor.dfm @@ -0,0 +1,232 @@ +inherited cxStyleRepositoryEditor: TcxStyleRepositoryEditor + Left = 333 + Top = 185 + Width = 317 + Height = 412 + Caption = 'StyleRepository editor' + Constraints.MinHeight = 350 + Constraints.MinWidth = 300 + Position = poDefaultPosOnly + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 0 + Top = 0 + Width = 309 + Height = 378 + ActivePage = tsStyles + Align = alClient + TabOrder = 0 + object tsStyles: TTabSheet + Caption = 'Styles' + object lbStyles: TListBox + Left = 0 + Top = 0 + Width = 210 + Height = 350 + Align = alClient + ItemHeight = 13 + MultiSelect = True + PopupMenu = pmStyles + TabOrder = 0 + OnClick = lbStylesClick + end + object pnlStyles: TPanel + Left = 210 + Top = 0 + Width = 91 + Height = 350 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object btStyleAdd: TButton + Left = 9 + Top = 8 + Width = 75 + Height = 25 + Caption = '&Add' + TabOrder = 0 + OnClick = btStyleAddClick + end + object btStyleDelete: TButton + Left = 9 + Top = 40 + Width = 75 + Height = 25 + Caption = '&Delete' + TabOrder = 1 + OnClick = btStyleDeleteClick + end + object btClose: TButton + Left = 9 + Top = 316 + Width = 75 + Height = 26 + Anchors = [akLeft, akBottom] + Caption = '&Close' + TabOrder = 2 + OnClick = btCloseClick + end + end + end + object tsStyleSheets: TTabSheet + Caption = 'Style Sheets' + ImageIndex = 1 + object lbStyleSheets: TListBox + Left = 0 + Top = 0 + Width = 201 + Height = 350 + Align = alClient + ItemHeight = 13 + MultiSelect = True + PopupMenu = pmStyleSheets + TabOrder = 0 + OnClick = lbStyleSheetsClick + end + object pnlStyleSheets: TPanel + Left = 201 + Top = 0 + Width = 100 + Height = 350 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object btStyleSheetAdd: TButton + Left = 9 + Top = 8 + Width = 85 + Height = 25 + Caption = '&Add...' + TabOrder = 0 + OnClick = btStyleSheetAddClick + end + object btStyleSheetDelete: TButton + Left = 9 + Top = 38 + Width = 85 + Height = 25 + Caption = '&Delete' + TabOrder = 1 + OnClick = btStyleSheetDeleteClick + end + object Button3: TButton + Left = 9 + Top = 316 + Width = 85 + Height = 26 + Anchors = [akLeft, akBottom] + Caption = '&Close' + TabOrder = 2 + OnClick = btCloseClick + end + object btnStyleSheetEdit: TButton + Left = 9 + Top = 68 + Width = 85 + Height = 25 + Caption = '&Edit...' + TabOrder = 3 + OnClick = btnStyleSheetEditClick + end + object btnStyleSheetsSave: TButton + Left = 9 + Top = 104 + Width = 85 + Height = 25 + Caption = '&Save to ini...' + TabOrder = 4 + OnClick = btnStyleSheetsSaveClick + end + object btnStyleSheetsLoad: TButton + Left = 9 + Top = 133 + Width = 85 + Height = 25 + Caption = '&Load from ini...' + TabOrder = 5 + OnClick = btnStyleSheetsLoadClick + end + object btnStyleSheetsPredefine: TButton + Left = 9 + Top = 163 + Width = 85 + Height = 25 + Caption = '&Predefined...' + TabOrder = 6 + OnClick = btnStyleSheetsPredefineClick + end + end + end + end + object pmStyles: TPopupMenu + Left = 40 + Top = 88 + object miStyleAdd: TMenuItem + Caption = 'Add' + ShortCut = 45 + OnClick = btStyleAddClick + end + object miStyleDelete: TMenuItem + Caption = 'Delete' + Enabled = False + ShortCut = 46 + OnClick = btStyleDeleteClick + end + object N1: TMenuItem + Caption = '-' + end + object miStyleSelectAll: TMenuItem + Caption = 'Select all' + Enabled = False + ShortCut = 16449 + OnClick = miStyleSelectAllClick + end + end + object pmStyleSheets: TPopupMenu + Left = 72 + Top = 168 + object miStyleSheetAdd: TMenuItem + Caption = 'Add...' + ShortCut = 45 + OnClick = btStyleSheetAddClick + end + object miStyleSheetDelete: TMenuItem + Caption = 'Delete' + Enabled = False + ShortCut = 46 + OnClick = btStyleSheetDeleteClick + end + object imStyleSheetEdit: TMenuItem + Caption = 'Edit...' + OnClick = btnStyleSheetEditClick + end + object MenuItem3: TMenuItem + Caption = '-' + end + object miStyleSheetSelectAll: TMenuItem + Caption = 'Select all' + Enabled = False + ShortCut = 16449 + OnClick = miStyleSheetSelectAllClick + end + end + object pmAddStyleSheet: TPopupMenu + Left = 128 + Top = 48 + end + object SaveDialog: TSaveDialog + DefaultExt = 'ini' + FileName = 'cxstyles.ini' + Filter = 'Ini files|*.ini' + Left = 160 + Top = 120 + end + object OpenDialog: TOpenDialog + DefaultExt = 'ini' + FileName = 'cxstyles.ini' + Filter = 'Ini files|*.ini' + Left = 160 + Top = 176 + end +end diff --git a/official/x.35/ExpressLibrary/Sources/cxStyleRepositoryEditor.pas b/official/x.35/ExpressLibrary/Sources/cxStyleRepositoryEditor.pas new file mode 100644 index 00000000..775acd98 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxStyleRepositoryEditor.pas @@ -0,0 +1,470 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxStyleRepositoryEditor; + +{$I cxVer.inc} + +interface + +uses + Windows, +{$IFDEF DELPHI6} + DesignIntf, + Variants, +{$ELSE} + DsgnIntf, +{$ENDIF} + SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, cxDesignWindows, StdCtrls, cxStyles, ExtCtrls, Menus, ComCtrls; + +type + TcxStyleRepositoryEditor = class(TcxDesignFormEditor) + lbStyles: TListBox; + btStyleAdd: TButton; + btStyleDelete: TButton; + btClose: TButton; + pnlStyles: TPanel; + pmStyles: TPopupMenu; + miStyleAdd: TMenuItem; + miStyleDelete: TMenuItem; + N1: TMenuItem; + miStyleSelectAll: TMenuItem; + PageControl1: TPageControl; + tsStyles: TTabSheet; + tsStyleSheets: TTabSheet; + lbStyleSheets: TListBox; + pnlStyleSheets: TPanel; + btStyleSheetAdd: TButton; + btStyleSheetDelete: TButton; + Button3: TButton; + pmStyleSheets: TPopupMenu; + miStyleSheetAdd: TMenuItem; + miStyleSheetDelete: TMenuItem; + MenuItem3: TMenuItem; + miStyleSheetSelectAll: TMenuItem; + btnStyleSheetEdit: TButton; + imStyleSheetEdit: TMenuItem; + pmAddStyleSheet: TPopupMenu; + btnStyleSheetsSave: TButton; + SaveDialog: TSaveDialog; + btnStyleSheetsLoad: TButton; + OpenDialog: TOpenDialog; + btnStyleSheetsPredefine: TButton; + procedure lbStylesClick(Sender: TObject); + procedure btStyleDeleteClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btStyleAddClick(Sender: TObject); + procedure miStyleSelectAllClick(Sender: TObject); + procedure btStyleSheetAddClick(Sender: TObject); + procedure btStyleSheetDeleteClick(Sender: TObject); + procedure miStyleSheetSelectAllClick(Sender: TObject); + procedure lbStyleSheetsClick(Sender: TObject); + procedure btnStyleSheetEditClick(Sender: TObject); + procedure btnStyleSheetsSaveClick(Sender: TObject); + procedure btnStyleSheetsLoadClick(Sender: TObject); + procedure btnStyleSheetsPredefineClick(Sender: TObject); + private + procedure AddStyleSheets(AList: TList); + function DoStyleGetName(AStyle: TcxStyle): string; + procedure DoAddStyleSheetMenuItemClick(Sender: TObject); + procedure InitAddStyleSheetMenu; + procedure ListBoxSelectComponents(AListBox: TListBox); + function GetStyleRepository: TcxStyleRepository; + procedure UpdateButtons; + procedure UpdateDesigner(Sender: TObject); + procedure UpdateItems; + procedure SelectItem(AListBox: TListBox; AItem: TPersistent); + function FindItemToSelect(AListBox: TListBox): TObject; + procedure DeleteSelectedComponents(AListBox: TListBox); + protected + procedure InitFormEditor; override; + public + procedure DoItemsModified; override; + procedure SelectionsChanged(const ASelection: TDesignerSelectionList); override; + property StyleRepository: TcxStyleRepository read GetStyleRepository; + end; + +procedure ShowStyleRepositoryEditor(ADesigner: IDesigner; + AStyleRepository: TcxStyleRepository); + +implementation + +{$R *.dfm} + +uses + cxStyleSheetEditor, cxStyleSheetsLoad; + +procedure ShowStyleRepositoryEditor(ADesigner: IDesigner; + AStyleRepository: TcxStyleRepository); +begin + ShowFormEditorClass(ADesigner, AStyleRepository, TcxStyleRepositoryEditor); +end; + +function TcxStyleRepositoryEditor.GetStyleRepository: TcxStyleRepository; +begin + Result := Component as TcxStyleRepository; +end; + +procedure TcxStyleRepositoryEditor.UpdateDesigner(Sender: TObject); +begin + Designer.Modified; +end; + +procedure TcxStyleRepositoryEditor.InitFormEditor; +begin + inherited InitFormEditor; + UpdateItems; + UpdateSelection; + UpdateButtons; + InitAddStyleSheetMenu; +end; + +procedure TcxStyleRepositoryEditor.DoItemsModified; +begin + UpdateItems; +end; + +procedure TcxStyleRepositoryEditor.AddStyleSheets(AList: TList); +var + I: Integer; +begin + for I := 0 to AList.Count - 1 do + begin + if TcxCustomStyleSheet(AList[I]).Name = '' then + TcxCustomStyleSheet(AList[I]).Name := + CreateUniqueName(Component.Owner, nil, TcxCustomStyleSheet(AList[I]), '', ''); + lbStyleSheets.Items.AddObject(TcxCustomStyleSheet(AList[I]).Name, + TcxCustomStyleSheet(AList[I])); + end; +end; + +function TcxStyleRepositoryEditor.DoStyleGetName(AStyle: TcxStyle): string; +begin + if AStyle.Name = '' then + Result := CreateUniqueName(Component.Owner, nil, AStyle, '', '') + else Result := AStyle.Name; + lbStyles.Items.AddObject(Result, AStyle); +end; + +procedure TcxStyleRepositoryEditor.DoAddStyleSheetMenuItemClick(Sender: TObject); +var + AItem: TcxCustomStyleSheet; + AList: TList; +begin + AList := TList.Create; + try + GetRegisteredStyleSheetClasses(AList); + AItem := StyleRepository.CreateStyleSheetEx( + TcxCustomStyleSheetClass(AList[TMenuItem(Sender).Tag]), StyleRepository.Owner); + finally + AList.Free; + end; + AItem.Name := CreateUniqueName(Component.Owner, nil, AItem, '', ''); + UpdateItems; + SelectItem(lbStyleSheets, AItem); + UpdateButtons; + UpdateDesigner(nil); +end; + +procedure TcxStyleRepositoryEditor.InitAddStyleSheetMenu; +var + AList: TList; + AMenuItem: TMenuItem; + I: Integer; +begin + AList := TList.Create; + try + GetRegisteredStyleSheetClasses(AList); + for I := 0 to AList.Count - 1 do + begin + AMenuItem := TMenuItem.Create(self); + pmAddStyleSheet.Items.Add(AMenuItem); + AMenuItem.Caption := TcxCustomStyleSheetClass(AList[I]).ClassName; + AMenuItem.Tag := I; + AMenuItem.OnClick := DoAddStyleSheetMenuItemClick; + end; + finally + AList.Free; + end; +end; + +procedure TcxStyleRepositoryEditor.ListBoxSelectComponents(AListBox: TListBox); +var + AList: TList; + I: Integer; +begin + AList := TList.Create; + try + for I := 0 to AListBox.Items.Count - 1 do + if AListBox.Selected[I] then + AList.Add(AListBox.Items.Objects[I]); + SelectComponents(AList, StyleRepository); + finally + AList.Free; + end; + UpdateButtons; +end; + +procedure TcxStyleRepositoryEditor.SelectItem(AListBox: TListBox; AItem: TPersistent); +begin + with AListBox do + ItemIndex := Items.IndexOfObject(AItem); + ListBoxClearSelection(AListBox); + if Component <> nil then + if AItem <> nil then + Designer.SelectComponent(AItem) + else + Designer.SelectComponent(Component); +end; + +procedure TcxStyleRepositoryEditor.UpdateButtons; +begin + btStyleDelete.Enabled := lbStyles.SelCount <> 0; + miStyleDelete.Enabled := btStyleDelete.Enabled; + miStyleSelectAll.Enabled := btStyleDelete.Enabled; + btStyleSheetDelete.Enabled := lbStyleSheets.SelCount <> 0; + miStyleSheetDelete.Enabled := btStyleSheetDelete.Enabled; + miStyleSheetSelectAll.Enabled := btStyleSheetDelete.Enabled; + btnStyleSheetsSave.Enabled := btStyleSheetDelete.Enabled; + btnStyleSheetEdit.Enabled := lbStyleSheets.SelCount = 1; + imStyleSheetEdit.Enabled := btnStyleSheetEdit.Enabled; +end; + +function TcxStyleRepositoryEditor.FindItemToSelect(AListBox: TListBox): TObject; +var + I: Integer; +begin + Result := nil; + with AListBox do + begin + if ItemIndex = -1 then Exit; + if not Selected[ItemIndex] then + Result := Items.Objects[ItemIndex] + else + begin + for I := ItemIndex + 1 to Items.Count - 1 do + if not Selected[I] then + begin + Result := Items.Objects[I]; + Exit + end; + for I := ItemIndex - 1 downto 0 do + if not Selected[I] then + begin + Result := Items.Objects[I]; + Exit + end; + end; + end; +end; + +procedure TcxStyleRepositoryEditor.UpdateItems; +var + I, AItemIndex, ATopIndex: Integer; + ASelection: TStringList; +begin + ListBoxSaveSelection(lbStyles, ASelection, AItemIndex, ATopIndex); + try + lbStyles.Items.Clear; + for I := 0 to StyleRepository.Count - 1 do + lbStyles.Items.AddObject(StyleRepository.Items[I].Name, StyleRepository.Items[I]); + finally + ListBoxRestoreSelection(lbStyles, ASelection, AItemIndex, ATopIndex); + end; + ListBoxSaveSelection(lbStyleSheets, ASelection, AItemIndex, ATopIndex); + try + lbStyleSheets.Items.Clear; + for I := 0 to StyleRepository. StyleSheetCount - 1 do + lbStyleSheets.Items.AddObject(StyleRepository.StyleSheets[I].Name, StyleRepository.StyleSheets[I]); + finally + ListBoxRestoreSelection(lbStyleSheets, ASelection, AItemIndex, ATopIndex); + end; +end; + +procedure TcxStyleRepositoryEditor.DeleteSelectedComponents(AListBox: TListBox); +var + I: Integer; + AItem: TPersistent; +begin + if AListBox.SelCount > 0 then + begin + AItem := FindItemToSelect(AListBox) as TPersistent; + for I := 0 to AListBox.Items.Count - 1 do + if AListBox.Selected[I] then + AListBox.Items.Objects[I].Free; + UpdateItems; + SelectItem(AListBox, AItem); + UpdateButtons; + UpdateDesigner(nil); + end; +end; + +procedure TcxStyleRepositoryEditor.lbStylesClick(Sender: TObject); +begin + ListBoxSelectComponents(lbStyles); +end; + +procedure TcxStyleRepositoryEditor.lbStyleSheetsClick(Sender: TObject); +begin + ListBoxSelectComponents(lbStyleSheets); +end; + +procedure TcxStyleRepositoryEditor.btStyleDeleteClick(Sender: TObject); +begin + DeleteSelectedComponents(lbStyles); +end; + +procedure TcxStyleRepositoryEditor.btStyleSheetDeleteClick( + Sender: TObject); +begin + DeleteSelectedComponents(lbStyleSheets); +end; + +procedure TcxStyleRepositoryEditor.SelectionsChanged(const ASelection: TDesignerSelectionList); +var + AList: TList; +begin + AList := TList.Create; + try + GetSelectionList(AList); + ListBoxSyncSelection(lbStyles, AList); + ListBoxSyncSelection(lbStyleSheets, AList); + finally + AList.Free; + end; + UpdateButtons; +end; + +procedure TcxStyleRepositoryEditor.btCloseClick(Sender: TObject); +begin + Close; +end; + +procedure TcxStyleRepositoryEditor.btStyleAddClick(Sender: TObject); +var + AItem: TcxCustomStyle; +begin + AItem := StyleRepository.CreateItemEx(TcxStyle, StyleRepository.Owner); + AItem.Name := CreateUniqueName(Component.Owner, nil, AItem, '', ''); + UpdateItems; + SelectItem(lbStyles, AItem); + UpdateButtons; + UpdateDesigner(nil); +end; + +procedure TcxStyleRepositoryEditor.btStyleSheetAddClick(Sender: TObject); +var + pt: TPoint; +begin + pt.X := btStyleAdd.Left; + pt.Y := btStyleAdd.Top + btStyleAdd.Height; + pt := btStyleAdd.Parent.ClientToScreen(pt); + pmAddStyleSheet.Popup(pt.X, pt.Y); +end; + +procedure TcxStyleRepositoryEditor.miStyleSelectAllClick(Sender: TObject); +begin + ListBoxSelectAll(lbStyles); + lbStylesClick(nil); +end; + +procedure TcxStyleRepositoryEditor.miStyleSheetSelectAllClick(Sender: TObject); +begin + ListBoxSelectAll(lbStyleSheets); + lbStyleSheetsClick(nil); +end; + +procedure TcxStyleRepositoryEditor.btnStyleSheetEditClick(Sender: TObject); +begin + if ShowcxStyleSheetEditor(TcxCustomStyleSheet( + lbStyleSheets.Items.Objects[lbStyleSheets.ItemIndex]), DoStyleGetName) then + Designer.Modified; +end; + +procedure TcxStyleRepositoryEditor.btnStyleSheetsSaveClick( + Sender: TObject); +var + I: Integer; + AList: TList; +begin + if SaveDialog.Execute then + begin + AList := TList.Create; + try + for I := 0 to lbStyleSheets.Items.Count - 1 do + if lbStyleSheets.Selected[I] then + AList.Add(TcxCustomStyleSheet(lbStyleSheets.Items.Objects[I])); + SaveStyleSheetsToIniFile(SaveDialog.FileName, AList); + finally + AList.Free; + end; + end; + +end; + +procedure TcxStyleRepositoryEditor.btnStyleSheetsLoadClick( + Sender: TObject); +var + AStyleSheetList: TList; +begin + if not OpenDialog.Execute then exit; + AStyleSheetList := TList.Create; + try + ShowLoadStyleSheetsFromIniFile(OpenDialog.FileName, StyleRepository, + Component.Owner, AStyleSheetList, DoStyleGetName); + AddStyleSheets(AStyleSheetList); + finally + AStyleSheetList.Free; + end; +end; + +procedure TcxStyleRepositoryEditor.btnStyleSheetsPredefineClick( + Sender: TObject); +var + AStyleSheetList: TList; +begin + AStyleSheetList := TList.Create; + try + ShowLoadStyleSheetsFromPreDefineStyles(StyleRepository, Component.Owner, + AStyleSheetList, DoStyleGetName); + AddStyleSheets(AStyleSheetList); + finally + AStyleSheetList.Free; + end; +end; + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxStyleSheetEditor.dfm b/official/x.35/ExpressLibrary/Sources/cxStyleSheetEditor.dfm new file mode 100644 index 00000000..1f5674cf --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxStyleSheetEditor.dfm @@ -0,0 +1,223 @@ +object frmcxStyleSheetEditor: TfrmcxStyleSheetEditor + Left = 377 + Top = 147 + AutoScroll = False + BorderIcons = [biSystemMenu] + Caption = 'StyleSheet Editor' + ClientHeight = 338 + ClientWidth = 319 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -10 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object pnlBottom: TPanel + Left = 0 + Top = 303 + Width = 319 + Height = 35 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + object Bevel: TBevel + Left = 0 + Top = 0 + Width = 319 + Height = 2 + Align = alTop + end + object pnlButtons: TPanel + Left = 150 + Top = 2 + Width = 169 + Height = 33 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btnOK: TButton + Left = 7 + Top = 4 + Width = 75 + Height = 25 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object bntCancel: TButton + Left = 88 + Top = 4 + Width = 75 + Height = 25 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + end + end + object pnlClient: TPanel + Left = 0 + Top = 0 + Width = 319 + Height = 303 + Align = alClient + BevelOuter = bvNone + BorderWidth = 4 + TabOrder = 1 + object pnlStyles: TPanel + Left = 4 + Top = 4 + Width = 163 + Height = 295 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object pnlStylesCaption: TPanel + Left = 0 + Top = 0 + Width = 163 + Height = 21 + Align = alTop + Alignment = taLeftJustify + BevelOuter = bvNone + Caption = 'Styles' + TabOrder = 0 + end + object pnlStylesClient: TPanel + Left = 0 + Top = 21 + Width = 163 + Height = 274 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + object lbStyles: TListBox + Left = 0 + Top = 0 + Width = 163 + Height = 186 + Style = lbOwnerDrawVariable + Align = alClient + ItemHeight = 16 + MultiSelect = True + TabOrder = 0 + OnClick = lbStylesClick + OnDrawItem = lbStylesDrawItem + OnMeasureItem = lbStylesMeasureItem + end + object pnlStylesButtons: TPanel + Left = 0 + Top = 186 + Width = 163 + Height = 88 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object cbColor: TCheckBox + Left = 35 + Top = 33 + Width = 119 + Height = 25 + Caption = '&Color' + TabOrder = 0 + OnClick = cbClick + end + object btnBitmap: TButton + Left = 2 + Top = 4 + Width = 25 + Height = 25 + Caption = '...' + TabOrder = 1 + OnClick = btnBitmapClick + end + object btnColor1: TButton + Left = 2 + Top = 33 + Width = 25 + Height = 25 + Caption = '...' + TabOrder = 2 + OnClick = btnColor1Click + end + object btnFont1: TButton + Left = 2 + Top = 62 + Width = 25 + Height = 25 + Caption = '...' + TabOrder = 3 + OnClick = btnFont1Click + end + object cbFont: TCheckBox + Left = 35 + Top = 62 + Width = 119 + Height = 25 + Caption = '&Font' + TabOrder = 4 + OnClick = cbClick + end + object cbBitmap: TCheckBox + Left = 35 + Top = 4 + Width = 117 + Height = 25 + Caption = '&Bitmap' + TabOrder = 5 + OnClick = cbClick + end + end + end + end + object pnlPreview: TPanel + Left = 171 + Top = 4 + Width = 144 + Height = 295 + Align = alRight + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + TabOrder = 1 + object pnlPreviewCaption: TPanel + Left = 0 + Top = 0 + Width = 144 + Height = 21 + Align = alTop + Alignment = taLeftJustify + BevelOuter = bvNone + Caption = 'Preview' + TabOrder = 0 + end + object pnlPreviewClient: TPanel + Left = 0 + Top = 21 + Width = 144 + Height = 274 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + end + end + end + object FontDialog: TFontDialog + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Left = 76 + Top = 28 + end + object ColorDialog: TColorDialog + Left = 44 + Top = 28 + end +end diff --git a/official/x.35/ExpressLibrary/Sources/cxStyleSheetEditor.pas b/official/x.35/ExpressLibrary/Sources/cxStyleSheetEditor.pas new file mode 100644 index 00000000..d5b561ff --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxStyleSheetEditor.pas @@ -0,0 +1,533 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxStyleSheetEditor; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Messages, ExtDlgs, + SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, + cxClasses, cxGraphics, cxStyles; + +type + TcxStyleSheetEditorPreview = class + public + constructor Create(AOwner: TComponent); virtual; + function Control: TWinControl; virtual; abstract; + function GetSize: TPoint; virtual; + class function GetStyleSheetClass: TcxCustomStyleSheetClass; virtual; + procedure SetStyleSheet(AStyleSheet: TcxCustomStyleSheet); virtual; abstract; + end; + + TcxStyleSheetEditorPreviewClass = class of TcxStyleSheetEditorPreview; + + TfrmcxStyleSheetEditor = class(TForm) + pnlBottom: TPanel; + pnlButtons: TPanel; + btnOK: TButton; + bntCancel: TButton; + FontDialog: TFontDialog; + ColorDialog: TColorDialog; + pnlClient: TPanel; + Bevel: TBevel; + pnlStyles: TPanel; + pnlStylesCaption: TPanel; + pnlStylesButtons: TPanel; + pnlStylesClient: TPanel; + lbStyles: TListBox; + pnlPreview: TPanel; + pnlPreviewCaption: TPanel; + pnlPreviewClient: TPanel; + cbColor: TCheckBox; + btnBitmap: TButton; + btnColor1: TButton; + btnFont1: TButton; + cbFont: TCheckBox; + cbBitmap: TCheckBox; + procedure lbStylesClick(Sender: TObject); + procedure lbStylesMeasureItem(Control: TWinControl; Index: Integer; + var Height: Integer); + procedure lbStylesDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; + State: TOwnerDrawState); + procedure cbClick(Sender: TObject); + procedure btnColor1Click(Sender: TObject); + procedure btnFont1Click(Sender: TObject); + procedure btnBitmapClick(Sender: TObject); + private + FCanvas: TcxCanvas; + FPreview: TcxStyleSheetEditorPreview; + FStateUpdating: Boolean; + FStyleList: TList; + FStyleSheet: TcxCustomStyleSheet; + function GetCheckBoxStyleValue(ACheckBox: TCheckBox): TcxStyleValue; + function GetFirstSelectedStyle: TcxStyle; + procedure RecreateListBox(AListBox: TListBox); + procedure SetSelectedStylesAssignValue(ACheckBox: TCheckBox); + procedure SetStyles(AStyleSheet: TcxCustomStyleSheet); + procedure UpdateStyles(AStyleSheet: TcxCustomStyleSheet; AGetStyleName: TcxStyleGetName); + procedure UpdateState; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + end; + +function ShowcxStyleSheetEditor(AStyleSheet: TcxCustomStyleSheet; AGetStyleName: TcxStyleGetName): Boolean; + +procedure RegisterStyleSheetEditorPreview(APreviewClass: TcxStyleSheetEditorPreviewClass); +procedure UnregisterStyleSheetEditorPreview(APreviewClass: TcxStyleSheetEditorPreviewClass); +function GetPreviewByStyleSheetClass(AStyleSheetClass: TcxCustomStyleSheetClass): TcxStyleSheetEditorPreviewClass; + +implementation + +{$R *.dfm} + +uses + TypInfo, cxControls; + +function VerifyBitmap(ABitmap: TBitmap): Boolean; +begin + Result := (ABitmap.Width > 0) and (ABitmap.Height > 0); +end; + +{ TcxStyleSheetEditorPreview } + +constructor TcxStyleSheetEditorPreview.Create(AOwner: TComponent); +begin + inherited Create; +end; + +function TcxStyleSheetEditorPreview.GetSize: TPoint; +begin + Result.X := 350; + Result.Y := 250; +end; + +class function TcxStyleSheetEditorPreview.GetStyleSheetClass: TcxCustomStyleSheetClass; +begin + Result := nil; +end; + +function ShowcxStyleSheetEditor(AStyleSheet: TcxCustomStyleSheet; + AGetStyleName: TcxStyleGetName): Boolean; +var + AForm: TfrmcxStyleSheetEditor; +begin + AForm := TfrmcxStyleSheetEditor.Create(nil); + try + AForm.SetStyles(AStyleSheet); + AForm.UpdateState; + AForm.ShowModal; + Result := AForm.ModalResult = mrOK; + if Result then + AForm.UpdateStyles(AStyleSheet, AGetStyleName); + finally + AForm.Free; + end; +end; + +{ TfrmcxStyleSheetEditor } + +constructor TfrmcxStyleSheetEditor.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FStyleList := TList.Create; + FCanvas := TcxCanvas.Create(nil); +end; + +destructor TfrmcxStyleSheetEditor.Destroy; +begin + FreeAndNil(FCanvas); + FStyleList.Free; + FStyleSheet.Free; + FPreview.Free; + inherited Destroy; +end; + +function TfrmcxStyleSheetEditor.GetCheckBoxStyleValue(ACheckBox: TCheckBox): TcxStyleValue; +begin + if ACheckBox = cbBitmap then + Result := svBitmap + else + if ACheckBox = cbColor then + Result := svColor + else + Result := svFont; +end; + +function TfrmcxStyleSheetEditor.GetFirstSelectedStyle: TcxStyle; +var + I: Integer; +begin + Result := nil; + for I := 0 to lbStyles.Items.Count - 1 do + if lbStyles.Selected[I] then + begin + Result := TcxStyle(FStyleList[I]); + Break; + end; +end; + +procedure TfrmcxStyleSheetEditor.RecreateListBox(AListBox: TListBox); +var + I: Integer; + ASelected: TList; +begin + ASelected := TList.Create; + try + for I := 0 to AListBox.Items.Count - 1 do + if AListBox.Selected[I] then + ASelected.Add(Pointer(I)); + RecreateControlWnd(AListBox); + for I := 0 to ASelected.Count - 1 do + AListBox.Selected[Integer((ASelected[I]))] := True; + finally + ASelected.Free; + end; +end; + +procedure TfrmcxStyleSheetEditor.SetSelectedStylesAssignValue(ACheckBox: TCheckBox); + + function cxStyleValueTocxStyleValues(AStyleValue: TcxStyleValue): TcxStyleValues; + begin + case AStyleValue of + svBitmap: + Result := [svBitmap]; + svColor: + Result := [svColor]; + svFont: + Result := [svFont, svTextColor]; + else + Result := []; + end; + end; + +var + AStyleValues: TcxStyleValues; + I: Integer; +begin + AStyleValues := cxStyleValueTocxStyleValues(GetCheckBoxStyleValue(ACheckBox)); + for I := 0 to lbStyles.Items.Count - 1 do + if lbStyles.Selected[I] then + with TcxStyle(FStyleList[I]) do + if ACheckBox.Checked then + begin + if (ACheckBox = cbBitmap) and not VerifyBitmap(Bitmap) then + Continue; + AssignedValues := AssignedValues + AStyleValues + end + else + AssignedValues := AssignedValues - AStyleValues; +end; + +procedure TfrmcxStyleSheetEditor.SetStyles(AStyleSheet: TcxCustomStyleSheet); +var + I, ACount: Integer; + APropList: TPropList; + AStyle, ACacheStyle: TcxStyle; +begin + FStyleSheet := TcxCustomStyleSheetClass(AStyleSheet.ClassType).Create(nil); + ACount := GetPropList(FStyleSheet.GetStyles.ClassInfo, [tkClass], @APropList); + try + lbStyles.Items.BeginUpdate; + for I := 0 to ACount - 1 do + if GetTypeData(APropList[I].PropType^).ClassType = TcxStyle then + begin + AStyle := TcxStyle(GetObjectProp(AStyleSheet.GetStyles, APropList[I].Name)); + ACacheStyle := TcxStyle.Create(Self); + if AStyle <> nil then + ACacheStyle.Assign(AStyle); + SetObjectProp(FStyleSheet.GetStyles, APropList[I], ACacheStyle); + FStyleList.Add(ACacheStyle); + lbStyles.Items.Add(APropList[I].Name); + end; + finally + lbStyles.Items.EndUpdate; + end; + if GetPreviewByStyleSheetClass(TcxCustomStyleSheetClass(FStyleSheet.ClassType)) <> nil then + begin + FPreview := GetPreviewByStyleSheetClass(TcxCustomStyleSheetClass(FStyleSheet.ClassType)).Create(self); + FPreview.Control.Parent := pnlPreviewClient; + FPreview.Control.Align := alClient; + FPreview.SetStyleSheet(FStyleSheet); + Width := pnlStyles.Width + lbStyles.Left * 2 + FPreview.GetSize.X; + if pnlPreviewClient.Height < FPreview.GetSize.Y then + Height := Height + FPreview.GetSize.Y - pnlPreviewClient.Height; + end else + begin + pnlPreview.Visible := False; + Width := pnlStyles.Width + lbStyles.Left * 2; + FPreview := nil; + end; +end; + +procedure TfrmcxStyleSheetEditor.UpdateStyles(AStyleSheet: TcxCustomStyleSheet; + AGetStyleName: TcxStyleGetName); +begin + CreateStyleSheetStyles(AStyleSheet, FStyleSheet, AGetStyleName) +end; + +procedure TfrmcxStyleSheetEditor.UpdateState; + + procedure UpdateCheckBox(ACheckBox: TCheckBox; AStyleValue: TcxStyleValue); + + function SelectedStylesHaveSameAssignedValue: Boolean; + var + AIsStyleValueAssigned: Boolean; + I: Integer; + begin + AIsStyleValueAssigned := AStyleValue in GetFirstSelectedStyle.AssignedValues; + Result := True; + for I := 0 to lbStyles.Items.Count - 1 do + if lbStyles.Selected[I] and ((AStyleValue in TcxStyle(FStyleList[I]).AssignedValues) <> AIsStyleValueAssigned) then + begin + Result := False; + Break; + end; + end; + + function GetCheckBoxState: TCheckBoxState; + const + ACheckBoxStateMap: array [Boolean] of TCheckBoxState = (cbUnchecked, cbChecked); + begin + Result := cbUnchecked; + if ACheckBox.Enabled then + if SelectedStylesHaveSameAssignedValue then + Result := ACheckBoxStateMap[AStyleValue in GetFirstSelectedStyle.AssignedValues] + else + Result := cbGrayed + end; + + begin + ACheckBox.Enabled := lbStyles.SelCount > 0; + ACheckBox.State := GetCheckBoxState; + end; + +begin + FStateUpdating := True; + try + btnBitmap.Enabled := lbStyles.SelCount > 0; + btnColor1.Enabled := btnBitmap.Enabled; + btnFont1.Enabled := btnBitmap.Enabled; + + UpdateCheckBox(cbBitmap, svBitmap); + UpdateCheckBox(cbColor, svColor); + UpdateCheckBox(cbFont, svFont); + finally + FStateUpdating := False; + end; +end; + +procedure TfrmcxStyleSheetEditor.lbStylesClick(Sender: TObject); +begin + UpdateState; +end; + +procedure TfrmcxStyleSheetEditor.lbStylesMeasureItem(Control: TWinControl; + Index: Integer; var Height: Integer); +var + AcxCanvas: TcxCanvas; +begin + if Index >= FStyleList.Count then exit; + if (svFont in TcxStyle(FStyleList[Index]).AssignedValues) then + begin + AcxCanvas := TcxCanvas.Create(lbStyles.Canvas); + try + AcxCanvas.Font.Assign(TcxStyle(FStyleList[Index]).Font); + Height := AcxCanvas.TextHeight(lbStyles.Items[Index]) + 2; + finally + AcxCanvas.Free; + end; + end; +end; + +procedure TfrmcxStyleSheetEditor.lbStylesDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +var + AFlags: Longint; + ASelected: Boolean; + AStyle: TcxStyle; + AText: string; + APrevTextColor: TColor; +begin + ASelected := odSelected in State; + AStyle := TcxStyle(FStyleList[Index]); + + if not ASelected and (svColor in AStyle.AssignedValues) then + lbStyles.Canvas.Brush.Color := AStyle.Color; + if not ASelected and (svBitmap in AStyle.AssignedValues) then + begin + FCanvas.Canvas := lbStyles.Canvas; + FCanvas.FillRect(Rect, AStyle.Bitmap); + end + else + lbStyles.Canvas.FillRect(Rect); + + AFlags := DrawTextBiDiModeFlags(DT_SINGLELINE or DT_VCENTER or DT_NOPREFIX); + Inc(Rect.Left, 2); + AText := lbStyles.Items[Index]; + if (svFont in AStyle.AssignedValues) then + begin + APrevTextColor := lbStyles.Canvas.Font.Color; + lbStyles.Canvas.Font.Assign(AStyle.Font); + lbStyles.Canvas.Font.Color := APrevTextColor; + end; + if (svTextColor in AStyle.AssignedValues) and not ASelected then + lbStyles.Canvas.Font.Color := AStyle.TextColor; + lbStyles.Canvas.Brush.Style := bsClear; + DrawText(lbStyles.Canvas.Handle, PChar(AText), Length(AText), Rect, AFlags); + lbStyles.Canvas.Brush.Style := bsSolid; +end; + +var + FStyleSheetPreviews: TList = nil; + +procedure RegisterStyleSheetEditorPreview(APreviewClass: TcxStyleSheetEditorPreviewClass); +begin + if FStyleSheetPreviews = nil then + FStyleSheetPreviews := TList.Create; + if FStyleSheetPreviews.IndexOf(TObject(APreviewClass)) < 0 then + FStyleSheetPreviews.Add(TObject(APreviewClass)); +end; + +procedure UnregisterStyleSheetEditorPreview(APreviewClass: TcxStyleSheetEditorPreviewClass); +begin + if FStyleSheetPreviews <> nil then + FStyleSheetPreviews.Remove(TObject(APreviewClass)); +end; + +function GetPreviewByStyleSheetClass(AStyleSheetClass: TcxCustomStyleSheetClass): TcxStyleSheetEditorPreviewClass; +var + I: Integer; +begin + Result := nil; + if FStyleSheetPreviews <> nil then + for I := 0 to FStyleSheetPreviews.Count - 1 do + if (TcxStyleSheetEditorPreviewClass(FStyleSheetPreviews[I]).GetStyleSheetClass = AStyleSheetClass) then + begin + Result := TcxStyleSheetEditorPreviewClass(FStyleSheetPreviews[I]); + Break; + end; +end; + +procedure TfrmcxStyleSheetEditor.cbClick(Sender: TObject); +begin + if not FStateUpdating then + try + SetSelectedStylesAssignValue(TCheckBox(Sender)); + finally + if Sender = cbFont then + RecreateListBox(lbStyles) + else + lbStyles.Invalidate; + UpdateState; + end; +end; + +procedure TfrmcxStyleSheetEditor.btnColor1Click(Sender: TObject); +var + I: Integer; +begin + ColorDialog.Color := TcxStyle(FStyleList[lbStyles.ItemIndex]).Color; + if ColorDialog.Execute then + try + for I := 0 to lbStyles.Items.Count - 1 do + if lbStyles.Selected[I] then + TcxStyle(FStyleList[I]).Color := ColorDialog.Color; + finally + lbStyles.Invalidate; + UpdateState; + end; +end; + +procedure TfrmcxStyleSheetEditor.btnFont1Click(Sender: TObject); +var + I: Integer; +begin + FontDialog.Font.Assign(TcxStyle(FStyleList[lbStyles.ItemIndex]).Font); + FontDialog.Font.Color := TcxStyle(FStyleList[lbStyles.ItemIndex]).TextColor; + if FontDialog.Execute then + try + for I := 0 to lbStyles.Items.Count - 1 do + if lbStyles.Selected[I] then + begin + TcxStyle(FStyleList[I]).Font.Assign(FontDialog.Font); + TcxStyle(FStyleList[I]).TextColor := FontDialog.Font.Color; + end; + finally + RecreateListBox(lbStyles); + UpdateState; + end; +end; + +procedure TfrmcxStyleSheetEditor.btnBitmapClick(Sender: TObject); +var + I: Integer; + AOpenPictureDialog: TOpenPictureDialog; +begin + AOpenPictureDialog := TOpenPictureDialog.Create(nil); + try + with AOpenPictureDialog do + begin + Filter := 'Bitmaps (*.bmp)|*.bmp'; + Options := [{$IFDEF DELPHI7}ofHideReadOnly, {$ENDIF}ofFileMustExist, ofEnableSizing]; + FileName := ''; + end; + if AOpenPictureDialog.Execute then + try + for I := 0 to lbStyles.Items.Count - 1 do + if lbStyles.Selected[I] then + TcxStyle(FStyleList[I]).Bitmap.LoadFromFile(AOpenPictureDialog.FileName); + finally + lbStyles.Invalidate; + UpdateState; + end; + finally + AOpenPictureDialog.Free; + end; +end; + +initialization + +finalization + FStyleSheetPreviews.Free; + FStyleSheetPreviews := nil; +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxStyleSheetsLoad.dfm b/official/x.35/ExpressLibrary/Sources/cxStyleSheetsLoad.dfm new file mode 100644 index 00000000..ca5b3676 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxStyleSheetsLoad.dfm @@ -0,0 +1,172 @@ +object frmcxStyleSheetsLoad: TfrmcxStyleSheetsLoad + Left = 303 + Top = 129 + AutoScroll = False + BorderIcons = [biSystemMenu] + Caption = 'Predefined StyleSheets' + ClientHeight = 329 + ClientWidth = 659 + Color = clBtnFace + Constraints.MinHeight = 296 + Constraints.MinWidth = 315 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -10 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object pnlBottom: TPanel + Left = 0 + Top = 294 + Width = 659 + Height = 35 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + object Bevel: TBevel + Left = 0 + Top = 0 + Width = 659 + Height = 2 + Align = alTop + end + object btnLoad: TButton + Left = 497 + Top = 8 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Caption = 'Load' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object btnClose: TButton + Left = 580 + Top = 8 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Close' + ModalResult = 2 + TabOrder = 1 + end + end + object pnlClient: TPanel + Left = 0 + Top = 0 + Width = 659 + Height = 294 + Align = alClient + BevelOuter = bvNone + BorderWidth = 5 + TabOrder = 1 + object pnlStyles: TPanel + Left = 5 + Top = 5 + Width = 297 + Height = 284 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object pnlStyleSheetClasses: TPanel + Left = 0 + Top = 0 + Width = 297 + Height = 25 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object lbStyleSheetClass: TLabel + Left = 3 + Top = 1 + Width = 94 + Height = 18 + AutoSize = False + Caption = 'Style Sheet Class:' + Layout = tlCenter + end + object cbStyleSheetClasses: TComboBox + Left = 96 + Top = 0 + Width = 201 + Height = 21 + Style = csDropDownList + Anchors = [akTop, akRight] + DropDownCount = 10 + ItemHeight = 13 + TabOrder = 0 + end + end + object lbStyleSheets: TListBox + Left = 0 + Top = 25 + Width = 297 + Height = 259 + Align = alClient + ItemHeight = 13 + MultiSelect = True + TabOrder = 1 + end + end + object pnlPreview: TPanel + Left = 302 + Top = 5 + Width = 352 + Height = 284 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 5 + Height = 284 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + end + object Panel1: TPanel + Left = 5 + Top = 0 + Width = 347 + Height = 284 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + object Panel3: TPanel + Left = 0 + Top = 0 + Width = 347 + Height = 25 + Align = alTop + Alignment = taLeftJustify + BevelOuter = bvNone + TabOrder = 0 + object lbPreview: TLabel + Left = 0 + Top = 0 + Width = 61 + Height = 21 + AutoSize = False + Caption = 'Preview' + Layout = tlCenter + end + end + object pnlPreviewClient: TPanel + Left = 0 + Top = 25 + Width = 347 + Height = 259 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + end + end + end + end +end diff --git a/official/x.35/ExpressLibrary/Sources/cxStyleSheetsLoad.pas b/official/x.35/ExpressLibrary/Sources/cxStyleSheetsLoad.pas new file mode 100644 index 00000000..09f81a00 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxStyleSheetsLoad.pas @@ -0,0 +1,470 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxStyleSheetsLoad; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + cxClasses, cxStyles, ExtCtrls, cxStyleSheetEditor; + +type + TcxPredefinedStyleSheetsClass = class of TcxPredefinedStyleSheets; + + TcxPredefinedStyleSheets = class + private + FList: TList; + protected + procedure AddStyleSheet(AStyleSheet: TcxCustomStyleSheet); + procedure AddStyleSheets; virtual; abstract; + public + constructor Create; virtual; + destructor Destroy; override; + procedure GetStyleSheetsByClass(AStyleSheetClass: TcxCustomStyleSheetClass; const AList: TList); + end; + + TcxPredefinedStyleSheetsList = class + private + FList: TList; + FStyleSheetClassComboBox: TComboBox; + FStyleSheetsListBox: TListBox; + FLoadButton: TButton; + FPreview: TcxStyleSheetEditorPreview; + procedure StyleSheetClassComboBoxClick(Sender: TObject); + procedure StyleSheetsListBoxClick(Sender: TObject); + protected + procedure FreeAndNilItems; + procedure UpdateButton; + public + constructor Create(AStyleSheetClassComboBox: TComboBox; AStyleSheetsListBox: TListBox; + ALoadButton: TButton); + destructor Destroy; override; + function CurrentStyleSheet: TcxCustomStyleSheet; + function CurrentStyleSheetClass: TcxCustomStyleSheetClass; + procedure FillListBox; + end; + + TfrmcxStyleSheetsLoad = class(TForm) + pnlBottom: TPanel; + Bevel: TBevel; + pnlStyles: TPanel; + pnlStyleSheetClasses: TPanel; + lbStyleSheetClass: TLabel; + cbStyleSheetClasses: TComboBox; + lbStyleSheets: TListBox; + pnlPreview: TPanel; + pnlClient: TPanel; + btnLoad: TButton; + btnClose: TButton; + Panel2: TPanel; + Panel1: TPanel; + Panel3: TPanel; + lbPreview: TLabel; + pnlPreviewClient: TPanel; + procedure FormCreate(Sender: TObject); + public + constructor Create(AOwner: TComponent); override; + function CurrentStyleSheetClass: TcxCustomStyleSheetClass; + procedure SetShowPreview(Value: Boolean); + end; + +procedure RegisterPredefinedStyleSheets(APredefinedStyleSheetsClass: TcxPredefinedStyleSheetsClass); +procedure UnregisterPredefinedStyleSheets(APredefinedStyleSheetsClass: TcxPredefinedStyleSheetsClass); +procedure GetPredefinedStyleSheetClasses(AList: TList); + +procedure ShowLoadStyleSheetsFromIniFile(const AIniFileName: string; + AStyleRepository: TcxStyleRepository; AOwner: TComponent; const AStyleSheetList: TList; + AStyleGetName: TcxStyleGetName); + +procedure ShowLoadStyleSheetsFromPreDefineStyles(AStyleRepository: TcxStyleRepository; + AOwner: TComponent; const AStyleSheetList: TList; AStyleGetName: TcxStyleGetName); + +implementation + +{$R *.dfm} + +uses + IniFiles; + +var + FPredefinedStyleSheetsList: TList = nil; + +procedure RegisterPredefinedStyleSheets(APredefinedStyleSheetsClass: TcxPredefinedStyleSheetsClass); +begin + if FPredefinedStyleSheetsList = nil then + FPredefinedStyleSheetsList := TList.Create; + if FPredefinedStyleSheetsList.IndexOf(TObject(APredefinedStyleSheetsClass)) = -1 then + FPredefinedStyleSheetsList.Add(TObject(APredefinedStyleSheetsClass)); +end; + +procedure UnregisterPredefinedStyleSheets(APredefinedStyleSheetsClass: TcxPredefinedStyleSheetsClass); +begin + if FPredefinedStyleSheetsList <> nil then + begin + FPredefinedStyleSheetsList.Remove(TObject(APredefinedStyleSheetsClass)); + if FPredefinedStyleSheetsList.Count = 0 then + FreeAndNil(FPredefinedStyleSheetsList); + end; +end; + +procedure GetPredefinedStyleSheetClasses(AList: TList); +begin + CopyList(FPredefinedStyleSheetsList, AList); +end; + +{ TcxPredefinedStyleSheets } + +constructor TcxPredefinedStyleSheets.Create; +begin + inherited; + FList := TList.Create; +end; + +destructor TcxPredefinedStyleSheets.Destroy; +begin + FList.Free; + inherited; +end; + +procedure TcxPredefinedStyleSheets.GetStyleSheetsByClass(AStyleSheetClass: TcxCustomStyleSheetClass; + const AList: TList); +var + I: Integer; +begin + for I := 0 to FList.Count - 1 do + if TcxCustomStyleSheetClass(TcxCustomStyleSheet(FList[I]).ClassType) = AStyleSheetClass then + AList.Add(FList[I]); +end; + +procedure TcxPredefinedStyleSheets.AddStyleSheet(AStyleSheet: TcxCustomStyleSheet); +begin + if FList.IndexOf(AStyleSheet) = -1 then + FList.Add(AStyleSheet); +end; + +{ TcxPredefinedStyleSheetsList } + +constructor TcxPredefinedStyleSheetsList.Create(AStyleSheetClassComboBox: TComboBox; + AStyleSheetsListBox: TListBox; ALoadButton: TButton); +var + I: Integer; +begin + inherited Create; + FList := TList.Create; + FStyleSheetClassComboBox := AStyleSheetClassComboBox; + FStyleSheetsListBox := AStyleSheetsListBox; + FLoadButton := ALoadButton; + FStyleSheetClassComboBox.OnClick := StyleSheetClassComboBoxClick; + FStyleSheetsListBox.OnClick := StyleSheetsListBoxClick; + if FPredefinedStyleSheetsList <> nil then + for I := 0 to FPredefinedStyleSheetsList.Count - 1 do + FList.Add(TcxPredefinedStyleSheetsClass(FPredefinedStyleSheetsList[I]).Create); +end; + +destructor TcxPredefinedStyleSheetsList.Destroy; +begin + FreeAndNil(FPreview); + FreeAndNilItems; + inherited; +end; + +function TcxPredefinedStyleSheetsList.CurrentStyleSheet: TcxCustomStyleSheet; +begin + with FStyleSheetsListBox do + if ItemIndex > -1 then + Result := TcxCustomStyleSheet(Items.Objects[ItemIndex]) + else + Result := nil; +end; + +function TcxPredefinedStyleSheetsList.CurrentStyleSheetClass: TcxCustomStyleSheetClass; +begin + with FStyleSheetClassComboBox do + if ItemIndex > - 1 then + Result := TcxCustomStyleSheetClass(Items.Objects[ItemIndex]) + else + Result := nil; +end; + +procedure TcxPredefinedStyleSheetsList.FillListBox; +var + AForm: TfrmcxStyleSheetsLoad; + AList: TList; + I: Integer; + StyleSheet: TcxCustomStyleSheet; + PreviewClass: TcxStyleSheetEditorPreviewClass; +begin + AForm := TfrmcxStyleSheetsLoad(GetParentForm(FStyleSheetsListBox)); + if CurrentStyleSheetClass = nil then + begin + FStyleSheetsListBox.Items.Clear; + //AForm.Width := AForm.pnlStyles.Width; + end + else + begin + AList := TList.Create; + try + for I := 0 to FList.Count - 1 do + TcxPredefinedStyleSheets(FList[I]).GetStyleSheetsByClass(CurrentStyleSheetClass, AList); + + with FStyleSheetsListBox.Items do + begin + BeginUpdate; + try + Clear; + for I := 0 to AList.Count - 1 do + begin + StyleSheet := TcxCustomStyleSheet(AList[I]); + AddObject(StyleSheet.Caption, StyleSheet); + end; + finally + EndUpdate; + end; + end; + finally + AList.Free; + end; + end; + + FreeAndNil(FPreview); + + PreviewClass := nil; + if CurrentStyleSheetClass <> nil then + PreviewClass := GetPreviewByStyleSheetClass(CurrentStyleSheetClass); + if PreviewClass <> nil then + begin + FPreview := PreviewClass.Create(AForm); + AForm.SetShowPreview(True); + FPreview.Control.Parent := AForm.pnlPreviewClient; + FPreview.Control.Align := alClient; + FPreview.SetStyleSheet(nil); + + if AForm.pnlPreviewClient.Width < FPreview.GetSize.X then + AForm.Width := AForm.Width + FPreview.GetSize.X - AForm.pnlPreviewClient.Width; + if AForm.pnlPreviewClient.Height < FPreview.GetSize.Y then + AForm.Height := AForm.Height + FPreview.GetSize.Y - AForm.pnlPreviewClient.Height; + end + else + AForm.SetShowPreview(False); + + UpdateButton; +end; + +procedure TcxPredefinedStyleSheetsList.FreeAndNilItems; +var + I: Integer; +begin + for I := 0 to FList.Count - 1 do + TObject(FList[I]).Free; + FList.Free; +end; + +procedure TcxPredefinedStyleSheetsList.UpdateButton; +begin + FLoadButton.Enabled := FStyleSheetsListBox.SelCount > 0; +end; + +procedure TcxPredefinedStyleSheetsList.StyleSheetClassComboBoxClick(Sender: TObject); +begin + FillListBox; +end; + +procedure TcxPredefinedStyleSheetsList.StyleSheetsListBoxClick(Sender: TObject); +begin + UpdateButton; + if FPreview <> nil then + FPreview.SetStyleSheet(CurrentStyleSheet); +end; + +procedure ShowLoadStyleSheetsFromIniFile(const AIniFileName: string; + AStyleRepository: TcxStyleRepository; + AOwner: TComponent; const AStyleSheetList: TList; + AStyleGetName: TcxStyleGetName); + + procedure SelectAllItems(AForm: TfrmcxStyleSheetsLoad); +//{$IFNDEF DELPHI6} + var + I: Integer; +//{$ENDIF} + begin +// {$IFDEF DELPHI6} +// AForm.lbStyleSheets.SelectAll; +// {$ELSE} + for I := 0 to AForm.lbStyleSheets.Items.Count - 1 do + AForm.lbStyleSheets.Selected[I] := True; +// {$ENDIF} + end; + +var + AForm: TfrmcxStyleSheetsLoad; + I: Integer; + AIniFile: TMemIniFile; + AStrings: TStringList; +begin + AIniFile := TMemIniFile.Create(AIniFileName); + AForm := TfrmcxStyleSheetsLoad.Create(nil); + AForm.SetShowPreview(False); + AStrings := TStringList.Create; + try + AIniFile.ReadSections(AForm.lbStyleSheets.Items); + SelectAllItems(AForm); + AForm.btnLoad.Enabled := (AForm.CurrentStyleSheetClass <> nil) and + (AForm.lbStyleSheets.Items.Count > 0); + AForm.ShowModal; + if AForm.ModalResult = mrOk then + begin + for I := 0 to AForm.lbStyleSheets.Items.Count - 1 do + if AForm.lbStyleSheets.Selected[I] then + AStrings.Add(AForm.lbStyleSheets.Items[I]); + LoadStyleSheetsFromIniFile(AIniFileName, AStyleRepository, + AForm.CurrentStyleSheetClass, + AStrings, AOwner, AStyleSheetList, AStyleGetName); + end; + finally + AStrings.Free; + AForm.Free; + AIniFile.Free; + end; +end; + +procedure CreateStyleSheetByPredefine(AStyleRepository: TcxStyleRepository; + AOwner: TComponent; const AStyleSheetList: TList; + AStyleGetName: TcxStyleGetName; ASource: TcxCustomStyleSheet); +var + AStyleSheet: TcxCustomStyleSheet; +begin + AStyleSheet := AStyleRepository.CreateStyleSheetEx(TcxCustomStyleSheetClass(ASource.ClassType), + AOwner); + if AStyleSheetList <> nil then + AStyleSheetList.Add(AStyleSheet); + if AOwner.FindComponent(ASource.Name) = nil then + AStyleSheet.Name := ASource.Name; + AStyleSheet.Caption := ASource.Caption; + CreateStyleSheetStyles(AStyleSheet, ASource, AStyleGetName); +end; + +procedure ShowLoadStyleSheetsFromPreDefineStyles(AStyleRepository: TcxStyleRepository; + AOwner: TComponent; const AStyleSheetList: TList; + AStyleGetName: TcxStyleGetName); +var + AForm: TfrmcxStyleSheetsLoad; + APredefinedList: TcxPredefinedStyleSheetsList; + I: Integer; +begin + AForm := TfrmcxStyleSheetsLoad.Create(nil); + APredefinedList := TcxPredefinedStyleSheetsList.Create( + AForm.cbStyleSheetClasses, AForm.lbStyleSheets, AForm.btnLoad); + try + APredefinedList.FillListBox; + AForm.ShowModal; + if AForm.ModalResult = mrOk then + begin + for I := 0 to AForm.lbStyleSheets.Items.Count - 1 do + if AForm.lbStyleSheets.Selected[I] then + CreateStyleSheetByPredefine(AStyleRepository, + AOwner, AStyleSheetList, AStyleGetName, + TcxCustomStyleSheet(AForm.lbStyleSheets.Items.Objects[I])); + end; + finally + APredefinedList.Free; + AForm.Free; + end; +end; + +{ TfrmcxStyleSheetsLoad } + +constructor TfrmcxStyleSheetsLoad.Create(AOwner: TComponent); +var + I: Integer; + AList: TList; + StyleSheetClass: TcxCustomStyleSheetClass; +begin + inherited Create(AOwner); + AList := TList.Create; + try + GetRegisteredStyleSheetClasses(AList); + for I := 0 to AList.Count - 1 do + begin + StyleSheetClass := TcxCustomStyleSheetClass(AList[I]); + cbStyleSheetClasses.Items.AddObject(StyleSheetClass.ClassName, TObject(StyleSheetClass)); + end; + + with cbStyleSheetClasses do + if Items.Count > 0 then ItemIndex := 0; + finally + AList.Free; + end; +end; + +function TfrmcxStyleSheetsLoad.CurrentStyleSheetClass: TcxCustomStyleSheetClass; +begin + with cbStyleSheetClasses do + if ItemIndex > - 1 then + Result := TcxCustomStyleSheetClass(Items.Objects[ItemIndex]) + else + Result := nil; +end; + +procedure TfrmcxStyleSheetsLoad.SetShowPreview(Value: Boolean); +begin + if pnlPreview.Visible <> Value then + if Value then + begin + Constraints.MaxWidth := 0; + ClientWidth := ClientWidth + pnlPreview.Width; + pnlPreview.Visible := Value; + end + else + begin + pnlPreview.Visible := Value; + ClientWidth := ClientWidth - pnlPreview.Width; + Constraints.MaxWidth := Width; + end; +end; + +procedure TfrmcxStyleSheetsLoad.FormCreate(Sender: TObject); +begin + lbStyleSheetClass.Height := cbStyleSheetClasses.Height; + lbPreview.Height := cbStyleSheetClasses.Height; +end; + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxStyles.pas b/official/x.35/ExpressLibrary/Sources/cxStyles.pas new file mode 100644 index 00000000..1293e1e2 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxStyles.pas @@ -0,0 +1,1659 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxStyles; + +{$I cxVer.inc} + +interface + +uses + Windows, + SysUtils, Classes, Graphics, cxClasses, cxGraphics; + +type + TcxCustomStyle = class; + TcxStyleRepository = class; + TcxCustomStyles = class; + TcxCustomStylesClass = class of TcxCustomStyles; + + { IcxStyleChangeListener } + + IcxStyleChangeListener = interface + ['{E25A5395-C1E8-4311-A281-9575F79DE862}'] + procedure StyleChanged(AStyle: TcxCustomStyle); + procedure StyleRemoved(AStyle: TcxCustomStyle); + end; + + { TcxCustomStyle } + + TcxCustomStyle = class(TComponent) + private + FListeners: TList; + FStyleRepository: TcxStyleRepository; + function GetIndex: Integer; + procedure SetStyleRepository(Value: TcxStyleRepository); + protected + procedure Changed; virtual; + procedure ReadState(Reader: TReader); override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure AddListener(AListener: IcxStyleChangeListener); virtual; + function GetParentComponent: TComponent; override; + function HasParent: Boolean; override; + procedure RemoveListener(AListener: IcxStyleChangeListener); virtual; + procedure RestoreDefaults; virtual; + procedure SetParentComponent(AParent: TComponent); override; + property Index: Integer read GetIndex; + property StyleRepository: TcxStyleRepository read FStyleRepository write SetStyleRepository; + end; + + TcxCustomStyleSheet = class(TcxComponent) + private + FBuiltIn: Boolean; + FCaption: string; + FStyles: TcxCustomStyles; + FStylesList: TList; + FStyleRepository: TcxStyleRepository; + function GetCaptionStored: Boolean; + function GetCaption: string; + function GetIndex: Integer; + procedure SetCaption(const Value: String); + procedure SetStyleRepository(Value: TcxStyleRepository); + + procedure ReadBuiltIn(AReader: TReader); + procedure WriteBuiltIn(AWriter: TWriter); + protected + procedure DefineProperties(AFiler: TFiler); override; + procedure DoStyleChanged(AIndex: Integer); + procedure GetFakeComponentLinks(AList: TList); override; + procedure ReadState(Reader: TReader); override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure AddStyles(AStyles: TcxCustomStyles); + procedure Assign(Source: TPersistent); override; + procedure CopyFrom(AStyleSheet: TcxCustomStyleSheet); + class function GetStylesClass: TcxCustomStylesClass; virtual; + function GetParentComponent: TComponent; override; + function HasParent: Boolean; override; + function GetStyles: TcxCustomStyles; + procedure RemoveStyles(AStyles: TcxCustomStyles); + procedure SetStyles(const Value: TcxCustomStyles); + procedure SetParentComponent(AParent: TComponent); override; + property BuiltIn: Boolean read FBuiltIn; + property Index: Integer read GetIndex; + property StyleRepository: TcxStyleRepository read FStyleRepository write SetStyleRepository; + published + property Caption: string read GetCaption write SetCaption stored GetCaptionStored; + end; + + TcxCustomStyleClass = class of TcxCustomStyle; + TcxCustomStyleSheetClass = class of TcxCustomStyleSheet; + + { TcxStyleRepository } + + TcxStyleRepository = class(TComponent) + private + FItems: TList; + FPixelsPerInch: Integer; + FScalable: Boolean; + FStyleSheets: TList; + function GetCount: Integer; + function GetItem(Index: Integer): TcxCustomStyle; + function GetStyleSheetCount: Integer; + function GetStyleSheet(Index: Integer): TcxCustomStyleSheet; + procedure ReadPixelsPerInch(Reader: TReader); + procedure WritePixelsPerInch(Writer: TWriter); + protected + procedure AddItem(AItem: TcxCustomStyle); + procedure AddStyleSheet(AStyleSheet: TcxCustomStyleSheet); + procedure DefineProperties(Filer: TFiler); override; + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + function GetScaledValue(AValue: Integer): Integer; + procedure RemoveItem(AItem: TcxCustomStyle); + procedure RemoveStyleSheet(AStyleSheet: TcxCustomStyleSheet); + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Clear; + procedure ClearStyleSheets; + function CreateItem(AStyleClass: TcxCustomStyleClass): TcxCustomStyle; virtual; + function CreateItemEx(AStyleClass: TcxCustomStyleClass; AOwner: TComponent): TcxCustomStyle; virtual; + function CreateStyleSheet(AStyleSheetClass: TcxCustomStyleSheetClass): TcxCustomStyleSheet; virtual; + function CreateStyleSheetEx(AStyleSheetClass: TcxCustomStyleSheetClass; AOwner: TComponent): TcxCustomStyleSheet; virtual; + function StyleIndexOf(AStyle: TcxCustomStyle): Integer; + function StyleSheetIndexOf(AStyleSheet: TcxCustomStyleSheet): Integer; + property Count: Integer read GetCount; + property StyleSheetCount: Integer read GetStyleSheetCount; + property Items[Index: Integer]: TcxCustomStyle read GetItem; default; + property StyleSheets[Index: Integer]: TcxCustomStyleSheet read GetStyleSheet; + published + property Scalable: Boolean read FScalable write FScalable default False; + end; + + { TcxCustomStyles } + + TcxCustomStylesItem = class + Index: Integer; + Item: TcxCustomStyle; + constructor Create(AIndex: Integer; AItem: TcxCustomStyle); + end; + + TcxCustomStyles = class(TcxInterfacedPersistent, IcxStyleChangeListener) + private + FDestroying: Boolean; + FItems: TList; + FStyleSheet: TcxCustomStyleSheet; + FOwnerStyleSheet: TcxCustomStyleSheet; // style sheet to which styles object is aggregated + function GetCount: Integer; + function GetItem(Index: Integer): TcxCustomStylesItem; + procedure SetStyleSheet(const Value: TcxCustomStyleSheet); + protected + // IcxStyleChangeListener + procedure StyleChanged(Sender: TcxCustomStyle); + procedure StyleRemoved(Sender: TcxCustomStyle); + + procedure Changed(AIndex: Integer); virtual; + procedure Clear; + procedure Delete(AItemIndex: Integer); + procedure DoChanged(AIndex: Integer); virtual; + function Find(AIndex: Integer; var AItemIndex: Integer): Boolean; + function GetValue(Index: Integer): TcxCustomStyle; + procedure SetValue(Index: Integer; Value: TcxCustomStyle); + + property Count: Integer read GetCount; + property Destroying: Boolean read FDestroying; + property Items[Index: Integer]: TcxCustomStylesItem read GetItem; + property OwnerStyleSheet: TcxCustomStyleSheet read FOwnerStyleSheet; + property StyleSheet: TcxCustomStyleSheet read FStyleSheet write SetStyleSheet; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function IsValidStyleSheet(AStyleSheet: TcxCustomStyleSheet): Boolean; + procedure ResetStyles; + property Values[Index: Integer]: TcxCustomStyle read GetValue write SetValue; + end; + + { TcxStyle } + + TcxStyleValue = (svBitmap, svColor, svFont, svTextColor); + TcxStyleValues = set of TcxStyleValue; + + TcxStyle = class(TcxCustomStyle) + private + FAssignedValues: TcxStyleValues; + FBitmap: TBitmap; + FColor: TColor; + FFont: TFont; + FTextColor: TColor; + procedure SetAssignedValues(Value: TcxStyleValues); + procedure SetBitmap(Value: TBitmap); + procedure SetColor(Value: TColor); + procedure SetFont(Value: TFont); + procedure SetTextColor(Value: TColor); + procedure BitmapChanged(Sender: TObject); + procedure FontChanged(Sender: TObject); + function IsBitmapStored: Boolean; + function IsColorStored: Boolean; + function IsFontStored: Boolean; + function IsTextColorStored: Boolean; + protected + procedure ReadState(Reader: TReader); override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property AssignedValues: TcxStyleValues read FAssignedValues write SetAssignedValues default []; + property Color: TColor read FColor write SetColor stored IsColorStored; + property Bitmap: TBitmap read FBitmap write SetBitmap stored IsBitmapStored; + property Font: TFont read FFont write SetFont stored IsFontStored; + property TextColor: TColor read FTextColor write SetTextColor stored IsTextColorStored; + end; + + TcxStyleGetName = function(AStyle: TcxStyle): string of object; + + { TcxStyles } + + TcxStyles = class(TcxCustomStyles, IcxFontListener) + private + FMaxDefaultViewParamsIndex: Integer; + protected + BitmapInViewParams: Boolean; + { IcxFontListener } + procedure IcxFontListener.Changed = DefaultFontChanged; + procedure DefaultFontChanged(Sender: TObject; AFont: TFont); + + function GetValue(Index: Integer): TcxStyle; + procedure SetValue(Index: Integer; Value: TcxStyle); + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); virtual; + function IsDefaultFont(Index: Integer): Boolean; virtual; + property MaxDefaultViewParamsIndex: Integer read FMaxDefaultViewParamsIndex; + public + function GetBitmap(Index: Integer): TBitmap; + procedure GetViewParams(Index: Integer; AData: TObject; AStyle: TcxStyle; out AParams: TcxViewParams); + + property Count; + property StyleSheet; + property Values[Index: Integer]: TcxStyle read GetValue write SetValue; + end; + +//function GetDefaultStyleRepository: TcxStyleRepository; +function CombineParamsWithStyle(AStyle: TcxStyle; + AHasValues: TcxStyleValues; var AParams: TcxViewParams): TcxStyleValues; +function UseStyle(AStyle: TcxStyle; AStyleValue: TcxStyleValue): Boolean; +procedure CreateStyleSheetStyles(ADestStyleSheet, ASourceStyleSheet: TcxCustomStyleSheet; + AStyleGetName: TcxStyleGetName = nil); + +procedure RegisterStyleSheetClass(AStyleSheetClass: TcxCustomStyleSheetClass); +procedure UnregisterStyleSheetClass(AStyleSheetClass: TcxCustomStyleSheetClass); +procedure GetRegisteredStyleSheetClasses(AList: TList); + +procedure SaveStyleSheetsToIniFile(const AIniFileName: string; const AList: TList); +procedure LoadStyleSheetsFromIniFile(const AIniFileName: string; + AStyleRepository: TcxStyleRepository; AStyleSheetClass: TcxCustomStyleSheetClass; + const AStyleSheetNames: TStrings = nil; AOwner: TComponent = nil; + const AStyleSheetList: TList = nil; AStyleGetName: TcxStyleGetName = nil); + +implementation + +uses + Controls, TypInfo, IniFiles; + +const + BitmapCaption = 'Bitmap'; + DefaultValue = 'default'; + +function BinaryStreamToString(AStream: TMemoryStream): string; +begin + SetLength(Result, AStream.Size * 2); + BinToHex(AStream.Memory, PChar(Result), AStream.Size); +end; + +procedure StringToBinaryStream(const S: string; AStream: TMemoryStream); +begin + AStream.Position := 0; + AStream.Size := Length(S) div 2; + HexToBin(PChar(S), AStream.Memory, AStream.Size); +end; + +function UseStyle(AStyle: TcxStyle; AStyleValue: TcxStyleValue): Boolean; +begin + Result := (AStyle <> nil) and (AStyleValue in AStyle.AssignedValues); +end; + +function VerifyBitmap(ABitmap: TBitmap): Boolean; +begin + Result := (ABitmap.Width > 0) and (ABitmap.Height > 0); +end; + +function CombineParamsWithStyle(AStyle: TcxStyle; + AHasValues: TcxStyleValues; var AParams: TcxViewParams): TcxStyleValues; + + function CanSetStyleValue(AValue: TcxStyleValue; + var ASetValues: TcxStyleValues): Boolean; + begin + Result := not (AValue in AHasValues) and (AValue in AStyle.AssignedValues); + if Result then + Include(ASetValues, AValue); + end; + +begin + Result := AHasValues; + if (AStyle = nil) or ([svBitmap..svTextColor] = AHasValues) or + (csDestroying in AStyle.ComponentState) then Exit; + if CanSetStyleValue(svColor, Result) then + AParams.Color := AStyle.Color; + if (AStyle.Font <> nil) and CanSetStyleValue(svFont, Result) then + AParams.Font := AStyle.Font; + if CanSetStyleValue(svTextColor, Result) then + AParams.TextColor := AStyle.TextColor; + if CanSetStyleValue(svBitmap, Result) then + AParams.Bitmap := AStyle.Bitmap; +end; + +{ TcxCustomStyle } + +constructor TcxCustomStyle.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FListeners := TList.Create; +end; + +destructor TcxCustomStyle.Destroy; + + procedure RemoveNotification; + begin + while FListeners.Count <> 0 do + IcxStyleChangeListener(FListeners.Last).StyleRemoved(Self); + end; + +begin + RemoveNotification; + StyleRepository := nil; + FreeAndNil(FListeners); + inherited Destroy; +end; + +procedure TcxCustomStyle.AddListener(AListener: IcxStyleChangeListener); +begin + if FListeners.IndexOf(Pointer(AListener)) = -1 then + FListeners.Add(Pointer(AListener)); +end; + +function TcxCustomStyle.GetParentComponent: TComponent; +begin + Result := StyleRepository; +end; + +function TcxCustomStyle.HasParent: Boolean; +begin + Result := StyleRepository <> nil; +end; + +procedure TcxCustomStyle.RemoveListener(AListener: IcxStyleChangeListener); +begin + if FListeners <> nil then + FListeners.Remove(Pointer(AListener)); +end; + +procedure TcxCustomStyle.RestoreDefaults; +begin +end; + +procedure TcxCustomStyle.SetParentComponent(AParent: TComponent); +begin + if not (csLoading in ComponentState) then + StyleRepository := AParent as TcxStyleRepository; +end; + +procedure TcxCustomStyle.Changed; +var + I: Integer; +begin + for I := FListeners.Count - 1 downto 0 do + IcxStyleChangeListener(FListeners[I]).StyleChanged(Self); +end; + +procedure TcxCustomStyle.ReadState(Reader: TReader); +begin + inherited ReadState(Reader); + StyleRepository := TcxStyleRepository(Reader.Parent); +end; + +function TcxCustomStyle.GetIndex: Integer; +begin + if StyleRepository <> nil then + Result := StyleRepository.StyleIndexOf(self) + else Result := -1; +end; + +procedure TcxCustomStyle.SetStyleRepository(Value: TcxStyleRepository); +begin + if FStyleRepository <> Value then + begin + if FStyleRepository <> nil then + FStyleRepository.RemoveItem(Self); + FStyleRepository := Value; + if Value <> nil then + Value.AddItem(Self); + end; +end; + +{ TcxCustomStyleSheet } + +constructor TcxCustomStyleSheet.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FBuiltIn := csDesigning in ComponentState; + FStyles := GetStylesClass.Create(self); + FStyles.FOwnerStyleSheet := self; + FStylesList := TList.Create; +end; + +destructor TcxCustomStyleSheet.Destroy; +begin + Destroying; + while FStylesList.Count > 0 do + TcxCustomStyles(FStylesList[FStylesList.Count - 1]).StyleSheet := nil; + StyleRepository := nil; + FStyles.Free; + FStylesList.Free; + inherited Destroy; +end; + +procedure TcxCustomStyleSheet.AddStyles(AStyles: TcxCustomStyles); +begin + if FStylesList.IndexOf(AStyles) < 0 then + FStylesList.Add(AStyles); +end; + +procedure TcxCustomStyleSheet.Assign(Source: TPersistent); +begin + if Source is TcxCustomStyleSheet then + with TcxCustomStyleSheet(Source) do + begin + Self.Caption := Caption; + Self.SetStyles(GetStyles); + end + else + inherited; +end; + +procedure TcxCustomStyleSheet.CopyFrom(AStyleSheet: TcxCustomStyleSheet); +var + I: Integer; + AStyle: TcxCustomStyle; +begin + if (AStyleSheet <> nil) and (GetStylesClass = AStyleSheet.GetStylesClass) then + begin + for I := 0 to AStyleSheet.GetStyles.Count - 1 do + begin + if StyleRepository <> nil then + AStyle := StyleRepository.CreateItemEx( + TcxCustomStyleClass(AStyleSheet.GetStyles.Items[I].Item.ClassType), + StyleRepository.Owner) + else + AStyle := TcxCustomStyleClass(AStyleSheet.GetStyles.Items[I].Item.ClassType).Create(Owner); + AStyle.Assign(AStyleSheet.GetStyles.Items[I].Item); + GetStyles.Values[AStyleSheet.GetStyles.Items[I].Index] := AStyle; + end; + end; +end; + +class function TcxCustomStyleSheet.GetStylesClass: TcxCustomStylesClass; +begin + Result := TcxCustomStyles; +end; + +function TcxCustomStyleSheet.GetParentComponent: TComponent; +begin + Result := StyleRepository; +end; + +function TcxCustomStyleSheet.HasParent: Boolean; +begin + Result := StyleRepository <> nil; +end; + +function TcxCustomStyleSheet.GetStyles: TcxCustomStyles; +begin + Result := FStyles; +end; + +procedure TcxCustomStyleSheet.RemoveStyles(AStyles: TcxCustomStyles); +begin + FStylesList.Remove(AStyles); +end; + +procedure TcxCustomStyleSheet.SetStyles(const Value: TcxCustomStyles); +begin + FStyles.Assign(Value); +end; + +procedure TcxCustomStyleSheet.SetParentComponent(AParent: TComponent); +begin + if not (csLoading in ComponentState) then + StyleRepository := AParent as TcxStyleRepository; +end; + +procedure TcxCustomStyleSheet.DefineProperties(AFiler: TFiler); +begin + inherited; + AFiler.DefineProperty('BuiltIn', ReadBuiltIn, WriteBuiltIn, True); +end; + +procedure TcxCustomStyleSheet.DoStyleChanged(AIndex: Integer); +var + I: Integer; +begin + for I := 0 to FStylesList.Count - 1 do + TcxCustomStyles(FStylesList[I]).DoChanged(AIndex); + UpdateFakeLinks; +end; + +procedure TcxCustomStyleSheet.GetFakeComponentLinks(AList: TList); +var + I: Integer; +begin + for I := 0 to FStyles.Count - 1 do + if (FStyles.Items[I].Item.Owner <> Owner) and (Owner <> nil) and + (AList.IndexOf(FStyles.Items[I].Item.Owner) < 0) then + AList.Add(FStyles.Items[I].Item.Owner); +end; + +procedure TcxCustomStyleSheet.ReadState(Reader: TReader); +begin + inherited ReadState(Reader); + StyleRepository := TcxStyleRepository(Reader.Parent); +end; + +function TcxCustomStyleSheet.GetCaptionStored: Boolean; +begin + Result := FCaption <> ''; +end; + +function TcxCustomStyleSheet.GetCaption: string; +begin + if FCaption <> '' then + Result := FCaption + else Result := Name; +end; + +function TcxCustomStyleSheet.GetIndex: Integer; +begin + if StyleRepository <> nil then + Result := StyleRepository.StyleSheetIndexOf(self) + else Result := -1; +end; + +procedure TcxCustomStyleSheet.SetCaption(const Value: String); +begin + if FCaption <> Value then + begin + if CompareText(Name, Value) <> 0 then + FCaption := Value + else FCaption := ''; + end; +end; + +procedure TcxCustomStyleSheet.SetStyleRepository(Value: TcxStyleRepository); +begin + if FStyleRepository <> Value then + begin + if FStyleRepository <> nil then + FStyleRepository.RemoveStyleSheet(Self); + FStyleRepository := Value; + if Value <> nil then + Value.AddStyleSheet(Self); + end; +end; + +procedure TcxCustomStyleSheet.ReadBuiltIn(AReader: TReader); +begin + FBuiltIn := AReader.ReadBoolean; +end; + +procedure TcxCustomStyleSheet.WriteBuiltIn(AWriter: TWriter); +begin + AWriter.WriteBoolean(FBuiltIn); +end; + +{ TcxStyleRepository } + +constructor TcxStyleRepository.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FItems := TList.Create; + FStyleSheets := TList.Create; +end; + +destructor TcxStyleRepository.Destroy; +begin + Clear; + ClearStyleSheets; + FItems.Free; + FItems := nil; + FStyleSheets.Free; + FStyleSheets := nil; + inherited Destroy; +end; + +procedure TcxStyleRepository.Clear; +begin + while Count > 0 do + Items[Count - 1].Free; +end; + +procedure TcxStyleRepository.ClearStyleSheets; +begin + while StyleSheetCount > 0 do + StyleSheets[StyleSheetCount - 1].Free; +end; + +function TcxStyleRepository.CreateItem(AStyleClass: TcxCustomStyleClass): TcxCustomStyle; +begin + Result := CreateItemEx(AStyleClass, Self); +end; + +function TcxStyleRepository.CreateItemEx(AStyleClass: TcxCustomStyleClass; + AOwner: TComponent): TcxCustomStyle; +begin + Result := AStyleClass.Create(AOwner); + Result.StyleRepository := Self; +end; + +function TcxStyleRepository.CreateStyleSheet(AStyleSheetClass: TcxCustomStyleSheetClass): TcxCustomStyleSheet; +begin + Result := CreateStyleSheetEx(AStyleSheetClass, Self); +end; + +function TcxStyleRepository.CreateStyleSheetEx(AStyleSheetClass: TcxCustomStyleSheetClass; + AOwner: TComponent): TcxCustomStyleSheet; +begin + Result := AStyleSheetClass.Create(AOwner); + Result.StyleRepository := Self; +end; + +function TcxStyleRepository.StyleIndexOf(AStyle: TcxCustomStyle): Integer; +begin + Result := FItems.IndexOf(AStyle); +end; + +function TcxStyleRepository.StyleSheetIndexOf(AStyleSheet: TcxCustomStyleSheet): Integer; +begin + Result := FStyleSheets.IndexOf(AStyleSheet); +end; + +procedure TcxStyleRepository.AddItem(AItem: TcxCustomStyle); +var + AIndex: Integer; +begin + AIndex := FItems.IndexOf(AItem); + if AIndex = -1 then + FItems.Add(AItem); +end; + +procedure TcxStyleRepository.AddStyleSheet(AStyleSheet: TcxCustomStyleSheet); +var + AIndex: Integer; +begin + AIndex := FStyleSheets.IndexOf(AStyleSheet); + if AIndex = -1 then + FStyleSheets.Add(AStyleSheet); +end; + +procedure TcxStyleRepository.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('PixelsPerInch', ReadPixelsPerInch, WritePixelsPerInch, Filer.Ancestor = nil); +end; + +procedure TcxStyleRepository.GetChildren(Proc: TGetChildProc; Root: TComponent); +var + AItem: TcxCustomStyle; + AStyleSheet: TcxCustomStyleSheet; + I: Integer; +begin + for I := 0 to Count - 1 do + begin + AItem := Items[I]; + if AItem.Owner = Root then + Proc(AItem); + end; + for I := 0 to StyleSheetCount - 1 do + begin + AStyleSheet := StyleSheets[I]; + if AStyleSheet.Owner = Root then + Proc(AStyleSheet); + end; +end; + +function TcxStyleRepository.GetScaledValue(AValue: Integer): Integer; +begin + Result := AValue; + if Scalable and (FPixelsPerInch <> 0) and (FPixelsPerInch <> cxGetScreenPixelsPerInch) then + Result := MulDiv(Result, cxGetScreenPixelsPerInch, FPixelsPerInch); +end; + +procedure TcxStyleRepository.RemoveItem(AItem: TcxCustomStyle); +begin + FItems.Remove(AItem); +end; + +procedure TcxStyleRepository.RemoveStyleSheet(AStyleSheet: TcxCustomStyleSheet); +begin + FStyleSheets.Remove(AStyleSheet); +end; + +function TcxStyleRepository.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxStyleRepository.GetStyleSheetCount: Integer; +begin + Result := FStyleSheets.Count; +end; + +function TcxStyleRepository.GetItem(Index: Integer): TcxCustomStyle; +begin + Result := TcxCustomStyle(FItems[Index]); +end; + +function TcxStyleRepository.GetStyleSheet(Index: Integer): TcxCustomStyleSheet; +begin + Result := TcxCustomStyleSheet(FStyleSheets[Index]); +end; + +procedure TcxStyleRepository.ReadPixelsPerInch(Reader: TReader); +begin + FPixelsPerInch := Reader.ReadInteger; +end; + +procedure TcxStyleRepository.WritePixelsPerInch(Writer: TWriter); +begin + Writer.WriteInteger(cxGetScreenPixelsPerInch); +end; + +{ TcxCustomStylesItem } + +constructor TcxCustomStylesItem.Create(AIndex: Integer; AItem: TcxCustomStyle); +begin + inherited Create; + Index := AIndex; + Item := AItem; +end; + +{ TcxCustomStyles } + +constructor TcxCustomStyles.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FItems := TList.Create; +end; + +destructor TcxCustomStyles.Destroy; +begin + FDestroying := True; + Clear; + FItems.Free; + StyleSheet := nil; + inherited Destroy; +end; + +procedure TcxCustomStyles.Assign(Source: TPersistent); +begin + if Source is TcxCustomStyles then + StyleSheet := TcxCustomStyles(Source).StyleSheet; +end; + +function TcxCustomStyles.IsValidStyleSheet(AStyleSheet: TcxCustomStyleSheet): Boolean; +var + AStyles: TcxCustomStyles; +begin + Result := (AStyleSheet = nil) or + ((AStyleSheet <> OwnerStyleSheet) and (AStyleSheet.GetStylesClass = TcxCustomStylesClass(ClassType))); + if Result and (AStyleSheet <> nil) and (OwnerStyleSheet <> nil) then //check for a cycle + begin + AStyles := AStyleSheet.GetStyles; + while AStyles.StyleSheet <> nil do + begin + if AStyles.StyleSheet = OwnerStyleSheet then + begin + Result := False; + break; + end; + AStyles := AStyles.StyleSheet.GetStyles; + end; + end; +end; + +procedure TcxCustomStyles.StyleChanged(Sender: TcxCustomStyle); +var + I: Integer; +begin + for I := 0 to Count - 1 do + if Items[I].Item = Sender then + DoChanged(Items[I].Index); +end; + +procedure TcxCustomStyles.StyleRemoved(Sender: TcxCustomStyle); +var + I: Integer; +begin + for I := Count - 1 downto 0 do + if Items[I].Item = Sender then + Delete(I); +end; + +procedure TcxCustomStyles.Clear; +begin + while Count > 0 do + Delete(Count - 1); +end; + +procedure TcxCustomStyles.Delete(AItemIndex: Integer); +var + AItem: TcxCustomStylesItem; + AIndex: Integer; +begin + AItem := Items[AItemIndex]; + AIndex := AItem.Index; + AItem.Item.RemoveListener(Self); + AItem.Free; + FItems.Delete(AItemIndex); + DoChanged(AIndex); +end; + +procedure TcxCustomStyles.DoChanged(AIndex: Integer); +begin + if Destroying then Exit; + Changed(AIndex); + if OwnerStyleSheet <> nil then + OwnerStyleSheet.DoStyleChanged(AIndex); +end; + +function TcxCustomStyles.Find(AIndex: Integer; var AItemIndex: Integer): Boolean; +var + L, H, I, C: Integer; +begin + AItemIndex := 0; + Result := False; + L := 0; + H := Count - 1; + if L <= H then + repeat + I := (L + H) div 2; + C := Items[I].Index - AIndex; + if C = 0 then + begin + AItemIndex := I; + Result := True; + Break; + end + else + if C < 0 then + L := I + 1 + else + H := I - 1; + if L > H then + begin + AItemIndex := L; + Break; + end; + until False; +end; + +function TcxCustomStyles.GetValue(Index: Integer): TcxCustomStyle; +var + AItemIndex: Integer; +begin + if Find(Index, AItemIndex) then + Result := Items[AItemIndex].Item + else + Result := nil; + if (Result = nil) and (StyleSheet <> nil) and + ((GetOwner = nil) or not (GetOwner is TComponent) or // don't persist a stylesheet's style + not (csWriting in TComponent(GetOwner).ComponentState)) then + Result := StyleSheet.GetStyles.GetValue(Index); +end; + +procedure TcxCustomStyles.ResetStyles; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Values[I] := nil; +end; + +procedure TcxCustomStyles.SetValue(Index: Integer; Value: TcxCustomStyle); +var +{$IFDEF DELPHI6} + AStylesRootOwner, AValueOwner: TPersistent; +{$ENDIF} + AItem: TcxCustomStylesItem; + AItemIndex: Integer; +begin +{$IFDEF DELPHI6} + if (Value <> nil) and (Value.Name <> '') then + begin + AStylesRootOwner := Owner; + while GetUltimateOwner(AStylesRootOwner) <> nil do + AStylesRootOwner := GetUltimateOwner(AStylesRootOwner); + AValueOwner := Value.Owner; + if (AStylesRootOwner <> AValueOwner) and + (AStylesRootOwner is TComponent) and (AValueOwner is TComponent) and + AStylesRootOwner.InheritsFrom(AValueOwner.ClassType) then + Value := TComponent(AStylesRootOwner).FindComponent(Value.Name) as TcxCustomStyle; + end; +{$ENDIF} + if GetValue(Index) <> Value then + if Find(Index, AItemIndex) then + begin + AItem := Items[AItemIndex]; + AItem.Item.RemoveListener(Self); + if Value <> nil then + begin + AItem.Item := Value; + Value.AddListener(Self); + end + else + begin + AItem.Free; + FItems.Delete(AItemIndex); + end; + DoChanged(Index); + end + else + if Value <> nil then + begin + AItem := TcxCustomStylesItem.Create(Index, Value); + FItems.Insert(AItemIndex, AItem); + Value.AddListener(Self); + DoChanged(Index); + end; +end; + +procedure TcxCustomStyles.Changed(AIndex: Integer); +begin +end; + +function TcxCustomStyles.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxCustomStyles.GetItem(Index: Integer): TcxCustomStylesItem; +begin + Result := TcxCustomStylesItem(FItems[Index]); +end; + +procedure TcxCustomStyles.SetStyleSheet(const Value: TcxCustomStyleSheet); +var + AChangedStyles: TList; + + procedure AddChangedStyles(AStyleSheet: TcxCustomStyleSheet); + var + I: Integer; + AIndex: Pointer; + begin + if AStyleSheet = nil then exit; + if AChangedStyles = nil then + AChangedStyles := TList.Create; + for I := 0 to AStyleSheet.GetStyles.Count - 1 do + begin + AIndex := Pointer(AStyleSheet.GetStyles.Items[I].Index); + if AChangedStyles.IndexOf(AIndex) < 0 then + AChangedStyles.Add(AIndex); + end; + if AStyleSheet.GetStyles.StyleSheet <> nil then + AddChangedStyles(AStyleSheet.GetStyles.StyleSheet); + end; + +var + I: Integer; +begin + if (StyleSheet <> Value) and IsValidStyleSheet(Value) then + begin + AChangedStyles := nil; + if (StyleSheet <> nil) then + begin + StyleSheet.RemoveStyles(self); + if not Destroying then + AddChangedStyles(StyleSheet); + end; + FStyleSheet := Value; + if StyleSheet <> nil then + begin + StyleSheet.AddStyles(self); + AddChangedStyles(StyleSheet); + end; + if AChangedStyles <> nil then + begin + for I := 0 to AChangedStyles.Count - 1 do + DoChanged(Integer(AChangedStyles[I])); + AChangedStyles.Free; + end; + end; +end; + +{ TcxStyle } + +constructor TcxStyle.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FColor := clDefault; + FBitmap := TBitmap.Create; + FBitmap.OnChange := BitmapChanged; + FFont := TFont.Create; + FFont.OnChange := FontChanged; + FTextColor := clDefault; +end; + +destructor TcxStyle.Destroy; +begin + FreeAndNil(FFont); + FreeAndNil(FBitmap); + inherited Destroy; +end; + +procedure TcxStyle.SetAssignedValues(Value: TcxStyleValues); +begin + if FAssignedValues <> Value then + begin + FAssignedValues := Value; + Changed; + end; +end; + +procedure TcxStyle.SetBitmap(Value: TBitmap); +begin + FBitmap.Assign(Value); +end; + +procedure TcxStyle.SetColor(Value: TColor); +begin + if FColor <> Value then + begin + FColor := Value; + if FColor = clDefault then // It's correct? + Exclude(FAssignedValues, svColor) + else + Include(FAssignedValues, svColor); + Changed; + end; +end; + +procedure TcxStyle.SetFont(Value: TFont); +begin + FFont.Assign(Value); +end; + +procedure TcxStyle.SetTextColor(Value: TColor); +begin + if FTextColor <> Value then + begin + FTextColor := Value; + if FTextColor = clDefault then // It's correct? + Exclude(FAssignedValues, svTextColor) + else + Include(FAssignedValues, svTextColor); + Changed; + end; +end; + +procedure TcxStyle.BitmapChanged(Sender: TObject); +begin + if FBitmap.Empty then + Exclude(FAssignedValues, svBitmap) + else + Include(FAssignedValues, svBitmap); + Changed; +end; + +procedure TcxStyle.FontChanged(Sender: TObject); +begin + Include(FAssignedValues, svFont); + Changed; +end; + +function TcxStyle.IsBitmapStored: Boolean; +begin + Result := svBitmap in FAssignedValues; +end; + +function TcxStyle.IsColorStored: Boolean; +begin + Result := svColor in FAssignedValues; +end; + +function TcxStyle.IsFontStored: Boolean; +begin + Result := svFont in FAssignedValues; +end; + +function TcxStyle.IsTextColorStored: Boolean; +begin + Result := svTextColor in FAssignedValues; +end; + +procedure TcxStyle.ReadState(Reader: TReader); +begin + inherited ReadState(Reader); + if StyleRepository <> nil then + Font.Height := StyleRepository.GetScaledValue(Font.Height); +end; + +procedure TcxStyle.Assign(Source: TPersistent); +begin + if Source is TcxStyle then + with TcxStyle(Source) do + begin + Self.Bitmap := Bitmap; + Self.Color := Color; + Self.Font := Font; + Self.TextColor := TextColor; + Self.AssignedValues := AssignedValues; + end + else + inherited Assign(Source); +end; + +procedure TcxStyle.RestoreDefaults; +begin + FAssignedValues := []; + FBitmap.Assign(nil); + FColor := clDefault; + FTextColor := clDefault; + Changed; +end; + +{ TcxStyles } + +procedure TcxStyles.DefaultFontChanged(Sender: TObject; AFont: TFont); +var + I: Integer; + AParams: TcxViewParams; +begin + for I := 0 to FMaxDefaultViewParamsIndex do + if IsDefaultFont(I) then + begin + GetDefaultViewParams(I, nil, AParams); + if AParams.Font = AFont then DoChanged(I); + end; +end; + +function TcxStyles.GetValue(Index: Integer): TcxStyle; +begin + Result := TcxStyle(inherited GetValue(Index)); +end; + +procedure TcxStyles.SetValue(Index: Integer; Value: TcxStyle); +begin + inherited SetValue(Index, Value); +end; + +procedure TcxStyles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +begin + AParams.Bitmap := nil; + if Index > FMaxDefaultViewParamsIndex then FMaxDefaultViewParamsIndex := Index; +end; + +function TcxStyles.IsDefaultFont(Index: Integer): Boolean; +begin + Result := not UseStyle(Values[Index], svFont); +end; + +function TcxStyles.GetBitmap(Index: Integer): TBitmap; +var + AAssignedStyle: TcxStyle; +begin + AAssignedStyle := Values[Index]; + if UseStyle(AAssignedStyle, svBitmap) and not AAssignedStyle.Bitmap.Empty then + Result := AAssignedStyle.Bitmap + else + Result := nil; +end; + +procedure TcxStyles.GetViewParams(Index: Integer; AData: TObject; AStyle: TcxStyle; + out AParams: TcxViewParams); +var + AAssignedStyle: TcxStyle; + ADefaultParams: TcxViewParams; + + function GetBitmap: TBitmap; + begin + if UseStyle(AStyle, svBitmap) then + Result := AStyle.Bitmap + else + if UseStyle(AAssignedStyle, svBitmap) then + Result := AAssignedStyle.Bitmap + else + Result := nil; + end; + + function GetColor: TColor; + begin + if UseStyle(AStyle, svColor) then + Result := AStyle.Color + else + if UseStyle(AAssignedStyle, svColor) then + Result := AAssignedStyle.Color + else + Result := clDefault; + end; + + function GetFont: TFont; + begin + if UseStyle(AStyle, svFont) then + Result := AStyle.Font + else + if UseStyle(AAssignedStyle, svFont) then + Result := AAssignedStyle.Font + else + Result := nil; + end; + + function GetTextColor: TColor; + begin + if UseStyle(AStyle, svTextColor) then + Result := AStyle.TextColor + else + if UseStyle(AAssignedStyle, svTextColor) then + Result := AAssignedStyle.TextColor + else + Result := clDefault; + end; + +begin + AAssignedStyle := Values[Index]; + with AParams do + begin + if BitmapInViewParams then + Bitmap := GetBitmap + else + Bitmap := nil; + Color := GetColor; + Font := GetFont; + TextColor := GetTextColor; + if BitmapInViewParams and (Bitmap = nil) or + (Color = clDefault) or (Font = nil) or (TextColor = clDefault) then + begin + GetDefaultViewParams(Index, AData, ADefaultParams); + if Bitmap = nil then + Bitmap := ADefaultParams.Bitmap; + if Color = clDefault then + Color := ADefaultParams.Color; + if Font = nil then + Font := ADefaultParams.Font; + if TextColor = clDefault then + TextColor := ADefaultParams.TextColor; + end; + end; +end; + +procedure CreateStyleSheetStyles(ADestStyleSheet, ASourceStyleSheet: TcxCustomStyleSheet; + AStyleGetName: TcxStyleGetName = nil); +var + APropList: TPropList; + I, ACount: Integer; + ADestStyle, ASourceStyle: TcxStyle; +begin + if ADestStyleSheet.GetStylesClass <> ASourceStyleSheet.GetStylesClass then Exit; + ACount := GetPropList(ADestStyleSheet.GetStyles.ClassInfo, [tkClass], @APropList); + for I := 0 to ACount - 1 do + if GetTypeData(APropList[I].PropType^).ClassType = TcxStyle then + begin + ADestStyle := TcxStyle(GetObjectProp(ADestStyleSheet.GetStyles, APropList[I].Name)); + ASourceStyle := TcxStyle(GetObjectProp(ASourceStyleSheet.GetStyles, APropList[I].Name)); + if ASourceStyle <> nil then + begin + if ADestStyle <> nil then + ADestStyle.Assign(ASourceStyle) + else + if (ADestStyleSheet.StyleRepository <> nil) and + (ASourceStyle.AssignedValues <> []) then + begin + ADestStyle := TcxStyle(ADestStyleSheet.StyleRepository.CreateItemEx(TcxStyle, ADestStyleSheet.Owner)); + if Assigned(AStyleGetName) then + ADestStyle.Name := AStyleGetName(ADestStyle); + ADestStyle.Assign(ASourceStyle); + SetObjectProp(ADestStyleSheet.GetStyles, APropList[I], ADestStyle); + end; + end + else + SetObjectProp(ADestStyleSheet.GetStyles, APropList[I], nil); + end; +end; + +var + FStyleSheetClasses: TList = nil; + +procedure RegisterStyleSheetClass(AStyleSheetClass: TcxCustomStyleSheetClass); +begin + if FStyleSheetClasses = nil then + FStyleSheetClasses := TList.Create; + if FStyleSheetClasses.IndexOf(TObject(AStyleSheetClass)) = -1 then + FStyleSheetClasses.Add(TObject(AStyleSheetClass)); +end; + +procedure UnregisterStyleSheetClass(AStyleSheetClass: TcxCustomStyleSheetClass); +begin + if FStyleSheetClasses <> nil then + FStyleSheetClasses.Remove(TObject(AStyleSheetClass)); +end; + +procedure GetRegisteredStyleSheetClasses(AList: TList); +var + I: Integer; +begin + AList.Clear; + if FStyleSheetClasses <> nil then + for I := 0 to FStyleSheetClasses.Count - 1 do + AList.Add(FStyleSheetClasses[I]); +end; + +function ColorToText(AColor: TColor): string; +begin + Result := IntToStr(AColor); +end; + +function TextToColor(const ASt: string): TColor; +begin + if CompareText(ASt, DefaultValue) <> 0 then + Result := TColor(StrToInt(ASt)) + else Result := clDefault; +end; + +function FontToText(AFont: TFont): string; +begin + Result := AFont.Name + ',' + IntToStr(AFont.Size) + ',['; + if fsBold in AFont.Style then + Result := Result + 'B'; + if fsItalic in AFont.Style then + Result := Result + 'I'; + if fsUnderline in AFont.Style then + Result := Result + 'U'; + if fsStrikeOut in AFont.Style then + Result := Result + 'S'; + Result := Result + ']'; +end; + +procedure TextToFont(const AFont: TFont; const ASt: string); + procedure SetFontSize(AText: string); + begin + try + AFont.Size := StrToInt(AText); + except + end; + end; + +var + St: string; +begin + st := ASt; + if Pos(',', st) = 0 then + AFont.Name := st + else + begin + AFont.Name := Copy(st, 1, Pos(',', st) - 1); + st := Copy(st, Pos(',', st) + 1, Length(st)); + if Pos(',', st) = 0 then + SetFontSize(st) + else + begin + SetFontSize(Copy(st, 1, Pos(',', st) - 1)); + st := Copy(st, Pos(',', st) + 1, Length(st)); + if Pos('B', st) > 0 then + AFont.Style := AFont.Style + [fsBold]; + if Pos('I', st) > 0 then + AFont.Style := AFont.Style + [fsItalic]; + if Pos('U', st) > 0 then + AFont.Style := AFont.Style + [fsUnderline]; + if Pos('S', st) > 0 then + AFont.Style := AFont.Style + [fsStrikeout]; + end; + end; +end; + +procedure SaveBitmapToIniFile(AIniFile: TCustomIniFile; ABitmap: TBitmap; + const ASectionName, ABitmapName: string); +const + AStringValueMaxLength = 2047; +var + AStream: TMemoryStream; + I: Integer; + S: string; +begin + AStream := TMemoryStream.Create; + try + ABitmap.SaveToStream(AStream); + S := BinaryStreamToString(AStream); + finally + AStream.Free; + end; + for I := 0 to (Length(S) + AStringValueMaxLength - 1) div AStringValueMaxLength - 1 do + AIniFile.WriteString(ASectionName, ABitmapName + IntToStr(I), + Copy(S, 1 + I * AStringValueMaxLength, AStringValueMaxLength)); +end; + +procedure SaveStyleSheetsToIniFile(const AIniFileName: string; const AList: TList); +var + AIsFileEmpty: Boolean; + + procedure SaveStyleToIni(AIniFile: TCustomIniFile; const AStyleSheetCaption, AStyleName: string; + AStyle: TcxStyle); + var + Value: string; + begin + if svColor in AStyle.AssignedValues then + Value := ColorToText(AStyle.Color) + else + Value := DefaultValue; + if Value <> '' then + Value := Value + ','; + + if svTextColor in AStyle.AssignedValues then + Value := Value + ColorToText(AStyle.TextColor) + else + Value := Value + DefaultValue; + + if svFont in AStyle.AssignedValues then + begin + if Value <> '' then + Value := Value + ','; + Value := Value + FontToText(AStyle.Font); + end; + + if Value <> '' then + begin + AIniFile.WriteString(AStyleSheetCaption, AStyleName, Value); + AIsFileEmpty := False; + end; + + if (svBitmap in AStyle.AssignedValues) and VerifyBitmap(AStyle.Bitmap) then + SaveBitmapToIniFile(AIniFile, AStyle.Bitmap, AStyleSheetCaption, AStyleName + BitmapCaption); + end; + + procedure SaveStyleSheetToIni(AStyleSheet: TcxCustomStyleSheet; AIniFile: TCustomIniFile); + var + I, ACount: Integer; + APropList: TPropList; + AStyle: TcxStyle; + begin + ACount := GetPropList(AStyleSheet.GetStyles.ClassInfo, [tkClass], @APropList); + for I := 0 to ACount - 1 do + if GetTypeData(APropList[I].PropType^).ClassType = TcxStyle then + begin + AStyle := TcxStyle(GetObjectProp(AStyleSheet.GetStyles, APropList[I])); + if AStyle <> nil then + SaveStyleToIni(AIniFile, AStyleSheet.Caption, APropList[I].Name, AStyle); + end; + end; + +var + AIniFile: TMemIniFile; + F: TextFile; + I: Integer; +begin + AIsFileEmpty := True; + try + AIniFile := TMemIniFile.Create(AIniFileName); + try + for I := 0 to AList.Count - 1 do + SaveStyleSheetToIni(TcxCustomStyleSheet(AList[I]), AIniFile); + if not AIsFileEmpty then AIniFile.UpdateFile; + finally + AIniFile.Free; + end; + finally + if AIsFileEmpty then + begin + AssignFile(F, AIniFileName); + Rewrite(F); + CloseFile(F); + end; + end; +end; + +procedure LoadStyleSheetsFromIniFile(const AIniFileName: string; + AStyleRepository: TcxStyleRepository; AStyleSheetClass: TcxCustomStyleSheetClass; + const AStyleSheetNames: TStrings = nil; AOwner: TComponent = nil; + const AStyleSheetList: TList = nil; AStyleGetName: TcxStyleGetName = nil); + + procedure LoadStyleFromIni(AIniFile: TCustomIniFile; AStyleSheet: TcxCustomStyleSheet; + AStyleName: string; var AStyleNameIndex: Integer); + var + AIsBitmapValue: Boolean; + AKey, S: string; + APos: Integer; + APropInfo: PPropInfo; + AStream: TMemoryStream; + AStyle: TcxStyle; + I: Integer; + begin + if AStyleName = '' then + begin + Inc(AStyleNameIndex); + Exit; + end; + APos := Pos(BitmapCaption, AStyleName); + if APos > 0 then + begin + AIsBitmapValue := True; + AStyleName := Copy(AStyleName, 1, APos - 1); + end + else + AIsBitmapValue := False; + + APropInfo := GetPropInfo(PTypeInfo(AStyleSheet.GetStyles.ClassInfo), AStyleName); + if (APropInfo <> nil) and (GetTypeData(APropInfo.PropType^).ClassType = TcxStyle) then + begin + if AIsBitmapValue then + begin + AStyle := TcxStyle(GetObjectProp(AStyleSheet.GetStyles, APropInfo)); + S := ''; + I := 0; + repeat + AKey := AStyleName + BitmapCaption + IntToStr(I); + if not AIniFile.ValueExists(AStyleSheet.Caption, AKey) then + Break; + S := S + AIniFile.ReadString(AStyleSheet.Caption, AKey, ''); + Inc(AStyleNameIndex); + Inc(I); + until False; + AStream := TMemoryStream.Create; + try + StringToBinaryStream(S, AStream); + AStyle.Bitmap.LoadFromStream(AStream); + finally + AStream.Free; + end; + end + else + begin + if AOwner <> nil then + AStyle := TcxStyle(AStyleRepository.CreateItemEx(TcxStyle, AOwner)) + else AStyle := TcxStyle(AStyleRepository.CreateItem(TcxStyle)); + if Assigned(AStyleGetName) then + AStyle.Name := AStyleGetName(AStyle); + + S := AIniFile.ReadString(AStyleSheet.Caption, AStyleName, ''); + if Pos(',', S) = 0 then + AStyle.Color := TextToColor(S) + else + begin + AStyle.Color := TextToColor(Copy(S, 1, Pos(',', S) - 1)); + S := Copy(S, Pos(',', S) + 1, Length(S)); + if Pos(',', S) = 0 then + AStyle.TextColor := TextToColor(S) + else + begin + AStyle.TextColor := TextToColor(Copy(S, 1, Pos(',', S) - 1)); + TextToFont(AStyle.Font, Copy(S, Pos(',', S) + 1, Length(S))); + end; + end; + SetObjectProp(AStyleSheet.GetStyles, APropInfo, AStyle); + Inc(AStyleNameIndex); + end; + end else Inc(AStyleNameIndex); + end; + + procedure LoadStyleSheetFromIni(const AStyleSheetName: string; AIniFile: TCustomIniFile); + var + ANames: TStringList; + AStyleSheet: TcxCustomStyleSheet; + I: Integer; + begin + ANames := TStringList.Create; + try + AIniFile.ReadSection(AStyleSheetName, ANames); + if ANames.Count > 0 then + begin + if AOwner <> nil then + AStyleSheet := AStyleRepository.CreateStyleSheetEx(AStyleSheetClass, AOwner) + else AStyleSheet := AStyleRepository.CreateStyleSheet(AStyleSheetClass); + if AStyleSheetList <> nil then + AStyleSheetList.Add(AStyleSheet); + AStyleSheet.Caption := AStyleSheetName; + I := 0; + while I < ANames.Count do + LoadStyleFromIni(AIniFile, AStyleSheet, ANames[I], I); + end; + finally + ANames.Free; + end; + end; + +var + AIniFile: TMemIniFile; + I: Integer; + AStrings: TStringList; +begin + AIniFile := TMemIniFile.Create(AIniFileName); + AStrings := TStringList.Create; + try + if (AStyleSheetNames = nil) or (AStyleSheetNames.Count = 0) then + AIniFile.ReadSections(AStrings) + else + AStrings.AddStrings(AStyleSheetNames); + for I := 0 to AStrings.Count - 1 do + LoadStyleSheetFromIni(AStrings[I], AIniFile); + finally + AStrings.Free; + AIniFile.Free; + end; +end; + +initialization +{$IFDEF DELPHI6} + StartClassGroup(TControl); + GroupDescendentsWith(TcxCustomStyle, TControl); + GroupDescendentsWith(TcxCustomStyleSheet, TControl); + GroupDescendentsWith(TcxStyleRepository, TControl); +{$ENDIF} + RegisterClasses([TcxStyle]); + +finalization + FreeAndNil(FStyleSheetClasses); + +end. diff --git a/official/x.35/ExpressLibrary/Sources/cxVer.inc b/official/x.35/ExpressLibrary/Sources/cxVer.inc new file mode 100644 index 00000000..a26364cc --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/cxVer.inc @@ -0,0 +1,172 @@ +{$B-} { Complete Boolean Evaluation } +{$R-} { Range-Checking } +{$T-} { Typed @ operator } +{$X+} { Extended syntax } +{$P+} { Open string params } +{$J+} { Writeable structured consts } +{$H+} { Use long strings by default } +{$Q-} { Overflow checking } + +{$DEFINE DXVER500} + +{$IFNDEF CLR} + {$DEFINE OLEDRAGANDDROP} + {$IFNDEF DONTUSEJPEGIMAGE} + {$DEFINE USEJPEGIMAGE} + {$ENDIF} +{$ENDIF} + +{$DEFINE EXPRESSBARS5} + +{$DEFINE VCL} + +{$IFNDEF VER80} + {$IFNDEF VER90} + {$IFNDEF VER93} + {$DEFINE DELPHI3} { Borland Delphi 3.0 } + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER110} { Borland C++Builder 3.0 } + {$DEFINE CBUILDER3} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE DELPHI4} +{$ENDIF} + +{$IFDEF VER125} { Borland C++Builder 4.0 } + {$DEFINE CBUILDER3} + {$DEFINE DELPHI4} + {$DEFINE CBUILDER4} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$IFDEF BCB} { Borland C++Builder 5.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$IFDEF BCB} { Borland C++Builder 6.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} +{$ENDIF} + +{$IFNDEF DELPHI6} + {$DEFINE MSWINDOWS} +{$ENDIF} +{$IFDEF LINUX} + {$UNDEF MSWINDOWS} +{$ENDIF} + +{$IFDEF LINUX} + {$DEFINE KYLIX1} { Borland Kylix 1 } + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF CompilerVersion >= 14} + {$DEFINE KYLIX2} { Borland Kylix 2 } + {$IFEND} + {$IF CompilerVersion >= 14.50} + {$DEFINE KYLIX3} { Borland Kylix 3 } + {$IFEND} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} { Borland Delphi.Net } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} +{$ENDIF} + +{$IFDEF VER170} { Borland Delphi 9.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} +{$ENDIF} + +{$IFDEF VER180} { Borland Delphi 10 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$IFDEF BCB} { Borland C++Builder 10 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Borland Delphi 11 //CodeGear} + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$DEFINE DELPHI11} + {$IFDEF BCB} { Borland C++Builder 11 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$DEFINE CBUILDER11} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFNDEF CLR} + {$IFNDEF BCB} + {$IFDEF DELPHI6} + {$DEFINE REGISTERSHELLCTRLS} + {$ENDIF} + {$ENDIF} + {$IFDEF DELPHI7} + {$WARN UNSAFE_CAST OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_TYPE OFF} + {$ENDIF} +{$ENDIF} + +{$IFDEF REGISTERSHELLCTRLS} + {$DEFINE REGISTERCXSHELLCTRLS} +{$ENDIF} + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} diff --git a/official/x.35/ExpressLibrary/Sources/dxSkinInfo.pas b/official/x.35/ExpressLibrary/Sources/dxSkinInfo.pas new file mode 100644 index 00000000..d9f42385 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/dxSkinInfo.pas @@ -0,0 +1,1145 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinInfo; + +interface + +uses + Windows, Classes, Graphics, SysUtils, cxClasses, cxGraphics, cxLookAndFeels, + cxGeometry, cxLookAndFeelPainters, dxSkinsCore, dxSkinsStrs; + +type + TdxSkinScrollInfo = class + public + Element: TdxSkinElement; + ImageIndex: Integer; + end; + + TdxSkinFormIcon = (sfiMenu, sfiHelp, sfiMinimize, sfiMaximize, sfiRestore, sfiClose); + TdxSkinFormIcons = set of TdxSkinFormIcon; + + { TdxSkinInfo } + + TdxSkinInfo = class(TcxIUnknownObject, IdxSkinChangeListener, IdxSkinInfo) + private + FSkin: TdxSkin; + procedure SetSkin(ASkin: TdxSkin); + protected + Group_Bars: TdxSkinControlGroup; + Group_Common: TdxSkinControlGroup; + Group_Docking: TdxSkinControlGroup; + Group_Editors: TdxSkinControlGroup; + Group_Form: TdxSkinControlGroup; + Group_Grid: TdxSkinControlGroup; + Group_NavBar: TdxSkinControlGroup; + Group_NavPane: TdxSkinControlGroup; + Group_Ribbon: TdxSkinControlGroup; + Group_Scheduler: TdxSkinControlGroup; + Group_Tabs: TdxSkinControlGroup; + Group_VGrid: TdxSkinControlGroup; + // + CardViewSeparator: TdxSkinElement; + ClockElements: array[Boolean] of TdxSkinElement; + CheckboxElement: TdxSkinElement; + EditButtonElements: array [Boolean] of TdxSkinElement; + EditButtonGlyphs: array [TcxEditBtnKind] of TdxSkinElement; + GridGroupByBox: TdxSkinElement; + GridGroupRow: TdxSkinElement; + GridLine: TdxSkinElement; + GridFixedLine: TdxSkinElement; + IndicatorImages: TdxSkinElement; + NavigatorGlyphs: TdxSkinElement; + NavigatorGlyphsVert: TdxSkinElement; + RadioGroupButton: TdxSkinElement; + Splitter: array[Boolean] of TdxSkinElement; + TrackBarThumb: array[Boolean, TcxTrackBarTicksAlign] of TdxSkinElement; + TrackBarTrack: array[Boolean] of TdxSkinElement; + VGridCategory: TdxSkinElement; + VGridLine: array[Boolean] of TdxSkinElement; + // Colors + ContentEvenColor: TdxSkinColor; + ContentOddColor: TdxSkinColor; + ContentTextColor: TdxSkinColor; + HeaderBackgroundColor: TdxSkinColor; + HeaderBackgroundTextColor: TdxSkinColor; + SelectionColor: TdxSkinColor; + SelectionTextColor: TdxSkinColor; + // ExpandButton + ExpandButton: TdxSkinElement; + // Footer + FooterCell, FooterPanel: TdxSkinElement; + // header + Header, HeaderSpecial: TdxSkinElement; + // filter + FilterButtons: array[Boolean] of TdxSkinElement; + FilterPanel: TdxSkinElement; + // Scheduler3 + SchedulerNavigationButtons: array[Boolean] of TdxSkinElement; + SchedulerNavigationButtonsArrow: array[Boolean] of TdxSkinElement; + // + procedure CheckItem(AItem: TObject; const AMessage: string; var ACheckedItem); + function CreateBlankElement(AGroup: TdxSkinControlGroup; const AName: string): TdxSkinElement; + function CreateBlankGroup(const AName: string): TdxSkinControlGroup; + function GetColorByName(AGroup: TdxSkinPersistent; const AName: string): TdxSkinColor; + function GetIntPropertyByName(AGroup: TdxSkinPersistent; const AName: string): TdxSkinIntegerProperty; + function GetElementColorProperty(AElement: TdxSkinPersistent; const APropName: string): TColor; + function GetElementIntProperty(AElement: TdxSkinPersistent; const APropName: string; + ADefValue: Integer = 0): Integer; + function GetGroupByName(const AName: string): TdxSkinControlGroup; + function GetElementByName(AGroup: TdxSkinControlGroup; const AName: string; + ACreateIfEmpty: Boolean = True): TdxSkinElement; + procedure InitializeGroups; + procedure InitializeBarElements; + procedure InitializeButtonElements; + procedure InitializeCheckboxElements; + procedure InitializeClockElements; + procedure InitializeColors; + procedure InitializeDockControlElements; + procedure InitializeEditButtonElements; + procedure InitializeFilterElements; + procedure InitializeFooterElements; + procedure InitializeFormElements; + procedure InitializeGridElements; + procedure InitializeGroupBoxElements; + procedure InitializeHeaderElements; + procedure InitializeIndicatorImages; + procedure InitializeNavBarElements; + procedure InitializeNavigatorElements; + procedure InitializePageControlElements; + procedure InitializeProgressBarElements; + procedure InitializeRadioGroupElements; + procedure InitializeRibbonColors; + procedure InitializeRibbonElements; + procedure InitializeRibbonProperties; + procedure InitializeSchedulerElements; + procedure InitializeScrollBarElements; + procedure InitializeSizeGripElements; + procedure InitializeSplitterElements; + procedure InitializeToolTipElements; + procedure InitializeTrackBarElements; + procedure InitializeSkinInfo; virtual; + + procedure FinalizeScrollBarElements; + procedure FinalizeSkinInfo; virtual; + { IdxSkinInfo } + function GetSkin: TdxSkin; + { IdxSkinChangeListener } + procedure SkinChanged(Sender: TdxSkin); virtual; + public + // Button + ButtonDisabled: TdxSkinColor; + ButtonElements: TdxSkinElement; + // Colors + ContainerBorderColor: TdxSkinColor; + ContainerHighlightBorderColor: TdxSkinColor; + ContentColor: TdxSkinColor; + EditorBackgroundColors: array[Boolean] of TdxSkinColor; + EditorTextColors: array[Boolean] of TdxSkinColor; + // ProgressBar + ProgressBarElements: array[Boolean, Boolean] of TdxSkinElement; + // ScrollBars + ScrollBar_Elements: array[Boolean, TcxScrollBarPart] of TdxSkinScrollInfo; + // GroupBox + GroupBoxCaptionElements: array[TcxGroupBoxCaptionPosition] of TdxSkinElement; + GroupBoxClient: TdxSkinElement; + GroupBoxElements: array[TcxGroupBoxCaptionPosition] of TdxSkinElement; + // DockControl + DockControlBorder: TdxSkinElement; + DockControlCaption: TdxSkinElement; + DockControlCaptionNonFocusedTextColor: TColor; + DockControlHideBar: TdxSkinElement; + DockControlHideBarLeft: TdxSkinElement; + DockControlHideBarRight: TdxSkinElement; + DockControlHideBarBottom: TdxSkinElement; + DockControlHideBarButtons: TdxSkinElement; + DockControlHideBarTextColor: TdxSkinColor; + DockControlIndents: array[0..2] of Integer; + DockControlTabHeader: TdxSkinElement; + DockControlTabHeaderBackground: TdxSkinElement; + DockControlTabHeaderLine: TdxSkinElement; + DockControlTabTextColor: array[Boolean] of TdxSkinColor; + DockControlWindowButton: TdxSkinElement; + DockControlWindowButtonGlyphs: TdxSkinElement; + // PageControl + LayoutControlColor: TdxSkinColor; + PageControlButtonHorz: TdxSkinElement; + PageControlButtonVert: TdxSkinElement; + PageControlHeader: TdxSkinElement; + PageControlIndents: array[0..5] of Integer; + PageControlPane: TdxSkinElement; + TabTextColor: TdxSkinColor; + TabTextColorActive: TdxSkinColor; + TabTextColorDisabled: TdxSkinColor; + TabTextColorHot: TdxSkinColor; + // NavBar + NavBarBackgroundColor: TdxSkinElement; + NavBarGroupButtons: array [Boolean] of TdxSkinElement; + NavBarGroupClient: TdxSkinElement; + NavBarGroupHeader: TdxSkinElement; + NavBarItem: TdxSkinElement; + NavPaneCaptionFontSize: TdxSkinIntegerProperty; + NavPaneCaptionHeight: TdxSkinIntegerProperty; + NavPaneCollapseButton: TdxSkinElement; + NavPaneCollapsedGroupClient: TdxSkinElement; + NavPaneExpandButton: TdxSkinElement; + NavPaneFormBorder: TdxSkinElement; + NavPaneFormSizeGrip: TdxSkinElement; + NavPaneGroupButton: array[Boolean] of TdxSkinElement; + NavPaneGroupCaption: TdxSkinElement; + NavPaneGroupClient: TdxSkinElement; + NavPaneItem: TdxSkinElement; + NavPaneOverflowPanel: TdxSkinElement; + NavPaneOverflowPanelExpandedItem: TdxSkinElement; + NavPaneOverflowPanelItem: TdxSkinElement; + NavPaneScrollButtons: array[Boolean] of TdxSkinElement; + NavPaneSelectedItem: TdxSkinElement; + NavPaneSplitter: TdxSkinElement; + // Form + FormBorderWidths: array[Boolean] of TRect; + FormCaptionDelta: Integer; + FormContent: TdxSkinElement; + FormFrames: array[Boolean, TcxBorder] of TdxSkinElement; + FormIcons: array[Boolean, TdxSkinFormIcon] of TdxSkinElement; + FormInactiveColor: TdxSkinColor; + FormStatusBar: TdxSkinElement; + FormTextShadowColor: TdxSkinColor; + SizeGrip: TdxSkinElement; + // Scheduler + SchedulerAllDayArea: array[Boolean] of TdxSkinElement; + SchedulerAppointment: array[Boolean] of TdxSkinElement; + SchedulerAppointmentBorder: TdxSkinColor; + SchedulerAppointmentBorderSize: TdxSkinIntegerProperty; + SchedulerAppointmentMask: TdxSkinElement; + SchedulerAppointmentShadow: array[Boolean] of TdxSkinElement; + SchedulerCurrentTimeIndicator: TdxSkinElement; + SchedulerMoreButton: TdxSkinElement; + SchedulerNavigatorColor: TdxSkinColor; + SchedulerTimeGridCurrentTimeIndicator: TdxSkinElement; + SchedulerTimeGridHeader: array[Boolean] of TdxSkinElement; + SchedulerTimeLine: TdxSkinElement; + SchedulerTimeRuler: TdxSkinElement; + // Bars + Bar: TdxSkinElement; + BarCustomize: TdxSkinElement; + BarCustomizeVertical: TdxSkinElement; + BarDisabledTextColor: TdxSkinColor; + BarDrag: TdxSkinElement; + BarDragVertical: TdxSkinElement; + BarSeparator: TdxSkinElement; + BarVertical: TdxSkinElement; + BarVerticalSeparator: TdxSkinElement; + Dock: TdxSkinElement; + FloatingBar: TdxSkinElement; + LinkBorderPainter: TdxSkinElement; + LinkSelected: TdxSkinElement; + MainMenu: TdxSkinElement; + MainMenuCustomize: TdxSkinElement; + MainMenuDrag: TdxSkinElement; + MainMenuLinkSelected: TdxSkinElement; + MainMenuVertical: TdxSkinElement; + PopupMenu: TdxSkinElement; + PopupMenuCheck: TdxSkinElement; + PopupMenuExpandButton: TdxSkinElement; + PopupMenuLinkSelected: TdxSkinElement; + PopupMenuSeparator: TdxSkinElement; + PopupMenuSideStrip: TdxSkinElement; + PopupMenuSideStripNonRecent: TdxSkinElement; + PopupMenuSplitButton: TdxSkinElement; + PopupMenuSplitButton2: TdxSkinElement; + ScreenTipItem: TdxSkinColor; + ScreenTipSeparator: TdxSkinElement; + ScreenTipTitleItem: TdxSkinColor; + ScreenTipWindow: TdxSkinElement; + // + RibbonApplicationButton: TdxSkinElement; + RibbonApplicationMenuBorders: array[Boolean] of TdxSkinElement; + RibbonButtonArrow: TdxSkinElement; + RibbonButtonGroup: TdxSkinElement; + RibbonButtonGroupButton: TdxSkinElement; + RibbonButtonGroupSeparator: TdxSkinElement; + RibbonButtonText: array[Boolean] of TColor; + RibbonCaptionFontDelta: TdxSkinIntegerProperty; + RibbonCaptionText: array[Boolean] of TColor; + RibbonCollapsedToolBarBackground: TdxSkinElement; + RibbonCollapsedToolBarGlyphBackground: TdxSkinElement; + RibbonDocumentNameTextColor: array[Boolean] of TColor; + RibbonExtraPaneColor: TdxSkinColor; + RibbonFormBottom: array[Boolean] of TdxSkinElement; + RibbonFormCaption: TdxSkinElement; + RibbonFormLeft: array[Boolean] of TdxSkinElement; + RibbonFormRight: array[Boolean] of TdxSkinElement; + RibbonGalleryBackground: TdxSkinElement; + RibbonGalleryButtonDown: TdxSkinElement; + RibbonGalleryButtonDropDown: TdxSkinElement; + RibbonGalleryButtonUp: TdxSkinElement; + RibbonGalleryGroupCaption: TdxSkinElement; + RibbonGalleryPane: TdxSkinElement; + RibbonGallerySizeGrips: TdxSkinElement; + RibbonGallerySizingPanel: TdxSkinElement; + RibbonHeaderBackground: TdxSkinElement; + RibbonIndents: array[0..2] of Integer; + RibbonLargeButton: TdxSkinElement; + RibbonLargeSplitButtonBottom: TdxSkinElement; + RibbonLargeSplitButtonTop: TdxSkinElement; + RibbonQATCustomizeButtonOutsizeQAT: array[Boolean] of TdxSkinBooleanProperty; + RibbonQATIndentBeforeCustomizeButton: array[Boolean] of TdxSkinIntegerProperty; + RibbonQuickToolbar: array[Boolean] of TdxSkinElement; + RibbonQuickToolbarBelow: TdxSkinElement; + RibbonQuickToolbarButtonGlyph: TdxSkinElement; + RibbonQuickToolbarDropDown: TdxSkinElement; + RibbonQuickToolbarGlyph: TdxSkinElement; + RibbonSmallButton: TdxSkinElement; + RibbonSplitButtonLeft: TdxSkinElement; + RibbonSplitButtonRight: TdxSkinElement; + RibbonStatusBarBackground: TdxSkinElement; + RibbonStatusBarButton: TdxSkinElement; + RibbonStatusBarSeparator: TdxSkinElement; + RibbonTab: TdxSkinElement; + RibbonTabGroup: TdxSkinElement; + RibbonTabGroupHeader: TdxSkinElement; + RibbonTabPanel: TdxSkinElement; + RibbonTabPanelGroupButton: TdxSkinElement; + RibbonTabText: array[Boolean] of TColor; + // Status bar text colors + RibbonStatusBarText: TColor; + RibbonStatusBarTextHot: TColor; + RibbonStatusBarTextDisabled: TColor; + // + constructor Create(ASkin: TdxSkin); virtual; + destructor Destroy; override; + + property Skin: TdxSkin read FSkin write SetSkin; + end; + + TdxSkinInfoClass = class of TdxSkinInfo; + +implementation + +uses + Math; + +{ TdxSkinInfo } + +constructor TdxSkinInfo.Create(ASkin: TdxSkin); +begin + Skin := ASkin; +end; + +destructor TdxSkinInfo.Destroy; +var + ASkin: TdxSkin; +begin + ASkin := Skin; + Skin := nil; + FreeAndNil(ASkin); + inherited Destroy; +end; + +procedure TdxSkinInfo.CheckItem( + AItem: TObject; const AMessage: string; var ACheckedItem); +begin + Assert(AItem <> nil, AMessage); + TObject(ACheckedItem) := AItem; +end; + +function TdxSkinInfo.CreateBlankElement(AGroup: TdxSkinControlGroup; + const AName: string): TdxSkinElement; +var + ABitmap: TBitmap; +begin + Result := AGroup.AddElement(AName); + if Result <> nil then + begin + Result.Image.States := [esNormal]; + Result.Image.Stretch := smStretch; + Result.Tag := 2; + ABitmap := TBitmap.Create; + try + ABitmap.Width := 32; + ABitmap.Height := 32; + with ABitmap.Canvas do + begin + Pen.Color := clRed; + Pen.Width := 2; + MoveTo(0, 0); + LineTo(ABitmap.Width, ABitmap.Height); + MoveTo(0, ABitmap.Height); + LineTo(ABitmap.Width, 0); + end; + Result.Image.Texture.SetBitmap(ABitmap); + finally + ABitmap.Free; + end; + end; +end; + +function TdxSkinInfo.CreateBlankGroup(const AName: string): TdxSkinControlGroup; +begin + Result := FSkin.AddGroup(AName); + if Result <> nil then + Result.Tag := 2; +end; + +function TdxSkinInfo.GetColorByName(AGroup: TdxSkinPersistent; + const AName: string): TdxSkinColor; +begin + Result := nil; + if AGroup <> nil then + begin + Result := AGroup.GetPropertyByName(AName) as TdxSkinColor; + if Result <> nil then + Result.Tag := 1; + end; +end; + +function TdxSkinInfo.GetIntPropertyByName(AGroup: TdxSkinPersistent; + const AName: string): TdxSkinIntegerProperty; +begin + Result := nil; + if AGroup <> nil then + begin + Result := AGroup.GetPropertyByName(AName) as TdxSkinIntegerProperty; + if Result <> nil then + Result.Tag := 1; + end; +end; + +function TdxSkinInfo.GetElementColorProperty(AElement: TdxSkinPersistent; + const APropName: string): TColor; +var + AProperty: TdxSkinColor; +begin + Result := clDefault; + if AElement <> nil then + begin + AProperty := AElement.GetPropertyByName(APropName) as TdxSkinColor; + if AProperty <> nil then + Result := AProperty.Value; + end; +end; + +function TdxSkinInfo.GetElementIntProperty(AElement: TdxSkinPersistent; + const APropName: string; ADefValue: Integer = 0): Integer; +var + AProperty: TdxSkinIntegerProperty; +begin + Result := ADefValue; + if AElement <> nil then + begin + AProperty := AElement.GetPropertyByName(APropName) as TdxSkinIntegerProperty; + if AProperty <> nil then + Result := AProperty.Value; + end; +end; + +function TdxSkinInfo.GetGroupByName(const AName: string): TdxSkinControlGroup; +begin + if Skin = nil then + Result := nil + else + begin + Result := Skin.GetGroupByName(AName); + if Result = nil then + Result := CreateBlankGroup(AName) + else + Result.Tag := 1; + end; +end; + +function TdxSkinInfo.GetElementByName(AGroup: TdxSkinControlGroup; + const AName: string; ACreateIfEmpty: Boolean = True): TdxSkinElement; +begin + if AGroup = nil then + Result := nil + else + begin + Result := AGroup.GetElementByName(AName); + if Result = nil then + begin + if ACreateIfEmpty then + Result := CreateBlankElement(AGroup, AName); + end + else + Result.Tag := 1; + end; +end; + +procedure TdxSkinInfo.InitializeGroups; +begin + Group_Bars := GetGroupByName(sdxSkinGroupBars); + Group_Common := GetGroupByName(sdxSkinGroupCommon); + Group_Docking := GetGroupByName(sdxSkinGroupDocking); + Group_Editors := GetGroupByName(sdxSkinGroupEditors); + Group_Ribbon := GetGroupByName(sdxSkinGroupRibbon); + Group_Form := GetGroupByName(sdxSkinGroupForm); + Group_Grid := GetGroupByName(sdxSkinGroupGrid); + Group_Tabs := GetGroupByName(sdxSkinGroupTabs); + Group_Scheduler := GetGroupByName(sdxSkinGroupScheduler); + Group_VGrid := GetGroupByName(sdxSkinGroupVGrid); + Group_NavBar := GetGroupByName(sdxSkinGroupNavBar); + Group_NavPane := GetGroupByName(sdxSkinGroupNavPane); +end; + +procedure TdxSkinInfo.InitializeBarElements; +begin + Bar := GetElementByName(Group_Bars, sdxBarsBar); + BarCustomize := GetElementByName(Group_Bars, sdxBarsBarCustomize); + BarCustomizeVertical := GetElementByName(Group_Bars, sdxBarsBarCustomizeVertical); + BarDrag := GetElementByName(Group_Bars, sdxBarsBarFinger); + BarDragVertical := GetElementByName(Group_Bars, sdxBarsBarFingerVertical); + BarSeparator := GetElementByName(Group_Bars, sdxBarsBarSeparator); + BarVertical := GetElementByName(Group_Bars, sdxBarsBarVertical); + BarVerticalSeparator := GetElementByName(Group_Bars, sdxBarsBarVerticalSeparator); + Dock := GetElementByName(Group_Bars, sdxBarsDock); + FloatingBar := GetElementByName(Group_Bars, sdxBarsFloatBar); + LinkBorderPainter := GetElementByName(Group_Bars, sdxBarsLinkStatic); + LinkSelected := GetElementByName(Group_Bars, sdxBarsLinkSelected); + MainMenu := GetElementByName(Group_Bars, sdxBarsMainMenu); + MainMenuCustomize := GetElementByName(Group_Bars, sdxBarsMainMenuCustomize, False); + MainMenuDrag := GetElementByName(Group_Bars, sdxBarsMainMenuDrag, False); + MainMenuLinkSelected := GetElementByName(Group_Bars, sdxBarsMainMenuLinkSelected); + MainMenuVertical := GetElementByName(Group_Bars, sdxBarsMainMenuVertical); + PopupMenu := GetElementByName(Group_Bars, sdxBarsPopupMenu); + PopupMenuCheck := GetElementByName(Group_Bars, sdxBarsPopupMenuCheck); + PopupMenuExpandButton := GetElementByName(Group_Bars, sdxBarsPopupMenuExpandButton); + PopupMenuLinkSelected := GetElementByName(Group_Bars, sdxBarsPopupMenuLinkSelected); + PopupMenuSeparator := GetElementByName(Group_Bars, sdxBarsPopupMenuSeparator); + PopupMenuSideStrip := GetElementByName(Group_Bars, sdxBarsPopupMenuSideStrip); + PopupMenuSideStripNonRecent := GetElementByName(Group_Bars, sdxBarsPopupMenuSideStripNonRecent); + PopupMenuSplitButton := GetElementByName(Group_Bars, sdxBarsPopupMenuDropDownButtonLabel); + PopupMenuSplitButton2 := GetElementByName(Group_Bars, sdxBarsPopupMenuDropDownButtonArrow); +end; + +procedure TdxSkinInfo.InitializeButtonElements; +begin + ButtonElements := GetElementByName(Group_Common, sdxButton); + ExpandButton := GetElementByName(Group_Grid, sdxPlusMinus); + if ButtonElements <> nil then + ButtonDisabled := GetColorByName(ButtonElements, sdxSkinsButtonDisabledTextColor); +end; + +procedure TdxSkinInfo.InitializeCheckboxElements; +begin + CheckboxElement := GetElementByName(Group_Editors, sdxCheckbox); +end; + +procedure TdxSkinInfo.InitializeClockElements; +begin + ClockElements[False] := GetElementByName(Group_Editors, sdxClock); + ClockElements[True] := GetElementByName(Group_Editors, sdxClockGlass); +end; + +procedure TdxSkinInfo.InitializeColors; +begin + BarDisabledTextColor := GetColorByName(Group_Bars, sdxSkinsBarDisabledTextColor); + DockControlTabTextColor[False] := GetColorByName(Group_Docking, sdxSkinsTabTextColor); + DockControlTabTextColor[True] := GetColorByName(Group_Docking, sdxSkinsTabTextColorActive); + SchedulerNavigatorColor := GetColorByName(Group_Scheduler, sdxSkinsSchedulerNavigatorColor); + + TabTextColor := GetColorByName(PageControlHeader, sdxTextColorNormal); + TabTextColorActive := GetColorByName(PageControlHeader, sdxTextColorSelected); + TabTextColorDisabled := GetColorByName(PageControlHeader, sdxTextColorDisabled); + TabTextColorHot := GetColorByName(PageControlHeader, sdxTextColorHot); + + if Skin <> nil then + begin + ContainerBorderColor := Skin.GetColorByName(sdxSkinsContainerBorderColor); + ContainerHighlightBorderColor := Skin.GetColorByName(sdxSkinsContainerHighlightBorderColor); + ContentColor := Skin.GetColorByName(sdxSkinsContentColor); + ContentEvenColor := Skin.GetColorByName(sdxSkinsContentEvenColor); + ContentOddColor := Skin.GetColorByName(sdxSkinsContentOddColor); + ContentTextColor := Skin.GetColorByName(sdxSkinsContentTextColor); + DockControlHideBarTextColor := Skin.GetColorByName(sdxSkinsDCHiddenBarTextColor); + + EditorBackgroundColors[False] := GetColorByName(Group_Editors, sdxSkinsEditorBackgroundColor); + EditorBackgroundColors[True] := GetColorByName(Group_Editors, sdxSkinsEditorBackgroundDisabledColor); + EditorTextColors[False] := GetColorByName(Group_Editors, sdxSkinsEditorTextColor); + EditorTextColors[True] := GetColorByName(Group_Editors, sdxSkinsEditorTextDisabledColor); + + HeaderBackgroundColor := Skin.GetColorByName(sdxSkinsHeaderBackgroundColor); + HeaderBackgroundTextColor := Skin.GetColorByName(sdxSkinsHeaderBackgroundTextColor); + LayoutControlColor := Skin.GetColorByName(sdxSkinsLayoutControlColor); + SelectionColor := Skin.GetColorByName(sdxSkinsSelectionColor); + SelectionTextColor := Skin.GetColorByName(sdxSkinsSelectionTextColor); + end; +end; + +procedure TdxSkinInfo.InitializeDockControlElements; +begin + DockControlTabHeaderBackground := GetElementByName(Group_Docking, + sdxDockCtrlTabHeaderBackground); + DockControlTabHeaderLine := GetElementByName(Group_Docking, + sdxDockCtrlTabHeaderLine); + DockControlHideBarButtons := GetElementByName(Group_Docking, + sdxDockCtrlTabHeaderAutoHideBar); + DockControlWindowButton := GetElementByName(Group_Docking, sdxDockCtrlWindowButton); + DockControlWindowButtonGlyphs := GetElementByName(Group_Docking, sdxDockCtrlWindowGlyphs); + DockControlTabHeader := GetElementByName(Group_Docking, sdxDockCtrlTabHeader); + DockControlHideBar := GetElementByName(Group_Docking, sdxDockCtrlAutoHideBar); + DockControlHideBarLeft := GetElementByName(Group_Docking, sdxDockCtrlAutoHideBarLeft); + DockControlHideBarRight := GetElementByName(Group_Docking, sdxDockCtrlAutoHideBarRight); + DockControlHideBarBottom := GetElementByName(Group_Docking, sdxDockCtrlAutoHideBarBottom); + + DockControlCaption := GetElementByName(Group_Docking, sdxDockCtrlCaption); + DockControlBorder := GetElementByName(Group_Docking, sdxDockCtrlBorder); + DockControlCaptionNonFocusedTextColor := GetElementColorProperty(DockControlCaption, + sdxDockCtrlInactiveCaptionTextColor); + + FillChar(DockControlIndents, SizeOf(DockControlIndents), 0); + if Group_Docking <> nil then + begin + DockControlIndents[0] := GetElementIntProperty(Group_Docking, sdxDCActiveTabHeaderDownGrow); + DockControlIndents[1] := GetElementIntProperty(Group_Docking, sdxDCActiveTabHeaderHGrow); + DockControlIndents[2] := GetElementIntProperty(Group_Docking, sdxDCActiveTabHeaderUpGrow); + end; +end; + +procedure TdxSkinInfo.InitializeEditButtonElements; +var + AKind: TcxEditBtnKind; +begin + EditButtonElements[False] := GetElementByName(Group_Editors, sdxEditorButton); + EditButtonElements[True] := GetElementByName(Group_Editors, sdxCloseButton); + for AKind := Low(TcxEditBtnKind) to High(TcxEditBtnKind) do + EditButtonGlyphs[AKind] := GetElementByName(Group_Editors, EditButtonsMap[AKind]); +end; + +procedure TdxSkinInfo.InitializeFilterElements; +begin + FilterButtons[False] := GetElementByName(Group_Grid, sdxFilterButton); + FilterButtons[True] := GetElementByName(Group_Grid, sdxFilterButtonActive); + FilterPanel := GetElementByName(Group_Grid, sdxFilterPanel); +end; + +procedure TdxSkinInfo.InitializeFooterElements; +begin + FooterCell := GetElementByName(Group_Grid, sdxFooterCell); + FooterPanel := GetElementByName(Group_Grid, sdxFooterPanel); +end; + +procedure TdxSkinInfo.InitializeFormElements; + + procedure CorrectStateAndStretch(AElement: TdxSkinElement; + AInclude, AExclude: TdxSkinElementStates; AStretch: Boolean = False); + begin + if AElement = nil then Exit; + AElement.Image.States := AElement.Image.States + AInclude - AExclude; + if AStretch then + AElement.Image.Stretch := smStretch; + end; + +var + R: TRect; + ASide: TcxBorder; + AStandard: Boolean; + AIcon: TdxSkinFormIcon; +begin + FillChar(FormIcons, SizeOf(FormIcons), 0); + FormInactiveColor := GetColorByName(Group_Form, sdxTextInactiveColor); + FormTextShadowColor := GetColorByName(Group_Form, sdxTextShadowColor); + FormStatusBar := GetElementByName(Group_Bars, sdxStatusBar); + FormIcons[False, sfiClose] := GetElementByName(Group_Form, sdxSmallFormButtonClose); + FormIcons[True, sfiClose] := GetElementByName(Group_Form, sdxFormButtonClose); + FormIcons[True, sfiMinimize] := GetElementByName(Group_Form, sdxFormButtonMinimize); + FormIcons[True, sfiMaximize] := GetElementByName(Group_Form, sdxFormButtonMaximize); + FormIcons[True, sfiRestore] := GetElementByName(Group_Form, sdxFormButtonRestore); + FormIcons[True, sfiHelp] := GetElementByName(Group_Form, sdxFormButtonHelp); + FormContent := GetElementByName(Group_Form, sdxFormContent); + + for AStandard := False to True do + for ASide := bLeft to bBottom do + FormFrames[AStandard, ASide] := GetElementByName(Group_Form, + FormFrameMap[AStandard, ASide]); + + if Skin = nil then Exit; + Skin.BeginUpdate; + try + for AStandard := False to True do + begin + R := cxNullRect; + for AIcon := sfiMenu to sfiClose do + CorrectStateAndStretch(FormIcons[AStandard, AIcon], [esActiveDisabled], [esActive], True); + for ASide := bLeft to bBottom do + begin + if FormFrames[AStandard, ASide] = nil then Continue; + CorrectStateAndStretch(FormFrames[AStandard, ASide], [esActive, esActiveDisabled], [esNormal]); + with FormFrames[AStandard, ASide].Image do + case ASide of + bLeft: + begin + Margins.Left := 1; + Margins.Right := 0; + R.Left := Size.cx; + end; + bRight: + begin + Margins.Right := 1; + Margins.Left := 0; + R.Right := Size.cx; + end; + bBottom: + begin + Margins.Top := 0; + Margins.Bottom := 1; + R.Bottom := Size.cy; + end; + end; + end; + FormBorderWidths[AStandard] := R; + end; + FormCaptionDelta := Max(1, + GetElementIntProperty(FormFrames[True, bTop], sdxCaptionFontDelta)); + finally + Skin.CancelUpdate; + end; +end; + +procedure TdxSkinInfo.InitializeGroupBoxElements; +begin + GroupBoxClient := GetElementByName(Group_Common, sdxGroupPanelNoBorder); + GroupBoxElements[cxgpTop] := GetElementByName(Group_Common, sdxGroupPanelTop); + GroupBoxElements[cxgpBottom] := GetElementByName(Group_Common, sdxGroupPanelBottom); + GroupBoxElements[cxgpLeft] := GetElementByName(Group_Common, sdxGroupPanelLeft); + GroupBoxElements[cxgpRight] := GetElementByName(Group_Common, sdxGroupPanelRight); + GroupBoxElements[cxgpCenter] := GetElementByName(Group_Common, sdxGroupPanel); + + GroupBoxCaptionElements[cxgpTop] := GetElementByName(Group_Common, sdxGroupPanelCaptionTop); + GroupBoxCaptionElements[cxgpBottom] := GetElementByName(Group_Common, sdxGroupPanelCaptionBottom); + GroupBoxCaptionElements[cxgpLeft] := GetElementByName(Group_Common, sdxGroupPanelCaptionLeft); + GroupBoxCaptionElements[cxgpRight] := GetElementByName(Group_Common, sdxGroupPanelCaptionRight); +end; + +procedure TdxSkinInfo.InitializeGridElements; +begin + GridFixedLine := GetElementByName(Group_Grid, sdxGridFixedLine); + CardViewSeparator := GetElementByName(Group_Grid, sdxCardSeparator); + GridGroupByBox := GetElementByName(Group_Grid, sdxGroupByBox); + if (GridGroupByBox <> nil) and not GridGroupByBox.Image.Empty then + GridGroupByBox.Color := clNone; + GridGroupRow := GetElementByName(Group_Grid, sdxGroupRow); + GridLine := GetElementByName(Group_Grid, sdxGridLine); + VGridCategory := GetElementByName(Group_VGrid, sdxVGridRowHeader); + VGridLine[False] := GetElementByName(Group_VGrid, sdxVGridLine); + VGridLine[True] := GetElementByName(Group_VGrid, sdxVGridBandLine); +end; + +procedure TdxSkinInfo.InitializeHeaderElements; +begin + Header := GetElementByName(Group_Common, sdxHeader); + HeaderSpecial := GetElementByName(Group_Common, sdxHeaderSpecial); +end; + +procedure TdxSkinInfo.InitializeIndicatorImages; +begin + IndicatorImages := GetElementByName(Group_Grid, sdxIndicatorImages); +end; + +procedure TdxSkinInfo.InitializeNavBarElements; +begin + NavBarBackgroundColor := GetElementByName(Group_NavBar, sdxNavBarBackground); + NavBarGroupClient := GetElementByName(Group_NavBar, sdxNavBarGroupClient); + NavBarItem := GetElementByName(Group_NavBar, sdxNavBarItem); + NavBarGroupHeader := GetElementByName(Group_NavBar, sdxNavBarGroupHeader); + NavBarGroupButtons[True] := GetElementByName(Group_NavBar, sdxNavBarGroupCloseButton); + NavBarGroupButtons[False] := GetElementByName(Group_NavBar, sdxNavBarGroupOpenButton); + NavPaneCollapseButton := GetElementByName(Group_NavPane, sdxNavPaneCollapseButton); + NavPaneCollapsedGroupClient := GetElementByName(Group_NavPane, sdxNavPaneCollapsedGroupClient); + NavPaneExpandButton := GetElementByName(Group_NavPane, sdxNavPaneExpandButton); + NavPaneFormBorder := GetElementByName(Group_NavPane, sdxNavPaneFormBorder); + NavPaneFormSizeGrip := GetElementByName(Group_NavPane, sdxNavPaneFormSizeGrip); + NavPaneGroupButton[False] := GetElementByName(Group_NavPane, sdxNavPaneGroupButton); + NavPaneGroupButton[True] := GetElementByName(Group_NavPane, sdxNavPaneGroupButtonSelected); + NavPaneGroupCaption := GetElementByName(Group_NavPane, sdxNavPaneGroupCaption); + NavPaneSplitter := GetElementByName(Group_NavPane, sdxNavPaneSplitter); + NavPaneScrollButtons[False] := GetElementByName(Group_NavPane, sdxNavPaneScrollUpBtn); + NavPaneScrollButtons[True] := GetElementByName(Group_NavPane, sdxNavPaneScrollDownBtn); + NavPaneOverflowPanel := GetElementByName(Group_NavPane, sdxNavPaneOverflowPanel); + NavPaneOverflowPanelItem := GetElementByName(Group_NavPane, sdxNavPaneOverflowPanelItem); + NavPaneOverflowPanelExpandedItem := GetElementByName(Group_NavPane, sdxNavPaneOverflowPanelExpandItem); + NavPaneGroupClient := GetElementByName(Group_NavPane, sdxNavPaneGroupClient); + NavPaneItem := GetElementByName(Group_NavPane, sdxNavPaneItem); + NavPaneSelectedItem := GetElementByName(Group_NavPane, sdxNavPaneItemSelected); + NavPaneCaptionHeight := GetIntPropertyByName(NavPaneGroupCaption, sdxNavPaneCaptionHeight); + NavPaneCaptionFontSize := GetIntPropertyByName(NavPaneGroupCaption, sdxNavPaneCaptionFontSize); +end; + +procedure TdxSkinInfo.InitializeNavigatorElements; +begin + NavigatorGlyphs := GetElementByName(Group_Editors, sdxNavigatorGlyphs); + NavigatorGlyphsVert := GetElementByName(Group_Editors, sdxNavigatorGlyphsVert); +end; + +procedure TdxSkinInfo.InitializePageControlElements; +begin + PageControlHeader := GetElementByName(Group_Tabs, sdxPageControlHeaderTop); + PageControlButtonHorz := GetElementByName(Group_Tabs, sdxPageControlHorz); + PageControlButtonVert := GetElementByName(Group_Tabs, sdxPageControlVert); + if FormContent <> nil then + begin + if PageControlButtonHorz <> nil then + PageControlButtonHorz.Color := FormContent.Color; + if PageControlButtonVert <> nil then + PageControlButtonVert.Color := FormContent.Color; + end; + PageControlPane := GetElementByName(Group_Tabs, sdxPageControlPane); + FillChar(PageControlIndents, SizeOf(PageControlIndents), 0); + if Group_Tabs <> nil then + begin + PageControlIndents[0] := GetElementIntProperty(Group_Tabs, sdxRowIndentFar); + PageControlIndents[1] := GetElementIntProperty(Group_Tabs, sdxRowIndentNear); + PageControlIndents[2] := GetElementIntProperty(Group_Tabs, sdxSelectedHeaderDownGrow); + PageControlIndents[3] := GetElementIntProperty(Group_Tabs, sdxSelectedHeaderHGrow); + PageControlIndents[4] := GetElementIntProperty(Group_Tabs, sdxSelectedHeaderUpGrow); + PageControlIndents[5] := GetElementIntProperty(Group_Tabs, sdxHeaderDownGrow); + end; +end; + +procedure TdxSkinInfo.InitializeProgressBarElements; +begin + ProgressBarElements[False, False] := GetElementByName(Group_Editors, sdxProgressBorder); + ProgressBarElements[False, True] := GetElementByName(Group_Editors, sdxProgressBorderVert); + ProgressBarElements[True, False] := GetElementByName(Group_Editors, sdxProgressChunk); + ProgressBarElements[True, True] := GetElementByName(Group_Editors, sdxProgressChunkVert); +end; + +procedure TdxSkinInfo.InitializeRadioGroupElements; +begin + RadioGroupButton := GetElementByName(Group_Editors, sdxRadioGroup); +end; + +procedure TdxSkinInfo.InitializeRibbonColors; + + function GetElementTextColor(AElement: TdxSkinElement): TColor; + begin + if AElement = nil then + Result := clDefault + else + Result := AElement.TextColor; + end; + +begin + RibbonExtraPaneColor := GetColorByName(Group_Ribbon, sdxRibbonExtraPaneColor); + + RibbonCaptionText[False] := GetElementColorProperty(RibbonFormCaption, sdxTextInactiveColor); + RibbonCaptionText[True] := GetElementTextColor(RibbonFormCaption); + RibbonTabText[True] := GetElementColorProperty(RibbonTab, sdxTextColorSelected); + RibbonTabText[False] := GetElementTextColor(RibbonTab); + RibbonDocumentNameTextColor[True] := GetElementColorProperty(RibbonFormCaption, + sdxRibbonDocumentNameTextColor); + RibbonDocumentNameTextColor[False] := RibbonCaptionText[False]; + + RibbonStatusBarText := GetElementColorProperty(RibbonStatusBarButton, + sdxTextColorNormal); + RibbonStatusBarTextHot := GetElementColorProperty(RibbonStatusBarButton, + sdxTextColorHot); + RibbonStatusBarTextDisabled := GetElementColorProperty(RibbonStatusBarButton, + sdxTextColorDisabled); + + RibbonButtonText[False] := GetElementTextColor(RibbonSmallButton); + RibbonButtonText[True] := GetElementColorProperty(Group_Ribbon, + sdxRibbonButtonDisabledText); +end; + +procedure TdxSkinInfo.InitializeRibbonElements; +begin + RibbonApplicationButton := GetElementByName(Group_Ribbon, sdxRibbonApplicationButton); + RibbonApplicationMenuBorders[False] := GetElementByName(Group_Ribbon, + sdxRibbonAppMenuHeaderBackground); + RibbonApplicationMenuBorders[True] := GetElementByName(Group_Ribbon, + sdxRibbonAppMenuFooterBackground); + RibbonCollapsedToolBarBackground := GetElementByName(Group_Ribbon, sdxRibbonCollapsedToolBarBackground); + RibbonCollapsedToolBarGlyphBackground := GetElementByName(Group_Ribbon, sdxRibbonCollapsedToolBarGlyphBackground); + RibbonFormCaption := GetElementByName(Group_Ribbon, sdxRibbonFormCaption); + RibbonFormBottom[False] := GetElementByName(Group_Ribbon, sdxRibbonFormBottom); + RibbonFormBottom[True] := GetElementByName(Group_Ribbon, sdxRibbonDialogFrameBottom); + RibbonFormLeft[False] := GetElementByName(Group_Ribbon, sdxRibbonFormFrameLeft); + RibbonFormLeft[True] := GetElementByName(Group_Ribbon, sdxRibbonDialogFrameLeft); + RibbonFormRight[False] := GetElementByName(Group_Ribbon, sdxRibbonFormFrameRight); + RibbonFormRight[True] := GetElementByName(Group_Ribbon, sdxRibbonDialogFrameRight); + RibbonTab := GetElementByName(Group_Ribbon, sdxRibbonTabHeaderPage); + RibbonTabPanel := GetElementByName(Group_Ribbon, sdxRibbonTabPanel); + RibbonTabPanelGroupButton := GetElementByName(Group_Ribbon, sdxRibbonTabPanelGroupButton); + RibbonTabGroup := GetElementByName(Group_Ribbon, sdxRibbonTabGroup); + RibbonTabGroupHeader := GetElementByName(Group_Ribbon, sdxRibbonTabGroupHeader); + RibbonGalleryBackground := GetElementByName(Group_Ribbon, sdxRibbonGalleryBackground); + RibbonGalleryButtonDown := GetElementByName(Group_Ribbon, sdxRibbonGalleryButtonDown); + RibbonGalleryButtonDropDown := GetElementByName(Group_Ribbon, sdxRibbonGalleryButtonDropDown); + RibbonGalleryButtonUp := GetElementByName(Group_Ribbon, sdxRibbonGalleryButtonUp); + RibbonGalleryGroupCaption := GetElementByName(Group_Ribbon, sdxRibbonGalleryGroupCaption); + RibbonGalleryPane := GetElementByName(Group_Ribbon, sdxRibbonGalleryPane); + RibbonGallerySizingPanel := GetElementByName(Group_Ribbon, sdxRibbonGallerySizingPanel); + RibbonGallerySizeGrips := GetElementByName(Group_Ribbon, sdxRibbonGallerySizeGrips); + RibbonHeaderBackground := GetElementByName(Group_Ribbon, sdxRibbonHeaderBackground); + RibbonSmallButton := GetElementByName(Group_Ribbon, sdxRibbonSmallButton); + RibbonSplitButtonLeft := GetElementByName(Group_Ribbon, sdxRibbonSplitButtonLeft); + RibbonSplitButtonRight := GetElementByName(Group_Ribbon, sdxRibbonSplitButtonRight); + + RibbonLargeButton := GetElementByName(Group_Ribbon, sdxRibbonLargeButton); + RibbonLargeSplitButtonTop := GetElementByName(Group_Ribbon, sdxRibbonLargeSplitButtonTop); + RibbonLargeSplitButtonBottom := GetElementByName(Group_Ribbon, sdxRibbonLargeSplitButtonBottom); + RibbonButtonArrow := GetElementByName(Group_Ribbon, sdxRibbonButtonArrow); + RibbonButtonGroup := GetElementByName(Group_Ribbon, sdxRibbonButtonGroup); + RibbonStatusBarBackground := GetElementByName(Group_Ribbon, sdxRibbonStatusBarBackground); + RibbonStatusBarButton := GetElementByName(Group_Ribbon, sdxRibbonStatusBarButton); + RibbonStatusBarSeparator := GetElementByName(Group_Ribbon, sdxRibbonStatusBarSeparator); + RibbonQuickToolbar[True] := GetElementByName(Group_Ribbon, sdxRibbonQuickToolbarInCaption); + RibbonQuickToolbar[False] := GetElementByName(Group_Ribbon, sdxRibbonQuickToolbarAbove); + RibbonQuickToolbarBelow := GetElementByName(Group_Ribbon, sdxRibbonQuickToolbarBelow); + RibbonQuickToolbarButtonGlyph := GetElementByName(Group_Ribbon, sdxRibbonQuickToolbarButtonGlyph); + RibbonQuickToolbarDropDown := GetElementByName(Group_Ribbon, sdxRibbonQuickToolbarDropDown); + RibbonQuickToolbarGlyph := GetElementByName(Group_Ribbon, sdxRibbonQuickToolbarGlyph); + RibbonButtonGroupButton := GetElementByName(Group_Ribbon, sdxRibbonButtonGroupButton); + RibbonButtonGroupSeparator := GetElementByName(Group_Ribbon, sdxRibbonButtonGroupSeparator); + + InitializeRibbonProperties; + InitializeRibbonColors; +end; + +procedure TdxSkinInfo.InitializeRibbonProperties; +var + AIndex: Boolean; +begin + for AIndex := False to True do + if RibbonQuickToolbar[AIndex] <> nil then + with RibbonQuickToolbar[AIndex] do + begin + RibbonQATCustomizeButtonOutsizeQAT[AIndex] := + GetPropertyByName(sdxRibbonQATCustomizeButtonOutsideQAT) as TdxSkinBooleanProperty; + RibbonQATIndentBeforeCustomizeButton[AIndex] := + GetPropertyByName(sdxRibbonQATIndentBeforeCustomizeItem) as TdxSkinIntegerProperty; + end; + + RibbonCaptionFontDelta := GetIntPropertyByName(RibbonFormCaption, sdxCaptionFontDelta); + if Group_Ribbon = nil then + FillChar(RibbonIndents, SizeOf(RibbonIndents), 0) + else + begin + RibbonIndents[0] := GetElementIntProperty(RibbonApplicationButton, + sdxRibbonAppButtonRightIndent); + RibbonIndents[1] := GetElementIntProperty(RibbonQuickToolbar[True], + sdxRibbonQuickAccessToolbarOffset); + RibbonIndents[2] := GetElementIntProperty(Group_Ribbon, sdxRibbonTabHeaderDownGrowIndent); + end; +end; + +procedure TdxSkinInfo.InitializeScrollBarElements; + + procedure SetInfo(AHorz: Boolean; APart: TcxScrollBarPart; + AElement: TdxSkinElement; AImageIndex: Integer = 0); + begin + FreeAndNil(ScrollBar_Elements[AHorz, APart]); + if Skin = nil then Exit; + ScrollBar_Elements[AHorz, APart] := TdxSkinScrollInfo.Create; + ScrollBar_Elements[AHorz, APart].Element := AElement; + ScrollBar_Elements[AHorz, APart].ImageIndex := AImageIndex; + end; + +var + AElement: TdxSkinElement; +begin + // buttons + AElement := GetElementByName(Group_Common, sdxScrollButton); + if FormContent <> nil then + AElement.Color := FormContent.Color; //todo: transparent elements bug + SetInfo(False, sbpLineUp, AElement); + SetInfo(False, sbpLineDown, AElement, 1); + SetInfo(True, sbpLineUp, AElement, 2); + SetInfo(True, sbpLineDown, AElement, 3); + // Thumbnail + SetInfo(False, sbpThumbnail, + GetElementByName(Group_Common, sdxScrollThumbButtonVert)); + SetInfo(True, sbpThumbnail, + GetElementByName(Group_Common, sdxScrollThumbButtonHorz)); + // Page + AElement := GetElementByName(Group_Common, sdxScrollContentVert); + SetInfo(False, sbpPageUp, AElement); + SetInfo(False, sbpPageDown, AElement); + AElement := GetElementByName(Group_Common, sdxScrollContentHorz); + SetInfo(True, sbpPageUp, AElement); + SetInfo(True, sbpPageDown, AElement); +end; + +procedure TdxSkinInfo.InitializeSchedulerElements; + + procedure HideElementUsage(AElement: TdxSkinElement); + begin + if AElement <> nil then + AElement.Tag := 0; + end; + +begin + SchedulerTimeGridHeader[False] := GetElementByName(Group_Scheduler, + sdxSchedulerTimeGridHeader); + SchedulerTimeGridHeader[True] := GetElementByName(Group_Scheduler, + sdxSchedulerTimeGridHeaderSelected); + SchedulerTimeLine := GetElementByName(Group_Scheduler, sdxSchedulerTimeLine); + SchedulerTimeRuler := GetElementByName(Group_Scheduler, sdxSchedulerTimeRuler); + SchedulerMoreButton := GetElementByName(Group_Scheduler, sdxSchedulerMoreButton); + SchedulerAppointment[False] := GetElementByName(Group_Scheduler, sdxSchedulerAppointmentRight); + SchedulerAppointment[True] := GetElementByName(Group_Scheduler, sdxSchedulerAppointment); + SchedulerAllDayArea[False] := GetElementByName(Group_Scheduler, sdxSchedulerAllDayArea); + SchedulerAllDayArea[True] := GetElementByName(Group_Scheduler, sdxSchedulerAllDayAreaSelected); + SchedulerCurrentTimeIndicator := GetElementByName(Group_Scheduler, + sdxSchedulerCurrentTimeIndicator); + SchedulerAppointmentShadow[False] := GetElementByName(Group_Scheduler, + sdxSchedulerAppointmentBottomShadow); + SchedulerAppointmentShadow[True] := GetElementByName(Group_Scheduler, + sdxSchedulerAppointmentRightShadow); + SchedulerAppointmentBorderSize := GetIntPropertyByName(SchedulerAppointment[True], + sdxSchedulerAppointmentBorderSize); + SchedulerAppointmentMask := GetElementByName(Group_Scheduler, sdxSchedulerAppointmentMask); + SchedulerAppointmentBorder := GetColorByName(SchedulerAppointment[True], + sdxSchedulerSeparatorColor); + SchedulerNavigationButtons[False] := GetElementByName(Group_Scheduler, sdxSchedulerNavButtonPrev); + SchedulerNavigationButtons[True] := GetElementByName(Group_Scheduler, sdxSchedulerNavButtonNext); + SchedulerNavigationButtonsArrow[False] := GetElementByName(Group_Scheduler, + sdxSchedulerNavButtonPrevArrow); + SchedulerNavigationButtonsArrow[True] := GetElementByName(Group_Scheduler, + sdxSchedulerNavButtonNextArrow); + + // TODO: Its a scheduler3 element - ACreateIfEmpty = False + SchedulerTimeGridCurrentTimeIndicator := GetElementByName(Group_Scheduler, + sdxSchedulerTimeGridCurrentTimeIndicator, False); +end; + +procedure TdxSkinInfo.InitializeSizeGripElements; +begin + SizeGrip := GetElementByName(Group_Common, sdxSizeGrip); +end; + +procedure TdxSkinInfo.InitializeSplitterElements; +begin + Splitter[False] := GetElementByName(Group_Common, sdxSplitterVert); + Splitter[True] := GetElementByName(Group_Common, sdxSplitterHorz); +end; + +procedure TdxSkinInfo.InitializeToolTipElements; +begin + ScreenTipWindow := GetElementByName(Group_Bars, sdxScreenTipWindow); + ScreenTipItem := GetColorByName(ScreenTipWindow, sdxScreenTipItem); + ScreenTipSeparator := GetElementByName(Group_Bars, sdxScreenTipSeparator); + ScreenTipTitleItem := GetColorByName(ScreenTipWindow, sdxScreenTipTitleItem); +end; + +procedure TdxSkinInfo.InitializeTrackBarElements; +begin + TrackBarTrack[True] := GetElementByName(Group_Editors, sdxTrackBarTrack); + TrackBarTrack[False] := GetElementByName(Group_Editors, sdxTrackBarTrackVert); + + TrackBarThumb[True, tbtaDown] := GetElementByName(Group_Editors, sdxTrackBarThumb); + TrackBarThumb[True, tbtaUp] := GetElementByName(Group_Editors, sdxTrackBarThumbUp); + TrackBarThumb[True, tbtaBoth] := GetElementByName(Group_Editors, sdxTrackBarThumbBoth); + + TrackBarThumb[False, tbtaDown] := GetElementByName(Group_Editors, sdxTrackBarThumbVert); + TrackBarThumb[False, tbtaUp] := GetElementByName(Group_Editors, sdxTrackBarThumbVertUp); + TrackBarThumb[False, tbtaBoth] := GetElementByName(Group_Editors, sdxTrackBarThumbVertBoth); +end; + +procedure TdxSkinInfo.InitializeSkinInfo; +begin + InitializeGroups; + InitializeBarElements; + InitializeFormElements; + InitializeDockControlElements; + InitializeButtonElements; + InitializeFooterElements; + InitializeCheckboxElements; + InitializeClockElements; + InitializeEditButtonElements; + InitializeGroupBoxElements; + InitializeGridElements; + InitializeIndicatorImages; + InitializeNavBarElements; + InitializeNavigatorElements; + InitializeSchedulerElements; + InitializeHeaderElements; + InitializeFilterElements; + InitializePageControlElements; + InitializeProgressBarElements; + InitializeRadioGroupElements; + InitializeScrollBarElements; + InitializeRibbonElements; + InitializeSizeGripElements; + InitializeSplitterElements; + InitializeTrackBarElements; + InitializeToolTipElements; + InitializeColors; +end; + +procedure TdxSkinInfo.FinalizeScrollBarElements; +var + AHorz: Boolean; + APart: TcxScrollBarPart; +begin + for AHorz := False to True do + for APart := Low(TcxScrollBarPart) to High(TcxScrollBarPart) do + FreeAndNil(ScrollBar_Elements[AHorz, APart]); +end; + +procedure TdxSkinInfo.FinalizeSkinInfo; +begin + FinalizeScrollBarElements; +end; + +function TdxSkinInfo.GetSkin: TdxSkin; +begin + Result := Skin; +end; + +procedure TdxSkinInfo.SkinChanged(Sender: TdxSkin); +begin + FinalizeSkinInfo; + InitializeSkinInfo; +end; + +procedure TdxSkinInfo.SetSkin(ASkin: TdxSkin); +begin + if ASkin <> Skin then + begin + if Skin <> nil then + begin + FinalizeSkinInfo; + Skin.RemoveListener(Self); + end; + FSkin := ASkin; + if Skin <> nil then + Skin.AddListener(Self); + InitializeSkinInfo; + end; +end; + +end. diff --git a/official/x.35/ExpressLibrary/Sources/dxSkinsCore.pas b/official/x.35/ExpressLibrary/Sources/dxSkinsCore.pas new file mode 100644 index 00000000..a2c33210 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/dxSkinsCore.pas @@ -0,0 +1,3145 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinsCore; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Windows, SysUtils, Classes, Graphics, Math, cxGraphics, cxGeometry, cxClasses, + cxLookAndFeels, dxGDIPlusApi, dxGDIPlusClasses, dxSkinsStrs, ActiveX, Forms, + dxOffice11; + +type + TdxSkinVersion = Double; + +const + dxSkinSignature = 'dxSkin'; + dxSkinStreamVersion: TdxSkinVersion = 1.02; + ImageNameSuffix = '_Image.png'; + GlyphNameSuffix = '_Glyph.png'; + BitmapNameSuffixes: array[Boolean] of string = (GlyphNameSuffix, ImageNameSuffix); +{$IFNDEF DELPHI6} + PathDelim = '\'; +{$ENDIF} + +type + TdxSkin = class; + TdxSkinClass = class of TdxSkin; + TdxSkinCustomPersistentObject = class; + TdxSkinCustomPersistentObjectClass = class of TdxSkinCustomPersistentObject; + TdxSkinPersistentClass = class of TdxSkinPersistent; + TdxSkinControlGroupClass = class of TdxSkinControlGroup; + TdxSkinElementClass = class of TdxSkinElement; + TdxSkinColor = class; + TdxSkinProperty = class; + TdxSkinPropertyClass = class of TdxSkinProperty; + TdxSkinControlGroup = class; + TdxSkinImage = class; + TdxSkinElement = class; + + EdxSkin = class(Exception); + + IdxSkinChangeListener = interface + ['{28681774-0475-43AE-8704-1C904D294742}'] + procedure SkinChanged(Sender: TdxSkin); + end; + + IdxSkinInfo = interface + ['{97D85495-E631-413C-8DBC-BE7B784A9EA0}'] + function GetSkin: TdxSkin; + end; + + { TdxSkinCustomPersistentObject } + + TdxSkinCustomPersistentObject = class(TPersistent) + private + FName: string; + FOwner: TPersistent; + FTag: Integer; + FOnChange: TNotifyEvent; + protected + procedure DoChange; virtual; + function GetOwner: TPersistent; override; + public + constructor Create(AOwner: TPersistent; const AName: string); virtual; + function Clone: TdxSkinCustomPersistentObject; virtual; + + property Tag: Integer read FTag write FTag; + published + property Name: string read FName write FName; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + end; + + { TdxSkinPersistent } + + TdxSkinPersistent = class(TdxSkinCustomPersistentObject) + private + FLockCount: Integer; + FModified: Boolean; + FProperties: TcxObjectList; + FSorted: Boolean; + function GetPropertyCount: Integer; + function GetProperty(Index: Integer): TdxSkinProperty; + procedure SetSorted(AValue: Boolean); + protected + procedure AddSubItem(AInstance: TdxSkinCustomPersistentObject; AList: TcxObjectList); + procedure Changed; virtual; + procedure DoSort; virtual; + procedure SubItemHandler(Sender: TObject); virtual; + procedure ReadProperties(AStream: TStream); + procedure WriteProperties(AStream: TStream); + + property LockCount: Integer read FLockCount write FLockCount; + property Sorted: Boolean read FSorted write SetSorted; + public + constructor Create(AOwner: TPersistent; const AName: string); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function AddProperty(const AName: string; + APropertyClass: TdxSkinPropertyClass): TdxSkinProperty; + procedure BeginUpdate; + procedure CancelUpdate; + procedure DeleteProperty(const AProperty: TdxSkinProperty); virtual; + procedure EndUpdate; + function GetPropertyByName(const AName: string): TdxSkinProperty; + procedure Sort; + + property Modified: Boolean read FModified write FModified; + property PropertyCount: Integer read GetPropertyCount; + property Properties[Index: Integer]: TdxSkinProperty read GetProperty; + end; + + { TdxSkin } + + TdxSkin = class(TdxSkinPersistent) + private + FColors: TcxObjectList; + FGroups: TcxObjectList; + FListeners: TInterfaceList; + FName: string; + FOnChange: TNotifyEvent; + FVersion: TdxSkinVersion; + function GetColor(Index: Integer): TdxSkinColor; + function GetColorCount: Integer; + function GetGroup(Index: Integer): TdxSkinControlGroup; + function GetGroupCount: Integer; + procedure SetName(const Value: string); + protected + procedure DoChange; override; + procedure DoSort; override; + procedure LoadFromResource(hInst: THandle); virtual; + procedure NotifyListeners; + + property Listeners: TInterfaceList read FListeners; + public + constructor Create(const AName: string; ALoadOnCreate: Boolean; hInst: THandle); reintroduce; virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function AddColor(const AName: string; const AColor: TColor): TdxSkinColor; + function AddGroup(const AName: string = ''): TdxSkinControlGroup; + procedure AddListener(AListener: IdxSkinChangeListener); + procedure Clear; + procedure ClearModified; + function Clone(const AName: string): TdxSkin; reintroduce; virtual; + procedure DeleteProperty(const AProperty: TdxSkinProperty); override; + function GetColorByName(const AName: string): TdxSkinColor; + function GetGroupByName(const AName: string): TdxSkinControlGroup; + procedure LoadFromStream(AStream: TStream); virtual; + procedure LoadFromFile(const AFileName: string); + procedure RemoveListener(AListener: IdxSkinChangeListener); + procedure SaveToFile(const AFileName: string); + procedure SaveToStream(AStream: TStream); virtual; + + property ColorCount: Integer read GetColorCount; + property Colors[Index: Integer]: TdxSkinColor read GetColor; + property GroupCount: Integer read GetGroupCount; + property Groups[Index: Integer]: TdxSkinControlGroup read GetGroup; + published + property Name: string read FName write SetName; + property Version: TdxSkinVersion read FVersion; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + end; + + { TdxSkinProperty } + + TdxSkinProperty = class(TdxSkinCustomPersistentObject) + protected + procedure ReadData(Stream: TStream); virtual; + procedure ReadFromStream(Stream: TStream); virtual; + procedure WriteData(Stream: TStream); virtual; + procedure WriteToStream(Stream: TStream); virtual; + public + class procedure Register; + class procedure Unregister; + class function Description: string; virtual; + function Compare(AProperty: TdxSkinProperty): Boolean; virtual; + end; + + TdxSkinGradientMode = (gmHorizontal, gmVertical, gmForwardDiagonal, + gmBackwardDiagonal); + + { TdxSkinCanvas } + + TdxSkinCanvas = class(TObject) + private + FBuffer: TcxBitmap; + FGraphics: GpGraphics; + FRect: TRect; + FSourceDC: HDC; + function GetInterpolationMode: Integer; + procedure SetInterpolationMode(AValue: Integer); + procedure FillRectByDiagonalGradient(const R: TRect; AColor1, AColor2: TColor; + AForward: Boolean); + public + function IsLowColors(DC: HDC): Boolean; + function IsRectVisible(DC: HDC; const R: TRect): Boolean; + procedure BeginPaint(DC: HDC; const R: TRect); + procedure BeginPaintEx(Graphics: GpGraphics; const R: TRect); + procedure DrawImage(AImage: TdxPNGImage; const ADest, ASource: TRect); + procedure EndPaint; overload; + procedure FillRectByColor(const R: TRect; AColor: TColor); + procedure FillRectByGradient(const R: TRect; AColor1, AColor2: TColor; + AMode: TdxSkinGradientMode); + procedure StretchDrawImage(AImage: TdxPNGImage; const ADest, ASource: TRect); + procedure TileImage(AImage: TdxPNGImage; const ADest, ASource: TRect); + // Properties + property Graphics: GpGraphics read FGraphics; + property InterpolationMode: Integer read GetInterpolationMode write SetInterpolationMode; + end; + + { TdxSkinIntegerProperty } + + TdxSkinIntegerProperty = class(TdxSkinProperty) + private + FValue: Integer; + procedure SetValue(AValue: Integer); + protected + procedure ReadData(Stream: TStream); override; + procedure WriteData(Stream: TStream); override; + public + procedure Assign(Source: TPersistent); override; + function Compare(AProperty: TdxSkinProperty): Boolean; override; + published + property Value: Integer read FValue write SetValue default 0; + end; + + { TdxSkinBooleanProperty } + + TdxSkinBooleanProperty = class(TdxSkinProperty) + private + FValue: Boolean; + procedure SetValue(AValue: Boolean); + protected + procedure ReadData(Stream: TStream); override; + procedure WriteData(Stream: TStream); override; + public + procedure Assign(Source: TPersistent); override; + function Compare(AProperty: TdxSkinProperty): Boolean; override; + published + property Value: Boolean read FValue write SetValue default False; + end; + + { TdxSkinColor } + + TdxSkinColor = class(TdxSkinProperty) + private + FValue: TColor; + procedure SetValue(AValue: TColor); + protected + procedure ReadData(Stream: TStream); override; + procedure WriteData(Stream: TStream); override; + public + constructor Create(AOwner: TPersistent; const AName: string); override; + procedure Assign(Source: TPersistent); override; + function Compare(AProperty: TdxSkinProperty): Boolean; override; + published + property Value: TColor read FValue write SetValue default clDefault; + end; + + { TdxSkinRectProperty } + + TdxSkinRectProperty = class(TdxSkinProperty) + private + FValue: TcxRect; + function GetValueByIndex(Index: Integer): Integer; + procedure SetValue(Value: TcxRect); + procedure SetValueByIndex(Index, Value: Integer); + procedure InternalHandler(Sender: TObject); + protected + procedure ReadData(Stream: TStream); override; + procedure WriteData(Stream: TStream); override; + public + constructor Create(AOwner: TPersistent; const AName: string); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function Compare(AProperty: TdxSkinProperty): Boolean; override; + + property Value: TcxRect read FValue write SetValue; + published + property Left: Integer index 0 read GetValueByIndex write SetValueByIndex default 0; + property Top: Integer index 1 read GetValueByIndex write SetValueByIndex default 0; + property Right: Integer index 2 read GetValueByIndex write SetValueByIndex default 0; + property Bottom: Integer index 3 read GetValueByIndex write SetValueByIndex default 0; + end; + + { TdxSkinSizeProperty } + + TdxSkinSizeProperty = class(TdxSkinProperty) + private + FValue: TSize; + procedure SetValue(const Value: TSize); + protected + procedure ReadData(Stream: TStream); override; + procedure WriteData(Stream: TStream); override; + public + procedure Assign(Source: TPersistent); override; + function Compare(AProperty: TdxSkinProperty): Boolean; override; + function GetValueByIndex(Index: Integer): Integer; + procedure SetValueByIndex(Index, Value: Integer); + + property Value: TSize read FValue write SetValue; + published + property cx: Integer index 0 read GetValueByIndex write SetValueByIndex default 0; + property cy: Integer index 1 read GetValueByIndex write SetValueByIndex default 0; + end; + + { TdxSkinBorder } + + TdxSkinBorder = class(TdxSkinProperty) + private + FColor: TColor; + FKind: TcxBorder; + FThin: Integer; + procedure SetColor(AValue: TColor); + procedure SetThin(AValue: Integer); + protected + procedure ReadData(Stream: TStream); override; + procedure WriteData(Stream: TStream); override; + public + constructor Create(AOwner: TPersistent; const AName: string); override; + procedure Assign(Source: TPersistent); override; + function Compare(AProperty: TdxSkinProperty): Boolean; override; + procedure Draw(DC: HDC; const ABounds: TRect); virtual; + procedure DrawEx(ACanvas: TdxSkinCanvas; const ABounds: TRect); virtual; + + property Kind: TcxBorder read FKind; + published + property Color: TColor read FColor write SetColor default clNone; + property Thin: Integer read FThin write SetThin default 1; + end; + + { TdxSkinBorders } + + TdxSkinBorders = class(TdxSkinProperty) + private + FBorders: array[TcxBorder] of TdxSkinBorder; + function GetBorder(ABorder: TcxBorder): TdxSkinBorder; + function GetBorderByIndex(Index: Integer): TdxSkinBorder; + procedure SetBorderByIndex(Index: Integer; AValue: TdxSkinBorder); + protected + procedure CreateBorders; + procedure DeleteBorders; + procedure SubItemHandler(Sender: TObject); virtual; + public + constructor Create(AOwner: TPersistent; const AName: string); override; + destructor Destroy; override; + procedure Assign(ASource: TPersistent); override; + function Compare(AProperty: TdxSkinProperty): Boolean; override; + + property Items[AKind: TcxBorder]: TdxSkinBorder read GetBorder; default; + published + property Left: TdxSkinBorder index 0 read GetBorderByIndex write SetBorderByIndex; + property Top: TdxSkinBorder index 1 read GetBorderByIndex write SetBorderByIndex; + property Right: TdxSkinBorder index 2 read GetBorderByIndex write SetBorderByIndex; + property Bottom: TdxSkinBorder index 3 read GetBorderByIndex write SetBorderByIndex; + end; + + { TdxSkinStringProperty } + + TdxSkinStringProperty = class(TdxSkinProperty) + private + FValue: string; + procedure SetValue(const AValue: string); + protected + procedure ReadData(Stream: TStream); override; + procedure WriteData(Stream: TStream); override; + public + procedure Assign(Source: TPersistent); override; + function Compare(AProperty: TdxSkinProperty): Boolean; override; + published + property Value: string read FValue write SetValue; + end; + + { TdxSkinControlGroup } + + TdxSkinControlGroup = class(TdxSkinPersistent) + private + FElements: TcxObjectList; + function GetCount: Integer; + function GetElement(AIndex: Integer): TdxSkinElement; + function GetSkin: TdxSkin; + procedure SetElement(AIndex: Integer; AElement: TdxSkinElement); + protected + procedure DoSort; override; + procedure ReadData(AStream: TStream; const AVersion: TdxSkinVersion); virtual; + procedure WriteData(AStream: TStream); virtual; + public + constructor Create(AOwner: TPersistent; const AName: string); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function AddElement(const AName: string): TdxSkinElement; + function AddElementEx(const AName: string; AElementClass: TdxSkinElementClass): TdxSkinElement; + procedure Clear; + procedure ClearModified; + procedure Delete(AIndex: Integer); + procedure RemoveElement(AElement: TdxSkinElement); + function GetElementByName(const AName: string): TdxSkinElement; + + property Count: Integer read GetCount; + property Elements[Index: Integer]: TdxSkinElement read GetElement write SetElement; + property Skin: TdxSkin read GetSkin; + end; + + { TdxSkinImage } + + TdxSkinElementState = (esNormal, esHot, esPressed, esDisabled, esActive, + esFocused, esDroppedDown, esChecked, esHotCheck, esActiveDisabled, + esCheckPressed); + + TdxSkinElementStates = set of TdxSkinElementState; + + TdxSkinImageLayout = (ilHorizontal, ilVertical); + TdxSkinStretchMode = (smStretch, smTile, smNoResize); + TdxSkinElementPartBounds = array[0..2, 0..2] of TRect; + TdxSkinElementPartVisibility = array[0..2, 0..2] of Boolean; + + TdxSkinImage = class(TPersistent) + private + FGradient: TdxSkinGradientMode; + FGradientBeginColor: TColor; + FGradientEndColor: TColor; + FImageLayout: TdxSkinImageLayout; + FIsDirty: Boolean; + FMargins: TcxRect; + FOnChange: TNotifyEvent; + FOwner: TdxSkinElement; + FPartSizing: TdxSkinElementPartVisibility; + FPartsVisibility: TdxSkinElementPartVisibility; + FSize: TSize; + FSourceName: string; + FStateBounds: array[TdxSkinElementState] of TRect; + FStateCount: Integer; + FStates: TdxSkinElementStates; + FStretch: TdxSkinStretchMode; + FTexture: TdxPNGImage; + FTransparentColor: TColor; + function GetEmpty: Boolean; + function GetImageCount: Integer; + function GetName: string; + function GetPartSizing(Col, Row: Integer): Boolean; + function GetPartVisible(Col, Row: Integer): Boolean; + function GetSize: TSize; + function GetSourceName: string; + function GetStateBounds(AImageIndex: Integer; AState: TdxSkinElementState): TRect; + function GetStateCount: Integer; + procedure SetGradientBeginColor(AValue: TColor); + procedure SetGradientEndColor(AValue: TColor); + procedure SetGradientMode(AValue: TdxSkinGradientMode); + procedure SetImageLayout(AValue: TdxSkinImageLayout); + procedure SetMargins(AValue: TcxRect); + procedure SetName(const AValue: string); + procedure SetStates(AValue: TdxSkinElementStates); + procedure SetStretch(AValue: TdxSkinStretchMode); + procedure SetTransparentColor(AValue: TColor); + procedure SubItemHandler(Sender: TObject); + protected + procedure CheckInfo; + procedure CheckState(var AState: TdxSkinElementState); + procedure DoChange; virtual; + procedure DoInitializeInfo; virtual; + procedure DrawPart(ACanvas: TdxSkinCanvas; const ADest, ASource: TRect; + APartSizing, AIsCenterPart: Boolean); virtual; + function GetOwner: TPersistent; override; + procedure InitializePartsInfo(const ABounds: TRect; var AParts; + var AVisibility; ACheckMargins: Boolean); + procedure ReadData(AStream: TStream); + procedure WriteData(AStream: TStream); + + property TransparentColor: TColor read FTransparentColor write SetTransparentColor; + property IsDirty: Boolean read FIsDirty write FIsDirty; + + property PartSizing[Col, Row: Integer]: Boolean read GetPartSizing; + property PartVisible[Col, Row: Integer]: Boolean read GetPartVisible; + public + constructor Create(AOwner: TdxSkinElement); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure Clear; + function Compare(AImage: TdxSkinImage): Boolean; virtual; + procedure Draw(DC: HDC; const ARect: TRect; AImageIndex: Integer = 0; + AState: TdxSkinElementState = esNormal); virtual; + procedure DrawEx(ACanvas: TdxSkinCanvas; const ARect: TRect; + AImageIndex: Integer = 0; AState: TdxSkinElementState = esNormal); virtual; + procedure GetBitmap(AImageIndex: Integer; AState: TdxSkinElementState; + ABitmap: TBitmap; ABkColor: TColor = clNone); + procedure LoadFromFile(const AFileName: string); + procedure SaveToFile(const AFileName: string); + procedure SetStateMapping(AStateOrder: array of TdxSkinElementState); + + property Empty: Boolean read GetEmpty; + property ImageCount: Integer read GetImageCount; + property Name: string read GetName write SetName; + property Owner: TdxSkinElement read FOwner; + property Size: TSize read GetSize; + property SourceName: string read GetSourceName; + property StateBounds[ImageIndex: Integer; State: TdxSkinElementState]: TRect read GetStateBounds; + property StateCount: Integer read GetStateCount; + property Texture: TdxPNGImage read FTexture; + published + property Gradient: TdxSkinGradientMode read FGradient write SetGradientMode default gmHorizontal; + property GradientBeginColor: TColor read FGradientBeginColor write SetGradientBeginColor default clNone; + property GradientEndColor: TColor read FGradientEndColor write SetGradientEndColor default clNone; + property ImageLayout: TdxSkinImageLayout read FImageLayout write SetImageLayout default ilHorizontal; + property Margins: TcxRect read FMargins write SetMargins; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + property States: TdxSkinElementStates read FStates write SetStates; + property Stretch: TdxSkinStretchMode read FStretch write SetStretch default smStretch; + end; + + { TdxSkinElement } + + TdxSkinElement = class(TdxSkinPersistent) + private + FAlpha: Byte; + FBorders: TdxSkinBorders; + FBrush: GpBrush; + FCanvas: TdxSkinCanvas; + FColor: TColor; + FContentOffset: TcxRect; + FGlyph: TdxSkinImage; + FImage: TdxSkinImage; + FImageCount: Integer; + FIsColorAssigned: Boolean; + FMinSize: TcxSize; + FTextColor: TColor; + function GetGroup: TdxSkinControlGroup; + function GetIsAlphaUsed: Boolean; + function GetPath: string; + function GetSize: TSize; + procedure SetAlpha(AValue: Byte); + procedure SetBorders(AValue: TdxSkinBorders); + procedure SetColor(AValue: TColor); + procedure SetContentOffset(AValue: TcxRect); + procedure SetGlyph(AValue: TdxSkinImage); + procedure SetImage(AValue: TdxSkinImage); + procedure SetImageCount(AValue: Integer); + procedure SetMinSize(AValue: TcxSize); + procedure SetTextColor(AValue: TColor); + protected + function CompareProperties(AElement: TdxSkinElement): Boolean; virtual; + function ExpandName(ABitmap: TdxSkinImage): string; virtual; + procedure FillBackgroundByColor(ACanvas: TdxSkinCanvas; const ARect: TRect); + procedure InternalDraw(ACanvas: TdxSkinCanvas; const ARect: TRect; + AImageIndex: Integer = 0; AState: TdxSkinElementState = esNormal); + procedure ReadData(AStream: TStream; AVersion: TdxSkinVersion); virtual; + procedure WriteData(AStream: TStream; AVersion: TdxSkinVersion); virtual; + property Brush: GpBrush read FBrush; + property Canvas: TdxSkinCanvas read FCanvas; + property IsColorAssigned: Boolean read FIsColorAssigned; + public + constructor Create(AOwner: TPersistent; const AName: string); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function Compare(AElement: TdxSkinElement): Boolean; virtual; + procedure Draw(DC: HDC; const ARect: TRect; AImageIndex: Integer = 0; + AState: TdxSkinElementState = esNormal); virtual; + procedure SetStateMapping(AStateOrder: array of TdxSkinElementState); + + property Group: TdxSkinControlGroup read GetGroup; + property IsAlphaUsed: Boolean read GetIsAlphaUsed; + property Path: string read GetPath; + property Size: TSize read GetSize; + published + property Color: TColor read FColor write SetColor default clDefault; + property Alpha: Byte read FAlpha write SetAlpha default 255; + property Borders: TdxSkinBorders read FBorders write SetBorders; + property ContentOffset: TcxRect read FContentOffset write SetContentOffset; + property Glyph: TdxSkinImage read FGlyph write SetGlyph; + property MinSize: TcxSize read FMinSize write SetMinSize; + property TextColor: TColor read FTextColor write SetTextColor default clDefault; + property Image: TdxSkinImage read FImage write SetImage; + property ImageCount: Integer read FImageCount write SetImageCount default 1; + end; + + { TdxSkinEmptyElement } + + TdxSkinEmptyElement = class(TdxSkinElement) + public + procedure Draw(DC: HDC; const ARect: TRect; AImageIndex: Integer = 0; + AState: TdxSkinElementState = esNormal); override; + end; + + { TdxSkinPartStream } + + TdxSkinPartStream = class(TStream) + private + FPosEnd: Longint; + FPosStart: Longint; + FSource: TStream; + protected + {$IFDEF DELPHI7} + function GetSize: Int64; override; + {$ENDIF} + public + constructor Create(ASource: TStream); virtual; + procedure Initialize(const APosStart, APosEnd: Longint); + procedure InitializeEx(ASource: TStream; const APosStart, APosEnd: Longint); + function Read(var Buffer; Count: Longint): Longint; override; + function Seek(Offset: Longint; Origin: Word): Longint; override; + function Write(const Buffer; Count: Longint): Longint; override; + + property PosEnd: Longint read FPosEnd; + property PosStart: Longint read FPosStart; + property Source: TStream read FSource; + end; + + { TdxSkinElementCache } + + TdxSkinElementCache = class(TObject) + private + FCache: GpBitmap; + FElement: TdxSkinElement; + FImageIndex: Integer; + FIsAlphaBlendUsed: Boolean; + FRect: TRect; + FState: TdxSkinElementState; + protected + procedure FreeCache; + procedure UpdateCache(const R: TRect; AState: TdxSkinElementState = esNormal; + AImageIndex: Integer = 0); + // Properties + property Element: TdxSkinElement read FElement; + public + destructor Destroy; override; + procedure CheckCacheState(AElement: TdxSkinElement; const R: TRect; + AState: TdxSkinElementState = esNormal; AImageIndex: Integer = 0); + procedure Draw(DC: HDC; const R: TRect); + end; + + { TdxSkinElementCacheList } + + TdxSkinElementCacheList = class(TcxObjectList) + private + FCacheListLimit: Integer; + procedure CheckListLimits; + function FindElementCache(AElement: TdxSkinElement; const R: TRect; + out AElementCache: TdxSkinElementCache): Boolean; + function GetElementCache(AIndex: Integer): TdxSkinElementCache; + public + constructor Create; + procedure DrawElement(DC: HDC; AElement: TdxSkinElement; const R: TRect; + AState: TdxSkinElementState = esNormal; AImageIndex: Integer = 0); + property CacheListLimit: Integer read FCacheListLimit write FCacheListLimit; + property ElementCache[Index: Integer]: TdxSkinElementCache read GetElementCache; + end; + +function dxSkinRegisteredPropertyTypes: TList; + +procedure dxSkinInvalidOperation(const AMessage: string); +procedure dxSkinCheck(ACondition: Boolean; const AMessage: string); +procedure dxSkinCheckVersion(AVersion: Double); +function dxSkinCheckSignature(AStream: TStream; out AVersion: TdxSkinVersion): Boolean; +function dxSkinCheckSkinElement(AElement: TdxSkinElement): TdxSkinElement; +procedure dxSkinWriteSignature(AStream: TStream); + +implementation + +const + dxSkinElementCacheListLimit = 8; + + PartSizing: array[0..2, 0..2] of Boolean = + ((False, True, False), + (True, True, True), + (False, True, False)); + +var + dxSkinEmptyElement: TdxSkinElement; + PartStream: TdxSkinPartStream; + RegisteredPropertyTypes: TList; + +type + TdxSkinARGBQuad = packed record + rgbRed: Byte; + rgbGreen: Byte; + rgbBlue: Byte; + Alpha: Byte; + end; + + TRect2Int = array[TcxBorder] of Integer; + +function ColorToARGB(AColor: TColor; Alpha: Byte = 255): Integer; +begin + with TRGBQUAD(ColorToRgb(AColor)) do + begin + TdxSkinARGBQuad(Result).Alpha := Alpha; + TdxSkinARGBQuad(Result).rgbRed := rgbRed; + TdxSkinARGBQuad(Result).rgbGreen := rgbGreen; + TdxSkinARGBQuad(Result).rgbBlue := rgbBlue; + end; +end; + +function ReadStringFromStream(AStream: TStream): string; +var + L: Integer; +begin + AStream.Read(L, SizeOf(L)); + SetLength(Result, L); + if L > 0 then + AStream.ReadBuffer(Result[1], L); +end; + +function ReadInteger(AStream: TStream): Integer; +begin + AStream.Read(Result, SizeOf(Result)); +end; + +procedure WriteStringToStream(AStream: TStream; const AValue: string); +var + L: Integer; +begin + L := Length(AValue); + AStream.Write(L, SizeOf(L)); + if L > 0 then + AStream.WriteBuffer(AValue[1], L); +end; + +procedure WriteInteger(AStream: TStream; const AValue: Integer); +begin + AStream.Write(AValue, SizeOf(AValue)); +end; + +function dxSkinRegisteredPropertyTypes: TList; +begin + Result := RegisteredPropertyTypes; +end; + +procedure dxSkinInvalidOperation(const AMessage: string); +begin + raise EdxSkin.Create(AMessage); +end; + +procedure dxSkinCheck(ACondition: Boolean; const AMessage: string); +begin + if not ACondition then + dxSkinInvalidOperation(AMessage); +end; + +procedure dxSkinCheckVersion(AVersion: Double); +begin + if AVersion < 1 then + raise EdxSkin.Create(sdxOldFormat); +end; + +function dxSkinCheckSignature(AStream: TStream; out AVersion: TdxSkinVersion): Boolean; +var + ASignature: array[0..Length(dxSkinSignature) - 1] of Char; +begin + AStream.Position := AStream.Position + SizeOf(Integer); + Result := AStream.Read(ASignature, Length(dxSkinSignature)) = Length(dxSkinSignature); + Result := Result and (ASignature = dxSkinSignature); + if Result then + AStream.ReadBuffer(AVersion, SizeOf(AVersion)); +end; + +function dxSkinCheckSkinElement(AElement: TdxSkinElement): TdxSkinElement; +begin + Result := AElement; + if Result = nil then + Result := dxSkinEmptyElement; +end; + +procedure dxSkinWriteSignature(AStream: TStream); +begin + WriteStringToStream(AStream, dxSkinSignature); + AStream.Write(dxSkinStreamVersion, SizeOf(dxSkinStreamVersion)); +end; + +function dxCompareByName(AItem1, AItem2: TdxSkinCustomPersistentObject): Integer; +begin + Result := AnsiCompareStr(AItem1.Name, AItem2.Name); +end; + +function FindItemByName(AItemsList: TcxObjectList; const AName: string): TObject; +var + L, H, AIndex, C: Integer; +begin + Result := nil; + L := 0; + H := AItemsList.Count - 1; + while L <= H do + begin + AIndex := (L + H) div 2; + C := AnsiCompareStr(TdxSkinCustomPersistentObject(AItemsList[AIndex]).Name, AName); + if C < 0 then + L := AIndex + 1 + else + begin + H := AIndex - 1; + if C = 0 then + begin + Result := TdxSkinCustomPersistentObject(AItemsList[AIndex]); + Break; + end + end; + end; +end; + +{ TdxSkinPersistent } + +constructor TdxSkinPersistent.Create( + AOwner: TPersistent; const AName: string); +begin + inherited Create(AOwner, AName); + FProperties := TcxObjectList.Create; +end; + +destructor TdxSkinPersistent.Destroy; +begin + FProperties.Free; + inherited Destroy; +end; + +procedure TdxSkinPersistent.Assign(Source: TPersistent); +var + I: Integer; +begin + BeginUpdate; + try + if Source is TdxSkinPersistent then + begin + for I := 0 to TdxSkinPersistent(Source).PropertyCount - 1 do + AddSubItem(TdxSkinPersistent(Source).Properties[I].Clone, FProperties); + end + else + inherited Assign(Source); + finally + EndUpdate; + end; +end; + +function TdxSkinPersistent.AddProperty( + const AName: string; APropertyClass: TdxSkinPropertyClass): TdxSkinProperty; +begin + Result := APropertyClass.Create(Self, AName); + AddSubItem(Result, FProperties); +end; + +procedure TdxSkinPersistent.BeginUpdate; +begin + Inc(FLockCount); +end; + +procedure TdxSkinPersistent.CancelUpdate; +begin + Dec(FLockCount); +end; + +procedure TdxSkinPersistent.DeleteProperty(const AProperty: TdxSkinProperty); +begin + if FProperties.Remove(AProperty) <> -1 then + begin + AProperty.Free; + Changed; + end; +end; + +procedure TdxSkinPersistent.EndUpdate; +begin + Dec(FLockCount); + if FLockCount = 0 then + Changed; +end; + +procedure TdxSkinPersistent.Sort; +begin + SetSorted(True); +end; + +procedure TdxSkinPersistent.AddSubItem( + AInstance: TdxSkinCustomPersistentObject; AList: TcxObjectList); +begin + AInstance.FOwner := Self; + AInstance.OnChange := SubItemHandler; + AList.Add(AInstance); + Changed; +end; + +procedure TdxSkinPersistent.Changed; +begin + Modified := True; + FSorted := False; + if LockCount = 0 then + DoChange; +end; + +procedure TdxSkinPersistent.DoSort; +begin + FProperties.Sort(TListSortCompare(@dxCompareByName)); +end; + +procedure TdxSkinPersistent.SubItemHandler(Sender: TObject); +begin + Changed; +end; + +procedure TdxSkinPersistent.ReadProperties(AStream: TStream); +var + I: Integer; + APropClass: TdxSkinPropertyClass; +begin + for I := 0 to ReadInteger(AStream) - 1 do + begin + APropClass := TdxSkinPropertyClass(FindClass(ReadStringFromStream(AStream))); + AddProperty(ReadStringFromStream(AStream), APropClass).ReadData(AStream); + end; +end; + +procedure TdxSkinPersistent.WriteProperties(AStream: TStream); +var + I: Integer; +begin + WriteInteger(AStream, PropertyCount); + for I := 0 to PropertyCount -1 do + Properties[I].WriteToStream(AStream); +end; + +function TdxSkinPersistent.GetPropertyByName(const AName: string): TdxSkinProperty; +begin + Sort; + Result := TdxSkinProperty(FindItemByName(FProperties, AName)); +end; + +function TdxSkinPersistent.GetPropertyCount: Integer; +begin + Result := FProperties.Count; +end; + +function TdxSkinPersistent.GetProperty(Index: Integer): TdxSkinProperty; +begin + Result := FProperties[Index] as TdxSkinProperty; +end; + +procedure TdxSkinPersistent.SetSorted(AValue: Boolean); +begin + if AValue <> FSorted then + begin + FSorted := AValue; + if AValue then + DoSort; + end; +end; + +{ TdxSkin } + +constructor TdxSkin.Create(const AName: string; + ALoadOnCreate: Boolean; hInst: THandle); +begin + inherited Create(nil, AName); + FListeners := TInterfaceList.Create; + FColors := TcxObjectList.Create; + FGroups := TcxObjectList.Create; + FVersion := dxSkinStreamVersion; + FName := AName; + if ALoadOnCreate then + LoadFromResource(hInst); +end; + +destructor TdxSkin.Destroy; +begin + FListeners.Free; + FColors.Free; + FGroups.Free; + inherited Destroy; +end; + +procedure TdxSkin.ClearModified; +var + I: Integer; +begin + FModified := False; + for I := 0 to GroupCount - 1 do + Groups[I].ClearModified; +end; + +function TdxSkin.Clone(const AName: string): TdxSkin; +var + AClass: TdxSkinClass; +begin + AClass := TdxSkinClass(ClassType); + Result := AClass.Create(Name, False, 0); + Result.Assign(Self); +end; + +procedure TdxSkin.Assign(Source: TPersistent); +var + I: Integer; +begin + BeginUpdate; + try + if Source is TdxSkin then + begin + // clone colors + for I := 0 to TdxSkin(Source).ColorCount - 1 do + AddSubItem(TdxSkin(Source).Colors[I].Clone, FColors); + for I := 0 to TdxSkin(Source).GroupCount - 1 do + AddSubItem(TdxSkin(Source).Groups[I].Clone, FGroups); + end; + inherited Assign(Source); + finally + EndUpdate; + end; +end; + +function TdxSkin.AddColor( + const AName: string; const AColor: TColor): TdxSkinColor; +begin + Result := TdxSkinColor.Create(Self, AName); + BeginUpdate; + try + AddSubItem(Result, FColors); + Result.Value := AColor; + finally + EndUpdate; + end; +end; + +function TdxSkin.AddGroup(const AName: string): TdxSkinControlGroup; +begin + Result := TdxSkinControlGroup.Create(Self, AName); + AddSubItem(Result, FGroups); +end; + +procedure TdxSkin.AddListener(AListener: IdxSkinChangeListener); +begin + Listeners.Add(AListener); +end; + +procedure TdxSkin.Clear; +begin + FGroups.Clear; + FColors.Clear; + FProperties.Clear; +end; + +function TdxSkin.GetColorByName(const AName: string): TdxSkinColor; +begin + Sort; + Result := TdxSkinColor(FindItemByName(FColors, AName)); +end; + +procedure TdxSkin.DeleteProperty(const AProperty: TdxSkinProperty); +begin + inherited DeleteProperty(AProperty); + if FColors.Remove(AProperty) <> -1 then + begin + AProperty.Free; + Changed; + end; +end; + +function TdxSkin.GetGroupByName(const AName: string): TdxSkinControlGroup; +begin + Sort; + Result := TdxSkinControlGroup(FindItemByName(FGroups, AName)); +end; + +procedure TdxSkin.LoadFromStream(AStream: TStream); +var + I: Integer; +begin + if not CheckGdiPlus then Exit; + if not dxSkinCheckSignature(AStream, FVersion) then + raise EdxSkin.Create(sdxSkinInvalidStreamFormat); + FName := ReadStringFromStream(AStream); + dxSkinCheckVersion(FVersion); + BeginUpdate; + try + Clear; + for I := 0 to ReadInteger(AStream) - 1 do + begin + if FVersion >= 0.92 then + ReadStringFromStream(AStream); + AddColor(ReadStringFromStream(AStream), ReadInteger(AStream)); + end; + ReadProperties(AStream); + for I := 0 to ReadInteger(AStream) - 1 do + AddGroup(ReadStringFromStream(AStream)).ReadData(AStream, Version); + finally + EndUpdate; + end; +end; + +procedure TdxSkin.LoadFromFile(const AFileName: string); +var + AStream: TStream; +begin + AStream := TFileStream.Create(AFileName, fmOpenRead or fmShareDenyNone); + try + LoadFromStream(AStream); + finally + AStream.Free + end; +end; + +procedure TdxSkin.RemoveListener(AListener: IdxSkinChangeListener); +begin + Listeners.Remove(AListener); +end; + +procedure TdxSkin.SaveToFile(const AFileName: string); +var + AStream: TStream; +begin + AStream := TFileStream.Create(AFileName, fmCreate); + try + SaveToStream(AStream); + finally + AStream.Free + end; +end; + +procedure TdxSkin.SaveToStream(AStream: TStream); +var + I: Integer; +begin + dxSkinWriteSignature(AStream); + WriteStringToStream(AStream, Name); + WriteInteger(AStream, ColorCount); + for I := 0 to ColorCount - 1 do + Colors[I].WriteToStream(AStream); + WriteProperties(AStream); + WriteInteger(AStream, GroupCount); + for I := 0 to GroupCount - 1 do + Groups[I].WriteData(AStream); +end; + + +procedure TdxSkin.DoChange; +begin + NotifyListeners; + if Assigned(FOnChange) then + FOnChange(Self); +end; + +procedure TdxSkin.DoSort; +begin + inherited DoSort; + FGroups.Sort(TListSortCompare(@dxCompareByName)); + FColors.Sort(TListSortCompare(@dxCompareByName)); +end; + +procedure TdxSkin.NotifyListeners; +var + I: Integer; +begin + Inc(FLockCount); + try + for I := 0 to Listeners.Count - 1 do + IdxSkinChangeListener(Listeners[I]).SkinChanged(Self); + finally + Dec(FLockCount); + end; +end; + +procedure TdxSkin.LoadFromResource(hInst: THandle); +var + AStream: TStream; +begin + AStream := TResourceStream.Create(hInst, Name, PChar(sdxResourceType)); + try + LoadFromStream(AStream); + finally + AStream.Free; + end; +end; + +function TdxSkin.GetColor(Index: Integer): TdxSkinColor; +begin + Result := FColors[Index] as TdxSkinColor; +end; + +function TdxSkin.GetColorCount: Integer; +begin + Result := FColors.Count; +end; + +function TdxSkin.GetGroup(Index: Integer): TdxSkinControlGroup; +begin + Result := FGroups[Index] as TdxSkinControlGroup; +end; + +function TdxSkin.GetGroupCount: Integer; +begin + Result := FGroups.Count; +end; + +procedure TdxSkin.SetName(const Value: string); +begin + FName := Value; +end; + +{ TdxSkinImage } + +constructor TdxSkinImage.Create(AOwner: TdxSkinElement); +begin + FOwner := AOwner; + FTexture := TdxPNGImage.Create(); + FMargins := TcxRect.Create(Self); + FMargins.OnChange := SubItemHandler; + FGradientBeginColor := clNone; + FGradientEndColor := clNone; + FGradient := gmHorizontal; + FTransparentColor := clNone; +end; + +destructor TdxSkinImage.Destroy; +begin + FMargins.Free; + FTexture.Free; + inherited Destroy; +end; + +procedure TdxSkinImage.Assign(Source: TPersistent); +begin + if not (Source is TdxSkinImage) then Exit; + if TdxSkinImage(Source).Empty then + Clear + else + begin + Texture.Assign(TdxSkinImage(Source).Texture); + FSourceName := TdxSkinImage(Source).SourceName; + FIsDirty := True; + end; + GradientBeginColor := TdxSkinImage(Source).GradientBeginColor; + GradientEndColor := TdxSkinImage(Source).GradientEndColor; + Gradient := TdxSkinImage(Source).Gradient; + ImageLayout := TdxSkinImage(Source).ImageLayout; + Margins.Assign(TdxSkinImage(Source).Margins); + States := TdxSkinImage(Source).States; + Stretch := TdxSkinImage(Source).Stretch; +end; + +procedure TdxSkinImage.Clear; +begin + Texture.Handle := nil; + FSourceName := ''; + DoChange; +end; + +procedure TdxSkinImage.GetBitmap(AImageIndex: Integer; + AState: TdxSkinElementState; ABitmap: TBitmap; ABkColor: TColor = clNone); +begin + ABitmap.FreeImage; + ABitmap.Width := Size.cx; + ABitmap.Height := Size.cy; + if ABkColor <> clNone then + begin + if ABkColor <> clDefault then + ABitmap.Canvas.Brush.Color := ABkColor; + ABitmap.Canvas.FillRect(Rect(0, 0, Size.cx, Size.cy)); + end; + Draw(ABitmap.Canvas.Handle, Rect(0, 0, Size.cx, Size.cy), AImageIndex, AState); +end; + +procedure TdxSkinImage.LoadFromFile(const AFileName: string); +var + AFile : TFileStream; +begin + FSourceName := AFileName; + AFile := TFileStream.Create(AFileName, fmOpenRead or fmShareDenyNone); + try + Texture.LoadFromStream(AFile); + finally + AFile.Free; + end; + DoChange; +end; + +procedure TdxSkinImage.SaveToFile(const AFileName: string); +begin + if Empty then Exit; + Texture.SaveToFile(ChangeFileExt(AFileName, '.png')); + DoChange; +end; + +procedure TdxSkinImage.SetStateMapping(AStateOrder: array of TdxSkinElementState); +var + ASrc: TRect; + ASize: TSize; + ABitmap: TBitmap; + AIndex, AImageIndex: Integer; +begin + if Texture.Empty then Exit; + ABitmap := Texture.GetAsBitmap; + try + ASize := Size; + ASrc := Rect(0, 0, ASize.cx, ASize.cy); + if ImageLayout = ilHorizontal then + ASize.cy := 0 + else + ASize.cx := 0; + for AImageIndex := 0 to ImageCount - 1 do + for AIndex := Low(AStateOrder) to High(AStateOrder) do + begin + if not (AStateOrder[AIndex] in States) then Continue; + Texture.StretchDraw(ABitmap.Canvas.Handle, + StateBounds[AImageIndex, AStateOrder[AIndex]], ASrc); + OffsetRect(ASrc, ASize.cx, ASize.cy); + end; + Texture.SetBitmap(ABitmap); + finally + ABitmap.Free; + end; +end; + +procedure TdxSkinImage.CheckInfo; +begin + if not IsDirty then Exit; + IsDirty := False; + DoInitializeInfo; +end; + +procedure TdxSkinImage.CheckState(var AState: TdxSkinElementState); +var + AFirstState: TdxSkinElementState; +begin + if not (AState in FStates) then + for AFirstState := Low(TdxSKinElementState) to High(TdxSKinElementState) do + if AFirstState in FStates then + begin + AState := AFirstState; + Break; + end; +end; + +function TdxSkinImage.Compare(AImage: TdxSkinImage): Boolean; +begin + Result := (AImage.ImageLayout = ImageLayout) and (AImage.Empty = Empty) and + (AImage.States = States) and (AImage.Gradient = Gradient) and + (AImage.GradientBeginColor = GradientBeginColor) and + (AImage.GradientEndColor = GradientEndColor) and (AImage.Stretch = Stretch) and + (AImage.Size.cx = Size.cx) and (AImage.Size.cy = Size.cy) and + AImage.Margins.IsEqual(Margins.Rect) and Texture.Compare(AImage.Texture); +end; + +procedure TdxSkinImage.Draw(DC: HDC; const ARect: TRect; + AImageIndex: Integer = 0; AState: TdxSkinElementState = esNormal); +var + ACanvas: TdxSkinCanvas; +begin + CheckInfo; + if (FSize.cx <= 0) or (FSize.cy <= 0) or IsRectEmpty(ARect) or not RectVisible(DC, ARect) then Exit; + ACanvas := TdxSkinCanvas.Create; + try + ACanvas.BeginPaint(DC, ARect); + DrawEx(ACanvas, ARect, AImageIndex, AState); + ACanvas.EndPaint; + finally + ACanvas.Free; + end; +end; + +procedure TdxSkinImage.DrawEx(ACanvas: TdxSkinCanvas; const ARect: TRect; + AImageIndex: Integer = 0; AState: TdxSkinElementState = esNormal); +var + ACol, ARow: Integer; + AVisibility: TdxSkinElementPartVisibility; + DestParts, SourceParts: TdxSkinElementPartBounds; +begin + if Empty then Exit; + CheckInfo; + CheckState(AState); + if Stretch = smNoResize then + ACanvas.DrawImage(Texture, cxRectCenter(ARect, Size), StateBounds[AImageIndex, AState]) + else + begin + FillChar(AVisibility, SizeOf(AVisibility), 1); + InitializePartsInfo(StateBounds[AImageIndex, AState], SourceParts, AVisibility, False); + InitializePartsInfo(ARect, DestParts, AVisibility, True); + for ARow := 0 to 2 do + for ACol := 0 to 2 do + if AVisibility[ACol, ARow] then + begin + DrawPart(ACanvas, DestParts[ACol, ARow], SourceParts[ACol, ARow], + PartSizing[ACol, ARow], (ACol = 1) and (ARow = 1)); + end; + end; +end; + +procedure TdxSkinImage.DrawPart(ACanvas: TdxSkinCanvas; const ADest: TRect; + const ASource: TRect; APartSizing, AIsCenterPart: Boolean); +begin + if (GradientBeginColor <> clNone) and AIsCenterPart then + ACanvas.FillRectByGradient(ADest, GradientBeginColor, GradientEndColor, Gradient) + else + if not APartSizing then + ACanvas.DrawImage(Texture, ADest, ASource) + else + if Stretch = smTile then + ACanvas.TileImage(Texture, ADest, ASource) + else + ACanvas.StretchDrawImage(Texture, ADest, ASource); +end; + +procedure TdxSkinImage.DoChange; +begin + IsDirty := True; + if Assigned(FOnChange) then + FOnChange(Self); +end; + +procedure TdxSkinImage.DoInitializeInfo; +var + AState: TdxSkinElementState; + AParts: TdxSkinElementPartBounds; + AStateIndices: array[TdxSkinElementState] of Byte; +begin + FStateCount := 0; + FillChar(AStateIndices, SizeOf(AStateIndices), 0); + for AState := Low(TdxSkinElementState) to High(TdxSkinElementState) do + if AState in States then + begin + AStateIndices[AState] := FStateCount; + Inc(FStateCount); + end; + FSize := cxSize(Texture.Width, Texture.Height); + if StateCount > 0 then + begin + if ImageLayout = ilHorizontal then + FSize.cx := FSize.cx div ImageCount div StateCount + else + FSize.cy := FSize.cy div ImageCount div StateCount; + end; + for AState := Low(TdxSkinElementState) to High(TdxSkinElementState) do + begin + if ImageLayout = ilHorizontal then + FStateBounds[AState] := Rect(AStateIndices[AState] * FSize.cx, + 0, (AStateIndices[AState] + 1) * FSize.cx, FSize.cy) + else + FStateBounds[AState] := Rect(0, AStateIndices[AState] * FSize.cy, + FSize.cx, (AStateIndices[AState] + 1) * FSize.cy) + end; + InitializePartsInfo(Rect(0, 0, FSize.cx, FSize.cy), AParts, FPartsVisibility, False); +end; + +function TdxSkinImage.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +procedure TdxSkinImage.InitializePartsInfo(const ABounds: TRect; + var AParts; var AVisibility; ACheckMargins: Boolean); + + procedure MakePart(const ALeft, ATop, ARight, ABottom: Integer; + var ARect: TRect; var AVisible: Boolean); + begin + if not AVisible then Exit; + ARect.Left := ALeft; + ARect.Top := ATop; + ARect.Right := ARight; + ARect.Bottom := ABottom; + AVisible := (ALeft < ARight) and (ATop < ABottom); + end; + + procedure DoCheckMargins(var AMargins: TRect); + var + ASize, ADelta, I: Integer; + begin + if ACheckMargins then + begin + ASize := AMargins.Left + AMargins.Right; + ADelta := ASize - cxRectWidth(ABounds); + if ADelta > 0 then + begin + for I := 0 to 2 do + begin + FPartSizing[0, I] := True; + FPartSizing[2, I] := True; + end; + Dec(AMargins.Left, MulDiv(AMargins.Left, ADelta, ASize)); + Dec(AMargins.Right, MulDiv(AMargins.Right, ADelta, ASize)); + end; + ASize := AMargins.Top + AMargins.Bottom; + ADelta := ASize - cxRectHeight(ABounds); + if ADelta > 0 then + begin + Dec(AMargins.Top, MulDiv(AMargins.Top, ADelta, ASize)); + Dec(AMargins.Bottom, MulDiv(AMargins.Bottom, ADelta, ASize)); + for I := 0 to 2 do + begin + FPartSizing[I, 0] := True; + FPartSizing[I, 2] := True; + end; + end; + end; + end; + +var + AMargins, R: TRect; +begin + AMargins := Margins.Rect; + // stretch margins + Move(dxSkinsCore.PartSizing, FPartSizing, SizeOf(FPartSizing)); + DoCheckMargins(AMargins); + // + with AMargins do + begin + R := cxRect(ABounds.Left + Left, ABounds.Top + Top, + ABounds.Right - Right, ABounds.Bottom - Bottom); + // check horizontal bounds + if R.Left > ABounds.Right then + R.Left := ABounds.Right; + if R.Left > R.Right then + R.Right := R.Left; + if R.Right > ABounds.Right then + R.Right := ABounds.Right; + // check vertical bounds + if R.Top > ABounds.Bottom then + R.Top := ABounds.Bottom; + if R.Top > R.Bottom then + R.Bottom := R.Top; + if R.Bottom > ABounds.Bottom then + R.Bottom := ABounds.Bottom; + end; + // top line + MakePart(ABounds.Left, ABounds.Top, R.Left, R.Top, + TdxSkinElementPartBounds(AParts)[0, 0], + TdxSkinElementPartVisibility(AVisibility)[0, 0]); + MakePart(R.Left, ABounds.Top, R.Right, R.Top, + TdxSkinElementPartBounds(AParts)[1, 0], + TdxSkinElementPartVisibility(AVisibility)[1, 0]); + MakePart(R.Right, ABounds.Top, ABounds.Right, R. + Top, TdxSkinElementPartBounds(AParts)[2, 0], + TdxSkinElementPartVisibility(AVisibility)[2, 0]); + // middle line + MakePart(ABounds.Left, R.Top, R.Left, R.Bottom, + TdxSkinElementPartBounds(AParts)[0, 1], + TdxSkinElementPartVisibility(AVisibility)[0, 1]); + MakePart(R.Left, R.Top, R.Right, R.Bottom, + TdxSkinElementPartBounds(AParts)[1, 1], + TdxSkinElementPartVisibility(AVisibility)[1, 1]); + MakePart(R.Right, R.Top, ABounds.Right, R.Bottom, + TdxSkinElementPartBounds(AParts)[2, 1], + TdxSkinElementPartVisibility(AVisibility)[2, 1]); + // bottom line + MakePart(ABounds.Left, R.Bottom, R.Left, ABounds.Bottom, + TdxSkinElementPartBounds(AParts)[0, 2], + TdxSkinElementPartVisibility(AVisibility)[0, 2]); + MakePart(R.Left, R.Bottom, R.Right, ABounds.Bottom, + TdxSkinElementPartBounds(AParts)[1, 2], + TdxSkinElementPartVisibility(AVisibility)[1, 2]); + MakePart(R.Right, R.Bottom, ABounds.Right, ABounds.Bottom, + TdxSkinElementPartBounds(AParts)[2, 2], + TdxSkinElementPartVisibility(AVisibility)[2, 2]); +end; + +function TdxSkinImage.GetEmpty: Boolean; +begin + Result := (FSourceName = '') and Texture.Empty; +end; + +function TdxSkinImage.GetImageCount: Integer; +begin + Result := Owner.ImageCount; +end; + +function TdxSkinImage.GetName: string; +begin + if not Empty then + Result := Owner.ExpandName(Self) + else + Result := ''; +end; + +function TdxSkinImage.GetPartSizing(Col, Row: Integer): Boolean; +begin + Result := FPartSizing[Col, Row]; +end; + +function TdxSkinImage.GetPartVisible(Col, Row: Integer): Boolean; +begin + Result := FPartsVisibility[Col, Row]; +end; + +function TdxSkinImage.GetSize: TSize; +begin + CheckInfo; + Result := FSize; +end; + +function TdxSkinImage.GetSourceName: string; +begin + Result := FSourceName; + if (Result = '') and not Empty then + Result := Owner.Path + Name; +end; + +function TdxSkinImage.GetStateBounds( + AImageIndex: Integer; AState: TdxSkinElementState): TRect; +begin + CheckInfo; + Result := FStateBounds[AState]; + if AImageIndex > 0 then + begin + if ImageLayout = ilHorizontal then + OffsetRect(Result, StateCount * AImageIndex * Size.cx, 0) + else + OffsetRect(Result, 0, StateCount * AImageIndex * Size.cy) + end; +end; + +function TdxSkinImage.GetStateCount: Integer; +begin + CheckInfo; + Result := FStateCount; +end; + +procedure TdxSkinImage.ReadData(AStream: TStream); +var + APos, ASize: Integer; +begin + AStream.Read(FMargins.Data^, SizeOf(TRect)); + AStream.Read(FImageLayout, SizeOf(TdxSkinImageLayout)); + AStream.Read(FStates, SizeOf(TdxSkinElementStates)); + AStream.Read(FStretch, SizeOf(FStretch)); + if Owner.Group.Skin.Version >= 1.02 then + begin + AStream.Read(FGradientBeginColor, SizeOf(FGradientBeginColor)); + AStream.Read(FGradientEndColor, SizeOf(FGradientEndColor)); + AStream.Read(FGradient, SizeOf(FGradient)); + end; + AStream.Read(ASize, SizeOf(Integer)); + APos := AStream.Position; + if ASize > 0 then + begin + PartStream.InitializeEx(AStream, AStream.Position, AStream.Position + ASize); + Texture.LoadFromStream(PartStream); + end; + AStream.Position := APos + ASize; + IsDirty := True; +end; + +procedure TdxSkinImage.WriteData(AStream: TStream); +var + ASize: Integer; + APNGStream: TMemoryStream; +begin + AStream.Write(Margins.Data^, SizeOf(TRect)); + AStream.Write(FImageLayout, SizeOf(TdxSkinImageLayout)); + AStream.Write(FStates, SizeOf(TdxSkinElementStates)); + AStream.Write(FStretch, SizeOf(FStretch)); + AStream.Write(FGradientBeginColor, SizeOf(FGradientBeginColor)); + AStream.Write(FGradientEndColor, SizeOf(FGradientEndColor)); + AStream.Write(FGradient, SizeOf(FGradient)); + APNGStream := TMemoryStream.Create; + try + if not Empty then + Texture.SaveToStream(APNGStream); + ASize := APNGStream.Size; + AStream.Write(ASize, SizeOf(Integer)); + if ASize > 0 then + begin + APNGStream.Position := 0; + AStream.Write(APNGStream.Memory^, APNGStream.Size); + end; + finally + APNGStream.Free; + end; +end; + +procedure TdxSkinImage.SetGradientBeginColor(AValue: TColor); +begin + if AValue <> FGradientBeginColor then + begin + FGradientBeginColor := AValue; + DoChange; + end; +end; + +procedure TdxSkinImage.SetGradientEndColor(AValue: TColor); +begin + if AValue <> GradientEndColor then + begin + FGradientEndColor := AValue; + DoChange; + end; +end; + +procedure TdxSkinImage.SetGradientMode(AValue: TdxSkinGradientMode); +begin + if AValue <> FGradient then + begin + FGradient := AValue; + DoChange; + end; +end; + +procedure TdxSkinImage.SetImageLayout(AValue: TdxSkinImageLayout); +begin + if ImageLayout <> AValue then + begin + FImageLayout := AValue; + DoChange; + end; +end; + +procedure TdxSkinImage.SetMargins(AValue: TcxRect); +begin + FMargins.Assign(AValue); +end; + +procedure TdxSkinImage.SetStates(AValue: TdxSkinElementStates); +begin + if FStates <> AValue then + begin + FStates := AValue; + DoChange; + end; +end; + +procedure TdxSkinImage.SetStretch(AValue: TdxSkinStretchMode); +begin + if Stretch <> AValue then + begin + FStretch := AValue; + DoChange; + end; +end; + +procedure TdxSkinImage.SetTransparentColor(AValue: TColor); +begin + if AValue <> TransparentColor then + begin + FTransparentColor := AValue; + DoChange; + end; +end; + +procedure TdxSkinImage.SetName(const AValue: string); +begin + LoadFromFile(AValue); +end; + +procedure TdxSkinImage.SubItemHandler(Sender: TObject); +begin + DoChange; +end; + +{ TdxSkinCustomPersistentObject } + +constructor TdxSkinCustomPersistentObject.Create( + AOwner: TPersistent; const AName: string); +begin + FName := AName; + FOwner := AOwner; +end; + +function TdxSkinCustomPersistentObject.Clone: TdxSkinCustomPersistentObject; +var + AClass: TdxSkinCustomPersistentObjectClass; +begin + AClass := TdxSkinCustomPersistentObjectClass(ClassType); + Result := AClass.Create(nil, Name); + Result.Assign(Self); +end; + +procedure TdxSkinCustomPersistentObject.DoChange; +begin + if Assigned(FOnChange) then + FOnChange(Self); +end; + +function TdxSkinCustomPersistentObject.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +{ TdxSkinProperty } + +class procedure TdxSkinProperty.Register; +begin + RegisteredPropertyTypes.Add(Self); + RegisterClass(Self); +end; + +class procedure TdxSkinProperty.Unregister; +begin + UnRegisterClass(Self); + RegisteredPropertyTypes.Remove(Self); +end; + +class function TdxSkinProperty.Description: string; +begin + Result := StringReplace(ClassName, + 'TdxSkin', '', [rfReplaceAll, rfIgnoreCase]); + Result := StringReplace(Result, 'Property', '', [rfReplaceAll, rfIgnoreCase]); +end; + +function TdxSkinProperty.Compare(AProperty: TdxSkinProperty): Boolean; +begin + Result := False; +end; + +procedure TdxSkinProperty.ReadData(Stream: TStream); +begin +end; + +procedure TdxSkinProperty.ReadFromStream(Stream: TStream); +begin + Name := ReadStringFromStream(Stream); + ReadData(Stream); +end; + +procedure TdxSkinProperty.WriteData(Stream: TStream); +begin +end; + +procedure TdxSkinProperty.WriteToStream(Stream: TStream); +begin + WriteStringToStream(Stream, ClassName); + WriteStringToStream(Stream, Name); + WriteData(Stream); +end; + +{ TdxSkinIntegerProperty } + +procedure TdxSkinIntegerProperty.Assign(Source: TPersistent); +begin + if Source is TdxSkinIntegerProperty then + Value := TdxSkinIntegerProperty(Source).Value + else + inherited Assign(Source); +end; + +function TdxSkinIntegerProperty.Compare(AProperty: TdxSkinProperty): Boolean; +begin + Result := (AProperty.Name = Name) and (AProperty is TdxSkinIntegerProperty) and + (TdxSkinIntegerProperty(AProperty).Value = Value); +end; + +procedure TdxSkinIntegerProperty.ReadData(Stream: TStream); +begin + Stream.ReadBuffer(FValue, SizeOf(FValue)); +end; + +procedure TdxSkinIntegerProperty.WriteData(Stream: TStream); +begin + Stream.WriteBuffer(FValue, SizeOf(FValue)); +end; + +procedure TdxSkinIntegerProperty.SetValue(AValue: Integer); +begin + if AValue <> FValue then + begin + FValue := AValue; + DoChange; + end; +end; + +{ TdxSkinBooleanProperty } + +procedure TdxSkinBooleanProperty.Assign(Source: TPersistent); +begin + if Source is TdxSkinBooleanProperty then + Value := TdxSkinBooleanProperty(Source).Value + else + inherited Assign(Source); +end; + +function TdxSkinBooleanProperty.Compare(AProperty: TdxSkinProperty): Boolean; +begin + Result := (AProperty.Name = Name) and (AProperty is TdxSkinBooleanProperty) and + (TdxSkinBooleanProperty(AProperty).Value = Value) +end; + +procedure TdxSkinBooleanProperty.ReadData(Stream: TStream); +begin + Stream.ReadBuffer(FValue, SizeOf(FValue)); +end; + +procedure TdxSkinBooleanProperty.WriteData(Stream: TStream); +begin + Stream.WriteBuffer(FValue, SizeOf(FValue)); +end; + +procedure TdxSkinBooleanProperty.SetValue(AValue: Boolean); +begin + if AValue <> FValue then + begin + FValue := AValue; + DoChange; + end; +end; + +{ TdxSkinColor } + +constructor TdxSkinColor.Create(AOwner: TPersistent; const AName: string); +begin + inherited Create(AOwner, AName); + FValue := clDefault; +end; + +procedure TdxSkinColor.Assign(Source: TPersistent); +begin + if Source is TdxSkinColor then + Value := TdxSkinColor(Source).Value + else + inherited Assign(Source); +end; + +function TdxSkinColor.Compare(AProperty: TdxSkinProperty): Boolean; +begin + Result := (AProperty.Name = Name) and (AProperty is TdxSkinColor) and + (TdxSkinColor(AProperty).Value = Value); +end; + +procedure TdxSkinColor.ReadData(Stream: TStream); +begin + Stream.ReadBuffer(FValue, SizeOf(FValue)); +end; + +procedure TdxSkinColor.WriteData(Stream: TStream); +begin + Stream.WriteBuffer(FValue, SizeOf(FValue)); +end; + +procedure TdxSkinColor.SetValue(AValue: TColor); +begin + if AValue <> FValue then + begin + FValue := AValue; + DoChange; + end; +end; + +{ TdxSkinRectProperty } + +constructor TdxSkinRectProperty.Create(AOwner: TPersistent; const AName: string); +begin + inherited Create(AOwner, AName); + FValue := TcxRect.Create(Self); + FValue.OnChange := InternalHandler; +end; + +destructor TdxSkinRectProperty.Destroy; +begin + FValue.Free; + inherited Destroy; +end; + +procedure TdxSkinRectProperty.Assign(Source: TPersistent); +begin + if Source is TdxSkinRectProperty then + Value := TdxSkinRectProperty(Source).Value + else + inherited Assign(Source); +end; + +function TdxSkinRectProperty.Compare(AProperty: TdxSkinProperty): Boolean; +begin + Result := (AProperty.Name = Name) and (AProperty is TdxSkinRectProperty) and + TdxSkinRectProperty(AProperty).Value.IsEqual(Value); +end; + +procedure TdxSkinRectProperty.ReadData(Stream: TStream); +var + ARect: TRect; +begin + Stream.ReadBuffer(ARect, SizeOf(TRect)); + FValue.Rect := ARect; +end; + +procedure TdxSkinRectProperty.WriteData(Stream: TStream); +begin + Stream.WriteBuffer(FValue.Rect, SizeOf(TRect)); +end; + +function TdxSkinRectProperty.GetValueByIndex(Index: Integer): Integer; +begin + Result := FValue.GetValue(Index); +end; + +procedure TdxSkinRectProperty.SetValue(Value: TcxRect); +begin + FValue.Assign(Value); +end; + +procedure TdxSkinRectProperty.SetValueByIndex(Index, Value: Integer); +begin + FValue.SetValue(Index, Value); +end; + +procedure TdxSkinRectProperty.InternalHandler(Sender: TObject); +begin + DoChange; +end; + +{ TdxSkinSizeProperty } + +procedure TdxSkinSizeProperty.Assign(Source: TPersistent); +begin + if Source is TdxSkinSizeProperty then + Value := TdxSkinSizeProperty(Source).Value + else + inherited Assign(Source); +end; + +function TdxSkinSizeProperty.Compare(AProperty: TdxSkinProperty): Boolean; +begin + Result := (AProperty.Name = Name) and (AProperty is TdxSkinSizeProperty); + if Result then + with TdxSkinSizeProperty(AProperty) do + Result := ((Self.Value.cx) = Value.cx) and ((Self.Value.cy) = Value.cy); +end; + +function TdxSkinSizeProperty.GetValueByIndex(Index: Integer): Integer; +begin + if Index = 0 then + Result := FValue.cx + else + Result := FValue.cy +end; + +procedure TdxSkinSizeProperty.SetValueByIndex(Index, Value: Integer); +var + AValue: TSize; +begin + AValue := FValue; + if Index = 0 then + AValue.cx := Value + else + AValue.cy := Value; + SetValue(AValue); +end; + +procedure TdxSkinSizeProperty.ReadData(Stream: TStream); +begin + Stream.ReadBuffer(FValue, SizeOf(FValue)); +end; + +procedure TdxSkinSizeProperty.WriteData(Stream: TStream); +begin + Stream.WriteBuffer(FValue, SizeOf(FValue)); +end; + +procedure TdxSkinSizeProperty.SetValue(const Value: TSize); +begin + if (Value.cx <> FValue.cx) or (Value.cy <> FValue.cy) then + begin + FValue := Value; + DoChange; + end; +end; + +{ TdxSkinBorder } + +constructor TdxSkinBorder.Create(AOwner: TPersistent; const AName: string); +begin + inherited Create(AOwner, AName); + FColor := clNone; + FThin := 1; +end; + +procedure TdxSkinBorder.Assign(Source: TPersistent); +var + ASource: TdxSkinBorder; +begin + if not (Source is TdxSkinBorder) then Exit; + ASource := TdxSkinBorder(Source); + Color := ASource.Color; + FKind := ASource.Kind; + Thin := ASource.Thin; +end; + +function TdxSkinBorder.Compare(AProperty: TdxSkinProperty): Boolean; +begin + Result := (AProperty is TdxSkinBorder); + if Result then + with TdxSkinBorder(AProperty) do + begin + Result := (Color = Self.Color) and (Thin = Self.Thin) and + (Kind = Self.Kind); + end; +end; + +procedure TdxSkinBorder.Draw(DC: HDC; const ABounds: TRect); +var + ACanvas: TdxSkinCanvas; +begin + if Color = clNone then Exit; + ACanvas := TdxSkinCanvas.Create; + try + ACanvas.BeginPaint(DC, ABounds); + DrawEx(ACanvas, ABounds); + ACanvas.EndPaint; + finally + ACanvas.Free; + end; +end; + +procedure TdxSkinBorder.DrawEx(ACanvas: TdxSkinCanvas; const ABounds: TRect); +begin + if Color = clNone then Exit; + with ABounds do + case Kind of + bLeft: + ACanvas.FillRectByColor(Rect(Left, Top, Left + Thin, Bottom), Color); + bTop: + ACanvas.FillRectByColor(Rect(Left, Top, Right, Top + Thin), Color); + bRight: + ACanvas.FillRectByColor(Rect(Right - Thin, Top, Right, Bottom), Color); + bBottom: + ACanvas.FillRectByColor(Rect(Left, Bottom - Thin, Right, Bottom), Color); + end; +end; + +procedure TdxSkinBorder.ReadData(Stream: TStream); +var + AColor: TColor; +begin + Stream.Read(AColor, SizeOf(FColor)); + Stream.Read(FThin, SizeOf(FThin)); + Color := AColor; +end; + +procedure TdxSkinBorder.WriteData(Stream: TStream); +begin + Stream.Write(FColor, SizeOf(FColor)); + Stream.Write(FThin, SizeOf(FThin)); +end; + +procedure TdxSkinBorder.SetColor(AValue: TColor); +begin + if AValue <> FColor then + begin + FColor := AValue; + DoChange; + end; +end; + +procedure TdxSkinBorder.SetThin(AValue: Integer); +begin + if AValue <> FThin then + begin + FThin := AValue; + DoChange; + end; +end; + +{ TdxSkinBorders } + +constructor TdxSkinBorders.Create(AOwner: TPersistent; const AName: string); +begin + inherited Create(AOwner, AName); + CreateBorders; +end; + +destructor TdxSkinBorders.Destroy; +begin + DeleteBorders; + inherited Destroy; +end; + +procedure TdxSkinBorders.Assign(ASource: TPersistent); +var + ABorder: TcxBorder; +begin + if ASource is TdxSkinBorders then + begin + for ABorder := Low(TcxBorder) to High(TcxBorder) do + FBorders[ABorder].Assign(TdxSkinBorders(ASource).FBorders[ABorder]) + end + else + inherited Assign(ASource); +end; + +function TdxSkinBorders.Compare(AProperty: TdxSkinProperty): Boolean; +var + ASide: TcxBorder; +begin + Result := (AProperty is TdxSkinBorders); + if Result then + begin + for ASide := Low(TcxBorder) to High(TcxBorder) do + Result := Items[ASide].Compare(TdxSkinBorders(AProperty).Items[ASide]); + end; +end; + +procedure TdxSkinBorders.CreateBorders; +var + ASide: TcxBorder; +const + BorderNames: array[TcxBorder] of string = + (sdxLeft, sdxTop, sdxRight, sdxBottom); +begin + for ASide := bLeft to bBottom do + begin + FBorders[ASide] := TdxSkinBorder.Create(Self, BorderNames[ASide]); + FBorders[ASide].FKind := ASide; + FBorders[ASide].OnChange := SubItemHandler; + end; +end; + +procedure TdxSkinBorders.DeleteBorders; +var + ASide: TcxBorder; +begin + for ASide := bLeft to bBottom do + FBorders[ASide].Free; +end; + +procedure TdxSkinBorders.SubItemHandler(Sender: TObject); +begin + DoChange; +end; + +function TdxSkinBorders.GetBorder(ABorder: TcxBorder): TdxSkinBorder; +begin + Result := FBorders[ABorder]; +end; + +function TdxSkinBorders.GetBorderByIndex(Index: Integer): TdxSkinBorder; +begin + Result := FBorders[TcxBorder(Index)]; +end; + +procedure TdxSkinBorders.SetBorderByIndex(Index: Integer; AValue: TdxSkinBorder); +begin + FBorders[TcxBorder(Index)].Assign(AValue); +end; + +{ TdxSkinStringProperty } + +procedure TdxSkinStringProperty.Assign(Source: TPersistent); +begin + if Source is TdxSkinStringProperty then + Value := TdxSkinStringProperty(Source).Value + else + inherited Assign(Source); +end; + +function TdxSkinStringProperty.Compare(AProperty: TdxSkinProperty): Boolean; +begin + Result := (AProperty.Name = Name) and (AProperty is TdxSkinStringProperty) and + (AnsiCompareStr(TdxSkinStringProperty(AProperty).Value, Value) = 0); +end; + +procedure TdxSkinStringProperty.ReadData(Stream: TStream); +begin + Value := ReadStringFromStream(Stream); +end; + +procedure TdxSkinStringProperty.WriteData(Stream: TStream); +begin + WriteStringToStream(Stream, Value); +end; + +procedure TdxSkinStringProperty.SetValue(const AValue: string); +begin + if AValue <> FValue then + begin + FValue := AValue; + DoChange; + end; +end; + +{ TdxSkinControlGroup } + +constructor TdxSkinControlGroup.Create( + AOwner: TPersistent; const AName: string); +begin + inherited Create(AOwner, AName); + FElements := TcxObjectList.Create; +end; + +destructor TdxSkinControlGroup.Destroy; +begin + FElements.Free; + inherited Destroy; +end; + +procedure TdxSkinControlGroup.Assign(Source: TPersistent); +var + I: Integer; + ASource: TdxSkinControlGroup; +begin + BeginUpdate; + try + if Source is TdxSkinControlGroup then + begin + ASource := TdxSkinControlGroup(Source); + for I := 0 to ASource.Count - 1 do + AddSubItem(ASource.Elements[I].Clone, FElements); + end; + inherited Assign(Source); + finally + EndUpdate; + end; +end; + +function TdxSkinControlGroup.AddElement(const AName: string): TdxSkinElement; +begin + Result := AddElementEx(AName, TdxSkinElement); +end; + +function TdxSkinControlGroup.AddElementEx( + const AName: string; AElementClass: TdxSkinElementClass): TdxSkinElement; +begin + Result := AElementClass.Create(Self, AName); + AddSubItem(Result, FElements); +end; + +procedure TdxSkinControlGroup.Clear; +begin + FElements.Clear; + FProperties.Clear; +end; + +procedure TdxSkinControlGroup.ClearModified; +var + I: Integer; +begin + FModified := False; + for I := 0 to Count - 1 do + Elements[I].Modified := False; +end; + +procedure TdxSkinControlGroup.Delete(AIndex: Integer); +begin + FElements[AIndex].Free; + FElements.Delete(AIndex); + Changed; +end; + +procedure TdxSkinControlGroup.RemoveElement(AElement: TdxSkinElement); +var + I: Integer; +begin + for I := 0 to Count - 1 do + if AElement = Elements[I] then + begin + Delete(I); + Break; + end; +end; + +function TdxSkinControlGroup.GetElementByName( + const AName: string): TdxSkinElement; +begin + Sort; + Result := TdxSkinElement(FindItemByName(FElements, AName)); +end; + +procedure TdxSkinControlGroup.DoSort; +begin + inherited DoSort; + FElements.Sort(TListSortCompare(@dxCompareByName)); +end; + +procedure TdxSkinControlGroup.ReadData( + AStream: TStream; const AVersion: TdxSkinVersion); +var + AIndex: Integer; +begin + for AIndex := 0 to ReadInteger(AStream) - 1 do + AddElement(ReadStringFromStream(AStream)).ReadData(AStream, AVersion); + if AVersion < 0.91 then Exit; + ReadProperties(AStream); + Changed; +end; + +procedure TdxSkinControlGroup.WriteData(AStream: TStream); +var + AIndex: Integer; + AElement: TdxSkinElement; +begin + WriteStringToStream(AStream, Name); + WriteInteger(AStream, Count); + for AIndex := 0 to Count - 1 do + begin + AElement := Elements[AIndex]; + WriteStringToStream(AStream, AElement.Name); + AElement.WriteData(AStream, dxSkinStreamVersion); + end; + WriteProperties(AStream); +end; + +function TdxSkinControlGroup.GetCount: Integer; +begin + Result := FElements.Count; +end; + +function TdxSkinControlGroup.GetElement(AIndex: Integer): TdxSkinElement; +begin + Result := FElements[AIndex] as TdxSkinElement; +end; + +function TdxSkinControlGroup.GetSkin: TdxSkin; +begin + Result := GetOwner as TdxSkin; +end; + +procedure TdxSkinControlGroup.SetElement(AIndex: Integer; AElement: TdxSkinElement); +begin + Elements[AIndex].Assign(AElement); +end; + +{ TdxSkinElement } + +constructor TdxSkinElement.Create( + AOwner: TPersistent; const AName: string); +begin + inherited Create(AOwner, AName); + FCanvas := TdxSkinCanvas.Create; + FColor := clDefault; + FImageCount := 1; + FImage := TdxSkinImage.Create(Self); + FImage.OnChange := SubItemHandler; + FContentOffset := TcxRect.Create(Self); + FContentOffset.OnChange := SubItemHandler; + FGlyph := TdxSkinImage.Create(Self); + FGlyph.OnChange := SubItemHandler; + FAlpha := 255; + FBorders := TdxSkinBorders.Create(Self, sdxBorders); + FBorders.OnChange := SubItemHandler; + FTextColor := clDefault; + FMinSize := TcxSize.Create(Self); + FMinSize.OnChange := SubItemHandler; +end; + +destructor TdxSkinElement.Destroy; +begin + FCanvas.Free; + FMinSize.Free; + FContentOffset.Free; + FImage.Free; + FGlyph.Free; + FBorders.Free; + if FBrush <> nil then + GdipDeleteBrush(FBrush); + inherited Destroy; +end; + +procedure TdxSkinElement.Assign(Source: TPersistent); +var + ASource: TdxSkinElement; +begin + if Source is TdxSkinElement then + begin + ASource := TdxSkinElement(Source); + Image.Assign(ASource.Image); + Glyph.Assign(ASource.Glyph); + Color := ASource.Color; + Alpha := ASource.Alpha; + ContentOffset.Assign(ASource.ContentOffset); + ImageCount := ASource.ImageCount; + Borders := ASource.Borders; + MinSize.Assign(ASource.MinSize); + TextColor := ASource.TextColor; + end; + inherited Assign(Source); +end; + +function TdxSkinElement.Compare(AElement: TdxSkinElement): Boolean; +begin + Result := (AElement.Name = Name) and (Color = AElement.Color) and + (ImageCount = AElement.ImageCount) and (Alpha = AElement.Alpha) and + (TextColor = AElement.TextColor) and MinSize.IsEqual(AElement.MinSize) and + (ContentOffset.IsEqual(AElement.ContentOffset.Rect)) and + Borders.Compare(AElement.Borders) and CompareProperties(AElement) and + Image.Compare(AElement.Image) and Glyph.Compare(AElement.Glyph); +end; + +procedure TdxSkinElement.Draw(DC: HDC; const ARect: TRect; + AImageIndex: Integer = 0; AState: TdxSkinElementState = esNormal); +begin + if Canvas.IsRectVisible(DC, ARect) then + begin + Canvas.BeginPaint(DC, ARect); + try + InternalDraw(Canvas, ARect, AImageIndex, AState); + finally + Canvas.EndPaint; + end; + end; +end; + +procedure TdxSkinElement.SetStateMapping(AStateOrder: array of TdxSkinElementState); +begin + FImage.SetStateMapping(AStateOrder); + FGlyph.SetStateMapping(AStateOrder); +end; + +function TdxSkinElement.CompareProperties(AElement: TdxSkinElement): Boolean; +var + I: Integer; +begin + Result := AElement.PropertyCount = PropertyCount; + if Result then + for I := 0 to PropertyCount - 1 do + begin + Result := AElement.Properties[I].Compare(Properties[I]); + if not Result then + Break; + end; +end; + +function TdxSkinElement.ExpandName(ABitmap: TdxSkinImage): string; +begin + Result := Name + BitmapNameSuffixes[ABitmap = Image] +end; + +procedure TdxSkinElement.FillBackgroundByColor(ACanvas: TdxSkinCanvas; + const ARect: TRect); +begin + if IsColorAssigned and (Image.Empty or (Image.Stretch = smNoResize) or IsAlphaUsed) then + begin + if Alpha = 255 then + ACanvas.FillRectByColor(ARect, Color) + else + GdipFillRectangleI(ACanvas.Graphics, Brush, ARect.Left, ARect.Top, + ARect.Right - ARect.Left, ARect.Bottom - ARect.Top); + end; +end; + +procedure TdxSkinElement.InternalDraw(ACanvas: TdxSkinCanvas; + const ARect: TRect; AImageIndex: Integer = 0; + AState: TdxSkinElementState = esNormal); +var + ASide: TcxBorder; + R: TRect; +begin + if not Image.Empty then + begin + FillBackgroundByColor(ACanvas, ARect); + Image.DrawEx(ACanvas, ARect, AImageIndex, AState); + end + else + begin + R := ARect; + for ASide := bLeft to bBottom do + with Borders[ASide] do + begin + if Color <> clNone then + begin + DrawEx(ACanvas, ARect); + if ASide in [bLeft, bTop] then + Inc(TRect2Int(R)[ASide], Thin) + else + Dec(TRect2Int(R)[ASide], Thin); + end; + end; + FillBackgroundByColor(ACanvas, R); + end; + Glyph.DrawEx(ACanvas, cxRectContent(ARect, ContentOffset.Rect), AImageIndex, AState); +end; + +procedure TdxSkinElement.ReadData(AStream: TStream; AVersion: TdxSkinVersion); +var + ASide: TcxBorder; +begin + AStream.Read(FColor, SizeOf(TColor)); + AStream.Read(FAlpha, SizeOf(FAlpha)); + AStream.Read(FImageCount, SizeOf(Integer)); + AStream.Read(ContentOffset.Data^, SizeOf(TRect)); + Glyph.ReadData(AStream); + Image.ReadData(AStream); + for ASide := bLeft to bBottom do + begin + if Group.Skin.Version >= 0.92 then + ReadStringFromStream(AStream); + Borders[ASide].ReadFromStream(AStream); + end; + Color := FColor; + if Group.Skin.Version >= 0.93 then + AStream.Read(FTextColor, SizeOf(TColor)); + if Group.Skin.Version >= 0.94 then + AStream.Read(FMinSize.Data^, SizeOf(TSize)); + if Group.Skin.Version >= 0.95 then + ReadProperties(AStream); +end; + +procedure TdxSkinElement.WriteData(AStream: TStream; AVersion: TdxSkinVersion); +var + ASide: TcxBorder; +begin + AStream.Write(FColor, SizeOf(TColor)); + AStream.Write(FAlpha, SizeOf(Alpha)); + AStream.Write(FImageCount, SizeOf(Integer)); + AStream.Write(ContentOffset.Data^, SizeOf(TRect)); + Glyph.WriteData(AStream); + Image.WriteData(AStream); + for ASide := bLeft to bBottom do + Borders[ASide].WriteToStream(AStream); + AStream.Write(FTextColor, SizeOf(TColor)); + AStream.Write(FMinSize.Data^, SizeOf(TSize)); + WriteProperties(AStream); +end; + +function TdxSkinElement.GetGroup: TdxSkinControlGroup; +begin + Result := GetOwner as TdxSkinControlGroup; +end; + +function TdxSkinElement.GetIsAlphaUsed: Boolean; +begin + if Image.Empty then + Result := Alpha < 255 + else + Result := Image.Texture.IsAlphaUsed; +end; + +function TdxSkinElement.GetPath: string; +begin + Result := Group.Name + PathDelim; +end; + +function TdxSkinElement.GetSize: TSize; +begin + Result := Image.Size; +end; + +procedure TdxSkinElement.SetAlpha(AValue: Byte); +begin + if Alpha <> AValue then + begin + FAlpha := AValue; + Color := Color; + end; +end; + +procedure TdxSkinElement.SetBorders(AValue: TdxSkinBorders); +begin + FBorders.Assign(AValue); +end; + +procedure TdxSkinElement.SetColor(AValue: TColor); +begin + FColor := AValue; + FIsColorAssigned := (Color <> clDefault) and (Color <> clNone); + if IsColorAssigned then + begin + if FBrush <> nil then + GdipSetSolidFillColor(FBrush, ColorToARGB(AValue, Alpha)) + else + GdipCreateSolidFill(ColorToARGB(AValue, Alpha), FBrush); + end; + DoChange; +end; + +procedure TdxSkinElement.SetContentOffset(AValue: TcxRect); +begin + ContentOffset.Assign(AValue); +end; + +procedure TdxSkinElement.SetGlyph(AValue: TdxSkinImage); +begin + Glyph.Assign(AValue); +end; + +procedure TdxSkinElement.SetImage(AValue: TdxSkinImage); +begin + Image.Assign(AValue); +end; + +procedure TdxSkinElement.SetImageCount(AValue: Integer); +begin + if AValue < 1 then + AValue := 1; + if AValue <> FImageCount then + begin + FImageCount := AValue; + Image.IsDirty := True; + Glyph.IsDirty := True; + DoChange; + end; +end; + +procedure TdxSkinElement.SetMinSize(AValue: TcxSize); +begin + FMinSize.Assign(AValue); +end; + +procedure TdxSkinElement.SetTextColor(AValue: TColor); +begin + FTextColor := AValue; + DoChange; +end; + +{ TdxSkinEmptyElement } + +procedure TdxSkinEmptyElement.Draw(DC: HDC; const ARect: TRect; + AImageIndex: Integer = 0; AState: TdxSkinElementState = esNormal); +var + RedBrush: HBRUSH; +begin + FillRect(DC, ARect, GetStockObject(WHITE_BRUSH)); + RedBrush := CreateSolidBrush(255); + FrameRect(DC, ARect, RedBrush); + DeleteObject(RedBrush); +end; + +{ TdxSkinPartStream } + +constructor TdxSkinPartStream.Create(ASource: TStream); +begin + FSource := ASource; +end; + +{$IFDEF DELPHI7} + +function TdxSkinPartStream.GetSize: Int64; +begin + Result := FPosEnd - FPosStart; +end; + +{$ENDIF} + +procedure TdxSkinPartStream.Initialize(const APosStart, APosEnd: Longint); +begin + FPosStart := APosStart; + FPosEnd := APosEnd; +end; + +procedure TdxSkinPartStream.InitializeEx( + ASource: TStream; const APosStart, APosEnd: Longint); +begin + FSource := ASource; + Initialize(APosStart, APosEnd); +end; + +function TdxSkinPartStream.Read(var Buffer; Count: Longint): Longint; +begin + Result := Source.Read(Buffer, Count); +end; + +function TdxSkinPartStream.Seek(Offset: Longint; Origin: Word): Longint; +var + ANewPos: Longint; +begin + ANewPos := Source.Position + Offset; + case Origin of + soFromBeginning: + ANewPos := PosStart + Offset; + soFromEnd: + ANewPos := PosEnd + Offset; + end; + Source.Position := Min(Max(PosStart, ANewPos), PosEnd); + Result := Source.Position - PosStart; +end; + +function TdxSkinPartStream.Write(const Buffer; Count: Longint): Longint; +begin + Result := Source.Write(Buffer, Count); + FPosEnd := Source.Position; +end; + +{ TdxSkinCanvas } + +function TdxSkinCanvas.GetInterpolationMode: Integer; +begin + GdipCheck(GdipGetInterpolationMode(Graphics, Result)); +end; + +procedure TdxSkinCanvas.SetInterpolationMode(AValue: Integer); +begin + GdipCheck(GdipSetInterpolationMode(Graphics, AValue)); +end; + +function TdxSkinCanvas.IsLowColors(DC: HDC): Boolean; +begin + Result := GetDeviceCaps(DC, BITSPIXEL) <= 8; +end; + +function TdxSkinCanvas.IsRectVisible(DC: HDC; const R: TRect): Boolean; +begin + Result := not cxRectIsEmpty(R) and RectVisible(DC, R); +end; + +procedure TdxSkinCanvas.BeginPaint(DC: HDC; const R: TRect); +var + ATempDC: HDC; +begin + FRect := R; + ATempDC := DC; + FSourceDC := DC; + if IsLowColors(DC) then + begin + FBuffer := TcxBitmap.CreateSize(R, pf32bit); + ATempDC := FBuffer.Canvas.Handle; + cxBitBlt(ATempDC, DC, FBuffer.ClientRect, R.TopLeft, SRCCOPY); + SetWindowOrgEx(ATempDC, R.Left, R.Top, nil); + end; + GdipCheck(GdipCreateFromHDC(ATempDC, FGraphics)); +end; + +procedure TdxSkinCanvas.BeginPaintEx(Graphics: GpGraphics; const R: TRect); +begin + FRect := R; + FSourceDC := 0; + FGraphics := Graphics; +end; + +procedure TdxSkinCanvas.EndPaint; +var + ACanvas: TCanvas; + ASaveIndex: Integer; +begin + GdipCheck(GdipDeleteGraphics(FGraphics)); + if FBuffer <> nil then + begin + SetWindowOrgEx(FBuffer.Canvas.Handle, 0, 0, nil); + // todo: using TCanvas for valid bitmap drawing to 256 colors DC + ACanvas := TCanvas.Create; + try + ASaveIndex := SaveDC(FSourceDC); + ACanvas.Handle := FSourceDC; + ACanvas.Draw(FRect.Left, FRect.Top, FBuffer); + ACanvas.Handle := 0; + RestoreDC(FSourceDC, ASaveIndex); + finally + ACanvas.Free; + end; + FreeAndNil(FBuffer); + end; +end; + +procedure TdxSkinCanvas.FillRectByColor(const R: TRect; AColor: TColor); +var + ABrush: HBRUSH; + DC: HDC; +begin + ABrush := CreateSolidBrush(ColorToRGB(AColor)); + GdipCheck(GdipGetDC(Graphics, DC)); + FillRect(DC, R, ABrush); + GdipCheck(GdipReleaseDC(Graphics, DC)); + DeleteObject(ABrush); +end; + +procedure TdxSkinCanvas.FillRectByGradient(const R: TRect; AColor1: TColor; + AColor2: TColor; AMode: TdxSkinGradientMode); +var + DC: HDC; +begin + if (AColor1 = AColor2) or (AColor2 = clNone) or (AColor2 = clDefault) then + FillRectByColor(R, AColor1) + else + if AMode in [gmVertical, gmHorizontal] then + begin + GdipCheck(GdipGetDC(Graphics, DC)); + FillGradientRect(DC, R, AColor1, AColor2, AMode = gmHorizontal); + GdipCheck(GdipReleaseDC(Graphics, DC)); + end + else + FillRectByDiagonalGradient(R, AColor1, AColor2, AMode = gmForwardDiagonal); +end; + +procedure TdxSkinCanvas.DrawImage(AImage: TdxPNGImage; const ADest, ASource: TRect); +var + AOldIntpMode: Integer; +begin + AOldIntpMode := InterpolationMode; + try + InterpolationMode := InterpolationModeNearestNeighbor; + StretchDrawImage(AImage, ADest, ASource); + finally + InterpolationMode := AOldIntpMode; + end; +end; + +procedure TdxSkinCanvas.FillRectByDiagonalGradient(const R: TRect; + AColor1, AColor2: TColor; AForward: Boolean); +const + GradientModeFlags: array[Boolean] of LinearGradientMode = ( + LinearGradientModeBackwardDiagonal, LinearGradientModeForwardDiagonal + ); +var + ABrush: GpLineGradient; + R1: TdxGPRect; +begin + R1.X := R.Left; + R1.Y := R.Top; + R1.Width := R.Right - R.Left; + R1.Height := R.Bottom - R.Top; + GdipCheck(GdipCreateLineBrushFromRectI(@R1, ColorToARGB(AColor1), + ColorToARGB(AColor2), GradientModeFlags[AForward], WrapModeTile, ABrush)); + GdipCheck(GdipFillRectangleI(Graphics, ABrush, R1.X, R1.Y, R1.Width, R1.Height)); + GdipCheck(GdipDeleteBrush(ABrush)); +end; + +procedure TdxSkinCanvas.StretchDrawImage(AImage: TdxPNGImage; + const ADest, ASource: TRect); +begin + AImage.StretchDrawEx(Graphics, ADest, ASource); +end; + +procedure TdxSkinCanvas.TileImage(AImage: TdxPNGImage; const ADest, ASource: TRect); +var + ALastCol, ALastRow, ACol, ARow: Integer; + AOldIntpMode: Integer; + ASize, ADestSize: TSize; + RDest, RSrc: TRect; +begin + AOldIntpMode := InterpolationMode; + try + InterpolationMode := InterpolationModeNearestNeighbor; + ASize := cxSize(cxRectWidth(ASource), cxRectHeight(ASource)); + ADestSize := cxSize(cxRectWidth(ADest), cxRectHeight(ADest)); + ALastCol := ADestSize.cx div ASize.cx - Ord(ADestSize.cx mod ASize.cx = 0); + ALastRow := ADestSize.cy div ASize.cy - Ord(ADestSize.cy mod ASize.cy = 0); + for ARow := 0 to ALastRow do + begin + RSrc.Top := ASource.Top; + RSrc.Bottom := ASource.Bottom; + RDest.Top := ADest.Top + ASize.cy * ARow; + RDest.Bottom := RDest.Top + ASize.cy; + if RDest.Bottom > ADest.Bottom then + begin + Dec(RSrc.Bottom, RDest.Bottom - ADest.Bottom); + RDest.Bottom := ADest.Bottom; + end; + for ACol := 0 to ALastCol do + begin + RSrc.Left := ASource.Left; + RSrc.Right := ASource.Right; + RDest.Left := ADest.Left + ASize.cx * ACol; + RDest.Right := RDest.Left + ASize.cx; + if RDest.Right > ADest.Right then + begin + Dec(RSrc.Right, RDest.Right - ADest.Right); + RDest.Right := ADest.Right; + end; + AImage.DrawEx(Graphics, RDest, RSrc); + end; + end; + finally + InterpolationMode := AOldIntpMode; + end; +end; + +{ TdxSkinElementCache } + +destructor TdxSkinElementCache.Destroy; +begin + FreeCache; + inherited Destroy; +end; + +procedure TdxSkinElementCache.FreeCache; +begin + if Assigned(FCache) then + begin + GdipCheck(GdipDisposeImage(FCache)); + FCache := nil; + end; +end; + +procedure TdxSkinElementCache.CheckCacheState(AElement: TdxSkinElement; + const R: TRect; AState: TdxSkinElementState = esNormal; + AImageIndex: Integer = 0); +begin + if (AElement <> Element) or (AState <> FState) or + (FImageIndex <> AImageIndex) or (cxRectWidth(R) <> cxRectWidth(FRect)) or + (cxRectHeight(R) <> cxRectHeight(FRect)) + then + begin + FElement := AElement; + FImageIndex := AImageIndex; + FRect := R; + FState := AState; + FIsAlphaBlendUsed := AElement.IsAlphaUsed; + UpdateCache(R, AState, AImageIndex); + end; +end; + +procedure TdxSkinElementCache.UpdateCache(const R: TRect; + AState: TdxSkinElementState = esNormal; AImageIndex: Integer = 0); +var + ACanvas: TdxSkinCanvas; + AGraphics: GpGraphics; + R1: TRect; +begin + ACanvas := TdxSkinCanvas.Create; + try + R1 := R; + OffsetRect(R1, -R1.Left, -R1.Top); + FreeCache; + if not IsRectEmpty(R1) then + begin + GdipCheck(GdipCreateBitmapFromScan0(R1.Right, R1.Bottom, 0, + PixelFormat32bppPARGB, nil, FCache)); + GdipCheck(GdipGetImageGraphicsContext(FCache, AGraphics)); + ACanvas.BeginPaintEx(AGraphics, R1); + try + Element.InternalDraw(ACanvas, R1, AImageIndex, AState); + finally + ACanvas.EndPaint; + end; + end; + finally + ACanvas.Free; + end; +end; + +procedure TdxSkinElementCache.Draw(DC: HDC; const R: TRect); +var + ABitmap: HBITMAP; + AGraphics: GpGraphics; + AMemDC: HDC; +begin + if FCache = nil then + Exit; + + if FIsAlphaBlendUsed then + begin + GdipCheck(GdipCreateFromHDC(DC, AGraphics)); + GdipCheck(GdipDrawImageRectI(AGraphics, FCache, R.Left, R.Top, + R.Right - R.Left, R.Bottom - R.Top)); + GdipCheck(GdipDeleteGraphics(AGraphics)); + end + else + begin + AMemDC := CreateCompatibleDC(DC); + GdipCheck(GdipCreateHBITMAPFromBitmap(FCache, ABitmap, 0)); + SelectObject(AMemDC, ABitmap); + cxBitBlt(DC, AMemDC, R, cxNullPoint, SRCCOPY); + DeleteDC(AMemDC); + DeleteObject(ABitmap); + end; +end; + +{ TdxSkinElementCacheList } + +constructor TdxSkinElementCacheList.Create; +begin + inherited Create; + CacheListLimit := dxSkinElementCacheListLimit; +end; + +procedure TdxSkinElementCacheList.DrawElement(DC: HDC; AElement: TdxSkinElement; + const R: TRect; AState: TdxSkinElementState = esNormal; AImageIndex: Integer = 0); +var + AElementCache: TdxSkinElementCache; +begin + if not FindElementCache(AElement, R, AElementCache) then + begin + AElementCache := TdxSkinElementCache.Create; + Add(AElementCache); + CheckListLimits; + end; + AElementCache.CheckCacheState(AElement, R, AState, AImageIndex); + AElementCache.Draw(DC, R); +end; + +procedure TdxSkinElementCacheList.CheckListLimits; +begin + if Count > CacheListLimit then + begin + ElementCache[0].Free; + Delete(0); + end; +end; + +function TdxSkinElementCacheList.FindElementCache(AElement: TdxSkinElement; + const R: TRect; out AElementCache: TdxSkinElementCache): Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to Count - 1 do + begin + AElementCache := ElementCache[I]; + Result := (AElementCache.Element = AElement) and cxRectIsEqual(R, AElementCache.FRect); + if Result then + Break; + end; +end; + +function TdxSkinElementCacheList.GetElementCache(AIndex: Integer): TdxSkinElementCache; +begin + Result := TdxSkinElementCache(Items[AIndex]); +end; + +procedure RegisterAssistants; +begin + dxSkinEmptyElement := TdxSkinEmptyElement.Create(nil, ''); + RegisteredPropertyTypes := TList.Create; + PartStream := TdxSkinPartStream.Create(nil); + RegisterClasses([TdxSkinControlGroup, TdxSkinElement, TdxSkinImage]); + // register properties + TdxSkinIntegerProperty.Register; + TdxSkinColor.Register; + TdxSkinRectProperty.Register; + TdxSkinSizeProperty.Register; + TdxSkinBooleanProperty.Register; + TdxSkinStringProperty.Register; + // + CheckGdiPlus; + CheckPngCodec; +end; + +procedure UnregisterAssistants; +begin + RegisteredPropertyTypes.Free; + UnRegisterClasses([TdxSkinControlGroup, TdxSkinElement, TdxSkinImage]); + UnRegisterClasses([TdxSkinIntegerProperty, TdxSkinColor, TdxSkinRectProperty, + TdxSkinSizeProperty, TdxSkinBooleanProperty]); + PartStream.Free; + FreeAndNil(dxSkinEmptyElement); +end; + +initialization + dxUnitsLoader.AddUnit(@RegisterAssistants, @UnregisterAssistants); +finalization + dxUnitsLoader.RemoveUnit(@UnregisterAssistants); + +end. diff --git a/official/x.35/ExpressLibrary/Sources/dxSkinsStrs.pas b/official/x.35/ExpressLibrary/Sources/dxSkinsStrs.pas new file mode 100644 index 00000000..4ab06bf4 --- /dev/null +++ b/official/x.35/ExpressLibrary/Sources/dxSkinsStrs.pas @@ -0,0 +1,503 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express Cross Platform Library classes } +{ } +{ Copyright (c) 2000-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSCROSSPLATFORMLIBRARY AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM } +{ ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinsStrs; + +interface + +uses + cxGraphics, cxLookAndFeelPainters; + +resourcestring + // skins core + sdxResourceType = 'DXSKINS'; + sdxNavBarResourceType = 'DXNAVBARSKINS'; + + sdxSkinInvalidStreamFormat = 'Invalid stream format'; + sdxOldFormat = 'The skin data version is older than the current ExpressSkins Library version.' + #13#10 + + 'Skins cannot be loaded due to a version mismatch.'; + sdxSkinElementNotFound = 'Element "%s" not found'; + sdxSkinGroupNotFound = 'Group "%s" not found'; + sdxSkinParentNotFound = 'Parent skin "%s" not found'; + sdxSkinsRootFolder = 'My DX_VCL Skins'; + sdxAdditionProperties ='AdditionalProperties'; + sdxColors = 'Colors'; + sdxInteger = 'Int'; + sdxMinSize = 'MinSize'; + sdxProperties = 'Properties'; + sdxValue = 'Value'; + sdxOffset = 'Offset'; + + //colors + sdxSchedulerSeparatorColor = 'SeparatorColor'; + sdxSkinsBarDisabledTextColor = 'DisabledTextColor'; + sdxSkinsButtonDisabledTextColor = 'DisabledText'; + sdxSkinsContainerBorderColor = 'ContainerBorderColor'; + sdxSkinsContainerHighlightBorderColor = 'ContainerHighlightBorderColor'; + sdxSkinsContentColor = 'ContentColor'; + sdxSkinsContentEvenColor = 'ContentEvenColor'; + sdxSkinsContentOddColor = 'ContentOddColor'; + sdxSkinsContentTextColor = 'ContentTextColor'; + sdxSkinsHeaderBackgroundColor = 'HeaderBackgroundColor'; + sdxSkinsHeaderBackgroundTextColor = 'HeaderBackgroundTextColor'; + sdxSkinsLayoutControlColor = 'LayoutControlColor'; + sdxSkinsSchedulerNavigatorColor = 'NavigatorColor'; + sdxSkinsSelectionColor = 'SelectionColor'; + sdxSkinsSelectionTextColor = 'SelectionTextColor'; + sdxSkinsTabTextColor = 'TabHeaderTextColor'; + sdxSkinsTabTextColorActive = 'TabHeaderTextColorActive'; + sdxSkinsTabTextColorDisabled = 'TabHeaderTextColorDisabled'; + sdxSkinsTabTextColorHot = 'TabHeaderTextColorHot'; + + // Edit Colors + sdxSkinsEditorBackgroundColor = 'BackgroundColor'; + sdxSkinsEditorBackgroundDisabledColor = 'BackgroundDisabledColor'; + sdxSkinsEditorTextColor = 'TextColor'; + sdxSkinsEditorTextDisabledColor = 'TextDisabledColor'; + + // common + sdxCaptionFontDelta = 'FontDelta'; + + // dock control colors + + sdxSkinsDCCaptionActiveTextColor = 'DockControlCaptionActiveTextColor'; + sdxSkinsDCCaptionTextColor = 'DockControlCaptionTextColor'; + sdxSkinsDCHiddenBarTextColor = 'DockControlHiddenBarTextColor'; + + // groups + sdxSkinGroupBars = 'Bars'; + sdxSkinGroupCommon = 'Common'; + sdxSkinGroupDocking = 'Docking'; + sdxSkinGroupEditors = 'Editors'; + sdxSkinGroupForm = 'Form'; + sdxSkinGroupGrid = 'Grid'; + sdxSkinGroupLayoutControl = 'LayoutControl'; + sdxSkinGroupNavBar = 'NavBar'; + sdxSkinGroupNavPane = 'NavPane'; + sdxSkinGroupRibbon = 'Ribbon'; + sdxSkinGroupScheduler = 'Scheduler'; + sdxSkinGroupTabs = 'PageControl'; + sdxSkinGroupVGrid = 'VerticalGrid'; + + // skin group elements + + sdxComboButtonGlyph = 'ComboButtonGlyph'; + sdxSpinUpGlyph = 'SpinUpGlyph'; + sdxSpinDownGlyph = 'SpinDownGlyph'; + sdxSpinLeftGlyph = 'SpinLeftGlyph'; + sdxSpinRightGlyph = 'SpinRightGlyph'; + sdxEditorButton = 'EditorButton'; + sdxCloseButton = 'CloseButton'; + + // bars elements + sdxBarsBar = 'Bar'; + sdxBarsBarCustomize = 'BarCustomize'; + sdxBarsBarCustomizeVertical = 'BarCustomizeVertical'; + sdxBarsBarFinger = 'BarDragGrip'; + sdxBarsBarFingerVertical = 'BarDragGripVertical'; + sdxBarsBarSeparator = 'BarSeparator'; + sdxBarsBarVertical = 'BarVertical'; + sdxBarsBarVerticalSeparator = 'BarSeparatorVertical'; + sdxBarsDock = 'Dock'; + sdxBarsFloatBar = 'FloatBar'; + sdxBarsLinkStatic = 'LinkStatic'; + sdxBarsLinkSelected = 'LinkSelected'; + sdxBarsMainMenu = 'MainMenu'; + sdxBarsMainMenuCustomize = 'MainMenuCustomize'; + sdxBarsMainMenuDrag = 'MainMenuDrag'; + sdxBarsMainMenuLinkSelected = 'MainMenuLinkSelected'; + sdxBarsMainMenuVertical = 'MainMenuVertical'; + sdxBarsPopupMenu = 'PopupMenu'; + sdxBarsPopupMenuCheck = 'PopupMenuCheck'; + sdxBarsPopupMenuExpandButton = 'PopupMenuExpandButton'; + sdxBarsPopupMenuLinkSelected = 'PopupMenuLinkSelected'; + sdxBarsPopupMenuSeparator = 'PopupMenuSeparator'; + sdxBarsPopupMenuSideStrip = 'PopupMenuSideStrip'; + sdxBarsPopupMenuSideStripNonRecent = 'PopupMenuSideStripNonRecent'; + sdxBarsPopupMenuDropDownButtonLabel = 'PopupMenuDropDownButtonLabel'; + sdxBarsPopupMenuDropDownButtonArrow = 'PopupMenuDropDownButtonArrow'; + + // Colors + sdxTextColorNormal = 'TextColor'; + sdxTextColorDisabled = 'TextColorDisabled'; + sdxTextColorHot = 'TextColorHot'; + sdxTextColorPressed = 'TextColorPressed'; + sdxTextColorSelected = 'TextColorSelected'; + sdxTextInactiveColor = 'TextColorInactive'; + + // ribbon elements + sdxRibbonAppButtonRightIndent = 'RightIndent'; + sdxRibbonApplicationButton = 'FormAppButton'; + sdxRibbonAppMenuFooterBackground = 'AppMenuBackgroundBottom'; + sdxRibbonAppMenuHeaderBackground = 'AppMenuBackground'; + sdxRibbonButtonArrow = 'ButtonArrow'; + sdxRibbonButtonDisabledText = 'ButtonDisabled'; + sdxRibbonButtonGroup = 'ButtonGroup'; + sdxRibbonButtonGroupButton = 'ButtonGroupButton'; + sdxRibbonButtonGroupSeparator = 'ButtonGroupSeparator'; + sdxRibbonCaptionFontDelta = 'FontDelta'; + sdxRibbonCollapsedToolBarBackground = 'TabGroupCollapsed'; + sdxRibbonCollapsedToolBarGlyphBackground = 'TabGroupCollapsedBox'; + sdxRibbonDialogFrameBottom = 'DialogFrameBottom'; + sdxRibbonDialogFrameLeft = 'DialogFrameLeft'; + sdxRibbonDialogFrameRight = 'DialogFrameRight'; + sdxRibbonDocumentNameTextColor = 'DocumentNameTextColor'; + sdxRibbonExtraPaneColor = 'AppMenuExtraPaneColor'; + sdxRibbonFormBottom = 'FormFrameBottom'; + sdxRibbonFormCaption = 'FormCaption'; + sdxRibbonFormFrameLeft = 'FormFrameLeft'; + sdxRibbonFormFrameRight = 'FormFrameRight'; + sdxRibbonGalleryBackground = 'DropDownGalleryBackground'; + sdxRibbonGalleryButtonDown = 'InRibbonGalleryButtonDown'; + sdxRibbonGalleryButtonDropDown = 'InRibbonGalleryButtonDropDown'; + sdxRibbonGalleryButtonUp = 'InRibbonGalleryButtonUp'; + sdxRibbonGalleryGroupCaption = 'DropDownGalleryGroupHeader'; + sdxRibbonGalleryPane = 'InRibbonGalleryPane'; + sdxRibbonGallerySizeGrips = 'DropDownGallerySizeGrip'; + sdxRibbonGallerySizingPanel = 'DropDownGallerySizePanel'; + sdxRibbonHeaderBackground = 'TabBackground'; + sdxRibbonLargeButton = 'LargeButton'; + sdxRibbonLargeSplitButtonBottom = 'LargeSplitButtonBottom'; + sdxRibbonLargeSplitButtonTop = 'LargeSplitButtonTop'; + sdxRibbonQATCustomizeButtonOutsideQAT = 'DisplayCustomizeButtonOutsideQAT'; + sdxRibbonQATIndentBeforeCustomizeItem = 'IndentBeforeCustomizeButton'; + sdxRibbonQuickAccessToolbarOffset = 'Offset'; + sdxRibbonQuickToolbarAbove = 'QATAboveBackground'; + sdxRibbonQuickToolbarBelow = 'QATBelowBackground'; + sdxRibbonQuickToolbarButtonGlyph = 'QATButtonGlyph'; + sdxRibbonQuickToolbarDropDown = 'QATOverflow'; + sdxRibbonQuickToolbarGlyph = 'QATCustomizeButton'; + sdxRibbonQuickToolbarInCaption = 'QATInRibbonBackground'; + sdxRibbonSmallButton = 'Button'; + sdxRibbonSplitButtonLeft = 'SplitButtonLeft'; + sdxRibbonSplitButtonRight = 'SplitButtonRight'; + sdxRibbonStatusBarBackground = 'StatusBarBackground'; + sdxRibbonStatusBarButton = 'StatusBarButton'; + sdxRibbonStatusBarSeparator = 'StatusBarSeparator'; + sdxRibbonTabGroup = 'TabGroup'; + sdxRibbonTabGroupHeader = 'TabGroupCaption'; + sdxRibbonTabHeaderDownGrowIndent = 'TabHeaderDownGrow'; + sdxRibbonTabHeaderPage = 'Tab'; + sdxRibbonTabPanel = 'TabPanel'; + sdxRibbonTabPanelGroupButton = 'TabGroupButton'; + + // navbar elemets + sdxNavBarBackground = 'Background'; + sdxNavBarGroupClient = 'GroupClient'; + sdxNavBarGroupCloseButton = 'GroupCloseButton'; + sdxNavBarGroupFooter = 'GroupFooter'; + sdxNavBarGroupHeader = 'GroupHeader'; + sdxNavBarGroupOpenButton = 'GroupOpenButton'; + sdxNavBarItem = 'Item'; + + sdxNavPaneCaptionFontSize = 'FontSize'; + sdxNavPaneCaptionHeight = 'Height'; + sdxNavPaneCollapseButton = 'CollapseButton'; + sdxNavPaneCollapsedGroupClient = 'CollapsedGroupClient'; + sdxNavPaneExpandButton = 'ExpandButton'; + sdxNavPaneFormBorder = 'PopupBorder'; + sdxNavPaneFormSizeGrip = 'PopupSizeGrip'; + sdxNavPaneGroupButton = 'GroupButton'; + sdxNavPaneGroupButtonSelected = 'GroupButtonSelected'; + sdxNavPaneGroupCaption = 'Caption'; + sdxNavPaneGroupClient = 'GroupClient'; + sdxNavPaneItem = 'Item'; + sdxNavPaneItemSelected = 'ItemSelected'; + sdxNavPaneOverflowPanel = 'OverflowPanel'; + sdxNavPaneOverflowPanelExpandItem = 'OverflowPanelExpandItem'; + sdxNavPaneOverflowPanelItem = 'OverflowPanelItem'; + sdxNavPaneScrollDownBtn = 'ScrollDownButton'; + sdxNavPaneScrollUpBtn = 'ScrollUpButton'; + sdxNavPaneSplitter = 'Splitter'; + + // scheduler + sdxSchedulerAllDayArea = 'AllDayArea'; + sdxSchedulerAllDayAreaSelected = 'AllDayAreaSelected'; + sdxSchedulerAppointment = 'Appointment'; + sdxSchedulerAppointmentBorder = 'AppointmentBorder'; + sdxSchedulerAppointmentBorderSize = 'BorderSize'; + sdxSchedulerAppointmentBottomShadow = 'AppointmentBottomShadow'; + sdxSchedulerAppointmentMask = 'AppointmentMask'; + sdxSchedulerAppointmentRight = 'AppointmentRightBorder'; + sdxSchedulerAppointmentRightShadow = 'AppointmentRightShadow'; + sdxSchedulerCurrentTimeIndicator = 'CurrentTimeIndicator'; + sdxSchedulerMoreButton = 'MoreButton'; + sdxSchedulerNavButtonNext = 'NavButtonNext'; + sdxSchedulerNavButtonNextArrow = 'NavButtonNextArrow'; + sdxSchedulerNavButtonPrev = 'NavButtonPrev'; + sdxSchedulerNavButtonPrevArrow = 'NavButtonPrevArrow'; + sdxSchedulerTimeGridCurrentTimeIndicator = 'TimeGridCurrentTimeIndicator'; + sdxSchedulerTimeGridHeader = 'TimeGridHeader'; + sdxSchedulerTimeGridHeaderSelected = 'TimeGridHeaderSelected'; + sdxSchedulerTimeLine = 'DefaultTimeLine'; + sdxSchedulerTimeRuler = 'Ruler'; + + // dock control elements + sdxDCActiveTabHeaderDownGrow = 'ActiveTabHeaderDownGrow'; + sdxDCActiveTabHeaderHGrow = 'ActiveTabHeaderHGrow'; + sdxDCActiveTabHeaderUpGrow = 'ActiveTabHeaderUpGrow'; + sdxDockCtrlAutoHideBar = 'AutoHideBar'; + sdxDockCtrlAutoHideBarBottom = 'AutoHideBarBottom'; + sdxDockCtrlAutoHideBarLeft = 'AutoHideBarLeft'; + sdxDockCtrlAutoHideBarRight = 'AutoHideBarRight'; + sdxDockCtrlBorder = 'DockWindowBorder'; + sdxDockCtrlCaption = 'DockWindowCaption'; + sdxDockCtrlInactiveCaptionTextColor = 'InactiveCaptionTextColor'; + sdxDockCtrlTabHeader = 'TabHeader'; + sdxDockCtrlTabHeaderAutoHideBar = 'TabHeaderAutoHideBar'; + sdxDockCtrlTabHeaderBackground = 'TabHeaderBackground'; + sdxDockCtrlTabHeaderLine = 'TabHeaderLine'; + sdxDockCtrlWindowButton = 'DockWindowButton'; + sdxDockCtrlWindowGlyphs = 'DockWindowButtonGlyphs'; + + // skin group panel + sdxGroupPanel = 'GroupPanel'; + sdxGroupPanelBottom = 'GroupPanelBottom'; + sdxGroupPanelCaptionBottom = 'GroupPanelCaptionBottom'; + sdxGroupPanelCaptionLeft = 'GroupPanelCaptionLeft'; + sdxGroupPanelCaptionRight = 'GroupPanelCaptionRight'; + sdxGroupPanelCaptionTop = 'GroupPanelCaptionTop'; + sdxGroupPanelLeft = 'GroupPanelLeft'; + sdxGroupPanelNoBorder = 'GroupPanelNoBorder'; + sdxGroupPanelRight = 'GroupPanelRight'; + sdxGroupPanelTop = 'GroupPanelTop'; + + sdxButton = 'Button'; + sdxCheckbox = 'Checkbox'; + sdxClock = 'ClockFace'; + sdxClockGlass = 'ClockGlass'; + sdxNavigatorGlyphs = 'Navigator'; + sdxNavigatorGlyphsVert = 'NavigatorVert'; + sdxProgressBorder = 'ProgressBorder'; + sdxProgressBorderVert = 'ProgressBorderVert'; + sdxProgressChunk = 'ProgressChunk'; + sdxProgressChunkVert = 'ProgressChunkVert'; + sdxRadioGroup = 'RadioButton'; + sdxScrollButton = 'ScrollButton'; + sdxScrollContentHorz = 'ScrollContentHorz'; + sdxScrollContentVert = 'ScrollContentVert'; + sdxScrollThumbButtonHorz = 'ScrollThumbHorz'; + sdxScrollThumbButtonVert = 'ScrollThumbVert'; + sdxSizeGrip = 'SizeGrip'; + sdxSplitterHorz = 'SplitterHorz'; + sdxSplitterVert = 'Splitter'; + sdxScreenTipItem = 'ScreenTipItem'; + sdxScreenTipSeparator = 'ScreenTipSeparator'; + sdxScreenTipTitleItem = 'ScreenTipTitleItem'; + sdxScreenTipWindow = 'ScreenTipWindow'; + + // trackbar + sdxTrackBarThumb = 'TrackBarThumb'; + sdxTrackBarThumbBoth = 'TrackBarThumbBoth'; + sdxTrackBarThumbUp = 'TrackBarThumbUp'; + sdxTrackBarThumbVert = 'TrackBarThumbVert'; + sdxTrackBarThumbVertBoth = 'TrackBarThumbVertBoth'; + sdxTrackBarThumbVertUp = 'TrackBarThumbVertUp'; + sdxTrackBarTrack = 'TrackBarTrack'; + sdxTrackBarTrackVert = 'TrackBarTrackVert'; + + // pagecontrol + sdxPageControlHeaderBottom = 'TabHeaderBottom'; + sdxPageControlHeaderLeft = 'TabHeaderLeft'; + sdxPageControlHeaderRight = 'TabHeaderRight'; + sdxPageControlHeaderTop = 'TabHeader'; + sdxPageControlHorz = 'TabButtonHorz'; + sdxPageControlPane = 'TabPane'; + sdxPageControlVert = 'TabButtonVert'; + + sdxHeaderDownGrow = 'HeaderDownGrow'; + sdxRowIndentFar = 'RowIndentFar'; + sdxRowIndentNear = 'RowIndentNear'; + sdxSelectedHeaderDownGrow = 'SelectedHeaderDownGrow'; + sdxSelectedHeaderHGrow = 'SelectedHeaderHGrow'; + sdxSelectedHeaderUpGrow = 'SelectedHeaderUpGrow'; + + // grid + sdxCardSeparator = 'CardSeparator'; + sdxFilterButton = 'FilterButton'; + sdxFilterButtonActive = 'FilterButtonActive'; + sdxFilterPanel = 'GridFilterPanel'; + sdxFooterCell = 'FooterCell'; + sdxFooterPanel = 'FooterPanel'; + sdxGridLine = 'GridLine'; + sdxGroupByBox = 'GridGroupPanel'; + sdxGroupRow = 'GroupRow'; + sdxHeader = 'Header'; + sdxHeaderLeft = 'HeaderLeft'; + sdxHeaderRight = 'HeaderRight'; + sdxHeaderSpecial = 'HeaderSpecial'; + sdxIndicatorImages = 'IndicatorImages'; + sdxGridFixedLine = 'GridFixedLine'; + + sdxPlusMinus = 'PlusMinus'; + sdxPlusMinusEx = 'PlusMinusEx'; + + sdxVGridBandLine = 'BandBorder'; + sdxVGridLine = 'GridLine'; + sdxVGridRow = 'Row'; + sdxVGridRowHeader = 'Category'; + + // form + sdxTextShadowColor = 'TextShadowColor'; + + sdxFormFrameLeft = 'FormFrameLeft'; + sdxFormCaption = 'FormCaption'; + sdxFormContent = 'FormContent'; + sdxFormFrameRight = 'FormFrameRight'; + sdxFormFrameBottom = 'FormFrameBottom'; + + sdxSmallFormFrameLeft = 'SmallFormFrameLeft'; + sdxSmallFormCaption = 'SmallFormCaption'; + sdxSmallFormFrameRight = 'SmallFormFrameRight'; + sdxSmallFormFrameBottom = 'SmallFormFrameBottom'; + + sdxFormButtonClose = 'FormButtonClose'; + sdxFormButtonHelp = 'FormButtonHelp'; + sdxFormButtonMaximize = 'FormButtonMaximize'; + sdxFormButtonMinimize = 'FormButtonMinimize'; + sdxFormButtonRestore = 'FormButtonRestore'; + sdxSmallFormButtonClose = 'SmallFormButtonClose'; + sdxStatusBar = 'StatusBar'; + + // xml storage + sdxItem = 'Item'; + sdxItems = 'Items'; + + sdxControlParts = 'ControlParts'; + sdxGlyph = 'Glyph'; + sdxImage = 'Image'; + sdxName = 'Name'; + sdxParentName = 'Parent'; + sdxPart = 'Part'; + sdxVersion = 'Version'; + + // layout orientation + sdxLayoutHorz = 'Horizontal'; + sdxLayoutVert = 'Vertical'; + + // properties + sdxBoolean = 'Boolean'; + sdxColor = 'Color'; + sdxContent = 'Content'; + sdxImageCount = 'ImageCount'; + sdxRect = 'Rect'; + sdxSize = 'Size'; + sdxString = 'String'; + sdxTextColor = 'TextColor'; + + // stretch mode + sdxStretch = 'Stretch'; + sdxTile = 'Tile'; + sdxNoResize = 'NoResize'; + + // bitmap + sdxFile = 'File'; + sdxLayout = 'Layout'; + sdxStates = 'States'; + sdxMargins = 'Margins'; + + // rect + sdxBorders = 'Borders'; + sdxThin = 'Thin'; + + sdxLeft = 'Left'; + sdxTop = 'Top'; + sdxRight = 'Right'; + sdxBottom = 'Bottom'; + + // size + sdxWidth = 'Width'; + sdxHeight = 'Height'; + + // Gradient + sdxGradientBeginColor = 'GradientBeginColor'; + sdxGradientEndColor = 'GradientEndColor'; + sdxGradientMode = 'GradientMode'; + sdxGradientModeBackwardDiagonal = 'BackwardDiagonal'; + sdxGradientModeForwardDiagonal = 'ForwardDiagonal'; + sdxGradientModeHorizontal = 'Horizontal'; + sdxGradientModeVertical = 'Vertical'; + +const + CommonGroup: array[0..18] of string = + (sdxSkinGroupCommon, + sdxButton, sdxGroupPanel, sdxGroupPanelBottom, sdxGroupPanelCaptionBottom, + sdxGroupPanelCaptionLeft, sdxGroupPanelCaptionRight, sdxGroupPanelCaptionTop, + sdxGroupPanelLeft, sdxGroupPanelRight, sdxGroupPanelTop, sdxScrollButton, + sdxScrollContentHorz, sdxScrollContentVert, sdxScrollThumbButtonHorz, + sdxScrollThumbButtonVert, sdxSizeGrip, sdxSplitterHorz, sdxSplitterVert); + + EditorsGroup: array[0..22] of string = + (sdxSkinGroupEditors, + sdxCheckbox, sdxCloseButton, sdxComboButtonGlyph, sdxEditorButton, sdxNavigatorGlyphs, + sdxProgressBorder, sdxProgressBorderVert, sdxProgressChunk, sdxProgressChunkVert, + sdxRadioGroup, sdxSpinDownGlyph, sdxSpinLeftGlyph, sdxSpinRightGlyph, sdxSpinUpGlyph, + sdxTrackBarThumb, sdxTrackBarThumbBoth, sdxTrackBarThumbUp, sdxTrackBarThumbVert, + sdxTrackBarThumbVertBoth, sdxTrackBarThumbVertUp, sdxTrackBarTrack, sdxTrackBarTrackVert); + + GridGroup: array[0..14] of string = + (sdxSkinGroupGrid, + sdxFilterButton, sdxFilterButtonActive, sdxFilterPanel, sdxFooterCell, sdxFooterPanel, + sdxGroupByBox, sdxGroupRow, sdxHeader, sdxHeaderLeft, sdxHeaderRight, sdxHeaderSpecial, + sdxIndicatorImages, sdxPlusMinus, sdxPlusMinusEx); + + TabGroup: array[0..5] of string = + (sdxSkinGroupTabs, + sdxPageControlHeaderBottom, sdxPageControlHeaderLeft, + sdxPageControlHeaderRight, sdxPageControlHeaderTop, sdxPageControlPane); + + VGridGroup: array[0..4] of string = + (sdxSkinGroupVGrid, + sdxVGridBandLine, sdxVGridLine, sdxVGridRow, sdxVGridRowHeader); + + FormGroup: array[0..13] of string = + (sdxFormFrameLeft, sdxFormCaption, sdxFormFrameRight, sdxFormFrameBottom, + sdxSmallFormFrameLeft, sdxSmallFormCaption, sdxSmallFormFrameRight, + sdxSmallFormFrameBottom, sdxSmallFormButtonClose, sdxFormButtonClose, + sdxFormButtonMinimize, sdxFormButtonMaximize, sdxFormButtonRestore, sdxFormButtonHelp); + + EditButtonsMap: array[TcxEditBtnKind] of string = (sdxCloseButton, sdxComboButtonGlyph, + sdxEditorButton, sdxEditorButton, sdxSpinUpGlyph, sdxSpinDownGlyph, + sdxSpinLeftGlyph, sdxSpinRightGlyph); + + FormFrameMap: array[Boolean, TcxBorder] of string = + ((sdxFormFrameLeft, sdxSmallFormCaption, sdxFormFrameRight, sdxFormFrameBottom), + (sdxFormFrameLeft, sdxFormCaption, sdxFormFrameRight, sdxFormFrameBottom)); + +implementation + +end. + diff --git a/official/x.35/ExpressNavBar 2/EULA.txt b/official/x.35/ExpressNavBar 2/EULA.txt new file mode 100644 index 00000000..522f4bf7 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/EULA.txt @@ -0,0 +1,119 @@ +DEVELOPER EXPRESS INC +ExpressNavBar 2(tm) COMPONENT SUITE +Copyright (C) 2002-2008 Developer Express Inc. + +END-USER LICENSE AGREEMENT +FOR ALL SOFTWARE COMPONENT PRODUCT(S) + +IMPORTANT- READ CAREFULLY: This DEVELOPER EXPRESS INC ("DEVEXPRESS") End-User License Agreement ("EULA") is a legal agreement between you, a developer of software applications, ("Developer End User") and DEVEXPRESS for all DEVEXPRESS products, controls, source code, demos, intermediate files, media, printed materials, and "online" or electronic documentation ("SOFTWARE COMPONENT PRODUCT(S)") contained in this installation file. + +DEVEXPRESS grants to you as an individual, a personal, nonexclusive license to install and use the SOFTWARE COMPONENT PRODUCT(S) for the sole purposes of designing, developing, testing, and deploying application programs which you create. By installing, copying, or otherwise using the SOFTWARE COMPONENT PRODUCT(S), you agree to be bound by the terms of this EULA. If you do not agree to any part of the terms of this EULA, DO NOT INSTALL, USE, EVALUATE, OR REPLICATE IN ANY MANNER, ANY PART, FILE OR PORTION OF THE SOFTWARE COMPONENT PRODUCT(S). + +All SOFTWARE COMPONENT PRODUCT(S) is licensed, not sold. If you are an individual, you must acquire an individual license for the SOFTWARE COMPONENT PRODUCT(S) from DEVEXPRESS or its authorized resellers. If you are an entity, you must acquire and assign an individual license for each Developer End User within your organization using and or developing with the SOFTWARE COMPONENT PRODUCT(S) from DEVEXPRESS or its authorized resellers. + +If the SOFTWARE COMPONENT PRODUCT(S) you have obtained is marked as a "TRIAL" or "EVALUATION," you may install one copy of the SOFTWARE COMPONENT PRODUCT(S) for testing purposes for a period of 30 calendar days from the date of installation ("Evaluation Period"). Upon expiration of the Evaluation Period, the SOFTWARE COMPONENT PRODUCT(S) must be uninstalled and all copies destroyed. + +RIGOROUS ENFORCEMENT OF INTELLECTUAL PROPERTY RIGHTS. If the licensed right of use for this SOFTWARE COMPONENT PRODUCT(S) is purchased by you with any intent to reverse engineer, decompile, create derivative works, and the exploitation or unauthorized transfer of, any DEVEXPRESS intellectual property and trade secrets, to include any exposed methods or source code where provided, no licensed right of use shall exist, and any PRODUCT(s) created as a result shall be judged illegal by definition of all applicable law. Any sale or resale of intellectual property or created derivatives so obtained will be prosecuted to the fullest extent of all local, federal and international law. + +1. GRANT OF LICENSE. + +This EULA, if legally executed as defined herein, licenses and so grants the single individual Developer End User the following rights: + +SOFTWARE COMPONENT PRODUCT(S) - Developer End User may install and use the SOFTWARE COMPONENT PRODUCT(S) on a single computer. Developer End User may also install and use the SOFTWARE COMPONENT PRODUCT(S) on a portable computer. + +2. LIMITATIONS ON REVERSE ENGINEERING, DECOMPILATION, AND DISASSEMBLY. + +You may not reverse engineer, decompile, create derivative works, translate, or disassemble the SOFTWARE COMPONENT PRODUCT(S), and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation. You agree to take all reasonable, legal and appropriate measures to prohibit the illegal dissemination of the SOFTWARE COMPONENT PRODUCT(S) or any of its constituent parts and redistributables to the fullest extent of all applicable local, US Codes and International Laws and Treaties regarding anti-circumvention, including but not limited to, the Geneva and Berne World Intellectual Property Organization (WIPO) Diplomatic Conferences. + +3. SEPARATION OF COMPONENTS. + +The SOFTWARE COMPONENT PRODUCT(S) is licensed as a single PRODUCT(s). The SOFTWARE COMPONENT PRODUCT(S) and its constituent parts and any provided redistributables may not be reverse engineered, decompiled, disassembled or separated for use on more than one computer, nor placed for distribution, sale, or resale as individual creations by Developer End User. The provision of source code, if included with the SOFTWARE COMPONENT PRODUCT(S), does not constitute transfer of any legal rights to such code, and resale or distribution of all or any portion of all source code and intellectual property will be prosecuted to the fullest extent of all applicable local, federal and international laws. All DEVEXPRESS libraries, source code, redistributables and other files remain DEVEXPRESS's exclusive property. You may not distribute any files, except those that DEVEXPRESS has expressly designated as Redistributable. + +4. RENTAL. + +You may not rent, lease, or lend the SOFTWARE COMPONENT PRODUCT(S). + +5. TRANSFER. + +You may NOT permanently or temporarily transfer ANY of your rights under this EULA to any individual or entity without prior written approval from DEVEXPRESS. Regardless of any modifications which you make and regardless of how you might compile, link, and/or package your programs, under no circumstances may the libraries, Redistributables, and/or other files of the SOFTWARE COMPONENT PRODUCT(S) (including any portions thereof) be used for developing programs by anyone other than you. Only you as the licensed Developer End User have the right to use the libraries, redistributables, or other files of the SOFTWARE COMPONENT PRODUCT(S) (or any portions thereof) for developing programs created with the SOFTWARE COMPONENT PRODUCT(S). In particular, you may not share copies of the Redistributables with other co-developers. You may not reproduce or distribute any DEVEXPRESS documentation without DEVEXPRESS's explicit permission. + +If you are an entity (Company), you must acquire and assign a license to each Developer End User within your organization using and or developing with the SOFTWARE COMPONENT PRODUCT(S). With written notification to DEVEXPRESS, Company may transfer the license obtained for a Developer End User to another Developer End User employed or otherwise engaged by Company if the initial Developer End User is no longer employed or engaged by Company or is reassigned to another function within Company and no longer develops software applications using the SOFTWARE COMPONENT PRODUCT(S). In addition, with written notification to DEVEXPRESS, Company may transfer its license of the SOFTWARE COMPONENT PRODUCT(S) to a successor Company. + +6. ROYALTY FREE REDISTRIBUTION. + +DEVEXPRESS PRODUCT(s) may include certain files ("Redistributable(s)") intended for distribution by you to the users of software applications which you create. Redistributables include, for example, those files identified in printed or on-line documentation as redistributable files, or those files preselected for deployment by an install utility provided with the SOFTWARE COMPONENT PRODUCT(S) (if any). In all circumstances, the Redistributables for the SOFTWARE COMPONENT PRODUCT(S) are only those files specifically designated as such by DEVEXPRESS. + +Subject to all of the terms and conditions in this EULA, you may reproduce and distribute copies of the Redistributables, provided that such copies are made from the original copy of the Redistributables included with the SOFTWARE COMPONENT PRODUCT(S) or modified versions of the Redistributables which are provided to you by DEVEXPRESS or those which you create. Copies of Redistributables may only be distributed with and for the sole purpose of executing application programs permitted under this EULA that you have created using the SOFTWARE COMPONENT PRODUCT(S). + +REDISTRIBUTABLES. To obtain a list of redistributables that apply under this EULA, contact support@devexpress.com + +AT NO TIME MAY DEVELOPER END USER CREATE ANY TOOL, REDISTRIBUTABLE, OR SOFTWARE COMPONENT PRODUCT(S) THAT DIRECTLY OR INDIRECTLY COMPETES WITH DEVEXPRESS SOFTWARE COMPONENT PRODUCT(S) WHICH UTILIZES ALL OR ANY PORTION OF THE SOFTWARE COMPONENT PRODUCT(S) contained within this installation. + +Distribution by the Developer End User of any design-time tools (EXE's OCX's or DLL's), executables, and source code distributed to Developer End User by DEVEXPRESS as part of this SOFTWARE COMPONENT PRODUCT(S) and not explicitly identified as a redistributable file is strictly prohibited. The Developer End User shall not develop software applications that provide an application programming interface to the SOFTWARE COMPONENT PRODUCT(S) or the SOFTWARE COMPONENT PRODUCT(S) as modified. + +The Developer End User may NOT distribute the SOFTWARE COMPONENT PRODUCT(S), in any format, to other users for development or application compilation purposes. Specifically, if Developer End User creates a control using the SOFTWARE COMPONENT PRODUCT(S) as a constituent control, Developer End User may NOT distribute the control created with the SOFTWARE COMPONENT PRODUCT(S) (in any format) to users to be used used at design time and or for ANY development purposes. + +Developer End User MAY NOT REDISTRIBUTE any SOFTWARE COMPONENT PRODUCT(s) files if using an evaluation, trial, Not for Resale, or demo version of the SOFTWARE COMPONENT PRODUCT(s). + +7. UPGRADES. + +If the SOFTWARE COMPONENT PRODUCT(S) is labeled as an upgrade, you must be properly licensed to use the SOFTWARE COMPONENT PRODUCT(S) identified by DEVEXPRESS as being eligible for the upgrade in order to use the SOFTWARE COMPONENT PRODUCT(S). A SOFTWARE COMPONENT PRODUCT(S) labeled as an upgrade replaces and/or supplements the SOFTWARE COMPONENT PRODUCT(S) that formed the basis for your eligibility for the upgrade, and together constitutes a single PRODUCT(S). You may use the resulting upgraded PRODUCT(S) only in accordance with all the terms of this EULA. + +8. COPYRIGHT. + +All title and copyrights in and to the SOFTWARE COMPONENT PRODUCT(S) (including but not limited to any copywritten images, demos, source code, intermediate files, packages, photographs, redistributables, animations, video, audio, music, text, and "applets" incorporated into the SOFTWARE COMPONENT PRODUCT(S) the accompanying printed materials, and any copies of the SOFTWARE COMPONENT PRODUCT(S)) are owned by DEVEXPRESS or its subsidiaries. The SOFTWARE COMPONENT PRODUCT(S) is protected by copyright laws and international treaty provisions and therefore, you must treat the SOFTWARE COMPONENT PRODUCT(S) like any other copyrighted material except that you may install the SOFTWARE COMPONENT PRODUCT(S) as described in this EULA. + +9. DUAL-MEDIA SOFTWARE COMPONENT PRODUCT(S). + +You may receive the SOFTWARE COMPONENT PRODUCT(S) in more than one medium. Regardless of the medium, you may use only one medium that is appropriate for your single computer. You may not loan, sell, rent, lease, or otherwise transfer in any manner the other medium to another user or entity. + +10. U.S. GOVERNMENT RESTRICTED RIGHTS. + +The Licensed Software is Commercial Computer Software provided with RESTRICTED RIGHTS under Federal Acquisition Regulations and agency supplements to them. Use, duplication or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFAR 255.227-7013 et. seq. or 252.211-7015, or subparagraphs (a) through (d) of the Commercial Computer Software Restricted Rights at FAR 52.227-19, as applicable, or similar clauses in the NASA FAR Supplement. Contractor-manufacturer is Developer Express Inc. / 6375 S. Pecos Rd Suite 118, Las Vegas NV 89120. + +11. EXPORT RESTRICTIONS. + +DEVEXPRESS expressly complies with all export restrictions imposed by the government of the United States of America. You, as Developer End User, must agree not to export or re-export the SOFTWARE COMPONENT PRODUCT(S) within any created application to any country, person, entity or end user subject to U.S.A. export restrictions. Restricted countries currently include, but are not necessarily limited to Cuba, Iran, Iraq, Libya, North Korea, Sudan, and Syria. You warrant and represent that neither the U.S.A. Bureau of Export Administration nor any other federal agency has suspended, revoked or denied your export privileges. + +12. NOTE ON JAVA SUPPORT. + +Certain SOFTWARE COMPONENT PRODUCT(S) may contain support for programs written in Java. Java technology is not fault tolerant and is not designed, manufactured, or intended for use or resale as on-line control equipment in hazardous environments requiring fail-safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines, or weapons systems, in which the failure of Java technology could lead directly to death, personal injury, or severe physical or environmental damage. + +13. DISCLAIMER OF WARRANTY. + +DEVEXPRESS expressly disclaims any warranty for the SOFTWARE COMPONENT PRODUCT(S). THE SOFTWARE COMPONENT PRODUCT(S) AND ANY RELATED DOCUMENTATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. DEVEXPRESS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY REPRESENTATIONS REGARDING THE USE, OR THE RESULTS OF THE USE, OF THE SOFTWARE COMPONENT PRODUCT(S) IN TERMS OF CORRECTNESS, ACCURACY, RELIABILITY, OR OTHERWISE. THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE COMPONENT PRODUCT(S) REMAINS WITH YOU. No oral or written information or advice given by DEVEXPRESS or its employees shall create a warranty or in any way increase the scope of this warranty. + +14. LIMITATIONS ON LIABILITY. + +To the maximum extent permitted by applicable law, in no event shall DEVEXPRESS be liable for any special, incidental, indirect, or consequential damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use the SOFTWARE COMPONENT PRODUCT(S) or the provision of or failure to provide Support Services, even if DEVEXPRESS has been advised of the possibility of such damages. + +Developer End User understands that the SOFTWARE COMPONENT PRODUCT(S) may produce inaccurate results because of a failure or fault within the SOFTWARE COMPONENT PRODUCT(S) or failure by Developer End User to properly use and or deploy the SOFTWARE COMPONENT PRODUCT(S). Developer End User assumes full and sole responsibility for any use of the SOFTWARE COMPONENT PRODUCT(S), and bears the entire risk for failures or faults within the SOFTWARE COMPONENT PRODUCT(S). You agree that regardless of the cause of failure or fault or the form of any claim, YOUR SOLE REMEDY AND DEVEXPRESS'S SOLE OBLIGATION SHALL BE GOVERNED BY THIS AGREEMENT AND IN NO EVENT SHALL DEVEXPRESS'S LIABILITY EXCEED THE PRICE PAID TO DEVEXPRESS FOR THE SOFTWARE COMPONENT PRODUCT(S). This Limited Warranty is void if failure of the SOFTWARE COMPONENT PRODUCT(S) has resulted from accident, abuse, alteration, unauthorized use or misapplication of the SOFTWARE COMPONENT PRODUCT(S). + +15. INDEMNIFICATION. + +You hereby agree to indemnify DEVEXPRESS and its officers, directors, employees, agents, and representatives from each and every demand, claim, loss, liability, or damage of any kind, including actual attorneys fees, whether in tort or contract, that it or any of them may incur by reason of, or arising out of, any claim which is made by any third party with respect to any breach or violation of this Agreement by you or any claims based on the Applications and the SOFTWARE COMPONENT PRODUCT(S) included herein. + +16. SUPPORT SERVICES. + +DEVEXPRESS may provide you with support services related to the SOFTWARE COMPONENT PRODUCT(S) ("Support Services"). Use of Support Services is governed by DEVEXPRESS policies and programs described in the user manual, in "on line" documentation and/or other DEVEXPRESS provided materials. Any supplemental SOFTWARE COMPONENT PRODUCT(S) provided to you as part of the Support Services shall be considered part of the SOFTWARE COMPONENT PRODUCT(S) and subject to the terms and conditions of this EULA. With respect to technical information you provide to DEVEXPRESS as part of the Support Services, DEVEXPRESS may use such information for its business purposes, including for SOFTWARE COMPONENT PRODUCT(s) support and development. DEVEXPRESS will not utilize such technical information in a form that personally identifies you. + +17. TERMINATION. + +Without prejudice to any other rights or remedies, DEVEXPRESS will terminate this EULA upon your failure to comply with all the terms and conditions of this EULA. In such events, you must destroy all copies of the SOFTWARE COMPONENT PRODUCT(S) and all of its component parts including any related documentation, and must remove ANY and ALL use of such technology immediately from any applications using technology contained in the SOFTWARE COMPONENT PRODUCT(S) developed by you, whether in native, altered or compiled state. + +18. TAX. + +DEVEXPRESS delivers its software electronically and does not collect sales or use tax for residents of US states in which it operates. You should confirm that your local, state, or federal government does not impose any sales or use tax on electronically delivered software. You are entirely liable for any such sales or use tax. + +19. MISCELLANEOUS. + +This EULA shall be construed, interpreted and governed by the laws of the State of Nevada, U.S.A. This EULA gives you specific legal rights; you may have others that vary from state to state and from country to country. + +This EULA may only be modified in writing signed by you and an authorized officer of DEVELOPER EXPRESS INC. If any provision of this EULA is found void or unenforceable, the remainder will remain valid and enforceable according to its terms. If any remedy provided is determined to have failed for its essential purpose, all limitations of liability and exclusions of damages set forth in the Limited Warranty shall remain in effect. + +DEVEXPRESS reserves all rights not specifically granted in this EULA. + +ACKNOWLEDGEMENTS. Developer End User acknowledges that he or she has read this Agreement, understands it, and agrees to be bound by its terms and conditions. + +Should you have any questions concerning this EULA, or if you desire to contact DEVEXPRESS for any reason, please contact us directly at us in the United States of America at 702-262-0609, or write: Developer Express Inc. Legal department / 6330 McLeod Dr Suite 1, Las Vegas NV 89120. + diff --git a/official/x.35/ExpressNavBar 2/Help/ExpressNavBar2.cnt b/official/x.35/ExpressNavBar 2/Help/ExpressNavBar2.cnt new file mode 100644 index 00000000..3ce59595 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Help/ExpressNavBar2.cnt @@ -0,0 +1,124 @@ +:Base ExpressNavBar2.hlp +:Title ExpressNavBar Suite 2 +:Index ExpressNavBar Suite 2=ExpressNavBar2.hlp +1 ExpressNavBar 2 +2 Overview=Overview +2 What's New in v2=CD_Whats_New_in_v2 +2 Known Issues and Important Changes List=CD_Known_Issues_and_Important_Changes_List +2 Quick Start +3 Step 1 - Creating a Layout=Step_1_Creating_a_Layout +3 Step 2 - Assigning Images=Step_2_Assigning_Images +3 Step 3 - Modifying Styles=Step_3_Modifying_Styles +2 Glossary +3 Group=IDH_Term_Group +3 Item=IDH_Term_Item +3 Link=IDH_Term_Link +3 Active Group=IDH_Term_Active_Group +3 Expanded Group=IDH_Term_Expanded_Group +3 Group Header=IDH_Term_Group_Header +3 Large images=IDH_Term_Large_images +3 Small images=IDH_Term_Small_images +3 Icon view=IDH_Term_Icon_view +3 Group hint=IDH_Term_Group_hint +3 Link hint=IDH_Term_Link_hint +3 Default Style=IDH_Term_Default_Style +3 Custom Style=IDH_Term_Custom_Style +3 View=IDH_Term_View +3 Side Bar View=IDH_Term_SideBar_View +3 Explorer Bar View=IDH_Term_ExplorerBar_View +3 Group Header Sign=IDH_Term_Group_Header_Sign +3 Scroll Button=IDH_Term_Scroll_Button +3 Navigation Pane's Header Section=IDH_Term_NavPaneHeaderSection +3 Navigation Pane's Splitter=IDH_Term_NavPaneSplitter +3 Navigation Pane's Overflow Panel=IDH_Term_NavPaneOverflowPanel +3 Navigation Pane's Context Menu=IDH_Term_NavPaneContextMenu +3 Collapsed Navigation Pane=CD_NavBarTerm_Collapsed_Navigation_Pane +2 Concepts +3 Groups, Links and Items +4 Customizing Group Layout=IDH_Concept_Customizing_Group_Layout +4 Embedding Controls into Groups=Embedding_Controls_into_Groups +4 Expanding and Collapsing Groups=IDH_Concept_Expanding_and_Collapsing_Groups +4 Link Arrangement=IDH_Concept_Links_Arrangement +4 Linking Groups and Items=IDH_Concept_Linking_Groups_And_Items +4 Selecting and Clicking Links=IDH_Concept_Selecting_and_Clicking_Links +3 Views +4 Differences in Side Bar and Explorer Bar Views=IDH_Concept_Differences_in_the_SideBar_and_ExplorerBar_Views +4 Expanding and Collapsing Navigation Panes=CD_Concept_Expanding_and_Collapsing_Navigation_Panes +4 Registering Custom Views=IDH_Concept_Registering_Custom_Views +3 Hints +4 Link & Group Hints=IDH_Concept_Link_and_Group_Hints +3 Styles +4 Style Settings=IDH_Concept_Style_Settings +4 Assigning Styles to Elements=IDH_Concept_Assigning_Styles_to_Elements +3 Drag and Drop +4 Internal and External Drag & Drop Operations=IDH_Concept_Internal_and_External_Drag_and_Drop_Operations +3 Custom Painting +4 Custom Draw Basics=IDH_Concept_Custom_Draw_Basics +4 Custom Painting Hints=IDH_Concept_Hints_Custom_Painting +4 Custom Painting Static Elements=IDH_Concept_Custom_Painting_of_Static_Elements +4 Custom Painting Active Elements=IDH_Concept_Custom_Painting_of_Active_Elements +4 GDI+ Library Overview=IDH_Concept_GDIplus_Library_Overview +3 Saving and Restoring Settings +4 Saving and Restoring NavBar Settings=Saving_and_Restoring_NavBar_Settings +2 Reference +3 TdxCustomNavBar=IDH_Class_TcxCustomNavBar +3 TdxNavBar=IDH_Class_TcxNavBar +3 Units +4 dxNavBar Unit Overview=IDH_Unit_dxNavBar +4 dxNavBarBase Unit Overview=IDH_Unit_cxNavBarBase +4 dxNavBarCollns Unit Overview=IDH_Unit_cxNavBarCollns +4 dxNavBarGroupItems Unit Overview=IDH_Unit_dxNavBarGroupItems +4 dxNavBarStyles Unit Overview=IDH_Unit_cxNavBarStyles +4 cxNavBarViewsFact Unit Overview=IDH_Unit_cxNavBarViewsFact +4 cxNavBarConsts Unit Overview=IDH_Unit_cxNavBarConsts +3 Base Collection and Item Objects +4 TdxNavBarCustomItem=IDH_Class_TdxNavBarCustomItem +4 TdxNavBarComponentCollection=IDH_Class_TcxNavBarComponentCollection +4 TdxNavBarComponentCollectionItem=IDH_Class_TcxNavBarComponentCollectionItem +3 Groups +4 TdxNavBarGroup=IDH_Class_TcxNavBarGroup +4 TdxNavBarGroups=IDH_Class_TcxNavBarGroups +3 Items +4 TdxNavBarItem=IDH_Class_TcxNavBarItem +4 TdxNavBarItems=IDH_Class_TcxNavBarItems +4 TdxNavBarSeparator=IDH_Class_TdxNavBarSeparator +3 Links +4 TdxNavBarItemLink=IDH_Class_TcxNavBarItemLink +4 TdxNavBarItemLinks=IDH_Class_TcxNavBarItemLinks +3 Styles +4 TdxNavBarBaseStyle=IDH_Class_TdxNavBarBaseStyle +4 TdxNavBarBaseCustomStyles=IDH_Class_TdxNavBarBaseCustomStyles +4 TdxNavBarDefaultStyle=IDH_Class_TdxNavBarDefaultStyle +4 TdxNavBarDefaultStyles=IDH_Class_TcxNavBarDefaultStyles +4 TdxNavBarCustomStyles=IDH_Class_TdxNavBarCustomStyles +4 TdxNavBarGroupCustomStyles=IDH_Class_TdxNavBarGroupCustomStyles +4 TdxNavBarItemCustomStyles=IDH_Class_TdxNavBarItemCustomStyles +4 TdxNavBarStyle=IDH_Class_TcxNavBarStyle +4 TdxNavBarStyleItem=IDH_Class_TcxNavBarStyleItem +4 TdxNavBarStyleRepository=IDH_Class_TdxNavBarStyleRepository +3 Views +4 TdxNavBarViewsFactory=IDH_Class_TcxNavBarViewsFactory +4 dxNavBarViewsFactory function=IDH_cxNavBarViewsFact_cxNavBarViewsFactory +3 View Infos +4 TdxNavBarViewInfo=IDH_Class_TcxNavBarViewInfo +4 TdxNavBarGroupViewInfo=IDH_Class_TcxNavBarGroupViewInfo +4 TdxNavBarLinkViewInfo=IDH_Class_TcxNavBarLinkViewInfo +3 Base Painters +4 TdxNavBarCustomBackgroundPainter=IDH_Class_TdxNavBarCustomBackgroundPainter +4 TdxNavBarCustomButtonPainter=IDH_Class_TdxNavBarCustomButtonPainter +4 TdxNavBarCustomHintPainter=IDH_Class_TdxNavBarCustomHintPainter +4 TdxNavBarCustomImagePainter=IDH_Class_TdxNavBarCustomImagePainter +4 TdxNavBarCustomScrollButtonsPainter=IDH_Class_TdxNavBarCustomScrollButtonsPainter +4 TdxNavBarCustomSelectionPainter=IDH_Class_TdxNavBarCustomSelectionPainter +4 TdxNavBarCustomSignPainter=IDH_Class_TdxNavBarCustomSignPainter +3 Constants and Variables +4 dxNavBarDefaultLargeImageHeight constant=IDH_Const_cxNavBarDefaultLargeImageHeight +4 dxNavBarDefaultLargeImageWidth constant=IDH_Const_cxNavBarDefaultLargeImageWidth +4 dxNavBarDefaultSmallImageHeight constant=IDH_Const_cxNavBarDefaultSmallImageHeight +4 dxNavBarDefaultSmallImageWidth constant=IDH_Const_cxNavBarDefaultSmallImageWidth +4 dxNavBarScrollInterval constant=IDH_Const_cxNavBarScrollInterval +4 dxNavBarDragObject variable=IDH_Var_dxNavBarDragObject +3 Types and Other Objects +4 TdxBarStyleHAlignment=IDH_Type_TcxBarStyleHAlignment +4 TdxBarStyleVAlignment=IDH_Type_TcxBarStyleVAlignment +4 TdxBarStyleGradientMode=IDH_Type_TcxBarStyleGradientMode diff --git a/official/x.35/ExpressNavBar 2/Help/ExpressNavBar2.hlp b/official/x.35/ExpressNavBar 2/Help/ExpressNavBar2.hlp new file mode 100644 index 00000000..467b43c5 Binary files /dev/null and b/official/x.35/ExpressNavBar 2/Help/ExpressNavBar2.hlp differ diff --git a/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarC11.bpk b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarC11.bpk new file mode 100644 index 00000000..c770a999 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarC11.bpk @@ -0,0 +1,183 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxNavBarC11.bpl +OBJFILES = dxNavBarReg.obj dxfmNavBarDsgnEditor.obj \ + dxNavBarDsgnConsts.obj dxNavBarDsgnUtils.obj \ + dcldxNavBarC11.obj +MAINSOURCE = dcldxNavBarC11.cpp +RESFILES = dcldxNavBarC11.res dxNavBarReg.dcr dxfmNavBarDsgnEditor.dfm +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = vcl.lib rtl.lib +PACKAGES = rtl.bpi vcl.bpi dxNavBarC11.bpi designide.bpi cxLibraryC11.bpi dclcxLibraryC11.bpi +DEFFILE = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;""$(SEARCHPATH)"";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;""$(SEARCHPATH)"";$(LIBDIR) +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressNavBar 2 by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarC11.cpp b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarC11.cpp new file mode 100644 index 00000000..6253bdfb --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarC11.cpp @@ -0,0 +1,25 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxNavBarC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxNavBarC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dclLibraryC11.bpi"); +USEUNIT("dxNavBarReg.pas"); +USERES("dxNavBarReg.dcr"); +USEUNIT("dxfmNavBarDsgnEditor.pas"); +USEUNIT("dxNavBarDsgnConsts.pas"); +USEUNIT("dxNavBarDsgnUtils.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarC11.res b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarC11.res new file mode 100644 index 00000000..fed3fa99 Binary files /dev/null and b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarC11.res differ diff --git a/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD10.dpk b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD10.dpk new file mode 100644 index 00000000..c68e5043 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD10.dpk @@ -0,0 +1,40 @@ +package dcldxNavBarD10; + +{$R *.res} +{$R dxNavBarReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressNavBar 2 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + dclcxLibraryD10, + dxNavBarD10; + +contains + dxNavBarDsgnConsts, + dxfmNavBarDsgnEditor, + dxNavBarDsgnUtils, + dxNavBarReg; + +end. diff --git a/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD10.res b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD10.res new file mode 100644 index 00000000..7647fd95 Binary files /dev/null and b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD10.res differ diff --git a/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD11.dpk b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD11.dpk new file mode 100644 index 00000000..b40a5a99 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD11.dpk @@ -0,0 +1,40 @@ +package dcldxNavBarD11; + +{$R *.res} +{$R dxNavBarReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressNavBar 2 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + dclcxLibraryD11, + dxNavBarD11; + +contains + dxNavBarDsgnConsts, + dxfmNavBarDsgnEditor, + dxNavBarDsgnUtils, + dxNavBarReg; + +end. diff --git a/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD11.res b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD11.res new file mode 100644 index 00000000..8cb444d2 Binary files /dev/null and b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD11.res differ diff --git a/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD7.dpk b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD7.dpk new file mode 100644 index 00000000..9a3cc8f6 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD7.dpk @@ -0,0 +1,40 @@ +package dcldxNavBarD7; + +{$R *.res} +{$R dxNavBarReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressNavBar 2 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + dclcxLibraryVCLD7, + dxNavBarD7; + +contains + dxNavBarDsgnConsts, + dxfmNavBarDsgnEditor, + dxNavBarDsgnUtils, + dxNavBarReg; + +end. diff --git a/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD7.res b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD7.res new file mode 100644 index 00000000..98bb9f60 Binary files /dev/null and b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD7.res differ diff --git a/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD9.dpk b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD9.dpk new file mode 100644 index 00000000..3ee95b56 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD9.dpk @@ -0,0 +1,40 @@ +package dcldxNavBarD9; + +{$R *.res} +{$R dxNavBarReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressNavBar 2 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + dclcxLibraryD9, + dxNavBarD9; + +contains + dxNavBarDsgnConsts, + dxfmNavBarDsgnEditor, + dxNavBarDsgnUtils, + dxNavBarReg; + +end. diff --git a/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD9.res b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD9.res new file mode 100644 index 00000000..3eee5b3a Binary files /dev/null and b/official/x.35/ExpressNavBar 2/Packages/dcldxNavBarD9.res differ diff --git a/official/x.35/ExpressNavBar 2/Packages/dxNavBarC11.bpk b/official/x.35/ExpressNavBar 2/Packages/dxNavBarC11.bpk new file mode 100644 index 00000000..18cbd9ce --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Packages/dxNavBarC11.bpk @@ -0,0 +1,186 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxNavBarC11.bpl +OBJFILES = dxNavBarBase.obj dxNavBar.obj \ + dxNavBarViewsFact.obj dxNavBarStyles.obj \ + dxNavBarCollns.obj dxNavBarConsts.obj \ + dxNavBarBaseViews.obj dxNavBarXPViews.obj \ + dxNavBarExplorerViews.obj dxNavBarGraphics.obj \ + dxNavBarOfficeViews.obj dxNavBarVSToolBoxViews.obj \ + dxNavBarOffice11Views.obj dxNavBarOffice12Views.obj dxNavBarC11.obj \ + dxNavBarVistaViews.obj dxNavBarCustomPainters.obj dxNavBarSkinBasedViews.obj \ + dxNavBarGroupItems.obj dxNavBarAccessibility.obj +MAINSOURCE = dxNavBarC11.cpp +RESFILES = dxNavBarC11.res +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = vcljpg.lib vcl.lib trl.lib +PACKAGES = rtl.bpi vcl.bpi vcljpg.bpi dxThemeC11.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressNavBar 2 by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressNavBar 2/Packages/dxNavBarC11.cpp b/official/x.35/ExpressNavBar 2/Packages/dxNavBarC11.cpp new file mode 100644 index 00000000..5ac39420 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Packages/dxNavBarC11.cpp @@ -0,0 +1,39 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxNavBarC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vcljpg.bpi"); +USEUNIT("dxNavBarXPViews.pas"); +USEUNIT("dxNavBar.pas"); +USEUNIT("dxNavBarBase.pas"); +USEUNIT("dxNavBarBaseViews.pas"); +USEUNIT("dxNavBarCollns.pas"); +USEUNIT("dxNavBarConsts.pas"); +USEUNIT("dxNavBarExplorerViews.pas"); +USEUNIT("dxNavBarGraphics.pas"); +USEUNIT("dxNavBarOfficeViews.pas"); +USEUNIT("dxNavBarStyles.pas"); +USEUNIT("dxNavBarViewsFact.pas"); +USEUNIT("dxNavBarVSToolBoxViews.pas"); +USEUNIT("dxNavBarOffice11Views.pas"); +USEUNIT("dxNavBarOffice12Views.pas"); +USEUNIT("dxNavBarVistaViews.pas"); +USEUNIT("dxNavBarCustomPainters.pas"); +USEUNIT("dxNavBarSkinBasedViews.pas"); +USEUNIT("dxNavBarGroupItems.pas"); +USEUNIT("dxNavBarAccessibility.pas"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressNavBar 2/Packages/dxNavBarC11.res b/official/x.35/ExpressNavBar 2/Packages/dxNavBarC11.res new file mode 100644 index 00000000..b09b0f4f Binary files /dev/null and b/official/x.35/ExpressNavBar 2/Packages/dxNavBarC11.res differ diff --git a/official/x.35/ExpressNavBar 2/Packages/dxNavBarD10.dpk b/official/x.35/ExpressNavBar 2/Packages/dxNavBarD10.dpk new file mode 100644 index 00000000..09f47e60 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Packages/dxNavBarD10.dpk @@ -0,0 +1,55 @@ +package dxNavBarD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressNavBar 2 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcljpg, + cxLibraryD10; + +contains + dxNavBar, + dxNavBarStyles, + dxNavBarCollns, + dxNavBarViewsFact, + dxNavBarVSToolBoxViews, + dxNavBarXPViews, + dxNavBarExplorerViews, + dxNavBarOfficeViews, + dxNavBarBaseViews, + dxNavBarConsts, + dxNavBarBase, + dxNavBarGraphics, + dxNavBarOffice11Views, + dxNavBarOffice12Views, + dxNavBarVistaViews, + dxNavBarCustomPainters, + dxNavBarSkinBasedViews, + dxNavBarGroupItems, + dxNavBarAccessibility; + +end. + diff --git a/official/x.35/ExpressNavBar 2/Packages/dxNavBarD10.res b/official/x.35/ExpressNavBar 2/Packages/dxNavBarD10.res new file mode 100644 index 00000000..70975c5d Binary files /dev/null and b/official/x.35/ExpressNavBar 2/Packages/dxNavBarD10.res differ diff --git a/official/x.35/ExpressNavBar 2/Packages/dxNavBarD11.dpk b/official/x.35/ExpressNavBar 2/Packages/dxNavBarD11.dpk new file mode 100644 index 00000000..48389b28 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Packages/dxNavBarD11.dpk @@ -0,0 +1,55 @@ +package dxNavBarD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressNavBar 2 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcljpg, + cxLibraryD11; + +contains + dxNavBar, + dxNavBarStyles, + dxNavBarCollns, + dxNavBarViewsFact, + dxNavBarVSToolBoxViews, + dxNavBarXPViews, + dxNavBarExplorerViews, + dxNavBarOfficeViews, + dxNavBarBaseViews, + dxNavBarConsts, + dxNavBarBase, + dxNavBarGraphics, + dxNavBarOffice11Views, + dxNavBarOffice12Views, + dxNavBarVistaViews, + dxNavBarCustomPainters, + dxNavBarSkinBasedViews, + dxNavBarGroupItems, + dxNavBarAccessibility; + +end. + diff --git a/official/x.35/ExpressNavBar 2/Packages/dxNavBarD11.res b/official/x.35/ExpressNavBar 2/Packages/dxNavBarD11.res new file mode 100644 index 00000000..844312fe Binary files /dev/null and b/official/x.35/ExpressNavBar 2/Packages/dxNavBarD11.res differ diff --git a/official/x.35/ExpressNavBar 2/Packages/dxNavBarD7.dpk b/official/x.35/ExpressNavBar 2/Packages/dxNavBarD7.dpk new file mode 100644 index 00000000..5a6920e6 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Packages/dxNavBarD7.dpk @@ -0,0 +1,55 @@ +package dxNavBarD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressNavBar 2 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcljpg, + cxLibraryVCLD7; + +contains + dxNavBar, + dxNavBarStyles, + dxNavBarCollns, + dxNavBarViewsFact, + dxNavBarVSToolBoxViews, + dxNavBarXPViews, + dxNavBarExplorerViews, + dxNavBarOfficeViews, + dxNavBarBaseViews, + dxNavBarConsts, + dxNavBarBase, + dxNavBarGraphics, + dxNavBarOffice11Views, + dxNavBarOffice12Views, + dxNavBarVistaViews, + dxNavBarCustomPainters, + dxNavBarSkinBasedViews, + dxNavBarGroupItems, + dxNavBarAccessibility; + +end. + diff --git a/official/x.35/ExpressNavBar 2/Packages/dxNavBarD7.res b/official/x.35/ExpressNavBar 2/Packages/dxNavBarD7.res new file mode 100644 index 00000000..1649162a Binary files /dev/null and b/official/x.35/ExpressNavBar 2/Packages/dxNavBarD7.res differ diff --git a/official/x.35/ExpressNavBar 2/Packages/dxNavBarD9.dpk b/official/x.35/ExpressNavBar 2/Packages/dxNavBarD9.dpk new file mode 100644 index 00000000..0c25546f --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Packages/dxNavBarD9.dpk @@ -0,0 +1,55 @@ +package dxNavBarD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressNavBar 2 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcljpg, + cxLibraryD9; + +contains + dxNavBar, + dxNavBarStyles, + dxNavBarCollns, + dxNavBarViewsFact, + dxNavBarVSToolBoxViews, + dxNavBarXPViews, + dxNavBarExplorerViews, + dxNavBarOfficeViews, + dxNavBarBaseViews, + dxNavBarConsts, + dxNavBarBase, + dxNavBarGraphics, + dxNavBarOffice11Views, + dxNavBarOffice12Views, + dxNavBarVistaViews, + dxNavBarCustomPainters, + dxNavBarSkinBasedViews, + dxNavBarGroupItems, + dxNavBarAccessibility; + +end. + diff --git a/official/x.35/ExpressNavBar 2/Packages/dxNavBarD9.res b/official/x.35/ExpressNavBar 2/Packages/dxNavBarD9.res new file mode 100644 index 00000000..10777a56 Binary files /dev/null and b/official/x.35/ExpressNavBar 2/Packages/dxNavBarD9.res differ diff --git a/official/x.35/ExpressNavBar 2/Sources/cxVer.inc b/official/x.35/ExpressNavBar 2/Sources/cxVer.inc new file mode 100644 index 00000000..a26364cc --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/cxVer.inc @@ -0,0 +1,172 @@ +{$B-} { Complete Boolean Evaluation } +{$R-} { Range-Checking } +{$T-} { Typed @ operator } +{$X+} { Extended syntax } +{$P+} { Open string params } +{$J+} { Writeable structured consts } +{$H+} { Use long strings by default } +{$Q-} { Overflow checking } + +{$DEFINE DXVER500} + +{$IFNDEF CLR} + {$DEFINE OLEDRAGANDDROP} + {$IFNDEF DONTUSEJPEGIMAGE} + {$DEFINE USEJPEGIMAGE} + {$ENDIF} +{$ENDIF} + +{$DEFINE EXPRESSBARS5} + +{$DEFINE VCL} + +{$IFNDEF VER80} + {$IFNDEF VER90} + {$IFNDEF VER93} + {$DEFINE DELPHI3} { Borland Delphi 3.0 } + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER110} { Borland C++Builder 3.0 } + {$DEFINE CBUILDER3} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE DELPHI4} +{$ENDIF} + +{$IFDEF VER125} { Borland C++Builder 4.0 } + {$DEFINE CBUILDER3} + {$DEFINE DELPHI4} + {$DEFINE CBUILDER4} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$IFDEF BCB} { Borland C++Builder 5.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$IFDEF BCB} { Borland C++Builder 6.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} +{$ENDIF} + +{$IFNDEF DELPHI6} + {$DEFINE MSWINDOWS} +{$ENDIF} +{$IFDEF LINUX} + {$UNDEF MSWINDOWS} +{$ENDIF} + +{$IFDEF LINUX} + {$DEFINE KYLIX1} { Borland Kylix 1 } + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF CompilerVersion >= 14} + {$DEFINE KYLIX2} { Borland Kylix 2 } + {$IFEND} + {$IF CompilerVersion >= 14.50} + {$DEFINE KYLIX3} { Borland Kylix 3 } + {$IFEND} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} { Borland Delphi.Net } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} +{$ENDIF} + +{$IFDEF VER170} { Borland Delphi 9.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} +{$ENDIF} + +{$IFDEF VER180} { Borland Delphi 10 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$IFDEF BCB} { Borland C++Builder 10 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Borland Delphi 11 //CodeGear} + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$DEFINE DELPHI11} + {$IFDEF BCB} { Borland C++Builder 11 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$DEFINE CBUILDER11} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFNDEF CLR} + {$IFNDEF BCB} + {$IFDEF DELPHI6} + {$DEFINE REGISTERSHELLCTRLS} + {$ENDIF} + {$ENDIF} + {$IFDEF DELPHI7} + {$WARN UNSAFE_CAST OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_TYPE OFF} + {$ENDIF} +{$ENDIF} + +{$IFDEF REGISTERSHELLCTRLS} + {$DEFINE REGISTERCXSHELLCTRLS} +{$ENDIF} + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBar.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBar.pas new file mode 100644 index 00000000..14d2c63e --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBar.pas @@ -0,0 +1,8077 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBar; + +{$I cxVer.inc} + +interface + +uses + Classes, {$IFDEF DELPHI6}Types, {$ENDIF}IniFiles, Registry, Windows, Messages, + Graphics, Controls, Forms, ImgList, StdCtrls, ExtCtrls, Contnrs, + cxScrollBar, cxClasses, cxGraphics, cxGeometry, + cxControls, dxNavBarBase, dxNavBarCollns, dxNavBarStyles, dxNavBarConsts, + dxThemeManager, cxLookAndFeels, cxAccessibility, cxLibraryConsts; + +type + TdxNavBarDragDropFlag = (fAllowDragLink, fAllowDropLink, fAllowDragGroup, fAllowDropGroup); + TdxNavBarDragDropFlags = set of TdxNavBarDragDropFlag; + TdxNavBarObjectState = (sActive, sDisabled, sExpanded, sHotTracked, sPressed, sSelected, sSpecial, sFocused); + TdxNavBarObjectStates = set of TdxNavBarObjectState; + TdxNavBarChildKind = (nbckGroup, nbckItem, nbckStyle, nbckGroupControl); + +const + nbNone = -1; + dxNavBarDefaultDragDropFlags = [fAllowDragLink, fAllowDropLink, fAllowDragGroup, fAllowDropGroup]; + dxNavBarHintWindowSizeCorrection = 6; + dxNavBarHintWindowTextOffset: TPoint = (X: 2; Y: 2); + +type + TdxCustomNavBar = class; + TdxNavBarViewInfo = class; + TdxNavBarGroupViewInfo = class; + TdxNavBarPainter = class; + TdxNavBarHintWindow = class; + TdxNavBarScrollBar = class; + TdxNavBarController = class; + TdxNavBarControllerClass = class of TdxNavBarController; + + { TdxNavBarPersistent } + + TdxNavBarPersistent = class(TPersistent) + private + FNavBar: TdxCustomNavBar; + protected + function GetOwner: TPersistent; override; + public + constructor Create(ANavBar: TdxCustomNavBar); virtual; + property NavBar: TdxCustomNavBar read FNavBar; + end; + + TdxNavBarCustomViewInfo = class + protected + FNavBar: TdxCustomNavBar; + FPainter: TdxNavBarPainter; + FRatio: Double; + property Ratio: Double read FRatio; + function GetRevisedValue(AValue: Integer): Integer; + public + constructor Create; + + property NavBar: TdxCustomNavBar read FNavBar; + property Painter: TdxNavBarPainter read FPainter; + end; + + TdxNavBarCustomItemViewInfo = class(TdxNavBarCustomViewInfo) + protected + FCaptionFont: TFont; + FCaptionRect: TRect; + FCaptionVisible: Boolean; + FDesignRect: TRect; + FImageRect: TRect; + FImageVisible: Boolean; + FFocusRect: TRect; + FRect: TRect; + + FViewInfo: TdxNavBarViewInfo; + + procedure CalcDesignRect(const AItemRect: TRect; AMarkSize: Integer); + function GetNavBarItem: TdxNavBarCustomItem; virtual; abstract; + function GetImageList: TCustomImageList; virtual; + function GetState: TdxNavBarObjectStates; virtual; + function IsEnabled: Boolean; + function IsFocused: Boolean; + function IsSelected: Boolean; + function UseDisabledImages: Boolean; virtual; + function UseHotImages: Boolean; virtual; + function UseLargeImages: Boolean; virtual; + public + constructor Create(AViewInfo: TdxNavBarViewInfo); + destructor Destroy; override; + + procedure CorrectBounds(dX, dY: Integer); virtual; + function ImageIndex: Integer; virtual; + + // Rectangles + property CaptionRect: TRect read FCaptionRect; + property DesignRect: TRect read FDesignRect; + property ImageRect: TRect read FImageRect; + property FocusRect: TRect read FFocusRect; + property Rect: TRect read FRect; + + property ImageList: TCustomImageList read GetImageList; + property State: TdxNavBarObjectStates read GetState; + property ViewInfo: TdxNavBarViewInfo read FViewInfo; + end; + + TdxNavBarLinkViewInfo = class(TdxNavBarCustomItemViewInfo) + private + FGroupViewInfo: TdxNavBarGroupViewInfo; + FLink: TdxNavBarItemLink; + FItem: TdxNavBarItem; + protected + function GetNavBarItem: TdxNavBarCustomItem; override; + function GetState: TdxNavBarObjectStates; override; + public + constructor Create(AGroupViewInfo: TdxNavBarGroupViewInfo; ALink: TdxNavBarItemLink; ACaptionVisible, AImageVisisble: Boolean); + + // Calculation + procedure CalculateBounds(X, Y: Integer); virtual; + + // Sizes + function GetCaptionHeight: Integer; virtual; + function GetDrawEdgeFlag: Integer; virtual; + function GetImageHeight: Integer; virtual; + function GetImageWidth: Integer; virtual; + + // Conditions + function IsCaptionVisible: Boolean; + function IsImageVisible: Boolean; + function IsWholeVisible: Boolean; + + // Style attributes + function StyleItem: TdxNavBarStyleItem; virtual; + function Style: TdxNavBarBaseStyle; virtual; + function Font: TFont; virtual; + function FontColor: TColor; virtual; + function UseLargeImages: Boolean; override; + + // Rectangles + function SelectionRect: TRect; virtual; + + // Object links + property Link: TdxNavBarItemLink read FLink; + property Item: TdxNavBarItem read FItem; + property GroupViewInfo: TdxNavBarGroupViewInfo read FGroupViewInfo; + end; + TdxNavBarLinkViewInfoClass = class of TdxNavBarLinkViewInfo; + + TdxNavBarGroupViewInfo = class(TdxNavBarCustomItemViewInfo) + private + FItems: TList; + FGroup: TdxNavBarGroup; + FItemsVisible: Boolean; + + function GetControl: TdxNavBarGroupControl; + function GetControlBackColor: TColor; + function GetControlBackColor2: TColor; + function GetItemCount: Integer; + function GetItem(Index: Integer): TdxNavBarLinkViewInfo; + function IsDefaultControlStyle: Boolean; + protected + FCaptionSignRect: TRect; + FCaptionTextRect: TRect; + FItemsRect: TRect; + + procedure AddLink(AViewInfo: TdxNavBarViewInfo; ALink: TdxNavBarItemLink; ACaptionVisible, AImageVisisble: Boolean); + procedure ClearItems; + procedure DoCreateItemsInfo; virtual; + + function GetControlRect: TRect; virtual; + + procedure AdjustControlBounds; virtual; + function GetNavBarItem: TdxNavBarCustomItem; override; + function GetState: TdxNavBarObjectStates; override; + public + constructor Create(AViewInfo: TdxNavBarViewInfo; AGroup: TdxNavBarGroup; ACaptionVisible, AItemsVisible: Boolean); + destructor Destroy; override; + + // Calculation + procedure CreateInfo; virtual; + procedure CreateItemsInfo; + procedure CalculateBounds(var X, Y: Integer); virtual; + procedure CorrectBounds(dX, dY: Integer); override; + procedure CorrectActiveGroupBounds(dX, dY: Integer); virtual; + + function GetLinkViewInfoByLink(ALink: TdxNavBarItemLink): TdxNavBarLinkViewInfo; + function IndexOfLinkViewInfo(AViewInfo: TdxNavBarLinkViewInfo): Integer; + + // Sizes + function GetCaptionHeight: Integer; virtual; + function GetDrawEdgeFlag: Integer; virtual; + function GetImageHeight: Integer; virtual; + function GetImageWidth: Integer; virtual; + + // Conditions + function IsCaptionVisible: Boolean; + function IsCaptionImageVisible: Boolean; + function IsCaptionSignVisible: Boolean; + function IsCaptionUseSmallImages: Boolean; + function IsItemsVisible: Boolean; + function IsLinksUseSmallImages: Boolean; + function IsViewAsIconView: Boolean; + + // Styles attributes + function BorderColor: TColor; virtual; + function BgImage: TPicture; virtual; + function BgBackColor: TColor; virtual; + function BgBackColor2: TColor; virtual; + function BgAlphaBlend: Byte; virtual; + function BgAlphaBlend2: Byte; virtual; + function BgGradientMode: TdxBarStyleGradientMode; virtual; + function CaptionStyleItem: TdxNavBarStyleItem; virtual; + function CaptionStyle: TdxNavBarBaseStyle; virtual; + function CaptionImage: TPicture; virtual; + function CaptionBorderColor: TColor; virtual; + function CaptionBackColor: TColor; virtual; + function CaptionBackColor2: TColor; virtual; + function CaptionAlphaBlend: Byte; virtual; + function CaptionAlphaBlend2: Byte; virtual; + function CaptionGradientMode: TdxBarStyleGradientMode; virtual; + function CaptionFont: TFont; virtual; + function CaptionFontColor: TColor; virtual; + function CaptionSignColor: TColor; virtual; + function CaptionHAlignment: TdxBarStyleHAlignment; virtual; + function CaptionVAlignment: TdxBarStyleVAlignment; virtual; + function ControlImage: TPicture; virtual; + function ControlBackColor: TColor; virtual; + function ControlBackColor2: TColor; virtual; + function ControlAlphaBlend: Byte; virtual; + function ControlAlphaBlend2: Byte; virtual; + function ControlGradientMode: TdxBarStyleGradientMode; virtual; + function UseLargeImages: Boolean; override; + + // Rectangles + property CaptionImageRect: TRect read FImageRect; + property CaptionSignRect: TRect read FCaptionSignRect; + property CaptionTextRect: TRect read FCaptionTextRect; + property ControlRect: TRect read GetControlRect; + property ItemsRect: TRect read FItemsRect; + + // Object links + property Control: TdxNavBarGroupControl read GetControl; + property ItemCount: Integer read GetItemCount; + property Items[Index: Integer]: TdxNavBarLinkViewInfo read GetItem; + property Group: TdxNavBarGroup read FGroup; + end; + TdxNavBarGroupViewInfoClass = class of TdxNavBarGroupViewInfo; + + TdxNavBarCalcHintEvent = procedure (AItem: TObject; var ARect: TRect) of object; + TdxNavBarViewInfo = class(TdxNavBarCustomViewInfo) + private + FGroups: TObjectList; + FHeaderFont: TFont; + FTopScrollButtonRect: TRect; + FBottomScrollButtonRect: TRect; + FHintRect: TRect; + FHintText: string; + + function GetGroupCount: Integer; + function GetGroup(Index: Integer): TdxNavBarGroupViewInfo; + function GetBottomScrollButtonState: TdxNavBarObjectStates; + function GetTopScrollButtonState: TdxNavBarObjectStates; + protected + // Colors + procedure CreateColors; virtual; + procedure RefreshColors; virtual; + procedure ReleaseColors; virtual; + + function ClientHeight: Integer; + function ClientWidth: Integer; + function GetSpaceBetweenGroups: Integer; + function GetLargeImageHeight: Integer; + function GetLargeImageWidth: Integer; + function GetSmallImageHeight: Integer; + function GetSmallImageWidth: Integer; + + // Group + function GetGroupBorderOffsets: TRect; virtual; + function GetGroupCaptionHeightAddon: Integer; virtual; + class function GetGroupCaptionTextIndent: Integer; virtual; + class function GetGroupCaptionImageIndent: Integer; virtual; + function GetGroupSeparatorWidth: Integer; virtual; + function GetGroupCaptionSignSize: TSize; virtual; + function GetGroupEdges: TPoint; virtual; + class function GetGroupCaptionSeparatorWidth: Integer; virtual; + + // Link + class function GetLinksLargeSeparatorWidth: Integer; virtual; + class function GetLinksSmallSeparatorWidth: Integer; virtual; + class function GetLinksIconViewSeparatorWidth: Integer; virtual; + function GetLinksImageEdges: TRect; virtual; + + // Sizes + class function GetDragArrowHeight: Integer; virtual; + class function GetDragArrowWidth: Integer; virtual; + function GetHeaderHeightAddon: Integer; virtual; + function GetNavBarCollapsedWidth: Integer; virtual; + function GetNavBarMinExpandedWidth: Integer; virtual; + class function GetScrollButtonVerticalEdge: Integer; virtual; + class function GetScrollButtonHorizontalEdge: Integer; virtual; + class function GetScrollButtonVerticalSize: Integer; virtual; + class function GetScrollButtonHorizontalSize: Integer; virtual; + + // Conditions + function CanCollapse: Boolean; virtual; + function CanHasActiveGroup: Boolean; virtual; + function CanHasSpecialGroup: Boolean; virtual; + function CanHasScrollButtonInGroupCaption: Boolean; virtual; + function CanHasImageInGroupCaption: Boolean; virtual; + function CanHasSignInGroupCaption: Boolean; virtual; + function CanHasGroupViewAsIconView: Boolean; virtual; + function CanHasGroupWithNoCaption: Boolean; virtual; + function CanHasVisibleItemsInGroup(AGroup: TdxNavBarGroup): Boolean; virtual; + function CanGroupCaptionBoundsByImage: Boolean; virtual; + function CanGroupsUseLargeImages: Boolean; virtual; + function CanLinksUseLargeImages: Boolean; virtual; + function CanSelectLinkByRect: Boolean; virtual; + + procedure AddGroup(AViewInfo: TdxNavBarViewInfo; AGroup: TdxNavBarGroup; ACaptionVisible, AItemsVisible: Boolean); + procedure RemoveGroup(AGroupViewInfo: TdxNavBarGroupViewInfo); + procedure ClearGroups; + + // Correction + procedure AdjustControlsBounds; virtual; + procedure CorrectBounds; virtual; + + function GetBoundsUpdateType: TdxNavBarChangeType; virtual; + function GetTopScrollButtonRect: TRect; virtual; + function GetBottomScrollButtonRect: TRect; virtual; + + // Calculations + procedure DoCreateGroupsInfo; virtual; + procedure DoCalculateBounds(X, Y: Integer); virtual; + + function IsGroupActive(AGroup: TdxNavBarGroup): Boolean; virtual; + procedure DoGroupActiveToggle(AGroup: TdxNavBarGroup); virtual; + procedure DoGroupActivate(AGroup: TdxNavBarGroup); virtual; + procedure DoGroupDeactivate(AGroup: TdxNavBarGroup); virtual; + procedure MakeLinkVisible(ALink: TdxNavBarItemLink; ATop: Boolean = True); virtual; + procedure MakeGroupVisible(AGroup: TdxNavBarGroup; + AExpandGroup: Boolean = True; ATop: Boolean = True); virtual; + public + constructor Create(APainter: TdxNavBarPainter); virtual; + destructor Destroy; override; + // Calculation + procedure CreateInfo; virtual; + procedure CreateGroupsInfo; + procedure CalculateBounds; + procedure CalculateScrollButtonsBounds; virtual; + procedure ClearRects; virtual; + // Styles attributes + function BgImage: TPicture; virtual; + function BgBackColor: TColor; virtual; + function BgBackColor2: TColor; virtual; + function BgAlphaBlend: Byte; virtual; + function BgAlphaBlend2: Byte; virtual; + function BgGradientMode: TdxBarStyleGradientMode; virtual; + function BorderColor: TColor; virtual; + function BottomScrollButtonStyleItem: TdxNavBarStyleItem; virtual; + function BottomScrollButtonStyle: TdxNavBarBaseStyle; virtual; + function BottomScrollButtonImage: TPicture; virtual; + function BottomScrollButtonBackColor: TColor; virtual; + function BottomScrollButtonBackColor2: TColor; virtual; + function BottomScrollButtonAlphaBlend: Byte; virtual; + function BottomScrollButtonAlphaBlend2: Byte; virtual; + function BottomScrollButtonGradientMode: TdxBarStyleGradientMode; virtual; + function TopScrollButtonStyleItem: TdxNavBarStyleItem; virtual; + function TopScrollButtonStyle: TdxNavBarBaseStyle; virtual; + function TopScrollButtonImage: TPicture; virtual; + function TopScrollButtonBackColor: TColor; virtual; + function TopScrollButtonBackColor2: TColor; virtual; + function TopScrollButtonAlphaBlend: Byte; virtual; + function TopScrollButtonAlphaBlend2: Byte; virtual; + function TopScrollButtonGradientMode: TdxBarStyleGradientMode; virtual; + function HintImage: TPicture; virtual; + function HintBackColor: TColor; virtual; + function HintBackColor2: TColor; virtual; + function HintAlphaBlend: Byte; virtual; + function HintAlphaBlend2: Byte; virtual; + function HintGradientMode: TdxBarStyleGradientMode; virtual; + function HintFont: TFont; virtual; + function DragDropItemTargetBackColor: TColor; virtual; + function DragDropGroupTargetBackColor: TColor; virtual; + function DragDropGroupTargetBackColor2: TColor; virtual; + function DragDropGroupTargetAlphaBlend: Byte; virtual; + function DragDropGroupTargetAlphaBlend2: Byte; virtual; + function DragDropGroupTargetGradient: TdxBarStyleGradientMode; virtual; + function HeaderImage: TPicture; virtual; + function HeaderBackColor: TColor; virtual; + function HeaderBackColor2: TColor; virtual; + function HeaderAlphaBlend: Byte; virtual; + function HeaderAlphaBlend2: Byte; virtual; + function HeaderGradientMode: TdxBarStyleGradientMode; virtual; + function HeaderFont: TFont; virtual; + function HeaderFontColor: TColor; virtual; + function HeaderHAlignment: TdxBarStyleHAlignment; virtual; + function HeaderVAlignment: TdxBarStyleVAlignment; virtual; + function HeaderDrawEdgeFlag: Integer; + function OverflowPanelImage: TPicture; virtual; + function OverflowPanelBackColor: TColor; virtual; + function OverflowPanelBackColor2: TColor; virtual; + function OverflowPanelAlphaBlend: Byte; virtual; + function OverflowPanelAlphaBlend2: Byte; virtual; + function OverflowPanelGradientMode: TdxBarStyleGradientMode; virtual; + function OverflowPanelFont: TFont; virtual; + function OverflowPanelFontColor: TColor; virtual; + function SplitterBackColor: TColor; virtual; + function SplitterBackColor2: TColor; virtual; + function SplitterAlphaBlend: Byte; virtual; + function SplitterAlphaBlend2: Byte; virtual; + function SplitterGradientMode: TdxBarStyleGradientMode; virtual; + // Default styles + procedure AssignDefaultBackgroundStyle; virtual; + procedure AssignDefaultButtonStyle; virtual; + procedure AssignDefaultButtonPressedStyle; virtual; + procedure AssignDefaultButtonHotTrackedStyle; virtual; + procedure AssignDefaultGroupControlStyle; virtual; + procedure AssignDefaultGroupBackgroundStyle; virtual; + procedure AssignDefaultGroupHeaderStyle; virtual; + procedure AssignDefaultGroupHeaderActiveStyle; virtual; + procedure AssignDefaultGroupHeaderActiveHotTrackedStyle; virtual; + procedure AssignDefaultGroupHeaderActivePressedStyle; virtual; + procedure AssignDefaultGroupHeaderHotTrackedStyle; virtual; + procedure AssignDefaultGroupHeaderPressedStyle; virtual; + procedure AssignDefaultHintStyle; virtual; + procedure AssignDefaultItemStyle; virtual; + procedure AssignDefaultItemDisabledStyle; virtual; + procedure AssignDefaultItemHotTrackedStyle; virtual; + procedure AssignDefaultItemPressedStyle; virtual; + procedure AssignDefaultDropTargetGroupStyle; virtual; + procedure AssignDefaultDropTargetLinkStyle; virtual; + procedure AssignDefaultNavigationPaneHeaderStyle; virtual; + // Groups + function ActiveGroupViewInfo: TdxNavBarGroupViewInfo; + function GetGroupViewInfoByGroup(AGroup: TdxNavBarGroup): TdxNavBarGroupViewInfo; + function GetLinkViewInfoByLink(ALink: TdxNavBarItemLink): TdxNavBarLinkViewInfo; + function IndexOfGroupViewInfo(AViewInfo: TdxNavBarGroupViewInfo): Integer; + // Hit tests + function GetGroupViewInfoAtPos(const pt: TPoint): TdxNavBarGroupViewInfo; + function GetGroupViewInfoAtCaptionPos(const pt: TPoint): TdxNavBarGroupViewInfo; virtual; + function GetGroupViewInfoAtItemsPos(const pt: TPoint): TdxNavBarGroupViewInfo; virtual; + function GetGroupAtCaptionPos(const pt: TPoint): TdxNavBarGroup; + function GetGroupAtItemsPos(const pt: TPoint): TdxNavBarGroup; + + function GetLinkViewInfoAtPos(const pt: TPoint): TdxNavBarLinkViewInfo; virtual; + function GetLinkViewInfoAtSelectedPos(const pt: TPoint): TdxNavBarLinkViewInfo; virtual; + function GetLinkAtPos(const pt: TPoint): TdxNavBarItemLink; + function GetLinkAtSelectedPos(const pt: TPoint): TdxNavBarItemLink; + function GetViewInfoAtDragPosition(const pt: TPoint; var ItemGroup: TdxNavBarGroupViewInfo; + var Item1, Item2: TdxNavBarLinkViewInfo): Integer; virtual; + function GetViewInfoAtDragPositionWhenIconView(const pt: TPoint; var ItemGroup: TdxNavBarGroupViewInfo; + var Item1, Item2: TdxNavBarLinkViewInfo): Integer; virtual; + function GetLinksAtDragPosition(const pt: TPoint; var ItemGroup: TdxNavBarGroup; + var Item1, Item2: TdxNavBarItemLink): Integer; + function IsPtGroupDesignRect(const pt: TPoint): Boolean; + function IsPtItemDesignRect(const pt: TPoint): Boolean; +// function IsPtNavigationPaneHeader(const pt: TPoint): Boolean; virtual; +// function IsPtNavigationPaneSplitter(const pt: TPoint): Boolean; virtual; +// function IsPtNavigationPaneOverflowPanel(const pt: TPoint): Boolean; virtual; +// function GetNavigationPaneOverflowPanelItemIndexAtPos(const pt: TPoint): Integer; virtual; +// function GetNavigationPaneOverflowPanelGroupAtPos(const pt: TPoint): TdxNavBarGroup; virtual; + // Scroll buttons + function IsTopScrollButtonVisible: Boolean; + function IsBottomScrollButtonVisible: Boolean; + function IsPtTopScrollButton(const pt: TPoint): Boolean; + function IsPtBottomScrollButton(const pt: TPoint): Boolean; + property TopScrollButtonRect: TRect read FTopScrollButtonRect; + property BottomScrollButtonRect: TRect read FBottomScrollButtonRect; + property TopScrollButtonState: TdxNavBarObjectStates read GetTopScrollButtonState; + property BottomScrollButtonState: TdxNavBarObjectStates read GetBottomScrollButtonState; + // Hint + property HintRect: TRect read FHintRect write FHintRect; + property HintText: string read FHintText write FHintText; + // Accelerators + function FindGroupWithAccel(AKey: Word): TdxNavBarGroup; virtual; + function FindLinkWithAccel(AKey: Word): TdxNavBarItemLink; virtual; + + property GroupCount: Integer read GetGroupCount; + property Groups[Index: Integer]: TdxNavBarGroupViewInfo read GetGroup; + end; + TdxNavBarViewInfoClass = class of TdxNavBarViewInfo; + + { TdxNavBarItemCalculators } + + TdxNavBarItemCalculator = class(TdxNavBarCustomGroupItemCalculator) + public + class procedure CalculateBounds(X, Y: Integer; var ALinkViewInfo); override; + end; + + TdxNavBarSeparatorCalculator = class(TdxNavBarCustomGroupItemCalculator) + public + class procedure CalculateBounds(X, Y: Integer; var ALinkViewInfo); override; + end; + + TdxNavBarPainter = class(TdxNavBarPersistent, IUnknown) + private + FNeedRecreateViewInfo: Boolean; + FNeedRecalculateViewInfo: Boolean; + FNeedRedrawCanvas: Boolean; + FViewInfo: TdxNavBarViewInfo; + FController: TdxNavBarController; + FcxCanvas: TcxCanvas; + + function GetCanvas: TCanvas; + function GetcxCanvas: TcxCanvas; + protected + { IUnknown } + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall; + + function GetMasterLookAndFeel: TcxLookAndFeel; virtual; + procedure CheckDrawParamChanges; + class function Reregistered: Boolean; virtual; + // View infos + function CreateViewInfo: TdxNavBarViewInfo; virtual; + function CreateGroupViewInfo(AViewInfo: TdxNavBarViewInfo; AGroup: + TdxNavBarGroup; ACaptionVisible, AItemsVisible: Boolean): TdxNavBarGroupViewInfo; virtual; + function CreateLinkViewInfo(AViewInfo: TdxNavBarGroupViewInfo; ALink: TdxNavBarItemLink; + ACaptionVisible, AImageVisisble: Boolean): TdxNavBarLinkViewInfo; virtual; + class function GetViewInfoClass: TdxNavBarViewInfoClass; virtual; + class function GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; virtual; + class function GetLinkViewInfoClass: TdxNavBarLinkViewInfoClass; virtual; + // Controller + function CreateController: TdxNavBarController; + function GetControllerClass: TdxNavBarControllerClass; virtual; + // ScrollBar + function CreatecxScrollBar: TcxScrollBar; virtual; + function GetcxScrollBarClass: TcxScrollBarClass; virtual; + + function GetOwner: TPersistent; override; + function IsViewInfoValid: Boolean; + // Drawing + procedure DoDrawHint(ACanvas: TCanvas; const ARect: TRect); virtual; + procedure DrawSolidFocusRect(ARect: TRect; AColor: TColor); + public + constructor Create(ANavBar: TdxCustomNavBar); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + function DC: HDC; + // Drawing + procedure DrawNavBarControl; virtual; + procedure DrawBackground; virtual; + procedure DrawGroup(AGroupViewInfo: TdxNavBarGroupViewInfo); virtual; + procedure DrawGroupBackground(AGroupViewInfo: TdxNavBarGroupViewInfo); virtual; + procedure DrawGroupBorder(AGroupViewInfo: TdxNavBarGroupViewInfo); virtual; + procedure DrawGroupCaption(AGroupViewInfo: TdxNavBarGroupViewInfo); virtual; + procedure DrawGroupCaptionButton(AGroupViewInfo: TdxNavBarGroupViewInfo); virtual; + procedure DrawGroupCaptionText(AGroupViewInfo: TdxNavBarGroupViewInfo); virtual; + procedure DrawGroupCaptionImage(AGroupViewInfo: TdxNavBarGroupViewInfo); virtual; + procedure DrawGroupCaptionSign(AGroupViewInfo: TdxNavBarGroupViewInfo); virtual; + procedure DrawGroupControl(ACanvas: TCanvas; ARect: TRect; AGroupViewInfo: TdxNavBarGroupViewInfo); virtual; + procedure DrawGroupDesignRect(AGroupViewInfo: TdxNavBarGroupViewInfo); virtual; + procedure DrawGroupItems(AGroupViewInfo: TdxNavBarGroupViewInfo); virtual; + procedure DrawGroupFocusRect(AGroupViewInfo: TdxNavBarGroupViewInfo); virtual; + procedure DrawItem(ALinkViewInfo: TdxNavBarLinkViewInfo); virtual; + procedure DrawItemCaption(ALinkViewInfo: TdxNavBarLinkViewInfo); virtual; + procedure DrawItemDesignRect(ALinkViewInfo: TdxNavBarLinkViewInfo); virtual; + procedure DrawItemFocusRect(ALinkViewInfo: TdxNavBarLinkViewInfo); virtual; + procedure DrawItemImage(ALinkViewInfo: TdxNavBarLinkViewInfo); virtual; + procedure DrawItemSelection(ALinkViewInfo: TdxNavBarLinkViewInfo); virtual; + procedure DrawItemsRect(AGroupViewInfo: TdxNavBarGroupViewInfo); virtual; + procedure DrawSeparator(ALinkViewInfo: TdxNavBarLinkViewInfo); virtual; + procedure DrawScrollButtons; virtual; + procedure DrawBottomScrollButton; virtual; + procedure DrawTopScrollButton; virtual; + procedure DrawDropTargetGroupSelection; virtual; + procedure DrawDropTargetLinkSelection; virtual; + procedure DrawHintWindow(AHintWindow: TdxNavBarHintWindow); virtual; + procedure DrawGroupHintWindow(ACanvas: TCanvas; const ARect: TRect); virtual; + procedure DrawLinkHintWindow(ACanvas: TCanvas; const ARect: TRect); virtual; + + procedure InvalidateViewInfo(AType: TdxNavBarChangeType); + procedure InvalidateScrollButtons; + procedure Paint; + + property Canvas: TCanvas read GetCanvas; + property cxCanvas: TcxCanvas read GetcxCanvas; + property Controller: TdxNavBarController read FController; + property ViewInfo: TdxNavBarViewInfo read FViewInfo; + end; + TdxNavBarPainterClass = class of TdxNavBarPainter; + + { TdxNavBarCursors } + + TdxNavBarCursors = class(TdxNavBarPersistent) + private + FDragCopyCursor: TCursor; + FHotTrackedGroupCursor: TCursor; + FHotTrackedLinkCursor: TCursor; + + function GetCursor: TCursor; + function GetDragCursor: TCursor; + procedure SetCursor(Value: TCursor); + procedure SetDragCursor(Value: TCursor); + public + constructor Create(ANavBar: TdxCustomNavBar); override; + procedure Assign(Source: TPersistent); override; + published + property Cursor: TCursor read GetCursor write SetCursor default crDefault; + property DragCursor: TCursor read GetDragCursor write SetDragCursor default dxNavBarDragCursor; + property DragCopyCursor: TCursor read FDragCopyCursor write FDragCopyCursor default dxNavBarDragCopyCursor; + property HotTrackedGroupCursor: TCursor read FHotTrackedGroupCursor write FHotTrackedGroupCursor default crDefault; + property HotTrackedLinkCursor: TCursor read FHotTrackedLinkCursor write FHotTrackedLinkCursor default dxNavBarLinksCursor; + end; + + { TdxNavBarCustomDraw } + + TdxNavBarCustomDrawEvent = procedure(Sender: TObject; ACanvas: TCanvas; + AViewInfo: TdxNavBarViewInfo; var AHandled: Boolean) of object; + TdxNavBarCustomDrawGroupEvent = procedure(Sender: TObject; ACanvas: TCanvas; + AViewInfo: TdxNavBarGroupViewInfo; var AHandled: Boolean) of object; + TdxNavBarCustomDrawGroupHintEvent = procedure(Sender: TObject; ACanvas: TCanvas; + AGroup: TdxNavBarGroup; AHint: string; R: TRect; var AHandled: Boolean) of object; + TdxNavBarCustomDrawLinkEvent = procedure(Sender: TObject; ACanvas: TCanvas; + AViewInfo: TdxNavBarLinkViewInfo; var AHandled: Boolean) of object; + TdxNavBarCustomDrawLinkHintEvent = procedure(Sender: TObject; ACanvas: TCanvas; + ALink: TdxNavBarItemLink; AHint: string; R: TRect; var AHandled: Boolean) of object; + + TdxNavBarCustomDrawEvents = class(TdxNavBarPersistent) + private + FBackground: TdxNavBarCustomDrawEvent; + FBottomScrollButton: TdxNavBarCustomDrawEvent; + FTopScrollButton: TdxNavBarCustomDrawEvent; + FGroupCaption: TdxNavBarCustomDrawGroupEvent; + FGroupClientBackground: TdxNavBarCustomDrawGroupEvent; + FGroupClientForeground: TdxNavBarCustomDrawGroupEvent; + FGroupHint: TdxNavBarCustomDrawGroupHintEvent; + FLink: TdxNavBarCustomDrawLinkEvent; + FLinkHint: TdxNavBarCustomDrawLinkHintEvent; + FNavigationPaneHeader: TdxNavBarCustomDrawEvent; + FNavigationPaneSplitter: TdxNavBarCustomDrawEvent; + FNavigationPaneOverflowPanel: TdxNavBarCustomDrawEvent; + FNavigationPaneOverflowPanelHint: TdxNavBarCustomDrawGroupHintEvent; + public + procedure Assign(Source: TPersistent); override; + published + property Background: TdxNavBarCustomDrawEvent read FBackground write FBackground; + property GroupCaption: TdxNavBarCustomDrawGroupEvent read FGroupCaption write FGroupCaption; + property GroupClientBackground: TdxNavBarCustomDrawGroupEvent read FGroupClientBackground write FGroupClientBackground; + property GroupClientForeground: TdxNavBarCustomDrawGroupEvent read FGroupClientForeground write FGroupClientForeground; + property GroupHint: TdxNavBarCustomDrawGroupHintEvent read FGroupHint write FGroupHint; + property Link: TdxNavBarCustomDrawLinkEvent read FLink write FLink; + property LinkHint: TdxNavBarCustomDrawLinkHintEvent read FLinkHint write FLinkHint; + property BottomScrollButton: TdxNavBarCustomDrawEvent read FBottomScrollButton write FBottomScrollButton; + property TopScrollButton: TdxNavBarCustomDrawEvent read FTopScrollButton write FTopScrollButton; + property NavigationPaneHeader: TdxNavBarCustomDrawEvent read FNavigationPaneHeader write FNavigationPaneHeader; + property NavigationPaneSplitter: TdxNavBarCustomDrawEvent read FNavigationPaneSplitter write FNavigationPaneSplitter; + property NavigationPaneOverflowPanel: TdxNavBarCustomDrawEvent read FNavigationPaneOverflowPanel write FNavigationPaneOverflowPanel; + property NavigationPaneOverflowPanelHint: TdxNavBarCustomDrawGroupHintEvent read FNavigationPaneOverflowPanelHint write FNavigationPaneOverflowPanelHint; + end; + + { TdxNavBarOptions } + + { TdxNavBarBehaviorOptions } + + TdxNavBarCommonBehaviorOptions = class(TdxNavBarPersistent) + private + FDragDropFlags: TdxNavBarDragDropFlags; + FShowGroupsHint: Boolean; + FShowLinksHint: Boolean; + public + constructor Create(ANavBar: TdxCustomNavBar); override; + procedure Assign(Source: TPersistent); override; + published + property DragDropFlags: TdxNavBarDragDropFlags read FDragDropFlags write FDragDropFlags default dxNavBarDefaultDragDropFlags; + property ShowGroupsHint: Boolean read FShowGroupsHint write FShowGroupsHint default False; + property ShowLinksHint: Boolean read FShowLinksHint write FShowLinksHint default False; + end; + + TdxNavBarNavigationPaneBehaviorOptions = class(TdxNavBarPersistent) + private + FAdjustWidthByPopup: Boolean; + FAllowCustomizing: Boolean; + FCollapsible: Boolean; + FCollapsed: Boolean; + FShowOverflowPanelHints: Boolean; + + procedure SetCollapsible(Value: Boolean); + procedure SetCollapsed(Value: Boolean); + public + constructor Create(ANavBar: TdxCustomNavBar); override; + procedure Assign(Source: TPersistent); override; + published + property AdjustWidthByPopup: Boolean read FAdjustWidthByPopup write FAdjustWidthByPopup default False; + property AllowCustomizing: Boolean read FAllowCustomizing write FAllowCustomizing default True; + property Collapsible: Boolean read FCollapsible write SetCollapsible default False; + property Collapsed: Boolean read FCollapsed write SetCollapsed default False; + property ShowOverflowPanelHints: Boolean read FShowOverflowPanelHints write FShowOverflowPanelHints default True; + end; + + TdxNavBarSideBarBehaviorOptions = class(TdxNavBarPersistent) + private + FAllowSelectLinks: Boolean; + FEachGroupHasSelectedLink: Boolean; + + procedure SetAllowSelectLinks(Value: Boolean); + procedure SetEachGroupHasSelectedLink(Value: Boolean); + public + procedure Assign(Source: TPersistent); override; + published + property AllowSelectLinks: Boolean read FAllowSelectLinks write SetAllowSelectLinks default False; + property EachGroupHasSelectedLink: Boolean read FEachGroupHasSelectedLink write SetEachGroupHasSelectedLink default False; + end; + + TdxNavBarBehaviorOptions = class(TdxNavBarPersistent) + private + FCommon: TdxNavBarCommonBehaviorOptions; + FNavigationPane: TdxNavBarNavigationPaneBehaviorOptions; + FSideBar: TdxNavBarSideBarBehaviorOptions; + + procedure SetCommon(AValue: TdxNavBarCommonBehaviorOptions); + procedure SetNavigationPane(AValue: TdxNavBarNavigationPaneBehaviorOptions); + procedure SetSideBar(AValue: TdxNavBarSideBarBehaviorOptions); + public + constructor Create(ANavBar: TdxCustomNavBar); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + published + property Common: TdxNavBarCommonBehaviorOptions read FCommon write SetCommon; + property NavigationPane: TdxNavBarNavigationPaneBehaviorOptions read FNavigationPane write SetNavigationPane; + property SideBar: TdxNavBarSideBarBehaviorOptions read FSideBar write SetSideBar; + end; + + { TdxNavBarViewOptions } + + TdxNavBarCommonViewOptions = class(TdxNavBarPersistent) + private + FShowGroupCaptions: Boolean; + + procedure SetShowGroupCaptions(AValue: Boolean); + public + constructor Create(ANavBar: TdxCustomNavBar); override; + procedure Assign(Source: TPersistent); override; + published + property ShowGroupCaptions: Boolean read FShowGroupCaptions write SetShowGroupCaptions default True; + end; + + TdxNavBarExplorerBarViewOptions = class(TdxNavBarPersistent) + private + FShowSpecialGroup: Boolean; + FSpaceBetweenGroups: Integer; + + procedure SetShowSpecialGroup(Value: Boolean); + procedure SetSpaceBetweenGroups(Value: Integer); + public + procedure Assign(Source: TPersistent); override; + published + property ShowSpecialGroup: Boolean read FShowSpecialGroup write SetShowSpecialGroup default False; + property SpaceBetweenGroups: Integer read FSpaceBetweenGroups write SetSpaceBetweenGroups default 0; + end; + + TdxNavBarNavigationPaneViewOptions = class(TdxNavBarPersistent) + private + FMaxVisibleGroups: Integer; + FOverflowPanelUseSmallImages: Boolean; + FShowHeader: Boolean; + FShowOverflowPanel: Boolean; + + procedure SetMaxVisibleGroups(Value: Integer); + procedure SetOverflowPanelUseSmallImages(Value: Boolean); + procedure SetShowHeader(Value: Boolean); + procedure SetShowOverflowPanel(Value: Boolean); + public + constructor Create(ANavBar: TdxCustomNavBar); override; + procedure Assign(Source: TPersistent); override; + published + property MaxVisibleGroups: Integer read FMaxVisibleGroups write SetMaxVisibleGroups default -1; + property OverflowPanelUseSmallImages: Boolean read FOverflowPanelUseSmallImages write SetOverflowPanelUseSmallImages default True; + property ShowHeader: Boolean read FShowHeader write SetShowHeader default True; + property ShowOverflowPanel: Boolean read FShowOverflowPanel write SetShowOverflowPanel default True; + end; + + TdxNavBarViewOptions = class(TdxNavBarPersistent) + private + FCommon: TdxNavBarCommonViewOptions; + FExplorerBar: TdxNavBarExplorerBarViewOptions; + FNavigationPane: TdxNavBarNavigationPaneViewOptions; + + procedure SetCommon(AValue: TdxNavBarCommonViewOptions); + procedure SetExplorerBar(AValue: TdxNavBarExplorerBarViewOptions); + procedure SetNavigationPane(AValue: TdxNavBarNavigationPaneViewOptions); + public + constructor Create(ANavBar: TdxCustomNavBar); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + published + property Common: TdxNavBarCommonViewOptions read FCommon write SetCommon; + property ExplorerBar: TdxNavBarExplorerBarViewOptions read FExplorerBar write SetExplorerBar; + property NavigationPane: TdxNavBarNavigationPaneViewOptions read FNavigationPane write SetNavigationPane; + end; + + { TdxNavBarImageOptions } + + TdxNavBarImageOptions = class(TdxNavBarNexusPersistent) + private + FDisabledSmallImages: TCustomImageList; + FDisabledLargeImages: TCustomImageList; + FHotSmallImages: TCustomImageList; + FHotLargeImages: TCustomImageList; + FLargeImages: TCustomImageList; + FSmallImages: TCustomImageList; + FDisabledLargeChangeLink: TChangeLink; + FDisabledSmallChangeLink: TChangeLink; + FHotLargeChangeLink: TChangeLink; + FHotSmallChangeLink: TChangeLink; + FLargeChangeLink: TChangeLink; + FSmallChangeLink: TChangeLink; + procedure SetImageList(var ANewValue, AOldValue: TCustomImageList; const AChangeLink: TChangeLink); + procedure SetDisabledLargeImages(Value: TCustomImageList); + procedure SetDisabledSmallImages(Value: TCustomImageList); + procedure SetHotLargeImages(Value: TCustomImageList); + procedure SetHotSmallImages(Value: TCustomImageList); + procedure SetLargeImages(Value: TCustomImageList); + procedure SetSmallImages(Value: TCustomImageList); + protected + procedure FreeNotification(AComponent: TComponent); override; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + published + property DisabledLargeImages: TCustomImageList read FDisabledLargeImages write SetDisabledLargeImages; + property DisabledSmallImages: TCustomImageList read FDisabledSmallImages write SetDisabledSmallImages; + property HotLargeImages: TCustomImageList read FHotLargeImages write SetHotLargeImages; + property HotSmallImages: TCustomImageList read FHotSmallImages write SetHotSmallImages; + property LargeImages: TCustomImageList read FLargeImages write SetLargeImages; + property SmallImages: TCustomImageList read FSmallImages write SetSmallImages; + end; + + { TdxNavBarController } + + TdxNavBarPart = record + MajorPartIndex: Integer; + MinorPartIndex: Integer; + end; + + TdxNavBarController = class + private + FHotPart: TdxNavBarPart; + FPressedPart: TdxNavBarPart; + + function GetPainter: TdxNavBarPainter; + function GetViewInfo: TdxNavBarViewInfo; + + procedure CalcGroupHintRect(AItem: TObject; var ARect: TRect); + procedure CalcLinkHintRect(AItem: TObject; var ARect: TRect); + + procedure SetHotPart(APart: TdxNavBarPart); + procedure SetPressedPart(APart: TdxNavBarPart); + protected + FNavBar: TdxCustomNavBar; + + function CanFocusOnClick(const APoint: TPoint): Boolean; virtual; + function GetCursor: HIcon; virtual; + function GetItemHintRect(ANavBarItem: TObject; ACalcHintProc: TdxNavBarCalcHintEvent): TRect; + function GetPartAtPos(const APoint: TPoint): TdxNavBarPart; virtual; + + procedure DoClick(const APart: TdxNavBarPart); virtual; + procedure DoCheckBounds(var ALeft, ATop, AWidth, AHeight: Integer); virtual; + procedure DoLinkClick(ANavBar: TdxCustomNavBar; ALink: TdxNavBarItemLink); virtual; + procedure DoMouseDown(AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); virtual; + procedure DoMouseUp(AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); virtual; + procedure DoMouseMove(AShift: TShiftState; const APoint: TPoint); virtual; + procedure DoMouseLeave; virtual; + procedure DoSetHotPart(const APart: TdxNavBarPart); virtual; + procedure DoSetPressedPart(const APart: TdxNavBarPart); virtual; + procedure DoShowHint(var AHintInfo: THintInfo); virtual; + + procedure DoShowGroupHint(var AHintInfo: THintInfo; AGroupViewInfo: TdxNavBarGroupViewInfo); virtual; + procedure DoShowLinkHint(var AHintInfo: THintInfo; ALinkViewInfo: TdxNavBarLinkViewInfo); virtual; + function GetGroupHintRect(AGroup: TdxNavBarGroup): TRect; virtual; + function GetGroupHintText(AGroup: TdxNavBarGroup): string; virtual; + function GetLinkHintRect(ALink: TdxNavBarItemLink): TRect; virtual; + function GetLinkHintText(ALink: TdxNavBarItemLink): string; virtual; + + property NavBar: TdxCustomNavBar read FNavBar; + public + constructor Create(ANavBar: TdxCustomNavBar); virtual; + destructor Destroy; override; + procedure CheckBounds(var ALeft, ATop, AWidth, AHeight: Integer); + procedure InvalidateAll(AType: TdxNavBarChangeType); + procedure MouseDown(AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); + procedure MouseUp(AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); + procedure MouseMove(AShift: TShiftState; const APoint: TPoint); + procedure MouseLeave; + procedure ShowHint(var AHintInfo: THintInfo; out ACanShow: Boolean); + + property HotPart: TdxNavBarPart read FHotPart write SetHotPart; + property PressedPart: TdxNavBarPart read FPressedPart write SetPressedPart; + property Painter: TdxNavBarPainter read GetPainter; + property ViewInfo: TdxNavBarViewInfo read GetViewInfo; + end; + + TdxNavBarGroupEvent = procedure(Sender: TObject; AGroup: TdxNavBarGroup) of object; + TdxNavBarGroupChangingEvent = procedure(Sender: TObject; ANewGroup: TdxNavBarGroup; var AAllowChange: Boolean) of object; + TdxNavBarLinkEvent = procedure(Sender: TObject; ALink: TdxNavBarItemLink) of object; + TdxNavBarCalcGroupHintRectEvent = procedure(Sender: TObject; AGroup: TdxNavBarGroup; + AViewInfo: TdxNavBarViewInfo; var R: TRect) of object; + TdxNavBarCalcLinkHintRectEvent = procedure(Sender: TObject; ALink: TdxNavBarItemLink; + AViewInfo: TdxNavBarViewInfo; var R: TRect) of object; + TdxNavBarCalcGroupClientHeightEvent = procedure(Sender: TObject; AViewInfo: TdxNavBarGroupViewInfo; + var AHeight: Integer) of object; + TdxNavBarGetGroupHintEvent = procedure(Sender: TObject; AGroup: TdxNavBarGroup; + var AHint: string) of object; + TdxNavBarGetLinkHintEvent = procedure(Sender: TObject; ALink: TdxNavBarItemLink; + var AHint: string) of object; + + TdxNavBarInternalState = (nbisKeyDowned, nbisDragging, nbisAlreadyCollapsed); + TdxNavBarInternalStates = set of TdxNavBarInternalState; + + TdxCustomNavBar = class(TcxControl, IcxDesignSelectionChanged{, IcxMouseTrackingCaller}) + private + FActiveGroup: TdxNavBarGroup; + FActiveGroupIndex: Integer; + FBorderStyle: TBorderStyle; + FCanvasBitmap: TBitmap; + FCursors: TdxNavBarCursors; + FDragObject: TDragControlObject; + FGroups: TdxNavBarGroups; + FInternalState: TdxNavBarInternalStates; + FIAccessibilityHelper: IdxNavBarAccessibilityHelper; + FItems: TdxNavBarItems; + FPainter: TdxNavBarPainter; + FScrollBar: TdxNavBarScrollBar; + FThemeNotificator: TdxThemeChangedNotificator; + FUpdateLock: Integer; + FView: Integer; + + FOptionsBehavior: TdxNavBarBehaviorOptions; + FOptionsImage: TdxNavBarImageOptions; + FOptionsStyle: TdxNavBarStyleOptions; + FOptionsView: TdxNavBarViewOptions; + + FOnCustomDraw: TdxNavBarCustomDrawEvents; + FOnActiveGroupChanged: TNotifyEvent; + FOnActiveGroupChanging: TdxNavBarGroupChangingEvent; + FOnCalcGroupHintRect: TdxNavBarCalcGroupHintRectEvent; + FOnCalcGroupClientHeight: TdxNavBarCalcGroupClientHeightEvent; + FOnCalcLinkHintRect: TdxNavBarCalcLinkHintRectEvent; + FOnCalcNavigationPaneOverflowPanelHintRect: TdxNavBarCalcGroupHintRectEvent; + FOnCollapseStateChanged: TNotifyEvent; + FOnGetGroupHint: TdxNavBarGetGroupHintEvent; + FOnGetLinkHint: TdxNavBarGetLinkHintEvent; + FOnGroupClick: TdxNavBarGroupEvent; + FOnGroupHotTrack: TdxNavBarGroupEvent; + FOnGroupPress: TdxNavBarGroupEvent; + FOnLinkClick: TdxNavBarLinkEvent; + FOnLinkHotTrack: TdxNavBarLinkEvent; + FOnLinkPress: TdxNavBarLinkEvent; + FOnNavigationPaneCollapsed: TNotifyEvent; + FOnNavigationPaneExpanded: TNotifyEvent; + + FActivateGroupTimer: TcxTimer; + FScrollTimer: TcxTimer; + + FActiveGroupCandidate: TdxNavBarGroup; + FFocusedAccessibleObject: IdxNavBarAccessibilityHelper; + FSourcePoint: TPoint; + FSourceShift: TShiftState; + FSourceGroup: TdxNavBarGroup; + FSourceLink: TdxNavBarItemLink; + FTargetPoint: TPoint; + FHotTrackedGroup: TdxNavBarGroup; + FHotTrackedLink: TdxNavBarItemLink; + FOriginalWidth: Integer; + FPressedGroup: TdxNavBarGroup; + FPressedLink: TdxNavBarItemLink; + FScrollButtonDownIsDown: Boolean; + FScrollButtonUpIsDown: Boolean; + + function GetController: TdxNavBarController; + function GetPainter: TdxNavBarPainter; + function GetViewInfo: TdxNavBarViewInfo; + + function GetActiveGroup: TdxNavBarGroup; + function GetActiveGroupIndex: Integer; + function GetNavigationPaneOverflowPanelItemCount: Integer; + function GetEnableDragging: Boolean; + function GetIAccessibilityHelper: IdxNavBarAccessibilityHelper; + function GetScrollPosition: Integer; + function GetSourceGroup: TdxNavBarGroup; + function GetSourceLink: TdxNavBarItemLink; + function GetSourceItem: TdxNavBarItem; + function GetTargetGroup: TdxNavBarGroup; + function GetTargetLink1: TdxNavBarItemLink; + function GetTargetLink2: TdxNavBarItemLink; + function GetTargetLinkIndex: Integer; + function GetVisibleGroupCount: Integer; + procedure SetActiveGroup(Value: TdxNavBarGroup); + procedure SetActiveGroupIndex(Value: Integer); + procedure SetBorderStyle(const Value: TBorderStyle); + procedure SetFocusedAccessibleObject(Value: IdxNavBarAccessibilityHelper); + + // Cursors + function GetDragCopyCursor: TCursor; + function GetHotTrackedGroupCursor: TCursor; + function GetHotTrackedLinkCursor: TCursor; + procedure SetCursors(Value: TdxNavBarCursors); + procedure SetDragCopyCursor(Value: TCursor); + procedure SetHotTrackedGroupCursor(Value: TCursor); + procedure SetHotTrackedLinkCursor(Value: TCursor); + + // ViewStyle + function GetViewStyle: TdxNavBarPainter; + procedure SetView(Value: Integer); + procedure SetViewStyle(Value: TdxNavBarPainter); + + // OptionsImage + function GetLargeImages: TCustomImageList; + function GetSmallImages: TCustomImageList; + procedure SetOptionsImage(Value: TdxNavBarImageOptions); + procedure SetLargeImages(const Value: TCustomImageList); + procedure SetSmallImages(const Value: TCustomImageList); + + // Options + procedure SetOptionsView(Value: TdxNavBarViewOptions); + procedure SetOptionsBehavior(Value: TdxNavBarBehaviorOptions); + // Common + function GetDragDropFlags: TdxNavBarDragDropFlags; + function GetShowGroupCaptions: Boolean; + function GetShowGroupsHint: Boolean; + function GetShowLinksHint: Boolean; + procedure SetDragDropFlags(Value: TdxNavBarDragDropFlags); + procedure SetShowGroupsHint(const Value: Boolean); + procedure SetShowLinksHint(const Value: Boolean); + procedure SetShowGroupCaptions(Value: Boolean); + // ExplorerStyle + function GetShowSpecialGroup: Boolean; + function GetSpaceBetweenGroups: Integer; + procedure SetShowSpecialGroup(const Value: Boolean); + procedure SetSpaceBetweenGroups(Value: Integer); + // NavigationStyle + function GetAllowSelectLinks: Boolean; + function GetEachGroupHasSelectedLink: Boolean; + procedure SetAllowSelectLinks(const Value: Boolean); + procedure SetEachGroupHasSelectedLink(const Value: Boolean); + // NavitationPane + function GetNavigationPaneMaxVisibleGroups: Integer; + function GetNavigationPaneOverflowPanelUseSmallImages: Boolean; + function GetShowNavigationPaneOverflowPanelHints: Boolean; + procedure SetNavigationPaneMaxVisibleGroups(Value: Integer); + procedure SetNavigationPaneOverflowPanelUseSmallImages(const Value: Boolean); + procedure SetShowNavigationPaneOverflowPanelHints(const Value: Boolean); + + // CustomDraw + function GetOnCustomDrawBackground: TdxNavBarCustomDrawEvent; + function GetOnCustomDrawBottomScrollButton: TdxNavBarCustomDrawEvent; + function GetOnCustomDrawGroupCaption: TdxNavBarCustomDrawGroupEvent; + function GetOnCustomDrawGroupClientBackground: TdxNavBarCustomDrawGroupEvent; + function GetOnCustomDrawGroupClientForeground: TdxNavBarCustomDrawGroupEvent; + function GetOnCustomDrawGroupHint: TdxNavBarCustomDrawGroupHintEvent; + function GetOnCustomDrawLink: TdxNavBarCustomDrawLinkEvent; + function GetOnCustomDrawLinkHint: TdxNavBarCustomDrawLinkHintEvent; + function GetOnCustomDrawNavigationPaneHeader: TdxNavBarCustomDrawEvent; + function GetOnCustomDrawNavigationPaneOverflowPanel: TdxNavBarCustomDrawEvent; + function GetOnCustomDrawNavigationPaneOverflowPanelHint: TdxNavBarCustomDrawGroupHintEvent; + function GetOnCustomDrawNavigationPaneSplitter: TdxNavBarCustomDrawEvent; + function GetOnCustomDrawTopScrollButton: TdxNavBarCustomDrawEvent; + procedure SetOnCustomDraw(Value: TdxNavBarCustomDrawEvents); + procedure SetOnCustomDrawBackground(const Value: TdxNavBarCustomDrawEvent); + procedure SetOnCustomDrawBottomScrollButton(const Value: TdxNavBarCustomDrawEvent); + procedure SetOnCustomDrawGroupCaption(const Value: TdxNavBarCustomDrawGroupEvent); + procedure SetOnCustomDrawGroupClientBackground(const Value: TdxNavBarCustomDrawGroupEvent); + procedure SetOnCustomDrawGroupClientForeground(const Value: TdxNavBarCustomDrawGroupEvent); + procedure SetOnCustomDrawGroupHint(const Value: TdxNavBarCustomDrawGroupHintEvent); + procedure SetOnCustomDrawLink(const Value: TdxNavBarCustomDrawLinkEvent); + procedure SetOnCustomDrawLinkHint(const Value: TdxNavBarCustomDrawLinkHintEvent); + procedure SetOnCustomDrawNavigationPaneHeader(const Value: TdxNavBarCustomDrawEvent); + procedure SetOnCustomDrawNavigationPaneOverflowPanel(const Value: TdxNavBarCustomDrawEvent); + procedure SetOnCustomDrawNavigationPaneOverflowPanelHint(const Value: TdxNavBarCustomDrawGroupHintEvent); + procedure SetOnCustomDrawNavigationPaneSplitter(const Value: TdxNavBarCustomDrawEvent); + procedure SetOnCustomDrawTopScrollButton(const Value: TdxNavBarCustomDrawEvent); + + // Styles + function GetDefaultStyles: TdxNavBarDefaultStyles; + function GetNavBarCustomStyle(Index: Integer): TdxNavBarStyleItem; + function GetStyles: TdxNavBarStyleRepository; + procedure SetDefaultStyles(Value: TdxNavBarDefaultStyles); + procedure SetNavBarCustomStyle(Index: Integer; const Value: TdxNavBarStyleItem); + procedure SetOptionsStyle(Value: TdxNavBarStyleOptions); + + procedure DragDone; + function IsAllowDragLink: Boolean; + function IsAllowDropLink: Boolean; + function IsAllowDragGroup: Boolean; + function IsAllowDropGroup: Boolean; + // Notifications + procedure OnGroupsChanged(Sender: TObject; AItem: TcxComponentCollectionItem; + AAction: TcxComponentCollectionNotification); + procedure OnItemsChanged(Sender: TObject; AItem: TcxComponentCollectionItem; + AAction: TcxComponentCollectionNotification); + procedure OnStylesChanged(Sender: TObject); + procedure OnImagesChanged(Sender: TObject); + procedure OnLinksChanged(Sender: TObject; ALink: TdxNavBarItemLink); + procedure OnThemeChanged; + // Timers + procedure DoActivateGroupTimer(Sender: TObject); + procedure DoScrollTimer(Sender: TObject); + // Messages + procedure WMCreate(var Msg: TWMCreate); message WM_CREATE; + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + procedure WMSetCursor(var Msg: TWMSetCursor); message WM_SETCURSOR; + procedure WMVScroll(var Message: TWMVScroll); message WM_VSCROLL; + procedure CMCtl3DChanged(var Message: TMessage); message CM_CTL3DCHANGED; + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + procedure CMHintShow(var Message: TCMHintShow); message CM_HINTSHOW; + procedure CMSysColorChange(var Message: TMessage); message CM_SYSCOLORCHANGE; + protected + FDesignHelper: IcxDesignHelper; + + procedure AccessibleObjectOwnerObjectDestroyedNotification( + Sender: TObject); virtual; + procedure CheckCollapseState; + procedure CheckFocusedAccessibleObject; + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWindowHandle(const Params: TCreateParams); override; + procedure DefineProperties(Filer: TFiler); override; + function GetDesignHitTest(X, Y: Integer; Shift: TShiftState): Boolean; override; + procedure FocusChanged; override; + procedure Loaded; override; + procedure MouseEnter(AControl: TControl); override; +// procedure MouseLeave; overload; // IcxMouseTrackingCaller + procedure MouseLeave(AControl: TControl); overload; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure ReadOriginalWidth(Reader: TReader); + procedure SetChildOrder(Child: TComponent; Order: Integer); override; + procedure SetName(const NewName: TComponentName); override; + procedure WriteOriginalWidth(Writer: TWriter); + + function CanFocusOnClick(X, Y: Integer): Boolean; override; + procedure DoEnter; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); override; + procedure DoEndDrag(Target: TObject; X, Y: Integer); override; + procedure DoStartDrag(var DragObject: TDragObject); override; + + procedure DoActiveGroupChanged; virtual; + procedure DoActiveGroupChanging(ANewGroup: TdxNavBarGroup; var AAllowChange: Boolean); + procedure DoCollapseStateChanged; + procedure DoGroupDragDrop(Group: TdxNavBarGroup); virtual; + procedure DoGroupDragOver(Group: TdxNavBarGroup; var Accept: Boolean); virtual; + procedure DoGroupHotTrack(Group: TdxNavBarGroup); virtual; + procedure DoGroupMouseDown(Group: TdxNavBarGroup); virtual; + procedure DoGroupMouseUp(Group: TdxNavBarGroup); virtual; + procedure DoLinkDragDrop(Link: TdxNavBarItemLink); virtual; + procedure DoLinkDragOver(Link: TdxNavBarItemLink; var Accept: Boolean); virtual; + procedure DoLinkHotTrack(Link: TdxNavBarItemLink); virtual; + procedure DoLinkMouseDown(Link: TdxNavBarItemLink); virtual; + procedure DoLinkMouseUp(Link: TdxNavBarItemLink); virtual; + procedure DoNavigationPaneCollapsed; + procedure DoNavigationPaneExpanded; + procedure DoItemDragDrop(Item: TdxNavBarItem); virtual; + procedure DoItemDragOver(Item: TdxNavBarItem; var Accept: Boolean); virtual; + procedure DoBottomScrollButtonDown; virtual; + procedure DoBottomScrollButtonUp; virtual; + procedure DoTopScrollButtonDown; virtual; + procedure DoTopScrollButtonUp; virtual; +// procedure DoOverflowPanelMouseUp; virtual; + procedure DoUpdateScrollBarStyle; virtual; + function GetClientRect: TRect; override; + procedure DoScroll(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer); + + // Painting + procedure Paint; override; + procedure InvalidateScrollButtons; + // Load/Save layout + procedure LoadFromRegIni(AStorage: TCustomIniFile; LoadStyles: Boolean); virtual; + procedure SaveToRegIni(AStorage: TCustomIniFile; SaveStyles: Boolean); virtual; + + function CreatePainter: TdxNavBarPainter; virtual; + function GetAccessibilityHelperClass: TdxNavBarCustomAccessibilityHelperClass; virtual; + function GetGroupClass: TdxNavBarGroupClass; virtual; + function GetItemClass: TdxNavBarItemClass; virtual; + + function IsCollapsed: Boolean; + function IsInternal: Boolean; virtual; + + property CanvasBitmap: TBitmap read FCanvasBitmap; + property FocusedAccessibleObject: IdxNavBarAccessibilityHelper read + FFocusedAccessibleObject write SetFocusedAccessibleObject; + property UpdateLock: Integer read FUpdateLock; + + property OriginalWidth: Integer read FOriginalWidth write FOriginalWidth; + property OnCollapseStateChanged: TNotifyEvent read FOnCollapseStateChanged write FOnCollapseStateChanged; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function CanFocus: Boolean; override; + procedure DeSelectLinks; + procedure DragDrop(Source: TObject; X, Y: Integer); override; + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + + procedure InitiateAction; override; + procedure Invalidate; override; + procedure InvalidateAll(AType: TdxNavBarChangeType); overload; + procedure InvalidateAll(AItem: TcxComponentCollectionItem; + AAction: TcxComponentCollectionNotification); overload; + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; + // Layout store/restore + procedure AssignDefaultStyles; + procedure LoadFromIniFile(AFileName: string; LoadStyles: Boolean = True); + procedure LoadFromRegistry(ARegistryPath: string; LoadStyles: Boolean = True); + procedure LoadFromStream(AStream: TStream; LoadStyles: Boolean = True); + procedure SaveToIniFile(AFileName: string; SaveStyles: Boolean = True); + procedure SaveToRegistry(ARegistryPath: string; SaveStyles: Boolean = True); + procedure SaveToStream(AStream: TStream; SaveStyles: Boolean = True); + // ViewInfo + function GetGroupAtCaptionPos(const pt: TPoint): TdxNavBarGroup; + function GetGroupAtItemsPos(const pt: TPoint): TdxNavBarGroup; + function GetLinkAtPos(const pt: TPoint): TdxNavBarItemLink; + function GetLinkAtSelectedPos(const pt: TPoint): TdxNavBarItemLink; + function IsPtGroupDesignRect(const pt: TPoint): Boolean; + function IsPtItemDesignRect(const pt: TPoint): Boolean; + function IsPtTopScrollButton(const pt: TPoint): Boolean; + function IsPtBottomScrollButton(const pt: TPoint): Boolean; + function IsTopScrollButtonVisible: Boolean; + function IsBottomScrollButtonVisible: Boolean; +// function IsPtNavigationPaneHeader(const pt: TPoint): Boolean; +// function IsPtNavigationPaneSplitter(const pt: TPoint): Boolean; +// function IsPtNavigationPaneOverflowPanel(const pt: TPoint): Boolean; + // Groups and links visibility + procedure MakeLinkVisible(ALink: TdxNavBarItemLink); + procedure MakeGroupVisible(AGroup: TdxNavBarGroup); + // Updates lock + procedure BeginUpdate; + procedure EndUpdate; + // NavigationPane + function CanDecNavigationPaneOverflowPanelItemCount: Boolean; + function CanIncNavigationPaneOverflowPanelItemCount: Boolean; + procedure DoDecNavigationPaneOverflowPanelItemCount; + procedure DoIncNavigationPaneOverflowPanelItemCount; + // Designer + function DesignerIsSelected(AObject: TPersistent): Boolean; + procedure DesignerModified; + procedure DesignerSelect(AObject: TPersistent); + // IcxDesignSelectionChanged + procedure DesignSelectionChanged(ASelection: TList); + + property Controller: TdxNavBarController read GetController; + property Painter: TdxNavBarPainter read GetPainter; + property ViewInfo: TdxNavBarViewInfo read GetViewInfo; + + property EnableDragging: Boolean read GetEnableDragging; + property IAccessibilityHelper: IdxNavBarAccessibilityHelper + read GetIAccessibilityHelper; + property ScrollBar: TdxNavBarScrollBar read FScrollBar; + property SourcePoint: TPoint read FSourcePoint; + property SourceGroup: TdxNavBarGroup read GetSourceGroup; + property SourceLink: TdxNavBarItemLink read GetSourceLink; + property SourceItem: TdxNavBarItem read GetSourceItem; + property TargetPoint: TPoint read FTargetPoint; + property TargetGroup: TdxNavBarGroup read GetTargetGroup; + property TargetLink1: TdxNavBarItemLink read GetTargetLink1; + property TargetLink2: TdxNavBarItemLink read GetTargetLink2; + property TargetLinkIndex: Integer read GetTargetLinkIndex; + property HotTrackedGroup: TdxNavBarGroup read FHotTrackedGroup; + property HotTrackedLink: TdxNavBarItemLink read FHotTrackedLink; + property PressedGroup: TdxNavBarGroup read FPressedGroup; + property PressedLink: TdxNavBarItemLink read FPressedLink; + + property NavigationPaneOverflowPanelItemCount: Integer read GetNavigationPaneOverflowPanelItemCount; +// property NavigationPaneOverflowPanelHotTrackedIndex: Integer read FNavigationPaneOverflowPanelHotTrackedIndex; +// property NavigationPaneOverflowPanelPressedIndex: Integer read FNavigationPaneOverflowPanelPressedIndex; +// property NavigationPaneOverflowPanelSignPressed: Boolean read FNavigationPaneOverflowPanelSignPressed; +// property NavigationPaneOverflowPanelSignHotTracked: Boolean read FNavigationPaneOverflowPanelSignHotTracked; + + property ScrollButtonDownIsDown: Boolean read FScrollButtonDownIsDown; + property ScrollButtonUpIsDown: Boolean read FScrollButtonUpIsDown; + property ScrollPosition: Integer read GetScrollPosition; + + property ActiveGroupIndex: Integer read GetActiveGroupIndex write SetActiveGroupIndex; + property ActiveGroup: TdxNavBarGroup read GetActiveGroup write SetActiveGroup; + property Groups: TdxNavBarGroups read FGroups; + property Items: TdxNavBarItems read FItems; + property VisibleGroupCount: Integer read GetVisibleGroupCount; + + // Cursors + property Cursors: TdxNavBarCursors read FCursors write SetCursors; + property DragCopyCursor: TCursor read GetDragCopyCursor write SetDragCopyCursor; + property HotTrackedGroupCursor: TCursor read GetHotTrackedGroupCursor write SetHotTrackedGroupCursor; + property HotTrackedLinkCursor: TCursor read GetHotTrackedLinkCursor write SetHotTrackedLinkCursor; + + // ViewStyle + property View: Integer read FView write SetView; + property ViewStyle: TdxNavBarPainter read GetViewStyle write SetViewStyle; + + // OptionsImage + property OptionsImage: TdxNavBarImageOptions read FOptionsImage write SetOptionsImage; + property LargeImages: TCustomImageList read GetLargeImages write SetLargeImages; + property SmallImages: TCustomImageList read GetSmallImages write SetSmallImages; + + // OptionsStyle + property OptionsStyle: TdxNavBarStyleOptions read FOptionsStyle write SetOptionsStyle; + property DefaultStyles: TdxNavBarDefaultStyles read GetDefaultStyles write SetDefaultStyles; + property Styles: TdxNavBarStyleRepository read GetStyles; + property StyleBackground: TdxNavBarStyleItem index 0 read GetNavBarCustomStyle write SetNavBarCustomStyle; + property StyleHint: TdxNavBarStyleItem index 1 read GetNavBarCustomStyle write SetNavBarCustomStyle; + property StyleDropTargetGroup: TdxNavBarStyleItem index 2 read GetNavBarCustomStyle write SetNavBarCustomStyle; + property StyleDropTargetLink: TdxNavBarStyleItem index 3 read GetNavBarCustomStyle write SetNavBarCustomStyle; + property StyleButton: TdxNavBarStyleItem index 4 read GetNavBarCustomStyle write SetNavBarCustomStyle; + property StyleButtonHotTracked: TdxNavBarStyleItem index 5 read GetNavBarCustomStyle write SetNavBarCustomStyle; + property StyleButtonPressed: TdxNavBarStyleItem index 6 read GetNavBarCustomStyle write SetNavBarCustomStyle; + property StyleNavigationPaneHeader: TdxNavBarStyleItem index 7 read GetNavBarCustomStyle write SetNavBarCustomStyle; + + // Options + property OptionsView: TdxNavBarViewOptions read FOptionsView write SetOptionsView; + property OptionsBehavior: TdxNavBarBehaviorOptions read FOptionsBehavior write SetOptionsBehavior; + // Common + property DragDropFlags: TdxNavBarDragDropFlags read GetDragDropFlags write SetDragDropFlags; + property ShowGroupsHint: Boolean read GetShowGroupsHint write SetShowGroupsHint; + property ShowLinksHint: Boolean read GetShowLinksHint write SetShowLinksHint; + property ShowGroupCaptions: Boolean read GetShowGroupCaptions write SetShowGroupCaptions; + // ExplorerStyle + property ShowSpecialGroup: Boolean read GetShowSpecialGroup write SetShowSpecialGroup; + property SpaceBetweenGroups: Integer read GetSpaceBetweenGroups write SetSpaceBetweenGroups; + // NavigationStyle + property AllowSelectLinks: Boolean read GetAllowSelectLinks write SetAllowSelectLinks; + property EachGroupHasSelectedLink: Boolean read GetEachGroupHasSelectedLink write SetEachGroupHasSelectedLink; + // NavigationPane + property NavigationPaneMaxVisibleGroups: Integer read GetNavigationPaneMaxVisibleGroups write SetNavigationPaneMaxVisibleGroups; + property NavigationPaneOverflowPanelUseSmallImages: Boolean read GetNavigationPaneOverflowPanelUseSmallImages write SetNavigationPaneOverflowPanelUseSmallImages; + property ShowNavigationPaneOverflowPanelHints: Boolean read GetShowNavigationPaneOverflowPanelHints write SetShowNavigationPaneOverflowPanelHints; + + property OnActiveGroupChanged: TNotifyEvent read FOnActiveGroupChanged write FOnActiveGroupChanged; + property OnActiveGroupChanging: TdxNavBarGroupChangingEvent read FOnActiveGroupChanging write FOnActiveGroupChanging; + property OnCalcGroupClientHeight: TdxNavBarCalcGroupClientHeightEvent read FOnCalcGroupClientHeight write FOnCalcGroupClientHeight; + property OnCalcGroupHintRect: TdxNavBarCalcGroupHintRectEvent read FOnCalcGroupHintRect write FOnCalcGroupHintRect; + property OnCalcLinkHintRect: TdxNavBarCalcLinkHintRectEvent read FOnCalcLinkHintRect write FOnCalcLinkHintRect; + property OnCalcNavigationPaneOverflowPanelHintRect: TdxNavBarCalcGroupHintRectEvent read FOnCalcNavigationPaneOverflowPanelHintRect write FOnCalcNavigationPaneOverflowPanelHintRect; + + property OnCustomDraw: TdxNavBarCustomDrawEvents read FOnCustomDraw write SetOnCustomDraw; + property OnCustomDrawBackground: TdxNavBarCustomDrawEvent read GetOnCustomDrawBackground write SetOnCustomDrawBackground; + property OnCustomDrawGroupCaption: TdxNavBarCustomDrawGroupEvent read GetOnCustomDrawGroupCaption write SetOnCustomDrawGroupCaption; + property OnCustomDrawGroupClientBackground: TdxNavBarCustomDrawGroupEvent read GetOnCustomDrawGroupClientBackground write SetOnCustomDrawGroupClientBackground; + property OnCustomDrawGroupClientForeground: TdxNavBarCustomDrawGroupEvent read GetOnCustomDrawGroupClientForeground write SetOnCustomDrawGroupClientForeground; + property OnCustomDrawGroupHint: TdxNavBarCustomDrawGroupHintEvent read GetOnCustomDrawGroupHint write SetOnCustomDrawGroupHint; + property OnCustomDrawLink: TdxNavBarCustomDrawLinkEvent read GetOnCustomDrawLink write SetOnCustomDrawLink; + property OnCustomDrawLinkHint: TdxNavBarCustomDrawLinkHintEvent read GetOnCustomDrawLinkHint write SetOnCustomDrawLinkHint; + property OnCustomDrawBottomScrollButton: TdxNavBarCustomDrawEvent read GetOnCustomDrawBottomScrollButton write SetOnCustomDrawBottomScrollButton; + property OnCustomDrawTopScrollButton: TdxNavBarCustomDrawEvent read GetOnCustomDrawTopScrollButton write SetOnCustomDrawTopScrollButton; + property OnCustomDrawNavigationPaneHeader: TdxNavBarCustomDrawEvent read GetOnCustomDrawNavigationPaneHeader write SetOnCustomDrawNavigationPaneHeader; + property OnCustomDrawNavigationPaneSplitter: TdxNavBarCustomDrawEvent read GetOnCustomDrawNavigationPaneSplitter write SetOnCustomDrawNavigationPaneSplitter; + property OnCustomDrawNavigationPaneOverflowPanel: TdxNavBarCustomDrawEvent read GetOnCustomDrawNavigationPaneOverflowPanel write SetOnCustomDrawNavigationPaneOverflowPanel; + property OnCustomDrawNavigationPaneOverflowPanelHint: TdxNavBarCustomDrawGroupHintEvent read GetOnCustomDrawNavigationPaneOverflowPanelHint write SetOnCustomDrawNavigationPaneOverflowPanelHint; + + property OnNavigationPaneCollapsed: TNotifyEvent read FOnNavigationPaneCollapsed write FOnNavigationPaneCollapsed; + property OnNavigationPaneExpanded: TNotifyEvent read FOnNavigationPaneExpanded write FOnNavigationPaneExpanded; + + property OnGetGroupHint: TdxNavBarGetGroupHintEvent read FOnGetGroupHint write FOnGetGroupHint; + property OnGetLinkHint: TdxNavBarGetLinkHintEvent read FOnGetLinkHint write FOnGetLinkHint; + property OnGroupClick: TdxNavBarGroupEvent read FOnGroupClick write FOnGroupClick; + property OnGroupHotTrack: TdxNavBarGroupEvent read FOnGroupHotTrack write FOnGroupHotTrack; + property OnGroupPress: TdxNavBarGroupEvent read FOnGroupPress write FOnGroupPress; + property OnLinkClick: TdxNavBarLinkEvent read FOnLinkClick write FOnLinkClick; + property OnLinkHotTrack: TdxNavBarLinkEvent read FOnLinkHotTrack write FOnLinkHotTrack; + property OnLinkPress: TdxNavBarLinkEvent read FOnLinkPress write FOnLinkPress; + published + property Align; + property Anchors; + property BorderStyle: TBorderStyle read FBorderStyle write SetBorderStyle default bsNone; + property Color; + property Constraints; + property Ctl3D; + property Enabled; + property Font; + property PopupMenu; + property Visible; + + property OnContextPopup; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + end; + + TdxNavBarDragObject = class + private + FNavBar: TdxCustomNavBar; + FSourceGroup: TdxNavBarGroup; + FSourceLink: TdxNavBarItemLink; + FSourceItem: TdxNavBarItem; + FTargetGroup: TdxNavBarGroup; + FTargetLink1: TdxNavBarItemLink; + FTargetLink2: TdxNavBarItemLink; + FTargetLinkIndex: Integer; + function GetSourceItem: TdxNavBarItem; + protected + procedure UpdateTargets; virtual; + public + constructor Create(ANavBar: TdxCustomNavBar; + var DragObject: TDragObject {deprecated}; ASourceGroup: TdxNavBarGroup; + ASourceLink: TdxNavBarItemLink; ASourceItem: TdxNavBarItem); + property NavBar: TdxCustomNavBar read FNavBar; + property SourceGroup: TdxNavBarGroup read FSourceGroup; + property SourceLink: TdxNavBarItemLink read FSourceLink; + property SourceItem: TdxNavBarItem read GetSourceItem; + property TargetGroup: TdxNavBarGroup read FTargetGroup; + property TargetLink1: TdxNavBarItemLink read FTargetLink1; + property TargetLink2: TdxNavBarItemLink read FTargetLink2; + property TargetLinkIndex: Integer read FTargetLinkIndex; + end; + + TdxNavBarScrollBar = class + private + FKind: TScrollBarKind; + FParent: TWinControl; + FScrollBar: TcxScrollBar; + FScrollInfo: TScrollInfo; + FVisible: Boolean; + + FLargeChange: Integer; + FSmallChange: Integer; + + FOnScroll: TScrollEvent; + + procedure CorrectPos(var APos: Integer; AMin, AMax, APageSize: Integer); + function GetHandle: THandle; + function GetHeight: Integer; + function GetMax: Integer; + function GetMin: Integer; + function GetPageSize: Integer; + function GetPosition: Integer; + function GetWidth: Integer; + procedure SetMax(const Value: Integer); + procedure SetMin(const Value: Integer); + procedure SetPageSize(const Value: Integer); + procedure SetPosition(const Value: Integer); + procedure SetVisible(const Value: Boolean); + protected + procedure RecreatecxScrollBar; + procedure Reset; + procedure Scroll(Sender: TObject; AScrollCode: TScrollCode; var AScrollPos: Integer); + property Handle: THandle read GetHandle; + property ScrollBar: TcxScrollBar read FScrollBar; + public + constructor Create(AParent: TWinControl; AKind: TScrollBarKind); + destructor Destroy; override; + procedure SetScrollParams(AMin, AMax, APosition, APageSize: Integer; ARedraw: Boolean = True); + + property Height: Integer read GetHeight; + property Max: Integer read GetMax write SetMax; + property Min: Integer read GetMin write SetMin; + property PageSize: Integer read GetPageSize write SetPageSize; + property Position: Integer read GetPosition write SetPosition; + property Visible: Boolean read FVisible write SetVisible; + property Width: Integer read GetWidth; + + property LargeChange: Integer read FLargeChange write FLargeChange; + property SmallChange: Integer read FSmallChange write FSmallChange; + property OnScroll: TScrollEvent read FOnScroll write FOnScroll; + end; + + TdxNavBarHintWindow = class(TcxBaseHintWindow) + protected + FNavBar: TdxCustomNavBar; + procedure Paint; override; + public + function CalcHintRect(MaxWidth: Integer; const AHint: string; AData: Pointer): TRect; override; + end; + + TdxNavBar = class(TdxCustomNavBar) + private + FCustomDrawEvents: TNotifyEvent; + published + property ActiveGroupIndex; + property TabOrder; + property TabStop default False; + + // Cursors + property Cursors; + property Cursor stored False; + property DragCopyCursor stored False; + property DragCursor stored False; + property HotTrackedGroupCursor stored False; + property HotTrackedLinkCursor stored False; + + // ViewStyle + property View; + property ViewStyle; + + // Options + property OptionsBehavior; + property OptionsImage; + property OptionsStyle; + property OptionsView; + // Common + property DragDropFlags stored False; + property ShowGroupsHint stored False; + property ShowLinksHint stored False; + property ShowGroupCaptions stored False; + // ExplorerStyle + property ShowSpecialGroup stored False; + property SpaceBetweenGroups stored False; + // NavigationStyle + property AllowSelectLinks stored False; + property EachGroupHasSelectedLink stored False; + // NavigationPane + property NavigationPaneMaxVisibleGroups stored False; + property NavigationPaneOverflowPanelUseSmallImages stored False; + property ShowNavigationPaneOverflowPanelHints stored False; + // Image + property LargeImages stored False; + property SmallImages stored False; + // Style + property DefaultStyles stored False; + property StyleBackground stored False; + property StyleHint stored False; + property StyleDropTargetGroup stored False; + property StyleDropTargetLink stored False; + property StyleButton stored False; + property StyleButtonHotTracked stored False; + property StyleButtonPressed stored False; + property StyleNavigationPaneHeader stored False; + + property OnActiveGroupChanged; + property OnActiveGroupChanging; + property OnCalcGroupClientHeight; + property OnCalcGroupHintRect; + property OnCalcNavigationPaneOverflowPanelHintRect; + property OnCalcLinkHintRect; + + // CustomDrawEvents + property OnCustomDraw; + property CustomDrawEvents: TNotifyEvent read FCustomDrawEvents write FCustomDrawEvents; + property OnCustomDrawBackground stored False; + property OnCustomDrawGroupCaption stored False; + property OnCustomDrawGroupClientBackground stored False; + property OnCustomDrawGroupClientForeground stored False; + property OnCustomDrawGroupHint stored False; + property OnCustomDrawLink stored False; + property OnCustomDrawLinkHint stored False; + property OnCustomDrawBottomScrollButton stored False; + property OnCustomDrawTopScrollButton stored False; + property OnCustomDrawNavigationPaneHeader stored False; + property OnCustomDrawNavigationPaneSplitter stored False; + property OnCustomDrawNavigationPaneOverflowPanel stored False; + property OnCustomDrawNavigationPaneOverflowPanelHint stored False; + + property OnDragDrop; + property OnDragOver; + property OnEndDrag; + property OnGetGroupHint; + property OnGetLinkHint; + property OnGroupClick; + property OnGroupHotTrack; + property OnGroupPress; + property OnLinkClick; + property OnLinkHotTrack; + property OnLinkPress; + property OnMouseEnter; + property OnMouseLeave; + property OnNavigationPaneCollapsed; + property OnNavigationPaneExpanded; + property OnStartDrag; + end; + +var + dxNavBarDragObject: TdxNavBarDragObject; + DrawIconsAsEnabled: Boolean; + FOnRegisterNavBar, FOnUnRegisterNavBar: TcxNotifyProcedure; + +function dxNavBarPart(AMajorPartIndex: Integer; AMinorPartIndex: Integer = nbNone): TdxNavBarPart; +function IsdxNavBarPartsEqual(const APart1, APart2: TdxNavBarPart): Boolean; + +implementation + +{$R *.res} + +uses + Consts, Math, SysUtils, dxUxTheme, + dxNavBarViewsFact, dxNavBarAccessibility, +// Views: + dxNavBarBaseViews, dxNavBarXPViews, + dxNavBarOfficeViews, dxNavBarOffice11Views, dxNavBarOffice12Views, + dxNavBarVSToolBoxViews, dxNavBarExplorerViews, dxNavBarVistaViews; + +type + TdxNavBarItemAccess = class(TdxNavBarItem); + +function dxNavBarPart(AMajorPartIndex: Integer; AMinorPartIndex: Integer = nbNone): TdxNavBarPart; +begin + Result.MajorPartIndex := AMajorPartIndex; + Result.MinorPartIndex := AMinorPartIndex; +end; + +function IsdxNavBarPartsEqual(const APart1, APart2: TdxNavBarPart): Boolean; +begin + Result := (APart1.MajorPartIndex = APart2.MajorPartIndex) and (APart1.MinorPartIndex = APart2.MinorPartIndex); +end; + +{ TdxNavBarPersistent } + +constructor TdxNavBarPersistent.Create(ANavBar: TdxCustomNavBar); +begin + inherited Create; + FNavBar := ANavBar; +end; + +function TdxNavBarPersistent.GetOwner: TPersistent; +begin + Result := NavBar; +end; + +{ TdxNavBarCustomViewInfo } + +constructor TdxNavBarCustomViewInfo.Create; +begin + inherited Create; + FRatio := Max(1, Screen.PixelsPerInch / 96); +end; + +function TdxNavBarCustomViewInfo.GetRevisedValue(AValue: Integer): Integer; +begin + Result := Round(Ratio * AValue); +end; + +{ TdxNavBarCustomItemViewInfo } + +constructor TdxNavBarCustomItemViewInfo.Create(AViewInfo: TdxNavBarViewInfo); +begin + inherited Create; + FCaptionFont := TFont.Create; + FViewInfo := AViewInfo; + FPainter := FViewInfo.Painter; + FNavBar := FViewInfo.NavBar; +end; + +destructor TdxNavBarCustomItemViewInfo.Destroy; +begin + FreeAndNil(FCaptionFont); + inherited; +end; + +procedure TdxNavBarCustomItemViewInfo.CorrectBounds(dX, dY: Integer); +begin + OffsetRect(FCaptionRect, dX, dY); + OffsetRect(FDesignRect, dX, dY); + OffsetRect(FFocusRect, dX, dY); + OffsetRect(FImageRect, dX, dY); + OffsetRect(FRect, dX, dY); +end; + +function TdxNavBarCustomItemViewInfo.ImageIndex: Integer; +begin + if UseLargeImages then + Result := GetNavBarItem.LargeImageIndex + else + Result := GetNavBarItem.SmallImageIndex; +end; + +procedure TdxNavBarCustomItemViewInfo.CalcDesignRect(const AItemRect: TRect; AMarkSize: Integer); +var + ADesignArea: TRect; +begin + if NavBar.IsDesigning then + begin + ADesignArea := AItemRect; + ADesignArea.Left := ADesignArea.Right - 20; + FDesignRect := cxRectCenter(ADesignArea, AMarkSize, AMarkSize); + end + else + FDesignRect := cxNullRect; +end; + +function TdxNavBarCustomItemViewInfo.GetImageList: TCustomImageList; +begin + if UseLargeImages then + if UseDisabledImages then + Result := NavBar.OptionsImage.DisabledLargeImages + else + if UseHotImages then + Result := NavBar.OptionsImage.HotLargeImages + else + Result := NavBar.LargeImages + else + if UseDisabledImages then + Result := NavBar.OptionsImage.DisabledSmallImages + else + if UseHotImages then + Result := NavBar.OptionsImage.HotSmallImages + else + Result := NavBar.SmallImages; +end; + +function TdxNavBarCustomItemViewInfo.GetState: TdxNavBarObjectStates; +begin + Result := []; +end; + +function TdxNavBarCustomItemViewInfo.IsEnabled: Boolean; +begin + Result := not(sDisabled in State); +end; + +function TdxNavBarCustomItemViewInfo.IsFocused: Boolean; +begin + Result := sFocused in State; +end; + +function TdxNavBarCustomItemViewInfo.IsSelected: Boolean; +begin + Result := [sActive, sHotTracked, sPressed, sSelected] * State <> []; +end; + +function TdxNavBarCustomItemViewInfo.UseDisabledImages: Boolean; +begin + Result := not IsEnabled and + (not UseLargeImages and (NavBar.OptionsImage.DisabledSmallImages <> nil) or + UseLargeImages and (NavBar.OptionsImage.DisabledLargeImages <> nil)) ; +end; + +function TdxNavBarCustomItemViewInfo.UseHotImages: Boolean; +begin + Result := IsSelected and + (not UseLargeImages and (NavBar.OptionsImage.HotSmallImages <> nil) or + UseLargeImages and (NavBar.OptionsImage.HotLargeImages <> nil)); +end; + +function TdxNavBarCustomItemViewInfo.UseLargeImages: Boolean; +begin + Result := False; +end; + +{ TdxNavBarLinkViewInfo } + +constructor TdxNavBarLinkViewInfo.Create(AGroupViewInfo: TdxNavBarGroupViewInfo; ALink: TdxNavBarItemLink; + ACaptionVisible, AImageVisisble: Boolean); +begin + inherited Create(AGroupViewInfo.ViewInfo); + FGroupViewInfo := AGroupViewInfo; + FLink := ALink; + FItem := FLink.Item; + FCaptionVisible := ACaptionVisible; + FImageVisible := AImageVisisble; +end; + +procedure TdxNavBarLinkViewInfo.CalculateBounds(X, Y: Integer); +begin + TdxNavBarItemAccess(Item).GetCalculatorClass.CalculateBounds(X, Y, Self); +end; + +function TdxNavBarLinkViewInfo.UseLargeImages: Boolean; +begin + Result := not GroupViewInfo.IsLinksUseSmallImages; +end; + +function TdxNavBarLinkViewInfo.SelectionRect: TRect; +begin + Result := ImageRect; + InflateRect(Result, 2, 2) +end; + +function TdxNavBarLinkViewInfo.GetNavBarItem: TdxNavBarCustomItem; +begin + Result := Item; +end; + +function TdxNavBarLinkViewInfo.GetState: TdxNavBarObjectStates; +begin + Result := inherited GetState; + if not Item.Enabled then + Include(Result, sDisabled); + if NavBar.PressedLink = Link then + Include(Result, sPressed); + if Link.IsSelected then + Include(Result, sSelected); + if NavBar.HotTrackedLink = Link then + Include(Result, sHotTracked); + if Link.IAccessibilityHelper.IsFocused then + Include(Result, sFocused); +end; + +function TdxNavBarLinkViewInfo.GetCaptionHeight: Integer; +begin + Result := 4; + Inc(Result, cxScreenCanvas.FontHeight(Font)); +end; + +function TdxNavBarLinkViewInfo.GetDrawEdgeFlag: Integer; +const + AFlagMap: array[Boolean] of Integer = (DT_CENTER or DT_WORDBREAK, DT_LEFT or DT_VCENTER or DT_SINGLELINE); +begin + Result := AFlagMap[GroupViewInfo.IsLinksUseSmallImages]; +end; + +function TdxNavBarLinkViewInfo.GetImageHeight: Integer; +begin + if GroupViewInfo.IsLinksUseSmallImages then + Result := ViewInfo.GetSmallImageHeight + else Result := ViewInfo.GetLargeImageHeight; +end; + +function TdxNavBarLinkViewInfo.GetImageWidth: Integer; +begin + if GroupViewInfo.IsLinksUseSmallImages then + Result := ViewInfo.GetSmallImageWidth + else Result := ViewInfo.GetLargeImageWidth; +end; + +function TdxNavBarLinkViewInfo.IsCaptionVisible: Boolean; +begin + Result := FCaptionVisible and (FCaptionRect.Left > FRect.Left) and (FCaptionRect.Right < FRect.Right); +end; + +function TdxNavBarLinkViewInfo.IsImageVisible: Boolean; +begin + Result := FImageVisible and (FImageRect.Left > FRect.Left) and (FImageRect.Right < FRect.Right); +end; + +function TdxNavBarLinkViewInfo.IsWholeVisible: Boolean; +begin + Result := PtInRect(GroupViewInfo.ItemsRect, Rect.TopLeft) and + PtInRect(GroupViewInfo.ItemsRect, Rect.BottomRight); +end; + +function TdxNavBarLinkViewInfo.StyleItem: TdxNavBarStyleItem; +begin + if sDisabled in State then + Result := Item.StyleDisabled + else if sPressed in State then + Result := Item.StylePressed + else if sHotTracked in State then + Result := Item.StyleHotTracked + else Result := Item.Style; +end; + +function TdxNavBarLinkViewInfo.Style: TdxNavBarBaseStyle; +begin + if sDisabled in State then + Result := NavBar.DefaultStyles.ItemDisabled + else if sPressed in State then + Result := NavBar.DefaultStyles.ItemPressed + else if sHotTracked in State then + Result := NavBar.DefaultStyles.ItemHotTracked + else Result := NavBar.DefaultStyles.Item; +end; + +function TdxNavBarLinkViewInfo.Font: TFont; +begin + Result := FCaptionFont; + if (StyleItem <> nil) and (savFont in StyleItem.Style.AssignedValues) then + Result.Assign(StyleItem.Style.Font) + else Result.Assign(Style.Font); +end; + +function TdxNavBarLinkViewInfo.FontColor: TColor; +begin + Result := Font.Color; +end; + +{ TdxNavBarGroupViewInfo } + +constructor TdxNavBarGroupViewInfo.Create(AViewInfo: TdxNavBarViewInfo; AGroup: TdxNavBarGroup; + ACaptionVisible, AItemsVisible: Boolean); +begin + inherited Create(AViewInfo); + FGroup := AGroup; + FCaptionVisible := ACaptionVisible; + FItemsVisible := AItemsVisible; + + FItems := TList.Create; + CreateInfo; +end; + +destructor TdxNavBarGroupViewInfo.Destroy; +begin + ClearItems; + FItems.Free; + inherited Destroy; +end; + +function TdxNavBarGroupViewInfo.GetLinkViewInfoByLink(ALink: TdxNavBarItemLink): TdxNavBarLinkViewInfo; +var + I: Integer; +begin + Result := nil; + for I := 0 to ItemCount - 1 do + if Items[I].Link = ALink then + begin + Result := Items[I]; + break; + end; +end; + +function TdxNavBarGroupViewInfo.IndexOfLinkViewInfo(AViewInfo: TdxNavBarLinkViewInfo): Integer; +begin + Result := FItems.IndexOf(AViewInfo); +end; + +function TdxNavBarGroupViewInfo.BorderColor: TColor; +begin + Result := CaptionBackColor2; +end; + +function TdxNavBarGroupViewInfo.BgImage: TPicture; +begin + if (Group.StyleBackground <> nil) and (savImage in Group.StyleBackground.Style.AssignedValues) then + Result := Group.StyleBackground.Style.Image + else Result := NavBar.DefaultStyles.GroupBackground.Image; +end; + +function TdxNavBarGroupViewInfo.BgBackColor: TColor; +begin + if (Group.StyleBackground <> nil) and (savBackColor in Group.StyleBackground.Style.AssignedValues) then + Result := Group.StyleBackground.Style.BackColor + else Result := NavBar.DefaultStyles.GroupBackground.BackColor; +end; + +function TdxNavBarGroupViewInfo.BgBackColor2: TColor; +begin + if (Group.StyleBackground <> nil) and (savBackColor2 in Group.StyleBackground.Style.AssignedValues) then + Result := Group.StyleBackground.Style.BackColor2 + else Result := NavBar.DefaultStyles.GroupBackground.BackColor2; +end; + +function TdxNavBarGroupViewInfo.BgAlphaBlend: Byte; +begin + if (Group.StyleBackground <> nil) and (savAlphaBlending in Group.StyleBackground.Style.AssignedValues) then + Result := Group.StyleBackground.Style.AlphaBlending + else Result := NavBar.DefaultStyles.GroupBackground.AlphaBlending; +end; + +function TdxNavBarGroupViewInfo.BgAlphaBlend2: Byte; +begin + if (Group.StyleBackground <> nil) and (savAlphaBlending2 in Group.StyleBackground.Style.AssignedValues) then + Result := Group.StyleBackground.Style.AlphaBlending2 + else Result := NavBar.DefaultStyles.GroupBackground.AlphaBlending2; +end; + +function TdxNavBarGroupViewInfo.BgGradientMode: TdxBarStyleGradientMode; +begin + if (Group.StyleBackground <> nil) and (savGradientMode in Group.StyleBackground.Style.AssignedValues) then + Result := Group.StyleBackground.Style.GradientMode + else Result := NavBar.DefaultStyles.GroupBackground.GradientMode; +end; + +function TdxNavBarGroupViewInfo.CaptionStyleItem: TdxNavBarStyleItem; +begin + if (sActive in State) or (sSpecial in State) then + begin + if sPressed in State then + Result := Group.StyleHeaderActivePressed + else if sHotTracked in State then + Result := Group.StyleHeaderActiveHotTracked + else Result := Group.StyleHeaderActive; + end + else if sPressed in State then + Result := Group.StyleHeaderPressed + else if sHotTracked in State then + Result := Group.StyleHeaderHotTracked + else Result := Group.StyleHeader; +end; + +function TdxNavBarGroupViewInfo.CaptionStyle: TdxNavBarBaseStyle; +begin + if (sActive in State) or (sSpecial in State) then + begin + if sPressed in State then + Result := NavBar.DefaultStyles.GroupHeaderActivePressed + else if sHotTracked in State then + Result := NavBar.DefaultStyles.GroupHeaderActiveHotTracked + else Result := NavBar.DefaultStyles.GroupHeaderActive; + end + else if sPressed in State then + Result := NavBar.DefaultStyles.GroupHeaderPressed + else if sHotTracked in State then + Result := NavBar.DefaultStyles.GroupHeaderHotTracked + else Result := NavBar.DefaultStyles.GroupHeader; +end; + +function TdxNavBarGroupViewInfo.CaptionImage: TPicture; +begin + if (CaptionStyleItem <> nil) and (savImage in CaptionStyleItem.Style.AssignedValues) then + Result := CaptionStyleItem.Style.Image + else Result := CaptionStyle.Image; +end; + +function TdxNavBarGroupViewInfo.CaptionBorderColor: TColor; +begin + Result := clNone; +end; + +function TdxNavBarGroupViewInfo.CaptionBackColor: TColor; +begin + if (CaptionStyleItem <> nil) and (savBackColor in CaptionStyleItem.Style.AssignedValues) then + Result := CaptionStyleItem.Style.BackColor + else Result := CaptionStyle.BackColor; +end; + +function TdxNavBarGroupViewInfo.CaptionBackColor2: TColor; +begin + if (CaptionStyleItem <> nil) and (savBackColor2 in CaptionStyleItem.Style.AssignedValues) then + Result := CaptionStyleItem.Style.BackColor2 + else Result := CaptionStyle.BackColor2; +end; + +function TdxNavBarGroupViewInfo.CaptionAlphaBlend: Byte; +begin + if (CaptionStyleItem <> nil) and (savAlphaBlending in CaptionStyleItem.Style.AssignedValues) then + Result := CaptionStyleItem.Style.AlphaBlending + else Result := CaptionStyle.AlphaBlending; +end; + +function TdxNavBarGroupViewInfo.CaptionAlphaBlend2: Byte; +begin + if (CaptionStyleItem <> nil) and (savAlphaBlending2 in CaptionStyleItem.Style.AssignedValues) then + Result := CaptionStyleItem.Style.AlphaBlending2 + else Result := CaptionStyle.AlphaBlending2; +end; + +function TdxNavBarGroupViewInfo.CaptionGradientMode: TdxBarStyleGradientMode; +begin + if (CaptionStyleItem <> nil) and (savGradientMode in CaptionStyleItem.Style.AssignedValues) then + Result := CaptionStyleItem.Style.GradientMode + else Result := CaptionStyle.GradientMode; +end; + +function TdxNavBarGroupViewInfo.CaptionFont: TFont; +begin + Result := FCaptionFont; + if (CaptionStyleItem <> nil) and (savFont in CaptionStyleItem.Style.AssignedValues) then + Result.Assign(CaptionStyleItem.Style.Font) + else Result.Assign(CaptionStyle.Font); +end; + +function TdxNavBarGroupViewInfo.CaptionFontColor: TColor; +begin + Result := CaptionFont.Color; +end; + +function TdxNavBarGroupViewInfo.CaptionSignColor: TColor; +begin + Result := CaptionFontColor; +end; + +function TdxNavBarGroupViewInfo.CaptionHAlignment: TdxBarStyleHAlignment; +begin + if (CaptionStyleItem <> nil) and (savHAlignment in CaptionStyleItem.Style.AssignedValues) then + Result := CaptionStyleItem.Style.HAlignment + else Result := CaptionStyle.HAlignment; +end; + +function TdxNavBarGroupViewInfo.CaptionVAlignment: TdxBarStyleVAlignment; +begin + if (CaptionStyleItem <> nil) and (savVAlignment in CaptionStyleItem.Style.AssignedValues) then + Result := CaptionStyleItem.Style.VAlignment + else Result := CaptionStyle.VAlignment; +end; + +function TdxNavBarGroupViewInfo.ControlImage: TPicture; +begin + if (Group.StyleControl <> nil) and (savImage in Group.StyleControl.Style.AssignedValues) then + Result := Group.StyleControl.Style.Image + else Result := NavBar.DefaultStyles.GroupControl.Image; +end; + +function TdxNavBarGroupViewInfo.ControlBackColor: TColor; +begin + if IsDefaultControlStyle then + Result := BgBackColor + else Result := GetControlBackColor; +end; + +function TdxNavBarGroupViewInfo.ControlBackColor2: TColor; +begin + if IsDefaultControlStyle then + Result := BgBackColor2 + else Result := GetControlBackColor2; +end; + +function TdxNavBarGroupViewInfo.ControlAlphaBlend: Byte; +begin + if IsDefaultControlStyle then + Result := BgAlphaBlend + else if (Group.StyleControl <> nil) and (savAlphaBlending in Group.StyleControl.Style.AssignedValues) then + Result := Group.StyleControl.Style.AlphaBlending + else Result := NavBar.DefaultStyles.GroupControl.AlphaBlending; +end; + +function TdxNavBarGroupViewInfo.ControlAlphaBlend2: Byte; +begin + if IsDefaultControlStyle then + Result := BgAlphaBlend2 + else if (Group.StyleControl <> nil) and (savAlphaBlending2 in Group.StyleControl.Style.AssignedValues) then + Result := Group.StyleControl.Style.AlphaBlending2 + else Result := NavBar.DefaultStyles.GroupControl.AlphaBlending2; +end; + +function TdxNavBarGroupViewInfo.ControlGradientMode: TdxBarStyleGradientMode; +begin + if IsDefaultControlStyle then + Result := BgGradientMode + else if (Group.StyleControl <> nil) and (savGradientMode in Group.StyleControl.Style.AssignedValues) then + Result := Group.StyleControl.Style.GradientMode + else Result := NavBar.DefaultStyles.GroupControl.GradientMode; +end; + +function TdxNavBarGroupViewInfo.UseLargeImages: Boolean; +begin + Result := not IsCaptionUseSmallImages; +end; + +function TdxNavBarGroupViewInfo.GetState: TdxNavBarObjectStates; +begin + Result := inherited GetState; + if (Group = NavBar.PressedGroup) or Group.CaptionPanelIAccessibilityHelper.IsPressed then + Include(Result, sPressed); + if Group = NavBar.HotTrackedGroup then + Include(Result, sHotTracked); + if Group.Expanded then + Include(Result, sExpanded); + if (Group = NavBar.ActiveGroup) and ViewInfo.CanHasActiveGroup then + Include(Result, sActive); + if (Group = NavBar.ActiveGroup) and ViewInfo.CanHasSpecialGroup and NavBar.ShowSpecialGroup then + Include(Result, sSpecial); + if Group.CaptionPanelIAccessibilityHelper.IsFocused then + Include(Result, sFocused); +end; + +function TdxNavBarGroupViewInfo.GetCaptionHeight: Integer; +begin + Result := ViewInfo.GetGroupCaptionHeightAddon; + Inc(Result, cxScreenCanvas.FontHeight(CaptionFont)); +end; + +function TdxNavBarGroupViewInfo.GetDrawEdgeFlag: Integer; +const + dxHAlignment: array[TdxBarStyleHAlignment] of Integer = (DT_LEFT, DT_CENTER, DT_RIGHT); + dxVAlignment: array[TdxBarStyleVAlignment] of Integer = (DT_TOP, DT_VCENTER, DT_BOTTOM); +begin + Result := dxHAlignment[CaptionHAlignment] or dxVAlignment[CaptionVAlignment] or + DT_SINGLELINE or DT_END_ELLIPSIS; +end; + +function TdxNavBarGroupViewInfo.GetImageHeight: Integer; +begin + if IsCaptionUseSmallImages then + Result := ViewInfo.GetSmallImageHeight + else Result := ViewInfo.GetLargeImageHeight; +end; + +function TdxNavBarGroupViewInfo.GetImageWidth: Integer; +begin + if IsCaptionUseSmallImages then + Result := ViewInfo.GetSmallImageWidth + else Result := ViewInfo.GetLargeImageWidth; +end; + +function TdxNavBarGroupViewInfo.IsCaptionVisible: Boolean; +begin + Result := FCaptionVisible and NavBar.ShowGroupCaptions and + (Group.ShowCaption or not ViewInfo.CanHasGroupWithNoCaption); +end; + +function TdxNavBarGroupViewInfo.IsCaptionImageVisible: Boolean; +begin + Result := ViewInfo.CanHasImageInGroupCaption and + (CaptionImageRect.Left >= CaptionRect.Left) and + (CaptionImageRect.Right <= CaptionRect.Right) and + (not ViewInfo.CanHasSignInGroupCaption or + (CaptionImageRect.Right < CaptionSignRect.Left)); +end; + +function TdxNavBarGroupViewInfo.IsCaptionSignVisible: Boolean; +begin + Result := ViewInfo.CanHasSignInGroupCaption and + (FCaptionSignRect.Left >= FCaptionRect.Left) and + (FCaptionSignRect.Right <= FCaptionRect.Right); +end; + +function TdxNavBarGroupViewInfo.IsCaptionUseSmallImages: Boolean; +begin + Result := not ViewInfo.CanGroupsUseLargeImages or Group.UseSmallImages; +end; + +function TdxNavBarGroupViewInfo.IsItemsVisible: Boolean; +begin + Result := FItemsVisible and ViewInfo.CanHasVisibleItemsInGroup(Group); +end; + +function TdxNavBarGroupViewInfo.IsLinksUseSmallImages: Boolean; +begin + Result := not ViewInfo.CanLinksUseLargeImages or Group.LinksUseSmallImages; +end; + +function TdxNavBarGroupViewInfo.IsViewAsIconView: Boolean; +begin + Result := ViewInfo.CanHasGroupViewAsIconView and Group.ShowAsIconView; +end; + +procedure TdxNavBarGroupViewInfo.AdjustControlBounds; +begin + Group.Control.AdjustControl(ControlRect, IsItemsVisible and Group.ShowControl); +end; + +function TdxNavBarGroupViewInfo.GetNavBarItem: TdxNavBarCustomItem; +begin + Result := Group; +end; + +procedure TdxNavBarGroupViewInfo.CreateInfo; +begin + CreateItemsInfo; +end; + +procedure TdxNavBarGroupViewInfo.CreateItemsInfo; +begin + ClearItems; + if Group <> nil then + DoCreateItemsInfo; +end; + +procedure TdxNavBarGroupViewInfo.CalculateBounds(var X, Y: Integer); + + function HasScrollButtonInGroupCaption: Boolean; + var + AActiveIndex, AIndex: Integer; + begin + AIndex := ViewInfo.IndexOfGroupViewInfo(Self); + AActiveIndex := ViewInfo.IndexOfGroupViewInfo(ViewInfo.ActiveGroupViewInfo); + Result := ViewInfo.CanHasScrollButtonInGroupCaption and + ((AIndex = AActiveIndex) or (AIndex = AActiveIndex + 1)); + end; + + procedure CalcImageRect; + var + ADelta, AHeightAddon: Integer; + begin + if ViewInfo.CanHasImageInGroupCaption then + begin + FImageRect.Left := FCaptionRect.Left + ViewInfo.GetGroupCaptionImageIndent; + FImageRect.Bottom := FCaptionRect.Bottom; + FImageRect.Right := FImageRect.Left + GetImageWidth; + FImageRect.Top := FImageRect.Bottom - GetImageHeight; + if ViewInfo.CanGroupCaptionBoundsByImage then + AHeightAddon := ViewInfo.GetGroupCaptionHeightAddon + else + AHeightAddon := 0; + if FImageRect.Top - 2 * AHeightAddon < FCaptionRect.Top then + begin + ADelta := FCaptionRect.Top + 2 * AHeightAddon - FImageRect.Top; + Inc(FCaptionRect.Bottom, ADelta); + Inc(FCaptionTextRect.Bottom, ADelta); + if not ViewInfo.CanGroupCaptionBoundsByImage then + begin + Inc(FCaptionRect.Top, ADelta); + Inc(FCaptionTextRect.Top, ADelta); + end; + OffsetRect(FImageRect, 0, ADelta - AHeightAddon); + end + else + begin + ADelta := cxRectHeight(FCaptionRect) div 2 - GetImageWidth div 2; + OffsetRect(FImageRect, 0, -ADelta); + end; + FCaptionTextRect.Left := FImageRect.Right + ViewInfo.GetGroupCaptionTextIndent; + end + else + FImageRect := cxNullRect; + end; + + procedure CalcSignRect; + var + ASignZone: TRect; + begin + if ViewInfo.CanHasSignInGroupCaption then + begin + ASignZone := FCaptionRect; + ASignZone.Left := FCaptionRect.Right - cxRectHeight(FCaptionRect); + FCaptionSignRect := cxRectCenter(ASignZone, ViewInfo.GetGroupCaptionSignSize); + FCaptionTextRect.Right := ASignZone.Left; + end + else + FCaptionSignRect := cxNullRect; + end; + + procedure CalcCaptionRect; + begin + FCaptionRect.Left := X; + FCaptionRect.Top := Y; + FCaptionRect.Right := ViewInfo.ClientWidth - X; + if HasScrollButtonInGroupCaption then + FCaptionRect.Right := FCaptionRect.Right - GetCaptionHeight - 2; + + if IsCaptionVisible then + begin + FCaptionRect.Bottom := Y + GetCaptionHeight; + FCaptionTextRect := FCaptionRect; + InflateRect(FCaptionTextRect, -2, -1); + CalcImageRect; + CalcSignRect; + end + else + FCaptionRect.Bottom := FCaptionRect.Top; + end; + + procedure CalcClientRect; + var + I: Integer; + AItemStartX, AItemStartY, AItemsRectBottom, AClientHeight: Integer; + begin + FRect.TopLeft := FCaptionRect.TopLeft; + FRect.Right := ViewInfo.ClientWidth - X; + if IsItemsVisible then + begin + if Control <> nil then + begin + FRect.Bottom := FCaptionRect.Bottom + Control.OriginalHeight; + Inc(FRect.Bottom, ViewInfo.GetGroupBorderOffsets.Top + ViewInfo.GetGroupBorderOffsets.Bottom); + end + else + begin + AItemsRectBottom := FCaptionRect.Bottom + ViewInfo.GetGroupCaptionSeparatorWidth; + AItemStartX := X; + AItemStartY := AItemsRectBottom; + for I := 0 to ItemCount - 1 do + begin + Items[I].CalculateBounds(AItemStartX, AItemStartY); + if IsViewAsIconView then + begin + if (Items[I].Rect.Right > FCaptionRect.Right) and (I > 0) then + begin + AItemStartX := X; + AItemStartY := Items[I - 1].Rect.Bottom; + Items[I].CalculateBounds(AItemStartX, AItemStartY); + end; + AItemStartX := Items[I].Rect.Right; + end + else + AItemStartY := Items[I].Rect.Bottom; + AItemsRectBottom := Items[I].Rect.Bottom; + end; + FRect.Bottom := AItemsRectBottom + ViewInfo.GetGroupCaptionSeparatorWidth; + end; + end + else + FRect.Bottom := FCaptionRect.Bottom; + if Group.Expanded and Assigned(NavBar.OnCalcGroupClientHeight) then + begin + AClientHeight := cxRectHeight(FRect) - cxRectHeight(FCaptionRect); + NavBar.OnCalcGroupClientHeight(NavBar, Self, AClientHeight); + FRect.Bottom := FRect.Top + AClientHeight + cxRectHeight(FCaptionRect); + end; + end; + + procedure CalcItemsRect; + begin + FItemsRect.Left := FCaptionRect.Left; + FItemsRect.Top := FCaptionRect.Bottom; + FItemsRect.BottomRight := FRect.BottomRight; + end; + + procedure CalcFocusRect; + begin + if IsFocused then + FFocusRect := cxRectContent(CaptionRect, cxRect(2, 2, 2, 2)) + else + SetRectEmpty(FFocusRect); + end; + +begin + CalcCaptionRect; + CalcDesignRect(CaptionRect, 14); + CalcFocusRect; + CalcClientRect; + CalcItemsRect; + Y := Rect.Bottom + ViewInfo.GetSpaceBetweenGroups; +end; + +procedure TdxNavBarGroupViewInfo.CorrectBounds(dX, dY: Integer); +var + I: Integer; +begin + inherited; + OffsetRect(FItemsRect, dX, dY); + OffsetRect(FCaptionTextRect, dX, dY); + OffsetRect(FCaptionSignRect, dX, dY); + for I := 0 to ItemCount - 1 do + Items[I].CorrectBounds(dX, dY); +end; + +procedure TdxNavBarGroupViewInfo.CorrectActiveGroupBounds(dX, dY: Integer); +var + I, OffsetY: Integer; + ALinkViewInfo: TdxNavBarLinkViewInfo; +begin + FRect.Right := FRect.Right + dX; + FRect.Bottom := FRect.Bottom + dY; + FItemsRect.Right := FItemsRect.Right + dX; + FItemsRect.Bottom := FItemsRect.Bottom + dY; + OffsetY := 0; + for I := 0 to Group.TopVisibleLinkIndex - 1 do + begin + ALinkViewInfo := ViewInfo.GetLinkViewInfoByLink(Group.Links[I]); + if ALinkViewInfo <> nil then + Inc(OffsetY, ALinkViewInfo.Rect.Bottom - ALinkViewInfo.Rect.Top); + end; + for I := 0 to ItemCount - 1 do + Items[I].CorrectBounds(0, - OffsetY); +end; + +function TdxNavBarGroupViewInfo.GetControl: TdxNavBarGroupControl; +begin + if Group.ShowControl then + Result := Group.Control + else Result := nil; +end; + +function TdxNavBarGroupViewInfo.GetControlBackColor: TColor; +begin + if (Group.StyleControl <> nil) and (savBackColor in Group.StyleControl.Style.AssignedValues) then + Result := Group.StyleControl.Style.BackColor + else Result := NavBar.DefaultStyles.GroupControl.BackColor; +end; + +function TdxNavBarGroupViewInfo.GetControlBackColor2: TColor; +begin + if (Group.StyleControl <> nil) and (savBackColor2 in Group.StyleControl.Style.AssignedValues) then + Result := Group.StyleControl.Style.BackColor2 + else Result := NavBar.DefaultStyles.GroupControl.BackColor2; +end; + +function TdxNavBarGroupViewInfo.GetItemCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxNavBarGroupViewInfo.GetItem(Index: Integer): TdxNavBarLinkViewInfo; +begin + Result := TdxNavBarLinkViewInfo(FItems.Items[Index]); +end; + +function TdxNavBarGroupViewInfo.IsDefaultControlStyle: Boolean; +begin + Result := (GetControlBackColor = clNone) or (GetControlBackColor2 = clNone); +end; + +procedure TdxNavBarGroupViewInfo.AddLink(AViewInfo: TdxNavBarViewInfo; ALink: TdxNavBarItemLink; ACaptionVisible, AImageVisisble: Boolean); +begin + FItems.Add(Painter.CreateLinkViewInfo(self, ALink, ACaptionVisible, AImageVisisble)); +end; + +procedure TdxNavBarGroupViewInfo.ClearItems; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do Items[I].Free; + FItems.Clear; +end; + +procedure TdxNavBarGroupViewInfo.DoCreateItemsInfo; +var + I: Integer; +begin + if IsItemsVisible and (Control = nil) then + for I := 0 to Group.LinkCount - 1 do + if (Group.Links[I].Item <> nil) and Group.Links[I].Item.Visible then + AddLink(ViewInfo, Group.Links[I], True, True); +end; + +function TdxNavBarGroupViewInfo.GetControlRect: TRect; +begin + Result := ItemsRect; + Result := cxRectContent(Result, ViewInfo.GetGroupBorderOffsets); + if IsCaptionVisible then Result.Top := CaptionRect.Bottom; +end; + +{ TdxNavBarViewInfo } + +constructor TdxNavBarViewInfo.Create(APainter: TdxNavBarPainter); +begin + inherited Create; + FPainter := APainter; + FNavBar := FPainter.NavBar; + FGroups := TObjectList.Create; + FHeaderFont := TFont.Create; + CreateColors; +end; + +destructor TdxNavBarViewInfo.Destroy; +begin + ReleaseColors; + FHeaderFont.Free; + ClearGroups; + FGroups.Free; + inherited Destroy; +end; + +function TdxNavBarViewInfo.ActiveGroupViewInfo: TdxNavBarGroupViewInfo; +begin + if (NavBar.ActiveGroup <> nil) then + Result := GetGroupViewInfoByGroup(NavBar.ActiveGroup) + else Result := nil; +end; + +function TdxNavBarViewInfo.GetGroupViewInfoByGroup(AGroup: TdxNavBarGroup): TdxNavBarGroupViewInfo; +var + I: Integer; +begin + Result := nil; + for I := 0 to GroupCount - 1 do + if Groups[I].Group = AGroup then + begin + Result := Groups[I]; + break; + end; +end; + +function TdxNavBarViewInfo.GetLinkViewInfoByLink(ALink: TdxNavBarItemLink): TdxNavBarLinkViewInfo; +var + I: Integer; +begin + Result := nil; + for I := 0 to GroupCount - 1 do + begin + Result := Groups[I].GetLinkViewInfoByLink(ALink); + if Result <> nil then break; + end; +end; + +function TdxNavBarViewInfo.IndexOfGroupViewInfo(AViewInfo: TdxNavBarGroupViewInfo): Integer; +begin + Result := FGroups.IndexOf(AViewInfo); +end; + +function TdxNavBarViewInfo.GetGroupViewInfoAtPos(const pt: TPoint): TdxNavBarGroupViewInfo; +var + I: Integer; +begin + Result := nil; + for I := 0 to GroupCount - 1 do + if PtInRect(Groups[I].Rect, pt) then + begin + Result := Groups[I]; + Break; + end; +end; + +function TdxNavBarViewInfo.GetGroupViewInfoAtCaptionPos(const pt: TPoint): TdxNavBarGroupViewInfo; +begin + Result := GetGroupViewInfoAtPos(pt); + if (Result <> nil) and not PtInRect(Result.CaptionRect, pt) then + Result := nil; +end; + +function GetValidGroup(AViewInfo: TdxNavBarGroupViewInfo): TdxNavBarGroup; +begin + if (AViewInfo <> nil) and (AViewInfo.Group <> nil) and not AViewInfo.Group.IsDestroying then + Result := AViewInfo.Group + else + Result := nil; +end; + +function TdxNavBarViewInfo.GetGroupViewInfoAtItemsPos(const pt: TPoint): TdxNavBarGroupViewInfo; +begin + Result := GetGroupViewInfoAtPos(pt); + if (Result <> nil) and PtInRect(Result.CaptionRect, pt) then + Result := nil; +end; + +function TdxNavBarViewInfo.GetGroupAtCaptionPos(const pt: TPoint): TdxNavBarGroup; +begin + Result := GetValidGroup(GetGroupViewInfoAtCaptionPos(pt)); +end; + +function TdxNavBarViewInfo.GetGroupAtItemsPos(const pt: TPoint): TdxNavBarGroup; +begin + Result := GetValidGroup(GetGroupViewInfoAtItemsPos(pt)); +end; + +function TdxNavBarViewInfo.GetLinkViewInfoAtPos(const pt: TPoint): TdxNavBarLinkViewInfo; +var + I: Integer; + AGroupViewInfo: TdxNavBarGroupViewInfo; +begin + Result := nil; + AGroupViewInfo := GetGroupViewInfoAtItemsPos(pt); + if AGroupViewInfo <> nil then + for I := 0 to AGroupViewInfo.ItemCount - 1 do + if PtInRect(AGroupViewInfo.Items[I].Rect, pt) then + begin + Result := AGroupViewInfo.Items[I]; + Break; + end; +end; + +function TdxNavBarViewInfo.GetLinkViewInfoAtSelectedPos(const pt: TPoint): TdxNavBarLinkViewInfo; +var + ACaptionRect: TRect; +begin + Result := nil; + if not (IsPtBottomScrollButton(pt) or IsPtTopScrollButton(pt)) then + begin + Result := GetLinkViewInfoAtPos(pt); + if (Result <> nil) and not Result.Link.CanSelect then + Result := nil + else + if (Result <> nil) and not CanSelectLinkByRect then + begin + ACaptionRect := Result.CaptionRect; + if Result.GroupViewInfo.IsLinksUseSmallImages then + ACaptionRect.Left := Result.ImageRect.Right + else + ACaptionRect.Top := Result.ImageRect.Bottom; + if not(PtInRect(Result.ImageRect, pt) or PtInRect(ACaptionRect, pt)) then + Result := nil; + end; + end; +end; + +function GetValidLink(AViewInfo: TdxNavBarLinkViewInfo): TdxNavBarItemLink; +begin + if (AViewInfo <> nil) and (AViewInfo.Link <> nil) and + (AViewInfo.Link.Group <> nil) and (AViewInfo.Link.Item <> nil) then + Result := AViewInfo.Link + else + Result := nil; +end; + +function TdxNavBarViewInfo.GetLinkAtPos(const pt: TPoint): TdxNavBarItemLink; +begin + Result := GetValidLink(GetLinkViewInfoAtPos(pt)); +end; + +function TdxNavBarViewInfo.GetLinkAtSelectedPos(const pt: TPoint): TdxNavBarItemLink; +begin + Result := GetValidLink(GetLinkViewInfoAtSelectedPos(pt)); +end; + +function TdxNavBarViewInfo.GetViewInfoAtDragPosition(const pt: TPoint; var ItemGroup: TdxNavBarGroupViewInfo; + var Item1, Item2: TdxNavBarLinkViewInfo): Integer; +var + Index: Integer; + ALinkViewInfo: TdxNavBarLinkViewInfo; +begin + ItemGroup := nil; + Item1 := nil; + Item2 := nil; + ItemGroup := GetGroupViewInfoAtItemsPos(pt); + if ItemGroup <> nil then + begin + if ItemGroup.IsViewAsIconView then + Result := GetViewInfoAtDragPositionWhenIconView(pt, ItemGroup, Item1, Item2) + else + begin + ALinkViewInfo := GetLinkViewInfoAtPos(pt); + if ALinkViewInfo <> nil then + begin + Index := ItemGroup.IndexOfLinkViewInfo(ALinkViewInfo); + if (ALinkViewInfo.Rect.Top + ALinkViewInfo.Rect.Bottom) div 2 > pt.y then + begin + if Index > 0 then + Item1 := ItemGroup.Items[Index - 1]; + Item2 := ALinkViewInfo + end + else + begin + Item1 := ALinkViewInfo; + if Index < ItemGroup.ItemCount - 1 then + Item2 := ItemGroup.Items[Index + 1]; + end; + end + else + if ItemGroup.ItemCount > 0 then + if pt.Y < ItemGroup.Items[0].Rect.Top then + Item2 := ItemGroup.Items[0] + else + Item1 := ItemGroup.Items[ItemGroup.ItemCount - 1]; + if (Item1 <> nil) and (Item2 <> nil) then + Result := Item2.Link.Index + else + if Item1 <> nil then + Result := ItemGroup.Group.LinkCount + else + Result := 0; + end; + end + else + begin + ItemGroup := GetGroupViewInfoAtCaptionPos(pt); + if ItemGroup <> nil then + begin + if ItemGroup.ItemCount > 0 then + Item2 := ItemGroup.Items[0]; + Result := 0; + end + else Result := -1; + end; +end; + +function TdxNavBarViewInfo.GetViewInfoAtDragPositionWhenIconView(const pt: TPoint; var ItemGroup: TdxNavBarGroupViewInfo; + var Item1, Item2: TdxNavBarLinkViewInfo): Integer; +var + I, Index: Integer; + ALinkViewInfo: TdxNavBarLinkViewInfo; +begin + ItemGroup := nil; + Item1 := nil; + Item2 := nil; + ItemGroup := GetGroupViewInfoAtItemsPos(pt); + if ItemGroup <> nil then + begin + ALinkViewInfo := GetLinkViewInfoAtPos(pt); + if ALinkViewInfo <> nil then + begin + Index := ItemGroup.IndexOfLinkViewInfo(ALinkViewInfo); + if (ALinkViewInfo.Rect.Left + (ALinkViewInfo.Rect.Right - ALinkViewInfo.Rect.Left) div 2) > pt.x then + begin + if Index > 0 then + Item1 := ItemGroup.Items[Index - 1]; + Item2 := ALinkViewInfo + end + else + begin + Item1 := ALinkViewInfo; + if Index < ItemGroup.ItemCount - 1 then + Item2 := ItemGroup.Items[Index + 1]; + end; + end + else + begin + if ItemGroup.ItemCount > 0 then + begin + if pt.Y < ItemGroup.Items[0].Rect.Top then + Item2 := ItemGroup.Items[0] + else if pt.Y > ItemGroup.Items[ItemGroup.ItemCount - 1].Rect.Top then + Item1 := ItemGroup.Items[ItemGroup.ItemCount - 1] + else for I := 0 to ItemGroup.ItemCount - 1 do + if (pt.y > ItemGroup.Items[I].Rect.Top) and (pt.y < ItemGroup.Items[I].Rect.Bottom) then + begin + if pt.x > ItemGroup.Items[I].Rect.Right then + begin + Item1 := ItemGroup.Items[I]; + if I < ItemGroup.ItemCount - 1 then + Item2 := ItemGroup.Items[I + 1]; + end + else if pt.x < ItemGroup.Items[I].Rect.Right then + begin + Item2 := ItemGroup.Items[I]; + if I > 0 then + Item1 := ItemGroup.Items[I - 1]; + end + end; + end; + end; + if (Item1 <> nil) and (Item2 <> nil) then + Result := Item2.Link.Index + else if Item1 <> nil then + Result := ItemGroup.Group.LinkCount + else Result := 0; + end + else Result := -1; +end; + +function TdxNavBarViewInfo.GetLinksAtDragPosition(const pt: TPoint; var ItemGroup: TdxNavBarGroup; + var Item1, Item2: TdxNavBarItemLink): Integer; +var + AGroupViewInfo: TdxNavBarGroupViewInfo; + ALinkViewInfo1, ALinkViewInfo2: TdxNavBarLinkViewInfo; +begin + Result := GetViewInfoAtDragPosition(pt, AGroupViewInfo, ALinkViewInfo1, ALinkViewInfo2); + if (AGroupViewInfo <> nil) and (AGroupViewInfo.Group <> nil) and + not AGroupViewInfo.Group.IsDestroying then + ItemGroup := AGroupViewInfo.Group + else ItemGroup := nil; + if (ALinkViewInfo1 <> nil) and (ALinkViewInfo1.Link <> nil) and + (ALinkViewInfo1.Link.Group <> nil) and ((ALinkViewInfo1.Link.Item <> nil)) then + Item1 := ALinkViewInfo1.Link + else Item1 := nil; + if (ALinkViewInfo2 <> nil) and (ALinkViewInfo2.Link <> nil) and + (ALinkViewInfo2.Link.Group <> nil) and ((ALinkViewInfo2.Link.Item <> nil)) then + Item2 := ALinkViewInfo2.Link + else Item2 := nil; +end; + +function TdxNavBarViewInfo.IsTopScrollButtonVisible: Boolean; +begin + Result := (FTopScrollButtonRect.Top <> FTopScrollButtonRect.Bottom) and + (FTopScrollButtonRect.Left <> FTopScrollButtonRect.Right); +end; + +function TdxNavBarViewInfo.IsBottomScrollButtonVisible: Boolean; +begin + Result := (FBottomScrollButtonRect.Top <> FBottomScrollButtonRect.Bottom) and + (FBottomScrollButtonRect.Left <> FBottomScrollButtonRect.Right); +end; + +function TdxNavBarViewInfo.IsPtTopScrollButton(const pt: TPoint): Boolean; +begin + Result := PtInRect(FTopScrollButtonRect, pt); +end; + +function TdxNavBarViewInfo.IsPtBottomScrollButton(const pt: TPoint): Boolean; +begin + Result := PtInRect(FBottomScrollButtonRect, pt); +end; + +function TdxNavBarViewInfo.IsPtGroupDesignRect(const pt: TPoint): Boolean; +var + AGroupViewInfo: TdxNavBarGroupViewInfo; +begin + AGroupViewInfo := GetGroupViewInfoAtCaptionPos(pt); + Result := (AGroupViewInfo <> nil) and PtInRect(AGroupViewInfo.DesignRect, pt); +end; + +function TdxNavBarViewInfo.IsPtItemDesignRect(const pt: TPoint): Boolean; +var + ALinkViewInfo: TdxNavBarLinkViewInfo; +begin + ALinkViewInfo := GetLinkViewInfoAtPos(pt); + Result := (ALinkViewInfo <> nil) and PtInRect(ALinkViewInfo.DesignRect, pt); +end; + +function TdxNavBarViewInfo.BgImage: TPicture; +begin + if (NavBar.StyleBackground <> nil) and (savImage in NavBar.StyleBackground.Style.AssignedValues) then + Result := NavBar.StyleBackground.Style.Image + else Result := NavBar.DefaultStyles.Background.Image; +end; + +function TdxNavBarViewInfo.BgBackColor: TColor; +begin + if (NavBar.StyleBackground <> nil) and (savBackColor in NavBar.StyleBackground.Style.AssignedValues) then + Result := NavBar.StyleBackground.Style.BackColor + else Result := NavBar.DefaultStyles.Background.BackColor; +end; + +function TdxNavBarViewInfo.BgBackColor2: TColor; +begin + if (NavBar.StyleBackground <> nil) and (savBackColor2 in NavBar.StyleBackground.Style.AssignedValues) then + Result := NavBar.StyleBackground.Style.BackColor2 + else Result := NavBar.DefaultStyles.Background.BackColor2; +end; + +function TdxNavBarViewInfo.BgAlphaBlend: Byte; +begin + if (NavBar.StyleBackground <> nil) and (savAlphaBlending in NavBar.StyleBackground.Style.AssignedValues) then + Result := NavBar.StyleBackground.Style.AlphaBlending + else Result := NavBar.DefaultStyles.Background.AlphaBlending; +end; + +function TdxNavBarViewInfo.BgAlphaBlend2: Byte; +begin + if (NavBar.StyleBackground <> nil) and (savAlphaBlending2 in NavBar.StyleBackground.Style.AssignedValues) then + Result := NavBar.StyleBackground.Style.AlphaBlending2 + else Result := NavBar.DefaultStyles.Background.AlphaBlending2; +end; + +function TdxNavBarViewInfo.BgGradientMode: TdxBarStyleGradientMode; +begin + if (NavBar.StyleBackground <> nil) and (savGradientMode in NavBar.StyleBackground.Style.AssignedValues) then + Result := NavBar.StyleBackground.Style.GradientMode + else Result := NavBar.DefaultStyles.Background.GradientMode; +end; + +function TdxNavBarViewInfo.BorderColor: TColor; +begin + Result := clNone; +end; + +function TdxNavBarViewInfo.BottomScrollButtonStyleItem: TdxNavBarStyleItem; +begin + if NavBar.ScrollButtonUpIsDown then + Result := NavBar.StyleButtonPressed + else if IsPtBottomScrollButton(NavBar.TargetPoint) then + Result := NavBar.StyleButtonHotTracked + else Result := NavBar.StyleButton; +end; + +function TdxNavBarViewInfo.BottomScrollButtonStyle: TdxNavBarBaseStyle; +begin + if NavBar.ScrollButtonUpIsDown then + Result := NavBar.DefaultStyles.ButtonPressed + else if IsPtBottomScrollButton(NavBar.TargetPoint) then + Result := NavBar.DefaultStyles.ButtonHotTracked + else Result := NavBar.DefaultStyles.Button; +end; + +function TdxNavBarViewInfo.BottomScrollButtonImage: TPicture; +begin + if (BottomScrollButtonStyleItem <> nil) and (savImage in BottomScrollButtonStyleItem.Style.AssignedValues) then + Result := BottomScrollButtonStyleItem.Style.Image + else Result := BottomScrollButtonStyle.Image; +end; + +function TdxNavBarViewInfo.BottomScrollButtonBackColor: TColor; +begin + if (BottomScrollButtonStyleItem <> nil) and (savBackColor in BottomScrollButtonStyleItem.Style.AssignedValues) then + Result := BottomScrollButtonStyleItem.Style.BackColor + else Result := BottomScrollButtonStyle.BackColor; +end; + +function TdxNavBarViewInfo.BottomScrollButtonBackColor2: TColor; +begin + if (BottomScrollButtonStyleItem <> nil) and (savBackColor2 in BottomScrollButtonStyleItem.Style.AssignedValues) then + Result := BottomScrollButtonStyleItem.Style.BackColor2 + else Result := BottomScrollButtonStyle.BackColor2; +end; + +function TdxNavBarViewInfo.BottomScrollButtonAlphaBlend: Byte; +begin + if (BottomScrollButtonStyleItem <> nil) and (savAlphaBlending in BottomScrollButtonStyleItem.Style.AssignedValues) then + Result := BottomScrollButtonStyleItem.Style.AlphaBlending + else Result := BottomScrollButtonStyle.AlphaBlending; +end; + +function TdxNavBarViewInfo.BottomScrollButtonAlphaBlend2: Byte; +begin + if (BottomScrollButtonStyleItem <> nil) and (savAlphaBlending2 in BottomScrollButtonStyleItem.Style.AssignedValues) then + Result := BottomScrollButtonStyleItem.Style.AlphaBlending2 + else Result := BottomScrollButtonStyle.AlphaBlending2; +end; + +function TdxNavBarViewInfo.BottomScrollButtonGradientMode: TdxBarStyleGradientMode; +begin + if (BottomScrollButtonStyleItem <> nil) and (savGradientMode in BottomScrollButtonStyleItem.Style.AssignedValues) then + Result := BottomScrollButtonStyleItem.Style.GradientMode + else Result := BottomScrollButtonStyle.GradientMode; +end; + +function TdxNavBarViewInfo.TopScrollButtonStyleItem: TdxNavBarStyleItem; +begin + if NavBar.ScrollButtonUpIsDown then + Result := NavBar.StyleButtonPressed + else if IsPtTopScrollButton(NavBar.TargetPoint) then + Result := NavBar.StyleButtonHotTracked + else Result := NavBar.StyleButton; +end; + +function TdxNavBarViewInfo.TopScrollButtonStyle: TdxNavBarBaseStyle; +begin + if NavBar.ScrollButtonUpIsDown then + Result := NavBar.DefaultStyles.ButtonPressed + else if IsPtTopScrollButton(NavBar.TargetPoint) then + Result := NavBar.DefaultStyles.ButtonHotTracked + else Result := NavBar.DefaultStyles.Button; +end; + +function TdxNavBarViewInfo.TopScrollButtonImage: TPicture; +begin + if (TopScrollButtonStyleItem <> nil) and (savImage in TopScrollButtonStyleItem.Style.AssignedValues) then + Result := TopScrollButtonStyleItem.Style.Image + else Result := TopScrollButtonStyle.Image; +end; + +function TdxNavBarViewInfo.TopScrollButtonBackColor: TColor; +begin + if (TopScrollButtonStyleItem <> nil) and (savBackColor in TopScrollButtonStyleItem.Style.AssignedValues) then + Result := TopScrollButtonStyleItem.Style.BackColor + else Result := TopScrollButtonStyle.BackColor; +end; + +function TdxNavBarViewInfo.TopScrollButtonBackColor2: TColor; +begin + if (TopScrollButtonStyleItem <> nil) and (savBackColor2 in TopScrollButtonStyleItem.Style.AssignedValues) then + Result := TopScrollButtonStyleItem.Style.BackColor2 + else Result := TopScrollButtonStyle.BackColor2; +end; + +function TdxNavBarViewInfo.TopScrollButtonAlphaBlend: Byte; +begin + if (TopScrollButtonStyleItem <> nil) and (savAlphaBlending in TopScrollButtonStyleItem.Style.AssignedValues) then + Result := TopScrollButtonStyleItem.Style.AlphaBlending + else Result := TopScrollButtonStyle.AlphaBlending; +end; + +function TdxNavBarViewInfo.TopScrollButtonAlphaBlend2: Byte; +begin + if (TopScrollButtonStyleItem <> nil) and (savAlphaBlending2 in TopScrollButtonStyleItem.Style.AssignedValues) then + Result := TopScrollButtonStyleItem.Style.AlphaBlending2 + else Result := TopScrollButtonStyle.AlphaBlending2; +end; + +function TdxNavBarViewInfo.TopScrollButtonGradientMode: TdxBarStyleGradientMode; +begin + if (TopScrollButtonStyleItem <> nil) and (savGradientMode in TopScrollButtonStyleItem.Style.AssignedValues) then + Result := TopScrollButtonStyleItem.Style.GradientMode + else Result := TopScrollButtonStyle.GradientMode; +end; + +function TdxNavBarViewInfo.HintImage: TPicture; +begin + if (NavBar.StyleHint <> nil) and (savImage in NavBar.StyleHint.Style.AssignedValues) then + Result := NavBar.StyleHint.Style.Image + else Result := NavBar.DefaultStyles.Hint.Image +end; + +function TdxNavBarViewInfo.HintBackColor: TColor; +begin + if (NavBar.StyleHint <> nil) and (savBackColor in NavBar.StyleHint.Style.AssignedValues) then + Result := NavBar.StyleHint.Style.BackColor + else Result := NavBar.DefaultStyles.Hint.BackColor; +end; + +function TdxNavBarViewInfo.HintBackColor2: TColor; +begin + if (NavBar.StyleHint <> nil) and (savBackColor2 in NavBar.StyleHint.Style.AssignedValues) then + Result := NavBar.StyleHint.Style.BackColor2 + else Result := NavBar.DefaultStyles.Hint.BackColor2; +end; + +function TdxNavBarViewInfo.HintAlphaBlend: Byte; +begin + if (NavBar.StyleHint <> nil) and (savAlphaBlending in NavBar.StyleHint.Style.AssignedValues) then + Result := NavBar.StyleHint.Style.AlphaBlending + else Result := NavBar.DefaultStyles.Hint.AlphaBlending; +end; + +function TdxNavBarViewInfo.HintAlphaBlend2: Byte; +begin + if (NavBar.StyleHint <> nil) and (savAlphaBlending2 in NavBar.StyleHint.Style.AssignedValues) then + Result := NavBar.StyleHint.Style.AlphaBlending2 + else Result := NavBar.DefaultStyles.Hint.AlphaBlending2; +end; + +function TdxNavBarViewInfo.HintGradientMode: TdxBarStyleGradientMode; +begin + if (NavBar.StyleHint <> nil) and (savGradientMode in NavBar.StyleHint.Style.AssignedValues) then + Result := NavBar.StyleHint.Style.GradientMode + else Result := NavBar.DefaultStyles.Hint.GradientMode; +end; + +function TdxNavBarViewInfo.HintFont: TFont; +begin + if (NavBar.StyleHint <> nil) and (savFont in NavBar.StyleHint.Style.AssignedValues) then + Result := NavBar.StyleHint.Style.Font + else Result := NavBar.DefaultStyles.Hint.Font; +end; + +function TdxNavBarViewInfo.DragDropItemTargetBackColor: TColor; +begin + if (NavBar.StyleDropTargetLink <> nil) and (savBackColor in NavBar.StyleDropTargetLink.Style.AssignedValues) then + Result := NavBar.StyleDropTargetLink.Style.BackColor + else Result := NavBar.DefaultStyles.DropTargetLink.BackColor; +end; + +function TdxNavBarViewInfo.DragDropGroupTargetBackColor: TColor; +begin + if (NavBar.StyleDropTargetGroup <> nil) and (savBackColor in NavBar.StyleDropTargetGroup.Style.AssignedValues) then + Result := NavBar.StyleDropTargetGroup.Style.BackColor + else Result := NavBar.DefaultStyles.DropTargetGroup.BackColor; +end; + +function TdxNavBarViewInfo.DragDropGroupTargetBackColor2: TColor; +begin + if (NavBar.StyleDropTargetGroup <> nil) and (savBackColor2 in NavBar.StyleDropTargetGroup.Style.AssignedValues) then + Result := NavBar.StyleDropTargetGroup.Style.BackColor2 + else Result := NavBar.DefaultStyles.DropTargetGroup.BackColor2; +end; + +function TdxNavBarViewInfo.DragDropGroupTargetAlphaBlend: Byte; +begin + if (NavBar.StyleDropTargetGroup <> nil) and (savAlphaBlending in NavBar.StyleDropTargetGroup.Style.AssignedValues) then + Result := NavBar.StyleDropTargetGroup.Style.AlphaBlending + else Result := NavBar.DefaultStyles.DropTargetGroup.AlphaBlending; +end; + +function TdxNavBarViewInfo.DragDropGroupTargetAlphaBlend2: Byte; +begin + if (NavBar.StyleDropTargetGroup <> nil) and (savAlphaBlending2 in NavBar.StyleDropTargetGroup.Style.AssignedValues) then + Result := NavBar.StyleDropTargetGroup.Style.AlphaBlending2 + else Result := NavBar.DefaultStyles.DropTargetGroup.AlphaBlending2; +end; + +function TdxNavBarViewInfo.DragDropGroupTargetGradient: TdxBarStyleGradientMode; +begin + if (NavBar.StyleDropTargetGroup <> nil) and (savGradientMode in NavBar.StyleDropTargetGroup.Style.AssignedValues) then + Result := NavBar.StyleDropTargetGroup.Style.GradientMode + else Result := NavBar.DefaultStyles.DropTargetGroup.GradientMode; +end; + +function TdxNavBarViewInfo.HeaderImage: TPicture; +begin + if (NavBar.StyleNavigationPaneHeader <> nil) and (savImage in NavBar.StyleNavigationPaneHeader.Style.AssignedValues) then + Result := NavBar.StyleNavigationPaneHeader.Style.Image + else Result := NavBar.DefaultStyles.NavigationPaneHeader.Image +end; + +function TdxNavBarViewInfo.HeaderBackColor: TColor; +begin + if (NavBar.StyleNavigationPaneHeader <> nil) and (savBackColor in NavBar.StyleNavigationPaneHeader.Style.AssignedValues) then + Result := NavBar.StyleNavigationPaneHeader.Style.BackColor + else Result := NavBar.DefaultStyles.NavigationPaneHeader.BackColor; +end; + +function TdxNavBarViewInfo.HeaderBackColor2: TColor; +begin + if (NavBar.StyleNavigationPaneHeader <> nil) and (savBackColor2 in NavBar.StyleNavigationPaneHeader.Style.AssignedValues) then + Result := NavBar.StyleNavigationPaneHeader.Style.BackColor2 + else Result := NavBar.DefaultStyles.NavigationPaneHeader.BackColor2; +end; + +function TdxNavBarViewInfo.HeaderAlphaBlend: Byte; +begin + if (NavBar.StyleNavigationPaneHeader <> nil) and (savAlphaBlending in NavBar.StyleNavigationPaneHeader.Style.AssignedValues) then + Result := NavBar.StyleNavigationPaneHeader.Style.AlphaBlending + else Result := NavBar.DefaultStyles.NavigationPaneHeader.AlphaBlending; +end; + +function TdxNavBarViewInfo.HeaderAlphaBlend2: Byte; +begin + if (NavBar.StyleNavigationPaneHeader <> nil) and (savAlphaBlending2 in NavBar.StyleNavigationPaneHeader.Style.AssignedValues) then + Result := NavBar.StyleNavigationPaneHeader.Style.AlphaBlending2 + else Result := NavBar.DefaultStyles.NavigationPaneHeader.AlphaBlending2; +end; + +function TdxNavBarViewInfo.HeaderGradientMode: TdxBarStyleGradientMode; +begin + if (NavBar.StyleNavigationPaneHeader <> nil) and (savGradientMode in NavBar.StyleNavigationPaneHeader.Style.AssignedValues) then + Result := NavBar.StyleNavigationPaneHeader.Style.GradientMode + else Result := NavBar.DefaultStyles.NavigationPaneHeader.GradientMode; +end; + +function TdxNavBarViewInfo.HeaderFont: TFont; +begin + Result := FHeaderFont; + if (NavBar.StyleNavigationPaneHeader <> nil) and (savFont in NavBar.StyleNavigationPaneHeader.Style.AssignedValues) then + Result.Assign(NavBar.StyleNavigationPaneHeader.Style.Font) + else + Result.Assign(NavBar.DefaultStyles.NavigationPaneHeader.Font); +end; + +function TdxNavBarViewInfo.HeaderFontColor: TColor; +begin + Result := HeaderFont.Color; +end; + +function TdxNavBarViewInfo.HeaderHAlignment: TdxBarStyleHAlignment; +begin + if (NavBar.StyleNavigationPaneHeader <> nil) and (savHAlignment in NavBar.StyleNavigationPaneHeader.Style.AssignedValues) then + Result := NavBar.StyleNavigationPaneHeader.Style.HAlignment + else Result := NavBar.DefaultStyles.NavigationPaneHeader.HAlignment; +end; + +function TdxNavBarViewInfo.HeaderVAlignment: TdxBarStyleVAlignment; +begin + if (NavBar.StyleNavigationPaneHeader <> nil) and (savVAlignment in NavBar.StyleNavigationPaneHeader.Style.AssignedValues) then + Result := NavBar.StyleNavigationPaneHeader.Style.VAlignment + else Result := NavBar.DefaultStyles.NavigationPaneHeader.VAlignment; +end; + +function TdxNavBarViewInfo.HeaderDrawEdgeFlag: Integer; +const + dxHAlignment: array[TdxBarStyleHAlignment] of Integer = (DT_LEFT, DT_CENTER, DT_RIGHT); + dxVAlignment: array[TdxBarStyleVAlignment] of Integer = (DT_TOP, DT_VCENTER, DT_BOTTOM); +begin + Result := dxHAlignment[HeaderHAlignment] or dxVAlignment[HeaderVAlignment] or + DT_SINGLELINE or DT_END_ELLIPSIS; +end; + +function TdxNavBarViewInfo.OverflowPanelImage: TPicture; +begin + Result := NavBar.DefaultStyles.GroupHeader.Image; +end; + +function TdxNavBarViewInfo.OverflowPanelBackColor: TColor; +begin + Result := NavBar.DefaultStyles.GroupHeader.BackColor; +end; + +function TdxNavBarViewInfo.OverflowPanelBackColor2: TColor; +begin + Result := NavBar.DefaultStyles.GroupHeader.BackColor2; +end; + +function TdxNavBarViewInfo.OverflowPanelAlphaBlend: Byte; +begin + Result := NavBar.DefaultStyles.GroupHeader.AlphaBlending; +end; + +function TdxNavBarViewInfo.OverflowPanelAlphaBlend2: Byte; +begin + Result := NavBar.DefaultStyles.GroupHeader.AlphaBlending2; +end; + +function TdxNavBarViewInfo.OverflowPanelGradientMode: TdxBarStyleGradientMode; +begin + Result := NavBar.DefaultStyles.GroupHeader.GradientMode; +end; + +function TdxNavBarViewInfo.OverflowPanelFont: TFont; +begin + Result := NavBar.DefaultStyles.GroupHeader.Font; +end; + +function TdxNavBarViewInfo.OverflowPanelFontColor: TColor; +begin + Result := NavBar.DefaultStyles.GroupHeader.Font.Color; +end; + +function TdxNavBarViewInfo.SplitterBackColor: TColor; +begin + Result := HeaderBackColor; +end; + +function TdxNavBarViewInfo.SplitterBackColor2: TColor; +begin + Result := HeaderBackColor2; +end; + +function TdxNavBarViewInfo.SplitterAlphaBlend: Byte; +begin + Result := HeaderAlphaBlend; +end; + +function TdxNavBarViewInfo.SplitterAlphaBlend2: Byte; +begin + Result := HeaderAlphaBlend2; +end; + +function TdxNavBarViewInfo.SplitterGradientMode: TdxBarStyleGradientMode; +begin + Result := HeaderGradientMode; +end; + +procedure TdxNavBarViewInfo.AssignDefaultBackgroundStyle; +begin + NavBar.DefaultStyles.Background.ResetValues; + NavBar.DefaultStyles.Background.BackColor := clAppWorkSpace; + NavBar.DefaultStyles.Background.BackColor2 := clAppWorkSpace; +end; + +procedure TdxNavBarViewInfo.AssignDefaultButtonStyle; +begin + NavBar.DefaultStyles.Button.ResetValues; + NavBar.DefaultStyles.Button.BackColor := clBtnFace; + NavBar.DefaultStyles.Button.BackColor2 := clBtnFace; +end; + +procedure TdxNavBarViewInfo.AssignDefaultButtonPressedStyle; +begin + NavBar.DefaultStyles.ButtonPressed.Assign(NavBar.DefaultStyles.Button); +end; + +procedure TdxNavBarViewInfo.AssignDefaultButtonHotTrackedStyle; +begin + NavBar.DefaultStyles.ButtonHotTracked.Assign(NavBar.DefaultStyles.Button); +end; + +procedure TdxNavBarViewInfo.AssignDefaultGroupControlStyle; +begin + NavBar.DefaultStyles.GroupControl.ResetValues; + NavBar.DefaultStyles.GroupControl.BackColor := clNone; + NavBar.DefaultStyles.GroupControl.BackColor2 := clNone; +end; + +procedure TdxNavBarViewInfo.AssignDefaultGroupBackgroundStyle; +begin + NavBar.DefaultStyles.GroupBackground.ResetValues; + NavBar.DefaultStyles.GroupBackground.BackColor := clAppWorkSpace; + NavBar.DefaultStyles.GroupBackground.BackColor2 := clAppWorkSpace; +end; + +procedure TdxNavBarViewInfo.AssignDefaultGroupHeaderStyle; +begin + NavBar.DefaultStyles.GroupHeader.ResetValues; + NavBar.DefaultStyles.GroupHeader.BackColor := clBtnFace; + NavBar.DefaultStyles.GroupHeader.BackColor2 := clBtnFace; + NavBar.DefaultStyles.GroupHeader.Font.Color := clBtnText; + NavBar.DefaultStyles.GroupHeader.HAlignment := haCenter; +end; + +procedure TdxNavBarViewInfo.AssignDefaultGroupHeaderActiveStyle; +begin + NavBar.DefaultStyles.GroupHeaderActive.Assign(NavBar.DefaultStyles.GroupHeader); +end; + +procedure TdxNavBarViewInfo.AssignDefaultGroupHeaderActiveHotTrackedStyle; +begin + NavBar.DefaultStyles.GroupHeaderActiveHotTracked.Assign(NavBar.DefaultStyles.GroupHeaderActive); +end; + +procedure TdxNavBarViewInfo.AssignDefaultGroupHeaderActivePressedStyle; +begin + NavBar.DefaultStyles.GroupHeaderActivePressed.Assign(NavBar.DefaultStyles.GroupHeaderActive); +end; + +procedure TdxNavBarViewInfo.AssignDefaultGroupHeaderHotTrackedStyle; +begin + NavBar.DefaultStyles.GroupHeaderHotTracked.Assign(NavBar.DefaultStyles.GroupHeader); +end; + +procedure TdxNavBarViewInfo.AssignDefaultGroupHeaderPressedStyle; +begin + NavBar.DefaultStyles.GroupHeaderPressed.Assign(NavBar.DefaultStyles.GroupHeader); +end; + +procedure TdxNavBarViewInfo.AssignDefaultHintStyle; +begin + NavBar.DefaultStyles.Hint.ResetValues; + NavBar.DefaultStyles.Hint.BackColor := clInfoBk; + NavBar.DefaultStyles.Hint.BackColor2 := clInfoBk; + NavBar.DefaultStyles.Hint.Font.Color := clInfoText; + NavBar.DefaultStyles.Hint.HAlignment := haCenter; +end; + +procedure TdxNavBarViewInfo.AssignDefaultItemStyle; +begin + NavBar.DefaultStyles.Item.ResetValues; + NavBar.DefaultStyles.Item.Font.Color := clBtnHighlight; + NavBar.DefaultStyles.Item.HAlignment := haCenter; +end; + +procedure TdxNavBarViewInfo.AssignDefaultItemDisabledStyle; +begin + NavBar.DefaultStyles.ItemDisabled.Assign(NavBar.DefaultStyles.Item); + NavBar.DefaultStyles.ItemDisabled.Font.Color := clBtnText; +end; + +procedure TdxNavBarViewInfo.AssignDefaultItemHotTrackedStyle; +begin + NavBar.DefaultStyles.ItemHotTracked.Assign(NavBar.DefaultStyles.Item); +end; + +procedure TdxNavBarViewInfo.AssignDefaultItemPressedStyle; +begin + NavBar.DefaultStyles.ItemPressed.Assign(NavBar.DefaultStyles.Item); +end; + +procedure TdxNavBarViewInfo.AssignDefaultDropTargetGroupStyle; +begin + NavBar.DefaultStyles.DropTargetGroup.ResetValues; + NavBar.DefaultStyles.DropTargetGroup.BackColor := clHighlight; + NavBar.DefaultStyles.DropTargetGroup.BackColor2 := clHighlight; + NavBar.DefaultStyles.DropTargetGroup.AlphaBlending := 60; + NavBar.DefaultStyles.DropTargetGroup.AlphaBlending2 := 60; +end; + +procedure TdxNavBarViewInfo.AssignDefaultDropTargetLinkStyle; +begin + NavBar.DefaultStyles.DropTargetLink.ResetValues; + NavBar.DefaultStyles.DropTargetLink.BackColor := clBlack; +end; + +procedure TdxNavBarViewInfo.AssignDefaultNavigationPaneHeaderStyle; +begin + NavBar.DefaultStyles.NavigationPaneHeader.ResetValues; +end; + +function TdxNavBarViewInfo.GetLargeImageHeight: Integer; +begin + if (NavBar.LargeImages <> nil) then + Result := NavBar.LargeImages.Height + else Result := dxNavBarDefaultLargeImageHeight; +end; + +function TdxNavBarViewInfo.GetLargeImageWidth: Integer; +begin + if (NavBar.LargeImages <> nil) then + Result := NavBar.LargeImages.Width + else Result := dxNavBarDefaultLargeImageWidth; +end; + +function TdxNavBarViewInfo.GetSmallImageHeight: Integer; +begin + if (NavBar.SmallImages <> nil) then + Result := NavBar.SmallImages.Height + else Result := dxNavBarDefaultSmallImageHeight; +end; + +function TdxNavBarViewInfo.GetSmallImageWidth: Integer; +begin + if (NavBar.SmallImages <> nil) then + Result := NavBar.SmallImages.Width + else Result := dxNavBarDefaultSmallImageWidth; +end; + +procedure TdxNavBarViewInfo.CreateColors; +begin +end; + +procedure TdxNavBarViewInfo.RefreshColors; +begin +end; + +procedure TdxNavBarViewInfo.ReleaseColors; +begin +end; + +function TdxNavBarViewInfo.ClientHeight: Integer; +begin + Result := NavBar.ClientHeight; +end; + +function TdxNavBarViewInfo.ClientWidth: Integer; +begin + Result := NavBar.ClientWidth; +end; + +function TdxNavBarViewInfo.GetSpaceBetweenGroups: Integer; +begin + if NavBar.SpaceBetweenGroups > 0 then + Result := NavBar.SpaceBetweenGroups + else + Result := GetGroupSeparatorWidth; +end; + +function TdxNavBarViewInfo.GetGroupBorderOffsets: TRect; +begin + Result := cxNullRect; +end; + +function TdxNavBarViewInfo.GetGroupCaptionHeightAddon: Integer; +begin + Result := 6; +end; + +class function TdxNavBarViewInfo.GetGroupCaptionTextIndent: Integer; +begin + Result := 4; +end; + +class function TdxNavBarViewInfo.GetGroupCaptionImageIndent: Integer; +begin + Result := 0; +end; + +function TdxNavBarViewInfo.GetGroupSeparatorWidth: Integer; +begin + Result := 0; +end; + +function TdxNavBarViewInfo.GetGroupCaptionSignSize: TSize; +begin + Result := cxSize(16, 16); +end; + +function TdxNavBarViewInfo.GetGroupEdges: TPoint; +begin + Result := cxNullPoint; +end; + +class function TdxNavBarViewInfo.GetGroupCaptionSeparatorWidth: Integer; +begin + Result := 8; +end; + +class function TdxNavBarViewInfo.GetLinksLargeSeparatorWidth: Integer; +begin + Result := 6; +end; + +class function TdxNavBarViewInfo.GetLinksSmallSeparatorWidth: Integer; +begin + Result := 6; +end; + +class function TdxNavBarViewInfo.GetLinksIconViewSeparatorWidth: Integer; +begin + Result := 4; +end; + +function TdxNavBarViewInfo.GetLinksImageEdges: TRect; +begin + Result := cxRect(4, 4, 4, 4); +end; + +class function TdxNavBarViewInfo.GetDragArrowHeight: Integer; +begin + Result := 8; +end; + +class function TdxNavBarViewInfo.GetDragArrowWidth: Integer; +begin + Result := 6; +end; + +function TdxNavBarViewInfo.GetHeaderHeightAddon: Integer; +begin + Result := 8; +end; + +function TdxNavBarViewInfo.GetNavBarCollapsedWidth: Integer; +begin + Result := 0; +end; + +function TdxNavBarViewInfo.GetNavBarMinExpandedWidth: Integer; +begin + Result := 0; +end; + +class function TdxNavBarViewInfo.GetScrollButtonVerticalEdge: Integer; +begin + Result := 6; +end; + +class function TdxNavBarViewInfo.GetScrollButtonHorizontalEdge: Integer; +begin + Result := 6; +end; + +class function TdxNavBarViewInfo.GetScrollButtonVerticalSize: Integer; +begin + Result := 16; +end; + +class function TdxNavBarViewInfo.GetScrollButtonHorizontalSize: Integer; +begin + Result := 16; +end; + +function TdxNavBarViewInfo.CanCollapse: Boolean; +begin + Result := False; +end; + +function TdxNavBarViewInfo.CanHasActiveGroup: Boolean; +begin + Result := True; +end; + +function TdxNavBarViewInfo.CanHasSpecialGroup: Boolean; +begin + Result := False; +end; + +function TdxNavBarViewInfo.CanHasScrollButtonInGroupCaption: Boolean; +begin + Result := False; +end; + +function TdxNavBarViewInfo.CanHasImageInGroupCaption: Boolean; +begin + Result := False; +end; + +function TdxNavBarViewInfo.CanHasSignInGroupCaption: Boolean; +begin + Result := False; +end; + +function TdxNavBarViewInfo.CanHasGroupViewAsIconView: Boolean; +begin + Result := True; +end; + +function TdxNavBarViewInfo.CanHasGroupWithNoCaption: Boolean; +begin + Result := False; +end; + +function TdxNavBarViewInfo.CanHasVisibleItemsInGroup(AGroup: TdxNavBarGroup): Boolean; +begin + Result := AGroup = NavBar.ActiveGroup; +end; + +function TdxNavBarViewInfo.CanGroupCaptionBoundsByImage: Boolean; +begin + Result := False; +end; + +function TdxNavBarViewInfo.CanGroupsUseLargeImages: Boolean; +begin + Result := True; +end; + +function TdxNavBarViewInfo.CanLinksUseLargeImages: Boolean; +begin + Result := True; +end; + +function TdxNavBarViewInfo.CanSelectLinkByRect: Boolean; +begin + Result := False; +end; + +procedure TdxNavBarViewInfo.DoCreateGroupsInfo; +var + I: Integer; +begin + if NavBar.ShowGroupCaptions then + begin + for I := 0 to NavBar.Groups.Count - 1 do + if NavBar.Groups[I].Visible then + AddGroup(Self, NavBar.Groups[I], True, True); + end + else + if NavBar.ActiveGroup <> nil then + AddGroup(Self, NavBar.ActiveGroup, True, True); +end; + +procedure TdxNavBarViewInfo.DoCalculateBounds(X, Y: Integer); +var + I: Integer; +begin + for I := 0 to GroupCount - 1 do + Groups[I].CalculateBounds(X, Y); +end; + +function TdxNavBarViewInfo.FindGroupWithAccel(AKey: Word): TdxNavBarGroup; +var + AIndex: Integer; + AGroup: TdxNavBarGroup; +begin + Result := nil; + for AIndex := 0 to GroupCount - 1 do + begin + AGroup := Groups[AIndex].Group; + if IsAccel(AKey, AGroup.Caption) then + begin + Result := AGroup; + Break; + end + end; +end; + +function TdxNavBarViewInfo.FindLinkWithAccel(AKey: Word): TdxNavBarItemLink; +var + AGroupIndex, ALinkIndex: Integer; + AGroupViewInfo: TdxNavBarGroupViewInfo; + ALinkViewInfo: TdxNavBarLinkViewInfo; +begin + Result := nil; + for AGroupIndex := 0 to GroupCount - 1 do + begin + AGroupViewInfo := Groups[AGroupIndex]; + for ALinkIndex := 0 to AGroupViewInfo.ItemCount - 1 do + begin + ALinkViewInfo := AGroupViewInfo.Items[ALinkIndex]; + if IsAccel(AKey, ALinkViewInfo.Item.Caption) then + begin + Result := ALinkViewInfo.Link; + Break; + end; + end; + end; +end; + +procedure TdxNavBarViewInfo.DoGroupActiveToggle(AGroup: TdxNavBarGroup); +begin + if IsGroupActive(AGroup) then + DoGroupDeactivate(AGroup) + else + DoGroupActivate(AGroup); +end; + +procedure TdxNavBarViewInfo.DoGroupActivate(AGroup: TdxNavBarGroup); +begin +end; + +procedure TdxNavBarViewInfo.DoGroupDeactivate(AGroup: TdxNavBarGroup); +begin +end; + +function TdxNavBarViewInfo.IsGroupActive(AGroup: TdxNavBarGroup): Boolean; +begin + Result := False; +end; + +procedure TdxNavBarViewInfo.MakeLinkVisible(ALink: TdxNavBarItemLink; ATop: Boolean = True); +begin +end; + +procedure TdxNavBarViewInfo.MakeGroupVisible(AGroup: TdxNavBarGroup; + AExpandGroup: Boolean = True; ATop: Boolean = True); +begin +end; + +procedure TdxNavBarViewInfo.AdjustControlsBounds; +var + I: Integer; + AGroup: TdxNavBarGroup; + AControl: TdxNavBarGroupControl; + AViewInfo: TdxNavBarGroupViewInfo; +begin + for I := 0 to NavBar.Groups.Count - 1 do + begin + AGroup := NavBar.Groups[I]; + AControl := AGroup.Control; + if (AControl <> nil) and (AControl.Parent = NavBar) then + begin + AViewInfo := GetGroupViewInfoByGroup(AGroup); + if AViewInfo <> nil then + AViewInfo.AdjustControlBounds + else + AControl.AdjustControl(cxRectOffset(NavBar.BoundsRect, + cxPointInvert(NavBar.BoundsRect.TopLeft)), False); + end; + end; +end; + +procedure TdxNavBarViewInfo.CorrectBounds; +begin +// do nothing +end; + +function TdxNavBarViewInfo.GetBoundsUpdateType: TdxNavBarChangeType; +begin + Result := doRecalc; +end; + +procedure TdxNavBarViewInfo.CreateInfo; +begin + CreateGroupsInfo; +end; + +procedure TdxNavBarViewInfo.CreateGroupsInfo; +begin + ClearGroups; + DoCreateGroupsInfo; +end; + +procedure TdxNavBarViewInfo.CalculateBounds; +begin + ClearRects; + DoCalculateBounds(GetGroupEdges.X, GetGroupEdges.Y); + CorrectBounds; + AdjustControlsBounds; +end; + +procedure TdxNavBarViewInfo.CalculateScrollButtonsBounds; +begin + if ActiveGroupViewInfo = nil then exit; + FTopScrollButtonRect := GetTopScrollButtonRect; + FBottomScrollButtonRect := GetBottomScrollButtonRect; +end; + +procedure TdxNavBarViewInfo.ClearRects; +begin + SetRectEmpty(FTopScrollButtonRect); + SetRectEmpty(FBottomScrollButtonRect); + SetRectEmpty(FHintRect); +end; + +function TdxNavBarViewInfo.GetTopScrollButtonRect: TRect; +begin + SetRectEmpty(Result); + if not (sDisabled in TopScrollButtonState) then + begin + Result := ActiveGroupViewInfo.ItemsRect; + Result.Left := Result.Right - GetScrollButtonHorizontalSize; + Result.Bottom := Result.Top + GetScrollButtonVerticalSize; + OffSetRect(Result, - GetScrollButtonHorizontalEdge, GetScrollButtonVerticalEdge); + end; +end; + +function TdxNavBarViewInfo.GetBottomScrollButtonRect: TRect; +begin + SetRectEmpty(Result); + if not (sDisabled in BottomScrollButtonState) then + begin + Result := ActiveGroupViewInfo.ItemsRect; + Result.Left := Result.Right - GetScrollButtonHorizontalSize; + Result.Bottom := Result.Top + GetScrollButtonVerticalSize; + OffSetRect(Result, - GetScrollButtonHorizontalEdge, - GetScrollButtonVerticalEdge); + OffSetRect(Result, 0, ActiveGroupViewInfo.ItemsRect.Bottom - + ActiveGroupViewInfo.ItemsRect.Top - GetScrollButtonVerticalSize); + end; +end; + +function TdxNavBarViewInfo.GetGroupCount: Integer; +begin + Result := FGroups.Count; +end; + +function TdxNavBarViewInfo.GetGroup(Index: Integer): TdxNavBarGroupViewInfo; +begin + Result := TdxNavBarGroupViewInfo(FGroups.Items[Index]); +end; + +procedure TdxNavBarViewInfo.AddGroup(AViewInfo: TdxNavBarViewInfo; AGroup: TdxNavBarGroup; ACaptionVisible, AItemsVisible: Boolean); +begin + FGroups.Add(Painter.CreateGroupViewInfo(AViewInfo, AGroup, ACaptionVisible, AItemsVisible)); +end; + +procedure TdxNavBarViewInfo.RemoveGroup(AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + FGroups.Remove(AGroupViewInfo); +end; + +procedure TdxNavBarViewInfo.ClearGroups; +begin + FGroups.Clear; +end; + +function TdxNavBarViewInfo.GetBottomScrollButtonState: TdxNavBarObjectStates; +begin + Result := []; + if not NavBar.IsDesigning then + begin + if NavBar.ScrollButtonDownIsDown then + Result := Result + [sPressed]; + if IsPtBottomScrollButton(NavBar.TargetPoint) then + Result := Result + [sHotTracked]; + end; + if not ((ActiveGroupViewInfo <> nil) and (ActiveGroupViewInfo.ItemCount > 0) and + (ActiveGroupViewInfo.Items[ActiveGroupViewInfo.ItemCount - 1].Rect.Bottom > + ActiveGroupViewInfo.Rect.Bottom) and + (ActiveGroupViewInfo.Group.TopVisibleLinkIndex < ActiveGroupViewInfo.ItemCount - 1)) then + Result := Result + [sDisabled]; +end; + +function TdxNavBarViewInfo.GetTopScrollButtonState: TdxNavBarObjectStates; +begin + Result := []; + if not NavBar.IsDesigning then + begin + if NavBar.ScrollButtonUpIsDown then + Result := Result + [sPressed]; + if IsPtTopScrollButton(NavBar.TargetPoint) then + Result := Result + [sHotTracked]; + end; + if not ((ActiveGroupViewInfo <> nil) and (ActiveGroupViewInfo.ItemCount > 0) and + (ActiveGroupViewInfo.Group.TopVisibleLinkIndex > 0)) then + Result := Result + [sDisabled]; +end; + +{ TdxNavBarItemCalculators } + +class procedure TdxNavBarItemCalculator.CalculateBounds(X, Y: Integer; var ALinkViewInfo); + + procedure PriorCalcImageRect(ALeft, ATop: Integer); + begin + with TdxNavBarLinkViewInfo(ALinkViewInfo) do + FImageRect := cxRectBounds(ALeft, ATop, GetImageWidth, GetImageHeight); + end; + + procedure PriorCalcCaptionRect(ALeft, ATop, ARightPosition: Integer); + var + ARect: TRect; + begin + with TdxNavBarLinkViewInfo(ALinkViewInfo) do + begin + ARect := cxRect(ALeft, ATop, ARightPosition, ATop + GetCaptionHeight); + cxScreenCanvas.Canvas.Font := Font; + cxDrawText(cxScreenCanvas.Handle, Item.Caption, ARect, GetDrawEdgeFlag or DT_CALCRECT); + ARect.Right := Min(ARect.Right, ARightPosition); + FCaptionRect := ARect; + end; + end; + + procedure CalcRect(ARight, ABottom: Integer); + begin + TdxNavBarLinkViewInfo(ALinkViewInfo).FRect := cxRect(X, Y, ARight, ABottom); + end; + + procedure CalcSmallBounds(ARightPosition: Integer); + begin + with TdxNavBarLinkViewInfo(ALinkViewInfo) do + begin + PriorCalcImageRect(X + ViewInfo.GetLinksImageEdges.Left, Y); + PriorCalcCaptionRect(FImageRect.Right + ViewInfo.GetLinksImageEdges.Right, Y, ARightPosition - 1); + + CalcRect(ARightPosition, + Y + Max(cxRectHeight(ImageRect), cxRectHeight(CaptionRect)) + ViewInfo.GetLinksSmallSeparatorWidth); + + OffsetRect(FImageRect, 0, (cxRectHeight(Rect) - cxRectHeight(ImageRect)) div 2); + OffsetRect(FCaptionRect, 0, (cxRectHeight(Rect) div 2) - (cxRectHeight(CaptionRect) div 2)); + end; + end; + + procedure CalcLargeBounds(ARightPosition: Integer); + begin + with TdxNavBarLinkViewInfo(ALinkViewInfo) do + begin + PriorCalcImageRect(X, Y + ViewInfo.GetLinksLargeSeparatorWidth div 2); + PriorCalcCaptionRect(X + 1, FImageRect.Bottom + ViewInfo.GetLinksImageEdges.Bottom, ARightPosition - 1); + + CalcRect(ARightPosition, CaptionRect.Bottom + ViewInfo.GetLinksLargeSeparatorWidth div 2); + + OffsetRect(FImageRect, (cxRectWidth(Rect) - cxRectWidth(ImageRect)) div 2, 0); + OffsetRect(FCaptionRect, (cxRectWidth(Rect) - cxRectWidth(CaptionRect)) div 2, 0); + end; + end; + + procedure CalcFocusRect; + begin + with TdxNavBarLinkViewInfo(ALinkViewInfo) do + if IsFocused then + cxRectIntersect(FFocusRect, Rect, cxRectInflate(CaptionRect, 2, 0, 2, 0)) + else + SetRectEmpty(FFocusRect); + end; + +var + ARightPosition: Integer; +begin + with TdxNavBarLinkViewInfo(ALinkViewInfo) do + begin + if GroupViewInfo.IsViewAsIconView then + begin + PriorCalcImageRect(X + ViewInfo.GetLinksImageEdges.Left, + Y + ViewInfo.GetLinksImageEdges.Top); + + SetRectEmpty(FCaptionRect); + + CalcRect(FImageRect.Right + ViewInfo.GetLinksImageEdges.Right, + FImageRect.Bottom + ViewInfo.GetLinksImageEdges.Bottom); + end + else + begin + ARightPosition := ViewInfo.ClientWidth - X; + if GroupViewInfo.IsLinksUseSmallImages then + CalcSmallBounds(ARightPosition) + else + CalcLargeBounds(ARightPosition); + end; + CalcFocusRect; + CalcDesignRect(FRect, 10); + end; +end; + +class procedure TdxNavBarSeparatorCalculator.CalculateBounds(X, Y: Integer; var ALinkViewInfo); +const + ASeparatorHeight = 3; +begin + with TdxNavBarLinkViewInfo(ALinkViewInfo) do + begin + FRect := cxRect(X, Y, X + ViewInfo.ClientWidth - 2 * ViewInfo.GetGroupEdges.X, Y + ASeparatorHeight); + FImageRect := cxRectBounds(FRect.Left + ViewInfo.GetLinksImageEdges.Left, FRect.Top, GetImageWidth, ASeparatorHeight); + FCaptionRect := cxRect(FImageRect.Right + ViewInfo.GetLinksImageEdges.Right, FRect.Top, FRect.Right, FRect.Bottom); + end; +end; + +{ TdxNavBarPainter } + +constructor TdxNavBarPainter.Create(ANavBar: TdxCustomNavBar); +begin + inherited; + FViewInfo := CreateViewInfo; + FController := CreateController; + + FNeedRecreateViewInfo := True; + FNeedRecalculateViewInfo := True; + FNeedRedrawCanvas := True; + + FcxCanvas := TcxCanvas.Create(Canvas); +end; + +destructor TdxNavBarPainter.Destroy; +begin + FreeAndNil(FcxCanvas); + FreeAndNil(FController); + FreeAndNil(FViewInfo); + inherited; +end; + +procedure TdxNavBarPainter.Assign(Source: TPersistent); +begin + if not (Source is TdxNavBarPainter) then + inherited; +end; + +function TdxNavBarPainter.DC: HDC; +begin + Result := Canvas.Handle; +end; + +procedure TdxNavBarPainter.InvalidateViewInfo(AType: TdxNavBarChangeType); +begin + if AType = doRecreate then + begin + FNeedRecreateViewInfo := True; + FNeedRecalculateViewInfo := True; + end + else if AType = doRecalc then + FNeedRecalculateViewInfo := True; + FNeedRedrawCanvas := True; +end; + +procedure TdxNavBarPainter.Paint; +{var + I: Integer;} +begin + CheckDrawParamChanges; + NavBar.CheckCollapseState; + +{ for I := 0 to ViewInfo.GroupCount - 1 do + if (ViewInfo.Groups[I].Control <> nil) and ViewInfo.Groups[I].Control.Visible and + (ViewInfo.Groups[I].ControlRect.Bottom > ViewInfo.Groups[I].ControlRect.Top) then + with ViewInfo.Groups[I].ControlRect do + ExcludeClipRect(NavBar.Canvas.Handle, Left, Top, Right, Bottom);} + BitBlt(NavBar.Canvas.Handle, 0, 0, ViewInfo.ClientWidth, ViewInfo.ClientHeight, DC, 0, 0, SRCCOPY); + SelectClipRgn(DC, 0); +end; + +procedure TdxNavBarPainter.InvalidateScrollButtons; +begin + if ViewInfo.IsTopScrollButtonVisible then + Windows.InvalidateRect(NavBar.Handle, @ViewInfo.TopScrollButtonRect, True); + if ViewInfo.IsBottomScrollButtonVisible then + Windows.InvalidateRect(NavBar.Handle, @ViewInfo.BottomScrollButtonRect, True); +end; + +function TdxNavBarPainter.CreateViewInfo: TdxNavBarViewInfo; +begin + Result := GetViewInfoClass.Create(Self); +end; + +function TdxNavBarPainter.CreateGroupViewInfo(AViewInfo: TdxNavBarViewInfo; AGroup: TdxNavBarGroup; + ACaptionVisible, AItemsVisible: Boolean): TdxNavBarGroupViewInfo; +begin + Result := GetGroupViewInfoClass.Create(AViewInfo, AGroup, ACaptionVisible, AItemsVisible); +end; + +function TdxNavBarPainter.CreateLinkViewInfo(AViewInfo: TdxNavBarGroupViewInfo; ALink: TdxNavBarItemLink; + ACaptionVisible, AImageVisisble: Boolean): TdxNavBarLinkViewInfo; +begin + Result := GetLinkViewInfoClass.Create(AViewInfo, ALink, ACaptionVisible, AImageVisisble); +end; + +class function TdxNavBarPainter.GetViewInfoClass: TdxNavBarViewInfoClass; +begin + Result := TdxNavBarViewInfo; +end; + +class function TdxNavBarPainter.GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; +begin + Result := TdxNavBarGroupViewInfo; +end; + +class function TdxNavBarPainter.GetLinkViewInfoClass: TdxNavBarLinkViewInfoClass; +begin + Result := TdxNavBarLinkViewInfo; +end; + +function TdxNavBarPainter.CreateController: TdxNavBarController; +begin + Result := GetControllerClass.Create(NavBar); +end; + +function TdxNavBarPainter.GetControllerClass: TdxNavBarControllerClass; +begin + Result := TdxNavBarController; +end; + +function TdxNavBarPainter.CreatecxScrollBar: TcxScrollBar; +begin + Result := GetcxScrollBarClass.Create(nil); +end; + +function TdxNavBarPainter.GetcxScrollBarClass: TcxScrollBarClass; +begin + Result := TcxControlScrollBar; +end; + +function TdxNavBarPainter.GetCanvas: TCanvas; +begin + Result := NavBar.CanvasBitmap.Canvas; +end; + +function TdxNavBarPainter.GetcxCanvas: TcxCanvas; +begin + if FcxCanvas.Canvas <> Canvas then + FcxCanvas.Canvas := Canvas; + Result := FcxCanvas; +end; + +function TdxNavBarPainter._AddRef: Integer; +begin + Result := -1; +end; + +function TdxNavBarPainter._Release: Integer; +begin + Result := -1; +end; + +function TdxNavBarPainter.QueryInterface( + const IID: TGUID; out Obj): HResult; +const + E_NOINTERFACE = HResult($80004002); +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +function TdxNavBarPainter.GetMasterLookAndFeel: TcxLookAndFeel; +begin + Result := nil; +end; + +procedure TdxNavBarPainter.CheckDrawParamChanges; +begin + if NavBar.UpdateLock = 0 then + begin + if NavBar.CanvasBitmap.Width = 0 then + NavBar.CanvasBitmap.Width := NavBar.ClientWidth; + if NavBar.CanvasBitmap.Height = 0 then + NavBar.CanvasBitmap.Height := NavBar.ClientHeight; + + if FNeedRecreateViewInfo then ViewInfo.CreateInfo; + if FNeedRecalculateViewInfo then ViewInfo.CalculateBounds; + if FNeedRedrawCanvas then DrawNavBarControl; + end; + FNeedRecreateViewInfo := False; + FNeedRecalculateViewInfo := False; + FNeedRedrawCanvas := False; + NavBar.CheckFocusedAccessibleObject; +end; + +class function TdxNavBarPainter.Reregistered: Boolean; +begin + Result := False; +end; + +function TdxNavBarPainter.GetOwner: TPersistent; +begin + Result := FNavBar; +end; + +function TdxNavBarPainter.IsViewInfoValid: Boolean; +begin + Result := not FNeedRecalculateViewInfo; +end; + +procedure TdxNavBarPainter.DoDrawHint(ACanvas: TCanvas; const ARect: TRect); +begin +// do nothing +end; + +procedure TdxNavBarPainter.DrawSolidFocusRect(ARect: TRect; + AColor: TColor); + + procedure DrawFocusLine(X, Y, ALength: Integer; AHorz: Boolean; + ABrush: HBRUSH); + var + ADC: HDC; + AFillPixel: Boolean; + DX, DY, I: Integer; + R: TRect; + begin + ADC := DC; + AFillPixel := Odd(X + Y); + + R := Bounds(X, Y, 1, 1); + DX := IfThen(AHorz, 1, 0); + DY := IfThen(AHorz, 0, 1); + + for I := 1 to ALength do + begin + if AFillPixel then + FillRect(ADC, R, ABrush); + AFillPixel := not AFillPixel; + OffsetRect(R, DX, DY); + end; + end; + +var + ABrush: HBRUSH; +begin + if not IsRectEmpty(ARect) then + begin + ABrush := CreateSolidBrush(ColorToRGB(AColor)); + try + InflateRect(ARect, -1, -1); + DrawFocusLine(ARect.Left, ARect.Top, cxRectWidth(ARect), True, ABrush); + DrawFocusLine(ARect.Left, ARect.Top, cxRectHeight(ARect), False, ABrush); + DrawFocusLine(ARect.Right-1, ARect.Top, cxRectHeight(ARect), False, ABrush); + DrawFocusLine(ARect.Left, ARect.Bottom-1, cxRectWidth(ARect), True, ABrush); + finally + DeleteObject(ABrush); + end; + end; +end; + +procedure TdxNavBarPainter.DrawNavBarControl; +var + I: Integer; + AHandled: Boolean; +begin + AHandled := False; + if Assigned(NavBar.OnCustomDrawBackground) then + NavBar.OnCustomDrawBackground(NavBar, Canvas, ViewInfo, AHandled); + if not AHandled then DrawBackground; + for I := 0 to ViewInfo.GroupCount - 1 do + if RectVisible(Canvas.Handle, ViewInfo.Groups[I].Rect) then + DrawGroup(ViewInfo.Groups[I]); + DrawScrollButtons; + DrawDropTargetGroupSelection; + DrawDropTargetLinkSelection; +end; + +procedure TdxNavBarPainter.DrawBackground; +begin +// do nothing +end; + +procedure TdxNavBarPainter.DrawDropTargetLinkSelection; +begin +// do nothing +end; + +procedure TdxNavBarPainter.DrawHintWindow(AHintWindow: TdxNavBarHintWindow); +begin + if NavBar.HotTrackedGroup <> nil then + DrawGroupHintWindow(AHintWindow.Canvas, AHintWindow.ClientRect) + else + if NavBar.HotTrackedLink <> nil then + DrawLinkHintWindow(AHintWindow.Canvas, AHintWindow.ClientRect) + else + DoDrawHint(AHintWindow.Canvas, AHintWindow.ClientRect); +end; + +procedure TdxNavBarPainter.DrawGroupHintWindow(ACanvas: TCanvas; const ARect: TRect); +var + AHandled: Boolean; +begin + AHandled := False; + if Assigned(NavBar.OnCustomDrawGroupHint) then + NavBar.OnCustomDrawGroupHint(NavBar, ACanvas, NavBar.HotTrackedGroup, + ViewInfo.HintText, ARect, AHandled); + if not AHandled then + DoDrawHint(ACanvas, ARect); +end; + +procedure TdxNavBarPainter.DrawLinkHintWindow(ACanvas: TCanvas; const ARect: TRect); +var + AHandled: Boolean; +begin + AHandled := False; + if Assigned(NavBar.OnCustomDrawLinkHint) then + NavBar.OnCustomDrawLinkHint(NavBar, ACanvas, NavBar.HotTrackedLink, + ViewInfo.HintText, ARect, AHandled); + if not AHandled then + DoDrawHint(ACanvas, ARect); +end; + +procedure TdxNavBarPainter.DrawGroup(AGroupViewInfo: TdxNavBarGroupViewInfo); +var + AHandled: Boolean; +begin + DrawItemsRect(AGroupViewInfo); + if AGroupViewInfo.IsCaptionVisible then + begin + AHandled := False; + if Assigned(NavBar.OnCustomDrawGroupCaption) then + NavBar.OnCustomDrawGroupCaption(NavBar, Canvas, AGroupViewInfo, AHandled); + if not AHandled then + DrawGroupCaption(AGroupViewInfo); + DrawGroupFocusRect(AGroupViewInfo); + DrawGroupDesignRect(AGroupViewInfo); + end; +end; + +procedure TdxNavBarPainter.DrawGroupBackground(AGroupViewInfo: TdxNavBarGroupViewInfo); +begin +// do nothing +end; + +procedure TdxNavBarPainter.DrawGroupBorder(AGroupViewInfo: TdxNavBarGroupViewInfo); +begin +// do nothing +end; + +procedure TdxNavBarPainter.DrawGroupCaption(AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + DrawGroupCaptionButton(AGroupViewInfo); + DrawGroupCaptionText(AGroupViewInfo); + if AGroupViewInfo.IsCaptionImageVisible then + DrawGroupCaptionImage(AGroupViewInfo); + if AGroupViewInfo.IsCaptionSignVisible then + DrawGroupCaptionSign(AGroupViewInfo); +end; + +procedure TdxNavBarPainter.DrawGroupCaptionButton(AGroupViewInfo: TdxNavBarGroupViewInfo); +begin +// do nothing +end; + +procedure TdxNavBarPainter.DrawGroupCaptionText(AGroupViewInfo: TdxNavBarGroupViewInfo); +var + R: TRect; +begin + with AGroupViewInfo do + begin + Canvas.Brush.Style := bsClear; + Canvas.Font := CaptionFont; + Canvas.Font.Color := CaptionFontColor; + R := CaptionTextRect; + cxDrawText(DC, Group.Caption, R, GetDrawEdgeFlag); + end; +end; + +procedure TdxNavBarPainter.DrawGroupCaptionImage(AGroupViewInfo: TdxNavBarGroupViewInfo); +begin +// do nothing +end; + +procedure TdxNavBarPainter.DrawGroupCaptionSign(AGroupViewInfo: TdxNavBarGroupViewInfo); +begin +// do nothing +end; + +procedure TdxNavBarPainter.DrawGroupControl(ACanvas: TCanvas; ARect: TRect; AGroupViewInfo: TdxNavBarGroupViewInfo); +begin +// do nothing +end; + +procedure TdxNavBarPainter.DrawGroupDesignRect(AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + cxDrawDesignRect(cxCanvas, AGroupViewInfo.DesignRect, NavBar.DesignerIsSelected(AGroupViewInfo.Group)); +end; + +procedure TdxNavBarPainter.DrawGroupItems(AGroupViewInfo: TdxNavBarGroupViewInfo); +var + I: Integer; + ALinkViewInfo: TdxNavBarLinkViewInfo; +begin + cxCanvas.SaveClipRegion; + try + cxCanvas.SetClipRegion(TcxRegion.Create(AGroupViewInfo.ItemsRect), roSet); + for I := 0 to AGroupViewInfo.ItemCount - 1 do + begin + ALinkViewInfo := AGroupViewInfo.Items[I]; + if (ALinkViewInfo.Rect.Top >= AGroupViewInfo.ItemsRect.Top) and + (ALinkViewInfo.Rect.Top <= AGroupViewInfo.ItemsRect.Bottom) then + begin + ALinkViewInfo.Item.Draw(Self, ALinkViewInfo); + end; + end; + finally + cxCanvas.RestoreClipRegion; + end; +end; + +procedure TdxNavBarPainter.DrawGroupFocusRect(AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + with AGroupViewInfo do + DrawSolidFocusRect(FocusRect, CaptionFontColor); +end; + +procedure TdxNavBarPainter.DrawItem(ALinkViewInfo: TdxNavBarLinkViewInfo); +var + AHandled: Boolean; +begin + AHandled := False; + if Assigned(NavBar.OnCustomDrawLink) then + NavBar.OnCustomDrawLink(NavBar, Canvas, ALinkViewInfo, AHandled); + if not AHandled then + begin + DrawItemSelection(ALinkViewInfo); + if (ALinkViewInfo.ImageList <> nil) and (0 <= ALinkViewInfo.ImageIndex) and + (ALinkViewInfo.ImageIndex < ALinkViewInfo.ImageList.Count) then + begin + if ALinkViewInfo.IsImageVisible then + DrawItemImage(ALinkViewInfo); + end; + DrawItemCaption(ALinkViewInfo); + end; + DrawItemFocusRect(ALinkViewInfo); + DrawItemDesignRect(ALinkViewInfo); +end; + +procedure TdxNavBarPainter.DrawItemCaption(ALinkViewInfo: TdxNavBarLinkViewInfo); +var + R: TRect; +begin + with ALinkViewInfo do + begin + R := CaptionRect; +{ + if R.Left < Rect.Left then + R.Left := Rect.Left; + if R.Right > Rect.Right then + R.Right := Rect.Right; +} + Canvas.Brush.Style := bsClear; + Canvas.Font := Font; + Canvas.Font.Color := FontColor; + cxDrawText(DC, Item.Caption, R, GetDrawEdgeFlag or DT_END_ELLIPSIS); + end; +end; + +procedure TdxNavBarPainter.DrawItemDesignRect(ALinkViewInfo: TdxNavBarLinkViewInfo); +begin + cxDrawDesignRect(cxCanvas, ALinkViewInfo.DesignRect, NavBar.DesignerIsSelected(ALinkViewInfo.Item)); +end; + +procedure TdxNavBarPainter.DrawItemFocusRect(ALinkViewInfo: TdxNavBarLinkViewInfo); +begin + with ALinkViewInfo do + DrawSolidFocusRect(FocusRect, FontColor); +end; + +procedure TdxNavBarPainter.DrawItemImage(ALinkViewInfo: TdxNavBarLinkViewInfo); +begin +// do nothing +end; + +procedure TdxNavBarPainter.DrawItemSelection(ALinkViewInfo: TdxNavBarLinkViewInfo); +begin +// do nothing +end; + +procedure TdxNavBarPainter.DrawItemsRect(AGroupViewInfo: TdxNavBarGroupViewInfo); +var + AHandled: Boolean; +begin + AHandled := False; + if Assigned(NavBar.OnCustomDrawGroupClientBackground) then + NavBar.OnCustomDrawGroupClientBackground(NavBar, Canvas, AGroupViewInfo, AHandled); + if not AHandled then + begin + DrawGroupBackground(AGroupViewInfo); + if not cxRectIsNull(ViewInfo.GetGroupBorderOffsets) then + DrawGroupBorder(AGroupViewInfo); + end; + if AGroupViewInfo.Control = nil then + begin + AHandled := False; + if Assigned(NavBar.OnCustomDrawGroupClientForeground) then + NavBar.OnCustomDrawGroupClientForeground(NavBar, Canvas, AGroupViewInfo, AHandled); + if not AHandled then + DrawGroupItems(AGroupViewInfo); + end; +end; + +procedure TdxNavBarPainter.DrawSeparator(ALinkViewInfo: TdxNavBarLinkViewInfo); +var + ARect: TRect; +begin + Canvas.Brush.Color := ALinkViewInfo.FontColor; + ARect := ALinkViewInfo.Rect; + Inc(ARect.Left, 7); + Canvas.FillRect(cxRectCenter(ARect, cxRectWidth(ARect), 1)); +end; + +procedure TdxNavBarPainter.DrawScrollButtons; +var + AHandled: Boolean; +begin + if ViewInfo.IsTopScrollButtonVisible then + begin + AHandled := False; + if Assigned(NavBar.OnCustomDrawTopScrollButton) then + NavBar.OnCustomDrawTopScrollButton(NavBar, Canvas, ViewInfo, AHandled); + if not AHandled then DrawTopScrollButton; + end; + if ViewInfo.IsBottomScrollButtonVisible then + begin + AHandled := False; + if Assigned(NavBar.OnCustomDrawBottomScrollButton) then + NavBar.OnCustomDrawBottomScrollButton(NavBar, Canvas, ViewInfo, AHandled); + if not AHandled then DrawBottomScrollButton; + end; +end; + +procedure TdxNavBarPainter.DrawBottomScrollButton; +begin +// do nothing +end; + +procedure TdxNavBarPainter.DrawTopScrollButton; +begin +// do nothing +end; + +procedure TdxNavBarPainter.DrawDropTargetGroupSelection; +begin +// do nothing +end; + +{ TdxNavBarCursors } + +constructor TdxNavBarCursors.Create(ANavBar: TdxCustomNavBar); +begin + inherited; + Cursor := crDefault; + DragCursor := dxNavBarDragCursor; + FDragCopyCursor := dxNavBarDragCopyCursor; + FHotTrackedGroupCursor := crDefault; + FHotTrackedLinkCursor := dxNavBarLinksCursor; +end; + +procedure TdxNavBarCursors.Assign(Source: TPersistent); +var + ASourceCursors: TdxNavBarCursors; +begin + if Source is TdxNavBarCursors then + begin + ASourceCursors := TdxNavBarCursors(Source); + Cursor := ASourceCursors.Cursor; + DragCopyCursor := ASourceCursors.DragCopyCursor; + DragCursor := ASourceCursors.DragCursor; + HotTrackedGroupCursor := ASourceCursors.HotTrackedGroupCursor; + HotTrackedLinkCursor := ASourceCursors.HotTrackedLinkCursor; + end + else + inherited; +end; + +function TdxNavBarCursors.GetCursor: TCursor; +begin + Result := NavBar.Cursor; +end; + +function TdxNavBarCursors.GetDragCursor: TCursor; +begin + Result := NavBar.DragCursor; +end; + +procedure TdxNavBarCursors.SetCursor(Value: TCursor); +begin + NavBar.Cursor := Value; +end; + +procedure TdxNavBarCursors.SetDragCursor(Value: TCursor); +begin + NavBar.DragCursor := Value; +end; + +{ TdxNavBarCustomDrawEvents } + +procedure TdxNavBarCustomDrawEvents.Assign(Source: TPersistent); +var + ASourceEvents: TdxNavBarCustomDrawEvents; +begin + if Source is TdxNavBarCustomDrawEvents then + begin + ASourceEvents := TdxNavBarCustomDrawEvents(Source); + Background := ASourceEvents.Background; + GroupCaption := ASourceEvents.GroupCaption; + GroupClientBackground := ASourceEvents.GroupClientBackground; + GroupClientForeground := ASourceEvents.GroupClientForeground; + GroupHint := ASourceEvents.GroupHint; + Link := ASourceEvents.Link; + LinkHint := ASourceEvents.LinkHint; + BottomScrollButton := ASourceEvents.BottomScrollButton; + TopScrollButton := ASourceEvents.TopScrollButton; + NavigationPaneHeader := ASourceEvents.NavigationPaneHeader; + NavigationPaneSplitter := ASourceEvents.NavigationPaneSplitter; + NavigationPaneOverflowPanel := ASourceEvents.NavigationPaneOverflowPanel; + NavigationPaneOverflowPanelHint := ASourceEvents.NavigationPaneOverflowPanelHint; + end + else + inherited; +end; + +constructor TdxNavBarCommonViewOptions.Create(ANavBar: TdxCustomNavBar); +begin + inherited; + FShowGroupCaptions := True; +end; + +procedure TdxNavBarCommonViewOptions.Assign(Source: TPersistent); +var + ASourceOptions: TdxNavBarCommonViewOptions; +begin + if Source is TdxNavBarCommonViewOptions then + begin + ASourceOptions := TdxNavBarCommonViewOptions(Source); + ShowGroupCaptions := ASourceOptions.ShowGroupCaptions; + end + else + inherited; +end; + +procedure TdxNavBarCommonViewOptions.SetShowGroupCaptions(AValue: Boolean); +begin + if ShowGroupCaptions <> AValue then + begin + FShowGroupCaptions := AValue; + NavBar.InvalidateAll(doRecreate); + end; +end; + +{ TdxNavBarExplorerBarViewOptions } + +procedure TdxNavBarExplorerBarViewOptions.Assign(Source: TPersistent); +var + ASourceOptions: TdxNavBarExplorerBarViewOptions; +begin + if Source is TdxNavBarExplorerBarViewOptions then + begin + ASourceOptions := TdxNavBarExplorerBarViewOptions(Source); + ShowSpecialGroup := ASourceOptions.ShowSpecialGroup; + SpaceBetweenGroups := ASourceOptions.SpaceBetweenGroups; + end + else + inherited; +end; + +procedure TdxNavBarExplorerBarViewOptions.SetShowSpecialGroup(Value: Boolean); +begin + if ShowSpecialGroup <> Value then + begin + FShowSpecialGroup := Value; + NavBar.InvalidateAll(doRecreate); + end; +end; + +procedure TdxNavBarExplorerBarViewOptions.SetSpaceBetweenGroups(Value: Integer); +begin + Value := Max(Value, 0); + if SpaceBetweenGroups <> Value then + begin + FSpaceBetweenGroups := Value; + NavBar.InvalidateAll(doRecalc); + end; +end; + +{ TdxNavBarNavigationPaneViewOptions } + +constructor TdxNavBarNavigationPaneViewOptions.Create(ANavBar: TdxCustomNavBar); +begin + inherited; + FMaxVisibleGroups := -1; + FOverflowPanelUseSmallImages := True; + FShowHeader := True; + FShowOverflowPanel := True; +end; + +procedure TdxNavBarNavigationPaneViewOptions.Assign(Source: TPersistent); +var + ASourceOptions: TdxNavBarNavigationPaneViewOptions; +begin + if Source is TdxNavBarNavigationPaneViewOptions then + begin + ASourceOptions := TdxNavBarNavigationPaneViewOptions(Source); + MaxVisibleGroups := ASourceOptions.MaxVisibleGroups; + OverflowPanelUseSmallImages := ASourceOptions.OverflowPanelUseSmallImages; + ShowHeader := ASourceOptions.ShowHeader; + ShowOverflowPanel := ASourceOptions.ShowOverflowPanel; + end + else + inherited; +end; + +procedure TdxNavBarNavigationPaneViewOptions.SetMaxVisibleGroups(Value: Integer); +begin + Value := Max(Value, -1); + if MaxVisibleGroups <> Value then + begin + FMaxVisibleGroups := Value; + NavBar.InvalidateAll(doRecreate); + end; +end; + +procedure TdxNavBarNavigationPaneViewOptions.SetOverflowPanelUseSmallImages(Value: Boolean); +begin + if OverflowPanelUseSmallImages <> Value then + begin + FOverflowPanelUseSmallImages := Value; + NavBar.InvalidateAll(doRecreate); + end; +end; + +procedure TdxNavBarNavigationPaneViewOptions.SetShowHeader(Value: Boolean); +begin + if ShowHeader <> Value then + begin + FShowHeader := Value; + NavBar.InvalidateAll(doRecreate); + end; +end; + +procedure TdxNavBarNavigationPaneViewOptions.SetShowOverflowPanel(Value: Boolean); +begin + if ShowOverflowPanel <> Value then + begin + FShowOverflowPanel := Value; + NavBar.InvalidateAll(doRecreate); + end; +end; + +{ TdxNavBarViewOptions } + +constructor TdxNavBarViewOptions.Create(ANavBar: TdxCustomNavBar); +begin + inherited; + FCommon := TdxNavBarCommonViewOptions.Create(ANavBar); + FExplorerBar := TdxNavBarExplorerBarViewOptions.Create(ANavBar); + FNavigationPane := TdxNavBarNavigationPaneViewOptions.Create(ANavBar); +end; + +destructor TdxNavBarViewOptions.Destroy; +begin + FreeAndNil(FNavigationPane); + FreeAndNil(FExplorerBar); + FreeAndNil(FCommon); + inherited; +end; + +procedure TdxNavBarViewOptions.Assign(Source: TPersistent); +var + ASourceOptions: TdxNavBarViewOptions; +begin + if Source is TdxNavBarViewOptions then + begin + ASourceOptions := TdxNavBarViewOptions(Source); + FCommon.Assign(ASourceOptions.Common); + FExplorerBar.Assign(ASourceOptions.ExplorerBar); + FNavigationPane.Assign(ASourceOptions.NavigationPane); + end + else + inherited; +end; + +procedure TdxNavBarViewOptions.SetCommon(AValue: TdxNavBarCommonViewOptions); +begin + if FCommon <> AValue then + FCommon.Assign(AValue); +end; + +procedure TdxNavBarViewOptions.SetExplorerBar(AValue: TdxNavBarExplorerBarViewOptions); +begin + if FExplorerBar <> AValue then + FExplorerBar.Assign(AValue) +end; + +procedure TdxNavBarViewOptions.SetNavigationPane(AValue: TdxNavBarNavigationPaneViewOptions); +begin + if FNavigationPane <> AValue then + FNavigationPane.Assign(AValue); +end; + +{ TdxNavBarOptions } + +constructor TdxNavBarCommonBehaviorOptions.Create(ANavBar: TdxCustomNavBar); +begin + inherited; + FDragDropFlags := dxNavBarDefaultDragDropFlags; +end; + +procedure TdxNavBarCommonBehaviorOptions.Assign(Source: TPersistent); +var + ASourceOptions: TdxNavBarCommonBehaviorOptions; +begin + if Source is TdxNavBarCommonBehaviorOptions then + begin + ASourceOptions := TdxNavBarCommonBehaviorOptions(Source); + DragDropFlags := ASourceOptions.DragDropFlags; + ShowGroupsHint := ASourceOptions.ShowGroupsHint; + ShowLinksHint := ASourceOptions.ShowLinksHint; + end + else + inherited; +end; + +constructor TdxNavBarNavigationPaneBehaviorOptions.Create(ANavBar: TdxCustomNavBar); +begin + inherited; + FAllowCustomizing := True; + FShowOverflowPanelHints := True; +end; + +procedure TdxNavBarNavigationPaneBehaviorOptions.Assign(Source: TPersistent); +var + ASourceOptions: TdxNavBarNavigationPaneBehaviorOptions; +begin + if Source is TdxNavBarNavigationPaneBehaviorOptions then + begin + ASourceOptions := TdxNavBarNavigationPaneBehaviorOptions(Source); + AdjustWidthByPopup := ASourceOptions.AdjustWidthByPopup; + AllowCustomizing := ASourceOptions.AllowCustomizing; + Collapsed := ASourceOptions.Collapsed; + Collapsible := ASourceOptions.Collapsible; + ShowOverflowPanelHints := ASourceOptions.ShowOverflowPanelHints; + end + else + inherited; +end; + +procedure TdxNavBarNavigationPaneBehaviorOptions.SetCollapsible(Value: Boolean); +begin + if Collapsible <> Value then + begin + FCollapsible := Value; + Collapsed := FCollapsible and (NavBar.Width < NavBar.ViewInfo.GetNavBarMinExpandedWidth); + if NavBar.Width = 0 then + NavBar.CheckCollapseState; // because no WM_PAINT if width = 0 + NavBar.InvalidateAll(doRecalc); + end; +end; + +procedure TdxNavBarNavigationPaneBehaviorOptions.SetCollapsed(Value: Boolean); +begin + if (Collapsed <> Value) and (not Value or Collapsible) then + begin + FCollapsed := Value; + if FCollapsed and not (csLoading in NavBar.ComponentState) then + NavBar.OriginalWidth := Max(NavBar.Width, NavBar.ViewInfo.GetNavBarMinExpandedWidth); + NavBar.InvalidateAll(doRecreate); + end; +end; + +{ TdxNavBarSideBarBehaviorOptions } + +procedure TdxNavBarSideBarBehaviorOptions.Assign(Source: TPersistent); +var + ASourceOptions: TdxNavBarSideBarBehaviorOptions; +begin + if Source is TdxNavBarSideBarBehaviorOptions then + begin + ASourceOptions := TdxNavBarSideBarBehaviorOptions(Source); + AllowSelectLinks := ASourceOptions.AllowSelectLinks; + EachGroupHasSelectedLink := ASourceOptions.EachGroupHasSelectedLink; + end + else + inherited; +end; + +procedure TdxNavBarSideBarBehaviorOptions.SetAllowSelectLinks(Value: Boolean); +begin + if AllowSelectLinks <> Value then + begin + FAllowSelectLinks := Value; + if not FAllowSelectLinks then + NavBar.DeSelectLinks; + NavBar.InvalidateAll(doRedraw); + end; +end; + +procedure TdxNavBarSideBarBehaviorOptions.SetEachGroupHasSelectedLink(Value: Boolean); +begin + if EachGroupHasSelectedLink <> Value then + begin + FEachGroupHasSelectedLink := Value; + if not FEachGroupHasSelectedLink then + NavBar.DeSelectLinks; + NavBar.InvalidateAll(doRedraw); + end; +end; + +constructor TdxNavBarBehaviorOptions.Create(ANavBar: TdxCustomNavBar); +begin + inherited; + FCommon := TdxNavBarCommonBehaviorOptions.Create(ANavBar); + FNavigationPane := TdxNavBarNavigationPaneBehaviorOptions.Create(ANavBar); + FSideBar := TdxNavBarSideBarBehaviorOptions.Create(ANavBar); +end; + +destructor TdxNavBarBehaviorOptions.Destroy; +begin + FreeAndNil(FSideBar); + FreeAndNil(FNavigationPane); + FreeAndNil(FCommon); + inherited; +end; + +procedure TdxNavBarBehaviorOptions.Assign(Source: TPersistent); +var + ASourceOptions: TdxNavBarBehaviorOptions; +begin + if Source is TdxNavBarBehaviorOptions then + begin + ASourceOptions := TdxNavBarBehaviorOptions(Source); + FCommon.Assign(ASourceOptions.Common); + FNavigationPane.Assign(ASourceOptions.NavigationPane); + FSideBar.Assign(ASourceOptions.SideBar); + end + else + inherited; +end; + +procedure TdxNavBarBehaviorOptions.SetCommon(AValue: TdxNavBarCommonBehaviorOptions); +begin + if FCommon <> AValue then + FCommon.Assign(AValue); +end; + +procedure TdxNavBarBehaviorOptions.SetNavigationPane(AValue: TdxNavBarNavigationPaneBehaviorOptions); +begin + if FNavigationPane <> AValue then + FNavigationPane.Assign(AValue); +end; + +procedure TdxNavBarBehaviorOptions.SetSideBar(AValue: TdxNavBarSideBarBehaviorOptions); +begin + if FSideBar <> AValue then + FSideBar.Assign(AValue); +end; + +{ TdxNavBarImageOptions } + +constructor TdxNavBarImageOptions.Create(AOwner: TPersistent); +begin + inherited; + FDisabledLargeChangeLink := TChangeLink.Create; + FDisabledSmallChangeLink := TChangeLink.Create; + FHotLargeChangeLink := TChangeLink.Create; + FHotSmallChangeLink := TChangeLink.Create; + FLargeChangeLink := TChangeLink.Create; + FSmallChangeLink := TChangeLink.Create; +end; + +destructor TdxNavBarImageOptions.Destroy; +begin + FreeAndNil(FDisabledLargeChangeLink); + FreeAndNil(FDisabledSmallChangeLink); + FreeAndNil(FHotLargeChangeLink); + FreeAndNil(FHotSmallChangeLink); + FreeAndNil(FSmallChangeLink); + FreeAndNil(FLargeChangeLink); + inherited; +end; + +procedure TdxNavBarImageOptions.Assign(Source: TPersistent); +var + ASourceOptions: TdxNavBarImageOptions; +begin + if Source is TdxNavBarImageOptions then + begin + ASourceOptions := TdxNavBarImageOptions(Source); + SmallImages := ASourceOptions.SmallImages; + LargeImages := ASourceOptions.LargeImages; + HotSmallImages := ASourceOptions.HotSmallImages; + HotLargeImages := ASourceOptions.HotLargeImages; + DisabledSmallImages := ASourceOptions.DisabledSmallImages; + DisabledLargeImages := ASourceOptions.DisabledLargeImages; + end + else + inherited; +end; + +procedure TdxNavBarImageOptions.FreeNotification(AComponent: TComponent); +begin + if AComponent = DisabledSmallImages then + DisabledSmallImages := nil; + if AComponent = DisabledLargeImages then + DisabledLargeImages := nil; + if AComponent = HotSmallImages then + HotSmallImages := nil; + if AComponent = HotLargeImages then + HotLargeImages := nil; + if AComponent = SmallImages then + SmallImages := nil; + if AComponent = LargeImages then + LargeImages := nil; +end; + +procedure TdxNavBarImageOptions.SetImageList(var ANewValue, AOldValue: TCustomImageList; const AChangeLink: TChangeLink); +begin + cxSetImageList(ANewValue, AOldValue, AChangeLink, FNotifyComponent); +end; + +procedure TdxNavBarImageOptions.SetDisabledLargeImages(Value: TCustomImageList); +begin + SetImageList(Value, FDisabledLargeImages, FDisabledLargeChangeLink); +end; + +procedure TdxNavBarImageOptions.SetDisabledSmallImages(Value: TCustomImageList); +begin + SetImageList(Value, FDisabledSmallImages, FDisabledSmallChangeLink); +end; + +procedure TdxNavBarImageOptions.SetHotLargeImages(Value: TCustomImageList); +begin + SetImageList(Value, FHotLargeImages, FHotLargeChangeLink); +end; + +procedure TdxNavBarImageOptions.SetHotSmallImages(Value: TCustomImageList); +begin + SetImageList(Value, FHotSmallImages, FHotSmallChangeLink); +end; + +procedure TdxNavBarImageOptions.SetLargeImages(Value: TCustomImageList); +begin + SetImageList(Value, FLargeImages, FLargeChangeLink); +end; + +procedure TdxNavBarImageOptions.SetSmallImages(Value: TCustomImageList); +begin + SetImageList(Value, FSmallImages, FSmallChangeLink); +end; + +{ TdxNavBarController } + +constructor TdxNavBarController.Create(ANavBar: TdxCustomNavBar); +begin + inherited Create; + FNavBar := ANavBar; + FHotPart := dxNavBarPart(nbNone); + FPressedPart := dxNavBarPart(nbNone); +end; + +destructor TdxNavBarController.Destroy; +begin + cxClearObjectLinks(Self); + inherited; +end; + +procedure TdxNavBarController.CheckBounds(var ALeft, ATop, AWidth, AHeight: Integer); +begin + DoCheckBounds(ALeft, ATop, AWidth, AHeight); +end; + +procedure TdxNavBarController.InvalidateAll(AType: TdxNavBarChangeType); +begin + FNavBar.InvalidateAll(AType); +end; + +procedure TdxNavBarController.MouseDown(AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); +begin + DoMouseDown(AButton, AShift, APoint); +end; + +procedure TdxNavBarController.MouseUp(AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); +begin + DoMouseUp(AButton, AShift, APoint); +end; + +procedure TdxNavBarController.MouseMove(AShift: TShiftState; const APoint: TPoint); +begin + DoMouseMove(AShift, APoint); +end; + +procedure TdxNavBarController.MouseLeave; +begin + DoMouseLeave; +end; + +procedure TdxNavBarController.ShowHint(var AHintInfo: THintInfo; out ACanShow: Boolean); +begin + ACanShow := not NavBar.EnableDragging; + if ACanShow then + begin + if AHintInfo.HintWindowClass = THintWindow then + AHintInfo.HintWindowClass := TdxNavBarHintWindow; + AHintInfo.HintData := @AHintInfo; + ViewInfo.HintText := ''; + DoShowHint(AHintInfo); + AHintInfo.HintStr := ViewInfo.HintText; + ACanShow := AHintInfo.HintStr <> ''; + end; +end; + +function TdxNavBarController.CanFocusOnClick(const APoint: TPoint): Boolean; +begin + Result := not (NavBar.IsPtTopScrollButton(APoint) or NavBar.IsPtBottomScrollButton(APoint)); +end; + +function TdxNavBarController.GetCursor: HIcon; +begin + Result := 0; +end; + +function TdxNavBarController.GetItemHintRect(ANavBarItem: TObject; + ACalcHintProc: TdxNavBarCalcHintEvent): TRect; +const + AFlagsMap: array [Boolean] of DWORD = (0, DT_WORDBREAK); +begin + Result := Rect(0, 0, Max(ViewInfo.ClientWidth, NavBar.OriginalWidth), 0); + cxScreenCanvas.Font := ViewInfo.HintFont; + cxDrawText(cxScreenCanvas.Handle, ViewInfo.HintText, Result, DT_CALCRECT or DT_LEFT or + DT_NOPREFIX or AFlagsMap[ANavBarItem <> nil]); + Inc(Result.Right, dxNavBarHintWindowSizeCorrection); + Inc(Result.Bottom, dxNavBarHintWindowSizeCorrection); + if Assigned(ACalcHintProc) then + ACalcHintProc(ANavBarItem, Result); + OffsetRect(Result, 20, 0); +end; + +function TdxNavBarController.GetPartAtPos(const APoint: TPoint): TdxNavBarPart; +begin + Result := dxNavBarPart(nbNone); +end; + +procedure TdxNavBarController.DoClick(const APart: TdxNavBarPart); +begin +// do nothing +end; + +procedure TdxNavBarController.DoCheckBounds(var ALeft, ATop, AWidth, AHeight: Integer); +begin +// do nothing +end; + +procedure TdxNavBarController.DoLinkClick(ANavBar: TdxCustomNavBar; ALink: TdxNavBarItemLink); +var + AItem: TdxNavBarItem; +begin + AItem := ALink.Item; + ALink.Selected := ANavBar.AllowSelectLinks; + if Assigned(AItem.OnClick) then + AItem.OnClick(AItem) + else + if AItem.Action <> nil then + AItem.ActionLink.Execute{$IFDEF DELPHI6}(AItem){$ENDIF} + else + if Assigned(ANavBar.OnLinkClick) then + ANavBar.OnLinkClick(ANavBar, ALink); +end; + +procedure TdxNavBarController.DoMouseDown(AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); +var + AGroup: TdxNavBarGroup; + ALink: TdxNavBarItemLink; +begin + with FNavBar do + if ssLeft in AShift then + begin + if IsPtTopScrollButton(APoint) then + DoTopScrollButtonDown + else + if IsPtBottomScrollButton(APoint) then + DoBottomScrollButtonDown + else + begin + AGroup := GetGroupAtCaptionPos(APoint); + if AGroup <> nil then + DoGroupMouseDown(AGroup) + else + begin + if IsDesigning then + ALink := GetLinkAtPos(APoint) + else + ALink := GetLinkAtSelectedPos(APoint); + if ALink <> nil then + DoLinkMouseDown(ALink); + end; + end; + end + else + if (FHotTrackedGroup <> nil) or (FHotTrackedLink <> nil) then + begin + FHotTrackedGroup := nil; + FHotTrackedLink := nil; + InvalidateAll(doRedraw); + end; +end; + +procedure TdxNavBarController.DoMouseUp(AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); + + procedure InternalDoMouseUp; + begin + with FNavBar do + if IsPtTopScrollButton(FSourcePoint) or ScrollButtonUpIsDown then + DoTopScrollButtonUp + else + if IsPtBottomScrollButton(FSourcePoint) or ScrollButtonDownIsDown then + DoBottomScrollButtonUp + else + begin + FScrollButtonDownIsDown := False; + FScrollButtonUpIsDown := False; + if (FSourceGroup <> nil) then + DoGroupMouseUp(FSourceGroup); + if FSourceLink <> nil then + DoLinkMouseUp(FSourceLink); + end; + end; + +var + APart: TdxNavBarPart; +begin + APart := GetPartAtPos(APoint); + SetHotPart(APart); + + if IsdxNavBarPartsEqual(APart, FPressedPart) then + begin + SetPressedPart(dxNavBarPart(nbNone)); + DoClick(APart); + end + else + SetPressedPart(dxNavBarPart(nbNone)); + + if IsdxNavBarPartsEqual(APart, dxNavBarPart(nbNone)) then + InternalDoMouseUp; +end; + +procedure TdxNavBarController.DoMouseMove(AShift: TShiftState; const APoint: TPoint); +var + ALink: TdxNavBarItemLink; + AGroup: TdxNavBarGroup; +begin + with FNavBar do + if FSourceShift * AShift = [] then + begin + ALink := GetLinkAtSelectedPos(FTargetPoint); + if ALink <> FHotTrackedLink then + DoLinkHotTrack(ALink); + AGroup := GetGroupAtCaptionPos(FTargetPoint); + if AGroup <> FHotTrackedGroup then + DoGroupHotTrack(AGroup); + end; +end; + +procedure TdxNavBarController.DoMouseLeave; +begin +// do nothing +end; + +procedure TdxNavBarController.DoSetHotPart(const APart: TdxNavBarPart); +begin +// do nothing +end; + +procedure TdxNavBarController.DoSetPressedPart(const APart: TdxNavBarPart); +begin +// do nothing +end; + +procedure TdxNavBarController.DoShowHint(var AHintInfo: THintInfo); +var + AGroupViewInfo: TdxNavBarGroupViewInfo; + ALinkViewInfo: TdxNavBarLinkViewInfo; +begin + AGroupViewInfo := ViewInfo.GetGroupViewInfoAtCaptionPos(AHintInfo.CursorPos); + if AGroupViewInfo <> nil then + begin + if NavBar.ShowGroupsHint then + DoShowGroupHint(AHintInfo, AGroupViewInfo); + end + else + begin + ALinkViewInfo := ViewInfo.GetLinkViewInfoAtSelectedPos(AHintInfo.CursorPos); + if ALinkViewInfo <> nil then + begin + if NavBar.ShowLinksHint then + DoShowLinkHint(AHintInfo, ALinkViewInfo); + end + end; +end; + +procedure TdxNavBarController.DoShowGroupHint(var AHintInfo: THintInfo; AGroupViewInfo: TdxNavBarGroupViewInfo); +var + AGroup: TdxNavBarGroup; +begin + AGroup := AGroupViewInfo.Group; + ViewInfo.HintText := GetGroupHintText(AGroup); + ViewInfo.HintRect := GetGroupHintRect(AGroup); + AHintInfo.CursorRect := AGroupViewInfo.CaptionRect; +end; + +procedure TdxNavBarController.DoShowLinkHint(var AHintInfo: THintInfo; ALinkViewInfo: TdxNavBarLinkViewInfo); +var + ALink: TdxNavBarItemLink; +begin + ALink := ViewInfo.GetLinkAtSelectedPos(AHintInfo.CursorPos); + ViewInfo.HintText := GetLinkHintText(ALink); + ViewInfo.HintRect := GetLinkHintRect(ALink); + AHintInfo.CursorRect := ALinkViewInfo.Rect; +end; + +function TdxNavBarController.GetGroupHintRect(AGroup: TdxNavBarGroup): TRect; +begin + Result := GetItemHintRect(AGroup, CalcGroupHintRect); +end; + +function TdxNavBarController.GetLinkHintRect(ALink: TdxNavBarItemLink): TRect; +begin + Result := GetItemHintRect(ALink, CalcLinkHintRect); +end; + +function TdxNavBarController.GetGroupHintText(AGroup: TdxNavBarGroup): string; +begin + Result := AGroup.Hint; + if Assigned(NavBar.OnGetGroupHint) then + NavBar.OnGetGroupHint(NavBar, AGroup, Result); + Result := GetShortHint(Result); +end; + +function TdxNavBarController.GetLinkHintText(ALink: TdxNavBarItemLink): string; +begin + Result := ALink.Item.Hint; + if Assigned(NavBar.OnGetLinkHint) then + NavBar.OnGetLinkHint(NavBar, ALink, Result); + Result := GetShortHint(Result); +end; + +function TdxNavBarController.GetPainter: TdxNavBarPainter; +begin + Result := FNavBar.Painter; +end; + +function TdxNavBarController.GetViewInfo: TdxNavBarViewInfo; +begin + Result := FNavBar.ViewInfo; +end; + +procedure TdxNavBarController.CalcGroupHintRect(AItem: TObject; var ARect: TRect); +begin + if Assigned(NavBar.OnCalcGroupHintRect) then + NavBar.OnCalcGroupHintRect(NavBar, TdxNavBarGroup(AItem), ViewInfo, ARect); +end; + +procedure TdxNavBarController.CalcLinkHintRect(AItem: TObject; var ARect: TRect); +begin + if Assigned(NavBar.OnCalcLinkHintRect) then + NavBar.OnCalcLinkHintRect(NavBar, TdxNavBarItemLink(AItem), ViewInfo, ARect); +end; + +procedure TdxNavBarController.SetHotPart(APart: TdxNavBarPart); +begin + if not IsdxNavBarPartsEqual(FHotPart, APart) then + begin + FHotPart := APart; + DoSetHotPart(APart); + end; +end; + +procedure TdxNavBarController.SetPressedPart(APart: TdxNavBarPart); +begin + if not IsdxNavBarPartsEqual(FPressedPart, APart) then + begin + FPressedPart := APart; + DoSetPressedPart(APart); + end; +end; + +{ TdxCustomNavBar } + +constructor TdxCustomNavBar.Create(AOwner: TComponent); + + function InternalCreateTimer(AInterval: Integer; AOnTimer: TNotifyEvent): TcxTimer; + begin + Result := TcxTimer.Create(Self); + Result.Enabled := False; + Result.Interval := AInterval; + Result.OnTimer := AOnTimer; + end; + +begin + inherited Create(AOwner); + + TabStop := False; + + FCanvasBitmap := TBitmap.Create; + FScrollBar := TdxNavBarScrollBar.Create(Self, sbVertical); + FScrollBar.OnScroll := DoScroll; + Keys := [kArrows]; + + FActivateGroupTimer := InternalCreateTimer(dxNavBarActivateGroupInterval, DoActivateGroupTimer); + FScrollTimer := InternalCreateTimer(dxNavBarScrollInterval, DoScrollTimer); + + FCursors := TdxNavBarCursors.Create(Self); + FOnCustomDraw := TdxNavBarCustomDrawEvents.Create(Self); + + FOptionsStyle := TdxNavBarStyleOptions.Create(Self); + FOptionsStyle.OnChange := OnStylesChanged; + FOptionsBehavior := TdxNavBarBehaviorOptions.Create(Self); + FOptionsView := TdxNavBarViewOptions.Create(Self); + FOptionsImage := TdxNavBarImageOptions.Create(Self); + OptionsImage.FDisabledSmallChangeLink.OnChange := OnImagesChanged; + OptionsImage.FDisabledLargeChangeLink.OnChange := OnImagesChanged; + OptionsImage.FHotSmallChangeLink.OnChange := OnImagesChanged; + OptionsImage.FHotLargeChangeLink.OnChange := OnImagesChanged; + OptionsImage.FLargeChangeLink.OnChange := OnImagesChanged; + OptionsImage.FSmallChangeLink.OnChange := OnImagesChanged; + + FGroups := TdxNavBarGroups.Create(Self, GetGroupClass); + FGroups.OnChange := OnGroupsChanged; + FGroups.OnLinksChange := OnLinksChanged; + FItems := TdxNavBarItems.Create(Self, GetItemClass); + FItems.OnChange := OnItemsChanged; + + FThemeNotificator := TdxThemeChangedNotificator.Create; + FThemeNotificator.OnThemeChanged := OnThemeChanged; + +// FNavigationPaneOverflowPanelHotTrackedIndex := -1; +// FNavigationPaneOverflowPanelPressedIndex := -1; + + BevelInner := bvNone; + BevelOuter := bvNone; + ControlStyle := ControlStyle - [csAcceptsControls, csSetCaption] + [csActionClient]; + Height := 300; + Width := 150; + ShowHint := True; + + AssignDefaultStyles; + if Assigned(FOnRegisterNavBar) then + FOnRegisterNavBar(Self); +end; + +destructor TdxCustomNavBar.Destroy; +begin + if Assigned(FOnUnRegisterNavBar) then + FOnUnRegisterNavBar(Self); + NavBarAccessibleObjectOwnerObjectDestroyed(FIAccessibilityHelper); + + FreeAndNil(FActivateGroupTimer); + FreeAndNil(FScrollTimer); + + FreeAndNil(FScrollBar); + + FreeAndNil(FThemeNotificator); + + FreeAndNil(FItems); + FreeAndNil(FGroups); + + FreeAndNil(FOptionsImage); + FreeAndNil(FOptionsView); + FreeAndNil(FOptionsBehavior); + FreeAndNil(FOptionsStyle); + + FreeAndNil(FOnCustomDraw); + FreeAndNil(FCursors); + FreeAndNil(FPainter); + FreeAndNil(FCanvasBitmap); + cxClearObjectLinks(Self); + inherited; +end; + +function TdxCustomNavBar.CanFocus: Boolean; +begin + Result := inherited CanFocus and TabStop; +end; + +procedure TdxCustomNavBar.DeSelectLinks; +var + I: Integer; +begin + for I := 0 to Groups.Count - 1 do + Groups[I].SelectedLinkIndex := -1; +end; + +procedure TdxCustomNavBar.DragDrop(Source: TObject; X, Y: Integer); +begin + if FPressedGroup <> nil then + begin + FPressedGroup := nil; + InvalidateAll(doRedraw); + end; + if FPressedLink <> nil then + begin + FPressedLink := nil; + InvalidateAll(doRedraw); + end; + FTargetPoint := Point(X, Y); + FHotTrackedLink := GetLinkAtSelectedPos(FTargetPoint); + FHotTrackedGroup := GetGroupAtCaptionPos(FTargetPoint); + if dxNavBarDragObject <> nil then + begin + dxNavBarDragObject.UpdateTargets; + if (SourceItem <> nil) and IsAllowDropLink then + DoItemDragDrop(SourceItem) + else if (SourceLink <> nil) and IsAllowDropLink then + DoLinkDragDrop(SourceLink) + else if (SourceGroup <> nil) and IsAllowDropGroup then + DoGroupDragDrop(SourceGroup) + end; + inherited DragDrop(Source, X, Y); + DragDone; +end; + +procedure TdxCustomNavBar.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); +var + ABoundsChanged: Boolean; +begin + Controller.CheckBounds(ALeft, ATop, AWidth, AHeight); + ABoundsChanged := (ALeft <> Left) or (ATop <> Top) or (AWidth <> Width) or (AHeight <> Height); + inherited SetBounds(ALeft, ATop, AWidth, AHeight); + if ABoundsChanged and (CanvasBitmap <> nil) and HandleAllocated then + begin + if CanvasBitmap.Width <= ClientWidth then + CanvasBitmap.Width := ClientWidth + 10; + if CanvasBitmap.Height <= ClientHeight then + CanvasBitmap.Height := ClientHeight + 10; + InvalidateAll(ViewInfo.GetBoundsUpdateType); + end; +end; + +procedure TdxCustomNavBar.Loaded; +begin + inherited; + if (0 <= FActiveGroupIndex) and (FActiveGroupIndex < Groups.Count) then + FActiveGroup := Groups[FActiveGroupIndex]; + DefaultStyles.AssignDefaultValues(True); + InvalidateAll(doRecreate); +end; + +procedure TdxCustomNavBar.MouseEnter(AControl: TControl); +begin + inherited; +// BeginMouseTracking(Self, Bounds, Self); + InvalidateAll(doRedraw); +end; + +{ +procedure TdxCustomNavBar.MouseLeave; // IcxMouseTrackingCaller +begin + MouseLeave(Self); +end; +} + +procedure TdxCustomNavBar.MouseLeave(AControl: TControl); +begin +// EndMouseTracking(Self); + FTargetPoint := cxInvalidPoint; + FPressedGroup := nil; + FPressedLink := nil; + FHotTrackedGroup := nil; + FHotTrackedLink := nil; + if dxNavBarDragObject <> nil then + dxNavBarDragObject.UpdateTargets; + inherited; + Controller.MouseLeave; + InvalidateAll(doRecalc); +end; + +procedure TdxCustomNavBar.AccessibleObjectOwnerObjectDestroyedNotification( + Sender: TObject); +begin + if (FFocusedAccessibleObject <> nil) and + (FFocusedAccessibleObject.GetHelper = Sender) then + FFocusedAccessibleObject := nil; +end; + +procedure TdxCustomNavBar.CheckCollapseState; + + function AlreadyCollapsed: Boolean; + begin + Result := nbisAlreadyCollapsed in FInternalState; + end; + +var + ANeedCollapse, ANeedExpand: Boolean; +begin + ANeedCollapse := IsCollapsed and not AlreadyCollapsed; + ANeedExpand := not IsCollapsed and AlreadyCollapsed; + if ANeedCollapse or ANeedExpand then + begin + if ANeedCollapse then + begin + Width := ViewInfo.GetNavBarCollapsedWidth; + Include(FInternalState, nbisAlreadyCollapsed); + DoNavigationPaneCollapsed; + end + else + begin + Width := FOriginalWidth; + Exclude(FInternalState, nbisAlreadyCollapsed); + DoNavigationPaneExpanded; + end; + end; +end; + +procedure TdxCustomNavBar.CheckFocusedAccessibleObject; +begin + if (FocusedAccessibleObject <> nil) and not FocusedAccessibleObject.CanFocus(False) then + FocusedAccessibleObject.RemoveFocus; +end; + +procedure TdxCustomNavBar.CreateParams(var Params: TCreateParams); +const + ABorderStylesMap: array[TBorderStyle] of DWORD = (0, WS_BORDER); +begin + inherited CreateParams(Params); + Params.Style := Params.Style or ABorderStylesMap[BorderStyle]; + if NewStyleControls and Ctl3D and (BorderStyle = bsSingle) then + begin + Params.Style := Params.Style and not WS_BORDER; + Params.ExStyle := Params.ExStyle or WS_EX_CLIENTEDGE; + end; + Params.WindowClass.style := Params.WindowClass.style and not (CS_HREDRAW or CS_VREDRAW); +end; + +procedure TdxCustomNavBar.CreateWindowHandle(const Params: TCreateParams); +begin + inherited CreateWindowHandle(Params); + ScrollBar.Reset; +end; + +procedure TdxCustomNavBar.DefineProperties(Filer: TFiler); + + function NeedWriteOriginalWidth: Boolean; + begin + Result := OptionsBehavior.NavigationPane.Collapsed; + if Filer.Ancestor is TdxCustomNavBar then + Result := Result and (OriginalWidth <> TdxCustomNavBar(Filer.Ancestor).OriginalWidth); + end; + +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('OriginalWidth', ReadOriginalWidth, WriteOriginalWidth, + NeedWriteOriginalWidth); +end; + +function TdxCustomNavBar.GetDesignHitTest(X, Y: Integer; Shift: TShiftState): Boolean; +begin + Result := IsPtGroupDesignRect(Point(X,Y)) or IsPtItemDesignRect(Point(X, Y)) or + IsPtTopScrollButton(Point(X,Y)) or IsPtBottomScrollButton(Point(X,Y)); +end; + +procedure TdxCustomNavBar.FocusChanged; +begin + inherited; + if FocusedAccessibleObject <> nil then + FocusedAccessibleObject.FocusedChanged(False); +end; + +procedure TdxCustomNavBar.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) then + begin + if AComponent = FHotTrackedGroup then FHotTrackedGroup := nil; + if AComponent = FPressedGroup then FPressedGroup := nil; + if AComponent = FActiveGroup then ActiveGroup := nil; + end; +end; + +procedure TdxCustomNavBar.ReadOriginalWidth(Reader: TReader); +begin + FOriginalWidth := Reader.ReadInteger; +end; + +procedure TdxCustomNavBar.SetChildOrder(Child: TComponent; Order: Integer); +var + AChildKind: TdxNavBarChildKind; + AOrder, I: Integer; +begin + AOrder := Order; + for AChildKind := Low(TdxNavBarChildKind) to High(TdxNavBarChildKind) do + case AChildKind of + nbckGroup: + begin + if Child is TdxNavBarGroup then + begin + TdxNavBarGroup(Child).Index := AOrder; + Exit; + end; + Dec(AOrder, Groups.Count); + end; + nbckItem: + begin + if Child is TdxNavBarItem then + begin + TdxNavBarItem(Child).Index := AOrder; + Exit; + end; + Dec(AOrder, Items.Count); + end; + nbckStyle: + begin + if Child is TdxNavBarStyleItem then + begin + TdxNavBarStyleItem(Child).Index := AOrder; + Exit; + end; + Dec(AOrder, Styles.Count); + end; + nbckGroupControl: + for I := 0 to Groups.Count - 1 do + if Groups[I].Control <> nil then + Dec(AOrder); + end; + inherited SetChildOrder(Child, Order); +end; + +procedure TdxCustomNavBar.GetChildren(Proc: TGetChildProc; Root: TComponent); +var + AChildKind: TdxNavBarChildKind; + I: Integer; +begin + for AChildKind := Low(TdxNavBarChildKind) to High(TdxNavBarChildKind) do + case AChildKind of + nbckGroup: + for I := 0 to Groups.Count - 1 do + if Groups[I].Owner = Root then + Proc(Groups[I]); + nbckItem: + for I := 0 to Items.Count - 1 do + if Items[I].Owner = Root then + Proc(Items[I]); + nbckStyle: + for I := 0 to Styles.Count - 1 do + if Styles[I].Owner = Root then + Proc(Styles[I]); + nbckGroupControl: + for I := 0 to Groups.Count - 1 do + if (Groups[I].Control <> nil) and (Groups[I].Control.Owner = Root) then + Proc(Groups[I].Control); + end; +end; + +procedure TdxCustomNavBar.SetName(const NewName: TComponentName); +var + OldName, NewItemName: string; + I, L: Integer; + + procedure UpdateName(AComponent: TComponent); + begin + NewItemName := AComponent.Name; + if Pos(OldName, NewItemName) = 1 then + begin + Delete(NewItemName, 1, L); + Insert(Name, NewItemName, 1); + try + AComponent.Name := NewItemName; + except + on EComponentError do ; {Ignore rename errors } + end; + end; + end; + +begin + OldName := Name; + L := Length(OldName); + inherited; + if IsDesigning then + begin + for I := 0 to Groups.Count - 1 do + UpdateName(Groups[I]); + for I := 0 to Items.Count - 1 do + UpdateName(Items[I]); + for I := 0 to Styles.Count - 1 do + UpdateName(Styles[I]); + end; +end; + +procedure TdxCustomNavBar.WriteOriginalWidth(Writer: TWriter); +begin + Writer.WriteInteger(FOriginalWidth); +end; + +function TdxCustomNavBar.CanFocusOnClick(X, Y: Integer): Boolean; +begin + Result := inherited CanFocusOnClick(X, Y) and Controller.CanFocusOnClick(Point(X, Y)); +end; + +procedure TdxCustomNavBar.DoEnter; +begin + inherited DoEnter; + if FocusedAccessibleObject = nil then + FocusedAccessibleObject := IAccessibilityHelper.GetNextObjectForNavigation( + dirNone); +end; + +procedure TdxCustomNavBar.KeyDown(var Key: Word; Shift: TShiftState); + + function GetNavigationDirection: TcxDirection; + begin + case Key of + VK_LEFT: + Result := dirLeft; + VK_UP: + Result := dirUp; + VK_RIGHT: + Result := dirRight; + VK_DOWN: + Result := dirDown; + else + Result := dirNone; + end; + end; + + function GetNewFocusedAccessibleObject: IdxNavBarAccessibilityHelper; + begin + if FocusedAccessibleObject = nil then + Result := IAccessibilityHelper.GetNextObjectForNavigation(dirDown) + else + Result := FocusedAccessibleObject.GetNextObjectForNavigation( + GetNavigationDirection); + end; + +var + ANewFocusedAccessibleObject: IdxNavBarAccessibilityHelper; +begin + Include(FInternalState, nbisKeyDowned); + inherited KeyDown(Key, Shift); + if GetNavigationDirection <> dirNone then + begin + ANewFocusedAccessibleObject := GetNewFocusedAccessibleObject; + if ANewFocusedAccessibleObject <> nil then + FocusedAccessibleObject := ANewFocusedAccessibleObject; + end + else + if (Key <> 0) and (FocusedAccessibleObject <> nil) then + FocusedAccessibleObject.KeyDown(Key, Shift); +end; + +procedure TdxCustomNavBar.KeyPress(var Key: Char); +begin + inherited KeyPress(Key); + if (Key <> #0) and (FocusedAccessibleObject <> nil) then + FocusedAccessibleObject.KeyPress(Key); +end; + +procedure TdxCustomNavBar.KeyUp(var Key: Word; Shift: TShiftState); +var + ALinkSelf: TcxObjectLink; +begin + inherited KeyUp(Key, Shift); + if (nbisKeyDowned in FInternalState) and (Key <> 0) and (FocusedAccessibleObject <> nil) then + begin + Exclude(FInternalState, nbisKeyDowned); + ALinkSelf := cxAddObjectLink(Self); + try + FocusedAccessibleObject.KeyUp(Key, Shift); + if ALinkSelf.Ref = nil then + Key := 0; + finally + cxRemoveObjectLink(ALinkSelf); + end; + end; +end; + +function TdxCustomNavBar.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; + +const + AScrollCodes: array[Boolean, Boolean] of TScrollCode = ((scLineUp, scPageUp), (scLineDown, scPageDown)); + + function IsScrollBarsPresent(AControl: TWinControl): Boolean; + var + AScrollInfo: TScrollInfo; + begin + ZeroMemory(@AScrollInfo, SizeOf(TScrollInfo)); + AScrollInfo.fMask := SIF_ALL; + AScrollInfo.cbSize := SizeOf(TScrollInfo); + GetScrollInfo(AControl.Handle, SB_VERT, AScrollInfo); + Result := (AScrollInfo.nPage > 0) and (AScrollInfo.nMax >= Integer(AScrollInfo.nPage)); + end; + +var + AScrollPos: Integer; + AControl: TWinControl; + AMessage: TWMMouseWheel; + AWindowRect: TRect; +begin + Result := False; + GetWindowRect(Handle, AWindowRect); + if PtInRect(AWindowRect, Mouse.CursorPos) and ScrollBar.Visible then + begin + AControl := FindControl(WindowFromPoint(Mouse.CursorPos)); + if (AControl <> nil) and (AControl <> Self) and IsScrollBarsPresent(AControl) then + begin + AMessage.Msg := WM_MOUSEWHEEL; + AMessage.Keys := ShiftStateToKeys(Shift); + AMessage.WheelDelta := WheelDelta; + AMessage.Pos := PointToSmallPoint(MousePos); + + AControl.DefaultHandler(AMessage); + Result := AMessage.Result = 1; + end; + + if not Result then + begin + AScrollPos := ScrollBar.Position; + ScrollBar.Scroll(ScrollBar, AScrollCodes[WheelDelta < 0, ssCtrl in Shift], AScrollPos); + Result := True; + end; + end; +end; + +procedure TdxCustomNavBar.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + AAccessibleObject: IdxNavBarAccessibilityHelper; +begin + if IsPtBottomScrollButton(Point(X, Y)) or IsPtTopScrollButton(Point(X, Y)) then + AAccessibleObject := nil + else + AAccessibleObject := NavBarGetFocusableAccessibleObjectAtPos( + IAccessibilityHelper, ClientToScreen(Point(X, Y))); + + inherited MouseDown(Button, Shift, X, Y); + FSourceShift := Shift; + FSourcePoint := Point(X, Y); + Controller.MouseDown(Button, Shift, FSourcePoint); + if (AAccessibleObject <> nil) and AAccessibleObject.GetHelper.IsOwnerObjectLive and + AAccessibleObject.CanFocus(False) then + FocusedAccessibleObject := AAccessibleObject; +end; + +procedure TdxCustomNavBar.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + ALinkSelf: TcxObjectLink; +begin + if EnableDragging then exit; + inherited MouseUp(Button, Shift, X, Y); + FSourcePoint := Point(X, Y); + ALinkSelf := cxAddObjectLink(Self); + try + Controller.MouseUp(Button, Shift, FSourcePoint); + if ALinkSelf.Ref <> nil then + FSourceShift := []; + finally + cxRemoveObjectLink(ALinkSelf); + end; +end; + +procedure TdxCustomNavBar.MouseMove(Shift: TShiftState; X, Y: Integer); + + function IsDragBegining: Boolean; + begin + Result := (Abs(FSourcePoint.X - X) > 3) or (Abs(FSourcePoint.Y - Y) > 3); + end; + + function CanDrag: Boolean; + begin + Result := (IsAllowDragGroup and (FSourceGroup <> nil)) or + (IsAllowDragLink and (FSourceLink <> nil) and FSourceLink.Item.Enabled); + end; + +begin + FTargetPoint := Point(X, Y); + if not Painter.IsViewInfoValid or IsDesigning then + Exit; + if IsTopScrollButtonVisible or IsBottomScrollButtonVisible then + InvalidateScrollButtons; + + if CanDrag and IsDragBegining then + begin + FSourceShift := []; + Include(FInternalState, nbisDragging); + DragMode := dmAutomatic; + BeginDrag(True); + end + else + begin + inherited MouseMove(Shift, X, Y); + Controller.MouseMove(Shift, FTargetPoint); + end; +end; + +procedure TdxCustomNavBar.DragOver(Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); +begin + Accept := False; + FTargetPoint := Point(X, Y); + FScrollButtonDownIsDown := False; + FScrollButtonUpIsDown := False; + if FPressedGroup <> nil then + begin + FPressedGroup := nil; + InvalidateAll(doRedraw); + end; + if FPressedLink <> nil then + begin + FPressedLink := nil; + InvalidateAll(doRedraw); + end; + if IsTopScrollButtonVisible or IsBottomScrollButtonVisible then + InvalidateScrollButtons; + if dxNavBarDragObject <> nil then + begin + dxNavBarDragObject.UpdateTargets; + if (SourceItem <> nil) and IsAllowDropLink then + DoItemDragOver(SourceItem, Accept) + else if (SourceLink <> nil) and IsAllowDropLink then + DoLinkDragOver(SourceLink, Accept) + else if (SourceGroup <> nil) and IsAllowDropGroup then + DoGroupDragOver(SourceGroup, Accept); + end; + if Assigned(OnDragOver) then + OnDragOver(Self, Source, X, Y, State, Accept); +end; + +procedure TdxCustomNavBar.DoEndDrag(Target: TObject; X, Y: Integer); +begin + inherited DoEndDrag(Target, X, Y); + FreeAndNil(FDragObject); + DragDone; +end; + +type + TdxDragObject = class(TDragControlObject) + protected + function GetDragCursor(Accepted: Boolean; X, Y: Integer): TCursor; override; + end; + +function TdxDragObject.GetDragCursor(Accepted: Boolean; X, Y: Integer): TCursor; +var + Wnd: TWinControl; +begin + Wnd := FindVCLWindow(Point(X, Y)); + if Accepted and (Wnd is TdxCustomNavBar) then + begin + if dxNavBarDragObject.SourceItem <> nil then + Result := TdxCustomNavBar(Wnd).DragCopyCursor + else Result := TdxCustomNavBar(Wnd).DragCursor; + end + else Result := inherited GetDragCursor(Accepted, X, Y); +end; + +procedure TdxCustomNavBar.DoStartDrag(var DragObject: TDragObject); +begin + if dxNavBarDragObject = nil then + dxNavBarDragObject := TdxNavBarDragObject.Create(Self, DragObject {deprecated}, FSourceGroup, FSourceLink, nil); + FDragObject := TdxDragObject.Create(Self); + DragObject := FDragObject; + DoLinkHotTrack(nil); + DoGroupHotTrack(nil); + inherited DoStartDrag(DragObject); +end; + +procedure TdxCustomNavBar.DoActivateGroupTimer(Sender: TObject); +var + Group: TdxNavBarGroup; +begin + Group := ViewInfo.GetGroupAtCaptionPos(FTargetPoint); + if Group = FActiveGroupCandidate then + ViewInfo.DoGroupActivate(Group); + FActivateGroupTimer.Enabled := False; +end; + +procedure TdxCustomNavBar.DoScrollTimer(Sender: TObject); +begin + FScrollButtonUpIsDown := IsPtTopScrollButton(TargetPoint); + FScrollButtonDownIsDown := IsPtBottomScrollButton(TargetPoint); + if ScrollButtonUpIsDown or ScrollButtonDownIsDown then + begin + if ScrollButtonUpIsDown and not (sDisabled in ViewInfo.TopScrollButtonState) then + ActiveGroup.TopVisibleLinkIndex := ActiveGroup.TopVisibleLinkIndex - 1; + if ScrollButtonDownIsDown and not (sDisabled in ViewInfo.BottomScrollButtonState) then + ActiveGroup.TopVisibleLinkIndex := ActiveGroup.TopVisibleLinkIndex + 1; + end + else FScrollTimer.Enabled := False; +end; + +procedure TdxCustomNavBar.DoGroupDragDrop(Group: TdxNavBarGroup); +begin + if TargetGroup <> nil then + Group.Index := TargetGroup.Index; +end; + +procedure TdxCustomNavBar.DoGroupDragOver(Group: TdxNavBarGroup; var Accept: Boolean); +begin + Accept := (Group <> TargetGroup) and (TargetGroup <> nil); + InvalidateAll(doRedraw); +end; + +procedure TdxCustomNavBar.DoGroupHotTrack(Group: TdxNavBarGroup); +begin + if FHotTrackedGroup <> nil then + InvalidateAll(doRecalc); + FHotTrackedGroup := Group; + if FHotTrackedGroup <> nil then + InvalidateAll(doRecalc); + if Assigned(FOnGroupHotTrack) then + FOnGroupHotTrack(Self, FHotTrackedGroup); +end; + +procedure TdxCustomNavBar.DoGroupMouseDown(Group: TdxNavBarGroup); +begin + if not IsDesigning or (ssDouble in FSourceShift) then + begin + FSourceGroup := Group; + FPressedGroup := Group; + if Assigned(FOnGroupPress) then + FOnGroupPress(Self, FPressedGroup); + InvalidateAll(doRecalc); + end + else + DesignerSelect(Group); +end; + +procedure TdxCustomNavBar.DoGroupMouseUp(Group: TdxNavBarGroup); +begin + if not IsDesigning or (ssDouble in FSourceShift) then + begin + FSourceGroup := nil; + if Assigned(Group.OnClick) then + Group.OnClick(Group) + else if Assigned(FOnGroupClick) then + FOnGroupClick(Self, Group); + ViewInfo.DoGroupActiveToggle(Group); + FPressedGroup := nil; + InvalidateAll(doRecalc); + end; +end; + +procedure TdxCustomNavBar.DoLinkDragDrop(Link: TdxNavBarItemLink); +var + AIndex: Integer; + ASourceLink: TdxNavBarItemLink; +begin + AIndex := TargetLinkIndex; + if AIndex > -1 then + begin + if (TargetGroup = Link.Group) and (AIndex > Link.Index) then Dec(AIndex); + if Link.Group <> TargetGroup then + begin + Link.Group.SelectedLinkIndex := -1; + ASourceLink := TargetGroup.CreateLink(Link.Item); + ASourceLink.Index := AIndex; + Link.Group.RemoveLink(Link.Index); + end + else ASourceLink := Link; + ASourceLink.Index := AIndex; + InvalidateAll(doRedraw); + end; +end; + +procedure TdxCustomNavBar.DoLinkDragOver(Link: TdxNavBarItemLink; var Accept: Boolean); +var + Group: TdxNavBarGroup; +begin + Accept := True; + if IsPtTopScrollButton(TargetPoint) or IsPtBottomScrollButton(TargetPoint) then + FScrollTimer.Enabled := True + else + begin + Group := ViewInfo.GetGroupAtCaptionPos(FTargetPoint); + if Group <> nil then + begin + FActivateGroupTimer.Enabled := False; + FActiveGroupCandidate := Group; + FActivateGroupTimer.Enabled := True; + end; + Accept := (TargetGroup <> nil) and (TargetLink1 <> Link) and (TargetLink2 <> Link); + InvalidateAll(doRedraw); + end; +end; + +procedure TdxCustomNavBar.DoLinkHotTrack(Link: TdxNavBarItemLink); +begin + if FHotTrackedLink <> nil then + InvalidateAll(doRecalc); + FHotTrackedLink := Link; + if FHotTrackedLink <> nil then + InvalidateAll(doRecalc); + if Assigned(FOnLinkHotTrack) then + FOnLinkHotTrack(Self, FHotTrackedLink); +end; + +procedure TdxCustomNavBar.DoLinkMouseDown(Link: TdxNavBarItemLink); +begin + if not IsDesigning then + begin + FSourceLink := Link; + if (Link.Group.SelectedLinkIndex > -1) then + InvalidateAll(doRecalc); + if Link.CanSelect then + begin + FPressedLink := Link; + if Assigned(FOnLinkPress) then + FOnLinkPress(Self, FPressedLink); + InvalidateAll(doRecalc); + end; + end + else + DesignerSelect(Link.Item); +end; + +procedure TdxCustomNavBar.DoLinkMouseUp(Link: TdxNavBarItemLink); +var + ALinkSelf: TcxObjectLink; +begin + FSourceLink := nil; + if Link.CanSelect then + begin + ALinkSelf := cxAddObjectLink(Self); + try + Controller.DoLinkClick(Self, Link); + if ALinkSelf.Ref <> nil then + begin + FPressedLink := nil; + InvalidateAll(doRecalc); + end; + finally + cxRemoveObjectLink(ALinkSelf); + end; + end; +end; + +procedure TdxCustomNavBar.DoNavigationPaneCollapsed; +begin + DoCollapseStateChanged; + CallNotify(OnNavigationPaneCollapsed, Self); +end; + +procedure TdxCustomNavBar.DoNavigationPaneExpanded; +begin + DoCollapseStateChanged; + CallNotify(OnNavigationPaneExpanded, Self); +end; + +procedure TdxCustomNavBar.DoItemDragDrop(Item: TdxNavBarItem); +begin + if TargetGroup <> nil then + begin + with TargetGroup.CreateLink(Item) do + Index := TargetLinkIndex; + end; +end; + +procedure TdxCustomNavBar.DoItemDragOver(Item: TdxNavBarItem; var Accept: Boolean); +var + Group: TdxNavBarGroup; +begin + Accept := True; + if IsPtTopScrollButton(FTargetPoint) or IsPtBottomScrollButton(FTargetPoint) then + FScrollTimer.Enabled := True + else + begin + Group := GetGroupAtCaptionPos(FTargetPoint); + if Group <> nil then + begin + FActivateGroupTimer.Enabled := False; + FActiveGroupCandidate := Group; + FActivateGroupTimer.Enabled := True; + end; + Accept := TargetGroup <> nil; + InvalidateAll(doRedraw); + end; +end; + +procedure TdxCustomNavBar.DoBottomScrollButtonDown; +begin + if not (sDisabled in ViewInfo.BottomScrollButtonState) then + begin + FScrollButtonUpIsDown := False; + FScrollButtonDownIsDown := True; + FScrollTimer.Enabled := True; + if ActiveGroup <> nil then + begin + ActiveGroup.TopVisibleLinkIndex := ActiveGroup.TopVisibleLinkIndex + 1; + DesignerModified; + end; + InvalidateScrollButtons; + end; +end; + +procedure TdxCustomNavBar.DoBottomScrollButtonUp; +begin + FScrollButtonDownIsDown := False; + FScrollTimer.Enabled := False; + InvalidateScrollButtons; +end; + +procedure TdxCustomNavBar.DoTopScrollButtonDown; +begin + if not (sDisabled in ViewInfo.TopScrollButtonState) then + begin + FScrollButtonDownIsDown := False; + FScrollButtonUpIsDown := True; + FScrollTimer.Enabled := True; + if ActiveGroup <> nil then + begin + ActiveGroup.TopVisibleLinkIndex := ActiveGroup.TopVisibleLinkIndex - 1; + DesignerModified; + end; + InvalidateScrollButtons; + end; +end; + +procedure TdxCustomNavBar.DoTopScrollButtonUp; +begin + FScrollButtonUpIsDown := False; + FScrollTimer.Enabled := False; + InvalidateScrollButtons; +end; + +procedure TdxCustomNavBar.DoUpdateScrollBarStyle; +begin + if FScrollBar.ScrollBar.ClassType <> Painter.GetcxScrollBarClass then + FScrollBar.RecreatecxScrollBar; + with FScrollBar.ScrollBar do + begin + if View in [dxNavBarXP1View, dxNavBarXP2View, dxNavBarXPExplorerBarView, + dxNavBarAdvExplorerBarView, dxNavBarOffice11ExplorerBarView, dxNavBarVistaExplorerBarView] + then + LookAndFeel.NativeStyle := True + else + begin + LookAndFeel.NativeStyle := False; + case View of + dxNavBarBaseView: + LookAndFeel.Kind := lfStandard; + dxNavBarOffice1View, dxNavBarOffice2View, dxNavBarOffice3View, dxNavBarFlatView: + LookAndFeel.Kind := lfFlat; + dxNavBarUltraFlatExplorerView, dxNavBarExplorerBarView: + LookAndFeel.Kind := lfUltraFlat; + dxNavBarOffice11TaskPaneView, dxNavBarOffice11NavigatorPaneView: + LookAndFeel.Kind := lfOffice11; + dxNavBarSkinExplorerBarView: + if Painter.GetMasterLookAndFeel <> nil then + LookAndFeel.MasterLookAndFeel := Painter.GetMasterLookAndFeel; + end; + end; + end; +end; + +function TdxCustomNavBar.GetClientRect: TRect; +begin + Result := inherited GetClientRect; + if FScrollBar.Visible then + if FScrollBar.FKind = sbVertical then + Result.Right := Result.Right - FScrollBar.Width + else + Result.Bottom := Result.Bottom - FScrollBar.Height; +end; + +procedure TdxCustomNavBar.DoScroll(Sender: TObject; ScrollCode: TScrollCode; + var ScrollPos: Integer); +begin + InvalidateAll(doRecalc); + Update; +end; + +function TdxCustomNavBar.DesignerIsSelected(AObject: TPersistent): Boolean; +begin + Result := (FDesignHelper <> nil) and FDesignHelper.IsObjectSelected(Self, AObject); +end; + +procedure TdxCustomNavBar.DesignerModified; +begin + if FDesignHelper <> nil then + FDesignHelper.Modified; +end; + +procedure TdxCustomNavBar.DesignerSelect(AObject: TPersistent); +begin + if FDesignHelper <> nil then + FDesignHelper.SelectObject(Self, AObject, True, False); +end; + +procedure TdxCustomNavBar.DesignSelectionChanged(ASelection: TList); +begin + InvalidateAll(doRedraw); +end; + +procedure TdxCustomNavBar.OnGroupsChanged(Sender: TObject; AItem: TcxComponentCollectionItem; + AAction: TcxComponentCollectionNotification); +begin + if NavigationPaneMaxVisibleGroups <> -1 then + InvalidateAll(doRecreate) + else + InvalidateAll(AItem, AAction); +// if AAction = ccnChanged then //#DG ? +// DesignerModified; +end; + +procedure TdxCustomNavBar.OnItemsChanged(Sender: TObject; AItem: TcxComponentCollectionItem; + AAction: TcxComponentCollectionNotification); +begin + InvalidateAll(AItem, AAction); +end; + +procedure TdxCustomNavBar.OnStylesChanged(Sender: TObject); +begin + InvalidateAll(doRecreate); +end; + +procedure TdxCustomNavBar.OnImagesChanged(Sender: TObject); +begin + InvalidateAll(doRecreate); +end; + +procedure TdxCustomNavBar.OnLinksChanged(Sender: TObject; ALink: TdxNavBarItemLink); +begin + if FHotTrackedLink = ALink then + FHotTrackedLink := nil; + if FPressedLink = ALink then + FPressedLink := nil; +end; + +procedure TdxCustomNavBar.OnThemeChanged; +begin + if FPainter.Reregistered then + ViewStyle := CreatePainter + else + begin + ViewInfo.RefreshColors; + InvalidateAll(doRecreate); + end; +end; + +procedure TdxCustomNavBar.DoActiveGroupChanged; +begin + if [csDestroying, csLoading] * ComponentState = [] then + CallNotify(OnActiveGroupChanged, Self); +end; + +procedure TdxCustomNavBar.DoActiveGroupChanging(ANewGroup: TdxNavBarGroup; var AAllowChange: Boolean); +begin + if ([csDestroying, csLoading] * ComponentState = []) and Assigned(OnActiveGroupChanging) then + OnActiveGroupChanging(Self, ANewGroup, AAllowChange); +end; + +procedure TdxCustomNavBar.DoCollapseStateChanged; +begin + CallNotify(OnCollapseStateChanged, Self); +end; + +procedure TdxCustomNavBar.Paint; +begin + Painter.Paint; +end; + +procedure TdxCustomNavBar.InitiateAction; +begin + inherited; + Groups.InitiateActions; +end; + +procedure TdxCustomNavBar.Invalidate; +begin + if FPainter <> nil then + Painter.InvalidateViewInfo(doRedraw); + inherited; +end; + +procedure TdxCustomNavBar.InvalidateAll(AType: TdxNavBarChangeType); +begin + if ([csDestroying, csLoading] * ComponentState) = [] then + begin + if FPainter <> nil then + Painter.InvalidateViewInfo(AType); + if HandleAllocated then + begin + if AType = doRecreate then + RedrawWindow(Handle, nil, 0, RDW_INVALIDATE or RDW_ALLCHILDREN); + Invalidate; + end; + end; +end; + +procedure TdxCustomNavBar.InvalidateAll(AItem: TcxComponentCollectionItem; + AAction: TcxComponentCollectionNotification); + + function GetUpdateType(AItem: TcxComponentCollectionItem; + AAction: TcxComponentCollectionNotification): TdxNavBarChangeType; + begin + if (AItem <> nil) and (AAction = ccnChanged) then + Result := doRecalc + else + Result := doRecreate; + end; + +begin + InvalidateAll(GetUpdateType(AItem, AAction)); +end; + +procedure TdxCustomNavBar.InvalidateScrollButtons; +begin + if csDestroying in ComponentState then exit; + Painter.InvalidateViewInfo(doRedraw); + if HandleAllocated then Painter.InvalidateScrollButtons; +end; + +procedure TdxCustomNavBar.LoadFromRegIni(AStorage: TCustomIniFile; LoadStyles: Boolean); + + procedure ReadStyle(AIndex: Integer); + var + ASection, ABuffer, AText: string; + AStream: TStringStream; + AGraphicClass: TGraphicClass; + AGraphic: TGraphic; + AStyleItem: TdxNavBarStyleItem; + begin + with AStorage do + begin + ASection := 'Style' + IntToStr(AIndex); + AStyleItem := Styles.Add; + with AStyleItem.Style do + begin + BackColor := ReadInteger(ASection, 'BackColor', BackColor); + BackColor2 := ReadInteger(ASection, 'BackColor2', BackColor2); + AlphaBlending := ReadInteger(ASection, 'AlphaBlending', AlphaBlending); + AlphaBlending2 := ReadInteger(ASection, 'AlphaBlending2', AlphaBlending2); + Font.Charset := ReadInteger(ASection, 'FontCharset', Font.Charset); + Font.Color := ReadInteger(ASection, 'FontColor', Font.Color); + Font.Height :=ReadInteger(ASection, 'FontHeight', Font.Height); + Font.Name := ReadString(ASection, 'FontName', Font.Name); + Font.Pitch := TFontPitch(ReadInteger(ASection, 'FontPitch', Integer(Font.Pitch))); + Font.Size := ReadInteger(ASection, 'FontSize', Font.Size); + if ReadBool(ASection, 'FontStyleBold', fsBold in Font.Style) then + Font.Style := Font.Style + [fsBold]; + if ReadBool(ASection, 'FontStyleItalic', fsItalic in Font.Style) then + Font.Style := Font.Style + [fsItalic]; + if ReadBool(ASection, 'FontStyleUnderline', fsUnderline in Font.Style) then + Font.Style := Font.Style + [fsUnderline]; + if ReadBool(ASection, 'FontStyleStrikeOut', fsStrikeOut in Font.Style) then + Font.Style := Font.Style + [fsStrikeOut]; + GradientMode := TdxBarStyleGradientMode(ReadInteger(ASection, 'GradientMode', Integer(GradientMode))); + if ValueExists(ASection, 'Image') then + begin + AText := ReadString(ASection, 'Image', ''); + SetLength(ABuffer, Length(AText) div 2); + HexToBin(PChar(AText), PChar(ABuffer), Length(AText) div 2); + AStream := TStringStream.Create(ABuffer); + try + AStream.Position := 0; + AGraphicClass := TGraphicClass(GetClass(ReadString(ASection, 'ImageClass', ''))); + if AGraphicClass <> nil then + begin + AGraphic := AGraphicClass.Create; + try + AGraphic.LoadFromStream(AStream); + Image.Graphic := AGraphic; + finally + AGraphic.Free; + end; + end; + finally + AStream.Free; + end; + end; + HAlignment := TdxBarStyleHAlignment(ReadInteger(ASection, 'HAlignment', Integer(HAlignment))); + VAlignment := TdxBarStyleVAlignment(ReadInteger(ASection, 'VAlignment', Integer(VAlignment))); + AStyleItem.Tag := ReadInteger(ASection, 'Tag', AStyleItem.Tag); + end; + end; + end; + + function GetCustomItem(ACollection: TdxNavBarCustomItems; const ASection: string): TdxNavBarCustomItem; + var + AItemIdentifier: string; + begin + Result := nil; + AItemIdentifier := AStorage.ReadString(ASection, 'Name', ''); + if AItemIdentifier <> '' then + Result := TdxNavBarCustomItem(ACollection.ItemByName(AItemIdentifier)) + else + begin + AItemIdentifier := AStorage.ReadString(ASection, 'Caption', ''); + if AItemIdentifier <> '' then + Result := ACollection.ItemByCaption(AItemIdentifier); + end; + if Result = nil then + Result := ACollection.Add; + end; + + procedure ReadItem(AIndex: Integer); + var + AItem: TdxNavBarItem; + ASection: string; + begin + ASection := 'Item' + IntToStr(AIndex); + AItem := TdxNavBarItem(GetCustomItem(Items, ASection)); + AItem.Caption := AStorage.ReadString(ASection, 'Caption', AItem.Caption); + AItem.Enabled := AStorage.ReadBool(ASection, 'Enabled', AItem.Enabled); + AItem.Hint := AStorage.ReadString(ASection, 'Hint', AItem.Hint); + AItem.LargeImageIndex := AStorage.ReadInteger(ASection, 'LargeImageIndex', + AItem.LargeImageIndex); + AItem.SmallImageIndex := AStorage.ReadInteger(ASection, 'SmallImageIndex', + AItem.SmallImageIndex); + if LoadStyles and (Styles.Count > 0) then + begin + if AStorage.ValueExists(ASection, 'StyleStyleIndex') then + AItem.Style := Styles[AStorage.ReadInteger(ASection, 'StyleStyleIndex', 0)]; + if AStorage.ValueExists(ASection, 'StyleDisabledStyleIndex') then + AItem.StyleDisabled := Styles[AStorage.ReadInteger(ASection, 'StyleDisabledStyleIndex', 0)]; + if AStorage.ValueExists(ASection, 'StyleHotTrackedStyleIndex') then + AItem.StyleHotTracked := Styles[AStorage.ReadInteger(ASection, 'StyleHotTrackedStyleIndex', 0)]; + if AStorage.ValueExists(ASection, 'StylePressedStyleIndex') then + AItem.StylePressed := Styles[AStorage.ReadInteger(ASection, 'StylePressedStyleIndex', 0)]; + end; + AItem.Tag := AStorage.ReadInteger(ASection, 'Tag', AItem.Tag); + AItem.Visible := AStorage.ReadBool(ASection, 'Visible', AItem.Visible); + end; + + procedure ReadGroup(AIndex: Integer); + var + J, ALinkCount: Integer; + ASection: string; + AGroup: TdxNavBarGroup; + AUseControl: Boolean; + AControlName: string; + AControl: TCustomControl; + AItemIndex: Integer; + begin + ASection := 'Group' + IntToStr(AIndex); + AGroup := TdxNavBarGroup(GetCustomItem(Groups, ASection)); + with AGroup do + begin + Caption := AStorage.ReadString(ASection, 'Caption', Caption); + Expanded := AStorage.ReadBool(ASection, 'Expanded', Expanded); + Hint := AStorage.ReadString(ASection, 'Hint', Hint); + LargeImageIndex := AStorage.ReadInteger(ASection, 'LargeImageIndex', LargeImageIndex); + LinksUseSmallImages := AStorage.ReadBool(ASection, 'LinksUseSmallImages', LinksUseSmallImages); + ClearLinks; + ALinkCount := AStorage.ReadInteger(ASection, 'LinkCount', 0); + for J := 0 to ALinkCount - 1 do + begin + AItemIndex := + AStorage.ReadInteger(ASection, 'Link' + IntToStr(J) + 'ItemIndex', -1); + if (AItemIndex >= 0) and (AItemIndex < Items.Count) then + CreateLink(Items[AItemIndex]); + end; + SelectedLinkIndex := AStorage.ReadInteger(ASection, 'SelectedLinkIndex', SelectedLinkIndex); + ShowAsIconView := AStorage.ReadBool(ASection, 'ShowAsIconView', ShowAsIconView); + ShowExpandButton := AStorage.ReadBool(ASection, 'ShowExpandButton', ShowExpandButton); + SmallImageIndex := AStorage.ReadInteger(ASection, 'SmallImageIndex', SmallImageIndex); + if LoadStyles and (Styles.Count > 0) then + begin + if AStorage.ValueExists(ASection, 'StyleBackgroundStyleIndex') then + StyleBackground := Styles[AStorage.ReadInteger(ASection, 'StyleBackgroundStyleIndex', 0)]; + if AStorage.ValueExists(ASection, 'StyleHeaderStyleIndex') then + StyleHeader := Styles[AStorage.ReadInteger(ASection, 'StyleHeaderStyleIndex', 0)]; + if AStorage.ValueExists(ASection, 'StyleHeaderActiveStyleIndex') then + StyleHeaderActive := Styles[AStorage.ReadInteger(ASection, 'StyleHeaderActiveStyleIndex', 0)]; + if AStorage.ValueExists(ASection, 'StyleHeaderHotTrackedStyleIndex') then + StyleHeaderHotTracked := Styles[AStorage.ReadInteger(ASection, 'StyleHeaderHotTrackedStyleIndex', 0)]; + if AStorage.ValueExists(ASection, 'StyleHeaderPressedStyleIndex') then + StyleHeaderPressed := Styles[AStorage.ReadInteger(ASection, 'StyleHeaderPressedStyleIndex', 0)]; + end; + Tag := AStorage.ReadInteger(ASection, 'Tag', Tag); + TopVisibleLinkIndex := AStorage.ReadInteger(ASection, 'TopVisibleLinkIndex', TopVisibleLinkIndex); + UseSmallImages := AStorage.ReadBool(ASection, 'UseSmallImages', UseSmallImages); + Visible := AStorage.ReadBool(ASection, 'Visible', Visible); + + AUseControl := AStorage.ReadBool(ASection, 'UseControl', UseControl); + if AUseControl then + begin + AControlName := AStorage.ReadString(ASection, 'ControlName', ''); + AControl := TCustomControl(Owner.FindComponent(AControlName)); + if AControl is TdxNavBarGroupControl then + begin + AGroup.AcceptControl(AControl as TdxNavBarGroupControl); + UseControl := AUseControl; + ShowControl := AStorage.ReadBool(ASection, 'ShowControl', ShowControl); + end; + end; + end; + AGroup.Index := AIndex; + end; + +var + AActiveGroupIndex, ACount, I: Integer; + AGroupControl: TdxNavBarGroupControl; + AGroupControls: TList; +begin + View := AStorage.ReadInteger('Layout', 'View', View); + + if LoadStyles and AStorage.ValueExists('Layout', 'StyleCount') then + begin + Styles.Clear; + ACount := AStorage.ReadInteger('Layout', 'StyleCount', Styles.Count); + for I := 0 to ACount - 1 do + ReadStyle(I); + end; + + if AStorage.ValueExists('Layout', 'ItemCount') then + begin + ACount := AStorage.ReadInteger('Layout', 'ItemCount', Items.Count); + for I := 0 to ACount - 1 do + ReadItem(I); + end; + + if AStorage.ValueExists('Layout', 'GroupCount') then + begin + AGroupControls := TList.Create; + try + for I := 0 to Groups.Count - 1 do + begin + if Groups[I].UseControl and (Groups[I].Control <> nil) then + begin + AGroupControls.Add(Groups[I].Control); + Groups[I].ReleaseControl; + end; + end; + ACount := AStorage.ReadInteger('Layout', 'GroupCount', Groups.Count); + for I := 0 to ACount - 1 do + ReadGroup(I); + for I := 0 to AGroupControls.Count - 1 do + begin + AGroupControl := TdxNavBarGroupControl(AGroupControls[I]); + if AGroupControl.Group = nil then + AGroupControl.Free; + end; + finally + AGroupControls.Free; + end; + end; + AActiveGroupIndex := AStorage.ReadInteger('Layout', 'ActiveGroup', ActiveGroupIndex); + if (0 <= AActiveGroupIndex) and (AActiveGroupIndex < Groups.Count) then + ActiveGroupIndex := AActiveGroupIndex; + NavigationPaneMaxVisibleGroups := AStorage.ReadInteger('Layout', + 'NavigationPaneMaxVisibleGroups', NavigationPaneMaxVisibleGroups); + + if LoadStyles and (Styles.Count > 0) then + begin + if AStorage.ValueExists('Layout', 'StyleBackgroundStyleIndex') then + StyleBackground := Styles[AStorage.ReadInteger('Layout', 'StyleBackgroundStyleIndex', 0)]; + if AStorage.ValueExists('Layout', 'StyleButtonStyleIndex') then + StyleButton := Styles[AStorage.ReadInteger('Layout', 'StyleButtonStyleIndex', 0)]; + if AStorage.ValueExists('Layout', 'StyleButtonHotTrackedStyleIndex') then + StyleButtonHotTracked := Styles[AStorage.ReadInteger('Layout', 'StyleButtonHotTrackedStyleIndex', 0)]; + if AStorage.ValueExists('Layout', 'StyleButtonPressedStyleIndex') then + StyleButtonPressed := Styles[AStorage.ReadInteger('Layout', 'StyleButtonPressedStyleIndex', 0)]; + if AStorage.ValueExists('Layout', 'StyleDropTargetGroupStyleIndex') then + StyleDropTargetGroup := Styles[AStorage.ReadInteger('Layout', 'StyleDropTargetGroupStyleIndex', 0)]; + if AStorage.ValueExists('Layout', 'StyleDropTargetLinkStyleIndex') then + StyleDropTargetLink := Styles[AStorage.ReadInteger('Layout', 'StyleDropTargetLinkStyleIndex', 0)]; + if AStorage.ValueExists('Layout', 'StyleHintStyleIndex') then + StyleHint := Styles[AStorage.ReadInteger('Layout', 'StyleHintPressedStyleIndex', 0)]; + if AStorage.ValueExists('Layout', 'StyleNavigationPaneHeaderStyleIndex') then + StyleNavigationPaneHeader := Styles[AStorage.ReadInteger('Layout', 'StyleNavigationPaneHeaderStyleIndex', 0)]; + end; +end; + +procedure TdxCustomNavBar.SaveToRegIni(AStorage: TCustomIniFile; SaveStyles: Boolean); + + procedure WriteStyle(AStyleItem: TdxNavBarStyleItem); + var + ASection, AText: string; + AStream: TStringStream; + begin + with AStorage do + begin + ASection := 'Style' + IntToStr(AStyleItem.Index); + with AStyleItem.Style do + begin + if savBackColor in AssignedValues then + WriteInteger(ASection, 'BackColor', BackColor); + if savBackColor2 in AssignedValues then + WriteInteger(ASection, 'BackColor2', BackColor2); + if savAlphaBlending in AssignedValues then + WriteInteger(ASection, 'AlphaBlending', AlphaBlending); + if savAlphaBlending2 in AssignedValues then + WriteInteger(ASection, 'AlphaBlending2', AlphaBlending2); + if savFont in AssignedValues then + begin + WriteInteger(ASection, 'FontCharset', Integer(Font.Charset)); + WriteInteger(ASection, 'FontColor', Font.Color); + WriteInteger(ASection, 'FontHeight', Font.Height); + WriteString(ASection, 'FontName', Font.Name); + WriteInteger(ASection, 'FontPitch', Integer(Font.Pitch)); + WriteInteger(ASection, 'FontSize', Font.Size); + WriteBool(ASection, 'FontStyleBold', fsBold in Font.Style); + WriteBool(ASection, 'FontStyleItalic', fsItalic in Font.Style); + WriteBool(ASection, 'FontStyleUnderline', fsUnderline in Font.Style); + WriteBool(ASection, 'FontStyleStrikeOut', fsStrikeOut in Font.Style); + end; + if savGradientMode in AssignedValues then + WriteInteger(ASection, 'GradientMode', Integer(GradientMode)); + if (savImage in AssignedValues) and (Image.Graphic <> nil) and + not Image.Graphic.Empty then + begin + AStream := TStringStream.Create(''); + try + Image.Graphic.SaveToStream(AStream); + AStream.Position := 0; + SetLength(AText, Length(AStream.DataString) * 2); + BinToHex(PChar(AStream.DataString), PChar(AText), Length(AStream.DataString)); + WriteString(ASection, 'ImageClass', Image.Graphic.ClassName); + WriteString(ASection, 'Image', AText); + finally + AStream.Free; + end; + end; + if savHAlignment in AssignedValues then + WriteInteger(ASection, 'HAlignment', Integer(HAlignment)); + if savVAlignment in AssignedValues then + WriteInteger(ASection, 'VAlignment', Integer(VAlignment)); + WriteInteger(ASection, 'Tag', AStyleItem.Tag); + end; + end; + end; + + procedure WriteItem(AItem: TdxNavBarItem); + var + ASection: string; + begin + ASection := 'Item' + IntToStr(AItem.Index); + AStorage.WriteString(ASection, 'Caption', AItem.Caption); + AStorage.WriteBool(ASection, 'Enabled', AItem.Enabled); + AStorage.WriteString(ASection, 'Hint', AItem.Hint); + AStorage.WriteInteger(ASection, 'LargeImageIndex', AItem.LargeImageIndex); + AStorage.WriteString(ASection, 'Name', AItem.Name); + AStorage.WriteInteger(ASection, 'SmallImageIndex', AItem.SmallImageIndex); + if SaveStyles and (Styles.Count > 0) then + begin + if AItem.Style <> nil then + AStorage.WriteInteger(ASection, 'StyleStyleIndex', AItem.Style.Index); + if AItem.StyleDisabled <> nil then + AStorage.WriteInteger(ASection, 'StyleDisabledStyleIndex', AItem.StyleDisabled.Index); + if AItem.StyleHotTracked <> nil then + AStorage.WriteInteger(ASection, 'StyleHotTrackedStyleIndex', AItem.StyleHotTracked.Index); + if AItem.StylePressed <> nil then + AStorage.WriteInteger(ASection, 'StylePressedStyleIndex', AItem.StylePressed.Index); + end; + AStorage.WriteInteger(ASection, 'Tag', AItem.Tag); + AStorage.WriteBool(ASection, 'Visible', AItem.Visible); + end; + + procedure WriteGroup(AGroup: TdxNavBarGroup); + var + J: Integer; + ASection: string; + begin + with AStorage do + begin + ASection := 'Group' + IntToStr(AGroup.Index); + with AGroup do + begin + WriteString(ASection, 'Caption', Caption); + WriteBool(ASection, 'Expanded', Expanded); + WriteString(ASection, 'Hint', Hint); + WriteInteger(ASection, 'LargeImageIndex', LargeImageIndex); + WriteInteger(ASection, 'LinkCount', LinkCount); + for J := 0 to LinkCount - 1 do + if Links[J].Item <> nil then + WriteInteger(ASection, 'Link' + IntToStr(J) + 'ItemIndex', Links[J].Item.Index); + WriteBool(ASection, 'LinksUseSmallImages', LinksUseSmallImages); + WriteString(ASection, 'Name', Name); + WriteInteger(ASection, 'SelectedLinkIndex', SelectedLinkIndex); + WriteBool(ASection, 'ShowControl', ShowControl); + WriteBool(ASection, 'ShowAsIconView', ShowAsIconView); + WriteBool(ASection, 'ShowExpandButton', ShowExpandButton); + WriteInteger(ASection, 'SmallImageIndex', SmallImageIndex); + if SaveStyles and (Styles.Count > 0) then + begin + if StyleBackground <> nil then + WriteInteger(ASection, 'StyleBackgroundStyleIndex', StyleBackground.Index); + if StyleHeader <> nil then + WriteInteger(ASection, 'StyleHeaderStyleIndex', StyleHeader.Index); + if StyleHeaderActive <> nil then + WriteInteger(ASection, 'StyleHeaderActiveStyleIndex', StyleHeaderActive.Index); + if StyleHeaderHotTracked <> nil then + WriteInteger(ASection, 'StyleHeaderHotTrackedStyleIndex', StyleHeaderHotTracked.Index); + if StyleHeaderPressed <> nil then + WriteInteger(ASection, 'StyleHeaderPressedStyleIndex', StyleHeaderPressed.Index); + end; + WriteInteger(ASection, 'Tag', Tag); + WriteInteger(ASection, 'TopVisibleLinkIndex', TopVisibleLinkIndex); + WriteBool(ASection, 'UseSmallImages', UseSmallImages); + WriteBool(ASection, 'Visible', Visible); + + WriteBool(ASection, 'UseControl', UseControl); + if UseControl then + begin + WriteBool(ASection, 'ShowControl', ShowControl); + if Control <> nil then + WriteString(ASection, 'ControlName', Control.Name); + end; + end; + end; + end; + +var + I: Integer; + ASections: TStringList; +begin + with AStorage do + begin + ASections := TStringList.Create; + try + ReadSections(ASections); + for I := 0 to ASections.Count - 1 do + if (Pos('Layout', ASections[I]) > 0) or (Pos('Group', ASections[I]) > 0) or + (Pos('Item', ASections[I]) > 0) or (Pos('Style', ASections[I]) > 0) then + EraseSection(ASections[I]); + finally + ASections.Free; + end; + + WriteInteger('Layout', 'View', View); + if SaveStyles then + begin + WriteInteger('Layout', 'StyleCount', Styles.Count); + for I := 0 to Styles.Count - 1 do + WriteStyle(Styles[I]); + end; + WriteInteger('Layout', 'ItemCount', Items.Count); + for I := 0 to Items.Count - 1 do + WriteItem(Items[I]); + WriteInteger('Layout', 'GroupCount', Groups.Count); + for I := 0 to Groups.Count - 1 do + WriteGroup(Groups[I]); + if SaveStyles and (Styles.Count > 0) then + begin + if StyleBackground <> nil then + WriteInteger('Layout', 'StyleBackgroundStyleIndex', StyleBackground.Index); + if StyleButton <> nil then + WriteInteger('Layout', 'StyleButtonStyleIndex', StyleButton.Index); + if StyleButtonHotTracked <> nil then + WriteInteger('Layout', 'StyleButtonHotTrackedStyleIndex', StyleButtonHotTracked.Index); + if StyleButtonPressed <> nil then + WriteInteger('Layout', 'StyleButtonPressedStyleIndex', StyleButtonPressed.Index); + if StyleDropTargetGroup <> nil then + WriteInteger('Layout', 'StyleDropTargetGroupStyleIndex', StyleDropTargetGroup.Index); + if StyleDropTargetLink <> nil then + WriteInteger('Layout', 'StyleDropTargetLinkStyleIndex', StyleDropTargetLink.Index); + if StyleHint <> nil then + WriteInteger('Layout', 'StyleHintStyleIndex', StyleHint.Index); + if StyleNavigationPaneHeader <> nil then + WriteInteger('Layout', 'StyleNavigationPaneHeaderStyleIndex', StyleNavigationPaneHeader.Index); + end; + WriteInteger('Layout', 'ActiveGroup', ActiveGroupIndex); + WriteInteger('Layout', 'NavigationPaneMaxVisibleGroups', NavigationPaneMaxVisibleGroups); + end; +end; + +function TdxCustomNavBar.CreatePainter: TdxNavBarPainter; +begin + Result := dxNavBarViewsFactory.PainterClasses[dxNavBarViewsFactory.IndexOfID(FView)].Create(Self); +end; + +function TdxCustomNavBar.GetAccessibilityHelperClass: TdxNavBarCustomAccessibilityHelperClass; +begin + Result := TdxNavBarAccessibilityHelper; +end; + +function TdxCustomNavBar.GetGroupClass: TdxNavBarGroupClass; +begin + Result := TdxNavBarGroup; +end; + +function TdxCustomNavBar.GetItemClass: TdxNavBarItemClass; +begin + Result := TdxNavBarItem; +end; + +function TdxCustomNavBar.IsCollapsed: Boolean; +begin + Result := OptionsBehavior.NavigationPane.Collapsed and ViewInfo.CanCollapse; +end; + +function TdxCustomNavBar.IsInternal: Boolean; +begin + Result := False; +end; + +function TdxCustomNavBar.GetController: TdxNavBarController; +begin + Result := Painter.Controller; +end; + +function TdxCustomNavBar.GetPainter: TdxNavBarPainter; +begin + if FPainter = nil then + FPainter := CreatePainter; + Result := FPainter; +end; + +function TdxCustomNavBar.GetViewInfo: TdxNavBarViewInfo; +begin + if Painter <> nil then + Result := Painter.ViewInfo + else + Result := nil; +end; + +function TdxCustomNavBar.GetActiveGroup: TdxNavBarGroup; +var + I: Integer; + AGroup: TdxNavBarGroup; +begin + if (Groups = nil) or (Groups.Count = 0) then + Result := nil + else if (FActiveGroup = nil) or not FActiveGroup.Visible then + begin + AGroup := nil; + for I := 0 to Groups.Count - 1 do + if Groups[I].Visible then + begin + AGroup := Groups[I]; + break; + end; + if FActiveGroup = nil then + FActiveGroup := AGroup; + Result := AGroup; + end + else Result := FActiveGroup; +end; + +function TdxCustomNavBar.GetActiveGroupIndex: Integer; +begin + if ActiveGroup <> nil then + Result := ActiveGroup.Index + else Result := -1; +end; + +function TdxCustomNavBar.GetNavigationPaneOverflowPanelItemCount: Integer; +begin + if csLoading in ComponentState then + Result := 0 + else + if NavigationPaneMaxVisibleGroups = -1 then + Result := 0 + else + Result := Max(0, VisibleGroupCount - NavigationPaneMaxVisibleGroups); +end; + +function TdxCustomNavBar.GetEnableDragging: Boolean; +begin + Result := (dxNavBarDragObject <> nil) or (nbisDragging in FInternalState); +end; + +function TdxCustomNavBar.GetIAccessibilityHelper: IdxNavBarAccessibilityHelper; +begin +// Requires + Assert(not (IsDestroying and (FIAccessibilityHelper = nil))); +// + if FIAccessibilityHelper = nil then + FIAccessibilityHelper := NavBarGetAccessibilityHelper( + GetAccessibilityHelperClass.Create(Self, Self)); + Result := FIAccessibilityHelper; +end; + +function TdxCustomNavBar.GetScrollPosition: Integer; +begin + if (FScrollBar <> nil) and FScrollBar.Visible then + Result := FScrollBar.Position + else Result := 0; +end; + +function TdxCustomNavBar.GetSourceGroup: TdxNavBarGroup; +begin + if EnableDragging and (dxNavBarDragObject <> nil) then + Result := dxNavBarDragObject.SourceGroup + else Result := FSourceGroup; +end; + +function TdxCustomNavBar.GetSourceLink: TdxNavBarItemLink; +begin + if EnableDragging and (dxNavBarDragObject <> nil) then + Result := dxNavBarDragObject.SourceLink + else Result := FSourceLink; +end; + +function TdxCustomNavBar.GetSourceItem: TdxNavBarItem; +begin + if EnableDragging and (dxNavBarDragObject <> nil) then + Result := dxNavBarDragObject.SourceItem + else Result := nil; +end; + +function TdxCustomNavBar.GetTargetGroup: TdxNavBarGroup; +begin + if dxNavBarDragObject <> nil then + Result := dxNavBarDragObject.TargetGroup + else Result := nil; +end; + +function TdxCustomNavBar.GetTargetLink1: TdxNavBarItemLink; +begin + if dxNavBarDragObject <> nil then + Result := dxNavBarDragObject.TargetLink1 + else Result := nil; +end; + +function TdxCustomNavBar.GetTargetLink2: TdxNavBarItemLink; +begin + if dxNavBarDragObject <> nil then + Result := dxNavBarDragObject.TargetLink2 + else Result := nil; +end; + +function TdxCustomNavBar.GetTargetLinkIndex: Integer; +begin + if dxNavBarDragObject <> nil then + Result := dxNavBarDragObject.TargetLinkIndex + else Result := -1; +end; + +function TdxCustomNavBar.GetVisibleGroupCount: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Groups.Count - 1 do + if Groups[I].Visible then Inc(Result); +end; + +procedure TdxCustomNavBar.SetActiveGroup(Value: TdxNavBarGroup); +var + AAllowChanging: Boolean; +begin + if FActiveGroup <> Value then + begin + AAllowChanging := True; + DoActiveGroupChanging(Value, AAllowChanging); + if AAllowChanging then + begin + FActiveGroup := Value; + InvalidateAll(doRecreate); + DoActiveGroupChanged; + end; + end; +end; + +procedure TdxCustomNavBar.SetActiveGroupIndex(Value: Integer); +begin + if not (csLoading in ComponentState) then + begin + if (0 <= Value) and (Value < Groups.Count) then + ActiveGroup := Groups[Value]; + end + else FActiveGroupIndex := Value; +end; + +procedure TdxCustomNavBar.SetBorderStyle(const Value: TBorderStyle); +begin + if BorderStyle <> Value then + begin + FBorderStyle := Value; + RecreateWnd; + end; +end; + +procedure TdxCustomNavBar.SetFocusedAccessibleObject( + Value: IdxNavBarAccessibilityHelper); + + function GetAccessibilityHelper( + AAccessibleObject: IdxNavBarAccessibilityHelper): TdxNavBarAccessibilityHelper; + begin + if AAccessibleObject <> nil then + Result := TdxNavBarAccessibilityHelper(AAccessibleObject.GetHelper) + else + Result := nil; + end; + +var + APrevFocusedAccessibleObject: IdxNavBarAccessibilityHelper; +begin + if GetAccessibilityHelper(FFocusedAccessibleObject) <> + GetAccessibilityHelper(Value) then + begin + APrevFocusedAccessibleObject := FFocusedAccessibleObject; + FFocusedAccessibleObject := Value; + if APrevFocusedAccessibleObject <> nil then + APrevFocusedAccessibleObject.FocusedChanged(True); + if FFocusedAccessibleObject <> nil then + FFocusedAccessibleObject.FocusedChanged(True); + end; +end; + +function TdxCustomNavBar.GetDragCopyCursor: TCursor; +begin + Result := Cursors.DragCopyCursor; +end; + +function TdxCustomNavBar.GetHotTrackedGroupCursor: TCursor; +begin + Result := Cursors.HotTrackedGroupCursor; +end; + +function TdxCustomNavBar.GetHotTrackedLinkCursor: TCursor; +begin + Result := Cursors.HotTrackedLinkCursor; +end; + +procedure TdxCustomNavBar.SetCursors(Value: TdxNavBarCursors); +begin + FCursors.Assign(Value); +end; + +procedure TdxCustomNavBar.SetDragCopyCursor(Value: TCursor); +begin + Cursors.DragCopyCursor := Value; +end; + +procedure TdxCustomNavBar.SetHotTrackedGroupCursor(Value: TCursor); +begin + Cursors.HotTrackedGroupCursor := Value; +end; + +procedure TdxCustomNavBar.SetHotTrackedLinkCursor(Value: TCursor); +begin + Cursors.HotTrackedLinkCursor := Value; +end; + +function TdxCustomNavBar.GetNavigationPaneMaxVisibleGroups: Integer; +begin + Result := OptionsView.NavigationPane.MaxVisibleGroups; +end; + +function TdxCustomNavBar.GetNavigationPaneOverflowPanelUseSmallImages: Boolean; +begin + Result := OptionsView.NavigationPane.OverflowPanelUseSmallImages; +end; + +function TdxCustomNavBar.GetShowNavigationPaneOverflowPanelHints: Boolean; +begin + Result := OptionsBehavior.NavigationPane.ShowOverflowPanelHints; +end; + +procedure TdxCustomNavBar.SetNavigationPaneMaxVisibleGroups(Value: Integer); +begin + OptionsView.NavigationPane.MaxVisibleGroups := Value; +end; + +procedure TdxCustomNavBar.SetNavigationPaneOverflowPanelUseSmallImages(const Value: Boolean); +begin + OptionsView.NavigationPane.OverflowPanelUseSmallImages := Value; +end; + +procedure TdxCustomNavBar.SetShowNavigationPaneOverflowPanelHints(const Value: Boolean); +begin + OptionsBehavior.NavigationPane.ShowOverflowPanelHints := Value; +end; + +function TdxCustomNavBar.GetDragDropFlags: TdxNavBarDragDropFlags; +begin + Result := OptionsBehavior.Common.DragDropFlags; +end; + +function TdxCustomNavBar.GetShowGroupsHint: Boolean; +begin + Result := OptionsBehavior.Common.ShowGroupsHint; +end; + +function TdxCustomNavBar.GetShowLinksHint: Boolean; +begin + Result := OptionsBehavior.Common.ShowLinksHint; +end; + +procedure TdxCustomNavBar.SetOptionsBehavior(Value: TdxNavBarBehaviorOptions); +begin + FOptionsBehavior.Assign(Value); +end; + +procedure TdxCustomNavBar.SetDragDropFlags(Value: TdxNavBarDragDropFlags); +begin + OptionsBehavior.Common.DragDropFlags := Value; +end; + +procedure TdxCustomNavBar.SetShowGroupsHint(const Value: Boolean); +begin + OptionsBehavior.Common.ShowGroupsHint := Value; +end; + +procedure TdxCustomNavBar.SetShowLinksHint(const Value: Boolean); +begin + OptionsBehavior.Common.ShowLinksHint := Value; +end; + +function TdxCustomNavBar.GetViewStyle: TdxNavBarPainter; +begin + Result := FPainter; +end; + +procedure TdxCustomNavBar.SetView(Value: Integer); +begin + if FView <> Value then + begin + if not dxNavBarViewsFactory.IsViewRegistered(Value) then + Value := dxNavBarViewsFactory.IDs[dxNavBarViewsFactory.Count - 1]; + FView := Value; + ViewStyle := CreatePainter; + end; +end; + +procedure TdxCustomNavBar.SetViewStyle(Value: TdxNavBarPainter); +begin + if Value <> nil then + begin + FreeAndNil(FPainter); + FPainter := Value; + if ScrollBar <> nil then + ScrollBar.Visible := False; + AssignDefaultStyles; + InvalidateAll(doRecreate); + DoUpdateScrollBarStyle; + end; +end; + +procedure TdxCustomNavBar.SetOptionsView(Value: TdxNavBarViewOptions); +begin + FOptionsView.Assign(Value); +end; + +function TdxCustomNavBar.GetShowGroupCaptions: Boolean; +begin + Result := OptionsView.Common.ShowGroupCaptions; +end; + +procedure TdxCustomNavBar.SetShowGroupCaptions(Value: Boolean); +begin + OptionsView.Common.ShowGroupCaptions := Value; +end; + +function TdxCustomNavBar.GetShowSpecialGroup: Boolean; +begin + Result := OptionsView.ExplorerBar.ShowSpecialGroup; +end; + +function TdxCustomNavBar.GetSpaceBetweenGroups: Integer; +begin + Result := OptionsView.ExplorerBar.SpaceBetweenGroups; +end; + +procedure TdxCustomNavBar.SetShowSpecialGroup(const Value: Boolean); +begin + OptionsView.ExplorerBar.ShowSpecialGroup := Value; +end; + +procedure TdxCustomNavBar.SetSpaceBetweenGroups(Value: Integer); +begin + OptionsView.ExplorerBar.SpaceBetweenGroups := Value; +end; + +function TdxCustomNavBar.GetAllowSelectLinks: Boolean; +begin + Result := OptionsBehavior.SideBar.AllowSelectLinks; +end; + +function TdxCustomNavBar.GetEachGroupHasSelectedLink: Boolean; +begin + Result := OptionsBehavior.SideBar.EachGroupHasSelectedLink; +end; + +procedure TdxCustomNavBar.SetAllowSelectLinks(const Value: Boolean); +begin + OptionsBehavior.SideBar.AllowSelectLinks := Value; +end; + +procedure TdxCustomNavBar.SetEachGroupHasSelectedLink(const Value: Boolean); +begin + OptionsBehavior.SideBar.EachGroupHasSelectedLink := Value; +end; + +function TdxCustomNavBar.GetLargeImages: TCustomImageList; +begin + Result := OptionsImage.LargeImages; +end; + +function TdxCustomNavBar.GetSmallImages: TCustomImageList; +begin + Result := OptionsImage.SmallImages; +end; + +procedure TdxCustomNavBar.SetOptionsImage(Value: TdxNavBarImageOptions); +begin + FOptionsImage.Assign(Value); +end; + +procedure TdxCustomNavBar.SetLargeImages(const Value: TCustomImageList); +begin + OptionsImage.LargeImages := Value; +end; + +procedure TdxCustomNavBar.SetSmallImages(const Value: TCustomImageList); +begin + OptionsImage.SmallImages := Value; +end; + +function TdxCustomNavBar.GetOnCustomDrawBackground: TdxNavBarCustomDrawEvent; +begin + Result := OnCustomDraw.Background; +end; + +function TdxCustomNavBar.GetOnCustomDrawBottomScrollButton: TdxNavBarCustomDrawEvent; +begin + Result := OnCustomDraw.BottomScrollButton; +end; + +function TdxCustomNavBar.GetOnCustomDrawGroupCaption: TdxNavBarCustomDrawGroupEvent; +begin + Result := OnCustomDraw.GroupCaption; +end; + +function TdxCustomNavBar.GetOnCustomDrawGroupClientBackground: TdxNavBarCustomDrawGroupEvent; +begin + Result := OnCustomDraw.GroupClientBackground; +end; + +function TdxCustomNavBar.GetOnCustomDrawGroupClientForeground: TdxNavBarCustomDrawGroupEvent; +begin + Result := OnCustomDraw.GroupClientForeground; +end; + +function TdxCustomNavBar.GetOnCustomDrawGroupHint: TdxNavBarCustomDrawGroupHintEvent; +begin + Result := OnCustomDraw.GroupHint; +end; + +function TdxCustomNavBar.GetOnCustomDrawLink: TdxNavBarCustomDrawLinkEvent; +begin + Result := OnCustomDraw.Link; +end; + +function TdxCustomNavBar.GetOnCustomDrawLinkHint: TdxNavBarCustomDrawLinkHintEvent; +begin + Result := OnCustomDraw.LinkHint; +end; + +function TdxCustomNavBar.GetOnCustomDrawNavigationPaneHeader: TdxNavBarCustomDrawEvent; +begin + Result := OnCustomDraw.NavigationPaneHeader; +end; + +function TdxCustomNavBar.GetOnCustomDrawNavigationPaneOverflowPanel: TdxNavBarCustomDrawEvent; +begin + Result := OnCustomDraw.NavigationPaneOverflowPanel; +end; + +function TdxCustomNavBar.GetOnCustomDrawNavigationPaneOverflowPanelHint: TdxNavBarCustomDrawGroupHintEvent; +begin + Result := OnCustomDraw.NavigationPaneOverflowPanelHint; +end; + +function TdxCustomNavBar.GetOnCustomDrawNavigationPaneSplitter: TdxNavBarCustomDrawEvent; +begin + Result := OnCustomDraw.NavigationPaneSplitter; +end; + +function TdxCustomNavBar.GetOnCustomDrawTopScrollButton: TdxNavBarCustomDrawEvent; +begin + Result := OnCustomDraw.TopScrollButton; +end; + +procedure TdxCustomNavBar.SetOnCustomDraw(Value: TdxNavBarCustomDrawEvents); +begin + FOnCustomDraw.Assign(Value); +end; + +procedure TdxCustomNavBar.SetOnCustomDrawBackground( + const Value: TdxNavBarCustomDrawEvent); +begin + OnCustomDraw.Background := Value; +end; + +procedure TdxCustomNavBar.SetOnCustomDrawBottomScrollButton( + const Value: TdxNavBarCustomDrawEvent); +begin + OnCustomDraw.BottomScrollButton := Value; +end; + +procedure TdxCustomNavBar.SetOnCustomDrawGroupCaption( + const Value: TdxNavBarCustomDrawGroupEvent); +begin + OnCustomDraw.GroupCaption := Value; +end; + +procedure TdxCustomNavBar.SetOnCustomDrawGroupClientBackground( + const Value: TdxNavBarCustomDrawGroupEvent); +begin + OnCustomDraw.GroupClientBackground := Value; +end; + +procedure TdxCustomNavBar.SetOnCustomDrawGroupClientForeground( + const Value: TdxNavBarCustomDrawGroupEvent); +begin + OnCustomDraw.GroupClientForeground := Value; +end; + +procedure TdxCustomNavBar.SetOnCustomDrawGroupHint( + const Value: TdxNavBarCustomDrawGroupHintEvent); +begin + OnCustomDraw.GroupHint := Value; +end; + +procedure TdxCustomNavBar.SetOnCustomDrawLink( + const Value: TdxNavBarCustomDrawLinkEvent); +begin + OnCustomDraw.Link := Value; +end; + +procedure TdxCustomNavBar.SetOnCustomDrawLinkHint( + const Value: TdxNavBarCustomDrawLinkHintEvent); +begin + OnCustomDraw.LinkHint := Value; +end; + +procedure TdxCustomNavBar.SetOnCustomDrawNavigationPaneHeader( + const Value: TdxNavBarCustomDrawEvent); +begin + OnCustomDraw.NavigationPaneHeader := Value; +end; + +procedure TdxCustomNavBar.SetOnCustomDrawNavigationPaneOverflowPanel( + const Value: TdxNavBarCustomDrawEvent); +begin + OnCustomDraw.NavigationPaneOverflowPanel := Value; +end; + +procedure TdxCustomNavBar.SetOnCustomDrawNavigationPaneOverflowPanelHint( + const Value: TdxNavBarCustomDrawGroupHintEvent); +begin + OnCustomDraw.NavigationPaneOverflowPanelHint := Value; +end; + +procedure TdxCustomNavBar.SetOnCustomDrawNavigationPaneSplitter( + const Value: TdxNavBarCustomDrawEvent); +begin + OnCustomDraw.NavigationPaneSplitter := Value; +end; + +procedure TdxCustomNavBar.SetOnCustomDrawTopScrollButton( + const Value: TdxNavBarCustomDrawEvent); +begin + OnCustomDraw.TopScrollButton := Value; +end; + +function TdxCustomNavBar.GetDefaultStyles: TdxNavBarDefaultStyles; +begin + Result := OptionsStyle.DefaultStyles; +end; + +function TdxCustomNavBar.GetNavBarCustomStyle(Index: Integer): TdxNavBarStyleItem; +begin + Result := OptionsStyle.CustomStyles.Styles[Index]; +end; + +function TdxCustomNavBar.GetStyles: TdxNavBarStyleRepository; +begin + Result := OptionsStyle.CustomStyleRepository; +end; + +procedure TdxCustomNavBar.SetDefaultStyles(Value: TdxNavBarDefaultStyles); +begin + OptionsStyle.DefaultStyles := Value; +end; + +procedure TdxCustomNavBar.SetNavBarCustomStyle(Index: Integer; const Value: TdxNavBarStyleItem); +begin + OptionsStyle.CustomStyles.Styles[Index] := Value; +end; + +procedure TdxCustomNavBar.SetOptionsStyle(Value: TdxNavBarStyleOptions); +begin + FOptionsStyle.Assign(Value); +end; + +procedure TdxCustomNavBar.AssignDefaultStyles; +begin + if csLoading in ComponentState then exit; + DefaultStyles.AssignDefaultValues(False); + InvalidateAll(doRecalc); +end; + +procedure TdxCustomNavBar.LoadFromIniFile(AFileName: string; LoadStyles: Boolean = True); +var + AStream: TFileStream; +begin + if AFileName = '' then exit; +{$IFDEF DELPHI6} + AStream := TFileStream.Create(AFileName, fmOpenRead, fmShareDenyWrite); +{$ELSE} + AStream := TFileStream.Create(AFileName, fmOpenRead or fmShareDenyWrite); +{$ENDIF} + try + LoadFromStream(AStream, LoadStyles); + finally + AStream.Free; + end; +end; + +procedure TdxCustomNavBar.LoadFromRegistry(ARegistryPath: string; LoadStyles: Boolean = True); +var + Storage: TRegistryIniFile; +begin + if ARegistryPath = '' then exit; + Storage := TRegistryIniFile.Create(ARegistryPath); + try + LoadFromRegIni(Storage, LoadStyles); + finally + Storage.Free; + end; +end; + +procedure TdxCustomNavBar.LoadFromStream(AStream: TStream; LoadStyles: Boolean = True); +var + Storage: TMemIniFile; + AStrings: TStringList; +begin + Storage := TMemIniFile.Create(''); + AStrings := TStringList.Create; + try + AStrings.LoadFromStream(AStream); + Storage.SetStrings(AStrings); + LoadFromRegIni(Storage, LoadStyles); + finally + AStrings.Free; + Storage.Free; + end; +end; + +procedure TdxCustomNavBar.SaveToIniFile(AFileName: string; SaveStyles: Boolean = True); +var + AStream: TFileStream; +begin + if AFileName = '' then Exit; +{$IFDEF DELPHI6} + AStream := TFileStream.Create(AFileName, fmCreate, fmShareExclusive); +{$ELSE} + AStream := TFileStream.Create(AFileName, fmCreate or fmShareExclusive); +{$ENDIF} + try + SaveToStream(AStream, SaveStyles); + finally + AStream.Free; + end; +end; + +procedure TdxCustomNavBar.SaveToRegistry(ARegistryPath: string; SaveStyles: Boolean = True); +var + Storage: TRegistryIniFile; +begin + if ARegistryPath = '' then exit; + Storage := TRegistryIniFile.Create(ARegistryPath); + try + SaveToRegIni(Storage, SaveStyles); + finally + Storage.Free; + end; +end; + +procedure TdxCustomNavBar.SaveToStream(AStream: TStream; SaveStyles: Boolean = True); +var + Storage: TMemIniFile; + AStrings: TStringList; +begin + Storage := TMemIniFile.Create(''); + AStrings := TStringList.Create; + try + SaveToRegIni(Storage, SaveStyles); + Storage.GetStrings(AStrings); + AStrings.SaveToStream(AStream); + finally + AStrings.Free; + Storage.Free; + end; +end; + +function TdxCustomNavBar.GetGroupAtCaptionPos(const pt: TPoint): TdxNavBarGroup; +begin + Result := ViewInfo.GetGroupAtCaptionPos(pt); +end; + +function TdxCustomNavBar.GetGroupAtItemsPos(const pt: TPoint): TdxNavBarGroup; +begin + Result := ViewInfo.GetGroupAtItemsPos(pt); +end; + +function TdxCustomNavBar.GetLinkAtPos(const pt: TPoint): TdxNavBarItemLink; +begin + Result := ViewInfo.GetLinkAtPos(pt); +end; + +function TdxCustomNavBar.IsPtGroupDesignRect(const pt: TPoint): Boolean; +begin + Result := ViewInfo.IsPtGroupDesignRect(pt); +end; + +function TdxCustomNavBar.IsPtItemDesignRect(const pt: TPoint): Boolean; +begin + Result := ViewInfo.IsPtItemDesignRect(pt); +end; + +function TdxCustomNavBar.GetLinkAtSelectedPos(const pt: TPoint): TdxNavBarItemLink; +begin + Result := ViewInfo.GetLinkAtSelectedPos(pt); +end; + +function TdxCustomNavBar.IsPtTopScrollButton(const pt: TPoint): Boolean; +begin + Result := ViewInfo.IsPtTopScrollButton(pt); +end; + +function TdxCustomNavBar.IsPtBottomScrollButton(const pt: TPoint): Boolean; +begin + Result := ViewInfo.IsPtBottomScrollButton(pt); +end; + +function TdxCustomNavBar.IsTopScrollButtonVisible: Boolean; +begin + Result := ViewInfo.IsTopScrollButtonVisible; +end; + +function TdxCustomNavBar.IsBottomScrollButtonVisible: Boolean; +begin + Result := ViewInfo.IsBottomScrollButtonVisible; +end; + +procedure TdxCustomNavBar.MakeLinkVisible(ALink: TdxNavBarItemLink); +begin + ViewInfo.MakeLinkVisible(ALink); +end; + +procedure TdxCustomNavBar.MakeGroupVisible(AGroup: TdxNavBarGroup); +begin + ViewInfo.MakeGroupVisible(AGroup); +end; + +procedure TdxCustomNavBar.BeginUpdate; +begin + Inc(FUpdateLock); +end; + +procedure TdxCustomNavBar.EndUpdate; +begin + Dec(FUpdateLock); + if FUpdateLock = 0 then InvalidateAll(doRecreate); +end; + +function TdxCustomNavBar.CanDecNavigationPaneOverflowPanelItemCount: Boolean; +begin + Result := ShowGroupCaptions and (NavigationPaneOverflowPanelItemCount > 0); +end; + +function TdxCustomNavBar.CanIncNavigationPaneOverflowPanelItemCount: Boolean; +begin + Result := ShowGroupCaptions and (NavigationPaneOverflowPanelItemCount < VisibleGroupCount); +end; + +procedure TdxCustomNavBar.DoDecNavigationPaneOverflowPanelItemCount; +begin + if NavigationPaneMaxVisibleGroups = VisibleGroupCount - 1 then + NavigationPaneMaxVisibleGroups := -1 + else + NavigationPaneMaxVisibleGroups := NavigationPaneMaxVisibleGroups + 1; +end; + +procedure TdxCustomNavBar.DoIncNavigationPaneOverflowPanelItemCount; +begin + if (NavigationPaneMaxVisibleGroups = -1) or + (NavigationPaneMaxVisibleGroups > VisibleGroupCount) then + NavigationPaneMaxVisibleGroups := VisibleGroupCount - 1 + else + NavigationPaneMaxVisibleGroups := NavigationPaneMaxVisibleGroups - 1; +end; + +procedure TdxCustomNavBar.DragDone; +begin + dxNavBarDragObject.Free; + dxNavBarDragObject := nil; + Exclude(FInternalState, nbisDragging); + DragMode := dmManual; + FSourceGroup := nil; + FSourceLink := nil; +end; + +function TdxCustomNavBar.IsAllowDragLink: Boolean; +begin + Result := fAllowDragLink in DragDropFlags; +end; + +function TdxCustomNavBar.IsAllowDropLink: Boolean; +begin + Result := fAllowDropLink in DragDropFlags; +end; + +function TdxCustomNavBar.IsAllowDragGroup: Boolean; +begin + Result := fAllowDragGroup in DragDropFlags; +end; + +function TdxCustomNavBar.IsAllowDropGroup: Boolean; +begin + Result := fAllowDropGroup in DragDropFlags; +end; + +procedure TdxCustomNavBar.WMCreate(var Msg: TWMCreate); +begin + inherited; + InvalidateAll(doRecreate); +end; + +procedure TdxCustomNavBar.WMGetDlgCode(var Message: TWMGetDlgCode); +begin + inherited; + Message.Result := Message.Result or DLGC_WANTARROWS; +end; + +procedure TdxCustomNavBar.WMSetCursor(var Msg: TWMSetCursor); +var + AIcon: HIcon; +begin + AIcon := Controller.GetCursor; + + if AIcon <> 0 then + SetCursor(AIcon) + else + begin + if FHotTrackedGroup <> nil then + SetCursor(Screen.Cursors[HotTrackedGroupCursor]) + else + if (HotTrackedLink <> nil) then + SetCursor(Screen.Cursors[HotTrackedLinkCursor]) + else + inherited; + end; +end; + +procedure TdxCustomNavBar.WMVScroll(var Message: TWMVScroll); +var + AScrollPos: Integer; +begin + inherited; + AScrollPos := Message.Pos; + ScrollBar.Scroll(ScrollBar, TScrollCode(Message.ScrollCode), AScrollPos); +end; + +procedure TdxCustomNavBar.CMCtl3DChanged(var Message: TMessage); +begin + if NewStyleControls and (BorderStyle = bsSingle) then + RecreateWnd; + inherited; +end; + +procedure TdxCustomNavBar.CMDialogChar(var Message: TCMDialogChar); +var + AGroup: TdxNavBarGroup; + ALink: TdxNavBarItemLink; +begin + if inherited CanFocus then + begin + AGroup := ViewInfo.FindGroupWithAccel(Message.CharCode); + if AGroup <> nil then + begin + DoGroupMouseUp(AGroup); + Message.Result := 1; + end + else + begin + ALink := ViewInfo.FindLinkWithAccel(Message.CharCode); + if (ALink <> nil) and ALink.CanSelect then + begin + DoLinkMouseUp(ALink); + Message.Result := 1; + end + else + inherited; + end; + end; +end; + +procedure TdxCustomNavBar.CMHintShow(var Message: TCMHintShow); +const + AResultMap: array[Boolean] of Integer = (1, 0); +var + ACanShow: Boolean; +begin + Controller.ShowHint(Message.HintInfo^, ACanShow); + Message.Result := AResultMap[ACanShow]; +end; + +procedure TdxCustomNavBar.CMSysColorChange(var Message: TMessage); +begin + ViewInfo.RefreshColors; + InvalidateAll(doRedraw); +end; + +{ TdxNabBarDragObject } + +constructor TdxNavBarDragObject.Create(ANavBar: TdxCustomNavBar; + var DragObject: TDragObject {deprecated}; + ASourceGroup: TdxNavBarGroup; ASourceLink: TdxNavBarItemLink; ASourceItem: TdxNavBarItem); +begin + inherited Create; + FNavBar := ANavBar; + FSourceLink := ASourceLink; + FSourceGroup := ASourceGroup; + FSourceItem := ASourceItem; +end; + +procedure TdxNavBarDragObject.UpdateTargets; +begin + if SourceGroup <> nil then + begin + FTargetGroup := NavBar.ViewInfo.GetGroupAtCaptionPos(NavBar.TargetPoint); + if FTargetGroup = nil then + FTargetGroup := NavBar.ViewInfo.GetGroupAtItemsPos(NavBar.TargetPoint); + end + else if (SourceLink <> nil) or (SourceItem <> nil) then + FTargetLinkIndex := NavBar.ViewInfo.GetLinksAtDragPosition(NavBar.TargetPoint, + FTargetGroup, FTargetLink1, FTargetLink2); +end; + +function TdxNavBarDragObject.GetSourceItem: TdxNavBarItem; +begin + if FSourceItem <> nil then + Result := FSourceItem + else if (GetKeyState(VK_CONTROL) < 0) and (FSourceLink <> nil) then + Result := FSourceLink.Item + else Result := nil; +end; + +{ TdxNavBarScrollBar } + +constructor TdxNavBarScrollBar.Create(AParent: TWinControl; AKind: TScrollBarKind); +begin + inherited Create; + FParent := AParent; + FKind := AKind; + RecreatecxScrollBar; +end; + +destructor TdxNavBarScrollBar.Destroy; +begin + FreeAndNil(FScrollBar); + inherited Destroy; +end; + +procedure TdxNavBarScrollBar.SetScrollParams(AMin, AMax, APosition, APageSize: Integer; ARedraw: + Boolean = True); +var + AClientRect: TRect; +begin + if (AMax < AMin) or (AMax < APageSize) then + raise EInvalidOperation.Create(SScrollBarRange); + + CorrectPos(APosition, AMin, AMax, APageSize); + AClientRect := FParent.ClientRect; + with AClientRect do + if FScrollBar.Kind = sbVertical then + FScrollBar.SetBounds(Right, 0, Self.Width, Bottom - Top) + else + FScrollBar.SetBounds(Left, Bottom, Right - Left, Self.Height); + + if (Min <> AMin) or (Max <> AMax) or (PageSize <> APageSize) or (Position <> APosition) then + begin + FScrollInfo.nMin := AMin; + FScrollInfo.nMax := AMax; + FScrollInfo.nPage := APageSize; + FScrollInfo.nPos := APosition; + with FScrollInfo do + FScrollBar.SetScrollParams(nMin, nMax, APosition, APageSize, ARedraw); + FLargeChange := FScrollInfo.nPage; + end; +end; + +procedure TdxNavBarScrollBar.RecreatecxScrollBar; +begin + FreeAndNil(FScrollBar); + FScrollBar := TdxCustomNavBar(FParent).Painter.CreatecxScrollBar; + FScrollBar.Parent := FParent; + FScrollBar.Kind := FKind; + FScrollBar.OnScroll := Scroll; + Reset; +end; + +procedure TdxNavBarScrollBar.Reset; +begin + ZeroMemory(@FScrollInfo, FScrollInfo.cbSize); + FScrollInfo.cbSize := SizeOf(FScrollInfo); + FScrollInfo.fMask := SIF_ALL; + FScrollInfo.nMax := 100; + FScrollBar.Visible := False; + FVisible := False; +end; + +procedure TdxNavBarScrollBar.Scroll(Sender: TObject; AScrollCode: TScrollCode; var AScrollPos: Integer); + + procedure DoScroll(AScrollCode: TScrollCode; var AScrollPos: Integer); + begin + if Assigned(OnScroll) then + OnScroll(Self, AScrollCode, AScrollPos); + end; + +var + ANewPos: Integer; +begin + ANewPos := Position; + case AScrollCode of + scLineUp: Dec(ANewPos, SmallChange); + scLineDown: Inc(ANewPos, SmallChange); + scPageUp: Dec(ANewPos, LargeChange); + scPageDown: Inc(ANewPos, LargeChange); + scPosition, scTrack: ANewPos := AScrollPos; + scTop: ANewPos := Min; + scBottom: ANewPos := Max; + end; + Position := ANewPos; + AScrollPos := ANewPos; + DoScroll(AScrollCode, AScrollPos); +end; + +procedure TdxNavBarScrollBar.CorrectPos(var APos: Integer; AMin, AMax, APageSize: Integer); +begin + if APos < AMin then + APos := AMin; + if APos > AMax - APageSize then + APos := AMax - APageSize; +end; + +function TdxNavBarScrollBar.GetHandle: THandle; +begin + if FParent.HandleAllocated then + Result := FParent.Handle + else + Result := 0; +end; + +function TdxNavBarScrollBar.GetHeight: Integer; +begin + Result := FParent.ClientHeight; +end; + +function TdxNavBarScrollBar.GetMax: Integer; +begin + Result := FScrollInfo.nMax; +end; + +function TdxNavBarScrollBar.GetMin: Integer; +begin + Result := FScrollInfo.nMin; +end; + +function TdxNavBarScrollBar.GetPageSize: Integer; +begin + Result := FScrollInfo.nPage +end; + +function TdxNavBarScrollBar.GetPosition: Integer; +begin + Result := FScrollInfo.nPos; +end; + +function TdxNavBarScrollBar.GetWidth: Integer; +begin + Result := GetSystemMetrics(SM_CXVSCROLL); +end; + +procedure TdxNavBarScrollBar.SetMax(const Value: Integer); +begin + SetScrollParams(Min, Value, Position, PageSize); +end; + +procedure TdxNavBarScrollBar.SetMin(const Value: Integer); +begin + SetScrollParams(Value, Max, Position, PageSize); +end; + +procedure TdxNavBarScrollBar.SetPageSize(const Value: Integer); +begin + SetScrollParams(Min, Max, Position, Value); +end; + +procedure TdxNavBarScrollBar.SetPosition(const Value: Integer); +begin + SetScrollParams(Min, Max, Value, PageSize); +end; + +procedure TdxNavBarScrollBar.SetVisible(const Value: Boolean); +begin + if FVisible <> Value then + begin + FVisible := Value; + FScrollBar.Visible := Value; + end; +end; + +{ TdxNavBarHintWindow } + +function TdxNavBarHintWindow.CalcHintRect(MaxWidth: Integer; const AHint: string; AData: Pointer): TRect; +var + AHintInfo: THintInfo; +begin + AHintInfo := PHintInfo(AData)^; + FNavBar := TdxCustomNavBar(AHintInfo.HintControl); + Result := FNavBar.ViewInfo.HintRect; +end; + +procedure TdxNavBarHintWindow.Paint; +begin + if FNavBar <> nil then + FNavBar.Painter.DrawHintWindow(Self) + else + inherited Paint; +end; + +initialization + RegisterClasses([TdxNavBar]); + dxNavBarDragObject := nil; + Screen.Cursors[dxNavBarDragCursor] := LoadCursor(HInstance, 'dxNavBarDragCursor'); + Screen.Cursors[dxNavBarDragCopyCursor] := LoadCursor(HInstance, 'dxNavBarDragCopyCursor'); + Screen.Cursors[dxNavBarLinksCursor] := LoadCursor(HInstance, 'dxNavBarLinksCursor'); + +finalization + DestroyCursor(Screen.Cursors[dxNavBarLinksCursor]); + DestroyCursor(Screen.Cursors[dxNavBarDragCopyCursor]); + DestroyCursor(Screen.Cursors[dxNavBarDragCursor]); + +end. diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBar.res b/official/x.35/ExpressNavBar 2/Sources/dxNavBar.res new file mode 100644 index 00000000..c36a8b42 Binary files /dev/null and b/official/x.35/ExpressNavBar 2/Sources/dxNavBar.res differ diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarAccessibility.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarAccessibility.pas new file mode 100644 index 00000000..a79b3459 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarAccessibility.pas @@ -0,0 +1,476 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarAccessibility; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, cxAccessibility, cxClasses, dxNavBar, dxNavBarBase, + dxNavBarCollns; + +type + { TdxNavBarAccessibilityHelper } + + TdxNavBarAccessibilityHelper = class(TdxNavBarCustomAccessibilityHelper) + private + function GetNavBar: TdxCustomNavBar; + protected + function GetChild(AIndex: Integer): TcxAccessibilityHelper; override; + function GetChildCount: Integer; override; + + function GetBounds: TRect; override; + function IsContainer: Boolean; override; + + property NavBar: TdxCustomNavBar read GetNavBar; + end; + + { TdxNavBarGroupAccessibilityHelper } + + TdxNavBarGroupAccessibilityHelper = class(TdxNavBarCustomAccessibilityHelper) + private + function GetGroup: TdxNavBarGroup; + function GetGroupViewInfo: TdxNavBarGroupViewInfo; + function GetNavBar: TdxCustomNavBar; + protected + function GetChild(AIndex: Integer): TcxAccessibilityHelper; override; + function GetChildCount: Integer; override; + function GetParent: TcxAccessibilityHelper; override; + function GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + function GetBounds: TRect; override; + function IsContainer: Boolean; override; + + property Group: TdxNavBarGroup read GetGroup; + property GroupViewInfo: TdxNavBarGroupViewInfo read GetGroupViewInfo; + property NavBar: TdxCustomNavBar read GetNavBar; + end; + + { TdxNavBarGroupCaptionPanelAccessibilityHelper } + + TdxNavBarGroupCaptionPanelAccessibilityHelper = class(TdxNavBarCustomAccessibilityHelper) + private + function GetGroup: TdxNavBarGroup; + protected + function GetParent: TcxAccessibilityHelper; override; + function GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + function CanBeFocusedByDefault: Boolean; override; + procedure Click(AKey: Word); override; + function GetBounds: TRect; override; + function IsClickKey(AKey: Word): Boolean; override; + function IsContainer: Boolean; override; + procedure MakeVisible; override; + + property Group: TdxNavBarGroup read GetGroup; + end; + + { TdxNavBarItemLinkContainerAccessibilityHelper } + + TdxNavBarItemLinkContainerAccessibilityHelper = class(TdxNavBarCustomAccessibilityHelper) + private + function GetGroup: TdxNavBarGroup; + protected + function GetChild(AIndex: Integer): TcxAccessibilityHelper; override; + function GetChildCount: Integer; override; + function GetParent: TcxAccessibilityHelper; override; + function GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + function GetBounds: TRect; override; + function IsContainer: Boolean; override; + function IsScrollable( + out AInvisiblePartHeight, AChildMinTopScreenBound: Integer): Boolean; override; + + property Group: TdxNavBarGroup read GetGroup; + end; + + { TdxNavBarItemLinkAccessibilityHelper } + + TdxNavBarItemLinkAccessibilityHelper = class(TdxNavBarCustomAccessibilityHelper) + private + function GetLink: TdxNavBarItemLink; + function GetLinkViewInfo: TdxNavBarLinkViewInfo; + protected + function GetParent: TcxAccessibilityHelper; override; + function GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + // IdxNavBarAccessibilityHelper + procedure RemoveFocus; override; + + function CanBeFocusedByDefault: Boolean; override; + procedure Click(AKey: Word); override; + function GetBounds: TRect; override; + function IsClickKey(AKey: Word): Boolean; override; + function IsContainer: Boolean; override; + procedure MakeVisible; override; + + property Link: TdxNavBarItemLink read GetLink; + property LinkViewInfo: TdxNavBarLinkViewInfo read GetLinkViewInfo; + end; + +implementation + +uses + Math, Types, cxGraphics, cxGeometry; + +type + TdxCustomNavBarAccess = class(TdxCustomNavBar); + TdxNavBarViewInfoAccess = class(TdxNavBarViewInfo); + +function GetWindowClientOrigin(AWnd: HWND): TPoint; +begin + Result := cxNullPoint; + ClientToScreen(AWnd, Result); +end; + +{ TdxNavBarAccessibilityHelper } + +function TdxNavBarAccessibilityHelper.GetChild( + AIndex: Integer): TcxAccessibilityHelper; +begin + if AIndex < inherited GetChildCount then + Result := inherited GetChild(AIndex) + else + Result := NavBar.Groups[AIndex - inherited GetChildCount].IAccessibilityHelper.GetHelper; +end; + +function TdxNavBarAccessibilityHelper.GetChildCount: Integer; +begin + Result := inherited GetChildCount + NavBar.Groups.Count; +end; + +function TdxNavBarAccessibilityHelper.GetBounds: TRect; +begin + GetWindowRect(OwnerObjectWindow, Result); + Result := cxRectOffset(Result, cxPointInvert(OwnerObjectControl.ClientOrigin)); +end; + +function TdxNavBarAccessibilityHelper.IsContainer: Boolean; +begin + Result := True; +end; + +function TdxNavBarAccessibilityHelper.GetNavBar: TdxCustomNavBar; +begin + Result := TdxCustomNavBar(FOwnerObject); +end; + +{ TdxNavBarGroupAccessibilityHelper } + +function TdxNavBarGroupAccessibilityHelper.GetChild( + AIndex: Integer): TcxAccessibilityHelper; +begin + if AIndex < inherited GetChildCount then + Result := inherited GetChild(AIndex) + else + begin + Dec(AIndex, inherited GetChildCount); + // Requires + Assert(AIndex < 2); + // + if AIndex = 0 then + Result := Group.CaptionPanelIAccessibilityHelper.GetHelper + else + Result := Group.LinkContainerIAccessibilityHelper.GetHelper; + end; +end; + +function TdxNavBarGroupAccessibilityHelper.GetChildCount: Integer; +begin + Result := inherited GetChildCount + 2; +end; + +function TdxNavBarGroupAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := NavBar.IAccessibilityHelper.GetHelper; +end; + +function TdxNavBarGroupAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := Parent.States[cxAccessibleObjectSelfID]; + if not Group.Visible or (GroupViewInfo = nil) then + Result := Result or cxSTATE_SYSTEM_INVISIBLE; +end; + +function TdxNavBarGroupAccessibilityHelper.GetBounds: TRect; +begin + Result := GroupViewInfo.Rect; +end; + +function TdxNavBarGroupAccessibilityHelper.IsContainer: Boolean; +begin + Result := True; +end; + +function TdxNavBarGroupAccessibilityHelper.GetGroup: TdxNavBarGroup; +begin + Result := TdxNavBarGroup(FOwnerObject); +end; + +function TdxNavBarGroupAccessibilityHelper.GetNavBar: TdxCustomNavBar; +begin + Result := TdxCustomNavBar(OwnerObjectControl); +end; + +function TdxNavBarGroupAccessibilityHelper.GetGroupViewInfo: TdxNavBarGroupViewInfo; +begin + Result := NavBar.ViewInfo.GetGroupViewInfoByGroup(Group); +end; + +{ TdxNavBarGroupCaptionPanelAccessibilityHelper } + +function TdxNavBarGroupCaptionPanelAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := Group.IAccessibilityHelper.GetHelper; +end; + +function TdxNavBarGroupCaptionPanelAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := Parent.States[cxAccessibleObjectSelfID]; + if (Result and cxSTATE_SYSTEM_INVISIBLE = 0) and + not (Parent as TdxNavBarGroupAccessibilityHelper).GroupViewInfo.IsCaptionVisible then + Result := Result or cxSTATE_SYSTEM_INVISIBLE; +end; + +function TdxNavBarGroupCaptionPanelAccessibilityHelper.CanBeFocusedByDefault: Boolean; +begin + Result := True; +end; + +procedure TdxNavBarGroupCaptionPanelAccessibilityHelper.Click(AKey: Word); +var + ACanNavBarHasActiveGroup: Boolean; +begin + inherited Click(AKey); + ACanNavBarHasActiveGroup := TdxNavBarViewInfoAccess(TdxCustomNavBar( + OwnerObjectControl).ViewInfo).CanHasActiveGroup; + if ACanNavBarHasActiveGroup then + TdxCustomNavBarAccess(OwnerObjectControl).DoGroupMouseUp(Group) + else + if AKey in [VK_ADD, VK_SUBTRACT] then + Group.Expanded := AKey = VK_ADD + else + Group.Expanded := not Group.Expanded; +end; + +function TdxNavBarGroupCaptionPanelAccessibilityHelper.GetBounds: TRect; +begin + Result := (Parent as TdxNavBarGroupAccessibilityHelper).GroupViewInfo.CaptionRect; +end; + +function TdxNavBarGroupCaptionPanelAccessibilityHelper.IsClickKey( + AKey: Word): Boolean; +var + ACanNavBarHasActiveGroup: Boolean; +begin + Result := inherited IsClickKey(AKey); + if Result then + Exit; + ACanNavBarHasActiveGroup := TdxNavBarViewInfoAccess(TdxCustomNavBar( + OwnerObjectControl).ViewInfo).CanHasActiveGroup; + if ACanNavBarHasActiveGroup then + Result := AKey in [VK_RETURN, VK_SPACE] + else + Result := Group.Expandable and (AKey in [VK_ADD, VK_SPACE, VK_SUBTRACT]); +end; + +function TdxNavBarGroupCaptionPanelAccessibilityHelper.IsContainer: Boolean; +begin + Result := False; +end; + +procedure TdxNavBarGroupCaptionPanelAccessibilityHelper.MakeVisible; +begin + TdxNavBarViewInfoAccess(TdxCustomNavBar( + OwnerObjectControl).ViewInfo).MakeGroupVisible(Group, False, False); +end; + +function TdxNavBarGroupCaptionPanelAccessibilityHelper.GetGroup: TdxNavBarGroup; +begin + Result := TdxNavBarGroup(FOwnerObject); +end; + +{ TdxNavBarItemLinkContainerAccessibilityHelper } + +function TdxNavBarItemLinkContainerAccessibilityHelper.GetChild( + AIndex: Integer): TcxAccessibilityHelper; +begin + if AIndex < inherited GetChildCount then + Result := inherited GetChild(AIndex) + else + Result := Group.Links[AIndex - inherited GetChildCount].IAccessibilityHelper.GetHelper; +end; + +function TdxNavBarItemLinkContainerAccessibilityHelper.GetChildCount: Integer; +begin + Result := inherited GetChildCount + Group.LinkCount; +end; + +function TdxNavBarItemLinkContainerAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := Group.IAccessibilityHelper.GetHelper; +end; + +function TdxNavBarItemLinkContainerAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := Parent.States[cxAccessibleObjectSelfID]; + if (Result and cxSTATE_SYSTEM_INVISIBLE = 0) and ( + not TdxNavBarGroupAccessibilityHelper(Parent).GroupViewInfo.IsItemsVisible or + Group.UseControl and Group.ShowControl + ) then + Result := Result or cxSTATE_SYSTEM_INVISIBLE; +end; + +function TdxNavBarItemLinkContainerAccessibilityHelper.GetBounds: TRect; +begin + Result := TdxNavBarGroupAccessibilityHelper(Parent).GroupViewInfo.ItemsRect; +end; + +function TdxNavBarItemLinkContainerAccessibilityHelper.IsContainer: Boolean; +begin + Result := True; +end; + +function TdxNavBarItemLinkContainerAccessibilityHelper.IsScrollable( + out AInvisiblePartHeight, AChildMinTopScreenBound: Integer): Boolean; +begin + with TdxCustomNavBar(OwnerObjectControl).ViewInfo do + Result := IsTopScrollButtonVisible or IsBottomScrollButtonVisible; + if Result then + begin + AInvisiblePartHeight := + TdxNavBarItemLinkContainerAccessibilityHelper(Childs[ChildCount - 1]).GetBounds.Bottom - + TdxNavBarItemLinkContainerAccessibilityHelper(Childs[0]).GetBounds.Top - + cxRectHeight(GetBounds); + AChildMinTopScreenBound := TdxNavBarItemLinkContainerAccessibilityHelper( + Childs[0]).GetScreenBounds(cxAccessibleObjectSelfID).Top; + end; +end; + +function TdxNavBarItemLinkContainerAccessibilityHelper.GetGroup: TdxNavBarGroup; +begin + Result := TdxNavBarGroup(FOwnerObject); +end; + +{ TdxNavBarItemLinkAccessibilityHelper } + +function TdxNavBarItemLinkAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := Link.Group.LinkContainerIAccessibilityHelper.GetHelper; +end; + +function TdxNavBarItemLinkAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := Parent.States[cxAccessibleObjectSelfID]; + if (Link.Item = nil) or not Link.CanSelect then + Result := Result or cxSTATE_SYSTEM_UNAVAILABLE; + if (Link.Item <> nil) and not Link.Item.Visible then + Result := Result or cxSTATE_SYSTEM_INVISIBLE; +end; + +procedure TdxNavBarItemLinkAccessibilityHelper.RemoveFocus; +var + AGroupCaptionPanelAccessibilityHelper: TdxNavBarGroupCaptionPanelAccessibilityHelper; +begin + AGroupCaptionPanelAccessibilityHelper := TdxNavBarGroupCaptionPanelAccessibilityHelper( + TdxNavBarItemLinkContainerAccessibilityHelper(Parent).Group.CaptionPanelIAccessibilityHelper.GetHelper); + if AGroupCaptionPanelAccessibilityHelper.CanFocus(True) then + TdxCustomNavBarAccess(OwnerObjectControl).FocusedAccessibleObject := AGroupCaptionPanelAccessibilityHelper + else + inherited RemoveFocus; +end; + +function TdxNavBarItemLinkAccessibilityHelper.CanBeFocusedByDefault: Boolean; +begin + Result := True; +end; + +procedure TdxNavBarItemLinkAccessibilityHelper.Click(AKey: Word); +begin + inherited Click(AKey); + TdxCustomNavBarAccess(OwnerObjectControl).DoLinkMouseUp(Link); +end; + +function TdxNavBarItemLinkAccessibilityHelper.GetBounds: TRect; +begin + if (IsRectEmpty(LinkViewInfo.ImageRect) or cxRectContain(LinkViewInfo.SelectionRect, LinkViewInfo.ImageRect)) and + (IsRectEmpty(LinkViewInfo.CaptionRect) or cxRectContain(LinkViewInfo.SelectionRect, LinkViewInfo.CaptionRect)) then + Result := LinkViewInfo.SelectionRect + else + Result := cxRectUnion(LinkViewInfo.ImageRect, LinkViewInfo.CaptionRect); +end; + +function TdxNavBarItemLinkAccessibilityHelper.IsClickKey( + AKey: Word): Boolean; +begin + Result := inherited IsClickKey(AKey) or (AKey in [VK_RETURN, VK_SPACE]); +end; + +function TdxNavBarItemLinkAccessibilityHelper.IsContainer: Boolean; +begin + Result := False; +end; + +procedure TdxNavBarItemLinkAccessibilityHelper.MakeVisible; +begin + TdxNavBarViewInfoAccess(TdxCustomNavBar(OwnerObjectControl).ViewInfo).MakeLinkVisible(Link, False); +end; + +function TdxNavBarItemLinkAccessibilityHelper.GetLink: TdxNavBarItemLink; +begin + Result := TdxNavBarItemLink(FOwnerObject); +end; + +function TdxNavBarItemLinkAccessibilityHelper.GetLinkViewInfo: TdxNavBarLinkViewInfo; +var + AGroupViewInfo: TdxNavBarGroupViewInfo; +begin + AGroupViewInfo := (Parent.Parent as TdxNavBarGroupAccessibilityHelper).GroupViewInfo; + Result := AGroupViewInfo.GetLinkViewInfoByLink(Link); +// Ensures + Assert(Result <> nil); +end; + +end. + diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarBase.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarBase.pas new file mode 100644 index 00000000..ff724e95 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarBase.pas @@ -0,0 +1,812 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarBase; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, Controls, cxAccessibility, cxClasses; + +type + TdxNavBarCustomAccessibilityHelper = class; + + TdxNavBarNexusPersistent = class(TcxOwnedPersistent) + protected + FNotifyComponent: TcxFreeNotificator; + procedure FreeNotification(AComponent: TComponent); virtual; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + end; + + TdxNavBarChangeType = (doRecreate, doRecalc, doRedraw); + TdxNavBarChangeEvent = procedure(Sender: TObject; AType: TdxNavBarChangeType) of object; + + TdxNavBarComponentCollection = class; + TdxNavBarComponentCollectionItem = class(TcxComponentCollectionItem) + private + function InternalGetCollection: TdxNavBarComponentCollection; + procedure InternalSetCollection(Value: TdxNavBarComponentCollection); + protected + procedure InitiateActions; virtual; + procedure SetIndex(Value: Integer); override; + public + property Collection: TdxNavBarComponentCollection read InternalGetCollection + write InternalSetCollection; + end; + TdxNavBarComponentCollectionItemClass = class of TdxNavBarComponentCollectionItem; + + TdxNavBarComponentCollection = class(TcxComponentCollection) + private + function InternalGetOwner: TComponent; + protected + procedure InitiateActions; virtual; + public + function Add: TdxNavBarComponentCollectionItem; + function ItemByName(const AName: string): TdxNavBarComponentCollectionItem; + property Owner: TComponent read InternalGetOwner; + end; + + IdxNavBarAccessibilityHelper = interface(IcxAccessibilityHelper) + ['{C8DF0BFA-B9C6-4BB8-B377-8E3FAE529855}'] + procedure AttachChild(AChild: IdxNavBarAccessibilityHelper); + function CanFocus(AFocusingByDefault: Boolean): Boolean; + procedure DetachChild(AChild: IdxNavBarAccessibilityHelper); + procedure FocusedChanged(AMakeVisible: Boolean); + function GetNavBarHelper: TdxNavBarCustomAccessibilityHelper; + function GetNextObjectForNavigation( + ADirection: TcxDirection): IdxNavBarAccessibilityHelper; + function IsFocused: Boolean; + function IsPressed: Boolean; + procedure KeyDown(var Key: Word; Shift: TShiftState); + procedure KeyPress(var Key: Char); + procedure KeyUp(var Key: Word; Shift: TShiftState); + procedure RemoveFocus; + end; + + TdxNavBarCustomAccessibilityHelper = class(TcxAccessibilityHelper, + IdxNavBarAccessibilityHelper) + private + FAttachedChildList: TInterfaceList; + FOwnerObjectControl: TWinControl; + FIsPressed: Boolean; + FTag: Integer; + function InternalGetChild(AIndex: Integer): TdxNavBarCustomAccessibilityHelper; + function InternalGetParent: TdxNavBarCustomAccessibilityHelper; + protected + // IcxAccessibilityHelper + procedure OwnerObjectDestroyed; override; + + function GetChild(AIndex: Integer): TcxAccessibilityHelper; override; + function GetChildCount: Integer; override; + function GetOwnerObjectWindow: HWND; override; + function GetScreenBounds( + AChildID: TcxAccessibleSimpleChildElementID): TRect; override; + function GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + // IdxNavBarAccessibilityHelper + procedure AttachChild(AChild: IdxNavBarAccessibilityHelper); + function CanFocus(AFocusingByDefault: Boolean): Boolean; virtual; + procedure DetachChild(AChild: IdxNavBarAccessibilityHelper); + procedure FocusedChanged(AMakeVisible: Boolean); virtual; + function GetNavBarHelper: TdxNavBarCustomAccessibilityHelper; + function GetNextObjectForNavigation( + ADirection: TcxDirection): IdxNavBarAccessibilityHelper; + function IsFocused: Boolean; + function IsPressed: Boolean; + procedure KeyDown(var Key: Word; Shift: TShiftState); virtual; + procedure KeyPress(var Key: Char); virtual; + procedure KeyUp(var Key: Word; Shift: TShiftState); virtual; + procedure RemoveFocus; virtual; + + function CanBeFocusedByDefault: Boolean; virtual; + procedure Click(AKey: Word); virtual; + function GetAssociatedObject: TdxNavBarCustomAccessibilityHelper; virtual; + function GetBounds: TRect; virtual; abstract; + function InternalGetNextObjectForNavigation( + ADirection: TcxDirection): IdxNavBarAccessibilityHelper; virtual; + function IsChild(AChild: TdxNavBarCustomAccessibilityHelper): Boolean; + function IsClickKey(AKey: Word): Boolean; virtual; + function IsContainer: Boolean; virtual; abstract; + function IsScrollable( + out AInvisiblePartHeight, AChildMinTopScreenBound: Integer): Boolean; virtual; + procedure MakeVisible; virtual; + procedure SetIsPressed(Value: Boolean); + + property AssociatedObject: TdxNavBarCustomAccessibilityHelper + read GetAssociatedObject; + property OwnerObjectControl: TWinControl read FOwnerObjectControl; + property Tag: Integer read FTag write FTag; + public + constructor Create(AOwnerObject: TObject; + AOwnerObjectControl: TWinControl); reintroduce; virtual; + destructor Destroy; override; + property Childs[AIndex: Integer]: TdxNavBarCustomAccessibilityHelper + read InternalGetChild; + property Parent: TdxNavBarCustomAccessibilityHelper read InternalGetParent; + end; + + TdxNavBarCustomAccessibilityHelperClass = class of TdxNavBarCustomAccessibilityHelper; + +procedure NavBarAccessibleObjectOwnerObjectDestroyed( + var AAccessibleObject: IdxNavBarAccessibilityHelper); +function NavBarGetAccessibilityHelper( + AObject: TObject): IdxNavBarAccessibilityHelper; +function NavBarGetFocusableAccessibleObjectAtPos( + ARootAccessibleObject: IdxNavBarAccessibilityHelper; + const P: TPoint): IdxNavBarAccessibilityHelper; + +implementation + +uses + Math, SysUtils, Types, cxGeometry, dxNavBar; + +type + TdxCustomNavBarAccess = class(TdxCustomNavBar); + +procedure NavBarAccessibleObjectOwnerObjectDestroyed( + var AAccessibleObject: IdxNavBarAccessibilityHelper); +begin + if AAccessibleObject <> nil then + AAccessibleObject.OwnerObjectDestroyed; + AAccessibleObject := nil; +end; + +function NavBarGetAccessibilityHelper( + AObject: TObject): IdxNavBarAccessibilityHelper; +begin + Supports(AObject, IdxNavBarAccessibilityHelper, Result); +end; + +function NavBarGetFocusableAccessibleObjectAtPos( + ARootAccessibleObject: IdxNavBarAccessibilityHelper; + const P: TPoint): IdxNavBarAccessibilityHelper; + + function InternalGetFocusableAccessibleObjectAtPos( + ARootAccessibleObject: TdxNavBarCustomAccessibilityHelper; + const P: TPoint): IdxNavBarAccessibilityHelper; + var + AChildHelper, AHelper: TdxNavBarCustomAccessibilityHelper; + I: Integer; + begin + Result := nil; + AHelper := ARootAccessibleObject.GetNavBarHelper; + if not AHelper.CanFocus(False) then + Exit; + if not AHelper.IsContainer then + Result := ARootAccessibleObject + else + for I := 0 to AHelper.ChildCount - 1 do + begin + AChildHelper := AHelper.Childs[I]; + if AChildHelper.Visible and + PtInRect(AChildHelper.GetScreenBounds(cxAccessibleObjectSelfID), P) then + begin + Result := InternalGetFocusableAccessibleObjectAtPos(AChildHelper, P); + Break; + end; + end; + end; + +begin +// Requires + Assert(ARootAccessibleObject <> nil); +// + if not PtInRect(ARootAccessibleObject.GetNavBarHelper.GetScreenBounds( + cxAccessibleObjectSelfID), P) then + Result := nil + else + Result := InternalGetFocusableAccessibleObjectAtPos( + ARootAccessibleObject.GetNavBarHelper, P); +end; + +procedure RemoveRedundantFocusableAccessibleObjects( + AFocusableAccessibleObjectList: TList; + ACurrentObject: TdxNavBarCustomAccessibilityHelper; + var ACurrentObjectScreenBounds: TRect; + ADirection: TcxDirection); forward; +procedure ReplaceContainerWithItsFocusableChildren( + AFocusableAccessibleObjectList: TList; AContainerIndex: Integer; + ACurrentObject: TdxNavBarCustomAccessibilityHelper; + var ACurrentObjectScreenBounds: TRect); forward; + +procedure ChooseOptimalFocusableAccessibleObject( + AFocusableAccessibleObjectList: TList; + const ACurrentObjectScreenBounds: TRect; ADirection: TcxDirection; + ADistance: Integer); +var + ABound, AMinBound, I: Integer; + AObject, AOptimalObject: TdxNavBarCustomAccessibilityHelper; + AObjectScreenBounds: TRect; +begin + AMinBound := MaxInt; + AOptimalObject := nil; + for I := 0 to AFocusableAccessibleObjectList.Count - 1 do + begin + AObject := TdxNavBarCustomAccessibilityHelper(AFocusableAccessibleObjectList[I]); + AObjectScreenBounds := AObject.GetScreenBounds(cxAccessibleObjectSelfID); + OffsetRect(AObjectScreenBounds, 0, AObject.Tag); + if ADistance = 0 then + with ACurrentObjectScreenBounds do + if ((ADirection in [dirUp, dirDown]) and (AObjectScreenBounds.Left = Left) and (AObjectScreenBounds.Right = Right)) or + ((ADirection in [dirLeft, dirRight]) and (AObjectScreenBounds.Top = Top) and (AObjectScreenBounds.Bottom = Bottom)) then + begin + AOptimalObject := AObject; + Break; + end; + ABound := IfThen(ADirection in [dirUp, dirDown], AObjectScreenBounds.Left, + AObjectScreenBounds.Top); + if ABound < AMinBound then + begin + AMinBound := ABound; + AOptimalObject := AObject; + end; + end; + AFocusableAccessibleObjectList.Clear; + AFocusableAccessibleObjectList.Add(AOptimalObject); +end; + +function GetNearestFocusableAccessibleObject( + AFocusableAccessibleObjectList: TList; + ACurrentObject: TdxNavBarCustomAccessibilityHelper; + var ACurrentObjectScreenBounds: TRect; + ADirection: TcxDirection): TdxNavBarCustomAccessibilityHelper; overload; + + function GetDistance( + const ACurrentObjectScreenBounds, AObjectScreenBounds: TRect; + ADirection: TcxDirection): Integer; + begin + Result := 0; + case ADirection of + dirLeft: + Result := ACurrentObjectScreenBounds.Left - AObjectScreenBounds.Right; + dirRight: + Result := AObjectScreenBounds.Left - ACurrentObjectScreenBounds.Right; + dirUp: + Result := ACurrentObjectScreenBounds.Top - AObjectScreenBounds.Bottom; + dirDown: + Result := AObjectScreenBounds.Top - ACurrentObjectScreenBounds.Bottom; + end; + if Result < 0 then + Result := MaxInt; + end; + +var + AMinDistance, I: Integer; + AObject: TdxNavBarCustomAccessibilityHelper; + AObjectScreenBounds: TRect; +begin + AMinDistance := MaxInt - 1; + for I := 0 to AFocusableAccessibleObjectList.Count - 1 do + begin + AObject := TdxNavBarCustomAccessibilityHelper(AFocusableAccessibleObjectList[I]); + AObjectScreenBounds := AObject.GetScreenBounds(cxAccessibleObjectSelfID); + OffsetRect(AObjectScreenBounds, 0, AObject.Tag); + AMinDistance := Min(AMinDistance, GetDistance(ACurrentObjectScreenBounds, + AObjectScreenBounds, ADirection)); + end; + I := 0; + while I < AFocusableAccessibleObjectList.Count do + begin + AObject := TdxNavBarCustomAccessibilityHelper(AFocusableAccessibleObjectList[I]); + AObjectScreenBounds := AObject.GetScreenBounds(cxAccessibleObjectSelfID); + OffsetRect(AObjectScreenBounds, 0, AObject.Tag); + if GetDistance(ACurrentObjectScreenBounds, AObjectScreenBounds, ADirection) > AMinDistance then + AFocusableAccessibleObjectList.Delete(I) + else + Inc(I); + end; + if AFocusableAccessibleObjectList.Count > 1 then + ChooseOptimalFocusableAccessibleObject(AFocusableAccessibleObjectList, + ACurrentObjectScreenBounds, ADirection, AMinDistance); + if AFocusableAccessibleObjectList.Count = 0 then + Result := nil + else + if TdxNavBarCustomAccessibilityHelper(AFocusableAccessibleObjectList[0]).IsContainer then + begin + ReplaceContainerWithItsFocusableChildren(AFocusableAccessibleObjectList, + 0, ACurrentObject, ACurrentObjectScreenBounds); + Result := GetNearestFocusableAccessibleObject( + AFocusableAccessibleObjectList, ACurrentObject, + ACurrentObjectScreenBounds, ADirection); + end + else + Result := TdxNavBarCustomAccessibilityHelper(AFocusableAccessibleObjectList[0]); +end; + +function GetNearestFocusableAccessibleObject( + ARootAccessibleObject, ACurrentObject: TdxNavBarCustomAccessibilityHelper; + ACurrentObjectScreenBounds: TRect; + ADirection: TcxDirection): TdxNavBarCustomAccessibilityHelper; overload; +var + AFocusableAccessibleObjectList: TList; +begin + AFocusableAccessibleObjectList := TList.Create; + try + AFocusableAccessibleObjectList.Add(ARootAccessibleObject); + ARootAccessibleObject.Tag := 0; + RemoveRedundantFocusableAccessibleObjects(AFocusableAccessibleObjectList, + ACurrentObject, ACurrentObjectScreenBounds, ADirection); + Result := GetNearestFocusableAccessibleObject(AFocusableAccessibleObjectList, + ACurrentObject, ACurrentObjectScreenBounds, ADirection); + finally + FreeAndNil(AFocusableAccessibleObjectList); + end; +end; + +procedure RemoveRedundantFocusableAccessibleObjects( + AFocusableAccessibleObjectList: TList; + ACurrentObject: TdxNavBarCustomAccessibilityHelper; + var ACurrentObjectScreenBounds: TRect; ADirection: TcxDirection); +var + AObject: TdxNavBarCustomAccessibilityHelper; + I: Integer; +begin + if (ACurrentObject = nil) or (ACurrentObject.Parent = nil) then + Exit; + I := 0; + while I < AFocusableAccessibleObjectList.Count do + begin + AObject := TdxNavBarCustomAccessibilityHelper(AFocusableAccessibleObjectList[I]); + if AObject = ACurrentObject then + begin + AFocusableAccessibleObjectList.Delete(I); + Break; + end + else + if AObject.IsContainer and AObject.IsChild(ACurrentObject) then + ReplaceContainerWithItsFocusableChildren(AFocusableAccessibleObjectList, + I, ACurrentObject, ACurrentObjectScreenBounds) + else + Inc(I); + end; +end; + +procedure ReplaceContainerWithItsFocusableChildren( + AFocusableAccessibleObjectList: TList; AContainerIndex: Integer; + ACurrentObject: TdxNavBarCustomAccessibilityHelper; + var ACurrentObjectScreenBounds: TRect); +var + AContainer: TdxNavBarCustomAccessibilityHelper; + AContainerBottomBound, AContainerInvisiblePartHeight, + AContainerChildMinTopScreenBound, AContainerChildTopBoundOffset, I, J: Integer; + AContainerScreenBounds, AObjectScreenBounds: TRect; + AObject: TdxNavBarCustomAccessibilityHelper; +begin + AContainer := TdxNavBarCustomAccessibilityHelper( + AFocusableAccessibleObjectList[AContainerIndex]); + AContainerScreenBounds := AContainer.GetScreenBounds(cxAccessibleObjectSelfID); + AContainerBottomBound := AContainerScreenBounds.Bottom + AContainer.Tag; + AFocusableAccessibleObjectList.Delete(AContainerIndex); + if (ACurrentObject <> nil) and AContainer.IsScrollable(AContainerInvisiblePartHeight, + AContainerChildMinTopScreenBound) then + begin + for I := 0 to AFocusableAccessibleObjectList.Count - 1 do + begin + AObject := TdxNavBarCustomAccessibilityHelper( + AFocusableAccessibleObjectList[I]); + if AObject.GetScreenBounds(cxAccessibleObjectSelfID).Top + AObject.Tag >= AContainerBottomBound then + AObject.Tag := AObject.Tag + AContainerInvisiblePartHeight; + end; + if (ACurrentObject <> nil) and not AContainer.IsChild(ACurrentObject) and + (ACurrentObjectScreenBounds.Top >= AContainerBottomBound) then + OffsetRect(ACurrentObjectScreenBounds, 0, AContainerInvisiblePartHeight); + AContainerChildTopBoundOffset := AContainerScreenBounds.Top - + AContainerChildMinTopScreenBound + AContainer.Tag; + end + else + AContainerChildTopBoundOffset := AContainer.Tag; + J := AContainerIndex; + for I := 0 to AContainer.ChildCount - 1 do + begin + AObject := AContainer.Childs[I]; + AObjectScreenBounds := AObject.GetScreenBounds(cxAccessibleObjectSelfID); + if (ACurrentObject = nil) and ((AObjectScreenBounds.Top < AContainerScreenBounds.Top) or + (AObjectScreenBounds.Top >= AContainerScreenBounds.Bottom)) then + Continue; + if AObject.CanFocus(ACurrentObject = nil) then + begin + AFocusableAccessibleObjectList.Insert(J, AObject); + Inc(J); + AObject.Tag := AContainerChildTopBoundOffset; + end; + end; + if (ACurrentObject <> nil) and AContainer.IsChild(ACurrentObject) then + OffsetRect(ACurrentObjectScreenBounds, 0, AContainerChildTopBoundOffset - AContainer.Tag); +end; + +{ TdxNavBarNexusPersistent } + +constructor TdxNavBarNexusPersistent.Create(AOwner: TPersistent); +begin + inherited; + FNotifyComponent := TcxFreeNotificator.Create(nil); + FNotifyComponent.OnFreeNotification := FreeNotification; +end; + +destructor TdxNavBarNexusPersistent.Destroy; +begin + FreeAndNil(FNotifyComponent); + inherited; +end; + +procedure TdxNavBarNexusPersistent.FreeNotification(AComponent: TComponent); +begin +// do nothing +end; + +{ TdxComponentCollectionItem } + +procedure TdxNavBarComponentCollectionItem.InitiateActions; +begin +end; + +procedure TdxNavBarComponentCollectionItem.SetIndex(Value: Integer); +begin + if Collection = nil then + Exit; + if Value < 0 then + Value := 0; + if Value > Collection.Count - 1 + then Value := Collection.Count - 1; + inherited SetIndex(Value); +end; + +function TdxNavBarComponentCollectionItem.InternalGetCollection: TdxNavBarComponentCollection; +begin + Result := TdxNavBarComponentCollection(inherited Collection); +end; + +procedure TdxNavBarComponentCollectionItem.InternalSetCollection(Value: TdxNavBarComponentCollection); +begin + inherited Collection := Value; +end; + +{ TdxComponentCollection } + +function TdxNavBarComponentCollection.Add: TdxNavBarComponentCollectionItem; +begin + Result := TdxNavBarComponentCollectionItem(inherited Add); +end; + +function TdxNavBarComponentCollection.ItemByName(const AName: string): TdxNavBarComponentCollectionItem; +var + I: Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + if Items[I].Name = AName then + begin + Result := TdxNavBarComponentCollectionItem(Items[I]); + Break; + end; +end; + +procedure TdxNavBarComponentCollection.InitiateActions; +var + I: Integer; +begin + for I := 0 to Count - 1 do + TdxNavBarComponentCollectionItem(Items[I]).InitiateActions; +end; + +function TdxNavBarComponentCollection.InternalGetOwner: TComponent; +begin + Result := ParentComponent; +end; + +{ TdxNavBarCustomAccessibilityHelper } + +constructor TdxNavBarCustomAccessibilityHelper.Create(AOwnerObject: TObject; + AOwnerObjectControl: TWinControl); +begin +// Requires + Assert(AOwnerObjectControl is TdxCustomNavBar); +// + inherited Create(AOwnerObject); + FOwnerObjectControl := AOwnerObjectControl; + FAttachedChildList := TInterfaceList.Create; +end; + +destructor TdxNavBarCustomAccessibilityHelper.Destroy; +begin + FreeAndNil(FAttachedChildList); + inherited Destroy; +end; + +// IcxAccessibilityHelper +procedure TdxNavBarCustomAccessibilityHelper.OwnerObjectDestroyed; +begin + inherited OwnerObjectDestroyed; + TdxCustomNavBarAccess( + OwnerObjectControl).AccessibleObjectOwnerObjectDestroyedNotification(Self); +end; + +function TdxNavBarCustomAccessibilityHelper.GetChild( + AIndex: Integer): TcxAccessibilityHelper; +begin + Result := (FAttachedChildList[AIndex] as IdxNavBarAccessibilityHelper).GetHelper; +end; + +function TdxNavBarCustomAccessibilityHelper.GetChildCount: Integer; +begin + Result := FAttachedChildList.Count; +end; + +function TdxNavBarCustomAccessibilityHelper.GetOwnerObjectWindow: HWND; +begin + if OwnerObjectControl.HandleAllocated then + Result := OwnerObjectControl.Handle + else + Result := 0; +end; + +function TdxNavBarCustomAccessibilityHelper.GetScreenBounds( + AChildID: TcxAccessibleSimpleChildElementID): TRect; +begin + if Visible then + Result := cxRectOffset(GetBounds, OwnerObjectControl.ClientOrigin) + else + Result := cxNullRect; +end; + +function TdxNavBarCustomAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +var + AHandle: HWND; +begin + Result := cxSTATE_SYSTEM_NORMAL; + AHandle := OwnerObjectWindow; + if (AHandle = 0) or not IsWindowVisible(AHandle) then + Result := Result or cxSTATE_SYSTEM_INVISIBLE; + if not OwnerObjectControl.Enabled then + Result := Result or cxSTATE_SYSTEM_UNAVAILABLE; +end; + +// IdxNavBarAccessibilityHelper +procedure TdxNavBarCustomAccessibilityHelper.AttachChild( + AChild: IdxNavBarAccessibilityHelper); +begin +// Requires + Assert(IsContainer and (AChild <> nil)); +// + FAttachedChildList.Add(AChild); +end; + +function TdxNavBarCustomAccessibilityHelper.CanFocus( + AFocusingByDefault: Boolean): Boolean; + + function HasFocusableChild: Boolean; + var + I: Integer; + begin + Result := False; + for I := 0 to ChildCount - 1 do + begin + Result := Childs[I].CanFocus(AFocusingByDefault); + if Result then + Break; + end; + end; + +var + AState: Integer; +begin + Result := not (csDestroying in OwnerObjectControl.ComponentState); + if not Result then + Exit; + AState := States[cxAccessibleObjectSelfID]; + Result := (AState and (cxSTATE_SYSTEM_INVISIBLE or cxSTATE_SYSTEM_UNAVAILABLE) = 0) and + (not IsContainer and (not AFocusingByDefault or CanBeFocusedByDefault) or IsContainer and HasFocusableChild); +end; + +procedure TdxNavBarCustomAccessibilityHelper.DetachChild( + AChild: IdxNavBarAccessibilityHelper); +begin +// Requires + Assert(IsContainer and (AChild <> nil)); +// + FAttachedChildList.Remove(AChild); +end; + +procedure TdxNavBarCustomAccessibilityHelper.FocusedChanged( + AMakeVisible: Boolean); +var + R: TRect; +begin + TdxCustomNavBar(OwnerObjectControl).InvalidateAll(doRecalc); + if IsFocused then + begin + if AMakeVisible then + begin + GetWindowRect(TdxCustomNavBar(OwnerObjectControl).Handle, R); + IntersectRect(R, R, Parent.GetScreenBounds(cxAccessibleObjectSelfID)); + if not cxRectContain(R, GetScreenBounds(cxAccessibleObjectSelfID)) then + MakeVisible; + end; + end + else + SetIsPressed(False); +end; + +function TdxNavBarCustomAccessibilityHelper.GetNavBarHelper: TdxNavBarCustomAccessibilityHelper; +begin + Result := Self; +end; + +function TdxNavBarCustomAccessibilityHelper.GetNextObjectForNavigation( + ADirection: TcxDirection): IdxNavBarAccessibilityHelper; +begin +// Requires + Assert((Parent = nil) and (ADirection in [dirNone, dirDown]) or + (Parent <> nil) and (ADirection <> dirNone) and not IsContainer); +// + OwnerObjectControl.Update; + Result := InternalGetNextObjectForNavigation(ADirection); +end; + +function TdxNavBarCustomAccessibilityHelper.IsFocused: Boolean; + + function GetFocusedAccessibleObject: TdxNavBarCustomAccessibilityHelper; + begin + if TdxCustomNavBarAccess(OwnerObjectControl).FocusedAccessibleObject <> nil then + Result := TdxCustomNavBarAccess(OwnerObjectControl).FocusedAccessibleObject.GetNavBarHelper + else + Result := nil; + end; + +var + AFocusedAccessibleObject: TdxNavBarCustomAccessibilityHelper; +begin + AFocusedAccessibleObject := GetFocusedAccessibleObject; + Result := OwnerObjectControl.Focused and (AFocusedAccessibleObject <> nil) and + ((AFocusedAccessibleObject.GetHelper = Self) or (AFocusedAccessibleObject.AssociatedObject = Self)); +end; + +function TdxNavBarCustomAccessibilityHelper.IsPressed: Boolean; +begin + Result := FIsPressed; +end; + +procedure TdxNavBarCustomAccessibilityHelper.KeyDown(var Key: Word; + Shift: TShiftState); +begin + SetIsPressed(IsClickKey(Key)); +end; + +procedure TdxNavBarCustomAccessibilityHelper.KeyPress(var Key: Char); +begin +end; + +procedure TdxNavBarCustomAccessibilityHelper.KeyUp(var Key: Word; + Shift: TShiftState); +begin + SetIsPressed(False); + if IsClickKey(Key) then + Click(Key); +end; + +procedure TdxNavBarCustomAccessibilityHelper.RemoveFocus; +begin + TdxCustomNavBarAccess(OwnerObjectControl).FocusedAccessibleObject := nil; +end; + +function TdxNavBarCustomAccessibilityHelper.CanBeFocusedByDefault: Boolean; +begin + Result := False; +end; + +procedure TdxNavBarCustomAccessibilityHelper.Click; +begin +end; + +function TdxNavBarCustomAccessibilityHelper.GetAssociatedObject: TdxNavBarCustomAccessibilityHelper; +begin + Result := nil; +end; + +function TdxNavBarCustomAccessibilityHelper.InternalGetNextObjectForNavigation( + ADirection: TcxDirection): IdxNavBarAccessibilityHelper; +var + ACurrentObject: TdxNavBarCustomAccessibilityHelper; + ACurrentObjectScreenBounds: TRect; +begin + ACurrentObjectScreenBounds := GetScreenBounds(cxAccessibleObjectSelfID); + if Parent = nil then + OffsetRect(ACurrentObjectScreenBounds, 0, -cxRectHeight(ACurrentObjectScreenBounds)); + if ADirection <> dirNone then + ACurrentObject := Self + else + begin + ACurrentObject := nil; + ADirection := dirDown; + end; + Result := GetNearestFocusableAccessibleObject( + GetRootHelper as TdxNavBarCustomAccessibilityHelper, ACurrentObject, + ACurrentObjectScreenBounds, ADirection); +end; + +function TdxNavBarCustomAccessibilityHelper.IsChild( + AChild: TdxNavBarCustomAccessibilityHelper): Boolean; +begin +// Requires + Assert(AChild <> nil); +// + repeat + AChild := AChild.Parent; + Result := AChild = Self; + until Result or (AChild = nil) or (AChild.Parent = nil); +end; + +function TdxNavBarCustomAccessibilityHelper.IsClickKey(AKey: Word): Boolean; +begin + Result := False; +end; + +function TdxNavBarCustomAccessibilityHelper.IsScrollable( + out AInvisiblePartHeight, AChildMinTopScreenBound: Integer): Boolean; +begin + Result := False; +end; + +procedure TdxNavBarCustomAccessibilityHelper.MakeVisible; +begin +end; + +procedure TdxNavBarCustomAccessibilityHelper.SetIsPressed(Value: Boolean); +begin + if Value <> FIsPressed then + begin + FIsPressed := Value; + TdxCustomNavBar(OwnerObjectControl).Invalidate; + end; +end; + +function TdxNavBarCustomAccessibilityHelper.InternalGetChild( + AIndex: Integer): TdxNavBarCustomAccessibilityHelper; +begin + Result := GetChild(AIndex) as TdxNavBarCustomAccessibilityHelper; +end; + +function TdxNavBarCustomAccessibilityHelper.InternalGetParent: TdxNavBarCustomAccessibilityHelper; +begin + Result := GetParent as TdxNavBarCustomAccessibilityHelper; +end; + +end. + diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarBaseViews.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarBaseViews.pas new file mode 100644 index 00000000..5b977f69 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarBaseViews.pas @@ -0,0 +1,377 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarBaseViews; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, Types, Graphics, ImgList, + dxNavBar, dxNavBarBase, dxNavBarCollns, dxNavBarStyles, dxNavBarCustomPainters; + +type + TdxNavBarBaseViewInfo = class(TdxNavBarViewInfo) + protected + procedure CorrectBounds; override; + function GetActiveGroupMinHeight: Integer; virtual; + public + procedure DoGroupActivate(AGroup: TdxNavBarGroup); override; + procedure DoGroupDeactivate(AGroup: TdxNavBarGroup); override; + function IsGroupActive(AGroup: TdxNavBarGroup): Boolean; override; + procedure MakeLinkVisible(ALink: TdxNavBarItemLink; ATop: Boolean = True); override; + procedure MakeGroupVisible(AGroup: TdxNavBarGroup; + AExpandGroup: Boolean = True; ATop: Boolean = True); override; + end; + + { TdxNavBarNavigationBarController } + + TdxNavBarNavigationBarController = class(TdxNavBarController) + end; + + TdxNavBarBasePainter = class(TdxNavBarElementPainter) + protected + class function GetViewInfoClass: TdxNavBarViewInfoClass; override; + function GetControllerClass: TdxNavBarControllerClass; override; + + class function ButtonPainterClass: TdxNavBarCustomButtonPainterClass; override; + class function ScrollButtonsPainterClass: TdxNavBarCustomScrollButtonsPainterClass; override; + class function SelectionPainterClass: TdxNavBarCustomSelectionPainterClass; override; + end; + + TdxNavBarBaseSelectionPainter = class(TdxNavBarCustomSelectionPainter) + protected + class procedure GetColors(AState: TdxNavBarObjectStates; ABackColor: TColor; out AFillColor, + ATopLeftOuterColor, ABottomRightOuterColor, ATopLeftInnerColor, ABottomRightInnerColor: TColor); override; + end; + + TdxNavBarBaseButtonPainter = class(TdxNavBarCustomButtonPainter) + protected + class procedure InternalDrawButton(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; + AState: TdxNavBarObjectStates); override; + end; + + TdxNavBarBaseScrollButtonsPainter = class(TdxNavBarCustomScrollButtonsPainter) + protected + class procedure InternalDrawBottomButton(ACanvas: TCanvas; ARect: TRect; + AButtonPainterClass: TdxNavBarCustomButtonPainterClass; AColor1, AColor2: TColor; + AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode; + ABorderColor: TColor; AState: TdxNavBarObjectStates); override; + class procedure InternalDrawTopButton(ACanvas: TCanvas; ARect: TRect; + AButtonPainterClass: TdxNavBarCustomButtonPainterClass; AColor1, AColor2: TColor; + AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode; + ABorderColor: TColor; AState: TdxNavBarObjectStates); override; + end; + + TdxNavBarFlatPainter = class(TdxNavBarBasePainter) + protected + class function ButtonPainterClass: TdxNavBarCustomButtonPainterClass; override; + end; + + TdxNavBarFlatButtonPainter = class(TdxNavBarCustomButtonPainter) + protected + class procedure InternalDrawButton(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; + AState: TdxNavBarObjectStates); override; + end; + +implementation + +uses + Math, cxGraphics, dxOffice11, cxGeometry, + dxNavBarViewsFact, dxNavBarGraphics, dxNavBarConsts; + +{ TdxNavBarBaseViewInfo } + +procedure TdxNavBarBaseViewInfo.CorrectBounds; +var + I, ActiveGroupViewInfoIndex: Integer; + OffsetY, MinHeight: Integer; +begin + if (GroupCount = 0) or (ActiveGroupViewInfo = nil) then exit; + + ActiveGroupViewInfoIndex := IndexOfGroupViewInfo(ActiveGroupViewInfo); + OffsetY := ClientHeight - Groups[GroupCount - 1].Rect.Bottom; + MinHeight := GetActiveGroupMinHeight; + if (ActiveGroupViewInfo.ItemsRect.Bottom + OffsetY < ActiveGroupViewInfo.ItemsRect.Top + MinHeight) then + OffsetY := ActiveGroupViewInfo.ItemsRect.Top + MinHeight - ActiveGroupViewInfo.ItemsRect.Bottom; + ActiveGroupViewInfo.CorrectActiveGroupBounds(0, OffsetY); + for I := ActiveGroupViewInfoIndex + 1 to GroupCount - 1 do + Groups[I].CorrectBounds(0, OffsetY); + CalculateScrollButtonsBounds; +end; + +function TdxNavBarBaseViewInfo.GetActiveGroupMinHeight: Integer; +var + ATopVisibleLinkViewInfo: TdxNavBarLinkViewInfo; +begin + if ActiveGroupViewInfo <> nil then + begin + Result := 2 * GetScrollButtonVerticalSize + 3 * GetScrollButtonVerticalEdge; + if ActiveGroupViewInfo.ItemCount > ActiveGroupViewInfo.Group.TopVisibleLinkIndex then + begin + ATopVisibleLinkViewInfo := ActiveGroupViewInfo.Items[ActiveGroupViewInfo.Group.TopVisibleLinkIndex]; + Result := Max(Result, cxRectHeight(ATopVisibleLinkViewInfo.Rect) + GetGroupCaptionSeparatorWidth); + end; + end + else Result := 0; +end; + +procedure TdxNavBarBaseViewInfo.DoGroupActivate(AGroup: TdxNavBarGroup); +begin + if NavBar.ActiveGroupIndex <> AGroup.Index then + begin + NavBar.ActiveGroup := AGroup; + NavBar.DesignerModified; + end; +end; + +procedure TdxNavBarBaseViewInfo.DoGroupDeactivate(AGroup: TdxNavBarGroup); +begin +end; + +function TdxNavBarBaseViewInfo.IsGroupActive(AGroup: TdxNavBarGroup): Boolean; +begin + Result := AGroup = NavBar.ActiveGroup; +end; + +procedure TdxNavBarBaseViewInfo.MakeLinkVisible(ALink: TdxNavBarItemLink; ATop: Boolean = True); +var + AGroupViewInfo: TdxNavBarGroupViewInfo; + ALinkViewInfo: TdxNavBarLinkViewInfo; +begin + if NavBar.ActiveGroup <> ALink.Group then + begin + NavBar.ActiveGroup := ALink.Group; + CreateInfo; + CalculateBounds; + end; + AGroupViewInfo := GetGroupViewInfoByGroup(ALink.Group); + if AGroupViewInfo <> nil then + begin + ALinkViewInfo := AGroupViewInfo.GetLinkViewInfoByLink(ALink); + if ALinkViewInfo <> nil then + begin + if ATop or (ALinkViewInfo.Rect.Top < AGroupViewInfo.ItemsRect.Top) then + ALink.Group.TopVisibleLinkIndex := AGroupViewInfo.IndexOfLinkViewInfo(ALinkViewInfo) + else + while (ALinkViewInfo.Rect.Bottom > AGroupViewInfo.ItemsRect.Bottom) do + begin + ALink.Group.TopVisibleLinkIndex := ALink.Group.TopVisibleLinkIndex + 1; + CalculateBounds; + end; + NavBar.InvalidateAll(doRecreate); + end; + end; +end; + +procedure TdxNavBarBaseViewInfo.MakeGroupVisible(AGroup: TdxNavBarGroup; + AExpandGroup: Boolean = True; ATop: Boolean = True); +begin + NavBar.ActiveGroup := AGroup; +end; + +{ TdxNavBarCustomPainter } + +class function TdxNavBarBasePainter.GetViewInfoClass: TdxNavBarViewInfoClass; +begin + Result := TdxNavBarBaseViewInfo; +end; + +function TdxNavBarBasePainter.GetControllerClass: TdxNavBarControllerClass; +begin + Result := TdxNavBarNavigationBarController; +end; + +class function TdxNavBarBasePainter.ButtonPainterClass: TdxNavBarCustomButtonPainterClass; +begin + Result := TdxNavBarBaseButtonPainter; +end; + +class function TdxNavBarBasePainter.ScrollButtonsPainterClass: TdxNavBarCustomScrollButtonsPainterClass; +begin + Result := TdxNavBarBaseScrollButtonsPainter; +end; + +class function TdxNavBarBasePainter.SelectionPainterClass: TdxNavBarCustomSelectionPainterClass; +begin + Result := TdxNavBarBaseSelectionPainter; +end; + +{ TdxNavBarBaseSelectionPainter } + +class procedure TdxNavBarBaseSelectionPainter.GetColors(AState: TdxNavBarObjectStates; ABackColor: TColor; + out AFillColor, ATopLeftOuterColor, ABottomRightOuterColor, ATopLeftInnerColor, ABottomRightInnerColor: TColor); +begin + inherited; + if IsPressed(AState) then + begin + ATopLeftOuterColor := DarkDarkBorderColor(ABackColor); + ABottomRightOuterColor := LightLightBorderColor(ABackColor); + end + else + begin + ATopLeftOuterColor := LightLightBorderColor(ABackColor); + ABottomRightOuterColor := DarkDarkBorderColor(ABackColor); + end; +end; + +{ TdxNavBarBaseButtonPainter } + +class procedure TdxNavBarBaseButtonPainter.InternalDrawButton(ACanvas: TCanvas; ARect: TRect; + APicture: TPicture; AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; AState: TdxNavBarObjectStates); +begin + inherited; + if sPressed in AState then + dxNavBarDrawSelectedFrame(ACanvas, ARect, DarkDarkBorderColor(AColor1), DarkDarkBorderColor(AColor1), + DarkBorderColor(AColor1), DarkBorderColor(AColor1)) + else + dxNavBarDrawSelectedFrame(ACanvas, ARect, LightLightBorderColor(AColor1), DarkDarkBorderColor(AColor1), + LightBorderColor(AColor1), DarkBorderColor(AColor1)); + if sActive in AState then + FillRectByColor(ACanvas.Handle, cxRectSetBottom(ARect, ARect.Bottom, 1), clBlack); +end; + +{ TdxNavBarBaseScrollButtonsPainter } + +class procedure TdxNavBarBaseScrollButtonsPainter.InternalDrawBottomButton(ACanvas: TCanvas; + ARect: TRect; AButtonPainterClass: TdxNavBarCustomButtonPainterClass; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; AState: TdxNavBarObjectStates); +var + pt1, pt2, pt3: TPoint; + AArrowHeight, AArrowWidth: Integer; +begin + AButtonPainterClass.DrawButton(ACanvas, ARect, nil, AColor1, AColor2, + AAlphaBlend1, AAlphaBlend2, AGradientMode, ABorderColor, AState); + + AArrowHeight := (ARect.Bottom - ARect.Top) div 4; + AArrowWidth := 2 * AArrowHeight - 1; + pt1.X := ARect.Left + (ARect.Right - ARect.Left) div 2 - 1; + pt1.Y := ARect.Top + (ARect.Bottom - ARect.Top) div 2 + (AArrowHeight div 2) - 1; + pt2.X := pt1.X - AArrowWidth div 2; + pt2.Y := pt1.Y - AArrowHeight + 1; + pt3.X := pt2.X + AArrowWidth - 1; + pt3.Y := pt2.Y; + if sDisabled in AState then + begin + ACanvas.Brush.Color := clGrayText; + ACanvas.Pen.Color := clGrayText; + end + else + begin + ACanvas.Brush.Color := clBlack; + ACanvas.Pen.Color := clBlack; + end; + ACanvas.Brush.Style := bsSolid; + ACanvas.Pen.Style := psSolid; + ACanvas.Polygon([pt1, pt2, pt3]); +end; + +class procedure TdxNavBarBaseScrollButtonsPainter.InternalDrawTopButton(ACanvas: TCanvas; + ARect: TRect; AButtonPainterClass: TdxNavBarCustomButtonPainterClass; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; AState: TdxNavBarObjectStates); +var + pt1, pt2, pt3: TPoint; + AArrowHeight, AArrowWidth: Integer; +begin + AButtonPainterClass.DrawButton(ACanvas, ARect, nil, AColor1, AColor2, + AAlphaBlend2, AAlphaBlend2, AGradientMode, ABorderColor, AState); + + AArrowHeight := (ARect.Bottom - ARect.Top) div 4; + AArrowWidth := 2 * AArrowHeight - 1; + pt1.X := ARect.Left + (ARect.Right - ARect.Left) div 2 - 1; + pt1.Y := ARect.Top + (ARect.Bottom - ARect.Top) div 2 - (AArrowHeight div 2) - 1; + pt2.X := pt1.X - AArrowWidth div 2; + pt2.Y := pt1.Y + AArrowHeight - 1; + pt3.X := pt2.X + AArrowWidth - 1; + pt3.Y := pt2.Y; + if sDisabled in AState then + begin + ACanvas.Brush.Color := clGrayText; + ACanvas.Pen.Color := clGrayText; + end + else + begin + ACanvas.Brush.Color := clBlack; + ACanvas.Pen.Color := clBlack; + end; + ACanvas.Brush.Style := bsSolid; + ACanvas.Pen.Style := psSolid; + ACanvas.Polygon([pt1, pt2, pt3]); +end; + +{ TdxNavBarFlatPainter } + +class function TdxNavBarFlatPainter.ButtonPainterClass: TdxNavBarCustomButtonPainterClass; +begin + Result := TdxNavBarFlatButtonPainter; +end; + +{ TdxNavBarFlatButtonPainter } + +class procedure TdxNavBarFlatButtonPainter.InternalDrawButton(ACanvas: TCanvas; ARect: TRect; + APicture: TPicture; AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; AState: TdxNavBarObjectStates); +begin + inherited; + if sPressed in AState then + dxNavBarDrawSelectedFrame(ACanvas, ARect, DarkDarkBorderColor(AColor1), LightLightBorderColor(AColor1), + DarkBorderColor(AColor1), clNone) + else + if sHotTracked in AState then + dxNavBarDrawSelectedFrame(ACanvas, ARect, LightLightBorderColor(AColor1), DarkDarkBorderColor(AColor1), + clNone, DarkBorderColor(AColor1)) + else + dxNavBarDrawSelectedFrame(ACanvas, ARect, LightLightBorderColor(AColor1), DarkBorderColor(AColor1), + clNone, clNone); + if sActive in AState then + FillRectByColor(ACanvas.Handle, cxRectSetBottom(ARect, ARect.Bottom, 1), clBlack); +end; + +initialization + RegisterView(dxNavBarBaseView, 'BaseView', TdxNavBarBasePainter); + RegisterView(dxNavBarFlatView, 'FlatView', TdxNavBarFlatPainter); + +finalization + UnRegisterView(dxNavBarBaseView); + UnRegisterView(dxNavBarFlatView); + +end. diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarCollns.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarCollns.pas new file mode 100644 index 00000000..8a8f434e --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarCollns.pas @@ -0,0 +1,2052 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarCollns; + +{$I cxVer.inc} + +interface + +uses + Windows, Graphics, Classes, Controls, ExtCtrls, ActnList, Messages, + dxNavBarBase, dxNavBarStyles, cxAccessibility, cxControls, cxClasses; + +type + TdxNavBarItem = class; + TdxNavBarGroup = class; + + TdxNavBarItemLink = class(TCollectionItem) + private + FData: Integer; + FIAccessibilityHelper: IdxNavBarAccessibilityHelper; + FItem: TdxNavBarItem; + function GetGroup: TdxNavBarGroup; + function GetIAccessibilityHelper: IdxNavBarAccessibilityHelper; + procedure SetSelected(Value: Boolean); + protected + procedure InitiateAction; + function IsAncestorEqual(AItemLink: TdxNavBarItemLink): Boolean; + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + function CanSelect: Boolean; + function IsSelected: Boolean; + property Data: Integer read FData write FData; + property Group: TdxNavBarGroup read GetGroup; + property IAccessibilityHelper: IdxNavBarAccessibilityHelper read + GetIAccessibilityHelper; + property Selected: Boolean read IsSelected write SetSelected; + published + property Item: TdxNavBarItem read FItem write FItem; + end; + + TdxNavBarItemLinks = class(TCollection) + private + FGroup: TdxNavBarGroup; + protected + function GetOwner: TPersistent; override; + function IsAncestorEqual(AItemLinks: TdxNavBarItemLinks): Boolean; + + function GetItem(Index: Integer): TdxNavBarItemLink; + procedure SetItem(Index: Integer; Value: TdxNavBarItemLink); + procedure Update(Item: TCollectionItem); override; + public + constructor Create(AGroup: TdxNavBarGroup); + function Add: TdxNavBarItemLink; + + property Group: TdxNavBarGroup read FGroup; + property Items[Index: Integer]: TdxNavBarItemLink read GetItem write SetItem; default; + end; + + TdxNavBarGroupControlState = (gcsOverSizeGrip); + TdxNavBarGroupControlStates = set of TdxNavBarGroupControlState; + + TdxNavBarGroupControl = class(TCustomPanel) + private + FInternalState: TdxNavBarGroupControlStates; + FGroup: TdxNavBarGroup; + FGroupIndex: Integer; + FOriginalCursor: TCursor; + FOriginalHeight: Integer; + FUpdateLock: Integer; + FUseStyle: Boolean; + + function GetInternalNavBar: TControl; + procedure SetOriginalHeight(const Value: Integer); + procedure SetUseStyle(const Value: Boolean); + function SizeGripRect: TRect; + procedure CMVisibleChanged(var Message: TMessage); message CM_VISIBLECHANGED; + {$IFNDEF DELPHI7} + procedure WMPrintClient(var Message: TWMPrintClient); message WM_PRINTCLIENT; + {$ENDIF} + function GetMouseOverSizeGrip: Boolean; + procedure SetMouseOverSizeGrip(AValue: Boolean); + + property MouseOverSizeGrip: Boolean read GetMouseOverSizeGrip write SetMouseOverSizeGrip; + protected + procedure ChangeScale(M, D: Integer); override; + procedure DefineProperties(Filer: TFiler); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure ReadOriginalHeight(Reader: TReader); + procedure ReadGroupIndex(Reader: TReader); + procedure WriteOriginalHeight(Writer: TWriter); + procedure WriteGroupIndex(Writer: TWriter); + procedure ReadState(Reader: TReader); override; + procedure SetParent(AParent: TWinControl); override; + + procedure Paint; override; + + procedure BeginUpdate; + procedure EndUpdate; + procedure UpdateGroup; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + procedure AdjustControl(ARect: TRect; AVisible: Boolean); virtual; + procedure BeginResize(AControl: TControl; AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); + procedure DrawSizeGrip(ACanvas: TCanvas; const ARect: TRect); + function GetSizeGripRect(AControl: TControl): TRect; + function IsOnPopupControl: Boolean; + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; + property OriginalHeight: Integer read FOriginalHeight write SetOriginalHeight; + + property Group: TdxNavBarGroup read FGroup write FGroup; + published + property Alignment; + property BiDiMode; + property Caption; + property Color; + property Font; + property ParentBiDiMode; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property ShowHint; + property TabOrder; + property TabStop; + property UseStyle: Boolean read FUseStyle write SetUseStyle default False; + + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnEnter; + property OnExit; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + end; + + TdxNavBarCustomItem = class(TdxNavBarComponentCollectionItem) + private + FCaption: string; + FHint: string; + FLargeImageIndex: Integer; + FSmallImageIndex: Integer; + + FOnClick: TNotifyEvent; + + procedure SetCaption(const Value: string); + procedure SetHint(const Value: string); + procedure SetLargeImageIndex(const Value: Integer); + procedure SetSmallImageIndex(const Value: Integer); + procedure SetVisible(const Value: Boolean); + protected + FVisible: Boolean; + + procedure DoSetVisible(Value: Boolean); virtual; + + property Caption: string read FCaption write SetCaption; + property Hint: string read FHint write SetHint; + + property OnClick: TNotifyEvent read FOnClick write FOnClick; + public + constructor Create(AOwner: TComponent); override; + procedure Assign(Source: TPersistent); override; + function IsDestroying: Boolean; + function IsLoading: Boolean; + + property LargeImageIndex: Integer read FLargeImageIndex write SetLargeImageIndex default -1; + property SmallImageIndex: Integer read FSmallImageIndex write SetSmallImageIndex default -1; + property Visible: Boolean read FVisible write SetVisible default True; + end; + + { TdxNavBarGroupExpandOptions } + + TdxNavBarGroupExpansionOptions = class(TcxOwnedPersistent) + private + FExpandable: Boolean; + FExpanded: Boolean; + FShowExpandButton: Boolean; + + function GetGroup: TdxNavBarGroup; + procedure SetExpanded(AValue: Boolean); + procedure SetShowExpandButton(AValue: Boolean); + + property Group: TdxNavBarGroup read GetGroup; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + published + property Expandable: Boolean read FExpandable write FExpandable default True; + property Expanded: Boolean read FExpanded write SetExpanded default True; + property ShowExpandButton: Boolean read FShowExpandButton write SetShowExpandButton default True; + end; + + { TdxNavBarGroupControlOptions } + + TdxNavBarGroupControlOptions = class(TcxOwnedPersistent) + private + FAllowControlResizing: Boolean; + FUseControl: Boolean; + FShowControl: Boolean; + + function GetGroup: TdxNavBarGroup; + procedure SetAllowControlResizing(AValue: Boolean); + procedure SetShowControl(AValue: Boolean); + procedure SetUseControl(AValue: Boolean); + + property Group: TdxNavBarGroup read GetGroup; + public + procedure Assign(Source: TPersistent); override; + published + property AllowControlResizing: Boolean read FAllowControlResizing write SetAllowControlResizing default False; + property ShowControl: Boolean read FShowControl write SetShowControl default False; + property UseControl: Boolean read FUseControl write SetUseControl default False; + end; + + { TdxNavBarGroup } + + TdxNavBarGroup = class(TdxNavBarCustomItem) + private + FAlign: TcxTopBottom; + FCaptionPanelIAccessibilityHelper: IdxNavBarAccessibilityHelper; + FControl: TdxNavBarGroupControl; + FCustomStyles: TdxNavBarGroupCustomStyles; + FIAccessibilityHelper: IdxNavBarAccessibilityHelper; + FLinkContainerIAccessibilityHelper: IdxNavBarAccessibilityHelper; + FLinks: TdxNavBarItemLinks; + FLinksUseSmallImages: Boolean; + FLoadedSelectedLinkIndex: Integer; + FOptionsGroupControl: TdxNavBarGroupControlOptions; + FOptionsExpansion: TdxNavBarGroupExpansionOptions; + FSelectedLink: TdxNavBarItemLink; + FShowAsIconView: Boolean; + FShowCaption: Boolean; + FTopVisibleLinkIndex: Integer; + FUseSmallImages: Boolean; + FVisibleForCustomization: Boolean; + + FOnCollapsed: TNotifyEvent; + FOnExpanded: TNotifyEvent; + FOnSelectedLinkChanged: TNotifyEvent; + FOnTopVisibleLinkChanged: TNotifyEvent; + + function GetCaptionPanelIAccessibilityHelper: IdxNavBarAccessibilityHelper; + function GetIAccessibilityHelper: IdxNavBarAccessibilityHelper; + function GetLinkContainerIAccessibilityHelper: IdxNavBarAccessibilityHelper; + function GetLinkCount: Integer; + function GetLink(Index: Integer): TdxNavBarItemLink; + function GetSelectedLinkIndex: Integer; + procedure SetAlign(const Value: TcxTopBottom); + procedure SetLinksUseSmallImages(const Value: Boolean); + procedure SetSelectedLinkIndex(Value: Integer); + procedure SetShowAsIconView(const Value: Boolean); + procedure SetShowCaption(const Value: Boolean); + procedure SetTopVisibleLinkIndex(Value: Integer); + procedure SetUseSmallImages(const Value: Boolean); + + // OptionsGroupControl + function GetShowControl: Boolean; + function GetUseControl: Boolean; + procedure SetOptionsGroupControl(const Value: TdxNavBarGroupControlOptions); + procedure SetShowControl(const Value: Boolean); + procedure SetUseControl(const Value: Boolean); + + // OptionsExpansion + function GetExpandable: Boolean; + function GetExpanded: Boolean; + function GetShowExpandButton: Boolean; + procedure SetOptionsExpansion(const Value: TdxNavBarGroupExpansionOptions); + procedure SetExpandable(const Value: Boolean); + procedure SetExpanded(const Value: Boolean); + procedure SetShowExpandButton(const Value: Boolean); + + // Styles + function GetCustomStyle(Index: Integer): TdxNavBarStyleItem; + procedure SetCustomStyles(Value: TdxNavBarGroupCustomStyles); + procedure SetCustomStyle(Index: Integer; const Value: TdxNavBarStyleItem); + protected + procedure DefineProperties(Filer: TFiler); override; + procedure DoSetVisible(Value: Boolean); override; + function GetAccessibilityHelperClass: TdxNavBarCustomAccessibilityHelperClass; virtual; + function GetCaptionPanelAccessibilityHelperClass: TdxNavBarCustomAccessibilityHelperClass; virtual; + function GetLinkContainerAccessibilityHelperClass: TdxNavBarCustomAccessibilityHelperClass; virtual; + procedure InitiateActions; override; + procedure Loaded; override; + procedure ReadLinks(Reader: TReader); + procedure WriteLinks(Writer: TWriter); + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure SetName(const NewName: TComponentName); override; + procedure StyleChanged(Sender: TObject; AType: TdxNavBarChangeType); + + procedure DoExpanded; dynamic; + procedure DoCollapsed; dynamic; + procedure DoSelectedLinkChanged; dynamic; + procedure DoTopVisibleLinkChanged; dynamic; + + procedure CreateControl; virtual; + procedure DestroyControl; virtual; + + procedure LinksChanged(ALink: TdxNavBarItemLink); + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function GetCollectionFromParent(AParent: TComponent): TcxComponentCollection; override; + + procedure AcceptControl(AControl: TdxNavBarGroupControl); virtual; + procedure ReleaseControl; virtual; + + procedure ClearLinks; + function CreateLink(AItem: TdxNavBarItem): TdxNavBarItemLink; + function FindLink(AItem: TdxNavBarItem): TdxNavBarItemLink; + procedure RemoveLink(AIndex: Integer); + procedure RemoveLinks(AItem: TdxNavBarItem); + + property CaptionPanelIAccessibilityHelper: IdxNavBarAccessibilityHelper + read GetCaptionPanelIAccessibilityHelper; + property Control: TdxNavBarGroupControl read FControl; + property IAccessibilityHelper: IdxNavBarAccessibilityHelper + read GetIAccessibilityHelper; + property LinkContainerIAccessibilityHelper: IdxNavBarAccessibilityHelper + read GetLinkContainerIAccessibilityHelper; + property LinkCount: Integer read GetLinkCount; + property Links[Index: Integer]: TdxNavBarItemLink read GetLink; + property SelectedLink: TdxNavBarItemLink read FSelectedLink; + published + property Align: TcxTopBottom read FAlign write SetAlign default vaTop; + property Caption; + property Hint; + property LargeImageIndex; + property LinksUseSmallImages: Boolean read FLinksUseSmallImages write SetLinksUseSmallImages default True; + property SelectedLinkIndex: Integer read GetSelectedLinkIndex write SetSelectedLinkIndex; + property ShowAsIconView: Boolean read FShowAsIconView write SetShowAsIconView default False; + property ShowCaption: Boolean read FShowCaption write SetShowCaption default True; + property SmallImageIndex; + property TopVisibleLinkIndex: Integer read FTopVisibleLinkIndex write SetTopVisibleLinkIndex; + property UseSmallImages: Boolean read FUseSmallImages write SetUseSmallImages default True; + property Visible; + property VisibleForCustomization: Boolean read FVisibleForCustomization write FVisibleForCustomization default True; + + // OptionsGroupControl + property OptionsGroupControl: TdxNavBarGroupControlOptions read FOptionsGroupControl write SetOptionsGroupControl; + property ShowControl: Boolean read GetShowControl write SetShowControl stored False; + property UseControl: Boolean read GetUseControl write SetUseControl stored False; + + // OptionsExpand + property OptionsExpansion: TdxNavBarGroupExpansionOptions read FOptionsExpansion write SetOptionsExpansion; + property Expandable: Boolean read GetExpandable write SetExpandable stored False; + property Expanded: Boolean read GetExpanded write SetExpanded stored False; + property ShowExpandButton: Boolean read GetShowExpandButton write SetShowExpandButton stored False; + + // Styles + property CustomStyles: TdxNavBarGroupCustomStyles read FCustomStyles write SetCustomStyles; + property StyleBackground: TdxNavBarStyleItem index 0 read GetCustomStyle write SetCustomStyle stored False; + property StyleControl: TdxNavBarStyleItem index 1 read GetCustomStyle write SetCustomStyle stored False; + property StyleHeader: TdxNavBarStyleItem index 2 read GetCustomStyle write SetCustomStyle stored False; + property StyleHeaderActive: TdxNavBarStyleItem index 3 read GetCustomStyle write SetCustomStyle stored False; + property StyleHeaderActiveHotTracked: TdxNavBarStyleItem index 4 read GetCustomStyle write SetCustomStyle stored False; + property StyleHeaderActivePressed: TdxNavBarStyleItem index 5 read GetCustomStyle write SetCustomStyle stored False; + property StyleHeaderHotTracked: TdxNavBarStyleItem index 6 read GetCustomStyle write SetCustomStyle stored False; + property StyleHeaderPressed: TdxNavBarStyleItem index 7 read GetCustomStyle write SetCustomStyle stored False; + + // Events + property OnClick; + property OnCollapsed: TNotifyEvent read FOnCollapsed write FOnCollapsed; + property OnExpanded: TNotifyEvent read FOnExpanded write FOnExpanded; + property OnSelectedLinkChanged: TNotifyEvent read FOnSelectedLinkChanged write FOnSelectedLinkChanged; + property OnTopVisibleLinkChanged: TNotifyEvent read FOnTopVisibleLinkChanged write FOnTopVisibleLinkChanged; + end; + + TdxNavBarGroupClass = class of TdxNavBarGroup; + + TdxNavBarLinksChangeEvent = procedure (Sender: TObject; ALink: TdxNavBarItemLink) of object; + + TdxNavBarCustomItems = class(TdxNavBarComponentCollection) + protected + function GetItem(Index: Integer): TdxNavBarCustomItem; + procedure SetItem(Index: Integer; Value: TdxNavBarCustomItem); + public + function Add: TdxNavBarCustomItem; + function ItemByCaption(const ACaption: string): TdxNavBarCustomItem; + property Items[Index: Integer]: TdxNavBarCustomItem read GetItem write SetItem; + end; + + TdxNavBarGroups = class(TdxNavBarCustomItems) + private + FOnLinksChange: TdxNavBarLinksChangeEvent; + protected + function GetItem(Index: Integer): TdxNavBarGroup; + procedure SetItem(Index: Integer; Value: TdxNavBarGroup); + procedure DoLinksChanged(ALink: TdxNavBarItemLink); dynamic; + public + function Add: TdxNavBarGroup; + procedure InitiateActions; override; + property Items[Index: Integer]: TdxNavBarGroup read GetItem write SetItem; default; + property OnLinksChange: TdxNavBarLinksChangeEvent read FOnLinksChange write FOnLinksChange; + end; + + TdxNavBarItemActionLink = class(TActionLink) + private + FClient: TdxNavBarItem; + protected + procedure AssignClient(AClient: TObject); override; + + function IsCaptionLinked: Boolean; override; + function IsEnabledLinked: Boolean; override; + function IsHintLinked: Boolean; override; + function IsImageIndexLinked: Boolean; override; + function IsVisibleLinked: Boolean; override; + + procedure SetCaption(const Value: string); override; + procedure SetEnabled(Value: Boolean); override; + procedure SetHint(const Value: string); override; + procedure SetImageIndex(Value: Integer); override; + procedure SetVisible(Value: Boolean); override; + end; + + { TdxNavBarItemCalculator } + + TdxNavBarCustomGroupItemCalculator = class + public + class procedure CalculateBounds(X, Y: Integer; var ALinkViewInfo); virtual; + end; + TdxNavBarCustomGroupItemCalculatorClass = class of TdxNavBarCustomGroupItemCalculator; + + { TdxNavBarItem } + + TdxNavBarItem = class(TdxNavBarCustomItem) + private + FActionLink: TdxNavBarItemActionLink; + FEnabled: Boolean; + FCustomStyles: TdxNavBarItemCustomStyles; + + function GetAction: TBasicAction; + procedure SetAction(Value: TBasicAction); + procedure SetEnabled(const Value: Boolean); + + // Styles + function GetCustomStyle(Index: Integer): TdxNavBarStyleItem; + procedure SetCustomStyles(Value: TdxNavBarItemCustomStyles); + procedure SetCustomStyle(Index: Integer; const Value: TdxNavBarStyleItem); + + procedure DoActionChange(Sender: TObject); + function IsCaptionStored: Boolean; + function IsEnabledStored: Boolean; + function IsHintStored: Boolean; + function IsImageIndexStored: Boolean; + function IsVisibleStored: Boolean; + protected + procedure Loaded; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure SetName(const NewName: TComponentName); override; + + procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); dynamic; + function CanSelect: Boolean; virtual; + class function GetCalculatorClass: TdxNavBarCustomGroupItemCalculatorClass; virtual; + protected + function GetCollectionFromParent(AParent: TComponent): TcxComponentCollection; override; + procedure StyleChanged(Sender: TObject; AType: TdxNavBarChangeType); + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + procedure Draw(const APainter, ALinkViewInfo); virtual; + procedure RemoveAllLinks; + + property ActionLink: TdxNavBarItemActionLink read FActionLink; + published + property Action: TBasicAction read GetAction write SetAction; + property Caption stored IsCaptionStored; + property Enabled: Boolean read FEnabled write SetEnabled stored IsEnabledStored; + property Hint stored IsHintStored; + property LargeImageIndex stored IsImageIndexStored; + property SmallImageIndex stored IsImageIndexStored; + property Visible stored IsVisibleStored; + + // Styles + property CustomStyles: TdxNavBarItemCustomStyles read FCustomStyles write SetCustomStyles; + property Style: TdxNavBarStyleItem index 0 read GetCustomStyle write SetCustomStyle stored False; + property StyleDisabled: TdxNavBarStyleItem index 1 read GetCustomStyle write SetCustomStyle stored False; + property StyleHotTracked: TdxNavBarStyleItem index 2 read GetCustomStyle write SetCustomStyle stored False; + property StylePressed: TdxNavBarStyleItem index 3 read GetCustomStyle write SetCustomStyle stored False; + + property OnClick; + end; + + TdxNavBarItemClass = class of TdxNavBarItem; + + TdxNavBarItems = class(TdxNavBarCustomItems) + protected + function GetItem(Index: Integer): TdxNavBarItem; + procedure SetItem(Index: Integer; Value: TdxNavBarItem); + public + function Add: TdxNavBarItem; overload; + function Add(AItemClass: TdxNavBarItemClass): TdxNavBarItem; overload; + procedure Assign(Source: TPersistent); override; + property Items[Index: Integer]: TdxNavBarItem read GetItem write SetItem; default; + end; + +function ClientToParent(const AControl: TControl; const Point: TPoint; + AParent: TWinControl): TPoint; + +implementation + +uses + SysUtils, Math, Types, Forms, cxGraphics, cxGeometry, + dxNavBarConsts, dxNavBarAccessibility, dxNavBarOffice11Views, dxNavBar; + +type + TdxNavBarPainterAccess = class(TdxNavBarPainter); + TdxCustomNavBarAccess = class(TdxCustomNavBar); + TdxNavBarPopupControlAccess = class(TdxNavBarPopupControl); + +function ClientToParent(const AControl: TControl; const Point: TPoint; + AParent: TWinControl): TPoint; +const + SParentRequired = 'Control ''%s'' has no parent window'; + SParentGivenNotAParent = 'Parent given is not a parent of ''%s'''; +var + LParent: TWinControl; +begin + if AParent = nil then + AParent := AControl.Parent; + if AParent = nil then + raise EInvalidOperation.CreateFmt(SParentRequired, [AControl.Name]); + Result := Point; + Inc(Result.X, AControl.Left); + Inc(Result.Y, AControl.Top); + LParent := AControl.Parent; + while (LParent <> nil) and (LParent <> AParent) do + begin + if LParent.Parent <> nil then + begin + Inc(Result.X, LParent.Left); + Inc(Result.Y, LParent.Top); + end; + if LParent = AParent then + Break + else + LParent := LParent.Parent; + end; + if LParent = nil then + raise EInvalidOperation.CreateFmt(SParentGivenNotAParent, [AControl.Name]); +end; + +function GetNavBar(AComponentCollectionItem: TcxComponentCollectionItem): TdxCustomNavBar; +begin + Result := AComponentCollectionItem.GetParentComponent as TdxCustomNavBar; +end; + +{ TdxNavBarItemLink } + +constructor TdxNavBarItemLink.Create(Collection: TCollection); +begin + inherited; + if Group <> nil then Group.LinksChanged(Self); +end; + +destructor TdxNavBarItemLink.Destroy; +begin + NavBarAccessibleObjectOwnerObjectDestroyed(FIAccessibilityHelper); + Selected := False; + FItem := nil; + if (Group <> nil) and not Group.IsDestroying then + Group.LinksChanged(Self); + inherited; +end; + +procedure TdxNavBarItemLink.Assign(Source: TPersistent); +begin + if Source is TdxNavBarItemLink then + begin + Data := TdxNavBarItemLink(Source).Data; + Item := TdxNavBarItemLink(Source).Item; + end + else + inherited; +end; + +function TdxNavBarItemLink.CanSelect: Boolean; +begin + Result := (Item <> nil) and Item.CanSelect; +end; + +function TdxNavBarItemLink.IsSelected: Boolean; +begin + Result := (Group <> nil) and (Group.SelectedLink = Self); +end; + +procedure TdxNavBarItemLink.InitiateAction; +begin + if (Item <> nil) and (Item.ActionLink <> nil) then Item.ActionLink.Update; +end; + +function TdxNavBarItemLink.IsAncestorEqual(AItemLink: TdxNavBarItemLink): Boolean; +begin + Result := (AItemLink = Self) or (AItemLink <> nil) and ( + (Item = nil) and (AItemLink.Item = nil) or + (Item <> nil) and (AItemLink.Item <> nil) and (Item.Name = AItemLink.Item.Name) + ); +end; + +function TdxNavBarItemLink.GetGroup: TdxNavBarGroup; +begin + if Collection is TdxNavBarItemLinks then + Result := (Collection as TdxNavBarItemLinks).Group + else Result := nil; +end; + +function TdxNavBarItemLink.GetIAccessibilityHelper: IdxNavBarAccessibilityHelper; +begin + if FIAccessibilityHelper = nil then + FIAccessibilityHelper := NavBarGetAccessibilityHelper( + TdxNavBarItemLinkAccessibilityHelper.Create(Self, + Group.Collection.ParentComponent as TdxCustomNavBar)); + Result := FIAccessibilityHelper; +end; + +procedure TdxNavBarItemLink.SetSelected(Value: Boolean); +begin + if (Selected <> Value) and (Group <> nil) and not Group.IsDestroying then + if Value then + Group.SelectedLinkIndex := Index + else + Group.SelectedLinkIndex := -1; +end; + +{ TdxNavBarItemLinks } + +constructor TdxNavBarItemLinks.Create(AGroup: TdxNavBarGroup); +begin + FGroup := AGroup; + inherited Create(TdxNavBarItemLink); +end; + +function TdxNavBarItemLinks.Add: TdxNavBarItemLink; +begin + Result := inherited Add as TdxNavBarItemLink; +end; + +function TdxNavBarItemLinks.GetOwner: TPersistent; +begin + Result := Group; +end; + +function TdxNavBarItemLinks.IsAncestorEqual(AItemLinks: TdxNavBarItemLinks): Boolean; +var + I: Integer; +begin + Result := Self = AItemLinks; + if Result then + Exit; + Result := (AItemLinks <> nil) and (Count = AItemLinks.Count); + if Result then + for I := 0 to Count - 1 do + begin + Result := Items[I].IsAncestorEqual(AItemLinks[I]); + if not Result then + Break; + end; +end; + +function TdxNavBarItemLinks.GetItem(Index: Integer): TdxNavBarItemLink; +begin + Result := inherited GetItem(Index) as TdxNavBarItemLink; +end; + +procedure TdxNavBarItemLinks.SetItem(Index: Integer; Value: TdxNavBarItemLink); +begin + inherited SetItem(Index, Value); +end; + +procedure TdxNavBarItemLinks.Update(Item: TCollectionItem); +begin + Group.Changed(Item = nil); +end; + +{ TdxNavBarGroupControl } + +constructor TdxNavBarGroupControl.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FGroupIndex := -1; + BevelInner := bvNone; + BevelOuter := bvNone; + Color := clBtnFace; + ControlStyle := ControlStyle + [csNoDesignVisible]; + DoubleBuffered := True; +{$IFDEF DELPHI7} + ParentBackground := False; +{$ENDIF} + UseDockManager := False; + FOriginalCursor := Cursor; +end; + +destructor TdxNavBarGroupControl.Destroy; +begin + FGroup := nil; + inherited Destroy; +end; + +procedure TdxNavBarGroupControl.AdjustControl(ARect: TRect; AVisible: Boolean); +var + AOriginalHeight: Integer; +begin + BeginUpdate; + try + AOriginalHeight := FOriginalHeight; + Visible := AVisible; + BoundsRect := ARect; + FOriginalHeight := AOriginalHeight; + finally + EndUpdate; + end; +end; + +procedure TdxNavBarGroupControl.BeginResize(AControl: TControl; AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); +begin + if IsOnPopupControl then + TdxNavBarPopupControlAccess(GetParentForm(Self)).BeginResize(AControl, AButton, AShift, APoint); +end; + +procedure TdxNavBarGroupControl.DrawSizeGrip(ACanvas: TCanvas; const ARect: TRect); +begin + if GetInternalNavBar <> nil then + TdxNavBarOffice11NavPanePainter(TdxCustomNavBar(GetInternalNavBar).Painter).DrawSizeGrip(ACanvas, ARect); +end; + +function TdxNavBarGroupControl.GetSizeGripRect(AControl: TControl): TRect; +begin + Result := cxNullRect; + if GetInternalNavBar <> nil then + begin + Result := cxRectOffset(TdxNavBarOffice11NavPaneViewInfo(TdxCustomNavBar(GetInternalNavBar).Painter.ViewInfo).SizeGripRect, + cxPointInvert(dxNavBarCollns.ClientToParent(AControl, Result.TopLeft, TdxCustomNavBar(GetInternalNavBar)))); + end; +end; + +function TdxNavBarGroupControl.IsOnPopupControl: Boolean; +var + AParentForm: TCustomForm; +begin + AParentForm := GetParentForm(Self); + Result := AParentForm is TdxNavBarPopupControl; +end; + +procedure TdxNavBarGroupControl.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); +begin + FOriginalHeight := AHeight; + if (Visible or (FUpdateLock > 0)) and + ((ALeft <> Left) or (ATop <> Top) or + (AWidth <> Width) or (AHeight <> Height)) then + begin + inherited SetBounds(ALeft, ATop, AWidth, AHeight); + UpdateGroup; + end; +end; + +procedure TdxNavBarGroupControl.ChangeScale(M, D: Integer); +var + AOriginalHeight: Integer; +begin + if not (csLoading in ComponentState) or (sfHeight in ScalingFlags) then + AOriginalHeight := MulDiv(FOriginalHeight, M, D) + else + AOriginalHeight := FOriginalHeight; + inherited ChangeScale(M, D); + FOriginalHeight := AOriginalHeight; +end; + +procedure TdxNavBarGroupControl.DefineProperties(Filer: TFiler); + + function NeedWriteGroupIndex: Boolean; + begin + Result := (Group <> nil) and ( + not (Filer.Ancestor is TdxNavBarGroupControl) or + (TdxNavBarGroupControl(Filer.Ancestor).Group = nil) or + (Group.Index <> TdxNavBarGroupControl(Filer.Ancestor).Group.Index) + ); + end; + + function NeedWriteOriginalHeight: Boolean; + begin + Result := not (Filer.Ancestor is TdxNavBarGroupControl) or + (OriginalHeight <> TdxNavBarGroupControl(Filer.Ancestor).OriginalHeight); + end; + +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('GroupIndex', ReadGroupIndex, WriteGroupIndex, + NeedWriteGroupIndex); + Filer.DefineProperty('OriginalHeight', ReadOriginalHeight, + WriteOriginalHeight, NeedWriteOriginalHeight); +end; + +procedure TdxNavBarGroupControl.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + inherited; + if IsOnPopupControl and PtInRect(SizeGripRect, cxPoint(X, Y)) then + BeginResize(Self, Button, Shift, cxPoint(X, Y)); +end; + +procedure TdxNavBarGroupControl.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited; + MouseOverSizeGrip := IsOnPopupControl and PtInRect(SizeGripRect, cxPoint(X, Y)); +end; + +procedure TdxNavBarGroupControl.ReadOriginalHeight(Reader: TReader); +begin + FOriginalHeight := Reader.ReadInteger; +end; + +procedure TdxNavBarGroupControl.ReadGroupIndex(Reader: TReader); +begin + FGroupIndex := Reader.ReadInteger; +end; + +procedure TdxNavBarGroupControl.WriteOriginalHeight(Writer: TWriter); +begin + Writer.WriteInteger(FOriginalHeight); +end; + +procedure TdxNavBarGroupControl.WriteGroupIndex(Writer: TWriter); +begin + Writer.WriteInteger(Group.Index); +end; + +procedure TdxNavBarGroupControl.ReadState(Reader: TReader); +var + AGroup: TdxNavBarGroup; +begin + inherited ReadState(Reader); + if not (Reader.Parent is TdxCustomNavBar) then + raise Exception.Create(cxGetResourceString(@sdxInvalideGroupControl)); + if (0 > FGroupIndex) or (FGroupIndex > TdxCustomNavBar(Reader.Parent).Groups.Count - 1) then + raise Exception.Create(cxGetResourceString(@sdxInvalideGroupControl)); + AGroup := TdxCustomNavBar(Reader.Parent).Groups[FGroupIndex]; + if (AGroup.Control <> nil) and (AGroup.Control <> Self) then + raise Exception.Create(cxGetResourceString(@sdxInvalideGroupControl)); + Group := AGroup; + Group.FControl := Self; + if not Group.UseControl then // ??? + begin + Group.OptionsGroupControl.FUseControl := True; + Group.OptionsGroupControl.FShowControl := True; + end; +// Visible := False; ??? +end; + +procedure TdxNavBarGroupControl.SetParent(AParent: TWinControl); +begin + if (AParent = nil) or ((AParent is TdxCustomNavBar) and (csLoading in ComponentState)) or + ((Group <> nil) and (AParent = Group.GetParentComponent)) then + inherited SetParent(AParent) + else raise Exception.Create(cxGetResourceString(@sdxInvalideGroupControl)); +end; + +procedure TdxNavBarGroupControl.Paint; +begin + if UseStyle then + begin + if TdxCustomNavBar(Parent).Painter.ViewInfo.GetGroupViewInfoByGroup(Group) = nil then + begin + TdxCustomNavBar(Parent).Painter.InvalidateViewInfo(doRecreate); + TdxNavBarPainterAccess(TdxCustomNavBar(Parent).Painter).CheckDrawParamChanges; + end; + if TdxCustomNavBar(Parent).Painter.ViewInfo.GetGroupViewInfoByGroup(Group) <> nil then + TdxCustomNavBar(Parent).Painter.DrawGroupControl(Canvas, ClientRect, TdxCustomNavBar(Parent).Painter.ViewInfo.GetGroupViewInfoByGroup(Group)); + end + else + inherited; + if IsOnPopupControl then + DrawSizeGrip(Canvas, SizeGripRect); +end; + +procedure TdxNavBarGroupControl.BeginUpdate; +begin + Inc(FUpdateLock); +end; + +procedure TdxNavBarGroupControl.EndUpdate; +begin + Dec(FUpdateLock); +end; + +procedure TdxNavBarGroupControl.UpdateGroup; +begin + if (FUpdateLock = 0) and (Group <> nil) then + Group.Changed(True); +end; + +function TdxNavBarGroupControl.GetInternalNavBar: TControl; +var + AControl: TWinControl; +begin + Result := nil; + if (Parent is TdxCustomNavBar) then + begin + AControl := Self; + while (AControl.Parent <> nil) and not (AControl.Parent is TdxNavBarPopupControl) do AControl := AControl.Parent; + if (AControl.Parent is TdxNavBarPopupControl) and (AControl is TdxCustomNavBar) then + Result := AControl; + end; +end; + +procedure TdxNavBarGroupControl.SetOriginalHeight(const Value: Integer); +begin + if (FOriginalHeight <> Value) and (Value > 0) then + begin + FOriginalHeight := Value; + if not (csLoading in ComponentState) then + Height := FOriginalHeight; + end; +end; + +procedure TdxNavBarGroupControl.SetUseStyle(const Value: Boolean); +begin + if FUseStyle <> Value then + begin + FUseStyle := Value; + Invalidate; + end; +end; + +function TdxNavBarGroupControl.SizeGripRect: TRect; +begin + Result := GetSizeGripRect(Self); +end; + +{$IFNDEF DELPHI7} +procedure TdxNavBarGroupControl.WMPrintClient(var Message: TWMPrintClient); +begin + if (Message.Result <> 1) and + ((Message.Flags and PRF_CHECKVISIBLE = 0) or Visible) then + PaintHandler(TWMPaint(Message)) + else + inherited; +end; +{$ENDIF} + +function TdxNavBarGroupControl.GetMouseOverSizeGrip: Boolean; +begin + Result := gcsOverSizeGrip in FInternalState; +end; + +procedure TdxNavBarGroupControl.SetMouseOverSizeGrip(AValue: Boolean); +begin + if MouseOverSizeGrip <> AValue then + if AValue then + begin + FOriginalCursor := Cursor; + Cursor := crSizeWE; + Include(FInternalState, gcsOverSizeGrip); + end + else + begin + Cursor := FOriginalCursor; + Exclude(FInternalState, gcsOverSizeGrip); + end; +end; + +procedure TdxNavBarGroupControl.CMVisibleChanged(var Message: TMessage); +begin + inherited; + UpdateGroup; +end; + +{ TdxNavBarCustomItem } + +constructor TdxNavBarCustomItem.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FLargeImageIndex := -1; + FSmallImageIndex := -1; + FVisible := True; +end; + +procedure TdxNavBarCustomItem.Assign(Source: TPersistent); +var + ANavBarCustomItem: TdxNavBarCustomItem; +begin + if Source is TdxNavBarCustomItem then + begin + ANavBarCustomItem := TdxNavBarCustomItem(Source); + LargeImageIndex := ANavBarCustomItem.LargeImageIndex; + SmallImageIndex := ANavBarCustomItem.SmallImageIndex; + Visible := ANavBarCustomItem.Visible; + end + else + inherited; +end; + +function TdxNavBarCustomItem.IsDestroying: Boolean; +begin + Result := csDestroying in ComponentState; +end; + +function TdxNavBarCustomItem.IsLoading: Boolean; +begin + Result := csLoading in ComponentState; +end; + +procedure TdxNavBarCustomItem.DoSetVisible(Value: Boolean); +begin + FVisible := Value; + Changed(True); +end; + +procedure TdxNavBarCustomItem.SetCaption(const Value: string); +begin + if FCaption <> Value then + begin + FCaption := Value; + Changed(False); + end; +end; + +procedure TdxNavBarCustomItem.SetHint(const Value: string); +begin + if FHint <> Value then + begin + FHint := Value; +// Changed; + end; +end; + +procedure TdxNavBarCustomItem.SetLargeImageIndex(const Value: Integer); +begin + if FLargeImageIndex <> Value then + begin + FLargeImageIndex := Value; + Changed(False); + end; +end; + +procedure TdxNavBarCustomItem.SetSmallImageIndex(const Value: Integer); +begin + if FSmallImageIndex <> Value then + begin + FSmallImageIndex := Value; + Changed(False); + end; +end; + +procedure TdxNavBarCustomItem.SetVisible(const Value: Boolean); +begin + if Visible <> Value then + DoSetVisible(Value); +end; + +{ TdxNavBarGroupExpandOptions } + +constructor TdxNavBarGroupExpansionOptions.Create(AOwner: TPersistent); +begin + inherited; + FExpandable := True; + FExpanded := True; + FShowExpandButton := True; +end; + +procedure TdxNavBarGroupExpansionOptions.Assign(Source: TPersistent); +begin + if Source is TdxNavBarGroupExpansionOptions then + begin + Expandable := TdxNavBarGroupExpansionOptions(Source).Expandable; + Expanded := TdxNavBarGroupExpansionOptions(Source).Expanded; + ShowExpandButton := TdxNavBarGroupExpansionOptions(Source).ShowExpandButton; + end + else + inherited; +end; + +function TdxNavBarGroupExpansionOptions.GetGroup: TdxNavBarGroup; +begin + Result := TdxNavBarGroup(Owner); +end; + +procedure TdxNavBarGroupExpansionOptions.SetExpanded(AValue: Boolean); +begin + if FExpanded <> AValue then + begin + FExpanded := AValue; + Group.Changed(True); + if FExpanded then + Group.DoExpanded + else + Group.DoCollapsed; + end; +end; + +procedure TdxNavBarGroupExpansionOptions.SetShowExpandButton(AValue: Boolean); +begin + if FShowExpandButton <> AValue then + begin + FShowExpandButton := AValue; + Group.Changed(False); + end; +end; + +{ TdxNavBarGroupControlOptions } + +procedure TdxNavBarGroupControlOptions.Assign(Source: TPersistent); +begin + if Source is TdxNavBarGroupControlOptions then + begin + AllowControlResizing := TdxNavBarGroupControlOptions(Source).AllowControlResizing; + UseControl := TdxNavBarGroupControlOptions(Source).UseControl; + ShowControl := TdxNavBarGroupControlOptions(Source).ShowControl; + end + else + inherited; +end; + +function TdxNavBarGroupControlOptions.GetGroup: TdxNavBarGroup; +begin + Result := TdxNavBarGroup(Owner); +end; + +procedure TdxNavBarGroupControlOptions.SetAllowControlResizing(AValue: Boolean); +begin + if FAllowControlResizing <> AValue then + begin + FAllowControlResizing := AValue; + Group.Changed(True); + end; +end; + +procedure TdxNavBarGroupControlOptions.SetShowControl(AValue: Boolean); +begin + if FShowControl <> AValue then + begin + FShowControl := AValue; + if FShowControl and not FUseControl and not Group.IsLoading then + begin + FUseControl := True; + Group.CreateControl; + end; + Group.Changed(True); + end; +end; + +procedure TdxNavBarGroupControlOptions.SetUseControl(AValue: Boolean); +begin + if FUseControl <> AValue then + begin + FUseControl := AValue; + if not Group.IsLoading then + if FUseControl then + begin + FShowControl := True; + Group.CreateControl; + end + else + begin + FShowControl := False; + Group.DestroyControl; + end; + Group.Changed(True); + end; +end; + +{ TdxNavBarGroup } + +constructor TdxNavBarGroup.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FLinks := TdxNavBarItemLinks.Create(Self); + FOptionsGroupControl := TdxNavBarGroupControlOptions.Create(Self); + FOptionsExpansion := TdxNavBarGroupExpansionOptions.Create(Self); + FCustomStyles := TdxNavBarGroupCustomStyles.Create(Self); + FCustomStyles.OnChange := StyleChanged; + FLinksUseSmallImages := True; + FLoadedSelectedLinkIndex := -1; + FShowCaption := True; + FTopVisibleLinkIndex := 0; + FUseSmallImages := True; + FVisibleForCustomization := True; +end; + +destructor TdxNavBarGroup.Destroy; +begin + NavBarAccessibleObjectOwnerObjectDestroyed(FCaptionPanelIAccessibilityHelper); + NavBarAccessibleObjectOwnerObjectDestroyed(FIAccessibilityHelper); + NavBarAccessibleObjectOwnerObjectDestroyed(FLinkContainerIAccessibilityHelper); + FreeAndNil(FCustomStyles); + DestroyControl; + FreeAndNil(FOptionsExpansion); + FreeAndNil(FOptionsGroupControl); + FreeAndNil(FLinks); + inherited Destroy; +end; + +function TdxNavBarGroup.GetCollectionFromParent(AParent: TComponent): TcxComponentCollection; +begin + Result := (AParent as TdxCustomNavBar).Groups; +end; + +procedure TdxNavBarGroup.ClearLinks; +begin + FLinks.Clear; +end; + +function TdxNavBarGroup.CreateLink(AItem: TdxNavBarItem): TdxNavBarItemLink; +begin + Result := FLinks.Add; + Result.Item := AItem; +end; + +function TdxNavBarGroup.FindLink(AItem: TdxNavBarItem): TdxNavBarItemLink; +var + I: Integer; +begin + Result := nil; + for I := 0 to LinkCount - 1 do + if Links[I].Item = AItem then + begin + Result := Links[I]; + break; + end; +end; + +procedure TdxNavBarGroup.RemoveLink(AIndex: Integer); +begin + FLinks.Delete(AIndex); +end; + +procedure TdxNavBarGroup.RemoveLinks(AItem: TdxNavBarItem); +var + I: Integer; +begin + I := 0; + while I < LinkCount do + if Links[I].Item = AItem then + RemoveLink(I) + else Inc(I); +end; + +procedure TdxNavBarGroup.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('Links', ReadLinks, WriteLinks, True); +end; + +procedure TdxNavBarGroup.DoSetVisible(Value: Boolean); +var + AActiveGroup: TdxNavBarGroup; +begin + if not IsLoading then + AActiveGroup := GetNavBar(Self).ActiveGroup + else + AActiveGroup := nil; + + FVisible := Value; + if Control <> nil then + Control.Visible := FVisible; + Changed(True); + + if not IsLoading then + if FVisible and (AActiveGroup = nil) then + GetNavBar(Self).ActiveGroup := Self + else + if not FVisible and (AActiveGroup = Self) then + GetNavBar(Self).ActiveGroup := nil; +end; + +function TdxNavBarGroup.GetAccessibilityHelperClass: TdxNavBarCustomAccessibilityHelperClass; +begin + Result := TdxNavBarGroupAccessibilityHelper; +end; + +function TdxNavBarGroup.GetCaptionPanelAccessibilityHelperClass: TdxNavBarCustomAccessibilityHelperClass; +begin + Result := TdxNavBarGroupCaptionPanelAccessibilityHelper; +end; + +function TdxNavBarGroup.GetLinkContainerAccessibilityHelperClass: TdxNavBarCustomAccessibilityHelperClass; +begin + Result := TdxNavBarItemLinkContainerAccessibilityHelper; +end; + +procedure TdxNavBarGroup.Loaded; +begin + inherited; + if FControl = nil then // ??? + begin + OptionsGroupControl.FUseControl := False; + OptionsGroupControl.FShowControl := False; + end; + SelectedLinkIndex := FLoadedSelectedLinkIndex; +end; + +procedure TdxNavBarGroup.ReadLinks(Reader: TReader); +begin + Reader.ReadValue; + Reader.ReadCollection(FLinks); + Changed(True); +end; + +procedure TdxNavBarGroup.WriteLinks(Writer: TWriter); +begin + Writer.WriteCollection(FLinks); +end; + +procedure TdxNavBarGroup.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if Operation = opRemove then + begin + if AComponent is TdxNavBarItem then RemoveLinks(AComponent as TdxNavBarItem); + if AComponent = Control then UseControl := False; + end; +end; + +procedure TdxNavBarGroup.SetName(const NewName: TComponentName); +var + L: Integer; + OldName, NewControlName: string; + ChangeCaption: Boolean; +begin + ChangeCaption := not IsLoading and (Name = Caption); + OldName := Name; + L := Length(OldName); + inherited SetName(NewName); + if (Control <> nil) and (csDesigning in ComponentState) and not IsLoading then + begin + NewControlName := Control.Name; + if Pos(OldName, NewControlName) = 1 then + begin + Delete(NewControlName, 1, L); + Insert(Name, NewControlName, 1); + try + Control.Name := NewControlName; + except + on EComponentError do ; {Ignore rename errors } + end; + end; + end; + if ChangeCaption then Caption := NewName; +end; + +procedure TdxNavBarGroup.StyleChanged(Sender: TObject; AType: TdxNavBarChangeType); +begin + Changed(True); +end; + +procedure TdxNavBarGroup.InitiateActions; +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + Links[I].InitiateAction; +end; + +procedure TdxNavBarGroup.DoExpanded; +begin + if Assigned(FOnExpanded) then + FOnExpanded(Self); +end; + +procedure TdxNavBarGroup.DoCollapsed; +begin + if Assigned(FOnCollapsed) then + FOnCollapsed(Self); +end; + +procedure TdxNavBarGroup.DoSelectedLinkChanged; +begin + if Assigned(FOnSelectedLinkChanged) then + FOnSelectedLinkChanged(Self); +end; + +procedure TdxNavBarGroup.DoTopVisibleLinkChanged; +begin + if Assigned(FOnTopVisibleLinkChanged) then + FOnTopVisibleLinkChanged(Self); +end; + +procedure TdxNavBarGroup.CreateControl; +begin + if IsLoading then exit; + if (FControl = nil) and (Collection <> nil) then + begin + FControl := TdxNavBarGroupControl.Create(Owner); + FControl.Group := Self; + if Name <> '' then FControl.Name := Name + 'Control'; + FControl.Parent := TWinControl(GetParentComponent); + end +end; + +procedure TdxNavBarGroup.DestroyControl; +begin + if (FControl <> nil) and not (csDestroying in FControl.ComponentState) then + FControl.Free; + FControl := nil; +end; + +procedure TdxNavBarGroup.AcceptControl(AControl: TdxNavBarGroupControl); +begin + if (Collection = nil) or (AControl.Parent <> GetParentComponent) then exit; + FControl := AControl; + FControl.Group := Self; +end; + +procedure TdxNavBarGroup.ReleaseControl; +begin + if FControl <> nil then + begin + FControl.Group := nil; + FControl := nil; + end; +end; + +procedure TdxNavBarGroup.LinksChanged(ALink: TdxNavBarItemLink); + + procedure UpdateTopVisibleLinkIndex; + begin + TopVisibleLinkIndex := TopVisibleLinkIndex; + end; + +begin + if Collection is TdxNavBarGroups then + (Collection as TdxNavBarGroups).DoLinksChanged(ALink); + UpdateTopVisibleLinkIndex; +end; + +function TdxNavBarGroup.GetCaptionPanelIAccessibilityHelper: IdxNavBarAccessibilityHelper; +begin + if FCaptionPanelIAccessibilityHelper = nil then + FCaptionPanelIAccessibilityHelper := NavBarGetAccessibilityHelper( + GetCaptionPanelAccessibilityHelperClass.Create(Self, + Collection.ParentComponent as TdxCustomNavBar)); + Result := FCaptionPanelIAccessibilityHelper; +end; + +function TdxNavBarGroup.GetIAccessibilityHelper: IdxNavBarAccessibilityHelper; +begin + if FIAccessibilityHelper = nil then + FIAccessibilityHelper := NavBarGetAccessibilityHelper( + GetAccessibilityHelperClass.Create(Self, + Collection.ParentComponent as TdxCustomNavBar)); + Result := FIAccessibilityHelper; +end; + +function TdxNavBarGroup.GetLinkContainerIAccessibilityHelper: IdxNavBarAccessibilityHelper; +begin + if FLinkContainerIAccessibilityHelper = nil then + FLinkContainerIAccessibilityHelper := NavBarGetAccessibilityHelper( + GetLinkContainerAccessibilityHelperClass.Create(Self, + Collection.ParentComponent as TdxCustomNavBar)); + Result := FLinkContainerIAccessibilityHelper; +end; + +function TdxNavBarGroup.GetLinkCount: Integer; +begin + Result := FLinks.Count; +end; + +function TdxNavBarGroup.GetLink(Index: Integer): TdxNavBarItemLink; +begin + Result := FLinks[Index]; +end; + +function TdxNavBarGroup.GetSelectedLinkIndex: Integer; +begin + if IsLoading then + Result := FLoadedSelectedLinkIndex + else + if SelectedLink = nil then + Result := -1 + else + Result := SelectedLink.Index; +end; + +procedure TdxNavBarGroup.SetAlign(const Value: TcxTopBottom); +begin + if FAlign <> Value then + begin + FAlign := Value; + Changed(True); + end; +end; + +function TdxNavBarGroup.GetExpandable: Boolean; +begin + Result := OptionsExpansion.Expandable; +end; + +function TdxNavBarGroup.GetExpanded: Boolean; +begin + Result := OptionsExpansion.Expanded; +end; + +function TdxNavBarGroup.GetShowExpandButton: Boolean; +begin + Result := OptionsExpansion.ShowExpandButton; +end; + +procedure TdxNavBarGroup.SetOptionsExpansion(const Value: TdxNavBarGroupExpansionOptions); +begin + if FOptionsExpansion <> Value then + FOptionsExpansion.Assign(Value); +end; + +procedure TdxNavBarGroup.SetExpandable(const Value: Boolean); +begin + OptionsExpansion.Expandable := Value; +end; + +procedure TdxNavBarGroup.SetExpanded(const Value: Boolean); +begin + OptionsExpansion.Expanded := Value; +end; + +procedure TdxNavBarGroup.SetShowExpandButton(const Value: Boolean); +begin + OptionsExpansion.ShowExpandButton := Value; +end; + +procedure TdxNavBarGroup.SetSelectedLinkIndex(Value: Integer); +begin + if IsLoading then + FLoadedSelectedLinkIndex := Value + else + begin + if (Value < -1) or not GetNavBar(Self).AllowSelectLinks then + Value := -1 + else + if Value > LinkCount - 1 then + Value := LinkCount - 1; + + if SelectedLinkIndex <> Value then + begin + if not GetNavBar(Self).EachGroupHasSelectedLink and + (SelectedLinkIndex = -1) and (Value <> -1) then + GetNavBar(Self).DeSelectLinks; + if Value = -1 then + FSelectedLink := nil + else + FSelectedLink := Links[Value]; + Changed(False); + DoSelectedLinkChanged; + end; + end; +end; + +procedure TdxNavBarGroup.SetShowAsIconView(const Value: Boolean); +begin + if FShowAsIconView <> Value then + begin + FShowAsIconView := Value; + Changed(False); + end; +end; + +procedure TdxNavBarGroup.SetShowCaption(const Value: Boolean); +begin + if FShowCaption <> Value then + begin + FShowCaption := Value; + Changed(False); + end; +end; + +procedure TdxNavBarGroup.SetTopVisibleLinkIndex(Value: Integer); +begin + if IsLoading then + FTopVisibleLinkIndex := Value + else + begin + Value := Min(Value, LinkCount - 1); + Value := Max(Value, 0); + if FTopVisibleLinkIndex <> Value then + begin + FTopVisibleLinkIndex := Value; + Changed(False); + DoTopVisibleLinkChanged; + end; + end; +end; + +procedure TdxNavBarGroup.SetLinksUseSmallImages(const Value: Boolean); +begin + if FLinksUseSmallImages <> Value then + begin + FLinksUseSmallImages := Value; + Changed(False); + end; +end; + +procedure TdxNavBarGroup.SetUseSmallImages(const Value: Boolean); +begin + if FUseSmallImages <> Value then + begin + FUseSmallImages := Value; + Changed(False); + end; +end; + +function TdxNavBarGroup.GetShowControl: Boolean; +begin + Result := OptionsGroupControl.ShowControl; +end; + +function TdxNavBarGroup.GetUseControl: Boolean; +begin + Result := OptionsGroupControl.UseControl; +end; + +procedure TdxNavBarGroup.SetOptionsGroupControl(const Value: TdxNavBarGroupControlOptions); +begin + if FOptionsGroupControl <> Value then + FOptionsGroupControl.Assign(Value); +end; + +procedure TdxNavBarGroup.SetShowControl(const Value: Boolean); +begin + OptionsGroupControl.ShowControl := Value; +end; + +procedure TdxNavBarGroup.SetUseControl(const Value: Boolean); +begin + OptionsGroupControl.UseControl := Value; +end; + +procedure TdxNavBarGroup.SetCustomStyles(Value: TdxNavBarGroupCustomStyles); +begin + FCustomStyles.Assign(Value); +end; + +function TdxNavBarGroup.GetCustomStyle(Index: Integer): TdxNavBarStyleItem; +begin + Result := CustomStyles.Styles[Index]; +end; + +procedure TdxNavBarGroup.SetCustomStyle(Index: Integer; const Value: TdxNavBarStyleItem); +begin + CustomStyles.Styles[Index] := Value; +end; + +{ TdxNavBarCustomItems } + +function TdxNavBarCustomItems.Add: TdxNavBarCustomItem; +begin + Result := inherited Add as TdxNavBarCustomItem; +end; + +function TdxNavBarCustomItems.ItemByCaption(const ACaption: string): TdxNavBarCustomItem; +var + I: Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + if Items[I].Caption = ACaption then + begin + Result := Items[I]; + Break; + end; +end; + +function TdxNavBarCustomItems.GetItem(Index: Integer): TdxNavBarCustomItem; +begin + Result := inherited GetItem(Index) as TdxNavBarCustomItem; +end; + +procedure TdxNavBarCustomItems.SetItem(Index: Integer; Value: TdxNavBarCustomItem); +begin + inherited SetItem(Index, Value); +end; + +{ TdxNavBarGroups } + +function TdxNavBarGroups.Add: TdxNavBarGroup; +begin + Result := inherited Add as TdxNavBarGroup; +end; + +procedure TdxNavBarGroups.InitiateActions; +begin + inherited InitiateActions; +end; + +function TdxNavBarGroups.GetItem(Index: Integer): TdxNavBarGroup; +begin + Result := inherited GetItem(Index) as TdxNavBarGroup; +end; + +procedure TdxNavBarGroups.SetItem(Index: Integer; Value: TdxNavBarGroup); +begin + inherited SetItem(Index, Value); +end; + +procedure TdxNavBarGroups.DoLinksChanged(ALink: TdxNavBarItemLink); +begin + if UpdateCount = 0 then + if Assigned(FOnLinksChange) then FOnLinksChange(Self, ALink); +end; + +{ TdxNavBarItemActionLink } + +procedure TdxNavBarItemActionLink.AssignClient(AClient: TObject); +begin + FClient := AClient as TdxNavBarItem; +end; + +function TdxNavBarItemActionLink.IsCaptionLinked: Boolean; +begin + Result := inherited IsCaptionLinked and + (FClient.Caption = (Action as TCustomAction).Caption); +end; + +function TdxNavBarItemActionLink.IsEnabledLinked: Boolean; +begin + Result := inherited IsEnabledLinked and + (FClient.Enabled = (Action as TCustomAction).Enabled); +end; + +function TdxNavBarItemActionLink.IsHintLinked: Boolean; +begin + Result := inherited IsHintLinked and + (FClient.Hint = (Action as TCustomAction).Hint); +end; + +function TdxNavBarItemActionLink.IsImageIndexLinked: Boolean; +begin + Result := inherited IsImageIndexLinked and + (FClient.LargeImageIndex = (Action as TCustomAction).ImageIndex) and + (FClient.SmallImageIndex = (Action as TCustomAction).ImageIndex); +end; + +function TdxNavBarItemActionLink.IsVisibleLinked: Boolean; +begin + Result := inherited IsImageIndexLinked and + (FClient.Visible = (Action as TCustomAction).Visible); +end; + +procedure TdxNavBarItemActionLink.SetCaption(const Value: string); +begin + if IsCaptionLinked then FClient.Caption := Value; +end; + +procedure TdxNavBarItemActionLink.SetEnabled(Value: Boolean); +begin + if IsEnabledLinked then FClient.Enabled := Value; +end; + +procedure TdxNavBarItemActionLink.SetHint(const Value: string); +begin + if IsHintLinked then FClient.Hint := Value; +end; + +procedure TdxNavBarItemActionLink.SetImageIndex(Value: Integer); +begin + if IsImageIndexLinked then + begin + FClient.LargeImageIndex := Value; + FClient.SmallImageIndex := Value; + end; +end; + +procedure TdxNavBarItemActionLink.SetVisible(Value: Boolean); +begin + if IsVisibleLinked then FClient.Visible := Value; +end; + +{ TdxNavBarItemCalculator } + +class procedure TdxNavBarCustomGroupItemCalculator.CalculateBounds(X, Y: Integer; var ALinkViewInfo); +begin +end; + +{ TdxNavBarItem } + +constructor TdxNavBarItem.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FCustomStyles := TdxNavBarItemCustomStyles.Create(Self); + FCustomStyles.OnChange := StyleChanged; + FEnabled := True; +end; + +destructor TdxNavBarItem.Destroy; +begin + FreeAndNil(FCustomStyles); + FreeAndNil(FActionLink); + inherited Destroy; +end; + +procedure TdxNavBarItem.Assign(Source: TPersistent); +var + ANavBarItem: TdxNavBarItem; +begin + if Source is TdxNavBarItem then + begin + inherited; + ANavBarItem := TdxNavBarItem(Source); + Action := ANavBarItem.Action; + Caption := ANavBarItem.Caption; + Enabled := ANavBarItem.Enabled; + Hint := ANavBarItem.Hint; + CustomStyles := ANavBarItem.CustomStyles; + OnClick := ANavBarItem.OnClick; + end; +end; + +function TdxNavBarItem.GetCollectionFromParent(AParent: TComponent): TcxComponentCollection; +begin + Result := (AParent as TdxCustomNavBar).Items; +end; + +procedure TdxNavBarItem.Draw(const APainter, ALinkViewInfo); +begin + TdxNavBarPainter(APainter).DrawItem(TdxNavBarLinkViewInfo(ALinkViewInfo)); +end; + +procedure TdxNavBarItem.RemoveAllLinks; +var + I: Integer; +begin + for I := 0 to GetNavBar(Self).Groups.Count - 1 do + GetNavBar(Self).Groups[I].RemoveLinks(Self); +end; + +procedure TdxNavBarItem.Loaded; +begin + inherited; + if Action <> nil then ActionChange(Action, True); +end; + +procedure TdxNavBarItem.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if Operation = opRemove then + begin + if AComponent = Action then Action := nil; + end; +end; + +procedure TdxNavBarItem.SetName(const NewName: TComponentName); +var + ChangeCaption: Boolean; +begin + ChangeCaption := not (csLoading in ComponentState) and (Name = Caption); + inherited SetName(NewName); + if ChangeCaption then Caption := NewName; +end; + +procedure TdxNavBarItem.ActionChange(Sender: TObject; CheckDefaults: Boolean); +begin + if Action is TCustomAction then + with TCustomAction(Sender) do + begin + if not CheckDefaults or (Self.Caption = '') then + Self.Caption := Caption; + if not CheckDefaults or (Self.Enabled = True) then + Self.Enabled := Enabled; + if not CheckDefaults or (Self.Hint = '') then + Self.Hint := Hint; + if not CheckDefaults or ((Self.LargeImageIndex = -1) and (Self.SmallImageIndex = -1))then + begin + Self.LargeImageIndex := ImageIndex; + Self.SmallImageIndex := ImageIndex; + end; + if not CheckDefaults or (Self.Visible = True) then + Self.Visible := Visible; + end; +end; + +function TdxNavBarItem.CanSelect: Boolean; +begin + Result := Enabled; +end; + +class function TdxNavBarItem.GetCalculatorClass: TdxNavBarCustomGroupItemCalculatorClass; +begin + Result := TdxNavBarItemCalculator; +end; + +procedure TdxNavBarItem.StyleChanged(Sender: TObject; AType: TdxNavBarChangeType); +begin + Changed(False); +end; + +function TdxNavBarItem.GetAction: TBasicAction; +begin + if FActionLink = nil then Result := nil + else Result := FActionLink.Action; +end; + +procedure TdxNavBarItem.SetAction(Value: TBasicAction); +begin + if Value = nil then + begin + if FActionLink <> nil then + FActionLink.Free; + FActionLink := nil; + end + else + begin + if (Value is TCustomAction) and (csDesigning in Value.ComponentState) then + TCustomAction(Value).DisableIfNoHandler := False; + if FActionLink = nil then + FActionLink := TdxNavBarItemActionLink.Create(Self); + FActionLink.Action := Value; + FActionLink.OnChange := DoActionChange; + ActionChange(Value, csLoading in Value.ComponentState); + Value.FreeNotification(Self); + end; +end; + +procedure TdxNavBarItem.SetEnabled(const Value: Boolean); +begin + if FEnabled <> Value then + begin + FEnabled := Value; + Changed(False); + end; +end; + +function TdxNavBarItem.GetCustomStyle(Index: Integer): TdxNavBarStyleItem; +begin + Result := CustomStyles.Styles[Index]; +end; + +procedure TdxNavBarItem.SetCustomStyles(Value: TdxNavBarItemCustomStyles); +begin + FCustomStyles.Assign(Value); +end; + +procedure TdxNavBarItem.SetCustomStyle(Index: Integer; const Value: TdxNavBarStyleItem); +begin + CustomStyles.Styles[Index] := Value; +end; + +procedure TdxNavBarItem.DoActionChange(Sender: TObject); +begin + if Sender = Action then ActionChange(Sender, False); +end; + +function TdxNavBarItem.IsCaptionStored: Boolean; +begin + Result := (FActionLink = nil) or not FActionLink.IsCaptionLinked; +end; + +function TdxNavBarItem.IsEnabledStored: Boolean; +begin + Result := (Enabled = False) and ((FActionLink = nil) or not FActionLink.IsEnabledLinked); +end; + +function TdxNavBarItem.IsHintStored: Boolean; +begin + Result := (FActionLink = nil) or not FActionLink.IsHintLinked; +end; + +function TdxNavBarItem.IsImageIndexStored: Boolean; +begin + Result := (FActionLink = nil) or not FActionLink.IsImageIndexLinked; +end; + +function TdxNavBarItem.IsVisibleStored: Boolean; +begin + Result := (FActionLink = nil) or not FActionLink.IsVisibleLinked; +end; + +{ TdxNavBarItems } + +function TdxNavBarItems.Add: TdxNavBarItem; +begin + Result := inherited Add as TdxNavBarItem; +end; + +function TdxNavBarItems.Add(AItemClass: TdxNavBarItemClass): TdxNavBarItem; +begin + Result := AItemClass.Create(ParentComponent.Owner); + Result.SetParentComponent(ParentComponent); + SetItemName(Result); +end; + +procedure TdxNavBarItems.Assign(Source: TPersistent); +var + I: Integer; + AItem: TdxNavBarItem; +begin + if Source is TdxNavBarItems then + begin + BeginUpdate; + try + Clear; + for I := 0 to TdxNavBarItems(Source).Count - 1 do + begin + AItem := TdxNavBarItems(Source).Items[I]; + Add(TdxNavBarItemClass(AItem.ClassType)).Assign(AItem); + end; + finally + EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +function TdxNavBarItems.GetItem(Index: Integer): TdxNavBarItem; +begin + Result := inherited GetItem(Index) as TdxNavBarItem; +end; + +procedure TdxNavBarItems.SetItem(Index: Integer; Value: TdxNavBarItem); +begin + inherited SetItem(Index, Value); +end; + +initialization + RegisterClasses([TdxNavBarItemLink, TdxNavBarItemLinks, + TdxNavBarGroupControl, TdxNavBarGroup, TdxNavBarItem]); + +end. diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarConsts.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarConsts.pas new file mode 100644 index 00000000..eb6a86db --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarConsts.pas @@ -0,0 +1,101 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarConsts; + +{$I cxVer.inc} + +interface + +uses + Classes, cxLibraryConsts; + +const + dxNavBarDefaultLargeImageHeight = 32; + dxNavBarDefaultLargeImageWidth = 32; + dxNavBarDefaultSmallImageHeight = 16; + dxNavBarDefaultSmallImageWidth = 16; + + dxNavBarActivateGroupInterval = 300; + dxNavBarScrollInterval = 300; + + dxNavBarCursors: array[0..2] of TIdentMapEntry = ( + (Value: dxNavBarDragCursor; Name: 'dxcrDrag'), + (Value: dxNavBarDragCopyCursor; Name: 'dxcrDragCopy'), + (Value: dxNavBarLinksCursor; Name: 'dxcrLinks')); + +//Views + dxNavBarBaseView = 0; + dxNavBarFlatView = 1; + dxNavBarOffice1View = 2; + dxNavBarOffice2View = 3; + dxNavBarOffice3View = 4; + dxNavBarVSToolBoxView = 5; + dxNavBarXP1View = 6; + dxNavBarXP2View = 7; + dxNavBarExplorerBarView = 8; + dxNavBarUltraFlatExplorerView = 9; + dxNavBarAdvExplorerBarView = 10; + dxNavBarXPExplorerBarView = 11; + dxNavBarOffice11TaskPaneView = 12; + dxNavBarOffice11NavigatorPaneView = 13; + dxNavBarOffice11ExplorerBarView = 16; + dxNavBarOffice12NavigatorPaneView = 17; + dxNavBarOffice12ExplorerBarView = 18; + dxNavBarVistaExplorerBarView = 19; + dxNavBarSkinExplorerBarView = 14; + dxNavBarSkinNavigatorPaneView = 15; + +resourcestring + sdxNavigationPaneOverflowPanelCustomizeHint = 'Configure buttons'; + sdxNavigationPaneMinimizeNavPaneSignHint = 'Minimize Navigation Pane'; + sdxNavigationPaneExpandNavPaneSignHint = 'Expand Navigation Pane'; + sdxNavigationPaneCollapseBarHint = 'Click to expand Navigation Pane'; + sdxNavigationPaneCollapseBar = 'Navigation Pane'; + +//Exception messages + + sdxInvalideGroupControl = 'Invalid the TdxNavBarGroupControl parent or group.'; + sdxCannotFindView = 'Cannot find view with ID = %d.'; + sdxViewAlreadyExists = 'ID of view = %d is already exists.'; + +//Office11Views popup menu captions + + sdxNavBarOffice11ShowMoreButtons = 'Show &More Buttons'; + sdxNavBarOffice11ShowFewerButtons = 'Show &Fewer Buttons'; + sdxNavBarOffice11AddRemoveButtons = '&Add or Remove Buttons'; + +implementation + +end. diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarCustomPainters.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarCustomPainters.pas new file mode 100644 index 00000000..af92f668 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarCustomPainters.pas @@ -0,0 +1,926 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarCustomPainters; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Windows, Graphics, ImgList, dxNavBar, dxNavBarStyles; + +type + TdxNavBarCustomImagePainter = class + protected + class function GetRGBColor(Value: TColor): DWORD; + class procedure InternalDrawImage(ACanvas: TCanvas; AImageList: TCustomImageList; + AImageIndex: Integer; ARect: TRect; AEnabled: Boolean); virtual; + public + class procedure DrawImage(ACanvas: TCanvas; AImageList: TCustomImageList; + AImageIndex: Integer; ARect: TRect; AEnabled: Boolean = True); + class function IsValidImage(AImageList: TCustomImageList;AImageIndex: Integer): Boolean; + end; + TdxNavBarCustomImagePainterClass = class of TdxNavBarCustomImagePainter; + + TdxNavBarCustomSelectionPainter = class + protected + class procedure GetColors(AState: TdxNavBarObjectStates; ABackColor: TColor; out AFillColor, + ATopLeftOuterColor, ABottomRightOuterColor, ATopLeftInnerColor, ABottomRightInnerColor: TColor); virtual; + class procedure InternalDrawSelection(ACanvas: TCanvas; ARect: TRect; + ABackColor: TColor; AState: TdxNavBarObjectStates); virtual; + class function IsPressed(AState: TdxNavBarObjectStates): Boolean; virtual; + public + class procedure DrawSelection(ACanvas: TCanvas; ARect: TRect; + ABackColor: TColor; AState: TdxNavBarObjectStates); + end; + TdxNavBarCustomSelectionPainterClass = class of TdxNavBarCustomSelectionPainter; + + TdxNavBarUltraFlatSelectionPainter = class(TdxNavBarCustomSelectionPainter) + protected + class procedure GetColors(AState: TdxNavBarObjectStates; ABackColor: TColor; out AFillColor, + ATopLeftOuterColor, ABottomRightOuterColor, ATopLeftInnerColor, ABottomRightInnerColor: TColor); override; + class function IsPressed(AState: TdxNavBarObjectStates): Boolean; override; + end; + + TdxNavBarCustomBackgroundPainter = class + private + class procedure InternalDrawGradientBackground(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AEraseBackground: Boolean; ABackgroundColor: TColor; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode); + protected + class procedure DrawPicture(ACanvas: TCanvas; ARect: TRect; APicture: TPicture); + class procedure FillGradientRect(DC: HDC; const ARect: TRect; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode); + class procedure InternalDrawBackground(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AEraseBackground: Boolean; ABackgroundColor: TColor; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode); virtual; + public + class procedure DrawBackground(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AEraseBackground: Boolean; ABackgroundColor: TColor; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode); + end; + TdxNavBarCustomBackgroundPainterClass = class of TdxNavBarCustomBackgroundPainter; + + TdxNavBarCustomGroupBackgroundPainter = class + protected + class procedure InternalDrawBackground(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode); virtual; + public + class procedure DrawBackground(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode); + end; + TdxNavBarCustomGroupBackgroundPainterClass = class of TdxNavBarCustomGroupBackgroundPainter; + + TdxNavBarCustomGroupBorderPainter = class + protected + class procedure InternalDrawBorder(ACanvas: TCanvas; ARect: TRect; AColor: TColor; AWithCaption: Boolean); virtual; + public + class procedure DrawBorder(ACanvas: TCanvas; ARect: TRect; AColor: TColor; AWithCaption: Boolean); + end; + TdxNavBarCustomGroupBorderPainterClass = class of TdxNavBarCustomGroupBorderPainter; + + TdxNavBarCustomSignPainter = class + protected + class procedure InternalDrawSign(ACanvas: TCanvas; ARect: TRect; + AForeColor, ABackColor1, ABackColor2: TColor; AState: TdxNavBarObjectStates); virtual; + public + class procedure DrawSign(ACanvas: TCanvas; ARect: TRect; + AForeColor, ABackColor1, ABackColor2: TColor; AState: TdxNavBarObjectStates); + end; + TdxNavBarCustomSignPainterClass = class of TdxNavBarCustomSignPainter; + + TdxNavBarCustomHintPainter = class + protected + class procedure InternalDrawHint(ACanvas: TCanvas; ARect: TRect; AHint: string; + APicture: TPicture; AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; AFont: TFont); virtual; + public + class procedure DrawHint(ACanvas: TCanvas; ARect: TRect; AHint: string; + APicture: TPicture; AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; AFont: TFont); + end; + TdxNavBarCustomHintPainterClass = class of TdxNavBarCustomHintPainter; + + TdxNavBarCustomButtonPainter = class + protected + class procedure InternalDrawButton(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; + AState: TdxNavBarObjectStates); virtual; + public + class procedure DrawButton(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; + AState: TdxNavBarObjectStates); + end; + TdxNavBarCustomButtonPainterClass = class of TdxNavBarCustomButtonPainter; + + TdxNavBarCustomScrollButtonsPainter = class + protected + class procedure InternalDrawBottomButton(ACanvas: TCanvas; ARect: TRect; + AButtonPainterClass: TdxNavBarCustomButtonPainterClass; AColor1, AColor2: TColor; + AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode; + ABorderColor: TColor; AState: TdxNavBarObjectStates); virtual; + class procedure InternalDrawTopButton(ACanvas: TCanvas; ARect: TRect; + AButtonPainterClass: TdxNavBarCustomButtonPainterClass; AColor1, AColor2: TColor; + AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode; + ABorderColor: TColor; AState: TdxNavBarObjectStates); virtual; + public + class procedure DrawBottomButton(ACanvas: TCanvas; ARect: TRect; + AButtonPainterClass: TdxNavBarCustomButtonPainterClass; AColor1, AColor2: TColor; + AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode; + ABorderColor: TColor; AState: TdxNavBarObjectStates); + class procedure DrawTopButton(ACanvas: TCanvas; ARect: TRect; + AButtonPainterClass: TdxNavBarCustomButtonPainterClass; AColor1, AColor2: TColor; + AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode; + ABorderColor: TColor; AState: TdxNavBarObjectStates); + end; + TdxNavBarCustomScrollButtonsPainterClass = class of TdxNavBarCustomScrollButtonsPainter; + + TdxNavBarCustomDropTargetLinkPainter = class + protected + class procedure InternalDrawTargetLink(ACanvas: TCanvas; + pt1, pt2, pt3, pt4, pt5, pt6: TPoint; AColor: TColor); virtual; + public + class procedure DrawTargetLink(ACanvas: TCanvas; + pt1, pt2, pt3, pt4, pt5, pt6: TPoint; AColor: TColor); + end; + TdxNavBarCustomDropTargetLinkPainterClass = class of TdxNavBarCustomDropTargetLinkPainter; + + TdxNavBarCustomDropTargetGroupPainter = class + protected + class procedure InternalDrawTargetGroup(ACanvas: TCanvas; ARect: TRect; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode); virtual; + public + class procedure DrawTargetGroup(ACanvas: TCanvas; ARect: TRect; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode); + end; + TdxNavBarCustomDropTargetGroupPainterClass = class of TdxNavBarCustomDropTargetGroupPainter; + + TdxNavBarViewInfoAccess = class(TdxNavBarViewInfo); + TdxNavBarLinkViewInfoAccess = class(TdxNavBarLinkViewInfo); + + TdxNavBarElementPainter = class(TdxNavBarPainter) + protected + // Drawing + procedure DoDrawDropTargetLinkSelection(AItemGroup: TdxNavBarGroupViewInfo; AItem1, AItem2: TdxNavBarLinkViewInfo); virtual; + procedure DoDrawHint(ACanvas: TCanvas; const ARect: TRect); override; + // Painters + class function BackgroundPainterClass: TdxNavBarCustomBackgroundPainterClass; virtual; + class function ButtonPainterClass: TdxNavBarCustomButtonPainterClass; virtual; + class function DropTargetGroupPainterClass: TdxNavBarCustomDropTargetGroupPainterClass; virtual; + class function DropTargetLinkPainterClass: TdxNavBarCustomDropTargetLinkPainterClass; virtual; + class function GroupBackgroundPainterClass: TdxNavBarCustomGroupBackgroundPainterClass; virtual; + class function GroupBorderPainterClass: TdxNavBarCustomGroupBorderPainterClass; virtual; + class function ImagePainterClass: TdxNavBarCustomImagePainterClass; virtual; + class function ScrollButtonsPainterClass: TdxNavBarCustomScrollButtonsPainterClass; virtual; + class function SelectionPainterClass: TdxNavBarCustomSelectionPainterClass; virtual; + class function SignPainterClass: TdxNavBarCustomSignPainterClass; virtual; + public + // Drawing + procedure DrawBackground; override; + procedure DrawDropTargetGroupSelection; override; + procedure DrawDropTargetLinkSelection; override; + procedure DrawGroupBackground(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawGroupBorder(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawGroupCaptionButton(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawGroupCaptionImage(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawGroupCaptionSign(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawGroupControl(ACanvas: TCanvas; ARect: TRect; AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawItemImage(ALinkViewInfo: TdxNavBarLinkViewInfo); override; + procedure DrawItemSelection(ALinkViewInfo: TdxNavBarLinkViewInfo); override; + procedure DrawBottomScrollButton; override; + procedure DrawTopScrollButton; override; + end; + +implementation + +uses + CommCtrl, cxGraphics, cxGeometry, dxOffice11, dxNavBarGraphics; + +{ TdxNavBarCustomImagePainter } + +class procedure TdxNavBarCustomImagePainter.DrawImage(ACanvas: TCanvas; + AImageList: TCustomImageList; AImageIndex: Integer; ARect: TRect; AEnabled: Boolean); +begin + InternalDrawImage(ACanvas, AImageList, AImageIndex, ARect, AEnabled); +end; + +class function TdxNavBarCustomImagePainter.IsValidImage(AImageList: TCustomImageList; AImageIndex: Integer): Boolean; +begin + Result := IsImageAssigned(AImageList, AImageIndex); +end; + +class function TdxNavBarCustomImagePainter.GetRGBColor(Value: TColor): DWORD; +begin + Result := ColorToRGB(Value); + case Result of + clNone: Result := CLR_NONE; + clDefault: Result := CLR_DEFAULT; + end; +end; + +class procedure TdxNavBarCustomImagePainter.InternalDrawImage(ACanvas: TCanvas; + AImageList: TCustomImageList; AImageIndex: Integer; ARect: TRect; AEnabled: Boolean); +var + ASavedDCInfo: Integer; +begin + if IsValidImage(AImageList, AImageIndex) then + begin + ASavedDCInfo := SaveDC(ACanvas.Handle); + AImageList.Draw(ACanvas, ARect.Left, ARect.Top, AImageIndex, AEnabled or DrawIconsAsEnabled); + RestoreDC(ACanvas.Handle, ASavedDCInfo); + end; +end; + +{ TdxNavBarCustomSelectionPainter } + +class procedure TdxNavBarCustomSelectionPainter.DrawSelection(ACanvas: TCanvas; + ARect: TRect; ABackColor: TColor; AState: TdxNavBarObjectStates); +begin + InternalDrawSelection(ACanvas, ARect, ABackColor, AState); +end; + +class procedure TdxNavBarCustomSelectionPainter.GetColors(AState: TdxNavBarObjectStates; ABackColor: TColor; + out AFillColor, ATopLeftOuterColor, ABottomRightOuterColor, ATopLeftInnerColor, ABottomRightInnerColor: TColor); +begin + AFillColor := clNone; + ATopLeftOuterColor := clNone; + ABottomRightOuterColor := clNone; + ATopLeftInnerColor := clNone; + ABottomRightInnerColor := clNone; +end; + +class procedure TdxNavBarCustomSelectionPainter.InternalDrawSelection( + ACanvas: TCanvas; ARect: TRect; ABackColor: TColor; AState: TdxNavBarObjectStates); +var + AFillColor, ATopLeftOuterColor, ABottomRightOuterColor, + ATopLeftInnerColor, ABottomRightInnerColor: TColor; +begin + if [sSelected, sPressed, sHotTracked] * AState <> [] then + begin + GetColors(AState, ABackColor, AFillColor, ATopLeftOuterColor, ABottomRightOuterColor, + ATopLeftInnerColor, ABottomRightInnerColor); + dxNavBarDrawSelectedFrame(ACanvas, ARect, ATopLeftOuterColor, ABottomRightOuterColor, + ATopLeftInnerColor, ABottomRightInnerColor); + if AFillColor <> clNone then + FillRectByColor(ACanvas.Handle, cxRectInflate(ARect, -1, -1), AFillColor); + end; +end; + +class function TdxNavBarCustomSelectionPainter.IsPressed(AState: TdxNavBarObjectStates): Boolean; +begin + Result := [sPressed, sSelected] * AState <> []; +end; + +{ TdxNavBarUltraFlatSelectionPainter } + +class procedure TdxNavBarUltraFlatSelectionPainter.GetColors(AState: TdxNavBarObjectStates; ABackColor: TColor; + out AFillColor, ATopLeftOuterColor, ABottomRightOuterColor, ATopLeftInnerColor, ABottomRightInnerColor: TColor); +begin + inherited; + ATopLeftOuterColor := ColorToRGB(clHighlight); + ABottomRightOuterColor := ColorToRGB(clHighlight); + if IsPressed(AState) then + AFillColor := GetRealColor(GetLightColor(14, 44, 40)) + else + AFillColor := GetRealColor(GetLightColor(-2, 30, 72)); +end; + +class function TdxNavBarUltraFlatSelectionPainter.IsPressed(AState: TdxNavBarObjectStates): Boolean; +begin + Result := (sPressed in AState) and not (sSelected in AState); +end; + +{ TdxNavBarCustomBackgroundPainter } + +class procedure TdxNavBarCustomBackgroundPainter.DrawBackground(ACanvas: TCanvas; ARect: TRect; + APicture: TPicture; AEraseBackground: Boolean; ABackgroundColor: TColor; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode); +begin + InternalDrawBackground(ACanvas, ARect, APicture, AEraseBackground, ABackgroundColor, + AColor1, AColor2, AAlphaBlend1, AAlphaBlend2, AGradientMode); +end; + +class procedure TdxNavBarCustomBackgroundPainter.DrawPicture(ACanvas: TCanvas; ARect: TRect; + APicture: TPicture); +var + dLeft, dTop, dWidth, dHeight: Integer; + ABmp: TBitmap; + ACreatedFlag: Boolean; +begin + ACreatedFlag := not(APicture.Graphic is TBitmap); + if ACreatedFlag then + begin + ABmp := cxCreateBitmap(APicture.Graphic.Height, APicture.Graphic.Height); + ABmp.Canvas.Draw(0, 0, APicture.Graphic); + end + else + ABmp := APicture.Bitmap; + + if ABmp <> nil then + begin + dTop := ARect.Top; + while (dTop < ARect.Bottom) do begin + dHeight := ABmp.Height; + if (dTop + dHeight > ARect.Bottom) then + dHeight := ARect.Bottom - dTop; + dLeft := ARect.Left; + while (dLeft < ARect.Right) do begin + dWidth := ABmp.Width; + if (dLeft + dWidth > ARect.Right) then + dWidth := ARect.Right - dLeft; + BitBlt(ACanvas.Handle, dLeft, dTop, dWidth, dHeight, ABmp.Canvas.Handle, 0, 0, SRCCOPY); + Inc(dLeft, dWidth); + end; + Inc(dTop, dHeight); + end; + if ACreatedFlag then ABmp.Free; + end; +end; + +class procedure TdxNavBarCustomBackgroundPainter.FillGradientRect(DC: HDC; const ARect: TRect; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode); + + function CalcColorComponent(AFromColorComponent, AToColorComponent: Byte; + AGradientSize: TSize; AGradientPos: TPoint): Integer; + var + AFromToColorSize: Integer; + begin + AFromToColorSize := AToColorComponent - AFromColorComponent; + case AGradientMode of + gmHorizontal: + Result := AFromColorComponent + + MulDiv(AGradientPos.X, AFromToColorSize, (AGradientSize.cx - 1)); + gmVertical: + Result := AFromColorComponent + + MulDiv(AGradientPos.Y, AFromToColorSize, (AGradientSize.cy - 1)); + gmForwardDiagonal: + Result := AFromColorComponent + + (MulDiv(AGradientPos.X, AFromToColorSize, (AGradientSize.cx - 1)) + + MulDiv(AGradientPos.Y, AFromToColorSize, (AGradientSize.cy - 1))) div 2; + gmBackwardDiagonal: + Result := AFromColorComponent + + (MulDiv(AGradientSize.cx - 1 - AGradientPos.X, AFromToColorSize, (AGradientSize.cx - 1)) + + MulDiv(AGradientPos.Y, AFromToColorSize, (AGradientSize.cy - 1))) div 2; + else + Result := 0; + end + end; + + function CalcRGBColor(AFromColor, AToColor: TColor; + AGradientSize: TSize; AGradientPos: TPoint): TColor; + var + R, G, B: Byte; + begin + R := CalcColorComponent(GetRValue(AFromColor), GetRValue(AToColor), + AGradientSize, AGradientPos); + G := CalcColorComponent(GetGValue(AFromColor), GetGValue(AToColor), + AGradientSize, AGradientPos); + B := CalcColorComponent(GetBValue(AFromColor), GetBValue(AToColor), + AGradientSize, AGradientPos); + Result := RGB(R, G, B); + end; + + function GetGradientSize(ARect: TRect): TSize; + const + MaxGradientHeight = 256; + MaxGradientWidth = 256; + var + ARectWidth, ARectHeight: Integer; + begin + ARectWidth := ARect.Right - ARect.Left; + ARectHeight := ARect.Bottom - ARect.Top; + if ARectWidth < MaxGradientWidth then + Result.cx := ARectWidth + else + Result.cx := MaxGradientWidth; + if ARectHeight < MaxGradientHeight then + Result.cy := ARectHeight + else + Result.cy := MaxGradientHeight; + end; + +var + AOneColorRect: TRect; + I, J, ARectWidth, ARectHeight: Integer; + AGradientSize: TSize; + +begin + AColor1 := ColorToRGB(AColor1); + AColor2 := ColorToRGB(AColor2); + if AColor1 = AColor2 then + begin + FillRectByColor(DC, ARect, AColor1); + Exit; + end; + + AOneColorRect := ARect; + ARectWidth := ARect.Right - ARect.Left; + ARectHeight := ARect.Bottom - ARect.Top; + AGradientSize := GetGradientSize(ARect); + + for I := 0 to AGradientSize.cy - 1 do + begin + AOneColorRect.Bottom := ARect.Top + MulDiv(I + 1, ARectHeight, AGradientSize.cy); + for J := 0 to AGradientSize.cx - 1 do + begin + AOneColorRect.Right := ARect.Left + MulDiv(J + 1, ARectWidth, AGradientSize.cx); + if not IsRectEmpty(AOneColorRect) then + FillRectByColor(DC, AOneColorRect, CalcRGBColor(AColor1, AColor2, AGradientSize, Point(J, I))); + AOneColorRect.Left := AOneColorRect.Right; + if AOneColorRect.Left >= ARect.Right then + Break; + end; + AOneColorRect.Top := AOneColorRect.Bottom; + if AOneColorRect.Top >= ARect.Bottom then + Break; + AOneColorRect.Left := ARect.Left; + end; +end; + +class procedure TdxNavBarCustomBackgroundPainter.InternalDrawBackground(ACanvas: TCanvas; ARect: TRect; + APicture: TPicture; AEraseBackground: Boolean; ABackgroundColor: TColor; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode); +begin + if (APicture <> nil) and (APicture.Graphic <> nil) and not APicture.Graphic.Empty then + DrawPicture(ACanvas, ARect, APicture) + else + if AEraseBackground then + FillRectByColor(ACanvas.Handle, ARect, ABackgroundColor); + if (AColor1 = AColor2) and (AAlphaBlend1 = 255) and (AAlphaBlend2 = 255) then + FillRectByColor(ACanvas.Handle, ARect, AColor1) + else + InternalDrawGradientBackground(ACanvas, ARect, APicture, AEraseBackground, + ABackgroundColor, AColor1, AColor2, AAlphaBlend1, AAlphaBlend2, AGradientMode); +end; + +class procedure TdxNavBarCustomBackgroundPainter.InternalDrawGradientBackground(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AEraseBackground: Boolean; ABackgroundColor: TColor; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode); +begin + if IsGdiPlusAvailable then + GdipFillGradientRect(ACanvas.Handle, ARect, AColor1, AColor2, AAlphaBlend1, AAlphaBlend2, AGradientMode) + else + if (AAlphaBlend1 <> 0) or (AAlphaBlend2 <> 0) then + FillGradientRect(ACanvas.Handle, ARect, AColor1, AColor2, AAlphaBlend1, AAlphaBlend2, AGradientMode); +end; + +{ TdxNavBarCustomGroupBackgroundPainter } + +class procedure TdxNavBarCustomGroupBackgroundPainter.DrawBackground(ACanvas: TCanvas; + ARect: TRect; APicture: TPicture; AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode); +begin + InternalDrawBackground(ACanvas, ARect, APicture, AColor1, AColor2, + AAlphaBlend1, AAlphaBlend2, AGradientMode); +end; + +class procedure TdxNavBarCustomGroupBackgroundPainter.InternalDrawBackground(ACanvas: TCanvas; ARect: + TRect; APicture: TPicture; AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode); +begin + TdxNavBarCustomBackgroundPainter.DrawBackground(ACanvas, ARect, APicture, False, clNone, + AColor1, AColor2, AAlphaBlend1, AAlphaBlend2, AGradientMode); +end; + +{ TdxNavBarCustomGroupBorderPainter } + +class procedure TdxNavBarCustomGroupBorderPainter.InternalDrawBorder(ACanvas: TCanvas; + ARect: TRect; AColor: TColor; AWithCaption: Boolean); +begin +end; + +class procedure TdxNavBarCustomGroupBorderPainter.DrawBorder(ACanvas: TCanvas; + ARect: TRect; AColor: TColor; AWithCaption: Boolean); +begin + InternalDrawBorder(ACanvas, ARect, AColor, AWithCaption); +end; + +{ TdxNavBarCustomSignPainter } + +class procedure TdxNavBarCustomSignPainter.DrawSign(ACanvas: TCanvas; ARect: TRect; + AForeColor, ABackColor1, ABackColor2: TColor; AState: TdxNavBarObjectStates); +begin + InternalDrawSign(ACanvas, ARect, AForeColor, ABackColor1, ABackColor2, AState); +end; + +class procedure TdxNavBarCustomSignPainter.InternalDrawSign(ACanvas: TCanvas; ARect: TRect; + AForeColor, ABackColor1, ABackColor2: TColor; AState: TdxNavBarObjectStates); +begin + +end; + +{ TdxNavBarCustomHintPainter } + +class procedure TdxNavBarCustomHintPainter.DrawHint(ACanvas: TCanvas; ARect: TRect; + AHint: string; APicture: TPicture; AColor1, AColor2: TColor; + AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode; + AFont: TFont); +begin + InternalDrawHint(ACanvas, ARect, AHint, APicture, AColor1, AColor2, + AAlphaBlend1, AAlphaBlend2, AGradientMode, AFont); +end; + +class procedure TdxNavBarCustomHintPainter.InternalDrawHint(ACanvas: TCanvas; + ARect: TRect; AHint: string; APicture: TPicture; AColor1, + AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; AFont: TFont); +begin + if AHint <> '' then + begin + TdxNavBarCustomBackgroundPainter.DrawBackground(ACanvas, ARect, APicture, True, clInfoBk, + AColor1, AColor2, AAlphaBlend1, AAlphaBlend2, AGradientMode); + Windows.DrawEdge(ACanvas.Handle, ARect, BDR_RAISEDOUTER, BF_RECT); + InflateRect(ARect, -1, -1); + Inc(ARect.Left, dxNavBarHintWindowTextOffset.X); + Inc(ARect.Top, dxNavBarHintWindowTextOffset.Y); + ACanvas.Font := AFont; + ACanvas.Brush.Style := bsClear; + cxDrawText(ACanvas.Handle, AHint, ARect, DT_LEFT or DT_NOPREFIX or DT_WORDBREAK); + end; +end; + +{ TdxNavBarCustomButtonPainter } + +class procedure TdxNavBarCustomButtonPainter.DrawButton(ACanvas: TCanvas; + ARect: TRect; APicture: TPicture; AColor1, AColor2: TColor; AAlphaBlend1, + AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode; + ABorderColor: TColor; AState: TdxNavBarObjectStates); +begin + InternalDrawButton(ACanvas, ARect, APicture, AColor1, AColor2, + AAlphaBlend1, AAlphaBlend2, AGradientMode, ABorderColor, AState); +end; + +class procedure TdxNavBarCustomButtonPainter.InternalDrawButton(ACanvas: TCanvas; + ARect: TRect; APicture: TPicture; AColor1, AColor2: TColor; AAlphaBlend1, + AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode; + ABorderColor: TColor; AState: TdxNavBarObjectStates); +begin + TdxNavBarCustomBackgroundPainter.DrawBackground(ACanvas, ARect, APicture, False, clBtnFace, AColor1, AColor2, + AAlphaBlend1, AAlphaBlend2, AGradientMode); +end; + +{ TdxNavBarCustomScrollButtonsPainter } + +class procedure TdxNavBarCustomScrollButtonsPainter.DrawBottomButton( + ACanvas: TCanvas; ARect: TRect; + AButtonPainterClass: TdxNavBarCustomButtonPainterClass; AColor1, AColor2: TColor; + AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode; + ABorderColor: TColor; AState: TdxNavBarObjectStates); +begin + InternalDrawBottomButton(ACanvas, ARect, AButtonPainterClass, AColor1, AColor2, + AAlphaBlend1, AAlphaBlend2, AGradientMode, ABorderColor, AState); +end; + +class procedure TdxNavBarCustomScrollButtonsPainter.DrawTopButton(ACanvas: TCanvas; + ARect: TRect; AButtonPainterClass: TdxNavBarCustomButtonPainterClass; AColor1, + AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode; + ABorderColor: TColor; AState: TdxNavBarObjectStates); +begin + InternalDrawTopButton(ACanvas, ARect, AButtonPainterClass, AColor1, AColor2, + AAlphaBlend1, AAlphaBlend2, AGradientMode, ABorderColor, AState); +end; + +class procedure TdxNavBarCustomScrollButtonsPainter.InternalDrawBottomButton( + ACanvas: TCanvas; ARect: TRect; + AButtonPainterClass: TdxNavBarCustomButtonPainterClass; AColor1, AColor2: TColor; + AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode; + ABorderColor: TColor; AState: TdxNavBarObjectStates); +begin + +end; + +class procedure TdxNavBarCustomScrollButtonsPainter.InternalDrawTopButton( + ACanvas: TCanvas; ARect: TRect; + AButtonPainterClass: TdxNavBarCustomButtonPainterClass; AColor1, AColor2: TColor; + AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode; + ABorderColor: TColor; AState: TdxNavBarObjectStates); +begin + +end; + +{ TdxNavBarCustomDropTargetLinkPainter } + +class procedure TdxNavBarCustomDropTargetLinkPainter.DrawTargetLink( + ACanvas: TCanvas; pt1, pt2, pt3, pt4, pt5, pt6: TPoint; AColor: TColor); +begin + InternalDrawTargetLink(ACanvas, pt1, pt2, pt3, pt4, pt5, pt6, AColor); +end; + +class procedure TdxNavBarCustomDropTargetLinkPainter.InternalDrawTargetLink( + ACanvas: TCanvas; pt1, pt2, pt3, pt4, pt5, pt6: TPoint; AColor: TColor); +begin + ACanvas.Brush.Style := bsSolid; + ACanvas.Brush.Color := AColor; + ACanvas.Pen.Style := psSolid; + ACanvas.Pen.Color := AColor; + ACanvas.Polygon([pt1, pt2, pt3, pt1, pt4, pt5, pt6, pt4]); +end; + +{ TdxNavBarCustomDropTargetGroupPainter } + +class procedure TdxNavBarCustomDropTargetGroupPainter.DrawTargetGroup(ACanvas: TCanvas; + ARect: TRect; AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode); +begin + InternalDrawTargetGroup(ACanvas, ARect, AColor1, AColor2, + AAlphaBlend1, AAlphaBlend2, AGradientMode); +end; + +class procedure TdxNavBarCustomDropTargetGroupPainter.InternalDrawTargetGroup( + ACanvas: TCanvas; ARect: TRect; AColor1, AColor2: TColor; AAlphaBlend1, + AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode); +begin + if IsGdiPlusAvailable then + TdxNavBarCustomBackgroundPainter.DrawBackground(ACanvas, ARect, nil, False, clBlack, + AColor1, AColor2, AAlphaBlend1, AAlphaBlend2, AGradientMode) + else + with TcxCanvas.Create(ACanvas) do + begin + DrawComplexFrame(ARect, AColor1, AColor1, cxBordersAll, 2); + Free; + end; +end; + +{ TdxNavBarElementPainter } + +procedure TdxNavBarElementPainter.DrawBackground; +begin + with ViewInfo do + BackgroundPainterClass.DrawBackground(Canvas, NavBar.ClientRect, BgImage, True, NavBar.Color, + BgBackColor, BgBackColor2, BgAlphaBlend, BgAlphaBlend2, + BgGradientMode); +end; + +procedure TdxNavBarElementPainter.DrawDropTargetGroupSelection; +var + AGroupViewInfo: TdxNavBarGroupViewInfo; +begin + if not NavBar.EnableDragging or (NavBar.SourceGroup = nil) or + not (fAllowDropGroup in NavBar.DragDropFlags) then exit; + AGroupViewInfo := ViewInfo.GetGroupViewInfoAtCaptionPos(NavBar.TargetPoint); + if AGroupViewInfo = nil then + AGroupViewInfo := ViewInfo.GetGroupViewInfoAtItemsPos(NavBar.TargetPoint); + if (AGroupViewInfo <> nil) and (AGroupViewInfo.Group <> NavBar.SourceGroup) then + with ViewInfo do + DropTargetGroupPainterClass.DrawTargetGroup(Canvas, AGroupViewInfo.CaptionRect, + DragDropGroupTargetBackColor, DragDropGroupTargetBackColor2, + DragDropGroupTargetAlphaBlend, DragDropGroupTargetAlphaBlend2, + DragDropGroupTargetGradient); +end; + +procedure TdxNavBarElementPainter.DrawDropTargetLinkSelection; +var + Item1, Item2: TdxNavBarLinkViewInfo; + ItemGroup: TdxNavBarGroupViewInfo; +begin + if not NavBar.EnableDragging or ((NavBar.SourceLink = nil) and (NavBar.SourceItem = nil)) or + not (fAllowDropLink in NavBar.DragDropFlags) then exit; + ViewInfo.GetViewInfoAtDragPosition(NavBar.TargetPoint, ItemGroup, Item1, Item2); + if (Item1 <> nil) and (NavBar.SourceItem = nil) and (Item1.Link = NavBar.SourceLink) then exit; + if (Item2 <> nil) and (NavBar.SourceItem = nil) and (Item2.Link = NavBar.SourceLink) then exit; + if (Item1 <> nil) or (Item2 <> nil) then + DoDrawDropTargetLinkSelection(ItemGroup, Item1, Item2) +end; + +procedure TdxNavBarElementPainter.DrawGroupBackground(AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + with AGroupViewInfo do + GroupBackgroundPainterClass.DrawBackground(Canvas, ItemsRect, BgImage, + BgBackColor, BgBackColor2, BgAlphaBlend, BgAlphaBlend2, BgGradientMode); +end; + +procedure TdxNavBarElementPainter.DrawGroupBorder(AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + if not TdxNavBarViewInfoAccess(ViewInfo).IsGroupActive(AGroupViewInfo.Group) then exit; + with AGroupViewInfo do + GroupBorderPainterClass.DrawBorder(Canvas, ItemsRect, BorderColor, IsCaptionVisible); +end; + +procedure TdxNavBarElementPainter.DrawGroupCaptionButton(AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + with AGroupViewInfo do + ButtonPainterClass.DrawButton(Canvas, CaptionRect, CaptionImage, + CaptionBackColor, CaptionBackColor2, CaptionAlphaBlend, CaptionAlphaBlend2, + CaptionGradientMode, CaptionBorderColor, State); +end; + +procedure TdxNavBarElementPainter.DrawGroupCaptionImage(AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + with AGroupViewInfo do + ImagePainterClass.DrawImage(Canvas, ImageList, ImageIndex, CaptionImageRect); +end; + +procedure TdxNavBarElementPainter.DrawGroupCaptionSign(AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + if AGroupViewInfo.Group.ShowExpandButton then + with AGroupViewInfo do + SignPainterClass.DrawSign(Canvas, CaptionSignRect, CaptionSignColor, + CaptionBackColor, CaptionBackColor2, State); +end; + +procedure TdxNavBarElementPainter.DrawGroupControl(ACanvas: TCanvas; ARect: TRect; AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + with AGroupViewInfo do + GroupBackgroundPainterClass.DrawBackground(ACanvas, ARect, ControlImage, + ControlBackColor, ControlBackColor2, ControlAlphaBlend, ControlAlphaBlend2, + ControlGradientMode); +end; + +procedure TdxNavBarElementPainter.DrawItemImage(ALinkViewInfo: TdxNavBarLinkViewInfo); +begin + with TdxNavBarLinkViewInfoAccess(ALinkViewInfo) do + begin + ImagePainterClass.DrawImage(Canvas, ImageList, ImageIndex, ImageRect, + IsEnabled or UseDisabledImages); + if IsRectEmpty(CaptionRect) and Link.IAccessibilityHelper.IsFocused then + DrawSolidFocusRect(cxRectInflate(ImageRect, 1, 1), FontColor); + end; +end; + +procedure TdxNavBarElementPainter.DrawItemSelection(ALinkViewInfo: TdxNavBarLinkViewInfo); +begin + with ALinkViewInfo do + if Item.Enabled then + SelectionPainterClass.DrawSelection(Canvas, SelectionRect, GroupViewInfo.BgBackColor, State); +end; + +procedure TdxNavBarElementPainter.DrawBottomScrollButton; +begin + with ViewInfo do + begin + ScrollButtonsPainterClass.DrawBottomButton(Canvas, BottomScrollButtonRect, + ButtonPainterClass, BottomScrollButtonBackColor, BottomScrollButtonBackColor2, + BottomScrollButtonAlphaBlend, BottomScrollButtonAlphaBlend2, BottomScrollButtonGradientMode, + BorderColor, BottomScrollButtonState); + with BottomScrollButtonRect do + ExcludeClipRect(Canvas.Handle, Left, Top, Right, Bottom); + end; +end; + +procedure TdxNavBarElementPainter.DrawTopScrollButton; +begin + with ViewInfo do + begin + ScrollButtonsPainterClass.DrawTopButton(Canvas, TopScrollButtonRect, + ButtonPainterClass, TopScrollButtonBackColor, TopScrollButtonBackColor2, + TopScrollButtonAlphaBlend, TopScrollButtonAlphaBlend2, TopScrollButtonGradientMode, + BorderColor, TopScrollButtonState); + with TopScrollButtonRect do + ExcludeClipRect(Canvas.Handle, Left, Top, Right, Bottom); + end; +end; + +procedure TdxNavBarElementPainter.DoDrawDropTargetLinkSelection(AItemGroup: TdxNavBarGroupViewInfo; + AItem1, AItem2: TdxNavBarLinkViewInfo); +var + lpt1, lpt2, lapt1, lapt2, lapt3, rapt1, rapt2, rapt3: TPoint; + AViewInfoAccess: TdxNavBarViewInfoAccess; +begin + if AItem1 <> nil then + begin + if not AItemGroup.IsViewAsIconView then + lpt1 := cxRectLeftBottom(AItem1.Rect) + else + lpt1 := cxRectRightTop(AItem1.Rect); + lpt2 := AItem1.Rect.BottomRight; + end + else + begin + lpt1 := AItem2.Rect.TopLeft; + if not AItemGroup.IsViewAsIconView then + lpt2 := cxRectRightTop(AItem2.Rect) + else + lpt2 := cxRectLeftBottom(AItem2.Rect); + end; + + AViewInfoAccess := TdxNavBarViewInfoAccess(ViewInfo); + if PtInRect(cxRectInflate(AItemGroup.ItemsRect, 1, 1), lpt1) and PtInRect(cxRectInflate(AItemGroup.ItemsRect, 1, 1), lpt2) then + begin + lapt1 := lpt1; + lapt2 := lpt1; + lapt3 := lpt1; + rapt1 := lpt2; + rapt2 := lpt2; + rapt3 := lpt2; + if not AItemGroup.IsViewAsIconView then + begin + lapt1.x := lpt1.x + AViewInfoAccess.GetDragArrowWidth; + if AItem1 <> nil then + lapt2.y := lpt1.y - AViewInfoAccess.GetDragArrowHeight div 2; + if AItem2 <> nil then + lapt3.y := lpt1.y + AViewInfoAccess.GetDragArrowHeight div 2; + rapt1.x := lapt1.x + cxRectWidth(AItemGroup.Rect) - 1 - 2 * AViewInfoAccess.GetDragArrowWidth; + rapt2.x := lapt2.x + cxRectWidth(AItemGroup.Rect) - 1; + rapt2.y := lapt2.y; + rapt3.x := lapt3.x + cxRectWidth(AItemGroup.Rect) - 1; + rapt3.y := lapt3.y; + end; + DropTargetLinkPainterClass.DrawTargetLink(Canvas, lapt1, lapt2, lapt3, rapt1, rapt2, rapt3, + ViewInfo.DragDropItemTargetBackColor); + end; +end; + +procedure TdxNavBarElementPainter.DoDrawHint(ACanvas: TCanvas; const ARect: TRect); +begin + with ViewInfo do + TdxNavBarCustomHintPainter.DrawHint(ACanvas, ARect, + ViewInfo.HintText, HintImage, HintBackColor, HintBackColor2, + HintAlphaBlend, HintAlphaBlend2, HintGradientMode, HintFont); +end; + +class function TdxNavBarElementPainter.BackgroundPainterClass: TdxNavBarCustomBackgroundPainterClass; +begin + Result := TdxNavBarCustomBackgroundPainter; +end; + +class function TdxNavBarElementPainter.ButtonPainterClass: TdxNavBarCustomButtonPainterClass; +begin + Result := TdxNavBarCustomButtonPainter; +end; + +class function TdxNavBarElementPainter.DropTargetGroupPainterClass: TdxNavBarCustomDropTargetGroupPainterClass; +begin + Result := TdxNavBarCustomDropTargetGroupPainter; +end; + +class function TdxNavBarElementPainter.DropTargetLinkPainterClass: TdxNavBarCustomDropTargetLinkPainterClass; +begin + Result := TdxNavBarCustomDropTargetLinkPainter; +end; + +class function TdxNavBarElementPainter.GroupBackgroundPainterClass: TdxNavBarCustomGroupBackgroundPainterClass; +begin + Result := TdxNavBarCustomGroupBackgroundPainter; +end; + +class function TdxNavBarElementPainter.GroupBorderPainterClass: TdxNavBarCustomGroupBorderPainterClass; +begin + Result := TdxNavBarCustomGroupBorderPainter; +end; + +class function TdxNavBarElementPainter.ImagePainterClass: TdxNavBarCustomImagePainterClass; +begin + Result := TdxNavBarCustomImagePainter; +end; + +class function TdxNavBarElementPainter.ScrollButtonsPainterClass: TdxNavBarCustomScrollButtonsPainterClass; +begin + Result := TdxNavBarCustomScrollButtonsPainter; +end; + +class function TdxNavBarElementPainter.SelectionPainterClass: TdxNavBarCustomSelectionPainterClass; +begin + Result := TdxNavBarCustomSelectionPainter; +end; + +class function TdxNavBarElementPainter.SignPainterClass: TdxNavBarCustomSignPainterClass; +begin + Result := TdxNavBarCustomSignPainter; +end; + +end. diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarDsgnConsts.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarDsgnConsts.pas new file mode 100644 index 00000000..d631caa8 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarDsgnConsts.pas @@ -0,0 +1,70 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarDsgnConsts; + +{$I cxVer.inc} + +interface + +const + { don't localize } + dxNavBarMajorVersion = '2'; + sdxProductName = 'ExpressNavBar'; + + { don't localize} + sdxNavBarClassesPrefix = 'dxNavBar'; + sdxGroup = 'Group'; + sdxItem = 'Item'; + sdxStyleItem = 'StyleItem'; + + sdxEditor = sdxProductName + ' Editor...'; + sdxDesignerCaption = '%s.%s - %s'; + sdxNavBarDesigner = 'NavBar designer'; + sdxGroupsDesigner = 'Groups designer'; + sdxItemsDesigner = 'Items designer'; + sdxLinksDesigner = 'Links designer'; + sdxViewsDesigner = 'Views designer'; + sdxDefaultStylesDesigner = 'Default Styles designer'; + sdxCustomStylesDesigner = 'Custom Styles designer'; + + { don't localize} + sdxExpressNavBarRootRegPath = 'Developer Express\ExpressNavBar'; + sdxExpressNavBarDesignerLayoutRegPath = sdxExpressNavBarRootRegPath + '\DesignerLayout'; + sdxHeight = 'Height'; + sdxWidth = 'Width'; + +implementation + +end. diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarDsgnUtils.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarDsgnUtils.pas new file mode 100644 index 00000000..df4effbe --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarDsgnUtils.pas @@ -0,0 +1,105 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarDsgnUtils; + +{$I cxVer.inc} + +interface + +uses + Classes, + {$IFDEF DELPHI6} + DesignIntf, ComponentDesigner, + DesignEditors + {$ELSE} + DsgnIntf, LibIntf + {$ENDIF}; + +type + {$IFDEF DELPHI6} + IDelphiDesigner = IDesigner; + IDelphiIDE = IDesignEnvironment; + ILibrary = IComponentDesigner; + IPersistent = TPersistent; + IComponent = TComponent; + {$ELSE} + IDelphiDesigner = IFormDesigner; + {$ENDIF} + +function MakeIComponent(Component: TComponent): IComponent; +function MakeIPersistent(Persistent: TPersistent): IPersistent; +function TryExtractComponent(Component: IPersistent): TComponent; +function TryExtractPersistent(Persistent: IPersistent): TPersistent; + +implementation + +function MakeIComponent(Component: TComponent): IComponent; +begin + {$IFDEF DELPHI6} + Result := Component; + {$ELSE} + Result := DsgnIntf.MakeIComponent(Component); + {$ENDIF} +end; + +function MakeIPersistent(Persistent: TPersistent): IPersistent; +begin + {$IFDEF DELPHI6} + Result := Persistent; + {$ELSE} + Result := DsgnIntf.MakeIPersistent(Persistent); + {$ENDIF} +end; + +function TryExtractComponent(Component: IPersistent): TComponent; +begin + {$IFDEF DELPHI6} + Result := TComponent(Component); + {$ELSE} + Result := DsgnIntf.TryExtractComponent(IComponent(Component)); + {$ENDIF} +end; + +function TryExtractPersistent(Persistent: IPersistent): TPersistent; +begin + {$IFDEF DELPHI6} + Result := Persistent; + {$ELSE} + Result := DsgnIntf.TryExtractPersistent(Persistent); + {$ENDIF} +end; + +end. + diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarExplorerViews.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarExplorerViews.pas new file mode 100644 index 00000000..bea66d2c --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarExplorerViews.pas @@ -0,0 +1,1191 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarExplorerViews; + +{$I cxVer.inc} + +interface + +uses + Windows, Graphics, Classes, Forms, Controls, SysUtils, + dxNavBar, dxNavBarBase, dxNavBarCollns, dxNavBarStyles, dxNavBarCustomPainters, + cxClasses, cxControls; + +const + ebSplitter = 3; + +type + { ExplorerBarView } + + TdxNavBarExplorerBarGroupViewInfo = class(TdxNavBarGroupViewInfo) + private + FSplitterRect: TRect; + function GetAlign: TcxTopBottom; + protected + function GetSplitterSize: Integer; virtual; + public + procedure CalculateBounds(var X, Y: Integer); override; + procedure CorrectBounds(dX, dY: Integer); override; + property Align: TcxTopBottom read GetAlign; + property SplitterRect: TRect read FSplitterRect; + end; + + TdxNavBarExplorerBarViewInfo = class(TdxNavBarViewInfo) + protected + procedure CorrectScrollInfo; virtual; + + procedure CorrectBounds; override; + procedure DoCalculateBounds(X, Y: Integer); override; + procedure DoCreateGroupsInfo; override; + + function GetGroupBorderOffsets: TRect; override; + function GetGroupCaptionHeightAddon: Integer; override; + function GetGroupCaptionSignSize: TSize; override; + function GetGroupSeparatorWidth: Integer; override; + function GetGroupEdges: TPoint; override; + + function GetAbsoluteLinksImageEdges: TRect; virtual; + function GetLinksImageEdges: TRect; override; + + function CanHasActiveGroup: Boolean; override; + function CanHasSpecialGroup: Boolean; override; + function CanHasImageInGroupCaption: Boolean; override; + function CanHasSignInGroupCaption: Boolean; override; + function CanHasGroupViewAsIconView: Boolean; override; + function CanHasGroupWithNoCaption: Boolean; override; + function CanHasVisibleItemsInGroup(AGroup: TdxNavBarGroup): Boolean; override; + public + procedure AssignDefaultBackgroundStyle; override; + procedure AssignDefaultGroupBackgroundStyle; override; + procedure AssignDefaultGroupHeaderStyle; override; + procedure AssignDefaultGroupHeaderActiveStyle; override; + procedure AssignDefaultItemStyle; override; + procedure AssignDefaultItemDisabledStyle; override; + procedure AssignDefaultItemHotTrackedStyle; override; + + procedure DoGroupActivate(AGroup: TdxNavBarGroup); override; + procedure DoGroupDeactivate(AGroup: TdxNavBarGroup); override; + function IsGroupActive(AGroup: TdxNavBarGroup): Boolean; override; + procedure MakeLinkVisible(ALink: TdxNavBarItemLink; ATop: Boolean = True); override; + procedure MakeGroupVisible(AGroup: TdxNavBarGroup; + AExpandGroup: Boolean = True; ATop: Boolean = True); override; + + // Hit tests + function GetGroupViewInfoIndexAtSplitterPos(const pt: TPoint): Integer; virtual; + function GetGroupViewInfoAtSplitterPos(const pt: TPoint): TdxNavBarGroupViewInfo; virtual; + end; + + TdxNavBarExplorerBarController = class(TdxNavBarController) + private + FStartDragPoint: TPoint; + FStartDragHeight: Integer; + + function GetSizedGroup: TdxNavBarGroupViewInfo; + protected + function GetPartAtPos(const APoint: TPoint): TdxNavBarPart; override; + + procedure DoMouseDown(AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); override; + procedure DoMouseMove(AShift: TShiftState; const APoint: TPoint); override; + procedure DoMouseUp(AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); override; + function GetCursor: HIcon; override; + + procedure DoSplitterStartDrag(const APoint: TPoint); + procedure DoSplitterDrag(const APoint: TPoint); + procedure DoSplitterEndDrag(const APoint: TPoint); + procedure DoSplitterCancelDrag; + public + destructor Destroy; override; + end; + + TdxNavBarExplorerBarPainter = class(TdxNavBarElementPainter) + protected + class function GetViewInfoClass: TdxNavBarViewInfoClass; override; + class function GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; override; + function GetControllerClass: TdxNavBarControllerClass; override; + + class function GroupBorderPainterClass: TdxNavBarCustomGroupBorderPainterClass; override; + class function SignPainterClass: TdxNavBarCustomSignPainterClass; override; + public + procedure DrawGroup(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawGroupControlSplitter(AGroupViewInfo: TdxNavBarExplorerBarGroupViewInfo); virtual; + end; + + TdxNavBarExplorerBarBorderPainter = class(TdxNavBarCustomGroupBorderPainter) + protected + class procedure InternalDrawBorder(ACanvas: TCanvas; ARect: TRect; AColor: TColor; + AWithCaption: Boolean); override; + end; + + TdxNavBarExplorerBarSignPainter = class(TdxNavBarCustomSignPainter) + protected + class procedure DrawSignSelection(ACanvas: TCanvas; ARect: TRect; AForeColor, + ABackColor1, ABackColor2: TColor; AState: TdxNavBarObjectStates); virtual; + class procedure InternalDrawSign(ACanvas: TCanvas; ARect: TRect; + AForeColor, ABackColor1, ABackColor2 : TColor; AState: TdxNavBarObjectStates); override; + end; + + { UltraFlatExplorerBarView } + + TdxNavBarUltraFlatExplorerBarPainter = class(TdxNavBarExplorerBarPainter) + protected + class function SelectionPainterClass: TdxNavBarCustomSelectionPainterClass; override; + end; + + { AdvExplorerBarView } + + TdxNavBarAdvExplorerBarLinkViewInfo = class(TdxNavBarLinkViewInfo) + public + function FontColor: TColor; override; + end; + + TdxNavBarAdvExplorerBarGroupViewInfo = class(TdxNavBarExplorerBarGroupViewInfo) + private + function IsDefaultBgColor: Boolean; + function IsDefaultCaptionColor: Boolean; + public + function BorderColor: TColor; override; + function BgBackColor: TColor; override; + function BgBackColor2: TColor; override; + function BgAlphaBlend: Byte; override; + function BgAlphaBlend2: Byte; override; + function BgGradientMode: TdxBarStyleGradientMode; override; + function CaptionBackColor: TColor; override; + function CaptionBackColor2: TColor; override; + function CaptionAlphaBlend: Byte; override; + function CaptionAlphaBlend2: Byte; override; + function CaptionGradientMode: TdxBarStyleGradientMode; override; + function CaptionFontColor: TColor; override; + function CaptionSignColor: TColor; override; + end; + + TdxNavBarAdvExplorerBarViewInfo = class(TdxNavBarExplorerBarViewInfo) + private + function IsDefaultBgColor: Boolean; + protected + procedure CreateColors; override; + procedure RefreshColors; override; + procedure ReleaseColors; override; + + function GetGroupCaptionSignSize: TSize; override; + public + function BgBackColor: TColor; override; + function BgBackColor2: TColor; override; + function BgAlphaBlend: Byte; override; + function BgAlphaBlend2: Byte; override; + function BgGradientMode: TdxBarStyleGradientMode; override; + + procedure AssignDefaultBackgroundStyle; override; + procedure AssignDefaultGroupBackgroundStyle; override; + procedure AssignDefaultGroupHeaderStyle; override; + procedure AssignDefaultGroupHeaderActiveStyle; override; + procedure AssignDefaultItemStyle; override; + procedure AssignDefaultItemDisabledStyle; override; + end; + + TdxNavBarAdvExplorerBarPainter = class(TdxNavBarExplorerBarPainter) + protected + class function GetViewInfoClass: TdxNavBarViewInfoClass; override; + class function GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; override; + class function GetLinkViewInfoClass: TdxNavBarLinkViewInfoClass; override; + + class function ButtonPainterClass: TdxNavBarCustomButtonPainterClass; override; + class function SignPainterClass: TdxNavBarCustomSignPainterClass; override; + end; + + TdxNavBarAdvExplorerButtonPainter = class(TdxNavBarCustomButtonPainter) + protected + class procedure InternalDrawButton(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; + AState: TdxNavBarObjectStates); override; + end; + + TdxNavBarAdvExplorerBarSignPainter = class(TdxNavBarExplorerBarSignPainter) + protected + class procedure PrepareBitmap(ACanvas: TCanvas; ARect: TRect; ABitmap: TBitmap; + AForeColor: TColor; AState: TdxNavBarObjectStates); + class procedure InternalDrawSign(ACanvas: TCanvas; ARect: TRect; + AForeColor, ABackColor1, ABackColor2 : TColor; AState: TdxNavBarObjectStates); override; + end; + +implementation + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + CommCtrl, ImgList, Math, cxGeometry, cxGraphics, dxOffice11, + dxNavBarViewsFact, dxNavBarConsts, dxNavBarGraphics; + +function GetColor(ANormalColor, AHotColor: TColor; + AState: TdxNavBarObjectStates): TColor; +begin + if sDisabled in AState then + Result := LightLightColor(ANormalColor) + else + if AState * [sHotTracked, sPressed, sSelected] <> [] then + Result := AHotColor + else + Result := ANormalColor; +end; + +{ TdxNavBarExplorerBarGroupViewInfo } + +procedure TdxNavBarExplorerBarGroupViewInfo.CalculateBounds(var X, Y: Integer); +var + ASpace, AShortage: Integer; +begin + inherited; + if Group.OptionsGroupControl.AllowControlResizing and Group.Expanded and + Group.ShowControl and Group.UseControl then + begin + ASpace := GetSplitterSize; + AShortage := ASpace - TdxNavBarExplorerBarViewInfo(ViewInfo).GetSpaceBetweenGroups; + + if AShortage > 0 then + begin + Inc(Y, AShortage); + if Align = vaBottom then + CorrectBounds(0, AShortage); + end; + if Align = vaTop then + FSplitterRect := cxRect(FRect.Left, FRect.Bottom, FRect.Right, FRect.Bottom + ASpace) + else + FSplitterRect := cxRect(FRect.Left, FRect.Top - ASpace, FRect.Right, FRect.Top); + end + else + FSplitterRect := cxNullRect; +end; + +procedure TdxNavBarExplorerBarGroupViewInfo.CorrectBounds(dX, dY: Integer); +begin + inherited; + OffsetRect(FSplitterRect, dX, dY); +end; + +function TdxNavBarExplorerBarGroupViewInfo.GetSplitterSize: Integer; +begin + Result := 3; +end; + +function TdxNavBarExplorerBarGroupViewInfo.GetAlign: TcxTopBottom; +begin + Result := Group.Align; +end; + +{ TdxNavBarExplorerBarViewInfo } + +procedure TdxNavBarExplorerBarViewInfo.CorrectBounds; +begin + CorrectScrollInfo; +end; + +procedure TdxNavBarExplorerBarViewInfo.DoCalculateBounds(X, Y: Integer); +var + I: Integer; + ARestPlace: Integer; +begin + inherited; + + if GroupCount > 0 then + begin + ARestPlace := ClientHeight - Groups[GroupCount - 1].Rect.Bottom - GetGroupEdges.Y; + if ARestPlace > 0 then + begin + for I := 0 to GroupCount - 1 do + if TdxNavBarExplorerBarGroupViewInfo(Groups[I]).Align = vaBottom then + Groups[I].CorrectBounds(0, ARestPlace); + end; + end; +end; + +procedure TdxNavBarExplorerBarViewInfo.DoCreateGroupsInfo; +var + I: Integer; +begin + for I := 0 to NavBar.Groups.Count - 1 do + if NavBar.Groups[I].Visible and (NavBar.Groups[I].Align = vaTop) then + AddGroup(Self, NavBar.Groups[I], True, True); + for I := 0 to NavBar.Groups.Count - 1 do + if NavBar.Groups[I].Visible and (NavBar.Groups[I].Align = vaBottom) then + AddGroup(Self, NavBar.Groups[I], True, True); +end; + +procedure TdxNavBarExplorerBarViewInfo.CorrectScrollInfo; +var + I, AHeight: Integer; + ADelta: Double; + AOldVisible: Boolean; + AMin, AMax, APageSize: Integer; +begin + AOldVisible := NavBar.ScrollBar.Visible; + if GroupCount > 0 then + begin + AHeight := Groups[GroupCount - 1].Rect.Bottom + GetGroupEdges.Y; + if AHeight > ClientHeight then + begin + ADelta := (ClientHeight * NavBar.ScrollBar.Height) / AHeight; + APageSize := Round(ADelta); + AMin := 0; + AMax := AHeight - ClientHeight + Round(ADelta); + + NavBar.ScrollBar.SmallChange := GetGroupCaptionSignSize.cx; + NavBar.ScrollBar.SetScrollParams(AMin, AMax, NavBar.ScrollBar.Position, APageSize); + NavBar.ScrollBar.Visible := True; + end + else + NavBar.ScrollBar.Visible := False; + end + else + NavBar.ScrollBar.Visible := False; + + if AOldVisible = NavBar.ScrollBar.Visible then + begin + for I := 0 to GroupCount - 1 do + Groups[I].CorrectBounds(0, -NavBar.ScrollPosition); + end + else CalculateBounds; +end; + +function TdxNavBarExplorerBarViewInfo.GetGroupBorderOffsets: TRect; +begin + Result := cxRect(1, 1, 1, 1); +end; + +function TdxNavBarExplorerBarViewInfo.GetGroupCaptionHeightAddon: Integer; +begin + Result := 12; +end; + +function TdxNavBarExplorerBarViewInfo.GetGroupCaptionSignSize: TSize; +begin + Result := cxSize(18, 18); +end; + +function TdxNavBarExplorerBarViewInfo.GetGroupSeparatorWidth: Integer; +begin + Result := GetRevisedValue(15); +end; + +function TdxNavBarExplorerBarViewInfo.GetGroupEdges: TPoint; +begin + Result := cxPoint(GetRevisedValue(12), GetRevisedValue(12)); +end; + +function TdxNavBarExplorerBarViewInfo.GetAbsoluteLinksImageEdges: TRect; +begin + Result := cxRect(13, 4, 7, 4); +end; + +function TdxNavBarExplorerBarViewInfo.GetLinksImageEdges: TRect; +begin + with GetAbsoluteLinksImageEdges do + Result := Rect(GetRevisedValue(Left), Top, GetRevisedValue(Right), Bottom); +end; + +function TdxNavBarExplorerBarViewInfo.CanHasActiveGroup: Boolean; +begin + Result := False; +end; + +function TdxNavBarExplorerBarViewInfo.CanHasSpecialGroup: Boolean; +begin + Result := True; +end; + +function TdxNavBarExplorerBarViewInfo.CanHasImageInGroupCaption: Boolean; +begin + Result := True; +end; + +function TdxNavBarExplorerBarViewInfo.CanHasSignInGroupCaption: Boolean; +begin + Result := True; +end; + +function TdxNavBarExplorerBarViewInfo.CanHasGroupViewAsIconView: Boolean; +begin + Result := False; +end; + +function TdxNavBarExplorerBarViewInfo.CanHasGroupWithNoCaption: Boolean; +begin + Result := True; +end; + +function TdxNavBarExplorerBarViewInfo.CanHasVisibleItemsInGroup(AGroup: TdxNavBarGroup): Boolean; +begin + Result := AGroup.Expanded; +end; + +procedure TdxNavBarExplorerBarViewInfo.AssignDefaultBackgroundStyle; +begin + NavBar.DefaultStyles.Background.ResetValues; + NavBar.DefaultStyles.Background.BackColor := clWindow; + NavBar.DefaultStyles.Background.BackColor2 := clWindow; +end; + +procedure TdxNavBarExplorerBarViewInfo.AssignDefaultGroupBackgroundStyle; +begin + NavBar.DefaultStyles.GroupBackground.ResetValues; + NavBar.DefaultStyles.GroupBackground.BackColor := clWindow; + NavBar.DefaultStyles.GroupBackground.BackColor2 := clWindow; +end; + +procedure TdxNavBarExplorerBarViewInfo.AssignDefaultGroupHeaderStyle; +begin + NavBar.DefaultStyles.GroupHeader.ResetValues; + NavBar.DefaultStyles.GroupHeader.BackColor := clBtnFace; + NavBar.DefaultStyles.GroupHeader.BackColor2 := clBtnFace; + NavBar.DefaultStyles.GroupHeader.Font.Color := clBtnText; + NavBar.DefaultStyles.GroupHeader.Font.Style := [fsBold]; +end; + +procedure TdxNavBarExplorerBarViewInfo.AssignDefaultGroupHeaderActiveStyle; +begin + NavBar.DefaultStyles.GroupHeaderActive.Assign(NavBar.DefaultStyles.GroupHeader); + NavBar.DefaultStyles.GroupHeaderActive.BackColor := clActiveCaption; + NavBar.DefaultStyles.GroupHeaderActive.BackColor2 := clActiveCaption; + NavBar.DefaultStyles.GroupHeaderActive.Font.Color := clCaptionText; +end; + +procedure TdxNavBarExplorerBarViewInfo.AssignDefaultItemStyle; +begin + NavBar.DefaultStyles.Item.ResetValues; + NavBar.DefaultStyles.Item.Font.Color := clWindowText; + NavBar.DefaultStyles.Item.HAlignment := haCenter; +end; + +procedure TdxNavBarExplorerBarViewInfo.AssignDefaultItemDisabledStyle; +begin + NavBar.DefaultStyles.ItemDisabled.Assign(NavBar.DefaultStyles.Item); + NavBar.DefaultStyles.ItemDisabled.Font.Color := clGrayText; +end; + +procedure TdxNavBarExplorerBarViewInfo.AssignDefaultItemHotTrackedStyle; +begin + NavBar.DefaultStyles.ItemHotTracked.Assign(NavBar.DefaultStyles.Item); + NavBar.DefaultStyles.ItemHotTracked.Font.Style := NavBar.DefaultStyles.ItemHotTracked.Font.Style + [fsUnderline]; +end; + +procedure TdxNavBarExplorerBarViewInfo.DoGroupActivate(AGroup: TdxNavBarGroup); +begin + if AGroup.Expandable and not AGroup.Expanded then + begin + AGroup.Expanded := True; + NavBar.DesignerModified; + end; +end; + +procedure TdxNavBarExplorerBarViewInfo.DoGroupDeactivate(AGroup: TdxNavBarGroup); +begin + if AGroup.Expandable and AGroup.Expanded then + begin + AGroup.Expanded := False; + NavBar.DesignerModified; + end; +end; + +function TdxNavBarExplorerBarViewInfo.IsGroupActive(AGroup: TdxNavBarGroup): Boolean; +begin + Result := AGroup.Expanded; +end; + +procedure TdxNavBarExplorerBarViewInfo.MakeLinkVisible(ALink: TdxNavBarItemLink; ATop: Boolean = True); +var + AGroupViewInfo: TdxNavBarGroupViewInfo; + ALinkViewInfo: TdxNavBarLinkViewInfo; + ADisplacement: Integer; +begin + if not ALink.Group.Expanded then + begin + ALink.Group.Expanded := True; + CreateInfo; + CalculateBounds; + end; + AGroupViewInfo := GetGroupViewInfoByGroup(ALink.Group); + if AGroupViewInfo <> nil then + begin + ALinkViewInfo := AGroupViewInfo.GetLinkViewInfoByLink(ALink); + if ALinkViewInfo <> nil then + begin + ADisplacement := 0; + if ATop or (ALinkViewInfo.Rect.Top < 0) then + ADisplacement := ALinkViewInfo.Rect.Top - 2 + else + if ALinkViewInfo.Rect.Bottom > NavBar.ClientRect.Bottom then + ADisplacement := ALinkViewInfo.Rect.Bottom - NavBar.ClientRect.Bottom; + NavBar.ScrollBar.Position := NavBar.ScrollBar.Position + ADisplacement; + NavBar.InvalidateAll(doRecreate); + end; + end; +end; + +procedure TdxNavBarExplorerBarViewInfo.MakeGroupVisible(AGroup: TdxNavBarGroup; + AExpandGroup: Boolean = True; ATop: Boolean = True); +var + AGroupViewInfo: TdxNavBarGroupViewInfo; + ADisplacement: Integer; +begin + if AExpandGroup and not AGroup.Expanded then + begin + AGroup.Expanded := True; + CreateInfo; + CalculateBounds; + end; + AGroupViewInfo := GetGroupViewInfoByGroup(AGroup); + if AGroupViewInfo <> nil then + begin + ADisplacement := 0; + if ATop or (AGroupViewInfo.CaptionRect.Top < 0) then + ADisplacement := AGroupViewInfo.Rect.Top - 2 + else + if AGroupViewInfo.CaptionRect.Bottom > NavBar.ClientRect.Bottom then + ADisplacement := AGroupViewInfo.CaptionRect.Bottom - NavBar.ClientRect.Bottom; + NavBar.ScrollBar.Position := NavBar.ScrollBar.Position + ADisplacement; + NavBar.InvalidateAll(doRecreate); + end; +end; + +function TdxNavBarExplorerBarViewInfo.GetGroupViewInfoIndexAtSplitterPos(const pt: TPoint): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to GroupCount - 1 do + if ptInRect(TdxNavBarExplorerBarGroupViewInfo(Groups[I]).FSplitterRect, pt) then + begin + Result := I; + Break; + end; +end; + +function TdxNavBarExplorerBarViewInfo.GetGroupViewInfoAtSplitterPos(const pt: TPoint): TdxNavBarGroupViewInfo; +var + AIndex: Integer; +begin + AIndex := GetGroupViewInfoIndexAtSplitterPos(pt); + if AIndex > -1 then + Result := Groups[AIndex] + else + Result := nil; +end; + +{ TdxNavBarExplorerBarController } + +destructor TdxNavBarExplorerBarController.Destroy; +begin + DoSplitterCancelDrag; + inherited; +end; + +function TdxNavBarExplorerBarController.GetPartAtPos(const APoint: TPoint): TdxNavBarPart; +begin + Result.MinorPartIndex := TdxNavBarExplorerBarViewInfo(ViewInfo).GetGroupViewInfoIndexAtSplitterPos(APoint); + if Result.MinorPartIndex <> nbNone then + Result.MajorPartIndex := ebSplitter + else + Result := inherited GetPartAtPos(APoint); +end; + +procedure TdxNavBarExplorerBarController.DoMouseDown(AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); +begin + if (ssLeft in AShift) then + begin + PressedPart := GetPartAtPos(APoint); + case PressedPart.MajorPartIndex of + ebSplitter: DoSplitterStartDrag(APoint); + else {nbNone} + inherited; + end; + end + else + inherited; +end; + +procedure TdxNavBarExplorerBarController.DoMouseMove(AShift: TShiftState; const APoint: TPoint); +begin + if PressedPart.MajorPartIndex = ebSplitter then + DoSplitterDrag(APoint) + else + begin + HotPart := GetPartAtPos(APoint); + inherited; + end; +end; + +procedure TdxNavBarExplorerBarController.DoMouseUp(AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); +begin + HotPart := GetPartAtPos(APoint); + case PressedPart.MajorPartIndex of + ebSplitter: DoSplitterEndDrag(APoint); + else + inherited; + end; + PressedPart := dxNavBarPart(nbNone); +end; + +function TdxNavBarExplorerBarController.GetCursor: HIcon; +begin + if HotPart.MajorPartIndex = ebSplitter then + Result := Screen.Cursors[crSizeNS] + else + Result := inherited GetCursor; +end; + +procedure TdxNavBarExplorerBarController.DoSplitterStartDrag(const APoint: TPoint); +var + ARect: TRect; +begin + FStartDragHeight := GetSizedGroup.Control.OriginalHeight; + FStartDragPoint := APoint; + SetCaptureControl(NavBar); + + ARect := GetSizedGroup.Rect; + MapWindowRect(NavBar.Handle, 0, ARect); +end; + +procedure TdxNavBarExplorerBarController.DoSplitterDrag(const APoint: TPoint); +var + AdY, AdPosition: Integer; +begin + AdY := APoint.Y - FStartDragPoint.Y; + if TdxNavBarExplorerBarGroupViewInfo(GetSizedGroup).Align = vaBottom then + begin + AdY := -AdY; + AdPosition := GetSizedGroup.Control.OriginalHeight -(FStartDragHeight + AdY); + + if FStartDragHeight + AdY > 0 then + begin + GetSizedGroup.Control.OriginalHeight := FStartDragHeight + AdY; + + InvalidateAll(doRecalc); +// TdxNavBarExplorerBarPainter(NavBar.Painter).CheckDrawParamChanges; // recalculate +// NavBar.Update; or Application.ProcessMessages; or NavBar.Painter.Paint; + NavBar.Update; + + if NavBar.ScrollBar.Visible {and (AdPosition < 0)} then + NavBar.ScrollBar.Position := NavBar.ScrollBar.Position - AdPosition; + InvalidateAll(doRecalc); + end; + end + else + GetSizedGroup.Control.OriginalHeight := FStartDragHeight + AdY; +end; + +procedure TdxNavBarExplorerBarController.DoSplitterEndDrag(const APoint: TPoint); +begin + DoSplitterCancelDrag; +end; + +procedure TdxNavBarExplorerBarController.DoSplitterCancelDrag; +begin + SetCaptureControl(nil); +end; + +function TdxNavBarExplorerBarController.GetSizedGroup: TdxNavBarGroupViewInfo; +begin + Result := ViewInfo.Groups[PressedPart.MinorPartIndex]; +end; + +{ TdxNavBarExplorerBarPainter } + +procedure TdxNavBarExplorerBarPainter.DrawGroup(AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + inherited; + if not IsRectEmpty(TdxNavBarExplorerBarGroupViewInfo(AGroupViewInfo).FSplitterRect) then + DrawGroupControlSplitter(TdxNavBarExplorerBarGroupViewInfo(AGroupViewInfo)); +end; + +procedure TdxNavBarExplorerBarPainter.DrawGroupControlSplitter(AGroupViewInfo: TdxNavBarExplorerBarGroupViewInfo); +begin +// do nothing +end; + +class function TdxNavBarExplorerBarPainter.GetViewInfoClass: TdxNavBarViewInfoClass; +begin + Result := TdxNavBarExplorerBarViewInfo; +end; + +class function TdxNavBarExplorerBarPainter.GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; +begin + Result := TdxNavBarExplorerBarGroupViewInfo; +end; + +function TdxNavBarExplorerBarPainter.GetControllerClass: TdxNavBarControllerClass; +begin + Result := TdxNavBarExplorerBarController; +end; + +class function TdxNavBarExplorerBarPainter.GroupBorderPainterClass: TdxNavBarCustomGroupBorderPainterClass; +begin + Result := TdxNavBarExplorerBarBorderPainter; +end; + +class function TdxNavBarExplorerBarPainter.SignPainterClass: TdxNavBarCustomSignPainterClass; +begin + Result := TdxNavBarExplorerBarSignPainter; +end; + +{ TdxNavBarUltraFlatExplorerBarPainter } + +class function TdxNavBarUltraFlatExplorerBarPainter.SelectionPainterClass: TdxNavBarCustomSelectionPainterClass; +begin + Result := TdxNavBarUltraFlatSelectionPainter; +end; + +{ TdxNavBarAdvExplorerBarLinkViewInfo } + +function TdxNavBarAdvExplorerBarLinkViewInfo.FontColor: TColor; +begin + Result := Font.Color; + if Result = clNone then + Result := GetColor(dxAdvExplorerBarFontColor, dxAdvExplorerBarFontHotColor, State); +end; + +{ TdxNavBarAdvExplorerBarGroupViewInfo } + +function TdxNavBarAdvExplorerBarGroupViewInfo.BorderColor: TColor; +begin + if not IsDefaultCaptionColor then + Result := inherited BorderColor + else if BgBackColor <> clWhite then + Result := clWhite + else Result := LightLightColor(clHighlight); +end; + +function TdxNavBarAdvExplorerBarGroupViewInfo.BgAlphaBlend: Byte; +begin + if IsDefaultBgColor then + Result := 255 + else Result := inherited BgAlphaBlend; +end; + +function TdxNavBarAdvExplorerBarGroupViewInfo.BgAlphaBlend2: Byte; +begin + if IsDefaultBgColor then + Result := 255 + else Result := inherited BgAlphaBlend2; +end; + +function TdxNavBarAdvExplorerBarGroupViewInfo.BgBackColor: TColor; +begin + if IsDefaultBgColor then + Result := dxAdvExplorerBarGroupBackgroundColor + else + Result := inherited BgBackColor; +end; + +function TdxNavBarAdvExplorerBarGroupViewInfo.BgBackColor2: TColor; +begin + if IsDefaultBgColor then + Result := dxAdvExplorerBarGroupBackgroundColor + else + Result := inherited BgBackColor2; +end; + +function TdxNavBarAdvExplorerBarGroupViewInfo.BgGradientMode: TdxBarStyleGradientMode; +begin + if IsDefaultBgColor then + Result := gmHorizontal + else Result := inherited BgGradientMode; +end; + +function TdxNavBarAdvExplorerBarGroupViewInfo.CaptionAlphaBlend: Byte; +begin + if IsDefaultCaptionColor then + Result := 255 + else Result := inherited CaptionAlphaBlend; +end; + +function TdxNavBarAdvExplorerBarGroupViewInfo.CaptionAlphaBlend2: Byte; +begin + if IsDefaultCaptionColor then + Result := 255 + else Result := inherited CaptionAlphaBlend2; +end; + +function TdxNavBarAdvExplorerBarGroupViewInfo.CaptionBackColor: TColor; +begin + if not IsDefaultCaptionColor then + Result := inherited CaptionBackColor + else + if sSpecial in State then + Result := dxAdvExplorerBarSpecialGroupCaptionColor1 + else + Result := dxAdvExplorerBarGroupCaptionColor1; +end; + +function TdxNavBarAdvExplorerBarGroupViewInfo.CaptionBackColor2: TColor; +begin + if not IsDefaultCaptionColor then + Result := inherited CaptionBackColor2 + else + if sSpecial in State then + Result := dxAdvExplorerBarSpecialGroupCaptionColor2 + else + Result := dxAdvExplorerBarGroupCaptionColor2; +end; + +function TdxNavBarAdvExplorerBarGroupViewInfo.CaptionFontColor: TColor; +begin + Result := CaptionFont.Color; + if Result = clNone then + if sSpecial in State then + Result := GetColor(dxAdvExplorerBarSpecialGroupFontColor, + dxAdvExplorerBarSpecialGroupFontHotColor, State) + else + Result := GetColor(dxAdvExplorerBarGroupFontColor, + dxAdvExplorerBarGroupFontHotColor, State); +end; + +function TdxNavBarAdvExplorerBarGroupViewInfo.CaptionSignColor: TColor; +begin + if sSpecial in State then + begin + if not IsDefaultCaptionColor then + Result := CaptionBackColor2 + else + Result := GetColor(dxAdvExplorerBarSpecialGroupCaptionSignColor, + dxAdvExplorerBarSpecialGroupCaptionSignHotColor, State) + end + else + begin + if CaptionFont.Color = clNone then + Result := GetColor(dxAdvExplorerBarGroupCaptionSignColor, + dxAdvExplorerBarGroupCaptionSignHotColor, State) + else + Result := CaptionFontColor; + end; +end; + +function TdxNavBarAdvExplorerBarGroupViewInfo.CaptionGradientMode: TdxBarStyleGradientMode; +begin + if IsDefaultCaptionColor then + Result := gmHorizontal + else Result := inherited CaptionGradientMode; +end; + +function TdxNavBarAdvExplorerBarGroupViewInfo.IsDefaultBgColor: Boolean; +begin + Result := (inherited BgBackColor = clNone) or (inherited BgBackColor2 = clNone); +end; + +function TdxNavBarAdvExplorerBarGroupViewInfo.IsDefaultCaptionColor: Boolean; +begin + Result := (inherited CaptionBackColor = clNone) or (inherited CaptionBackColor2 = clNone); +end; + +{ TdxNavAdvBarExplorerBarViewInfo } + +function TdxNavBarAdvExplorerBarViewInfo.BgAlphaBlend: Byte; +begin + if IsDefaultBgColor then + Result := 255 + else Result := inherited BgAlphaBlend; +end; + +function TdxNavBarAdvExplorerBarViewInfo.BgAlphaBlend2: Byte; +begin + if IsDefaultBgColor then + Result := 255 + else Result := inherited BgAlphaBlend2; +end; + +function TdxNavBarAdvExplorerBarViewInfo.BgBackColor: TColor; +begin + if IsDefaultBgColor then + Result := dxAdvExplorerBarBackgroundColor1 + else + Result := inherited BgBackColor; +end; + +function TdxNavBarAdvExplorerBarViewInfo.BgBackColor2: TColor; +begin + if IsDefaultBgColor then + Result := dxAdvExplorerBarBackgroundColor2 + else + Result := inherited BgBackColor2; +end; + +function TdxNavBarAdvExplorerBarViewInfo.BgGradientMode: TdxBarStyleGradientMode; +begin + if IsDefaultBgColor then + Result := gmVertical//gmHorizontal + else Result := inherited BgGradientMode; +end; + +procedure TdxNavBarAdvExplorerBarViewInfo.AssignDefaultBackgroundStyle; +begin + NavBar.DefaultStyles.Background.ResetValues; + NavBar.DefaultStyles.Background.BackColor := clNone; + NavBar.DefaultStyles.Background.BackColor2 := clNone; +end; + +procedure TdxNavBarAdvExplorerBarViewInfo.AssignDefaultGroupBackgroundStyle; +begin + NavBar.DefaultStyles.GroupBackground.ResetValues; + NavBar.DefaultStyles.GroupBackground.BackColor := clNone; + NavBar.DefaultStyles.GroupBackground.BackColor2 := clNone; +end; + +procedure TdxNavBarAdvExplorerBarViewInfo.AssignDefaultGroupHeaderActiveStyle; +begin + NavBar.DefaultStyles.GroupHeaderActive.Assign(NavBar.DefaultStyles.GroupHeader); + NavBar.DefaultStyles.GroupHeaderActive.BackColor := clNone; + NavBar.DefaultStyles.GroupHeaderActive.BackColor2 := clNone; + NavBar.DefaultStyles.GroupHeaderActive.Font.Color := clNone; +end; + +procedure TdxNavBarAdvExplorerBarViewInfo.AssignDefaultGroupHeaderStyle; +begin + NavBar.DefaultStyles.GroupHeader.ResetValues; + NavBar.DefaultStyles.GroupHeader.BackColor := clNone; + NavBar.DefaultStyles.GroupHeader.BackColor2 := clNone; + NavBar.DefaultStyles.GroupHeader.Font.Color := clNone; + NavBar.DefaultStyles.GroupHeader.Font.Style := [fsBold]; +end; + +procedure TdxNavBarAdvExplorerBarViewInfo.AssignDefaultItemStyle; +begin + NavBar.DefaultStyles.Item.ResetValues; + NavBar.DefaultStyles.Item.Font.Color := clNone; + NavBar.DefaultStyles.Item.HAlignment := haCenter; +end; + +procedure TdxNavBarAdvExplorerBarViewInfo.AssignDefaultItemDisabledStyle; +begin + NavBar.DefaultStyles.ItemDisabled.Assign(NavBar.DefaultStyles.Item); +end; + +procedure TdxNavBarAdvExplorerBarViewInfo.CreateColors; +begin + CreateAdvExplorerBarColors; +end; + +procedure TdxNavBarAdvExplorerBarViewInfo.RefreshColors; +begin + RefreshAdvExplorerBarColors; +end; + +procedure TdxNavBarAdvExplorerBarViewInfo.ReleaseColors; +begin + ReleaseAdvExplorerBarColors; +end; + +function TdxNavBarAdvExplorerBarViewInfo.GetGroupCaptionSignSize: TSize; +begin + Result := cxSize(22, 22); +end; + +function TdxNavBarAdvExplorerBarViewInfo.IsDefaultBgColor: Boolean; +begin + Result := (inherited BgBackColor = clNone) or (inherited BgBackColor2 = clNone); +end; + +{ TdxNavBarAdvExplorerBarPainter } + +class function TdxNavBarAdvExplorerBarPainter.GetViewInfoClass: TdxNavBarViewInfoClass; +begin + Result := TdxNavBarAdvExplorerBarViewInfo; +end; + +class function TdxNavBarAdvExplorerBarPainter.GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; +begin + Result := TdxNavBarAdvExplorerBarGroupViewInfo; +end; + +class function TdxNavBarAdvExplorerBarPainter.GetLinkViewInfoClass: TdxNavBarLinkViewInfoClass; +begin + Result := TdxNavBarAdvExplorerBarLinkViewInfo; +end; + +class function TdxNavBarAdvExplorerBarPainter.ButtonPainterClass: TdxNavBarCustomButtonPainterClass; +begin + Result := TdxNavBarAdvExplorerButtonPainter; +end; + +class function TdxNavBarAdvExplorerBarPainter.SignPainterClass: TdxNavBarCustomSignPainterClass; +begin + Result := TdxNavBarAdvExplorerBarSignPainter; +end; + +{ TdxNavBarExplorerBarBorderPainter } + +class procedure TdxNavBarExplorerBarBorderPainter.InternalDrawBorder(ACanvas: TCanvas; + ARect: TRect; AColor: TColor; AWithCaption: Boolean); +var + ABorders: TcxBorders; +begin + ABorders := cxBordersAll; + if AWithCaption then + Exclude(ABorders, bTop); + with TcxCanvas.Create(ACanvas) do + begin + DrawComplexFrame(ARect, AColor, AColor, ABorders); + Free; + end; +end; + +{ TdxNavBarAdvExplorerButtonPainter } + +class procedure TdxNavBarAdvExplorerButtonPainter.InternalDrawButton(ACanvas: TCanvas; ARect: TRect; + APicture: TPicture; AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; AState: TdxNavBarObjectStates); +begin + ExcludeClipRect(ACanvas.Handle, ARect.Left, ARect.Top, ARect.Left + 2, ARect.Top + 1); + ExcludeClipRect(ACanvas.Handle, ARect.Left, ARect.Top, ARect.Left + 1, ARect.Top + 2); + ExcludeClipRect(ACanvas.Handle, ARect.Right - 2, ARect.Top, ARect.Right, ARect.Top + 1); + ExcludeClipRect(ACanvas.Handle, ARect.Right - 1, ARect.Top, ARect.Right, ARect.Top + 2); + inherited; + SelectClipRgn(ACanvas.Handle, 0); +end; + +{ TdxNavBarExplorerBarSignPainter } + +class procedure TdxNavBarExplorerBarSignPainter.InternalDrawSign(ACanvas: TCanvas; + ARect: TRect; AForeColor, ABackColor1, ABackColor2 : TColor; + AState: TdxNavBarObjectStates); + + procedure BoldPolyline(const APoint1, APoint2, APoint3: TPoint; ADirection: Integer); + begin + ACanvas.Polyline([APoint2, APoint1, APoint3]); + ACanvas.Polyline([cxPointOffset(APoint2, 1, 0), cxPointOffset(APoint1, 0, ADirection), cxPointOffset(APoint3, -1, 0)]) + end; + +var + pt1, pt2, pt3: TPoint; + ADirection: Integer; +begin + DrawSignSelection(ACanvas, ARect, AForeColor, ABackColor1, ABackColor2, AState); + + ACanvas.Pen.Color := AForeColor; + ACanvas.Pen.Style := psSolid; + ACanvas.Pen.Width := 1; + + ADirection := IfThen(sExpanded in AState, +1, -1); + + pt1 := cxRectCenter(ARect); + pt1 := Point(pt1.X - 1, pt1.Y + ADirection * (-4)); + pt2 := Point(pt1.X - 7 div 2, pt1.Y + ADirection * (4 - 1)); + pt3 := Point(pt2.X + 7, pt2.Y + ADirection); + BoldPolyline(pt1, pt2, pt3, ADirection); + + pt1.Y := pt1.Y + ADirection * 4; + pt2.Y := pt2.Y + ADirection * 4; + pt3.Y := pt3.Y + ADirection * 4; + BoldPolyline(pt1, pt2, pt3, ADirection); +end; + +class procedure TdxNavBarExplorerBarSignPainter.DrawSignSelection(ACanvas: TCanvas; + ARect: TRect; AForeColor, ABackColor1, ABackColor2: TColor; AState: TdxNavBarObjectStates); +begin + if sHotTracked in AState then + DrawEdge(ACanvas.Handle, ARect, BDR_RAISEDINNER, BF_RECT); +end; + +{ TdxNavAdvBarExplorerBarSignPainter } + +class procedure TdxNavBarAdvExplorerBarSignPainter.PrepareBitmap(ACanvas: TCanvas; + ARect: TRect; ABitmap: TBitmap; AForeColor: TColor; AState: TdxNavBarObjectStates); + + function GetSignBitmap: TBitmap; + begin + (*if sSpecial in AState then + if sExpanded in AState then + Result := dxAdvExplorerBarSpecialGroupCaptionCollapseSignBitmap + else + Result := dxAdvExplorerBarSpecialGroupCaptionExpandSignBitmap + else*) + if sExpanded in AState then + Result := dxAdvExplorerBarGroupCaptionCollapseSignBitmap + else + Result := dxAdvExplorerBarGroupCaptionExpandSignBitmap; + end; + +var + ABitmapColors: TRGBColors; + I, J: Integer; + ABgColor, APixelColor, AMarksColor, ATransparentColor: COLORREF; +begin + ABitmap.Assign(GetSignBitmap); + ABitmapColors := GetBitmapBits(ABitmap, True); + RGBQuadToColorRef(ABitmapColors[0], ATransparentColor); + AMarksColor := clBlue; + for I := 0 to ABitmap.Width - 1 do + for J := 0 to ABitmap.Height - 1 do + begin + RGBQuadToColorRef(ABitmapColors[J * ABitmap.Width + I], APixelColor); + if APixelColor <> ATransparentColor then + if APixelColor = AMarksColor then + ColorRefToRGBQuad(ColorToRGB(AForeColor), ABitmapColors[J * ABitmap.Width + I]) + else + begin + ABgColor := ACanvas.Pixels[ARect.Left + I, ARect.Top + J]; + APixelColor := GetMiddleRGB(ABgColor, APixelColor, + MulDiv((255 - GetRValue(APixelColor)), 100, 255)); + ColorRefToRGBQuad(APixelColor, ABitmapColors[J * ABitmap.Width + I]); + end; + end; + + SetBitmapBits(ABitmap, ABitmapColors, True); + ABitmap.Transparent := True; +end; + +class procedure TdxNavBarAdvExplorerBarSignPainter.InternalDrawSign(ACanvas: TCanvas; ARect: TRect; + AForeColor, ABackColor1, ABackColor2 : TColor; AState: TdxNavBarObjectStates); +var + ABitmap: TBitmap; +begin + ABitmap := TBitmap.Create; + try + PrepareBitmap(ACanvas, ARect, ABitmap, AForeColor, AState); + ACanvas.Draw(ARect.Left, ARect.Top, ABitmap); + finally + ABitmap.Free; + end; +end; + +initialization + RegisterView(dxNavBarExplorerBarView, 'ExplorerBarView', TdxNavBarExplorerBarPainter); + RegisterView(dxNavBarUltraFlatExplorerView, 'UltraFlatExplorerBarView', TdxNavBarUltraFlatExplorerBarPainter); + RegisterView(dxNavBarAdvExplorerBarView, 'AdvExplorerBarView', TdxNavBarAdvExplorerBarPainter); + +finalization + UnRegisterView(dxNavBarExplorerBarView); + UnRegisterView(dxNavBarUltraFlatExplorerView); + UnRegisterView(dxNavBarAdvExplorerBarView); + +end. diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarGraphics.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarGraphics.pas new file mode 100644 index 00000000..f04a700a --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarGraphics.pas @@ -0,0 +1,1083 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarGraphics; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Windows, Classes, Controls, CommCtrl, Graphics, ImgList, + cxClasses, cxGraphics, dxNavBar, dxNavBarStyles, dxNavBarCustomPainters; + +type + TXPScheme = (schUnknown, schNormalColor, schHomestead, schMetallic); + TXPSchemeColor = schNormalColor .. schMetallic; + +var + // AdvExplorerBar bitmaps, colors and fonts + dxAdvExplorerBarGroupCaptionCollapseSignBitmap: TBitmap; + dxAdvExplorerBarGroupCaptionExpandSignBitmap: TBitmap; +// dxAdvExplorerBarSpecialGroupCaptionCollapseSignBitmap: TBitmap; +// dxAdvExplorerBarSpecialGroupCaptionExpandSignBitmap: TBitmap; + + dxAdvExplorerBarBackgroundColor1: COLORREF; + dxAdvExplorerBarBackgroundColor2: COLORREF; + dxAdvExplorerBarFontColor: COLORREF; + dxAdvExplorerBarFontHotColor: COLORREF; + dxAdvExplorerBarGroupBackgroundColor: COLORREF; + dxAdvExplorerBarGroupCaptionColor1: COLORREF; + dxAdvExplorerBarGroupCaptionColor2: COLORREF; + dxAdvExplorerBarGroupCaptionSignColor: COLORREF; + dxAdvExplorerBarGroupCaptionSignHotColor: COLORREF; + dxAdvExplorerBarGroupFontColor: COLORREF; + dxAdvExplorerBarGroupFontHotColor: COLORREF; + dxAdvExplorerBarSpecialGroupCaptionColor1: COLORREF; + dxAdvExplorerBarSpecialGroupCaptionColor2: COLORREF; + dxAdvExplorerBarSpecialGroupCaptionSignColor: COLORREF; + dxAdvExplorerBarSpecialGroupCaptionSignHotColor: COLORREF; + dxAdvExplorerBarSpecialGroupFontColor: COLORREF; + dxAdvExplorerBarSpecialGroupFontHotColor: COLORREF; + + // Office11 color and bitmaps + dxOffice11BackgroundColor1: COLORREF; + dxOffice11BackgroundColor2: COLORREF; + dxOffice11GroupBackgroundColor1: COLORREF; + dxOffice11GroupBackgroundColor2: COLORREF; + dxOffice11GroupCaptionColor1: COLORREF; + dxOffice11GroupCaptionColor2: COLORREF; + dxOffice11GroupBorderColor: COLORREF; + dxOffice11GroupFontColor: COLORREF; + dxOffice11LinkFontColor: COLORREF; + + dxOffice11CaptionExpandSignBitmap: TBitmap; + dxOffice11CaptionCollapseSignBitmap: TBitmap; + + // Office11 NavPane bitmaps + dxOffice11NavPaneOverflowPanelBitmap: TBitmap; + dxOffice11NavPaneSplitterBitmap: TBitmap; + dxOffice11NavPaneArrowUpBitmap: TBitmap; + dxOffice11NavPaneArrowDownBitmap: TBitmap; + dxOffice11NavPaneDefaultLargeBitmap: TBitmap; + dxOffice11NavPaneDefaultSmallBitmap: TBitmap; + + // XPExplorerBar bitmaps, colors and fonts + dxXPExplorerBarSpecialGroupHeader: TBitmap; + dxXPExplorerBarNormalGroupHeader: TBitmap; + dxXPExplorerBarSpecialGroupCollapseHot: TBitmap; + dxXPExplorerBarNormalGroupCollapseHot: TBitmap; + dxXPExplorerBarSpecialGroupCollapse: TBitmap; + dxXPExplorerBarNormalGroupCollapse: TBitmap; + dxXPExplorerBarSpecialGroupExpandHot: TBitmap; + dxXPExplorerBarNormalGroupExpandHot: TBitmap; + dxXPExplorerBarSpecialGroupExpand: TBitmap; + dxXPExplorerBarNormalGroupExpand: TBitmap; + dxXPExplorerBarBackground: TBitmap; + + dxXPExplorerBarItemFont: TFont; + dxXPExplorerBarItemFontHot: TFont; + dxXPExplorerBarGroupHeaderFont: TFont; + dxXPExplorerBarGroupHeaderFontHot: TFont; + + dxXPExplorerBarBackgroundColor1: TColor = clNone; // TODO ??? + dxXPExplorerBarBackgroundColor2: TColor = clNone; // TODO ??? + dxXPExplorerBarGroupBackgroundColor1: TColor = clNone; // TODO ??? + dxXPExplorerBarGroupBackgroundColor2: TColor = clNone; // TODO ??? + dxXPExplorerBarGroupBorderColor: TColor = clNone; + +procedure CreateAdvExplorerBarColors; +procedure RefreshAdvExplorerBarColors; +procedure ReleaseAdvExplorerBarColors; + +procedure CreateOffice11Colors; +procedure RefreshOffice11Colors; +procedure ReleaseOffice11Colors; + +procedure CreateOffice11NavPaneColors; +procedure RefreshOffice11NavPaneColors; +procedure ReleaseOffice11NavPaneColors; + +function CheckShellInstance: Boolean; +procedure CreateXPExplorerBarColors; +procedure RefreshXPExplorerBarColors; +procedure ReleaseXPExplorerBarColors; + +function XPScheme: TXPScheme; + +function LightColor(AColor: TColor): TColor; +function LightLightColor(AColor: TColor): TColor; +function DarkColor(AColor: TColor): TColor; +function DarkDarkColor(AColor: TColor): TColor; +function LightBorderColor(AColor: TColor): TColor; +function LightLightBorderColor(AColor: TColor): TColor; +function DarkBorderColor(AColor: TColor): TColor; +function DarkDarkBorderColor(AColor: TColor): TColor; +function CalcColor(d: Integer): TColor; +function CalcTextColor(AColor: TColor; AState: TdxNavBarObjectStates): TColor; +function GetFontHeight(AFont: TFont): Integer; +procedure GetSystemFont(AFont: TFont); + +procedure dxNavBarDrawSelectedFrame(ACanvas: TCanvas; const ARect: TRect; ATopLeftOuterColor, ABottomRightOuterColor, + ATopLeftInnerColor, ABottomRightInnerColor: TColor); + +procedure RGBQuadToColorRef(AColor: TRGBQuad; out ARevertedColor: COLORREF); +procedure ColorRefToRGBQuad(AColor: COLORREF; out ARevertedColor: TRGBQuad); + +type + PARGB = ^ARGB; + ARGB = DWORD; + {$EXTERNALSYM ARGB} + ARGB64 = Int64; + {$EXTERNALSYM ARGB64} + + PdxGPColor = ^TdxGPColor; + TdxGPColor = ARGB; + TdxGPColorDynArray = array of TdxGPColor; + +// Color +const + AlphaShift = 24; + {$EXTERNALSYM AlphaShift} + RedShift = 16; + {$EXTERNALSYM RedShift} + GreenShift = 8; + {$EXTERNALSYM GreenShift} + BlueShift = 0; + {$EXTERNALSYM BlueShift} + + AlphaMask = $ff000000; + {$EXTERNALSYM AlphaMask} + RedMask = $00ff0000; + {$EXTERNALSYM RedMask} + GreenMask = $0000ff00; + {$EXTERNALSYM GreenMask} + BlueMask = $000000ff; + {$EXTERNALSYM BlueMask} + +function IsGdiPlusAvailable: Boolean; + +function MakeColor(r, g, b: Byte): TdxGPColor; overload; +function MakeColor(a, r, g, b: Byte): TdxGPColor; overload; +function MakeColor(color: TColor; alpha: Byte): TdxGPColor; overload; +function GetAlpha(color: ARGB): BYTE; +function GetRed(color: ARGB): BYTE; +function GetGreen(color: ARGB): BYTE; +function GetBlue(color: ARGB): BYTE; +function ColorRefToARGB(rgb: COLORREF): ARGB; +function ARGBToColorRef(Color: ARGB): COLORREF; + +procedure GdipFillGradientRect(DC: HDC; const ARect: TRect; AColor1, AColor2: TColor; + AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode); + +implementation + +uses + SysUtils, Math, cxGeometry, dxGDIPlusAPI, dxGDIPlusClasses, + dxThemeConsts, dxUxTheme, dxThemeManager, dxOffice11; + +const + ShellLibraryName = 'shell32.dll'; + +type + TdxSHGetShellStyleHInstance = function: LongWord; stdcall; + PdxSHGetShellStyleHInstance = ^TdxSHGetShellStyleHInstance; + +var + FCounterAdvExplorerBar: Integer; + FCounterOffice11: Integer; + FCounterOffice11NavPane: Integer; + FCounterXPExplorerBar: Integer; + + FShellLibrary: HMODULE; + + FSHGetShellStyleHInstancePointer: PdxSHGetShellStyleHInstance; + FSHGetShellStyleHInstance: TdxSHGetShellStyleHInstance; + FShellInstance: LongInt; + +{ TdxStyleSheetParser } + +type + TdxStyleSheetParser = class + private + FStyles: TStringList; + + function TrimChars(AText: string): string; + function LeftString(AText: string; APos: Integer): string; + function RightString(AText: string; APos: Integer): string; + function MiddleString(AText: string; AStartPos, AEndPos: Integer): string; + protected + function GetStyleText(AStyleName: string): string; + function GetStyleAttributeText(AStyleText, AAttributeName: string): string; + + procedure ParseColorName(var AColor: TColor; AAttributeText: string); + procedure ParseColor(var AColor: TColor; AAttributeText: string); + + procedure ParseFontWeight(AFont: TFont; AStyleText: string); + procedure ParseFontDecoration(AFont: TFont; AStyleText: string); + procedure ParseFontColor(AFont: TFont; AStyleText: string); + procedure ParseFontSize(AFont: TFont; AStyleText: string); + public + constructor Create(AText: string); + destructor Destroy; override; + + procedure ParseBackgroundColor(var AColor: TColor; AStyleName: string); + procedure ParseBorderColor(var AColor: TColor; AStyleName: string); + procedure ParseFont(AFont: TFont; AStyleName: string); + end; + +constructor TdxStyleSheetParser.Create(AText: string); +begin + FStyles := TStringList.Create; + FStyles.Text := Trim(AText); +end; + +destructor TdxStyleSheetParser.Destroy; +begin + FStyles.Free; + inherited; +end; + +procedure TdxStyleSheetParser.ParseBackgroundColor(var AColor: TColor; AStyleName: string); +var + AStyleText, AStyleAttributeText: string; +begin + AStyleText := StringReplace(GetStyleText(AStyleName), ' ', '', [rfReplaceAll]); + if AStyleText <> '' then + begin + AStyleAttributeText := GetStyleAttributeText(AStyleText, 'BACKGROUND-COLOR:'); + ParseColor(AColor, StringReplace(AStyleAttributeText, ' ', '', [rfReplaceAll])); + end +end; + +procedure TdxStyleSheetParser.ParseBorderColor(var AColor: TColor; AStyleName: string); +var + APos: Integer; + AStyleText, AStyleAttributeText: string; +begin + AStyleText := StringReplace(GetStyleText(AStyleName), ' ', '', [rfReplaceAll]); + if AStyleText <> '' then + begin + AStyleAttributeText := GetStyleAttributeText(AStyleText, 'BORDER:'); + AStyleAttributeText := StringReplace(AStyleAttributeText, '''', '', [rfReplaceAll]); + APos := Pos(' ', AStyleAttributeText); + if APos > 0 then + AStyleAttributeText := RightString(AStyleAttributeText, APos + 1); + APos := Pos(' ', AStyleAttributeText); + if APos > 0 then + AStyleAttributeText := RightString(AStyleAttributeText, APos + 1); + ParseColor(AColor, StringReplace(AStyleAttributeText, ' ', '', [rfReplaceAll])); + end; +end; + +procedure TdxStyleSheetParser.ParseFont(AFont: TFont; AStyleName: string); +var + AStyleText: string; +begin + AStyleText := StringReplace(GetStyleText(AStyleName), ' ', '', [rfReplaceAll]); + if AStyleText <> '' then + begin + ParseFontSize(AFont, AStyleText); + ParseFontWeight(AFont, AStyleText); + ParseFontDecoration(AFont, AStyleText); + ParseFontColor(AFont, AStyleText); + end; +end; + +procedure TdxStyleSheetParser.ParseFontWeight(AFont: TFont; AStyleText: string); +var + AFontWeight: string; +begin + AFontWeight := UpperCase(GetStyleAttributeText(AStyleText, 'FONT-WEIGHT:')); + if AFontWeight = 'BOLD' then + AFont.Style := AFont.Style + [fsBold] + else if AFontWeight = 'NORMAL' then + AFont.Style := AFont.Style - [fsBold]; +end; + +procedure TdxStyleSheetParser.ParseFontDecoration(AFont: TFont; AStyleText: string); +var + AFontDecoration: string; +begin + AFontDecoration := UpperCase(GetStyleAttributeText(AStyleText, 'TEXT-DECORATION:')); + if AFontDecoration = 'UNDERLINE' then + AFont.Style := AFont.Style + [fsUnderline] + else if AFontDecoration = 'NONE' then + AFont.Style := AFont.Style - [fsUnderline]; +end; + +procedure TdxStyleSheetParser.ParseFontColor(AFont: TFont; AStyleText: string); +var + AFontColor: TColor; + AFontColorString: string; +begin + AFontColorString := GetStyleAttributeText(AStyleText, 'COLOR:'); + if AFontColorString <> '' then + begin + ParseColor(AFontColor, AFontColorString); + if AFontColor > 0 then + AFont.Color := AFontColor; + end; +end; + +procedure TdxStyleSheetParser.ParseFontSize(AFont: TFont; AStyleText: string); +var + AFontSize: string; +begin + AFontSize := TrimChars(GetStyleAttributeText(AStyleText, 'FONT-SIZE:')); + if AFontSize <> '' then + AFont.Size := StrToInt(AFontSize); +end; + +function TdxStyleSheetParser.GetStyleText(AStyleName: string): string; +var + I: Integer; +begin + Result := ''; + for I := 0 to FStyles.Count - 1 do + if Pos(UpperCase(AStyleName), UpperCase(FStyles[I])) = 1 then + begin + Result := FStyles[I]; + break; + end; +end; + +function TdxStyleSheetParser.GetStyleAttributeText(AStyleText, AAttributeName: string): string; +var + ABeginPos, AEndPos: Integer; +begin + Result := ''; + ABeginPos := Pos(UpperCase(AAttributeName), UpperCase(AStyleText)); + if ABeginPos > 0 then + begin + ABeginPos := ABeginPos + Length(AAttributeName); + Result := RightString(AStyleText, ABeginPos); + AEndPos := Pos(';', Result); + if AEndPos = 0 then + AEndPos := Pos('}', Result); + if AEndPos > 0 then + Result := LeftString(Result, AEndPos); + end; +end; + +procedure TdxStyleSheetParser.ParseColorName(var AColor: TColor; AAttributeText: string); +begin + cxColorByName(AAttributeText, AColor); +end; + +procedure TdxStyleSheetParser.ParseColor(var AColor: TColor; AAttributeText: string); +var + APos: Integer; + R, G, B: Byte; +begin + APos := Pos('#', AAttributeText); + if APos > 0 then + begin + AAttributeText := RightString(AAttributeText, APos + 1); + R := StrToInt('$' + MiddleString(AAttributeText, 1, 2)); + G := StrToInt('$' + MiddleString(AAttributeText, 3, 4)); + B := StrToInt('$' + MiddleString(AAttributeText, 5, 6)); + AColor := RGB(R, G, B); + end + else + ParseColorName(AColor, AAttributeText); +end; + +function TdxStyleSheetParser.TrimChars(AText: string): string; +var + I: Integer; +begin + Result := ''; + for I := 1 to Length(AText) do + if (AText[I] >= '0') and (AText[I] <= '9') then + Result := Result + AText[I]; +end; + +function TdxStyleSheetParser.LeftString(AText: string; APos: Integer): string; +begin + Result := Copy(AText, 1, APos - 1); +end; + +function TdxStyleSheetParser.RightString(AText: string; APos: Integer): string; +begin + Result := Copy(AText, APos, Length(AText) - APos + 1); +end; + +function TdxStyleSheetParser.MiddleString(AText: string; AStartPos, AEndPos: Integer): string; +begin + Result := Copy(AText, AStartPos, AEndPos - AStartPos + 1); +end; + +{ utilities } + +procedure InitAdvExplorerBarColors; +const + Colors: array[TXPSchemeColor, 0..11] of COLORREF = ( + ($E7A27B, $D67563, $C65D21, $FF8E42, $F7DFD6, $FFFFFF, $F7D3C6, $B54900, $CE5D29, $A53C00, $FFCDAC, $FF8E42), + ($ADD9CC, $84BDA5, $2D6656, $1D9272, $ECF6F6, $ECFCFF, $B8E7E0, $408C77, $67A896, $1C674B, $BEEDDD, $B8E7E0), + ($D4C8C4, $C8B3B1, $3D3D3F, $7C7C7E, $F5F1F0, $FFFFFF, $E0D7D6, $927777, $C7B6B4, $734431, $FEFEF9, $E6E6E6) + ); +var + AColorScheme: TXPScheme; +begin + AColorScheme := XPScheme; + if AColorScheme <> schUnknown then + begin + dxAdvExplorerBarBackgroundColor1 := Colors[AColorScheme, 0]; + dxAdvExplorerBarBackgroundColor2 := Colors[AColorScheme, 1]; + dxAdvExplorerBarFontColor := Colors[AColorScheme, 2]; + dxAdvExplorerBarFontHotColor := Colors[AColorScheme, 3]; + dxAdvExplorerBarGroupBackgroundColor := Colors[AColorScheme, 4]; + dxAdvExplorerBarGroupCaptionColor1 := Colors[AColorScheme, 5]; + dxAdvExplorerBarGroupCaptionColor2 := Colors[AColorScheme, 6]; + dxAdvExplorerBarGroupFontColor := dxAdvExplorerBarFontColor; + dxAdvExplorerBarGroupFontHotColor := dxAdvExplorerBarFontHotColor; + dxAdvExplorerBarSpecialGroupCaptionColor1 := Colors[AColorScheme, 7]; + dxAdvExplorerBarSpecialGroupCaptionColor2 := Colors[AColorScheme, 8]; + dxAdvExplorerBarGroupCaptionSignColor := Colors[AColorScheme, 9]; + dxAdvExplorerBarGroupCaptionSignHotColor := dxAdvExplorerBarFontHotColor; + dxAdvExplorerBarSpecialGroupCaptionSignColor := dxAdvExplorerBarGroupCaptionSignColor;//clWhite; + dxAdvExplorerBarSpecialGroupCaptionSignHotColor := dxAdvExplorerBarGroupCaptionSignHotColor;//Colors[AColorScheme, 10]; + dxAdvExplorerBarSpecialGroupFontColor := clWhite; + dxAdvExplorerBarSpecialGroupFontHotColor := Colors[AColorScheme, 11]; + end + else + begin + dxAdvExplorerBarBackgroundColor1 := ColorToRGB(clInactiveCaption); + dxAdvExplorerBarBackgroundColor2 := dxAdvExplorerBarBackgroundColor1; + dxAdvExplorerBarFontColor := CalcTextColor(clNone, []); + dxAdvExplorerBarFontHotColor := CalcTextColor(clNone, [sHotTracked]); + dxAdvExplorerBarGroupBackgroundColor := LightLightColor(clInactiveCaption); + dxAdvExplorerBarGroupCaptionColor1 := ColorToRGB(clWindow); + dxAdvExplorerBarGroupCaptionColor2 := LightLightColor(clHighlight); + dxAdvExplorerBarGroupFontColor := dxAdvExplorerBarFontColor; + dxAdvExplorerBarGroupFontHotColor := dxAdvExplorerBarFontHotColor; + dxAdvExplorerBarSpecialGroupCaptionColor1 := ColorToRGB(clHighlight); + dxAdvExplorerBarSpecialGroupCaptionColor2 := dxAdvExplorerBarSpecialGroupCaptionColor1; + dxAdvExplorerBarGroupCaptionSignColor := dxAdvExplorerBarGroupFontColor; + dxAdvExplorerBarGroupCaptionSignHotColor := dxAdvExplorerBarGroupFontHotColor; + dxAdvExplorerBarSpecialGroupCaptionSignColor := dxAdvExplorerBarSpecialGroupCaptionColor2; + dxAdvExplorerBarSpecialGroupCaptionSignHotColor := dxAdvExplorerBarSpecialGroupCaptionColor2; + dxAdvExplorerBarSpecialGroupFontColor := ColorToRGB(clCaptionText); + dxAdvExplorerBarSpecialGroupFontHotColor := dxAdvExplorerBarSpecialGroupFontColor; + end; +end; + +procedure CreateAdvExplorerBarBitmaps; +begin + dxAdvExplorerBarGroupCaptionCollapseSignBitmap := TBitmap.Create; + dxAdvExplorerBarGroupCaptionCollapseSignBitmap.Handle := LoadBitmap(HInstance, 'DXNAVBARADVEXPLORERBARGROUPCAPTIONCOLLAPSESIGN'); + dxAdvExplorerBarGroupCaptionExpandSignBitmap := TBitmap.Create; + dxAdvExplorerBarGroupCaptionExpandSignBitmap.Handle := LoadBitmap(HInstance, 'DXNAVBARADVEXPLORERBARGROUPCAPTIONEXPANDSIGN'); +// dxAdvExplorerBarSpecialGroupCaptionCollapseSignBitmap := TBitmap.Create; +// dxAdvExplorerBarSpecialGroupCaptionCollapseSignBitmap.Handle := LoadBitmap(HInstance, 'DXNAVBARADVEXPLORERBARSPECIALGROUPCAPTIONCOLLAPSESIGN'); +// dxAdvExplorerBarSpecialGroupCaptionExpandSignBitmap := TBitmap.Create; +// dxAdvExplorerBarSpecialGroupCaptionExpandSignBitmap.Handle := LoadBitmap(HInstance, 'DXNAVBARADVEXPLORERBARSPECIALGROUPCAPTIONEXPANDSIGN'); +end; + +procedure DestroyAdvExplorerBarBitmaps; +begin + dxAdvExplorerBarGroupCaptionCollapseSignBitmap.Free; + dxAdvExplorerBarGroupCaptionCollapseSignBitmap := nil; + dxAdvExplorerBarGroupCaptionExpandSignBitmap.Free; + dxAdvExplorerBarGroupCaptionExpandSignBitmap := nil; +// dxAdvExplorerBarSpecialGroupCaptionCollapseSignBitmap.Free; +// dxAdvExplorerBarSpecialGroupCaptionCollapseSignBitmap := nil; +// dxAdvExplorerBarSpecialGroupCaptionExpandSignBitmap.Free; +// dxAdvExplorerBarSpecialGroupCaptionExpandSignBitmap := nil; +end; + +procedure CreateAdvExplorerBarColors; +begin + if FCounterAdvExplorerBar = 0 then + begin + InitAdvExplorerBarColors; + CreateAdvExplorerBarBitmaps; + end; + Inc(FCounterAdvExplorerBar); +end; + +procedure RefreshAdvExplorerBarColors; +begin + InitAdvExplorerBarColors; + if FCounterAdvExplorerBar > 0 then + begin + DestroyAdvExplorerBarBitmaps; + CreateAdvExplorerBarBitmaps; + end; +end; + +procedure ReleaseAdvExplorerBarColors; +begin + Dec(FCounterAdvExplorerBar); + if FCounterAdvExplorerBar = 0 then + DestroyAdvExplorerBarBitmaps; +end; + +procedure InitOffice11Colors; +const + Office11Colors: array[TXPSchemeColor, 0..8] of COLORREF = ( + ($FADAC4, $C97A4A, $FEECDD, $F1D0BA, $F9DBC4, $E08F65, $FFFFFF, $862D00, $B23D00), + ($E7F2F3, $98C6BE, $FFFFFF, $E7F2F3, $AEDFD2, $80B0A1, $FFFFFF, $466B5A, $5E8674), + ($F4EEEE, $C3B0B1, $FCFBFB, $F5F0F0, $DFD0D0, $BFA8A9, $FFFFFF, $795B5C, $99797A) + ); +var + AOffice11Scheme: TXPScheme; +begin + AOffice11Scheme := XPScheme; + if AreVisualStylesAvailable and (AOffice11Scheme <> schUnknown){luna} then + begin + dxOffice11BackgroundColor1 := Office11Colors[AOffice11Scheme, 0]; + dxOffice11BackgroundColor2 := Office11Colors[AOffice11Scheme, 1]; + dxOffice11GroupBackgroundColor1 := Office11Colors[AOffice11Scheme, 2]; + dxOffice11GroupBackgroundColor2 := Office11Colors[AOffice11Scheme, 3]; + dxOffice11GroupCaptionColor1 := Office11Colors[AOffice11Scheme, 4]; + dxOffice11GroupCaptionColor2 := Office11Colors[AOffice11Scheme, 5]; + dxOffice11GroupBorderColor := Office11Colors[AOffice11Scheme, 6]; + dxOffice11GroupFontColor := Office11Colors[AOffice11Scheme, 7]; + dxOffice11LinkFontColor := Office11Colors[AOffice11Scheme, 8]; + end + else + begin + dxOffice11BackgroundColor1 := GetMiddleRGB(clBtnFace, clWindow, 50); + dxOffice11BackgroundColor2 := GetMiddleRGB(clBtnFace, clWindow, 100); + dxOffice11GroupBackgroundColor1 := GetMiddleRGB(clBtnFace, clWindow, 15); + dxOffice11GroupBackgroundColor2 := GetMiddleRGB(clBtnFace, clWindow, 20); + dxOffice11GroupCaptionColor1 := GetMiddleRGB(clBtnFace, clWindow, 45); + dxOffice11GroupCaptionColor2 := GetMiddleRGB(clBtnFace, clWindow, 70); + dxOffice11GroupBorderColor := GetMiddleRGB(clBtnFace, clWindow, 5); + dxOffice11GroupFontColor := clBlack; + dxOffice11LinkFontColor := clBlue; + end; +end; + +procedure CreateOffice11Bitmaps; +begin + dxOffice11CaptionExpandSignBitmap := TBitmap.Create; + dxOffice11CaptionExpandSignBitmap.Handle := LoadBitmap(HInstance, 'DXNAVBAROFFICE11EXPANDSIGN'); + dxOffice11CaptionCollapseSignBitmap := TBitmap.Create; + dxOffice11CaptionCollapseSignBitmap.Handle := LoadBitmap(HInstance, 'DXNAVBAROFFICE11COLLAPSESIGN'); +end; + +procedure DestroyOffice11Bitmaps; +begin + FreeAndNil(dxOffice11CaptionExpandSignBitmap); + FreeAndNil(dxOffice11CaptionCollapseSignBitmap); +end; + +procedure CreateOffice11Colors; +begin + if FCounterOffice11 = 0 then + begin + InitOffice11Colors; + CreateOffice11Bitmaps; + end; + Inc(FCounterOffice11); +end; + +procedure RefreshOffice11Colors; +begin + InitOffice11Colors; + if FCounterOffice11 <> 0 then + begin + DestroyOffice11Bitmaps; + CreateOffice11Bitmaps; + end; +end; + +procedure ReleaseOffice11Colors; +begin + Dec(FCounterOffice11); + if FCounterOffice11 = 0 then + DestroyOffice11Bitmaps; +end; + +procedure CreateOffice11NavPaneBitmaps; +begin + dxOffice11NavPaneOverflowPanelBitmap := TBitmap.Create; + dxOffice11NavPaneOverflowPanelBitmap.Handle := LoadBitmap(HInstance, 'DXNAVBAROFFICE11NAVPANEOVERFLOW'); + dxOffice11NavPaneOverflowPanelBitmap.Transparent := True; + dxOffice11NavPaneSplitterBitmap := TBitmap.Create; + dxOffice11NavPaneSplitterBitmap.Handle := LoadBitmap(HInstance, 'DXNAVBAROFFICE11NAVPANESPLITTER'); + dxOffice11NavPaneSplitterBitmap.Transparent := True; + dxOffice11NavPaneArrowUpBitmap := TBitmap.Create; + dxOffice11NavPaneArrowUpBitmap.Handle := LoadBitmap(HInstance, 'DXNAVBAROFFICE11NAVPANEARROWUP'); + dxOffice11NavPaneArrowUpBitmap.Transparent := True; + dxOffice11NavPaneArrowDownBitmap := TBitmap.Create; + dxOffice11NavPaneArrowDownBitmap.Handle := LoadBitmap(HInstance, 'DXNAVBAROFFICE11NAVPANEARROWDOWN'); + dxOffice11NavPaneArrowDownBitmap.Transparent := True; + dxOffice11NavPaneDefaultLargeBitmap := TBitmap.Create; + dxOffice11NavPaneDefaultLargeBitmap.Handle := LoadBitmap(HInstance, 'DXNAVBAROFFICE11NAVPANEDEFAULTLARGE'); + dxOffice11NavPaneDefaultLargeBitmap.Transparent := True; + dxOffice11NavPaneDefaultSmallBitmap := TBitmap.Create; + dxOffice11NavPaneDefaultSmallBitmap.Handle := LoadBitmap(HInstance, 'DXNAVBAROFFICE11NAVPANEDEFAULTSMALL'); + dxOffice11NavPaneDefaultSmallBitmap.Transparent := True; +end; + +procedure DestroyOffice11NavPaneBitmaps; +begin + FreeAndNil(dxOffice11NavPaneArrowUpBitmap); + FreeAndNil(dxOffice11NavPaneArrowDownBitmap); + FreeAndNil(dxOffice11NavPaneOverflowPanelBitmap); + FreeAndNil(dxOffice11NavPaneSplitterBitmap); + FreeAndNil(dxOffice11NavPaneDefaultLargeBitmap); + FreeAndNil(dxOffice11NavPaneDefaultSmallBitmap); +end; + +procedure CreateOffice11NavPaneColors; +begin + if FCounterOffice11NavPane = 0 then + CreateOffice11NavPaneBitmaps; + Inc(FCounterOffice11NavPane); +end; + +procedure RefreshOffice11NavPaneColors; +begin + if FCounterOffice11NavPane <> 0 then + begin + DestroyOffice11NavPaneBitmaps; + CreateOffice11NavPAneBitmaps; + end; +end; + +procedure ReleaseOffice11NavPaneColors; +begin + Dec(FCounterOffice11NavPane); + if FCounterOffice11NavPane = 0 then + DestroyOffice11NavPaneBitmaps; +end; + +function GetResourceImage(AID: Byte): TBitmap; +var + AResType, AResID: PChar; + AResInfo: THandle; +begin + Result := nil; + if CheckShellInstance then + begin + AResType := RT_BITMAP; + AResID := PChar(char(AID)); + AResInfo := FindResource(FShellInstance, AResID, AResType); + if AResInfo > 0 then + begin + Result := TBitmap.Create; + Result.LoadFromResourceID(FShellInstance, AID); + end; + end; +end; + +function GetResourceText(AName: string): string; +var + AResType, AResName: PChar; + AStream: TResourceStream; + AResInfo: THandle; +begin + Result := ''; + if CheckShellInstance then + begin + AResType := PChar(23); + AResName := PChar(AName); + AResInfo := FindResource(FShellInstance, AResName, AResType); + if AResInfo > 0 then + begin + AStream := TResourceStream.Create(FShellInstance, AResName, AResType); + try + Result := Copy(PChar(AStream.Memory), 1, AStream.Size); + finally + AStream.Free; + end; + end; + end; +end; + +procedure CreateXPExplorerBarBitmaps; +begin + dxXPExplorerBarSpecialGroupHeader := GetResourceImage(110); + dxXPExplorerBarNormalGroupHeader := GetResourceImage(112); + dxXPExplorerBarSpecialGroupCollapseHot := GetResourceImage(105); + dxXPExplorerBarNormalGroupCollapseHot := GetResourceImage(101); + dxXPExplorerBarSpecialGroupCollapse := GetResourceImage(104); + dxXPExplorerBarNormalGroupCollapse := GetResourceImage(100); + dxXPExplorerBarSpecialGroupExpandHot := GetResourceImage(107); + dxXPExplorerBarNormalGroupExpandHot := GetResourceImage(103); + dxXPExplorerBarSpecialGroupExpand := GetResourceImage(106); + dxXPExplorerBarNormalGroupExpand := GetResourceImage(102); + dxXPExplorerBarBackground := GetResourceImage(114); +end; + +procedure CreateXPExplorerBarStyleSheetAttributes; +var + AStyleSheetText: string; + AParser: TdxStyleSheetParser; +begin + AStyleSheetText := GetResourceText('CPWEBVW.CSS'); + AParser := TdxStyleSheetParser.Create(AStyleSheetText); + try + dxXPExplorerBarItemFont := TFont.Create; + dxXPExplorerBarItemFontHot := TFont.Create; + dxXPExplorerBarGroupHeaderFont := TFont.Create; + dxXPExplorerBarGroupHeaderFontHot := TFont.Create; + + GetSystemFont(dxXPExplorerBarItemFont); + GetSystemFont(dxXPExplorerBarItemFontHot); + GetSystemFont(dxXPExplorerBarGroupHeaderFont); + GetSystemFont(dxXPExplorerBarGroupHeaderFontHot); + + AParser.ParseFont(dxXPExplorerBarGroupHeaderFont, 'BODY '); + AParser.ParseFont(dxXPExplorerBarGroupHeaderFontHot, 'BODY '); + AParser.ParseFont(dxXPExplorerBarItemFont, 'BODY '); + AParser.ParseFont(dxXPExplorerBarItemFontHot, 'BODY '); + AParser.ParseFont(dxXPExplorerBarItemFont, 'A '); + AParser.ParseFont(dxXPExplorerBarItemFontHot, 'A '); + AParser.ParseFont(dxXPExplorerBarGroupHeaderFont, '.LEARNABOUTCAPTION '); + AParser.ParseFont(dxXPExplorerBarGroupHeaderFontHot, '.LEARNABOUTCAPTION '); + AParser.ParseFont(dxXPExplorerBarGroupHeaderFontHot, 'A:HOVER '); + AParser.ParseFont(dxXPExplorerBarItemFontHot, 'A:HOVER '); + + AParser.ParseBorderColor(dxXPExplorerBarGroupBorderColor, '.LEARNABOUTBOX'); + finally + AParser.Free; + end; +end; + +procedure DestroyXPExplorerBarBitmaps; +begin + FreeAndNil(dxXPExplorerBarSpecialGroupHeader); + FreeAndNil(dxXPExplorerBarNormalGroupHeader); + FreeAndNil(dxXPExplorerBarSpecialGroupCollapseHot); + FreeAndNil(dxXPExplorerBarNormalGroupCollapseHot); + FreeAndNil(dxXPExplorerBarSpecialGroupCollapse); + FreeAndNil(dxXPExplorerBarNormalGroupCollapse); + FreeAndNil(dxXPExplorerBarSpecialGroupExpandHot); + FreeAndNil(dxXPExplorerBarNormalGroupExpandHot); + FreeAndNil(dxXPExplorerBarSpecialGroupExpand); + FreeAndNil(dxXPExplorerBarNormalGroupExpand); + FreeAndNil(dxXPExplorerBarBackground); +end; + +procedure DestroyXPExplorerBarStyleSheetAttributes; +begin + FreeAndNil(dxXPExplorerBarItemFont); + FreeAndNil(dxXPExplorerBarItemFontHot); + FreeAndNil(dxXPExplorerBarGroupHeaderFont); + FreeAndNil(dxXPExplorerBarGroupHeaderFontHot); + dxXPExplorerBarGroupBorderColor := clNone; +end; + +procedure LoadShellInstance; +begin + FShellLibrary := LoadLibrary(ShellLibraryName); + if FShellLibrary <> 0 then + FSHGetShellStyleHInstancePointer := GetProcAddress(FShellLibrary, 'SHGetShellStyleHInstance'); + if FSHGetShellStyleHInstancePointer <> nil then + @FSHGetShellStyleHInstance := FSHGetShellStyleHInstancePointer; +end; + +procedure UnloadShellInstance; +begin + if FShellLibrary <> 0 then + FreeLibrary(FShellLibrary); +end; + +function CheckShellInstance: Boolean; +begin + Result := FShellInstance > 0; +end; + +procedure CreateXPExplorerBarColors; +begin + if FCounterXPExplorerBar = 0 then + begin + if FSHGetShellStyleHInstancePointer <> nil then + begin + FShellInstance := FSHGetShellStyleHInstance; + end; + CreateXPExplorerBarBitmaps; + CreateXPExplorerBarStyleSheetAttributes; + end; + Inc(FCounterXPExplorerBar); +end; + +procedure RefreshXPExplorerBarColors; +begin + if FCounterXPExplorerBar <> 0 then + begin + FShellInstance := 0; + DestroyXPExplorerBarBitmaps; + DestroyXPExplorerBarStyleSheetAttributes; + if FSHGetShellStyleHInstancePointer <> nil then + begin + FShellInstance := FSHGetShellStyleHInstance; + end; + CreateXPExplorerBarBitmaps; + CreateXPExplorerBarStyleSheetAttributes; + end; +end; + +procedure ReleaseXPExplorerBarColors; +begin + Dec(FCounterXPExplorerBar); + if FCounterXPExplorerBar = 0 then + begin + FShellInstance := 0; + DestroyXPExplorerBarBitmaps; + DestroyXPExplorerBarStyleSheetAttributes; + end; +end; + +function XPScheme: TXPScheme; +begin + Result := TXPScheme(GetOffice11Scheme); +end; + +function LightColor(AColor: TColor): TColor; +begin + Result := Light(AColor, 80); +end; + +function LightLightColor(AColor: TColor): TColor; +begin + Result := Light(AColor, 40); +end; + +function DarkColor(AColor: TColor): TColor; +begin + Result := Dark(AColor, 60); +end; + +function DarkDarkColor(AColor: TColor): TColor; +begin + Result := Dark(AColor, 40); +end; + +function LightBorderColor(AColor: TColor): TColor; +begin + Result := Light(AColor, 70); +end; + +function LightLightBorderColor(AColor: TColor): TColor; +begin + Result := Light(AColor, 20); +end; + +function DarkBorderColor(AColor: TColor): TColor; +begin + Result := Dark(AColor, 70); +end; + +function DarkDarkBorderColor(AColor: TColor): TColor; +begin + Result := Dark(AColor, 20); +end; + +function CalcColor(d: Integer): TColor; +var + clrColor: TColor; + r, g, b: Integer; + AMax, ADelta, AMaxDelta: Integer; +begin + clrColor := clHighlight; + r := GetRed(clrColor); + g := GetGreen(clrColor); + b := GetBlue(clrColor); + AMax := Max(Max(r, g), b); + ADelta := $23 + d; + AMaxDelta := (255 - (AMax + ADelta)); + if AMaxDelta > 0 then AMaxDelta := 0; + Inc(r, (ADelta + AMaxDelta + 5)); + Inc(g, (ADelta + AMaxDelta)); + Inc(b, (ADelta + AMaxDelta)); + if r > 255 then r := 255; + if g > 255 then g := 255; + if b > 255 then b := 255; + Result := RGB(Abs(r), Abs(g), Abs(b)); + Result := ColorRefToARGB(Result); +end; + +function CalcTextColor(AColor: TColor; AState: TdxNavBarObjectStates): TColor; +begin + if AColor = clNone then + Result := CalcColor(-50) + else Result := AColor; + + if (sDisabled in AState) then + Result := LightLightColor(Result) + else if (sSelected in AState) or (sHotTracked in AState) or (sPressed in AState) then + Result := LightColor(Result); +end; + +function GetFontHeight(AFont: TFont): Integer; +begin + Result := cxScreenCanvas.FontHeight(AFont); +end; + +procedure GetSystemFont(AFont: TFont); +var + NonClientMetrics: TNonClientMetrics; +begin + NonClientMetrics.cbSize := sizeof(NonClientMetrics); + if SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, @NonClientMetrics, 0) then + AFont.Handle := Windows.CreateFontIndirect(NonClientMetrics.lfMessageFont) + else + AFont.Handle := GetStockObject(DEFAULT_GUI_FONT); +end; + +procedure dxNavBarDrawSelectedFrame(ACanvas: TCanvas; const ARect: TRect; ATopLeftOuterColor, ABottomRightOuterColor, + ATopLeftInnerColor, ABottomRightInnerColor: TColor); + + function GetBorders(ATopLeftColor, ABottomRightColor: TColor): TcxBorders; + begin + Result := []; + if ATopLeftColor <> clNone then + Result := Result + [bLeft, bTop]; + if ABottomRightColor <> clNone then + Result := Result + [bRight, bBottom]; + end; + +begin + with TcxCanvas.Create(ACanvas) do + begin + DrawComplexFrame(ARect, ATopLeftOuterColor, ABottomRightOuterColor, + GetBorders(ATopLeftOuterColor, ABottomRightOuterColor)); + DrawComplexFrame(cxRectInflate(ARect, -1, -1), ATopLeftInnerColor, ABottomRightInnerColor, + GetBorders(ATopLeftInnerColor, ABottomRightInnerColor)); + Free; + end; +end; + +procedure RGBQuadToColorRef(AColor: TRGBQuad; out ARevertedColor: COLORREF); +begin + ARevertedColor := RGB(AColor.rgbRed, AColor.rgbGreen, AColor.rgbBlue); +end; + +procedure ColorRefToRGBQuad(AColor: COLORREF; out ARevertedColor: TRGBQuad); +begin + ARevertedColor.rgbBlue := GetBValue(AColor); + ARevertedColor.rgbGreen := GetGValue(AColor); + ARevertedColor.rgbRed := GetRValue(AColor); +end; + +function IsGdiPlusAvailable: Boolean; +begin + Result := CheckGdiPlus; +end; + +{ TdxGPColor } + +function MakeColor(r, g, b: Byte): ARGB; overload; +begin + result := MakeColor(255, r, g, b); +end; + +function MakeColor(a, r, g, b: Byte): ARGB; overload; +begin + result := ((DWORD(b) shl BlueShift) or + (DWORD(g) shl GreenShift) or + (DWORD(r) shl RedShift) or + (DWORD(a) shl AlphaShift)); +end; + +function MakeColor(color: TColor; alpha: Byte): ARGB; overload; +begin + result := MakeColor(alpha, GetRValue(color), GetGValue(color), GetBValue(color)); +end; + +function GetAlpha(color: ARGB): BYTE; +begin + result := BYTE(color shr AlphaShift); +end; + +function GetRed(color: ARGB): BYTE; +begin + result := BYTE(color shr RedShift); +end; + +function GetGreen(color: ARGB): BYTE; +begin + result := BYTE(color shr GreenShift); +end; + +function GetBlue(color: ARGB): BYTE; +begin + result := BYTE(color shr BlueShift); +end; + +function ColorRefToARGB(rgb: COLORREF): ARGB; +begin + result := MakeColor(255, GetRValue(rgb), GetGValue(rgb), GetBValue(rgb)); +end; + +function ARGBToColorRef(Color: ARGB): COLORREF; +begin + result := RGB(GetRed(Color), GetGreen(Color), GetBlue(Color)); +end; + +procedure GdipFillGradientRect(DC: HDC; const ARect: TRect; AColor1, AColor2: TColor; + AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode); +var + AGPCanvas: TdxGPGraphics; + AGPBrush: TdxGPLinearGradientBrush; + AGPRect, AGPBrushRect: TdxGPRect; + AGPGradientMode: TdxGPLinearGradientMode; + AGPColor1, AGPColor2: TdxGPColor; +begin + AGPRect := MakeRect(ARect); + AGPColor1 := MakeColor(ColorToRGB(AColor1), AAlphaBlend1); + AGPColor2 := MakeColor(ColorToRGB(AColor2), AAlphaBlend2); + AGPGradientMode := TdxGPLinearGradientMode(AGradientMode); + AGPCanvas := TdxGPGraphics.Create(DC); + try + AGPBrushRect := MakeRect(cxRectInflate(ARect, 1, 1));// Inflate: Avoid GDIPlus gradient fill bug + AGPBrush := TdxGPLinearGradientBrush.Create(AGPBrushRect, AGPColor1, AGPColor2, AGPGradientMode); + try + AGPCanvas.FillRectangle(AGPBrush, AGPRect); + finally + AGPBrush.Free; + end; + finally + AGPCanvas.Free; + end; +end; + +initialization + LoadShellInstance; + +finalization + UnloadShellInstance; + +end. + diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarGroupItems.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarGroupItems.pas new file mode 100644 index 00000000..a56daa79 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarGroupItems.pas @@ -0,0 +1,77 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarGroupItems; + +interface + +uses + dxNavBarCollns; + +type + TdxNavBarSeparator = class(TdxNavBarItem) + protected + function CanSelect: Boolean; override; + class function GetCalculatorClass: TdxNavBarCustomGroupItemCalculatorClass; override; + public + procedure Draw(const APainter, ALinkViewInfo); override; + end; + +implementation + +uses + Classes, Graphics, dxNavBar; + +{ TdxNavBarSeparator } + +procedure TdxNavBarSeparator.Draw(const APainter, ALinkViewInfo); +begin + TdxNavBarPainter(APainter).DrawSeparator(TdxNavBarLinkViewInfo(ALinkViewInfo)); +end; + +function TdxNavBarSeparator.CanSelect: Boolean; +begin + Result := False; +end; + +class function TdxNavBarSeparator.GetCalculatorClass: TdxNavBarCustomGroupItemCalculatorClass; +begin + Result := TdxNavBarSeparatorCalculator; +end; + +initialization + RegisterClasses([TdxNavBarSeparator]); + +end. + diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarOffice11Views.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarOffice11Views.pas new file mode 100644 index 00000000..d8b6f402 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarOffice11Views.pas @@ -0,0 +1,5270 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarOffice11Views; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, Graphics, Controls, Menus, ImgList, Contnrs, Forms, + dxNavBar, dxNavBarBase, dxNavBarStyles, dxNavBarCustomPainters, dxNavBarBaseViews, + dxNavBarOfficeViews, dxNavBarExplorerViews, dxNavBarCollns, cxAccessibility, + cxContainer, cxControls, cxGraphics; + +const + nbOverflowPanelSign = 0; + nbOverflowPanelItem = 1; + nbHeaderSign = 2; + nbSplitter = 3; + nbItemPanelCollapseItem = 4; + nbItemPanelCollapseBar = 5; + +type + TdxNavBarNavigationPaneViewInfo = class; + TdxNavBarNavigationPanePainter = class; + + { TdxNavBarOffice11ExplorerBar } + + TdxNavBarOffice11LinkViewInfo = class(TdxNavBarLinkViewInfo) + public + function FontColor: TColor; override; + end; + + TdxNavBarOffice11GroupViewInfo = class(TdxNavBarExplorerBarGroupViewInfo) + private + function IsDefaultBgColor: Boolean; + function IsDefaultCaptionColor: Boolean; + public + function BorderColor: TColor; override; + function BgBackColor: TColor; override; + function BgBackColor2: TColor; override; + function BgAlphaBlend: Byte; override; + function BgAlphaBlend2: Byte; override; + function BgGradientMode: TdxBarStyleGradientMode; override; + function CaptionBackColor: TColor; override; + function CaptionBackColor2: TColor; override; + function CaptionAlphaBlend: Byte; override; + function CaptionAlphaBlend2: Byte; override; + function CaptionGradientMode: TdxBarStyleGradientMode; override; + function CaptionFontColor: TColor; override; + end; + + TdxNavBarOffice11ViewInfo = class(TdxNavBarExplorerBarViewInfo) + private + function IsDefaultBgColor: Boolean; + protected + procedure CreateColors; override; + procedure RefreshColors; override; + procedure ReleaseColors; override; + + function GetGroupEdges: TPoint; override; + function GetGroupSeparatorWidth: Integer; override; + function GetLinksImageEdges: TRect; override; + public + function BgBackColor: TColor; override; + function BgBackColor2: TColor; override; + function BgAlphaBlend: Byte; override; + function BgAlphaBlend2: Byte; override; + function BgGradientMode: TdxBarStyleGradientMode; override; + + procedure AssignDefaultBackgroundStyle; override; + procedure AssignDefaultGroupBackgroundStyle; override; + procedure AssignDefaultGroupHeaderStyle; override; + procedure AssignDefaultGroupHeaderActiveStyle; override; + procedure AssignDefaultItemStyle; override; + end; + + TdxNavBarOffice11Painter = class(TdxNavBarExplorerBarPainter) + protected + class function GetViewInfoClass: TdxNavBarViewInfoClass; override; + class function GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; override; + class function GetLinkViewInfoClass: TdxNavBarLinkViewInfoClass; override; + + class function ButtonPainterClass: TdxNavBarCustomButtonPainterClass; override; + class function SignPainterClass: TdxNavBarCustomSignPainterClass; override; + end; + + TdxNavBarOffice11SignPainter = class(TdxNavBarExplorerBarSignPainter) + protected + class procedure PrepareBitmap(ACanvas: TCanvas; ABitmap: TBitmap; + ABackColor1, ABackColor2: TColor; AState: TdxNavBarObjectStates); + class procedure InternalDrawSign(ACanvas: TCanvas; ARect: TRect; + AForeColor, ABackColor1, ABackColor2: TColor; AState: TdxNavBarObjectStates); override; + end; + + TdxNavBarOffice11ExplorerBarGroupViewInfo = class(TdxNavBarExplorerBarGroupViewInfo) + private + function IsDefaultCaptionColor: Boolean; + public + function CaptionBorderColor: TColor; override; + function CaptionBackColor: TColor; override; + function CaptionBackColor2: TColor; override; + function CaptionAlphaBlend: Byte; override; + function CaptionAlphaBlend2: Byte; override; + function CaptionGradientMode: TdxBarStyleGradientMode; override; + end; + + TdxNavBarOffice11ExplorerBarViewInfo = class(TdxNavBarExplorerBarViewInfo) + protected + procedure CreateColors; override; + procedure RefreshColors; override; + procedure ReleaseColors; override; + + function CanSelectLinkByRect: Boolean; override; + function GetGroupBorderOffsets: TRect; override; + function GetGroupCaptionHeightAddon: Integer; override; + class function GetGroupCaptionImageIndent: Integer; override; + function GetGroupEdges: TPoint; override; + function GetGroupSeparatorWidth: Integer; override; + public + procedure AssignDefaultBackgroundStyle; override; + procedure AssignDefaultButtonStyle; override; + procedure AssignDefaultGroupBackgroundStyle; override; + procedure AssignDefaultGroupHeaderStyle; override; + procedure AssignDefaultItemStyle; override; + procedure AssignDefaultItemDisabledStyle; override; + procedure AssignDefaultNavigationPaneHeaderStyle; override; + end; + + TdxNavBarOffice11ExplorerBarControllerState = (ecsOverSizeGrip); + TdxNavBarOffice11ExplorerBarControllerStates = set of TdxNavBarOffice11ExplorerBarControllerState; + + TdxNavBarOffice11ExplorerBarController = class(TdxNavBarExplorerBarController) + private + FInternalState: TdxNavBarOffice11ExplorerBarControllerStates; + function GetMouseOverSizeGrip: Boolean; + procedure SetMouseOverSizeGrip(AValue: Boolean); + property MouseOverSizeGrip: Boolean read GetMouseOverSizeGrip write SetMouseOverSizeGrip; + protected + procedure DoMouseDown(AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); override; + procedure DoMouseMove(AShift: TShiftState; const APoint: TPoint); override; + function GetCursor: HIcon; override; + end; + + TdxNavBarOffice11ExplorerBarPainter = class(TdxNavBarExplorerBarPainter) + protected + class function GetViewInfoClass: TdxNavBarViewInfoClass; override; + class function GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; override; + function GetControllerClass: TdxNavBarControllerClass; override; + + class function SignPainterClass: TdxNavBarCustomSignPainterClass; override; + public + procedure DrawNavBarControl; override; + procedure DrawGroupControlSplitter(AGroupViewInfo: TdxNavBarExplorerBarGroupViewInfo); override; + end; + + TdxNavBarOffice11ExplorerBarSignPainter = class(TdxNavBarExplorerBarSignPainter) + protected + class procedure DrawSignSelection(ACanvas: TCanvas; ARect: TRect; AForeColor, + ABackColor1, ABackColor2: TColor; AState: TdxNavBarObjectStates); override; + end; + + { TdxNavBarNavigationPane } + + TdxNavBarNavigationPaneGroupViewInfo = class(TdxNavBarGroupViewInfo) + private + function IsDefaultCaptionColor: Boolean; + public + function CaptionBorderColor: TColor; override; + function CaptionBackColor: TColor; override; + function CaptionBackColor2: TColor; override; + function CaptionAlphaBlend: Byte; override; + function CaptionAlphaBlend2: Byte; override; + function CaptionGradientMode: TdxBarStyleGradientMode; override; + end; + + TdxNavBarOffice11NavPaneGroupViewInfo = class(TdxNavBarNavigationPaneGroupViewInfo); + + TdxNavBarNavigationPaneCustomViewInfo = class(TdxNavBarCustomViewInfo) + private + FViewInfo: TdxNavBarViewInfo; + function GetViewInfo: TdxNavBarNavigationPaneViewInfo; + function GetPainter: TdxNavBarNavigationPanePainter; + protected + property ViewInfo: TdxNavBarNavigationPaneViewInfo read GetViewInfo; + property Painter: TdxNavBarNavigationPanePainter read GetPainter; + public + constructor Create(AViewInfo: TdxNavBarViewInfo); virtual; + end; + + TdxNavBarOverflowPanelViewInfoItem = class + public + Group: TdxNavBarGroup; + Rect: TRect; + SelectionRect: TRect; + end; + + TdxNavBarOverflowPanelViewInfo = class(TdxNavBarNavigationPaneCustomViewInfo) + private + FIAccessibilityHelper: IdxNavBarAccessibilityHelper; + FItems: TList; + FRect: TRect; + FSignRect: TRect; + FVisibleItemCount: Integer; + + procedure ClearRects; + procedure ClearItems; + procedure OffsetElements(AHeightDifference: Integer); + + function GetIAccessibilityHelper: IdxNavBarAccessibilityHelper; + + function AddItem: TdxNavBarOverflowPanelViewInfoItem; + function GetItemCount: Integer; + function GetItems(AIndex: Integer): TdxNavBarOverflowPanelViewInfoItem; + protected + function GetAccessibilityHelperClass: TdxNavBarCustomAccessibilityHelperClass; virtual; + + function GetHeight: Integer; virtual; + function GetImageHeight: Integer; + function GetImageWidth: Integer; + function GetImageList: TCustomImageList; + function GetImageIndex(AGroup: TdxNavBarGroup): Integer; + function GetItemIndexAtPos(const pt: TPoint): Integer; + function GetItemSelectionWidth: Integer; + function GetGroupAtPos(const pt: TPoint): TdxNavBarGroup; + + // Calculation + procedure CalculateBounds(X, Y: Integer); + + // Conditions + function IsVisible: Boolean; + + // Indents + function GetImageWidthAddon: Integer; virtual; + function GetSignWidth: Integer; virtual; + function GetHeightAddon: Integer; virtual; + function GetPopupMenuImageIndent: Integer; virtual; + function GetPopupMenuTextIndent: Integer; virtual; + function GetSeparator: Integer; virtual; + + function GetClientOffset: TRect; virtual; + + property ItemCount: Integer read GetItemCount; + property Items[AIndex: Integer]: TdxNavBarOverflowPanelViewInfoItem read GetItems; + public + constructor Create(AViewInfo: TdxNavBarViewInfo); override; + destructor Destroy; override; + + property Rect: TRect read FRect; + end; + TdxNavBarOverflowPanelViewInfoClass = class of TdxNavBarOverflowPanelViewInfo; + + TdxNavBarItemPanelViewInfoItem = class + private + function GetCaption: string; + protected + procedure OffsetRects(dX, dY: Integer); + public + Index: Integer; + ItemLink: TdxNavBarItemLink; + Font: TFont; + Rect: TRect; + TextRect: TRect; + ImageRect: TRect; + ImageList: TCustomImageList; + ImageIndex: Integer; + + property Caption: string read GetCaption; + end; + + TdxNavBarItemPanelViewInfo = class(TdxNavBarNavigationPaneCustomViewInfo) + private + FIAccessibilityHelper: IdxNavBarAccessibilityHelper; + FCollapseBarGroup: TdxNavBarGroup; + FCollapseBarRect: TRect; + FRect: TRect; + FActiveGroupViewInfo: TdxNavBarGroupViewInfo; + FItems: TObjectList; + + FIsCollapseMode: Boolean; //#DG TODO: + + function GetCollapseBarIAccessibilityHelper: IdxNavBarAccessibilityHelper; + function GetIAccessibilityHelper: IdxNavBarAccessibilityHelper; + function GetItemCount: Integer; + function GetItemIAccessibilityHelper(AIndex: Integer): IdxNavBarAccessibilityHelper; + function GetItems(AIndex: Integer): TdxNavBarItemPanelViewInfoItem; + procedure SetActiveGroupViewInfo(AValue: TdxNavBarGroupViewInfo); + + function AddItem: TdxNavBarItemPanelViewInfoItem; + procedure ClearItems; + procedure CreateItems; + protected + function GetMinHeight: Integer; + + procedure CalculateBounds(var X, Y: Integer); + procedure CorrectBounds(AHeightDifference: Integer); + function GetCollapseBarFont: TFont; + function GetCollapseBarText: string; + function GetItemFont(AIndex: Integer): TFont; + function GetItemIndexAtPos(const pt: TPoint): Integer; + + function GetCollapseBarCaptionIndent: Integer; + + function GetAccessibilityHelperClass: TdxNavBarCustomAccessibilityHelperClass; virtual; + + property IAccessibilityHelper: IdxNavBarAccessibilityHelper + read GetIAccessibilityHelper; + property ActiveGroupViewInfo: TdxNavBarGroupViewInfo read FActiveGroupViewInfo write SetActiveGroupViewInfo; + property CollapseBarFont: TFont read GetCollapseBarFont; + property CollapseBarText: string read GetCollapseBarText; + property CollapseBarRect: TRect read FCollapseBarRect; + property ItemCount: Integer read GetItemCount; + property Items[AIndex: Integer]: TdxNavBarItemPanelViewInfoItem read GetItems; + property Rect: TRect read FRect; + public + constructor Create(AViewInfo: TdxNavBarViewInfo); override; + destructor Destroy; override; + + property CollapseBarIAccessibilityHelper: IdxNavBarAccessibilityHelper + read GetCollapseBarIAccessibilityHelper; + property ItemIAccessibilityHelpers[AIndex: Integer]: IdxNavBarAccessibilityHelper + read GetItemIAccessibilityHelper; + end; + + TdxNavBarNavigationPaneViewInfo = class(TdxNavBarOffice3ViewInfo) + private + FActiveGroupCaptionPanelIAccessibilityHelper: IdxNavBarAccessibilityHelper; + FSizeGripRect: TRect; + FHeaderRect: TRect; + FHeaderSignIAccessibilityHelper: IdxNavBarAccessibilityHelper; + FHeaderSignRect: TRect; + FHeaderTextRect: TRect; + + FOverflowPanelViewInfo: TdxNavBarOverflowPanelViewInfo; + FItemPanelViewInfo: TdxNavBarItemPanelViewInfo; + + FSplitterRect: TRect; + FPopupMenu: TPopupMenu; + FImageList: TImageList; + + FMaxImageSize: TSize; + FImageHeightPeer: Boolean; + + function GetPainter: TdxNavBarNavigationPanePainter; + + function GetActiveGroupCaptionPanelIAccessibilityHelper: IdxNavBarAccessibilityHelper; + function GetHeaderSignIAccessibilityHelper: IdxNavBarAccessibilityHelper; + function GetOverflowPanelIAccessibilityHelper: IdxNavBarAccessibilityHelper; + function GetOverflowPanelSignIAccessibilityHelper: IdxNavBarAccessibilityHelper; + function GetOverflowPanelItemIAccessibilityHelper(AIndex: Integer): IdxNavBarAccessibilityHelper; + function GetNavPanePartIAccessibilityHelper(const APart: TdxNavBarPart): IdxNavBarAccessibilityHelper; + + function GetSmallImagesCount: Integer; + + // OverflowPanel + function GetOverflowPanelItemCount: Integer; + function GetOverflowPanelItems(AIndex: Integer): TdxNavBarOverflowPanelViewInfoItem; + function GetOverflowPanelRect: TRect; + function GetOverflowPanelSignRect: TRect; + function GetOverflowPanelVisibleItemCount: Integer; + + function IsActiveGroupVisible: Boolean; + function IsGroupReflectionNeeded: Boolean; + function GetRealGroupStartIndex: Integer; + function GetRealGroupCount: Integer; + + function IsDefaultHeaderColor: Boolean; + function IsDefaultOverflowPanelColor: Boolean; + function IsDefaultBottomScrollButtonColor: Boolean; + function IsDefaultTopScrollButtonColor: Boolean; + procedure RecreateImageList; + // Menu items + procedure DoMoreButtonsClick(Sender: TObject); + procedure DoFewerButtonsClick(Sender: TObject); + procedure DoAddRemoveButtonsClick(Sender: TObject); + procedure DoHiddenGroupClick(Sender: TObject); + procedure DoMeasureItem(Sender: TObject; ACanvas: TCanvas; var Width, Height: Integer); + procedure DoDrawItem(Sender: TObject; ACanvas: TCanvas; ARect: TRect; + Selected: Boolean); + protected + procedure CreateColors; override; + procedure RefreshColors; override; + procedure ReleaseColors; override; + + // Sizes + function GetGroupEdges: TPoint; override; + function GetGroupSeparatorWidth: Integer; override; + function GetGroupBorderOffsets: TRect; override; + class function GetGroupCaptionImageIndent: Integer; override; + function GetGroupCaptionHeightAddon: Integer; override; + function GetGroupHeaderTextIndent: Integer; virtual; + function GetHeaderClientOffset: TRect; virtual; + function GetHeaderSignIndents: TRect; virtual; + function GetNavBarCollapsedWidth: Integer; override; + function GetNavBarMinExpandedWidth: Integer; override; + + // Conditions + function CanCollapse: Boolean; override; + function CanHasGroupViewAsIconView: Boolean; override; + function CanHasImageInGroupCaption: Boolean; override; + function CanGroupCaptionBoundsByImage: Boolean; override; + function IsBottomBorderNeeded: Boolean; + function IsHeaderVisible: Boolean; + function IsSplitterVisible: Boolean; + function IsTopBorderNeeded: Boolean; + + // Correction + procedure CorrectBounds; override; + + // Calculations + procedure DoCreateGroupsInfo; override; + procedure DoCalculateBounds(X, Y: Integer); override; + + function GetItemPanelRect: TRect; + + function GetBoundsUpdateType: TdxNavBarChangeType; override; + + function GetActiveGroupCaptionPanelAccessibilityHelperClass: TdxNavBarCustomAccessibilityHelperClass; virtual; + function GetHeaderSignAccessibilityHelperClass: TdxNavBarCustomAccessibilityHelperClass; virtual; + function GetOverflowPanelViewInfoClass: TdxNavBarOverflowPanelViewInfoClass; virtual; + public + constructor Create(APainter: TdxNavBarPainter); override; + destructor Destroy; override; + + procedure CreateInfo; override; + procedure CreateItemPanelViewInfo; + procedure CreateOverflowPanelInfo(AItemCount: Integer; AClearOld: Boolean); virtual; + procedure CalculateSizeGripBounds; virtual; + procedure CalculateHeaderBounds(var X, Y: Integer); virtual; + procedure CalculateMaxImageSize; virtual; + procedure CalculateSplitterBounds(var X, Y: Integer); virtual; + procedure ClearRects; override; + + function GetHeaderHeight: Integer; virtual; + function GetGripSize: Integer; virtual; + function GetSplitterHeight: Integer; virtual; + + function GetGroupViewInfoAtItemsPos(const pt: TPoint): TdxNavBarGroupViewInfo; override; + function GetViewInfoAtDragPosition(const pt: TPoint; var ItemGroup: TdxNavBarGroupViewInfo; + var Item1, Item2: TdxNavBarLinkViewInfo): Integer; override; + + function IsPtIncNavigationPaneOverflowPanelItemCount(const pt: TPoint): Boolean; + function IsPtDecNavigationPaneOverflowPanelItemCount(const pt: TPoint): Boolean; + function IsPtNavigationPaneHeader(const pt: TPoint): Boolean; + function IsPtNavigationPaneHeaderSign(const pt: TPoint): Boolean; + function IsPtNavigationPaneOverflowPanel(const pt: TPoint): Boolean; + function IsPtNavigationPaneOverflowPanelSign(const pt: TPoint): Boolean; + function IsPtNavigationPaneSplitter(const pt: TPoint): Boolean; + function IsPtNavigationPaneItemPanel(const pt: TPoint): Boolean; + + procedure DoShowPopupMenu(const APoint: TPoint); + procedure DoUpdatePopupMenu; virtual; + + function FindGroupWithAccel(AKey: Word): TdxNavBarGroup; override; + function FindLinkWithAccel(AKey: Word): TdxNavBarItemLink; override; + + function BorderWidth: Integer; virtual; + function BorderColor: TColor; override; + function CollapseBarFontColor: TColor; virtual; + + function BottomScrollButtonBackColor: TColor; override; + function BottomScrollButtonBackColor2: TColor; override; + function BottomScrollButtonAlphaBlend: Byte; override; + function BottomScrollButtonAlphaBlend2: Byte; override; + function BottomScrollButtonGradientMode: TdxBarStyleGradientMode; override; + function TopScrollButtonBackColor: TColor; override; + function TopScrollButtonBackColor2: TColor; override; + function TopScrollButtonAlphaBlend: Byte; override; + function TopScrollButtonAlphaBlend2: Byte; override; + function TopScrollButtonGradientMode: TdxBarStyleGradientMode; override; + function HeaderBackColor: TColor; override; + function HeaderBackColor2: TColor; override; + function HeaderAlphaBlend: Byte; override; + function HeaderAlphaBlend2: Byte; override; + function HeaderGradientMode: TdxBarStyleGradientMode; override; + function HeaderFontColor: TColor; override; + function OverflowPanelBackColor: TColor; override; + function OverflowPanelBackColor2: TColor; override; + function OverflowPanelAlphaBlend: Byte; override; + function OverflowPanelAlphaBlend2: Byte; override; + function OverflowPanelGradientMode: TdxBarStyleGradientMode; override; + function SplitterBackColor: TColor; override; + function SplitterBackColor2: TColor; override; + function SplitterGradientMode: TdxBarStyleGradientMode; override; + + procedure AssignDefaultBackgroundStyle; override; + procedure AssignDefaultButtonStyle; override; + procedure AssignDefaultGroupBackgroundStyle; override; + procedure AssignDefaultGroupHeaderStyle; override; + procedure AssignDefaultItemStyle; override; + procedure AssignDefaultItemDisabledStyle; override; + procedure AssignDefaultNavigationPaneHeaderStyle; override; + + property HeaderRect: TRect read FHeaderRect; + property HeaderSignRect: TRect read FHeaderSignRect; + property ItemPanelRect: TRect read GetItemPanelRect; + + property OverflowPanelItemCount: Integer read GetOverflowPanelItemCount; + property OverflowPanelItems[Index: Integer]: TdxNavBarOverflowPanelViewInfoItem read GetOverflowPanelItems; + property OverflowPanelRect: TRect read GetOverflowPanelRect; + property OverflowPanelSignRect: TRect read GetOverflowPanelSignRect; + property OverflowPanelVisibleItemCount: Integer read GetOverflowPanelVisibleItemCount; + + property SizeGripRect: TRect read FSizeGripRect; + property SplitterRect: TRect read FSplitterRect; + + property ActiveGroupCaptionPanelIAccessibilityHelper: IdxNavBarAccessibilityHelper + read GetActiveGroupCaptionPanelIAccessibilityHelper; + property ImageList: TImageList read FImageList; + property ItemPanelViewInfo: TdxNavBarItemPanelViewInfo read FItemPanelViewInfo; + property PopupMenu: TPopupMenu read FPopupMenu; + property Painter: TdxNavBarNavigationPanePainter read GetPainter; + + property NavPanePartIAccessibilityHelpers[const APart: TdxNavBarPart]: IdxNavBarAccessibilityHelper + read GetNavPanePartIAccessibilityHelper; + property OverflowPanelSignIAccessibilityHelper: IdxNavBarAccessibilityHelper + read GetOverflowPanelSignIAccessibilityHelper; + property OverflowPanelIAccessibilityHelper: IdxNavBarAccessibilityHelper + read GetOverflowPanelIAccessibilityHelper; + property HeaderSignIAccessibilityHelper: IdxNavBarAccessibilityHelper + read GetHeaderSignIAccessibilityHelper; + end; + + TdxNavBarOffice11NavPaneViewInfo = class(TdxNavBarNavigationPaneViewInfo); + + TdxNavBarPopupControlViewInfo = class(TdxNavBarNavigationPaneCustomViewInfo) + private + FRect: TRect; + + function GetClientRect: TRect; + protected + procedure CalculateBounds(AClientWidth: Integer); virtual; + function CalculatePosition: TPoint; virtual; + function GetBorderOffsets: TRect; virtual; + function GetMaxHeight: Integer; virtual; + function GetMinWidth: Integer; virtual; + function IsPtSizeGrip(const pt: TPoint): Boolean; virtual; + public + property ClientRect: TRect read GetClientRect; + property Rect: TRect read FRect; + end; + TdxNavBarPopupControlViewInfoClass = class of TdxNavBarPopupControlViewInfo; + + TdxNavBarPopupControlState = (pcsSizing, pcsOverSizeGrip); + TdxNavBarPopupControlStates = set of TdxNavBarPopupControlState; + + TdxNavBarPopupControl = class(TcxCustomPopupWindow) + private + FCapturePointOffset: Integer; + FNavBar: TdxCustomNavBar; + FOriginalWidth: Integer; + FInnerControl: TdxCustomNavBar; // TdxNavBarPopupInnerControl + FInternalState: TdxNavBarPopupControlStates; + FSizeFrame: TcxSizeFrame; + FViewInfo: TdxNavBarPopupControlViewInfo; + + procedure CreateViewInfo; + function GetPainter: TdxNavBarNavigationPanePainter; + procedure SetNewWidth(AWidth: Integer); + + function GetMouseOverSizeGrip: Boolean; + procedure SetMouseOverSizeGrip(AValue: Boolean); + + property MouseOverSizeGrip: Boolean read GetMouseOverSizeGrip write SetMouseOverSizeGrip; + protected + function NeedAdjustWidth: Boolean; + function CalculatePosition: TPoint; override; + procedure CalculateSize; override; + procedure BeginResize(AControl: TControl; AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); + procedure EndResize(ACancel: Boolean = False); + procedure DoShowed; override; + procedure DrawSizeFrame(const R: TRect); + procedure InitPopup; override; + procedure Paint; override; + procedure RefreshPopupWindow; + + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + function NeedIgnoreMouseMessageAfterCloseUp(AWnd: THandle; AMsg: Cardinal; + AShift: TShiftState; const APos: TPoint): Boolean; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + public + constructor Create(ANavBar: TdxCustomNavBar); reintroduce; virtual; + destructor Destroy; override; + procedure CloseUp; override; + procedure Popup(AFocusedControl: TWinControl); override; + + property Painter: TdxNavBarNavigationPanePainter read GetPainter; + property ViewInfo: TdxNavBarPopupControlViewInfo read FViewInfo; + end; + + { TdxNavBarNavigationPaneController } + + TdxNavBarNavPanePartState = (oisNormal, oisHot, oisPressed, oisChecked, oisHotCheck, oisDroppedDown); + TdxNavBarNavigationPaneControllerInternalState = (npsPopupShowLocked); + TdxNavBarNavigationPaneControllerInternalStates = set of TdxNavBarNavigationPaneControllerInternalState; + + TdxNavBarNavigationPaneController = class(TdxNavBarNavigationBarController) + private + FInternalState: TdxNavBarNavigationPaneControllerInternalStates; + FPopupControl: TdxNavBarPopupControl; + + FDroppedDownPart: TdxNavBarPart; + + procedure CalcOverflowPanelHintRect(AItem: TObject; var ARect: TRect); + procedure ChangeNavBarCollapseState; + + function IsAnyItemHotTracked: Boolean; + function IsPopupControlExists: Boolean; + function IsPopupControlVisible: Boolean; + function IsOverflowPanelGroupHotTracked: Boolean; + function GetNavPanePartState(const APart: TdxNavBarPart): TdxNavBarNavPanePartState; + function GetOriginalWidth: Integer; + function GetViewInfo: TdxNavBarNavigationPaneViewInfo; + + function GetOverflowPanelGroup(AIndex: Integer): TdxNavBarGroup; + + procedure SetDroppedDownPart(APart: TdxNavBarPart); + procedure SetOriginalWidth(AValue: Integer); + + property OverflowPanelGroup[AIndex: Integer]: TdxNavBarGroup read GetOverflowPanelGroup; + protected + function CanFocusOnClick(const APoint: TPoint): Boolean; override; + function GetCursor: HIcon; override; + function GetPartAtPos(const APoint: TPoint): TdxNavBarPart; override; + + procedure DoClick(const APart: TdxNavBarPart); override; + procedure DoCheckBounds(var ALeft, ATop, AWidth, AHeight: Integer); override; + procedure DoMouseDown(AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); override; + procedure DoMouseMove(AShift: TShiftState; const APoint: TPoint); override; + procedure DoMouseLeave; override; + procedure DoSetHotPart(const APart: TdxNavBarPart); override; + procedure DoSetPressedPart(const APart: TdxNavBarPart); override; + + procedure DoShowHint(var AHintInfo: THintInfo); override; + procedure DoShowOverflowPanelHint(var AHintInfo: THintInfo); virtual; + function GetNavPaneItemHintRect(const ACursorPos: TPoint): TRect; virtual; + function GetNavPaneItemHintText: string; virtual; + function GetNavPaneItemHintCursorRect: TRect; virtual; + + procedure DoOverflowPanelItemClick; + procedure DoOverflowPanelSignClick; + procedure DoHeaderSignClick; + procedure DoCollapseBarClick; + procedure DoCollapseItemClick; + procedure DoSplitterDrag(const APoint: TPoint); + + function Collapsible: Boolean; + function Collapsed: Boolean; + procedure CollapseStateChaged(Sender: TObject); + + property OriginalWidth: Integer read GetOriginalWidth write SetOriginalWidth; + property PopupControl: TdxNavBarPopupControl read FPopupControl; + public + constructor Create(ANavBar: TdxCustomNavBar); override; + destructor Destroy; override; + + procedure ClosePopupControl; + procedure ShowPopupControl; + + property DroppedDownPart: TdxNavBarPart read FDroppedDownPart write SetDroppedDownPart; + property ViewInfo: TdxNavBarNavigationPaneViewInfo read GetViewInfo; + end; + + TdxNavBarNavigationPanePainter = class(TdxNavBarOffice3Painter) + private + function GetController: TdxNavBarNavigationPaneController; + function GetOverflowPanelViewInfo: TdxNavBarOverflowPanelViewInfo; + function GetViewInfo: TdxNavBarNavigationPaneViewInfo; + + procedure DrawItemPanelPartFocusRect(const APartRect: TRect); + procedure DrawVertivalText(AFont: TFont; const AText: string; const ARect: TRect; AState: TdxNavBarNavPanePartState); + procedure DrawOverflowPanelItemBackground(ACanvas: TCanvas; AState: TdxNavBarNavPanePartState; const ARect: TRect); overload; + procedure DrawOverflowPanelItemBackground(ACanvas: TCanvas; const APart: TdxNavBarPart; const ARect: TRect); overload; + protected + function CreatePopupControlViewInfo: TdxNavBarPopupControlViewInfo; + class function ButtonPainterClass: TdxNavBarCustomButtonPainterClass; override; + class function GetViewInfoClass: TdxNavBarViewInfoClass; override; + class function GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; override; + function GetControllerClass: TdxNavBarControllerClass; override; + class function GetPopupControlViewInfoClass: TdxNavBarPopupControlViewInfoClass; virtual; + + function GetNavPanePartState(const APart: TdxNavBarPart): TdxNavBarNavPanePartState; + + procedure DoDrawHeader; virtual; + procedure DoDrawOverflowPanel; virtual; + procedure DoDrawSplitter; virtual; + public + procedure DrawNavBarControl; override; + procedure DrawGroupCaption(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawSizeGrip(ACanvas: TCanvas; const ARect: TRect); virtual; + procedure DrawHintWindow(AHintWindow: TdxNavBarHintWindow); override; + procedure DrawItemPanel; virtual; + procedure DrawGroupCaptionButton(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawCollapseBar(AItemPanelViewInfo: TdxNavBarItemPanelViewInfo); virtual; + procedure DrawCollapseElementBackground(const ARect: TRect; AState: TdxNavBarNavPanePartState); virtual; + procedure DrawCollapseItem(AItemViewInfo: TdxNavBarItemPanelViewInfoItem; AState: TdxNavBarNavPanePartState); virtual; + procedure DrawBorder; virtual; + procedure DrawHeader; virtual; + procedure DrawHeaderBackground; virtual; + procedure DrawHeaderSign; virtual; + procedure DrawHeaderText; virtual; + procedure DrawOverflowPanel; virtual; + procedure DrawOverflowPanelBackground; virtual; + procedure DrawOverflowPanelSign; virtual; + procedure DrawOverflowPanelItems; virtual; + procedure DrawOverflowPanelHintWindow(ACanvas: TCanvas; const ARect: TRect); virtual; + procedure DrawPopupControl(ACanvas: TcxCanvas; AViewInfo: TdxNavBarPopupControlViewInfo); virtual; + procedure DrawSplitter; virtual; + procedure DrawSplitterSign; virtual; + procedure DrawPopupMenuItem(ACanvas: TCanvas; ARect: TRect; AImageList: TCustomImageList; + AImageIndex: Integer; AText: string; State: TdxNavBarObjectStates); virtual; + + property Controller: TdxNavBarNavigationPaneController read GetController; + property OverflowPanelViewInfo: TdxNavBarOverflowPanelViewInfo read GetOverflowPanelViewInfo; + property ViewInfo: TdxNavBarNavigationPaneViewInfo read GetViewInfo; + end; + + TdxNavBarNavigationPaneButtonPainter = class(TdxNavBarCustomButtonPainter) + protected + class procedure InternalDrawButton(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; + AState: TdxNavBarObjectStates); override; + end; + + TdxNavBarOffice11NavPaneButtonPainter = class(TdxNavBarNavigationPaneButtonPainter); + + TdxNavBarOffice11NavPanePainter = class(TdxNavBarNavigationPanePainter) + protected + class function GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; override; + class function GetViewInfoClass: TdxNavBarViewInfoClass; override; + class function ButtonPainterClass: TdxNavBarCustomButtonPainterClass; override; + end; + + TdxNavBarOffice11NavPaneGroupButtonPainter = class(TdxNavBarCustomButtonPainter) + protected + class procedure InternalDrawButton(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; + AState: TdxNavBarObjectStates); override; + end; + + { TdxNavBarItemCollectionItemAccessibilityHelper } + + TdxNavBarItemCollectionItemAccessibilityHelper = class(TdxNavBarCustomAccessibilityHelper) + private + FItemIndex: Integer; + public + property ItemIndex: Integer read FItemIndex write FItemIndex; + end; + + TdxNavBarItemCollectionItemAccessibilityHelperClass = class of TdxNavBarItemCollectionItemAccessibilityHelper; + + { TdxNavBarItemCollectionAccessibilityHelper } + + TdxNavBarItemCollectionAccessibilityHelper = class(TdxNavBarCustomAccessibilityHelper) + private + FItemIAccessibilityHelpers: TInterfaceList; + function GetItemIAccessibilityHelper(AIndex: Integer): IdxNavBarAccessibilityHelper; + function GetItemIAccessibilityHelperCount: Integer; + procedure SetItemIAccessibilityHelperCount(Value: Integer); + protected + function GetChild(AIndex: Integer): TcxAccessibilityHelper; override; + function GetChildCount: Integer; override; + + function GetActualItemCount: Integer; virtual; abstract; + function GetItemAccessibilityHelperClass: TdxNavBarItemCollectionItemAccessibilityHelperClass; virtual; abstract; + function IsContainer: Boolean; override; + public + constructor Create(AOwnerObject: TObject; + AOwnerObjectControl: TWinControl); override; + destructor Destroy; override; + + procedure CheckItemIAccessibilityHelperCount; + + property ItemIAccessibilityHelperCount: Integer + read GetItemIAccessibilityHelperCount; + property ItemIAccessibilityHelpers[AIndex: Integer]: IdxNavBarAccessibilityHelper + read GetItemIAccessibilityHelper; + end; + + TdxNavBarNavigationPaneOverflowPanelAccessibilityHelper = class(TdxNavBarItemCollectionAccessibilityHelper) + private + FSignIAccessibilityHelper: IdxNavBarAccessibilityHelper; + function GetSignIAccessibilityHelper: IdxNavBarAccessibilityHelper; + function GetViewInfo: TdxNavBarOverflowPanelViewInfo; + protected + function GetChild(AIndex: Integer): TcxAccessibilityHelper; override; + function GetChildCount: Integer; override; + function GetParent: TcxAccessibilityHelper; override; + function GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + function GetActualItemCount: Integer; override; + function GetBounds: TRect; override; + function GetItemAccessibilityHelperClass: TdxNavBarItemCollectionItemAccessibilityHelperClass; override; + function GetSignAccessibilityHelperClass: TdxNavBarCustomAccessibilityHelperClass; virtual; + + property ViewInfo: TdxNavBarOverflowPanelViewInfo read GetViewInfo; + public + destructor Destroy; override; + + property SignIAccessibilityHelper: IdxNavBarAccessibilityHelper + read GetSignIAccessibilityHelper; + end; + + TdxNavBarNavigationPaneOverflowPanelItemAccessibilityHelper = class(TdxNavBarItemCollectionItemAccessibilityHelper) + private + function GetGroup: TdxNavBarGroup; + function GetViewInfo: TdxNavBarNavigationPaneViewInfo; + protected + function GetParent: TcxAccessibilityHelper; override; + function GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + procedure Click(AKey: Word); override; + function GetBounds: TRect; override; + function IsClickKey(AKey: Word): Boolean; override; + function IsContainer: Boolean; override; + + property Group: TdxNavBarGroup read GetGroup; + property ViewInfo: TdxNavBarNavigationPaneViewInfo read GetViewInfo; + end; + + TdxNavBarNavigationPaneOverflowPanelSignAccessibilityHelper = class(TdxNavBarCustomAccessibilityHelper) + private + function GetViewInfo: TdxNavBarNavigationPaneViewInfo; + protected + function GetParent: TcxAccessibilityHelper; override; + function GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + procedure Click(AKey: Word); override; + function GetBounds: TRect; override; + function IsClickKey(AKey: Word): Boolean; override; + function IsContainer: Boolean; override; + + property ViewInfo: TdxNavBarNavigationPaneViewInfo read GetViewInfo; + end; + + { TdxNavBarNavigationPaneActiveGroupCaptionPanelAccessibilityHelper } + + TdxNavBarNavigationPaneActiveGroupCaptionPanelAccessibilityHelper = class(TdxNavBarCustomAccessibilityHelper) + private + function GetGroupViewInfo: TdxNavBarGroupViewInfo; + function GetNavBar: TdxCustomNavBar; + function GetNavBarViewInfo: TdxNavBarNavigationPaneViewInfo; + protected + function GetParent: TcxAccessibilityHelper; override; + function GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + function CanBeFocusedByDefault: Boolean; override; + function GetAssociatedObject: TdxNavBarCustomAccessibilityHelper; override; + function GetBounds: TRect; override; + function IsContainer: Boolean; override; + + property NavBar: TdxCustomNavBar read GetNavBar; + property NavBarViewInfo: TdxNavBarNavigationPaneViewInfo read GetNavBarViewInfo; + property GroupViewInfo: TdxNavBarGroupViewInfo read GetGroupViewInfo; + end; + + { TdxNavBarNavigationPaneHeaderSignAccessibilityHelper } + + TdxNavBarNavigationPaneHeaderSignAccessibilityHelper = class(TdxNavBarCustomAccessibilityHelper) + private + function GetViewInfo: TdxNavBarNavigationPaneViewInfo; + protected + function GetParent: TcxAccessibilityHelper; override; + function GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + procedure Click(AKey: Word); override; + function GetBounds: TRect; override; + function IsClickKey(AKey: Word): Boolean; override; + function IsContainer: Boolean; override; + + property ViewInfo: TdxNavBarNavigationPaneViewInfo read GetViewInfo; + end; + + { TdxNavBarItemPanelAccessibilityHelper } + + TdxNavBarItemPanelAccessibilityHelper = class(TdxNavBarItemCollectionAccessibilityHelper) + private + FCollapseBarIAccessibilityHelper: IdxNavBarAccessibilityHelper; + function GetCollapseBarIAccessibilityHelper: IdxNavBarAccessibilityHelper; + function GetViewInfo: TdxNavBarItemPanelViewInfo; + protected + function GetChild(AIndex: Integer): TcxAccessibilityHelper; override; + function GetChildCount: Integer; override; + function GetParent: TcxAccessibilityHelper; override; + function GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + function GetActualItemCount: Integer; override; + function GetBounds: TRect; override; + function GetCollapseBarAccessibilityHelperClass: TdxNavBarCustomAccessibilityHelperClass; virtual; + function GetItemAccessibilityHelperClass: TdxNavBarItemCollectionItemAccessibilityHelperClass; override; + + property ViewInfo: TdxNavBarItemPanelViewInfo read GetViewInfo; + public + destructor Destroy; override; + + property CollapseBarIAccessibilityHelper: IdxNavBarAccessibilityHelper + read GetCollapseBarIAccessibilityHelper; + end; + + { TdxNavBarItemPanelCollapseBarAccessibilityHelper } + + TdxNavBarItemPanelCollapseBarAccessibilityHelper = class(TdxNavBarCustomAccessibilityHelper) + private + function GetViewInfo: TdxNavBarItemPanelViewInfo; + protected + function GetParent: TcxAccessibilityHelper; override; + function GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + function CanBeFocusedByDefault: Boolean; override; + procedure Click(AKey: Word); override; + function GetBounds: TRect; override; + function IsClickKey(AKey: Word): Boolean; override; + function IsContainer: Boolean; override; + + property ViewInfo: TdxNavBarItemPanelViewInfo read GetViewInfo; + end; + + { TdxNavBarItemPanelItemAccessibilityHelper } + + TdxNavBarItemPanelItemAccessibilityHelper = class(TdxNavBarItemCollectionItemAccessibilityHelper) + private + function GetViewInfo: TdxNavBarItemPanelViewInfo; + protected + function GetParent: TcxAccessibilityHelper; override; + function GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; override; + + function CanBeFocusedByDefault: Boolean; override; + procedure Click(AKey: Word); override; + function GetBounds: TRect; override; + function IsClickKey(AKey: Word): Boolean; override; + function IsContainer: Boolean; override; + + property ViewInfo: TdxNavBarItemPanelViewInfo read GetViewInfo; + end; + +implementation + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + SysUtils, CommCtrl, Math, + cxClasses, cxGeometry, cxLookAndFeels, dxOffice11, + dxNavBarConsts, dxNavBarGraphics, dxNavBarViewsFact, dxThemeManager, dxUxTheme, + dxNavBarAccessibility; + +type + TdxCustomNavBarAccess = class(TdxCustomNavBar); + TdxNavBarControllerAccess = class(TdxNavBarController); + TdxNavBarItemAccess = class(TdxNavBarItem); + TdxNavBarPainterAccess = class(TdxNavBarPainter); + +{ TdxNavBarOffice11LinkViewInfo } + +function TdxNavBarOffice11LinkViewInfo.FontColor: TColor; +begin + Result := Font.Color; + if Result = clNone then Result := dxOffice11LinkFontColor; +end; + +{ TdxNavBarOffice11GroupViewInfo } + +function TdxNavBarOffice11GroupViewInfo.BorderColor: TColor; +begin + if IsDefaultCaptionColor then + Result := dxOffice11GroupBorderColor + else Result := inherited BorderColor; +end; + +function TdxNavBarOffice11GroupViewInfo.BgAlphaBlend: Byte; +begin + if IsDefaultBgColor then + Result := 255 + else Result := inherited BgAlphaBlend; +end; + +function TdxNavBarOffice11GroupViewInfo.BgAlphaBlend2: Byte; +begin + if IsDefaultBgColor then + Result := 255 + else Result := inherited BgAlphaBlend2; +end; + +function TdxNavBarOffice11GroupViewInfo.BgBackColor: TColor; +begin + if IsDefaultBgColor then + Result := dxOffice11GroupBackgroundColor1 + else Result := inherited BgBackColor; +end; + +function TdxNavBarOffice11GroupViewInfo.BgBackColor2: TColor; +begin + if IsDefaultBgColor then + Result := dxOffice11GroupBackgroundColor2 + else Result := inherited BgBackColor2; +end; + +function TdxNavBarOffice11GroupViewInfo.BgGradientMode: TdxBarStyleGradientMode; +begin + if IsDefaultBgColor then + Result := gmVertical + else Result := inherited BgGradientMode; +end; + +function TdxNavBarOffice11GroupViewInfo.CaptionAlphaBlend: Byte; +begin + if IsDefaultCaptionColor then + Result := 255 + else Result := inherited CaptionAlphaBlend; +end; + +function TdxNavBarOffice11GroupViewInfo.CaptionAlphaBlend2: Byte; +begin + if IsDefaultCaptionColor then + Result := 255 + else Result := inherited CaptionAlphaBlend2; +end; + +function TdxNavBarOffice11GroupViewInfo.CaptionBackColor: TColor; +begin + if IsDefaultCaptionColor then + Result := dxOffice11GroupCaptionColor1 + else Result := inherited CaptionBackColor; +end; + +function TdxNavBarOffice11GroupViewInfo.CaptionBackColor2: TColor; +begin + if IsDefaultCaptionColor then + Result := dxOffice11GroupCaptionColor2 + else Result := inherited CaptionBackColor2; +end; + +function TdxNavBarOffice11GroupViewInfo.CaptionGradientMode: TdxBarStyleGradientMode; +begin + if IsDefaultCaptionColor then + Result := gmHorizontal + else Result := inherited CaptionGradientMode; +end; + +function TdxNavBarOffice11GroupViewInfo.CaptionFontColor: TColor; +begin + Result := CaptionFont.Color; + if Result = clNone then Result := dxOffice11GroupFontColor; +end; + +function TdxNavBarOffice11GroupViewInfo.IsDefaultBgColor: Boolean; +begin + Result := (inherited BgBackColor = clNone) or (inherited BgBackColor2 = clNone); +end; + +function TdxNavBarOffice11GroupViewInfo.IsDefaultCaptionColor: Boolean; +begin + Result := (inherited CaptionBackColor = clNone) or (inherited CaptionBackColor2 = clNone); +end; + +{ TdxNavBarOffice11ViewInfo } + +function TdxNavBarOffice11ViewInfo.BgAlphaBlend: Byte; +begin + if IsDefaultBgColor then + Result := 255 + else Result := inherited BgAlphaBlend; +end; + +function TdxNavBarOffice11ViewInfo.BgAlphaBlend2: Byte; +begin + if IsDefaultBgColor then + Result := 255 + else Result := inherited BgAlphaBlend2; +end; + +function TdxNavBarOffice11ViewInfo.BgBackColor: TColor; +begin + if IsDefaultBgColor then + Result := dxOffice11BackgroundColor1 + else Result := inherited BgBackColor; +end; + +function TdxNavBarOffice11ViewInfo.BgBackColor2: TColor; +begin + if IsDefaultBgColor then + Result := dxOffice11BackgroundColor2 + else Result := inherited BgBackColor2; +end; + +function TdxNavBarOffice11ViewInfo.BgGradientMode: TdxBarStyleGradientMode; +begin + if IsDefaultBgColor then + Result := gmVertical + else Result := inherited BgGradientMode; +end; + +procedure TdxNavBarOffice11ViewInfo.AssignDefaultBackgroundStyle; +begin + NavBar.DefaultStyles.Background.ResetValues; + NavBar.DefaultStyles.Background.BackColor := clNone; + NavBar.DefaultStyles.Background.BackColor2 := clNone; +end; + +procedure TdxNavBarOffice11ViewInfo.AssignDefaultGroupBackgroundStyle; +begin + NavBar.DefaultStyles.GroupBackground.ResetValues; + NavBar.DefaultStyles.GroupBackground.BackColor := clNone; + NavBar.DefaultStyles.GroupBackground.BackColor2 := clNone; +end; + +procedure TdxNavBarOffice11ViewInfo.AssignDefaultGroupHeaderStyle; +begin + NavBar.DefaultStyles.GroupHeader.ResetValues; + NavBar.DefaultStyles.GroupHeader.BackColor := clNone; + NavBar.DefaultStyles.GroupHeader.BackColor2 := clNone; + NavBar.DefaultStyles.GroupHeader.Font.Color := clNone; + NavBar.DefaultStyles.GroupHeader.Font.Size := 10; + NavBar.DefaultStyles.GroupHeader.Font.Style := [fsBold]; +end; + +procedure TdxNavBarOffice11ViewInfo.AssignDefaultGroupHeaderActiveStyle; +begin + NavBar.DefaultStyles.GroupHeaderActive.Assign(NavBar.DefaultStyles.GroupHeader); +end; + +procedure TdxNavBarOffice11ViewInfo.AssignDefaultItemStyle; +begin + NavBar.DefaultStyles.Item.ResetValues; + NavBar.DefaultStyles.Item.Font.Color := clNone; + NavBar.DefaultStyles.Item.HAlignment := haCenter; +end; + +procedure TdxNavBarOffice11ViewInfo.CreateColors; +begin + dxNavBarGraphics.CreateOffice11Colors; +end; + +procedure TdxNavBarOffice11ViewInfo.RefreshColors; +begin + dxNavBarGraphics.RefreshOffice11Colors; +end; + +procedure TdxNavBarOffice11ViewInfo.ReleaseColors; +begin + dxNavBarGraphics.ReleaseOffice11Colors; +end; + +function TdxNavBarOffice11ViewInfo.GetGroupEdges: TPoint; +begin + Result := cxPoint(10, 4); +end; + +function TdxNavBarOffice11ViewInfo.GetGroupSeparatorWidth: Integer; +begin + Result := 4; +end; + +function TdxNavBarOffice11ViewInfo.GetLinksImageEdges: TRect; +begin + Result := cxRect(4, 4, 4, 4); +end; + +function TdxNavBarOffice11ViewInfo.IsDefaultBgColor: Boolean; +begin + Result := (inherited BgBackColor = clNone) or (inherited BgBackColor2 = clNone) +end; + +{ TdxNavBarOffice11Painter } + +class function TdxNavBarOffice11Painter.SignPainterClass: TdxNavBarCustomSignPainterClass; +begin + Result := TdxNavBarOffice11SignPainter; +end; + +class function TdxNavBarOffice11Painter.GetViewInfoClass: TdxNavBarViewInfoClass; +begin + Result := TdxNavBarOffice11ViewInfo; +end; + +class function TdxNavBarOffice11Painter.GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; +begin + Result := TdxNavBarOffice11GroupViewInfo; +end; + +class function TdxNavBarOffice11Painter.GetLinkViewInfoClass: TdxNavBarLinkViewInfoClass; +begin + Result := TdxNavBarOffice11LinkViewInfo; +end; + +class function TdxNavBarOffice11Painter.ButtonPainterClass: TdxNavBarCustomButtonPainterClass; +begin + Result := TdxNavBarAdvExplorerButtonPainter; +end; + +{ TdxNavBarOffice11ExplorerBarGroupViewInfo } + +function TdxNavBarOffice11ExplorerBarGroupViewInfo.CaptionBorderColor: TColor; +begin + Result := dxOffice11NavPaneBorder; +end; + +function TdxNavBarOffice11ExplorerBarGroupViewInfo.CaptionBackColor: TColor; +begin + if not IsDefaultCaptionColor then + Result := inherited CaptionBackColor + else + Result := dxOffice11NavPaneGroupCaptionColor1; + exit; + if sActive in State then + begin + if sHotTracked in State then + Result := dxOffice11NavPaneGroupCaptionPressedHotColor1 + else + Result := dxOffice11NavPaneGroupCaptionPressedColor1; + end + else + if sHotTracked in State then + Result := dxOffice11NavPaneGroupCaptionHotColor1 + else + Result := dxOffice11NavPaneGroupCaptionColor1; +end; + +function TdxNavBarOffice11ExplorerBarGroupViewInfo.CaptionBackColor2: TColor; +begin + if not IsDefaultCaptionColor then + Result := inherited CaptionBackColor2 + else + Result := dxOffice11NavPaneGroupCaptionColor2; + Exit; + if sActive in State then + begin + if sHotTracked in State then + Result := dxOffice11NavPaneGroupCaptionPressedHotColor2 + else + Result := dxOffice11NavPaneGroupCaptionPressedColor2; + end + else + if sHotTracked in State then + Result := dxOffice11NavPaneGroupCaptionHotColor2 + else + Result := dxOffice11NavPaneGroupCaptionColor2; +end; + +function TdxNavBarOffice11ExplorerBarGroupViewInfo.CaptionAlphaBlend: Byte; +begin + if not IsDefaultCaptionColor then + Result := inherited CaptionAlphaBlend + else Result := 255; +end; + +function TdxNavBarOffice11ExplorerBarGroupViewInfo.CaptionAlphaBlend2: Byte; +begin + if not IsDefaultCaptionColor then + Result := inherited CaptionAlphaBlend2 + else Result := 255; +end; + +function TdxNavBarOffice11ExplorerBarGroupViewInfo.CaptionGradientMode: TdxBarStyleGradientMode; +begin + if not IsDefaultCaptionColor then + Result := inherited CaptionGradientMode + else Result := gmVertical; +end; + +function TdxNavBarOffice11ExplorerBarGroupViewInfo.IsDefaultCaptionColor: Boolean; +begin + Result := (inherited CaptionBackColor = clNone) or (inherited CaptionBackColor2 = clNone); +end; + +{ TdxNavBarOffice11ExplorerBarViewInfo } + +procedure TdxNavBarOffice11ExplorerBarViewInfo.AssignDefaultBackgroundStyle; +begin + NavBar.DefaultStyles.Background.ResetValues; + NavBar.DefaultStyles.Background.BackColor := clWindow; + NavBar.DefaultStyles.Background.BackColor2 := clWindow; +end; + +procedure TdxNavBarOffice11ExplorerBarViewInfo.AssignDefaultButtonStyle; +begin + NavBar.DefaultStyles.Button.ResetValues; + NavBar.DefaultStyles.Button.BackColor := clNone; + NavBar.DefaultStyles.Button.BackColor2 := clNone; +end; + +procedure TdxNavBarOffice11ExplorerBarViewInfo.AssignDefaultGroupBackgroundStyle; +begin + NavBar.DefaultStyles.GroupBackground.ResetValues; + NavBar.DefaultStyles.GroupBackground.BackColor := clWindow; + NavBar.DefaultStyles.GroupBackground.BackColor2 := clWindow; +end; + +procedure TdxNavBarOffice11ExplorerBarViewInfo.AssignDefaultGroupHeaderStyle; +begin + NavBar.DefaultStyles.GroupHeader.ResetValues; + NavBar.DefaultStyles.GroupHeader.BackColor := clNone; + NavBar.DefaultStyles.GroupHeader.BackColor2 := clNone; + NavBar.DefaultStyles.GroupHeader.Font.Style := [fsBold]; +end; + +procedure TdxNavBarOffice11ExplorerBarViewInfo.AssignDefaultItemStyle; +begin + NavBar.DefaultStyles.Item.ResetValues; + NavBar.DefaultStyles.Item.Font.Color := clWindowText; + NavBar.DefaultStyles.Item.HAlignment := haCenter; +end; + +procedure TdxNavBarOffice11ExplorerBarViewInfo.AssignDefaultItemDisabledStyle; +begin + NavBar.DefaultStyles.ItemDisabled.Assign(NavBar.DefaultStyles.Item); + NavBar.DefaultStyles.ItemDisabled.Font.Color := clGrayText; +end; + +procedure TdxNavBarOffice11ExplorerBarViewInfo.AssignDefaultNavigationPaneHeaderStyle; +begin + NavBar.DefaultStyles.NavigationPaneHeader.ResetValues; + NavBar.DefaultStyles.NavigationPaneHeader.BackColor := clNone; + NavBar.DefaultStyles.NavigationPaneHeader.BackColor2 := clNone; + NavBar.DefaultStyles.NavigationPaneHeader.Font.Color := clNone; + NavBar.DefaultStyles.NavigationPaneHeader.Font.Name := 'Arial'; + NavBar.DefaultStyles.NavigationPaneHeader.Font.Size := 11; + NavBar.DefaultStyles.NavigationPaneHeader.Font.Style := [fsBold]; +end; + +procedure TdxNavBarOffice11ExplorerBarViewInfo.CreateColors; +begin + CreateOffice11NavPaneColors; +end; + +procedure TdxNavBarOffice11ExplorerBarViewInfo.RefreshColors; +begin + RefreshOffice11NavPaneColors; +end; + +procedure TdxNavBarOffice11ExplorerBarViewInfo.ReleaseColors; +begin + ReleaseOffice11NavPaneColors; +end; + +function TdxNavBarOffice11ExplorerBarViewInfo.CanSelectLinkByRect: Boolean; +begin + Result := True; +end; + +function TdxNavBarOffice11ExplorerBarViewInfo.GetGroupBorderOffsets: TRect; +begin + Result := cxNullRect; +end; + +function TdxNavBarOffice11ExplorerBarViewInfo.GetGroupCaptionHeightAddon: Integer; +begin + Result := 6; +end; + +class function TdxNavBarOffice11ExplorerBarViewInfo.GetGroupCaptionImageIndent: Integer; +begin + Result := 2; +end; + +function TdxNavBarOffice11ExplorerBarViewInfo.GetGroupEdges: TPoint; +begin + Result := cxPoint(0, 0); +end; + +function TdxNavBarOffice11ExplorerBarViewInfo.GetGroupSeparatorWidth: Integer; +begin + Result := 0; +end; + +{ TdxNavBarOffice11ExplorerBarController } + +procedure TdxNavBarOffice11ExplorerBarController.DoMouseDown(AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); +begin + if MouseOverSizeGrip then + TdxNavBarGroupControl(FNavBar.Parent).BeginResize(FNavBar, AButton, AShift, APoint) + else + inherited; +end; + +procedure TdxNavBarOffice11ExplorerBarController.DoMouseMove(AShift: TShiftState; const APoint: TPoint); +begin + MouseOverSizeGrip := (FNavBar.Parent is TdxNavBarGroupControl) and + TdxNavBarGroupControl(FNavBar.Parent).IsOnPopupControl and + not (FNavBar.IsPtBottomScrollButton(APoint) or FNavBar.IsPtTopScrollButton(APoint)) and + cxRectPtIn(TdxNavBarGroupControl(FNavBar.Parent).GetSizeGripRect(FNavBar), APoint); + if not MouseOverSizeGrip then + inherited; +end; + +function TdxNavBarOffice11ExplorerBarController.GetCursor: HIcon; +begin + if MouseOverSizeGrip then + Result := Screen.Cursors[crSizeWE] + else + Result := inherited GetCursor; +end; + +function TdxNavBarOffice11ExplorerBarController.GetMouseOverSizeGrip: Boolean; +begin + Result := ecsOverSizeGrip in FInternalState; +end; + +procedure TdxNavBarOffice11ExplorerBarController.SetMouseOverSizeGrip(AValue: Boolean); +begin + if MouseOverSizeGrip <> AValue then + if AValue then + Include(FInternalState, ecsOverSizeGrip) + else + Exclude(FInternalState, ecsOverSizeGrip); +end; + +{ TdxNavBarOffice11ExplorerBarPainter } + +procedure TdxNavBarOffice11ExplorerBarPainter.DrawNavBarControl; +begin + inherited; + if (NavBar.Parent is TdxNavBarGroupControl) and + TdxNavBarGroupControl(NavBar.Parent).IsOnPopupControl then + TdxNavBarGroupControl(NavBar.Parent).DrawSizeGrip(Canvas, TdxNavBarGroupControl(NavBar.Parent).GetSizeGripRect(NavBar)); +end; + +procedure TdxNavBarOffice11ExplorerBarPainter.DrawGroupControlSplitter(AGroupViewInfo: TdxNavBarExplorerBarGroupViewInfo); +var + APoint: TPoint; +begin + with AGroupViewInfo do + ButtonPainterClass.DrawButton(Canvas, SplitterRect, CaptionImage, + CaptionBackColor, CaptionBackColor2, CaptionAlphaBlend, CaptionAlphaBlend2, + CaptionGradientMode, CaptionBorderColor, State); + if dxOffice11NavPaneSplitterBitmap <> nil then + begin + APoint := cxRectCenter(AGroupViewInfo.SplitterRect, dxOffice11NavPaneSplitterBitmap.Width, dxOffice11NavPaneSplitterBitmap.Height).TopLeft; + if APoint.X > AGroupViewInfo.SplitterRect.Left then + Canvas.Draw(APoint.X, APoint.Y, dxOffice11NavPaneSplitterBitmap); + end; +end; + +class function TdxNavBarOffice11ExplorerBarPainter.GetViewInfoClass: TdxNavBarViewInfoClass; +begin + Result := TdxNavBarOffice11ExplorerBarViewInfo; +end; + +class function TdxNavBarOffice11ExplorerBarPainter.GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; +begin + Result := TdxNavBarOffice11ExplorerBarGroupViewInfo; +end; + +function TdxNavBarOffice11ExplorerBarPainter.GetControllerClass: TdxNavBarControllerClass; +begin + Result := TdxNavBarOffice11ExplorerBarController; +end; + +class function TdxNavBarOffice11ExplorerBarPainter.SignPainterClass: TdxNavBarCustomSignPainterClass; +begin + Result := TdxNavBarOffice11ExplorerBarSignPainter; +end; + +{ TdxNavBarOffice11ExplorerBarSignPainter } + +class procedure TdxNavBarOffice11ExplorerBarSignPainter.DrawSignSelection(ACanvas: TCanvas; ARect: TRect; AForeColor, + ABackColor1, ABackColor2: TColor; AState: TdxNavBarObjectStates); +begin +end; + +{ TdxNavBarNavigationPane } + +function TdxNavBarNavigationPaneGroupViewInfo.CaptionBorderColor: TColor; +begin + Result := dxOffice11NavPaneBorder; +end; + +function TdxNavBarNavigationPaneGroupViewInfo.CaptionBackColor: TColor; +begin + if not IsDefaultCaptionColor then + Result := inherited CaptionBackColor + else + if sActive in State then + begin + if sHotTracked in State then + Result := dxOffice11NavPaneGroupCaptionPressedHotColor1 + else + Result := dxOffice11NavPaneGroupCaptionPressedColor1; + end + else + if sHotTracked in State then + Result := dxOffice11NavPaneGroupCaptionHotColor1 + else + Result := dxOffice11NavPaneGroupCaptionColor1; +end; + +function TdxNavBarNavigationPaneGroupViewInfo.CaptionBackColor2: TColor; +begin + if not IsDefaultCaptionColor then + Result := inherited CaptionBackColor2 + else + if sActive in State then + begin + if sHotTracked in State then + Result := dxOffice11NavPaneGroupCaptionPressedHotColor2 + else + Result := dxOffice11NavPaneGroupCaptionPressedColor2; + end + else + if sHotTracked in State then + Result := dxOffice11NavPaneGroupCaptionHotColor2 + else + Result := dxOffice11NavPaneGroupCaptionColor2; +end; + +function TdxNavBarNavigationPaneGroupViewInfo.CaptionAlphaBlend: Byte; +begin + if not IsDefaultCaptionColor then + Result := inherited CaptionAlphaBlend + else Result := 255; +end; + +function TdxNavBarNavigationPaneGroupViewInfo.CaptionAlphaBlend2: Byte; +begin + if not IsDefaultCaptionColor then + Result := inherited CaptionAlphaBlend2 + else Result := 255; +end; + +function TdxNavBarNavigationPaneGroupViewInfo.CaptionGradientMode: TdxBarStyleGradientMode; +begin + if not IsDefaultCaptionColor then + Result := inherited CaptionGradientMode + else Result := gmVertical; +end; + +function TdxNavBarNavigationPaneGroupViewInfo.IsDefaultCaptionColor: Boolean; +begin + Result := (inherited CaptionBackColor = clNone) or (inherited CaptionBackColor2 = clNone); +end; + +{ TdxNavBarNavigationPaneCustomViewInfo } + +constructor TdxNavBarNavigationPaneCustomViewInfo.Create(AViewInfo: TdxNavBarViewInfo); +begin + inherited Create; + FViewInfo := AViewInfo; + FPainter := FViewInfo.Painter; + FNavBar := FViewInfo.NavBar; +end; + +function TdxNavBarNavigationPaneCustomViewInfo.GetViewInfo: TdxNavBarNavigationPaneViewInfo; +begin + Result := TdxNavBarNavigationPaneViewInfo(FViewInfo); +end; + +function TdxNavBarNavigationPaneCustomViewInfo.GetPainter: TdxNavBarNavigationPanePainter; +begin + Result := TdxNavBarNavigationPanePainter(inherited Painter); +end; + +{ TdxNavBarOverflowPanelViewInfo } + +constructor TdxNavBarOverflowPanelViewInfo.Create(AViewInfo: TdxNavBarViewInfo); +begin + inherited; + FItems := TObjectList.Create; +end; + +destructor TdxNavBarOverflowPanelViewInfo.Destroy; +begin + ClearItems; + FreeAndNil(FItems); + NavBarAccessibleObjectOwnerObjectDestroyed(FIAccessibilityHelper); + inherited; +end; + +function TdxNavBarOverflowPanelViewInfo.GetAccessibilityHelperClass: TdxNavBarCustomAccessibilityHelperClass; +begin + Result := TdxNavBarNavigationPaneOverflowPanelAccessibilityHelper; +end; + +procedure TdxNavBarOverflowPanelViewInfo.CalculateBounds(X, Y: Integer); + + procedure CalculateItemRects(const AItemsRect: TRect); + var + I, AStartPos, ASelectionWidth: Integer; + APlaceCount: Integer; + ASelectionRect, AItemRect: TRect; + begin + ASelectionWidth := GetItemSelectionWidth; + APlaceCount := cxRectWidth(AItemsRect) div ASelectionWidth; + FVisibleItemCount := Min(APlaceCount, ItemCount); + + AStartPos := AItemsRect.Right - FVisibleItemCount * ASelectionWidth; + + ASelectionRect := cxRect(0, 0, ASelectionWidth, cxRectHeight(AItemsRect)); + OffsetRect(ASelectionRect, AStartPos, AItemsRect.Top); + + AItemRect := cxRect(0, 0, ASelectionWidth, GetImageHeight); + OffsetRect(AItemRect, AStartPos, AItemsRect.Top + + (cxRectHeight(AItemsRect) - GetImageHeight) div 2); + InflateRect(AItemRect, -GetImageWidthAddon, 0); + + for I := 0 to FVisibleItemCount - 1 do + begin + Items[I].SelectionRect := ASelectionRect; + OffsetRect(Items[I].SelectionRect, ASelectionWidth * I, 0); + Items[I].Rect := AItemRect; + OffsetRect(Items[I].Rect, ASelectionWidth * I, 0); + end; + end; + +var + AClientRect, AItemsRect: TRect; +begin + if not IsVisible then + Exit; + + FRect := Bounds(X, Y, ViewInfo.ClientWidth - 2*X, GetHeight); + + AClientRect := cxRectContent(FRect, GetClientOffset); + FSignRect := AClientRect; + FSignRect.Left := FSignRect.Right - GetSignWidth; + + if ViewInfo.Painter.Controller.Collapsed then + AItemsRect := cxNullRect + else + begin + AItemsRect := AClientRect; + AItemsRect.Right := FSignRect.Left - GetSeparator; + end; + CalculateItemRects(AItemsRect); +end; + +function TdxNavBarOverflowPanelViewInfo.IsVisible: Boolean; +begin + Result := NavBar.OptionsView.NavigationPane.ShowOverflowPanel; +end; + +function TdxNavBarOverflowPanelViewInfo.GetHeight: Integer; + + function GetHeight: Integer; + begin + Result := GetImageHeight; + if ViewInfo.FImageHeightPeer then + Result := Max(ViewInfo.FMaxImageSize.cy, Result) + end; + +begin + if not IsVisible then + Result := 0 + else + Result := GetHeight + GetHeightAddon; +end; + +function TdxNavBarOverflowPanelViewInfo.GetImageHeight: Integer; +begin + if NavBar.NavigationPaneOverflowPanelUseSmallImages then + Result := ViewInfo.GetSmallImageHeight + else + Result := ViewInfo.GetLargeImageHeight; +end; + +function TdxNavBarOverflowPanelViewInfo.GetImageWidth: Integer; +begin + if NavBar.NavigationPaneOverflowPanelUseSmallImages then + Result := ViewInfo.GetSmallImageWidth + else + Result := ViewInfo.GetLargeImageWidth; +end; + +function TdxNavBarOverflowPanelViewInfo.GetImageList: TCustomImageList; +begin + if NavBar.NavigationPaneOverflowPanelUseSmallImages then + Result := NavBar.SmallImages + else + Result := NavBar.LargeImages; +end; + +function TdxNavBarOverflowPanelViewInfo.GetImageIndex(AGroup: TdxNavBarGroup): Integer; +begin + if NavBar.NavigationPaneOverflowPanelUseSmallImages then + Result := AGroup.SmallImageIndex + else + Result := AGroup.LargeImageIndex; +end; + +function TdxNavBarOverflowPanelViewInfo.GetItemIndexAtPos(const pt: TPoint): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to FVisibleItemCount - 1 do + if PtInRect(Items[I].SelectionRect, pt) then + begin + Result := I; + Break; + end; +end; + +function TdxNavBarOverflowPanelViewInfo.GetItemSelectionWidth: Integer; +begin + Result := GetImageWidth + 2 * GetImageWidthAddon; +end; + +function TdxNavBarOverflowPanelViewInfo.GetGroupAtPos(const pt: TPoint): TdxNavBarGroup; +var + AIndex: Integer; +begin + AIndex := GetItemIndexAtPos(pt); + if AIndex >= 0 then + begin + Result := Items[AIndex].Group; + if (Result <> nil) and (csDestroying in Result.ComponentState) then + Result := nil; + end + else + Result := nil; +end; + +function TdxNavBarOverflowPanelViewInfo.GetHeightAddon: Integer; +begin + Result := 8; +end; + +function TdxNavBarOverflowPanelViewInfo.GetImageWidthAddon: Integer; +begin + Result := 3; +end; + +function TdxNavBarOverflowPanelViewInfo.GetPopupMenuImageIndent: Integer; +begin + Result := 3; +end; + +function TdxNavBarOverflowPanelViewInfo.GetPopupMenuTextIndent: Integer; +begin + Result := 4; +end; + +function TdxNavBarOverflowPanelViewInfo.GetSignWidth: Integer; +begin + Result := 18; +end; + +function TdxNavBarOverflowPanelViewInfo.GetSeparator: Integer; +begin + Result := 0; +end; + +function TdxNavBarOverflowPanelViewInfo.GetClientOffset: TRect; +begin + Result := cxNullRect; + Result := cxRectOffset(Result, 0, ViewInfo.BorderWidth); +end; + +procedure TdxNavBarOverflowPanelViewInfo.ClearRects; +begin + SetRectEmpty(FRect); + SetRectEmpty(FSignRect); +end; + +procedure TdxNavBarOverflowPanelViewInfo.ClearItems; +begin + FVisibleItemCount := 0; + FItems.Clear; +end; + +procedure TdxNavBarOverflowPanelViewInfo.OffsetElements(AHeightDifference: Integer); +var + I: Integer; +begin + if not IsVisible then + Exit; + OffsetRect(FRect, 0, AHeightDifference); + OffsetRect(FSignRect, 0, AHeightDifference); + for I := 0 to FVisibleItemCount - 1 do + begin + OffsetRect(Items[I].Rect, 0, AHeightDifference); + OffsetRect(Items[I].SelectionRect, 0, AHeightDifference); + end; +end; + +function TdxNavBarOverflowPanelViewInfo.GetIAccessibilityHelper: IdxNavBarAccessibilityHelper; +begin + if FIAccessibilityHelper = nil then + FIAccessibilityHelper := NavBarGetAccessibilityHelper( + GetAccessibilityHelperClass.Create(Self, NavBar)); + Result := FIAccessibilityHelper; +end; + +function TdxNavBarOverflowPanelViewInfo.AddItem: TdxNavBarOverflowPanelViewInfoItem; +begin + Result := TdxNavBarOverflowPanelViewInfoItem.Create; + FItems.Insert(0, Result); +end; + +function TdxNavBarOverflowPanelViewInfo.GetItemCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxNavBarOverflowPanelViewInfo.GetItems(AIndex: Integer): TdxNavBarOverflowPanelViewInfoItem; +begin + Result := TdxNavBarOverflowPanelViewInfoItem(FItems[AIndex]); +end; + +{ TdxNavBarItemPanelViewInfoItem } + +procedure TdxNavBarItemPanelViewInfoItem.OffsetRects(dX, dY: Integer); +begin + Rect := cxRectOffset(Rect, dX, dY); + TextRect := cxRectOffset(TextRect, dX, dY); + ImageRect := cxRectOffset(ImageRect, dX, dY); +end; + +function TdxNavBarItemPanelViewInfoItem.GetCaption: string; +begin + Result := ItemLink.Item.Caption; +end; + +{ TdxNavBarItemPanelViewInfo } + +constructor TdxNavBarItemPanelViewInfo.Create(AViewInfo: TdxNavBarViewInfo); +begin + inherited; + FItems := TObjectList.Create; + NavBar.IAccessibilityHelper.AttachChild(IAccessibilityHelper); +end; + +destructor TdxNavBarItemPanelViewInfo.Destroy; +begin + if not (csDestroying in NavBar.ComponentState) then + NavBar.IAccessibilityHelper.DetachChild(IAccessibilityHelper); + NavBarAccessibleObjectOwnerObjectDestroyed(FIAccessibilityHelper); + FreeAndNil(FItems); + inherited; +end; + +function TdxNavBarItemPanelViewInfo.GetMinHeight: Integer; +begin + if FIsCollapseMode then + Result := cxTextWidth(CollapseBarFont, CollapseBarText) + GetCollapseBarCaptionIndent * 2 + else + Result := ViewInfo.GetActiveGroupMinHeight; +end; + +procedure TdxNavBarItemPanelViewInfo.CalculateBounds(var X, Y: Integer); + + procedure CalculateItemRects(ARect: TRect); + var + I: Integer; + AItem: TdxNavBarItemPanelViewInfoItem; + ATextWidth, AIndent: Integer; + AImageSize: TSize; + begin + for I := 0 to ItemCount - 1 do + begin + AItem := Items[I]; + AIndent := ViewInfo.GetGroupCaptionImageIndent; + ATextWidth := cxTextWidth(AItem.Font, AItem.Caption); + AItem.TextRect := cxRect(ARect.Left, ARect.Bottom, ARect.Right, ARect.Bottom + ATextWidth + AIndent * 2); + + if IsImageAssigned(AItem.ImageList, AItem.ImageIndex) then + AImageSize := Size(ViewInfo.GetSmallImageWidth, ViewInfo.GetSmallImageHeight) + else + AImageSize := cxNullSize; + AItem.ImageRect := cxRectCenter(cxRect(ARect.Left, AItem.TextRect.Bottom, ARect.Right, AItem.TextRect.Bottom + AImageSize.cy), AImageSize); + + AItem.Rect := cxRect(ARect.Left, AItem.TextRect.Top, ARect.Right, AItem.ImageRect.Bottom); + if IsImageAssigned(AItem.ImageList, AItem.ImageIndex) then + AItem.Rect.Bottom := AItem.Rect.Bottom + AIndent; + + ARect.Bottom := AItem.Rect.Bottom; + end; + end; + +begin + if (FActiveGroupViewInfo <> nil) and not FIsCollapseMode then + begin + FActiveGroupViewInfo.CalculateBounds(X, Y); + FRect := FActiveGroupViewInfo.Rect; + end + else + begin + FRect := Bounds(X, Y, ViewInfo.ClientWidth - 2*X, GetMinHeight); + Y := FRect.Bottom; + end; + if FIsCollapseMode then + begin + FCollapseBarRect := FRect; + CalculateItemRects(FCollapseBarRect); + end + else + FCollapseBarRect := cxNullRect; +end; + +procedure TdxNavBarItemPanelViewInfo.CorrectBounds(AHeightDifference: Integer); +var + I, ALastVisibleIndex: Integer; +begin + FRect.Bottom := FRect.Bottom + AHeightDifference; + if (FActiveGroupViewInfo <> nil) and not FIsCollapseMode then + FActiveGroupViewInfo.CorrectActiveGroupBounds(0, AHeightDifference); + if FIsCollapseMode then + begin + ALastVisibleIndex := -1; + for I := 0 to ItemCount - 1 do + begin + if cxRectHeight(Items[I].Rect) <= AHeightDifference then + begin + AHeightDifference := AHeightDifference - cxRectHeight(Items[I].Rect); + ALastVisibleIndex := I; + end + else + Break; + end; + for I := ItemCount - 1 downto ALastVisibleIndex + 1 do + FItems.Delete(I); + FCollapseBarRect.Bottom := FCollapseBarRect.Bottom + AHeightDifference; + for I := 0 to ItemCount - 1 do + Items[I].OffsetRects(0, AHeightDifference); + (IAccessibilityHelper.GetHelper as TdxNavBarItemPanelAccessibilityHelper).CheckItemIAccessibilityHelperCount; + end; +end; + +function TdxNavBarItemPanelViewInfo.GetCollapseBarFont: TFont; +begin + Result := ViewInfo.HeaderFont; +end; + +function TdxNavBarItemPanelViewInfo.GetCollapseBarText: string; +begin + Result := cxGetResourceString(@sdxNavigationPaneCollapseBar); +end; + +function TdxNavBarItemPanelViewInfo.GetItemFont(AIndex: Integer): TFont; +begin + Result := NavBar.DefaultStyles.Item.Font; +end; + +function TdxNavBarItemPanelViewInfo.GetItemIndexAtPos(const pt: TPoint): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to ItemCount - 1 do + if PtInRect(Items[I].Rect, pt) then + begin + Result := I; + Break; + end; +end; + +function TdxNavBarItemPanelViewInfo.GetCollapseBarCaptionIndent: Integer; +begin + Result := GetRevisedValue(4); +end; + +function TdxNavBarItemPanelViewInfo.GetAccessibilityHelperClass: TdxNavBarCustomAccessibilityHelperClass; +begin + Result := TdxNavBarItemPanelAccessibilityHelper; +end; + +function TdxNavBarItemPanelViewInfo.GetCollapseBarIAccessibilityHelper: IdxNavBarAccessibilityHelper; +begin + Result := (IAccessibilityHelper.GetHelper as TdxNavBarItemPanelAccessibilityHelper).CollapseBarIAccessibilityHelper; +end; + +function TdxNavBarItemPanelViewInfo.GetIAccessibilityHelper: IdxNavBarAccessibilityHelper; +begin + if FIAccessibilityHelper = nil then + FIAccessibilityHelper := NavBarGetAccessibilityHelper( + GetAccessibilityHelperClass.Create(Self, NavBar)); + Result := FIAccessibilityHelper; +end; + +function TdxNavBarItemPanelViewInfo.GetItemCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxNavBarItemPanelViewInfo.GetItemIAccessibilityHelper( + AIndex: Integer): IdxNavBarAccessibilityHelper; +begin + Result := (IAccessibilityHelper.GetHelper as TdxNavBarItemPanelAccessibilityHelper).ItemIAccessibilityHelpers[AIndex]; +end; + +function TdxNavBarItemPanelViewInfo.GetItems(AIndex: Integer): TdxNavBarItemPanelViewInfoItem; +begin + Result := TdxNavBarItemPanelViewInfoItem(FItems[AIndex]); +end; + +procedure TdxNavBarItemPanelViewInfo.SetActiveGroupViewInfo(AValue: TdxNavBarGroupViewInfo); +begin + FActiveGroupViewInfo := AValue; +end; + +function TdxNavBarItemPanelViewInfo.AddItem: TdxNavBarItemPanelViewInfoItem; +begin + Result := TdxNavBarItemPanelViewInfoItem.Create; + Result.Index := FItems.Add(Result); +end; + +procedure TdxNavBarItemPanelViewInfo.ClearItems; +begin + FItems.Clear; +end; + +procedure TdxNavBarItemPanelViewInfo.CreateItems; +var + I: Integer; + APanelItem: TdxNavBarItemPanelViewInfoItem; + ALink: TdxNavBarItemLink; +begin + ClearItems; + if FIsCollapseMode and (FCollapseBarGroup <> nil) then + begin + for I := 0 to FCollapseBarGroup.LinkCount - 1 do + begin + ALink := FCollapseBarGroup.Links[I]; + if ALink.CanSelect and ALink.Item.Visible then + begin + APanelItem := AddItem; + APanelItem.ItemLink := ALink; + APanelItem.Font := GetItemFont(I); + APanelItem.ImageList := NavBar.SmallImages; + APanelItem.ImageIndex := APanelItem.ItemLink.Item.SmallImageIndex; + end; + end; + end; +end; + +{ TdxNavBarOffice11NavPanelViewInfo } + +constructor TdxNavBarNavigationPaneViewInfo.Create(APainter: TdxNavBarPainter); +begin + inherited; + FOverflowPanelViewInfo := GetOverflowPanelViewInfoClass.Create(Self); + FItemPanelViewInfo := TdxNavBarItemPanelViewInfo.Create(Self); + FImageList := TImageList.Create(NavBar); + FPopupMenu := TPopupMenu.Create(NavBar); + APainter.NavBar.IAccessibilityHelper.AttachChild( + ActiveGroupCaptionPanelIAccessibilityHelper); + APainter.NavBar.IAccessibilityHelper.AttachChild( + HeaderSignIAccessibilityHelper); + APainter.NavBar.IAccessibilityHelper.AttachChild( + OverflowPanelIAccessibilityHelper); +end; + +destructor TdxNavBarNavigationPaneViewInfo.Destroy; +begin + if not (csDestroying in NavBar.ComponentState) then + begin + NavBar.IAccessibilityHelper.DetachChild(ActiveGroupCaptionPanelIAccessibilityHelper); + NavBar.IAccessibilityHelper.DetachChild(HeaderSignIAccessibilityHelper); + NavBar.IAccessibilityHelper.DetachChild(OverflowPanelIAccessibilityHelper); + end; + NavBarAccessibleObjectOwnerObjectDestroyed(FActiveGroupCaptionPanelIAccessibilityHelper); + NavBarAccessibleObjectOwnerObjectDestroyed(FHeaderSignIAccessibilityHelper); + FPopupMenu.Free; + FImageList.Free; + FreeAndnil(FItemPanelViewInfo); + FreeAndnil(FOverflowPanelViewInfo); + inherited; +end; + +function TdxNavBarNavigationPaneViewInfo.FindGroupWithAccel(AKey: Word): TdxNavBarGroup; +var + AIndex: Integer; + AGroup: TdxNavBarGroup; +begin + Result := inherited FindGroupWithAccel(AKey); + if (Result = nil) and (FOverflowPanelViewInfo.IsVisible) and not Painter.Controller.Collapsed then + for AIndex := 0 to FOverflowPanelViewInfo.ItemCount - 1 do + begin + AGroup := FOverflowPanelViewInfo.Items[AIndex].Group; + if IsAccel(AKey, AGroup.Caption) then + begin + Result := AGroup; + Break; + end + end; +end; + +function TdxNavBarNavigationPaneViewInfo.FindLinkWithAccel(AKey: Word): TdxNavBarItemLink; +var + AIndex: Integer; + AItemPanelViewInfoItem: TdxNavBarItemPanelViewInfoItem; +begin + Result := inherited FindLinkWithAccel(AKey); + if Result = nil then + for AIndex := 0 to FItemPanelViewInfo.ItemCount - 1 do + begin + AItemPanelViewInfoItem := FItemPanelViewInfo.Items[AIndex]; + if IsAccel(AKey, AItemPanelViewInfoItem.Caption) then + begin + Result := AItemPanelViewInfoItem.ItemLink; + Break; + end + end; +end; + +function TdxNavBarNavigationPaneViewInfo.BorderWidth: Integer; +begin + Result := 1; +end; + +function TdxNavBarNavigationPaneViewInfo.BorderColor: TColor; +begin + Result := dxOffice11NavPaneBorder; +end; + +function TdxNavBarNavigationPaneViewInfo.CollapseBarFontColor: TColor; +begin + Result := BorderColor; +end; + +function TdxNavBarNavigationPaneViewInfo.BottomScrollButtonBackColor: TColor; +begin + if not IsDefaultBottomScrollButtonColor then + Result := inherited BottomScrollButtonBackColor + else if sPressed in BottomScrollButtonState then + Result := dxOffice11NavPaneGroupCaptionPressedColor1 + else if sActive in BottomScrollButtonState then + Result := dxOffice11NavPaneGroupCaptionPressedColor2 + else if sHotTracked in BottomScrollButtonState then + Result := dxOffice11NavPaneGroupCaptionHotColor1 + else Result := dxOffice11NavPaneGroupCaptionColor1; +end; + +function TdxNavBarNavigationPaneViewInfo.BottomScrollButtonBackColor2: TColor; +begin + if not IsDefaultBottomScrollButtonColor then + Result := inherited BottomScrollButtonBackColor2 + else if sPressed in BottomScrollButtonState then + Result := dxOffice11NavPaneGroupCaptionPressedColor2 + else if sActive in BottomScrollButtonState then + Result := dxOffice11NavPaneGroupCaptionPressedColor1 + else if sHotTracked in BottomScrollButtonState then + Result := dxOffice11NavPaneGroupCaptionHotColor2 + else Result := dxOffice11NavPaneGroupCaptionColor2; +end; + +function TdxNavBarNavigationPaneViewInfo.BottomScrollButtonAlphaBlend: Byte; +begin + if not IsDefaultBottomScrollButtonColor then + Result := inherited BottomScrollButtonAlphaBlend + else Result := 255; +end; + +function TdxNavBarNavigationPaneViewInfo.BottomScrollButtonAlphaBlend2: Byte; +begin + if not IsDefaultBottomScrollButtonColor then + Result := inherited BottomScrollButtonAlphaBlend2 + else Result := 255; +end; + +function TdxNavBarNavigationPaneViewInfo.BottomScrollButtonGradientMode: TdxBarStyleGradientMode; +begin + if not IsDefaultBottomScrollButtonColor then + Result := inherited BottomScrollButtonGradientMode + else Result := gmVertical; +end; + +function TdxNavBarNavigationPaneViewInfo.TopScrollButtonBackColor: TColor; +begin + if not IsDefaultTopScrollButtonColor then + Result := inherited TopScrollButtonBackColor + else if sPressed in TopScrollButtonState then + Result := dxOffice11NavPaneGroupCaptionPressedColor1 + else if sActive in TopScrollButtonState then + Result := dxOffice11NavPaneGroupCaptionPressedColor2 + else if sHotTracked in TopScrollButtonState then + Result := dxOffice11NavPaneGroupCaptionHotColor1 + else Result := dxOffice11NavPaneGroupCaptionColor1; +end; + +function TdxNavBarNavigationPaneViewInfo.TopScrollButtonBackColor2: TColor; +begin + if not IsDefaultTopScrollButtonColor then + Result := inherited TopScrollButtonBackColor2 + else if sPressed in TopScrollButtonState then + Result := dxOffice11NavPaneGroupCaptionPressedColor2 + else if sActive in TopScrollButtonState then + Result := dxOffice11NavPaneGroupCaptionPressedColor1 + else if sHotTracked in TopScrollButtonState then + Result := dxOffice11NavPaneGroupCaptionHotColor2 + else Result := dxOffice11NavPaneGroupCaptionColor2; +end; + +function TdxNavBarNavigationPaneViewInfo.TopScrollButtonAlphaBlend: Byte; +begin + if not IsDefaultTopScrollButtonColor then + Result := inherited TopScrollButtonAlphaBlend + else Result := 255; +end; + +function TdxNavBarNavigationPaneViewInfo.TopScrollButtonAlphaBlend2: Byte; +begin + if not IsDefaultTopScrollButtonColor then + Result := inherited TopScrollButtonAlphaBlend2 + else Result := 255; +end; + +function TdxNavBarNavigationPaneViewInfo.TopScrollButtonGradientMode: TdxBarStyleGradientMode; +begin + if not IsDefaultTopScrollButtonColor then + Result := inherited TopScrollButtonGradientMode + else Result := gmVertical; +end; + +function TdxNavBarNavigationPaneViewInfo.HeaderBackColor: TColor; +begin + if not IsDefaultHeaderColor then + Result := inherited HeaderBackColor + else Result := dxOffice11NavPaneHeaderColor1; +end; + +function TdxNavBarNavigationPaneViewInfo.HeaderBackColor2: TColor; +begin + if not IsDefaultHeaderColor then + Result := inherited HeaderBackColor2 + else Result := dxOffice11NavPaneHeaderColor2; +end; + +function TdxNavBarNavigationPaneViewInfo.HeaderAlphaBlend: Byte; +begin + if not IsDefaultHeaderColor then + Result := inherited HeaderAlphaBlend + else Result := 255; +end; + +function TdxNavBarNavigationPaneViewInfo.HeaderAlphaBlend2: Byte; +begin + if not IsDefaultHeaderColor then + Result := inherited HeaderAlphaBlend2 + else Result := 255; +end; + +function TdxNavBarNavigationPaneViewInfo.HeaderGradientMode: TdxBarStyleGradientMode; +begin + if not IsDefaultHeaderColor then + Result := inherited HeaderGradientMode + else Result := gmVertical; +end; + +function TdxNavBarNavigationPaneViewInfo.HeaderFontColor: TColor; +begin + Result := inherited HeaderFontColor; + if Result = clNone then + Result := dxOffice11NavPaneHeaderFontColor; +end; + +function TdxNavBarNavigationPaneViewInfo.OverflowPanelBackColor: TColor; +begin + if not IsDefaultOverflowPanelColor then + Result := inherited OverflowPanelBackColor + else Result := dxOffice11NavPaneGroupCaptionColor1; +end; + +function TdxNavBarNavigationPaneViewInfo.OverflowPanelBackColor2: TColor; +begin + if not IsDefaultOverflowPanelColor then + Result := inherited OverflowPanelBackColor2 + else Result := dxOffice11NavPaneGroupCaptionColor2; +end; + +function TdxNavBarNavigationPaneViewInfo.OverflowPanelAlphaBlend: Byte; +begin + if not IsDefaultOverflowPanelColor then + Result := inherited OverflowPanelAlphaBlend + else Result := 255; +end; + +function TdxNavBarNavigationPaneViewInfo.OverflowPanelAlphaBlend2: Byte; +begin + if not IsDefaultOverflowPanelColor then + Result := inherited OverflowPanelAlphaBlend2 + else Result := 255; +end; + +function TdxNavBarNavigationPaneViewInfo.OverflowPanelGradientMode: TdxBarStyleGradientMode; +begin + if not IsDefaultOverflowPanelColor then + Result := inherited OverflowPanelGradientMode + else Result := gmVertical; +end; + +function TdxNavBarNavigationPaneViewInfo.SplitterBackColor: TColor; +begin + if XPScheme = schUnknown then + Result := dxOffice11NavPaneSplitterColor1 + else + Result := inherited SplitterBackColor; +end; + +function TdxNavBarNavigationPaneViewInfo.SplitterBackColor2: TColor; +begin + if XPScheme = schUnknown then + Result := dxOffice11NavPaneSplitterColor2 + else + Result := inherited SplitterBackColor2; +end; + +function TdxNavBarNavigationPaneViewInfo.SplitterGradientMode: TdxBarStyleGradientMode; +begin + if XPScheme = schUnknown then + Result := gmVertical + else + Result := inherited SplitterGradientMode; +end; + +procedure TdxNavBarNavigationPaneViewInfo.AssignDefaultBackgroundStyle; +begin + NavBar.DefaultStyles.Background.ResetValues; + NavBar.DefaultStyles.Background.BackColor := clWindow; + NavBar.DefaultStyles.Background.BackColor2 := clWindow; +end; + +procedure TdxNavBarNavigationPaneViewInfo.AssignDefaultButtonStyle; +begin + NavBar.DefaultStyles.Button.ResetValues; + NavBar.DefaultStyles.Button.BackColor := clNone; + NavBar.DefaultStyles.Button.BackColor2 := clNone; +end; + +procedure TdxNavBarNavigationPaneViewInfo.AssignDefaultGroupBackgroundStyle; +begin + NavBar.DefaultStyles.GroupBackground.ResetValues; + NavBar.DefaultStyles.GroupBackground.BackColor := clWindow; + NavBar.DefaultStyles.GroupBackground.BackColor2 := clWindow; +end; + +procedure TdxNavBarNavigationPaneViewInfo.AssignDefaultGroupHeaderStyle; +begin + NavBar.DefaultStyles.GroupHeader.ResetValues; + NavBar.DefaultStyles.GroupHeader.BackColor := clNone; + NavBar.DefaultStyles.GroupHeader.BackColor2 := clNone; + NavBar.DefaultStyles.GroupHeader.Font.Style := [fsBold]; +end; + +procedure TdxNavBarNavigationPaneViewInfo.AssignDefaultItemStyle; +begin + NavBar.DefaultStyles.Item.ResetValues; + NavBar.DefaultStyles.Item.Font.Color := clWindowText; + NavBar.DefaultStyles.Item.HAlignment := haCenter; +end; + +procedure TdxNavBarNavigationPaneViewInfo.AssignDefaultItemDisabledStyle; +begin + NavBar.DefaultStyles.ItemDisabled.Assign(NavBar.DefaultStyles.Item); + NavBar.DefaultStyles.ItemDisabled.Font.Color := clGrayText; +end; + +procedure TdxNavBarNavigationPaneViewInfo.AssignDefaultNavigationPaneHeaderStyle; +begin + NavBar.DefaultStyles.NavigationPaneHeader.ResetValues; + NavBar.DefaultStyles.NavigationPaneHeader.BackColor := clNone; + NavBar.DefaultStyles.NavigationPaneHeader.BackColor2 := clNone; + NavBar.DefaultStyles.NavigationPaneHeader.Font.Color := clNone; + NavBar.DefaultStyles.NavigationPaneHeader.Font.Name := 'Arial'; + NavBar.DefaultStyles.NavigationPaneHeader.Font.Size := 11; + NavBar.DefaultStyles.NavigationPaneHeader.Font.Style := [fsBold]; +end; + +procedure TdxNavBarNavigationPaneViewInfo.CreateColors; +begin + CreateOffice11NavPaneColors; +end; + +procedure TdxNavBarNavigationPaneViewInfo.RefreshColors; +begin + RefreshOffice11NavPaneColors; +end; + +procedure TdxNavBarNavigationPaneViewInfo.ReleaseColors; +begin + ReleaseOffice11NavPaneColors; +end; + +function TdxNavBarNavigationPaneViewInfo.GetGroupEdges: TPoint; +begin + Result := cxPoint(1, 0); +end; + +function TdxNavBarNavigationPaneViewInfo.GetGroupSeparatorWidth: Integer; +begin + Result := 0; +end; + +function TdxNavBarNavigationPaneViewInfo.GetGroupBorderOffsets: TRect; +begin + Result := inherited GetGroupBorderOffsets; + if IsTopBorderNeeded then + Result.Top := Result.Top + BorderWidth; + if IsBottomBorderNeeded then + Result.Bottom := Result.Bottom + BorderWidth; +end; + +class function TdxNavBarNavigationPaneViewInfo.GetGroupCaptionImageIndent: Integer; +begin + Result := 4; +end; + +function TdxNavBarNavigationPaneViewInfo.GetGroupCaptionHeightAddon: Integer; +begin + Result := 4; +end; + +function TdxNavBarNavigationPaneViewInfo.GetGroupHeaderTextIndent: Integer; +begin + Result := GetGroupCaptionTextIndent; +end; + +function TdxNavBarNavigationPaneViewInfo.GetHeaderClientOffset: TRect; +begin + Result := cxNullRect; +end; + +function TdxNavBarNavigationPaneViewInfo.GetHeaderSignIndents: TRect; +begin + Result := Rect(GetGroupCaptionImageIndent, 0, GetGroupCaptionImageIndent, 0); +end; + +function TdxNavBarNavigationPaneViewInfo.GetNavBarCollapsedWidth: Integer; +var + AMaxElementSize: Integer; +begin + with FOverflowPanelViewInfo do + AMaxElementSize := Max((GetGroupCaptionImageIndent) * 2 + FMaxImageSize.cx, + GetSignWidth + GetClientOffset.Left + GetClientOffset.Right); + AMaxElementSize := Max(AMaxElementSize, + cxRectWidth(HeaderSignRect) + GetHeaderClientOffset.Left + GetHeaderClientOffset.Right); + Result := AMaxElementSize + GetGroupEdges.X * 2; +end; + +function TdxNavBarNavigationPaneViewInfo.GetNavBarMinExpandedWidth: Integer; +begin + Result := GetNavBarCollapsedWidth * 2; +end; + +function TdxNavBarNavigationPaneViewInfo.GetHeaderHeight: Integer; +begin + if not IsHeaderVisible then + Result := 0 + else + begin + Result := GetHeaderHeightAddon; + Inc(Result, Max(cxScreenCanvas.FontHeight(HeaderFont), GetGroupCaptionSignSize.cy)); + end; +end; + +function TdxNavBarNavigationPaneViewInfo.GetGripSize: Integer; +begin + if TdxCustomNavBarAccess(NavBar).IsInternal then + Result := 15 + else + Result := 0; +end; + +function TdxNavBarNavigationPaneViewInfo.GetSplitterHeight: Integer; +begin + if not IsSplitterVisible then + Result := 0 + else + Result := 7; +end; + +function TdxNavBarNavigationPaneViewInfo.CanCollapse: Boolean; +begin + Result := True; +end; + +function TdxNavBarNavigationPaneViewInfo.CanHasGroupViewAsIconView: Boolean; +begin + Result := False; +end; + +function TdxNavBarNavigationPaneViewInfo.CanHasImageInGroupCaption: Boolean; +begin + Result := True; +end; + +function TdxNavBarNavigationPaneViewInfo.CanGroupCaptionBoundsByImage: Boolean; +begin + Result := True; +end; + +function TdxNavBarNavigationPaneViewInfo.IsBottomBorderNeeded: Boolean; +begin + Result := not IsGroupReflectionNeeded; +end; + +function TdxNavBarNavigationPaneViewInfo.IsHeaderVisible: Boolean; +begin + Result := NavBar.OptionsView.NavigationPane.ShowHeader; +end; + +function TdxNavBarNavigationPaneViewInfo.IsSplitterVisible: Boolean; +begin + Result := FOverflowPanelViewInfo.IsVisible; +end; + +function TdxNavBarNavigationPaneViewInfo.IsTopBorderNeeded: Boolean; +begin + Result := not IsHeaderVisible; +end; + +procedure TdxNavBarNavigationPaneViewInfo.DoCreateGroupsInfo; + + procedure CheckFocusedAccessibleObject; + var + AFocusedAccessibleObject: IdxNavBarAccessibilityHelper; + begin + AFocusedAccessibleObject := TdxCustomNavBarAccess(NavBar).FocusedAccessibleObject; + if (AFocusedAccessibleObject <> nil) and (NavBar.ActiveGroup <> nil) and + (AFocusedAccessibleObject.GetHelper = NavBar.ActiveGroup.CaptionPanelIAccessibilityHelper.GetHelper) then + TdxCustomNavBarAccess(NavBar).FocusedAccessibleObject := ActiveGroupCaptionPanelIAccessibilityHelper; + end; + +var + I: Integer; +begin + if IsActiveGroupVisible then + AddGroup(Self, NavBar.ActiveGroup, False, True); + + if IsGroupReflectionNeeded then + for I := 0 to NavBar.Groups.Count - 1 do + if NavBar.Groups[I].Visible then + AddGroup(Self, NavBar.Groups[I], True, False); + CheckFocusedAccessibleObject; +end; + +procedure TdxNavBarNavigationPaneViewInfo.DoCalculateBounds(X, Y: Integer); +var + I: Integer; +begin + CalculateMaxImageSize; + CalculateHeaderBounds(X, Y); + FItemPanelViewInfo.CalculateBounds(X, Y); + CalculateSplitterBounds(X, Y); + for I := GetRealGroupStartIndex to GroupCount - 1 do + Groups[I].CalculateBounds(X, Y); +end; + +function TdxNavBarNavigationPaneViewInfo.GetItemPanelRect: TRect; +begin + Result := FItemPanelViewInfo.FRect; +end; + +function TdxNavBarNavigationPaneViewInfo.GetBoundsUpdateType: TdxNavBarChangeType; +begin + Result := doRecreate; +end; + +function TdxNavBarNavigationPaneViewInfo.GetActiveGroupCaptionPanelAccessibilityHelperClass: TdxNavBarCustomAccessibilityHelperClass; +begin + Result := TdxNavBarNavigationPaneActiveGroupCaptionPanelAccessibilityHelper; +end; + +function TdxNavBarNavigationPaneViewInfo.GetHeaderSignAccessibilityHelperClass: TdxNavBarCustomAccessibilityHelperClass; +begin + Result := TdxNavBarNavigationPaneHeaderSignAccessibilityHelper; +end; + +function TdxNavBarNavigationPaneViewInfo.GetOverflowPanelViewInfoClass: TdxNavBarOverflowPanelViewInfoClass; +begin + Result := TdxNavBarOverflowPanelViewInfo; +end; + +procedure TdxNavBarNavigationPaneViewInfo.CreateInfo; +var + AOverflowPanelItemCount: Integer; +begin + inherited; + if NavBar.ShowGroupCaptions then + AOverflowPanelItemCount := NavBar.NavigationPaneOverflowPanelItemCount + else AOverflowPanelItemCount := 0; + CreateOverflowPanelInfo(AOverflowPanelItemCount, True); + CreateItemPanelViewInfo; +end; + +procedure TdxNavBarNavigationPaneViewInfo.CreateItemPanelViewInfo; +begin + FItemPanelViewInfo.ActiveGroupViewInfo := ActiveGroupViewInfo; + FItemPanelViewInfo.FIsCollapseMode := Painter.Controller.Collapsed; + FItemPanelViewInfo.FCollapseBarGroup := NavBar.ActiveGroup; + FItemPanelViewInfo.CreateItems; +end; + +procedure TdxNavBarNavigationPaneViewInfo.CreateOverflowPanelInfo(AItemCount: Integer; AClearOld: Boolean); +var + I: Integer; + AItem: TdxNavBarOverflowPanelViewInfoItem; +begin + if AClearOld then + FOverflowPanelViewInfo.ClearItems; + if not FOverflowPanelViewInfo.IsVisible then Exit; + for I := GroupCount - 1 downto GetRealGroupStartIndex do + begin + if OverflowPanelItemCount >= AItemCount then + Break; + AItem := FOverflowPanelViewInfo.AddItem; + AItem.Group := Groups[I].Group; + RemoveGroup(Groups[I]); + end; +end; + +procedure TdxNavBarNavigationPaneViewInfo.CalculateSizeGripBounds; +begin + FSizeGripRect.Right := ClientWidth; + FSizeGripRect.Left := FSizeGripRect.Right - GetGripSize; + FSizeGripRect.Bottom := ClientHeight; + FSizeGripRect.Top := FSizeGripRect.Bottom - GetGripSize; +end; + +procedure TdxNavBarNavigationPaneViewInfo.CalculateHeaderBounds(var X, Y: Integer); +begin + if IsHeaderVisible then + begin + FHeaderRect := Bounds(X, Y, ClientWidth - 2*X , GetHeaderHeight); + FHeaderTextRect := cxRectContent(FHeaderRect, GetHeaderClientOffset); + + if Painter.Controller.Collapsible then + begin + FHeaderSignRect := FHeaderTextRect; + Dec(FHeaderSignRect.Right, GetHeaderSignIndents.Right); + FHeaderSignRect.Left := FHeaderSignRect.Right - GetGroupCaptionSignSize.cx; + FHeaderTextRect.Right := FHeaderSignRect.Left - GetHeaderSignIndents.Left; + FHeaderSignRect := cxRectCenter(FHeaderSignRect, GetGroupCaptionSignSize); + end + else + FHeaderSignRect := cxNullRect; + Y := FHeaderRect.Bottom + GetSpaceBetweenGroups; + end + else + begin + SetRectEmpty(FHeaderTextRect); + SetRectEmpty(FHeaderSignRect); + end; +end; + +procedure TdxNavBarNavigationPaneViewInfo.CalculateMaxImageSize; + + function GetGroupViewInfo(AList: TList; AIndex: Integer): TdxNavBarGroupViewInfo; + begin + Result := TdxNavBarGroupViewInfo(AList[AIndex]); + end; + +var + I: Integer; + AList: TObjectList; +begin + AList := TObjectList.Create; + try + FMaxImageSize := Size(FOverflowPanelViewInfo.GetImageWidth, FOverflowPanelViewInfo.GetImageHeight); + + for I := 0 to NavBar.Groups.Count - 1 do + AList.Add(Painter.CreateGroupViewInfo(Self, NavBar.Groups[I], True, False)); + + FImageHeightPeer := AList.Count > 0; + for I := 0 to AList.Count - 1 do + begin + FImageHeightPeer := FImageHeightPeer and (GetGroupViewInfo(AList, 0).GetImageHeight = GetGroupViewInfo(AList, I).GetImageHeight); + FMaxImageSize.cx := Max(FMaxImageSize.cx, GetGroupViewInfo(AList, I).GetImageWidth); + FMaxImageSize.cy := Max(FMaxImageSize.cy, GetGroupViewInfo(AList, I).GetImageHeight); + end; + finally + AList.Free; + end; +end; + +procedure TdxNavBarNavigationPaneViewInfo.CalculateSplitterBounds(var X, Y: Integer); +begin + if not IsSplitterVisible then + Exit; + + FSplitterRect := Bounds(X, Y, ClientWidth - 2*X, GetSplitterHeight); + Y := FSplitterRect.Bottom + GetSpaceBetweenGroups; +end; + +procedure TdxNavBarNavigationPaneViewInfo.ClearRects; +begin + inherited; + FOverflowPanelViewInfo.ClearRects; + SetRectEmpty(FHeaderRect); + SetRectEmpty(FSizeGripRect); + SetRectEmpty(FSplitterRect); +end; + +procedure TdxNavBarNavigationPaneViewInfo.CorrectBounds; + + procedure CalcHeightDifference(out AShortage, AHeightDifference: Integer); + var + AAvailableHeight, ARequiredHeight, AMinHeight: Integer; + begin + AAvailableHeight := ClientHeight - FOverflowPanelViewInfo.GetHeight; + if GetRealGroupCount = 0 then + Dec(AAvailableHeight, GetSplitterHeight); + AMinHeight := FItemPanelViewInfo.GetMinHeight; + if GroupCount > 0 then + ARequiredHeight := Groups[GroupCount - 1].Rect.Bottom + else + ARequiredHeight := HeaderRect.Bottom + AMinHeight; + AHeightDifference := AAvailableHeight - ARequiredHeight; + if AHeightDifference < AMinHeight - cxRectHeight(FItemPanelViewInfo.FRect) then // if AHeightDifference < 0 + begin + AShortage := AMinHeight - cxRectHeight(FItemPanelViewInfo.FRect) - AHeightDifference; + AHeightDifference := AMinHeight - cxRectHeight(FItemPanelViewInfo.FRect); + end + else + AShortage := 0; + end; + + procedure CorrectOverflowPanel(AShortage: Integer; var AHeightDifference: Integer); + + procedure CorrectOverflowPanelBounds; + var + X, Y: Integer; + begin + X := SplitterRect.Left; + if (GetRealGroupCount = 0) or not NavBar.ShowGroupCaptions then + Y := SplitterRect.Bottom + else + Y := Groups[GroupCount - 1].Rect.Bottom; + FOverflowPanelViewInfo.CalculateBounds(X, Y); + end; + + procedure RemoveExcessGroups(var AOverflowPanelGroupCount: Integer); + var + I: Integer; + begin + for I := GroupCount - 1 downto GetRealGroupStartIndex do + begin + if AShortage <= 0 then + Break; + Dec(AShortage, cxRectHeight(Groups[I].Rect)); + Inc(AOverflowPanelGroupCount); + end; + Inc(AHeightDifference, -AShortage); + end; + + var + AGroupCount: Integer; + begin + if not FOverflowPanelViewInfo.IsVisible then + Exit; + AGroupCount := NavBar.NavigationPaneOverflowPanelItemCount; + if not NavBar.ShowGroupCaptions then + AGroupCount := GroupCount - 1 + else + if AShortage > 0 then + RemoveExcessGroups(AGroupCount); + + CreateOverflowPanelInfo(AGroupCount, False); + CorrectOverflowPanelBounds; + end; + + procedure OffsetElements(AHeightDifference: Integer); + var + I: Integer; + begin + + for I := GetRealGroupStartIndex to GroupCount - 1 do + Groups[I].CorrectBounds(0, AHeightDifference); + + OffsetRect(FSplitterRect, 0, AHeightDifference); + FOverflowPanelViewInfo.OffsetElements(AHeightDifference); + end; + + procedure CorrectBoundsWithActiveGroup; + var + AHeightDifference, AShortage: Integer; + begin + CalcHeightDifference(AShortage, AHeightDifference); + CorrectOverflowPanel(AShortage, AHeightDifference); + FItemPanelViewInfo.CorrectBounds(AHeightDifference); + OffsetElements(AHeightDifference); + end; + +begin + CorrectBoundsWithActiveGroup; + CalculateScrollButtonsBounds; + CalculateSizeGripBounds; +end; + +function TdxNavBarNavigationPaneViewInfo.GetGroupViewInfoAtItemsPos(const pt: TPoint): TdxNavBarGroupViewInfo; +begin + Result := inherited GetGroupViewInfoAtItemsPos(pt); + if (Result = ActiveGroupViewInfo) and (NavBar.SourceGroup <> nil) then + Result := nil; +end; + +function TdxNavBarNavigationPaneViewInfo.GetViewInfoAtDragPosition(const pt: TPoint; + var ItemGroup: TdxNavBarGroupViewInfo; var Item1, Item2: TdxNavBarLinkViewInfo): Integer; +begin + Result := inherited GetViewInfoAtDragPosition(pt, ItemGroup, Item1, Item2); + if (ItemGroup <> nil) and (GroupCount > 0) and (ItemGroup <> Groups[0]) and + (NavBar.ActiveGroup = ItemGroup.Group) then + begin + ItemGroup := Groups[0]; + Item1 := nil; + if ItemGroup.ItemCount > 0 then + Item2 := ItemGroup.Items[0] + else Item2 := nil; + Result := 0; + end; +end; + +function TdxNavBarNavigationPaneViewInfo.IsPtIncNavigationPaneOverflowPanelItemCount(const pt: TPoint): Boolean; +begin + if GetRealGroupCount > 0 then + Result := pt.Y > SplitterRect.Top + cxRectHeight(SplitterRect) div 2 + cxRectHeight(Groups[GetRealGroupStartIndex].Rect) + else + Result := pt.Y > SplitterRect.Top + cxRectHeight(SplitterRect) div 2 + 20; +end; + +function TdxNavBarNavigationPaneViewInfo.IsPtDecNavigationPaneOverflowPanelItemCount(const pt: TPoint): Boolean; +begin + if GetRealGroupCount > 0 then + Result := pt.Y < SplitterRect.Top + cxRectHeight(SplitterRect) div 2 - cxRectHeight(Groups[GetRealGroupStartIndex].Rect) + else + Result := pt.Y < SplitterRect.Top + cxRectHeight(SplitterRect) div 2 - 20; +end; + +function TdxNavBarNavigationPaneViewInfo.IsPtNavigationPaneHeader(const pt: TPoint): Boolean; +begin + Result := PtInRect(FHeaderRect, pt); +end; + +function TdxNavBarNavigationPaneViewInfo.IsPtNavigationPaneHeaderSign(const pt: TPoint): Boolean; +begin + Result := PtInRect(FHeaderSignRect, pt); +end; + +function TdxNavBarNavigationPaneViewInfo.IsPtNavigationPaneOverflowPanel(const pt: TPoint): Boolean; +begin + Result := PtInRect(OverflowPanelRect, pt); +end; + +function TdxNavBarNavigationPaneViewInfo.IsPtNavigationPaneOverflowPanelSign(const pt: TPoint): Boolean; +begin + Result := PtInRect(OverflowPanelSignRect, pt); +end; + +function TdxNavBarNavigationPaneViewInfo.IsPtNavigationPaneSplitter(const pt: TPoint): Boolean; +begin + Result := PtInRect(FSplitterRect, pt); +end; + +function TdxNavBarNavigationPaneViewInfo.IsPtNavigationPaneItemPanel(const pt: TPoint): Boolean; +begin + Result := PtInRect(FItemPanelViewInfo.FRect, pt); +end; + +procedure TdxNavBarNavigationPaneViewInfo.DoShowPopupMenu(const APoint: TPoint); +begin + DoUpdatePopupMenu; + PopupMenu.Popup(APoint.X, APoint.Y); +end; + +procedure TdxNavBarNavigationPaneViewInfo.DoUpdatePopupMenu; + + function AddItem(AParentItem: TMenuItem; ACaption: string; + AEnabled: Boolean = True; AOnClick: TNotifyEvent = nil; + AImageIndex: Integer = -1; AChecked: Boolean = False): TMenuItem; + begin + Result := TMenuItem.Create(PopupMenu); + Result.Caption := ACaption; + Result.OnDrawItem := DoDrawItem; + if ACaption <> '-' then + begin + Result.OnMeasureItem := DoMeasureItem; + Result.OnClick := AOnClick; + Result.Checked := AChecked; + Result.Enabled := AEnabled; + Result.ImageIndex := AImageIndex; + end; + AParentItem.Add(Result); + end; + + procedure AssignImage(AImageList: TImageList; ASourceBitmap: TBitmap); + var + ABitmap: TBitmap; + ASideSize: Integer; + AStretchRect: TRect; + AMaskColor: TColor; + begin + if AImageList.BkColor = clNone then + AMaskColor := clFuchsia + else + AMaskColor := AImageList.BkColor; + ABitmap := cxCreateBitmap(AImageList.Width, AImageList.Height); + try + ASideSize := Min(ABitmap.Width, ABitmap.Height); + AStretchRect.Left := (ABitmap.Width - ASideSize) div 2; + AStretchRect.Right := AStretchRect.Left + ASideSize; + AStretchRect.Top := (ABitmap.Height - ASideSize) div 2; + AStretchRect.Bottom := AStretchRect.Top + ASideSize; + ABitmap.Canvas.Brush.Color := AMaskColor; + ABitmap.Canvas.FillRect(Rect(0, 0, ABitmap.Width, ABitmap.Height)); + ABitmap.Canvas.StretchDraw(AStretchRect, ASourceBitmap); + AImageList.AddMasked(ABitmap, AMaskColor); + finally + ABitmap.Free; + end; + end; + + function GetImageIndex(AGroup: TdxNavBarGroup; ADefaultImageIndex: Integer): Integer; + begin + if IsImageAssigned(NavBar.SmallImages, AGroup.SmallImageIndex) then + Result := AGroup.SmallImageIndex + else + Result := ADefaultImageIndex; + end; + + procedure CreateGroupList(AParentMenuItem: TMenuItem; ADefaultImageIndex: Integer); + var + I: Integer; + AItem: TMenuItem; + begin + for I := 0 to NavBar.Groups.Count - 1 do + begin + if NavBar.Groups[I].VisibleForCustomization then + begin + AItem := AddItem(AParentMenuItem, NavBar.Groups[I].Caption, True, DoAddRemoveButtonsClick, + GetImageIndex(NavBar.Groups[I], ADefaultImageIndex), NavBar.Groups[I].Visible); + {$IFDEF DELPHI6} + AItem.AutoCheck := True; + {$ENDIF}; + AItem.Tag := I; + end; + end; + end; + + procedure CreateHiddenGroupList(AParentMenuItem: TMenuItem; ADefaultImageIndex: Integer); + var + I: Integer; + begin + AddItem(AParentMenuItem, '-'); + for I := OverflowPanelVisibleItemCount to OverflowPanelItemCount - 1 do + AddItem(AParentMenuItem, OverflowPanelItems[I].Group.Caption, True, DoHiddenGroupClick, + GetImageIndex(OverflowPanelItems[I].Group, ADefaultImageIndex), + NavBar.ActiveGroup = OverflowPanelItems[I].Group).Tag := Integer(OverflowPanelItems[I].Group); + end; + +var + AImageCount: Integer; + AParentMenuItem: TMenuItem; +begin + RecreateImageList; + + if NavBar.SmallImages <> nil then + begin + ImageList.Width := NavBar.SmallImages.Width; + ImageList.Height := NavBar.SmallImages.Height; + end; + + AImageCount := GetSmallImagesCount; + AssignImage(ImageList, dxOffice11NavPaneArrowUpBitmap); + AssignImage(ImageList, dxOffice11NavPaneArrowDownBitmap); + AssignImage(ImageList, dxOffice11NavPaneDefaultSmallBitmap); + + PopupMenu.Items.Clear; + PopupMenu.Images := ImageList; + + AddItem(PopupMenu.Items, cxGetResourceString(@sdxNavBarOffice11ShowMoreButtons), + NavBar.CanDecNavigationPaneOverflowPanelItemCount, DoMoreButtonsClick, AImageCount); + AddItem(PopupMenu.Items, cxGetResourceString(@sdxNavBarOffice11ShowFewerButtons), + NavBar.CanIncNavigationPaneOverflowPanelItemCount, DoFewerButtonsClick, AImageCount + 1); + if NavBar.OptionsBehavior.NavigationPane.AllowCustomizing then + begin + AParentMenuItem := AddItem(PopupMenu.Items, + cxGetResourceString(@sdxNavBarOffice11AddRemoveButtons), NavBar.Groups.Count > 0); + CreateGroupList(AParentMenuItem, AImageCount + 2); + end; + CreateHiddenGroupList(PopupMenu.Items, AImageCount + 2); +end; + +function TdxNavBarNavigationPaneViewInfo.IsDefaultHeaderColor: Boolean; +begin + Result := (inherited HeaderBackColor = clNone) or (inherited HeaderBackColor2 = clNone); +end; + +function TdxNavBarNavigationPaneViewInfo.IsDefaultOverflowPanelColor: Boolean; +begin + Result := (inherited OverflowPanelBackColor = clNone) or (inherited OverflowPanelBackColor2 = clNone); +end; + +function TdxNavBarNavigationPaneViewInfo.IsDefaultBottomScrollButtonColor: Boolean; +begin + Result := (inherited BottomScrollButtonBackColor = clNone) or (inherited BottomScrollButtonBackColor2 = clNone); +end; + +function TdxNavBarNavigationPaneViewInfo.IsDefaultTopScrollButtonColor: Boolean; +begin + Result := (inherited TopScrollButtonBackColor = clNone) or (inherited TopScrollButtonBackColor2 = clNone); +end; + +procedure TdxNavBarNavigationPaneViewInfo.RecreateImageList; +begin + FImageList.Free; + FImageList := TImageList.Create(NavBar); +end; + +function TdxNavBarNavigationPaneViewInfo.GetPainter: TdxNavBarNavigationPanePainter; +begin + Result := TdxNavBarNavigationPanePainter(inherited Painter); +end; + +function TdxNavBarNavigationPaneViewInfo.GetActiveGroupCaptionPanelIAccessibilityHelper: IdxNavBarAccessibilityHelper; +begin + if FActiveGroupCaptionPanelIAccessibilityHelper = nil then + FActiveGroupCaptionPanelIAccessibilityHelper := NavBarGetAccessibilityHelper( + GetActiveGroupCaptionPanelAccessibilityHelperClass.Create(Self, NavBar)); + Result := FActiveGroupCaptionPanelIAccessibilityHelper; +end; + +function TdxNavBarNavigationPaneViewInfo.GetHeaderSignIAccessibilityHelper: IdxNavBarAccessibilityHelper; +begin + if FHeaderSignIAccessibilityHelper = nil then + FHeaderSignIAccessibilityHelper := NavBarGetAccessibilityHelper( + GetHeaderSignAccessibilityHelperClass.Create(Self, NavBar)); + Result := FHeaderSignIAccessibilityHelper; +end; + +function TdxNavBarNavigationPaneViewInfo.GetNavPanePartIAccessibilityHelper( + const APart: TdxNavBarPart): IdxNavBarAccessibilityHelper; +begin + case APart.MajorPartIndex of + nbOverflowPanelItem: Result := GetOverflowPanelItemIAccessibilityHelper(APart.MinorPartIndex); + nbOverflowPanelSign: Result := OverflowPanelSignIAccessibilityHelper; + nbHeaderSign: Result := HeaderSignIAccessibilityHelper; + + nbItemPanelCollapseItem: Result := FItemPanelViewInfo.ItemIAccessibilityHelpers[APart.MinorPartIndex]; + nbItemPanelCollapseBar: Result := FItemPanelViewInfo.CollapseBarIAccessibilityHelper; + end; +end; + +function TdxNavBarNavigationPaneViewInfo.GetOverflowPanelIAccessibilityHelper: IdxNavBarAccessibilityHelper; +begin + Result := FOverflowPanelViewInfo.GetIAccessibilityHelper; +end; + +procedure TdxNavBarNavigationPaneViewInfo.DoMoreButtonsClick(Sender: TObject); +begin + NavBar.DoDecNavigationPaneOverflowPanelItemCount; +end; + +procedure TdxNavBarNavigationPaneViewInfo.DoFewerButtonsClick(Sender: TObject); +begin + NavBar.DoIncNavigationPaneOverflowPanelItemCount; +end; + +procedure TdxNavBarNavigationPaneViewInfo.DoAddRemoveButtonsClick(Sender: TObject); +var + AMenuItem: TMenuItem; + AGroup: TdxNavBarGroup; +begin + AMenuItem := Sender as TMenuItem; +{$IFNDEF DELPHI6} + AMenuItem.Checked := not AMenuItem.Checked; +{$ENDIF} + AGroup := NavBar.Groups[AMenuItem.Tag]; + AGroup.Visible := AMenuItem.Checked; +end; + +procedure TdxNavBarNavigationPaneViewInfo.DoHiddenGroupClick(Sender: TObject); +begin + NavBar.ActiveGroup := TdxNavBarGroup(TMenuItem(Sender).Tag); +end; + +procedure TdxNavBarNavigationPaneViewInfo.DoDrawItem(Sender: TObject; + ACanvas: TCanvas; ARect: TRect; Selected: Boolean); +var + AMenuItem: TMenuItem; + AState: TdxNavBarObjectStates; + AImageList: TCustomImageList; + AImageIndex: Integer; +begin + AMenuItem := Sender as TMenuItem; + AState := []; + if Selected then + Include(AState, sSelected); + if AMenuItem.Checked then + Include(AState, sActive); + if not AMenuItem.Enabled then + Include(AState, sDisabled); + + AImageIndex := AMenuItem.ImageIndex; + if IsImageAssigned(NavBar.SmallImages, AImageIndex) then + AImageList := NavBar.SmallImages + else + begin + AImageList := ImageList; + Dec(AImageIndex, GetSmallImagesCount); + end; + (Painter as TdxNavBarNavigationPanePainter).DrawPopupMenuItem(ACanvas, ARect, + AImageList, AImageIndex, AMenuItem.Caption, AState); +end; + +procedure TdxNavBarNavigationPaneViewInfo.DoMeasureItem(Sender: TObject; ACanvas: TCanvas; var Width, Height: Integer); +begin + Height := 2 * FOverflowPanelViewInfo.GetPopupMenuImageIndent + GetSmallImageHeight; +end; + +function TdxNavBarNavigationPaneViewInfo.GetOverflowPanelItemCount: Integer; +begin + Result := FOverflowPanelViewInfo.ItemCount; +end; + +function TdxNavBarNavigationPaneViewInfo.GetOverflowPanelItems(AIndex: Integer): TdxNavBarOverflowPanelViewInfoItem; +begin + Result := FOverflowPanelViewInfo.Items[AIndex]; +end; + +function TdxNavBarNavigationPaneViewInfo.GetOverflowPanelVisibleItemCount: Integer; +begin + Result := FOverflowPanelViewInfo.FVisibleItemCount; +end; + +function TdxNavBarNavigationPaneViewInfo.GetOverflowPanelRect: TRect; +begin + Result := FOverflowPanelViewInfo.FRect; +end; + +function TdxNavBarNavigationPaneViewInfo.GetOverflowPanelSignRect: TRect; +begin + Result := FOverflowPanelViewInfo.FSignRect; +end; + +function TdxNavBarNavigationPaneViewInfo.GetOverflowPanelSignIAccessibilityHelper: IdxNavBarAccessibilityHelper; +begin + Result := (OverflowPanelIAccessibilityHelper.GetHelper as TdxNavBarNavigationPaneOverflowPanelAccessibilityHelper).SignIAccessibilityHelper; +end; + +function TdxNavBarNavigationPaneViewInfo.GetOverflowPanelItemIAccessibilityHelper(AIndex: Integer): IdxNavBarAccessibilityHelper; +begin + Result := (OverflowPanelIAccessibilityHelper.GetHelper as TdxNavBarNavigationPaneOverflowPanelAccessibilityHelper).ItemIAccessibilityHelpers[AIndex] +end; + +function TdxNavBarNavigationPaneViewInfo.IsActiveGroupVisible: Boolean; +begin + Result := not Painter.Controller.Collapsed and (NavBar.ActiveGroup <> nil) and NavBar.ActiveGroup.Visible; +end; + +function TdxNavBarNavigationPaneViewInfo.IsGroupReflectionNeeded: Boolean; +begin + Result := FOverflowPanelViewInfo.IsVisible or + NavBar.OptionsView.Common.ShowGroupCaptions; +end; + +function TdxNavBarNavigationPaneViewInfo.GetRealGroupStartIndex: Integer; +begin + if IsActiveGroupVisible then + Result := 1 + else + Result := 0; +end; + +function TdxNavBarNavigationPaneViewInfo.GetRealGroupCount: Integer; +begin + Result := GroupCount - GetRealGroupStartIndex; +end; + +function TdxNavBarNavigationPaneViewInfo.GetSmallImagesCount: Integer; +begin + if NavBar.SmallImages <> nil then + Result := NavBar.SmallImages.Count + else + Result := 0; +end; + +{ TdxNavBarPopupControlViewInfo } + +procedure TdxNavBarPopupControlViewInfo.CalculateBounds(AClientWidth: Integer); +var + X, Y: Integer; + AActiveGroupViewInfo: TdxNavBarGroupViewInfo; +begin + AActiveGroupViewInfo := TdxNavBarGroupViewInfo.Create(ViewInfo, NavBar.ActiveGroup, False, True); + try + X := 0; + Y := 0; + AActiveGroupViewInfo.CalculateBounds(X, Y); + FRect := cxRectSetHeight(AActiveGroupViewInfo.Rect, + cxRectHeight(AActiveGroupViewInfo.Rect) + GetBorderOffsets.Top + GetBorderOffsets.Bottom); + FRect := cxRectSetWidth(FRect, + AClientWidth + GetBorderOffsets.Left + GetBorderOffsets.Right); + if (AActiveGroupViewInfo.Control <> nil) or (cxRectHeight(FRect) > GetMaxHeight) then + FRect := cxRectSetHeight(FRect, GetMaxHeight); + finally + FreeAndNil(AActiveGroupViewInfo); + end; +end; + +function TdxNavBarPopupControlViewInfo.CalculatePosition: TPoint; +begin + Result := NavBar.ClientToScreen(cxPoint(NavBar.Width - ViewInfo.BorderWidth, + cxRectHeight(ViewInfo.HeaderRect) - 1)); +end; + +function TdxNavBarPopupControlViewInfo.GetBorderOffsets: TRect; +begin + Result := cxRect(2, 2, 2, 2); +end; + +function TdxNavBarPopupControlViewInfo.GetMaxHeight: Integer; +begin + Result := NavBar.ClientHeight - ViewInfo.GetHeaderHeight * 2; +end; + +function TdxNavBarPopupControlViewInfo.GetMinWidth: Integer; +begin + Result := ViewInfo.GetNavBarMinExpandedWidth + GetBorderOffsets.Left + GetBorderOffsets.Right; +end; + +function TdxNavBarPopupControlViewInfo.IsPtSizeGrip(const pt: TPoint): Boolean; +begin + Result := (pt.X >= cxRectWidth(FRect) - GetBorderOffsets.Right); +end; + +function TdxNavBarPopupControlViewInfo.GetClientRect: TRect; +begin + Result := cxRectContent(FRect, GetBorderOffsets); +end; + +type + TdxNavBarPopupInnerControl = class(TdxCustomNavBar) + private + FNavBar: TdxCustomNavBar; + procedure AcceptActiveGroupControl(ASource, ADestination: TdxCustomNavBar); + procedure AssignGroupProperties(ASource, ADestination: TdxCustomNavBar); + procedure CloneActiveGroupLinks(ASource, ADestination: TdxCustomNavBar); + procedure SynchronizeActiveGroupLinks; + protected + procedure UpdateData; + procedure UpdateOriginalData; + function IsInternal: Boolean; override; + public + constructor Create(APopupControl: TdxNavBarPopupControl); reintroduce; virtual; + end; + + TdxNavBarPopupInnerControlControllerState = (icsOverSizeGrip); + TdxNavBarPopupInnerControlControllerStates = set of TdxNavBarPopupInnerControlControllerState; + + TdxNavBarPopupInnerControlController = class(TdxNavBarNavigationPaneController) + private + FInternalState: TdxNavBarPopupInnerControlControllerStates; + function GetNavBar: TdxNavBarPopupInnerControl; + function GetMouseOverSizeGrip: Boolean; + function GetViewInfo: TdxNavBarOffice11NavPaneViewInfo; + procedure SetMouseOverSizeGrip(AValue: Boolean); + property MouseOverSizeGrip: Boolean read GetMouseOverSizeGrip write SetMouseOverSizeGrip; + protected + procedure DoLinkClick(ANavBar: TdxCustomNavBar; ALink: TdxNavBarItemLink); override; + procedure DoMouseDown(AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); override; + procedure DoMouseMove(AShift: TShiftState; const APoint: TPoint); override; + function GetCursor: HIcon; override; + + property NavBar: TdxNavBarPopupInnerControl read GetNavBar; + property ViewInfo: TdxNavBarOffice11NavPaneViewInfo read GetViewInfo; + end; + +{ TdxNavBarPopupInnerControl } + +constructor TdxNavBarPopupInnerControl.Create(APopupControl: TdxNavBarPopupControl); +begin + inherited Create(APopupControl); + FNavBar := APopupControl.FNavBar; + OptionsView.NavigationPane.ShowHeader := False; + OptionsView.NavigationPane.ShowOverflowPanel := False; +end; + +procedure TdxNavBarPopupInnerControl.UpdateData; +begin + View := FNavBar.View; + ViewStyle.Assign(FNavBar.ViewStyle); + AllowSelectLinks := FNavBar.AllowSelectLinks; + OptionsStyle := FNavBar.OptionsStyle; + OptionsImage := FNavBar.OptionsImage; + BeginUpdate; + try + Items.Assign(FNavBar.Items); + ActiveGroup.ClearLinks; + CloneActiveGroupLinks(FNavBar, Self); + AssignGroupProperties(FNavBar, Self); + finally + EndUpdate; + end; + TabStop := FNavBar.TabStop and not (Groups[0].UseControl and Groups[0].ShowControl); +end; + +procedure TdxNavBarPopupInnerControl.UpdateOriginalData; +begin + FNavBar.BeginUpdate; + try + SynchronizeActiveGroupLinks; + AssignGroupProperties(Self, FNavBar); + finally + FNavBar.EndUpdate; + end; +end; + +function TdxNavBarPopupInnerControl.IsInternal: Boolean; +begin + Result := True; +end; + +procedure TdxNavBarPopupInnerControl.AcceptActiveGroupControl(ASource, ADestination: TdxCustomNavBar); +var + AControl: TdxNavBarGroupControl; + ASourceGroup, ADestinationGroup: TdxNavBarGroup; +begin + ASourceGroup := ASource.ActiveGroup; + ADestinationGroup := ADestination.ActiveGroup; + AControl := ASourceGroup.Control; + AControl.Group := ADestinationGroup; + AControl.Parent := ADestination; + ADestinationGroup.AcceptControl(AControl); + ADestinationGroup.UseControl := True; + ADestinationGroup.ShowControl := ASourceGroup.ShowControl; + if ASource = Self then + begin + ASourceGroup.ReleaseControl; + AControl.Group := ADestinationGroup; + ASourceGroup.UseControl := False; + end; +end; + +procedure TdxNavBarPopupInnerControl.AssignGroupProperties(ASource, ADestination: TdxCustomNavBar); +var + ASourceGroup, ADestinationGroup: TdxNavBarGroup; +begin + ASourceGroup := ASource.ActiveGroup; + ADestinationGroup := ADestination.ActiveGroup; + if ASourceGroup = FNavBar.ActiveGroup then + begin + ADestinationGroup.CustomStyles := ASourceGroup.CustomStyles; + ADestinationGroup.LinksUseSmallImages := ASourceGroup.LinksUseSmallImages; + ADestinationGroup.ShowAsIconView := ASourceGroup.ShowAsIconView; + end; + if ASourceGroup.UseControl then + AcceptActiveGroupControl(ASource, ADestination); + ADestinationGroup.SelectedLinkIndex := ASourceGroup.SelectedLinkIndex; + ADestinationGroup.OnSelectedLinkChanged := ASourceGroup.OnSelectedLinkChanged; + ADestinationGroup.OnTopVisibleLinkChanged := ASourceGroup.OnTopVisibleLinkChanged; + ASourceGroup.OnSelectedLinkChanged := nil; + ASourceGroup.OnTopVisibleLinkChanged := nil; +end; + +procedure TdxNavBarPopupInnerControl.CloneActiveGroupLinks(ASource, ADestination: TdxCustomNavBar); +var + I: Integer; + ASourceLink, ADestinationLink: TdxNavBarItemLink; +begin + for I := 0 to ASource.ActiveGroup.LinkCount - 1 do + begin + ASourceLink := ASource.ActiveGroup.Links[I]; + ADestinationLink := ADestination.ActiveGroup.CreateLink(ADestination.Items[ASourceLink.Item.Index]); + if ASource = FNavBar then + ADestinationLink.Data := Integer(ASourceLink); + end; +end; + +procedure TdxNavBarPopupInnerControl.SynchronizeActiveGroupLinks; +var + I: Integer; + ASourceLink, ADestinationLink: TdxNavBarItemLink; + ASourceGroup, ADestinationGroup: TdxNavBarGroup; +begin + ASourceGroup := ActiveGroup; + ADestinationGroup := FNavBar.ActiveGroup; + for I := 0 to ASourceGroup.LinkCount - 1 do + begin + ASourceLink := ASourceGroup.Links[I]; + ADestinationLink := TdxNavBarItemLink(ASourceGroup.Links[I].Data); + if ADestinationLink = nil then + ASourceLink.Data := Integer(ADestinationGroup.CreateLink(Items[ASourceLink.Item.Index])); + end; + for I := 0 to ASourceGroup.LinkCount - 1 do + begin + ASourceLink := ASourceGroup.Links[I]; + ADestinationLink := TdxNavBarItemLink(ASourceGroup.Links[I].Data); + ADestinationLink.Index := ASourceLink.Index; + end; + for I := ADestinationGroup.LinkCount - 1 downto ASourceGroup.LinkCount do + ADestinationGroup.RemoveLink(I); +end; + +{ TdxNavBarPopupInnerControlController } + +procedure TdxNavBarPopupInnerControlController.DoLinkClick(ANavBar: TdxCustomNavBar; ALink: TdxNavBarItemLink); +begin + ALink.Selected := NavBar.AllowSelectLinks; + ALink := TdxNavBarItemLink(ALink.Data); + ANavBar := NavBar.FNavBar; + TdxNavBarNavigationPaneController(ANavBar.Painter.Controller).ClosePopupControl; + inherited; +end; + +procedure TdxNavBarPopupInnerControlController.DoMouseDown(AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); +begin + if MouseOverSizeGrip then + TdxNavBarPopupControl(NavBar.Parent).BeginResize(NavBar, AButton, AShift, APoint) + else + inherited; +end; + +procedure TdxNavBarPopupInnerControlController.DoMouseMove(AShift: TShiftState; const APoint: TPoint); +begin + MouseOverSizeGrip := not (NavBar.IsPtBottomScrollButton(APoint) or NavBar.IsPtTopScrollButton(APoint)) and + cxRectPtIn(ViewInfo.SizeGripRect, APoint); + if not MouseOverSizeGrip then + inherited; +end; + +function TdxNavBarPopupInnerControlController.GetCursor: HIcon; +begin + if MouseOverSizeGrip then + Result := Screen.Cursors[crSizeWE] + else + Result := inherited GetCursor; +end; + +function TdxNavBarPopupInnerControlController.GetNavBar: TdxNavBarPopupInnerControl; +begin + Result := TdxNavBarPopupInnerControl(FNavBar); +end; + +function TdxNavBarPopupInnerControlController.GetMouseOverSizeGrip: Boolean; +begin + Result := icsOverSizeGrip in FInternalState; +end; + +function TdxNavBarPopupInnerControlController.GetViewInfo: TdxNavBarOffice11NavPaneViewInfo; +begin + Result := TdxNavBarOffice11NavPaneViewInfo(inherited ViewInfo); +end; + +procedure TdxNavBarPopupInnerControlController.SetMouseOverSizeGrip(AValue: Boolean); +begin + if MouseOverSizeGrip <> AValue then + if AValue then + Include(FInternalState, icsOverSizeGrip) + else + Exclude(FInternalState, icsOverSizeGrip); +end; + +{ TdxNavBarPopupControl } + +constructor TdxNavBarPopupControl.Create(ANavBar: TdxCustomNavBar); +begin + inherited Create(ANavBar); + CaptureFocus := True; + FNavBar := ANavBar; + FOriginalWidth := Painter.Controller.OriginalWidth; +end; + +destructor TdxNavBarPopupControl.Destroy; +begin + FreeAndNil(FInnerControl); + inherited; +end; + +procedure TdxNavBarPopupControl.CloseUp; +begin + TdxNavBarPopupInnerControl(FInnerControl).UpdateOriginalData; + if pcsSizing in FInternalState then + EndResize(True); + FreeAndNil(FViewInfo); + ActiveControl := nil; + inherited; +end; + +procedure TdxNavBarPopupControl.Popup(AFocusedControl: TWinControl); +begin + CreateViewInfo; + inherited; +end; + +function TdxNavBarPopupControl.NeedAdjustWidth: Boolean; +begin + Result := FNavBar.OptionsBehavior.NavigationPane.AdjustWidthByPopup; +end; + +function TdxNavBarPopupControl.CalculatePosition: TPoint; +begin + Result := FViewInfo.CalculatePosition; +end; + +procedure TdxNavBarPopupControl.CalculateSize; +begin + FViewInfo.CalculateBounds(FOriginalWidth); + Width := cxRectWidth(FViewInfo.FRect); + Height := cxRectHeight(FViewInfo.FRect); + FInnerControl.Width := cxRectWidth(FViewInfo.ClientRect); + FInnerControl.Height := cxRectHeight(FViewInfo.ClientRect); +end; + +procedure TdxNavBarPopupControl.BeginResize(AControl: TControl; AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); +var + ARealPoint: TPoint; +begin + SetCaptureControl(Self); + if AControl <> Self then + ARealPoint := dxNavBarCollns.ClientToParent(AControl, APoint, Self) + else + ARealPoint := APoint; + FCapturePointOffset := Width - ARealPoint.X; + Include(FInternalState, pcsSizing); + DrawSizeFrame(BoundsRect); +end; + +procedure TdxNavBarPopupControl.EndResize(ACancel: Boolean = False); +begin + SetCaptureControl(nil); + Exclude(FInternalState, pcsSizing); + if not ACancel then + SetNewWidth(cxRectWidth(FSizeFrame.BoundsRect)); + DrawSizeFrame(cxEmptyRect); +end; + +procedure TdxNavBarPopupControl.DoShowed; +begin + inherited DoShowed; + if FInnerControl.Groups[0].UseControl and FInnerControl.Groups[0].ShowControl then + begin + TdxNavBarPainterAccess(FInnerControl.Painter).CheckDrawParamChanges; + ActiveControl := FindNextControl(nil, True, True, False); + end; +end; + +procedure TdxNavBarPopupControl.DrawSizeFrame(const R: TRect); +var + ABorderWidth: Integer; +begin + if not IsRectEmpty(R) then + begin + ABorderWidth := 1; + if FSizeFrame = nil then + FSizeFrame := TcxSizeFrame.Create(ABorderWidth); + FSizeFrame.Show; + FSizeFrame.DrawSizeFrame(R); + end + else + FreeAndNil(FSizeFrame); +end; + +procedure TdxNavBarPopupControl.InitPopup; +begin + if FInnerControl = nil then + begin + FInnerControl := TdxNavBarPopupInnerControl.Create(Self); + FInnerControl.Parent := Self; + FInnerControl.Left := ViewInfo.GetBorderOffsets.Left; + FInnerControl.Top := ViewInfo.GetBorderOffsets.Top; + FInnerControl.Groups.Add; /////-> InnerControl + FInnerControl.ShowGroupCaptions := False; /////-> InnerControl + end; + TdxNavBarPopupInnerControl(FInnerControl).UpdateData; + if NeedAdjustWidth then + FOriginalWidth := Painter.Controller.OriginalWidth; +end; + +procedure TdxNavBarPopupControl.Paint; +begin + FViewInfo.Painter.DrawPopupControl(Canvas, FViewInfo); +end; + +procedure TdxNavBarPopupControl.RefreshPopupWindow; +begin + CalculateSize; + Refresh; +end; + +procedure TdxNavBarPopupControl.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + //inherited; + if (GetCaptureControl <> nil) and ViewInfo.IsPtSizeGrip(cxPoint(X, Y)) then + BeginResize(Self, Button, Shift, cxPoint(X, Y)); +end; + +procedure TdxNavBarPopupControl.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + if pcsSizing in FInternalState then + EndResize; +end; + +procedure TdxNavBarPopupControl.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + // inherited; + if not (pcsSizing in FInternalState) then + MouseOverSizeGrip := ViewInfo.IsPtSizeGrip(Point(X, Y)) + else + if X + FCapturePointOffset > ViewInfo.GetMinWidth then + DrawSizeFrame(cxRectSetWidth(BoundsRect, X + FCapturePointOffset)); +end; + +function TdxNavBarPopupControl.NeedIgnoreMouseMessageAfterCloseUp(AWnd: THandle; AMsg: Cardinal; + AShift: TShiftState; const APos: TPoint): Boolean; +begin + Result := True; +end; + +procedure TdxNavBarPopupControl.KeyDown(var Key: Word; Shift: TShiftState); +begin + if Key = VK_ESCAPE then + if pcsSizing in FInternalState then + EndResize(True) + else + CloseUp + else + inherited; +end; + +procedure TdxNavBarPopupControl.CreateViewInfo; +begin + FViewInfo := Painter.CreatePopupControlViewInfo; +end; + +function TdxNavBarPopupControl.GetPainter: TdxNavBarNavigationPanePainter; +begin + Result := TdxNavBarNavigationPanePainter(FNavBar.Painter); +end; + +procedure TdxNavBarPopupControl.SetNewWidth(AWidth: Integer); +begin + FOriginalWidth := FOriginalWidth + AWidth - Width; + if NeedAdjustWidth then + Painter.Controller.OriginalWidth := FOriginalWidth; + RefreshPopupWindow; +end; + +function TdxNavBarPopupControl.GetMouseOverSizeGrip: Boolean; +begin + Result := pcsOverSizeGrip in FInternalState; +end; + +procedure TdxNavBarPopupControl.SetMouseOverSizeGrip(AValue: Boolean); +begin + if MouseOverSizeGrip <> AValue then + if AValue then + begin + Include(FInternalState, pcsOverSizeGrip); + Cursor := crSizeWE; + end + else + begin + Exclude(FInternalState, pcsOverSizeGrip); + Cursor := crDefault; + end; +end; + +{ TdxNavBarNavigationPaneController } + +constructor TdxNavBarNavigationPaneController.Create(ANavBar: TdxCustomNavBar); +begin + inherited; + TdxCustomNavBarAccess(ANavBar).OnCollapseStateChanged := CollapseStateChaged; + FDroppedDownPart := dxNavBarPart(nbNone); +end; + +destructor TdxNavBarNavigationPaneController.Destroy; +begin + TdxCustomNavBarAccess(FNavBar).OnCollapseStateChanged := nil; + FreeAndNil(FPopupControl); + inherited; +end; + +procedure TdxNavBarNavigationPaneController.ClosePopupControl; +begin + if IsPopupControlExists and IsPopupControlVisible then + PopupControl.CloseUp; +end; + +procedure TdxNavBarNavigationPaneController.ShowPopupControl; +begin + if FNavBar.ActiveGroup <> nil then + begin + if not IsPopupControlExists then + FPopupControl := TdxNavBarPopupControl.Create(FNavBar); + FPopupControl.OwnerBounds := FNavBar.BoundsRect; + FPopupControl.OwnerParent := FNavBar.Parent; + FPopupControl.Popup(nil); + end; +end; + +procedure TdxNavBarNavigationPaneController.DoClick(const APart: TdxNavBarPart); +begin + case HotPart.MajorPartIndex of + nbOverflowPanelItem: DoOverflowPanelItemClick; + nbOverflowPanelSign: DoOverflowPanelSignClick; + nbHeaderSign: + begin + DoHeaderSignClick; + HotPart := dxNavBarPart(nbNone); + end; + nbItemPanelCollapseBar: DoCollapseBarClick; + nbItemPanelCollapseItem: DoCollapseItemClick; + else + inherited; + end; +end; + +procedure TdxNavBarNavigationPaneController.DoCheckBounds(var ALeft, ATop, AWidth, AHeight: Integer); +begin + inherited; + if AWidth <> FNavBar.Width then + if Collapsed then + if AWidth >= ViewInfo.GetNavBarMinExpandedWidth then + begin + OriginalWidth := AWidth; + ChangeNavBarCollapseState; + end + else + AWidth := ViewInfo.GetNavBarCollapsedWidth + else + if AWidth < ViewInfo.GetNavBarMinExpandedWidth then + ChangeNavBarCollapseState; +end; + +procedure TdxNavBarNavigationPaneController.DoMouseDown(AButton: TMouseButton; AShift: TShiftState; const APoint: TPoint); +begin + if IsPopupControlExists and FPopupControl.JustClosed then + Include(FInternalState, npsPopupShowLocked) + else + begin + Exclude(FInternalState, npsPopupShowLocked); + if (ssLeft in AShift) then + begin + PressedPart := GetPartAtPos(APoint); + if IsdxNavBarPartsEqual(PressedPart, dxNavBarPart(nbNone)) then + inherited; + end + else + inherited; + end; +end; + +procedure TdxNavBarNavigationPaneController.DoMouseMove(AShift: TShiftState; const APoint: TPoint); +begin + HotPart := GetPartAtPos(APoint); + if PressedPart.MajorPartIndex = nbSplitter then + DoSplitterDrag(APoint) + else + inherited; +end; + +procedure TdxNavBarNavigationPaneController.DoMouseLeave; +begin + HotPart := dxNavBarPart(nbNone); + inherited; +end; + +procedure TdxNavBarNavigationPaneController.DoSetHotPart(const APart: TdxNavBarPart); +begin + InvalidateAll(doRedraw); +end; + +procedure TdxNavBarNavigationPaneController.DoSetPressedPart(const APart: TdxNavBarPart); +begin + InvalidateAll(doRedraw); +end; + +procedure TdxNavBarNavigationPaneController.DoShowHint(var AHintInfo: THintInfo); +begin + if IsAnyItemHotTracked then + begin + if NavBar.ShowNavigationPaneOverflowPanelHints then + DoShowOverflowPanelHint(AHintInfo); + end + else + inherited; +end; + +procedure TdxNavBarNavigationPaneController.DoShowOverflowPanelHint(var AHintInfo: THintInfo); +begin + ViewInfo.HintText := GetNavPaneItemHintText; + ViewInfo.HintRect := GetNavPaneItemHintRect(AHintInfo.CursorPos); + AHintInfo.CursorRect := GetNavPaneItemHintCursorRect; +end; + +function TdxNavBarNavigationPaneController.GetNavPaneItemHintRect(const ACursorPos: TPoint): TRect; +var + ANavBarItem: TObject; +begin + case HotPart.MajorPartIndex of + nbOverflowPanelItem: ANavBarItem := ViewInfo.OverflowPanelItems[HotPart.MinorPartIndex].Group; + nbItemPanelCollapseItem: ANavBarItem := ViewInfo.ItemPanelViewInfo.Items[HotPart.MinorPartIndex].ItemLink.Item; + else + ANavBarItem := nil; + end; + Result := GetItemHintRect(ANavBarItem, CalcOverflowPanelHintRect); +end; + +function TdxNavBarNavigationPaneController.GetNavPaneItemHintText: string; +begin + case HotPart.MajorPartIndex of + nbOverflowPanelItem: + Result := RemoveAccelChars(ViewInfo.OverflowPanelItems[HotPart.MinorPartIndex].Group.Caption, False); + nbOverflowPanelSign: + Result := cxGetResourceString(@sdxNavigationPaneOverflowPanelCustomizeHint); + nbHeaderSign: + if Collapsed then + Result := cxGetResourceString(@sdxNavigationPaneExpandNavPaneSignHint) + else + Result := cxGetResourceString(@sdxNavigationPaneMinimizeNavPaneSignHint); + nbItemPanelCollapseItem: + Result := RemoveAccelChars(GetLinkHintText(ViewInfo.ItemPanelViewInfo.Items[HotPart.MinorPartIndex].ItemLink), False); + nbItemPanelCollapseBar: + Result := cxGetResourceString(@sdxNavigationPaneCollapseBarHint); + else + Result := ''; + end; +end; + +function TdxNavBarNavigationPaneController.GetNavPaneItemHintCursorRect: TRect; +begin + case HotPart.MajorPartIndex of + nbOverflowPanelItem: Result := ViewInfo.OverflowPanelItems[HotPart.MinorPartIndex].SelectionRect; + nbOverflowPanelSign: Result := ViewInfo.OverflowPanelSignRect; + nbHeaderSign: Result := ViewInfo.HeaderSignRect; + nbItemPanelCollapseItem: Result := ViewInfo.ItemPanelViewInfo.Items[HotPart.MinorPartIndex].Rect; + nbItemPanelCollapseBar: Result := ViewInfo.ItemPanelViewInfo.CollapseBarRect; + else + Result := cxNullRect; + end; +end; + +procedure TdxNavBarNavigationPaneController.DoOverflowPanelItemClick; +begin + FNavBar.ActiveGroup := OverflowPanelGroup[HotPart.MinorPartIndex] +end; + +procedure TdxNavBarNavigationPaneController.DoOverflowPanelSignClick; +var + APoint: TPoint; +begin + APoint.Y := cxRectCenter(ViewInfo.OverflowPanelSignRect).Y; + APoint.X := ViewInfo.OverflowPanelSignRect.Right; + DroppedDownPart := dxNavBarPart(nbOverflowPanelSign); + ViewInfo.DoShowPopupMenu(FNavBar.ClientToScreen(APoint)); + DroppedDownPart := dxNavBarPart(nbNone); + HotPart := GetPartAtPos(GetMouseCursorPos); +end; + +procedure TdxNavBarNavigationPaneController.DoHeaderSignClick; +begin + ChangeNavBarCollapseState; +end; + +procedure TdxNavBarNavigationPaneController.DoCollapseBarClick; +var + ALinkSelf: TcxObjectLink; +begin + if not IsPopupControlExists or not IsPopupControlVisible and not (npsPopupShowLocked in FInternalState) then + begin + DroppedDownPart := dxNavBarPart(nbItemPanelCollapseBar); + ALinkSelf := cxAddObjectLink(Self); + try + ShowPopupControl; + if ALinkSelf.Ref <> nil then + DroppedDownPart := dxNavBarPart(nbNone); + finally + cxRemoveObjectLink(ALinkSelf); + end; + end; +end; + +procedure TdxNavBarNavigationPaneController.DoCollapseItemClick; +begin + DoLinkClick(NavBar, ViewInfo.FItemPanelViewInfo.Items[HotPart.MinorPartIndex].ItemLink); +end; + +procedure TdxNavBarNavigationPaneController.DoSplitterDrag(const APoint: TPoint); +begin + if FNavBar.CanDecNavigationPaneOverflowPanelItemCount and + ViewInfo.IsPtDecNavigationPaneOverflowPanelItemCount(APoint) then + FNavBar.DoDecNavigationPaneOverflowPanelItemCount + else + if FNavBar.CanIncNavigationPaneOverflowPanelItemCount and + ViewInfo.IsPtIncNavigationPaneOverflowPanelItemCount(APoint) then + FNavBar.DoIncNavigationPaneOverflowPanelItemCount; +end; + +function TdxNavBarNavigationPaneController.CanFocusOnClick(const APoint: TPoint): Boolean; +begin + Result := not ViewInfo.IsPtNavigationPaneSplitter(APoint) and inherited CanFocusOnClick(APoint); +end; + +function TdxNavBarNavigationPaneController.GetCursor: HIcon; + + function InternalGetCursor(const APart: TdxNavBarPart; out ACursor: HIcon): Boolean; + begin + Result := not IsdxNavBarPartsEqual(APart, dxNavBarPart(nbNone)); + if IsdxNavBarPartsEqual(APart, dxNavBarPart(nbSplitter)) then + if FNavBar.ShowGroupCaptions then + ACursor := Screen.Cursors[crSizeNS] + else + ACursor := 0 + else + ACursor := Screen.Cursors[FNavBar.HotTrackedGroupCursor]; + end; + +begin + if not (InternalGetCursor(PressedPart, Result) or InternalGetCursor(HotPart, Result)) then + Result := inherited GetCursor; +end; + +function TdxNavBarNavigationPaneController.Collapsible: Boolean; +begin + Result := FNavBar.OptionsBehavior.NavigationPane.Collapsible; +end; + +function TdxNavBarNavigationPaneController.Collapsed: Boolean; +begin + Result := FNavBar.OptionsBehavior.NavigationPane.Collapsed; +end; + +procedure TdxNavBarNavigationPaneController.CollapseStateChaged(Sender: TObject); +begin + ClosePopupControl; +end; + +procedure TdxNavBarNavigationPaneController.CalcOverflowPanelHintRect(AItem: TObject; var ARect: TRect); +begin + if Assigned(NavBar.OnCalcNavigationPaneOverflowPanelHintRect) then + NavBar.OnCalcNavigationPaneOverflowPanelHintRect(NavBar, TdxNavBarGroup(AItem), ViewInfo, ARect); +end; + +procedure TdxNavBarNavigationPaneController.ChangeNavBarCollapseState; +begin + FNavBar.OptionsBehavior.NavigationPane.Collapsed := not Collapsed; +end; + +function TdxNavBarNavigationPaneController.IsAnyItemHotTracked: Boolean; +begin + Result := not IsdxNavBarPartsEqual(HotPart, dxNavBarPart(nbNone)); +end; + +function TdxNavBarNavigationPaneController.IsPopupControlExists: Boolean; +begin + Result := FPopupControl <> nil; +end; + +function TdxNavBarNavigationPaneController.IsPopupControlVisible: Boolean; +begin + Result := IsPopupControlExists and FPopupControl.Visible; +end; + +function TdxNavBarNavigationPaneController.IsOverflowPanelGroupHotTracked: Boolean; +begin + Result := HotPart.MajorPartIndex = nbOverflowPanelItem; +end; + +function TdxNavBarNavigationPaneController.GetNavPanePartState(const APart: TdxNavBarPart): TdxNavBarNavPanePartState; +var + AGroup: TdxNavBarGroup; +begin + if APart.MajorPartIndex = nbOverflowPanelItem then + AGroup := OverflowPanelGroup[APart.MinorPartIndex] + else + AGroup := nil; + + if (AGroup <> nil) and (FNavBar.ActiveGroup = AGroup) then + begin + if IsdxNavBarPartsEqual(HotPart, APart) and (IsdxNavBarPartsEqual(PressedPart, dxNavBarPart(nbNone)) or IsdxNavBarPartsEqual(PressedPart, APart)) then + Result := oisHotCheck + else + Result := oisChecked + end + else + if IsdxNavBarPartsEqual(FDroppedDownPart, APart) then + Result := oisDroppedDown + else + if IsdxNavBarPartsEqual(PressedPart, APart) then + if IsdxNavBarPartsEqual(HotPart, APart) then + Result := oisPressed + else + Result := oisNormal + else + if IsdxNavBarPartsEqual(HotPart, APart) and IsdxNavBarPartsEqual(PressedPart, dxNavBarPart(nbNone)) then + Result := oisHot + else + Result := oisNormal; +end; + +function TdxNavBarNavigationPaneController.GetOriginalWidth: Integer; +begin + Result := TdxCustomNavBarAccess(FNavBar).OriginalWidth; +end; + +function TdxNavBarNavigationPaneController.GetPartAtPos(const APoint: TPoint): TdxNavBarPart; +begin + Result.MinorPartIndex := ViewInfo.FOverflowPanelViewInfo.GetItemIndexAtPos(APoint); + if (Result.MinorPartIndex <> nbNone) then + Result.MajorPartIndex := nbOverflowPanelItem + else + if ViewInfo.IsPtNavigationPaneOverflowPanelSign(APoint) then + Result.MajorPartIndex := nbOverflowPanelSign + else + if ViewInfo.IsPtNavigationPaneHeaderSign(APoint) then + Result.MajorPartIndex := nbHeaderSign + else + if ViewInfo.IsPtNavigationPaneSplitter(APoint) then + Result.MajorPartIndex := nbSplitter + else + if Collapsed and ViewInfo.IsPtNavigationPaneItemPanel(APoint) then + begin + Result.MinorPartIndex := ViewInfo.FItemPanelViewInfo.GetItemIndexAtPos(APoint); + if Result.MinorPartIndex <> nbNone then + Result.MajorPartIndex := nbItemPanelCollapseItem + else + Result.MajorPartIndex := nbItemPanelCollapseBar; + end + else + Result := inherited GetPartAtPos(APoint); +end; + +function TdxNavBarNavigationPaneController.GetViewInfo: TdxNavBarNavigationPaneViewInfo; +begin + Result := TdxNavBarNavigationPaneViewInfo(inherited ViewInfo); +end; + +function TdxNavBarNavigationPaneController.GetOverflowPanelGroup(AIndex: Integer): TdxNavBarGroup; +begin + Result := ViewInfo.FOverflowPanelViewInfo.Items[AIndex].Group; +end; + +procedure TdxNavBarNavigationPaneController.SetDroppedDownPart(APart: TdxNavBarPart); +begin + if not IsdxNavBarPartsEqual(FDroppedDownPart, APart) then + begin + FDroppedDownPart := APart; + InvalidateAll(doRedraw); + end; +end; + +procedure TdxNavBarNavigationPaneController.SetOriginalWidth(AValue: Integer); +begin + TdxCustomNavBarAccess(FNavBar).OriginalWidth := AValue; +end; + +{ TdxNavBarNavigationPanePainter } + +procedure TdxNavBarNavigationPanePainter.DrawNavBarControl; +begin + inherited DrawNavBarControl; + DrawHeader; + DrawItemPanel; + DrawOverflowPanel; + DrawSplitter; + DrawBorder; + if TdxCustomNavBarAccess(NavBar).IsInternal then + DrawSizeGrip(Canvas, ViewInfo.SizeGripRect); +end; + +procedure TdxNavBarNavigationPanePainter.DrawGroupCaption(AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + DrawGroupCaptionButton(AGroupViewInfo); + if not Controller.Collapsed then + DrawGroupCaptionText(AGroupViewInfo); + if AGroupViewInfo.IsCaptionImageVisible then + DrawGroupCaptionImage(AGroupViewInfo); +end; + +procedure TdxNavBarNavigationPanePainter.DrawSizeGrip(ACanvas: TCanvas; const ARect: TRect); +const + ASpace = 4; + ALineCount = 3; +var + I: Integer; + AStartPoint: TPoint; +begin + ACanvas.Pen.Color := clBlack; + AStartPoint := cxRectOffset(ARect, -ViewInfo.BorderWidth, -ViewInfo.BorderWidth).BottomRight; + Dec(AStartPoint.Y); + for I := 0 to ALineCount - 1 do + with AStartPoint do + begin + ACanvas.MoveTo(X - ASpace * (I + 1), Y); + ACanvas.LineTo(X, Y - ASpace* (I + 1)); + end; +end; + +procedure TdxNavBarNavigationPanePainter.DrawHintWindow(AHintWindow: TdxNavBarHintWindow); +begin + if Controller.IsAnyItemHotTracked then + DrawOverflowPanelHintWindow(AHintWindow.Canvas, AHintWindow.ClientRect) + else + inherited; +end; + +procedure TdxNavBarNavigationPanePainter.DrawItemPanel; +var + I: Integer; +begin + if Controller.Collapsed then + begin + DrawCollapseBar(ViewInfo.FItemPanelViewInfo); + for I := 0 to ViewInfo.FItemPanelViewInfo.ItemCount - 1 do + DrawCollapseItem(ViewInfo.FItemPanelViewInfo.Items[I], GetNavPanePartState(dxNavBarPart(nbItemPanelCollapseItem, I))); + end; +end; + +procedure TdxNavBarNavigationPanePainter.DrawGroupCaptionButton(AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + with AGroupViewInfo do + TdxNavBarOffice11NavPaneGroupButtonPainter.DrawButton(Canvas, CaptionRect, CaptionImage, + CaptionBackColor, CaptionBackColor2, CaptionAlphaBlend, CaptionAlphaBlend2, + CaptionGradientMode, CaptionBorderColor, State); +end; + +procedure TdxNavBarNavigationPanePainter.DrawCollapseBar(AItemPanelViewInfo: TdxNavBarItemPanelViewInfo); +var + AState: TdxNavBarNavPanePartState; +begin + AState := GetNavPanePartState(dxNavBarPart(nbItemPanelCollapseBar)); + DrawCollapseElementBackground(AItemPanelViewInfo.CollapseBarRect, AState); + DrawVertivalText(AItemPanelViewInfo.CollapseBarFont, AItemPanelViewInfo.CollapseBarText, AItemPanelViewInfo.CollapseBarRect, AState); + if AItemPanelViewInfo.CollapseBarIAccessibilityHelper.IsFocused then + DrawItemPanelPartFocusRect(AItemPanelViewInfo.CollapseBarRect); +end; + +procedure TdxNavBarNavigationPanePainter.DrawCollapseElementBackground(const ARect: TRect; AState: TdxNavBarNavPanePartState); +begin + case AState of + oisNormal: + begin + Canvas.Brush.Color := GetMiddleRGB(ViewInfo.OverflowPanelBackColor, ViewInfo.OverflowPanelBackColor2, 50); + Canvas.FillRect(ARect); + end; + else + DrawOverflowPanelItemBackground(Canvas, AState, ARect); + end; + cxCanvas.FrameRect(ARect, clBlack, 1, [bBottom]); +end; + +procedure TdxNavBarNavigationPanePainter.DrawCollapseItem(AItemViewInfo: TdxNavBarItemPanelViewInfoItem; AState: TdxNavBarNavPanePartState); +begin + DrawCollapseElementBackground(AItemViewInfo.Rect, AState); + DrawVertivalText(AItemViewInfo.Font, AItemViewInfo.Caption, AItemViewInfo.TextRect, AState); + if ImagePainterClass.IsValidImage(AItemViewInfo.ImageList, AItemViewInfo.ImageIndex) then + ImagePainterClass.DrawImage(Canvas, AItemViewInfo.ImageList, AItemViewInfo.ImageIndex, AItemViewInfo.ImageRect); + if ViewInfo.ItemPanelViewInfo.ItemIAccessibilityHelpers[AItemViewInfo.Index].IsFocused then + DrawItemPanelPartFocusRect(AItemViewInfo.Rect); +end; + +procedure TdxNavBarNavigationPanePainter.DrawBorder; +var + ABorderRect: TRect; +begin + with cxCanvas do + begin + SaveClipRegion; + try + ABorderRect := cxRectBounds(0, 0, ViewInfo.ClientWidth, ViewInfo.ClientHeight); + SetClipRegion(TcxRegion.Create(cxRectInflate(ABorderRect, - ViewInfo.BorderWidth, - ViewInfo.BorderWidth)), + roSubtract); + FillRect(ABorderRect, ViewInfo.BorderColor); + finally + RestoreClipRegion; + end; + end; +end; + +procedure TdxNavBarNavigationPanePainter.DrawHeader; +var + AHandled: Boolean; +begin + if not ViewInfo.IsHeaderVisible then Exit; + AHandled := False; + if Assigned(NavBar.OnCustomDrawNavigationPaneHeader) then + NavBar.OnCustomDrawNavigationPaneHeader(NavBar, Canvas, ViewInfo, AHandled); + if not AHandled then + DoDrawHeader; +end; + +procedure TdxNavBarNavigationPanePainter.DrawHeaderBackground; +var + R: TRect; +begin + R := ViewInfo.HeaderRect; + Inc(R.Top); + with ViewInfo do + BackgroundPainterClass.DrawBackground(Canvas, R, HeaderImage, False, clNone, + HeaderBackColor, HeaderBackColor2, HeaderAlphaBlend, HeaderAlphaBlend2, + OverflowPanelGradientMode); +end; + +procedure TdxNavBarNavigationPanePainter.DrawHeaderSign; +const + AStateMap: array[Boolean] of TdxNavBarObjectStates = ([sExpanded], []); +var + ACanvas: TcxCanvas; + ABitmap: TcxCustomBitmap; + ASignColor: TColor; +begin + ABitmap := TcxCustomBitmap.CreateSize(ViewInfo.FHeaderSignRect); + try + ACanvas := ABitmap.cxCanvas; + + case GetNavPanePartState(dxNavBarPart(nbHeaderSign)) of + oisNormal: + begin + ASignColor := ViewInfo.HeaderFontColor; + ACanvas.CopyRect(ABitmap.ClientRect, Canvas, ViewInfo.FHeaderSignRect); + end; + else + ASignColor := clBlack; + DrawOverflowPanelItemBackground(ACanvas.Canvas, dxNavBarPart(nbHeaderSign), ABitmap.ClientRect); + end; + + ABitmap.Rotate(raMinus90); + TdxNavBarOffice11ExplorerBarSignPainter.DrawSign(ACanvas.Canvas, ABitmap.ClientRect, + ASignColor, clNone, clNone, AStateMap[Controller.Collapsed]); + ABitmap.Rotate(raPlus90); + + with ViewInfo.FHeaderSignRect.TopLeft do + Canvas.Draw(X, Y, ABitmap); + finally + ABitmap.Free; + end; +end; + +procedure TdxNavBarNavigationPanePainter.DrawHeaderText; +var + R: TRect; + AText: string; +begin + with ViewInfo do + begin + R := FHeaderTextRect; + Inc(R.Left, ViewInfo.GetGroupHeaderTextIndent); + + if (NavBar.ActiveGroup <> nil) and NavBar.ActiveGroup.Visible then + AText := RemoveAccelChars(NavBar.ActiveGroup.Caption) + else + AText := ''; + Canvas.Brush.Style := bsClear; + Canvas.Font := HeaderFont; + Canvas.Font.Color := HeaderFontColor; + cxDrawText(DC, AText, R, HeaderDrawEdgeFlag or DT_NOPREFIX); + end; +end; + +procedure TdxNavBarNavigationPanePainter.DrawOverflowPanel; +var + AHandled: Boolean; +begin + if not OverflowPanelViewInfo.IsVisible then Exit; + AHandled := False; + if Assigned(NavBar.OnCustomDrawNavigationPaneOverflowPanel) then + NavBar.OnCustomDrawNavigationPaneOverflowPanel(NavBar, Canvas, ViewInfo, AHandled); + if not AHandled then + DoDrawOverflowPanel; +end; + +procedure TdxNavBarNavigationPanePainter.DrawOverflowPanelBackground; +begin + with ViewInfo do + TdxNavBarOffice11NavPaneGroupButtonPainter.DrawButton(Canvas, OverflowPanelRect, OverflowPanelImage, + OverflowPanelBackColor, OverflowPanelBackColor2, OverflowPanelAlphaBlend, + OverflowPanelAlphaBlend2, OverflowPanelGradientMode, BorderColor, []); +end; + +procedure TdxNavBarNavigationPanePainter.DrawOverflowPanelSign; +var + R: TRect; +begin + if dxOffice11NavPaneOverflowPanelBitmap <> nil then + begin + R := ViewInfo.OverflowPanelSignRect; + if R.Left > ViewInfo.OverflowPanelRect.Left then + begin + DrawOverflowPanelItemBackground(Canvas, dxNavBarPart(nbOverflowPanelSign), R); + + with cxRectCenter(R, dxOffice11NavPaneOverflowPanelBitmap.Width, dxOffice11NavPaneOverflowPanelBitmap.Height).TopLeft do + Canvas.Draw(X, Y, dxOffice11NavPaneOverflowPanelBitmap); +// if ViewInfo.OverflowPanelSignIAccessibilityHelper.IsFocused then +// begin +// R := Bounds(X, Y, dxOffice11NavPaneOverflowPanelBitmap.Width, +// dxOffice11NavPaneOverflowPanelBitmap.Height); +// InflateRect(R, 1, 1); +// DrawSolidFocusRect(R, clBlack); +// end; + end; + end; +end; + +procedure TdxNavBarNavigationPanePainter.DrawOverflowPanelItems; +var + I: Integer; + AGroup: TdxNavBarGroup; + R: TRect; +begin + for I := 0 to ViewInfo.OverflowPanelVisibleItemCount - 1 do + begin + R := ViewInfo.OverflowPanelItems[I].SelectionRect; + DrawOverflowPanelItemBackground(Canvas, dxNavBarPart(nbOverflowPanelItem, I), R); + + R := ViewInfo.OverflowPanelItems[I].Rect; + AGroup := ViewInfo.OverflowPanelItems[I].Group; + if ImagePainterClass.IsValidImage(ViewInfo.FOverflowPanelViewInfo.GetImageList, ViewInfo.FOverflowPanelViewInfo.GetImageIndex(AGroup)) then + ImagePainterClass.DrawImage(Canvas, ViewInfo.FOverflowPanelViewInfo.GetImageList, ViewInfo.FOverflowPanelViewInfo.GetImageIndex(AGroup), R) + else + if NavBar.NavigationPaneOverflowPanelUseSmallImages then + Canvas.Draw(R.Left, R.Top, dxOffice11NavPaneDefaultSmallBitmap) + else + Canvas.Draw(R.Left, R.Top, dxOffice11NavPaneDefaultLargeBitmap); +// if ViewInfo.OverflowPanelItemIAccessibilityHelpers[I].IsFocused then +// begin +// InflateRect(R, 1, 1); +// DrawSolidFocusRect(R, clBlack); +// end; + end; +end; + +procedure TdxNavBarNavigationPanePainter.DrawOverflowPanelHintWindow(ACanvas: TCanvas; const ARect: TRect); +var + AHandled: Boolean; + AGroup: TdxNavBarGroup; +begin + AHandled := False; + if Assigned(NavBar.OnCustomDrawNavigationPaneOverflowPanelHint) then + begin + if Controller.IsOverflowPanelGroupHotTracked then + AGroup := ViewInfo.OverflowPanelItems[Controller.HotPart.MinorPartIndex].Group + else + AGroup := nil; + NavBar.OnCustomDrawNavigationPaneOverflowPanelHint(NavBar, ACanvas, AGroup, + NavBar.ViewInfo.HintText, ARect, AHandled); + end; + if not AHandled then + with ViewInfo do + TdxNavBarCustomHintPainter.DrawHint(ACanvas, ARect, + ViewInfo.HintText, HintImage, HintBackColor, HintBackColor2, + HintAlphaBlend, HintAlphaBlend2, HintGradientMode, HintFont); +end; + +procedure TdxNavBarNavigationPanePainter.DrawPopupControl(ACanvas: TcxCanvas; AViewInfo: TdxNavBarPopupControlViewInfo); +begin + ACanvas.FrameRect(AViewInfo.FRect, ViewInfo.BorderColor); + ACanvas.SaveClipRegion; + try + ACanvas.ExcludeClipRect(AViewInfo.ClientRect); + ACanvas.FillRect(cxRectInflate(AViewInfo.FRect, -1, -1), $EEC6A9); + finally + ACanvas.RestoreClipRegion; + end; +end; + +procedure TdxNavBarNavigationPanePainter.DrawSplitter; +var + AHandled: Boolean; +begin + if not ViewInfo.IsSplitterVisible then Exit; + AHandled := False; + if Assigned(NavBar.OnCustomDrawNavigationPaneSplitter) then + NavBar.OnCustomDrawNavigationPaneSplitter(NavBar, Canvas, ViewInfo, AHandled); + if not AHandled then + DoDrawSplitter; +end; + +procedure TdxNavBarNavigationPanePainter.DrawSplitterSign; +var + APoint: TPoint; +begin + if dxOffice11NavPaneSplitterBitmap <> nil then + begin + APoint := cxRectCenter(ViewInfo.SplitterRect, dxOffice11NavPaneSplitterBitmap.Width, dxOffice11NavPaneSplitterBitmap.Height).TopLeft; + if APoint.X > ViewInfo.OverflowPanelRect.Left then + Canvas.Draw(APoint.X, APoint.Y, dxOffice11NavPaneSplitterBitmap); + end; +end; + +procedure TdxNavBarNavigationPanePainter.DrawPopupMenuItem(ACanvas: TCanvas; ARect: TRect; AImageList: TCustomImageList; + AImageIndex: Integer; AText: string; State: TdxNavBarObjectStates); +var + R: TRect; +begin + BackgroundPainterClass.DrawBackground(ACanvas, ARect, nil, False, clNone, + clMenu, clMenu, 255, 255, gmVertical); + R := ARect; + R.Right := R.Left + 2 * ViewInfo.FOverflowPanelViewInfo.GetPopupMenuImageIndent + ViewInfo.GetSmallImageWidth; + BackgroundPainterClass.DrawBackground(ACanvas, R, nil, False, clNone, dxOffice11NavPaneGroupCaptionColor1, + dxOffice11NavPaneGroupCaptionColor2, 255, 255, gmHorizontal); + + if AText <> '-' then + begin + InflateRect(R, -1, -1); + if sSelected in State then + begin + ButtonPainterClass.DrawButton(ACanvas, ARect, nil, dxOffice11NavPaneGroupCaptionHotColor1, + dxOffice11NavPaneGroupCaptionHotColor2, 255, 255, gmVertical, dxOffice11NavPaneBorder, []); + if sActive in State then + ButtonPainterClass.DrawButton(ACanvas, R, nil, dxOffice11NavPaneGroupCaptionPressedColor1, + dxOffice11NavPaneGroupCaptionPressedColor2, 255, 255, gmVertical, dxOffice11NavPaneBorder, []); + end + else if sActive in State then + ButtonPainterClass.DrawButton(ACanvas, R, nil, dxOffice11NavPaneGroupCaptionHotColor1, + dxOffice11NavPaneGroupCaptionHotColor1, 255, 255, gmVertical, dxOffice11NavPaneBorder, []); + + InflateRect(R, 1 - ViewInfo.FOverflowPanelViewInfo.GetPopupMenuImageIndent, 1 - ViewInfo.FOverflowPanelViewInfo.GetPopupMenuImageIndent); + AImageList.Draw(ACanvas, R.Left, R.Top, AImageIndex, not (sDisabled in State)); + + R := ARect; + R.Left := R.Left + 2 * ViewInfo.FOverflowPanelViewInfo.GetPopupMenuImageIndent + ViewInfo.GetSmallImageWidth + ViewInfo.FOverflowPanelViewInfo.GetPopupMenuTextIndent; + if sDisabled in State then + ACanvas.Font.Color := clGrayText + else ACanvas.Font.Color := clMenuText; + ACanvas.Brush.Style := bsClear; + cxDrawText(ACanvas.Handle, AText, R, DT_LEFT or DT_VCENTER or DT_SINGLELINE); + end + else + begin + ACanvas.Pen.Color := Dark(dxOffice11NavPaneGroupCaptionColor2, 80); + ACanvas.MoveTo(R.Right + cxRectWidth(R) div 2, R.Top + cxRectHeight(ARect) div 2); + ACanvas.LineTo(ARect.Right, R.Top + cxRectHeight(ARect) div 2); + end; +end; + +function TdxNavBarNavigationPanePainter.CreatePopupControlViewInfo: TdxNavBarPopupControlViewInfo; +begin + Result := GetPopupControlViewInfoClass.Create(NavBar.ViewInfo); +end; + +class function TdxNavBarNavigationPanePainter.ButtonPainterClass: TdxNavBarCustomButtonPainterClass; +begin + Result := TdxNavBarNavigationPaneButtonPainter; +end; + +class function TdxNavBarNavigationPanePainter.GetViewInfoClass: TdxNavBarViewInfoClass; +begin + Result := TdxNavBarNavigationPaneViewInfo; +end; + +class function TdxNavBarNavigationPanePainter.GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; +begin + Result := TdxNavBarNavigationPaneGroupViewInfo; +end; + +function TdxNavBarNavigationPanePainter.GetControllerClass: TdxNavBarControllerClass; +begin + if TdxCustomNavBarAccess(NavBar).IsInternal then + Result := TdxNavBarPopupInnerControlController + else + Result := TdxNavBarNavigationPaneController; +end; + +class function TdxNavBarNavigationPanePainter.GetPopupControlViewInfoClass: TdxNavBarPopupControlViewInfoClass; +begin + Result := TdxNavBarPopupControlViewInfo; +end; + +function TdxNavBarNavigationPanePainter.GetNavPanePartState(const APart: TdxNavBarPart): TdxNavBarNavPanePartState; +begin + Result := Controller.GetNavPanePartState(APart); + if (Result = oisNormal) and ViewInfo.NavPanePartIAccessibilityHelpers[APart].IsPressed then + Result := oisPressed; + if (Result = oisNormal) and + (APart.MajorPartIndex in [nbOverflowPanelSign, nbOverflowPanelItem, nbHeaderSign]) and + ViewInfo.NavPanePartIAccessibilityHelpers[APart].IsFocused then + Result := oisHot; +end; + +procedure TdxNavBarNavigationPanePainter.DoDrawHeader; +begin + DrawHeaderBackground; + if not Controller.Collapsed then + DrawHeaderText; + if Controller.Collapsible then + DrawHeaderSign; +end; + +procedure TdxNavBarNavigationPanePainter.DoDrawOverflowPanel; +begin + DrawOverflowPanelBackground; + DrawOverflowPanelSign; + DrawOverflowPanelItems; +end; + +procedure TdxNavBarNavigationPanePainter.DoDrawSplitter; +var + R: TRect; +begin + with ViewInfo do + begin + Canvas.Brush.Color := clWhite; + R := SplitterRect; + Canvas.FillRect(Rect(R.Left, R.Top, R.Right, R.Top + 1)); + Inc(R.Top); + BackgroundPainterClass.DrawBackground(Canvas, R, nil, False, clNone, + SplitterBackColor, SplitterBackColor2, SplitterAlphaBlend, SplitterAlphaBlend2, + SplitterGradientMode); + end; + DrawSplitterSign; +end; + +function TdxNavBarNavigationPanePainter.GetViewInfo: TdxNavBarNavigationPaneViewInfo; +begin + if inherited ViewInfo is TdxNavBarNavigationPaneViewInfo then + Result := inherited ViewInfo as TdxNavBarNavigationPaneViewInfo + else Result := nil; +end; + +function TdxNavBarNavigationPanePainter.GetController: TdxNavBarNavigationPaneController; +begin + Result := TdxNavBarNavigationPaneController(inherited Controller); +end; + +function TdxNavBarNavigationPanePainter.GetOverflowPanelViewInfo: TdxNavBarOverflowPanelViewInfo; +begin + Result := ViewInfo.FOverflowPanelViewInfo; +end; + +procedure TdxNavBarNavigationPanePainter.DrawItemPanelPartFocusRect( + const APartRect: TRect); +begin + DrawSolidFocusRect(cxRectInflate(APartRect, -1, -0, -1, -1), + ViewInfo.HeaderFontColor); +end; + +procedure TdxNavBarNavigationPanePainter.DrawVertivalText(AFont: TFont; const AText: string; const ARect: TRect; AState: TdxNavBarNavPanePartState); +var + ACanvas: TcxCanvas; + ADrawRect, ABackgroundRect: TRect; + ABitmap: TcxCustomBitmap; +begin + ADrawRect := cxGetTextRect(AFont, AText, 1); + ABitmap := TcxCustomBitmap.CreateSize(cxRectRotate(ADrawRect)); + try + ACanvas := ABitmap.cxCanvas; + + ABackgroundRect := cxRectCenter(ARect, ABitmap.Width, ABitmap.Height); + ACanvas.CopyRect(cxRectRotate(ADrawRect), Canvas, ABackgroundRect); + + ABitmap.Rotate(raMinus90); + ACanvas.Brush.Style := bsClear; + ACanvas.Font := AFont; + + ACanvas.Font.Color := ViewInfo.CollapseBarFontColor; +{ + if AState = oisNormal then + ACanvas.Font.Color := ViewInfo.BorderColor + else + ACanvas.Font.Color := ViewInfo.HeaderFontColor; +} + cxDrawText(ACanvas.Handle, AText, ADrawRect, DT_CENTER or DT_VCENTER or DT_SINGLELINE); + ABitmap.Rotate(raPlus90); + + cxCanvas.SaveClipRegion; + try + cxCanvas.SetClipRegion(TcxRegion.Create(ARect), roIntersect); + with ABackgroundRect.TopLeft do + Canvas.Draw(X, Y, ABitmap); + finally + cxCanvas.RestoreClipRegion; + end; + finally + ABitmap.Free; + end; +end; + +procedure TdxNavBarNavigationPanePainter.DrawOverflowPanelItemBackground(ACanvas: TCanvas; AState: TdxNavBarNavPanePartState; const ARect: TRect); +var + AColor1, AColor2: TColor; +begin + case AState of + oisPressed, oisHotCheck, oisDroppedDown: + begin + AColor1 := dxOffice11NavPaneGroupCaptionPressedHotColor1; + AColor2 := dxOffice11NavPaneGroupCaptionPressedHotColor2; + end; + oisChecked: + begin + AColor1 := dxOffice11NavPaneGroupCaptionPressedColor1; + AColor2 := dxOffice11NavPaneGroupCaptionPressedColor2; + end; + oisHot: + begin + AColor1 := dxOffice11NavPaneGroupCaptionHotColor1; + AColor2 := dxOffice11NavPaneGroupCaptionHotColor2; + end; + else {oisNormal} + AColor1 := clNone; + AColor2 := clNone; + end; + + if (AColor1 <> clNone) and (AColor2 <> clNone) then + BackgroundPainterClass.DrawBackground(ACanvas, ARect, nil, False, clNone, + AColor1, AColor2, 255, 255, gmVertical); +end; + +procedure TdxNavBarNavigationPanePainter.DrawOverflowPanelItemBackground(ACanvas: TCanvas; const APart: TdxNavBarPart; const ARect: TRect); +begin + DrawOverflowPanelItemBackground(ACanvas, GetNavPanePartState(APart), ARect); +end; + +{ TdxNavBarNavigationPaneButtonPainter } + +class procedure TdxNavBarNavigationPaneButtonPainter.InternalDrawButton(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; + AState: TdxNavBarObjectStates); +begin + inherited; + ACanvas.Brush.Style := bsClear; + ACanvas.Pen.Color := ColorToRGB(ABorderColor); + ACanvas.Pen.Style := psSolid; + ACanvas.Pen.Width := 1; + ACanvas.Rectangle(ARect.Left, ARect.Top, ARect.Right, ARect.Bottom); +end; + +{ TdxNavBarOffice11NavPanePainter } + +class function TdxNavBarOffice11NavPanePainter.GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; +begin + Result := TdxNavBarOffice11NavPaneGroupViewInfo; +end; + +class function TdxNavBarOffice11NavPanePainter.GetViewInfoClass: TdxNavBarViewInfoClass; +begin + Result := TdxNavBarOffice11NavPaneViewInfo; +end; + +class function TdxNavBarOffice11NavPanePainter.ButtonPainterClass: TdxNavBarCustomButtonPainterClass; +begin + Result := TdxNavBarOffice11NavPaneButtonPainter; +end; + +{ TdxNavBarOffice11NavPaneGroupButtonPainter } + +class procedure TdxNavBarOffice11NavPaneGroupButtonPainter.InternalDrawButton(ACanvas: TCanvas; ARect: TRect; + APicture: TPicture; AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; AState: TdxNavBarObjectStates); +var + ABackgroundRect: TRect; +begin + ABackgroundRect := ARect; + Inc(ABackgroundRect.Top); + inherited InternalDrawButton(ACanvas, ABackgroundRect, APicture, AColor1, AColor2, + AAlphaBlend1, AAlphaBlend2, AGradientMode, ABorderColor, AState); + ACanvas.Pen.Color := ColorToRGB(ABorderColor); + ACanvas.Pen.Style := psSolid; + ACanvas.Pen.Width := 1; + ACanvas.MoveTo(ARect.Left, ARect.Top); + ACanvas.LineTo(ARect.Right, ARect.Top); +end; + +{ TdxNavBarOffice11SignPainter } + +class procedure TdxNavBarOffice11SignPainter.PrepareBitmap(ACanvas: TCanvas; + ABitmap: TBitmap; ABackColor1, ABackColor2: TColor; AState: TdxNavBarObjectStates); +var + ABitmapColors: TRGBColors; + ATransparentColor, APixelColor: COLORREF; + AMinValue, AMaxValue, AValue: Byte; + I, J: Integer; +begin + if sExpanded in AState then + ABitmap.Assign(dxOffice11CaptionCollapseSignBitmap) + else + ABitmap.Assign(dxOffice11CaptionExpandSignBitmap); + + ABitmapColors := GetBitmapBits(ABitmap, True); + + RGBQuadToColorRef(ABitmapColors[0], ATransparentColor); + + AMaxValue := 1; + AMinValue := 255; + for I := 0 to ABitmap.Width - 1 do + for J := 0 to ABitmap.Height - 1 do + begin + RGBQuadToColorRef(ABitmapColors[J * ABitmap.Width + I], APixelColor); + if (APixelColor <> ATransparentColor) and (APixelColor <> 0{mark}) then + begin + AValue := GetRValue(APixelColor); + AMaxValue := Max(AMaxValue, AValue); + AMinValue := Min(AMinValue, AValue); + end; + end; + + for I := 0 to ABitmap.Width - 1 do + for J := 0 to ABitmap.Height - 1 do + begin + RGBQuadToColorRef(ABitmapColors[J * ABitmap.Width + I], APixelColor); + if (APixelColor <> ATransparentColor) and (APixelColor <> 0{mark}) then + begin + AValue := GetRValue(APixelColor); + APixelColor := GetMiddleRGB(ColorToRGB(ABackColor1), ColorToRGB(ABackColor2), + MulDiv(AValue - AMinValue, 100, AMaxValue - AMinValue)); + ColorRefToRGBQuad(APixelColor, ABitmapColors[J * ABitmap.Width + I]); + end; + end; + + SetBitmapBits(ABitmap, ABitmapColors, True); + ABitmap.Transparent := True; +end; + +class procedure TdxNavBarOffice11SignPainter.InternalDrawSign(ACanvas: TCanvas; ARect: TRect; + AForeColor, ABackColor1, ABackColor2: TColor; AState: TdxNavBarObjectStates); +var + ABitmap: TBitmap; +begin + ABitmap := TBitmap.Create; + try + PrepareBitmap(ACanvas, ABitmap, ABackColor1, ABackColor2, AState); + ACanvas.Draw(ARect.Left, ARect.Top, ABitmap); + finally + ABitmap.Free; + end; +end; + +{ TdxNavBarItemCollectionAccessibilityHelper } + +constructor TdxNavBarItemCollectionAccessibilityHelper.Create( + AOwnerObject: TObject; AOwnerObjectControl: TWinControl); +begin + inherited Create(AOwnerObject, AOwnerObjectControl); + FItemIAccessibilityHelpers := TInterfaceList.Create; +end; + +destructor TdxNavBarItemCollectionAccessibilityHelper.Destroy; +begin + SetItemIAccessibilityHelperCount(0); + FreeAndNil(FItemIAccessibilityHelpers); + inherited Destroy; +end; + +procedure TdxNavBarItemCollectionAccessibilityHelper.CheckItemIAccessibilityHelperCount; +begin + SetItemIAccessibilityHelperCount(GetActualItemCount); +end; + +function TdxNavBarItemCollectionAccessibilityHelper.GetChild( + AIndex: Integer): TcxAccessibilityHelper; +begin + if AIndex < inherited GetChildCount then + Result := inherited GetChild(AIndex) + else + begin + Dec(AIndex, inherited GetChildCount); + CheckItemIAccessibilityHelperCount; + Result := ItemIAccessibilityHelpers[AIndex].GetHelper; + end; +end; + +function TdxNavBarItemCollectionAccessibilityHelper.GetChildCount: Integer; +begin + Result := inherited GetChildCount; + CheckItemIAccessibilityHelperCount; + Inc(Result, ItemIAccessibilityHelperCount); +end; + +function TdxNavBarItemCollectionAccessibilityHelper.IsContainer: Boolean; +begin + Result := True; +end; + +function TdxNavBarItemCollectionAccessibilityHelper.GetItemIAccessibilityHelper( + AIndex: Integer): IdxNavBarAccessibilityHelper; +begin + CheckItemIAccessibilityHelperCount; + Result := FItemIAccessibilityHelpers[AIndex] as IdxNavBarAccessibilityHelper; +end; + +function TdxNavBarItemCollectionAccessibilityHelper.GetItemIAccessibilityHelperCount: Integer; +begin + CheckItemIAccessibilityHelperCount; + Result := FItemIAccessibilityHelpers.Count; +end; + +procedure TdxNavBarItemCollectionAccessibilityHelper.SetItemIAccessibilityHelperCount( + Value: Integer); +var + AIAccessibilityHelper: IdxNavBarAccessibilityHelper; + I: Integer; +begin + if FItemIAccessibilityHelpers.Count <> Value then + if FItemIAccessibilityHelpers.Count < Value then + for I := 1 to Value - FItemIAccessibilityHelpers.Count do + begin + AIAccessibilityHelper := NavBarGetAccessibilityHelper(GetItemAccessibilityHelperClass.Create(Self, + OwnerObjectControl)); + (AIAccessibilityHelper.GetHelper as TdxNavBarItemCollectionItemAccessibilityHelper).ItemIndex := + FItemIAccessibilityHelpers.Count; + FItemIAccessibilityHelpers.Add(AIAccessibilityHelper); + end + else + for I := FItemIAccessibilityHelpers.Count - 1 downto Value do + begin + AIAccessibilityHelper := FItemIAccessibilityHelpers[I] as IdxNavBarAccessibilityHelper; + NavBarAccessibleObjectOwnerObjectDestroyed(AIAccessibilityHelper); + FItemIAccessibilityHelpers.Delete(I); + end; +end; + +{ TdxNavBarNavigationPaneOverflowPanelAccessibilityHelper } + +destructor TdxNavBarNavigationPaneOverflowPanelAccessibilityHelper.Destroy; +begin + NavBarAccessibleObjectOwnerObjectDestroyed(FSignIAccessibilityHelper); + inherited Destroy; +end; + +function TdxNavBarNavigationPaneOverflowPanelAccessibilityHelper.GetChild( + AIndex: Integer): TcxAccessibilityHelper; +begin + if AIndex < inherited GetChildCount then + Result := inherited GetChild(AIndex) + else + Result := SignIAccessibilityHelper.GetHelper; +end; + +function TdxNavBarNavigationPaneOverflowPanelAccessibilityHelper.GetChildCount: Integer; +begin + Result := inherited GetChildCount + 1; +end; + +function TdxNavBarNavigationPaneOverflowPanelAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := ViewInfo.NavBar.IAccessibilityHelper.GetHelper; +end; + +function TdxNavBarNavigationPaneOverflowPanelAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := Parent.States[cxAccessibleObjectSelfID]; + if not ViewInfo.IsVisible then + Result := Result or cxSTATE_SYSTEM_INVISIBLE; +end; + +function TdxNavBarNavigationPaneOverflowPanelAccessibilityHelper.GetActualItemCount: Integer; +begin + Result := ViewInfo.ItemCount; +end; + +function TdxNavBarNavigationPaneOverflowPanelAccessibilityHelper.GetBounds: TRect; +begin + Result := ViewInfo.FRect; +end; + +function TdxNavBarNavigationPaneOverflowPanelAccessibilityHelper.GetItemAccessibilityHelperClass: TdxNavBarItemCollectionItemAccessibilityHelperClass; +begin + Result := TdxNavBarNavigationPaneOverflowPanelItemAccessibilityHelper; +end; + +function TdxNavBarNavigationPaneOverflowPanelAccessibilityHelper.GetSignAccessibilityHelperClass: TdxNavBarCustomAccessibilityHelperClass; +begin + Result := TdxNavBarNavigationPaneOverflowPanelSignAccessibilityHelper; +end; + +function TdxNavBarNavigationPaneOverflowPanelAccessibilityHelper.GetSignIAccessibilityHelper: IdxNavBarAccessibilityHelper; +begin + if FSignIAccessibilityHelper = nil then + FSignIAccessibilityHelper := NavBarGetAccessibilityHelper( + GetSignAccessibilityHelperClass.Create(Self, OwnerObjectControl)); + Result := FSignIAccessibilityHelper; +end; + +function TdxNavBarNavigationPaneOverflowPanelAccessibilityHelper.GetViewInfo: TdxNavBarOverflowPanelViewInfo; +begin + Result := TdxNavBarOverflowPanelViewInfo(FOwnerObject); +end; + +{ TdxNavBarNavigationPaneOverflowPanelItemAccessibilityHelper } + +function TdxNavBarNavigationPaneOverflowPanelItemAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := TcxAccessibilityHelper(FOwnerObject); +end; + +function TdxNavBarNavigationPaneOverflowPanelItemAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := Parent.States[cxAccessibleObjectSelfID]; + if ItemIndex >= ViewInfo.OverflowPanelVisibleItemCount then + Result := Result or cxSTATE_SYSTEM_INVISIBLE; +end; + +procedure TdxNavBarNavigationPaneOverflowPanelItemAccessibilityHelper.Click( + AKey: Word); +begin + inherited Click(AKey); + TdxCustomNavBarAccess(OwnerObjectControl).DoGroupMouseUp(Group); +end; + +function TdxNavBarNavigationPaneOverflowPanelItemAccessibilityHelper.GetBounds: TRect; +begin + Result := ViewInfo.OverflowPanelItems[ItemIndex].SelectionRect; +end; + +function TdxNavBarNavigationPaneOverflowPanelItemAccessibilityHelper.IsClickKey( + AKey: Word): Boolean; +begin + Result := inherited IsClickKey(AKey) or (AKey in [VK_RETURN, VK_SPACE]); +end; + +function TdxNavBarNavigationPaneOverflowPanelItemAccessibilityHelper.IsContainer: Boolean; +begin + Result := False; +end; + +function TdxNavBarNavigationPaneOverflowPanelItemAccessibilityHelper.GetGroup: TdxNavBarGroup; +begin + Result := ViewInfo.OverflowPanelItems[ItemIndex].Group; +end; + +function TdxNavBarNavigationPaneOverflowPanelItemAccessibilityHelper.GetViewInfo: TdxNavBarNavigationPaneViewInfo; +begin + Result := TdxNavBarNavigationPaneOverflowPanelAccessibilityHelper(FOwnerObject).ViewInfo.ViewInfo; +end; + +{ TdxNavBarNavigationPaneOverflowPanelSignAccessibilityHelper } + +function TdxNavBarNavigationPaneOverflowPanelSignAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := TcxAccessibilityHelper(FOwnerObject); +end; + +function TdxNavBarNavigationPaneOverflowPanelSignAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := Parent.States[cxAccessibleObjectSelfID]; +end; + +// IdxNavBarAccessibilityHelper +procedure TdxNavBarNavigationPaneOverflowPanelSignAccessibilityHelper.Click( + AKey: Word); +begin + inherited Click(AKey); + ViewInfo.DoShowPopupMenu(cxRectCenter(GetScreenBounds(cxAccessibleObjectSelfID))); +end; + +function TdxNavBarNavigationPaneOverflowPanelSignAccessibilityHelper.GetBounds: TRect; +begin + Result := ViewInfo.OverflowPanelSignRect; +end; + +function TdxNavBarNavigationPaneOverflowPanelSignAccessibilityHelper.IsClickKey( + AKey: Word): Boolean; +begin + Result := inherited IsClickKey(AKey) or (AKey in [VK_RETURN, VK_SPACE]); +end; + +function TdxNavBarNavigationPaneOverflowPanelSignAccessibilityHelper.IsContainer: Boolean; +begin + Result := False; +end; + +function TdxNavBarNavigationPaneOverflowPanelSignAccessibilityHelper.GetViewInfo: TdxNavBarNavigationPaneViewInfo; +begin + Result := TdxNavBarNavigationPaneOverflowPanelAccessibilityHelper(FOwnerObject).ViewInfo.ViewInfo; +end; + +{ TdxNavBarNavigationPaneActiveGroupCaptionPanelAccessibilityHelper } + +function TdxNavBarNavigationPaneActiveGroupCaptionPanelAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := NavBar.IAccessibilityHelper.GetHelper; +end; + +function TdxNavBarNavigationPaneActiveGroupCaptionPanelAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := Parent.States[cxAccessibleObjectSelfID]; + if (NavBar.ActiveGroup = nil) or not NavBar.ActiveGroup.Visible or + not NavBar.ShowGroupCaptions or (GroupViewInfo = nil) then + Result := Result or cxSTATE_SYSTEM_INVISIBLE or cxSTATE_SYSTEM_UNAVAILABLE; +end; + +function TdxNavBarNavigationPaneActiveGroupCaptionPanelAccessibilityHelper.CanBeFocusedByDefault: Boolean; +begin + Result := True; +end; + +function TdxNavBarNavigationPaneActiveGroupCaptionPanelAccessibilityHelper.GetAssociatedObject: TdxNavBarCustomAccessibilityHelper; +begin + if Visible then + Result := NavBar.ActiveGroup.CaptionPanelIAccessibilityHelper.GetNavBarHelper + else + Result := nil; +end; + +function TdxNavBarNavigationPaneActiveGroupCaptionPanelAccessibilityHelper.GetBounds: TRect; +begin + Result := GroupViewInfo.Rect; +end; + +function TdxNavBarNavigationPaneActiveGroupCaptionPanelAccessibilityHelper.IsContainer: Boolean; +begin + Result := False; +end; + +function TdxNavBarNavigationPaneActiveGroupCaptionPanelAccessibilityHelper.GetGroupViewInfo: TdxNavBarGroupViewInfo; +var + I: Integer; +begin +// Requires + Assert(NavBar.ActiveGroup <> nil); +// + Result := nil; + for I := NavBarViewInfo.GetRealGroupStartIndex to NavBarViewInfo.GroupCount - 1 do + if NavBar.ViewInfo.Groups[I].Group = NavBar.ActiveGroup then + begin + Result := NavBar.ViewInfo.Groups[I]; + Break; + end; +end; + +function TdxNavBarNavigationPaneActiveGroupCaptionPanelAccessibilityHelper.GetNavBar: TdxCustomNavBar; +begin + Result := TdxNavBarOffice11NavPaneViewInfo(FOwnerObject).NavBar; +end; + +function TdxNavBarNavigationPaneActiveGroupCaptionPanelAccessibilityHelper.GetNavBarViewInfo: TdxNavBarNavigationPaneViewInfo; +begin + Result := TdxNavBarNavigationPaneViewInfo(NavBar.ViewInfo); +end; + +{ TdxNavBarNavigationPaneHeaderSignAccessibilityHelper } + +function TdxNavBarNavigationPaneHeaderSignAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := TdxCustomNavBar(OwnerObjectControl).IAccessibilityHelper.GetHelper; +end; + +function TdxNavBarNavigationPaneHeaderSignAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := Parent.States[cxAccessibleObjectSelfID]; + if not ViewInfo.Painter.Controller.Collapsible then + Result := Result or cxSTATE_SYSTEM_INVISIBLE or cxSTATE_SYSTEM_UNAVAILABLE; +end; + +procedure TdxNavBarNavigationPaneHeaderSignAccessibilityHelper.Click(AKey: Word); +begin + inherited Click(AKey); + ViewInfo.Painter.Controller.DoHeaderSignClick; +end; + +function TdxNavBarNavigationPaneHeaderSignAccessibilityHelper.GetBounds: TRect; +begin + Result := ViewInfo.HeaderSignRect; +end; + +function TdxNavBarNavigationPaneHeaderSignAccessibilityHelper.IsClickKey( + AKey: Word): Boolean; +begin + Result := inherited IsClickKey(AKey) or (AKey in [VK_RETURN, VK_SPACE]); +end; + +function TdxNavBarNavigationPaneHeaderSignAccessibilityHelper.IsContainer: Boolean; +begin + Result := False; +end; + +function TdxNavBarNavigationPaneHeaderSignAccessibilityHelper.GetViewInfo: TdxNavBarNavigationPaneViewInfo; +begin + Result := TdxNavBarNavigationPaneViewInfo(FOwnerObject); +end; + +{ TdxNavBarItemPanelAccessibilityHelper } + +destructor TdxNavBarItemPanelAccessibilityHelper.Destroy; +begin + NavBarAccessibleObjectOwnerObjectDestroyed(FCollapseBarIAccessibilityHelper); + inherited Destroy; +end; + +function TdxNavBarItemPanelAccessibilityHelper.GetChild( + AIndex: Integer): TcxAccessibilityHelper; +begin + if AIndex < inherited GetChildCount then + Result := inherited GetChild(AIndex) + else + Result := CollapseBarIAccessibilityHelper.GetHelper; +end; + +function TdxNavBarItemPanelAccessibilityHelper.GetChildCount: Integer; +begin + Result := inherited GetChildCount + 1; +end; + +function TdxNavBarItemPanelAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := ViewInfo.NavBar.IAccessibilityHelper.GetHelper; +end; + +function TdxNavBarItemPanelAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := Parent.States[cxAccessibleObjectSelfID]; + if not ViewInfo.Painter.Controller.Collapsed then + Result := Result or cxSTATE_SYSTEM_INVISIBLE; +end; + +function TdxNavBarItemPanelAccessibilityHelper.GetActualItemCount: Integer; +begin + Result := ViewInfo.ItemCount; +end; + +function TdxNavBarItemPanelAccessibilityHelper.GetBounds: TRect; +begin + Result := ViewInfo.Rect; +end; + +function TdxNavBarItemPanelAccessibilityHelper.GetCollapseBarAccessibilityHelperClass: TdxNavBarCustomAccessibilityHelperClass; +begin + Result := TdxNavBarItemPanelCollapseBarAccessibilityHelper; +end; + +function TdxNavBarItemPanelAccessibilityHelper.GetItemAccessibilityHelperClass: TdxNavBarItemCollectionItemAccessibilityHelperClass; +begin + Result := TdxNavBarItemPanelItemAccessibilityHelper; +end; + +function TdxNavBarItemPanelAccessibilityHelper.GetCollapseBarIAccessibilityHelper: IdxNavBarAccessibilityHelper; +begin + if FCollapseBarIAccessibilityHelper = nil then + FCollapseBarIAccessibilityHelper := NavBarGetAccessibilityHelper( + GetCollapseBarAccessibilityHelperClass.Create(Self, OwnerObjectControl)); + Result := FCollapseBarIAccessibilityHelper; +end; + +function TdxNavBarItemPanelAccessibilityHelper.GetViewInfo: TdxNavBarItemPanelViewInfo; +begin + Result := TdxNavBarItemPanelViewInfo(FOwnerObject); +end; + +{ TdxNavBarItemPanelCollapseBarAccessibilityHelper } + +function TdxNavBarItemPanelCollapseBarAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := TcxAccessibilityHelper(FOwnerObject); +end; + +function TdxNavBarItemPanelCollapseBarAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := Parent.States[cxAccessibleObjectSelfID]; +end; + +function TdxNavBarItemPanelCollapseBarAccessibilityHelper.CanBeFocusedByDefault: Boolean; +begin + Result := True; +end; + +procedure TdxNavBarItemPanelCollapseBarAccessibilityHelper.Click(AKey: Word); +begin + inherited Click(AKey); + ViewInfo.Painter.Controller.ShowPopupControl; +end; + +function TdxNavBarItemPanelCollapseBarAccessibilityHelper.GetBounds: TRect; +begin + Result := ViewInfo.CollapseBarRect; +end; + +function TdxNavBarItemPanelCollapseBarAccessibilityHelper.IsClickKey( + AKey: Word): Boolean; +begin + Result := inherited IsClickKey(AKey) or (AKey in [VK_RETURN, VK_SPACE]); +end; + +function TdxNavBarItemPanelCollapseBarAccessibilityHelper.IsContainer: Boolean; +begin + Result := False; +end; + +function TdxNavBarItemPanelCollapseBarAccessibilityHelper.GetViewInfo: TdxNavBarItemPanelViewInfo; +begin + Result := TdxNavBarItemPanelAccessibilityHelper(FOwnerObject).ViewInfo; +end; + +{ TdxNavBarItemPanelItemAccessibilityHelper } + +function TdxNavBarItemPanelItemAccessibilityHelper.GetParent: TcxAccessibilityHelper; +begin + Result := TcxAccessibilityHelper(FOwnerObject); +end; + +function TdxNavBarItemPanelItemAccessibilityHelper.GetState( + AChildID: TcxAccessibleSimpleChildElementID): Integer; +begin + Result := Parent.States[cxAccessibleObjectSelfID]; +end; + +function TdxNavBarItemPanelItemAccessibilityHelper.CanBeFocusedByDefault: Boolean; +begin + Result := True; +end; + +procedure TdxNavBarItemPanelItemAccessibilityHelper.Click(AKey: Word); +begin + inherited Click(AKey); + TdxNavBarControllerAccess(ViewInfo.Painter.Controller).DoLinkClick(ViewInfo.NavBar, + ViewInfo.Items[ItemIndex].ItemLink); +end; + +function TdxNavBarItemPanelItemAccessibilityHelper.GetBounds: TRect; +begin + Result := ViewInfo.Items[ItemIndex].Rect; +end; + +function TdxNavBarItemPanelItemAccessibilityHelper.IsClickKey( + AKey: Word): Boolean; +begin + Result := inherited IsClickKey(AKey) or (AKey in [VK_RETURN, VK_SPACE]); +end; + +function TdxNavBarItemPanelItemAccessibilityHelper.IsContainer: Boolean; +begin + Result := False; +end; + +function TdxNavBarItemPanelItemAccessibilityHelper.GetViewInfo: TdxNavBarItemPanelViewInfo; +begin + Result := TdxNavBarItemPanelAccessibilityHelper(FOwnerObject).ViewInfo; +end; + +initialization + RegisterView(dxNavBarOffice11TaskPaneView, 'Office11TaskPaneView', TdxNavBarOffice11Painter); + RegisterView(dxNavBarOffice11ExplorerBarView, 'Office11ExplorerBarView', TdxNavBarOffice11ExplorerBarPainter); + RegisterView(dxNavBarOffice11NavigatorPaneView, 'Office11NavigationPaneView', TdxNavBarOffice11NavPanePainter); + +finalization + UnRegisterView(dxNavBarOffice11TaskPaneView); + UnRegisterView(dxNavBarOffice11ExplorerBarView); + UnRegisterView(dxNavBarOffice11NavigatorPaneView); + +end. diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarOffice12Views.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarOffice12Views.pas new file mode 100644 index 00000000..6de1cf9f --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarOffice12Views.pas @@ -0,0 +1,268 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarOffice12Views; + +{$I cxVer.inc} + +interface + +uses + Windows, cxGraphics, SysUtils, Classes, cxClasses, cxControls, dxNavBar, dxNavBarSkinBasedViews, + dxSkinsCore, dxSkinInfo, cxScrollBar, cxLookAndFeels, cxLookAndFeelPainters; + +type + TdxNavBarOffice12PainterHelper = class(TdxNavBarSkinBasedPainterHelper) + protected + function GetFullSkinName: TdxSkinName; override; + function GetSkinsCount: Integer; override; + function GetSkinNames(AIndex: Integer): TdxSkinName; override; + procedure SetSkinName(AValue: TdxSkinName); override; + end; + + TdxNavBarOffice12NavPanePainter = class(TdxNavBarSkinBasedNavPanePainter) + protected + class function GetSkinPainterHelperClass: TdxNavBarSkinBasedPainterHelperClass; override; + + function GetDefaultColorSchemeName: TdxSkinName; override; + public + procedure Assign(Source: TPersistent); override; + published + property ColorSchemeName; + end; + + TdxNavBarOffice12ExplorerBarPainter = class(TdxNavBarSkinBasedExplorerBarPainter) + protected + class function GetSkinPainterHelperClass: TdxNavBarSkinBasedPainterHelperClass; override; + function CreatecxScrollBar: TcxScrollBar; override; + function GetcxScrollBarClass: TcxScrollBarClass; override; + procedure DrawScrollBarPart(ACanvas: TcxCanvas; const R: TRect; + APart: TcxScrollBarPart; AState: TcxButtonState); + function ScrollBarMinimalThumbSize: Integer; + function IsGroupCaptionButtonCompositeDraw(AGroupViewInfo: TdxNavBarGroupViewInfo): Boolean; override; + + function GetDefaultColorSchemeName: TdxSkinName; override; + public + procedure Assign(Source: TPersistent); override; + procedure DrawItemSelection(ALinkViewInfo: TdxNavBarLinkViewInfo); override; + published + property ColorSchemeName; + end; + +implementation + +{$R *.res} + +uses + dxNavBarBase, dxNavBarViewsFact, dxNavBarConsts; + +const + AColorSchemeCount = 3; + AColorSchemeNames: array [0..AColorSchemeCount - 1] of ShortString = ('Blue', 'Black', 'Silver'); + +var + ADefaultColorSchemeName: ShortString; + +{ TdxNavBarOffice12PainterHelper } + +function TdxNavBarOffice12PainterHelper.GetFullSkinName: TdxSkinName; +begin + Result := 'Office12_' + SkinName; +end; + +function TdxNavBarOffice12PainterHelper.GetSkinsCount: Integer; +begin + Result := AColorSchemeCount; +end; + +function TdxNavBarOffice12PainterHelper.GetSkinNames(AIndex: Integer): TdxSkinName; +begin + Result := AColorSchemeNames[AIndex]; +end; + +procedure TdxNavBarOffice12PainterHelper.SetSkinName(AValue: TdxSkinName); +begin + inherited; + ADefaultColorSchemeName := AValue; +end; + +{ TdxNavBarOffice12NavPanePainter } + +procedure TdxNavBarOffice12NavPanePainter.Assign(Source: TPersistent); +begin + if Source is TdxNavBarOffice12NavPanePainter then + ColorSchemeName := TdxNavBarOffice12NavPanePainter(Source).ColorSchemeName + else + inherited; +end; + +class function TdxNavBarOffice12NavPanePainter.GetSkinPainterHelperClass: TdxNavBarSkinBasedPainterHelperClass; +begin + Result := TdxNavBarOffice12PainterHelper; +end; + +function TdxNavBarOffice12NavPanePainter.GetDefaultColorSchemeName: TdxSkinName; +begin + Result := ADefaultColorSchemeName; +end; + +type + TdxNavBarcxOffice12ScrollBar = class(TcxControlScrollBar) + private + FNavBarPainter: TdxNavBarOffice12ExplorerBarPainter; + protected + procedure DrawScrollBarPart(ACanvas: TcxCanvas; const R: TRect; + APart: TcxScrollBarPart; AState: TcxButtonState); override; + function IsButtonHotTrack: Boolean; override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); + function ScrollBarMinimalThumbSize: Integer; override; + public + constructor Create(APainter: TdxNavBarOffice12ExplorerBarPainter); reintroduce; virtual; + end; + +{ TdxNavBarcxOffice12ScrollBar } + +constructor TdxNavBarcxOffice12ScrollBar.Create(APainter: TdxNavBarOffice12ExplorerBarPainter); +begin + inherited Create(nil); + FNavBarPainter := APainter; +end; + +procedure TdxNavBarcxOffice12ScrollBar.DrawScrollBarPart( + ACanvas: TcxCanvas; const R: TRect; APart: TcxScrollBarPart; + AState: TcxButtonState); +begin + if FNavBarPainter <> nil then + FNavBarPainter.DrawScrollBarPart(ACanvas, R, APart, AState) + else + inherited; +end; + +function TdxNavBarcxOffice12ScrollBar.IsButtonHotTrack: Boolean; +begin + Result := True; +end; + +procedure TdxNavBarcxOffice12ScrollBar.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin +//do nothing +end; + +function TdxNavBarcxOffice12ScrollBar.ScrollBarMinimalThumbSize: Integer; +begin + if FNavBarPainter <> nil then + Result := FNavBarPainter.ScrollBarMinimalThumbSize + else + Result := inherited ScrollBarMinimalThumbSize; +end; + +{ TdxNavBarOffice12ExplorerBarPainter } + +procedure TdxNavBarOffice12ExplorerBarPainter.Assign(Source: TPersistent); +begin + if Source is TdxNavBarOffice12ExplorerBarPainter then + ColorSchemeName := TdxNavBarOffice12ExplorerBarPainter(Source).ColorSchemeName + else + inherited; +end; + +procedure TdxNavBarOffice12ExplorerBarPainter.DrawItemSelection(ALinkViewInfo: TdxNavBarLinkViewInfo); +begin +end; + +class function TdxNavBarOffice12ExplorerBarPainter.GetSkinPainterHelperClass: TdxNavBarSkinBasedPainterHelperClass; +begin + Result := TdxNavBarOffice12PainterHelper; +end; + +function TdxNavBarOffice12ExplorerBarPainter.CreatecxScrollBar: TcxScrollBar; +begin + Result := TdxNavBarcxOffice12ScrollBar.Create(Self); +end; + +function TdxNavBarOffice12ExplorerBarPainter.GetcxScrollBarClass: TcxScrollBarClass; +begin + Result := TdxNavBarcxOffice12ScrollBar; +end; + +procedure TdxNavBarOffice12ExplorerBarPainter.DrawScrollBarPart(ACanvas: TcxCanvas; const R: TRect; + APart: TcxScrollBarPart; AState: TcxButtonState); +const + ButtonState2SkinState: array[TcxButtonState] of TdxSkinElementState = + (esNormal, esNormal, esHot, esPressed, esDisabled); +var + AInfo: TdxSkinScrollInfo; +begin + if FSkinBasedPainterHelper = nil then + Exit; + AInfo := FSkinBasedPainterHelper.NavBarScrollBarElements(False, APart); + if (AInfo <> nil) and (AInfo.Element <> nil) then + AInfo.Element.Draw(ACanvas.Handle, R, AInfo.ImageIndex, ButtonState2SkinState[AState]); +end; + +function TdxNavBarOffice12ExplorerBarPainter.ScrollBarMinimalThumbSize: Integer; +var + AInfo: TdxSkinScrollInfo; +begin + Result := 0; + if FSkinBasedPainterHelper = nil then + Exit; + AInfo := FSkinBasedPainterHelper.NavBarScrollBarElements(False, sbpThumbnail); + if (AInfo <> nil) and (AInfo.Element <> nil) then + Result := AInfo.Element.Size.cy; +end; + +function TdxNavBarOffice12ExplorerBarPainter.IsGroupCaptionButtonCompositeDraw( + AGroupViewInfo: TdxNavBarGroupViewInfo): Boolean; +begin + Result := (ViewInfo.GroupCount > 0) and (ViewInfo.Groups[0] = AGroupViewInfo); +end; + +function TdxNavBarOffice12ExplorerBarPainter.GetDefaultColorSchemeName: TdxSkinName; +begin + Result := ADefaultColorSchemeName; +end; + +initialization + ADefaultColorSchemeName := AColorSchemeNames[0]; + RegisterView(dxNavBarOffice12NavigatorPaneView, 'Office12NavigationPaneView', TdxNavBarOffice12NavPanePainter); + RegisterView(dxNavBarOffice12ExplorerBarView, 'Office12ExplorerBarView', TdxNavBarOffice12ExplorerBarPainter); + +finalization + UnRegisterView(dxNavBarOffice12NavigatorPaneView); + UnRegisterView(dxNavBarOffice12ExplorerBarView); +end. + diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarOffice12Views.res b/official/x.35/ExpressNavBar 2/Sources/dxNavBarOffice12Views.res new file mode 100644 index 00000000..ca5f5c26 Binary files /dev/null and b/official/x.35/ExpressNavBar 2/Sources/dxNavBarOffice12Views.res differ diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarOfficeViews.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarOfficeViews.pas new file mode 100644 index 00000000..7acbb4a3 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarOfficeViews.pas @@ -0,0 +1,234 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarOfficeViews; + +{$I cxVer.inc} + +interface + +uses + Windows, Graphics, Types, dxNavBar, dxNavBarStyles, + dxNavBarBaseViews, dxNavBarCollns, dxNavBarCustomPainters; + +type + TdxNavBarOffice1ViewInfo = class(TdxNavBarBaseViewInfo) + protected + function GetGroupCaptionHeightAddon: Integer; override; + function GetGroupSeparatorWidth: Integer; override; + public + procedure AssignDefaultBackgroundStyle; override; + procedure AssignDefaultGroupBackgroundStyle; override; + procedure AssignDefaultGroupHeaderStyle; override; + procedure AssignDefaultItemStyle; override; + procedure AssignDefaultItemDisabledStyle; override; + end; + + TdxNavBarOffice1Painter = class(TdxNavBarBasePainter) + protected + class function GetViewInfoClass: TdxNavBarViewInfoClass; override; + + class function ButtonPainterClass: TdxNavBarCustomButtonPainterClass; override; + end; + + TdxNavBarOffice2Painter = class(TdxNavBarOffice1Painter) + protected + class function SelectionPainterClass: TdxNavBarCustomSelectionPainterClass; override; + end; + + TdxNavBarOffice3LinkViewInfo = class(TdxNavBarLinkViewInfo) + public + function SelectionRect: TRect; override; + end; + + TdxNavBarOffice3ViewInfo = class(TdxNavBarOffice1ViewInfo) + protected + class function GetLinksLargeSeparatorWidth: Integer; override; + function CanSelectLinkByRect: Boolean; override; + end; + + TdxNavBarOffice3Painter = class(TdxNavBarOffice2Painter) + protected + class function GetViewInfoClass: TdxNavBarViewInfoClass; override; + class function GetLinkViewInfoClass: TdxNavBarLinkViewInfoClass; override; + end; + + TdxNavBarOfficeButtonPainter = class(TdxNavBarCustomButtonPainter) + protected + class procedure InternalDrawButton(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; + AState: TdxNavBarObjectStates); override; + end; + +implementation + +uses + CommCtrl, ImgList, Buttons, cxGeometry, cxGraphics, dxOffice11, + dxNavBarViewsFact, dxNavBarGraphics, dxNavBarConsts; + +{ TdxNavBarOffice1ViewInfo } + +procedure TdxNavBarOffice1ViewInfo.AssignDefaultBackgroundStyle; +begin + NavBar.DefaultStyles.Background.ResetValues; + NavBar.DefaultStyles.Background.BackColor := clBtnFace; + NavBar.DefaultStyles.Background.BackColor2 := clBtnFace; +end; + +procedure TdxNavBarOffice1ViewInfo.AssignDefaultGroupBackgroundStyle; +begin + NavBar.DefaultStyles.GroupBackground.ResetValues; + NavBar.DefaultStyles.GroupBackground.BackColor := clBtnFace; + NavBar.DefaultStyles.GroupBackground.BackColor2 := clBtnFace; +end; + +procedure TdxNavBarOffice1ViewInfo.AssignDefaultGroupHeaderStyle; +begin + NavBar.DefaultStyles.GroupHeader.ResetValues; + NavBar.DefaultStyles.GroupHeader.BackColor := clBtnFace; + NavBar.DefaultStyles.GroupHeader.BackColor2 := clBtnFace; + NavBar.DefaultStyles.GroupHeader.Font.Color := clBtnText; + NavBar.DefaultStyles.GroupHeader.HAlignment := haCenter; +end; + +procedure TdxNavBarOffice1ViewInfo.AssignDefaultItemStyle; +begin + NavBar.DefaultStyles.Item.ResetValues; + NavBar.DefaultStyles.Item.Font.Color := clBtnText; + NavBar.DefaultStyles.Item.HAlignment := haCenter; +end; + +procedure TdxNavBarOffice1ViewInfo.AssignDefaultItemDisabledStyle; +begin + with NavBar.DefaultStyles do + begin + ItemDisabled.Assign(NavBar.DefaultStyles.Item); + ItemDisabled.Font.Color := clBtnShadow; + end; +end; + +function TdxNavBarOffice1ViewInfo.GetGroupCaptionHeightAddon: Integer; +begin + Result := 8; +end; + +function TdxNavBarOffice1ViewInfo.GetGroupSeparatorWidth: Integer; +begin + Result := 1; +end; + +{ TdxNavBarOffice1Painter } + +class function TdxNavBarOffice1Painter.GetViewInfoClass: TdxNavBarViewInfoClass; +begin + Result := TdxNavBarOffice1ViewInfo; +end; + +class function TdxNavBarOffice1Painter.ButtonPainterClass: TdxNavBarCustomButtonPainterClass; +begin + Result := TdxNavBarOfficeButtonPainter; +end; + +{ TdxNavBarOffice2Painter } + +class function TdxNavBarOffice2Painter.SelectionPainterClass: TdxNavBarCustomSelectionPainterClass; +begin + Result := TdxNavBarUltraFlatSelectionPainter; +end; + +{ TdxNavBarOffice3LinkViewInfo } + +function TdxNavBarOffice3LinkViewInfo.SelectionRect: TRect; +begin + Result := Rect; + InflateRect(Result, -1, -1); +end; + +{ TdxNavBarOffice3ViewInfo } + +class function TdxNavBarOffice3ViewInfo.GetLinksLargeSeparatorWidth: Integer; +begin + Result := 16; +end; + +function TdxNavBarOffice3ViewInfo.CanSelectLinkByRect: Boolean; +begin + Result := True; +end; + +{ TdxNavBarOffice3Painter } + +class function TdxNavBarOffice3Painter.GetViewInfoClass: TdxNavBarViewInfoClass; +begin + Result := TdxNavBarOffice3ViewInfo; +end; + +class function TdxNavBarOffice3Painter.GetLinkViewInfoClass: TdxNavBarLinkViewInfoClass; +begin + Result := TdxNavBarOffice3LinkViewInfo; +end; + +{ TdxNavBarOfficeButtonPainter } + +class procedure TdxNavBarOfficeButtonPainter.InternalDrawButton(ACanvas: TCanvas; ARect: TRect; + APicture: TPicture; AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; AState: TdxNavBarObjectStates); +begin + inherited; + if sPressed in AState then + dxNavBarDrawSelectedFrame(ACanvas, ARect, DarkDarkBorderColor(AColor1), LightLightBorderColor(AColor1), + DarkBorderColor(AColor1), clNone) + else + if sHotTracked in AState then + dxNavBarDrawSelectedFrame(ACanvas, ARect, LightLightBorderColor(AColor1), DarkDarkBorderColor(AColor1), + LightBorderColor(AColor1), DarkBorderColor(AColor1)) + else + dxNavBarDrawSelectedFrame(ACanvas, ARect, LightLightBorderColor(AColor1), DarkDarkBorderColor(AColor1), + clNone, clNone); + if sActive in AState then + FillRectByColor(ACanvas.Handle, cxRectSetBottom(ARect, ARect.Bottom, 1), clBlack); +end; + +initialization + RegisterView(dxNavBarOffice1View, 'Office1View', TdxNavBarOffice1Painter); + RegisterView(dxNavBarOffice2View, 'Office2View', TdxNavBarOffice2Painter); + RegisterView(dxNavBarOffice3View, 'Office3View', TdxNavBarOffice3Painter); + +finalization + UnRegisterView(dxNavBarOffice1View); + UnRegisterView(dxNavBarOffice2View); + UnRegisterView(dxNavBarOffice3View); + +end. diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarReg.dcr b/official/x.35/ExpressNavBar 2/Sources/dxNavBarReg.dcr new file mode 100644 index 00000000..92d913b0 Binary files /dev/null and b/official/x.35/ExpressNavBar 2/Sources/dxNavBarReg.dcr differ diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarReg.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarReg.pas new file mode 100644 index 00000000..4e9c65b5 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarReg.pas @@ -0,0 +1,471 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarReg; + +{$I cxVer.inc} + +interface + +procedure Register; + +implementation + +uses + Classes, Windows, Graphics, Controls, Forms, ImgList, SysUtils, Math, +{$IFDEF DELPHI6} + Types, VCLEditors, DesignIntf, DesignEditors, +{$ELSE} + DsgnIntf, +{$ENDIF} + ToolsAPI, cxClasses, + cxLibraryReg, cxPropEditors, + dxNavBar, dxNavBarBase, dxNavBarCollns, dxNavBarStyles, dxNavBarGroupItems, + dxNavBarConsts, dxNavBarDsgnConsts, dxfmNavBarDsgnEditor, dxNavBarViewsFact, + dxNavBarSkinBasedViews; + +type + TdxNavBarViewProperty = class(TIntegerProperty) + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + { TdxNavBarViewStyleProperty } + + TdxNavBarViewStyleProperty = class(TClassProperty) + protected + function HasSubProperties: Boolean; + function View: Integer; + function ViewStyle: TdxNavBarPainter; + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + { TdxNavBarCustomDrawEventEditor } + + TdxNavBarCustomDrawEventEditor = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + public + function GetName: string; override; + end; + + { TdxNavBarSkinNameProperty } + + TdxNavBarColorSchemeNameProperty = class(TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + end; + + { TdxNavBarImageIndexProperty } + + TdxNavBarImageIndexProperty = class(TImageIndexProperty) + protected + function GetCollectionItem: TdxNavBarComponentCollectionItem; virtual; + function GetNavBar: TdxCustomNavBar; virtual; + end; + + TdxSmallImageIndexProperty = class(TdxNavBarImageIndexProperty) + protected + function GetImages: TCustomImageList; override; + end; + + TdxLargeImageIndexProperty = class(TdxNavBarImageIndexProperty) + protected + function GetImages: TCustomImageList; override; + end; + + TdxNavBarCursorProperty = class(TCursorProperty{$IFDEF DELPHI6}, ICustomPropertyListDrawing{$ENDIF}) + public + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + + procedure ListMeasureHeight(const Value: string; ACanvas: TCanvas; + var AHeight: Integer); {$IFNDEF DELPHI6} override;{$ENDIF} + procedure ListMeasureWidth(const Value: string; + ACanvas: TCanvas; var AWidth: Integer); {$IFNDEF DELPHI6} override;{$ENDIF} + procedure ListDrawValue(const Value: string; ACanvas: TCanvas; + const ARect: TRect; ASelected: Boolean); {$IFNDEF DELPHI6} override;{$ENDIF} + end; + + TdxNavBarComponentEditor = class(TcxComponentEditor) + protected + function GetProductMajorVersion: string; override; + function GetProductName: string; override; + function InternalGetVerb(AIndex: Integer): string; override; + function InternalGetVerbCount: Integer; override; + procedure InternalExecuteVerb(AIndex: Integer); override; + end; + +{ TdxNavBarViewProperty } + +function TdxNavBarViewProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paMultiSelect, paValueList]; +end; + +function TdxNavBarViewProperty.GetValue: string; +var + AIndex: Integer; +begin + AIndex := GetOrdValue; + if (0 <= AIndex) and (AIndex < dxNavBarViewsFactory.Count) then + Result := dxNavBarViewsFactory.Names[AIndex] + else Result := ''; +end; + +procedure TdxNavBarViewProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to dxNavBarViewsFactory.Count - 1 do + Proc(dxNavBarViewsFactory.Names[I]); +end; + +procedure TdxNavBarViewProperty.SetValue(const Value: string); +var + AIndex: Integer; +begin + AIndex := dxNavBarViewsFactory.IndexOfName(Value); + if AIndex > -1 then SetOrdValue(AIndex); +end; + +{ TdxNavBarViewStyleProperty } + +function TdxNavBarViewStyleProperty.HasSubProperties: Boolean; +var + AColorSchemes: IdxNavBarColorSchemes; +begin + Result := Supports(ViewStyle, IdxNavBarColorSchemes, AColorSchemes) and + (AColorSchemes.GetCount > 1); +end; + +function TdxNavBarViewStyleProperty.View: Integer; +begin + if GetComponent(0) is TdxNavBar then + Result := (GetComponent(0) as TdxNavBar).View + else + Result := -1; +end; + +function TdxNavBarViewStyleProperty.ViewStyle: TdxNavBarPainter; +begin + if GetComponent(0) is TdxNavBar then + Result := (GetComponent(0) as TdxNavBar).ViewStyle + else + Result := nil; +end; + +function TdxNavBarViewStyleProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes; + if not HasSubProperties then + Exclude(Result, paSubProperties); + Result := Result - [paReadOnly] + [paValueList, paSortList, paRevertable] + + {$IFDEF DELPHI6}[paVolatileSubProperties] {$ELSE } [] {$ENDIF}; +end; + +function TdxNavBarViewStyleProperty.GetValue: string; +var + AIndex: Integer; +begin + AIndex := dxNavBarViewsFactory.IndexOfID(View); + if (0 <= AIndex) and (AIndex < dxNavBarViewsFactory.Count) then + Result := dxNavBarViewsFactory.Names[AIndex] + else + Result := ''; +end; + +procedure TdxNavBarViewStyleProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to dxNavBarViewsFactory.Count - 1 do + Proc(dxNavBarViewsFactory.Names[I]); +end; + +procedure TdxNavBarViewStyleProperty.SetValue(const Value: string); +begin + ObjectInspectorCollapseProperty; + (GetComponent(0) as TdxNavBar).View := dxNavBarViewsFactory.GetIDFromName(Value); + Modified; +end; + +{ TdxNavBarCustomDrawEventEditor } + +function TdxNavBarCustomDrawEventEditor.GetName: string; +begin + Result := 'OnCustomDraw'; +end; + +function TdxNavBarCustomDrawEventEditor.GetInstance: TPersistent; +begin + Result := TdxCustomNavBar(GetComponent(0)).OnCustomDraw; +end; + +{ TdxNavBarColorSchemeNameProperty } + +function TdxNavBarColorSchemeNameProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes - [paReadOnly] + [paValueList]; +end; + +procedure TdxNavBarColorSchemeNameProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; + AColorSchemes: IdxNavBarColorSchemes; +begin + if Supports(GetComponent(0), IdxNavBarColorSchemes, AColorSchemes) then + for I := 0 to AColorSchemes.GetCount - 1 do + Proc(AColorSchemes.GetNames(I)); +end; + +{ TdxNavBarImageIndexProperty } + +function TdxNavBarImageIndexProperty.GetCollectionItem: TdxNavBarComponentCollectionItem; +begin + Result := GetComponent(0) as TdxNavBarComponentCollectionItem; +end; + +function TdxNavBarImageIndexProperty.GetNavBar: TdxCustomNavBar; +begin + Result := GetCollectionItem.GetParentComponent as TdxCustomNavBar; +end; + +{ TdxSmallImageIndexProperty } + +function TdxSmallImageIndexProperty.GetImages: TCustomImageList; +begin + if GetNavBar <> nil then + Result := GetNavBar.SmallImages + else Result := nil; +end; + +{ TdxLargeImageIndexProperty } + +function TdxLargeImageIndexProperty.GetImages: TCustomImageList; +begin + if GetNavBar <> nil then + Result := GetNavBar.LargeImages + else Result := nil; +end; + +{ TdxNavBarCursorProperty } + +function TdxNavBarCursorProperty.GetValue: string; +begin + if not IntToIdent(TCursor(GetOrdValue), Result, dxNavBarCursors) then + Result := inherited GetValue; +end; + +procedure TdxNavBarCursorProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + inherited; + for I := Low(dxNavBarCursors) to High(dxNavBarCursors) do + Proc(dxNavBarCursors[I].Name); +end; + +procedure TdxNavBarCursorProperty.SetValue(const Value: string); +var + NewValue: Longint; +begin + if IdentToInt(Value, NewValue, dxNavBarCursors) then + SetOrdValue(NewValue) + else inherited SetValue(Value); +end; + +procedure TdxNavBarCursorProperty.ListMeasureHeight(const Value: string; ACanvas: TCanvas; + var AHeight: Integer); +begin + AHeight := Max(ACanvas.TextHeight('Wg'), GetSystemMetrics(SM_CYCURSOR) + 4); +end; + +procedure TdxNavBarCursorProperty.ListMeasureWidth(const Value: string; + ACanvas: TCanvas; var AWidth: Integer); +begin + AWidth := AWidth + GetSystemMetrics(SM_CXCURSOR) + 4; +end; + +procedure TdxNavBarCursorProperty.ListDrawValue(const Value: string; ACanvas: TCanvas; + const ARect: TRect; ASelected: Boolean); +var + Right: Integer; + CursorIndex: Integer; + CursorHandle: THandle; +{$IFNDEF DELPHI6} + R: TRect; +{$ENDIF} +begin + Right := ARect.Left + GetSystemMetrics(SM_CXCURSOR) + 4; + with ACanvas do + begin + if not Classes.IdentToInt(Value, CursorIndex, dxNavBarCursors) then + if not IdentToCursor(Value, CursorIndex) then + CursorIndex := StrToInt(Value); + ACanvas.FillRect(ARect); + CursorHandle := Screen.Cursors[CursorIndex]; + if CursorHandle <> 0 then + DrawIconEx(ACanvas.Handle, ARect.Left + 2, ARect.Top + 2, CursorHandle, + 0, 0, 0, 0, DI_NORMAL or DI_DEFAULTSIZE); + {$IFDEF DELPHI6} + DefaultPropertyListDrawValue(Value, ACanvas, Rect(Right, ARect.Top, + ARect.Right, ARect.Bottom), ASelected); + {$ELSE} + R := ARect; + R.Left := Right + 4; + ACanvas.TextRect(R, R.Left + 1, R.Top + 1, Value); + {$ENDIF} + end; +end; + +{ TdxNavBarComponentEditor } + +function TdxNavBarComponentEditor.GetProductMajorVersion: string; +begin + Result := dxNavBarMajorVersion; +end; + +function TdxNavBarComponentEditor.GetProductName: string; +begin + Result := sdxProductName; +end; + +function TdxNavBarComponentEditor.InternalGetVerb(AIndex: Integer): string; +begin + Result := sdxEditor; +end; + +function TdxNavBarComponentEditor.InternalGetVerbCount: Integer; +begin + Result := 1; +end; + +procedure TdxNavBarComponentEditor.InternalExecuteVerb(AIndex: Integer); +begin + dxShowNavBarDesigner(TdxCustomNavBar(Component)); +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterComponents(dxLibraryProductPage, [TdxNavBar]); + RegisterClasses([TdxNavBarPainter]); + RegisterNoIconProc([TdxNavBarGroup, TdxNavBarItem, TdxNavBarStyleItem]); + RegisterComponentEditor(TdxNavBar, TdxNavBarComponentEditor); + + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TdxNavBar, 'CustomDrawEvents', TdxNavBarCustomDrawEventEditor); + + RegisterPropertyEditor(TypeInfo(TCursor), TdxNavBarCursors, 'Cursor', TdxNavBarCursorProperty); + RegisterPropertyEditor(TypeInfo(TCursor), TdxNavBarCursors, 'DragCursor', TdxNavBarCursorProperty); + RegisterPropertyEditor(TypeInfo(TCursor), TdxNavBarCursors, 'DragCopyCursor', TdxNavBarCursorProperty); + RegisterPropertyEditor(TypeInfo(TCursor), TdxNavBarCursors, 'HotTrackedGroupCursor', TdxNavBarCursorProperty); + RegisterPropertyEditor(TypeInfo(TCursor), TdxNavBarCursors, 'HotTrackedLinkCursor', TdxNavBarCursorProperty); + + RegisterPropertyEditor(TypeInfo(TdxNavBarPainter), TdxNavBar, 'ViewStyle', TdxNavBarViewStyleProperty); + RegisterPropertyEditor(TypeInfo(Integer), TdxNavBarGroup, 'LargeImageIndex', TdxLargeImageIndexProperty); + RegisterPropertyEditor(TypeInfo(Integer), TdxNavBarGroup, 'SmallImageIndex', TdxSmallImageIndexProperty); + RegisterPropertyEditor(TypeInfo(Integer), TdxNavBarItem, 'LargeImageIndex', TdxLargeImageIndexProperty); + RegisterPropertyEditor(TypeInfo(Integer), TdxNavBarItem, 'SmallImageIndex', TdxSmallImageIndexProperty); + RegisterPropertyEditor(TypeInfo(TdxSkinName), TdxNavBarSkinBasedNavPanePainter, 'ColorSchemeName', TdxNavBarColorSchemeNameProperty); + RegisterPropertyEditor(TypeInfo(TdxSkinName), TdxNavBarSkinBasedExplorerBarPainter, 'ColorSchemeName', TdxNavBarColorSchemeNameProperty); + + HideClassProperties(TdxNavBar, [ + // Cursors + 'Cursor', 'DragCopyCursor', 'DragCursor', 'HotTrackedGroupCursor', 'HotTrackedLinkCursor', + // OptionsBehavior + 'AllowSelectlinks', 'DragDropFlags', 'ShowGroupsHint', 'ShowLinksHint', + 'ShowNavigationPaneOverflowPanelHints', 'EachGroupHasSelectedLink', + // OptionsStyle + 'DefaultStyles', 'StyleBackground', 'StyleHint', + 'StyleDropTargetGroup', 'StyleDropTargetLink', 'StyleButton', + 'StyleButtonHotTracked', 'StyleButtonPressed', 'StyleNavigationPaneHeader', + // OptionsImage + 'LargeImages', 'SmallImages', + // OptionsView + 'View', 'ShowSpecialGroup', 'SpaceBetweenGroups', 'ShowGroupCaptions', + 'NavigationPaneMaxVisibleGroups', 'NavigationPaneOverflowPanelUseSmallImages', + // CustomDraw + 'OnCustomDraw', 'OnCustomDrawBackground', 'OnCustomDrawGroupCaption', 'OnCustomDrawGroupClientBackground', + 'OnCustomDrawGroupClientForeground', 'OnCustomDrawGroupHint', 'OnCustomDrawLink', + 'OnCustomDrawLinkHint', 'OnCustomDrawBottomScrollButton', 'OnCustomDrawTopScrollButton', + 'OnCustomDrawNavigationPaneHeader', 'OnCustomDrawNavigationPaneSplitter', + 'OnCustomDrawNavigationPaneOverflowPanel', 'OnCustomDrawNavigationPaneOverflowPanelHint']); + + HideClassProperties(TdxNavBarGroup, [ + // CustomStyles + 'StyleBackground', 'StyleControl', + 'StyleHeader', 'StyleHeaderActive', 'StyleHeaderActiveHotTracked', + 'StyleHeaderActivePressed', 'StyleHeaderHotTracked', 'StyleHeaderPressed', + // OptionsExpand + 'Expandable', 'Expanded', 'ShowExpandButton', + // OptionsGroupControl + 'ShowControl', 'UseControl']); + HideClassProperties(TdxNavBarItem, ['Style', 'StyleDisabled', 'StyleHotTracked', 'StylePressed']); + HideClassProperties(TdxNavBarSeparator, [ + 'CustomStyles', 'Style', 'StyleDisabled', 'StyleHotTracked', 'StylePressed', + 'Action', 'Caption', 'Enabled', 'Hint', 'LargeImageIndex', 'SmallImageIndex', + 'OnClick']); +end; + +type + TdxCustomNavBarAccess = class(TdxCustomNavBar); + +procedure RegisterNavBar(ASender: TObject); +begin + TdxCustomNavBarAccess(ASender).FDesignHelper := TdxNavBarDesigner.Create(TComponent(ASender)); +end; + +procedure UnRegisterNavBar(ASender: TObject); +begin + TdxCustomNavBarAccess(ASender).FDesignHelper := nil; +end; + +initialization + FOnRegisterNavBar := RegisterNavBar; + FOnUnRegisterNavBar := UnRegisterNavBar; + +end. + diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarSkinBasedViews.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarSkinBasedViews.pas new file mode 100644 index 00000000..6030d113 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarSkinBasedViews.pas @@ -0,0 +1,1515 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarSkinBasedViews; + +interface + +uses + Types, Windows, Graphics, Classes, SysUtils, ImgList, cxGraphics, cxClasses, + dxNavBar, dxNavBarBase, dxNavBarCollns, dxNavBarStyles, dxNavBarExplorerViews, + dxNavBarConsts, dxNavBarOffice11Views, dxNavBarOfficeViews, dxSkinsStrs, + dxSkinsCore, dxSkinInfo, cxLookAndFeelPainters; + +type + IdxNavBarColorSchemes = interface + ['{C49F9017-0A09-4C8E-BF28-BA5BE0614580}'] + function GetCount: Integer; + function GetNames(AIndex: Integer): TdxSkinName; + function GetName: TdxSkinName; + procedure SetName(AValue: TdxSkinName); + end; + + TdxNavBarSkin = class(TdxSkin) + procedure LoadFromResource(hInst: THandle); override; + end; + + TdxNavBarSkinInfo = class(TdxSkinInfo) + protected + procedure InitializeAdditionalNavBarElements; virtual; + procedure InitializeSkinInfo; override; + public + NavBarDragDropItemTarget: TdxSkinElement; + NavBarSeparator: TdxSkinElement; + end; + + TdxNavBarSkinBasedPainterHelper = class(TcxIUnknownObject, IdxNavBarColorSchemes) + private + FCachedPainterData: TdxSkinInfo; + FSkinName: TdxSkinName; + FOnChanged: TNotifyEvent; + protected + { IdxNavBarColorSchemes } + function IdxNavBarColorSchemes.GetCount = GetSkinsCount; + function IdxNavBarColorSchemes.GetNames = GetSkinNames; + function IdxNavBarColorSchemes.GetName = GetSkinName; + procedure IdxNavBarColorSchemes.SetName = SetSkinName; + + procedure DoChanged; virtual; + function GetFullSkinName: TdxSkinName; virtual; + function GetSkinsCount: Integer; virtual; + function GetSkinNames(AIndex: Integer): TdxSkinName; virtual; + function GetSkinInfoClass: TdxSkinInfoClass; virtual; + function GetSkinName: TdxSkinName; virtual; + function GetSkinPainterData(var AData: TdxSkinInfo): Boolean; virtual; + function IsSkinAvailable: Boolean; virtual; + procedure SetSkinName(AValue: TdxSkinName); virtual; + public + constructor Create(ASkinName: TdxSkinName); virtual; + destructor Destroy; override; + // Skin elements and properties + function NavBarBackground: TdxSkinElement; virtual; + function NavBarDragDropItemTarget: TdxSkinElement; virtual; + function NavBarGroupButtonCaption: TdxSkinElement; virtual; + function NavBarGroupClient: TdxSkinElement; virtual; + function NavBarGroupSigns (AIsClose: Boolean): TdxSkinElement; virtual; + function NavBarItem: TdxSkinElement; virtual; + function NavBarScrollBarElements(AIsHorizontal: Boolean; APart: TcxScrollBarPart): TdxSkinScrollInfo; virtual; + function NavBarSeparator: TdxSkinElement; virtual; + function NavPaneCaptionFontSize: TdxSkinIntegerProperty; virtual; + function NavPaneCaptionHeight: TdxSkinIntegerProperty; virtual; + function NavPaneGroupButtonCaption(AIsSelected: Boolean): TdxSkinElement; virtual; + function NavPaneGroupClient: TdxSkinElement; virtual; + function NavPaneHeader: TdxSkinElement; virtual; + function NavePaneHeaderSign(ACollapse: Boolean): TdxSkinElement; virtual; + function NavPaneItem(AIsSelected: Boolean): TdxSkinElement; virtual; + function NavPaneItemPanel: TdxSkinElement; virtual; + function NavPaneOverflowPanel: TdxSkinElement; virtual; + function NavPaneOverflowPanelSign: TdxSkinElement; virtual; + function NavPaneOverflowPanelItem: TdxSkinElement; virtual; + function NavPanePopupControl: TdxSkinElement; virtual; + function NavPanePopupMenu: TdxSkinElement; virtual; + function NavPanePopupMenuSelection: TdxSkinElement; virtual; + function NavPanePopupMenuSeparator: TdxSkinElement; virtual; + function NavPanePopupMenuSideStrip: TdxSkinElement; virtual; + function NavPaneScrollButtons(AIsDown: Boolean): TdxSkinElement; virtual; + function NavPaneSplitter: TdxSkinElement; virtual; + function NavPaneSizeGrip: TdxSkinElement; virtual; + + property SkinName: TdxSkinName read GetSkinName write SetSkinName; + property OnChanged: TNotifyEvent read FOnChanged write FOnChanged; + end; + + TdxNavBarSkinBasedPainterHelperClass = class of TdxNavBarSkinBasedPainterHelper; + + { TdxNavBarSkinNavPaneLinkViewInfo } + + TdxNavBarSkinBasedNavPaneLinkViewInfo = class(TdxNavBarLinkViewInfo) + protected + function GetSkinHelper: TdxNavBarSkinBasedPainterHelper; + public + function FontColor: TColor; override; + function SelectionRect: TRect; override; + end; + + { TdxNavBarSkinNavPaneGroupViewInfo } + + TdxNavBarSkinBasedNavPaneGroupViewInfo = class(TdxNavBarNavigationPaneGroupViewInfo) + protected + function GetSkinHelper: TdxNavBarSkinBasedPainterHelper; + public + function CaptionFontColor: TColor; override; + end; + + { TdxNavBarSkinBasedOverflowPanelViewInfo } + + TdxNavBarSkinBasedOverflowPanelViewInfo = class(TdxNavBarOverflowPanelViewInfo) + protected + function GetSkinHelper: TdxNavBarSkinBasedPainterHelper; + function IsSkinAvailable: Boolean; + + function GetClientOffset: TRect; override; + function GetSignWidth: Integer; override; + end; + + { TdxNavBarSkinBasedNavPaneViewInfo } + + TdxNavBarSkinBasedNavPaneViewInfo = class(TdxNavBarNavigationPaneViewInfo) + protected + function GetSkinHelper: TdxNavBarSkinBasedPainterHelper; virtual; + function IsSkinAvailable: Boolean; + + function GetDragDropItemTargetHeight: Integer; + function GetGroupBorderOffsets: TRect; override; + function GetGroupEdges: TPoint; override; + function GetGroupHeaderTextIndent: Integer; override; + function GetOverflowPanelViewInfoClass: TdxNavBarOverflowPanelViewInfoClass; override; + public + procedure AssignDefaultNavigationPaneHeaderStyle; override; + function BorderColor: TColor; override; + function CollapseBarFontColor: TColor; override; + function GetHeaderHeight: Integer; override; + function GetSplitterHeight: Integer; override; + function HeaderFontColor: TColor; override; + end; + + TdxNavBarSkinBasedPopupControlViewInfo = class(TdxNavBarPopupControlViewInfo) + protected + function GetSkinHelper: TdxNavBarSkinBasedPainterHelper; + function GetBorderOffsets: TRect; override; + end; + + { TdxNavBarSkinBasedNavPanePainter } + + TdxNavBarSkinBasedNavPanePainter = class(TdxNavBarNavigationPanePainter, IdxNavBarColorSchemes) + private + function GetOverflowPanelViewInfo: TdxNavBarSkinBasedOverflowPanelViewInfo; + function InternalDrawScrollButton(ADownButton: Boolean; const ARect: TRect; + AState: TdxNavBarObjectStates): Boolean; + protected + FSkinBasedPainterHelper: TdxNavBarSkinBasedPainterHelper; + + function CreateSkinHelper: TdxNavBarSkinBasedPainterHelper; virtual; + + class function GetViewInfoClass: TdxNavBarViewInfoClass; override; + class function GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; override; + class function GetLinkViewInfoClass: TdxNavBarLinkViewInfoClass; override; + class function GetSkinPainterHelperClass: TdxNavBarSkinBasedPainterHelperClass; virtual; + class function GetPopupControlViewInfoClass: TdxNavBarPopupControlViewInfoClass; override; + + procedure ColorSchemeChanged(ASender: TObject); virtual; + function GetColorSchemeHelper: IdxNavBarColorSchemes; virtual; + function GetDefaultColorSchemeName: TdxSkinName; virtual; + function GetColorSchemeName: TdxSkinName; virtual; + function IsSkinAvailable: Boolean; virtual; + procedure SetColorSchemeName(const AValue: TdxSkinName); virtual; + + function GetNavPaneElementState(const APart: TdxNavBarPart): TdxSkinElementState; + function GetSplitterType: Integer; virtual; + // Drawing + procedure DoDrawDropTargetLinkSelection(AItemGroup: TdxNavBarGroupViewInfo; AItem1, AItem2: TdxNavBarLinkViewInfo); override; + procedure DoDrawSplitter; override; + + property ColorSchemeHelper: IdxNavBarColorSchemes read GetColorSchemeHelper implements IdxNavBarColorSchemes; + public + constructor Create(ANavBar: TdxCustomNavBar); override; + destructor Destroy; override; + // Drawing + procedure DrawBottomScrollButton; override; + procedure DrawCollapseElementBackground(const ARect: TRect; AState: TdxNavBarNavPanePartState); override; + procedure DrawGroupCaptionButton(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawHeaderBackground; override; + procedure DrawHeaderSign; override; + procedure DrawItemSelection(ALinkViewInfo: TdxNavBarLinkViewInfo); override; + procedure DrawOverflowPanelBackground; override; + procedure DrawOverflowPanelItems; override; + procedure DrawOverflowPanelSign; override; + procedure DrawPopupControl(ACanvas: TcxCanvas; AViewInfo: TdxNavBarPopupControlViewInfo); override; + procedure DrawPopupMenuItem(ACanvas: TCanvas; ARect: TRect; + AImageList: TCustomImageList; AImageIndex: Integer; AText: String; + State: TdxNavBarObjectStates); override; + procedure DrawSeparator(ALinkViewInfo: TdxNavBarLinkViewInfo); override; + procedure DrawTopScrollButton; override; + + property OverflowPanelViewInfo: TdxNavBarSkinBasedOverflowPanelViewInfo read GetOverflowPanelViewInfo; + property ColorSchemeName: TdxSkinName read GetColorSchemeName write SetColorSchemeName; + end; + + { TdxNavBarSkinBasedExplorerBarViewInfo } + + TdxNavBarSkinBasedExplorerBarViewInfo = class(TdxNavBarOffice11ExplorerBarViewInfo) + protected + function GetSkinHelper: TdxNavBarSkinBasedPainterHelper; + + function GetDragDropItemTargetHeight: Integer; + function GetGroupBorderOffsets: TRect; override; + end; + + { TdxNavBarSkinExplorerBarPainter } + + TdxNavBarSkinBasedExplorerBarPainter = class(TdxNavBarOffice11ExplorerBarPainter, IdxNavBarColorSchemes) + protected + FSkinBasedPainterHelper: TdxNavBarSkinBasedPainterHelper; + + function CreateSkinHelper: TdxNavBarSkinBasedPainterHelper; virtual; + + class function GetViewInfoClass: TdxNavBarViewInfoClass; override; + class function GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; override; + class function GetLinkViewInfoClass: TdxNavBarLinkViewInfoClass; override; + class function GetSkinPainterHelperClass: TdxNavBarSkinBasedPainterHelperClass; virtual; + + procedure ColorSchemeChanged(ASender: TObject); virtual; + function GetColorSchemeName: TdxSkinName; virtual; + function GetColorSchemeHelper: IdxNavBarColorSchemes; virtual; + function GetDefaultColorSchemeName: TdxSkinName; virtual; + function IsSkinAvailable: Boolean; virtual; + procedure SetColorSchemeName(const AValue: TdxSkinName); virtual; + + procedure DoDrawDropTargetLinkSelection(AItemGroup: TdxNavBarGroupViewInfo; AItem1, AItem2: TdxNavBarLinkViewInfo); override; + function IsGroupCaptionButtonCompositeDraw(AGroupViewInfo: TdxNavBarGroupViewInfo): Boolean; virtual; + + property ColorSchemeHelper: IdxNavBarColorSchemes read GetColorSchemeHelper implements IdxNavBarColorSchemes; + public + constructor Create(ANavBar: TdxCustomNavBar); override; + destructor Destroy; override; + + procedure DrawGroupBorder(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawGroupCaptionButton(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawGroupCaptionSign(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawGroupControlSplitter(AGroupViewInfo: TdxNavBarExplorerBarGroupViewInfo); override; + procedure DrawSeparator(ALinkViewInfo: TdxNavBarLinkViewInfo); override; + + property ColorSchemeName: TdxSkinName read GetColorSchemeName write SetColorSchemeName; + end; + + { TdxNavBarSkinExplorerBarLinkViewInfo } + + TdxNavBarSkinBasedExplorerBarLinkViewInfo = class(TdxNavBarOffice3LinkViewInfo) + public + function FontColor: TColor; override; + end; + + { TdxNavBarSkinExplorerBarGroupViewInfo } + + TdxNavBarSkinBasedExplorerBarGroupViewInfo = class(TdxNavBarExplorerBarGroupViewInfo) + public + function CaptionFontColor: TColor; override; + procedure CalculateBounds(var X, Y: Integer); override; + end; + +function GetNavBarColorSchemes(APainter: TdxNavBarPainter): IdxNavBarColorSchemes; + +function NavBarObjectStateToSkinState(AState: TdxNavBarObjectStates): TdxSkinElementState; +function GetSkinElementOffsets(AElement: TdxSkinElement): TRect; +function DrawSkinElement(AElement: TdxSkinElement; ACanvas: TCanvas; const ARect: TRect; + AImageIndex: Integer = 0; AState: TdxSkinElementState = esNormal; ADrawContentOnly: Boolean = False): Boolean; + +implementation + +uses + Math, cxGeometry, dxNavBarGraphics; + +const + //Additional NavBar elements + sdxNavBarDragDropItemTarget = 'DragDropItemTarget'; + sdxNavBarSeparator = 'Separator'; + +type + TdxNavBarNavigationPaneControllerAccess = class(TdxNavBarNavigationPaneController); + +function GetNavBarColorSchemes(APainter: TdxNavBarPainter): IdxNavBarColorSchemes; +begin + Supports(APainter, IdxNavBarColorSchemes, Result); +end; + +function NavBarObjectStateToSkinState(AState: TdxNavBarObjectStates): TdxSkinElementState; +begin + Result := esNormal; + if sPressed in AState then + Result := esPressed + else + if sHotTracked in AState then + Result := esHot + else + if sDisabled in AState then + Result := esDisabled; +end; + +function GetSkinElementOffsets(AElement: TdxSkinElement): TRect; +begin + if AElement <> nil then + begin + Result := AElement.ContentOffset.Rect; + if cxRectIsNull(Result) then + with AElement.Borders do + Result := cxRect(Left.Thin, Top.Thin, Right.Thin, Bottom.Thin); + end + else + Result := cxNullRect; +end; + +function DrawSkinElement(AElement: TdxSkinElement; ACanvas: TCanvas; const ARect: TRect; + AImageIndex: Integer = 0; AState: TdxSkinElementState = esNormal; ADrawContentOnly: Boolean = False): Boolean; +var + AcxCanvas: TcxCanvas; + ADrawRect: TRect; +begin + if AElement <> nil then + begin + Result := True; + AcxCanvas := TcxCanvas.Create(ACanvas); + AcxCanvas.SaveClipRegion; + try + AcxCanvas.SetClipRegion(TcxRegion.Create(ARect), roIntersect); + if ADrawContentOnly then + ADrawRect := cxRectContent(ARect, cxRectInvert(GetSkinElementOffsets(AElement))) + else + ADrawRect := ARect; + AElement.Draw(AcxCanvas.Handle, ADrawRect, AImageIndex, AState); + finally + AcxCanvas.RestoreClipRegion; + AcxCanvas.Free; + end; + end + else + Result := False; +end; + +{ TdxNavBarSkin} + +procedure TdxNavBarSkin.LoadFromResource(hInst: THandle); +var + AStream: TStream; +begin + AStream := TResourceStream.Create(hInst, Name, PChar(sdxNavBarResourceType)); + try + LoadFromStream(AStream); + finally + AStream.Free; + end; +end; + +{ TdxNavBarSkinInfo } + +procedure TdxNavBarSkinInfo.InitializeAdditionalNavBarElements; +begin + NavBarDragDropItemTarget := GetElementByName(Group_NavBar, sdxNavBarDragDropItemTarget); + NavBarSeparator := GetElementByName(Group_NavBar, sdxNavBarSeparator); +end; + +procedure TdxNavBarSkinInfo.InitializeSkinInfo; +begin + inherited; + InitializeAdditionalNavBarElements; +end; + +{ TdxNavBarSkinBasedPainterHelper } + +constructor TdxNavBarSkinBasedPainterHelper.Create(ASkinName: TdxSkinName); +begin + inherited Create; + FSkinName := ASkinName; +end; + +destructor TdxNavBarSkinBasedPainterHelper.Destroy; +begin + FreeAndNil(FCachedPainterData); + inherited; +end; + +procedure TdxNavBarSkinBasedPainterHelper.DoChanged; +begin + CallNotify(OnChanged, Self); +end; + +function TdxNavBarSkinBasedPainterHelper.GetFullSkinName: TdxSkinName; +begin + Result := SkinName; +end; + +function TdxNavBarSkinBasedPainterHelper.GetSkinsCount: Integer; +begin + Result := 0; +end; + +function TdxNavBarSkinBasedPainterHelper.GetSkinNames(AIndex: Integer): TdxSkinName; +begin + Result := ''; +end; + +function TdxNavBarSkinBasedPainterHelper.GetSkinInfoClass: TdxSkinInfoClass; +begin + Result := TdxNavBarSkinInfo; +end; + +function TdxNavBarSkinBasedPainterHelper.GetSkinName: TdxSkinName; +begin + Result := FSkinName; +end; + +function TdxNavBarSkinBasedPainterHelper.GetSkinPainterData(var AData: TdxSkinInfo): Boolean; +begin + if (FCachedPainterData = nil) and IsGdiPlusAvailable then + FCachedPainterData := GetSkinInfoClass.Create( + TdxNavBarSkin.Create(GetFullSkinName, True, HInstance)); + AData := FCachedPainterData; + Result := AData <> nil; +end; + +function TdxNavBarSkinBasedPainterHelper.IsSkinAvailable: Boolean; +var + AData: TdxSkinInfo; +begin + Result := GetSkinPainterData(AData); +end; + +procedure TdxNavBarSkinBasedPainterHelper.SetSkinName(AValue: TdxSkinName); +begin + if FSkinName <> AValue then + begin + FreeAndNil(FCachedPainterData); + FSkinName := AValue; + DoChanged; + end; +end; + +function TdxNavBarSkinBasedPainterHelper.NavBarBackground: TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.NavBarBackgroundColor; +end; + +function TdxNavBarSkinBasedPainterHelper.NavBarDragDropItemTarget: TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := TdxNavBarSkinInfo(ASkinInfo).NavBarDragDropItemTarget; +end; + +function TdxNavBarSkinBasedPainterHelper.NavBarGroupButtonCaption: TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.NavBarGroupHeader; +end; + +function TdxNavBarSkinBasedPainterHelper.NavBarGroupClient: TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.NavBarGroupClient; +end; + +function TdxNavBarSkinBasedPainterHelper.NavBarGroupSigns( + AIsClose: Boolean): TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.NavBarGroupButtons[AIsClose]; +end; + +function TdxNavBarSkinBasedPainterHelper.NavBarItem: TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.NavBarItem; +end; + +function TdxNavBarSkinBasedPainterHelper.NavBarScrollBarElements( + AIsHorizontal: Boolean; APart: TcxScrollBarPart): TdxSkinScrollInfo; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.ScrollBar_Elements[AIsHorizontal, APart]; +end; + +function TdxNavBarSkinBasedPainterHelper.NavBarSeparator: TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := TdxNavBarSkinInfo(ASkinInfo).NavBarSeparator; +end; + +function TdxNavBarSkinBasedPainterHelper.NavPaneCaptionFontSize: TdxSkinIntegerProperty; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.NavPaneCaptionFontSize; +end; + +function TdxNavBarSkinBasedPainterHelper.NavPaneCaptionHeight: TdxSkinIntegerProperty; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.NavPaneCaptionHeight; +end; + +function TdxNavBarSkinBasedPainterHelper.NavPaneGroupButtonCaption( + AIsSelected: Boolean): TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.NavPaneGroupButton[AIsSelected]; +end; + +function TdxNavBarSkinBasedPainterHelper.NavPaneGroupClient: TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.NavPaneGroupClient; +end; + +function TdxNavBarSkinBasedPainterHelper.NavPaneHeader: TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.NavPaneGroupCaption; +end; + +function TdxNavBarSkinBasedPainterHelper.NavePaneHeaderSign(ACollapse: Boolean): TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + if ACollapse then + Result := ASkinInfo.NavPaneCollapseButton + else + Result := ASkinInfo.NavPaneExpandButton; +end; + +function TdxNavBarSkinBasedPainterHelper.NavPaneItem( + AIsSelected: Boolean): TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + if AIsSelected then + Result := ASkinInfo.NavPaneSelectedItem + else + Result := ASkinInfo.NavPaneItem; +end; + +function TdxNavBarSkinBasedPainterHelper.NavPaneItemPanel: TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.NavPaneCollapsedGroupClient; +end; + +function TdxNavBarSkinBasedPainterHelper.NavPaneOverflowPanel: TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.NavPaneOverflowPanel; +end; + +function TdxNavBarSkinBasedPainterHelper.NavPaneOverflowPanelSign: TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.NavPaneOverflowPanelExpandedItem; +end; + +function TdxNavBarSkinBasedPainterHelper.NavPaneOverflowPanelItem: TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.NavPaneOverflowPanelItem; +end; + +function TdxNavBarSkinBasedPainterHelper.NavPanePopupControl: TdxSkinElement; +begin + Result := NavBarBackground; +end; + +function TdxNavBarSkinBasedPainterHelper.NavPanePopupMenu: TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.PopupMenu; +end; + +function TdxNavBarSkinBasedPainterHelper.NavPanePopupMenuSelection: TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.PopupMenuLinkSelected; +end; + +function TdxNavBarSkinBasedPainterHelper.NavPanePopupMenuSeparator: TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.PopupMenuSeparator; +end; + +function TdxNavBarSkinBasedPainterHelper.NavPanePopupMenuSideStrip: TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.PopupMenuSideStrip; +end; + +function TdxNavBarSkinBasedPainterHelper.NavPaneScrollButtons( + AIsDown: Boolean): TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.NavPaneScrollButtons[AIsDown]; +end; + +function TdxNavBarSkinBasedPainterHelper.NavPaneSplitter: TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.NavPaneSplitter; +end; + +function TdxNavBarSkinBasedPainterHelper.NavPaneSizeGrip: TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.NavPaneFormSizeGrip; +end; + + { TdxNavBarSkinBasedNavPaneGroupViewInfo } + +function TdxNavBarSkinBasedNavPaneGroupViewInfo.CaptionFontColor: TColor; +var + AElement: TdxSkinElement; +begin + AElement := GetSkinHelper.NavPaneGroupButtonCaption(False); + if AElement <> nil then + Result := AElement.TextColor + else + Result := inherited CaptionFontColor; +end; + +function TdxNavBarSkinBasedNavPaneGroupViewInfo.GetSkinHelper: TdxNavBarSkinBasedPainterHelper; +begin + Result := TdxNavBarSkinBasedNavPanePainter(Painter).FSkinBasedPainterHelper; +end; + +{ TdxNavBarSkinBasedNavPaneLinkViewInfo } + +function TdxNavBarSkinBasedNavPaneLinkViewInfo.FontColor: TColor; +var + AElement: TdxSkinElement; +begin + AElement := GetSkinHelper.NavPaneItem(False); + if (AElement <> nil) and (Item.Enabled) then + Result := AElement.TextColor + else + Result := inherited FontColor; +end; + +function TdxNavBarSkinBasedNavPaneLinkViewInfo.SelectionRect: TRect; +begin + Result := Rect; + InflateRect(Result, -2, 0); +end; + +function TdxNavBarSkinBasedNavPaneLinkViewInfo.GetSkinHelper: TdxNavBarSkinBasedPainterHelper; +begin + Result := TdxNavBarSkinBasedNavPanePainter(Painter).FSkinBasedPainterHelper; +end; + +{ TdxNavBarSkinBasedOverflowPanelViewInfo } + +function TdxNavBarSkinBasedOverflowPanelViewInfo.GetSkinHelper: TdxNavBarSkinBasedPainterHelper; +begin + Result := TdxNavBarSkinBasedNavPanePainter(Painter).FSkinBasedPainterHelper; +end; + +function TdxNavBarSkinBasedOverflowPanelViewInfo.IsSkinAvailable: Boolean; +begin + Result := TdxNavBarSkinBasedNavPanePainter(Painter).IsSkinAvailable; +end; + +function TdxNavBarSkinBasedOverflowPanelViewInfo.GetClientOffset: TRect; +var + AElement: TdxSkinElement; +begin + AElement := GetSkinHelper.NavPaneOverflowPanel; + if AElement = nil then + Result := inherited GetClientOffset + else + Result := AElement.ContentOffset.Rect; +end; + +function TdxNavBarSkinBasedOverflowPanelViewInfo.GetSignWidth: Integer; +var + AElement: TdxSkinElement; +begin + Result := inherited GetSignWidth; + if Result <> 0 then + begin + AElement := GetSkinHelper.NavPaneOverflowPanelSign; + if AElement <> nil then + Result := AElement.Size.cx; + end; +end; + +{ TdxNavBarSkinBasedNavPaneViewInfo } + +procedure TdxNavBarSkinBasedNavPaneViewInfo.AssignDefaultNavigationPaneHeaderStyle; +var + AElement: TdxSkinIntegerProperty; +begin + inherited; + AElement := GetSkinHelper.NavPaneCaptionFontSize; + if AElement <> nil then + NavBar.DefaultStyles.NavigationPaneHeader.Font.Size := AElement.Value; +end; + +function TdxNavBarSkinBasedNavPaneViewInfo.BorderColor: TColor; +var + AElement: TdxSkinElement; +begin + AElement := GetSkinHelper.NavBarBackground; + if AElement <> nil then + Result := AElement.Borders.Left.Color + else + Result := inherited BorderColor; +end; + +function TdxNavBarSkinBasedNavPaneViewInfo.CollapseBarFontColor: TColor; +var + AElement: TdxSkinElement; +begin + AElement := GetSkinHelper.NavPaneItemPanel; + if AElement <> nil then + Result := AElement.TextColor + else + Result := inherited CollapseBarFontColor; +end; + +function TdxNavBarSkinBasedNavPaneViewInfo.HeaderFontColor: TColor; +var + AElement: TdxSkinElement; +begin + AElement := GetSkinHelper.NavPaneHeader; + if AElement <> nil then + Result := AElement.TextColor + else + Result := inherited HeaderFontColor; +end; + +function TdxNavBarSkinBasedNavPaneViewInfo.GetHeaderHeight: Integer; +var + AElement: TdxSkinIntegerProperty; +begin + Result := inherited GetHeaderHeight; + if Result <> 0 then + begin + AElement := GetSkinHelper.NavPaneCaptionHeight; + if AElement <> nil then + Result := Max(AElement.Value, Result); + end; +end; + +function TdxNavBarSkinBasedNavPaneViewInfo.GetSplitterHeight: Integer; +begin + Result := inherited GetSplitterHeight; + if IsSkinAvailable and (Result <> 0) then + Result := 8; +end; + +function TdxNavBarSkinBasedNavPaneViewInfo.GetSkinHelper: TdxNavBarSkinBasedPainterHelper; +begin + Result := TdxNavBarSkinBasedNavPanePainter(Painter).FSkinBasedPainterHelper; +end; + +function TdxNavBarSkinBasedNavPaneViewInfo.IsSkinAvailable: Boolean; +begin + Result := TdxNavBarSkinBasedNavPanePainter(Painter).IsSkinAvailable; +end; + +function TdxNavBarSkinBasedNavPaneViewInfo.GetDragDropItemTargetHeight: Integer; +var + AElement: TdxSkinElement; +begin + Result := 0; + AElement := GetSkinHelper.NavBarDragDropItemTarget; + if AElement <> nil then + Result := AElement.Size.cy; +end; + +function TdxNavBarSkinBasedNavPaneViewInfo.GetGroupBorderOffsets: TRect; +begin + Result := inherited GetGroupBorderOffsets; + Inc(Result.Left, BorderWidth); + Inc(Result.Right, BorderWidth); +end; + +function TdxNavBarSkinBasedNavPaneViewInfo.GetGroupEdges: TPoint; +begin + if IsSkinAvailable then + Result := cxNullPoint + else + Result := inherited GetGroupEdges; +end; + +function TdxNavBarSkinBasedNavPaneViewInfo.GetGroupHeaderTextIndent: Integer; +begin + if IsSkinAvailable then + Result := 8 + else + Result := inherited GetGroupHeaderTextIndent; +end; + +function TdxNavBarSkinBasedNavPaneViewInfo.GetOverflowPanelViewInfoClass: TdxNavBarOverflowPanelViewInfoClass; +begin + Result := TdxNavBarSkinBasedOverflowPanelViewInfo; +end; + +{ TdxNavBarSkinBasedPopupControlViewInfo } + +function TdxNavBarSkinBasedPopupControlViewInfo.GetSkinHelper: TdxNavBarSkinBasedPainterHelper; +begin + Result := TdxNavBarSkinBasedNavPanePainter(Painter).FSkinBasedPainterHelper; +end; + +function TdxNavBarSkinBasedPopupControlViewInfo.GetBorderOffsets: TRect; +var + AElement: TdxSkinElement; +begin + AElement := GetSkinHelper.NavPanePopupControl; + if AElement <> nil then + Result := AElement.ContentOffset.Rect + else + Result := inherited GetBorderOffsets; +end; + +{ TdxNavBarSkinBasedNavPanePainter } + +constructor TdxNavBarSkinBasedNavPanePainter.Create(ANavBar: TdxCustomNavBar); +begin + inherited Create(ANavBar); + FSkinBasedPainterHelper := CreateSkinHelper; + FSkinBasedPainterHelper.OnChanged := ColorSchemeChanged; +end; + +destructor TdxNavBarSkinBasedNavPanePainter.Destroy; +begin + FSkinBasedPainterHelper.OnChanged := nil; + FreeAndNil(FSkinBasedPainterHelper); + inherited Destroy; +end; + +function TdxNavBarSkinBasedNavPanePainter.CreateSkinHelper: TdxNavBarSkinBasedPainterHelper; +begin + Result := GetSkinPainterHelperClass.Create(GetDefaultColorSchemeName); +end; + +class function TdxNavBarSkinBasedNavPanePainter.GetViewInfoClass: TdxNavBarViewInfoClass; +begin + Result := TdxNavBarSkinBasedNavPaneViewInfo; +end; + +class function TdxNavBarSkinBasedNavPanePainter.GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; +begin + Result := TdxNavBarSkinBasedNavPaneGroupViewInfo; +end; + +class function TdxNavBarSkinBasedNavPanePainter.GetLinkViewInfoClass: TdxNavBarLinkViewInfoClass; +begin + Result := TdxNavBarSkinBasedNavPaneLinkViewInfo; +end; + +class function TdxNavBarSkinBasedNavPanePainter.GetSkinPainterHelperClass: TdxNavBarSkinBasedPainterHelperClass; +begin + Result := TdxNavBarSkinBasedPainterHelper; +end; + +class function TdxNavBarSkinBasedNavPanePainter.GetPopupControlViewInfoClass: TdxNavBarPopupControlViewInfoClass; +begin + Result := TdxNavBarSkinBasedPopupControlViewInfo; +end; + +procedure TdxNavBarSkinBasedNavPanePainter.ColorSchemeChanged(ASender: TObject); +begin + NavBar.InvalidateAll(doRecreate); +end; + +function TdxNavBarSkinBasedNavPanePainter.GetColorSchemeHelper: IdxNavBarColorSchemes; +begin + Supports(FSkinBasedPainterHelper, IdxNavBarColorSchemes, Result); +end; + +function TdxNavBarSkinBasedNavPanePainter.GetDefaultColorSchemeName: TdxSkinName; +begin + Result := ''; +end; + +function TdxNavBarSkinBasedNavPanePainter.GetColorSchemeName: TdxSkinName; +begin + Result := FSkinBasedPainterHelper.SkinName; +end; + +function TdxNavBarSkinBasedNavPanePainter.IsSkinAvailable: Boolean; +begin + Result := FSkinBasedPainterHelper.IsSkinAvailable; +end; + +procedure TdxNavBarSkinBasedNavPanePainter.SetColorSchemeName(const AValue: TdxSkinName); +begin + FSkinBasedPainterHelper.SkinName := AValue; +end; + +function TdxNavBarSkinBasedNavPanePainter.GetNavPaneElementState(const APart: TdxNavBarPart): TdxSkinElementState; +const + AElementMap: array[TdxNavBarNavPanePartState] of TdxSkinElementState = + (esNormal, esHot, esPressed, esChecked, esHotCheck, esDroppedDown); +begin + Result := AElementMap[GetNavPanePartState(APart)]; +end; + +function TdxNavBarSkinBasedNavPanePainter.GetSplitterType: Integer; +begin + Result := Byte(not TdxNavBarNavigationPaneControllerAccess(Controller).Collapsed); +end; + +procedure TdxNavBarSkinBasedNavPanePainter.DoDrawDropTargetLinkSelection(AItemGroup: TdxNavBarGroupViewInfo; AItem1, AItem2: TdxNavBarLinkViewInfo); +var + ARect: TRect; + AHeight: Integer; +begin + AHeight := TdxNavBarSkinBasedNavPaneViewInfo(ViewInfo).GetDragDropItemTargetHeight; + if AItem1 <> nil then + ARect := cxRectSetBottom(AItem1.Rect, AItem1.Rect.Bottom, AHeight) + else + ARect := cxRectSetTop(AItem2.Rect, AItem2.Rect.Top, AHeight); + if not DrawSkinElement(FSkinBasedPainterHelper.NavBarDragDropItemTarget, Canvas, ARect) then + inherited; +end; + +procedure TdxNavBarSkinBasedNavPanePainter.DoDrawSplitter; +begin + if not DrawSkinElement(FSkinBasedPainterHelper.NavPaneSplitter, Canvas, ViewInfo.SplitterRect, + GetSplitterType) then + inherited; +end; + +function TdxNavBarSkinBasedNavPanePainter.GetOverflowPanelViewInfo: TdxNavBarSkinBasedOverflowPanelViewInfo; +begin + Result := TdxNavBarSkinBasedOverflowPanelViewInfo(inherited OverflowPanelViewInfo); +end; + +function TdxNavBarSkinBasedNavPanePainter.InternalDrawScrollButton(ADownButton: Boolean; + const ARect: TRect; AState: TdxNavBarObjectStates): Boolean; +begin + Result := DrawSkinElement(FSkinBasedPainterHelper.NavPaneScrollButtons(ADownButton), Canvas, ARect, + 0, NavBarObjectStateToSkinState(AState)); +end; + +procedure TdxNavBarSkinBasedNavPanePainter.DrawBottomScrollButton; +begin + with ViewInfo do + if not InternalDrawScrollButton(True, BottomScrollButtonRect, + BottomScrollButtonState) + then + inherited DrawBottomScrollButton; +end; + +procedure TdxNavBarSkinBasedNavPanePainter.DrawCollapseElementBackground(const ARect: TRect; AState: TdxNavBarNavPanePartState); +const + AElementMap: array[TdxNavBarNavPanePartState] of TdxSkinElementState = + (esNormal, esHot, esPressed, esChecked, esHotCheck, esDroppedDown); +begin + if not DrawSkinElement(FSkinBasedPainterHelper.NavPaneItemPanel, Canvas, ARect, 0, AElementMap[AState]) then + inherited; +end; + +procedure TdxNavBarSkinBasedNavPanePainter.DrawHeaderBackground; +begin + if not DrawSkinElement(FSkinBasedPainterHelper.NavPaneHeader, Canvas, ViewInfo.HeaderRect) then + inherited; +end; + +procedure TdxNavBarSkinBasedNavPanePainter.DrawHeaderSign; +begin + if not DrawSkinElement(FSkinBasedPainterHelper.NavePaneHeaderSign(not NavBar.OptionsBehavior.NavigationPane.Collapsed), + Canvas, ViewInfo.HeaderSignRect, 0, GetNavPaneElementState(dxNavBarPart(nbHeaderSign))) then + inherited; +end; + +procedure TdxNavBarSkinBasedNavPanePainter.DrawGroupCaptionButton( + AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + if not DrawSkinElement(FSkinBasedPainterHelper.NavPaneGroupButtonCaption(sActive in AGroupViewInfo.State), + Canvas, cxRectInflate(AGroupViewInfo.CaptionRect, 0, 1, 0, 0), 0, NavBarObjectStateToSkinState(AGroupViewInfo.State)) then + inherited; +end; + +procedure TdxNavBarSkinBasedNavPanePainter.DrawItemSelection( + ALinkViewInfo: TdxNavBarLinkViewInfo); +var + AState: TdxSkinElementState; +begin + AState := NavBarObjectStateToSkinState(ALinkViewInfo.State); + if not DrawSkinElement(FSkinBasedPainterHelper.NavPaneItem((AState = esNormal) and (sSelected in ALinkViewInfo.State)), + Canvas, ALinkViewInfo.SelectionRect, 0, AState) then + inherited; +end; + +procedure TdxNavBarSkinBasedNavPanePainter.DrawOverflowPanelBackground; +begin + if not DrawSkinElement(FSkinBasedPainterHelper.NavPaneOverflowPanel, Canvas, ViewInfo.OverflowPanelRect) then + inherited; +end; + +procedure TdxNavBarSkinBasedNavPanePainter.DrawOverflowPanelItems; + + function GetOverflowPanelItemElementState(AIndex: Integer): TdxSkinElementState; + begin + Result := GetNavPaneElementState(dxNavBarPart(nbOverflowPanelItem, AIndex)); + case Result of + esChecked: + Result := esNormal; + esHotCheck: + Result := esHot; + end; + end; + +var + ASkinElement: TdxSkinElement; + AElementState: TdxSkinElementState; + AGroup: TdxNavBarGroup; + I: Integer; + R: TRect; +begin + ASkinElement := FSkinBasedPainterHelper.NavPaneOverflowPanelItem; + if ASkinElement = nil then + inherited DrawOverflowPanelItems + else + with ViewInfo do + for I := 0 to OverflowPanelVisibleItemCount - 1 do + begin + R := OverflowPanelItems[I].SelectionRect; + AGroup := OverflowPanelItems[I].Group; + AElementState := GetOverflowPanelItemElementState(I); + ASkinElement.Draw(Canvas.Handle, R, Byte(AGroup = NavBar.ActiveGroup), + AElementState); + R := ViewInfo.OverflowPanelItems[I].Rect; + with ImagePainterClass do + if IsValidImage(OverflowPanelViewInfo.GetImageList, OverflowPanelViewInfo.GetImageIndex(AGroup)) then + DrawImage(Canvas, OverflowPanelViewInfo.GetImageList, OverflowPanelViewInfo.GetImageIndex(AGroup), R) + else + if NavBar.NavigationPaneOverflowPanelUseSmallImages then + Canvas.Draw(R.Left, R.Top, dxOffice11NavPaneDefaultSmallBitmap) + else + Canvas.Draw(R.Left, R.Top, dxOffice11NavPaneDefaultLargeBitmap); + end; +end; + +procedure TdxNavBarSkinBasedNavPanePainter.DrawOverflowPanelSign; +begin + if not DrawSkinElement(FSkinBasedPainterHelper.NavPaneOverflowPanelSign, Canvas, ViewInfo.OverflowPanelSignRect, + 0, GetNavPaneElementState(dxNavBarPart(nbOverflowPanelSign))) then + inherited; +end; + +procedure TdxNavBarSkinBasedNavPanePainter.DrawPopupControl(ACanvas: TcxCanvas; AViewInfo: TdxNavBarPopupControlViewInfo); +var + AElement: TdxSkinElement; +begin + AElement := FSkinBasedPainterHelper.NavPanePopupControl; + if AElement = nil then + inherited DrawPopupControl(ACanvas, AViewInfo) + else + begin + ACanvas.SaveClipRegion; + try + ACanvas.ExcludeClipRect(AViewInfo.ClientRect); + AElement.Draw(ACanvas.Handle, AViewInfo.Rect); + finally + ACanvas.RestoreClipRegion; + end; + end; +end; + +procedure TdxNavBarSkinBasedNavPanePainter.DrawPopupMenuItem(ACanvas: TCanvas; ARect: TRect; + AImageList: TCustomImageList; AImageIndex: Integer; AText: String; + State: TdxNavBarObjectStates); +var + ABuf: TcxBitmap; + APopupMenu: TdxSkinElement; + ASelected: TdxSkinElement; + ASeparator: TdxSkinElement; + ASideStrip: TdxSkinElement; + AImageAreaWidth: Integer; + R: TRect; + + function InitializeElements: Boolean; + begin + APopupMenu := FSkinBasedPainterHelper.NavPanePopupMenu; + ASelected := FSkinBasedPainterHelper.NavPanePopupMenuSelection; + ASeparator := FSkinBasedPainterHelper.NavPanePopupMenuSeparator; + ASideStrip := FSkinBasedPainterHelper.NavPanePopupMenuSideStrip; + Result := (APopupMenu <> nil) and (ASelected <> nil) and (ASeparator <> nil) and + (ASideStrip <> nil); + end; + + procedure DrawImage(ACanvas: TCanvas; AIsActive: Boolean; AImageAreaWidth: Integer); + var + R: TRect; + begin + R := ARect; + OffsetRect(R, -R.Left, -R.Top); + R.Right := R.Left + AImageAreaWidth; + + if AIsActive then + ASelected.Draw(ACanvas.Handle, R); + + with TdxNavBarSkinBasedNavPaneViewInfo(ViewInfo) do + InflateRect(R, -OverflowPanelViewInfo.GetPopupMenuImageIndent, + -OverflowPanelViewInfo.GetPopupMenuImageIndent); + AImageList.Draw(ACanvas, R.Left, R.Top, AImageIndex, not (sDisabled in State)); + end; + + procedure DrawItemText(ACanvas: TCanvas; AImageAreaWidth: Integer); + var + R: TRect; + begin + R := ARect; + OffsetRect(R, -R.Left, -R.Top); + + with TdxNavBarSkinBasedNavPaneViewInfo(ViewInfo) do + R.Left := AImageAreaWidth + OverflowPanelViewInfo.GetPopupMenuTextIndent; + + if sDisabled in State then + ACanvas.Font.Color := clGrayText + else + ACanvas.Font.Color := clMenuText; + + ACanvas.Brush.Style := bsClear; + cxDrawText(ACanvas.Handle, AText, R, DT_LEFT or DT_VCENTER or DT_SINGLELINE); + end; + + procedure DrawMenuBackground(ACanvas: TCanvas; AImageAreaWidth: Integer); + var + R: TRect; + begin + R := ARect; + OffsetRect(R, -R.Left, -R.Top); + with APopupMenu.Borders do + begin + Dec(R.Left, Left.Thin); + Dec(R.Top, Top.Thin); + Inc(R.Right, Right.Thin); + Inc(R.Bottom, Bottom.Thin); + end; + APopupMenu.Draw(ABuf.Canvas.Handle, R); + + R := ARect; + OffsetRect(R, -R.Left, -R.Top); + R.Right := R.Left + AImageAreaWidth + 2; + ASideStrip.Draw(ABuf.Canvas.Handle, R); + end; + +begin + if not InitializeElements then + inherited DrawPopupMenuItem(ACanvas, ARect, AImageList, AImageIndex, AText, State) + else + begin + with TdxNavBarSkinBasedNavPaneViewInfo(ViewInfo) do + AImageAreaWidth := 2 * OverflowPanelViewInfo.GetPopupMenuImageIndent + GetSmallImageWidth; + + ABuf := TcxBitmap.CreateSize(ARect); + try + ABuf.Canvas.Font := ACanvas.Font; + ABuf.PixelFormat := pf32bit; + DrawMenuBackground(ABuf.Canvas, AImageAreaWidth); + if AText = '-' then + ASeparator.Draw(ABuf.Canvas.Handle, Rect(AImageAreaWidth + 4, + cxRectHeight(ARect) div 2, ABuf.Width, cxRectHeight(ARect) div 2 + 1)) + else + begin + if sSelected in State then + begin + R := ARect; + OffsetRect(R, -R.Left, -R.Top); + ASelected.Draw(ABuf.Canvas.Handle, R); + end; + DrawImage(ABuf.Canvas, sActive in State, AImageAreaWidth); + DrawItemText(ABuf.Canvas, AImageAreaWidth); + end; + BitBlt(ACanvas.Handle, ARect.Left, ARect.Top, ABuf.Width, ABuf.Height, + ABuf.Canvas.Handle, 0, 0, SRCCOPY); + finally + ABuf.Free; + end; + end; +end; + +procedure TdxNavBarSkinBasedNavPanePainter.DrawSeparator(ALinkViewInfo: TdxNavBarLinkViewInfo); +begin + if not DrawSkinElement(FSkinBasedPainterHelper.NavBarSeparator, Canvas, ALinkViewInfo.Rect) then + inherited; +end; + +procedure TdxNavBarSkinBasedNavPanePainter.DrawTopScrollButton; +begin + with ViewInfo do + if not InternalDrawScrollButton(False, TopScrollButtonRect, + TopScrollButtonState) + then + inherited DrawTopScrollButton; +end; + +{ TdxNavBarSkinBasedExplorerBarViewInfo } + +function TdxNavBarSkinBasedExplorerBarViewInfo.GetSkinHelper: TdxNavBarSkinBasedPainterHelper; +begin + Result := TdxNavBarSkinBasedExplorerBarPainter(Painter).FSkinBasedPainterHelper; +end; + +function TdxNavBarSkinBasedExplorerBarViewInfo.GetDragDropItemTargetHeight: Integer; +var + AElement: TdxSkinElement; +begin + Result := 0; + AElement := GetSkinHelper.NavBarDragDropItemTarget; + if AElement <> nil then + Result := AElement.Size.cy; +end; + +function TdxNavBarSkinBasedExplorerBarViewInfo.GetGroupBorderOffsets: TRect; +begin + Result := GetSkinElementOffsets(GetSkinHelper.NavBarGroupClient); +end; + +{ TdxNavBarSkinBasedExplorerBarPainter } + +constructor TdxNavBarSkinBasedExplorerBarPainter.Create(ANavBar: TdxCustomNavBar); +begin + inherited Create(ANavBar); + FSkinBasedPainterHelper := CreateSkinHelper; + FSkinBasedPainterHelper.OnChanged := ColorSchemeChanged; +end; + +destructor TdxNavBarSkinBasedExplorerBarPainter.Destroy; +begin + FSkinBasedPainterHelper.OnChanged := nil; + FreeAndNil(FSkinBasedPainterHelper); + inherited Destroy; +end; + +procedure TdxNavBarSkinBasedExplorerBarPainter.DrawGroupBorder(AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + if not DrawSkinElement(FSkinBasedPainterHelper.NavBarGroupClient, Canvas, AGroupViewInfo.ItemsRect) then + inherited; +end; + +procedure TdxNavBarSkinBasedExplorerBarPainter.DrawGroupCaptionButton( + AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + if not DrawSkinElement(FSkinBasedPainterHelper.NavBarGroupButtonCaption, Canvas, AGroupViewInfo.CaptionRect, + 0, NavBarObjectStateToSkinState(AGroupViewInfo.State), IsGroupCaptionButtonCompositeDraw(AGroupViewInfo)) then + inherited; +end; + +procedure TdxNavBarSkinBasedExplorerBarPainter.DrawGroupCaptionSign(AGroupViewInfo: TdxNavBarGroupViewInfo); +var + AElement: TdxSkinElement; +begin + AElement := FSkinBasedPainterHelper.NavBarGroupSigns(sExpanded in AGroupViewInfo.State); + if AElement = nil then + inherited DrawGroupCaptionSign(AGroupViewInfo) + else + if AGroupViewInfo.Group.ShowExpandButton then + AElement.Draw(Canvas.Handle, AGroupViewInfo.CaptionSignRect, 0, + NavBarObjectStateToSkinState(AGroupViewInfo.State)); +end; + +procedure TdxNavBarSkinBasedExplorerBarPainter.DrawGroupControlSplitter(AGroupViewInfo: TdxNavBarExplorerBarGroupViewInfo); +begin + if not DrawSkinElement(FSkinBasedPainterHelper.NavPaneSplitter, Canvas, AGroupViewInfo.SplitterRect, 0, esNormal, True) then + inherited; +end; + +procedure TdxNavBarSkinBasedExplorerBarPainter.DrawSeparator(ALinkViewInfo: TdxNavBarLinkViewInfo); +begin + if not DrawSkinElement(FSkinBasedPainterHelper.NavBarSeparator, Canvas, ALinkViewInfo.Rect) then + inherited; +end; + +function TdxNavBarSkinBasedExplorerBarPainter.CreateSkinHelper: TdxNavBarSkinBasedPainterHelper; +begin + Result := GetSkinPainterHelperClass.Create(GetDefaultColorSchemeName); +end; + +class function TdxNavBarSkinBasedExplorerBarPainter.GetViewInfoClass: TdxNavBarViewInfoClass; +begin + Result := TdxNavBarSkinBasedExplorerBarViewInfo; +end; + +class function TdxNavBarSkinBasedExplorerBarPainter.GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; +begin + Result := TdxNavBarSkinBasedExplorerBarGroupViewInfo; +end; + +class function TdxNavBarSkinBasedExplorerBarPainter.GetLinkViewInfoClass: TdxNavBarLinkViewInfoClass; +begin + Result := TdxNavBarSkinBasedExplorerBarLinkViewInfo; +end; + +class function TdxNavBarSkinBasedExplorerBarPainter.GetSkinPainterHelperClass: TdxNavBarSkinBasedPainterHelperClass; +begin + Result := TdxNavBarSkinBasedPainterHelper; +end; + +procedure TdxNavBarSkinBasedExplorerBarPainter.ColorSchemeChanged(ASender: TObject); +begin + NavBar.InvalidateAll(doRecreate); +end; + +function TdxNavBarSkinBasedExplorerBarPainter.GetColorSchemeName: TdxSkinName; +begin + Result := FSkinBasedPainterHelper.SkinName; +end; + +function TdxNavBarSkinBasedExplorerBarPainter.GetColorSchemeHelper: IdxNavBarColorSchemes; +begin + Supports(FSkinBasedPainterHelper, IdxNavBarColorSchemes, Result); +end; + +function TdxNavBarSkinBasedExplorerBarPainter.GetDefaultColorSchemeName: TdxSkinName; +begin + Result := ''; +end; + +function TdxNavBarSkinBasedExplorerBarPainter.IsSkinAvailable: Boolean; +begin + Result := FSkinBasedPainterHelper.IsSkinAvailable; +end; + +procedure TdxNavBarSkinBasedExplorerBarPainter.SetColorSchemeName(const AValue: TdxSkinName); +begin + FSkinBasedPainterHelper.SkinName := AValue; +end; + +procedure TdxNavBarSkinBasedExplorerBarPainter.DoDrawDropTargetLinkSelection( + AItemGroup: TdxNavBarGroupViewInfo; AItem1, AItem2: TdxNavBarLinkViewInfo); +var + ARect: TRect; + AHeight: Integer; +begin + AHeight := TdxNavBarSkinBasedExplorerBarViewInfo(ViewInfo).GetDragDropItemTargetHeight; + if AItem1 <> nil then + ARect := cxRectSetBottom(AItem1.Rect, AItem1.Rect.Bottom, AHeight) + else + ARect := cxRectSetTop(AItem2.Rect, AItem2.Rect.Top, AHeight); + if not DrawSkinElement(FSkinBasedPainterHelper.NavBarDragDropItemTarget, Canvas, ARect) then + inherited; +end; + +function TdxNavBarSkinBasedExplorerBarPainter.IsGroupCaptionButtonCompositeDraw( + AGroupViewInfo: TdxNavBarGroupViewInfo): Boolean; +begin + Result := False; +end; + +{ TdxNavBarSkinBasedExplorerBarGroupViewInfo } + +function TdxNavBarSkinBasedExplorerBarGroupViewInfo.CaptionFontColor: TColor; +var + AElement: TdxSkinElement; +begin + with TdxNavBarSkinBasedExplorerBarPainter(Painter) do + begin + AElement := FSkinBasedPainterHelper.NavBarGroupButtonCaption; + if AElement <> nil then + Result := AElement.TextColor + else + Result := inherited CaptionFontColor; + end; +end; + +procedure TdxNavBarSkinBasedExplorerBarGroupViewInfo.CalculateBounds(var X, Y: Integer); +var + AElement: TdxSkinElement; +begin + inherited CalculateBounds(X, Y); + with TdxNavBarSkinBasedExplorerBarPainter(Painter) do + begin + AElement := FSkinBasedPainterHelper.NavBarGroupButtonCaption; + if (AElement <> nil) and IsCaptionVisible and not IsRectEmpty(FImageRect) then + begin + OffsetRect(FImageRect, AElement.ContentOffset.Left, 0); + Inc(FCaptionTextRect.Left, AElement.ContentOffset.Left); + end; + end; +end; + +{ TdxNavBarSkinBasedExplorerBarLinkViewInfo } + +function TdxNavBarSkinBasedExplorerBarLinkViewInfo.FontColor: TColor; +var + AElement: TdxSkinElement; +begin + with TdxNavBarSkinBasedExplorerBarPainter(Painter) do + begin + AElement := FSkinBasedPainterHelper.NavBarItem; + if AElement <> nil then + Result := AElement.TextColor + else + Result := inherited FontColor; + end; +end; + +end. + diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarStyles.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarStyles.pas new file mode 100644 index 00000000..0cd3d528 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarStyles.pas @@ -0,0 +1,1006 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarStyles; + +{$I cxVer.inc} + +interface + +uses + Classes, Graphics, cxClasses, dxNavBarBase; + +type + TdxBarStyleHAlignment = (haLeft, haCenter, haRight); + TdxBarStyleVAlignment = (vaTop, vaCenter, vaBottom); + TdxBarStyleAssignedValue = (savAlphaBlending, savAlphaBlending2, savBackColor, savBackColor2, savFont, savGradientMode, + savHAlignment, savVAlignment, savImage); + TdxBarStyleAssignedValues = set of TdxBarStyleAssignedValue; + TdxBarStyleGradientMode = (gmHorizontal, gmVertical, gmForwardDiagonal, gmBackwardDiagonal); + + TdxNavBarBaseStyle = class(TcxOwnedPersistent) + private + FAlphaBlending: Byte; + FAlphaBlending2: Byte; + FAssignedValues: TdxBarStyleAssignedValues; + FBackColor: TColor; + FBackColor2: TColor; + FGradientMode: TdxBarStyleGradientMode; + FFont: TFont; + FImage: TPicture; + FHAlignment: TdxBarStyleHAlignment; + FVAlignment: TdxBarStyleVAlignment; + FOnChange: TdxNavBarChangeEvent; + + procedure SetAlphaBlending(const Value: Byte); + procedure SetAlphaBlending2(const Value: Byte); + procedure SetAssignedValues(const Value: TdxBarStyleAssignedValues); + procedure SetBackColor(const Value: TColor); + procedure SetBackColor2(const Value: TColor); + procedure SetFont(const Value: TFont); + procedure SetGradientMode(const Value: TdxBarStyleGradientMode); + procedure SetHAlignment(const Value: TdxBarStyleHAlignment); + procedure SetImage(const Value: TPicture); + procedure SetVAlignment(const Value: TdxBarStyleVAlignment); + protected + function CanAssignValue: Boolean; virtual; + procedure Changed(AType: TdxNavBarChangeType); virtual; + procedure FontChanged(Sender: TObject); + procedure ImageChanged(Sender: TObject); + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + + procedure Assign(Source: TPersistent); override; + procedure ResetValues; + + property AssignedValues: TdxBarStyleAssignedValues read FAssignedValues write SetAssignedValues default []; + property OnChange: TdxNavBarChangeEvent read FOnChange write FOnChange; + published + property AlphaBlending: Byte read FAlphaBlending write SetAlphaBlending default 255; + property AlphaBlending2: Byte read FAlphaBlending2 write SetAlphaBlending2 default 255; + property BackColor: TColor read FBackColor write SetBackColor; + property BackColor2: TColor read FBackColor2 write SetBackColor2; + property GradientMode: TdxBarStyleGradientMode read FGradientMode write SetGradientMode default gmHorizontal; + property Font: TFont read FFont write SetFont; + property Image: TPicture read FImage write SetImage; + property HAlignment: TdxBarStyleHAlignment read FHAlignment write SetHAlignment default haCenter; + property VAlignment: TdxBarStyleVAlignment read FVAlignment write SetVAlignment default vaCenter; + end; + + TdxNavBarDefaultStyleAssignProc = procedure of object; + TdxNavBarDefaultStyles = class; + TdxNavBarDefaultStyle = class(TdxNavBarBaseStyle) + private + FDefaultValues: Boolean; + FDefaultValuesProc: TdxNavBarDefaultStyleAssignProc; + function GetCollection: TdxNavBarDefaultStyles; + protected + procedure Changed(AType: TdxNavBarChangeType); override; + procedure AssignDefaultValues(CheckDefault: Boolean); + property DefaultValuesProc: TdxNavBarDefaultStyleAssignProc read FDefaultValuesProc write FDefaultValuesProc; + public + constructor Create(AOwner: TPersistent); override; + property Collection: TdxNavBarDefaultStyles read GetCollection; + property DefaultValues: Boolean read FDefaultValues write FDefaultValues; + end; + + TdxNavBarDefaultStyles = class(TcxOwnedPersistent) + private + FDefaultStylesList: TList; + FUpdateCount: Integer; + FOnChange: TdxNavBarChangeEvent; + + function IsDefaultStyleStored(Index: Integer): Boolean; + function GetDefaultStyleCount: Integer; + function GetDefaultStyle(Index: Integer): TdxNavBarDefaultStyle; + procedure SetDefaultStyle(Index: Integer; const Value: TdxNavBarDefaultStyle); + + procedure AssignDefaultBackgroundStyle; + procedure AssignDefaultButtonStyle; + procedure AssignDefaultButtonPressedStyle; + procedure AssignDefaultButtonHotTrackedStyle; + procedure AssignDefaultGroupBackgroundStyle; + procedure AssignDefaultGroupControlStyle; + procedure AssignDefaultGroupHeaderStyle; + procedure AssignDefaultGroupHeaderActiveStyle; + procedure AssignDefaultGroupHeaderActiveHotTrackedStyle; + procedure AssignDefaultGroupHeaderActivePressedStyle; + procedure AssignDefaultGroupHeaderHotTrackedStyle; + procedure AssignDefaultGroupHeaderPressedStyle; + procedure AssignDefaultHintStyle; + procedure AssignDefaultItemStyle; + procedure AssignDefaultItemDisabledStyle; + procedure AssignDefaultItemHotTrackedStyle; + procedure AssignDefaultItemPressedStyle; + procedure AssignDefaultDropTargetGroupStyle; + procedure AssignDefaultDropTargetLinkStyle; + procedure AssignDefaultNavigationPaneHeaderStyle; + protected + procedure CreateDefaultStyleList; virtual; + procedure DestroyDefaultStyleList; virtual; + procedure OnStyleChange(Sender: TObject; AType: TdxNavBarChangeType); + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + + procedure Assign(Source: TPersistent); override; + procedure AssignDefaultValues(CheckDefault: Boolean); + procedure BeginUpdate; + procedure EndUpdate; + + property DefaultStyleCount: Integer read GetDefaultStyleCount; + property DefaultStyles[Index: Integer]: TdxNavBarDefaultStyle read GetDefaultStyle; + property OnChange: TdxNavBarChangeEvent read FOnChange write FOnChange; + published + property Background: TdxNavBarDefaultStyle index 0 read GetDefaultStyle write SetDefaultStyle stored IsDefaultStyleStored; + property Button: TdxNavBarDefaultStyle index 1 read GetDefaultStyle write SetDefaultStyle stored IsDefaultStyleStored; + property ButtonPressed: TdxNavBarDefaultStyle index 2 read GetDefaultStyle write SetDefaultStyle stored IsDefaultStyleStored; + property ButtonHotTracked: TdxNavBarDefaultStyle index 3 read GetDefaultStyle write SetDefaultStyle stored IsDefaultStyleStored; + property GroupBackground: TdxNavBarDefaultStyle index 4 read GetDefaultStyle write SetDefaultStyle stored IsDefaultStyleStored; + property GroupControl: TdxNavBarDefaultStyle index 5 read GetDefaultStyle write SetDefaultStyle stored IsDefaultStyleStored; + property GroupHeader: TdxNavBarDefaultStyle index 6 read GetDefaultStyle write SetDefaultStyle stored IsDefaultStyleStored; + property GroupHeaderActive: TdxNavBarDefaultStyle index 7 read GetDefaultStyle write SetDefaultStyle stored IsDefaultStyleStored; + property GroupHeaderActiveHotTracked: TdxNavBarDefaultStyle index 8 read GetDefaultStyle write SetDefaultStyle stored IsDefaultStyleStored; + property GroupHeaderActivePressed: TdxNavBarDefaultStyle index 9 read GetDefaultStyle write SetDefaultStyle stored IsDefaultStyleStored; + property GroupHeaderHotTracked: TdxNavBarDefaultStyle index 10 read GetDefaultStyle write SetDefaultStyle stored IsDefaultStyleStored; + property GroupHeaderPressed: TdxNavBarDefaultStyle index 11 read GetDefaultStyle write SetDefaultStyle stored IsDefaultStyleStored; + property Hint: TdxNavBarDefaultStyle index 12 read GetDefaultStyle write SetDefaultStyle stored IsDefaultStyleStored; + property Item: TdxNavBarDefaultStyle index 13 read GetDefaultStyle write SetDefaultStyle stored IsDefaultStyleStored; + property ItemDisabled: TdxNavBarDefaultStyle index 14 read GetDefaultStyle write SetDefaultStyle stored IsDefaultStyleStored; + property ItemHotTracked: TdxNavBarDefaultStyle index 15 read GetDefaultStyle write SetDefaultStyle stored IsDefaultStyleStored; + property ItemPressed: TdxNavBarDefaultStyle index 16 read GetDefaultStyle write SetDefaultStyle stored IsDefaultStyleStored; + property DropTargetGroup: TdxNavBarDefaultStyle index 17 read GetDefaultStyle write SetDefaultStyle stored IsDefaultStyleStored; + property DropTargetLink: TdxNavBarDefaultStyle index 18 read GetDefaultStyle write SetDefaultStyle stored IsDefaultStyleStored; + property NavigationPaneHeader: TdxNavBarDefaultStyle index 19 read GetDefaultStyle write SetDefaultStyle stored IsDefaultStyleStored; + end; + + TdxNavBarStyle = class(TdxNavBarBaseStyle) + published + property AssignedValues; + end; + + TdxNavBarStyleItem = class(TdxNavBarComponentCollectionItem) + private + FChangeStyleHandlers: TcxEventHandlerCollection; + FStyle: TdxNavBarStyle; + procedure SetStyle(const Value: TdxNavBarStyle); + protected + function GetCollectionFromParent(AParent: TComponent): TcxComponentCollection; override; + procedure OnStyleChange(Sender: TObject; AType: TdxNavBarChangeType); + procedure RegisterChanges(AValue: TcxEventHandler); + procedure UnRegisterChanges(AValue: TcxEventHandler); + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + published + property Style: TdxNavBarStyle read FStyle write SetStyle; + end; + + TdxNavBarStyleRepository = class(TdxNavBarComponentCollection) + protected + function GetItem(Index: Integer): TdxNavBarStyleItem; + procedure SetItem(Index: Integer; Value: TdxNavBarStyleItem); + procedure SetItemName(AItem: TcxComponentCollectionItem); override; + public + function Add: TdxNavBarStyleItem; + property Items[Index: Integer]: TdxNavBarStyleItem read GetItem write SetItem; default; + end; + + TdxNavBarBaseCustomStyles = class(TdxNavBarNexusPersistent) + private + FStyles: array of TdxNavBarStyleItem; + FOnChange: TdxNavBarChangeEvent; + procedure InternalStyleChange(Sender: TObject; const AEventArgs); + protected + procedure AddNotificator(AIndex: Integer); virtual; + procedure DoChange; + function GetStyle(Index: Integer): TdxNavBarStyleItem; + procedure SetStyle(Index: Integer; const Value: TdxNavBarStyleItem); + function GetStyleCount: Integer; virtual; abstract; + procedure FreeNotification(AComponent: TComponent); override; + procedure RemoveNotificator(AIndex: Integer); virtual; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + property Styles[Index: Integer]: TdxNavBarStyleItem read GetStyle write SetStyle; + property OnChange: TdxNavBarChangeEvent read FOnChange write FOnChange; + end; + + TdxNavBarCustomStyles = class(TdxNavBarBaseCustomStyles) + protected + function GetStyleCount: Integer; override; + published + property Background: TdxNavBarStyleItem index 0 read GetStyle write SetStyle; + property Hint: TdxNavBarStyleItem index 1 read GetStyle write SetStyle; + property DropTargetGroup: TdxNavBarStyleItem index 2 read GetStyle write SetStyle; + property DropTargetLink: TdxNavBarStyleItem index 3 read GetStyle write SetStyle; + property Button: TdxNavBarStyleItem index 4 read GetStyle write SetStyle; + property ButtonHotTracked: TdxNavBarStyleItem index 5 read GetStyle write SetStyle; + property ButtonPressed: TdxNavBarStyleItem index 6 read GetStyle write SetStyle; + property NavigationPaneHeader: TdxNavBarStyleItem index 7 read GetStyle write SetStyle; + end; + + TdxNavBarGroupCustomStyles = class(TdxNavBarBaseCustomStyles) + protected + function GetStyleCount: Integer; override; + published + property Background: TdxNavBarStyleItem index 0 read GetStyle write SetStyle; + property Control: TdxNavBarStyleItem index 1 read GetStyle write SetStyle; + property Header: TdxNavBarStyleItem index 2 read GetStyle write SetStyle; + property HeaderActive: TdxNavBarStyleItem index 3 read GetStyle write SetStyle; + property HeaderActiveHotTracked: TdxNavBarStyleItem index 4 read GetStyle write SetStyle; + property HeaderActivePressed: TdxNavBarStyleItem index 5 read GetStyle write SetStyle; + property HeaderHotTracked: TdxNavBarStyleItem index 6 read GetStyle write SetStyle; + property HeaderPressed: TdxNavBarStyleItem index 7 read GetStyle write SetStyle; + end; + + TdxNavBarItemCustomStyles = class(TdxNavBarBaseCustomStyles) + protected + function GetStyleCount: Integer; override; + published + property Item: TdxNavBarStyleItem index 0 read GetStyle write SetStyle; + property ItemDisabled: TdxNavBarStyleItem index 1 read GetStyle write SetStyle; + property ItemHotTracked: TdxNavBarStyleItem index 2 read GetStyle write SetStyle; + property ItemPressed: TdxNavBarStyleItem index 3 read GetStyle write SetStyle; + end; + + TdxNavBarStyleOptions = class(TcxOwnedPersistent) + private + FDefaultStyles: TdxNavBarDefaultStyles; + FCustomStyles: TdxNavBarCustomStyles; + FCustomStyleRepository: TdxNavBarStyleRepository; + FOnChange: TNotifyEvent; + + procedure CustomStylesChanged(Sender: TObject; + AItem: TcxComponentCollectionItem; AAction: TcxComponentCollectionNotification); + procedure StyleChanged(Sender: TObject; AType: TdxNavBarChangeType); + procedure SetCustomStyleRepository(Value: TdxNavBarStyleRepository); + procedure SetDefaultStyles(Value: TdxNavBarDefaultStyles); + procedure SetCustomStyles(Value: TdxNavBarCustomStyles); + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + published + property DefaultStyles: TdxNavBarDefaultStyles read FDefaultStyles write SetDefaultStyles; + property CustomStyles: TdxNavBarCustomStyles read FCustomStyles write SetCustomStyles; + property CustomStyleRepository: TdxNavBarStyleRepository read FCustomStyleRepository write SetCustomStyleRepository; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + end; + +implementation + +uses + jpeg, dxNavBar, SysUtils; + +type + TdxCustomNavBarAccess = class(TdxCustomNavBar); + +{ TdxNavBarStyle } + +constructor TdxNavBarBaseStyle.Create(AOwner: TPersistent); +begin + inherited; + FBackColor := clWhite; + FBackColor2 := clWhite; + FAlphaBlending := 255; + FAlphaBlending2 := 255; + FHAlignment := haLeft; + FVAlignment := vaCenter; + FFont := TFont.Create; + FFont.OnChange := FontChanged; + FImage := TPicture.Create; + FImage.OnChange := ImageChanged; +end; + +destructor TdxNavBarBaseStyle.Destroy; +begin + FImage.Free; + FFont.Free; + inherited Destroy; +end; + +procedure TdxNavBarBaseStyle.Assign(Source: TPersistent); +begin + if Source is TdxNavBarBaseStyle then + begin + FAlphaBlending := TdxNavBarBaseStyle(Source).AlphaBlending; + FAlphaBlending2 := TdxNavBarBaseStyle(Source).AlphaBlending2; + FBackColor := TdxNavBarBaseStyle(Source).BackColor; + FBackColor2 := TdxNavBarBaseStyle(Source).BackColor2; + FGradientMode := TdxNavBarBaseStyle(Source).GradientMode; + FFont.Assign(TdxNavBarBaseStyle(Source).Font); + FImage.Assign(TdxNavBarBaseStyle(Source).Image); + FHAlignment := TdxNavBarBaseStyle(Source).HAlignment; + FVAlignment := TdxNavBarBaseStyle(Source).VAlignment; + FAssignedValues := TdxNavBarBaseStyle(Source).AssignedValues; + Changed(doRecalc); + end + else inherited Assign(Source); +end; + +procedure TdxNavBarBaseStyle.ResetValues; +begin + FAlphaBlending := 255; + FAlphaBlending2 := 255; + FBackColor := clWhite; + FBackColor2 := clWhite; + FGradientMode := gmHorizontal; + FFont.Charset := 1; // DEFAULT_CHARSET + FFont.Color := clWindowText; + FFont.Height := -11; + FFont.Name := 'MS Sans Serif'; + FFont.Pitch := fpDefault; + FFont.Size := 8; + FFont.Style := []; + FImage.Graphic := nil; + FHAlignment := haLeft; + FVAlignment := vaCenter; + FAssignedValues := []; +end; + +function TdxNavBarBaseStyle.CanAssignValue: Boolean; +begin + Result := True; +end; + +procedure TdxNavBarBaseStyle.Changed(AType: TdxNavBarChangeType); +begin + if Assigned(FOnChange) then FOnChange(Self, AType); +end; + +procedure TdxNavBarBaseStyle.FontChanged(Sender: TObject); +begin + if CanAssignValue then + Include(FAssignedValues, savFont); + Changed(doRecalc); +end; + +procedure TdxNavBarBaseStyle.ImageChanged(Sender: TObject); +begin + if CanAssignValue then + Include(FAssignedValues, savImage); + Changed(doRecalc); +end; + +procedure TdxNavBarBaseStyle.SetAlphaBlending(const Value: Byte); +begin + if FAlphaBlending <> Value then + begin + FAlphaBlending := Value; + if CanAssignValue then + Include(FAssignedValues, savAlphaBlending); + Changed(doRedraw); + end; +end; + +procedure TdxNavBarBaseStyle.SetAlphaBlending2(const Value: Byte); +begin + if FAlphaBlending2 <> Value then + begin + FAlphaBlending2 := Value; + if CanAssignValue then + Include(FAssignedValues, savAlphaBlending2); + Changed(doRedraw); + end; +end; + +procedure TdxNavBarBaseStyle.SetAssignedValues(const Value: TdxBarStyleAssignedValues); +begin + if FAssignedValues <> Value then + begin + FAssignedValues := Value; + Changed(doRecalc); + end; +end; + +procedure TdxNavBarBaseStyle.SetBackColor(const Value: TColor); +begin + if FBackColor <> Value then + begin + FBackColor := Value; + if CanAssignValue then + Include(FAssignedValues, savBackColor); + Changed(doRedraw); + end; +end; + +procedure TdxNavBarBaseStyle.SetBackColor2(const Value: TColor); +begin + if FBackColor2 <> Value then + begin + FBackColor2 := Value; + if CanAssignValue then + Include(FAssignedValues, savBackColor2); + Changed(doRedraw); + end; +end; + +procedure TdxNavBarBaseStyle.SetFont(const Value: TFont); +begin + FFont.Assign(Value); + if CanAssignValue then + Include(FAssignedValues, savFont); + Changed(doRecalc); +end; + +procedure TdxNavBarBaseStyle.SetGradientMode(const Value: TdxBarStyleGradientMode); +begin + if FGradientMode <> Value then + begin + FGradientMode := Value; + if CanAssignValue then + Include(FAssignedValues, savGradientMode); + Changed(doRedraw); + end; +end; + +procedure TdxNavBarBaseStyle.SetHAlignment(const Value: TdxBarStyleHAlignment); +begin + if FHAlignment <> Value then + begin + FHAlignment := Value; + if CanAssignValue then + Include(FAssignedValues, savHAlignment); + Changed(doRedraw); + end; +end; + +procedure TdxNavBarBaseStyle.SetImage(const Value: TPicture); +begin + FImage.Assign(Value); + Changed(doRecalc); +end; + +procedure TdxNavBarBaseStyle.SetVAlignment(const Value: TdxBarStyleVAlignment); +begin + if FVAlignment <> Value then + begin + FVAlignment := Value; + if CanAssignValue then + Include(FAssignedValues, savVAlignment); + Changed(doRedraw); + end; +end; + +{ TdxNavBarDefaultStyle } + +constructor TdxNavBarDefaultStyle.Create(AOwner: TPersistent); +begin + inherited; + FDefaultValues := True; +end; + +procedure TdxNavBarDefaultStyle.Changed(AType: TdxNavBarChangeType); +begin + inherited; + if Collection <> nil then + Collection.OnStyleChange(Self, AType); + DefaultValues := False; +end; + +procedure TdxNavBarDefaultStyle.AssignDefaultValues(CheckDefault: Boolean); +begin + if Assigned(FDefaultValuesProc) and (DefaultValues or not CheckDefault) then + begin + FDefaultValuesProc; + FDefaultValues := True; + end; +end; + +function TdxNavBarDefaultStyle.GetCollection: TdxNavBarDefaultStyles; +begin + if Owner is TdxNavBarDefaultStyles then + Result := Owner as TdxNavBarDefaultStyles + else Result := nil; +end; + +{ TdxNavBarDefaultStyles } + +constructor TdxNavBarDefaultStyles.Create(AOwner: TPersistent); +begin + inherited; + FUpdateCount := 0; + FDefaultStylesList := TList.Create; + CreateDefaultStyleList; +end; + +destructor TdxNavBarDefaultStyles.Destroy; +begin + DestroyDefaultStyleList; + FDefaultStylesList.Free; + inherited Destroy; +end; + +procedure TdxNavBarDefaultStyles.Assign(Source: TPersistent); +var + I: Integer; + AStyles: TdxNavBarDefaultStyles; +begin + if Source is TdxNavBarDefaultStyles then + begin + AStyles := Source as TdxNavBarDefaultStyles; + for I := 0 to DefaultStyleCount - 1 do + if I < AStyles.DefaultStyleCount then + DefaultStyles[I].Assign(AStyles.DefaultStyles[I]); + end + else inherited; +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultValues(CheckDefault: Boolean); +var + I: Integer; +begin + BeginUpdate; + try + for I := 0 to DefaultStyleCount - 1 do + DefaultStyles[I].AssignDefaultValues(CheckDefault); + finally + EndUpdate; + end; +end; + +procedure TdxNavBarDefaultStyles.BeginUpdate; +begin + Inc(FUpdateCount); +end; + +procedure TdxNavBarDefaultStyles.EndUpdate; +begin + Dec(FUpdateCount); +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultBackgroundStyle; +begin + TdxCustomNavBar(Owner).ViewInfo.AssignDefaultBackgroundStyle; +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultButtonStyle; +begin + TdxCustomNavBar(Owner).ViewInfo.AssignDefaultButtonStyle; +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultButtonPressedStyle; +begin + TdxCustomNavBar(Owner).ViewInfo.AssignDefaultButtonPressedStyle; +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultButtonHotTrackedStyle; +begin + TdxCustomNavBar(Owner).ViewInfo.AssignDefaultButtonHotTrackedStyle; +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultGroupBackgroundStyle; +begin + TdxCustomNavBar(Owner).ViewInfo.AssignDefaultGroupBackgroundStyle; +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultGroupControlStyle; +begin + TdxCustomNavBar(Owner).ViewInfo.AssignDefaultGroupControlStyle; +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultGroupHeaderStyle; +begin + TdxCustomNavBar(Owner).ViewInfo.AssignDefaultGroupHeaderStyle; +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultGroupHeaderActiveStyle; +begin + TdxCustomNavBar(Owner).ViewInfo.AssignDefaultGroupHeaderActiveStyle; +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultGroupHeaderActiveHotTrackedStyle; +begin + TdxCustomNavBar(Owner).ViewInfo.AssignDefaultGroupHeaderActiveHotTrackedStyle; +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultGroupHeaderActivePressedStyle; +begin + TdxCustomNavBar(Owner).ViewInfo.AssignDefaultGroupHeaderActivePressedStyle; +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultGroupHeaderHotTrackedStyle; +begin + TdxCustomNavBar(Owner).ViewInfo.AssignDefaultGroupHeaderHotTrackedStyle; +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultGroupHeaderPressedStyle; +begin + TdxCustomNavBar(Owner).ViewInfo.AssignDefaultGroupHeaderPressedStyle; +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultHintStyle; +begin + TdxCustomNavBar(Owner).ViewInfo.AssignDefaultHintStyle; +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultItemStyle; +begin + TdxCustomNavBar(Owner).ViewInfo.AssignDefaultItemStyle; +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultItemDisabledStyle; +begin + TdxCustomNavBar(Owner).ViewInfo.AssignDefaultItemDisabledStyle; +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultItemHotTrackedStyle; +begin + TdxCustomNavBar(Owner).ViewInfo.AssignDefaultItemHotTrackedStyle; +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultItemPressedStyle; +begin + TdxCustomNavBar(Owner).ViewInfo.AssignDefaultItemPressedStyle; +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultDropTargetGroupStyle; +begin + TdxCustomNavBar(Owner).ViewInfo.AssignDefaultDropTargetGroupStyle; +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultDropTargetLinkStyle; +begin + TdxCustomNavBar(Owner).ViewInfo.AssignDefaultDropTargetLinkStyle; +end; + +procedure TdxNavBarDefaultStyles.AssignDefaultNavigationPaneHeaderStyle; +begin + TdxCustomNavBar(Owner).ViewInfo.AssignDefaultNavigationPaneHeaderStyle; +end; + +procedure TdxNavBarDefaultStyles.CreateDefaultStyleList; + + procedure AddStyle(ADefaultValuesProc: TdxNavBarDefaultStyleAssignProc); + var + AStyle: TdxNavBarDefaultStyle; + begin + AStyle := TdxNavBarDefaultStyle.Create(Self); + FDefaultStylesList.Add(AStyle); + AStyle.DefaultValuesProc := ADefaultValuesProc; + end; + +begin + AddStyle(AssignDefaultBackgroundStyle); + AddStyle(AssignDefaultButtonStyle); + AddStyle(AssignDefaultButtonPressedStyle); + AddStyle(AssignDefaultButtonHotTrackedStyle); + AddStyle(AssignDefaultGroupBackgroundStyle); + AddStyle(AssignDefaultGroupControlStyle); + AddStyle(AssignDefaultGroupHeaderStyle); + AddStyle(AssignDefaultGroupHeaderActiveStyle); + AddStyle(AssignDefaultGroupHeaderActiveHotTrackedStyle); + AddStyle(AssignDefaultGroupHeaderActivePressedStyle); + AddStyle(AssignDefaultGroupHeaderHotTrackedStyle); + AddStyle(AssignDefaultGroupHeaderPressedStyle); + AddStyle(AssignDefaultHintStyle); + AddStyle(AssignDefaultItemStyle); + AddStyle(AssignDefaultItemDisabledStyle); + AddStyle(AssignDefaultItemHotTrackedStyle); + AddStyle(AssignDefaultItemPressedStyle); + AddStyle(AssignDefaultDropTargetGroupStyle); + AddStyle(AssignDefaultDropTargetLinkStyle); + AddStyle(AssignDefaultNavigationPaneHeaderStyle); +end; + +procedure TdxNavBarDefaultStyles.DestroyDefaultStyleList; +var + I: Integer; +begin + for I := 0 to DefaultStyleCount - 1 do + DefaultStyles[I].Free; + FDefaultStylesList.Clear; +end; + +procedure TdxNavBarDefaultStyles.OnStyleChange(Sender: TObject; AType: TdxNavBarChangeType); +begin + if FUpdateCount = 0 then + if Assigned(FOnChange) then FOnChange(Self, AType); +end; + +function TdxNavBarDefaultStyles.IsDefaultStyleStored(Index: Integer): Boolean; +begin + Result := not DefaultStyles[Index].DefaultValues; +end; + +function TdxNavBarDefaultStyles.GetDefaultStyleCount: Integer; +begin + Result := FDefaultStylesList.Count; +end; + +function TdxNavBarDefaultStyles.GetDefaultStyle(Index: Integer): TdxNavBarDefaultStyle; +begin + Result := TdxNavBarDefaultStyle(FDefaultStylesList[Index]); +end; + +procedure TdxNavBarDefaultStyles.SetDefaultStyle(Index: Integer; const Value: TdxNavBarDefaultStyle); +begin + TdxNavBarDefaultStyle(FDefaultStylesList[Index]).Assign(Value); +end; + +{ TdxBarStyleItem } + +constructor TdxNavBarStyleItem.Create(AOwner: TComponent); +begin + inherited; + FChangeStyleHandlers := TcxEventHandlerCollection.Create; + FStyle := TdxNavBarStyle.Create(Self); + FStyle.OnChange := OnStyleChange; +end; + +destructor TdxNavBarStyleItem.Destroy; +begin + FreeAndNil(FStyle); + FreeAndNil(FChangeStyleHandlers); + inherited; +end; + +procedure TdxNavBarStyleItem.Assign(Source: TPersistent); +begin + if Source is TdxNavBarStyleItem then + Style := TdxNavBarStyleItem(Source).Style + else + inherited; +end; + +function TdxNavBarStyleItem.GetCollectionFromParent(AParent: TComponent): TcxComponentCollection; +begin + Result := (AParent as TdxCustomNavBar).Styles; +end; + +procedure TdxNavBarStyleItem.OnStyleChange(Sender: TObject; AType: TdxNavBarChangeType); +begin + if FChangeStyleHandlers <> nil then + FChangeStyleHandlers.CallEvents(Self, AType); +end; + +procedure TdxNavBarStyleItem.RegisterChanges(AValue: TcxEventHandler); +begin + if FChangeStyleHandlers <> nil then + FChangeStyleHandlers.Add(AValue); +end; + +procedure TdxNavBarStyleItem.UnRegisterChanges(AValue: TcxEventHandler); +begin + if FChangeStyleHandlers <> nil then + FChangeStyleHandlers.Remove(AValue); +end; + +procedure TdxNavBarStyleItem.SetStyle(const Value: TdxNavBarStyle); +begin + FStyle.Assign(Value); +end; + +{ TdxBarStyles } + +function TdxNavBarStyleRepository.Add: TdxNavBarStyleItem; +begin + Result := inherited Add as TdxNavBarStyleItem; +end; + +function TdxNavBarStyleRepository.GetItem(Index: Integer): TdxNavBarStyleItem; +begin + Result := inherited GetItem(Index) as TdxNavBarStyleItem; +end; + +procedure TdxNavBarStyleRepository.SetItem(Index: Integer; Value: TdxNavBarStyleItem); +begin + inherited SetItem(Index, Value); +end; + +procedure TdxNavBarStyleRepository.SetItemName(AItem: TcxComponentCollectionItem); +begin + if TdxCustomNavBarAccess(ParentComponent).FDesignHelper <> nil then + AItem.Name := TdxCustomNavBarAccess(ParentComponent).FDesignHelper.UniqueName(TdxCustomNavBarAccess(ParentComponent).Name + 'StyleItem') + else + inherited; +end; + +{ TdxNavBarBaseCustomStyles } + +constructor TdxNavBarBaseCustomStyles.Create(AOwner: TPersistent); +begin + inherited; + SetLength(FStyles, GetStyleCount); +end; + +destructor TdxNavBarBaseCustomStyles.Destroy; +var + I: Integer; +begin + for I := 0 to GetStyleCount - 1 do + Styles[I] := nil; + inherited Destroy; +end; + +procedure TdxNavBarBaseCustomStyles.Assign(Source: TPersistent); +var + I: Integer; + ASourceStyles: TdxNavBarBaseCustomStyles; +begin + if Source is TdxNavBarBaseCustomStyles then + begin + ASourceStyles := TdxNavBarBaseCustomStyles(Source); + for I := 0 to GetStyleCount - 1 do + if I < ASourceStyles.GetStyleCount then + Styles[I] := ASourceStyles.Styles[I] + else + Styles[I] := nil; + end + else + inherited; +end; + +procedure TdxNavBarBaseCustomStyles.AddNotificator(AIndex: Integer); +begin + if Styles[AIndex] <> nil then + Styles[AIndex].RegisterChanges(InternalStyleChange); +end; + +procedure TdxNavBarBaseCustomStyles.DoChange; +begin + if Assigned(FOnChange) then + OnChange(Self, doRecreate); +end; + +function TdxNavBarBaseCustomStyles.GetStyle(Index: Integer): TdxNavBarStyleItem; +begin + Result := FStyles[Index]; +end; + +procedure TdxNavBarBaseCustomStyles.SetStyle(Index: Integer; const Value: TdxNavBarStyleItem); +begin + if FStyles[Index] <> Value then + begin + RemoveNotificator(Index); + FNotifyComponent.RemoveSender(FStyles[Index]); + FStyles[Index] := Value; + FNotifyComponent.AddSender(FStyles[Index]); + AddNotificator(Index); + DoChange; + end; +end; + +procedure TdxNavBarBaseCustomStyles.FreeNotification(AComponent: TComponent); +var + I: Integer; +begin + for I := 0 to GetStyleCount - 1 do + if Styles[I] = AComponent then + Styles[I] := nil; +end; + +procedure TdxNavBarBaseCustomStyles.RemoveNotificator(AIndex: Integer); +begin + if Styles[AIndex] <> nil then + Styles[AIndex].UnRegisterChanges(InternalStyleChange); +end; + +procedure TdxNavBarBaseCustomStyles.InternalStyleChange(Sender: TObject; const AEventArgs); +begin + DoChange; +end; + +{ TdxNavBarCustomStyles } + +function TdxNavBarCustomStyles.GetStyleCount: Integer; +begin + Result := 8; //TODO: constant +end; + +{ TdxNavBarGroupCustomStyles } + +function TdxNavBarGroupCustomStyles.GetStyleCount: Integer; +begin + Result := 8; //TODO: constant +end; + +{ TdxNavBarItemCustomStyles } + +function TdxNavBarItemCustomStyles.GetStyleCount: Integer; +begin + Result := 4; +end; + +{ TdxNavBarStyleOptions } + +constructor TdxNavBarStyleOptions.Create(AOwner: TPersistent); +begin + inherited; + FCustomStyleRepository := TdxNavBarStyleRepository.Create(AOwner as TComponent, TdxNavBarStyleItem); + FCustomStyleRepository.OnChange := CustomStylesChanged; + FDefaultStyles := TdxNavBarDefaultStyles.Create(AOwner); + FDefaultStyles.OnChange := StyleChanged; + FCustomStyles := TdxNavBarCustomStyles.Create(AOwner); + FCustomStyles.OnChange := StyleChanged; +end; + +destructor TdxNavBarStyleOptions.Destroy; +begin + FreeAndNil(FCustomStyles); + FreeAndNil(FDefaultStyles); + FreeAndNil(FCustomStyleRepository); + inherited; +end; + +procedure TdxNavBarStyleOptions.Assign(Source: TPersistent); +var + ASourceStyleOptions: TdxNavBarStyleOptions; +begin + if Source is TdxNavBarStyleOptions then + begin + ASourceStyleOptions := TdxNavBarStyleOptions(Source); + CustomStyleRepository := ASourceStyleOptions.CustomStyleRepository; + DefaultStyles := ASourceStyleOptions.DefaultStyles; + CustomStyles := ASourceStyleOptions.CustomStyles; + OnChange := ASourceStyleOptions.OnChange; + end + else + inherited; +end; + +procedure TdxNavBarStyleOptions.CustomStylesChanged(Sender: TObject; + AItem: TcxComponentCollectionItem; AAction: TcxComponentCollectionNotification); +begin + CallNotify(OnChange, Self); +end; + +procedure TdxNavBarStyleOptions.StyleChanged(Sender: TObject; AType: TdxNavBarChangeType); +begin + CallNotify(OnChange, Self); +end; + +procedure TdxNavBarStyleOptions.SetCustomStyleRepository(Value: TdxNavBarStyleRepository); +begin + FCustomStyleRepository.Assign(Value); +end; + +procedure TdxNavBarStyleOptions.SetDefaultStyles(Value: TdxNavBarDefaultStyles); +begin + FDefaultStyles.Assign(Value); +end; + +procedure TdxNavBarStyleOptions.SetCustomStyles(Value: TdxNavBarCustomStyles); +begin + FCustomStyles.Assign(Value); +end; + +initialization + RegisterClasses([TdxNavBarStyleItem]); + +end. diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarVSToolBoxViews.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarVSToolBoxViews.pas new file mode 100644 index 00000000..6b448ae3 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarVSToolBoxViews.pas @@ -0,0 +1,346 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarVSToolBoxViews; + +{$I cxVer.inc} + +interface + +uses + Windows, Graphics, Forms, + dxNavBar, dxNavBarCollns, dxNavBarStyles, dxNavBarCustomPainters, dxNavBarBaseViews; + +type + TdxNavBarVSToolBoxLinkViewInfo = class(TdxNavBarLinkViewInfo) + public + function SelectionRect: TRect; override; + end; + + TdxNavBarVSToolBoxViewInfo = class(TdxNavBarBaseViewInfo) + protected + function GetGroupCaptionHeightAddon: Integer; override; + function GetGroupSeparatorWidth: Integer; override; + class function GetGroupCaptionSeparatorWidth: Integer; override; + + function CanHasScrollButtonInGroupCaption: Boolean; override; + function CanLinksUseLargeImages: Boolean; override; + function CanSelectLinkByRect: Boolean; override; + + function GetTopScrollButtonRect: TRect; override; + function GetBottomScrollButtonRect: TRect; override; + public + procedure AssignDefaultBackgroundStyle; override; + procedure AssignDefaultGroupBackgroundStyle; override; + procedure AssignDefaultGroupHeaderStyle; override; + procedure AssignDefaultItemStyle; override; + procedure AssignDefaultItemDisabledStyle; override; + end; + + TdxNavBarVSToolBoxController = class(TdxNavBarNavigationBarController) + protected + procedure DoShowLinkHint(var AHintInfo: THintInfo; ALinkViewInfo: TdxNavBarLinkViewInfo); override; + function GetLinkHintRect(ALink: TdxNavBarItemLink): TRect; override; + function GetLinkHintText(ALink: TdxNavBarItemLink): string; override; + end; + + TdxNavBarVSToolBoxPainter = class(TdxNavBarFlatPainter) + protected + class function GetViewInfoClass: TdxNavBarViewInfoClass; override; + class function GetLinkViewInfoClass: TdxNavBarLinkViewInfoClass; override; + function GetControllerClass: TdxNavBarControllerClass; override; + + class function ButtonPainterClass: TdxNavBarCustomButtonPainterClass; override; + class function SelectionPainterClass: TdxNavBarCustomSelectionPainterClass; override; + public + procedure DrawLinkHintWindow(ACanvas: TCanvas; const ARect: TRect); override; + end; + + TdxNavBarVSToolBoxSelectionPainter = class(TdxNavBarBaseSelectionPainter) + protected + class procedure GetColors(AState: TdxNavBarObjectStates; ABackColor: TColor; out AFillColor, + ATopLeftOuterColor, ABottomRightOuterColor, ATopLeftInnerColor, ABottomRightInnerColor: TColor); override; + end; + + TdxNavBarVSToolBoxButtonPainter = class(TdxNavBarCustomButtonPainter) + protected + class procedure InternalDrawButton(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; + AState: TdxNavBarObjectStates); override; + end; + +implementation + +uses + Controls, Types, cxGraphics, cxGeometry, + dxNavBarViewsFact, dxNavBarGraphics, dxNavBarConsts; + +{ TdxNavBarVSToolBoxLinkViewInfo } + +function TdxNavBarVSToolBoxLinkViewInfo.SelectionRect: TRect; +begin + Result := Rect; + InflateRect(Result, -1, -1); +end; + +{ TdxNavBarVSToolBoxViewInfo } + +procedure TdxNavBarVSToolBoxViewInfo.AssignDefaultBackgroundStyle; +begin + NavBar.DefaultStyles.Background.ResetValues; + NavBar.DefaultStyles.Background.BackColor := clBtnFace; + NavBar.DefaultStyles.Background.BackColor2 := clBtnFace; +end; + +procedure TdxNavBarVSToolBoxViewInfo.AssignDefaultGroupBackgroundStyle; +begin + NavBar.DefaultStyles.GroupBackground.ResetValues; + NavBar.DefaultStyles.GroupBackground.BackColor := clBtnFace; + NavBar.DefaultStyles.GroupBackground.BackColor2 := clBtnFace ; +end; + +procedure TdxNavBarVSToolBoxViewInfo.AssignDefaultGroupHeaderStyle; +begin + NavBar.DefaultStyles.GroupHeader.ResetValues; + NavBar.DefaultStyles.GroupHeader.BackColor := clBtnFace; + NavBar.DefaultStyles.GroupHeader.BackColor2 := clBtnFace; + NavBar.DefaultStyles.GroupHeader.Font.Color := clBtnText; +end; + +procedure TdxNavBarVSToolBoxViewInfo.AssignDefaultItemStyle; +begin + NavBar.DefaultStyles.Item.ResetValues; + NavBar.DefaultStyles.Item.Font.Color := clBtnText; + NavBar.DefaultStyles.Item.HAlignment := haCenter; +end; + +procedure TdxNavBarVSToolBoxViewInfo.AssignDefaultItemDisabledStyle; +begin + NavBar.DefaultStyles.ItemDisabled.Assign(NavBar.DefaultStyles.Item); + NavBar.DefaultStyles.ItemDisabled.Font.Color := clBtnShadow; +end; + +function TdxNavBarVSToolBoxViewInfo.CanHasScrollButtonInGroupCaption: Boolean; +begin + Result := True; +end; + +function TdxNavBarVSToolBoxViewInfo.CanLinksUseLargeImages: Boolean; +begin + Result := False; +end; + +function TdxNavBarVSToolBoxViewInfo.CanSelectLinkByRect: Boolean; +begin + Result := True; +end; + +function TdxNavBarVSToolBoxViewInfo.GetGroupCaptionHeightAddon: Integer; +begin + Result := 4; +end; + +function TdxNavBarVSToolBoxViewInfo.GetGroupSeparatorWidth: Integer; +begin + Result := 1; +end; + +class function TdxNavBarVSToolBoxViewInfo.GetGroupCaptionSeparatorWidth: Integer; +begin + Result := 2; +end; + +function TdxNavBarVSToolBoxViewInfo.GetTopScrollButtonRect: TRect; +begin + SetRectEmpty(Result); + if GroupCount > 0 then + begin + Result := ActiveGroupViewInfo.CaptionRect; + Result.Left := Result.Right - (ActiveGroupViewInfo.CaptionRect.Bottom - ActiveGroupViewInfo.CaptionRect.Top); + OffsetRect(Result, (Result.Right - Result.Left) + 2, 0); + end; +end; + +function TdxNavBarVSToolBoxViewInfo.GetBottomScrollButtonRect: TRect; +var + AGroupViewInfo: TdxNavBarGroupViewInfo; +begin + SetRectEmpty(Result); + if GroupCount > 0 then + begin + if IndexOfGroupViewInfo(ActiveGroupViewInfo) < GroupCount - 1 then + begin + AGroupViewInfo := Groups[IndexOfGroupViewInfo(ActiveGroupViewInfo) + 1]; + Result := AGroupViewInfo.CaptionRect; + Result.Left := Result.Right - (AGroupViewInfo.CaptionRect.Bottom - AGroupViewInfo.CaptionRect.Top); + OffsetRect(Result, (Result.Right - Result.Left) + 2, 0); + end + else + begin + Result := ActiveGroupViewInfo.CaptionRect; + Result.Left := Result.Right - (ActiveGroupViewInfo.CaptionRect.Bottom - ActiveGroupViewInfo.CaptionRect.Top); + OffsetRect(Result, (Result.Right - Result.Left) + 2, + ActiveGroupViewInfo.ItemsRect.Bottom - ActiveGroupViewInfo.ItemsRect.Top); + end; + end; +end; + +{ TdxNavBarVSToolBoxController } + +procedure TdxNavBarVSToolBoxController.DoShowLinkHint(var AHintInfo: THintInfo; ALinkViewInfo: TdxNavBarLinkViewInfo); +begin + inherited; + AHintInfo.HintPos := NavBar.ClientToScreen(NavBar.ClientRect.TopLeft); +end; + +function TdxNavBarVSToolBoxController.GetLinkHintRect(ALink: TdxNavBarItemLink): TRect; +var + R: TRect; + ALinkViewInfo: TdxNavBarLinkViewInfo; +begin + ALinkViewInfo := ViewInfo.GetLinkViewInfoByLink(ALink); + if ALinkViewInfo <> nil then + begin + Result := ALinkViewInfo.SelectionRect; + R := Result; + cxScreenCanvas.Font := ViewInfo.HintFont; + cxDrawText(cxScreenCanvas.Handle, ViewInfo.HintText, R, DT_CALCRECT or ALinkViewInfo.GetDrawEdgeFlag); + if cxRectWidth(R) > cxRectWidth(ALinkViewInfo.CaptionRect) then + Result.Right := ALinkViewInfo.CaptionRect.Left + cxRectWidth(R) + 4; + end + else + Result := inherited GetLinkHintRect(ALink); +end; + +function TdxNavBarVSToolBoxController.GetLinkHintText(ALink: TdxNavBarItemLink): string; +begin + Result := inherited GetLinkHintText(ALink); + if Result = '' then + Result := ALink.Item.Caption; +end; + +{ TdxNavBarVSToolBoxPainter } + +procedure TdxNavBarVSToolBoxPainter.DrawLinkHintWindow(ACanvas: TCanvas; const ARect: TRect); +var + R: TRect; + AWidth: Integer; + ALinkViewInfo: TdxNavBarLinkViewInfo; +begin + ALinkViewInfo := ViewInfo.GetLinkViewInfoByLink(NavBar.HotTrackedLink); + if ALinkViewInfo <> nil then + with ALinkViewInfo do + begin + AWidth := cxRectWidth(ARect) - (SelectionRect.Right - SelectionRect.Left); + R := cxRectOffset(SelectionRect, - SelectionRect.Left, - SelectionRect.Top); + if AWidth > 0 then + R.Right := R.Right + AWidth; + with ALinkViewInfo.GroupViewInfo do + BackgroundPainterClass.DrawBackground(ACanvas, R, BgImage, False, clBtnFace, + BgBackColor, BgBackColor2, BgAlphaBlend, BgAlphaBlend2, BgGradientMode); + SelectionPainterClass.DrawSelection(ACanvas, R, GroupViewInfo.BgBackColor, [sHotTracked]); + R := cxRectOffset(ImageRect, - SelectionRect.Left, - SelectionRect.Top); + ImagePainterClass.DrawImage(ACanvas, ImageList, ImageIndex, R); + R := cxRectOffset(CaptionRect, - SelectionRect.Left, - SelectionRect.Top); + AWidth := cxRectWidth(ARect); + R.Right := R.Left + AWidth; + ACanvas.Font := ALinkViewInfo.Font; + ACanvas.Brush.Style := bsClear; + cxDrawText(ACanvas.Handle, ViewInfo.HintText, R, GetDrawEdgeFlag); + end; +end; + +class function TdxNavBarVSToolBoxPainter.GetViewInfoClass: TdxNavBarViewInfoClass; +begin + Result := TdxNavBarVSToolBoxViewInfo; +end; + +class function TdxNavBarVSToolBoxPainter.GetLinkViewInfoClass: TdxNavBarLinkViewInfoClass; +begin + Result := TdxNavBarVSToolBoxLinkViewInfo; +end; + +function TdxNavBarVSToolBoxPainter.GetControllerClass: TdxNavBarControllerClass; +begin + Result := TdxNavBarVSToolBoxController; +end; + +class function TdxNavBarVSToolBoxPainter.ButtonPainterClass: TdxNavBarCustomButtonPainterClass; +begin + Result := TdxNavBarVSToolBoxButtonPainter; +end; + +class function TdxNavBarVSToolBoxPainter.SelectionPainterClass: TdxNavBarCustomSelectionPainterClass; +begin + Result := TdxNavBarVSToolBoxSelectionPainter; +end; + +{ TdxNavBarVSToolBoxSelectionPainter } + +class procedure TdxNavBarVSToolBoxSelectionPainter.GetColors(AState: TdxNavBarObjectStates; ABackColor: TColor; + out AFillColor, ATopLeftOuterColor, ABottomRightOuterColor, ATopLeftInnerColor, ABottomRightInnerColor: TColor); +begin + inherited; + if IsPressed(AState) then + begin + ATopLeftOuterColor := DarkBorderColor(ABackColor); + ABottomRightOuterColor := LightBorderColor(ABackColor); + end + else + ATopLeftInnerColor := LightBorderColor(ABackColor); +end; + +{ TdxNavBarVSToolBoxButtonPainter } + +class procedure TdxNavBarVSToolBoxButtonPainter.InternalDrawButton(ACanvas: TCanvas; ARect: TRect; + APicture: TPicture; AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; AState: TdxNavBarObjectStates); +begin + inherited; + if sPressed in AState then + dxNavBarDrawSelectedFrame(ACanvas, ARect, DarkDarkBorderColor(AColor1), LightLightBorderColor(AColor1), + DarkBorderColor(AColor1), clNone) + else + dxNavBarDrawSelectedFrame(ACanvas, ARect, LightLightBorderColor(AColor1), DarkDarkBorderColor(AColor1), + LightBorderColor(AColor1), clNone); +end; + +initialization + RegisterView(dxNavBarVSToolBoxView, 'VSToolBoxView', TdxNavBarVSToolBoxPainter); + +finalization + UnRegisterView(dxNavBarVSToolBoxView); + +end. diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarViewsFact.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarViewsFact.pas new file mode 100644 index 00000000..18199de5 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarViewsFact.pas @@ -0,0 +1,245 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarViewsFact; + +{$I cxVer.inc} + +interface + +uses + Classes, Contnrs, dxNavBar; + +type + TdxNavBarViewsFactory = class + private + FViews: TObjectList; + + function GetCount: Integer; + function GetIDs(AIndex: Integer): Integer; + function GetNames(AIndex: Integer): string; + function GetPainterClasses(AIndex: Integer): TdxNavBarPainterClass; + function IsIndexValid(AIndex: Integer): Boolean; + protected + procedure Clear; + public + constructor Create; + destructor Destroy; override; + procedure RegisterView(AID: Integer; AName: string; APainterClass: TdxNavBarPainterClass); + procedure UnRegisterView(AID: Integer); + function GetIDFromName(const Name: string): Integer; + function IndexOfName(const Name: string): Integer; + function IndexOfID(const AID: Integer): Integer; + function IsViewRegistered(AID: Integer): Boolean; + + property Count: Integer read GetCount; + property IDs[AIndex: Integer]: Integer read GetIDs; + property Names[AIndex: Integer]: string read GetNames; + property PainterClasses[AIndex: Integer]: TdxNavBarPainterClass read GetPainterClasses; + end; + +function dxNavBarViewsFactory: TdxNavBarViewsFactory; +procedure RegisterView(AID: Integer; AName: string; APainterClass: TdxNavBarPainterClass); +procedure UnRegisterView(AID: Integer); + +implementation + +uses + SysUtils, cxClasses, dxNavBarConsts; + +type + TdxNavBarPainterFactItem = class + ID: Integer; + Name: string; + PainterClass: TdxNavBarPainterClass; + end; + +var + FdxNavBarViewsFactIsFinalized: Boolean; + FNavBarViewsFactory: TdxNavBarViewsFactory; + +function dxNavBarViewsFactory: TdxNavBarViewsFactory; +begin + if (FNavBarViewsFactory = nil) and not FdxNavBarViewsFactIsFinalized then + FNavBarViewsFactory := TdxNavBarViewsFactory.Create; + Result := FNavBarViewsFactory; +end; + +procedure RegisterView(AID: Integer; AName: string; APainterClass: TdxNavBarPainterClass); +begin + if dxNavBarViewsFactory <> nil then + dxNavBarViewsFactory.RegisterView(AID, AName, APainterClass); +end; + +procedure UnRegisterView(AID: Integer); +begin + if dxNavBarViewsFactory <> nil then + dxNavBarViewsFactory.UnRegisterView(AID); +end; + +function FactItemCompare(AItem1, AItem2: Pointer): Integer; +var + AID1, AID2: Integer; +begin + AID1 := TdxNavBarPainterFactItem(AItem1).ID; + AID2 := TdxNavBarPainterFactItem(AItem2).ID; + if AID1 > AID2 then + Result := 1 + else + if AID1 < AID2 then + Result := -1 + else + Result := 0; +end; + +{ TdxNavBarViewsFactory } + +constructor TdxNavBarViewsFactory.Create; +begin + inherited Create; + FViews := TObjectList.Create; +end; + +destructor TdxNavBarViewsFactory.Destroy; +begin + FreeAndNil(FViews); + inherited Destroy; +end; + +function TdxNavBarViewsFactory.GetCount: Integer; +begin + Result := FViews.Count; +end; + +function TdxNavBarViewsFactory.GetIDs(AIndex: Integer): Integer; +begin + if IsIndexValid(AIndex) then + Result := TdxNavBarPainterFactItem(FViews[AIndex]).ID + else + Result := -1; +end; + +function TdxNavBarViewsFactory.GetNames(AIndex: Integer): string; +begin + if IsIndexValid(AIndex) then + Result := TdxNavBarPainterFactItem(FViews[AIndex]).Name + else + Result := ''; +end; + +function TdxNavBarViewsFactory.GetPainterClasses(AIndex: Integer): TdxNavBarPainterClass; +begin + if IsIndexValid(AIndex) then + Result := TdxNavBarPainterFactItem(FViews[AIndex]).PainterClass + else + Result := nil; +end; + +function TdxNavBarViewsFactory.IsIndexValid(AIndex: Integer): Boolean; +begin + Result := (0 <= AIndex) and (AIndex < Count); +end; + +procedure TdxNavBarViewsFactory.Clear; +begin + FViews.Clear; +end; + +procedure TdxNavBarViewsFactory.RegisterView(AID: Integer; AName: string; APainterClass: TdxNavBarPainterClass); +var + Item: TdxNavBarPainterFactItem; +begin + if IndexOfID(AID) <> -1 then + raise Exception.CreateFmt(cxGetResourceString(@sdxViewAlreadyExists), [AID]); + Item := TdxNavBarPainterFactItem.Create; + RegisterClasses([APainterClass]); + with Item do + begin + ID := AID; + Name := AName; + PainterClass := APainterClass + end; + FViews.Add(Item); + FViews.Sort(FactItemCompare); +end; + +procedure TdxNavBarViewsFactory.UnRegisterView(AID: Integer); +begin + if IndexOfID(AID) <> -1 then + FViews.Delete(IndexOfID(AID)); +end; + +function TdxNavBarViewsFactory.GetIDFromName(const Name: string): Integer; +begin + Result := IDs[IndexOfName(Name)] +end; + +function TdxNavBarViewsFactory.IndexOfName(const Name: string): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Count - 1 do + if Names[I] = Name then + begin + Result := I; + break; + end; +end; + +function TdxNavBarViewsFactory.IndexOfID(const AID: Integer): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to Count - 1 do + if IDs[I] = AID then + begin + Result := I; + break; + end; +end; + +function TdxNavBarViewsFactory.IsViewRegistered(AID: Integer): Boolean; +begin + Result := IndexOfID(AID) <> -1; +end; + +initialization + +finalization + FdxNavBarViewsFactIsFinalized := True; + FreeAndNil(FNavBarViewsFactory); + +end. diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarVistaViews.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarVistaViews.pas new file mode 100644 index 00000000..6055b120 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarVistaViews.pas @@ -0,0 +1,371 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarVistaViews; + +{$I cxVer.inc} + +interface + +uses + Windows, Graphics, SysUtils, Types, dxNavBar, dxNavBarStyles, dxNavBarCustomPainters, dxNavBarSkinBasedViews, + dxNavBarExplorerViews, dxNavBarXPViews, dxNavBarOfficeViews, dxNavBarCollns, dxSkinsCore, + cxGraphics, cxClasses; + +type + TdxNavBarVistaPainterHelper = class(TdxNavBarSkinBasedPainterHelper) + public + function NavBarBackground: TdxSkinElement; override; + function NavBarDragDropItemTarget: TdxSkinElement; override; + function NavBarGroupButtonCaption: TdxSkinElement; override; + function NavBarItem: TdxSkinElement; override; + function NavBarSeparator: TdxSkinElement; override; + end; + + TdxNavBarVistaExplorerBarViewInfo = class(TdxNavBarExplorerBarViewInfo) + protected + function CanSelectLinkByRect: Boolean; override; + function GetAbsoluteLinksImageEdges: TRect; override; + function GetGroupBorderOffsets: TRect; override; + class function GetGroupCaptionImageIndent: Integer; override; + function GetGroupCaptionHeightAddon: Integer; override; + function GetGroupEdges: TPoint; override; + function GetGroupSeparatorWidth: Integer; override; + public + procedure AssignDefaultItemHotTrackedStyle; override; + end; + + TdxNavBarVistaExplorerBarSelectionPainter = class(TdxNavBarCustomSelectionPainter) + protected + class procedure GetColors(AState: TdxNavBarObjectStates; ABackColor: TColor; out AFillColor, + ATopLeftOuterColor, ABottomRightOuterColor, ATopLeftInnerColor, ABottomRightInnerColor: TColor); override; + end; + + TdxNavBarVistaExplorerBarButtonPainter = class(TdxNavBarCustomButtonPainter) + protected + class procedure InternalDrawButton(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; + AState: TdxNavBarObjectStates); override; + end; + + TdxNavBarVistaExplorerBarPainter = class(TdxNavBarSkinBasedExplorerBarPainter) + protected + class function GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; override; + class function GetLinkViewInfoClass: TdxNavBarLinkViewInfoClass; override; + class function GetViewInfoClass: TdxNavBarViewInfoClass; override; + class function GetSkinPainterHelperClass: TdxNavBarSkinBasedPainterHelperClass; override; + + class function ButtonPainterClass: TdxNavBarCustomButtonPainterClass; override; + class function SelectionPainterClass: TdxNavBarCustomSelectionPainterClass; override; + + function GetDefaultColorSchemeName: TdxSkinName; override; + public + procedure DrawBackground; override; + procedure DrawGroupControlSplitter(AGroupViewInfo: TdxNavBarExplorerBarGroupViewInfo); override; + procedure DrawItemSelection(ALinkViewInfo: TdxNavBarLinkViewInfo); override; + end; + + TdxNavBarVistaExplorerBarLinkViewInfo = class(TdxNavBarSkinBasedExplorerBarLinkViewInfo) + public + function Font: TFont; override; + function FontColor: TColor; override; + end; + + TdxNavBarVistaExplorerBarGroupViewInfo = class(TdxNavBarExplorerBarGroupViewInfo) + protected + function GetSplitterSize: Integer; override; + public + function CaptionBackColor: TColor; override; + function CaptionBackColor2: TColor; override; + function CaptionFont: TFont; override; + function CaptionFontColor: TColor; override; + end; + +implementation + +{$R *.res} + +uses + cxControls, dxOffice11, cxGeometry, dxUxTheme, + dxNavBarViewsFact, dxNavBarConsts; + +{ TdxNavBarVistaPainterHelper } + +function TdxNavBarVistaPainterHelper.NavBarBackground: TdxSkinElement; +begin + if not IsThemeActive then + Result := nil + else + Result := inherited NavBarBackground; +end; + +function TdxNavBarVistaPainterHelper.NavBarDragDropItemTarget: TdxSkinElement; +begin + Result := nil; +end; + +function TdxNavBarVistaPainterHelper.NavBarGroupButtonCaption: TdxSkinElement; +begin + if not IsThemeActive then + Result := nil + else + Result := inherited NavBarGroupButtonCaption; +end; + +function TdxNavBarVistaPainterHelper.NavBarItem: TdxSkinElement; +begin + if not IsThemeActive then + Result := nil + else + Result := inherited NavBarItem; +end; + +function TdxNavBarVistaPainterHelper.NavBarSeparator: TdxSkinElement; +begin + Result := nil; +end; + +{ TdxNavBarVistaExplorerBarViewInfo } + +procedure TdxNavBarVistaExplorerBarViewInfo.AssignDefaultItemHotTrackedStyle; +begin + inherited; + NavBar.DefaultStyles.ItemHotTracked.Font.Style := NavBar.DefaultStyles.ItemHotTracked.Font.Style - [fsUnderline]; +end; + +function TdxNavBarVistaExplorerBarViewInfo.CanSelectLinkByRect: Boolean; +begin + Result := True; +end; + +function TdxNavBarVistaExplorerBarViewInfo.GetAbsoluteLinksImageEdges: TRect; +begin + Result := cxRect(7, 4, 9, 4); +end; + +function TdxNavBarVistaExplorerBarViewInfo.GetGroupBorderOffsets: TRect; +begin + Result := cxNullRect; +end; + +class function TdxNavBarVistaExplorerBarViewInfo.GetGroupCaptionImageIndent: Integer; +begin + Result := 2; +end; + +function TdxNavBarVistaExplorerBarViewInfo.GetGroupCaptionHeightAddon: Integer; +begin + Result := 9; +end; + +function TdxNavBarVistaExplorerBarViewInfo.GetGroupEdges: TPoint; +begin + if not IsThemeActive then + Result := cxNullPoint + else + Result := cxPoint(1, 1); +end; + +function TdxNavBarVistaExplorerBarViewInfo.GetGroupSeparatorWidth: Integer; +begin + Result := 0; +end; + +{ TdxNavBarVistaExplorerBarSelectionPainter } + +class procedure TdxNavBarVistaExplorerBarSelectionPainter.GetColors(AState: TdxNavBarObjectStates; ABackColor: TColor; out AFillColor, + ATopLeftOuterColor, ABottomRightOuterColor, ATopLeftInnerColor, ABottomRightInnerColor: TColor); +begin + inherited; + AFillColor := clActiveCaption; +end; + +{ TdxNavBarVistaExplorerBarButtonPainter } + +class procedure TdxNavBarVistaExplorerBarButtonPainter.InternalDrawButton(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; + AState: TdxNavBarObjectStates); +begin + FillRectByColor(ACanvas.Handle, ARect, AColor1); +end; + +{ TdxNavBarVistaExplorerBarPainter } + +procedure TdxNavBarVistaExplorerBarPainter.DrawBackground; +begin + inherited DrawBackground; + DrawSkinElement(FSkinBasedPainterHelper.NavBarBackground, Canvas, NavBar.ClientRect); +end; + +procedure TdxNavBarVistaExplorerBarPainter.DrawGroupControlSplitter(AGroupViewInfo: TdxNavBarExplorerBarGroupViewInfo); +var + ARect: TRect; +begin + ARect := cxRectSetBottom(AGroupViewInfo.SplitterRect, AGroupViewInfo.SplitterRect.Top + 1, 1); + FillRectByColor(Canvas.Handle, ARect, clBtnHighlight); + ARect := cxRectSetBottom(ARect, ARect.Bottom + 2, 2); + FillRectByColor(Canvas.Handle, ARect, clBtnFace); + ARect := cxRectSetBottom(ARect, ARect.Bottom + 1, 1); + FillRectByColor(Canvas.Handle, ARect, clBtnHighlight); +end; + +procedure TdxNavBarVistaExplorerBarPainter.DrawItemSelection( + ALinkViewInfo: TdxNavBarLinkViewInfo); +begin + if not DrawSkinElement(FSkinBasedPainterHelper.NavBarItem, Canvas, ALinkViewInfo.SelectionRect, + 0, NavBarObjectStateToSkinState(ALinkViewInfo.State)) then + inherited; +end; + +class function TdxNavBarVistaExplorerBarPainter.GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; +begin + Result := TdxNavBarVistaExplorerBarGroupViewInfo; +end; + +class function TdxNavBarVistaExplorerBarPainter.GetLinkViewInfoClass: TdxNavBarLinkViewInfoClass; +begin + Result := TdxNavBarVistaExplorerBarLinkViewInfo; +end; + +class function TdxNavBarVistaExplorerBarPainter.GetViewInfoClass: TdxNavBarViewInfoClass; +begin + Result := TdxNavBarVistaExplorerBarViewInfo; +end; + +class function TdxNavBarVistaExplorerBarPainter.GetSkinPainterHelperClass: TdxNavBarSkinBasedPainterHelperClass; +begin + Result := TdxNavBarVistaPainterHelper; +end; + +class function TdxNavBarVistaExplorerBarPainter.ButtonPainterClass: TdxNavBarCustomButtonPainterClass; +begin + Result := TdxNavBarVistaExplorerBarButtonPainter; +end; + +class function TdxNavBarVistaExplorerBarPainter.SelectionPainterClass: TdxNavBarCustomSelectionPainterClass; +begin + Result := TdxNavBarVistaExplorerBarSelectionPainter; +end; + +function TdxNavBarVistaExplorerBarPainter.GetDefaultColorSchemeName: TdxSkinName; +begin + Result := 'Vista'; +end; + +{ TdxNavBarVistaExplorerBarLinkViewInfo } + +function TdxNavBarVistaExplorerBarLinkViewInfo.Font: TFont; +begin + Result := inherited Font; + Result.name := 'Segoe UI'; +end; + +function TdxNavBarVistaExplorerBarLinkViewInfo.FontColor: TColor; +const + ATextColor: array [Boolean] of TColor = (clWindowText, clHighlightText); +begin + if not IsThemeActive then + Result := ATextColor[[sSelected, sPressed, sHotTracked] * State <> []] + else + Result := inherited FontColor; +end; + +{ TdxNavBarVistaExplorerBarGroupViewInfo } + +function TdxNavBarVistaExplorerBarGroupViewInfo.CaptionBackColor: TColor; +begin + if [sSelected, sPressed, sHotTracked] * State <> [] then + if sPressed in State then + Result := clHotLight + else + Result := clActiveCaption + else + Result := clWindow; +end; + +function TdxNavBarVistaExplorerBarGroupViewInfo.CaptionBackColor2: TColor; +begin + Result := CaptionBackColor; +end; + +function TdxNavBarVistaExplorerBarGroupViewInfo.CaptionFont: TFont; +begin + Result := inherited CaptionFont; + Result.Style := Result.Style - [fsBold]; + Result.Name := 'Segoe UI'; +end; + +function TdxNavBarVistaExplorerBarGroupViewInfo.CaptionFontColor: TColor; +const + ATextColor: array [Boolean] of TColor = (clWindowText, clHighlightText); +var + AElement: TdxSkinElement; +begin + if not IsThemeActive then + Result := ATextColor[[sSelected, sPressed, sHotTracked] * State <> []] + else + with TdxNavBarVistaExplorerBarPainter(Painter) do + begin + AElement := FSkinBasedPainterHelper.NavBarGroupButtonCaption; + if AElement <> nil then + Result := AElement.TextColor + else + Result := inherited CaptionFontColor; + end; +end; + +function TdxNavBarVistaExplorerBarGroupViewInfo.GetSplitterSize: Integer; +begin + Result := 4; +end; + +procedure RegisterVistaViews; +begin + RegisterView(dxNavBarVistaExplorerBarView, 'VistaExplorerBarView', TdxNavBarVistaExplorerBarPainter); +end; + +procedure UnRegisterVistaViews; +begin + UnRegisterView(dxNavBarVistaExplorerBarView); +end; + +initialization + RegisterVistaViews; + +finalization + UnRegisterVistaViews; + +end. diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarVistaViews.res b/official/x.35/ExpressNavBar 2/Sources/dxNavBarVistaViews.res new file mode 100644 index 00000000..c64d8e67 Binary files /dev/null and b/official/x.35/ExpressNavBar 2/Sources/dxNavBarVistaViews.res differ diff --git a/official/x.35/ExpressNavBar 2/Sources/dxNavBarXPViews.pas b/official/x.35/ExpressNavBar 2/Sources/dxNavBarXPViews.pas new file mode 100644 index 00000000..121ab393 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxNavBarXPViews.pas @@ -0,0 +1,1061 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxNavBarXPViews; + +{$I cxVer.inc} + +interface + +uses + Windows, Graphics, dxNavBar, dxNavBarCollns, dxNavBarStyles, dxNavBarGraphics, + dxNavBarCustomPainters, dxNavBarBaseViews, dxNavBarExplorerViews, dxNavBarOfficeViews, + dxThemeManager; + +type + TdxNavBarXP1GroupViewInfo = class(TdxNavBarExplorerBarGroupViewInfo) + private + function IsDefaultBgColor: Boolean; + function IsDefaultCaptionColor: Boolean; + public + function BgBackColor: TColor; override; + function BgBackColor2: TColor; override; + function BgAlphaBlend: Byte; override; + function BgAlphaBlend2: Byte; override; + function BgGradientMode: TdxBarStyleGradientMode; override; + function CaptionBackColor: TColor; override; + function CaptionBackColor2: TColor; override; + function CaptionAlphaBlend: Byte; override; + function CaptionAlphaBlend2: Byte; override; + function CaptionGradientMode: TdxBarStyleGradientMode; override; + end; + + TdxNavBarXP1ViewInfo = class(TdxNavBarBaseViewInfo) + public + procedure AssignDefaultBackgroundStyle; override; + procedure AssignDefaultGroupBackgroundStyle; override; + procedure AssignDefaultGroupHeaderStyle; override; + procedure AssignDefaultItemStyle; override; + procedure AssignDefaultItemDisabledStyle; override; + end; + + TdxNavBarXP1Painter = class(TdxNavBarFlatPainter) + protected + class function GetViewInfoClass: TdxNavBarViewInfoClass; override; + class function GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; override; + + class function ScrollButtonsPainterClass: TdxNavBarCustomScrollButtonsPainterClass; override; + class function SelectionPainterClass: TdxNavBarCustomSelectionPainterClass; override; + public + procedure DrawGroupCaptionButton(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + end; + + TdxNavBarXP2Painter = class(TdxNavBarOffice1Painter) + protected + class function BackgroundPainterClass: TdxNavBarCustomBackgroundPainterClass; override; + class function ButtonPainterClass: TdxNavBarCustomButtonPainterClass; override; + class function GroupBackgroundPainterClass: TdxNavBarCustomGroupBackgroundPainterClass; override; + class function ScrollButtonsPainterClass: TdxNavBarCustomScrollButtonsPainterClass; override; + class function SelectionPainterClass: TdxNavBarCustomSelectionPainterClass; override; + end; + + TdxNavBarXPExplorerBarLinkViewInfo = class(TdxNavBarLinkViewInfo) + public + function Font: TFont; override; + function FontColor: TColor; override; + end; + + TdxNavBarXPExplorerBarGroupViewInfo = class(TdxNavBarExplorerBarGroupViewInfo) + public + function BorderColor: TColor; override; + function BgBackColor: TColor; override; + function BgBackColor2: TColor; override; + function BgAlphaBlend: Byte; override; + function BgAlphaBlend2: Byte; override; + function BgGradientMode: TdxBarStyleGradientMode; override; + function CaptionBackColor: TColor; override; + function CaptionBackColor2: TColor; override; + function CaptionAlphaBlend: Byte; override; + function CaptionAlphaBlend2: Byte; override; + function CaptionGradientMode: TdxBarStyleGradientMode; override; + function CaptionFont: TFont; override; + function CaptionFontColor: TColor; override; + end; + + TdxNavBarXPExplorerBarViewInfo = class(TdxNavBarExplorerBarViewInfo) + protected + procedure CreateColors; override; + procedure RefreshColors; override; + procedure ReleaseColors; override; + + function GetGroupCaptionHeightAddon: Integer; override; + function GetGroupCaptionSignSize: TSize; override; + public + function BgBackColor: TColor; override; + function BgBackColor2: TColor; override; + function BgAlphaBlend: Byte; override; + function BgAlphaBlend2: Byte; override; + function BgGradientMode: TdxBarStyleGradientMode; override; + end; + + TdxNavBarXPExplorerBarPainter = class(TdxNavBarExplorerBarPainter) + protected + class function GetViewInfoClass: TdxNavBarViewInfoClass; override; + class function GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; override; + class function GetLinkViewInfoClass: TdxNavBarLinkViewInfoClass; override; + + class function BackgroundPainterClass: TdxNavBarCustomBackgroundPainterClass; override; + class function ButtonPainterClass: TdxNavBarCustomButtonPainterClass; override; + class function SignPainterClass: TdxNavBarCustomSignPainterClass; override; + end; + + TdxNavBarXPExplorerBarButtonPainter = class(TdxNavBarCustomButtonPainter) + protected + class function GetButtonBitmap(AState: TdxNavBarObjectStates): TBitmap; + class procedure InternalDrawButton(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; + AState: TdxNavBarObjectStates); override; + end; + + TdxNavBarXPExplorerBarSignPainter = class(TdxNavBarExplorerBarSignPainter) + protected + class procedure CreateBitmap(var ADC: HDC; var ABitmap, AOldBitmap: HBITMAP; var AData: Pointer; AWidth, AHeight: Integer); + class procedure DeleteBitmap(var ADC: HDC; var ABitmap, AOldBitmap: HBITMAP; var AData: Pointer); + class procedure DrawMaskBitmap(DestX, DestY: Integer; DestHandle: THandle; Bitmap: TBitmap); + + class function GetSignBitmap(AState: TdxNavBarObjectStates): TBitmap; + class procedure InternalDrawSign(ACanvas: TCanvas; ARect: TRect; + AForeColor, ABackColor1, ABackColor2 : TColor; AState: TdxNavBarObjectStates); override; + end; + + TdxNavBarXPPainter = class + public + class function DrawObject(ACanvas: TCanvas; ARect: TRect; AObject: TdxThemedObjectType; + iPartId, iStateId: Integer): Boolean; + class function DrawText(ACanvas: TCanvas; ARect: TRect; + ACaption: string; ADrawTextFlag: Integer; + AObject: TdxThemedObjectType; iPartId, iStateId: Integer): Boolean; + end; + + TdxNavBarXPBackgroundPainter = class(TdxNavBarCustomBackgroundPainter) + protected + class procedure InternalDrawBackground(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AEraseBackground: Boolean; ABackgroundColor: TColor; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode); override; + end; + + TdxNavBarXPGroupBackgroundPainter = class(TdxNavBarCustomGroupBackgroundPainter) + protected + class procedure InternalDrawBackground(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode); override; + end; + + TdxNavBarXPSelectionPainter = class(TdxNavBarBaseSelectionPainter) + protected + class procedure InternalDrawSelection(ACanvas: TCanvas; ARect: TRect; + ABackColor: TColor; AState: TdxNavBarObjectStates); override; + end; + + TdxNavBarXPScrollButtonsPainter = class(TdxNavBarBaseScrollButtonsPainter) + protected + class procedure InternalDrawBottomButton(ACanvas: TCanvas; ARect: TRect; + AButtonPainterClass: TdxNavBarCustomButtonPainterClass; AColor1, AColor2: TColor; + AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode; + ABorderColor: TColor; AState: TdxNavBarObjectStates); override; + class procedure InternalDrawTopButton(ACanvas: TCanvas; ARect: TRect; + AButtonPainterClass: TdxNavBarCustomButtonPainterClass; AColor1, AColor2: TColor; + AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode; + ABorderColor: TColor; AState: TdxNavBarObjectStates); override; + end; + + TdxNavBarXPButtonPainter = class(TdxNavBarOfficeButtonPainter) + protected + class procedure InternalDrawButton(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; + AState: TdxNavBarObjectStates); override; + end; + + TdxNavBarXPExplorerBarBackgroundPainter = class(TdxNavBarCustomBackgroundPainter) + protected + class function GetBackgroundBitmap: TBitmap; + class procedure InternalDrawBackground(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; + AEraseBackground: Boolean; ABackgroundColor: TColor; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode); override; + end; + +implementation + +uses + Types, CommCtrl, ImgList, Buttons, + dxNavBarViewsFact, dxNavBarConsts, + dxThemeConsts, dxUxTheme, cxGeometry; + +{ TdxNavBarXP1GroupViewInfo } + +function TdxNavBarXP1GroupViewInfo.BgAlphaBlend: Byte; +begin + if IsDefaultBgColor then + Result := 255 + else Result := inherited BgAlphaBlend; +end; + +function TdxNavBarXP1GroupViewInfo.BgAlphaBlend2: Byte; +begin + if IsDefaultBgColor then + Result := 255 + else Result := inherited BgAlphaBlend2; +end; + +function TdxNavBarXP1GroupViewInfo.BgBackColor: TColor; +begin + if IsDefaultBgColor then + Result := LightLightColor(clInactiveCaption) + else Result := inherited BgBackColor; +end; + +function TdxNavBarXP1GroupViewInfo.BgBackColor2: TColor; +begin + if IsDefaultBgColor then + Result := clInactiveCaption + else Result := inherited BgBackColor2; +end; + +function TdxNavBarXP1GroupViewInfo.BgGradientMode: TdxBarStyleGradientMode; +begin + if IsDefaultBgColor then + Result := gmHorizontal + else Result := inherited BgGradientMode; +end; + +function TdxNavBarXP1GroupViewInfo.CaptionAlphaBlend: Byte; +begin + if IsDefaultCaptionColor then + Result := 255 + else Result := inherited CaptionAlphaBlend; +end; + +function TdxNavBarXP1GroupViewInfo.CaptionAlphaBlend2: Byte; +begin + if IsDefaultCaptionColor then + Result := 255 + else Result := inherited CaptionAlphaBlend2; +end; + +function TdxNavBarXP1GroupViewInfo.CaptionBackColor: TColor; +begin + if IsDefaultCaptionColor then + Result := clActiveCaption + else Result := inherited CaptionBackColor; +end; + +function TdxNavBarXP1GroupViewInfo.CaptionBackColor2: TColor; +begin + if IsDefaultCaptionColor then + begin + if Group = NavBar.HotTrackedGroup then + Result := clActiveCaption + else Result := DarkColor(clActiveCaption); + end + else Result := inherited CaptionBackColor2; +end; + +function TdxNavBarXP1GroupViewInfo.CaptionGradientMode: TdxBarStyleGradientMode; +begin + if IsDefaultCaptionColor then + Result := gmHorizontal + else Result := inherited CaptionGradientMode; +end; + +function TdxNavBarXP1GroupViewInfo.IsDefaultBgColor: Boolean; +begin + Result := (inherited BgBackColor = clNone) or (inherited BgBackColor2 = clNone); +end; + +function TdxNavBarXP1GroupViewInfo.IsDefaultCaptionColor: Boolean; +begin + Result := (inherited CaptionBackColor = clNone) or (inherited CaptionBackColor2 = clNone); +end; + +{ TdxNavBarXP1ViewInfo } + +procedure TdxNavBarXP1ViewInfo.AssignDefaultBackgroundStyle; +begin + NavBar.DefaultStyles.Background.ResetValues; + NavBar.DefaultStyles.Background.BackColor := clAppWorkSpace; + NavBar.DefaultStyles.Background.BackColor2 := clAppWorkSpace; +end; + +procedure TdxNavBarXP1ViewInfo.AssignDefaultGroupBackgroundStyle; +begin + NavBar.DefaultStyles.GroupBackground.ResetValues; + NavBar.DefaultStyles.GroupBackground.BackColor := clNone; + NavBar.DefaultStyles.GroupBackground.BackColor2 := clNone; +end; + +procedure TdxNavBarXP1ViewInfo.AssignDefaultGroupHeaderStyle; +begin + NavBar.DefaultStyles.GroupHeader.ResetValues; + NavBar.DefaultStyles.GroupHeader.BackColor := clNone; + NavBar.DefaultStyles.GroupHeader.BackColor2 := clNone; + NavBar.DefaultStyles.GroupHeader.Font.Color := clCaptionText; + NavBar.DefaultStyles.GroupHeader.HAlignment := haCenter; +end; + +procedure TdxNavBarXP1ViewInfo.AssignDefaultItemStyle; +begin + NavBar.DefaultStyles.Item.ResetValues; + NavBar.DefaultStyles.Item.Font.Color := clBtnText; + NavBar.DefaultStyles.Item.HAlignment := haCenter; +end; + +procedure TdxNavBarXP1ViewInfo.AssignDefaultItemDisabledStyle; +begin + NavBar.DefaultStyles.ItemDisabled.Assign(NavBar.DefaultStyles.Item); + NavBar.DefaultStyles.ItemDisabled.Font.Color := clBtnShadow; +end; + +{ TdxNavBarXP1Painter } + +procedure TdxNavBarXP1Painter.DrawGroupCaptionButton(AGroupViewInfo: TdxNavBarGroupViewInfo); +var + Color1, Color2: TColor; +begin + with AGroupViewInfo do + begin + Color1 := LightLightColor(CaptionBackColor); + if NavBar.HotTrackedGroup = Group then + Color2 := LightColor(CaptionBackColor) + else Color2 := CaptionBackColor; + ButtonPainterClass.DrawButton(Canvas, CaptionRect, CaptionImage, + Color1, Color2, CaptionAlphaBlend, CaptionAlphaBlend2, + CaptionGradientMode, CaptionBorderColor, State); + end; +end; + +class function TdxNavBarXP1Painter.GetViewInfoClass: TdxNavBarViewInfoClass; +begin + Result := TdxNavBarXP1ViewInfo; +end; + +class function TdxNavBarXP1Painter.GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; +begin + Result := TdxNavBarXP1GroupViewInfo; +end; + +class function TdxNavBarXP1Painter.ScrollButtonsPainterClass: TdxNavBarCustomScrollButtonsPainterClass; +begin + Result := TdxNavBarXPScrollButtonsPainter; +end; + +class function TdxNavBarXP1Painter.SelectionPainterClass: TdxNavBarCustomSelectionPainterClass; +begin + Result := TdxNavBarXPSelectionPainter; +end; + +{ TdxNavBarXP2Painter } + +class function TdxNavBarXP2Painter.BackgroundPainterClass: TdxNavBarCustomBackgroundPainterClass; +begin + Result := TdxNavBarXPBackgroundPainter; +end; + +class function TdxNavBarXP2Painter.ButtonPainterClass: TdxNavBarCustomButtonPainterClass; +begin + Result := TdxNavBarXPButtonPainter; +end; + +class function TdxNavBarXP2Painter.GroupBackgroundPainterClass: TdxNavBarCustomGroupBackgroundPainterClass; +begin + Result := TdxNavBarXPGroupBackgroundPainter; +end; + +class function TdxNavBarXP2Painter.ScrollButtonsPainterClass: TdxNavBarCustomScrollButtonsPainterClass; +begin + Result := TdxNavBarXPScrollButtonsPainter; +end; + +class function TdxNavBarXP2Painter.SelectionPainterClass: TdxNavBarCustomSelectionPainterClass; +begin + Result := TdxNavBarXPSelectionPainter; +end; + +{ TdxNavBarXPExplorerBarLinkViewInfo } + +function TdxNavBarXPExplorerBarLinkViewInfo.Font: TFont; +var + AFont: TFont; +begin + Result := inherited Font; + if (OpenTheme(totExplorerBar) <> 0) and CheckShellInstance then + begin + if sHotTracked in State then + AFont := dxXPExplorerBarItemFontHot + else AFont := dxXPExplorerBarItemFont; + if AFont <> nil then + begin + Result.Assign(AFont); + if sDisabled in State then + Result.Style := Result.Style - [fsUnderline]; + end; + end; +end; + +function TdxNavBarXPExplorerBarLinkViewInfo.FontColor: TColor; +begin + Result := inherited FontColor; + if (OpenTheme(totExplorerBar) <> 0) and CheckShellInstance then + begin + Result := Font.Color; + if sDisabled in State then + Result := LightColor(Result); + end; +end; + +{ TdxNavBarXPExplorerBarGroupViewInfo } + +function TdxNavBarXPExplorerBarGroupViewInfo.BorderColor: TColor; +var + APart: Integer; + AColor: COLORREF; +begin + APart := EBP_NORMALGROUPBACKGROUND; + if dxXPExplorerBarGroupBorderColor <> clNone then + Result := dxXPExplorerBarGroupBorderColor + else if (OpenTheme(totExplorerBar) <> 0) and not Failed(GetThemeColor(OpenTheme(totExplorerBar), APart, 0, TMT_BORDERCOLOR, AColor)) then + Result := AColor + else Result := inherited BorderColor; +end; + +function TdxNavBarXPExplorerBarGroupViewInfo.BgBackColor: TColor; +var + APart: Integer; + AColor: COLORREF; +begin + APart := EBP_NORMALGROUPBACKGROUND; + if (OpenTheme(totExplorerBar) <> 0) and not Failed(GetThemeColor(OpenTheme(totExplorerBar), APart, 0, TMT_FILLCOLOR, AColor)) then + Result := AColor + else if (OpenTheme(totExplorerBar) <> 0) and not Failed(GetThemeColor(OpenTheme(totExplorerBar), APart, 0, TMT_GRADIENTCOLOR1, AColor)) then + Result := AColor + else Result := inherited BgBackColor; +end; + +function TdxNavBarXPExplorerBarGroupViewInfo.BgBackColor2: TColor; +var + APart: Integer; + AColor: COLORREF; +begin + APart := EBP_NORMALGROUPBACKGROUND; + if (OpenTheme(totExplorerBar) <> 0) and not Failed(GetThemeColor(OpenTheme(totExplorerBar), APart, 0, TMT_FILLCOLOR, AColor)) then + Result := AColor + else if (OpenTheme(totExplorerBar) <> 0) and not Failed(GetThemeColor(OpenTheme(totExplorerBar), APart, 0, TMT_GRADIENTCOLOR2, AColor)) then + Result := AColor + else Result := inherited BgBackColor2; +end; + +function TdxNavBarXPExplorerBarGroupViewInfo.BgAlphaBlend: Byte; +begin + if OpenTheme(totExplorerBar) <> 0 then + Result := 255 + else Result := inherited BgAlphaBlend; +end; + +function TdxNavBarXPExplorerBarGroupViewInfo.BgAlphaBlend2: Byte; +begin + if OpenTheme(totExplorerBar) <> 0 then + Result := 255 + else Result := inherited BgAlphaBlend2; +end; + +function TdxNavBarXPExplorerBarGroupViewInfo.BgGradientMode: TdxBarStyleGradientMode; +begin + if OpenTheme(totExplorerBar) <> 0 then + Result := gmHorizontal + else Result := inherited BgGradientMode; +end; + +function TdxNavBarXPExplorerBarGroupViewInfo.CaptionBackColor: TColor; +var + APart: Integer; + AColor: COLORREF; +begin + if sSpecial in State then + APart := EBP_SPECIALGROUPHEAD + else APart := EBP_NORMALGROUPHEAD; + if (OpenTheme(totExplorerBar) <> 0) and not Failed(GetThemeColor(OpenTheme(totExplorerBar), APart, 0, TMT_FILLCOLOR, AColor)) then + Result := AColor + else if (OpenTheme(totExplorerBar) <> 0) and not Failed(GetThemeColor(OpenTheme(totExplorerBar), APart, 0, TMT_GRADIENTCOLOR1, AColor)) then + Result := AColor + else Result := inherited CaptionBackColor; +end; + +function TdxNavBarXPExplorerBarGroupViewInfo.CaptionBackColor2: TColor; +var + APart: Integer; + AColor: COLORREF; +begin + if sSpecial in State then + APart := EBP_SPECIALGROUPHEAD + else APart := EBP_NORMALGROUPHEAD; + if (OpenTheme(totExplorerBar) <> 0) and not Failed(GetThemeColor(OpenTheme(totExplorerBar), APart, 0, TMT_FILLCOLOR, AColor)) then + Result := AColor + else if (OpenTheme(totExplorerBar) <> 0) and not Failed(GetThemeColor(OpenTheme(totExplorerBar), APart, 0, TMT_GRADIENTCOLOR2, AColor)) then + Result := AColor + else Result := inherited CaptionBackColor2; +end; + +function TdxNavBarXPExplorerBarGroupViewInfo.CaptionAlphaBlend: Byte; +begin + if OpenTheme(totExplorerBar) <> 0 then + Result := 255 + else Result := inherited CaptionAlphaBlend; +end; + +function TdxNavBarXPExplorerBarGroupViewInfo.CaptionAlphaBlend2: Byte; +begin + if OpenTheme(totExplorerBar) <> 0 then + Result := 255 + else Result := inherited CaptionAlphaBlend2; +end; + +function TdxNavBarXPExplorerBarGroupViewInfo.CaptionGradientMode: TdxBarStyleGradientMode; +begin + if OpenTheme(totExplorerBar) <> 0 then + Result := gmHorizontal + else Result := inherited CaptionGradientMode; +end; + +function TdxNavBarXPExplorerBarGroupViewInfo.CaptionFont: TFont; +var + AFont: TFont; +begin + Result := inherited CaptionFont; + if (OpenTheme(totExplorerBar) <> 0) and CheckShellInstance then + begin + if sHotTracked in State then + AFont := dxXPExplorerBarGroupHeaderFontHot + else AFont := dxXPExplorerBarGroupHeaderFont; + if AFont <> nil then + begin + Result.Assign(AFont); + Result.Style := Result.Style - [fsUnderline]; + end; + end; +end; + +function TdxNavBarXPExplorerBarGroupViewInfo.CaptionFontColor: TColor; +begin + if (OpenTheme(totExplorerBar) <> 0) and CheckShellInstance then + begin + Result := CaptionFont.Color; + if sSpecial in State then Result := clWhite; + end + else Result := inherited CaptionFontColor; +end; + +{ TdxNavBarXPExplorerBarViewInfo } + +function TdxNavBarXPExplorerBarViewInfo.BgBackColor: TColor; +var + AColor: COLORREF; +begin + if (OpenTheme(totExplorerBar) <> 0) and not Failed(GetThemeColor(OpenTheme(totExplorerBar), EBP_HEADERBACKGROUND, -1, TMT_GRADIENTCOLOR1, AColor)) then + Result := AColor + else Result := inherited BgBackColor; +end; + +function TdxNavBarXPExplorerBarViewInfo.BgBackColor2: TColor; +var + AColor: COLORREF; +begin + if (OpenTheme(totExplorerBar) <> 0) and not Failed(GetThemeColor(OpenTheme(totExplorerBar), EBP_HEADERBACKGROUND, -1, TMT_GRADIENTCOLOR2, AColor)) then + Result := AColor + else Result := inherited BgBackColor2; +end; + +function TdxNavBarXPExplorerBarViewInfo.BgAlphaBlend: Byte; +begin + if OpenTheme(totExplorerBar) <> 0 then + Result := 255 + else Result := inherited BgAlphaBlend; +end; + +function TdxNavBarXPExplorerBarViewInfo.BgAlphaBlend2: Byte; +begin + if OpenTheme(totExplorerBar) <> 0 then + Result := 255 + else Result := inherited BgAlphaBlend2; +end; + +function TdxNavBarXPExplorerBarViewInfo.BgGradientMode: TdxBarStyleGradientMode; +begin + if OpenTheme(totExplorerBar) <> 0 then + Result := gmVertical + else Result := inherited BgGradientMode; +end; + +procedure TdxNavBarXPExplorerBarViewInfo.CreateColors; +begin + CreateXPExplorerBarColors; +end; + +procedure TdxNavBarXPExplorerBarViewInfo.RefreshColors; +begin + RefreshXPExplorerBarColors; +end; + +procedure TdxNavBarXPExplorerBarViewInfo.ReleaseColors; +begin + ReleaseXPExplorerBarColors; +end; + +function TdxNavBarXPExplorerBarViewInfo.GetGroupCaptionHeightAddon: Integer; +begin + if OpenTheme(totExplorerBar) = 0 then + Result := inherited GetGroupCaptionHeightAddon + else + Result := 12; +end; + +function TdxNavBarXPExplorerBarViewInfo.GetGroupCaptionSignSize: TSize; +begin + if OpenTheme(totExplorerBar) = 0 then + Result := inherited GetGroupCaptionSignSize + else + Result := cxSize(22, 22); +end; + +{ TdxNavBarXPExplorerBarPainter } + +class function TdxNavBarXPExplorerBarPainter.GetViewInfoClass: TdxNavBarViewInfoClass; +begin + Result := TdxNavBarXPExplorerBarViewInfo; +end; + +class function TdxNavBarXPExplorerBarPainter.GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; +begin + Result := TdxNavBarXPExplorerBarGroupViewInfo; +end; + +class function TdxNavBarXPExplorerBarPainter.GetLinkViewInfoClass: TdxNavBarLinkViewInfoClass; +begin + Result := TdxNavBarXPExplorerBarLinkViewInfo; +end; + +class function TdxNavBarXPExplorerBarPainter.BackgroundPainterClass: TdxNavBarCustomBackgroundPainterClass; +begin + Result := TdxNavBarXPExplorerBarBackgroundPainter; +end; + +class function TdxNavBarXPExplorerBarPainter.ButtonPainterClass: TdxNavBarCustomButtonPainterClass; +begin + Result := TdxNavBarXPExplorerBarButtonPainter; +end; + +class function TdxNavBarXPExplorerBarPainter.SignPainterClass: TdxNavBarCustomSignPainterClass; +begin + Result := TdxNavBarXPExplorerBarSignPainter; +end; + +{ TdxNavBarXPExplorerBarButtonPainter } + +class function TdxNavBarXPExplorerBarButtonPainter.GetButtonBitmap(AState: TdxNavBarObjectStates): TBitmap; +begin + if (sSpecial in AState) and (dxXPExplorerBarSpecialGroupHeader <> nil) then + Result := dxXPExplorerBarSpecialGroupHeader + else Result := dxXPExplorerBarNormalGroupHeader; +end; + +class procedure TdxNavBarXPExplorerBarButtonPainter.InternalDrawButton( + ACanvas: TCanvas; ARect: TRect; APicture: TPicture; AColor1, + AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; + AState: TdxNavBarObjectStates); +var + ABitmap: TBitmap; + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totExplorerBar); + ABitmap := GetButtonBitmap(AState); + if (ATheme <> 0) and (ABitmap <> nil) then + begin + ABitmap.PixelFormat := pf32bit; + ABitmap.Transparent := True; + ABitmap.TransparentColor := clFuchsia; + ACanvas.StretchDraw(ARect, ABitmap); + end + else + inherited; +end; + +{ TdxNavBarXPExplorerBarSignPainter } + +class procedure TdxNavBarXPExplorerBarSignPainter.CreateBitmap(var ADC: HDC; + var ABitmap, AOldBitmap: HBITMAP; var AData: Pointer; AWidth, AHeight: Integer); +var + TempDC: HDC; + BitInfo: TBitmapInfo; +begin + TempDC := GetDC(0); + ADC := CreateCompatibleDC(TempDC); + with BitInfo.bmiHeader do + begin + biSize := SizeOf(TBitmapInfoHeader); + biPlanes := 1; + biBitCount := 32; + biCompression := BI_RGB; + biWidth := AWidth; + biHeight := AHeight; + biSizeImage := 0; + biXPelsPerMeter := 0; + biYPelsPerMeter := 0; + biClrUsed := 0; + biClrImportant := 0; + end; + ABitmap := CreateDIBSection(ADC, BitInfo, DIB_RGB_COLORS, AData, 0, 0); + GDIFlush; + AOldBitmap := SelectObject(ADC, ABitmap); + ReleaseDC(0, TempDC); +end; + +class procedure TdxNavBarXPExplorerBarSignPainter.DeleteBitmap(var ADC: HDC; + var ABitmap, AOldBitmap: HBITMAP; var AData: Pointer); +begin + GDIFlush; + SelectObject(ADC, AOldBitmap); + DeleteObject(ABitmap); + DeleteDC(ADC); + AData := nil; +end; + +class procedure TdxNavBarXPExplorerBarSignPainter.DrawMaskBitmap(DestX, DestY: Integer; + DestHandle: THandle; Bitmap: TBitmap); +var + I, J: Integer; + DC1, DC2: HDC; + Bitmap1, Bitmap2: HBITMAP; + OldBitmap1, OldBitmap2: HBITMAP; + Data1, Data2: Pointer; + ASourceData, ADestData: Pointer; + sR, sG, sB, sA: Byte; + dR, dG, dB: Byte; + R, G, B: Word; +begin + CreateBitmap(DC1, Bitmap1, OldBitmap1, Data1, Bitmap.Width, Bitmap.Height); + CreateBitmap(DC2, Bitmap2, OldBitmap2, Data2, Bitmap.Width, Bitmap.Height); + try + BitBlt(DC1, 0, 0, Bitmap.Width, Bitmap.Height, Bitmap.Canvas.Handle, 0, 0, SRCCOPY); + BitBlt(DC2, 0, 0, Bitmap.Width, Bitmap.Height, DestHandle, DestX, DestY, SRCCOPY); + + ASourceData := Pointer(Integer(Data1) + ((Bitmap.Height - 1) * Bitmap.Width * 4)); + ADestData := Pointer(Integer(Data2) + ((Bitmap.Height - 1) * Bitmap.Width * 4)); + for I := 0 to Bitmap.Height - 1 do + begin + for J := 0 to Bitmap.Width - 1 do + begin + sA := PByte(Integer(ASourceData) + 3)^; + + sG := PByte(ASourceData)^; + dG := PByte(ADestData)^; + G := (sG * sA) + (dG * (255 - sA)); + PByte(ADestData)^ := G div 256 + 1; + + sB := PByte(Integer(ASourceData) + 1)^; + dB := PByte(Integer(ADestData) + 1)^; + B := (sB * sA) + (dB * (255 - sA)); + PByte(Integer(ADestData) + 1)^ := B div 256 + 1; + + sR := PByte(Integer(ASourceData) + 2)^; + dR := PByte(Integer(ADestData) + 2)^; + R := (sR * sA) + (dR * (255 - sA)); + PByte(Integer(ADestData) + 2)^ := R div 256 + 1; + + PByte(Integer(ADestData) + 3)^ := PByte(Integer(ASourceData) + 3)^; + + ASourceData := Pointer(Integer(ASourceData) + 4); + ADestData := Pointer(Integer(ADestData) + 4); + end; + ASourceData := Pointer(Integer(ASourceData) - Bitmap.Width * 4 * 2); + ADestData := Pointer(Integer(ADestData) - Bitmap.Width * 4 * 2); + end; + + BitBlt(DestHandle, DestX, DestY, Bitmap.Width, Bitmap.Height, DC2, 0, 0, SRCCOPY); + finally + DeleteBitmap(DC1, Bitmap1, OldBitmap1, Data1); + DeleteBitmap(DC2, Bitmap2, OldBitmap2, Data2); + end; +end; + +class function TdxNavBarXPExplorerBarSignPainter.GetSignBitmap(AState: TdxNavBarObjectStates): TBitmap; +begin + if (sExpanded in AState) then + begin + if sHotTracked in AState then + begin + if (sSpecial in AState) and (dxXPExplorerBarSpecialGroupCollapseHot <> nil) then + Result := dxXPExplorerBarSpecialGroupCollapseHot + else Result := dxXPExplorerBarNormalGroupCollapseHot + end + else + begin + if (sSpecial in AState) and (dxXPExplorerBarSpecialGroupCollapse <> nil) then + Result := dxXPExplorerBarSpecialGroupCollapse + else Result := dxXPExplorerBarNormalGroupCollapse; + end; + end + else + begin + if sHotTracked in AState then + begin + if (sSpecial in AState) and (dxXPExplorerBarSpecialGroupExpandHot <> nil) then + Result := dxXPExplorerBarSpecialGroupExpandHot + else Result := dxXPExplorerBarNormalGroupExpandHot + end + else + begin + if (sSpecial in AState) and (dxXPExplorerBarSpecialGroupExpand <> nil) then + Result := dxXPExplorerBarSpecialGroupExpand + else Result := dxXPExplorerBarNormalGroupExpand; + end; + end; +end; + +class procedure TdxNavBarXPExplorerBarSignPainter.InternalDrawSign(ACanvas: TCanvas; + ARect: TRect; AForeColor, ABackColor1, ABackColor2 : TColor; + AState: TdxNavBarObjectStates); +var + ABitmap: TBitmap; + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totExplorerBar); + ABitmap := GetSignBitmap(AState); + if (ATheme <> 0) and (ABitmap <> nil) then + begin + if TdxNavBarXPExplorerBarButtonPainter.GetButtonBitmap(AState) <> nil then + DrawMaskBitmap(ARect.Left, ARect.Top, ACanvas.Handle, ABitmap) + else + begin + ABitmap.PixelFormat := pf32bit; + ABitmap.Transparent := True; + ABitmap.TransparentColor := clFuchsia; + ACanvas.StretchDraw(ARect, ABitmap); + end + end + else inherited; +end; + +{ TdxNavBarXPPainter } + +class function TdxNavBarXPPainter.DrawObject(ACanvas: TCanvas; ARect: TRect; + AObject: TdxThemedObjectType; iPartId, iStateId: Integer): Boolean; +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(AObject); + if ATheme <> 0 then + begin + DrawThemeBackground(ATheme, ACanvas.Handle, iPartId, iStateId, @ARect); + Result := True; + end + else Result := False; +end; + +class function TdxNavBarXPPainter.DrawText(ACanvas: TCanvas; ARect: TRect; + ACaption: string; ADrawTextFlag: Integer; + AObject: TdxThemedObjectType; iPartId, iStateId: Integer): Boolean; +var + ATheme: TdxTheme; +begin + ATheme := OpenTheme(AObject); + if ATheme <> 0 then + begin + DrawThemeText(ATheme, ACanvas.Handle, iPartId, iStateId, ACaption, + -1, ADrawTextFlag, 0, ARect); + Result := True; + end + else Result := False; +end; + +{ TdxNavBarXPBackgroundPainter } + +class procedure TdxNavBarXPBackgroundPainter.InternalDrawBackground(ACanvas: TCanvas; + ARect: TRect; APicture: TPicture; AEraseBackground: Boolean; ABackgroundColor: TColor; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode); +begin + if not TdxNavBarXPPainter.DrawObject(ACanvas, ARect, totTab, TABP_BODY, 0) then + inherited; +end; + +{ TdxNavBarXPGroupBackgroundPainter } + +class procedure TdxNavBarXPGroupBackgroundPainter.InternalDrawBackground(ACanvas: TCanvas; + ARect: TRect; APicture: TPicture; AColor1, AColor2: TColor; + AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode); +begin + TdxNavBarXPBackgroundPainter.DrawBackground(ACanvas, ARect, APicture, False, clNone, + AColor1, AColor2, AAlphaBlend1, AAlphaBlend2, AGradientMode); +end; + +{ TdxNavBarXPSelectionPainter } + +class procedure TdxNavBarXPSelectionPainter.InternalDrawSelection(ACanvas: TCanvas; + ARect: TRect; ABackColor: TColor; AState: TdxNavBarObjectStates); +var + AStateID: Integer; +begin + if [sPressed, sSelected] * AState <> [] then + AStateID := TS_PRESSED + else + if (sHotTracked in AState) then + AStateID := TS_HOT + else + AStateID := TS_NORMAL; + if not TdxNavBarXPPainter.DrawObject(ACanvas, ARect, totToolBar, TP_BUTTON, AStateID) then + inherited; +end; + +{ TdxNavBarXPButtonPainter } + +class procedure TdxNavBarXPButtonPainter.InternalDrawButton(ACanvas: TCanvas; + ARect: TRect; APicture: TPicture; AColor1, AColor2: TColor; AAlphaBlend1, + AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; + AState: TdxNavBarObjectStates); +var + AStateID: Integer; +begin + if sPressed in AState then + AStateID := PBS_PRESSED + else + if sHotTracked in AState then + AStateID := PBS_HOT + else + if sActive in AState then + AStateID := PBS_DEFAULTED + else + AStateID := PBS_NORMAL; + if not TdxNavBarXPPainter.DrawObject(ACanvas, ARect, totButton, BP_PUSHBUTTON, AStateID) then + inherited; +end; + +{ TdxNavBarXPScrollButtonsPainter } + +class procedure TdxNavBarXPScrollButtonsPainter.InternalDrawBottomButton( + ACanvas: TCanvas; ARect: TRect; + AButtonPainterClass: TdxNavBarCustomButtonPainterClass; AColor1, AColor2: TColor; + AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode; + ABorderColor: TColor; AState: TdxNavBarObjectStates); +var + ATheme: TdxTheme; + AStateID: Integer; +begin + ATheme := OpenTheme(totScrollBar); + if ATheme <> 0 then + begin + if sPressed in AState then + AStateID := ABS_DOWNPRESSED + else if sHotTracked in AState then + AStateID := ABS_DOWNHOT + else AStateID := ABS_DOWNNORMAL; + TdxNavBarXPPainter.DrawObject(ACanvas, ARect, totScrollBar, SBP_ARROWBTN, AStateID); + ExcludeClipRect(ACanvas.Handle, ARect.Left, ARect.Top, ARect.Right, ARect.Bottom); + end + else inherited; +end; + +class procedure TdxNavBarXPScrollButtonsPainter.InternalDrawTopButton( + ACanvas: TCanvas; ARect: TRect; + AButtonPainterClass: TdxNavBarCustomButtonPainterClass; AColor1, AColor2: TColor; + AAlphaBlend1, AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode; + ABorderColor: TColor; AState: TdxNavBarObjectStates); +var + ATheme: TdxTheme; + AStateID: Integer; +begin + ATheme := OpenTheme(totScrollBar); + if ATheme <> 0 then + begin + if sPressed in AState then + AStateID := ABS_UPPRESSED + else if sHotTracked in AState then + AStateID := ABS_UPHOT + else AStateID := ABS_UPNORMAL; + TdxNavBarXPPainter.DrawObject(ACanvas, ARect, totScrollBar, SBP_ARROWBTN, AStateID); + ExcludeClipRect(ACanvas.Handle, ARect.Left, ARect.Top, ARect.Right, ARect.Bottom); + end + else inherited; +end; + +{ TdxNavBarXPExplorerBarBackgroundPainter } + +class function TdxNavBarXPExplorerBarBackgroundPainter.GetBackgroundBitmap: TBitmap; +begin + Result := dxXPExplorerBarBackground; +end; + +class procedure TdxNavBarXPExplorerBarBackgroundPainter.InternalDrawBackground(ACanvas: TCanvas; + ARect: TRect; APicture: TPicture; AEraseBackground: Boolean; ABackgroundColor: TColor; + AColor1, AColor2: TColor; AAlphaBlend1, AAlphaBlend2: Byte; + AGradientMode: TdxBarStyleGradientMode); +var + ABitmap: TBitmap; + ATheme: TdxTheme; +begin + ATheme := OpenTheme(totExplorerBar); + ABitmap := GetBackgroundBitmap; + if (ATheme <> 0) and (ABitmap <> nil) then + begin + ABitmap.PixelFormat := pf32bit; + ABitmap.Transparent := True; + ABitmap.TransparentColor := clFuchsia; + ACanvas.StretchDraw(ARect, ABitmap); + end + else inherited; +end; + + +initialization + RegisterView(dxNavBarXP1View, 'XP1View', TdxNavBarXP1Painter); + RegisterView(dxNavBarXP2View, 'XP2View', TdxNavBarXP2Painter); + RegisterView(dxNavBarXPExplorerBarView, 'XPExplorerBarView', TdxNavBarXPExplorerBarPainter); + +finalization + UnRegisterView(dxNavBarXP1View); + UnRegisterView(dxNavBarXP2View); + UnRegisterView(dxNavBarXPExplorerBarView); + +end. diff --git a/official/x.35/ExpressNavBar 2/Sources/dxfmNavBarDsgnEditor.dfm b/official/x.35/ExpressNavBar 2/Sources/dxfmNavBarDsgnEditor.dfm new file mode 100644 index 00000000..a122002b --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxfmNavBarDsgnEditor.dfm @@ -0,0 +1,3772 @@ +object dxfmNavBarDesignWindow: TdxfmNavBarDesignWindow + Left = 405 + Top = 152 + AutoScroll = False + BorderIcons = [biSystemMenu] + ClientHeight = 433 + ClientWidth = 539 + Color = clBtnFace + Constraints.MinHeight = 467 + Constraints.MinWidth = 547 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + PixelsPerInch = 96 + TextHeight = 13 + object nbMain: TdxNavBar + Left = 0 + Top = 0 + Width = 137 + Height = 392 + Align = alLeft + ActiveGroupIndex = 0 + TabOrder = 1 + View = 8 + OptionsImage.LargeImages = ilNavBarLarge + OptionsImage.SmallImages = ilNavBarSmall + OnLinkClick = nbMainLinkClick + object bgMain: TdxNavBarGroup + Caption = 'Main' + LargeImageIndex = 0 + SelectedLinkIndex = -1 + TopVisibleLinkIndex = 0 + UseSmallImages = False + Links = < + item + Item = biGroups + end + item + Item = biItems + end + item + Item = biLinks + end + item + Item = biViews + end> + end + object bgStyles: TdxNavBarGroup + Caption = 'Styles' + LargeImageIndex = 1 + SelectedLinkIndex = -1 + TopVisibleLinkIndex = 0 + UseSmallImages = False + Links = < + item + Item = biDefaultStyles + end + item + Item = biCustomStyles + end> + end + object biGroups: TdxNavBarItem + Caption = 'Groups' + SmallImageIndex = 0 + end + object biItems: TdxNavBarItem + Caption = 'Items' + SmallImageIndex = 1 + end + object biLinks: TdxNavBarItem + Caption = 'Link designer' + SmallImageIndex = 2 + end + object biViews: TdxNavBarItem + Caption = 'Views' + SmallImageIndex = 3 + end + object biDefaultStyles: TdxNavBarItem + Caption = 'Default styles' + SmallImageIndex = 4 + end + object biCustomStyles: TdxNavBarItem + Caption = 'Custom styles' + SmallImageIndex = 5 + end + end + object pnCommonButtons: TPanel + Left = 0 + Top = 392 + Width = 539 + Height = 41 + Align = alBottom + BevelOuter = bvNone + TabOrder = 2 + object btCancel: TButton + Left = 431 + Top = 8 + Width = 100 + Height = 25 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Close' + TabOrder = 0 + OnClick = btCancelClick + end + end + object pcMain: TPageControl + Left = 137 + Top = 0 + Width = 402 + Height = 392 + ActivePage = tsGroups + Align = alClient + TabOrder = 0 + object tsGroups: TTabSheet + Caption = 'Groups' + object pnButtons: TPanel + Left = 0 + Top = 0 + Width = 394 + Height = 33 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object tlbGroups: TToolBar + Left = 0 + Top = 6 + Width = 150 + Height = 25 + Align = alNone + Caption = 'Commands' + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Images = ilActions + ParentShowHint = False + ShowHint = True + TabOrder = 0 + object ToolButton3: TToolButton + Left = 0 + Top = 0 + Action = actAdd + end + object ToolButton5: TToolButton + Left = 23 + Top = 0 + Action = actDelete + end + object ToolButton6: TToolButton + Left = 46 + Top = 0 + Width = 8 + Caption = 'ToolButton6' + ImageIndex = 5 + Style = tbsSeparator + end + object ToolButton1: TToolButton + Left = 54 + Top = 0 + Action = actMoveUp + end + object ToolButton2: TToolButton + Left = 77 + Top = 0 + Action = actMoveDown + end + object ToolButton7: TToolButton + Left = 100 + Top = 0 + Width = 8 + Caption = 'ToolButton7' + ImageIndex = 5 + Style = tbsSeparator + end + object ToolButton12: TToolButton + Left = 108 + Top = 0 + Action = actSelectAll + end + end + end + object lbxGroups: TListBox + Left = 0 + Top = 33 + Width = 394 + Height = 331 + Align = alClient + ItemHeight = 13 + MultiSelect = True + PopupMenu = pmMain + TabOrder = 1 + OnClick = ListBoxClick + OnContextPopup = lbxContextPopup + end + end + object tsItems: TTabSheet + Caption = 'Items' + ImageIndex = 5 + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 394 + Height = 33 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object tlbItems: TToolBar + Left = 0 + Top = 6 + Width = 161 + Height = 25 + Align = alNone + Caption = 'Commands' + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Images = ilActions + ParentShowHint = False + ShowHint = True + TabOrder = 0 + object ToolButton4: TToolButton + Left = 0 + Top = 0 + Action = actAdd + DropdownMenu = pmGroupItemClasses + Style = tbsDropDown + end + object ToolButton8: TToolButton + Left = 36 + Top = 0 + Action = actDelete + end + object ToolButton9: TToolButton + Left = 59 + Top = 0 + Width = 8 + Caption = 'ToolButton6' + ImageIndex = 5 + Style = tbsSeparator + end + object ToolButton10: TToolButton + Left = 67 + Top = 0 + Action = actMoveUp + end + object ToolButton11: TToolButton + Left = 90 + Top = 0 + Action = actMoveDown + end + object ToolButton13: TToolButton + Left = 113 + Top = 0 + Width = 8 + Caption = 'ToolButton7' + ImageIndex = 5 + Style = tbsSeparator + end + object ToolButton14: TToolButton + Left = 121 + Top = 0 + Action = actSelectAll + end + end + end + object lbxItems: TListBox + Left = 0 + Top = 33 + Width = 394 + Height = 331 + Align = alClient + ItemHeight = 13 + MultiSelect = True + PopupMenu = pmMain + TabOrder = 1 + OnClick = ListBoxClick + OnContextPopup = lbxItemsContextPopup + end + end + object tsLinks: TTabSheet + Caption = 'Link designer' + ImageIndex = 2 + object Splitter1: TSplitter + Left = 227 + Top = 28 + Height = 336 + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 394 + Height = 28 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object tlbLinkDesigner: TToolBar + Left = 0 + Top = 6 + Width = 150 + Height = 25 + Align = alNone + Caption = 'Commands' + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Images = ilActions + ParentShowHint = False + ShowHint = True + TabOrder = 0 + object ToolButton22: TToolButton + Left = 0 + Top = 0 + Action = actAdd + end + object ToolButton23: TToolButton + Left = 23 + Top = 0 + Action = actDelete + end + object ToolButton24: TToolButton + Left = 46 + Top = 0 + Width = 8 + Caption = 'ToolButton6' + ImageIndex = 5 + Style = tbsSeparator + end + object ToolButton25: TToolButton + Left = 54 + Top = 0 + Action = actMoveUp + end + object ToolButton26: TToolButton + Left = 77 + Top = 0 + Action = actMoveDown + end + end + end + object Panel3: TPanel + Left = 230 + Top = 28 + Width = 164 + Height = 336 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lbxLinkDesignerItems: TListView + Left = 0 + Top = 25 + Width = 164 + Height = 311 + Align = alClient + Columns = <> + DragMode = dmAutomatic + HideSelection = False + ReadOnly = True + PopupMenu = pmMain + SmallImages = ilLinkDesigner + TabOrder = 0 + ViewStyle = vsList + OnClick = lbxLinkDesignerItemsClick + OnContextPopup = lbxContextPopup + OnEndDrag = lbxLinkDesignerItemsEndDrag + OnDragDrop = lbxLinkDesignerItemsDragDrop + OnDragOver = lbxLinkDesignerItemsDragOver + OnStartDrag = lbxLinkDesignerItemsStartDrag + end + object Panel7: TPanel + Left = 0 + Top = 0 + Width = 164 + Height = 25 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Label2: TLabel + Left = 0 + Top = 7 + Width = 28 + Height = 13 + Caption = 'Items:' + end + end + end + object Panel4: TPanel + Left = 0 + Top = 28 + Width = 227 + Height = 336 + Align = alLeft + BevelOuter = bvNone + TabOrder = 2 + object tvLinkDesignerGroups: TTreeView + Left = 0 + Top = 25 + Width = 227 + Height = 311 + Align = alClient + DragMode = dmAutomatic + HideSelection = False + Images = ilLinkDesigner + Indent = 19 + PopupMenu = pmMain + ReadOnly = True + TabOrder = 0 + OnClick = tvLinkDesignerGroupsClick + OnContextPopup = lbxContextPopup + OnDragDrop = tvLinkDesignerGroupsDragDrop + OnDragOver = tvLinkDesignerGroupsDragOver + OnEndDrag = tvLinkDesignerGroupsEndDrag + OnExit = tvLinkDesignerGroupsExit + OnKeyUp = tvLinkDesignerGroupsKeyUp + OnStartDrag = tvLinkDesignerGroupsStartDrag + end + object Panel5: TPanel + Left = 0 + Top = 0 + Width = 227 + Height = 25 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Label1: TLabel + Left = 0 + Top = 7 + Width = 82 + Height = 13 + Caption = 'Groups and links:' + end + end + end + end + object tsViews: TTabSheet + Caption = 'Views' + ImageIndex = 4 + object Label3: TLabel + Left = 193 + Top = 14 + Width = 41 + Height = 13 + Anchors = [akTop, akRight] + Caption = 'Preview:' + end + object Label4: TLabel + Left = 0 + Top = 14 + Width = 55 + Height = 13 + Caption = 'View styles:' + end + object lblColorScheme: TLabel + Left = 0 + Top = 325 + Width = 67 + Height = 13 + Anchors = [akLeft, akBottom] + Caption = 'Color scheme:' + end + object nbPreview: TdxNavBar + Left = 193 + Top = 32 + Width = 201 + Height = 332 + Anchors = [akTop, akRight, akBottom] + BorderStyle = bsSingle + ActiveGroupIndex = 0 + DragCopyCursor = -1141 + DragCursor = -1140 + HotTrackedLinkCursor = crHandPoint + TabOrder = 0 + View = 13 + OptionsImage.LargeImages = ilPreviewLarge + OptionsImage.SmallImages = ilPreviewSmall + object bgLocal: TdxNavBarGroup + Caption = 'Local' + LargeImageIndex = 4 + SelectedLinkIndex = -1 + SmallImageIndex = 10 + TopVisibleLinkIndex = 0 + UseSmallImages = False + Links = < + item + Item = biInbox + end + item + Item = biOutbox + end + item + Item = biSentItems + end + item + Item = biDeletedItems + end + item + Item = biReport + end> + end + object bgContacts: TdxNavBarGroup + Caption = 'Contacts' + LargeImageIndex = 7 + LinksUseSmallImages = False + SelectedLinkIndex = -1 + SmallImageIndex = 5 + TopVisibleLinkIndex = 0 + Links = < + item + Item = nbCalendar + end + item + Item = nbTask + end + item + Item = biReport + end> + end + object biInbox: TdxNavBarItem + Caption = 'Inbox' + LargeImageIndex = 3 + SmallImageIndex = 3 + end + object biOutbox: TdxNavBarItem + Caption = 'Outbox' + LargeImageIndex = 7 + SmallImageIndex = 7 + end + object biSentItems: TdxNavBarItem + Caption = 'Sent Items' + Enabled = False + LargeImageIndex = 0 + SmallImageIndex = 0 + end + object biDeletedItems: TdxNavBarItem + Caption = 'Deleted Items' + LargeImageIndex = 1 + SmallImageIndex = 1 + end + object biReport: TdxNavBarItem + Caption = 'Report' + LargeImageIndex = 2 + SmallImageIndex = 2 + end + object nbCalendar: TdxNavBarItem + Caption = 'Calendar' + LargeImageIndex = 6 + SmallImageIndex = 6 + end + object nbTask: TdxNavBarItem + Caption = 'Task' + LargeImageIndex = 5 + SmallImageIndex = 4 + end + end + object lbxViewStyles: TListBox + Left = 0 + Top = 32 + Width = 189 + Height = 278 + Anchors = [akLeft, akTop, akRight, akBottom] + ItemHeight = 13 + TabOrder = 1 + OnClick = lbxViewStylesChange + OnContextPopup = lbxContextPopup + end + object cbColorScheme: TComboBox + Left = 0 + Top = 343 + Width = 189 + Height = 21 + Style = csDropDownList + Anchors = [akLeft, akRight, akBottom] + ItemHeight = 0 + TabOrder = 2 + OnChange = cbColorSchemeChange + end + end + object tsDefaultStyles: TTabSheet + Caption = 'Default styles' + ImageIndex = 5 + object lbxDefaultStyles: TListBox + Left = 0 + Top = 33 + Width = 394 + Height = 331 + Align = alClient + ItemHeight = 13 + MultiSelect = True + TabOrder = 0 + OnClick = ListBoxClick + OnContextPopup = lbxContextPopup + end + object Panel8: TPanel + Left = 0 + Top = 0 + Width = 394 + Height = 33 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object tlbDefaultStyles: TToolBar + Left = 0 + Top = 6 + Width = 150 + Height = 33 + Align = alNone + Caption = 'Commands' + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Images = ilActions + ParentShowHint = False + ShowHint = True + TabOrder = 0 + object ToolButton27: TToolButton + Left = 0 + Top = 0 + Action = actDefaultSettings + end + end + end + end + object tsCustomStyles: TTabSheet + Caption = 'Custom styles' + ImageIndex = 3 + object lbxCustomStyles: TListBox + Left = 0 + Top = 33 + Width = 394 + Height = 331 + Align = alClient + ItemHeight = 13 + MultiSelect = True + PopupMenu = pmMain + TabOrder = 0 + OnClick = ListBoxClick + OnContextPopup = lbxContextPopup + end + object Panel6: TPanel + Left = 0 + Top = 0 + Width = 394 + Height = 33 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object tlbCustomStyles: TToolBar + Left = 0 + Top = 6 + Width = 150 + Height = 33 + Align = alNone + Caption = 'Commands' + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Images = ilActions + ParentShowHint = False + ShowHint = True + TabOrder = 0 + object ToolButton15: TToolButton + Left = 0 + Top = 0 + Action = actAdd + end + object ToolButton16: TToolButton + Left = 23 + Top = 0 + Action = actDelete + end + object ToolButton17: TToolButton + Left = 46 + Top = 0 + Width = 8 + Caption = 'ToolButton6' + ImageIndex = 5 + Style = tbsSeparator + end + object ToolButton18: TToolButton + Left = 54 + Top = 0 + Action = actMoveUp + end + object ToolButton19: TToolButton + Left = 77 + Top = 0 + Action = actMoveDown + end + object ToolButton20: TToolButton + Left = 100 + Top = 0 + Width = 8 + Caption = 'ToolButton7' + ImageIndex = 5 + Style = tbsSeparator + end + object ToolButton21: TToolButton + Left = 108 + Top = 0 + Action = actSelectAll + end + end + end + end + end + object pmMain: TPopupMenu + Images = ilActions + Left = 15 + Top = 247 + object miAdd: TMenuItem + Action = actAdd + Visible = False + end + object msiAdd: TMenuItem + Caption = '&Add' + Hint = 'Add' + ImageIndex = 0 + Visible = False + end + object N2: TMenuItem + Caption = '-' + end + object miEdit: TMenuItem + Caption = '&Edit' + object miCut: TMenuItem + Action = actCut + end + object miCopy: TMenuItem + Action = actCopy + end + object miPaste: TMenuItem + Action = actPaste + end + object miDelete: TMenuItem + Action = actDelete + end + object N3: TMenuItem + Caption = '-' + end + object miSelectAll: TMenuItem + Action = actSelectAll + end + end + object N4: TMenuItem + Caption = '-' + end + object miMoveUp: TMenuItem + Action = actMoveUp + end + object miMoveDown: TMenuItem + Action = actMoveDown + end + end + object actlCommands: TActionList + Images = ilActions + Left = 96 + Top = 248 + object actAdd: TAction + Category = 'EditCollection' + Caption = '&Add' + Hint = 'Add' + ImageIndex = 0 + ShortCut = 45 + OnExecute = AddClick + end + object actMoveUp: TAction + Category = 'EditCollection' + Caption = 'Move &Up' + Hint = 'Move up' + ImageIndex = 5 + ShortCut = 16422 + OnExecute = MoveUpClick + end + object actMoveDown: TAction + Category = 'EditCollection' + Caption = 'Move &Down' + Hint = 'Move Down' + ImageIndex = 6 + ShortCut = 16424 + OnExecute = MoveDownClick + end + object actCut: TAction + Category = 'EditCollection' + Caption = 'Cu&t' + Hint = 'Cut|Cuts the selection and puts it on the Clipboard' + ImageIndex = 1 + ShortCut = 16472 + OnExecute = ActionClick + end + object actDefaultSettings: TAction + Category = 'DefaultStyles' + Caption = 'DefaultSettings' + Hint = 'Default settings' + ImageIndex = 7 + ShortCut = 16452 + OnExecute = DefaultSettingsClick + end + object actCopy: TAction + Category = 'EditCollection' + Caption = '&Copy' + Hint = 'Copy|Copies the selection and puts it on the Clipboard' + ImageIndex = 2 + ShortCut = 16451 + OnExecute = ActionClick + end + object actPaste: TAction + Category = 'EditCollection' + Caption = '&Paste' + Hint = 'Paste|Inserts Clipboard contents' + ImageIndex = 3 + ShortCut = 16470 + OnExecute = ActionClick + end + object actDelete: TAction + Category = 'EditCollection' + Caption = '&Delete' + Hint = 'Delete|Erases the selection' + ImageIndex = 4 + ShortCut = 46 + OnExecute = ActionClick + end + object actSelectAll: TAction + Category = 'EditCollection' + Caption = 'Select All' + Hint = 'Select All|Selects the entire document' + ImageIndex = 8 + ShortCut = 16449 + OnExecute = ActionClick + end + end + object ilActions: TcxImageList + FormatVersion = 1 + DesignInfo = 19398672 + ImageInfo = < + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000B0B0B210B0B0B210B0B0B210B0B + 0B210B0B0B210000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000A8261FF09805FFF077E5DFF077C5BFF067A + 5AFF0B0B0B210000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000C8665FF3CC2AAFF3CC2AAFF3BC2AAFF077D + 5CFF0B0B0B210000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000F8968FF3DC5ADFF3DC5ACFF3DC5ACFF0980 + 5FFF0B0B0B210000000000000000000000000000000000000000000000000000 + 00000B0B0B210B0B0B210B0B0B21128D6CFF40C8B0FF40C8B0FF40C7B0FF0A82 + 62FF0B0B0B210B0B0B210B0B0B210B0B0B210B0B0B2100000000000000001B9D + 7CFF1A9A79FF189776FF169573FF149270FF44CDB4FF44CCB3FF44CBB3FF0D87 + 66FF0C8463FF0A8261FF097F5EFF077E5DFF0B0B0B2100000000000000001FA0 + 7FFF4AD3BAFF4AD3B9FF49D2B9FF49D2B8FF49D0B8FF47D0B8FF47D0B7FF47CF + B6FF46CFB7FF46CFB6FF46CEB5FF09805FFF0B0B0B21000000000000000020A4 + 83FF4ED7BEFF4DD7BEFF4DD6BDFF4DD6BDFF4CD6BCFF4CD5BCFF4BD4BCFF4BD4 + BBFF4BD4BAFF49D3B9FF49D2B9FF0B8462FF0B0B0B21000000000000000022A6 + 86FF51DCC2FF51DBC2FF51DBC1FF50DAC1FF50DAC1FF50DAC0FF4FD9C0FF4FD9 + BFFF4ED8BFFF4ED8BFFF4DD7BDFF0E8866FF0B0B0B21000000000000000023A9 + 88FF23A886FF22A685FF20A383FF1EA180FF53DDC4FF53DEC4FF53DDC3FF1797 + 76FF169473FF14916FFF128E6DFF108B6AFF0000000000000000000000000000 + 000000000000000000000000000021A583FF57E1C7FF56E0C7FF56E0C6FF1A9A + 79FF0B0B0B210000000000000000000000000000000000000000000000000000 + 000000000000000000000000000023A786FF58E3C9FF58E3C9FF58E3C8FF1C9E + 7DFF0B0B0B210000000000000000000000000000000000000000000000000000 + 000000000000000000000000000024A989FF58E3C9FF58E3C9FF58E3C9FF1FA2 + 81FF0B0B0B210000000000000000000000000000000000000000000000000000 + 000000000000000000000000000025AB8AFF25AA89FF23A988FF23A786FF21A5 + 84FF000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000840000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008400000000000000000000008400000000000000000000008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000008400000000000000000000008400000000000000840000000000 + 0000000000008400000000000000000000000000000000000000000000000000 + 0000000000008400000000000000000000008400000000000000840000000000 + 0000000000008400000000000000000000000000000000000000000000000000 + 0000000000000000000084000000840000008400000000000000840000000000 + 0000000000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000000000000840000008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000000000000840000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + Mask.Data = { + 7E000000424D7E000000000000003E0000002800000010000000100000000100 + 010000000000400000000000000000000000020000000000000000000000FFFF + FF00FFFF0000F3FF0000ED9F0000ED6F0000ED6F0000F16F0000FD1F0000FC7F + 0000FEFF0000FC7F0000FD7F0000F93F0000FBBF0000FBBF0000FBBF0000FFFF + 0000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000840000008400 + 0000840000008400000084000000840000008400000000000000000000000000 + 00000000000000000000000000000000000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008400000000000000000000000000 + 00000000000000000000000000000000000084000000FFFFFF00000000000000 + 0000000000000000000000000000FFFFFF008400000000000000000000000000 + 00000000000000000000000000000000000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00840000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0084000000FFFFFF00000000000000 + 0000000000000000000000000000FFFFFF00840000000000000000000000FFFF + FF000000000000000000000000000000000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00840000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0084000000FFFFFF00000000000000 + 0000FFFFFF00840000008400000084000000840000000000000000000000FFFF + FF000000000000000000000000000000000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0084000000FFFFFF0084000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00840000008400000000000000000000000000000000000000FFFF + FF000000000000000000FFFFFF00000000008400000084000000840000008400 + 000084000000840000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF0000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + Mask.Data = { + 7E000000424D7E000000000000003E0000002800000010000000100000000100 + 010000000000400000000000000000000000020000000000000000000000FFFF + FF00FFFF0000FFFF0000FC010000FC010000FC01000000010000000100000001 + 0000000100000003000000070000000F000000FF000001FF000003FF0000FFFF + 0000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000840000008400 + 0000840000008400000084000000840000008400000084000000000000000000 + 00000000000000000000000000000000000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0084000000000000008484 + 84000084840084848400008484008484840084000000FFFFFF00840000008400 + 000084000000840000008400000084000000FFFFFF0084000000000000000084 + 84008484840000848400848484000084840084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0084000000000000008484 + 84000084840084848400008484008484840084000000FFFFFF00840000008400 + 000084000000FFFFFF0084000000840000008400000084000000000000000084 + 84008484840000848400848484000084840084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF008400000000000000000000008484 + 84000084840084848400008484008484840084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000840000000000000000000000000000000084 + 8400848484000084840084848400008484008400000084000000840000008400 + 0000840000008400000084000000000000000000000000000000000000008484 + 8400008484008484840000848400848484000084840084848400008484008484 + 8400008484008484840000848400000000000000000000000000000000000084 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000008484840084848400000000000000000000000000000000008484 + 84008484840000000000C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6 + C600000000008484840000848400000000000000000000000000000000000084 + 840084848400008484000000000000FFFF00000000000000000000FFFF000000 + 0000848484000084840084848400000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF0000FFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + Mask.Data = { + 7E000000424D7E000000000000003E0000002800000010000000100000000100 + 010000000000400000000000000000000000020000000000000000000000FFFF + FF00FFFF0000FC00000080000000000000000000000000000000000100000003 + 0000000300000003000000030000000300000003000080070000F87F0000FFFF + 0000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000A1C290141ACFF171717450000000000000000000000000000 + 00000141ACFF1717174500000000000000000000000000000000000000000000 + 0000000A1C290141ACFF2D60DFFF0141ACFF1717174500000000000000000141 + ACFF2D60DFFF0141ACFF17171745000000000000000000000000000000000000 + 00000141ACFF2D60DFFF3666E9FF2D60DFFF0141ACFF171717450141ACFF2D60 + DFFF3666E9FF2D60DFFF0141ACFF171717450000000000000000000000000000 + 0000000A1C290141ACFF2F63E1FF3869EBFF2F63E1FF0141ACFF2F63E1FF3969 + EBFF2F63E1FF0141ACFF17171745000000000000000000000000000000000000 + 000000000000000A1C290141ACFF3368E3FF3C6EEEFF3C6EEEFF3C6FEEFF3367 + E3FF0141ACFF1717174500000000000000000000000000000000000000000000 + 00000000000000000000000A1C290141ACFF4074F2FF4075F1FF4074F1FF0141 + ACFF171717450000000000000000000000000000000000000000000000000000 + 000000000000000A1C290141ACFF3871E8FF4379F4FF4379F4FF437AF4FF3970 + E8FF0141ACFF1717174500000000000000000000000000000000000000000000 + 0000000A1C290141ACFF3B73EAFF467DF6FF3B73EAFF0141ACFF3B73EAFF467D + F6FF3B73EAFF0141ACFF17171745000000000000000000000000000000000000 + 00000141ACFF3B73EAFF467DF6FF3B73EAFF0141ACFF171717450141ACFF3B73 + EAFF467DF6FF3B73EAFF0141ACFF171717450000000000000000000000000000 + 0000000A1C290141ACFF3B73EAFF0141ACFF1717174500000000000000000141 + ACFF3B73EAFF0141ACFF17171745000000000000000000000000000000000000 + 000000000000000A1C290141ACFF171717450000000000000000000000000000 + 00000141ACFF1717174500000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000B0B0B260B0B0B260B0B0B260B0B + 0B260B0B0B260000000000000000000000000000000000000000000000000000 + 000000000000000000000000000025AB8AFF24AA89FF23AA87FF22A987FF22A9 + 86FF0B0B0B260000000000000000000000000000000000000000000000000000 + 000000000000000000000000000022A988FF58E3C9FF58E3C9FF58E3C9FF1EA6 + 84FF0B0B0B260000000000000000000000000000000000000000000000000000 + 00000000000000000000000000001FA583FF55E0C6FF55E0C6FF55E0C6FF1BA0 + 7EFF0B0B0B260000000000000000000000000000000000000000000000000000 + 00000000000000000000000000001B9E7CFF51DBC2FF51DBC2FF51DBC1FF179C + 7AFF0B0B0B260000000000000000000000000000000000000000000000000000 + 0000000000000B0B0B260B0B0B26189C7AFF4CD6BCFF4CD5BCFF4CD5BCFF149B + 78FF0B0B0B260B0B0B260B0B0B260B0B0B260000000000000000000000000000 + 0000179C7AFF169C79FF159B78FF149B78FF47D0B6FF47D0B6FF47D0B6FF1199 + 76FF109975FF0F9875FF0E9874FF000000000000000000000000000000000000 + 00000023194B138D6BFF37BDA3FF42CAB1FF42CAB1FF42CAB2FF42CAB2FF42CA + B1FF37BDA3FF0C8464FF00000000000000000000000000000000000000000000 + 0000000000000023194B0F8766FF33B89FFF3EC5ADFF3EC5ADFF3EC6ADFF34B8 + 9FFF0A8160FF0000000000000000000000000000000000000000000000000000 + 000000000000000000000023194B0B8362FF32B69CFF3BC2AAFF32B69CFF087F + 5EFF000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000023194B087F5CFF32B69CFF067C5CFF0000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000023194B057A59FF000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000023194B057A59FF0E0E0E300000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000023194B087F5CFF32B69CFF067C5CFF0E0E + 0E30000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000023194B0B8362FF32B69CFF3BC2AAFF32B69CFF087F + 5EFF0E0E0E300000000000000000000000000000000000000000000000000000 + 0000000000000023194B0F8766FF33B89FFF3EC5ADFF3EC5ADFF3EC6ADFF34B8 + 9FFF0A8160FF0E0E0E3000000000000000000000000000000000000000000000 + 00000023194B138D6BFF37BDA3FF42CAB1FF42CAB1FF42CAB2FF42CAB2FF42CA + B1FF37BDA3FF0C8464FF0E0E0E30000000000000000000000000000000000000 + 0000179C7AFF169C79FF159B78FF149B78FF47D0B6FF47D0B6FF47D0B6FF1199 + 76FF109975FF0F9875FF0E9874FF0E0E0E300000000000000000000000000000 + 0000000000000000000000000000189C7AFF4CD6BCFF4CD5BCFF4CD5BCFF149B + 78FF0E0E0E300000000000000000000000000000000000000000000000000000 + 00000000000000000000000000001B9E7CFF51DBC2FF51DBC2FF51DBC1FF179C + 7AFF0E0E0E300000000000000000000000000000000000000000000000000000 + 00000000000000000000000000001FA583FF55E0C6FF55E0C6FF55E0C6FF1BA0 + 7EFF0E0E0E300000000000000000000000000000000000000000000000000000 + 000000000000000000000000000022A988FF58E3C9FF58E3C9FF58E3C9FF1EA6 + 84FF0E0E0E300000000000000000000000000000000000000000000000000000 + 000000000000000000000000000025AB8AFF24AA89FF23AA87FF22A987FF22A9 + 86FF000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000070A09280C11 + 10430141ACFF0B2E60B61D282D8A17211F82151C1B73121817620F1413510C10 + 0F41090C0C310608082104050514000000000000000000000000000000000000 + 0000001B47696794F6FF6794F6FF5B83DAE22D416C7000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000587FD3DB6794F6FF6794F6FF0C5BCDFF0141ACFF000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000314675796794F6FF6794F6FF0B45BAFF0C5BCDFF0141ACFF0000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000121A2B2D3863F1FF0141ACFF6794F6FF0B45BAFF0C5BCDFF0141 + ACFF000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000013DA2F03863F1FF3E71EFFF6794F6FF0B45BAFF0C5B + CDFF0141ACFF0000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000141ACFF3863F1FF3E71EFFF6794F6FF0B45 + BAFF0C5BCDFF0141ACFF00000000000000000000000000000000000000000000 + 00000000000000000000FFFFFFFFFFFFFFFF0141ACFF3863F1FF3E71EFFF6794 + F6FF0B45BAFF0C5BCDFF0141ACFF000000000000000000000000000000000000 + 000000000000FFFFFFFF000000FFFFFFFFFF000000000141ACFF3863F1FF3E71 + EFFF6794F6FF0B45BAFFFFFFFFFF2E7857FF0000000000000000000000000000 + 0000FFFFFFFF000000FF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFF3E71EFFFFFFFFFFF3C906FFF429664FF286443CF0000000000000000FFFF + FFFF000000FF000000FF000000FF000000FF000000FF000000FF000000FFFFFF + FFFFFFFFFFFF69B2A5FF8FCDAEFF429664FF429664FF1535236E000000000000 + 00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FFFFFF + FFFF276F65FF70BD99FF70BD99FF8FCDAEFF317B52FF00000000000000000000 + 0000000000FF000000FF000000FF000000FF000000FF000000FF000000FFFFFF + FFFF00000000286443CF70BD99FF317B52FF0000000000000000000000000000 + 000000000000000000FF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFF0000000000000000112B1D59000000000000000000000000000000000000 + 00000000000000000000000000FF000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000FF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000FF0000000000000000000000000032 + 86FFFFFFFFFF003286FFFFFFFFFF003286FFFFFFFFFF003286FFFFFFFFFF0032 + 86FFFFFFFFFF000000FF000000FF000000FF000000FF000000FF00000000FFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFE9E9E9FFE8E8E8FFE7E7E7FFE6E6E6FFE4E4 + E4FFE3E3E3FFE3E3E3FFFFFFFFFF000000FF0000000000000000000000000032 + 86FFFFFFFFFFFFFFFFFF007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FFE4E4E4FFFFFFFFFF000000FF000000000000000000000000FFFF + FFFFFFFFFFFFFFFFFFFF007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFF007756FFE6E6E6FFFFFFFFFFFFFFFFFF0000000000000000000000000032 + 86FFFFFFFFFFFFFFFFFF007756FFFFFFFFFF494949FF474747FF454545FFFFFF + FFFF007756FFE7E7E7FFFFFFFFFF003286FF000000000000000000000000FFFF + FFFFFFFFFFFFFFFFFFFF007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFF007756FFE9E9E9FFFFFFFFFFFFFFFFFF0000000000000000000000000032 + 86FFFFFFFFFFFFFFFFFF007756FFFFFFFFFF646464FF626262FF606060FFFFFF + FFFF007756FFEBEBEBFFFFFFFFFF003286FF000000000000000000000000FFFF + FFFFFFFFFFFFFFFFFFFF007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFF007756FFEDEDEDFFFFFFFFFFFFFFFFFF0000000000000000000000000032 + 86FFFFFFFFFFFFFFFFFF007756FFFFFFFFFF818181FF7E7E7EFFFFFFFFFFFFFF + FFFF007756FFFFFFFFFFFFFFFFFF003286FF000000000000000000000000FFFF + FFFFFFFFFFFFFFFFFFFF007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0077 + 56FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000032 + 86FFFFFFFFFFFFFFFFFF007756FF007756FF007756FF007756FF007756FFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFF003286FF000000000000000000000000FFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000032 + 86FFFFFFFFFF003286FFFFFFFFFF003286FFFFFFFFFF003286FFFFFFFFFF0032 + 86FFFFFFFFFF003286FFFFFFFFFF003286FF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000006060611121212351414143B1414143B1414143BFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF12121235060606110000000000000000000000000000 + 000000221848026D50EC007756FF007756FF007756FF007756FFFFFFFFFF0000 + 00FF000000FFFFFFFFFF0E2F2672121212350000000000000000000000000000 + 0000006A4DE4B7D9CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000 + 00FF000000FFFFFFFFFFFFFFFFFF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFADADADFFADADADFFFFFFFFFF000000FF000000FF0000 + 00FF000000FF000000FF000000FF1414143B00000000000000000404040C0D0D + 0D270E7156FFE2E2E2FFE2E2E2FFE2E2E2FFFFFFFFFF000000FF000000FF0000 + 00FF000000FF000000FF000000FF1E1E1E590404040C000000000D3329630D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFF0000 + 00FF000000FFFFFFFFFFFFFFFFFF0D9570FF0D332963000000000D9570FF0D95 + 70FF007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000 + 00FF000000FFFFFFFFFF007756FF0D9570FF0D9570FF000000000D9570FF0D95 + 70FF007756FFFFFFFFFF8D968BFF8D968BFF8D968BFF8D968BFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF0D9570FF0D9570FF000000000D9570FF0D95 + 70FF0E7156FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2 + E2FFE2E2E2FFE2E2E2FF0E7156FF0D9570FF0D9570FF0000000003251C3F0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF03251C3F00000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3 + C3FFC3C3C3FFFFFFFFFF007756FF121212350000000000000000000000000000 + 0000006C4EE7BDDCD3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFBDDCD3FF016D4FEB0505050F0000000000000000000000000000 + 0000001D153F005E44C9007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF005E44C9001D153F000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000006060611121212351414143B1414143B1414143BFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF12121235060606110000000000000000000000000000 + 000000221848026D50EC007756FF007756FF007756FF007756FFFFFFFFFF0000 + 00FF000000FFFFFFFFFF0E2F2672121212350000000000000000000000000000 + 0000006A4DE4B7D9CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000 + 00FF000000FFFFFFFFFFFFFFFFFF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFF434343FFFFFFFFFFFFFFFFFF000000FF000000FF0000 + 00FF000000FF000000FF000000FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FF000000FF0000 + 00FF000000FF000000FF000000FF1414143B0000000000000000000000000000 + 0000007756FF007756FF007756FF007756FFFFFFFFFFFFFFFFFFFFFFFFFF0000 + 00FF000000FFFFFFFFFFFFFFFFFF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000 + 00FF000000FFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFF434343FFFFFFFFFFA6A6A6FFA6A6A6FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FF007756FF007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF007756FF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFF434343FFFFFFFFFFA6A6A6FFA6A6A6FFA6A6A6FFA6A6 + A6FFA6A6A6FFFFFFFFFF007756FF121212350000000000000000000000000000 + 0000006C4EE7BDDCD3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFBDDCD3FF016D4FEB0505050F0000000000000000000000000000 + 0000001D153F005E44C9007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF005E44C9001D153F000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end> + end + object ilNavBarLarge: TcxImageList + Height = 32 + Width = 32 + FormatVersion = 1 + DesignInfo = 19398704 + ImageInfo = < + item + Image.Data = { + 36100000424D3610000000000000360000002800000020000000200000000100 + 2000000000000010000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000010101022222223B393939624040 + 406D4141416F4242427143434372434343734444447444444475464646774646 + 4678474747794747477A4848487B4848487C4949497D4A4A4A7E4A4A4A7F4444 + 4475292929470202020300000000000000000000000000000000000000000000 + 00000000000000000000000000000004030615604CA5128D6CF10D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF138E6DF32773 + 5EC5494C4B822828284500000000000000000000000000000000000000000000 + 0000000000000000000000000000074F3B870D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF29725EC34343437200000000000000000000000000000000000000000000 + 00000000000000000000000000000C8967EA0D9570FF51B398FFE8F5F2FFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE8F5F2FF51B398FF0D95 + 70FF118F6CF44747477A00000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFE5F4F0FFFCFCFCFFF4F4 + F4FFF2F2F2FFF1F1F1FFF1F1F1FFF0F0F0FFEFEFEFFFEFEFEFFFEEEEEEFFEEEE + EEFFEDEDEDFFECECECFFECECECFFEBEBEBFFEDEDEDFFF9F9F9FFE5F4F0FF0D95 + 70FF0D9570FF4646467800000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFFFFFFFFFF8F8F8FFF7F7 + F7FF818181FF818181FF808080FF7F7F7FFF7E7E7EFF7D7D7DFF7D7D7DFF7C7C + 7CFF7B7B7BFF7A7A7AFF7A7A7AFF797979FFEEEEEEFFEFEFEFFFFFFFFFFF0D95 + 70FF0D9570FF4444447400000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFFFFFFFFFFBFBFBFFFBFB + FBFFFAFAFAFFFAFAFAFFF9F9F9FFF8F8F8FFF8F8F8FFF7F7F7FFF6F6F6FFF6F6 + F6FFF5F5F5FFF4F4F4FFF3F3F3FFF3F3F3FFF2F2F2FFF1F1F1FFFFFFFFFF0D95 + 70FF0D9570FF4242427100000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFFFFFFFFFFEFEFEFFFEFE + FEFFFEFEFEFFFDFDFDFFFDFDFDFFFCFCFCFFFBFBFBFFFBFBFBFFFAFAFAFFFAFA + FAFFF9F9F9FFF8F8F8FFF8F8F8FFF7F7F7FFF6F6F6FFF6F6F6FFFFFFFFFF0D95 + 70FF0D9570FF4040406E00000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFFFFFFFFFFFFFFFFFFFFF + FFFF909090FF8F8F8FFF8E8E8EFF8E8E8EFF8C8C8CFF8B8B8BFF8A8A8AFF8989 + 89FF888888FF878787FF868686FF858585FFFAFAFAFFFAFAFAFFFFFFFFFF0D95 + 70FF0D9570FF3F3F3F6B00000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFE8F5F2FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFEFEFFFFFFFFFFE8F5F2FF0D95 + 70FF0D9570FF3D3D3D6800000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FF49AF93FFCCE9E1FFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFCCD5F8FF6C87EAFF234AE0FF6C87EAFFCCD5F8FFDFF1ECFF49AF93FF0D95 + 70FF0D9570FF3A3A3A6400000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF09644CFFBAD0 + CAFF6C87EAFF153FDEFFFFFFFFFF153FDEFF6C87EAFFBAD0CAFF09644CFF0D95 + 70FF0D9570FF3939396100000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF085842FFF5F8 + F8FF234AE0FFFFFFFFFFFFFFFFFFFFFFFFFF234AE0FFF5F8F8FF085842FF0D95 + 70FF0D9570FF3636365D00000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF41CBAFFF41CBAFFF41CBAFFF41CB + AEFF41CBAFFF41CBAFFF41CBAEFF41CBAFFF41CBAEFF41CBAEFF157059FFBAD0 + CAFF6C87EAFF153FDEFF153FDEFF153FDEFF6C87EAFFBAD0CAFF15705AFF41CB + AFFF0D9570FF3434345900000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF2FB798FF32BB9CFF32BB9CFF32BC + 9DFF32BC9DFF32BC9DFF32BC9DFF32BC9DFF32BB9CFF32BC9DFF1E8B71FF6596 + 89FFC6D1F4FF6C87EAFF234AE0FF6C87EAFFC6D1F4FF659689FF1E8B71FF2FB7 + 98FF0D9570FF3232325600000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF129B76FF1EA785FF23AC8BFF23AC + 8BFF23AC8BFF23AC8AFF23AC8BFF23AC8BFF23AC8BFF23AC8AFF20A182FF1274 + 5BFF659689FFBAD0CAFFF5F8F8FFBAD0CAFF659689FF12745BFF1B9D7CFF129B + 76FF0D9570FF3030305200000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0C8D + 6AFF0B7759FF09644CFF085842FF09644CFF0B7759FF0C8D6AFF0D9570FF0D95 + 70FF0D9570FF2E2E2E4F00000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FF51B398FFE8F5F2FFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE8F5F2FF51B398FF0D95 + 70FF0D9570FF2C2C2C4B00000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFE5F4F0FFFCFCFCFFF4F4 + F4FFF2F2F2FFF1F1F1FFF1F1F1FFF0F0F0FFEFEFEFFFEFEFEFFFEEEEEEFFEEEE + EEFFEDEDEDFFECECECFFECECECFFEBEBEBFFEDEDEDFFF9F9F9FFE5F4F0FF0D95 + 70FF0D9570FF2929294700000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFFFFFFFFFF8F8F8FFF7F7 + F7FFBBBBBBFFBABABAFFB8B8B8FFB7B7B7FFB6B6B6FFB4B4B4FFB3B3B3FFB1B1 + B1FFB0B0B0FFAFAFAFFFADADADFFADADADFFEEEEEEFFEFEFEFFFFFFFFFFF0D95 + 70FF0D9570FF2727274300000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFFFFFFFFFFBFBFBFFFBFB + FBFFFAFAFAFFFAFAFAFFF9F9F9FFF8F8F8FFF8F8F8FFF7F7F7FFF6F6F6FFF6F6 + F6FFF5F5F5FFF4F4F4FFF3F3F3FFF3F3F3FFF2F2F2FFF1F1F1FFFFFFFFFF0D95 + 70FF0D9570FF2525253F00000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFFFFFFFFFFEFEFEFFFEFE + FEFFFEFEFEFFFDFDFDFFFDFDFDFFFCFCFCFFFBFBFBFFFBFBFBFFFAFAFAFFFAFA + FAFFF9F9F9FFF8F8F8FFF8F8F8FFF7F7F7FFF6F6F6FFF6F6F6FFFFFFFFFF0D95 + 70FF0D9570FF2323233C00000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFFFFFFFFFFFFFFFFFFFFF + FFFFCBCBCBFFCBCBCBFFCBCBCBFFCACACAFFC8C8C8FFC8C8C8FFC7C7C7FFC5C5 + C5FFC4C4C4FFC3C3C3FFC1C1C1FFC0C0C0FFFAFAFAFFFAFAFAFFFFFFFFFF0D95 + 70FF0D9570FF2121213800000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFE8F5F2FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFEFEFFFFFFFFFFE8F5F2FF0D95 + 70FF0D9570FF1E1E1E3400000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FF49AF93FFCCE9E1FFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFCCD5F8FF6C87EAFF234AE0FF6C87EAFFCCD5F8FFDFF1ECFF49AF93FF0D95 + 70FF0D9570FF1C1C1C3000000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF09644CFFBAD0 + CAFF6C87EAFF153FDEFFFFFFFFFF153FDEFF6C87EAFFBAD0CAFF09644CFF0D95 + 70FF0D9570FF1A1A1A2D00000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF085842FFF5F8 + F8FF234AE0FFFFFFFFFFFFFFFFFFFFFFFFFF234AE0FFF5F8F8FF085842FF0D95 + 70FF0D9570FF1818182900000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF41CBAFFF41CBAFFF41CBAFFF41CB + AEFF41CBAFFF41CBAFFF41CBAEFF41CBAFFF41CBAEFF41CBAEFF157059FFBAD0 + CAFF6C87EAFF153FDEFF153FDEFF153FDEFF6C87EAFFBAD0CAFF15705AFF41CB + AFFF0D9570FF1414142200000000000000000000000000000000000000000000 + 00000000000000000000000000000C8967EA32BB9CFF32BB9CFF32BB9CFF32BC + 9DFF32BC9DFF32BC9DFF32BC9DFF32BC9DFF32BB9CFF32BC9DFF1E8B71FF6596 + 89FFC6D1F4FF6C87EAFF234AE0FF6C87EAFFC6D1F4FF659689FF1E8B71FF32BB + 9CFF0E8A68ED0B0B0B1200000000000000000000000000000000000000000000 + 0000000000000000000000000000074F3B87169F7BFF22AB8AFF23AC8BFF23AC + 8BFF23AC8BFF23AC8AFF23AC8BFF23AC8BFF23AC8BFF23AC8AFF20A182FF1274 + 5BFF659689FFBAD0CAFFF5F8F8FFBAD0CAFF659689FF12745BFF1FA081FF169F + 7BFF0B533F8E0101010100000000000000000000000000000000000000000000 + 000000000000000000000000000000040306074D3A840C8564E40D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0C8D + 6AFF0B7759FF09644CFF085842FF09644CFF0B7759FF0C8D6AFF0C8564E4074D + 3A84000403060000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36100000424D3610000000000000360000002800000020000000200000000100 + 2000000000000010000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000010101040405051506090824090C + 0C310A0E0E3A0B100F3F0A0E0E3A090C0C310609082404050515010101040000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000060D1025133547721A526FAC1F648CD12272 + A0EE2378A9FE22719EEE1E638AD11A506EAC1437487E0D17194A080B0B2E0406 + 0618000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000102020713394D7720658CCF2690C1FF28A0CFFF29AEDCFF2AB9 + E6FF2DBFEBFF2DBBE5FF2DAEDBFF2A9FCDFF278CBBFF1E5F84CB163C4F860B10 + 0F3F060908240102020700000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000061218231B5271A82790C2FE29A8D7FF2BBFECFF2BC0ECFF2DC1ECFF2EC1 + EDFF30C1EDFF31C2EDFF33C3EEFF36C4EEFF37C3EDFF32A9D5FF298AB9FE1A4F + 6DAA0F1E2456070A092801020207000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000612 + 18221D5B7CB6289BCCFF2AB7E4FF2BC0ECFF2CC0ECFF2DC1EDFF2FC2ECFF75AC + 9EFFCB8F3BFFCC8F3BFF79AD9FFF39C5EFFF3CC7EFFF3EC8EFFF3DBDE5FF3097 + C5FF1B5676B60F1E245606090824000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000010101051B53 + 72A5299CCEFF2BBBE8FF2CC1ECFF2DC1EDFF2FC1EDFF31C2EDFF32C3EEFFCC8F + 3BFFFD7E00FFFD7E00FFCD903BFF3EC7F0FF41C9F0FF44CAF1FF46CAF1FF46C5 + ECFF3399C6FF1A506DAA0B100F3F040606180000000000000000000000000000 + 000000000000000000000000000000000000000000000000000013394E722895 + C9FE2BB8E6FF2EC1EDFF24B3C3FF16A08FFF16A08FFF28B4C3FF36C4EFFFCD90 + 3BFFFD7E00FFFD7E00FFCE903BFF44C9F0FF46CBF1FF49CBF2FF4CCDF2FF4FCD + F2FF4BC2E8FF308FBDFE163C5086080B0B2E0101010400000000000000000000 + 0000020202032020203D353535653B3B3B713C3C3C733B4245852D769FE32BAD + DCFF2EC2EDFF31C2EDFF16A08FFF0D9570FF0D9570FF18A18FFF3BC6EFFF7EAF + 9FFFCE903BFFCF913CFF82B1A1FF49CBF2FF419EB5FF366269FF376369FF47A0 + B7FF57D1F5FF46B2DBFF1E6187CB0D17194A0405051500000000000000000004 + 030614604BA6118C6BF10D9570FF0D9570FF0D9470FF198C89FF2A9ACFFF30C2 + EDFF32C3EEFF34C4EEFF17A18FFF0D9570FF0D9570FF19A190FF40C8F0FF43C9 + F0FF46CBF1FF48CBF2FF4BCCF2FF4ECEF3FF376269FF2E3F3CFF2E3F3CFF3963 + 6AFF5ED3F6FF60D4F5FF3694C2FF1537497E060908240000000000000000074F + 3B870D9570FF0D9570FF0D9570FF0D9570FF0F906DFF1F8B9EFF2EA9DBFF33C3 + EEFF36C4EFFF38C5EFFF2BB6C5FF19A18FFF1AA290FF31B8C6FF45CAF1FF48CB + F2FF4ACCF2FF4ECEF3FF50CEF3FF54CFF4FF386369FF2E3F3CFF2E3F3CFF3A64 + 6AFF62D6F7FF66D6F7FF49ADD6FF1B5271AC090C0C3100000000000000000C89 + 67EA0D9570FF51B398FFE8F5F2FFFFFFFFFFEBECECFF53A1CDFF32B6E4FF38C5 + EEFF3BC6EFFF3DC7EFFF3FC8EFFF42C9F0FF45CAF1FF47CBF1FF4BCCF1FF4ECD + F2FF50CFF3FF54D0F4FF57D1F4FF59D2F4FF4DA2B8FF3A646AFF3B646AFF53A4 + B9FF68D8F7FF6CD9F8FF5CC2E6FF20668FD10A0E0E3A00000000000000000D95 + 70FF0D9570FFE5F4F0FFFFFFFFFFFFFFFFFFE3E5E5FF3996CBFF38C0EBFF2988 + F1FF133AF4FF133AF4FF2F8AF2FF48CBF2FF4ACCF2FF4DCDF3FF50CEF3FF53D0 + F3FF56D1F4FF59D2F4FF5CD3F5FF5FD5F6FF62D5F7FF66D7F6FF69D8F8FF6BD9 + F8FF6EDAF8FF72DBF9FF6CD3F3FF2377A7EE0B100F3F00000000000000000D95 + 70FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFFDDE0E0FF2B91CAFF3FC6F0FF133A + F4FF040BF5FF040BF5FF153BF4FF4DCDF3FF50CEF3FF53D0F3FF56D0F4FF59D2 + F5FF5CD3F5FF5FD4F6FF62D6F7FF65D6F7FF68D7F7FF6BD8F8FF56C0FBFF399F + FEFF399FFEFF5CC2FCFF78DEF9FF2680B5FE0A0E0E3A00000000000000000D95 + 70FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFFDADDDDFF3A98CDFF41C4EDFF153A + F4FF040BF5FF040BF5FF173BF5FF52CFF4FF56D0F4FF58D1F5FF5CD3F5FF5ED4 + F6FF61D5F6FF65D6F7FF67D7F7FF6AD9F8FF6EDAF8FF71DAF9FF399FFEFF268B + FFFF268BFFFF3BA0FEFF75D7F5FF2379ABEE090C0C3100000000000000000D95 + 70FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFFDDDFDFFF53A2CFFF3DB6E3FF348C + F4FF173BF5FF173BF5FF3A8FF4FF58D2F5FF5CD2F5FF5ED3F5FF61D5F6FF58C8 + EDFF47B0DDFF56C1E9FF69D5F6FF70DBF9FF73DCF9FF76DDFAFF3BA0FEFF268B + FFFF268BFFFF3CA0FEFF6BCAEBFF206B94D10609082400000000000000000D95 + 70FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFFE1E4E3FF88B9D3FF2C94CEFF4EC9 + F0FF54D0F4FF58D1F5FF5AD3F5FF5ED4F5FF61D5F6FF55C4EBFF3298CEFF4295 + C3FF61A1C3FF5F9FC2FF2C8DC5FF57BDE5FF78DEFBFF7BDFFBFF61C4FDFF3CA0 + FEFF3DA0FEFF65C5FEFF5AB8DFFF1C5575AC0405051500000000000000000D95 + 70FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFFEDEEEEFFCED6D7FF3A97CDFF2D96 + CFFF42B0E0FF4FC0E9FF56C7EEFF4CBAE5FF359DD3FF2B90CAFF78ABC7FFD2D7 + D7FFD3D6D6FFB5BBBAFF599DC3FF3DA1D3FF7DE0FBFF80E1FCFF82E2FCFF85E3 + FDFF87E4FEFF88E3FDFF44A2D1FF133648720101010400000000000000000D95 + 70FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFFFDFDFDFFD8DCDBFFC6D0D3FF7DB2 + CFFF54A1CDFF4A9DCCFF499CCBFF489CCBFF5DA3C9FFB9D1DDFFFEFEFEFFFFFF + FFFFFFFFFFFFCDD2D1FF4F9AC3FF44A7D8FF82E1FCFF85E3FDFF87E3FDFF88E4 + FEFF8AE5FEFF68C4E8FF226B94D1060E11250000000000000000000000000D95 + 70FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFDFDFFE8EAEAFFDADD + DDFFD4D8D7FFD2D6D5FFCFD3D3FFD6D9D9FFF1F2F2FFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFBEC9CCFF2A8FCAFF70CFF1FF86E3FDFF88E4FDFF8BE5FEFF8CE5 + FEFF7FD9F6FF43A2D2FE143B5077000000000000000000000000000000000D95 + 70FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFF9FAFAFF84ABBEFF3A9FD4FF88E4FDFF8AE4FEFF8BE5FEFF8DE6FFFF87DF + FBFF51B0DDFF1C5877AD01020207000000000000000000000000000000000D95 + 70FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFFCBCBCBFFCBCBCBFFCBCBCBFFCACA + CAFFC9C9C9FFC8C8C8FFC7C7C7FFC7C7C7FFC5C5C5FFC5C5C5FFC4C4C4FFC3C3 + C3FFE0E5E6FF5B9EC2FF67C6ECFF8BE5FEFF8DE6FEFF8FE6FEFF81DAF7FF51B2 + DEFF206085BD0612182300000000000000000000000000000000000000000D95 + 70FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFFCBCBCBFFCBCBCBFFCBCBCBFFCACA + CAFFC9C9C9FFC8C8C8FFC7C7C7FFC7C7C7FFC5C5C5FFC5C5C5FFC4C4C4FFC1C1 + C1FFB3C9D3FF2A91CCFF79D4F4FF8EE7FFFF8EE6FFFF67C4EAFF389BD0FE1E59 + 79B107131A270000000000000000000000000000000000000000000000000D95 + 70FF0D9570FFE8F5F2FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2F3 + F3FFAFB8BAFF5DA0C4FF48ABDBFF4AACDCFF399ED4FF2B78A2E4163E54820203 + 030B000000000000000000000000000000000000000000000000000000000D95 + 70FF0D9570FF49AF93FFCCE9E1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCCD5F8FF6C87EAFF234AE0FF6B86 + E7FFA8B3CEFF8AAAB1FF328CA8FF23849BFF1D8485FF2932346F000000000000 + 0000000000000000000000000000000000000000000000000000000000000D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF09644CFFBAD0CAFF6C87EAFF153FDEFFFFFFFFFF153F + DDFF6883E0FF9BB0AAFF115C49FF118A69FF0E936FFF2727274A000000000000 + 0000000000000000000000000000000000000000000000000000000000000D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF085842FFF5F8F8FF234AE0FFFFFFFFFFFFFFFFFFFFFF + FFFF234AE0FFF5F8F8FF085842FF0D9570FF0D9570FF25252546000000000000 + 0000000000000000000000000000000000000000000000000000000000000D95 + 70FF41CBAFFF41CBAFFF41CBAFFF41CBAEFF41CBAFFF41CBAFFF41CBAEFF41CB + AFFF41CBAEFF41CBAEFF157059FFBAD0CAFF6C87EAFF153FDEFF153FDEFF153F + DEFF6C87EAFFBAD0CAFF15705AFF41CBAFFF0D9570FF2020203C000000000000 + 0000000000000000000000000000000000000000000000000000000000000C89 + 67EA32BB9CFF32BB9CFF32BB9CFF32BC9DFF32BC9DFF32BC9DFF32BC9DFF32BC + 9DFF32BB9CFF32BC9DFF1E8B71FF659689FFC6D1F4FF6C87EAFF234AE0FF6C87 + EAFFC6D1F4FF659689FF1E8B71FF32BB9CFF0E8C69EF11111120000000000000 + 000000000000000000000000000000000000000000000000000000000000074F + 3B87169F7BFF22AB8AFF23AC8BFF23AC8BFF23AC8BFF23AC8AFF23AC8BFF23AC + 8BFF23AC8BFF23AC8AFF20A182FF12745BFF659689FFBAD0CAFFF5F8F8FFBAD0 + CAFF659689FF12745BFF1FA081FF169F7BFF0E56439501010101000000000000 + 0000000000000000000000000000000000000000000000000000000000000004 + 0306074D3A840C8564E40D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0C8D6AFF0B7759FF09644CFF085842FF0964 + 4CFF0B7759FF0C8D6AFF0C8564E4074D3A840004030600000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36100000424D3610000000000000360000002800000020000000200000000100 + 2000000000000010000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000080800000808000000000000000 + 000000000000000000000000000000000000C0C0C000C0C0C000000000000080 + 8000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000080800000808000000000000000 + 000000000000000000000000000000000000C0C0C000C0C0C000000000000080 + 8000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000000000000080800000808000000000000000 + 000000000000000000000000000000000000C0C0C000C0C0C000000000000080 + 8000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000080800000808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000080 + 8000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000080800000808000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000FFFFFF00C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000000000000080800000808000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000080800000000000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000000000000080 + 8000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000000000000080800000000000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000000000000080 + 8000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C00080808000808080008080 + 8000808080008080800080808000000000000080800000000000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000000000000080 + 8000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000000000000080800000000000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000000000000080 + 8000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000080800000000000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000000000000080800000000000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C00000000000C0C0 + C000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C00080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00C0C0C000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000FFFFFF00C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000FFFFFF00C0C0C000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00C0C0C000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000FFFFFF00C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000FFFFFF00C0C0C000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00C0C0C000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C00080808000808080008080 + 80008080800080808000808080008080800080808000C0C0C000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + Mask.Data = { + BE000000424DBE000000000000003E0000002800000020000000200000000100 + 010000000000800000000000000000000000020000000000000000000000FFFF + FF00FFFFFFFFFFFFFFFFFFFE000FFFFC000FF000000FF000000FF000000FF000 + 000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000 + 000FF000001FF0003FFFF0003FFFF0003FFFF0003FFFF0003FFFF0003FFFF000 + 3FFFF0003FFFF0003FFFF0003FFFF0003FFFF0003FFFF0003FFFFFFFFFFFFFFF + FFFF} + end> + end + object ilNavBarSmall: TcxImageList + FormatVersion = 1 + DesignInfo = 22544432 + ImageInfo = < + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000505050E0F0F0F2E11111133111111331111113311111133111111331111 + 11331111113311111133111111330F0F0F2E0505050E00000000000000000022 + 1848016D4FEB007756FF007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF007756FF026D50EC0C2E256D0F0F0F2E0000000000000000006A + 4DE4B7D9CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFB7D9CFFF026C4FE91111113300000000000000000077 + 56FFFFFFFFFFF7F7F7FF969696FF939393FF929292FF8F8F8FFF8D8D8DFF8B8B + 8BFF8A8A8AFFECECECFFFFFFFFFF007756FF1111113300000000000000000077 + 56FFFFFFFFFFF6F6F6FFF3F3F3FFF1F1F1FFEEEEEEFFECECECFFE9E9E9FFE8E8 + E8FFE6E6E6FFE5E5E5FFFFFFFFFF007756FF1111113300000000000000000077 + 56FFFFFFFFFFF8F8F8FF9E9E9EFF9C9C9CFF999999FF979797FF959595FF9292 + 92FF909090FFE6E6E6FFFFFFFFFF007756FF1111113300000000000000000077 + 56FFFFFFFFFFF9F9F9FFF7F7F7FFF5F5F5FFF2F2F2FFF5F5F5FFFAFAFAFFFEFE + FEFFF9F9F9FFF0F0F0FFFFFFFFFF007756FF1111113300000000000000000077 + 56FFFFFFFFFFFCFCFCFFA7A7A7FFA4A4A4FFF8F8F8FFCCD5F8FF6C87EAFF234A + E0FF6C87EAFFCCD5F8FFFFFFFFFF007756FF1111113300000000000000000077 + 56FFBDDCD3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6C87EAFF153FDEFFFFFF + FFFF153FDEFF6C87EAFFEDF5F3FF007756FF1111113300000000000000000077 + 56FF007756FF007756FF007756FF085742FFF5F8F8FF234AE0FFFFFFFFFFFFFF + FFFFFFFFFFFF234AE0FFF5F8F8FF085742FF1111113300000000000000000077 + 56FF35BB9EFF35BB9EFF35BB9EFF126D56FFBAD0CAFF6C87EAFF153FDEFF153F + DEFF153FDEFF6C87EAFFBAD0CAFF065D46FF1111113300000000000000000077 + 56FF28A98BFF2CAE90FF2CAD90FF1B846AFF659689FFC6D1F4FF6C87EAFF234A + E0FF6C87EAFFC6D1F4FF659689FF04674CFF0F0F0F2E0000000000000000006C + 4EE7047D5CFF0E8969FF128D6EFF118667FF0C6951FF659689FFBAD0CAFFF5F8 + F8FFBAD0CAFF659689FF07644BFF026A4DEE0404040D0000000000000000001D + 153F005E44C9007756FF007756FF007756FF017353FF04674CFF065D46FF0857 + 42FF065D46FF04674CFF015D44D0001D153F0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000006060611121212351414143B1414143B1414143B1414143B1414 + 143B1414143B1414143B12121235060606110000000000000000000000000000 + 000000221848026D50EC007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF026E50ED0E2F2672121212350000000000000000000000000000 + 0000006A4DE4B7D9CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFB7D9CFFF026C4FEA1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFADADADFFADADADFFADADADFFADADADFFADADADFFADAD + ADFFADADADFFFFFFFFFF007756FF1414143B00000000000000000404040C0D0D + 0D270E7156FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2 + E2FFE2E2E2FFE2E2E2FF0E7156FF1E1E1E590404040C000000000D3329630D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D332963000000000D9570FF0D95 + 70FF007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF0D9570FF0D9570FF000000000D9570FF0D95 + 70FF007756FFFFFFFFFF8D968BFF8D968BFF8D968BFF8D968BFF8D968BFF8D96 + 8BFF8D968BFFFFFFFFFF007756FF0D9570FF0D9570FF000000000D9570FF0D95 + 70FF0E7156FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2 + E2FFE2E2E2FFE2E2E2FF0E7156FF0D9570FF0D9570FF0000000003251C3F0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF03251C3F00000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3 + C3FFC3C3C3FFFFFFFFFF007756FF121212350000000000000000000000000000 + 0000006C4EE7BDDCD3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFBDDCD3FF016D4FEB0505050F0000000000000000000000000000 + 0000001D153F005E44C9007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF005E44C9001D153F000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000060606121313133A1515154015151540151515401515 + 154015151540151515401313133A060606120000000000000000000000000000 + 00000000000000221848026D50EC007756FF007756FF007756FF007756FF0077 + 56FF007756FF026E50ED0F312876131313390000000000000000000000000000 + 000000000000006A4DE4B7D9CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFB7D9CFFF036D4FEB151515400000000000000000000000000000 + 000000000000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF151515400000000000000000000000001C1C + 1C543B3B3BB0555555FF555555FF555555FF9E9E9EFFFFFFFFFFFFFFFFFF9E9E + 9EFF555555FF555555FF555555FF414141C41C1C1C5400000000000000003B3B + 3BB0B9B9B9FFEEEEEEFFEEEEEEFFEEEEEEFFEEEEEEFF555555FF555555FFEEEE + EEFFEEEEEEFFEEEEEEFFEEEEEEFFADADADFF3B3B3BB000000000000000005555 + 55FFF2F2F2FFA2A2A2FF555555FF555555FF555555FF555555FF555555FF5555 + 55FF585858FF5D5D5DFF878787FFEEEEEEFF555555FF00000000000000005555 + 55FFF5F5F5FF555555FFFFFFFFFF555555FFEAEAEAFFEDEDEDFFEFEFEFFFEAEA + EAFF555555FFFFFFFFFF555555FFEEEEEEFF555555FF00000000000000005555 + 55FFF5F5F5FFBABABAFF555555FF555555FF555555FF555555FF555555FF5555 + 55FF555555FF555555FF9C9C9CFFEEEEEEFF555555FF00000000000000003B3B + 3BB0ADADADFFF4F4F4FFEEEEEEFFEEEEEEFFEDEDEDFF555555FF555555FFEEEE + EEFFEEEEEEFFEEEEEEFFEEEEEEFFADADADFF3B3B3BB000000000000000001C1C + 1C543B3B3BB0555555FF555555FF555555FF9E9E9EFFFFFFFFFFFFFFFFFF9E9E + 9EFF555555FF555555FF555555FF414141C41C1C1C5400000000000000000000 + 000000000000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1313133A0000000000000000000000000000 + 000000000000006C4EE7BDDCD3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFBDDCD3FF026D50EC050505100000000000000000000000000000 + 000000000000001D153F005E44C9007756FF007756FF007756FF007756FF0077 + 56FF007756FF005E44C9001D153F000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000022 + 1848006C4EE7007756FF007756FF007756FF007756FF007756FF007756FF0077 + 56FF006C4EE7002218480000000000000000000000000000000000000000006A + 4DE4B7D9CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFB7D9CFFF026C4FEA1414143B121212350606061100000000000000000077 + 56FFFFFFFFFF8A8A8AFF8A8A8AFF8A8A8AFF8A8A8AFF8A8A8AFF8A8A8AFF8A8A + 8AFFFFFFFFFF007756FF15795EED14332A721212123500000000000000000077 + 56FFFFFFFFFFF8F8F8FFF5F5F5FFF3F3F3FFF0F0F0FFEEEEEEFFEBEBEBFFE9E9 + E9FFFFFFFFFF007756FFBDDCD4FF16775DEA1414143B00000000000000000077 + 56FFFFFFFFFFF9F9F9FFF7F7F7FFF5F5F5FFF2F2F2FFEFEFEFFFEDEDEDFFEBEB + EBFFFFFFFFFF007756FFFFFFFFFF168365FF1414143B00000000000000000077 + 56FFFFFFFFFF8A8A8AFF8A8A8AFF8A8A8AFF8A8A8AFF8A8A8AFF8A8A8AFF8A8A + 8AFFFFFFFFFF007756FFFFFFFFFF168365FF1414143B00000000000000000077 + 56FFBDDCD3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFBDDCD3FF007756FFFFFFFFFF168365FF1414143B00000000000000000077 + 56FF007756FF007756FF007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF007756FFFFFFFFFF168365FF1414143B00000000000000000077 + 56FF35BB9EFF35BB9EFF35BB9EFF35BB9EFF35BB9EFF35BC9EFF35BC9EFF35BC + 9EFF35BB9EFF007756FFC3DFD7FF168365FF1414143B00000000000000000077 + 56FF28A98BFF2CAE90FF2CAD90FF2CAE90FF2CAE90FF2CAE90FF2CAD90FF2CAD + 90FF28A88AFF007756FF168365FF168365FF1414143B0000000000000000006C + 4EE7047D5CFF0E8969FF128D6EFF128D6DFF128D6EFF128D6EFF128D6EFF0E89 + 69FF047D5CFF067F5EFF42CDB0FF168365FF1414143B0000000000000000001D + 153F005E44C9007756FF007756FF007756FF007756FF007756FF007756FF0077 + 56FF128D6DFF3FC5A9FF52DBC1FF168365FF1212123500000000000000000000 + 00000000000014775BE7229578FF37B498FF3DBDA1FF3DBCA1FF3DBDA1FF3DBD + A1FF3DBDA1FF37B498FF229578FF15785DEB0505050F00000000000000000000 + 0000000000000520193F116750C9168365FF168365FF168365FF168365FF1683 + 65FF168365FF168365FF116750C90520193F0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000203030C0507071E080B0A2C0A0E0D370A0E + 0D37080B0A2C0507071E0203030C000000000000000000000000000000000000 + 000000000000000000000B202B47113D5C980E4777CF074680F106437DF10B43 + 71CF103B599D0F263163090C0C31040606180000000000000000000000000000 + 00000000000010364E75136192E21983B9FF24A1D1FF2DB8E5FF30B9E4FF29A0 + CFFF1B7BB0FF0E5084E310364D8A0A0E0D380406061800000000000000000000 + 00000F364F6E1978AFF625A2D4FF30C2EDFF32C3EDFFFD7E00FFFD7E00FF40C8 + F0FF44CAF1FF33A0CEFF146095F610364D8A090C0C310203030C00000000081D + 29341B6FA1DE28A7D8FF009172FF009172FF39C6EEFFFD7E00FFFD7E00FF48CB + F1FF2E3F3CFF2E3F3CFF3EA5D0FF135386E30F2631630507071E000000001344 + 6280269ACFFF35C4EDFF009172FF009172FF41C8F0FF46CAF1FF4BCCF2FF50CE + F3FF2E3F3CFF2E3F3CFF61D4F6FF2F85B6FF103C5A9D080B0A2C000000001D67 + 94C031B1E0FF3BC6EFFF40C8EFFF44C9F1FF49CBF2FF4FCEF3FF54CFF3FF5AD1 + F5FF5FD4F6FF65D6F6FF6AD8F7FF52B1D9FF0D4775CF0A0E0D37000000002482 + B9ED3CC2ECFF040BF5FF040BF5FF4DCDF2FF52CFF3FF57D1F4FF5DD3F6FF63D5 + F6FF68D7F7FF268BFFFF268BFFFF6FD1F1FF0A4D86F10A0E0D37000000002686 + BDED44C5EEFF040BF5FF040BF5FF56D0F4FF5CD3F5FF61D5F5FF66D6F6FF4DB1 + DBFF6DD6F5FF268BFFFF268BFFFF77D5F3FF0D538CF1080B0A2C00000000206D + 9AC044BBE6FF54D0F4FF5AD2F4FF5FD3F6FF65D6F6FF4DB5E0FF227EB9FF1C76 + B2FF50AED8FF7EDFFBFF82E1FBFF65BEE1FF135280CF0507071E00000000123F + 586E2F98D1FF53C6EDFF59CAEFFF3FA7D8FF2A8EC8FF227BB0EA16507397227F + BBFF7FDFFAFF85E3FDFF89E4FDFF499FCCFF144361980203030C000000000001 + 01010E32465821719EC62274A3CC1A5A7F9F1447647E02070A0C1E6D9BCA4DAD + DAFF88E3FCFF8BE5FDFF6BC3E6FF2774A2E20B212D4700000000000000000000 + 0000000000000000000000000000000000000000000002090C0F288BC7FC75D1 + F1FF8DE5FDFF6DC7EAFF3890C2F6113A52750000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000185273903297 + CEFF40A1D4FF2B7EAEDB113A526E000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000040E + 1419071A242D081C283200000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000070A09280C11 + 10430141ACFF0B2E60B61D282D8A17211F82151C1B73121817620F1413510C10 + 0F41090C0C310608082104050514000000000000000000000000000000000000 + 0000001B47696794F6FF6794F6FF5B83DAE22D416C7000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000587FD3DB6794F6FF6794F6FF0C5BCDFF0141ACFF000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000314675796794F6FF6794F6FF0B45BAFF0C5BCDFF0141ACFF0000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000121A2B2D3863F1FF0141ACFF6794F6FF0B45BAFF0C5BCDFF0141 + ACFF000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000013DA2F03863F1FF3E71EFFF6794F6FF0B45BAFF0C5B + CDFF0141ACFF0000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000141ACFF3863F1FF3E71EFFF6794F6FF0B45 + BAFF0C5BCDFF0141ACFF00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000141ACFF3863F1FF3E71EFFF6794 + F6FF0B45BAFF0C5BCDFF0141ACFF000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000141ACFF3863F1FF3E71 + EFFF6794F6FF0B45BAFFFFFFFFFF2E7857FF0000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000141ACFF3863 + F1FF3E71EFFFFFFFFFFF3C906FFF429664FF286443CF00000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000141 + ACFFFFFFFFFF69B2A5FF8FCDAEFF429664FF429664FF1535236E000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000276F65FF70BD99FF70BD99FF8FCDAEFF317B52FF00000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000286443CF70BD99FF317B52FF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000112B1D59000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end> + end + object ilLinkDesigner: TcxImageList + FormatVersion = 1 + DesignInfo = 22544400 + ImageInfo = < + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000006060611121212351414143B1414143B1414143B1414143B1414 + 143B1414143B1414143B12121235060606110000000000000000000000000000 + 000000221848026D50EC007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF026E50ED0E2F2672121212350000000000000000000000000000 + 0000006A4DE4B7D9CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFB7D9CFFF026C4FEA1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFADADADFFADADADFFADADADFFADADADFFADADADFFADAD + ADFFADADADFFFFFFFFFF007756FF1414143B00000000000000000404040C0D0D + 0D270E7156FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2 + E2FFE2E2E2FFE2E2E2FF0E7156FF1E1E1E590404040C000000000D3329630D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D332963000000000D9570FF0D95 + 70FF007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF0D9570FF0D9570FF000000000D9570FF0D95 + 70FF007756FFFFFFFFFF8D968BFF8D968BFF8D968BFF8D968BFF8D968BFF8D96 + 8BFF8D968BFFFFFFFFFF007756FF0D9570FF0D9570FF000000000D9570FF0D95 + 70FF0E7156FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2 + E2FFE2E2E2FFE2E2E2FF0E7156FF0D9570FF0D9570FF0000000003251C3F0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF03251C3F00000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3 + C3FFC3C3C3FFFFFFFFFF007756FF121212350000000000000000000000000000 + 0000006C4EE7BDDCD3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFBDDCD3FF016D4FEB0505050F0000000000000000000000000000 + 0000001D153F005E44C9007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF005E44C9001D153F000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000505050E0F0F0F2E11111133111111331111113311111133111111331111 + 11331111113311111133111111330F0F0F2E0505050E00000000000000000022 + 1848016D4FEB007756FF007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF007756FF026D50EC0C2E256D0F0F0F2E0000000000000000006A + 4DE4B7D9CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFB7D9CFFF026C4FE91111113300000000000000000077 + 56FFFFFFFFFFF7F7F7FF969696FF939393FF929292FF8F8F8FFF8D8D8DFF8B8B + 8BFF8A8A8AFFECECECFFFFFFFFFF007756FF1111113300000000000000000077 + 56FFFFFFFFFFF6F6F6FFF3F3F3FFF1F1F1FFEEEEEEFFECECECFFE9E9E9FFE8E8 + E8FFE6E6E6FFE5E5E5FFFFFFFFFF007756FF1111113300000000000000000077 + 56FFFFFFFFFFF8F8F8FF9E9E9EFF9C9C9CFF999999FF979797FF959595FF9292 + 92FF909090FFE6E6E6FFFFFFFFFF007756FF1111113300000000000000000077 + 56FFFFFFFFFFF9F9F9FFF7F7F7FFF5F5F5FFF2F2F2FFF5F5F5FFFAFAFAFFFEFE + FEFFF9F9F9FFF0F0F0FFFFFFFFFF007756FF1111113300000000000000000077 + 56FFFFFFFFFFFCFCFCFFA7A7A7FFA4A4A4FFF8F8F8FFCCD5F8FF6C87EAFF234A + E0FF6C87EAFFCCD5F8FFFFFFFFFF007756FF1111113300000000000000000077 + 56FFBDDCD3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6C87EAFF153FDEFFFFFF + FFFF153FDEFF6C87EAFFEDF5F3FF007756FF1111113300000000000000000077 + 56FF007756FF007756FF007756FF085742FFF5F8F8FF234AE0FFFFFFFFFFFFFF + FFFFFFFFFFFF234AE0FFF5F8F8FF085742FF1111113300000000000000000077 + 56FF35BB9EFF35BB9EFF35BB9EFF126D56FFBAD0CAFF6C87EAFF153FDEFF153F + DEFF153FDEFF6C87EAFFBAD0CAFF065D46FF1111113300000000000000000077 + 56FF28A98BFF2CAE90FF2CAD90FF1B846AFF659689FFC6D1F4FF6C87EAFF234A + E0FF6C87EAFFC6D1F4FF659689FF04674CFF0F0F0F2E0000000000000000006C + 4EE7047D5CFF0E8969FF128D6EFF118667FF0C6951FF659689FFBAD0CAFFF5F8 + F8FFBAD0CAFF659689FF07644BFF026A4DEE0404040D0000000000000000001D + 153F005E44C9007756FF007756FF007756FF017353FF04674CFF065D46FF0857 + 42FF065D46FF04674CFF015D44D0001D153F0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000E0000001C00000029000000290000002900000017000000000000 + 0000000000170000002900000029000000290000001C0000000E000000001C1C + 1C543B3B3BB9555555FF555555FF555555FF313131A400000029000000293131 + 31A4555555FF555555FF555555FF3B3B3BBD1C1C1C6F0000001C000000003B3B + 3BB0B9B9B9FFEEEEEEFFEEEEEEFFEEEEEEFFEEEEEEFF555555FF555555FFEEEE + EEFFEEEEEEFFEEEEEEFFEEEEEEFFADADADFF3B3B3BBD00000029000000005555 + 55FFF2F2F2FFA2A2A2FF555555FF555555FF555555FF555555FF555555FF5555 + 55FF585858FF5D5D5DFF878787FFEEEEEEFF555555FF00000029000000005555 + 55FFF5F5F5FF555555FF00000000555555FFEAEAEAFFEDEDEDFFEFEFEFFFEAEA + EAFF555555FF00000000555555FFEEEEEEFF555555FF00000029000000005555 + 55FFF5F5F5FFBABABAFF555555FF555555FF555555FF555555FF555555FF5555 + 55FF555555FF555555FF9C9C9CFFEEEEEEFF555555FF0000001C000000003B3B + 3BB0ADADADFFF4F4F4FFEEEEEEFFEEEEEEFFEDEDEDFF555555FF555555FFEEEE + EEFFEEEEEEFFEEEEEEFFEEEEEEFFADADADFF3B3B3BB90000000E000000001C1C + 1C543B3B3BB0555555FF555555FF555555FF3131319200000000000000003131 + 3192555555FF555555FF555555FF3B3B3BB01C1C1C5400000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000FF + FF0000FFFF0000000000000000000000000000000000000000000000000000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF00000000000000000000000000000000000000000000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF000000000000000000000000000000000000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000FF + FF0000FFFF000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + Mask.Data = { + 7E000000424D7E000000000000003E0000002800000010000000100000000100 + 010000000000400000000000000000000000020000000000000000000000FFFF + FF00FFFF0000FFFF0000FFFF0000FFFF0000FF3F0000FF1F0000000F00000007 + 00000003000000070000000F0000FF1F0000FF3F0000FFFF0000FFFF0000FFFF + 0000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000FF + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF00000000 + 00000000000000000000000000000000000000000000000000000000000000FF + 0000000000000000000000000000000000000000000000FF000000FF000000FF + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FF000000FF000000FF + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FF000000FF000000FF + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FF000000FF000000FF + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000FF000000FF000000FF000000FF000000FF + 000000FF000000FF000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FF000000FF000000FF000000FF + 000000FF00000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FF000000FF000000FF + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FF00000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + Mask.Data = { + 7E000000424D7E000000000000003E0000002800000010000000100000000100 + 010000000000400000000000000000000000020000000000000000000000FFFF + FF00FFFF0000FFFF0000FFFF0000807F0000003F0000001F00003C1F0000FC1F + 0000F0070000F0070000F80F0000FC1F0000FE3F0000FF7F0000FFFF0000FFFF + 0000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000006060611121212351414143B1414143B1414143B1414143B1414 + 143B1414143B1414143B12121235060606110000000000000000000000000000 + 000000221848026D50EC007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF026E50ED0E2F2672121212350000000000000000000000000000 + 0000006A4DE4B7D9CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFB7D9CFFF026C4FEA1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFF434343FFFFFFFFFFA6A6A6FFA6A6A6FFA6A6A6FFA6A6 + A6FFA6A6A6FFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FF007756FF007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF007756FF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFF434343FFFFFFFFFFA6A6A6FFA6A6A6FFA6A6A6FFA6A6 + A6FFA6A6A6FFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FF007756FF007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF007756FF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFF434343FFFFFFFFFFA6A6A6FFA6A6A6FFA6A6A6FFA6A6 + A6FFA6A6A6FFFFFFFFFF007756FF121212350000000000000000000000000000 + 0000006C4EE7BDDCD3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFBDDCD3FF016D4FEB0505050F0000000000000000000000000000 + 0000001D153F005E44C9007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF005E44C9001D153F000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end> + end + object ilToolBar: TcxImageList + FormatVersion = 1 + DesignInfo = 17563805 + end + object ilTreeView: TcxImageList + FormatVersion = 1 + DesignInfo = 19923101 + end + object ilToolBarDisabled: TcxImageList + FormatVersion = 1 + DesignInfo = 17563837 + end + object pmGroupItemClasses: TPopupMenu + Images = ilActions + Left = 56 + Top = 248 + end + object ilPreviewSmall: TcxImageList + FormatVersion = 1 + DesignInfo = 22544464 + ImageInfo = < + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00C0A8900070584000705040006048300060483000604830006048 + 3000604830006048300060483000604830006048300060483000FF00FF00FF00 + FF00FF00FF00C0A89000FFF8F000F0E0E000F0D8C000E0D0C000E0C8B000E0C0 + B000E0B8A000E0B0A000D0A89000D0A09000D0A0800060483000FF00FF00FF00 + FF00FF00FF00C0A8A000FFF8FF00FFF8F000FFF8F000F0F0E000F0E8E000F0E0 + D000F0D8D000F0D8C000F0D0C000F0D0C000D0A8900060483000708890007078 + 800060707000C0A8A000FFFFFF00C0B0A000B0A09000B0989000B0988000A090 + 8000F0E0D000F0D8D000F0D8C000F0D0C000E0B0A0006048300070889000A0E0 + F00070D0F000C0B0A000FFFFFF00D0C0B000C0B0A000C0A8A000C0A89000B0A0 + 9000B0A09000F0E0D000F0D8D000F0D8C000E0B0A0006048300080889000B0E8 + F00090E8FF00C0B0A000FFFFFF00FFFFFF00FFF8FF00FFF8F000FFF8F000FFF0 + F000F0E8E000F0E8E000F0E0D000F0D8D000E0B8A000604830008090A000B0E8 + F000A0E8FF00D0B0A000FFFFFF00FFFFFF00FFFFFF00FFF8FF00FFF8FF00FFF8 + F000FFF0F000FFE8E0002048D0002040A000E0C0B000604830008090A000B0F0 + FF00B0F0FF00D0B8A000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFF8FF00FFF8 + FF00FFF8F000FFF0F0004060F0002048D000F0D0D000705040008098A000C0F0 + FF00B0F0F000D0B8A000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFF8FF00FFF8F000FFF8F000FFF0F000F0E8E000705840008098A000C0F0 + FF00B0F0FF00D0B8A000D0B8A000D0B8A000C0B0A000C0B0A000C0B0A000C0A8 + A000C0A8A000C0A8A000C0A89000C0A89000C0A89000C0A8900090A0A000C0F0 + FF00B0F0FF00B0F0FF00B0F0F000A0F0FF0090E8FF0090E0FF0080E0FF0070D0 + FF0060D0F00050C0F00050B8F0002098D00060708000FF00FF0090A0B000C0F0 + FF00C0F0FF00C0F0FF00C0F0FF00B0F0FF00B0F0FF00A0E8FF0090E8FF0090E0 + FF0080D8FF0070D0FF0070C8F00060B8F00060708000FF00FF0090A0B00090A0 + B00090A0B00090A0B00090A0B00090A0B00090A0A0009098A0008098A0008098 + A0008098A0008098A0008098A0008090A000FF00FF00FF00FF0090A8B000B0E8 + F000B0F0FF00B0F0FF00B0F0F00090E0F00090A0B000FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0090A8 + B00090A8B00090A8B00090A8B00090A8B000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF0073655700403020004030200040302000503830005038 + 300065574900FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00B19D9700E1CBB400FFF0D000FFFFE000FFF0D000FFE8C000FFD8 + A000F0D0B000735E4900FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00A0888000FFFFFF00FFF8FF00FFF8F000FFF0E000FFF0D000FFE8 + C000FFE0C00080685000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00B4ADA500F0F8E00070B860000060000000480000004800003090 + 4000F0D8B000B0907000917B7000FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00BDACA700E1DAD200D0F0D00020982000E0D0D000FFFFFF00B0C090001070 + 2000C0C89000E0B8A00065574900FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00A58F8700F0F0F000F0F8F00080D8800020982000FFFFFF00308030001070 + 1000FFE0C000F0D0B00060483000FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00B0989000FFFFFF00FFFFFF00FFFFFF0020C020000068000000601000C0E0 + A000FFF0D000FFE0B00070605000FF00FF00FF00FF00FF00FF00FF00FF00BDAC + A700C0B0B000FFFFFF00FFFFFF00FFFFFF00E0FFD00010B0100090D89000FFFF + F000FFF0D000FFE8C000A088700091877D00FF00FF00FF00FF00FF00FF00A58F + 8700E0D0D000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFF8 + E000FFF0E000FFF0D000D0B0900070635600FF00FF00FF00FF00FF00FF00A088 + 8000F0F0F000FFF8FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFF8 + F000FFF0E000FFF0E000F0D0B0005A4B3C00FF00FF00FF00FF00FF00FF00A58F + 8700A0888000A090800090888000A0908000A0908000A0908000A0908000A090 + 8000A0888000A08880007060500050403000FF00FF00FF00FF00FF00FF00C0B2 + A5008F7A730080706000B0A09000E0D8D000F0F0F000FFF8F000FFFFFF00FFFF + FF00F0F0F000D0C8C000E0D0D0007B6F6300FF00FF00FF00FF00FF00FF00FF00 + FF009F938700A4907D00C0C0C000F0F0F000FFF8FF00FFFFFF00FFFFFF00FFFF + FF00E0E0E000D0C0C00093816F00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00A7A1910096877800907870009080700090787000907870008070 + 60007058400070635600FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF005859 + 5800006000000060000000600000006000000060000000600000006000000060 + 00000060000000600000006000000060000000600000FF00FF001C201C00FFFF + FF008BD9A0000098000000980000009800000098000000980000009800000098 + 00000098000000980000009800000098000000600000FF00FF0098ACB3001C20 + 1C00808080008BD9A00081D7990077D592006CD38A0061D1830056CF7B004BCD + 730040CB6B0035C9630030C860000098000000600000FF00FF001C201C00FFFF + FF009FDDAF0095DBA7008BD9A00081D7990077D592006CD38A0061D183002025 + 2000202520002025200035C963000098000000600000FF00FF0098ACB3001C20 + 1C00808080009FDDAF0095DBA7008BD9A00081D7990077D592006CD38A0061D1 + 830056CF7B004BCD730040CB6B000098000000600000FF00FF001C201C00FFFF + FF00B4E1BD00A9DFB6009FDDAF0095DBA7008BD9A00081D7990077D592006CD3 + 8A0061D1830056CF7B004BCD73000098000000600000FF00FF0098ACB3001C20 + 1C0080808000B9E2C100AFE0BA00A4DEB2009ADCAB0090DAA40086D89C0077D5 + 92006CD38A0061D1830056CF7B000098000000600000FF00FF001C201C00FFFF + FF00BEE3C400BEE3C400B9E2C100AFE0BA00A4DEB2009ADCAB0090DAA40086D8 + 9C007CD6950072D48E0067D287000098000000600000FF00FF0098ACB3001C20 + 1C0080808000BEE3C400BEE3C400B9E2C100AFE0BA00A4DEB2009ADCAB0090DA + A40086D89C007CD6950072D48E000098000000600000FF00FF001C201C00FFFF + FF00BEE3C400BEE3C40000980000006000000060000000600000006000000060 + 00000060000086D89C007CD695000098000000600000FF00FF0098ACB3001C20 + 1C0080808000BEE3C4000098000030C860005FD0810088D89E00ACDFB700BEE3 + C4000060000090DAA40086D89C000098000000600000FF00FF001C201C00FFFF + FF00BEE3C400BEE3C4000098000030C8600030C860005FD0810088D89E009ADC + AB00006000009ADCAB0090DAA4000098000000600000FF00FF0098ACB3001C20 + 1C0080808000BEE3C40000980000009800000098000000980000009800000098 + 000000980000A4DEB2009ADCAB000098000000600000FF00FF001C201C00FFFF + FF00BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3 + C400BEE3C400B4E1BD00A9DFB6000098000000600000FF00FF0098ACB3001C20 + 1C0080808000BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3 + C400BEE3C400BEE3C400B4E1BD00A9DFB60000600000FF00FF00FF00FF000098 + 0000009800000098000000980000009800000098000000980000009800000098 + 00000098000000980000009800000098000000980000FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF0080A8C00050708000407090003068800030688000306080003058 + 7000305870003058700030587000305060003050600030486000FF00FF00FF00 + FF00FF00FF0080A8C000D0FFFF00A0E8FF0080E0F00080D8F00070D0F00070D0 + F00070C8F00070C8F00070C8F00060C8F00060C0F00030506000FF00FF00FF00 + FF00FF00FF0080A8C000C0E8F000B0F8FF0090F0FF0090F0FF0090F0FF0090F0 + FF0090F0FF0090F0FF0090F0FF0080E0FF0060B8E00030506000708890007078 + 80006070700080B0C00080B8D00090E0F00090F8FF0090F0FF0080E8FF0070E0 + FF0080E8FF0080E8FF0090F0FF0070D8F0004088B0004058600070889000A0E0 + F00070D0F00090B0C000B0E8F00060B8D00080E8FF0070E0F00050B0E00030A0 + D0003090C00070D0F00070D8F0004098C00060C0E0004058700080889000B0E8 + F00090E8FF0090B8D000D0FFFF00A0E8F00070C8F00050B0E00080D8F00080E8 + FF0080E8F00040A0C00050C0E00080E0F00070C8F000406070008090A000B0E8 + F000A0E8FF0090C0D000D0FFFF0090E8F00060B8E00080E0F000A0F8FF0090F0 + FF0090F0FF0090E8FF0050A8D00080E0F00070D0F000406070008090A000B0F0 + FF00B0F0FF0090C0D000C0F8FF0060C0E00090E0F000A0F8FF00A0F8FF00A0F8 + FF00A0F8FF0090F0FF0090E8FF0050A0C00060C0E000506870008098A000C0F0 + FF00B0F0F00090C8D000A0E0F000E0FFFF00E0FFFF00E0FFFF00E0FFFF00E0FF + FF00E0FFFF00D0FFFF00D0FFFF00B0F8FF004098C000507080008098A000C0F0 + FF00B0F0FF0090C8D00090C8D00090C8D00090C8D00090C0D00090C0D00090B8 + D00090B8C00080B0C00080B0C00080A8C00080A8C00080A8C00090A0A000C0F0 + FF00B0F0FF00B0F0FF00B0F0F000A0F0FF0090E8FF0090E0FF0080E0FF0070D0 + FF0060D0F00050C0F00050B8F0002098D00060708000FF00FF0090A0B000C0F0 + FF00C0F0FF00C0F0FF00C0F0FF00B0F0FF00B0F0FF00A0E8FF0090E8FF0090E0 + FF0080D8FF0070D0FF0070C8F00060B8F00060708000FF00FF0090A0B00090A0 + B00090A0B00090A0B00090A0B00090A0B00090A0A0009098A0008098A0008098 + A0008098A0008098A0008098A0008090A000FF00FF00FF00FF0090A8B000B0E8 + F000B0F0FF00B0F0FF00B0F0F00090E0F00090A0B000FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0090A8 + B00090A8B00090A8B00090A8B00090A8B000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00FF00 + FF0000436E0000436E0000436E0000436E0000436E0000436E0000436E000043 + 6E0000436E0000436E0000436E0000436E00FF00FF00FF00FF00FF00FF000090 + C80077D6EF000290C9000290C9000290C9000290C9000290C9000290C9000290 + C9000290C9000290C9000290C9000290C90000436E00FF00FF00FF00FF000090 + C800D0BCAF006947310069473100694731006947310069473100694731006947 + 31006947310069473100694731000290C90000436E00FF00FF00FF00FF000090 + C800CFBBAD00F5F0ED00F1EAE600EDE4DF00E9DED800E5D8D100E1D2CA00DDCC + C200DBC9BF00DBC9BF00694731000290C90000436E00FF00FF00FF00FF000090 + C800CEBAAC00FBF9F800F7F3F100CECCE4004F5CCF00D9D2DA00E7DBD500E3D5 + CD00DFCFC600DBC9BF00694731000290C90000436E00FF00FF00FF00FF000090 + C800CDB9AA00FFFFFF00FBF9F8005D6AD6000017C6005662D000EBE1DC00E7DB + D500E3D5CD00DFCFC600694731000290C90000436E00FF00FF00FF00FF000090 + C800CCB7A900FFFFFF00C4C9F200041BC700616DD700041AC700ACADDA00EBE1 + DC00E7DBD500E3D5CD00694731000290C90000436E00FF00FF00FF00FF000090 + C800CBB6A800FFFFFF006472DC00283BCF00F4F3F7008F97DF001B2ECA00DDD8 + E000EBE1DC00E7DBD500694731000290C90000436E00FF00FF00FF00FF000090 + C800CAB5A600FFFFFF00FFFFFF00FFFFFF00FFFFFF00FBF9F8006C78D9004150 + D000ECE5E200EBE1DC00694731000290C90000436E00FF00FF00FF00FF000090 + C800CAB5A600FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FBF9F8006C78 + D9005F6BD400EFE7E200694731000290C90000436E00FF00FF00FF00FF000090 + C800CAB5A600FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FBF9 + F8008890DE006F78D600694731000290C90000436E00FF00FF00FF00FF000090 + C800CAB5A600FFFFFF000060980000436E0000436E0000436E0000436E000043 + 6E0000436E00003A8100694731000290C90000436E00FF00FF00FF00FF000090 + C800CAB5A600CAB5A6000060980095E8F8006ED0EC0000436E006ED0EC004EBD + E3000B95CC0000436E00CAB5A6000290C90000436E00FF00FF00FF00FF000090 + C80095E8F80095E8F80095E8F8000060980095E8F80000436E0000436E006ED0 + EC0000436E0095E8F8008DE4F60086DFF30000436E00FF00FF00FF00FF00FF00 + FF000090C8000090C8000090C8000090C8000060980095E8F80095E8F8000043 + 6E000090C8000090C8000090C8000090C800FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000060980000609800006098000060 + 9800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00D5BFB1006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100D5BFB100F6F2 + EF00B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A2930069473100D5BFB1002A80 + 1E00136F0D00136F0D00136F0D00136F0D00136F0D00136F0D002A801E00E3D5 + CE00E0D1C900DFCFC600DCCBC100DBC9BF00B7A2930069473100D5BFB10059A8 + 5100448B2F003CA02C0032A4260032A526003D9E2C00438D2E00136F0D00E7DB + D500A1745C00A1745C00A1745C00A1745C00B7A2930069473100D5BFB10080BC + 790042952E0031A62600369B3200369E320032A727003E952C00136F0D00EAE0 + DA00E7DBD500E4D7D000E2D3CB00DFCFC600B7A2930069473100D5BFB100CFE8 + CD004CA741002D942F0071AB90006FA68E0030923100136F0D00EFE8E300EDE4 + DF00A1745C00A1745C00A1745C00A1745C00B7A2930069473100D5BFB100FFFF + FF00B9DDC2004F9DA000559BC8004E96C2004E8E8F00A8C2AA00F2ECE800EFE8 + E300EDE4DF00EAE0DA00E7DBD500E4D7D000B7A2930069473100D5BFB100FFFF + FF00A5CDE8005DAADD005CA9DD0057A4D900519ACC00A0BACA00F5F0ED00F2EC + E800EFE8E300EDE4DF00EAE0DA00E7DBD500B7A2930069473100D5BFB100ECF6 + FA006CB9DF0065B2E50065B1E5005FACDF0056A2D700689EBE00F7F4F100F5F0 + ED00F2ECE800EFE8E300EDE4DF00EAE0DA00B7A2930069473100D5BFB100E9F6 + FA005BB0D5005CA6D50065AFDF0062AFE20058A4D8003285A700FAF8F600F7F4 + F100F7A07300F7A07300F7A07300F7A07300B7A2930069473100D5BFB100F4FA + FC0078C0DD0056A0CD00569DCA00539CCA00448DBB003285A700FDFCFB00FAF8 + F600F7F4F100F5F0ED00F2ECE800EFE8E300B7A2930069473100D5BFB100FFFF + FF00CEEAF40062B5DE005DA7D5004B92BE003285A700C6DCE600FFFFFF00FDFC + FB00F7A07300F7A07300F7A07300F7A07300B7A2930069473100D5BFB100FFFF + FF00FFFFFF00CEEAF400A5CDE800A5CDE800CEEAF400FFFFFF00FFFFFF00FFFF + FF00FEFEFD00FCFAF900F9F6F400F6F2EF00F3EEEA0069473100D5BFB100D5BF + B100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BF + B100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00ABACAC006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100ABACAC00F9F6 + F400B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A2930069473100ABACAC00FCFB + F900F9F6F400F6F2EF00F3EDE900F0E8E400EDE4DF00EAE0D900E7DBD400E4D7 + CF00E1D2C900DECDC400DBC9BF00DBC9BF00B7A2930069473100ABACAC00FFFF + FF00808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000DBC9BF00B7A2930069473100ABACAC00FFFF + FF0080808000FFFFFF0080808000FFFFFF0080808000FFFFFF0080808000FFFF + FF0080808000FFFFFF0080808000DECDC400B7A2930069473100ABACAC00FFFF + FF00808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000E1D2C900B7A2930069473100ABACAC00FFFF + FF0080808000FFFFFF0080808000FFFFFF0080808000FFFFFF0080808000FFFF + FF0080808000FFFFFF0080808000E4D7CF00B7A2930069473100ABACAC00FFFF + FF00808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000E9DED700B7A2930069473100ABACAC00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF0080808000FFFFFF0080808000FFFF + FF0080808000FFFFFF0080808000ECE2DC00B7A2930069473100ABACAC00FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000EEE6E100B7A2930069473100ABACAC00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFD + FC00FBF9F700F7F4F100F4EFEC00F1EBE700B7A2930069473100CD762100CD76 + 2100CD762100CD762100CD762100CD762100CD762100CD762100CD762100CD76 + 2100CD762100CD762100CD762100CD762100CD76210069473100CD762100FBC3 + 9F00FBC39F00FBC39F00FBC39F00FBBE9800FAB38A00F8A77B00F79C6D00F693 + 5F00F6895300F57F4600F4753900F46B2D00F46B2D0069473100CD762100FBC3 + 9F00FBC39F00FBC39F00FBC39F00FBC39F00FBBE9800FAB38A00F8A77B00F79C + 6D00F6935F00F68E5900F5844C00F57A4000F470330069473100CD762100CD76 + 2100CD762100CD762100CD762100CD762100CD762100CD762100CD762100CD76 + 2100CD762100CD762100CD762100CD762100CD762100CD762100} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00BBA6970073533D0073533D0073533D0073533D0073533D007353 + 3D0073533D0073533D0073533D0073533D0073533D0073533D00FF00FF00FF00 + FF00FF00FF00BBA69700F8F3F200E5CBB900E5CBB900E5CBB900E5CBB900E5CB + B900E5CBB900E5CBB900E5CBB900E5CBB900E5CBB90073533D00FF00FF00FF00 + FF00FF00FF00BBA69700FBF9F900F8F4F300A58F8100957B6A00A7908200EADF + DA00E6DAD300E3D4CD00DFCFC600DBCAC000E5CBB90073533D00FF00FF00FF00 + FF00FF00FF00BBA69700FEFEFE00FCFAF9009C85760073533D007D604B00E5DB + D500EBE0DB00E7DAD400E3D5CE00DFD0C700E5CBB90073533D00859299000060 + 900000609000BBA69700FFFFFF00FEFEFE00D7CDC7007656410073533D00A38D + 7E00E6DCD600B5A19400E2D5CE00E3D6CF00E5CBB90073533D00859299008CF1 + F8000691CD00BBA69700FFFFFF00FFFFFF00FDFDFD00BFAFA500765641007353 + 3D007F624D0078594400987E6D00E3D6CF00E5CBB90073533D008592990092F4 + F8008CF1F800BBA69700FFFFFF00FFFFFF00FFFFFF00FEFEFE00DDD5D000A38D + 7F00876C590075554000886C5900DFD3CD00E5CBB90073533D008592990092F4 + F80092F4F800BBA69700FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFEFE00FDFC + FC00F6F3F100A8948600E5DCD700EFE8E400E5CBB90073533D008592990092F4 + F80092F4F800BBA69700FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFE + FE00FEFDFD00F7F4F200F7F3F100F3EEEB00F0E8E40073533D008592990092F4 + F80092F4F800BBA69700BBA69700BBA69700BBA69700BBA69700BBA69700BBA6 + 9700BBA69700BBA69700BBA69700BBA69700BBA69700BBA697008592990092F4 + F80092F4F80092F4F80092F4F80092F4F8008FF3F80089F0F80080EAF6007AE7 + F60074E3F5006EE0F5000691CD0000609000FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F8008FF3F80089F0F80083EC + F7007DE9F60077E5F5000691CD0000609000FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F8008FF3F80089F0 + F80083ECF7007DE9F60077E5F50000609000FF00FF00FF00FF00859299008592 + 9900859299008592990085929900859299008592990085929900859299008592 + 990085929900859299008592990085929900FF00FF00FF00FF008592990094F5 + F80094F5F80094F5F80094F5F80085929900FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592 + 9900859299008592990085929900FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00708890007078 + 8000607070005060600040505000303840002028300010202000101020001010 + 20001010200010102000101020001010200010102000FF00FF0070889000A0E0 + F00070D0F00050B8E00030B0E00030A8E00020A0D0002098C0002090C0002080 + B0002080B0001080B0002078A0002070900010202000FF00FF0080889000B0E8 + F00090E8FF0080E0FF0070D8FF0070D0F00060C8F00050C0F00040B8F00030A8 + F00030A8E0002098E0001090D0002078A00020283000FF00FF008090A000B0E8 + F000A0E8FF0090E8FF0080E0FF0070D8FF0070D0F00060C8F00050C0F00040B8 + F00030A8F00030A0E0002098E0001080B00030384000FF00FF008090A000B0F0 + FF00B0F0FF00A0E8FF0090E0FF0080E0FF0070D8FF0070D0F00060C8F00050C0 + F00040B0F00030A8F00020A0E0001080B00040405000FF00FF008098A000C0F0 + FF00B0F0F000A0F0FF00A0E8FF0090E0FF0080E0FF0070D8FF0060D0F00060C8 + F00050B8F00040B0F00030A8E0001088C00050506000FF00FF008098A000C0F0 + FF00B0F0FF00B0F0FF00A0E8FF0090E8FF0090E0FF0080E0FF0070D8FF0060D0 + F00060C8F00050B8F00030A8E0001090C00050607000FF00FF0090A0A000C0F0 + FF00B0F0FF00B0F0FF00B0F0F000A0F0FF0090E8FF0090E0FF0080E0FF0070D0 + FF0060D0F00050C0F00050B8F0002098D00060708000FF00FF0090A0B000C0F0 + FF00C0F0FF00C0F0FF00C0F0FF00B0F0FF00B0F0FF00A0E8FF0090E8FF0090E0 + FF0080D8FF0070D0FF0070C8F00060C0F00060708000FF00FF0090A0B00090A0 + B00090A0B00090A0B00090A0B00090A0B00090A0A0009098A0008098A0008098 + A0008098A0008098A0008098A0008098A000FF00FF00FF00FF0090A8B000B0E8 + F000B0F0FF00B0F0FF00B0F0F00090E0F00090A0B000FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0090A8 + B00090A8B00090A8B00090A8B00090A8B000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF007698 + DA003757BB001530A400344FAC007490C700FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF0080A8C000507890005088A0006090B00070A0C0004070D0002040 + D0001038C0001038D0001028A0001028A0004060A0006088A000FF00FF00FF00 + FF00FF00FF0080A8C000E0FFFF00B0E8FF00A0E8FF0070A8F0002050F0002048 + E0001038C000B0E8FF004070F0002050E0001028A0005070A000FF00FF00FF00 + FF00FF00FF0080B0C000C0E8F000C0F8FF00B0F8FF003070FF001048FF000048 + FF002048E0001038C000D0F8FF005080F0001030B0003050B000708890007078 + 80006070700080B0C00080C0D000A0E8F000B0F8FF001048FF001048E000C0F0 + FF001048FF002048E0001040C000C0E8FF001038E0001030B00070889000A0E0 + F00070D0F00090B8C000B0E8F00080C8E000A0F0FF002060FF002048E00070B0 + F000A0E0F0001048FF002048E0001038C0002040D0003058C00080889000B0E8 + F00090E8FF0090B8D000D0FFFF00B0F0FF0090E0F00060A0F0001048FF003058 + D00090B8FF00A0E0F0001048FF002048E0002048E0006080C0008090A000B0E8 + F000A0E8FF0090C0D000D0FFFF00A0E8F00080C8E000A0E0FF006090FF001048 + FF002048E0002048E0001048FF001050F0005088F00070A0B0008090A000B0F0 + FF00B0F0FF0090C0D000C0F8FF0070C8E000A0E8F000B0F8FF00A0E8FF006098 + FF003068FF002050FF004078FF006098F00090C8F0007098A0008098A000C0F0 + FF00B0F0F00090C8D000A0E0F000E0FFFF00E0FFFF00E0FFFF00E0FFFF00E0FF + FF00E0FFFF00E0FFFF00E0FFFF00C0F8FF0070B8D000708890008098A000C0F0 + FF00B0F0FF0090C8D00090C8D00090C8E00090C8D000A0C8D000A0C8D000A0C8 + D000A0C8D000A0C8D000A0C0D00090B8D00090B8C00090B0C00090A0A000C0F0 + FF00B0F0FF00B0F0FF00B0F0F000A0F0FF0090E8FF0090E0FF0080E0FF0080D8 + FF0070D0FF0060C8F00060C0F00030A0D00070788000FF00FF0090A0B000C0F0 + FF00C0F0FF00C0F0FF00C0F0FF00B0F0FF00B0F0FF00A0E8FF0090E8FF0090E0 + FF0080D8FF0080D8FF0070D0F00060C0F00060708000FF00FF0090A0B00090A0 + B00090A0B00090A0B00090A0B00090A0B00090A0A0009098A0008098A0008098 + A0008098A0008098A0008098A0008090A000FF00FF00FF00FF0090A8B000B0E8 + F000B0F0FF00B0F0FF00B0F0F00090E0F00090A0B000FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0090A8 + B00090A8B00090A8B00090A8B00090A8B000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00C0989000C090 + 9000C0888000B0808000B0787000A0707000A0686000A0686000A0686000A068 + 6000A0686000A0686000A0606000A0606000A0606000A0606000C0989000F0D8 + C000FFFFF000FFF0D000FFE0B000FFD8A000FFC89000FFC89000FFC09000FFB8 + 8000FFB88000FFA87000FFA87000F0A06000D0805000A0606000D0989000D0A8 + A000E0D0C000FFFFF000FFF8E000FFF0D000FFE8D000FFE8C000FFE0C000FFD8 + B000FFD8B000FFD0A000FFC89000D0987000C0706000A0686000D0A09000FFFF + F000D0B0A000E0D0C000FFF8F000FFF8F000FFF8F000FFF0E000FFF0E000FFE8 + C000FFE0C000FFD8B000E0A88000C0807000FFB87000A0686000D0A0A000FFFF + FF00FFFFF000D0A09000E0C8C000FFF8F000FFF8F000FFF8F000FFF0E000FFF0 + D000F0E0C000D0A88000C0787000FFD8A000FFD09000A0687000D0A0A000FFFF + FF00F0D8D000E0C0B000E0C0B000E0C0B000E0C8C000E0C8B000E0C0B000E0C0 + B000D0B0A000D0A8A000D0989000E0B09000FFD8A000A0707000D0A8A000F0D0 + C000E0B8B000F0F0F000F0F0F000E0B8A000E0B8A000D0B0A000D0B0A000D0A8 + A000D0A8A000F0E8E000F0E0D000C0989000E0A88000A0787000D0A8A000C0B8 + B000F0F0F000FFF8F000F0E0E000F0F0F000F0F0F000F0F0F000F0F0E000F0F0 + E000F0F0E000F0E0D000FFF0E000F0D8D000A0909000A0787000D0A8A000A0D8 + F000FFFFF000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFF000FFF8 + F000FFF8F000FFF0F000F0F0F000E0E0E00050B0E000A0787000D0A8A000A0E8 + FF00B0E0FF00B0E0FF00A0D8FF0080D0FF0060D0FF0060C8FF0060C8FF0050C8 + FF0050C0F00040B8F00040B0F00030B0F00020B0FF00C0989000FF00FF00D0B8 + C000C0F0FF00D0F8FF00D0F0FF00D0E8FF00B0E8FF00A0E0FF0080D0FF0070C8 + FF0050C8FF0070C8FF0060C8FF0040B8FF00A0B0C000FF00FF00FF00FF00FF00 + FF00D0B8B000D0E0E000D0F8FF00D0F0FF00D0E8FF00B0E8FF00A0E0FF0080D0 + FF0070C8FF0050C8FF0090C0E000B0A8B000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00D6B5A300D0B8B000E0F8FF00E0F8FF00D0F0FF00B0E0FF0090E0 + FF0070D0FF00C0B0B000C4A89A00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00E1BBAA00D0B0A000E0E0E000D0F8FF00C0F0FF00B0C8 + D000D0B8B000DDB39D00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00D9B2A500D0B0A000D0B0A000D0AF + 9C00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF006C8C + 9C00293643002936430029364300293643002936430029364300293643002936 + 43002936430029364300293643002936430029364300293643006C8C9C00335D + 7100335D7100335D7100335D7100335D7100335D7100335D7100335D7100335D + 7100335D71005CCAE10077DEEB0085E9F00098F8F800293643006C8C9C0090F2 + F50053A3B70053A3B70053A3B70053A3B70053A3B70053A3B70053A3B70053A3 + B70053A3B700335D71005CCAE10077DEEB0085E9F000293643006C8C9C0098F8 + F80090F2F50088EBF20080E5EF0078DFEB0070D9E80068D3E50061CEE30059C8 + E00053A3B7005CCAE100335D71005CCAE10077DEEB00293643006C8C9C0098F8 + F80098F8F80090F2F50088EBF20080E5EF0078DFEB0070D9E80068D3E50061CE + E30053A3B70098F8F8005CCAE100335D71005CCAE100293643006C8C9C0098F8 + F80098F8F80098F8F80090F2F50088EBF20080E5EF0078DFEB0070D9E80068D3 + E50053A3B70053A3B70053A3B70053A3B700335D7100293643006C8C9C0098F8 + F80098F8F80098F8F80098F8F80094F5F70088EBF20080E5EF0078DFEB0070D9 + E80068D3E50061CEE30059C8E00053A3B700335D7100293643006C8C9C0098F8 + F80098F8F80098F8F80098F8F80098F8F80094F5F7008CEFF40084E8F0007CE2 + ED0074DCEA0068D3E50061CEE30053A3B700335D7100293643006C8C9C0098F8 + F80098F8F80098F8F80098F8F80098F8F80098F8F80094F5F7008CEFF40084E8 + F0007CE2ED0074DCEA006CD6E70053A3B700335D7100293643006C8C9C0098F8 + F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80094F5F7008CEF + F40084E8F0007CE2ED0074DCEA0053A3B700335D7100293643006C8C9C0098F8 + F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80094F5 + F7008CEFF40084E8F0007CE2ED0074DCEA00335D71006C8C9C006C8C9C006C8C + 9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C + 9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C9C00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end> + end + object ilPreviewLarge: TcxImageList + Height = 28 + Width = 28 + FormatVersion = 1 + DesignInfo = 19398736 + ImageInfo = < + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00BBA6 + 970073533D0073533D0073533D0073533D0073533D0073533D0073533D007353 + 3D0073533D0073533D0073533D0073533D0073533D0073533D0073533D007353 + 3D0073533D0073533D00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00BBA69700F7F3F100BBA69700BBA69700BBA6 + 9700BBA69700BBA69700BBA69700BBA69700BBA69700BBA69700BBA69700BBA6 + 9700BBA69700BBA69700BBA69700BBA69700BBA6970073533D00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00BBA6 + 9700FAF7F500F7F3F200F5F0ED00ECE4E000E7DDD800E5DAD400E3D7D100E7DC + D600E8DCD600E5D8D200E3D5CD00E0D1C900DECEC500DCCAC000DBC9BF00DBC9 + BF00BBA6970073533D00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00BBA69700FCFAFA00FAF7F600F7F4F200AA96 + 8900866956008569560085685500C4B3A800EAE0DA00E8DCD600E6D8D200E3D5 + CE00E0D2CA00DECEC500DCCAC100DBC9BF00BBA6970073533D00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00BBA6 + 9700FEFDFD00FCFAFA00FAF7F600AC998C0073533D0073533D0073533D00AF9B + 8E00ECE3DE00EAE0DB00E8DCD600E6D8D200E3D5CE00E0D2CA00DECEC500DCCB + C100BBA6970073533D00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00BBA69700FEFEFE00FEFEFE00FCFBFB00D0C4 + BC0074543E0073533D0073533D00896E5B00E8DFDA00EDE4DF00EAE0DB00E6DB + D500E6D9D200E3D6CE00E1D2CA00DECEC500BBA6970073533D00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00BBA6 + 9700FFFFFF00FFFFFF00FEFEFE00F7F4F3008A705D0073533D0073533D007353 + 3D00B3A09300EBE2DE00E8DED800B29E9100E1D4CD00E6D9D300E3D6CF00E1D2 + CB00BBA6970073533D00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00BBA69700FFFFFF00FFFFFF00FFFFFF00FEFE + FE00D6CCC6007A5C470073533D0073533D0075564000A38D7E00C3B3A8008467 + 53009D847400E2D6CF00E6D9D300E3D6CF00BBA6970073533D00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00BBA6 + 9700FFFFFF00FFFFFF00FFFFFF00FFFFFF00FDFCFC00C8BBB3007C5E4A007353 + 3D0073533D0073533D0075553F0073543E0073533E009E867600E2D6CF00E6DA + D300BBA6970073533D0085929900006090000060900000609000006090000060 + 9000006090000060900000609000BBA69700FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FDFDFD00DBD3CE00957D6C007656410073533D0073533D007353 + 3D0073533D007B5D4800CFC0B700E9DED800BBA6970073533D00859299008BF0 + F7000691CD000691CD000691CD000691CD000691CD000691CD000691CD00BBA6 + 9700FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFEFE00FBF9 + F900DED6D000BDADA300A69183007A5B47007A5C4700C7B8AE00EDE4E000EBE1 + DC00BBA6970073533D00859299008BF0F70087EEF70083ECF7007FEAF6007CE8 + F60078E6F50074E4F50071E2F500BBA69700FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FEFEFE00FDFCFC00FBF9F800F2EEEC009279 + 6800C8BAB100F2EBE800F0E8E400EDE5E000BBA6970073533D00859299008EF2 + F8008BF0F70087EEF70083ECF7007FEAF6007CE8F60078E6F50074E4F500BBA6 + 9700FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FEFEFE00FEFDFD00F8F5F400DDD4CF00F5F1EF00F4EFEC00F2ECE800F0E8 + E400BBA6970073533D008592990092F4F8008EF2F8008BF0F70087EEF70083EC + F7007FEAF6007CE8F60078E6F500BBA69700FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFEFE00FEFDFD00FCF9 + F900F9F6F500F7F3F100F5EFED00F3ECE900F0E9E50073533D008592990092F4 + F80092F4F8008EF2F8008BF0F70087EEF70083ECF7007FEAF6007CE8F600BBA6 + 9700BBA69700BBA69700BBA69700BBA69700BBA69700BBA69700BBA69700BBA6 + 9700BBA69700BBA69700BBA69700BBA69700BBA69700BBA69700BBA69700BBA6 + 9700BBA69700BBA697008592990092F4F80092F4F80092F4F8008EF2F8008BF0 + F70087EEF70083ECF7007FEAF6007CE8F60078E6F50074E4F50071E2F5006DE0 + F5006ADDF40066DBF40062D9F4005ED7F4005AD5F30056D3F3000691CD000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80090F3F8008DF1F80089EFF70083ECF7007FEA + F6007CE8F60078E6F50074E4F50071E2F5006DE0F5006ADDF40066DBF40062D9 + F4005ED7F4005AD5F3000691CD0000609000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80090F3F8008DF1F80089EFF70085EDF70081EBF6007EE9F6007AE7F60076E5 + F50072E3F5006FE1F5006CDFF50068DCF40064DAF40060D8F4000691CD000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80090F3F8008DF1F80089EF + F70085EDF70081EBF6007EE9F6007AE7F60076E5F50072E3F5006FE1F5006CDF + F50068DCF40064DAF4000691CD0000609000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80092F4F80090F3F8008DF1F80089EFF70085EDF70081EBF6007EE9 + F6007AE7F60076E5F50072E3F5006FE1F5006CDFF50068DCF4000691CD000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80090F3 + F8008DF1F80089EFF70085EDF70081EBF6007EE9F6007AE7F60076E5F50072E3 + F5006FE1F5006CDFF5000691CD0000609000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80092F4F80092F4F80092F4F80090F3F8008DF1F80089EFF70085ED + F70081EBF6007EE9F6007AE7F60076E5F50072E3F5006FE1F5000691CD000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80090F3F8008DF1F80089EFF70085EDF70081EBF6007EE9F6007AE7 + F60076E5F50072E3F5000691CD0000609000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F8008EF2 + F8008BF0F70087EEF70083ECF7007EE9F6007AE7F60072E3F50072E3F5000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00859299008592 + 9900859299008592990085929900859299008592990085929900859299008592 + 9900859299008592990085929900859299008592990085929900859299008592 + 990085929900859299008592990085929900FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990095F6F80092F4F80091F2F80090F1F8008EF0 + F8008DEFF80090F1F80079CADE0085929900FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990084DB + E80094F5F80092F4F80091F2F80090F1F80090F1F80079CADE0085929900FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00859299008592990085929900859299008592 + 99008592990085929900FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF009C9288004D3D2F004D3D2F004D3D2F004D3D2F004D3D2F004D3D + 2F004D3D2F004D3D2F004D3D2F004D3D2F0073605100FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0096867800ECD9C800ECD7 + C500EBD5C200EBD4BF00EBD2BB00EBD0B800EACEB500EACDB200EACBAE00E9C9 + AB00AD9178008D796A00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00A49B9100BEAD9F00F9E8D900F9E6D600F9E4D200F8E2CF00F8E0CB00F8DE + C700F7DCC400F7DBC000F7D8BC00F7D7B900DCBDA0006D605500FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF0096867800DCCEC100FAEADD00F9E8 + D900F9E6D600F9E4D200DBCDB700CCBAA800D9C3AF00EDD3BC00F7DAC000F7D9 + BD00F3D3B6004E3E2F00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF008D7B6E00F0E3D900FAECE100EEE0D300BDB2A600E5D4C4008CA67D003366 + 3200255A2500656A5200D1BBA500F5D9BF00F7D9BD00A18872008D796A00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00AEA09300E5E1D600769B77003A85 + 480026813800A5A09100468B4B00116F1F000E6518002459240034592C008F84 + 7100F2D6BC00D9BDA4006D605500FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00A49B + 9100CBC0B70088C7940023A24400209A3E001E9138006D7F67004E9855001477 + 250016702200376B3600125F16001A53190076715D00EBCFB50052413200FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF0096867800DCDED3003EB5600026AC4C0023A4 + 46002A9D4600789E7800EDE5D50068A56A00B4B19D00B0BB9A000E6618000B5D + 1200155315009C917C00937D6A008D796A00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008D7B + 6E00D6EAD90036B65D0041AF600089C59400D2DDC800F5EBE100FAEDE100F2E7 + D900EEE2D10085AB7D00127020000F671A00145E1900ADA48D00C4AD98006658 + 4C00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00A49B9100BBB0A700BAE6C6002FC65F00418E5800ABAB + A500D6D3CB00FBF1EA00FAEFE600FAEDE200F8EADD00539A5A00157927001270 + 200026682A00D8C6B300E9D2BC0057453600FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0096867800D9D2 + CC00A1E1B40030C8600030C45F0039A75A00ABB0A600FBF3ED00FBF1E900FBEF + E600F5EADE0090BC8D00459650001A7C2B0054805100EEDAC800F7E0CC00836F + 5E008D796A00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008D7B6E00F0EBE900BCE9C80033C8620030C8600033C2 + 6000C0BDBA00E6E1DD00F7EFE900FBF1EA00F4E9E000D6CEC30098A38C00B2AD + 9E00E0D9C400F8E5D400F9E4D100BAA593006D605500FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00A99B9000FBF7 + F600F8F8F50063CD840035C7630061C37F00C2CEC30056AA6E009A999400F8F0 + EA00ACCAAB0037984E0022943D003C714400BEB1A600F9E7D800F9E5D400E8D3 + C1004E3E2F00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00A49B9100C8BEB700FDFAF900F8F8F500D8ECDC00F6F6F300DAE6 + DB0048C26E002FC75F00389E5700989C9400CCDFC9002AA84C00229F42002B8F + 42009DAE9300F4E5D700F9E8D900F7E0CC00736051008D796A00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0096867800E7E1DD00FDFA + F900FDFAF900FDFAF900FDFAF900B4E5C10031C8600030C860002FC75F00399C + 570070A37C0028B04F0024A74800508F5D00F9EDE200FAECE000F9EADC00F9E8 + D900A79586006D605500FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF008D7B6E00FAF7F600FDFAF900FDFAF900FDFAF900FDFAF900FDFA + F900B4E6C2003DCA6A0030C760004DB96F004BB56B0039BB5F005EBD7600CBD7 + C400FBF0E700FAEEE400FAECE000FAEADD00D7C6B8004E3E2F00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00ACA39900B4A99F00FDFAF900FDFA + F900FDFAF900FDFAF900FDFAF900FDFAF900FCF9F800DDF1E100C3E8CC00CEE5 + D300D5ECDA00EBF1E800F9F4F000FBF4EE00FBF2EB00FBF0E700FAEEE400FAEC + E000F1E1D40065544600A49B9100FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF0096897B00C3BAB300E7E1DE00E7E1DE00E7E1DE00E7E1DE00E7E1DE00E7E1 + DE00E7E1DE00E7E1DE00E7E1DE00E7E1DE00E7E1DE00E7E1DE00E6E0DD00E6DF + DA00E6DDD600E5DCD400E4DAD000E4D9CE00E2D5C9006D5C4F00918A8400FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00948376008D7B6E008F7D6E008F7D + 6E008F7D6E00907E7100A89C9100A89B8F00A89B8F00ADA09700AB9D9300A99B + 9000A7998D00A5978A00A3958700A19184009F8F82009D8C7F00988679009382 + 75008E7E70005E4B3D00A49B9100FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00A49B9100918173008D796A008D796A008D796A009F908500F9F8F800F5F2 + F200EFEBE900E9E3E100E3DCD800DDD4D000D7CDC700D1C6BF00CBBEB600C4B7 + AE00BEAEA500AE9E9300A59387009E8C8000928073005F4E4000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00A49B91008C796A008D79 + 6A008D796A00AFA39800FBFAFA00FAF9F900F4F2F100EFEBE900E8E3E000E3DC + D800DCD4D000D7CDC800D1C6BF00CBBFB700C5B7AE00B8A99F00AC9A8F00A593 + 87007A6A5D00918A8400FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00948376008C786A008D796A00BFB6AE00FCFBFB00FCFB + FB00FBF9F900F6F3F300F0EBEA00E9E4E200E3DDD900DDD5D100D7CEC800D2C7 + C000CBBFB700C2B4AC00B3A39800A593880066574B00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00A49B91009483 + 76008C786900CDC5C000FCFBFB00FCFBFB00FCFBFB00FBF9F900F5F3F300F0EC + EB00E9E4E200E4DEDA00DDD6D100D8CFC900D2C7C000CBBFB700BAA99F007E6E + 6200A49B9100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00A49B91008A786A00D9D4CF00FCFBFB00FCFB + FB00FCFBFB00FCFBFB00FBF9F900F7F4F400F0ECEB00EAE5E300E4DEDA00DED6 + D200D8CFC900D3C8C100AB9C92006D605500FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00A49B910094837600BFB4AC00BFB4AC00BFB4AC00BFB4AC00BFB4AC00BFB4 + AC00BFB4AC00BFB4AC00BFB4AC00BFB4AC00BFB4AC00BFB4AC0078685C00A49B + 9100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00A49B9100948376009483 + 7600948376009483760094837600948376009483760094837600948376009483 + 76009483760094837600A49B9100FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF002025200020252000006000000060 + 0000006000000060000000600000006000000060000000600000006000000060 + 0000006000000060000000600000006000000060000000600000006000000060 + 0000006000000060000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF007070700020252000009800000098000000980000009800000098 + 0000009800000098000000980000009800000098000000980000009800000098 + 000000980000009800000098000000980000009800000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF0091939500202520002025200089D89E0083D7 + 9A007DD6960077D5920072D48E006CD3890066D2850060D181005AD07D0054CE + 79004ECD740048CC700042CB6C003CCA680036C9640030C8600030C8600030C8 + 600030C860000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF00707070002025200089D89E0083D79A007DD6960077D5920072D4 + 8E006CD3890066D2850060D181005AD07D0054CE79004ECD740048CC700042CB + 6C003CCA680036C9640030C8600030C8600030C860000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF0091939500202520002025200095DBA6008FD9 + A20089D89E0083D79A007DD6960077D5920072D48E006CD3890066D2850060D1 + 81005AD07D0054CE790020252000202520002025200020252000202520002025 + 200030C860000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF00707070002025200095DBA6008FD9A20089D89E0083D79A007DD6 + 960077D5920072D48E006CD3890066D2850060D181005AD07D0054CE79004ECD + 740048CC700042CB6C003CCA680036C9640030C860000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF00919395002025200020252000A4DEB1009EDD + AD0098DBA90092DAA40089D89E0083D79A007DD6960077D5920072D48E006CD3 + 890066D2850060D181005AD07D0054CE79004ECD740048CC700042CB6C003CCA + 680036C964000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF007070700020252000A4DEB1009EDDAD0098DBA90092DAA4008CD9 + A00086D89C0080D698007AD5940075D590006FD48C0069D2870063D183005DD0 + 7F0057CF7B0051CE770048CC700042CB6C003CCA68000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF00919395002025200020252000B0E0B900AADF + B500A4DEB1009EDDAD0098DBA90092DAA4008CD9A00086D89C0080D698007AD5 + 940075D590006FD48C0069D2870063D183005DD07F0057CF7B0051CE77004BCD + 720045CC6E000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF007070700020252000B0E0B900AADFB500A4DEB1009EDDAD0098DB + A90092DAA4008CD9A00086D89C0080D698007AD5940075D590006FD48C0069D2 + 870063D183005DD07F0057CF7B0051CE77004BCD72000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF00919395002025200020252000BCE3C200B6E2 + BE00B0E0B900AADFB500A4DEB1009EDDAD0098DBA90092DAA4008CD9A00086D8 + 9C0080D698007AD5940075D590006FD48C0069D2870063D183005DD07F0057CF + 7B0051CE77000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF007070700020252000BCE3C200B6E2BE00B0E0B900AADFB500A4DE + B1009EDDAD0098DBA90092DAA4008CD9A00086D89C0080D698007AD5940075D5 + 90006FD48C0069D2870063D183005DD07F0057CF7B000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF00919395002025200020252000BEE3C400BEE3 + C400BCE3C200B6E2BE00B0E0B900AADFB500A4DEB1009EDDAD0098DBA90092DA + A4008CD9A00086D89C0080D698007AD5940075D590006FD48C0069D2870063D1 + 83005DD07F000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF007070700020252000BEE3C400BEE3C400BEE3C400B9E2C000B3E1 + BB00ADE0B700A7DEB300A1DDAF009BDCAB0095DBA6008FD9A20086D89C0080D6 + 98007AD5940075D590006FD48C0069D2870063D183000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF00919395002025200020252000BEE3C400BEE3 + C400BEE3C400BEE3C400BEE3C400B9E2C000B3E1BB00ADE0B700A7DEB300A1DD + AF009BDCAB0095DBA6008FD9A20089D89E0083D79A007DD6960077D5920072D4 + 8E006CD389000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF007070700020252000BEE3C400BEE3C400BEE3C400BEE3C400BEE3 + C400B9E2C000B3E1BB00ADE0B700A7DEB300A1DDAF009BDCAB0095DBA6008FD9 + A20089D89E0083D79A007DD6960077D5920072D48E000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF00919395002025200020252000BEE3C400BEE3 + C400BEE3C4000098000000600000006000000060000000600000006000000060 + 000000600000006000000060000000600000006000000060000083D79A007DD6 + 960077D592000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF007070700020252000BEE3C400BEE3C4000098000038C966004ACC + 72005CD07F006ED38B007CD6960088D89E0094DAA600A0DDAF00ACDFB700B8E1 + BF00BEE3C4000060000089D89E0083D79A007DD696000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF00919395002025200020252000BEE3C400BEE3 + C400BEE3C4000098000030C8600038C966004ACC72005CD07F006ED38B007CD6 + 960088D89E0094DAA600A0DDAF00ACDFB700B8E1BF00006000008FD9A20089D8 + 9E0083D79A000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF007070700020252000BEE3C400BEE3C4000098000030C8600030C8 + 600038C966004ACC72005CD07F006ED38B007CD6960088D89E0094DAA600A0DD + AF00ACDFB7000060000095DBA6008FD9A20089D89E000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF00919395002025200020252000BEE3C400BEE3 + C400BEE3C4000098000030C8600030C8600030C8600038C966004ACC72005CD0 + 7F006ED38B007CD6960088D89E0094DAA600A0DDAF00006000009EDDAD0098DB + A90092DAA4000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF007070700020252000BEE3C400BEE3C4000098000030C8600030C8 + 600030C8600030C8600038C966004ACC72005CD07F006ED38B007CD6960088D8 + 9E0094DAA60000600000A4DEB1009EDDAD0098DBA9000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF00919395002025200020252000BEE3C400BEE3 + C400BEE3C4000098000000980000009800000098000000980000009800000098 + 0000069A06000C9C0C00129F120018A119001EA31F0000980000AADFB500A4DE + B1009EDDAD000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF007070700020252000BEE3C400BEE3C400BEE3C400BEE3C400BEE3 + C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3 + C400BCE3C200B6E2BE00B0E0B900AADFB500A4DEB1000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF00919395002025200000980000BEE3C400BEE3 + C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3 + C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BCE3C200B6E2BE00B0E0 + B900AADFB500A4DEB10000600000FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF000098000000980000009800000098000000980000009800000098 + 0000009800000098000000980000009800000098000000980000009800000098 + 000000980000009800000098000000980000009800000098000000980000FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00C6B0A30069473100694731006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 31006947310069473100694731006947310069473100FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00CFB9AB00FAF8F700B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 930069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00CFB9AB00FDFBFB00FAF8F700F8F4F300F6F1EF00F3EEEB00F1EA + E700EFE7E300EDE4DF00EBE0DB00E8DDD700E6D9D300E4D6CF00E1D3CB00DFCF + C700DDCCC300DBC9BF00DBC9BF00B7A2930069473100FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00CFB9AB00FFFFFF00FDFB + FB00FAF8F700F8F4F300F6F1EF00F3EEEB00F1EAE700EFE7E300EDE4DF00EBE0 + DB00E8DDD700E6D9D300E4D6CF00E1D3CB00DFCFC700DDCCC300DBC9BF00B7A2 + 930069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00CFB9AB00FFFFFF00FFFFFF00FDFBFB00FAF8F700F3AB5900F3AB + 5900F3AB5900F3AB5900F3AB5900F3AB5900F3AB5900F3AB5900E6D9D300E4D6 + CF00E1D3CB00DFCFC700DDCCC300B7A2930069473100FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00CFB9AB00FFFFFF00FFFF + FF00FFFFFF00FDFBFB00FAF8F700F8F4F300F6F1EF00F3EEEB00F1EAE700EFE7 + E300EDE4DF00EBE0DB00E8DDD700E6D9D300E4D6CF00E1D3CB00DFCFC700B7A2 + 930069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00CFB9AB00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FDFBFB00FAF8 + F700F8F4F300F6F1EF00F3EEEB00F1EAE700EFE7E300EDE4DF00EBE0DB00E8DD + D700E6D9D300E4D6CF00E1D3CB00B7A2930069473100FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00CFB9AB00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00F3AB5900F3AB5900F3AB5900F3AB5900F3AB5900F3AB + 5900F3AB5900F3AB5900EDE4DF00EBE0DB00E8DDD700E6D9D300E4D6CF00B7A2 + 930069473100FF00FF0085929900006090000060900000609000006090000060 + 900000609000CFB9AB00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FEFDFD00FCFAF900F9F6F500F7F3F100F5EFED00F2ECE900F0E9E500EEE5 + E100ECE2DD00EADFD900E7DBD500B7A2930069473100FF00FF00859299008BF0 + F7000691CD000691CD000691CD000691CD000691CD00CFB9AB00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFDFD00FCFAF900F9F6 + F500F7F3F100F5EFED00F2ECE900316ADC00316ADC00316ADC00EADFD900B7A2 + 930069473100FF00FF00859299008BF0F70087EEF70083ECF7007FEAF6007CE8 + F60078E6F500CFB9AB00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FEFDFD00FCFAF900F9F6F500F7F3F100F5EFED00314A + 800060A2FA00316ADC00ECE2DD00B7A2930069473100FF00FF00859299008EF2 + F8008BF0F70087EEF70083ECF7007FEAF6007CE8F600CFB9AB00FFFFFF004878 + F8004878F8004878F800FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFD + FD00FCFAF900F9F6F500F7F3F100396EE30060A2FA00316ADC00EEE5E100B7A2 + 930069473100FF00FF008592990092F4F8008EF2F8008BF0F70087EEF70083EC + F7007FEAF600CFB9AB00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFDFD00FCFAF900F9F6F500F7F3 + F100F5EFED00F2ECE900F0E9E500EEE5E10069473100FF00FF008592990092F4 + F80092F4F8008EF2F8008BF0F70087EEF70083ECF700CFB9AB00CFB9AB00CFB9 + AB00CFB9AB00CFB9AB00CFB9AB00CFB9AB00CFB9AB00CFB9AB00CFB9AB00CFB9 + AB00CFB9AB00CFB9AB00CFB9AB00CFB9AB00CFB9AB00CFB9AB00CFB9AB00CFB9 + AB00CFB9AB00FF00FF008592990092F4F80092F4F80092F4F8008EF2F8008BF0 + F70087EEF70083ECF7007FEAF6007CE8F60078E6F50074E4F50071E2F5006DE0 + F5006ADDF40066DBF40062D9F4005ED7F4005AD5F30056D3F3000691CD000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80090F3F8008DF1F80089EFF70083ECF7007FEA + F6007CE8F60078E6F50074E4F50071E2F5006DE0F5006ADDF40066DBF40062D9 + F4005ED7F4005AD5F3000691CD0000609000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80090F3F8008DF1F80089EFF70085EDF70081EBF6007EE9F6007AE7F60076E5 + F50072E3F5006FE1F5006CDFF50068DCF40064DAF40060D8F4000691CD000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80090F3F8008DF1F80089EF + F70085EDF70081EBF6007EE9F6007AE7F60076E5F50072E3F5006FE1F5006CDF + F50068DCF40064DAF4000691CD0000609000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80092F4F80090F3F8008DF1F80089EFF70085EDF70081EBF6007EE9 + F6007AE7F60076E5F50072E3F5006FE1F5006CDFF50068DCF4000691CD000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80090F3 + F8008DF1F80089EFF70085EDF70081EBF6007EE9F6007AE7F60076E5F50072E3 + F5006FE1F5006CDFF5000691CD0000609000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80092F4F80092F4F80092F4F80090F3F8008DF1F80089EFF70085ED + F70081EBF6007EE9F6007AE7F60076E5F50072E3F5006FE1F5000691CD000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80090F3F8008DF1F80089EFF70085EDF70081EBF6007EE9F6007AE7 + F60076E5F50072E3F5000691CD0000609000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F8008EF2 + F8008BF0F70087EEF70083ECF7007EE9F6007AE7F60072E3F50072E3F5000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00859299008592 + 9900859299008592990085929900859299008592990085929900859299008592 + 9900859299008592990085929900859299008592990085929900859299008592 + 990085929900859299008592990085929900FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990095F6F80092F4F80091F2F80090F1F8008EF0 + F8008DEFF80090F1F80079CADE0085929900FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990084DB + E80094F5F80092F4F80091F2F80090F1F80090F1F80079CADE0085929900FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00859299008592990085929900859299008592 + 99008592990085929900FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00C7B2A3006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 31006947310069473100694731006947310069473100FF00FF00FF00FF00C7B2 + A300DBC9BF00B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 930069473100FF00FF00FF00FF00C7B2A300B7A29300DFD0C700DFD0C700DFD0 + C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0 + C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0 + C700DFD0C700DFD0C700DFD0C700CE99970069473100FF00FF00FF00FF00C7B2 + A300DBC9BF00B7A29300E4D7CF00E4D7CF00E4D7CF00E4D7CF00E4D7CF00E4D7 + CF00E4D7CF00E4D7CF00E4D7CF00E4D7CF00E4D7CF00E4D7CF00E4D7CF00E4D7 + CF00E4D7CF00E4D7CF00E4D7CF00E4D7CF00E4D7CF00E4D7CF00B7A29300B7A2 + 930069473100FF00FF00FF00FF00C7B2A300DECEC500DECEC500B7A29300E9DE + D700E9DED700E9DED700E9DED700E9DED700E9DED700E9DED700E9DED700E9DE + D700E9DED700E9DED700E9DED700E9DED700E9DED700E9DED700E9DED700E9DE + D700E9DED700B7A29300DECEC500B7A2930069473100FF00FF00FF00FF00C7B2 + A300E2D4CC00E2D4CC00E2D4CC00B7A29300EDE4DF00EDE4DF00EDE4DF00EDE4 + DF00EDE4DF00EDE4DF00EDE4DF00EDE4DF00EDE4DF00EDE4DF00EDE4DF00EDE4 + DF00EDE4DF00EDE4DF00EDE4DF00EDE4DF00B7A29300E2D4CC00E2D4CC00B7A2 + 930069473100FF00FF00FF00FF00C7B2A300E6D9D200E6D9D200E6D9D200E6D9 + D200B7A29300F0E9E500F0E9E500F0E9E500F0E9E500F0E9E500F0E9E500F0E9 + E500F0E9E500F0E9E500F0E9E500F0E9E500F0E9E500F0E9E500F0E9E500B7A2 + 9300E6D9D200E6D9D200E6D9D200B7A2930069473100FF00FF00FF00FF00C7B2 + A300EADFD900EADFD900EADFD900EADFD900EADFD900B7A29300F4EFEC00F4EF + EC00F4EFEC00F4EFEC00F4EFEC00F4EFEC00F4EFEC00F4EFEC00F4EFEC00F4EF + EC00F4EFEC00F4EFEC00B7A29300EADFD900EADFD900EADFD900EADFD900B7A2 + 930069473100FF00FF00FF00FF00C7B2A300EDE4DF00EDE4DF00EDE4DF00EDE4 + DF00EDE4DF00EDE4DF00B7A29300F8F4F200F8F4F200F8F4F200F8F4F200F8F4 + F200F8F4F200F8F4F200F8F4F200F8F4F200F8F4F200B7A29300EDE4DF00EDE4 + DF00EDE4DF00EDE4DF00EDE4DF00B7A2930069473100FF00FF00FF00FF00C7B2 + A300F0E8E400F0E8E400F0E8E400F0E8E400F0E8E400F0E8E400B7A29300B7A2 + 9300FCFAF900FCFAF900FCFAF900FCFAF900FCFAF900FCFAF900FCFAF900FCFA + F900B7A29300B7A29300F0E8E400F0E8E400F0E8E400F0E8E400F0E8E400B7A2 + 930069473100FF00FF00FF00FF00C7B2A300F3EDE900F3EDE900F3EDE900F3ED + E900F3EDE900B7A29300DDC5C200DDC5C200B7A29300DDC5C200FFFFFF00FFFF + FF00FFFFFF00FFFFFF00DDC5C200B7A29300DDC5C200DDC5C200B7A29300F3ED + E900F3EDE900F3EDE900F3EDE900B7A2930069473100FF00FF00FF00FF00C7B2 + A300F6F1EF00F6F1EF00F6F1EF00F6F1EF00B7A29300DDC5C200FBF9F700F7F4 + F100DDC5C200C7B2A300B7A29300B7A29300B7A29300B7A29300C7B2A300DDC5 + C200DCCBC100DBC9BF00DDC5C200B7A29300F6F1EF00F6F1EF00F6F1EF00B7A2 + 930069473100FF00FF00FF00FF00C7B2A300F9F6F400F9F6F400F9F6F400B7A2 + 9300DDC5C200FFFFFF00FEFDFC00FBF9F700F7F4F100EEE0E000EEE0E000EEE0 + E000EEE0E000EEE0E000EEE0E000E4D7CF00E1D2C900DECDC400DBC9BF00DDC5 + C200B7A29300F9F6F400F9F6F400B7A2930069473100FF00FF00FF00FF00C7B2 + A300FCFBFA00FCFBFA00B7A29300C8B3A400FFFFFF00FFFFFF00B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300DECDC400DBC9BF00D2C0B300B7A29300FCFBFA00B7A2 + 930069473100FF00FF00FF00FF00C7B2A300FFFFFF00B8A39400DDC5C200C8B3 + A400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FCFBF900F9F6F400F6F2 + EF00F3EDE900F0E8E400EDE4DF00EAE0D900E7DBD400E4D7CF00E1D2C900DECD + C400D2BFB200DDC5C200B7A29300FFFFFF0069473100FF00FF00FF00FF00C7B2 + A300B7A29300DDC5C20027A5E900C8B3A400FFFFFF00FFFFFF00B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300E4D7CF00E1D2C900D1BEB10027A5E900DDC5C200B7A2 + 930069473100FF00FF00FF00FF00C7B2A300DDC5C20027A5E90027A5E900C8B3 + A400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FCFB + F900F9F6F400F6F2EF00F3EDE900F0E8E400EDE4DF00EAE0D900E7DBD400E4D7 + CF00D1BEB10027A5E90027A5E900B7A2930069473100FF00FF00FF00FF00FF00 + FF00C7B2A300DDC5C20047B6FF00C8B3A400FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FCFBF900F9F6F400F6F2EF00F3ED + E900F0E8E400EDE4DF00EAE0D900E7DBD400D0BDB00047B6FF00B7A293006947 + 3100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00C7B2A300DDC5C200C8B3 + A400C8B3A400C8B3A400C8B3A400C8B3A400C8B3A400C9B4A500C9B5A600CAB6 + A700CBB6A800CBB7A900CCB8AA00CCB9AB00CDB9AB00CEBAAC00CEBBAD00CFBB + AE00CFBCAF00BCA7980069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00C7B2A300DDC5C200DBF3FA00DBF3FA00DBF3FA00D4F0 + FA00C7EBFB00B9E5FB00ACDFFB009ED9FC0091D4FC0082CEFD0073C8FD0064C2 + FE0055BCFE0047B6FF0047B6FF0047B6FF00BBA6970073533E00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00C7B2 + A300EEE0E000DBF3FA00DBF3FA00DBF3FA00D4F0FA00C7EBFB00B9E5FB00B2E2 + FB00A5DCFC0097D6FC0089D1FC007BCBFD006CC5FD005DBFFE004EB9FE00B7A2 + 930069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00C7B2A300EEE0E000DBF3FA00DBF3 + FA00DBF3FA00DBF3FA00CDEDFA00C0E8FB00B2E2FB00A5DCFC0097D6FC0089D1 + FC007BCBFD006CC5FD00B7A2930069473100FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00C7B2A300EEE0E000DBF3FA00DBF3FA00DBF3FA00DBF3FA00CDED + FA00C0E8FB00B2E2FB00A5DCFC0097D6FC0089D1FC00B7A2930069473100FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00C7B2A300EEE0 + E000DBF3FA00DBF3FA00DBF3FA00DBF3FA00CDEDFA00C0E8FB00B2E2FB00A5DC + FC00B7A2930069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00C7B2A300EEE0E000EEE0E000EEE0E000EEE0 + E000EEE0E000EEE0E000DDC5C200B7A2930069473100FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00C7B2A300C7B2A300C7B2A300C7B2A300C7B2A300C7B2A300C7B2A300C7B2 + A300FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF000090C800006098000060 + 9800006098000060980000609800006098000060980000609800006098000060 + 9800006098000060980000609800006098000060980000609800006098000060 + 9800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C80070D1EC000290C9000290C9000290C9000290C9000290C9000290 + C9000290C9000290C9000290C9000290C9000290C9000290C9000290C9000290 + C9000290C9000290C9000290C9000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C80075D4EE0070D1EC006CCF + EB0067CCE90062C9E8005EC7E70059C4E50054C1E4004FBEE2004BBBE10046B8 + DF0041B5DE003DB2DD0038AFDB0036AEDB0036AEDB0036AEDB0036AEDB000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C8007AD7EF00CAB5A600694731006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 31006947310069473100694731000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C8007EDAF000CAB5A600F0E9 + E500B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300694731000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C80083DDF200CAB5A600F2ECE900F0E9E500EEE5E100ECE2DD00EADF + D900E7DBD500E5D8D100E3D4CD00E0D1C900DECEC500DDCCC300DBC9BF00DBC9 + BF00DBC9BF00B7A29300694731000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C80088DFF300CAB5A600F5EF + ED00F2ECE900F0E9E500EEE5E100ECE2DD00EADFD900E7DBD500E6D9D300E4D6 + CF00E1D3CB00DFCFC700DDCCC300DBC9BF00DBC9BF00B7A29300694731000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C8008CE2F500CAB5A600F7F3F100F5EFED00F2ECE900F0E9E5006971 + D000C1BDD800EBE0DB00E8DDD700E6D9D300E4D6CF00E1D3CB00DFCFC700DDCC + C300DBC9BF00B7A29300694731000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C80093E6F700CAB5A600F9F6 + F500F8F4F300F6F1EF00DDDBE800041AC7000418C200C1BDD800EBE0DB00E8DD + D700E6D9D300E4D6CF00E1D3CB00DFCFC700DDCCC300B7A29300694731000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C80095E8F800CAB5A600FDFBFB00FAF8F700F8F4F3007B86DF000019 + CA000017C6004B57CC00EDE4DF00EBE0DB00E8DDD700E6D9D300E4D6CF00E1D3 + CB00DFCFC700B7A29300694731000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C80095E8F800CAB5A600FFFF + FF00FDFBFB00DCDEF300102AD4002339D3007A84DB000017C600B4B3DB00EDE4 + DF00EBE0DB00E8DDD700E6D9D300E4D6CF00E1D3CB00B7A29300694731000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C80095E8F800CAB5A600FFFFFF00FFFFFF006B7DE8000826D700AFB5 + E900F3EEEF002E41D0002638CB00E8E1E200EDE4DF00EBE0DB00E8DDD700E6D9 + D300E4D6CF00B7A29300694731000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C80095E8F800CAB5A600FFFF + FF00FFFFFF00FFFFFF00FDFBFB00FAF8F700F8F4F300CDCDE9000B23CC006E77 + D500EFE7E300EDE4DF00EBE0DB00E8DDD700E6D9D300B7A29300694731000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C80095E8F800CAB5A600FFFFFF00FFFFFF00FFFFFF00FFFFFF00FDFB + FB00FAF8F700F8F4F300AAAFE500041DCC00B2B3DF00EFE7E300EDE4DF00EBE0 + DB00E8DDD700B7A29300694731000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C80095E8F800CAB5A600FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FDFBFB00FAF8F700F8F4F3008B94 + E200132BCE00D4D0E300F0E9E500EEE5E100ECE2DD00B7A29300694731000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C80095E8F800CAB5A600FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FDFBFB00FAF8F700F9F6F5008B95E3002A3FD200E8E3E800F0E9 + E500EEE5E100B7A29300694731000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C80095E8F800CAB5A600FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFDFD00FCFA + F900F9F6F5009BA3E5004153D500E8E3E800F0E9E500B7A29300694731000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C80095E8F800CAB5A600FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FEFDFD00FCFAF900F9F6F500C6C8EA006874 + DA00F2ECE900B7A29300694731000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C80095E8F800CAB5A600FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FEFDFD00FCFAF900F9F6F500F7F3F100F5EFED00B7A29300694731000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C80095E8F800CAB5A600FFFFFF00FFFFFF00B7A29300B7A29300B7A2 + 9300B7A29300B8A39400B9A49500BAA59700BBA69800BCA89A00BDA99B00BFAA + 9C00F7F3F100B7A29300694731000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C80095E8F800CAB5A600FFFF + FF00B7A293000060900000609000006090000060900000609000006090000060 + 900000609000006090000060900000609000BFAA9C0069473100694731000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C80095E8F800CAB5A600CAB5A600006098004EBDE3004EBDE3004EBD + E3004EBDE3004EBDE3006ED0EC006ED0EC004EBDE3004EBDE3004EBDE3000290 + C90000436E00CAB5A600CAB5A6000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C80095E8F80095E8F80095E8 + F80095E8F800006098006ED0EC006ED0EC006ED0EC0000436E000290C9006ED0 + EC006ED0EC006ED0EC000290C90000436E0088DFF30083DDF2007EDAF0000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C80080C4E80095E8F80095E8F80095E8F80095E8F800006098006ED0 + EC006ED0EC0000436E0000436E0095E8F8006ED0EC000290C90000436E0091E5 + F6008CE2F50088DFF30083DDF2005DB4E1000290C900FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF000090C8000090C8000190 + C8000190C8000190C8000060980095E8F80095E8F80095E8F80095E8F80095E8 + F80095E8F8000290C90000436E000290C9000290C9000290C9000290C9000290 + C900FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF000060 + 9800006098000060980000609800006098000060980000609800FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00D0BAAC006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 31006947310069473100694731006947310069473100FF00FF00FF00FF00D0BA + AC00FAF8F600B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 930069473100FF00FF00FF00FF00D0BAAC00FCFAF900FAF8F600F8F5F300F6F2 + F000F5F0ED00F3EDE900F1EAE600EFE8E300EDE5E000ECE2DE00EBE0DB00E9DD + D700E7DAD400E5D7D100E3D5CD00E1D2CA00DFCFC700DDCDC300DBCAC000DBC9 + BF00DBC9BF00DBC9BF00DBC9BF00B7A2930069473100FF00FF00FF00FF00D0BA + AC00FDFDFC00B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300DBC9BF00B7A2 + 930069473100FF00FF00FF00FF00D0BAAC00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300DBC9BF00B7A2930069473100FF00FF00FF00FF00D0BA + AC00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300DBC9BF00B7A2 + 930069473100FF00FF00FF00FF00D0BAAC00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300DBCAC000B7A2930069473100FF00FF00FF00FF00D0BA + AC00FFFFFF00B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300C8600000C8600000C860 + 0000C8600000C8600000B7A29300B7A29300B7A29300B7A29300DECEC500B7A2 + 930069473100FF00FF00FF00FF00D0BAAC00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00C8600000FDEDE300FDEDE300FDEDE300C8600000FFFFFF00FFFF + FF00FFFFFF00B7A29300E0D1C800B7A2930069473100FF00FF00FF00FF00D0BA + AC00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00C8600000F8C8C800FDED + E300FDEDE300C8600000FFFFFF00FFFFFF00FFFFFF00B7A29300E2D3CC00B7A2 + 930069473100FF00FF00FF00FF00D0BAAC00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00C860000090300000F8C8C800FDEDE300C8600000FFFFFF00FFFF + FF00FFFFFF00B7A29300E4D6CF00B7A2930069473100FF00FF00FF00FF00D0BA + AC00FFFFFF00B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300C8600000C8600000C860 + 0000C8600000C8600000B7A29300B7A29300B7A29300B7A29300E6D9D200B7A2 + 930069473100FF00FF00FF00FF00D0BAAC00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300E8DBD600B7A2930069473100FF00FF00FF00FF00D0BA + AC00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300EBE0DB00B7A2 + 930069473100FF00FF00FF00FF00D0BAAC00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300ECE2DE00B7A2930069473100FF00FF00FF00FF00D0BA + AC00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300EDE5E000B7A2 + 930069473100FF00FF00FF00FF00D0BAAC00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FDFDFC00FCFAF900FAF8F600F8F5F300F6F2F000F5F0 + ED00F3EDE900F1EAE600EFE8E300B7A2930069473100FF00FF00FF00FF00CD76 + 2100CD762100CD762100CD762100CD762100CD762100CD762100CD762100CD76 + 2100CD762100CD762100CD762100CD762100CD762100CD762100CD762100CD76 + 2100CD762100CD762100CD762100CD762100CD762100CD762100CD762100CD76 + 210069473100FF00FF00FF00FF00CD762100FBC39F00FBC39F00FBC39F00FBC3 + 9F00FBC39F00FBC39F00FBBE9700FAB89000FAB28800F9AC8000F8A67900F8A0 + 7100F79A6900F7956200F78F5B00F6895300F6834B00F57D4400F5773C00F471 + 3400F46B2D00F46B2D00F46B2D00F46B2D0069473100FF00FF00FF00FF00CD76 + 2100FBC39F00FBC39F00FBC39F0069473100FBC39F00FBC39F00FBC39F00FBBE + 9700FAB89000FAB28800F9AC8000F8A67900F8A07100F79A6900F7956200F78F + 5B00F6895300F6834B00F57D440069473100F4713400F46B2D00F46B2D00F46B + 2D0069473100FF00FF00FF00FF00CD762100FBC39F00FBC39F00A36F5A00A36F + 5A0069473100FBC39F00FBC39F00FBC39F00FBBE9700FAB89000FAB28800F9AC + 8000F8A67900F8A07100F79A6900F7956200F78F5B00F6895300A36F5A00A36F + 5A0069473100F4713400F46B2D00F46B2D0069473100FF00FF00FF00FF00CD76 + 2100FBC39F00FBC39F00A36F5A00C898980069473100FBC39F00FBC39F00FBC3 + 9F00FBC39F00FBBE9700FAB89000FAB28800F9AC8000F8A67900F8A07100F79A + 6900F7956200F78F5B00A36F5A00C898980069473100F5773C00F4713400F46B + 2D0069473100FF00FF00FF00FF00CD762100FBC39F00FBC39F00A36F5A00E4B4 + B40069473100FBC39F00FBC39F00FBC39F00FBC39F00FBC39F00FBC19B00FBBB + 9400FAB58C00F9AF8400F8A67900F8A07100F79A6900F7956200A36F5A00E4B4 + B40069473100F57D4400F5773C00F471340069473100FF00FF00FF00FF00CD76 + 2100CD762100CD762100A36F5A00F5C5C50069473100CD762100CD762100CD76 + 2100CD762100CD762100CD762100CD762100CD762100CD762100CD762100CD76 + 2100CD762100CD762100A36F5A00F5C5C50069473100CD762100CD762100CD76 + 2100CD762100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00A36F5A00FFFF + FF0069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00A36F5A00FFFF + FF0069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00A36F5A00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00A36F5A00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00D5BFB1006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 31006947310069473100694731006947310069473100FF00FF00FF00FF00D5BF + B100F7F3F100B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 930069473100FF00FF00FF00FF00D5BFB100F9F6F400F7F3F100F5F1EE00F4EE + EB00F2ECE800F1EAE600EFE7E300EDE5E000ECE3DD00EBE1DB00E9DED800E7DC + D500E6D9D200E4D7CF00E3D5CD00E1D2CA00DFD0C700DECDC400DCCBC100DBC9 + BF00DBC9BF00DBC9BF00DBC9BF00B7A2930069473100FF00FF00FF00FF00D5BF + B100FBF9F800E5EDE200B0CCAC002F872800146D0E00136F0D0013700D001370 + 0D00136F0D00146D0E00156B0E001E821B00A4BB9700D4D1C200E4D7CF00E3D5 + CD00E1D2CA00DFD0C700DECDC400DCCBC100DBC9BF00DBC9BF00DBC9BF00B7A2 + 930069473100FF00FF00FF00FF00D5BFB100FDFCFB0059AA53002E771E004487 + 2F0044933000409A2E003D9F2D003D9F2D003F9C2D0044942F00488C3200307D + 20001A73110047964100E6D9D200A1745C00A1745C00A1745C00A1745C00A174 + 5C00A1745C00A1745C00DBC9BF00B7A2930069473100FF00FF00FF00FF00D5BF + B100FEFEFD00158B0E004B863300449330003D9F2D0038A82A0033AB270032AA + 260037AA2A003DA02C0042962F004A8932002C7C1D0000680000E7DCD500E6D9 + D200E4D7CF00E3D5CD00E1D2CA00DFD0C700DECDC400DCCBC100DBC9BF00B7A2 + 930069473100FF00FF00FF00FF00D5BFB100FFFFFF00148D0E00488C3100409B + 2E0038A82A0030B126001B911700188D15002BAD220037AA2A003E9E2D00468F + 30002A7F1C00006E0000EADFD900A1745C00A1745C00A1745C00A1745C00A174 + 5C00A1745C00A1745C00DCCBC100B7A2930069473100FF00FF00FF00FF00D5BF + B100FFFFFF009ECB9800459030003E9E2D0032AC27001E961A00589D58006EAD + 6D001D93190030AE26003BA22C003B9029000E730B0084AF7C00EBE2DC00EADF + D900E8DDD600E7DBD400E5D8D100E3D6CE00E2D3CB00E0D1C800DFCFC600B7A2 + 930069473100FF00FF00FF00FF00D5BFB100FFFFFF00D0EAD0003FA13600399E + 2A00269D1E002D802E00A5D0B400BCD5CC00428A4600289820003BA12C003587 + 290098B59000EEE6E100EDE4DF00A1745C00A1745C00A1745C00A1745C00A174 + 5C00A1745C00A1745C00E0D1C800B7A2930069473100FF00FF00FF00FF00D5BF + B100FFFFFF00FFFFFF00CAE8CA002E9F2800298F3300548E94005A96BE005792 + BC004386900039824D001677110098BA9200F1EBE700F0E8E400EEE6E100EDE4 + DF00EBE2DC00EADFD900E8DDD600E7DBD400E5D8D100E3D6CE00E2D3CB00B7A2 + 930069473100FF00FF00FF00FF00D5BFB100FFFFFF00FFFFFF00FFFFFF00C5E0 + E20055A1C80055A1D50053A1D600509ED4004C9ACF004C8DB3009AB1B300EFEC + E900F3EDEA00F1EBE700F0E8E400EEE6E100EDE4DF00EBE2DC00EADFD900E8DD + D600E7DBD400E5D8D100E3D6CE00B7A2930069473100FF00FF00FF00FF00D5BF + B100FFFFFF00FFFFFF00FFFFFF0077B3DA005AA7DC005BA8DC005AA7DB0057A4 + D90053A1D6004D9BD000598AAC00E6E6E600F5F1EE00F4EEEB00F2ECE800F1EA + E600EFE7E300EDE4DF00EBE2DC00EADFD900E8DDD600E7DBD400E5D8D100B7A2 + 930069473100FF00FF00FF00FF00D5BFB100FFFFFF00FFFFFF00B4D6EB0063AB + DC0060ADE10061AEE20060ADE1005DAADE0059A6DB0053A1D6004C93C400ABBA + C200F7F3F100F5F1EE00F4EEEB00F2ECE800F1EAE600EFE7E300EDE5E000ECE3 + DD00EBE1DB00E9DED800E7DBD400B7A2930069473100FF00FF00FF00FF00D5BF + B100FFFFFF00FFFFFF0072C5DF0054ADDF0068B4E70068B5E80066B3E60062AF + E2005EABDF0058A5DA00519ED4006B98AE00F9F6F400F7F3F100F5F1EE00F4EE + EB00F2ECE800F1EAE600EFE7E300EDE5E000ECE3DD00EBE1DB00E9DED800B7A2 + 930069473100FF00FF00FF00FF00D5BFB100FFFFFF00FFFFFF0072C5DF0051A8 + D80069B3E4006EBAEC006BB7EA0066B3E50060ADE1005AA7DB0054A2D7003386 + A800FAF8F600F9F6F400F7F3F100F5F1EE00F4EEEB00F2ECE800F1EAE600EFE7 + E300EDE5E000ECE3DD00EBE1DB00B7A2930069473100FF00FF00FF00FF00D5BF + B100FFFFFF00FFFFFF0072C5DF003F93C0004E94C000549BC70061A9D80064AF + E10061AEE10058A4D8004E98CA003285A700FCFAF900FAF8F600F9F6F400F7F3 + F100F5F1EE00F4EEEB00F2ECE800F1EAE600EFE7E300EDE5E000ECE3DD00B7A2 + 930069473100FF00FF00FF00FF00D5BFB100FFFFFF00FFFFFF00BFE5F1003BA1 + CD0059A1CE00579ECC005197C3005198C500549DCC00478EBB002A7AA40092BE + D000FEFEFD00FCFAF900FAF8F600F7A07300F7A07300F7A07300F7A07300F7A0 + 7300F7A07300F7A07300EDE5E000B7A2930069473100FF00FF00FF00FF00D5BF + B100FFFFFF00FFFFFF00FFFFFF004BB5D8005EAEDD0064ADDB005AA1CF004F95 + C200458AB6003A80AB00277BA200E7F1F400FFFFFF00FEFEFD00FDFCFB00FBF9 + F800F9F7F500F8F4F200F6F2EF00F4EEEB00F2ECE800F1EAE600EFE7E300B7A2 + 930069473100FF00FF00FF00FF00D5BFB100FFFFFF00FFFFFF00FFFFFF00EFF8 + FB005ABADD005DB2E10060A9D700539BC700468DB9003B87AB00C5DCE500FFFF + FF00FFFFFF00FFFFFF00FEFEFD00F7A07300F7A07300F7A07300F7A07300F7A0 + 7300F7A07300F7A07300F1EBE700B7A2930069473100FF00FF00FF00FF00D5BF + B100FFFFFF00FFFFFF00FFFFFF00FFFFFF00E3F4F90052B7DA001C8CBF001887 + BA001D88B900CEE2E900FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFE + FD00FDFCFB00FBF9F800F9F7F500F8F4F200F6F2EF00F5F0ED00F3EDEA00B7A2 + 930069473100FF00FF00FF00FF00D5BFB100FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFEFD00FDFCFB00FBF9F800F9F7 + F500F8F4F200F6F2EF00F5F0ED00F3EDEA0069473100FF00FF00FF00FF00D5BF + B100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BF + B100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BF + B100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BF + B100D5BFB100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF007088 + 9000405860004050600040506000404850003040500030404000303840003030 + 4000202830002028300020283000202020001020200010182000101820001010 + 2000101020001010200010102000101020001010200010102000101020001010 + 200010102000FF00FF00FF00FF007090A000A0E0F00060C0E00060C0E00060B8 + E00060B8D00050B0D00050A8D00050A8C00040A0C00040A0C0004098C0003090 + B0003090B0003088B0003080B0002080B0002080B0002080A0002078A0002078 + A0002078A0002078A0002078A0002078A00010102000FF00FF00FF00FF008090 + A000A0E0F00080D8F00080D8F00070C8E00060C0E00060C0E00050B8E00050B8 + E00040B0E00040B0E00040A8E00040A8D00030A0D00030A0D00030A0D0003098 + D0003098D0002098D0002090D0002090C0002088C0002088C0002078A0002078 + A00010102000FF00FF00FF00FF008090A000A0E0F00080D8F00080D8F00080D0 + F00070D0F00070C8F00060C8F00060C0F00050C0F00050C0F00050B8F00040B8 + E00040B0E00040B0E00030A8E00030A8E00030A8E00030A0E00020A0D0002098 + D0002098D0002088C0002078A0002078A00010182000FF00FF00FF00FF008090 + A000B0E8F00090D8F00090D8F00080D8F00080D0F00070D0F00060C8F00060C8 + F00050C0F00050C0F00050C0F00040B8F00040B0E00040B0E00040A8E00030A8 + E00030A8E00030A0E00030A0D00020A0D0002098D0002090C0002078A0002078 + A00010202000FF00FF00FF00FF008090A000B0E8FF0090E0F00090E0F00090D8 + F00080D8F00070D0F00070D0F00060C8F00060C8F00060C8F00050C0F00050C0 + F00040B8E00040B0E00040B0E00040A8E00040A8E00030A8E00030A0E00030A0 + D0002098D0002090C0002078A0002078A00020203000FF00FF00FF00FF008090 + A000B0E8FF0090E0F00090E0F00090D8F00080D8F00070D0F00070D0F00060C8 + F00060C8F00060C8F00050C0F00050C0F00040B8E00040B0E00040B0E00040A8 + E00040A8E00030A8E00030A0E00030A0D0002098D0002090C0002078A0002078 + A00020203000FF00FF00FF00FF008090A000B0E8FF00A0E0F000A0E0F00090E0 + F00080D8F00080D0F00070D0F00070C8F00060C8F00060C8F00060C0F00050C0 + F00050C0F00040B8E00040B0E00040B0E00040B0E00030A8E00030A8E00030A0 + E00030A0D0002090D0002080B0002080B00020283000FF00FF00FF00FF008098 + A000C0F0FF00A0E0F000A0E0F000A0E0F00090E0F00080D8F00080D0F00070D0 + F00060C8F00060C8F00060C8F00050C0F00050C0F00050B8F00040B8E00040B0 + E00040B0E00040B0E00030A8E00030A8E00030A0E0002098D0002080B0002080 + B00030304000FF00FF00FF00FF008098A000C0F0FF00A0E8F000A0E8F000A0E0 + F00090E0F00090D8F00080D8F00080D0F00070D0F00070D0F00060C8F00060C8 + F00050C0F00050C0F00050B8F00040B8E00040B8E00040B0E00040B0E00030A8 + E00030A8E0003098D0003088B0003088B00030384000FF00FF00FF00FF008098 + A000C0F0FF00B0E8FF00B0E8FF00A0E8F000A0E0F00090E0F00090D8F00080D8 + F00070D0F00070D0F00070D0F00060C8F00060C0F00050C0F00050C0F00050B8 + F00050B8F00040B8E00040B0E00040B0E00030A8E0003098D0003090B0003090 + B00040405000FF00FF00FF00FF008098A000C0F0FF00B0E8FF00B0E8FF00B0E8 + F000A0E8F000A0E0F00090E0F00080D8F00080D0F00080D0F00070D0F00070C8 + F00060C8F00060C0F00050C0F00050C0F00050C0F00040B8F00040B0E00040B0 + E00040A8E00030A0D0003090C0003090C00040485000FF00FF00FF00FF008098 + A000D0F0FF00B0F0FF00B0F0FF00B0E8FF00A0E8F000A0E0F00090E0F00090D8 + F00080D8F00080D8F00080D0F00070D0F00060C8F00060C8F00050C0F00050C0 + F00050C0F00050C0F00040B8E00040B0E00040B0E00030A0D0004098C0004098 + C00040506000FF00FF00FF00FF008098A000D0F0FF00B0F0FF00B0F0FF00B0E8 + FF00A0E8F000A0E0F00090E0F00090D8F00080D8F00080D8F00080D0F00070D0 + F00060C8F00060C8F00050C0F00050C0F00050C0F00050C0F00040B8E00040B0 + E00040B0E00030A0D0004098C0004098C00040506000FF00FF00FF00FF008098 + A000D0F0FF00C0F0FF00C0F0FF00B0F0FF00B0E8FF00A0E8F000A0E0F00090E0 + F00090D8F00090D8F00080D8F00070D0F00070D0F00060C8F00060C8F00050C0 + F00050C0F00050C0F00050C0F00040B8E00040B0E00040A8D00040A0C00040A0 + C00050586000FF00FF00FF00FF008098A000D0F8FF00C0F0FF00C0F0FF00C0F0 + FF00B0E8FF00B0E8F000A0E8F000A0E0F00090E0F00090E0F00080D8F00080D8 + F00070D0F00070C8F00060C8F00060C0F00060C0F00050C0F00050C0F00050B8 + F00040B8E00040B0E00050A8D00050A8D00050607000FF00FF00FF00FF008098 + A000D0F8FF00D0F8FF00D0F8FF00D0F0FF00C0F0FF00C0F0FF00C0F0FF00B0E8 + FF00B0E8F000B0E8F000A0E0F000A0E0F00090D8F00090D8F00080D8F00080D0 + F00080D0F00080D0F00070D0F00070D0F00070C8F00070C8F00070B0D00070B0 + D00060707000FF00FF00FF00FF008098A0008098A0008098A0008098A0008098 + A0008098A0008090A0008090A0007090A0007088900070889000708890007088 + 9000708890007080900070809000708090007080900070809000708090007080 + 900070809000708090007080900070809000FF00FF00FF00FF00FF00FF008098 + A00090B8C000A0D0E000A0D0E000A0D0E000A0D0E000A0D0D000A0C8D00090C8 + D00090C8D00090C8D00080B8C0008098A000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF008098A000B0D8E000B0D8E000C0F0 + FF00C0F0FF00C0F0FF00B0F0FF00B0E8FF00A0D0E000A0D0E0008098A000FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF008098A000B0D8E000B0D8E000C0F0FF00C0F0FF00C0F0FF00B0F0FF00B0E8 + FF00A0D0E000A0D0E0008098A000FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008098A0008098A0008098 + A0008098A0008098A0008090A0008090A0008098A0008098A000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00C7B2A30069473100694731006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 31006947310069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00C7B2A300DFD0C700B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A2930069473100FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00C7B2A300B7A29300DFD0C700DFD0 + C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0 + C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0 + C700B7A2930069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00C7B2A300DFD0C700B7A29300E6DAD300E6DAD300E6DAD300E6DAD300E6DA + D300E6DAD300E6DAD300E6DAD300E6DAD300E6DAD300E6DAD300E6DAD300E6DA + D300E6DAD300E6DAD300E6DAD300B7A29300B7A2930069473100FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00C7B2A300E4D7CF00E4D7CF00B7A2 + 9300EEE5DF00EEE5DF00EEE5DF00EEE5DF00EEE5DF00EEE5DF00EEE5DF00EEE5 + DF00EEE5DF00EEE5DF00EEE5DF00EEE5DF00EEE5DF00EEE5DF00B7A29300DFD0 + C700B7A2930069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00C7B2A300E9DED800E9DED800E9DED800B7A29300F2EBE800F2EBE800F2EB + E800F2EBE800F2EBE800F2EBE800F2EBE800F2EBE800F2EBE800F2EBE800F2EB + E800F2EBE800B7A29300E6DAD300E6DAD300B7A2930069473100FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00C7B2A300EEE5E000EEE5E000EEE5 + E000EEE5E000B7A29300F6F2F000F6F2F000F6F2F000F6F2F000F6F2F000F6F2 + F000F6F2F000F6F2F000F6F2F000F6F2F000B7A29300EEE5DF00EEE5DF00EEE5 + DF00B7A2930069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00C7B2A300F1EAE700F1EAE700F1EAE700F1EAE700F1EAE700B7A29300FBF9 + F800FBF9F800FBF9F800FBF9F800FBF9F800FBF9F800FBF9F800FBF9F800B7A2 + 9300F2EBE800F2EBE800F2EBE800F2EBE800B7A2930069473100FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00C7B2A300F4EFED00F4EFED00F4EF + ED00F4EFED00B7A29300EEE0E000B7A29300FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00B7A29300DDC5C200B7A29300F6F2F000F6F2F000F6F2 + F000B7A293006947310085929900006090000060900000609000006090000060 + 9000C7B2A300F8F4F300F8F4F300F8F4F300B7A29300EEE0E000FBF8F700EEE0 + E000B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300DDC5C200DBC9 + BF00DDC5C200B7A29300FBF9F800FBF9F800B7A2930069473100859299008BF0 + F7000691CD000691CD000691CD000691CD00C7B2A300FCFAF900FCFAF900B7A2 + 9300EEE0E000FFFFFF00FEFDFD00FBF8F700EEE0E000EEE0E000EEE0E000EEE0 + E000EEE0E000EEE0E000E4D6CF00E0D1C800DCCBC200DDC5C200B7A29300FFFF + FF00B7A2930069473100859299008BF0F70087EEF70083ECF7007FEAF6007CE8 + F600C7B2A300FFFFFF00B8A39400FFFFFF00FFFFFF00B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300E0D1C800DCCBC200C8B3A400B7A29300F7F1EA0069473100859299008EF2 + F8008BF0F70087EEF70083ECF7007FEAF600C7B2A300B7A29300C8B3A400FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FCFAFA00F9F5F400F5F0 + EE00F2EBE800EEE6E200EBE1DC00E8DCD600E4D6CF00E0D1C800C8B3A400DDC5 + C200D1A09E00694731008592990092F4F8008EF2F8008BF0F70087EEF70083EC + F700C7B2A30027A5E900C8B3A400FFFFFF00FFFFFF00B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300E8DCD600E4D6CF00C8B3A40027A5E900B7A29300694731008592990092F4 + F80092F4F8008EF2F8008BF0F70087EEF700C7B2A30027A5E900C8B3A400FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FCFA + FA00F9F5F400F5F0EE00F2EBE800EEE6E200EBE1DC00E8DCD600C8B3A40027A5 + E900B7A29300694731008592990092F4F80092F4F80092F4F8008EF2F8008BF0 + F70087EEF700C7B2A300C8B3A400C8B3A400C8B3A400C8B3A400C8B3A400C8B3 + A400C8B3A400C8B3A400C8B3A400C8B3A400C8B3A400C8B3A400C8B3A400C8B3 + A400C8B3A400C8B3A400C8B3A400B9A4950069473100FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80090F3F8008DF1F80089EFF700C7B2A300DBF3 + FA00DBF3FA00DBF3FA00D3F0FA00C5EAFB00B6E3FB00A7DDFC0098D7FC0089D1 + FC007BCBFD006CC5FD005DBFFE004EB9FE0047B6FF0047B6FF00B7A293006947 + 3100FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80090F3F8008DF1F80089EFF700C7B2A300DBF3FA00DBF3FA00DBF3FA00D3F0 + FA00C5EAFB00B6E3FB00A7DDFC0098D7FC0091D4FC0082CEFD0073C8FD0064C2 + FE0055BCFE00B7A2930069473100FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80090F3F8008DF1F80089EF + F700C7B2A300DBF3FA00DBF3FA00DBF3FA00DBF3FA00CCEDFB00BDE6FB00AEE0 + FB009FDAFC0091D4FC0082CEFD0073C8FD00B7A2930069473100FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80092F4F80090F3F8008DF1F80089EFF700C7B2A300DBF3FA00DBF3 + FA00DBF3FA00DBF3FA00CCEDFB00BDE6FB00AEE0FB009FDAFC0091D4FC00B7A2 + 930069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80090F3 + F8008DF1F80089EFF700C7B2A300DBF3FA00DBF3FA00DBF3FA00DBF3FA00CCED + FB00BDE6FB00AEE0FB009FDAFC0069473100FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80092F4F80092F4F80092F4F80090F3F8008DF1F80089EFF700C7B2 + A300C7B2A300C7B2A300C7B2A300C7B2A300C7B2A300C7B2A300C7B2A3000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80090F3F8008DF1F80089EFF70085EDF70081EBF6007EE9F6007AE7 + F60076E5F50072E3F5000691CD0000609000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F8008EF2 + F8008BF0F70087EEF70083ECF7007EE9F6007AE7F60072E3F50072E3F5000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00859299008592 + 9900859299008592990085929900859299008592990085929900859299008592 + 9900859299008592990085929900859299008592990085929900859299008592 + 990085929900859299008592990085929900FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990095F6F80092F4F80091F2F80090F1F8008EF0 + F8008DEFF80090F1F80079CADE0085929900FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990084DB + E80094F5F80092F4F80091F2F80090F1F80090F1F80079CADE0085929900FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00859299008592990085929900859299008592 + 99008592990085929900FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF006C8C9C002936430029364300293643002936430029364300293643002936 + 4300293643002936430029364300293643002936430029364300293643002936 + 4300293643002936430029364300293643002936430029364300293643002936 + 4300FF00FF00FF00FF00FF00FF006C8C9C00335D7100335D7100335D7100335D + 7100335D7100335D7100335D7100335D7100335D7100335D7100335D7100335D + 7100335D7100335D7100335D7100335D7100335D71005CCAE10077DEEB0085E9 + F00098F8F80098F8F80098F8F80029364300FF00FF00FF00FF00FF00FF006C8C + 9C008DEFF30053A3B70053A3B70053A3B70053A3B70053A3B70053A3B70053A3 + B70053A3B70053A3B70053A3B70053A3B70053A3B70053A3B70053A3B70053A3 + B70053A3B700335D71005CCAE10077DEEB0085E9F00098F8F80098F8F8002936 + 4300FF00FF00FF00FF00FF00FF006C8C9C0092F4F6008DEFF30087EBF10082E7 + EF007CE3ED0077DEEB0071DAE9006CD6E70066D2E50061CEE3005CCAE10056C5 + DE0051C1DC004BBDDA0046B9D80040B4D60053A3B7005CCAE100335D71005CCA + E10077DEEB0085E9F00098F8F80029364300FF00FF00FF00FF00FF00FF006C8C + 9C0098F8F80092F4F6008DEFF30087EBF10082E7EF007CE3ED0077DEEB0071DA + E9006CD6E70066D2E50061CEE3005CCAE10056C5DE0051C1DC004BBDDA0046B9 + D80053A3B70077DEEB005CCAE100335D71005CCAE10077DEEB0085E9F0002936 + 4300FF00FF00FF00FF00FF00FF006C8C9C0098F8F80098F8F80092F4F6008DEF + F30087EBF10082E7EF007CE3ED0077DEEB0071DAE9006CD6E70066D2E50061CE + E3005CCAE10056C5DE0051C1DC004BBDDA0053A3B70085E9F00077DEEB005CCA + E100335D71005CCAE10077DEEB0029364300FF00FF00FF00FF00FF00FF006C8C + 9C0098F8F80098F8F80098F8F80095F6F70090F2F5008AEDF20085E9F0007CE3 + ED0077DEEB0071DAE9006CD6E70066D2E50061CEE3005CCAE10056C5DE0051C1 + DC0053A3B70098F8F80085E9F00077DEEB005CCAE100335D71005CCAE1002936 + 4300FF00FF00FF00FF00FF00FF006C8C9C0098F8F80098F8F80098F8F80098F8 + F80095F6F70090F2F5008AEDF20085E9F0007FE5EE007AE1EC0074DCEA006FD8 + E80069D4E60064D0E4005ECCE20056C5DE0053A3B70053A3B70053A3B70053A3 + B70053A3B70053A3B700335D710029364300FF00FF00FF00FF00FF00FF006C8C + 9C0098F8F80098F8F80098F8F80098F8F80098F8F80095F6F70090F2F5008AED + F20085E9F0007FE5EE007AE1EC0074DCEA006FD8E80069D4E60064D0E4005ECC + E20059C7DF0053C3DD004EBFDB0048BBD90043B6D70053A3B700335D71002936 + 4300FF00FF00FF00FF00FF00FF006C8C9C0098F8F80098F8F80098F8F80098F8 + F80098F8F80098F8F80095F6F70090F2F5008AEDF20085E9F0007FE5EE007AE1 + EC0074DCEA006FD8E80069D4E60064D0E4005ECCE20059C7DF0053C3DD004EBF + DB0048BBD90053A3B700335D710029364300FF00FF00FF00FF00FF00FF006C8C + 9C0098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80095F6 + F70090F2F5008AEDF20085E9F0007FE5EE007AE1EC0074DCEA006FD8E80069D4 + E60064D0E4005ECCE20059C7DF0053C3DD004EBFDB0053A3B700335D71002936 + 4300FF00FF00FF00FF00FF00FF006C8C9C0098F8F80098F8F80098F8F80098F8 + F80098F8F80098F8F80098F8F80098F8F80095F6F70090F2F5008AEDF20085E9 + F0007FE5EE007AE1EC0074DCEA006FD8E80069D4E60064D0E4005ECCE20059C7 + DF0053C3DD0053A3B700335D710029364300FF00FF00FF00FF00FF00FF006C8C + 9C0098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8 + F80098F8F80095F6F70090F2F5008AEDF20085E9F0007FE5EE007AE1EC0074DC + EA006FD8E80069D4E60064D0E4005ECCE20059C7DF0053A3B700335D71002936 + 4300FF00FF00FF00FF00FF00FF006C8C9C0098F8F80098F8F80098F8F80098F8 + F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80092F4 + F6008DEFF30087EBF10082E7EF007AE1EC0074DCEA006FD8E80069D4E60064D0 + E4005ECCE20053A3B700335D710029364300FF00FF00FF00FF00FF00FF006C8C + 9C0098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8 + F80098F8F80098F8F80098F8F80098F8F80092F4F6008DEFF30087EBF10082E7 + EF007CE3ED0077DEEB0071DAE9006CD6E70066D2E50053A3B700335D71002936 + 4300FF00FF00FF00FF00FF00FF006C8C9C0098F8F80098F8F80098F8F80098F8 + F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8 + F80098F8F80092F4F6008DEFF30087EBF10082E7EF007CE3ED0077DEEB0071DA + E9006CD6E70053A3B700335D710029364300FF00FF00FF00FF00FF00FF006C8C + 9C0098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8 + F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80092F4F6008DEF + F30087EBF10082E7EF007CE3ED0077DEEB0071DAE9006CD6E700335D71006C8C + 9C00FF00FF00FF00FF00FF00FF006C8C9C006C8C9C006C8C9C006C8C9C006C8C + 9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C + 9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C + 9C006C8C9C006C8C9C006C8C9C00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end> + end +end diff --git a/official/x.35/ExpressNavBar 2/Sources/dxfmNavBarDsgnEditor.pas b/official/x.35/ExpressNavBar 2/Sources/dxfmNavBarDsgnEditor.pas new file mode 100644 index 00000000..981c5c79 --- /dev/null +++ b/official/x.35/ExpressNavBar 2/Sources/dxfmNavBarDsgnEditor.pas @@ -0,0 +1,2443 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressNavBar } +{ } +{ Copyright (c) 2002-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSNAVBAR AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxfmNavBarDsgnEditor; + +{$I cxVer.inc} + +interface + +uses + Dialogs, Classes, Controls, Messages, Forms, StdCtrls, ExtCtrls, Menus, ImgList, ComCtrls, + ToolWin, ActnList, Types, +{$IFDEF DELPHI6} + DesignWindows, DesignIntf, DesignEditors, +{$ELSE} + DsgnIntf, DsgnWnds, LibIntf, +{$ENDIF} + dxNavBar, dxNavBarBase, dxNavBarCollns, dxNavBarStyles, dxNavBarDsgnUtils, + cxClasses, cxDesignWindows, cxGraphics, cxControls; + +type + TdxfmNavBarDesignWindow = class; + + TdxNavBarDsgnWindowPageHandler = class + private + FDsgnWindow: TdxfmNavBarDesignWindow; + function GetNavBar: TdxCustomNavBar; + protected + function DesignerCaptionPostfix: string; virtual; + function ItemNamePrefix: string; virtual; + + function CanAdd: Boolean; virtual; + function CanCopy: Boolean; virtual; + function CanCut: Boolean; virtual; + function CanDelete: Boolean; virtual; + function CanSelectAll: Boolean; virtual; + function CanMoveUp: Boolean; virtual; + function CanMoveDown: Boolean; virtual; + function CanPaste: Boolean; virtual; + public + constructor Create(ADsgnWindow: TdxfmNavBarDesignWindow); + destructor Destroy; override; + + procedure Activate; + procedure Add(AItemClass: TClass); virtual; + procedure Copy; virtual; + procedure Cut; virtual; + procedure Delete; virtual; + procedure ItemDeleted(AItem: TPersistent); virtual; + procedure GetSelections(const ASelections: IDesignerSelections); virtual; + procedure MoveSelection(ADelta: Integer); virtual; + procedure Paste; virtual; + procedure SelectAll; virtual; + procedure UpdateActions; virtual; + procedure UpdateContent; virtual; + procedure UpdateScrollBar; virtual; + procedure UpdateSelections(const ASelections: IDesignerSelections); virtual; + + property DsgnWindow: TdxfmNavBarDesignWindow read FDsgnWindow; + property NavBar: TdxCustomNavBar read GetNavBar; + end; + + IdxNavBarDesignEditor = interface + ['{1A11AE34-8BF4-40A6-8B0E-F37399A236CC}'] + procedure Activate; + end; + + TdxNavBarDesigner = class(TcxDesignHelper, IdxNavBarDesignEditor) + private + FDesignWindow: TdxfmNavBarDesignWindow; + FIsBeingModified: Boolean; + + procedure Activate; { IdxNavBarDesignEditor } + function GetDesignWindow: TdxfmNavBarDesignWindow; + public + constructor Create(AComponent: TComponent); override; + destructor Destroy; override; + procedure Modified; override; { IcxDesignHelper } + + property DesignWindow: TdxfmNavBarDesignWindow read GetDesignWindow; + end; + + TdxfmNavBarDesignWindow = class(TDesignWindow) + ilActions: TcxImageList; + pmMain: TPopupMenu; + miAdd: TMenuItem; + N2: TMenuItem; + miEdit: TMenuItem; + miCut: TMenuItem; + miCopy: TMenuItem; + miPaste: TMenuItem; + miDelete: TMenuItem; + N3: TMenuItem; + miSelectAll: TMenuItem; + N4: TMenuItem; + miMoveUp: TMenuItem; + miMoveDown: TMenuItem; + nbMain: TdxNavBar; + bgMain: TdxNavBarGroup; + bgStyles: TdxNavBarGroup; + biGroups: TdxNavBarItem; + biLinks: TdxNavBarItem; + biViews: TdxNavBarItem; + biDefaultStyles: TdxNavBarItem; + biCustomStyles: TdxNavBarItem; + pnCommonButtons: TPanel; + btCancel: TButton; + pcMain: TPageControl; + tsGroups: TTabSheet; + lbxGroups: TListBox; + tsLinks: TTabSheet; + Splitter1: TSplitter; + tsViews: TTabSheet; + Label3: TLabel; + Label4: TLabel; + nbPreview: TdxNavBar; + bgLocal: TdxNavBarGroup; + bgContacts: TdxNavBarGroup; + biInbox: TdxNavBarItem; + biOutbox: TdxNavBarItem; + biSentItems: TdxNavBarItem; + biDeletedItems: TdxNavBarItem; + biReport: TdxNavBarItem; + lbxViewStyles: TListBox; + tsDefaultStyles: TTabSheet; + lbxDefaultStyles: TListBox; + tsCustomStyles: TTabSheet; + lbxCustomStyles: TListBox; + actlCommands: TActionList; + actAdd: TAction; + actMoveUp: TAction; + actMoveDown: TAction; + pnButtons: TPanel; + tlbGroups: TToolBar; + ToolButton3: TToolButton; + ToolButton6: TToolButton; + ToolButton1: TToolButton; + ToolButton2: TToolButton; + ToolButton7: TToolButton; + ToolButton5: TToolButton; + ToolButton12: TToolButton; + Panel6: TPanel; + tlbCustomStyles: TToolBar; + ToolButton15: TToolButton; + ToolButton16: TToolButton; + ToolButton17: TToolButton; + ToolButton18: TToolButton; + ToolButton19: TToolButton; + ToolButton20: TToolButton; + ToolButton21: TToolButton; + Panel2: TPanel; + tlbLinkDesigner: TToolBar; + ToolButton22: TToolButton; + ToolButton23: TToolButton; + ToolButton24: TToolButton; + ToolButton25: TToolButton; + ToolButton26: TToolButton; + biItems: TdxNavBarItem; + tsItems: TTabSheet; + Panel1: TPanel; + tlbItems: TToolBar; + ToolButton4: TToolButton; + ToolButton8: TToolButton; + ToolButton9: TToolButton; + ToolButton10: TToolButton; + ToolButton11: TToolButton; + ToolButton13: TToolButton; + ToolButton14: TToolButton; + lbxItems: TListBox; + Panel3: TPanel; + lbxLinkDesignerItems: TListView; + Panel4: TPanel; + tvLinkDesignerGroups: TTreeView; + Panel5: TPanel; + Panel7: TPanel; + Label1: TLabel; + Label2: TLabel; + Panel8: TPanel; + tlbDefaultStyles: TToolBar; + ToolButton27: TToolButton; + actDefaultSettings: TAction; + actDelete: TAction; + actCut: TAction; + actCopy: TAction; + actPaste: TAction; + actSelectAll: TAction; + ilNavBarLarge: TcxImageList; + ilNavBarSmall: TcxImageList; + ilLinkDesigner: TcxImageList; + ilToolBar: TcxImageList; + ilTreeView: TcxImageList; + ilToolBarDisabled: TcxImageList; + pmGroupItemClasses: TPopupMenu; + msiAdd: TMenuItem; + cbColorScheme: TComboBox; + lblColorScheme: TLabel; + ilPreviewSmall: TcxImageList; + ilPreviewLarge: TcxImageList; + nbCalendar: TdxNavBarItem; + nbTask: TdxNavBarItem; + procedure ListBoxClick(Sender: TObject); + procedure AddClick(Sender: TObject); + procedure ActionClick(Sender: TObject); + procedure MoveUpClick(Sender: TObject); + procedure MoveDownClick(Sender: TObject); + procedure tvLinkDesignerGroupsDragDrop(Sender, Source: TObject; X, Y: Integer); + procedure tvLinkDesignerGroupsDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); + procedure tvLinkDesignerGroupsStartDrag(Sender: TObject; var DragObject: TDragObject); + procedure lbxLinkDesignerItemsDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); + procedure lbxLinkDesignerItemsDragDrop(Sender, Source: TObject; X, Y: Integer); + procedure lbxLinkDesignerItemsStartDrag(Sender: TObject; var DragObject: TDragObject); + procedure tvLinkDesignerGroupsExit(Sender: TObject); + procedure tvLinkDesignerGroupsClick(Sender: TObject); + procedure lbxLinkDesignerItemsClick(Sender: TObject); + procedure tvLinkDesignerGroupsEndDrag(Sender, Target: TObject; X, + Y: Integer); + procedure lbxLinkDesignerItemsEndDrag(Sender, Target: TObject; X, + Y: Integer); + procedure tvLinkDesignerGroupsKeyUp(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure nbMainLinkClick(Sender: TObject; ALink: TdxNavBarItemLink); + procedure DefaultSettingsClick(Sender: TObject); + procedure lbxViewStylesChange(Sender: TObject); + procedure btCancelClick(Sender: TObject); + procedure lbxItemsContextPopup(Sender: TObject; MousePos: TPoint; + var Handled: Boolean); + procedure lbxContextPopup(Sender: TObject; MousePos: TPoint; + var Handled: Boolean); + procedure cbColorSchemeChange(Sender: TObject); + private + FNavBar: TdxCustomNavBar; + FHandlers: TList; + FCurrentHandler: TdxNavBarDsgnWindowPageHandler; + FSaveCursor: TCursor; + + function GetNavBarDesigner: IcxDesignHelper; + procedure SetNavBar(Value: TdxCustomNavBar); + + procedure ActivatePage(APageIndex: Integer); + function CanAdd: Boolean; + function CanCopy: Boolean; + function CanCut: Boolean; + function CanDelete: Boolean; + function CanMoveDown: Boolean; + function CanMoveUp: Boolean; + function CanPaste: Boolean; + function CanSelectAll: Boolean; + procedure Copy; + procedure Cut; + procedure Delete; + procedure HandleException; + function GetRegistryPath: string; + procedure Paste; + procedure RestoreLayout; + procedure Select(AComponent: TComponent; AddToSelection: Boolean); + procedure SelectAll; + procedure SelectNavBar; + procedure StartWait; + procedure StopWait; + procedure StoreLayout; + procedure UpdateActions; reintroduce; + procedure UpdateCaption; + procedure UpdateSelections(const ASelections: IDesignerSelections); + + function GetHandler(Index: Integer): TdxNavBarDsgnWindowPageHandler; + function GetHandlerCount: Integer; + protected + procedure Activated; override; + {$IFDEF DELPHI9} + procedure CreateParams(var Params: TCreateParams); override; + {$ENDIF} + function UniqueName(Component: TComponent): string; override; + + procedure ActiveDesignerPageChanged; + procedure InitializeHandlers; + procedure InitializeViewStyles; + procedure FinalizeHandlers; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + function ClipboardComponents: Boolean; + + {$IFDEF DELPHI6} + function EditAction(Action: TEditAction): Boolean; override; + {$ELSE} + procedure EditAction(Action: TEditAction); override; + {$ENDIF} + function GetEditState: TEditState; override; + + {$IFDEF DELPHI6} + procedure ItemDeleted(const ADesigner: IDesigner; Item: TPersistent); override; + procedure ItemsModified(const Designer: IDesigner); override; + procedure SelectionChanged(const ADesigner: IDesigner; const ASelection: IDesignerSelections); override; + {$ELSE} + procedure ComponentDeleted(Component: IPersistent); override; + procedure FormModified; override; + procedure SelectionChanged(ASelection: TDesignerSelectionList); override; + {$ENDIF} + + property CurrentHandler: TdxNavBarDsgnWindowPageHandler read FCurrentHandler write FCurrentHandler; + property HandlerCount: Integer read GetHandlerCount; + property Handlers[Index: Integer]: TdxNavBarDsgnWindowPageHandler read GetHandler; + property NavBar: TdxCustomNavBar read FNavBar write SetNavBar; + property NavBarDesigner: IcxDesignHelper read GetNavBarDesigner; + end; + +procedure dxShowNavBarDesigner(ANavBar: TdxCustomNavBar); + +implementation + +{$R *.DFM} + +uses + Windows, SysUtils, TypInfo, Registry, Math, Graphics, +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + ToolsAPI, dxNavBarViewsFact, dxNavBarDsgnConsts, dxNavBarGroupItems, + dxNavBarSkinBasedViews; + +type + TdxCustomNavBarAccess = class(TdxCustomNavBar); + +procedure dxShowNavBarDesigner(ANavBar: TdxCustomNavBar); +var + ANavBarDesignEditor: IdxNavBarDesignEditor; +begin + if Supports(TdxCustomNavBarAccess(ANavBar).FDesignHelper, IdxNavBarDesignEditor, ANavBarDesignEditor) then + ANavBarDesignEditor.Activate; +end; + +{ TdxNavBarDesigner } + +constructor TdxNavBarDesigner.Create(AComponent: TComponent); +begin + inherited Create(AComponent); + AddSelectionChangedListener(AComponent); +end; + +destructor TdxNavBarDesigner.Destroy; +begin + if FDesignWindow <> nil then + begin + FDesignWindow.Designer := nil; + FDesignWindow.Free; + end; + RemoveSelectionChangedListener(Component); + inherited Destroy; +end; + +function TdxNavBarDesigner.GetDesignWindow: TdxfmNavBarDesignWindow; +begin + if FDesignWindow = nil then + begin + FDesignWindow := TdxfmNavBarDesignWindow.Create(nil); + FDesignWindow.Designer := Designer; + FDesignWindow.NavBar := TdxCustomNavBar(Component); + end; + Result := FDesignWindow; +end; + +procedure TdxNavBarDesigner.Activate; +begin + DesignWindow.Show; +end; + +procedure TdxNavBarDesigner.Modified; +begin + if not FIsBeingModified and (Designer <> nil) then + begin + FIsBeingModified := True; + try + inherited Modified; + finally + FIsBeingModified := False + end; + end; +end; + +type + TdxNavBarDsgnWindowComponentCollectionPageHandler = class(TdxNavBarDsgnWindowPageHandler) + private + function GetItem(Index: Integer): TdxNavBarComponentCollectionItem; + function GetItemCount: Integer; + function GetSelected(Index: Integer): Boolean; + function GetSelectedCount: Integer; + procedure SetSelected(Index: Integer; const Value: Boolean); + protected + function AddNavBarCollectionItem(AItemClass: TClass): TdxNavBarComponentCollectionItem; virtual; + function GetNavBarComponentCollection: TdxNavBarComponentCollection; virtual; + function MainList: TListBox; virtual; + function ItemClass: TComponentClass; virtual; + procedure SetCollectionItemName(ANavBarCollectionItem: TdxNavBarComponentCollectionItem); virtual; + + function CanAdd: Boolean; override; + function CanCopy: Boolean; override; + function CanCut: Boolean; override; + function CanDelete: Boolean; override; + function CanSelectAll: Boolean; override; + function CanMoveUp: Boolean; override; + function CanMoveDown: Boolean; override; + function CanPaste: Boolean; override; + public + procedure Add(AItemClass: TClass); override; + procedure Copy; override; + procedure Cut; override; + procedure Delete; override; + procedure ItemDeleted(AItem: TPersistent); override; + function IndexOf(AItem: TComponent): Integer; + procedure GetSelections(const ASelections: IDesignerSelections); override; + procedure MoveSelection(ADelta: Integer); override; + procedure Paste; override; + procedure RefreshListValues; virtual; + procedure SelectAll; override; + procedure UpdateContent; override; + procedure UpdateScrollBar; override; + procedure UpdateSelections(const ASelections: IDesignerSelections); override; + + property Selected[Index: Integer]: Boolean read GetSelected write SetSelected; + property SelectedCount: Integer read GetSelectedCount; + property Items[Index: Integer]: TdxNavBarComponentCollectionItem read GetItem; + property ItemCount: Integer read GetItemCount; + property NavBarCollection: TdxNavBarComponentCollection read GetNavBarComponentCollection; + + property DsgnWindow: TdxfmNavBarDesignWindow read FDsgnWindow; + property NavBar: TdxCustomNavBar read GetNavBar; + end; + +{ TdxNavBarDsgnWindowComponentCollectionPageHandler } + +procedure TdxNavBarDsgnWindowComponentCollectionPageHandler.Add(AItemClass: TClass); +var + ANavBarCollectionItem: TdxNavBarComponentCollectionItem; +begin + ANavBarCollectionItem := AddNavBarCollectionItem(AItemClass); + SetCollectionItemName(ANavBarCollectionItem); + MainList.Items.AddObject(ANavBarCollectionItem.Name, ANavBarCollectionItem); + DsgnWindow.Select(ANavBarCollectionItem, False); + UpdateScrollBar; + MainList.Update; + // NavBar.DesignerModified; +end; + +procedure TdxNavBarDsgnWindowComponentCollectionPageHandler.Copy; +var + Components: {$IFDEF DELPHI6}IDesignerSelections{$ELSE}TDesignerSelectionList{$ENDIF}; +begin +//DsgnWindow.Designer.CopySelection +{$IFDEF DELPHI6} + Components := CreateSelectionList; +{$ELSE} + Components := TDesignerSelectionList.Create; + try +{$ENDIF} + GetSelections(Components); + DsgnWindow.CopyComponents(NavBar.Owner, Components); +{$IFNDEF DELPHI6} + finally + Components.Free; + end; +{$ENDIF} + UpdateScrollBar; +end; + +procedure TdxNavBarDsgnWindowComponentCollectionPageHandler.Cut; +begin + Copy; + Delete; +end; + +procedure TdxNavBarDsgnWindowComponentCollectionPageHandler.Delete; +var + Selections: IDesignerSelections; + I: Integer; +begin + DsgnWindow.StartWait; + try + Selections := CreateSelectionList; + GetSelections(Selections); + for I := 0 to Selections.Count - 1 do + dxNavBarDsgnUtils.TryExtractPersistent(Selections[I]).Free; + finally + DsgnWindow.StopWait; + end; +end; + +procedure TdxNavBarDsgnWindowComponentCollectionPageHandler.ItemDeleted( + AItem: TPersistent); +var + Index, ItemIndex: Integer; +begin + if (AItem = nil) or not AItem.InheritsFrom(ItemClass) then exit; + + Index := IndexOf(TComponent(AItem)); + if Index <> -1 then + begin + ItemIndex := MainList.ItemIndex; + MainList.Items.Delete(Index); + + ItemIndex := Min(ItemIndex, ItemCount - 1); + if ItemIndex <> -1 then + DsgnWindow.Select(Items[ItemIndex], False) + else + DsgnWindow.SelectNavBar; + UpdateScrollBar; + end; +end; + +procedure TdxNavBarDsgnWindowComponentCollectionPageHandler.GetSelections( + const ASelections: IDesignerSelections); +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + if Selected[I] then + ASelections.Add(dxNavBarDsgnUtils.MakeIComponent(Items[I])); + if ASelections.Count = 0 then + ASelections.Add(dxNavBarDsgnUtils.MakeIComponent(NavBar)); +end; + +function TdxNavBarDsgnWindowComponentCollectionPageHandler.IndexOf( + AItem: TComponent): Integer; +begin + Result := MainList.Items.IndexOfObject(AItem); +end; + +procedure TdxNavBarDsgnWindowComponentCollectionPageHandler.MoveSelection( + ADelta: Integer); + + procedure MoveDown(ADelta: Integer); + var + I, Index: Integer; + begin + for I := 0 to ItemCount - 1 do + if Selected[I] then + begin + Index := Items[I].Index; + Inc(Index, ADelta); + if Index > ItemCount - 1 then + Index := ItemCount - 1; + while (Index < ItemCount) and Selected[Index] do + Inc(Index); + Items[I].Index := Index; + end; + end; + + procedure MoveUp(ADelta: Integer); + var + I, Index: Integer; + begin + for I := ItemCount - 1 downto 0 do + if Selected[I] then + begin + Index := Items[I].Index; + Inc(Index, ADelta); + if Index < 0 then + Index := 0; + while (Index > -1) and Selected[Index] do + Dec(Index); + Items[I].Index := Index; + end; + end; + +begin + if ADelta > 0 then + MoveDown(ADelta) + else + MoveUp(ADelta); + NavBar.DesignerModified; +end; + +procedure TdxNavBarDsgnWindowComponentCollectionPageHandler.Paste; +var + Components: {$IFDEF DELPHI6}IDesignerSelections{$ELSE}TDesignerSelectionList{$ENDIF}; + I: Integer; +begin +//DsgnWindow.Designer.PasteSelection +{$IFDEF DELPHI6} + Components := CreateSelectionList; +{$ELSE} + Components := TDesignerSelectionList.Create; + try +{$ENDIF} + DsgnWindow.StartWait; + try + MainList.Items.BeginUpdate; + try + DsgnWindow.PasteComponents(NavBar.Owner, NavBar, Components); + UpdateContent; + for I := ItemCount - 1 downto ItemCount - Components.Count do + Selected[I] := True; + DsgnWindow.Designer.SetSelections(Components); + finally + MainList.Items.EndUpdate; + end; + finally + DsgnWindow.StopWait; + end; +{$IFNDEF DELPHI6} + finally + Components.Free; + end; +{$ENDIF} + UpdateScrollBar; +end; + +procedure TdxNavBarDsgnWindowComponentCollectionPageHandler.UpdateContent; +var + Selections: IDesignerSelections; + I, Index: Integer; + Component: TComponent; +begin + MainList.Items.BeginUpdate; + try + Selections := CreateSelectionList; + GetSelections(Selections); + + MainList.Items.Clear; + if NavBar = nil then Exit; + RefreshListValues; + + for I := 0 to Selections.Count - 1 do + begin + Component := dxNavBarDsgnUtils.TryExtractComponent(Selections[I]); + if Component is ItemClass then + begin + Index := IndexOf(Component); + if Index <> -1 then Selected[Index] := True; + end; + end; + finally + MainList.Items.EndUpdate; + end; +end; + +procedure TdxNavBarDsgnWindowComponentCollectionPageHandler.RefreshListValues; +var + I: Integer; + ANavBarCollectionItem: TcxComponentCollectionItem; +begin + for I := 0 to NavBarCollection.Count - 1 do + begin + ANavBarCollectionItem := NavBarCollection.Items[I]; + if ANavBarCollectionItem.Owner = NavBar.Owner then + MainList.Items.AddObject(ANavBarCollectionItem.Name, ANavBarCollectionItem); + end; +end; + +procedure TdxNavBarDsgnWindowComponentCollectionPageHandler.SelectAll; +var + Selections: IDesignerSelections; + I: Integer; +begin + Selections := CreateSelectionList; + for I := 0 to ItemCount - 1 do + Selections.Add(dxNavBarDsgnUtils.MakeIComponent(Items[I])); + DsgnWindow.Designer.SetSelections(Selections); +end; + +procedure TdxNavBarDsgnWindowComponentCollectionPageHandler.SetSelected( + Index: Integer; const Value: Boolean); +begin + if MainList <> nil then + MainList.Selected[Index] := Value; +end; + +procedure TdxNavBarDsgnWindowComponentCollectionPageHandler.UpdateScrollBar; +var + I, NewWidth, CurrentWidth: Integer; +begin + NewWidth := 0; + with MainList do + begin + for I := 0 to Items.Count - 1 do + begin + CurrentWidth := 2 + Canvas.TextWidth(Items[I]) + 1; + if CurrentWidth > NewWidth then NewWidth := CurrentWidth; + end; + SendMessage(Handle, LB_SETHORIZONTALEXTENT, NewWidth, 0); + end; +end; + +procedure TdxNavBarDsgnWindowComponentCollectionPageHandler.UpdateSelections(const ASelections: IDesignerSelections); + + function InSelection(AItem: TComponent): Boolean; + var + I: Integer; + begin + Result := False; + for I := 0 to ASelections.Count - 1 do + if AItem = dxNavBarDsgnUtils.TryExtractComponent(ASelections[I]) then + begin + Result := True; + break; + end; + end; + +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + if Selected[I] xor InSelection(Items[I]) then + Selected[I] := not Selected[I]; +end; + +function TdxNavBarDsgnWindowComponentCollectionPageHandler.AddNavBarCollectionItem(AItemClass: TClass): TdxNavBarComponentCollectionItem; +begin + Result := nil; +end; + +function TdxNavBarDsgnWindowComponentCollectionPageHandler.GetNavBarComponentCollection: TdxNavBarComponentCollection; +begin + Result := nil; +end; + +function TdxNavBarDsgnWindowComponentCollectionPageHandler.MainList: TListBox; +begin + Result := nil; +end; + +function TdxNavBarDsgnWindowComponentCollectionPageHandler.ItemClass: TComponentClass; +begin + Result := nil; +end; + +procedure TdxNavBarDsgnWindowComponentCollectionPageHandler.SetCollectionItemName( + ANavBarCollectionItem: TdxNavBarComponentCollectionItem); +begin + ANavBarCollectionItem.Name := DsgnWindow.UniqueName(ANavBarCollectionItem); +end; + +function TdxNavBarDsgnWindowComponentCollectionPageHandler.CanAdd: Boolean; +begin + Result := (NavBar <> nil) and (NavBar.Owner <> nil); + if Result then + Result := not (csInline in NavBar.Owner.ComponentState); +end; + +function TdxNavBarDsgnWindowComponentCollectionPageHandler.CanCopy: Boolean; +begin + Result := SelectedCount <> 0; +end; + +function TdxNavBarDsgnWindowComponentCollectionPageHandler.CanCut: Boolean; +begin + Result := CanCopy and CanDelete; +end; + +function TdxNavBarDsgnWindowComponentCollectionPageHandler.CanDelete: Boolean; +var + I: Integer; +begin + Result := SelectedCount <> 0; + if Result then + for I := 0 to ItemCount - 1 do + if Selected[I] and (csAncestor in Items[I].ComponentState) then + begin + Result := False; + Exit; + end; +end; + +function TdxNavBarDsgnWindowComponentCollectionPageHandler.CanMoveDown: Boolean; +var + I, Counter: Integer; +begin + Counter := 0; + for I := ItemCount - 1 downto 0 do + begin + if not Selected[I] then + begin + Result := Counter < SelectedCount; + Exit; + end; + Inc(Counter); + end; + Result := False; +end; + +function TdxNavBarDsgnWindowComponentCollectionPageHandler.CanMoveUp: Boolean; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + if not Selected[I] then + begin + Result := I < SelectedCount; + Exit; + end; + Result := False; +end; + +function TdxNavBarDsgnWindowComponentCollectionPageHandler.CanPaste: Boolean; +begin + Result := CanAdd and DsgnWindow.ClipboardComponents and DsgnWindow.Designer.CanPaste; +end; + +function TdxNavBarDsgnWindowComponentCollectionPageHandler.CanSelectAll: Boolean; +begin + Result := ItemCount <> SelectedCount; +end; + +function TdxNavBarDsgnWindowComponentCollectionPageHandler.GetItem( + Index: Integer): TdxNavBarComponentCollectionItem; +begin + if MainList <> nil then + Result := TdxNavBarComponentCollectionItem(MainList.Items.Objects[Index]) + else Result := nil; +end; + +function TdxNavBarDsgnWindowComponentCollectionPageHandler.GetItemCount: Integer; +begin + if MainList <> nil then + Result := MainList.Items.Count + else Result := 0; +end; + +function TdxNavBarDsgnWindowComponentCollectionPageHandler.GetSelected( + Index: Integer): Boolean; +begin + if MainList <> nil then + Result := MainList.Selected[Index] + else Result := False; +end; + +function TdxNavBarDsgnWindowComponentCollectionPageHandler.GetSelectedCount: Integer; +begin + if MainList <> nil then + Result := MainList.SelCount + else Result := 0; +end; + +type + TdxNavBarDsgnWindowGroupsHandler = class(TdxNavBarDsgnWindowComponentCollectionPageHandler) + protected + function AddNavBarCollectionItem(AItemClass: TClass): TdxNavBarComponentCollectionItem; override; + function DesignerCaptionPostfix: string; override; + function GetNavBarComponentCollection: TdxNavBarComponentCollection; override; + function MainList: TListBox; override; + function ItemNamePrefix: string; override; + function ItemClass: TComponentClass; override; + end; + +{ TdxNavBarDsgnWindowGroupsHandler } + +function TdxNavBarDsgnWindowGroupsHandler.AddNavBarCollectionItem(AItemClass: TClass): TdxNavBarComponentCollectionItem; +begin + Result := TdxNavBarGroups(NavBarCollection).Add; +end; + +function TdxNavBarDsgnWindowGroupsHandler.DesignerCaptionPostfix: string; +begin + Result := sdxGroupsDesigner; +end; + +function TdxNavBarDsgnWindowGroupsHandler.GetNavBarComponentCollection: TdxNavBarComponentCollection; +begin + Result := NavBar.Groups; +end; + +function TdxNavBarDsgnWindowGroupsHandler.MainList: TListBox; +begin + Result := DsgnWindow.lbxGroups; +end; + +function TdxNavBarDsgnWindowGroupsHandler.ItemNamePrefix: string; +begin + Result := sdxGroup; +end; + +function TdxNavBarDsgnWindowGroupsHandler.ItemClass: TComponentClass; +begin + Result := TdxNavBarGroup; +end; + +type + TdxNavBarDsgnWindowItemsHandler = class(TdxNavBarDsgnWindowComponentCollectionPageHandler) + protected + function AddNavBarCollectionItem(AItemClass: TClass): TdxNavBarComponentCollectionItem; override; + function DesignerCaptionPostfix: string; override; + function GetNavBarComponentCollection: TdxNavBarComponentCollection; override; + function MainList: TListBox; override; + function ItemNamePrefix: string; override; + function ItemClass: TComponentClass; override; + end; + +{ TdxNavBarDsgnWindowItemsHandler } + +function TdxNavBarDsgnWindowItemsHandler.AddNavBarCollectionItem(AItemClass: TClass): TdxNavBarComponentCollectionItem; +begin + if (AItemClass <> nil) and AItemClass.InheritsFrom(TdxNavBarItem) then + Result := TdxNavBarItems(NavBarCollection).Add(TdxNavBarItemClass(AItemClass)) + else + Result := TdxNavBarItems(NavBarCollection).Add; +end; + +function TdxNavBarDsgnWindowItemsHandler.DesignerCaptionPostfix: string; +begin + Result := sdxItemsDesigner; +end; + +function TdxNavBarDsgnWindowItemsHandler.GetNavBarComponentCollection: TdxNavBarComponentCollection; +begin + Result := NavBar.Items; +end; + +function TdxNavBarDsgnWindowItemsHandler.MainList: TListBox; +begin + Result := DsgnWindow.lbxItems; +end; + +function TdxNavBarDsgnWindowItemsHandler.ItemNamePrefix: string; +begin + Result := sdxItem; +end; + +function TdxNavBarDsgnWindowItemsHandler.ItemClass: TComponentClass; +begin + Result := TdxNavBarItem; +end; + +type + TdxNavBarDsgnWindowCustomStylesHandler = class(TdxNavBarDsgnWindowComponentCollectionPageHandler) + protected + function AddNavBarCollectionItem(AItemClass: TClass): TdxNavBarComponentCollectionItem; override; + function MainList: TListBox; override; + function DesignerCaptionPostfix: string; override; + function GetNavBarComponentCollection: TdxNavBarComponentCollection; override; + function ItemNamePrefix: string; override; + function ItemClass: TComponentClass; override; + procedure SetCollectionItemName(ANavBarCollectionItem: TdxNavBarComponentCollectionItem); override; + end; + +{ TdxNavBarDsgnWindowSlylesHandler } + +function TdxNavBarDsgnWindowCustomStylesHandler.AddNavBarCollectionItem(AItemClass: TClass): TdxNavBarComponentCollectionItem; +begin + Result := TdxNavBarStyleRepository(NavBarCollection).Add; +end; + +function TdxNavBarDsgnWindowCustomStylesHandler.MainList: TListBox; +begin + Result := DsgnWindow.lbxCustomStyles; +end; + +function TdxNavBarDsgnWindowCustomStylesHandler.DesignerCaptionPostfix: string; +begin + Result := sdxCustomStylesDesigner; +end; + +function TdxNavBarDsgnWindowCustomStylesHandler.GetNavBarComponentCollection: TdxNavBarComponentCollection; +begin + Result := NavBar.Styles; +end; + +function TdxNavBarDsgnWindowCustomStylesHandler.ItemNamePrefix: string; +begin + Result := sdxStyleItem; +end; + +function TdxNavBarDsgnWindowCustomStylesHandler.ItemClass: TComponentClass; +begin + Result := TdxNavBarStyleItem; +end; + +procedure TdxNavBarDsgnWindowCustomStylesHandler.SetCollectionItemName(ANavBarCollectionItem: TdxNavBarComponentCollectionItem); +begin +//do nothing +end; + +type + TdxNavBarDsgnWindowLinksHandler = class(TdxNavBarDsgnWindowPageHandler) + private + FLockUpdateContent: Boolean; + FSourceItem: TdxNavBarItem; + FSourceLink: TdxNavBarItemLink; + FTargetGroup: TdxNavBarGroup; + FTargetLink: TdxNavBarItemLink; + + function GetSelectedGroup: TdxNavBarGroup; + function GetSelectedItem: TdxNavBarItem; + function GetSelectedLink: TdxNavBarItemLink; + protected + function CanAdd: Boolean; override; + function CanDelete: Boolean; override; + function CanSelectAll: Boolean; override; + function CanMoveUp: Boolean; override; + function CanMoveDown: Boolean; override; + function DesignerCaptionPostfix: string; override; + + function ItemsLV: TListView; + function LinksTV: TTreeView; + procedure RefreshGroupTreeView; + procedure RefreshItemList; + function GetGroupByNode(ANode: TTreeNode): TdxNavBarGroup; + function GetLinkByNode(ANode: TTreeNode): TdxNavBarItemLink; + function GetItemByNode(ANode: TListItem): TdxNavBarItem; + function GetNodeByGroup(AGroup: TdxNavBarGroup): TTreeNode; + function GetNodeByLink(ALink: TdxNavBarItemLink): TTreeNode; + procedure CreateNodeByLink(ALink: TdxNavBarItemLink); + procedure RemoveNodeByLink(ALink: TdxNavBarItemLink); + + function GetGroupNodeCaption(AGroup: TdxNavBarGroup): string; + function GetItemNodeCaption(AItem: TdxNavBarItem): string; + procedure SetTargetGroupNodeImage(AImageIndex: Integer); + procedure SetTargetLinkNodeImage(AImageIndex: Integer); + procedure UpdateTargets(ANode: TTreeNode); + procedure ClearTargets; + + procedure CreateLink(AItem: TdxNavBarItem; AGroup: TdxNavBarGroup; AIndex: Integer); + procedure MoveLink(ALink: TdxNavBarItemLink; AGroup: TdxNavBarGroup; AIndex: Integer); + procedure RemoveLink(ALink: TdxNavBarItemLink); + public + procedure Add(AItemClass: TClass); override; + procedure Delete; override; + procedure ItemDeleted(AItem: TPersistent); override; + procedure MoveSelection(ADelta: Integer); override; + procedure UpdateContent; override; + + property SelectedGroup: TdxNavBarGroup read GetSelectedGroup; + property SelectedItem: TdxNavBarItem read GetSelectedItem; + property SelectedLink: TdxNavBarItemLink read GetSelectedLink; + property SourceItem: TdxNavBarItem read FSourceItem write FSourceItem; + property SourceLink: TdxNavBarItemLink read FSourceLink write FSourceLink; + property TargetGroup: TdxNavBarGroup read FTargetGroup; + property TargetLink: TdxNavBarItemLink read FTargetLink; + end; + +{ TdxNavBarDsgnWindowLinksHandler } + +function TdxNavBarDsgnWindowLinksHandler.CanAdd: Boolean; +begin + Result := (SelectedItem <> nil) and (SelectedGroup <> nil); +end; + +function TdxNavBarDsgnWindowLinksHandler.CanDelete: Boolean; +begin + Result := SelectedLink <> nil; +end; + +function TdxNavBarDsgnWindowLinksHandler.CanSelectAll: Boolean; +begin + Result := False; +end; + +function TdxNavBarDsgnWindowLinksHandler.CanMoveUp: Boolean; +begin + Result := (SelectedLink <> nil) and (SelectedLink.Index > 0); +end; + +function TdxNavBarDsgnWindowLinksHandler.CanMoveDown: Boolean; +begin + Result := (SelectedLink <> nil) and (SelectedLink.Index < SelectedLink.Group.LinkCount - 1); +end; + +function TdxNavBarDsgnWindowLinksHandler.DesignerCaptionPostfix: string; +begin + Result := sdxLinksDesigner; +end; + +function TdxNavBarDsgnWindowLinksHandler.GetGroupByNode(ANode: TTreeNode): TdxNavBarGroup; +begin + if TObject(ANode.Data) is TdxNavBarGroup then + Result := TdxNavBarGroup(ANode.Data) + else Result := nil; +end; + +function TdxNavBarDsgnWindowLinksHandler.GetLinkByNode(ANode: TTreeNode): TdxNavBarItemLink; +begin + if TObject(ANode.Data) is TdxNavBarItemLink then + Result := TdxNavBarItemLink(ANode.Data) + else Result := nil; +end; + +function TdxNavBarDsgnWindowLinksHandler.GetItemByNode(ANode: TListItem): TdxNavBarItem; +begin + if TObject(ANode.Data) is TdxNavBarItem then + Result := TdxNavBarItem(ANode.Data) + else Result := nil; +end; + +function TdxNavBarDsgnWindowLinksHandler.GetNodeByGroup(AGroup: TdxNavBarGroup): TTreeNode; +var + I: Integer; +begin + Result := nil; + for I := 0 to DsgnWindow.tvLinkDesignerGroups.Items.Count - 1 do + if TObject(DsgnWindow.tvLinkDesignerGroups.Items[I].Data) = AGroup then + begin + Result := DsgnWindow.tvLinkDesignerGroups.Items[I]; + break; + end; +end; + +function TdxNavBarDsgnWindowLinksHandler.GetNodeByLink(ALink: TdxNavBarItemLink): TTreeNode; +var + I: Integer; +begin + Result := nil; + for I := 0 to DsgnWindow.tvLinkDesignerGroups.Items.Count - 1 do + if TObject(DsgnWindow.tvLinkDesignerGroups.Items[I].Data) = ALink then + begin + Result := DsgnWindow.tvLinkDesignerGroups.Items[I]; + break; + end; +end; + +procedure TdxNavBarDsgnWindowLinksHandler.CreateNodeByLink(ALink: TdxNavBarItemLink); +var + ANode: TTreeNode; +begin + ANode := GetNodeByGroup(ALink.Group); + if ANode <> nil then + begin + if ALink.Index = ALink.Group.LinkCount - 1 then + ANode := LinksTV.Items.AddChildObject(ANode, GetItemNodeCaption(ALink.Item), ALink) + else + begin + ANode := GetNodeByLink(ALink.Group.Links[ALink.Index + 1]); + ANode := LinksTV.Items.InsertObject(ANode, GetItemNodeCaption(ALink.Item), ALink); + end; + with ANode do + begin + ImageIndex := 2; + SelectedIndex := 2; + end; + LinksTV.Selected := ANode; + end; +end; + +procedure TdxNavBarDsgnWindowLinksHandler.RemoveNodeByLink(ALink: TdxNavBarItemLink); +var + ANode: TTreeNode; +begin + ANode := GetNodeByLink(ALink); + if ANode <> nil then + LinksTV.Items.Delete(ANode); +end; + +function TdxNavBarDsgnWindowLinksHandler.GetGroupNodeCaption(AGroup: TdxNavBarGroup): string; +begin + Result := AGroup.Caption + ' [' + AGroup.Name + ']'; +end; + +function TdxNavBarDsgnWindowLinksHandler.GetItemNodeCaption(AItem: TdxNavBarItem): string; +begin + Result := AItem.Caption + ' [' + AItem.Name + ']'; +end; + +procedure TdxNavBarDsgnWindowLinksHandler.SetTargetGroupNodeImage(AImageIndex: Integer); +var + ANode: TTreeNode; +begin + if TargetGroup <> nil then + begin + ANode := GetNodeByGroup(TargetGroup); + if ANode <> nil then + with ANode do + begin + ImageIndex := AImageIndex; + SelectedIndex := AImageIndex; + end; + end; +end; + +procedure TdxNavBarDsgnWindowLinksHandler.SetTargetLinkNodeImage(AImageIndex: Integer); +var + ANode: TTreeNode; +begin + if TargetLink <> nil then + begin + ANode := GetNodeByLink(TargetLink); + if ANode <> nil then + with ANode do + begin + ImageIndex := AImageIndex; + SelectedIndex := AImageIndex; + end; + end; +end; + +procedure TdxNavBarDsgnWindowLinksHandler.UpdateTargets(ANode: TTreeNode); +var + AGroup: TdxNavBarGroup; + ALink: TdxNavBarItemLink; +begin + if ANode <> nil then + begin + ALink := GetLinkByNode(ANode); + AGroup := GetGroupByNode(ANode); + end + else + begin + AGroup := nil; + ALink := nil; + end; + if FTargetGroup <> AGroup then + begin + SetTargetGroupNodeImage(1); + FTargetGroup := AGroup; + SetTargetGroupNodeImage(3); + end; + if FTargetLink <> ALink then + begin + SetTargetLinkNodeImage(2); + FTargetLink := ALink; + SetTargetLinkNodeImage(4); + end; +end; + +procedure TdxNavBarDsgnWindowLinksHandler.ClearTargets; +begin + SetTargetGroupNodeImage(1); + SetTargetLinkNodeImage(2); + FTargetGroup := nil; + FTargetLink := nil;; +end; + +procedure TdxNavBarDsgnWindowLinksHandler.Add; +begin + CreateLink(SelectedItem, SelectedGroup, -1); +end; + +procedure TdxNavBarDsgnWindowLinksHandler.Delete; +begin + RemoveLink(SelectedLink); +end; + +procedure TdxNavBarDsgnWindowLinksHandler.ItemDeleted(AItem: TPersistent); +begin + if (AItem <> nil) and (AItem.ClassType = TdxNavBarItemLink) then + RemoveNodeByLink(TdxNavBarItemLink(AItem)); +end; + +procedure TdxNavBarDsgnWindowLinksHandler.MoveSelection(ADelta: Integer); +begin + MoveLink(SelectedLink, SelectedGroup, SelectedLink.Index + ADelta); +end; + +procedure TdxNavBarDsgnWindowLinksHandler.UpdateContent; +begin + if not FLockUpdateContent then + begin + RefreshItemList; + RefreshGroupTreeView; + end; +end; + +function TdxNavBarDsgnWindowLinksHandler.ItemsLV: TListView; +begin + Result := DsgnWindow.lbxLinkDesignerItems; +end; + +function TdxNavBarDsgnWindowLinksHandler.LinksTV: TTreeView; +begin + Result := DsgnWindow.tvLinkDesignerGroups; +end; + +procedure TdxNavBarDsgnWindowLinksHandler.CreateLink(AItem: TdxNavBarItem; AGroup: TdxNavBarGroup; AIndex: Integer); +var + ALink: TdxNavBarItemLink; +begin + DsgnWindow.tvLinkDesignerGroups.Items.BeginUpdate; + try + ALink := AGroup.CreateLink(AItem); + if (AIndex >= 0) and (AIndex < AGroup.LinkCount) then + ALink.Index := AIndex; + CreateNodeByLink(ALink); + finally + DsgnWindow.tvLinkDesignerGroups.FullExpand; + DsgnWindow.tvLinkDesignerGroups.Items.EndUpdate; + end; + FLockUpdateContent := True; + NavBar.DesignerModified; + FLockUpdateContent := False; +end; + +procedure TdxNavBarDsgnWindowLinksHandler.MoveLink(ALink: TdxNavBarItemLink; AGroup: TdxNavBarGroup; AIndex: Integer); +var + AItem: TdxNavBarItem; +begin + AItem := ALink.Item; + RemoveLink(ALink); + CreateLink(AItem, AGroup, AIndex); +end; + +procedure TdxNavBarDsgnWindowLinksHandler.RemoveLink(ALink: TdxNavBarItemLink); +begin + ALink.Group.RemoveLink(ALink.Index); + FLockUpdateContent := True; + NavBar.DesignerModified; + FLockUpdateContent := False; +end; + +procedure TdxNavBarDsgnWindowLinksHandler.RefreshGroupTreeView; +var + I, J: Integer; + Group: TdxNavBarGroup; + Node: TTreeNode; +begin + LinksTV.Items.BeginUpdate; + try + LinksTV.Items.Clear; + if NavBar = nil then Exit; + + for I := 0 to NavBar.Groups.Count - 1 do + begin + Group := NavBar.Groups[I]; + if Group.Owner = NavBar.Owner then + begin + Node := LinksTV.Items.AddObject(nil, GetGroupNodeCaption(Group), Group); + Node.ImageIndex := 1; + Node.SelectedIndex := 1; + for J := 0 to Group.LinkCount - 1 do + begin + with LinksTV.Items.AddChildObject(Node, GetItemNodeCaption(Group.Links[J].Item), Group.Links[J]) do + begin + ImageIndex := 2; + SelectedIndex := 2; + end; + end; + end; + end; + LinksTV.FullExpand; + finally + LinksTV.Items.EndUpdate; + end; +end; + +procedure TdxNavBarDsgnWindowLinksHandler.RefreshItemList; +var + I: Integer; + Item: TdxNavBarItem; +begin + ItemsLV.Items.BeginUpdate; + try + ItemsLV.Items.Clear; + if NavBar = nil then Exit; + + for I := 0 to NavBar.Items.Count - 1 do + begin + Item := NavBar.Items[I]; + if Item.Owner = NavBar.Owner then + with ItemsLV.Items.Add do + begin + Caption := GetItemNodeCaption(Item); + Data := Item; + if Item is TdxNavBarSeparator then + ImageIndex := 5 + else + ImageIndex := 0; + end; + end; + finally + ItemsLV.Items.EndUpdate; + end; +end; + +function TdxNavBarDsgnWindowLinksHandler.GetSelectedGroup: TdxNavBarGroup; +var + ALink: TdxNavBarItemLink; +begin + if LinksTV.Selected <> nil then + begin + Result := GetGroupByNode(LinksTV.Selected); + if Result = nil then + begin + ALink := GetLinkByNode(LinksTV.Selected); + if ALink <> nil then Result := ALink.Group; + end; + end + else Result := nil; +end; + +function TdxNavBarDsgnWindowLinksHandler.GetSelectedItem: TdxNavBarItem; +begin + if ItemsLV.Selected <> nil then + Result := GetItemByNode(ItemsLV.Selected) + else Result := nil; +end; + +function TdxNavBarDsgnWindowLinksHandler.GetSelectedLink: TdxNavBarItemLink; +begin + if LinksTV.Selected <> nil then + Result := GetLinkByNode(LinksTV.Selected) + else Result := nil; +end; + +type + TdxNavBarDsgnWindowViewsHandler = class(TdxNavBarDsgnWindowPageHandler) + protected + function DesignerCaptionPostfix: string; override; + procedure UpdateColorSchemes; + public + procedure UpdateContent; override; + end; + +{ TdxNavBarDsgnWindowViewsHandler } + +function TdxNavBarDsgnWindowViewsHandler.DesignerCaptionPostfix: string; +begin + Result := sdxViewsDesigner; +end; + +procedure TdxNavBarDsgnWindowViewsHandler.UpdateColorSchemes; +var + I, AIndex: Integer; + AColorSchemes: IdxNavBarColorSchemes; + AColorSchemesEnable: Boolean; +begin + DsgnWindow.cbColorScheme.Clear; + AColorSchemesEnable := Supports(NavBar.ViewStyle, IdxNavBarColorSchemes, AColorSchemes) and + (AColorSchemes.GetCount > 1); + DsgnWindow.cbColorScheme.Enabled := AColorSchemesEnable; + DsgnWindow.lblColorScheme.Enabled := AColorSchemesEnable; + if AColorSchemesEnable then + begin + for I := 0 to AColorSchemes.GetCount - 1 do + DsgnWindow.cbColorScheme.Items.Add(AColorSchemes.GetNames(I)); + AIndex := DsgnWindow.cbColorScheme.Items.IndexOf(AColorSchemes.GetName); + end + else + begin + DsgnWindow.cbColorScheme.Items.Add('None'); + AIndex := 0; + end; + DsgnWindow.cbColorScheme.ItemIndex := AIndex; +end; + +procedure TdxNavBarDsgnWindowViewsHandler.UpdateContent; +begin + DsgnWindow.lbxViewStyles.ItemIndex := dxNavBarViewsFactory.IndexOfID(NavBar.View); + DsgnWindow.nbPreview.View := NavBar.View; + DsgnWindow.nbPreview.ViewStyle.Assign(NavBar.ViewStyle); + UpdateColorSchemes; +end; + +type + TdxNavBarDsgnWindowDefaultStylesHandler = class(TdxNavBarDsgnWindowPageHandler) + private + function GetItem(Index: Integer): TdxNavBarDefaultStyle; + function GetItemCount: Integer; + function GetSelected(Index: Integer): Boolean; + procedure SetSelected(Index: Integer; const Value: Boolean); + protected + function DesignerCaptionPostfix: string; override; + function MainList: TListBox; + public + procedure GetSelections(const ASelections: IDesignerSelections); override; + procedure UpdateContent; override; + procedure UpdateSelections(const ASelections: IDesignerSelections); override; + + property Selected[Index: Integer]: Boolean read GetSelected write SetSelected; + property Items[Index: Integer]: TdxNavBarDefaultStyle read GetItem; + property ItemCount: Integer read GetItemCount; + end; + +{ TdxNavBarDsgnWindowDefaultStylesHandler } + +function TdxNavBarDsgnWindowDefaultStylesHandler.DesignerCaptionPostfix: string; +begin + Result := sdxDefaultStylesDesigner; +end; + +function TdxNavBarDsgnWindowDefaultStylesHandler.GetItem( + Index: Integer): TdxNavBarDefaultStyle; +begin + if MainList <> nil then + Result := TdxNavBarDefaultStyle(MainList.Items.Objects[Index]) + else Result := nil; +end; + +function TdxNavBarDsgnWindowDefaultStylesHandler.GetItemCount: Integer; +begin + if MainList <> nil then + Result := MainList.Items.Count + else Result := 0; +end; + +function TdxNavBarDsgnWindowDefaultStylesHandler.GetSelected( + Index: Integer): Boolean; +begin + if MainList <> nil then + Result := MainList.Selected[Index] + else Result := False; +end; + +procedure TdxNavBarDsgnWindowDefaultStylesHandler.GetSelections( + const ASelections: IDesignerSelections); +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + if Selected[I] then + ASelections.Add(dxNavBarDsgnUtils.MakeIPersistent(Items[I])); + if ASelections.Count = 0 then + ASelections.Add(dxNavBarDsgnUtils.MakeIComponent(NavBar)); +end; + +function TdxNavBarDsgnWindowDefaultStylesHandler.MainList: TListBox; +begin + Result := DsgnWindow.lbxDefaultStyles; +end; + +procedure TdxNavBarDsgnWindowDefaultStylesHandler.UpdateContent; +var + PropList: TPropList; + V: Variant; + I: Integer; + AStyle: TdxNavBarDefaultStyle; + ACount: Integer; +begin + if MainList.Items.Count > 0 then exit; + ACount := GetPropList(TypeInfo(TdxNavBarDefaultStyles), [tkClass], @PropList); + for I := 0 to ACount - 1 do + begin + if TdxNavBarDefaultStyle.ClassName = PropList[I].PropType^.Name then + begin + V := GetPropValue(NavBar.DefaultStyles, PropList[I].Name); + //TODO !!!! + AStyle := TdxNavBarDefaultStyle(TVarData(V).VPointer); + MainList.Items.AddObject(PropList[I].Name, AStyle); + end; + end; +end; + +procedure TdxNavBarDsgnWindowDefaultStylesHandler.SetSelected( + Index: Integer; const Value: Boolean); +begin + if MainList <> nil then + MainList.Selected[Index] := Value; +end; + +procedure TdxNavBarDsgnWindowDefaultStylesHandler.UpdateSelections( + const ASelections: IDesignerSelections); + + function InSelection(AItem: TPersistent): Boolean; + var + I: Integer; + begin + Result := False; + for I := 0 to ASelections.Count - 1 do + if AItem = dxNavBarDsgnUtils.TryExtractPersistent(ASelections[I]) then + begin + Result := True; + break; + end; + end; + +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + if Selected[I] xor InSelection(Items[I]) then + Selected[I] := not Selected[I]; +end; + +{ TdxNavBarDsgnWindowPageHandler } + +constructor TdxNavBarDsgnWindowPageHandler.Create(ADsgnWindow: TdxfmNavBarDesignWindow); +begin + inherited Create; + FDsgnWindow := ADsgnWindow; +end; + +destructor TdxNavBarDsgnWindowPageHandler.Destroy; +begin + inherited; +end; + +procedure TdxNavBarDsgnWindowPageHandler.Activate; +begin + UpdateContent; + UpdateActions; +end; + +procedure TdxNavBarDsgnWindowPageHandler.Add(AItemClass: TClass); +begin +end; + +procedure TdxNavBarDsgnWindowPageHandler.Copy; +begin +end; + +procedure TdxNavBarDsgnWindowPageHandler.Cut; +begin +end; + +procedure TdxNavBarDsgnWindowPageHandler.Delete; +begin +end; + +procedure TdxNavBarDsgnWindowPageHandler.ItemDeleted(AItem: TPersistent); +begin +end; + +procedure TdxNavBarDsgnWindowPageHandler.GetSelections(const ASelections: IDesignerSelections); +begin +end; + +procedure TdxNavBarDsgnWindowPageHandler.MoveSelection(ADelta: Integer); +begin +end; + +procedure TdxNavBarDsgnWindowPageHandler.Paste; +begin +end; + +procedure TdxNavBarDsgnWindowPageHandler.UpdateContent; +begin +end; + +procedure TdxNavBarDsgnWindowPageHandler.SelectAll; +begin +end; + +function TdxNavBarDsgnWindowPageHandler.DesignerCaptionPostfix: string; +begin + Result := sdxNavBarDesigner; +end; + +function TdxNavBarDsgnWindowPageHandler.ItemNamePrefix: string; +begin + Result := ''; +end; + +function TdxNavBarDsgnWindowPageHandler.CanAdd: Boolean; +begin + Result := False; +end; + +function TdxNavBarDsgnWindowPageHandler.CanCopy: Boolean; +begin + Result := False; +end; + +function TdxNavBarDsgnWindowPageHandler.CanCut: Boolean; +begin + Result := False; +end; + +function TdxNavBarDsgnWindowPageHandler.CanDelete: Boolean; +begin + Result := False; +end; + +function TdxNavBarDsgnWindowPageHandler.CanSelectAll: Boolean; +begin + Result := False; +end; + +function TdxNavBarDsgnWindowPageHandler.CanMoveUp: Boolean; +begin + Result := False; +end; + +function TdxNavBarDsgnWindowPageHandler.CanMoveDown: Boolean; +begin + Result := False; +end; + +function TdxNavBarDsgnWindowPageHandler.CanPaste: Boolean; +begin + Result := False; +end; + +procedure TdxNavBarDsgnWindowPageHandler.UpdateActions; +begin + DsgnWindow.UpdateActions; +end; + +procedure TdxNavBarDsgnWindowPageHandler.UpdateScrollBar; +begin +end; + +procedure TdxNavBarDsgnWindowPageHandler.UpdateSelections(const ASelections: IDesignerSelections); +begin +end; + +function TdxNavBarDsgnWindowPageHandler.GetNavBar: TdxCustomNavBar; +begin + if DsgnWindow <> nil then + Result := DsgnWindow.NavBar + else Result := nil; +end; + +{ TdxfmNavBarDesignWindow } + +constructor TdxfmNavBarDesignWindow.Create(AOwner: TComponent); + + procedure TramsformImages(ASourceImageList, ADestinationImageList: TcxImageList; ABkColor: TColor; AEnabled: Boolean = True); + var + ABitmap: TcxBitmap; + ABitmap24bit: TcxCustomBitmap; + I: Integer; + begin + ADestinationImageList.Clear; + ABitmap := TcxBitmap.CreateSize(ASourceImageList.Width, ASourceImageList.Height, cxColorToRGBQuad(ABkColor, $FF)); + ABitmap24bit := TcxCustomBitmap.CreateSize(ABitmap.ClientRect, pf24bit); + try + for I := 0 to ASourceImageList.Count - 1 do + begin + ABitmap.Clear; + ASourceImageList.Draw(ABitmap.Canvas, ABitmap.ClientRect, I, True, False, AEnabled); + ABitmap24bit.CopyBitmap(ABitmap); + ADestinationImageList.AddMasked(ABitmap24bit, ABkColor); + end; + finally + ABitmap24bit.Free; + ABitmap.Free; + end; + end; + + procedure PopulateGroupItemMenu; + + function CreateAddMenuItem(AOwner: TComponent; const ACaption: string; AImageIndex: Integer; AClass: TClass): TMenuItem; + begin + Result := TMenuItem.Create(AOwner); + Result.Caption := ACaption; + Result.ImageIndex := AImageIndex; + Result.OnClick := miAdd.OnClick; + Result.Tag := Integer(AClass); + end; + + begin + pmGroupItemClasses.Items.Add(CreateAddMenuItem(pmGroupItemClasses, 'Add Item', 9, TdxNavBarItem)); + pmGroupItemClasses.Items.Add(CreateAddMenuItem(pmGroupItemClasses, 'Add Separator', 10, TdxNavBarSeparator)); + + msiAdd.Add(CreateAddMenuItem(msiAdd, 'Add Item', 9, TdxNavBarItem)); + msiAdd.Add(CreateAddMenuItem(msiAdd, 'Add Separator', 10, TdxNavBarSeparator)); + end; + +var + I: Integer; +begin + inherited; + FHandlers := TList.Create; + InitializeHandlers; + InitializeViewStyles; + + actDelete.Tag := Integer(eaDelete); + actSelectAll.Tag := Integer(eaSelectAll); + actCut.Tag := Integer(eaCut); + actCopy.Tag := Integer(eaCopy); + actPaste.Tag := Integer(eaPaste); + + for I := 0 to pcMain.PageCount - 1 do + pcMain.Pages[I].TabVisible := False; + + PopulateGroupItemMenu; + + ActivatePage(0); + RestoreLayout; + if not IsXPManifestEnabled then + begin + tlbGroups.Images := ilToolBar; + tlbGroups.DisabledImages := ilToolBarDisabled; + tlbItems.Images := ilToolBar; + tlbItems.DisabledImages := ilToolBarDisabled; + tlbLinkDesigner.Images := ilToolBar; + tlbLinkDesigner.DisabledImages := ilToolBarDisabled; + tlbDefaultStyles.Images := ilToolBar; + tlbDefaultStyles.DisabledImages := ilToolBarDisabled; + tlbCustomStyles.Images := ilToolBar; + tlbCustomStyles.DisabledImages := ilToolBarDisabled; + tvLinkDesignerGroups.Images := ilTreeView; + lbxLinkDesignerItems.SmallImages := ilTreeView; + TramsformImages(ilActions, ilToolBar, clBtnFace); + TramsformImages(ilActions, ilToolBarDisabled, clBtnFace, False); + TramsformImages(ilLinkDesigner, ilTreeView, clWindow); + end; +end; + +destructor TdxfmNavBarDesignWindow.Destroy; +begin + FinalizeHandlers; + FHandlers.Free; + StoreLayout; + if NavBarDesigner <> nil then + TdxNavBarDesigner(NavBarDesigner).FDesignWindow := nil; + inherited; +end; + +function TdxfmNavBarDesignWindow.ClipboardComponents: Boolean; +begin + Result := inherited ClipboardComponents; +end; + +{$IFDEF DELPHI6} +function TdxfmNavBarDesignWindow.EditAction(Action: TEditAction): Boolean; +{$ELSE} +procedure TdxfmNavBarDesignWindow.EditAction(Action: TEditAction); +{$ENDIF} +begin +{$IFDEF DELPHI6} + Result := True; +{$ENDIF} + case Action of + eaCut: Cut; + eaCopy: Copy; + eaPaste: Paste; + eaDelete: Delete; + eaSelectAll: SelectAll; + end; +end; + +function TdxfmNavBarDesignWindow.GetEditState: TEditState; +begin + Result := []; + if CanDelete then + Result := Result + [esCanDelete]; + if CanSelectAll then + Result := Result + [esCanSelectAll]; + if CanCut then + Result := Result + [esCanCut]; + if CanCopy then + Result := Result + [esCanCopy]; + if CanPaste then + Result := Result + [esCanPaste]; +end; + +{$IFDEF DELPHI6} +procedure TdxfmNavBarDesignWindow.ItemDeleted(const ADesigner: IDesigner; + Item: TPersistent); +{$ELSE} +procedure TdxfmNavBarDesignWindow.ComponentDeleted(Component: IPersistent); +{$ENDIF} +var + AItem: TPersistent; +begin + inherited; + AItem := dxNavBarDsgnUtils.TryExtractPersistent({$IFDEF DELPHI6}Item{$ELSE}Component{$ENDIF}); + if (NavBar <> nil) and not (csDestroying in NavBar.ComponentState) and + (CurrentHandler <> nil) then + CurrentHandler.ItemDeleted(AItem); +end; + +{$IFDEF DELPHI6} +procedure TdxfmNavBarDesignWindow.ItemsModified(const Designer: IDesigner); +{$ELSE} +procedure TdxfmNavBarDesignWindow.FormModified; +{$ENDIF} +begin + inherited; + if CurrentHandler <> nil then + CurrentHandler.UpdateContent; + UpdateCaption; + UpdateActions; +end; + +{$IFDEF DELPHI6} +procedure TdxfmNavBarDesignWindow.SelectionChanged(const ADesigner: IDesigner; + const ASelection: IDesignerSelections); +{$ELSE} +procedure TdxfmNavBarDesignWindow.SelectionChanged(ASelection: TDesignerSelectionList); +{$ENDIF} +begin + inherited; +{$IFDEF DELPHI6} + if ADesigner = Designer then +{$ENDIF} + UpdateSelections(ASelection); +end; + +procedure TdxfmNavBarDesignWindow.Activated; +var + Selections: IDesignerSelections; +begin + inherited; + if CurrentHandler <> nil then + CurrentHandler.Activate; + Selections := CreateSelectionList; + Designer.GetSelections(Selections); + UpdateSelections(Selections); +end; + +{$IFDEF DELPHI9} +procedure TdxfmNavBarDesignWindow.CreateParams(var Params: TCreateParams); +begin + inherited; + Params.WndParent := Application.MainForm.Handle; +end; +{$ENDIF} + +function TdxfmNavBarDesignWindow.UniqueName(Component: TComponent): string; +var + AItemNamePrefix: string; + AIndex: Integer; +begin + AIndex := Pos(sdxNavBarClassesPrefix, Component.ClassName); + if AIndex > 0 then + AItemNamePrefix := System.Copy(Component.ClassName, AIndex + Length(sdxNavBarClassesPrefix), MaxInt) + else + AItemNamePrefix := CurrentHandler.ItemNamePrefix; + Result := Designer.UniqueName(NavBar.Name + AItemNamePrefix); +end; + +procedure TdxfmNavBarDesignWindow.ActiveDesignerPageChanged; +begin + SelectNavBar; + if pcMain.ActivePage.PageIndex < HandlerCount then + begin + CurrentHandler := Handlers[pcMain.ActivePage.PageIndex]; + if CurrentHandler <> nil then + CurrentHandler.Activate; + UpdateCaption; + end; +end; + +function TdxfmNavBarDesignWindow.GetNavBarDesigner: IcxDesignHelper; +begin + if NavBar <> nil then + Result := TdxCustomNavBarAccess(NavBar).FDesignHelper + else Result := nil; +end; + +procedure TdxfmNavBarDesignWindow.SetNavBar(Value: TdxCustomNavBar); +begin + if FNavBar <> Value then + begin + FNavBar := Value; + if CurrentHandler <> nil then + CurrentHandler.UpdateContent; + UpdateCaption; + UpdateActions; + end; +end; + +procedure TdxfmNavBarDesignWindow.ActivatePage(APageIndex: Integer); +begin + pcMain.ActivePage := pcMain.Pages[APageIndex]; + ActiveDesignerPageChanged; +end; + +function TdxfmNavBarDesignWindow.CanAdd: Boolean; +begin + if CurrentHandler <> nil then + Result := CurrentHandler.CanAdd + else Result := False; +end; + +function TdxfmNavBarDesignWindow.CanCopy: Boolean; +begin + if CurrentHandler <> nil then + Result := CurrentHandler.CanCopy + else Result := False; +end; + +function TdxfmNavBarDesignWindow.CanCut: Boolean; +begin + if CurrentHandler <> nil then + Result := CurrentHandler.CanCut + else Result := False; +end; + +function TdxfmNavBarDesignWindow.CanDelete: Boolean; +begin + if CurrentHandler <> nil then + Result := CurrentHandler.CanDelete + else Result := False; +end; + +function TdxfmNavBarDesignWindow.CanMoveDown: Boolean; +begin + if CurrentHandler <> nil then + Result := CurrentHandler.CanMoveDown + else Result := False; +end; + +function TdxfmNavBarDesignWindow.CanMoveUp: Boolean; +begin + if CurrentHandler <> nil then + Result := CurrentHandler.CanMoveUp + else Result := False; +end; + +function TdxfmNavBarDesignWindow.CanPaste: Boolean; +begin + if CurrentHandler <> nil then + Result := CurrentHandler.CanPaste + else Result := False; +end; + +function TdxfmNavBarDesignWindow.CanSelectAll: Boolean; +begin + if CurrentHandler <> nil then + Result := CurrentHandler.CanSelectAll + else Result := False; +end; + +procedure TdxfmNavBarDesignWindow.Copy; +begin + if CurrentHandler <> nil then + CurrentHandler.Copy; +end; + +procedure TdxfmNavBarDesignWindow.Cut; +begin + if CurrentHandler <> nil then + CurrentHandler.Cut; +end; + +procedure TdxfmNavBarDesignWindow.Delete; +begin + if CurrentHandler <> nil then + CurrentHandler.Delete; +end; + +procedure TdxfmNavBarDesignWindow.HandleException; +begin + Abort; +end; + +function TdxfmNavBarDesignWindow.GetRegistryPath: string; +begin + Result := (BorlandIDEServices as IOTAServices).GetBaseRegistryKey + '\' + + sdxExpressNavBarDesignerLayoutRegPath; +end; + +procedure TdxfmNavBarDesignWindow.Paste; +begin + if CurrentHandler <> nil then + CurrentHandler.Paste; +end; + +procedure TdxfmNavBarDesignWindow.RestoreLayout; +begin + with TRegistry.Create do + try + try + if OpenKey(GetRegistryPath, False) then + begin + if ValueExists(sdxWidth) then + Width := ReadInteger(sdxWidth); + if ValueExists(sdxHeight) then + Height := ReadInteger(sdxHeight); + end; + except + HandleException; + end; + finally + Free; + end; + if CurrentHandler <> nil then + CurrentHandler.UpdateScrollBar; +end; + +procedure TdxfmNavBarDesignWindow.Select(AComponent: TComponent; AddToSelection: Boolean); +var + Selections: IDesignerSelections; +begin + Selections := CreateSelectionList; + if AddToSelection then + Designer.GetSelections(Selections); + Selections.Add(dxNavBarDsgnUtils.MakeIComponent(AComponent)); + Designer.SetSelections(Selections); +end; + +procedure TdxfmNavBarDesignWindow.SelectAll; +begin + if CurrentHandler <> nil then + CurrentHandler.SelectAll; +end; + +procedure TdxfmNavBarDesignWindow.SelectNavBar; +begin + if NavBar <> nil then + Select(NavBar, False); +end; + +procedure TdxfmNavBarDesignWindow.StartWait; +begin + FSaveCursor := Screen.Cursor; + Screen.Cursor := crHourGlass; +end; + +procedure TdxfmNavBarDesignWindow.StopWait; +begin + Screen.Cursor := FSaveCursor; +end; + +procedure TdxfmNavBarDesignWindow.StoreLayout; +begin + with TRegistry.Create do + try + try + if OpenKey(GetRegistryPath, True) then + begin + WriteInteger(sdxWidth, Width); + WriteInteger(sdxHeight, Height); + end; + except + HandleException; + end; + finally + Free; + end; +end; + +procedure TdxfmNavBarDesignWindow.UpdateActions; +begin + actAdd.Enabled := CanAdd; + actDelete.Enabled := CanDelete; + actMoveUp.Enabled := CanMoveUp; + actMoveDown.Enabled := CanMoveDown; + actSelectAll.Enabled := CanSelectAll; + actCut.Enabled := CanCut; + actCopy.Enabled := CanCopy; + actPaste.Enabled := CanPaste; +end; + +procedure TdxfmNavBarDesignWindow.UpdateCaption; +var + APostfix: string; +begin + if (NavBar <> nil) and (NavBar.Owner <> nil) then + begin + if CurrentHandler <> nil then + APostfix := CurrentHandler.DesignerCaptionPostfix + else APostfix := sdxNavBarDesigner; + Caption := Format(sdxDesignerCaption, [NavBar.Owner.Name, NavBar.Name, APostfix]); + end; +end; + +procedure TdxfmNavBarDesignWindow.UpdateSelections(const ASelections: IDesignerSelections); +begin + if (NavBar = nil) or (csDestroying in NavBar.ComponentState) or (ASelections = nil) then exit; + if CurrentHandler <> nil then + CurrentHandler.UpdateSelections(ASelections); + UpdateActions; +end; + +procedure TdxfmNavBarDesignWindow.ListBoxClick(Sender: TObject); +var + Selections: IDesignerSelections; +begin + Selections := CreateSelectionList; + if CurrentHandler <> nil then + CurrentHandler.GetSelections(Selections); + Designer.SetSelections(Selections); +end; + +function TdxfmNavBarDesignWindow.GetHandler(Index: Integer): TdxNavBarDsgnWindowPageHandler; +begin + Result := TdxNavBarDsgnWindowPageHandler(FHandlers.Items[Index]); +end; + +function TdxfmNavBarDesignWindow.GetHandlerCount: Integer; +begin + Result := FHandlers.Count; +end; + +procedure TdxfmNavBarDesignWindow.InitializeHandlers; +begin + FHandlers.Add(TdxNavBarDsgnWindowGroupsHandler.Create(Self)); + FHandlers.Add(TdxNavBarDsgnWindowItemsHandler.Create(Self)); + FHandlers.Add(TdxNavBarDsgnWindowLinksHandler.Create(Self)); + FHandlers.Add(TdxNavBarDsgnWindowViewsHandler.Create(Self)); + FHandlers.Add(TdxNavBarDsgnWindowDefaultStylesHandler.Create(Self)); + FHandlers.Add(TdxNavBarDsgnWindowCustomStylesHandler.Create(Self)); +end; + +procedure TdxfmNavBarDesignWindow.InitializeViewStyles; +var + I: Integer; +begin + for I := 0 to dxNavBarViewsFactory.Count - 1 do + lbxViewStyles.Items.Add(dxNavBarViewsFactory.Names[I]); +end; + +procedure TdxfmNavBarDesignWindow.FinalizeHandlers; +var + I: Integer; +begin + for I := 0 to FHandlers.Count - 1 do + TdxNavBarDsgnWindowPageHandler(FHandlers.Items[I]).Free; + FHandlers.Clear; +end; + +procedure TdxfmNavBarDesignWindow.AddClick(Sender: TObject); +begin + if CurrentHandler <> nil then + CurrentHandler.Add(TClass(TComponent(Sender).Tag)); +end; + +procedure TdxfmNavBarDesignWindow.ActionClick(Sender: TObject); +begin + EditAction(TEditAction(TComponent(Sender).Tag)); +end; + +procedure TdxfmNavBarDesignWindow.MoveUpClick(Sender: TObject); +begin + if CurrentHandler <> nil then + CurrentHandler.MoveSelection(-1); +end; + +procedure TdxfmNavBarDesignWindow.MoveDownClick(Sender: TObject); +begin + if CurrentHandler <> nil then + CurrentHandler.MoveSelection(1); +end; + +procedure TdxfmNavBarDesignWindow.tvLinkDesignerGroupsDragDrop(Sender, + Source: TObject; X, Y: Integer); +var + AGroup: TdxNavBarGroup; + AIndex: Integer; +begin + if CurrentHandler is TdxNavBarDsgnWindowLinksHandler then + with (CurrentHandler as TdxNavBarDsgnWindowLinksHandler) do + begin + SetTargetGroupNodeImage(1); + SetTargetLinkNodeImage(2); + if TargetLink <> nil then + begin + AIndex := TargetLink.Index; + AGroup := TargetLink.Group; + end + else + begin + AIndex := -1; + AGroup := TargetGroup; + end; + if AGroup <> nil then + begin + if SourceItem <> nil then + CreateLink(SourceItem, AGroup, AIndex) + else if SourceLink <> nil then + MoveLink(SourceLink, AGroup, AIndex); + end; + SourceItem := nil; + SourceLink := nil; + ClearTargets; + end; + UpdateActions; +end; + +procedure TdxfmNavBarDesignWindow.tvLinkDesignerGroupsDragOver(Sender, + Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); +begin + if CurrentHandler is TdxNavBarDsgnWindowLinksHandler then + with (CurrentHandler as TdxNavBarDsgnWindowLinksHandler) do + begin + Accept := (SourceLink <> nil) or (SourceItem <> nil); + if Accept then + UpdateTargets(tvLinkDesignerGroups.GetNodeAt(X, Y)); + Accept := Accept and ((TargetGroup <> nil) or (TargetLink <> nil)); + end + else Accept := False; +end; + +procedure TdxfmNavBarDesignWindow.lbxLinkDesignerItemsDragOver(Sender, + Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); +begin + if CurrentHandler is TdxNavBarDsgnWindowLinksHandler then + with (CurrentHandler as TdxNavBarDsgnWindowLinksHandler) do + Accept := (SourceLink <> nil) + else Accept := False +end; + +procedure TdxfmNavBarDesignWindow.lbxLinkDesignerItemsDragDrop(Sender, + Source: TObject; X, Y: Integer); +begin + if CurrentHandler is TdxNavBarDsgnWindowLinksHandler then + with (CurrentHandler as TdxNavBarDsgnWindowLinksHandler) do + begin + RemoveLink(SourceLink); + SourceLink := nil; + end; + UpdateActions; +end; + +procedure TdxfmNavBarDesignWindow.lbxLinkDesignerItemsStartDrag( + Sender: TObject; var DragObject: TDragObject); +begin + if CurrentHandler is TdxNavBarDsgnWindowLinksHandler then + with (CurrentHandler as TdxNavBarDsgnWindowLinksHandler) do + begin + SourceItem := GetItemByNode(lbxLinkDesignerItems.Selected); + if SourceItem = nil then CancelDrag; + end; +end; + +procedure TdxfmNavBarDesignWindow.tvLinkDesignerGroupsStartDrag( + Sender: TObject; var DragObject: TDragObject); +begin + if CurrentHandler is TdxNavBarDsgnWindowLinksHandler then + with (CurrentHandler as TdxNavBarDsgnWindowLinksHandler) do + begin + SourceLink := GetLinkByNode(tvLinkDesignerGroups.Selected); + if SourceLink = nil then CancelDrag; + end; +end; + +procedure TdxfmNavBarDesignWindow.tvLinkDesignerGroupsExit( + Sender: TObject); +begin + if CurrentHandler is TdxNavBarDsgnWindowLinksHandler then + with (CurrentHandler as TdxNavBarDsgnWindowLinksHandler) do ClearTargets; +end; + +procedure TdxfmNavBarDesignWindow.tvLinkDesignerGroupsClick( + Sender: TObject); +begin + UpdateActions; +end; + +procedure TdxfmNavBarDesignWindow.lbxLinkDesignerItemsClick( + Sender: TObject); +begin + UpdateActions; +end; + +procedure TdxfmNavBarDesignWindow.tvLinkDesignerGroupsEndDrag(Sender, + Target: TObject; X, Y: Integer); +begin + if CurrentHandler is TdxNavBarDsgnWindowLinksHandler then + with (CurrentHandler as TdxNavBarDsgnWindowLinksHandler) do ClearTargets; +end; + +procedure TdxfmNavBarDesignWindow.lbxLinkDesignerItemsEndDrag(Sender, + Target: TObject; X, Y: Integer); +begin + if CurrentHandler is TdxNavBarDsgnWindowLinksHandler then + with (CurrentHandler as TdxNavBarDsgnWindowLinksHandler) do ClearTargets; +end; + +procedure TdxfmNavBarDesignWindow.tvLinkDesignerGroupsKeyUp( + Sender: TObject; var Key: Word; Shift: TShiftState); +begin + UpdateActions; +end; + +procedure TdxfmNavBarDesignWindow.nbMainLinkClick(Sender: TObject; + ALink: TdxNavBarItemLink); +begin + if ALink.Item.Index < pcMain.PageCount then + ActivatePage(ALink.Item.Index); +end; + +procedure TdxfmNavBarDesignWindow.DefaultSettingsClick(Sender: TObject); +begin + NavBar.AssignDefaultStyles; + Designer.Modified; +end; + +procedure TdxfmNavBarDesignWindow.lbxViewStylesChange(Sender: TObject); +var + Components: {$IFDEF DELPHI6}IDesignerSelections{$ELSE}TDesignerSelectionList{$ENDIF}; + AView: Integer; +begin + AView := dxNavBarViewsFactory.IDs[(Sender as TListBox).ItemIndex]; + if NavBar.View <> AView then + begin + {$IFDEF DELPHI6} + Components := CreateSelectionList; + {$ELSE} + Components := TDesignerSelectionList.Create; + try + {$ENDIF} + Designer.GetSelections(Components); + Select(nil, False); + nbPreview.View := AView; + NavBar.View := nbPreview.View; + Designer.SetSelections(Components); + {$IFNDEF DELPHI6} + finally + Components.Free; + end; + {$ENDIF} + Designer.Modified; + end; +end; + +procedure TdxfmNavBarDesignWindow.btCancelClick(Sender: TObject); +begin + Close; +end; + +procedure TdxfmNavBarDesignWindow.lbxItemsContextPopup(Sender: TObject; + MousePos: TPoint; var Handled: Boolean); +begin + miAdd.Visible := False; + msiAdd.Visible := True; +end; + +procedure TdxfmNavBarDesignWindow.lbxContextPopup(Sender: TObject; + MousePos: TPoint; var Handled: Boolean); +begin + miAdd.Visible := True; + msiAdd.Visible := False; +end; + +procedure TdxfmNavBarDesignWindow.cbColorSchemeChange(Sender: TObject); +var + AColorSchemes: IdxNavBarColorSchemes; +begin + if Supports(NavBar.ViewStyle, IdxNavBarColorSchemes, AColorSchemes) and + (AColorSchemes.GetCount > 1) then + if AColorSchemes.GetName <> cbColorScheme.Text then + begin + AColorSchemes.SetName(cbColorScheme.Text); + nbPreview.ViewStyle.Assign(NavBar.ViewStyle); + Designer.Modified; + end; +end; + +end. + + + diff --git a/official/x.35/ExpressPageControl 2/Help/cxPageControl.cnt b/official/x.35/ExpressPageControl 2/Help/cxPageControl.cnt new file mode 100644 index 00000000..487c2713 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Help/cxPageControl.cnt @@ -0,0 +1,56 @@ +:Base cxPageControl.hlp +:Title ExpressPageControl Suite +:Index ExpressPageControl Suite=cxPageControl.hlp +1 ExpressPageControl +2 Overview +3 Tab Control=IDH_BC_TabControlOverview +3 Page Control=IDH_BC_PageControlOverview +2 Glossary +3 Tab=IDH_Term_Tab +3 Selected Tab=IDH_Term_SelectedTab +3 Main Tab=IDH_Term_MainTab +3 Tab Caption=IDH_Term_TabCaption +3 Tab Image=IDH_Term_TabImage +3 Tab Panel=IDH_Term_TabPanel +3 Tab Row=IDH_Term_TabRow +3 Page=IDH_Term_Page +3 Navigator Bar=IDH_Term_NavigatorBar +3 Go Dialog=IDH_Term_GoDialog +3 Close Button=IDH_Term_CloseButton +3 Painting Style=IDH_Term_PaintingStyle +3 Buttons Painting Style=IDH_Term_ButtonsPaintingStyle +3 Flat Buttons Painting Style=IDH_Term_FlatButtonsPaintingStyle +3 Tabs Painting Style=IDH_Term_TabsPaintingStyle +3 Flat Painting Style=IDH_Term_FlatPaintingStyle +3 Extra Flat Painting Style=IDH_Term_ExtraFlatPaintingStyle +3 Ultra Flat Painting Style=IDH_Term_UltraFlatPaintingStyle +3 Office11 Painting Style=IDH_Term_Office11PaintingStyle +3 OneNote Painting Style=IDH_Term_OneNotePaintingStyle +3 Slanted Painting Style=IDH_Term_SlantedPaintingStyle +3 XP Painting Style=IDH_Term_XPPaintingStyle +3 Skin Painting Style=IDH_Term_SkinPaintingStyle +2 Quick Start +3 Tab Control=IDH_Tutorial_TabControl +3 Page Control=IDH_Tutorial_PageControl +2 Concepts +3 Tabs Position and Arrangement=IDH_Story_TabsPositionAndArrangement +3 Displaying Images in Tabs=IDH_Story_DisplayingImagesInTabs +3 Navigator Bar Position and Visibility=IDH_Story_NavigatorBarPositionAndVisibility +3 Applying Painting Styles=IDH_Story_ApplyingPaintingStyles +3 Handling Multiple Selections=IDH_Story_HandlingMultiSelections +3 Traversing through Tabs and Pages=IDH_Story_IteratingThroughTabsAndPages +3 Managing the Pages Collection=IDH_Story_ManagingPagesCollection +3 Managing Tabs Collection=IDH_Story_ManagingTabsCollection +3 Custom Painting=IDH_Story_TabsCustomDrawing +2 Task Based Help +3 Using the Tab Control to Display Dataset Records=IDH_TBH_UsingTheTabControlToDisplayDatasetRecords +2 Reference +3 Base Classes +4 TcxCustomTabControl=IDH_Class_TcxCustomTabControl +3 Controls +4 TcxTabControl=IDH_Class_TcxTabControl +4 TcxPageControl=IDH_Class_TcxPageControl +3 Tabs and Pages +4 TcxTab=IDH_Class_TcxTab +4 TcxTabs=IDH_Class_TcxTabs +4 TcxTabSheet=IDH_Class_TcxTabSheet diff --git a/official/x.35/ExpressPageControl 2/Help/cxPageControl.hlp b/official/x.35/ExpressPageControl 2/Help/cxPageControl.hlp new file mode 100644 index 00000000..3dcd07e1 Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Help/cxPageControl.hlp differ diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlC10.bpk b/official/x.35/ExpressPageControl 2/Packages/cxPageControlC10.bpk new file mode 100644 index 00000000..9d3e3925 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/cxPageControlC10.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = cxPageControlC10.bpl +OBJFILES = cxPageControlC10.obj cxPC.obj cxPCConsts.obj cxPCGoDialog.obj cxPCPainters.obj cxPCPaintersFactory.obj +RESFILES = cxPageControlC10.res +MAINSOURCE = cxPageControlC10.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = cxLibraryC10.bpi dxThemeC10.bpi rtl.bpi vcl.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express Cross Platform PageControl by Developer Express Inc." -aa \ + -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlC10.cpp b/official/x.35/ExpressPageControl 2/Packages/cxPageControlC10.cpp new file mode 100644 index 00000000..2916b590 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/cxPageControlC10.cpp @@ -0,0 +1,28 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxPageControlC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEUNIT("cxPC.pas"); +USEUNIT("cxPCConsts.pas"); +USEUNIT("cxPCGoDialog.pas"); +USEUNIT("cxPCPainters.pas"); +USEUNIT("cxPCPaintersFactory.pas"); + +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlC10.res b/official/x.35/ExpressPageControl 2/Packages/cxPageControlC10.res new file mode 100644 index 00000000..e7a70cb6 Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Packages/cxPageControlC10.res differ diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlC11.bpk b/official/x.35/ExpressPageControl 2/Packages/cxPageControlC11.bpk new file mode 100644 index 00000000..8a627cd3 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/cxPageControlC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = cxPageControlC11.bpl +OBJFILES = cxPageControlC11.obj cxPC.obj cxPCConsts.obj cxPCGoDialog.obj cxPCPainters.obj cxPCPaintersFactory.obj +RESFILES = cxPageControlC11.res +MAINSOURCE = cxPageControlC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = cxLibraryC11.bpi dxThemeC11.bpi rtl.bpi vcl.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express Cross Platform PageControl by Developer Express Inc." -aa \ + -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlC11.cpp b/official/x.35/ExpressPageControl 2/Packages/cxPageControlC11.cpp new file mode 100644 index 00000000..93715af4 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/cxPageControlC11.cpp @@ -0,0 +1,28 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxPageControlC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEUNIT("cxPC.pas"); +USEUNIT("cxPCConsts.pas"); +USEUNIT("cxPCGoDialog.pas"); +USEUNIT("cxPCPainters.pas"); +USEUNIT("cxPCPaintersFactory.pas"); + +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlC11.res b/official/x.35/ExpressPageControl 2/Packages/cxPageControlC11.res new file mode 100644 index 00000000..de6e735e Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Packages/cxPageControlC11.res differ diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlC5.bpk b/official/x.35/ExpressPageControl 2/Packages/cxPageControlC5.bpk new file mode 100644 index 00000000..4f332ec8 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/cxPageControlC5.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = cxPageControlC5.bpl +OBJFILES = cxPageControlC5.obj cxPC.obj cxPCConsts.obj cxPCGoDialog.obj cxPCPainters.obj cxPCPaintersFactory.obj +RESFILES = cxPageControlC5.res +MAINSOURCE = cxPageControlC5.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = cxLibraryVCLC5.bpi dxThemeC5.bpi vcl50.bpi +SPARELIBS = vcl50.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express Cross Platform PageControl (VCL Edition) by Developer Express Inc." -aa \ + -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlC5.cpp b/official/x.35/ExpressPageControl 2/Packages/cxPageControlC5.cpp new file mode 100644 index 00000000..226b4938 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/cxPageControlC5.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxPageControlC5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEUNIT("cxPC.pas"); +USEUNIT("cxPCConsts.pas"); +USEUNIT("cxPCGoDialog.pas"); +USEUNIT("cxPCPainters.pas"); +USEUNIT("cxPCPaintersFactory.pas"); + +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlC5.res b/official/x.35/ExpressPageControl 2/Packages/cxPageControlC5.res new file mode 100644 index 00000000..506654ac Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Packages/cxPageControlC5.res differ diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlD10.dpk b/official/x.35/ExpressPageControl 2/Packages/cxPageControlD10.dpk new file mode 100644 index 00000000..9931b4ea --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/cxPageControlD10.dpk @@ -0,0 +1,40 @@ +package cxPageControlD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform PageControl by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxLibraryD10; + +contains + cxPC, + cxPCConsts, + cxPCGoDialog, + cxPCPainters, + cxPCPaintersFactory; + +end. diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlD10.res b/official/x.35/ExpressPageControl 2/Packages/cxPageControlD10.res new file mode 100644 index 00000000..4172eee5 Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Packages/cxPageControlD10.res differ diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlD11.dpk b/official/x.35/ExpressPageControl 2/Packages/cxPageControlD11.dpk new file mode 100644 index 00000000..2806520c --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/cxPageControlD11.dpk @@ -0,0 +1,40 @@ +package cxPageControlD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform PageControl by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxLibraryD11; + +contains + cxPC, + cxPCConsts, + cxPCGoDialog, + cxPCPainters, + cxPCPaintersFactory; + +end. diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlD11.res b/official/x.35/ExpressPageControl 2/Packages/cxPageControlD11.res new file mode 100644 index 00000000..06f715ba Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Packages/cxPageControlD11.res differ diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlD5.dpk b/official/x.35/ExpressPageControl 2/Packages/cxPageControlD5.dpk new file mode 100644 index 00000000..c3f08f0e --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/cxPageControlD5.dpk @@ -0,0 +1,40 @@ +package cxPageControlD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'Express Cross Platform PageControl (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + cxLibraryVCLD5; + +contains + cxPC, + cxPCConsts, + cxPCGoDialog, + cxPCPainters, + cxPCPaintersFactory; + +end. diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlD5.res b/official/x.35/ExpressPageControl 2/Packages/cxPageControlD5.res new file mode 100644 index 00000000..b22b6ecb Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Packages/cxPageControlD5.res differ diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlD9.dpk b/official/x.35/ExpressPageControl 2/Packages/cxPageControlD9.dpk new file mode 100644 index 00000000..1925e1cd --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/cxPageControlD9.dpk @@ -0,0 +1,40 @@ +package cxPageControlD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform PageControl by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxLibraryD9; + +contains + cxPC, + cxPCConsts, + cxPCGoDialog, + cxPCPainters, + cxPCPaintersFactory; + +end. diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlD9.res b/official/x.35/ExpressPageControl 2/Packages/cxPageControlD9.res new file mode 100644 index 00000000..b8e70df9 Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Packages/cxPageControlD9.res differ diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLC6.bpk b/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLC6.bpk new file mode 100644 index 00000000..199f98e9 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLC6.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = cxPageControlVCLC6.bpl +OBJFILES = cxPageControlVCLC6.obj cxPC.obj cxPCConsts.obj cxPCGoDialog.obj cxPCPainters.obj cxPCPaintersFactory.obj +RESFILES = cxPageControlVCLC6.res +MAINSOURCE = cxPageControlVCLC6.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = cxLibraryVCLC6.bpi dxThemeC6.bpi rtl.bpi vcl.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express Cross Platform PageControl (VCL Edition) by Developer Express Inc." -aa \ + -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLC6.cpp b/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLC6.cpp new file mode 100644 index 00000000..1f7b86a2 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLC6.cpp @@ -0,0 +1,28 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxPageControlVCLC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEUNIT("cxPC.pas"); +USEUNIT("cxPCConsts.pas"); +USEUNIT("cxPCGoDialog.pas"); +USEUNIT("cxPCPainters.pas"); +USEUNIT("cxPCPaintersFactory.pas"); + +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLC6.res b/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLC6.res new file mode 100644 index 00000000..5d3a8c03 Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLC6.res differ diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLD6.dpk b/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLD6.dpk new file mode 100644 index 00000000..02e4f207 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLD6.dpk @@ -0,0 +1,40 @@ +package cxPageControlVCLD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform PageControl (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxLibraryVCLD6; + +contains + cxPC, + cxPCConsts, + cxPCGoDialog, + cxPCPainters, + cxPCPaintersFactory; + +end. diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLD6.res b/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLD6.res new file mode 100644 index 00000000..7719910c Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLD6.res differ diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLD7.dpk b/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLD7.dpk new file mode 100644 index 00000000..f98a27e1 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLD7.dpk @@ -0,0 +1,40 @@ +package cxPageControlVCLD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform PageControl (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxLibraryVCLD7; + +contains + cxPC, + cxPCConsts, + cxPCGoDialog, + cxPCPainters, + cxPCPaintersFactory; + +end. diff --git a/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLD7.res b/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLD7.res new file mode 100644 index 00000000..266d3f7d Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Packages/cxPageControlVCLD7.res differ diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC10.bpk b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC10.bpk new file mode 100644 index 00000000..d4c555c2 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC10.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxPageControlC10.bpl +OBJFILES = dclcxPageControlC10.obj cxPCReg.obj +RESFILES = dclcxPageControlC10.res cxPCReg.dcr +MAINSOURCE = dclcxPageControlC10.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = dclcxLibraryC10.bpi cxLibraryC10.bpi dxThemeC10.bpi cxPageControlC10.bpi designide.bpi rtl.bpi vcl.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M -LUdclstd +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express Cross Platform PageControl by Developer Express Inc." -aa \ + -Tpp -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC10.cpp b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC10.cpp new file mode 100644 index 00000000..0db525f6 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC10.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxPageControlC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEPACKAGE("cxPageControlC10.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dclcxLibraryC10.bpi"); +USEUNIT("cxPCReg.pas"); +USERES("cxPCReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC10.res b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC10.res new file mode 100644 index 00000000..90da54d4 Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC10.res differ diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC11.bpk b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC11.bpk new file mode 100644 index 00000000..f396c1bd --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxPageControlC11.bpl +OBJFILES = dclcxPageControlC11.obj cxPCReg.obj +RESFILES = dclcxPageControlC11.res cxPCReg.dcr +MAINSOURCE = dclcxPageControlC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = dclcxLibraryC11.bpi cxLibraryC11.bpi dxThemeC11.bpi cxPageControlC11.bpi designide.bpi rtl.bpi vcl.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M -LUdclstd +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express Cross Platform PageControl by Developer Express Inc." -aa \ + -Tpp -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC11.cpp b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC11.cpp new file mode 100644 index 00000000..33973cec --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC11.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxPageControlC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("cxPageControlC11.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEUNIT("cxPCReg.pas"); +USERES("cxPCReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC11.res b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC11.res new file mode 100644 index 00000000..40fb95d0 Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC11.res differ diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC5.bpk b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC5.bpk new file mode 100644 index 00000000..801f1c15 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC5.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dclcxPageControlC5.bpl +OBJFILES = dclcxPageControlC5.obj cxPCReg.obj +RESFILES = dclcxPageControlC5.res cxPCReg.dcr +MAINSOURCE = dclcxPageControlC5.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = dclcxLibraryVCLC5.bpi cxLibraryVCLC5.bpi dxThemeC5.bpi cxPageControlC5.bpi dsnide50.bpi vcl50.bpi +SPARELIBS = vcl50.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M -LUdclstd50 +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express Cross Platform PageControl (VCL Edition) by Developer Express Inc." -aa \ + -Tpp -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC5.cpp b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC5.cpp new file mode 100644 index 00000000..1a6a38ff --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC5.cpp @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxPageControlC5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEPACKAGE("cxPageControlC5.bpi"); +USEPACKAGE("dsnide50.bpi"); +USEPACKAGE("dclcxLibraryVCLC5.bpi"); +USEUNIT("cxPCReg.pas"); +USERES("cxPCReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC5.res b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC5.res new file mode 100644 index 00000000..a0acb200 Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlC5.res differ diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD10.dpk b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD10.dpk new file mode 100644 index 00000000..75d21a85 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD10.dpk @@ -0,0 +1,39 @@ +package dclcxPageControlD10; + +{$R *.res} +{$R cxPCReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform PageControl by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + cxPageControlD10, + dclcxLibraryD10; + +contains + cxPCReg; + +end. diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD10.res b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD10.res new file mode 100644 index 00000000..b297872d Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD10.res differ diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD11.dpk b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD11.dpk new file mode 100644 index 00000000..69b4c7be --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD11.dpk @@ -0,0 +1,39 @@ +package dclcxPageControlD11; + +{$R *.res} +{$R cxPCReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform PageControl by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + cxPageControlD11, + dclcxLibraryD11; + +contains + cxPCReg; + +end. diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD11.res b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD11.res new file mode 100644 index 00000000..fcb85b1a Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD11.res differ diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD5.dpk b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD5.dpk new file mode 100644 index 00000000..93371133 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD5.dpk @@ -0,0 +1,38 @@ +package dclcxPageControlD5; + +{$R *.RES} +{$R cxPCReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'Express Cross Platform PageControl (VCL Edition) by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + cxPageControlD5, + dclcxLibraryVCLD5; + +contains + cxPCReg; + +end. diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD5.res b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD5.res new file mode 100644 index 00000000..64a0248b Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD5.res differ diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD9.dpk b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD9.dpk new file mode 100644 index 00000000..0a179a74 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD9.dpk @@ -0,0 +1,39 @@ +package dclcxPageControlD9; + +{$R *.res} +{$R cxPCReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform PageControl by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + cxPageControlD9, + dclcxLibraryD9; + +contains + cxPCReg; + +end. diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD9.res b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD9.res new file mode 100644 index 00000000..4d3f1dde Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlD9.res differ diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLC6.bpk b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLC6.bpk new file mode 100644 index 00000000..e8d52ad7 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLC6.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxPageControlVCLC6.bpl +OBJFILES = dclcxPageControlVCLC6.obj cxPCReg.obj +RESFILES = dclcxPageControlVCLC6.res cxPCReg.dcr +MAINSOURCE = dclcxPageControlVCLC6.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = dclcxLibraryVCLC6.bpi cxLibraryVCLC6.bpi dxThemeC6.bpi cxPageControlVCLC6.bpi designide.bpi rtl.bpi vcl.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) \ + -I"$(SEARCHPATH)";$(LIBDIR) -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M -LUdclstd +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express Cross Platform PageControl (VCL Edition) by Developer Express Inc." -aa \ + -Tpp -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLC6.cpp b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLC6.cpp new file mode 100644 index 00000000..089fca35 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLC6.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxPageControlVCLC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEPACKAGE("cxPageControlVCLC6.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dclcxLibraryVCLC6.bpi"); +USEUNIT("cxPCReg.pas"); +USERES("cxPCReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLC6.res b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLC6.res new file mode 100644 index 00000000..2f9b139c Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLC6.res differ diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLD6.dpk b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLD6.dpk new file mode 100644 index 00000000..5b19ce23 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLD6.dpk @@ -0,0 +1,39 @@ +package dclcxPageControlVCLD6; + +{$R *.RES} +{$R cxPCReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'Express Cross Platform PageControl (VCL Edition) by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + cxPageControlVCLD6, + dclcxLibraryVCLD6; + +contains + cxPCReg; + +end. diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLD6.res b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLD6.res new file mode 100644 index 00000000..a60809ca Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLD6.res differ diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLD7.dpk b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLD7.dpk new file mode 100644 index 00000000..c4429160 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLD7.dpk @@ -0,0 +1,39 @@ +package dclcxPageControlVCLD7; + +{$R *.res} +{$R cxPCReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express Cross Platform PageControl (VCL Edition) by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + cxPageControlVCLD7, + dclcxLibraryVCLD7; + +contains + cxPCReg; + +end. diff --git a/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLD7.res b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLD7.res new file mode 100644 index 00000000..db037606 Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Packages/dclcxPageControlVCLD7.res differ diff --git a/official/x.35/ExpressPageControl 2/Sources/cxPC.pas b/official/x.35/ExpressPageControl 2/Sources/cxPC.pas new file mode 100644 index 00000000..383e2b0f --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Sources/cxPC.pas @@ -0,0 +1,7126 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPageControl } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPAGECONTROL AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxPC; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, Classes, Controls, Forms, Graphics, ImgList, + SysUtils, cxClasses, cxControls, cxGraphics, cxLookAndFeels, cxPCGoDialog; + +type + TcxPCRectCorrection = record + dLeft, dTop, dRight, dBottom: Integer; + end; + + TcxPCOption = (pcoAlwaysShowGoDialogButton, pcoCloseButton, + pcoFixedTabWidthWhenRotated, pcoGoDialog, pcoGradient, + pcoGradientClientArea, pcoNoArrows, pcoRedrawOnResize, pcoSort, + pcoTopToBottomText, pcoUsePageColorForTab); + TcxPCOptions = set of TcxPCOption; + +const + cxPCEmptyRectCorrection: TcxPCRectCorrection = + (dLeft: 0; dTop: 0; dRight: 0; dBottom: 0); + + TabsContainerOffset = 2; + TabsContainerBaseWidth = 3; + + cxPCNoStyle = -1; + cxPCDefaultStyle = 0; + cxPCDefaultStyleName = 'Default'; + + cxPCDefaultOptions = [pcoAlwaysShowGoDialogButton, pcoGradient, + pcoGradientClientArea, pcoRedrawOnResize]; + +type + TcxPCStyleID = -1 .. High(Integer); + TcxPCStandardStyle = (tsTabs, tsButtons, tsFlatButtons); + + TcxTabPosition = (tpTop, tpBottom, tpLeft, tpRight); + + TcxTabSlantKind = (skCutCorner, skSlant); + TcxTabSlantPosition = (spLeft, spRight); + TcxTabSlantPositions = set of TcxTabSlantPosition; + + TcxCustomTabControl = class; + TcxTab = class; + TcxTabSheet = class; + + TcxDrawTabEvent = procedure(AControl: TcxCustomTabControl; ATab: TcxTab; + var DefaultDraw: Boolean) of object; + TcxDrawTabExEvent = procedure(AControl: TcxCustomTabControl; ATab: TcxTab; + Font: TFont) of object; + TcxGetTabImageEvent = procedure(Sender: TObject; TabIndex: Integer; + var ImageIndex: Integer) of object; + TcxPageChangingEvent = procedure(Sender: TObject; NewPage: TcxTabSheet; var AllowChange: Boolean) of object; + TcxPCCanCloseEvent = procedure(Sender: TObject; var ACanClose: Boolean) of object; + TcxTabChangedEvent = procedure(Sender: TObject; TabID: Integer) of object; + TcxTabChangingEvent = procedure(Sender: TObject; var AllowChange: Boolean) of object; + + TcxPCNavigatorButton = (nbTopLeft, nbBottomRight, nbGoDialog, nbClose); + TcxPCNavigatorButtons = set of TcxPCNavigatorButton; + TcxPCNavigatorButtonIndex = TcxPCNavigatorButtons; + TcxPCNavigatorButtonState = (nbsNormal, nbsPressed, nbsHotTrack, nbsDisabled); + TcxPCNavigatorPosition = (npLeftTop, npLeftBottom, npRightTop, npRightBottom); + + TcxPCTabsPosition = record + ExtendedTabsRect: TRect; + ExtendedTopOrLeftTabsRectBottomOrRightBorderOffset: Integer; + ExtendedBottomOrRightTabsRectTopOrLeftBorderOffset: Integer; + MinDistanceBetweenTopOrLeftAndBottomOrRightExtendedTabsRects: Integer; + NormalRowWidth: Integer; + NormalTabsRect: TRect; + end; + + TcxPCWOffset = record + Left, Right: Integer; + end; + + TcxPCDistance = record + dw, dh: Integer; + end; + + TcxPCTabPosition = record + TabNormalPosition: TPoint; + TabNormalWidth: Integer; // Height is in TcxTabs + TabRectCorrection: TcxPCRectCorrection; + end; + + TcxPCIndexInterval = record + Left, Right: Integer; + end; + TcxPCLineIndexBoundsArray = array of TcxPCIndexInterval; + + TcxPCTabIndex = Integer; + + TcxPCTabPropertyChanged = (tpcNotSpecified, tpcColor, tpcEnabled, tpcFocused, + tpcHighlighted, tpcHotTrack, tpcIsMainTab, tpcLayout, tpcPressed, + tpcSelected, tpcTracking); + + TcxPCTabNotification = (tnDeleting); + + TcxPCOutTabImageAndTextData = record + TabImageRect: TRect; + TabTextRect: TRect; + TabVisibleIndex: Integer; + end; + + TcxPCImageListRotatedImagesElement = record + BackgroundColor: TColor; + Bitmap: TBitmap; + IsBackgroundColorSpecified: Boolean; + end; + TcxPCImageListRotatedImagesElementArray = + array of TcxPCImageListRotatedImagesElement; + + TcxTabs = class; + TcxTabSlants = class; + + TcxTab = class(TPersistent) + private + FCaption: string; // type of TStrings' item + FColor: TColor; + FEnabled: Boolean; + FHighlighted: Boolean; + FImageIndex: TImageIndex; + FIndex: Integer; + FObject: TObject; + FPaintBitmap: TBitmap; + FRow: Integer; + FSelected: Boolean; + FTabPosition: TcxPCTabPosition; + FTabs: TcxTabs; + FVerticalTextBitmap: TBitmap; + FVisible: Boolean; + FVisibleRow: Integer; + function GetFullRect: TRect; + function GetHotTrack: Boolean; + function GetImageIndex: TImageIndex; + function GetIsMainTab: Boolean; + function GetNormalLongitudinalSize: Integer; + function GetNormalRect: TRect; + function GetPaintingPosition: TcxTabPosition; + function GetPaintingPositionIndex: Integer; + function GetParentControl: TcxCustomTabControl; + function GetPressed: Boolean; + function GetRealEnabled: Boolean; + function GetRealVisible: Boolean; + function GetTracking: Boolean; + function GetVisibleIndex: Integer; + function GetVisibleRect: TRect; + procedure InternalSetCaption(const Value: string); + function IsImageIndexStored: Boolean; + procedure SetCaption(const Value: string); + procedure SetColor(Value: TColor); + procedure SetEnabled(const Value: Boolean); + procedure SetHighlighted(const Value: Boolean); + procedure SetImageIndex(Value: TImageIndex); + procedure SetSelected(const Value: Boolean); + procedure SetVisible(const Value: Boolean); + protected + procedure AssignTo(Dest: TPersistent); override; + procedure Changed(ATabPropertyChanged: TcxPCTabPropertyChanged); + procedure ValidateImageIndex; + property NormalLongitudinalSize: Integer read GetNormalLongitudinalSize; + property ParentControl: TcxCustomTabControl read GetParentControl; + property Tabs: TcxTabs read FTabs; + property VerticalTextBitmap: TBitmap read FVerticalTextBitmap; + public + constructor Create(ATabs: TcxTabs; AIndex: Integer); + destructor Destroy; override; + procedure InitializePaintBitmap; + procedure ResetPaintBitmap; + procedure ResetVerticalTextBitmap; + property FullRect: TRect read GetFullRect; + property HotTrack: Boolean read GetHotTrack; + property Index: Integer read FIndex; + property IsMainTab: Boolean read GetIsMainTab; + property NormalRect: TRect read GetNormalRect; + property PaintBitmap: TBitmap read FPaintBitmap; + property PaintingPosition: TcxTabPosition read GetPaintingPosition; + property PaintingPositionIndex: Integer read GetPaintingPositionIndex; + property Pressed: Boolean read GetPressed; + property RealEnabled: Boolean read GetRealEnabled; + property RealVisible: Boolean read GetRealVisible; + property Tracking: Boolean read GetTracking; + property VisibleIndex: Integer read GetVisibleIndex; + property VisibleRect: TRect read GetVisibleRect; + property VisibleRow: Integer read FVisibleRow; + published + property Caption: string read FCaption write SetCaption; + property Color: TColor read FColor write SetColor default clDefault; + property Enabled: Boolean read FEnabled write SetEnabled default True; + property Highlighted: Boolean read FHighlighted write SetHighlighted; + property ImageIndex: TImageIndex + read GetImageIndex write SetImageIndex stored IsImageIndexStored; + property Selected: Boolean read FSelected write SetSelected; + property Visible: Boolean read FVisible write SetVisible default True; + end; + + TcxTabs = class(TStrings) + private + FNotification: Boolean; + FParent: TcxCustomTabControl; + FTabNormalHeight: Integer; + FTabsItemA: array of TcxTab; + FUpdating: Boolean; + function GetTab(TabIndex: Integer): TcxTab; + function GetVisibleTab(TabVisibleIndex: Integer): TcxTab; + procedure SetTab(Index: Integer; const Value: TcxTab); + function GetVisibleTabsCount: Integer; + protected + function Get(Index: Integer): string; override; + function GetCount: Integer; override; + function GetObject(Index: Integer): TObject; override; + procedure Put(Index: Integer; const S: string); override; + procedure PutObject(Index: Integer; AObject: TObject); override; + procedure Changed(VisibleIndex: Integer = -1; TabPropertyChanged: TcxPCTabPropertyChanged = tpcLayout); + procedure Notify(Index: Integer; Action: TcxPCTabNotification); virtual; + class procedure OutError(SourceMethodName: TCaption; Index: Integer); virtual; + procedure SetHotTrack(VisibleIndex: Integer); + procedure SetMainTab; + procedure SetTracking(NewTracking: Integer); + procedure UpdateTabIndexes(FirstIndex, LastIndex: Integer); + procedure ValidateImageIndexes; + property Parent: TcxCustomTabControl read FParent; + public + constructor Create(AParent: TcxCustomTabControl); + destructor Destroy; override; + procedure Clear; override; + procedure Delete(Index: Integer); override; + procedure Insert(Index: Integer; const S: string); override; + procedure Move(CurIndex, NewIndex: Integer); override; + procedure ResetTabVerticalTextBitmaps; + public + property TabNormalHeight: Integer read FTabNormalHeight; + property Tabs[TabIndex: Integer]: TcxTab read GetTab write SetTab; default; + property VisibleTabsCount: Integer read GetVisibleTabsCount; + property VisibleTabs[TabVisibleIndex: Integer]: TcxTab read GetVisibleTab; + end; + + TcxVisibleTabList = class + private + FParent: TcxCustomTabControl; + TabIndexA: array of TcxPCTabIndex; + function GetCount: Integer; + function GetTab(TabVisibleIndex: Integer): TcxTab; + procedure OutError(SourceMethodName: TCaption; Msg: string); + public + constructor Create(AParent: TcxCustomTabControl); + destructor Destroy; override; + + function FindVisibleTab(TabIndex: TcxPCTabIndex; var TabVisibleIndex: Integer): Boolean; + procedure HideTab(TabIndex: TcxPCTabIndex); + procedure ShowTab(TabIndex: TcxPCTabIndex); + procedure Update; + function TabVisibleIndexOf(TabIndex: TcxPCTabIndex): Integer; + + property Count: Integer read GetCount; + property Tabs[TabVisibleIndex: Integer]: TcxTab read GetTab; default; + end; + + TcxPCPainterParentInfo = class + private + FParent: TcxCustomTabControl; + function GetActivePage: TcxTabSheet; + function GetCanvas: TcxCanvas; + function GetFont: TFont; + function GetIsTabsContainer: Boolean; + function GetTabPosition: TcxTabPosition; + function GetNavigatorPositione: TcxPCNavigatorPosition; + function GetMultiLine: Boolean; + function GetNavigatorButtonState( + Index: TcxPCNavigatorButton): TcxPCNavigatorButtonState; + function GetVisibleTab(TabVisibleIndex: Integer): TcxTab; + function GetTabHeight: Smallint; + function GetTabsOnBothSides: Boolean; + function GetTabWidth: Smallint; + function GetMainTabVisibleIndex: Integer; + function GetOptions: TcxPCOptions; + function GetPageColor(ATabVisibleIndex: Integer): TColor; + function GetPage(ATabVisibleIndex: Integer): TcxTabSheet; + function GetRaggedRight: Boolean; + function GetTabColor(ATabVisibleIndex: Integer): TColor; + function GetTabSlants: TcxTabSlants; + function GetNavigatorButtons: TcxPCNavigatorButtons; + function GetHeight: Integer; + function GetWidth: Integer; + function GetExtendedBottomOrRightTabsRect: TRect; + function GetExtendedTopOrLeftTabsRect: TRect; + function GetRowCount: Integer; + function GetScrollOpposite: Boolean; + function GetTopOrLeftPartRowCount: Integer; + function GetColor: TColor; + function GetHideTabs: Boolean; + function GetShowFrame: Boolean; + function GetRotate: Boolean; + function GetImageBorder: Integer; + protected + property Pages[ATabVisibleIndex: Integer]: TcxTabSheet read GetPage; + public + constructor Create(AParent: TcxCustomTabControl); + property ActivePage: TcxTabSheet read GetActivePage; + property Canvas: TcxCanvas read GetCanvas; + property Color: TColor read GetColor; + property ExtendedBottomOrRightTabsRect: TRect read GetExtendedBottomOrRightTabsRect; + property ExtendedTopOrLeftTabsRect: TRect read GetExtendedTopOrLeftTabsRect; + property Font: TFont read GetFont; + property Height: Integer read GetHeight; + property HideTabs: Boolean read GetHideTabs; + property ImageBorder: Integer read GetImageBorder; + property IsTabsContainer: Boolean read GetIsTabsContainer; + property MainTabVisibleIndex: Integer read GetMainTabVisibleIndex; + property MultiLine: Boolean read GetMultiLine; + property NavigatorButtonsState[Index: TcxPCNavigatorButton]: TcxPCNavigatorButtonState read GetNavigatorButtonState; + property NavigatorButtons: TcxPCNavigatorButtons read GetNavigatorButtons; + property NavigatorPosition: TcxPCNavigatorPosition read GetNavigatorPositione; + property Options: TcxPCOptions read GetOptions; + property PageColors[ATabVisibleIndex: Integer]: TColor read GetPageColor; + property RaggedRight: Boolean read GetRaggedRight; + property Rotate: Boolean read GetRotate; + property RowCount: Integer read GetRowCount; + property ScrollOpposite: Boolean read GetScrollOpposite; + property ShowFrame: Boolean read GetShowFrame; + property TabColors[ATabVisibleIndex: Integer]: TColor read GetTabColor; + property TabHeight: Smallint read GetTabHeight; + property TabPosition: TcxTabPosition read GetTabPosition; + property TabSlants: TcxTabSlants read GetTabSlants; + property TabsOnBothSides: Boolean read GetTabsOnBothSides; + property TabWidth: Smallint read GetTabWidth; + property TopOrLeftPartRowCount: Integer read GetTopOrLeftPartRowCount; + property VisibleTabs[TabVisibleIndex: Integer]: TcxTab read GetVisibleTab; + property Width: Integer read GetWidth; + end; + + TcxPCCustomPainter = class + private + FParentInfo: TcxPCPainterParentInfo; + FParentControl: TcxCustomTabControl; + FSavedClipRgns: TList; + procedure DestroySavedClipRgns; + function GetDisabledTextFaceColor: TColor; + function GetDisabledTextShadowColor: TColor; + function GetHighlightedTabBodyColor: TColor; + procedure PrepareTabControlImagesBitmapBackground(ABitmap: TBitmap); + protected + FOutTabImageAndTextData: TcxPCOutTabImageAndTextData; + class function AllowRotate: Boolean; virtual; + function CalculateTabNormalWidth(Tab: TcxTab): Integer; virtual; abstract; + procedure CorrectTabRect(TabVisibleIndex: Integer; var TabRectCorrection: TcxPCRectCorrection); virtual; + function CreateNewTabVerticalTextBitmap(TabVisibleIndex: Integer): TBitmap; + procedure DirectionalPolyline(const R: TRect; APoints: array of TPoint; + ATabPosition: TcxTabPosition; AColor: TColor); + function DoCustomDraw(TabVisibleIndex: Integer): Boolean; + procedure DrawNativeTabBackground(DC: HDC; ATab: TcxTabSheet); virtual; + procedure DrawTabImageAndText(TabVisibleIndex: Integer); virtual; + procedure ExcludeTabContentClipRegion(ATabVisibleIndex: Integer); + procedure FillDisplayRect; virtual; + procedure FillTabPaneContent; virtual; + function GetButtonsDistance(AButton1, AButton2: TcxPCNavigatorButton): Integer; virtual; + function GetButtonsRegionFromTabsOffset: Integer; virtual; + function GetButtonsRegionHOffset: Integer; virtual; + function GetButtonsRegionWOffset: Integer; virtual; + function GetClientColor: TColor; virtual; + function GetClientRect: TRect; + function GetClientRectOffset: TRect; virtual; + function GetDisplayRect: TRect; + function GetDisplayRectOffset: TRect; virtual; + function GetDrawImageOffset(TabVisibleIndex: Integer): TRect; virtual; abstract; + function GetDrawImageWithoutTextWOffset(TabVisibleIndex: Integer): TcxPCWOffset; virtual; abstract; + function GetDrawTextHOffset(TabVisibleIndex: Integer): TRect; virtual; abstract; + + function GetExtendedRect(const ARect, AExtension: TRect; ATabPosition: TcxTabPosition): TRect; + function GetFrameWidth: Integer; virtual; + + procedure AfterPaintTab(ATabVisibleIndex: Integer); virtual; + function AlwaysColoredTabs: Boolean; virtual; + function GetGoDialogPosition(GoDialogSize: TSize): TPoint; virtual; abstract; + function GetHighlightedTextColor(ATabVisibleIndex: Integer; + ATextColor: TColor): TColor; + function GetHotTrackColor: TColor; + function GetImageTextDistance(ATabVisibleIndex: Integer): Integer; virtual; abstract; + function GetMaxTabCaptionHeight: Integer; + function GetMinTabNormalWidth(ATabVisibleIndex: Integer): Integer; virtual; abstract; + function GetMinTabSelectionDistance: TcxPCDistance; virtual; abstract; + function GetNativeContentOffset: TRect; virtual; + function GetTabBaseImageSize: TSize; + function GetTabBodyColor(TabVisibleIndex: Integer): TColor; virtual; abstract; + function GetTabColor(ATabVisibleIndex: Integer): TColor; virtual; + function GetTabClipRgn(ATabVisibleIndex: Integer): TcxRegion; virtual; + function GetTabClipRgnOperation(ATabVisibleIndex: Integer): TcxRegionOperation; virtual; + function GetTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; virtual; abstract; + procedure GetTabNativePartAndState(ATabVisibleIndex: Integer; + out PartId, StateId: Integer); virtual; + function GetTabNativeState(ATabVisibleIndex: Integer): Integer; + function GetTabRotatedImageSize: TSize; + function GetTabsContainerOffsets: TRect; virtual; + function GetTabsNormalDistance: TcxPCDistance; virtual; + function GetTabsPosition(NavigatorButtons: TcxPCNavigatorButtons): TcxPCTabsPosition; virtual; abstract; + function GetTabVerticalTextBitmap(TabVisibleIndex: Integer): TBitmap; + function GetTextColor(ATabVisibleIndex: Integer): TColor; virtual; + function GetTooNarrowTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; virtual; abstract; + procedure Init; virtual; + procedure InternalDrawText(ACanvas: TCanvas; const ACaption: string; + ARect: TRect; ATabVisibleIndex: Integer); virtual; + procedure InternalInvalidateRect(Rect: TRect); + procedure InternalPaint; virtual; + procedure InternalPolyLine(const APoints: array of TPoint; AColor: TColor; + ACanvas: TCanvas = nil); + procedure InternalPrepareOutTabImageAndTextData(ATabVisibleIndex: Integer; + var AImageRect, ATextRect: TRect); virtual; abstract; + procedure InternalResetClipRegion; + function InternalSetClipRect(ClipR: TRect; IntersectWithCurrentClipRegion: Boolean = True): Boolean; + procedure InvalidateTabExtendedTabsRect(TabVisibleIndex: Integer); + procedure InvalidateTabRect(ATabVisibleIndex: Integer); virtual; + function IsAssignedImages: Boolean; + function IsCustomDraw: Boolean; + function IsEnableHotTrack: Boolean; virtual; + function IsNativePainting: Boolean; virtual; + function IsOverButton(X, Y: Integer; var Button: TcxPCNavigatorButton): Boolean; virtual; abstract; + function IsOverTab(TabVisibleIndex: Integer; X, Y: Integer): Boolean; virtual; + function IsTabHasImage(ATabVisibleIndex: Integer): Boolean; + function IsTabBorderThick(ATabVisibleIndex: Integer): Boolean; virtual; abstract; + function IsTabTransparent(ATabVisibleIndex: Integer): Boolean; virtual; + function NeedDisabledTextShadow: Boolean; virtual; + function NeedRedrawOnResize: Boolean; virtual; + function NeedShowFrame: Boolean; virtual; + procedure Paint; virtual; + procedure PaintButtonsRegion; virtual; abstract; + procedure PaintClientArea; virtual; + procedure PaintFrame; virtual; abstract; + procedure PaintTabsRegion; virtual; abstract; + procedure PrepareTabCanvasFont(ATab: TcxTab; ACanvas: TcxCanvas); + procedure PrepareDrawTabContentBitmapBackground(ABitmap: TBitmap; + const ABitmapPos: TPoint; ATabVisibleIndex: Integer); virtual; + procedure RepaintButton(Button: TcxPCNavigatorButton; OldButtonState: TcxPCNavigatorButtonState); virtual; + procedure RepaintButtonsRegion; virtual; + procedure RepaintTab(TabVisibleIndex: Integer; TabPropertyChanged: TcxPCTabPropertyChanged); virtual; + procedure RestoreClipRgn; + procedure RotatePoint(const R: TRect; var P: TPoint; + ATabPosition: TcxTabPosition); + procedure RotatePolyline(const R: TRect; var APoints: array of TPoint; + ATabPosition: TcxTabPosition); + procedure SaveClipRgn; + procedure StandardPainterPrepareOutTabImageAndTextData(TabVisibleIndex: Integer); + + property DisabledTextFaceColor: TColor read GetDisabledTextFaceColor; + property DisabledTextShadowColor: TColor read GetDisabledTextShadowColor; + property HighlightedTabBodyColor: TColor read GetHighlightedTabBodyColor; + + property ParentControl: TcxCustomTabControl read FParentControl; + property ParentInfo: TcxPCPainterParentInfo read FParentInfo; + public + constructor Create(AParent: TcxCustomTabControl); virtual; + destructor Destroy; override; + + function CalculateTabNormalHeight: Integer; virtual; abstract; + function GetGoDialogButtonBounds: TRect; virtual; abstract; + class function GetStandardStyle: TcxPCStandardStyle; virtual; + class function GetStyleID: TcxPCStyleID; virtual; + class function GetStyleName: TCaption; virtual; + class function HasLookAndFeel(ALookAndFeel: TcxLookAndFeel): Boolean; virtual; + class function IsDefault(ALookAndFeel: TcxLookAndFeel): Boolean; virtual; + class function IsMainTabBoundWithClient: Boolean; virtual; + class function IsMultiSelectionAccepted: Boolean; virtual; + class function IsStandardStyle: Boolean; virtual; + class function IsTabPressable: Boolean; virtual; + end; + + TcxPCPainterClass = class of TcxPCCustomPainter; + + TcxPCImageListPrepareBitmapBackgroundEvent = procedure(ABitmap: TBitmap) of object; + + TcxPCImageList = class + private + FBaseImageChangeLink: TChangeLink; + FBaseImages: TCustomImageList; + FFreeNotificator: TcxFreeNotificator; + FImageRotationAngle: TcxRotationAngle; + FParent: TcxCustomTabControl; + FRotatedImages: TcxPCImageListRotatedImagesElementArray; + FOnChange: TNotifyEvent; + FOnPrepareBitmapBackground: TcxPCImageListPrepareBitmapBackgroundEvent; + procedure BaseImageListChange(Sender: TObject); + procedure Change; + procedure ClearRotatedImages; + procedure DoPrepareBitmapBackground(ABitmap: TBitmap); + procedure FreeNotification(AComponent: TComponent); + class procedure OutError(SourceMethodName, Msg: TCaption); + procedure RotateImage(Index: Integer; BackgroundColor: TColor; Enabled: Boolean); + procedure RotateImages; + procedure SetImageRotationAngle(const Value: TcxRotationAngle); + procedure SetBaseImages(const Value: TCustomImageList); + function GetBaseImageSize: TSize; + function GetRotatedImageSize: TSize; + public + constructor Create(AParent: TcxCustomTabControl); + destructor Destroy; override; + procedure Draw(Canvas: TCanvas; X, Y, Index: Integer; BackgroundColor: TColor; + Enabled: Boolean = True); + + property BaseImages: TCustomImageList read FBaseImages write SetBaseImages; + property BaseImageSize: TSize read GetBaseImageSize; + property ImageRotationAngle: TcxRotationAngle read FImageRotationAngle write SetImageRotationAngle default ra0; + property RotatedImageSize: TSize read GetRotatedImageSize; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + property OnPrepareBitmapBackground: TcxPCImageListPrepareBitmapBackgroundEvent + read FOnPrepareBitmapBackground write FOnPrepareBitmapBackground; + end; + + { TcxTabSlants } + + TcxTabSlants = class(TPersistent) + private + FKind: TcxTabSlantKind; + FOwner: TPersistent; + FPositions: TcxTabSlantPositions; + FOnChange: TNotifyEvent; + procedure Changed; + procedure SetKind(Value: TcxTabSlantKind); + procedure SetPositions(Value: TcxTabSlantPositions); + protected + function GetOwner: TPersistent; override; + public + constructor Create(AOwner: TPersistent); + procedure Assign(Source: TPersistent); override; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + published + property Kind: TcxTabSlantKind read FKind write SetKind default skSlant; + property Positions: TcxTabSlantPositions read FPositions write SetPositions + default [spLeft]; + end; + + { TcxCustomTabControl } + + TcxCustomTabControl = class(TcxControl, IdxSkinSupport) + private + FChangeEventLockCount: Integer; + FClientRect: TRect; + FExtendedBottomOrRightTabsRect: TRect; + FExtendedTopOrLeftTabsRect: TRect; + FFirstVisibleTab, FLastVisibleTab: Integer; + FFocusable: Boolean; + FGoDialog: TcxPCGoDialog; + FHideTabs: Boolean; + FHotTrack: Boolean; + FHotTrackNavigatorButton: TcxPCNavigatorButtonIndex; + FHotTrackTabVisibleIndex: Integer; + FImageBorder: Integer; + FImages: TcxPCImageList; + FIsClientRectLoaded: Boolean; + FIsGoDialogShowing: Boolean; + FIsLastTabFullyVisible: Boolean; + FIsTabsContainer: Boolean; + FMainTabVisibleIndex: Integer; + FMaxRotatedTabWidth: Integer; + FMaxTabCaptionWidth: Integer; + FMultiLine: Boolean; + FMultiSelect: Boolean; + FNavigatorButtons: TcxPCNavigatorButtons; + FNavigatorButtonStates: array[TcxPCNavigatorButton] of TcxPCNavigatorButtonState; + FNavigatorPosition: TcxPCNavigatorPosition; + FOptions: TcxPCOptions; + FOwnerDraw: Boolean; + FPainter: TcxPCCustomPainter; + FPressedNavigatorButton: TcxPCNavigatorButtonIndex; + FPressedTabVisibleIndex: Integer; + FRaggedRight: Boolean; + FRotate: Boolean; + FRowCount: Integer; + FRowHeight: Integer; + FScrollOpposite: Boolean; + FShowFrame: Boolean; + FStyle: TcxPCStyleID; + FTabCaptionAlignment: TAlignment; + FTabIndex: Integer; + FTabPosition: TcxTabPosition; + FTabs: TcxTabs; + FTabSize: TSmallPoint; + FTabSlants: TcxTabSlants; + FTabsPosition: TcxPCTabsPosition; + FTimer: TcxTimer; + FTopOrLeftPartRowCount: Integer; + FTracking: Integer; + FUpdating: Boolean; + FVisibleTabList: TcxVisibleTabList; + FOnCanClose: TcxPCCanCloseEvent; + FOnChange: TNotifyEvent; + FOnChanging: TcxTabChangingEvent; + FOnDrawTab: TcxDrawTabEvent; + FOnDrawTabEx: TcxDrawTabExEvent; + FOnGetImageIndex: TcxGetTabImageEvent; + procedure ArrowButtonClick(NavigatorButton: TcxPCNavigatorButton); + procedure Calculate; + procedure CalculateLongitudinalTabPositions; + procedure CalculateRowHeight; + procedure CalculateRowPositions; + procedure CalculateTabNormalSize(Tab: TcxTab); + procedure CalculateTabNormalSizes; + function CanMouseWheel(const AMouseScreenPos: TPoint): Boolean; + function CanPressButton(AButton: TcxPCNavigatorButton): Boolean; + procedure CloseButtonClick; + procedure CorrectMaxRotatedTabWidth; + procedure CorrectTabRect(TabVisibleIndex: Integer); + procedure CreateGoDialog; + procedure CreateTimer; + procedure DoDrawTabEx(ATabVisibleIndex: Integer; AFont: TFont); + function GetDisplayRect: TRect; + function GetImages: TCustomImageList; + function GetLineWidth(const ALineIndexBoundsA: TcxPCLineIndexBoundsArray; + ALineNumber, ATabsDistance: Integer): Integer; + function GetMainTabIndex: Integer; + function GetMaxRotatedTabWidth: Integer; + function GetNavigatorButton(NavigatorButtonIndex: TcxPCNavigatorButtonIndex): TcxPCNavigatorButton; + function GetNavigatorButtons(OnlyObligatoryButtons: Boolean): TcxPCNavigatorButtons; + function GetOptions: TcxPCOptions; + function GetStyle: TcxPCStyleID; + function GetTabExtendedTabsRect(TabVisibleIndex: Integer): TRect; + function GetTabsTab(TabIndex: Integer): TcxTab; + procedure InitializeLineBoundsA(var ALineIndexBoundsA: TcxPCLineIndexBoundsArray; AFirstIndex, ALastIndex: Integer); + function InternalGetClientRect: TRect; + function InternalGetShiftState: TShiftState; + procedure InternalInvalidateRect(Rect: TRect); + function IsTooSmallControlSize: Boolean; + function PassDesignMouseEvent(X, Y: Integer): Boolean; + procedure PlaceVisibleTabsOnRows(ATabsWidth, ATabsDistance: Integer); + procedure PrepareImagesBitmapBackground(ABitmap: TBitmap); + procedure RearrangeRows; + procedure ReadClientRectBottom(Reader: TReader); + procedure ReadClientRectLeft(Reader: TReader); + procedure ReadClientRectRight(Reader: TReader); + procedure ReadClientRectTop(Reader: TReader); + procedure RepaintTab(TabVisibleIndex: Integer; TabPropertyChanged: TcxPCTabPropertyChanged); + procedure SelectTab(ATabVisibleIndex: Integer; AAddToSelected: Boolean); + procedure SetHideTabs(const Value: Boolean); + procedure SetHotTrack(Value: Boolean); + procedure SetImageBorder(const Value: Integer); + procedure SetImages(const Value: TCustomImageList); + procedure SetIsTabsContainer(Value: Boolean); + procedure SetMaxRotatedTabWidth(Value: Integer); + procedure SetMultiLine(const Value: Boolean); + procedure SetMultiSelect(const Value: Boolean); + procedure SetNavigatorPosition(const Value: TcxPCNavigatorPosition); + procedure SetOptions(Value: TcxPCOptions); + procedure SetOwnerDraw(const Value: Boolean); + procedure SetRaggedRight(const Value: Boolean); + procedure SetRotate(const Value: Boolean); + procedure SetScrollOpposite(const Value: Boolean); + procedure SetShowFrame(const Value: Boolean); + procedure SetStyle(const Value: TcxPCStyleID); + procedure SetTabCaptionAlignment(Value: TAlignment); + procedure SetTabHeight(const Value: Smallint); + procedure SetTabIndex(Value: Integer); + procedure SetTabPosition(const Value: TcxTabPosition); + procedure SetTabs(const Value: TcxTabs); + procedure SetTabSlants(Value: TcxTabSlants); + procedure SetTabsTab(TabIndex: Integer; const Value: TcxTab); + procedure SetTabWidth(const Value: Smallint); + procedure SynchronizeHotTrackStates(Shift: TShiftState); + procedure SynchronizeNavigatorButtons; + procedure SynchronizeTabImagesRotationAngle; + procedure TabSlantsChanged(Sender: TObject); + procedure TimerEventHandler(Sender: TObject); + procedure UpdateButtonsState; + procedure UpdateTabPosition(ANavigatorButtons: TcxPCNavigatorButtons); + procedure WriteClientRectBottom(Writer: TWriter); + procedure WriteClientRectLeft(Writer: TWriter); + procedure WriteClientRectRight(Writer: TWriter); + procedure WriteClientRectTop(Writer: TWriter); + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + procedure WMPrintClient(var Message: TWMPrintClient); message WM_PRINTCLIENT; + procedure CMDesignHitTest(var Message: TCMDesignHitTest); message CM_DESIGNHITTEST; + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + procedure CMDialogKey(var Message: TCMDialogKey); message CM_DIALOGKEY; + procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure CMParentColorChanged(var Message: TMessage); message CM_PARENTCOLORCHANGED; + protected + procedure AdjustClientRect(var Rect: TRect); override; + procedure AfterPaintTab(ACanvas: TcxCanvas; ATab: TcxTab; + AImageAndTextData: TcxPCOutTabImageAndTextData); virtual; + procedure DefineProperties(Filer: TFiler); override; + function DoCanClose: Boolean; virtual; + procedure DoClose; virtual; + function DoMouseWheelDown(Shift: TShiftState; MousePos: + TPoint): Boolean; override; + function DoMouseWheelUp(Shift: TShiftState; MousePos: + TPoint): Boolean; override; + procedure FocusChanged; override; + procedure FontChanged; override; + function HandleDialogChar(Key: Integer): Boolean; virtual; + function HasBackground: Boolean; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure Loaded; override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseLeave(AControl: TControl); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + function NeedsScrollBars: Boolean; override; + procedure Paint; override; + procedure Resize; override; + function CanChange(NewTabIndex: Integer): Boolean; dynamic; + function CanShowTab(TabIndex: Integer): Boolean; virtual; + procedure Change; dynamic; + procedure CorrectFirstVisibleTab(TabVisibleIndex: Integer); + procedure DoShowGoDialog; virtual; + procedure DrawTab(TabIndex: Integer; const Rect: TRect; Active: Boolean); virtual; + function GetActivePage: TcxTabSheet; virtual; + function GetImageIndex(ATabIndex: Integer): Integer; virtual; + function GetPage(ATabIndex: Integer): TcxTabSheet; virtual; + procedure GoDialogClickEventHandler(ATabControlItemIndex: Integer); virtual; + procedure HideGoDialog(ATabControlItemIndex: Integer); + procedure ImageListChange(Sender: TObject); virtual; + function InternalKeyDown(var Key: Word; Shift: TShiftState): Boolean; virtual; + function IsChangeEventLocked: Boolean; + procedure LockChangeEvent(ALock: Boolean); + class procedure OutError(SourceMethodName: TCaption; Msg: TCaption); + procedure PrepareTabCanvasFont(ATab: TcxTab; ACanvas: TcxCanvas); virtual; + procedure RequestLayout; dynamic; + procedure SetDefaultStyle; + procedure SetModified; + procedure ShowGoDialog; + function TabIndexTabMustBeVisible: Boolean; virtual; + procedure UpdateTabImages; + procedure CreateHandle; override; + procedure CreateParams(var Params: TCreateParams); override; + property DisplayRect: TRect read GetDisplayRect; + property FirstVisibleTab: Integer read FFirstVisibleTab write FFirstVisibleTab; + property Focusable: Boolean read FFocusable write FFocusable default True; + property HideTabs: Boolean read FHideTabs write SetHideTabs default False; + property HotTrack: Boolean read FHotTrack write SetHotTrack default False; + property ImageBorder: Integer read FImageBorder write SetImageBorder default 0; + property Images: TCustomImageList read GetImages write SetImages; + property IsTabsContainer: Boolean read FIsTabsContainer + write SetIsTabsContainer default False; + property MainTabIndex: Integer read GetMainTabIndex; + property MaxRotatedTabWidth: Integer read GetMaxRotatedTabWidth + write SetMaxRotatedTabWidth default 0; + property MultiLine: Boolean read FMultiLine write SetMultiLine default False; + property MultiSelect: Boolean read FMultiSelect write SetMultiSelect default False; + property NavigatorPosition: TcxPCNavigatorPosition read FNavigatorPosition + write SetNavigatorPosition default npRightTop; + property Options: TcxPCOptions read GetOptions write SetOptions + default cxPCDefaultOptions; + property OwnerDraw: Boolean read FOwnerDraw write SetOwnerDraw default False; + property RaggedRight: Boolean read FRaggedRight write SetRaggedRight default False; + property Rotate: Boolean read FRotate write SetRotate default False; + property ScrollOpposite: Boolean read FScrollOpposite + write SetScrollOpposite default False; + property ShowFrame: Boolean read FShowFrame write SetShowFrame default False; + property Style: TcxPCStyleID read GetStyle write SetStyle default cxPCDefaultStyle; + property TabCaptionAlignment: TAlignment read FTabCaptionAlignment + write SetTabCaptionAlignment default taCenter; + property TabHeight: Smallint read FTabSize.Y write SetTabHeight default 0; + property TabIndex: Integer read FTabIndex write SetTabIndex default -1; + property TabPosition: TcxTabPosition read FTabPosition write SetTabPosition + default tpTop; + property TabSlants: TcxTabSlants read FTabSlants write SetTabSlants; + property TabsTabs[TabIndex: Integer]: TcxTab read GetTabsTab write SetTabsTab; + property TabWidth: Smallint read FTabSize.X write SetTabWidth default 0; + property VisibleTabList: TcxVisibleTabList read FVisibleTabList; + property OnCanClose: TcxPCCanCloseEvent read FOnCanClose write FOnCanClose; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + property OnChanging: TcxTabChangingEvent read FOnChanging write FOnChanging; + property OnDrawTab: TcxDrawTabEvent read FOnDrawTab write FOnDrawTab; + property OnDrawTabEx: TcxDrawTabExEvent read FOnDrawTabEx write FOnDrawTabEx; + property OnGetImageIndex: TcxGetTabImageEvent read FOnGetImageIndex write FOnGetImageIndex; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function CanFocus: Boolean; override; + function GetOptimalSize: Integer; + procedure GetTabOrderList(List: TList); override; + function IndexOfTabAt(X, Y: Integer): Integer; + procedure ScrollTabs(Delta: Integer); + procedure SetStandardStyle(StandardStyle: TcxPCStandardStyle); + procedure SetStyleByStyleName(StyleName: TCaption); + property LookAndFeel; + property Painter: TcxPCCustomPainter read FPainter; + property ParentBackground; + property RowCount: Integer read FRowCount; + property Tabs: TcxTabs read FTabs write SetTabs; + property TabStop default True; + property TopOrLeftPartRowCount: Integer read FTopOrLeftPartRowCount; + end; + + { TcxPageControl } + + TcxPageControl = class(TcxCustomTabControl) + private + FActivePage: TcxTabSheet; + FActivePageSetting: Boolean; + FNewDockSheet: TcxTabSheet; + FPageInserting: Boolean; + FPages: TList; + FUndockingPage: TcxTabSheet; + FOnPageChanging: TcxPageChangingEvent; + procedure ChangeActivePage(APage: TcxTabSheet); + function GetActivePageIndex: Integer; + function GetDockClientFromPoint(P: TPoint): TControl; + function GetPageCount: Integer; + function GetTabCount: Integer; + procedure InsertPage(APage: TcxTabSheet); + procedure RemovePage(APage: TcxTabSheet); + procedure SetActivePage(APage: TcxTabSheet); + procedure SetActivePageIndex(Value: Integer); + procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; + procedure WMLButtonDblClk(var Message: TWMLButtonDblClk); message WM_LBUTTONDBLCLK; + procedure CMDockNotification(var Message: TCMDockNotification); message CM_DOCKNOTIFICATION; + procedure CMControlChange(var Message: TCMControlChange); message CM_CONTROLCHANGE; + procedure CMUnDockClient(var Message: TCMUnDockClient); message CM_UNDOCKCLIENT; + protected + procedure AlignControls(AControl: TControl; var Rect: TRect); override; + function CanChange(NewTabIndex: Integer): Boolean; override; + function CanFocusOnClick: Boolean; override; + procedure Change; override; + procedure DoAddDockClient(Client: TControl; const ARect: TRect); override; + function DockClient(DockSource: TDragDockObject; + MousePos: TPoint): Integer; virtual; + procedure DoClose; override; + procedure DockOver(Source: TDragDockObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); override; + procedure DoRemoveDockClient(Client: TControl); override; + function GetActivePage: TcxTabSheet; override; + function GetPage(ATabIndex: Integer): TcxTabSheet; override; + procedure GetSiteInfo(Client: TControl; var InfluenceRect: TRect; + MousePos: TPoint; var CanDock: Boolean); override; + procedure ImageListChange(Sender: TObject); override; + procedure Loaded; override; + procedure RequestLayout; override; + procedure SetChildOrder(Child: TComponent; Order: Integer); override; + procedure ShowControl(AControl: TControl); override; + function TabIndexTabMustBeVisible: Boolean; override; + function UndockClient(NewTarget, Client: TControl): Boolean; + virtual; + function DoUnDock(NewTarget: TWinControl; Client: TControl): Boolean; override; + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + function CanChangeActivePage(NewPage: TcxTabSheet): Boolean; dynamic; + procedure ControlChange(Inserting: Boolean; Child: TControl); virtual; + function GetPageFromDockClient(Client: TControl): TcxTabSheet; + procedure PageChange; dynamic; + procedure PageChanging(NewPage: TcxTabSheet; var AllowChange: Boolean); + procedure UpdateActivePage; virtual; + procedure UpdateTab(APage: TcxTabSheet); + procedure UpdateTabs; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function FindNextPage(ACurrentPage: TcxTabSheet; + AGoForward, ACheckTabAccessibility: Boolean): TcxTabSheet; + function FindNextPageEx(ACurrentPage: TcxTabSheet; + AGoForward, ACheckTabAccessibility, ACircular: Boolean): TcxTabSheet; + procedure DockDrop(Source: TDragDockObject; X, Y: Integer); override; + procedure SelectNextPage(GoForward: Boolean; CheckTabVisible: Boolean = True); + property ActivePageIndex: Integer read GetActivePageIndex + write SetActivePageIndex; + property PageCount: Integer read GetPageCount; + property Pages[Index: Integer]: TcxTabSheet read GetPage; + property TabCount: Integer read GetTabCount; + published + property ActivePage: TcxTabSheet read FActivePage write SetActivePage; + property Align; + property Anchors; + property BiDiMode; + property Color; + property Constraints; + property DockSite; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property Focusable; + property Font; + property HideTabs; + property HotTrack; + property ImageBorder; + property Images; + property LookAndFeel; + property MaxRotatedTabWidth; + property MultiLine; + property NavigatorPosition; + property Options; + property OwnerDraw; + property ParentBackground; + property ParentBiDiMode; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property RaggedRight; + property Rotate; + property ScrollOpposite; + property ShowFrame; + property ShowHint; + property Style; + property TabHeight; + property TabOrder; + property TabPosition; + property TabSlants; + property TabWidth; + property Visible; + property OnCanClose; + property OnChange; + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnDockDrop; + property OnDockOver; + property OnDragDrop; + property OnDragOver; + property OnDrawTab; + property OnDrawTabEx; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnGetImageIndex; + property OnGetSiteInfo; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnPageChanging: TcxPageChangingEvent read FOnPageChanging + write FOnPageChanging; + property OnResize; + property OnStartDock; + property OnStartDrag; + property OnUnDock; + end; + + TcxTabSheet = class(TCustomControl) + private + FHighlighted: Boolean; + FImageIndex: TImageIndex; + FPageControl: TcxPageControl; + FTab: TcxTab; + FTabShowing: Boolean; + FTabVisible: Boolean; + FOnHide: TNotifyEvent; + FOnShow: TNotifyEvent; + function GetPageIndex: Integer; + function GetTabIndex: Integer; + procedure InternalColorChanged; + procedure SetHighlighted(const Value: Boolean); + procedure SetImageIndex(const Value: TImageIndex); + procedure SetPageControl(const Value: TcxPageControl); + procedure SetPageIndex(const Value: Integer); + procedure SetTabVisible(const Value: Boolean); + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure WMWindowPosChanged(var Message: TWMWindowPosChanged); message WM_WINDOWPOSCHANGED; + procedure CMColorChanged(var Message: TMessage); message CM_COLORCHANGED; + procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED; + procedure CMParentColorChanged(var Message: TMessage); message CM_PARENTCOLORCHANGED; + procedure CMShowingChanged(var Message: TMessage); message CM_SHOWINGCHANGED; + procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED; + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure DoHide; dynamic; + procedure DoShow; dynamic; + procedure EnabledChanged; dynamic; + procedure PagePropertyChanged; + procedure SetParent(AParent: TWinControl); override; + procedure SetParentPageControl(AParentPageControl: TcxPageControl); virtual; + procedure ShowingChanged; dynamic; + procedure TextChanged; dynamic; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property PageControl: TcxPageControl read FPageControl write SetPageControl; + property TabIndex: Integer read GetTabIndex; + property TabShowing: Boolean read FTabShowing; + published + property BorderWidth; + property Caption; + property Color; + property Constraints; + property DragMode; + property Enabled; + property Font; + property Height stored False; + property Highlighted: Boolean read FHighlighted write SetHighlighted default False; + property ImageIndex: TImageIndex read FImageIndex write SetImageIndex default -1; + property Left stored False; + property PageIndex: Integer read GetPageIndex write SetPageIndex stored False; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property ShowHint; + property TabVisible: Boolean read FTabVisible write SetTabVisible default True; + property Top stored False; + property Visible stored False; + property Width stored False; + property OnClick; +{$IFDEF DELPHI5} + property OnContextPopup; +{$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnHide: TNotifyEvent read FOnHide write FOnHide; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnResize; + property OnShow: TNotifyEvent read FOnShow write FOnShow; + property OnStartDrag; + end; + + { TcxTabControl } + + TcxTabControl = class(TcxCustomTabControl) + public + property DisplayRect; + published + property Align; + property Anchors; + property BiDiMode; + property Color; + property Constraints; + property DockSite; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property Focusable; + property Font; + property HideTabs; + property HotTrack; + property ImageBorder; + property Images; + property LookAndFeel; + property MaxRotatedTabWidth; + property MultiLine; + property MultiSelect; + property NavigatorPosition; + property Options; + property OwnerDraw; + property ParentBackground; + property ParentBiDiMode; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property RaggedRight; + property Rotate; + property ScrollOpposite; + property ShowFrame; + property ShowHint; + property Style; + property TabHeight; + property TabIndex; + property TabOrder; + property TabPosition; + property Tabs; + property TabSlants; + property TabStop; + property TabWidth; + property Visible; + property OnCanClose; + property OnChange; + property OnChanging; + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnDockDrop; + property OnDockOver; + property OnDragDrop; + property OnDragOver; + property OnDrawTab; + property OnDrawTabEx; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnGetImageIndex; + property OnGetSiteInfo; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnResize; + property OnStartDock; + property OnStartDrag; + property OnUnDock; + end; + +procedure CorrectRect(var Rect: TRect; RectCorrection: TcxPCRectCorrection); +function DistanceGetter(const Distance: TcxPCDistance; const LongitudinalDistance: Boolean): Integer; +function GetButtonCount(NavigatorButtons: TcxPCNavigatorButtons): Integer; +function GetTextRotationAngle(TabControl: TcxCustomTabControl): TcxRotationAngle; +procedure InitializeLineBoundsArray(TabControl: TcxCustomTabControl; + var LineIndexBoundsA: TcxPCLineIndexBoundsArray); +procedure InitializeVisibleTabRange(TabControl: TcxCustomTabControl; + var FirstIndex, LastIndex: Integer); +function InternalGetTextRotationAngle(TabControl: TcxCustomTabControl): TcxRotationAngle; +function InternalIsVerticalText(TabControl: TcxCustomTabControl): Boolean; +function IsBottomToTopAlignment(TabControl: TcxCustomTabControl): Boolean; +function IsOneOfButtons(AButton1, AButton2, AButton: TcxPCNavigatorButton): Boolean; +function IsRightToLeftAlignment(TabControl: TcxCustomTabControl): Boolean; +function IsVerticalText(TabControl: TcxCustomTabControl): Boolean; +function PointGetter(const APoint: TPoint; AIsY: Boolean): Longint; +procedure PointSetter(var APoint: TPoint; AIsY: Boolean; AValue: Longint); +procedure RectSetter(var ARect: TRect; AIsLeftTop, AIsY: Boolean; + AValue: Longint); +function RotateRect(const ARect: TRect; ATabPosition: TcxTabPosition): TRect; +function RotateRectBack(const ARect: TRect; ATabPosition: TcxTabPosition): TRect; +function TextSize(ATab: TcxTab; const AText: string; AFont: TFont = nil): TSize; +procedure ValidateRect(var R: TRect); + +function GetPCStyleName(AStyleID: TcxPCStyleID): string; +function PageControlDependsControls: TList; + +var + TabScrollingDelay: Integer = 150; + TabScrollingStartDelay: Integer = 300; + +implementation + +uses + Math, cxPCConsts, cxPCPainters, cxPCPaintersFactory, dxThemeConsts, dxThemeManager, dxUxTheme; + +var + FBackgroundBitmap: TBitmap = nil; + FDependsControls: TList; + IsWin98Or2000: Boolean = False; + +procedure CorrectRect(var Rect: TRect; RectCorrection: TcxPCRectCorrection); +begin + Inc(Rect.Top, RectCorrection.dTop); + Inc(Rect.Bottom, RectCorrection.dBottom); + Inc(Rect.Left, RectCorrection.dLeft); + Inc(Rect.Right, RectCorrection.dRight); +end; + +function DistanceGetter(const Distance: TcxPCDistance; const LongitudinalDistance: Boolean): Integer; +begin + if LongitudinalDistance then + Result := Distance.dw + else + Result := Distance.dh; +end; + +function GetButtonCount(NavigatorButtons: TcxPCNavigatorButtons): Integer; +var + NavigatorButton: TcxPCNavigatorButton; +begin + Result := 0; + for NavigatorButton := Low(TcxPCNavigatorButton) to High(TcxPCNavigatorButton) do + if NavigatorButton in NavigatorButtons then + Inc(Result); +end; + +function GetControlRect(AControl: TControl): TRect; +begin + Result := Rect(0, 0, AControl.Width, AControl.Height); +end; + +function GetTextRotationAngle(TabControl: TcxCustomTabControl): TcxRotationAngle; +begin + if IsVerticalText(TabControl) then + if pcoTopToBottomText in TabControl.Options then + Result := raMinus90 + else + Result := raPlus90 + else + Result := ra0; +end; + +procedure InitializeLineBoundsArray(TabControl: TcxCustomTabControl; var LineIndexBoundsA: TcxPCLineIndexBoundsArray); +var + LineCount, I: Integer; + FirstIndex, LastIndex: Integer; +begin + SetLength(LineIndexBoundsA, TabControl.RowCount); + if TabControl.RowCount = 0 then + Exit; + for LineCount := 0 to TabControl.RowCount - 1 do + LineIndexBoundsA[LineCount].Left := -1; + InitializeVisibleTabRange(TabControl, FirstIndex, LastIndex); + for I := FirstIndex to LastIndex do + with LineIndexBoundsA[TabControl.FVisibleTabList[I].VisibleRow] do + if Left = -1 then + begin + Left := I; + Right := I; + end + else + begin + if I < Left then + Left := I; + if I > Right + then Right := I; + end; +end; + +procedure InitializeVisibleTabRange(TabControl: TcxCustomTabControl; var FirstIndex, + LastIndex: Integer); +begin + if TabControl.MultiLine then + begin + FirstIndex := 0; + LastIndex := TabControl.FVisibleTabList.Count - 1; + end + else + begin + FirstIndex := TabControl.FFirstVisibleTab; + if TabControl.FFirstVisibleTab = -1 then + LastIndex := -2 + else + LastIndex := TabControl.FLastVisibleTab; + end; +end; + +function InternalGetTextRotationAngle(TabControl: TcxCustomTabControl): TcxRotationAngle; +begin + if TabControl.Painter.IsNativePainting then + Result := ra0 + else + Result := GetTextRotationAngle(TabControl); +end; + +function InternalIsVerticalText(TabControl: TcxCustomTabControl): Boolean; +begin + Result := not TabControl.Painter.IsNativePainting and + IsVerticalText(TabControl); +end; + +function InternalGetCursorPos: TPoint; +begin + GetCursorPos(Result); +end; + +function IsBottomToTopAlignment(TabControl: TcxCustomTabControl): Boolean; +begin + with TabControl do + begin + Result := (TabPosition in [tpLeft, tpRight]) and (not Rotate) and + not(pcoTopToBottomText in Options); + end; +end; + +function IsOneOfButtons(AButton1, AButton2, AButton: TcxPCNavigatorButton): Boolean; +begin + Result := (AButton = AButton1) or (AButton = AButton2); +end; + +function IsRightToLeftAlignment(TabControl: TcxCustomTabControl): Boolean; +begin + with TabControl do + begin + Result := (TabPosition in [tpTop, tpBottom]) and Rotate and + (pcoTopToBottomText in Options); + end; +end; + +function IsVerticalText(TabControl: TcxCustomTabControl): Boolean; +begin + with TabControl do + begin + Result := (TabPosition in [tpLeft, tpRight]) and (not Rotate); + Result := Result or (TabPosition in [tpTop, tpBottom]) and Rotate; + end; +end; + +function PointGetter(const APoint: TPoint; AIsY: Boolean): Longint; +begin + if AIsY then + Result := APoint.Y + else + Result := APoint.X; +end; + +procedure PointSetter(var APoint: TPoint; AIsY: Boolean; AValue: Longint); +begin + if AIsY then + APoint.Y := AValue + else + APoint.X := AValue; +end; + +procedure PrepareBitmap(ABitmap: TBitmap; AParametersSource: TcxCanvas; + ASize: TSize; ABackgroundColor: TColor); +begin + ABitmap.Width := ASize.cx; + ABitmap.Height := ASize.cy; + with ABitmap.Canvas do + begin + Font.Assign(AParametersSource.Font); + Pen := AParametersSource.Pen; + + Brush := AParametersSource.Brush; + Brush.Color := ABackgroundColor; + Brush.Style := bsSolid; + FillRect(Rect(0, 0, ABitmap.Width, ABitmap.Height)); + Brush := AParametersSource.Brush; + end; +end; + +procedure RectSetter(var ARect: TRect; AIsLeftTop, AIsY: Boolean; + AValue: Longint); +begin + if AIsLeftTop then + begin + if AIsY then + ARect.Top := AValue + else + ARect.Left := AValue; + end + else + begin + if AIsY then + ARect.Bottom := AValue + else + ARect.Right := AValue; + end; +end; + +procedure RetrieveWindowsVersion; +begin + IsWin98Or2000 := + (Win32Platform = VER_PLATFORM_WIN32_WINDOWS) and (Win32MinorVersion <> 0) or + (Win32Platform = VER_PLATFORM_WIN32_NT) and (Win32MajorVersion = 5); +end; + +function RotateRect(const ARect: TRect; ATabPosition: TcxTabPosition): TRect; +begin + case ATabPosition of + tpLeft: Result := Rect(ARect.Top, ARect.Right, ARect.Bottom, ARect.Left); + tpTop: Result := ARect; + tpRight: Result := Rect(ARect.Bottom, ARect.Left, ARect.Top, ARect.Right); + tpBottom: Result := Rect(ARect.Right, ARect.Bottom, ARect.Left, ARect.Top); + end; +end; + +function RotateRectBack(const ARect: TRect; ATabPosition: TcxTabPosition): TRect; +begin + case ATabPosition of + tpLeft: Result := RotateRect(ARect, tpRight); + tpTop: Result := ARect; + tpRight: Result := RotateRect(ARect, tpLeft); + tpBottom: Result := RotateRect(ARect, tpBottom); + end; +end; + +function TextSize(ATab: TcxTab; const AText: string; AFont: TFont = nil): TSize; +begin + if AFont = nil then + ATab.ParentControl.PrepareTabCanvasFont(ATab, cxScreenCanvas) + else + cxScreenCanvas.Font := AFont; + Result := cxTextSize(cxScreenCanvas.Handle, AText); +end; + +procedure ValidateRect(var R: TRect); +begin + with R do + begin + if Right < Left then + Right := Left; + if Bottom < Top then + Bottom := Top; + end; +end; + +function VerifyImageList(Images: TCustomImageList): Boolean; +begin + Result := (Images <> nil) and (Images.Count > 0); +end; + +function GetPCStyleName(AStyleID: TcxPCStyleID): string; +var + APainterClass: TcxPCPainterClass; +begin + if AStyleID = cxPCDefaultStyle then + Result := cxPCDefaultStyleName + else + begin + APainterClass := PaintersFactory.GetPainterClass(AStyleID); + if APainterClass = nil then + Result := '' + else + Result := APainterClass.GetStyleName; + end; +end; + +function PageControlDependsControls: TList; +begin + Result := FDependsControls; +end; + +{ TcxTabSlants } + +constructor TcxTabSlants.Create(AOwner: TPersistent); +begin + inherited Create; + FOwner := AOwner; + FKind := skSlant; + FPositions := [spLeft]; +end; + +procedure TcxTabSlants.Assign(Source: TPersistent); +begin + if Source is TcxTabSlants then + begin + Kind := TcxTabSlants(Source).Kind; + Positions := TcxTabSlants(Source).Positions; + end + else + inherited Assign(Source); +end; + +function TcxTabSlants.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +procedure TcxTabSlants.Changed; +begin + if Assigned(FOnChange) then + FOnChange(Self); +end; + +procedure TcxTabSlants.SetKind(Value: TcxTabSlantKind); +begin + if Value <> FKind then + begin + FKind := Value; + Changed; + end; +end; + +procedure TcxTabSlants.SetPositions(Value: TcxTabSlantPositions); +begin + if Value <> FPositions then + begin + FPositions := Value; + Changed; + end; +end; + +procedure TcxCustomTabControl.ArrowButtonClick( + NavigatorButton: TcxPCNavigatorButton); +var + SpecialAlignment: Boolean; + Direction: Integer; +begin + if FNavigatorButtonStates[NavigatorButton] = nbsDisabled then Exit; + SpecialAlignment := IsRightToLeftAlignment(Self) or IsBottomToTopAlignment(Self); + if (SpecialAlignment and (NavigatorButton = nbTopLeft)) or + ((not SpecialAlignment) and (NavigatorButton = nbBottomRight)) then + Direction := 1 + else + Direction := -1; + Inc(FFirstVisibleTab, Direction); + RequestLayout; +end; + +procedure TcxCustomTabControl.Calculate; + +var + cTabsDistance: Integer; // c - longitudinal coordinate + + function InitializeVariables: Boolean; + begin + FNavigatorButtons := []; + SynchronizeNavigatorButtons; + FTabsPosition := FPainter.GetTabsPosition([]); + Result := FTabsPosition.NormalRowWidth > 0; + if not Result then Exit; + cTabsDistance := DistanceGetter(FPainter.GetTabsNormalDistance, not Rotate{along "c" axis}); + end; + + procedure MultiLineCalculate; + begin + if not InitializeVariables then Exit; + + PlaceVisibleTabsOnRows(FTabsPosition.NormalRowWidth, cTabsDistance); + CalculateLongitudinalTabPositions; + CalculateRowHeight; + RearrangeRows; + end; + + procedure NotMultiLineCalculate; + + procedure SetTabRows; + var + FirstIndex, LastIndex, I: Integer; + begin + InitializeVisibleTabRange(Self, FirstIndex, LastIndex); + for I := FirstIndex to LastIndex do + with FVisibleTabList[I] do + begin + FRow := 0; + FVisibleRow := 0; + end; + end; + + begin + FRowCount := 1; + if TabPosition in [tpTop, tpLeft] then FTopOrLeftPartRowCount := 1 + else FTopOrLeftPartRowCount := 0; + CalculateLongitudinalTabPositions; + if IsTooSmallControlSize then Exit; + SetTabRows; + CalculateRowHeight; + CalculateRowPositions; + end; + + procedure ResetControlInternalVariables; + var + VisibleTabCount: Integer; + + procedure ValidateTabVisibleIndex(var TabVisibleIndex: Integer); + begin + if TabVisibleIndex >= VisibleTabCount then + TabVisibleIndex := -1; + end; + + begin + VisibleTabCount := FVisibleTabList.Count; + + FExtendedBottomOrRightTabsRect := cxEmptyRect; + FExtendedTopOrLeftTabsRect := cxEmptyRect; + + if (FFirstVisibleTab = -1) and (VisibleTabCount > 0) then + FFirstVisibleTab := 0; + if FFirstVisibleTab >= VisibleTabCount then + FFirstVisibleTab := VisibleTabCount - 1; + FLastVisibleTab := FFirstVisibleTab; + + ValidateTabVisibleIndex(FHotTrackTabVisibleIndex); + ValidateTabVisibleIndex(FMainTabVisibleIndex); + ValidateTabVisibleIndex(FPressedTabVisibleIndex); + + FRowCount := 0; + + if FTabIndex >= Tabs.Count then + FTabIndex := Tabs.Count - 1; + + FTopOrLeftPartRowCount := 0; + end; + +begin + ResetControlInternalVariables; + if FVisibleTabList.Count = 0 then + begin + InitializeVariables; + Exit; + end; + CalculateTabNormalSizes; + if MultiLine then MultiLineCalculate else NotMultiLineCalculate; +end; + +procedure TcxCustomTabControl.CalculateLongitudinalTabPositions; + + procedure InternalCalculateLongitudinalTabPositions( + AFirstIndex, ALastIndex: Integer; ACalculateAll: Boolean = False; Row: Integer = 0); + var + I: Integer; + ALineStartPosition, ALineFinishPosition: Integer; + ATabStartPosition, ATabFinishPosition, ATabWidth: Integer; + ADistanceBetweenTabs: Integer; + AIsY: Boolean; + ASign: Integer; + begin + AIsY := TabPosition in [tpLeft, tpRight]; + ALineStartPosition := PointGetter(FTabsPosition.NormalTabsRect.TopLeft, AIsY); + ASign := 1; + if IsRightToLeftAlignment(Self) or IsBottomToTopAlignment(Self) then + begin + ALineFinishPosition := -ALineStartPosition; + Inc(ALineStartPosition, FTabsPosition.NormalRowWidth - 1); + ASign := -1; + end + else + ALineFinishPosition := ALineStartPosition + FTabsPosition.NormalRowWidth - 1; + ADistanceBetweenTabs := DistanceGetter(FPainter.GetTabsNormalDistance, not Rotate); + + ATabStartPosition := ALineStartPosition; + ATabFinishPosition := ATabStartPosition; + for I := AFirstIndex to ALastIndex do + begin + FLastVisibleTab := I; + ATabWidth := FVisibleTabList[I].NormalLongitudinalSize; + ATabFinishPosition := ATabStartPosition + (ATabWidth - 1) * ASign; + with FVisibleTabList[I] do + if ASign > 0 then + PointSetter(FTabPosition.TabNormalPosition, AIsY, ATabStartPosition) + else + PointSetter(FTabPosition.TabNormalPosition, AIsY, ATabFinishPosition); + + ATabStartPosition := ATabFinishPosition + (1 + ADistanceBetweenTabs) * ASign; + if (ATabStartPosition * ASign > ALineFinishPosition) and (not ACalculateAll) then + Break; + end; + FIsLastTabFullyVisible := (ATabFinishPosition * ASign <= ALineFinishPosition) + and (FLastVisibleTab = ALastIndex); + end; + + procedure NotMultiLineCalculateLongitudinalTabPositions; + var + APrevFirstVisibleTab: Integer; + begin + APrevFirstVisibleTab := FFirstVisibleTab; + FFirstVisibleTab := 0; + + UpdateTabPosition(GetNavigatorButtons(True)); + if IsTooSmallControlSize then Exit; + InternalCalculateLongitudinalTabPositions(FFirstVisibleTab, FVisibleTabList.Count - 1, True); + + if not FIsLastTabFullyVisible then + begin + FFirstVisibleTab := APrevFirstVisibleTab; + + UpdateTabPosition(GetNavigatorButtons(False)); + if IsTooSmallControlSize then Exit; + + InternalCalculateLongitudinalTabPositions(FFirstVisibleTab, FVisibleTabList.Count - 1); + + if FIsLastTabFullyVisible then + while FFirstVisibleTab > 0 do + begin + Dec(FFirstVisibleTab); + InternalCalculateLongitudinalTabPositions(FFirstVisibleTab, FVisibleTabList.Count - 1); + if not FIsLastTabFullyVisible then + begin + Inc(FFirstVisibleTab); + InternalCalculateLongitudinalTabPositions(FFirstVisibleTab, FVisibleTabList.Count - 1); + Break; + end; + end; + end; + SynchronizeNavigatorButtons; + UpdateButtonsState; + end; + + procedure MultiLineCalculateLongitudinalTabPositions; + var + LineFreeSpaceWidth, LineFreeSpaceWidthRest, TotalTabsNormalWidth: Integer; + LineIndexBoundsA: TcxPCLineIndexBoundsArray; + + procedure StretchTabWidths(Row: Integer); + var + I: Integer; + dTabNormalWidth: Integer; + begin + LineFreeSpaceWidthRest := LineFreeSpaceWidth; + for I := LineIndexBoundsA[Row].Left to LineIndexBoundsA[Row].Right do + begin + with FVisibleTabList[I].FTabPosition do + begin + if I = LineIndexBoundsA[Row].Right then + dTabNormalWidth := LineFreeSpaceWidthRest + else + dTabNormalWidth := TabNormalWidth * LineFreeSpaceWidth div TotalTabsNormalWidth; + Dec(LineFreeSpaceWidthRest, dTabNormalWidth); + end; + with FVisibleTabList[I] do + Inc(FTabPosition.TabNormalWidth, dTabNormalWidth); + end; + end; + + var + Row: Integer; + ToStretchTabs: Boolean; + ADistanceBetweenTabs: Integer; + begin + UpdateTabPosition([]); + if IsTooSmallControlSize then Exit; + InitializeLineBoundsA(LineIndexBoundsA, 0, FVisibleTabList.Count - 1); + ToStretchTabs := not(Rotate or RaggedRight); + ADistanceBetweenTabs := DistanceGetter(FPainter.GetTabsNormalDistance, not Rotate); + for Row := 0 to RowCount - 1 do + begin + if ToStretchTabs then + begin + TotalTabsNormalWidth := GetLineWidth(LineIndexBoundsA, Row, 0); + LineFreeSpaceWidth := FTabsPosition.NormalRowWidth - GetLineWidth(LineIndexBoundsA, Row, ADistanceBetweenTabs); + if LineFreeSpaceWidth > 0 then StretchTabWidths(Row); + end; + InternalCalculateLongitudinalTabPositions(LineIndexBoundsA[Row].Left, LineIndexBoundsA[Row].Right, False, Row); + end; + end; + + procedure SetLongitudinalExtendedTabsRectsBounds; + begin + if TabPosition in [tpTop, tpBottom] then + begin + with FExtendedBottomOrRightTabsRect, FTabsPosition do + begin + Left := ExtendedTabsRect.Left; + Right := ExtendedTabsRect.Right; + end; + with FExtendedTopOrLeftTabsRect, FTabsPosition do + begin + Left := ExtendedTabsRect.Left; + Right := ExtendedTabsRect.Right; + end; + end else + begin + with FExtendedBottomOrRightTabsRect, FTabsPosition do + begin + Top := ExtendedTabsRect.Top; + Bottom := ExtendedTabsRect.Bottom; + end; + with FExtendedTopOrLeftTabsRect, FTabsPosition do + begin + Top := ExtendedTabsRect.Top; + Bottom := ExtendedTabsRect.Bottom; + end; + end; + end; + +begin + if FVisibleTabList.Count = 0 then + Exit; + if FRowCount > 1(*MultiLine*) then + MultiLineCalculateLongitudinalTabPositions + else + NotMultiLineCalculateLongitudinalTabPositions; + if not IsTooSmallControlSize then SetLongitudinalExtendedTabsRectsBounds; +end; + +procedure TcxCustomTabControl.CalculateRowHeight; + + function GetMaxWidthTabVisibleIndex: Integer; + var + AFirstIndex, ALastIndex, AMaxTabWidth, I: Integer; + begin + Result := -1; + AMaxTabWidth := 0; + if pcoFixedTabWidthWhenRotated in Options then + begin + AFirstIndex := 0; + ALastIndex := FVisibleTabList.Count - 1; + end + else + InitializeVisibleTabRange(Self, AFirstIndex, ALastIndex); + for I := AFirstIndex to ALastIndex do + with FVisibleTabList[I].FTabPosition do + if TabNormalWidth > AMaxTabWidth then + begin + AMaxTabWidth := TabNormalWidth; + Result := I; + end; + end; + +var + AMaxWidthTabVisibleIndex: Integer; + ATab: TcxTab; +begin + if Rotate then + begin + AMaxWidthTabVisibleIndex := GetMaxWidthTabVisibleIndex; + if AMaxWidthTabVisibleIndex <> -1 then + begin + ATab := FVisibleTabList[AMaxWidthTabVisibleIndex]; + FMaxTabCaptionWidth := TextSize(ATab, ATab.Caption).cx; + FRowHeight := ATab.FTabPosition.TabNormalWidth; + end + else + begin + FMaxTabCaptionWidth := 0; + FRowHeight := 0; + end; + if (MaxRotatedTabWidth > 0) and + (MaxRotatedTabWidth >= FPainter.GetMinTabNormalWidth(-1)) and + (FRowHeight > MaxRotatedTabWidth) then + FRowHeight := MaxRotatedTabWidth; + end + else + FRowHeight := Tabs.FTabNormalHeight; +end; + +procedure TcxCustomTabControl.CalculateRowPositions; +var + // c - diametrical coordinate + cNormalTopBorder, cNormalBottomBorder: Integer; + cExtendedTopBorder, cExtendedBottomBorder: Integer; + cTabsDistance: Integer; + cIsY: Boolean; + + procedure InitializeVariables; + begin + cTabsDistance := DistanceGetter(FPainter.GetTabsNormalDistance, Rotate); + cIsY := TabPosition in [tpTop, tpBottom]; + with FTabsPosition.NormalTabsRect do + begin + cNormalTopBorder := PointGetter(TopLeft, cIsY); + cNormalBottomBorder := PointGetter(BottomRight, cIsY); + end; + with FTabsPosition.ExtendedTabsRect do + begin + cExtendedTopBorder := PointGetter(TopLeft, cIsY); + cExtendedBottomBorder := PointGetter(BottomRight, cIsY); + end; + end; + + procedure SetDiametricalExtendedTabsRectsBorders; + + procedure SetInternalBorders; + var + Border: Integer; + BottomOrRightPartRowCount: Integer; + begin + with FTabsPosition do + begin +// ExtendedTopOrLeftTabsRectBottomOrRightBorder + Border := cNormalTopBorder + FTopOrLeftPartRowCount * (FRowHeight + cTabsDistance); + Dec(Border, cTabsDistance); + Inc(Border, ExtendedTopOrLeftTabsRectBottomOrRightBorderOffset); + + if Border > cExtendedBottomBorder then Border := cExtendedBottomBorder; + RectSetter(FExtendedTopOrLeftTabsRect, False, cIsY, Border); + +// ExtendedBottomOrRightTabsRectTopOrLeftBorder + BottomOrRightPartRowCount := RowCount - FTopOrLeftPartRowCount; + Border := cNormalBottomBorder - BottomOrRightPartRowCount * (FRowHeight + cTabsDistance); + Inc(Border, cTabsDistance); + Inc(Border, ExtendedBottomOrRightTabsRectTopOrLeftBorderOffset); + + if Border < cExtendedTopBorder then Border := cExtendedTopBorder; + RectSetter(FExtendedBottomOrRightTabsRect, True, cIsY, Border); + end; + end; + + procedure CorrectSecondaryBorder; + var + SecondaryBorderBound: Integer; + begin + if TabPosition in [tpTop, tpLeft] then + begin + SecondaryBorderBound := PointGetter(FExtendedTopOrLeftTabsRect.BottomRight, cIsY) + FTabsPosition.MinDistanceBetweenTopOrLeftAndBottomOrRightExtendedTabsRects; + SecondaryBorderBound := Min(SecondaryBorderBound, cExtendedBottomBorder); + if PointGetter(FExtendedBottomOrRightTabsRect.TopLeft, cIsY) < SecondaryBorderBound then + RectSetter(FExtendedBottomOrRightTabsRect, True, cIsY, SecondaryBorderBound); + end + else + begin + SecondaryBorderBound := PointGetter(FExtendedBottomOrRightTabsRect.TopLeft, cIsY) - FTabsPosition.MinDistanceBetweenTopOrLeftAndBottomOrRightExtendedTabsRects; + SecondaryBorderBound := Max(SecondaryBorderBound, cExtendedTopBorder); + if PointGetter(FExtendedTopOrLeftTabsRect.BottomRight, cIsY) > SecondaryBorderBound then + RectSetter(FExtendedTopOrLeftTabsRect, False, cIsY, SecondaryBorderBound); + end; + end; + + begin + RectSetter(FExtendedTopOrLeftTabsRect, True, cIsY, cExtendedTopBorder); + RectSetter(FExtendedBottomOrRightTabsRect, False, cIsY, cExtendedBottomBorder); + SetInternalBorders; + if (FTopOrLeftPartRowCount <> 0) and (FTopOrLeftPartRowCount <> FRowCount) then + CorrectSecondaryBorder; + end; + +var + I: Integer; + c: Integer; +begin + InitializeVariables; + for I := 0 to FVisibleTabList.Count - 1 do + with FVisibleTabList[I] do + begin + if FVisibleRow < FTopOrLeftPartRowCount then + c := cNormalTopBorder + FVisibleRow * (FRowHeight + cTabsDistance) + else + begin + c := cNormalBottomBorder - (RowCount - FVisibleRow) * FRowHeight; + Dec(c, (RowCount - 1 - FVisibleRow) * cTabsDistance); + end; + PointSetter(FTabPosition.TabNormalPosition, cIsY, c); + end; + SetDiametricalExtendedTabsRectsBorders; +end; + +procedure TcxCustomTabControl.CalculateTabNormalSize(Tab: TcxTab); +begin + Tab.FTabPosition.TabNormalWidth := FPainter.CalculateTabNormalWidth(Tab); +end; + +procedure TcxCustomTabControl.CalculateTabNormalSizes; +var + I: Integer; + Tab: TcxTab; +begin + if Tabs.Count = 0 then + OutError('CalculateTabNormalSizes', scxPCTabCountEqualsZero); + Tabs.FTabNormalHeight := FPainter.CalculateTabNormalHeight; + for I := 0 to Tabs.Count - 1 do + begin + Tab := TabsTabs[I]; + if Tab.Visible then + Tab.FTabPosition.TabNormalWidth := FPainter.CalculateTabNormalWidth(Tab) + else + Tab.FTabPosition.TabNormalWidth := 0; + end; +end; + +function TcxCustomTabControl.CanMouseWheel(const AMouseScreenPos: TPoint): Boolean; +var + R: TRect; +begin + Result := False; + if not MultiLine and (FFirstVisibleTab >= 0) then + begin + R := FVisibleTabList[FFirstVisibleTab].FullRect; + with ScreenToClient(AMouseScreenPos) do + if (TabPosition in [tpTop, tpBottom]) and (Y >= R.Top) and (Y < R.Bottom) or + (TabPosition in [tpLeft, tpRight]) and (X >= R.Left) and (X < R.Right) then + Result := True; + end; +end; + +function TcxCustomTabControl.CanPressButton(AButton: TcxPCNavigatorButton): Boolean; +var + SpecialAlignment: Boolean; +begin + Result := True; + case AButton of + nbTopLeft, nbBottomRight: + begin + SpecialAlignment := IsRightToLeftAlignment(Self) or IsBottomToTopAlignment(Self); + if (SpecialAlignment and (AButton = nbTopLeft)) or + ((not SpecialAlignment) and (AButton = nbBottomRight)) then + Result := (FLastVisibleTab < FVisibleTabList.Count - 1) or + not FIsLastTabFullyVisible and (FLastVisibleTab <> FFirstVisibleTab) + else + Result := FFirstVisibleTab > 0; + end; + nbClose: + Result := FMainTabVisibleIndex >= 0; + end; +end; + +procedure TcxCustomTabControl.CloseButtonClick; +begin + if DoCanClose then + DoClose; +end; + +procedure TcxCustomTabControl.CorrectMaxRotatedTabWidth; +var + AMinTabNormalWidth: Integer; +begin + if FMaxRotatedTabWidth > 0 then + begin + AMinTabNormalWidth := FPainter.GetMinTabNormalWidth(-1); + if FMaxRotatedTabWidth < AMinTabNormalWidth then + FMaxRotatedTabWidth := AMinTabNormalWidth; + end; +end; + +procedure TcxCustomTabControl.CorrectTabRect(TabVisibleIndex: Integer); +begin + with FVisibleTabList[TabVisibleIndex] do + FPainter.CorrectTabRect(TabVisibleIndex, FTabPosition.TabRectCorrection); +end; + +procedure TcxCustomTabControl.CreateGoDialog; +begin + if not IsDesigning then + begin + FGoDialog := TcxPCGoDialog.Create(Self); + FGoDialog.OnClick := GoDialogClickEventHandler; + end; +end; + +procedure TcxCustomTabControl.CreateTimer; +begin + if FTimer = nil then + begin + FTimer := TcxTimer.Create(Self); + FTimer.OnTimer := TimerEventHandler; + end; + FTimer.Interval := TabScrollingStartDelay; + FTimer.Enabled := True; +end; + +function TcxCustomTabControl.GetDisplayRect: TRect; +begin + Result := FPainter.GetClientRect; +end; + +function TcxCustomTabControl.GetImages: TCustomImageList; +begin + Result := FImages.BaseImages; +end; + +function TcxCustomTabControl.GetLineWidth( + const ALineIndexBoundsA: TcxPCLineIndexBoundsArray; + ALineNumber, ATabsDistance: Integer): Integer; +var + I: Integer; +begin + Result := 0; + with ALineIndexBoundsA[ALineNumber] do + begin + for I := Left to Right do + Inc(Result, FVisibleTabList[I].NormalLongitudinalSize); + Inc(Result, (Right - Left) * ATabsDistance); + end; +end; + +function TcxCustomTabControl.GetMainTabIndex: Integer; +begin + Result := -1; + if FMainTabVisibleIndex <> -1 then + Result := FVisibleTabList[FMainTabVisibleIndex].Index; +end; + +function TcxCustomTabControl.GetMaxRotatedTabWidth: Integer; +begin + CorrectMaxRotatedTabWidth; + Result := FMaxRotatedTabWidth; +end; + +function TcxCustomTabControl.GetNavigatorButton( + NavigatorButtonIndex: TcxPCNavigatorButtonIndex): TcxPCNavigatorButton; +var + FirstNavigatorButton, LastNavigatorButton, NavigatorButton: TcxPCNavigatorButton; +begin + Result := Low(TcxPCNavigatorButton); + FirstNavigatorButton := Low(TcxPCNavigatorButton); + LastNavigatorButton := High(NavigatorButton); + for NavigatorButton := FirstNavigatorButton to LastNavigatorButton do + if NavigatorButton in NavigatorButtonIndex then + begin + Result := NavigatorButton; + Break; + end; +end; + +function TcxCustomTabControl.GetNavigatorButtons(OnlyObligatoryButtons: Boolean): TcxPCNavigatorButtons; +begin + Result := []; + if (pcoCloseButton in Options) and not MultiLine then + Include(Result, nbClose); + if not OnlyObligatoryButtons and not (pcoNoArrows in Options) then + Result := Result + [nbTopLeft, nbBottomRight]; + if (pcoGoDialog in Options) and + (not OnlyObligatoryButtons or (pcoAlwaysShowGoDialogButton in Options)) then + Include(Result, nbGoDialog); +end; + +function TcxCustomTabControl.GetOptions: TcxPCOptions; +begin + Result := FOptions; +end; + +function TcxCustomTabControl.GetStyle: TcxPCStyleID; +begin + Result := FStyle; +end; + +function TcxCustomTabControl.GetTabExtendedTabsRect(TabVisibleIndex: Integer): TRect; +begin + if FVisibleTabList[TabVisibleIndex].VisibleRow < TopOrLeftPartRowCount then + Result := FExtendedTopOrLeftTabsRect + else + Result := FExtendedBottomOrRightTabsRect +end; + +function TcxCustomTabControl.GetTabsTab(TabIndex: Integer): TcxTab; +begin + Result := Tabs.Tabs[TabIndex]; +end; + +procedure TcxCustomTabControl.InitializeLineBoundsA(var ALineIndexBoundsA: TcxPCLineIndexBoundsArray; AFirstIndex, ALastIndex: Integer); +var + I, ALineIndex: Integer; + AFirstRow, ARowCount: Integer; +begin + AFirstRow := FVisibleTabList[AFirstIndex].FRow; + ARowCount := FVisibleTabList[ALastIndex].FRow - AFirstRow + 1; + SetLength(ALineIndexBoundsA, ARowCount); + ALineIndex := 0; + ALineIndexBoundsA[0].Left := AFirstIndex; + for I := AFirstIndex to ALastIndex do + if FVisibleTabList[I].FRow - AFirstRow > ALineIndex then + begin + ALineIndexBoundsA[ALineIndex].Right := I - 1; + Inc(ALineIndex); + ALineIndexBoundsA[ALineIndex].Left := I; + end; + ALineIndexBoundsA[ALineIndex].Right := ALastIndex; +end; + +function TcxCustomTabControl.InternalGetClientRect: TRect; +begin + if IsLoading then + if FIsClientRectLoaded then + Result := FClientRect + else + Result := GetControlRect(Self) + else + begin + Result := DisplayRect; + ValidateRect(Result); + end; +end; + +function TcxCustomTabControl.InternalGetShiftState: TShiftState; +var + AKeyState: TKeyBoardState; +begin + GetKeyboardState(AKeyState); + Result := KeyboardStateToShiftState(AKeyState); +end; + +procedure TcxCustomTabControl.InternalInvalidateRect(Rect: TRect); +begin + InvalidateRect(Rect, False); +end; + +function TcxCustomTabControl.IsTooSmallControlSize: Boolean; +begin + Result := FTabsPosition.NormalRowWidth <= 0; +end; + +function TcxCustomTabControl.PassDesignMouseEvent(X, Y: Integer): Boolean; +var + NavigatorButton: TcxPCNavigatorButton; + PressedTabVisibleIndex: Integer; +begin + Result := FPainter.IsOverButton(X, Y, NavigatorButton) and not (NavigatorButton in [nbGoDialog, nbClose]); + if not Result then + begin + PressedTabVisibleIndex := IndexOfTabAt(X, Y); + Result := (PressedTabVisibleIndex <> -1) and (PressedTabVisibleIndex <> FMainTabVisibleIndex); + end; +end; + +procedure TcxCustomTabControl.PlaceVisibleTabsOnRows(ATabsWidth, ATabsDistance: Integer); + + procedure InternalImproveTabsLayout(var ALineBoundsA: TcxPCLineIndexBoundsArray); + + function Deviation(const ALineBoundsA: TcxPCLineIndexBoundsArray; ALineIndex: Integer): Double; + begin + Result := Power(ATabsWidth - GetLineWidth(ALineBoundsA, ALineIndex, ATabsDistance), 2); + end; + + function TotalDeviation(const ALineBoundsA: TcxPCLineIndexBoundsArray): Double; + var + I: Integer; + begin + Result := 0; + for I := 0 to Length(ALineBoundsA) - 1 do + Result := Result + Deviation(ALineBoundsA, I); + end; + + procedure CopyBounds(var ASource, ADestination: TcxPCLineIndexBoundsArray); + var + I: Integer; + begin + if Length(ASource) <> Length(ADestination) then + SetLength(ADestination, Length(ASource)); + for I := 0 to Length(ASource) - 1 do + ADestination[I] := ASource[I]; + end; + + function DoBest(var ALineBoundsA: TcxPCLineIndexBoundsArray; ALineIndex: Integer; ADirection: Integer): Boolean; + + procedure DoChange(var ALineBoundsA: TcxPCLineIndexBoundsArray; ALineIndex: Integer); + begin + case ADirection of + -1: + if ALineIndex > 0 then + begin + Dec(ALineBoundsA[ALineIndex].Left); + Dec(ALineBoundsA[ALineIndex - 1].Right); + end; + 1: + if ALineIndex < Length(ALineBoundsA) - 1 then + begin + Inc(ALineBoundsA[ALineIndex].Right); + Inc(ALineBoundsA[ALineIndex + 1].Left); + end; + end; + end; + + var + APrevError, ANewError: Double; + ATempLineBoundsA: TcxPCLineIndexBoundsArray; + begin + CopyBounds(ALineBoundsA, ATempLineBoundsA); + APrevError := Deviation(ATempLineBoundsA, ALineIndex); + + DoChange(ATempLineBoundsA, ALineIndex); + + ANewError := Deviation(ATempLineBoundsA, ALineIndex); + Result := (ANewError < APrevError) and (GetLineWidth(ATempLineBoundsA, ALineIndex, ATabsDistance) <= ATabsWidth); + if Result then + CopyBounds(ATempLineBoundsA, ALineBoundsA); + end; + + function DoComplexBest(ACurrentError: Double; var ALineBoundsA: TcxPCLineIndexBoundsArray): Boolean; + var + I: Integer; + ATempLineBoundsA: TcxPCLineIndexBoundsArray; + APrevDeviation: Double; + begin + Result := False; + CopyBounds(ALineBoundsA, ATempLineBoundsA); + for I := Length(ATempLineBoundsA) - 1 downto 0 do + begin + repeat + APrevDeviation := TotalDeviation(ATempLineBoundsA); + until not DoBest(ATempLineBoundsA, I, -1) or (APrevDeviation < TotalDeviation(ATempLineBoundsA)); + + if TotalDeviation(ATempLineBoundsA) < ACurrentError then + begin + Result := True; + CopyBounds(ATempLineBoundsA, ALineBoundsA); + Break; + end; + end; + end; + + function DoSimpleBest(var ALineBoundsA: TcxPCLineIndexBoundsArray; ADirection: Integer): Boolean; + var + I: Integer; + ATempLineBoundsA: TcxPCLineIndexBoundsArray; + ACurrentError: Double; + begin + Result := False; + ACurrentError := TotalDeviation(ALineBoundsA); + for I := 0 to Length(ALineBoundsA) - 1 do + begin + CopyBounds(ALineBoundsA, ATempLineBoundsA); + DoBest(ATempLineBoundsA, I, ADirection); + if TotalDeviation(ATempLineBoundsA) < ACurrentError then + begin + Result := True; + CopyBounds(ATempLineBoundsA, ALineBoundsA); + Break; + end; + end; + end; + + function DoTotalBest(var ALineBoundsA: TcxPCLineIndexBoundsArray): Boolean; + var + ACurrentError: Double; + begin + ACurrentError := TotalDeviation(ALineBoundsA); + Result := DoComplexBest(ACurrentError, ALineBoundsA) or + DoSimpleBest(ALineBoundsA, 1) or + DoSimpleBest(ALineBoundsA, -1); + end; + + begin + while DoTotalBest(ALineBoundsA) do {loop}; + end; + + procedure AcceptImprovements(const ALineBoundsA: TcxPCLineIndexBoundsArray); + var + I, ARow, ACurrentRow: Integer; + begin + ACurrentRow := FVisibleTabList[ALineBoundsA[0].Left].FRow; + for ARow := 0 to Length(ALineBoundsA) - 1 do + begin + for I := ALineBoundsA[ARow].Left to ALineBoundsA[ARow].Right do + FVisibleTabList[I].FRow := ACurrentRow; + Inc(ACurrentRow); + end; + end; + + procedure ImproveTabsLayout(AFirstIndex, ALastIndex: Integer); + var + ALineIndexBoundsA: TcxPCLineIndexBoundsArray; + begin + if Rotate and RaggedRight then Exit; + InitializeLineBoundsA(ALineIndexBoundsA, AFirstIndex, ALastIndex); + InternalImproveTabsLayout(ALineIndexBoundsA); + AcceptImprovements(ALineIndexBoundsA); + end; + +var + FirstIndex: Integer; + c: Integer; + Count, I: Integer; +begin + Count := FVisibleTabList.Count; + FRowCount := 1; + FirstIndex := 0; + c := 0; + for I := 0 to Count - 1 do + begin + if FVisibleTabList[I].NormalLongitudinalSize >= ATabsWidth then + begin + if c <> 0 then + begin + Inc(FRowCount); + c := 0; + end; + if (I > FirstIndex{guarantees that FVisibleTabList[FirstIndex].FRow had been set}) and + ((FRowCount - 1) - FVisibleTabList[FirstIndex].FRow > 1) then + ImproveTabsLayout(FirstIndex, I - 1); + FirstIndex := I + 1; + if (not Rotate) and (ATabsWidth > FPainter.GetMinTabNormalWidth(I)) then + with FVisibleTabList[I] do + FTabPosition.TabNormalWidth := ATabsWidth; + FVisibleTabList[I].FRow := FRowCount - 1; + if I <> Count - 1 then Inc(FRowCount); + end else + if c + FVisibleTabList[I].NormalLongitudinalSize > ATabsWidth then + begin + Inc(FRowCount); + FVisibleTabList[I].FRow := FRowCount - 1; + c := FVisibleTabList[I].NormalLongitudinalSize + ATabsDistance; + end else + begin + FVisibleTabList[I].FRow := FRowCount - 1; + Inc(c, FVisibleTabList[I].NormalLongitudinalSize + ATabsDistance); + end; + end; + if (Count - 1 > FirstIndex) and ((FRowCount - 1) - FVisibleTabList[FirstIndex].FRow > 0) then + ImproveTabsLayout(FirstIndex, Count - 1); +end; + +procedure TcxCustomTabControl.PrepareImagesBitmapBackground(ABitmap: TBitmap); +begin + Painter.PrepareTabControlImagesBitmapBackground(ABitmap); +end; + +procedure TcxCustomTabControl.RearrangeRows; + + function IsRowNumbersCorrectionNeeded: Boolean; + begin + if TabPosition in [tpBottom, tpTop] then + begin + Result := Rotate and not(pcoTopToBottomText in Options); + if TabPosition = tpBottom then Result := not Result; + end else + begin + Result := (not Rotate) and (pcoTopToBottomText in Options); + if TabPosition = tpRight then Result := not Result; + end; + end; + + // tpTop: top to bottom + // tpLeft: left to right + // tpRight: right to left + // tpBottom: bottom to top + procedure ConvertRowNumbersToNumbersRelativeToTabPosition; + var + I: Integer; + begin + if IsRowNumbersCorrectionNeeded then + for I := 0 to FVisibleTabList.Count - 1 do + with FVisibleTabList[I] do + FVisibleRow := RowCount - 1 - FRow + else + for I := 0 to FVisibleTabList.Count - 1 do + with FVisibleTabList[I] do + FVisibleRow := FRow; + end; + + procedure ConvertRelativeNumbersToConvenientNumbers; + var + I: Integer; + begin + if TabPosition in [tpRight, tpBottom] then + begin + for I := 0 to FVisibleTabList.Count - 1 do + with FVisibleTabList[I] do + FVisibleRow := RowCount - 1 - FVisibleRow; + FTopOrLeftPartRowCount := FRowCount - FTopOrLeftPartRowCount; + end + end; + +var + I: Integer; + dRow: Integer; + RelativeTopPartRowCount: Integer; +begin + ConvertRowNumbersToNumbersRelativeToTabPosition; + RelativeTopPartRowCount := RowCount; + + if FMainTabVisibleIndex <> -1 then + if ScrollOpposite then + RelativeTopPartRowCount := FVisibleTabList[FMainTabVisibleIndex].FVisibleRow + 1 + else + if FPainter.IsMainTabBoundWithClient then + begin + dRow := RowCount - 1 - FVisibleTabList[FMainTabVisibleIndex].FVisibleRow; + for I := 0 to FVisibleTabList.Count - 1 do + with FVisibleTabList[I] do + if RowCount = 0 then + FVisibleRow := 0 + else + FVisibleRow := (FVisibleRow + dRow) mod RowCount; + end; + + FTopOrLeftPartRowCount := RelativeTopPartRowCount; + ConvertRelativeNumbersToConvenientNumbers; + CalculateRowPositions; +end; + +procedure TcxCustomTabControl.ReadClientRectBottom(Reader: TReader); +begin + FClientRect.Bottom := Reader.ReadInteger; +end; + +procedure TcxCustomTabControl.ReadClientRectLeft(Reader: TReader); +begin + FClientRect.Left := Reader.ReadInteger; +end; + +procedure TcxCustomTabControl.ReadClientRectRight(Reader: TReader); +begin + FClientRect.Right := Reader.ReadInteger; +end; + +procedure TcxCustomTabControl.ReadClientRectTop(Reader: TReader); +begin + FClientRect.Top := Reader.ReadInteger; + FIsClientRectLoaded := True; +end; + +procedure TcxCustomTabControl.RepaintTab(TabVisibleIndex: Integer; TabPropertyChanged: TcxPCTabPropertyChanged); +begin + FPainter.RepaintTab(TabVisibleIndex, TabPropertyChanged); +end; + +procedure TcxCustomTabControl.SelectTab(ATabVisibleIndex: Integer; AAddToSelected: Boolean); +var + ALink: TcxObjectLink; +begin + ALink := cxAddObjectLink(Self); + try + if MultiSelect and FPainter.IsMultiSelectionAccepted and AAddToSelected then + begin + if ATabVisibleIndex = FMainTabVisibleIndex then + TabIndex := -1 + else + FVisibleTabList[ATabVisibleIndex].Selected := not FVisibleTabList[ATabVisibleIndex].Selected; + end + else + begin + TabIndex := FVisibleTabList[ATabVisibleIndex].Index; + if ALink.Ref <> nil then + SetModified; + end; + finally + cxRemoveObjectLink(ALink); + end; +end; + +procedure TcxCustomTabControl.SetHideTabs(const Value: Boolean); +begin + if Value <> FHideTabs then + begin + FHideTabs := Value; + Invalidate; + Realign; + end; +end; + +procedure TcxCustomTabControl.SetHotTrack(Value: Boolean); +begin + if Value <> FHotTrack then + begin + FHotTrack := Value; + SynchronizeHotTrackStates(InternalGetShiftState); + end; +end; + +procedure TcxCustomTabControl.SetImageBorder(const Value: Integer); +begin + if (Value >= 0) and (Value <> FImageBorder) then + begin + FImageBorder := Value; + if FVisibleTabList.Count > 0 then RequestLayout; + end; +end; + +procedure TcxCustomTabControl.SetImages(const Value: TCustomImageList); +begin + FImages.BaseImages := Value; +end; + +procedure TcxCustomTabControl.SetIsTabsContainer(Value: Boolean); +begin + if Value <> FIsTabsContainer then + begin + FIsTabsContainer := Value; + RequestLayout; + end; +end; + +procedure TcxCustomTabControl.SetMaxRotatedTabWidth(Value: Integer); +begin + if Value < 0 then + Value := 0; + if (Value > 0) and (Value < FPainter.GetMinTabNormalWidth(-1)) then + Value := FPainter.GetMinTabNormalWidth(-1); + if Value <> FMaxRotatedTabWidth then + begin + FMaxRotatedTabWidth := Value; + if Rotate and (FVisibleTabList.Count > 0) then RequestLayout; + end; +end; + +procedure TcxCustomTabControl.SetMultiLine(const Value: Boolean); +begin + if Value <> FMultiLine then + begin + FMultiLine := Value; + RequestLayout; + end; +end; + +procedure TcxCustomTabControl.SetMultiSelect(const Value: Boolean); +begin + FMultiSelect := Value; +end; + +procedure TcxCustomTabControl.SetNavigatorPosition( + const Value: TcxPCNavigatorPosition); +begin + if Value <> FNavigatorPosition then + begin + FNavigatorPosition := Value; + RequestLayout; + end; +end; + +procedure TcxCustomTabControl.SetOptions(Value: TcxPCOptions); +const + GraphicOptions: TcxPCOptions = [pcoGradient, pcoGradientClientArea, + pcoUsePageColorForTab]; + LayoutOptions: TcxPCOptions = [ + pcoAlwaysShowGoDialogButton, pcoCloseButton, pcoFixedTabWidthWhenRotated, + pcoGoDialog, pcoGradient, pcoGradientClientArea, pcoNoArrows, + pcoTopToBottomText + ]; +var + AAddOptions, AChangedOptions, ASubOptions: TcxPCOptions; +begin + AAddOptions := Value - FOptions; + ASubOptions := FOptions - Value; + AChangedOptions := AAddOptions + ASubOptions; + if AChangedOptions <> [] then + begin + FOptions := Value; + if AChangedOptions * LayoutOptions <> [] then + RequestLayout + else + if AChangedOptions * GraphicOptions <> [] then + Invalidate; + end; +end; + +procedure TcxCustomTabControl.SetOwnerDraw(const Value: Boolean); +begin + if Value <> FOwnerDraw then + begin + FOwnerDraw := Value; + Invalidate; + end; +end; + +procedure TcxCustomTabControl.SetRaggedRight(const Value: Boolean); +begin + if Value <> FRaggedRight then + begin + FRaggedRight := Value; + if MultiLine then + RequestLayout; + end; +end; + +procedure TcxCustomTabControl.SetRotate(const Value: Boolean); +begin + if not FPainter.AllowRotate and Value then + raise Exception.Create(Format(scxPCAllowRotateError, [FPainter.GetStyleName])); + if Value <> FRotate then + begin + FRotate := Value; + RequestLayout; + end; +end; + +procedure TcxCustomTabControl.SetScrollOpposite(const Value: Boolean); +begin + if Value <> FScrollOpposite then + begin + FScrollOpposite := Value; + if MultiLine then + if FMainTabVisibleIndex <> -1 then + begin + RearrangeRows; + Realign; + Invalidate; + end + else + Realign; + end; +end; + +procedure TcxCustomTabControl.SetShowFrame(const Value: Boolean); +begin + if Value <> FShowFrame then + begin + FShowFrame := Value; + RequestLayout; + end; +end; + +procedure TcxCustomTabControl.SetStyle(const Value: TcxPCStyleID); +var + NewPainterClass: TcxPCPainterClass; +begin + if Value = cxPCDefaultStyle then + begin + FStyle := cxPCDefaultStyle; + SetDefaultStyle; + end + else + begin + if Style = Value then + Exit; + NewPainterClass := PaintersFactory.GetPainterClass(Value); + if NewPainterClass = nil then + Exit; + FStyle := Value; + if (FPainter = nil) or (NewPainterClass <> FPainter.ClassType) then + begin + PaintersFactory.FreePainterInstance(FPainter); + FPainter := PaintersFactory.GetPainterInstance(NewPainterClass, Self); + if Rotate and not FPainter.AllowRotate then + Rotate := False; + Tabs.ResetTabVerticalTextBitmaps; + RequestLayout; + InvalidateWithChildren; + end; + end; +end; + +procedure TcxCustomTabControl.SetTabCaptionAlignment(Value: TAlignment); +begin + if Value <> FTabCaptionAlignment then + begin + FTabCaptionAlignment := Value; + RequestLayout; + end; +end; + +procedure TcxCustomTabControl.SetTabHeight(const Value: Smallint); +begin + if Value <> FTabSize.Y then + begin + FTabSize.Y := Value; + RequestLayout; + end; +end; + +procedure TcxCustomTabControl.SetTabIndex(Value: Integer); + + procedure UnselectTabs; + var + I: Integer; + begin + FTabIndex := -1; + Tabs.SetMainTab; + for I := 0 to Tabs.Count - 1 do + TabsTabs[I].Selected := False; + end; + +begin + if IsLoading then + begin + FTabIndex := Value; + Exit; + end; + if (Value <> -1) and (Value < 0) or (Value >= Tabs.Count) then Exit; + if (Value <> -1) and TabIndexTabMustBeVisible and (not TabsTabs[Value].Visible) then Value := -1; + if Value = FTabIndex then Exit; + if not CanChange(Value) then Exit; + + UnselectTabs; + Tabs.SetTracking(-1); + FTabIndex := Value; + Tabs.SetMainTab; + + if (FMainTabVisibleIndex <> -1) and not MultiLine then + CorrectFirstVisibleTab(FMainTabVisibleIndex); + + if MultiLine then + begin + RearrangeRows; + Realign; + Invalidate; + end + else +// if Value <> -1 then + RequestLayout; + UpdateButtonsState; + SynchronizeHotTrackStates(InternalGetShiftState); + + Change; +end; + +procedure TcxCustomTabControl.SetTabPosition(const Value: TcxTabPosition); +begin + if Value <> FTabPosition then + begin + FTabPosition := Value; + RequestLayout; + end; +end; + +procedure TcxCustomTabControl.SetTabs(const Value: TcxTabs); +begin + FTabs.Assign(Value); +end; + +procedure TcxCustomTabControl.SetTabSlants(Value: TcxTabSlants); +begin + FTabSlants.Assign(Value); +end; + +procedure TcxCustomTabControl.SetTabsTab(TabIndex: Integer; + const Value: TcxTab); +begin + Tabs.Tabs[TabIndex] := Value; +end; + +procedure TcxCustomTabControl.SetTabWidth(const Value: Smallint); +begin + if Value <> FTabSize.X then + begin + FTabSize.X := Value; + RequestLayout; + end; +end; + +procedure TcxCustomTabControl.SynchronizeHotTrackStates(Shift: TShiftState); + + procedure ChangeHotTrackNavigatorButton(NewHotTrackNavigatorButton: TcxPCNavigatorButtonIndex); + var + OldHotTrackNavigatorButton: TcxPCNavigatorButtonIndex; + NavigatorButton: TcxPCNavigatorButton; + begin + OldHotTrackNavigatorButton := FHotTrackNavigatorButton; + FHotTrackNavigatorButton := NewHotTrackNavigatorButton; + if OldHotTrackNavigatorButton <> [] then + begin + NavigatorButton := GetNavigatorButton(OldHotTrackNavigatorButton); + FNavigatorButtonStates[NavigatorButton] := nbsNormal; + FPainter.RepaintButton(NavigatorButton, nbsHotTrack); + end; + if NewHotTrackNavigatorButton <> [] then + begin + NavigatorButton := GetNavigatorButton(NewHotTrackNavigatorButton); + FNavigatorButtonStates[NavigatorButton] := nbsHotTrack; + FPainter.RepaintButton(NavigatorButton, nbsNormal); + end; + end; + +var + MousePos: TPoint; + NewHotTrackTabVisibleIndex: Integer; + NewHotTrackNavigatorButton: TcxPCNavigatorButtonIndex; + NavigatorButton: TcxPCNavigatorButton; +begin + if [csDesigning, csLoading, csDestroying] * ComponentState <> [] then Exit; + if not HandleAllocated then Exit; + if FIsGoDialogShowing then Exit; + MousePos := ScreenToClient(InternalGetCursorPos); + + NewHotTrackTabVisibleIndex := -1; + NewHotTrackNavigatorButton := []; + if (HotTrack or Painter.IsEnableHotTrack) and Enabled then + if not (ssLeft in Shift) and FPainter.IsOverButton(MousePos.X, MousePos.Y, NavigatorButton) and + (not (FNavigatorButtonStates[NavigatorButton] in [nbsDisabled, nbsPressed])) then + NewHotTrackNavigatorButton := [NavigatorButton] + else + if not (ssLeft in Shift) or not Painter.IsTabPressable then + begin + NewHotTrackTabVisibleIndex := IndexOfTabAt(MousePos.X, MousePos.Y); + if (NewHotTrackTabVisibleIndex <> -1) and (not FVisibleTabList[NewHotTrackTabVisibleIndex].Enabled) then + NewHotTrackTabVisibleIndex := -1; + end; + if NewHotTrackNavigatorButton <> FHotTrackNavigatorButton then + ChangeHotTrackNavigatorButton(NewHotTrackNavigatorButton); + Tabs.SetHotTrack(NewHotTrackTabVisibleIndex); +end; + +procedure TcxCustomTabControl.SynchronizeNavigatorButtons; +begin + if (FHotTrackNavigatorButton <> []) and + (FHotTrackNavigatorButton * FNavigatorButtons = []) then + begin + FNavigatorButtonStates[GetNavigatorButton(FHotTrackNavigatorButton)] := nbsNormal; + FHotTrackNavigatorButton := []; + end; + + if (FPressedNavigatorButton <> []) and + (FPressedNavigatorButton * FNavigatorButtons = []) then + begin + FNavigatorButtonStates[GetNavigatorButton(FPressedNavigatorButton)] := nbsNormal; + FPressedNavigatorButton := []; + end; +end; + +procedure TcxCustomTabControl.SynchronizeTabImagesRotationAngle; +var + ATextRotationAngle: TcxRotationAngle; +begin + ATextRotationAngle := InternalGetTextRotationAngle(Self); + if VerifyImageList(Images) then + FImages.ImageRotationAngle := ATextRotationAngle; +end; + +procedure TcxCustomTabControl.TabSlantsChanged(Sender: TObject); +begin + RequestLayout; +end; + +procedure TcxCustomTabControl.TimerEventHandler(Sender: TObject); +begin + FTimer.Interval := TabScrollingDelay; + if FPressedNavigatorButton <> [] then + begin + ArrowButtonClick(GetNavigatorButton(FPressedNavigatorButton)); + if FPressedNavigatorButton <> [] then Exit; + end; + FTimer.Enabled := False; +end; + +procedure TcxCustomTabControl.UpdateButtonsState; + + procedure InternalUpdateButtonState(AButton: TcxPCNavigatorButton); + var + ANewButtonState, APrevButtonState: TcxPCNavigatorButtonState; + begin + if not (AButton in FNavigatorButtons) then + Exit; + APrevButtonState := FNavigatorButtonStates[AButton]; + ANewButtonState := APrevButtonState; + if CanPressButton(AButton) then + begin + if APrevButtonState = nbsDisabled then + ANewButtonState := nbsNormal; + end + else + ANewButtonState := nbsDisabled; + if ANewButtonState <> APrevButtonState then + begin + if ANewButtonState = nbsDisabled then + begin + FHotTrackNavigatorButton := []; + FPressedNavigatorButton := []; + end; + FNavigatorButtonStates[AButton] := ANewButtonState; + FPainter.RepaintButton(AButton, APrevButtonState); + SynchronizeHotTrackStates(InternalGetShiftState); + end; + end; + +var + AButton: TcxPCNavigatorButton; +begin + for AButton := Low(TcxPCNavigatorButton) to High(TcxPCNavigatorButton) do + if AButton <> nbGoDialog then + InternalUpdateButtonState(AButton); +end; + +procedure TcxCustomTabControl.UpdateTabPosition(ANavigatorButtons: TcxPCNavigatorButtons); +begin + FNavigatorButtons := ANavigatorButtons; + FTabsPosition := FPainter.GetTabsPosition(ANavigatorButtons); +end; + +procedure TcxCustomTabControl.WriteClientRectBottom(Writer: TWriter); +begin + Writer.WriteInteger(InternalGetClientRect.Bottom); +end; + +procedure TcxCustomTabControl.WriteClientRectLeft(Writer: TWriter); +begin + Writer.WriteInteger(InternalGetClientRect.Left); +end; + +procedure TcxCustomTabControl.WriteClientRectRight(Writer: TWriter); +begin + Writer.WriteInteger(InternalGetClientRect.Right); +end; + +procedure TcxCustomTabControl.WriteClientRectTop(Writer: TWriter); +begin + Writer.WriteInteger(InternalGetClientRect.Top); +end; + +procedure TcxCustomTabControl.WMGetDlgCode(var Message: TWMGetDlgCode); +begin + inherited; + Message.Result := Message.Result or DLGC_WANTARROWS; +end; + +procedure TcxCustomTabControl.WMPrintClient(var Message: TWMPrintClient); +begin +{$IFDEF DELPHI7} + inherited +{$ELSE} + if (Message.Result <> 1) and + ((Message.Flags and PRF_CHECKVISIBLE = 0) or Visible) then + PaintHandler(TWMPaint(Message)) + else + inherited +{$ENDIF} +end; + +procedure TcxCustomTabControl.CMDesignHitTest( + var Message: TCMDesignHitTest); +begin + inherited; + with Message do + if PassDesignMouseEvent(XPos, YPos) then Result := 1; +end; + +procedure TcxCustomTabControl.CMDialogChar(var Message: TCMDialogChar); +begin + if HandleDialogChar(Message.CharCode) then + Message.Result := 1 + else + inherited; +end; + +procedure TcxCustomTabControl.CMDialogKey(var Message: TCMDialogKey); +var + ACharCode: Word; + AIsKeyHandled: Boolean; + AKeyState: TKeyBoardState; +begin + if Focused or HandleAllocated and Windows.IsChild(Handle, Windows.GetFocus) then + begin + ACharCode := Message.CharCode; + GetKeyboardState(AKeyState); + AIsKeyHandled := InternalKeyDown(ACharCode, KeyboardStateToShiftState(AKeyState)); + Message.CharCode := ACharCode; + if AIsKeyHandled then + begin + Message.Result := 1; + Exit; + end; + end; + inherited; +end; + +procedure TcxCustomTabControl.CMEnabledChanged(var Message: TMessage); +begin + inherited; + Invalidate; +end; + +procedure TcxCustomTabControl.CMMouseLeave(var Message: TMessage); +begin + inherited; + SynchronizeHotTrackStates(InternalGetShiftState); +end; + +procedure TcxCustomTabControl.CMParentColorChanged(var Message: TMessage); +begin + inherited; + Invalidate; +end; + +constructor TcxCustomTabControl.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := [csAcceptsControls, csCaptureMouse, csClickEvents, + csDoubleClicks, csOpaque{$IFDEF DELPHI7}, csParentBackground{$ENDIF}]; + FVisibleTabList := TcxVisibleTabList.Create(Self); + Width := 289; + + Height := 193; + + FFirstVisibleTab := -1; + FLastVisibleTab := -1; + + FFocusable := True; + FHotTrackNavigatorButton := []; + FHotTrackTabVisibleIndex := -1; + FImageBorder := 0; + FIsGoDialogShowing := False; + + FNavigatorPosition := npRightTop; + FPressedNavigatorButton := []; + FPressedTabVisibleIndex := -1; + FMainTabVisibleIndex := -1; + FOptions := cxPCDefaultOptions; + FTabCaptionAlignment := taCenter; + FTabIndex := -1; + FTabSlants := TcxTabSlants.Create(Self); + FTabSlants.OnChange := TabSlantsChanged; + FTimer := nil; + FTracking := -1; + FUpdating := False; + TabStop := True; + + FImages := TcxPCImageList.Create(Self); + FImages.OnChange := ImageListChange; + FImages.OnPrepareBitmapBackground := PrepareImagesBitmapBackground; + FTabs := TcxTabs.Create(Self); + Style := cxPCDefaultStyle; + + CreateGoDialog; +end; + +destructor TcxCustomTabControl.Destroy; +begin + FreeAndNil(FTabSlants); + FreeAndNil(FTimer); + FreeAndNil(FGoDialog); + FImages.Free; + FTabs.Free; + PaintersFactory.FreePainterInstance(FPainter); + FVisibleTabList.Free; + inherited Destroy; +end; + +function TcxCustomTabControl.CanFocus: Boolean; +begin + Result := inherited CanFocus and FFocusable; +end; + +function TcxCustomTabControl.GetOptimalSize: Integer; +var + ADistanceBetweenTabs, ATabFinishPosition, ATabStartPosition, ATabWidth, I: Integer; + AIsY: Boolean; + ALineFinishPosition, ALineStartPosition: Integer; +begin + Result := 0; + if VisibleTabList.Count = 0 then + Exit; + CalculateTabNormalSizes; + UpdateTabPosition(GetNavigatorButtons(True)); + + AIsY := TabPosition in [tpLeft, tpRight]; + ALineStartPosition := PointGetter(FTabsPosition.NormalTabsRect.TopLeft, AIsY); + ALineFinishPosition := ALineStartPosition + FTabsPosition.NormalRowWidth - 1; + ADistanceBetweenTabs := DistanceGetter(FPainter.GetTabsNormalDistance, not Rotate); + + ATabStartPosition := ALineStartPosition; + ATabFinishPosition := ATabStartPosition; + for I := 0 to VisibleTabList.Count - 1 do + begin + ATabWidth := FVisibleTabList[I].NormalLongitudinalSize; + ATabFinishPosition := ATabStartPosition + ATabWidth - 1; + ATabStartPosition := ATabFinishPosition + 1 + ADistanceBetweenTabs; + end; + FIsLastTabFullyVisible := (ATabFinishPosition <= ALineFinishPosition); + + if TabPosition in [tpTop, tpBottom] then + Result := ATabFinishPosition + 1 + (Width - 1 - ALineFinishPosition) + else + Result := ATabFinishPosition + 1 + (Height - 1 - ALineFinishPosition); +end; + +procedure TcxCustomTabControl.GetTabOrderList(List: TList); +begin + inherited GetTabOrderList(List); + if not FFocusable then + List.Remove(Self); +end; + +function TcxCustomTabControl.IndexOfTabAt(X, Y: Integer): Integer; +var + FirstIndex, LastIndex, I: Integer; +begin + Result := -1; + InitializeVisibleTabRange(Self, FirstIndex, LastIndex); + for I := FirstIndex to LastIndex do + with FVisibleTabList[I] do + if PtInRect(VisibleRect, Point(X, Y)) and FPainter.IsOverTab(I, X, Y) then + begin + Result := I; + Break; + end; +end; + +procedure TcxCustomTabControl.ScrollTabs(Delta: Integer); +var + I: Integer; +begin + if not FMultiLine then + begin + for I := 0 to Abs(Delta) - 1 do + if Delta < 0 then + ArrowButtonClick(nbTopLeft) + else + ArrowButtonClick(nbBottomRight); + end; +end; + +procedure TcxCustomTabControl.SetStandardStyle(StandardStyle: TcxPCStandardStyle); +const + StandardStyleNameMap: array[TcxPCStandardStyle] of string = ( + 'tsTabs', 'tsButtons', 'tsFlatButtons'); +var + NewPainterClass: TcxPCPainterClass; +begin + NewPainterClass := PaintersFactory.GetPainterClass(StandardStyle); + if NewPainterClass = nil then + OutError('SetStandardStyle', Format(scxPCStandardStyleError, [StandardStyleNameMap[StandardStyle]])) + else + Style := NewPainterClass.GetStyleID; +end; + +procedure TcxCustomTabControl.SetStyleByStyleName(StyleName: TCaption); +var + NewPainterClass: TcxPCPainterClass; +begin + if StyleName = cxPCDefaultStyleName then + begin + FStyle := cxPCDefaultStyle; + SetDefaultStyle; + end + else + begin + NewPainterClass := PaintersFactory.GetPainterClass(StyleName); + if NewPainterClass = nil then + OutError('SetStyleByName', Format(scxPCStyleNameError, [StyleName])) + else + Style := NewPainterClass.GetStyleID; + end; +end; + +procedure TcxCustomTabControl.AdjustClientRect(var Rect: TRect); +begin + Rect := InternalGetClientRect; +end; + +procedure TcxCustomTabControl.AfterPaintTab(ACanvas: TcxCanvas; ATab: TcxTab; + AImageAndTextData: TcxPCOutTabImageAndTextData); +begin +end; + +procedure TcxCustomTabControl.DefineProperties(Filer: TFiler); + + function IsClientRectBottomStored: Boolean; + begin + if Assigned(Filer.Ancestor) then + Result := InternalGetClientRect.Bottom <> + TcxCustomTabControl(Filer.Ancestor).InternalGetClientRect.Bottom + else + Result := InternalGetClientRect.Bottom <> 0; + end; + + function IsClientRectLeftStored: Boolean; + begin + if Assigned(Filer.Ancestor) then + Result := InternalGetClientRect.Left <> + TcxCustomTabControl(Filer.Ancestor).InternalGetClientRect.Left + else + Result := InternalGetClientRect.Left <> 0; + end; + + function IsClientRectRightStored: Boolean; + begin + if Assigned(Filer.Ancestor) then + Result := InternalGetClientRect.Right <> + TcxCustomTabControl(Filer.Ancestor).InternalGetClientRect.Right + else + Result := True; + end; + + function IsClientRectTopStored: Boolean; + begin + if Assigned(Filer.Ancestor) then + Result := InternalGetClientRect.Top <> + TcxCustomTabControl(Filer.Ancestor).InternalGetClientRect.Top + else + Result := True; + end; + +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('ClientRectBottom', ReadClientRectBottom, + WriteClientRectBottom, IsClientRectBottomStored); + Filer.DefineProperty('ClientRectLeft', ReadClientRectLeft, + WriteClientRectLeft, IsClientRectLeftStored); + Filer.DefineProperty('ClientRectRight', ReadClientRectRight, + WriteClientRectRight, IsClientRectRightStored); + Filer.DefineProperty('ClientRectTop', ReadClientRectTop, + WriteClientRectTop, IsClientRectTopStored); +end; + +function TcxCustomTabControl.DoCanClose: Boolean; +begin + Result := True; + if Assigned(FOnCanClose) then + FOnCanClose(Self, Result); +end; + +procedure TcxCustomTabControl.DoClose; +begin + Tabs.Delete(TabIndex); + Change; +end; + +procedure TcxCustomTabControl.DoDrawTabEx(ATabVisibleIndex: Integer; + AFont: TFont); +begin + if Assigned(FOnDrawTabEx) then + FOnDrawTabEx(Self, VisibleTabList[ATabVisibleIndex], AFont); +end; + +function TcxCustomTabControl.DoMouseWheelDown(Shift: TShiftState; + MousePos: TPoint): Boolean; +begin + Result := CanMouseWheel(MousePos); + if Result then + ScrollTabs(1); +end; + +function TcxCustomTabControl.DoMouseWheelUp(Shift: TShiftState; + MousePos: TPoint): Boolean; +begin + Result := CanMouseWheel(MousePos); + if Result then + ScrollTabs(-1); +end; + +procedure TcxCustomTabControl.FocusChanged; +begin + inherited FocusChanged; + if not IsDestroying and (FMainTabVisibleIndex <> -1) and + FVisibleTabList[FMainTabVisibleIndex].RealVisible then + FPainter.RepaintTab(FMainTabVisibleIndex, tpcFocused); +end; + +procedure TcxCustomTabControl.FontChanged; +begin + inherited FontChanged; + RequestLayout; +end; + +function TcxCustomTabControl.HandleDialogChar(Key: Integer): Boolean; +var + I: Integer; + Tab: TcxTab; +begin + Result := False; + for I := 0 to Tabs.Count - 1 do + begin + Tab := TabsTabs[I]; + if IsAccel(Key, Tab.Caption) and CanShowTab(I) and inherited CanFocus then + begin + Result := True; + TabIndex := Tab.Index; + Break; + end; + end; +end; + +function TcxCustomTabControl.HasBackground: Boolean; +begin + Result := False; +end; + +procedure TcxCustomTabControl.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited KeyDown(Key, Shift); + InternalKeyDown(Key, Shift); +end; + +procedure TcxCustomTabControl.Loaded; +var + OldTabIndex: Integer; +begin + inherited Loaded; + RequestLayout; + if TabIndex <> -1 then + begin + OldTabIndex := FTabIndex; + FTabIndex := -1; + LockChangeEvent(True); + try + TabIndex := OldTabIndex; + finally + LockChangeEvent(False); + end; + end; +end; + +procedure TcxCustomTabControl.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + inherited LookAndFeelChanged(Sender, AChangedValues); + SetDefaultStyle; + RequestLayout; + if lfvNativeStyle in AChangedValues then + InvalidateWithChildren; +end; + +procedure TcxCustomTabControl.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + + procedure NavigatorButtonDown(NavigatorButton: TcxPCNavigatorButton); + var + OldButtonState: TcxPCNavigatorButtonState; + begin + OldButtonState := FNavigatorButtonStates[NavigatorButton]; + if OldButtonState in [nbsPressed, nbsDisabled] then Exit; + + FNavigatorButtonStates[NavigatorButton] := nbsPressed; + FPressedNavigatorButton := [NavigatorButton]; + FPainter.RepaintButton(NavigatorButton, OldButtonState); + + if NavigatorButton in [nbTopLeft, nbBottomRight] then + begin + ArrowButtonClick(NavigatorButton); + if FPressedNavigatorButton = [NavigatorButton] then + CreateTimer; + Exit; + end; + end; + + procedure TabDown(TabVisibleIndex: Integer); + begin + with FVisibleTabList[TabVisibleIndex] do + begin + if not RealEnabled and not IsDesigning then Exit; + if FPainter.IsTabPressable and not IsDesigning then + begin + FPressedTabVisibleIndex := TabVisibleIndex; + FPainter.RepaintTab(TabVisibleIndex, tpcPressed); + end + else + SelectTab(TabVisibleIndex, ssCtrl in Shift); + end; + end; + +var + PressedTabVisibleIndex: Integer; + NavigatorButton: TcxPCNavigatorButton; +begin + inherited MouseDown(Button, Shift, X, Y); + if not IsDesigning and (HideTabs or (Button <> mbLeft)) then + Exit; + + SynchronizeHotTrackStates(Shift); + + if FPainter.IsOverButton(X, Y, NavigatorButton) then + NavigatorButtonDown(NavigatorButton) + else + begin + PressedTabVisibleIndex := IndexOfTabAt(X, Y); + if PressedTabVisibleIndex <> -1 then TabDown(PressedTabVisibleIndex); + end; +end; + +procedure TcxCustomTabControl.MouseLeave(AControl: TControl); +begin + inherited MouseLeave(AControl); + if not FIsGoDialogShowing then + SynchronizeHotTrackStates([]); +end; + +procedure TcxCustomTabControl.MouseMove(Shift: TShiftState; X, Y: Integer); + + procedure ReleaseNavigatorButton; + var + NavigatorButton, NavigatorButton1: TcxPCNavigatorButton; + begin + if FTimer <> nil then + begin + FTimer.Enabled := False; + for NavigatorButton := nbTopLeft to nbBottomRight do + if FNavigatorButtonStates[NavigatorButton] = nbsPressed then + begin + if FPainter.IsOverButton(X, Y, NavigatorButton1) and + (NavigatorButton = NavigatorButton1) and (HotTrack or Painter.IsEnableHotTrack) then + FNavigatorButtonStates[NavigatorButton] := nbsHotTrack + else + FNavigatorButtonStates[NavigatorButton] := nbsNormal; + UpdateButtonsState; + FPainter.RepaintButtonsRegion; + end; + end; + end; + +var + NavigatorButton: TcxPCNavigatorButton; + TabVisibleIndex: Integer; + OldPressedTabVisibleIndex: Integer; + IsOverNavigatorButton: Boolean; + PressedNavigatorButton: TcxPCNavigatorButton; +begin + inherited MouseMove(Shift, X, Y); + if HideTabs then Exit; + if FIsGoDialogShowing then Exit; + + IsOverNavigatorButton := FPainter.IsOverButton(X, Y, NavigatorButton); + if (IsOverNavigatorButton and (FPressedNavigatorButton <> [NavigatorButton])) or + (not IsOverNavigatorButton) then + if FPressedNavigatorButton <> [] then + begin + if FTimer <> nil then + FTimer.Enabled := False; + PressedNavigatorButton := GetNavigatorButton(FPressedNavigatorButton); + FNavigatorButtonStates[PressedNavigatorButton] := nbsNormal; + FPressedNavigatorButton := []; + FPainter.RepaintButton(PressedNavigatorButton, nbsPressed); + end; + + TabVisibleIndex := IndexOfTabAt(X, Y); + if (TabVisibleIndex <> FPressedTabVisibleIndex) and + (FPressedTabVisibleIndex <> -1) then + begin + OldPressedTabVisibleIndex := FPressedTabVisibleIndex; + FPressedTabVisibleIndex := -1; + FPainter.RepaintTab(OldPressedTabVisibleIndex, tpcPressed); + end; + + SynchronizeHotTrackStates(Shift); +end; + +procedure TcxCustomTabControl.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + + procedure NavigatorButtonUp(NavigatorButton: TcxPCNavigatorButton); + var + ACloseButtonClicked: Boolean; + AOldButtonState: TcxPCNavigatorButtonState; + begin + if FTimer <> nil then FTimer.Enabled := False; + AOldButtonState := FNavigatorButtonStates[NavigatorButton]; + if AOldButtonState = nbsDisabled then Exit; + if (not IsDesigning) and (NavigatorButton = nbGoDialog) and + (FPressedNavigatorButton = [nbGoDialog]) then + ShowGoDialog + else + begin + ACloseButtonClicked := (not IsDesigning) and (NavigatorButton = nbClose) and + (FPressedNavigatorButton = [nbClose]); + + if AOldButtonState = nbsPressed then FPressedNavigatorButton := []; + FNavigatorButtonStates[NavigatorButton] := nbsNormal; + FPainter.RepaintButton(NavigatorButton, AOldButtonState); + SynchronizeHotTrackStates(Shift); + + if ACloseButtonClicked then + CloseButtonClick; + end; + end; + + procedure TabUp(TabVisibleIndex: Integer); + begin + with FVisibleTabList[TabVisibleIndex] do + begin + if not RealEnabled and not IsDesigning then Exit; + if FPainter.IsTabPressable and not IsDesigning and + (TabVisibleIndex = FPressedTabVisibleIndex) then + begin + if FPressedTabVisibleIndex <> -1 then + begin + FPressedTabVisibleIndex := -1; + FPainter.RepaintTab(TabVisibleIndex, tpcPressed); + end; + + SelectTab(TabVisibleIndex, ssCtrl in Shift); + end; + + SynchronizeHotTrackStates(Shift); + end; + end; + +var + NavigatorButton: TcxPCNavigatorButton; + PressedTabVisibleIndex: Integer; +begin + inherited MouseUp(Button, Shift, X, Y); + if HideTabs then Exit; + if Button <> mbLeft then Exit; + if FIsGoDialogShowing then Exit; + if FPainter.IsOverButton(X, Y, NavigatorButton) then + NavigatorButtonUp(NavigatorButton) + else + begin + PressedTabVisibleIndex := IndexOfTabAt(X, Y); + if PressedTabVisibleIndex <> -1 then + TabUp(PressedTabVisibleIndex); + end; +end; + +function TcxCustomTabControl.NeedsScrollBars: Boolean; +begin + Result := False; +end; + +procedure TcxCustomTabControl.Paint; +begin + if IsDestroying then + Exit; + FPainter.SaveClipRgn; + try + FPainter.Paint; + finally + FPainter.RestoreClipRgn; + end; +end; + +procedure TcxCustomTabControl.Resize; +begin + RequestLayout; + Realign; + if (pcoRedrawOnResize in Options) and Painter.NeedRedrawOnResize then + InvalidateWithChildren; + inherited Resize; +end; + +function TcxCustomTabControl.CanChange(NewTabIndex: Integer): Boolean; +begin + Result := True; + if Assigned(FOnChanging) and not IsChangeEventLocked then + FOnChanging(Self, Result); +end; + +function TcxCustomTabControl.CanShowTab(TabIndex: Integer): Boolean; +begin + Result := TabsTabs[TabIndex].Visible and TabsTabs[TabIndex].RealEnabled; +end; + +procedure TcxCustomTabControl.Change; +begin + if Assigned(FOnChange) and not IsChangeEventLocked then + FOnChange(Self); +end; + +procedure TcxCustomTabControl.CorrectFirstVisibleTab( + TabVisibleIndex: Integer); + +var + c: Integer; + ADistanceBetweenTabs: Integer; +begin + if TabVisibleIndex < FFirstVisibleTab then + FFirstVisibleTab := TabVisibleIndex + else if (TabVisibleIndex = FLastVisibleTab) and FIsLastTabFullyVisible then + Exit + else if TabVisibleIndex >= FLastVisibleTab then + begin + UpdateTabPosition(FNavigatorButtons); + ADistanceBetweenTabs := DistanceGetter(FPainter.GetTabsNormalDistance, not Rotate); + if IsTooSmallControlSize then FFirstVisibleTab := TabVisibleIndex + else + begin + c := FVisibleTabList[TabVisibleIndex].NormalLongitudinalSize; + FFirstVisibleTab := TabVisibleIndex; + while (c + ADistanceBetweenTabs < FTabsPosition.NormalRowWidth) and (FFirstVisibleTab > 0) do + begin + Dec(FFirstVisibleTab); + Inc(c, ADistanceBetweenTabs); + Inc(c, FVisibleTabList[FFirstVisibleTab].NormalLongitudinalSize); + if c > FTabsPosition.NormalRowWidth then Inc(FFirstVisibleTab); + end; + end; + end; +end; + +procedure TcxCustomTabControl.DoShowGoDialog; +begin + FGoDialog.Popup(pcoSort in Options); + HideGoDialog(-1); +end; + +procedure TcxCustomTabControl.DrawTab(TabIndex: Integer; const Rect: TRect; + Active: Boolean); +begin +end; + +function TcxCustomTabControl.GetActivePage: TcxTabSheet; +begin + Result := nil; +end; + +function TcxCustomTabControl.GetImageIndex(ATabIndex: Integer): Integer; +begin + Result := TabsTabs[ATabIndex].FImageIndex; + if Assigned(OnGetImageIndex) then + OnGetImageIndex(Self, ATabIndex, Result); + if Result < 0 then + Result := -1; + if (Images = nil) or (Images.Width <= 0) or (Images.Height <= 0) or + (Result >= Images.Count) then + Result := -1; +end; + +function TcxCustomTabControl.GetPage(ATabIndex: Integer): TcxTabSheet; +begin + Result := nil; +end; + +procedure TcxCustomTabControl.GoDialogClickEventHandler(ATabControlItemIndex: Integer); +begin + HideGoDialog(ATabControlItemIndex); +end; + +procedure TcxCustomTabControl.HideGoDialog(ATabControlItemIndex: Integer); +begin + FIsGoDialogShowing := False; + + FNavigatorButtonStates[nbGoDialog] := nbsNormal; + FPressedNavigatorButton := []; + FPainter.RepaintButton(nbGoDialog, nbsPressed); + + if ATabControlItemIndex <> -1then + TabIndex := ATabControlItemIndex; + + SynchronizeHotTrackStates(InternalGetShiftState); +end; + +procedure TcxCustomTabControl.ImageListChange(Sender: TObject); +begin + RequestLayout; +end; + +function TcxCustomTabControl.InternalKeyDown(var Key: Word; + Shift: TShiftState): Boolean; + + function GetCorrectedDelta(Delta: Integer): Integer; + var + SpecialAlignment: Boolean; + begin + SpecialAlignment := IsRightToLeftAlignment(Self) or IsBottomToTopAlignment(Self); + if (SpecialAlignment and (Delta = -1)) or + ((not SpecialAlignment) and (Delta = 1)) then + Result := 1 + else + Result := -1; + end; + + procedure ChangeTabIndex(TabVisibleIndex: Integer); + begin + if TabVisibleIndex <> FMainTabVisibleIndex then + TabIndex := FVisibleTabList[TabVisibleIndex].Index; + end; + + function GetNearestEnabledVisibleTabVisibleIndex(CurrentTabVisibleIndex, + Delta: Integer; Cycle: Boolean): Integer; + var + I: Integer; + VisibleTabCount: Integer; + begin + Result := -1; + VisibleTabCount := FVisibleTabList.Count; + I := CurrentTabVisibleIndex; + repeat + if FVisibleTabList[I].RealEnabled then Break + else + begin + Inc(I, Delta); + if ((I < 0) or (I >= VisibleTabCount)) then + if not Cycle then + Exit + else + if I < 0 then I := VisibleTabCount - 1 + else I := 0; + end; + until I = CurrentTabVisibleIndex; + if FVisibleTabList[I].RealEnabled then + Result := I; + end; + +var + Delta: Integer; + Cycle: Boolean; + TabVisibleIndex: Integer; + VisibleTabCount: Integer; +begin + Result := False; + VisibleTabCount := FVisibleTabList.Count; + if HideTabs or (VisibleTabCount = 0) then Exit; + if (Shift = [ssAlt]) or (Shift = [ssAlt, ssShift]) then Exit; + + Cycle := False; + Delta := 0; + TabVisibleIndex := -1; + case Key of + VK_TAB: + if ssCtrl in Shift then + begin + Cycle := True; + if ssShift in Shift then + Delta := -1 + else + Delta := 1; + end; + VK_RIGHT, VK_DOWN: + Delta := 1; + VK_LEFT, VK_UP: + Delta := -1; + VK_HOME, VK_END: + begin + if Key = VK_HOME then Delta := -1 + else Delta := 1; + Delta := GetCorrectedDelta(Delta); + if Delta = 1 then + TabVisibleIndex := VisibleTabCount - 1 + else + TabVisibleIndex := 0; + Delta := -Delta; + end; + VK_RETURN, VK_SPACE: + if FTracking <> -1 then + begin + TabIndex := FVisibleTabList[FTracking].Index; + Result := True; + end; + end; + + if Delta = 0 then + Exit; + Result := True; + + if TabVisibleIndex = -1 then + begin + Delta := GetCorrectedDelta(Delta); + if FTracking <> -1 then + TabVisibleIndex := FTracking + Delta + else if FMainTabVisibleIndex <> -1 then + TabVisibleIndex := FMainTabVisibleIndex + Delta + else + if Delta = 1 then TabVisibleIndex := 0 + else TabVisibleIndex := VisibleTabCount - 1; + + if TabVisibleIndex < 0 then + if Cycle then TabVisibleIndex := VisibleTabCount - 1 + else Exit; + if TabVisibleIndex >= VisibleTabCount then + if Cycle then TabVisibleIndex := 0 + else Exit; + end; + + TabVisibleIndex := GetNearestEnabledVisibleTabVisibleIndex(TabVisibleIndex, Delta, Cycle); + + if TabVisibleIndex <> -1 then + if (not FPainter.IsTabPressable) or (Key = VK_TAB) then + ChangeTabIndex(TabVisibleIndex) + else + Tabs.SetTracking(TabVisibleIndex); +end; + +function TcxCustomTabControl.IsChangeEventLocked: Boolean; +begin + Result := (FChangeEventLockCount > 0) or IsLoading or IsDesigning; +end; + +procedure TcxCustomTabControl.LockChangeEvent(ALock: Boolean); +begin + if ALock then + Inc(FChangeEventLockCount) + else + if FChangeEventLockCount > 0 then + Dec(FChangeEventLockCount); +end; + +class procedure TcxCustomTabControl.OutError(SourceMethodName: TCaption; Msg: TCaption); +begin + raise Exception.Create('TcxCustomTabControl.' + SourceMethodName + ': ' + Msg); +end; + +procedure TcxCustomTabControl.PrepareTabCanvasFont(ATab: TcxTab; ACanvas: TcxCanvas); +begin + ACanvas.Font := Font; + ACanvas.Font.Color := Painter.GetTextColor(ATab.VisibleIndex); + DoDrawTabEx(ATab.VisibleIndex, ACanvas.Font); +end; + +procedure TcxCustomTabControl.RequestLayout; +var + APrevMainTabVisibleIndex: Integer; +begin + if IsLoading or FUpdating then Exit; + FUpdating := True; + try + APrevMainTabVisibleIndex := FMainTabVisibleIndex; + if FMainTabVisibleIndex >= VisibleTabList.Count then + FMainTabVisibleIndex := -1; + + Painter.Init; + CorrectMaxRotatedTabWidth; + + Tabs.ResetTabVerticalTextBitmaps; + Calculate; + Tabs.ValidateImageIndexes; + SynchronizeTabImagesRotationAngle; + Realign; + Invalidate; + + FMainTabVisibleIndex := APrevMainTabVisibleIndex; + Tabs.SetMainTab; + + SynchronizeHotTrackStates(InternalGetShiftState); + finally + FUpdating := False; + end; +end; + +procedure TcxCustomTabControl.SetDefaultStyle; +var + AStyleID: TcxPCStyleID; +begin + if Style <> cxPCDefaultStyle then Exit; + AStyleID := PaintersFactory.GetStyleID(LookAndFeel); + if AStyleID = cxPCNoStyle then + Style := PaintersFactory.GetDefaultStyleID(LookAndFeel) + else + Style := AStyleID; + FStyle := cxPCDefaultStyle; +end; + +procedure TcxCustomTabControl.SetModified; +begin + if not IsLoading then + Modified; +end; + +procedure TcxCustomTabControl.ShowGoDialog; +begin + FIsGoDialogShowing := True; + DoShowGoDialog; +end; + +function TcxCustomTabControl.TabIndexTabMustBeVisible: Boolean; +begin + Result := False; +end; + +procedure TcxCustomTabControl.UpdateTabImages; +var + I: Integer; +begin + for I := 0 to FTabs.Count - 1 do + TabsTabs[I].ImageIndex := GetImageIndex(I); + Invalidate; +end; + +procedure TcxCustomTabControl.CreateHandle; +begin + inherited CreateHandle; + RequestLayout; + Realign; +end; + +procedure TcxCustomTabControl.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params.WindowClass do + style := style and not(CS_HREDRAW or CS_VREDRAW); +end; + +{ TcxPCImageList } + +procedure TcxPCImageList.BaseImageListChange(Sender: TObject); +begin + RotateImages; + Change; +end; + +procedure TcxPCImageList.Change; +begin + if Assigned(OnChange) then + OnChange(Self); +end; + +procedure TcxPCImageList.ClearRotatedImages; +var + I: Integer; +begin + for I := 0 to Length(FRotatedImages) - 1 do + FRotatedImages[I].Bitmap.Free; + FRotatedImages := nil; +end; + +procedure TcxPCImageList.DoPrepareBitmapBackground(ABitmap: TBitmap); +begin + if Assigned(FOnPrepareBitmapBackground) then + FOnPrepareBitmapBackground(ABitmap); +end; + +constructor TcxPCImageList.Create(AParent: TcxCustomTabControl); +begin + inherited Create; + FParent := AParent; + + FBaseImageChangeLink := TChangeLink.Create; + FBaseImageChangeLink.OnChange := BaseImageListChange; + FImageRotationAngle := ra0; + + FFreeNotificator := TcxFreeNotificator.Create(nil); + FFreeNotificator.OnFreeNotification := FreeNotification; +end; + +destructor TcxPCImageList.Destroy; +begin + FFreeNotificator.Free; + FBaseImageChangeLink.Free; + ClearRotatedImages; + inherited Destroy; +end; + +procedure TcxPCImageList.Draw(Canvas: TCanvas; X, Y, + Index: Integer; BackgroundColor: TColor; Enabled: Boolean = True); +var + Bitmap: TBitmap; +begin + if not VerifyImageList(BaseImages) then + OutError('Draw', scxPCNoBaseImages); + if (Index < 0) or (Index >= BaseImages.Count) then + OutError('Draw', Format(scxPCImageListIndexError, [Index, BaseImages.Count - 1])); + + if ImageRotationAngle = ra0 then + begin + if FParent.Painter.IsNativePainting then + BaseImages.Draw(Canvas, X, Y, Index, Enabled) + else + begin + Bitmap := TBitmap.Create; + PrepareBitmap(Bitmap, FParent.Canvas, BaseImageSize, BackgroundColor); + DoPrepareBitmapBackground(Bitmap); + BaseImages.Draw(Bitmap.Canvas, 0, 0, Index, Enabled); + Canvas.Draw(X, Y, Bitmap); + Bitmap.Free; + end; + end else + begin + RotateImage(Index, BackgroundColor, Enabled); + Canvas.Draw(X, Y, FRotatedImages[Index].Bitmap); + end; +end; + +function TcxPCImageList.GetBaseImageSize: TSize; +begin + if (BaseImages = nil) or (BaseImages.Width <= 0) or (BaseImages.Height <= 0) then + Result := Size(0, 0) + else + Result := Size(BaseImages.Width, BaseImages.Height); +end; + +function TcxPCImageList.GetRotatedImageSize: TSize; +begin + Result := GetBaseImageSize; + if ImageRotationAngle <> ra0 then + Result := Size(Result.cy, Result.cx); +end; + +procedure TcxPCImageList.FreeNotification(AComponent: TComponent); +begin + if AComponent = BaseImages then + BaseImages := nil; +end; + +class procedure TcxPCImageList.OutError(SourceMethodName, Msg: TCaption); +begin + raise Exception.Create('TcxPCImageList.' + SourceMethodName + ': ' + Msg); +end; + +procedure TcxPCImageList.RotateImage(Index: Integer; + BackgroundColor: TColor; Enabled: Boolean); +var + E: TcxPCImageListRotatedImagesElement; +begin + E := FRotatedImages[Index]; + if (E.IsBackgroundColorSpecified) and (E.BackgroundColor = BackgroundColor) then Exit; + E.BackgroundColor := BackgroundColor; + E.IsBackgroundColorSpecified := True; + + with E.Bitmap, E.Bitmap.Canvas do + begin + Width := BaseImages.Width; + Height := BaseImages.Height; + Brush.Style := bsSolid; + Brush.Color := BackgroundColor; + FillRect(Rect(0, 0, Width, Height)); + if FParent.Painter.IsNativePainting then + Transparent := True; + DoPrepareBitmapBackground(E.Bitmap); + BaseImages.Draw(Canvas, 0, 0, Index, Enabled); + FParent.Canvas.RotateBitmap(E.Bitmap, ImageRotationAngle); + end; +end; + +procedure TcxPCImageList.RotateImages; +var + I: Integer; +begin + if FImageRotationAngle = ra0 then Exit; + if not VerifyImageList(FBaseImages) then Exit; + + ClearRotatedImages; + SetLength(FRotatedImages, BaseImages.Count); + for I := 0 to BaseImages.Count - 1 do + begin + FRotatedImages[I].IsBackgroundColorSpecified := False; + FRotatedImages[I].Bitmap := TBitmap.Create; + FRotatedImages[I].Bitmap.PixelFormat := pf32bit; + FRotatedImages[I].Bitmap.HandleType := bmDDB; + end; +end; + +procedure TcxPCImageList.SetBaseImages( + const Value: TCustomImageList); +begin + cxSetImageList(Value, FBaseImages, FBaseImageChangeLink, FFreeNotificator); +end; + +procedure TcxPCImageList.SetImageRotationAngle( + const Value: TcxRotationAngle); +begin + begin + FImageRotationAngle := Value; + BaseImageListChange(BaseImages); + end; +end; + +{ TcxPageControl } + +constructor TcxPageControl.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FPages := TList.Create; +end; + +destructor TcxPageControl.Destroy; +var + I: Integer; +begin + for I := 0 to PageCount - 1 do + with Pages[I] do + begin + FPageControl := nil; + FTab := nil; + end; + FPages.Free; + inherited Destroy; +end; + +function TcxPageControl.FindNextPage(ACurrentPage: TcxTabSheet; AGoForward, + ACheckTabAccessibility: Boolean): TcxTabSheet; +begin + Result := FindNextPageEx(ACurrentPage, AGoForward, ACheckTabAccessibility, True); +end; + +function TcxPageControl.FindNextPageEx(ACurrentPage: TcxTabSheet; + AGoForward, ACheckTabAccessibility, ACircular: Boolean): TcxTabSheet; + + function GetDefaultStartPageIndex: Integer; + begin + if AGoForward then + Result := 0 + else + Result := PageCount - 1; + end; + + function IncrementIndex(var APageIndex: Integer): Boolean; + const + AStep: array [Boolean] of Integer = (-1, 1); + begin + Result := True; + Inc(APageIndex, AStep[AGoForward]); + if (APageIndex < 0) or (PageCount - 1 < APageIndex) then + if ACircular then + APageIndex := GetDefaultStartPageIndex + else + Result := False; + end; + + function InternalGetNextPage(APagesCount: Integer; APageIndex: Integer): TcxTabSheet; + var + I: Integer; + begin + Result := nil; + for I := 0 to APagesCount - 1 do + begin + if not ACheckTabAccessibility or Pages[APageIndex].TabVisible and Pages[APageIndex].Enabled then + begin + Result := Pages[APageIndex]; + Break; + end + else + if not IncrementIndex(APageIndex) then + Break; + end; + end; + +var + APageIndex: Integer; +begin + Result := nil; + if PageCount <> 0 then + begin + APageIndex := FPages.IndexOf(ACurrentPage); + if APageIndex = -1 then + Result := InternalGetNextPage(PageCount, GetDefaultStartPageIndex) + else + if IncrementIndex(APageIndex) then + Result := InternalGetNextPage(PageCount - 1, APageIndex); + end; +end; + +procedure TcxPageControl.DockDrop(Source: TDragDockObject; X, Y: Integer); +begin + if (DockClient(Source, Point(X, Y)) >= 0) and Assigned(OnDockDrop) then + OnDockDrop(Self, Source, X, Y); +end; + +procedure TcxPageControl.SelectNextPage(GoForward: Boolean; CheckTabVisible: Boolean = True); +var + Page: TcxTabSheet; +begin + Page := FindNextPage(ActivePage, GoForward, CheckTabVisible); + if (Page <> nil) and (Page <> ActivePage) then + ActivePage := Page; +end; + +procedure TcxPageControl.AlignControls(AControl: TControl; var Rect: TRect); +var + ARgn: TcxRegion; +begin + inherited AlignControls(AControl, Rect); + if (ActivePage <> nil) and ActivePage.HandleAllocated and + (ActivePage.BorderWidth > 0) and Painter.IsNativePainting then + begin + ARgn := TcxRegion.Create(GetControlRect(ActivePage)); + try + SendMessage(ActivePage.Handle, WM_NCPAINT, ARgn.Handle, 0); + finally + ARgn.Free; + end; + end; +end; + +function TcxPageControl.CanChange(NewTabIndex: Integer): Boolean; +begin + Result := inherited CanChange(NewTabIndex); + if Result and (NewTabIndex <> -1) then + Result := CanChangeActivePage(Pages[NewTabIndex]); +end; + +function TcxPageControl.CanFocusOnClick: Boolean; +var + ATabIndex: Integer; +begin + Result := inherited CanFocusOnClick; + if Result then + begin + with ScreenToClient(GetMouseCursorPos) do + ATabIndex := IndexOfTabAt(X, Y); + Result := (ATabIndex <> -1) and (ActivePageIndex = ATabIndex); + end; +end; + +procedure TcxPageControl.Change; +begin + LockChangeEvent(True); + try + UpdateActivePage; + finally + LockChangeEvent(False); + end; + inherited Change; +end; + +procedure TcxPageControl.DoAddDockClient(Client: TControl; + const ARect: TRect); +begin + if FNewDockSheet <> nil then Client.Parent := FNewDockSheet; +end; + +function TcxPageControl.DockClient(DockSource: TDragDockObject; + MousePos: TPoint): Integer; + + function CheckDockingControl: Boolean; + var + I: Integer; + begin + Result := True; + for I := 0 to PageCount - 1 do + if DockSource.Control.Parent = Pages[I] then + begin + Pages[I].PageIndex := PageCount - 1; + Result := False; + Break; + end; + end; + +var + ADockingControl: TControl; +begin + Result := 0; + if not CheckDockingControl then + Exit; + FNewDockSheet := TcxTabSheet.Create(Self); + try + try + ADockingControl := DockSource.Control; + if ADockingControl is TCustomForm then + FNewDockSheet.Caption := TCustomForm(ADockingControl).Caption; + FNewDockSheet.PageControl := Self; + ADockingControl.Dock(Self, DockSource.DockRect); + except + FNewDockSheet.Free; + raise; + end; + FNewDockSheet.TabVisible := ADockingControl.Visible; + if ADockingControl.Visible then + ActivePage := FNewDockSheet; + ADockingControl.Align := alClient; + finally + FNewDockSheet := nil; + end; +end; + +procedure TcxPageControl.DoClose; +begin + ActivePage.Free; +end; + +procedure TcxPageControl.DockOver(Source: TDragDockObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); +var + R: TRect; +begin + GetWindowRect(Handle, R); + Source.DockRect := R; + DoDockOver(Source, X, Y, State, Accept); +end; + +procedure TcxPageControl.DoRemoveDockClient(Client: TControl); +begin + if (FUndockingPage <> nil) and not (csDestroying in ComponentState) then + begin + SelectNextPage(True); + FUndockingPage.Free; + FUndockingPage := nil; + end; +end; + +function TcxPageControl.GetActivePage: TcxTabSheet; +begin + Result := ActivePage; +end; + +function TcxPageControl.GetPage(ATabIndex: Integer): TcxTabSheet; +begin + Result := TcxTabSheet(FPages[ATabIndex]); +end; + +procedure TcxPageControl.GetSiteInfo(Client: TControl; + var InfluenceRect: TRect; MousePos: TPoint; var CanDock: Boolean); +begin + CanDock := GetPageFromDockClient(Client) = nil; + inherited GetSiteInfo(Client, InfluenceRect, MousePos, CanDock); +end; + +procedure TcxPageControl.ImageListChange(Sender: TObject); +var + I: Integer; +begin + if FPageInserting then + Exit; + + for I := 0 to PageCount - 1 do + Pages[I].FTab.ImageIndex := Pages[I].ImageIndex; + inherited ImageListChange(Sender); +end; + +procedure TcxPageControl.Loaded; +begin + inherited Loaded; + UpdateTabs; + if (not IsDesigning) and (ActivePage <> nil) and (not ActivePage.Enabled) then + ActivePage := nil; +end; + +procedure TcxPageControl.RequestLayout; +begin + inherited RequestLayout; + if ActivePage <> nil then + ActivePage.Invalidate; +end; + +procedure TcxPageControl.SetChildOrder(Child: TComponent; Order: Integer); +begin + TcxTabSheet(Child).PageIndex := Order; +end; + +procedure TcxPageControl.ShowControl(AControl: TControl); +var + Page: TcxTabSheet; +begin + if (AControl is TcxTabSheet) then + begin + Page := TcxTabSheet(AControl); + if Page.PageControl = Self then + ActivePage := Page; + end; + inherited ShowControl(AControl); +end; + +function TcxPageControl.TabIndexTabMustBeVisible: Boolean; +begin + Result := True; +end; + +function TcxPageControl.UndockClient(NewTarget, Client: TControl): Boolean; +var + APage: TcxTabSheet; +begin + Result := True; + APage := GetPageFromDockClient(Client); + if APage <> nil then + begin + FUndockingPage := APage; + Client.Align := alNone; + end; +end; + +function TcxPageControl.DoUnDock(NewTarget: TWinControl; + Client: TControl): Boolean; +begin + Result := True; + if Assigned(OnUnDock) then + OnUnDock(Self, Client, NewTarget, Result); + Result := Result and UndockClient(NewTarget, Client); +end; + +procedure TcxPageControl.GetChildren(Proc: TGetChildProc; Root: TComponent); +var + I: Integer; +begin + for I := 0 to PageCount - 1 do + Proc(Pages[I]); +end; + +function TcxPageControl.CanChangeActivePage(NewPage: TcxTabSheet): Boolean; +begin + Result := True; + PageChanging(NewPage, Result); +end; + +procedure TcxPageControl.ControlChange(Inserting: Boolean; Child: TControl); +begin + if IsDesigning and Inserting and not (Child is TcxTabSheet) then + begin + Child.SetBounds(Child.Left + Left, Child.Top + Top, Child.Width, Child.Height); + Child.Parent := Parent; + end; +end; + +function TcxPageControl.GetPageFromDockClient(Client: TControl): TcxTabSheet; +var + I: Integer; +begin + Result := nil; + for I := 0 to PageCount - 1 do + begin + if (Client.Parent = Pages[I]) and (Client.HostDockSite = Self) then + begin + Result := Pages[I]; + Exit; + end; + end; +end; + +procedure TcxPageControl.PageChange; +begin + inherited Change; +end; + +procedure TcxPageControl.PageChanging(NewPage: TcxTabSheet; + var AllowChange: Boolean); +begin + if Assigned(FOnPageChanging) and not IsChangeEventLocked then + FOnPageChanging(Self, NewPage, AllowChange); +end; + +procedure TcxPageControl.UpdateActivePage; +begin + if TabIndex = -1 then + ActivePage := nil + else + ActivePage := Pages[TabIndex]; +end; + +procedure TcxPageControl.UpdateTab(APage: TcxTabSheet); +begin + if csLoading in ComponentState then Exit; + with APage.FTab do + begin + Caption := APage.Caption; + Enabled := APage.Enabled; + ImageIndex := APage.ImageIndex; + Highlighted := APage.Highlighted; + Visible := APage.TabVisible; + end; + if FActivePage = APage then + if APage.TabVisible then + TabIndex := APage.FTab.Index + else + TabIndex := -1; +end; + +procedure TcxPageControl.UpdateTabs; +var + I: Integer; +begin + for I := 0 to PageCount - 1 do + UpdateTab(Pages[I]); +end; + +procedure TcxPageControl.ChangeActivePage(APage: TcxTabSheet); +var + ANewActiveControl: TWinControl; + AParentForm: TCustomForm; +begin + if FActivePage <> APage then + begin + if not CanChangeActivePage(APage) then + Exit; + + AParentForm := GetParentForm(Self); + if (AParentForm <> nil) and (FActivePage <> nil) and + FActivePage.ContainsControl(AParentForm.ActiveControl) then + begin + AParentForm.ActiveControl := FActivePage; + if AParentForm.ActiveControl <> FActivePage then + begin + TabIndex := FActivePage.FTab.Index; + Exit; + end; + end; + + ANewActiveControl := nil; + if (APage <> nil) and (AParentForm <> nil) and (FActivePage <> nil) and + (AParentForm.ActiveControl = FActivePage) then + begin + if APage.Enabled and Visible and Enabled and Parent.CanFocus then + ANewActiveControl := APage + else + ANewActiveControl := Self; + end; + if FActivePage <> nil then + FActivePage.Visible := False; + if APage <> nil then + begin + APage.BringToFront; + APage.Visible := True; + APage.Invalidate; + end; + if ANewActiveControl <> nil then + AParentForm.ActiveControl := ANewActiveControl; + FActivePage := APage; + PageChange; + if (AParentForm <> nil) and (FActivePage <> nil) and + (AParentForm.ActiveControl = FActivePage) then + FActivePage.SelectFirst; + + SetModified; + end; +end; + +function TcxPageControl.GetActivePageIndex: Integer; +begin + if ActivePage = nil then + Result := -1 + else + Result := ActivePage.PageIndex; +end; + +function TcxPageControl.GetDockClientFromPoint(P: TPoint): TControl; +var + APage: TcxTabSheet; + AVisibleTabIndex, I: Integer; +begin + Result := nil; + if DockSite then + begin + AVisibleTabIndex := IndexOfTabAt(P.X, P.Y); + if AVisibleTabIndex >= 0 then + begin + APage := nil; + for I := 0 to PageCount - 1 do + if Pages[I].TabIndex = AVisibleTabIndex then + begin + APage := Pages[I]; + Break; + end; + if (APage <> nil) and (APage.ControlCount > 0) then + begin + Result := APage.Controls[0]; + if Result.HostDockSite <> Self then + Result := nil; + end; + end; + end; +end; + +function TcxPageControl.GetPageCount: Integer; +begin + Result := FPages.Count; +end; + +function TcxPageControl.GetTabCount: Integer; +begin + Result := FVisibleTabList.Count; +end; + +procedure TcxPageControl.InsertPage(APage: TcxTabSheet); +var + PageIndex: Integer; +begin + if CanAllocateHandle(Self) then + HandleNeeded; + FPageInserting := True; + try + PageIndex := FPages.Add(APage); + APage.SetParentPageControl(Self); + Tabs.Add(APage.Caption); + finally + FPageInserting := False; + end; + APage.FTab := Tabs.Tabs[PageIndex]; + UpdateTab(APage); +end; + +procedure TcxPageControl.RemovePage(APage: TcxTabSheet); + + function InternalFindNextPage(ACurrentPage: TcxTabSheet; AGoForward, + ACheckTabAccessibility: Boolean): TcxTabSheet; + begin + Result := FindNextPageEx(ACurrentPage, AGoForward, ACheckTabAccessibility, False); + if Result = nil then + Result := FindNextPageEx(ACurrentPage, not AGoForward, ACheckTabAccessibility, False); + end; + +var + ANextPage: TcxTabSheet; +begin + ANextPage := InternalFindNextPage(APage, True, not IsDesigning); + if ANextPage = APage then + ANextPage := nil; + + Tabs.Delete(FPages.Remove(APage)); + APage.FTab := nil; + FTabIndex := -1; + FMainTabVisibleIndex := -1; + ActivePage := ANextPage; + APage.SetParentPageControl(nil); +end; + +procedure TcxPageControl.SetActivePage(APage: TcxTabSheet); +begin + if FActivePageSetting or (APage <> nil) and (APage.PageControl <> Self) then + Exit; + ChangeActivePage(APage); + if ActivePage = APage then + begin + LockChangeEvent(True); + FActivePageSetting := True; + try + if (APage <> nil) and APage.TabVisible then + TabIndex := APage.FTab.Index + else + TabIndex := -1; + finally + FActivePageSetting := False; + LockChangeEvent(False); + end; + end; +end; + +procedure TcxPageControl.SetActivePageIndex(Value: Integer); +begin + if (Value >= 0) and (Value < PageCount) then + ActivePage := Pages[Value] + else + ActivePage := nil; +end; + +procedure TcxPageControl.WMLButtonDown(var Message: TWMLButtonDown); +var + ADockClient: TControl; +begin + inherited; + ADockClient := GetDockClientFromPoint(SmallPointToPoint(Message.Pos)); + if ADockClient <> nil then + ADockClient.BeginDrag(False); +end; + +procedure TcxPageControl.WMLButtonDblClk(var Message: TWMLButtonDblClk); +var + ADockClient: TControl; +begin + inherited; + ADockClient := GetDockClientFromPoint(SmallPointToPoint(Message.Pos)); + if ADockClient <> nil then + ADockClient.ManualDock(nil, nil, alNone); +end; + +procedure TcxPageControl.CMDockNotification(var Message: TCMDockNotification); +var + APage: TcxTabSheet; + I: Integer; + S: string; +begin + APage := GetPageFromDockClient(Message.Client); + if APage <> nil then + case Message.NotifyRec.ClientMsg of + WM_SETTEXT: + begin + S := PChar(Message.NotifyRec.MsgLParam); + for I := 1 to Length(S) do + if (S[I] = #10) or (S[I] = #13) then + begin + SetLength(S, I - 1); + Break; + end; + APage.Caption := S; + end; + CM_VISIBLECHANGED: + APage.TabVisible := Boolean(Message.NotifyRec.MsgWParam); + end; + inherited; +end; + +procedure TcxPageControl.CMControlChange(var Message: TCMControlChange); +begin + inherited; + ControlChange(Message.Inserting, Message.Control); +end; + +procedure TcxPageControl.CMUnDockClient(var Message: TCMUnDockClient); +begin + UndockClient(Message.NewTarget, Message.Client); +end; + +{ TcxPCCustomPainter } + +class function TcxPCCustomPainter.AllowRotate: Boolean; +begin + Result := True; +end; + +procedure TcxPCCustomPainter.CorrectTabRect(TabVisibleIndex: Integer; + var TabRectCorrection: TcxPCRectCorrection); +begin + TabRectCorrection := cxPCEmptyRectCorrection; +end; + +constructor TcxPCCustomPainter.Create( + AParent: TcxCustomTabControl); +begin + inherited Create; + FParentControl := AParent; + FParentInfo := TcxPCPainterParentInfo.Create(AParent); + FSavedClipRgns := TList.Create; +end; + +destructor TcxPCCustomPainter.Destroy; +begin + DestroySavedClipRgns; + FreeAndNil(FSavedClipRgns); + FreeAndNil(FParentInfo); + inherited; +end; + +class function TcxPCCustomPainter.GetStandardStyle: TcxPCStandardStyle; +begin + Result := tsTabs; +end; + +class function TcxPCCustomPainter.GetStyleID: TcxPCStyleID; +begin + Result := cxPCNoStyle; +end; + +class function TcxPCCustomPainter.GetStyleName: TCaption; +begin + Result := ''; +end; + +class function TcxPCCustomPainter.HasLookAndFeel(ALookAndFeel: TcxLookAndFeel): Boolean; +begin + Result := False; +end; + +class function TcxPCCustomPainter.IsDefault(ALookAndFeel: TcxLookAndFeel): Boolean; +begin + Result := False; +end; + +class function TcxPCCustomPainter.IsMainTabBoundWithClient: Boolean; +begin + Result := True; +end; + +class function TcxPCCustomPainter.IsMultiSelectionAccepted: Boolean; +begin + Result := False; +end; + +class function TcxPCCustomPainter.IsStandardStyle: Boolean; +begin + Result := False; +end; + +class function TcxPCCustomPainter.IsTabPressable: Boolean; +begin + Result := False; +end; + +function TcxPCCustomPainter.CreateNewTabVerticalTextBitmap( + TabVisibleIndex: Integer): TBitmap; +begin + with ParentControl.FVisibleTabList[TabVisibleIndex] do + begin + FVerticalTextBitmap := TBitmap.Create; + Result := FVerticalTextBitmap; + end; +end; + +procedure TcxPCCustomPainter.DirectionalPolyline(const R: TRect; + APoints: array of TPoint; ATabPosition: TcxTabPosition; AColor: TColor); +begin + RotatePolyline(R, APoints, ATabPosition); + InternalPolyLine(APoints, AColor); +end; + +function TcxPCCustomPainter.DoCustomDraw(TabVisibleIndex: Integer): Boolean; +begin + Result := True; + ParentControl.OnDrawTab(ParentControl, ParentInfo.VisibleTabs[TabVisibleIndex], + Result); + Result := not Result; +end; + +procedure TcxPCCustomPainter.DrawNativeTabBackground(DC: HDC; ATab: TcxTabSheet); +begin +end; + +procedure TcxPCCustomPainter.DrawTabImageAndText(TabVisibleIndex: Integer); +var + Tab: TcxTab; + + procedure InitializeBitmap(ABitmap: TBitmap; S: TCaption; R: TRect; + AEnabled: Boolean; ABackgroundColor: TColor); + var + ATextRect: TRect; + begin + if IsNativePainting then + ABitmap.Canvas.Font := ParentInfo.Canvas.Font + else + PrepareBitmap(ABitmap, ParentInfo.Canvas, Size(R.Right - R.Left, + R.Bottom - R.Top), ABackgroundColor); + PrepareDrawTabContentBitmapBackground(ABitmap, FOutTabImageAndTextData.TabTextRect.TopLeft, + TabVisibleIndex); + ATextRect := R; + if not IsNativePainting then + OffsetRect(ATextRect, -ATextRect.Left, -ATextRect.Top); + + with ABitmap.Canvas do + begin + Brush.Style := bsClear; + if not AEnabled then + begin + Font.Color := DisabledTextFaceColor; + if NeedDisabledTextShadow then + begin + OffsetRect(ATextRect, 1, 1); + InternalDrawText(ABitmap.Canvas, S, ATextRect, TabVisibleIndex); + OffsetRect(ATextRect, -1, -1); + Font.Color := DisabledTextShadowColor; + end; + end; + InternalDrawText(ABitmap.Canvas, S, ATextRect, TabVisibleIndex); + end; + end; + + procedure OutVerticalText(ACaption: TCaption; const R: TRect; + AEnabled: Boolean; ABackgroundColor: TColor); + var + ABitmap: TBitmap; + begin + ABitmap := GetTabVerticalTextBitmap(TabVisibleIndex); + if ABitmap = nil then + begin + ABitmap := CreateNewTabVerticalTextBitmap(TabVisibleIndex); + ABitmap.PixelFormat := pf32bit; + ABitmap.HandleType := bmDDB; + InitializeBitmap(ABitmap, ACaption, Rect(R.Top, R.Left, R.Bottom, R.Right), + AEnabled, ABackgroundColor); // Rotated rectangle + ParentInfo.Canvas.RotateBitmap(ABitmap, GetTextRotationAngle(ParentControl)); + end; + if IsNativePainting then + Tab.PaintBitmap.Canvas.Draw(R.Left, R.Top, ABitmap) + else + ParentInfo.Canvas.Draw(R.Left, R.Top, ABitmap); + end; + + procedure OutHorizontalText(ACaption: TCaption; const R: TRect; + AEnabled: Boolean; ABackgroundColor: TColor); + var + ABitmap: TBitmap; + begin + if IsNativePainting then + InitializeBitmap(Tab.PaintBitmap, ACaption, R, AEnabled, ABackgroundColor) + else + begin + ABitmap := TBitmap.Create; + ABitmap.PixelFormat := pf32bit; + ABitmap.HandleType := bmDDB; + try + InitializeBitmap(ABitmap, ACaption, R, AEnabled, ABackgroundColor); + ParentInfo.Canvas.Draw(R.Left, R.Top, ABitmap); + finally + ABitmap.Free; + end; + end; + end; + +var + IsTabEnabled: Boolean; + TabImageIndex: TImageIndex; + ABackgroundColor: TColor; +begin + FOutTabImageAndTextData.TabVisibleIndex := TabVisibleIndex; + Tab := ParentInfo.VisibleTabs[TabVisibleIndex]; + PrepareTabCanvasFont(Tab, ParentInfo.Canvas); + StandardPainterPrepareOutTabImageAndTextData(TabVisibleIndex); + ABackgroundColor := GetTabBodyColor(TabVisibleIndex); + + with FOutTabImageAndTextData do + begin + IsTabEnabled := Tab.RealEnabled; + TabImageIndex := ParentControl.GetImageIndex(Tab.Index); + if TabImageIndex <> -1 then + if IsNativePainting then + ParentControl.FImages.Draw(Tab.PaintBitmap.Canvas, TabImageRect.Left, + TabImageRect.Top, TabImageIndex, ABackgroundColor, IsTabEnabled) + else + begin + ParentControl.FImages.Draw(ParentInfo.Canvas.Canvas, TabImageRect.Left, + TabImageRect.Top, TabImageIndex, ABackgroundColor, IsTabEnabled); + end; + + if Tab.Caption <> '' then + begin + if InternalIsVerticalText(ParentControl) then + OutVerticalText(Tab.Caption, TabTextRect, IsTabEnabled, ABackgroundColor) + else + OutHorizontalText(Tab.Caption, TabTextRect, IsTabEnabled, ABackgroundColor); + end; + end; + ExcludeTabContentClipRegion(TabVisibleIndex); +end; + +procedure TcxPCCustomPainter.ExcludeTabContentClipRegion(ATabVisibleIndex: Integer); +var + AContentRgn: TcxRegion; +begin + if IsNativePainting then + Exit; + + AContentRgn := TcxRegion.Create(FOutTabImageAndTextData.TabTextRect); + AContentRgn.Combine(TcxRegion.Create(FOutTabImageAndTextData.TabImageRect), roAdd); + AContentRgn.Combine(GetTabClipRgn(ATabVisibleIndex), roIntersect); + ParentInfo.Canvas.SetClipRegion(AContentRgn, roSubtract); +end; + +procedure TcxPCCustomPainter.FillDisplayRect; +begin + ParentInfo.Canvas.Brush.Style := bsSolid; + ParentInfo.Canvas.Brush.Color := GetClientColor; + ParentInfo.Canvas.FillRect(GetClientRect); +end; + +procedure TcxPCCustomPainter.FillTabPaneContent; +begin + FillDisplayRect; +end; + +function TcxPCCustomPainter.GetButtonsDistance( + AButton1, AButton2: TcxPCNavigatorButton): Integer; +begin + Result := 0; +end; + +function TcxPCCustomPainter.GetButtonsRegionFromTabsOffset: Integer; +begin + Result := 0; +end; + +function TcxPCCustomPainter.GetButtonsRegionHOffset: Integer; +begin + Result := 0; +end; + +function TcxPCCustomPainter.GetButtonsRegionWOffset: Integer; +begin + Result := 0; +end; + +function TcxPCCustomPainter.GetClientColor: TColor; +begin + if ParentInfo.MainTabVisibleIndex <> -1 then + Result := ParentInfo.PageColors[ParentInfo.MainTabVisibleIndex] + else + Result := ParentInfo.Color; +end; + +function TcxPCCustomPainter.GetClientRect: TRect; +begin + Result := GetExtendedRect(GetControlRect(ParentControl), + GetClientRectOffset, ParentInfo.TabPosition); + ValidateRect(Result); +end; + +function TcxPCCustomPainter.GetClientRectOffset: TRect; +begin + Result := GetDisplayRectOffset; + if NeedShowFrame then + OffsetRect(Result, GetFrameWidth, GetFrameWidth); +end; + +function TcxPCCustomPainter.GetDisplayRect: TRect; +begin + Result := GetExtendedRect(GetControlRect(ParentControl), + GetDisplayRectOffset, ParentInfo.TabPosition); + ValidateRect(Result); +end; + +function TcxPCCustomPainter.GetDisplayRectOffset: TRect; +begin + Result := cxEmptyRect; + if ParentInfo.HideTabs or (ParentInfo.RowCount = 0) then + Exit; + case ParentInfo.TabPosition of + tpTop: + begin + Result.Top := ParentInfo.ExtendedTopOrLeftTabsRect.Bottom; + if ParentInfo.TopOrLeftPartRowCount <> ParentInfo.RowCount then + Result.Bottom := ParentInfo.Height - ParentInfo.ExtendedBottomOrRightTabsRect.Top; + end; + tpLeft: + begin + Result.Top := ParentInfo.ExtendedTopOrLeftTabsRect.Right; + if ParentInfo.TopOrLeftPartRowCount <> ParentInfo.RowCount then + Result.Bottom := ParentInfo.Width - ParentInfo.ExtendedBottomOrRightTabsRect.Left; + end; + tpBottom: + begin + Result.Top := ParentInfo.Height - ParentInfo.ExtendedBottomOrRightTabsRect.Top; + if ParentInfo.TopOrLeftPartRowCount <> 0 then + Result.Bottom := ParentInfo.ExtendedTopOrLeftTabsRect.Bottom; + end; + tpRight: + begin + Result.Top := ParentInfo.Width - ParentInfo.ExtendedBottomOrRightTabsRect.Left; + if ParentInfo.TopOrLeftPartRowCount <> 0 then + Result.Bottom := ParentInfo.ExtendedTopOrLeftTabsRect.Right; + end; + end; +end; + +function TcxPCCustomPainter.GetExtendedRect(const ARect, AExtension: TRect; ATabPosition: TcxTabPosition): TRect; +begin + Result := ARect; + cxGraphics.ExtendRect(Result, RotateRect(AExtension, ATabPosition)); +end; + +function TcxPCCustomPainter.GetFrameWidth: Integer; +begin + Result := 0; +end; + +procedure TcxPCCustomPainter.DestroySavedClipRgns; +var + I: Integer; +begin + for I := 0 to FSavedClipRgns.Count - 1 do + DeleteObject(HRGN(FSavedClipRgns[I])); +end; + +function TcxPCCustomPainter.GetDisabledTextFaceColor: TColor; +begin + Result := clBtnHighlight; +end; + +function TcxPCCustomPainter.GetDisabledTextShadowColor: TColor; +begin + Result := clBtnShadow; +end; + +function TcxPCCustomPainter.GetHighlightedTabBodyColor: TColor; +begin + Result := clHighlight; +end; + +procedure TcxPCCustomPainter.PrepareTabControlImagesBitmapBackground(ABitmap: TBitmap); +begin + with FOutTabImageAndTextData do + PrepareDrawTabContentBitmapBackground(ABitmap, TabImageRect.TopLeft, TabVisibleIndex); +end; + +procedure TcxPCCustomPainter.AfterPaintTab(ATabVisibleIndex: Integer); +begin + ParentControl.AfterPaintTab(ParentInfo.Canvas, ParentInfo.VisibleTabs[ATabVisibleIndex], + FOutTabImageAndTextData); +end; + +function TcxPCCustomPainter.AlwaysColoredTabs: Boolean; +begin + Result := False; +end; + +function TcxPCCustomPainter.GetHighlightedTextColor(ATabVisibleIndex: Integer; + ATextColor: TColor): TColor; +var + AColor: TColorRef; + ATheme: TdxTheme; +begin + if IsNativePainting then + begin + ATheme := OpenTheme(totTab); + if GetThemeColor(ATheme, TABP_TABITEM, GetTabNativeState(ATabVisibleIndex), TMT_TEXTCOLOR, AColor) = S_OK then + Result := AColor + else + Result := ATextColor; + end + else + Result := clHighlightText; +end; + +function TcxPCCustomPainter.GetHotTrackColor: TColor; +begin + if IsWin98Or2000 then + Result := GetSysColor(COLOR_HOTLIGHT) + else + Result := clBlue; +end; + +function TcxPCCustomPainter.GetMaxTabCaptionHeight: Integer; +var + ATextHeight: Integer; + I: Integer; +begin + Result := 0; + for I := 0 to ParentControl.VisibleTabList.Count - 1 do + begin + ATextHeight := TextSize(ParentInfo.VisibleTabs[I], 'Zg').cy; + if ATextHeight > Result then + Result := ATextHeight; + end; +end; + +function TcxPCCustomPainter.GetNativeContentOffset: TRect; +var + R: TRect; +begin + R := Rect(0, 0, 100, 100); + GetThemeBackgroundContentRect(OpenTheme(totTab), 0, TABP_PANE, 0, R, Result); + Result.Right := R.Right - Result.Right; + Result.Bottom := R.Bottom - Result.Bottom; + + if IsStandardTheme then + begin + if ParentInfo.IsTabsContainer then + Result.Left := TabsContainerBaseWidth + else + Result.Left := Max(Result.Left, Result.Top); + Result.Top := Result.Left; + Result.Right := Result.Left * 2;//Max(Result.Right, Result.Bottom); + Result.Bottom := Result.Top * 2;//Result.Right; + end; +end; + +function TcxPCCustomPainter.GetTabBaseImageSize: TSize; +begin + Result := ParentControl.FImages.BaseImageSize; +end; + +function TcxPCCustomPainter.GetTabColor(ATabVisibleIndex: Integer): TColor; +begin + Result := ParentInfo.TabColors[ATabVisibleIndex]; +end; + +function TcxPCCustomPainter.GetTabClipRgn(ATabVisibleIndex: Integer): TcxRegion; +begin + Result := TcxRegion.Create(ParentInfo.VisibleTabs[ATabVisibleIndex].VisibleRect); +end; + +function TcxPCCustomPainter.GetTabClipRgnOperation(ATabVisibleIndex: Integer): TcxRegionOperation; +begin + Result := roIntersect; +end; + +procedure TcxPCCustomPainter.GetTabNativePartAndState(ATabVisibleIndex: Integer; + out PartId, StateId: Integer); +begin + PartId := 0; + StateId := 0; +end; + +function TcxPCCustomPainter.GetTabNativeState(ATabVisibleIndex: Integer): Integer; +var + ATab: TcxTab; +begin + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + if ATab.IsMainTab then + Result := TIS_SELECTED + else + if ATab.HotTrack then + Result := TIS_HOT + else + Result := TIS_NORMAL; +end; + +function TcxPCCustomPainter.GetTabRotatedImageSize: TSize; +begin + Result := ParentControl.FImages.RotatedImageSize; +end; + +function TcxPCCustomPainter.GetTabsContainerOffsets: TRect; +begin + Result := cxEmptyRect; +end; + +function TcxPCCustomPainter.GetTabsNormalDistance: TcxPCDistance; +begin + Result.dw := 0; + Result.dh := 0; +end; + +function TcxPCCustomPainter.GetTabVerticalTextBitmap( + TabVisibleIndex: Integer): TBitmap; +begin + Result := ParentInfo.VisibleTabs[TabVisibleIndex].VerticalTextBitmap; +end; + +function TcxPCCustomPainter.GetTextColor(ATabVisibleIndex: Integer): TColor; +var + ATab: TcxTab; +begin + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + if ATab.Highlighted then + Result := GetHighlightedTextColor(ATabVisibleIndex, ParentInfo.Font.Color) + else + if ATab.HotTrack then + Result := GetHotTrackColor + else + Result := clBtnText; +end; + +procedure TcxPCCustomPainter.Init; +begin +end; + +procedure TcxPCCustomPainter.InternalPaint; +begin + if not ParentInfo.HideTabs then + begin + PaintButtonsRegion; + PaintTabsRegion; + end; + PaintClientArea; +end; + +procedure TcxPCCustomPainter.InternalDrawText(ACanvas: TCanvas; + const ACaption: string; ARect: TRect; ATabVisibleIndex: Integer); +var + APartId, AStateId: Integer; +begin + if IsNativePainting and ParentInfo.VisibleTabs[ATabVisibleIndex].RealEnabled and + AreVisualStylesAvailable then + begin + GetTabNativePartAndState(ATabVisibleIndex, APartId, AStateId); + DrawThemeText(OpenTheme(totTab), ACanvas.Handle, APartId, + AStateId, ACaption, -1, DT_SINGLELINE or DT_END_ELLIPSIS, 0, ARect); + end + else + cxDrawText(ACanvas.Handle, ACaption, ARect, DT_SINGLELINE or DT_END_ELLIPSIS); +end; + +procedure TcxPCCustomPainter.InternalInvalidateRect(Rect: TRect); +begin + ParentControl.InternalInvalidateRect(Rect); +end; + +procedure TcxPCCustomPainter.InternalPolyLine(const APoints: array of TPoint; + AColor: TColor; ACanvas: TCanvas = nil); +var + ALastPoint: TPoint; +begin + if ACanvas = nil then + ACanvas := ParentInfo.Canvas.Canvas; + ACanvas.Pen.Color := AColor; + ACanvas.Polyline(APoints); + ALastPoint := APoints[High(APoints)]; + ACanvas.Polyline([ALastPoint, Point(ALastPoint.X + 1, ALastPoint.Y + 1)]); +end; + +procedure TcxPCCustomPainter.InternalResetClipRegion; +begin + RestoreClipRgn; +end; + +function TcxPCCustomPainter.InternalSetClipRect(ClipR: TRect; + IntersectWithCurrentClipRegion: Boolean = True): Boolean; +var + RectClipRegion: HRGN; +begin + Result := False; + if IsRectEmpty(ClipR) then Exit; + with ParentInfo.Canvas do + begin + if IntersectWithCurrentClipRegion and + (not Windows.RectVisible(Handle, ClipR)) then Exit; + SaveClipRgn; + if IntersectWithCurrentClipRegion then + IntersectClipRect(ClipR) + else + begin + with ClipR do + RectClipRegion := Windows.CreateRectRgn(Left, Top, Right, Bottom); + SelectClipRgn(Handle, RectClipRegion); + DeleteObject(RectClipRegion); + end; + end; + Result := True; +end; + +procedure TcxPCCustomPainter.InvalidateTabExtendedTabsRect(TabVisibleIndex: Integer); +var + TabExtendedRect: TRect; +begin + with ParentControl do + begin + TabExtendedRect := GetTabExtendedTabsRect(TabVisibleIndex); + InternalInvalidateRect(TabExtendedRect); + end; +end; + +procedure TcxPCCustomPainter.InvalidateTabRect(ATabVisibleIndex: Integer); +begin + ParentControl.InternalInvalidateRect(ParentInfo.VisibleTabs[ATabVisibleIndex].VisibleRect); +end; + +function TcxPCCustomPainter.IsAssignedImages: Boolean; +begin + Result := GetTabBaseImageSize.cx > 0; +end; + +function TcxPCCustomPainter.IsCustomDraw: Boolean; +begin + Result := ParentControl.OwnerDraw and Assigned(ParentControl.OnDrawTab); +end; + +function TcxPCCustomPainter.IsEnableHotTrack: Boolean; +begin + Result := IsNativePainting; +end; + +function TcxPCCustomPainter.IsNativePainting: Boolean; +begin + Result := False; +end; + +function TcxPCCustomPainter.IsOverTab(TabVisibleIndex: Integer; X, + Y: Integer): Boolean; +begin + Result := True; +end; + +function TcxPCCustomPainter.IsTabHasImage(ATabVisibleIndex: Integer): Boolean; +begin + Result := IsAssignedImages and (ParentInfo.VisibleTabs[ATabVisibleIndex].ImageIndex >= 0); +end; + +function TcxPCCustomPainter.IsTabTransparent(ATabVisibleIndex: Integer): Boolean; +begin + Result := False; +end; + +function TcxPCCustomPainter.NeedDisabledTextShadow: Boolean; +begin + Result := True; +end; + +function TcxPCCustomPainter.NeedRedrawOnResize: Boolean; +begin + Result := IsNativePainting; +end; + +function TcxPCCustomPainter.NeedShowFrame: Boolean; +begin + Result := ParentInfo.ShowFrame; +end; + +procedure TcxPCCustomPainter.Paint; +begin + InternalPaint; +end; + +procedure TcxPCCustomPainter.PaintClientArea; +begin + if NeedShowFrame then + PaintFrame; + FillDisplayRect; + ParentInfo.Canvas.ExcludeClipRect(GetDisplayRect); +end; + +procedure TcxPCCustomPainter.PrepareTabCanvasFont(ATab: TcxTab; ACanvas: TcxCanvas); +begin + ParentControl.PrepareTabCanvasFont(ATab, ACanvas); +end; + +procedure TcxPCCustomPainter.PrepareDrawTabContentBitmapBackground( + ABitmap: TBitmap; const ABitmapPos: TPoint; ATabVisibleIndex: Integer); +begin +end; + +procedure TcxPCCustomPainter.RepaintButton( + Button: TcxPCNavigatorButton; OldButtonState: TcxPCNavigatorButtonState); +begin +end; + +procedure TcxPCCustomPainter.RepaintButtonsRegion; +begin +end; + +procedure TcxPCCustomPainter.RepaintTab(TabVisibleIndex: Integer; + TabPropertyChanged: TcxPCTabPropertyChanged); +begin +end; + +procedure TcxPCCustomPainter.RestoreClipRgn; +var + ARgn: HRGN; +begin + if FSavedClipRgns.Count = 0 then + Exit; + ARgn := HRGN(FSavedClipRgns.Last); + SelectClipRgn(ParentInfo.Canvas.Handle, ARgn); + if ARgn <> 0 then + DeleteObject(ARgn); + FSavedClipRgns.Delete(FSavedClipRgns.Count - 1); +end; + +procedure TcxPCCustomPainter.RotatePoint(const R: TRect; var P: TPoint; + ATabPosition: TcxTabPosition); +begin + case ATabPosition of + tpBottom: + P.Y := R.Bottom - 1 - (P.Y - R.Top); + tpLeft: + P := Point(R.Right - 1 - (R.Bottom - 1 - P.Y), R.Bottom - 1 - (P.X - R.Left)); + tpRight: + P := Point(R.Bottom - 1 - P.Y + R.Left, R.Bottom - 1 - (P.X - R.Left)); + end; +end; + +procedure TcxPCCustomPainter.RotatePolyline(const R: TRect; var APoints: array of TPoint; + ATabPosition: TcxTabPosition); +var + I: Integer; +begin + for I := 0 to High(APoints) do + RotatePoint(R, APoints[I], ATabPosition); +end; + +procedure TcxPCCustomPainter.SaveClipRgn; +var + ARgn: HRGN; +begin + ARgn := CreateRectRgn(0, 0, 0, 0); + if GetClipRgn(ParentInfo.Canvas.Handle, ARgn) = 1 then + FSavedClipRgns.Add(Pointer(ARgn)) + else + begin + DeleteObject(ARgn); + FSavedClipRgns.Add(nil); + end; +end; + +procedure TcxPCCustomPainter.StandardPainterPrepareOutTabImageAndTextData( + TabVisibleIndex: Integer); +var + AHasImages, ATabHasImage: Boolean; + ImageRect, TextRect: TRect; + Tab: TcxTab; + + procedure CorrectTabContentHOffset(var ADrawOffset: TRect); + + procedure CorrectNonpressableTabContentHOffset(var ADrawOffset: TRect); + begin + if ParentInfo.Rotate then + begin + ADrawOffset.Top := 0; + ADrawOffset.Bottom := 0; + end; + end; + + procedure CorrectPressableTabContentHOffset(var ADrawOffset: TRect); + begin + if InternalGetTextRotationAngle(ParentControl) = raMinus90 then + begin + if not IsTabBorderThick(TabVisibleIndex) then + begin + Inc(ADrawOffset.Top); + Dec(ADrawOffset.Bottom); + end; + end + else + if IsTabBorderThick(TabVisibleIndex) then + begin + Inc(ADrawOffset.Top); + Dec(ADrawOffset.Bottom); + end; + end; + + begin + if IsTabPressable then + CorrectPressableTabContentHOffset(ADrawOffset) + else + CorrectNonpressableTabContentHOffset(ADrawOffset); + end; + + procedure CalculateImageHPosition; + var + ADrawImageOffset: TRect; + ATempVar: Integer; + TextRotationAngle: TcxRotationAngle; + ImageSize: TSize; + begin + if not ATabHasImage then + Exit; + + ADrawImageOffset := GetDrawImageOffset(TabVisibleIndex); + CorrectTabContentHOffset(ADrawImageOffset); + if IsMainTabBoundWithClient and (Tab.PaintingPositionIndex in [5, 7, 10]) then + begin + ATempVar := ADrawImageOffset.Top; + ADrawImageOffset.Top := ADrawImageOffset.Bottom; + ADrawImageOffset.Bottom := ATempVar; + end; + ImageSize := GetTabRotatedImageSize; + if IsNativePainting then + with Tab.FullRect do + if IsVerticalText(ParentControl) then + ImageRect := Rect(0, 0, Bottom - Top, Right - Left) + else + ImageRect := Rect(0, 0, Right - Left, Bottom - Top) + else + ImageRect := Tab.FullRect; + TextRotationAngle := InternalGetTextRotationAngle(ParentControl); + with ImageRect do + case TextRotationAngle of + ra0: + begin + Inc(Top, ADrawImageOffset.Top); + Dec(Bottom, ADrawImageOffset.Bottom); + Top := Top + (Bottom - Top - ImageSize.cy) div 2; + Bottom := Top + ImageSize.cy; + end; + raPlus90: + begin + Inc(Left, ADrawImageOffset.Top); + Dec(Right, ADrawImageOffset.Bottom); + Left := Left + (Right - Left - ImageSize.cx) div 2; + Right := Left + ImageSize.cx; + end; + raMinus90: + begin + Inc(Left, ADrawImageOffset.Bottom); + Dec(Right, ADrawImageOffset.Top); + Right := Right - (Right - Left - ImageSize.cx) div 2; + Left := Right - ImageSize.cx; + end; + end; + end; + + procedure CalculateTextHPosition; + var + ADrawTextOffset: TRect; + ATempVar: Integer; + ATextHeight: Integer; + begin + if Tab.Caption = '' then + Exit; + if IsNativePainting then + with Tab.FullRect do + if IsVerticalText(ParentControl) then + TextRect := Rect(0, 0, Bottom - Top, Right - Left) + else + TextRect := Rect(0, 0, Right - Left, Bottom - Top) + else + TextRect := Tab.FullRect; + + ADrawTextOffset := GetDrawTextHOffset(TabVisibleIndex); + CorrectTabContentHOffset(ADrawTextOffset); + + if IsMainTabBoundWithClient and (Tab.PaintingPositionIndex in [5, 7, 10]) then + begin + ATempVar := ADrawTextOffset.Top; + ADrawTextOffset.Top := ADrawTextOffset.Bottom; + ADrawTextOffset.Bottom := ATempVar; + end; + if AHasImages then + Inc(ADrawTextOffset.Left, ParentInfo.ImageBorder); + ATextHeight := ParentInfo.Canvas.TextHeight('Zg'); + with TextRect do + case InternalGetTextRotationAngle(ParentControl) of + ra0: + begin + Inc(Top, ADrawTextOffset.Top); + Dec(Bottom, ADrawTextOffset.Bottom); + Top := Top + (Bottom - Top - ATextHeight) div 2; + Bottom := Top + ATextHeight; + end; + raPlus90: + begin + Inc(Left, ADrawTextOffset.Top); + Dec(Right, ADrawTextOffset.Bottom); + Left := Left + (Right - Left - ATextHeight) div 2; + Right := Left + ATextHeight; + end; + raMinus90: + begin + Inc(Left, ADrawTextOffset.Bottom); + Dec(Right, ADrawTextOffset.Top); + Right := Right - (Right - Left - ATextHeight) div 2; + Left := Right - ATextHeight; + end; + end; + end; + + procedure CorrectTabContentWOffset(var AOffset: TcxPCWOffset; AIsCentering: Boolean); + var + ATempVar: Integer; + begin + if IsNativePainting and (Tab.PaintingPositionIndex in [2, 9, 12]) then + begin + ATempVar := AOffset.Left; + AOffset.Left := AOffset.Right; + AOffset.Right := ATempVar; + end; + + if not IsTabPressable then + Exit; + + if InternalGetTextRotationAngle(ParentControl) = raPlus90 then + begin + if AIsCentering then + begin + if IsTabBorderThick(TabVisibleIndex) then + begin + Dec(AOffset.Left); + Inc(AOffset.Right); + end; + end + else + if IsTabBorderThick(TabVisibleIndex) then + begin + Dec(AOffset.Left); + Inc(AOffset.Right); + end; + end + else + if IsTabBorderThick(TabVisibleIndex) then + begin + Inc(AOffset.Left); + Dec(AOffset.Right); + end; + end; + + procedure CalculateImageWPosition; + var + ADrawImageOffset: TcxPCWOffset; + AImageSize: TSize; + AImageRect: TRect; + ATextRotationAngle: TcxRotationAngle; + begin + AImageSize := GetTabBaseImageSize; + if IsNativePainting then + with Tab.FullRect do + if IsVerticalText(ParentControl) then + AImageRect := Rect(0, 0, Bottom - Top, Right - Left) + else + AImageRect := Rect(0, 0, Right - Left, Bottom - Top) + else + AImageRect := Tab.FullRect; + ATextRotationAngle := InternalGetTextRotationAngle(ParentControl); + ADrawImageOffset := GetDrawImageWithoutTextWOffset(TabVisibleIndex); + CorrectTabContentWOffset(ADrawImageOffset, True); + with AImageRect do + case ATextRotationAngle of + ra0: + begin + Inc(AImageRect.Left, ADrawImageOffset.Left); + Dec(AImageRect.Right, ADrawImageOffset.Right); + begin + ImageRect.Left := Left + (Right - Left - AImageSize.cx) div 2; + ImageRect.Right := ImageRect.Left + AImageSize.cx; + end; + end; + raPlus90: + begin + Dec(AImageRect.Bottom, ADrawImageOffset.Left); + Inc(AImageRect.Top, ADrawImageOffset.Right); + if IsTabPressable then + begin + ImageRect.Top := Top + (Bottom - Top - AImageSize.cx) div 2; + ImageRect.Bottom := ImageRect.Top + AImageSize.cx; + end + else + begin + ImageRect.Bottom := Bottom - (Bottom - Top - AImageSize.cx) div 2; + ImageRect.Top := ImageRect.Bottom - AImageSize.cx; + end; + end; + raMinus90: + begin + Inc(AImageRect.Top, ADrawImageOffset.Left); + Dec(AImageRect.Bottom, ADrawImageOffset.Right); + ImageRect.Top := Top + (Bottom - Top - AImageSize.cx) div 2; + ImageRect.Bottom := ImageRect.Top + AImageSize.cx; + end; + end; + end; + + procedure CalculateImageAndTextWPositions; + + function GetContentWOffset(ATabWidth, AContentWidth: Integer): Integer; + var + ACaptionAlignment: TAlignment; + begin + if not ParentInfo.Rotate or (ParentInfo.TabWidth > 0) or (ParentControl.MaxRotatedTabWidth > 0) then + ACaptionAlignment := taCenter + else + ACaptionAlignment := ParentControl.TabCaptionAlignment; + case ACaptionAlignment of + taLeftJustify: + Result := (ATabWidth - ParentControl.FMaxTabCaptionWidth) div 2; + taRightJustify: + Result := (ATabWidth - ParentControl.FMaxTabCaptionWidth) div 2 + + ParentControl.FMaxTabCaptionWidth - AContentWidth; + else + Result := (ATabWidth - AContentWidth) div 2; + end; + end; + + var + AContentWidth, W: Integer; + AImageSize: TSize; + ATabContentWOffset: TcxPCWOffset; + AIsTabTooNarrow: Boolean; + AVisibleTextWidth: Integer; + R: TRect; + + procedure CalculateVisibleTextWidth; + var + ATempRect: TRect; + L: Integer; + S: string; + begin + ATempRect := Rect(0, 0, W - AContentWidth, 0); + S := Tab.Caption; + L := Length(S); + SetLength(S, L + Length('....')); + S[L + 1] := #0; + DrawText(ParentInfo.Canvas.Handle, PChar(S), -1, + ATempRect, DT_SINGLELINE or DT_CALCRECT or DT_END_ELLIPSIS or DT_MODIFYSTRING); + SetLength(S, StrLen(PChar(S))); + AVisibleTextWidth := ATempRect.Right; + if (AVisibleTextWidth > W - AContentWidth) or (S = '&...') then + AVisibleTextWidth := 0; + end; + + procedure InternalCalculateImageAndTextWPositions; + var + AImageTextDistance: Integer; + begin + if AContentWidth <= 0 then + begin + ImageRect := cxEmptyRect; + TextRect := cxEmptyRect; + Exit; + end; + + AImageTextDistance := GetImageTextDistance(TabVisibleIndex); + case InternalGetTextRotationAngle(ParentControl) of + ra0: + begin + Inc(R.Left, ATabContentWOffset.Left); + if not AIsTabTooNarrow and not (AHasImages and ParentInfo.Rotate) then + Inc(R.Left, GetContentWOffset(W, AContentWidth)); + if ATabHasImage then + begin + ImageRect.Left := R.Left + ParentInfo.ImageBorder; + ImageRect.Right := ImageRect.Left + AImageSize.cx; + end; + if AHasImages and ParentInfo.Rotate or ATabHasImage then + Inc(R.Left, ParentInfo.ImageBorder * 2 + AImageSize.cx + AImageTextDistance); + + if not AIsTabTooNarrow and AHasImages and ParentInfo.Rotate then + Inc(R.Left, GetContentWOffset(R.Right - R.Left - ATabContentWOffset.Right, AVisibleTextWidth)); + TextRect.Left := R.Left; + TextRect.Right := TextRect.Left + AVisibleTextWidth; + end; + raPlus90: + begin + Dec(R.Bottom, ATabContentWOffset.Left); + if not AIsTabTooNarrow and not (AHasImages and ParentInfo.Rotate) then + Dec(R.Bottom, GetContentWOffset(W, AContentWidth)); + if ATabHasImage then + begin + ImageRect.Bottom := R.Bottom - ParentInfo.ImageBorder; + ImageRect.Top := ImageRect.Bottom - AImageSize.cx; + end; + if AHasImages and ParentInfo.Rotate or ATabHasImage then + Dec(R.Bottom, ParentInfo.ImageBorder * 2 + AImageSize.cx + AImageTextDistance); + + if not AIsTabTooNarrow and AHasImages and ParentInfo.Rotate then + Dec(R.Bottom, GetContentWOffset(R.Bottom - R.Top - ATabContentWOffset.Right, AVisibleTextWidth)); + TextRect.Bottom := R.Bottom; + TextRect.Top := TextRect.Bottom - AVisibleTextWidth; + end; + raMinus90: + begin + Inc(R.Top, ATabContentWOffset.Left); + if not AIsTabTooNarrow and not (AHasImages and ParentInfo.Rotate) then + Inc(R.Top, GetContentWOffset(W, AContentWidth)); + if ATabHasImage then + begin + ImageRect.Top := R.Top + ParentInfo.ImageBorder; + ImageRect.Bottom := ImageRect.Top + AImageSize.cx; + end; + if AHasImages and ParentInfo.Rotate or ATabHasImage then + Inc(R.Top, ParentInfo.ImageBorder * 2 + AImageSize.cx + AImageTextDistance); + + if not AIsTabTooNarrow and AHasImages and ParentInfo.Rotate then + Inc(R.Top, GetContentWOffset(R.Bottom - R.Top - ATabContentWOffset.Right, AVisibleTextWidth)); + TextRect.Top := R.Top; + TextRect.Bottom := TextRect.Top + AVisibleTextWidth; + end; + end; + end; + + begin + if IsNativePainting then + with Tab.FullRect do + if IsVerticalText(ParentControl) then + R := Rect(0, 0, Bottom - Top, Right - Left) + else + R := Rect(0, 0, Right - Left, Bottom - Top) + else + R := Tab.FullRect; + if InternalIsVerticalText(ParentControl) then + W := R.Bottom - R.Top + else + W := R.Right - R.Left; + ATabContentWOffset := GetTabContentWOffset(TabVisibleIndex); + CorrectTabContentWOffset(ATabContentWOffset, AHasImages); + if IsTabPressable and AHasImages and (GetTextRotationAngle(ParentControl) = raPlus90) then + begin + Inc(ATabContentWOffset.Left); + Dec(ATabContentWOffset.Right); + end; + Dec(W, ATabContentWOffset.Left + ATabContentWOffset.Right); + AContentWidth := 0; + if AHasImages and ParentInfo.Rotate or ATabHasImage then + begin + AImageSize := GetTabBaseImageSize; + AContentWidth := AImageSize.cx + 2 * ParentInfo.ImageBorder + GetImageTextDistance(TabVisibleIndex); + end; + + AIsTabTooNarrow := TextSize(Tab, Tab.Caption, ParentInfo.Canvas.Font).cx > W - AContentWidth; + if AIsTabTooNarrow then + begin + Inc(W, ATabContentWOffset.Left + ATabContentWOffset.Right); + ATabContentWOffset := GetTooNarrowTabContentWOffset(TabVisibleIndex); + CorrectTabContentWOffset(ATabContentWOffset, AHasImages); + if IsTabPressable and AHasImages and (GetTextRotationAngle(ParentControl) = raPlus90) then + begin + Inc(ATabContentWOffset.Left); + Dec(ATabContentWOffset.Right); + end; + Dec(W, ATabContentWOffset.Left + ATabContentWOffset.Right); + end; + + CalculateVisibleTextWidth; + Inc(AContentWidth, AVisibleTextWidth); + + InternalCalculateImageAndTextWPositions; + end; + + procedure CalculateWPositions; + begin + if ATabHasImage and (Tab.Caption = '') then + CalculateImageWPosition; + if Tab.Caption <> '' then + CalculateImageAndTextWPositions; + end; + +begin + Tab := ParentInfo.VisibleTabs[TabVisibleIndex]; + AHasImages := IsAssignedImages; + ATabHasImage := IsTabHasImage(TabVisibleIndex); + if not ATabHasImage then + ImageRect := cxEmptyRect; + if Tab.Caption = '' then + TextRect := cxEmptyRect; + CalculateImageHPosition; + CalculateTextHPosition; + CalculateWPositions; + InternalPrepareOutTabImageAndTextData(TabVisibleIndex, ImageRect, TextRect); +end; + +{ TcxPCPainterParentInfo } + +constructor TcxPCPainterParentInfo.Create( + AParent: TcxCustomTabControl); +begin + inherited Create; + FParent := AParent; +end; + +function TcxPCPainterParentInfo.GetActivePage: TcxTabSheet; +begin + Result := FParent.GetActivePage; +end; + +function TcxPCPainterParentInfo.GetCanvas: TcxCanvas; +begin + Result := FParent.Canvas; +end; + +function TcxPCPainterParentInfo.GetFont: TFont; +begin + Result := FParent.Font; +end; + +function TcxPCPainterParentInfo.GetIsTabsContainer: Boolean; +begin + Result := FParent.IsTabsContainer; +end; + +function TcxPCPainterParentInfo.GetColor: TColor; +begin + Result := FParent.Color; +end; + +function TcxPCPainterParentInfo.GetExtendedBottomOrRightTabsRect: TRect; +begin + Result := FParent.FExtendedBottomOrRightTabsRect; +end; + +function TcxPCPainterParentInfo.GetExtendedTopOrLeftTabsRect: TRect; +begin + Result := FParent.FExtendedTopOrLeftTabsRect; +end; + +function TcxPCPainterParentInfo.GetHeight: Integer; +begin + Result := FParent.Height; +end; + +function TcxPCPainterParentInfo.GetHideTabs: Boolean; +begin + Result := FParent.HideTabs; +end; + +function TcxPCPainterParentInfo.GetImageBorder: Integer; +begin + Result := FParent.ImageBorder; +end; + +function TcxPCPainterParentInfo.GetMainTabVisibleIndex: Integer; +begin + Result := FParent.FMainTabVisibleIndex; +end; + +function TcxPCPainterParentInfo.GetMultiLine: Boolean; +begin + Result := FParent.MultiLine; +end; + +function TcxPCPainterParentInfo.GetNavigatorButtons: TcxPCNavigatorButtons; +begin + Result := FParent.FNavigatorButtons; +end; + +function TcxPCPainterParentInfo.GetNavigatorButtonState( + Index: TcxPCNavigatorButton): TcxPCNavigatorButtonState; +begin + Result := FParent.FNavigatorButtonStates[Index]; +end; + +function TcxPCPainterParentInfo.GetNavigatorPositione: TcxPCNavigatorPosition; +begin + Result := FParent.NavigatorPosition; +end; + +function TcxPCPainterParentInfo.GetOptions: TcxPCOptions; +begin + Result := FParent.Options; +end; + +function TcxPCPainterParentInfo.GetPageColor(ATabVisibleIndex: Integer): TColor; +var + ATabSheet: TcxTabSheet; +begin + ATabSheet := Pages[ATabVisibleIndex]; + if ATabSheet <> nil then + Result := ATabSheet.Color + else + Result := FParent.Color; +end; + +function TcxPCPainterParentInfo.GetPage(ATabVisibleIndex: Integer): TcxTabSheet; +begin + Result := FParent.GetPage(VisibleTabs[ATabVisibleIndex].Index); +end; + +function TcxPCPainterParentInfo.GetRaggedRight: Boolean; +begin + Result := FParent.RaggedRight; +end; + +function TcxPCPainterParentInfo.GetTabColor(ATabVisibleIndex: Integer): TColor; +var + ATabSheet: TcxTabSheet; +begin + ATabSheet := Pages[ATabVisibleIndex]; + Result := VisibleTabs[ATabVisibleIndex].Color; + if (Result = clDefault) and (ATabSheet <> nil) and + ((pcoUsePageColorForTab in Options) or FParent.Painter.AlwaysColoredTabs) and + not ATabSheet.ParentColor then + Result := ATabSheet.Color; +end; + +function TcxPCPainterParentInfo.GetTabSlants: TcxTabSlants; +begin + Result := FParent.TabSlants; +end; + +function TcxPCPainterParentInfo.GetRotate: Boolean; +begin + Result := FParent.Rotate; +end; + +function TcxPCPainterParentInfo.GetRowCount: Integer; +begin + Result := FParent.RowCount; +end; + +function TcxPCPainterParentInfo.GetScrollOpposite: Boolean; +begin + Result := FParent.ScrollOpposite; +end; + +function TcxPCPainterParentInfo.GetShowFrame: Boolean; +begin + Result := FParent.ShowFrame; +end; + +function TcxPCPainterParentInfo.GetTabHeight: Smallint; +begin + Result := FParent.TabHeight; +end; + +function TcxPCPainterParentInfo.GetTabsOnBothSides: Boolean; +begin + Result := (TabPosition in [tpTop, tpLeft]) and (TopOrLeftPartRowCount <> RowCount) or + (TabPosition in [tpBottom, tpRight]) and (TopOrLeftPartRowCount <> 0); +end; + +function TcxPCPainterParentInfo.GetTabPosition: TcxTabPosition; +begin + Result := FParent.TabPosition; +end; + +function TcxPCPainterParentInfo.GetTabWidth: Smallint; +begin + Result := FParent.TabWidth; +end; + +function TcxPCPainterParentInfo.GetTopOrLeftPartRowCount: Integer; +begin + Result := FParent.TopOrLeftPartRowCount; +end; + +function TcxPCPainterParentInfo.GetVisibleTab( + TabVisibleIndex: Integer): TcxTab; +begin + Result := FParent.FVisibleTabList[TabVisibleIndex]; +end; + +function TcxPCPainterParentInfo.GetWidth: Integer; +begin + Result := FParent.Width; +end; + +{ TcxVisibleTabList } + +constructor TcxVisibleTabList.Create(AParent: TcxCustomTabControl); +begin + inherited Create; + FParent := AParent; + TabIndexA := nil; +end; + +destructor TcxVisibleTabList.Destroy; +begin + TabIndexA := nil; + inherited; +end; + +function TcxVisibleTabList.GetCount: Integer; +begin + Result := Length(TabIndexA); +end; + +function TcxVisibleTabList.GetTab(TabVisibleIndex: Integer): TcxTab; +begin + if (TabVisibleIndex < 0) or (TabVisibleIndex >= Count) then + if Count = 0 then + OutError('GetTab', scxPCVisibleTabListEmpty) + else + OutError('GetTab', Format(scxPCTabVisibleIndexOutsOfBounds, [TabVisibleIndex, Count - 1])); + Result := FParent.TabsTabs[TabIndexA[TabVisibleIndex]]; +end; + +function TcxVisibleTabList.FindVisibleTab(TabIndex: TcxPCTabIndex; var TabVisibleIndex: Integer): Boolean; +var + FirstIndex, LastIndex, MiddleIndex: Integer; +begin + Result := False; + TabVisibleIndex := 0; + if (TabIndexA = nil) or (Length(TabIndexA) = 0) then Exit; + + FirstIndex := 0; + Result := True; + if TabIndex = TabIndexA[0] then Exit; + Result := False; + if TabIndex < TabIndexA[0] then Exit; + + LastIndex := Count - 1; + TabVisibleIndex := LastIndex; + Result := True; + if TabIndex = TabIndexA[LastIndex] then Exit; + Inc(TabVisibleIndex); + Result := False; + if TabIndex > TabIndexA[LastIndex] then Exit; + + while LastIndex - FirstIndex > 1 do + begin + MiddleIndex := (FirstIndex + LastIndex) div 2; + if TabIndex = TabIndexA[MiddleIndex] then + begin + TabVisibleIndex := MiddleIndex; + Result := True; + Exit; + end; + if TabIndex < TabIndexA[MiddleIndex] then LastIndex := MiddleIndex + else FirstIndex := MiddleIndex; + end; + TabVisibleIndex := LastIndex; +end; + +procedure TcxVisibleTabList.HideTab(TabIndex: TcxPCTabIndex); +var + TabVisibleIndex: Integer; + OldCount: Integer; +begin + if FindVisibleTab(TabIndex, TabVisibleIndex) then + begin + OldCount := Count; + if TabVisibleIndex <> OldCount - 1 then + Move(TabIndexA[TabVisibleIndex + 1], TabIndexA[TabVisibleIndex], + (OldCount - TabVisibleIndex - 1) * SizeOf(TcxPCTabIndex)); + SetLength(TabIndexA, OldCount - 1); + end; +end; + +procedure TcxVisibleTabList.OutError(SourceMethodName: TCaption; Msg: string); +begin + raise Exception.Create('TcxVisibleTabList.' + SourceMethodName + ': ' + Msg); +end; + +procedure TcxVisibleTabList.ShowTab(TabIndex: TcxPCTabIndex); +var + TabVisibleIndex: Integer; + OldCount: Integer; +begin + if not FindVisibleTab(TabIndex, TabVisibleIndex) then + begin + OldCount := Count; + SetLength(TabIndexA, OldCount + 1); + if TabVisibleIndex <> OldCount then + Move(TabIndexA[TabVisibleIndex], TabIndexA[TabVisibleIndex + 1], + (OldCount - TabVisibleIndex) * SizeOf(TcxPCTabIndex)); + TabIndexA[TabVisibleIndex] := TabIndex; + end; +end; + +procedure TcxVisibleTabList.Update; +var + VisibleTabCount: Integer; + I, TabCount: TcxPCTabIndex; +begin + with FParent.Tabs do + begin + VisibleTabCount := 0; + TabCount := Count; + for I := 0 to TabCount - 1 do + if Tabs[I].Visible then Inc(VisibleTabCount); + SetLength(TabIndexA, VisibleTabCount); + + VisibleTabCount := 0; + for I := 0 to TabCount - 1 do + if Tabs[I].Visible then + begin + TabIndexA[VisibleTabCount] := I; + Inc(VisibleTabCount); + end; + end; +end; + +function TcxVisibleTabList.TabVisibleIndexOf(TabIndex: TcxPCTabIndex): Integer; +begin + if not FindVisibleTab(TabIndex, Result) then Result := -1; +end; + +{ TcxTab } + +constructor TcxTab.Create(ATabs: TcxTabs; AIndex: Integer); +begin + inherited Create; + FIndex := AIndex; + FTabs := ATabs; + + FColor := clDefault; + FEnabled := True; + FImageIndex := AIndex; + FVisible := True; +end; + +destructor TcxTab.Destroy; +begin + FTabs.Notify(Index, tnDeleting); + FreeAndNil(FVerticalTextBitmap); + FreeAndNil(FPaintBitmap); + with ParentControl do + if (FTracking <> -1) and (FTracking = VisibleIndex) then + FTracking := -1; + inherited; +end; + +procedure TcxTab.InitializePaintBitmap; +begin + if FPaintBitmap = nil then + FPaintBitmap := TBitmap.Create; + FPaintBitmap.PixelFormat := pf32bit; + FPaintBitmap.HandleType := bmDDB; +end; + +procedure TcxTab.ResetPaintBitmap; +begin + FreeAndNil(FPaintBitmap); +end; + +procedure TcxTab.ResetVerticalTextBitmap; +begin + FreeAndNil(FVerticalTextBitmap); +end; + +procedure TcxTab.AssignTo(Dest: TPersistent); +var + DestTab: TcxTab; +begin + if Dest is TcxTab then + begin + DestTab := TcxTab(Dest); + DestTab.FCaption := Caption; + DestTab.FEnabled := Enabled; + DestTab.FHighlighted := Highlighted; + DestTab.ImageIndex := ImageIndex; + DestTab.FObject := FObject; + DestTab.Visible := Visible; + DestTab.Selected := Selected; + end + else + inherited AssignTo(Dest); +end; + +procedure TcxTab.Changed(ATabPropertyChanged: TcxPCTabPropertyChanged); +begin + Tabs.Changed(VisibleIndex, ATabPropertyChanged); +end; + +procedure TcxTab.ValidateImageIndex; +begin + if FImageIndex = -1 then + Exit; + if RealVisible then + Changed(tpcNotSpecified); +end; + +function TcxTab.GetFullRect: TRect; +begin + Result := NormalRect; + with ParentControl do + CorrectTabRect(FVisibleTabList.TabVisibleIndexOf(Index)); + CorrectRect(Result, FTabPosition.TabRectCorrection); +end; + +function TcxTab.GetHotTrack: Boolean; +var + HotTrackTabVisibleIndex: Integer; +begin + HotTrackTabVisibleIndex := ParentControl.FHotTrackTabVisibleIndex; + Result := (HotTrackTabVisibleIndex <> -1) and (HotTrackTabVisibleIndex = VisibleIndex); +end; + +function TcxTab.GetImageIndex: TImageIndex; +begin + Result := ParentControl.GetImageIndex(Index); +end; + +function TcxTab.GetIsMainTab: Boolean; +begin + Result := Index = ParentControl.MainTabIndex; +end; + +function TcxTab.GetNormalLongitudinalSize: Integer; +begin + if ParentControl.Rotate then Result := Tabs.FTabNormalHeight + else Result := FTabPosition.TabNormalWidth; +end; + +function TcxTab.GetNormalRect: TRect; +begin + Result.Left := FTabPosition.TabNormalPosition.X; + Result.Top := FTabPosition.TabNormalPosition.Y; + if IsVerticalText(ParentControl) then + begin + Result.Right := Result.Left + Tabs.TabNormalHeight; + if ParentControl.Rotate then + Result.Bottom := Result.Top + ParentControl.FRowHeight + else + Result.Bottom := Result.Top + FTabPosition.TabNormalWidth; + end + else + begin + if ParentControl.Rotate then + Result.Right := Result.Left + ParentControl.FRowHeight + else + Result.Right := Result.Left + FTabPosition.TabNormalWidth; + Result.Bottom := Result.Top + Tabs.TabNormalHeight; + end; +end; + +function TcxTab.GetPaintingPosition: TcxTabPosition; +var + IsY: Boolean; +begin + with ParentControl do + begin + IsY := TabPosition in [tpTop, tpBottom]; + if VisibleRow < TopOrLeftPartRowCount then + if IsY then Result := tpTop + else Result := tpLeft + else + if IsY then Result := tpBottom + else Result := tpRight; + end; +end; + +function TcxTab.GetPaintingPositionIndex: Integer; +const + APaintingPositionIndexMap: array [TcxTabPosition, TcxRotationAngle] of Integer = ( + (1, 2, 3, 0), + (10, 11, 12, 0), + (6, 4, 5, 0), + (9, 7, 8, 0) + ); +begin + Result := APaintingPositionIndexMap[PaintingPosition, GetTextRotationAngle(ParentControl)]; +end; + +function TcxTab.GetParentControl: TcxCustomTabControl; +begin + Result := Tabs.Parent; +end; + +function TcxTab.GetPressed: Boolean; +var + PressedTabVisibleIndex: Integer; +begin + PressedTabVisibleIndex := ParentControl.FPressedTabVisibleIndex; + Result := (PressedTabVisibleIndex <> -1) and (PressedTabVisibleIndex = VisibleIndex); +end; + +function TcxTab.GetRealEnabled: Boolean; +begin + Result := ParentControl.Enabled and Enabled; +end; + +function TcxTab.GetRealVisible: Boolean; +begin + Result := not IsRectEmpty(VisibleRect) +end; + +function TcxTab.GetTracking: Boolean; +begin + with ParentControl do + Result := (FTracking <> -1) and (FTracking = VisibleIndex); +end; + +function TcxTab.GetVisibleIndex: Integer; +begin + Result := ParentControl.FVisibleTabList.TabVisibleIndexOf(Index); +end; + +function TcxTab.GetVisibleRect: TRect; +var + ATabVisibleIndex: Integer; +begin + Result := cxEmptyRect; + if not Visible then + Exit; + with ParentControl do + begin + ATabVisibleIndex := VisibleIndex; + if (not MultiLine) and + ((ATabVisibleIndex < FFirstVisibleTab) or + (ATabVisibleIndex > FLastVisibleTab)) then + Exit; + if VisibleRow < TopOrLeftPartRowCount then + IntersectRect(Result, FullRect, FExtendedTopOrLeftTabsRect) + else + IntersectRect(Result, FullRect, FExtendedBottomOrRightTabsRect); + end; +end; + +procedure TcxTab.InternalSetCaption(const Value: string); +begin + FCaption := Value; +end; + +function TcxTab.IsImageIndexStored: Boolean; +begin + Result := FImageIndex <> Index; +end; + +procedure TcxTab.SetCaption(const Value: string); +var + OldTabNormalWidth: Integer; + TabLayoutChanged: Boolean; + OldRealVisible: Boolean; + OldRowHeight: Integer; +begin + if Value <> FCaption then + with FTabPosition do + begin + if not Visible then + begin + InternalSetCaption(Value); + Exit; + end; + + OldRealVisible := RealVisible; + OldTabNormalWidth := TabNormalWidth; + OldRowHeight := ParentControl.FRowHeight; + + InternalSetCaption(Value); + ParentControl.CalculateTabNormalSize(Self); + + if ParentControl.Rotate then + begin + ParentControl.CalculateRowHeight; + TabLayoutChanged := ParentControl.FRowHeight <> OldRowHeight; + end + else + TabLayoutChanged := TabNormalWidth <> OldTabNormalWidth; + + if TabLayoutChanged then + Changed(tpcLayout) + else + if OldRealVisible then Changed(tpcNotSpecified); + end; +end; + +procedure TcxTab.SetColor(Value: TColor); +begin + if Value <> FColor then + begin + FColor := Value; + if RealVisible then + Changed(tpcColor); + end; +end; + +procedure TcxTab.SetEnabled(const Value: Boolean); +var + OldRealVisible: Boolean; +begin + if Value <> FEnabled then + begin + OldRealVisible := RealVisible; + FEnabled := Value; + if OldRealVisible or RealVisible then + Changed(tpcEnabled); + end; +end; + +procedure TcxTab.SetHighlighted(const Value: Boolean); +var + OldRealVisible: Boolean; +begin + if Value <> FHighlighted then + begin + OldRealVisible := RealVisible; + FHighlighted := Value; + if OldRealVisible or RealVisible then + Changed(tpcHighlighted); + end; +end; + +procedure TcxTab.SetImageIndex(Value: TImageIndex); +begin + if Value < 0 then + Value := -1; + if Value <> FImageIndex then + begin + FImageIndex := Value; + if RealVisible then + Changed(tpcLayout); + end; +end; + +procedure TcxTab.SetSelected(const Value: Boolean); + + function GetSelectedTabCount: Integer; + var + I, TabCount: Integer; + begin + Result := 0; + TabCount := Tabs.Count; + for I := 0 to TabCount - 1 do + if Tabs.Tabs[I].Selected then + Inc(Result); + end; + +var + OldRealVisible: Boolean; +begin + if Value <> FSelected then + begin + if csLoading in ParentControl.ComponentState then + begin + FSelected := Value; + Exit; + end; + + with ParentControl do + begin + if not FPainter.IsMultiSelectionAccepted then + begin + if Value and (Index <> TabIndex) then Exit; + end else + if Value and (GetSelectedTabCount > 0) and (not MultiSelect) then + MultiSelect := True; + OldRealVisible := RealVisible; + FSelected := Value; + if OldRealVisible or RealVisible then + Self.Changed(tpcSelected); + end; + end; +end; + +procedure TcxTab.SetVisible(const Value: Boolean); +var + OldRealVisible: Boolean; + IsTabIndexCorrectionNeeded: Boolean; +begin + if Value <> FVisible then + with ParentControl do + if Value then + begin + FVisibleTabList.ShowTab(Index); + FVisible := Value; + Self.Changed(tpcLayout); + end else + begin + IsTabIndexCorrectionNeeded := TabIndexTabMustBeVisible and (Index = TabIndex); + OldRealVisible := RealVisible; + FVisibleTabList.HideTab(Index); + FVisible := Value; + if OldRealVisible or MultiLine then + Self.Changed(tpcLayout) + else + Calculate; + if IsTabIndexCorrectionNeeded then + if FMainTabVisibleIndex <> -1 then + TabIndex := FVisibleTabList[FMainTabVisibleIndex].Index; + end; +end; + +{ TcxTabs } + +procedure TcxTabs.Changed(VisibleIndex: Integer = -1; + TabPropertyChanged: TcxPCTabPropertyChanged = tpcLayout); +begin + with Parent do + begin + if [csLoading, csDestroying] * ComponentState <> [] then Exit; + if (VisibleIndex = -1) or (TabPropertyChanged = tpcLayout) then + RequestLayout + else + RepaintTab(VisibleIndex, TabPropertyChanged); + end; +end; + +procedure TcxTabs.Clear; +var + I, TabCount: Integer; +begin + TabCount := Count; + if TabCount > 0 then + begin + for I := TabCount - 1 downto 0 do + FTabsItemA[I].Free; + FTabsItemA := nil; + Changed; + end; +end; + +constructor TcxTabs.Create(AParent: TcxCustomTabControl); +begin + inherited Create; + FTabsItemA := nil; + FNotification := False; + FParent := AParent; + FUpdating := False; +end; + +procedure TcxTabs.Delete(Index: Integer); +var + NewTabCount: Integer; +begin + if FUpdating then Exit; + FUpdating := True; + if not FNotification then + begin + if (Index < 0) or (Index >= Count) then + OutError('Delete', Index); + FTabsItemA[Index].Free; + end; + NewTabCount := Count - 1; + if Index < NewTabCount then + begin + System.Move(FTabsItemA[Index + 1], FTabsItemA[Index], + (NewTabCount - Index) * SizeOf(TcxTab)); + UpdateTabIndexes(Index, NewTabCount - 1); + end; + SetLength(FTabsItemA, NewTabCount); + + Parent.FVisibleTabList.Update; + Changed; + + FUpdating := False; +end; + +destructor TcxTabs.Destroy; +begin + Clear; + inherited; +end; + +function TcxTabs.Get(Index: Integer): string; +begin + if (Index < 0) or (Index >= Count) then + OutError('Get', Index); + Result := FTabsItemA[Index].FCaption; +end; + +function TcxTabs.GetCount: Integer; +begin + Result := Length(FTabsItemA); +end; + +function TcxTabs.GetObject(Index: Integer): TObject; +begin + Result := Tabs[Index].FObject; +end; + +procedure TcxTabs.Put(Index: Integer; const S: string); +begin + Tabs[Index].Caption := S; +end; + +procedure TcxTabs.PutObject(Index: Integer; AObject: TObject); +begin + Tabs[Index].FObject := AObject; +end; + +function TcxTabs.GetTab(TabIndex: Integer): TcxTab; +begin + if (TabIndex < 0) or (TabIndex >= Count) then + OutError('GetTab', TabIndex); + Result := FTabsItemA[TabIndex]; +end; + +function TcxTabs.GetVisibleTab(TabVisibleIndex: Integer): TcxTab; +var + VisibleTabCount: Integer; +begin + VisibleTabCount := Parent.FVisibleTabList.Count; + if (TabVisibleIndex < 0) or (TabVisibleIndex >= VisibleTabCount) then + raise Exception.Create('TcxTabs.GetVisibleTab: ' + Format(scxPCTabVisibleIndexOutsOfBounds, + [TabVisibleIndex, VisibleTabCount])); + Result := Parent.FVisibleTabList[TabVisibleIndex]; +end; + +procedure TcxTabs.Insert(Index: Integer; const S: string); +var + OldTabCount: Integer; +begin + if (Index < 0) or (Index > Count) then + OutError('Insert', Index); + OldTabCount := Count; + SetLength(FTabsItemA, OldTabCount + 1); + if Index <> OldTabCount then + System.Move(FTabsItemA[Index], FTabsItemA[Index + 1], + (OldTabCount - Index) * SizeOf(TcxTab)); + FTabsItemA[Index] := TcxTab.Create(Self, Index); + UpdateTabIndexes(Index + 1, OldTabCount); + FTabsItemA[Index].InternalSetCaption(S); + + with Parent do + if not (csLoading in ComponentState) and (FTabIndex = -1) then + if Self.Count = 1 then FTabIndex := 0; + + Parent.FVisibleTabList.Update; + Changed; +end; + +procedure TcxTabs.Move(CurIndex, NewIndex: Integer); + + procedure CopyArray(AFromIndex, AToIndex, ACount: Integer); + begin + System.Move(FTabsItemA[AFromIndex], FTabsItemA[AToIndex], ACount * SizeOf(TcxTab)); + end; + +var + AcxTab: TcxTab; +begin + if CurIndex <> NewIndex then + begin + AcxTab := FTabsItemA[CurIndex]; + if CurIndex > NewIndex then + CopyArray(NewIndex, NewIndex + 1, CurIndex - NewIndex) + else + CopyArray(CurIndex + 1, CurIndex, NewIndex - CurIndex); + FTabsItemA[NewIndex] := AcxTab; + if CurIndex > NewIndex then + UpdateTabIndexes(NewIndex, CurIndex) + else + UpdateTabIndexes(CurIndex, NewIndex); + Parent.FVisibleTabList.Update; + Changed; + end; +end; + +procedure TcxTabs.Notify(Index: Integer; Action: TcxPCTabNotification); +begin + FNotification := True; + if Action = tnDeleting then Delete(Index); + FNotification := False; +end; + +class procedure TcxTabs.OutError(SourceMethodName: TCaption; Index: Integer); +begin + raise Exception.Create('TcxTabs.' + SourceMethodName + ': ' + Format(scxPCTabIndexError, [Index])); +end; + +procedure TcxTabs.ResetTabVerticalTextBitmaps; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Tabs[I].ResetVerticalTextBitmap; +end; + +procedure TcxTabs.SetHotTrack(VisibleIndex: Integer); +var + OldHotTrackTabVisibleIndex: Integer; +begin + with Parent do + begin + if FHotTrackTabVisibleIndex = VisibleIndex then Exit; + OldHotTrackTabVisibleIndex := FHotTrackTabVisibleIndex; + FHotTrackTabVisibleIndex := VisibleIndex; + if OldHotTrackTabVisibleIndex <> -1 then + Self.Changed(OldHotTrackTabVisibleIndex, tpcHotTrack); + if FHotTrackTabVisibleIndex <> -1 then + Self.Changed(FHotTrackTabVisibleIndex, tpcHotTrack); + end; +end; + +procedure TcxTabs.SetMainTab; +var + OldMainTabVisibleIndex: Integer; +begin + with Parent do + begin + OldMainTabVisibleIndex := FMainTabVisibleIndex; + if OldMainTabVisibleIndex >= FVisibleTabList.Count then + OldMainTabVisibleIndex := -1; + + if FTabIndex = -1 then FMainTabVisibleIndex := -1 + else + with FVisibleTabList do + if not FindVisibleTab(FTabIndex, FMainTabVisibleIndex) and (FMainTabVisibleIndex = Count) then + FMainTabVisibleIndex := Count - 1; + + if FMainTabVisibleIndex = OldMainTabVisibleIndex then Exit; + if OldMainTabVisibleIndex <> -1 then + Self.Changed(OldMainTabVisibleIndex, tpcIsMainTab); + if FMainTabVisibleIndex <> -1 then + Self.Changed(FMainTabVisibleIndex, tpcIsMainTab); + + UpdateButtonsState; + end; +end; + +procedure TcxTabs.SetTab(Index: Integer; const Value: TcxTab); +begin + if (Index < 0) or (Index >= Count) then + OutError('SetTab', Index); + FTabsItemA[Index].Assign(Value); +end; + +function TcxTabs.GetVisibleTabsCount: Integer; +begin + Result := Parent.FVisibleTabList.Count; +end; + +procedure TcxTabs.SetTracking(NewTracking: Integer); +var + OldTracking: Integer; +begin + with Parent do + begin + OldTracking := FTracking; + if OldTracking >= FVisibleTabList.Count then + OldTracking := -1; + + if (NewTracking < 0) or (NewTracking >= FVisibleTabList.Count) then + NewTracking := -1; + FTracking := NewTracking; + + if FTracking = OldTracking then Exit; + if OldTracking <> -1 then + Self.Changed(OldTracking, tpcTracking); + if FTracking <> -1 then + Self.Changed(FTracking, tpcTracking); + + if (FTracking <> -1) and not Multiline then + begin + CorrectFirstVisibleTab(FTracking); + RequestLayout; + SynchronizeHotTrackStates(InternalGetShiftState); + end; + end; +end; + +procedure TcxTabs.UpdateTabIndexes(FirstIndex, LastIndex: Integer); +var + I: Integer; +begin + for I := FirstIndex to LastIndex do + FTabsItemA[I].FIndex := I; +end; + +procedure TcxTabs.ValidateImageIndexes; +var + I: Integer; +begin + for I := 0 to Count - 1 do + FTabsItemA[I].ValidateImageIndex; +end; + +{ TcxTabSheet } + +procedure TcxTabSheet.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params.WindowClass do + style := style and not(CS_HREDRAW or CS_VREDRAW); +end; + +procedure TcxTabSheet.DoHide; +begin + if Assigned(FOnHide) then FOnHide(Self); +end; + +procedure TcxTabSheet.DoShow; +begin + if Assigned(FOnShow) then FOnShow(Self); +end; + +procedure TcxTabSheet.EnabledChanged; +begin + PagePropertyChanged; +end; + +procedure TcxTabSheet.PagePropertyChanged; +begin + if PageControl <> nil then + PageControl.UpdateTab(Self); +end; + +procedure TcxTabSheet.SetParent(AParent: TWinControl); +begin + if (AParent is TcxPageControl) or (AParent = nil) then + if AParent <> FPageControl then + PageControl := TcxPageControl(AParent) + else + inherited SetParent(AParent) + else + Abort; +end; + +procedure TcxTabSheet.SetParentPageControl(AParentPageControl: TcxPageControl); +begin + FPageControl := AParentPageControl; + SetParent(AParentPageControl); +end; + +procedure TcxTabSheet.ShowingChanged; +begin + try + if Showing then + DoShow + else + DoHide; + except + Application.HandleException(Self); + end; +end; + +procedure TcxTabSheet.TextChanged; +begin + PagePropertyChanged; +end; + +procedure TcxTabSheet.WMEraseBkgnd(var Message: TWMEraseBkgnd); + + procedure DrawNotNativeBackground; + var + ASavedDC: Integer; + begin + ASavedDC := SaveDC(Message.DC); + try + OffsetWindowOrgEx(Message.DC, Left, Top, nil); + PageControl.Canvas.Canvas.Lock; + try + PageControl.Canvas.Canvas.Handle := Message.DC; + try + PageControl.Painter.FillTabPaneContent; + finally + PageControl.Canvas.Canvas.Handle := 0; + end; + finally + PageControl.Canvas.Canvas.Unlock; + end; + finally + RestoreDC(Message.DC, ASavedDC); + end; + end; + +begin + if (PageControl <> nil) and (not DoubleBuffered or + (TMessage(Message).wParam = TMessage(Message).lParam)) then + if PageControl.Painter.IsNativePainting then + PageControl.Painter.DrawNativeTabBackground(Message.DC, Self) + else + DrawNotNativeBackground; + Message.Result := 1; +end; + +procedure TcxTabSheet.WMNCPaint(var Message: TWMNCPaint); +var + ASavedDC: Integer; + DC: HDC; + R: TRect; +begin + if (PageControl = nil) or not PageControl.Painter.IsNativePainting then + inherited + else + begin + DC := GetWindowDC(Handle); + try + ASavedDC := SaveDC(DC); + try + R := GetControlRect(Self); + InflateRect(R, -BorderWidth, -BorderWidth); + with R do + ExcludeClipRect(DC, Left, Top, Right, Bottom); + PageControl.Painter.DrawNativeTabBackground(DC, Self); + finally + RestoreDC(DC, ASavedDC); + end; + finally + ReleaseDC(Handle, DC); + end; + end; +end; + +procedure TcxTabSheet.WMWindowPosChanged(var Message: TWMWindowPosChanged); +begin + inherited; + Invalidate; +end; + +procedure TcxTabSheet.CMColorChanged(var Message: TMessage); +begin + inherited; + InternalColorChanged; +end; + +procedure TcxTabSheet.CMEnabledChanged(var Message: TMessage); +begin + inherited; + EnabledChanged; +end; + +procedure TcxTabSheet.CMParentColorChanged(var Message: TMessage); +begin + inherited; + InternalColorChanged; +end; + +procedure TcxTabSheet.CMShowingChanged(var Message: TMessage); +begin + inherited; + ShowingChanged; +end; + +procedure TcxTabSheet.CMTextChanged(var Message: TMessage); +begin + inherited; + TextChanged; +end; + +constructor TcxTabSheet.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Align := alClient; + ControlStyle := ControlStyle + [csAcceptsControls, csNoDesignVisible]; + Visible := False; + FImageIndex := -1; + FTab := nil; + FTabVisible := True; + TabStop := False; +end; + +destructor TcxTabSheet.Destroy; +begin + if PageControl <> nil then + begin + if FPageControl.FUndockingPage = Self then FPageControl.FUndockingPage := nil; + FPageControl.RemovePage(Self); + end; + inherited Destroy; +end; + +function TcxTabSheet.GetPageIndex: Integer; +begin + if PageControl = nil then + Result := -1 + else + Result := PageControl.FPages.IndexOf(Self); +end; + +function TcxTabSheet.GetTabIndex: Integer; +begin + if FTab = nil then + Result := -1 + else + Result := FTab.VisibleIndex; +end; + +procedure TcxTabSheet.InternalColorChanged; +begin + if FTab <> nil then + FTab.Changed(tpcLayout); + if (BorderWidth > 0) and HandleAllocated then + SendMessage(Handle, WM_NCPAINT, 1, 0); + Invalidate; +end; + +procedure TcxTabSheet.SetHighlighted(const Value: Boolean); +begin + if Value <> FHighlighted then + begin + FHighlighted := Value; + PagePropertyChanged; + end; +end; + +procedure TcxTabSheet.SetImageIndex(const Value: TImageIndex); +begin + if Value <> FImageIndex then + begin + FImageIndex := Value; + PagePropertyChanged; + end; +end; + +procedure TcxTabSheet.SetPageControl(const Value: TcxPageControl); +begin + if Value <> FPageControl then + begin + if FPageControl <> nil then FPageControl.RemovePage(Self); + if Value <> nil then + begin + Value.InsertPage(Self); + if not(csLoading in Value.ComponentState) and (Value.ActivePage = nil) then + Value.ActivePage := Self; + end; + end; +end; + +procedure TcxTabSheet.SetPageIndex(const Value: Integer); +var + AOldPageIndex: Integer; +begin + if PageControl <> nil then + begin + if Value > PageControl.PageCount - 1 then + raise EListError.CreateFmt(scxPCPageIndexError, [Value, PageControl.PageCount - 1]); + AOldPageIndex := PageIndex; + PageControl.FPages.Move(AOldPageIndex, Value); + PageControl.Tabs.Move(AOldPageIndex, Value); + FTab := PageControl.Tabs.Tabs[Value]; + PageControl.UpdateTab(Self); + PageControl.LockChangeEvent(True); + try + PageControl.TabIndex := PageControl.ActivePageIndex; + finally + PageControl.LockChangeEvent(False); + end; + end; +end; + +procedure TcxTabSheet.SetTabVisible(const Value: Boolean); +begin + if Value <> FTabVisible then + begin + FTabVisible := Value; + PagePropertyChanged; + if Value and (PageControl <> nil) and (PageControl.PageCount = 1) and (PageControl.ActivePage = nil) then + PageControl.ActivePage := Self; + end; +end; + +initialization + RetrieveWindowsVersion; + FDependsControls := TList.Create; + +finalization + FreeAndNil(FBackgroundBitmap); + FDependsControls.Free; + +end. diff --git a/official/x.35/ExpressPageControl 2/Sources/cxPCConsts.pas b/official/x.35/ExpressPageControl 2/Sources/cxPCConsts.pas new file mode 100644 index 00000000..0642f7ec --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Sources/cxPCConsts.pas @@ -0,0 +1,57 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPageControl } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPAGECONTROL AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxPCConsts; + +interface + +resourcestring + scxPCImageListIndexError = 'Index (%d) must be between 0 and %d'; + scxPCNoBaseImages = 'BaseImages is not assigned'; + scxPCNoRegisteredStyles = 'There are no styles registered'; + scxPCPageIndexError = '%d is an invalid PageIndex value. PageIndex must be ' + + 'between 0 and %d'; + scxPCPainterClassError = 'PCPainterClass is nil'; + scxPCStandardStyleError = '%s is an unsupported standard style'; + scxPCStyleNameError = '%s is an unregistered style name'; + scxPCTabCountEqualsZero = 'Tabs.Count = 0'; + scxPCTabIndexError = 'Tab''s index (%d) out of bounds'; + scxPCTabVisibleIndexOutsOfBounds = 'TabVisibleIndex (%d) must be between 0 and %d'; + scxPCVisibleTabListEmpty = 'There are no visible tabs'; + scxPCAllowRotateError = '%s style does not support rotation of tabs'; + +implementation + +end. diff --git a/official/x.35/ExpressPageControl 2/Sources/cxPCGoDialog.pas b/official/x.35/ExpressPageControl 2/Sources/cxPCGoDialog.pas new file mode 100644 index 00000000..fddfdb97 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Sources/cxPCGoDialog.pas @@ -0,0 +1,139 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPageControl } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPAGECONTROL AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxPCGoDialog; + +{$I cxVer.inc} + +interface + +uses + Windows, Menus; + +type + TcxPCGoDialogClickEvent = procedure(ATabControlItemIndex: Integer) of object; + + { TcxPCGoDialog } + + TcxPCGoDialog = class(TPopupMenu) + private + FOnClick: TcxPCGoDialogClickEvent; + procedure DoClick(ATabControlItemIndex: Integer); + function GetDialogPosition: TPoint; + procedure InitializeItems(ASortItems: Boolean); + procedure ItemClick(Sender: TObject); + public + procedure Popup(ASortItems: Boolean); reintroduce; + property OnClick: TcxPCGoDialogClickEvent read FOnClick write FOnClick; + end; + +implementation + +uses + Classes, Controls, SysUtils, cxPC, cxControls; + +{ TcxPCGoDialog } + +procedure TcxPCGoDialog.Popup(ASortItems: Boolean); +var + P: TPoint; +begin + InitializeItems(ASortItems); + P := GetDialogPosition; + inherited Popup(P.X, P.Y); +end; + +procedure TcxPCGoDialog.DoClick(ATabControlItemIndex: Integer); +begin + if Assigned(FOnClick) then + FOnClick(ATabControlItemIndex); +end; + +function TcxPCGoDialog.GetDialogPosition: TPoint; +var + R: TRect; +begin + R := TcxCustomTabControl(Owner).Painter.GetGoDialogButtonBounds; + Result := TcxCustomTabControl(Owner).ClientToScreen(Point(R.Left, R.Bottom)); +end; + +procedure TcxPCGoDialog.InitializeItems(ASortItems: Boolean); + + procedure PrepareItemCaptionList(AList: TStringList; ASortItems: Boolean); + var + ATab: TcxTab; + ATabControl: TcxCustomTabControl; + I: Integer; + begin + ATabControl := TcxCustomTabControl(Owner); + for I := 0 to ATabControl.Tabs.VisibleTabsCount - 1 do + begin + ATab := ATabControl.Tabs.VisibleTabs[I]; + if ATab.RealEnabled then + AList.AddObject(RemoveAccelChars(ATab.Caption, False), ATab); + end; + if ASortItems then + AList.Sort; + end; + +var + AItemCaptionList: TStringList; + AMenuItem: TMenuItem; + I: Integer; +begin + AItemCaptionList := TStringList.Create; + try + PrepareItemCaptionList(AItemCaptionList, ASortItems); + Items.Clear; + for I := 0 to AItemCaptionList.Count - 1 do + begin + AMenuItem := TMenuItem.Create(Self); + AMenuItem.Caption := TcxTab(AItemCaptionList.Objects[I]).Caption; + AMenuItem.Tag := (TcxTab(AItemCaptionList.Objects[I]).Index); + AMenuItem.OnClick := ItemClick; + Items.Add(AMenuItem); + end; + finally + FreeAndNil(AItemCaptionList); + end; +end; + +procedure TcxPCGoDialog.ItemClick(Sender: TObject); +begin + DoClick(TMenuItem(Sender).Tag); +end; + +end. + diff --git a/official/x.35/ExpressPageControl 2/Sources/cxPCPainters.pas b/official/x.35/ExpressPageControl 2/Sources/cxPCPainters.pas new file mode 100644 index 00000000..ba93eee2 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Sources/cxPCPainters.pas @@ -0,0 +1,6081 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPageControl } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPAGECONTROL AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxPCPainters; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, Controls, Graphics, SysUtils, cxGraphics, cxLookAndFeels, + cxPC; + +const + cxPCEmptyWOffset: TcxPCWOffset = (Left: 0; Right: 0); + + cxPCTabsStyle = 1; + cxPCButtonsStyle = 2; + cxPCFlatButtonsStyle = 3; + cxPCExtraFlatStyle = 5; + cxPCUltraFlatStyle = 6; + cxPCFlatStyle = 7; + cxPCOffice11Style = 8; + cxPCSlantedStyle = 9; + cxPCOneNoteStyle = 10; + cxPCSkinStyle = 11; + + StandardPainterTabControlFrameBorderWidth = 2; + +type + TcxPCNavigatorButtonPosition = record + Button: TcxPCNavigatorButton; + ButtonRect: TRect; + end; + TcxPCNavigatorButtonPositions = array of TcxPCNavigatorButtonPosition; + + TcxPCTabsDelimiterOffsets = record + Top, Bottom: Integer; + end; + + TcxPCArrow = (aTop, aBottom, aLeft, aRight); + + TcxPCNavigatorButtonContentParameters = record + BrushColor: TColor; + Color: TColor; + Enabled: Boolean; + LiteStyle: Boolean; + end; + + TLinePosition = (lpL, lpLT, lpT, lpRT, lpR, lpRB, lpB, lpLB); + TLinePositions = array of TLinePosition; + + TPoints = array of TPoint; + + { TcxPCStandardPainter } + + TcxPCStandardPainter = class(TcxPCCustomPainter) + private + FButtonsQueue: TcxPCNavigatorButtonPositions; + FButtonsRect: TRect; + function GetButtonsWidth(ANavigatorButtons: TcxPCNavigatorButtons): Integer; + protected + function CalculateTabNormalWidth(Tab: TcxTab): Integer; override; + function GetDrawImageOffset(TabVisibleIndex: Integer): TRect; override; + function GetDrawImageWithoutTextWOffset(TabVisibleIndex: Integer): TcxPCWOffset; override; + function GetDrawTextHOffset(TabVisibleIndex: Integer): TRect; override; + function GetFrameWidth: Integer; override; + function GetGoDialogPosition(GoDialogSize: TSize): TPoint; override; + function GetImageTextDistance(ATabVisibleIndex: Integer): Integer; override; + function GetMinTabNormalWidth(ATabVisibleIndex: Integer): Integer; override; + function GetMinTabSelectionDistance: TcxPCDistance; override; + function GetTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; override; + function GetTabsNormalDistance: TcxPCDistance; override; + function GetTabsPosition(NavigatorButtons: TcxPCNavigatorButtons): TcxPCTabsPosition; override; + function GetTooNarrowTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; override; + procedure InternalPrepareOutTabImageAndTextData(ATabVisibleIndex: Integer; + var AImageRect, ATextRect: TRect); override; + function IsOverButton(X, Y: Integer; var Button: TcxPCNavigatorButton): Boolean; override; + function IsTabBorderThick(ATabVisibleIndex: Integer): Boolean; override; + procedure Paint; override; + procedure PaintButtonsRegion; override; + procedure PaintTab(TabVisibleIndex: Integer); virtual; + procedure PaintTabsRegion; override; + procedure RepaintButton(Button: TcxPCNavigatorButton; OldButtonState: TcxPCNavigatorButtonState); override; + procedure RepaintButtonsRegion; override; + procedure RepaintTab(TabVisibleIndex: Integer; TabPropertyChanged: TcxPCTabPropertyChanged); override; + + procedure CalculateButtonContentParameters(AButton: TcxPCNavigatorButton; + out AParameters: TcxPCNavigatorButtonContentParameters); virtual; + procedure CalculateButtonsRect(NavigatorButtons: TcxPCNavigatorButtons); virtual; + procedure CalculateButtonsRegion(NavigatorButtons: TcxPCNavigatorButtons); virtual; + function CalculateButtonsRegionWidth(NavigatorButtons: TcxPCNavigatorButtons): Integer; virtual; + procedure CorrectTabHeightForImage(var AHeight: Integer); + procedure DrawButtonContent(AButton: TcxPCNavigatorButton; + const AParameters: TcxPCNavigatorButtonContentParameters; + AContentRectLeftTopCorner: TPoint); + function Get3DButtonContentPosition(AButton: TcxPCNavigatorButton): TPoint; + function GetButtonArrow(AButton: TcxPCNavigatorButton): TcxPCArrow; + function GetButtonCenteredContentPosition(AButton: TcxPCNavigatorButton): TPoint; + function GetButtonColor(AButtonState: TcxPCNavigatorButtonState): TColor; virtual; + function GetButtonContentColor(AButtonState: TcxPCNavigatorButtonState): TColor; virtual; + function GetButtonContentPosition(AButton: TcxPCNavigatorButton): TPoint; virtual; + function GetButtonHeight: Integer; virtual; + function GetButtonWidth(Button: TcxPCNavigatorButton): Integer; virtual; + function GetDefaultTabNormalHeight: Integer; virtual; + function GetDefaultTabNormalHTextOffset: Integer; virtual; + function GetDefaultTabNormalWidth: Integer; virtual; + function GetFrameRect: TRect; + function GetFreeSpaceColor: TColor; virtual; + function GetMinFrameRectSize: Integer; virtual; + function GetTabBorderWidth(Tab: TcxTab): Integer; virtual; + function GetTabNormalWidth(ATabVisibleIndex: Integer): Integer; virtual; + function GetTabsRectOffset: TRect; virtual; + function InternalCalculateTabNormalHeight: Integer; virtual; + procedure InternalDrawEdge(const Rect: TRect; Sunken: Boolean; ThinFrame: Boolean = False); + procedure InternalDrawFocusRect(TabVisibleIndex: Integer; R: TRect); virtual; + procedure PaintButton(Button: TcxPCNavigatorButton; + const ButtonRect: TRect); virtual; + procedure PaintButtonBackground(AButtonRect: TRect; + AButtonState: TcxPCNavigatorButtonState); virtual; + procedure PaintButtonFrame(var ARect: TRect; + AButtonState: TcxPCNavigatorButtonState); virtual; + procedure PaintFrame; override; + procedure PaintFrameBorder(R: TRect); virtual; + procedure PaintTabShape(TabVisibleIndex: Integer); virtual; abstract; + procedure PrepareTabBackground(ATabVisibleIndex: Integer); virtual; + procedure GetButtonsOrder(ANavigatorButtons: TcxPCNavigatorButtons; + var AButtonPositions: TcxPCNavigatorButtonPositions); virtual; + property ButtonsRect: TRect read FButtonsRect; + public + constructor Create(AParent: TcxCustomTabControl); override; + destructor Destroy; override; + function CalculateTabNormalHeight: Integer; override; + function GetGoDialogButtonBounds: TRect; override; + class function IsMainTabBoundWithClient: boolean; override; + class function IsMultiSelectionAccepted: boolean; override; + class function IsStandardStyle: Boolean; override; + class function IsTabPressable: Boolean; override; + end; + + { TcxPCButtonedPainter } + + TcxPCButtonedPainter = class(TcxPCStandardPainter) + private + MainTabBrushBitmap: TBitmap; + protected + function GetButtonContentPosition(AButton: TcxPCNavigatorButton): TPoint; override; + function GetButtonsRegionHOffset: Integer; override; + function GetButtonsRegionWOffset: Integer; override; + function GetDisplayRectOffset: TRect; override; + function GetTabBodyColor(TabVisibleIndex: Integer): TColor; override; + function GetTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; override; + function GetTabsContainerOffsets: TRect; override; + function GetTooNarrowTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; override; + function IsTabBorderThick(ATabVisibleIndex: Integer): Boolean; override; + public + constructor Create(AParent: TcxCustomTabControl); override; + destructor Destroy; override; + end; + + { TcxPCTabsPainter } + + TcxPCTabsPainter = class(TcxPCStandardPainter) + private +{ FMDC: HDC; + FPrevMDCBitmap: HBITMAP;} + protected + procedure CorrectTabRect(TabVisibleIndex: Integer; + var TabRectCorrection: TcxPCRectCorrection); override; + procedure DrawNativeTabBackground(DC: HDC; ATab: TcxTabSheet); override; + function GetButtonContentPosition(AButton: TcxPCNavigatorButton): TPoint; override; + function GetButtonHeight: Integer; override; + function GetButtonsRegionHOffset: Integer; override; + function GetButtonsRegionWOffset: Integer; override; + function GetButtonWidth(Button: TcxPCNavigatorButton): Integer; override; + function GetClientRectOffset: TRect; override; + function GetDisplayRectOffset: TRect; override; + function GetDrawImageOffset(TabVisibleIndex: Integer): TRect; override; + function GetDrawImageWithoutTextWOffset(TabVisibleIndex: Integer): TcxPCWOffset; override; + function GetDrawTextHOffset(TabVisibleIndex: Integer): TRect; override; + function GetImageTextDistance(ATabVisibleIndex: Integer): Integer; override; + function GetTabBodyColor(TabVisibleIndex: Integer): TColor; override; + function GetTabClipRgn(ATabVisibleIndex: Integer): TcxRegion; override; + function GetTabClipRgnOperation(ATabVisibleIndex: Integer): TcxRegionOperation; override; + function GetTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; override; + procedure GetTabNativePartAndState(ATabVisibleIndex: Integer; + out PartId, StateId: Integer); override; + function GetTabsContainerOffsets: TRect; override; + function GetTabsPosition(NavigatorButtons: TcxPCNavigatorButtons): TcxPCTabsPosition; override; + function GetTooNarrowTabContentWOffset( + ATabVisibleIndex: Integer): TcxPCWOffset; override; + function InternalCalculateTabNormalHeight: Integer; override; + procedure InternalPrepareOutTabImageAndTextData(ATabVisibleIndex: Integer; + var AImageRect, ATextRect: TRect); override; + procedure InvalidateTabRect(ATabVisibleIndex: Integer); override; + function IsNativePainting: Boolean; override; + function IsOverTab(TabVisibleIndex: Integer; X, Y: Integer): Boolean; override; + function NeedShowFrame: Boolean; override; + procedure Paint; override; + procedure PaintButton(Button: TcxPCNavigatorButton; + const ButtonRect: TRect); override; + procedure PaintClientArea; override; + procedure PaintFrame; override; + procedure PaintTabShape(TabVisibleIndex: Integer); override; + procedure PaintTabsRegion; override; + procedure PaintNativeTabBackground(DC: HDC; ATabVisibleIndex: Integer; const ABounds: TRect); virtual; +// procedure PrepareBackgroundBitmap; virtual; + procedure PrepareTabBackground(ATabVisibleIndex: Integer); override; + procedure PrepareTabBitmapBackground(ABitmap: TBitmap; const ARect: TRect; ATab: TcxTab); virtual; + procedure RepaintTab(TabVisibleIndex: Integer; TabPropertyChanged: TcxPCTabPropertyChanged); override; + function GetMinFrameRectSize: Integer; override; + procedure GetTabCornersColor(ATabVisibleIndex: Integer; + out AColor1, AColor2: TColor); virtual; + procedure PaintTabCorners(ATabVisibleIndex: Integer); virtual; + procedure PaintTabFrame(ATabVisibleIndex: Integer); virtual; + procedure InternalPaintFrame(ACanvas: TCanvas); virtual; + public + class function GetStandardStyle: TcxPCStandardStyle; override; + class function GetStyleID: TcxPCStyleID; override; + class function GetStyleName: TCaption; override; + class function HasLookAndFeel(ALookAndFeel: TcxLookAndFeel): Boolean; override; + class function IsDefault(ALookAndFeel: TcxLookAndFeel): Boolean; override; + end; + + { TcxPCButtonsPainter } + + TcxPCButtonsPainter = class(TcxPCButtonedPainter) + protected + function IsTabBorderThick(ATabVisibleIndex: Integer): Boolean; override; + procedure PaintTabShape(TabVisibleIndex: Integer); override; + public + class function GetStandardStyle: TcxPCStandardStyle; override; + class function GetStyleID: TcxPCStyleID; override; + class function GetStyleName: TCaption; override; + class function HasLookAndFeel(ALookAndFeel: TcxLookAndFeel): Boolean; override; + end; + + { TcxPCFlatButtonsPainter } + + TcxPCFlatButtonsPainter = class(TcxPCButtonedPainter) + protected + procedure PaintTab(TabVisibleIndex: Integer); override; + procedure PaintTabShape(TabVisibleIndex: Integer); override; + public + class function GetStandardStyle: TcxPCStandardStyle; override; + class function GetStyleID: TcxPCStyleID; override; + class function GetStyleName: TCaption; override; + class function HasLookAndFeel(ALookAndFeel: TcxLookAndFeel): Boolean; override; + end; + + { TcxPCExtraFlatPainter } + + TcxPCExtraFlatPainter = class(TcxPCStandardPainter) + protected + procedure CalculateButtonContentParameters(AButton: TcxPCNavigatorButton; + out AParameters: TcxPCNavigatorButtonContentParameters); override; + function CalculateTabNormalWidth(Tab: TcxTab): Integer; override; + procedure CorrectTabRect(TabVisibleIndex: Integer; var TabRectCorrection: TcxPCRectCorrection); override; + function GetButtonColor(AButtonState: TcxPCNavigatorButtonState): TColor; override; + function GetButtonContentColor(AButtonState: TcxPCNavigatorButtonState): TColor; override; + function GetButtonContentPosition(AButton: TcxPCNavigatorButton): TPoint; override; + function GetButtonHeight: Integer; override; + function GetButtonWidth(Button: TcxPCNavigatorButton): Integer; override; + function GetClientColor: TColor; override; + function GetClientRectOffset: TRect; override; + function GetDefaultTabNormalHeight: Integer; override; + function GetDefaultTabNormalHTextOffset: Integer; override; + function GetDisplayRectOffset: TRect; override; + function GetDrawImageOffset(TabVisibleIndex: Integer): TRect; override; + function GetDrawTextHOffset(TabVisibleIndex: Integer): TRect; override; + function GetFrameWidth: Integer; override; + function GetFreeSpaceColor: TColor; override; + function GetMinTabNormalWidth(ATabVisibleIndex: Integer): Integer; override; + function GetTabBodyColor(TabVisibleIndex: Integer): TColor; override; + function GetTabBorderWidth(Tab: TcxTab = nil): Integer; override; + function GetTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; override; + function GetTabNormalWidth(ATabVisibleIndex: Integer): Integer; override; + function GetTabsRowsDelimiterWidth: Integer; virtual; + function GetTabsNormalDistance: TcxPCDistance; override; + function GetTabsPosition(NavigatorButtons: TcxPCNavigatorButtons): TcxPCTabsPosition; override; + function GetTooNarrowTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; override; + function InternalCalculateTabNormalHeight: Integer; override; + procedure InternalPaint; override; + procedure PaintButtonFrame(var ARect: TRect; + AButtonState: TcxPCNavigatorButtonState); override; + procedure PaintClientArea; override; + procedure PaintFrame; override; + procedure PaintTabShape(TabVisibleIndex: Integer); override; + procedure PaintTabsRegion; override; + procedure RepaintTab(TabVisibleIndex: Integer; TabPropertyChanged: TcxPCTabPropertyChanged); override; + function GetButtonsDistance(AButton1, AButton2: TcxPCNavigatorButton): Integer; override; + function GetButtonsRegionHOffset: Integer; override; + function GetButtonsRegionWOffset: Integer; override; + function GetFocusRect: TRect; virtual; + function GetTabsDelimiterOffsets: TcxPCTabsDelimiterOffsets; virtual; + procedure DrawBackground(ACanvas: TCanvas; ARect: TRect; + ATabVisibleIndex: Integer); virtual; + procedure ExcludeUnderLine(var R: TRect); virtual; + function GetMainTabRowUnderlineColor: TColor; virtual; + function GetMainTabRowUnderlineRect: TRect; virtual; + function GetTabBackgroundRect(ATabVisibleIndex: Integer; + AForNormalState: Boolean): TRect; virtual; + function GetTabsDelimiterWidth: Integer; virtual; + function GetTabsRowColor: TColor; virtual; + function GetTabsRowRect(ARowIndex: Integer): TRect; + procedure InternalPaintFrame(ALeftTopColor, ARightBottomColor: TColor); + procedure InternalPaintMainTabFrame(var R: TRect; ALightColor, ADarkColor: TColor); + procedure InternalPaintTabsRowsDelimiter(var ARowRect: TRect; + AColors: array of TColor); + function IsMainTabRow(AVisibleRow: Integer): Boolean; + function NeedShowTabsRegionFrame: Boolean; virtual; + procedure PaintMainTabFrame(var R: TRect); virtual; + procedure PaintMainTabRowUnderline; + procedure PaintTabsDelimiter(const ARect: TRect); virtual; + procedure PaintTabsRowsDelimiter(var ARowRect: TRect; ARowIndex: Integer); virtual; + public + function CalculateTabNormalHeight: Integer; override; + class function GetStyleID: TcxPCStyleID; override; + class function GetStyleName: TCaption; override; + class function HasLookAndFeel(ALookAndFeel: TcxLookAndFeel): Boolean; override; + class function IsMainTabBoundWithClient: boolean; override; + class function IsMultiSelectionAccepted: boolean; override; + class function IsTabPressable: Boolean; override; + end; + + { TcxPCUltraFlatPainter } + + TcxPCUltraFlatPainter = class(TcxPCExtraFlatPainter) + protected + procedure CalculateButtonContentParameters(AButton: TcxPCNavigatorButton; + out AParameters: TcxPCNavigatorButtonContentParameters); override; + function GetButtonColor(AButtonState: TcxPCNavigatorButtonState): TColor; override; + function GetButtonContentPosition(AButton: TcxPCNavigatorButton): TPoint; override; + function GetButtonHeight: Integer; override; + function GetButtonsDistance(AButton1, AButton2: TcxPCNavigatorButton): Integer; override; + function GetButtonsRegionHOffset: Integer; override; + function GetButtonWidth(Button: TcxPCNavigatorButton): Integer; override; + function GetFocusRect: TRect; override; + procedure PaintButtonFrame(var ARect: TRect; + AButtonState: TcxPCNavigatorButtonState); override; + procedure PaintFrame; override; + procedure PaintMainTabFrame(var R: TRect); override; + procedure PaintTabsRowsDelimiter(var ARowRect: TRect; ARowIndex: Integer); override; + public + class function GetStyleID: TcxPCStyleID; override; + class function GetStyleName: TCaption; override; + class function HasLookAndFeel(ALookAndFeel: TcxLookAndFeel): Boolean; override; + end; + + { TcxPCFlatPainter } + + TcxPCFlatPainter = class(TcxPCTabsPainter) + protected + function GetButtonContentPosition(AButton: TcxPCNavigatorButton): TPoint; override; + function GetButtonHeight: Integer; override; + function GetButtonWidth(Button: TcxPCNavigatorButton): Integer; override; + function GetFrameWidth: Integer; override; + function GetTabClipRgn(ATabVisibleIndex: Integer): TcxRegion; override; + function GetTabClipRgnOperation(ATabVisibleIndex: Integer): TcxRegionOperation; override; + function IsNativePainting: Boolean; override; + function NeedShowFrame: Boolean; override; + procedure PaintButtonFrame(var ARect: TRect; + AButtonState: TcxPCNavigatorButtonState); override; + procedure PaintFrameBorder(R: TRect); override; + procedure PaintTabFrame(ATabVisibleIndex: Integer); override; + public + class function GetStyleID: TcxPCStyleID; override; + class function GetStyleName: TCaption; override; + class function HasLookAndFeel(ALookAndFeel: TcxLookAndFeel): Boolean; override; + end; + + { TcxPCOffice11Painter } + + TcxPCOffice11Painter = class(TcxPCUltraFlatPainter) + private + function GetSelectedColor1: TColor; + function GetSelectedColor2: TColor; + function IsGradientClienArea: Boolean; + function NeedShowMainTabOppositeRowLine: Boolean; + procedure PaintMainTabOppositeRowLine; + protected + class function GetFrameColor: TColor; virtual; + procedure DrawBackground(ACanvas: TCanvas; ARect: TRect; + ATabVisibleIndex: Integer); override; + procedure ExcludeUnderLine(var R: TRect); override; + procedure FillDisplayRect; override; + function GetButtonContentColor(AButtonState: TcxPCNavigatorButtonState): TColor; override; + function GetClientRectOffset: TRect; override; + function GetFocusRect: TRect; override; + function GetFreeSpaceColor: TColor; override; + function GetMainTabRowUnderlineColor: TColor; override; + function GetMainTabRowUnderlineRect: TRect; override; + function GetTabBodyColor(TabVisibleIndex: Integer): TColor; override; + function GetTabsDelimiterOffsets: TcxPCTabsDelimiterOffsets; override; + function GetTabsDelimiterWidth: Integer; override; + function GetTabsRowsDelimiterWidth: Integer; override; + function IsTabTransparent(ATabVisibleIndex: Integer): Boolean; override; + function NeedRedrawOnResize: Boolean; override; + function NeedShowTabsRegionFrame: Boolean; override; + procedure PaintButtonBackground(AButtonRect: TRect; + AButtonState: TcxPCNavigatorButtonState); override; + procedure PaintButtonFrame(var ARect: TRect; + AButtonState: TcxPCNavigatorButtonState); override; + procedure PaintClientArea; override; + procedure PaintFrame; override; + procedure PaintMainTabFrame(var R: TRect); override; + procedure PaintTabsDelimiter(const ARect: TRect); override; + procedure PaintTabsRowsDelimiter(var ARowRect: TRect; ARowIndex: Integer); override; + procedure PrepareDrawTabContentBitmapBackground(ABitmap: TBitmap; + const ABitmapPos: TPoint; ATabVisibleIndex: Integer); override; + procedure DrawGradientBackground(ACanvas: TCanvas; ARect: TRect; + ATabVisibleIndex: Integer; AHorizontal, AInverse: Boolean); + public + class function GetStyleID: TcxPCStyleID; override; + class function GetStyleName: TCaption; override; + class function HasLookAndFeel(ALookAndFeel: TcxLookAndFeel): Boolean; override; + end; + + { TcxPCSlantedPainter } + + TcxPCSlantedPainter = class(TcxPCStandardPainter) + private + FCutValue: Integer; + function GetTabsLineRect(ATabIndexInterval: TcxPCIndexInterval; AFullRect: Boolean): TRect; + function GetTabUnderlineRect(ATab: TcxTab): TRect; + protected + function AlwaysColoredTabs: Boolean; override; + procedure CalculateButtonContentParameters(AButton: TcxPCNavigatorButton; + out AParameters: TcxPCNavigatorButtonContentParameters); override; + function CalculateTabNormalWidth(Tab: TcxTab): Integer; override; + procedure FillDisplayRect; override; + function GetButtonColor(AButtonState: TcxPCNavigatorButtonState): TColor; override; + function GetButtonContentColor(AButtonState: TcxPCNavigatorButtonState): TColor; override; + function GetButtonContentPosition(AButton: TcxPCNavigatorButton): TPoint; override; + function GetButtonHeight: Integer; override; + function GetButtonsDistance(AButton1, AButton2: TcxPCNavigatorButton): Integer; override; + function GetButtonsRegionFromTabsOffset: Integer; override; + function GetButtonsRegionHOffset: Integer; override; + function GetButtonsRegionWOffset: Integer; override; + function GetButtonWidth(Button: TcxPCNavigatorButton): Integer; override; + function GetClientColor: TColor; override; + function GetClientRectOffset: TRect; override; + function GetDefaultTabNormalHeight: Integer; override; + function GetDrawImageOffset(TabVisibleIndex: Integer): TRect; override; + function GetDrawTextHOffset(TabVisibleIndex: Integer): TRect; override; + function GetFrameWidth: Integer; override; + function GetImageTextDistance(ATabVisibleIndex: Integer): Integer; override; + function GetMinTabNormalWidth(ATabVisibleIndex: Integer): Integer; override; + function GetTabBodyColor(TabVisibleIndex: Integer): TColor; override; + function GetTabClipRgn(ATabVisibleIndex: Integer): TcxRegion; override; + function GetTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; override; + function GetTabNormalWidth(ATabVisibleIndex: Integer): Integer; override; + function GetTabsContainerOffsets: TRect; override; + function GetTabsNormalDistance: TcxPCDistance; override; + function GetTabsRectOffset: TRect; override; + function GetTooNarrowTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; override; + procedure Init; override; + function InternalCalculateTabNormalHeight: Integer; override; + function IsOverTab(TabVisibleIndex: Integer; X, Y: Integer): Boolean; override; + function IsTabBorderThick(ATabVisibleIndex: Integer): Boolean; override; + procedure PaintButtonFrame(var ARect: TRect; + AButtonState: TcxPCNavigatorButtonState); override; + procedure PaintFrame; override; + procedure PaintTabShape(TabVisibleIndex: Integer); override; + procedure PaintTabsRegion; override; + procedure PrepareDrawTabContentBitmapBackground(ABitmap: TBitmap; + const ABitmapPos: TPoint; ATabVisibleIndex: Integer); override; + + function CanLightMainTab: Boolean; virtual; + function DirectionalGetFigureRegion(const R: TRect; APoints: array of TPoint; + ALinePositions: array of TLinePosition; ATabPositon: TcxTabPosition; + AForContent: Boolean): TcxRegion; + procedure DrawBackground(ACanvas: TCanvas; R: TRect; + ATabVisibleIndex: Integer; AHorizontalGradient, AInverseGradient: Boolean); virtual; + procedure DrawTabUnderline(ATabVisibleIndex: Integer); virtual; + procedure GetBackgroundGradientColors(ATabVisibleIndex: Integer; + out AColor1, AColor2: TColor); virtual; + function GetCutValue: Integer; + function GetGeometricalMinTabWidth: Integer; virtual; + function GetFrameColor: TColor; virtual; + function GetSlantedSides: TcxTabSlantPositions; virtual; + procedure GetTabFramePolyline(ATabVisibleIndex: Integer; + out APoints: TPoints; out ALinePositions: TLinePositions); + function GetTabImageSize: TSize; virtual; + function GetVerticalTextIndent: Integer; virtual; + function InternalGetCutValue: Integer; virtual; + function InternalGetTabClipRegion(ATabVisibleIndex: Integer; + AForContent: Boolean): TcxRegion; virtual; + procedure PaintTabFrame(ATabVisibleIndex: Integer; const R: TRect); virtual; + procedure PaintTabStateMark(ATabVisibleIndex: Integer); virtual; + + property SlantedSides: TcxTabSlantPositions read GetSlantedSides; + public + class function GetStyleID: TcxPCStyleID; override; + class function GetStyleName: TCaption; override; + class function HasLookAndFeel(ALookAndFeel: TcxLookAndFeel): Boolean; override; + end; + + { TcxPCOneNotePainter } + + TcxPCOneNotePainter = class(TcxPCSlantedPainter) + protected + class function AllowRotate: Boolean; override; + function CanLightMainTab: Boolean; override; + procedure DrawTabUnderline(ATabVisibleIndex: Integer); override; + procedure GetBackgroundGradientColors(ATabVisibleIndex: Integer; + out AColor1, AColor2: TColor); override; + function GetButtonsRegionHOffset: Integer; override; + function GetDrawImageOffset(TabVisibleIndex: Integer): TRect; override; + function GetDrawTextHOffset(TabVisibleIndex: Integer): TRect; override; + function GetFrameColor: TColor; override; + function GetGeometricalMinTabWidth: Integer; override; + function GetSlantedSides: TcxTabSlantPositions; override; + function GetTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; override; + function GetTabsContainerOffsets: TRect; override; + function GetTabsNormalDistance: TcxPCDistance; override; + function GetTabsRectOffset: TRect; override; + function InternalGetCutValue: Integer; override; + function InternalGetTabClipRegion(ATabVisibleIndex: Integer; + AForContent: Boolean): TcxRegion; override; + procedure PaintTabFrame(ATabVisibleIndex: Integer; const R: TRect); override; + procedure PaintTabStateMark(ATabVisibleIndex: Integer); override; + public + class function GetStyleID: TcxPCStyleID; override; + class function GetStyleName: TCaption; override; + class function HasLookAndFeel(ALookAndFeel: TcxLookAndFeel): Boolean; override; + end; + +procedure DrawBorder(ACanvas: TcxCanvas; var ARect: TRect; ASides: array of TcxBorder; AColors: array of TColor; AExcludeBorder: Boolean = False); +procedure ExchangeValues(var AValue1, AValue2); +procedure GetRectSize(const R: TRect; AIsHorizontal: Boolean; + out ARWidth, ARHeight: Integer); +procedure RotateTabsDistance(var ADistance: TcxPCDistance); + +var + cxPCLightBrushColor: TColor; + +implementation + +uses + Math, cxLookAndFeelPainters, cxPCPaintersFactory, dxThemeConsts, + dxThemeManager, dxUxTheme, dxOffice11; + +const + ButtonsPainterTabContentWOffsetA: array[Boolean] of TcxPCWOffset = ( + (Left: 4; Right: 4), + (Left: 3; Right: 4) + ); + + StandardNativePainterButtonHeight = 17; + StandardNativePainterButtonWidth = 17; + StandardPainterButtonHeight = 20; + StandardPainterButtonWidthA: array [Boolean, TcxPCNavigatorButton] of Integer = ( + (20, 20, 12, 20), // TabPosition in [tpLeft, tpRight] + (20, 20, 13, 20) // TabPosition in [tpTop, tpBottom] + ); + StandardPainterTabBorderWidth = 2; + StandardPainterDefaultTabNormalHeightA: array [TcxPCStandardStyle] of Integer = (18, 20, 20); + StandardPainterDefaultTabNormalHTextOffsetA: array [TcxPCStandardStyle] of Integer = (2, 4, 4); + StandardPainterDrawImageOffsetA: array [Boolean, TcxPCStandardStyle] of TRect = ( + ((Left: 6; Top: 1; Right: 0; Bottom: 0), + (Left: 6; Top: -1; Right: 0; Bottom: 1), + (Left: 6; Top: -1; Right: 0; Bottom: 1) + ), + ((Left: 8; Top: 1; Right: 0; Bottom: 3), + (Left: 7; Top: -1; Right: 0; Bottom: 1), + (Left: 7; Top: -1; Right: 0; Bottom: 1) + ) + ); + StandardPainterDrawTextHOffsetA: array [Boolean, TcxPCStandardStyle] of TRect = ( + ((Left: 5; Top: 1; Right: 5; Bottom: -1), + (Left: 6; Top: 0; Right: 4; Bottom: 1), + (Left: 6; Top: 0; Right: 4; Bottom: 1) + ), + ((Left: 5; Top: 1; Right: 5; Bottom: 2), + (Left: 6; Top: 0; Right: 4; Bottom: 1), + (Left: 6; Top: 0; Right: 4; Bottom: 1) + ) + ); + StandardPainterTabContentWOffsetA: array [Boolean, TcxPCStandardStyle] of TcxPCWOffset = ( + ((Left: 2; Right: 2), + (Left: 3; Right: 3), + (Left: 2; Right: 2) + ), + ((Left: 4; Right: 4), + (Left: 3; Right: 3), + (Left: 4; Right: 2) + ) + ); + StandardPainterTabsNormalDistanceA: array [TcxPCStandardStyle] of TcxPCDistance = ( + (dw: 0; dh: 0), + (dw: 3; dh: 3), + (dw: 10; dh: 3) + ); + StandardPainterMaxTabBorderWidth = 2; + StandardPainterWDistanceBetweenImageBorderAndText = 1; + StandardPainterTooNarrowTabContentWOffsetA: array [Boolean, TcxPCStandardStyle] of TcxPCWOffset = ( + ((Left: 2; Right: 2), + (Left: 3; Right: 3), + (Left: 2; Right: 2) + ), + ((Left: 4; Right: 4), + (Left: 3; Right: 3), + (Left: 3; Right: 2) + ) + ); + + TabsPainterContentWOffsetA: array[Boolean, Boolean] of TcxPCWOffset = ( + ((Left: 3; Right: 3), + (Left: 3; Right: 3)), + ((Left: 5; Right: 5), + (Left: 4; Right: 5)) + ); + TabsPainterDrawImageWithoutTextRotatedMainTabWOffset: array[Boolean] of TcxPCWOffset = + ((Left: 1; Right: 2), (Left: 2; Right: 1)); + TabsPainterButtonBorderWidth = 2; + + ExtraFlatPainterButtonSize = 13; + ExtraFlatPainterDefaultTabNormalWidth = 0; + ExtraFlatPainterDrawImageOffsetA: array [Boolean] of TRect = ( + (Left: 2; Top: 0; Right: 0; Bottom: 0), + (Left: 3; Top: 0; Right: 0; Bottom: 0) + ); + ExtraFlatPainterDrawTextHOffsetA: array [Boolean] of TRect = ( + (Left: 5; Top: 2; Right: 3; Bottom: 0), + (Left: 6; Top: 2; Right: 3; Bottom: 0) + ); + ExtraFlatPainterMainTabBorderWidth = 1; + ExtraFlatPainterMainTabRectCorrection: TcxPCRectCorrection = ( + dLeft: -1; dTop: -1; dRight: 1; dBottom: 1 + ); + ExtraFlatPainterTabContentWOffset: array [Boolean] of TcxPCWOffset = ( + (Left: 2; Right: 2), + (Left: 3; Right: 3) + ); + ExtraFlatPainterWDistanceBetweenImageBorderAndText = 0; + ExtraFlatPainterTabsRowFreeSpaceWidth = 3; + + ExtraFlatPainterMainTabRowUnderlineWidth = 2; + + ButtonedPainterDistanceBetweenTabsAndClientRects = 2; + + MinTabSelectionDistance: TcxPCDistance = (dw: 4; dh: 4); + + cxPCDarkEdgeColor = clBtnShadow; + cxPCDarkestEdgeColor = cl3DDkShadow; + cxPCTabBodyColor = clBtnFace; + cxPCLightEdgeColor = {clNavy}cl3DLight; + cxPCLightestEdgeColor = clBtnHighlight; + + cxPCLightBrushColorDelta = 20; + + cxPCArrowConvertionA: array [nbTopLeft .. nbBottomRight, Boolean] of TcxPCArrow = ( + (aLeft, aTop), + (aRight, aBottom) + ); + cxPCArrowSizeA: array [nbTopLeft .. nbGoDialog] of Integer = (5, 5, 4); + + UltraFlatPainterButtonWidthA: array[TcxPCNavigatorButton] of Integer = + (15, 15, 11, 14); + UltraFlatPainterButtonHeight = 15; + + FlatPainterButtonBorderWidth = 1; + + SlantedPainterButtonWidthA: array[TcxPCNavigatorButton] of Integer = + (17, 17, 13, 16); + SlantedPainterButtonHeight = 17; + + CutCornerSize = 6; + SlantedPainterTabStateMarkWidth = 3; + OneNotePainterTabFrameWidth = 2; + + CloseButtonCrossSize = 9; + +type + TWinControlAccess = class(TWinControl); + + { TcxPaletteChangedNotifier } + + TcxPaletteChangedNotifier = class(TcxSystemPaletteChangedNotifier) + protected + procedure DoChanged; override; + end; + +var + FPaletteChangedNotifier: TcxPaletteChangedNotifier; + OneNoteMainTabBorderColor: COLORREF; + OneNoteTabBorderColor: COLORREF; + OneNoteMainTabInnerBorderColor: COLORREF; + OneNoteTabHotBorderColor: COLORREF; + OneNoteTabInnerBorderColor1: COLORREF; + OneNoteTabInnerBorderColor2: COLORREF; + +procedure AddPoints(var APoints: TPoints; const ANewPoints: array of TPoint; + var ALinePositions: TLinePositions; const ANewLinePositions: array of TLinePosition); +var + I, AArrayLength: Integer; +begin + AArrayLength := Length(APoints); + SetLength(APoints, AArrayLength + Length(ANewPoints)); + for I := 0 to Length(ANewPoints) - 1 do + APoints[AArrayLength + I] := ANewPoints[I]; + + AArrayLength := Length(ALinePositions); + SetLength(ALinePositions, AArrayLength + Length(ANewLinePositions)); + for I := 0 to Length(ANewLinePositions) - 1 do + ALinePositions[AArrayLength + I] := ANewLinePositions[I]; +end; + +procedure CalculateLightBrushColor; +var + R, G, B: Integer; + Color: Integer; +begin + Color := ColorToRGB(clBtnFace); + R := GetRValue(Color) + cxPCLightBrushColorDelta; + if R > 255 then R := 255; + G := GetGValue(Color) + cxPCLightBrushColorDelta; + if G > 255 then G := 255; + B := GetBValue(Color) + cxPCLightBrushColorDelta; + if B > 255 then B := 255; + cxPCLightBrushColor := RGB(R, G, B); +end; + +procedure DrawBorder(ACanvas: TcxCanvas; var ARect: TRect; ASides: array of TcxBorder; AColors: array of TColor; AExcludeBorder: Boolean = False); +var + I: Integer; + ARegion: TcxRegion; + AInitialRect: TRect; +begin + AInitialRect := ARect; + for I := 0 to High(ASides) do + begin + ACanvas.Pen.Color := AColors[I]; + case ASides[I] of + bLeft: + begin + ACanvas.Polyline([ARect.TopLeft, Point(ARect.Left, ARect.Bottom)]); + Inc(ARect.Left); + end; + bTop: + begin + ACanvas.Polyline([ARect.TopLeft, Point(ARect.Right, ARect.Top)]); + Inc(ARect.Top); + end; + bRight: + begin + ACanvas.Polyline([Point(ARect.Right - 1, ARect.Top), Point(ARect.Right - 1, ARect.Bottom)]); + Dec(ARect.Right); + end; + bBottom: + begin + ACanvas.Polyline([Point(ARect.Left, ARect.Bottom - 1), Point(ARect.Right, ARect.Bottom - 1)]); + Dec(ARect.Bottom); + end; + end; + end; + if AExcludeBorder then + begin + ARegion := TcxRegion.Create(AInitialRect); + ARegion.Combine(TcxRegion.Create(ARect), roSubtract); + ACanvas.SetClipRegion(ARegion, roSubtract); + end; +end; + +procedure ExchangeValues(var AValue1, AValue2); +var + ATempValue: DWORD; +begin + ATempValue := DWORD(AValue1); + DWORD(AValue1) := DWORD(AValue2); + DWORD(AValue2) := ATempValue; +end; + +function GetControlRect(Control: TControl): TRect; +begin + Result.Left := 0; + Result.Top := 0; + Result.Right := Control.Width; + Result.Bottom := Control.Height; +end; + +function GetFigureRegion(APoints: array of TPoint; + const ALinePositions: array of TLinePosition; AForContent: Boolean): TcxRegion; + + function ThereIsLine(ALinePosition: TLinePosition): Boolean; + var + I: Integer; + begin + Result := False; + for I := 0 to High(ALinePositions) do + if ALinePositions[I] = ALinePosition then + begin + Result := True; + Break; + end; + end; + +var + I: Integer; + P1, P2: TPoint; +begin + for I := 0 to High(APoints) - 1 do + begin + P1 := APoints[I]; + P2 := APoints[I + 1]; + if AForContent then + begin + case ALinePositions[I] of + lpL: + begin + Inc(P1.X); + Inc(P2.X); + if ThereIsLine(lpLB) then + Inc(P1.Y); + if ThereIsLine(lpLT) then + Dec(P2.Y); + end; + lpLT: + begin + if ThereIsLine(lpL) then + Inc(P1.Y) + else + Inc(P1.X); + if ThereIsLine(lpT) then + Inc(P2.X) + else + Inc(P2.Y); + end; + lpLB: + begin + if ThereIsLine(lpB) then + Inc(P1.X) + else + Dec(P1.Y); + if ThereIsLine(lpL) then + Dec(P2.Y) + else + Inc(P2.X); + end; + lpT: + begin + Inc(P1.Y); + Inc(P2.Y); + if ThereIsLine(lpLT) then + Dec(P1.X); + if ThereIsLine(lpRT) then + Inc(P2.X); + end; + end; + end + else + case ALinePositions[I] of + lpRT: + begin + if ThereIsLine(lpT) then + Inc(P1.X) + else + Dec(P1.Y); + if ThereIsLine(lpR) then + Dec(P2.Y) + else + Inc(P2.X); + end; + lpR: + begin + Inc(P1.X); + Inc(P2.X); + if ThereIsLine(lpRT) then + Inc(P1.Y); + if ThereIsLine(lpRB) then + Dec(P2.Y); + end; + lpRB: + begin + if ThereIsLine(lpR) then + Inc(P1.Y) + else + Inc(P1.X); + if ThereIsLine(lpB) then + Inc(P2.X) + else + Inc(P2.Y); + end; + lpB: + begin + Inc(P1.Y); + Inc(P2.Y); + if ThereIsLine(lpRB) then + Dec(P1.X); + if ThereIsLine(lpLB) then + Inc(P2.X); + end; + end; + APoints[I] := P1; + APoints[I + 1] := P2; + end; + Result := TcxRegion.Create(CreatePolygonRgn(APoints, Length(APoints), WINDING)); +end; + +procedure GetRectSize(const R: TRect; AIsHorizontal: Boolean; + out ARWidth, ARHeight: Integer); +begin + if AIsHorizontal then + begin + ARWidth := R.Right - R.Left; + ARHeight := R.Bottom - R.Top; + end + else + begin + ARWidth := R.Bottom - R.Top; + ARHeight := R.Right - R.Left; + end; +end; + +function HSBToRGB(AHue, ASaturation, ABrightness: Extended): TColor; + + procedure GetRGB(out R, G, B: Integer); + var + AMinColorComponent, AMaxColorComponent: Extended; + begin + if ABrightness = 0 then + begin + R := 0; + G := 0; + B := 0; + Exit; + end; + AMaxColorComponent := ABrightness * 255 / 100; + AMinColorComponent := AMaxColorComponent * (100 - ASaturation) / 100; + if AHue <= 60 then + begin + R := Trunc(AMaxColorComponent); + G := Trunc(AMinColorComponent + (AMaxColorComponent - AMinColorComponent) * AHue / 60); + B := Trunc(AMinColorComponent); + end + else if AHue <= 120 then + begin + R := Trunc(AMaxColorComponent + (AMaxColorComponent - AMinColorComponent) * (60 - AHue) / 60); + G := Trunc(AMaxColorComponent); + B := Trunc(AMinColorComponent); + end + else if AHue <= 180 then + begin + R := Trunc(AMinColorComponent); + G := Trunc(AMaxColorComponent); + B := Trunc(AMinColorComponent + (AMaxColorComponent - AMinColorComponent) * (AHue - 120) / 60); + end + else if AHue <= 240 then + begin + R := Trunc(AMinColorComponent); + G := Trunc(AMaxColorComponent + (AMaxColorComponent - AMinColorComponent) * (180 - AHue) / 60); + B := Trunc(AMaxColorComponent); + end + else if AHue <= 300 then + begin + R := Trunc(AMinColorComponent + (AMaxColorComponent - AMinColorComponent) * (AHue - 240) / 60); + G := Trunc(AMinColorComponent); + B := Trunc(AMaxColorComponent); + end + else + begin + R := Trunc(AMaxColorComponent); + G := Trunc(AMinColorComponent); + B := Trunc(AMaxColorComponent + (AMaxColorComponent - AMinColorComponent) * (300 - AHue) / 60); + end + end; + +var + R, G, B: Integer; +begin + GetRGB(R, G, B); + Result := RGB(R, G, B); +end; + +procedure RGBToHSB(ARGBColor: TColor; out Hue, Saturation, Brightness: Extended); +var + AMinColorComponent: Integer; + R, G, B: Integer; + + procedure PreCalculate; + begin + ARGBColor := ColorToRGB(ARGBColor); + R := GetRValue(ARGBColor); + G := GetGValue(ARGBColor); + B := GetBValue(ARGBColor); + + AMinColorComponent := R; + if G < AMinColorComponent then + AMinColorComponent := G; + if B < AMinColorComponent then + AMinColorComponent := B; + end; + + function GetBrightness: Integer; + begin + Result := R; + if G > Result then + Result := G; + if B > Result then + Result := B; + end; + + function GetSaturation(ABrightness: Extended): Extended; + begin + if ABrightness = 0 then + Result := 0 + else + Result := 100 - AMinColorComponent * 100 / ABrightness; + end; + + function GetHue(ABrightness: Integer; ASaturation: Extended): Extended; + begin + if ASaturation = 0 then + Result := 0 // ??? + else + begin + if R = ABrightness then + Result := (G - B) * 60 / (ABrightness - AMinColorComponent) + else if G = ABrightness then + Result := (B - R) * 60 / (ABrightness - AMinColorComponent) + 120 + else + Result := (R - G) * 60 / (ABrightness - AMinColorComponent) + 240; + if Result < 0 then + Result := Result + 360; + end; + end; + +var + ABrightness: Integer; +begin + PreCalculate; + + ABrightness := GetBrightness; + Brightness := ABrightness * 100 / 255; + Saturation := GetSaturation(ABrightness); + Hue := GetHue(ABrightness, Saturation); +end; + +function Light(AColor: TColor; APercentage: Byte): TColor; +var + AHue, ASaturation, ABrightness: Extended; +begin + RGBToHSB(ColorToRGB(AColor), AHue, ASaturation, ABrightness); + ABrightness := ABrightness * (100 + APercentage) / 100; + if ABrightness > 100 then + ABrightness := 100; + Result := HSBToRGB(AHue, ASaturation, ABrightness); +end; + +procedure PrepareOneNoteStyleColors; +const + AColors: array[TOffice11Scheme, 0..5] of TColor = ( + (clBtnShadow, clBtnShadow, clWhite, $6A240A, clBtnFace, clBtnFace), + ($9C613B, $9A3500, clWhite, $800000, clWhite, $F1A675), + ($588060, $6B7760, clWhite, $385D3F, clWhite, $8CC2B0), + ($947C7C, $927476, clWhite, $6F4B4B, clWhite, $CEB9BA) + ); +var + AColorScheme: TOffice11Scheme; +begin + AColorScheme := GetOffice11Scheme; + OneNoteMainTabBorderColor := AColors[AColorScheme, 0]; + OneNoteTabBorderColor := AColors[AColorScheme, 1]; + OneNoteMainTabInnerBorderColor := AColors[AColorScheme, 2]; + OneNoteTabHotBorderColor := AColors[AColorScheme, 3]; + OneNoteTabInnerBorderColor1 := AColors[AColorScheme, 4]; + OneNoteTabInnerBorderColor2 := AColors[AColorScheme, 5]; +end; + +procedure RotateTabsDistance(var ADistance: TcxPCDistance); +var + A: Integer; +begin + A := ADistance.dw; + ADistance.dw := ADistance.dh; + ADistance.dh := A; +end; + +function Size(cx, cy: Integer): TSize; +begin + Result.cx := cx; + Result.cy := cy; +end; + +procedure TcxPCTabsPainter.CorrectTabRect(TabVisibleIndex: Integer; + var TabRectCorrection: TcxPCRectCorrection); +const + TabRectCorrectionA: array[TcxTabPosition] of TcxPCRectCorrection = ( + (dLeft: -2; dTop: -2; dRight: 2; dBottom: 1), + (dLeft: -2; dTop: -1; dRight: 2; dBottom: 2), + (dLeft: -2; dTop: -2; dRight: 1; dBottom: 2), + (dLeft: -1; dTop: -2; dRight: 2; dBottom: 2) + ); +begin + inherited CorrectTabRect(TabVisibleIndex, TabRectCorrection); + if TabVisibleIndex = ParentInfo.MainTabVisibleIndex then + TabRectCorrection := TabRectCorrectionA[ParentInfo.VisibleTabs[TabVisibleIndex].PaintingPosition]; +end; + +procedure TcxPCTabsPainter.DrawNativeTabBackground(DC: HDC; ATab: TcxTabSheet); +var + ATheme: TdxTheme; + R: TRect; +begin + R := GetDisplayRect; + InflateRect(R, StandardPainterTabControlFrameBorderWidth, + StandardPainterTabControlFrameBorderWidth); + OffsetRect(R, -ATab.Left, -ATab.Top); + ATheme := OpenTheme(totTab); + DrawThemeBackground(ATheme, DC, TABP_PANE, 0, R); +end; + +function TcxPCTabsPainter.GetButtonContentPosition( + AButton: TcxPCNavigatorButton): TPoint; +begin + Result := Get3DButtonContentPosition(AButton); +end; + +function TcxPCTabsPainter.GetButtonHeight: Integer; +begin + if not IsNativePainting then + Result := inherited GetButtonHeight + else + Result := StandardNativePainterButtonHeight; +end; + +function TcxPCTabsPainter.GetButtonsRegionHOffset: Integer; +begin + Result := 0; + if ParentInfo.IsTabsContainer then + Result := TabsContainerOffset; +end; + +function TcxPCTabsPainter.GetButtonsRegionWOffset: Integer; +begin + Result := 0; + if ParentInfo.IsTabsContainer then + Result := TabsContainerOffset; +end; + +function TcxPCTabsPainter.GetButtonWidth(Button: TcxPCNavigatorButton): Integer; +var + ASize: TSize; +begin + if IsNativePainting then + begin + Result := StandardNativePainterButtonWidth; + if Button = nbGoDialog then + begin + if GetThemePartSize(OpenTheme(totSpin), ParentInfo.Canvas.Handle, SPNP_DOWN, + DNS_NORMAL, TS_TRUE, ASize) = S_OK then + Result := ASize.cx; + end + (*else + if Button = nbClose then + begin + if GetThemePartSize(OpenTheme(totWindow), ParentInfo.Canvas.Handle, WP_SMALLCLOSEBUTTON, + CBS_NORMAL, TS_TRUE, ASize) = S_OK then + if ParentInfo.TabPosition in [tpTop, tpBottom] then + Result := ASize.cx + else + Result := ASize.cy; + end;*) + end + else + Result := inherited GetButtonWidth(Button); +end; + +function TcxPCTabsPainter.GetClientRectOffset: TRect; + + function GetNativeFrameSizeCorrection: TRect; + var + R: TRect; + begin + R := GetNativeContentOffset; + case ParentInfo.TabPosition of + tpLeft: + Result := Rect(R.Bottom, R.Left, R.Top, R.Right); + tpTop: + Result := R; + tpRight: + Result := Rect(R.Top, R.Right, R.Bottom, R.Left); + tpBottom: + Result := Rect(R.Right, R.Bottom, R.Left, R.Top); + end; + Result.Right := -Result.Right; + Result.Bottom := -Result.Bottom; + end; + +begin + Result := inherited GetClientRectOffset; + if IsNativePainting then + begin + OffsetRect(Result, -StandardPainterTabControlFrameBorderWidth, + -StandardPainterTabControlFrameBorderWidth); + cxGraphics.ExtendRect(Result, GetNativeFrameSizeCorrection); + end; + if ParentInfo.IsTabsContainer and not IsNativePainting then + Inc(Result.Top, TabsContainerBaseWidth - GetFrameWidth); +end; + +function TcxPCTabsPainter.GetDisplayRectOffset: TRect; +begin + Result := inherited GetDisplayRectOffset; + if not ParentInfo.HideTabs and (ParentInfo.RowCount > 0) then + Dec(Result.Top); +end; + +function TcxPCTabsPainter.GetDrawImageOffset(TabVisibleIndex: Integer): TRect; +begin + Result := inherited GetDrawImageOffset(TabVisibleIndex); + if (ParentInfo.VisibleTabs[TabVisibleIndex].PaintingPositionIndex in [5, 7, 10]) then + Inc(Result.Bottom); +end; + +function TcxPCTabsPainter.GetDrawImageWithoutTextWOffset(TabVisibleIndex: Integer): TcxPCWOffset; +begin + if ParentInfo.Rotate and ParentInfo.VisibleTabs[TabVisibleIndex].IsMainTab then + Result := TabsPainterDrawImageWithoutTextRotatedMainTabWOffset[ParentInfo.VisibleTabs[TabVisibleIndex].PaintingPositionIndex in [3, 6, 11]] + else + Result := inherited GetDrawImageWithoutTextWOffset(TabVisibleIndex); +end; + +function TcxPCTabsPainter.GetDrawTextHOffset(TabVisibleIndex: Integer): TRect; +begin + Result := inherited GetDrawTextHOffset(TabVisibleIndex); + if (ParentInfo.VisibleTabs[TabVisibleIndex].PaintingPositionIndex in [5, 7, 10]) then + Inc(Result.Bottom); + with ParentInfo do + if VisibleTabs[TabVisibleIndex].IsMainTab and (GetTabRotatedImageSize.cx = 0) then + Inc(Result.Left, 2); +end; + +function TcxPCTabsPainter.GetImageTextDistance(ATabVisibleIndex: Integer): Integer; +//var +// ACorrection: Integer; +// ATab: TcxTab; +// ATabContentWOffset: TcxPCWOffset; +begin + Result := inherited GetImageTextDistance(ATabVisibleIndex); +// ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; +// if ParentInfo.Rotate and (ATab.Caption <> '') then +// begin +// ATabContentWOffset := TabsPainterContentWOffsetA[IsTabBorderThick(ATabVisibleIndex), +// ParentInfo.Rotate]; +// if ATab.PaintingPositionIndex in [3, 6, 11] then +// ExchangeValues(ATabContentWOffset.Left, ATabContentWOffset.Right); +// ACorrection := 12; +// if ATab.IsMainTab then +// Inc(ACorrection, 3); +// ACorrection := (ACorrection - ATabContentWOffset.Left - ATabContentWOffset.Right) div 2; +// Inc(Result, ACorrection); +// end; +end; + +{ TcxPCTabsPainter } + +class function TcxPCTabsPainter.GetStandardStyle: TcxPCStandardStyle; +begin + Result := tsTabs; +end; + +class function TcxPCTabsPainter.GetStyleID: TcxPCStyleID; +begin + Result := cxPCTabsStyle; +end; + +class function TcxPCTabsPainter.GetStyleName: TCaption; +begin + Result := 'Tabs'; +end; + +class function TcxPCTabsPainter.HasLookAndFeel(ALookAndFeel: TcxLookAndFeel): Boolean; +begin + Result := ALookAndFeel.GetAvailablePainter([totTab]).LookAndFeelStyle in + [lfsStandard, lfsNative]; +end; + +class function TcxPCTabsPainter.IsDefault(ALookAndFeel: TcxLookAndFeel): Boolean; +begin + Result := ALookAndFeel.NativeStyle; +end; + +function TcxPCTabsPainter.GetTabBodyColor(TabVisibleIndex: Integer): TColor; +var + ATab: TcxTab; +begin + ATab := ParentInfo.VisibleTabs[TabVisibleIndex]; + if ATab.Highlighted then + Result := HighlightedTabBodyColor + else + begin + Result := GetTabColor(TabVisibleIndex); + if Result = clDefault then + Result := cxPCTabBodyColor; + end; +end; + +function TcxPCTabsPainter.GetTabClipRgn(ATabVisibleIndex: Integer): TcxRegion; +var + ATab: TcxTab; + ATabRect: TRect; +begin + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + + ATabRect := ATab.VisibleRect; + if ATab.IsMainTab then + ATabRect := GetExtendedRect(ATab.VisibleRect, Rect(0, 0, 0, -1), ATab.PaintingPosition); + + Result := TcxRegion.Create(ATabRect); +end; + +function TcxPCTabsPainter.GetTabClipRgnOperation(ATabVisibleIndex: Integer): TcxRegionOperation; +begin + if not ParentInfo.VisibleTabs[ATabVisibleIndex].IsMainTab then + Result := roIntersect + else + Result := roSet; +end; + +function TcxPCTabsPainter.GetTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; +var +// ACorrection: Integer; + ATab: TcxTab; +begin + Result := TabsPainterContentWOffsetA[IsTabBorderThick(ATabVisibleIndex), + ParentInfo.Rotate]; + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + if ATab.PaintingPositionIndex in [3, 6, 11] then + ExchangeValues(Result.Left, Result.Right); +// if ParentInfo.Rotate and (ATab.Caption <> '') then +// begin +// ACorrection := 12; +// if ATab.IsMainTab then +// Inc(ACorrection, 3); +// ACorrection := (ACorrection - Result.Left - Result.Right) div 2; +// if GetTabBaseImageSize.cx = 0 then +// Inc(Result.Left, ACorrection); +// Inc(Result.Right, ACorrection); +// end; +end; + +procedure TcxPCTabsPainter.GetTabNativePartAndState(ATabVisibleIndex: Integer; + out PartId, StateId: Integer); +type + TcxTabPositionWithinRow = (tprLeftMost, tprMiddle, tprRightMost); +const + ATabNativePartA: array[Boolean, TcxTabPositionWithinRow] of Integer = ( + (TABP_TABITEMLEFTEDGE, TABP_TABITEM, TABP_TABITEMRIGHTEDGE), + (TABP_TOPTABITEMLEFTEDGE, TABP_TOPTABITEM, TABP_TOPTABITEMRIGHTEDGE) + ); +var + ALineIndexBoundsA: TcxPCLineIndexBoundsArray; + ATab: TcxTab; + ATabPositionWithinRow: TcxTabPositionWithinRow; +begin + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + InitializeLineBoundsArray(ParentControl, ALineIndexBoundsA); + + if ParentInfo.MultiLine and not ParentInfo.RaggedRight then + begin + if ParentInfo.IsTabsContainer then + ATabPositionWithinRow := tprMiddle + else + if (ALineIndexBoundsA[ATab.VisibleRow].Right = ATab.VisibleIndex) then + ATabPositionWithinRow := tprRightMost + else + if ALineIndexBoundsA[ATab.VisibleRow].Left = ATab.VisibleIndex then + ATabPositionWithinRow := tprLeftMost + else + ATabPositionWithinRow := tprMiddle; + end + else + if ParentInfo.IsTabsContainer then + ATabPositionWithinRow := tprMiddle + else + if ALineIndexBoundsA[ATab.VisibleRow].Left = ATab.VisibleIndex then + ATabPositionWithinRow := tprLeftMost + else + if ATab.VisibleIndex = ParentControl.Tabs.VisibleTabsCount - 1 then + ATabPositionWithinRow := tprRightMost + else + ATabPositionWithinRow := tprMiddle; + + // to work like standard PageControl + if not ParentInfo.MultiLine or ParentInfo.RaggedRight then + if ATab.IsMainTab and (ATabPositionWithinRow = tprRightMost) then + ATabPositionWithinRow := tprMiddle; + + PartId := ATabNativePartA[ATab.IsMainTab, ATabPositionWithinRow]; + StateId := GetTabNativeState(ATabVisibleIndex); +end; + +function TcxPCTabsPainter.GetTabsContainerOffsets: TRect; +begin + Result := Rect(TabsContainerOffset, TabsContainerOffset, TabsContainerOffset, 0); +end; + +function TcxPCTabsPainter.GetTabsPosition( + NavigatorButtons: TcxPCNavigatorButtons): TcxPCTabsPosition; + +var + NormalTabsRectCorrection: TRect; + + procedure DoHardCalculation; + var + AButtonsWidth: Integer; + ATabsContainerOffset: TRect; + begin + AButtonsWidth := CalculateButtonsRegionWidth(NavigatorButtons); + ATabsContainerOffset := cxEmptyRect; + if ParentInfo.IsTabsContainer then + ATabsContainerOffset := GetTabsContainerOffsets; + + NormalTabsRectCorrection := RotateRect(Rect(0, 2 + ATabsContainerOffset.Top, 0, 0), ParentInfo.TabPosition); + ExtendRect(Result.ExtendedTabsRect, RotateRect(Rect(0, ATabsContainerOffset.Top, 0, 0), ParentInfo.TabPosition)); + with ParentInfo do + begin + if TabPosition in [tpTop, tpBottom] then + begin + if MultiLine or (NavigatorButtons = []) then + begin + Result.ExtendedTabsRect.Left := ATabsContainerOffset.Left; + Result.ExtendedTabsRect.Right := Width - ATabsContainerOffset.Left; + NormalTabsRectCorrection.Left := 2 + ATabsContainerOffset.Left; + NormalTabsRectCorrection.Right := 2 + ATabsContainerOffset.Left; + end + else + begin + if NavigatorPosition in [npLeftTop, npLeftBottom] then + begin + Result.ExtendedTabsRect.Left := AButtonsWidth; + Result.ExtendedTabsRect.Right := Width - ATabsContainerOffset.Left; + end + else + begin + Result.ExtendedTabsRect.Left := ATabsContainerOffset.Left; + Result.ExtendedTabsRect.Right := Width - AButtonsWidth; + end; + NormalTabsRectCorrection.Left := Result.ExtendedTabsRect.Left + 2; + NormalTabsRectCorrection.Right := Width - Result.ExtendedTabsRect.Right + 2; + end; + Result.NormalRowWidth := Width - NormalTabsRectCorrection.Left - NormalTabsRectCorrection.Right; + end + else + begin + if MultiLine or (NavigatorButtons = []) then + begin + Result.ExtendedTabsRect.Top := ATabsContainerOffset.Left; + Result.ExtendedTabsRect.Bottom := Height - ATabsContainerOffset.Left; + NormalTabsRectCorrection.Top := 2 + ATabsContainerOffset.Left; + NormalTabsRectCorrection.Bottom := 2 + ATabsContainerOffset.Left; + end + else + begin + if NavigatorPosition in [npLeftTop, npRightTop] then + begin + Result.ExtendedTabsRect.Top := AButtonsWidth; + Result.ExtendedTabsRect.Bottom := Height - ATabsContainerOffset.Left; + end + else + begin + Result.ExtendedTabsRect.Top := ATabsContainerOffset.Left; + Result.ExtendedTabsRect.Bottom := Height - AButtonsWidth; + end; + NormalTabsRectCorrection.Top := Result.ExtendedTabsRect.Top + 2; + NormalTabsRectCorrection.Bottom := Height - Result.ExtendedTabsRect.Bottom + 2; + end; + Result.NormalRowWidth := Height - NormalTabsRectCorrection.Top - NormalTabsRectCorrection.Bottom; + end; + end; + end; + +begin + with Result do + begin + ExtendedTabsRect := GetControlRect(ParentControl); + NormalTabsRect := ExtendedTabsRect; + + DoHardCalculation; + + cxGraphics.ExtendRect(NormalTabsRect, NormalTabsRectCorrection); + + ExtendedTopOrLeftTabsRectBottomOrRightBorderOffset := 0; + ExtendedBottomOrRightTabsRectTopOrLeftBorderOffset := 0; + if ParentInfo.TabPosition in [tpTop, tpLeft] then + ExtendedTopOrLeftTabsRectBottomOrRightBorderOffset := 1 + else + ExtendedBottomOrRightTabsRectTopOrLeftBorderOffset := -1; + MinDistanceBetweenTopOrLeftAndBottomOrRightExtendedTabsRects := 0; + end; + + CalculateButtonsRegion(NavigatorButtons); +end; + +function TcxPCTabsPainter.GetTooNarrowTabContentWOffset( + ATabVisibleIndex: Integer): TcxPCWOffset; +begin + Result := GetTabContentWOffset(ATabVisibleIndex); +end; + +function TcxPCTabsPainter.InternalCalculateTabNormalHeight: Integer; +begin + if ParentInfo.Rotate then + Result := inherited InternalCalculateTabNormalHeight - 2 + else + Result := inherited InternalCalculateTabNormalHeight - 3; +end; + +procedure TcxPCTabsPainter.InternalPrepareOutTabImageAndTextData( + ATabVisibleIndex: Integer; var AImageRect, ATextRect: TRect); +var + ATab: TcxTab; +begin + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + if IsNativePainting and ATab.IsMainTab and (ATab.PaintingPositionIndex in [5, 7, 10]) then + begin + OffsetRect(AImageRect, 0, 1); + OffsetRect(ATextRect, 0, 1); + end; + inherited InternalPrepareOutTabImageAndTextData(ATabVisibleIndex, AImageRect, + ATextRect); +end; + +procedure TcxPCTabsPainter.InvalidateTabRect(ATabVisibleIndex: Integer); +var + ATab: TcxTab; + R: TRect; +begin + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + R := ATab.VisibleRect; + R := GetExtendedRect(R, Rect(0, 0, 0, -1), ATab.PaintingPosition); + ParentControl.InvalidateRect(R, False); +end; + +function TcxPCTabsPainter.IsNativePainting: Boolean; +begin + if csDestroying in ParentControl.ComponentState then + Result := False + else + Result := ParentControl.LookAndFeel.NativeStyle and + AreVisualStylesAvailable and (OpenTheme(totTab) <> TC_NONE); +end; + +function TcxPCTabsPainter.IsOverTab(TabVisibleIndex: Integer; X, Y: Integer): Boolean; +begin + // TODO + Result := True; +end; + +function TcxPCTabsPainter.NeedShowFrame: Boolean; +begin + Result := True; +end; + +procedure TcxPCTabsPainter.Paint; +begin +{ if IsNativePainting then + begin + FMDC := 0; + FPrevMDCBitmap := 0; + try + FMDC := CreateCompatibleDC(ParentInfo.Canvas.Handle); + FPrevMDCBitmap := SelectObject(FMDC, + CreateCompatibleBitmap(ParentInfo.Canvas.Handle, ParentControl.Width, + ParentControl.Height)); + + PrepareBackgroundBitmap; + inherited Paint; + finally + if FPrevMDCBitmap <> 0 then + DeleteObject(SelectObject(FMDC, FPrevMDCBitmap)); + if FMDC <> 0 then + DeleteDC(FMDC); + end; + end + else} + inherited Paint; +end; + +procedure TcxPCTabsPainter.PaintButton(Button: TcxPCNavigatorButton; + const ButtonRect: TRect); +const + AArrowButtonPartIdMap: array [TcxPCArrow] of Integer = (SPNP_UP, SPNP_DOWN, + SPNP_DOWNHORZ, SPNP_UPHORZ); + AArrowButtonStateIdMap: array [TcxPCArrow, TcxPCNavigatorButtonState] of Integer = ( + (UPS_NORMAL, UPS_PRESSED, UPS_HOT, UPS_DISABLED), + (DNS_NORMAL, DNS_PRESSED, DNS_HOT, DNS_DISABLED), + (DNHZS_NORMAL, DNHZS_PRESSED, DNHZS_HOT, DNHZS_DISABLED), + (UPHZS_NORMAL, UPHZS_PRESSED, UPHZS_HOT, UPHZS_DISABLED) + ); + ACloseButtonStateIdMap: array [TcxPCNavigatorButtonState] of Integer = + (CBS_NORMAL, CBS_PUSHED, CBS_HOT, CBS_DISABLED); +var + AArrow: TcxPCArrow; + APartId, AStateId: Integer; + ATheme: TdxTheme; +begin + if IsNativePainting then + begin + if Button = nbClose then + begin + ATheme := OpenTheme(totWindow); + APartId := WP_SMALLCLOSEBUTTON; + AStateId := ACloseButtonStateIdMap[ParentInfo.NavigatorButtonsState[Button]]; + end + else + begin + ATheme := OpenTheme(totSpin); + AArrow := GetButtonArrow(Button); + APartId := AArrowButtonPartIdMap[AArrow]; + AStateId := AArrowButtonStateIdMap[AArrow, ParentInfo.NavigatorButtonsState[Button]]; + end; + if ParentControl.ParentBackground and IsThemeBackgroundPartiallyTransparent(ATheme, APartId, AStateId) then + cxDrawThemeParentBackground(ParentControl, ParentInfo.Canvas, ButtonRect) + else + begin + ParentInfo.Canvas.Brush.Color := ParentInfo.Color; + ParentInfo.Canvas.FillRect(ButtonRect); + end; + DrawThemeBackground(ATheme, ParentInfo.Canvas.Handle, APartId, AStateId, + ButtonRect); + end + else + inherited PaintButton(Button, ButtonRect); +end; + +procedure TcxPCTabsPainter.PaintClientArea; +begin + if IsNativePainting then + InternalPaintFrame(ParentInfo.Canvas.Canvas) + else + inherited PaintClientArea; +end; + +procedure TcxPCTabsPainter.PaintFrame; +var + AFrameRect: TRect; +begin + inherited PaintFrame; + if ParentInfo.IsTabsContainer then + begin + AFrameRect := GetFrameRect; + InflateRect(AFrameRect, -GetFrameWidth, -GetFrameWidth); + ParentInfo.Canvas.Brush.Color := cxPCTabBodyColor; + ParentInfo.Canvas.FillRect(AFrameRect); + end; +end; + +procedure TcxPCTabsPainter.PaintTabShape(TabVisibleIndex: Integer); + + procedure PaintNativeFrame; + var + ABitmap: TBitmap; + ATab: TcxTab; + ATabRect: TRect; + begin + ATab := ParentInfo.VisibleTabs[TabVisibleIndex]; + ATabRect := ATab.FullRect; + if ATab.IsMainTab then + ATabRect := GetExtendedRect(ATabRect, Rect(0, 0, 0, -1), ATab.PaintingPosition); + ABitmap := ATab.PaintBitmap; + case ATab.PaintingPositionIndex of + 2, 4, 7, 11: + begin + ParentInfo.Canvas.RotateBitmap(ABitmap, raPlus90); + with FOutTabImageAndTextData.TabTextRect do + FOutTabImageAndTextData.TabTextRect := Rect(Top, ABitmap.Width - Right, Bottom, ABitmap.Width - Left); + end; + 3, 5, 8, 12: + begin + ParentInfo.Canvas.RotateBitmap(ABitmap, raMinus90); + with FOutTabImageAndTextData.TabTextRect do + FOutTabImageAndTextData.TabTextRect := Rect(ABitmap.Height - Bottom, Left, ABitmap.Height - Top, Right); + end; + end; + OffsetRect(FOutTabImageAndTextData.TabTextRect, ATabRect.Left, ATabRect.Top); + ParentInfo.Canvas.CopyRect(ATabRect, ABitmap.Canvas, + Rect(0, 0, ABitmap.Width, ABitmap.Height)); + InflateRect(ATabRect, -StandardPainterTabBorderWidth, -StandardPainterTabBorderWidth); + InternalDrawFocusRect(TabVisibleIndex, ATabRect); + ATab.ResetPaintBitmap; + end; + +var + ATab: TcxTab; + MainTab: Boolean; + AFocusRect, R: TRect; + TabPaintingPosition: TcxTabPosition; +begin + if IsNativePainting then + begin + PaintNativeFrame; + Exit; + end; + + ATab := ParentInfo.VisibleTabs[TabVisibleIndex]; + MainTab := ATab.IsMainTab; + + TabPaintingPosition := ATab.PaintingPosition; + + R := ATab.FullRect; + InflateRect(R, -StandardPainterTabBorderWidth, -StandardPainterTabBorderWidth); +// if MainTab or ParentInfo.IsTabsContainer then + R := GetExtendedRect(R, Rect(0, 0, 0, -StandardPainterTabBorderWidth), TabPaintingPosition); + + ParentInfo.Canvas.Brush.Style := bsSolid; + ParentInfo.Canvas.Brush.Color := GetTabBodyColor(TabVisibleIndex); + ParentInfo.Canvas.FillRect(R); + + if MainTab then + begin + AFocusRect := GetExtendedRect(R, Rect(0, 0, 0, 1), TabPaintingPosition); + InternalDrawFocusRect(TabVisibleIndex, AFocusRect); + end; + + if not MainTab then + begin + SubtractRect(R, GetExtendedRect(R, Rect(0, 0, 0, -StandardPainterTabBorderWidth), TabPaintingPosition), R); + ParentInfo.Canvas.Brush.Color := ParentInfo.Color; + ParentInfo.Canvas.FillRect(R); + end; + + PaintTabFrame(TabVisibleIndex); +end; + +procedure TcxPCTabsPainter.PaintTabsRegion; +var + I: Integer; + FirstIndex, LastIndex: Integer; + MainTabVisibleIndex: Integer; + SpecialTab: TcxTab; +begin + MainTabVisibleIndex := ParentInfo.MainTabVisibleIndex; + if MainTabVisibleIndex <> -1 then + begin + SpecialTab := ParentInfo.VisibleTabs[MainTabVisibleIndex]; + if SpecialTab.RealVisible then + PaintTab(MainTabVisibleIndex); + end; + + InitializeVisibleTabRange(ParentControl, FirstIndex, LastIndex); + for I := FirstIndex to LastIndex do + if I <> MainTabVisibleIndex then + PaintTab(I); +end; + +procedure TcxPCTabsPainter.PaintNativeTabBackground( + DC: HDC; ATabVisibleIndex: Integer; const ABounds: TRect); +var + ATheme: TdxTheme; + APartId, AStateId: Integer; +begin + GetTabNativePartAndState(ATabVisibleIndex, APartId, AStateId); + ATheme := OpenTheme(totTab); + DrawThemeBackground(ATheme, DC, APartId, AStateId, ABounds); +end; + +{procedure TcxPCTabsPainter.PrepareBackgroundBitmap; +var + ATempCanvas: TCanvas; + R: TRect; +begin + ATempCanvas := TCanvas.Create; + try + ATempCanvas.Handle := FMDC; + R := GetControlRect(ParentControl); + if ParentControl.ParentBackground then + cxDrawThemeParentBackground(ParentControl, ATempCanvas, R) + else + begin + ATempCanvas.Brush.Color := ParentInfo.Color; + ATempCanvas.FillRect(R); + end; + InternalPaintFrame(ATempCanvas); + finally + ATempCanvas.Free; + end; +end; } + +procedure TcxPCTabsPainter.PrepareTabBackground(ATabVisibleIndex: Integer); +const + RRectNativePaintingCorrectionA: array[TcxTabPosition] of TcxPCRectCorrection = ( + (dLeft: 0; dTop: 0; dRight: 0; dBottom: 1), + (dLeft: 0; dTop: -1; dRight: 0; dBottom: 0), + (dLeft: 0; dTop: 0; dRight: 1; dBottom: 0), + (dLeft: -1; dTop: 0; dRight: 0; dBottom: 0) + ); +var + Tab: TcxTab; + MainTab: Boolean; + FullRect, R: TRect; + TabPaintingPosition: TcxTabPosition; + ABitmap: TBitmap; + R1: TRect; +begin + Tab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + MainTab := Tab.IsMainTab; + + FullRect := Tab.FullRect; + TabPaintingPosition := Tab.PaintingPosition; + with ParentInfo.Canvas do + begin + R := FullRect; + if MainTab then + CorrectRect(R, RRectNativePaintingCorrectionA[TabPaintingPosition]); + + Tab.InitializePaintBitmap; + ABitmap := Tab.PaintBitmap; + + R1 := Rect(0, 0, R.Right - R.Left, R.Bottom - R.Top); + if TabPaintingPosition in [tpLeft, tpRight] then + begin + ABitmap.Width := R1.Bottom; + ABitmap.Height := R1.Right; + end + else + begin + ABitmap.Width := R1.Right; + ABitmap.Height := R1.Bottom; + end; + PrepareTabBitmapBackground(ABitmap, R, Tab); + R1 := Rect(0, 0, ABitmap.Width, ABitmap.Height); + PaintNativeTabBackground(ABitmap.Canvas.Handle, ATabVisibleIndex, R1); + case Tab.PaintingPositionIndex of + 2, 9: + RotateBitmap(ABitmap, raMinus90); + 3: + RotateBitmap(ABitmap, raPlus90); + 4: + RotateBitmap(ABitmap, ra180, True); + 5, 10: + RotateBitmap(ABitmap, ra0, True); + 6, 11: + RotateBitmap(ABitmap, raPlus90, True); + 7: + RotateBitmap(ABitmap, ra180); + 12: + RotateBitmap(ABitmap, raMinus90, True); + end; + end; +end; + +procedure TcxPCTabsPainter.PrepareTabBitmapBackground(ABitmap: TBitmap; + const ARect: TRect; ATab: TcxTab); +begin + if IsNativePainting and ParentControl.ParentBackground then + cxDrawTransparentControlBackground(ParentControl, ABitmap.Canvas, ARect) + else + FillRectByColor(ABitmap.Canvas.Handle, Rect(0, 0, ABitmap.Width, ABitmap.Height), + GetFreeSpaceColor); +end; + +procedure TcxPCTabsPainter.RepaintTab(TabVisibleIndex: Integer; + TabPropertyChanged: TcxPCTabPropertyChanged); +begin + if (TabPropertyChanged = tpcIsMainTab) and + (not ParentInfo.VisibleTabs[TabVisibleIndex].IsMainTab) then + InvalidateTabExtendedTabsRect(TabVisibleIndex) + else + begin + if IsVerticalText(ParentControl) then + ParentInfo.VisibleTabs[TabVisibleIndex].ResetVerticalTextBitmap; + InvalidateTabRect(TabVisibleIndex); + end; +end; + +function TcxPCTabsPainter.GetMinFrameRectSize: Integer; +begin + if ParentInfo.IsTabsContainer then + Result := TabsContainerBaseWidth + GetFrameWidth + else + Result := inherited GetMinFrameRectSize; +end; + +procedure TcxPCTabsPainter.GetTabCornersColor(ATabVisibleIndex: Integer; + out AColor1, AColor2: TColor); +var + ALineIndexBoundsA: TcxPCLineIndexBoundsArray; + ATab: TcxTab; +begin + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + if (ATab.VisibleRow = 0) and (ParentInfo.TopOrLeftPartRowCount > 0) or + (ATab.VisibleRow = ParentInfo.RowCount - 1) and (ParentInfo.TopOrLeftPartRowCount <> ParentInfo.RowCount) then + begin + AColor1 := ParentInfo.Color; + AColor2 := AColor1; + end + else + begin + AColor1 := clBtnFace; + AColor2 := AColor1; + if ATab.IsMainTab and not ParentInfo.Rotate then + begin + InitializeLineBoundsArray(ParentControl, ALineIndexBoundsA); + if ALineIndexBoundsA[ATab.VisibleRow].Left = ATabVisibleIndex then + AColor1 := ParentInfo.Color; + if ALineIndexBoundsA[ATab.VisibleRow].Right = ATabVisibleIndex then + AColor2 := ParentInfo.Color; + end; + end; +end; + +procedure TcxPCTabsPainter.PaintTabCorners(ATabVisibleIndex: Integer); +var + AColor1, AColor2: TColor; + ATab: TcxTab; +begin + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + + GetTabCornersColor(ATabVisibleIndex, AColor1, AColor2); + if (ATab.PaintingPosition in [tpLeft, tpRight]) and + (GetTextRotationAngle(ParentControl) <> raMinus90) then + ExchangeValues(AColor1, AColor2); + + with ATab.FullRect do + case ATab.PaintingPosition of + tpTop: + begin + InternalPolyLine([Point(Left, Top + 1), Point(Left, Top), Point(Left + 1, Top)], AColor1); + InternalPolyLine([Point(Right - 2, Top), Point(Right - 1, Top), Point(Right - 1, Top + 1)], AColor2); + end; + tpBottom: + begin + InternalPolyLine([Point(Left, Bottom - 2), Point(Left, Bottom - 1), Point(Left + 1, Bottom - 1)], AColor1); + InternalPolyLine([Point(Right - 2, Bottom - 1), Point(Right - 1, Bottom - 1), Point(Right - 1, Bottom - 2)], AColor2); + end; + tpLeft: + begin + InternalPolyLine([Point(Left, Top + 1), Point(Left, Top), Point(Left + 1, Top)], AColor1); + InternalPolyLine([Point(Left, Bottom - 2), Point(Left, Bottom - 1), Point(Left + 1, Bottom - 1)], AColor2); + end; + tpRight: + begin + InternalPolyLine([Point(Right - 2, Top), Point(Right - 1, Top), Point(Right - 1, Top + 1)], AColor1); + InternalPolyLine([Point(Right - 2, Bottom - 1), Point(Right - 1, Bottom - 1), Point(Right - 1, Bottom - 2)], AColor2); + end; + end; +end; + +procedure TcxPCTabsPainter.PaintTabFrame(ATabVisibleIndex: Integer); +var + ATabUnderlineColor: TColor; + ATab: TcxTab; +begin + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + if ParentInfo.IsTabsContainer then + ATabUnderlineColor := clBtnFace + else + ATabUnderlineColor := GetTabBodyColor(ATabVisibleIndex); + with ATab.FullRect do + case ATab.PaintingPosition of + tpTop: + begin + InternalPolyLine([Point(Left, Bottom - 1), Point(Left, Top + 2), Point(Left + 2, Top), Point(Right - 3, Top)], cxPCLightestEdgeColor); + InternalPolyLine([Point(Left + 1, Bottom - 1), Point(Left + 1, Top + 2), Point(Left + 2, Top + 1), Point(Right - 3, Top + 1)], cxPCLightEdgeColor); + InternalPolyLine([Point(Right - 1, Bottom - 1), Point(Right - 1, Top + 2), Point(Right - 2, Top + 1)], cxPCDarkestEdgeColor); + InternalPolyLine([Point(Right - 2, Bottom - 1), Point(Right - 2, Top + 2)], cxPCDarkEdgeColor); + + if ATab.IsMainTab then + begin + if Left = 0 then + begin + InternalPolyLine([Point(Left, Bottom), Point(Left, Bottom)], cxPCLightestEdgeColor); + InternalPolyLine([Point(Left + 1, Bottom), Point(Left + 1, Bottom)], cxPCLightEdgeColor); + end + else + InternalPolyLine([Point(Left, Bottom), Point(Left + 1, Bottom)], cxPCLightEdgeColor); + if Right = ParentInfo.Width then + begin + InternalPolyLine([Point(Left + 2, Bottom), Point(Right - 3, Bottom)], ATabUnderlineColor); + InternalPolyLine([Point(Right - 2, Bottom), Point(Right - 2, Bottom)], cxPCDarkEdgeColor); + InternalPolyLine([Point(Right - 1, Bottom), Point(Right - 1, Bottom)], cxPCDarkestEdgeColor); + end + else + InternalPolyLine([Point(Left + 2, Bottom), Point(Right - 1, Bottom)], ATabUnderlineColor); + end; + end; + tpBottom: + begin + InternalPolyLine([Point(Left, Top), Point(Left, Bottom - 3), Point(Left + 1, Bottom - 2)], cxPCLightestEdgeColor); + InternalPolyLine([Point(Left + 1, Top), Point(Left + 1, Bottom - 3)], cxPCLightEdgeColor); + InternalPolyLine([Point(Left + 2, Bottom - 1), Point(Right - 3, Bottom - 1), Point(Right - 1, Bottom - 3), Point(Right - 1, Top)], cxPCDarkestEdgeColor); + InternalPolyLine([Point(Left + 2, Bottom - 2), Point(Right - 3, Bottom - 2), Point(Right - 2, Bottom - 3), Point(Right - 2, Top)], cxPCDarkEdgeColor); + + if ATab.IsMainTab then + begin + if Left = 0 then + begin + InternalPolyLine([Point(Left, Top - 1), Point(Left, Top - 1)], cxPCLightestEdgeColor); + InternalPolyLine([Point(Left + 1, Top - 1), Point(Left + 1, Top - 1)], cxPCLightEdgeColor); + InternalPolyLine([Point(Left + 2, Top - 1), Point(Right - 3, Top - 1)], ATabUnderlineColor); + end + else + InternalPolyLine([Point(Left, Top - 1), Point(Right - 3, Top - 1)], ATabUnderlineColor); + if Right = ParentInfo.Width then + begin + InternalPolyLine([Point(Right - 2, Top - 1), Point(Right - 2, Top - 1)], cxPCDarkEdgeColor); + InternalPolyLine([Point(Right - 1, Top - 1), Point(Right - 1, Top - 1)], cxPCDarkestEdgeColor); + end + else + InternalPolyLine([Point(Right - 2, Top - 1), Point(Right - 1, Top - 1)], cxPCDarkEdgeColor); + end; + end; + tpLeft: + begin + InternalPolyLine([Point(Left, Bottom - 3), Point(Left, Top + 2), Point(Left + 2, Top), Point(Right - 1, Top)], cxPCLightestEdgeColor); + InternalPolyLine([Point(Left + 1, Bottom - 3), Point(Left + 1, Top + 2), Point(Left + 2, Top + 1), Point(Right - 1, Top + 1)], cxPCLightEdgeColor); + InternalPolyLine([Point(Left + 2, Bottom - 2), Point(Left + 3, Bottom - 1), Point(Right - 1, Bottom - 1)], cxPCDarkestEdgeColor); + InternalPolyLine([Point(Left + 1, Bottom - 2), Point(Left + 2, Bottom - 1), Point(Left + 3, Bottom - 2), Point(Right - 1, Bottom - 2)], cxPCDarkEdgeColor); + + if ATab.IsMainTab then + begin + if Top = 0 then + begin + InternalPolyLine([Point(Right, Top), Point(Right, Top)], cxPCLightestEdgeColor); + InternalPolyLine([Point(Right, Top + 1), Point(Right, Top + 1)], cxPCLightEdgeColor); + end + else + InternalPolyLine([Point(Right, Top), Point(Right, Top + 1)], cxPCLightEdgeColor); + if Bottom = ParentInfo.Height then + begin + InternalPolyLine([Point(Right, Top + 2), Point(Right, Bottom - 3)], ATabUnderlineColor); + InternalPolyLine([Point(Right, Bottom - 2), Point(Right, Bottom - 2)], cxPCDarkEdgeColor); + InternalPolyLine([Point(Right, Bottom - 1), Point(Right, Bottom - 1)], cxPCDarkestEdgeColor); + end + else + InternalPolyLine([Point(Right, Top + 2), Point(Right, Bottom - 1)], ATabUnderlineColor); + end; + end; + tpRight: + begin + InternalPolyLine([Point(Left, Top), Point(Right - 3, Top), Point(Right - 2, Top + 1)], cxPCLightestEdgeColor); + InternalPolyLine([Point(Left, Top + 1), Point(Right - 3, Top + 1)], cxPCLightEdgeColor); + InternalPolyLine([Point(Left, Bottom - 1), Point(Right - 3, Bottom - 1), Point(Right - 1, Bottom - 3), Point(Right - 1, Top + 2)], cxPCDarkestEdgeColor); + InternalPolyLine([Point(Left, Bottom - 2), Point(Right - 3, Bottom - 2), Point(Right - 2, Bottom - 3), Point(Right - 2, Top + 2)], cxPCDarkEdgeColor); + + if ATab.IsMainTab then + begin + if Top = 0 then + begin + InternalPolyLine([Point(Left - 1, Top), Point(Left - 1, Top)], cxPCLightestEdgeColor); + InternalPolyLine([Point(Left - 1, Top + 1), Point(Left - 1, Top + 1)], cxPCLightEdgeColor); + InternalPolyLine([Point(Left - 1, Top + 2), Point(Left - 1, Bottom - 3)], ATabUnderlineColor); + end + else + InternalPolyLine([Point(Left - 1, Top), Point(Left - 1, Bottom - 3)], ATabUnderlineColor); + if Bottom = ParentInfo.Height then + begin + InternalPolyLine([Point(Left - 1, Bottom - 2), Point(Left - 1, Bottom - 2)], cxPCDarkEdgeColor); + InternalPolyLine([Point(Left - 1, Bottom - 1), Point(Left - 1, Bottom - 1)], cxPCDarkestEdgeColor); + end + else + InternalPolyLine([Point(Left - 1, Bottom - 2), Point(Left - 1, Bottom - 1)], cxPCDarkEdgeColor); + end; + end; + end; + PaintTabCorners(ATabVisibleIndex); +end; + +procedure TcxPCTabsPainter.InternalPaintFrame(ACanvas: TCanvas); +var + ARect, R: TRect; + ATheme: TdxTheme; +begin + ARect := GetDisplayRect; + if IsRectEmpty(ARect) then + Exit; + ATheme := OpenTheme(totTab); + R := GetNativeContentOffset; + if ARect.Right - ARect.Left < R.Left + R.Right then + ARect.Right := ARect.Left + R.Left + R.Right; + if ARect.Bottom - ARect.Top < R.Top + R.Bottom then + ARect.Bottom := ARect.Top + R.Top + R.Bottom; + with ACanvas do + begin + if (ACanvas.Handle = ParentInfo.Canvas.Handle) and + IsThemeBackgroundPartiallyTransparent(ATheme, TABP_PANE, 0) and ParentControl.ParentBackground then + cxDrawThemeParentBackground(ParentControl, ACanvas, ARect) + else + begin + Brush.Color := ParentInfo.Color; + FillRect(ARect); + end; + DrawThemeBackground(ATheme, Handle, TABP_PANE, 0, ARect); + if ACanvas.Handle = ParentInfo.Canvas.Handle then + with ARect do + Windows.ExcludeClipRect(Handle, Left, Top, Right, Bottom); + end; +end; + +{ TcxPCFlatButtonsPainter } + +class function TcxPCFlatButtonsPainter.GetStandardStyle: TcxPCStandardStyle; +begin + Result := tsFlatButtons; +end; + +class function TcxPCFlatButtonsPainter.GetStyleID: TcxPCStyleID; +begin + Result := cxPCFlatButtonsStyle; +end; + +class function TcxPCFlatButtonsPainter.GetStyleName: TCaption; +begin + Result := 'FlatButtons'; +end; + +class function TcxPCFlatButtonsPainter.HasLookAndFeel(ALookAndFeel: TcxLookAndFeel): Boolean; +begin + Result := False; +end; + +procedure TcxPCFlatButtonsPainter.PaintTab(TabVisibleIndex: Integer); +var + Tab: TcxTab; + + procedure InternalPaintTabsDelimiter; + + function IsDelimiterNeeded: Boolean; + var + FirstIndex, LastIndex, I: Integer; + NextRow: Integer; + IsY: Boolean; + c: Integer; // coordinate + begin + Result := False; + InitializeVisibleTabRange(ParentControl, FirstIndex, LastIndex); + + with ParentInfo do + if Rotate then + begin + if (RowCount = 1) or (Tab.VisibleRow = RowCount - 1) then Exit; + NextRow := Tab.VisibleRow + 1; + IsY := TabPosition in [tpLeft, tpRight]; + c := PointGetter(Tab.FullRect.TopLeft, IsY); + for I := FirstIndex to LastIndex do + with VisibleTabs[I] do + if (VisibleRow = NextRow) and (PointGetter(FullRect.TopLeft, IsY) = c) then + begin + Result := True; + Break; + end; + end else + if (TabVisibleIndex < LastIndex) and + (VisibleTabs[TabVisibleIndex + 1].VisibleRow = Tab.VisibleRow) then + Result := True; + end; + + const + DelimiterWidth = 2; + var + R: TRect; + TabsDistance: Integer; + DelimiterLeftBorder, DelimiterTopBorder: Integer; + DelimiterRect: TRect; + begin + if not IsDelimiterNeeded then Exit; + R := Tab.FullRect; + TabsDistance := StandardPainterTabsNormalDistanceA[GetStandardStyle].dw; + + with R do + if IsVerticalText(ParentControl) then + begin + if IsBottomToTopAlignment(ParentControl) then + begin + Bottom := Top; + Top := Bottom - TabsDistance; + end else + begin + Top := Bottom; + Bottom := Top + TabsDistance; + end; + if not InternalSetClipRect(R) then Exit; + DelimiterTopBorder := Top + (TabsDistance - DelimiterWidth) div 2; + InternalPolyLine([Point(Left + 1, DelimiterTopBorder), Point(Right - 2, DelimiterTopBorder)], cxPCDarkEdgeColor); + InternalPolyLine([Point(Left + 1, DelimiterTopBorder + 1), Point(Right - 2, DelimiterTopBorder + 1)], cxPCLightestEdgeColor); + DelimiterRect := Rect(Left + 1, DelimiterTopBorder, Right - 1, DelimiterTopBorder + 2); + end else + begin + if IsRightToLeftAlignment(ParentControl) then + begin + Right := Left; + Left := Right - TabsDistance; + end else + begin + Left := Right; + Right := Left + TabsDistance; + end; + if not InternalSetClipRect(R) then Exit; + DelimiterLeftBorder := Left + (TabsDistance - DelimiterWidth) div 2; + InternalPolyLine([Point(DelimiterLeftBorder, Top + 1), Point(DelimiterLeftBorder, Bottom - 2)], cxPCDarkEdgeColor); + InternalPolyLine([Point(DelimiterLeftBorder + 1, Top + 1), Point(DelimiterLeftBorder + 1, Bottom - 2)], cxPCLightestEdgeColor); + DelimiterRect := Rect(DelimiterLeftBorder, Top + 1, DelimiterLeftBorder + 2, Bottom - 1); + end; + with ParentInfo.Canvas do + begin + SaveClipRgn; + ExcludeClipRect(DelimiterRect); + Brush.Style := bsSolid; + Brush.Color := ParentInfo.Color; + FillRect(R); + RestoreClipRgn; + end; + + InternalResetClipRegion; + ParentInfo.Canvas.ExcludeClipRect(R); + end; + +begin + inherited PaintTab(TabVisibleIndex); + Tab := ParentInfo.VisibleTabs[TabVisibleIndex]; + InternalPaintTabsDelimiter; +end; + +procedure TcxPCFlatButtonsPainter.PaintTabShape(TabVisibleIndex: Integer); +var + FullRect: TRect; + Tab: TcxTab; + TabBodyColor: TColor; +begin + Tab := ParentInfo.VisibleTabs[TabVisibleIndex]; + TabBodyColor := GetTabBodyColor(TabVisibleIndex); + FullRect := Tab.FullRect; + with ParentInfo.Canvas, FullRect do + begin + if (not Tab.Tracking) and (Tab.Pressed or Tab.Selected or Tab.IsMainTab) then + begin + InternalDrawEdge(FullRect, True); + InflateRect(FullRect, -StandardPainterTabBorderWidth, -StandardPainterTabBorderWidth); + end + else if Tab.HotTrack or Tab.Tracking then + begin + InternalPolyLine([Point(Left, Bottom - 2), Point(Left, Top), Point(Right - 2, Top)], cxPCLightestEdgeColor); + InternalPolyLine([Point(Left, Bottom - 1), Point(Right - 1, Bottom - 1), Point(Right - 1, Top)], cxPCDarkEdgeColor); + InflateRect(FullRect, -1, -1); + end; + + Brush.Color := TabBodyColor; + FillRect(FullRect); + + InflateRect(FullRect, 1, 1); + InternalDrawFocusRect(TabVisibleIndex, FullRect); + end; +end; + +{ TcxPCStandardPainter } + +procedure TcxPCStandardPainter.CalculateButtonContentParameters( + AButton: TcxPCNavigatorButton; out AParameters: TcxPCNavigatorButtonContentParameters); +var + AButtonState: TcxPCNavigatorButtonState; +begin + AButtonState := ParentInfo.NavigatorButtonsState[AButton]; + AParameters.BrushColor := GetButtonContentColor(AButtonState); + AParameters.Color := AParameters.BrushColor; + AParameters.Enabled := ParentControl.Enabled and (AButtonState <> nbsDisabled); + AParameters.LiteStyle := False; +end; + +procedure TcxPCStandardPainter.CalculateButtonsRect(NavigatorButtons: TcxPCNavigatorButtons); +var + AButtonHeight, AButtonsWidth: Integer; +begin + AButtonHeight := GetButtonHeight; + AButtonsWidth := GetButtonsWidth(NavigatorButtons); + with FButtonsRect do + if ParentInfo.TabPosition in [tpTop, tpBottom] then + begin + if ParentInfo.NavigatorPosition in [npLeftTop, npLeftBottom] then + Left := GetButtonsRegionWOffset + else + Left := ParentInfo.Width - AButtonsWidth - GetButtonsRegionWOffset; + if ParentInfo.TabPosition = tpTop then + Top := GetButtonsRegionHOffset + else + Top := ParentInfo.Height - AButtonHeight - GetButtonsRegionHOffset; + Right := Left + AButtonsWidth; + Bottom := Top + AButtonHeight; + end + else + begin + if ParentInfo.TabPosition = tpLeft then + Left := GetButtonsRegionHOffset + else + Left := ParentInfo.Width - AButtonHeight - GetButtonsRegionHOffset; + if ParentInfo.NavigatorPosition in [npLeftTop, npRightTop] then + Top := GetButtonsRegionWOffset + else + Top := ParentInfo.Height - AButtonsWidth - GetButtonsRegionWOffset; + Right := Left + AButtonHeight; + Bottom := Top + AButtonsWidth; + end; +end; + +procedure TcxPCStandardPainter.CalculateButtonsRegion( + NavigatorButtons: TcxPCNavigatorButtons); +var + ButtonLeftTopCorner: TPoint; + IsY: Boolean; + ButtonIndex: Integer; + Button: TcxPCNavigatorButton; +begin + if NavigatorButtons = [] then + begin + SetLength(FButtonsQueue, 0); + Exit; + end; + CalculateButtonsRect(NavigatorButtons); + GetButtonsOrder(NavigatorButtons, FButtonsQueue); + ButtonLeftTopCorner := FButtonsRect.TopLeft; + IsY := ParentInfo.TabPosition in [tpLeft, tpRight]; + for ButtonIndex := 0 to High(FButtonsQueue) do + begin + Button := FButtonsQueue[ButtonIndex].Button; + with ButtonLeftTopCorner, FButtonsQueue[ButtonIndex].ButtonRect do + begin + TopLeft := ButtonLeftTopCorner; + if IsY then + begin + Bottom := Top + GetButtonWidth(Button); + Right := Left + GetButtonHeight; + if ButtonIndex < High(FButtonsQueue) then + Y := Bottom + GetButtonsDistance(Button, FButtonsQueue[ButtonIndex + 1].Button); + end else + begin + Right := Left + GetButtonWidth(Button); + Bottom := Top + GetButtonHeight; + if ButtonIndex < High(FButtonsQueue) then + X := Right + GetButtonsDistance(Button, FButtonsQueue[ButtonIndex + 1].Button); + end; + end; + end; +end; + +function TcxPCStandardPainter.CalculateButtonsRegionWidth( + NavigatorButtons: TcxPCNavigatorButtons): Integer; +begin + Result := GetButtonsWidth(NavigatorButtons); + if Result > 0 then + begin + Inc(Result, GetButtonsRegionWOffset); + Inc(Result, GetButtonsRegionFromTabsOffset); + end; +end; + +procedure TcxPCStandardPainter.CorrectTabHeightForImage(var AHeight: Integer); +var + ATabImageHeight: Integer; +begin + ATabImageHeight := GetTabBaseImageSize.cy; + if ParentInfo.Rotate and (ATabImageHeight > 0) and Odd(AHeight - ATabImageHeight) then + Inc(AHeight); +end; + +function TcxPCStandardPainter.CalculateTabNormalWidth(Tab: TcxTab): Integer; +begin + with ParentInfo do + if TabWidth > 0 then + Result := TabWidth + else + begin + Result := GetTabNormalWidth(Tab.VisibleIndex); + if Tab.Caption <> '' then + Inc(Result, TextSize(Tab, Tab.Caption).cx); + if Result < GetMinTabNormalWidth(Tab.VisibleIndex) then + Result := GetMinTabNormalWidth(Tab.VisibleIndex); + end; +end; + +constructor TcxPCStandardPainter.Create(AParent: TcxCustomTabControl); +begin + inherited Create(AParent); + FButtonsQueue := nil; +end; + +destructor TcxPCStandardPainter.Destroy; +begin + FButtonsQueue := nil; + inherited Destroy; +end; + +function TcxPCStandardPainter.CalculateTabNormalHeight: Integer; +var + DefaultTabNormalHeight: Integer; +begin + with ParentInfo do + begin + Result := InternalCalculateTabNormalHeight; + + DefaultTabNormalHeight := GetDefaultTabNormalHeight; + if Result < DefaultTabNormalHeight then + Result := DefaultTabNormalHeight; + + CorrectTabHeightForImage(Result); + + if TabHeight > Result then + Result := TabHeight; + end; +end; + +function TcxPCStandardPainter.GetGoDialogButtonBounds: TRect; +var + AButtonIndex: Integer; +begin + Result := cxEmptyRect; + for AButtonIndex := 0 to High(FButtonsQueue) do + with FButtonsQueue[AButtonIndex] do + if Button = nbGoDialog then + begin + Result := ButtonRect; + Break; + end; +end; + +function TcxPCStandardPainter.GetDefaultTabNormalHeight: Integer; +begin + Result := StandardPainterDefaultTabNormalHeightA[GetStandardStyle]; +end; + +function TcxPCStandardPainter.GetDefaultTabNormalHTextOffset: Integer; +begin + Result := StandardPainterDefaultTabNormalHTextOffsetA[GetStandardStyle]; +end; + +function TcxPCStandardPainter.GetDefaultTabNormalWidth: Integer; +begin + Result := 42; +end; + +function TcxPCStandardPainter.GetFrameRect: TRect; +var + AMinFrameRectSize: Integer; +begin + AMinFrameRectSize := GetMinFrameRectSize; + Result := GetDisplayRect; + if Result.Right - Result.Left < AMinFrameRectSize then + Result.Right := Result.Left + AMinFrameRectSize; + if Result.Bottom - Result.Top < AMinFrameRectSize then + Result.Bottom := Result.Top + AMinFrameRectSize; +end; + +function TcxPCStandardPainter.GetFreeSpaceColor: TColor; +begin + Result := ParentInfo.Color; +end; + +function TcxPCStandardPainter.GetMinFrameRectSize: Integer; +begin + Result := GetFrameWidth * 2; +end; + +function TcxPCStandardPainter.GetTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; +begin + Result := StandardPainterTabContentWOffsetA[IsTabBorderThick(ATabVisibleIndex), + GetStandardStyle]; +end; + +function TcxPCStandardPainter.GetDrawImageOffset(TabVisibleIndex: Integer): TRect; +begin + Result := StandardPainterDrawImageOffsetA[IsTabBorderThick(TabVisibleIndex), + GetStandardStyle]; +end; + +function TcxPCStandardPainter.GetDrawImageWithoutTextWOffset( + TabVisibleIndex: Integer): TcxPCWOffset; +begin + Result := cxPCEmptyWOffset; +end; + +function TcxPCStandardPainter.GetDrawTextHOffset(TabVisibleIndex: Integer): TRect; +begin + Result := StandardPainterDrawTextHOffsetA[IsTabBorderThick(TabVisibleIndex), + GetStandardStyle]; +end; + +function TcxPCStandardPainter.GetFrameWidth: Integer; +begin + Result := StandardPainterTabControlFrameBorderWidth; +end; + +function TcxPCStandardPainter.GetGoDialogPosition(GoDialogSize: TSize): TPoint; +const + GoDialogPositionA: array[TcxTabPosition, TcxPCNavigatorPosition] of TcxPCNavigatorPosition = ( + (npLeftTop, npLeftTop, npRightTop, npRightTop), + (npLeftBottom, npLeftBottom, npRightBottom, npRightBottom), + (npLeftTop, npLeftBottom, npLeftTop, npLeftBottom), + (npRightTop, npRightBottom, npRightTop, npRightBottom) + ); +var + ButtonIndex: Integer; + GoDialogPosition: TcxPCNavigatorPosition; +begin + for ButtonIndex := 0 to High(FButtonsQueue) do + with ParentInfo, FButtonsQueue[ButtonIndex] do + if Button = nbGoDialog then + begin + GoDialogPosition := GoDialogPositionA[TabPosition, NavigatorPosition]; + if GoDialogPosition in [npLeftTop, npLeftBottom] then + Result.X := ButtonRect.Left + else + Result.X := ButtonRect.Right - GoDialogSize.cx; + if GoDialogPosition in [npLeftTop, npRightTop] then + Result.Y := ButtonRect.Bottom + else + Result.Y := ButtonRect.Top - GoDialogSize.cy; + Exit; + end; +end; + +function TcxPCStandardPainter.GetImageTextDistance(ATabVisibleIndex: Integer): Integer; +//var +// ACorrection: Integer; +// ATabContentWOffset: TcxPCWOffset; +begin + Result := 6; +// if ParentInfo.Rotate and (ParentInfo.VisibleTabs[ATabVisibleIndex].Caption <> '') then +// begin +// ATabContentWOffset := ButtonsPainterTabContentWOffsetA[GetTabBaseImageSize.cx > 0]; +// ACorrection := 12 - ATabContentWOffset.Left - ATabContentWOffset.Right; +// Inc(Result, ACorrection - ACorrection div 2); +// end; +end; + +function TcxPCStandardPainter.GetMinTabNormalWidth(ATabVisibleIndex: Integer): Integer; +begin + Result := GetTabNormalWidth(ATabVisibleIndex); + if Result < GetDefaultTabNormalWidth then + Result := GetDefaultTabNormalWidth; +end; + +function TcxPCStandardPainter.GetMinTabSelectionDistance: TcxPCDistance; +begin + Result := MinTabSelectionDistance; +end; + +function TcxPCStandardPainter.GetTabsNormalDistance: TcxPCDistance; +begin + Result := StandardPainterTabsNormalDistanceA[GetStandardStyle]; +end; + +function TcxPCStandardPainter.GetTabBorderWidth(Tab: TcxTab): Integer; +begin + Result := StandardPainterMaxTabBorderWidth; +end; + +function TcxPCStandardPainter.GetTabNormalWidth(ATabVisibleIndex: Integer): Integer; +begin + if IsAssignedImages and ((ATabVisibleIndex = -1) or IsTabHasImage(ATabVisibleIndex) or ParentInfo.Rotate) then + Result := GetTabBaseImageSize.cx + 2 * ParentInfo.ImageBorder + 6 + else + Result := 0; + Inc(Result, 12); +end; + +function TcxPCStandardPainter.GetTabsRectOffset: TRect; +begin + Result := cxEmptyRect; +end; + +function TcxPCStandardPainter.GetTabsPosition( + NavigatorButtons: TcxPCNavigatorButtons): TcxPCTabsPosition; +var + AButtonsWidth: Integer; + ATabsContainerOffset: TRect; +begin + AButtonsWidth := CalculateButtonsRegionWidth(NavigatorButtons); + ATabsContainerOffset := cxEmptyRect; + if ParentInfo.IsTabsContainer then + ATabsContainerOffset := GetTabsContainerOffsets; + + with ParentInfo, Result do + begin + Result.ExtendedTabsRect := GetControlRect(ParentControl); + ExtendRect(ExtendedTabsRect, GetTabsRectOffset); + + if NavigatorButtons <> [] then + begin + ExtendRect(ExtendedTabsRect, RotateRect(Rect(0, ATabsContainerOffset.Top, 0, 0), ParentInfo.TabPosition)); + ATabsContainerOffset := RotateRect(ATabsContainerOffset, ParentInfo.TabPosition); + if TabPosition in [tpTop, tpBottom] then + begin + if NavigatorPosition in [npLeftTop, npLeftBottom] then + begin + Inc(ExtendedTabsRect.Left, AButtonsWidth); + Dec(ExtendedTabsRect.Right, ATabsContainerOffset.Right); + end + else + begin + Dec(ExtendedTabsRect.Right, AButtonsWidth); + Inc(ExtendedTabsRect.Left, ATabsContainerOffset.Left); + end; + end + else + begin + if NavigatorPosition in [npLeftTop, npRightTop] then + begin + Inc(ExtendedTabsRect.Top, AButtonsWidth); + Dec(ExtendedTabsRect.Bottom, ATabsContainerOffset.Bottom); + end + else + begin + Dec(ExtendedTabsRect.Bottom, AButtonsWidth); + Inc(ExtendedTabsRect.Top, ATabsContainerOffset.Top); + end; + end; + end + else + ExtendRect(ExtendedTabsRect, RotateRect(ATabsContainerOffset, ParentInfo.TabPosition)); + if TabPosition in [tpTop, tpBottom] then + NormalRowWidth := (ExtendedTabsRect.Right - ExtendedTabsRect.Left) + else + NormalRowWidth := (ExtendedTabsRect.Bottom - ExtendedTabsRect.Top); + + NormalTabsRect := ExtendedTabsRect; + + ExtendedTopOrLeftTabsRectBottomOrRightBorderOffset := 0; + ExtendedBottomOrRightTabsRectTopOrLeftBorderOffset := 0; + + MinDistanceBetweenTopOrLeftAndBottomOrRightExtendedTabsRects := + GetTabsNormalDistance.dh; + end; + + CalculateButtonsRegion(NavigatorButtons); +end; + +function TcxPCStandardPainter.GetTooNarrowTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; +begin + Result := StandardPainterTooNarrowTabContentWOffsetA[ + IsTabBorderThick(ATabVisibleIndex), GetStandardStyle]; +end; + +procedure TcxPCStandardPainter.InternalPrepareOutTabImageAndTextData( + ATabVisibleIndex: Integer; var AImageRect, ATextRect: TRect); +begin + FOutTabImageAndTextData.TabImageRect := AImageRect; + FOutTabImageAndTextData.TabTextRect := ATextRect; +end; + +function TcxPCStandardPainter.InternalCalculateTabNormalHeight: Integer; +begin + if IsAssignedImages then + Result := GetTabBaseImageSize.cy + 2 * ParentInfo.ImageBorder + 6 + else + Result := 0; + if Result < GetMaxTabCaptionHeight + 8 then + Result := GetMaxTabCaptionHeight + 8; +end; + +procedure TcxPCStandardPainter.InternalDrawEdge(const Rect: TRect; + Sunken: Boolean; ThinFrame: Boolean = False); +const + ThickFrameLineColorA: array [Boolean, 1 .. 4] of TColor = ( + (cxPCLightEdgeColor, cxPCLightestEdgeColor, cxPCDarkestEdgeColor, cxPCDarkEdgeColor), + (cxPCDarkEdgeColor, cxPCDarkestEdgeColor, cxPCLightestEdgeColor, cxPCLightEdgeColor) + ); + ThinFrameLineColorA: array [Boolean, 1 .. 2] of TColor = ( + (cxPCLightEdgeColor, cxPCDarkestEdgeColor), + (cxPCDarkestEdgeColor, cxPCLightEdgeColor) + ); +begin + with Rect do + if ThinFrame then + begin + InternalPolyLine([Point(Left, Bottom - 2), Point(Left, Top), Point(Right - 2, Top)], ThinFrameLineColorA[Sunken, 1]); + InternalPolyLine([Point(Left, Bottom - 1), Point(Right - 1, Bottom - 1), Point(Right - 1, Top)], ThinFrameLineColorA[Sunken, 2]); + end else + begin + InternalPolyLine([Point(Left, Bottom - 2), Point(Left, Top), Point(Right - 2, Top)], ThickFrameLineColorA[Sunken, 1]); + InternalPolyLine([Point(Left + 1, Bottom - 3), Point(Left + 1, Top + 1), Point(Right - 3, Top + 1)], ThickFrameLineColorA[Sunken, 2]); + InternalPolyLine([Point(Left, Bottom - 1), Point(Right - 1, Bottom - 1), Point(Right - 1, Top)], ThickFrameLineColorA[Sunken, 3]); + InternalPolyLine([Point(Left + 1, Bottom - 2), Point(Right - 2, Bottom - 2), Point(Right - 2, Top + 1)], ThickFrameLineColorA[Sunken, 4]); + end; +end; + +procedure TcxPCStandardPainter.InternalDrawFocusRect(TabVisibleIndex: Integer; R: TRect); +var + ATab: TcxTab; +begin + ATab := ParentInfo.VisibleTabs[TabVisibleIndex]; + if InternalSetClipRect(ATab.VisibleRect, False) then + begin + if ATab.RealEnabled and ATab.IsMainTab and ParentControl.Focused then + with ParentInfo.Canvas do + begin + InflateRect(R, -1, -1); + Pen.Color := ParentInfo.Font.Color; // DrawTabEx + DrawFocusRect(R); + end; + InternalResetClipRegion; + end; +end; + +procedure TcxPCStandardPainter.PaintButton(Button: TcxPCNavigatorButton; + const ButtonRect: TRect); +var + AButtonState: TcxPCNavigatorButtonState; + AContentLeftTopCorner: TPoint; + AContentParameters: TcxPCNavigatorButtonContentParameters; + R: TRect; +begin + AButtonState := ParentInfo.NavigatorButtonsState[Button]; + R := ButtonRect; + PaintButtonFrame(R, AButtonState); + PaintButtonBackground(R, AButtonState); + + CalculateButtonContentParameters(Button, AContentParameters); + AContentLeftTopCorner := GetButtonContentPosition(Button); + with ButtonRect.TopLeft do + begin + Inc(AContentLeftTopCorner.X, X); + Inc(AContentLeftTopCorner.Y, Y); + end; + + DrawButtonContent(Button, AContentParameters, AContentLeftTopCorner); +end; + +procedure TcxPCStandardPainter.PaintButtonBackground(AButtonRect: TRect; + AButtonState: TcxPCNavigatorButtonState); +begin + ParentInfo.Canvas.Brush.Color := GetButtonColor(AButtonState); + ParentInfo.Canvas.FillRect(AButtonRect); +end; + +procedure TcxPCStandardPainter.PaintButtonFrame(var ARect: TRect; + AButtonState: TcxPCNavigatorButtonState); +begin + InternalDrawEdge(ARect, AButtonState = nbsPressed); + InflateRect(ARect, -2, -2); +end; + +procedure TcxPCStandardPainter.PaintFrame; +begin + PaintFrameBorder(GetFrameRect); +end; + +procedure TcxPCStandardPainter.PaintFrameBorder(R: TRect); +begin + ParentInfo.Canvas.DrawComplexFrame(R, cxPCLightestEdgeColor, cxPCDarkestEdgeColor); + InflateRect(R, -1, -1); + ParentInfo.Canvas.DrawComplexFrame(R, cxPCLightEdgeColor, cxPCDarkEdgeColor); +end; + +procedure TcxPCStandardPainter.PrepareTabBackground(ATabVisibleIndex: Integer); +begin +end; + +class function TcxPCStandardPainter.IsMainTabBoundWithClient: boolean; +const + IsMainTabBoundWithClientA: array [TcxPCStandardStyle] of boolean = (True, False, False); +begin + Result := IsMainTabBoundWithClientA[GetStandardStyle]; +end; + +class function TcxPCStandardPainter.IsMultiSelectionAccepted: boolean; +const + IsMultiSelectionAcceptedA: array [TcxPCStandardStyle] of boolean = (False, True, True); +begin + Result := IsMultiSelectionAcceptedA[GetStandardStyle]; +end; + +class function TcxPCStandardPainter.IsStandardStyle: Boolean; +begin + Result := True; +end; + +function TcxPCStandardPainter.IsOverButton(X, Y: Integer; + var Button: TcxPCNavigatorButton): Boolean; +var + ButtonIndex: Integer; +begin + Result := False; + for ButtonIndex := 0 to High(FButtonsQueue) do + begin + Result := PtInRect(FButtonsQueue[ButtonIndex].ButtonRect, Point(X, Y)); + if Result then + begin + Button := FButtonsQueue[ButtonIndex].Button; + Break; + end; + end; +end; + +function TcxPCStandardPainter.IsTabBorderThick(ATabVisibleIndex: Integer): Boolean; +begin + Result := ParentInfo.VisibleTabs[ATabVisibleIndex].IsMainTab; +end; + +class function TcxPCStandardPainter.IsTabPressable: Boolean; +const + IsTabPressableA: array [TcxPCStandardStyle] of boolean = (False, True, + True); +begin + Result := IsTabPressableA[GetStandardStyle]; +end; + +procedure TcxPCStandardPainter.Paint; +var + R: TRect; +begin + inherited Paint; + R := GetControlRect(ParentControl); + if IsNativePainting and ParentControl.ParentBackground then + cxDrawThemeParentBackground(ParentControl, ParentInfo.Canvas, R) + else + with ParentInfo.Canvas do + begin + Brush.Color := GetFreeSpaceColor; + Brush.Style := bsSolid; + FillRect(R); + end; +end; + +procedure TcxPCStandardPainter.PaintButtonsRegion; +var + AButtonIndex: Integer; +begin + if ParentInfo.NavigatorButtons = [] then + Exit; + for AButtonIndex := 0 to High(FButtonsQueue) do + with FButtonsQueue[AButtonIndex] do + if InternalSetClipRect(ButtonRect) then + begin + PaintButton(Button, ButtonRect); + InternalResetClipRegion; + ParentInfo.Canvas.ExcludeClipRect(ButtonRect); + end; +end; + +procedure TcxPCStandardPainter.PaintTabsRegion; +var + I: Integer; + FirstIndex, LastIndex: Integer; +begin + InitializeVisibleTabRange(ParentControl, FirstIndex, LastIndex); + for I := FirstIndex to LastIndex do + PaintTab(I); +end; + +procedure TcxPCStandardPainter.RepaintButton(Button: TcxPCNavigatorButton; + OldButtonState: TcxPCNavigatorButtonState); +var + ButtonIndex: Integer; +begin + for ButtonIndex := 0 to High(FButtonsQueue) do + if FButtonsQueue[ButtonIndex].Button = Button then + InternalInvalidateRect(FButtonsQueue[ButtonIndex].ButtonRect); +end; + +procedure TcxPCStandardPainter.RepaintButtonsRegion; +begin + if ParentInfo.NavigatorButtons = [] then Exit; + InternalInvalidateRect(FButtonsRect); +end; + +procedure TcxPCStandardPainter.RepaintTab(TabVisibleIndex: Integer; + TabPropertyChanged: TcxPCTabPropertyChanged); +begin + if IsVerticalText(ParentControl) then + ParentInfo.VisibleTabs[TabVisibleIndex].ResetVerticalTextBitmap; + InvalidateTabRect(TabVisibleIndex); +end; + +procedure TcxPCStandardPainter.GetButtonsOrder(ANavigatorButtons: TcxPCNavigatorButtons; + var AButtonPositions: TcxPCNavigatorButtonPositions); +type + TcxPCNavigatorButtonA = array of TcxPCNavigatorButton; + + procedure InternalGetButtonsOrder(out AButtonsOrder: TcxPCNavigatorButtonA); + var + AInverseOrder, AIsY: Boolean; + begin + SetLength(AButtonsOrder, Integer(High(TcxPCNavigatorButton)) - + Integer(Low(TcxPCNavigatorButton)) + 1); + AIsY := ParentInfo.TabPosition in [tpLeft, tpRight]; + AInverseOrder := (AIsY and (ParentInfo.NavigatorPosition in [npLeftTop, npRightTop])) or + (not AIsY and (ParentInfo.NavigatorPosition in [npLeftTop, npLeftBottom])); + if not AInverseOrder then + begin + AButtonsOrder[0] := nbGoDialog; + AButtonsOrder[1] := nbTopLeft; + AButtonsOrder[2] := nbBottomRight; + AButtonsOrder[3] := nbClose; + end + else + begin + AButtonsOrder[0] := nbClose; + AButtonsOrder[1] := nbTopLeft; + AButtonsOrder[2] := nbBottomRight; + AButtonsOrder[3] := nbGoDialog; + end; + end; + +var + AButtonPosition, I: Integer; + AButtonsOrder: TcxPCNavigatorButtonA; +begin + SetLength(AButtonPositions, GetButtonCount(ANavigatorButtons)); + InternalGetButtonsOrder(AButtonsOrder); + AButtonPosition := 0; + for I := 0 to High(AButtonsOrder) do + if AButtonsOrder[I] in ANavigatorButtons then + begin + AButtonPositions[AButtonPosition].Button := AButtonsOrder[I]; + Inc(AButtonPosition); + end; +end; + +function TcxPCStandardPainter.GetButtonHeight: Integer; +begin + Result := StandardPainterButtonHeight; +end; + +function TcxPCStandardPainter.GetButtonWidth( + Button: TcxPCNavigatorButton): Integer; +var + IsY: Boolean; +begin + IsY := ParentInfo.TabPosition in [tpLeft, tpRight]; + Result := StandardPainterButtonWidthA[IsY, Button]; +end; + +procedure TcxPCStandardPainter.DrawButtonContent(AButton: TcxPCNavigatorButton; + const AParameters: TcxPCNavigatorButtonContentParameters; + AContentRectLeftTopCorner: TPoint); +type + TArrowPointA = array [0 .. 2] of TPoint; + + procedure InternalDrawArrow(Points: TArrowPointA; LeftTopCorner: TPoint); + var + I: Integer; + begin + for I := 0 to 2 do + with Points[I] do + begin + Inc(X, LeftTopCorner.X); + Inc(Y, LeftTopCorner.Y); + end; + ParentInfo.Canvas.Polygon(Points); + end; + + procedure DrawArrow(const ALeftTopCorner: TPoint); + const + PolygonPointsMultipliersA: array[TcxPCArrow] of TArrowPointA = ( + ((X: 0; Y: 1), (X: 1; Y: 0), (X: 2; Y: 1)), + ((X: 0; Y: 0), (X: 2; Y: 0), (X: 1; Y: 1)), + ((X: 0; Y: 1), (X: 1; Y: 0), (X: 1; Y: 2)), + ((X: 0; Y: 0), (X: 1; Y: 1), (X: 0; Y: 2)) + ); + var + PolygonPoints: TArrowPointA; + ArrowUnit: Integer; + I: Integer; + begin + ArrowUnit := cxPCArrowSizeA[AButton] - 1; + PolygonPoints := PolygonPointsMultipliersA[GetButtonArrow(AButton)]; + for I := 0 to 2 do + with PolygonPoints[I] do + begin + X := X * ArrowUnit; + Y := Y * ArrowUnit; + end; + InternalDrawArrow(PolygonPoints, ALeftTopCorner); + end; + + procedure DrawCross(const ALeftTopCorner: TPoint); + begin + with ALeftTopCorner do + if AParameters.LiteStyle then + if ParentInfo.TabPosition in [tpTop, tpBottom] then + begin + InternalPolyLine([Point(X + 1, Y), Point(X + CloseButtonCrossSize - 2, Y + CloseButtonCrossSize - 3)], ParentInfo.Canvas.Pen.Color); + InternalPolyLine([Point(X, Y), Point(X + CloseButtonCrossSize - 3, Y + CloseButtonCrossSize - 3)], ParentInfo.Canvas.Pen.Color); + + InternalPolyLine([Point(X, Y + CloseButtonCrossSize - 3), Point(X + CloseButtonCrossSize - 3, Y)], ParentInfo.Canvas.Pen.Color); + InternalPolyLine([Point(X + 1, Y + CloseButtonCrossSize - 3), Point(X + CloseButtonCrossSize - 2, Y)], ParentInfo.Canvas.Pen.Color); + end + else + begin + InternalPolyLine([Point(X, Y), Point(X + CloseButtonCrossSize - 3, Y + CloseButtonCrossSize - 3)], ParentInfo.Canvas.Pen.Color); + InternalPolyLine([Point(X, Y + 1), Point(X + CloseButtonCrossSize - 3, Y + CloseButtonCrossSize - 2)], ParentInfo.Canvas.Pen.Color); + + InternalPolyLine([Point(X, Y + CloseButtonCrossSize - 3), Point(X + CloseButtonCrossSize - 3, Y)], ParentInfo.Canvas.Pen.Color); + InternalPolyLine([Point(X, Y + CloseButtonCrossSize - 2), Point(X + CloseButtonCrossSize - 3, Y + 1)], ParentInfo.Canvas.Pen.Color); + end + else + begin + InternalPolyLine([Point(X + 1, Y), Point(X + CloseButtonCrossSize - 1, Y + CloseButtonCrossSize - 2)], ParentInfo.Canvas.Pen.Color); + InternalPolyLine([Point(X, Y), Point(X + CloseButtonCrossSize - 1, Y + CloseButtonCrossSize - 1)], ParentInfo.Canvas.Pen.Color); + InternalPolyLine([Point(X, Y + 1), Point(X + CloseButtonCrossSize - 2, Y + CloseButtonCrossSize - 1)], ParentInfo.Canvas.Pen.Color); + + InternalPolyLine([Point(X, Y + CloseButtonCrossSize - 2), Point(X + CloseButtonCrossSize - 2, Y)], ParentInfo.Canvas.Pen.Color); + InternalPolyLine([Point(X, Y + CloseButtonCrossSize - 1), Point(X + CloseButtonCrossSize - 1, Y)], ParentInfo.Canvas.Pen.Color); + InternalPolyLine([Point(X + 1, Y + CloseButtonCrossSize - 1), Point(X + CloseButtonCrossSize - 1, Y + 1)], ParentInfo.Canvas.Pen.Color); + end; + end; + + procedure InternalDrawContent(const ALeftTopCorner: TPoint); + begin + if AButton = nbClose then + DrawCross(ALeftTopCorner) + else + DrawArrow(ALeftTopCorner); + end; + +begin + with ParentInfo.Canvas do + begin + if not AParameters.Enabled then + begin + Brush.Color := DisabledTextFaceColor; + Pen.Color := DisabledTextFaceColor; + with AContentRectLeftTopCorner do + InternalDrawContent(Point(X + 1, Y + 1)); + Brush.Color := DisabledTextShadowColor; + Pen.Color := DisabledTextShadowColor; + end else + begin + Brush.Color := AParameters.BrushColor; + Pen.Color := AParameters.Color; + end; + InternalDrawContent(AContentRectLeftTopCorner); + end; + ParentInfo.Canvas.Brush.Style := bsSolid; +end; + +function TcxPCStandardPainter.Get3DButtonContentPosition( + AButton: TcxPCNavigatorButton): TPoint; +const + AArrowButtonArrowRectLeftTopCorners: array [TcxPCArrow] of TPoint = ( + (X: 5; Y: 7), (X: 5; Y: 7), (X: 6; Y: 5), (X: 8; Y: 5) + ); + ACloseButtonCrossRectLeftTopCorner: TPoint = (X: 5; Y: 5); + AGoDialogArrowRectLeftTopCorners: array [Boolean] of TPoint = ( + (X: 2; Y: 8), // TabPosition in [tpTop, tpBottom] + (X: 6; Y: 4) + ); +begin + case AButton of + nbGoDialog: + Result := AGoDialogArrowRectLeftTopCorners[ParentInfo.TabPosition in [tpLeft, tpRight]]; + nbClose: + Result := ACloseButtonCrossRectLeftTopCorner; + else + Result := AArrowButtonArrowRectLeftTopCorners[GetButtonArrow(AButton)]; + end; + if ParentInfo.NavigatorButtonsState[AButton] = nbsPressed then + begin + Inc(Result.X); + Inc(Result.Y); + end; +end; + +function TcxPCStandardPainter.GetButtonArrow(AButton: TcxPCNavigatorButton): TcxPCArrow; +var + AIsY: Boolean; +begin + AIsY := ParentInfo.TabPosition in [tpLeft, tpRight]; + if AButton = nbGoDialog then + Result := aBottom + else + Result := cxPCArrowConvertionA[AButton, AIsY]; +end; + +function TcxPCStandardPainter.GetButtonCenteredContentPosition( + AButton: TcxPCNavigatorButton): TPoint; + + procedure RotateSize(var ASize: TSize); + begin + ASize := Size(ASize.cy, ASize.cx); + end; + + function GetContentSize: TSize; + var + AArrowSize: Integer; + begin + if AButton = nbClose then + begin + Result := Size(CloseButtonCrossSize - 1, CloseButtonCrossSize - 2); + if ParentInfo.TabPosition in [tpLeft, tpRight] then + RotateSize(Result); + end + else + begin + AArrowSize := cxPCArrowSizeA[AButton]; + Result := Size(AArrowSize, AArrowSize * 2 - 1); + if (AButton = nbGoDialog) or (AButton in [nbTopLeft, nbBottomRight]) and + (ParentInfo.TabPosition in [tpLeft, tpRight]) then + RotateSize(Result); + end; + end; + +var + AButtonSize, AContentSize: TSize; +begin + AContentSize := GetContentSize; + + AButtonSize := Size(GetButtonWidth(AButton), GetButtonHeight); + if ParentInfo.TabPosition in [tpLeft, tpRight] then + RotateSize(AButtonSize); + + Result.X := (AButtonSize.cx - AContentSize.cx) div 2; + Result.Y := (AButtonSize.cy - AContentSize.cy) div 2; + if AButton = nbGoDialog then + Inc(Result.Y); + if ParentInfo.NavigatorButtonsState[AButton] = nbsPressed then + begin + if AButton <> nbGoDialog then + Inc(Result.X); + Inc(Result.Y); + end; +end; + +function TcxPCStandardPainter.GetButtonColor( + AButtonState: TcxPCNavigatorButtonState): TColor; +begin + Result := cxPCTabBodyColor; +end; + +function TcxPCStandardPainter.GetButtonContentColor( + AButtonState: TcxPCNavigatorButtonState): TColor; +begin + if AButtonState = nbsHotTrack then + Result := GetHotTrackColor + else + Result := clBtnText; +end; + +function TcxPCStandardPainter.GetButtonContentPosition( + AButton: TcxPCNavigatorButton): TPoint; +begin + Result := GetButtonCenteredContentPosition(AButton); +end; + +procedure TcxPCStandardPainter.PaintTab(TabVisibleIndex: Integer); +var + AIsCustomDraw: Boolean; + ARegion: TcxRegion; + ARgnOperation: TcxRegionOperation; +begin + ARegion := GetTabClipRgn(TabVisibleIndex); + ARgnOperation := GetTabClipRgnOperation(TabVisibleIndex); + try + SaveClipRgn; + ParentInfo.Canvas.SetClipRegion(ARegion, ARgnOperation, False); + AIsCustomDraw := IsCustomDraw and DoCustomDraw(TabVisibleIndex); + if not AIsCustomDraw then + begin + if IsNativePainting then + PrepareTabBackground(TabVisibleIndex); + DrawTabImageAndText(TabVisibleIndex); + PaintTabShape(TabVisibleIndex); + end; + RestoreClipRgn; + if not IsTabTransparent(TabVisibleIndex) or AIsCustomDraw then + begin + AfterPaintTab(TabVisibleIndex); + ParentInfo.Canvas.SetClipRegion(ARegion, roSubtract, False); + end + else + ExcludeTabContentClipRegion(TabVisibleIndex); + finally + ARegion.Free; + end; +end; + +function TcxPCStandardPainter.GetButtonsWidth(ANavigatorButtons: TcxPCNavigatorButtons): Integer; +var + AButton: TcxPCNavigatorButton; + AButtonPositions: TcxPCNavigatorButtonPositions; + I: Integer; +begin + GetButtonsOrder(ANavigatorButtons, AButtonPositions); + Result := 0; + for I := 0 to High(AButtonPositions) do + begin + AButton := AButtonPositions[I].Button; + Inc(Result, GetButtonWidth(AButton)); + if I < High(AButtonPositions) then + Inc(Result, GetButtonsDistance(AButton, AButtonPositions[I + 1].Button)); + end; +end; + +{ TcxPCButtonsPainter } + +class function TcxPCButtonsPainter.GetStandardStyle: TcxPCStandardStyle; +begin + Result := tsButtons; +end; + +class function TcxPCButtonsPainter.GetStyleID: TcxPCStyleID; +begin + Result := cxPCButtonsStyle; +end; + +class function TcxPCButtonsPainter.GetStyleName: TCaption; +begin + Result := 'Buttons'; +end; + +class function TcxPCButtonsPainter.HasLookAndFeel( + ALookAndFeel: TcxLookAndFeel): Boolean; +begin + Result := False; +end; + +function TcxPCButtonsPainter.IsTabBorderThick(ATabVisibleIndex: Integer): Boolean; +begin + with ParentInfo.VisibleTabs[ATabVisibleIndex] do + Result := Tracking or Pressed or Selected or IsMainTab; +end; + +procedure TcxPCButtonsPainter.PaintTabShape(TabVisibleIndex: Integer); +const + ATabFrameLineColorA: array [Boolean, 1 .. 4] of TColor = ( + (cxPCLightestEdgeColor, cxPCDarkestEdgeColor, cxPCLightestEdgeColor, cxPCDarkEdgeColor), + (cxPCDarkEdgeColor, cxPCDarkestEdgeColor, cxPCLightestEdgeColor, cxPCLightEdgeColor) + ); +var + R, AFullRect: TRect; + ATab: TcxTab; + ATabBodyColor: TColor; + AIsSunkenTab: Boolean; +begin + ATab := ParentInfo.VisibleTabs[TabVisibleIndex]; + ATabBodyColor := GetTabBodyColor(TabVisibleIndex); + AFullRect := ATab.FullRect; + R := AFullRect; + with ParentInfo.Canvas do + begin + AIsSunkenTab := ATab.Pressed or ATab.Selected or ATab.IsMainTab or ATab.Tracking; + if AIsSunkenTab then + begin + DrawComplexFrame(R, cxPCDarkestEdgeColor, cxPCLightestEdgeColor); + InflateRect(R, -1, -1); + DrawComplexFrame(R, cxPCDarkEdgeColor, cxPCLightEdgeColor); + end else + begin + DrawComplexFrame(R, cxPCLightestEdgeColor, cxPCDarkestEdgeColor); + InflateRect(R, -1, -1); + DrawComplexFrame(R, cxPCLightEdgeColor, cxPCDarkEdgeColor); + end; + InflateRect(R, -1, -1); + + Brush.Color := ATabBodyColor; + FillRect(R); + + InflateRect(R, 1, 1); + InternalDrawFocusRect(TabVisibleIndex, R); + end; +end; + +{ TcxPCButtonedPainter } + +constructor TcxPCButtonedPainter.Create(AParent: TcxCustomTabControl); + + procedure InitializeMainTabBrushBitmap; + const + BrushBitmapSize = 8; + var + X, Y, XStart: Integer; + begin + with MainTabBrushBitmap, MainTabBrushBitmap.Canvas do + begin + Width := BrushBitmapSize; + Height := BrushBitmapSize; + + Brush.Style := bsSolid; + Brush.Color := cxPCLightEdgeColor; + FillRect(Rect(0, 0, BrushBitmapSize, BrushBitmapSize)); + + XStart := 0; + X := XStart; + Y := 0; + repeat + Pixels[X, Y] := cxPCLightestEdgeColor; + Inc(X, 2); + if X >= BrushBitmapSize then + begin + XStart := 1 - XStart; + X := XStart; + Inc(Y); + end; + until Y = BrushBitmapSize; + end; + end; + +begin + inherited Create(AParent); + MainTabBrushBitmap := TBitmap.Create; + InitializeMainTabBrushBitmap; +end; + +destructor TcxPCButtonedPainter.Destroy; +begin + MainTabBrushBitmap.Free; + inherited Destroy; +end; + +function TcxPCButtonedPainter.GetButtonContentPosition( + AButton: TcxPCNavigatorButton): TPoint; +begin + Result := Get3DButtonContentPosition(AButton); +end; + +function TcxPCButtonedPainter.GetButtonsRegionHOffset: Integer; +begin + if ParentInfo.IsTabsContainer then + Result := TabsContainerOffset + else + Result := 0; +end; + +function TcxPCButtonedPainter.GetButtonsRegionWOffset: Integer; +begin + if ParentInfo.IsTabsContainer then + Result := TabsContainerOffset + else + Result := 0; +end; + +function TcxPCButtonedPainter.GetDisplayRectOffset: TRect; +begin + Result := inherited GetDisplayRectOffset; + if not ParentInfo.HideTabs and (ParentInfo.RowCount > 0) then + Inc(Result.Top, ButtonedPainterDistanceBetweenTabsAndClientRects); +end; + +function TcxPCButtonedPainter.GetTabBodyColor( + TabVisibleIndex: Integer): TColor; +var + ATab: TcxTab; +begin + ATab := ParentInfo.VisibleTabs[TabVisibleIndex]; + if ATab.Highlighted then + Result := HighlightedTabBodyColor + else + begin + Result := GetTabColor(TabVisibleIndex); + if Result = clDefault then + if ATab.IsMainTab then + Result := cxPCLightestEdgeColor + else + Result := clBtnFace; + end; +end; + +function TcxPCButtonedPainter.GetTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; +//var +// ACorrection: Integer; +begin + Result := ButtonsPainterTabContentWOffsetA[IsAssignedImages]; +// if ParentInfo.Rotate and (ParentInfo.VisibleTabs[ATabVisibleIndex].Caption <> '') then +// begin +// ACorrection := (12 - Result.Left - Result.Right) div 2; +// if GetTabBaseImageSize.cx = 0 then +// Inc(Result.Left, ACorrection); +// Inc(Result.Right, ACorrection); +// end; +end; + +function TcxPCButtonedPainter.GetTabsContainerOffsets: TRect; +begin + Result := Rect(TabsContainerOffset, TabsContainerOffset, TabsContainerOffset, 0); +end; + +function TcxPCButtonedPainter.GetTooNarrowTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; +begin + Result := GetTabContentWOffset(ATabVisibleIndex); +end; + +function TcxPCButtonedPainter.IsTabBorderThick(ATabVisibleIndex: Integer): Boolean; +begin + with ParentInfo.VisibleTabs[ATabVisibleIndex] do + Result := not Tracking and (Pressed or Selected or IsMainTab); +end; + +{ TcxPCExtraFlatPainter } + +procedure TcxPCExtraFlatPainter.CalculateButtonContentParameters( + AButton: TcxPCNavigatorButton; out AParameters: TcxPCNavigatorButtonContentParameters); +begin + inherited CalculateButtonContentParameters(AButton, AParameters); + AParameters.Enabled := True; + AParameters.LiteStyle := (AButton = nbClose) or not ParentControl.Enabled or + (ParentInfo.NavigatorButtonsState[AButton] = nbsDisabled); + if AParameters.LiteStyle then + AParameters.BrushColor := cxPCLightBrushColor; +end; + +function TcxPCExtraFlatPainter.CalculateTabNormalWidth(Tab: TcxTab): Integer; +begin + if ParentInfo.TabWidth > 0 then + Result := ParentInfo.TabWidth + else + begin + Result := GetTabNormalWidth(Tab.VisibleIndex); + Inc(Result, 12); + if Tab.Caption <> '' then + Inc(Result, TextSize(Tab, Tab.Caption).cx - 3); + end; + if Result < GetMinTabNormalWidth(Tab.VisibleIndex) then + Result := GetMinTabNormalWidth(Tab.VisibleIndex); +end; + +procedure TcxPCExtraFlatPainter.CorrectTabRect(TabVisibleIndex: Integer; + var TabRectCorrection: TcxPCRectCorrection); +begin + with ParentInfo do + if VisibleTabs[TabVisibleIndex].IsMainTab then + TabRectCorrection := ExtraFlatPainterMainTabRectCorrection + else + inherited CorrectTabRect(TabVisibleIndex, TabRectCorrection); +end; + +function TcxPCExtraFlatPainter.GetButtonColor( + AButtonState: TcxPCNavigatorButtonState): TColor; +begin + if AButtonState in [nbsHotTrack, nbsPressed] then + Result := clBtnFace + else + Result := GetTabsRowColor; +end; + +function TcxPCExtraFlatPainter.GetButtonContentColor( + AButtonState: TcxPCNavigatorButtonState): TColor; +begin + if not ParentControl.Enabled or (AButtonState = nbsDisabled) then + Result := cxPCDarkEdgeColor + else + if AButtonState = nbsPressed then + Result := cxPCLightestEdgeColor + else + Result := clBtnText; +end; + +function TcxPCExtraFlatPainter.GetButtonContentPosition( + AButton: TcxPCNavigatorButton): TPoint; +const + AArrowButtonArrowRectLeftTopCorners: array [TcxPCArrow] of TPoint = ( + (X: 2; Y: 5), (X: 2; Y: 3), (X: 5; Y: 2), (X: 3; Y: 2) + ); + ACloseButtonCrossRectLeftTopCorners: array[Boolean] of TPoint = ((X: 3; Y: 2), (X: 2; Y: 3)); + AGoDialogArrowRectLeftTopCorner: TPoint = (X: 3; Y: 4); +begin + case AButton of + nbGoDialog: + begin + Result := AGoDialogArrowRectLeftTopCorner; + if ParentInfo.NavigatorButtonsState[AButton] = nbsPressed then + Inc(Result.Y); + end; + nbClose: + Result := ACloseButtonCrossRectLeftTopCorners[ParentInfo.TabPosition in [tpTop, tpBottom]]; + else + Result := AArrowButtonArrowRectLeftTopCorners[GetButtonArrow(AButton)]; + end; +end; + +function TcxPCExtraFlatPainter.GetButtonHeight: Integer; +begin + Result := ExtraFlatPainterButtonSize; +end; + +function TcxPCExtraFlatPainter.GetButtonWidth( + Button: TcxPCNavigatorButton): Integer; +begin + Result := ExtraFlatPainterButtonSize; +end; + +function TcxPCExtraFlatPainter.GetClientColor: TColor; +begin + if ParentInfo.MainTabVisibleIndex <> -1 then + Result := ParentInfo.PageColors[ParentInfo.MainTabVisibleIndex] + else + Result := clBtnFace; +end; + +function TcxPCExtraFlatPainter.GetClientRectOffset: TRect; +begin + Result := inherited GetClientRectOffset; + if not ParentInfo.HideTabs and (ParentInfo.RowCount > 0) then + Inc(Result.Top, ExtraFlatPainterMainTabRowUnderlineWidth); + ExcludeUnderLine(Result); +end; + +function TcxPCExtraFlatPainter.GetDefaultTabNormalHeight: Integer; +begin + Result := 17; +end; + +function TcxPCExtraFlatPainter.GetDefaultTabNormalHTextOffset: Integer; +begin + Result := 2; +end; + +function TcxPCExtraFlatPainter.GetDisplayRectOffset: TRect; +begin + Result := inherited GetDisplayRectOffset; + if not ParentInfo.HideTabs and ParentInfo.TabsOnBothSides then + Inc(Result.Bottom, ExtraFlatPainterTabsRowFreeSpaceWidth); +end; + +function TcxPCExtraFlatPainter.GetDrawImageOffset(TabVisibleIndex: Integer): TRect; +begin + Result := ExtraFlatPainterDrawImageOffsetA[ParentInfo.VisibleTabs[TabVisibleIndex].IsMainTab]; +end; + +function TcxPCExtraFlatPainter.GetDrawTextHOffset(TabVisibleIndex: Integer): TRect; +var + AIsMainTab: Boolean; +begin + AIsMainTab := ParentInfo.VisibleTabs[TabVisibleIndex].IsMainTab; + Result := ExtraFlatPainterDrawTextHOffsetA[AIsMainTab]; + if ParentInfo.VisibleTabs[TabVisibleIndex].PaintingPositionIndex in [5, 7, 10] then + begin + Result.Top := 0; + Result.Bottom := 0; + end; + + if GetTabRotatedImageSize.cx > 0 then + if AIsMainTab then + Inc(Result.Left) + else + Inc(Result.Left, 2); +end; + +function TcxPCExtraFlatPainter.GetFrameWidth: Integer; +begin + Result := 1; +end; + +function TcxPCExtraFlatPainter.GetFreeSpaceColor: TColor; +begin + Result := clBtnFace; +end; + +function TcxPCExtraFlatPainter.GetMinTabNormalWidth(ATabVisibleIndex: Integer): Integer; +begin + Result := GetTabNormalWidth(ATabVisibleIndex); +end; + +{ TcxPCExtraFlatPainter } + +function TcxPCExtraFlatPainter.CalculateTabNormalHeight: Integer; +var + DefaultTabNormalHeight: Integer; +begin + with ParentInfo do + begin + Result := InternalCalculateTabNormalHeight; + + DefaultTabNormalHeight := GetDefaultTabNormalHeight; + if Result < DefaultTabNormalHeight then + Result := DefaultTabNormalHeight; + + CorrectTabHeightForImage(Result); + + if (TabHeight - 4 >= DefaultTabNormalHeight) and (TabHeight - 4 > Result) then + Result := TabHeight - 4; + end; +end; + +class function TcxPCExtraFlatPainter.GetStyleID: TcxPCStyleID; +begin + Result := cxPCExtraFlatStyle; +end; + +class function TcxPCExtraFlatPainter.GetStyleName: TCaption; +begin + Result := 'ExtraFlat'; +end; + +class function TcxPCExtraFlatPainter.HasLookAndFeel(ALookAndFeel: TcxLookAndFeel): Boolean; +begin + Result := False; +end; + +function TcxPCExtraFlatPainter.GetTabBodyColor( + TabVisibleIndex: Integer): TColor; +var + ATab: TcxTab; +begin + ATab := ParentInfo.VisibleTabs[TabVisibleIndex]; + if ATab.Highlighted then + Result := HighlightedTabBodyColor + else + begin + Result := GetTabColor(TabVisibleIndex); + if Result = clDefault then + if ATab.IsMainTab then + Result := cxPCTabBodyColor + else + if ParentInfo.IsTabsContainer then + Result := ParentInfo.Color + else + Result := cxPCLightBrushColor; + end; +end; + +function TcxPCExtraFlatPainter.GetTabBorderWidth(Tab: TcxTab = nil): Integer; +begin + Result := 0; + if (Tab <> nil) and Tab.IsMainTab then Result := 1; +end; + +function TcxPCExtraFlatPainter.GetTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; +begin + Result := ExtraFlatPainterTabContentWOffset[ParentInfo.VisibleTabs[ATabVisibleIndex].IsMainTab]; +end; + +function TcxPCExtraFlatPainter.GetTabNormalWidth(ATabVisibleIndex: Integer): Integer; +begin + if IsAssignedImages and ((ATabVisibleIndex = -1) or IsTabHasImage(ATabVisibleIndex) or ParentInfo.Rotate) then + Result := GetTabBaseImageSize.cx + 2 * ParentInfo.ImageBorder + 4 + else + Result := 0; +end; + +function TcxPCExtraFlatPainter.GetTabsRowsDelimiterWidth: Integer; +begin + Result := 3; +end; + +function TcxPCExtraFlatPainter.GetTabsNormalDistance: TcxPCDistance; +begin + Result.dw := GetTabsDelimiterWidth; + Result.dh := GetTabsRowsDelimiterWidth + ExtraFlatPainterTabsRowFreeSpaceWidth; + if ParentInfo.Rotate then + RotateTabsDistance(Result); +end; + +function TcxPCExtraFlatPainter.GetTabsPosition( + NavigatorButtons: TcxPCNavigatorButtons): TcxPCTabsPosition; +const + TabsRegionHOffset = ExtraFlatPainterTabsRowFreeSpaceWidth; + TabsRegionWOffset = 6; + + NormalTabsRectCorrection: TRect = (Left: TabsRegionWOffset; Top: TabsRegionHOffset; Right: TabsRegionWOffset; Bottom: 0); + ExtendedTabsRectCorrection: TRect = (Left: -1; Top: -1; Right: -1; Bottom: 0); + + procedure CalculateNormalParameters; + var + ButtonsWidth: Integer; + ANormalTabsRectCorrection: TRect; + begin + ButtonsWidth := CalculateButtonsRegionWidth(NavigatorButtons); + with ParentInfo, Result do + begin + ANormalTabsRectCorrection := NormalTabsRectCorrection; + if NeedShowTabsRegionFrame then + OffsetRect(ANormalTabsRectCorrection, 0, GetFrameWidth); + NormalTabsRect := GetExtendedRect(GetControlRect(ParentControl), + ANormalTabsRectCorrection, TabPosition); + + if TabPosition in [tpTop, tpBottom] then + begin + NormalRowWidth := Width - 2 * TabsRegionWOffset - ButtonsWidth; + if NavigatorPosition in [npLeftTop, npLeftBottom] then + Inc(NormalTabsRect.Left, ButtonsWidth) + else + Dec(NormalTabsRect.Right, ButtonsWidth); + end else + begin + NormalRowWidth := Height - 2 * TabsRegionWOffset - ButtonsWidth; + if NavigatorPosition in [npLeftTop, npRightTop] then + Inc(NormalTabsRect.Top, ButtonsWidth) + else + Dec(NormalTabsRect.Bottom, ButtonsWidth); + end; + end; + end; + +begin + CalculateNormalParameters; + + with ParentInfo, Result do + begin + ExtendedTabsRect := GetExtendedRect(NormalTabsRect, ExtendedTabsRectCorrection, TabPosition); + + ExtendedTopOrLeftTabsRectBottomOrRightBorderOffset := 0; + ExtendedBottomOrRightTabsRectTopOrLeftBorderOffset := 0; + if ParentInfo.TabPosition in [tpTop, tpLeft] then + ExtendedTopOrLeftTabsRectBottomOrRightBorderOffset := 1 + else + ExtendedBottomOrRightTabsRectTopOrLeftBorderOffset := -1; + MinDistanceBetweenTopOrLeftAndBottomOrRightExtendedTabsRects := + GetTabsNormalDistance.dh - 1; + end; + + CalculateButtonsRegion(NavigatorButtons); +end; + +function TcxPCExtraFlatPainter.GetTooNarrowTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; +begin + Result := GetTabContentWOffset(ATabVisibleIndex); +end; + +function TcxPCExtraFlatPainter.InternalCalculateTabNormalHeight: Integer; +begin + Result := inherited InternalCalculateTabNormalHeight; + Dec(Result, 3); +end; + +procedure TcxPCExtraFlatPainter.InternalPaint; +begin + PaintClientArea; + if not ParentInfo.HideTabs then + begin + PaintButtonsRegion; + PaintTabsRegion; + end; +end; + +procedure TcxPCExtraFlatPainter.PaintButtonFrame(var ARect: TRect; + AButtonState: TcxPCNavigatorButtonState); +begin + if AButtonState in [nbsHotTrack, nbsPressed] then + begin + InternalDrawEdge(ARect, AButtonState = nbsPressed, True); + InflateRect(ARect, -1, -1); + end; +end; + +class function TcxPCExtraFlatPainter.IsMainTabBoundWithClient: boolean; +begin + Result := True; +end; + +class function TcxPCExtraFlatPainter.IsMultiSelectionAccepted: boolean; +begin + Result := False; +end; + +class function TcxPCExtraFlatPainter.IsTabPressable: Boolean; +begin + Result := False; +end; + +procedure TcxPCExtraFlatPainter.PaintClientArea; +begin + PaintMainTabRowUnderline; + inherited PaintClientArea; +end; + +procedure TcxPCExtraFlatPainter.PaintFrame; +begin + InternalPaintFrame(clBtnHighlight, clBtnShadow); +end; + +procedure TcxPCExtraFlatPainter.PaintTabShape(TabVisibleIndex: Integer); +var + R: TRect; + Tab: TcxTab; +begin + Tab := ParentInfo.VisibleTabs[TabVisibleIndex]; + R := Tab.FullRect; + if Tab.IsMainTab then + PaintMainTabFrame(R); + + if not IsTabTransparent(TabVisibleIndex) then + DrawBackground(ParentInfo.Canvas.Canvas, R, TabVisibleIndex); + if Tab.IsMainTab then + InternalDrawFocusRect(TabVisibleIndex, GetFocusRect); +end; + +procedure TcxPCExtraFlatPainter.PaintTabsRegion; + + procedure PaintDelimiter(TabVisibleIndex: Integer); + + function IsDelimiterNeeded: Boolean; + var + FirstIndex, LastIndex: Integer; + Tab, NextTab: TcxTab; + begin + Result := False; + Tab := ParentInfo.VisibleTabs[TabVisibleIndex]; + if Tab.IsMainTab then Exit; + InitializeVisibleTabRange(ParentControl, FirstIndex, LastIndex); + if TabVisibleIndex = LastIndex then Exit; + NextTab := ParentInfo.VisibleTabs[TabVisibleIndex + 1]; + if NextTab.IsMainTab then Exit; + Result := Tab.VisibleRow = NextTab.VisibleRow; + end; + + var + ADelimiterOffsets: TcxPCTabsDelimiterOffsets; + ADelimiterRect, ATabFullRect: TRect; + begin + if not IsDelimiterNeeded then + Exit; + ATabFullRect := ParentInfo.VisibleTabs[TabVisibleIndex].FullRect; + ADelimiterOffsets := GetTabsDelimiterOffsets; + with ATabFullRect do + case ParentInfo.TabPosition of + tpTop, tpBottom: + begin + ADelimiterRect.Top := Top + ADelimiterOffsets.Top; + ADelimiterRect.Bottom := Bottom - ADelimiterOffsets.Bottom; + if IsRightToLeftAlignment(ParentControl) then + ADelimiterRect.Left := Left - GetTabsDelimiterWidth + else + ADelimiterRect.Left := Right; + ADelimiterRect.Right := ADelimiterRect.Left + GetTabsDelimiterWidth; + end; + tpLeft, tpRight: + begin + ADelimiterRect.Left := Left + ADelimiterOffsets.Top; + ADelimiterRect.Right := Right - ADelimiterOffsets.Bottom; + if IsBottomToTopAlignment(ParentControl) then + ADelimiterRect.Top := Top - GetTabsDelimiterWidth + else + ADelimiterRect.Top := Bottom; + ADelimiterRect.Bottom := ADelimiterRect.Top + GetTabsDelimiterWidth; + end; + end; + PaintTabsDelimiter(ADelimiterRect); + end; + +var + AInterval: TcxPCIndexInterval; + ALineIndexBoundsA: TcxPCLineIndexBoundsArray; + AOutTabImageAndTextDatas: array of TcxPCOutTabImageAndTextData; + ARowIndex, I: Integer; + ARowRect, R: TRect; +begin + InitializeLineBoundsArray(ParentControl, ALineIndexBoundsA); + + for ARowIndex := 0 to Length(ALineIndexBoundsA) - 1 do + begin + SaveClipRgn; + + AInterval := ALineIndexBoundsA[ARowIndex]; + SetLength(AOutTabImageAndTextDatas, AInterval.Right - AInterval.Left + 1); + for I := AInterval.Left to AInterval.Right do + begin + PaintTab(I); + PaintDelimiter(I); + AOutTabImageAndTextDatas[I - AInterval.Left] := FOutTabImageAndTextData; + end; + + ARowRect := GetTabsRowRect(ARowIndex); + + R := ARowRect; + PaintTabsRowsDelimiter(R, ARowIndex); + DrawBackground(ParentInfo.Canvas.Canvas, R, -1); + + RestoreClipRgn; + + for I := AInterval.Left to AInterval.Right do + if IsTabTransparent(I) then + begin + FOutTabImageAndTextData := AOutTabImageAndTextDatas[I - AInterval.Left]; + AfterPaintTab(I); + end; + + ParentInfo.Canvas.ExcludeClipRect(ARowRect); + end; +end; + +procedure TcxPCExtraFlatPainter.RepaintTab(TabVisibleIndex: Integer; + TabPropertyChanged: TcxPCTabPropertyChanged); +var + ATab: TcxTab; +begin + if IsVerticalText(ParentControl) then + ParentInfo.VisibleTabs[TabVisibleIndex].ResetVerticalTextBitmap; + ATab := ParentInfo.VisibleTabs[TabVisibleIndex]; + if (TabPropertyChanged = tpcIsMainTab) and not ATab.IsMainTab then + InvalidateTabExtendedTabsRect(TabVisibleIndex) + else + InvalidateTabRect(TabVisibleIndex); + if ATab.IsMainTab then + ParentControl.InvalidateRect(GetMainTabRowUnderlineRect, False); +end; + +function TcxPCExtraFlatPainter.GetButtonsDistance( + AButton1, AButton2: TcxPCNavigatorButton): Integer; +begin + if IsOneOfButtons(AButton1, AButton2, nbGoDialog) then + begin + if IsOneOfButtons(AButton1, AButton2, nbClose) then + Result := 3 + else + Result := 0; + end + else + Result := 3; +end; + +function TcxPCExtraFlatPainter.GetButtonsRegionHOffset: Integer; +begin + Result := 6; +end; + +function TcxPCExtraFlatPainter.GetButtonsRegionWOffset: Integer; +begin + Result := 1; + if NeedShowTabsRegionFrame then + Inc(Result, GetFrameWidth); +end; + +function TcxPCExtraFlatPainter.GetFocusRect: TRect; +const + AFocusRectCorrectionA: array[TcxTabPosition] of TcxPCRectCorrection = ( + (dLeft: 0; dTop: 0; dRight: -1; dBottom: 1), + (dLeft: 1; dTop: -1; dRight: -1; dBottom: -1), + (dLeft: 0; dTop: 0; dRight: 1; dBottom: -1), + (dLeft: -1; dTop: 1; dRight: -1; dBottom: -1) + ); +begin + Result := ParentInfo.VisibleTabs[ParentInfo.MainTabVisibleIndex].FullRect; + CorrectRect(Result, AFocusRectCorrectionA[ParentInfo.TabPosition]); +end; + +function TcxPCExtraFlatPainter.GetTabsDelimiterOffsets: TcxPCTabsDelimiterOffsets; +begin + Result.Top := 2; + Result.Bottom := 2; +end; + +procedure TcxPCExtraFlatPainter.DrawBackground(ACanvas: TCanvas; ARect: TRect; + ATabVisibleIndex: Integer); +begin + if (ATabVisibleIndex <> -1) and (ATabVisibleIndex <> ParentInfo.MainTabVisibleIndex) then + begin + ACanvas.Brush.Color := GetTabsRowColor; + ACanvas.FrameRect(ARect); + InflateRect(ARect, -1, -1); + end; + + if ATabVisibleIndex = -1 then + ACanvas.Brush.Color := GetTabsRowColor + else + ACanvas.Brush.Color := GetTabBodyColor(ATabVisibleIndex); + ACanvas.Brush.Style := bsSolid; + ACanvas.FillRect(ARect); +end; + +procedure TcxPCExtraFlatPainter.ExcludeUnderLine(var R: TRect); +begin + if NeedShowFrame and not ParentInfo.HideTabs and (ParentInfo.RowCount > 0) then + Dec(R.Top); +end; + +function TcxPCExtraFlatPainter.GetMainTabRowUnderlineColor: TColor; +begin + if ParentInfo.MainTabVisibleIndex = -1 then + Result := cxPCTabBodyColor + else + begin + Result := GetTabColor(ParentInfo.MainTabVisibleIndex); + if Result = clDefault then + Result := cxPCTabBodyColor; + end; +end; + +function TcxPCExtraFlatPainter.GetMainTabRowUnderlineRect: TRect; +begin + if ParentInfo.HideTabs or (ParentInfo.RowCount = 0) then + begin + Result := cxEmptyRect; + Exit; + end; + + Result := GetClientRect; + SubtractRect(Result, + GetExtendedRect(Result, Rect(0, - ExtraFlatPainterMainTabRowUnderlineWidth, 0, 0), ParentInfo.TabPosition), + Result); +end; + +function TcxPCExtraFlatPainter.GetTabBackgroundRect(ATabVisibleIndex: Integer; + AForNormalState: Boolean): TRect; +var + ATab: TcxTab; +begin + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + if not AForNormalState and (ATabVisibleIndex = ParentInfo.MainTabVisibleIndex) then + Result := GetExtendedRect(ATab.FullRect, Rect(1, 1, 1, 0), ATab.PaintingPosition) + else + begin + Result := GetExtendedRect(ATab.NormalRect, + Rect(0, -ExtraFlatPainterTabsRowFreeSpaceWidth, 0, -GetTabsRowsDelimiterWidth), + ParentInfo.TabPosition); + end; +end; + +function TcxPCExtraFlatPainter.GetTabsDelimiterWidth: Integer; +begin + Result := 1; +end; + +function TcxPCExtraFlatPainter.GetTabsRowColor: TColor; +begin + if ParentInfo.IsTabsContainer then + Result := ParentInfo.Color + else + Result := cxPCLightBrushColor; +end; + +function TcxPCExtraFlatPainter.GetTabsRowRect(ARowIndex: Integer): TRect; +var + ALineIndexBoundsA: TcxPCLineIndexBoundsArray; +begin + InitializeLineBoundsArray(ParentControl, ALineIndexBoundsA); + Result := GetTabBackgroundRect(ALineIndexBoundsA[ARowIndex].Left, True); + if ParentInfo.TabPosition in [tpLeft, tpRight] then + begin + Result.Top := 0; + Result.Bottom := ParentInfo.Height; + end + else + begin + Result.Left := 0; + Result.Right := ParentInfo.Width; + end; + + if NeedShowTabsRegionFrame then + Result := GetExtendedRect(Result, Rect(1, 0, 1, 0), ParentInfo.TabPosition); +end; + +procedure TcxPCExtraFlatPainter.InternalPaintFrame( + ALeftTopColor, ARightBottomColor: TColor); +var + R: TRect; +begin + R := GetDisplayRect; + if ParentInfo.HideTabs or (ParentInfo.RowCount = 0) then + ParentInfo.Canvas.DrawComplexFrame(R, ALeftTopColor, ARightBottomColor) + else + case ParentInfo.TabPosition of + tpTop: + DrawBorder(ParentInfo.Canvas, R, [bRight, bBottom, bLeft], [ARightBottomColor, ARightBottomColor, ALeftTopColor]); + tpBottom: + DrawBorder(ParentInfo.Canvas, R, [bRight, bTop, bLeft], [ARightBottomColor, ALeftTopColor, ALeftTopColor]); + tpLeft: + DrawBorder(ParentInfo.Canvas, R, [bBottom, bRight, bTop], [ARightBottomColor, ARightBottomColor, ALeftTopColor]); + tpRight: + DrawBorder(ParentInfo.Canvas, R, [bBottom, bLeft, bTop], [ARightBottomColor, ALeftTopColor, ALeftTopColor]); + end; +end; + +procedure TcxPCExtraFlatPainter.InternalPaintMainTabFrame(var R: TRect; + ALightColor, ADarkColor: TColor); +var + AMainTab: TcxTab; +begin + AMainTab := ParentInfo.VisibleTabs[ParentInfo.MainTabVisibleIndex]; + case AMainTab.PaintingPosition of + tpTop: + DrawBorder(ParentInfo.Canvas, R, [bLeft, bTop, bRight], [ALightColor, ALightColor, ADarkColor]); + tpBottom: + begin + DrawBorder(ParentInfo.Canvas, R, [bLeft, bBottom, bRight], [ALightColor, ADarkColor, ADarkColor]); + ParentInfo.Canvas.Pixels[R.Left - 1, R.Top] := ADarkColor; + end; + tpLeft: + DrawBorder(ParentInfo.Canvas, R, [bTop, bLeft, bBottom], [ALightColor, ALightColor, ADarkColor]); + tpRight: + begin + DrawBorder(ParentInfo.Canvas, R, [bTop, bRight, bBottom], [ALightColor, ADarkColor, ADarkColor]); + ParentInfo.Canvas.Pixels[R.Left, R.Top - 1] := ADarkColor; + end; + end; +end; + +procedure TcxPCExtraFlatPainter.InternalPaintTabsRowsDelimiter(var ARowRect: TRect; + AColors: array of TColor); +var + I: Integer; +begin + for I := 0 to GetTabsRowsDelimiterWidth - 1 do + case ParentInfo.TabPosition of + tpTop: + DrawBorder(ParentInfo.Canvas, ARowRect, [bBottom], [AColors[I]]); + tpBottom: + DrawBorder(ParentInfo.Canvas, ARowRect, [bTop], [AColors[I]]); + tpLeft: + DrawBorder(ParentInfo.Canvas, ARowRect, [bRight], [AColors[I]]); + tpRight: + DrawBorder(ParentInfo.Canvas, ARowRect, [bLeft], [AColors[I]]); + end; +end; + +function TcxPCExtraFlatPainter.IsMainTabRow(AVisibleRow: Integer): Boolean; +begin + if ParentInfo.MainTabVisibleIndex <> -1 then + Result := ParentInfo.VisibleTabs[ParentInfo.MainTabVisibleIndex].VisibleRow = AVisibleRow + else + if ParentInfo.TabPosition in [tpTop, tpLeft] then + Result := AVisibleRow = ParentInfo.RowCount - 1 + else + Result := AVisibleRow = 0; +end; + +function TcxPCExtraFlatPainter.NeedShowTabsRegionFrame: Boolean; +begin + Result := False; +end; + +procedure TcxPCExtraFlatPainter.PaintMainTabFrame(var R: TRect); +begin + InternalPaintMainTabFrame(R, clWhite, clBlack); +end; + +procedure TcxPCExtraFlatPainter.PaintMainTabRowUnderline; +begin + if not ParentInfo.HideTabs and (ParentInfo.RowCount > 0) then + begin + ParentInfo.Canvas.Brush.Color := GetMainTabRowUnderlineColor; + ParentInfo.Canvas.FillRect(GetMainTabRowUnderlineRect); + end; +end; + +procedure TcxPCExtraFlatPainter.PaintTabsDelimiter(const ARect: TRect); +begin + ParentInfo.Canvas.Brush.Color := cxPCDarkEdgeColor; + ParentInfo.Canvas.FillRect(ARect); + ParentInfo.Canvas.ExcludeClipRect(ARect); +end; + +procedure TcxPCExtraFlatPainter.PaintTabsRowsDelimiter(var ARowRect: TRect; + ARowIndex: Integer); +begin + if ParentInfo.TabPosition in [tpTop, tpLeft] then + InternalPaintTabsRowsDelimiter(ARowRect, [cxPCTabBodyColor, cxPCTabBodyColor, clWhite]) + else + InternalPaintTabsRowsDelimiter(ARowRect, [cxPCTabBodyColor, cxPCTabBodyColor, clBlack]) +end; + +{ TcxPCUltraFlatPainter } + +class function TcxPCUltraFlatPainter.GetStyleID: TcxPCStyleID; +begin + Result := cxPCUltraFlatStyle; +end; + +class function TcxPCUltraFlatPainter.GetStyleName: TCaption; +begin + Result := 'UltraFlat'; +end; + +class function TcxPCUltraFlatPainter.HasLookAndFeel(ALookAndFeel: TcxLookAndFeel): Boolean; +begin + Result := ALookAndFeel.GetAvailablePainter([totTab]).LookAndFeelStyle = lfsUltraFlat; +end; + +procedure TcxPCUltraFlatPainter.CalculateButtonContentParameters( + AButton: TcxPCNavigatorButton; out AParameters: TcxPCNavigatorButtonContentParameters); +begin + inherited CalculateButtonContentParameters(AButton, AParameters); + AParameters.Enabled := ParentControl.Enabled; + AParameters.LiteStyle := AButton = nbClose; + AParameters.BrushColor := AParameters.Color; +end; + +function TcxPCUltraFlatPainter.GetButtonColor( + AButtonState: TcxPCNavigatorButtonState): TColor; +begin + if AButtonState = nbsHotTrack then + Result := clBtnFace + else + if AButtonState = nbsPressed then + Result := clBtnShadow + else + Result := cxPCLightBrushColor; +end; + +function TcxPCUltraFlatPainter.GetButtonContentPosition( + AButton: TcxPCNavigatorButton): TPoint; +begin + Result := GetButtonCenteredContentPosition(AButton); +end; + +function TcxPCUltraFlatPainter.GetButtonHeight: Integer; +begin + Result := UltraFlatPainterButtonHeight; +end; + +function TcxPCUltraFlatPainter.GetButtonsDistance( + AButton1, AButton2: TcxPCNavigatorButton): Integer; +begin + if IsOneOfButtons(AButton1, AButton2, nbClose) then + Result := 3 + else + Result := 1; +end; + +function TcxPCUltraFlatPainter.GetButtonsRegionHOffset: Integer; +begin + Result := 3; +end; + +function TcxPCUltraFlatPainter.GetButtonWidth(Button: TcxPCNavigatorButton): Integer; +begin + Result := UltraFlatPainterButtonWidthA[Button]; +end; + +function TcxPCUltraFlatPainter.GetFocusRect: TRect; +begin + Result := GetExtendedRect(ParentInfo.VisibleTabs[ParentInfo.MainTabVisibleIndex].FullRect, + Rect(1, 1, 1, 0), ParentInfo.TabPosition); +end; + +procedure TcxPCUltraFlatPainter.PaintButtonFrame(var ARect: TRect; + AButtonState: TcxPCNavigatorButtonState); + + function GetFrameColor: TColor; + begin + if AButtonState in [nbsNormal, nbsDisabled] then + Result := clBtnShadow + else + Result := clBlack; + end; + +begin + ParentInfo.Canvas.DrawComplexFrame(ARect, GetFrameColor, GetFrameColor); + InflateRect(ARect, -1, -1); +end; + +procedure TcxPCUltraFlatPainter.PaintFrame; +begin + InternalPaintFrame(clBtnShadow, clBtnShadow); +end; + +procedure TcxPCUltraFlatPainter.PaintMainTabFrame(var R: TRect); +begin + InternalPaintMainTabFrame(R, clBlack, clBlack); +end; + +procedure TcxPCUltraFlatPainter.PaintTabsRowsDelimiter(var ARowRect: TRect; + ARowIndex: Integer); +begin + if IsMainTabRow(ARowIndex) then + InternalPaintTabsRowsDelimiter(ARowRect, [cxPCTabBodyColor, cxPCTabBodyColor, clBlack]) + else + InternalPaintTabsRowsDelimiter(ARowRect, [cxPCTabBodyColor, clBlack, cxPCTabBodyColor]) +end; + +{ TcxPCFlatPainter } + +class function TcxPCFlatPainter.GetStyleID: TcxPCStyleID; +begin + Result := cxPCFlatStyle; +end; + +class function TcxPCFlatPainter.GetStyleName: TCaption; +begin + Result := 'Flat'; +end; + +class function TcxPCFlatPainter.HasLookAndFeel(ALookAndFeel: TcxLookAndFeel): Boolean; +begin + Result := ALookAndFeel.GetAvailablePainter([totTab]).LookAndFeelStyle = lfsFlat; +end; + +function TcxPCFlatPainter.GetButtonContentPosition( + AButton: TcxPCNavigatorButton): TPoint; +begin + Result := inherited GetButtonContentPosition(AButton); + Dec(Result.X, TabsPainterButtonBorderWidth - FlatPainterButtonBorderWidth); + Dec(Result.Y, TabsPainterButtonBorderWidth - FlatPainterButtonBorderWidth); +end; + +function TcxPCFlatPainter.GetButtonHeight: Integer; +begin + Result := inherited GetButtonHeight; + Dec(Result, (TabsPainterButtonBorderWidth - FlatPainterButtonBorderWidth) * 2); +end; + +function TcxPCFlatPainter.GetButtonWidth(Button: TcxPCNavigatorButton): Integer; +begin + Result := inherited GetButtonWidth(Button); + Dec(Result, (TabsPainterButtonBorderWidth - FlatPainterButtonBorderWidth) * 2); +end; + +function TcxPCFlatPainter.GetFrameWidth: Integer; +begin + Result := 1; +end; + +function TcxPCFlatPainter.GetTabClipRgn(ATabVisibleIndex: Integer): TcxRegion; +begin + Result := TcxRegion.Create(ParentInfo.VisibleTabs[ATabVisibleIndex].VisibleRect); +end; + +function TcxPCFlatPainter.GetTabClipRgnOperation(ATabVisibleIndex: Integer): TcxRegionOperation; +begin + Result := roIntersect; +end; + +function TcxPCFlatPainter.IsNativePainting: Boolean; +begin + Result := False; +end; + +function TcxPCFlatPainter.NeedShowFrame: Boolean; +begin + Result := True; +end; + +procedure TcxPCFlatPainter.PaintButtonFrame(var ARect: TRect; + AButtonState: TcxPCNavigatorButtonState); +begin + if AButtonState = nbsPressed then + ParentInfo.Canvas.DrawComplexFrame(ARect, cxPCDarkEdgeColor, cxPCLightestEdgeColor) + else + ParentInfo.Canvas.DrawComplexFrame(ARect, cxPCLightestEdgeColor, cxPCDarkEdgeColor); + InflateRect(ARect, -1, -1); +end; + +procedure TcxPCFlatPainter.PaintFrameBorder(R: TRect); +begin + ParentInfo.Canvas.DrawComplexFrame(R, cxPCLightestEdgeColor, cxPCDarkEdgeColor); +end; + +procedure TcxPCFlatPainter.PaintTabFrame(ATabVisibleIndex: Integer); + + function GetContrastColor: TColor; + begin + Result := Light(GetTabBodyColor(ATabVisibleIndex), 85); + end; + +var + AContrastColor: TColor; + ATab: TcxTab; + R: TRect; +begin + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + R := ATab.FullRect; + AContrastColor := GetContrastColor; + with R do + case ATab.PaintingPosition of + tpTop: + begin + InternalPolyLine([Point(Left, Bottom - 1), Point(Left, Top + 2), Point(Left + 2, Top), Point(Right - 3, Top), Point(Right - 2, Top + 1)], cxPCLightestEdgeColor); + InternalPolyLine([Point(Right - 1, Top + 2), Point(Right - 1, Bottom - 1)], cxPCDarkEdgeColor); + InternalPolyLine([Point(Left + 1, Bottom - 1), Point(Left + 1, Top + 2), Point(Left + 2, Top + 1), Point(Right - 3, Top + 1), Point(Right - 2, Top + 2), Point(Right - 2, Bottom - 1)], AContrastColor); + end; + tpBottom: + begin + InternalPolyLine([Point(Left, Top), Point(Left, Bottom - 3), Point(Left + 1, Bottom - 2)], cxPCLightestEdgeColor); + InternalPolyLine([Point(Left + 2, Bottom - 1), Point(Right - 3, Bottom - 1), Point(Right - 1, Bottom - 3), Point(Right - 1, Top)], cxPCDarkEdgeColor); + InternalPolyLine([Point(Left + 1, Top), Point(Left + 1, Bottom - 3)], AContrastColor); + InternalPolyLine([Point(Left + 2, Bottom - 2), Point(Right - 3, Bottom - 2), Point(Right - 2, Bottom - 3), Point(Right - 2, Top)], clBtnFace); + end; + tpLeft: + begin + InternalPolyLine([Point(Right - 1, Bottom - 1), Point(Left + 2, Bottom - 1)], cxPCDarkEdgeColor); + InternalPolyLine([Point(Left + 1, Bottom - 2), Point(Left, Bottom - 3), Point(Left, Top + 2), Point(Left + 2, Top), Point(Right - 1, Top)], cxPCLightestEdgeColor); + InternalPolyLine([Point(Right - 1, Bottom - 2), Point(Left + 2, Bottom - 2), Point(Left + 1, Bottom - 3), Point(Left + 1, Top + 2), Point(Left + 2, Top + 1), Point(Right - 1, Top + 1)], AContrastColor); + end; + tpRight: + begin + InternalPolyLine([Point(Left, Top), Point(Right - 3, Top), Point(Right - 2, Top + 1)], cxPCLightestEdgeColor); + InternalPolyLine([Point(Right - 1, Top + 2), Point(Right - 1, Bottom - 3), Point(Right - 3, Bottom - 1), Point(Left, Bottom - 1)], cxPCDarkEdgeColor); + InternalPolyLine([Point(Left, Top + 1), Point(Right - 3, Top + 1)], AContrastColor); + InternalPolyLine([Point(Right - 2, Top + 2), Point(Right - 2, Bottom - 3), Point(Right - 3, Bottom - 2), Point(Left, Bottom - 2)], clBtnFace); + end; + end; + PaintTabCorners(ATabVisibleIndex); +end; + +{ TcxPCOffice11Painter } + +class function TcxPCOffice11Painter.GetStyleID: TcxPCStyleID; +begin + Result := cxPCOffice11Style; +end; + +class function TcxPCOffice11Painter.GetStyleName: TCaption; +begin + Result := 'Office11'; +end; + +class function TcxPCOffice11Painter.HasLookAndFeel( + ALookAndFeel: TcxLookAndFeel): Boolean; +begin + with ALookAndFeel do + Result := (ALookAndFeel.SkinPainter = nil) and (GetAvailablePainter([totTab]).LookAndFeelStyle = lfsOffice11); +end; + +class function TcxPCOffice11Painter.GetFrameColor: TColor; +begin + Result := dxOffice11SelectedBorderColor; +end; + +procedure TcxPCOffice11Painter.DrawBackground(ACanvas: TCanvas; ARect: TRect; + ATabVisibleIndex: Integer); +begin + DrawGradientBackground(ACanvas, ARect, ATabVisibleIndex, + ParentInfo.TabPosition in [tpLeft, tpRight], False); +end; + +procedure TcxPCOffice11Painter.ExcludeUnderLine(var R: TRect); +begin +// do nothing +end; + +procedure TcxPCOffice11Painter.FillDisplayRect; +begin + if (ParentInfo.ActivePage <> nil) and not ParentInfo.ActivePage.ParentColor then + begin + ParentInfo.Canvas.Brush.Color := ParentInfo.ActivePage.Color; + ParentInfo.Canvas.FillRect(GetClientRect); + end + else + if IsGradientClienArea then + FillGradientRect(ParentInfo.Canvas.Handle, GetClientRect, + dxOffice11ToolbarsColor1, dxOffice11ToolbarsColor2, + ParentInfo.TabPosition in [tpLeft, tpRight]) + else + begin + ParentInfo.Canvas.Brush.Color := GetMiddleRGB(dxOffice11ToolbarsColor1, dxOffice11ToolbarsColor2, 50); + ParentInfo.Canvas.FillRect(GetClientRect); + end; +end; + +function TcxPCOffice11Painter.GetButtonContentColor( + AButtonState: TcxPCNavigatorButtonState): TColor; +begin + if AButtonState = nbsDisabled then + Result := dxOffice11TextDisabledColor + else + Result := dxOffice11TextEnabledColor; +end; + +function TcxPCOffice11Painter.GetClientRectOffset: TRect; +begin + Result := inherited GetClientRectOffset; + if NeedShowMainTabOppositeRowLine then + Inc(Result.Bottom); +end; + +function TcxPCOffice11Painter.GetFocusRect: TRect; +begin + Result := GetExtendedRect(ParentInfo.VisibleTabs[ParentInfo.MainTabVisibleIndex].FullRect, + Rect(1, 1, 1, 0), ParentInfo.TabPosition); +end; + +function TcxPCOffice11Painter.GetFreeSpaceColor: TColor; +begin + Result := GetFrameColor; +end; + +function TcxPCOffice11Painter.GetMainTabRowUnderlineColor: TColor; +begin + if (ParentInfo.MainTabVisibleIndex <> -1) and + (GetTabColor(ParentInfo.MainTabVisibleIndex) <> clDefault) then + Result := GetTabColor(ParentInfo.MainTabVisibleIndex) + else + if not (pcoGradient in ParentInfo.Options) then + Result := GetMiddleRGB(GetSelectedColor1, GetSelectedColor2, 50) + else + if ParentInfo.TabPosition in [tpTop, tpLeft] then + Result := GetSelectedColor2 + else + Result := GetSelectedColor1; +end; + +function TcxPCOffice11Painter.GetMainTabRowUnderlineRect: TRect; +begin + if ParentInfo.HideTabs or (ParentInfo.RowCount = 0) then + begin + Result := cxEmptyRect; + Exit; + end; + + Result := GetDisplayRect; + SubtractRect(Result, Result, + GetExtendedRect(Result, Rect(0, ExtraFlatPainterMainTabRowUnderlineWidth, 0, 0), ParentInfo.TabPosition)); +end; + +function TcxPCOffice11Painter.GetTabBodyColor(TabVisibleIndex: Integer): TColor; +begin + if ParentInfo.VisibleTabs[TabVisibleIndex].Highlighted then + Result := HighlightedTabBodyColor + else + Result := GetTabColor(TabVisibleIndex); +end; + +function TcxPCOffice11Painter.GetTabsDelimiterOffsets: TcxPCTabsDelimiterOffsets; +begin + if ParentInfo.TabPosition in [tpTop, tpLeft] then + begin + Result.Top := 0; + Result.Bottom := 2; + end + else + begin + Result.Top := 3; + Result.Bottom := -1; + end; +end; + +function TcxPCOffice11Painter.GetTabsDelimiterWidth: Integer; +begin + Result := 2; +end; + +function TcxPCOffice11Painter.GetTabsRowsDelimiterWidth: Integer; +begin + Result := 1; +end; + +function TcxPCOffice11Painter.IsTabTransparent(ATabVisibleIndex: Integer): Boolean; +begin + Result := not (ParentInfo.VisibleTabs[ATabVisibleIndex].IsMainTab or + (GetTabBodyColor(ATabVisibleIndex) <> clDefault)); +end; + +function TcxPCOffice11Painter.NeedRedrawOnResize: Boolean; +begin + Result := IsGradientClienArea; +end; + +function TcxPCOffice11Painter.NeedShowTabsRegionFrame: Boolean; +begin + Result := NeedShowFrame; +end; + +procedure TcxPCOffice11Painter.PaintButtonBackground(AButtonRect: TRect; + AButtonState: TcxPCNavigatorButtonState); +var + AColor1, AColor2: TColor; + ATabsRowRect: TRect; +begin + if not InternalSetClipRect(AButtonRect) then + Exit; + ATabsRowRect := GetTabsRowRect(0); + case AButtonState of + nbsNormal, nbsDisabled: + DrawBackground(ParentInfo.Canvas.Canvas, ATabsRowRect, -1); + nbsPressed, nbsHotTrack: + begin + if AButtonState = nbsHotTrack then + begin + AColor1 := GetSelectedColor1; + AColor2 := GetSelectedColor2; + end + else + begin + AColor1 := dxOffice11SelectedDownColor1; + AColor2 := dxOffice11SelectedDownColor2; + end; + if not (pcoGradient in ParentInfo.Options) then + begin + AColor1 := GetMiddleRGB(AColor1, AColor2, 50); + AColor2 := AColor1; + end; + FillGradientRect(ParentInfo.Canvas.Handle, ATabsRowRect, AColor1, AColor2, + ParentInfo.TabPosition in [tpLeft, tpRight]); + end; + end; + RestoreClipRgn; +end; + +procedure TcxPCOffice11Painter.PaintButtonFrame(var ARect: TRect; + AButtonState: TcxPCNavigatorButtonState); + + function GetFrameColor: TColor; + begin + if not ParentControl.Enabled or (AButtonState = nbsDisabled) then + Result := dxOffice11TextDisabledColor + else + Result := TcxPCOffice11Painter.GetFrameColor; + end; + +begin + ParentInfo.Canvas.FrameRect(ARect, GetFrameColor); + InflateRect(ARect, -1, -1); +end; + +procedure TcxPCOffice11Painter.PaintClientArea; +begin + PaintMainTabOppositeRowLine; + inherited PaintClientArea; +end; + +procedure TcxPCOffice11Painter.PaintFrame; +var + AFrameRect: TRect; +begin + AFrameRect := GetClientRect; + InflateRect(AFrameRect, 1, 1); + ParentInfo.Canvas.FrameRect(AFrameRect, GetFrameColor); +end; + +procedure TcxPCOffice11Painter.PaintMainTabFrame(var R: TRect); +begin + InternalPaintMainTabFrame(R, GetFrameColor, GetFrameColor); +end; + +procedure TcxPCOffice11Painter.PaintTabsDelimiter(const ARect: TRect); + + procedure PaintDelimiterLine(const R: TRect; AColor: TColor); + begin + ParentInfo.Canvas.Brush.Color := AColor; + ParentInfo.Canvas.FillRect(R); + ParentInfo.Canvas.ExcludeClipRect(R); + end; + +var + R: TRect; +begin + R := ARect; + Dec(R.Right); + Dec(R.Bottom); + PaintDelimiterLine(R, dxOffice11BarSeparatorColor1); + OffsetRect(R, 1, 1); + PaintDelimiterLine(R, dxOffice11BarSeparatorColor2); +end; + +procedure TcxPCOffice11Painter.PaintTabsRowsDelimiter(var ARowRect: TRect; + ARowIndex: Integer); +begin + InternalPaintTabsRowsDelimiter(ARowRect, [GetFrameColor]); +end; + +procedure TcxPCOffice11Painter.PrepareDrawTabContentBitmapBackground( + ABitmap: TBitmap; const ABitmapPos: TPoint; ATabVisibleIndex: Integer); +var + P: TPoint; + R: TRect; +begin + R := GetExtendedRect(GetTabBackgroundRect(ATabVisibleIndex, False), + Rect(0, 0, 0, GetTabsRowsDelimiterWidth), ParentInfo.TabPosition); + P := ABitmapPos; + if IsVerticalText(ParentControl) then + begin + R := Rect(R.Top, R.Left, R.Bottom, R.Right); + P := Point(P.Y, P.X); + end; + if ParentInfo.Rotate and (GetTextRotationAngle(ParentControl) = raPlus90) then + OffsetRect(R, -R.Left + P.X + ABitmap.Width - R.Right, -P.Y) + else if not ParentInfo.Rotate and (GetTextRotationAngle(ParentControl) = raMinus90) then + OffsetRect(R, -P.X, -R.Top - (R.Bottom - P.Y - ABitmap.Height)) + else + OffsetRect(R, -P.X, -P.Y); + DrawGradientBackground(ABitmap.Canvas, R, ATabVisibleIndex, ParentInfo.Rotate, + not ParentInfo.Rotate and (GetTextRotationAngle(ParentControl) = raMinus90) or + ParentInfo.Rotate and (GetTextRotationAngle(ParentControl) = raPlus90)); +end; + +procedure TcxPCOffice11Painter.DrawGradientBackground(ACanvas: TCanvas; + ARect: TRect; ATabVisibleIndex: Integer; AHorizontal, AInverse: Boolean); + + procedure GetGradientColors(out AColor1, AColor2: TColor); + begin +// if ParentInfo.IsTabsContainer and ((ATabVisibleIndex = -1) or (ATabVisibleIndex <> ParentInfo.MainTabVisibleIndex)) then +// begin +// AColor1 := ParentInfo.Color; +// AColor2 := AColor1; +// Exit; +// end; + + if (ATabVisibleIndex <> -1) and (ATabVisibleIndex = ParentInfo.MainTabVisibleIndex) then + begin + AColor1 := GetSelectedColor1; + AColor2 := GetSelectedColor2; + end + else + begin + AColor1 := dxOffice11ToolbarsColor1; + AColor2 := dxOffice11ToolbarsColor2; + end; + + if not (pcoGradient in ParentInfo.Options) then + begin + AColor1 := GetMiddleRGB(AColor1, AColor2, 50); + AColor2 := AColor1; + end + else + if AInverse then + ExchangeValues(AColor1, AColor2); + end; + + procedure DrawColoredTabBackground; + var + AColor1, AColor2: TColor; + begin + GetGradientColors(AColor1, AColor2); + if ATabVisibleIndex <> ParentInfo.MainTabVisibleIndex then + case ParentInfo.VisibleTabs[ATabVisibleIndex].PaintingPosition of + tpTop: + begin + InternalPolyLine([Point(ARect.Left, ARect.Bottom - 1), Point(ARect.Right - 1, ARect.Bottom - 1)], AColor2, ACanvas); + Dec(ARect.Bottom); + end; + tpBottom: + begin + InternalPolyLine([Point(ARect.Left, ARect.Top), Point(ARect.Right - 1, ARect.Top)], AColor1, ACanvas); + Inc(ARect.Top); + end; + tpLeft: + begin + InternalPolyLine([Point(ARect.Right - 1, ARect.Top), Point(ARect.Right - 1, ARect.Bottom - 1)], AColor2, ACanvas); + Dec(ARect.Right); + end; + tpRight: + begin + InternalPolyLine([Point(ARect.Left, ARect.Top), Point(ARect.Left, ARect.Bottom - 1)], AColor1, ACanvas); + Inc(ARect.Left); + end; + end; + ACanvas.Brush.Color := GetTabBodyColor(ATabVisibleIndex); + ACanvas.FillRect(ARect); + end; + +var + AColor1, AColor2: TColor; +begin + if (ATabVisibleIndex <> -1) and (GetTabBodyColor(ATabVisibleIndex) <> clDefault) then + DrawColoredTabBackground + else + begin + GetGradientColors(AColor1, AColor2); + FillGradientRect(ACanvas.Handle, ARect, AColor1, AColor2, AHorizontal); + end; +end; + +function TcxPCOffice11Painter.GetSelectedColor1: TColor; +begin + Result := dxOffice11SelectedColor1; +end; + +function TcxPCOffice11Painter.GetSelectedColor2: TColor; +begin + Result := dxOffice11SelectedColor2; +end; + +function TcxPCOffice11Painter.IsGradientClienArea: Boolean; +begin + Result := ParentInfo.Options * [pcoGradient, pcoGradientClientArea] = [pcoGradient, pcoGradientClientArea]; +end; + +function TcxPCOffice11Painter.NeedShowMainTabOppositeRowLine: Boolean; +begin + Result := not NeedShowFrame and + ((ParentInfo.TabPosition in [tpTop, tpLeft]) and (ParentInfo.TopOrLeftPartRowCount <> ParentInfo.RowCount) or + (ParentInfo.TabPosition in [tpBottom, tpRight]) and (ParentInfo.TopOrLeftPartRowCount <> 0)); +end; + +procedure TcxPCOffice11Painter.PaintMainTabOppositeRowLine; +var + ARWidth, ARHeight: Integer; + R: TRect; +begin + if NeedShowMainTabOppositeRowLine then + begin + R := GetExtendedRect(GetClientRect, Rect(0, 0, 0, -1), ParentInfo.TabPosition); + GetRectSize(R, ParentInfo.TabPosition in [tpTop, tpBottom], ARWidth, ARHeight); + DirectionalPolyline(R, [Point(R.Left, R.Bottom - 1), Point(R.Left + ARWidth - 1, R.Bottom - 1)], + ParentInfo.TabPosition, GetFrameColor); + end; +end; + +{ TcxPCSlantedPainter } + +class function TcxPCSlantedPainter.GetStyleID: TcxPCStyleID; +begin + Result := cxPCSlantedStyle; +end; + +class function TcxPCSlantedPainter.GetStyleName: TCaption; +begin + Result := 'Slanted'; +end; + +class function TcxPCSlantedPainter.HasLookAndFeel( + ALookAndFeel: TcxLookAndFeel): Boolean; +begin + Result := False; +end; + +function TcxPCSlantedPainter.AlwaysColoredTabs: Boolean; +begin + Result := True; +end; + +procedure TcxPCSlantedPainter.CalculateButtonContentParameters( + AButton: TcxPCNavigatorButton; out AParameters: TcxPCNavigatorButtonContentParameters); +begin + inherited CalculateButtonContentParameters(AButton, AParameters); + AParameters.Enabled := True; + AParameters.LiteStyle := AButton = nbClose; +end; + +function TcxPCSlantedPainter.CalculateTabNormalWidth(Tab: TcxTab): Integer; +begin + Result := 0; + if not Tab.Visible then + Exit; + if ParentInfo.TabWidth > 0 then + Result := ParentInfo.TabWidth + else + begin + Result := GetTabNormalWidth(Tab.VisibleIndex); + if Tab.Caption <> '' then + begin + Inc(Result, TextSize(Tab, Tab.Caption).cx); + if IsTabHasImage(Tab.VisibleIndex) or IsAssignedImages and ParentInfo.Rotate then + Inc(Result, GetImageTextDistance(Tab.VisibleIndex)); + end; + end; + if Result < GetMinTabNormalWidth(Tab.VisibleIndex)then + Result := GetMinTabNormalWidth(Tab.VisibleIndex); +end; + +procedure TcxPCSlantedPainter.FillDisplayRect; +var + R: TRect; +begin + R := GetClientRect; + if ParentInfo.IsTabsContainer then + ExtendRect(R, RotateRect(Rect(0, -TabsContainerOffset, 0, 0), ParentInfo.TabPosition)); + ParentInfo.Canvas.Brush.Style := bsSolid; + ParentInfo.Canvas.Brush.Color := GetClientColor; + ParentInfo.Canvas.FillRect(R); +end; + +function TcxPCSlantedPainter.GetButtonColor(AButtonState: TcxPCNavigatorButtonState): TColor; +begin + if AButtonState = nbsHotTrack then + Result := GetMiddleRGB(clBtnFace(*ParentInfo.Color*), clWhite, 35) + else + if AButtonState = nbsPressed then + Result := GetMiddleRGB(clBtnFace(*ParentInfo.Color*), clBlack, 90) + else + Result := clBtnFace(*ParentInfo.Color*); +end; + +function TcxPCSlantedPainter.GetButtonContentColor( + AButtonState: TcxPCNavigatorButtonState): TColor; +begin + if (AButtonState = nbsDisabled) or not ParentControl.Enabled then + Result := clBtnShadow + else + if AButtonState = nbsPressed then + Result := GetMiddleRGB(ParentInfo.Color, clWhite, 10) + else + Result := clBtnText; +end; + +function TcxPCSlantedPainter.GetButtonContentPosition( + AButton: TcxPCNavigatorButton): TPoint; +begin + Result := GetButtonCenteredContentPosition(AButton); +end; + +function TcxPCSlantedPainter.GetButtonHeight: Integer; +begin + Result := SlantedPainterButtonHeight; +end; + +function TcxPCSlantedPainter.GetButtonsDistance( + AButton1, AButton2: TcxPCNavigatorButton): Integer; +begin + if IsOneOfButtons(AButton1, AButton2, nbClose) then + Result := 3 + else + Result := 1; +end; + +function TcxPCSlantedPainter.GetButtonsRegionFromTabsOffset: Integer; +begin + Result := 1; +end; + +function TcxPCSlantedPainter.GetButtonsRegionHOffset: Integer; +begin + if ParentInfo.IsTabsContainer then + Result := TabsContainerOffset + else + Result := 1; +end; + +function TcxPCSlantedPainter.GetButtonsRegionWOffset: Integer; +begin + Result := 0; + if ParentInfo.IsTabsContainer then + Result := TabsContainerOffset; +end; + +function TcxPCSlantedPainter.GetButtonWidth(Button: TcxPCNavigatorButton): Integer; +begin + Result := SlantedPainterButtonWidthA[Button]; +end; + +function TcxPCSlantedPainter.GetClientColor: TColor; +begin + if not ParentInfo.IsTabsContainer or (ParentInfo.MainTabVisibleIndex = -1) then + Result := inherited GetClientColor + else + begin + Result := GetTabColor(ParentInfo.MainTabVisibleIndex); + if Result = clDefault then + if ParentInfo.IsTabsContainer then + Result := cxPCTabBodyColor + else + Result := ParentInfo.Color; + end; +end; + +function TcxPCSlantedPainter.GetClientRectOffset: TRect; +begin + Result := inherited GetClientRectOffset; + if not ParentInfo.HideTabs and (ParentInfo.RowCount > 0) and ParentInfo.IsTabsContainer then + Inc(Result.Top, TabsContainerOffset); + if not NeedShowFrame and not ParentInfo.HideTabs and (ParentInfo.RowCount > 0) then + begin + Inc(Result.Top); + if ParentInfo.TabsOnBothSides then + Inc(Result.Bottom); + end; +end; + +function TcxPCSlantedPainter.GetDefaultTabNormalHeight: Integer; +begin + Result := 0; +end; + +function TcxPCSlantedPainter.GetDrawImageOffset(TabVisibleIndex: Integer): TRect; +begin + if ParentInfo.Rotate then + if (ParentInfo.TabSlants.Kind = skSlant) or (ParentInfo.TabSlants.Positions = []) then + begin + Result.Top := GetFrameWidth + 1; + Result.Bottom := GetFrameWidth + 1; + end + else + begin + Result.Top := GetFrameWidth + 2; + Result.Bottom := GetFrameWidth + 2; + end + else + Result := Rect(0, SlantedPainterTabStateMarkWidth + GetFrameWidth, 0, 1); +end; + +function TcxPCSlantedPainter.GetDrawTextHOffset(TabVisibleIndex: Integer): TRect; +begin + if ParentInfo.Rotate then + Result := Rect(0, GetFrameWidth + 3, 0, GetFrameWidth + 1) + else + Result := Rect(0, SlantedPainterTabStateMarkWidth + GetFrameWidth + 1, 0, 1); +end; + +function TcxPCSlantedPainter.GetFrameWidth: Integer; +begin + Result := 1; +end; + +function TcxPCSlantedPainter.GetImageTextDistance(ATabVisibleIndex: Integer): Integer; +begin + Result := 3; +end; + +function TcxPCSlantedPainter.GetMinTabNormalWidth(ATabVisibleIndex: Integer): Integer; +begin + Result := GetTabNormalWidth(ATabVisibleIndex); +end; + +function TcxPCSlantedPainter.GetTabBodyColor( + TabVisibleIndex: Integer): TColor; +var + ATab: TcxTab; +begin + ATab := ParentInfo.VisibleTabs[TabVisibleIndex]; + if ATab.Highlighted then + Result := HighlightedTabBodyColor + else + begin + Result := GetTabColor(TabVisibleIndex); + if Result = clDefault then + if ParentInfo.IsTabsContainer then + Result := cxPCTabBodyColor + else + Result := ParentInfo.Color; + end; +end; + +function TcxPCSlantedPainter.GetTabClipRgn(ATabVisibleIndex: Integer): TcxRegion; +var + ATab: TcxTab; +begin + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + Result := InternalGetTabClipRegion(ATabVisibleIndex, False); + Result.Combine(TcxRegion.Create(ATab.VisibleRect), roIntersect); + if ParentInfo.VisibleTabs[ATabVisibleIndex].IsMainTab then + Result.Combine(TcxRegion.Create(GetTabUnderlineRect(ATab)), roAdd); +end; + +function TcxPCSlantedPainter.GetTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; + + function GetCutSideOffset: Integer; + begin + if ParentInfo.TabSlants.Kind = skSlant then + Result := GetCutValue + else + Result := CutCornerSize; + end; + +const + AContentOffset = 2; +var + ATab: TcxTab; +begin + if ParentInfo.Rotate then + begin + Result.Left := AContentOffset; + Result.Right := AContentOffset + SlantedPainterTabStateMarkWidth + GetFrameWidth; + if (ParentInfo.TabSlants.Kind = skCutCorner) and (ParentInfo.TabSlants.Positions <> []) then + Inc(Result.Right); + + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + if (ATab.PaintingPosition = tpTop) and (GetTextRotationAngle(ParentControl) = raMinus90) or + (ATab.PaintingPosition = tpBottom) and (GetTextRotationAngle(ParentControl) = raPlus90) or + (ATab.PaintingPosition = tpLeft) then + ExchangeValues(Result.Left, Result.Right); + end + else + begin + Result.Left := AContentOffset + GetFrameWidth; + Result.Right := AContentOffset + GetFrameWidth; + if spLeft in ParentInfo.TabSlants.Positions then + Result.Left := GetCutSideOffset; + if spRight in ParentInfo.TabSlants.Positions then + Result.Right := GetCutSideOffset; + if GetTextRotationAngle(ParentControl) = raMinus90 then + ExchangeValues(Result.Left, Result.Right); + end; +end; + +function TcxPCSlantedPainter.GetTabNormalWidth(ATabVisibleIndex: Integer): Integer; +begin + with GetTabContentWOffset(ATabVisibleIndex) do + Result := Left + Right; + if IsAssignedImages and ((ATabVisibleIndex = -1) or IsTabHasImage(ATabVisibleIndex) or ParentInfo.Rotate) then + Inc(Result, GetTabImageSize.cx); + Result := Max(Result, GetGeometricalMinTabWidth); +end; + +function TcxPCSlantedPainter.GetTabsContainerOffsets: TRect; +begin + Result := cxEmptyRect; + if not ParentInfo.IsTabsContainer then + Exit; + Result := Rect(0, TabsContainerOffset, 0, 0); + case ParentInfo.TabPosition of + tpTop, tpLeft: + begin + Result.Left := TabsContainerOffset - Integer(spLeft in SlantedSides); + Result.Right := TabsContainerOffset - Integer(spRight in SlantedSides); + end; + tpBottom, tpRight: + begin + Result.Left := TabsContainerOffset - Integer(spRight in SlantedSides); + Result.Right := TabsContainerOffset - Integer(spLeft in SlantedSides); + end; + end; +end; + +function TcxPCSlantedPainter.GetTabsNormalDistance: TcxPCDistance; + + function GetSlantCount: Integer; + begin + Result := 0; + if spLeft in SlantedSides then + Inc(Result); + if spRight in SlantedSides then + Inc(Result); + end; + +begin + Result.dh := -3; + if SlantedSides = [] then + Result.dw := 1 + else + Result.dw := -(GetCutValue div 2) * GetSlantCount; + if ParentInfo.Rotate then + RotateTabsDistance(Result); +end; + +function TcxPCSlantedPainter.GetTabsRectOffset: TRect; +begin + Result := cxEmptyRect; + if spLeft in SlantedSides then + begin + if ParentInfo.TabPosition in [tpTop, tpBottom] then + Result.Left := 1 + else + Result.Bottom := 1; + end; + if spRight in SlantedSides then + begin + if ParentInfo.TabPosition in [tpTop, tpBottom] then + Result.Right := 1 + else + Result.Top := 1; + end; +end; + +function TcxPCSlantedPainter.GetTooNarrowTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; +begin + Result := GetTabContentWOffset(ATabVisibleIndex); +end; + +procedure TcxPCSlantedPainter.Init; +begin + inherited Init; + FCutValue := InternalGetCutValue; +end; + +function TcxPCSlantedPainter.InternalCalculateTabNormalHeight: Integer; + + function GetDrawImageTotalHOffset: Integer; + begin + Result := GetDrawImageOffset(-1).Top + GetDrawImageOffset(-1).Bottom; + end; + + function GetDrawTextTotalHOffset: Integer; + begin + Result := GetDrawTextHOffset(-1).Top + GetDrawTextHOffset(-1).Bottom; + end; + +begin + Result := GetMaxTabCaptionHeight + GetDrawTextTotalHOffset; + if Result < GetTabImageSize.cy + GetDrawImageTotalHOffset then + Result := GetTabImageSize.cy + GetDrawImageTotalHOffset; +end; + +function TcxPCSlantedPainter.IsOverTab(TabVisibleIndex: Integer; X, Y: Integer): Boolean; +var + ARegion: TcxRegion; + AFirstIndex, ALastIndex: Integer; +begin + ARegion := GetTabClipRgn(TabVisibleIndex); + Result := ARegion.PtInRegion(X, Y); + ARegion.Free; + + if Result then + begin + InitializeVisibleTabRange(ParentControl, AFirstIndex, ALastIndex); + if (TabVisibleIndex + 1 <= ALastIndex) and + ParentInfo.VisibleTabs[TabVisibleIndex + 1].IsMainTab then + begin + ARegion := GetTabClipRgn(TabVisibleIndex + 1); + Result := not ARegion.PtInRegion(X, Y); + ARegion.Free; + end; + end; +end; + +function TcxPCSlantedPainter.IsTabBorderThick(ATabVisibleIndex: Integer): Boolean; +begin + Result := False; +end; + +procedure TcxPCSlantedPainter.PaintButtonFrame(var ARect: TRect; + AButtonState: TcxPCNavigatorButtonState); + + function GetFrameColor: TColor; + begin + if AButtonState in [nbsNormal, nbsDisabled] then + Result := clBtnShadow + else + Result := clBlack; + end; + +begin + ParentInfo.Canvas.DrawComplexFrame(ARect, GetFrameColor, GetFrameColor); + InflateRect(ARect, -1, -1); +end; + +procedure TcxPCSlantedPainter.PaintFrame; +var + AFrameRect: TRect; +begin + AFrameRect := GetClientRect; + InflateRect(AFrameRect, 1, 1); + if ParentInfo.IsTabsContainer then + ExtendRect(AFrameRect, RotateRect(Rect(0, -TabsContainerOffset, 0, 0), ParentInfo.TabPosition)); + ParentInfo.Canvas.FrameRect(AFrameRect, GetFrameColor); +end; + +procedure TcxPCSlantedPainter.PaintTabShape(TabVisibleIndex: Integer); + + procedure DrawFocusRect; + var + R: TRect; + begin + R := FOutTabImageAndTextData.TabTextRect; + if not IsRectEmpty(R) then + begin + case GetTextRotationAngle(ParentControl) of + ra0: + ExtendRect(R, Rect(-3, -2, -3, -2)); + raPlus90: + ExtendRect(R, Rect(-2, -3, -2, -3)); + raMinus90: + ExtendRect(R, Rect(-2, -3, -2, -3)); + end; + + ParentInfo.Canvas.Brush.Color := GetTabBodyColor(TabVisibleIndex); + InternalDrawFocusRect(TabVisibleIndex, R); + end; + end; + +var + R: TRect; + ATab: TcxTab; +begin + SaveClipRgn; + try + ATab := ParentInfo.VisibleTabs[TabVisibleIndex]; + R := ATab.FullRect; + PaintTabFrame(TabVisibleIndex, R); + ParentInfo.Canvas.SetClipRegion(InternalGetTabClipRegion(TabVisibleIndex, True), roIntersect); + PaintTabStateMark(TabVisibleIndex); + DrawBackground(ParentInfo.Canvas.Canvas, R, TabVisibleIndex, ATab.PaintingPosition in [tpLeft, tpRight], False); + finally + RestoreClipRgn; + end; + if ParentInfo.VisibleTabs[TabVisibleIndex].IsMainTab then + DrawTabUnderline(TabVisibleIndex); + DrawFocusRect; +end; + +procedure TcxPCSlantedPainter.PaintTabsRegion; + + procedure DrawLineBorder(ATabIndexInterval: TcxPCIndexInterval; AIsUpperLine, AIsLowerLine: Boolean); + var + ALineRect: TRect; + ALeftSide, ARightSide, ABottomSide: TcxBorder; + ATabInLine: TcxTab; + begin + ATabInLine := ParentInfo.VisibleTabs[ATabIndexInterval.Left]; + ALineRect := GetExtendedRect(GetTabsLineRect(ATabIndexInterval, AIsLowerLine), + Rect(0, -GetTabsNormalDistance.dh, 0, -1), ATabInLine.PaintingPosition); + + case ATabInLine.PaintingPosition of + tpTop: + begin + ALeftSide := bLeft; + ARightSide := bRight; + ABottomSide := bBottom; + end; + tpBottom: + begin + ALeftSide := bLeft; + ARightSide := bRight; + ABottomSide := bTop; + end; + tpLeft: + begin + ALeftSide := bBottom; + ARightSide := bTop; + ABottomSide := bRight; + end; + else + begin + ALeftSide := bBottom; + ARightSide := bTop; + ABottomSide := bLeft; + end; + end; + + if (spLeft in SlantedSides) and not AIsUpperLine then + DrawBorder(ParentInfo.Canvas, ALineRect, ALeftSide, [GetFrameColor], True); + if (spRight in SlantedSides) and not AIsUpperLine then + DrawBorder(ParentInfo.Canvas, ALineRect, ARightSide, [GetFrameColor], True); + DrawBorder(ParentInfo.Canvas, ALineRect, ABottomSide, [GetFrameColor], True); + end; + + procedure PaintLine(ATabIndexInterval: TcxPCIndexInterval; AIsUpperLine, AIsLowerLine: Boolean); + var + I: Integer; + begin + for I := ATabIndexInterval.Left to ATabIndexInterval.Right do + if I <> ParentInfo.MainTabVisibleIndex then + PaintTab(I); + DrawLineBorder(ATabIndexInterval, AIsUpperLine, AIsLowerLine); + end; + +var + J: Integer; + ALineIndexBoundsA: TcxPCLineIndexBoundsArray; + AFirstIndex, AlastIndex: Integer; +begin + InitializeVisibleTabRange(ParentControl, AFirstIndex, AlastIndex); + + if (ParentInfo.MainTabVisibleIndex <> -1) and + (AFirstIndex <= ParentInfo.MainTabVisibleIndex) and + (ParentInfo.MainTabVisibleIndex <= AlastIndex) then + PaintTab(ParentInfo.MainTabVisibleIndex); + + InitializeLineBoundsArray(ParentControl, ALineIndexBoundsA); + + for J := ParentInfo.TopOrLeftPartRowCount - 1 downto 0 do + PaintLine(ALineIndexBoundsA[J], J = 0, J = ParentInfo.TopOrLeftPartRowCount - 1); + + for J := ParentInfo.TopOrLeftPartRowCount to ParentInfo.RowCount - 1 do + PaintLine(ALineIndexBoundsA[J], J = ParentInfo.RowCount - 1, J = ParentInfo.TopOrLeftPartRowCount); +end; + +procedure TcxPCSlantedPainter.PrepareDrawTabContentBitmapBackground(ABitmap: TBitmap; + const ABitmapPos: TPoint; ATabVisibleIndex: Integer); +var + P: TPoint; + R: TRect; +begin + R := ParentInfo.VisibleTabs[ATabVisibleIndex].FullRect; + P := ABitmapPos; + if IsVerticalText(ParentControl) then + begin + R := Rect(R.Top, R.Left, R.Bottom, R.Right); + P := Point(P.Y, P.X); + end; + + if ParentInfo.Rotate and (GetTextRotationAngle(ParentControl) = raPlus90) then + OffsetRect(R, -R.Left + P.X + ABitmap.Width - R.Right, -P.Y) + else if not ParentInfo.Rotate and (GetTextRotationAngle(ParentControl) = raMinus90) then + OffsetRect(R, -P.X, -R.Top - (R.Bottom - P.Y - ABitmap.Height)) + else + OffsetRect(R, -P.X, -P.Y); + DrawBackground(ABitmap.Canvas, R, ATabVisibleIndex, ParentInfo.Rotate, + not ParentInfo.Rotate and (GetTextRotationAngle(ParentControl) = raMinus90) or + ParentInfo.Rotate and (GetTextRotationAngle(ParentControl) = raPlus90)); +end; + +function TcxPCSlantedPainter.CanLightMainTab: Boolean; +begin + Result := False; +end; + +function TcxPCSlantedPainter.DirectionalGetFigureRegion(const R: TRect; + APoints: array of TPoint; ALinePositions: array of TLinePosition; + ATabPositon: TcxTabPosition; AForContent: Boolean): TcxRegion; + + procedure CorrectPolylineEnd(AIndex: Integer); + begin + with APoints[AIndex] do + case ALinePositions[High(ALinePositions)] of + lpL: + Dec(Y); + lpLT: + begin + Inc(X); + Dec(Y); + end; + lpT: + Inc(X); + lpRT: + begin + Inc(X); + Inc(Y); + end; + lpR: + Inc(Y); + lpRB: + begin + Dec(X); + Inc(Y); + end; + lpB: + Dec(X); + lpLB: + begin + Dec(X); + Dec(Y); + end; + end; + end; + + procedure CorrectPolylineEnds; + begin + CorrectPolylineEnd(High(APoints)); + if (ATabPositon = tpLeft) and (ALinePositions[0] = lpLB) then + begin + Inc(APoints[0].X); + Inc(APoints[0].Y); + end; + end; + + procedure ReorderPoints; + const + ALinePositionConversionTable: array[TcxTabPosition, TLinePosition] of TLinePosition = ( + (lpL, lpLT, lpT, lpRT, lpR, lpRB, lpB, lpLB), + (lpL, lpLB, lpB, lpRB, lpR, lpRB, lpB, lpLB), + (lpB, lpLB, lpL, lpLT, lpT, lpRB, lpB, lpLB), + (lpB, lpRB, lpR, lpRT, lpT, lpRB, lpB, lpLB) + ); + var + ALinePosition: TLinePosition; + I: Integer; + P: TPoint; + begin + case ATabPositon of + tpBottom, tpRight: + begin + for I := 0 to Length(APoints) div 2 - 1 do + begin + P := APoints[I]; + APoints[I] := APoints[High(APoints) - I]; + APoints[High(APoints) - I] := P; + end; + for I := 0 to Length(ALinePositions) div 2 - 1 do + begin + ALinePosition := ALinePositions[I]; + ALinePositions[I] := ALinePositions[High(ALinePositions) - I]; + ALinePositions[High(ALinePositions) - I] := ALinePosition; + end; + end; + end; + for I := 0 to High(ALinePositions) do + ALinePositions[I] := ALinePositionConversionTable[ATabPositon, ALinePositions[I]]; + end; + +begin + RotatePolyline(R, APoints, ATabPositon); + ReorderPoints; + CorrectPolylineEnds; + Result := GetFigureRegion(APoints, ALinePositions, AForContent); +end; + +procedure TcxPCSlantedPainter.DrawBackground(ACanvas: TCanvas; R: TRect; + ATabVisibleIndex: Integer; AHorizontalGradient, AInverseGradient: Boolean); +var + AColor1, AColor2: TColor; + ATab: TcxTab; +begin + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + if ATab.IsMainTab and not (CanLightMainTab and ATab.HotTrack) then + begin + ACanvas.Brush.Color := GetTabBodyColor(ATabVisibleIndex); + ACanvas.FillRect(R); + end + else + begin + if pcoGradient in ParentInfo.Options then + GetBackgroundGradientColors(ATabVisibleIndex, AColor1, AColor2) + else + begin + AColor1 := GetTabBodyColor(ATabVisibleIndex); + AColor2 := AColor1; + end; + if CanLightMainTab and ATab.IsMainTab and ATab.HotTrack and + (ATab.PaintingPosition in [tpBottom, tpRight]) then + ExchangeValues(AColor1, AColor2); + if AInverseGradient then + ExchangeValues(AColor1, AColor2); + FillGradientRect(ACanvas.Handle, R, AColor1, AColor2, AHorizontalGradient); + end; +end; + +procedure TcxPCSlantedPainter.DrawTabUnderline(ATabVisibleIndex: Integer); +var + AFrameColor: TColor; + ARHeight, ARWidth: Integer; + ATab: TcxTab; + P: TPoint; + R: TRect; +begin + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + AFrameColor := GetFrameColor; + ParentInfo.Canvas.Brush.Color := GetTabBodyColor(ATabVisibleIndex); + ParentInfo.Canvas.FillRect(GetTabUnderlineRect(ATab)); + + if ATab.IsMainTab then + begin + R := ATab.FullRect; + if not (spLeft in SlantedSides) then + begin + P := Point(R.Left, R.Bottom); + RotatePoint(R, P, ATab.PaintingPosition); + ParentInfo.Canvas.Pixels[P.X, P.Y] := AFrameColor; + end; + if not (spRight in SlantedSides) then + begin + GetRectSize(R, ATab.PaintingPosition in [tpTop, tpBottom], ARWidth, ARHeight); + P := Point(R.Left + ARWidth - 1, R.Bottom); + RotatePoint(R, P, ATab.PaintingPosition); + ParentInfo.Canvas.Pixels[P.X, P.Y] := AFrameColor; + end; + end; +end; + +procedure TcxPCSlantedPainter.GetBackgroundGradientColors(ATabVisibleIndex: Integer; + out AColor1, AColor2: TColor); +var + ATabColor: TColor; +begin + ATabColor := GetTabBodyColor(ATabVisibleIndex); + if ParentInfo.VisibleTabs[ATabVisibleIndex].HotTrack then + begin + AColor1 := Light(ATabColor, 20); + AColor2 := ATabColor; + end + else + begin + AColor1 := Light(ATabColor, 13); + AColor2 := Dark(ATabColor, 90); + end; +end; + +function TcxPCSlantedPainter.GetCutValue: Integer; +begin + Result := FCutValue; +end; + +function TcxPCSlantedPainter.GetGeometricalMinTabWidth: Integer; + + function GetCutSideCount: Integer; + begin + Result := 0; + if spLeft in ParentInfo.TabSlants.Positions then + Inc(Result); + if spRight in ParentInfo.TabSlants.Positions then + Inc(Result); + end; + +const + MinContentWidth = 4; + RoundedCornerSideWidth = 2; +begin + if ParentInfo.Rotate then + begin + Result := 0; + Exit; + end; + + if ParentInfo.TabSlants.Positions = [] then + Result := RoundedCornerSideWidth * 2 + else + begin + Result := 0; + Inc(Result, GetCutValue * GetCutSideCount); + if ParentInfo.TabSlants.Kind = skSlant then + Inc(Result, RoundedCornerSideWidth * (2 - GetCutSideCount)) + else + Inc(Result, GetFrameWidth * (2 - GetCutSideCount)); + end; + Inc(Result, MinContentWidth); +end; + +function TcxPCSlantedPainter.GetFrameColor: TColor; +begin + Result := clBtnShadow; +end; + +function TcxPCSlantedPainter.GetSlantedSides: TcxTabSlantPositions; +begin + if (ParentInfo.TabSlants.Kind = skSlant) and not ParentInfo.Rotate then + Result := ParentInfo.TabSlants.Positions + else + Result := []; +end; + +procedure TcxPCSlantedPainter.GetTabFramePolyline(ATabVisibleIndex: Integer; + out APoints: TPoints; out ALinePositions: TLinePositions); +var + ARHeight, ARWidth: Integer; + ATab: TcxTab; + R: TRect; +begin + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + R := ATab.FullRect; + GetRectSize(R, ATab.PaintingPosition in [tpTop, tpBottom], ARWidth, ARHeight); + + SetLength(APoints, 0); + SetLength(ALinePositions, 0); + if (spLeft in ParentInfo.TabSlants.Positions) and (not ParentInfo.Rotate or (ParentInfo.TabSlants.Kind = skCutCorner)) then + begin + if ParentInfo.TabSlants.Kind = skSlant then + AddPoints(APoints, [Point(R.Left, R.Bottom - 1), Point(R.Left + (ARHeight - 1), + R.Bottom - ARHeight)], ALinePositions, [lpLT]) + else + AddPoints(APoints, [Point(R.Left, R.Bottom - 1), Point(R.Left, R.Bottom - ARHeight + CutCornerSize), + Point(R.Left + CutCornerSize, R.Bottom - ARHeight)], ALinePositions, [lpL, lpLT]); + end + else + if (ParentInfo.TabSlants.Kind = skSlant) or (ParentInfo.TabSlants.Positions = []) then + AddPoints(APoints, [Point(R.Left, R.Bottom - 1), Point(R.Left, R.Bottom - ARHeight + 2), + Point(R.Left + 2, R.Bottom - ARHeight)], ALinePositions, [lpL, lpLT]) + else + AddPoints(APoints, [Point(R.Left, R.Bottom - 1), Point(R.Left, R.Bottom - ARHeight)], + ALinePositions, [lpL]); + + if (spRight in ParentInfo.TabSlants.Positions) and (not ParentInfo.Rotate or (ParentInfo.TabSlants.Kind = skCutCorner)) then + begin + if ParentInfo.TabSlants.Kind = skSlant then + AddPoints(APoints, [Point(ARWidth + R.Left - 1 - (ARHeight - 1), R.Bottom - ARHeight), + Point(ARWidth + R.Left - 1, R.Bottom - 1)], ALinePositions, [lpT, lpRT]) + else + AddPoints(APoints, [Point(ARWidth + R.Left - CutCornerSize - 1, R.Bottom - ARHeight), + Point(ARWidth + R.Left - 1, R.Bottom - ARHeight + CutCornerSize), Point(ARWidth + R.Left - 1, R.Bottom - 1)], + ALinePositions, [lpT, lpRT, lpR]); + end + else + if (ParentInfo.TabSlants.Kind = skSlant) or (ParentInfo.TabSlants.Positions = []) then + AddPoints(APoints, [Point(ARWidth + R.Left - 3, R.Bottom - ARHeight), + Point(ARWidth + R.Left - 1, R.Bottom - ARHeight + 2), Point(ARWidth + R.Left - 1, R.Bottom - 1)], + ALinePositions, [lpT, lpRT, lpR]) + else + AddPoints(APoints, [Point(ARWidth + R.Left - 1, R.Bottom - ARHeight), + Point(ARWidth + R.Left - 1, R.Bottom - 1)], ALinePositions, [lpT, lpR]); +end; + +function TcxPCSlantedPainter.GetTabImageSize: TSize; + + function CorrectSize(AValue: Integer): Integer; + begin + Result := AValue; + if Result > 0 then + Inc(Result, 2 * ParentInfo.ImageBorder); + end; + +begin + Result.cx := CorrectSize(GetTabBaseImageSize.cx); + Result.cy := CorrectSize(GetTabBaseImageSize.cy); +end; + +function TcxPCSlantedPainter.GetVerticalTextIndent: Integer; +begin + Result := 0; +end; + +function TcxPCSlantedPainter.InternalGetCutValue: Integer; +begin + if ParentInfo.TabSlants.Kind = skSlant then + Result := CalculateTabNormalHeight - 1 + else + Result := CutCornerSize; +end; + +function TcxPCSlantedPainter.InternalGetTabClipRegion(ATabVisibleIndex: Integer; + AForContent: Boolean): TcxRegion; +var + ALinePositions: TLinePositions; + APoints: TPoints; +begin + GetTabFramePolyline(ATabVisibleIndex, APoints, ALinePositions); + Result := DirectionalGetFigureRegion(ParentInfo.VisibleTabs[ATabVisibleIndex].FullRect, + APoints, ALinePositions, ParentInfo.VisibleTabs[ATabVisibleIndex].PaintingPosition, AForContent); +end; + +procedure TcxPCSlantedPainter.PaintTabFrame(ATabVisibleIndex: Integer; + const R: TRect); +var + ARHeight, ARWidth: Integer; + ATabPaintingPosition: TcxTabPosition; + ALinePositions: TLinePositions; + APoints: TPoints; +begin + ATabPaintingPosition := ParentInfo.VisibleTabs[ATabVisibleIndex].PaintingPosition; + GetRectSize(R, ATabPaintingPosition in [tpTop, tpBottom], ARWidth, ARHeight); + GetTabFramePolyline(ATabVisibleIndex, APoints, ALinePositions); + DirectionalPolyline(R, APoints, ATabPaintingPosition, GetFrameColor); +end; + +procedure TcxPCSlantedPainter.PaintTabStateMark(ATabVisibleIndex: Integer); +var + ATab: TcxTab; + R: TRect; +begin + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + if ATab.HotTrack or ATab.IsMainTab then + begin + SubtractRect(R, ATab.FullRect, + GetExtendedRect(ATab.FullRect, Rect(0, GetFrameWidth + SlantedPainterTabStateMarkWidth, 0, 0), ATab.PaintingPosition)); + ParentInfo.Canvas.Brush.Color := clHighlight; + ParentInfo.Canvas.FillRect(R); + ParentInfo.Canvas.ExcludeClipRect(R); + end; +end; + +function TcxPCSlantedPainter.GetTabsLineRect(ATabIndexInterval: TcxPCIndexInterval; AFullRect: Boolean): TRect; + + procedure ExchangeTabs(var ALeftTab, ARightTab: TcxTab); + var + AExchangeTab: TcxTab; + begin + AExchangeTab := ALeftTab; + ALeftTab := ARightTab; + ARightTab := AExchangeTab; + end; + +var + ALeftTab, ARightTab: TcxTab; +begin + ALeftTab := ParentInfo.VisibleTabs[ATabIndexInterval.Left]; + ARightTab := ParentInfo.VisibleTabs[ATabIndexInterval.Right]; + Result := ALeftTab.VisibleRect; + case ParentInfo.TabPosition of + tpTop, tpBottom: + begin + if IsRightToLeftAlignment(ParentControl) then + ExchangeTabs(ALeftTab, ARightTab); + + if not AFullRect and not (spLeft in SlantedSides) then + Result.Left := ALeftTab.VisibleRect.Left + else + Result.Left := 0; + if not AFullRect and not (spRight in SlantedSides) then + Result.Right := ARightTab.VisibleRect.Right + else + Result.Right := ParentControl.Width; + end; + tpLeft, tpRight: + begin + if not IsBottomToTopAlignment(ParentControl) then + ExchangeTabs(ALeftTab, ARightTab); + + if not AFullRect and not (spRight in SlantedSides) then + Result.Top := ARightTab.VisibleRect.Top + else + Result.Top := 0; + if not AFullRect and not (spLeft in SlantedSides) then + Result.Bottom := ALeftTab.VisibleRect.Bottom + else + Result.Bottom := ParentControl.Height; + end; + end; +end; + +function TcxPCSlantedPainter.GetTabUnderlineRect(ATab: TcxTab): TRect; +begin + SubtractRect(Result, + GetExtendedRect(ATab.VisibleRect, Rect(0, 0, 0, -1), ATab.PaintingPosition), + ATab.VisibleRect); +end; + +{ TcxPCOneNotePainter } + +class function TcxPCOneNotePainter.GetStyleID: TcxPCStyleID; +begin + Result := cxPCOneNoteStyle; +end; + +class function TcxPCOneNotePainter.GetStyleName: TCaption; +begin + Result := 'OneNote'; +end; + +class function TcxPCOneNotePainter.HasLookAndFeel(ALookAndFeel: TcxLookAndFeel): Boolean; +begin + Result := False; +end; + +class function TcxPCOneNotePainter.AllowRotate: Boolean; +begin + Result := False; +end; + +function TcxPCOneNotePainter.CanLightMainTab: Boolean; +begin + Result := True; +end; + +procedure TcxPCOneNotePainter.DrawTabUnderline(ATabVisibleIndex: Integer); +var + AColor: TColor; + ARWidth, ARHeight: Integer; + ATab: TcxTab; + R: TRect; +begin + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + if ATab.IsMainTab then + AColor := GetTabBodyColor(ATabVisibleIndex)//ParentInfo.PageColors[ATabVisibleIndex] + else + AColor := GetFrameColor; + R := ATab.FullRect; + GetRectSize(R, ATab.PaintingPosition in [tpTop, tpBottom], ARWidth, ARHeight); + DirectionalPolyline(R, [Point(R.Left, R.Bottom), Point(R.Left, R.Bottom)], + ATab.PaintingPosition, GetMiddleRGB(GetFrameColor, AColor, 50)); + DirectionalPolyline(R, [Point(R.Left + 1, R.Bottom), Point(R.Left + ARWidth - 1, R.Bottom)], + ATab.PaintingPosition, AColor); +end; + +procedure TcxPCOneNotePainter.GetBackgroundGradientColors(ATabVisibleIndex: Integer; + out AColor1, AColor2: TColor); +var + ATabColor: TColor; +begin + ATabColor := GetTabBodyColor(ATabVisibleIndex); + if ParentInfo.VisibleTabs[ATabVisibleIndex].HotTrack then + begin + AColor1 := Light(ATabColor, 20); + AColor2 := ATabColor; + end + else + begin + AColor1 := Light(ATabColor, 13); + AColor2 := Dark(ATabColor, 90); + end; +end; + +function TcxPCOneNotePainter.GetButtonsRegionHOffset: Integer; +begin + Result := 0; + if ParentInfo.IsTabsContainer then + Result := TabsContainerOffset; +end; + +function TcxPCOneNotePainter.GetDrawImageOffset(TabVisibleIndex: Integer): TRect; +begin + Result := Rect(0, OneNotePainterTabFrameWidth + 1, 0, 1); +end; + +function TcxPCOneNotePainter.GetDrawTextHOffset(TabVisibleIndex: Integer): TRect; +begin + Result := Rect(0, OneNotePainterTabFrameWidth + 2, 0, 1); +end; + +function TcxPCOneNotePainter.GetFrameColor: TColor; +begin + Result := OneNoteMainTabBorderColor; +end; + +function TcxPCOneNotePainter.GetGeometricalMinTabWidth: Integer; +const + MinContentWidth = 2; +begin + Result := GetCutValue + MinContentWidth + OneNotePainterTabFrameWidth; +end; + +function TcxPCOneNotePainter.GetSlantedSides: TcxTabSlantPositions; +begin + Result := [spLeft]; +end; + +function TcxPCOneNotePainter.GetTabContentWOffset(ATabVisibleIndex: Integer): TcxPCWOffset; +const + AContentOffset = 2; +begin + Result.Left := GetCutValue; + Result.Right := AContentOffset + OneNotePainterTabFrameWidth; + if GetTextRotationAngle(ParentControl) = raMinus90 then + ExchangeValues(Result.Left, Result.Right); +end; + +function TcxPCOneNotePainter.GetTabsContainerOffsets: TRect; +begin + Result := cxEmptyRect; + if ParentInfo.IsTabsContainer then + Result.Top := TabsContainerOffset; +end; + +function TcxPCOneNotePainter.GetTabsNormalDistance: TcxPCDistance; +begin + Result.dh := -3; + Result.dw := -GetCutValue + 5; +end; + +function TcxPCOneNotePainter.GetTabsRectOffset: TRect; +begin + Result := RotateRect(Rect(4, 0, 4, 0), ParentInfo.TabPosition); +end; + +function TcxPCOneNotePainter.InternalGetCutValue: Integer; +begin + Result := CalculateTabNormalHeight + 2; +end; + +function TcxPCOneNotePainter.InternalGetTabClipRegion(ATabVisibleIndex: Integer; + AForContent: Boolean): TcxRegion; +var + APaintingPosition: TcxTabPosition; + ARHeight, ARWidth: Integer; + R: TRect; +begin + ParentInfo.Canvas.BeginPath; + R := ParentInfo.VisibleTabs[ATabVisibleIndex].FullRect; + APaintingPosition := ParentInfo.VisibleTabs[ATabVisibleIndex].PaintingPosition; + if AForContent then + case APaintingPosition of + tpTop: + begin + Inc(R.Top); + Inc(R.Bottom); + GetRectSize(R, True, ARWidth, ARHeight); + DirectionalPolyline(R, [Point(R.Left + 2, R.Bottom - 1), Point(R.Left + (R.Bottom - R.Top - 2), R.Top + 3), + Point(R.Left + (R.Bottom - R.Top + 2), R.Top + 1), + Point(R.Right - 2, R.Top + 1), Point(R.Right - 2, R.Bottom - 1)], tpTop, clWhite); + end; + tpBottom: + begin + Inc(R.Left); + DirectionalPolyline(R, [Point(R.Left + 2, R.Bottom - 1), Point(R.Left + (R.Bottom - R.Top - 3), R.Top + 4), + Point(R.Left + (R.Bottom - R.Top + 2), R.Top + 1), + Point(R.Right - 2, R.Top + 1), Point(R.Right - 2, R.Bottom - 1)], tpBottom, clWhite); + end; + tpLeft: + begin + Inc(R.Top); + Inc(R.Left); + Inc(R.Right); + GetRectSize(R, False, ARWidth, ARHeight); + DirectionalPolyline(R, [Point(R.Left + 2, R.Bottom - 1), Point(R.Left + (ARHeight - 2), R.Bottom - ARHeight + 3), + Point(R.Left + (ARHeight + 2), R.Bottom - ARHeight + 1), + Point(ARWidth + R.Left - 2, R.Bottom - ARHeight + 1), Point(ARWidth + R.Left - 2, R.Bottom - 1)], tpLeft, clWhite); + end; + tpRight: + begin + Inc(R.Top); + GetRectSize(R, False, ARWidth, ARHeight); + DirectionalPolyline(R, [Point(R.Left + 2, R.Bottom - 1), Point(R.Left + (ARHeight - 1), R.Bottom - ARHeight + 3), + Point(R.Left + (ARHeight + 3), R.Bottom - ARHeight + 1), + Point(ARWidth + R.Left - 2, R.Bottom - ARHeight + 1), Point(ARWidth + R.Left - 2, R.Bottom - 1)], tpRight, clWhite); + end; + end + else + begin + InflateRect(R, 1, 1); + GetRectSize(R, APaintingPosition in [tpTop, tpBottom], ARWidth, ARHeight); + case APaintingPosition of + tpTop: + DirectionalPolyline(R, [Point(R.Left, R.Bottom - 2), Point(R.Left + 1, R.Bottom - 2), + Point(R.Left + (ARHeight - 3), R.Bottom - ARHeight + 3), Point(R.Left + (ARHeight + 2), R.Bottom - ARHeight), + Point(ARWidth + R.Left - 4, R.Bottom - ARHeight), Point(ARWidth + R.Left - 1, R.Bottom - ARHeight + 3), + Point(ARWidth + R.Left - 1, R.Bottom - 1)], tpTop, $9C613B); + tpBottom: + DirectionalPolyline(R, [Point(R.Left, R.Bottom - 2), Point(R.Left + 1, R.Bottom - 2), + Point(R.Left + (ARHeight - 3), R.Bottom - ARHeight + 3), Point(R.Left + (ARHeight + 2), R.Bottom - ARHeight), + Point(ARWidth + R.Left - 4, R.Bottom - ARHeight), Point(ARWidth + R.Left - 1, R.Bottom - ARHeight + 3), + Point(ARWidth + R.Left - 1, R.Bottom - 1)], tpBottom, $9C613B); + tpLeft: + DirectionalPolyline(R, [Point(R.Left, R.Bottom - 2), Point(R.Left + 1, R.Bottom - 2), + Point(R.Left + (ARHeight - 3), R.Bottom - ARHeight + 3), Point(R.Left + (ARHeight + 2), R.Bottom - ARHeight), + Point(ARWidth + R.Left - 5, R.Bottom - ARHeight), Point(ARWidth + R.Left - 1, R.Bottom - ARHeight + 4), + Point(ARWidth + R.Left - 1, R.Bottom - 1)], tpLeft, $9C613B); + tpRight: + DirectionalPolyline(R, [Point(R.Left - 1, R.Bottom - 1), Point(R.Left - 1, R.Bottom - 3), Point(R.Left + 2, R.Bottom - 3), + Point(R.Left + (ARHeight - 2), R.Bottom - ARHeight + 2), Point(R.Left + (ARHeight + 2), R.Bottom - ARHeight), + Point(ARWidth + R.Left - 4, R.Bottom - ARHeight), Point(ARWidth + R.Left - 1, R.Bottom - ARHeight + 3), + Point(ARWidth + R.Left - 1, R.Bottom - 1)], tpRight, $9C613B); + end; + end; + ParentInfo.Canvas.EndPath; + Result := TcxRegion.Create(PathToRegion(ParentInfo.Canvas.Handle)); +end; + +procedure TcxPCOneNotePainter.PaintTabFrame(ATabVisibleIndex: Integer; + const R: TRect); + + procedure PrepareColors(out ABorderColor, AInnerBorderColor1, AInnerBorderColor2: TColor); + var + ATab: TcxTab; + begin + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + if ATab.HotTrack then + begin + ABorderColor := OneNoteTabHotBorderColor; + AInnerBorderColor1 := OneNoteTabHotBorderColor; + AInnerBorderColor2 := OneNoteTabHotBorderColor; + end + else + if ATab.IsMainTab then + begin + ABorderColor := OneNoteMainTabBorderColor; + AInnerBorderColor1 := GetMiddleRGB(clWhite, GetTabBodyColor(ATabVisibleIndex), 60); + AInnerBorderColor2 := GetMiddleRGB(AInnerBorderColor1, GetTabBodyColor(ATabVisibleIndex), 70); + end + else + begin + ABorderColor := OneNoteTabBorderColor; + AInnerBorderColor1 := GetMiddleRGB(clWhite, OneNoteTabInnerBorderColor2, 50); + AInnerBorderColor1 := GetMiddleRGB(AInnerBorderColor1, GetTabBodyColor(ATabVisibleIndex), 50); + AInnerBorderColor2 := GetMiddleRGB(OneNoteTabInnerBorderColor2, GetTabBodyColor(ATabVisibleIndex), 50); + end; + end; + + function GetColorAt(P: TPoint): TColor; + var + ANeighbourTabVisibleIndex: Integer; + begin + RotatePoint(R, P, ParentInfo.VisibleTabs[ATabVisibleIndex].PaintingPosition); + ANeighbourTabVisibleIndex := ParentControl.IndexOfTabAt(P.X, P.Y); + if ANeighbourTabVisibleIndex = -1 then + Result := ParentInfo.Color + else + Result := GetTabBodyColor(ANeighbourTabVisibleIndex); + end; + +var + ABorderColor, AInnerBorderColor1, AInnerBorderColor2: TColor; + ARHeight, ARWidth: Integer; + ATabPaintingPosition: TcxTabPosition; +begin + ATabPaintingPosition := ParentInfo.VisibleTabs[ATabVisibleIndex].PaintingPosition; + GetRectSize(R, ATabPaintingPosition in [tpTop, tpBottom], ARWidth, ARHeight); + PrepareColors(ABorderColor, AInnerBorderColor1, AInnerBorderColor2); + + DirectionalPolyline(R, [Point(R.Left, R.Bottom - 1), Point(R.Left, R.Bottom - 1)], + ATabPaintingPosition, GetMiddleRGB(ABorderColor, GetColorAt(Point(R.Left - 1, R.Bottom - 1)), 25)); + DirectionalPolyline(R, [Point(R.Left + 1, R.Bottom - 1), Point(R.Left + 1, R.Bottom - 1), + Point(R.Left + (ARHeight - 3), R.Bottom - ARHeight + 3), Point(R.Left + (ARHeight + 2), R.Bottom - ARHeight), + Point(ARWidth + R.Left - 3, R.Bottom - ARHeight), Point(ARWidth + R.Left - 1, R.Bottom - ARHeight + 2), + Point(ARWidth + R.Left - 1, R.Bottom - 1)], ATabPaintingPosition, ABorderColor); + DirectionalPolyline(R, [Point(R.Left + (ARHeight + 2), R.Bottom - ARHeight), + Point(R.Left + (ARHeight + 2), R.Bottom - ARHeight)], ATabPaintingPosition, GetMiddleRGB(ABorderColor, GetColorAt(Point(R.Left + (ARHeight + 1), R.Bottom - ARHeight)), 60)); + DirectionalPolyline(R, [Point(R.Left + 2, R.Bottom - 1), Point(R.Left + (ARHeight - 3), R.Bottom - ARHeight + 4), + Point(R.Left + (ARHeight + 2), R.Bottom - ARHeight + 1), + Point(ARWidth + R.Left - 4, R.Bottom - ARHeight + 1)], ATabPaintingPosition, AInnerBorderColor1); + DirectionalPolyline(R, [Point(ARWidth + R.Left - 3, R.Bottom - ARHeight + 1), Point(ARWidth + R.Left - 2, R.Bottom - ARHeight + 2), + Point(ARWidth + R.Left - 2, R.Bottom - 1)], ATabPaintingPosition, AInnerBorderColor2); +end; + +procedure TcxPCOneNotePainter.PaintTabStateMark(ATabVisibleIndex: Integer); +begin + // do nothing +end; + +{ TcxPaletteChangedNotifier } + +procedure TcxPaletteChangedNotifier.DoChanged; +begin + PrepareOneNoteStyleColors; +end; + +initialization + CalculateLightBrushColor; + PrepareOneNoteStyleColors; + FPaletteChangedNotifier := TcxPaletteChangedNotifier.Create(True); + RegisterPCPainterClass(TcxPCTabsPainter); + RegisterPCPainterClass(TcxPCButtonsPainter); + RegisterPCPainterClass(TcxPCFlatButtonsPainter); + RegisterPCPainterClass(TcxPCExtraFlatPainter); + RegisterPCPainterClass(TcxPCUltraFlatPainter); + RegisterPCPainterClass(TcxPCFlatPainter); + RegisterPCPainterClass(TcxPCOffice11Painter); + RegisterPCPainterClass(TcxPCSlantedPainter); + RegisterPCPainterClass(TcxPCOneNotePainter); + +finalization + UnregisterPCPainterClass(TcxPCTabsPainter); + UnregisterPCPainterClass(TcxPCButtonsPainter); + UnregisterPCPainterClass(TcxPCFlatButtonsPainter); + UnregisterPCPainterClass(TcxPCExtraFlatPainter); + UnregisterPCPainterClass(TcxPCUltraFlatPainter); + UnregisterPCPainterClass(TcxPCFlatPainter); + UnregisterPCPainterClass(TcxPCOffice11Painter); + UnregisterPCPainterClass(TcxPCSlantedPainter); + UnregisterPCPainterClass(TcxPCOneNotePainter); + FreeAndNil(FPaletteChangedNotifier); + +end. + diff --git a/official/x.35/ExpressPageControl 2/Sources/cxPCPaintersFactory.pas b/official/x.35/ExpressPageControl 2/Sources/cxPCPaintersFactory.pas new file mode 100644 index 00000000..038c919c --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Sources/cxPCPaintersFactory.pas @@ -0,0 +1,237 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPageControl } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPAGECONTROL AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxPCPaintersFactory; + +{$I cxVer.inc} + +interface + +uses + Classes, Controls, SysUtils, cxClasses, cxLookAndFeels, cxPC, cxPCConsts; + +type + + TcxPCPaintersFactory = class + private + FPainterClassList: TList; + class procedure OutError(SourceMethodName, Msg: string); + function GetPainterClassCount: Integer; + function InternalGetPainterClass(Index: Integer): TcxPCPainterClass; + public + constructor Create; + destructor Destroy; override; + + procedure FreePainterInstance(Painter: TcxPCCustomPainter); + + function GetDefaultStyleID(ALookAndFeel: TcxLookAndFeel): TcxPCStyleID; + function GetPainterClass(const StandardStyle: TcxPCStandardStyle): TcxPCPainterClass; overload; + function GetPainterClass(const StyleID: TcxPCStyleID): TcxPCPainterClass; overload; + function GetPainterClass(const StyleName: TCaption): TcxPCPainterClass; overload; + function GetPainterInstance(PCPainterClass: TcxPCPainterClass; AParent: TcxCustomTabControl): TcxPCCustomPainter; + + function GetStyleID(ALookAndFeel: TcxLookAndFeel): TcxPCStyleID; + + procedure RegisterPCPainterClass(PCPainterClass: TcxPCPainterClass); + procedure UnregisterPCPainterClass(PCPainterClass: TcxPCPainterClass); + + property PainterClassCount: Integer read GetPainterClassCount; + property PainterClasses[Index: Integer]: TcxPCPainterClass read InternalGetPainterClass; + end; + +function PaintersFactory: TcxPCPaintersFactory; +procedure RegisterPCPainterClass(PCPainterClass: TcxPCPainterClass); +procedure UnregisterPCPainterClass(PCPainterClass: TcxPCPainterClass); + +implementation + +var + FPaintersFactory: TcxPCPaintersFactory = nil; + +function PaintersFactory: TcxPCPaintersFactory; +begin + Result := FPaintersFactory; +end; + +procedure RegisterPCPainterClass(PCPainterClass: TcxPCPainterClass); +begin + if FPaintersFactory = nil then + FPaintersFactory := TcxPCPaintersFactory.Create; + FPaintersFactory.RegisterPCPainterClass(PCPainterClass); +end; + +procedure UnregisterPCPainterClass(PCPainterClass: TcxPCPainterClass); +begin + if FPaintersFactory <> nil then + begin + FPaintersFactory.UnregisterPCPainterClass(PCPainterClass); + if FPaintersFactory.PainterClassCount = 0 then + FreeAndNil(FPaintersFactory); + end; +end; + +{ TcxPCPaintersFactory } + +constructor TcxPCPaintersFactory.Create; +begin + inherited Create; + FPainterClassList := TList.Create; +end; + +destructor TcxPCPaintersFactory.Destroy; +begin + FPainterClassList.Free; + inherited Destroy; +end; + +procedure TcxPCPaintersFactory.FreePainterInstance( + Painter: TcxPCCustomPainter); +begin + if Painter <> nil then Painter.Free; +end; + +function TcxPCPaintersFactory.GetDefaultStyleID(ALookAndFeel: TcxLookAndFeel): TcxPCStyleID; +var + I: Integer; +begin + if PainterClassCount = 0 then + OutError('GetDefaultStyleID', scxPCNoRegisteredStyles); + Result := PainterClasses[0].GetStyleID; + for I := PainterClassCount - 1 downto 0 do + if PainterClasses[I].IsDefault(ALookAndFeel) then + begin + Result := PainterClasses[I].GetStyleID; + Break; + end; +end; + +function TcxPCPaintersFactory.GetPainterClass(const StandardStyle: TcxPCStandardStyle): + TcxPCPainterClass; +var + I: Integer; +begin + for I := 0 to PainterClassCount - 1 do + begin + Result := PainterClasses[I]; + if Result.IsStandardStyle and (Result.GetStandardStyle = StandardStyle) then + Exit; + end; + Result := nil; +end; + +function TcxPCPaintersFactory.GetPainterClass(const StyleID: TcxPCStyleID): TcxPCPainterClass; +var + I: Integer; +begin + for I := 0 to PainterClassCount - 1 do + begin + Result := PainterClasses[I]; + if Result.GetStyleID = StyleID then Exit; + end; + Result := nil; +end; + +function TcxPCPaintersFactory.GetPainterClass(const StyleName: TCaption): TcxPCPainterClass; +var + I: Integer; +begin + for I := 0 to PainterClassCount - 1 do + begin + Result := PainterClasses[I]; + if AnsiUpperCase(Result.GetStyleName) = AnsiUpperCase(StyleName) then + Exit; + end; + Result := nil; +end; + +function TcxPCPaintersFactory.GetPainterClassCount: Integer; +begin + Result := FPainterClassList.Count; +end; + +function TcxPCPaintersFactory.GetPainterInstance(PCPainterClass: TcxPCPainterClass; + AParent: TcxCustomTabControl): TcxPCCustomPainter; +begin + if PCPainterClass = nil then + begin + Result := nil; + OutError('GetPainterInstance', scxPCPainterClassError); + end + else + Result := PCPainterClass.Create(AParent); +end; + +function TcxPCPaintersFactory.GetStyleID(ALookAndFeel: TcxLookAndFeel): TcxPCStyleID; +var + I: Integer; +begin + Result := cxPCNoStyle; + for I := PainterClassCount - 1 downto 0 do + if PainterClasses[I].HasLookAndFeel(ALookAndFeel) then + begin + Result := PainterClasses[I].GetStyleID; + Break; + end; +end; + +function TcxPCPaintersFactory.InternalGetPainterClass(Index: Integer): TcxPCPainterClass; +begin + Result := TcxPCPainterClass(FPainterClassList.Items[Index]); +end; + +class procedure TcxPCPaintersFactory.OutError(SourceMethodName, Msg: string); +begin + raise Exception.Create('TcxPCPaintersFactory.' + SourceMethodName + ': ' + Msg); +end; + +procedure TcxPCPaintersFactory.RegisterPCPainterClass( + PCPainterClass: TcxPCPainterClass); +begin + if FPainterClassList.IndexOf(TObject(PCPainterClass)) = -1 then + FPainterClassList.Add(TObject(PCPainterClass)); +end; + +procedure TcxPCPaintersFactory.UnregisterPCPainterClass( + PCPainterClass: TcxPCPainterClass); +begin + FPainterClassList.Remove(TObject(PCPainterClass)); +end; + +initialization + +finalization + FreeAndNil(FPaintersFactory); + +end. diff --git a/official/x.35/ExpressPageControl 2/Sources/cxPCReg.dcr b/official/x.35/ExpressPageControl 2/Sources/cxPCReg.dcr new file mode 100644 index 00000000..17054b7a Binary files /dev/null and b/official/x.35/ExpressPageControl 2/Sources/cxPCReg.dcr differ diff --git a/official/x.35/ExpressPageControl 2/Sources/cxPCReg.pas b/official/x.35/ExpressPageControl 2/Sources/cxPCReg.pas new file mode 100644 index 00000000..b02b1408 --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Sources/cxPCReg.pas @@ -0,0 +1,275 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPageControl } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPAGECONTROL AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxPCReg; + +{$I cxVer.inc} + +interface + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI6} + DesignEditors, DesignIntf, DesignMenus, +{$ELSE} + DsgnIntf, Menus, +{$ENDIF} + Classes, Forms, SysUtils, cxLibraryReg, cxPC, cxPCConsts, cxPCPaintersFactory; + +const + cxPCMajorVersion = '2'; + cxPCProductName = 'ExpressPageControl Suite'; + cxPageControlComponentEditorVerbA: array[0 .. 3] of string = ( + 'New Page', + 'Next Page', + 'Previous Page', + 'Delete Page' + ); + +type + { TcxPCStyleProperty } + + TcxPCStyleProperty = class(TOrdinalProperty) + private + class procedure OutError(SourceMethodName, Msg: string); + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + { TcxTabControlComponentEditor } + + TcxTabControlComponentEditor = class(TcxComponentEditor) + protected + function GetProductMajorVersion: string; override; + function GetProductName: string; override; + end; + + { TcxPageControlActivePageProperty } + + TcxPageControlActivePageProperty = class(TComponentProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + end; + + { TcxPageControlComponentEditor } + + TcxPageControlComponentEditor = class(TcxTabControlComponentEditor) + private + function GetPageControl: TcxPageControl; + protected + function InternalGetVerb(AIndex: Integer): string; override; + function InternalGetVerbCount: Integer; override; + procedure InternalExecuteVerb(AIndex: Integer); override; + + procedure AddPage; + procedure NextPage(GoForward: Boolean); + property PageControl: TcxPageControl read GetPageControl; + public + procedure Edit; override; + procedure PrepareItem(Index: Integer; const AItem: TDesignMenuItem); override; + end; + +{ TcxPCStyleProperty } + +function TcxPCStyleProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paMultiSelect, paRevertable, paSortList, paValueList]; +end; + +function TcxPCStyleProperty.GetValue: string; +begin + Result := GetPCStyleName(GetOrdValue); +end; + +procedure TcxPCStyleProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + Proc(cxPCDefaultStyleName); + for I := 0 to PaintersFactory.PainterClassCount - 1 do + Proc(PaintersFactory.PainterClasses[I].GetStyleName); +end; + +class procedure TcxPCStyleProperty.OutError(SourceMethodName, Msg: string); +begin + raise Exception.Create('TcxPCStyleProperty.' + SourceMethodName + ': ' + Msg); +end; + +procedure TcxPCStyleProperty.SetValue(const Value: string); +var + PainterClass: TcxPCPainterClass; +begin + if Value = cxPCDefaultStyleName then + SetOrdValue(cxPCDefaultStyle) + else + begin + PainterClass := PaintersFactory.GetPainterClass(Value); + if PainterClass = nil then + OutError('SetValue', Format(scxPCStyleNameError, [Value])) + else + SetOrdValue(PainterClass.GetStyleID); + end; +end; + +{ TcxTabControlComponentEditor } + +function TcxTabControlComponentEditor.GetProductMajorVersion: string; +begin + Result := cxPCMajorVersion; +end; + +function TcxTabControlComponentEditor.GetProductName: string; +begin + Result := cxPCProductName; +end; + +{ TcxPageControlActivePageProperty } + +function TcxPageControlActivePageProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList]; +end; + +procedure TcxPageControlActivePageProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; + Component: TComponent; +begin + for I := 0 to Designer.GetRoot.ComponentCount - 1 do + begin + Component := Designer.GetRoot.Components[I]; + if (Component.Name <> '') and (Component is TcxTabSheet) and + (TcxTabSheet(Component).PageControl = GetComponent(0)) then + Proc(Component.Name); + end; +end; + +{ TcxPageControlComponentEditor } + +procedure TcxPageControlComponentEditor.Edit; +begin +end; + +procedure TcxPageControlComponentEditor.PrepareItem(Index: Integer; + const AItem: TDesignMenuItem); +begin + inherited PrepareItem(Index, AItem); + if (Index > 0) and (Index < GetVerbCount - 3) then + if Index < 3 then + AItem.Enabled := PageControl.PageCount > 1 + else + AItem.Enabled := Component is TcxTabSheet; +end; + +function TcxPageControlComponentEditor.InternalGetVerb(AIndex: Integer): string; +begin + Result := cxPageControlComponentEditorVerbA[AIndex]; +end; + +function TcxPageControlComponentEditor.InternalGetVerbCount: Integer; +begin + Result := Length(cxPageControlComponentEditorVerbA); +end; + +procedure TcxPageControlComponentEditor.InternalExecuteVerb(AIndex: Integer); +begin + case AIndex of + 0: AddPage; + 1: NextPage(True); + 2: NextPage(False); + 3: if (PageControl.ActivePage <> nil) then + begin + Designer.SelectComponent(PageControl); + PageControl.ActivePage.Free; + end; + end; +end; + +procedure TcxPageControlComponentEditor.AddPage; +var + Page: TcxTabSheet; +begin + Page := TcxTabSheet.Create(Designer.GetRoot); + Page.Name := Designer.UniqueName(TcxTabSheet.ClassName); + Page.PageControl := PageControl; + Page.ImageIndex := Page.TabIndex; + PageControl.ActivePage := Page; + Designer.SelectComponent(Page); +end; + +procedure TcxPageControlComponentEditor.NextPage(GoForward: Boolean); +var + APrevActivePage: TcxTabSheet; +begin + APrevActivePage := PageControl.ActivePage; + PageControl.SelectNextPage(GoForward, False); + if PageControl.ActivePage <> APrevActivePage then + Designer.SelectComponent(PageControl.ActivePage); +end; + +function TcxPageControlComponentEditor.GetPageControl: TcxPageControl; +begin + if Component is TcxPageControl then + Result := TcxPageControl(Component) + else + Result := TcxTabSheet(Component).PageControl; +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterComponents('Dev Express', [TcxTabControl, TcxPageControl]); + + RegisterComponentEditor(TcxTabControl, TcxTabControlComponentEditor); + RegisterComponentEditor(TcxPageControl, TcxPageControlComponentEditor); + RegisterComponentEditor(TcxTabSheet, TcxPageControlComponentEditor); + + RegisterPropertyEditor(TypeInfo(TcxPCStyleID), nil, '', TcxPCStyleProperty); + RegisterPropertyEditor(TypeInfo(TcxTabSheet), TcxPageControl, 'ActivePage', TcxPageControlActivePageProperty); + + RegisterClass(TcxTabSheet); +end; + +end. diff --git a/official/x.35/ExpressPageControl 2/Sources/cxVer.inc b/official/x.35/ExpressPageControl 2/Sources/cxVer.inc new file mode 100644 index 00000000..a26364cc --- /dev/null +++ b/official/x.35/ExpressPageControl 2/Sources/cxVer.inc @@ -0,0 +1,172 @@ +{$B-} { Complete Boolean Evaluation } +{$R-} { Range-Checking } +{$T-} { Typed @ operator } +{$X+} { Extended syntax } +{$P+} { Open string params } +{$J+} { Writeable structured consts } +{$H+} { Use long strings by default } +{$Q-} { Overflow checking } + +{$DEFINE DXVER500} + +{$IFNDEF CLR} + {$DEFINE OLEDRAGANDDROP} + {$IFNDEF DONTUSEJPEGIMAGE} + {$DEFINE USEJPEGIMAGE} + {$ENDIF} +{$ENDIF} + +{$DEFINE EXPRESSBARS5} + +{$DEFINE VCL} + +{$IFNDEF VER80} + {$IFNDEF VER90} + {$IFNDEF VER93} + {$DEFINE DELPHI3} { Borland Delphi 3.0 } + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER110} { Borland C++Builder 3.0 } + {$DEFINE CBUILDER3} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE DELPHI4} +{$ENDIF} + +{$IFDEF VER125} { Borland C++Builder 4.0 } + {$DEFINE CBUILDER3} + {$DEFINE DELPHI4} + {$DEFINE CBUILDER4} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$IFDEF BCB} { Borland C++Builder 5.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$IFDEF BCB} { Borland C++Builder 6.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} +{$ENDIF} + +{$IFNDEF DELPHI6} + {$DEFINE MSWINDOWS} +{$ENDIF} +{$IFDEF LINUX} + {$UNDEF MSWINDOWS} +{$ENDIF} + +{$IFDEF LINUX} + {$DEFINE KYLIX1} { Borland Kylix 1 } + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF CompilerVersion >= 14} + {$DEFINE KYLIX2} { Borland Kylix 2 } + {$IFEND} + {$IF CompilerVersion >= 14.50} + {$DEFINE KYLIX3} { Borland Kylix 3 } + {$IFEND} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} { Borland Delphi.Net } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} +{$ENDIF} + +{$IFDEF VER170} { Borland Delphi 9.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} +{$ENDIF} + +{$IFDEF VER180} { Borland Delphi 10 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$IFDEF BCB} { Borland C++Builder 10 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Borland Delphi 11 //CodeGear} + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$DEFINE DELPHI11} + {$IFDEF BCB} { Borland C++Builder 11 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$DEFINE CBUILDER11} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFNDEF CLR} + {$IFNDEF BCB} + {$IFDEF DELPHI6} + {$DEFINE REGISTERSHELLCTRLS} + {$ENDIF} + {$ENDIF} + {$IFDEF DELPHI7} + {$WARN UNSAFE_CAST OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_TYPE OFF} + {$ENDIF} +{$ENDIF} + +{$IFDEF REGISTERSHELLCTRLS} + {$DEFINE REGISTERCXSHELLCTRLS} +{$ENDIF} + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} diff --git a/official/x.35/ExpressPrinting System/EULA.txt b/official/x.35/ExpressPrinting System/EULA.txt new file mode 100644 index 00000000..68bee6c2 --- /dev/null +++ b/official/x.35/ExpressPrinting System/EULA.txt @@ -0,0 +1,119 @@ +DEVELOPER EXPRESS INC +ExpressPrinting System(tm) COMPONENT SUITE +Copyright (C) 1999-2008 Developer Express Inc. + +END-USER LICENSE AGREEMENT +FOR ALL SOFTWARE COMPONENT PRODUCT(S) + +IMPORTANT- READ CAREFULLY: This DEVELOPER EXPRESS INC ("DEVEXPRESS") End-User License Agreement ("EULA") is a legal agreement between you, a developer of software applications, ("Developer End User") and DEVEXPRESS for all DEVEXPRESS products, controls, source code, demos, intermediate files, media, printed materials, and "online" or electronic documentation ("SOFTWARE COMPONENT PRODUCT(S)") contained in this installation file. + +DEVEXPRESS grants to you as an individual, a personal, nonexclusive license to install and use the SOFTWARE COMPONENT PRODUCT(S) for the sole purposes of designing, developing, testing, and deploying application programs which you create. By installing, copying, or otherwise using the SOFTWARE COMPONENT PRODUCT(S), you agree to be bound by the terms of this EULA. If you do not agree to any part of the terms of this EULA, DO NOT INSTALL, USE, EVALUATE, OR REPLICATE IN ANY MANNER, ANY PART, FILE OR PORTION OF THE SOFTWARE COMPONENT PRODUCT(S). + +All SOFTWARE COMPONENT PRODUCT(S) is licensed, not sold. If you are an individual, you must acquire an individual license for the SOFTWARE COMPONENT PRODUCT(S) from DEVEXPRESS or its authorized resellers. If you are an entity, you must acquire and assign an individual license for each Developer End User within your organization using and or developing with the SOFTWARE COMPONENT PRODUCT(S) from DEVEXPRESS or its authorized resellers. + +If the SOFTWARE COMPONENT PRODUCT(S) you have obtained is marked as a "TRIAL" or "EVALUATION," you may install one copy of the SOFTWARE COMPONENT PRODUCT(S) for testing purposes for a period of 30 calendar days from the date of installation ("Evaluation Period"). Upon expiration of the Evaluation Period, the SOFTWARE COMPONENT PRODUCT(S) must be uninstalled and all copies destroyed. + +RIGOROUS ENFORCEMENT OF INTELLECTUAL PROPERTY RIGHTS. If the licensed right of use for this SOFTWARE COMPONENT PRODUCT(S) is purchased by you with any intent to reverse engineer, decompile, create derivative works, and the exploitation or unauthorized transfer of, any DEVEXPRESS intellectual property and trade secrets, to include any exposed methods or source code where provided, no licensed right of use shall exist, and any PRODUCT(s) created as a result shall be judged illegal by definition of all applicable law. Any sale or resale of intellectual property or created derivatives so obtained will be prosecuted to the fullest extent of all local, federal and international law. + +1. GRANT OF LICENSE. + +This EULA, if legally executed as defined herein, licenses and so grants the single individual Developer End User the following rights: + +SOFTWARE COMPONENT PRODUCT(S) - Developer End User may install and use the SOFTWARE COMPONENT PRODUCT(S) on a single computer. Developer End User may also install and use the SOFTWARE COMPONENT PRODUCT(S) on a portable computer. + +2. LIMITATIONS ON REVERSE ENGINEERING, DECOMPILATION, AND DISASSEMBLY. + +You may not reverse engineer, decompile, create derivative works, translate, or disassemble the SOFTWARE COMPONENT PRODUCT(S), and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation. You agree to take all reasonable, legal and appropriate measures to prohibit the illegal dissemination of the SOFTWARE COMPONENT PRODUCT(S) or any of its constituent parts and redistributables to the fullest extent of all applicable local, US Codes and International Laws and Treaties regarding anti-circumvention, including but not limited to, the Geneva and Berne World Intellectual Property Organization (WIPO) Diplomatic Conferences. + +3. SEPARATION OF COMPONENTS. + +The SOFTWARE COMPONENT PRODUCT(S) is licensed as a single PRODUCT(s). The SOFTWARE COMPONENT PRODUCT(S) and its constituent parts and any provided redistributables may not be reverse engineered, decompiled, disassembled or separated for use on more than one computer, nor placed for distribution, sale, or resale as individual creations by Developer End User. The provision of source code, if included with the SOFTWARE COMPONENT PRODUCT(S), does not constitute transfer of any legal rights to such code, and resale or distribution of all or any portion of all source code and intellectual property will be prosecuted to the fullest extent of all applicable local, federal and international laws. All DEVEXPRESS libraries, source code, redistributables and other files remain DEVEXPRESS's exclusive property. You may not distribute any files, except those that DEVEXPRESS has expressly designated as Redistributable. + +4. RENTAL. + +You may not rent, lease, or lend the SOFTWARE COMPONENT PRODUCT(S). + +5. TRANSFER. + +You may NOT permanently or temporarily transfer ANY of your rights under this EULA to any individual or entity without prior written approval from DEVEXPRESS. Regardless of any modifications which you make and regardless of how you might compile, link, and/or package your programs, under no circumstances may the libraries, Redistributables, and/or other files of the SOFTWARE COMPONENT PRODUCT(S) (including any portions thereof) be used for developing programs by anyone other than you. Only you as the licensed Developer End User have the right to use the libraries, redistributables, or other files of the SOFTWARE COMPONENT PRODUCT(S) (or any portions thereof) for developing programs created with the SOFTWARE COMPONENT PRODUCT(S). In particular, you may not share copies of the Redistributables with other co-developers. You may not reproduce or distribute any DEVEXPRESS documentation without DEVEXPRESS's explicit permission. + +If you are an entity (Company), you must acquire and assign a license to each Developer End User within your organization using and or developing with the SOFTWARE COMPONENT PRODUCT(S). With written notification to DEVEXPRESS, Company may transfer the license obtained for a Developer End User to another Developer End User employed or otherwise engaged by Company if the initial Developer End User is no longer employed or engaged by Company or is reassigned to another function within Company and no longer develops software applications using the SOFTWARE COMPONENT PRODUCT(S). In addition, with written notification to DEVEXPRESS, Company may transfer its license of the SOFTWARE COMPONENT PRODUCT(S) to a successor Company. + +6. ROYALTY FREE REDISTRIBUTION. + +DEVEXPRESS PRODUCT(s) may include certain files ("Redistributable(s)") intended for distribution by you to the users of software applications which you create. Redistributables include, for example, those files identified in printed or on-line documentation as redistributable files, or those files preselected for deployment by an install utility provided with the SOFTWARE COMPONENT PRODUCT(S) (if any). In all circumstances, the Redistributables for the SOFTWARE COMPONENT PRODUCT(S) are only those files specifically designated as such by DEVEXPRESS. + +Subject to all of the terms and conditions in this EULA, you may reproduce and distribute copies of the Redistributables, provided that such copies are made from the original copy of the Redistributables included with the SOFTWARE COMPONENT PRODUCT(S) or modified versions of the Redistributables which are provided to you by DEVEXPRESS or those which you create. Copies of Redistributables may only be distributed with and for the sole purpose of executing application programs permitted under this EULA that you have created using the SOFTWARE COMPONENT PRODUCT(S). + +REDISTRIBUTABLES. To obtain a list of redistributables that apply under this EULA, contact support@devexpress.com + +AT NO TIME MAY DEVELOPER END USER CREATE ANY TOOL, REDISTRIBUTABLE, OR SOFTWARE COMPONENT PRODUCT(S) THAT DIRECTLY OR INDIRECTLY COMPETES WITH DEVEXPRESS SOFTWARE COMPONENT PRODUCT(S) WHICH UTILIZES ALL OR ANY PORTION OF THE SOFTWARE COMPONENT PRODUCT(S) contained within this installation. + +Distribution by the Developer End User of any design-time tools (EXE's OCX's or DLL's), executables, and source code distributed to Developer End User by DEVEXPRESS as part of this SOFTWARE COMPONENT PRODUCT(S) and not explicitly identified as a redistributable file is strictly prohibited. The Developer End User shall not develop software applications that provide an application programming interface to the SOFTWARE COMPONENT PRODUCT(S) or the SOFTWARE COMPONENT PRODUCT(S) as modified. + +The Developer End User may NOT distribute the SOFTWARE COMPONENT PRODUCT(S), in any format, to other users for development or application compilation purposes. Specifically, if Developer End User creates a control using the SOFTWARE COMPONENT PRODUCT(S) as a constituent control, Developer End User may NOT distribute the control created with the SOFTWARE COMPONENT PRODUCT(S) (in any format) to users to be used used at design time and or for ANY development purposes. + +Developer End User MAY NOT REDISTRIBUTE any SOFTWARE COMPONENT PRODUCT(s) files if using an evaluation, trial, Not for Resale, or demo version of the SOFTWARE COMPONENT PRODUCT(s). + +7. UPGRADES. + +If the SOFTWARE COMPONENT PRODUCT(S) is labeled as an upgrade, you must be properly licensed to use the SOFTWARE COMPONENT PRODUCT(S) identified by DEVEXPRESS as being eligible for the upgrade in order to use the SOFTWARE COMPONENT PRODUCT(S). A SOFTWARE COMPONENT PRODUCT(S) labeled as an upgrade replaces and/or supplements the SOFTWARE COMPONENT PRODUCT(S) that formed the basis for your eligibility for the upgrade, and together constitutes a single PRODUCT(S). You may use the resulting upgraded PRODUCT(S) only in accordance with all the terms of this EULA. + +8. COPYRIGHT. + +All title and copyrights in and to the SOFTWARE COMPONENT PRODUCT(S) (including but not limited to any copywritten images, demos, source code, intermediate files, packages, photographs, redistributables, animations, video, audio, music, text, and "applets" incorporated into the SOFTWARE COMPONENT PRODUCT(S) the accompanying printed materials, and any copies of the SOFTWARE COMPONENT PRODUCT(S)) are owned by DEVEXPRESS or its subsidiaries. The SOFTWARE COMPONENT PRODUCT(S) is protected by copyright laws and international treaty provisions and therefore, you must treat the SOFTWARE COMPONENT PRODUCT(S) like any other copyrighted material except that you may install the SOFTWARE COMPONENT PRODUCT(S) as described in this EULA. + +9. DUAL-MEDIA SOFTWARE COMPONENT PRODUCT(S). + +You may receive the SOFTWARE COMPONENT PRODUCT(S) in more than one medium. Regardless of the medium, you may use only one medium that is appropriate for your single computer. You may not loan, sell, rent, lease, or otherwise transfer in any manner the other medium to another user or entity. + +10. U.S. GOVERNMENT RESTRICTED RIGHTS. + +The Licensed Software is Commercial Computer Software provided with RESTRICTED RIGHTS under Federal Acquisition Regulations and agency supplements to them. Use, duplication or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFAR 255.227-7013 et. seq. or 252.211-7015, or subparagraphs (a) through (d) of the Commercial Computer Software Restricted Rights at FAR 52.227-19, as applicable, or similar clauses in the NASA FAR Supplement. Contractor-manufacturer is Developer Express Inc. / 6375 S. Pecos Rd Suite 118, Las Vegas NV 89120. + +11. EXPORT RESTRICTIONS. + +DEVEXPRESS expressly complies with all export restrictions imposed by the government of the United States of America. You, as Developer End User, must agree not to export or re-export the SOFTWARE COMPONENT PRODUCT(S) within any created application to any country, person, entity or end user subject to U.S.A. export restrictions. Restricted countries currently include, but are not necessarily limited to Cuba, Iran, Iraq, Libya, North Korea, Sudan, and Syria. You warrant and represent that neither the U.S.A. Bureau of Export Administration nor any other federal agency has suspended, revoked or denied your export privileges. + +12. NOTE ON JAVA SUPPORT. + +Certain SOFTWARE COMPONENT PRODUCT(S) may contain support for programs written in Java. Java technology is not fault tolerant and is not designed, manufactured, or intended for use or resale as on-line control equipment in hazardous environments requiring fail-safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines, or weapons systems, in which the failure of Java technology could lead directly to death, personal injury, or severe physical or environmental damage. + +13. DISCLAIMER OF WARRANTY. + +DEVEXPRESS expressly disclaims any warranty for the SOFTWARE COMPONENT PRODUCT(S). THE SOFTWARE COMPONENT PRODUCT(S) AND ANY RELATED DOCUMENTATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. DEVEXPRESS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY REPRESENTATIONS REGARDING THE USE, OR THE RESULTS OF THE USE, OF THE SOFTWARE COMPONENT PRODUCT(S) IN TERMS OF CORRECTNESS, ACCURACY, RELIABILITY, OR OTHERWISE. THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE COMPONENT PRODUCT(S) REMAINS WITH YOU. No oral or written information or advice given by DEVEXPRESS or its employees shall create a warranty or in any way increase the scope of this warranty. + +14. LIMITATIONS ON LIABILITY. + +To the maximum extent permitted by applicable law, in no event shall DEVEXPRESS be liable for any special, incidental, indirect, or consequential damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use the SOFTWARE COMPONENT PRODUCT(S) or the provision of or failure to provide Support Services, even if DEVEXPRESS has been advised of the possibility of such damages. + +Developer End User understands that the SOFTWARE COMPONENT PRODUCT(S) may produce inaccurate results because of a failure or fault within the SOFTWARE COMPONENT PRODUCT(S) or failure by Developer End User to properly use and or deploy the SOFTWARE COMPONENT PRODUCT(S). Developer End User assumes full and sole responsibility for any use of the SOFTWARE COMPONENT PRODUCT(S), and bears the entire risk for failures or faults within the SOFTWARE COMPONENT PRODUCT(S). You agree that regardless of the cause of failure or fault or the form of any claim, YOUR SOLE REMEDY AND DEVEXPRESS'S SOLE OBLIGATION SHALL BE GOVERNED BY THIS AGREEMENT AND IN NO EVENT SHALL DEVEXPRESS'S LIABILITY EXCEED THE PRICE PAID TO DEVEXPRESS FOR THE SOFTWARE COMPONENT PRODUCT(S). This Limited Warranty is void if failure of the SOFTWARE COMPONENT PRODUCT(S) has resulted from accident, abuse, alteration, unauthorized use or misapplication of the SOFTWARE COMPONENT PRODUCT(S). + +15. INDEMNIFICATION. + +You hereby agree to indemnify DEVEXPRESS and its officers, directors, employees, agents, and representatives from each and every demand, claim, loss, liability, or damage of any kind, including actual attorneys fees, whether in tort or contract, that it or any of them may incur by reason of, or arising out of, any claim which is made by any third party with respect to any breach or violation of this Agreement by you or any claims based on the Applications and the SOFTWARE COMPONENT PRODUCT(S) included herein. + +16. SUPPORT SERVICES. + +DEVEXPRESS may provide you with support services related to the SOFTWARE COMPONENT PRODUCT(S) ("Support Services"). Use of Support Services is governed by DEVEXPRESS policies and programs described in the user manual, in "on line" documentation and/or other DEVEXPRESS provided materials. Any supplemental SOFTWARE COMPONENT PRODUCT(S) provided to you as part of the Support Services shall be considered part of the SOFTWARE COMPONENT PRODUCT(S) and subject to the terms and conditions of this EULA. With respect to technical information you provide to DEVEXPRESS as part of the Support Services, DEVEXPRESS may use such information for its business purposes, including for SOFTWARE COMPONENT PRODUCT(s) support and development. DEVEXPRESS will not utilize such technical information in a form that personally identifies you. + +17. TERMINATION. + +Without prejudice to any other rights or remedies, DEVEXPRESS will terminate this EULA upon your failure to comply with all the terms and conditions of this EULA. In such events, you must destroy all copies of the SOFTWARE COMPONENT PRODUCT(S) and all of its component parts including any related documentation, and must remove ANY and ALL use of such technology immediately from any applications using technology contained in the SOFTWARE COMPONENT PRODUCT(S) developed by you, whether in native, altered or compiled state. + +18. TAX. + +DEVEXPRESS delivers its software electronically and does not collect sales or use tax for residents of US states in which it operates. You should confirm that your local, state, or federal government does not impose any sales or use tax on electronically delivered software. You are entirely liable for any such sales or use tax. + +19. MISCELLANEOUS. + +This EULA shall be construed, interpreted and governed by the laws of the State of Nevada, U.S.A. This EULA gives you specific legal rights; you may have others that vary from state to state and from country to country. + +This EULA may only be modified in writing signed by you and an authorized officer of DEVELOPER EXPRESS INC. If any provision of this EULA is found void or unenforceable, the remainder will remain valid and enforceable according to its terms. If any remedy provided is determined to have failed for its essential purpose, all limitations of liability and exclusions of damages set forth in the Limited Warranty shall remain in effect. + +DEVEXPRESS reserves all rights not specifically granted in this EULA. + +ACKNOWLEDGEMENTS. Developer End User acknowledges that he or she has read this Agreement, understands it, and agrees to be bound by its terms and conditions. + +Should you have any questions concerning this EULA, or if you desire to contact DEVEXPRESS for any reason, please contact us directly at us in the United States of America at 702-262-0609, or write: Developer Express Inc. Legal department / 6330 McLeod Dr Suite 1, Las Vegas NV 89120. + diff --git a/official/x.35/ExpressPrinting System/Help/EPrnSys.cnt b/official/x.35/ExpressPrinting System/Help/EPrnSys.cnt new file mode 100644 index 00000000..64051d9d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Help/EPrnSys.cnt @@ -0,0 +1,132 @@ +:Base EPrnSys.hlp +:Title ExpressPrinting System 3 +:Index ExpressPrinting System 3=EPrnSys.hlp +1 ExpressPrinting System 3 +2 Overview=IDH_ExpressPrintingSystem_Standard_Edition +2 Installation Notes=IDH_Custom_InstallationNotes +2 How To Get Support=IDH_Support +2 What's new in ExpressScheduler 3 Report Link=What_s_new_in_ExpressScheduler_3_Report_Link +2 What's new in ExpressScheduler 2 Report Link=What_s_new_in_ExpressScheduler_2_Report_Link +2 Quick Start +3 Step 1 - Control Printing Basics=IDH_QuckStart_Step1 +3 Step 2 - Using Report Designers=IDH_QuickStart_Step2 +3 Step 3 - Customizing the Printed Page=IDH_QuickStart_CustomizingPrintedPage +3 Step 4 - Printing Multiple Controls=IDH_QuickStart_PrintingMultipleControls +2 Concepts +3 Custom Drawing the Scheduler's Report=Custom_Drawing_the_Scheduler_s_Report +3 The Scheduler's Report Designer=The_Scheduler_s_Report_Designer +2 Components +3 TdxComponentPrinter=IDH_Class_TdxComponentPrinter +3 TdxPageSetupDialog=IDH_Class_TdxPageSetupDialog +3 TdxPSEngineController=IDH_Class_TdxPSEngineController +3 TdxPrintDialog=IDH_Class_TdxPrintDialog +3 TdxPrintStyleManager=IDH_Class_TdxPrintStyleManager +3 TdxPSFileBasedExplorer=IDH_Class_TdxPSFileBasedExplorer +3 TdxPSDBBasedExplorer=IDH_Class_TdxPSDBBasedExplorer +2 Classes +3 TdxBackground=IDH_Class_TdxBackground +3 TdxBaseObject=IDH_Class_TdxBaseObject +3 TdxCompositionLinkItem=IDH_Class_TdxCompositionLinkItem +3 TdxCompositionLinkItems=IDH_Class_TdxCompositionLinkItems +3 TdxPageFooter=IDH_Class_TdxPageFooter +3 TdxPageHeader=IDH_Class_TdxPageHeader +3 TdxPointWrapper=IDH_Class_TdxPointWrapper +3 TdxPreviewOptions=IDH_Class_TdxPreviewOptions +3 TdxPrinterPage=IDH_Class_TdxPrinterPage +3 TdxPrinterPageObject=IDH_Class_TdxPrinterPageObject +3 TdxPSPrintStyle=IDH_Class_TdxPSPrintStyle +3 TdxRectWrapper=IDH_Class_TdxRectWrapper +2 Report Links +3 TBasedxReportLink=IDH_Class_TBasedxReportLink +3 TdxCompositionReportLink=IDH_Class_TdxCompositionReportLink +3 TdxCheckListBoxReportLink=IDH_Class_TdxCheckListBoxReportLink +3 TdxDBGridReportLink=IDH_Class_TdxDBGridReportLink +3 TdxDBInspectorReportLink=IDH_Class_TdxDBInspectorReportLink +3 TdxDBOrgChartReportLink=IDH_Class_TdxDBOrgChartReportLink +3 TdxDBTeeChartReportLink=IDH_Class_TdxDBTeeChartReportLink +3 TdxDBTreeListReportLink=IDH_Class_TdxDBTreeListReportLink +3 TdxDBTreeViewReportLink=IDH_Class_TdxDBTreeViewReportLink +3 TdxDrawGridReportLink=IDH_Class_TdxDrawGridReportLink +3 TdxFlowChartReportLink=IDH_Class_TdxFlowChartReportLink +3 TdxImageReportLink=IDH_Class_TdxImageReportLink +3 TdxInspectorReportLink=IDH_Class_TdxInspectorReportLink +3 TdxListBoxReportLink=IDH_Class_TdxListBoxReportLink +3 TdxMasterViewReportLink=IDH_Class_TdxMasterViewReportLink +3 TdxOrgChartReportLink=IDH_Class_TdxOrgChartReportLink +3 TdxPictureReportLink=IDH_Class_TdxPictureReportLink +3 TdxRichEditReportLink=IDH_Class_TdxRichEditReportLink +3 TdxRTTIInspectorReportLink=IDH_Class_TdxRTTIInspectorReportLink +3 TdxStringGridReportLink=IDH_Class_TdxStringGridReportLink +3 TdxSpreadSheetBookReportLink=IDH_Class_TdxSpreadSheetBookReportLink +3 TdxSpreadSheetReportLink=IDH_Class_TdxSpreadSheetReportLink +3 TdxTeeChartReportLink=IDH_Class_TdxTeeChartReportLink +3 TdxTreeListReportLink=IDH_Class_TdxTreeListReportLink +3 TdxTreeViewExReportLink=IDH_Class_TdxTreeViewExReportLink +3 TdxTreeViewReportLink=IDH_Class_TdxTreeViewReportLink +3 TrxRichEditReportLink=IDH_Class_TrxRichEditReportLink +3 TdxGridReportLink=IDH_Class_TdxGridReportLink +3 TdxLayoutControlReportLink=IDH_Class_TdxLayoutControlReportLink +3 TcxTreeListReportLink=IDH_Class_TcxTreeListReportLink +3 TcxDBTreeListReportLink=IDH_Class_TcxDBTreeListReportLink +3 TcxVirtualTreeListReportLink=IDH_Class_TcxVirtualTreeListReportLink +3 TcxVerticalGridReportLink=IDH_Class_TcxVerticalGridReportLink +3 TcxDBVerticalGridReportLink=IDH_Class_TcxDBVerticalGridReportLink +3 TcxVirtualVerticalGridReportLink=IDH_Class_TcxVirtualVerticalGridReportLink +3 TcxSchedulerReportLink=IDH_Class_TcxSchedulerReportLink +2 Units +3 dxBase=IDH_Unit_dxBase +3 dxBkGnd=IDH_Unit_dxBkGnd +3 dxPgSDlg=IDH_Unit_dxPgSDlg +3 dxPrnDlg=IDH_Unit_dxPrnDlg +3 dxPrnPg=IDH_Unit_dxPrnPg +3 dxPSChlbxLnk=IDH_Unit_dxPSChlbxLnk +3 dxPSContainerLnk=IDH_Unit_dxPSContainerLnk +3 dxPSCore=IDH_Unit_dxPSCore +3 dxPScxSSLnk=IDH_Unit_dxPScxSSLnk +3 dxPScxTLLnk=IDH_Unit_dxPScxTLLnk +3 dxPScxVGridLnk=IDH_Unit_dxPScxVGridLnk +3 dxPScxScheduler2Lnk=IDH_Unit_dxPScxScheduler2Lnk +3 dxPScxSchedulerLnk=IDH_Unit_dxPScxSchedulerLnk +3 dxPScxScheduler3Lnk=IDH_Unit_dxPScxScheduler3Lnk>Main +3 dxPSDBBasedXplorer=IDH_Unit_dxPSDBBasedXplorer +3 dxPSDBTCLnk=IDH_Unit_dxPSDBTCLnk +3 dxPSDGrLnk=IDH_Unit_dxPSDGrLnk +3 dxPSdxDBCtrlLnk=IDH_Unit_dxPSdxDBCtrlLnk +3 dxPSdxDBGrLnk=IDH_Unit_dxPSdxDBGrLnk +3 dxPSdxDBInsLnk=IDH_Unit_dxPSdxDBInsLnk +3 dxPSdxDBOCLnk=IDH_Unit_dxPSdxDBOCLnk +3 dxPSdxDBTLLnk=IDH_Unit_dxPSdxDBTLLnk +3 dxPSdxDBTVLnk=IDH_Unit_dxPSdxDBTVLnk +3 dxPSdxFCLnk=IDH_Unit_dxPSdxFCLnk +3 dxPSdxInsLnk=IDH_Unit_dxPSdxInsLnk +3 dxPSdxLCLnk=IDH_Unit_dxPSdxLCLnk +3 dxPSdxMVLnk=IDH_Unit_dxPSdxMVLnk +3 dxPSdxOCLnk=IDH_Unit_dxPSdxOCLnk +3 dxPSdxOILnk=IDH_Unit_dxPSdxOILnk +3 dxPSdxTlLnk=IDH_Unit_dxPSdxTlLnk +3 dxPSEngine=IDH_dxPSEngn_dxPSEngine +3 dxPSEngn=IDH_Unit_dxPSEngn +3 dxPSFileBasedXplorer=IDH_Unit_dxPSFileBasedXplorer +3 dxPSImgLnk=IDH_Unit_dxPSImgLnk +3 dxPSGraphicLnk=IDH_Unit_dxPSGraphicLnk +3 dxPSGrLnks=IDH_Unit_dxPSGrLnks +3 dxPSLbxLnk=IDH_Unit_dxPSLbxLnk +3 dxPSRELnk=IDH_Unit_dxPSRELnk +3 dxPSrxRELnk=IDH_Unit_dxPSrxRELnk +3 dxPSStdGrLnk=IDH_Unit_dxPSStdGrLnk +3 dxPSTCLnk=IDH_Unit_dxPSTCLnk +3 dxPSTVLnk=IDH_Unit_dxPSTVLnk +3 dxWrap=IDH_Unit_dxWrap +3 dxPScxGridLnk=IDH_Unit_dxPScxGridLnk +2 Print Styles +3 TBasedxPrintStyle=IDH_Class_TBasedxPrintStyle +3 TdxPSPrintStyle=IDH_Class_TdxPSPrintStyle +3 TcxSchedulerReportLink +4 TcxSchedulerReportLinkDailyPrintStyle=IDH_Class_TcxSchedulerReportLinkDailyPrintStyle>Main +4 TcxSchedulerReportLinkDetailsPrintStyle=IDH_Class_TcxSchedulerReportLinkDetailsPrintStyle>Main +4 TcxSchedulerReportLinkMemoPrintStyle=IDH_Class_TcxSchedulerReportLinkMemoPrintStyle>Main +4 TcxSchedulerReportLinkMonthlyPrintStyle=IDH_Class_TcxSchedulerReportLinkMonthlyPrintStyle>Main +4 TcxSchedulerReportLinkTimeLinePrintStyle=IDH_Class_TcxSchedulerReportLinkTimeLinePrintStyle>Main +4 TcxSchedulerReportLinkTrifoldPrintStyle=IDH_Class_TcxSchedulerReportLinkTrifoldPrintStyle>Main +4 TcxSchedulerReportLinkWeeklyPrintStyle=IDH_Class_TcxSchedulerReportLinkWeeklyPrintStyle>Main +4 TcxSchedulerReportLinkYearlyPrintStyle=IDH_Class_TcxSchedulerReportLinkYearlyPrintStyle>Main diff --git a/official/x.35/ExpressPrinting System/Help/EPrnSys.hlp b/official/x.35/ExpressPrinting System/Help/EPrnSys.hlp new file mode 100644 index 00000000..1e7404b6 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Help/EPrnSys.hlp differ diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC10.bpk b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC10.bpk new file mode 100644 index 00000000..8f175a08 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC10.bpk @@ -0,0 +1,163 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxPSCoreC10.bpl +OBJFILES = dxPSReg.obj dxPSPrVwDsg.obj dxPSfmStlAdd.obj dxPSfmStlDsg.obj dxPSDsgUtils.obj \ + dxPSfmLnkDsg.obj dxPSfmLnkAdde.obj dxPSDsgProxies.obj dxPSDBBasedXplorerReg.obj dcldxPSCoreC10.obj +MAINSOURCE = dcldxPSCoreC10.cpp +RESFILES = dcldxPSCoreC10.res dxPS.dcr +DEFFILE = +RESDEPEN = $(RESFILES) dxPSfmLnkDsg.dfm dxPSfmLnkAdde.dfm \ + dxPSfmStlAdd.dfm dxPSfmStlDsg.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi designide.bpi dxcomnC10.bpi vclx.bpi dxPSCoreC10.bpi \ + cxLibraryC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System by Developer Express Inc." -aa -Tpp -x -Gn -Gl \ + -Gi -Gpd +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=1 +Locale=1033 +CodePage=1252 + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC10.cpp b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC10.cpp new file mode 100644 index 00000000..8e00cd5e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC10.cpp @@ -0,0 +1,32 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxPSCoreC10.res"); +USERES("dxPS.dcr"); +USEPACKAGE("dxcomnC10.bpi"); +USEUNIT("dxPSReg.pas"); +USEUNIT("dxPSPrVwDsg.pas"); +USEUNIT("dxPSDsgProxies.pas"); +USEUNIT("dxPSDsgUtils.pas"); +USEUNIT("dxPSDBBasedXplorerReg.pas"); +USEFORMNS("dxPSfmLnkDsg.pas", Dxpsfmlnkdsg, dxfmReportLinkDesignWindow); +USEFORMNS("dxPSfmLnkAdde.pas", Dxpsfmlnkadde, fmAddEmptyReportLink); +USEFORMNS("dxPSfmStlDsg.pas", Dxpsfmstldsg, dxfmPrintStylesDesignWindow); +USEFORMNS("dxPSfmStlAdd.pas", Dxpsfmstladd, dxfmSelectStyleClass); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("dxPSCoreC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC10.res b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC10.res new file mode 100644 index 00000000..f8abc0b8 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC11.bpk b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC11.bpk new file mode 100644 index 00000000..4f982f36 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC11.bpk @@ -0,0 +1,163 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxPSCoreC11.bpl +OBJFILES = dxPSReg.obj dxPSPrVwDsg.obj dxPSfmStlAdd.obj dxPSfmStlDsg.obj dxPSDsgUtils.obj \ + dxPSfmLnkDsg.obj dxPSfmLnkAdde.obj dxPSDsgProxies.obj dxPSDBBasedXplorerReg.obj dcldxPSCoreC11.obj +MAINSOURCE = dcldxPSCoreC11.cpp +RESFILES = dcldxPSCoreC11.res dxPS.dcr +DEFFILE = +RESDEPEN = $(RESFILES) dxPSfmLnkDsg.dfm dxPSfmLnkAdde.dfm \ + dxPSfmStlAdd.dfm dxPSfmStlDsg.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi designide.bpi dxcomnC11.bpi vclx.bpi dxPSCoreC11.bpi \ + cxLibraryC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System by Developer Express Inc." -aa -Tpp -x -Gn -Gl \ + -Gi -Gpd +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=1 +Locale=1033 +CodePage=1252 + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC11.cpp b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC11.cpp new file mode 100644 index 00000000..21cbf32c --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC11.cpp @@ -0,0 +1,32 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxPSCoreC11.res"); +USERES("dxPS.dcr"); +USEPACKAGE("dxcomnC11.bpi"); +USEUNIT("dxPSReg.pas"); +USEUNIT("dxPSPrVwDsg.pas"); +USEUNIT("dxPSDsgProxies.pas"); +USEUNIT("dxPSDsgUtils.pas"); +USEUNIT("dxPSDBBasedXplorerReg.pas"); +USEFORMNS("dxPSfmLnkDsg.pas", Dxpsfmlnkdsg, dxfmReportLinkDesignWindow); +USEFORMNS("dxPSfmLnkAdde.pas", Dxpsfmlnkadde, fmAddEmptyReportLink); +USEFORMNS("dxPSfmStlDsg.pas", Dxpsfmstldsg, dxfmPrintStylesDesignWindow); +USEFORMNS("dxPSfmStlAdd.pas", Dxpsfmstladd, dxfmSelectStyleClass); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("dxPSCoreC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC11.res b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC11.res new file mode 100644 index 00000000..39e2f910 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC5.bpk b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC5.bpk new file mode 100644 index 00000000..f78abe40 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC5.bpk @@ -0,0 +1,162 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dcldxPSCorec5.bpl +OBJFILES = dxPSReg.obj dxPSPrVwDsg.obj dxPSfmStlAdd.obj dxPSfmStlDsg.obj dxPSDsgUtils.obj \ + dxPSfmLnkDsg.obj dxPSfmLnkAdde.obj dxPSDsgProxies.obj dxPSDBBasedXplorerReg.obj dcldxPSCorec5.obj +RESFILES = dcldxPSCorec5.res dxPS.dcr +DEFFILE = +RESDEPEN = $(RESFILES) dxPSfmLnkDsg.dfm dxPSfmLnkAdde.dfm \ + dxPSfmStlAdd.dfm dxPSfmStlDsg.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib +PACKAGES = VCL50.bpi vcldb50.bpi dcldb50.bpi dxcomnc5.bpi vclx50.bpi dxPSCoreC5.bpi dsnide50.bpi \ + cxLibraryVCLC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd50 -LUdcldb50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System by Developer Express Inc." -aa -Tpp -x -Gn -Gl \ + -Gi -Gpd +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=1 +Locale=1033 +CodePage=1252 + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC5.cpp b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC5.cpp new file mode 100644 index 00000000..4d067679 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC5.cpp @@ -0,0 +1,32 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxPSCorec5.res"); +USERES("dxPS.dcr"); +USEPACKAGE("dxcomnc5.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("dcldb50.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEUNIT("dxPSReg.pas"); +USEUNIT("dxPSPrVwDsg.pas"); +USEUNIT("dxPSDsgProxies"); +USEUNIT("dxPSDsgUtils"); +USEFORMNS("dxPSfmLnkDsg.pas", Dxpsfmlnkdsg, dxfmReportLinkDesignWindow); +USEFORMNS("dxPSfmLnkAdde.pas", Dxpsfmlnkadde, fmAddEmptyReportLink); +USEFORMNS("dxPSfmStlDsg.pas", Dxpsfmstldsg, dxfmPrintStylesDesignWindow); +USEFORMNS("dxPSfmStlAdd.pas", Dxpsfmstladd, dxfmSelectStyleClass); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vclx50.bpi"); +USEPACKAGE("dsnide50.bpi"); +USEPACKAGE("dxPSCoreC5.bpi"); +USEUNIT("dxPSDBBasedXplorerReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC5.res b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC5.res new file mode 100644 index 00000000..98e785a4 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC6.bpk b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC6.bpk new file mode 100644 index 00000000..8f7e4ff6 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC6.bpk @@ -0,0 +1,162 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxPSCoreC6.bpl +OBJFILES = dxPSReg.obj dxPSPrVwDsg.obj dxPSfmStlAdd.obj dxPSfmStlDsg.obj dxPSDsgUtils.obj \ + dxPSfmLnkDsg.obj dxPSfmLnkAdde.obj dxPSDsgProxies.obj dxPSDBBasedXplorerReg.obj dcldxPSCoreC6.obj +RESFILES = dcldxPSCoreC6.res dxPS.dcr +DEFFILE = +RESDEPEN = $(RESFILES) dxPSfmLnkDsg.dfm dxPSfmLnkAdde.dfm \ + dxPSfmStlAdd.dfm dxPSfmStlDsg.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi dcldb.bpi designide.bpi dxcomnC6.bpi vclx.bpi dxPSCoreC6.bpi \ + cxLibraryVCLC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System by Developer Express Inc." -aa -Tpp -x -Gn -Gl \ + -Gi -Gpd +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=1 +Locale=1033 +CodePage=1252 + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC6.cpp b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC6.cpp new file mode 100644 index 00000000..14c5125e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC6.cpp @@ -0,0 +1,33 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxPSCoreC6.res"); +USERES("dxPS.dcr"); +USEPACKAGE("dxcomnC6.bpi"); +USEUNIT("dxPSReg.pas"); +USEUNIT("dxPSPrVwDsg.pas"); +USEUNIT("dxPSDsgProxies.pas"); +USEUNIT("dxPSDsgUtils.pas"); +USEUNIT("dxPSDBBasedXplorerReg.pas"); +USEFORMNS("dxPSfmLnkDsg.pas", Dxpsfmlnkdsg, dxfmReportLinkDesignWindow); +USEFORMNS("dxPSfmLnkAdde.pas", Dxpsfmlnkadde, fmAddEmptyReportLink); +USEFORMNS("dxPSfmStlDsg.pas", Dxpsfmstldsg, dxfmPrintStylesDesignWindow); +USEFORMNS("dxPSfmStlAdd.pas", Dxpsfmstladd, dxfmSelectStyleClass); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("dcldb.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC6.res b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC6.res new file mode 100644 index 00000000..3e54323e Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD10.dpk b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD10.dpk new file mode 100644 index 00000000..4b3c17d8 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD10.dpk @@ -0,0 +1,49 @@ +package dcldxPSCoreD10; + +{$R *.res} +{$R dxPS.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vclx, + vcl, + dxComnD10, + dxPSCoreD10, + dclstd, + dcldb; + +contains + dxPSDsgProxies, + dxPSDsgUtils, + dxPSPrVwDsg, + dxPSfmLnkDsg, + dxPSfmLnkAdde, + dxPSfmStlAdd, + dxPSfmStlDsg, + dxPSReg, + dxPSDBBasedXplorerReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD10.res b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD10.res new file mode 100644 index 00000000..cb84edfb Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD11.dpk b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD11.dpk new file mode 100644 index 00000000..0ec2fae0 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD11.dpk @@ -0,0 +1,49 @@ +package dcldxPSCoreD11; + +{$R *.res} +{$R dxPS.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vclx, + vcl, + dxComnD11, + dxPSCoreD11, + dclstd, + dcldb; + +contains + dxPSDsgProxies, + dxPSDsgUtils, + dxPSPrVwDsg, + dxPSfmLnkDsg, + dxPSfmLnkAdde, + dxPSfmStlAdd, + dxPSfmStlDsg, + dxPSReg, + dxPSDBBasedXplorerReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD11.res b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD11.res new file mode 100644 index 00000000..35b4f5d3 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD5.dpk b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD5.dpk new file mode 100644 index 00000000..10f142e3 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD5.dpk @@ -0,0 +1,49 @@ +package dcldxPSCoreD5; + +{$R *.res} +{$R dxPS.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vclx50, + vcl50, + dxComnD5, + dxPSCoreD5, + dclstd50, + dcldb50; + +contains + dxPSDsgProxies, + dxPSDsgUtils, + dxPSPrVwDsg, + dxPSfmLnkDsg, + dxPSfmLnkAdde, + dxPSfmStlAdd, + dxPSfmStlDsg, + dxPSReg, + dxPSDBBasedXplorerReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD5.res b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD5.res new file mode 100644 index 00000000..ff1c9dee Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD6.dpk b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD6.dpk new file mode 100644 index 00000000..05419f12 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD6.dpk @@ -0,0 +1,49 @@ +package dcldxPSCoreD6; + +{$R *.res} +{$R dxPS.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vclx, + vcl, + dxComnD6, + dxPSCoreD6, + dclstd, + dcldb; + +contains + dxPSDsgProxies, + dxPSDsgUtils, + dxPSPrVwDsg, + dxPSfmLnkDsg, + dxPSfmLnkAdde, + dxPSfmStlAdd, + dxPSfmStlDsg, + dxPSReg, + dxPSDBBasedXplorerReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD6.res b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD6.res new file mode 100644 index 00000000..b5c34ba3 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD7.dpk b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD7.dpk new file mode 100644 index 00000000..fd4b8709 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD7.dpk @@ -0,0 +1,49 @@ +package dcldxPSCoreD7; + +{$R *.res} +{$R dxPS.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vclx, + vcl, + dxComnD7, + dxPSCoreD7, + dclstd, + dcldb; + +contains + dxPSDsgProxies, + dxPSDsgUtils, + dxPSPrVwDsg, + dxPSfmLnkDsg, + dxPSfmLnkAdde, + dxPSfmStlAdd, + dxPSfmStlDsg, + dxPSReg, + dxPSDBBasedXplorerReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD7.res b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD7.res new file mode 100644 index 00000000..1c2e9ab2 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD9.dpk b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD9.dpk new file mode 100644 index 00000000..1eb17c23 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD9.dpk @@ -0,0 +1,49 @@ +package dcldxPSCoreD9; + +{$R *.res} +{$R dxPS.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vclx, + vcl, + dxComnD9, + dxPSCoreD9, + dclstd, + dcldb; + +contains + dxPSDsgProxies, + dxPSDsgUtils, + dxPSPrVwDsg, + dxPSfmLnkDsg, + dxPSfmLnkAdde, + dxPSfmStlAdd, + dxPSfmStlDsg, + dxPSReg, + dxPSDBBasedXplorerReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD9.res b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD9.res new file mode 100644 index 00000000..8e7c7976 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dcldxPSCoreD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC10.bpk new file mode 100644 index 00000000..c29834e7 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC10.bpk @@ -0,0 +1,171 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSCoreC10.bpl +OBJFILES = dxPSGlbl.obj dxPSCore.obj dxPSPrVwStd.obj dxPSRes.obj dxFEFDlg.obj dxBrhDlg.obj dxBase.obj \ + dxPrnPg.obj dxfmClr.obj dxPcPrVw.obj dxPrnDlg.obj dxPreVw.obj \ + dxPPAttr.obj dxPrnDev.obj dxBkgnd.obj dxWrap.obj dxPSUtl.obj \ + dxFmMnPg.obj dxfmZoom.obj dxPgSDlg.obj dxPSImgs.obj dxPSPrVwOpt.obj dxPSfmLnkAdd.obj \ + dxPSfmttl.obj dxPSPopupMan.obj dxfmpnfmt.obj dxfmDTFmt.obj dxPSfmEditDesc.obj \ + dxfmDfnStl.obj dxPSEvnt.obj dxPSESys.obj dxPSEngn.obj dxPSPrVw.obj dxPSForm.obj \ + dxPSGraphicLnk.obj dxPSCompsProvider.obj dxPSCPDsg.obj dxPSfmCompositionAdd.obj \ + dxPSfmCompositionDsg.obj dxPSPgsMnuBld.obj dxfmChFN.obj dxExtCtrlsStrs.obj \ + dxExtctrls.obj dxPSTextOut.obj dxPSBaseGridLnk.obj dxPSEdgePatterns.obj \ + dxPSFillPatterns.obj dxPSContainerLnk.obj dxPSDBBasedXplorer.obj dxPSExtDlgs.obj \ + dxPSFileBasedXplorer.obj dxPSfmReportProperties.obj dxPSShapes.obj dxPSTextLnk.obj \ + dxPSStandardFillPatterns.obj dxPSXplorerTreeView.obj dxPSSngltn.obj dxPSHFToolbarBld.obj \ + dxPSFMAutoHFTextFmt.obj dxPSAutoHFTextMNUBld.obj dxPSCoreC10.obj +MAINSOURCE = dxPSCoreC10.cpp +RESFILES = dxPSCoreC10.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPSPrVwStd.dfm dxFEFDlg.dfm dxfmClr.dfm dxPrnDlg.dfm \ + dxfmZoom.dfm dxPgsDlg.dfm dxBrhDlg.dfm dxfmChFN.dfm dxfmpnfmt.dfm dxfmDTFmt.dfm \ + dxfmDfnStl.dfm dxPSPrVwOpt.dfm dxPSfmttl.dfm dxPSfmEditDesc.dfm dxPSfmLnkAdd.dfm \ + dxPSCPDsg.dfm dxPSfmCompositionAdd.dfm dxPSfmCompositionDsg.dfm dxPSContainerLnk.dfm \ + dxPSTextLnk.dfm dxPSfmReportProperties.dfm dxPSExtDlgs.res +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi dbrtl.bpi dxcomnC10.bpi cxLibraryC10.bpi vcl.bpi vclx.bpi vcljpg.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System by Developer Express Inc." -aa -Tpp -x -Gn -Gpr -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=1 +Locale=1033 +CodePage=1252 + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC10.cpp new file mode 100644 index 00000000..f6e48722 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC10.cpp @@ -0,0 +1,76 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxPSCoreC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("dxcomnC10.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcljpg.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEUNIT("dxPSRes.pas"); +USEUNIT("dxBase.pas"); +USEUNIT("dxPrnPg.pas"); +USEUNIT("dxPSGlbl.pas"); +USEUNIT("dxPcPrVw.pas"); +USEUNIT("dxPreVw.pas"); +USEUNIT("dxPSCore.pas"); +USEUNIT("dxPPAttr.pas"); +USEUNIT("dxPrnDev.pas"); +USEUNIT("dxBkgnd.pas"); +USEUNIT("dxWrap.pas"); +USEUNIT("dxPSUtl.pas"); +USEUNIT("dxFmMnPg.pas"); +USEUNIT("dxPSImgs.pas"); +USEUNIT("dxPSPopupMan.pas"); +USEUNIT("dxPSEvnt.pas"); +USEUNIT("dxPSESys.pas"); +USEUNIT("dxPSEngn.pas"); +USEUNIT("dxPSPrVw.pas"); +USEUNIT("dxPSForm.pas"); +USEUNIT("dxPSPgsMnuBld.pas"); +USEUNIT("dxExtCtrlsStrs.pas"); +USEUNIT("dxExtctrls.pas"); +USEUNIT("dxPSTextOut.pas"); +USEUNIT("dxPSBaseGridLnk.pas"); +USEUNIT("dxPSEdgePatterns.pas"); +USEUNIT("dxPSFillPatterns.pas"); +USEFORMNS("dxPSPrVwStd.pas", Dxpsprvwstd, dxfmStdPreview); +USEFORMNS("dxFEFDlg.pas", Dxfefdlg, dxFEFDialog); +USEFORMNS("dxfmClr.pas", Dxfmclr, dxfmColorPalette); +USEFORMNS("dxPrnDlg.pas", Dxprndlg, fmdxPrintDialog); +USEFORMNS("dxfmZoom.pas", Dxfmzoom, fmZoom); +USEFORMNS("dxPgSDlg.pas", Dxpgsdlg, dxfmPageSetupDialog); +USEFORMNS("dxBrhDlg.pas", Dxbrhdlg, dxBrushDlg); +USEFORMNS("dxfmChFN.pas", Dxfmchfn, fmdxChangeFileName); +USEFORMNS("dxfmpnfmt.pas", Dxfmpnfmt, fmPageNumberFormat); +USEFORMNS("dxfmDTFmt.pas", Dxfmdtfmt, fmDateTimeFormats); +USEFORMNS("dxfmDfnStl.pas", Dxfmdfnstl, fmdxDefinePrintStyles); +USEFORMNS("dxPSPrVwOpt.pas", Dxpsprvwopt, fmOptions); +USEFORMNS("dxPSfmttl.pas", dxPSfmttl, dxfmReportTitleProperties); +USEFORMNS("dxPSfmEditDesc.pas", Dxpsfmeditdesc, dxfmEditDescription); +USEFORMNS("dxPSfmLnkAdd.pas", Dxpsfmlnkadd, dxfmSelectComponent); +USEUNIT("dxPSGraphicLnk.pas"); +USEUNIT("dxPSCompsProvider.pas"); +USEFORMNS("dxPSCPDsg.pas", Dxpscpdsg, dxfmCPDesigner); +USEFORMNS("dxPSfmCompositionAdd.pas", Dxpsfmcompositionadd, dxfmCompositionAddItems); +USEFORMNS("dxPSfmCompositionDsg.pas", Dxpsfmcompositiondsg, dxfmCompositionDesignWindow); +USEUNIT("dxPSContainerLnk.pas"); +USEUNIT("dxPSDBBasedXplorer.pas"); +USEUNIT("dxPSExtDlgs.pas"); +USEUNIT("dxPSFileBasedXplorer.pas"); +USEUNIT("dxPSfmReportProperties.pas"); +USEUNIT("dxPSShapes.pas"); +USEFORMNS("dxPSTextLnk.pas", Dxpstextlnk, dxfmTextReportLinkDesignWindow); +USEUNIT("dxPSStandardFillPatterns.pas"); +USEUNIT("dxPSXplorerTreeView.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreC10.res b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC10.res new file mode 100644 index 00000000..ec752ca4 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC11.bpk new file mode 100644 index 00000000..3aafe76c --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC11.bpk @@ -0,0 +1,171 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSCoreC11.bpl +OBJFILES = dxPSGlbl.obj dxPSCore.obj dxPSPrVwStd.obj dxPSRes.obj dxFEFDlg.obj dxBrhDlg.obj dxBase.obj \ + dxPrnPg.obj dxfmClr.obj dxPcPrVw.obj dxPrnDlg.obj dxPreVw.obj \ + dxPPAttr.obj dxPrnDev.obj dxBkgnd.obj dxWrap.obj dxPSUtl.obj \ + dxFmMnPg.obj dxfmZoom.obj dxPgSDlg.obj dxPSImgs.obj dxPSPrVwOpt.obj dxPSfmLnkAdd.obj \ + dxPSfmttl.obj dxPSPopupMan.obj dxfmpnfmt.obj dxfmDTFmt.obj dxPSfmEditDesc.obj \ + dxfmDfnStl.obj dxPSEvnt.obj dxPSESys.obj dxPSEngn.obj dxPSPrVw.obj dxPSForm.obj \ + dxPSGraphicLnk.obj dxPSCompsProvider.obj dxPSCPDsg.obj dxPSfmCompositionAdd.obj \ + dxPSfmCompositionDsg.obj dxPSPgsMnuBld.obj dxfmChFN.obj dxExtCtrlsStrs.obj \ + dxExtctrls.obj dxPSTextOut.obj dxPSBaseGridLnk.obj dxPSEdgePatterns.obj \ + dxPSFillPatterns.obj dxPSContainerLnk.obj dxPSDBBasedXplorer.obj dxPSExtDlgs.obj \ + dxPSFileBasedXplorer.obj dxPSfmReportProperties.obj dxPSShapes.obj dxPSTextLnk.obj \ + dxPSStandardFillPatterns.obj dxPSXplorerTreeView.obj dxPSSngltn.obj dxPSHFToolbarBld.obj \ + dxPSFMAutoHFTextFmt.obj dxPSAutoHFTextMNUBld.obj dxPSCoreC11.obj +MAINSOURCE = dxPSCoreC11.cpp +RESFILES = dxPSCoreC11.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPSPrVwStd.dfm dxFEFDlg.dfm dxfmClr.dfm dxPrnDlg.dfm \ + dxfmZoom.dfm dxPgsDlg.dfm dxBrhDlg.dfm dxfmChFN.dfm dxfmpnfmt.dfm dxfmDTFmt.dfm \ + dxfmDfnStl.dfm dxPSPrVwOpt.dfm dxPSfmttl.dfm dxPSfmEditDesc.dfm dxPSfmLnkAdd.dfm \ + dxPSCPDsg.dfm dxPSfmCompositionAdd.dfm dxPSfmCompositionDsg.dfm dxPSContainerLnk.dfm \ + dxPSTextLnk.dfm dxPSfmReportProperties.dfm dxPSExtDlgs.res +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi dbrtl.bpi dxcomnC11.bpi cxLibraryC11.bpi vcl.bpi vclx.bpi vcljpg.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System by Developer Express Inc." -aa -Tpp -x -Gn -Gpr -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=1 +Locale=1033 +CodePage=1252 + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC11.cpp new file mode 100644 index 00000000..fab4424c --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC11.cpp @@ -0,0 +1,76 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxPSCoreC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("dxcomnC11.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcljpg.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEUNIT("dxPSRes.pas"); +USEUNIT("dxBase.pas"); +USEUNIT("dxPrnPg.pas"); +USEUNIT("dxPSGlbl.pas"); +USEUNIT("dxPcPrVw.pas"); +USEUNIT("dxPreVw.pas"); +USEUNIT("dxPSCore.pas"); +USEUNIT("dxPPAttr.pas"); +USEUNIT("dxPrnDev.pas"); +USEUNIT("dxBkgnd.pas"); +USEUNIT("dxWrap.pas"); +USEUNIT("dxPSUtl.pas"); +USEUNIT("dxFmMnPg.pas"); +USEUNIT("dxPSImgs.pas"); +USEUNIT("dxPSPopupMan.pas"); +USEUNIT("dxPSEvnt.pas"); +USEUNIT("dxPSESys.pas"); +USEUNIT("dxPSEngn.pas"); +USEUNIT("dxPSPrVw.pas"); +USEUNIT("dxPSForm.pas"); +USEUNIT("dxPSPgsMnuBld.pas"); +USEUNIT("dxExtCtrlsStrs.pas"); +USEUNIT("dxExtctrls.pas"); +USEUNIT("dxPSTextOut.pas"); +USEUNIT("dxPSBaseGridLnk.pas"); +USEUNIT("dxPSEdgePatterns.pas"); +USEUNIT("dxPSFillPatterns.pas"); +USEFORMNS("dxPSPrVwStd.pas", Dxpsprvwstd, dxfmStdPreview); +USEFORMNS("dxFEFDlg.pas", Dxfefdlg, dxFEFDialog); +USEFORMNS("dxfmClr.pas", Dxfmclr, dxfmColorPalette); +USEFORMNS("dxPrnDlg.pas", Dxprndlg, fmdxPrintDialog); +USEFORMNS("dxfmZoom.pas", Dxfmzoom, fmZoom); +USEFORMNS("dxPgSDlg.pas", Dxpgsdlg, dxfmPageSetupDialog); +USEFORMNS("dxBrhDlg.pas", Dxbrhdlg, dxBrushDlg); +USEFORMNS("dxfmChFN.pas", Dxfmchfn, fmdxChangeFileName); +USEFORMNS("dxfmpnfmt.pas", Dxfmpnfmt, fmPageNumberFormat); +USEFORMNS("dxfmDTFmt.pas", Dxfmdtfmt, fmDateTimeFormats); +USEFORMNS("dxfmDfnStl.pas", Dxfmdfnstl, fmdxDefinePrintStyles); +USEFORMNS("dxPSPrVwOpt.pas", Dxpsprvwopt, fmOptions); +USEFORMNS("dxPSfmttl.pas", dxPSfmttl, dxfmReportTitleProperties); +USEFORMNS("dxPSfmEditDesc.pas", Dxpsfmeditdesc, dxfmEditDescription); +USEFORMNS("dxPSfmLnkAdd.pas", Dxpsfmlnkadd, dxfmSelectComponent); +USEUNIT("dxPSGraphicLnk.pas"); +USEUNIT("dxPSCompsProvider.pas"); +USEFORMNS("dxPSCPDsg.pas", Dxpscpdsg, dxfmCPDesigner); +USEFORMNS("dxPSfmCompositionAdd.pas", Dxpsfmcompositionadd, dxfmCompositionAddItems); +USEFORMNS("dxPSfmCompositionDsg.pas", Dxpsfmcompositiondsg, dxfmCompositionDesignWindow); +USEUNIT("dxPSContainerLnk.pas"); +USEUNIT("dxPSDBBasedXplorer.pas"); +USEUNIT("dxPSExtDlgs.pas"); +USEUNIT("dxPSFileBasedXplorer.pas"); +USEUNIT("dxPSfmReportProperties.pas"); +USEUNIT("dxPSShapes.pas"); +USEFORMNS("dxPSTextLnk.pas", Dxpstextlnk, dxfmTextReportLinkDesignWindow); +USEUNIT("dxPSStandardFillPatterns.pas"); +USEUNIT("dxPSXplorerTreeView.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreC11.res b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC11.res new file mode 100644 index 00000000..6becff16 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC5.bpk new file mode 100644 index 00000000..59a5d707 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC5.bpk @@ -0,0 +1,170 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPSCorec5.bpl +OBJFILES = dxPSPrVwStd.obj dxPSRes.obj dxFEFDlg.obj dxBrhDlg.obj dxBase.obj \ + dxPrnPg.obj dxPSGlbl.obj dxfmClr.obj dxPcPrVw.obj dxPrnDlg.obj dxPreVw.obj \ + dxPSCore.obj dxPPAttr.obj dxPrnDev.obj dxBkgnd.obj dxWrap.obj dxPSUtl.obj \ + dxFmMnPg.obj dxfmZoom.obj dxPgSDlg.obj dxPSImgs.obj dxPSPrVwOpt.obj dxPSfmLnkAdd.obj \ + dxPSfmttl.obj dxPSPopupMan.obj dxfmpnfmt.obj dxfmDTFmt.obj dxPSfmEditDesc.obj \ + dxfmDfnStl.obj dxPSEvnt.obj dxPSESys.obj dxPSEngn.obj dxPSPrVw.obj dxPSForm.obj \ + dxPSGraphicLnk.obj dxPSCompsProvider.obj dxPSCPDsg.obj dxPSfmCompositionAdd.obj \ + dxPSfmCompositionDsg.obj dxPSPgsMnuBld.obj dxfmChFN.obj dxExtCtrlsStrs.obj \ + dxExtctrls.obj dxPSTextOut.obj dxPSBaseGridLnk.obj dxPSEdgePatterns.obj \ + dxPSFillPatterns.obj dxPSContainerLnk.obj dxPSDBBasedXplorer.obj dxPSExtDlgs.obj \ + dxPSFileBasedXplorer.obj dxPSfmReportProperties.obj dxPSShapes.obj dxPSTextLnk.obj \ + dxPSStandardFillPatterns.obj dxPSXplorerTreeView.obj dxPSSngltn.obj dxPSHFToolbarBld.obj \ + dxPSFMAutoHFTextFmt.obj dxPSAutoHFTextMNUBld.obj dxPSCoreC5.obj +RESFILES = dxPSCoreC5.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPSPrVwStd.dfm dxFEFDlg.dfm dxfmClr.dfm dxPrnDlg.dfm \ + dxfmZoom.dfm dxPgsDlg.dfm dxBrhDlg.dfm dxfmChFN.dfm dxfmpnfmt.dfm dxfmDTFmt.dfm \ + dxfmDfnStl.dfm dxPSPrVwOpt.dfm dxPSfmttl.dfm dxPSfmEditDesc.dfm dxPSfmLnkAdd.dfm \ + dxPSCPDsg.dfm dxPSfmCompositionAdd.dfm dxPSfmCompositionDsg.dfm dxPSContainerLnk.dfm \ + dxPSTextLnk.dfm dxPSfmReportProperties.dfm dxPSExtDlgs.res +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib +PACKAGES = VCL50.bpi vcldb50.bpi dxcomnc5.bpi cxLibraryVCLC5.bpi vclx50.bpi vcljpg50.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System by Developer Express Inc." -aa -Tpp -x -Gn -Gpr -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=1 +Locale=1033 +CodePage=1252 + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC5.cpp new file mode 100644 index 00000000..3b34cecd --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC5.cpp @@ -0,0 +1,76 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxPSCoreC5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vclx50.bpi"); +USEPACKAGE("dxcomnC5.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("vcljpg50.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEUNIT("dxPSRes.pas"); +USEUNIT("dxBase.pas"); +USEUNIT("dxPrnPg.pas"); +USEUNIT("dxPSGlbl.pas"); +USEUNIT("dxPcPrVw.pas"); +USEUNIT("dxPreVw.pas"); +USEUNIT("dxPSCore.pas"); +USEUNIT("dxPPAttr.pas"); +USEUNIT("dxPrnDev.pas"); +USEUNIT("dxBkgnd.pas"); +USEUNIT("dxWrap.pas"); +USEUNIT("dxPSUtl.pas"); +USEUNIT("dxFmMnPg.pas"); +USEUNIT("dxPSImgs.pas"); +USEUNIT("dxPSPopupMan.pas"); +USEUNIT("dxPSEvnt.pas"); +USEUNIT("dxPSESys.pas"); +USEUNIT("dxPSEngn.pas"); +USEUNIT("dxPSPrVw.pas"); +USEUNIT("dxPSForm.pas"); +USEUNIT("dxPSPgsMnuBld.pas"); +USEUNIT("dxExtCtrlsStrs.pas"); +USEUNIT("dxExtctrls.pas"); +USEUNIT("dxPSTextOut.pas"); +USEUNIT("dxPSBaseGridLnk.pas"); +USEUNIT("dxPSEdgePatterns.pas"); +USEUNIT("dxPSFillPatterns.pas"); +USEFORMNS("dxPSPrVwStd.pas", Dxpsprvwstd, dxfmStdPreview); +USEFORMNS("dxFEFDlg.pas", Dxfefdlg, dxFEFDialog); +USEFORMNS("dxfmClr.pas", Dxfmclr, dxfmColorPalette); +USEFORMNS("dxPrnDlg.pas", Dxprndlg, fmdxPrintDialog); +USEFORMNS("dxfmZoom.pas", Dxfmzoom, fmZoom); +USEFORMNS("dxPgSDlg.pas", Dxpgsdlg, dxfmPageSetupDialog); +USEFORMNS("dxBrhDlg.pas", Dxbrhdlg, dxBrushDlg); +USEFORMNS("dxfmChFN.pas", Dxfmchfn, fmdxChangeFileName); +USEFORMNS("dxfmpnfmt.pas", Dxfmpnfmt, fmPageNumberFormat); +USEFORMNS("dxfmDTFmt.pas", Dxfmdtfmt, fmDateTimeFormats); +USEFORMNS("dxfmDfnStl.pas", Dxfmdfnstl, fmdxDefinePrintStyles); +USEFORMNS("dxPSPrVwOpt.pas", Dxpsprvwopt, fmOptions); +USEFORMNS("dxPSfmttl.pas", dxPSfmttl, dxfmReportTitleProperties); +USEFORMNS("dxPSfmEditDesc.pas", Dxpsfmeditdesc, dxfmEditDescription); +USEFORMNS("dxPSfmLnkAdd.pas", Dxpsfmlnkadd, dxfmSelectComponent); +USEUNIT("dxPSGraphicLnk.pas"); +USEUNIT("dxPSCompsProvider.pas"); +USEFORMNS("dxPSCPDsg.pas", Dxpscpdsg, dxfmCPDesigner); +USEFORMNS("dxPSfmCompositionAdd.pas", Dxpsfmcompositionadd, dxfmCompositionAddItems); +USEFORMNS("dxPSfmCompositionDsg.pas", Dxpsfmcompositiondsg, dxfmCompositionDesignWindow); +USEUNIT("dxPSContainerLnk.pas"); +USEUNIT("dxPSDBBasedXplorer.pas"); +USEUNIT("dxPSExtDlgs.pas"); +USEUNIT("dxPSFileBasedXplorer.pas"); +USEUNIT("dxPSfmReportProperties.pas"); +USEUNIT("dxPSShapes.pas"); +USEFORMNS("dxPSTextLnk.pas", Dxpstextlnk, dxfmTextReportLinkDesignWindow); +USEUNIT("dxPSStandardFillPatterns.pas"); +USEUNIT("dxPSXplorerTreeView.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreC5.res b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC5.res new file mode 100644 index 00000000..58b4bc93 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC6.bpk new file mode 100644 index 00000000..e80dce65 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC6.bpk @@ -0,0 +1,170 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSCorec6.bpl +OBJFILES = dxPSGlbl.obj dxPSCore.obj dxPSPrVwStd.obj dxPSRes.obj dxFEFDlg.obj dxBrhDlg.obj dxBase.obj \ + dxPrnPg.obj dxfmClr.obj dxPcPrVw.obj dxPrnDlg.obj dxPreVw.obj \ + dxPPAttr.obj dxPrnDev.obj dxBkgnd.obj dxWrap.obj dxPSUtl.obj \ + dxFmMnPg.obj dxfmZoom.obj dxPgSDlg.obj dxPSImgs.obj dxPSPrVwOpt.obj dxPSfmLnkAdd.obj \ + dxPSfmttl.obj dxPSPopupMan.obj dxfmpnfmt.obj dxfmDTFmt.obj dxPSfmEditDesc.obj \ + dxfmDfnStl.obj dxPSEvnt.obj dxPSESys.obj dxPSEngn.obj dxPSPrVw.obj dxPSForm.obj \ + dxPSGraphicLnk.obj dxPSCompsProvider.obj dxPSCPDsg.obj dxPSfmCompositionAdd.obj \ + dxPSfmCompositionDsg.obj dxPSPgsMnuBld.obj dxfmChFN.obj dxExtCtrlsStrs.obj \ + dxExtctrls.obj dxPSTextOut.obj dxPSBaseGridLnk.obj dxPSEdgePatterns.obj \ + dxPSFillPatterns.obj dxPSContainerLnk.obj dxPSDBBasedXplorer.obj dxPSExtDlgs.obj \ + dxPSFileBasedXplorer.obj dxPSfmReportProperties.obj dxPSShapes.obj dxPSTextLnk.obj \ + dxPSStandardFillPatterns.obj dxPSXplorerTreeView.obj dxPSSngltn.obj dxPSHFToolbarBld.obj \ + dxPSFMAutoHFTextFmt.obj dxPSAutoHFTextMNUBld.obj dxPSCoreC6.obj +RESFILES = dxPSCoreC6.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPSPrVwStd.dfm dxFEFDlg.dfm dxfmClr.dfm dxPrnDlg.dfm \ + dxfmZoom.dfm dxPgsDlg.dfm dxBrhDlg.dfm dxfmChFN.dfm dxfmpnfmt.dfm dxfmDTFmt.dfm \ + dxfmDfnStl.dfm dxPSPrVwOpt.dfm dxPSfmttl.dfm dxPSfmEditDesc.dfm dxPSfmLnkAdd.dfm \ + dxPSCPDsg.dfm dxPSfmCompositionAdd.dfm dxPSfmCompositionDsg.dfm dxPSContainerLnk.dfm \ + dxPSTextLnk.dfm dxPSfmReportProperties.dfm dxPSExtDlgs.res +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi dbrtl.bpi dxcomnC6.bpi cxLibraryVCLC6.bpi vcl.bpi vclx.bpi vcljpg.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System by Developer Express Inc." -aa -Tpp -x -Gn -Gpr -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=1 +Locale=1033 +CodePage=1252 + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC6.cpp new file mode 100644 index 00000000..e0cc5f2e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC6.cpp @@ -0,0 +1,76 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxPSCoreC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("dxcomnC6.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcljpg.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEUNIT("dxPSRes.pas"); +USEUNIT("dxBase.pas"); +USEUNIT("dxPrnPg.pas"); +USEUNIT("dxPSGlbl.pas"); +USEUNIT("dxPcPrVw.pas"); +USEUNIT("dxPreVw.pas"); +USEUNIT("dxPSCore.pas"); +USEUNIT("dxPPAttr.pas"); +USEUNIT("dxPrnDev.pas"); +USEUNIT("dxBkgnd.pas"); +USEUNIT("dxWrap.pas"); +USEUNIT("dxPSUtl.pas"); +USEUNIT("dxFmMnPg.pas"); +USEUNIT("dxPSImgs.pas"); +USEUNIT("dxPSPopupMan.pas"); +USEUNIT("dxPSEvnt.pas"); +USEUNIT("dxPSESys.pas"); +USEUNIT("dxPSEngn.pas"); +USEUNIT("dxPSPrVw.pas"); +USEUNIT("dxPSForm.pas"); +USEUNIT("dxPSPgsMnuBld.pas"); +USEUNIT("dxExtCtrlsStrs.pas"); +USEUNIT("dxExtctrls.pas"); +USEUNIT("dxPSTextOut.pas"); +USEUNIT("dxPSBaseGridLnk.pas"); +USEUNIT("dxPSEdgePatterns.pas"); +USEUNIT("dxPSFillPatterns.pas"); +USEFORMNS("dxPSPrVwStd.pas", Dxpsprvwstd, dxfmStdPreview); +USEFORMNS("dxFEFDlg.pas", Dxfefdlg, dxFEFDialog); +USEFORMNS("dxfmClr.pas", Dxfmclr, dxfmColorPalette); +USEFORMNS("dxPrnDlg.pas", Dxprndlg, fmdxPrintDialog); +USEFORMNS("dxfmZoom.pas", Dxfmzoom, fmZoom); +USEFORMNS("dxPgSDlg.pas", Dxpgsdlg, dxfmPageSetupDialog); +USEFORMNS("dxBrhDlg.pas", Dxbrhdlg, dxBrushDlg); +USEFORMNS("dxfmChFN.pas", Dxfmchfn, fmdxChangeFileName); +USEFORMNS("dxfmpnfmt.pas", Dxfmpnfmt, fmPageNumberFormat); +USEFORMNS("dxfmDTFmt.pas", Dxfmdtfmt, fmDateTimeFormats); +USEFORMNS("dxfmDfnStl.pas", Dxfmdfnstl, fmdxDefinePrintStyles); +USEFORMNS("dxPSPrVwOpt.pas", Dxpsprvwopt, fmOptions); +USEFORMNS("dxPSfmttl.pas", dxPSfmttl, dxfmReportTitleProperties); +USEFORMNS("dxPSfmEditDesc.pas", Dxpsfmeditdesc, dxfmEditDescription); +USEFORMNS("dxPSfmLnkAdd.pas", Dxpsfmlnkadd, dxfmSelectComponent); +USEUNIT("dxPSGraphicLnk.pas"); +USEUNIT("dxPSCompsProvider.pas"); +USEFORMNS("dxPSCPDsg.pas", Dxpscpdsg, dxfmCPDesigner); +USEFORMNS("dxPSfmCompositionAdd.pas", Dxpsfmcompositionadd, dxfmCompositionAddItems); +USEFORMNS("dxPSfmCompositionDsg.pas", Dxpsfmcompositiondsg, dxfmCompositionDesignWindow); +USEUNIT("dxPSContainerLnk.pas"); +USEUNIT("dxPSDBBasedXplorer.pas"); +USEUNIT("dxPSExtDlgs.pas"); +USEUNIT("dxPSFileBasedXplorer.pas"); +USEUNIT("dxPSfmReportProperties.pas"); +USEUNIT("dxPSShapes.pas"); +USEFORMNS("dxPSTextLnk.pas", Dxpstextlnk, dxfmTextReportLinkDesignWindow); +USEUNIT("dxPSStandardFillPatterns.pas"); +USEUNIT("dxPSXplorerTreeView.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreC6.res b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC6.res new file mode 100644 index 00000000..20991c44 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSCoreC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD10.dpk new file mode 100644 index 00000000..1eb3d02b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD10.dpk @@ -0,0 +1,102 @@ +package dxPSCoreD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + vclx, + dbrtl, + vcljpg, + dxComnD10, + cxLibraryD10; + +contains + dxWrap, + dxBkGnd, + dxBrhDlg, + dxExtCtrls, + dxExtCtrlsStrs, + dxFEFDlg, + dxfmChFN, + dxfmClr, + dxfmDfnStl, + dxfmDTFmt, + dxfmMnPg, + dxfmPNFmt, + dxfmZoom, + dxPcPrVw, + dxPgsDlg, + dxPpAttr, + dxPreVw, + dxPrnDev, + dxPrnDlg, + dxPrnPg, + dxPSAutoHFTextMnuBld, + dxPSCompsProvider, + dxPSCore, + dxPSCPDsg, + dxPSEdgePatterns, + dxPSEngn, + dxPSESys, + dxPSEvnt, + dxPSExcelEdgePatterns, + dxPSExcelFillPatterns, + dxPSFillPatterns, + dxPSfmAutoHFTextFmt, + dxPSfmCompositionAdd, + dxPSfmCompositionDsg, + dxPSfmEditDesc, + dxPSfmLnkAdd, + dxPSfmTtl, + dxPSForm, + dxPSGlbl, + dxPSGraphicLnk, + dxPSHFToolBarBld, + dxPSImgs, + dxPSPgsMnuBld, + dxPSPopupMan, + dxPSPrVw, + dxPSPrVwOpt, + dxPSPrVwStd, + dxPSRes, + dxPSSngltn, + dxPSTextOut, + dxPSUtl, + dxBase, + dxPSBaseGridLnk, + dxPSContainerLnk, + dxPSDBBasedXplorer, + dxPSExtDlgs, + dxPSFileBasedXplorer, + dxPSfmReportProperties, + dxPSShapes, + dxPSTextLnk, + dxPSStandardFillPatterns, + dxPSXplorerTreeView; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreD10.res b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD10.res new file mode 100644 index 00000000..b50ce6a9 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD11.dpk new file mode 100644 index 00000000..55d04c6a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD11.dpk @@ -0,0 +1,102 @@ +package dxPSCoreD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + vclx, + dbrtl, + vcljpg, + dxComnD11, + cxLibraryD11; + +contains + dxWrap, + dxBkGnd, + dxBrhDlg, + dxExtCtrls, + dxExtCtrlsStrs, + dxFEFDlg, + dxfmChFN, + dxfmClr, + dxfmDfnStl, + dxfmDTFmt, + dxfmMnPg, + dxfmPNFmt, + dxfmZoom, + dxPcPrVw, + dxPgsDlg, + dxPpAttr, + dxPreVw, + dxPrnDev, + dxPrnDlg, + dxPrnPg, + dxPSAutoHFTextMnuBld, + dxPSCompsProvider, + dxPSCore, + dxPSCPDsg, + dxPSEdgePatterns, + dxPSEngn, + dxPSESys, + dxPSEvnt, + dxPSExcelEdgePatterns, + dxPSExcelFillPatterns, + dxPSFillPatterns, + dxPSfmAutoHFTextFmt, + dxPSfmCompositionAdd, + dxPSfmCompositionDsg, + dxPSfmEditDesc, + dxPSfmLnkAdd, + dxPSfmTtl, + dxPSForm, + dxPSGlbl, + dxPSGraphicLnk, + dxPSHFToolBarBld, + dxPSImgs, + dxPSPgsMnuBld, + dxPSPopupMan, + dxPSPrVw, + dxPSPrVwOpt, + dxPSPrVwStd, + dxPSRes, + dxPSSngltn, + dxPSTextOut, + dxPSUtl, + dxBase, + dxPSBaseGridLnk, + dxPSContainerLnk, + dxPSDBBasedXplorer, + dxPSExtDlgs, + dxPSFileBasedXplorer, + dxPSfmReportProperties, + dxPSShapes, + dxPSTextLnk, + dxPSStandardFillPatterns, + dxPSXplorerTreeView; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreD11.res b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD11.res new file mode 100644 index 00000000..ea3a4d52 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD5.dpk new file mode 100644 index 00000000..e91bfe7e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD5.dpk @@ -0,0 +1,101 @@ +package dxPSCoreD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vclx50, + vcldb50, + vcljpg50, + dxComnD5, + cxLibraryVCLD5; + +contains + dxWrap, + dxBkGnd, + dxBrhDlg, + dxExtCtrls, + dxExtCtrlsStrs, + dxFEFDlg, + dxfmChFN, + dxfmClr, + dxfmDfnStl, + dxfmDTFmt, + dxfmMnPg, + dxfmPNFmt, + dxfmZoom, + dxPcPrVw, + dxPgsDlg, + dxPpAttr, + dxPreVw, + dxPrnDev, + dxPrnDlg, + dxPrnPg, + dxPSAutoHFTextMnuBld, + dxPSCompsProvider, + dxPSCore, + dxPSCPDsg, + dxPSEdgePatterns, + dxPSEngn, + dxPSESys, + dxPSEvnt, + dxPSExcelEdgePatterns, + dxPSExcelFillPatterns, + dxPSFillPatterns, + dxPSfmAutoHFTextFmt, + dxPSfmCompositionAdd, + dxPSfmCompositionDsg, + dxPSfmEditDesc, + dxPSfmLnkAdd, + dxPSfmTtl, + dxPSForm, + dxPSGlbl, + dxPSGraphicLnk, + dxPSHFToolBarBld, + dxPSImgs, + dxPSPgsMnuBld, + dxPSPopupMan, + dxPSPrVw, + dxPSPrVwOpt, + dxPSPrVwStd, + dxPSRes, + dxPSSngltn, + dxPSTextOut, + dxPSUtl, + dxBase, + dxPSBaseGridLnk, + dxPSContainerLnk, + dxPSDBBasedXplorer, + dxPSExtDlgs, + dxPSFileBasedXplorer, + dxPSfmReportProperties, + dxPSShapes, + dxPSTextLnk, + dxPSStandardFillPatterns, + dxPSXplorerTreeView; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreD5.res b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD5.res new file mode 100644 index 00000000..9bc56ceb Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD6.dpk new file mode 100644 index 00000000..e5c98206 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD6.dpk @@ -0,0 +1,102 @@ +package dxPSCoreD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + vclx, + dbrtl, + vcljpg, + dxComnD6, + cxLibraryVCLD6; + +contains + dxWrap, + dxBkGnd, + dxBrhDlg, + dxExtCtrls, + dxExtCtrlsStrs, + dxFEFDlg, + dxfmChFN, + dxfmClr, + dxfmDfnStl, + dxfmDTFmt, + dxfmMnPg, + dxfmPNFmt, + dxfmZoom, + dxPcPrVw, + dxPgsDlg, + dxPpAttr, + dxPreVw, + dxPrnDev, + dxPrnDlg, + dxPrnPg, + dxPSAutoHFTextMnuBld, + dxPSCompsProvider, + dxPSCore, + dxPSCPDsg, + dxPSEdgePatterns, + dxPSEngn, + dxPSESys, + dxPSEvnt, + dxPSExcelEdgePatterns, + dxPSExcelFillPatterns, + dxPSFillPatterns, + dxPSfmAutoHFTextFmt, + dxPSfmCompositionAdd, + dxPSfmCompositionDsg, + dxPSfmEditDesc, + dxPSfmLnkAdd, + dxPSfmTtl, + dxPSForm, + dxPSGlbl, + dxPSGraphicLnk, + dxPSHFToolBarBld, + dxPSImgs, + dxPSPgsMnuBld, + dxPSPopupMan, + dxPSPrVw, + dxPSPrVwOpt, + dxPSPrVwStd, + dxPSRes, + dxPSSngltn, + dxPSTextOut, + dxPSUtl, + dxBase, + dxPSBaseGridLnk, + dxPSContainerLnk, + dxPSDBBasedXplorer, + dxPSExtDlgs, + dxPSFileBasedXplorer, + dxPSfmReportProperties, + dxPSShapes, + dxPSTextLnk, + dxPSStandardFillPatterns, + dxPSXplorerTreeView; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreD6.res b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD6.res new file mode 100644 index 00000000..7f6a329c Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD7.dpk new file mode 100644 index 00000000..9caf3611 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD7.dpk @@ -0,0 +1,102 @@ +package dxPSCoreD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + vclx, + dbrtl, + vcljpg, + dxComnD7, + cxLibraryVCLD7; + +contains + dxWrap, + dxBkGnd, + dxBrhDlg, + dxExtCtrls, + dxExtCtrlsStrs, + dxFEFDlg, + dxfmChFN, + dxfmClr, + dxfmDfnStl, + dxfmDTFmt, + dxfmMnPg, + dxfmPNFmt, + dxfmZoom, + dxPcPrVw, + dxPgsDlg, + dxPpAttr, + dxPreVw, + dxPrnDev, + dxPrnDlg, + dxPrnPg, + dxPSAutoHFTextMnuBld, + dxPSCompsProvider, + dxPSCore, + dxPSCPDsg, + dxPSEdgePatterns, + dxPSEngn, + dxPSESys, + dxPSEvnt, + dxPSExcelEdgePatterns, + dxPSExcelFillPatterns, + dxPSFillPatterns, + dxPSfmAutoHFTextFmt, + dxPSfmCompositionAdd, + dxPSfmCompositionDsg, + dxPSfmEditDesc, + dxPSfmLnkAdd, + dxPSfmTtl, + dxPSForm, + dxPSGlbl, + dxPSGraphicLnk, + dxPSHFToolBarBld, + dxPSImgs, + dxPSPgsMnuBld, + dxPSPopupMan, + dxPSPrVw, + dxPSPrVwOpt, + dxPSPrVwStd, + dxPSRes, + dxPSSngltn, + dxPSTextOut, + dxPSUtl, + dxBase, + dxPSBaseGridLnk, + dxPSContainerLnk, + dxPSDBBasedXplorer, + dxPSExtDlgs, + dxPSFileBasedXplorer, + dxPSfmReportProperties, + dxPSShapes, + dxPSTextLnk, + dxPSStandardFillPatterns, + dxPSXplorerTreeView; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreD7.res b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD7.res new file mode 100644 index 00000000..037e7f42 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD9.dpk new file mode 100644 index 00000000..32f2fa89 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD9.dpk @@ -0,0 +1,102 @@ +package dxPSCoreD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + vclx, + dbrtl, + vcljpg, + dxComnD9, + cxLibraryD9; + +contains + dxWrap, + dxBkGnd, + dxBrhDlg, + dxExtCtrls, + dxExtCtrlsStrs, + dxFEFDlg, + dxfmChFN, + dxfmClr, + dxfmDfnStl, + dxfmDTFmt, + dxfmMnPg, + dxfmPNFmt, + dxfmZoom, + dxPcPrVw, + dxPgsDlg, + dxPpAttr, + dxPreVw, + dxPrnDev, + dxPrnDlg, + dxPrnPg, + dxPSAutoHFTextMnuBld, + dxPSCompsProvider, + dxPSCore, + dxPSCPDsg, + dxPSEdgePatterns, + dxPSEngn, + dxPSESys, + dxPSEvnt, + dxPSExcelEdgePatterns, + dxPSExcelFillPatterns, + dxPSFillPatterns, + dxPSfmAutoHFTextFmt, + dxPSfmCompositionAdd, + dxPSfmCompositionDsg, + dxPSfmEditDesc, + dxPSfmLnkAdd, + dxPSfmTtl, + dxPSForm, + dxPSGlbl, + dxPSGraphicLnk, + dxPSHFToolBarBld, + dxPSImgs, + dxPSPgsMnuBld, + dxPSPopupMan, + dxPSPrVw, + dxPSPrVwOpt, + dxPSPrVwStd, + dxPSRes, + dxPSSngltn, + dxPSTextOut, + dxPSUtl, + dxBase, + dxPSBaseGridLnk, + dxPSContainerLnk, + dxPSDBBasedXplorer, + dxPSExtDlgs, + dxPSFileBasedXplorer, + dxPSfmReportProperties, + dxPSShapes, + dxPSTextLnk, + dxPSStandardFillPatterns, + dxPSXplorerTreeView; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSCoreD9.res b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD9.res new file mode 100644 index 00000000..a91be3ea Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSCoreD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC10.bpk new file mode 100644 index 00000000..6bddfe2d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC10.bpk @@ -0,0 +1,184 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSDBTeeChartC10.bpl +OBJFILES = dxPSDBTCLnkReg.obj dxPSDBTCLnk.obj dxPSDBTeeChartC10.obj +MAINSOURCE = dxPSDBTeeChartC10.cpp +RESFILES = dxPSDBTeeChartC10.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi designide.bpi dxPSTeeChartC10.bpi dxPSCoreC10.bpi +!if !$d(TEEPRO) +PACKAGES = $(PACKAGES) tee.bpi teedb.bpi +USERDEFINES = +!elif $d(TEE5) +PACKAGES = $(PACKAGES) tee5C10.bpi teedb5C10.bpi +USERDEFINES = TEEPRO;TEE5 +!elif $d(TEE6) +PACKAGES = $(PACKAGES) tee6C10.bpi teedb6C10.bpi +USERDEFINES = TEEPRO;TEE6 +!elif $d(TEE7) +PACKAGES = $(PACKAGES) tee710.bpi teedb710.bpi +USERDEFINES = TEEPRO;TEE7 +!elif $d(TEE8) +PACKAGES = $(PACKAGES) tee810.bpi teedb810.bpi +USERDEFINES = TEEPRO;TEE8 +!endif + +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for DBTeeChart by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC10.cpp new file mode 100644 index 00000000..01c9fdbd --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC10.cpp @@ -0,0 +1,38 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxPSDBTeeChartC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxPSCoreC10.bpi"); +USEPACKAGE("dxPSTeeChartC10.bpi"); +#ifndef TEEPRO +USEPACKAGE("tee.bpi"); +USEPACKAGE("teedb.bpi"); +#elif defined(TEE5) +USEPACKAGE("tee5C10.bpi"); +USEPACKAGE("teedb5C10.bpi"); +#elif defined(TEE6) +USEPACKAGE("tee6C10.bpi"); +USEPACKAGE("teedb6C10.bpi"); +#elif defined(TEE7) +USEPACKAGE("tee710.bpi"); +USEPACKAGE("teedb710.bpi"); +#elif defined(TEE8) +USEPACKAGE("tee810.bpi"); +USEPACKAGE("teedb810.bpi"); +#endif +USEUNIT("dxPSDBTCLnk.pas"); +USEUNIT("dxPSDBTCLnkReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC10.res b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC10.res new file mode 100644 index 00000000..9c8e3374 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC11.bpk new file mode 100644 index 00000000..82b48b3e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC11.bpk @@ -0,0 +1,184 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSDBTeeChartC11.bpl +OBJFILES = dxPSDBTCLnkReg.obj dxPSDBTCLnk.obj dxPSDBTeeChartC11.obj +MAINSOURCE = dxPSDBTeeChartC11.cpp +RESFILES = dxPSDBTeeChartC11.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi designide.bpi dxPSTeeChartC11.bpi dxPSCoreC11.bpi +!if !$d(TEEPRO) +PACKAGES = $(PACKAGES) tee.bpi teedb.bpi +USERDEFINES = +!elif $d(TEE5) +PACKAGES = $(PACKAGES) tee5C11.bpi teedb5C11.bpi +USERDEFINES = TEEPRO;TEE5 +!elif $d(TEE6) +PACKAGES = $(PACKAGES) tee6C11.bpi teedb6C11.bpi +USERDEFINES = TEEPRO;TEE6 +!elif $d(TEE7) +PACKAGES = $(PACKAGES) tee711.bpi teedb711.bpi +USERDEFINES = TEEPRO;TEE7 +!elif $d(TEE8) +PACKAGES = $(PACKAGES) tee811.bpi teedb811.bpi +USERDEFINES = TEEPRO;TEE8 +!endif + +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for DBTeeChart by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC11.cpp new file mode 100644 index 00000000..187ffa7a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC11.cpp @@ -0,0 +1,38 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxPSDBTeeChartC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxPSCoreC11.bpi"); +USEPACKAGE("dxPSTeeChartC11.bpi"); +#ifndef TEEPRO +USEPACKAGE("tee.bpi"); +USEPACKAGE("teedb.bpi"); +#elif defined(TEE5) +USEPACKAGE("tee5C11.bpi"); +USEPACKAGE("teedb5C11.bpi"); +#elif defined(TEE6) +USEPACKAGE("tee6C11.bpi"); +USEPACKAGE("teedb6C11.bpi"); +#elif defined(TEE7) +USEPACKAGE("tee711.bpi"); +USEPACKAGE("teedb711.bpi"); +#elif defined(TEE8) +USEPACKAGE("tee811.bpi"); +USEPACKAGE("teedb811.bpi"); +#endif +USEUNIT("dxPSDBTCLnk.pas"); +USEUNIT("dxPSDBTCLnkReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC11.res b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC11.res new file mode 100644 index 00000000..2f21f9ef Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC5.bpk new file mode 100644 index 00000000..25afcc16 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC5.bpk @@ -0,0 +1,187 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPSDBTeeChartc5.bpl +OBJFILES = dxPSDBTCLnkReg.obj dxPSDBTCLnk.obj dxPSDBTeeChartc5.obj +RESFILES = dxPSDBTeeChartc5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = vcl50.bpi vcldb50.bpi dxPSTeeChartc5.bpi dxPSCorec5.bpi +!if !$d(TEEPRO) +PACKAGES = $(PACKAGES) tee50.bpi teedb50.bpi +USERDEFINES = +!elif $d(TEE5) +PACKAGES = $(PACKAGES) tee5c5.bpi teedb5c5.bpi +USERDEFINES = TEEPRO;TEE5 +!elif $d(TEE6) +PACKAGES = $(PACKAGES) tee6c5.bpi teedb6c5.bpi +USERDEFINES = TEEPRO;TEE6 +!elif $d(TEE7) +PACKAGES = $(PACKAGES) tee7c5.bpi teedb7c5.bpi +USERDEFINES = TEEPRO;TEE7 +!elif $d(TEE8) +PACKAGES = $(PACKAGES) tee8c5.bpi teedb8c5.bpi +USERDEFINES = TEEPRO;TEE8 +!endif + +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for DBTeeChart by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC5.cpp new file mode 100644 index 00000000..582fd581 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC5.cpp @@ -0,0 +1,36 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxPSDBTeeChartc5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("dxPSTeeChartc5.bpi"); +#ifndef TEEPRO +USEPACKAGE("tee50.bpi"); +USEPACKAGE("teedb50.bpi"); +#elif defined(TEE5) +USEPACKAGE("tee5c5.bpi"); +USEPACKAGE("teedb5c5.bpi"); +#elif defined(TEE6) +USEPACKAGE("tee6c5.bpi"); +USEPACKAGE("teedb6c5.bpi"); +#elif defined(TEE7) +USEPACKAGE("tee7c5.bpi"); +USEPACKAGE("teedb7c5.bpi"); +#elif defined(TEE8) +USEPACKAGE("tee8c5.bpi"); +USEPACKAGE("teedb8c5.bpi"); +#endif +USEUNIT("dxPSDBTCLnk.pas"); +USEUNIT("dxPSDBTCLnkReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC5.res b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC5.res new file mode 100644 index 00000000..98cc6735 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC6.bpk new file mode 100644 index 00000000..d3bc8f89 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC6.bpk @@ -0,0 +1,187 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSDBTeeChartC6.bpl +OBJFILES = dxPSDBTCLnkReg.obj dxPSDBTCLnk.obj dxPSDBTeeChartC6.obj +RESFILES = dxPSDBTeeChartC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi dxPSTeeChartC6.bpi dxPSCoreC6.bpi +!if !$d(TEEPRO) +PACKAGES = $(PACKAGES) tee.bpi teedb.bpi +USERDEFINES = +!elif $d(TEE5) +PACKAGES = $(PACKAGES) tee5c6.bpi teedb5c6.bpi +USERDEFINES = TEEPRO;TEE5 +!elif $d(TEE6) +PACKAGES = $(PACKAGES) tee6c6.bpi teedb6c6.bpi +USERDEFINES = TEEPRO;TEE6 +!elif $d(TEE7) +PACKAGES = $(PACKAGES) tee7c6.bpi teedb7c6.bpi +USERDEFINES = TEEPRO;TEE7 +!elif $d(TEE8) +PACKAGES = $(PACKAGES) tee8c6.bpi teedb8c6.bpi +USERDEFINES = TEEPRO;TEE8 +!endif + +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for DBTeeChart by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC6.cpp new file mode 100644 index 00000000..2cdbecef --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC6.cpp @@ -0,0 +1,37 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxPSDBTeeChartC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USEPACKAGE("dxPSTeeChartC6.bpi"); +#ifndef TEEPRO +USEPACKAGE("tee.bpi"); +USEPACKAGE("teedb.bpi"); +#elif defined(TEE5) +USEPACKAGE("tee5c6.bpi"); +USEPACKAGE("teedb5c6.bpi"); +#elif defined(TEE6) +USEPACKAGE("tee6c6.bpi"); +USEPACKAGE("teedb6c6.bpi"); +#elif defined(TEE7) +USEPACKAGE("tee7c6.bpi"); +USEPACKAGE("teedb7c6.bpi"); +#elif defined(TEE8) +USEPACKAGE("tee8c6.bpi"); +USEPACKAGE("teedb8c6.bpi"); +#endif +USEUNIT("dxPSDBTCLnk.pas"); +USEUNIT("dxPSDBTCLnkReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC6.res b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC6.res new file mode 100644 index 00000000..324731a6 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD10.dpk new file mode 100644 index 00000000..e66f2a99 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD10.dpk @@ -0,0 +1,50 @@ +package dxPSDBTeeChartD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for DBTeeChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD10, + dxPSTeeChartD10, +{$IFNDEF TEEPRO} + tee, + teedb; +{$ELSE} +{$IFDEF TEE7} + tee710, + teedb710; +{$ENDIF} +{$IFDEF TEE8} + tee810, + teedb810; +{$ENDIF} +{$ENDIF} + +contains + dxPSDBTCLnkReg, + dxPSDBTCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD10.res b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD10.res new file mode 100644 index 00000000..61bbf9d0 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD11.dpk new file mode 100644 index 00000000..5a8ea064 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD11.dpk @@ -0,0 +1,50 @@ +package dxPSDBTeeChartD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for DBTeeChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD11, + dxPSTeeChartD11, +{$IFNDEF TEEPRO} + tee, + teedb; +{$ELSE} +{$IFDEF TEE7} + tee711, + teedb711; +{$ENDIF} +{$IFDEF TEE8} + tee811, + teedb811; +{$ENDIF} +{$ENDIF} + +contains + dxPSDBTCLnkReg, + dxPSDBTCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD11.res b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD11.res new file mode 100644 index 00000000..e6dd5cc2 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD5.dpk new file mode 100644 index 00000000..40fcbcba --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD5.dpk @@ -0,0 +1,58 @@ +package dxPSDBTeeChartD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for DBTeeChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxPSCoreD5, + dxPSTeeChartD5, +{$IFNDEF TEEPRO} + tee50, + teedb50; +{$ELSE} +{$IFDEF TEE5} + tee55, + teedb55; +{$ENDIF} +{$IFDEF TEE6} + tee65, + teedb65; +{$ENDIF} +{$IFDEF TEE7} + tee75, + teedb75; +{$ENDIF} +{$IFDEF TEE8} + tee85, + teedb85; +{$ENDIF} +{$ENDIF} + +contains + dxPSDBTCLnkReg, + dxPSDBTCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD5.res b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD5.res new file mode 100644 index 00000000..e579e0f7 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD6.dpk new file mode 100644 index 00000000..beeb5c37 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD6.dpk @@ -0,0 +1,58 @@ +package dxPSDBTeeChartD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for DBTeeChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD6, + dxPSTeeChartD6, +{$IFNDEF TEEPRO} + tee, + teedb; +{$ELSE} +{$IFDEF TEE5} + tee, + teedb; +{$ENDIF} +{$IFDEF TEE6} + tee66, + teedb66; +{$ENDIF} +{$IFDEF TEE7} + tee76, + teedb76; +{$ENDIF} +{$IFDEF TEE8} + tee86, + teedb86; +{$ENDIF} +{$ENDIF} + +contains + dxPSDBTCLnkReg, + dxPSDBTCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD6.res b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD6.res new file mode 100644 index 00000000..57103d78 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD7.dpk new file mode 100644 index 00000000..0c9531a8 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD7.dpk @@ -0,0 +1,58 @@ +package dxPSDBTeeChartD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for DBTeeChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD7, + dxPSTeeChartD7, +{$IFNDEF TEEPRO} + tee, + teedb; +{$ELSE} +{$IFDEF TEE5} + tee57, + teedb57; +{$ENDIF} +{$IFDEF TEE6} + tee67, + teedb67; +{$ENDIF} +{$IFDEF TEE7} + tee77, + teedb77; +{$ENDIF} +{$IFDEF TEE8} + tee87, + teedb87; +{$ENDIF} +{$ENDIF} + +contains + dxPSDBTCLnkReg, + dxPSDBTCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD7.res b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD7.res new file mode 100644 index 00000000..73938e58 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD9.dpk new file mode 100644 index 00000000..0573b29f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD9.dpk @@ -0,0 +1,50 @@ +package dxPSDBTeeChartD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for DBTeeChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD9, + dxPSTeeChartD9, +{$IFNDEF TEEPRO} + tee, + teedb; +{$ELSE} +{$IFDEF TEE7} + tee79, + teedb79; +{$ENDIF} +{$IFDEF TEE8} + tee89, + teedb89; +{$ENDIF} +{$ENDIF} + +contains + dxPSDBTCLnkReg, + dxPSDBTCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD9.res b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD9.res new file mode 100644 index 00000000..2d07abe4 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSDBTeeChartD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC10.bpk new file mode 100644 index 00000000..90abd90e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC10.bpk @@ -0,0 +1,176 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSLnksC10.bpl +OBJFILES = dxPSChlbxLnk.obj dxPSLbxLnk.obj dxPSLnkReg.obj dxPSGrLnks.obj \ + dxPSStdGrLnk.obj dxPSTVLnk.obj dxPSRELnk.obj dxPSImgLnk.obj dxPSDBCtrlLnkReg.obj \ + dxPSDBCtrlLnks.obj dxPSDBCtrlProducers.obj dxPSLVLnk.obj dxPSLnksC10.obj +MAINSOURCE = dxPSLnksC10.cpp +RESFILES = dxPSLnksC10.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPSChlbxLnk.dfm dxPSLbxLnk.dfm dxPSStdGrLnk.dfm \ + dxPSLVLnk.dfm dxPSTVLnk.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC10.bpi cxLibraryC10.bpi designide.bpi rtl.bpi vcl.bpi vclx.bpi dbrtl.bpi \ + vcldb.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLinks (Standard) by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC10.cpp new file mode 100644 index 00000000..f50fd1f8 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC10.cpp @@ -0,0 +1,31 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxPSCoreC10.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USERES("dxPSLnksC10.res"); +USEUNIT("dxPSLnkReg.pas"); +USEUNIT("dxPSImgLnk.pas"); +USEFORMNS("dxPSChlbxLnk.pas", Dxpschlbxlnk, dxChlbxReportLinkDesignWindow); +USEFORMNS("dxPSLbxLnk.pas", Dxpslbxlnk, dxLBxReportLinkDesignWindow); +USEFORMNS("dxPSStdGrLnk.pas", Dxpsstdgrlnk, dxGridReportLinkDesignWindow); +USEFORMNS("dxPSTVLnk.pas", Dxpstvlnk, dxTVReportLinkDesignWindow); +USEUNIT("dxPSDBCtrlLnkReg.pas"); +USEUNIT("dxPSDBCtrlLnks.pas"); +USEUNIT("dxPSDBCtrlProducers.pas"); +USEUNIT("dxPSLVLnk.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksC10.res b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC10.res new file mode 100644 index 00000000..f4b02bc2 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC11.bpk new file mode 100644 index 00000000..52d44d58 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC11.bpk @@ -0,0 +1,176 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSLnksC11.bpl +OBJFILES = dxPSChlbxLnk.obj dxPSLbxLnk.obj dxPSLnkReg.obj dxPSGrLnks.obj \ + dxPSStdGrLnk.obj dxPSTVLnk.obj dxPSRELnk.obj dxPSImgLnk.obj dxPSDBCtrlLnkReg.obj \ + dxPSDBCtrlLnks.obj dxPSDBCtrlProducers.obj dxPSLVLnk.obj dxPSLnksC11.obj +MAINSOURCE = dxPSLnksC11.cpp +RESFILES = dxPSLnksC11.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPSChlbxLnk.dfm dxPSLbxLnk.dfm dxPSStdGrLnk.dfm \ + dxPSLVLnk.dfm dxPSTVLnk.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC11.bpi cxLibraryC11.bpi designide.bpi rtl.bpi vcl.bpi vclx.bpi dbrtl.bpi \ + vcldb.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLinks (Standard) by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC11.cpp new file mode 100644 index 00000000..ac7e8f1f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC11.cpp @@ -0,0 +1,31 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxPSCoreC11.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USERES("dxPSLnksC11.res"); +USEUNIT("dxPSLnkReg.pas"); +USEUNIT("dxPSImgLnk.pas"); +USEFORMNS("dxPSChlbxLnk.pas", Dxpschlbxlnk, dxChlbxReportLinkDesignWindow); +USEFORMNS("dxPSLbxLnk.pas", Dxpslbxlnk, dxLBxReportLinkDesignWindow); +USEFORMNS("dxPSStdGrLnk.pas", Dxpsstdgrlnk, dxGridReportLinkDesignWindow); +USEFORMNS("dxPSTVLnk.pas", Dxpstvlnk, dxTVReportLinkDesignWindow); +USEUNIT("dxPSDBCtrlLnkReg.pas"); +USEUNIT("dxPSDBCtrlLnks.pas"); +USEUNIT("dxPSDBCtrlProducers.pas"); +USEUNIT("dxPSLVLnk.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksC11.res b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC11.res new file mode 100644 index 00000000..1eccf75a Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC5.bpk new file mode 100644 index 00000000..e4a1a0ce --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC5.bpk @@ -0,0 +1,174 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPSLnksc5.bpl +OBJFILES = dxPSChlbxLnk.obj dxPSLbxLnk.obj dxPSLnkReg.obj dxPSGrLnks.obj \ + dxPSStdGrLnk.obj dxPSTVLnk.obj dxPSRELnk.obj dxPSImgLnk.obj dxPSDBCtrlLnkReg.obj \ + dxPSDBCtrlLnks.obj dxPSDBCtrlProducers.obj dxPSLVLnk.obj dxPSLnksC5.obj +RESFILES = dxPSLnksc5.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPSChlbxLnk.dfm dxPSLbxLnk.dfm dxPSStdGrLnk.dfm \ + dxPSLVLnk.dfm dxPSTVLnk.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = dxPSCorec5.bpi cxLibraryVCLC5.bpi vcldb50.bpi vcl50.bpi vclx50.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLinks (Standard) by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC5.cpp new file mode 100644 index 00000000..186dfe9a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC5.cpp @@ -0,0 +1,29 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vclx50.bpi"); +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USERES("dxPSLnksc5.res"); +USEUNIT("dxPSLnkReg.pas"); +USEUNIT("dxPSImgLnk.pas"); +USEFORMNS("dxPSChlbxLnk.pas", Dxpschlbxlnk, dxChlbxReportLinkDesignWindow); +USEFORMNS("dxPSLbxLnk.pas", Dxpslbxlnk, dxLBxReportLinkDesignWindow); +USEFORMNS("dxPSStdGrLnk.pas", Dxpsstdgrlnk, dxGridReportLinkDesignWindow); +USEFORMNS("dxPSTVLnk.pas", Dxpstvlnk, dxTVReportLinkDesignWindow); +USEUNIT("dxPSDBCtrlLnkReg.pas"); +USEUNIT("dxPSDBCtrlLnks.pas"); +USEUNIT("dxPSDBCtrlProducers.pas"); +USEUNIT("dxPSLVLnk.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksC5.res b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC5.res new file mode 100644 index 00000000..7246ffd4 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC6.bpk new file mode 100644 index 00000000..c4d17a95 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC6.bpk @@ -0,0 +1,175 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSLnksC6.bpl +OBJFILES = dxPSChlbxLnk.obj dxPSLbxLnk.obj dxPSLnkReg.obj dxPSGrLnks.obj \ + dxPSStdGrLnk.obj dxPSTVLnk.obj dxPSRELnk.obj dxPSImgLnk.obj dxPSDBCtrlLnkReg.obj \ + dxPSDBCtrlLnks.obj dxPSDBCtrlProducers.obj dxPSLVLnk.obj dxPSLnksC6.obj +RESFILES = dxPSLnksC6.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPSChlbxLnk.dfm dxPSLbxLnk.dfm dxPSStdGrLnk.dfm \ + dxPSLVLnk.dfm dxPSTVLnk.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC6.bpi cxLibraryVCLC6.bpi designide.bpi rtl.bpi vcl.bpi vclx.bpi dbrtl.bpi \ + vcldb.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLinks (Standard) by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC6.cpp new file mode 100644 index 00000000..f4f8f163 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC6.cpp @@ -0,0 +1,31 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USERES("dxPSLnksC6.res"); +USEUNIT("dxPSLnkReg.pas"); +USEUNIT("dxPSImgLnk.pas"); +USEFORMNS("dxPSChlbxLnk.pas", Dxpschlbxlnk, dxChlbxReportLinkDesignWindow); +USEFORMNS("dxPSLbxLnk.pas", Dxpslbxlnk, dxLBxReportLinkDesignWindow); +USEFORMNS("dxPSStdGrLnk.pas", Dxpsstdgrlnk, dxGridReportLinkDesignWindow); +USEFORMNS("dxPSTVLnk.pas", Dxpstvlnk, dxTVReportLinkDesignWindow); +USEUNIT("dxPSDBCtrlLnkReg.pas"); +USEUNIT("dxPSDBCtrlLnks.pas"); +USEUNIT("dxPSDBCtrlProducers.pas"); +USEUNIT("dxPSLVLnk.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksC6.res b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC6.res new file mode 100644 index 00000000..c6652c32 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSLnksC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD10.dpk new file mode 100644 index 00000000..b577b996 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD10.dpk @@ -0,0 +1,50 @@ +package dxPSLnksD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks (Standard) by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + vcldb, + vclshlctrls, + designide, + dxPSCoreD10; + +contains + dxPSLnkReg, + dxPSGrLnks, + dxPSImgLnk, + dxPSLbxLnk, + dxPSChLbxLnk, + dxPSRELnk, + dxPSStdGrLnk, + dxPSTVLnk, + dxPSDBCtrlLnkReg, + dxPSDBCtrlLnks, + dxPSDBCtrlProducers, + dxPSLVLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksD10.res b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD10.res new file mode 100644 index 00000000..a64e0692 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD11.dpk new file mode 100644 index 00000000..e8fec4de --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD11.dpk @@ -0,0 +1,50 @@ +package dxPSLnksD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks (Standard) by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + vcldb, + vclshlctrls, + designide, + dxPSCoreD11; + +contains + dxPSLnkReg, + dxPSGrLnks, + dxPSImgLnk, + dxPSLbxLnk, + dxPSChLbxLnk, + dxPSRELnk, + dxPSStdGrLnk, + dxPSTVLnk, + dxPSDBCtrlLnkReg, + dxPSDBCtrlLnks, + dxPSDBCtrlProducers, + dxPSLVLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksD11.res b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD11.res new file mode 100644 index 00000000..91d3067c Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD5.dpk new file mode 100644 index 00000000..cc921c06 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD5.dpk @@ -0,0 +1,47 @@ +package dxPSLnksD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks (Standard) by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcldb50, + dxPSCoreD5; + +contains + dxPSLnkReg, + dxPSGrLnks, + dxPSImgLnk, + dxPSLbxLnk, + dxPSChLbxLnk, + dxPSRELnk, + dxPSStdGrLnk, + dxPSTVLnk, + dxPSDBCtrlLnkReg, + dxPSDBCtrlLnks, + dxPSDBCtrlProducers, + dxPSLVLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksD5.res b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD5.res new file mode 100644 index 00000000..0bb1ee95 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD6.dpk new file mode 100644 index 00000000..7619f646 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD6.dpk @@ -0,0 +1,50 @@ +package dxPSLnksD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks (Standard) by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + vcldb, + vclshlctrls, + designide, + dxPSCoreD6; + +contains + dxPSLnkReg, + dxPSGrLnks, + dxPSImgLnk, + dxPSLbxLnk, + dxPSChLbxLnk, + dxPSRELnk, + dxPSStdGrLnk, + dxPSTVLnk, + dxPSDBCtrlLnkReg, + dxPSDBCtrlLnks, + dxPSDBCtrlProducers, + dxPSLVLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksD6.res b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD6.res new file mode 100644 index 00000000..76dba39b Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD7.dpk new file mode 100644 index 00000000..c427c13f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD7.dpk @@ -0,0 +1,50 @@ +package dxPSLnksD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks (Standard) by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + vcldb, + vclshlctrls, + designide, + dxPSCoreD7; + +contains + dxPSLnkReg, + dxPSGrLnks, + dxPSImgLnk, + dxPSLbxLnk, + dxPSChLbxLnk, + dxPSRELnk, + dxPSStdGrLnk, + dxPSTVLnk, + dxPSDBCtrlLnkReg, + dxPSDBCtrlLnks, + dxPSDBCtrlProducers, + dxPSLVLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksD7.res b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD7.res new file mode 100644 index 00000000..2247b4f0 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD9.dpk new file mode 100644 index 00000000..2652e9da --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD9.dpk @@ -0,0 +1,50 @@ +package dxPSLnksD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks (Standard) by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + vcldb, + vclshlctrls, + designide, + dxPSCoreD9; + +contains + dxPSLnkReg, + dxPSGrLnks, + dxPSImgLnk, + dxPSLbxLnk, + dxPSChLbxLnk, + dxPSRELnk, + dxPSStdGrLnk, + dxPSTVLnk, + dxPSDBCtrlLnkReg, + dxPSDBCtrlLnks, + dxPSDBCtrlProducers, + dxPSLVLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSLnksD9.res b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD9.res new file mode 100644 index 00000000..a902302c Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSLnksD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC10.bpk new file mode 100644 index 00000000..0d81ae2d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC10.bpk @@ -0,0 +1,173 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSPrVwAdvC10.bpl +OBJFILES = dxPSPrVwAdv.obj dxPSPrVwAdvC10.obj +MAINSOURCE = dxPSPrVwAdvC10.cpp +RESFILES = dxPSPrVwAdvC10.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPSPrVwAdv.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC10.bpi dxBarExtItemsC10.bpi dxBarC10.bpi dxThemeC10.bpi \ + cxLibraryC10.bpi rtl.bpi vcl.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System Advanced PreviewWindow by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC10.cpp new file mode 100644 index 00000000..c88f01ba --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC10.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxPSPrVwAdvC10.res"); +USEPACKAGE("dxcomnC10.bpi"); +USEPACKAGE("dxPSCoreC10.bpi"); +USEPACKAGE("dxBarExtItemsC10.bpi"); +USEPACKAGE("dxBarC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEFORMNS("dxPSPrVwAdv.pas", Dxpsprvwadv, dxfmPreviewWdxBar); +USEPACKAGE("vcl.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC10.res b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC10.res new file mode 100644 index 00000000..d7d8608d Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC11.bpk new file mode 100644 index 00000000..50051799 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC11.bpk @@ -0,0 +1,173 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSPrVwAdvC11.bpl +OBJFILES = dxPSPrVwAdv.obj dxPSPrVwAdvC11.obj +MAINSOURCE = dxPSPrVwAdvC11.cpp +RESFILES = dxPSPrVwAdvC11.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPSPrVwAdv.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC11.bpi dxBarExtItemsC11.bpi dxBarC11.bpi dxThemeC11.bpi \ + cxLibraryC11.bpi rtl.bpi vcl.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System Advanced PreviewWindow by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC11.cpp new file mode 100644 index 00000000..b95ee357 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC11.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxPSPrVwAdvC11.res"); +USEPACKAGE("dxcomnC11.bpi"); +USEPACKAGE("dxPSCoreC11.bpi"); +USEPACKAGE("dxBarExtItemsC11.bpi"); +USEPACKAGE("dxBarC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEFORMNS("dxPSPrVwAdv.pas", Dxpsprvwadv, dxfmPreviewWdxBar); +USEPACKAGE("vcl.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC11.res b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC11.res new file mode 100644 index 00000000..4e62a3b0 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC5.bpk new file mode 100644 index 00000000..0fc02250 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC5.bpk @@ -0,0 +1,172 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPSPrVwAdvc5.bpl +OBJFILES = dxPSPrVwAdv.obj dxPSPrVwAdvc5.obj +RESFILES = dxPSPrVwAdvc5.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPSPrVwAdv.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = dxPSCorec5.bpi dxBarExtItemsC5.bpi dxBarC5.bpi cxLibraryVCLC5.bpi \ + dxThemeC5.bpi vcl50.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System Advanced PreviewWindow by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC5.cpp new file mode 100644 index 00000000..c28397ad --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC5.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxPSPrVwAdvc5.res"); +USEPACKAGE("dxcomnc5.bpi"); +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("dxBarExtItemsC5.bpi"); +USEPACKAGE("dxBarC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEFORMNS("dxPSPrVwAdv.pas", Dxpsprvwadv, dxfmPreviewWdxBar); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC5.res b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC5.res new file mode 100644 index 00000000..703feb2a Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC6.bpk new file mode 100644 index 00000000..0581c0f2 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC6.bpk @@ -0,0 +1,172 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSPrVwAdvC6.bpl +OBJFILES = dxPSPrVwAdv.obj dxPSPrVwAdvC6.obj +RESFILES = dxPSPrVwAdvC6.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPSPrVwAdv.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC6.bpi dxBarExtItemsC6.bpi dxBarC6.bpi dxThemeC6.bpi \ + cxLibraryVCLC6.bpi rtl.bpi vcl.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System Advanced PreviewWindow by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC6.cpp new file mode 100644 index 00000000..0bb1d5a4 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC6.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxPSPrVwAdvC6.res"); +USEPACKAGE("dxcomnC6.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USEPACKAGE("dxBarExtItemsC6.bpi"); +USEPACKAGE("dxBarC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEFORMNS("dxPSPrVwAdv.pas", Dxpsprvwadv, dxfmPreviewWdxBar); +USEPACKAGE("vcl.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC6.res b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC6.res new file mode 100644 index 00000000..03fc0b7f Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvD10.dpk new file mode 100644 index 00000000..be14e019 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvD10.dpk @@ -0,0 +1,37 @@ +package dxPsPrVwAdvD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System Advanced Preview Window by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD10, + dxBarD10, + dxBarExtItemsD10; + +contains + dxPSPrVwAdv; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvD10.res b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvD10.res new file mode 100644 index 00000000..0d906970 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvD11.dpk new file mode 100644 index 00000000..e0153fca --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvD11.dpk @@ -0,0 +1,37 @@ +package dxPsPrVwAdvD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System Advanced Preview Window by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD11, + dxBarD11, + dxBarExtItemsD11; + +contains + dxPSPrVwAdv; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvD11.res b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvD11.res new file mode 100644 index 00000000..875dc94d Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvD9.dpk new file mode 100644 index 00000000..1366ecde --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvD9.dpk @@ -0,0 +1,37 @@ +package dxPsPrVwAdvD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System Advanced Preview Window by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD9, + dxBarD9, + dxBarExtItemsD9; + +contains + dxPSPrVwAdv; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvD9.res b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvD9.res new file mode 100644 index 00000000..db62436f Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSPrVwAdvD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkC5.bpk new file mode 100644 index 00000000..f191a645 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkC5.bpk @@ -0,0 +1,171 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPSTLLnkc5.bpl +OBJFILES = dxPSdxTLLnkReg.obj dxPSdxTLLnk.obj dxPSTLLnkc5.obj +RESFILES = dxPSTLLnkc5.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPSdxTLLnk.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = dxPSCorec5.bpi dxEdtrC5.bpi EQTLC5.bpi cxLibraryVCLC5.bpi vcl50.bpi vclx50.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -‚ˆ‘ˆ -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumTreeList by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkC5.cpp new file mode 100644 index 00000000..987dbc02 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkC5.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxcomnc5.bpi"); +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("dxEdtrC5.bpi"); +USEPACKAGE("EQTLC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USERES("dxPSTLLnkc5.res"); +USEUNIT("dxPSdxTLLnkReg.pas"); +USEFORMNS("dxPSdxTLLnk.pas", Dxpsdxtllnk, dxTLReportLinkDesignWindow); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vclx50.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkC5.res new file mode 100644 index 00000000..bbd233e9 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkC6.bpk new file mode 100644 index 00000000..e8ce403b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkC6.bpk @@ -0,0 +1,171 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSTLLnkC6.bpl +OBJFILES = dxPSdxTLLnkReg.obj dxPSdxTLLnk.obj dxPSTLLnkC6.obj +RESFILES = dxPSTLLnkC6.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPSdxTLLnk.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC6.bpi designide.bpi dxEdtrC6.bpi cxLibraryVCLC6.bpi EQTLC6.bpi rtl.bpi vcl.bpi vclx.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumTreeList by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkC6.cpp new file mode 100644 index 00000000..d29bf44d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkC6.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxcomnC6.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USEPACKAGE("dxEdtrC6.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("EQTLC6.bpi"); +USERES("dxPSTLLnkC6.res"); +USEUNIT("dxPSdxTLLnkReg.pas"); +USEFORMNS("dxPSdxTLLnk.pas", Dxpsdxtllnk, dxTLReportLinkDesignWindow); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkC6.res new file mode 100644 index 00000000..e8266586 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkD5.dpk new file mode 100644 index 00000000..8d1ae2d4 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkD5.dpk @@ -0,0 +1,37 @@ +package dxPSTLLnkD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS ON} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumTreeList by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxPSCoreD5, + eqTLD5; + +contains + dxPSdxTLLnkReg, + dxPSdxTLLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkD5.res new file mode 100644 index 00000000..2bf06846 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkD6.dpk new file mode 100644 index 00000000..0f38bf4e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkD6.dpk @@ -0,0 +1,38 @@ +package dxPSTLLnkD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS ON} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumTreeList by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD6, + eqTLD6; + +contains + dxPSdxTLLnkReg, + dxPSdxTLLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkD6.res new file mode 100644 index 00000000..d05514b4 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkD7.dpk new file mode 100644 index 00000000..a9cdc767 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkD7.dpk @@ -0,0 +1,38 @@ +package dxPSTLLnkD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS ON} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumTreeList by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD7, + eqTLD7; + +contains + dxPSdxTLLnkReg, + dxPSdxTLLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkD7.res new file mode 100644 index 00000000..77420ead Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSTLLnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC10.bpk new file mode 100644 index 00000000..4ab940f2 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC10.bpk @@ -0,0 +1,188 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSTeeChartC10.bpl +OBJFILES = dxPSTCLnkReg.obj dxPSTCLnk.obj dxPSTeeChartC10.obj +MAINSOURCE = dxPSTeeChartC10.cpp +RESFILES = dxPSTeeChartC10.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dxPSCoreC10.bpi +!if !$d(TEEPRO) +PACKAGES = $(PACKAGES) tee.bpi +USERDEFINES = +!elif $d(TEE5) +PACKAGES = $(PACKAGES) tee5C10.bpi +USERDEFINES = TEEPRO;TEE5 +!elif $d(TEE6) +PACKAGES = $(PACKAGES) tee6C10.bpi +USERDEFINES = TEEPRO;TEE6 +!elif $d(TEE7) +PACKAGES = $(PACKAGES) tee710.bpi +USERDEFINES = TEEPRO;TEE7 +!elif $d(TEE8) +PACKAGES = $(PACKAGES) tee810.bpi +USERDEFINES = TEEPRO;TEE8 +!endif + +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for TeeChart by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC10.cpp new file mode 100644 index 00000000..79dce1fe --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC10.cpp @@ -0,0 +1,29 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxPSTeeChartC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxPSCoreC10.bpi"); +#ifndef TEEPRO +USEPACKAGE("tee.bpi"); +#elif defined(TEE5) +USEPACKAGE("tee5C10.bpi"); +#elif defined(TEE6) +USEPACKAGE("tee6C10.bpi"); +#elif defined(TEE7) +USEPACKAGE("tee710.bpi"); +#elif defined(TEE8) +USEPACKAGE("tee810.bpi"); +#endif +USEUNIT("dxPSTCLnk.pas"); +USEUNIT("dxPSTCLnkReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC10.res b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC10.res new file mode 100644 index 00000000..76a696be Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC11.bpk new file mode 100644 index 00000000..b005b7e2 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC11.bpk @@ -0,0 +1,188 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSTeeChartC11.bpl +OBJFILES = dxPSTCLnkReg.obj dxPSTCLnk.obj dxPSTeeChartC11.obj +MAINSOURCE = dxPSTeeChartC11.cpp +RESFILES = dxPSTeeChartC11.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dxPSCoreC11.bpi +!if !$d(TEEPRO) +PACKAGES = $(PACKAGES) tee.bpi +USERDEFINES = +!elif $d(TEE5) +PACKAGES = $(PACKAGES) tee5C11.bpi +USERDEFINES = TEEPRO;TEE5 +!elif $d(TEE6) +PACKAGES = $(PACKAGES) tee6C11.bpi +USERDEFINES = TEEPRO;TEE6 +!elif $d(TEE7) +PACKAGES = $(PACKAGES) tee711.bpi +USERDEFINES = TEEPRO;TEE7 +!elif $d(TEE8) +PACKAGES = $(PACKAGES) tee811.bpi +USERDEFINES = TEEPRO;TEE8 +!endif + +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for TeeChart by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC11.cpp new file mode 100644 index 00000000..71deed8c --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC11.cpp @@ -0,0 +1,29 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxPSTeeChartC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxPSCoreC11.bpi"); +#ifndef TEEPRO +USEPACKAGE("tee.bpi"); +#elif defined(TEE5) +USEPACKAGE("tee5C11.bpi"); +#elif defined(TEE6) +USEPACKAGE("tee6C11.bpi"); +#elif defined(TEE7) +USEPACKAGE("tee711.bpi"); +#elif defined(TEE8) +USEPACKAGE("tee811.bpi"); +#endif +USEUNIT("dxPSTCLnk.pas"); +USEUNIT("dxPSTCLnkReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC11.res b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC11.res new file mode 100644 index 00000000..ac5a9c18 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC5.bpk new file mode 100644 index 00000000..160e8087 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC5.bpk @@ -0,0 +1,187 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPSTeeChartc5.bpl +OBJFILES = dxPSTCLnkReg.obj dxPSTCLnk.obj dxPSTeeChartc5.obj +RESFILES = dxPSTeeChartc5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = vcl50.bpi dxPSCorec5.bpi +!if !$d(TEEPRO) +PACKAGES = $(PACKAGES) tee50.bpi +USERDEFINES = +!elif $d(TEE5) +PACKAGES = $(PACKAGES) tee5c5.bpi +USERDEFINES = TEEPRO;TEE5 +!elif $d(TEE6) +PACKAGES = $(PACKAGES) tee6c5.bpi +USERDEFINES = TEEPRO;TEE6 +!elif $d(TEE7) +PACKAGES = $(PACKAGES) tee7c5.bpi +USERDEFINES = TEEPRO;TEE7 +!elif $d(TEE8) +PACKAGES = $(PACKAGES) tee8c5.bpi +USERDEFINES = TEEPRO;TEE8 +!endif + +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for TeeChart by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC5.cpp new file mode 100644 index 00000000..dd8643cb --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC5.cpp @@ -0,0 +1,29 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxPSTeeChartc5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("dxPSCorec5.bpi"); +#ifndef TEEPRO +USEPACKAGE("tee50.bpi"); +#elif defined(TEE5) +USEPACKAGE("tee5c5.bpi"); +#elif defined(TEE6) +USEPACKAGE("tee6c5.bpi"); +#elif defined(TEE7) +USEPACKAGE("tee7c5.bpi"); +#elif defined(TEE8) +USEPACKAGE("tee8c5.bpi"); +#endif +USEUNIT("dxPSTCLnk.pas"); +USEUNIT("dxPSTCLnkReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC5.res b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC5.res new file mode 100644 index 00000000..5b950a09 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC6.bpk new file mode 100644 index 00000000..5595065a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC6.bpk @@ -0,0 +1,187 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSTeeChartC6.bpl +OBJFILES = dxPSTCLnkReg.obj dxPSTCLnk.obj dxPSTeeChartC6.obj +RESFILES = dxPSTeeChartC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dxPSCoreC6.bpi +!if !$d(TEEPRO) +PACKAGES = $(PACKAGES) tee.bpi +USERDEFINES = +!elif $d(TEE5) +PACKAGES = $(PACKAGES) tee5c6.bpi +USERDEFINES = TEEPRO;TEE5 +!elif $d(TEE6) +PACKAGES = $(PACKAGES) tee6c6.bpi +USERDEFINES = TEEPRO;TEE6 +!elif $d(TEE7) +PACKAGES = $(PACKAGES) tee7c6.bpi +USERDEFINES = TEEPRO;TEE7 +!elif $d(TEE8) +PACKAGES = $(PACKAGES) tee8c6.bpi +USERDEFINES = TEEPRO;TEE8 +!endif + +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for TeeChart by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC6.cpp new file mode 100644 index 00000000..b75eb494 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC6.cpp @@ -0,0 +1,29 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxPSTeeChartC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +#ifndef TEEPRO +USEPACKAGE("tee.bpi"); +#elif defined(TEE5) +USEPACKAGE("tee5c6.bpi"); +#elif defined(TEE6) +USEPACKAGE("tee6c6.bpi"); +#elif defined(TEE7) +USEPACKAGE("tee7c6.bpi"); +#elif defined(TEE8) +USEPACKAGE("tee8c6.bpi"); +#endif +USEUNIT("dxPSTCLnk.pas"); +USEUNIT("dxPSTCLnkReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC6.res b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC6.res new file mode 100644 index 00000000..2c3aaac3 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD10.dpk new file mode 100644 index 00000000..d0674c84 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD10.dpk @@ -0,0 +1,47 @@ +package dxPSTeeChartD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for TeeChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD10, +{$IFNDEF TEEPRO} + tee; +{$ELSE} +{$IFDEF TEE7} + tee710; +{$ENDIF} +{$IFDEF TEE8} + tee810; +{$ENDIF} +{$ENDIF} + +contains + dxPSTCLnkReg, + dxPSTCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD10.res b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD10.res new file mode 100644 index 00000000..9582d95d Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD11.dpk new file mode 100644 index 00000000..12780f35 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD11.dpk @@ -0,0 +1,47 @@ +package dxPSTeeChartD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for TeeChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD11, +{$IFNDEF TEEPRO} + tee; +{$ELSE} +{$IFDEF TEE7} + tee711; +{$ENDIF} +{$IFDEF TEE8} + tee811; +{$ENDIF} +{$ENDIF} + +contains + dxPSTCLnkReg, + dxPSTCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD11.res b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD11.res new file mode 100644 index 00000000..4e290d9b Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD5.dpk new file mode 100644 index 00000000..2f5d606b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD5.dpk @@ -0,0 +1,52 @@ +package dxPSTeeChartD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for TeeChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxPSCoreD5, +{$IFNDEF TEEPRO} + tee50; +{$ELSE} +{$IFDEF TEE5} + tee55; +{$ENDIF} +{$IFDEF TEE6} + tee65; +{$ENDIF} +{$IFDEF TEE7} + tee75; +{$ENDIF} +{$IFDEF TEE8} + tee85; +{$ENDIF} +{$ENDIF} + +contains + dxPSTCLnkReg, + dxPSTCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD5.res b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD5.res new file mode 100644 index 00000000..0f6084df Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD6.dpk new file mode 100644 index 00000000..ab71091f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD6.dpk @@ -0,0 +1,53 @@ +package dxPSTeeChartD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for TeeChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD6, +{$IFNDEF TEEPRO} + tee; +{$ELSE} +{$IFDEF TEE5} + tee; +{$ENDIF} +{$IFDEF TEE6} + tee66; +{$ENDIF} +{$IFDEF TEE7} + tee76; +{$ENDIF} +{$IFDEF TEE8} + tee86; +{$ENDIF} +{$ENDIF} + +contains + dxPSTCLnkReg, + dxPSTCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD6.res b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD6.res new file mode 100644 index 00000000..75849531 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD7.dpk new file mode 100644 index 00000000..44460c8d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD7.dpk @@ -0,0 +1,53 @@ +package dxPSTeeChartD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for TeeChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD7, +{$IFNDEF TEEPRO} + tee; +{$ELSE} +{$IFDEF TEE5} + tee57; +{$ENDIF} +{$IFDEF TEE6} + tee67; +{$ENDIF} +{$IFDEF TEE7} + tee77; +{$ENDIF} +{$IFDEF TEE8} + tee87; +{$ENDIF} +{$ENDIF} + +contains + dxPSTCLnkReg, + dxPSTCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD7.res b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD7.res new file mode 100644 index 00000000..05fe45ea Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD9.dpk new file mode 100644 index 00000000..1adf309e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD9.dpk @@ -0,0 +1,47 @@ +package dxPSTeeChartD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for TeeChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD9, +{$IFNDEF TEEPRO} + tee; +{$ELSE} +{$IFDEF TEE7} + tee79; +{$ENDIF} +{$IFDEF TEE8} + tee89; +{$ENDIF} +{$ENDIF} + +contains + dxPSTCLnkReg, + dxPSTCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD9.res b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD9.res new file mode 100644 index 00000000..1dbe9614 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSTeeChartD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC10.bpk new file mode 100644 index 00000000..64667b97 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC10.bpk @@ -0,0 +1,175 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxCommonC10.bpl +OBJFILES = dxPScxCommon.obj dxPScxCommonReg.obj dxPScxDBEditorLnkReg.obj \ + dxPScxDBEditorLnks.obj dxPScxEditorLnks.obj dxPScxEditorLnkReg.obj \ + dxPScxEditorProducers.obj dxPScxImgLnk.obj dxPScxListBoxLnk.obj dxPScxCommonC10.obj +MAINSOURCE = dxPScxCommonC10.cpp +RESFILES = dxPScxCommonC10.res +DEFFILE = +RESDEPEN = +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib +PACKAGES = dxPSCoreC10.bpi dxPSLnksC10.bpi cxLibraryC10.bpi cxDataC10.bpi \ + cxEditorsC10.bpi designide.bpi dxThemeC10.bpi rtl.bpi vcl.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System Cross Platform Library by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC10.cpp new file mode 100644 index 00000000..26cf7f5e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC10.cpp @@ -0,0 +1,32 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxPSCoreC10.bpi"); +USERES("dxPScxCommonC10.res"); +USEPACKAGE("dxPSLnksC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEPACKAGE("designide.bpi"); +USEUNIT("dxPScxCommon.pas"); +USEUNIT("dxPScxCommonReg.pas"); +USEUNIT("dxPScxDBEditorLnkReg.pas"); +USEUNIT("dxPScxDBEditorLnks.pas"); +USEUNIT("dxPScxEditorLnks.pas"); +USEUNIT("dxPScxEditorLnkReg.pas"); +USEUNIT("dxPScxEditorProducers.pas"); +USEUNIT("dxPScxImgLnk.pas"); +USEUNIT("dxPScxListBoxLnk.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC10.res new file mode 100644 index 00000000..5857187e Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC11.bpk new file mode 100644 index 00000000..4dc62add --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC11.bpk @@ -0,0 +1,175 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxCommonC11.bpl +OBJFILES = dxPScxCommon.obj dxPScxCommonReg.obj dxPScxDBEditorLnkReg.obj \ + dxPScxDBEditorLnks.obj dxPScxEditorLnks.obj dxPScxEditorLnkReg.obj \ + dxPScxEditorProducers.obj dxPScxImgLnk.obj dxPScxListBoxLnk.obj dxPScxCommonC11.obj +MAINSOURCE = dxPScxCommonC11.cpp +RESFILES = dxPScxCommonC11.res +DEFFILE = +RESDEPEN = +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib +PACKAGES = dxPSCoreC11.bpi dxPSLnksC11.bpi cxLibraryC11.bpi cxDataC11.bpi \ + cxEditorsC11.bpi designide.bpi dxThemeC11.bpi rtl.bpi vcl.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System Cross Platform Library by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC11.cpp new file mode 100644 index 00000000..bf5ffb3b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC11.cpp @@ -0,0 +1,32 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxPSCoreC11.bpi"); +USERES("dxPScxCommonC11.res"); +USEPACKAGE("dxPSLnksC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("designide.bpi"); +USEUNIT("dxPScxCommon.pas"); +USEUNIT("dxPScxCommonReg.pas"); +USEUNIT("dxPScxDBEditorLnkReg.pas"); +USEUNIT("dxPScxDBEditorLnks.pas"); +USEUNIT("dxPScxEditorLnks.pas"); +USEUNIT("dxPScxEditorLnkReg.pas"); +USEUNIT("dxPScxEditorProducers.pas"); +USEUNIT("dxPScxImgLnk.pas"); +USEUNIT("dxPScxListBoxLnk.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC11.res new file mode 100644 index 00000000..7d023e97 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC5.bpk new file mode 100644 index 00000000..f57436a0 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC5.bpk @@ -0,0 +1,174 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPScxCommonC5.bpl +OBJFILES = dxPScxCommon.obj dxPScxCommonReg.obj dxPScxDBEditorLnkReg.obj \ + dxPScxDBEditorLnks.obj dxPScxEditorLnks.obj dxPScxEditorLnkReg.obj \ + dxPScxEditorProducers.obj dxPScxImgLnk.obj dxPScxListBoxLnk.obj dxPScxCommonC5.obj +RESFILES = dxPScxCommonC5.res +DEFFILE = +RESDEPEN = +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = dxPSCoreC5.bpi dxPSLnksC5.bpi cxLibraryVCLC5.bpi cxDataC5.bpi cxEditorsC5.bpi \ + dxThemeC5.bpi vcl50.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System Cross Platform Library by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC5.cpp new file mode 100644 index 00000000..f5947c03 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC5.cpp @@ -0,0 +1,30 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("dxPSCoreC5.bpi"); +USERES("dxPScxCommonC5.res"); +USEPACKAGE("dxPSLnksC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEUNIT("dxPScxCommon.pas"); +USEUNIT("dxPScxCommonReg.pas"); +USEUNIT("dxPScxDBEditorLnkReg.pas"); +USEUNIT("dxPScxDBEditorLnks.pas"); +USEUNIT("dxPScxEditorLnks.pas"); +USEUNIT("dxPScxEditorLnkReg.pas"); +USEUNIT("dxPScxEditorProducers.pas"); +USEUNIT("dxPScxImgLnk.pas"); +USEUNIT("dxPScxListBoxLnk.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC5.res new file mode 100644 index 00000000..a53e8e79 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC6.bpk new file mode 100644 index 00000000..9a9fe217 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC6.bpk @@ -0,0 +1,174 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxCommonC6.bpl +OBJFILES = dxPScxCommon.obj dxPScxCommonReg.obj dxPScxDBEditorLnkReg.obj \ + dxPScxDBEditorLnks.obj dxPScxEditorLnks.obj dxPScxEditorLnkReg.obj \ + dxPScxEditorProducers.obj dxPScxImgLnk.obj dxPScxListBoxLnk.obj dxPScxCommonC6.obj +RESFILES = dxPScxCommonC6.res +DEFFILE = +RESDEPEN = +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib +PACKAGES = dxPSCoreC6.bpi dxPSLnksC6.bpi cxLibraryVCLC6.bpi cxDataC6.bpi \ + cxEditorsVCLC6.bpi designide.bpi dxThemeC6.bpi rtl.bpi vcl.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System Cross Platform Library by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC6.cpp new file mode 100644 index 00000000..8d9e62bb --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC6.cpp @@ -0,0 +1,32 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USERES("dxPScxCommonC6.res"); +USEPACKAGE("dxPSLnksC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEPACKAGE("designide.bpi"); +USEUNIT("dxPScxCommon.pas"); +USEUNIT("dxPScxCommonReg.pas"); +USEUNIT("dxPScxDBEditorLnkReg.pas"); +USEUNIT("dxPScxDBEditorLnks.pas"); +USEUNIT("dxPScxEditorLnks.pas"); +USEUNIT("dxPScxEditorLnkReg.pas"); +USEUNIT("dxPScxEditorProducers.pas"); +USEUNIT("dxPScxImgLnk.pas"); +USEUNIT("dxPScxListBoxLnk.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC6.res new file mode 100644 index 00000000..52115c78 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD10.dpk new file mode 100644 index 00000000..bd63dcc5 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD10.dpk @@ -0,0 +1,47 @@ +package dxPScxCommonD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System Cross Platform Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD10, + dxPSLnksD10, + cxLibraryD10, + cxDataD10, + cxEditorsD10; + +contains + dxPScxCommon, + dxPScxCommonReg, + dxPScxDBEditorLnkReg, + dxPScxDBEditorLnks, + dxPScxEditorLnks, + dxPScxEditorLnkReg, + dxPScxEditorProducers, + dxPScxImgLnk, + dxPScxListBoxLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD10.res new file mode 100644 index 00000000..08f13bf3 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD11.dpk new file mode 100644 index 00000000..3480fa70 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD11.dpk @@ -0,0 +1,47 @@ +package dxPScxCommonD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System Cross Platform Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD11, + dxPSLnksD11, + cxLibraryD11, + cxDataD11, + cxEditorsD11; + +contains + dxPScxCommon, + dxPScxCommonReg, + dxPScxDBEditorLnkReg, + dxPScxDBEditorLnks, + dxPScxEditorLnks, + dxPScxEditorLnkReg, + dxPScxEditorProducers, + dxPScxImgLnk, + dxPScxListBoxLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD11.res new file mode 100644 index 00000000..f5112837 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD5.dpk new file mode 100644 index 00000000..ed840417 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD5.dpk @@ -0,0 +1,47 @@ +package dxPScxCommonD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System Cross Platform Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxPSCoreD5, + dxPSLnksD5, + cxLibraryVCLD5, + cxDataD5, + cxEditorsD5; + +contains + dxPScxCommon, + dxPScxCommonReg, + dxPScxDBEditorLnkReg, + dxPScxDBEditorLnks, + dxPScxEditorLnks, + dxPScxEditorLnkReg, + dxPScxEditorProducers, + dxPScxImgLnk, + dxPScxListBoxLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD5.res new file mode 100644 index 00000000..ef28747b Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD6.dpk new file mode 100644 index 00000000..ccb642c6 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD6.dpk @@ -0,0 +1,47 @@ +package dxPScxCommonD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System Cross Platform Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD6, + dxPSLnksD6, + cxLibraryVCLD6, + cxDataD6, + cxEditorsVCLD6; + +contains + dxPScxCommon, + dxPScxCommonReg, + dxPScxDBEditorLnkReg, + dxPScxDBEditorLnks, + dxPScxEditorLnks, + dxPScxEditorLnkReg, + dxPScxEditorProducers, + dxPScxImgLnk, + dxPScxListBoxLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD6.res new file mode 100644 index 00000000..a8e133ee Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD7.dpk new file mode 100644 index 00000000..bed1798b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD7.dpk @@ -0,0 +1,47 @@ +package dxPScxCommonD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System Cross Platform Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD7, + dxPSLnksD7, + cxLibraryVCLD7, + cxDataD7, + cxEditorsVCLD7; + +contains + dxPScxCommon, + dxPScxCommonReg, + dxPScxDBEditorLnkReg, + dxPScxDBEditorLnks, + dxPScxEditorLnks, + dxPScxEditorLnkReg, + dxPScxEditorProducers, + dxPScxImgLnk, + dxPScxListBoxLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD7.res b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD7.res new file mode 100644 index 00000000..1275a1c5 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD9.dpk new file mode 100644 index 00000000..6acd0eec --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD9.dpk @@ -0,0 +1,47 @@ +package dxPScxCommonD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System Cross Platform Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD9, + dxPSLnksD9, + cxLibraryD9, + cxDataD9, + cxEditorsD9; + +contains + dxPScxCommon, + dxPScxCommonReg, + dxPScxDBEditorLnkReg, + dxPScxDBEditorLnks, + dxPScxEditorLnks, + dxPScxEditorLnkReg, + dxPScxEditorProducers, + dxPScxImgLnk, + dxPScxListBoxLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD9.res b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD9.res new file mode 100644 index 00000000..13b3c6e6 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxCommonD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC10.bpk new file mode 100644 index 00000000..7d751035 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC10.bpk @@ -0,0 +1,171 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxExtCommonC10.bpl +OBJFILES = dxPScxCheckListBoxLnk.obj dxPScxExtComCtrlsLnk.obj dxPScxExtCommon.obj \ + dxPScxExtDBEditorLnkReg.obj dxPScxExtDBEditorLnks.obj dxPScxExtEditorLnkReg.obj \ + dxPScxExtEditorProducers.obj dxPScxMCListBoxLnk.obj dxPScxExtCommonC10.obj +MAINSOURCE = dxPScxExtCommonC10.cpp +RESFILES = dxPScxExtCommonC10.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxCheckListBoxLnk.dfm dxPScxMCListBoxLnk.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib +PACKAGES = dxPSCoreC10.bpi dxPSLnksC10.bpi cxLibraryC10.bpi cxDataC10.bpi \ + cxEditorsC10.bpi cxExtEditorsC10.bpi dxPScxCommonC10.bpi rtl.bpi vcl.bpi designide.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System Extended Cross Platform Library by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC10.cpp new file mode 100644 index 00000000..cd8fb90d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC10.cpp @@ -0,0 +1,31 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxPSCoreC10.bpi"); +USERES("dxPScxExtCommonC10.res"); +USEPACKAGE("dxPSLnksC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEPACKAGE("cxExtEditorsC10.bpi"); +USEUNIT("dxPScxCheckListBoxLnk.pas"); +USEUNIT("dxPScxExtComCtrlsLnk.pas"); +USEUNIT("dxPScxExtCommon.pas"); +USEUNIT("dxPScxExtDBEditorLnkReg.pas"); +USEUNIT("dxPScxExtDBEditorLnks.pas"); +USEUNIT("dxPScxExtEditorLnkReg.pas"); +USEUNIT("dxPScxExtEditorProducers.pas"); +USEUNIT("dxPScxMCListBoxLnk.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC10.res new file mode 100644 index 00000000..35ed854e Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC11.bpk new file mode 100644 index 00000000..ab059831 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC11.bpk @@ -0,0 +1,171 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxExtCommonC11.bpl +OBJFILES = dxPScxCheckListBoxLnk.obj dxPScxExtComCtrlsLnk.obj dxPScxExtCommon.obj \ + dxPScxExtDBEditorLnkReg.obj dxPScxExtDBEditorLnks.obj dxPScxExtEditorLnkReg.obj \ + dxPScxExtEditorProducers.obj dxPScxMCListBoxLnk.obj dxPScxExtCommonC11.obj +MAINSOURCE = dxPScxExtCommonC11.cpp +RESFILES = dxPScxExtCommonC11.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxCheckListBoxLnk.dfm dxPScxMCListBoxLnk.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib +PACKAGES = dxPSCoreC11.bpi dxPSLnksC11.bpi cxLibraryC11.bpi cxDataC11.bpi \ + cxEditorsC11.bpi cxExtEditorsC11.bpi dxPScxCommonC11.bpi rtl.bpi vcl.bpi designide.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System Extended Cross Platform Library by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC11.cpp new file mode 100644 index 00000000..58bdd060 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC11.cpp @@ -0,0 +1,31 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxPSCoreC11.bpi"); +USERES("dxPScxExtCommonC11.res"); +USEPACKAGE("dxPSLnksC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("cxExtEditorsC11.bpi"); +USEUNIT("dxPScxCheckListBoxLnk.pas"); +USEUNIT("dxPScxExtComCtrlsLnk.pas"); +USEUNIT("dxPScxExtCommon.pas"); +USEUNIT("dxPScxExtDBEditorLnkReg.pas"); +USEUNIT("dxPScxExtDBEditorLnks.pas"); +USEUNIT("dxPScxExtEditorLnkReg.pas"); +USEUNIT("dxPScxExtEditorProducers.pas"); +USEUNIT("dxPScxMCListBoxLnk.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC11.res new file mode 100644 index 00000000..e3c2943d Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC5.bpk new file mode 100644 index 00000000..e755df17 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC5.bpk @@ -0,0 +1,174 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPScxExtCommonC5.bpl +OBJFILES = dxPScxCheckListBoxLnk.obj dxPScxExtComCtrlsLnk.obj dxPScxExtCommon.obj \ + dxPScxExtDBEditorLnkReg.obj dxPScxExtDBEditorLnks.obj dxPScxExtEditorLnkReg.obj \ + dxPScxExtEditorProducers.obj dxPScxMCListBoxLnk.obj dxPScxExtCommonC5.obj +RESFILES = dxPScxExtCommonC5.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxCheckListBoxLnk.dfm dxPScxMCListBoxLnk.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = dxPSCoreC5.bpi dxPSLnksC5.bpi cxLibraryVCLC5.bpi cxDataC5.bpi cxEditorsC5.bpi \ + cxExtEditorsC5.bpi dxPScxCommonC5.bpi vcl50.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System Extended Cross Platform Library by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC5.cpp new file mode 100644 index 00000000..cfff2389 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC5.cpp @@ -0,0 +1,29 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("dxPSCoreC5.bpi"); +USERES("dxPScxExtCommonC5.res"); +USEPACKAGE("dxPSLnksC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("cxExtEditorsC5.bpi"); +USEUNIT("dxPScxCheckListBoxLnk.pas"); +USEUNIT("dxPScxExtComCtrlsLnk.pas"); +USEUNIT("dxPScxExtCommon.pas"); +USEUNIT("dxPScxExtDBEditorLnkReg.pas"); +USEUNIT("dxPScxExtDBEditorLnks.pas"); +USEUNIT("dxPScxExtEditorLnkReg.pas"); +USEUNIT("dxPScxExtEditorProducers.pas"); +USEUNIT("dxPScxMCListBoxLnk.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC5.res new file mode 100644 index 00000000..6486a4bf Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC6.bpk new file mode 100644 index 00000000..fccc1b83 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC6.bpk @@ -0,0 +1,174 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxExtCommonC6.bpl +OBJFILES = dxPScxCheckListBoxLnk.obj dxPScxExtComCtrlsLnk.obj dxPScxExtCommon.obj \ + dxPScxExtDBEditorLnkReg.obj dxPScxExtDBEditorLnks.obj dxPScxExtEditorLnkReg.obj \ + dxPScxExtEditorProducers.obj dxPScxMCListBoxLnk.obj dxPScxExtCommonC6.obj +RESFILES = dxPScxExtCommonC6.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxCheckListBoxLnk.dfm dxPScxMCListBoxLnk.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib +PACKAGES = dxPSCoreC6.bpi dxPSLnksC6.bpi cxLibraryVCLC6.bpi cxDataC6.bpi \ + cxEditorsVCLC6.bpi cxExtEditorsVCLC6.bpi dxPScxCommonC6.bpi rtl.bpi vcl.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System Extended Cross Platform Library by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC6.cpp new file mode 100644 index 00000000..7c86e26b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC6.cpp @@ -0,0 +1,30 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USERES("dxPScxExtCommonC6.res"); +USEPACKAGE("dxPSLnksC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("cxExtEditorsVCLC6.bpi"); +USEUNIT("dxPScxCheckListBoxLnk.pas"); +USEUNIT("dxPScxExtComCtrlsLnk.pas"); +USEUNIT("dxPScxExtCommon.pas"); +USEUNIT("dxPScxExtDBEditorLnkReg.pas"); +USEUNIT("dxPScxExtDBEditorLnks.pas"); +USEUNIT("dxPScxExtEditorLnkReg.pas"); +USEUNIT("dxPScxExtEditorProducers.pas"); +USEUNIT("dxPScxMCListBoxLnk.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC6.res new file mode 100644 index 00000000..0cddec17 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD10.dpk new file mode 100644 index 00000000..49752abd --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD10.dpk @@ -0,0 +1,47 @@ +package dxPScxExtCommonD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System Extended Cross Platform Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD10, + dxPScxCommonD10, + cxLibraryD10, + cxDataD10, + cxEditorsD10, + cxExtEditorsD10; + +contains + dxPScxCheckListBoxLnk, + dxPScxExtComCtrlsLnk, + dxPScxExtCommon, + dxPScxExtDBEditorLnkReg, + dxPScxExtDBEditorLnks, + dxPScxExtEditorLnkReg, + dxPScxExtEditorProducers, + dxPScxMCListBoxLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD10.res new file mode 100644 index 00000000..3f02e72e Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD11.dpk new file mode 100644 index 00000000..1847adaa --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD11.dpk @@ -0,0 +1,47 @@ +package dxPScxExtCommonD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System Extended Cross Platform Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD11, + dxPScxCommonD11, + cxLibraryD11, + cxDataD11, + cxEditorsD11, + cxExtEditorsD11; + +contains + dxPScxCheckListBoxLnk, + dxPScxExtComCtrlsLnk, + dxPScxExtCommon, + dxPScxExtDBEditorLnkReg, + dxPScxExtDBEditorLnks, + dxPScxExtEditorLnkReg, + dxPScxExtEditorProducers, + dxPScxMCListBoxLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD11.res new file mode 100644 index 00000000..f3fa8e42 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD5.dpk new file mode 100644 index 00000000..ca44b848 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD5.dpk @@ -0,0 +1,47 @@ +package dxPScxExtCommonD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System Extended Cross Platform Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxPSCoreD5, + dxPScxCommonD5, + cxLibraryVCLD5, + cxDataD5, + cxEditorsD5, + cxExtEditorsD5; + +contains + dxPScxCheckListBoxLnk, + dxPScxExtComCtrlsLnk, + dxPScxExtCommon, + dxPScxExtDBEditorLnkReg, + dxPScxExtDBEditorLnks, + dxPScxExtEditorLnkReg, + dxPScxExtEditorProducers, + dxPScxMCListBoxLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD5.res new file mode 100644 index 00000000..28df28f4 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD6.dpk new file mode 100644 index 00000000..d0939583 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD6.dpk @@ -0,0 +1,47 @@ +package dxPScxExtCommonD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System Extended Cross Platform Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD6, + dxPScxCommonD6, + cxLibraryVCLD6, + cxDataD6, + cxEditorsVCLD6, + cxExtEditorsVCLD6; + +contains + dxPScxCheckListBoxLnk, + dxPScxExtComCtrlsLnk, + dxPScxExtCommon, + dxPScxExtDBEditorLnkReg, + dxPScxExtDBEditorLnks, + dxPScxExtEditorLnkReg, + dxPScxExtEditorProducers, + dxPScxMCListBoxLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD6.res new file mode 100644 index 00000000..5ba1e8f0 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD7.dpk new file mode 100644 index 00000000..ce79473d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD7.dpk @@ -0,0 +1,47 @@ +package dxPScxExtCommonD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System Extended Cross Platform Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD7, + dxPScxCommonD7, + cxLibraryVCLD7, + cxDataD7, + cxEditorsVCLD7, + cxExtEditorsVCLD7; + +contains + dxPScxCheckListBoxLnk, + dxPScxExtComCtrlsLnk, + dxPScxExtCommon, + dxPScxExtDBEditorLnkReg, + dxPScxExtDBEditorLnks, + dxPScxExtEditorLnkReg, + dxPScxExtEditorProducers, + dxPScxMCListBoxLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD7.res b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD7.res new file mode 100644 index 00000000..e0f88e94 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD9.dpk new file mode 100644 index 00000000..d1df4634 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD9.dpk @@ -0,0 +1,47 @@ +package dxPScxExtCommonD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System Extended Cross Platform Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD9, + dxPScxCommonD9, + cxLibraryD9, + cxDataD9, + cxEditorsD9, + cxExtEditorsD9; + +contains + dxPScxCheckListBoxLnk, + dxPScxExtComCtrlsLnk, + dxPScxExtCommon, + dxPScxExtDBEditorLnkReg, + dxPScxExtDBEditorLnks, + dxPScxExtEditorLnkReg, + dxPScxExtEditorProducers, + dxPScxMCListBoxLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD9.res b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD9.res new file mode 100644 index 00000000..34c01dc3 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxExtCommonD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkC5.bpk new file mode 100644 index 00000000..815fae05 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkC5.bpk @@ -0,0 +1,169 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPScxGrid4LnkC5.bpl +OBJFILES = dxPScxGrid4LnkReg.obj dxPScxGrid4Lnk.obj dxPScxGrid4LnkPredefinedStyleSheets.obj \ + dxPScxGrid4LnkC5.obj +RESFILES = dxPScxGrid4LnkC5.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxGridLnk.dfm dxPScxGridLnkPredefinedStyleSheets.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC5.bpi cxLibraryVCLC5.bpi cxGridC5.bpi cxEditorsC5.bpi dxThemeC5.bpi \ + cxDataC5.bpi dclcxLibraryVCLC5.bpi dsnide50.bpi vcl50.bpi vclx50.bpi dxPScxCommonC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumGrid 4 by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkC5.cpp new file mode 100644 index 00000000..49b8f974 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkC5.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEPACKAGE("cxGridC5.bpi"); +USEPACKAGE("dclcxLibraryVCLC5.bpi"); +USEPACKAGE("dxPScxCommonC5.bpi"); +USERES("dxPScxGridLnkC5.res"); +USEUNIT("dxPScxGridLnkReg.pas"); +USEUNIT("dxPScxGridLnkPredefinedStyleSheets.pas"); +USEFORMNS("dxPScxGridLnk.pas", Dxpscxgridlnk, dxfmGridReportLinkDesignWindow); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vclx50.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkC5.res new file mode 100644 index 00000000..dbc7bbb7 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkC6.bpk new file mode 100644 index 00000000..08158386 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkC6.bpk @@ -0,0 +1,168 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxGrid4Lnkc6.bpl +OBJFILES = dxPScxGrid4LnkReg.obj dxPScxGrid4Lnk.obj dxPScxGrid4LnkPredefinedStyleSheets.obj dxPScxGrid4Lnkc6.obj +RESFILES = dxPScxGrid4Lnkc6.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxGridLnk.dfm dxPScxGridLnkPredefinedStyleSheets.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCorec6.bpi cxLibraryVCLC6.bpi cxGridVCLC6.bpi cxEditorsVCLC6.bpi dxThemeC6.bpi \ + cxDataC6.bpi designide.bpi vcl.bpi vclx.bpi rtl.bpi dclcxLibraryVCLC6.bpi dxPScxCommonC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumGrid 4 by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkC6.cpp new file mode 100644 index 00000000..d3d8c59b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkC6.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxPSCorec6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("dxPScxCommonC6.bpi"); +USEPACKAGE("dclcxLibraryVCLC6.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEPACKAGE("cxGridVCLC6.bpi"); +USERES("dxPScxGridLnkc6.res"); +USEUNIT("dxPScxGridLnkReg.pas"); +USEUNIT("dxPScxGridLnkPredefinedStyleSheets.pas"); +USEFORMNS("dxPScxGridLnk.pas", Dxpscxgridlnk, dxfmGridReportLinkDesignWindow); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkC6.res new file mode 100644 index 00000000..aaf7eb1b Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkD5.dpk new file mode 100644 index 00000000..42d8b57e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkD5.dpk @@ -0,0 +1,46 @@ +package dxPScxGrid4LnkD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS ON} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumGrid 4 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcljpg50, + vcldb50, + cxLibraryVCLD5, + dclcxLibraryVCLD5, + dxThemeD5, + dxPSCoreD5, + dxPScxCommonD5, + cxDataD5, + cxEditorsD5, + cxGridD5; + +contains + dxPScxGrid4LnkReg, + dxPScxGrid4LnkPredefinedStyleSheets, + dxPScxGrid4Lnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkD5.res new file mode 100644 index 00000000..5d260af2 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkD6.dpk new file mode 100644 index 00000000..1bc3ac54 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkD6.dpk @@ -0,0 +1,48 @@ +package dxPScxGrid4LnkD6; + +{$R *.RES} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS ON} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumGrid 4 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + vcljpg, + dbrtl, + vcldb, + cxLibraryVCLD6, + dclcxLibraryVCLD6, + dxThemeD6, + dxPSCoreD6, + dxPScxCommonD6, + cxDataD6, + cxEditorsVCLD6, + cxGridVCLD6; + +contains + dxPScxGrid4LnkReg, + dxPScxGrid4LnkPredefinedStyleSheets, + dxPScxGrid4Lnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkD6.res new file mode 100644 index 00000000..2ce7c1a6 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkD7.dpk new file mode 100644 index 00000000..e8df1535 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkD7.dpk @@ -0,0 +1,48 @@ +package dxPScxGrid4LnkD7; + +{$R *.RES} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS ON} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumGrid 4 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + vcljpg, + dbrtl, + vcldb, + cxLibraryVCLD7, + dclcxLibraryVCLD7, + dxThemeD7, + dxPSCoreD7, + dxPScxCommonD7, + cxDataD7, + cxEditorsVCLD7, + cxGridVCLD7; + +contains + dxPScxGrid4LnkReg, + dxPScxGrid4LnkPredefinedStyleSheets, + dxPScxGrid4Lnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkD7.res new file mode 100644 index 00000000..a678134c Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid4LnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC10.bpk new file mode 100644 index 00000000..88f655f2 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC10.bpk @@ -0,0 +1,168 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxGrid6LnkC10.bpl +OBJFILES = dxPScxGrid6LnkReg.obj dxPScxGrid6Lnk.obj dxPScxGrid6LnkPredefinedStyleSheets.obj dxPScxGrid6LnkC10.obj +RESFILES = dxPScxGrid6LnkC10.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxGrid6Lnk.dfm dxPScxGrid6LnkPredefinedStyleSheets.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC10.bpi cxLibraryC10.bpi cxGridC10.bpi cxEditorsC10.bpi dxThemeC10.bpi \ + cxDataC10.bpi designide.bpi vcl.bpi vclx.bpi rtl.bpi dclcxLibraryC10.bpi dxPScxCommonC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumGrid 6 by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC10.cpp new file mode 100644 index 00000000..6d48b2b9 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC10.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxPSCoreC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("dxPScxCommonC10.bpi"); +USEPACKAGE("dclcxLibraryC10.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEPACKAGE("cxGridC10.bpi"); +USERES("dxPScxGrid6LnkC10.res"); +USEUNIT("dxPScxGrid6LnkReg.pas"); +USEUNIT("dxPScxGrid6LnkPredefinedStyleSheets.pas"); +USEFORMNS("dxPScxGrid6Lnk.pas", DxpscxGrid6Lnk, dxfmGridReportLinkDesignWindow); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC10.res new file mode 100644 index 00000000..2d666cd8 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC11.bpk new file mode 100644 index 00000000..b0662fc6 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC11.bpk @@ -0,0 +1,168 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxGrid6LnkC11.bpl +OBJFILES = dxPScxGrid6LnkReg.obj dxPScxGrid6Lnk.obj dxPScxGrid6LnkPredefinedStyleSheets.obj dxPScxGrid6LnkC11.obj +RESFILES = dxPScxGrid6LnkC11.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxGrid6Lnk.dfm dxPScxGrid6LnkPredefinedStyleSheets.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC11.bpi cxLibraryC11.bpi cxGridC11.bpi cxEditorsC11.bpi dxThemeC11.bpi \ + cxDataC11.bpi designide.bpi vcl.bpi vclx.bpi rtl.bpi dclcxLibraryC11.bpi dxPScxCommonC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumGrid 6 by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC11.cpp new file mode 100644 index 00000000..aed5d8c7 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC11.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxPSCoreC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxPScxCommonC11.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("cxGridC11.bpi"); +USERES("dxPScxGrid6LnkC11.res"); +USEUNIT("dxPScxGrid6LnkReg.pas"); +USEUNIT("dxPScxGrid6LnkPredefinedStyleSheets.pas"); +USEFORMNS("dxPScxGrid6Lnk.pas", DxpscxGrid6Lnk, dxfmGridReportLinkDesignWindow); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC11.res new file mode 100644 index 00000000..431c15c1 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC5.bpk new file mode 100644 index 00000000..dde63770 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC5.bpk @@ -0,0 +1,169 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPScxGrid6LnkC5.bpl +OBJFILES = dxPScxGrid6LnkReg.obj dxPScxGrid6Lnk.obj dxPScxGrid6LnkPredefinedStyleSheets.obj \ + dxPScxGrid6LnkC5.obj +RESFILES = dxPScxGrid6LnkC5.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxGrid6Lnk.dfm dxPScxGrid6LnkPredefinedStyleSheets.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC5.bpi cxLibraryVCLC5.bpi cxGridC5.bpi cxEditorsC5.bpi dxThemeC5.bpi \ + cxDataC5.bpi dclcxLibraryVCLC5.bpi dsnide50.bpi vcl50.bpi vclx50.bpi dxPScxCommonC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumGrid 6 by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC5.cpp new file mode 100644 index 00000000..a69a4669 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC5.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEPACKAGE("cxGridC5.bpi"); +USEPACKAGE("dclcxLibraryVCLC5.bpi"); +USEPACKAGE("dxPScxCommonC5.bpi"); +USERES("dxPScxGrid6LnkC5.res"); +USEUNIT("dxPScxGrid6LnkReg.pas"); +USEUNIT("dxPScxGrid6LnkPredefinedStyleSheets.pas"); +USEFORMNS("dxPScxGrid6Lnk.pas", DxpscxGrid6Lnk, dxfmGridReportLinkDesignWindow); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vclx50.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC5.res new file mode 100644 index 00000000..763dfbda Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC6.bpk new file mode 100644 index 00000000..c3141f9d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC6.bpk @@ -0,0 +1,168 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxGrid6Lnkc6.bpl +OBJFILES = dxPScxGrid6LnkReg.obj dxPScxGrid6Lnk.obj dxPScxGrid6LnkPredefinedStyleSheets.obj dxPScxGrid6Lnkc6.obj +RESFILES = dxPScxGrid6Lnkc6.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxGrid6Lnk.dfm dxPScxGrid6LnkPredefinedStyleSheets.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCorec6.bpi cxLibraryVCLC6.bpi cxGridC6.bpi cxEditorsVCLC6.bpi dxThemeC6.bpi \ + cxDataC6.bpi designide.bpi vcl.bpi vclx.bpi rtl.bpi dclcxLibraryVCLC6.bpi dxPScxCommonC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumGrid 6 by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC6.cpp new file mode 100644 index 00000000..421a51fb --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC6.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxPSCorec6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("dxPScxCommonC6.bpi"); +USEPACKAGE("dclcxLibraryVCLC6.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEPACKAGE("cxGridC6.bpi"); +USERES("dxPScxGrid6Lnkc6.res"); +USEUNIT("dxPScxGrid6LnkReg.pas"); +USEUNIT("dxPScxGrid6LnkPredefinedStyleSheets.pas"); +USEFORMNS("dxPScxGrid6Lnk.pas", DxpscxGrid6Lnk, dxfmGridReportLinkDesignWindow); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC6.res new file mode 100644 index 00000000..2bc834fa Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD10.dpk new file mode 100644 index 00000000..95ff75ad --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD10.dpk @@ -0,0 +1,48 @@ +package dxPScxGrid6LnkD10; + +{$R *.RES} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS ON} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumGrid 6 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + vcljpg, + dbrtl, + vcldb, + cxLibraryD10, + dclcxLibraryD10, + dxThemeD10, + dxPSCoreD10, + dxPScxCommonD10, + cxDataD10, + cxEditorsD10, + cxGridD10; + +contains + dxPScxGrid6LnkReg, + dxPScxGrid6LnkPredefinedStyleSheets, + dxPScxGrid6Lnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD10.res new file mode 100644 index 00000000..761888df Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD11.dpk new file mode 100644 index 00000000..ed8f9f3f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD11.dpk @@ -0,0 +1,48 @@ +package dxPScxGrid6LnkD11; + +{$R *.RES} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS ON} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumGrid 6 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + vcljpg, + dbrtl, + vcldb, + cxLibraryD11, + dclcxLibraryD11, + dxThemeD11, + dxPSCoreD11, + dxPScxCommonD11, + cxDataD11, + cxEditorsD11, + cxGridD11; + +contains + dxPScxGrid6LnkReg, + dxPScxGrid6LnkPredefinedStyleSheets, + dxPScxGrid6Lnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD11.res new file mode 100644 index 00000000..50392aab Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD5.dpk new file mode 100644 index 00000000..d44fd115 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD5.dpk @@ -0,0 +1,46 @@ +package dxPScxGrid6LnkD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS ON} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumGrid 6 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcljpg50, + vcldb50, + cxLibraryVCLD5, + dclcxLibraryVCLD5, + dxThemeD5, + dxPSCoreD5, + dxPScxCommonD5, + cxDataD5, + cxEditorsD5, + cxGridD5; + +contains + dxPScxGrid6LnkReg, + dxPScxGrid6LnkPredefinedStyleSheets, + dxPScxGrid6Lnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD5.res new file mode 100644 index 00000000..8b3bfc65 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD6.dpk new file mode 100644 index 00000000..68ffa9bc --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD6.dpk @@ -0,0 +1,48 @@ +package dxPScxGrid6LnkD6; + +{$R *.RES} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS ON} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumGrid 6 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + vcljpg, + dbrtl, + vcldb, + cxLibraryVCLD6, + dclcxLibraryVCLD6, + dxThemeD6, + dxPSCoreD6, + dxPScxCommonD6, + cxDataD6, + cxEditorsVCLD6, + cxGridD6; + +contains + dxPScxGrid6LnkReg, + dxPScxGrid6LnkPredefinedStyleSheets, + dxPScxGrid6Lnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD6.res new file mode 100644 index 00000000..df50aad5 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD7.dpk new file mode 100644 index 00000000..6fc947e1 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD7.dpk @@ -0,0 +1,48 @@ +package dxPScxGrid6LnkD7; + +{$R *.RES} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS ON} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumGrid 6 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + vcljpg, + dbrtl, + vcldb, + cxLibraryVCLD7, + dclcxLibraryVCLD7, + dxThemeD7, + dxPSCoreD7, + dxPScxCommonD7, + cxDataD7, + cxEditorsVCLD7, + cxGridD7; + +contains + dxPScxGrid6LnkReg, + dxPScxGrid6LnkPredefinedStyleSheets, + dxPScxGrid6Lnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD7.res new file mode 100644 index 00000000..d7fb845d Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD9.dpk new file mode 100644 index 00000000..a1673be7 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD9.dpk @@ -0,0 +1,48 @@ +package dxPScxGrid6LnkD9; + +{$R *.RES} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS ON} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumGrid 6 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + vcljpg, + dbrtl, + vcldb, + cxLibraryD9, + dclcxLibraryD9, + dxThemeD9, + dxPSCoreD9, + dxPScxCommonD9, + cxDataD9, + cxEditorsD9, + cxGridD9; + +contains + dxPScxGrid6LnkReg, + dxPScxGrid6LnkPredefinedStyleSheets, + dxPScxGrid6Lnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD9.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD9.res new file mode 100644 index 00000000..cb18055a Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGrid6LnkD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC10.bpk new file mode 100644 index 00000000..f771c5fe --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC10.bpk @@ -0,0 +1,169 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxGridLnkC10.bpl +OBJFILES = dxPScxGridLnkReg.obj dxPScxGridLnk.obj dxPScxGridLnkPredefinedStyleSheets.obj dxPScxGridLnkC10.obj +MAINSOURCE = dxPScxGridLnkC10.cpp +RESFILES = dxPScxGridLnkC10.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxGridLnk.dfm dxPScxGridLnkPredefinedStyleSheets.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC10.bpi cxLibraryC10.bpi cxGridC10.bpi cxEditorsC10.bpi dxThemeC10.bpi \ + cxDataC10.bpi designide.bpi vcl.bpi vclx.bpi rtl.bpi dclcxLibraryC10.bpi dxPScxCommonC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumGrid 5 by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC10.cpp new file mode 100644 index 00000000..e736337b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC10.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxPSCoreC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("dxPScxCommonC10.bpi"); +USEPACKAGE("dclcxLibraryC10.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEPACKAGE("cxGridC10.bpi"); +USERES("dxPScxGridLnkC10.res"); +USEUNIT("dxPScxGridLnkReg.pas"); +USEUNIT("dxPScxGridLnkPredefinedStyleSheets.pas"); +USEFORMNS("dxPScxGridLnk.pas", Dxpscxgridlnk, dxfmGridReportLinkDesignWindow); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC10.res new file mode 100644 index 00000000..4a43f4da Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC11.bpk new file mode 100644 index 00000000..3f7548d3 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC11.bpk @@ -0,0 +1,169 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxGridLnkC11.bpl +OBJFILES = dxPScxGridLnkReg.obj dxPScxGridLnk.obj dxPScxGridLnkPredefinedStyleSheets.obj dxPScxGridLnkC11.obj +MAINSOURCE = dxPScxGridLnkC11.cpp +RESFILES = dxPScxGridLnkC11.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxGridLnk.dfm dxPScxGridLnkPredefinedStyleSheets.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC11.bpi cxLibraryC11.bpi cxGridC11.bpi cxEditorsC11.bpi dxThemeC11.bpi \ + cxDataC11.bpi designide.bpi vcl.bpi vclx.bpi rtl.bpi dclcxLibraryC11.bpi dxPScxCommonC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumGrid 5 by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC11.cpp new file mode 100644 index 00000000..7f079397 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC11.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxPSCoreC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxPScxCommonC11.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("cxGridC11.bpi"); +USERES("dxPScxGridLnkC11.res"); +USEUNIT("dxPScxGridLnkReg.pas"); +USEUNIT("dxPScxGridLnkPredefinedStyleSheets.pas"); +USEFORMNS("dxPScxGridLnk.pas", Dxpscxgridlnk, dxfmGridReportLinkDesignWindow); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC11.res new file mode 100644 index 00000000..681a4f1d Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC5.bpk new file mode 100644 index 00000000..408083af --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC5.bpk @@ -0,0 +1,169 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPScxGridLnkC5.bpl +OBJFILES = dxPScxGridLnkReg.obj dxPScxGridLnk.obj dxPScxGridLnkPredefinedStyleSheets.obj \ + dxPScxGridLnkC5.obj +RESFILES = dxPScxGridLnkC5.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxGridLnk.dfm dxPScxGridLnkPredefinedStyleSheets.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC5.bpi cxLibraryVCLC5.bpi cxGridC5.bpi cxEditorsC5.bpi dxThemeC5.bpi \ + cxDataC5.bpi dclcxLibraryVCLC5.bpi dsnide50.bpi vcl50.bpi vclx50.bpi dxPScxCommonC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumGrid 5 by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC5.cpp new file mode 100644 index 00000000..49b8f974 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC5.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEPACKAGE("cxGridC5.bpi"); +USEPACKAGE("dclcxLibraryVCLC5.bpi"); +USEPACKAGE("dxPScxCommonC5.bpi"); +USERES("dxPScxGridLnkC5.res"); +USEUNIT("dxPScxGridLnkReg.pas"); +USEUNIT("dxPScxGridLnkPredefinedStyleSheets.pas"); +USEFORMNS("dxPScxGridLnk.pas", Dxpscxgridlnk, dxfmGridReportLinkDesignWindow); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vclx50.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC5.res new file mode 100644 index 00000000..736e9521 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC6.bpk new file mode 100644 index 00000000..3470923c --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC6.bpk @@ -0,0 +1,168 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxGridLnkc6.bpl +OBJFILES = dxPScxGridLnkReg.obj dxPScxGridLnk.obj dxPScxGridLnkPredefinedStyleSheets.obj dxPScxGridLnkc6.obj +RESFILES = dxPScxGridLnkc6.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxGridLnk.dfm dxPScxGridLnkPredefinedStyleSheets.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCorec6.bpi cxLibraryVCLC6.bpi cxGridVCLC6.bpi cxEditorsVCLC6.bpi dxThemeC6.bpi \ + cxDataC6.bpi designide.bpi vcl.bpi vclx.bpi rtl.bpi dclcxLibraryVCLC6.bpi dxPScxCommonC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumGrid 5 by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC6.cpp new file mode 100644 index 00000000..d3d8c59b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC6.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxPSCorec6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("dxPScxCommonC6.bpi"); +USEPACKAGE("dclcxLibraryVCLC6.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEPACKAGE("cxGridVCLC6.bpi"); +USERES("dxPScxGridLnkc6.res"); +USEUNIT("dxPScxGridLnkReg.pas"); +USEUNIT("dxPScxGridLnkPredefinedStyleSheets.pas"); +USEFORMNS("dxPScxGridLnk.pas", Dxpscxgridlnk, dxfmGridReportLinkDesignWindow); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC6.res new file mode 100644 index 00000000..802e3109 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD10.dpk new file mode 100644 index 00000000..3bfe0266 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD10.dpk @@ -0,0 +1,48 @@ +package dxPScxGridLnkD10; + +{$R *.RES} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS ON} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumGrid 5 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + vcljpg, + dbrtl, + vcldb, + cxLibraryD10, + dclcxLibraryD10, + dxThemeD10, + dxPSCoreD10, + dxPScxCommonD10, + cxDataD10, + cxEditorsD10, + cxGridD10; + +contains + dxPScxGridLnkReg, + dxPScxGridLnkPredefinedStyleSheets, + dxPScxGridLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD10.res new file mode 100644 index 00000000..966bf6d4 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD11.dpk new file mode 100644 index 00000000..edb7b81f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD11.dpk @@ -0,0 +1,48 @@ +package dxPScxGridLnkD11; + +{$R *.RES} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS ON} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumGrid 5 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + vcljpg, + dbrtl, + vcldb, + cxLibraryD11, + dclcxLibraryD11, + dxThemeD11, + dxPSCoreD11, + dxPScxCommonD11, + cxDataD11, + cxEditorsD11, + cxGridD11; + +contains + dxPScxGridLnkReg, + dxPScxGridLnkPredefinedStyleSheets, + dxPScxGridLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD11.res new file mode 100644 index 00000000..b0a52895 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD5.dpk new file mode 100644 index 00000000..592ac438 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD5.dpk @@ -0,0 +1,46 @@ +package dxPScxGridLnkD5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS ON} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumGrid 5 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcljpg50, + vcldb50, + cxLibraryVCLD5, + dclcxLibraryVCLD5, + dxThemeD5, + dxPSCoreD5, + dxPScxCommonD5, + cxDataD5, + cxEditorsD5, + cxGridD5; + +contains + dxPScxGridLnkReg, + dxPScxGridLnkPredefinedStyleSheets, + dxPScxGridLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD5.res new file mode 100644 index 00000000..05d6e349 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD6.dpk new file mode 100644 index 00000000..53881678 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD6.dpk @@ -0,0 +1,48 @@ +package dxPScxGridLnkD6; + +{$R *.RES} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS ON} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumGrid 5 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + vcljpg, + dbrtl, + vcldb, + cxLibraryVCLD6, + dclcxLibraryVCLD6, + dxThemeD6, + dxPSCoreD6, + dxPScxCommonD6, + cxDataD6, + cxEditorsVCLD6, + cxGridVCLD6; + +contains + dxPScxGridLnkReg, + dxPScxGridLnkPredefinedStyleSheets, + dxPScxGridLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD6.res new file mode 100644 index 00000000..b4e2ac9b Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD7.dpk new file mode 100644 index 00000000..cac71fbd --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD7.dpk @@ -0,0 +1,48 @@ +package dxPScxGridLnkD7; + +{$R *.RES} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS ON} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumGrid 5 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + vcljpg, + dbrtl, + vcldb, + cxLibraryVCLD7, + dclcxLibraryVCLD7, + dxThemeD7, + dxPSCoreD7, + dxPScxCommonD7, + cxDataD7, + cxEditorsVCLD7, + cxGridVCLD7; + +contains + dxPScxGridLnkReg, + dxPScxGridLnkPredefinedStyleSheets, + dxPScxGridLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD7.res new file mode 100644 index 00000000..6dd28794 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD9.dpk new file mode 100644 index 00000000..65157e44 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD9.dpk @@ -0,0 +1,48 @@ +package dxPScxGridLnkD9; + +{$R *.RES} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS ON} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumGrid 5 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + vcljpg, + dbrtl, + vcldb, + cxLibraryD9, + dclcxLibraryD9, + dxThemeD9, + dxPSCoreD9, + dxPScxCommonD9, + cxDataD9, + cxEditorsD9, + cxGridD9; + +contains + dxPScxGridLnkReg, + dxPScxGridLnkPredefinedStyleSheets, + dxPScxGridLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD9.res b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD9.res new file mode 100644 index 00000000..8c225c3b Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxGridLnkD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC10.bpk new file mode 100644 index 00000000..19824f14 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC10.bpk @@ -0,0 +1,172 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxPCProdC10.bpl +OBJFILES = dxPScxPageControlProducer.obj dxPScxPCProdC10.obj +MAINSOURCE = dxPScxPCProdC10.cpp +RESFILES = dxPScxPCProdC10.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib +PACKAGES = dxPSCoreC10.bpi cxPageControlC10.bpi rtl.bpi vcl.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ContainerProducer for ExpressPageControl 2 by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC10.cpp new file mode 100644 index 00000000..d921bdbc --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC10.cpp @@ -0,0 +1,19 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxPSCoreC10.bpi"); +USERES("dxPScxPCProdC10.res"); +USEPACKAGE("cxPageControlC10.bpi"); +USEUNIT("dxPScxPageControlProducer.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC10.res new file mode 100644 index 00000000..f6d8a656 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC11.bpk new file mode 100644 index 00000000..ffa2fa84 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC11.bpk @@ -0,0 +1,172 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxPCProdC11.bpl +OBJFILES = dxPScxPageControlProducer.obj dxPScxPCProdC11.obj +MAINSOURCE = dxPScxPCProdC11.cpp +RESFILES = dxPScxPCProdC11.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib +PACKAGES = dxPSCoreC11.bpi cxPageControlC11.bpi rtl.bpi vcl.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ContainerProducer for ExpressPageControl 2 by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC11.cpp new file mode 100644 index 00000000..fc7c82fc --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC11.cpp @@ -0,0 +1,19 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxPSCoreC11.bpi"); +USERES("dxPScxPCProdC11.res"); +USEPACKAGE("cxPageControlC11.bpi"); +USEUNIT("dxPScxPageControlProducer.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC11.res new file mode 100644 index 00000000..712a658e Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC5.bpk new file mode 100644 index 00000000..89ddf7da --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC5.bpk @@ -0,0 +1,171 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPScxPCProdC5.bpl +OBJFILES = dxPScxPageControlProducer.obj dxPScxPCProdC5.obj +RESFILES = dxPScxPCProdC5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = dxPSCoreC5.bpi cxPageControlC5.bpi vcl50.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ContainerProducer for ExpressPageControl 2 by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC5.cpp new file mode 100644 index 00000000..167a9701 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC5.cpp @@ -0,0 +1,18 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("dxPSCoreC5.bpi"); +USERES("dxPScxPCProdC5.res"); +USEPACKAGE("cxPageControlC5.bpi"); +USEUNIT("dxPScxPageControlProducer.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC5.res new file mode 100644 index 00000000..5bb8ffc0 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC6.bpk new file mode 100644 index 00000000..bb4b596f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC6.bpk @@ -0,0 +1,171 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxPCProdC6.bpl +OBJFILES = dxPScxPageControlProducer.obj dxPScxPCProdC6.obj +RESFILES = dxPScxPCProdC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib +PACKAGES = dxPSCoreC6.bpi cxPageControlVCLC6.bpi rtl.bpi vcl.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ContainerProducer for ExpressPageControl 2 by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC6.cpp new file mode 100644 index 00000000..993d7caa --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC6.cpp @@ -0,0 +1,19 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USERES("dxPScxPCProdC6.res"); +USEPACKAGE("cxPageControlVCLC6.bpi"); +USEUNIT("dxPScxPageControlProducer.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC6.res new file mode 100644 index 00000000..36db34ec Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD10.dpk new file mode 100644 index 00000000..171bd4fb --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD10.dpk @@ -0,0 +1,38 @@ +package dxPScxPCProdD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ContainerProducer for ExpressPageControl 2 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dxPSCoreD10, + cxPageControlD10; + +contains + dxPScxPageControlProducer; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD10.res new file mode 100644 index 00000000..c1b9d55a Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD11.dpk new file mode 100644 index 00000000..6252dd42 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD11.dpk @@ -0,0 +1,38 @@ +package dxPScxPCProdD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ContainerProducer for ExpressPageControl 2 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dxPSCoreD11, + cxPageControlD11; + +contains + dxPScxPageControlProducer; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD11.res new file mode 100644 index 00000000..c9fe059d Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD5.dpk new file mode 100644 index 00000000..a0d66c70 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD5.dpk @@ -0,0 +1,36 @@ +package dxPScxPCProdD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ContainerProducer for ExpressPageControl 2 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxPSCoreD5, + cxPageControlD5; + +contains + dxPScxPageControlProducer; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD5.res new file mode 100644 index 00000000..f21be0c9 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD6.dpk new file mode 100644 index 00000000..88f493cc --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD6.dpk @@ -0,0 +1,38 @@ +package dxPScxPCProdD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ContainerProducer for ExpressPageControl 2 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dxPSCoreD6, + cxPageControlVCLD6; + +contains + dxPScxPageControlProducer; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD6.res new file mode 100644 index 00000000..c4e19fd2 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD7.dpk new file mode 100644 index 00000000..e76abad0 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD7.dpk @@ -0,0 +1,38 @@ +package dxPScxPCProdD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ContainerProducer for ExpressPageControl 2 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dxPSCoreD7, + cxPageControlVCLD7; + +contains + dxPScxPageControlProducer; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD7.res b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD7.res new file mode 100644 index 00000000..175b633e Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD9.dpk new file mode 100644 index 00000000..91df11c3 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD9.dpk @@ -0,0 +1,38 @@ +package dxPScxPCProdD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ContainerProducer for ExpressPageControl 2 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dxPSCoreD9, + cxPageControlD9; + +contains + dxPScxPageControlProducer; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD9.res b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD9.res new file mode 100644 index 00000000..f1575628 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxPCProdD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC10.bpk new file mode 100644 index 00000000..efb62ef2 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC10.bpk @@ -0,0 +1,175 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxPivotGridLnkC10.bpl +OBJFILES = dxPScxPivotGridLnkC10.obj dxPScxPivotGridLnk.obj dxPScxPivotGridLnkReg.obj + +RESFILES = dxPScxPivotGridLnkC10.res +MAINSOURCE = dxPScxPivotGridLnkC10.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi designide.bpi vcl.bpi dxPScxCommonC10.bpi dxPSCoreC10.bpi dcldxPSCoreC10.bpi \ + cxDataC10.bpi dclcxLibraryC10.bpi cxLibraryC10.bpi dclcxEditorsC10.bpi \ + cxEditorsC10.bpi cxPivotGridC10.bpi dxThemeC10.bpi dclcxPivotGridC10.bpi +SPARELIBS = rtl.lib CXLIBRARYC10.lib CXEDITORSC10.lib CXPIVOTGRIDC10.lib \ + DXPSCOREC10.lib dxPScxCommonC10.lib dclcxLibraryC10.lib dcldxPSCoreC10.lib dclcxPivotGridC10.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressPivotGrid by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC10.cpp new file mode 100644 index 00000000..1ad5ebd1 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC10.cpp @@ -0,0 +1,35 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +#pragma package(smart_init) + +USERES("dxPScxPivotGridLnkC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEUNIT("dxPScxPivotGridLnkReg.pas"); +USEFORMNS("dxPScxPivotGridLnk.pas", DxpscxPivotGridlnk, dxfmPivotGridReportLinkDesignWindow); +USEPACKAGE("dcldxPSCoreC10.bpi"); +USEPACKAGE("dxPSCoreC10.bpi"); +USEPACKAGE("cxPivotGridC10.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEPACKAGE("dclcxEditorsC10.bpi"); +USEPACKAGE("dclcxLibraryC10.bpi"); +USEPACKAGE("CXLIBRARYC10.bpi"); +USEPACKAGE("dxPScxCommonC10.bpi"); + +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- + diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC10.res new file mode 100644 index 00000000..514b2421 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC11.bpk new file mode 100644 index 00000000..c29a5b89 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC11.bpk @@ -0,0 +1,175 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxPivotGridLnkC11.bpl +OBJFILES = dxPScxPivotGridLnkC11.obj dxPScxPivotGridLnk.obj dxPScxPivotGridLnkReg.obj + +RESFILES = dxPScxPivotGridLnkC11.res +MAINSOURCE = dxPScxPivotGridLnkC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi designide.bpi vcl.bpi dxPScxCommonC11.bpi dxPSCoreC11.bpi dcldxPSCoreC11.bpi \ + cxDataC11.bpi dclcxLibraryC11.bpi cxLibraryC11.bpi dclcxEditorsC11.bpi \ + cxEditorsC11.bpi cxPivotGridC11.bpi dxThemeC11.bpi dclcxPivotGridC11.bpi +SPARELIBS = rtl.lib CXLIBRARYC11.lib CXEDITORSC11.lib CXPIVOTGRIDC11.lib \ + DXPSCOREC11.lib dxPScxCommonC11.lib dclcxLibraryC11.lib dcldxPSCoreC11.lib dclcxPivotGridC11.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressPivotGrid by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC11.cpp new file mode 100644 index 00000000..7ec27477 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC11.cpp @@ -0,0 +1,35 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +#pragma package(smart_init) + +USERES("dxPScxPivotGridLnkC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEUNIT("dxPScxPivotGridLnkReg.pas"); +USEFORMNS("dxPScxPivotGridLnk.pas", DxpscxPivotGridlnk, dxfmPivotGridReportLinkDesignWindow); +USEPACKAGE("dcldxPSCoreC11.bpi"); +USEPACKAGE("dxPSCoreC11.bpi"); +USEPACKAGE("cxPivotGridC11.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("dclcxEditorsC11.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEPACKAGE("CXLIBRARYC11.bpi"); +USEPACKAGE("dxPScxCommonC11.bpi"); + +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- + diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC11.res new file mode 100644 index 00000000..f1dfe4b9 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC5.bpk new file mode 100644 index 00000000..143c130f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC5.bpk @@ -0,0 +1,177 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPScxPivotGridLnkC5.bpl +OBJFILES = dxPScxPivotGridLnkReg.obj dxPScxPivotGridLnk.obj dxPScxPivotGridLnkC5.obj +RESFILES = dxPScxPivotGridLnkC5.res +MAINSOURCE = dxPScxPivotGridLnkC5.cpp +RESDEPEN = $(RESFILES) dxPScxPivotGridLnk.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = vcl50.bpi dcldxPSCorec5.bpi dxPSCorec5.bpi cxPivotGridC5.bpi dsnide50.bpi \ + cxDataC5.bpi dxThemeC5.bpi cxEditorsC5.bpi \ + dclcxEditorsC5.bpi dclcxLibraryVCLC5.bpi \ + CXLIBRARYVCLC5.bpi dxPScxCommonC5.bpi dclcxPivotGridC5.bpi +SPARELIBS = Vcl50.lib CXLIBRARYVCLC5.lib CXEDITORSC5.lib CXPivotGridC5.lib \ + DXPSCOREC5.lib dxPScxCommonC5.lib dclcxLibraryVCLC5.lib dcldxPSCorec5.lib dclcxPivotGridC5.lib +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressPivotGrid by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC5.cpp new file mode 100644 index 00000000..ec78c97e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC5.cpp @@ -0,0 +1,32 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dxPScxPivotGridLnkC5.res"); +USEPACKAGE("vcl50.bpi"); +USEUNIT("dxPScxPivotGridLnkReg.pas"); +USEFORMNS("dxPScxPivotGridLnk.pas", DxpscxPivotGridlnk, dxfmPivotGridReportLinkDesignWindow); +USEPACKAGE("dcldxPSCorec5.bpi"); +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("cxPivotGridC5.bpi"); +USEPACKAGE("dsnide50.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("dclcxEditorsC5.bpi"); +USEPACKAGE("dclcxLibraryVCLC5.bpi"); +USEPACKAGE("CXLIBRARYVCLC5.bpi"); +USEPACKAGE("dxPScxCommonC5.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC5.res new file mode 100644 index 00000000..e9154645 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC6.bpk new file mode 100644 index 00000000..17f35ba7 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC6.bpk @@ -0,0 +1,175 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxPivotGridLnkC6.bpl +OBJFILES = dxPScxPivotGridLnkC6.obj dxPScxPivotGridLnk.obj dxPScxPivotGridLnkReg.obj + +RESFILES = dxPScxPivotGridLnkC6.res +MAINSOURCE = dxPScxPivotGridLnkC6.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi designide.bpi vcl.bpi dxPScxCommonC6.bpi dxPSCoreC6.bpi dcldxPSCoreC6.bpi \ + cxDataC6.bpi dclcxLibraryVCLC6.bpi cxLibraryVCLC6.bpi dclcxEditorsVCLC6.bpi \ + cxEditorsVCLC6.bpi cxPivotGridC6.bpi dxThemeC6.bpi dclcxPivotGridC6.bpi +SPARELIBS = rtl.lib CXLIBRARYVCLC6.lib CXEDITORSVCLC6.lib CXPivotGridC6.lib \ + DXPSCOREC6.lib dxPScxCommonC6.lib dclcxLibraryVCLC6.lib dcldxPSCorec6.lib dclcxPivotGridC6.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressPivotGrid by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC6.cpp new file mode 100644 index 00000000..63df2ecf --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC6.cpp @@ -0,0 +1,35 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +#pragma package(smart_init) + +USERES("dxPScxPivotGridLnkC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEUNIT("dxPScxPivotGridLnkReg.pas"); +USEFORMNS("dxPScxPivotGridLnk.pas", DxpscxPivotGridlnk, dxfmPivotGridReportLinkDesignWindow); +USEPACKAGE("dcldxPSCoreC6.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USEPACKAGE("cxPivotGridVCLC6.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("dclcxEditorsVCLC6.bpi"); +USEPACKAGE("dclcxLibraryVCLC6.bpi"); +USEPACKAGE("CXLIBRARYVCLC6.bpi"); +USEPACKAGE("dxPScxCommonC6.bpi"); + +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- + \ No newline at end of file diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC6.res new file mode 100644 index 00000000..58045c73 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD10.dpk new file mode 100644 index 00000000..263e3c08 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD10.dpk @@ -0,0 +1,43 @@ +package dxPScxPivotGridLnkD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressPivotGrid by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD10, + dcldxPSCoreD10, + dxPScxCommonD10, + cxLibraryD10, + dclcxLibraryD10, + cxPivotGridD10, + dclcxPivotGridD10; + +contains + dxPScxPivotGridLnk, + dxPScxPivotGridLnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD10.res new file mode 100644 index 00000000..dfd7f422 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD11.dpk new file mode 100644 index 00000000..9409e13c --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD11.dpk @@ -0,0 +1,43 @@ +package dxPScxPivotGridLnkD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressPivotGrid by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD11, + dcldxPSCoreD11, + dxPScxCommonD11, + cxLibraryD11, + dclcxLibraryD11, + cxPivotGridD11, + dclcxPivotGridD11; + +contains + dxPScxPivotGridLnk, + dxPScxPivotGridLnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD11.res new file mode 100644 index 00000000..c3f2648a Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD5.dpk new file mode 100644 index 00000000..c8416d5f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD5.dpk @@ -0,0 +1,42 @@ +package dxPScxPivotGridLnkD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressPivotGrid by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxPSCoreD5, + dcldxPSCoreD5, + dxPScxCommonD5, + cxLibraryVCLD5, + dclcxLibraryVCLD5, + cxPivotGridD5, + dclcxPivotGridD5; + +contains + dxPScxPivotGridLnk, + dxPScxPivotGridLnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD5.res new file mode 100644 index 00000000..dfe78421 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD6.dpk new file mode 100644 index 00000000..0c4db18c --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD6.dpk @@ -0,0 +1,43 @@ +package dxPScxPivotGridLnkD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressPivotGrid by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD6, + dcldxPSCoreD6, + dxPScxCommonD6, + cxLibraryVCLD6, + dclcxLibraryVCLD6, + cxPivotGridD6, + dclcxPivotGridD6; + +contains + dxPScxPivotGridLnk, + dxPScxPivotGridLnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD6.res new file mode 100644 index 00000000..084bc63e Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD7.dpk new file mode 100644 index 00000000..b72b65ab --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD7.dpk @@ -0,0 +1,43 @@ +package dxPScxPivotGridLnkD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressPivotGrid by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD7, + dcldxPSCoreD7, + dxPScxCommonD7, + cxLibraryVCLD7, + dclcxLibraryVCLD7, + cxPivotGridD7, + dclcxPivotGridD7; + +contains + dxPScxPivotGridLnk, + dxPScxPivotGridLnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD7.res new file mode 100644 index 00000000..9885392d Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD9.dpk new file mode 100644 index 00000000..691ce3f6 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD9.dpk @@ -0,0 +1,43 @@ +package dxPScxPivotGridLnkD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressPivotGrid by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD9, + dcldxPSCoreD9, + dxPScxCommonD9, + cxLibraryD9, + dclcxLibraryD9, + cxPivotGridD9, + dclcxPivotGridD9; + +contains + dxPScxPivotGridLnk, + dxPScxPivotGridLnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD9.res b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD9.res new file mode 100644 index 00000000..97c6e32e Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxPivotGridLnkD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC10.bpk new file mode 100644 index 00000000..937e36c8 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC10.bpk @@ -0,0 +1,170 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxSSLnkC10.bpl +OBJFILES = dxPScxSSLnkReg.obj dxPScxSSLnk.obj dxPSExcelEdgePatterns.obj \ + dxPSExcelFillPatterns.obj dxPScxSSLnkC10.obj +MAINSOURCE = dxPScxSSLnkC10.cpp +RESFILES = dxPScxSSLnkC10.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxSSLnk.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC10.bpi cxLibraryC10.bpi cxSpreadSheetC10.bpi designide.bpi \ + vcl.bpi vclx.bpi rtl.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressSpreadSheet by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC10.cpp new file mode 100644 index 00000000..4478929a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC10.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxPSCoreC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("cxSpreadSheetC10.bpi"); +USERES("dxPScxSSLnkC10.res"); +USEUNIT("dxPScxSSLnkReg.pas"); +USEUNIT("dxPSExcelEdgePatterns.pas"); +USEUNIT("dxPSExcelFillPatterns.pas"); +USEFORMNS("dxPScxSSLnk.pas", Dxpscxsslnk, fmdxSpreadSheetDesignWindow); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC10.res new file mode 100644 index 00000000..07cf61b7 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC11.bpk new file mode 100644 index 00000000..09a00cf5 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC11.bpk @@ -0,0 +1,170 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxSSLnkC11.bpl +OBJFILES = dxPScxSSLnkReg.obj dxPScxSSLnk.obj dxPSExcelEdgePatterns.obj \ + dxPSExcelFillPatterns.obj dxPScxSSLnkC11.obj +MAINSOURCE = dxPScxSSLnkC11.cpp +RESFILES = dxPScxSSLnkC11.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxSSLnk.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC11.bpi cxLibraryC11.bpi cxSpreadSheetC11.bpi designide.bpi \ + vcl.bpi vclx.bpi rtl.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressSpreadSheet by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC11.cpp new file mode 100644 index 00000000..f135614b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC11.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxPSCoreC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("cxSpreadSheetC11.bpi"); +USERES("dxPScxSSLnkC11.res"); +USEUNIT("dxPScxSSLnkReg.pas"); +USEUNIT("dxPSExcelEdgePatterns.pas"); +USEUNIT("dxPSExcelFillPatterns.pas"); +USEFORMNS("dxPScxSSLnk.pas", Dxpscxsslnk, fmdxSpreadSheetDesignWindow); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC11.res new file mode 100644 index 00000000..c1c2b33a Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC5.bpk new file mode 100644 index 00000000..a33baa38 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC5.bpk @@ -0,0 +1,168 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPScxSSLnkc5.bpl +OBJFILES = dxPScxSSLnkReg.obj dxPSExcelEdgePatterns.obj \ + dxPSExcelFillPatterns.obj dxPScxSSLnk.obj dxPScxSSLnkc5.obj +RESFILES = dxPScxSSLnkc5.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxSSLnk.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = dxPSCorec5.bpi cxLibraryVCLC5.bpi cxSpreadSheetVCLC5.bpi vcl50.bpi vclx50.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressSpreadSheet by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC5.cpp new file mode 100644 index 00000000..f8f9620b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC5.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("cxSpreadSheetVCLC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USERES("dxPScxSSLnkc5.res"); +USEUNIT("dxPScxSSLnkReg.pas"); +USEUNIT("dxPSExcelEdgePatterns.pas"); +USEUNIT("dxPSExcelFillPatterns.pas"); +USEFORMNS("dxPScxSSLnk.pas", Dxpscxsslnk, fmdxSpreadSheetDesignWindow); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vclx50.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC5.res new file mode 100644 index 00000000..53625dd6 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC6.bpk new file mode 100644 index 00000000..fe05f21b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC6.bpk @@ -0,0 +1,169 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxSSLnkc6.bpl +OBJFILES = dxPScxSSLnkReg.obj dxPScxSSLnk.obj dxPSExcelEdgePatterns.obj \ + dxPSExcelFillPatterns.obj dxPScxSSLnkc6.obj +RESFILES = dxPScxSSLnkc6.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxSSLnk.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCorec6.bpi cxLibraryVCLC6.bpi cxSpreadSheetVCLC6.bpi designide.bpi \ + vcl.bpi vclx.bpi rtl.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressSpreadSheet by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC6.cpp new file mode 100644 index 00000000..72d4e3da --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC6.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxPSCorec6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("cxSpreadSheetVCLC6.bpi"); +USERES("dxPScxSSLnkc6.res"); +USEUNIT("dxPScxSSLnkReg.pas"); +USEUNIT("dxPSExcelEdgePatterns.pas"); +USEUNIT("dxPSExcelFillPatterns.pas"); +USEFORMNS("dxPScxSSLnk.pas", Dxpscxsslnk, fmdxSpreadSheetDesignWindow); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC6.res new file mode 100644 index 00000000..bcaafa5f Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD10.dpk new file mode 100644 index 00000000..2d3d8196 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD10.dpk @@ -0,0 +1,38 @@ +package dxPScxSSLnkD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressSpreadSheet by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + cxSpreadSheetD10, + dxPSCoreD10; + +contains + dxPScxSSLnkReg, + dxPScxSSLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD10.res new file mode 100644 index 00000000..dca7c2dc Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD11.dpk new file mode 100644 index 00000000..17890164 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD11.dpk @@ -0,0 +1,38 @@ +package dxPScxSSLnkD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressSpreadSheet by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + cxSpreadSheetD11, + dxPSCoreD11; + +contains + dxPScxSSLnkReg, + dxPScxSSLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD11.res new file mode 100644 index 00000000..3b8aeb32 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD5.dpk new file mode 100644 index 00000000..a4b8137a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD5.dpk @@ -0,0 +1,37 @@ +package dxPScxSSLnkD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressSpreadSheet by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + cxSpreadSheetVCLD5, + dxPSCoreD5; + +contains + dxPScxSSLnkReg, + dxPScxSSLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD5.res new file mode 100644 index 00000000..d4d5fcc1 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD6.dpk new file mode 100644 index 00000000..4ce72573 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD6.dpk @@ -0,0 +1,38 @@ +package dxPScxSSLnkD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressSpreadSheet by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + cxSpreadSheetVCLD6, + dxPSCoreD6; + +contains + dxPScxSSLnkReg, + dxPScxSSLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD6.res new file mode 100644 index 00000000..0df67345 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD7.dpk new file mode 100644 index 00000000..244a4c04 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD7.dpk @@ -0,0 +1,38 @@ +package dxPScxSSLnkD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressSpreadSheet by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + cxSpreadSheetVCLD7, + dxPSCoreD7; + +contains + dxPScxSSLnkReg, + dxPScxSSLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD7.res new file mode 100644 index 00000000..22674c69 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD9.dpk new file mode 100644 index 00000000..03229620 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD9.dpk @@ -0,0 +1,38 @@ +package dxPScxSSLnkD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressSpreadSheet by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + cxSpreadSheetD9, + dxPSCoreD9; + +contains + dxPScxSSLnkReg, + dxPScxSSLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD9.res b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD9.res new file mode 100644 index 00000000..75973adb Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxSSLnkD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC10.bpk new file mode 100644 index 00000000..2e836298 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC10.bpk @@ -0,0 +1,174 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxScheduler2LnkC10.bpl +OBJFILES = dxPScxScheduler2LnkC10.obj dxPScxScheduler2Lnk.obj dxPScxScheduler2LnkReg.obj +RESFILES = dxPScxScheduler2LnkC10.res +MAINSOURCE = dxPScxScheduler2LnkC10.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi designide.bpi vcl.bpi dxPScxCommonC10.bpi dxPSCoreC10.bpi dcldxPSCoreC10.bpi \ + cxDataC10.bpi dclcxLibraryC10.bpi cxLibraryC10.bpi dclcxEditorsC10.bpi \ + cxEditorsC10.bpi cxSchedulerC10.bpi dxThemeC10.bpi +SPARELIBS = rtl.lib CXLIBRARYC10.lib CXEDITORSC10.lib CXSCHEDULERC10.lib \ + DXPSCOREC10.lib dxPScxCommonC10.lib dclcxLibraryC10.lib dcldxPSCoreC10.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressScheduler 2 by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC10.cpp new file mode 100644 index 00000000..0dd66cb9 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC10.cpp @@ -0,0 +1,35 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +#pragma package(smart_init) + +USERES("dxPScxScheduler2LnkC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEUNIT("dxPScxScheduler2LnkReg.pas"); +USEFORMNS("dxPScxScheduler2Lnk.pas", Dxpscxscheduler2lnk, dxfmSchedulerReportLinkDesignWindow); +USEPACKAGE("dcldxPSCoreC10.bpi"); +USEPACKAGE("dxPSCoreC10.bpi"); +USEPACKAGE("cxSchedulerC10.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEPACKAGE("dclcxEditorsC10.bpi"); +USEPACKAGE("dclcxLibraryC10.bpi"); +USEPACKAGE("CXLIBRARYC10.bpi"); +USEPACKAGE("dxPScxCommonC10.bpi"); + +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- + diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC10.res new file mode 100644 index 00000000..faa62c12 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC11.bpk new file mode 100644 index 00000000..d5b61a28 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC11.bpk @@ -0,0 +1,174 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxScheduler2LnkC11.bpl +OBJFILES = dxPScxScheduler2LnkC11.obj dxPScxScheduler2Lnk.obj dxPScxScheduler2LnkReg.obj +RESFILES = dxPScxScheduler2LnkC11.res +MAINSOURCE = dxPScxScheduler2LnkC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi designide.bpi vcl.bpi dxPScxCommonC11.bpi dxPSCoreC11.bpi dcldxPSCoreC11.bpi \ + cxDataC11.bpi dclcxLibraryC11.bpi cxLibraryC11.bpi dclcxEditorsC11.bpi \ + cxEditorsC11.bpi cxSchedulerC11.bpi dxThemeC11.bpi +SPARELIBS = rtl.lib CXLIBRARYC11.lib CXEDITORSC11.lib CXSCHEDULERC11.lib \ + DXPSCOREC11.lib dxPScxCommonC11.lib dclcxLibraryC11.lib dcldxPSCoreC11.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressScheduler 2 by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC11.cpp new file mode 100644 index 00000000..02c4dd42 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC11.cpp @@ -0,0 +1,35 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +#pragma package(smart_init) + +USERES("dxPScxScheduler2LnkC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEUNIT("dxPScxScheduler2LnkReg.pas"); +USEFORMNS("dxPScxScheduler2Lnk.pas", Dxpscxscheduler2lnk, dxfmSchedulerReportLinkDesignWindow); +USEPACKAGE("dcldxPSCoreC11.bpi"); +USEPACKAGE("dxPSCoreC11.bpi"); +USEPACKAGE("cxSchedulerC11.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("dclcxEditorsC11.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEPACKAGE("CXLIBRARYC11.bpi"); +USEPACKAGE("dxPScxCommonC11.bpi"); + +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- + diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC11.res new file mode 100644 index 00000000..e0821e60 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC5.bpk new file mode 100644 index 00000000..b9b86b38 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC5.bpk @@ -0,0 +1,177 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPScxScheduler2LnkC5.bpl +OBJFILES = dxPScxScheduler2LnkReg.obj dxPScxScheduler2Lnk.obj dxPScxScheduler2LnkC5.obj +RESFILES = dxPScxScheduler2LnkC5.res +MAINSOURCE = dxPScxScheduler2LnkC5.cpp +RESDEPEN = $(RESFILES) dxPScxScheduler2Lnk.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = vcl50.bpi dcldxPSCorec5.bpi dxPSCorec5.bpi cxSchedulerC5.bpi dsnide50.bpi \ + cxDataC5.bpi dxThemeC5.bpi cxEditorsC5.bpi \ + dclcxEditorsC5.bpi dclcxLibraryVCLC5.bpi \ + CXLIBRARYVCLC5.bpi dxPScxCommonC5.bpi +SPARELIBS = Vcl50.lib CXLIBRARYVCLC5.lib CXEDITORSC5.lib CXSCHEDULERC5.lib \ + DXPSCOREC5.lib dxPScxCommonC5.lib dclcxLibraryVCLC5.lib dcldxPSCorec5.lib +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressScheduler 2 by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC5.cpp new file mode 100644 index 00000000..2e6d512c --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC5.cpp @@ -0,0 +1,32 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dxPScxScheduler2LnkC5.res"); +USEPACKAGE("vcl50.bpi"); +USEUNIT("dxPScxScheduler2LnkReg.pas"); +USEFORMNS("dxPScxScheduler2Lnk.pas", Dxpscxscheduler2lnk, dxfmSchedulerReportLinkDesignWindow); +USEPACKAGE("dcldxPSCorec5.bpi"); +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("cxSchedulerC5.bpi"); +USEPACKAGE("dsnide50.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("dclcxEditorsC5.bpi"); +USEPACKAGE("dclcxLibraryVCLC5.bpi"); +USEPACKAGE("CXLIBRARYVCLC5.bpi"); +USEPACKAGE("dxPScxCommonC5.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC5.res new file mode 100644 index 00000000..548783a0 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC6.bpk new file mode 100644 index 00000000..7b16216a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC6.bpk @@ -0,0 +1,175 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxScheduler2LnkC6.bpl +OBJFILES = dxPScxScheduler2LnkC6.obj dxPScxScheduler2Lnk.obj dxPScxScheduler2LnkReg.obj + +RESFILES = dxPScxScheduler2LnkC6.res +MAINSOURCE = dxPScxScheduler2LnkC6.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi designide.bpi vcl.bpi dxPScxCommonC6.bpi dxPSCoreC6.bpi dcldxPSCoreC6.bpi \ + cxDataC6.bpi dclcxLibraryVCLC6.bpi cxLibraryVCLC6.bpi dclcxEditorsVCLC6.bpi \ + cxEditorsVCLC6.bpi cxSchedulerVCLC6.bpi dxThemeC6.bpi +SPARELIBS = rtl.lib CXLIBRARYVCLC6.lib CXEDITORSVCLC6.lib CXSCHEDULERVCLC6.lib \ + DXPSCOREC6.lib dxPScxCommonC6.lib dclcxLibraryVCLC6.lib dcldxPSCorec6.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressScheduler 2 by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC6.cpp new file mode 100644 index 00000000..40975b44 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC6.cpp @@ -0,0 +1,35 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +#pragma package(smart_init) + +USERES("dxPScxScheduler2LnkC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEUNIT("dxPScxScheduler2LnkReg.pas"); +USEFORMNS("dxPScxScheduler2Lnk.pas", Dxpscxscheduler2lnk, dxfmSchedulerReportLinkDesignWindow); +USEPACKAGE("dcldxPSCoreC6.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USEPACKAGE("cxSchedulerVCLC6.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("dclcxEditorsVCLC6.bpi"); +USEPACKAGE("dclcxLibraryVCLC6.bpi"); +USEPACKAGE("CXLIBRARYVCLC6.bpi"); +USEPACKAGE("dxPScxCommonC6.bpi"); + +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- + \ No newline at end of file diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC6.res new file mode 100644 index 00000000..ae69fec0 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD10.dpk new file mode 100644 index 00000000..b6388298 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD10.dpk @@ -0,0 +1,42 @@ +package dxPScxScheduler2LnkD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressScheduler 2 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD10, + dcldxPSCoreD10, + dxPScxCommonD10, + cxLibraryD10, + dclcxLibraryD10, + cxSchedulerD10; + +contains + dxPScxScheduler2Lnk, + dxPScxScheduler2LnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD10.res new file mode 100644 index 00000000..6b07a9b6 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD11.dpk new file mode 100644 index 00000000..85024d53 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD11.dpk @@ -0,0 +1,42 @@ +package dxPScxScheduler2LnkD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressScheduler 2 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD11, + dcldxPSCoreD11, + dxPScxCommonD11, + cxLibraryD11, + dclcxLibraryD11, + cxSchedulerD11; + +contains + dxPScxScheduler2Lnk, + dxPScxScheduler2LnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD11.res new file mode 100644 index 00000000..ec26d76b Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD5.dpk new file mode 100644 index 00000000..dad710a1 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD5.dpk @@ -0,0 +1,41 @@ +package dxPScxScheduler2LnkD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressScheduler 2 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxPSCoreD5, + dcldxPSCoreD5, + dxPScxCommonD5, + cxLibraryVCLD5, + dclcxLibraryVCLD5, + cxSchedulerD5; + +contains + dxPScxScheduler2Lnk, + dxPScxScheduler2LnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD5.res new file mode 100644 index 00000000..0786c699 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD6.dpk new file mode 100644 index 00000000..cc2d5c8d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD6.dpk @@ -0,0 +1,42 @@ +package dxPScxScheduler2LnkD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressScheduler 2 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD6, + dcldxPSCoreD6, + dxPScxCommonD6, + cxLibraryVCLD6, + dclcxLibraryVCLD6, + cxSchedulerVCLD6; + +contains + dxPScxScheduler2Lnk, + dxPScxScheduler2LnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD6.res new file mode 100644 index 00000000..341dcf68 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD7.dpk new file mode 100644 index 00000000..40da5cd3 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD7.dpk @@ -0,0 +1,42 @@ +package dxPScxScheduler2LnkD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressScheduler 2 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD7, + dcldxPSCoreD7, + dxPScxCommonD7, + cxLibraryVCLD7, + dclcxLibraryVCLD7, + cxSchedulerVCLD7; + +contains + dxPScxScheduler2Lnk, + dxPScxScheduler2LnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD7.res new file mode 100644 index 00000000..3c03953d Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD9.dpk new file mode 100644 index 00000000..26b2bb16 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD9.dpk @@ -0,0 +1,42 @@ +package dxPScxScheduler2LnkD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressScheduler 2 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD9, + dcldxPSCoreD9, + dxPScxCommonD9, + cxLibraryD9, + dclcxLibraryD9, + cxSchedulerD9; + +contains + dxPScxScheduler2Lnk, + dxPScxScheduler2LnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD9.res b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD9.res new file mode 100644 index 00000000..20923c76 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler2LnkD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkC10.bpk new file mode 100644 index 00000000..d8043306 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkC10.bpk @@ -0,0 +1,174 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxScheduler3LnkC10.bpl +OBJFILES = dxPScxScheduler3LnkC10.obj dxPScxScheduler3Lnk.obj dxPScxScheduler3LnkReg.obj +RESFILES = dxPScxScheduler3LnkC10.res +MAINSOURCE = dxPScxScheduler3LnkC10.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi designide.bpi vcl.bpi dxPScxCommonC10.bpi dxPSCoreC10.bpi dcldxPSCoreC10.bpi \ + cxDataC10.bpi dclcxLibraryC10.bpi cxLibraryC10.bpi dclcxEditorsC10.bpi \ + cxEditorsC10.bpi cxSchedulerC10.bpi dxThemeC10.bpi +SPARELIBS = rtl.lib CXLIBRARYC10.lib CXEDITORSC10.lib CXSCHEDULERC10.lib \ + DXPSCOREC10.lib dxPScxCommonC10.lib dclcxLibraryC10.lib dcldxPSCoreC10.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressScheduler 3 by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkC10.cpp new file mode 100644 index 00000000..9cfde15b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkC10.cpp @@ -0,0 +1,35 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +#pragma package(smart_init) + +USERES("dxPScxScheduler3LnkC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEUNIT("dxPScxScheduler3LnkReg.pas"); +USEFORMNS("dxPScxScheduler3Lnk.pas", Dxpscxscheduler3lnk, dxfmSchedulerReportLinkDesignWindow); +USEPACKAGE("dcldxPSCoreC10.bpi"); +USEPACKAGE("dxPSCoreC10.bpi"); +USEPACKAGE("cxSchedulerC10.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEPACKAGE("dclcxEditorsC10.bpi"); +USEPACKAGE("dclcxLibraryC10.bpi"); +USEPACKAGE("CXLIBRARYC10.bpi"); +USEPACKAGE("dxPScxCommonC10.bpi"); + +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- + diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkC10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkC10.res new file mode 100644 index 00000000..3a2f59f2 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkC11.bpk new file mode 100644 index 00000000..7b2f9162 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkC11.bpk @@ -0,0 +1,174 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxScheduler3LnkC11.bpl +OBJFILES = dxPScxScheduler3LnkC11.obj dxPScxScheduler3Lnk.obj dxPScxScheduler3LnkReg.obj +RESFILES = dxPScxScheduler3LnkC11.res +MAINSOURCE = dxPScxScheduler3LnkC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi designide.bpi vcl.bpi dxPScxCommonC11.bpi dxPSCoreC11.bpi dcldxPSCoreC11.bpi \ + cxDataC11.bpi dclcxLibraryC11.bpi cxLibraryC11.bpi dclcxEditorsC11.bpi \ + cxEditorsC11.bpi cxSchedulerC11.bpi dxThemeC11.bpi +SPARELIBS = rtl.lib CXLIBRARYC11.lib CXEDITORSC11.lib CXSCHEDULERC11.lib \ + DXPSCOREC11.lib dxPScxCommonC11.lib dclcxLibraryC11.lib dcldxPSCoreC11.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressScheduler 3 by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkC11.cpp new file mode 100644 index 00000000..79b05c1f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkC11.cpp @@ -0,0 +1,35 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +#pragma package(smart_init) + +USERES("dxPScxScheduler3LnkC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEUNIT("dxPScxScheduler3LnkReg.pas"); +USEFORMNS("dxPScxScheduler3Lnk.pas", Dxpscxscheduler3lnk, dxfmSchedulerReportLinkDesignWindow); +USEPACKAGE("dcldxPSCoreC11.bpi"); +USEPACKAGE("dxPSCoreC11.bpi"); +USEPACKAGE("cxSchedulerC11.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("dclcxEditorsC11.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEPACKAGE("CXLIBRARYC11.bpi"); +USEPACKAGE("dxPScxCommonC11.bpi"); + +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- + diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkC11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkC11.res new file mode 100644 index 00000000..ffcf0012 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD10.dpk new file mode 100644 index 00000000..64adbe5b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD10.dpk @@ -0,0 +1,42 @@ +package dxPScxScheduler3LnkD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressScheduler 3 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD10, + dcldxPSCoreD10, + dxPScxCommonD10, + cxLibraryD10, + dclcxLibraryD10, + cxSchedulerD10; + +contains + dxPScxScheduler3Lnk, + dxPScxScheduler3LnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD10.res new file mode 100644 index 00000000..80f5ada7 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD11.dpk new file mode 100644 index 00000000..0aa24e67 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD11.dpk @@ -0,0 +1,42 @@ +package dxPScxScheduler3LnkD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressScheduler 3 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD11, + dcldxPSCoreD11, + dxPScxCommonD11, + cxLibraryD11, + dclcxLibraryD11, + cxSchedulerD11; + +contains + dxPScxScheduler3Lnk, + dxPScxScheduler3LnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD11.res new file mode 100644 index 00000000..29123299 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD7.dpk new file mode 100644 index 00000000..ce593297 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD7.dpk @@ -0,0 +1,42 @@ +package dxPScxScheduler3LnkD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressScheduler 3 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD7, + dcldxPSCoreD7, + dxPScxCommonD7, + cxLibraryVCLD7, + dclcxLibraryVCLD7, + cxSchedulerD7; + +contains + dxPScxScheduler3Lnk, + dxPScxScheduler3LnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD7.res new file mode 100644 index 00000000..337d5362 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD9.dpk new file mode 100644 index 00000000..a0a2b9c6 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD9.dpk @@ -0,0 +1,42 @@ +package dxPScxScheduler3LnkD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressScheduler 3 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD9, + dcldxPSCoreD9, + dxPScxCommonD9, + cxLibraryD9, + dclcxLibraryD9, + cxSchedulerD9; + +contains + dxPScxScheduler3Lnk, + dxPScxScheduler3LnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD9.res b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD9.res new file mode 100644 index 00000000..5a2888bb Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxScheduler3LnkD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkC5.bpk new file mode 100644 index 00000000..9b2c0450 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkC5.bpk @@ -0,0 +1,177 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPScxSchedulerLnkC5.bpl +OBJFILES = dxPScxSchedulerLnkReg.obj dxPScxSchedulerLnk.obj dxPScxSchedulerLnkC5.obj +RESFILES = dxPScxSchedulerLnkC5.res +MAINSOURCE = dxPScxSchedulerLnkC5.cpp +RESDEPEN = $(RESFILES) dxPScxSchedulerLnk.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = vcl50.bpi dcldxPSCorec5.bpi dxPSCorec5.bpi cxSchedulerC5.bpi dsnide50.bpi \ + cxDataC5.bpi dxThemeC5.bpi cxEditorsC5.bpi \ + dclcxEditorsC5.bpi dclcxLibraryVCLC5.bpi \ + CXLIBRARYVCLC5.bpi dxPScxCommonC5.bpi +SPARELIBS = Vcl50.lib CXLIBRARYVCLC5.lib CXEDITORSC5.lib CXSCHEDULERC5.lib \ + DXPSCOREC5.lib dxPScxCommonC5.lib dclcxLibraryVCLC5.lib dcldxPSCorec5.lib +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressScheduler by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkC5.cpp new file mode 100644 index 00000000..03ea6e39 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkC5.cpp @@ -0,0 +1,32 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dxPScxSchedulerLnkC5.res"); +USEPACKAGE("vcl50.bpi"); +USEUNIT("dxPScxSchedulerLnkReg.pas"); +USEFORMNS("dxPScxSchedulerLnk.pas", Dxpscxschedulerlnk, dxfmSchedulerReportLinkDesignWindow); +USEPACKAGE("dcldxPSCorec5.bpi"); +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("cxSchedulerC5.bpi"); +USEPACKAGE("dsnide50.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("dclcxEditorsC5.bpi"); +USEPACKAGE("dclcxLibraryVCLC5.bpi"); +USEPACKAGE("CXLIBRARYVCLC5.bpi"); +USEPACKAGE("dxPScxCommonC5.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkC5.res new file mode 100644 index 00000000..1765a6b2 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkC6.bpk new file mode 100644 index 00000000..7eecbeaf --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkC6.bpk @@ -0,0 +1,175 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxSchedulerLnkC6.bpl +OBJFILES = dxPScxSchedulerLnkC6.obj dxPScxSchedulerLnk.obj dxPScxSchedulerLnkReg.obj + +RESFILES = dxPScxSchedulerLnkC6.res +MAINSOURCE = dxPScxSchedulerLnkC6.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi designide.bpi vcl.bpi dxPScxCommonC6.bpi dxPSCoreC6.bpi dcldxPSCoreC6.bpi \ + cxDataC6.bpi dclcxLibraryVCLC6.bpi cxLibraryVCLC6.bpi dclcxEditorsVCLC6.bpi \ + cxEditorsVCLC6.bpi cxSchedulerVCLC6.bpi dxThemeC6.bpi +SPARELIBS = rtl.lib CXLIBRARYVCLC6.lib CXEDITORSVCLC6.lib CXSCHEDULERVCLC6.lib \ + DXPSCOREC6.lib dxPScxCommonC6.lib dclcxLibraryVCLC6.lib dcldxPSCorec6.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressScheduler by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkC6.cpp new file mode 100644 index 00000000..1112583c --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkC6.cpp @@ -0,0 +1,35 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +#pragma package(smart_init) + +USERES("dxPScxSchedulerLnkC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEUNIT("dxPScxSchedulerLnkReg.pas"); +USEFORMNS("dxPScxSchedulerLnk.pas", Dxpscxschedulerlnk, dxfmSchedulerReportLinkDesignWindow); +USEPACKAGE("dcldxPSCoreC6.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USEPACKAGE("cxSchedulerVCLC6.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("dclcxEditorsVCLC6.bpi"); +USEPACKAGE("dclcxLibraryVCLC6.bpi"); +USEPACKAGE("CXLIBRARYVCLC6.bpi"); +USEPACKAGE("dxPScxCommonC6.bpi"); + +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- + \ No newline at end of file diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkC6.res new file mode 100644 index 00000000..82a238b5 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD5.dpk new file mode 100644 index 00000000..747fe797 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD5.dpk @@ -0,0 +1,41 @@ +package dxPScxSchedulerLnkD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressScheduler by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxPSCoreD5, + dcldxPSCoreD5, + dxPScxCommonD5, + cxLibraryVCLD5, + dclcxLibraryVCLD5, + cxSchedulerD5; + +contains + dxPScxSchedulerLnk, + dxPScxSchedulerLnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD5.res new file mode 100644 index 00000000..30352554 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD6.dpk new file mode 100644 index 00000000..7269f532 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD6.dpk @@ -0,0 +1,42 @@ +package dxPScxSchedulerLnkD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressScheduler by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD6, + dcldxPSCoreD6, + dxPScxCommonD6, + cxLibraryVCLD6, + dclcxLibraryVCLD6, + cxSchedulerVCLD6; + +contains + dxPScxSchedulerLnk, + dxPScxSchedulerLnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD6.res new file mode 100644 index 00000000..1fd4f630 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD7.dpk new file mode 100644 index 00000000..6ec1cd37 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD7.dpk @@ -0,0 +1,42 @@ +package dxPScxSchedulerLnkD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressScheduler by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD7, + dcldxPSCoreD7, + dxPScxCommonD7, + cxLibraryVCLD7, + dclcxLibraryVCLD7, + cxSchedulerVCLD7; + +contains + dxPScxSchedulerLnk, + dxPScxSchedulerLnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD7.res new file mode 100644 index 00000000..6dbe3d82 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD9.dpk new file mode 100644 index 00000000..4622b11d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD9.dpk @@ -0,0 +1,42 @@ +package dxPScxSchedulerLnkD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressScheduler by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD9, + dcldxPSCoreD9, + dxPScxCommonD9, + cxLibraryD9, + dclcxLibraryD9, + cxSchedulerD9; + +contains + dxPScxSchedulerLnk, + dxPScxSchedulerLnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD9.res b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD9.res new file mode 100644 index 00000000..f130e1cd Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxSchedulerLnkD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC10.bpk new file mode 100644 index 00000000..5d418390 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC10.bpk @@ -0,0 +1,174 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxTLLnkC10.bpl +OBJFILES = dxPScxTLLnk.obj dxPScxTLLnkPredefinedStyleSheets.obj dxPScxTLLnkReg.obj dxPScxTLLnkC10.obj +MAINSOURCE = dxPScxTLLnkC10.cpp +RESFILES = dxPScxTLLnkC10.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxTLLnk.dfm dxPScxTLLnkPredefinedStyleSheets.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib +PACKAGES = dxPSCoreC10.bpi dxPSLnksC10.bpi cxLibraryC10.bpi cxDataC10.bpi \ + cxEditorsC10.bpi cxTreeListC10.bpi dclcxLibraryC10.bpi \ + rtl.bpi vcl.bpi designide.bpi dxPScxCommonC10.bpi dxThemeC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumTreeList 4 by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC10.cpp new file mode 100644 index 00000000..517a732c --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC10.cpp @@ -0,0 +1,29 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxPSCoreC10.bpi"); +USERES("dxPScxTLLnkC10.res"); +USEPACKAGE("dxPSLnksC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEPACKAGE("cxTreeListC10.bpi"); +USEPACKAGE("dclcxLibraryC10.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxPScxCommonC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEUNIT("dxPScxTLLnk.pas"); +USEUNIT("dxPScxTLLnkPredefinedStyleSheets.pas"); +USEUNIT("dxPScxTLLnkReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC10.res new file mode 100644 index 00000000..fbeba915 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC11.bpk new file mode 100644 index 00000000..79c36d5a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC11.bpk @@ -0,0 +1,174 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxTLLnkC11.bpl +OBJFILES = dxPScxTLLnk.obj dxPScxTLLnkPredefinedStyleSheets.obj dxPScxTLLnkReg.obj dxPScxTLLnkC11.obj +MAINSOURCE = dxPScxTLLnkC11.cpp +RESFILES = dxPScxTLLnkC11.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxTLLnk.dfm dxPScxTLLnkPredefinedStyleSheets.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib +PACKAGES = dxPSCoreC11.bpi dxPSLnksC11.bpi cxLibraryC11.bpi cxDataC11.bpi \ + cxEditorsC11.bpi cxTreeListC11.bpi dclcxLibraryC11.bpi \ + rtl.bpi vcl.bpi designide.bpi dxPScxCommonC11.bpi dxThemeC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumTreeList 4 by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC11.cpp new file mode 100644 index 00000000..a84ed4ec --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC11.cpp @@ -0,0 +1,29 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxPSCoreC11.bpi"); +USERES("dxPScxTLLnkC11.res"); +USEPACKAGE("dxPSLnksC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("cxTreeListC11.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxPScxCommonC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEUNIT("dxPScxTLLnk.pas"); +USEUNIT("dxPScxTLLnkPredefinedStyleSheets.pas"); +USEUNIT("dxPScxTLLnkReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC11.res new file mode 100644 index 00000000..afc4ccff Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC5.bpk new file mode 100644 index 00000000..515922bb --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC5.bpk @@ -0,0 +1,172 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPScxTLLnkC5.bpl +OBJFILES = dxPScxTLLnk.obj dxPScxTLLnkPredefinedStyleSheets.obj dxPScxTLLnkReg.obj dxPScxTLLnkC5.obj +RESFILES = dxPScxTLLnkC5.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxTLLnk.dfm dxPScxTLLnkPredefinedStyleSheets.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = dxPSCoreC5.bpi dxPSLnksC5.bpi cxLibraryVCLC5.bpi cxDataC5.bpi cxEditorsC5.bpi \ + cxTreeListC5.bpi dclcxLibraryVCLC5.bpi vcl50.bpi dxPScxCommonC5.bpi dxThemeC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumTreeList 4 by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC5.cpp new file mode 100644 index 00000000..97fa00b0 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC5.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("dxPSCoreC5.bpi"); +USERES("dxPScxTLLnkC5.res"); +USEPACKAGE("dxPSLnksC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("cxTreeListC5.bpi"); +USEPACKAGE("dclcxLibraryVCLC5.bpi"); +USEPACKAGE("dxPScxCommonC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEUNIT("dxPScxTLLnk.pas"); +USEUNIT("dxPScxTLLnkPredefinedStyleSheets.pas"); +USEUNIT("dxPScxTLLnkReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC5.res new file mode 100644 index 00000000..f82ed9c4 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC6.bpk new file mode 100644 index 00000000..60f12304 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC6.bpk @@ -0,0 +1,173 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxTLLnkC6.bpl +OBJFILES = dxPScxTLLnk.obj dxPScxTLLnkPredefinedStyleSheets.obj dxPScxTLLnkReg.obj dxPScxTLLnkC6.obj +RESFILES = dxPScxTLLnkC6.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxTLLnk.dfm dxPScxTLLnkPredefinedStyleSheets.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib +PACKAGES = dxPSCoreC6.bpi dxPSLnksC6.bpi cxLibraryVCLC6.bpi cxDataC6.bpi \ + cxEditorsVCLC6.bpi cxTreeListVCLC6.bpi dclcxLibraryVCLC6.bpi \ + rtl.bpi vcl.bpi designide.bpi dxPScxCommonC6.bpi dxThemeC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumTreeList 4 by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC6.cpp new file mode 100644 index 00000000..40420068 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC6.cpp @@ -0,0 +1,29 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USERES("dxPScxTLLnkC6.res"); +USEPACKAGE("dxPSLnksC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("cxTreeListVCLC6.bpi"); +USEPACKAGE("dclcxLibraryVCLC6.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxPScxCommonC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEUNIT("dxPScxTLLnk.pas"); +USEUNIT("dxPScxTLLnkPredefinedStyleSheets.pas"); +USEUNIT("dxPScxTLLnkReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC6.res new file mode 100644 index 00000000..2a332eb0 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkD10.dpk new file mode 100644 index 00000000..e4adea99 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkD10.dpk @@ -0,0 +1,42 @@ +package dxPScxTLLnkD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumTreeList 4 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD10, + dxPScxCommonD10, + cxLibraryD10, + dclcxLibraryD10, + cxTreeListD10; + +contains + dxPScxTLLnk, + dxPScxTLLnkReg, + dxPScxTLLnkPredefinedStyleSheets; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkD10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkD10.res new file mode 100644 index 00000000..2a1750e7 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkD11.dpk new file mode 100644 index 00000000..351bdd41 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkD11.dpk @@ -0,0 +1,42 @@ +package dxPScxTLLnkD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumTreeList 4 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD11, + dxPScxCommonD11, + cxLibraryD11, + dclcxLibraryD11, + cxTreeListD11; + +contains + dxPScxTLLnk, + dxPScxTLLnkReg, + dxPScxTLLnkPredefinedStyleSheets; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkD11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkD11.res new file mode 100644 index 00000000..3f367a37 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkD9.dpk new file mode 100644 index 00000000..3c84372b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkD9.dpk @@ -0,0 +1,42 @@ +package dxPScxTLLnkD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumTreeList 4 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD9, + dxPScxCommonD9, + cxLibraryD9, + dclcxLibraryD9, + cxTreeListD9; + +contains + dxPScxTLLnk, + dxPScxTLLnkReg, + dxPScxTLLnkPredefinedStyleSheets; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkD9.res b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkD9.res new file mode 100644 index 00000000..7797d16a Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxTLLnkD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC10.bpk new file mode 100644 index 00000000..e70f2baf --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC10.bpk @@ -0,0 +1,175 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxVGridLnkC10.bpl +OBJFILES = dxPScxVGridLnk.obj dxPScxVGridLnkPredefinedStyleSheets.obj \ + dxPScxVGridLnkReg.obj dxPScxVGridLnkC10.obj +MAINSOURCE = dxPScxVGridLnkC10.cpp +RESFILES = dxPScxVGridLnkC10.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxVGridLnk.dfm dxPScxVGridLnkPredefinedStyleSheets.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib +PACKAGES = dxPSCoreC10.bpi dxPSLnksC10.bpi cxLibraryC10.bpi cxDataC10.bpi \ + dclcxLibraryC10.bpi cxVerticalGridC10.bpi cxEditorsC10.bpi \ + vcl.bpi rtl.bpi designide.bpi dxPScxCommonC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressVerticalGrid by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC10.cpp new file mode 100644 index 00000000..3d30c22d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC10.cpp @@ -0,0 +1,28 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxPSCoreC10.bpi"); +USERES("dxPScxVGridLnkC10.res"); +USEPACKAGE("dxPSLnksC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEPACKAGE("cxVerticalGridC10.bpi"); +USEPACKAGE("dclcxLibraryC10.bpi"); +USEPACKAGE("dxPScxCommonC10.bpi"); +USEUNIT("dxPScxVGridLnk.pas"); +USEUNIT("dxPScxVGridLnkPredefinedStyleSheets.pas"); +USEUNIT("dxPScxVGridLnkReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC10.res new file mode 100644 index 00000000..9f35cb55 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC11.bpk new file mode 100644 index 00000000..61b6b568 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC11.bpk @@ -0,0 +1,175 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxVGridLnkC11.bpl +OBJFILES = dxPScxVGridLnk.obj dxPScxVGridLnkPredefinedStyleSheets.obj \ + dxPScxVGridLnkReg.obj dxPScxVGridLnkC11.obj +MAINSOURCE = dxPScxVGridLnkC11.cpp +RESFILES = dxPScxVGridLnkC11.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxVGridLnk.dfm dxPScxVGridLnkPredefinedStyleSheets.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib +PACKAGES = dxPSCoreC11.bpi dxPSLnksC11.bpi cxLibraryC11.bpi cxDataC11.bpi \ + dclcxLibraryC11.bpi cxVerticalGridC11.bpi cxEditorsC11.bpi \ + vcl.bpi rtl.bpi designide.bpi dxPScxCommonC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressVerticalGrid by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC11.cpp new file mode 100644 index 00000000..5806b0a4 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC11.cpp @@ -0,0 +1,28 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxPSCoreC11.bpi"); +USERES("dxPScxVGridLnkC11.res"); +USEPACKAGE("dxPSLnksC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("cxVerticalGridC11.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEPACKAGE("dxPScxCommonC11.bpi"); +USEUNIT("dxPScxVGridLnk.pas"); +USEUNIT("dxPScxVGridLnkPredefinedStyleSheets.pas"); +USEUNIT("dxPScxVGridLnkReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC11.res new file mode 100644 index 00000000..b40fc06d Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC5.bpk new file mode 100644 index 00000000..dab40a79 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC5.bpk @@ -0,0 +1,174 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPScxVGridLnkC5.bpl +OBJFILES = dxPScxVGridLnk.obj dxPScxVGridLnkPredefinedStyleSheets.obj \ + dxPScxVGridLnkReg.obj dxPScxVGridLnkC5.obj +RESFILES = dxPScxVGridLnkC5.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxVGridLnk.dfm dxPScxVGridLnkPredefinedStyleSheets.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = dxPSCoreC5.bpi dxPSLnksC5.bpi cxLibraryVCLC5.bpi cxDataC5.bpi \ + dclcxLibraryVCLC5.bpi cxVerticalGridC5.bpi cxEditorsC5.bpi \ + dxPScxCommonC5.bpi vcl50.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressVerticalGrid by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC5.cpp new file mode 100644 index 00000000..c8ce1bb3 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC5.cpp @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("dxPSCoreC5.bpi"); +USERES("dxPScxVGridLnkC5.res"); +USEPACKAGE("dxPSLnksC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("cxVerticalGridC5.bpi"); +USEPACKAGE("dclcxLibraryVCLC5.bpi"); +USEPACKAGE("dxPScxCommonC5.bpi"); +USEUNIT("dxPScxVGridLnk.pas"); +USEUNIT("dxPScxVGridLnkPredefinedStyleSheets.pas"); +USEUNIT("dxPScxVGridLnkReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC5.res new file mode 100644 index 00000000..06742088 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC6.bpk new file mode 100644 index 00000000..aa700e5e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC6.bpk @@ -0,0 +1,174 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPScxVGridLnkC6.bpl +OBJFILES = dxPScxVGridLnk.obj dxPScxVGridLnkPredefinedStyleSheets.obj \ + dxPScxVGridLnkReg.obj dxPScxVGridLnkC6.obj +RESFILES = dxPScxVGridLnkC6.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPScxVGridLnk.dfm dxPScxVGridLnkPredefinedStyleSheets.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib +PACKAGES = dxPSCoreC6.bpi dxPSLnksC6.bpi cxLibraryVCLC6.bpi cxDataC6.bpi \ + dclcxLibraryVCLC6.bpi cxVerticalGridVCLC6.bpi cxEditorsVCLC6.bpi \ + vcl.bpi rtl.bpi designide.bpi dxPScxCommonC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressVerticalGrid by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC6.cpp new file mode 100644 index 00000000..06a985df --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC6.cpp @@ -0,0 +1,28 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USERES("dxPScxVGridLnkC6.res"); +USEPACKAGE("dxPSLnksC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("cxVerticalGridVCLC6.bpi"); +USEPACKAGE("dclcxLibraryVCLC6.bpi"); +USEPACKAGE("dxPScxCommonC6.bpi"); +USEUNIT("dxPScxVGridLnk.pas"); +USEUNIT("dxPScxVGridLnkPredefinedStyleSheets.pas"); +USEUNIT("dxPScxVGridLnkReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC6.res new file mode 100644 index 00000000..d10e0e08 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD10.dpk new file mode 100644 index 00000000..db69646c --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD10.dpk @@ -0,0 +1,43 @@ +package dxPScxVGridLnkD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressVerticalGrid by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dxPSCoreD10, + dxPScxCommonD10, + cxLibraryD10, + dclcxLibraryD10, + cxVerticalGridD10; + +contains + dxPScxVGridLnk, + dxPScxVGridLnkReg, + dxPScxVGridLnkPredefinedStyleSheets; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD10.res b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD10.res new file mode 100644 index 00000000..2470dfc4 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD11.dpk new file mode 100644 index 00000000..e387c42a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD11.dpk @@ -0,0 +1,43 @@ +package dxPScxVGridLnkD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressVerticalGrid by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dxPSCoreD11, + dxPScxCommonD11, + cxLibraryD11, + dclcxLibraryD11, + cxVerticalGridD11; + +contains + dxPScxVGridLnk, + dxPScxVGridLnkReg, + dxPScxVGridLnkPredefinedStyleSheets; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD11.res b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD11.res new file mode 100644 index 00000000..eaa8e943 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD5.dpk new file mode 100644 index 00000000..1f124fb0 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD5.dpk @@ -0,0 +1,41 @@ +package dxPScxVGridLnkD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressVerticalGrid by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxPSCoreD5, + dxPScxCommonD5, + cxLibraryVCLD5, + dclcxLibraryVCLD5, + cxVerticalGridD5; + +contains + dxPScxVGridLnk, + dxPScxVGridLnkReg, + dxPScxVGridLnkPredefinedStyleSheets; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD5.res new file mode 100644 index 00000000..3b09f736 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD6.dpk new file mode 100644 index 00000000..79924a90 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD6.dpk @@ -0,0 +1,43 @@ +package dxPScxVGridLnkD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressVerticalGrid by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dxPSCoreD6, + dxPScxCommonD6, + cxLibraryVCLD6, + dclcxLibraryVCLD6, + cxVerticalGridVCLD6; + +contains + dxPScxVGridLnk, + dxPScxVGridLnkReg, + dxPScxVGridLnkPredefinedStyleSheets; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD6.res new file mode 100644 index 00000000..a913cdbe Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD7.dpk new file mode 100644 index 00000000..160b90ae --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD7.dpk @@ -0,0 +1,43 @@ +package dxPScxVGridLnkD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressVerticalGrid by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dxPSCoreD7, + dxPScxCommonD7, + cxLibraryVCLD7, + dclcxLibraryVCLD7, + cxVerticalGridVCLD7; + +contains + dxPScxVGridLnk, + dxPScxVGridLnkReg, + dxPScxVGridLnkPredefinedStyleSheets; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD7.res new file mode 100644 index 00000000..ce2fac15 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD9.dpk new file mode 100644 index 00000000..cf5ce502 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD9.dpk @@ -0,0 +1,43 @@ +package dxPScxVGridLnkD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressVerticalGrid by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dxPSCoreD9, + dxPScxCommonD9, + cxLibraryD9, + dclcxLibraryD9, + cxVerticalGridD9; + +contains + dxPScxVGridLnk, + dxPScxVGridLnkReg, + dxPScxVGridLnkPredefinedStyleSheets; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD9.res b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD9.res new file mode 100644 index 00000000..3a8c6fe8 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPScxVGridLnkD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkC5.bpk new file mode 100644 index 00000000..7b50c27f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkC5.bpk @@ -0,0 +1,172 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxDBCtrlLnkc5.bpl +OBJFILES = dxPSdxDBCtrlLnk.obj dxPSdxDBCtrlLnkc5.obj +RESFILES = dxPSdxDBCtrlLnkc5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = dxPSCorec5.bpi dxDBEdc5.bpi EQTLc5.bpi dxEdtrc5.bpi \ + vcl50.bpi vcldb50.bpi vclx50.bpi dxPSTLLnkc5.bpi ECQDBCC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumDBControl by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi -Gpr +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkC5.cpp new file mode 100644 index 00000000..017d4fb5 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkC5.cpp @@ -0,0 +1,25 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxcomnc5.bpi"); +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("dxDBEdc5.bpi"); +USEPACKAGE("EQTLc5.bpi"); +USEPACKAGE("dxEdtrc5.bpi"); +USEPACKAGE("ECQDBCC5.bpi"); +USEPACKAGE("dxPSTLLnkc5.bpi"); +USERES("dxPSdxDBCtrlLnkc5.res"); +USEUNIT("dxPSdxDBCtrlLnk.pas"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("vclx50.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkC5.res new file mode 100644 index 00000000..3a2c697c Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkC6.bpk new file mode 100644 index 00000000..d602ea5e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkC6.bpk @@ -0,0 +1,172 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxDBCtrlLnkC6.bpl +OBJFILES = dxPSdxDBCtrlLnk.obj dxPSdxDBCtrlLnkC6.obj +RESFILES = dxPSdxDBCtrlLnkC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC6.bpi dxDBEdC6.bpi EQTLC6.bpi dxEdtrC6.bpi \ + rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi vclx.bpi dxPSTLLnkC6.bpi ECQDBCC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumDBControl by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi -Gpr +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkC6.cpp new file mode 100644 index 00000000..66b7c85e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkC6.cpp @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxcomnC6.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USEPACKAGE("dxDBEdC6.bpi"); +USEPACKAGE("EQTLC6.bpi"); +USEPACKAGE("dxEdtrC6.bpi"); +USEPACKAGE("ECQDBCC6.bpi"); +USEPACKAGE("dxPSTLLnkC6.bpi"); +USERES("dxPSdxDBCtrlLnkC6.res"); +USEUNIT("dxPSdxDBCtrlLnk.pas"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("vclx.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkC6.res new file mode 100644 index 00000000..2abcd797 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkD5.dpk new file mode 100644 index 00000000..5d786360 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkD5.dpk @@ -0,0 +1,40 @@ +package dxPSdxDBCtrlLnkD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumDBControl by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcldb50, + dxPSCoreD5, + dxDBEdD5, + ECQDBCD5, + dxPSTLLnkD5; + +contains + dxPSdxDBCtrlLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkD5.res new file mode 100644 index 00000000..02b28ffe Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkD6.dpk new file mode 100644 index 00000000..94f4b3f7 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkD6.dpk @@ -0,0 +1,40 @@ +package dxPSdxDBCtrlLnkD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumDBControl by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + dxPSCoreD6, + dxDBEdD6, + ECQDBCD6, + dxPSTLLnkD6; + +contains + dxPSdxDBCtrlLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkD6.res new file mode 100644 index 00000000..c2898995 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkD7.dpk new file mode 100644 index 00000000..1c942b93 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkD7.dpk @@ -0,0 +1,40 @@ +package dxPSdxDBCtrlLnkD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumDBControl by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl, + dxPSCoreD7, + dxDBEdD7, + ECQDBCD7, + dxPSTLLnkD7; + +contains + dxPSdxDBCtrlLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkD7.res new file mode 100644 index 00000000..abb7b2e2 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBCtrlLnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkC5.bpk new file mode 100644 index 00000000..887691c7 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkC5.bpk @@ -0,0 +1,172 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxDBGrLnkc5.bpl +OBJFILES = dxPSdxDBGrLnkReg.obj dxPSdxDBGrLnk.obj dxPSdxDBGrLnkc5.obj +RESFILES = dxPSdxDBGrLnkc5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = dxPSCorec5.bpi dxDBEdc5.bpi EQTLc5.bpi dxEdtrc5.bpi EQGridc5.bpi \ + vcl50.bpi vcldb50.bpi vclx50.bpi dxPSdxDBCtrlLnkc5.bpi cxLibraryVCLC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumGrid by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkC5.cpp new file mode 100644 index 00000000..455b3744 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkC5.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxcomnc5.bpi"); +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("dxDBEdc5.bpi"); +USEPACKAGE("EQTLc5.bpi"); +USEPACKAGE("dxEdtrc5.bpi"); +USEPACKAGE("EQGridc5.bpi"); +USEPACKAGE("dxPSdxDBCtrlLnkc5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USERES("dxPSdxDBGrLnkc5.res"); +USEUNIT("dxPSdxDBGrLnkReg.pas"); +USEUNIT("dxPSdxDBGrLnk.pas"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("vclx50.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkC5.res new file mode 100644 index 00000000..78f8b81f Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkC6.bpk new file mode 100644 index 00000000..df73b69d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkC6.bpk @@ -0,0 +1,173 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxDBGrLnkC6.bpl +OBJFILES = dxPSdxDBGrLnkReg.obj dxPSdxDBGrLnk.obj dxPSdxDBGrLnkC6.obj +RESFILES = dxPSdxDBGrLnkC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC6.bpi dxDBEdC6.bpi EQTLC6.bpi dxEdtrC6.bpi EQGridC6.bpi \ + designide.bpi rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi vclx.bpi dxPSdxDBCtrlLnkC6.bpi \ + cxLibraryVCLC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumGrid by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkC6.cpp new file mode 100644 index 00000000..fc7aace5 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkC6.cpp @@ -0,0 +1,29 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxcomnC6.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USEPACKAGE("dxDBEdC6.bpi"); +USEPACKAGE("EQTLC6.bpi"); +USEPACKAGE("dxEdtrC6.bpi"); +USEPACKAGE("EQGridC6.bpi"); +USEPACKAGE("dxPSdxDBCtrlLnkC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USERES("dxPSdxDBGrLnkC6.res"); +USEUNIT("dxPSdxDBGrLnkReg.pas"); +USEUNIT("dxPSdxDBGrLnk.pas"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("designide.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkC6.res new file mode 100644 index 00000000..cee4ec0e Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkD5.dpk new file mode 100644 index 00000000..fdce6e08 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkD5.dpk @@ -0,0 +1,38 @@ +package dxPSdxDBGrLnkD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumGrid by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + EqGridD5, + dxPSCoreD5, + dxPSdxDBCtrlLnkD5; + +contains + dxPSdxDBGrLnkReg, + dxPSdxDBGrLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkD5.res new file mode 100644 index 00000000..b3bc1331 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkD6.dpk new file mode 100644 index 00000000..5e0d481d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkD6.dpk @@ -0,0 +1,38 @@ +package dxPSdxDBGrLnkD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumGrid by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + EqGridD6, + dxPSCoreD6, + dxPSdxDBCtrlLnkD6; + +contains + dxPSdxDBGrLnkReg, + dxPSdxDBGrLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkD6.res new file mode 100644 index 00000000..70c31768 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkD7.dpk new file mode 100644 index 00000000..37ee3976 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkD7.dpk @@ -0,0 +1,38 @@ +package dxPSdxDBGrLnkD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumGrid by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + EqGridD7, + dxPSCoreD7, + dxPSdxDBCtrlLnkD7; + +contains + dxPSdxDBGrLnkReg, + dxPSdxDBGrLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkD7.res new file mode 100644 index 00000000..40bc132b Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBGrLnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC10.bpk new file mode 100644 index 00000000..659804f6 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC10.bpk @@ -0,0 +1,172 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxDBOCLnkC10.bpl +OBJFILES = dxPSdxDBOCLnk.obj dxPSdxDBOCLnkC10.obj +MAINSOURCE = dxPSdxDBOCLnkC10.cpp +RESFILES = dxPSdxDBOCLnkC10.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxorgcC10.bpi dxdborC10.bpi dxPSCoreC10.bpi rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi dxPSdxOCLnkC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressDBOrgChart by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC10.cpp new file mode 100644 index 00000000..09b3912b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC10.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxorgcC10.bpi"); +USEPACKAGE("dxdborC10.bpi"); +USEPACKAGE("dxPSCoreC10.bpi"); +USEPACKAGE("dxPSdxOCLnkC10.bpi"); +USERES("dxPSdxDBOCLnkC10.res"); +USEUNIT("dxPSdxDBOCLnk.pas"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC10.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC10.res new file mode 100644 index 00000000..a3254aa3 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC11.bpk new file mode 100644 index 00000000..744bdbd7 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC11.bpk @@ -0,0 +1,172 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxDBOCLnkC11.bpl +OBJFILES = dxPSdxDBOCLnk.obj dxPSdxDBOCLnkC11.obj +MAINSOURCE = dxPSdxDBOCLnkC11.cpp +RESFILES = dxPSdxDBOCLnkC11.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxorgcC11.bpi dxdborC11.bpi dxPSCoreC11.bpi rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi dxPSdxOCLnkC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressDBOrgChart by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC11.cpp new file mode 100644 index 00000000..d88625b6 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC11.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxorgcC11.bpi"); +USEPACKAGE("dxdborC11.bpi"); +USEPACKAGE("dxPSCoreC11.bpi"); +USEPACKAGE("dxPSdxOCLnkC11.bpi"); +USERES("dxPSdxDBOCLnkC11.res"); +USEUNIT("dxPSdxDBOCLnk.pas"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC11.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC11.res new file mode 100644 index 00000000..93654249 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC5.bpk new file mode 100644 index 00000000..809d4ad0 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC5.bpk @@ -0,0 +1,171 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxDBOCLnkc5.bpl +OBJFILES = dxPSdxDBOCLnk.obj dxPSdxDBOCLnkc5.obj +RESFILES = dxPSdxDBOCLnkc5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = dxorgcc5.bpi dxdborc5.bpi dxPSCorec5.bpi vcl50.bpi vcldb50.bpi dxPSdxOCLnkc5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressDBOrgChart by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC5.cpp new file mode 100644 index 00000000..60181c69 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC5.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxorgcc5.bpi"); +USEPACKAGE("dxdborc5.bpi"); +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("dxPSdxOCLnkc5.bpi"); +USERES("dxPSdxDBOCLnkc5.res"); +USEUNIT("dxPSdxDBOCLnk.pas"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vcldb50.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC5.res new file mode 100644 index 00000000..e0ff0f41 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC6.bpk new file mode 100644 index 00000000..e2ace477 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC6.bpk @@ -0,0 +1,171 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxDBOCLnkC6.bpl +OBJFILES = dxPSdxDBOCLnk.obj dxPSdxDBOCLnkC6.obj +RESFILES = dxPSdxDBOCLnkC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxorgcC6.bpi dxdborC6.bpi dxPSCoreC6.bpi rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi dxPSdxOCLnkC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressDBOrgChart by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC6.cpp new file mode 100644 index 00000000..13942a77 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC6.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxorgcC6.bpi"); +USEPACKAGE("dxdborC6.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USEPACKAGE("dxPSdxOCLnkC6.bpi"); +USERES("dxPSdxDBOCLnkC6.res"); +USEUNIT("dxPSdxDBOCLnk.pas"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC6.res new file mode 100644 index 00000000..70daaf11 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD10.dpk new file mode 100644 index 00000000..78f3a259 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD10.dpk @@ -0,0 +1,39 @@ +package dxPSdxDBOCLnkD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks for ExpressDBOrgChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD10, + dxPSdxOCLnkD10, + DxorgcD10, + DxdborD10; + +contains + dxPSdxDBOCLnkReg, + dxPSdxDBOCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD10.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD10.res new file mode 100644 index 00000000..bdf8ad05 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD11.dpk new file mode 100644 index 00000000..08bb1dad --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD11.dpk @@ -0,0 +1,39 @@ +package dxPSdxDBOCLnkD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks for ExpressDBOrgChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD11, + dxPSdxOCLnkD11, + DxorgcD11, + DxdborD11; + +contains + dxPSdxDBOCLnkReg, + dxPSdxDBOCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD11.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD11.res new file mode 100644 index 00000000..31e9653f Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD5.dpk new file mode 100644 index 00000000..44487930 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD5.dpk @@ -0,0 +1,39 @@ +package dxPSdxDBOCLnkD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks for ExpressDBOrgChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxPSCoreD5, + dxPSdxOCLnkD5, + DxorgcD5, + DxdborD5; + +contains + dxPSdxDBOCLnkReg, + dxPSdxDBOCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD5.res new file mode 100644 index 00000000..9f5252cf Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD6.dpk new file mode 100644 index 00000000..8fcd4490 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD6.dpk @@ -0,0 +1,39 @@ +package dxPSdxDBOCLnkD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks for ExpressDBOrgChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD6, + dxPSdxOCLnkD6, + DxorgcD6, + DxdborD6; + +contains + dxPSdxDBOCLnkReg, + dxPSdxDBOCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD6.res new file mode 100644 index 00000000..1a5a0302 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD7.dpk new file mode 100644 index 00000000..6ebef60a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD7.dpk @@ -0,0 +1,39 @@ +package dxPSdxDBOCLnkD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks for ExpressDBOrgChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD7, + dxPSdxOCLnkD7, + DxorgcD7, + DxdborD7; + +contains + dxPSdxDBOCLnkReg, + dxPSdxDBOCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD7.res new file mode 100644 index 00000000..afb1e7b2 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD9.dpk new file mode 100644 index 00000000..66f9df3a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD9.dpk @@ -0,0 +1,39 @@ +package dxPSdxDBOCLnkD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks for ExpressDBOrgChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD9, + dxPSdxOCLnkD9, + DxorgcD9, + DxdborD9; + +contains + dxPSdxDBOCLnkReg, + dxPSdxDBOCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD9.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD9.res new file mode 100644 index 00000000..f069a9e7 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBOCLnkD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkC5.bpk new file mode 100644 index 00000000..eae874c3 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkC5.bpk @@ -0,0 +1,172 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxDBTLLnkc5.bpl +OBJFILES = dxPSdxDBTLLnkReg.obj dxPSdxDBTLLnk.obj dxPSdxDBTLLnkc5.obj +RESFILES = dxPSdxDBTLLnkc5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = dxPSCorec5.bpi dxDBEdc5.bpi EQTLc5.bpi dxEdtrc5.bpi EQDBTLc5.bpi \ + vcl50.bpi vcldb50.bpi vclx50.bpi cxLibraryVCLC5.bpi dxPSdxDBCtrlLnkc5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumDBTreeList by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkC5.cpp new file mode 100644 index 00000000..c6602488 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkC5.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxcomnc5.bpi"); +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("EQTLc5.bpi"); +USEPACKAGE("EQDBTLc5.bpi"); +USEPACKAGE("dxEdtrc5.bpi"); +USEPACKAGE("dxDBEdc5.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("dxPSdxDBCtrlLnkc5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USERES("dxPSdxDBTLLnkc5.res"); +USEUNIT("dxPSdxDBTLLnkReg.pas"); +USEUNIT("dxPSdxDBTLLnk.pas"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vclx50.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkC5.res new file mode 100644 index 00000000..173589d5 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkC6.bpk new file mode 100644 index 00000000..46294c49 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkC6.bpk @@ -0,0 +1,172 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxDBTLLnkC6.bpl +OBJFILES = dxPSdxDBTLLnkReg.obj dxPSdxDBTLLnk.obj dxPSdxDBTLLnkC6.obj +RESFILES = dxPSdxDBTLLnkC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES =dxPSCoreC6.bpi dxDBEdC6.bpi EQTLC6.bpi dxEdtrC6.bpi EQDBTLC6.bpi \ + designide.bpi rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi vclx.bpi cxLibraryVCLC6.bpi dxPSdxDBCtrlLnkC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressQuantumDBTreeList by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkC6.cpp new file mode 100644 index 00000000..3c666f25 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkC6.cpp @@ -0,0 +1,29 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxcomnC6.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USEPACKAGE("EQTLC6.bpi"); +USEPACKAGE("EQDBTLC6.bpi"); +USEPACKAGE("dxEdtrC6.bpi"); +USEPACKAGE("dxDBEdC6.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dxPSdxDBCtrlLnkC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USERES("dxPSdxDBTLLnkC6.res"); +USEUNIT("dxPSdxDBTLLnkReg.pas"); +USEUNIT("dxPSdxDBTLLnk.pas"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkC6.res new file mode 100644 index 00000000..d7eb1e55 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkD5.dpk new file mode 100644 index 00000000..535f97d1 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkD5.dpk @@ -0,0 +1,38 @@ +package dxPSdxDBTLLnkD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumDBTreeList by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + EQDBTLD5, + dxPSCoreD5, + dxPSdxDBCtrlLnkD5; + +contains + dxPSdxDBTLLnkReg, + dxPSdxDBTLLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkD5.res new file mode 100644 index 00000000..1f9bb14c Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkD6.dpk new file mode 100644 index 00000000..a2e18426 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkD6.dpk @@ -0,0 +1,38 @@ +package dxPSdxDBTLLnkD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumDBTreeList by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + EQDBTLD6, + dxPSCoreD6, + dxPSdxDBCtrlLnkD6; + +contains + dxPSdxDBTLLnkReg, + dxPSdxDBTLLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkD6.res new file mode 100644 index 00000000..4822e04c Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkD7.dpk new file mode 100644 index 00000000..f0674d2b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkD7.dpk @@ -0,0 +1,38 @@ +package dxPSdxDBTLLnkD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumDBTreeList by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + EQDBTLD7, + dxPSCoreD7, + dxPSdxDBCtrlLnkD7; + +contains + dxPSdxDBTLLnkReg, + dxPSdxDBTLLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkD7.res new file mode 100644 index 00000000..51371cc2 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTLLnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC10.bpk new file mode 100644 index 00000000..6addab08 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC10.bpk @@ -0,0 +1,168 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxDBTVLnkC10.bpl +OBJFILES = dxPSdxDBTVLnkReg.obj dxPSdxDBTVLnk.obj dxPSdxDBTVLnkC10.obj +MAINSOURCE = dxPSdxDBTVLnkC10.cpp +RESFILES = dxPSdxDBTVLnkC10.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib +PACKAGES = dxPSCoreC10.bpi dxdbtrC10.bpi dxPSLnksC10.bpi rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi designide.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressDBTree by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC10.cpp new file mode 100644 index 00000000..edf30f4a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC10.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("VCLDB.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxPSCoreC10.bpi"); +USEPACKAGE("dxdbtrC10.bpi"); +USEPACKAGE("dxPSLnksC10.bpi"); +USERES("dxPSdxDBTVLnkC10.res"); +USEUNIT("dxPSdxDBTVLnkReg.pas"); +USEUNIT("dxPSdxDBTVLnk.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC10.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC10.res new file mode 100644 index 00000000..f4bf522a Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC11.bpk new file mode 100644 index 00000000..1f845a1a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC11.bpk @@ -0,0 +1,168 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxDBTVLnkC11.bpl +OBJFILES = dxPSdxDBTVLnkReg.obj dxPSdxDBTVLnk.obj dxPSdxDBTVLnkC11.obj +MAINSOURCE = dxPSdxDBTVLnkC11.cpp +RESFILES = dxPSdxDBTVLnkC11.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib +PACKAGES = dxPSCoreC11.bpi dxdbtrC11.bpi dxPSLnksC11.bpi rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi designide.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressDBTree by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC11.cpp new file mode 100644 index 00000000..6471a146 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC11.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("VCLDB.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxPSCoreC11.bpi"); +USEPACKAGE("dxdbtrC11.bpi"); +USEPACKAGE("dxPSLnksC11.bpi"); +USERES("dxPSdxDBTVLnkC11.res"); +USEUNIT("dxPSdxDBTVLnkReg.pas"); +USEUNIT("dxPSdxDBTVLnk.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC11.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC11.res new file mode 100644 index 00000000..3a73fba0 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC5.bpk new file mode 100644 index 00000000..ebceb820 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC5.bpk @@ -0,0 +1,171 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxDBTVLnkc5.bpl +OBJFILES = dxPSdxDBTVLnkReg.obj dxPSdxDBTVLnk.obj dxPSdxDBTVLnkc5.obj +RESFILES = dxPSdxDBTVLnkc5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib vcldb50.lib +PACKAGES = dxPSCorec5.bpi dxdbtrC5.bpi dxPSLnksC5.bpi vcl50.bpi vcldb50.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressDBTree by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC5.cpp new file mode 100644 index 00000000..4197296d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC5.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("VCLDB50.bpi"); +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("dxdbtrC5.bpi"); +USEPACKAGE("dxPSLnksC5.bpi"); +USERES("dxPSdxDBTVLnkc5.res"); +USEUNIT("dxPSdxDBTVLnkReg.pas"); +USEUNIT("dxPSdxDBTVLnk.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC5.res new file mode 100644 index 00000000..1521d6ba Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC6.bpk new file mode 100644 index 00000000..b9ae73f2 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC6.bpk @@ -0,0 +1,171 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxDBTVLnkC6.bpl +OBJFILES = dxPSdxDBTVLnkReg.obj dxPSdxDBTVLnk.obj dxPSdxDBTVLnkC6.obj +RESFILES = dxPSdxDBTVLnkC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib dbrtl.lib vcldb.lib +PACKAGES = dxPSCoreC6.bpi dxdbtrC6.bpi dxPSLnksC6.bpi rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressDBTree by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC6.cpp new file mode 100644 index 00000000..cb38a982 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC6.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("VCLDB.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USEPACKAGE("dxdbtrC6.bpi"); +USEPACKAGE("dxPSLnksC6.bpi"); +USERES("dxPSdxDBTVLnkC6.res"); +USEUNIT("dxPSdxDBTVLnkReg.pas"); +USEUNIT("dxPSdxDBTVLnk.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC6.res new file mode 100644 index 00000000..37d8c1c4 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD10.dpk new file mode 100644 index 00000000..8119b38d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD10.dpk @@ -0,0 +1,39 @@ +package dxPSdxDBTVLnkD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressDBTree by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxDBTrD10, + dxPSLnksD10, + dxPSCoreD10; + +contains + dxPSdxDBTVLnkReg, + dxPSdxDBTVLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD10.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD10.res new file mode 100644 index 00000000..c8c64a13 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD11.dpk new file mode 100644 index 00000000..55065fb1 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD11.dpk @@ -0,0 +1,39 @@ +package dxPSdxDBTVLnkD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressDBTree by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxDBTrD11, + dxPSLnksD11, + dxPSCoreD11; + +contains + dxPSdxDBTVLnkReg, + dxPSdxDBTVLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD11.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD11.res new file mode 100644 index 00000000..c898185b Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD5.dpk new file mode 100644 index 00000000..f0356543 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD5.dpk @@ -0,0 +1,38 @@ +package dxPSdxDBTVLnkD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressDBTree by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxDBTrD5, + dxPSLnksD5, + dxPSCoreD5; + +contains + dxPSdxDBTVLnkReg, + dxPSdxDBTVLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD5.res new file mode 100644 index 00000000..b44d5903 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD6.dpk new file mode 100644 index 00000000..9fa5225c --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD6.dpk @@ -0,0 +1,38 @@ +package dxPSdxDBTVLnkD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressDBTree by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxDBTrD6, + dxPSLnksD6, + dxPSCoreD6; + +contains + dxPSdxDBTVLnkReg, + dxPSdxDBTVLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD6.res new file mode 100644 index 00000000..e0df9e15 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD7.dpk new file mode 100644 index 00000000..d08310a8 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD7.dpk @@ -0,0 +1,38 @@ +package dxPSdxDBTVLnkD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressDBTree by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxDBTrD7, + dxPSLnksD7, + dxPSCoreD7; + +contains + dxPSdxDBTVLnkReg, + dxPSdxDBTVLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD7.res new file mode 100644 index 00000000..58e80072 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD9.dpk new file mode 100644 index 00000000..b79ff4ab --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD9.dpk @@ -0,0 +1,39 @@ +package dxPSdxDBTVLnkD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressDBTree by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxDBTrD9, + dxPSLnksD9, + dxPSCoreD9; + +contains + dxPSdxDBTVLnkReg, + dxPSdxDBTVLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD9.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD9.res new file mode 100644 index 00000000..729001e0 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxDBTVLnkD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC10.bpk new file mode 100644 index 00000000..37c3fbef --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC10.bpk @@ -0,0 +1,172 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxFCLnkC10.bpl +OBJFILES = dxPSdxFCLnk.obj dxPSdxFCLnkC10.obj +MAINSOURCE = dxPSdxFCLnkC10.cpp +RESFILES = dxPSdxFCLnkC10.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxflowchartC10.bpi dxPSCoreC10.bpi rtl.bpi vcl.bpi dxPSLnksC10.bpi cxLibraryC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressFlowChart by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC10.cpp new file mode 100644 index 00000000..41b1b65f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC10.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxflowchartC10.bpi"); +USEPACKAGE("dxPSCoreC10.bpi"); +USEPACKAGE("dxPSLnksC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USERES("dxPSdxFCLnkC10.res"); +USEUNIT("dxPSdxFCLnk.pas"); +USEPACKAGE("vcl.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC10.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC10.res new file mode 100644 index 00000000..e515f5cf Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC11.bpk new file mode 100644 index 00000000..b6c4785a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC11.bpk @@ -0,0 +1,172 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxFCLnkC11.bpl +OBJFILES = dxPSdxFCLnk.obj dxPSdxFCLnkC11.obj +MAINSOURCE = dxPSdxFCLnkC11.cpp +RESFILES = dxPSdxFCLnkC11.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxflowchartC11.bpi dxPSCoreC11.bpi rtl.bpi vcl.bpi dxPSLnksC11.bpi cxLibraryC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressFlowChart by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC11.cpp new file mode 100644 index 00000000..b969fcb7 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxflowchartC11.bpi"); +USEPACKAGE("dxPSCoreC11.bpi"); +USEPACKAGE("dxPSLnksC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USERES("dxPSdxFCLnkC11.res"); +USEUNIT("dxPSdxFCLnk.pas"); +USEPACKAGE("vcl.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC11.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC11.res new file mode 100644 index 00000000..1d0502e5 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC5.bpk new file mode 100644 index 00000000..4b18a445 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC5.bpk @@ -0,0 +1,171 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxFCLnkc5.bpl +OBJFILES = dxPSdxFCLnk.obj dxPSdxFCLnkc5.obj +RESFILES = dxPSdxFCLnkc5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = dxflowchartc5.bpi dxPSCorec5.bpi vcl50.bpi dxPSLnksc5.bpi cxLibraryVCLC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressFlowChart by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC5.cpp new file mode 100644 index 00000000..d31a09f9 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC5.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxflowchartc5.bpi"); +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("dxPSLnksc5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USERES("dxPSdxFCLnkc5.res"); +USEUNIT("dxPSdxFCLnk.pas"); +USEPACKAGE("vcl50.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC5.res new file mode 100644 index 00000000..f050650b Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC6.bpk new file mode 100644 index 00000000..bd749e49 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC6.bpk @@ -0,0 +1,171 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxFCLnkC6.bpl +OBJFILES = dxPSdxFCLnk.obj dxPSdxFCLnkC6.obj +RESFILES = dxPSdxFCLnkC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxflowchartC6.bpi dxPSCoreC6.bpi rtl.bpi vcl.bpi dxPSLnksC6.bpi cxLibraryVCLC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressFlowChart by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC6.cpp new file mode 100644 index 00000000..76e13175 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC6.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxflowchartC6.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USEPACKAGE("dxPSLnksC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USERES("dxPSdxFCLnkC6.res"); +USEUNIT("dxPSdxFCLnk.pas"); +USEPACKAGE("vcl.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC6.res new file mode 100644 index 00000000..8214eb8d Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD10.dpk new file mode 100644 index 00000000..57f32979 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD10.dpk @@ -0,0 +1,38 @@ +package dxPSdxFCLnkD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks for ExpressFlowChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD10, + dxPSLnksD10, + dxFlowChartD10; + +contains + dxPSdxFCLnkReg, + dxPSdxFCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD10.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD10.res new file mode 100644 index 00000000..8392ca94 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD11.dpk new file mode 100644 index 00000000..4806ab10 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD11.dpk @@ -0,0 +1,38 @@ +package dxPSdxFCLnkD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks for ExpressFlowChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD11, + dxPSLnksD11, + dxFlowChartD11; + +contains + dxPSdxFCLnkReg, + dxPSdxFCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD11.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD11.res new file mode 100644 index 00000000..03dc8fa1 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD5.dpk new file mode 100644 index 00000000..eac413c9 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD5.dpk @@ -0,0 +1,38 @@ +package dxPSdxFCLnkD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks for ExpressFlowChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxPSCoreD5, + dxPSLnksD5, + dxFlowChartD5; + +contains + dxPSdxFCLnkReg, + dxPSdxFCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD5.res new file mode 100644 index 00000000..d66e4dc3 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD6.dpk new file mode 100644 index 00000000..84bef580 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD6.dpk @@ -0,0 +1,38 @@ +package dxPSdxFCLnkD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks for ExpressFlowChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD6, + dxPSLnksD6, + dxFlowChartD6; + +contains + dxPSdxFCLnkReg, + dxPSdxFCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD6.res new file mode 100644 index 00000000..1e045733 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD7.dpk new file mode 100644 index 00000000..2300106c --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD7.dpk @@ -0,0 +1,38 @@ +package dxPSdxFCLnkD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks for ExpressFlowChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD7, + dxPSLnksD7, + dxFlowChartD7; + +contains + dxPSdxFCLnkReg, + dxPSdxFCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD7.res new file mode 100644 index 00000000..faee8cff Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD9.dpk new file mode 100644 index 00000000..d9e47524 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD9.dpk @@ -0,0 +1,38 @@ +package dxPSdxFCLnkD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks for ExpressFlowChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD9, + dxPSLnksD9, + dxFlowChartD9; + +contains + dxPSdxFCLnkReg, + dxPSdxFCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD9.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD9.res new file mode 100644 index 00000000..efe1e35b Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxFCLnkD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkC5.bpk new file mode 100644 index 00000000..5a55eb8c --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkC5.bpk @@ -0,0 +1,171 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxInsLnkc5.bpl +OBJFILES = dxPSdxInsLnkReg.obj dxPSdxInsLnk.obj dxPSdxDBInsLnk.obj dxPSdxInsLnkc5.obj +RESFILES = dxPSdxInsLnkc5.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPSdxInsLnk.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = dxPSCorec5.bpi dxEdtrC5.bpi dxInsC5.bpi vcl50.bpi vclx50.bpi cxLibraryVCLC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressInspector by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkC5.cpp new file mode 100644 index 00000000..995a72d7 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkC5.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("VCLX50.bpi"); +USEPACKAGE("dxcomnc5.bpi"); +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("dxEdtrC5.bpi"); +USEPACKAGE("dxInsC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USERES("dxPSdxInsLnkc5.res"); +USEUNIT("dxPSdxInsLnkReg.pas"); +USEUNIT("dxPSdxDBInsLnk.pas"); +USEFORMNS("dxPSdxInsLnk.pas", Dxpsdxinslnk, dxInspectorDesignWindow); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkC5.res new file mode 100644 index 00000000..2241dd48 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkC6.bpk new file mode 100644 index 00000000..ecd7e176 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkC6.bpk @@ -0,0 +1,172 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxInsLnkC6.bpl +OBJFILES = dxPSdxInsLnkReg.obj dxPSdxInsLnk.obj dxPSdxDBInsLnk.obj dxPSdxInsLnkC6.obj +RESFILES = dxPSdxInsLnkC6.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPSdxInsLnk.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC6.bpi dxEdtrC6.bpi dxInsC6.bpi designide.bpi rtl.bpi vcl.bpi \ + cxLibraryVCLC6.bpi vclx.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressInspector by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkC6.cpp new file mode 100644 index 00000000..671a5ae3 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkC6.cpp @@ -0,0 +1,25 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("vcl.bpi"); +USEPACKAGE("VCLX.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxcomnC6.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USEPACKAGE("dxEdtrC6.bpi"); +USEPACKAGE("dxInsC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USERES("dxPSdxInsLnkC6.res"); +USEUNIT("dxPSdxInsLnkReg.pas"); +USEUNIT("dxPSdxDBInsLnk.pas"); +USEFORMNS("dxPSdxInsLnk.pas", Dxpsdxinslnk, dxInspectorDesignWindow); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkC6.res new file mode 100644 index 00000000..3a8dfbf0 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkD5.dpk new file mode 100644 index 00000000..65de5fa9 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkD5.dpk @@ -0,0 +1,38 @@ +package dxPSdxInsLnkD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressInspector by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxInsD5, + dxPSCoreD5; + +contains + dxPSdxInsLnkReg, + dxPSdxInsLnk, + dxPSdxDBInsLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkD5.res new file mode 100644 index 00000000..74ca26f5 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkD6.dpk new file mode 100644 index 00000000..cb4b7521 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkD6.dpk @@ -0,0 +1,39 @@ +package dxPSdxInsLnkD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressInspector by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxInsD6, + dxPSCoreD6; + +contains + dxPSdxInsLnkReg, + dxPSdxInsLnk, + dxPSdxDBInsLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkD6.res new file mode 100644 index 00000000..3de5d8e1 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkD7.dpk new file mode 100644 index 00000000..fe4c229a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkD7.dpk @@ -0,0 +1,39 @@ +package dxPSdxInsLnkD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressInspector by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxInsD7, + dxPSCoreD7; + +contains + dxPSdxInsLnkReg, + dxPSdxInsLnk, + dxPSdxDBInsLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkD7.res new file mode 100644 index 00000000..90e26e04 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxInsLnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC10.bpk new file mode 100644 index 00000000..9ef8b141 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC10.bpk @@ -0,0 +1,169 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxLCLnkC10.bpl +OBJFILES = dxPSdxLCLnk.obj dxPSdxLCLnkReg.obj dxPSdxLCLnkC10.obj +MAINSOURCE = dxPSdxLCLnkC10.cpp +RESFILES = dxPSdxLCLnkC10.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib +PACKAGES = dxPSCoreC10.bpi dxPSLnksC10.bpi cxLibraryC10.bpi cxDataC10.bpi \ + dxLayoutControlC10.bpi cxEditorsC10.bpi rtl.bpi vcl.bpi designide.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressLayoutControl by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC10.cpp new file mode 100644 index 00000000..6b08b5fa --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC10.cpp @@ -0,0 +1,25 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxPSCoreC10.bpi"); +USERES("dxPSdxLCLnkC10.res"); +USEPACKAGE("dxPSLnksC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEPACKAGE("dxLayoutControlC10.bpi"); +USEUNIT("dxPSdxLCLnk.pas"); +USEUNIT("dxPSdxLCLnkReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC10.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC10.res new file mode 100644 index 00000000..ba59da86 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC11.bpk new file mode 100644 index 00000000..db4ced2e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC11.bpk @@ -0,0 +1,169 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxLCLnkC11.bpl +OBJFILES = dxPSdxLCLnk.obj dxPSdxLCLnkReg.obj dxPSdxLCLnkC11.obj +MAINSOURCE = dxPSdxLCLnkC11.cpp +RESFILES = dxPSdxLCLnkC11.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib +PACKAGES = dxPSCoreC11.bpi dxPSLnksC11.bpi cxLibraryC11.bpi cxDataC11.bpi \ + dxLayoutControlC11.bpi cxEditorsC11.bpi rtl.bpi vcl.bpi designide.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -DBCB -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressLayoutControl by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC11.cpp new file mode 100644 index 00000000..170e6e54 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC11.cpp @@ -0,0 +1,25 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxPSCoreC11.bpi"); +USERES("dxPSdxLCLnkC11.res"); +USEPACKAGE("dxPSLnksC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("dxLayoutControlC11.bpi"); +USEUNIT("dxPSdxLCLnk.pas"); +USEUNIT("dxPSdxLCLnkReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC11.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC11.res new file mode 100644 index 00000000..14232e4d Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC5.bpk new file mode 100644 index 00000000..0044ca8b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC5.bpk @@ -0,0 +1,172 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxLCLnkC5.bpl +OBJFILES = dxPSdxLCLnk.obj dxPSdxLCLnkReg.obj dxPSdxLCLnkC5.obj +RESFILES = dxPSdxLCLnkC5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = dxPSCoreC5.bpi dxPSLnksC5.bpi cxLibraryVCLC5.bpi cxDataC5.bpi \ + dxLayoutControlC5.bpi cxEditorsC5.bpi vcl50.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressLayoutControl by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC5.cpp new file mode 100644 index 00000000..abf10b52 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC5.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("dxPSCoreC5.bpi"); +USERES("dxPSdxLCLnkC5.res"); +USEPACKAGE("dxPSLnksC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("dxLayoutControlC5.bpi"); +USEUNIT("dxPSdxLCLnk.pas"); +USEUNIT("dxPSdxLCLnkReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC5.res new file mode 100644 index 00000000..a45497a3 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC6.bpk new file mode 100644 index 00000000..627da9dd --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC6.bpk @@ -0,0 +1,172 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxLCLnkC6.bpl +OBJFILES = dxPSdxLCLnk.obj dxPSdxLCLnkReg.obj dxPSdxLCLnkC6.obj +RESFILES = dxPSdxLCLnkC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib +PACKAGES = dxPSCoreC6.bpi dxPSLnksC6.bpi cxLibraryVCLC6.bpi cxDataC6.bpi \ + dxLayoutControlC6.bpi cxEditorsVCLC6.bpi rtl.bpi vcl.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressLayoutControl by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC6.cpp new file mode 100644 index 00000000..5e483681 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC6.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USERES("dxPSdxLCLnkC6.res"); +USEPACKAGE("dxPSLnksC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("dxLayoutControlC6.bpi"); +USEUNIT("dxPSdxLCLnk.pas"); +USEUNIT("dxPSdxLCLnkReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC6.res new file mode 100644 index 00000000..42018c6c Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD10.dpk new file mode 100644 index 00000000..4a2b6951 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD10.dpk @@ -0,0 +1,39 @@ +package dxPSdxLCLnkD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressLayoutControl by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dxPSCoreD10, + dxLayoutControlD10; + +contains + dxPSdxLCLnk, + dxPSdxLCLnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD10.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD10.res new file mode 100644 index 00000000..0d707168 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD11.dpk new file mode 100644 index 00000000..e73551d7 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD11.dpk @@ -0,0 +1,39 @@ +package dxPSdxLCLnkD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressLayoutControl by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dxPSCoreD11, + dxLayoutControlD11; + +contains + dxPSdxLCLnk, + dxPSdxLCLnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD11.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD11.res new file mode 100644 index 00000000..cb8e789a Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD5.dpk new file mode 100644 index 00000000..29da3897 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD5.dpk @@ -0,0 +1,37 @@ +package dxPSdxLCLnkD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressLayoutControl by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxPSCoreD5, + dxLayoutControlD5; + +contains + dxPSdxLCLnk, + dxPSdxLCLnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD5.res new file mode 100644 index 00000000..4b5e5a2c Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD6.dpk new file mode 100644 index 00000000..f847cb58 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD6.dpk @@ -0,0 +1,39 @@ +package dxPSdxLCLnkD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressLayoutControl by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dxPSCoreD6, + dxLayoutControlD6; + +contains + dxPSdxLCLnk, + dxPSdxLCLnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD6.res new file mode 100644 index 00000000..fa9a2add Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD7.dpk new file mode 100644 index 00000000..761a24be --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD7.dpk @@ -0,0 +1,39 @@ +package dxPSdxLCLnkD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressLayoutControl by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dxPSCoreD7, + dxLayoutControlD7; + +contains + dxPSdxLCLnk, + dxPSdxLCLnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD7.res new file mode 100644 index 00000000..0bf7740a Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD9.dpk new file mode 100644 index 00000000..90b28a9b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD9.dpk @@ -0,0 +1,39 @@ +package dxPSdxLCLnkD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressLayoutControl by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dxPSCoreD9, + dxLayoutControlD9; + +contains + dxPSdxLCLnk, + dxPSdxLCLnkReg; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD9.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD9.res new file mode 100644 index 00000000..4b057216 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxLCLnkD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC10.bpk new file mode 100644 index 00000000..6926b192 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC10.bpk @@ -0,0 +1,173 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxMVLnkC10.bpl +OBJFILES = dxPSdxMVLnk.obj dxPSMD.obj dxPSdxMVLnkC10.obj +MAINSOURCE = dxPSdxMVLnkC10.cpp +RESFILES = dxPSdxMVLnkC10.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPSdxMVLnk.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC10.bpi dxMasterViewC10.bpi rtl.bpi vcl.bpi vclx.bpi dbrtl.bpi \ + cxLibraryC10.bpi vcldb.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressMasterView by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC10.cpp new file mode 100644 index 00000000..f20a693a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC10.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("VCLDB.bpi"); +USEPACKAGE("VCLX.bpi"); +USEPACKAGE("dxPSCoreC10.bpi"); +USEPACKAGE("dxMasterViewC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USERES("dxPSdxMVLnkC10.res"); +USEUNIT("dxPSMD.pas"); +USEFORMNS("dxPSdxMVLnk.pas", Dxpsdxmvlnk, dxMVReportLinkDesignWindow); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC10.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC10.res new file mode 100644 index 00000000..4bfd5e5a Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC11.bpk new file mode 100644 index 00000000..964c57b8 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC11.bpk @@ -0,0 +1,173 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxMVLnkC11.bpl +OBJFILES = dxPSdxMVLnk.obj dxPSMD.obj dxPSdxMVLnkC11.obj +MAINSOURCE = dxPSdxMVLnkC11.cpp +RESFILES = dxPSdxMVLnkC11.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPSdxMVLnk.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC11.bpi dxMasterViewC11.bpi rtl.bpi vcl.bpi vclx.bpi dbrtl.bpi \ + cxLibraryC11.bpi vcldb.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressMasterView by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC11.cpp new file mode 100644 index 00000000..9aa191b9 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC11.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("VCLDB.bpi"); +USEPACKAGE("VCLX.bpi"); +USEPACKAGE("dxPSCoreC11.bpi"); +USEPACKAGE("dxMasterViewC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USERES("dxPSdxMVLnkC11.res"); +USEUNIT("dxPSMD.pas"); +USEFORMNS("dxPSdxMVLnk.pas", Dxpsdxmvlnk, dxMVReportLinkDesignWindow); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC11.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC11.res new file mode 100644 index 00000000..fbf802a7 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC5.bpk new file mode 100644 index 00000000..fec5e832 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC5.bpk @@ -0,0 +1,171 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxMVLnkc5.bpl +OBJFILES = dxPSdxMVLnk.obj dxPSMD.obj dxPSdxMVLnkc5.obj +RESFILES = dxPSdxMVLnkc5.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPSdxMVLnk.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = dxPSCorec5.bpi dxMasterViewC5.bpi vcl50.bpi vclx50.bpi vcldb50.bpi cxLibraryVCLC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressMasterView by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC5.cpp new file mode 100644 index 00000000..1f741ae1 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC5.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("VCLDB50.bpi"); +USEPACKAGE("VCLX50.bpi"); +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("dxMasterViewC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USERES("dxPSdxMVLnkc5.res"); +USEUNIT("dxPSMD.pas"); +USEFORMNS("dxPSdxMVLnk.pas", Dxpsdxmvlnk, dxMVReportLinkDesignWindow); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC5.res new file mode 100644 index 00000000..60adc100 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC6.bpk new file mode 100644 index 00000000..bc2f5088 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC6.bpk @@ -0,0 +1,172 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxMVLnkC6.bpl +OBJFILES = dxPSdxMVLnk.obj dxPSMD.obj dxPSdxMVLnkC6.obj +RESFILES = dxPSdxMVLnkC6.res +DEFFILE = +RESDEPEN = $(RESFILES) dxPSdxMVLnk.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC6.bpi dxMasterViewC6.bpi rtl.bpi vcl.bpi vclx.bpi dbrtl.bpi \ + cxLibraryVCLC6.bpi vcldb.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressMasterView by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC6.cpp new file mode 100644 index 00000000..c6ece791 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC6.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("VCLDB.bpi"); +USEPACKAGE("VCLX.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USEPACKAGE("dxMasterViewC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USERES("dxPSdxMVLnkC6.res"); +USEUNIT("dxPSMD.pas"); +USEFORMNS("dxPSdxMVLnk.pas", Dxpsdxmvlnk, dxMVReportLinkDesignWindow); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC6.res new file mode 100644 index 00000000..567cdc14 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD10.dpk new file mode 100644 index 00000000..5d254434 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD10.dpk @@ -0,0 +1,39 @@ +package dxPSdxMVLnkD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressMasterView by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxMasterViewD10, + dxPSCoreD10, + designide; + +contains + dxPSMD, + dxPSdxMVLnkReg, + dxPSdxMVLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD10.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD10.res new file mode 100644 index 00000000..d2e8a650 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD11.dpk new file mode 100644 index 00000000..ef6f0f89 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD11.dpk @@ -0,0 +1,39 @@ +package dxPSdxMVLnkD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressMasterView by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxMasterViewD11, + dxPSCoreD11, + designide; + +contains + dxPSMD, + dxPSdxMVLnkReg, + dxPSdxMVLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD11.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD11.res new file mode 100644 index 00000000..cd2500e7 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD5.dpk new file mode 100644 index 00000000..cbf22691 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD5.dpk @@ -0,0 +1,38 @@ +package dxPSdxMVLnkD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressMasterView by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxMasterViewD5, + dxPSCoreD5; + +contains + dxPSMD, + dxPSdxMVLnkReg, + dxPSdxMVLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD5.res new file mode 100644 index 00000000..19ed0792 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD6.dpk new file mode 100644 index 00000000..75399a35 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD6.dpk @@ -0,0 +1,39 @@ +package dxPSdxMVLnkD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressMasterView by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxMasterViewD6, + dxPSCoreD6, + designide; + +contains + dxPSMD, + dxPSdxMVLnkReg, + dxPSdxMVLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD6.res new file mode 100644 index 00000000..b58271e5 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD7.dpk new file mode 100644 index 00000000..ad4b17c6 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD7.dpk @@ -0,0 +1,39 @@ +package dxPSdxMVLnkD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressMasterView by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxMasterViewD7, + dxPSCoreD7, + designide; + +contains + dxPSMD, + dxPSdxMVLnkReg, + dxPSdxMVLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD7.res new file mode 100644 index 00000000..31b8c987 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD9.dpk new file mode 100644 index 00000000..6684f327 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD9.dpk @@ -0,0 +1,39 @@ +package dxPSdxMVLnkD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressMasterView by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxMasterViewD9, + dxPSCoreD9, + designide; + +contains + dxPSMD, + dxPSdxMVLnkReg, + dxPSdxMVLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD9.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD9.res new file mode 100644 index 00000000..c69e419f Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxMVLnkD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC10.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC10.bpk new file mode 100644 index 00000000..73b2fcd3 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC10.bpk @@ -0,0 +1,172 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxOCLnkC10.bpl +OBJFILES = dxPSdxOCLnk.obj dxPSdxOCLnkReg.obj dxPSdxOCLnkC10.obj +MAINSOURCE = dxPSdxOCLnkC10.cpp +RESFILES = dxPSdxOCLnkC10.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxorgcC10.bpi dxPSCoreC10.bpi designide.bpi rtl.bpi vcl.bpi cxLibraryC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressOrgChart by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC10.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC10.cpp new file mode 100644 index 00000000..7c9c9a4f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC10.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxorgcC10.bpi"); +USEPACKAGE("dxPSCoreC10.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USERES("dxPSdxOCLnkC10.res"); +USEUNIT("dxPSdxOCLnk.pas"); +USEUNIT("dxPSdxOCLnkReg.pas"); +USEPACKAGE("vcl.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC10.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC10.res new file mode 100644 index 00000000..7084b498 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC11.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC11.bpk new file mode 100644 index 00000000..b734883f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC11.bpk @@ -0,0 +1,172 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxOCLnkC11.bpl +OBJFILES = dxPSdxOCLnk.obj dxPSdxOCLnkReg.obj dxPSdxOCLnkC11.obj +MAINSOURCE = dxPSdxOCLnkC11.cpp +RESFILES = dxPSdxOCLnkC11.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxorgcC11.bpi dxPSCoreC11.bpi designide.bpi rtl.bpi vcl.bpi cxLibraryC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressOrgChart by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC11.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC11.cpp new file mode 100644 index 00000000..4314497b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC11.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxorgcC11.bpi"); +USEPACKAGE("dxPSCoreC11.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USERES("dxPSdxOCLnkC11.res"); +USEUNIT("dxPSdxOCLnk.pas"); +USEUNIT("dxPSdxOCLnkReg.pas"); +USEPACKAGE("vcl.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC11.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC11.res new file mode 100644 index 00000000..f77a41ce Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC5.bpk new file mode 100644 index 00000000..dc0b2390 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC5.bpk @@ -0,0 +1,171 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxOCLnkc5.bpl +OBJFILES = dxPSdxOCLnk.obj dxPSdxOCLnkReg.obj dxPSdxOCLnkc5.obj +RESFILES = dxPSdxOCLnkc5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = dxorgcc5.bpi dxPSCorec5.bpi vcl50.bpi cxLibraryVCLC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressOrgChart by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC5.cpp new file mode 100644 index 00000000..cc8e05d0 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC5.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxorgcc5.bpi"); +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USERES("dxPSdxOCLnkc5.res"); +USEUNIT("dxPSdxOCLnk.pas"); +USEUNIT("dxPSdxOCLnkReg.pas"); +USEPACKAGE("vcl50.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC5.res new file mode 100644 index 00000000..63cbc7d6 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC6.bpk new file mode 100644 index 00000000..495d9d68 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC6.bpk @@ -0,0 +1,171 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxOCLnkC6.bpl +OBJFILES = dxPSdxOCLnk.obj dxPSdxOCLnkReg.obj dxPSdxOCLnkC6.obj +RESFILES = dxPSdxOCLnkC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxorgcC6.bpi dxPSCoreC6.bpi designide.bpi rtl.bpi vcl.bpi cxLibraryVCLC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressOrgChart by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC6.cpp new file mode 100644 index 00000000..53f813e7 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC6.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dxorgcC6.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USERES("dxPSdxOCLnkC6.res"); +USEUNIT("dxPSdxOCLnk.pas"); +USEUNIT("dxPSdxOCLnkReg.pas"); +USEPACKAGE("vcl.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC6.res new file mode 100644 index 00000000..574c3be3 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD10.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD10.dpk new file mode 100644 index 00000000..3ccfbbaa --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD10.dpk @@ -0,0 +1,38 @@ +package dxPSdxOCLnkD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks for ExpressOrgChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD10, + DxorgcD10; + +contains + dxPSdxOCLnkReg, + dxPSdxOCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD10.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD10.res new file mode 100644 index 00000000..945bd883 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD10.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD11.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD11.dpk new file mode 100644 index 00000000..1fc410e7 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD11.dpk @@ -0,0 +1,38 @@ +package dxPSdxOCLnkD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks for ExpressOrgChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD11, + DxorgcD11; + +contains + dxPSdxOCLnkReg, + dxPSdxOCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD11.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD11.res new file mode 100644 index 00000000..c4b47b6f Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD11.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD5.dpk new file mode 100644 index 00000000..9470debe --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD5.dpk @@ -0,0 +1,37 @@ +package dxPSdxOCLnkD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks for ExpressOrgChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxPSCoreD5, + DxorgcD5; + +contains + dxPSdxOCLnkReg, + dxPSdxOCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD5.res new file mode 100644 index 00000000..7b51390b Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD6.dpk new file mode 100644 index 00000000..df21b372 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD6.dpk @@ -0,0 +1,38 @@ +package dxPSdxOCLnkD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks for ExpressOrgChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD6, + DxorgcD6; + +contains + dxPSdxOCLnkReg, + dxPSdxOCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD6.res new file mode 100644 index 00000000..fbb5cd75 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD7.dpk new file mode 100644 index 00000000..5c4e044f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD7.dpk @@ -0,0 +1,38 @@ +package dxPSdxOCLnkD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks for ExpressOrgChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD7, + DxorgcD7; + +contains + dxPSdxOCLnkReg, + dxPSdxOCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD7.res new file mode 100644 index 00000000..473b73a8 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD9.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD9.dpk new file mode 100644 index 00000000..a8f22d38 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD9.dpk @@ -0,0 +1,38 @@ +package dxPSdxOCLnkD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLinks for ExpressOrgChart by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD9, + DxorgcD9; + +contains + dxPSdxOCLnkReg, + dxPSdxOCLnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD9.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD9.res new file mode 100644 index 00000000..b8efe895 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxOCLnkD9.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkC5.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkC5.bpk new file mode 100644 index 00000000..54787eb9 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkC5.bpk @@ -0,0 +1,171 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxOILnkc5.bpl +OBJFILES = dxPSdxOILnkReg.obj dxPSdxOILnk.obj dxPSdxOILnkc5.obj +RESFILES = dxPSdxOILnkc5.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = vcl50.lib +PACKAGES = dxPSCorec5.bpi dxObjInsC5.bpi dxPSdxInsLnkC5.bpi vcl50.bpi vclx50.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressRTTIInspector by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkC5.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkC5.cpp new file mode 100644 index 00000000..e64c7591 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkC5.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("VCLX50.bpi"); +USEPACKAGE("dxcomnc5.bpi"); +USEPACKAGE("dxEdtrC5.bpi"); +USEPACKAGE("dxPSCorec5.bpi"); +USEPACKAGE("dxObjInsC5.bpi"); +USEPACKAGE("dxPSdxInsLnkC5.bpi"); +USERES("dxPSdxOILnkc5.res"); +USEUNIT("dxPSdxOILnkReg.pas"); +USEUNIT("dxPSdxOILnk.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkC5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkC5.res new file mode 100644 index 00000000..566f185d Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkC5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkC6.bpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkC6.bpk new file mode 100644 index 00000000..33b07b5e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkC6.bpk @@ -0,0 +1,171 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxPSdxOILnkC6.bpl +OBJFILES = dxPSdxOILnkReg.obj dxPSdxOILnk.obj dxPSdxOILnkC6.obj +RESFILES = dxPSdxOILnkC6.res +DEFFILE = +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = dxPSCoreC6.bpi dxObjInsC6.bpi dxPSdxInsLnkC6.bpi rtl.bpi vcl.bpi vclx.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +SYSDEFINES = NO_STRICT;_RTLDLL;USEPACKAGES +USERDEFINES = +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressPrinting System ReportLink for ExpressRTTIInspector by Developer Express Inc." \ + -aa -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkC6.cpp b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkC6.cpp new file mode 100644 index 00000000..62cc4ca3 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkC6.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("vcl.bpi"); +USEPACKAGE("VCLX.bpi"); +USEPACKAGE("dxcomnC6.bpi"); +USEPACKAGE("dxEdtrC6.bpi"); +USEPACKAGE("dxPSCoreC6.bpi"); +USEPACKAGE("dxObjInsC6.bpi"); +USEPACKAGE("dxPSdxInsLnkC6.bpi"); +USERES("dxPSdxOILnkC6.res"); +USEUNIT("dxPSdxOILnkReg.pas"); +USEUNIT("dxPSdxOILnk.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkC6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkC6.res new file mode 100644 index 00000000..2740e2ad Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkC6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkD5.dpk new file mode 100644 index 00000000..83d052a3 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkD5.dpk @@ -0,0 +1,38 @@ +package dxPSdxOILnkD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressRTTIInspector by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxObjInsD5, + dxPSCoreD5, + dxPSdxInsLnkD5; + +contains + dxPSdxOILnkReg, + dxPSdxOILnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkD5.res new file mode 100644 index 00000000..a56ee547 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkD6.dpk new file mode 100644 index 00000000..37fc53a4 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkD6.dpk @@ -0,0 +1,38 @@ +package dxPSdxOILnkD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressRTTIInspector by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxObjInsD6, + dxPSCoreD6, + dxPSdxInsLnkD6; + +contains + dxPSdxOILnkReg, + dxPSdxOILnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkD6.res new file mode 100644 index 00000000..76a71ead Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkD7.dpk new file mode 100644 index 00000000..dde5cbd0 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkD7.dpk @@ -0,0 +1,38 @@ +package dxPSdxOILnkD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressRTTIInspector by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxObjInsD7, + dxPSCoreD7, + dxPSdxInsLnkD7; + +contains + dxPSdxOILnkReg, + dxPSdxOILnk; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkD7.res new file mode 100644 index 00000000..013f8721 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPSdxOILnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPsPrVwAdvD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPsPrVwAdvD5.dpk new file mode 100644 index 00000000..8c65586b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPsPrVwAdvD5.dpk @@ -0,0 +1,37 @@ +package dxPsPrVwAdvD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System Advanced Preview Window by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxPSCoreD5, + dxBarD5, + dxBarExtItemsD5; + +contains + dxPSPrVwAdv; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPsPrVwAdvD5.res b/official/x.35/ExpressPrinting System/Packages/dxPsPrVwAdvD5.res new file mode 100644 index 00000000..df7ec732 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPsPrVwAdvD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPsPrVwAdvD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPsPrVwAdvD6.dpk new file mode 100644 index 00000000..d068815a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPsPrVwAdvD6.dpk @@ -0,0 +1,37 @@ +package dxPsPrVwAdvD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System Advanced Preview Window by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD6, + dxBarD6, + dxBarExtItemsD6; + +contains + dxPSPrVwAdv; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPsPrVwAdvD6.res b/official/x.35/ExpressPrinting System/Packages/dxPsPrVwAdvD6.res new file mode 100644 index 00000000..a92dc2f9 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPsPrVwAdvD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPsPrVwAdvD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPsPrVwAdvD7.dpk new file mode 100644 index 00000000..f874eed4 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPsPrVwAdvD7.dpk @@ -0,0 +1,37 @@ +package dxPsPrVwAdvD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System Advanced Preview Window by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dxPSCoreD7, + dxBarD7, + dxBarExtItemsD7; + +contains + dxPSPrVwAdv; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPsPrVwAdvD7.res b/official/x.35/ExpressPrinting System/Packages/dxPsPrVwAdvD7.res new file mode 100644 index 00000000..2c89be9c Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPsPrVwAdvD7.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPscxTLLnkD5.dpk b/official/x.35/ExpressPrinting System/Packages/dxPscxTLLnkD5.dpk new file mode 100644 index 00000000..ca18cd68 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPscxTLLnkD5.dpk @@ -0,0 +1,41 @@ +package dxPScxTLLnkD5; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumTreeList 4 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxPSCoreD5, + dxPScxCommonD5, + cxLibraryVCLD5, + dclcxLibraryVCLD5, + cxTreeListD5; + +contains + dxPScxTLLnk, + dxPScxTLLnkReg, + dxPScxTLLnkPredefinedStyleSheets; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPscxTLLnkD5.res b/official/x.35/ExpressPrinting System/Packages/dxPscxTLLnkD5.res new file mode 100644 index 00000000..3850a532 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPscxTLLnkD5.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPscxTLLnkD6.dpk b/official/x.35/ExpressPrinting System/Packages/dxPscxTLLnkD6.dpk new file mode 100644 index 00000000..32e035de --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPscxTLLnkD6.dpk @@ -0,0 +1,42 @@ +package dxPScxTLLnkD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumTreeList 4 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxPSCoreD6, + dxPScxCommonD6, + cxLibraryVCLD6, + dclcxLibraryVCLD6, + cxTreeListVCLD6; + +contains + dxPScxTLLnk, + dxPScxTLLnkReg, + dxPScxTLLnkPredefinedStyleSheets; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPscxTLLnkD6.res b/official/x.35/ExpressPrinting System/Packages/dxPscxTLLnkD6.res new file mode 100644 index 00000000..163d4aee Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPscxTLLnkD6.res differ diff --git a/official/x.35/ExpressPrinting System/Packages/dxPscxTLLnkD7.dpk b/official/x.35/ExpressPrinting System/Packages/dxPscxTLLnkD7.dpk new file mode 100644 index 00000000..e79d51a6 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Packages/dxPscxTLLnkD7.dpk @@ -0,0 +1,43 @@ +package dxPScxTLLnkD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressPrinting System ReportLink for ExpressQuantumTreeList 4 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + designide, + dxPSCoreD7, + dxPScxCommonD7, + cxLibraryVCLD7, + dclcxLibraryVCLD7, + cxTreeListVCLD7; + +contains + dxPScxTLLnk, + dxPScxTLLnkReg, + dxPScxTLLnkPredefinedStyleSheets; + +end. diff --git a/official/x.35/ExpressPrinting System/Packages/dxPscxTLLnkD7.res b/official/x.35/ExpressPrinting System/Packages/dxPscxTLLnkD7.res new file mode 100644 index 00000000..fd8e2523 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Packages/dxPscxTLLnkD7.res differ diff --git a/official/x.35/ExpressPrinting System/Sources/cxVer.inc b/official/x.35/ExpressPrinting System/Sources/cxVer.inc new file mode 100644 index 00000000..a26364cc --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/cxVer.inc @@ -0,0 +1,172 @@ +{$B-} { Complete Boolean Evaluation } +{$R-} { Range-Checking } +{$T-} { Typed @ operator } +{$X+} { Extended syntax } +{$P+} { Open string params } +{$J+} { Writeable structured consts } +{$H+} { Use long strings by default } +{$Q-} { Overflow checking } + +{$DEFINE DXVER500} + +{$IFNDEF CLR} + {$DEFINE OLEDRAGANDDROP} + {$IFNDEF DONTUSEJPEGIMAGE} + {$DEFINE USEJPEGIMAGE} + {$ENDIF} +{$ENDIF} + +{$DEFINE EXPRESSBARS5} + +{$DEFINE VCL} + +{$IFNDEF VER80} + {$IFNDEF VER90} + {$IFNDEF VER93} + {$DEFINE DELPHI3} { Borland Delphi 3.0 } + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER110} { Borland C++Builder 3.0 } + {$DEFINE CBUILDER3} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE DELPHI4} +{$ENDIF} + +{$IFDEF VER125} { Borland C++Builder 4.0 } + {$DEFINE CBUILDER3} + {$DEFINE DELPHI4} + {$DEFINE CBUILDER4} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$IFDEF BCB} { Borland C++Builder 5.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$IFDEF BCB} { Borland C++Builder 6.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} +{$ENDIF} + +{$IFNDEF DELPHI6} + {$DEFINE MSWINDOWS} +{$ENDIF} +{$IFDEF LINUX} + {$UNDEF MSWINDOWS} +{$ENDIF} + +{$IFDEF LINUX} + {$DEFINE KYLIX1} { Borland Kylix 1 } + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF CompilerVersion >= 14} + {$DEFINE KYLIX2} { Borland Kylix 2 } + {$IFEND} + {$IF CompilerVersion >= 14.50} + {$DEFINE KYLIX3} { Borland Kylix 3 } + {$IFEND} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} { Borland Delphi.Net } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} +{$ENDIF} + +{$IFDEF VER170} { Borland Delphi 9.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} +{$ENDIF} + +{$IFDEF VER180} { Borland Delphi 10 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$IFDEF BCB} { Borland C++Builder 10 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Borland Delphi 11 //CodeGear} + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$DEFINE DELPHI11} + {$IFDEF BCB} { Borland C++Builder 11 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$DEFINE CBUILDER11} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFNDEF CLR} + {$IFNDEF BCB} + {$IFDEF DELPHI6} + {$DEFINE REGISTERSHELLCTRLS} + {$ENDIF} + {$ENDIF} + {$IFDEF DELPHI7} + {$WARN UNSAFE_CAST OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_TYPE OFF} + {$ENDIF} +{$ENDIF} + +{$IFDEF REGISTERSHELLCTRLS} + {$DEFINE REGISTERCXSHELLCTRLS} +{$ENDIF} + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} diff --git a/official/x.35/ExpressPrinting System/Sources/dxBase.pas b/official/x.35/ExpressPrinting System/Sources/dxBase.pas new file mode 100644 index 00000000..dba34606 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxBase.pas @@ -0,0 +1,624 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBase; + +interface + +{$I cxVer.inc} + +uses + Classes, dxPSSngltn; + +type + TdxBaseObject = class; + + TdxLockState = (lsUnlock, lsLock); + + TdxLockUpdateEvent = procedure(Sender: TdxBaseObject; ALockState: TdxLockState) of object; + + TdxBaseObjectClass = class of TdxBaseObject; + + TdxBaseObject = class(TPersistent) + private + FUpdateCount: Integer; + FOnLockUpdate: TdxLockUpdateEvent; + protected + procedure DoAssign(Source: TdxBaseObject); virtual; + procedure DoRestoreDefaults; virtual; + + function IsLocked: Boolean; + procedure LockUpdate(ALockState: TdxLockState); dynamic; + + property UpdateCount: Integer read FUpdateCount; + property OnLockUpdate: TdxLockUpdateEvent read FOnLockUpdate write FOnLockUpdate; + public + constructor Create; virtual; + procedure Assign(Source: TPersistent); override; + + procedure BeginUpdate; + procedure CancelUpdate; + procedure EndUpdate; + + function Clone: TdxBaseObject; virtual; + function IsEmpty: Boolean; virtual; + function IsEqual(ABaseObject: TdxBaseObject): Boolean; virtual; + procedure RestoreDefaults; + + procedure LoadFromFile(const AFileName: string); dynamic; + procedure LoadFromStream(AStream: TStream); dynamic; + procedure SaveToFile(const AFileName: string); dynamic; + procedure SaveToStream(AStream: TStream); dynamic; + end; + + TdxClassList = class(TList) + private + function GetItem(Index: Integer): TClass; + procedure SetItem(Index: Integer; Value: TClass); + public + function Add(AClass: TClass; ACheckExistence: Boolean = True): Integer; + function Find(AClass: TClass; out AnIndex: Integer): Boolean; overload; + function Find(AClass: TClass): Boolean; overload; + function IndexOf(AClass: TClass): Integer; + procedure Insert(Index: Integer; AClass: TClass; ACheckExistence: Boolean = True); + function Remove(AClass: TClass): Integer; + {$IFDEF DELPHI5} + function Extract(AClass: TClass): TClass; + {$ENDIF} + function First: TClass; + function Last: TClass; + + property Items[Index: Integer]: TClass read GetItem write SetItem; default; + end; + + TdxPersistentClassList = class(TdxClassList) + private + function GetItem(Index: Integer): TPersistentClass; + procedure SetItem(Index: Integer; Value: TPersistentClass); + protected + procedure UnregisterAll; virtual; + public + procedure Clear; {$IFDEF DELPHI5} override; {$ENDIF} + {$IFDEF DELPHI5} + function Extract(AClass: TPersistentClass): TPersistentClass; + {$ENDIF} + function First: TPersistentClass; + function Last: TPersistentClass; + + function Register(AClass: TPersistentClass): Integer; overload; virtual; + procedure Register(AnIndex: Integer; AClass: TPersistentClass); overload; virtual; + procedure Unregister(AClass: TPersistentClass); virtual; + + property Items[Index: Integer]: TPersistentClass read GetItem write SetItem; default; + end; + + TdxCustomCache = class + private + FItems: TList; + function GetCount: Integer; + function GetItem(Index: Integer): TObject; + protected + function Add(AnObject: TObject): Integer; + procedure FreeAndNilItems; + function IndexOfByClass(AClass: TClass): Integer; + + property Count: Integer read GetCount; + property Items[Index: Integer]: TObject read GetItem; + public + constructor Create; + destructor Destroy; override; + procedure Clear; virtual; + end; + + { Class Factories } + + TdxCustomClassFactory = class(TBasedxPSSingleton) + private + FItems: TdxClassList; + function GetCount: Integer; + function GetItem(Index: Integer): TClass; + protected + procedure FinalizeInstance; override; + procedure InitializeInstance; override; + property Items[Index: Integer]: TClass read GetItem; + public + function IndexOf(AClass: TClass): Integer; + procedure Register(AClass: TClass); virtual; + procedure Unregister(AClass: TClass); virtual; + procedure UnregisterAll; virtual; + property Count: Integer read GetCount; + end; + + { Maps } + + TdxCustomClassMapItemClass = class of TdxCustomClassMapItem; + + TdxCustomClassMapItem = class + public + class function PairClass: TClass; virtual; + end; + + TdxCustomClassMaps = class(TdxCustomClassFactory) + private + function GetItem(Index: Integer): TdxCustomClassMapItemClass; + protected + function GetPairClass(AClass: TClass): TdxCustomClassMapItemClass; virtual; + + property Items[Index: Integer]: TdxCustomClassMapItemClass read GetItem; + property PairClasses[AClass: TClass]: TdxCustomClassMapItemClass read GetPairClass; + end; + +procedure dxSavePersistent(AStream: TStream; APersistent: TPersistent); +procedure dxLoadPersistent(AStream: TStream; APersistent: TPersistent); + +implementation + +uses + SysUtils {$IFNDEF DELPHI5}, dxPSUtl {$ENDIF}; + +type + TdxSaver = class(TComponent) + private + FPersistent: TPersistent; + published + property Persistent: TPersistent read FPersistent write FPersistent; + end; + +procedure dxSavePersistent(AStream: TStream; APersistent: TPersistent); +var + Saver: TdxSaver; +begin + Assert(APersistent <> nil); + Saver := TdxSaver.Create(nil); + try + Saver.Persistent := APersistent; + AStream.WriteComponent(Saver); + finally + Saver.Free; + end; +end; + +procedure dxLoadPersistent(AStream: TStream; APersistent: TPersistent); +var + Saver: TdxSaver; +begin + Assert(APersistent <> nil); + Saver := TdxSaver.Create(nil); + try + Saver.Persistent := APersistent; + AStream.ReadComponent(Saver); + finally + Saver.Free; + end; +end; + +{ TdxBaseObject } + +constructor TdxBaseObject.Create; +begin + inherited Create; +end; + +procedure TdxBaseObject.Assign(Source: TPersistent); +begin + if Source is TdxBaseObject then + begin + BeginUpdate; + try + DoAssign(TdxBaseObject(Source)); + finally + EndUpdate; + end; + end + else + inherited; +end; + +procedure TdxBaseObject.BeginUpdate; +begin + if UpdateCount = 0 then LockUpdate(lsLock); + Inc(FUpdateCount); +end; + +procedure TdxBaseObject.CancelUpdate; +begin + if FUpdateCount <> 0 then Dec(FUpdateCount); +end; + +procedure TdxBaseObject.EndUpdate; +begin + if FUpdateCount <> 0 then + begin + Dec(FUpdateCount); + if UpdateCount = 0 then LockUpdate(lsUnlock); + end; +end; + +function TdxBaseObject.Clone: TdxBaseObject; +begin + Result := TdxBaseObjectClass(ClassType).Create; + try + Result.Assign(Self); + except + Result.Free; + raise; + end; +end; + +function TdxBaseObject.IsEmpty: Boolean; +begin + Result := False; +end; + +function TdxBaseObject.IsEqual(ABaseObject: TdxBaseObject): Boolean; +begin + Result := ABaseObject is ClassType; +end; + +procedure TdxBaseObject.RestoreDefaults; +begin + BeginUpdate; + try + DoRestoreDefaults; + finally + EndUpdate; + end; +end; + +procedure TdxBaseObject.SaveToFile(const AFileName: string); +var + AStream: TFileStream; +begin + AStream := TFileStream.Create(AFileName, fmCreate); + try + SaveToStream(AStream); + finally + AStream.Free; + end; +end; + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} +{$ENDIF} + +procedure TdxBaseObject.LoadFromFile(const AFileName: string); +var + AStream: TFileStream; +begin + AStream := TFileStream.Create(AFileName, fmOpenRead or fmShareDenyRead); + try + LoadFromStream(AStream); + finally + AStream.Free; + end; +end; + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM ON} +{$ENDIF} + +procedure TdxBaseObject.SaveToStream(AStream: TStream); +begin + dxSavePersistent(AStream, Self); +end; + +procedure TdxBaseObject.LoadFromStream(AStream: TStream); +begin + dxLoadPersistent(AStream, Self); +end; + +procedure TdxBaseObject.DoAssign(Source: TdxBaseObject); +begin +end; + +procedure TdxBaseObject.DoRestoreDefaults; +begin +end; + +function TdxBaseObject.IsLocked: Boolean; +begin + Result := FUpdateCount <> 0; +end; + +procedure TdxBaseObject.LockUpdate(ALockState: TdxLockState); +begin + if Assigned(FOnLockUpdate) then FOnLockUpdate(Self, ALockState); +end; + +{ TdxClassList } + +function TdxClassList.Add(AClass: TClass; ACheckExistence: Boolean = True): Integer; +begin + if not ACheckExistence or not Find(AClass, Result) then + Result := inherited Add(TObject(AClass)); +end; + +function TdxClassList.Find(AClass: TClass; out AnIndex: Integer): Boolean; +begin + AnIndex := IndexOf(AClass); + Result := AnIndex <> -1; +end; + +function TdxClassList.Find(AClass: TClass): Boolean; +begin + Result := IndexOf(AClass) <> -1; +end; + +function TdxClassList.IndexOf(AClass: TClass): Integer; +begin + Result := inherited IndexOf(TObject(AClass)); +end; + +procedure TdxClassList.Insert(Index: Integer; AClass: TClass; ACheckExistence: Boolean = True); +begin + if not ACheckExistence or not Find(AClass) then + inherited Insert(Index, TObject(AClass)); +end; + +function TdxClassList.Remove(AClass: TClass): Integer; +begin + Result := inherited Remove(TObject(AClass)); +end; + +{$IFDEF DELPHI5} +function TdxClassList.Extract(AClass: TClass): TClass; +begin + Result := TClass(inherited Extract(TObject(AClass))); +end; +{$ENDIF} + +function TdxClassList.First: TClass; +begin + Result := TClass(inherited First); +end; + +function TdxClassList.Last: TClass; +begin + Result := TClass(inherited Last); +end; + +function TdxClassList.GetItem(Index: Integer): TClass; +begin + Result := TClass(inherited Items[Index]); +end; + +procedure TdxClassList.SetItem(Index: Integer; Value: TClass); +begin + inherited Items[Index] := TObject(Value); +end; + +{ TdxPersistentClassList } + +procedure TdxPersistentClassList.Clear; +begin + UnregisterAll; + inherited; +end; + +{$IFDEF DELPHI5} +function TdxPersistentClassList.Extract(AClass: TPersistentClass): TPersistentClass; +begin + Result := TPersistentClass(inherited Extract(AClass)); +end; +{$ENDIF} + +function TdxPersistentClassList.First: TPersistentClass; +begin + Result := TPersistentClass(inherited First); +end; + +function TdxPersistentClassList.Last: TPersistentClass; +begin + Result := TPersistentClass(inherited Last); +end; + +function TdxPersistentClassList.Register(AClass: TPersistentClass): Integer; +begin + if (AClass <> nil) and not Find(AClass) then + begin + Result := Add(AClass); + Classes.RegisterClass(AClass); + end + else + Result := -1; +end; + +procedure TdxPersistentClassList.Register(AnIndex: Integer; AClass: TPersistentClass); +begin + if (AClass <> nil) and not Find(AClass) then + begin + Insert(AnIndex, AClass); + Classes.RegisterClass(AClass); + end; +end; + +procedure TdxPersistentClassList.Unregister(AClass: TPersistentClass); +var + Index: Integer; +begin + if Find(AClass, Index) then + begin + Classes.UnregisterClass(AClass); + Delete(Index); + end; +end; + +procedure TdxPersistentClassList.UnregisterAll; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Classes.UnregisterClass(Items[I]); +end; + +function TdxPersistentClassList.GetItem(Index: Integer): TPersistentClass; +begin + Result := TPersistentClass(inherited Items[Index]); +end; + +procedure TdxPersistentClassList.SetItem(Index: Integer; Value: TPersistentClass); +begin + inherited Items[Index] := Value; +end; + +{ TdxCustomCache } + +constructor TdxCustomCache.Create; +begin + inherited Create; + FItems := TList.Create; +end; + +destructor TdxCustomCache.Destroy; +begin + FreeAndNilItems; + inherited; +end; + +procedure TdxCustomCache.Clear; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].Free; + FItems.Clear; +end; + +function TdxCustomCache.Add(AnObject: TObject): Integer; +begin + Result := FItems.Add(AnObject); +end; + +procedure TdxCustomCache.FreeAndNilItems; +begin + Clear; + FreeAndNil(FItems); +end; + +function TdxCustomCache.IndexOfByClass(AClass: TClass): Integer; +begin + for Result := 0 to Count - 1 do + if Items[Result].ClassType = AClass then Exit; + Result := -1; +end; + +function TdxCustomCache.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxCustomCache.GetItem(Index: Integer): TObject; +begin + Result := FItems[Index]; +end; + +{ TdxCustomClassFactory } + +procedure TdxCustomClassFactory.Register(AClass: TClass); +begin + FItems.Insert(0, AClass, True); +end; + +procedure TdxCustomClassFactory.Unregister(AClass: TClass); +begin + FItems.Remove(AClass); +end; + +procedure TdxCustomClassFactory.UnregisterAll; +begin + FItems.Clear; +end; + +procedure TdxCustomClassFactory.FinalizeInstance; +begin + FreeAndNil(FItems); + inherited; +end; + +procedure TdxCustomClassFactory.InitializeInstance; +begin + inherited; + FItems := TdxClassList.Create; +end; + +function TdxCustomClassFactory.IndexOf(AClass: TClass): Integer; +begin + Result := FItems.IndexOf(AClass); +end; + +function TdxCustomClassFactory.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxCustomClassFactory.GetItem(Index: Integer): TClass; +begin + Result := FItems[Index]; +end; + +{ TdxCustomClassMapItem } + +class function TdxCustomClassMapItem.PairClass: TClass; +begin + Result := nil; +end; + +{ TdxCustomClassMaps } + +function TdxCustomClassMaps.GetPairClass(AClass: TClass): TdxCustomClassMapItemClass; +var + Candidate: TdxCustomClassMapItemClass; + I: Integer; +begin + Candidate := nil; + if AClass <> nil then + for I := Count - 1 downto 0 do + begin + Result := Items[I]; + if AClass.InheritsFrom(Result.PairClass) and + ((Candidate = nil) or Result.PairClass.InheritsFrom(Candidate.PairClass)) then + Candidate := Result; + if (Candidate <> nil) and (Candidate.PairClass = AClass) then + Break; + end; + Result := Candidate; +end; + +function TdxCustomClassMaps.GetItem(Index: Integer): TdxCustomClassMapItemClass; +begin + Result := TdxCustomClassMapItemClass(inherited Items[Index]); +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxBkgnd.pas b/official/x.35/ExpressPrinting System/Sources/dxBkgnd.pas new file mode 100644 index 00000000..53795357 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxBkgnd.pas @@ -0,0 +1,547 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBkGnd; + +interface + +{$I cxVer.inc} + +uses + Windows, Classes, SysUtils, Controls, Graphics, dxBase, dxPSGlbl, dxPSUtl; + +type + TdxPicturePaintMode = (ppmCenter, ppmStretch, ppmTile, ppmProportional); + TdxBackgroundMode = (bmNone, bmBrush, bmBrushBitmap, bmPicture); + TdxBackgroundParam = (bpBkColor, bpBrush, bpMode, bpPictureMode, bpPicture); + TdxBackgroundParams = set of TdxBackgroundParam; + TdxPaintSequence = (psBefore, psAfter); + + TdxBackgroundChangeEvent = procedure(Sender: TObject; AChangeWhat: TdxBackgroundParams) of object; + + TCustomdxBackgroundPaintEvent = procedure(Sender: TObject; Canvas: TCanvas; + Rect: TRect; ASequence: TdxPaintSequence; var ADone: Boolean) of object; + + TCustomdxBackgroundPaintExEvent = procedure(Sender: TObject; Canvas: TCanvas; + Rect: TRect; ASequence: TdxPaintSequence; PixelsNumerator, + PixelsDenominator: Integer; var ADone: Boolean) of object; + + TdxBackgroundClass = class of TdxBackground; + + TdxBackground = class(TdxBaseObject) + private + FBkColor: TColor; + FBrush: TBrush; + FIsRepaintNeeded: Boolean; + FMode: TdxBackgroundMode; + FPicture: TGraphic; + FPictureMode: TdxPicturePaintMode; + FOnApply: TNotifyEvent; + FOnChange: TdxBackgroundChangeEvent; + FOnPaint: TCustomdxBackgroundPaintEvent; + FOnPaintEx: TCustomdxBackgroundPaintExEvent; + function GetPicture: TGraphic; + procedure SetBkColor(Value: tColor); + procedure SetBrush(Value: TBrush); + procedure SetMode(Value: TdxBackgroundMode); + procedure SetPicture(Value: TGraphic); + procedure SetPictureMode(Value: TdxPicturePaintMode); + + procedure BrushChanged(Sender: TObject); + procedure PictureChanged(Sender: TObject); + protected + procedure DoAssign(Source: TdxBaseObject); override; + procedure DoRestoreDefaults; override; + + procedure DoApply; dynamic; + procedure DoChange(AChangeWhats: TdxBackgroundParams); dynamic; + procedure DoPaint(ACanvas: TCanvas; Rect: TRect; Sequence: TdxPaintSequence; + var ADone: Boolean); virtual; + procedure DoPaintEx(ACanvas: TCanvas; Rect: TRect; Sequence: TdxPaintSequence; + PixelsNumerator, PixelsDenominator: Integer; var ADone: Boolean); virtual; + procedure LockUpdate(ALockState : TdxLockState); override; + function RepaintNeeded(AChangeWhats: TdxBackgroundParams): Boolean; virtual; + + property OnApply: TNotifyEvent read FOnApply write FOnApply; + public + constructor Create; override; + destructor Destroy; override; + + procedure Clear; virtual; + function IsEmpty: Boolean; override; + function IsEqual(ABaseObject: TdxBaseObject): Boolean; override; + + procedure Paint(ACanvas: TCanvas; const R: TRect); virtual; + procedure PaintEx(ACanvas: TCanvas; const R: TRect; + PixelsNumerator, PixelsDenominator: Integer); virtual; + + function SetupEffects: Boolean; + + property IsRepaintNeeded: Boolean read FIsRepaintNeeded; + property OnChange: TdxBackgroundChangeEvent read FOnChange write FOnChange; + property OnPaint: TCustomdxBackgroundPaintEvent read FOnPaint write FOnPaint; + property OnPaintEx: TCustomdxBackgroundPaintExEvent read FOnPaintEx write FOnPaintEx; + published + property BkColor: TColor read FBkColor write SetBkColor default clWhite; + property Brush: TBrush read FBrush write SetBrush; + property Mode: TdxBackgroundMode read FMode write SetMode default bmNone; + property Picture: TGraphic read GetPicture write SetPicture; + property PictureMode: TdxPicturePaintMode read FPictureMode write SetPictureMode default ppmCenter; + end; + +procedure DrawPicture(APicture: TGraphic; ACanvas: TCanvas; const ARect: TRect; + APictureMode: TdxPicturePaintMode; PixelsNumerator, PixelsDenominator: Integer; + AnOffsetX: Integer = 0; AnOffsetY: Integer = 0); + +const + cwAll: TdxBackgroundParams = [bpBkColor..bpPicture]; + +implementation + +uses + dxFEFDlg; + +constructor TdxBackground.Create; +begin + inherited; + FBkColor := clWhite; + FBrush := TBrush.Create; + FBrush.OnChange := BrushChanged; + FMode := bmNone; + FPictureMode := ppmCenter; + FPicture := TBitmap.Create; + FPicture.OnChange := PictureChanged; +end; + +destructor TdxBackground.Destroy; +begin + FreeAndNil(FPicture); + FreeAndNil(FBrush); + inherited; +end; + +procedure TdxBackground.Clear; +begin + Brush.Color := clWhite; + Mode := bmNone; + Picture := nil; +end; + +function TdxBackground.IsEmpty: Boolean; +begin + case Mode of + bmBrush: + Result := Brush.Style = bsClear; + bmBrushBitmap, + bmPicture: + Result := (Picture = nil) or Picture.Empty; + else //bmNone + Result := True; + end; +end; + +function TdxBackground.IsEqual(ABaseObject: TdxBaseObject): Boolean; +begin + Result := inherited IsEqual(ABaseObject); + if Result then + with TdxBackground(ABaseObject) do + Result := + (Self.BkColor = BkColor) and + (Self.Mode = Mode) and + (Self.PictureMode = PictureMode) and + dxAreBrushesEqual(Self.Brush, Brush) and + dxAreGraphicsEqual(Self.Picture, Picture); +end; + +procedure TdxBackground.Paint(ACanvas: TCanvas; const R: TRect); +begin + PaintEx(ACanvas, R, 1, 1); +end; + +procedure TdxBackground.PaintEx(ACanvas: TCanvas; const R: TRect; + PixelsNumerator, PixelsDenominator: Integer); +var + PrevColor: COLORREF; + PrevBkMode: Integer; + PrevBrush: TBrush; + Done: Boolean; + DC: HDC; + Pattern: TBitmap; +begin + Done := False; + DoPaintEx(ACanvas, R, psBefore, PixelsNumerator, PixelsDenominator, Done); + if Done then Exit; + + DC := ACanvas.Handle; + case Mode of + bmNone: ; + bmBrush: + if Brush.Style <> bsClear then + begin + if Brush.Style > bsClear then {hatched brush} + begin + PrevBkMode := SetBkMode(DC, Windows.TRANSPARENT); + PrevColor := Windows.SetBkColor(DC, ColorToRGB(BkColor)); + end + else {bsSolid} + begin + PrevBkMode := GetBkMode(DC); + PrevColor := COLORREF(0); + end; + if (Brush.Style > bsClear) and IsPrinterDC(DC) then {hatched Brush} + begin + Pattern := TBitmap.Create; + with Pattern do + try + Width := 8; + Height := 8; + Canvas.Brush := Self.Brush; + SetBkMode(DC, Windows.TRANSPARENT); + Windows.SetBkColor(DC, ColorToRGB(BkColor)); + Canvas.FillRect(Rect(0, 0, Width, Height)); + DrawPicture(Pattern, ACanvas, R, ppmTile, PixelsNumerator, PixelsDenominator); + finally + Free; + end; + end + else + FillRect(DC, R, Brush.Handle); + if Brush.Style > bsClear then + begin + Windows.SetBkColor(DC, PrevColor); + SetBkMode(DC, PrevBkMode); + end; + end; + + bmBrushBitmap: + if Picture <> nil then + if (Picture.Width <= 8) and (Picture.Height <= 8) and not IsPrinterDC(DC) then + begin + PrevBrush := TBrush.Create; + try + PrevBrush.Assign(ACanvas.Brush); + ACanvas.Brush.Bitmap := TBitmap(Picture); + ACanvas.FillRect(R); + ACanvas.Brush.Bitmap := nil; + ACanvas.Brush := PrevBrush; + finally + PrevBrush.Free; + end; + end + else + DrawPicture(Picture, ACanvas, R, ppmTile, PixelsNumerator, PixelsDenominator); + + bmPicture: + if Picture <> nil then + if (PictureMode = ppmTile) and (Picture.Width <= 8) and (Picture.Height <= 8) and not IsPrinterDC(DC) then + begin + PrevBrush := TBrush.Create; + try + PrevBrush.Assign(ACanvas.Brush); + ACanvas.Brush.Bitmap := TBitmap(Picture); + ACanvas.FillRect(R); + ACanvas.Brush.Bitmap := nil; + ACanvas.Brush := PrevBrush; + finally + PrevBrush.Free; + end; + end + else + DrawPicture(Picture, ACanvas, R, PictureMode, PixelsNumerator, PixelsDenominator); + end; + + DoPaintEx(ACanvas, R, psAfter, PixelsNumerator, PixelsDenominator, Done); +end; + +function TdxBackground.SetupEffects: Boolean; +begin + Result := dxFEFDialog(Self); +end; + +procedure TdxBackground.DoAssign(Source: TdxBaseObject); +begin + inherited; + with Source as TdxBackground do + begin + Self.BkColor := BkColor; + Self.Brush := Brush; + Self.Mode := Mode; + Self.PictureMode := PictureMode; + Self.Picture := Picture; + end; +end; + +procedure TdxBackground.DoRestoreDefaults; +begin + inherited; + FBkColor := clWhite; + FMode := bmNone; + FPictureMode := ppmCenter; +end; + +procedure TdxBackground.DoApply; +begin + if Assigned(FOnApply) then FOnApply(Self); +end; + +procedure TdxBackground.DoChange(AChangeWhats: TdxBackgroundParams); +begin + if not IsLocked then + begin + FIsRepaintNeeded := RepaintNeeded(AChangeWhats); + if Assigned(FOnChange) then FOnChange(Self, AChangeWhats); + end; +end; + +procedure TdxBackground.DoPaint(ACanvas: TCanvas; Rect: TRect; + Sequence: TdxPaintSequence; var ADone: Boolean); +begin + if Assigned(FOnPaint) then FOnPaint(Self, ACanvas, Rect, Sequence, ADone); +end; + +procedure TdxBackground.DoPaintEx(ACanvas: TCanvas; Rect: TRect; + Sequence: TdxPaintSequence; PixelsNumerator, PixelsDenominator: Integer; + var ADone: Boolean); +begin + if Assigned(FOnPaintEx) then + FOnPaintEx(Self, ACanvas, Rect, Sequence, PixelsNumerator, PixelsDenominator, ADone); + if not ADone then + DoPaint(ACanvas, Rect, Sequence, ADone); +end; + +procedure TdxBackground.LockUpdate(ALockState : TdxLockState); +begin + if ALockState = lsUnLock then DoChange(cwAll); + inherited LockUpdate(ALockState); +end; + +function TdxBackground.RepaintNeeded(AChangeWhats: TdxBackgroundParams): Boolean; +begin + if bpMode in AChangeWhats then + Result := True + else + case Mode of + bmBrush: + Result := (bpBrush in AChangeWhats) or ((bpBkColor in AChangeWhats) and (Brush.Style > bsClear)); + bmBrushBitmap: + Result := bpPicture in AChangeWhats; + bmPicture: + Result := [bpPicture, bpPictureMode] * AChangeWhats <> []; + else + Result := False; + end; +end; + +procedure TdxBackground.BrushChanged(Sender: TObject); +begin + DoChange([bpBrush]); +end; + +procedure TdxBackground.PictureChanged(Sender: TObject); +begin + DoChange([bpPicture]); +end; + +procedure TdxBackground.SetBkColor(Value: tColor); +begin + if FBkColor <> Value then + begin + FBkColor := Value; + DoChange([bpBkColor]); + end; +end; + +procedure TdxBackground.SetBrush(Value: TBrush); +begin + FBrush.Assign(Value); +end; + +procedure TdxBackground.SetMode(Value: TdxBackgroundMode); +begin + if FMode <> Value then + begin + FMode := Value; + DoChange([bpMode]); + end; +end; + +function TdxBackground.GetPicture: TGraphic; +begin + if FPicture = nil then FPicture := TBitmap.Create; + Result := FPicture; +end; + +procedure TdxBackground.SetPicture(Value: TGraphic); +begin + if Value <> nil then + begin + Picture.Assign(Value); + TBitmap(Picture).HandleType := bmDIB; + end + else + if FPicture <> nil then + begin + TBitmap(FPicture).FreeImage; + TBitmap(FPicture).ReleaseHandle; + end; +end; + +procedure TdxBackground.SetPictureMode(Value: TdxPicturePaintMode); +begin + if FPictureMode <> Value then + begin + FPictureMode := Value; + DoChange([bpPictureMode]); + end; +end; + +{ utility routines } + +function IsGraphicVisible(DC: HDC; const R: TRect): Boolean; +begin + Result := IsPrinterDC(DC) or IsMetafileDC(DC) or RectVisible(DC, R); +end; + +procedure DrawGraphicCenter(AGraphic: TGraphic; ACanvas: TCanvas; const ARect: TRect; + PixelsNumerator, PixelsDenominator: Integer); +var + DC: HDC; + W, H: Integer; + R: TRect; +begin + DC := ACanvas.Handle; + with ARect, AGraphic do + begin + W := MulDiv(Width, PixelsNumerator, PixelsDenominator); + H := MulDiv(Height, PixelsNumerator, PixelsDenominator); + R := Bounds(Left + (Right - Left - W) div 2, Top + (Bottom - Top - H) div 2, W, H); + if IsGraphicVisible(DC, R) then + if (W <> Width) or (H <> Height) then + ACanvas.StretchDraw(R, AGraphic) + else + ACanvas.Draw(R.Left, R.Top, AGraphic); + end; +end; + +procedure DrawGraphicStretch(AGraphic: TGraphic; ACanvas: TCanvas; const ARect: TRect; + PixelsNumerator, PixelsDenominator: Integer); +begin + if IsGraphicVisible(ACanvas.Handle, ARect) then + ACanvas.StretchDraw(ARect, AGraphic); +end; + +procedure DrawGraphicTile(AGraphic: TGraphic; ACanvas: TCanvas; const ARect: TRect; + PixelsNumerator, PixelsDenominator: Integer; AnOffsetX: Integer = 0; AnOffsetY: Integer = 0); +var + DC: HDC; + I, J, W, H: Integer; + Rgn: HRGN; + R: TRect; +begin + DC := ACanvas.Handle; + + with ARect, AGraphic do + begin + W := MulDiv(Width, PixelsNumerator, PixelsDenominator); + H := MulDiv(Height, PixelsNumerator, PixelsDenominator); + AnOffsetX := AnOffsetX mod W; + AnOffsetY := AnOffsetY mod H; + + Rgn := dxPSUtl.IntersectClipRect(DC, ARect); + + for I := 0 to (Right - Left - AnOffsetX) div W do + for J := 0 to (Bottom - Top - AnOffsetX) div H do + begin + R := Bounds(Left + I * W + AnOffsetX, Top + J * H + AnOffsetY, W, H); + if IsGraphicVisible(DC, R) then + if (W <> Width) or (H <> Height) then + ACanvas.StretchDraw(R, AGraphic) + else + ACanvas.Draw(R.Left, R.Top, AGraphic); + end; + + dxPSUtl.RestoreClipRgn(DC, Rgn); + end; +end; + +procedure DrawGraphicStretchProportional(AGraphic: TGraphic; ACanvas: TCanvas; const ARect: TRect; + PixelsNumerator, PixelsDenominator: Integer); +var + DC: HDC; + W, H, V: Integer; + R: TRect; +begin + DC := ACanvas.Handle; + with ARect, AGraphic do + begin + W := Right - Left; + H := Bottom - Top; + if Width / Height > W / H then + begin + V := MulDiv(Height, W, Width); + R := Bounds(Left, Top + (H - V) div 2, W, V); + end + else + begin + V := MulDiv(Width, H, Height); + R := Bounds(Left + (W - V) div 2, Top, V, H); + end; + if IsGraphicVisible(DC, R) then + ACanvas.StretchDraw(R, AGraphic); + end; +end; + +procedure DrawPicture(APicture: TGraphic; ACanvas: TCanvas; const ARect: TRect; + APictureMode: TdxPicturePaintMode; PixelsNumerator, PixelsDenominator: Integer; + AnOffsetX: Integer = 0; AnOffsetY: Integer = 0); +begin + if APicture.Empty or (APicture.Width = 0) or (APicture.Height = 0) then Exit; + case APictureMode of + ppmCenter: + DrawGraphicCenter(APicture, ACanvas, ARect, PixelsNumerator, PixelsDenominator); + ppmStretch: + DrawGraphicStretch(APicture, ACanvas, ARect, PixelsNumerator, PixelsDenominator); + ppmTile: + DrawGraphicTile(APicture, ACanvas, ARect, PixelsNumerator, PixelsDenominator, AnOffsetX, AnOffsetY); + ppmProportional: + DrawGraphicStretchProportional(APicture, ACanvas, ARect, PixelsNumerator, PixelsDenominator); + end; +end; + +initialization + RegisterClass(TBitmap); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxBrhDlg.dfm b/official/x.35/ExpressPrinting System/Sources/dxBrhDlg.dfm new file mode 100644 index 00000000..2f5a2845 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxBrhDlg.dfm @@ -0,0 +1,75 @@ +object dxBrushDlg: TdxBrushDlg + Left = 363 + Top = 214 + BorderStyle = bsDialog + Caption = 'Setup Brush properties' + ClientHeight = 120 + ClientWidth = 229 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object GroupBox1: TGroupBox + Left = 4 + Top = 1 + Width = 222 + Height = 85 + TabOrder = 0 + object lblColor: TLabel + Left = 6 + Top = 21 + Width = 29 + Height = 13 + Caption = '&Color:' + OnClick = lblClick + end + object lblStyle: TLabel + Left = 6 + Top = 53 + Width = 28 + Height = 13 + Caption = '&Style:' + OnClick = lblClick + end + object bvlColorHolder: TBevel + Left = 38 + Top = 16 + Width = 178 + Height = 23 + Visible = False + end + object bvlStyleHolder: TBevel + Left = 38 + Top = 48 + Width = 178 + Height = 22 + Visible = False + end + end + object btnOK: TButton + Left = 70 + Top = 93 + Width = 75 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 151 + Top = 93 + Width = 75 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxBrhDlg.pas b/official/x.35/ExpressPrinting System/Sources/dxBrhDlg.pas new file mode 100644 index 00000000..1aebecfa --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxBrhDlg.pas @@ -0,0 +1,215 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxBrhDlg; + +interface + +{$I cxVer.inc} + +uses + Classes, Graphics, Controls, ExtCtrls, StdCtrls, Buttons, dxPSForm; + +type + TdxBrushDlg = class(TCustomdxPSForm) + GroupBox1: TGroupBox; + lblColor: TLabel; + btnOK: TButton; + btnCancel: TButton; + lblStyle: TLabel; + bvlColorHolder: TBevel; + bvlStyleHolder: TBevel; + procedure ccbxStyleChange(Sender: TObject); + procedure ccbxColorChange(Sender: TObject); + procedure lblClick(Sender: TObject); + private + FBrush: TBrush; + FcbxColor: TCustomComboBox; + FcbxStyle: TCustomComboBox; + FLockControls: Boolean; + FModified: Boolean; + + procedure BrushChanged(Sender: TObject); + procedure SetBrush(Value: TBrush); + + procedure CreateControls; + procedure CreateBrush; + procedure LoadStrings; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function Execute: Boolean; + + property Brush: TBrush read FBrush write SetBrush; + end; + +function AreEqualBrushes(const ABrushes: array of TBrush): Boolean; +function ChooseBrush(ABrush: TBrush): Boolean; + +implementation + +{$R *.DFM} + +uses + SysUtils, {$IFNDEF DELPHI5} dxPSUtl, {$ENDIF} cxClasses, dxExtCtrls, dxPSRes; + +function AreEqualBrushes(const ABrushes: array of TBrush): Boolean; +var + Brush: TBrush; + I: Integer; +begin + Result := False; + if High(ABrushes) - Low(ABrushes) > 1 then + begin + Brush := ABrushes[Low(ABrushes)]; + for I := Low(ABrushes) + 1 to High(ABrushes) do + if (Brush.Style <> ABrushes[I].Style) or (Brush.Color <> ABrushes[I].Color) then + Exit; + end; + Result := True; +end; + +function ChooseBrush(ABrush: TBrush): Boolean; +begin + Assert(ABrush <> nil); + with TdxBrushDlg.Create(nil) do + try + Brush := ABrush; + Result := Execute; + if Result then ABrush.Assign(Brush); + finally + Free; + end; +end; + +{ TdxBrushDlg } + +constructor TdxBrushDlg.Create(AOwner: TComponent); +begin + inherited; + CreateControls; + CreateBrush; + ActiveControl := FcbxColor; +end; + +destructor TdxBrushDlg.Destroy; +begin + FreeAndNil(FBrush); + inherited; +end; + +function TdxBrushDlg.Execute: Boolean; +begin + LoadStrings; + Result := (ShowModal = mrOk) and FModified; +end; + +procedure TdxBrushDlg.ccbxStyleChange(Sender: TObject); +begin + Brush.Style := TdxPSBrushStyleCombo(Sender).BrushStyle; +end; + +procedure TdxBrushDlg.ccbxColorChange(Sender: TObject); +begin + Brush.Color := TdxPSColorCombo(Sender).ColorValue; +end; + +procedure TdxBrushDlg.lblClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; + TCustomComboBox(ActiveControl).DroppedDown := True; +end; + +procedure TdxBrushDlg.CreateControls; +begin + FcbxColor := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(FcbxColor) do + begin + BoundsRect := bvlColorHolder.BoundsRect; + Parent := GroupBox1; + DropDownCount := 8; + ShowColorName := True; + OnChange := ccbxColorChange; + end; + lblColor.FocusControl := FcbxColor; + + FcbxStyle := TdxPSBrushStyleCombo.Create(Self); + with TdxPSBrushStyleCombo(FcbxStyle) do + begin + BoundsRect := bvlStyleHolder.BoundsRect; + Parent := GroupBox1; + ShowStyleName := True; + OnChange := ccbxStyleChange; + end; + lblStyle.FocusControl := FcbxStyle; +end; + +procedure TdxBrushDlg.CreateBrush; +begin + FBrush := TBrush.Create; + FBrush.Color := clBlack; + FBrush.Style := bsSolid; + FBrush.OnChange := BrushChanged; +end; + +procedure TdxBrushDlg.LoadStrings; +begin + Caption := cxGetResourceString(@sdxBrushDlgCaption); + lblColor.Caption := cxGetResourceString(@sdxColor); + lblStyle.Caption := cxGetResourceString(@sdxStyle); + btnOk.Caption := cxGetResourceString(@sdxBtnOK); + btnCancel.Caption := cxGetResourceString(@sdxBtnCancel); +end; + +procedure TdxBrushDlg.BrushChanged(Sender: TObject); +begin + FModified := True; + FLockControls := True; + try + TdxPSColorCombo(FcbxColor).ColorValue := Brush.Color; + TdxPSBrushStyleCombo(FcbxStyle).BrushColor := Brush.Color; + TdxPSBrushStyleCombo(FcbxStyle).BrushStyle := Brush.Style; + finally + FLockControls := False; + end; +end; + +procedure TdxBrushDlg.SetBrush(Value: TBrush); +begin + Brush.Assign(Value); + FModified := False; +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxExtCtrls.pas b/official/x.35/ExpressPrinting System/Sources/dxExtCtrls.pas new file mode 100644 index 00000000..ebcd1fa9 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxExtCtrls.pas @@ -0,0 +1,3134 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxExtCtrls; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, Classes, Graphics, Controls, StdCtrls, ExtCtrls, ComCtrls, + ImgList, Menus, Forms, Dialogs; + +type + { TdxPSSpinEdit } + + TdxButtonType = (btLine, btPage); + TdxSpinValueType = (svtInteger, svtFloat); + TdxScrollMouseSensetivity = (msLow, msMedium, msHigh); + + TdxSpinButtonClickEvent = procedure(Sender: TObject; ButtonType: TdxButtonType; + Button: TUDBtnType) of object; + + TdxPSSpinEdit = class(TCustomEdit) + private + FAlignment: TAlignment; + FArrowKeys: Boolean; + FCheckBounds: Boolean; + FDecimal: Byte; + FDefaultValue: Extended; + FEditorEnabled: Boolean; + FFlat: Boolean; + FIncrButtonWidth: Integer; + FIncrement: Extended; + FLastGoodValue: Extended; + FLegendText: string; + FLockChange: Boolean; + FMaxValue: Extended; + FMinValue: Extended; + FMouseInControl: Boolean; + FPageIncrButtonWidth: Integer; + FPageIncrement: Extended; + FPageUpDown: TCustomUpDown; + FSaveValue: Extended; + FScrollMouseSens: TdxScrollMouseSensetivity; + FUpDown: TCustomUpDown; + FUsePageIncr: Boolean; + FValueType: TdxSpinValueType; + FOnButtonClick: TdxSpinButtonClickEvent; + function GetAsInteger: Longint; + function GetButtonWidth: Integer; + function GetLegendText: string; + function GetMinHeight: Integer; + function IsDefaultValueStored: Boolean; + function IsIncrButtonWidthStored: Boolean; + function IsIncrementStored: Boolean; + function IsMaxStored: Boolean; + function IsMinStored: Boolean; + function IsPageIncrButtonWidthStored: Boolean; + function IsPageIncrementStored: Boolean; + function IsValueStored: Boolean; + procedure SetAlignment(Value: TAlignment); + procedure SetAsInteger(NewValue: Longint); + procedure SetCheckBounds(Value: Boolean); + procedure SetDecimal(NewValue: Byte); + procedure SetDefaultValue(NewDefaultValue: Extended); + procedure SetFlat(Value: Boolean); + procedure SetIncrButtonWidth(Value: Integer); + procedure SetLegendText(const Value: string); + procedure SetMaxValue(Value: Extended); + procedure SetMinValue(Value: Extended); + procedure SetPageIncrButtonWidth(Value: Integer); + procedure SetScrollMouseSens(Value: TdxScrollMouseSensetivity); + procedure SetUsePageIncr(Value: Boolean); + procedure SetValueType(NewType: TdxSpinValueType); + procedure GetTextHeight(var SysHeight, Height: Integer); + procedure PageUpDownClick(Sender: TObject; Button: TUDBtnType); + procedure RecreateButton; + procedure ResizeButtons; + procedure SetEditRect; + procedure UpDownClick(Sender: TObject; Button: TUDBtnType); + procedure WMContextMenu(var Message: TWMContextMenu); message WM_CONTEXTMENU; + procedure WMCut(var Message: TWMCut); message WM_CUT; + procedure WMKillFocus(var Message: TWMKillFocus); message WM_KILLFOCUS; + procedure WMMouseWheel(var Message: TWMMouseWheel); message WM_MOUSEWHEEL; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure WMPaste(var Message: TWMPaste); message WM_PASTE; + {$IFNDEF DELPHI5} + procedure WMRButtonUp(var Message: TWMRButtonUp); message WM_RBUTTONUP; + {$ENDIF} + procedure WMSetFocus(var Message: TWMSetFocus); message WM_SETFOCUS; + procedure WMSize(var Message: TWMSize); message WM_SIZE; + procedure CMBiDiModeChanged(var Message: TMessage); message CM_BIDIMODECHANGED; + procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED; + procedure CMEnter(var Message: TCMEnter); message CM_ENTER; + procedure CMExit(var Message: TCMExit); message CM_EXIT; + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; + procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + protected + procedure Change; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + + function CheckValue(NewValue: Extended): Extended; + procedure DoButtonClick(ButtonType: TdxButtonType; Button: TUDBtnType); + function GetValue: Extended; virtual; + function GetValueText: string; virtual; + function IsValidChar(Key: Char): Boolean; virtual; + procedure SetValue(NewValue: Extended); virtual; + procedure SpecialKeyClick(Key: Word; Shift: TShiftState; Sender: TObject); + public + constructor Create(AOwner: TComponent); override; + property AsInteger: Longint read GetAsInteger write SetAsInteger; + property Text; + published + property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify; + property ArrowKeys: Boolean read FArrowKeys write FArrowKeys default True; + property CheckBounds: Boolean read FCheckBounds write SetCheckBounds default True; + property UsePageIncr: Boolean read FUsePageIncr write SetUsePageIncr default False; + property PageIncrement: Extended read FPageIncrement write FPageIncrement stored IsPageIncrementStored; + property IncrButtonWidth: Integer read FIncrButtonWidth write SetIncrButtonWidth stored IsIncrButtonWidthStored; + property PageIncrButtonWidth: Integer read FPageIncrButtonWidth write SetPageIncrButtonWidth stored IsPageIncrButtonWidthStored; + property ScrollMouseSens: TdxScrollMouseSensetivity read FScrollMouseSens write SetScrollMouseSens default msMedium; + property DefaultValue: Extended read FDefaultValue write SetDefaultValue stored IsDefaultValueStored; + property Decimal: Byte read FDecimal write SetDecimal default 2; + property EditorEnabled: Boolean read FEditorEnabled write FEditorEnabled default True; + property Flat: Boolean read FFlat write SetFlat default False; + property Increment: Extended read FIncrement write FIncrement stored IsIncrementStored; + property LegendText: string read GetLegendText write SetLegendText; + property MaxValue: Extended read FMaxValue write SetMaxValue stored IsMaxStored; + property MinValue: Extended read FMinValue write SetMinValue stored IsMinStored; + property ValueType: TdxSpinValueType read FValueType write SetValueType default svtInteger; + property Value: Extended read GetValue write SetValue stored IsValueStored; + + property Anchors; + property AutoSelect; + property AutoSize; + property BiDiMode; + property Color; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property Font; + property ImeMode; + property ImeName; + property MaxLength; + property ParentBiDiMode; + property ParentColor; + property ParentFont; + property ParentShowHint; + property ReadOnly; + property ShowHint; + property TabOrder; + property TabStop; + property Visible; + property OnButtonClick: TdxSpinButtonClickEvent read FOnButtonClick write FOnButtonClick; + property OnChange; + property OnClick; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + end; + + { TdxPSColorCombo } + + TdxColorType = (ctPure, ctSystem); + TdxColorTypes = set of TdxColorType; + + TdxColorKind = (ckNormal, ckAuto, ckCustom); + + TdxSelectColorProc = function(var AColor: TColor): Boolean of object; + + TdxGetSelectColorProcEvent = procedure(Sender: TObject; + var SelectColorProc: TdxSelectColorProc) of object; + + TdxOnGetColorNameEvent = procedure(Sender: TObject; Index: Integer; + AColor: TColor; AKind: TdxColorKind; var AName: string) of object; + + TdxPSColorCombo = class(TCustomComboBox) + private + FAutoColor: TColor; + FAutoColorText: string; + FColorTypes: TdxColorTypes; + FCustomColorText: string; + FDropDownCountAssigned: Boolean; + FEndEllipsis: Boolean; + FIsAutoColorTextAssigned: Boolean; + FIsCustomColorTextAssigned: Boolean; + FSelEndOk: Boolean; + FShowAutoColor: Boolean; + FShowColorName: Boolean; + FShowCustomColor: Boolean; + FOnGetColorName: TdxOnGetColorNameEvent; + FOnGetSelectColorProc: TdxGetSelectColorProcEvent; + function GetActualDropDownCount: Integer; + function GetAutoColorText: string; + function GetColorTypes: TdxColorTypes; + function GetColorValue: TColor; + function GetCustomColorText: string; + function GetIsAutoColorSelected: Boolean; + function IsAutoColorTextStored: Boolean; + function IsCustomColorTextStored: Boolean; + procedure SetAutoColor(Value: TColor); + procedure SetAutoColorText(const Value: string); + procedure SetColorTypes(Value: TdxColorTypes); + procedure SetColorValue(Value: TColor); + procedure SetCustomColorText(const Value: string); + procedure SetEndEllipsis(Value: Boolean); + procedure SetShowAutoColor(Value: Boolean); + procedure SetShowColorName(Value: Boolean); + procedure SetShowCustomColor(Value: Boolean); + + function FindRGB(AColor: TColor): Integer; + procedure ResetItemHeight; + procedure SelectCustomColor; + function StandardSelectColorProc(var AColor: TColor): Boolean; + + procedure ReadIsAutoColorTextAssigned(AReader: TReader); + procedure ReadIsCustomColorTextAssigned(AReader: TReader); + procedure WriteIsAutoColorTextAssigned(AWriter: TWriter); + procedure WriteIsCustomColorTextAssigned(AWriter: TWriter); + procedure CMBiDiModeChanged(var Message: TMessage); message CM_BIDIMODECHANGED; + procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED; + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; + procedure CMRecreateWnd(var Message: TMessage); message CM_RECREATEWND; + procedure CNCommand(var Message: TWMCommand); message CN_COMMAND; + protected + procedure Click; override; + procedure CreateWnd; override; + procedure DefineProperties(Filer: TFiler); override; + procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure SetDropDownCount(const Value: Integer);{$IFDEF DELPHI6} override; {$ENDIF} + + function GetColorName(Index: Integer): string; virtual; + procedure RefreshItems; + function SelectColorProc: TdxSelectColorProc; dynamic; + public + constructor Create(AOwner: TComponent); override; + + function DefaultAutoColorText: string; virtual; + function DefaultCustomColorText: string; virtual; + + property ActualDropDownCount: Integer read GetActualDropDownCount; + property ColorNames[Index: Integer]: string read GetColorName; + property DropDownCountAssigned: Boolean read FDropDownCountAssigned write FDropDownCountAssigned; + property IsAutoColorSelected: Boolean read GetIsAutoColorSelected; + published + property Anchors; + property AutoColor: TColor read FAutoColor write SetAutoColor default clWindowText; + property AutoColorText: string read GetAutoColorText write SetAutoColorText stored IsAutoColorTextStored; + property BiDiMode; + property Color; + property ColorTypes: TdxColorTypes read GetColorTypes write SetColorTypes default [ctPure, ctSystem]; + property ColorValue: TColor read GetColorValue write SetColorValue default clBlack; + property Constraints; + property CustomColorText: string read GetCustomColorText write SetCustomColorText stored IsCustomColorTextStored; + property Ctl3D; + property DragKind; + property DragMode; + property DragCursor; + property DropDownCount write SetDropDownCount; + property Enabled; + property EndEllipsis: Boolean read FEndEllipsis write SetEndEllipsis default False; + property Font; + property ImeMode; + property ImeName; + property ParentBiDiMode; + property ParentColor; + property ParentCtl3D; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property ShowAutoColor: Boolean read FShowAutoColor write SetShowAutoColor default False; + property ShowColorName: Boolean read FShowColorName write SetShowColorName default True; + property ShowCustomColor: Boolean read FShowCustomColor write SetShowCustomColor default True; + property ShowHint; + property TabOrder; + property TabStop; + property Visible; + property OnChange; + property OnClick; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnDropDown; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnGetColorName: TdxOnGetColorNameEvent read FOnGetColorName write FOnGetColorName; + property OnGetSelectColorProc: TdxGetSelectColorProcEvent read FOnGetSelectColorProc write FOnGetSelectColorProc; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnStartDock; + property OnStartDrag; + end; + + { TdxPSBrushStyleCombo } + + TdxGetBrushStyleNameEvent = procedure(Sender: TObject; Index: Integer; + AStyle: TBrushStyle; var AName: string) of object; + + TdxPSBrushStyleCombo = class(TCustomComboBox) + private + FBrushColor: TColor; + FEndEllipsis: Boolean; + FShowStyleName: Boolean; + FOnGetBrushStyleName: TdxGetBrushStyleNameEvent; + function GetStyle(Index: Integer): TBrushStyle; + function GetStyleIndex(Style: TBrushStyle): Integer; + function GetStyleValue: TBrushStyle; + procedure SetBrushColor(Value: TColor); + procedure SetEndEllipsis(Value: Boolean); + procedure SetShowStyleName(Value: Boolean); + procedure SetStyleValue(Value: TBrushStyle); + procedure RefreshItems; + procedure ResetItemHeight; + procedure CMBiDiModeChanged(var Message: TMessage); message CM_BIDIMODECHANGED; + procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED; + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; + procedure CMRecreateWnd(var Message: TMessage); message CM_RECREATEWND; + protected + procedure CreateWnd; override; + procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); override; + function GetStyleName(Index: Integer): string; virtual; + property Sorted; + public + constructor Create(AOwner: TComponent); override; + property StyleIndexes[Style: TBrushStyle]: Integer read GetStyleIndex; + property StyleNames[Index: Integer]: string read GetStyleName; + property Styles[Index: Integer]: TBrushStyle read GetStyle; + published + property Anchors; + property BiDiMode; + property BrushColor: TColor read FBrushColor write SetBrushColor default clWindowText; + property BrushStyle: TBrushStyle read GetStyleValue write SetStyleValue default bsSolid; + property Color; + property Constraints; + property Ctl3D; + property DragKind; + property DragMode; + property DragCursor; + property Enabled; + property EndEllipsis: Boolean read FEndEllipsis write SetEndEllipsis default False; + property Font; + property ImeMode; + property ImeName; + property ParentBiDiMode; + property ParentColor; + property ParentCtl3D; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property ShowHint; + property ShowStyleName: Boolean read FShowStyleName write SetShowStyleName default False; + property TabOrder; + property TabStop; + property Visible; + property OnChange; + property OnClick; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnDropDown; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnGetBrushStyleName: TdxGetBrushStyleNameEvent read FOnGetBrushStyleName write FOnGetBrushStyleName; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnStartDock; + property OnStartDrag; + end; + +{ TdxPSPaintPanel } + +{$IFDEF BCB} + {$IFDEF CBUILDER4} + {$DEFINE CANDEFINE_DOUBLEBUFFERED} + {$ENDIF} +{$ELSE} + {$DEFINE CANDEFINE_DOUBLEBUFFERED} +{$ENDIF} + + TdxEdgeBorder = (ebLeft, ebTop, ebRight, ebBottom); + TdxEdgeBorders = set of TdxEdgeBorder; + + TdxEdgeStyle = (esNone, esRaised, esSunken); + + TdxPSPaintPanel = class(TCustomPanel) + private + FEdgeBorders: TdxEdgeBorders; + FEdgeInner: TdxEdgeStyle; + FEdgeOuter: TdxEdgeStyle; + FOnMouseEnter: TNotifyEvent; + FOnMouseLeave: TNotifyEvent; + FOnPaint: TNotifyEvent; + function GetEdgeBorders: TdxEdgeBorders; + procedure SetEdgeBorders(Value: TdxEdgeBorders); + procedure SetEdgeInner(Value: TdxEdgeStyle); + procedure SetEdgeOuter(Value: TdxEdgeStyle); + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure CMCtl3DChanged(var Message: TMessage); message CM_CTL3DCHANGED; + procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED; + protected + procedure Paint; override; + procedure DoPaint; dynamic; + procedure DoMouseEnter; dynamic; + procedure DoMouseLeave; dynamic; + public + constructor Create(AOwner: TComponent); override; + property Canvas; + published + property Align; + property Anchors; + property Constraints; + property DragKind; + {$IFDEF CANDEFINE_DOUBLEBUFFERED} + property DoubleBuffered default True; + {$ENDIF} + property EdgeBorders: TdxEdgeBorders read GetEdgeBorders write SetEdgeBorders default [ebLeft, ebTop, ebRight, ebBottom]; + property EdgeInner: TdxEdgeStyle read FEdgeInner write SetEdgeInner default esRaised; + property EdgeOuter: TdxEdgeStyle read FEdgeOuter write SetEdgeOuter default esSunken; + property DragCursor; + property DragMode; + property Enabled; + property Ctl3D; + property ParentColor; + property ParentCtl3D; + property ParentShowHint; + property PopupMenu; + property ShowHint; + property TabOrder; + property TabStop; + property Visible; + property OnPaint: TNotifyEvent read FOnPaint write FOnPaint; + property OnCanResize; + property OnConstrainedResize; + property OnClick; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnMouseDown; + property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter; + property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnResize; + property OnStartDock; + property OnStartDrag; + end; + + { TdxPSBitmapAnimator } + + TdxPSBitmapAnimator = class(TGraphicControl) + private + FAnimationSpeed: Integer; + FAnimationStepCount: Integer; + FBitmap: TBitmap; + FState: Boolean; + procedure SetBitmap(Value: TBitmap); + procedure SetState(Value: Boolean); + protected + procedure Paint; override; + procedure Resize; override; + + procedure Animate; dynamic; + procedure StateChanged; dynamic; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + published + property AnimationSpeed: Integer read FAnimationSpeed write FAnimationSpeed {ms} default 10; + property AnimationStepCount: Integer read FAnimationStepCount write FAnimationStepCount default 10; + property Bitmap: TBitmap read FBitmap write SetBitmap; + property State: Boolean read FState write SetState default False; + end; + + { TdxPSWarningPane } + + TdxPSWarningPane = class(TdxPSBitmapAnimator) + private + FHint: string; + procedure SetHint(const Value: string); + protected + procedure InitializeBitmap; virtual; + procedure InitializeBitmapHint(var R: TRect); virtual; + procedure StateChanged; override; + public + constructor Create(AOwner: TComponent); override; + procedure SetStateAndHint(NewState: Boolean; const AHint: string); + published + property Font; + property Hint: string read FHint write SetHint; + end; + + { TdxPSImageScrollBox } + + TdxPSImageScrollBoxBuiltInMenuItem = (biiPreview, biiCopy, biiSave); + TdxPSImageScrollBoxBuiltInMenuItems = set of TdxPSImageScrollBoxBuiltInMenuItem; + + TdxPSImageScrollBox = class(TScrollBox) + private + FBuiltInImages: TCustomImageList; + FBuiltInMenu: TPopupMenu; + FBuiltInMenuItemsVisibility: TdxPSImageScrollBoxBuiltInMenuItems; + FCanvas: TControlCanvas; + FCenter: Boolean; + FHintText: string; + FIsGraphicInvalid: Boolean; + FPicture: TPicture; + function GetCanvas: TCanvas; + function GetHasGraphic: Boolean; + function GetHasPictureRestRectBottom: Boolean; + function GetHasPictureRestRectLeft: Boolean; + function GetHasPictureRestRectRight: Boolean; + function GetHasPictureRestRectTop: Boolean; + function GetHasScrollBars: Boolean; + function GetHasScrollHorzBar: Boolean; + function GetHasScrollVertBar: Boolean; + function GetHintTextRect: TRect; + function GetIsPictureHeightExceedControlBounds: Boolean; + function GetIsPictureWidthExceedControlBounds: Boolean; + function GetPictureOriginX: Integer; + function GetPictureOriginY: Integer; + function GetPictureHeight: Integer; + function GetPictureRect: TRect; + function GetPictureWidth: Integer; + function GetPictureRestRectBottom: TRect; + function GetPictureRestRectRight: TRect; + function GetPictureRestRectLeft: TRect; + function GetPictureRestRectTop: TRect; + procedure SetCenter(Value: Boolean); + procedure SetHintText(const Value: string); + procedure SetPicture(Value: TPicture); + + procedure BuiltInMenuPopup(Sender: TObject); + procedure CopyClick(Sender: TObject); + procedure SaveClick(Sender: TObject); + procedure PreviewClick(Sender: TObject); + procedure PictureChanged(Sender: TObject); + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND; + procedure WMMouseActivate(var Message: TWMMouseActivate); message WM_MOUSEACTIVATE; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure WMPaint(var Message: TWMPaint); message WM_PAINT; + protected + miCopy: TMenuItem; + miLine1: TMenuItem; + miLine2: TMenuItem; + miPreview: TMenuItem; + miSave: TMenuItem; + procedure CreateParams(var Params: TCreateParams); override; + procedure DblClick; override; + function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; override; + + procedure CreateBuiltInImages; virtual; + procedure CreateBuiltInMenu; virtual; + procedure DrawHint; virtual; + procedure DrawPicture; virtual; + procedure DrawPictureRestSpace; virtual; + procedure Paint; virtual; + + property HasPictureRestRectBottom: Boolean read GetHasPictureRestRectBottom; + property HasPictureRestRectLeft: Boolean read GetHasPictureRestRectLeft; + property HasPictureRestRectRight: Boolean read GetHasPictureRestRectRight; + property HasPictureRestRectTop: Boolean read GetHasPictureRestRectTop; + property HasScrollBars: Boolean read GetHasScrollBars; + property HasScrollHorzBar: Boolean read GetHasScrollHorzBar; + property HasScrollVertBar: Boolean read GetHasScrollVertBar; + property HintTextRect: TRect read GetHintTextRect; + property IsPictureHeightExceedControlBounds: Boolean read GetIsPictureHeightExceedControlBounds; + property IsPictureWidthExceedControlBounds: Boolean read GetIsPictureWidthExceedControlBounds; + property PictureHeight: Integer read GetPictureHeight; + property PictureOriginX: Integer read GetPictureOriginX; + property PictureOriginY: Integer read GetPictureOriginY; + property PictureRect: TRect read GetPictureRect; + property PictureRestRectBottom: TRect read GetPictureRestRectBottom; + property PictureRestRectLeft: TRect read GetPictureRestRectLeft; + property PictureRestRectRight: TRect read GetPictureRestRectRight; + property PictureRestRectTop: TRect read GetPictureRestRectTop; + property PictureWidth: Integer read GetPictureWidth; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + property BuiltInImages: TCustomImageList read FBuiltInImages; + property BuiltInMenu: TPopupMenu read FBuiltInMenu; + property BuiltInMenuItemsVisibility: TdxPSImageScrollBoxBuiltInMenuItems read FBuiltInMenuItemsVisibility + write FBuiltInMenuItemsVisibility default [biiPreview..biiSave]; + property Canvas: TCanvas read GetCanvas; + property HasGraphic: Boolean read GetHasGraphic; + published + property Center: Boolean read FCenter write SetCenter default True; + property HintText: string read FHintText write SetHintText; + property Picture: TPicture read FPicture write SetPicture; + end; + +function WarningSignBitmap: TBitmap; + +var + UseAllColorValuesInDropDownList: Boolean = True; + +implementation + +uses + {$IFDEF DELPHI7} + Themes, UxTheme, + {$ENDIF} + CommCtrl, SysUtils, Registry, ExtDlgs, ClipBrd, cxClasses, dxPSUtl, dxPSImgs, + dxPSGlbl, dxPSRes, dxPCPrVw, dxPSPopupMan, dxExtCtrlsStrs; + +const + MinButtonWidth = 9; + ScrollMouseSensibility: array[TdxScrollMouseSensetivity] of Integer = (10, 5, 1); + + PureColors: array[0..19] of TColor = + (clBlack, clOlive, clTeal, clGreen, clMoneyGreen, clLime, clNavy, clBlue, + clAqua, clSkyBlue, clGray, clMedGray, clSilver, clMaroon, clPurple, clFuchsia, clRed, + clCream, clYellow, clWhite); + SysColors: array[0..24] of TColor = + (clScrollBar, clBackground, clActiveCaption, clInactiveCaption, clMenu, + clWindow, clWindowFrame, clMenuText, clWindowText, clCaptionText, clActiveBorder, + clInactiveBorder, clAppWorkSpace, clHighlight, clHighlightText, clBtnFace, + clBtnShadow, clGrayText, clBtnText, clInactiveCaptionText, clBtnHighlight, + cl3DDkShadow, cl3DLight, clInfoText, clInfoBk); + +var + FWarningSignBitmap: TBitmap; + +function WarningSignBitmap: TBitmap; +begin + if FWarningSignBitmap = nil then + begin + FWarningSignBitmap := TBitmap.Create; + Bitmap_LoadFromResourceName(FWarningSignBitmap, IDB_DXPSWARNINGSIGN); + FWarningSignBitmap.Transparent := True; + end; + Result := FWarningSignBitmap; +end; + +type + TdxUpDown = class(TCustomUpDown) + private + FLockChange: Boolean; + FMouseSensibility: TdxScrollMouseSensetivity; + FPrevMousePos: TSmallPoint; + procedure CancelScroll; + function MouseInSplitRegion(Pt: TSmallPoint): Boolean; + procedure ScrollMessage(var Message: TWMScroll); + procedure WMCaptureChanged(var Message: TMessage); message WM_CAPTURECHANGED; + procedure WMHScroll(var Message: TWMHScroll); message CN_HSCROLL; + procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; + procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; + procedure WMMouseMove(var Message: TWMMouseMove); message WM_MOUSEMOVE; + {$IFNDEF DELPHI5} + procedure WMRButtonUp(var Message: TWMRButtonUp); message WM_RBUTTONUP; + {$ENDIF} + procedure WMVScroll(var Message: TWMVScroll); message CN_VSCROLL; + protected + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + public + constructor Create(AOwner: TComponent); override; + + property MouseSensibility: TdxScrollMouseSensetivity read FMouseSensibility write FMouseSensibility default msMedium; + property PopupMenu; + property OnClick; + end; + +constructor TdxUpDown.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Orientation := udVertical; + Min := -1; + Max := 1; + Position := 0; + MouseSensibility := msMedium; +end; + +procedure TdxUpDown.KeyDown(var Key: Word; Shift: TShiftState); +begin + if (GetCapture = Handle) and (Key = VK_ESCAPE) then + CancelScroll; + inherited KeyDown(Key, Shift); +end; + +procedure TdxUpDown.CancelScroll; +begin + SetCursor(Screen.Cursors[crDefault]); +end; + +function TdxUpDown.MouseInSplitRegion(Pt: TSmallPoint): Boolean; +const + Delta = 2; +begin + Result := (Pt.Y > (Height div 2) - Delta) and (Pt.Y < (Height div 2) + Delta); +end; + +procedure TdxUpDown.ScrollMessage(var Message: TWMScroll); +const + UDBtnType: array [Boolean] of TUDBtnType = (btNext, btPrev); +begin + if not FLockChange then + begin + FLockChange := True; + try + case message.ScrollCode of + SB_THUMBPOSITION: + Click(UDBtnType[Message.Pos < 0]); + SB_LINEUP: + Click(btNext); + SB_LINEDOWN: + Click(btPrev); + end; + if HandleAllocated then SendMessage(Handle, UDM_SETPOS, 0, 0); + finally + FLockChange := False; + end; + end; +end; + +procedure TdxUpDown.WMCaptureChanged(var Message: TMessage); +begin + CancelScroll; +end; + +procedure TdxUpDown.WMHScroll(var message: TWMHScroll); +begin + ScrollMessage(Message); +end; + +procedure TdxUpDown.WMLButtonDown(var Message: TWMLButtonDown); +begin + if MouseInSplitRegion(Message.Pos) then + begin + FPrevMousePos := Message.Pos; + SetCapture(Handle); + end + else + inherited; +end; + +procedure TdxUpDown.WMLButtonUp(var Message: TWMLButtonUp); +begin + inherited; + if GetCapture = Handle then ReleaseCapture; +end; + +{$IFNDEF DELPHI5} +procedure TdxUpDown.WMRButtonUp(var Message: TWMMouse); +begin + inherited; + if not (csNoStdEvents in ControlStyle) then + with Message do + MouseUp(mbRight, KeysToShiftState(Keys), XPos, YPos); +end; +{$ENDIF} + +procedure TdxUpDown.WMMouseMove(var Message: TWMMouseMove); +const + Cursors: array[Boolean] of TCursor = (crDefault, crVSplit); + UDBtnType: array [Boolean] of TUDBtnType = (btNext, btPrev); +var + Pt: TSmallPoint; +begin + Pt := Message.Pos; + if GetCapture = Handle then + begin + if not FLockChange and (Abs(FPrevMousePos.Y - Pt.Y) >= ScrollMouseSensibility[MouseSensibility]) then + begin + Click(UDBtnType[Pt.Y > FPrevMousePos.Y]); + SendMessage(Handle, UDM_SETPOS, 0, 0); + FPrevMousePos := Pt; + end; + end + else + begin + Cursor := Cursors[MouseInSplitRegion(Pt)]; + inherited; + end; +end; + +procedure TdxUpDown.WMVScroll(var message: TWMVScroll); +begin + ScrollMessage(message); +end; + +procedure DrawBorder(Control: TWinControl); +var + DC: HDC; + R: TRect; + Pt: TPoint; + MouseInControl: Boolean; + DrawSunken: Boolean; + FocusControl: TWinControl; +begin + DC := GetWindowDC(Control.Handle); + try + GetWindowRect(Control.Handle, R); + GetCursorPos(Pt); + MouseInControl := PtInRect(R, Pt); + OffsetRect(R, -R.Left, -R.Top); + if Control.Enabled then + begin + if csDesigning in Control.ComponentState then + DrawSunken := True + else + if Control.Focused then + DrawSunken := True + else + if GetParentForm(Control).Active and MouseInControl then + begin + FocusControl := FindControl(GetFocus); + if FocusControl <> nil then + DrawSunken := not (FocusControl is Control.ClassType) + else + DrawSunken := True; + end + else + DrawSunken := False; + + if DrawSunken then + DrawEdge(DC, R, BDR_SUNKENOUTER, BF_RECT) + else + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + + InflateRect(R, -1, -1); + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + end + else + begin + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + InflateRect(R, -1, -1); + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNHIGHLIGHT)); + end; + finally + ReleaseDC(Control.Handle, DC); + end; +end; + +{ TdxPSSpinEdit } + +constructor TdxPSSpinEdit.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Text := '0'; + FDefaultValue := 0; + FFlat := False; + Height := 22; + Width := 65; + FIncrement := 1.0; + FPageIncrement := 10.0; + FCheckBounds := True; + FDecimal := 2; + FEditorEnabled := True; + FUsePageIncr := False; + FIncrButtonWidth := GetSystemMetrics(SM_CXVSCROLL); + FPageIncrButtonWidth := FIncrButtonWidth; + FScrollMouseSens := msMedium; + FArrowKeys := True; + FLegendText := ''; + FLastGoodValue := 0.0; + RecreateButton; +end; + +procedure TdxPSSpinEdit.RecreateButton; +begin + FreeAndNil(FUpDown); + FreeAndNil(FPageUpDown); + if FUsePageIncr then + begin + FPageUpDown := TdxUpDown.Create(Self); + with TdxUpDown(FPageUpDown) do + begin + Visible := True; + SetBounds(0, 0, FPageIncrButtonWidth, Self.Height); + if BiDiMode = bdRightToLeft then + Align := alLeft + else + Align := alRight; + Parent := Self; + MouseSensibility := Self.ScrollMouseSens; + OnClick := PageUpDownClick; + PopupMenu := Self.PopupMenu; + end; + end; + + FUpDown := TdxUpDown.Create(Self); + with TdxUpDown(FUpDown) do + begin + Visible := True; + SetBounds(0, 0, FIncrButtonWidth, Self.Height); + if BiDiMode = bdRightToLeft then + Align := alLeft + else + Align := alRight; + Parent := Self; + MouseSensibility := Self.ScrollMouseSens; + OnClick := UpDownClick; + PopupMenu := Self.PopupMenu; + end; +end; + +procedure TdxPSSpinEdit.UpDownClick(Sender: TObject; Button: TUDBtnType); +const + Keys: array[TUDBtnType] of UINT = (VK_UP, VK_DOWN); +begin + if TabStop and CanFocus then SetFocus; + SpecialKeyClick(Keys[Button], [], Sender); +end; + +procedure TdxPSSpinEdit.PageUpDownClick(Sender: TObject; Button: TUDBtnType); +const + Keys: array[TUDBtnType] of UINT = (VK_PRIOR, VK_NEXT); +begin + if TabStop and CanFocus then SetFocus; + SpecialKeyClick(Keys[Button], [], Sender); +end; + +function TdxPSSpinEdit.GetButtonWidth: Integer; +begin + Result := 0; + if FUpDown <> nil then Result := FUpDown.Width; + if FPageUpDown <> nil then Result := Result + FPageUpDown.Width; +end; + +procedure TdxPSSpinEdit.ResizeButtons; +begin + if FUpDown <> nil then + begin + FUpDown.Width := FIncrButtonWidth; + if BiDiMode = bdRightToLeft then + FUpDown.Align := alLeft + else + FUpDown.Align := alRight; + end; + if FPageUpDown <> nil then + begin + FPageUpDown.Width := FPageIncrButtonWidth; + if BiDiMode = bdRightToLeft then + FPageUpDown.Align := alLeft + else + FPageUpDown.Align := alRight; + end; +end; + +procedure TdxPSSpinEdit.KeyDown(var Key: Word; Shift: TShiftState); +var + IsProcessKey: Boolean; +begin + inherited KeyDown(Key, Shift); + IsProcessKey := + Key in [VK_PRIOR, VK_NEXT, VK_UP, VK_DOWN, VK_END, VK_HOME, VK_ESCAPE, VK_DELETE]; + if IsProcessKey then + case Key of + VK_PRIOR, VK_NEXT, VK_UP, VK_DOWN: + if ArrowKeys then + begin + SpecialKeyClick(Key, Shift, Self); + Key := 0; + end; + VK_END: + if ssCtrl in Shift then + begin + Value := MaxValue; + Key := 0; + end; + VK_HOME: + if ssCtrl in Shift then + begin + Value := MinValue; + Key := 0; + end; + VK_DELETE: + if not EditorEnabled then + begin + MessageBeep(0); + Key := 0; + end; + VK_ESCAPE: + begin + end; + end; +end; + +procedure TdxPSSpinEdit.Change; +begin + if not FLockChange then inherited Change; +end; + +procedure TdxPSSpinEdit.KeyPress(var Key: Char); +begin + if not EditorEnabled or not IsValidChar(Key) then + begin + Key := #0; + MessageBeep(0); + end; + + if Key <> #0 then + begin + inherited; + if Key = Char(VK_RETURN) then + begin + if AutoSelect then SelectAll; + Value := Value; + end; + if (Key = Char(VK_RETURN)) or (Key = Char(VK_ESCAPE)) then + begin + GetParentForm(Self).Perform(CM_DIALOGKEY, Byte(Key), 0); + if Key = Char(VK_RETURN) then Key := #0; + end; + end; +end; + +function TdxPSSpinEdit.IsValidChar(Key: Char): Boolean; +begin + Result := Key in ['+', '-', '0'..'9']; + Result := Result or (Key < #32) or (Pos(Key, LegendText) > 0); + if not Result and (ValueType = svtFloat) then + Result := Key = DecimalSeparator; + + if Result and not FEditorEnabled and + ((Key >= #32) or (Key = Char(VK_BACK)) or (Key = Char(VK_DELETE))) then + Result := False; +end; + +procedure TdxPSSpinEdit.CreateParams(var Params: TCreateParams); +const + Alignments: array[Boolean, TAlignment] of DWORD = + ((ES_LEFT, ES_RIGHT, ES_CENTER), (ES_RIGHT, ES_LEFT, ES_CENTER)); +begin + inherited; + Params.Style := Params.Style or ES_MULTILINE or WS_CLIPCHILDREN or + Alignments[UseRightToLeftAlignment, FAlignment]; +end; + +procedure TdxPSSpinEdit.CreateWnd; +begin + inherited; + SetEditRect; +end; + +procedure TdxPSSpinEdit.SetEditRect; +var + R: TRect; +begin + if BiDiMode = bdRightToLeft then + R := MakeRect(GetButtonWidth + 1, 0, ClientWidth - 1, ClientHeight + 1) + else + R := MakeRect(0, 0, ClientWidth - GetButtonWidth - 2, ClientHeight + 1); + SendMessage(Handle, EM_SETRECTNP, 0, Longint(@R)); +end; + +procedure TdxPSSpinEdit.SetAlignment(Value: TAlignment); +begin + if FAlignment <> Value then + begin + FAlignment := Value; + RecreateWnd; + end; +end; + +procedure TdxPSSpinEdit.WMSize(var message: TWMSize); +var + MinHeight: Integer; +begin + inherited; + MinHeight := GetMinHeight; + if Height < MinHeight then + Height := MinHeight + else + begin + ResizeButtons; + SetEditRect; + end; +end; + +procedure TdxPSSpinEdit.GetTextHeight(var SysHeight, Height: Integer); +var + DC: hDC; + SaveFont: hFont; + SysMetrics, Metrics: TTextMetric; +begin + DC := GetDC(0); + GetTextMetrics(DC, SysMetrics); + SaveFont := SelectObject(DC, Font.Handle); + GetTextMetrics(DC, Metrics); + SelectObject(DC, SaveFont); + ReleaseDC(0, DC); + SysHeight := SysMetrics.tmHeight; + Height := Metrics.tmHeight; +end; + +function TdxPSSpinEdit.GetMinHeight: Integer; +var + I, H: Integer; +begin + GetTextHeight(I, H); + if I > H then I := H; + Result := H + GetSystemMetrics(SM_CYBORDER) * 4 + 1; +end; + +procedure TdxPSSpinEdit.SpecialKeyClick(Key: Word; Shift: TShiftState; Sender: TObject); +var + OldText: string; +begin + if not ReadOnly then + begin + FLockChange := True; + try + OldText := inherited Text; + case Key of + VK_PRIOR: + begin + Value := Value + FPageIncrement; + DoButtonClick(btPage, btPrev); + end; + + VK_NEXT: + begin + Value := Value - FPageIncrement; + DoButtonClick(btPage, btNext); + end; + + VK_UP: + if ssCtrl in Shift then + begin + Value := Value + FPageIncrement; + DoButtonClick(btPage, btNext); + end + else + begin + Value := Value + FIncrement; + DoButtonClick(btLine, btNext); + end; + + VK_DOWN: + if ssCtrl in Shift then + begin + Value := Value - FPageIncrement; + DoButtonClick(btPage, btPrev); + end + else + begin + Value := Value - FIncrement; + DoButtonClick(btLine, btPrev); + end; + end; + finally + FLockChange := False; + end; + + if CompareText(OldText, inherited Text) <> 0 then + begin + Modified := True; + Change; + end; + end + else + MessageBeep(0); +end; + +function TdxPSSpinEdit.GetValueText: string; +var + P: Integer; +begin + if LegendText <> '' then + begin + P := Pos(LegendText, Text); + if P > 0 then + Result := Copy(Text, 1, P - 1) + else + Result := Text; + end + else + Result := Text; +end; + +function TdxPSSpinEdit.GetValue: Extended; +var + ValueText: string; + Code: Integer; +begin + ValueText := GetValueText; + if ValueType = svtFloat then + begin + {$IFDEF DELPHI6} + Result := StrToFloatDef(ValueText, DefaultValue); + {$ELSE} + if not TextToFloat(PChar(ValueText), Result, fvExtended) then + Result := DefaultValue; + {$ENDIF} + end + else + begin + Val(ValueText, Result, Code); + if Code <> 0 then + Result := Trunc(DefaultValue); + end; + +(*try + if ValueType = svtFloat then + Result := StrToFloat(GetValueText) + else + Result := StrToInt(GetValueText); + { Because -> StrToFloat(',7') = 0,7 } + Result := CheckValue(Result); + except + Result := DefaultValue; + if ValueType = svtInteger then Result := Trunc(Result); + end;*) +end; + +procedure TdxPSSpinEdit.SetLegendText(const Value: string); +var + V: Extended; +begin + if FLegendText <> Value then + begin + V := Self.Value; + FLegendText := Value; + Self.Value := V; + end; +end; + +function TdxPSSpinEdit.GetLegendText: string; +begin + if FLegendText = '' then + Result := '' + else + if FLegendText[1] = ' ' then + Result := FLegendText + else + Result := ' ' + FLegendText; +end; + +procedure TdxPSSpinEdit.SetValue(NewValue: Extended); +begin + if ValueType = svtFloat then + Text := FloatToStrF(CheckValue(NewValue), ffFixed, 15, FDecimal) + LegendText + else + Text := IntToStr(Round(CheckValue(NewValue))) + LegendText; +end; + +function TdxPSSpinEdit.CheckValue(NewValue: Extended): Extended; +begin + Result := NewValue; + if CheckBounds then +// if (FMinValue <> 0) or (FMaxValue <> FMinValue) then + if NewValue < FMinValue then + Result := FMinValue + else + if NewValue > FMaxValue then + Result := FMaxValue; +end; + +procedure TdxPSSpinEdit.SetDefaultValue(NewDefaultValue: Extended); +begin + if FDefaultValue <> NewDefaultValue then + FDefaultValue := CheckValue(NewDefaultValue); +end; + +function TdxPSSpinEdit.GetAsInteger: Longint; +begin + Result := Trunc(GetValue); +end; + +procedure TdxPSSpinEdit.SetAsInteger(NewValue: Longint); +begin + SetValue(NewValue); +end; + +procedure TdxPSSpinEdit.SetValueType(NewType: TdxSpinValueType); +begin + if FValueType <> NewType then + begin + FValueType := NewType; + Value := GetValue; + if FValueType = svtInteger then + begin + FIncrement := Round(FIncrement); + if FIncrement = 0 then FIncrement := 1; + FPageIncrement := Round(FPageIncrement); + if FPageIncrement = 0 then FPageIncrement := 1; + end; + end; +end; + +procedure TdxPSSpinEdit.SetFlat(Value: Boolean); +begin + if FFlat <> Value then + begin + FFlat := Value; + RecreateWnd; + end; +end; + +procedure TdxPSSpinEdit.SetUsePageIncr(Value: Boolean); +begin + if FUsePageIncr <> Value then + begin + FUsePageIncr := Value; + RecreateButton; + ResizeButtons; + SetEditRect; + end; +end; + +procedure TdxPSSpinEdit.SetIncrButtonWidth(Value: Integer); +begin + if Value < MinButtonWidth then + Value := MinButtonWidth; + + if FIncrButtonWidth <> Value then + begin + FIncrButtonWidth := Value; + ResizeButtons; + SetEditRect; + end; +end; + +procedure TdxPSSpinEdit.SetPageIncrButtonWidth(Value: Integer); +begin + if Value < MinButtonWidth then + Value := MinButtonWidth; + + if FPageIncrButtonWidth <> Value then + begin + FPageIncrButtonWidth := Value; + ResizeButtons; + SetEditRect; + end; +end; + +function TdxPSSpinEdit.IsIncrButtonWidthStored: Boolean; +begin + Result := FUpDown.Width <> GetSystemMetrics(SM_CXVSCROLL); +end; + +function TdxPSSpinEdit.IsPageIncrButtonWidthStored: Boolean; +begin + Result := (FPageUpDown <> nil) and (FPageUpDown.Width <> GetSystemMetrics(SM_CXVSCROLL)); +end; + +function TdxPSSpinEdit.IsIncrementStored: Boolean; +begin + Result := Increment <> 1.0; +end; + +function TdxPSSpinEdit.IsPageIncrementStored: Boolean; +begin + Result := PageIncrement <> 10.0; +end; + +function TdxPSSpinEdit.IsMaxStored: Boolean; +begin + Result := MaxValue <> 0.0; +end; + +function TdxPSSpinEdit.IsMinStored: Boolean; +begin + Result := MinValue <> 0.0; +end; + +function TdxPSSpinEdit.IsValueStored: Boolean; +begin + Result := GetValue <> 0.0; +end; + +function TdxPSSpinEdit.IsDefaultValueStored: Boolean; +begin + Result := FDefaultValue <> 0.0; +end; + +procedure TdxPSSpinEdit.SetMaxValue(Value: Extended); +begin + if FMaxValue <> Value then + begin + FMaxValue := Value; + CheckValue(Self.Value); + end; +end; + +procedure TdxPSSpinEdit.SetMinValue(Value: Extended); +begin + if FMinValue <> Value then + begin + FMinValue := Value; + Self.Value := Self.Value; + end; +end; + +procedure TdxPSSpinEdit.SetCheckBounds(Value: Boolean); +begin + if FCheckBounds <> Value then + begin + FCheckBounds := Value; + Self.Value := Self.Value; + end; +end; + +procedure TdxPSSpinEdit.SetDecimal(NewValue: Byte); +begin + if FDecimal <> NewValue then + begin + FDecimal := NewValue; + Self.Value := Self.Value; + end; +end; + +procedure TdxPSSpinEdit.SetScrollMouseSens(Value: TdxScrollMouseSensetivity); +begin + if FScrollMouseSens <> Value then + begin + FScrollMouseSens := Value; + TdxUpDown(FUpDown).MouseSensibility := Value; + + if FPageUpDown <> nil then + TdxUpDown(FPageUpDown).MouseSensibility := Value; + end; +end; + +procedure TdxPSSpinEdit.DoButtonClick(ButtonType: TdxButtonType; Button: TUDBtnType); +begin + if Assigned(FOnButtonClick) then FOnButtonClick(Self, ButtonType, Button); +end; + +procedure TdxPSSpinEdit.WMContextMenu(var Message: TWMContextMenu); +begin + if Message.hWnd = Handle then inherited; +end; + +procedure TdxPSSpinEdit.WMCut(var Message: TWMCut); +begin + if not FEditorEnabled or ReadOnly then Exit; + inherited; +end; + +procedure TdxPSSpinEdit.WMKillFocus(var Message: TWMKillFocus); +begin + inherited; + if Flat then DrawBorder(Self); +end; + +procedure TdxPSSpinEdit.WMMouseWheel(var Message: TWMMouseWheel); + + function GetControl: TCustomUpDown; + begin + if GetKeyState(VK_CONTROL) < 0 then + Result := FPageUpDown + else + Result := FUpDown; + end; + +const + ScrollCodes: array[Boolean] of SmallInt = (SB_LINEDOWN, SB_LINEUP); +var + ScrollMsg: TWMScroll; +begin + inherited; + FillChar(ScrollMsg, SizeOf(TMessage), 0); + ScrollMsg.Msg := WM_VSCROLL; + ScrollMsg.ScrollCode := ScrollCodes[Message.WheelDelta > 0]; + if GetControl is TdxUpDown then + TdxUpDown(GetControl).ScrollMessage(ScrollMsg); +end; + +procedure TdxPSSpinEdit.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + inherited; + //if Flat then InflateRect(message.CalcSize_Params.rgrc[0], -1, -1); +end; + +procedure TdxPSSpinEdit.WMNCPaint(var Message: TWMNCPaint); +begin + inherited; + if Flat then DrawBorder(Self); +end; + +procedure TdxPSSpinEdit.WMPaste(var Message: TWMPaste); +begin + if not FEditorEnabled or ReadOnly then Exit; + inherited; +end; + +{$IFNDEF DELPHI5} +procedure TdxPSSpinEdit.WMRButtonUp(var Message: TWMRButtonUp); +var + R: TRect; + Pt: TPoint; +begin + if (PopupMenu <> nil) and PopupMenu.AutoPopup then + begin + R := FUpDown.ClientRect; + if FUsePageIncr then + UnionRect(R, R, FPageUpDown.ClientRect); + Pt := ScreenToClient(SmallPointToPoint(Message.Pos)); + if PtInRect(R, Pt) then Exit; + end; + inherited; +end; +{$ENDIF} + +procedure TdxPSSpinEdit.WMSetFocus(var Message: TWMSetFocus); +begin + inherited; + if Flat then DrawBorder(Self); +end; + +procedure TdxPSSpinEdit.CMBiDiModeChanged(var Message: TMessage); +begin + inherited; + ResizeButtons; + SetEditRect; + Invalidate; +end; + +procedure TdxPSSpinEdit.CMEnabledChanged(var Message: TMessage); +begin + inherited; + if FUpDown <> nil then FUpDown.Enabled := Enabled; + if FPageUpDown <> nil then FPageUpDown.Enabled := Enabled; + if FFlat then DrawBorder(Self); +end; + +procedure TdxPSSpinEdit.CMEnter(var Message: TCMEnter); +begin + if AutoSelect and not (csLButtonDown in ControlState) then + SelectAll; + FSaveValue := Value; + inherited; +end; + +procedure TdxPSSpinEdit.CMExit(var Message: TCMExit); +begin +// if ( CheckValue(Value) <> Value ) then SetValue(Value) +// else + Value := Value; + inherited; +end; + +procedure TdxPSSpinEdit.CMFontChanged(var Message: TMessage); +begin + inherited; + ResizeButtons; + SetEditRect; +end; + +procedure TdxPSSpinEdit.CMMouseEnter(var Message: TMessage); +begin + inherited; + FMouseInControl := True; + if Flat then DrawBorder(Self); +end; + +procedure TdxPSSpinEdit.CMMouseLeave(var Message: TMessage); +begin + inherited; + FMouseInControl := False; + if Flat then DrawBorder(Self); +end; + +{ TdxPSColorCombo } + +constructor TdxPSColorCombo.Create(AOwner: TComponent); +begin + inherited; + Style := csOwnerDrawFixed; + FColorTypes := [ctPure, ctSystem]; + FShowColorName := True; + FShowCustomColor := True; + FAutoColor := clWindowText; +end; + +function TdxPSColorCombo.DefaultAutoColorText: string; +begin + Result := cxGetResourceString(@sdxAutoColorText); +end; + +function TdxPSColorCombo.DefaultCustomColorText: string; +begin + Result := cxGetResourceString(@sdxCustomColorText); +end; + +procedure TdxPSColorCombo.Click; +begin + if ShowCustomColor and (ItemIndex = Items.Count - 1) then SelectCustomColor; + inherited; +end; + +procedure TdxPSColorCombo.CreateWnd; +begin + inherited; + RefreshItems; +end; + +procedure TdxPSColorCombo.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('IsAutoColorTextAssigned', ReadIsAutoColorTextAssigned, WriteIsAutoColorTextAssigned, + FIsAutoColorTextAssigned and (AutoColorText = '')); + Filer.DefineProperty('IsCustomColorTextAssigned', ReadIsCustomColorTextAssigned, WriteIsCustomColorTextAssigned, + FIsCustomColorTextAssigned and (CustomColorText = '')); +end; + +procedure TdxPSColorCombo.DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); +const + ColorWidth = 22; + Format = DT_SINGLELINE or DT_VCENTER or DT_NOPREFIX; + EndEllipsis: array[Boolean] of UINT = (0, DT_END_ELLIPSIS); +var + ColorRect, TxtRect: TRect; + PrevColor: TColor; + PrevMode: Integer; + S: string; +begin + Canvas.FillRect(Rect); + InflateRect(Rect, -2, -2); + ColorRect := Rect; + TxtRect := Rect; + if FShowColorName or ((ShowAutoColor and (Index = 0)) or + (ShowCustomColor and (Index = Items.Count - 1))) then + begin + if BiDiMode = bdRightToLeft then + ColorRect.Left := ColorRect.Right - ColorWidth + else + ColorRect.Right := ColorRect.Left + ColorWidth; + + SubtractRect(TxtRect, Rect, ColorRect); + if BiDiMode = bdRightToLeft then + Dec(TxtRect.Right, 6); + Inc(TxtRect.Left, 6); + end; // else if ( Index = Items.Count - 1 ) then + // SetRectEmpty(AColorRect); + + with Canvas do + begin + Pen.Color := clBtnShadow; + PrevColor := Brush.Color; + if ShowAutoColor and (Index = 0) then + begin + Brush.Color := AutoColor; + Brush.Style := bsSolid; + end + else + if not ShowAutoColor or (TColor(Items.Objects[Index]) <> clNone) then + begin + Brush.Color := TColor(Items.Objects[Index]); + Brush.Style := bsSolid; + end + else + Brush.Style := bsClear; + + if not IsRectEmpty(ColorRect) then + with ColorRect do + Rectangle(Left, Top, Right, Bottom); + Brush.Color := PrevColor; + + PrevMode := SetBkMode(Handle, TRANSPARENT); + if not Enabled then + PrevColor := SetTextColor(Handle, ColorToRGB(clInactiveCaptionText)); + + if FShowColorName or ((ShowAutoColor and (Index = 0)) or + (ShowCustomColor and (Index = Items.Count - 1))) then + begin + S := GetColorName(Index); + DrawText(Canvas.Handle, PChar(S), Length(S), TxtRect, Format or EndEllipsis[Self.EndEllipsis]); + end; + + {$IFNDEF CBUILDER} + {$IFDEF DELPHI5} + if ShowAutoColor and ((Index = 0) or (Index = 1)) and not (odComboBoxEdit in State) then + begin + Pen.Color := clWindowText; + with Rect do + if Index = 0 then + Rectangle(Left, Bottom + 1, Right, Bottom + 2) + else + Rectangle(Left, Top - 2, Right, Top - 1); + end; + {$ENDIF} + {$ENDIF} + + if not Enabled then + SetTextColor(Handle, ColorToRGB(PrevColor)); + SetBkMode(Handle, PrevMode); + end; +end; + +procedure TdxPSColorCombo.KeyDown(var Key: Word; Shift: TShiftState); +begin + if not DroppedDown and ShowCustomColor and (Key = vk_RETURN) and + (ItemIndex = Items.Count - 1) then + Click; + inherited; +end; + +procedure TdxPSColorCombo.SetDropDownCount(const Value: Integer); +begin + {$IFDEF DELPHI6} + inherited; + {$ELSE} + inherited DropDownCount := Value; + {$ENDIF} + FDropDownCountAssigned := True; +end; + +procedure TdxPSColorCombo.RefreshItems; +begin + with Items do + begin + BeginUpdate; + try + Clear; + if ShowAutoColor then + AddObject(AutoColorText, TObject(AutoColor)); + + if ctPure in FColorTypes then + begin + AddObject(cxGetResourceString(@sdxPureColorBlack), TObject(PureColors[0])); + AddObject(cxGetResourceString(@sdxPureColorOlive), TObject(PureColors[1])); + AddObject(cxGetResourceString(@sdxPureColorTeal), TObject(PureColors[2])); + AddObject(cxGetResourceString(@sdxPureColorGreen), TObject(PureColors[3])); + AddObject(cxGetResourceString(@sdxPureColorMoneyGreen), TObject(PureColors[4])); + AddObject(cxGetResourceString(@sdxPureColorLime), TObject(PureColors[5])); + AddObject(cxGetResourceString(@sdxPureColorNavy), TObject(PureColors[6])); + AddObject(cxGetResourceString(@sdxPureColorBlue), TObject(PureColors[7])); + AddObject(cxGetResourceString(@sdxPureColorAqua), TObject(PureColors[8])); + AddObject(cxGetResourceString(@sdxPureColorSkyBlue), TObject(PureColors[9])); + AddObject(cxGetResourceString(@sdxPureColorGray), TObject(PureColors[10])); + AddObject(cxGetResourceString(@sdxPureColorMedGray), TObject(PureColors[11])); + AddObject(cxGetResourceString(@sdxPureColorSilver), TObject(PureColors[12])); + AddObject(cxGetResourceString(@sdxPureColorMaroon), TObject(PureColors[13])); + AddObject(cxGetResourceString(@sdxPureColorPurple), TObject(PureColors[14])); + AddObject(cxGetResourceString(@sdxPureColorFuchsia), TObject(PureColors[15])); + AddObject(cxGetResourceString(@sdxPureColorRed), TObject(PureColors[16])); + AddObject(cxGetResourceString(@sdxPureColorCream), TObject(PureColors[17])); + AddObject(cxGetResourceString(@sdxPureColorYellow), TObject(PureColors[18])); + AddObject(cxGetResourceString(@sdxPureColorWhite), TObject(PureColors[19])); + end; + + if ctSystem in FColorTypes then + begin + AddObject(cxGetResourceString(@sdxSysColorScrollBar), TObject(SysColors[0])); + AddObject(cxGetResourceString(@sdxSysColorBackground), TObject(SysColors[1])); + AddObject(cxGetResourceString(@sdxSysColorActiveCaption), TObject(SysColors[2])); + AddObject(cxGetResourceString(@sdxSysColorInactiveCaption), TObject(SysColors[3])); + AddObject(cxGetResourceString(@sdxSysColorMenu), TObject(SysColors[4])); + AddObject(cxGetResourceString(@sdxSysColorWindow), TObject(SysColors[5])); + AddObject(cxGetResourceString(@sdxSysColorWindowFrame), TObject(SysColors[6])); + AddObject(cxGetResourceString(@sdxSysColorMenuText), TObject(SysColors[7])); + AddObject(cxGetResourceString(@sdxSysColorWindowText), TObject(SysColors[8])); + AddObject(cxGetResourceString(@sdxSysColorCaptionText), TObject(SysColors[9])); + AddObject(cxGetResourceString(@sdxSysColorActiveBorder), TObject(SysColors[10])); + AddObject(cxGetResourceString(@sdxSysColorInactiveBorder), TObject(SysColors[11])); + AddObject(cxGetResourceString(@sdxSysColorAppWorkSpace), TObject(SysColors[12])); + AddObject(cxGetResourceString(@sdxSysColorHighLight), TObject(SysColors[13])); + AddObject(cxGetResourceString(@sdxSysColorHighLighText), TObject(SysColors[14])); + AddObject(cxGetResourceString(@sdxSysColorBtnFace), TObject(SysColors[15])); + AddObject(cxGetResourceString(@sdxSysColorBtnShadow), TObject(SysColors[16])); + AddObject(cxGetResourceString(@sdxSysColorGrayText), TObject(SysColors[17])); + AddObject(cxGetResourceString(@sdxSysColorBtnText), TObject(SysColors[18])); + AddObject(cxGetResourceString(@sdxSysColorInactiveCaptionText), TObject(SysColors[19])); + AddObject(cxGetResourceString(@sdxSysColorBtnHighligh), TObject(SysColors[20])); + AddObject(cxGetResourceString(@sdxSysColor3DDkShadow), TObject(SysColors[21])); + AddObject(cxGetResourceString(@sdxSysColor3DLight), TObject(SysColors[22])); + AddObject(cxGetResourceString(@sdxSysColorInfoText), TObject(SysColors[23])); + AddObject(cxGetResourceString(@sdxSysColorInfoBk), TObject(SysColors[24])); + end; + + if ShowCustomColor then + AddObject(CustomColorText, TObject(clNone)); + + if Items.Count <> 0 then + ItemIndex := 0; + finally + EndUpdate; + end; + end; +end; + +function TdxPSColorCombo.SelectColorProc: TdxSelectColorProc; +begin + Result := nil; + if Assigned(FOnGetSelectColorProc) then + begin + FOnGetSelectColorProc(Self, Result); + if @Result = nil then + Result := StandardSelectColorProc + end + else + Result := StandardSelectColorProc; +end; + +function TdxPSColorCombo.GetColorName(Index: Integer): string; +var + Kind: TdxColorKind; +begin + Result := Items[Index]; + if Assigned(FOnGetColorName) then + begin + if ShowAutoColor and (Index = 0) then + Kind := ckAuto + else + if ShowCustomColor and (Index = Items.Count - 1) then + Kind := ckCustom + else + Kind := ckNormal; + FOnGetColorName(Self, Index, TColor(Items.Objects[Index]), Kind, Result); + end; +end; + +function TdxPSColorCombo.GetActualDropDownCount: Integer; +begin + if UseAllColorValuesInDropDownList and not DropDownCountAssigned then + Result := Items.Count + else + Result := DropDownCount; +end; + +function TdxPSColorCombo.GetAutoColorText: string; +begin + if FIsAutoColorTextAssigned then + Result := FAutoColorText + else + Result := DefaultAutoColorText; +end; + +function TdxPSColorCombo.GetColorTypes: TdxColorTypes; +begin + Result := FColorTypes; +end; + +function TdxPSColorCombo.GetColorValue: TColor; +begin + Result := TColor(Items.Objects[ItemIndex]); +end; + +function TdxPSColorCombo.GetCustomColorText: string; +begin + if FIsCustomColorTextAssigned then + Result := FCustomColorText + else + Result := DefaultCustomColorText +end; + +function TdxPSColorCombo.GetIsAutoColorSelected: Boolean; +begin + Result := ShowAutoColor and (ItemIndex = 0); +end; + +function TdxPSColorCombo.IsAutoColorTextStored: Boolean; +begin + Result := FIsAutoColorTextAssigned and (AutoColorText <> DefaultAutoColorText); +end; + +function TdxPSColorCombo.IsCustomColorTextStored: Boolean; +begin + Result := FIsCustomColorTextAssigned and (CustomColorText <> DefaultCustomColorText); +end; + +procedure TdxPSColorCombo.SetAutoColor(Value: TColor); +begin + if FAutoColor <> Value then + begin + FAutoColor := Value; + if ShowAutoColor and (ItemIndex = 0) then Invalidate; + end; +end; + +procedure TdxPSColorCombo.SetAutoColorText(const Value: string); +begin + if AutoColorText <> Value then + begin + FAutoColorText := Value; + FIsAutoColorTextAssigned := True; + if ShowAutoColor then RecreateWnd;//and (ItemIndex = 0) then Invalidate; + end; +end; + +procedure TdxPSColorCombo.SetColorTypes(Value: TdxColorTypes); +begin + if Value <> FColorTypes then + begin + if Value = [] then Value := [ctPure]; + FColorTypes := Value; + RecreateWnd; + end; +end; + +procedure TdxPSColorCombo.SetColorValue(Value: TColor); +var + Index: Integer; +begin + Index := Items.IndexOfObject(TObject(Value)); + if Index > -1 then + ItemIndex := Index + else + if ShowCustomColor then + begin + Items.Objects[Items.Count - 1] := TObject(Value); + ItemIndex := Items.Count - 1; + Repaint; + end; +end; + +procedure TdxPSColorCombo.SetCustomColorText(const Value: string); +begin + if CustomColorText <> Value then + begin + FCustomColorText := Value; + FIsCustomColorTextAssigned := True; + if ShowCustomColor then RecreateWnd;//and (ItemIndex = 0) then Invalidate; + end; +end; + +procedure TdxPSColorCombo.SetEndEllipsis(Value: Boolean); +begin + if FEndEllipsis <> Value then + begin + FEndEllipsis := Value; + Invalidate; + end; +end; + +procedure TdxPSColorCombo.SetShowAutoColor(Value: Boolean); +begin + if FShowAutoColor <> Value then + begin + FShowAutoColor := Value; + RecreateWnd; + end; +end; + +procedure TdxPSColorCombo.SetShowColorName(Value: Boolean); +begin + if Value <> FShowColorName then + begin + FShowColorName := Value; + Repaint; + end; +end; + +procedure TdxPSColorCombo.SetShowCustomColor(Value: Boolean); +begin + if FShowCustomColor <> Value then + begin + FShowCustomColor := Value; + RecreateWnd; + end; +end; + +function TdxPSColorCombo.FindRGB(AColor: TColor): Integer; + + function IsSysColor(Color: TColor): Boolean; + begin + Result := (Color and $80000000 = $80000000); + end; + +var + C: TColor; +begin + if IsSysColor(AColor) then + AColor := ColorToRGB(GetSysColor(AColor)) + else + AColor := ColorToRGB(AColor); + + for Result := 0 to Items.Count - 1 do + begin + C := TColor(Items.Objects[Result]); + if IsSysColor(C) then + C := GetSysColor(C); + C := ColorToRGB(C); + if AColor = C then Exit; + end; + Result := -1; +end; + +procedure TdxPSColorCombo.ResetItemHeight; +var + H: Integer; +begin + H := -MulDiv(Font.Height, 15, 10); + if H < 10 then H := 10; + ItemHeight := H; +end; + +procedure TdxPSColorCombo.SelectCustomColor; +var + CustomColor: TColor; + Proc: TdxSelectColorProc; + Index: Integer; +begin + CustomColor := TColor(Items.Objects[ItemIndex]); + Proc := SelectColorProc(); + if Assigned(Proc) then + if Proc(CustomColor) then + begin + Index := Items.IndexOfObject(TObject(CustomColor)); + if Index <> ItemIndex then + if Index = -1 then + begin + Items.Objects[ItemIndex] := TObject(CustomColor); + Repaint; + end + else + ItemIndex := Index; + end + else + ColorValue := CustomColor; +end; + +function TdxPSColorCombo.StandardSelectColorProc(var AColor: TColor): Boolean; +begin + dxPSGlbl.ColorDialog.Color := AColor; + Result := dxPSGlbl.ColorDialog.Execute; + if Result then + AColor := dxPSGlbl.ColorDialog.Color; +end; + +procedure TdxPSColorCombo.ReadIsAutoColorTextAssigned(AReader: TReader); +begin + FIsAutoColorTextAssigned := AReader.ReadBoolean; +end; + +procedure TdxPSColorCombo.ReadIsCustomColorTextAssigned(AReader: TReader); +begin + FIsCustomColorTextAssigned := AReader.ReadBoolean; +end; + +procedure TdxPSColorCombo.WriteIsAutoColorTextAssigned(AWriter: TWriter); +begin + AWriter.WriteBoolean(FIsAutoColorTextAssigned); +end; + +procedure TdxPSColorCombo.WriteIsCustomColorTextAssigned(AWriter: TWriter); +begin + AWriter.WriteBoolean(FIsCustomColorTextAssigned); +end; + +procedure TdxPSColorCombo.CMBiDiModeChanged(var Message: TMessage); +begin + inherited; + Invalidate; +end; + +procedure TdxPSColorCombo.CMEnabledChanged(var Message: TMessage); +begin + inherited; + if csDesigning in ComponentState then Invalidate; +end; + +procedure TdxPSColorCombo.CMFontChanged(var Message: TMessage); +begin + inherited; + ResetItemHeight; +end; + +procedure TdxPSColorCombo.CMRecreateWnd(var Message: TMessage); +var + ASaveValue: TColor; + Ind: Integer; +begin + ASaveValue := ColorValue; + inherited; + Ind := FindRGB(ASaveValue); + if Ind > -1 then ItemIndex := Ind; +end; + +procedure TdxPSColorCombo.CNCommand(var Message: TWMCommand); +begin + case message.NotifyCode of + CBN_SELCHANGE: + begin + Text := Items[ItemIndex]; + //if not DroppedDown then Click; + Change; + Exit; + end; + CBN_CLOSEUP: + if FSelEndOk then Click; + CBN_DROPDOWN: + begin + DropDownCount := ActualDropDownCount; + FSelEndOk := True; + end; + CBN_SELENDCANCEL: + FSelEndOk := False; + end; + inherited; +end; + +{ TdxPSBrushStyleCombo } + +constructor TdxPSBrushStyleCombo.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ItemHeight := 22; + Height := 22; + FEndEllipsis := False; + FShowStyleName := False; + FBrushColor := clWindowText; + Style := csOwnerDrawFixed; +end; + +procedure TdxPSBrushStyleCombo.CreateWnd; +begin + inherited CreateWnd; + RefreshItems; + ItemIndex := 0; +end; + +procedure TdxPSBrushStyleCombo.DrawItem(Index: Integer; Rect: TRect; + State: TOwnerDrawState); +const + EndEllipsisMap: array[Boolean] of UINT = (0, DT_END_ELLIPSIS); + Format = DT_SINGLELINE or DT_LEFT or DT_VCENTER; +var + BrushRect, TextRect: TRect; + S: string; +begin + Canvas.FillRect(Rect); + InflateRect(Rect, -2, -2); + BrushRect := Rect; + TextRect := Rect; + if FShowStyleName then + begin + if BiDiMode = bdRightToLeft then + BrushRect.Left := BrushRect.Right - (Rect.Right - Rect.Left) div 2 + else + BrushRect.Right := BrushRect.Left + (Rect.Right - Rect.Left) div 2; + + SubtractRect(TextRect, Rect, BrushRect); + if BiDiMode = bdRightToLeft then + Dec(TextRect.Right, 6); + Inc(TextRect.Left, 6); + end; + + Canvas.Brush.Style := bsSolid; + Canvas.Brush.Color := clBtnShadow; + Canvas.FrameRect(BrushRect); + InflateRect(BrushRect, -1, -1); + + if Index > StyleIndexes[bsClear] then + Canvas.Brush.Style := Styles[Index] + else + Canvas.Brush.Style := bsSolid; + + if Index = StyleIndexes[bsClear] then + Canvas.Brush.Color := clWindow + else + if ColorToRGB(BrushColor) = ColorToRGB(clWindow) then + if Index > StyleIndexes[bsClear] then + Canvas.Brush.Color := clWindowText + else + Canvas.Brush.Color := BrushColor + else + Canvas.Brush.Color := BrushColor; + + SetBkColor(Canvas.Handle, ColorToRGB(clWindow)); + Canvas.FillRect(BrushRect); + + if FShowStyleName then + begin + Canvas.Brush.Style := bsClear; + if not Enabled then + Canvas.Font.Color := clGrayText; + S := StyleNames[Index]; + DrawText(Canvas.Handle, PChar(S), Length(S), TextRect, Format or EndEllipsisMap[EndEllipsis]); + end; + Canvas.Brush.Style := bsSolid; + Canvas.Font.Color := clWindowText; +end; + +function TdxPSBrushStyleCombo.GetStyleName(Index: Integer): string; +begin + Result := Items[Index]; + if Assigned(FOnGetBrushStyleName) then + FOnGetBrushStyleName(Self, Index, Styles[Index], Result); +end; + +function TdxPSBrushStyleCombo.GetStyle(Index: Integer): TBrushStyle; +begin + Result := TBrushStyle(Items.Objects[Index]); +end; + +function TdxPSBrushStyleCombo.GetStyleIndex(Style: TBrushStyle): Integer; +begin + Result := Items.IndexOfObject(TObject(Style)); +end; + +function TdxPSBrushStyleCombo.GetStyleValue: TBrushStyle; +begin + if ItemIndex <> -1 then + Result := Styles[ItemIndex] + else + Result := bsSolid; +end; + +procedure TdxPSBrushStyleCombo.SetBrushColor(Value: TColor); +begin + if FBrushColor <> Value then + begin + FBrushColor := Value; + Invalidate; + end; +end; + +procedure TdxPSBrushStyleCombo.SetEndEllipsis(Value: Boolean); +begin + if FEndEllipsis <> Value then + begin + FEndEllipsis := Value; + Invalidate; + end; +end; + +procedure TdxPSBrushStyleCombo.SetShowStyleName(Value: Boolean); +begin + if FShowStyleName <> Value then + begin + FShowStyleName := Value; + Invalidate; + end; +end; + +procedure TdxPSBrushStyleCombo.SetStyleValue(Value: TBrushStyle); +begin + ItemIndex := StyleIndexes[Value]; +end; + +procedure TdxPSBrushStyleCombo.RefreshItems; +begin + with Items do + begin + BeginUpdate; + try + Clear; + AddObject(cxGetResourceString(@sdxBrushStyleSolid), TObject(bsSolid)); + AddObject(cxGetResourceString(@sdxBrushStyleClear), TObject(bsClear)); + AddObject(cxGetResourceString(@sdxBrushStyleHorizontal), TObject(bsHorizontal)); + AddObject(cxGetResourceString(@sdxBrushStyleVertical), TObject(bsVertical)); + AddObject(cxGetResourceString(@sdxBrushStyleFDiagonal), TObject(bsFDiagonal)); + AddObject(cxGetResourceString(@sdxBrushStyleBDiagonal), TObject(bsBDiagonal)); + AddObject(cxGetResourceString(@sdxBrushStyleCross), TObject(bsCross)); + AddObject(cxGetResourceString(@sdxBrushStyleDiagCross), TObject(bsDiagCross)); + finally + EndUpdate; + end; + end; +end; + +procedure TdxPSBrushStyleCombo.ResetItemHeight; +var + H: Integer; +begin + H := -MulDiv(Font.Height, 12, 10); + if H < 22 then H := 22; + ItemHeight := H; +end; + +procedure TdxPSBrushStyleCombo.CMBiDiModeChanged(var Message: TMessage); +begin + inherited; + Invalidate; +end; + +procedure TdxPSBrushStyleCombo.CMFontChanged(var Message: TMessage); +begin + inherited; + ResetItemHeight; +end; + +procedure TdxPSBrushStyleCombo.CMRecreateWnd(var Message: TMessage); +var + SaveStyle: TBrushStyle; +begin + SaveStyle := BrushStyle; + inherited; + BrushStyle := SaveStyle; +end; + +procedure TdxPSBrushStyleCombo.CMEnabledChanged(var Message: TMessage); +begin + inherited; + if csDesigning in ComponentState then Invalidate; +end; + +{ TdxPSPaintPanel } + +constructor TdxPSPaintPanel.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FEdgeBorders := [ebLeft, ebTop, ebRight, ebBottom]; + FEdgeInner := esRaised; + FEdgeOuter := esSunken; + FDoubleBuffered := True; +end; + +procedure TdxPSPaintPanel.Paint; +begin + DoPaint; +end; + +procedure TdxPSPaintPanel.DoMouseEnter; +begin + if Assigned(FOnMouseEnter) then FOnMouseEnter(Self) +end; + +procedure TdxPSPaintPanel.DoMouseLeave; +begin + if Assigned(FOnMouseLeave) then FOnMouseLeave(Self) +end; + +procedure TdxPSPaintPanel.DoPaint; +begin + if Assigned(FOnPaint) then FOnPaint(Self) +end; + +function TdxPSPaintPanel.GetEdgeBorders: TdxEdgeBorders; +begin + Result := FEdgeBorders; +end; + +procedure TdxPSPaintPanel.SetEdgeBorders(Value: TdxEdgeBorders); +begin + if FEdgeBorders <> Value then + begin + FEdgeBorders := Value; + if (FEdgeOuter <> esNone) and (FEdgeInner <> esNone) then + RecreateWnd; + end; +end; + +procedure TdxPSPaintPanel.SetEdgeInner(Value: TdxEdgeStyle); +begin + if FEdgeInner <> Value then + begin + FEdgeInner := Value; + RecreateWnd; + end; +end; + +procedure TdxPSPaintPanel.SetEdgeOuter(Value: TdxEdgeStyle); +begin + if FEdgeOuter <> Value then + begin + FEdgeOuter := Value; + RecreateWnd; + end; +end; + +procedure TdxPSPaintPanel.WMNCCalcSize(var Message: TWMNCCalcSize); + + function GetEdgeSize: Integer; + begin + if Ctl3D then + Result := Integer(EdgeInner > esNone) + Integer(EdgeOuter > esNone) + else + Result := 1; + end; + + procedure AdjustEdges(var R: TRect; AEdgeSize: Integer); + begin + if ebLeft in FEdgeBorders then Inc(R.Left, AEdgeSize); + if ebTop in FEdgeBorders then Inc(R.Top, AEdgeSize); + if ebRight in FEdgeBorders then Dec(R.Right, AEdgeSize); + if ebBottom in FEdgeBorders then Dec(R.Bottom, AEdgeSize); + end; + +begin + AdjustEdges(Message.CalcSize_Params^.rgrc[0], GetEdgeSize); + inherited; +end; + +procedure TdxPSPaintPanel.WMNCPaint(var Message: TWMNCPaint); +const + InnerStyles: array[TdxEdgeStyle] of Integer = (0, BDR_RAISEDINNER, BDR_SUNKENINNER); + OuterStyles: array[TdxEdgeStyle] of Integer = (0, BDR_RAISEDOUTER, BDR_SUNKENOUTER); + Ctl3DStyles: array[Boolean] of Integer = (BF_MONO, 0); +var + R: TRect; + DC: HDC; + //Details: TThemedElementDetails; +begin + GetWindowRect(Handle, R); + OffsetRect(R, -R.Left, -R.Top); + DC := GetWindowDC(Handle); + try + //Details := ThemeServices.GetElementDetails(trBandNormal); + //ThemeServices.DrawEdge(DC, Details, R, BDR_RAISEDINNER or BDR_RAISEDOUTER, BF_RECT or BF_FLAT); + DrawEdge(DC, R, InnerStyles[FEdgeInner] or OuterStyles[FEdgeOuter], + Byte(FEdgeBorders) or Ctl3DStyles[Ctl3D]); + finally + ReleaseDC(Handle, DC); + end; +end; + +procedure TdxPSPaintPanel.CMCtl3DChanged(var Message: TMessage); +begin + inherited; + if FEdgeBorders <> [] then RecreateWnd; +end; + +procedure TdxPSPaintPanel.CMTextChanged(var Message: TMessage); +begin +end; + +procedure TdxPSPaintPanel.CMMouseEnter(var Message: TMessage); +begin + inherited; + DoMouseEnter; +end; + +procedure TdxPSPaintPanel.CMMouseLeave(var Message: TMessage); +begin + inherited; + DoMouseLeave; +end; + +{ TdxPSBitmapAnimator } + +constructor TdxPSBitmapAnimator.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FAnimationSpeed := 10; + FAnimationStepCount := 10; + + FBitmap := TBitmap.Create; + FBitmap.Height := Height; + FBitmap.Width := Width; + + FState := False; +end; + +destructor TdxPSBitmapAnimator.Destroy; +begin + FBitmap.Free; + inherited Destroy; +end; + +procedure TdxPSBitmapAnimator.Paint; +begin + if State and not Bitmap.Empty then + Canvas.Draw(0, 0, Bitmap) +end; + +procedure TdxPSBitmapAnimator.Resize; +begin + inherited; + Bitmap.Height := Height; + Bitmap.Width := Width; +end; + +procedure TdxPSBitmapAnimator.Animate; +var + dY, V, I: Integer; + T: DWORD; + R: TRect; +begin + dY := Height div AnimationStepCount + Ord((Height mod AnimationStepCount) <> 0); + + T := GetTickCount; + for I := 1 to AnimationStepCount do + begin + while GetTickCount - T < DWORD(FAnimationSpeed) do ; + T := GetTickCount; + + if State then + begin + V := Height - I * dY; + if V < 0 then V := 0; + Canvas.Draw(0, V, Bitmap); + end + else + begin + V := I * dY; + if V >= Height then V := Height; + R := MakeBounds(Left, Top + V - dY, Width, dY); + InvalidateRect(Parent.Handle, @R, True); + UpdateWindow(Parent.Handle); + Canvas.Draw(0, V, Bitmap); + end; + end; + + if Bitmap.Width < Width then + begin + Canvas.Brush.Color := clBtnFace; + Canvas.FillRect(MakeRect(Bitmap.Width, 0, Width, Height)); + end; +end; + +procedure TdxPSBitmapAnimator.StateChanged; +begin + if not Bitmap.Empty then Animate; +end; + +procedure TdxPSBitmapAnimator.SetBitmap(Value: TBitmap); +begin + Bitmap.Assign(Value); + Bitmap.Height := Height; + Bitmap.Width := Width; +end; + +procedure TdxPSBitmapAnimator.SetState(Value: Boolean); +begin + if FState <> Value then + begin + FState := Value; + StateChanged; + end; +end; + +{ TdxPSWarningPane } + +constructor TdxPSWarningPane.Create(AOwner: TComponent); +begin + inherited; + Font.Name := 'Tahoma'; + Font.Color := clInfoText; +end; + +procedure TdxPSWarningPane.SetStateAndHint(NewState: Boolean; const AHint: string); +begin + if State <> NewState then + if not State then + begin + Hint := AHint; + State := True; + end + else + State := False + else + Hint := AHint; +end; + +procedure TdxPSWarningPane.InitializeBitmap; +var + R: TRect; + X, Y: Integer; +begin + with Bitmap do + begin + R := MakeRect(0, 0, Width, Height); + // frame & Interior + Canvas.Pen.Color := clBtnShadow; + Canvas.Brush.Style := bsSolid; + Canvas.Brush.Color := clInfoBk; + Canvas.Rectangle(R.Left, R.Top, R.Right, R.Bottom); + InflateRect(R, -1, -1); + + // warning sign + with R do + begin + X := Left + 2; + Y := Top + (Bottom - Top - WarningSignBitmap.Height) div 2; + end; + Canvas.Draw(X, Y, WarningSignBitmap); + InflateRect(R, -1, -1); + + // text + Inc(R.Left, 2 + WarningSignBitmap.Width + 4); + Canvas.Brush.Style := bsClear; + Canvas.Font := Font; + InitializeBitmapHint(R); + end; +end; + +procedure TdxPSWarningPane.InitializeBitmapHint(var R: TRect); +const + TextFormats: array[Boolean] of UINT = (DT_SINGLELINE or DT_VCENTER, DT_WORDBREAK); +var + IsWordWrap: Boolean; +begin + IsWordWrap := Bitmap.Canvas.TextWidth(Hint) > (R.Right - R.Left); + DrawText(Bitmap.Canvas.Handle, PChar(Hint), Length(Hint), R, TextFormats[IsWordWrap]); +end; + +procedure TdxPSWarningPane.StateChanged; +begin + inherited; + Beep; +end; + +procedure TdxPSWarningPane.SetHint(const Value: string); +begin + if FHint <> Value then + begin + FHint := Value; + InitializeBitmap; + if State then Invalidate; + end; +end; + +{ TdxPSImageScrollBox } + +constructor TdxPSImageScrollBox.Create(AOwner: TComponent); +begin + inherited; + FBuiltInMenuItemsVisibility := [biiPreview..biiSave]; + Font.Style := Font.Style + [fsBold]; + HorzScrollBar.Tracking := True; + VertScrollBar.Tracking := True; + + FBuiltInImages := TImageList.Create(Self); + FBuiltInMenu := TPopupMenu.Create(Self); + FCanvas := TControlCanvas.Create; + FCanvas.Control := Self; + FPicture := TPicture.Create; + FPicture.OnChange := PictureChanged; + FCenter := True; + ParentFont := False; + + CreateBuiltInImages; + CreateBuiltInMenu; + + dxPSPopupMan.dxPSPopupMenuController.RegisterControl(Self); +end; + +destructor TdxPSImageScrollBox.Destroy; +begin + dxPSPopupMan.dxPSPopupMenuController.UnregisterControl(Self); + FreeAndNil(FPicture); + FreeAndNil(FCanvas); + inherited; +end; + +procedure TdxPSImageScrollBox.CreateParams(var Params: TCreateParams); +begin + inherited; + Params.WindowClass.Style := Params.WindowClass.Style + (CS_HREDRAW or CS_VREDRAW); +end; + +procedure TdxPSImageScrollBox.DblClick; +begin + inherited; + //if (biiPreview in FBuiltInMenuItemsVisibility) and HasGraphic then + // dxPCPrVw.dxShowPicturePreview(Picture.Graphic); +end; + +function TdxPSImageScrollBox.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; +type + TScrollDirection = (sdLeft, sdTop, sdRight, sdBottom); + + function GetScrollDirection: TScrollDirection; + const + ScrollDirectionHorzMap: array[Boolean] of TScrollDirection = (sdRight, sdLeft); + ScrollDirectionVertMap: array[Boolean] of TScrollDirection = (sdBottom, sdTop); + begin + if HasScrollVertBar then + Result := ScrollDirectionVertMap[WheelDelta > 0] + else + if HasScrollHorzBar then + Result := ScrollDirectionHorzMap[WheelDelta > 0] + else + Result := sdTop; + end; + +const + MsgMap: array[TScrollDirection] of Cardinal = (WM_HSCROLL, WM_VSCROLL, WM_HSCROLL, WM_VSCROLL); + ScrollCodeMap: array[TScrollDirection] of Smallint = (SB_LINELEFT, SB_LINEUP, SB_LINERIGHT, SB_LINEDOWN); + ScrollBarMap: array[TScrollDirection] of Integer = (SB_HORZ, SB_VERT, SB_HORZ, SB_VERT); +var + ScrollDirection: TScrollDirection; + Message: TWMScroll; +begin + Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos); + if not Result and HasScrollBars then + begin + ScrollDirection := GetScrollDirection; + FillChar(Message, SizeOf(TMessage), 0); + with Message do + begin + Msg := MsgMap[ScrollDirection]; + ScrollCode := ScrollCodeMap[ScrollDirection]; + Pos := GetScrollPos(Handle, ScrollBarMap[ScrollDirection]) + WheelDelta; + end; + Dispatch(Message); + end; +end; + +procedure TdxPSImageScrollBox.CreateBuiltInImages; + + procedure LoadImage(B: TBitmap; const AResName: string); + begin + Bitmap_LoadFromResourceName(B, AResName); + BuiltInImages.AddMasked(B, B.Canvas.Pixels[0, B.Height - 1]); + end; + +var + B: TBitmap; +begin + BuiltInImages.AllocBy := 3; + + B := TBitmap.Create; + try + LoadImage(B, IDB_DXPSPREVIEW); + LoadImage(B, IDB_DXPSCOPY); + LoadImage(B, IDB_DXPSSAVE); + finally + B.Free; + end; +end; + +procedure TdxPSImageScrollBox.CreateBuiltInMenu; + + function CreateMenuItem(const ACaption: string; AnImageIndex: Integer; AShortCut: TShortCut; + AnOnClick: TNotifyEvent): TMenuItem; + begin + Result := TMenuItem.Create(Self); + with Result do + begin + Caption := ACaption; + ImageIndex := AnImageIndex; + ShortCut := AShortCut; + + OnClick := AnOnClick; + end; + BuiltInMenu.Items.Add(Result); + end; + +begin + miPreview := CreateMenuItem(dxPSUtl.AddEndEllipsis(cxGetResourceString(@sdxPreview)), 0, 0, PreviewClick); + miLine1 := CreateMenuItem('-', -1, 0, nil); + miCopy := CreateMenuItem(cxGetResourceString(@sdxCopy), 1, Menus.TextToShortCut('Ctrl+C'), CopyClick); + miLine2 := CreateMenuItem('-', -1, 0, nil); + miSave := CreateMenuItem(cxGetResourceString(@sdxSave), 2, Menus.TextToShortCut('Ctrl+S'), SaveClick); + + BuiltInMenu.Images := BuiltInImages; + BuiltInMenu.OnPopup := BuiltInMenuPopup; + + PopupMenu := BuiltInMenu; +end; + +procedure TdxPSImageScrollBox.DrawHint; +const + TextFormat: UINT = DT_CENTER or DT_VCENTER or DT_WORDBREAK; +var + DC: HDC; + F: HFONT; + R: TRect; +begin + DC := Canvas.Handle; + + FillRect(DC, ClientRect, GetSysColorBrush(COLOR_BTNFACE)); + + F := SelectObject(DC, Font.Handle); + + R := HintTextRect; + SetBkMode(DC, Windows.TRANSPARENT); + DrawText(DC, PChar(HintText), Length(HintText), R, TextFormat); + SetBkMode(DC, Windows.OPAQUE); + + SelectObject(DC, F); +end; + +procedure TdxPSImageScrollBox.DrawPicture; +begin + Canvas.Draw(PictureOriginX, PictureOriginY, Picture.Graphic); +end; + +procedure TdxPSImageScrollBox.DrawPictureRestSpace; + + procedure DrawRestSpaceRect(const R: TRect); + begin + {$IFDEF DELPHI7} + with Themes.ThemeServices do + if ThemesEnabled then + DrawParentBackground(Handle, Canvas.Handle, nil, False) + else + {$ENDIF} + Canvas.FillRect(R); + end; + +begin + Canvas.Brush.Color := Color; + if HasPictureRestRectLeft then DrawRestSpaceRect(PictureRestRectLeft); + if HasPictureRestRectTop then DrawRestSpaceRect(PictureRestRectTop); + if HasPictureRestRectRight then DrawRestSpaceRect(PictureRestRectRight); + if HasPictureRestRectBottom then DrawRestSpaceRect(PictureRestRectBottom); +end; + +procedure TdxPSImageScrollBox.Paint; +begin + FIsGraphicInvalid := False; + try + if HasGraphic then + begin + DrawPictureRestSpace; + DrawPicture; + end + else + DrawHint; + except + FIsGraphicInvalid := True; + DrawHint; + end; +end; + +function TdxPSImageScrollBox.GetCanvas: TCanvas; +begin + Result := FCanvas; +end; + +function TdxPSImageScrollBox.GetHasGraphic: Boolean; +begin + Result := (Picture.Graphic <> nil) and not Picture.Graphic.Empty; +end; + +function TdxPSImageScrollBox.GetHasPictureRestRectBottom: Boolean; +begin + Result := RectVisible(Canvas.Handle, PictureRestRectBottom); +end; + +function TdxPSImageScrollBox.GetHasPictureRestRectLeft: Boolean; +begin + Result := RectVisible(Canvas.Handle, PictureRestRectLeft); +end; + +function TdxPSImageScrollBox.GetHasPictureRestRectRight: Boolean; +begin + Result := RectVisible(Canvas.Handle, PictureRestRectRight); +end; + +function TdxPSImageScrollBox.GetHasPictureRestRectTop: Boolean; +begin + Result := RectVisible(Canvas.Handle, PictureRestRectTop); +end; + +function TdxPSImageScrollBox.GetHasScrollBars: Boolean; +begin + Result := HasScrollHorzBar or HasScrollVertBar; +end; + +function TdxPSImageScrollBox.GetHasScrollHorzBar: Boolean; +begin + Result := HandleAllocated and (GetWindowLong(Handle, GWL_STYLE) and WS_HSCROLL <> 0); +end; + +function TdxPSImageScrollBox.GetHasScrollVertBar: Boolean; +begin + Result := HandleAllocated and (GetWindowLong(Handle, GWL_STYLE) and WS_VSCROLL <> 0); +end; + +function TdxPSImageScrollBox.GetHintTextRect: TRect; +const + TextFormat: UINT = DT_CALCRECT or DT_WORDBREAK; +var + X, Y: Integer; +begin + Result := ClientRect; + DrawText(Canvas.Handle, PChar(HintText), Length(HintText), Result, TextFormat); + + X := (ClientWidth - (Result.Right - Result.Left)) div 2; + Y := (ClientHeight - (Result.Bottom - Result.Top)) div 2; + OffsetRect(Result, X, Y); +end; + +function TdxPSImageScrollBox.GetIsPictureHeightExceedControlBounds: Boolean; +begin + Result := Picture.Graphic.Height > ClientHeight; +end; + +function TdxPSImageScrollBox.GetIsPictureWidthExceedControlBounds: Boolean; +begin + Result := Picture.Graphic.Width > ClientWidth; +end; + +function TdxPSImageScrollBox.GetPictureOriginX: Integer; +begin + if IsPictureWidthExceedControlBounds then + Result := -HorzScrollBar.Position + else + if Center then + Result := (ClientWidth - Picture.Graphic.Width) div 2 + else + Result := 0; +end; + +function TdxPSImageScrollBox.GetPictureOriginY: Integer; +begin + if IsPictureHeightExceedControlBounds then + Result := -VertScrollBar.Position + else + if Center then + Result := (ClientHeight - Picture.Graphic.Height) div 2 + else + Result := 0; +end; + +function TdxPSImageScrollBox.GetPictureHeight: Integer; +begin + with PictureRect do + Result := Bottom - Top; +end; + +function TdxPSImageScrollBox.GetPictureRect: TRect; +begin + if HasGraphic then + Result := MakeBounds(PictureOriginX, PictureOriginY, Picture.Graphic.Width, Picture.Graphic.Height) + else + Result := NullRect; +end; + +function TdxPSImageScrollBox.GetPictureWidth: Integer; +begin + with PictureRect do + Result := Right - Left; +end; + +function TdxPSImageScrollBox.GetPictureRestRectBottom: TRect; +begin + with Result do + begin + Left := PictureRestRectLeft.Right; + Top := PictureRect.Bottom; + Right := Left + PictureWidth; + Bottom := ClientHeight; + end; +end; + +function TdxPSImageScrollBox.GetPictureRestRectLeft: TRect; +begin + Result := MakeBounds(0, 0, PictureOriginX, ClientHeight); +end; + +function TdxPSImageScrollBox.GetPictureRestRectRight: TRect; +begin + Result := MakeRect(PictureOriginX + Picture.Graphic.Width - 1, 0, ClientWidth, ClientHeight); +end; + +function TdxPSImageScrollBox.GetPictureRestRectTop: TRect; +begin + with Result do + begin + Left := PictureRestRectLeft.Right; + Top := 0; + Right := Left + PictureWidth; + Bottom := PictureOriginY; + end; +end; + +procedure TdxPSImageScrollBox.SetCenter(Value: Boolean); +begin + if FCenter <> Value then + begin + FCenter := Value; + if HasGraphic then Invalidate; + end; +end; + +procedure TdxPSImageScrollBox.SetHintText(const Value: string); +begin + if FHintText <> Value then + begin + FHintText := Value; + if not HasGraphic then Invalidate; + end; +end; + +procedure TdxPSImageScrollBox.SetPicture(Value: TPicture); +begin + Picture.Assign(Value); +end; + +procedure TdxPSImageScrollBox.BuiltInMenuPopup(Sender: TObject); +begin + miPreview.Visible := biiPreview in FBuiltInMenuItemsVisibility; + miPreview.Enabled := HasGraphic; + miLine1.Visible := miPreview.Visible; + miCopy.Visible := biiCopy in FBuiltInMenuItemsVisibility; + miCopy.Enabled := HasGraphic; + miLine2.Visible := miCopy.Visible; + miSave.Visible := biiSave in FBuiltInMenuItemsVisibility; + miSave.Enabled := HasGraphic; +end; + +procedure TdxPSImageScrollBox.CopyClick(Sender: TObject); +begin + if HasGraphic then Clipboard.Assign(Picture.Graphic); +end; + +procedure TdxPSImageScrollBox.SaveClick(Sender: TObject); +var + GraphicClass: TGraphicClass; +begin + if HasGraphic then + begin + GraphicClass := TGraphicClass(Picture.Graphic.ClassType); + with TSavePictureDialog.Create(nil) do + try + DefaultExt := GraphicExtension(GraphicClass); + Filter := GraphicFilter(GraphicClass); + Options := Options + [ofOverwritePrompt]; + if Execute then + Picture.SaveToFile(FileName); + finally + Free; + end; + end; +end; + +procedure TdxPSImageScrollBox.PictureChanged(Sender: TObject); +begin + HorzScrollBar.Range := Picture.Width; + VertScrollBar.Range := Picture.Height; + Invalidate; +end; + +procedure TdxPSImageScrollBox.PreviewClick(Sender: TObject); +begin + if HasGraphic then dxPCPrVw.dxShowPicturePreview(Picture.Graphic); +end; + +procedure TdxPSImageScrollBox.WMEraseBkgnd(var Message: TWMEraseBkgnd); +begin + message.Result := 1; +end; + +procedure TdxPSImageScrollBox.WMMouseActivate(var Message: TWMMouseActivate); +begin + inherited; + if not (csDesigning in ComponentState) and CanFocus then + SetFocus; +end; + +procedure TdxPSImageScrollBox.WMNCPaint(var Message: TWMNCPaint); +begin + inherited; + {$IFDEF DELPHI7} + with Themes.ThemeServices do + if ThemesEnabled then + PaintBorder(Self, True); + {$ENDIF} +end; + +procedure TdxPSImageScrollBox.WMPaint(var Message: TWMPaint); +var + PaintStruct: TPaintStruct; +begin + Canvas.Lock; + try + Canvas.Handle := BeginPaint(Handle, PaintStruct); + try + Paint; + finally + Canvas.Handle := 0; + EndPaint(Handle, PaintStruct); + end; + finally + Canvas.Unlock; + end; +end; + +initialization + +finalization + FreeAndNil(FWarningSignBitmap); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxExtCtrlsStrs.pas b/official/x.35/ExpressPrinting System/Sources/dxExtCtrlsStrs.pas new file mode 100644 index 00000000..285a7c7e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxExtCtrlsStrs.pas @@ -0,0 +1,106 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxExtCtrlsStrs; + +interface + +{$I cxVer.inc} + +resourcestring + sdxAutoColorText = 'Auto'; + sdxCustomColorText = 'Custom...'; + + sdxSysColorScrollBar = 'ScrollBar'; + sdxSysColorBackground = 'Background'; + sdxSysColorActiveCaption = 'Active Caption'; + sdxSysColorInactiveCaption = 'Inactive Caption'; + sdxSysColorMenu = 'Menu'; + sdxSysColorWindow = 'Window'; + sdxSysColorWindowFrame = 'Window Frame'; + sdxSysColorMenuText = 'Menu Text'; + sdxSysColorWindowText = 'Window Text'; + sdxSysColorCaptionText = 'Caption Text'; + sdxSysColorActiveBorder = 'Active Border'; + sdxSysColorInactiveBorder = 'Inactive Border'; + sdxSysColorAppWorkSpace = 'App Workspace'; + sdxSysColorHighLight = 'Highlight'; + sdxSysColorHighLighText = 'Highlight Text'; + sdxSysColorBtnFace = 'Button Face'; + sdxSysColorBtnShadow = 'Button Shadow'; + sdxSysColorGrayText = 'Gray Text'; + sdxSysColorBtnText = 'Button Text'; + sdxSysColorInactiveCaptionText = 'Inactive Caption Text'; + sdxSysColorBtnHighligh = 'Button Highlight'; + sdxSysColor3DDkShadow = '3DDk Shadow'; + sdxSysColor3DLight = '3DLight'; + sdxSysColorInfoText = 'Info Text'; + sdxSysColorInfoBk = 'InfoBk'; + + sdxPureColorBlack = 'Black'; + sdxPureColorRed = 'Red'; + sdxPureColorLime = 'Lime'; + sdxPureColorYellow = 'Yellow'; + sdxPureColorGreen = 'Green'; + sdxPureColorTeal = 'Teal'; + sdxPureColorAqua = 'Aqua'; + sdxPureColorBlue = 'Blue'; + sdxPureColorWhite = 'White'; + sdxPureColorOlive = 'Olive'; + sdxPureColorMoneyGreen = 'Money Green'; + sdxPureColorNavy = 'Navy'; + sdxPureColorSkyBlue = 'Sky Blue'; + sdxPureColorGray = 'Gray'; + sdxPureColorMedGray = 'Medium Gray'; + sdxPureColorSilver = 'Silver'; + sdxPureColorMaroon = 'Maroon'; + sdxPureColorPurple = 'Purple'; + sdxPureColorFuchsia = 'Fuchsia'; + sdxPureColorCream = 'Cream'; + + sdxBrushStyleSolid = 'Solid'; + sdxBrushStyleClear = 'Clear'; + sdxBrushStyleHorizontal = 'Horizontal'; + sdxBrushStyleVertical = 'Vertical'; + sdxBrushStyleFDiagonal = 'FDiagonal'; + sdxBrushStyleBDiagonal = 'BDiagonal'; + sdxBrushStyleCross = 'Cross'; + sdxBrushStyleDiagCross = 'DiagCross'; + +implementation + +end. + + diff --git a/official/x.35/ExpressPrinting System/Sources/dxFEFDlg.dfm b/official/x.35/ExpressPrinting System/Sources/dxFEFDlg.dfm new file mode 100644 index 00000000..3664f1bc --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxFEFDlg.dfm @@ -0,0 +1,749 @@ +object dxFEFDialog: TdxFEFDialog + Left = 446 + Top = 168 + ActiveControl = dgTexture + BorderStyle = bsDialog + Caption = 'Fill Effects' + ClientHeight = 301 + ClientWidth = 392 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + ShowHint = True + PixelsPerInch = 96 + TextHeight = 13 + object lblSample: TLabel + Left = 307 + Top = 214 + Width = 44 + Height = 13 + Caption = 'Sample : ' + end + object PageControl1: TPageControl + Left = 4 + Top = 5 + Width = 297 + Height = 292 + ActivePage = tshTexture + TabOrder = 0 + OnChange = PageControl1Change + object tshTexture: TTabSheet + Caption = '&Texture' + object dgTexture: TDrawGrid + Left = 4 + Top = 4 + Width = 280 + Height = 198 + BorderStyle = bsNone + ColCount = 4 + Ctl3D = True + DefaultColWidth = 65 + DefaultRowHeight = 65 + DefaultDrawing = False + FixedCols = 0 + RowCount = 6 + FixedRows = 0 + Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goThumbTracking] + ParentCtl3D = False + ScrollBars = ssVertical + TabOrder = 0 + OnClick = dgTextureClick + OnDblClick = dgTextureDblClick + OnDrawCell = dgTextureDrawCell + OnMouseMove = dgTextureMouseMove + end + object pnlTextureName: TPanel + Left = 4 + Top = 205 + Width = 280 + Height = 24 + BevelOuter = bvLowered + TabOrder = 1 + end + object btnOtherTexture: TButton + Left = 150 + Top = 237 + Width = 134 + Height = 23 + Caption = '&Other Texture ...' + TabOrder = 2 + OnClick = btnOtherTextureClick + end + end + object tshPattern: TTabSheet + Caption = '&Pattern' + object lblForeground: TLabel + Left = 5 + Top = 191 + Width = 66 + Height = 13 + Caption = '&Foreground : ' + OnClick = lblForegroundClick + end + object lblBackground: TLabel + Left = 160 + Top = 191 + Width = 66 + Height = 13 + Caption = '&Background : ' + OnClick = lblForegroundClick + end + object bvlForeColorHolder: TBevel + Left = 4 + Top = 208 + Width = 124 + Height = 21 + Visible = False + end + object bvlBackColorHolder: TBevel + Left = 160 + Top = 208 + Width = 125 + Height = 21 + Visible = False + end + object dgPattern: TDrawGrid + Left = 4 + Top = 4 + Width = 280 + Height = 156 + BorderStyle = bsNone + ColCount = 8 + DefaultColWidth = 34 + DefaultRowHeight = 25 + DefaultDrawing = False + FixedCols = 0 + RowCount = 6 + FixedRows = 0 + Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine] + ParentShowHint = False + ScrollBars = ssNone + ShowHint = True + TabOrder = 0 + OnClick = dgPatternClick + OnDblClick = dgPatternDblClick + OnDrawCell = dgPatternDrawCell + OnMouseMove = dgPatternMouseMove + end + object pnlPatternName: TPanel + Left = 4 + Top = 163 + Width = 281 + Height = 23 + BevelOuter = bvLowered + TabOrder = 1 + end + object btnInvert: TButton + Left = 4 + Top = 237 + Width = 281 + Height = 23 + Caption = 'I&nvert colors' + TabOrder = 2 + OnClick = btnInvertClick + end + end + object tshPicture: TTabSheet + Caption = 'P&icture' + object lblPaintMode: TLabel + Left = 7 + Top = 210 + Width = 53 + Height = 13 + Caption = 'Paint &mode' + FocusControl = cbxPaintMode + OnClick = lblPaintModeClick + end + object Bevel4: TBevel + Left = 64 + Top = 216 + Width = 217 + Height = 3 + Shape = bsBottomLine + end + object sbxPicture: TScrollBox + Left = 4 + Top = 4 + Width = 279 + Height = 145 + HorzScrollBar.Tracking = True + VertScrollBar.Tracking = True + PopupMenu = pmPicture + TabOrder = 0 + TabStop = True + object pnlPicture: TPanel + Left = 0 + Top = 0 + Width = 273 + Height = 138 + BevelOuter = bvNone + TabOrder = 0 + object pbxPicture: TPaintBox + Left = 0 + Top = 0 + Width = 273 + Height = 138 + Align = alClient + OnPaint = pbxPicturePaint + end + object pnlNoPicture: TPanel + Left = 48 + Top = 58 + Width = 185 + Height = 25 + BevelOuter = bvNone + Caption = 'There is no Picture to display' + TabOrder = 0 + end + end + end + object pnlPictureName: TPanel + Left = 4 + Top = 152 + Width = 279 + Height = 24 + BevelOuter = bvLowered + TabOrder = 1 + end + object btnSelectPicture: TButton + Left = 146 + Top = 181 + Width = 137 + Height = 23 + Caption = 'Se&lect Picture ...' + TabOrder = 3 + OnClick = SelectPictureClick + end + object cbxPaintMode: TComboBox + Left = 6 + Top = 228 + Width = 129 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 4 + OnChange = cbxPaintModeChange + Items.Strings = ( + 'Center' + 'Stretch' + 'Tile' + 'Proportional') + end + object btnPreview: TButton + Left = 4 + Top = 181 + Width = 137 + Height = 23 + Caption = 'Pre&view ...' + TabOrder = 2 + OnClick = PicturePreviewClick + end + end + end + object pnlPreview: TPanel + Left = 316 + Top = 229 + Width = 65 + Height = 65 + BevelOuter = bvNone + BorderStyle = bsSingle + TabOrder = 5 + object pbxPreview: TPaintBox + Left = 0 + Top = 0 + Width = 61 + Height = 61 + Align = alClient + OnPaint = pbxPreviewPaint + end + end + object btnHelp: TButton + Left = 308 + Top = 112 + Width = 80 + Height = 23 + Caption = '&Help' + TabOrder = 4 + end + object btnApply: TButton + Left = 308 + Top = 83 + Width = 80 + Height = 23 + Caption = '&Apply' + TabOrder = 3 + OnClick = btnApplyClick + end + object btnCancel: TButton + Left = 308 + Top = 54 + Width = 80 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object btnOK: TButton + Left = 308 + Top = 25 + Width = 80 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object pmPicture: TPopupMenu + OnPopup = pmPicturePopup + Left = 340 + Top = 146 + object miPreview: TMenuItem + Caption = 'Pre&view...' + OnClick = PicturePreviewClick + end + object N3: TMenuItem + Caption = '-' + end + object miLoad: TMenuItem + Caption = '&Load...' + ShortCut = 45 + OnClick = SelectPictureClick + end + object miDelete: TMenuItem + Caption = '&Delete' + ShortCut = 46 + OnClick = miDeleteClick + end + object N2: TMenuItem + Caption = '-' + end + object miCut: TMenuItem + Caption = 'Cu&t' + ShortCut = 16472 + OnClick = miCutClick + end + object miCopy: TMenuItem + Caption = '&Copy' + ShortCut = 16451 + OnClick = miCopyClick + end + object miPaste: TMenuItem + Caption = '&Paste' + ShortCut = 16470 + OnClick = miPasteClick + end + end + object ilMenu: TImageList + Left = 312 + Top = 146 + Bitmap = { + 494C010106000A00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000840000008400000084000000840000008400 + 0000840000008400000084000000840000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00840000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400008484008484 + 8400008484008484840084000000FFFFFF008400000084000000840000008400 + 00008400000084000000FFFFFF00840000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000848400848484000084 + 8400848484000084840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00840000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400008484008484 + 8400008484008484840084000000FFFFFF00840000008400000084000000FFFF + FF00840000008400000084000000840000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000848400848484000084 + 8400848484000084840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0084000000FFFFFF0084000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400008484008484 + 8400008484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000848400848484000084 + 8400848484000084840084000000840000008400000084000000840000008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400008484008484 + 8400008484008484840000848400848484000084840084848400008484008484 + 8400008484000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000848400848484000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400848484000000 + 0000C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600000000008484 + 8400008484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000848400848484000084 + 84000000000000FFFF00000000000000000000FFFF0000000000848484000084 + 8400848484000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000FFFF0000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000008400 + 0000000000000000000084000000000000000000000084000000840000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000840000008400000084000000840000008400 + 0000840000008400000084000000000000000000000000000000008484000084 + 8400008484000084840000848400008484000084840000848400008484000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FF000000FF000000FF000000FF000000FF000000FFFF + FF00000000000000000000000000000000000000000000000000000000008400 + 0000000000000000000084000000000000008400000000000000000000008400 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000FFFF00000000000084 + 8400008484000084840000848400008484000084840000848400008484000084 + 8400000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000008400 + 0000000000000000000084000000000000008400000000000000000000008400 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF000000000000000000000000000000 + 000000000000FFFFFF00840000000000000000000000FFFFFF0000FFFF000000 + 0000008484000084840000848400008484000084840000848400008484000084 + 8400008484000000000000000000000000008484840084848400848484000000 + 000000000000FF000000FF000000FF000000FF000000FF000000FF000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000840000008400000084000000000000008400000000000000000000008400 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000FFFF00FFFFFF0000FF + FF00000000000084840000848400008484000084840000848400008484000084 + 84000084840000848400000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000000000008400000084000000840000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF000000000000000000000000000000 + 000000000000FFFFFF00840000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00840000008400 + 000000000000FF000000FF000000FF000000FF000000FF000000FF000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000000000008400000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF000000000000000000FFFFFF008400 + 00008400000084000000840000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000 + 00000000000000000000000000000000000000000000FFFFFF00840000008400 + 00008400000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 0000FFFFFF008400000000000000000000000000000000FFFF00FFFFFF0000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000084848400848484008484840084848400848484008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00840000008400 + 000084000000840000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000FFFFFF000000000084000000840000008400000084000000840000008400 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00C6C6C6000000000000000000000000000000 + 0000FFFFFF00FFFFFF0084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00840000008400 + 00008400000084000000FFFFFF00C6C6C600FFFFFF0084000000840000008400 + 0000840000008400000084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00C6C6C600FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFF00000000FC00FFFF00000000 + 8000FFF9000000000000E7FF000000000000C3F3000000000000C3E700000000 + 0001E1C7000000000003F08F000000000003F81F000000000003FC3F00000000 + 0003F81F000000000003F09F000000000003C1C700000000800783E300000000 + F87F8FF100000000FFFFFFFF00000000FFFFFFFEFFFFFFFFFFFFFF0CF3FFFFFF + 001FFC00ED9FFC01000FF805ED6FFC010007F805ED6FFC0100030006F16F0001 + 00010006FD1F000100000006FC7F0001001F0006FEFF0001001F0005FC7F0003 + 001F0005FD7F00078FF10001F93F000FFFF90001FBBF00FFFF750001FBBF01FF + FF8F0001FBBF03FFFFFF0001FFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxFEFDlg.pas b/official/x.35/ExpressPrinting System/Sources/dxFEFDlg.pas new file mode 100644 index 00000000..137a993e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxFEFDlg.pas @@ -0,0 +1,1597 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxFEFDlg; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, ExtDlgs, Registry, + StdCtrls, ExtCtrls, ComCtrls, Grids, Forms, Menus, Consts, ImgList, dxPSForm, + dxBkgnd; + +type + TdxFillAs = (faNone, faTexture, faPattern, faPicture); + + TdxFEFDialog = class(TCustomdxPSForm) + PageControl1: TPageControl; + tshTexture: TTabSheet; + tshPattern: TTabSheet; + tshPicture: TTabSheet; + dgTexture: TDrawGrid; + pnlTextureName: TPanel; + lblForeground: TLabel; + lblBackground: TLabel; + dgPattern: TDrawGrid; + pnlPatternName: TPanel; + btnOtherTexture: TButton; + sbxPicture: TScrollBox; + pnlPictureName: TPanel; + btnSelectPicture: TButton; + cbxPaintMode: TComboBox; + lblPaintMode: TLabel; + Bevel4: TBevel; + pnlPicture: TPanel; + pbxPicture: TPaintBox; + btnPreview: TButton; + btnInvert: TButton; + bvlForeColorHolder: TBevel; + bvlBackColorHolder: TBevel; + pnlPreview: TPanel; + pbxPreview: TPaintBox; + lblSample: TLabel; + btnHelp: TButton; + btnApply: TButton; + btnCancel: TButton; + btnOK: TButton; + pmPicture: TPopupMenu; + miCut: TMenuItem; + miCopy: TMenuItem; + miPaste: TMenuItem; + miDelete: TMenuItem; + miPreview: TMenuItem; + miLoad: TMenuItem; + ilMenu: TImageList; + N2: TMenuItem; + N3: TMenuItem; + pnlNoPicture: TPanel; + procedure dgTextureDrawCell(Sender: TObject; Col, Row: Integer; + Rect: TRect; State: TGridDrawState); + procedure dgPatternDrawCell(Sender: TObject; Col, Row: Integer; + Rect: TRect; State: TGridDrawState); + procedure SelectPictureClick(Sender: TObject); + procedure btnOtherTextureClick(Sender: TObject); + procedure dgTextureClick(Sender: TObject); + procedure dgPatternClick(Sender: TObject); + procedure pbxPreviewPaint(Sender: TObject); + procedure pbxPicturePaint(Sender: TObject); + procedure cbxColorChange(Sender: TObject); + procedure PageControl1Change(Sender: TObject); + procedure PicturePreviewClick(Sender: TObject); + procedure cbxPaintModeChange(Sender: TObject); + procedure lblPaintModeClick(Sender: TObject); + procedure lblForegroundClick(Sender: TObject); + procedure btnApplyClick(Sender: TObject); + procedure dgTextureDblClick(Sender: TObject); + procedure dgPatternDblClick(Sender: TObject); + procedure dgTextureMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure dgPatternMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure btnInvertClick(Sender: TObject); + procedure pmPicturePopup(Sender: TObject); + procedure miCopyClick(Sender: TObject); + procedure miPasteClick(Sender: TObject); + procedure miDeleteClick(Sender: TObject); + procedure miCutClick(Sender: TObject); + private + cbxBackColor: TCustomComboBox; + cbxForeColor: TCustomComboBox; + FActivePage: Integer; + FApplied: Boolean; + FBackground: TdxBackground; + FbmpPattern: TBitmap; + FbmpCurrentPattern: TBitmap; + FbmpTexture: TBitmap; + FControlsUpdating: Boolean; + FFirstApplied: Boolean; + FInitialDir: string; + FModified: Boolean; + FOriginalBackground: TdxBackground; + FOtherPicture: TGraphic; + FOtherPictureName: string; + FOtherTexture: TBitmap; + FOtherTextureName: string; + FPatternNames: TStringList; + FPatternWasSelected: Boolean; + FPicture: TGraphic; + FPictureExists: Boolean; + FPreviewWhat: TdxFillAs; + FTextureWasSelected: Boolean; + FTextureNames: TStringList; + FOnApply: TNotifyEvent; + + function GetBackColor: TColor; + function GetForeColor: TColor; + function GetOtherPicture(AGraphicClass: TGraphicClass): TGraphic; + function GetOtherTexture: TBitmap; + function GetPaintMode: TdxPicturePaintMode; + function GetPicture: TGraphic; + function GetSelectWhat: TdxFillAs; + procedure SetBackColor(Value: TColor); + procedure SetBackground(Value: TdxBackground); + procedure SetForeColor(Value: TColor); + procedure SetOtherTexture(Value: TBitmap); + procedure SetPaintMode(Value: TdxPicturePaintMode); + procedure SetPicture(Value: TGraphic); + procedure SetSelectWhat(Value: TdxFillAs); + + procedure AssignPicture(AImage: TGraphic); + procedure CheckModified; + function CopyPattern(I, J: Integer): TBitmap; + function CopyTexture(I, J: Integer): TBitmap; + procedure CreateControls; + procedure DrawSelectedFrame(ADrawGrid: TDrawGrid; Rect: TRect); + procedure DoApply; + procedure DoInvertColors; + procedure FreeAndNilResources; + function InternalLoadImage(var AImage: TGraphic; const AFileName: string): Boolean; + procedure LoadImage(var AImage: TGraphic; AWhat: Integer); + procedure LoadResources; + procedure MapPatternColors; + procedure PaintPicture; + procedure PaintPreview; + procedure StartSetting; + procedure SetupDialog; + procedure UpdateControlsState; + + procedure CMDialogChar(var Msg: TCMDialogChar); message CM_DIALOGCHAR; + procedure WMCancelMode(var Msg: TWMCancelMode); message WM_CANCELMODE; + + property BackColor: TColor read GetBackColor write SetBackColor; + property ForeColor: TColor read GetForeColor write SetForeColor; + property OtherTexture: TBitmap read GetOtherTexture write SetOtherTexture; + property PaintMode: TdxPicturePaintMode read GetPaintMode write SetPaintMode; + property Picture: TGraphic read GetPicture write SetPicture; + property SelectWhat: TdxFillAs read GetSelectWhat write SetSelectWhat; + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure Loaded; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function Execute: Boolean; + + procedure LoadFromRegistry(const APath: string); override; + procedure SaveToRegistry(const APath: string); override; + + property Background: TdxBackground read FBackground write SetBackground; + property OnApply: TNotifyEvent read FOnApply write FOnApply; + end; + +function dxFEFDialog(ABackground: TdxBackground): Boolean; +function StandardGetGraphicClassProc(const AFileName: string): TGraphicClass; + +type + TdxGetGraphicClassProc = function(const AFileName: string): TGraphicClass; + +var + GetGraphicClassProc: TdxGetGraphicClassProc = StandardGetGraphicClassProc; + +implementation + +{$R *.DFM} + +uses + {$IFDEF USEJPEGIMAGE} + Jpeg, + {$ENDIF} + ClipBrd, cxClasses, cxGraphics, dxPSGlbl, dxExtCtrls, dxPcPrVw, dxPSPopupMan, + dxPSImgs, dxPSRes, dxPSUtl; + +type + TdxBackgroundAccess = class(TdxBackground); + +const + PatternCount: TPoint = (X: 8; Y: 6); + PatternSize: TPoint = (X: 8; Y: 8); + TextureCount: TPoint = (X: 4; Y: 6); + TextureSize: TPoint = (X: 64; Y: 64); + + sdxInitialDir = 'InitialDir'; //Don't Localize + sdxActivePage = 'ActivePage'; //Don't Localize + +function dxCreateMappedBmp(ASource: TBitmap; const OldColors, NewColors: array of TColor): TBitmap; +var + I, J, K: Integer; +begin + Result := TBitmap.Create; + try + Result.Width := ASource.Width; + Result.Height := ASource.Height; + for I := 0 to ASource.Width - 1 do + for J := 0 to ASource.Height - 1 do + for K := Low(OldColors) to High(OldColors) do + if ASource.Canvas.Pixels[I, J] = OldColors[K] then + begin + Result.Canvas.Pixels[I, J] := NewColors[K]; + Break; + end + else + Result.Canvas.Pixels[I, J] := ASource.Canvas.Pixels[I, J]; + except + Result.Free; + raise; + end; +end; + +function dxFEFDialog(ABackground: TdxBackground): Boolean; +var + Dialog: TdxFEFDialog; + B: TBitmap; +begin + Result := False; + if ABackground = nil then Exit; + + Dialog := TdxFEFDialog.Create(nil); + try + Dialog.Background := ABackground; + Dialog.FOriginalBackground := ABackground; + Dialog.OnApply := TdxBackgroundAccess(ABackground).OnApply; + Result := Dialog.Execute or not Dialog.FFirstApplied; {at least one time button "Apply" was pressed} + if Dialog.ModalResult <> mrOK then Exit; + if Result then + begin + ABackground.BkColor := Dialog.BackColor; + ABackground.Brush.Color := Dialog.ForeColor; + ABackground.Picture := Dialog.Picture; + case Dialog.SelectWhat of + faTexture: + ABackground.Mode := bmBrushBitmap; + faPattern: + begin + B := TBitmap(ABackground.Picture); + B.Width := PatternSize.X; + B.Height := PatternSize.Y; + B.Canvas.Draw(-Dialog.dgPattern.Col * PatternSize.X, -Dialog.dgPattern.Row * PatternSize.Y, Dialog.FbmpCurrentPattern); + ABackground.Mode := bmBrushBitmap; + end; + faPicture: + begin + ABackground.Mode := bmPicture; + ABackground.PictureMode := Dialog.PaintMode; + end; + end; + end; + finally + Dialog.Free; + end; +end; + +function StandardGetGraphicClassProc(const AFileName: string): TGraphicClass; +var + Extention: string; +begin + Result := nil; + Extention := ExtractFileExt(AFileName); + if CompareText(Extention, '.' + GraphicExtension(TBitmap)) = 0 then + Result := TBitmap + else + {$IFDEF USEJPEGIMAGE} + if CompareText(Extention, '.' + GraphicExtension(TJpegImage)) = 0 then + Result := TJpegImage + else + {$ENDIF} + if CompareText(Extention, '.' + GraphicExtension(TMetafile)) = 0 then + Result := TMetafile + else + if CompareText(Extention, '.wmf') = 0 then + Result := TMetafile; +end; + +{ TdxFEFDialog } + +constructor TdxFEFDialog.Create(AOwner: TComponent); +begin + inherited; + HelpContext := dxhcFEFDlg; + + FFirstApplied := True; + CreateControls; + LoadResources; + FPreviewWhat := faNone; + FPatternWasSelected := False; + FTextureWasSelected := False; + FPictureExists := False; + + pmPicture.Images := ilMenu; + miLoad.ImageIndex := 0; + miPreview.ImageIndex := 1; + miCut.ImageIndex := 2; + miCopy.ImageIndex := 3; + miPaste.ImageIndex := 4; + miDelete.ImageIndex := 5; + + dxPSPopupMenuController.RegisterControl(sbxPicture); +end; + +destructor TdxFEFDialog.Destroy; +begin + dxPSPopupMenuController.UnregisterControl(sbxPicture); + FreeAndNil(FPatternNames); + FreeAndNil(FTextureNames); + FreeAndNil(FBackground); + FreeAndNil(FPicture); + FreeAndNil(FOtherTexture); + FreeAndNil(FOtherPicture); + FreeAndNilResources; + inherited; +end; + +procedure TdxFEFDialog.CreateControls; + + function CreateColorCombo(AParent: TWinControl; ASite: TControl; ALabel: TLabel; + ATabOrder: Integer): TdxPSColorCombo; + begin + Result := TdxPSColorCombo.Create(Self); + with Result do + begin + Parent := AParent; + BoundsRect := ASite.BoundsRect; + TabOrder := ATabOrder; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowCustomColor := False; + OnChange := cbxColorChange; + end; + ALabel.FocusControl := Result; + ASite.Visible := False; + end; + +begin + cbxForeColor := CreateColorCombo(tshPattern, bvlForeColorHolder, lblForeground, 1); + cbxBackColor := CreateColorCombo(tshPattern, bvlBackColorHolder, lblBackground, 2); + + FBackground := TdxBackground.Create; + FPicture := TBitmap.Create; + FPatternNames := TStringList.Create; + FTextureNames := TStringList.Create; +end; + +procedure TdxFEFDialog.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + Params.WindowClass.Style := Params.WindowClass.Style or CS_SAVEBITS; +end; + +procedure TdxFEFDialog.Loaded; +begin + inherited Loaded; + if Screen.PixelsPerInch > 96 then + begin + dgTexture.DefaultColWidth := (dgTexture.Width - GetSystemMetrics(SM_CXHSCROLL) - 1) div 4 - 1; + dgTexture.Width := dgTexture.Width - 1; + dgTexture.DefaultRowHeight := dgTexture.DefaultColWidth; + dgTexture.Height := dgTexture.Height - 2; + dgPattern.Width := dgPattern.Width - dgPattern.Width mod dgPattern.ColCount + 7; + dgPattern.DefaultColWidth := (dgPattern.Width - 1) div dgPattern.ColCount; + dgPattern.Height := dgPattern.Height - dgPattern.Height mod dgPattern.RowCount + 11; + dgPattern.DefaultRowHeight := dgPattern.Height div dgPattern.RowCount; + end; + with dgTexture do + pnlTextureName.SetBounds(Left, BoundsRect.Bottom + 3, Width, pnlTextureName.Height); + with dgPattern do + pnlPatternName.SetBounds(Left, BoundsRect.Bottom + 3, Width, pnlPatternName.Height); + btnInvert.SetBounds(dgPattern.Left, btnInvert.Top, dgPattern.Width, btnInvert.Height); +end; + +procedure TdxFEFDialog.CMDialogChar(var Msg: TCMDialogChar); +var + I: Integer; +begin + inherited; + with PageControl1 do + for I := 0 to PageCount - 1 do + if IsAccel(Msg.CharCode, Pages[I].Caption) then + begin + Msg.Result := 1; + ActivePage := Pages[I]; + Exit; + end; +end; + +procedure TdxFEFDialog.WMCancelMode(var Msg: TWMCancelMode); +begin + inherited; + dgPattern.Invalidate; + dgTexture.Invalidate; +end; + +function TdxFEFDialog.Execute: Boolean; +begin + StartSetting; + Result := (ShowModal = mrOk) and FModified; +end; + +procedure TdxFEFDialog.SetBackground(Value: TdxBackground); +begin + FBackground.Assign(Value); + SetupDialog; + UpdateControlsState; +end; + +procedure TdxFEFDialog.SetupDialog; +var + bmp: TBitmap; + I, J: Integer; +begin + FControlsUpdating := True; + try + cbxPaintMode.ItemIndex := Integer(Background.PictureMode); + ForeColor := FBackground.Brush.Color; + BackColor := FBackground.BkColor; + if (BackColor = ForeColor) and (ForeColor = clWhite) then + ForeColor := clBlack; + MapPatternColors; + if FBackground.Picture <> nil then + begin + case FBackground.Mode of + bmNone: ; + bmBrush: ; + bmBrushBitmap: + begin + PageControl1.ActivePage := tshPattern; + for I := 0 to PatternCount.X - 1 do + for J := 0 to PatternCount.Y - 1 do + begin + bmp := CopyPattern(I, J); + try + if dxAreGraphicsEqual(Bmp, FBackground.Picture) then + begin + FPatternWasSelected := True; + dgPattern.Col := I; + dgPattern.Row := J; + FPicture.Assign(TBitmap(FBackground.Picture)); + FPreviewWhat := faPattern; + dgPatternClick(dgPattern); + end; + finally + bmp.Free; + end; + end; + + PageControl1.ActivePage := tshTexture; + for I := 0 to TextureCount.X - 1 do + for J := 0 to TextureCount.Y - 1 do + begin + bmp := CopyTexture(I, J); + try + if dxAreBitmapsEqual(bmp, TBitmap(FBackground.Picture)) then + begin + FTextureWasSelected := True; + dgTexture.Col := I; + dgTexture.Row := J; + if (dgTexture.Row > 2) then dgTexture.TopRow := dgTexture.Row - 2; + FPicture.Assign(TBitmap(FBackground.Picture)); + FPreviewWhat := faTexture; + dgTextureClick(dgTexture); + end; + finally + bmp.Free; + end; + end; + end; + + bmPicture: + begin + FPicture.Assign(TBitmap(FBackground.Picture)); + GetOtherPicture(TGraphicClass(FBackground.Picture.ClassType)).Assign(FBackground.Picture); + FPictureExists := True; + FPreviewWhat := faPicture; + PageControl1.ActivePage := tshPicture; + PaintPicture; + end; + end; + end; + finally + FControlsUpdating := False; + end; + pbxPreview.Invalidate; +end; + +procedure TdxFEFDialog.UpdateControlsState; +var + b: Boolean; +begin + b := FModified and (FPicture <> nil) and not FPicture.Empty; + + btnApply.Visible := Assigned(OnApply); + btnApply.Enabled := b and not FApplied; + // btnOK.Enabled := b; + btnInvert.Enabled := BackColor <> ForeColor; + pnlNoPicture.Visible := FOtherPicture = nil; + btnPreview.Enabled := (FOtherPicture <> nil) and + ((FOtherPicture.Width > sbxPicture.ClientWidth) or + (FOtherPicture.Height > sbxPicture.ClientHeight)); + cbxPaintMode.Enabled := FOtherPicture <> nil; + lblPaintMode.Enabled := FOtherPicture <> nil; +end; + +procedure TdxFEFDialog.CheckModified; +begin + if not FModified then FModified := True; + FApplied := False; + UpdateControlsState; +end; + +procedure TdxFEFDialog.StartSetting; +begin + FModified := False; + FControlsUpdating := True; + try + with PageControl1 do + ActivePage := Pages[FActivePage]; + btnHelp.Visible := HelpContext <> 0; + finally + UpdateControlsState; + FControlsUpdating := False; + end; +end; + +procedure TdxFEFDialog.LoadResources; +var + Index: Integer; +begin + FbmpPattern := TBitmap.Create; + FbmpPattern.Width := PatternCount.X * PatternSize.X; + FbmpPattern.Height := PatternCount.Y * PatternSize.Y; + Bitmap_LoadFromResourceName(FbmpPattern, IDB_DXPSBKPATTERNS); + + FbmpTexture := TBitmap.Create; + FbmpTexture.Width := TextureCount.X * TextureSize.X; + FbmpTexture.Height := TextureCount.Y * TextureSize.Y; + Bitmap_LoadFromResourceName(FbmpTexture, IDB_DXPSBKTEXTURES); + + miLoad.Caption := cxGetResourceString(@sdxMenuLoad); + miPreview.Caption := cxGetResourceString(@sdxMenuPreview); + miCut.Caption := cxGetResourceString(@sdxMenuEditCut); + miCopy.Caption := cxGetResourceString(@sdxMenuEditCopy); + miPaste.Caption := cxGetResourceString(@sdxMenuEditPaste); + miDelete.Caption := cxGetResourceString(@sdxMenuEditDelete); + + tshTexture.Caption := cxGetResourceString(@sdxTexture); + tshPattern.Caption := cxGetResourceString(@sdxPattern); + tshPicture.Caption := cxGetResourceString(@sdxPicture); + + btnOtherTexture.Caption := cxGetResourceString(@sdxBtnOtherTexture); + lblForeground.Caption := cxGetResourceString(@sdxForeground); + lblBackground.Caption := cxGetResourceString(@sdxBackground); + btnInvert.Caption := cxGetResourceString(@sdxBtnInvertColors); + pnlNoPicture.Caption := cxGetResourceString(@sdxThereIsNoPictureToDisplay); + btnPreview.Caption := cxGetResourceString(@sdxBtnPreview); + btnSelectPicture.Caption := cxGetResourceString(@sdxBtnSelectPicture); + lblPaintMode.Caption := cxGetResourceString(@sdxPaintMode); + lblSample.Caption := cxGetResourceString(@sdxSample); + btnOK.Caption := cxGetResourceString(@sdxBtnOK); + btnCancel.Caption := cxGetResourceString(@sdxBtnCancel); + btnApply.Caption := cxGetResourceString(@sdxBtnApply); + Caption := cxGetResourceString(@sdxFEFCaption); + + Index := cbxPaintMode.ItemIndex; + with cbxPaintMode do + begin + Items.BeginUpdate; + try + Items.Clear; + Items.Add(cxGetResourceString(@sdxPaintModeCenter)); + Items.Add(cxGetResourceString(@sdxPaintModeStretch)); + Items.Add(cxGetResourceString(@sdxPaintModeTile)); + Items.Add(cxGetResourceString(@sdxPaintModeProportional)); + finally + Items.EndUpdate; + end; + end; + cbxPaintMode.ItemIndex := Index; + + with FPatternNames do + begin + BeginUpdate; + try + Clear; + Add(cxGetResourceString(@sdxPatternGray5)); + Add(cxGetResourceString(@sdxPatternGray10)); + Add(cxGetResourceString(@sdxPatternGray20)); + Add(cxGetResourceString(@sdxPatternGray25)); + Add(cxGetResourceString(@sdxPatternGray30)); + Add(cxGetResourceString(@sdxPatternGray40)); + Add(cxGetResourceString(@sdxPatternGray50)); + Add(cxGetResourceString(@sdxPatternGray60)); + Add(cxGetResourceString(@sdxPatternGray70)); + Add(cxGetResourceString(@sdxPatternGray75)); + Add(cxGetResourceString(@sdxPatternGray80)); + Add(cxGetResourceString(@sdxPatternGray90)); + Add(cxGetResourceString(@sdxPatternLightDownwardDiagonal)); + Add(cxGetResourceString(@sdxPatternLightUpwardDiagonal)); + Add(cxGetResourceString(@sdxPatternDarkDownwardDiagonal)); + Add(cxGetResourceString(@sdxPatternDarkUpwardDiagonal)); + Add(cxGetResourceString(@sdxPatternWideDownwardDiagonal)); + Add(cxGetResourceString(@sdxPatternWideUpwardDiagonal)); + Add(cxGetResourceString(@sdxPatternLightVertical)); + Add(cxGetResourceString(@sdxPatternLightHorizontal)); + Add(cxGetResourceString(@sdxPatternNarrowVertical)); + Add(cxGetResourceString(@sdxPatternNarrowHorizontal)); + Add(cxGetResourceString(@sdxPatternDarkVertical)); + Add(cxGetResourceString(@sdxPatternDarkHorizontal)); + Add(cxGetResourceString(@sdxPatternDashedDownward)); + Add(cxGetResourceString(@sdxPatternDashedUpward)); + Add(cxGetResourceString(@sdxPatternDashedHorizontal)); + Add(cxGetResourceString(@sdxPatternDashedVertical)); + Add(cxGetResourceString(@sdxPatternSmallConfetti)); + Add(cxGetResourceString(@sdxPatternLargeConfetti)); + Add(cxGetResourceString(@sdxPatternZigZag)); + Add(cxGetResourceString(@sdxPatternWave)); + Add(cxGetResourceString(@sdxPatternDiagonalBrick)); + Add(cxGetResourceString(@sdxPatternHorizantalBrick)); + Add(cxGetResourceString(@sdxPatternWeave)); + Add(cxGetResourceString(@sdxPatternPlaid)); + Add(cxGetResourceString(@sdxPatternDivot)); + Add(cxGetResourceString(@sdxPatternDottedGrid)); + Add(cxGetResourceString(@sdxPatternDottedDiamond)); + Add(cxGetResourceString(@sdxPatternShingle)); + Add(cxGetResourceString(@sdxPatternTrellis)); + Add(cxGetResourceString(@sdxPatternSphere)); + Add(cxGetResourceString(@sdxPatternSmallGrid)); + Add(cxGetResourceString(@sdxPatternLargeGrid)); + Add(cxGetResourceString(@sdxPatternSmallCheckedBoard)); + Add(cxGetResourceString(@sdxPatternLargeCheckedBoard)); + Add(cxGetResourceString(@sdxPatternOutlinedDiamond)); + Add(cxGetResourceString(@sdxPatternSolidDiamond)); + finally + EndUpdate; + end; + end; + + with FTextureNames do + begin + BeginUpdate; + try + Clear; + Add(cxGetResourceString(@sdxTextureNewSprint)); + Add(cxGetResourceString(@sdxTextureGreenMarble)); + Add(cxGetResourceString(@sdxTextureBlueTissuePaper)); + Add(cxGetResourceString(@sdxTexturePapyrus)); + Add(cxGetResourceString(@sdxTextureWaterDroplets)); + Add(cxGetResourceString(@sdxTextureCork)); + Add(cxGetResourceString(@sdxTextureRecycledPaper)); + Add(cxGetResourceString(@sdxTextureWhiteMarble)); + Add(cxGetResourceString(@sdxTexturePinkMarble)); + Add(cxGetResourceString(@sdxTextureCanvas)); + Add(cxGetResourceString(@sdxTexturePaperBag)); + Add(cxGetResourceString(@sdxTextureWalnut)); + Add(cxGetResourceString(@sdxTextureParchment)); + Add(cxGetResourceString(@sdxTextureBrownMarble)); + Add(cxGetResourceString(@sdxTexturePurpleMesh)); + Add(cxGetResourceString(@sdxTextureDenim)); + Add(cxGetResourceString(@sdxTextureFishFossil)); + Add(cxGetResourceString(@sdxTextureOak)); + Add(cxGetResourceString(@sdxTextureStationary)); + Add(cxGetResourceString(@sdxTextureGranite)); + Add(cxGetResourceString(@sdxTextureBouquet)); + Add(cxGetResourceString(@sdxTextureWonenMat)); + Add(cxGetResourceString(@sdxTextureSand)); + Add(cxGetResourceString(@sdxTextureMediumWood)); + finally + EndUpdate; + end; + end; +end; + +procedure TdxFEFDialog.FreeAndNilResources; +begin + FreeAndNil(FbmpPattern); + FreeAndNil(FbmpCurrentPattern); + FreeAndNil(FbmpTexture); +end; + +procedure TdxFEFDialog.dgTextureDrawCell(Sender: TObject; + Col, Row: Integer; Rect: TRect; State: TGridDrawState); +var + DrawGrid: TDrawGrid; + R: TRect; + DC: HDC; + BPP: Integer; + DoHalftone: Boolean; + Pt: TPoint; + ABitmap: Windows.TBitmap; + BltMode: Integer; +begin + DrawGrid := TDrawGrid(Sender); + DC := DrawGrid.Canvas.Handle; + R := Rect; + if not ((gdSelected in State) and FTextureWasSelected) then + if (FOtherTexture = nil) or ((Row < DrawGrid.RowCount - 1) or (Col = 0)) then + begin + DrawEdge(DC, R, EDGE_SUNKEN, BF_RECT); + InflateRect(R, -2, -2); + end + else + else + InflateRect(R, -2, -2); + + BltMode := GetStretchBltMode(DC); + if (FOtherTexture = nil) or (Row < DrawGrid.RowCount - 1) then + begin + BPP := GetDeviceCaps(DC, BITSPIXEL) * GetDeviceCaps(DC, PLANES); + cxGetBitmapData(FbmpTexture.Handle, ABitmap); + DoHalftone := (BPP <= 8) and (BPP < (ABitmap.bmBitsPixel * ABitmap.bmPlanes)); + if DoHalftone then + begin + GetBrushOrgEx(DC, Pt); + SetStretchBltMode(DC, HALFTONE); + SetBrushOrgEx(DC, Pt.x, Pt.y, @Pt); + end + else + if not FbmpTexture.Monochrome then + SetStretchBltMode(DC, STRETCH_DELETESCANS); + end; + + if FOtherTexture = nil then + Windows.StretchBlt(DC, R.Left, R.Top, R.Right - R.Left, + R.Bottom - R.Top, FbmpTexture.Canvas.Handle, Col * TextureSize.X, + Row * TextureSize.Y, TextureSize.X, TextureSize.Y, SRCCOPY) + else + if Row < DrawGrid.RowCount - 1 then + Windows.StretchBlt(DC, R.Left, R.Top, R.Right - R.Left, + R.Bottom - R.Top, FbmpTexture.Canvas.Handle, Col * TextureSize.X, + Row * TextureSize.Y, TextureSize.X, TextureSize.Y, SRCCOPY) + else + if Col = 0 then + DrawGrid.Canvas.StretchDraw(R, FOtherTexture) + else + Windows.FillRect(DC, Rect, hBrush(COLOR_BTNFACE + 1)); + + SetStretchBltMode(DC, BltMode); + + if gdSelected in State then + if (FTextureWasSelected and (FOtherTexture = nil)) or + ((FOtherTexture <> nil) and ((Row < DrawGrid.RowCount - 1) or (DrawGrid.Col = 0))) then + DrawSelectedFrame(DrawGrid, Rect); +end; + +procedure TdxFEFDialog.dgPatternDrawCell(Sender: TObject; Col, + Row: Integer; Rect: TRect; State: TGridDrawState); +var + APrevBrush: TBrush; + ABrushBitmap: TBitmap; + Pt: TPoint; + DC: hDC; +begin + DC := TDrawGrid(Sender).Canvas.Handle; + if not ((gdSelected in State) and FPatternWasSelected) then + DrawEdge(DC, Rect, EDGE_SUNKEN, BF_RECT); + InflateRect(Rect, -2, -2); + + APrevBrush := TBrush.Create; + try + APrevBrush.Assign(TDrawGrid(Sender).Canvas.Brush); + ABrushBitmap := CopyPattern(Col, Row); + try + SetBrushOrgEx(DC, Rect.Left, Rect.Top, @Pt); + with TDrawGrid(Sender).Canvas do + begin + Brush.Bitmap := ABrushBitmap; + FillRect(Rect); + Brush.Bitmap := nil; + Brush := APrevBrush; + end; + SetBrushOrgEx(DC, Pt.X, Pt.Y, nil); + finally + ABrushBitmap.Free; + end; + finally + APrevBrush.Free; + end; + + if (gdSelected in State) and FPatternWasSelected then + begin + InflateRect(Rect, 2, 2); + DrawSelectedFrame(TDrawGrid(Sender), Rect); + end; +end; + +procedure TdxFEFDialog.DrawSelectedFrame(ADrawGrid: TDrawGrid; Rect: TRect); +var + DC: HDC; + PrevColor: TColor; + PrevMode: Integer; + Points: array of TPoint; +begin + with ADrawGrid do + begin + DC := Canvas.Handle; + if (ActiveControl = ADrawGrid) and Focused then + begin + //InflateRect(Rect, 2, 2); + PrevMode := SetBkMode(DC, TRANSPARENT); + PrevColor := Canvas.Pen.Color; + Canvas.Pen.Color := clWindowText; + Canvas.Pen.Style := psDot; + with Rect do + begin + SetLength(Points, 5); + Points[0] := TopLeft; + Points[1] := MakePoint(Right - 1, Top); + Points[2] := MakePoint(Right - 1, Bottom - 1); + Points[3] := MakePoint(Left, Bottom - 1); + Points[4] := TopLeft; + Canvas.Polyline(Points); + end; + Canvas.Pen.Style := psSolid; + Canvas.Pen.Color := PrevColor; + SetBkMode(DC, PrevMode); + InflateRect(Rect, -1, -1); + end; + DrawEdge(DC, Rect, BDR_SUNKENOUTER, BF_RECT or BF_MONO); + InflateRect(Rect, -1, -1); + FrameRect(DC, Rect, GetSysColorBrush(COLOR_BTNHIGHLIGHT)); + end; +end; + +procedure TdxFEFDialog.LoadFromRegistry(const APath: string); +begin + inherited LoadFromRegistry(APath); + with TRegistry.Create do + try + if OpenKey(APath, False) then + try + if ValueExists(sdxInitialDir) then + FInitialDir := ReadString(sdxInitialDir); + if ValueExists(sdxActivePage) then + FActivePage := ReadInteger(sdxActivePage); + except + on ERegistryException do + { ignore } + else + raise; + end; + finally + Free; + end; +end; + +procedure TdxFEFDialog.SaveToRegistry(const APath: string); +begin + inherited SaveToRegistry(APath); + with TRegistry.Create do + try + if OpenKey(APath, True) then + try + WriteString(sdxInitialDir, FInitialDir); + WriteInteger(sdxActivePage, PageControl1.ActivePage.PageIndex); + except + on ERegistryException do + { ignore } + else + raise; + end; + finally + Free; + end; +end; + +procedure TdxFEFDialog.SelectPictureClick(Sender: TObject); +var + Graphic: TGraphic; +begin + Graphic := nil; + try + LoadImage(Graphic, 1); + if Graphic <> nil then AssignPicture(Graphic); + finally + if Graphic <> nil then Graphic.Free; + end; +end; + +procedure TdxFEFDialog.AssignPicture(AImage: TGraphic); +begin + if AImage is TMetafile then + begin + FPicture.Free; + FPicture := TBitmap.Create; + FPicture.Width := AImage.Width; + FPicture.Height := AImage.Height; + TBitmap(FPicture).Palette := AImage.Palette; + TBitmap(FPicture).Canvas.Draw(0, 0, AImage); + end + else + SetPicture(AImage); + + GetOtherPicture(TGraphicClass(FPicture.ClassType)).Assign(FPicture); + PaintPicture; + CheckModified; + FPreviewWhat := faPicture; + pbxPreview.Invalidate; + FPictureExists := True; +end; + +procedure TdxFEFDialog.PaintPicture; +begin + if FPicture <> nil then + begin + pnlPicture.SetBounds(0, 0, FPicture.Width, FPicture.Height); + pbxPicture.Invalidate; + end; +end; + +procedure TdxFEFDialog.pbxPicturePaint(Sender: TObject); +begin + if FOtherPicture <> nil then + TPaintBox(Sender).Canvas.Draw(0, 0, FOtherPicture); +end; + +procedure TdxFEFDialog.btnOtherTextureClick(Sender: TObject); +var + APicture: TGraphic; +begin + APicture := nil; + try + LoadImage(APicture, 0); + if APicture <> nil then + begin + if APicture is TMetafile then + begin + FPicture.Free; + FPicture := TBitmap.Create; + FPicture.Width := TextureSize.X; + FPicture.Height := TextureSize.Y; + TBitmap(FPicture).Palette := APicture.Palette; + TBitmap(FPicture).Canvas.Draw(0, 0, APicture); + end + else + SetPicture(APicture); + + if FOtherTexture = nil then + dgTexture.RowCount := dgTexture.RowCount + 1; + OtherTexture.Assign(FPicture); + dgTexture.Col := 0; + dgTexture.Row := dgTexture.RowCount - 1; + if not FTextureWasSelected then + FTextureWasSelected := True; + dgTexture.Invalidate; + CheckModified; + FPreviewWhat := faTexture; + pbxPreview.Refresh; + end; + finally + if APicture <> nil then APicture.Free; + end; +end; + +procedure TdxFEFDialog.LoadImage(var AImage: TGraphic; AWhat: Integer); +var + Registered: Boolean; + + procedure UnregisterIcon; + begin + Registered := Pos('ico', GraphicFilter(TGraphic)) > 0; + if Registered then TPicture.UnregisterGraphicClass(TIcon); + end; + + procedure RegisterIcon; + begin + if Registered then + TPicture.RegisterFileFormat('ico', SVIcons, TIcon); + end; + +var + Dialog: TOpenPictureDialog; + FileName: string; + B: TBitmap; +begin + UnregisterIcon; + try + Dialog := TOpenPictureDialog.Create(nil); + try + Dialog.InitialDir := FInitialDir; + Dialog.Filter := GraphicFilter(TGraphic); + if Dialog.Execute then + begin + if InternalLoadImage(AImage, Dialog.Filename) then + begin + FInitialDir := ExtractFileDir(Dialog.Filename); + FileName := {Dialog.FileName;//}ChangeFileExt(ExtractFileName(Dialog.Filename), ''); + + case AWhat of + 0: // textures + begin + FOtherTextureName := FileName; + pnlTextureName.Caption := FileName;//ChangeFileExt(ExtractFileName(Filename), ''); + if AImage is TMetafile then + // + else + if AImage is TBitmap then + begin + AImage.Width := TextureSize.X; + AImage.Height := TextureSize.Y; + end + else + begin + B := TBitmap.Create; + try + B.Assign(AImage); + B.Width := TextureSize.X; + B.Height := TextureSize.Y; + AImage.Assign(B); + finally + B.Free; + end; + end; + end; + + 1: // pictures + begin + FOtherPictureName := FileName; + pnlPictureName.Caption := FileName;//ChangeFileExt(ExtractFileName(FileName), ''); + end; + end; + CheckModified; + end; + end; + finally + Dialog.Free; + end; + finally + RegisterIcon; + end; +end; + +function TdxFEFDialog.InternalLoadImage(var AImage: TGraphic; const AFileName: string): Boolean; +var + Picture: TPicture; +begin + AImage := nil; + Picture := TPicture.Create; + try + try + Picture.LoadFromFile(AFileName); + AImage := dxPSUtl.CreateGraphic(TGraphicClass(Picture.Graphic.ClassType)); + AImage.Assign(Picture.Graphic); + Result := True; + except + FreeAndNil(AImage); + Result := False; + end; + finally + Picture.Free; + end; +end; + +function TdxFEFDialog.GetPicture: TGraphic; +begin + Result := FPicture; +end; + +function TdxFEFDialog.GetPaintMode: TdxPicturePaintMode; +begin + if cbxPaintMode.ItemIndex > -1 then + Result := TdxPicturePaintMode(cbxPaintMode.ItemIndex) + else + Result := ppmCenter; +end; + +procedure TdxFEFDialog.SetPicture(Value: TGraphic); +begin + if FPicture = nil then FPicture := TBitmap.Create; + FPicture.Assign(Value); +end; + +procedure TdxFEFDialog.SetPaintMode(Value: TdxPicturePaintMode); +begin + if PaintMode <> Value then + cbxPaintMode.ItemIndex := Integer(Value); +end; + +procedure TdxFEFDialog.PaintPreview; +var + APrevBrush: TBrush; + ABrushBitmap: TBitmap; + R: TRect; + AWidth, AHeight: Integer; + I, J: Integer; +begin + case FPreviewWhat of + faTexture: + if FTextureWasSelected then + begin + AWidth := Picture.Width; + AHeight := Picture.Height; + for i := 0 to pbxPreview.Width div AWidth do + for j := 0 to pbxPreview.Height div AHeight do + pbxPreview.Canvas.Draw(i * AWidth, j * AHeight, Picture); + end; + + faPattern: + if FPatternWasSelected then + begin + APrevBrush := TBrush.Create; + try + APrevBrush.Assign(pbxPreview.Canvas.Brush); + ABrushBitmap := CopyPattern(dgPattern.Col, dgPattern.Row); + try + R := pbxPreview.ClientRect; + InflateRect(R, 2, 2); + pbxPreview.Canvas.Brush.Bitmap := ABrushBitmap; + pbxPreview.Canvas.FillRect(R); + pbxPreview.Canvas.Brush.Bitmap := nil; + pbxPreview.Canvas.Brush := APrevBrush; + finally + ABrushBitmap.Free; + end; + finally + APrevBrush.Free; + end; + end; + + faPicture: + if FOtherPicture <> nil then + begin + R := pbxPreview.ClientRect; + InflateRect(R, 2, 2); + pbxPreview.Canvas.StretchDraw(R, FOtherPicture); + end; + end; +end; + +procedure TdxFEFDialog.dgTextureClick(Sender: TObject); +var + DrawGrid: TDrawGrid; +begin + DrawGrid := TDrawGrid(Sender); + if FPicture <> nil then FPicture.Free; + FPicture := nil; + + if FOtherTexture <> nil then + begin + if (DrawGrid.Row = DrawGrid.RowCount - 1) and (DrawGrid.Col > 0) then + Exit + else + if DrawGrid.Row < DrawGrid.RowCount - 1 then + FPicture := CopyTexture(DrawGrid.Col, DrawGrid.Row) + else + if DrawGrid.Col = 0 then + SetPicture(OtherTexture); + end + else + FPicture := CopyTexture(DrawGrid.Col, DrawGrid.Row); + if not FTextureWasSelected then + begin + FTextureWasSelected := True; + DrawGrid.Invalidate; + end; + FPreviewWhat := faTexture; + pbxPreview.Invalidate; + if (FOtherTexture <> nil) and (DrawGrid.Col = 0) and (DrawGrid.Row = DrawGrid.RowCount - 1) then + pnlTextureName.Caption := FOtherTextureName + else + pnlTextureName.Caption := FTextureNames[DrawGrid.Col * TextureCount.Y + DrawGrid.Row]; + CheckModified; +end; + +procedure TdxFEFDialog.dgPatternClick(Sender: TObject); +var + DrawGrid: TDrawGrid; +begin + DrawGrid := TDrawGrid(Sender); + if not FPatternWasSelected then + begin + FPatternWasSelected := True; + DrawGrid.Invalidate; + end; + FreeAndNil(FPicture); + + FPicture := CopyPattern(DrawGrid.Col, DrawGrid.Row); + FPreviewWhat := faPattern; + pbxPreview.Refresh; + pnlPatternName.Caption := FPatternNames[DrawGrid.Col * TextureCount.Y + DrawGrid.Row]; + CheckModified; +end; + +procedure TdxFEFDialog.pbxPreviewPaint(Sender: TObject); +begin + PaintPreview; +end; + +procedure TdxFEFDialog.MapPatternColors; +begin + FreeAndNil(FbmpCurrentPattern); + FbmpCurrentPattern := dxCreateMappedBmp(FbmpPattern, [clWhite, clBlack], [BackColor, ForeColor]); +end; + +procedure TdxFEFDialog.cbxColorChange(Sender: TObject); +begin + if FControlsUpdating then Exit; + FPreviewWhat := faPattern; + MapPatternColors; + pbxPreview.Invalidate; + dgPattern.Invalidate; + if (dgPattern.Col > -1) and (dgPattern.Row > -1) then + CheckModified; +end; + +function TdxFEFDialog.CopyTexture(I, J: Integer): TBitmap; +begin + Result := TBitmap.Create; + with Result do + try + Width := TextureSize.X; + Height := TextureSize.Y; + Canvas.Draw(-I * TextureSize.X, -J * TextureSize.Y, FbmpTexture); + except + Free; + raise; + end; +end; + +function TdxFEFDialog.CopyPattern(I, J: Integer): TBitmap; +begin + Result := TBitmap.Create; + with Result do + try + Width := PatternSize.X; + Height := PatternSize.Y; + Canvas.Draw(-I * PatternSize.X, -J * PatternSize.Y, FbmpCurrentPattern); + except + Result.Free; + raise; + end; +end; + +procedure TdxFEFDialog.PageControl1Change(Sender: TObject); +begin + FApplied := False; + FPreviewWhat := TdxFillAs(TPageControl(Sender).ActivePage.PageIndex + 1); + FreeAndNil(FPicture); + + case FPreviewWhat of + faTexture: + if FTextureWasSelected then + if FOtherTexture <> nil then + begin + if dgTexture.Row < dgTexture.RowCount - 1 then + FPicture := CopyTexture(dgTexture.Col, dgTexture.Row) + else + if dgTexture.Col = 0 then + SetPicture(OtherTexture); + end + else + FPicture := CopyTexture(dgTexture.Col, dgTexture.Row); + faPattern: + if FPatternWasSelected then + FPicture := CopyPattern(dgPattern.Col, dgPattern.Row); + faPicture: + if FOtherPicture <> nil then SetPicture(FOtherPicture); + end; + pbxPreview.Invalidate; + UpdateControlsState; +end; + +procedure TdxFEFDialog.PicturePreviewClick(Sender: TObject); +begin + dxShowPicturePreview(Picture); +end; + +procedure TdxFEFDialog.cbxPaintModeChange(Sender: TObject); +begin + if FControlsUpdating then Exit; + CheckModified; +end; + +function TdxFEFDialog.GetSelectWhat: TdxFillAs; +begin + Result := faNone; + if FTextureWasSelected and (PageControl1.ActivePage.PageIndex = 0) then + Result := faTexture + else + if FPatternWasSelected and (PageControl1.ActivePage.PageIndex = 1) then + Result := faPattern + else + if FPictureExists and (PageControl1.ActivePage.PageIndex = 2) then + Result := faPicture; +end; + +procedure TdxFEFDialog.SetSelectWhat(Value: TdxFillAs); +begin + case Value of + faNone: ; + faTexture: + begin + FTextureWasSelected := True; + PageControl1.ActivePage := PageControl1.Pages[0]; + end; + faPattern: + begin + FPatternWasSelected := True; + PageControl1.ActivePage := PageControl1.Pages[1]; + end; + faPicture: + begin + FPictureExists := True; + PageControl1.ActivePage := PageControl1.Pages[2]; + end; + end; +end; + +function TdxFEFDialog.GetOtherTexture: TBitmap; +begin + if FOtherTexture = nil then FOtherTexture := TBitmap.Create; + Result := FOtherTexture; +end; + +procedure TdxFEFDialog.SetOtherTexture(Value: TBitmap); +begin + if Value <> nil then + GetOtherTexture.Assign(Value) + else + if FOtherTexture <> nil then + begin + FOtherTexture.Free; + FOtherTexture := nil; + end; +end; + +function TdxFEFDialog.GetOtherPicture(AGraphicClass: TGraphicClass): TGraphic; +begin + FreeAndNil(FOtherPicture); + + if AGraphicClass <> nil then + FOtherPicture := dxPSUtl.CreateGraphic(AGraphicClass); + Result := FOtherPicture; +end; + +function TdxFEFDialog.GetForeColor: TColor; +begin + Result := TColor(cbxForeColor.Items.Objects[cbxForeColor.ItemIndex]); +end; + +procedure TdxFEFDialog.SetForeColor(Value: TColor); +begin + TdxPSColorCombo(cbxForeColor).ColorValue := Value; + cbxColorChange(cbxForeColor); {???} +end; + +function TdxFEFDialog.GetBackColor: TColor; +begin + Result := TColor(cbxBackColor.Items.Objects[cbxBackColor.ItemIndex]); +end; + +procedure TdxFEFDialog.SetBackColor(Value: TColor); +begin + TdxPSColorCombo(cbxBackColor).ColorValue := Value; + cbxColorChange(cbxBackColor); {???} +end; + +procedure TdxFEFDialog.lblPaintModeClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; + TComboBox(ActiveControl).DroppedDown := True; +end; + +procedure TdxFEFDialog.lblForegroundClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; + TdxPSColorCombo(ActiveControl).DroppedDown := True; +end; + +procedure TdxFEFDialog.DoApply; +var + B: TBitmap; +begin + if Assigned(FOnApply) then + begin + Background.BeginUpdate; + try + Background.BkColor := BackColor; + Background.Brush.Color := ForeColor; + Background.Picture := Picture; + case SelectWhat of + faTexture: + begin + Background.Picture := Picture; + Background.Mode := bmBrushBitmap; + end; + + faPattern: + begin + B := TBitmap(Background.Picture); + B.Width := PatternSize.X; + B.Height := PatternSize.Y; + B.Canvas.Draw(-dgPattern.Col * PatternSize.X, -dgPattern.Row * PatternSize.Y, FbmpCurrentPattern); + Background.Mode := bmBrushBitmap; + end; + + faPicture: + begin + Background.Mode := bmPicture; + Background.PictureMode := PaintMode; + end; + end; + if FOriginalBackground <> nil then FOriginalBackground.Assign(Background); + FOnApply(Background); + finally + Background.EndUpdate; + end; + end; +end; + +procedure TdxFEFDialog.btnApplyClick(Sender: TObject); +begin + DoApply; + FApplied := True; + if FFirstApplied then + begin + btnCancel.Caption := cxGetResourceString(@sdxBtnClose); + FFirstApplied := False; + end; + UpdateControlsState; +end; + +procedure TdxFEFDialog.dgTextureDblClick(Sender: TObject); +begin + if FPicture <> nil then btnOK.Click; +end; + +procedure TdxFEFDialog.dgPatternDblClick(Sender: TObject); +begin + if FPicture <> nil then btnOK.Click; +end; + +procedure TdxFEFDialog.dgTextureMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +const + ATextureLastCol: Longint = -2; + ATextureLastRow: Longint = -2; +var + Col, Row: Longint; + S: string; +begin + TDrawGrid(Sender).MouseToCell(X, Y, Col, Row); + + if (Col <> ATextureLastCol) or (Row <> ATextureLastRow) then + begin + Application.CancelHint; + S := ''; + if (Col > -1) and (Row > -1) then + if FOtherTexture = nil then + S := FTextureNames[Col * TextureCount.Y + Row] + else + if (FOtherTexture <> nil) and (Col = 0) and (Row = TDrawGrid(Sender).RowCount - 1) then + S := FOtherTextureName + else + if Row < TDrawGrid(Sender).RowCount - 1 then + S := FTextureNames[Col * TextureCount.Y + Row]; + + TDrawGrid(Sender).Hint := S; + end; + + ATextureLastCol := Col; + ATextureLastRow := Row; +end; + +procedure TdxFEFDialog.dgPatternMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +const + APatternLastCol: Longint = -2; + APatternLastRow: Longint = -2; +var + Col, Row: Longint; +begin + TDrawGrid(Sender).MouseToCell(X, Y, Col, Row); + if (Col <> APatternLastCol) or (Row <> APatternLastRow) then + begin + Application.CancelHint; + if (Col > -1) and (Row > -1) then + TDrawGrid(Sender).Hint := FPatternNames[Col * PatternCount.Y + Row]; + end; + + APatternLastCol := Col; + APatternLastRow := Row; +end; + +procedure TdxFEFDialog.btnInvertClick(Sender: TObject); +begin + DoInvertColors; + with dgPattern do + if (Col > -1) and (Row > -1) then CheckModified; +end; + +procedure TdxFEFDialog.DoInvertColors; +var + ASaveColor: TColor; +begin + dgPattern.Perform(WM_SETREDRAW, WPARAM(False), 0); + btnInvert.Perform(WM_SETREDRAW, WPARAM(False), 0); + ASaveColor := ForeColor; + ForeColor := BackColor; + BackColor := ASaveColor; + dgPattern.Perform(WM_SETREDRAW, WPARAM(True), 0); + dgPattern.Invalidate; + btnInvert.Perform(WM_SETREDRAW, WPARAM(True), 0); + btnInvert.Invalidate; +end; + +procedure TdxFEFDialog.pmPicturePopup(Sender: TObject); +begin + miPreview.Enabled := btnPreview.Enabled; + miCut.Enabled := FOtherPicture <> nil; + miCopy.Enabled := FOtherPicture <> nil; + miPaste.Enabled := ClipBoard.HasFormat(CF_PICTURE); + miDelete.Enabled := FOtherPicture <> nil; +end; + +procedure TdxFEFDialog.miCopyClick(Sender: TObject); +begin + ClipBoard.Assign(FOtherPicture); +end; + +procedure TdxFEFDialog.miPasteClick(Sender: TObject); +var + P: TPicture; +begin + P := TPicture.Create; + try + P.Assign(Clipboard); + if (P.Graphic <> nil) and not P.Graphic.Empty then + AssignPicture(P.Graphic); + finally + P.Free; + end; +end; + +procedure TdxFEFDialog.miDeleteClick(Sender: TObject); +begin + GetOtherPicture(nil); + pbxPicture.Invalidate; + pbxPreview.Invalidate; +end; + +procedure TdxFEFDialog.miCutClick(Sender: TObject); +begin + miCopy.Click; + miDelete.Click; +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPPAttr.pas b/official/x.35/ExpressPrinting System/Sources/dxPPAttr.pas new file mode 100644 index 00000000..10afd7f9 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPPAttr.pas @@ -0,0 +1,585 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPpAttr; + +interface + +{$I cxVer.inc} + +uses + Classes, Windows; + +type + TFloatSize = record + cx: Extended; + cy: Extended; + end; + + TdxPaper = class(TPersistent) + private + FName: string; + FShortName: string; + FSize: TPoint; + FDMPaper: Integer; + function GetHeight: Integer; + function GetWidth: Integer; + procedure SetHeight(Value: Integer); + procedure SetWidth(Value: Integer); + public + constructor Create(const AName, AShortName: string; + AWidth, AHeight: Integer; ADMPaper: Integer); + procedure Assign(Source: TPersistent); override; + function Clone: TdxPaper; + + property DMPaper: Integer read FDMPaper; + property Height: Integer read GetHeight write SetHeight; + property Name: string read FName; + property ShortName: string read FShortName; + property Size: TPoint read FSize write FSize; + property Width: Integer read GetWidth write SetWidth; + end; + + TdxPapers = class(TPersistent) + private + FPapers: TList; + function GetCount: Integer; + function GetPaper(Index: Integer): TdxPaper; + protected + procedure AddPapers; virtual; + public + constructor Create; virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + procedure Clear; + procedure Delete(AIndex: Integer); + function FindByDMPaper(ADMPaper: Integer): Integer; + function FindByName(const AName: string): Integer; + function FindByShortName(const AShortName: string): Integer; + function FindBySize(AWidth, AHeight: Integer): Integer; + procedure Refresh; + + property Count: Integer read GetCount; + property Papers[Index: Integer]: TdxPaper read GetPaper; default; + end; + + TdxBin = class(TPersistent) + private + FName: string; + FValue: Integer; + public + constructor Create(AValue: Integer; const AName: string); virtual; + procedure Assign(Source: TPersistent); override; + + property Name: string read FName; + property Value: Integer read FValue; + end; + + TdxBins = class(TPersistent) + private + FBins: TList; + function GetBin(Index: Integer): TdxBin; + function GetCount: Integer; + protected + procedure AddBins; virtual; + public + constructor Create; virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + procedure Clear; + procedure Delete(Index: Integer); + function FindByName(const AName: string): Integer; + function FindByValue(AValue: Integer): Integer; + function IndexOf(ABin: TdxBin): Integer; + procedure Refresh; + + property Bins[Index: Integer]: TdxBin read GetBin; default; + property Count: Integer read GetCount; + end; + +function Bins: TdxBins; +function Papers: TdxPapers; +function SetBins(Value: TdxBins): TdxBins; +function SetPapers(Value: TdxPapers): TdxPapers; + +implementation + +uses + SysUtils, dxPSUtl; + +var + FPapers: TdxPapers = nil; + FBins: TdxBins = nil; + +function Bins: TdxBins; +begin + if FBins = nil then FBins := TdxBins.Create; + Result := FBins; +end; + +function Papers: TdxPapers; +begin + if FPapers = nil then FPapers := TdxPapers.Create; + Result := FPapers; +end; + +function SetBins(Value: TdxBins): TdxBins; +begin + Result := FBins; + FBins := Value; +end; + +function SetPapers(Value: TdxPapers): TdxPapers; +begin + Result := FPapers; + FPapers := Value; +end; + +function InchToLoMetric(Value: Extended): Integer; +begin + Result := Round(Value * 254); +end; + +{ TdxPaper } + +constructor TdxPaper.Create(const AName, AShortName: string; + AWidth, AHeight: Integer; ADMPaper: Integer); +begin + inherited Create; + FName := AName; + FShortName := AShortName; + FSize.X := AWidth; + FSize.Y := AHeight; + FDMPaper := ADMPaper; +end; + +procedure TdxPaper.Assign(Source: TPersistent); +begin + if Source is TdxPaper then + with TdxPaper(Source) do + begin + Self.FName := Name; + Self.FShortName := ShortName; + Self.FSize := Size; + Self.FDMPaper := DMPaper; + end + else + inherited; +end; + +function TdxPaper.Clone: TdxPaper; +begin + Result := TdxPaper.Create(Name, ShortName, Width, Height, DMPaper); +end; + +function TdxPaper.GetHeight: Integer; +begin + Result := FSize.Y; +end; + +function TdxPaper.GetWidth: Integer; +begin + Result := FSize.X; +end; + +procedure TdxPaper.SetHeight(Value: Integer); +begin + FSize.Y := Value; +end; + +procedure TdxPaper.SetWidth(Value: Integer); +begin + FSize.X := Value; +end; + +{ TdxPapers } + +constructor TdxPapers.Create; +begin + inherited; + FPapers := TList.Create; + Refresh; +end; + +destructor TdxPapers.Destroy; +begin + Clear; + FreeAndNil(FPapers); + inherited; +end; + +procedure TdxPapers.Assign(Source: TPersistent); +var + I: Integer; +begin + if (Source = nil) or (Source is TdxPapers) then + with TdxPapers(Source) do + begin + Self.Clear; + if Source <> nil then + for I := 0 to Count - 1 do + Self.FPapers.Add(Papers[I].Clone); + end + else + inherited; +end; + +procedure TdxPapers.Clear; +begin + while Count > 0 do Delete(Count - 1); +end; + +procedure TdxPapers.Delete(AIndex: Integer); +begin + TObject(FPapers[AIndex]).Free; + FPapers.Delete(AIndex); +end; + +function TdxPapers.FindByDMPaper(ADMPaper: Integer): Integer; +begin + for Result := 0 to Count - 1 do + if Papers[Result].DMPaper = ADMPaper then Exit; + Result := -1; +end; + +function TdxPapers.FindByName(const AName: string): Integer; +begin + for Result := 0 to Count - 1 do + if dxSameText(Papers[Result].Name, AName) then + Exit; + Result := -1; +end; + +function TdxPapers.FindByShortName(const AShortName: string): Integer; +begin + for Result := 0 to Count - 1 do + if dxSameText(Papers[Result].ShortName, AShortName) then + Exit; + Result := -1; +end; + +function TdxPapers.FindBySize(AWidth, AHeight: Integer): Integer; +begin + for Result := 0 to Count - 1 do + if (Abs(Papers[Result].Width - AWidth) < 2) and (Abs(Papers[Result].Height - AHeight) < 2) then + Exit; + Result := -1; +end; + +procedure TdxPapers.Refresh; +begin + Clear; + AddPapers; +end; + +procedure TdxPapers.AddPapers; + + procedure Add(const AName, AShortName: string; AWidth, AHeight: Integer; DMPaper: Integer); + begin + FPapers.Add(TdxPaper.Create(AName, AShortName, AWidth, AHeight, DMPaper)); + end; + +begin + Add('Letter 8 1/2 x 11 in', 'Letter', InchToLoMetric(8.5), InchToLoMetric(11), DMPAPER_LETTER); + Add('Letter Small 8 1/2 x 11 in ', 'Letter Small', InchToLoMetric(8.5), InchToLoMetric(11), DMPAPER_LETTERSMALL); + Add('Tabloid 11 x 17 in', 'Tabloid', InchToLoMetric(11), InchToLoMetric(17), DMPAPER_TABLOID); + Add('Ledger 17 x 11 in', 'Ledger', InchToLoMetric(17), InchToLoMetric(11), DMPAPER_LEDGER); + Add('Legal 8 1/2 x 14 in', 'Legal', InchToLoMetric(8.5), InchToLoMetric(14), DMPAPER_LEGAL); + Add('Statement 5 1/2 x 8 1/2 in', 'Statement', InchToLoMetric(5.5), InchToLoMetric(8.5), DMPAPER_STATEMENT); + Add('Executive 7 1/4 x 10 1/2 in', 'Executive', InchToLoMetric(7.25), InchToLoMetric(10.5), DMPAPER_EXECUTIVE); + Add('A3 297 x 420 mm', 'A3', 2970, 4200, DMPAPER_A3); + Add('A4 210 x 297 mm', 'A4', 2100, 2970, DMPAPER_A4); + Add('A4 Small 210 x 297 mm', 'A4 Small', 2100, 2970, DMPAPER_A4SMALL); + Add('A5 148 x 210 mm', 'A5', 1480, 2100, DMPAPER_A5); + Add('B4 (JIS) 250 x 354', 'B4 (JIS)', 2500, 3540, DMPAPER_B4); + Add('B5 (JIS) 182 x 257 mm', 'B5 (JIS)', 1820, 2570, DMPAPER_B5); + Add('Folio 8 1/2 x 13 in', 'Folio', InchToLoMetric(8.5), InchToLoMetric(13), DMPAPER_FOLIO); + Add('Quarto 215 x 275 mm', 'Quarto', 2150, 2750, DMPAPER_QUARTO); + Add('10x14 in', '10x14 in', InchToLoMetric(10), InchToLoMetric(14), DMPAPER_10X14); + Add('11x17 in', '11x17 in', InchToLoMetric(11), InchToLoMetric(17), DMPAPER_11X17); + Add('Note 8 1/2 x 11 in', 'Note', InchToLoMetric(8.5), InchToLoMetric(11), DMPAPER_NOTE); + Add('Envelope #9 3 7/8 x 8 7/8', 'Envelope #9', InchToLoMetric(3 + 7 / 8), InchToLoMetric(8 + 7 / 8), DMPAPER_ENV_9); + Add('Envelope #10 4 1/8 x 9 1/2', 'Envelope #10', InchToLoMetric(4 + 1 / 8), InchToLoMetric(9.5), DMPAPER_ENV_10); + Add('Envelope #11 4 1/2 x 10 3/8', 'Envelope #11', InchToLoMetric(4.5), InchToLoMetric(10 + 3 / 8), DMPAPER_ENV_11); + Add('Envelope #12 4 3/4 x 11', 'Envelope #12', InchToLoMetric(4 + 3 / 4), InchToLoMetric(11), DMPAPER_ENV_12); + Add('Envelope #14 5 x 11 1/2', 'Envelope #14', InchToLoMetric(5), InchToLoMetric(11.5), DMPAPER_ENV_14); + Add('C sheet 17 x 22 in', 'C sheet', InchToLoMetric(17), InchToLoMetric(22), DMPAPER_CSHEET); + Add('D sheet 22 x 34 in', 'D sheet', InchToLoMetric(22), InchToLoMetric(34), DMPAPER_DSHEET); + Add('E sheet 34 x 44 in', 'E sheet', InchToLoMetric(34), InchToLoMetric(44), DMPAPER_ESHEET); + Add('Envelope DL 110 x 220mm', 'Envelope DL', 1100, 2200, DMPAPER_ENV_DL); + Add('Envelope C5 162 x 229 mm', 'Envelope C5', 1620, 2290, DMPAPER_ENV_C5); + Add('Envelope C3 324 x 458 mm', 'Envelope C3', 3240, 4580, DMPAPER_ENV_C3); + Add('Envelope C4 229 x 324 mm', 'Envelope C4', 2290, 3240, DMPAPER_ENV_C4); + Add('Envelope C6 114 x 162 mm', 'Envelope C6', 1140, 1620, DMPAPER_ENV_C6); + Add('Envelope C65 114 x 229 mm', 'Envelope 65', 1140, 2290, DMPAPER_ENV_C65); + Add('Envelope B4 250 x 353 mm', 'Envelope B4', 2500, 3530, DMPAPER_ENV_B4); + Add('Envelope B5 176 x 250 mm', 'Envelope B5', 1760, 2500, DMPAPER_ENV_B5); + Add('Envelope B6 176 x 125 mm', 'Envelope B6', 1760, 1250, DMPAPER_ENV_B6); + Add('Envelope 110 x 230 mm', 'Envelope 110', 1100, 2300, DMPAPER_ENV_ITALY); + Add('Envelope Monarch 3 7/8 x 7 1/2 in', 'Envelope Monarch', InchToLoMetric(3 + 7 / 8), InchToLoMetric(7.5), DMPAPER_ENV_MONARCH); + Add('6 3/4 Envelope 3 5/8 x 6 1/2 in', '6 3/4 Envelope', InchToLoMetric(3 + 5 / 8), InchToLoMetric(6.5), DMPAPER_ENV_PERSONAL); + Add('US Std Fanfold 14 7/8 x 11 in', 'US Std Fanfold', InchToLoMetric(14 + 7 / 8), InchToLoMetric(11), DMPAPER_FANFOLD_US); + Add('German Std Fanfold 8 1/2 x 12 in', 'German Std Fanfold', InchToLoMetric(8.5), InchToLoMetric(12), DMPAPER_FANFOLD_STD_GERMAN); + Add('German Legal Fanfold 8 1/2 x 13 in', 'German Legal Fanfold', InchToLoMetric(8.5), InchToLoMetric(13), DMPAPER_FANFOLD_LGL_GERMAN); + Add('B4 (ISO) 250 x 353 mm', 'B4 (ISO)', 2500, 3530, DMPAPER_ISO_B4); + Add('Japanese Postcard 100 x 148 mm', 'Japanese Postcard', 1000, 1480, DMPAPER_JAPANESE_POSTCARD); + Add('9 x 11 in', '9 x 11 in', InchToLoMetric(90), InchToLoMetric(110), DMPAPER_9X11); + Add('10 x 11 in', '10 x 11 in', InchToLoMetric(10), InchToLoMetric(11), DMPAPER_10X11); + Add('15 x 11 in', '15 x 11 in', InchToLoMetric(15), InchToLoMetric(11), DMPAPER_15X11); + Add('Envelope Invite 220 x 220 mm', 'Envelope Invite', 2200, 2200, DMPAPER_ENV_INVITE); +// DMPAPER_RESERVED_48 = 48; { RESERVED--DO NOT USE } +// DMPAPER_RESERVED_49 = 49; { RESERVED--DO NOT USE } + Add('Letter Extra 9 \275 x 12 in', 'Legal Extra', InchToLoMetric(9 + 1 / 275), InchToLoMetric(12), DMPAPER_LETTER_EXTRA); + Add('Legal Extra 9 \275 x 15 in', 'Legal Extra', InchToLoMetric(9 + 1 / 275), InchToLoMetric(15), DMPAPER_LEGAL_EXTRA); + Add('Tabloid Extra 11.69 x 18 in', 'Tabloid Extra', InchToLoMetric(11.69), InchToLoMetric(18), DMPAPER_TABLOID_EXTRA); + Add('A4 Extra 9.27 x 12.69 in', 'A4 Extra', InchToLoMetric(9.27), InchToLoMetric(12.69), DMPAPER_A4_EXTRA); + Add('Letter Transverse 8 \275 x 11 in', 'Letter Transverse', InchToLoMetric(8 + 1 / 275), InchToLoMetric(11), DMPAPER_LETTER_TRANSVERSE); + Add('A4 Transverse 210 x 297 mm', 'A4 Transverse', 2100, 2970, DMPAPER_LETTER_EXTRA_TRANSVERSE); + Add('Letter Extra Transverse 9\275 x 12 in', 'Letter Extra Transverse', InchToLoMetric(9 + 1 / 275), InchToLoMetric(12), DMPAPER_LETTER_EXTRA_TRANSVERSE); + Add('SuperASuperAA4 227 x 356 mm', 'SuperASuperAA4', 2270, 3560, DMPAPER_A_PLUS); + Add('SuperBSuperBA3 305 x 487 mm', 'SuperBSuperBA3', 3050, 4870, DMPAPER_B_PLUS); + Add('Letter Plus 8.5 x 12.69 in', 'Letter Plus', InchToLoMetric(8.5), InchToLoMetric(12.69), DMPAPER_LETTER_PLUS); + Add('A4 Plus 210 x 330 mm', 'A4 Plus', 2100, 3300, DMPAPER_A4_PLUS); + Add('A5 Transverse 148 x 210 mm', 'A5 Transverse', 1480, 2100, DMPAPER_A5_TRANSVERSE); + Add('B5 (JIS) Transverse 182 x 257 mm', 'B5 (JIS) Transverse', 1820, 2570, DMPAPER_B5_TRANSVERSE); + Add('A3 Extra 322 x 445 mm', 'A3 Extra', 3220, 4450, DMPAPER_A3_EXTRA); + Add('A5 Extra 174 x 235 mm', 'A5 Extra', 1740, 2350, DMPAPER_A5_EXTRA); + Add('B5 (ISO) Extra 201 x 276 mm', 'B5 (ISO) Extra', 2010, 2760, DMPAPER_B5_EXTRA); + Add('A2 420 x 594 mm', 'A2', 4200, 5940, DMPAPER_A2); + Add('A3 Transverse 297 x 420 mm', 'A3 Transverse', 2970, 4200, DMPAPER_A3_TRANSVERSE); + Add('A3 Extra Transverse 322 x 445 mm', 'A3 Extra Transverse', 3220, 4450, DMPAPER_A3_EXTRA_TRANSVERSE); + + if Win32MajorVersion >= 5 then + begin + Add('Japanese Double Postcard 200 x 148 mm', 'Japanese Double Postcard', 2000, 148, DMPAPER_DBL_JAPANESE_POSTCARD); + Add('A6 105 x 148 mm', 'A6', 1050, 1480, DMPAPER_A6); + // Add('Japanese Envelope Kaku #2', 'Japanese Envelope Kaku #2', 0, 0, DMPAPER_JENV_KAKU2); + // Add('Japanese Envelope Kaku #3', 'Japanese Envelope Kaku #3', 0, 0, DMPAPER_JENV_KAKU3); + // Add('Japanese Envelope Chou #3', 'Japanese Envelope Kaku #3', 0, 0, DMPAPER_JENV_CHOU3); + // Add('Japanese Envelope Chou #4', 'Japanese Envelope Kaku #4', 0, 0, DMPAPER_JENV_CHOU4); + Add('Letter Rotated 11 x 8 1/2 11 in', 'Letter Rotated', InchToLoMetric(11), InchToLoMetric(8.5), DMPAPER_LETTER_ROTATED); + Add('A3 Rotated 420 x 297 mm', 'A3 Rotated', 4200, 2970, DMPAPER_A3_ROTATED); + Add('A4 Rotated 297 x 210 mm', 'A4 Rotated', 2970, 2100, DMPAPER_A4_ROTATED); + Add('A5 Rotated 210 x 148 mm', 'A5 Rotated', 2100, 1480, DMPAPER_A5_ROTATED); + Add('B4 (JIS) Rotated 364 x 257 mm', 'B4 (JIS) Rotated', 3640, 2570, DMPAPER_B4_JIS_ROTATED); + Add('B5 (JIS) Rotated 257 x 182 mm', 'B5 (JIS) Rotated', 2570, 1820, DMPAPER_B5_JIS_ROTATED); + Add('Japanese Postcard Rotated 148 x 100 mm', 'Japanese Postcard Rotated', 1480, 1000, DMPAPER_JAPANESE_POSTCARD_ROTATED); + Add('A6 Rotated 148 x 105 mm', 'A6 Rotated', 1480, 1050, DMPAPER_A6_ROTATED); + // Add('Japanese Envelope Kaku #2 Rotated', 'Japanese Envelope Kaku #2 Rotated', 0, 0, DMPAPER_JENV_KAKU2_ROTATED); + // Add('Japanese Envelope Kaku #3 Rotated', 'Japanese Envelope Kaku #4 Rotated', 0, 0, DMPAPER_JENV_KAKU3_ROTATED); + // Add('Japanese Envelope Chou #3 Rotated', 'Japanese Envelope Chou #3 Rotated', 0, 0, DMPAPER_JENV_CHOU3_ROTATED); + // Add('Japanese Envelope Chow #4 Rotated', 'Japanese Envelope Chou #4 Rotated', 0, 0, DMPAPER_JENV_CHOU4_ROTATED); + Add('B6 (JIS) 128 x 182 mm', 'B6 (JIS)', 1280, 1820, DMPAPER_B6_JIS); + Add('B6 (JIS) Rotated 182 x 128 mm', 'B6 (JIS) Rotated', 1820, 1280, DMPAPER_B6_JIS_ROTATED); + Add('12X11 12 x 11 in', '12X11', InchToLoMetric(12), InchToLoMetric(11), DMPAPER_12X11); + // Add('Japanese Envelope You #4', 'Japanese Envelope You #4', 0, 0, DMPAPER_JENV_YOU4); + // Add('Japanese Envelope You #4 Rotated', 'Japanese Envelope You #4 Rotated', 0, 0, DMPAPER_JENV_YOU4_ROTATED); + Add('PRC 16K 146 x 215 mm', 'PRC 16K', 1460, 2150, DMPAPER_P16K); + Add('PRC 32K 97 x 151 mm', 'PRC 32K', 970, 1510, DMPAPER_P32K); + Add('PRC 32K(Big) 97 x 151 mm', 'PRC 32K(Big)', 970, 1510, DMPAPER_P32KBIG); + Add('PRC Envelope #1 102 x 165 mm', 'PRC Envelope #1', 1020, 1650, DMPAPER_PENV_1); + Add('PRC Envelope #2 102 x 176 mm', 'PRC Envelope #2', 1020, 1760, DMPAPER_PENV_2); + Add('PRC Envelope #3 125 x 176 mm', 'PRC Envelope #3', 1250, 1760, DMPAPER_PENV_3); + Add('PRC Envelope #4 110 x 208 mm', 'PRC Envelope #4', 1100, 2080, DMPAPER_PENV_4); + Add('PRC Envelope #5 110 x 220 mm', 'PRC Envelope #5', 2190, 2200, DMPAPER_PENV_5); + Add('PRC Envelope #6 120 x 230 mm', 'PRC Envelope #6', 1200, 2300, DMPAPER_PENV_6); + Add('PRC Envelope #7 160 x 230 mm', 'PRC Envelope #7', 1600, 2300, DMPAPER_PENV_7); + Add('PRC Envelope #8 120 x 309 mm', 'PRC Envelope #8', 1200, 3090, DMPAPER_PENV_8); + Add('PRC Envelope #9 229 x 324 mm', 'PRC Envelope #9', 2290, 3240, DMPAPER_PENV_9); + Add('PRC Envelope #10 324 x 458 mm', 'PRC Envelope #10', 3240, 4580, DMPAPER_PENV_10); + Add('PRC 16K Rotated 146 x 215 mm', 'PRC 16K Rotated', 1460, 2150, DMPAPER_P16K_ROTATED); + Add('PRC 32K Rotated 97 x 151 mm', 'PRC 32K Rotated', 970, 1510, DMPAPER_P32K_ROTATED); + Add('PRC 32K(Big) Rotated 97 x 151 mm', 'PRC 32K(Big) Rotated', 970, 1510, DMPAPER_P32KBIG_ROTATED); + Add('PRC Envelope #1 Rotated 165 x 102 mm', 'PRC Envelope #1 Rotated', 1650, 1020, DMPAPER_PENV_1_ROTATED); + Add('PRC Envelope #2 Rotated 176 x 102 mm', 'PRC Envelope #2 Rotated', 1760, 1020, DMPAPER_PENV_2_ROTATED); + Add('PRC Envelope #3 Rotated 176 x 125 mm', 'PRC Envelope #3 Rotated', 1760, 1250, DMPAPER_PENV_3_ROTATED); + Add('PRC Envelope #4 Rotated 208 x 110 mm', 'PRC Envelope #4 Rotated', 2080, 1100, DMPAPER_PENV_4_ROTATED); + Add('PRC Envelope #5 Rotated 220 x 110 mm', 'PRC Envelope #5 Rotated', 2200, 2190, DMPAPER_PENV_5_ROTATED); + Add('PRC Envelope #6 Rotated 230 x 120 mm', 'PRC Envelope #6 Rotated', 2300, 1200, DMPAPER_PENV_6_ROTATED); + Add('PRC Envelope #7 Rotated 230 x 160 mm', 'PRC Envelope #7 Rotated', 2300, 1600, DMPAPER_PENV_7_ROTATED); + Add('PRC Envelope #8 Rotated 309 x 120 mm', 'PRC Envelope #8 Rotated', 3090, 1200, DMPAPER_PENV_8_ROTATED); + Add('PRC Envelope #9 Rotated 324 x 229 mm', 'PRC Envelope #9 Rotated', 3240, 2290, DMPAPER_PENV_9_ROTATED); + Add('PRC Envelope #10 Rotated 458 x 324 mm', 'PRC Envelope #10 Rotated', 4580, 3240, DMPAPER_PENV_10_ROTATED); + end; + Add('Custom', 'Custom', 0, 0, DMPAPER_USER); +end; + +function TdxPapers.GetCount: Integer; +begin + Result := FPapers.Count; +end; + +function TdxPapers.GetPaper(Index: Integer): TdxPaper; +begin + Result := TdxPaper(FPapers[Index]); +end; + +{ TdxBin } + +constructor TdxBin.Create(AValue: Integer; const AName: string); +begin + inherited Create; + FValue := AValue; + FName := AName; +end; + +procedure TdxBin.Assign(Source: TPersistent); +begin + if Source is TdxBin then + with TdxBin(Source) do + begin + Self.FName := Name; + Self.FValue := Value; + end + else + inherited; +end; + +{ TdxBins } + +constructor TdxBins.Create; +begin + inherited Create; + FBins := TList.Create; + Refresh; +end; + +destructor TdxBins.Destroy; +begin + Clear; + FreeAndNil(FBins); + inherited; +end; + +procedure TdxBins.Assign(Source: TPersistent); +var + I: Integer; +begin + if (Source = nil) or (Source is TdxBins) then + with TdxBins(Source) do + begin + Self.Clear; + if Source <> nil then + for I := 0 to Count - 1 do + with Bins[I] do + Self.FBins.Add(TdxBin.Create(Value, Name)); + end + else + inherited; +end; + +procedure TdxBins.Clear; +begin + while Count > 0 do Delete(Count - 1); +end; + +procedure TdxBins.Delete(Index: Integer); +begin + Bins[Index].Free; + FBins.Delete(Index); +end; + +function TdxBins.FindByName(const AName: string): Integer; +begin + for Result := 0 to Count - 1 do + if dxSameText(Bins[Result].Name, AName) then + Exit; + Result := -1; +end; + +function TdxBins.FindByValue(AValue: Integer): Integer; +begin + for Result := 0 to Count - 1 do + if Bins[Result].Value = AValue then + Exit; + Result := -1; +end; + +function TdxBins.IndexOf(ABin: TdxBin): Integer; +begin + Result := FBins.IndexOf(ABin); +end; + +procedure TdxBins.Refresh; +begin + Clear; + AddBins; +end; + +procedure TdxBins.AddBins; + + procedure Add(AValue: Integer; const AName: string); + begin + FBins.Add(TdxBin.Create(AValue, AName)); + end; + +begin + Add(DMBIN_UPPER, 'DMBIN_UPPER'); // 1 +// Add(DMBIN_ONLYONE, 'DMBIN_ONLYONE'); // 1 + Add(DMBIN_LOWER, 'DMBIN_LOWER'); // 2 + Add(DMBIN_MIDDLE, 'DMBIN_MIDDLE'); // 3 + Add(DMBIN_MANUAL, 'DMBIN_MANUAL'); // 4 + Add(DMBIN_ENVELOPE, 'DMBIN_ENVELOPE'); // 5 + Add(DMBIN_ENVMANUAL, 'DMBIN_ENVMANUAL'); // 6 + Add(DMBIN_AUTO, 'DMBIN_AUTO'); // 7 + Add(DMBIN_TRACTOR, 'DMBIN_TRACTOR'); // 8 + Add(DMBIN_SMALLFMT, 'DMBIN_SMALLFMT'); // 9 + Add(DMBIN_LARGEFMT, 'DMBIN_LARGEFMT'); // 10 + Add(DMBIN_LARGECAPACITY, 'DMBIN_LARGECAPACITY'); // 11 + Add(DMBIN_CASSETTE, 'DMBIN_CASSETTE'); // 14 + Add(DMBIN_FORMSOURCE, 'DMBIN_FORMSOURCE'); // 15 + Add(DMBIN_USER, 'DMBIN_USER'); // $100 +end; + +function TdxBins.GetBin(Index: Integer): TdxBin; +begin + Result := TdxBin(FBins[Index]); +end; + +function TdxBins.GetCount: Integer; +begin + Result := FBins.Count; +end; + +initialization + +finalization + FreeAndNil(FBins); + FreeAndNil(FPapers); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPS.dcr b/official/x.35/ExpressPrinting System/Sources/dxPS.dcr new file mode 100644 index 00000000..f2521142 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Sources/dxPS.dcr differ diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSAutoHFTextMnuBld.pas b/official/x.35/ExpressPrinting System/Sources/dxPSAutoHFTextMnuBld.pas new file mode 100644 index 00000000..fb348911 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSAutoHFTextMnuBld.pas @@ -0,0 +1,219 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire coVisntents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSAutoHFTextMnuBld; + +interface + +{$I cxVer.inc} + +uses + Classes, cxClasses, dxBase, dxPSSngltn, dxPgsDlg; + +type + TAbstractdxPSAutoHFTextMenuBuilder = class + public + constructor Create; virtual; + procedure BuildAutoHFTextEntriesMenu(ARootItem: TObject; AData: Pointer; + AIncludeSetupAutoHFTextEntriesItem: Boolean; AAutoHFTextEntries: TStrings; + AOnHFTextEntriesClick, AOnSetupHFTextEntriesClick: TNotifyEvent); virtual; abstract; + class function ExtractAutoHFTextEntryIndexFromObj(Obj: TObject): Integer; virtual; + end; + + TdxPSAutoHFTextMenuBuilderClass = class of TAbstractdxPSAutoHFTextMenuBuilder; + + TdxStandardPSAutoHFTextMenuBuilder = class(TAbstractdxPSAutoHFTextMenuBuilder) + public + procedure BuildAutoHFTextEntriesMenu(ARootItem: TObject; AData: Pointer; + AIncludeSetupAutoHFTextEntriesItem: Boolean; AAutoHFTextEntries: TStrings; + AOnHFTextEntriesClick, AOnSetupHFTextEntriesClick: TNotifyEvent); override; + class function ExtractAutoHFTextEntryIndexFromObj(Obj: TObject): Integer; override; + end; + + TdxPSAutoHFTextMenuBuilderFactory = class(TBasedxPSSingleton) + private + FBuilders: TdxClassList; + function GetActiveBuilder: TdxPSAutoHFTextMenuBuilderClass; + function GetBuilder(Index: Integer): TdxPSAutoHFTextMenuBuilderClass; + function GetCount: Integer; + protected + procedure FinalizeInstance; override; + procedure InitializeInstance; override; + public + class function Instance: TdxPSAutoHFTextMenuBuilderFactory; reintroduce; overload; + procedure RegisterBuilder(ABuilder: TdxPSAutoHFTextMenuBuilderClass); + procedure UnregisterBuilder(ABuilder: TdxPSAutoHFTextMenuBuilderClass); + + property ActiveBuilder: TdxPSAutoHFTextMenuBuilderClass read GetActiveBuilder; + property Builders[Index: Integer]: TdxPSAutoHFTextMenuBuilderClass read GetBuilder; + property Count: Integer read GetCount; + end; + +function dxPSAutoHFTextMenuBuilderFactory: TdxPSAutoHFTextMenuBuilderFactory; + +implementation + +uses + Menus, SysUtils, dxPSUtl, dxPSRes; + +function dxPSAutoHFTextMenuBuilderFactory: TdxPSAutoHFTextMenuBuilderFactory; +begin + Result := TdxPSAutoHFTextMenuBuilderFactory.Instance; +end; + +{ TdxPSAutoHFTextMenuBuilderFactory } + +class function TdxPSAutoHFTextMenuBuilderFactory.Instance: TdxPSAutoHFTextMenuBuilderFactory; +begin + Result := inherited Instance as TdxPSAutoHFTextMenuBuilderFactory; +end; + +procedure TdxPSAutoHFTextMenuBuilderFactory.RegisterBuilder(ABuilder: TdxPSAutoHFTextMenuBuilderClass); +begin + if ABuilder <> nil then FBuilders.Add(ABuilder); +end; + +procedure TdxPSAutoHFTextMenuBuilderFactory.UnregisterBuilder(ABuilder: TdxPSAutoHFTextMenuBuilderClass); +begin + FBuilders.Remove(ABuilder); +end; + +procedure TdxPSAutoHFTextMenuBuilderFactory.FinalizeInstance; +begin + FreeAndNil(FBuilders); + inherited; +end; + +procedure TdxPSAutoHFTextMenuBuilderFactory.InitializeInstance; +begin + inherited; + FBuilders := TdxClassList.Create; +end; + +function TdxPSAutoHFTextMenuBuilderFactory.GetActiveBuilder: TdxPSAutoHFTextMenuBuilderClass; +begin + if Count <> 0 then + Result := TdxPSAutoHFTextMenuBuilderClass(Builders[Count - 1]) + else + Result := TdxStandardPSAutoHFTextMenuBuilder; +end; + +function TdxPSAutoHFTextMenuBuilderFactory.GetBuilder(Index: Integer): TdxPSAutoHFTextMenuBuilderClass; +begin + Result := TdxPSAutoHFTextMenuBuilderClass(FBuilders[Index]); +end; + +function TdxPSAutoHFTextMenuBuilderFactory.GetCount: Integer; +begin + Result := FBuilders.Count; +end; + +{ TAbstractdxPSAutoHFTextMenuBuilder } + +constructor TAbstractdxPSAutoHFTextMenuBuilder.Create; +begin + inherited Create; +end; + +class function TAbstractdxPSAutoHFTextMenuBuilder.ExtractAutoHFTextEntryIndexFromObj(Obj: TObject): Integer; +begin + Result := 0; +end; + +{ TdxStandardPSAutoHFTextMenuBuilder } + +procedure TdxStandardPSAutoHFTextMenuBuilder.BuildAutoHFTextEntriesMenu(ARootItem: TObject; + AData: Pointer; AIncludeSetupAutoHFTextEntriesItem: Boolean; + AAutoHFTextEntries: TStrings; AOnHFTextEntriesClick, AOnSetupHFTextEntriesClick: TNotifyEvent); + + procedure AddMenuItem(AParent: TMenuItem; AIndex: Integer); + var + MenuItem: TMenuItem; + begin + MenuItem := TMenuItem.Create(AParent); + with MenuItem do + begin + Caption := AAutoHFTextEntries[AIndex]; + Tag := MakeTTag(AIndex); + OnClick := AOnHFTextEntriesClick; + end; + AParent.Add(MenuItem); + end; + + procedure ClearMenuItems(AMenuItem: TMenuItem); + var + CurItem: TMenuItem; + begin + with AMenuItem do + while Count > 0 do + begin + CurItem := Items[Count - 1]; + Remove(CurItem); + CurItem.Free; + end; + end; + +var + MenuItem: TMenuItem; + I: Integer; + MI: TMenuItem; +begin + if not (ARootItem is TMenuItem) then Exit; + MenuItem := TMenuItem(ARootItem); + ClearMenuItems(MenuItem); + + for I := 0 to AAutoHFTextEntries.Count - 1 do + AddMenuItem(MenuItem, I); + + if AIncludeSetupAutoHFTextEntriesItem then + begin + if MenuItem.Count > 0 then MenuItem.Add(NewLine); + + MI := TMenuItem.Create(MenuItem); + MI.Caption := cxGetResourceString(@sdxMenuInsertEditAutoTextEntries); + MI.OnClick := AOnSetupHFTextEntriesClick; + MenuItem.Add(MI); + end; +end; + +class function TdxStandardPSAutoHFTextMenuBuilder.ExtractAutoHFTextEntryIndexFromObj(Obj: TObject): Integer; +begin + Result := TTagToInt(TMenuItem(Obj).Tag); +end; + +initialization + dxPSAutoHFTextMenuBuilderFactory.RegisterBuilder(TdxStandardPSAutoHFTextMenuBuilder); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSAutoRELnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSAutoRELnk.pas new file mode 100644 index 00000000..15dce50c --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSAutoRELnk.pas @@ -0,0 +1,189 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSAutoRELnk; + +interface + +{$I cxVer.inc} + +uses + Classes, Windows, Graphics, Controls, ARichEd, dxPSCore, dxPSContainerLnk, + dxPSRELnk; + +type + TdxPSdxCustomAutoRichEditProducer = class(TdxPSContainerCustomWinControlProducer) + protected + function CreateImage: TGraphic; virtual; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + function ObjectExpandHeight: Boolean; override; + public + function Control: TCustomAutoRichEdit; reintroduce; overload; + class function ControlClass: TControlClass; override; + + function ProducingObjectFriendlyName: string; override; + end; + + TdxAutoRichEditReportLink = class(TAbstractdxRichEditReportLink) + private + function GetAutoRichEdit: TAutoRichEdit; + protected + function GetRichEditHandle: HWND; override; + public + constructor Create(AOwner: TComponent); override; + property AutoRichEdit: TAutoRichEdit read GetAutoRichEdit; + end; + +implementation + +type + TCustomAutoRichEditAccess = class(TCustomAutoRichEdit); + +{ TdxPSdxCustomAutoRichEditProducer } + +function TdxPSdxCustomAutoRichEditProducer.Control: TCustomAutoRichEdit; +begin + Result := inherited Control as TCustomAutoRichEdit; +end; + +class function TdxPSdxCustomAutoRichEditProducer.ControlClass: TControlClass; +begin + Result := TCustomAutoRichEdit; +end; + +function TdxPSdxCustomAutoRichEditProducer.ProducingObjectFriendlyName: string; +begin + Result := ''; + if not IsDesigning and (TCustomAutoRichEditAccess(Control).Text <> '') then + Result := dxPSContainerLnk.dxPSMakeFriendlyNameFromStrings(TCustomAutoRichEditAccess(Control).Lines); + if Result = '' then + Result := inherited ProducingObjectFriendlyName; +end; + +function TdxPSdxCustomAutoRichEditProducer.CreateImage: TGraphic; + + function GetMargins: TRect; + begin + Result := Rect(dxTextSpace, dxTextSpace, dxTextSpace, dxTextSpace); + end; + + function GetMaxHeight: Integer; + begin + if Definition.OptionsPlace.ExpandHeight then + Result := -1 + else + Result := Control.Height; + end; + +begin + Result := GetRichEditAsGraphic(Control.Handle, TCustomAutoRichEditAccess(Control).Color, + GetMargins, TMetafile, Control.Width, -1, GetMaxHeight, DC); +end; + +procedure TdxPSdxCustomAutoRichEditProducer.InitializeItem(AnItem: TdxReportVisualItem); +var + Graphic: TGraphic; +begin + inherited; + with TdxReportCellGraphic(AnItem) do + begin + BorderClass := TdxPSCellSunkenBorder; + CellSides := BorderStyleMap[TCustomAutoRichEditAccess(Control).BorderStyle]; + Color := TCustomAutoRichEditAccess(Control).Color; + Graphic := Self.CreateImage; + try + Image := Graphic; + finally + Graphic.Free; + end; + Transparent := False; + end; +end; + +function TdxPSdxCustomAutoRichEditProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellGraphic; +end; + +function TdxPSdxCustomAutoRichEditProducer.ObjectExpandHeight: Boolean; +begin + Result := False; +end; + +{ TdxAutoRichEditReportLink } + +constructor TdxAutoRichEditReportLink.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + RichEditVersion := 2; + LinkModified(False); +end; + +function TdxAutoRichEditReportLink.GetAutoRichEdit: TAutoRichEdit; +begin + Result := inherited Component as TAutoRichEdit; +end; + +function TdxAutoRichEditReportLink.GetRichEditHandle: HWND; +begin + if AutoRichEdit <> nil then + Result := AutoRichEdit.Handle + else + Result := 0; +end; + +{ Assistants } + +procedure RegisterProducers; +begin + TdxPSdxCustomAutoRichEditProducer.Register; +end; + +procedure UnregisterProducers; +begin + TdxPSdxCustomAutoRichEditProducer.Unregister; +end; + +initialization + dxPSRegisterReportLink(TdxAutoRichEditReportLink, TAutoRichEdit, nil); + RegisterProducers; + +finalization + UnregisterProducers; + dxPSUnregisterReportLink(TdxAutoRichEditReportLink, TAutoRichEdit, nil); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSBaseGridLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSBaseGridLnk.pas new file mode 100644 index 00000000..e4878f41 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSBaseGridLnk.pas @@ -0,0 +1,2320 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSBaseGridLnk; + +interface + +{$I cxVer.inc} + +{$IFDEF CBUILDER5} + (*$HPPEMIT '#define HDC unsigned'*) +{$ELSE} + (*$HPPEMIT '#define HDC int'*) +{$ENDIF} + +uses + Classes, Windows, Graphics, Controls, StdCtrls, ImgList, dxPSCore, dxPSGlbl, + dxPrnPg, dxPSRes, dxBase, dxPSFillPatterns; + +type + {$IFDEF BCB} + {$DEFINE DefineArrays} + {$ENDIF} + + {$IFNDEF DELPHI6} + {$DEFINE DefineArrays} + {$ENDIF} + + {$IFDEF DefineArrays} + IntegerArray = array[0..$EFFFFFF] of Integer; + PIntegerArray = ^IntegerArray; + TBoundArray = array of Integer; + {$ENDIF} + + TAbstractdxGridReportLink = class; + TdxPSCustomGridCellDataMapClass = class of TdxPSCustomGridCellDataMap; + TdxPSCustomGridCellDataMap = class; + + { DataMaps } + + TdxPSGridCellDataMaps = class(TdxCustomClassMaps) + private + function GetMapClass(ADataItem: TAbstractdxReportCellData): TdxPSCustomGridCellDataMapClass; + public + class function Instance: TdxPSGridCellDataMaps; reintroduce; overload; + procedure InitializeCellData(ACol, ARow: Integer; ADataItem: TAbstractdxReportCellData; + AReportLink: TAbstractdxGridReportLink); + property MapClasses[ADataItem: TAbstractdxReportCellData]: TdxPSCustomGridCellDataMapClass read GetMapClass; default; + end; + + TdxPSCustomGridCellDataMap = class(TdxCustomClassMapItem) + protected + class procedure InitializeCellData(ACol, ARow: Integer; ADataItem: TAbstractdxReportCellData; + AReportLink: TAbstractdxGridReportLink); virtual; + class function DataClass: TdxReportCellDataClass; virtual; + public + class function PairClass: TClass; override; + + class procedure Register; + class procedure Unregister; + end; + + TdxPSTextGridCellDataMap = class(TdxPSCustomGridCellDataMap) + protected + class procedure InitializeCellData(ACol, ARow: Integer; ADataItem: TAbstractdxReportCellData; + AReportLink: TAbstractdxGridReportLink); override; + class function DataClass: TdxReportCellDataClass; override; + end; + + TdxPSImageGridCellDataMap = class(TdxPSTextGridCellDataMap) + protected + class procedure InitializeCellData(ACol, ARow: Integer; ADataItem: TAbstractdxReportCellData; + AReportLink: TAbstractdxGridReportLink); override; + class function DataClass: TdxReportCellDataClass; override; + end; + + { ReportLink } + + TdxGridDrawMode = (gdmStrict, gdmOddEven, gdmChess, gdmBorrowSource); + + TdxCustomGridReportLinkEvent = procedure(Sender: TAbstractdxGridReportLink) of object; + + TdxCustomGridReportLinkInitializeItemEvent = procedure (Sender: TAbstractdxGridReportLink; + ACol, ARow: Integer; ADataItem: TAbstractdxReportCellData) of object; + + TAbstractdxGridReportLink = class(TBasedxReportLink) + private + FAutoWidth: Boolean; + FDelimitersHardVert: TList; + FDefaultFixedFont: TFont; + FDrawMode: TdxGridDrawMode; + FEffects3D: Boolean; + FEndEllipsis: Boolean; + FEvenColor: TColor; + FEvenFont: TFont; + FFixedColor: TColor; + FFixedFont: TFont; + FFixedTransparent: Boolean; + FGridLineColor: TColor; + FIncludeFixed: Boolean; + FMultiline: Boolean; + FOnlySelected: Boolean; + FReportRows: TList; + FRowAutoHeight: Boolean; + FRowWidth: Integer; + FScreenDC: HDC; + FSoft3D: Boolean; + FSupportedCustomDraw: Boolean; + FUseCustomPageBreaks: Boolean; + FOnGetCustomPageBreaks: TdxCustomGridReportLinkEvent; + FOnInitializeItem: TdxCustomGridReportLinkInitializeItemEvent; + function GetActualFirstCol: Integer; + function GetActualFirstRow: Integer; + function GetActualLastCol: Integer; + function GetActualLastRow: Integer; + function GetAvailableSiteHeight: Integer; + function GetAvailableSiteWidth: Integer; + function GetColumnWidth(Index: Integer): Integer; + function GetOddColor: TColor; + function GetOddFont: TFont; + function GetReportRow(Index: Integer): TdxReportCell; + function GetReportRowByRow(Row: Integer): TdxReportCell; + function GetReportRowCount: Integer; + function GetRowHeight(ARow: Integer): Integer; + function GetRowWidth: Integer; + procedure SetAutoWidth(Value: Boolean); + procedure SetColumnWidth(Index: Integer; Value: Integer); + procedure SetEffects3D(Value: Boolean); + procedure SetEndEllipsis(Value: Boolean); + procedure SetEvenColor(Value: TColor); + procedure SetEvenFont(Value: TFont); + procedure SetFixedColor(Value: TColor); + procedure SetFixedFont(Value: TFont); + procedure SetFixedTransparent(Value: Boolean); + procedure SetGridLineColor(Value: TColor); + procedure SetIncludeFixed(Value: Boolean); + procedure SetMultiline(Value: Boolean); + procedure SetOddColor(Value: TColor); + procedure SetOddFont(Value: TFont); + procedure SetOnlySelected(Value: Boolean); + procedure SetRowAutoHeight(Value: Boolean); + procedure SetRowHeight(Index: Integer; Value: Integer); + procedure SetSoft3D(Value: Boolean); + procedure SetSupportedCustomDraw(Value: Boolean); + procedure SetUseCustomPageBreaks(Value: Boolean); + protected + FColumnWidths: array of Integer; + FCurrentCol: Integer; + FCurrentRow: Integer; + FEvenFontIndex: Integer; + FFixedFontIndex: Integer; + FRowHeights: array of Integer; + procedure ConstructReport(AReportCells: TdxReportCells); override; + procedure ConvertCoords; override; + function GetBreakPagesByHardDelimiters: Boolean; override; + function GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; override; + function GetUseHardVertDelimiters: Boolean; override; + procedure InternalRestoreDefaults; override; + function IsSupportedCustomDraw(AItem: TAbstractdxReportCellData): Boolean; override; + procedure MakeDelimiters(AReportCells: TdxReportCells; AHorzDelimiters, AVertDelimiters: TList); override; + procedure MakeHardDelimiters(AReportCells: TdxReportCells; AVertDelimiters: TList); override; + + procedure DoGetCustomPageBreaks; dynamic; + procedure DoInitializeItem(ACol, ARow: Integer; ADataItem: TAbstractdxReportCellData); dynamic; + + procedure AssignData(ACol, ARow: Integer; ADataItem: TAbstractdxReportCellData); virtual; + function CreateDataItem(AParent: TdxReportCell; ACol, ARow: Integer; const ABounds: TRect): TAbstractdxReportCellData; virtual; + function GetDataItemClass(ACol: Integer; ARow: Integer = 0): TdxReportCellDataClass; virtual; + + procedure CalculateColumnAutoWidths; virtual; + procedure CalculateColumnWidths; virtual; + procedure CalculateRowHeights(AReportCells: TdxReportCells); virtual; + function CalculateRowWidth: Integer; virtual; + function CanCalculateColumnAutoWidths: Boolean; virtual; + + function GetRowClass(ARow: Integer): TdxReportCellClass; virtual; + function GetRowParent(AReportCells: TdxReportCells; ARow: Integer): TdxReportCell; virtual; + procedure InitializeRow(AReportRow: TdxReportCell; ARow: Integer); virtual; + + function GetColCount: Integer; virtual; + function GetFixedColCount: Integer; virtual; + function GetFixedRowCount: Integer; virtual; + function GetRowCount: Integer; virtual; + + function GetActualColCount: Integer; virtual; + function GetActualColIndex(Col: Integer): Integer; virtual; + function GetActualRowCount: Integer; virtual; + function GetCellColor(ACol, ARow: Integer): TColor; virtual; + procedure GetCellColRow(AItem: TdxReportVisualItem; var ACol, ARow: Integer); + function GetCellContentBkColor(ACol, ARow: Integer): TColor; virtual; + function GetCellContentPattern(ACol, ARow: Integer): TdxPSFillPatternClass; virtual; + function GetCellEdge3DSoft(AItem: TAbstractdxReportCellData; ACol, ARow: Integer): Boolean; virtual; + function GetCellEdge3DStyle(AItem: TAbstractdxReportCellData; ACol, ARow: Integer): TdxCellEdgeStyle; virtual; + function GetCellEdgeMode(AItem: TAbstractdxReportCellData; ACol, ARow: Integer): TdxCellEdgeMode; virtual; + function GetCellFont(ACol, ARow: Integer): TFont; virtual; + function GetCellFontIndex(ACol, ARow: Integer): Integer; virtual; + function GetCellHasImage(ACol, ARow: Integer): Boolean; virtual; + function GetCellImage(ACol, ARow: Integer): TGraphic; virtual; + function GetCellImageIndex(ACol, ARow: Integer): Integer; virtual; + function GetCellImageLayout(ACol, ARow: Integer): TdxImageLayout; virtual; + function GetCellImageList(ACol, ARow: Integer): TCustomImageList; virtual; + function GetCellImageMakeSpaceForEmpty(ACol, ARow: Integer): Boolean; virtual; + function GetCellImageTransparent(ACol, ARow: Integer): Boolean; virtual; + function GetCellMultiline(ACol, ARow: Integer): Boolean; virtual; + function GetCellSides(ACol, ARow: Integer): TdxCellSides; virtual; + function GetCellText(ACol, ARow: Integer): string; virtual; abstract; + function GetCellTextAlignX(ACol, ARow: Integer): TdxTextAlignX; virtual; + function GetCellTextAlignY(ACol, ARow: Integer): TdxTextAlignY; virtual; + function GetCellTransparent(ACol, ARow: Integer): Boolean; virtual; + function GetColSortOrder(ACol: Integer): TdxCellSortOrder; virtual; + function GetEndEllipsis: Boolean; virtual; + function GetInternalRowHeight(Index: Integer): Integer; + function GetMinRowHeight(DC: HDC; AFont: TFont): Integer; virtual; + function GetMultiline: Boolean; virtual; + + procedure GetSelectedRange(ABeginCol, AEndCol, ABeginRow, AEndRow: PInteger); overload; virtual; + procedure GetSelectedRange(out ABeginCol, AEndCol, ABeginRow, AEndRow: Integer); overload; virtual; + function GetSelectedColCount: Integer; virtual; + function GetSelectedRowCount: Integer; virtual; + function GetSelectionRect: TRect; virtual; + + function GetSourceCellColor(ACol, ARow: Integer): TColor; virtual; + function GetSourceCellContentBkColor(ACol, ARow: Integer): TColor; virtual; + function GetSourceCellContentPattern(ACol, ARow: Integer): TdxPSFillPatternClass; virtual; + function GetSourceCellEdge3DSoft(ACol, ARow: Integer): Boolean; virtual; + function GetSourceCellEdge3DStyle(ACol, ARow: Integer): TdxCellEdgeStyle; virtual; + function GetSourceCellEdgeMode(ACol, ARow: Integer): TdxCellEdgeMode; virtual; + function GetSourceCellFont(ACol, ARow: Integer): TFont; virtual; + function GetSourceCellFontIndex(ACol, ARow: Integer): Integer; virtual; + function GetSourceCellMultiline(ACol, ARow: Integer): Boolean; virtual; + function GetSourceCellTextAlignX(ACol, ARow: Integer): TdxTextAlignX; virtual; + function GetSourceCellTextAlignY(ACol, ARow: Integer): TdxTextAlignY; virtual; + function GetSourceCellTransparent(ACol, ARow: Integer): Boolean; virtual; + function GetSourceColWidth(ACol: Integer): Integer; virtual; + function GetSourceRowHeight(ARow: Integer): Integer; virtual; + + function HasColumnHeaderImage(ACol: Integer): Boolean; virtual; + function HasSelection: Boolean; virtual; + function HasSelectionInCol(ACol: Integer): Boolean; virtual; + function HasSelectionInRow(ARow: Integer): Boolean; virtual; + function IsDrawBorder: Boolean; virtual; + function IsDrawFixedHorzLines: Boolean; virtual; + function IsDrawFixedVertLines: Boolean; virtual; + function IsDrawHorzLines: Boolean; virtual; + function IsDrawVertLines: Boolean; virtual; + function IsFixedCell(ACol, ARow: Integer): Boolean; virtual; + function IsFixedCol(ACol: Integer): Boolean; virtual; + function IsFixedRow(ARow: Integer): Boolean; virtual; + function IsFooterRow(ARow: Integer): Boolean; virtual; + function IsHeaderRow(ARow: Integer): Boolean; virtual; + function IsProcessedCell(ACol, ARow: Integer): Boolean; virtual; + function IsProcessedCol(ACol: Integer): Boolean; virtual; + function IsProcessedRow(ARow: Integer): Boolean; virtual; + function IsSelectedCell(ACol, ARow: Integer): Boolean; virtual; + function IsSelectedRow(ARow: Integer): Boolean; virtual; + + procedure NextCol; virtual; + procedure NextRow; virtual; + procedure SetDrawMode(Value: TdxGridDrawMode); virtual; + procedure SetupBoundsRect(ACell: TdxReportCell); + + procedure AddReportRow(ARow: TdxReportCell); + procedure AddVerticalHardDelimiter(ADelimiter: TdxReportCell); overload; + procedure AddVerticalHardDelimiter(ADelimiter: Integer); overload; + + procedure AfterConstruct(AReportCells: TdxReportCells); virtual; + procedure BeforeConstruct(AReportCells: TdxReportCells); virtual; + procedure PrepareConstruct(AReportCells: TdxReportCells); virtual; + procedure UnprepareConstruct(AReportCells: TdxReportCells); virtual; + + procedure InitializeDefaultFixedFont(AFont: TFont); virtual; + function IsFixedFontStored: Boolean; + + property ActualColIndexes[Col: Integer]: Integer read GetActualColIndex; + property ActualColCount: Integer read GetActualColCount; + property ActualFirstCol: Integer read GetActualFirstCol; + property ActualFirstRow: Integer read GetActualFirstRow; + property ActualLastCol: Integer read GetActualLastCol; + property ActualLastRow: Integer read GetActualLastRow; + property ActualRowCount: Integer read GetActualRowCount; + property AutoWidth: Boolean read FAutoWidth write SetAutoWidth default False; + property AvailableSiteHeight: Integer read GetAvailableSiteHeight; + property AvailableSiteWidth: Integer read GetAvailableSiteWidth; + property ColCount: Integer read GetColCount; + property ColumnWidths[Index: Integer]: Integer read GetColumnWidth write SetColumnWidth; + property DelimitersHardVert: TList read FDelimitersHardVert; + property DrawMode: TdxGridDrawMode read FDrawMode write SetDrawMode default gdmStrict; + property Effects3D: Boolean read FEffects3D write SetEffects3D default False; + property EndEllipsis: Boolean read GetEndEllipsis write SetEndEllipsis default False; + property EvenColor: TColor read FEvenColor write SetEvenColor default clWhite; + property EvenFont: TFont read FEvenFont write SetEvenFont stored IsFontStored; + property FixedColCount: Integer read GetFixedColCount; + property FixedColor: TColor read FFixedColor write SetFixedColor default clBtnFace; {dxDefaultFixedColor} + property FixedFont: TFont read FFixedFont write SetFixedFont stored IsFixedFontStored; + property FixedRowCount: Integer read GetFixedRowCount; + property FixedTransparent: Boolean read FFixedTransparent write SetFixedTransparent default False; + property GridLineColor: TColor read FGridLineColor write SetGridLineColor default clBlack; + property IncludeFixed: Boolean read FIncludeFixed write SetIncludeFixed default True; + property InternalRowHeights[Index: Integer]: Integer read GetInternalRowHeight; + property Multiline: Boolean read FMultiline write SetMultiline default False; + property OddColor: TColor read GetOddColor write SetOddColor stored IsFontStored default clWhite; + property OddFont: TFont read GetOddFont write SetOddFont stored IsFontStored; + property OnlySelected: Boolean read FOnlySelected write SetOnlySelected default False; + property ReportRowCount: Integer read GetReportRowCount; + property ReportRows[Index: Integer]: TdxReportCell read GetReportRow; + property ReportRowsByRow[ARow: Integer]: TdxReportCell read GetReportRowByRow; + property RowAutoHeight: Boolean read FRowAutoHeight write SetRowAutoHeight default False; + property RowCount: Integer read GetRowCount; + property RowHeights[Index: Integer]: Integer read GetRowHeight write SetRowHeight; + property RowWidth: Integer read GetRowWidth; + property ScreenDC: HDC read FScreenDC; + property SelectedColCount: Integer read GetSelectedColCount; + property SelectedRowCount: Integer read GetSelectedRowCount; + property SelectionRect: TRect read GetSelectionRect; + property Soft3D: Boolean read FSoft3D write SetSoft3D default True; + property SupportedCustomDraw: Boolean read FSupportedCustomDraw write SetSupportedCustomDraw default False; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + procedure AddPageBreak(ARow: Integer); overload; + procedure AddPageBreak(const ARows: array of Integer); overload; + procedure AddPageBreak(const ARows: array of Integer; AStartIndex, ACount: Integer); overload; + procedure AddPageBreak(ARows: PIntegerArray; ACount: Integer); overload; + procedure AddPageBreak(ARows: PIntegerArray; AStartIndex, ACount: Integer); overload; + procedure AddPageBreak(const ARows: TBoundArray); overload; + procedure AddPageBreak(const ARows: TBoundArray; AStartIndex, ACount: Integer); overload; + procedure AddPageBreak(ARows: TList); overload; // List of Integers -> Row Indexes + procedure AddPageBreak(ARows: TList; AStartIndex, ACount: Integer); overload; + + function DefaultFixedFont: TFont; virtual; + + property Color; + property Font; + property ScaleFonts; + property Transparent; + property UseCustomPageBreaks: Boolean read FUseCustomPageBreaks write SetUseCustomPageBreaks default False; + + property OnGetCustomPageBreaks: TdxCustomGridReportLinkEvent read FOnGetCustomPageBreaks write FOnGetCustomPageBreaks; + property OnInitializeItem: TdxCustomGridReportLinkInitializeItemEvent read FOnInitializeItem write FOnInitializeItem; + end; + +procedure dxPSDrawComboDrawModeItem(Control: TWinControl; Index: Integer; Rect: TRect; + State: TOwnerDrawState); +procedure dxPSDrawGridPreview(ACanvas: TCanvas; R: TRect; AReportLink: TAbstractdxGridReportLink; + AShowFixedColumn: Boolean = True; AShowFixedRow: Boolean = True); + +implementation + +uses + Forms, {$IFDEF DELPHI5} SysUtils, {$ENDIF} cxClasses, dxPSUtl, dxPSImgs; + +procedure dxPSDrawComboDrawModeItem(Control: TWinControl; Index: Integer; Rect: TRect; + State: TOwnerDrawState); +const + ImageIndexMap: array[TdxGridDrawMode] of Integer = (0, 1, 2, 3); +begin + with TComboBox(Control) do + dxPSUtl.dxDrawComboBoxItem(Canvas, Rect, Items[Index], + dxPSUtl.dxPSDrawModeImages, ImageIndexMap[TdxGridDrawMode(Index)], State); +end; + +function GetDesignerString(ACol, ARow: Integer): string; +const + sdxGridStrings: array[0..4, 0..6] of string = + (('7', '12', '27', '11', '11', '16', '84'), + ( '8', '6', '17', '12', '11', '16', '70'), + ('23', '32', '21', '15', '10', '26', '127'), + ('22', '12', '12', '32', '32', '12', '122'), + ('60', '62', '77', '70', '64', '70', '403')); +begin + if (ARow = 0) or (ACol = 0) then + begin + if ARow = 0 then + if ACol = 0 then + Result := '' + else + case ACol of + 1: Result := cxGetResourceString(@sdxEast); + 2: Result := cxGetResourceString(@sdxWest); + 3: Result := cxGetResourceString(@sdxSouth); + 4: Result := cxGetResourceString(@sdxNorth); + else + Result := cxGetResourceString(@sdxTotal); + end + else + case ARow of + 1: Result := cxGetResourceString(@sdxJanuaryShort); + 2: Result := cxGetResourceString(@sdxFebruaryShort); + 3: Result := cxGetResourceString(@sdxMarchShort); + 4: Result := cxGetResourceString(@sdxAprilShort); + 5: Result := cxGetResourceString(@sdxMayShort); + 6: Result := cxGetResourceString(@sdxJuneShort); + else + Result := cxGetResourceString(@sdxTotal); + end; + end + else + Result := sdxGridStrings[ACol - 1, ARow - 1]; +end; + +procedure dxPSDrawGridPreview(ACanvas: TCanvas; R: TRect; AReportLink: TAbstractdxGridReportLink; + AShowFixedColumn: Boolean = True; AShowFixedRow: Boolean = True); +const + PreviewDefaultColCount = 6; + PreviewDefaultRowCount = 8; + + function ColCount: Integer; + begin + Result := PreviewDefaultColCount - Ord(not AShowFixedColumn); + end; + + function RowCount: Integer; + begin + Result := PreviewDefaultRowCount - Ord(not AShowFixedRow); + end; + + function FixedColumnCount: Integer; + begin + Result := 1 - Ord(not AShowFixedColumn); + end; + + function FixedRowCount: Integer; + begin + Result := 1 - Ord(not AShowFixedRow); + end; + + function IsFixedCol(ACol: Integer): Boolean; + begin + Result := AShowFixedColumn and (ACol = 0); + end; + + function IsFixedRow(ARow: Integer): Boolean; + begin + Result := AShowFixedRow and (ARow = 0); + end; + + function IsFixedCell(ACol, ARow: Integer): Boolean; + begin + Result := IsFixedCol(ACol) or IsFixedRow(ARow); + end; + + procedure FrameRect(DC: HDC; var R: TRect; ABrush: HBRUSH; ASides: TdxCellSides); + var + R2: TRect; + begin + if csLeft in ASides then + begin + R2 := MakeRect(R.Left - 1, R.Top - 1, R.Left, R.Bottom); + FillRect(DC, R2, ABrush); + end; + + if csTop in ASides then + begin + R2 := MakeRect(R.Left - 1, R.Top - 1, R.Right, R.Top); + FillRect(DC, R2, ABrush); + end; + + if csRight in ASides then + begin + R2 := MakeRect(R.Right - 1, R.Top - 1, R.Right, R.Bottom); + FillRect(DC, R2, ABrush); + end; + + if csBottom in ASides then + begin + R2 := MakeRect(R.Left - 1, R.Bottom - 1, R.Right, R.Bottom); + FillRect(DC, R2, ABrush); + end; + + if csRight in ASides then Dec(R.Right); + if csBottom in ASides then Dec(R.Bottom); + end; + + function GetCellSides(ACol, ARow: Integer): TdxCellSides; + var + ABeginCol, AEndCol, ABeginRow, AEndRow: Integer; + begin + Result := csAll; + if not AReportLink.IsDrawBorder then + begin + if ACol = 0 then Exclude(Result, csLeft); + if ACol = ColCount - 1 then Exclude(Result, csRight); + if ARow = 0 then Exclude(Result, csTop); + if ARow = RowCount - 1 then Exclude(Result, csBottom); + end; + + if IsFixedCell(ACol, ARow) then + begin + if not AReportLink.IsDrawFixedHorzLines then + begin + if ARow > 0 then + Exclude(Result, csTop); + if IsFixedCol(ACol) then + begin + if ARow < RowCount - 1 then + Exclude(Result, csBottom) + end + else + if ARow < FixedRowCount - Byte(AReportLink.IsDrawHorzLines) then + Exclude(Result, csBottom); + end; + if not AReportLink.IsDrawFixedVertLines then + begin + if ACol > 0 then + Exclude(Result, csLeft); + if IsFixedRow(ARow) then + begin + if ACol < ColCount - 1 then + Exclude(Result, csRight) + end + else + if ACol < FixedColumnCount - Byte(AReportLink.IsDrawVertLines) then + Exclude(Result, csRight); + end; + end + else + begin + if not AReportLink.IsDrawHorzLines then + begin + ABeginRow := 0; + AEndRow := RowCount - 1; + if ARow < AEndRow then + if ARow > ABeginRow then + Result := Result - [csTop, csBottom] + else + Exclude(Result, csBottom) + else + if ARow > ABeginRow then + Exclude(Result, csTop); + end; + if not AReportLink.IsDrawVertLines then + begin + ABeginCol := 0; + AEndCol := ColCount - 1; + if ACol < AEndCol then + if ACol > ABeginCol then + Result := Result - [csLeft, csRight] + else + Exclude(Result, csRight) + else + if ACol > ABeginCol then + Exclude(Result, csLeft) + end; + end; + end; + + function GetCellFont(I, J: Integer): TFont; + begin + if IsFixedCell(I, J) then + Result := AReportLink.FixedFont + else + case AReportLink.DrawMode of + gdmStrict: + Result := AReportLink.Font; + gdmOddEven: + if Odd(J) then + Result := AReportLink.OddFont + else + Result := AReportLink.EvenFont; + else + if not Odd((I - FixedColumnCount) + (J - FixedRowCount)) then + Result := AReportLink.OddFont + else + Result := AReportLink.EvenFont; + end; + end; + + function GetCellColor(I, J: Integer): TColor; + begin + if IsFixedCell(I, J) then + Result := AReportLink.FixedColor + else + case AReportLink.DrawMode of + gdmStrict: + Result := AReportLink.Color; + gdmOddEven: + if Odd(J) then + Result := AReportLink.OddColor + else + Result := AReportLink.EvenColor; + else + if not Odd((I - FixedColumnCount) + (J - FixedRowCount)) then + Result := AReportLink.OddColor + else + Result := AReportLink.EvenColor; + end; + Result := ColorToRGB(Result); + end; + +var + R2: TRect; + DC: HDC; + I, J, W, H, OffsetX, OffsetY: Integer; + Sides: TdxCellSides; + Color: TColor; + Font: TFont; + FixedCell, IsTransparentCell: Boolean; + S: string; + PrevFont: HFONT; + PrevFontColor: COLORREF; + PreviewFont: TFont; + BorderBrush, Brush: HBRUSH; +begin + DC := ACanvas.Handle; + PrevFontColor := GetTextColor(DC); + PrevFont := GetCurrentObject(DC, OBJ_FONT); + PreviewFont := TFont.Create; + try + SetBkMode(DC, Windows.TRANSPARENT); + + InflateRect(R, -5, -5); + W := (R.Right - R.Left) div ColCount; + H := (R.Bottom - R.Top) div RowCount; + OffsetX := R.Left + (R.Right - R.Left - ColCount * W) div 2; + OffsetY := R.Top + (R.Bottom - R.Top - RowCount * H) div 2; + + BorderBrush := CreateSolidBrush(ColorToRGB(AReportLink.GridLineColor)); + + for I := 0 to ColCount - 1 do + for J := 0 to RowCount - 1 do + begin + R2 := MakeBounds(OffsetX + I * W, OffsetY + J * H, W, H); + Sides := GetCellSides(I, J); + Font := GetCellFont(I, J); + Color := GetCellColor(I, J); + FixedCell := IsFixedCell(I, J); + + FrameRect(DC, R2, BorderBrush, Sides); + if FixedCell and AReportLink.Effects3D then + begin + if (I = 0) and not AReportLink.IsDrawBorder then + Exclude(Sides, csTop); + if (J = 0) and not AReportLink.IsDrawBorder then + Exclude(Sides, csLeft); + if AReportLink.Soft3D then + Sides := Sides - [csRight, csBottom]; + Windows.DrawEdge(DC, R2, BDR_RAISEDINNER, Byte(Sides) or BF_ADJUST); + end; + + IsTransparentCell := (FixedCell and AReportLink.FixedTransparent) or + (not FixedCell and AReportLink.Transparent); + + if not IsTransparentCell then + begin + Brush := CreateSolidBrush(Color); + FillRect(DC, R2, Brush); + DeleteObject(Brush); + end; + + PreviewFont.Assign(Font); + PreviewFont.Size := 8; + SetTextColor(DC, ColorToRGB(PreviewFont.Color)); + SelectObject(DC, PreviewFont.Handle); + S := GetDesignerString(I + Ord(not AShowFixedColumn), J + Ord(not AShowFixedRow)); + ExtTextOut(DC, R2.Left + 2, R2.Top + 2, ETO_CLIPPED, @R2, PChar(S), Length(S), nil); + end; + + SetBkMode(DC, Windows.OPAQUE); + DeleteObject(BorderBrush); + finally + PreviewFont.Free; + end; + SelectObject(DC, PrevFont); + SetTextColor(DC, PrevFontColor); +end; + +{ TdxPSGridCellDataMaps } + +function dxPSGridCellDataMaps: TdxPSGridCellDataMaps; +begin + Result := TdxPSGridCellDataMaps.Instance; +end; + +class function TdxPSGridCellDataMaps.Instance: TdxPSGridCellDataMaps; +begin + Result := inherited Instance as TdxPSGridCellDataMaps; +end; + +procedure TdxPSGridCellDataMaps.InitializeCellData(ACol, ARow: Integer; ADataItem: TAbstractdxReportCellData; + AReportLink: TAbstractdxGridReportLink); +begin + MapClasses[ADataItem].InitializeCellData(ACol, ARow, ADataItem, AReportLink); +end; + +function TdxPSGridCellDataMaps.GetMapClass(ADataItem: TAbstractdxReportCellData): TdxPSCustomGridCellDataMapClass; +begin + Result := TdxPSCustomGridCellDataMapClass(PairClasses[ADataItem.ClassType]); +end; + +{ TdxPSCustomGridCellDataMap } + +class function TdxPSCustomGridCellDataMap.PairClass: TClass; +begin + Result := DataClass; +end; + +class procedure TdxPSCustomGridCellDataMap.Register; +begin + dxPSGridCellDataMaps.Register(Self); +end; + +class procedure TdxPSCustomGridCellDataMap.Unregister; +begin + dxPSGridCellDataMaps.Unregister(Self); +end; + +class function TdxPSCustomGridCellDataMap.DataClass: TdxReportCellDataClass; +begin + Result := TAbstractdxReportCellData; +end; + +class procedure TdxPSCustomGridCellDataMap.InitializeCellData(ACol, ARow: Integer; + ADataItem: TAbstractdxReportCellData; AReportLink: TAbstractdxGridReportLink); +begin + with ADataItem do + begin + Color := AReportLink.GetCellColor(ACol, ARow); + ContentBkColor := AReportLink.GetCellContentBkColor(ACol, ARow); + ContentPattern := AReportLink.GetCellContentPattern(ACol, ARow); + Transparent := AReportLink.GetCellTransparent(ACol, ARow); + + CellSides := AReportLink.GetCellSides(ACol, ARow); + Data := ACol + ARow * AReportLink.ColCount; + EdgeMode := AReportLink.GetCellEdgeMode(ADataItem, ACol, ARow); + Edge3DStyle := AReportLink.GetCellEdge3DStyle(ADataItem, ACol, ARow); + Edge3DSoft := AReportLink.GetCellEdge3DSoft(ADataItem, ACol, ARow); + FontIndex := AReportLink.GetCellFontIndex(ACol, ARow); + end; +end; + +{ TdxPSTextGridCellDataMap } + +class function TdxPSTextGridCellDataMap.DataClass: TdxReportCellDataClass; +begin + Result := TdxReportCellString; +end; + +class procedure TdxPSTextGridCellDataMap.InitializeCellData(ACol, ARow: Integer; + ADataItem: TAbstractdxReportCellData; AReportLink: TAbstractdxGridReportLink); +begin + inherited; + with TdxReportCellString(ADataItem) do + begin + EndEllipsis := AReportLink.GetEndEllipsis; + Multiline := AReportLink.GetCellMultiline(ACol, ARow); + SortOrder := AReportLink.GetColSortOrder(ACol); + Text := AReportLink.GetCellText(ACol, ARow); + TextAlignX := AReportLink.GetCellTextAlignX(ACol, ARow); + TextAlignY := AReportLink.GetCellTextAlignY(ACol, ARow); + end; +end; + +{ TdxPSImageGridCellDataMap } + +class function TdxPSImageGridCellDataMap.DataClass: TdxReportCellDataClass; +begin + Result := TdxReportCellImage; +end; + +class procedure TdxPSImageGridCellDataMap.InitializeCellData(ACol, ARow: Integer; + ADataItem: TAbstractdxReportCellData; AReportLink: TAbstractdxGridReportLink); +begin + inherited; + with TdxReportCellImage(ADataItem) do + begin + if AReportLink.GetCellHasImage(ACol, ARow) then + begin + Image := AReportLink.GetCellImage(ACol, ARow); + ImageTransparent := AReportLink.GetCellImageTransparent(ACol, ARow); + MakeSpaceForEmptyImage := AReportLink.GetCellImageMakeSpaceForEmpty(ACol, ARow); + end; + ImageIndex := AReportLink.GetCellImageIndex(ACol, ARow); + ImageLayout := AReportLink.GetCellImageLayout(ACol, ARow); + ImageList := AReportLink.GetCellImageList(ACol, ARow); + end; +end; + +{ TAbstractdxGridReportLink } + +constructor TAbstractdxGridReportLink.Create(AOwner: TComponent); +begin + inherited; + FDelimitersHardVert := TList.Create; + FFixedFont := TFont.Create; + FEvenFont := TFont.Create; + InternalRestoreDefaults; + FFixedFont.OnChange := FontChanged; + FEvenFont.OnChange := FontChanged; + LinkModified(False); + FCurrentCol := -1; + FCurrentRow := -1; + FReportRows := TList.Create; +end; + +destructor TAbstractdxGridReportLink.Destroy; +begin + FreeAndNil(FDefaultFixedFont); + FreeAndNil(FReportRows); + FreeAndNil(FEvenFont); + FreeAndNil(FFixedFont); + FreeAndNil(FDelimitersHardVert); + inherited; +end; + +procedure TAbstractdxGridReportLink.Assign(Source: TPersistent); +begin + inherited; + if Source is TAbstractdxGridReportLink then + with TAbstractdxGridReportLink(Source) do + begin + Self.DrawMode := DrawMode; + Self.Effects3D := Effects3D; + Self.EndEllipsis := EndEllipsis; + Self.EvenColor := EvenColor; + Self.EvenFont := EvenFont; + Self.FixedColor := FixedColor; + Self.FixedFont := FixedFont; + Self.FixedTransparent := FixedTransparent; + Self.GridLineColor := GridLineColor; + Self.IncludeFixed := IncludeFixed; + Self.OnlySelected := OnlySelected; + Self.Multiline := Multiline; + Self.RowAutoHeight := RowAutoHeight; + Self.Soft3D := Soft3D; + Self.SupportedCustomDraw := SupportedCustomDraw; + Self.UseCustomPageBreaks := UseCustomPageBreaks; + end; +end; + +procedure TAbstractdxGridReportLink.AddPageBreak(ARow: Integer); +var + ReportRow: TdxReportCell; +begin + ReportRow := ReportRowsByRow[ARow]; + if (ReportRow <> nil) and not ReportRow.IsFirstItem then + AddVerticalHardDelimiter(ReportRow); +end; + +procedure TAbstractdxGridReportLink.AddPageBreak(const ARows: array of Integer); +begin + AddPageBreak(ARows, 0, High(ARows) + 1); +end; + +procedure TAbstractdxGridReportLink.AddPageBreak(const ARows: array of Integer; + AStartIndex, ACount: Integer); +var + I: Integer; +begin + for I := AStartIndex to AStartIndex + ACount - 1 do + AddPageBreak(ARows[I]); +end; + +procedure TAbstractdxGridReportLink.AddPageBreak(ARows: PIntegerArray; ACount: Integer); +begin + AddPageBreak(ARows, 0, ACount); +end; + +procedure TAbstractdxGridReportLink.AddPageBreak(ARows: PIntegerArray; AStartIndex, ACount: Integer); +var + I: Integer; +begin + for I := AStartIndex to AStartIndex + ACount - 1 do + AddPageBreak(ARows^[I]); +end; + +procedure TAbstractdxGridReportLink.AddPageBreak(const ARows: TBoundArray); +var + I: Integer; +begin + for I := 0 to Length(ARows) - 1 do + AddPageBreak(ARows[I]); +end; + +procedure TAbstractdxGridReportLink.AddPageBreak(const ARows: TBoundArray; AStartIndex, ACount: Integer); +var + I: Integer; +begin + for I := AStartIndex to AStartIndex + ACount - 1 do + AddPageBreak(ARows[I]); +end; + +procedure TAbstractdxGridReportLink.AddPageBreak(ARows: TList); +begin + AddPageBreak(ARows, 0, ARows.Count); +end; + +procedure TAbstractdxGridReportLink.AddPageBreak(ARows: TList; AStartIndex, ACount: Integer); +var + I: Integer; +begin + for I := AStartIndex to AStartIndex + ACount - 1 do + AddPageBreak(Integer(ARows[I])); +end; + +function TAbstractdxGridReportLink.DefaultFixedFont: TFont; +begin + if FDefaultFixedFont = nil then + begin + FDefaultFixedFont := TFont.Create; + InitializeDefaultFixedFont(FDefaultFixedFont); + end; + Result := FDefaultFixedFont; +end; + +procedure TAbstractdxGridReportLink.ConstructReport(AReportCells: TdxReportCells); +var + Item: TdxReportItem; + ReportRow: TdxReportCell; + EntireRowCount, Row, Col: Integer; + R, R2: TRect; +begin + if not DataProviderPresent then Exit; + inherited; + BeforeConstruct(AReportCells); + try + PrepareConstruct(AReportCells); + try + EntireRowCount := ActualRowCount; + with AReportCells do + begin + BorderColor := GridLineColor; + Cells.FontIndex := 0; + Cells.Color := Self.Color; + if FootersOnEveryPage then + begin + FooterCells.FontIndex := FFixedFontIndex; + FooterCells.Color := FixedColor; + end; + if HeadersOnEveryPage then + begin + HeaderCells.FontIndex := FFixedFontIndex; + HeaderCells.Color := FixedColor; + end; + end; + R := MakeRect(0, 0, RowWidth, 0); + + FCurrentRow := 0; + for Row := 0 to RowCount - 1 do + begin + if IsProcessedRow(Row) then + begin + R.Top := R.Bottom; + R.Bottom := R.Top + GetRowHeight(Row); + + ReportRow := GetRowClass(Row).Create(GetRowParent(AReportCells, Row)); + AddReportRow(ReportRow); + InitializeRow(ReportRow, Row); + ReportRow.BoundsRect := R; + + Item := ReportRow.GetPrevSibling; + ReportRow.Top := 0; + if Item <> nil then + ReportRow.Top := TdxReportVisualItem(Item).BoundsRect.Bottom; + + FCurrentCol := 0; + R2 := MakeRect(0, 0, 0, R.Bottom - R.Top); + for Col := 0 to ColCount - 1 do + begin + if IsProcessedCol(Col) then + begin + R2.Left := R2.Right; + R2.Right := R2.Left + ColumnWidths[Col]; + if IsProcessedCell(Col, Row) then + CreateDataItem(ReportRow, ActualColIndexes[Col], Row, R2); + end; + NextCol; + end; + AReportCells.DoProgress(MulDiv(Row, 100, EntireRowCount)); + if AbortBuilding then Break; + end; + NextRow; + end; + finally + UnprepareConstruct(AReportCells); + end; + + if not AbortBuilding then + begin + SetupBoundsRect(AReportCells.Cells); + if FootersOnEveryPage then SetupBoundsRect(AReportCells.FooterCells); + if HeadersOnEveryPage then SetupBoundsRect(AReportCells.HeaderCells); + end; + finally + AfterConstruct(AReportCells); + end; +end; + +procedure TAbstractdxGridReportLink.ConvertCoords; + + procedure ConvertDelimiters(ADelimiters: TList); + var + I, Value: Integer; + begin + for I := 0 to ADelimiters.Count - 1 do + begin + Value := Integer(ADelimiters[I]); + Value := MulDiv(Value, PixelsNumerator, PixelsDenominator); + ADelimiters[I] := TObject(Value); + end; + end; + +begin + inherited; + ConvertDelimiters(DelimitersHardVert); +end; + +function TAbstractdxGridReportLink.GetBreakPagesByHardDelimiters: Boolean; +begin + Result := UseCustomPageBreaks; +end; + +function TAbstractdxGridReportLink.GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; +begin + Result := AutoWidth and (AUpdateCodes * uaMarginsVert <> []); +end; + +function TAbstractdxGridReportLink.GetUseHardVertDelimiters: Boolean; +begin + Result := UseCustomPageBreaks; +end; + +procedure TAbstractdxGridReportLink.InternalRestoreDefaults; +begin + inherited; + AutoWidth := False; + DrawMode := gdmStrict; + Effects3D := False; + EndEllipsis := False; + EvenColor := dxDefaultColor; + FixedColor := dxDefaultFixedColor; + EvenFont := Font; + FixedFont := Font; + FixedFont.Style := [fsBold]; + FixedTransparent := False; + GridLineColor := dxDefaultGridLineColor; + IncludeFixed := True; + Multiline := False; + OnlySelected := False; + RowAutoHeight := False; + Soft3D := True; + SupportedCustomDraw := False; +end; + +function TAbstractdxGridReportLink.IsSupportedCustomDraw(AItem: TAbstractdxReportCellData): Boolean; +begin + Result := SupportedCustomDraw; +end; + +procedure TAbstractdxGridReportLink.MakeDelimiters(AReportCells: TdxReportCells; + AHorzDelimiters, AVertDelimiters: TList); +var + I, V: Integer; + ReportRow: TdxReportCell; +begin + inherited; + if ReportRowCount <> 0 then + with AReportCells do + begin + if UseHorzDelimiters then + begin + ReportRow := ReportRows[0]; + for I := 1 to ReportRow.DataItemCount - 1 do + begin + V := ReportRow.DataItems[I].AbsoluteOrigin.X; + AHorzDelimiters.Add(TObject(V)); + end; + end; + + if UseVertDelimiters then + for I := 1 to ReportRowCount - 1 do + begin + V := ReportRows[I].AbsoluteOrigin.Y; + AVertDelimiters.Add(TObject(V)); + end; + end; +end; + +procedure TAbstractdxGridReportLink.MakeHardDelimiters(AReportCells: TdxReportCells; + AVertDelimiters: TList); +begin + inherited; + if UseCustomPageBreaks then + try + DoGetCustomPageBreaks; + except + Application.HandleException(Self); + end; + dxPSUtl.dxCopyList(DelimitersHardVert, AVertDelimiters); +end; + +procedure TAbstractdxGridReportLink.DoGetCustomPageBreaks; +begin + if Assigned(FOnGetCustomPageBreaks) then FOnGetCustomPageBreaks(Self); +end; + +procedure TAbstractdxGridReportLink.DoInitializeItem(ACol, ARow: Integer; + ADataItem: TAbstractdxReportCellData); +begin + if Assigned(FOnInitializeItem) then FOnInitializeItem(Self, ACol, ARow, ADataItem); +end; + +procedure TAbstractdxGridReportLink.AssignData(ACol, ARow: Integer; ADataItem: TAbstractdxReportCellData); +begin + dxPSGridCellDataMaps[ADataItem].InitializeCellData(ACol, ARow, ADataItem, Self); + Exit; + with ADataItem do + begin + Color := GetCellColor(ACol, ARow); + ContentBkColor := GetCellContentBkColor(ACol, ARow); + ContentPattern := GetCellContentPattern(ACol, ARow); + Transparent := GetCellTransparent(ACol, ARow); + + CellSides := GetCellSides(ACol, ARow); + Data := ACol + ARow * ColCount; + EdgeMode := GetCellEdgeMode(ADataItem, ACol, ARow); + Edge3DStyle := GetCellEdge3DStyle(ADataItem, ACol, ARow); + Edge3DSoft := GetCellEdge3DSoft(ADataItem, ACol, ARow); + FontIndex := GetCellFontIndex(ACol, ARow); + end; + + if ADataItem is TdxReportCellString then + with TdxReportCellString(ADataItem) do + begin + EndEllipsis := GetEndEllipsis; + Multiline := GetCellMultiline(ACol, ARow); + if IsFixedRow(ARow) then + SortOrder := GetColSortOrder(ACol); + Text := GetCellText(ACol, ARow); + TextAlignX := GetCellTextAlignX(ACol, ARow); + TextAlignY := GetCellTextAlignY(ACol, ARow); + end; + + if ADataItem is TdxReportCellImage then + with TdxReportCellImage(ADataItem) do + begin + ImageIndex := GetCellImageIndex(ACol, ARow); + ImageLayout := GetCellImageLayout(ACol, ARow); + ImageList := GetCellImageList(ACol, ARow); + end; +end; + +procedure TAbstractdxGridReportLink.CalculateColumnAutoWidths; +var + AutoWidthObject: TcxAutoWidthObject; + I, Index: Integer; + begin + AutoWidthObject := TcxAutoWidthObject.Create(ActualColCount); + try + for I := 0 to ColCount - 1 do + if IsProcessedCol(I) then + begin + with AutoWidthObject.AddItem do + begin + Width := ColumnWidths[I]; + MinWidth := 1; + Fixed := False; + end; + end; + AutoWidthObject.AvailableWidth := AvailableSiteWidth; + AutoWidthObject.Calculate; + + Index := 0; + for I := 0 to ColCount - 1 do + if IsProcessedCol(I) then + begin + ColumnWidths[I]:= AutoWidthObject[Index].AutoWidth; + Inc(Index); + end; + finally + AutoWidthObject.Free; + end; +end; + +procedure TAbstractdxGridReportLink.CalculateColumnWidths; +var + I: Integer; +begin + SetLength(FColumnWidths, ColCount); + for I := 0 to ColCount - 1 do + ColumnWidths[I] := GetSourceColWidth(ActualColIndexes[I]); + if AutoWidth and CanCalculateColumnAutoWidths then + CalculateColumnAutoWidths; +end; + +procedure TAbstractdxGridReportLink.CalculateRowHeights(AReportCells: TdxReportCells); + + function CalculateRowHeight(ACol, ARow: Integer): Integer; + var + ActualColIndex: Integer; + R: TRect; + begin + ActualColIndex := ActualColIndexes[ACol]; + R := MakeRect(0, 0, ColumnWidths[ACol], 5); + Result := Renderer.CalcTextRect(ScreenDC, GetCellText(ActualColIndex, ARow), R, + GetCellMultiline(ActualColIndex, ARow), GetCellFont(ActualColIndex, ARow)); + end; + +var + PrevFont: HFONT; + MinFixedRowHeight, MinRowHeight, V, H, Col, Row: Integer; +begin + PrevFont := GetCurrentObject(ScreenDC, OBJ_FONT); + + MinRowHeight := GetMinRowHeight(ScreenDC, Font); + MinFixedRowHeight := GetMinRowHeight(ScreenDC, FixedFont); + + SetLength(FRowHeights, RowCount); + for Row := 0 to RowCount - 1 do + begin + if not IsProcessedRow(Row) then + begin + RowHeights[Row] := 0; + Continue; + end; + V := GetSourceRowHeight(Row); + if RowAutoHeight and (V <> 0) then + begin + V := 0; + for Col := 0 to ColCount - 1 do + if IsProcessedCol(Col) then + begin + H := CalculateRowHeight(Col, Row); + if V < H then V := H; + end; + end; + if V <> 0 then + begin + if IsFixedRow(Row) or (FixedColCount > 0) then + begin + if V < MinFixedRowHeight then V := MinFixedRowHeight + end + else + if V < MinRowHeight then V := MinRowHeight; + end; + RowHeights[Row] := V; + end; + SelectObject(ScreenDC, PrevFont); +end; + +function TAbstractdxGridReportLink.CalculateRowWidth: Integer; +var + Col: Integer; +begin + Result := 0; + for Col := 0 to ColCount - 1 do + if IsProcessedCol(Col) then + Inc(Result, ColumnWidths[Col]); +end; + +function TAbstractdxGridReportLink.CanCalculateColumnAutoWidths: Boolean; +begin + Result := not IsAggregated or + {$IFDEF DELPHI6}SysUtils.{$ELSE}cxClasses.{$ENDIF}Supports(Controller, IdxReportLinkController); +end; + +function TAbstractdxGridReportLink.CreateDataItem(AParent: TdxReportCell; + ACol, ARow: Integer; const ABounds: TRect): TAbstractdxReportCellData; +var + DataClass: TdxReportCellDataClass; +begin + DataClass := GetDataItemClass(ACol, ARow); + if DataClass <> nil then + begin + Result := DataClass.Create(AParent); + Result.BoundsRect := ABounds; + AssignData(ACol, ARow, Result); + DoInitializeItem(ACol, ARow, Result); + end + else + Result := nil; +end; + +function TAbstractdxGridReportLink.GetDataItemClass(ACol: Integer; ARow: Integer = 0): TdxReportCellDataClass; +begin + Result := TdxReportCellString; +end; + +function TAbstractdxGridReportLink.GetRowClass(ARow: Integer): TdxReportCellClass; +begin + Result := TdxReportCell; +end; + +function TAbstractdxGridReportLink.GetRowParent(AReportCells: TdxReportCells; ARow: Integer): TdxReportCell; +begin + if HeadersOnEveryPage and IsHeaderRow(ARow) then + Result := AReportCells.HeaderCells + else + if FootersOnEveryPage and IsFooterRow(ARow) then + Result := AReportCells.FooterCells + else + Result := AReportCells.Cells; +end; + +procedure TAbstractdxGridReportLink.InitializeRow(AReportRow: TdxReportCell; + ARow: Integer); +begin + AReportRow.Data := ARow; + AReportRow.Transparent := True; + AReportRow.CellSides := []; +end; + +function TAbstractdxGridReportLink.GetColCount: Integer; +begin + Result := 0; +end; + +function TAbstractdxGridReportLink.GetFixedColCount: Integer; +begin + Result := 0; +end; + +function TAbstractdxGridReportLink.GetFixedRowCount: Integer; +begin + Result := 0; +end; + +function TAbstractdxGridReportLink.GetRowCount: Integer; +begin + Result := 0; +end; + +function TAbstractdxGridReportLink.GetActualColCount: Integer; +begin + if HasSelection then + Result := SelectedColCount + else + Result := ColCount; +end; + +function TAbstractdxGridReportLink.GetActualColIndex(Col: Integer): Integer; +begin + Result := Col; +end; + +function TAbstractdxGridReportLink.GetActualRowCount: Integer; +begin + if HasSelection then + Result := SelectedRowCount + else + Result := RowCount; +end; + +function TAbstractdxGridReportLink.GetCellEdge3DSoft(AItem: TAbstractdxReportCellData; + ACol, ARow: Integer): Boolean; +begin + if DrawMode = gdmBorrowSource then + Result := GetSourceCellEdge3DSoft(ACol, ARow) + else + Result := Soft3D; +end; + +function TAbstractdxGridReportLink.GetCellEdge3DStyle(AItem: TAbstractdxReportCellData; + ACol, ARow: Integer): TdxCellEdgeStyle; +begin + if DrawMode = gdmBorrowSource then + Result := GetSourceCellEdge3DStyle(ACol, ARow) + else + Result := cesRaised; +end; + +function TAbstractdxGridReportLink.GetCellEdgeMode(AItem: TAbstractdxReportCellData; + ACol, ARow: Integer): TdxCellEdgeMode; +begin + if DrawMode = gdmBorrowSource then + Result := GetSourceCellEdgeMode(ACol, ARow) + else + if IsFixedCell(ACol, ARow) and Effects3D then + Result := cem3DEffects + else + Result := cemPattern; +end; + +function TAbstractdxGridReportLink.GetEndEllipsis: Boolean; +begin + Result := FEndEllipsis; +end; + +function TAbstractdxGridReportLink.GetInternalRowHeight(Index: Integer): Integer; +begin + Result := FRowHeights[Index]; +end; + +function TAbstractdxGridReportLink.GetMinRowHeight(DC: HDC; AFont: TFont): Integer; +begin + Result := Renderer.CalcTextPatternHeight(DC, AFont); +end; + +function TAbstractdxGridReportLink.GetMultiline: Boolean; +begin + Result := FMultiline; +end; + +procedure TAbstractdxGridReportLink.GetSelectedRange(ABeginCol, AEndCol, + ABeginRow, AEndRow: PInteger); +var + BeginCol, EndCol, BeginRow, EndRow: Integer; +begin + GetSelectedRange(BeginCol, EndCol, BeginRow, EndRow); + if ABeginCol <> nil then + ABeginCol^ := BeginCol; + + if AEndCol <> nil then + AEndCol^ := EndCol; + + if ABeginRow <> nil then + ABeginRow^ := BeginRow; + + if AEndRow <> nil then + AEndRow^ := EndRow; +end; + +procedure TAbstractdxGridReportLink.GetSelectedRange(out ABeginCol, AEndCol, ABeginRow, AEndRow: Integer); +begin + with SelectionRect do + begin + ABeginCol := Left; + AEndCol := Right; + ABeginRow := Top; + AEndRow := Bottom; + end; +end; + +function TAbstractdxGridReportLink.GetSelectedColCount: Integer; +var + BeginCol, EndCol, BeginRow, EndRow: Integer; +begin + GetSelectedRange(BeginCol, EndCol, BeginRow, EndRow); + Result := EndCol - BeginCol + 1; + if IncludeFixed then Inc(Result, FixedColCount); +end; + +function TAbstractdxGridReportLink.GetSelectedRowCount: Integer; +var + BeginCol, EndCol, BeginRow, EndRow: Integer; +begin + GetSelectedRange(BeginCol, EndCol, BeginRow, EndRow); + Result := EndRow - BeginRow + 1; + if IncludeFixed then Inc(Result, FixedRowCount); +end; + +function TAbstractdxGridReportLink.GetSelectionRect: TRect; +begin + Result := dxPSGlbl.NullRect; +end; + +function TAbstractdxGridReportLink.GetSourceCellContentBkColor(ACol, ARow: Integer): TColor; +begin + Result := GetSourceCellColor(ACol, ARow); +end; + +function TAbstractdxGridReportLink.GetSourceCellColor(ACol, ARow: Integer): TColor; +begin + if IsFixedCell(ACol, ARow) then + Result := FixedColor + else + Result := Color; +end; + +function TAbstractdxGridReportLink.GetSourceCellContentPattern(ACol, ARow: Integer): TdxPSFillPatternClass; +begin + Result := TdxPSSolidFillPattern; +end; + +function TAbstractdxGridReportLink.GetSourceCellEdge3DSoft(ACol, ARow: Integer): Boolean; +begin + Result := False; +end; + +function TAbstractdxGridReportLink.GetSourceCellEdge3DStyle(ACol, ARow: Integer): TdxCellEdgeStyle; +begin + if IsFixedCell(ACol, ARow) then + Result := cesRaised + else + Result := cesSunken; +end; + +function TAbstractdxGridReportLink.GetSourceCellEdgeMode(ACol, ARow: Integer): TdxCellEdgeMode; +begin + Result := cemPattern; +end; + +function TAbstractdxGridReportLink.GetSourceCellFont(ACol, ARow: Integer): TFont; +begin + if IsFixedCell(ACol, ARow) then + Result := FixedFont + else + Result := Font; +end; + +function TAbstractdxGridReportLink.GetSourceCellFontIndex(ACol, ARow: Integer): Integer; +begin + if IsFixedCell(ACol, ARow) then + Result := FFixedFontIndex + else + Result := FFontIndex; +end; + +function TAbstractdxGridReportLink.GetSourceCellMultiline(ACol, ARow: Integer): Boolean; +begin + Result := False; +end; + +function TAbstractdxGridReportLink.GetSourceCellTextAlignX(ACol, ARow: Integer): TdxTextAlignX; +begin + Result := taLeft; +end; + +function TAbstractdxGridReportLink.GetSourceCellTextAlignY(ACol, ARow: Integer): TdxTextAlignY; +begin + Result := taCenterY; +end; + +function TAbstractdxGridReportLink.GetSourceCellTransparent(ACol, ARow: Integer): Boolean; +begin + Result := True; +end; + +function TAbstractdxGridReportLink.GetSourceColWidth(ACol: Integer): Integer; +begin + Result := 0; +end; + +function TAbstractdxGridReportLink.GetSourceRowHeight(ARow: Integer): Integer; +begin + Result := 0; +end; + +function TAbstractdxGridReportLink.HasColumnHeaderImage(ACol: Integer): Boolean; +begin + Result := False; +end; + +function TAbstractdxGridReportLink.HasSelection: Boolean; +var + BeginCol, EndCol, BeginRow, EndRow: Integer; +begin + if OnlySelected then + begin + GetSelectedRange(BeginCol, EndCol, BeginRow, EndRow); + Result := (EndCol >= BeginCol) and (EndRow >= BeginRow); + end + else + Result := False; +end; + +function TAbstractdxGridReportLink.HasSelectionInCol(ACol: Integer): Boolean; +var + BeginCol, EndCol, BeginRow, EndRow: Integer; +begin + GetSelectedRange(BeginCol, EndCol, BeginRow, EndRow); + Result := ((ACol >= BeginCol) and (ACol <= EndCol)) or (IncludeFixed and IsFixedCol(ACol)); +end; + +function TAbstractdxGridReportLink.HasSelectionInRow(ARow: Integer): Boolean; +var + BeginCol, EndCol, BeginRow, EndRow: Integer; +begin + GetSelectedRange(BeginCol, EndCol, BeginRow, EndRow); + Result := ((ARow >= BeginRow) and (ARow <= EndRow)) or (IncludeFixed and IsFixedRow(ARow)); +end; + +function TAbstractdxGridReportLink.IsDrawBorder: Boolean; +begin + Result := True; +end; + +function TAbstractdxGridReportLink.IsDrawHorzLines: Boolean; +begin + Result := True; +end; + +function TAbstractdxGridReportLink.IsDrawVertLines: Boolean; +begin + Result := True; +end; + +function TAbstractdxGridReportLink.IsDrawFixedHorzLines: Boolean; +begin + Result := True; +end; + +function TAbstractdxGridReportLink.IsDrawFixedVertLines: Boolean; +begin + Result := True; +end; + +function TAbstractdxGridReportLink.IsFixedCell(ACol, ARow: Integer): Boolean; +begin + Result := IsFixedCol(ACol) or IsFixedRow(ARow); +end; + +function TAbstractdxGridReportLink.IsFixedCol(ACol: Integer): Boolean; +begin + Result := ACol < FixedColCount; +end; + +function TAbstractdxGridReportLink.IsFixedRow(ARow: Integer): Boolean; +begin + Result := ARow < FixedRowCount; +end; + +function TAbstractdxGridReportLink.IsFooterRow(ARow: Integer): Boolean; +begin + Result := False; +end; + +function TAbstractdxGridReportLink.IsHeaderRow(ARow: Integer): Boolean; +begin + Result := IsFixedRow(ARow); +end; + +function TAbstractdxGridReportLink.IsProcessedCell(ACol, ARow: Integer): Boolean; +begin + Result := True; +end; + +function TAbstractdxGridReportLink.IsProcessedCol(ACol: Integer): Boolean; +begin + Result := not HasSelection or HasSelectionInCol(ACol); +end; + +function TAbstractdxGridReportLink.IsProcessedRow(ARow: Integer): Boolean; +begin + Result := not HasSelection or HasSelectionInRow(ARow); +end; + +function TAbstractdxGridReportLink.IsSelectedCell(ACol, ARow: Integer): Boolean; +var + BeginCol, EndCol, BeginRow, EndRow: Integer; +begin + GetSelectedRange(BeginCol, EndCol, BeginRow, EndRow); + + Result := ((ACol >= BeginCol) and (ACol <= EndCol) and (ARow >= BeginRow) and (ARow <= EndRow)); + if not Result and IncludeFixed then + Result := ((ACol >= BeginCol) and (ACol <= EndCol) and IsFixedCol(ACol)) or + ((ARow >= BeginRow) and (ARow <= EndRow) and IsFixedRow(ARow)); +end; + +function TAbstractdxGridReportLink.IsSelectedRow(ARow: Integer): Boolean; +begin + Result := False; +end; + +procedure TAbstractdxGridReportLink.NextCol; +begin + Inc(FCurrentCol); +end; + +procedure TAbstractdxGridReportLink.NextRow; +begin + Inc(FCurrentRow); +end; + +procedure TAbstractdxGridReportLink.SetDrawMode(Value: TdxGridDrawMode); +begin + if FDrawMode <> Value then + begin + FDrawMode := Value; + LinkModified(True); + end; +end; + +procedure TAbstractdxGridReportLink.SetupBoundsRect(ACell: TdxReportCell); +begin + with ACell do + if CellCount > 0 then + BoundsRect := MakeRect(0, 0, LastCell.BoundsRect.Right, LastCell.BoundsRect.Bottom); +end; + +procedure TAbstractdxGridReportLink.AddReportRow(ARow: TdxReportCell); +begin + FReportRows.Add(ARow); +end; + +procedure TAbstractdxGridReportLink.AddVerticalHardDelimiter(ADelimiter: TdxReportCell); +begin + AddVerticalHardDelimiter(ADelimiter.AbsoluteRect.Top); +end; + +procedure TAbstractdxGridReportLink.AddVerticalHardDelimiter(ADelimiter: Integer); +begin + FDelimitersHardVert.Add(TObject(ADelimiter)); +end; + +procedure TAbstractdxGridReportLink.AfterConstruct(AReportCells: TdxReportCells); +begin + ReleaseDC(0, FScreenDC); +end; + +procedure TAbstractdxGridReportLink.BeforeConstruct(AReportCells: TdxReportCells); +begin + FScreenDC := GetDC(0); +end; + +procedure TAbstractdxGridReportLink.PrepareConstruct(AReportCells: TdxReportCells); +begin + FRowWidth := -1; + FDelimitersHardVert.Clear; + SetLength(FColumnWidths, 0); + CalculateColumnWidths; + FReportRows.Clear; + CalculateRowHeights(AReportCells); + FFixedFontIndex := AddFontToPool(FixedFont); + FEvenFontIndex := AddFontToPool(EvenFont); +end; + +procedure TAbstractdxGridReportLink.UnprepareConstruct(AReportCells: TdxReportCells); +begin +end; + +procedure TAbstractdxGridReportLink.InitializeDefaultFixedFont(AFont: TFont); +begin + AFont.Assign(Font); + AFont.Style := AFont.Style + [fsBold]; +end; + +function TAbstractdxGridReportLink.IsFixedFontStored: Boolean; +begin + Result := not dxPSUtl.dxAreFontsEqual(FixedFont, DefaultFixedFont); +end; + +procedure TAbstractdxGridReportLink.GetCellColRow(AItem: TdxReportVisualItem; + var ACol, ARow: Integer); +begin + ARow := AItem.Data div ColCount; + ACol := AItem.Data - ARow * ColCount; +end; + +function TAbstractdxGridReportLink.GetCellColor(ACol, ARow: Integer): TColor; +begin + case DrawMode of + gdmStrict: + if IsFixedCell(ACol, ARow) then + Result := FixedColor + else + Result := Color; + + gdmOddEven: + if IsFixedCell(ACol, ARow) then + Result := FixedColor + else + if Odd(ARow) then + Result := Color + else + Result := EvenColor; + + gdmChess: + if IsFixedCell(ACol, ARow) then + Result := FixedColor + else + if not Odd((ACol - FixedColCount) + (ARow - FixedRowCount)) then + Result := Color + else + Result := EvenColor; + else { gdmBorrowSource } + Result := GetSourceCellColor(ACol, ARow); + end; +end; + +function TAbstractdxGridReportLink.GetCellContentBkColor(ACol, ARow: Integer): TColor; +begin + if DrawMode = gdmBorrowSource then + Result := GetSourceCellContentBkColor(ACol, ARow) + else + Result := GetCellColor(ACol, ARow); +end; + +function TAbstractdxGridReportLink.GetCellContentPattern(ACol, ARow: Integer): TdxPSFillPatternClass; +begin + if DrawMode = gdmBorrowSource then + Result := GetSourceCellContentPattern(ACol, ARow) + else + Result := TdxPSSolidFillPattern; +end; + +function TAbstractdxGridReportLink.GetCellTransparent(ACol, ARow: Integer): Boolean; +begin + if DrawMode = gdmBorrowSource then + Result := GetSourceCellTransparent(ACol, ARow) + else + if IsFixedCell(ACol, ARow) then + Result := FixedTransparent + else + Result := Self.Transparent; +end; + +function TAbstractdxGridReportLink.GetCellFont(ACol, ARow: Integer): TFont; +begin + case DrawMode of + gdmStrict: + if IsFixedCell(ACol, ARow) then + Result := FixedFont + else + Result := Font; + gdmOddEven: + if IsFixedCell(ACol, ARow) then + Result := FixedFont + else + if Odd(ARow) then + Result := Font + else + Result := EvenFont; + gdmChess: + if IsFixedCell(ACol, ARow) then + Result := FixedFont + else + if not Odd((ACol - FixedColCount) + (ARow - FixedRowCount)) then + Result := Font + else + Result := EvenFont; + else {gdmBorrowSource} + Result := GetSourceCellFont(ACol, ARow); + end; +end; + +function TAbstractdxGridReportLink.GetCellFontIndex(ACol, ARow: Integer): Integer; +begin + case DrawMode of + gdmStrict: + if IsFixedCell(ACol, ARow) then + Result := FFixedFontIndex + else + Result := FFontIndex; + gdmOddEven: + if IsFixedCell(ACol, ARow) then + Result := FFixedFontIndex + else + if Odd(ARow) then + Result := FFontIndex + else + Result := FEvenFontIndex; + gdmChess: + if IsFixedCell(ACol, ARow) then + Result := FFixedFontIndex + else + if not Odd((ACol - FixedColCount) + (ARow - FixedRowCount)) then + Result := FFontIndex + else + Result := FEvenFontIndex; + else {gdmBorrowSource} + Result := GetSourceCellFontIndex(ACol, ARow); + end; +end; + +function TAbstractdxGridReportLink.GetCellHasImage(ACol, ARow: Integer): Boolean; +begin + Result := False; +end; + +function TAbstractdxGridReportLink.GetCellImage(ACol, ARow: Integer): TGraphic; +begin + Result := nil; +end; + +function TAbstractdxGridReportLink.GetCellImageIndex(ACol, ARow: Integer): Integer; +begin + Result := -1; +end; + +function TAbstractdxGridReportLink.GetCellImageLayout(ACol, ARow: Integer): TdxImageLayout; +begin + Result := ilImageCenterLeft; +end; + +function TAbstractdxGridReportLink.GetCellImageList(ACol, ARow: Integer): TCustomImageList; +begin + Result := nil; +end; + +function TAbstractdxGridReportLink.GetCellImageMakeSpaceForEmpty(ACol, ARow: Integer): Boolean; +begin + Result := True; +end; + +function TAbstractdxGridReportLink.GetCellImageTransparent(ACol, ARow: Integer): Boolean; +begin + Result := True; +end; + +function TAbstractdxGridReportLink.GetCellMultiline(ACol, ARow: Integer): Boolean; +begin + if DrawMode = gdmBorrowSource then + Result := GetSourceCellMultiline(ACol, ARow) + else + Result := Multiline or RowAutoHeight; +end; + +function TAbstractdxGridReportLink.GetCellSides(ACol, ARow: Integer): TdxCellSides; +var + ABeginCol, AEndCol, ABeginRow, AEndRow: Integer; +begin + Result := csAll; + if not IsDrawBorder then + begin + if ACol = ActualFirstCol then Exclude(Result, csLeft); + if ACol = ActualLastCol then Exclude(Result, csRight); + if ARow = ActualFirstRow then Exclude(Result, csTop); + if ARow = ActualLastRow then Exclude(Result, csBottom); + end; + if IsFixedCell(ACol, ARow) then + begin + if not IsDrawFixedHorzLines then + begin + if ARow > 0 then Exclude(Result, csTop); + if IsFixedCol(ACol) then + begin + if ARow < ActualLastRow then + Exclude(Result, csBottom) + end + else + if ARow < FixedRowCount - Byte(IsDrawHorzLines) then + Exclude(Result, csBottom); + end; + if not IsDrawFixedVertLines then + begin + if ACol > 0 then Exclude(Result, csLeft); + if IsFixedRow(ARow) then + begin + if ACol < ActualLastCol then + Exclude(Result, csRight) + end + else + if ACol < FixedColCount - Byte(IsDrawVertLines) then + Exclude(Result, csRight); + end; + end + else + begin + GetSelectedRange(ABeginCol, AEndCol, ABeginRow, AEndRow); + if not IsDrawHorzLines then + begin + if not HasSelection then + begin + ABeginRow := FixedRowCount - 1; + if ABeginRow = -1 then ABeginRow := 0; + AEndRow := RowCount - 1; + end; + + if ARow < AEndRow then + if (ARow > ABeginRow) or (HasSelection and IncludeFixed and (FixedRowCount > 0)) then + Result := Result - [csTop, csBottom] + else + Exclude(Result, csBottom) + else + if (ARow > ABeginRow) or (HasSelection and IncludeFixed and (FixedRowCount > 0)) then + Exclude(Result, csTop); + end; + if not IsDrawVertLines then + begin + if not HasSelection then + begin + ABeginCol := FixedColCount - 1; + if ABeginCol = -1 then ABeginCol := 0; + AEndCol := ColCount - 1; + end; + + if ACol < AEndCol then + if (ACol > ABeginCol) or (HasSelection and IncludeFixed and (FixedColCount > 0)) then + Result := Result - [csLeft, csRight] + else + Exclude(Result, csRight) + else + if (ACol > ABeginCol) or (HasSelection and IncludeFixed and (FixedColCount > 0)) then + Exclude(Result, csLeft) + end; + end; +end; + +function TAbstractdxGridReportLink.GetCellTextAlignX(ACol, ARow: Integer): TdxTextAlignX; +begin + if DrawMode = gdmBorrowSource then + Result := GetSourceCellTextAlignX(ACol, ARow) + else + if IsFixedCell(ACol, ARow) then + Result := taCenterX + else + Result := taLeft; +end; + +function TAbstractdxGridReportLink.GetCellTextAlignY(ACol, ARow: Integer): TdxTextAlignY; +begin + if DrawMode = gdmBorrowSource then + Result := GetSourceCellTextAlignY(ACol, ARow) + else + if IsFixedCell(ACol, ARow) then + Result := taBottom //taCenterY + else + Result := taCenterY; +end; + +function TAbstractdxGridReportLink.GetColSortOrder(ACol: Integer): TdxCellSortOrder; +begin + Result := csoNone; +end; + +function TAbstractdxGridReportLink.GetActualFirstCol: Integer; +var + EndCol, BeginRow, EndRow: Integer; +begin + if not HasSelection or IncludeFixed then + Result := 0 + else + GetSelectedRange(Result, EndCol, BeginRow, EndRow); +end; + +function TAbstractdxGridReportLink.GetActualFirstRow: Integer; +var + BeginCol, EndCol, EndRow: Integer; +begin + if not HasSelection or IncludeFixed then + Result := 0 + else + GetSelectedRange(BeginCol, EndCol, Result, EndRow); +end; + +function TAbstractdxGridReportLink.GetActualLastCol: Integer; +var + BeginCol, BeginRow, EndRow: Integer; +begin + if not HasSelection then + Result := ColCount - 1 + else + GetSelectedRange(BeginCol, Result, BeginRow, EndRow); +end; + +function TAbstractdxGridReportLink.GetActualLastRow: Integer; +var + BeginCol, EndCol, BeginRow: Integer; +begin + if not HasSelection then + Result := RowCount - 1 + else + GetSelectedRange(BeginCol, EndCol, BeginRow, Result); +end; + +function TAbstractdxGridReportLink.GetAvailableSiteHeight: Integer; +var + ControllerIntf: IdxReportLinkController; +begin + if IsAggregated and SysUtils.Supports(TObject(Controller), IdxReportLinkController, ControllerIntf) then + with ControllerIntf.GetControlSiteBounds(TControl(Component)) do + Result := Bottom - Top - 1 + else + with RealPrinterPage.PaintRectPixels do + Result := Bottom - Top - 1; +end; + +function TAbstractdxGridReportLink.GetAvailableSiteWidth: Integer; +var + ControllerIntf: IdxReportLinkController; +begin + if IsAggregated and SysUtils.Supports(TObject(Controller), IdxReportLinkController, ControllerIntf) then + with ControllerIntf.GetControlSiteBounds(TControl(Component)) do + Result := Right - Left - 1 + else + with RealPrinterPage.PaintRectPixels do + Result := Right - Left - 1; +end; + +function TAbstractdxGridReportLink.GetColumnWidth(Index: Integer): Integer; +begin + Result := FColumnWidths[Index]; +end; + +function TAbstractdxGridReportLink.GetOddColor: TColor; +begin + Result := Color; +end; + +function TAbstractdxGridReportLink.GetOddFont: TFont; +begin + Result := inherited Font; +end; + +function TAbstractdxGridReportLink.GetReportRow(Index: Integer): TdxReportCell; +begin + Result := TdxReportCell(FReportRows[Index]); +end; + +function TAbstractdxGridReportLink.GetReportRowByRow(Row: Integer): TdxReportCell; +var + I: Integer; +begin + for I := 0 to ReportRowCount - 1 do + begin + Result := ReportRows[I]; + if Result.Data = Row then Exit; + end; + Result := nil; +end; + +function TAbstractdxGridReportLink.GetReportRowCount: Integer; +begin + Result := FReportRows.Count; +end; + +function TAbstractdxGridReportLink.GetRowHeight(ARow: Integer): Integer; +begin + Result := FRowHeights[ARow]; +end; + +function TAbstractdxGridReportLink.GetRowWidth: Integer; +begin + if FRowWidth = -1 then + FRowWidth := CalculateRowWidth; + Result := FRowWidth; +end; + +procedure TAbstractdxGridReportLink.SetAutoWidth(Value: Boolean); +begin + if FAutoWidth <> Value then + begin + FAutoWidth := Value; + LinkModified(True); + end; +end; + +procedure TAbstractdxGridReportLink.SetColumnWidth(Index: Integer; Value: Integer); +begin + FColumnWidths[Index] := Value; +end; + +procedure TAbstractdxGridReportLink.SetEffects3D(Value: Boolean); +begin + if FEffects3D <> Value then + begin + FEffects3D := Value; + LinkModified(True); + end; +end; + +procedure TAbstractdxGridReportLink.SetEndEllipsis(Value: Boolean); +begin + if FEndEllipsis <> Value then + begin + FEndEllipsis := Value; + LinkModified(True); + end; +end; + +procedure TAbstractdxGridReportLink.SetEvenColor(Value: TColor); +begin + if FEvenColor <> Value then + begin + FEvenColor := Value; + LinkModified(True); + end; +end; + +procedure TAbstractdxGridReportLink.SetEvenFont(Value: TFont); +begin + FEvenFont.Assign(Value) +end; + +procedure TAbstractdxGridReportLink.SetFixedColor(Value: TColor); +begin + if FFixedColor <> Value then + begin + FFixedColor := Value; + LinkModified(True); + end; +end; + +procedure TAbstractdxGridReportLink.SetFixedFont(Value: TFont); +begin + FFixedFont.Assign(Value) +end; + +procedure TAbstractdxGridReportLink.SetFixedTransparent(Value: Boolean); +begin + if FFixedTransparent <> Value then + begin + FFixedTransparent := Value; + LinkModified(True); + end; +end; + +procedure TAbstractdxGridReportLink.SetGridLineColor(Value: TColor); +begin + if FGridLineColor <> Value then + begin + FGridLineColor := Value; + LinkModified(True); + end; +end; + +procedure TAbstractdxGridReportLink.SetIncludeFixed(Value: Boolean); +begin + if FIncludeFixed <> Value then + begin + FIncludeFixed := Value; + LinkModified(True); + end; +end; + +procedure TAbstractdxGridReportLink.SetMultiline(Value: Boolean); +begin + if FMultiline <> Value then + begin + FMultiline := Value; + LinkModified(True); + end; +end; + +procedure TAbstractdxGridReportLink.SetOddColor(Value: TColor); +begin + inherited Color := Value; +end; + +procedure TAbstractdxGridReportLink.SetOddFont(Value: TFont); +begin + inherited Font := Value; +end; + +procedure TAbstractdxGridReportLink.SetOnlySelected(Value: Boolean); +begin + if FOnlySelected <> Value then + begin + FOnlySelected := Value; + LinkModified(True); + end; +end; + +procedure TAbstractdxGridReportLink.SetRowAutoHeight(Value: Boolean); +begin + if FRowAutoHeight <> Value then + begin + FRowAutoHeight := Value; + LinkModified(True); + end; +end; + +procedure TAbstractdxGridReportLink.SetRowHeight(Index: Integer; Value: Integer); +begin + FRowHeights[Index] := Value; +end; + +procedure TAbstractdxGridReportLink.SetSoft3D(Value: Boolean); +begin + if Soft3D <> Value then + begin + FSoft3D := Value; + LinkModified(True); + end; +end; + +procedure TAbstractdxGridReportLink.SetSupportedCustomDraw(Value: Boolean); +begin + if FSupportedCustomDraw <> Value then + begin + FSupportedCustomDraw := Value; + LinkModified(True); + end; +end; + +procedure TAbstractdxGridReportLink.SetUseCustomPageBreaks(Value: Boolean); +begin + if FUseCustomPageBreaks <> Value then + begin + FUseCustomPageBreaks := Value; + LinkModified(True); + end; +end; + +procedure RegisterAssistants; +begin + TdxPSCustomGridCellDataMap.Register; + TdxPSTextGridCellDataMap.Register; + TdxPSImageGridCellDataMap.Register; +end; + +procedure UnregisterAssistants; +begin + TdxPSImageGridCellDataMap.Unregister; + TdxPSTextGridCellDataMap.Unregister; + TdxPSCustomGridCellDataMap.Unregister; + TdxPSGridCellDataMaps.ReleaseInstance; +end; + +initialization + RegisterAssistants; + +finalization + UnregisterAssistants; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSCPDsg.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSCPDsg.dfm new file mode 100644 index 00000000..45250ab5 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSCPDsg.dfm @@ -0,0 +1,631 @@ +object dxfmCPDesigner: TdxfmCPDesigner + Left = 519 + Top = 331 + ActiveControl = btnAdd + BorderStyle = bsDialog + Caption = 'Component Printer Designer' + ClientHeight = 289 + ClientWidth = 454 + Color = clBtnFace + Constraints.MinHeight = 316 + Constraints.MinWidth = 462 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + KeyPreview = True + OldCreateOrder = False + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + OnKeyDown = FormKeyDown + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object btnClose: TButton + Left = 271 + Top = 261 + Width = 86 + Height = 23 + Caption = 'Close' + ModalResult = 1 + TabOrder = 0 + end + object btnHelp: TButton + Left = 363 + Top = 261 + Width = 86 + Height = 23 + Caption = '&Help' + TabOrder = 1 + end + object pcItems: TPageControl + Left = 5 + Top = 7 + Width = 444 + Height = 247 + ActivePage = tbsItems + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 2 + object tbsItems: TTabSheet + Caption = 'Items' + OnResize = tbsItemsResize + object lvItems: TListView + Left = 0 + Top = 0 + Width = 307 + Height = 219 + Align = alClient + Columns = <> + ColumnClick = False + MultiSelect = True + RowSelect = True + PopupMenu = pmItems + TabOrder = 0 + ViewStyle = vsReport + OnChange = lvItemsChange + OnDblClick = lvItemsDblClick + OnEdited = lvItemsEdited + OnEditing = lvItemsEditing + end + object pnlButtons: TPanel + Left = 307 + Top = 0 + Width = 129 + Height = 219 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object btnDesign: TButton + Left = 6 + Top = 103 + Width = 120 + Height = 23 + Caption = 'Desi&gn...' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 3 + OnClick = DesignClick + end + object btnAdd: TButton + Left = 6 + Top = 3 + Width = 120 + Height = 23 + Caption = '&Add...' + TabOrder = 0 + OnClick = AddClick + end + object btnDelete: TButton + Left = 6 + Top = 63 + Width = 120 + Height = 23 + Caption = '&Delete...' + TabOrder = 2 + OnClick = DeleteClick + end + object btnPageSetup: TButton + Left = 6 + Top = 133 + Width = 120 + Height = 23 + Caption = 'Pa&ge Setup...' + TabOrder = 4 + OnClick = PageSetupClick + end + object btnPrintPreview: TButton + Left = 6 + Top = 163 + Width = 120 + Height = 23 + Caption = 'Pre&view...' + TabOrder = 5 + OnClick = PrintPreviewClick + end + object btnPrint: TButton + Left = 6 + Top = 193 + Width = 120 + Height = 23 + Caption = '&Print...' + TabOrder = 6 + OnClick = PrintClick + end + object btnAddComposition: TButton + Left = 6 + Top = 33 + Width = 120 + Height = 23 + Caption = 'Add Composition' + TabOrder = 1 + OnClick = AddCompositionClick + end + end + object pnlNoItems: TPanel + Left = 12 + Top = 83 + Width = 289 + Height = 22 + BevelOuter = bvNone + Caption = 'There are no Items to display' + Color = clWindow + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnShadow + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + TabOrder = 2 + end + end + end + object pmItems: TPopupMenu + Images = ilItems + OnPopup = pmItemsPopup + Left = 20 + Top = 198 + object miAdd: TMenuItem + Caption = '&Add...' + ImageIndex = 1 + ShortCut = 45 + OnClick = AddClick + end + object miAddComposition: TMenuItem + Caption = 'Add Composition' + ImageIndex = 6 + OnClick = AddCompositionClick + end + object miDelete: TMenuItem + Caption = '&Delete' + ImageIndex = 2 + ShortCut = 46 + OnClick = DeleteClick + end + object miRename: TMenuItem + Caption = '&Rename' + ShortCut = 113 + OnClick = RenameClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miDesign: TMenuItem + Caption = 'Desi&gn...' + Default = True + ImageIndex = 0 + ShortCut = 16397 + OnClick = DesignClick + end + object miLine1: TMenuItem + Caption = '-' + end + object miPageSetup: TMenuItem + Caption = 'Pa&ge Setup...' + ImageIndex = 3 + OnClick = PageSetupClick + end + object miPrintPreview: TMenuItem + Caption = 'Pre&view...' + ImageIndex = 4 + OnClick = PrintPreviewClick + end + object miPrint: TMenuItem + Caption = '&Print...' + ImageIndex = 5 + ShortCut = 16464 + OnClick = PrintClick + end + end + object ilItems: TImageList + Left = 48 + Top = 198 + Bitmap = { + 494C010107000A00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0000000 + 0000C0C0C000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C0C0C0000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000080808000C0C0C000C0C0C0008080 + 80000000000080808000000000000000000000000000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C00000FFFF0000FFFF0000FFFF00C0C0C000C0C0 + C00000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000080808000C0C0C000C0C0C000FFFF00008080 + 80008080800000000000000000000000000000000000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000808080008080800080808000C0C0C000C0C0 + C00000000000C0C0C0000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFF + FF0000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000C0C0C000C0C0C000C0C0C000C0C0C0008080 + 8000C0C0C0000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C0C0C000C0C0C00000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFF + FF0000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000C0C0C000FFFF0000C0C0C000C0C0C0008080 + 8000C0C0C00000000000000000000000000000000000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0000000 + 0000C0C0C00000000000C0C0C00000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF0000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000080808000FFFF0000FFFF0000C0C0C0008080 + 8000808080000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C0C0 + C00000000000C0C0C0000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF0000000000FFFFFF00FFFF + FF0000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000080808000C0C0C000C0C0C0008080 + 800000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000C0C0C00000000000C0C0C00000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000000000FFFFFF000000 + 0000FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000C0C0C000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000808080000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000008000000080000000800000008000000080000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000000000008080800000000000C0C0C0000000000000000000000000000000 + 000080808000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008000000080000000800000008000 + 0000800000008000000080000000800000008000000080000000800000008000 + 000080000000800000008000000000000000000000000000000080808000C0C0 + C000C0C0C0008080800080808000808080008080800080808000808080008080 + 800000000000808080000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000008000000080000000800000008000 + 000080000000800000008080800080000000FFFFFF0080000000800000008000 + 000080000000800000008000000000000000000000000000000000000000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000FFFFFF00C0C0C0008080 + 800000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000008000000080000000808080008080 + 800080808000808080008080800080000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00800000008000000000000000000000008080800080808000C0C0 + C000C0C0C000C0C0C000C0C0C000000000008080800080808000FFFFFF008080 + 800000000000808080008080800000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000008000000080000000808080008080 + 800080808000808080008080800080000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00800000008000000000000000808080000000000000000000FFFF + FF00C0C0C000C0C0C000C0C0C000000000008080800080808000C0C0C0008080 + 800000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000008000000080000000808080008080 + 800080808000808080008080800080000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080000000800000000000000080808000C0C0C000C0C0C000FFFF + FF00808080000000000000000000000000000000000000000000C0C0C0008080 + 8000C0C0C000808080000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000008000000080000000808080008080 + 800080808000808080008080800080000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00800000008000000000000000808080000000000000000000FFFF + FF0080808000C0C0C000FFFFFF0000000000C0C0C000C0C0C000C0C0C0008080 + 800000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000008000000080000000808080008080 + 800080808000808080008080800080000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00800000008000000000000000000000000000000000000000C0C0 + C0000000000080808000C0C0C00000000000C0C0C000C0C0C000C0C0C0008080 + 800000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000008000000080000000808080008080 + 800080808000808080008080800080000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00800000008000000000000000000000000000000000000000C0C0 + C000FFFFFF00000000008080800080808000C0C0C000C0C0C000C0C0C0008080 + 800000000000808080000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000008000000080000000808080008080 + 800080808000808080008080800080000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00800000008000000000000000000000000000000080808000C0C0 + C000C0C0C000C0C0C000FFFFFF00FFFFFF00FFFFFF00C0C0C000808080008080 + 800000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000008000000080000000808080008080 + 80008080800080808000800000000000000080000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF008000000080000000000000000000000000000000000000008080 + 8000000000000000000000000000C0C0C0000000000080808000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000080000000800000008000 + 0000800000008000000000000000000000000000000080000000800000008000 + 0000800000008000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000C0C0C0000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080808000808080008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFC01F0000000CC007C01F0000 + 00088003C007000000010001C007000000030001C001000000030001C0010000 + 00030000C001000000030000C001000000038000C00100000007C000C0010000 + 000FE001C0010000000FE007F0010000000FF007F0030000001FF003FC070000 + 003FF803FC0F0000007FFFFFFFFF0000FFFFFFFFFFFFFFFFFE3FFFFFFFFFFFFF + FC3FC007FFF9F83FE027C007E7FF0001C003C007C3F30001E007C007C3E70001 + 8001C007E1C700010001C007F08F00010001C007F81F00010001C007FC3F0001 + E007C007F81F0001E003C007F09F0001C007C00FC1C70101E42FC01F83E38383 + FC3FC03F8FF1FFFFFC3FFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSCPDsg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSCPDsg.pas new file mode 100644 index 00000000..98a7e43a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSCPDsg.pas @@ -0,0 +1,676 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSCPDsg; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls, ComCtrls, ImgList, Menus, dxPSCore, dxPSForm; + +type + TdxfmCPDesignerOption = (doShowDescription); + TdxfmCPDesignerOptions = set of TdxfmCPDesignerOption; + + TdxfmCPDesigner = class(TCustomdxPSForm) + pmItems: TPopupMenu; + miDesign: TMenuItem; + miLine2: TMenuItem; + miAdd: TMenuItem; + miDelete: TMenuItem; + ilItems: TImageList; + btnClose: TButton; + btnHelp: TButton; + pcItems: TPageControl; + tbsItems: TTabSheet; + lvItems: TListView; + pnlButtons: TPanel; + btnDesign: TButton; + btnAdd: TButton; + btnDelete: TButton; + btnPageSetup: TButton; + btnPrintPreview: TButton; + btnPrint: TButton; + miPageSetup: TMenuItem; + miPrintPreview: TMenuItem; + miPrint: TMenuItem; + miLine1: TMenuItem; + miRename: TMenuItem; + btnAddComposition: TButton; + miAddComposition: TMenuItem; + pnlNoItems: TPanel; + procedure lvItemsChange(Sender: TObject; Item: TListItem; Change: TItemChange); + procedure AddClick(Sender: TObject); + procedure AddCompositionClick(Sender: TObject); + procedure DeleteClick(Sender: TObject); + procedure pmItemsPopup(Sender: TObject); + procedure DesignClick(Sender: TObject); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure lvItemsEdited(Sender: TObject; Item: TListItem; var S: String); + procedure lvItemsEditing(Sender: TObject; Item: TListItem; var AllowEdit: Boolean); + procedure lvItemsDblClick(Sender: TObject); + procedure PageSetupClick(Sender: TObject); + procedure PrintPreviewClick(Sender: TObject); + procedure PrintClick(Sender: TObject); + procedure RenameClick(Sender: TObject); + procedure tbsItemsResize(Sender: TObject); + procedure FormResize(Sender: TObject); + private + FComponentPrinter: TdxComponentPrinter; + FIsRefreshing: Boolean; + FListViewWndProc: TWndMethod; + FOptions: TdxfmCPDesignerOptions; + + function GetCurrentLink: TBasedxReportLink; + function GetItem(Index: Integer): TBasedxReportLink; + function GetItemCount: Integer; + function GetSelected(Index: Integer): Boolean; + function GetSelectedCount: Integer; + procedure SetCurrentLink(Value: TBasedxReportLink); + procedure SetSelected(Index: Integer; Value: Boolean); + + function CanAdd: Boolean; + function CanAddComposition: Boolean; + function CanDelete: Boolean; + function CanDesign: Boolean; + function CanPageSetup: Boolean; + function CanPrint: Boolean; + function CanPrintPreview: Boolean; + function CanRename: Boolean; + + procedure DeleteSelection; + function GetSelectedItemsAsString: string; + function HasOnlyBuiltInsAreInSelection: Boolean; + procedure Initialize; + procedure LoadStrings; + procedure RefreshColumns; + procedure RefreshList; + procedure UpdateControlsState; + + procedure ListViewWndProc(var Message: TMessage); + procedure SubClassListView; + procedure UnsubClassListView; + + procedure CMDialogChar(var Msg: TCMDialogChar); message CM_DIALOGCHAR; + protected + procedure BeforeConstruction; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + procedure Execute; + + procedure LoadFromRegistry(const APath: string); override; + procedure SaveToRegistry(const APath: string); override; + + property ComponentPrinter: TdxComponentPrinter read FComponentPrinter write FComponentPrinter; + property CurrentLink: TBasedxReportLink read GetCurrentLink write SetCurrentLink; + property ItemCount: Integer read GetItemCount; + property Items[Index: Integer]: TBasedxReportLink read GetItem; + property Selected[Index: Integer]: Boolean read GetSelected write SetSelected; + property SelectedCount: Integer read GetSelectedCount; + end; + + PdxCPDesignerDlgData = ^TdxCPDesignerDlgData; + TdxCPDesignerDlgData = record + ComponentPrinter: TdxComponentPrinter; + Options: TdxfmCPDesignerOptions; + end; + +procedure dxShowCPDesignerDlg(const AData: TdxCPDesignerDlgData); + +implementation + +{$R *.DFM} + +uses + Math, CommCtrl, cxClasses, dxPSGlbl, dxPSUtl, dxPSRes, dxPSPopupMan, + dxPSfmLnkAdd, dxPSCompsProvider; + +procedure dxShowCPDesignerDlg(const AData: TdxCPDesignerDlgData); +var + Dialog: TdxfmCPDesigner; +begin + if AData.ComponentPrinter = nil then Exit; + + Dialog := TdxfmCPDesigner.Create(nil); + try + Dialog.ComponentPrinter := AData.ComponentPrinter; + Dialog.FOptions := AData.Options; + Dialog.Execute; + finally + Dialog.Free; + end; +end; + +{ TdxfmCPDesigner } + +procedure TdxfmCPDesigner.FormResize(Sender: TObject); +const + BtnOffsetY = 6; +var + BtnOffsetX, RightOrigin, TopOrigin: Integer; +begin + BtnOffsetX := pcItems.Left; + RightOrigin := BtnOffsetX + pcItems.Width; + TopOrigin := pcItems.Top + pcItems.Height + BtnOffsetY; + + dxPSUtl.PlaceButtons([btnHelp, btnClose], BtnOffsetX, RightOrigin, TopOrigin); +end; + +procedure TdxfmCPDesigner.tbsItemsResize(Sender: TObject); +var + R: TRect; +begin + R := lvItems.ClientRect; + InflateRect(R, -3, -3); + with R do + begin + Top := (Bottom - Top - pnlNoItems.Height) div 2; + Bottom := Top + pnlNoItems.Height; + end; + pnlNoItems.BoundsRect := R; +end; + +procedure TdxfmCPDesigner.lvItemsChange(Sender: TObject; Item: TListItem; + Change: TItemChange); +begin + if (Change = ctState) and not FIsRefreshing then + UpdateControlsState; +end; + +procedure TdxfmCPDesigner.pmItemsPopup(Sender: TObject); +begin + miAdd.Enabled := CanAdd; + miAddComposition.Enabled := CanAddComposition; + miDelete.Enabled := CanDelete; + miRename.Enabled := CanRename; + miDesign.Enabled := CanDesign; + miPageSetup.Enabled := CanPageSetup; + miPrint.Enabled := CanPrint; + miPrintPreview.Enabled := CanPrintPreview; +end; + +procedure TdxfmCPDesigner.AddClick(Sender: TObject); +var + Data: TdxAddReportLinkDlgData; + I: Integer; + Component: TComponent; + LinkClass: TdxReportLinkClass; + Link: TBasedxReportLink; +begin + FillChar(Data, SizeOf(TdxAddReportLinkDlgData), 0); + Data.Components := TList.Create; + try + Data.ComponentPrinter := FComponentPrinter; + Data.Options := [adoShowDesignButton, adoShowDescriptionColumn, adoAllowMultiSelect, adoShowCaptionEdit]; + Data.ReportLinkCaption := cxGetResourceString(@sdxNewReport); + + if dxShowAddComponentsDlg(Data) then + for I := 0 to Data.Components.Count - 1 do + begin + Component := TComponent(Data.Components[I]); + LinkClass := dxPSLinkClassByCompClass(TComponentClass(Component.ClassType)); + if LinkClass <> nil then + begin + Link := ComponentPrinter.AddLink(Component); + Link.Caption := Data.ReportLinkCaption; + Link.Description := Data.ReportLinkDescription; + if Data.Components.Count = 1 then + Link.Name := Data.ReportLinkName; + RefreshList; + CurrentLink := Link; + if Data.DesignBtnPressed then + ComponentPrinter.DesignReport(Link); + end; + end; + finally + Data.Components.Free; + end; +end; + +procedure TdxfmCPDesigner.AddCompositionClick(Sender: TObject); +var + Link: TBasedxReportLink; +begin + Link := ComponentPrinter.AddEmptyLink(TdxCompositionReportLink); + Link.Caption := cxGetResourceString(@sdxNewCompositionCaption); + RefreshList; + CurrentLink := Link; + RenameClick(nil); +end; + +procedure TdxfmCPDesigner.DeleteClick(Sender: TObject); +begin + if not lvItems.IsEditing and + MessageQuestion(Format(cxGetResourceString(@sdxConfirmDeleteItem), [GetSelectedItemsAsString])) then + DeleteSelection; +end; + +procedure TdxfmCPDesigner.RenameClick(Sender: TObject); +begin + if SelectedCount = 1 then + lvItems.Selected.EditCaption; +end; + +procedure TdxfmCPDesigner.DesignClick(Sender: TObject); +begin + if CurrentLink.DesignReport then + RefreshList + else + UpdateControlsState; +end; + +procedure TdxfmCPDesigner.PageSetupClick(Sender: TObject); +begin + CurrentLink.PageSetup; +end; + +procedure TdxfmCPDesigner.PrintPreviewClick(Sender: TObject); +begin + CurrentLink.Preview(True); +end; + +procedure TdxfmCPDesigner.PrintClick(Sender: TObject); +begin + CurrentLink.Print(True, nil); +end; + +procedure TdxfmCPDesigner.FormCloseQuery(Sender: TObject; var CanClose: Boolean); +begin + CanClose := not lvItems.IsEditing; +end; + +procedure TdxfmCPDesigner.FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if (Key = VK_ESCAPE) or (Key = VK_RETURN) then Close; +end; + +procedure TdxfmCPDesigner.lvItemsEditing(Sender: TObject; Item: TListItem; + var AllowEdit: Boolean); +begin + AllowEdit := not Items[Item.Index].BuiltIn; + if AllowEdit then + lvItems.PopupMenu := nil; +end; + +procedure TdxfmCPDesigner.lvItemsEdited(Sender: TObject; Item: TListItem; + var S: string); +begin + Items[Item.Index].Caption := S; +end; + +procedure TdxfmCPDesigner.lvItemsDblClick(Sender: TObject); +begin + if SelectedCount = 1 then btnDesign.Click; +end; + +constructor TdxfmCPDesigner.Create(AOwner: TComponent); +begin + inherited; + HelpContext := dxPSGlbl.dxhcAddComponentsToComponentPrinterDlg; + dxPSPopupMenuController.RegisterControl(lvItems); + SubClassListView; +end; + +destructor TdxfmCPDesigner.Destroy; +begin + UnsubClassListView; + dxPSPopupMenuController.UnregisterControl(lvItems); + inherited; +end; + +procedure TdxfmCPDesigner.Execute; +begin + Initialize; + ShowModal; +end; + +procedure TdxfmCPDesigner.LoadFromRegistry(const APath: string); +begin + inherited; + dxPSUtl.dxLoadListViewColumnsFromRegistry(lvItems, APath); +end; + +procedure TdxfmCPDesigner.SaveToRegistry(const APath: string); +begin + inherited; + dxPSUtl.dxSaveListViewColumnsToRegistry(lvItems, APath); +end; + +procedure TdxfmCPDesigner.BeforeConstruction; +begin + inherited; + Options := Options + [foSizeableDialog]; +end; + +function TdxfmCPDesigner.CanDesign: Boolean; +begin + Result := (SelectedCount = 1) and (CurrentLink <> nil) and CurrentLink.CheckToDesign; +end; + +function TdxfmCPDesigner.CanPageSetup: Boolean; +begin + Result := (SelectedCount = 1) and (CurrentLink <> nil); +end; + +function TdxfmCPDesigner.CanPrint: Boolean; +begin + Result := (SelectedCount = 1) and (CurrentLink <> nil) and CurrentLink.DataProviderPresent; +end; + +function TdxfmCPDesigner.CanPrintPreview: Boolean; +begin + Result := (SelectedCount = 1) and (CurrentLink <> nil) and CurrentLink.DataProviderPresent; +end; + +function TdxfmCPDesigner.CanRename: Boolean; +begin + Result := (SelectedCount = 1) and (CurrentLink <> nil) and not CurrentLink.BuiltIn; +end; + +procedure TdxfmCPDesigner.DeleteSelection; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + if Selected[I] and not Items[I].BuiltIn then + TObject(lvItems.Items[I].Data).Free; + RefreshList; +end; + +function TdxfmCPDesigner.GetCurrentLink: TBasedxReportLink; +begin + if SelectedCount = 1 then + Result := TBasedxReportLink(lvItems.Selected.Data) + else + Result := nil; +end; + +function TdxfmCPDesigner.GetItem(Index: Integer): TBasedxReportLink; +begin + Result := TBasedxReportLink(lvItems.Items[Index].Data); +end; + +function TdxfmCPDesigner.GetItemCount: Integer; +begin + Result := lvItems.Items.Count; +end; + +function TdxfmCPDesigner.GetSelected(Index: Integer): Boolean; +begin + Result := lvItems.Items[Index].Selected; +end; + +function TdxfmCPDesigner.GetSelectedCount: Integer; +begin + Result := lvItems.SelCount; +end; + +procedure TdxfmCPDesigner.SetCurrentLink(Value: TBasedxReportLink); +var + ListItem: TListItem; + I: Integer; +begin + ListItem := lvItems.FindData(0, Value, True, True); + if ListItem <> nil then + begin + lvItems.Items.BeginUpdate; + try + for I := 0 To ItemCount - 1 do + Selected[I] := False; + lvItems.Selected := ListItem; + finally + lvItems.Items.EndUpdate; + end; + end; +end; + +procedure TdxfmCPDesigner.SetSelected(Index: Integer; Value: Boolean); +begin + lvItems.Items[Index].Selected := Value; +end; + +function TdxfmCPDesigner.CanAdd: Boolean; +begin + Result := True; +end; + +function TdxfmCPDesigner.CanAddComposition: Boolean; +begin + Result := True; +end; + +function TdxfmCPDesigner.CanDelete: Boolean; +begin + Result := (SelectedCount <> 0) and not HasOnlyBuiltInsAreInSelection; +end; + +procedure TdxfmCPDesigner.LoadStrings; +begin + Caption := cxGetResourceString(@sdxEditReports); + + tbsItems.Caption := cxGetResourceString(@sdxItems); + pnlNoItems.Caption := cxGetResourceString(@sdxThereAreNowItemsForShow); + + btnAdd.Caption := AddEndEllipsis(cxGetResourceString(@sdxBtnAdd)); + btnAddComposition.Caption := cxGetResourceString(@sdxBtnAddComposition); + btnDelete.Caption := cxGetResourceString(@sdxBtnDelete); + btnDesign.Caption := cxGetResourceString(@sdxBtnDesign); + btnPageSetup.Caption := cxGetResourceString(@sdxBtnPageSetup); + btnPrint.Caption := cxGetResourceString(@sdxBtnPrint); + btnPrintPreview.Caption := cxGetResourceString(@sdxBtnPreview); + + btnClose.Caption := cxGetResourceString(@sdxBtnClose); + btnHelp.Caption := cxGetResourceString(@sdxBtnHelp); + + miAdd.Caption := AddEndEllipsis(cxGetResourceString(@sdxBtnAdd)); + miAddComposition.Caption := cxGetResourceString(@sdxBtnAddComposition); + miDelete.Caption := cxGetResourceString(@sdxBtnDelete); + miRename.Caption := cxGetResourceString(@sdxRename); + miDesign.Caption := cxGetResourceString(@sdxBtnDesign); + miPageSetup.Caption := cxGetResourceString(@sdxBtnPageSetup); + miPrint.Caption := cxGetResourceString(@sdxBtnPrint); + miPrintPreview.Caption := cxGetResourceString(@sdxBtnPreview); +end; + +function TdxfmCPDesigner.GetSelectedItemsAsString: string; +var + I: Integer; +begin + Result := ''; + for I := 0 to ItemCount - 1 do + if Selected[I] and not Items[I].BuiltIn then + begin + if Result <> '' then Result := Result + ', '; + Result := Result + '"' + lvItems.Items[I].Caption + '"'; + end; +end; + +function TdxfmCPDesigner.HasOnlyBuiltInsAreInSelection: Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to ItemCount - 1 do + if Selected[I] and not Items[I].BuiltIn then + Exit; + Result := True; +end; + +procedure TdxfmCPDesigner.Initialize; +begin + if HelpContext <> 0 then + BorderIcons := BorderIcons + [biHelp]; + btnHelp.Visible := HelpContext <> 0; + if not btnHelp.Visible then + btnClose.BoundsRect := btnHelp.BoundsRect; + + LoadStrings; + + RefreshColumns; + RefreshList; + + pnlNoItems.Parent := lvItems; + FormResize(nil); + tbsItemsResize(nil); +end; + +procedure TdxfmCPDesigner.RefreshColumns; +var + ColumnWidths: array of Integer; + I: Integer; +begin + lvItems.Columns.BeginUpdate; + try + SetLength(ColumnWidths, lvItems.Columns.Count); + for I := 0 to lvItems.Columns.Count - 1 do + ColumnWidths[I] := lvItems.Columns[I].Width; + + lvItems.Columns.Clear; + with lvItems.Columns.Add do + begin + Width := 2 * (lvItems.Width - GetSystemMetrics(SM_CXHSCROLL) - 2) div 3; + Caption := cxGetResourceString(@sdxItemName); + end; + + if doShowDescription in FOptions then + with lvItems.Columns.Add do + begin + Width := (lvItems.Width - GetSystemMetrics(SM_CXHSCROLL) - 2) div 3; + Caption := cxGetResourceString(@sdxItemDescription); + end; + + for I := 0 to MinIntValue([lvItems.Columns.Count - 1, Length(ColumnWidths) - 1]) do + lvItems.Columns[I].Width := ColumnWidths[I]; + finally + lvItems.Columns.EndUpdate; + end; +end; + +procedure TdxfmCPDesigner.RefreshList; +const + ViewStyles: array[Boolean] of TViewStyle = (vsReport, vsList); +var + Selection: TList; + I: Integer; + ReportLink: TBasedxReportLink; +begin + lvItems.Items.BeginUpdate; + FIsRefreshing := True; + try + Selection := TList.Create; + try + dxPSUtl.dxSaveListViewSelection(lvItems, Selection); + + lvItems.Items.Clear; + for I := 0 to ComponentPrinter.LinkCount - 1 do + begin + ReportLink := ComponentPrinter[I]; + with lvItems.Items.Add do + begin + Caption := ReportLink.Caption; + Data := ReportLink; + SubItems.Add(ReportLink.Description); + end; + end; + + dxPSUtl.dxRestoreListViewSelection(lvItems, Selection); + finally + Selection.Free; + end; + + lvItems.ViewStyle := ViewStyles[ItemCount = 0]; + lvItems.Enabled := ItemCount <> 0; + lvItems.HideSelection := ItemCount = 0; + if (lvItems.SelCount = 0) and (ItemCount <> 0) then + lvItems.Selected := lvItems.Items[0]; + finally + FIsRefreshing := False; + lvItems.Items.EndUpdate; + end; + UpdateControlsState; + lvItems.Refresh; +end; + +procedure TdxfmCPDesigner.UpdateControlsState; +begin + pnlNoItems.Visible := ItemCount = 0; + btnAdd.Enabled := CanAdd; + btnAddComposition.Enabled := CanAddComposition; + btnDelete.Enabled := CanDelete; + btnDesign.Enabled := CanDesign; + btnPageSetup.Enabled := CanPageSetup; + btnPrint.Enabled := CanPrint; + btnPrintPreview.Enabled := CanPrintPreview; +end; + +procedure TdxfmCPDesigner.ListViewWndProc(var Message: TMessage); +begin + FListViewWndProc(Message); + if Message.Msg = CN_NOTIFY then + if TWMNotify(Message).NMHdr^.code = LVN_ENDLABELEDIT then + lvItems.PopupMenu := pmItems; +end; + +procedure TdxfmCPDesigner.SubClassListView; +begin + lvItems.HandleNeeded; + FListViewWndProc := lvItems.WindowProc; + lvItems.WindowProc := ListViewWndProc; +end; + +procedure TdxfmCPDesigner.UnsubClassListView; +begin + lvItems.WindowProc := FListViewWndProc; +end; + +procedure TdxfmCPDesigner.CMDialogChar(var Msg: TCMDialogChar); +begin + inherited; + if IsAccel(Msg.CharCode, tbsItems.Caption) then + begin + Msg.Result := 1; + if lvItems.Enabled and lvItems.CanFocus then + ActiveControl := lvItems; + end; +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSChLbxLnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSChLbxLnk.dfm new file mode 100644 index 00000000..eefa3d15 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSChLbxLnk.dfm @@ -0,0 +1,369 @@ +object dxChlbxReportLinkDesignWindow: TdxChlbxReportLinkDesignWindow + Left = 548 + Top = 365 + BorderStyle = bsDialog + Caption = 'dxCLbReportLinkDesigner' + ClientHeight = 243 + ClientWidth = 552 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 3 + Width = 544 + Height = 204 + ActivePage = tshColor + MultiLine = True + TabOrder = 1 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = '&Options' + object pnlOptions: TPanel + Left = 0 + Top = 0 + Width = 536 + Height = 176 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Bevel11: TBevel + Left = 41 + Top = 18 + Width = 207 + Height = 4 + Shape = bsBottomLine + end + object Bevel4: TBevel + Left = 79 + Top = 90 + Width = 167 + Height = 4 + Shape = bsBottomLine + end + object Image5: TImage + Left = 10 + Top = 109 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0FFFFFFF7FFFFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFFF + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDDDDDDDDDDD0F77777777777777777777 + F07DD0F0000FF7F0000000FF000F07DDDDDDDDDDDD0F7FFF77777FF77777FFF7 + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDDDDDDDDDDD0F77777777777777777777 + F07DD0777777777777777777777707DDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFFF + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDDDDDDDDDDD0F77777777777777777777 + F07DD0F0000FF7F00000000000FF07DDDDDDDDDDDD0F7FFFFFFF7FFFFFFFFFF7 + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDDDDDDDDDDD0F7F000FFF7F00000F00F7 + F07DD0777777777777777777777707DDCDDDDCDDDD0F7FFFFFFF7FFFFFFFFFF7 + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDCCCCDCCDDD0F7F00000F7F00000000F7 + F07DD0F00000F7F0000000FF000F07DDCCCCCCCCDD0F7FFFFFFF7FFFFFFFFFF7 + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDCCCCDCCDDD0F77777777777777777777 + F07DD0777777777777777777777707DDCDDDDCDDDD0F7FFFFFFF7FFFFFFFFFF7 + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDDDDDDDDDDD0F7FFFFFFF7F000000FFF7 + F07DD0F00FFFF7F000000000000F07DDDDDDDDDDDD0F7FFFFFFF7FFFFFFFFFF7 + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDDDDDDDDDDD0F7FFFFFFF7F0000F000F7 + F07DD0F00000F7F00000000F000F07DDDDDDDDDDDD0F7FFFFFFF7FFFFFFFFFF7 + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDDDDDDDDDDD0F7F00000F7F00000000F7 + F07DD0777777777777777777777707DDDDDDDDDDDD0F7FFFFFFF7FFFFFFFFFF7 + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDCDDDDCDDDD0F7F00F00F7F000000FFF7 + F07DD0F00FFFF7F000000FF000FF07DDCCCCDCCDDD0F7FFFFFFF7FFFFFFFFFF7 + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDCCCCCCCCDD0F7F00000F7F00000000F7 + F07DD0F00000F7F000000000000F07DDCCCCDCCDDD0F7FFFFFFF7FFFFFFFFFF7 + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDCDDDDCDDDD0F77777777777777777777 + F07DD0000000000000000000000007DDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFFF + F07DD0888888808888888888888807DDDDDDDDDDDD0F77777777777777777777 + F07DD0880000808800000088888807DDDDDDDDDDDD0F77777777777777777777 + F07DD0888888808888888888888807DDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFFF + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgGrid: TImage + Left = 10 + Top = 34 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblShow: TLabel + Left = 6 + Top = 14 + Width = 26 + Height = 13 + Caption = 'Show' + end + object lblMiscellaneous: TLabel + Left = 6 + Top = 85 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + end + object chbxShowBorders: TCheckBox + Left = 95 + Top = 31 + Width = 148 + Height = 17 + Caption = 'Border' + TabOrder = 0 + OnClick = chbxShowBordersClick + end + object chbxShowHorzLines: TCheckBox + Tag = 1 + Left = 95 + Top = 54 + Width = 148 + Height = 17 + Caption = 'Horizontal Lines' + TabOrder = 1 + OnClick = chbxShowBordersClick + end + object chbxFlatCheckMarks: TCheckBox + Tag = 2 + Left = 95 + Top = 107 + Width = 148 + Height = 17 + Caption = 'Flat Check &Marks' + TabOrder = 2 + OnClick = chbxShowBordersClick + end + object chbxRowAutoHeight: TCheckBox + Left = 95 + Top = 153 + Width = 148 + Height = 17 + Caption = '&Row Auto Height' + TabOrder = 4 + OnClick = chbxRowAutoHeightClick + end + object lblPreview: TStaticText + Left = 256 + Top = 1 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 5 + end + object chbxAutoWidth: TCheckBox + Left = 95 + Top = 130 + Width = 148 + Height = 17 + Caption = 'AutoWidth' + TabOrder = 3 + OnClick = chbxAutoWidthClick + end + end + end + object tshColor: TTabSheet + Caption = '&Color' + object pnlColor: TPanel + Left = 0 + Top = 0 + Width = 536 + Height = 176 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblGridLinesColor: TLabel + Left = 14 + Top = 143 + Width = 79 + Height = 13 + Caption = 'Grid Lines color: ' + OnClick = lblComboClick + end + object bvlLineColorHolder: TBevel + Left = 100 + Top = 137 + Width = 126 + Height = 21 + Visible = False + end + object lblDrawMode: TLabel + Left = 6 + Top = 13 + Width = 58 + Height = 13 + Caption = 'Draw &Mode:' + FocusControl = cbxDrawMode + OnClick = lblComboClick + end + object gbxTransparent: TGroupBox + Left = 6 + Top = 45 + Width = 232 + Height = 82 + Caption = ' ' + TabOrder = 2 + object lblColor: TLabel + Left = 9 + Top = 24 + Width = 35 + Height = 13 + Caption = 'Co&lor : ' + OnClick = lblComboClick + end + object bvlColorHolder: TBevel + Left = 94 + Top = 20 + Width = 126 + Height = 21 + Visible = False + end + object lblEvenColor: TLabel + Left = 9 + Top = 50 + Width = 59 + Height = 13 + Caption = 'E&ven Color: ' + OnClick = lblComboClick + end + object bvlEvenColorHolder: TBevel + Left = 94 + Top = 46 + Width = 126 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 18 + Top = 42 + Width = 15 + Height = 17 + Caption = 'T&ransparent' + TabOrder = 1 + OnClick = chbxTransparentClick + end + object cbxDrawMode: TComboBox + Left = 77 + Top = 8 + Width = 161 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 0 + OnClick = cbxDrawModeClick + OnDrawItem = cbxDrawModeDrawItem + Items.Strings = ( + 'Simpe' + 'Odd\Even Rows Mode' + 'Chess' + 'Borrow From Source') + end + object stTransparent: TStaticText + Left = 33 + Top = 43 + Width = 69 + Height = 17 + Caption = ' Transparent ' + FocusControl = chbxTransparent + TabOrder = 3 + OnClick = stTransparentClick + end + end + end + object tshFont: TTabSheet + Caption = '&Font' + object pnlFont: TPanel + Left = 0 + Top = 0 + Width = 536 + Height = 176 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object btnFont: TButton + Left = 8 + Top = 9 + Width = 110 + Height = 23 + Caption = 'Fo&nt ...' + TabOrder = 0 + OnClick = btnFontClick + end + object edFont: TEdit + Left = 8 + Top = 37 + Width = 231 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + Text = 'edFont' + end + object btnEvenFont: TButton + Tag = 1 + Left = 9 + Top = 70 + Width = 110 + Height = 23 + Caption = 'E&ven Font ...' + TabOrder = 2 + OnClick = btnFontClick + end + object edEvenFont: TEdit + Left = 9 + Top = 98 + Width = 231 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 3 + Text = 'edFont' + end + end + end + end + object pnlPreview: TPanel + Left = 265 + Top = 46 + Width = 273 + Height = 150 + BevelInner = bvLowered + BevelOuter = bvNone + Color = clWindow + TabOrder = 0 + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSChLbxLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSChLbxLnk.pas new file mode 100644 index 00000000..e8eec5a0 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSChLbxLnk.pas @@ -0,0 +1,707 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSChLbxLnk; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls, ComCtrls, CheckLst, dxPSCore, dxPSGrLnks, dxPSGlbl, + dxPSBaseGridLnk; + +type + TdxPSCheckGridCellDataMap = class(TdxPSTextGridCellDataMap) + protected + class procedure InitializeCellData(ACol, ARow: Integer; ADataItem: TAbstractdxReportCellData; + AReportLink: TAbstractdxGridReportLink); override; + class function DataClass: TdxReportCellDataClass; override; + end; + + TdxCheckListBoxPaintOption = (chlbxpoBorder, chlbxpoHorzLines, chlbxpoFlatCheckMarks); + TdxCheckListBoxPaintOptions = set of TdxCheckListBoxPaintOption; + + TdxCheckListBoxReportLink = class(TdxCustomListBoxReportLink) + private + FOptions: TdxCheckListBoxPaintOptions; + function GetOptions: TdxCheckListBoxPaintOptions; + function GetCheckListBox: TCheckListBox; + procedure SetOptions(Value: TdxCheckListBoxPaintOptions); + function IsFlatCheckMarks: Boolean; + protected + function GetDataItemClass(ACol: Integer; ARow: Integer = 0): TdxReportCellDataClass; override; + procedure InternalRestoreDefaults; override; + procedure InternalRestoreFromOriginal; override; + + function IsDrawBorder: Boolean; override; + function IsDrawHorzLines: Boolean; override; + procedure SetDrawMode(Value: TdxGridDrawMode); override; + public + procedure Assign(Source: TPersistent); override; + property CheckListBox: TCheckListBox read GetCheckListBox; + published + property AutoWidth; + property Color; + property EndEllipsis; + property EvenColor; + property EvenFont; + property Font; + property OddColor; + property OddFont; + property Options: TdxCheckListBoxPaintOptions read GetOptions write SetOptions + default [chlbxpoBorder..chlbxpoFlatCheckMarks]; + property Multiline; + property RowAutoHeight; + property ScaleFonts; + property SupportedCustomDraw; + property Transparent; + property UseCustomPageBreaks; + property UseHorzDelimiters; + property UseVertDelimiters; + property Width; + + property OnCustomDrawItem; + property OnGetCustomPageBreaks; + property OnInitializeItem; + end; + + TdxChlbxReportLinkDesignWindow = class(TStandarddxReportLinkDesignWindow) + pnlPreview: TPanel; + PageControl1: TPageControl; + tshOptions: TTabSheet; + pnlOptions: TPanel; + tshColor: TTabSheet; + pnlColor: TPanel; + lblGridLinesColor: TLabel; + chbxTransparent: TCheckBox; + tshFont: TTabSheet; + pnlFont: TPanel; + btnFont: TButton; + edFont: TEdit; + gbxTransparent: TGroupBox; + lblColor: TLabel; + bvlColorHolder: TBevel; + bvlLineColorHolder: TBevel; + chbxShowBorders: TCheckBox; + chbxShowHorzLines: TCheckBox; + chbxFlatCheckMarks: TCheckBox; + lblShow: TLabel; + Bevel11: TBevel; + lblMiscellaneous: TLabel; + Bevel4: TBevel; + btnEvenFont: TButton; + edEvenFont: TEdit; + lblEvenColor: TLabel; + bvlEvenColorHolder: TBevel; + chbxRowAutoHeight: TCheckBox; + Image5: TImage; + imgGrid: TImage; + lblDrawMode: TLabel; + cbxDrawMode: TComboBox; + lblPreview: TStaticText; + chbxAutoWidth: TCheckBox; + stTransparent: TStaticText; + procedure ccbxColorChange(Sender: TObject); + procedure btnFontClick(Sender: TObject); + procedure pbxPreviewPaint(Sender: TObject); + procedure chbxTransparentClick(Sender: TObject); + procedure lblComboClick(Sender: TObject); + procedure cbxDrawModeClick(Sender: TObject); + procedure chbxShowBordersClick(Sender: TObject); + procedure chbxRowAutoHeightClick(Sender: TObject); + procedure PageControl1Change(Sender: TObject); + procedure cbxDrawModeDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure chbxAutoWidthClick(Sender: TObject); + procedure stTransparentClick(Sender: TObject); + private + FccbxColor: TCustomComboBox; + FccbxEvenColor: TCustomComboBox; + FccbxGridLineColor: TCustomComboBox; + FItemCount: Integer; + FPaintWidth: Integer; + FPaintHeight: Integer; + FPreviewBox: TCustomPanel; + FPreviewFont: TFont; + FRectWidth: Integer; + FRectHeight: Integer; + procedure CreateControls; + function GetReportLink: TdxCheckListBoxReportLink; + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + protected + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + procedure LoadStrings; override; + procedure PaintPreview(ACanvas: TCanvas; R: TRect); override; + procedure UpdateControlsState; override; + procedure UpdatePreview; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property ReportLink: TdxCheckListBoxReportLink read GetReportLink; + end; + +const + dxDefaultCheckListBoxPaintOptions: TdxCheckListBoxPaintOptions = + [chlbxpoBorder, chlbxpoHorzLines, chlbxpoFlatCheckMarks]; + + DesignerStringCount = 6; + dxCheckListBoxStrings: array[0..DesignerStringCount - 1] of string = + ('Sample Text Row #1', 'Sample Text Row #2', 'Sample Text Row #3', + 'Sample Text Row #4', 'Sample Text Row #5', 'Sample Text Row #6'); + +implementation + +uses + cxClasses, dxExtCtrls, dxPSRes, dxPrnDev, dxPSUtl; + +{$R *.DFM} + +{ TdxPSCheckGridCellDataMap } + +class function TdxPSCheckGridCellDataMap.DataClass: TdxReportCellDataClass; +begin + Result := TdxReportCellCheck; +end; + +class procedure TdxPSCheckGridCellDataMap.InitializeCellData(ACol, ARow: Integer; + ADataItem: TAbstractdxReportCellData; AReportLink: TAbstractdxGridReportLink); +begin + inherited; + with TdxReportCellCheck(ADataItem) do + begin + CheckPos := ccpLeft; + Checked := TdxCheckListBoxReportLink(AReportLink).CheckListBox.State[ARow] > cbUnchecked; + Enabled := TdxCheckListBoxReportLink(AReportLink).CheckListBox.State[ARow] < cbGrayed; + {$IFDEF DELPHI5} + Enabled := Enabled and TdxCheckListBoxReportLink(AReportLink).CheckListBox.ItemEnabled[ARow]; + {$ENDIF} + FlatBorder := TdxCheckListBoxReportLink(AReportLink).IsFlatCheckMarks; + end; +end; + +{ TdxCheckListBoxReportLink } + +procedure TdxCheckListBoxReportLink.Assign(Source: TPersistent); +begin + if Source is TdxCheckListBoxReportLink then + Options := TdxCheckListBoxReportLink(Source).Options; + inherited; +end; + +procedure TdxCheckListBoxReportLink.InternalRestoreDefaults; +begin + inherited; + Options := dxDefaultCheckListBoxPaintOptions; +end; + +procedure TdxCheckListBoxReportLink.InternalRestoreFromOriginal; +begin + inherited; + if CheckListBox.Flat then + Options := Options + [chlbxpoFlatCheckMarks] + else + Options := Options - [chlbxpoFlatCheckMarks]; +end; + +function TdxCheckListBoxReportLink.IsDrawBorder: Boolean; +begin + Result := chlbxpoBorder in Options; +end; + +function TdxCheckListBoxReportLink.IsDrawHorzLines: Boolean; +begin + Result := chlbxpoHorzLines in Options; +end; + +procedure TdxCheckListBoxReportLink.SetDrawMode(Value: TdxGridDrawMode); +begin + if Value > gdmOddEven then Value := gdmOddEven; + inherited SetDrawMode(Value); +end; + +function TdxCheckListBoxReportLink.GetCheckListBox: TCheckListBox; +begin + Result := TCheckListBox(Component); +end; + +function TdxCheckListBoxReportLink.GetDataItemClass(ACol: Integer; ARow: Integer = 0): TdxReportCellDataClass; +begin + Result := TdxReportCellCheck; +end; + +function TdxCheckListBoxReportLink.IsFlatCheckMarks: Boolean; +begin + Result := chlbxpoFlatCheckMarks in Options; +end; + +function TdxCheckListBoxReportLink.GetOptions: TdxCheckListBoxPaintOptions; +begin + Result := FOptions; +end; + +procedure TdxCheckListBoxReportLink.SetOptions(Value: TdxCheckListBoxPaintOptions); +begin + if FOptions <> Value then + begin + FOptions := Value; + LinkModified(True); + end; +end; + +{ TdxChlbxReportLinkDesignWindow } + +constructor TdxChlbxReportLinkDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxhcCheckListBoxReportLinkDesigner; + inherited; + CreateControls; + FItemCount := 5; + FRectWidth := FPreviewBox.Width - 15; + FRectHeight := (FPreviewBox.Height - 15) div FItemCount; + FPaintWidth := FRectWidth + 1; + FPaintHeight := FItemCount * (FRectHeight + 1); + PageControl1.ActivePage := PageControl1.Pages[0]; + FPreviewFont := TFont.Create; +end; + +destructor TdxChlbxReportLinkDesignWindow.Destroy; +begin + FreeAndNil(FPreviewFont); + inherited; +end; + +procedure TdxChlbxReportLinkDesignWindow.CreateControls; +var + R: TRect; +begin + FccbxColor := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(FccbxColor) do + begin + BoundsRect := bvlColorHolder.BoundsRect; + Tag := MakeTTag(0); + Parent := gbxTransparent; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := dxDefaultColor; + OnChange := ccbxColorChange; + end; + lblColor.FocusControl := FccbxColor; + + FccbxEvenColor := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(FccbxEvenColor) do + begin + BoundsRect := bvlEvenColorHolder.BoundsRect; + Tag := MakeTTag(1); + Parent := gbxTransparent; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := dxDefaultColor; + OnChange := ccbxColorChange; + end; + lblEvenColor.FocusControl := FccbxEvenColor; + + FccbxGridLineColor := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(FccbxGridLineColor) do + begin + BoundsRect := bvlLineColorHolder.BoundsRect; + Tag := MakeTTag(2); + Parent := pnlColor; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := dxDefaultGridLineColor; + OnChange := ccbxColorChange; + end; + + lblGridLinesColor.FocusControl := FccbxGridLineColor; + FPreviewBox := TdxPSPaintPanel.Create(Self); + with TdxPSPaintPanel(FPreviewBox) do + begin + Parent := pnlPreview; + R := pnlPreview.BoundsRect; + OffsetRect(R, -R.Left, -R.Top); + InflateRect(R, -1, -1); + BoundsRect := R; + EdgeInner := esNone; + EdgeOuter := esNone; + OnPaint := pbxPreviewPaint; + end; +end; + +function TdxChlbxReportLinkDesignWindow.GetReportLink: TdxCheckListBoxReportLink; +begin + Result := inherited ReportLink as TdxCheckListBoxReportLink; +end; + +procedure TdxChlbxReportLinkDesignWindow.CMDialogChar(var Message: TCMDialogChar); +var + I: Integer; +begin + with PageControl1 do + for I := 0 to PageControl1.PageCount - 1 do + if IsAccel(Message.CharCode, Pages[I].Caption) then + begin + Message.Result := 1; + ActivePage := Pages[I]; + Exit; + end; +end; + +procedure TdxChlbxReportLinkDesignWindow.LoadStrings; +begin + inherited; + tshOptions.Caption := cxGetResourceString(@sdxOptions); + tshFont.Caption := cxGetResourceString(@sdxFonts); + tshColor.Caption := cxGetResourceString(@sdxColors); + lblPreview.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + lblShow.Caption := cxGetResourceString(@sdxShow); + chbxShowBorders.Caption := cxGetResourceString(@sdxBorderLines); + chbxShowHorzLines.Caption := cxGetResourceString(@sdxHorzLines); + + lblMiscellaneous.Caption := cxGetResourceString(@sdxMiscellaneous); + chbxFlatCheckMarks.Caption := cxGetResourceString(@sdxFlatCheckMarks); + chbxAutoWidth.Caption := cxGetResourceString(@sdxAutoWidth); + chbxRowAutoHeight.Caption := cxGetResourceString(@sdxRowAutoHeight); + + lblDrawMode.Caption := cxGetResourceString(@sdxDrawMode); + + with cbxDrawMode.Items do + begin + BeginUpdate; + try + Clear; + AddObject(cxGetResourceString(@sdxDrawModeStrict), TObject(gdmStrict)); + AddObject(cxGetResourceString(@sdxDrawModeOddEven), TObject(gdmOddEven)); + finally + EndUpdate; + end; + end; + + stTransparent.Caption := ' ' + cxGetResourceString(@sdxTransparent) + ' '; + lblColor.Caption := cxGetResourceString(@sdxColor); + lblEvenColor.Caption := cxGetResourceString(@sdxEvenColor); + lblGridLinesColor.Caption := cxGetResourceString(@sdxGridLinesColor); + + btnFont.Caption := cxGetResourceString(@sdxBtnFont); + btnEvenFont.Caption := cxGetResourceString(@sdxBtnEvenFont); +end; + +procedure TdxChlbxReportLinkDesignWindow.UpdateControlsState; +begin + inherited UpdateControlsState; + FccbxColor.Enabled := not chbxTransparent.Checked; + lblColor.Enabled := FccbxColor.Enabled; + FccbxEvenColor.Enabled := not chbxTransparent.Checked and + (ReportLink.DrawMode in [gdmOddEven, gdmChess]); + lblEvenColor.Enabled := FccbxEvenColor.Enabled; + + btnEvenFont.Enabled := ReportLink.DrawMode in [gdmOddEven, gdmChess]; + if ReportLink.DrawMode in [gdmOddEven, gdmChess] then + begin + lblColor.Caption := cxGetResourceString(@sdxOddColor); + btnFont.Caption := cxGetResourceString(@sdxBtnOddFont); + end + else + begin + lblColor.Caption := cxGetResourceString(@sdxColor); + btnFont.Caption := cxGetResourceString(@sdxBtnFont); + end; +end; + +procedure TdxChlbxReportLinkDesignWindow.DoInitialize; +begin + inherited DoInitialize; + + with cbxDrawMode do + ItemIndex := Items.IndexOfObject(TObject(ReportLink.DrawMode)); + chbxShowBorders.Checked := chlbxpoBorder in ReportLink.Options; + chbxShowHorzLines.Checked := chlbxpoHorzLines in ReportLink.Options; + chbxFlatCheckMarks.Checked := chlbxpoFlatCheckMarks in ReportLink.Options; + chbxAutoWidth.Checked := ReportLink.AutoWidth; + chbxRowAutoHeight.Checked := ReportLink.RowAutoHeight; + + chbxTransparent.Checked := ReportLink.Transparent; + TdxPSColorCombo(FccbxColor).ColorValue := ReportLink.Color; + TdxPSColorCombo(FccbxEvenColor).ColorValue := ReportLink.EvenColor; + TdxPSColorCombo(FccbxGridLineColor).ColorValue := ReportLink.GridLineColor; + + FontInfoToText(ReportLink.Font, edFont); + FontInfoToText(ReportLink.EvenFont, edEvenFont); +end; + +{$IFDEF DELPHI7} +function TdxChlbxReportLinkDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +procedure TdxChlbxReportLinkDesignWindow.PaintPreview(ACanvas: TCanvas; R: TRect); +const + CheckBorderMap: array[Boolean] of UINT = (0, DFCS_FLAT); + ControlStateMap: array[TCheckBoxState] of UINT = + (DFCS_BUTTONCHECK, DFCS_BUTTONCHECK or DFCS_CHECKED, DFCS_BUTTON3STATE or DFCS_CHECKED); + CheckStateMap: array[0..DesignerStringCount - 1] of TCheckBoxState = + (cbUnchecked, cbChecked, cbGrayed, cbUnchecked, cbChecked, cbChecked); +var + DC: HDC; + Brush: HBRUSH; + I, dY: Integer; + R2: TRect; + PrevBkMode: Integer; + PrevFont: HFONT; + PrevFontColor: COLORREF; + uState: UINT; + S: string; +begin + inherited; + DC := ACanvas.Handle; + //FillRect(DC, R, HBRUSH(COLOR_WINDOW + 1)); + InflateRect(R, -4, -4); + R2 := R; + dY := (R.Bottom - R.Top) div DesignerStringCount; + + with ReportLink do + begin + Brush := SelectObject(DC, CreateSolidBrush(ColorToRGB(GridLineColor))); + for I := 0 to DesignerStringCount do + if (((I = 0) or (I = DesignerStringCount)) and IsDrawBorder) or + ((I > 0) and (I < DesignerStringCount) and IsDrawHorzLines) then + begin + R := MakeRect(R2.Left + 1, R2.Top + I * dY, R2.Right - 1, R2.Top + I * dY + 1); + PatBlt(DC, R.Left, R.Top, R.Right - R.Left, R.Bottom - R.Top, PATCOPY); + end; + + if IsDrawBorder then + begin + R := MakeRect(R2.Left, R2.Top, R2.Left + 1, R2.Top + dY * DesignerStringCount + 1); + PatBlt(DC, R.Left, R.Top, R.Right - R.Left, R.Bottom - R.Top, PATCOPY); + R := MakeRect(R2.Right - 1, R2.Top, R2.Right, R2.Top + dY * DesignerStringCount + 1); + PatBlt(DC, R.Left, R.Top, R.Right - R.Left, R.Bottom - R.Top, PATCOPY); + end; + DeleteObject(SelectObject(DC, Brush)); + + PrevBkMode := SetBkMode(DC, Windows.TRANSPARENT); + PrevFont := GetCurrentObject(DC, OBJ_FONT); + PrevFontColor := GetTextColor(DC); + for I := 0 to DesignerStringCount - 1 do + begin + R := MakeRect(R2.Left + 1, R2.Top + I * dY + 1, R2.Right - 1, R2.Top + (I + 1) * dY + + Byte(not IsDrawHorzLines and (I < DesignerStringCount - 1))); + if not Transparent then + begin + Brush := CreateSolidBrush(ColorToRGB(ReportLink.GetCellColor(0, I))); + FillRect(DC, R, Brush); + DeleteObject(Brush); + end; + InflateRect(R, -2, -2); + Inc(R.Left, CheckWidth + 2); + + FPreviewFont.Assign(ReportLink.GetCellFont(0, I)); + FPreviewFont.Size := 8; + SelectObject(DC, FPreviewFont.Handle); + SetTextColor(DC, ColorToRGB(FPreviewFont.Color)); + S := dxCheckListBoxStrings[I]; + Windows.DrawText(DC, PChar(S), Length(S), R, DT_NOPREFIX or DT_SINGLELINE or + dxDrawTextTextAlignX[TextAlignX] or dxDrawTextTextAlignY[TextAlignY]); + + R := MakeBounds(R2.Left + 2, R2.Top + I * dY + 1 + (dY - CheckHeight) div 2, CheckWidth, CheckHeight); + uState := DFCS_TRANSPARENT or ControlStateMap[CheckStateMap[I]] or CheckBorderMap[IsFlatCheckMarks]; + DrawFrameControl(DC, R, DFC_BUTTON, uState); + end; + SetTextColor(DC, PrevFontColor); + SelectObject(DC, PrevFont); + SetBkMode(DC, PrevBkMode); + end; +end; + +procedure TdxChlbxReportLinkDesignWindow.chbxShowBordersClick(Sender: TObject); +var + Option: TdxCheckListBoxPaintOption; +begin + if LockControlsUpdate then Exit; + + Option := TdxCheckListBoxPaintOption(TTagToInt(TCheckBox(Sender).Tag)); + with ReportLink do + if TCheckBox(Sender).Checked then + Options := Options + [Option] + else + Options := Options - [Option]; + + Modified := True; + UpdatePreview; +end; + +procedure TdxChlbxReportLinkDesignWindow.chbxAutoWidthClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.AutoWidth := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxChlbxReportLinkDesignWindow.chbxRowAutoHeightClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.RowAutoHeight := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TdxChlbxReportLinkDesignWindow.cbxDrawModeClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TComboBox(Sender) do + ReportLink.DrawMode := TdxGridDrawMode(Items.Objects[ItemIndex]); + Modified := True; + UpdatePreview; +end; + +procedure TdxChlbxReportLinkDesignWindow.cbxDrawModeDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +begin + dxPSBaseGridLnk.dxPSDrawComboDrawModeItem(Control, Index, Rect, State); +end; + +procedure TdxChlbxReportLinkDesignWindow.chbxTransparentClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.Transparent := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TdxChlbxReportLinkDesignWindow.stTransparentClick(Sender: TObject); +begin + if chbxTransparent.CanFocus then ActiveControl := chbxTransparent; + chbxTransparent.Checked := not chbxTransparent.Checked; +end; + +procedure TdxChlbxReportLinkDesignWindow.UpdatePreview; +begin + FPreviewBox.Invalidate; +end; + +procedure TdxChlbxReportLinkDesignWindow.ccbxColorChange(Sender: TObject); +var + AColor: TColor; +begin + if LockControlsUpdate then Exit; + + AColor := TdxPSColorCombo(Sender).ColorValue; + case TTagToInt(TdxPSColorCombo(Sender).Tag) of + 0: ReportLink.Color := AColor; + 1: ReportLink.EvenColor := AColor; + 2: ReportLink.GridLineColor := AColor; + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxChlbxReportLinkDesignWindow.btnFontClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + + with dxPSGlbl.FontDialog do + begin + case TTagToInt(TComponent(Sender).Tag) of + 0: Font := ReportLink.Font; + 1: Font := ReportLink.EvenFont; + end; + if Execute then + begin + case TTagToInt(TComponent(Sender).Tag) of + 0: + begin + ReportLink.Font := Font; + FontInfoToText(ReportLink.Font, edFont); + end; + 1: + begin + ReportLink.EvenFont := Font; + FontInfoToText(ReportLink.EvenFont, edEvenFont); + end; + end; + Modified := True; + UpdatePreview; + end; + end; +end; + +procedure TdxChlbxReportLinkDesignWindow.pbxPreviewPaint(Sender: TObject); +begin + with TdxPSPaintPanel(Sender) do + PaintPreview(Canvas, ClientRect); +end; + +procedure TdxChlbxReportLinkDesignWindow.lblComboClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; + TCustomComboBox(ActiveControl).DroppedDown := True; +end; + +procedure TdxChlbxReportLinkDesignWindow.PageControl1Change(Sender: TObject); +begin + lblPreview.Parent := TPageControl(Sender).ActivePage; +end; + +procedure RegisterAssistants; +begin + TdxPSCheckGridCellDataMap.Register; +end; + +procedure UnregisterAssistants; +begin + TdxPSCheckGridCellDataMap.Unregister; +end; + +initialization + RegisterAssistants; + dxPSRegisterReportLink(TdxCheckListBoxReportLink, TCheckListBox, TdxChlbxReportLinkDesignWindow); + +finalization + dxPSUnregisterReportLink(TdxCheckListBoxReportLink, TCheckListBox, TdxChlbxReportLinkDesignWindow); + UnregisterAssistants; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSCompsProvider.pas b/official/x.35/ExpressPrinting System/Sources/dxPSCompsProvider.pas new file mode 100644 index 00000000..eac35dcf --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSCompsProvider.pas @@ -0,0 +1,214 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSCompsProvider; + +interface + +{$I cxVer.inc} + +uses + Classes, dxPSCore, dxPSSngltn; + +type + TdxComponentItem = class + private + FCaption: string; + FComponent: TComponent; + FDescription: string; + public + constructor Create(AComponent: TComponent; const ACaption, ADescription: string); + property Caption: string read FCaption write FCaption; + property Component: TComponent read FComponent write FComponent; + property Description: string read FDescription write FDescription; + end; + + TdxPSGetComponentOption = (gcoExcludeExisting, gcoExcludeOutOfActiveForm, gcoHideCustomContainers); + TdxPSGetComponentOptions = set of TdxPSGetComponentOption; + + TdxPSComponentsProviderClass = class of TAbstractdxPSComponentsProvider; + + TAbstractdxPSComponentsProvider = class + public + constructor Create; virtual; + procedure GetComponents(AComponentPrinter: TdxComponentPrinter; AReportLink: TBasedxReportLink; + AComponents: TStrings; AnOptions: TdxPSGetComponentOptions); virtual; abstract; + + class procedure Register; + class procedure Unregister; + end; + + TdxPSComponentProvidersFactory = class(TBasedxPSSingleton) + private + FItems: TList; + function GetActiveProvider: TAbstractdxPSComponentsProvider; + function GetCount: Integer; + function GetProvider(Index: Integer): TAbstractdxPSComponentsProvider; + protected + procedure FinalizeInstance; override; + procedure InitializeInstance; override; + public + class function Instance: TdxPSComponentProvidersFactory; reintroduce; overload; + + procedure GetComponents(AComponentPrinter: TdxComponentPrinter; AReportLink: TBasedxReportLink; + AComponents: TStrings; AnOptions: TdxPSGetComponentOptions); + function IndexOf(AProviderClass: TdxPSComponentsProviderClass): Integer; + procedure RegisterProvider(AProviderClass: TdxPSComponentsProviderClass); + procedure UnregisterProvider(AProviderClass: TdxPSComponentsProviderClass); + + property ActiveProvider: TAbstractdxPSComponentsProvider read GetActiveProvider; + property Count: Integer read GetCount; + property Providers[Index: Integer]: TAbstractdxPSComponentsProvider read GetProvider; default; + end; + +function dxPSCreateComponentItem(AComponent: TComponent; const ACaption, ADescription: string): TdxComponentItem; +function dxPSComponentProvidersFactory: TdxPSComponentProvidersFactory; + +implementation + +uses + SysUtils, dxPSUtl; + +function dxPSCreateComponentItem(AComponent: TComponent; const ACaption, ADescription: string): TdxComponentItem; +begin + Result := TdxComponentItem.Create(AComponent, ACaption, ADescription); +end; + +{ TdxComponentItem } + +constructor TdxComponentItem.Create(AComponent: TComponent; const ACaption, ADescription: string); +begin + inherited Create; + FComponent := AComponent; + FCaption := ACaption; + FDescription := ADescription; +end; + +{ TdxPSComponentProvidersFactory } + +function dxPSComponentProvidersFactory: TdxPSComponentProvidersFactory; +begin + Result := TdxPSComponentProvidersFactory.Instance; +end; + +class function TdxPSComponentProvidersFactory.Instance: TdxPSComponentProvidersFactory; +begin + Result := inherited Instance as TdxPSComponentProvidersFactory; +end; + +procedure TdxPSComponentProvidersFactory.GetComponents(AComponentPrinter: TdxComponentPrinter; + AReportLink: TBasedxReportLink; AComponents: TStrings; AnOptions: TdxPSGetComponentOptions); +begin + if ActiveProvider <> nil then + ActiveProvider.GetComponents(AComponentPrinter, AReportLink, AComponents, AnOptions); +end; + +function TdxPSComponentProvidersFactory.IndexOf(AProviderClass: TdxPSComponentsProviderClass): Integer; +begin + for Result := 0 to Count - 1 do + if Providers[Result].ClassType = AProviderClass then + Exit; + Result := -1; +end; + +procedure TdxPSComponentProvidersFactory.RegisterProvider(AProviderClass: TdxPSComponentsProviderClass); +begin + if IndexOf(AProviderClass) = -1 then FItems.Add(AProviderClass.Create); +end; + +procedure TdxPSComponentProvidersFactory.UnregisterProvider(AProviderClass: TdxPSComponentsProviderClass); +var + Index: Integer; +begin + Index := IndexOf(AProviderClass); + if Index <> -1 then + begin + Providers[Index].Free; + FItems.Delete(Index); + end; +end; + +procedure TdxPSComponentProvidersFactory.FinalizeInstance; +var + I: Integer; +begin + for I := 0 to Count - 1 do Providers[I].Free; + FreeAndNil(FItems); + inherited; +end; + +procedure TdxPSComponentProvidersFactory.InitializeInstance; +begin + inherited; + FItems := TList.Create; +end; + +function TdxPSComponentProvidersFactory.GetActiveProvider: TAbstractdxPSComponentsProvider; +begin + if Count <> 0 then + Result := Providers[Count - 1] + else + Result := nil; +end; + +function TdxPSComponentProvidersFactory.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxPSComponentProvidersFactory.GetProvider(Index: Integer): TAbstractdxPSComponentsProvider; +begin + Result := TAbstractdxPSComponentsProvider(FItems[Index]); +end; + +{ TAbstractdxPSComponentsProvider } + +constructor TAbstractdxPSComponentsProvider.Create; +begin + inherited Create; +end; + +class procedure TAbstractdxPSComponentsProvider.Register; +begin + dxPSComponentProvidersFactory.RegisterProvider(Self); +end; + +class procedure TAbstractdxPSComponentsProvider.Unregister; +begin + dxPSComponentProvidersFactory.UnregisterProvider(Self); +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSContainerLnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSContainerLnk.dfm new file mode 100644 index 00000000..f0f5dd7a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSContainerLnk.dfm @@ -0,0 +1,884 @@ +object dxfmCustomContainerDesignWindow: TdxfmCustomContainerDesignWindow + Left = 456 + Top = 379 + BorderStyle = bsDialog + Caption = 'dxfmCustomContainerDesignWindow' + ClientHeight = 315 + ClientWidth = 582 + Color = clBtnFace + Constraints.MinHeight = 342 + Constraints.MinWidth = 588 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 9 + Width = 574 + Height = 271 + ActivePage = tshReportLinks + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + OnChange = PageControl1Change + OnChanging = PageControl1Changing + object tshOptions: TTabSheet + Caption = 'Options' + object imgExpanding: TImage + Left = 9 + Top = 26 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDD7777777777777777777777777DDDDDDDDDDDD0000000000000000000000 + 000DDF888888888888888888888887DDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFFF + FF0DDF877777777777777777777787DDDDDDDDDDDD0F00000000000000000000 + 0F0DDF8F8888888888888888888787DDCDDDCDDDDD0F0FFFFFFFFFFFFFFFFFFF + 0F0DDF8F8000000000000000008787DDCCCDCCDDDD0F0F00000000000000000F + 0F0DDF8F80FFFFFFFFFFFFFFF08787DDCCCCCCCDDD0F0F0FFFFFFFFFFFFFFF0F + 0F0DDF8F80FFFFFFFFFFFFFFF08787DDCCCDCCDDDD0F0F0FFFFFFFFFFFFFFF0F + 0F0DDF8F80FFFFFFFFFFFFFFF08787DDCDDDCDDDDD0F0F0FFFFFFFFFFFFFFF0F + 0F0DDF8F80FFFFFFFFFFFFFFF08787DDDDDDDDDDDD0F0F0FFFFFFFFFFFFFFF0F + 0F0DDF8F80FFFFFFFFFFFFFFF08787DDDDDDDDDDDD0F0F0FFFFFFFFFFFFFFF0F + 0F0DDF8F80FFFFFFFFFFFFFFF08787DDDDDDDDDDDD0F0F0FFFFFFFFFFFFFFF0F + 0F0DDF8F8000000000000000008787DDDDDDDDDDDD0F0F00000000000000000F + 0F0DDF8F8888888888888888888787DDDDDDDDDDDD0F0FFFFFFFFFFFFFFFFFFF + 0F0DDF8F8000000888888888888787DDDDDDDDDDDD0F0F000000FFFFFFFFFFFF + 0F0DDF8F8888888888888888888787DDDDDDDDDDDD0F0FFFFFFFFFFFFFFFFFFF + 0F0DDF8F8000000888888888888787DDDDDDDDDDDD0F0F000000FFFFFFFFFFFF + 0F0DDF8F8888888888888888888787DDDDDDDDDDDD0F0FFFFFFFFFFFFFFFFFFF + 0F0DDF8FFFFFFFFFFFFFFFFFFFF787DDDDDDDDDDDD0F00000000000000000000 + 0F0DDF888888888888888888888887DDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFFF + FF0DDF8FFFFFFFFFFFFF8777777787DDDDDDDDDDDD0F0000000000000F000000 + 0F0DDF8788888888888F8F88888787DDDDDDDDDDDD0F0FFFFFFFFFFF0F0FFFFF + 0F0DDF8788888888888F8F88888787DDDDDDDDDDDD0F0FFFFFFFFFFF0F0FFFFF + 0F0DDF8777777777777F8F88888787DDCDDDCDDDDD0F0000000000000F0FFFFF + 0F0DDF888888888888888F88888787DDCCCDCCDDDD0FFFFFFFFFFFFFFF0FFFFF + 0F0DDF8FFFFFFFFFFFFF8F88888787DDCCCCCCCDDD0F0000000000000F0FFFFF + 0F0DDF8788888888888F8F80088787DDCCCDCCDDDD0F0FFFFFFFFFFF0F0F00FF + 0F0DDF8788888888888F8F88888787DDCDDDCDDDDD0F0FFFFFFFFFFF0F0FFFFF + 0F0DDF8777777777777F8FFFFFF787DDDDDDDDDDDD0F0000000000000F000000 + 0F0DDF888888888888888888888887DDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFFF + FF0DDFFFFFFFFFFFFFFFFFFFFFFFF7DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object bvlTransparents: TBevel + Left = 76 + Top = 10 + Width = 480 + Height = 4 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object imgPagination: TImage + Left = 9 + Top = 131 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDD0000000000000000000000007DDDDDDDDDDDD77777777777777770DDDDD + DDDDD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD7FFFFFFFFFFFFFFF0DDDDD + DDDDD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD7F7777777777777F0DDDDD + DDDDD0888000000000000000088F07DDDDDDDDDDDD7F78887F88F7FF7F07770D + DDDDD0F8F088887FFFF8FFFF0F8F07DDDDDDDDDDDD7F78887FFFF7FF7F0FFF0D + DDDDD0F8F080087F00F8F00F0F8F07DDDDDDDDDDDD7F7777777777777F077F0D + DDDDD0F8F088887FFFF8FFFF0F8F07DDDDDDDDDDDD7F78887F88F7FF7F0F7F07 + 770DD098F0000000000000000F8907DDDDDDDDDDDD7F78887FFFF7FF7F0F7F0F + FF0DD099FFFFFFFFFFFFFFFFFF9907DDCDDDDCDDDD7F7777777777777F0F7F07 + 7F0DD0999999999999999999999907DDCCCCDCCDDD7F78887FFFF7FF7F0F7F0F + 7F0DD099F0000000000000000F9907DDCCCCCCCCDD7F78787F88F7FF7F0F7F0F + 7F0DD098F088887FFFF8FFFF0F8907DDCCCCDCCDDD7F78887FFFF7FF7F0F7F0F + 7F0DD0F8F088887F88F8F88F0F8F07DDCDDDDCDDDD7F7777777777777F0F7F0F + 7F0DD0F8F080087F00F8F00F0F8F07DDDDDDDDDDDD7F78887FFFF7FF7F0F7F0F + 7F0DD0F8F088887FFFF8FFFF0F8F07DDDDDDDDDDDD7F78787F88F7FF7F0F7F0F + 7F0DD098F0000000000000000F8907DDCDDDDCDDDD7F78887FFFF7FF7F0F7F0F + 7F0DD099FFFFFFFFFFFFFFFFFF9907DDCCCCDCCDDD7F7777777777777F0F7F0F + 7F0DD0999999999999999999999907DDCCCCCCCCDD7F78887FFFF7FF7F0F7F0F + 7F0DD099F0000000000000000F9907DDCCCCDCCDDD7F78787F88F7FF7F0F7F0F + 7F0DD098F088887FFFF8FFFF0F8907DDCDDDDCDDDD7F78887FFFF7FF7F0F7F0F + 7F0DD0F8F088887F88F8F88F0F8F07DDDDDDDDDDDD7F7777777777777F0F7F0F + 7F0DD0F8F080087F00F8F00F0F8F07DDDDDDDDDDDD7FFFFFFFFFFFFFFF0F7F0F + 7F0DD0F8F088887FFFF8FFFF0F8F07DDDDDDDDDDDD00000000000000000F7F0F + 7F0DD0F8F0777778888888880F8F07DDDDDDDDDDDDDDDD7F7777777777777F0F + 7F0DD0F8F088887FFFF8FFFF0F8F07DDDDDDDDDDDDDDDD7FFFFFFFFFFFFFFF0F + 7F0DD0F8F080087F00F8F00F0F8F07DDDDDDDDDDDDDDDD00000000000000000F + 7F0DD0F8F088887FFFF8FFFF0F8807DDDDDDDDDDDDDDDDDDDD7F777777777777 + 7F0DD0888000000000000000088F07DDDDDDDDDDDDDDDDDDDD7FFFFFFFFFFFFF + FF0DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDDDDDDDDDD00000000000000 + 000DD000000000000000000000000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object Bevel1: TBevel + Left = 64 + Top = 115 + Width = 492 + Height = 4 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object bvlSize: TBevel + Left = 31 + Top = 183 + Width = 525 + Height = 4 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object imgSize: TImage + Left = 9 + Top = 199 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000008088807DDDDDDDDDDDD0800000000000000000000 + 807DD0F0FFFFFFFFFFFFFF0FFF0F07DDDDDDDDDDDD0F0FFFFFFFFFFFFFFFFFF0 + F07DD0F0F777777777777F0FFF8F07DDDDDDDDDDDD0F0F7777777777777777F0 + F07DD0F0F7FFFFFFFFFF7F0FFF0F07DDDDDDDDDDDD0F0F7FFFFFFFFFFFFFF7F0 + F07DD0F0F777777777777F0FFF8F07DDDDDDDDDDDD0F0F7777777777777777F0 + F07DD0F0FFFFFFFFFFFFFF0FFF0F07DDCDDDDCDDDD0F0FFFFFFFFFFFFFFFFFF0 + F07DD0F0F777777777777F0FFF8F07DDCCCCDCCDDD0F0F7777777777777777F0 + F07DD0F0F7FFFFFFFFFF7F0FFF0F07DDCCCCCCCCDD0F0F7FFFFFFFFFFFFFF7F0 + F07DD0F0F777777777777F0FFF8F07DDCCCCDCCDDD0F0F7777777777777777F0 + F07DD0F0FFFFFFFFFFFFFF0FFF0F07DDCDDDDCDDDD0F0FFFFFFFFFFFFFFFFFF0 + F07DD0F0F777777777777F0FFF8F07DDDDDDDDDDDD0F0F7777777777777777F0 + F07DD0F0F7FFFFFFFFFF7F0FFF0F07DDDDDDDDDDDD0F0F7FFFFFFFFFFFFFF7F0 + F07DD0F0F7FFFFFFFFFF7F0FFF8F07DDCDDDDCDDDD0F0F7FFFFFFFFFFFFFF7F0 + F07DD0F0F7F888888F8F7F0FFF0F07DDCCCCDCCDDD0F0F7F88888F8F8888F7F0 + F07DD0F0F7FFFFFFFFFF7F0FFF8F07DDCCCCCCCCDD0F0F7FFFFFFFFFFFFFF7F0 + F07DD0F0F7F88F888F8F7F0FFF0F07DDCCCCDCCDDD0F0F7F88F888F8F888F7F0 + F07DD0F0F7FFFFFFFFFF7F0FFF8F07DDCDDDDCDDDD0F0F7FFFFFFFFFFFFFF7F0 + F07DD0F0F777777777777F0FFF0F07DDDDDDDDDDDD0F0F7777777777777777F0 + F07DD0F0FFFFFFFFFFFFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFFFFFFFFFFFFFF0 + F07DD0F0F7777777F7777F0FFF0F07DDDDDDDDDDDD0F0F777777777F777777F0 + F07DD0F0F7FFFFF7F7FF7F0FFF8F07DDDDDDDDDDDD0F0F7FFFFFFF7F7FFFF7F0 + F07DD0F0F7777777F7777F0FFF0F07DDDDDDDDDDDD0F0F777777777F777777F0 + F07DD0F0FFFFFFFFFFFFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFFFFFFFFFFFFFF0 + F07DD0800000000000000008080807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblTransparents: TLabel + Left = 5 + Top = 5 + Width = 64 + Height = 13 + Caption = 'Transparents' + end + object lblPagination: TLabel + Left = 5 + Top = 110 + Width = 50 + Height = 13 + Caption = 'Pagination' + end + object lblSize: TLabel + Left = 5 + Top = 178 + Width = 19 + Height = 13 + Caption = 'Size' + end + object chbxTransparentRoot: TCheckBox + Left = 90 + Top = 26 + Width = 166 + Height = 17 + Caption = '&Root' + TabOrder = 0 + OnClick = TransparentClick + end + object chbxTransparentControls: TCheckBox + Tag = 1 + Left = 90 + Top = 47 + Width = 166 + Height = 17 + Caption = 'Controls' + TabOrder = 1 + OnClick = TransparentClick + end + object chbxTransparentContainers: TCheckBox + Tag = 2 + Left = 90 + Top = 67 + Width = 166 + Height = 17 + Caption = 'Containers' + TabOrder = 2 + OnClick = TransparentClick + end + object chbxTransparentGraphics: TCheckBox + Tag = 3 + Left = 90 + Top = 88 + Width = 166 + Height = 17 + Caption = '&Graphics' + TabOrder = 3 + OnClick = TransparentClick + end + object chbxTransparentGroups: TCheckBox + Tag = 4 + Left = 270 + Top = 26 + Width = 166 + Height = 17 + Caption = '&Groups' + TabOrder = 4 + OnClick = TransparentClick + end + object chbxTransparentItems: TCheckBox + Tag = 5 + Left = 270 + Top = 47 + Width = 166 + Height = 17 + Caption = '&Items' + TabOrder = 5 + OnClick = TransparentClick + end + object chbxPaginateByControlDetails: TCheckBox + Left = 90 + Top = 131 + Width = 166 + Height = 17 + Caption = 'Control Details' + TabOrder = 6 + OnClick = PaginationClick + end + object chbxPaginateByControls: TCheckBox + Tag = 1 + Left = 90 + Top = 152 + Width = 166 + Height = 17 + Caption = 'Controls' + TabOrder = 7 + OnClick = PaginationClick + end + object chbxPaginateByGroups: TCheckBox + Tag = 2 + Left = 270 + Top = 131 + Width = 166 + Height = 17 + Caption = '&Groups' + TabOrder = 8 + OnClick = PaginationClick + end + object chbxPaginateByItems: TCheckBox + Tag = 3 + Left = 270 + Top = 152 + Width = 166 + Height = 17 + Caption = '&Items' + TabOrder = 9 + OnClick = PaginationClick + end + object chbxAutoWidth: TCheckBox + Left = 90 + Top = 199 + Width = 166 + Height = 17 + Caption = 'Auto Width' + TabOrder = 10 + OnClick = SizeClick + end + end + object tshReportLinks: TTabSheet + Caption = 'Aggregated Links' + ImageIndex = 1 + OnResize = tshReportLinksResize + object pnlBtnSite: TPanel + Left = 474 + Top = 0 + Width = 92 + Height = 243 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object btnLinksDesign: TButton + Left = 7 + Top = 22 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Design...' + TabOrder = 0 + OnClick = DesignClick + end + object btnLinksRemoveInconsistents: TButton + Left = 7 + Top = 50 + Width = 80 + Height = 37 + Caption = 'Remove Unneeded' + TabOrder = 1 + OnClick = btnLinksRemoveInconsistentsClick + end + end + object pnlLinkListsSite: TPanel + Left = 0 + Top = 0 + Width = 474 + Height = 243 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object pnlAvailableLinksSite: TPanel + Left = 0 + Top = 0 + Width = 216 + Height = 243 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object lblAvailableLinks: TLabel + Left = 1 + Top = 5 + Width = 73 + Height = 13 + Caption = '&Available Links:' + FocusControl = lbxAvailableLinks + end + object lbxAvailableLinks: TListBox + Left = 0 + Top = 22 + Width = 216 + Height = 221 + Style = lbOwnerDrawFixed + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + DragMode = dmAutomatic + ItemHeight = 15 + MultiSelect = True + TabOrder = 0 + OnClick = lbxAggregatedLinksClick + OnDblClick = lbxAvailableLinksDblClick + OnDragDrop = lbxAvailableLinksDragDrop + OnDragOver = lbxAvailableLinksDragOver + OnDrawItem = lbxAggregatedLinksDrawItem + OnKeyDown = lbxAvailableLinksKeyDown + end + end + object pnlMoveButtonsSite: TPanel + Left = 216 + Top = 0 + Width = 42 + Height = 243 + Align = alLeft + BevelOuter = bvNone + TabOrder = 1 + object sbtnRemove: TSpeedButton + Left = 8 + Top = 133 + Width = 26 + Height = 26 + Glyph.Data = { + F6000000424DF600000000000000760000002800000010000000100000000100 + 0400000000008000000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00DDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD0DD + DDDDDDDDDDDD00DDDDDDDDDDDDD000DDDDDDDDDDDD0000DDDDDDDDDDD00000DD + DDDDDDDDDD0000DDDDDDDDDDDDD000DDDDDDDDDDDDDD00DDDDDDDDDDDDDDD0DD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD} + OnClick = sbtnRemoveClick + end + object sbtnAdd: TSpeedButton + Left = 8 + Top = 98 + Width = 26 + Height = 26 + Glyph.Data = { + F6000000424DF600000000000000760000002800000010000000100000000100 + 0400000000008000000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00DDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD0DDDDD + DDDDDDDDDD00DDDDDDDDDDDDDD000DDDDDDDDDDDDD0000DDDDDDDDDDDD00000D + DDDDDDDDDD0000DDDDDDDDDDDD000DDDDDDDDDDDDD00DDDDDDDDDDDDDD0DDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD} + OnClick = sbtnAddClick + end + end + object pnlAggregatedLinksSite: TPanel + Left = 258 + Top = 0 + Width = 216 + Height = 243 + Align = alClient + BevelOuter = bvNone + TabOrder = 2 + object lblAggregatedLinks: TLabel + Left = 1 + Top = 5 + Width = 87 + Height = 13 + Caption = 'A&ggregated Links:' + FocusControl = lbxAggregatedLinks + end + object lbxAggregatedLinks: TListBox + Left = 0 + Top = 22 + Width = 216 + Height = 221 + Style = lbOwnerDrawFixed + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + DragMode = dmAutomatic + ItemHeight = 15 + MultiSelect = True + TabOrder = 0 + OnClick = lbxAggregatedLinksClick + OnDblClick = lbxAggregatedLinksDblClick + OnDragDrop = lbxAggregatedLinksDragDrop + OnDragOver = lbxAggregatedLinksDragOver + OnDrawItem = lbxAggregatedLinksDrawItem + OnKeyDown = lbxAggregatedLinksKeyDown + end + end + end + end + object tshControls: TTabSheet + Caption = 'Controls' + ImageIndex = 2 + object btnControlsCheckAll: TButton + Left = 481 + Top = 4 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Check All' + TabOrder = 1 + OnClick = TreeViewCheckAllClick + end + object btnControlsExpandAll: TButton + Left = 481 + Top = 32 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'E&xpand All' + TabOrder = 2 + OnClick = TreeViewExpandAllClick + end + object tvControls: TTreeView + Left = 0 + Top = 0 + Width = 474 + Height = 243 + Align = alLeft + Anchors = [akLeft, akTop, akRight, akBottom] + HideSelection = False + Indent = 19 + ReadOnly = True + StateImages = ilControls + TabOrder = 0 + OnChange = TreeViewChange + OnClick = TreeViewClick + OnCustomDrawItem = TreeViewCustomDrawItem + OnKeyDown = TreeViewKeyDown + OnKeyPress = TreeViewKeyPress + OnMouseUp = TreeViewMouseUp + end + end + object tshHiddenControls: TTabSheet + Caption = 'Hidden Controls' + ImageIndex = 3 + object tvHiddenControls: TTreeView + Left = 0 + Top = 0 + Width = 474 + Height = 243 + Align = alLeft + Anchors = [akLeft, akTop, akRight, akBottom] + HideSelection = False + Indent = 19 + ReadOnly = True + StateImages = ilControls + TabOrder = 0 + OnChange = TreeViewChange + OnClick = TreeViewClick + OnCustomDrawItem = TreeViewCustomDrawItem + OnKeyDown = TreeViewKeyDown + OnKeyPress = TreeViewKeyPress + OnMouseUp = TreeViewMouseUp + end + object btnHiddenControlsCheckAll: TButton + Left = 481 + Top = 4 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Check All' + TabOrder = 1 + OnClick = TreeViewCheckAllClick + end + object btnHiddenControlsExpandAll: TButton + Left = 481 + Top = 32 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'E&xpand All' + TabOrder = 2 + OnClick = TreeViewExpandAllClick + end + end + end + object pmControls: TPopupMenu + Images = ilControlsPopup + OnPopup = pmControlsPopup + Left = 4 + Top = 285 + object miControlsCheckAll: TMenuItem + Caption = 'Check All' + ImageIndex = 0 + OnClick = TreeViewCheckAllClick + end + object miLine1: TMenuItem + Caption = '-' + end + object miControlsCheckStandardControls: TMenuItem + Caption = 'Check Standard Unprintable Controls' + Visible = False + OnClick = UnhideStandardControlsClick + end + object miControlsUncheckStandardControls: TMenuItem + Caption = 'Uncheck Standard Unprintable Controls' + Visible = False + OnClick = HideStandardControlsClick + end + object miLine2: TMenuItem + Caption = '-' + Visible = False + end + object miControlsCheckAllChildren: TMenuItem + Caption = 'Check All Children' + OnClick = TreeViewCheckAllChildrenClick + end + object miControlsUncheckAllChildren: TMenuItem + Caption = 'Uncheck All Children' + OnClick = TreeViewUncheckAllChildrenClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miControlsExpandAll: TMenuItem + Caption = 'Expand All' + ImageIndex = 1 + OnClick = TreeViewExpandAllClick + end + end + object ilControls: TImageList + Left = 32 + Top = 285 + end + object ilControlsPopup: TImageList + Left = 60 + Top = 285 + Bitmap = { + 494C010105000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000002000000001002000000000000020 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000007F7F7F007F7F7F007F7F7F0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F00000000007F7F + 7F007F7F7F000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000007F7F + 7F00000000000000000000000000000000000000000000000000000000000000 + 0000000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F000000 + 00000000000000000000BFBFBF00BFBFBF00BFBFBF0000000000000000000000 + 000000000000000000007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F0000000000BFBF + BF007F7F7F000000000000000000BFBFBF00BFBFBF00000000007F7F7F00BFBF + BF0000000000000000007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F00BFBF + BF007F7F7F00BFBFBF00BFBFBF007F7F7F0000000000BFBFBF007F7F7F007F7F + 7F007F7F7F007F7F7F007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000BFBFBF00BFBFBF0000000000FFFFFF00FFFFFF0000000000BFBFBF000000 + 00000000000000000000000000007F7F7F000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000BFBFBF000000 + 0000BFBFBF0000000000BFBFBF00BFBFBF00BFBFBF00FFFFFF007F7F7F000000 + 0000BFBFBF00BFBFBF00000000007F7F7F000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000BFBFBF00BFBF + BF00FFFFFF00000000007F7F7F0000000000BFBFBF00FFFFFF007F7F7F00BFBF + BF00BFBFBF00BFBFBF00000000007F7F7F000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000000000000000 + 0000FFFFFF00000000007F7F7F007F7F7F00BFBFBF0000000000BFBFBF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000BFBFBF00FFFFFF00000000000000000000000000BFBFBF00BFBFBF000000 + 0000000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F00BFBF + BF007F7F7F00BFBFBF00FFFFFF00FFFFFF00BFBFBF00BFBFBF007F7F7F007F7F + 7F007F7F7F00000000007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F0000000000BFBF + BF007F7F7F000000000000000000BFBFBF000000000000000000BFBFBF00BFBF + BF00000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F000000 + 00007F7F7F0000000000BFBFBF00BFBFBF00BFBFBF00000000007F7F7F000000 + 00007F7F7F000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000007F7F + 7F0000000000000000000000000000000000000000007F7F7F00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000007F7F7F007F7F7F007F7F7F0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000808080000000000000000000000000000000 + 0000000000000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000808080000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF0000800000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000808080000000000000000000FFFFFF00FFFFFF00FFFFFF0000800000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000808080000000000000000000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00C0C0C000000000000000000000000000000000008080 + 8000000000000000000000000000FFFFFF00FFFFFF0000800000008000000080 + 0000FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF00FFFFFF0000800000008000000080 + 0000FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 000000000000C0C0C00000000000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00C0C0C000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF0000000000FFFFFF000080000000800000008000000080 + 000000800000FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF000080000000800000008000000080 + 000000800000FFFFFF00FFFFFF00000000000000000000000000000000000000 + 000000000000C0C0C00000000000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00C0C0C000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF0000000000FFFFFF000080000000800000FFFFFF000080 + 00000080000000800000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF000080000000800000FFFFFF000080 + 00000080000000800000FFFFFF00000000000000000000000000000000000000 + 000000000000C0C0C00000000000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00C0C0C000000000008080800000000000000000000000 + 0000FFFFFF00FFFFFF0000000000FFFFFF0000800000FFFFFF00FFFFFF00FFFF + FF000080000000800000FFFFFF00000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000800000FFFFFF00FFFFFF00FFFF + FF000080000000800000FFFFFF00000000000000000000000000000000000000 + 000000000000C0C0C00000000000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00C0C0C0000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF000080000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000800000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000800000FFFFFF00000000000000000000000000000000000000 + 000000000000C0C0C00000000000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00C0C0C0000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF000080000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 000000000000C0C0C00000000000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C0000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF000080000080808000000000000000000000000000000000000000 + 0000000000000000000000000000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0080808000000000000000000000000000000000000000 + 0000000000000000000000000000808080000000000000000000000000000000 + 000000000000C0C0C00080808000000000000000000000000000000000000000 + 00000000000000000000000000008080800000000000FFFFFF00008000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000800000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C00000000000000000000000000000000000FFFFFF00008000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000808080000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000808080000000000000000000000000000000000000000000000000000000 + 00000000000080808000000000000000000000000000FFFFFF00008000008080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000800000FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000008080800000000000000000000000 + 0000000000000000000000000000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF00FC7F000000000000FC27000000000000 + EC23000000000000C4010000000000008001000000000000C001000000000000 + E000000000000000000000000000000000000000000000000003000000000000 + E003000000000000C0010000000000008003000000000000C407000000000000 + EC3F000000000000FC7F000000000000FC00BBFFBC00BC00FC00BB00BC00BC00 + FC00B800B000B000E000BB0080008000E000BBFFB000B000E000B003B000B000 + 00008003B000B0000000B003B000B0000000BFFFB000B0000000B00380008000 + 00078003B003B0030007B003B003B0030007BFFFBFFFBFFF003F003F00030003 + 003F003F00030003003F003F0003000300000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSContainerLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSContainerLnk.pas new file mode 100644 index 00000000..e613c1f7 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSContainerLnk.pas @@ -0,0 +1,6817 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSContainerLnk; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, Classes, Controls, Graphics, StdCtrls, ExtCtrls, ComCtrls, + TabNotBk, Forms, ImgList, Menus, dxBase, dxPSCore, dxPSSngltn, dxPSShapes, + dxPSForm, dxPSFillPatterns, dxPSStandardFillPatterns, Buttons; + +type + TdxCustomContainerReportLink = class; + TdxCustomContainerReportLinkOptionsItemPlaceClass = class of TdxCustomContainerReportLinkOptionsItemPlace; + TdxCustomContainerReportLinkOptionsItemPlace = class; + TdxCustomContainerReportLinkOptionsPaginationClass = class of TdxCustomContainerReportLinkOptionsPagination; + TdxCustomContainerReportLinkOptionsPagination = class; + TdxCustomContainerReportLinkOptionsTransparentClass = class of TdxCustomContainerReportLinkOptionsTransparent; + TdxCustomContainerReportLinkOptionsTransparent = class; + TdxfmCustomContainerDesignWindow = class; + + { Report Items } + + TdxReportWinControlHost = class(TdxReportCell) + private + function GetHasControlItem: Boolean; + protected + procedure BoundsChanged; override; + function GetControlItem: TdxReportVisualItem; virtual; + public + function MeasureHeight(DC: HDC): Integer; override; + function MeasureWidth(DC: HDC): Integer; override; + + property ControlItem: TdxReportVisualItem read GetControlItem; + property HasControlItem: Boolean read GetHasControlItem; + end; + + TdxReportNativePrintableControlHost = class(TdxReportWinControlHost) + protected + function GetControlItem: TdxReportVisualItem; override; + procedure BoundsChanged; override; + end; + + { Definitions } + + TdxPSCustomContainerItemDefinitionClass = class of TdxPSCustomContainerItemDefinition; + + TdxPSCustomContainerItemDefinition = class(TPersistent) + private + FComponent: TComponent; + FOptionsPlace: TdxCustomContainerReportLinkOptionsItemPlace; + FReportItem: TdxReportVisualItem; + FReportLink: TdxCustomContainerReportLink; + function GetRootContainer: TWinControl; + function GetTopLevelRootContainer: TWinControl; + protected + procedure AddDelimitersHorz(AList: TList); virtual; + procedure AddDelimitersVert(AList: TList); virtual; + procedure AddReportItemToDelimitersHorz(AList: TList); + procedure AddReportItemToDelimitersVert(AList: TList); + + function GetSizeChangeReportItem: TdxReportVisualItem; virtual; + function GetSizeMeasureReportItem: TdxReportVisualItem; virtual; + public + constructor Create(AReportLink: TdxCustomContainerReportLink; AComponent: TComponent; AReportItem: TdxReportVisualItem); virtual; + destructor Destroy; override; + + function OptionsPagination: TdxCustomContainerReportLinkOptionsPagination; overload; virtual; + + property Component: TComponent read FComponent write FComponent; + property OptionsPlace: TdxCustomContainerReportLinkOptionsItemPlace read FOptionsPlace; + property ReportItem: TdxReportVisualItem read FReportItem write FReportItem; + property ReportLink: TdxCustomContainerReportLink read FReportLink; + property RootContainer: TWinControl read GetRootContainer; + property TopLevelRootContainer: TWinControl read GetTopLevelRootContainer; + property SizeChangeReportItem: TdxReportVisualItem read GetSizeChangeReportItem; + property SizeMeasureReportItem: TdxReportVisualItem read GetSizeMeasureReportItem; + end; + + TdxPSContainerControlDefinition = class(TdxPSCustomContainerItemDefinition) + private + function GetControl: TControl; + procedure SetControl(Value: TControl); + protected + procedure AddDelimitersHorz(AList: TList); override; + procedure AddDelimitersVert(AList: TList); override; + public + property Control: TControl read GetControl write SetControl; + end; + + TdxPSNativePrintableControlDefinition = class(TdxPSContainerControlDefinition) + private + FDelimitersHorz: TList; + FDelimitersVert: TList; + FReportDimension: TPoint; + function GetDelimitersOffset: TPoint; + protected + procedure AddDelimitersHorz(AList: TList); override; + procedure AddDelimitersVert(AList: TList); override; + procedure GetData(AReportLink: TBasedxReportLink); + procedure ShiftDelimiters; + + function GetSizeChangeReportItem: TdxReportVisualItem; override; + + property DelimitersOffset: Tpoint read GetDelimitersOffset; + property DelimitersHorz: TList read FDelimitersHorz; + property DelimitersVert: TList read FDelimitersVert; + property ReportDimension: TPoint read FReportDimension; + public + constructor Create(AReportLink: TdxCustomContainerReportLink; AComponent: TComponent; AReportItem: TdxReportVisualItem); override; + destructor Destroy; override; + end; + + TdxPSContainerWinControlDefinition = class(TdxPSContainerControlDefinition) + protected + function GetSizeChangeReportItem: TdxReportVisualItem; override; + end; + + TdxPSContainerDefinition = class(TdxPSContainerWinControlDefinition) + protected + function GetSizeMeasureReportItem: TdxReportVisualItem; override; + end; + + { Iterators } + + IdxPSContainerIterator = interface + ['{B18A68C0-5505-42AC-9B8D-B96C79A2725E}'] + function GetControl(Index: Integer): TControl; + function GetControlCount: Integer; + procedure GoBeforeBOF; + procedure GoBeyondEOF; + function IsBOF: Boolean; + function IsEOF: Boolean; + function Next: TControl; + function Prev: TControl; + + property ControlCount: Integer read GetControlCount; + property Controls[Index: Integer]: TControl read GetControl; + end; + + TdxPSWinControlIteratorClass = class of TdxPSWinControlIterator; + + TdxPSWinControlIterator = class(TInterfacedObject, IdxPSContainerIterator) + private + FControl: TWinControl; + FCounter: Integer; + protected + { IdxPSContainerIterator } + function GetControl(Index: Integer): TControl; virtual; + function GetControlCount: Integer; virtual; + procedure GoBeforeBOF; virtual; + procedure GoBeyondEOF; virtual; + function IsBOF: Boolean; virtual; + function IsEOF: Boolean; virtual; + function Next: TControl; virtual; + function Prev: TControl; virtual; + + property ControlCount: Integer read GetControlCount; + property Controls[Index: Integer]: TControl read GetControl; + public + constructor Create(AControl: TWinControl); virtual; + class function ContainerClass: TWinControlClass; virtual; + property Control: TWinControl read FControl; + end; + + { Producers } + + TdxPSCustomProducerClass = class of TdxPSCustomProducer; + + TdxPSCustomProducer = class(TdxCustomClassMapItem) + private + FProducingObject: TComponent; + FReportLink: TdxCustomContainerReportLink; + function GetDC: HDC; + function GetDefinition(Component: TComponent): TdxPSCustomContainerItemDefinition; + function GetIsDesigning: Boolean; + function GetProducer(Component: TComponent): TdxPSCustomProducer; + protected + class function BuddyClass: TdxPSCustomProducerClass; virtual; + class function HelperProducer: TdxPSCustomProducerClass; virtual; + + function CanProcessChild(AChildControl: TControl): Boolean; virtual; + + function GetScrollPosLeft: Integer; virtual; + function GetScrollPosTop: Integer; virtual; + procedure GetImageLists(AProc: TdxPSGetImageListProc); virtual; + procedure InitializeOptionsPlace(AnOptions: TdxCustomContainerReportLinkOptionsItemPlace); virtual; + + procedure DoReposition; virtual; + function MeasureItemHeight(AnItem: TdxReportVisualItem): Integer; virtual; + function MeasureItemWidth(AnItem: TdxReportVisualItem): Integer; virtual; + function ObjectExpandHeight: Boolean; virtual; + function ObjectExpandWidth: Boolean; virtual; + function ObjectShrinkHeight: Boolean; virtual; + function ObjectShrinkWidth: Boolean; virtual; + + function OptionsTransparent: TdxCustomContainerReportLinkOptionsTransparent; overload; virtual; + + property DC: HDC read GetDC; + property Definitions[Component: TComponent]: TdxPSCustomContainerItemDefinition read GetDefinition; + property IsDesigning: Boolean read GetIsDesigning; + property Producers[Component: TComponent]: TdxPSCustomProducer read GetProducer; + property ScrollPosLeft: Integer read GetScrollPosLeft; + property ScrollPosTop: Integer read GetScrollPosTop; + public + constructor Create(AReportLink: TdxCustomContainerReportLink; AnObject: TComponent); virtual; + + class function CanHasAvailableChildren: Boolean; virtual; + class function HasNativeSupportForBorders: Boolean; virtual; + class function Reenterable: Boolean; virtual; + + function Definition: TdxPSCustomContainerItemDefinition; overload; virtual; + class function DefinitionClass: TdxPSCustomContainerItemDefinitionClass; virtual; // must be overriden + + procedure Initialize(AnObject: TComponent); virtual; + + function ProducingObject: TComponent; overload; virtual; + function ProducingObjectFriendlyName: string; virtual; + + function ReportLink: TdxCustomContainerReportLink; overload; virtual; + procedure Reposition; virtual; + function RootContainer: TWinControl; overload; virtual; + function TopLevelRootContainer: TWinControl; overload; virtual; + + class procedure Register; virtual; + class procedure Unregister; virtual; + end; + + TdxPSCustomContainerItemProducerClass = class of TdxPSCustomContainerItemProducer; + + TdxPSCustomContainerItemProducer = class(TdxPSCustomProducer) + private + function GetControlBounds: TRect; + protected + function CanProcessChild(AChildControl: TControl): Boolean; override; + function CreateIterator: IdxPSContainerIterator; virtual; + + function GetContentColor: TColor; virtual; + function GetControlBoundsRect: TRect; virtual; + function GetFont: TFont; virtual; + function GetFontColor: TColor; virtual; + function GetFontIndex: Integer; virtual; + function GetFontName: string; virtual; + function GetFontStyle: TFontStyles; virtual; + function IsFontSubstitutable: Boolean; virtual; + + function HostClass: TdxReportCellClass; virtual; + procedure InitializeHost(ACell: TdxReportCell); virtual; + procedure InitializeItem(AnItem: TdxReportVisualItem); virtual; + function ItemClass: TdxReportVisualItemClass; virtual; + public + function Control: TControl; overload; virtual; + class function ControlClass: TControlClass; virtual; + + function Definition: TdxPSContainerControlDefinition; reintroduce; overload; + class function DefinitionClass: TdxPSCustomContainerItemDefinitionClass; override; + + class function PairClass: TClass; override; + + function ProducingObject: TControl; reintroduce; overload; + function ProducingObjectFriendlyName: string; override; + + property ContentColor: TColor read GetContentColor; + property ControlBounds: TRect read GetControlBounds; + property Font: TFont read GetFont; + property FontColor: TColor read GetFontColor; + property FontIndex: Integer read GetFontIndex; + property FontName: string read GetFontName; + property FontStyle: TFontStyles read GetFontStyle; + end; + + TdxPSCustomDelegateProducer = class(TdxPSCustomContainerItemProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + function Producer: TdxPSCustomContainerItemProducer; virtual; abstract; + end; + + TdxPSNativePrintableControlProducerClass = class of TdxPSNativePrintableControlProducer; + + TdxPSNativePrintableControlProducer = class(TdxPSCustomContainerItemProducer) + private + FIsOuterLinkUsed: Boolean; + protected + procedure AdjustItemBounds(AnItem: TdxReportVisualItem); virtual; + + function CreateControlReportLink: TBasedxReportLink; + procedure CreateNativePrintableControlData(AnItem: TdxReportVisualItem); + procedure DeinitializeReportLink(AControlReportLink: TBasedxReportLink); virtual; + class function GetLinkClass(AClass: TClass): TdxReportLinkClass; + class function HasReportLink(AComponent: TComponent): Boolean; + procedure InitializeReportLink(AControlReportLink: TBasedxReportLink); virtual; + + function HostClass: TdxReportCellClass; override; + procedure InitializeHost(ACell: TdxReportCell); override; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + procedure InitializeNativePrintableControlHost(AnItem: TdxReportVisualItem); virtual; + function ItemClass: TdxReportVisualItemClass; override; + + function MeasureItemHeight(AnItem: TdxReportVisualItem): Integer; override; + function MeasureItemWidth(AnItem: TdxReportVisualItem): Integer; override; + function ObjectExpandHeight: Boolean; override; + function ObjectExpandWidth: Boolean; override; + + property IsOuterLinkUsed: Boolean read FIsOuterLinkUsed; + public + class function Reenterable: Boolean; override; + function Definition: TdxPSNativePrintableControlDefinition; reintroduce; overload; + class function DefinitionClass: TdxPSCustomContainerItemDefinitionClass; override; + + class function HasNativeSupportForBorders: Boolean; override; + + class procedure Register; override; + class procedure Unregister; override; + end; + + TdxPSContainerControlProducer = class(TdxPSCustomContainerItemProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + end; + + TdxPSControlAsMetafileProducer = class(TdxPSContainerControlProducer) + protected + class function BuddyClass: TdxPSCustomProducerClass; override; + function CreateControlImage(AnItem: TdxReportVisualItem): TGraphic; virtual; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + public + class function PairClass: TClass; override; + class procedure Register; override; + class procedure Unregister; override; + + procedure Reposition; override; + end; + + TdxPSBevelProducer = class(TdxPSContainerControlProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + public + function Control: TBevel; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPSPaintBoxProducer = class(TdxPSContainerControlProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + public + function Control: TPaintBox; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPSShapeProducer = class(TdxPSContainerControlProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + public + function Control: TShape; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPSCustomLabelProducer = class(TdxPSContainerControlProducer) + protected + function GetControlBoundsRect: TRect; override; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + function ObjectExpandHeight: Boolean; override; + function ObjectExpandWidth: Boolean; override; + public + function Control: TCustomLabel; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPSContainerCustomWinControlProducer = class(TdxPSContainerControlProducer) + protected + function CreateIterator: IdxPSContainerIterator; override; + function HostClass: TdxReportCellClass; override; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + class function IteratorClass: TdxPSWinControlIteratorClass; virtual; + public + function Control: TWinControl; reintroduce; overload; + class function ControlClass: TControlClass; override; + class function DefinitionClass: TdxPSCustomContainerItemDefinitionClass; override; + end; + + TdxPSWinControlAsMetafileProducer = class(TdxPSContainerCustomWinControlProducer) + protected + class function BuddyClass: TdxPSCustomProducerClass; override; + function CreateControlImage(AnItem: TdxReportVisualItem): TGraphic; virtual; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + public + class function PairClass: TClass; override; + procedure Reposition; override; + class procedure Register; override; + class procedure Unregister; override; + end; + + TdxPSContainerWinControlProducer = class(TdxPSContainerCustomWinControlProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + function ObjectExpandHeight: Boolean; override; + end; + + TdxPSDateTimePickerProducer = class(TdxPSContainerWinControlProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + public + function Control: TDateTimePicker; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPSCustomHotKeyProducer = class(TdxPSContainerWinControlProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + public + function Control: TCustomHotKey; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPSCustomStaticTextProducer = class(TdxPSContainerWinControlProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + public + function Control: TCustomStaticText; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPSCustomEditProducer = class(TdxPSContainerWinControlProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + public + function Control: TCustomEdit; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPSCustomMemoProducer = class(TdxPSCustomEditProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ObjectExpandHeight: Boolean; override; + public + function Control: TCustomMemo; reintroduce; overload; + class function ControlClass: TControlClass; override; + + function ProducingObjectFriendlyName: string; override; + end; + + TdxPSCustomComboBoxProducer = class(TdxPSContainerWinControlProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + public + function Control: TCustomComboBox; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + {$IFDEF DELPHI6} + TdxPSCustomComboBoxExProducer = class(TdxPSContainerWinControlProducer) + protected + procedure GetImageLists(AProc: TdxPSGetImageListProc); override; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + public + function Control: TCustomComboBoxEx; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + {$ENDIF} + + TdxPSCustomCheckBoxProducer = class(TdxPSContainerWinControlProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + public + function Control: TCustomCheckBox; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPSRadioButtonProducer = class(TdxPSContainerWinControlProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + public + function Control: TRadioButton; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPSCustomContainerProducerClass = class of TdxPSCustomContainerProducer; + + TdxPSCustomContainerProducer = class(TdxPSContainerCustomWinControlProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ObjectExpandHeight: Boolean; override; + function ObjectExpandWidth: Boolean; override; + function ObjectShrinkHeight: Boolean; override; + function ObjectShrinkWidth: Boolean; override; + public + class function CanHasAvailableChildren: Boolean; override; + class function DefinitionClass: TdxPSCustomContainerItemDefinitionClass; override; + end; + + TdxPSCustomPanelProducer = class(TdxPSCustomContainerProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + function ObjectExpandHeight: Boolean; override; + function ObjectExpandWidth: Boolean; override; + public + function Control: TCustomPanel; reintroduce; overload; + class function ControlClass: TControlClass; override; + + class function HasNativeSupportForBorders: Boolean; override; + end; + + TdxPSCustomGroupBoxProducer = class(TdxPSCustomContainerProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + procedure InitializeLookAndFeel(AnItem: TdxReportVisualItem; ALookAndFeel: TdxPSReportGroupLookAndFeel); + function ItemClass: TdxReportVisualItemClass; override; + class function LookAndFeelClass: TdxPSReportGroupLookAndFeelClass; virtual; + public + function Control: TCustomGroupBox; reintroduce; overload; + class function ControlClass: TControlClass; override; + + class function HasNativeSupportForBorders: Boolean; override; + end; + + TdxPSCustomRadioGroupProducer = class(TdxPSCustomGroupBoxProducer) + protected + function CanProcessChild(AChildControl: TControl): Boolean; override; + procedure CreateItems(AReportRadioGroup: TdxReportRadioGroup); + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + procedure InitializeRadioItem(AnItem: TdxCustomReportCellRadio; AnIndex: Integer); virtual; + function ItemClass: TdxReportVisualItemClass; override; + public + function Control: TCustomRadioGroup; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPSRootContainerProducer = class(TdxPSCustomContainerProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + end; + + TdxPSTabControlProducer = class(TdxPSRootContainerProducer) + public + function Control: TTabControl; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPSPageControlIterator = class(TdxPSWinControlIterator) + private + function GetPageControl: TPageControl; + protected + function GetControl(Index: Integer): TControl; override; + function GetControlCount: Integer; override; + public + property PageControl: TPageControl read GetPageControl; + end; + + TdxPSTabSheetProducer = class(TdxPSRootContainerProducer) + public + function Control: TTabSheet; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPSPageControlProducer = class(TdxPSRootContainerProducer)//TdxPSCustomDelegateProducer) + protected + function CanProcessChild(AChildControl: TControl): Boolean; override; + class function IteratorClass: TdxPSWinControlIteratorClass; override; + public + function Control: TPageControl; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPSNotebookIterator = class(TdxPSWinControlIterator) + private + function GetNotebook: TNotebook; + protected + function GetControl(Index: Integer): TControl; override; + function GetControlCount: Integer; override; + public + property Notebook: TNotebook read GetNotebook; + end; + + TdxPSNotebookPageProducer = class(TdxPSRootContainerProducer) + public + function Control: TPage; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPSNotebookProducer = class(TdxPSRootContainerProducer) + protected + function CanProcessChild(AChildControl: TControl): Boolean; override; + class function IteratorClass: TdxPSWinControlIteratorClass; override; + public + function Control: TNoteBook; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPSTabbedNotebookIterator = class(TdxPSWinControlIterator) + private + function GetTabbedNotebook: TTabbedNotebook; + protected + function GetControl(Index: Integer): TControl; override; + function GetControlCount: Integer; override; + public + property TabbedNotebook: TTabbedNotebook read GetTabbedNotebook; + end; + + TdxPSTabbedNotebookPageProducer = class(TdxPSRootContainerProducer) + public + function Control: TTabPage; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPSTabbedNotebookProducer = class(TdxPSRootContainerProducer) + protected + function CanProcessChild(AChildControl: TControl): Boolean; override; + class function IteratorClass: TdxPSWinControlIteratorClass; override; + public + function Control: TTabbedNotebook; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPSScrollingWinControlProducer = class(TdxPSRootContainerProducer) + protected + function GetScrollBarPos(AScrollBar: TControlScrollBar): Integer; virtual; + function GetScrollPosLeft: Integer; override; + function GetScrollPosTop: Integer; override; + + procedure InitializeHost(ACell: TdxReportCell); override; + + function ObjectExpandHeight: Boolean; override; + function ObjectExpandWidth: Boolean; override; + public + function Control: TScrollingWinControl; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + {$IFDEF DELPHI5} + TdxPSCustomFrameProducer = class(TdxPSScrollingWinControlProducer) + public + function Control: TCustomFrame; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + {$ENDIF} + + TdxPSCustomFormProducer = class(TdxPSScrollingWinControlProducer) + public + function Control: TCustomForm; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + { container builder } + + TdxPSContainerBuilderClass = class of TdxPSContainerBuilder; + + TdxPSContainerBuilder = class(TdxCustomClassMapItem) + private + FContainer: TWinControl; + FCurrentControl: TControl; + FHost: TdxReportCell; + FParentBuilder: TdxPSContainerBuilder; + FParentHost: TdxReportCell; + FReportLink: TdxCustomContainerReportLink; + function GetDC: HDC; + function GetIsRoot: Boolean; + function GetProducer(AControl: TControl): TdxPSCustomContainerItemProducer; + protected + procedure BuildNestedControls; + function CreateHost: TdxReportCell; virtual; + function CreateItemDefinition(AComponent: TComponent; AnItem: TdxReportVisualItem): TdxPSCustomContainerItemDefinition; + function CreateNestedControlsIterator: IdxPSContainerIterator; virtual; + function GetParentHost: TdxReportCell; virtual; + function HasAvailableChildren(AControl: TControl): Boolean; virtual; + procedure InitializeHost; virtual; + procedure InitializeItem(AnItem: TdxReportVisualItem); virtual; + + function IsAborted: Boolean; + procedure Progress(const APercentDone: Double); + + property CurrentControl: TControl read FCurrentControl; + property DC: HDC read GetDC; + property Producers[AControl: TControl]: TdxPSCustomContainerItemProducer read GetProducer; + public + constructor Create(AReportLink: TdxCustomContainerReportLink; AContainer: TWinControl; + AParentBuilder: TdxPSContainerBuilder; AParentHost: TdxReportCell = nil); virtual; + destructor Destroy; override; + + function Build: TdxReportCell; virtual; + function BuildControl(AControl: TControl; AParentHost: TdxReportCell = nil): TdxReportVisualItem; + function BuildNestedContainer(AContainer: TWinControl; AParentHost: TdxReportCell = nil): TdxReportCell; + + class function ContainerClass: TWinControlClass; virtual; + class function PairClass: TClass; override; + class procedure Register; + class procedure Unregister; + + property Container: TWinControl read FContainer; + property Host: TdxReportCell read FHost; + property IsRoot: Boolean read GetIsRoot; + property ParentBuilder: TdxPSContainerBuilder read FParentBuilder; + property ParentHost: TdxReportCell read GetParentHost; + property ReportLink: TdxCustomContainerReportLink read FReportLink; + end; + + TdxPSContainerReportLinkCustomCache = class(TdxCustomCache) + private + FReportLink: TdxCustomContainerReportLink; + public + constructor Create(AReportLink: TdxCustomContainerReportLink); virtual; + function ReportLink: TdxCustomContainerReportLink; overload; virtual; + end; + + TdxPSCustomProducerCache = class(TdxPSContainerReportLinkCustomCache) + private + function GetItem(Index: Integer): TdxPSCustomProducer; + function GetProducer(ProducerClass: TdxPSCustomProducerClass; Component: TComponent): TdxPSCustomProducer; + protected + property Items[Index: Integer]: TdxPSCustomProducer read GetItem; + public + property Producers[ProducerClass: TdxPSCustomProducerClass; Component: TComponent]: TdxPSCustomProducer read GetProducer; default; + end; + + { Options } + + TdxCustomContainerReportLinkOptionsClass = class of TdxCustomContainerReportLinkOptions; + + TdxCustomContainerReportLinkOptions = class(TPersistent) + private + FReportLink: TdxCustomContainerReportLink; + protected + procedure Changed; dynamic; + public + constructor Create(AReportLink: TdxCustomContainerReportLink); virtual; + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; virtual; + + property ReportLink: TdxCustomContainerReportLink read FReportLink; + end; + + TdxCustomContainerReportLinkOptionsBehaviorClass = class of TdxCustomContainerReportLinkOptionsBehavior; + + TdxCustomContainerReportLinkOptionsBehavior = class(TdxCustomContainerReportLinkOptions) + private + FConsumeExistingLinks: Boolean; + procedure SetConsumeExistingLinks(Value: Boolean); + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property ConsumeExistingLinks: Boolean read FConsumeExistingLinks write SetConsumeExistingLinks default True; // obsolete - Aggregated Links always consumed + end; + + TdxCustomContainerReportLinkOptionsDesignerTabsClass = class of TdxCustomContainerReportLinkOptionsDesignerTabs; + + TdxCustomContainerReportLinkOptionsDesignerTabs = class(TdxCustomContainerReportLinkOptions) + private + FAutoHideReportLinksIfEmpty: Boolean; + FControls: Boolean; + FReportLinks: Boolean; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property AutoHideReportLinksIfEmpty: Boolean read FAutoHideReportLinksIfEmpty write FAutoHideReportLinksIfEmpty default True; + property Controls: Boolean read FControls write FControls default True; + property ReportLinks: Boolean read FReportLinks write FReportLinks default True; + end; + + TdxCustomContainerReportLinkOptionsItemPlace = class(TdxCustomContainerReportLinkOptions) + private + FExpandHeight: Boolean; + FExpandWidth: Boolean; + FShrinkHeight: Boolean; + FShrinkWidth: Boolean; + protected + function GetData: Integer; virtual; + procedure SetData(Value: Integer); virtual; + + procedure ReadData(AStream: TStream); virtual; + procedure WriteData(AStream: TStream); virtual; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + + function HasHorzResizing: Boolean; + function HasVertResizing: Boolean; + + procedure SetAll; + procedure UnsetAll; + published + property ExpandHeight: Boolean read FExpandHeight write FExpandHeight default False; + property ExpandWidth: Boolean read FExpandWidth write FExpandWidth default False; + property ShrinkHeight: Boolean read FShrinkHeight write FShrinkHeight default False; + property ShrinkWidth: Boolean read FShrinkWidth write FShrinkWidth default False; + end; + + TdxCustomContainerReportLinkOptionsPagination = class(TdxCustomContainerReportLinkOptions) + private + FControlDetails: Boolean; + FControls: Boolean; + procedure SetControlDetails(Value: Boolean); + procedure SetControls(Value: Boolean); + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property ControlDetails: Boolean read FControlDetails write SetControlDetails default True; + property Controls: Boolean read FControls write SetControls default True; + end; + + TdxCustomContainerReportLinkOptionsRefinementsClass = class of TdxCustomContainerReportLinkOptionsRefinements; + + TdxCustomContainerReportLinkOptionsRefinements = class(TdxCustomContainerReportLinkOptions) + private + FRootBorders: Boolean; + procedure SetRootBorders(Value: Boolean); + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property RootBorders: Boolean read FRootBorders write SetRootBorders default False; + end; + + TdxCustomContainerReportLinkOptionsTransparent = class(TdxCustomContainerReportLinkOptions) + private + FContainers: Boolean; + FControls: Boolean; + FGraphics: Boolean; + FRoot: Boolean; + procedure SetContainters(Value: Boolean); + procedure SetControls(Value: Boolean); + procedure SetGraphics(Value: Boolean); + procedure SetRoot(Value: Boolean); + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property Containers: Boolean read FContainers write SetContainters default True; + property Controls: Boolean read FControls write SetControls default True; + property Graphics: Boolean read FGraphics write SetGraphics default False; + property Root: Boolean read FRoot write SetRoot default True; + end; + + TdxNodeObject = class + public + Caption: string; + Component: TComponent; + State: TCheckBoxState; + end; + + TdxPSReportLinkProcessingStage = (psBefore, psAfter); + + TdxContainerReportLinkCustomDrawItemEvent = procedure(Sender: TdxCustomContainerReportLink; + ACanvas: TCanvas; AnItem: TAbstractdxReportCellData; AComponent: TComponent; var ADone: Boolean) of object; + + TdxContainerReportLinkGetComponentReportLinkEvent = procedure(Sender: TdxCustomContainerReportLink; + AComponent: TComponent; var AReportLink: TBasedxReportLink) of object; + + TdxContainerReportLinkGetComponentCaptionEvent = procedure(Sender: TdxCustomContainerReportLink; + AComponent: TComponent; var ACaption: string) of object; + + TdxContainerReportLinkInitializeItemEvent = procedure(Sender: TdxCustomContainerReportLink; + AnItem: TdxReportVisualItem; AComponent: TComponent) of object; + + TdxContainerReportLinkInitializeItemOptionsPlaceEvent = procedure(Sender: TdxCustomContainerReportLink; + AnItem: TdxReportVisualItem; AComponent: TComponent; AOptionsPlace: TdxCustomContainerReportLinkOptionsItemPlace) of object; + + TdxContainerReportLinkInitializeReportLinkEvent = procedure(Sender: TdxCustomContainerReportLink; + AReportLink: TBasedxReportLink; AStage: TdxPSReportLinkProcessingStage) of object; + + TdxContainerReportLinkIsComponentProcessedEvent = procedure(Sender: TdxCustomContainerReportLink; + AComponent: TComponent; var AIsProcessed: Boolean) of object; + + TdxCustomContainerReportLink = class(TBasedxReportLink) + private + FActiveBuilder: TdxPSContainerBuilder; + FAggregatedReportLinks: TStrings; + FDefinitions: TList; + FDelimitersHorz: TList; + FDelimitersVert: TList; + FExcludedComponents: TStrings; + FHiddenComponents: TStrings; + FOptionsBehavior: TdxCustomContainerReportLinkOptionsBehavior; + FOptionsDesignerTabs: TdxCustomContainerReportLinkOptionsDesignerTabs; + //FOptionsItemPlace: TdxCustomContainerReportLinkOptionsItemPlace; {.2} + FOptionsPagination: TdxCustomContainerReportLinkOptionsPagination; + FOptionsRefinements: TdxCustomContainerReportLinkOptionsRefinements; + FOptionsTransparent: TdxCustomContainerReportLinkOptionsTransparent; + FPreparationFont: TFont; + FProducerCache: TdxPSCustomProducerCache; + FScreenDC: HDC; + FSupportedCustomDraw: Boolean; + FOnCustomDrawItem: TdxContainerReportLinkCustomDrawItemEvent; + FOnGetComponentCaption: TdxContainerReportLinkGetComponentCaptionEvent; + FOnGetComponentReportLink: TdxContainerReportLinkGetComponentReportLinkEvent; + FOnInitializeItem: TdxContainerReportLinkInitializeItemEvent; + FOnInitializeItemOptionsPlace: TdxContainerReportLinkInitializeItemOptionsPlaceEvent; + FOnInitializeReportLink: TdxContainerReportLinkInitializeReportLinkEvent; + FOnIsComponentProcessed: TdxContainerReportLinkIsComponentProcessedEvent; + function GetAggregatedReportLink(Index: Integer): TBasedxReportLink; + function GetAggregatedReportLinkCount: Integer; + function GetContainer: TWinControl; + function GetController: TdxCustomContainerReportLink; + function GetDefinition(Index: Integer): TdxPSCustomContainerItemDefinition; + function GetDefinitionByContainerItem(Component: TComponent): TdxPSCustomContainerItemDefinition; + function GetDefinitionByReportItem(Item: TdxReportVisualItem): TdxPSCustomContainerItemDefinition; + function GetDefinitionCount: Integer; + function GetDelimitersHorzCount: Integer; + function GetDelimitersHorzItem(Index: Integer): Integer; + function GetDelimitersVertCount: Integer; + function GetDelimitersVertItem(Index: Integer): Integer; + function GetDesignWindow: TdxfmCustomContainerDesignWindow; + function GetExcludedComponent(Index: Integer): TComponent; + function GetExcludedComponentCount: Integer; + function GetHiddenComponent(Index: Integer): TComponent; + function GetHiddenComponentCount: Integer; + function GetProducerByClass(ProducerClass: TdxPSCustomProducerClass; Component: TComponent): TdxPSCustomProducer; + function GetRootCell: TdxReportCell; + function GetTopLevelContainer: TWinControl; + procedure SetController(Value: TdxCustomContainerReportLink); + procedure SetOnCustomDrawItem(Value: TdxContainerReportLinkCustomDrawItemEvent); + procedure SetOptionsBehavior(Value: TdxCustomContainerReportLinkOptionsBehavior); + procedure SetOptionsDesignerTabs(Value: TdxCustomContainerReportLinkOptionsDesignerTabs); + //procedure SetOptionsItemPlace(Value: TdxCustomContainerReportLinkOptionsItemPlace); {.2} + procedure SetOptionsPagination(Value: TdxCustomContainerReportLinkOptionsPagination); + procedure SetOptionsRefinements(Value: TdxCustomContainerReportLinkOptionsRefinements); + procedure SetOptionsTransparent(Value: TdxCustomContainerReportLinkOptionsTransparent); + procedure SetSupportedCustomDraw(Value: Boolean); + + procedure LoadAggregatedReportLinks; + procedure ReadAggregatedReportLinks(Stream: TStream); + procedure WriteAggregatedReportLinks(Stream: TStream); + + procedure LoadExcludedComponents; + procedure ReadExcludedComponents(Stream: TStream); + procedure WriteExcludedComponents(Stream: TStream); + + procedure LoadHiddenComponents; + procedure ReadHiddenComponents(Stream: TStream); + procedure WriteHiddenComponents(Stream: TStream); + protected + procedure DefineProperties(Filer: TFiler); override; + procedure Loaded; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + + procedure AfterDesignReport(ADone: Boolean); override; + procedure BeforeDesignReport; override; + procedure ConstructReport(AReportCells: TdxReportCells); override; + procedure ConvertCoords; override; + procedure CustomDraw(AItem: TAbstractdxReportCellData; ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); override; + procedure DoApplyInDesigner; override; + procedure DoChangeComponent; override; + function GetDesignerClass: TdxReportLinkDesignWindowClass; override; + function GetEmptyPagesCanExist: Boolean; override; + procedure GetImageLists(AProc: TdxPSGetImageListProc); override; + procedure InternalRestoreDefaults; override; + + function IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; override; + procedure MakeDelimiters(AReportCells: TdxReportCells; AHorzDelimiters, AVertDelimiters: TList); override; + + function BuildContainer(AContainer: TWinControl; AParentBuilder: TdxPSContainerBuilder; AParentHost: TdxReportCell = nil): TdxReportCell; + function CreateBuilder(AContainer: TWinControl; AParentBuilder: TdxPSContainerBuilder; AParentHost: TdxReportCell = nil): TdxPSContainerBuilder; + function CreateItemDefinition(AComponent: TComponent; AnItem: TdxReportVisualItem): TdxPSCustomContainerItemDefinition; + + function GetProducer(Component: TComponent): TdxPSCustomProducer; + + procedure DoCustomDrawItem(ACanvas: TCanvas; AnItem: TAbstractdxReportCellData; var ADone: Boolean); dynamic; + procedure DoGetComponentCaption(AComponent: TComponent; var ACaption: string); dynamic; + function DoGetReportLink(AComponent: TComponent): TBasedxReportLink; dynamic; + procedure DoInitializeItem(AnItem: TdxReportVisualItem); dynamic; + procedure DoInitializeItemOptionsPlace(AnItem: TdxReportVisualItem); dynamic; + procedure DoInitializeReportLink(AReportLink: TBasedxReportLink; AStage: TdxPSReportLinkProcessingStage); dynamic; + function DoIsComponentProcessed(AComponent: TComponent): Boolean; dynamic; + + procedure PrepareConstruct; virtual; + procedure UnprepareConstruct; virtual; + + procedure CreateOptions; virtual; + procedure DestroyOptions; virtual; + function GetOptionsBehaviorClass: TdxCustomContainerReportLinkOptionsBehaviorClass; dynamic; + function GetOptionsDesignerTabsClass: TdxCustomContainerReportLinkOptionsDesignerTabsClass; dynamic; + function GetOptionsItemPlaceClass: TdxCustomContainerReportLinkOptionsItemPlaceClass; dynamic; + function GetOptionsPaginationClass: TdxCustomContainerReportLinkOptionsPaginationClass; dynamic; + function GetOptionsRefinementsClass: TdxCustomContainerReportLinkOptionsRefinementsClass; dynamic; + function GetOptionsTransparentClass: TdxCustomContainerReportLinkOptionsTransparentClass; dynamic; + procedure OptionsModified(AnOptions: TdxCustomContainerReportLinkOptions); dynamic; + + procedure AddDefinition(ADefinition: TdxPSCustomContainerItemDefinition); + procedure ClearDefinitions; + procedure DeleteDefinition(Index: Integer); + function FindDefinition(AComponent: TComponent; out AnIndex: Integer): Boolean; overload; + function FindDefinition(AnItem: TdxReportVisualItem; out AnIndex: Integer): Boolean; overload; + procedure FreeAndNilDefinitions; + + procedure AddControl(ATreeView: TTreeView; AParent: TTreeNode; AControl: TControl); + procedure AddHiddenControl(ATreeView: TTreeView; AParent: TTreeNode; AControl: TControl); + function AddNode(ATreeView: TTreeView; AParent: TTreeNode; AComponent: TComponent; AChecked: Boolean): TTreeNode; + function CreateNodeObject(AComponent: TComponent; AChecked: Boolean): TdxNodeObject; virtual; + function IsComponentEditable(AComponent: TComponent): Boolean; virtual; + procedure LoadControlsTree(ATreeView: TTreeView); virtual; + procedure LoadHiddenControlsTree(ATreeView: TTreeView); virtual; + + procedure InstallAggregatedReportLinksController(AnInstall: Boolean); + + function GetComponentByName(const AName: string): TComponent; + function GetPreparedFontIndex(AFont: TFont): Integer; overload; + function GetPreparedFontIndex(AFont: TFont; AnIsFontSubstitutable: Boolean; + const AFontName: string; AFontColor: TColor; AFontStyle: TFontStyles): Integer; overload; + function IsComponentProcessed(AComponent: TComponent): Boolean; + + procedure AddDelimiters; virtual; + procedure CreateRootLookAndFeel; virtual; + procedure HideDesignerTabs(ADesignWindow: TdxfmCustomContainerDesignWindow); virtual; + procedure PullReportItems; virtual; + procedure RepositionControls; virtual; + // + function NeedTwoPassRendering: Boolean; override; + function IsScaleGridLines: Boolean; override; + + property ActiveBuilder: TdxPSContainerBuilder read FActiveBuilder; + property Controller: TdxCustomContainerReportLink read GetController write SetController; + property DefinitionCount: Integer read GetDefinitionCount; + property Definitions[Index: Integer]: TdxPSCustomContainerItemDefinition read GetDefinition; + property DefinitionsByContainerItem[Component: TComponent]: TdxPSCustomContainerItemDefinition read GetDefinitionByContainerItem; + property DefinitionsByReportItem[Item: TdxReportVisualItem]: TdxPSCustomContainerItemDefinition read GetDefinitionByReportItem; + property DelimitersHorz: TList read FDelimitersHorz; + property DelimitersHorzCount: Integer read GetDelimitersHorzCount; + property DelimitersHorzItems[Index: Integer]: Integer read GetDelimitersHorzItem; + property DelimitersVert: TList read FDelimitersVert; + property DelimitersVertCount: Integer read GetDelimitersVertCount; + property DelimitersVertItems[Index: Integer]: Integer read GetDelimitersVertItem; + property PreparationFont: TFont read FPreparationFont; + property ProducerCache: TdxPSCustomProducerCache read FProducerCache; + property Producers[Component: TComponent]: TdxPSCustomProducer read GetProducer; + property RootCell: TdxReportCell read GetRootCell; + property ScreenDC: HDC read FScreenDC; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + class function Aggregable: Boolean; override; + + function CanHideComponent(AComponent: TComponent): Boolean; + function CanHideComponentByName(const AName: string): Boolean; + procedure HideComponent(AComponent: TComponent); + procedure HideComponentByName(const AName: string); + procedure HideComponents(const AComponents: array of TComponent); + procedure HideComponentsByName(const ANames: array of string); + function FindHiddenComponent(AComponent: TComponent; out AnIndex: Integer): Boolean; overload; + function FindHiddenComponent(AComponent: TComponent): Boolean; overload; + function FindHiddenComponentByName(const AName: string; out AnIndex: Integer): Boolean; overload; + function FindHiddenComponentByName(const AName: string): Boolean; overload; + procedure UnhideAllComponents; + procedure UnhideComponent(AComponent: TComponent); + procedure UnhideComponentByName(const AName: string); + procedure UnhideComponents(const AComponents: array of TComponent); + procedure UnhideComponentsByName(const ANames: array of string); + + procedure HideStandardControls; + procedure UnhideStandardControls; + + function CanExcludeComponent(AComponent: TComponent): Boolean; + function CanExcludeComponentByName(const AName: string): Boolean; + procedure ExcludeComponent(AComponent: TComponent); + procedure ExcludeComponentByName(const AName: string); + procedure ExcludeComponents(const AComponents: array of TComponent); + procedure ExcludeComponentsByName(const ANames: array of string); + function FindExcludedComponent(AComponent: TComponent; out AnIndex: Integer): Boolean; overload; + function FindExcludedComponent(AComponent: TComponent): Boolean; overload; + function FindExcludedComponentByName(const AName: string; out AnIndex: Integer): Boolean; overload; + function FindExcludedComponentByName(const AName: string): Boolean; overload; + procedure UnexcludeAllComponents; + procedure UnexcludeComponent(AComponent: TComponent); + procedure UnexcludeComponentByName(const AName: string); + procedure UnexcludeComponents(const AComponents: array of TComponent); + procedure UnexcludeComponentsByName(const ANames: array of string); + + procedure AggregateLink(AReportLink: TBasedxReportLink); + procedure DisaggregateAllLinks; + procedure DisaggregateInconsistentLinks; + procedure DisaggregateLink(AReportLink: TBasedxReportLink); + function FindAggregatedLinkByComponent(AComponent: TComponent): TBasedxReportLink; + function HasInconsistentlyAggregatedLinks: Boolean; + function IsLinkAggregable(AReportLink: TBasedxReportLink): Boolean; + function IsLinkAggregated(AReportLink: TBasedxReportLink): Boolean; + function IsLinkAggregatedConsistently(AReportLink: TBasedxReportLink): Boolean; + + property AggregatedReportLinkCount: Integer read GetAggregatedReportLinkCount; + property AggregatedReportLinks[Index: Integer]: TBasedxReportLink read GetAggregatedReportLink; + property Container: TWinControl read GetContainer; + property DesignWindow: TdxfmCustomContainerDesignWindow read GetDesignWindow; + property ExcludedComponentCount: Integer read GetExcludedComponentCount; + property ExcludedComponents[Index: Integer]: TComponent read GetExcludedComponent; + property HiddenComponentCount: Integer read GetHiddenComponentCount; + property HiddenComponents[Index: Integer]: TComponent read GetHiddenComponent; + property ProducersByClass[ProducerClass: TdxPSCustomProducerClass; Component: TComponent]: TdxPSCustomProducer read GetProducerByClass; + property TopLevelContainer: TWinControl read GetTopLevelContainer; + published + property Color; + property Font; + property OptionsBehavior: TdxCustomContainerReportLinkOptionsBehavior read FOptionsBehavior write SetOptionsBehavior; + property OptionsDesignerTabs: TdxCustomContainerReportLinkOptionsDesignerTabs read FOptionsDesignerTabs write SetOptionsDesignerTabs; + //property OptionsItemPlace: TdxCustomContainerReportLinkOptionsItemPlace read FOptionsItemPlace write SetOptionsItemPlace; {.2} + property OptionsPagination: TdxCustomContainerReportLinkOptionsPagination read FOptionsPagination write SetOptionsPagination; + property OptionsRefinements: TdxCustomContainerReportLinkOptionsRefinements read FOptionsRefinements write SetOptionsRefinements; + property OptionsTransparent: TdxCustomContainerReportLinkOptionsTransparent read FOptionsTransparent write SetOptionsTransparent; + property ScaleFonts; + property SupportedCustomDraw: Boolean read FSupportedCustomDraw write SetSupportedCustomDraw default False; + + property OnCustomDrawItem: TdxContainerReportLinkCustomDrawItemEvent read FOnCustomDrawItem write SetOnCustomDrawItem; + property OnGetComponentCaption: TdxContainerReportLinkGetComponentCaptionEvent read FOnGetComponentCaption write FOnGetComponentCaption; + property OnGetComponentReportLink: TdxContainerReportLinkGetComponentReportLinkEvent read FOnGetComponentReportLink write FOnGetComponentReportLink; + property OnInitializeItem: TdxContainerReportLinkInitializeItemEvent read FOnInitializeItem write FOnInitializeItem; + property OnInitializeItemOptionsPlace: TdxContainerReportLinkInitializeItemOptionsPlaceEvent read FOnInitializeItemOptionsPlace write FOnInitializeItemOptionsPlace; + property OnInitializeReportLink: TdxContainerReportLinkInitializeReportLinkEvent read FOnInitializeReportLink write FOnInitializeReportLink; + property OnIsComponentProcessed: TdxContainerReportLinkIsComponentProcessedEvent read FOnIsComponentProcessed write FOnIsComponentProcessed; + end; + + {$IFDEF DELPHI5} + {$IFNDEF DELPHI6} + {$DEFINE WMCONTEXTMENU} + {$ENDIF} + {$ENDIF} + + TdxfmCustomContainerDesignWindow = class(TStandarddxReportLinkDesignWindow) + PageControl1: TPageControl; + tshOptions: TTabSheet; + tshReportLinks: TTabSheet; + tshControls: TTabSheet; + pmControls: TPopupMenu; + miControlsCheckAll: TMenuItem; + miLine1: TMenuItem; + miControlsCheckAllChildren: TMenuItem; + miControlsUncheckAllChildren: TMenuItem; + miLine2: TMenuItem; + miControlsExpandAll: TMenuItem; + lblTransparents: TLabel; + imgExpanding: TImage; + bvlTransparents: TBevel; + chbxTransparentRoot: TCheckBox; + chbxTransparentControls: TCheckBox; + chbxTransparentContainers: TCheckBox; + btnControlsCheckAll: TButton; + btnControlsExpandAll: TButton; + chbxTransparentGraphics: TCheckBox; + chbxTransparentGroups: TCheckBox; + chbxTransparentItems: TCheckBox; + lblPagination: TLabel; + imgPagination: TImage; + Bevel1: TBevel; + chbxPaginateByControlDetails: TCheckBox; + chbxPaginateByControls: TCheckBox; + chbxPaginateByGroups: TCheckBox; + chbxPaginateByItems: TCheckBox; + ilControls: TImageList; + tvControls: TTreeView; + ilControlsPopup: TImageList; + tshHiddenControls: TTabSheet; + tvHiddenControls: TTreeView; + btnHiddenControlsCheckAll: TButton; + btnHiddenControlsExpandAll: TButton; + miControlsUncheckStandardControls: TMenuItem; + miControlsCheckStandardControls: TMenuItem; + miLine3: TMenuItem; + lblSize: TLabel; + bvlSize: TBevel; + imgSize: TImage; + chbxAutoWidth: TCheckBox; + pnlBtnSite: TPanel; + btnLinksDesign: TButton; + pnlLinkListsSite: TPanel; + pnlAvailableLinksSite: TPanel; + lblAvailableLinks: TLabel; + lbxAvailableLinks: TListBox; + pnlMoveButtonsSite: TPanel; + sbtnRemove: TSpeedButton; + sbtnAdd: TSpeedButton; + pnlAggregatedLinksSite: TPanel; + lbxAggregatedLinks: TListBox; + lblAggregatedLinks: TLabel; + btnLinksRemoveInconsistents: TButton; + procedure TreeViewClick(Sender: TObject); + procedure TreeViewKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure TreeViewKeyPress(Sender: TObject; var Key: Char); + procedure TreeViewCheckAllChildrenClick(Sender: TObject); + procedure TreeViewCheckAllClick(Sender: TObject); + procedure TreeViewUncheckAllChildrenClick(Sender: TObject); + procedure TreeViewExpandAllClick(Sender: TObject); + procedure pmControlsPopup(Sender: TObject); + procedure TreeViewCustomDrawItem(Sender: TCustomTreeView; + Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean); + procedure DesignClick(Sender: TObject); + procedure lbxAggregatedLinksClick(Sender: TObject); + procedure TreeViewChange(Sender: TObject; Node: TTreeNode); + procedure TransparentClick(Sender: TObject); + procedure lbxAggregatedLinksDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure PaginationClick(Sender: TObject); + procedure TreeViewMouseUp(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + procedure PageControl1Change(Sender: TObject); + procedure PageControl1Changing(Sender: TObject; + var AllowChange: Boolean); + procedure HideStandardControlsClick(Sender: TObject); + procedure UnhideStandardControlsClick(Sender: TObject); + procedure SizeClick(Sender: TObject); + procedure sbtnAddClick(Sender: TObject); + procedure sbtnRemoveClick(Sender: TObject); + procedure tshReportLinksResize(Sender: TObject); + procedure lbxAvailableLinksKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure lbxAggregatedLinksKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure lbxAvailableLinksDragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); + procedure lbxAvailableLinksDragDrop(Sender, Source: TObject; X, + Y: Integer); + procedure lbxAggregatedLinksDragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); + procedure lbxAggregatedLinksDragDrop(Sender, Source: TObject; X, + Y: Integer); + procedure lbxAggregatedLinksDblClick(Sender: TObject); + procedure lbxAvailableLinksDblClick(Sender: TObject); + procedure btnLinksRemoveInconsistentsClick(Sender: TObject); + private + FAreHiddenControlsChanged: Boolean; + {$IFDEF WMCONTEXTMENU} + FControlsTreeViewWndProc: TWndMethod; + FHiddenControlsTreeViewWndProc: TWndMethod; + {$ENDIF} + FLastActiveTab: TTabSheet; + function GetAggregatedLink(Index: Integer): TBasedxReportLink; + function GetAggregatedLinkCount: Integer; + function GetAggregatedLinkSelected(Index: Integer): Boolean; + function GetAvailableLink(Index: Integer): TBasedxReportLink; + function GetAvailableLinkCount: Integer; + function GetAvailableLinkSelected(Index: Integer): Boolean; + function GetControlsTab: TTabSheet; + function GetHiddenControlsTab: TTabSheet; + function GetReportLink: TdxCustomContainerReportLink; + function GetReportLinksTab: TTabSheet; + function GetSelectedReportLink: TBasedxReportLink; + + procedure DoCheckAllChildren(ANode: TTreeNode; AChecked: Boolean); + procedure DoToggleNodeState(ANode: TTreeNode); + + function CanAggregate: Boolean; + function CanDesign: Boolean; + function CanDisaggregate: Boolean; + function CanRemoveInconsistents: Boolean; + //function CanSelectAll(AListBox: TListBox): Boolean; + procedure DoAggregateSelectedLinks; + procedure DoDisaggregateSelectedLinks; + procedure DoSelectAll(AListBox: TListBox); + procedure RefreshAggregatedLinks; + procedure RefreshAvailableLinks; + + {$IFDEF WMCONTEXTMENU} + procedure ControlsTreeViewWndProc(var Message: TMessage); + procedure HiddenControlsTreeViewWndProc(var Message: TMessage); + procedure ProcessContextMenu(AMessage: TWMContextMenu; ATreeView: TTreeView); + procedure RestoreTreeViewsWndProc; + procedure SubstituteTreeViewsWndProc; + {$ENDIF} + protected + procedure BeforeConstruction; override; + procedure DoInitialize; override; + procedure LoadStrings; override; + procedure UpdateControlsState; override; + + function GetActiveTreeView: TTreeView; virtual; + procedure InitializeControlsTree; virtual; + procedure InitializeHiddenControlsTree; virtual; + function IsBoldNode(ANode: TTreeNode): Boolean; virtual; + procedure RefreshControlsTree; + procedure RefreshHiddenControlsTree; + procedure RefreshReportLinksList; + + procedure SetOptionsPaginationByIndex(AnIndex: Integer; AValue: Boolean); virtual; + //procedure SetOptionsPlaceByIndex(AnIndex: Integer; AValue: Boolean); virtual; {.2} + procedure SetOptionsSizeByIndex(AnIndex: Integer; AValue: Boolean); virtual; + procedure SetOptionsTransparentByIndex(AnIndex: Integer; AValue: Boolean); virtual; + + {$IFDEF DELPHI5} + procedure TreeView_AdvancedCustomDrawItem(Sender: TCustomTreeView; + Node: TTreeNode; State: TCustomDrawState; Stage: TCustomDrawStage; + var PaintImages, DefaultDraw: Boolean); + {$ENDIF} + procedure TreeView_BeginUpdate; + procedure TreeView_CheckAllChildren(ANode: TTreeNode; AChecked: Boolean); + procedure TreeView_EndUpdate; + procedure TreeView_FreeNodeObjects(ATreeView: TTreeView); + function TreeView_HasCheckedChildren(ANode: TTreeNode): Boolean; + function TreeView_HasRoot(ATreeView: TTreeView): Boolean; + function TreeView_HasUncheckedChildren(ANode: TTreeNode): Boolean; + function TreeView_GetNodeObject(ANode: TTreeNode): TdxNodeObject; + function TreeView_getRoot(ATreeView: TTreeView): TTreeNode; // API function TreeView_GetRoot already exists + function TreeView_IsNodeEditable(ANode: TTreeNode): Boolean; + procedure TreeView_NormalizeNode(ANode: TTreeNode); + procedure TreeView_SetNodeState(ANode: TTreeNode; AState: TCheckBoxState); + procedure TreeView_ToggleNodeState(ANode: TTreeNode); + procedure TreeView_UpdateNodeImage(ANode: TTreeNode); + procedure TreeView_UpdateNodesState(ANode: TTreeNode); + + property ActiveTreeView: TTreeView read GetActiveTreeView; + property ControlsTab: TTabSheet read GetControlsTab; + property HiddenControlsTab: TTabSheet read GetHiddenControlsTab; + property ReportLinksTab: TTabSheet read GetReportLinksTab; + property SelectedReportLink: TBasedxReportLink read GetSelectedReportLink; + + property AggregatedLinkCount: Integer read GetAggregatedLinkCount; + property AggregatedLinks[Index: Integer]: TBasedxReportLink read GetAggregatedLink; + property AggregatedLinkSelected[Index: Integer]: Boolean read GetAggregatedLinkSelected; + property AvailableLinkCount: Integer read GetAvailableLinkCount; + property AvailableLinks[Index: Integer]: TBasedxReportLink read GetAvailableLink; + property AvailableLinkSelected[Index: Integer]: Boolean read GetAvailableLinkSelected; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + property ReportLink: TdxCustomContainerReportLink read GetReportLink; + end; + +function dxPSIsComponentContainer(AComponentClass: TClass): Boolean; overload; +function dxPSIsComponentContainer(AComponent: TObject{TComponent}): Boolean; overload; +procedure dxPSRegisterContainer(AContainerClass: TWinControlClass; + ADesignerClass: TdxReportLinkDesignWindowClass = nil{TdxfmCustomContainerDesignWindow}); +procedure dxPSRegisterContainers(const AContainerClasses: array of TWinControlClass; + ADesignerClass: TdxReportLinkDesignWindowClass = nil{TdxfmCustomContainerDesignWindow}); +procedure dxPSUnregisterContainer(AContainerClass: TWinControlClass; + ADesignerClass: TdxReportLinkDesignWindowClass = nil{TdxfmCustomContainerDesignWindow}); +procedure dxPSUnregisterContainers(const AContainerClasses: array of TWinControlClass; + ADesignerClass: TdxReportLinkDesignWindowClass = nil{TdxfmCustomContainerDesignWindow}); + +function dxPSMakeFriendlyNameFromStrings(AStrings: TStrings): string; + +const + BevelShapeMap: array[TBevelShape] of TdxCellSides = + (csAll, csAll, [csTop], [csBottom], [csLeft], [csRight], []); + BevelStyleMap: array[TBevelStyle, TBevelShape] of TdxPSCellBorderClass = + ((TdxPSCellSunkenSoftBorder, TdxPSCellEtchedBorder, TdxPSCellRaisedSoftBorder, + TdxPSCellRaisedSoftBorder, TdxPSCellRaisedSoftBorder, TdxPSCellRaisedSoftBorder, TdxPSCellNullBorder), + (TdxPSCellRaisedSoftBorder, TdxPSCellBumpedBorder, TdxPSCellRaisedBorder, + TdxPSCellRaisedBorder, TdxPSCellRaisedBorder, TdxPSCellRaisedBorder, TdxPSCellNullBorder)); + BorderStyleMap: array[TBorderStyle] of TdxCellSides = ([], csAll); + BrushStyleMap: array[TBrushStyle] of TdxPSFillPatternClass = + (TdxPSSolidFillPattern, nil, TdxPSHorizontalFillPattern, TdxPSVerticalFillPattern, + TdxPSFDiagonalFillPattern, TdxPSBDiagonalFillPattern, TdxPSCrossFillPattern, + TdxPSDiagCrossFillPattern); + CheckAlignmentMap: array[TLeftRight] of TdxCellCheckPos = (ccpRight, ccpLeft); + Ctl3DBorderClassMap: array[Boolean] of TdxPSCellBorderClass = (TdxPSCellUltraFlatBorder, TdxPSCellSunkenBorder); + PanelBevelsMap: array[TPanelBevel, TPanelBevel] of TdxPSCellBorderClass = + ((TdxPSCellNullBorder, TdxPSCellSunkenSoftBorder, TdxPSCellRaisedSoftBorder, TdxPSCellRaisedSoftBorder), + (TdxPSCellSunkenSoftBorder, TdxPSCellSunkenBorder, TdxPSCellBumpedBorder, TdxPSCellBumpedBorder), + (TdxPSCellRaisedSoftBorder, TdxPSCellEtchedBorder, TdxPSCellRaisedBorder, TdxPSCellRaisedBorder), + (TdxPSCellRaisedSoftBorder, TdxPSCellEtchedBorder, TdxPSCellRaisedBorder, TdxPSCellRaisedBorder)); + PanelSingleBorderMap: array[Boolean] of TdxPSCellBorderClass = (TdxPSCellRaisedBorder, TdxPSCellEtchedBorder); + ShapeTypeMap: array[TShapeType] of TdxReportCellShapeClass = + (TdxReportCellRectangle, TdxReportCellSquare, TdxReportCellRoundRect, + TdxReportCellRoundSquare, TdxReportCellEllipse, TdxReportCellCircle); + + MaxCaptionLength: Integer = 64; + + ExpandHeightBit = $00000001; + ExpandHeightOffset = $00000000; + ExpandWidthBit = $00000002; + ExpandWidthOffset = $00000001; + ShrinkHeightBit = $00000004; + ShrinkHeightOffset = $00000002; + ShrinkWidthBit = $00000008; + ShrinkWidthOffset = $00000003; + + StandardHiddenControlCount = 6; + StandardHiddenControls: array[0..StandardHiddenControlCount - 1] of string = + ('TScrollBar', 'TSplitter', 'TControlBar', 'TToolBar', 'TCoolBar', 'TPageScroller'); + +implementation + +{$R *.dfm} + +uses + SysUtils, cxClasses, cxControls, dxPSGlbl, dxPSUtl, dxPSRes, dxPSPopupMan; + +const + StandardContainerCount = {$IFDEF DELPHI5} 11 {$ELSE} 10 {$ENDIF}; + StandardContainers: array[0..StandardContainerCount - 1] of TWinControlClass = + (TPanel, TScrollBox, TTabControl, TTabSheet, TPageControl, TTabPage, + TTabbedNotebook, TPage, TNotebook, TCustomForm {$IFDEF DELPHI5}, TCustomFrame{$ENDIF}); + + DefaultControlDisabledContentColor: TColor = clBtnFace; + DefaultControlDisabledTextColor: TColor = clGrayText; + +//{.1} - RootDesigner +//{.2} - ItemOptionsPlace + +type + TBasedxReportLinkAccess = class(TBasedxReportLink); + + + TCustomCheckBoxAccess = class(TCustomCheckBox); + TCustomComboBoxAccess = class(TCustomComboBox); + {$IFDEF DELPHI6} + TCustomComboBoxExAccess = class(TCustomComboBoxEx); + {$ENDIF} + TCustomEditAccess = class(TCustomEdit); + TCustomGroupBoxAccess = class(TCustomGroupBox); + TCustomHotKeyAccess = class(TCustomHotKey); + TCustomLabelAccess = class(TCustomLabel); + TCustomMemoAccess = class(TCustomMemo); + TCustomPanelAccess = class(TCustomPanel); + TCustomRadioGroupAccess = class(TCustomRadioGroup); + TCustomStaticTextAccess = class(TCustomStaticText); + + TdxPSNativePrintableControlProducerFactory = class(TdxCustomClassMaps) + private + function GetProducerClass(Component: TComponent): TdxPSNativePrintableControlProducerClass; + public + class function Instance: TdxPSNativePrintableControlProducerFactory; reintroduce; overload; + class procedure ReleaseInstance; override; + property ProducerClasses[Component: TComponent]: TdxPSNativePrintableControlProducerClass read GetProducerClass; default; + end; + + TdxPSContainerItemProducerFactory = class(TdxCustomClassMaps) + private + function GetProducerClass(Component: TComponent; IsRoot: Boolean): TdxPSCustomProducerClass; + public + class function Instance: TdxPSContainerItemProducerFactory; reintroduce; overload; + class procedure ReleaseInstance; override; + property ProducerClasses[Component: TComponent; IsRoot: Boolean]: TdxPSCustomProducerClass read GetProducerClass; default; + end; + + TdxPSProducerHelperFactory = class(TdxCustomClassMaps) + private + function GetItem(Index: Integer): TdxPSCustomProducerClass; + function GetProducerClass(ProducerClass: TdxPSCustomProducerClass): TdxPSCustomProducerClass; + public + class function Instance: TdxPSProducerHelperFactory; reintroduce; overload; + property Items[Index: Integer]: TdxPSCustomProducerClass read GetItem; + property ProducerClasses[ProducerClass: TdxPSCustomProducerClass]: TdxPSCustomProducerClass read GetProducerClass; default; + end; + + TdxPSContainerBuilderFactory = class(TdxCustomClassMaps) + private + function GetBuilderClass(Control: TWinControl): TdxPSContainerBuilderClass; + protected + function CreateBuilder(AReportLink: TdxCustomContainerReportLink; AContainer: TWinControl; + AParentBuilder: TdxPSContainerBuilder; AParentHost: TdxReportCell = nil): TdxPSContainerBuilder; + public + class function Instance: TdxPSContainerBuilderFactory; reintroduce; overload; + class procedure ReleaseInstance; override; + property BuilderClasses[Control: TWinControl]: TdxPSContainerBuilderClass read GetBuilderClass; default; + end; + +var + FInternalComponentPrinter: TdxComponentPrinter; + FIsNativePrintableControlProducerFactoryReleased: Boolean = False; + FIsContainerItemProducerFactoryReleased: Boolean = False; + FIsContainerBuilderFactoryReleased: Boolean = False; + +function InternalComponentPrinter: TdxComponentPrinter; +begin + if FInternalComponentPrinter = nil then + FInternalComponentPrinter := TdxComponentPrinter.Create(nil); + Result := FInternalComponentPrinter; +end; + +{ utility routines } + +function dxPSMakeFriendlyNameFromStrings(AStrings: TStrings): string; +const + CR = #13; + LF = #10; +var + P: Integer; +begin + Result := AStrings[0]; + if Length(Result) > MaxCaptionLength then + begin + Delete(Result, MaxCaptionLength, Length(Result) - MaxCaptionLength); + Result := Result + '...'; + end; + + repeat + P := Pos(LF, Result); + if P <> 0 then + Delete(Result, P, 1); + + P := Pos(CR, Result); + if P <> 0 then + Delete(Result, P, 1); + + if P <> 0 then + Insert(' ', Result, P); + until P = 0; +end; + +{ Registration routines } + +function dxPSIsComponentContainer(AComponentClass: TClass): Boolean; +begin + Result := TdxCustomContainerReportLink.Supports(AComponentClass); +end; + +function dxPSIsComponentContainer(AComponent: TObject{TComponent}): Boolean; +begin + Result := TdxCustomContainerReportLink.Supports(AComponent); +end; + +procedure dxPSRegisterContainer(AContainerClass: TWinControlClass; + ADesignerClass: TdxReportLinkDesignWindowClass = nil); +begin + if ADesignerClass = nil then + ADesignerClass := TdxfmCustomContainerDesignWindow; + dxPSRegisterReportLink(TdxCustomContainerReportLink, AContainerClass, ADesignerClass); +end; + +procedure dxPSRegisterContainers(const AContainerClasses: array of TWinControlClass; + ADesignerClass: TdxReportLinkDesignWindowClass = nil); +var + I: Integer; +begin + if ADesignerClass = nil then + ADesignerClass := TdxfmCustomContainerDesignWindow; + for I := 0 to High(AContainerClasses) do + dxPSRegisterContainer(AContainerClasses[I], ADesignerClass); +end; + +procedure dxPSUnregisterContainer(AContainerClass: TWinControlClass; + ADesignerClass: TdxReportLinkDesignWindowClass = nil); +begin + if ADesignerClass = nil then + ADesignerClass := TdxfmCustomContainerDesignWindow; + dxPSUnregisterReportLink(TdxCustomContainerReportLink, AContainerClass, ADesignerClass); +end; + +procedure dxPSUnregisterContainers(const AContainerClasses: array of TWinControlClass; + ADesignerClass: TdxReportLinkDesignWindowClass = nil); +var + I: Integer; +begin + if ADesignerClass = nil then + ADesignerClass := TdxfmCustomContainerDesignWindow; + for I := 0 to High(AContainerClasses) do + dxPSUnregisterContainer(AContainerClasses[I], ADesignerClass); +end; + +{ Helpers } + +{ CheckBox Helpers } + +function CheckBox_GetAlignment(AControl: TCustomCheckBox): TAlignment; +begin + Result := TCustomCheckBoxAccess(AControl).Alignment; +end; + +function CheckBox_GetState(AControl: TCustomCheckBox): TCheckBoxState; +begin + Result := TCustomCheckBoxAccess(AControl).State; +end; + +{ ComboBox Helpers } + +function ComboBox_GetStyle(AControl: TCustomComboBox): TComboBoxStyle; +begin + Result := TCustomComboBoxAccess(AControl).Style; +end; + +function ComboBox_GetCurrentText(AControl: TCustomComboBox): string; +begin + if ComboBox_GetStyle(AControl) = csDropDown then + Result := Control_GetText(AControl) + else + if AControl.ItemIndex <> -1 then + Result := AControl.Items[AControl.ItemIndex] + else + Result := '' +end; + +{ Edit Helpers } + +function Edit_GetBorderStyle(AControl: TCustomEdit): TBorderStyle; +begin + Result := TCustomEditAccess(AControl).BorderStyle; +end; + +{ HotKey Helpers } + +function HotKey_GetHotKey(AControl: TCustomHotKey): TShortCut; +begin + Result := TCustomHotKeyAccess(AControl).HotKey; +end; + +{ Label Helpers } + +function Label_GetAlignment(AControl: TCustomLabel): TAlignment; +begin + Result := TCustomLabelAccess(AControl).Alignment; +end; + +function Label_GetAutoSize(AControl: TCustomLabel): Boolean; +begin + Result := TCustomLabelAccess(AControl).AutoSize; +end; + +function Label_GetText(AControl: TCustomLabel): string; +begin + Result := TCustomLabelAccess(AControl).GetLabelText; +end; + +function Label_GetLayout(AControl: TCustomLabel): TTextLayout; +begin + Result := TCustomLabelAccess(AControl).Layout; +end; + +function Label_GetWordWrap(AControl: TCustomLabel): Boolean; +begin + Result := TCustomLabelAccess(AControl).WordWrap; +end; + +{ Memo Helpers } + +function Memo_GetAlignment(AControl: TCustomMemo): TAlignment; +begin + Result := TCustomMemoAccess(AControl).Alignment; +end; + +function Memo_GetLines(AControl: TCustomMemo): TStrings; +begin + Result := TCustomMemoAccess(AControl).Lines; +end; + +{ Panel Helpers } + +function Panel_GetAlignment(AControl: TCustomPanel): TAlignment; +begin + Result := TCustomPanelAccess(AControl).Alignment; +end; + +function Panel_GetBorderStyle(AControl: TCustomPanel): TBorderStyle; +begin + Result := TCustomPanelAccess(AControl).BorderStyle; +end; + +function Panel_GetBevelInner(AControl: TCustomPanel): TPanelBevel; +begin + Result := TCustomPanelAccess(AControl).BevelInner; +end; + +function Panel_GetBevelOuter(AControl: TCustomPanel): TPanelBevel; +begin + Result := TCustomPanelAccess(AControl).BevelOuter; +end; + +{ RadioGroup Helpers } + +function RadioGroup_GetColumns(AControl: TCustomRadioGroup): Integer; +begin + Result := TCustomRadioGroupAccess(AControl).Columns; +end; + +function RadioGroup_GetItemIndex(AControl: TCustomRadioGroup): Integer; +begin + Result := TCustomRadioGroupAccess(AControl).ItemIndex; +end; + +function RadioGroup_GetItems(AControl: TCustomRadioGroup): TStrings; +begin + Result := TCustomRadioGroupAccess(AControl).Items; +end; + +{ StaticText Helpers } + +function StaticText_GetAlignment(AControl: TCustomStaticText): TAlignment; +begin + Result := TCustomStaticTextAccess(AControl).Alignment; +end; + +function StaticText_GetBorderStyle(AControl: TCustomStaticText): TStaticBorderStyle; +begin + Result := TCustomStaticTextAccess(AControl).BorderStyle +end; + +{ TdxPSNativePrintableControlProducerFactory } + +function dxPSNativePrintableControlProducerFactory: TdxPSNativePrintableControlProducerFactory; +begin + Result := TdxPSNativePrintableControlProducerFactory.Instance; +end; + +class function TdxPSNativePrintableControlProducerFactory.Instance: TdxPSNativePrintableControlProducerFactory; +begin + Result := inherited Instance as TdxPSNativePrintableControlProducerFactory; +end; + +class procedure TdxPSNativePrintableControlProducerFactory.ReleaseInstance; +begin + inherited; + FIsNativePrintableControlProducerFactoryReleased := True; +end; + +function TdxPSNativePrintableControlProducerFactory.GetProducerClass( + Component: TComponent): TdxPSNativePrintableControlProducerClass; +begin + Result := TdxPSNativePrintableControlProducerClass(PairClasses[Component.ClassType]); +end; + +{ TdxProducersFactory } + +function dxPSContainerItemProducerFactory: TdxPSContainerItemProducerFactory; +begin + Result := TdxPSContainerItemProducerFactory.Instance; +end; + +class function TdxPSContainerItemProducerFactory.Instance: TdxPSContainerItemProducerFactory; +begin + Result := inherited Instance as TdxPSContainerItemProducerFactory; +end; + +class procedure TdxPSContainerItemProducerFactory.ReleaseInstance; +begin + inherited; + FIsContainerBuilderFactoryReleased := True; +end; + +function TdxPSContainerItemProducerFactory.GetProducerClass(Component: TComponent; + IsRoot: Boolean): TdxPSCustomProducerClass; +begin + if not IsRoot then + Result := dxPSNativePrintableControlProducerFactory.ProducerClasses[Component] + else + Result := nil; + + if (Result = nil) or not TdxPSNativePrintableControlProducerClass(Result).HasReportLink(Component) then + begin + Result := TdxPSCustomProducerClass(PairClasses[Component.ClassType]); + if Result.HelperProducer <> nil then + Result := Result.HelperProducer; + end; +end; + +{ TdxPSProducerHelperFactory } + +function dxPSProducerHelperFactory: TdxPSProducerHelperFactory; +begin + Result := TdxPSProducerHelperFactory.Instance; +end; + +class function TdxPSProducerHelperFactory.Instance: TdxPSProducerHelperFactory; +begin + Result := inherited Instance as TdxPSProducerHelperFactory; +end; + +function TdxPSProducerHelperFactory.GetItem(Index: Integer): TdxPSCustomProducerClass; +begin + Result := TdxPSCustomProducerClass(inherited Items[Index]); +end; + +function TdxPSProducerHelperFactory.GetProducerClass(ProducerClass: TdxPSCustomProducerClass): TdxPSCustomProducerClass; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I]; + if ProducerClass = Result.BuddyClass then Exit; + end; + Result := nil; +end; + +{ TdxPSContainerBuilderFactory } + +function dxContainerBuilderFactory: TdxPSContainerBuilderFactory; +begin + Result := TdxPSContainerBuilderFactory.Instance; +end; + +class function TdxPSContainerBuilderFactory.Instance: TdxPSContainerBuilderFactory; +begin + Result := inherited Instance as TdxPSContainerBuilderFactory; +end; + +class procedure TdxPSContainerBuilderFactory.ReleaseInstance; +begin + inherited; + FIsContainerBuilderFactoryReleased := True; +end; + +function TdxPSContainerBuilderFactory.CreateBuilder(AReportLink: TdxCustomContainerReportLink; + AContainer: TWinControl; AParentBuilder: TdxPSContainerBuilder; + AParentHost: TdxReportCell = nil): TdxPSContainerBuilder; +begin + Result := BuilderClasses[AContainer].Create(AReportLink, AContainer, AParentBuilder, AParentHost); +end; + +function TdxPSContainerBuilderFactory.GetBuilderClass(Control: TWinControl): TdxPSContainerBuilderClass; +begin + Result := TdxPSContainerBuilderClass(PairClasses[Control.ClassType]); +end; + +{ TdxReportWinControlHost } + +function TdxReportWinControlHost.MeasureHeight(DC: HDC): Integer; + + procedure MeasureItem(AnItem: TdxReportVisualItem; var AValue: Integer); + var + V: Integer; + begin + if AnItem.Visible then + begin + V := AnItem.Top + AnItem.Height; + if AValue < V then AValue := V; + end; + end; + + function MeasureNestedCells: Integer; + var + I: Integer; + begin + Result := 0; + for I := 0 to CellCount - 1 do + MeasureItem(Cells[I], Result); + end; + + function MeasureNestedDataItems: Integer; + var + I: Integer; + begin + Result := 0; + for I := 0 to DataItemCount - 1 do + MeasureItem(DataItems[I], Result); + end; + +begin + Result := Max(MeasureNestedDataItems, MeasureNestedCells); + if Result <> 0 then Inc(Result, 2); +end; + +function TdxReportWinControlHost.MeasureWidth(DC: HDC): Integer; + + procedure MeasureItem(AnItem: TdxReportVisualItem; var AValue: Integer); + var + V: Integer; + begin + if AnItem.Visible then + begin + V := AnItem.Left + AnItem.Width; + if AValue < V then AValue := V; + end; + end; + + function MeasureNestedCells: Integer; + var + I: Integer; + Item: TdxReportVisualItem; + begin + Result := 0; + for I := 0 to CellCount - 1 do + begin + Item := Cells[I]; + if Item <> ControlItem then MeasureItem(Item, Result); + end; + end; + + function MeasureNestedDataItems: Integer; + var + I: Integer; + Item: TdxReportVisualItem; + begin + Result := 0; + for I := 0 to DataItemCount - 1 do + begin + Item := DataItems[I]; + {if Item <> ControlItem then }MeasureItem(Item, Result); + end; + end; + +begin + Result := Max(MeasureNestedDataItems, MeasureNestedCells); + if Result <> 0 then Inc(Result, 2); +end; + +function TdxReportWinControlHost.GetControlItem: TdxReportVisualItem; +begin + if (DataItemCount <> 0) and (DataItems[0].Data <> 0) then + Result := DataItems[0] + else + if (CellCount <> 0) and (Cells[0].Data <> 0) then + Result := Cells[0] + else + Result := nil; +end; + +procedure TdxReportWinControlHost.BoundsChanged; +begin + if HasControlItem then + begin + ControlItem.Width := Width; + ControlItem.Height := Height; + end; +end; + +function TdxReportWinControlHost.GetHasControlItem: Boolean; +begin + Result := ControlItem <> nil; +end; + +{ TdxReportNativePrintableControlHost } + +function TdxReportNativePrintableControlHost.GetControlItem: TdxReportVisualItem; +begin + if CellCount <> 0 then + Result := Cells[0] + else + Result := nil; +end; + +procedure TdxReportNativePrintableControlHost.BoundsChanged; +begin + inherited; +end; + +{ TdxPSCustomContainerItemDefinition } + +constructor TdxPSCustomContainerItemDefinition.Create(AReportLink: TdxCustomContainerReportLink; + AComponent: TComponent; AReportItem: TdxReportVisualItem); +begin + inherited Create; + FReportLink := AReportLink; + FComponent := AComponent; + FReportItem := AReportItem; + FOptionsPlace := AReportLink.GetOptionsItemPlaceClass.Create(AReportLink); +// FOptionsPlace.Assign(AReportLink.OptionsItemPlace); {.2} +end; + +destructor TdxPSCustomContainerItemDefinition.Destroy; +begin + FreeAndNil(FOptionsPlace); + inherited; +end; + +function TdxPSCustomContainerItemDefinition.OptionsPagination: TdxCustomContainerReportLinkOptionsPagination; +begin + Result := ReportLink.OptionsPagination; +end; + +procedure TdxPSCustomContainerItemDefinition.AddDelimitersHorz(AList: TList); +begin +end; + +procedure TdxPSCustomContainerItemDefinition.AddDelimitersVert(AList: TList); +begin +end; + +procedure TdxPSCustomContainerItemDefinition.AddReportItemToDelimitersHorz(AList: TList); +begin + with ReportItem do + begin + AList.Add(TObject(Integer(AbsoluteOrigin.X))); + AList.Add(TObject(Integer(AbsoluteOrigin.X + Width))); + end; +end; + +procedure TdxPSCustomContainerItemDefinition.AddReportItemToDelimitersVert(AList: TList); +begin + with ReportItem do + begin + AList.Add(TObject(Integer(AbsoluteOrigin.Y))); + AList.Add(TObject(Integer(AbsoluteOrigin.Y + Height))); + end; +end; + +function TdxPSCustomContainerItemDefinition.GetSizeChangeReportItem: TdxReportVisualItem; +begin + Result := ReportItem; +end; + +function TdxPSCustomContainerItemDefinition.GetSizeMeasureReportItem: TdxReportVisualItem; +begin + Result := ReportItem; +end; + +function TdxPSCustomContainerItemDefinition.GetRootContainer: TWinControl; +begin + Result := ReportLink.Container; +end; + +function TdxPSCustomContainerItemDefinition.GetTopLevelRootContainer: TWinControl; +begin + Result := ReportLink.TopLevelContainer; +end; + +{ TdxPSContainerControlDefinition } + +procedure TdxPSContainerControlDefinition.AddDelimitersHorz(AList: TList); +begin + if OptionsPagination.Controls then AddReportItemToDelimitersHorz(AList); +end; + +procedure TdxPSContainerControlDefinition.AddDelimitersVert(AList: TList); +begin + if OptionsPagination.Controls then AddReportItemToDelimitersVert(AList); +end; + +function TdxPSContainerControlDefinition.GetControl: TControl; +begin + Result := TControl(Component); +end; + +procedure TdxPSContainerControlDefinition.SetControl(Value: TControl); +begin + Component := Value; +end; + +{ TdxPSNativePrintableControlDefinition } + +constructor TdxPSNativePrintableControlDefinition.Create(AReportLink: TdxCustomContainerReportLink; + AComponent: TComponent; AReportItem: TdxReportVisualItem); +begin + inherited; + FDelimitersHorz := TList.Create; + FDelimitersVert := TList.Create; +end; + +destructor TdxPSNativePrintableControlDefinition.Destroy; +begin + FreeAndNil(FDelimitersVert); + FreeAndNil(FDelimitersHorz); + inherited; +end; + +procedure TdxPSNativePrintableControlDefinition.AddDelimitersHorz(AList: TList); +begin + with OptionsPagination do + begin + if Controls then + AddReportItemToDelimitersHorz(AList); + if ControlDetails then + dxPSUtl.dxAppendList(DelimitersHorz, AList); + end +end; + +procedure TdxPSNativePrintableControlDefinition.AddDelimitersVert(AList: TList); +begin + with OptionsPagination do + begin + if Controls then + AddReportItemToDelimitersVert(AList); + if ControlDetails then + dxPSUtl.dxAppendList(DelimitersVert, AList); + end +end; + +procedure TdxPSNativePrintableControlDefinition.GetData(AReportLink: TBasedxReportLink); +begin + with TBasedxReportLinkAccess(AReportLink) do + begin + InternalGetDelimiters(DelimitersHorz, DelimitersVert); + FReportDimension := MakePoint(ReportWidth, ReportHeight); + end; + ShiftDelimiters; +end; + +procedure TdxPSNativePrintableControlDefinition.ShiftDelimiters; +var + Offset: TPoint; +begin + Offset := DelimitersOffset; + dxPSUtl.dxShiftIntegerListValues(DelimitersHorz, Offset.X); + dxPSUtl.dxShiftIntegerListValues(DelimitersVert, Offset.Y); +end; + +function TdxPSNativePrintableControlDefinition.GetSizeChangeReportItem: TdxReportVisualItem; +begin + Result := ReportItem.Parent; +end; + +function TdxPSNativePrintableControlDefinition.GetDelimitersOffset: TPoint; +var + Parent: TWinControl; +begin + Result := MakePoint(Control.Left, Control.Top); + Parent := Control.Parent; + while Parent <> TopLevelRootContainer do + begin + Inc(Result.X, Parent.Left); + Inc(Result.Y, Parent.Top); + Parent := Parent.Parent; + end; +end; + +{ TdxPSContainerWinControlDefinition } + +function TdxPSContainerWinControlDefinition.GetSizeChangeReportItem: TdxReportVisualItem; +begin + Result := ReportItem.Parent; +end; + +{ TdxPSContainerDefinition } + +function TdxPSContainerDefinition.GetSizeMeasureReportItem: TdxReportVisualItem; +begin + Result := ReportItem.Parent; +end; + +{ TdxPSWinControlIterator } + +constructor TdxPSWinControlIterator.Create(AControl: TWinControl); +begin + inherited Create; + FControl := AControl; + FCounter := -1; +end; + +class function TdxPSWinControlIterator.ContainerClass: TWinControlClass; +begin + Result := TWinControl; +end; + +function TdxPSWinControlIterator.GetControl(Index: Integer): TControl; +begin + Result := Control.Controls[Index]; +end; + +function TdxPSWinControlIterator.GetControlCount: Integer; +begin + Result := Control.ControlCount; +end; + +procedure TdxPSWinControlIterator.GoBeforeBOF; +begin + FCounter := -1; +end; + +procedure TdxPSWinControlIterator.GoBeyondEOF; +begin + FCounter := ControlCount; +end; + +function TdxPSWinControlIterator.IsBOF: Boolean; +begin + Result := FCounter < 1; +end; + +function TdxPSWinControlIterator.IsEOF: Boolean; +begin + Result := FCounter + 1 = ControlCount; +end; + +function TdxPSWinControlIterator.Next: TControl; +begin + if not IsEOF then + begin + Inc(FCounter); + Result := Controls[FCounter]; + end + else + Result := nil; +end; + +function TdxPSWinControlIterator.Prev: TControl; +begin + if not IsBOF then + begin + Dec(FCounter); + Result := Controls[FCounter]; + end + else + Result := nil; +end; + +{ TdxPSCustomProducer } + +constructor TdxPSCustomProducer.Create(AReportLink: TdxCustomContainerReportLink; + AnObject: TComponent); +begin + inherited Create; + FReportLink := AReportLink; + Initialize(AnObject); +end; + +class function TdxPSCustomProducer.CanHasAvailableChildren: Boolean; +begin + Result := False; +end; + +class function TdxPSCustomProducer.HasNativeSupportForBorders: Boolean; +begin + Result := False; +end; + +class function TdxPSCustomProducer.Reenterable: Boolean; +begin + Result := True; +end; + +function TdxPSCustomProducer.Definition: TdxPSCustomContainerItemDefinition; +begin + Result := ReportLink.DefinitionsByContainerItem[ProducingObject]; +end; + +class function TdxPSCustomProducer.DefinitionClass: TdxPSCustomContainerItemDefinitionClass; +begin + Result := TdxPSCustomContainerItemDefinition; +end; + +procedure TdxPSCustomProducer.Initialize(AnObject: TComponent); +begin + FProducingObject := AnObject; +end; + +function TdxPSCustomProducer.ProducingObject: TComponent; +begin + Result := FProducingObject; +end; + +function TdxPSCustomProducer.ProducingObjectFriendlyName: string; +begin + Result := ProducingObject.Name; +end; + +function TdxPSCustomProducer.ReportLink: TdxCustomContainerReportLink; +begin + Result := FReportLink; +end; + +procedure TdxPSCustomProducer.Reposition; +begin + DoReposition; +end; + +function TdxPSCustomProducer.RootContainer: TWinControl; +begin + Result := ReportLink.Container; +end; + +function TdxPSCustomProducer.TopLevelRootContainer: TWinControl; +begin + Result := ReportLink.TopLevelContainer; +end; + +class procedure TdxPSCustomProducer.Register; +begin + dxPSContainerItemProducerFactory.Register(Self); +end; + +class procedure TdxPSCustomProducer.Unregister; +begin + if not FIsContainerItemProducerFactoryReleased then dxPSContainerItemProducerFactory.Unregister(Self); +end; + +class function TdxPSCustomProducer.HelperProducer: TdxPSCustomProducerClass; +begin + Result := dxPSProducerHelperFactory[Self]; +end; + +class function TdxPSCustomProducer.BuddyClass: TdxPSCustomProducerClass; +begin + Result := nil; +end; + +function TdxPSCustomProducer.CanProcessChild(AChildControl: TControl): Boolean; +begin + Result := True; +end; + +function TdxPSCustomProducer.GetScrollPosLeft: Integer; +begin + Result := 0; +end; + +function TdxPSCustomProducer.GetScrollPosTop: Integer; +begin + Result := 0; +end; + +procedure TdxPSCustomProducer.GetImageLists(AProc: TdxPSGetImageListProc); +begin +end; + +procedure TdxPSCustomProducer.InitializeOptionsPlace(AnOptions: TdxCustomContainerReportLinkOptionsItemPlace); +begin + with AnOptions do + begin + ExpandHeight := ObjectExpandHeight; + ExpandWidth := ObjectExpandWidth; + ShrinkHeight := ObjectShrinkHeight; + ShrinkWidth := ObjectShrinkWidth; + end; +end; + +procedure TdxPSCustomProducer.DoReposition; +var + ItemHeight, ItemWidth: Integer; +begin + with Definition do + begin + if OptionsPlace.HasVertResizing then + begin + ItemHeight := MeasureItemHeight(SizeMeasureReportItem); + if OptionsPlace.ExpandHeight and (SizeChangeReportItem.Height < ItemHeight) then + SizeChangeReportItem.Height := ItemHeight; + if OptionsPlace.ShrinkHeight and (SizeChangeReportItem.Height > ItemHeight) and (ItemHeight <> 0) then + SizeChangeReportItem.Height := ItemHeight; + end; + + if OptionsPlace.HasHorzResizing then + begin + ItemWidth := MeasureItemWidth(SizeMeasureReportItem); + if OptionsPlace.ExpandWidth and (SizeChangeReportItem.Width < ItemWidth) then + SizeChangeReportItem.Width := ItemWidth; + if OptionsPlace.ShrinkWidth and (SizeChangeReportItem.Width > ItemWidth) then + SizeChangeReportItem.Width := ItemWidth; + end; + end; +end; + +function TdxPSCustomProducer.MeasureItemHeight(AnItem: TdxReportVisualItem): Integer; +begin + Result := AnItem.MeasureHeight(DC); +end; + +function TdxPSCustomProducer.MeasureItemWidth(AnItem: TdxReportVisualItem): Integer; +begin + Result := AnItem.MeasureWidth(DC); +end; + +function TdxPSCustomProducer.ObjectExpandHeight: Boolean; +begin + Result := False; +end; + +function TdxPSCustomProducer.ObjectExpandWidth: Boolean; +begin + Result := False; +end; + +function TdxPSCustomProducer.ObjectShrinkHeight: Boolean; +begin + Result := False; +end; + +function TdxPSCustomProducer.ObjectShrinkWidth: Boolean; +begin + Result := False; +end; + +function TdxPSCustomProducer.OptionsTransparent: TdxCustomContainerReportLinkOptionsTransparent; +begin + Result := ReportLink.OptionsTransparent; +end; + +function TdxPSCustomProducer.GetDC: HDC; +begin + Result := ReportLink.ScreenDC; +end; + +function TdxPSCustomProducer.GetDefinition(Component: TComponent): TdxPSCustomContainerItemDefinition; +begin + Result := ReportLink.DefinitionsByContainerItem[Component]; +end; + +function TdxPSCustomProducer.GetIsDesigning: Boolean; +begin + Result := csDesigning in ReportLink.ComponentState; +end; + +function TdxPSCustomProducer.GetProducer(Component: TComponent): TdxPSCustomProducer; +begin + Result := ReportLink.Producers[Component]; +end; + +{ TdxPSCustomContainerItemProducer } + +function TdxPSCustomContainerItemProducer.Control: TControl; +begin + Result := ProducingObject; +end; + +class function TdxPSCustomContainerItemProducer.ControlClass: TControlClass; +begin + Result := TControl; +end; + +function TdxPSCustomContainerItemProducer.Definition: TdxPSContainerControlDefinition; +begin + Result := inherited Definition as TdxPSContainerControlDefinition; +end; + +class function TdxPSCustomContainerItemProducer.DefinitionClass: TdxPSCustomContainerItemDefinitionClass; +begin + Result := TdxPSContainerControlDefinition; +end; + +class function TdxPSCustomContainerItemProducer.PairClass: TClass; +begin + Result := ControlClass; +end; + +function TdxPSCustomContainerItemProducer.ProducingObject: TControl; +begin + Result := TControl(inherited ProducingObject); +end; + +function TdxPSCustomContainerItemProducer.ProducingObjectFriendlyName: string; +begin + Result := ''; + if not IsDesigning then + Result := Control_GetText(Control); + if Result = '' then + Result := inherited ProducingObjectFriendlyName; +end; + +function TdxPSCustomContainerItemProducer.CanProcessChild(AChildControl: TControl): Boolean; +begin + Result := ((csAcceptsControls in Control_GetControlStyle(Control)) and + ((AChildControl.Owner <> Control)) or + (Control is TCustomForm) {$IFDEF DELPHI5} or (Control is TCustomFrame){$ENDIF}); +end; + +function TdxPSCustomContainerItemProducer.CreateIterator: IdxPSContainerIterator; +begin + Result := nil; +end; + +function TdxPSCustomContainerItemProducer.GetContentColor: TColor; +begin + if Control.Enabled then + Result := Control_GetColor(Control) + else + Result := DefaultControlDisabledContentColor; +end; + +function TdxPSCustomContainerItemProducer.GetControlBoundsRect: TRect; +begin + Result := Control.ClientRect; + OffsetRect(Result, Control.Left, Control.Top); +end; + +function TdxPSCustomContainerItemProducer.GetFont: TFont; +begin + Result := Control_GetFont(Control); +end; + +function TdxPSCustomContainerItemProducer.GetFontColor: TColor; +begin + if Control.Enabled then + Result := Font.Color + else + Result := DefaultControlDisabledTextColor; +end; + +function TdxPSCustomContainerItemProducer.GetFontIndex: Integer; +begin + Result := ReportLink.GetPreparedFontIndex(Font, IsFontSubstitutable, FontName, FontColor, FontStyle); +end; + +function TdxPSCustomContainerItemProducer.GetFontName: string; +begin + Result := Font.Name; +end; + +function TdxPSCustomContainerItemProducer.GetFontStyle: TFontStyles; +begin + Result := Font.Style; +end; + +function TdxPSCustomContainerItemProducer.IsFontSubstitutable: Boolean; +begin + Result := True; +end; + +function TdxPSCustomContainerItemProducer.HostClass: TdxReportCellClass; +begin + Result := TdxReportCell; +end; + +procedure TdxPSCustomContainerItemProducer.InitializeHost(ACell: TdxReportCell); +begin + with ACell do + begin + BoundsRect := ControlBounds; + Color := ContentColor; + CellSides := []; + ExcludeFromClipRgn := True; + Transparent := True; + end; +end; + +procedure TdxPSCustomContainerItemProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + with AnItem do + begin + BoundsRect := GetControlBoundsRect; + Color := ContentColor; + Data := Integer(TObject(Control)); + FontIndex := Self.FontIndex; + Transparent := OptionsTransparent.Controls; + end; +end; + +function TdxPSCustomContainerItemProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TAbstractdxReportCellData; +end; + +function TdxPSCustomContainerItemProducer.GetControlBounds: TRect; +begin + Result := GetControlBoundsRect; + if Control <> RootContainer then {.1} + with Producers[Control.Parent] do + OffsetRect(Result, ScrollPosLeft, ScrollPosTop); +end; + +{ TdxPSCustomDelegateProducer } + +procedure TdxPSCustomDelegateProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + Producer.InitializeItem(AnItem); +end; + +function TdxPSCustomDelegateProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := Producer.ItemClass; +end; + +{ TdxPSNativePrintableControlProducer } + +class function TdxPSNativePrintableControlProducer.Reenterable: Boolean; +begin + Result := False; +end; + +function TdxPSNativePrintableControlProducer.Definition: TdxPSNativePrintableControlDefinition; +begin + Result := inherited Definition as TdxPSNativePrintableControlDefinition; +end; + +class function TdxPSNativePrintableControlProducer.DefinitionClass: TdxPSCustomContainerItemDefinitionClass; +begin + Result := TdxPSNativePrintableControlDefinition; +end; + +class function TdxPSNativePrintableControlProducer.HasNativeSupportForBorders: Boolean; +begin + Result := True; +end; + +class procedure TdxPSNativePrintableControlProducer.Register; +begin + dxPSNativePrintableControlProducerFactory.Register(Self); +end; + +class procedure TdxPSNativePrintableControlProducer.Unregister; +begin + if not FIsNativePrintableControlProducerFactoryReleased then + dxPSNativePrintableControlProducerFactory.Unregister(Self); +end; + +procedure TdxPSNativePrintableControlProducer.AdjustItemBounds(AnItem: TdxReportVisualItem); +var + R: TRect; +begin + with AnItem do + begin + R := BoundsRect; + InflateRect(R, AnItem.BorderClass.Thickness - 1, AnItem.BorderClass.Thickness - 1); + if ShowShadow then + begin + Inc(R.Right, ShadowDepth); + Inc(R.Bottom, ShadowDepth); + end; + + if not (Control is TWinControl) then + begin + OffsetRect(R, Control.Left, Control.Top); + with Producers[Control.Parent] do + OffsetRect(R, ScrollPosLeft, ScrollPosTop); + end; + + BoundsRect := R; + + with Definition.OptionsPlace do + begin + if not ShrinkWidth and not ExpandWidth and (Width < Parent.Width) then + Width := Parent.Width; + if not ShrinkHeight and not ExpandHeight and (Height < Parent.Height) then + Height := Parent.Height; + end; + + if not Parent.ClipChildren then + begin + Parent.Height := Height; + Parent.Width := Width; + end; + end; +end; + +function TdxPSNativePrintableControlProducer.CreateControlReportLink: TBasedxReportLink; +begin + Result := ReportLink.DoGetReportLink(Control); + FIsOuterLinkUsed := Result <> nil; + if not FIsOuterLinkUsed then + Result := GetLinkClass(Control.ClassType).Create(nil); + InitializeReportLink(Result); +end; + +procedure TdxPSNativePrintableControlProducer.CreateNativePrintableControlData(AnItem: TdxReportVisualItem); +var + Link: TBasedxReportLinkAccess; + Pt: TPoint; +begin + Link := TBasedxReportLinkAccess(CreateControlReportLink); + try + if Link.DataProviderPresent then + begin + if not IsOuterLinkUsed then Link.RestoreFromOriginal; + Link.RebuildReport; + AnItem.Assign(Link.ReportCells.Cells); + + Pt := Control.ClientToScreen(NullPoint); + Pt := TopLevelRootContainer.ScreenToClient(Pt); + AnItem.ReportCells.AppendOverlays(Link.ReportCells, Pt.X, Pt.Y); + + Definition.GetData(Link); + end + else + AnItem.CellSides := []; + finally + DeinitializeReportLink(Link); + if not IsOuterLinkUsed then Link.Free; + FIsOuterLinkUsed := False; + end; +end; + +procedure TdxPSNativePrintableControlProducer.DeinitializeReportLink(AControlReportLink: TBasedxReportLink); +begin + with TBasedxReportLinkAccess(AControlReportLink) do + begin + if ComponentPrinter = InternalComponentPrinter then ComponentPrinter := nil; + Controller := nil; + ReportLink.DoInitializeReportLink(AControlReportLink, psAfter); + end; +end; + +class function TdxPSNativePrintableControlProducer.GetLinkClass(AClass: TClass): TdxReportLinkClass; +begin + Result := dxPSLinkClassByCompClass(TComponentClass(AClass)); +end; + +procedure TdxPSNativePrintableControlProducer.InitializeReportLink(AControlReportLink: TBasedxReportLink); +begin + with TBasedxReportLinkAccess(AControlReportLink) do + begin + if ComponentPrinter = nil then ComponentPrinter := InternalComponentPrinter; + Controller := ReportLink; + Component := Control; + ReportLink.DoInitializeReportLink(AControlReportLink, psBefore); + end; +end; + +class function TdxPSNativePrintableControlProducer.HasReportLink(AComponent: TComponent): Boolean; +var + LinkClass: TdxReportLinkClass; +begin + LinkClass := GetLinkClass(AComponent.ClassType); + Result := (LinkClass <> nil) and LinkClass.Aggregable; +end; + +function TdxPSNativePrintableControlProducer.HostClass: TdxReportCellClass; +begin + Result := TdxReportNativePrintableControlHost; +end; + +procedure TdxPSNativePrintableControlProducer.InitializeHost(ACell: TdxReportCell); +begin + inherited; + ACell.ClipChildren := not (ObjectExpandHeight and ObjectExpandWidth); +end; + +procedure TdxPSNativePrintableControlProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + CreateNativePrintableControlData(AnItem); + InitializeNativePrintableControlHost(AnItem); +end; + +procedure TdxPSNativePrintableControlProducer.InitializeNativePrintableControlHost(AnItem: TdxReportVisualItem); +begin + AnItem.Data := Integer(TObject(Control)); // should be copied as well !!! + AnItem.ExcludeFromClipRgn := True; + AnItem.Transparent := True; + AnItem.CellSides := []; //v.3.2 + + AdjustItemBounds(AnItem); +end; + +function TdxPSNativePrintableControlProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCell; +end; + +function TdxPSNativePrintableControlProducer.MeasureItemHeight(AnItem: TdxReportVisualItem): Integer; +begin + Result := Definition.ReportDimension.Y; +end; + +function TdxPSNativePrintableControlProducer.MeasureItemWidth(AnItem: TdxReportVisualItem): Integer; +begin + Result := Definition.ReportDimension.X; +end; + +function TdxPSNativePrintableControlProducer.ObjectExpandHeight: Boolean; +begin + Result := False; +end; + +function TdxPSNativePrintableControlProducer.ObjectExpandWidth: Boolean; +begin + Result := False; +end; + +{ TdxPSContainerControlProducer } + +procedure TdxPSContainerControlProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + AnItem.BoundsRect := GetControlBoundsRect; + AnItem.CellSides := csAll; + //AnItem.ExcludeFromClipRgn := True; +end; + +{ TdxPSControlAsMetafileProducer } + +class function TdxPSControlAsMetafileProducer.PairClass: TClass; +begin + Result := BuddyClass; +end; + +class procedure TdxPSControlAsMetafileProducer.Register; +begin + dxPSProducerHelperFactory.Register(Self); +end; + +class procedure TdxPSControlAsMetafileProducer.Unregister; +begin + dxPSProducerHelperFactory.Unregister(Self); +end; + +procedure TdxPSControlAsMetafileProducer.Reposition; +begin +end; + +class function TdxPSControlAsMetafileProducer.BuddyClass: TdxPSCustomProducerClass; +begin + Result := TdxPSContainerControlProducer; +end; + +function TdxPSControlAsMetafileProducer.CreateControlImage(AnItem: TdxReportVisualItem): TGraphic; +var + Canvas: TMetafileCanvas; +begin + Result := TdxReportCellGraphic(AnItem).CreateImage(TMetafile); + try + Result.Height := AnItem.Height; + Result.Width := AnItem.Width; + Canvas := TMetafileCanvas.Create(TMetafile(Result), DC); + try + Control.Perform(WM_PAINT, Canvas.Handle, 0) + finally + Canvas.Free; + end; + except + Result.Free; + raise; + end; +end; + +procedure TdxPSControlAsMetafileProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + TdxReportCellGraphic(AnItem).CellSides := []; + TdxReportCellGraphic(AnItem).ImageTransparent := False; + CreateControlImage(AnItem); +end; + +function TdxPSControlAsMetafileProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellGraphic; +end; + +{ TdxPSBevelProducer } + +function TdxPSBevelProducer.Control: TBevel; +begin + Result := inherited Control as TBevel; +end; + +class function TdxPSBevelProducer.ControlClass: TControlClass; +begin + Result := TBevel; +end; + +procedure TdxPSBevelProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + AnItem.CellSides := BevelShapeMap[Control.Shape]; + AnItem.BorderClass := BevelStyleMap[Control.Style, Control.Shape]; + AnItem.Transparent := True; +end; + +function TdxPSBevelProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellBox; +end; + +{ TdxPSPaintBoxProducer } + +function TdxPSPaintBoxProducer.Control: TPaintBox; +begin + Result := inherited Control as TPaintBox; +end; + +class function TdxPSPaintBoxProducer.ControlClass: TControlClass; +begin + Result := TPaintBox; +end; + +procedure TdxPSPaintBoxProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + AnItem.CellSides := []; + AnItem.BorderClass := TdxPSCellNullBorder; + AnItem.Transparent := True; +end; + +function TdxPSPaintBoxProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellBox; +end; + +{ TdxPSShapeProducer } + +function TdxPSShapeProducer.Control: TShape; +begin + Result := inherited Control as TShape; +end; + +class function TdxPSShapeProducer.ControlClass: TControlClass; +begin + Result := TShape; +end; + +procedure TdxPSShapeProducer.InitializeItem(AnItem: TdxReportVisualItem); +var + V: Integer; +begin + inherited; + with TCustomdxReportCellShape(AnItem) do + begin + CellSides := []; + ContentBkColor := Control_GetColor(Control.Parent); + ContentPattern := BrushStyleMap[Control.Brush.Style]; + ShapeBorderColor := Control.Pen.Color; + ShapeBorderThickness := Control.Pen.Width; + if (Control.Pen.Style <> psSolid) and (ShapeBorderThickness > 1) then + ShapeBorderThickness := 1; + ShapeColor := Control.Brush.Color; + if Control.Pen.Style = psClear then + ShapeBorderColor := ShapeColor; + ShapeTransparent := Control.Brush.Style = bsClear; + if Control.Shape in [stRoundRect, stRoundSquare] then + begin + if ShapeHeight > ShapeWidth then + V := ShapeWidth + else + V := ShapeHeight; + TdxReportCellRoundRect(AnItem).EllipseHeight := V div 4; + TdxReportCellRoundRect(AnItem).EllipseWidth := V div 4; + end; + Transparent := True; + end; +end; + +function TdxPSShapeProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := ShapeTypeMap[Control.Shape]; +end; + +{ TdxPSCustomLabelProducer } + +function TdxPSCustomLabelProducer.Control: TCustomLabel; +begin + Result := inherited Control as TCustomLabel; +end; + +class function TdxPSCustomLabelProducer.ControlClass: TControlClass; +begin + Result := TCustomLabel; +end; + +function TdxPSCustomLabelProducer.GetControlBoundsRect: TRect; +begin + Result := inherited GetControlBoundsRect; + OffsetRect(Result, 0, -2); +end; + +procedure TdxPSCustomLabelProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + with TdxReportCellString(AnItem) do + begin + CellSides := []; + Multiline := Label_GetWordWrap(Control); + HidePrefix := True; + Text := Label_GetText(Control); + TextAlignX := dxPSCore.dxTextAlignX[Label_GetAlignment(Control)]; + TextAlignY := dxPSCore.dxTextAlignY[Label_GetLayout(Control)]; + AdjustFont := Label_GetAutoSize(Control); + end; +end; + +function TdxPSCustomLabelProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellString; +end; + +function TdxPSCustomLabelProducer.ObjectExpandHeight: Boolean; +begin + Result := True; +end; + +function TdxPSCustomLabelProducer.ObjectExpandWidth: Boolean; +begin + Result := Label_GetAutoSize(Control); +end; + +{ TdxPSContainerCustomWinControlProducer } + +function TdxPSContainerCustomWinControlProducer.Control: TWinControl; +begin + Result := inherited Control as TWinControl; +end; + +class function TdxPSContainerCustomWinControlProducer.ControlClass: TControlClass; +begin + Result := TWinControl; +end; + +function TdxPSContainerCustomWinControlProducer.CreateIterator: IdxPSContainerIterator; +begin + IteratorClass.Create(Control).GetInterface(IdxPSContainerIterator, Result); +end; + +class function TdxPSContainerCustomWinControlProducer.DefinitionClass: TdxPSCustomContainerItemDefinitionClass; +begin + Result := TdxPSContainerWinControlDefinition; +end; + +function TdxPSContainerCustomWinControlProducer.HostClass: TdxReportCellClass; +begin + Result := TdxReportWinControlHost; +end; + +procedure TdxPSContainerCustomWinControlProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + AnItem.Left := 0; + AnItem.Top := 0; + AnItem.BorderClass := Ctl3DBorderClassMap[Control_GetCtl3D(Control)]; + //AnItem.ExcludeFromClipRgn := True; +end; + +class function TdxPSContainerCustomWinControlProducer.IteratorClass: TdxPSWinControlIteratorClass; +begin + Result := TdxPSWinControlIterator; +end; + +{ TdxPSWinControlAsMetafileProducer } + +class function TdxPSWinControlAsMetafileProducer.PairClass: TClass; +begin + Result := BuddyClass; +end; + +procedure TdxPSWinControlAsMetafileProducer.Reposition; +begin +end; + +class procedure TdxPSWinControlAsMetafileProducer.Register; +begin + dxPSProducerHelperFactory.Register(Self); +end; + +class procedure TdxPSWinControlAsMetafileProducer.Unregister; +begin + dxPSProducerHelperFactory.Unregister(Self); +end; + +class function TdxPSWinControlAsMetafileProducer.BuddyClass: TdxPSCustomProducerClass; +begin + Result := TdxPSContainerWinControlProducer; +end; + +function TdxPSWinControlAsMetafileProducer.CreateControlImage(AnItem: TdxReportVisualItem): TGraphic; +var + Canvas: TMetafileCanvas; +begin + Result := TdxReportCellGraphic(AnItem).CreateImage(TMetafile); + Result.Width := AnItem.Width; + Result.Height := AnItem.Height; + Canvas := TMetafileCanvas.Create(TMetafile(Result), DC); + try + Control.PaintTo(Canvas.Handle, 0, 0); + finally + Canvas.Free; + end; +end; + +procedure TdxPSWinControlAsMetafileProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + TdxReportCellGraphic(AnItem).CellSides := []; + TdxReportCellGraphic(AnItem).ImageTransparent := False; + CreateControlImage(AnItem); +end; + +function TdxPSWinControlAsMetafileProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellGraphic; +end; + +{ TdxPSContainerWinControlProducer } + +procedure TdxPSContainerWinControlProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + TdxReportCellString(AnItem).Text := Control_GetText(Control); +end; + +function TdxPSContainerWinControlProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellString; +end; + +function TdxPSContainerWinControlProducer.ObjectExpandHeight: Boolean; +begin + Result := True; +end; + +{ TdxPSDateTimePickerProducer } + +function TdxPSDateTimePickerProducer.Control: TDateTimePicker; +begin + Result := inherited Control as TDateTimePicker; +end; + +class function TdxPSDateTimePickerProducer.ControlClass: TControlClass; +begin + Result := TDateTimePicker; +end; + +procedure TdxPSDateTimePickerProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + with TdxReportCellCheck(AnItem) do + begin + //AnItem.BorderClass := Ctl3DBorderClassMap[ControlGetCtl3D(Control)]; + if Control.ShowCheckbox then + begin + ButtonEdgeStyle := cbes3D; + Checked := Control.Checked; + CheckPos := ccpLeft; + end; + end; +end; + +function TdxPSDateTimePickerProducer.ItemClass: TdxReportVisualItemClass; +const + ItemClasses: array[Boolean] of TdxReportVisualItemClass = (TdxReportCellString, TdxReportCellCheck); +begin + Result := ItemClasses[Control.ShowCheckbox]; +end; + +{ TdxPSCustomHotKeyProducer } + +function TdxPSCustomHotKeyProducer.Control: TCustomHotKey; +begin + Result := inherited Control as TCustomHotKey; +end; + +class function TdxPSCustomHotKeyProducer.ControlClass: TControlClass; +begin + Result := TCustomHotKey; +end; + +procedure TdxPSCustomHotKeyProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + TdxReportCellString(AnItem).Text := Menus.ShortCutToText(HotKey_GetHotKey(Control)); +end; + +{ TdxPSCustomStaticTextProducer } + +function TdxPSCustomStaticTextProducer.Control: TCustomStaticText; +begin + Result := inherited Control as TCustomStaticText; +end; + +class function TdxPSCustomStaticTextProducer.ControlClass: TControlClass; +begin + Result := TCustomStaticText; +end; + +procedure TdxPSCustomStaticTextProducer.InitializeItem(AnItem: TdxReportVisualItem); +const + BorderClassMap: array[TStaticBorderStyle] of TdxPSCellBorderClass = + (TdxPSCellNullBorder, TdxPSCellUltraFlatBorder, TdxPSCellSunkenSoftBorder); + CellSidesMap: array[TStaticBorderStyle] of TdxCellSides = ([], csAll, csAll); +begin + inherited; + TdxReportCellString(AnItem).BorderClass := BorderClassMap[StaticText_GetBorderStyle(Control)]; + TdxReportCellString(AnItem).CellSides := CellSidesMap[StaticText_GetBorderStyle(Control)]; + TdxReportCellString(AnItem).HidePrefix := True; + TdxReportCellString(AnItem).TextAlignX := dxPSCore.dxTextAlignX[StaticText_GetAlignment(Control)]; +end; + +{ TdxPSCustomEditProducer } + +function TdxPSCustomEditProducer.Control: TCustomEdit; +begin + Result := inherited Control as TCustomEdit; +end; + +class function TdxPSCustomEditProducer.ControlClass: TControlClass; +begin + Result := TCustomEdit; +end; + +procedure TdxPSCustomEditProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + TdxReportCellString(AnItem).CellSides := BorderStyleMap[Edit_GetBorderStyle(Control)]; + //TdxReportCellString(AnItem).BorderClass := Ctl3DBorderClassMap[ControlGetCtl3D(Control)]; +end; + +{ TdxPSCustomMemoProducer } + +function TdxPSCustomMemoProducer.Control: TCustomMemo; +begin + Result := inherited Control as TCustomMemo; +end; + +class function TdxPSCustomMemoProducer.ControlClass: TControlClass; +begin + Result := TCustomMemo; +end; + +function TdxPSCustomMemoProducer.ProducingObjectFriendlyName: string; +var + Lines: TStrings; +begin + Result := ''; + Lines := Memo_GetLines(Control); + if not IsDesigning and (Lines.Count <> 0) then + Result := dxPSMakeFriendlyNameFromStrings(Lines); + if Result = '' then + Result := inherited ProducingObjectFriendlyName; +end; + +procedure TdxPSCustomMemoProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + TdxReportCellString(AnItem).TextAlignX := dxPSCore.dxTextAlignX[Memo_GetAlignment(Control)]; + TdxReportCellString(AnItem).TextAlignY := taTop; + TdxReportCellString(AnItem).Multiline := True; +end; + +function TdxPSCustomMemoProducer.ObjectExpandHeight: Boolean; +begin + Result := False; +end; + +{ TdxPSCustomComboBoxProducer } + +function TdxPSCustomComboBoxProducer.Control: TCustomComboBox; +begin + Result := inherited Control as TCustomComboBox; +end; + +class function TdxPSCustomComboBoxProducer.ControlClass: TControlClass; +begin + Result := TCustomComboBox; +end; + +procedure TdxPSCustomComboBoxProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + //TdxReportCellString(AnItem).BorderClass := Ctl3DBorderClassMap[ControlGetCtl3D(Control)]; + TdxReportCellString(AnItem).Text := ComboBox_GetCurrentText(Control); +end; + +{$IFDEF DELPHI6} + +{ TdxPSComboBoxExProducer } + +function TdxPSCustomComboBoxExProducer.Control: TCustomComboBoxEx; +begin + Result := inherited Control as TCustomComboBoxEx; +end; + +class function TdxPSCustomComboBoxExProducer.ControlClass: TControlClass; +begin + Result := TCustomComboBoxEx; +end; + +procedure TdxPSCustomComboBoxExProducer.GetImageLists(AProc: TdxPSGetImageListProc); +begin + inherited; + AProc(Control.Images); +end; + +procedure TdxPSCustomComboBoxExProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + with TdxReportCellImage(AnItem) do + begin + if Control.ItemIndex <> -1 then + ImageIndex := Control.ItemsEx[Control.ItemIndex].ImageIndex; + ImageList := Control.Images; + MakeSpaceForEmptyImage := True; + if Control.Style in [csExSimple, csExDropDown] then + Text := Control_GetText(Control) + else + if Control.ItemIndex <> -1 then + Text := Control.ItemsEx[Control.ItemIndex].Caption + else + Text := ''; + end; +end; + +function TdxPSCustomComboBoxExProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellImage; +end; + +{$ENDIF} + +function TdxPSCustomCheckBoxProducer.Control: TCustomCheckBox; +begin + Result := inherited Control as TCustomCheckBox; +end; + +class function TdxPSCustomCheckBoxProducer.ControlClass: TControlClass; +begin + Result := TCustomCheckBox; +end; + +procedure TdxPSCustomCheckBoxProducer.InitializeItem(AnItem: TdxReportVisualItem); +var + CheckState: TCheckBoxState; +begin + inherited; + CheckState := CheckBox_GetState(Control); + with TdxReportCellCheck(AnItem) do + begin + ButtonEdgeStyle := cbes3D; + CellSides := []; + Checked := CheckState <> cbUnchecked; + CheckPos := CheckAlignmentMap[CheckBox_GetAlignment(Control)]; + Enabled := CheckState <> cbGrayed; + HidePrefix := True; + TextAlignX := taLeft; + end; +end; + +function TdxPSCustomCheckBoxProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellCheck; +end; + +{ TdxPSRadioButtonProducer } + +function TdxPSRadioButtonProducer.Control: TRadioButton; +begin + Result := inherited Control as TRadioButton; +end; + +class function TdxPSRadioButtonProducer.ControlClass: TControlClass; +begin + Result := TRadioButton; +end; + +procedure TdxPSRadioButtonProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + with TdxReportCellRadio(AnItem) do + begin + ButtonEdgeStyle := cbes3D; + CellSides := []; + Checked := Control.Checked; + CheckPos := CheckAlignmentMap[Control.Alignment]; + Enabled := Control.Enabled; + HidePrefix := True; + TextAlignX := taLeft; + end; +end; + +function TdxPSRadioButtonProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellRadio; +end; + +{ TdxPSCustomContainerProducer } + +class function TdxPSCustomContainerProducer.CanHasAvailableChildren: Boolean; +begin + Result := True; +end; + +class function TdxPSCustomContainerProducer.DefinitionClass: TdxPSCustomContainerItemDefinitionClass; +begin + Result := TdxPSContainerDefinition; +end; + +procedure TdxPSCustomContainerProducer.InitializeItem(AnItem: TdxReportVisualItem); +const + CellsSidesMap: array[Boolean] of TdxCellSides = ([], csAll); +begin + inherited; + //AnItem.ExcludeFromClipRgn := Control <> RootContainer; + if Control = RootContainer then + begin + AnItem.CellSides := CellsSidesMap[ReportLink.OptionsRefinements.RootBorders]; + AnItem.Transparent := OptionsTransparent.Root; + end + else + AnItem.Transparent := OptionsTransparent.Containers; +end; + +function TdxPSCustomContainerProducer.ObjectExpandHeight: Boolean; +begin + if Control = RootContainer then + Result := True + else + Result := inherited ObjectExpandHeight; +end; + +function TdxPSCustomContainerProducer.ObjectExpandWidth: Boolean; +begin + if Control = RootContainer then + Result := True + else + Result := inherited ObjectExpandWidth; +end; + +function TdxPSCustomContainerProducer.ObjectShrinkHeight: Boolean; +begin + if Control = RootContainer then + Result := True + else + Result := inherited ObjectShrinkHeight; +end; + +function TdxPSCustomContainerProducer.ObjectShrinkWidth: Boolean; +begin + if Control = RootContainer then + Result := True + else + Result := inherited ObjectShrinkWidth; +end; + +{ TdxPSCustomPanelProducer } + +function TdxPSCustomPanelProducer.Control: TCustomPanel; +begin + Result := inherited Control as TCustomPanel; +end; + +class function TdxPSCustomPanelProducer.ControlClass: TControlClass; +begin + Result := TCustomPanel; +end; + +class function TdxPSCustomPanelProducer.HasNativeSupportForBorders: Boolean; +begin + Result := True; +end; + +procedure TdxPSCustomPanelProducer.InitializeItem(AnItem: TdxReportVisualItem); +var + BevelInner, BevelOuter: TPanelBevel; +begin + inherited; + if Panel_GetBorderStyle(Control) <> bsSingle then + begin + BevelInner := Panel_GetBevelInner(Control); + BevelOuter := Panel_GetBevelOuter(Control); + if (BevelInner = bvNone) and (BevelOuter = bvNone) then + TdxReportCellString(AnItem).CellSides := [] + else + TdxReportCellString(AnItem).BorderClass := PanelBevelsMap[BevelInner, BevelOuter]; + end + else + TdxReportCellString(AnItem).BorderClass := PanelSingleBorderMap[Control_GetCtl3D(Control)]; + + TdxReportCellString(AnItem).Text := Control_GetText(Control); + TdxReportCellString(AnItem).TextAlignX := dxPSCore.dxTextAlignX[Panel_GetAlignment(Control)]; + TdxReportCellString(AnItem).TextAlignY := taCenterY; +end; + +function TdxPSCustomPanelProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellString; +end; + +function TdxPSCustomPanelProducer.ObjectExpandHeight: Boolean; +begin + if Control <> RootContainer then + Result := True + else + Result := inherited ObjectExpandHeight; +end; + +function TdxPSCustomPanelProducer.ObjectExpandWidth: Boolean; +begin + if Control <> RootContainer then + Result := True + else + Result := inherited ObjectExpandWidth; +end; + +{ TdxPSCustomGroupBoxProducer } + +function TdxPSCustomGroupBoxProducer.Control: TCustomGroupBox; +begin + Result := inherited Control as TCustomGroupBox; +end; + +class function TdxPSCustomGroupBoxProducer.ControlClass: TControlClass; +begin + Result := TCustomGroupBox; +end; + +class function TdxPSCustomGroupBoxProducer.HasNativeSupportForBorders: Boolean; +begin + Result := True; +end; + +procedure TdxPSCustomGroupBoxProducer.InitializeItem(AnItem: TdxReportVisualItem); +const + BorderClasses: array[Boolean] of TdxPSCellBorderClass = (TdxPSCellUltraFlatBorder, TdxPSCellEtchedBorder); +begin + inherited; + with TdxReportGroup(AnItem) do + begin + BorderClass := BorderClasses[Control_GetCtl3D(Control)]; + BorderColor := dxPSCore.dxDefaultGridLineColor; + CaptionAlignment := taLeft; + CaptionText := Control_GetText(Control); + CaptionTransparent := Transparent; + CellSides := csAll; + ShowCaption := True; + UseOwnBorderClass := True; + + LookAndFeel := ReportLink.CreateGroupLookAndFeel(LookAndFeelClass); + InitializeLookAndFeel(AnItem, LookAndFeel); + LookAndFeel.Prepare(DC); + CalculateCaptionTextWidth(DC); + end; +end; + +procedure TdxPSCustomGroupBoxProducer.InitializeLookAndFeel(AnItem: TdxReportVisualItem; + ALookAndFeel: TdxPSReportGroupLookAndFeel); +begin + ALookAndFeel.FontIndex := AnItem.FontIndex; + ALookAndFeel.CaptionFontIndex := AnItem.FontIndex; + ALookAndFeel.Color := ContentColor; +end; + +function TdxPSCustomGroupBoxProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportGroup; +end; + +class function TdxPSCustomGroupBoxProducer.LookAndFeelClass: TdxPSReportGroupLookAndFeelClass; +begin + Result := TdxPSReportGroupStandardLookAndFeel; +end; + +{ TdxPSCustomRadioGroupProducer } + +function TdxPSCustomRadioGroupProducer.Control: TCustomRadioGroup; +begin + Result := inherited Control as TCustomRadioGroup; +end; + +class function TdxPSCustomRadioGroupProducer.ControlClass: TControlClass; +begin + Result := TCustomRadioGroup; +end; + +function TdxPSCustomRadioGroupProducer.CanProcessChild(AChildControl: TControl): Boolean; +begin + Result := not AChildControl.ClassNameIs('TGroupButton'); // RadioGroup's buttons are processed inside +end; + +procedure TdxPSCustomRadioGroupProducer.CreateItems(AReportRadioGroup: TdxReportRadioGroup); +var + Items: TStrings; + I: Integer; + Item: TdxCustomReportCellRadio; +begin + Items := RadioGroup_GetItems(Control); + for I := 0 to Items.Count - 1 do + begin + Item := AReportRadioGroup.Add(Items[I]); + InitializeRadioItem(Item, I); + end; +end; + +procedure TdxPSCustomRadioGroupProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + with TdxReportRadioGroup(AnItem) do + begin + ButtonEdgeStyle := cbes3D; + CheckPos := ccpLeft; + ColumnCount := RadioGroup_GetColumns(Control); + CreateItems(TdxReportRadioGroup(AnItem)); + ItemIndex := RadioGroup_GetItemIndex(Control); + + AdjustContent(DC); + end; +end; + +procedure TdxPSCustomRadioGroupProducer.InitializeRadioItem(AnItem: TdxCustomReportCellRadio; AnIndex: Integer); +begin + AnItem.Enabled := Control.Controls[AnIndex].Enabled; +end; + +function TdxPSCustomRadioGroupProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportRadioGroup; +end; + +{ TdxPSRootContainerProducer } + +procedure TdxPSRootContainerProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + AnItem.Left := 0; + AnItem.Top := 0; +end; + +{ TdxPSPageControlIterator } + +function TdxPSPageControlIterator.GetControl(Index: Integer): TControl; +begin + Result := PageControl.ActivePage; +end; + +function TdxPSPageControlIterator.GetControlCount: Integer; +begin + Result := Ord(PageControl.PageCount > 0); +end; + +function TdxPSPageControlIterator.GetPageControl: TPageControl; +begin + Result := TPageControl(Control); +end; + +{ TdxPSPageControlProducer } + +function TdxPSPageControlProducer.Control: TPageControl; +begin + Result := inherited Control as TPageControl; +end; + +class function TdxPSPageControlProducer.ControlClass: TControlClass; +begin + Result := TPageControl; +end; + +function TdxPSPageControlProducer.CanProcessChild(AChildControl: TControl): Boolean; +begin + Result := AChildControl = Control.ActivePage; +end; + +class function TdxPSPageControlProducer.IteratorClass: TdxPSWinControlIteratorClass; +begin + Result := TdxPSPageControlIterator; +end; + +{ TdxPSTabSheetProducer } + +function TdxPSTabSheetProducer.Control: TTabSheet; +begin + Result := inherited Control as TTabSheet; +end; + +class function TdxPSTabSheetProducer.ControlClass: TControlClass; +begin + Result := TTabSheet; +end; + +{ TdxPSTabControlProducer } + +function TdxPSTabControlProducer.Control: TTabControl; +begin + Result := inherited Control as TTabControl; +end; + +class function TdxPSTabControlProducer.ControlClass: TControlClass; +begin + Result := TTabControl; +end; + +{ TdxPSNotebookIterator } + +function TdxPSNotebookIterator.GetControl(Index: Integer): TControl; +begin + with Notebook do + Result := TPage(Pages.Objects[PageIndex]); +end; + +function TdxPSNotebookIterator.GetControlCount: Integer; +begin + Result := Ord(Notebook.Pages.Count <> 0); +end; + +function TdxPSNotebookIterator.GetNotebook: TNotebook; +begin + Result := TNotebook(Control); +end; + +{ TdxPSNotebookPageProducer } + +function TdxPSNotebookPageProducer.Control: TPage; +begin + Result := inherited Control as TPage; +end; + +class function TdxPSNotebookPageProducer.ControlClass: TControlClass; +begin + Result := TPage; +end; + +{ TdxPSNotebookProducer } + +function TdxPSNotebookProducer.Control: TNotebook; +begin + Result := inherited Control as TNotebook; +end; + +class function TdxPSNotebookProducer.ControlClass: TControlClass; +begin + Result := TNotebook; +end; + +function TdxPSNotebookProducer.CanProcessChild(AChildControl: TControl): Boolean; +begin + Result := AChildControl = Control.Pages.Objects[Control.PageIndex]; +end; + +class function TdxPSNotebookProducer.IteratorClass: TdxPSWinControlIteratorClass; +begin + Result := TdxPSNotebookIterator; +end; + +{ TdxPSTabbedNotebookIterator } + +function TdxPSTabbedNotebookIterator.GetControl(Index: Integer): TControl; +begin + with TabbedNotebook do + Result := TTabPage(Pages.Objects[PageIndex]); +end; + +function TdxPSTabbedNotebookIterator.GetControlCount: Integer; +begin + Result := Ord(TabbedNotebook.Pages.Count <> 0); +end; + +function TdxPSTabbedNotebookIterator.GetTabbedNotebook: TTabbedNotebook; +begin + Result := TTabbedNotebook(Control); +end; + +{ TdxPSTabbedNotebookPageProducer } + +function TdxPSTabbedNotebookPageProducer.Control: TTabPage; +begin + Result := inherited Control as TTabPage; +end; + +class function TdxPSTabbedNotebookPageProducer.ControlClass: TControlClass; +begin + Result := TTabPage; +end; + +{ TdxPSTabbedNotebookProducer } + +function TdxPSTabbedNotebookProducer.Control: TTabbedNotebook; +begin + Result := inherited Control as TTabbedNotebook; +end; + +class function TdxPSTabbedNotebookProducer.ControlClass: TControlClass; +begin + Result := TTabbedNotebook; +end; + +function TdxPSTabbedNotebookProducer.CanProcessChild(AChildControl: TControl): Boolean; +begin + Result := AChildControl = Control.Pages.Objects[Control.PageIndex]; +end; + +class function TdxPSTabbedNotebookProducer.IteratorClass: TdxPSWinControlIteratorClass; +begin + Result := TdxPSTabbedNotebookIterator; +end; + +{ TdxPSScrollingWinControlProducer } + +function TdxPSScrollingWinControlProducer.Control: TScrollingWinControl; +begin + Result := inherited Control as TScrollingWinControl; +end; + +class function TdxPSScrollingWinControlProducer.ControlClass: TControlClass; +begin + Result := TScrollingWinControl; +end; + +function TdxPSScrollingWinControlProducer.GetScrollBarPos(AScrollBar: TControlScrollBar): Integer; +begin + with AScrollBar do + if Visible then + Result := Position + else + Result := 0; +end; + +function TdxPSScrollingWinControlProducer.GetScrollPosLeft: Integer; +begin + Result := GetScrollBarPos(Control.HorzScrollBar); +end; + +function TdxPSScrollingWinControlProducer.GetScrollPosTop: Integer; +begin + Result := GetScrollBarPos(Control.VertScrollBar); +end; + +procedure TdxPSScrollingWinControlProducer.InitializeHost(ACell: TdxReportCell); + + function GetScrollValue(AValue, AMinValue: Integer): Integer; + begin + if AValue > AMinValue then + Result := AValue + else + Result := AMinValue; + end; + +begin + inherited; + with Control do + begin + ACell.Height := GetScrollValue(VertScrollBar.Range, Height); + ACell.Width := GetScrollValue(HorzScrollBar.Range, Width); + end +end; + +function TdxPSScrollingWinControlProducer.ObjectExpandHeight: Boolean; +begin + Result := True; +end; + +function TdxPSScrollingWinControlProducer.ObjectExpandWidth: Boolean; +begin + Result := True; +end; + +{$IFDEF DELPHI5} + +{ TdxPSCustomFrameProducer } + +function TdxPSCustomFrameProducer.Control: TCustomFrame; +begin + Result := inherited Control as TCustomFrame; +end; + +class function TdxPSCustomFrameProducer.ControlClass: TControlClass; +begin + Result := TCustomFrame; +end; +{$ENDIF} + +{ TdxPSCustomFormProducer } + +function TdxPSCustomFormProducer.Control: TCustomForm; +begin + Result := inherited Control as TCustomForm; +end; + +class function TdxPSCustomFormProducer.ControlClass: TControlClass; +begin + Result := TCustomForm; +end; + +{ TdxPSContainerBuilder } + +constructor TdxPSContainerBuilder.Create(AReportLink: TdxCustomContainerReportLink; + AContainer: TWinControl; AParentBuilder: TdxPSContainerBuilder; AParentHost: TdxReportCell = nil); +begin + inherited Create; + FReportLink := AReportLink; + FContainer := AContainer; + FParentBuilder := AParentBuilder; + FParentHost := AParentHost; + ReportLink.FActiveBuilder := Self; +end; + +destructor TdxPSContainerBuilder.Destroy; +begin + ReportLink.FActiveBuilder := ParentBuilder; + inherited; +end; + +function TdxPSContainerBuilder.Build: TdxReportCell; +var + Item: TdxReportVisualItem; +begin + Result := CreateHost; + BuildNestedControls; + Item := BuildControl(Container); + Item.Index := 0; // make it as first item +end; + +function TdxPSContainerBuilder.BuildControl(AControl: TControl; AParentHost: TdxReportCell = nil): TdxReportVisualItem; +begin + FCurrentControl := AControl; + try + with Producers[AControl] do + begin + if AParentHost = nil then AParentHost := Host; + Result := ItemClass.Create(AParentHost); + CreateItemDefinition(AControl, Result); + InitializeItem(Result); + end; + InitializeItem(Result); + finally + FCurrentControl := nil; + end; +end; + +function TdxPSContainerBuilder.BuildNestedContainer(AContainer: TWinControl; + AParentHost: TdxReportCell = nil): TdxReportCell; +begin + Result := ReportLink.BuildContainer(AContainer, Self, AParentHost); +end; + +class function TdxPSContainerBuilder.ContainerClass: TWinControlClass; +begin + Result := TWinControl; +end; + +class function TdxPSContainerBuilder.PairClass: TClass; +begin + Result := ContainerClass; +end; + +class procedure TdxPSContainerBuilder.Register; +begin + dxContainerBuilderFactory.Register(Self); +end; + +class procedure TdxPSContainerBuilder.Unregister; +begin + if not FIsContainerBuilderFactoryReleased then dxContainerBuilderFactory.Unregister(Self); +end; + +procedure TdxPSContainerBuilder.BuildNestedControls; +var + Control: TControl; + Count, Index: Integer; +begin + if HasAvailableChildren(Container) then + with CreateNestedControlsIterator do + begin + Count := ControlCount; + Index := 1; + + // Controls + GoBeyondEOF; + while not IsBOF do + begin + Control := Prev; + if not (Control is TWinControl) and ReportLink.DoIsComponentProcessed(Control) then + BuildControl(Control); + if IsRoot then + begin + Progress(100 * Index / Count); + if IsAborted then Break; + end; + Inc(Index); + end; + if IsAborted then Exit; + + // WinControls + GoBeforeBOF; + while not IsEOF do + begin + Control := Next; + if (Control is TWinControl) and ReportLink.DoIsComponentProcessed(Control) then + BuildNestedContainer(TWinControl(Control), Host); + if IsRoot then + begin + Progress(100 * Index / Count); + if IsAborted then Break; + end; + Inc(Index); + end; + + if not IsAborted then Progress(100); + end; +end; + +function TdxPSContainerBuilder.CreateHost: TdxReportCell; +begin + FHost := Producers[Container].HostClass.Create(ParentHost); + InitializeHost; + Result := Host; +end; + +function TdxPSContainerBuilder.CreateItemDefinition(AComponent: TComponent; + AnItem: TdxReportVisualItem): TdxPSCustomContainerItemDefinition; +begin + Result := ReportLink.CreateItemDefinition(AComponent, AnItem); +end; + +function TdxPSContainerBuilder.CreateNestedControlsIterator: IdxPSContainerIterator; +begin + Result := Producers[Container].CreateIterator; +end; + +procedure TdxPSContainerBuilder.InitializeHost; +begin + Producers[Container].InitializeHost(Host); +end; + +procedure TdxPSContainerBuilder.InitializeItem(AnItem: TdxReportVisualItem); +begin + ReportLink.DoInitializeItem(AnItem); + ReportLink.DoInitializeItemOptionsPlace(AnItem); +end; + +function TdxPSContainerBuilder.IsAborted: Boolean; +begin + Result := ReportLink.AbortBuilding; +end; + +procedure TdxPSContainerBuilder.Progress(const APercentDone: Double); +begin + ReportLink.DoProgress(APercentDone); +end; + +function TdxPSContainerBuilder.GetParentHost: TdxReportCell; +begin + Result := FParentHost; + if Result = nil then + if ParentBuilder <> nil then + Result := ParentBuilder.Host + else + Result := ReportLink.RootCell; +end; + +function TdxPSContainerBuilder.HasAvailableChildren(AControl: TControl): Boolean; +var + Producer: TdxPSCustomContainerItemProducer; + I: Integer; + Child: TControl; +begin + Result := False; + if (AControl is TWinControl) and (TWinControl(AControl).ControlCount <> 0) then + begin + Producer := Producers[AControl]; + if Producer.CanHasAvailableChildren then + with TWinControl(AControl) do + for I := 0 to ControlCount - 1 do + begin + Child := Controls[I]; + Result := Producer.CanProcessChild(Child) and ReportLink.DoIsComponentProcessed(Child); + if Result then Exit; + end; + end; +end; + +function TdxPSContainerBuilder.GetDC: HDC; +begin + Result := ReportLink.ScreenDC; +end; + +function TdxPSContainerBuilder.GetIsRoot: Boolean; +begin + Result := ParentBuilder = nil; +end; + +function TdxPSContainerBuilder.GetProducer(AControl: TControl): TdxPSCustomContainerItemProducer; +begin + Result := ReportLink.Producers[AControl] as TdxPSCustomContainerItemProducer; +end; + +{ TdxPSContainerReportLinkCustomCache } + +constructor TdxPSContainerReportLinkCustomCache.Create(AReportLink: TdxCustomContainerReportLink); +begin + inherited Create; + FReportLink := AReportLink; +end; + +function TdxPSContainerReportLinkCustomCache.ReportLink: TdxCustomContainerReportLink; +begin + Result := FReportLink; +end; + +{ TdxPSCustomProducerCache } + +function TdxPSCustomProducerCache.GetItem(Index: Integer): TdxPSCustomProducer; +begin + Result := TdxPSCustomProducer(inherited Items[Index]); +end; + +function TdxPSCustomProducerCache.GetProducer(ProducerClass: TdxPSCustomProducerClass; + Component: TComponent): TdxPSCustomProducer; +var + Index: Integer; +begin + Index := IndexOfByClass(ProducerClass); + if (Index = -1) or (not ProducerClass.Reenterable and (Items[Index].ProducingObject <> Component)) then + Index := Add(ProducerClass.Create(ReportLink, Component)); + Result := Items[Index]; + Result.Initialize(Component); +end; + +{ TdxCustomContainerReportLinkOptions } + +constructor TdxCustomContainerReportLinkOptions.Create(AReportLink: TdxCustomContainerReportLink); +begin + inherited Create; + FReportLink := AReportLink; + RestoreDefaults; +end; + +procedure TdxCustomContainerReportLinkOptions.Assign(Source: TPersistent); +begin + if Source is TdxCustomContainerReportLinkOptions then + else + inherited; +end; + +procedure TdxCustomContainerReportLinkOptions.RestoreDefaults; +begin +end; + +procedure TdxCustomContainerReportLinkOptions.Changed; +begin + if ReportLink <> nil then ReportLink.OptionsModified(Self); +end; + +{ TdxCustomContainerOptionsBehavior } + +procedure TdxCustomContainerReportLinkOptionsBehavior.Assign(Source: TPersistent); +begin + if Source is TdxCustomContainerReportLinkOptionsBehavior then + with TdxCustomContainerReportLinkOptionsBehavior(Source) do + begin + Self.ConsumeExistingLinks := ConsumeExistingLinks; + end; + inherited; +end; + +procedure TdxCustomContainerReportLinkOptionsBehavior.RestoreDefaults; +begin + ConsumeExistingLinks := True; +end; + +procedure TdxCustomContainerReportLinkOptionsBehavior.SetConsumeExistingLinks(Value: Boolean); +begin + if FConsumeExistingLinks <> Value then + begin + FConsumeExistingLinks := Value; + Changed; + end; +end; + +{ TdxCustomContainerReportLinkOptionsDesignerTabs } + +procedure TdxCustomContainerReportLinkOptionsDesignerTabs.Assign(Source: TPersistent); +begin + if Source is TdxCustomContainerReportLinkOptionsDesignerTabs then + with TdxCustomContainerReportLinkOptionsDesignerTabs(Source) do + begin + Self.AutoHideReportLinksIfEmpty := AutoHideReportLinksIfEmpty; + Self.Controls := Controls; + Self.ReportLinks := ReportLinks; + end; + inherited; +end; + +procedure TdxCustomContainerReportLinkOptionsDesignerTabs.RestoreDefaults; +begin + inherited; + AutoHideReportLinksIfEmpty := True; + Controls := True; + ReportLinks := True; +end; + +{ TdxCustomContainerReportLinkOptionsItemPlace } + +procedure TdxCustomContainerReportLinkOptionsItemPlace.Assign(Source: TPersistent); +begin + if Source is TdxCustomContainerReportLinkOptionsItemPlace then + with TdxCustomContainerReportLinkOptionsItemPlace(Source) do + begin + Self.ExpandHeight := ExpandHeight; + Self.ExpandWidth := ExpandWidth; + Self.ShrinkHeight := ShrinkHeight; + Self.ShrinkWidth := ShrinkWidth; + end; + inherited; +end; + +procedure TdxCustomContainerReportLinkOptionsItemPlace.RestoreDefaults; +begin + ExpandHeight := False; + ExpandWidth := False; + ShrinkHeight := False; + ShrinkWidth := False; +end; + +function TdxCustomContainerReportLinkOptionsItemPlace.GetData: Integer; +begin + Result := ((Ord(ExpandHeight) shl ExpandHeightOffset) and ExpandHeightBit) or + ((Ord(ExpandWidth) shl ExpandWidthOffset) and ExpandWidthBit) or + ((Ord(ShrinkHeight) shl ShrinkHeightOffset) and ShrinkHeightBit) or + ((Ord(ShrinkWidth) shr ShrinkWidthOffset) and ShrinkWidthBit); +end; + +procedure TdxCustomContainerReportLinkOptionsItemPlace.SetData(Value: Integer); +begin + ExpandHeight := Boolean((Value and ExpandHeightOffset) shr ExpandHeightBit); + ExpandWidth := Boolean((Value and ExpandWidthOffset) shr ExpandWidthBit); + ShrinkHeight := Boolean((Value and ShrinkHeightOffset) shr ShrinkHeightBit); + ShrinkWidth := Boolean((Value and ShrinkWidthOffset) shr ShrinkWidthBit); +end; + +procedure TdxCustomContainerReportLinkOptionsItemPlace.ReadData(AStream: TStream); +var + Buffer: Integer; +begin + Buffer := GetData; + AStream.WriteBuffer(Buffer , SizeOf(Buffer)); +end; + +procedure TdxCustomContainerReportLinkOptionsItemPlace.WriteData(AStream: TStream); +var + Buffer: Integer; +begin + AStream.ReadBuffer(Buffer , SizeOf(Buffer)); + SetData(Buffer); +end; + +function TdxCustomContainerReportLinkOptionsItemPlace.HasHorzResizing: Boolean; +begin + Result := ExpandWidth or ShrinkWidth; +end; + +function TdxCustomContainerReportLinkOptionsItemPlace.HasVertResizing: Boolean; +begin + Result := ExpandHeight or ShrinkHeight; +end; + +procedure TdxCustomContainerReportLinkOptionsItemPlace.SetAll; +begin + ExpandHeight := True; + ExpandWidth := True; + ShrinkHeight := True; + ShrinkWidth := True; +end; + +procedure TdxCustomContainerReportLinkOptionsItemPlace.UnsetAll; +begin + ExpandHeight := False; + ExpandWidth := False; + ShrinkHeight := False; + ShrinkWidth := False; +end; + +{ TdxCustomContainerReportLinkOptionsPagination } + +procedure TdxCustomContainerReportLinkOptionsPagination.Assign(Source: TPersistent); +begin + if Source is TdxCustomContainerReportLinkOptionsPagination then + with TdxCustomContainerReportLinkOptionsPagination(Source) do + begin + Self.ControlDetails := ControlDetails; + Self.Controls := Controls; + end; + inherited; +end; + +procedure TdxCustomContainerReportLinkOptionsPagination.RestoreDefaults; +begin + inherited; + ControlDetails := True; + Controls := True; +end; + +procedure TdxCustomContainerReportLinkOptionsPagination.SetControlDetails(Value: Boolean); +begin + if FControlDetails <> Value then + begin + FControlDetails := Value; + Changed; + end; +end; + +procedure TdxCustomContainerReportLinkOptionsPagination.SetControls(Value: Boolean); +begin + if FControls <> Value then + begin + FControls := Value; + Changed; + end; +end; + +{ TdxCustomContainerReportLinkOptionsRefinements } + +procedure TdxCustomContainerReportLinkOptionsRefinements.Assign(Source: TPersistent); +begin + if Source is TdxCustomContainerReportLinkOptionsRefinements then + with TdxCustomContainerReportLinkOptionsRefinements(Source) do + begin + Self.RootBorders := RootBorders; + end; + inherited; +end; + +procedure TdxCustomContainerReportLinkOptionsRefinements.RestoreDefaults; +begin + inherited; + RootBorders := False; +end; + +procedure TdxCustomContainerReportLinkOptionsRefinements.SetRootBorders(Value: Boolean); +begin + if FRootBorders <> Value then + begin + FRootBorders := Value; + Changed; + end; +end; + +{ TdxCustomContainerOptionsTransparent } + +procedure TdxCustomContainerReportLinkOptionsTransparent.Assign(Source: TPersistent); +begin + if Source is TdxCustomContainerReportLinkOptionsTransparent then + with TdxCustomContainerReportLinkOptionsTransparent(Source) do + begin + Self.Containers := Containers; + Self.Controls := Controls; + Self.Graphics := Graphics; + Self.Root := Root; + end; + inherited; +end; + +procedure TdxCustomContainerReportLinkOptionsTransparent.RestoreDefaults; +begin + Controls := True; + Containers := True; + Graphics := False; + Root := True; + inherited; +end; + +procedure TdxCustomContainerReportLinkOptionsTransparent.SetContainters(Value: Boolean); +begin + if FContainers <> Value then + begin + FContainers := Value; + Changed; + end; +end; + +procedure TdxCustomContainerReportLinkOptionsTransparent.SetControls(Value: Boolean); +begin + if FControls <> Value then + begin + FControls := Value; + Changed; + end; +end; + +procedure TdxCustomContainerReportLinkOptionsTransparent.SetGraphics(Value: Boolean); +begin + if FGraphics <> Value then + begin + FGraphics := Value; + Changed; + end; +end; + +procedure TdxCustomContainerReportLinkOptionsTransparent.SetRoot(Value: Boolean); +begin + if FRoot <> Value then + begin + FRoot := Value; + Changed; + end; +end; + +{ TdxCustomContainerReportLink } + +constructor TdxCustomContainerReportLink.Create(AOwner: TComponent); +begin + inherited; + FAggregatedReportLinks := TStringList.Create; + FDefinitions := TList.Create; + FDelimitersHorz := TList.Create; + FDelimitersVert := TList.Create; + FExcludedComponents := TStringList.Create; + FHiddenComponents := TStringList.Create; + FPreparationFont := TFont.Create; + FProducerCache := TdxPSCustomProducerCache.Create(Self); + FSupportedCustomDraw := False; + CreateOptions; +end; + +destructor TdxCustomContainerReportLink.Destroy; +begin + {$IFNDEF DELPHI5} + Destroying; + {$ENDIF} + DestroyOptions; + FreeAndNil(FPreparationFont); + FreeAndNil(FProducerCache); + FreeAndNil(FHiddenComponents); + FreeAndNil(FExcludedComponents); + FreeAndNil(FDelimitersVert); + FreeAndNil(FDelimitersHorz); + FreeAndNilDefinitions; + FreeAndNil(FAggregatedReportLinks); + inherited; +end; + +procedure TdxCustomContainerReportLink.Assign(Source: TPersistent); +begin + if Source is TdxCustomContainerReportLink then + with TdxCustomContainerReportLink(Source) do + begin + Self.FAggregatedReportLinks.Assign(FAggregatedReportLinks); + Self.FExcludedComponents.Assign(FExcludedComponents); + Self.FHiddenComponents.Assign(FHiddenComponents); + Self.OptionsBehavior := OptionsBehavior; + Self.OptionsDesignerTabs := OptionsDesignerTabs; + //Self.OptionsItemPlace := OptionsItemPlace; {.2} + Self.OptionsPagination := OptionsPagination; + Self.OptionsTransparent := OptionsTransparent; + Self.SupportedCustomDraw := SupportedCustomDraw; + end; + inherited; +end; + +class function TdxCustomContainerReportLink.Aggregable: Boolean; +begin + Result := False; +end; + +function TdxCustomContainerReportLink.CanHideComponent(AComponent: TComponent): Boolean; +begin + Result := (AComponent <> nil) and (Container <> nil) and (AComponent <> Container); + if Result then + if AComponent is TControl then + Result := Container.ContainsControl(TControl(AComponent)) + else + Result := (Container.Owner <> nil) and (Container.Owner = AComponent.Owner); +end; + +function TdxCustomContainerReportLink.CanHideComponentByName(const AName: string): Boolean; +begin + Result := (AName <> '') and (Container <> nil); + if Result then + begin + Result := Container.FindChildControl(AName) <> nil; + if not Result and (Container.Owner <> nil) then + Result := Container.Owner.FindComponent(AName) <> nil; + end; +end; + +procedure TdxCustomContainerReportLink.HideComponent(AComponent: TComponent); +var + Index: Integer; +begin + if CanHideComponent(AComponent) and not FindHiddenComponent(AComponent, Index) then + FHiddenComponents.AddObject(AComponent.Name, AComponent) +end; + +procedure TdxCustomContainerReportLink.HideComponentByName(const AName: string); +var + Index: Integer; + Component: TComponent; +begin + if CanHideComponentByName(AName) and not FindHiddenComponentByName(AName, Index) then + begin + Component := GetComponentByName(AName); + if Component <> nil then + FHiddenComponents.AddObject(AName, Component); + end; +end; + +procedure TdxCustomContainerReportLink.HideComponents(const AComponents: array of TComponent); +var + I: Integer; +begin + for I := Low(AComponents) to High(AComponents) do + HideComponent(AComponents[I]); +end; + +procedure TdxCustomContainerReportLink.HideComponentsByName(const ANames: array of string); +var + I: Integer; +begin + for I := Low(ANames) to High(ANames) do + HideComponentByName(ANames[I]); +end; + +function TdxCustomContainerReportLink.FindHiddenComponent(AComponent: TComponent; + out AnIndex: Integer): Boolean; +begin + AnIndex := FHiddenComponents.IndexOfObject(AComponent); + Result := AnIndex <> -1; +end; + +function TdxCustomContainerReportLink.FindHiddenComponent(AComponent: TComponent): Boolean; +var + Index: Integer; +begin + Result := FindHiddenComponent(AComponent, Index); +end; + +function TdxCustomContainerReportLink.FindHiddenComponentByName(const AName: string; + out AnIndex: Integer): Boolean; +begin + AnIndex := FHiddenComponents.IndexOf(AName); + Result := AnIndex <> -1; +end; + +function TdxCustomContainerReportLink.FindHiddenComponentByName(const AName: string): Boolean; +var + Index: Integer; +begin + Result := FindHiddenComponentByName(AName, Index); +end; + +procedure TdxCustomContainerReportLink.UnhideAllComponents; +begin + FHiddenComponents.Clear; +end; + +procedure TdxCustomContainerReportLink.UnhideComponent(AComponent: TComponent); +var + Index: Integer; +begin + if FindHiddenComponent(AComponent, Index) then + FHiddenComponents.Delete(Index); +end; + +procedure TdxCustomContainerReportLink.UnhideComponentByName(const AName: string); +var + Index: Integer; +begin + if FindHiddenComponentByName(AName, Index) then + FHiddenComponents.Delete(Index); +end; + +procedure TdxCustomContainerReportLink.UnhideComponents(const AComponents: array of TComponent); +var + I: Integer; +begin + for I := Low(AComponents) to High(AComponents) do + UnhideComponent(AComponents[I]); +end; + +procedure TdxCustomContainerReportLink.UnhideComponentsByName(const ANames: array of string); +var + I: Integer; +begin + for I := Low(ANames) to High(ANames) do + UnhideComponentByName(ANames[I]); +end; + +procedure TdxCustomContainerReportLink.HideStandardControls; +var + I, J: Integer; + ControlClass: TClass; + Control: TControl; +begin + if Container <> nil then + for I := Low(StandardHiddenControls) to High(StandardHiddenControls) do + begin + ControlClass := Classes.GetClass(StandardHiddenControls[I]); + if ControlClass <> nil then + for J := 0 to Container.ControlCount - 1 do + begin + Control := Container.Controls[J]; + if Control is ControlClass then + HideComponent(Control); + end; + end; +end; + +procedure TdxCustomContainerReportLink.UnhideStandardControls; +var + I, J: Integer; + ControlClass: TClass; + Control: TControl; +begin + if Container <> nil then + for I := Low(StandardHiddenControls) to High(StandardHiddenControls) do + begin + ControlClass := Classes.GetClass(StandardHiddenControls[I]); + if ControlClass <> nil then + for J := 0 to Container.ControlCount - 1 do + begin + Control := Container.Controls[J]; + if Control is ControlClass then + UnhideComponent(Control); + end; + end; +end; + +function TdxCustomContainerReportLink.CanExcludeComponent(AComponent: TComponent): Boolean; +begin + Result := (AComponent <> nil) and (Container <> nil) and (AComponent <> Container); + if Result then + if AComponent is TControl then + Result := Container.ContainsControl(TControl(AComponent)) + else + Result := (Container.Owner <> nil) and (Container.Owner = AComponent.Owner); +end; + +function TdxCustomContainerReportLink.CanExcludeComponentByName(const AName: string): Boolean; +begin + Result := (AName <> '') and (Container <> nil); + if Result then + begin + Result := Container.FindChildControl(AName) <> nil; + if not Result and (Container.Owner <> nil) then + Result := Container.Owner.FindComponent(AName) <> nil; + end; +end; + +procedure TdxCustomContainerReportLink.ExcludeComponent(AComponent: TComponent); +var + Index: Integer; +begin + if CanExcludeComponent(AComponent) and not FindExcludedComponent(AComponent, Index) then + FExcludedComponents.AddObject(AComponent.Name, AComponent); +end; + +procedure TdxCustomContainerReportLink.ExcludeComponentByName(const AName: string); +var + Index: Integer; + Component: TComponent; +begin + if CanExcludeComponentByName(AName) and not FindExcludedComponentByName(AName, Index) then + begin + Component := GetComponentByName(AName); + if Component <> nil then + FExcludedComponents.AddObject(AName, Component); + end; +end; + +procedure TdxCustomContainerReportLink.ExcludeComponents(const AComponents: array of TComponent); +var + I: Integer; +begin + for I := Low(AComponents) to High(AComponents) do + ExcludeComponent(AComponents[I]); +end; + +procedure TdxCustomContainerReportLink.ExcludeComponentsByName(const ANames: array of string); +var + I: Integer; +begin + for I := Low(ANames) to High(ANames) do + ExcludeComponentByName(ANames[I]); +end; + +function TdxCustomContainerReportLink.FindExcludedComponent(AComponent: TComponent; + out AnIndex: Integer): Boolean; +begin + AnIndex := FExcludedComponents.IndexOfObject(AComponent); + Result := AnIndex <> -1; +end; + +function TdxCustomContainerReportLink.FindExcludedComponent(AComponent: TComponent): Boolean; +var + Index: Integer; +begin + Result := FindExcludedComponent(AComponent, Index); +end; + +function TdxCustomContainerReportLink.FindExcludedComponentByName(const AName: string; + out AnIndex: Integer): Boolean; +begin + AnIndex := FExcludedComponents.IndexOf(AName); + Result := AnIndex <> -1; +end; + +function TdxCustomContainerReportLink.FindExcludedComponentByName(const AName: string): Boolean; +var + Index: Integer; +begin + Result := FindExcludedComponentByName(AName, Index); +end; + +procedure TdxCustomContainerReportLink.UnexcludeAllComponents; +begin + FExcludedComponents.Clear; +end; + +procedure TdxCustomContainerReportLink.UnexcludeComponent(AComponent: TComponent); +var + Index: Integer; +begin + if FindExcludedComponent(AComponent, Index) then + FExcludedComponents.Delete(Index); +end; + +procedure TdxCustomContainerReportLink.UnexcludeComponentByName(const AName: string); +var + Index: Integer; +begin + if FindExcludedComponentByName(AName, Index) then + FExcludedComponents.Delete(Index); +end; + +procedure TdxCustomContainerReportLink.UnexcludeComponents(const AComponents: array of TComponent); +var + I: Integer; +begin + for I := Low(AComponents) to High(AComponents) do + UnexcludeComponent(AComponents[I]); +end; + +procedure TdxCustomContainerReportLink.UnexcludeComponentsByName(const ANames: array of string); +var + I: Integer; +begin + for I := Low(ANames) to High(ANames) do + UnexcludeComponentByName(ANames[I]); +end; + +procedure TdxCustomContainerReportLink.AggregateLink(AReportLink: TBasedxReportLink); +begin + if IsLinkAggregable(AReportLink) and not IsLinkAggregated(AReportLink) then + FAggregatedReportLinks.AddObject(AReportLink.Name, AReportLink); +end; + +procedure TdxCustomContainerReportLink.DisaggregateAllLinks; +begin + InstallAggregatedReportLinksController(False); + FAggregatedReportLinks.Clear; +end; + +procedure TdxCustomContainerReportLink.DisaggregateInconsistentLinks; +var + I: Integer; + Link: TBasedxReportLink; +begin + for I := AggregatedReportLinkCount - 1 downto 0 do + begin + Link := AggregatedReportLinks[I]; + if not IsLinkAggregatedConsistently(Link) then DisaggregateLink(Link); + end; +end; + +procedure TdxCustomContainerReportLink.DisaggregateLink(AReportLink: TBasedxReportLink); +var + Index: Integer; +begin + Index := FAggregatedReportLinks.IndexOfObject(AReportLink); + if Index <> -1 then + begin + TBasedxReportLinkAccess(AReportLink).Controller := nil; + FAggregatedReportLinks.Delete(Index); + end; +end; + +function TdxCustomContainerReportLink.FindAggregatedLinkByComponent(AComponent: TComponent): TBasedxReportLink; +var + I: Integer; +begin + if AComponent <> nil then + for I := 0 to AggregatedReportLinkCount - 1 do + begin + Result := AggregatedReportLinks[I]; + if (Result <> nil) and (Result.Component = AComponent) then + Exit; + end; + Result := nil; +end; + +function TdxCustomContainerReportLink.HasInconsistentlyAggregatedLinks: Boolean; +var + I: Integer; +begin + Result := True; + for I := 0 to AggregatedReportLinkCount - 1 do + if not IsLinkAggregatedConsistently(AggregatedReportLinks[I]) then + Exit; + Result := False; +end; + +function TdxCustomContainerReportLink.IsLinkAggregable(AReportLink: TBasedxReportLink): Boolean; +begin + Result := (AReportLink <> nil) and (AReportLink <> Self) and AReportLink.Aggregable; +end; + +function TdxCustomContainerReportLink.IsLinkAggregated(AReportLink: TBasedxReportLink): Boolean; +begin + Result := FAggregatedReportLinks.IndexOfObject(AReportLink) <> -1; +end; + +function TdxCustomContainerReportLink.IsLinkAggregatedConsistently(AReportLink: TBasedxReportLink): Boolean; +begin + Result := IsLinkAggregated(AReportLink) and (AReportLink.Component is TControl) and + (Container <> nil) and Container.ContainsControl(TControl(AReportLink.Component)); +end; + +procedure TdxCustomContainerReportLink.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineBinaryProperty('HiddenComponents', ReadHiddenComponents, + WriteHiddenComponents, True); + Filer.DefineBinaryProperty('ExcludedComponents', ReadExcludedComponents, + WriteExcludedComponents, True); + Filer.DefineBinaryProperty('AggregatedReportLinks', ReadAggregatedReportLinks, + WriteAggregatedReportLinks, True); +end; + +procedure TdxCustomContainerReportLink.Loaded; +begin + inherited; + LoadHiddenComponents; + LoadExcludedComponents; + LoadAggregatedReportLinks; +end; + +procedure TdxCustomContainerReportLink.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if (Operation = opRemove) and not IsDestroying then + begin + UnexcludeComponent(AComponent); + UnhideComponent(AComponent); + if AComponent is TBasedxReportLink then + DisaggregateLink(TBasedxReportLink(AComponent)); + end; +end; + +procedure TdxCustomContainerReportLink.AfterDesignReport(ADone: Boolean); +begin + InstallAggregatedReportLinksController(False); + inherited; +end; + +procedure TdxCustomContainerReportLink.BeforeDesignReport; +begin + inherited; + InstallAggregatedReportLinksController(True); + HideDesignerTabs(DesignWindow); +end; + +procedure TdxCustomContainerReportLink.ConstructReport(AReportCells: TdxReportCells); +var + Root: TdxReportCell; +begin + inherited; + if Container = nil then Exit; + + PrepareConstruct; + try + Root := BuildContainer(Container, nil, nil); + if not AbortBuilding then + begin + RepositionControls; + Root.Left := 0; + Root.Top := 0; + AReportCells.Cells.BoundsRect := MakeRect(0, 0, Root.Width, Root.Height); + end; + finally + UnprepareConstruct; + end; +end; + +procedure TdxCustomContainerReportLink.ConvertCoords; + + procedure ConvertDelimiters(ADelimiters: TList); + var + I, Value: Integer; + begin + for I := 0 to ADelimiters.Count - 1 do + begin + Value := Integer(ADelimiters[I]); + Value := MulDiv(Value, PixelsNumerator, PixelsDenominator); + ADelimiters[I] := Pointer(Value); + end; + end; + +begin + inherited; + ConvertDelimiters(DelimitersHorz); + ConvertDelimiters(DelimitersVert); +end; + +procedure TdxCustomContainerReportLink.CustomDraw(AItem: TAbstractdxReportCellData; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); +begin + if AItem.Data <> 0 then DoCustomDrawItem(ACanvas, AItem, ADone); +end; + +procedure TdxCustomContainerReportLink.DoApplyInDesigner; +begin + inherited; + InstallAggregatedReportLinksController(True); +end; + +procedure TdxCustomContainerReportLink.DoChangeComponent; +begin + inherited; + DisaggregateAllLinks; + UnexcludeAllComponents; + UnhideAllComponents; +end; + +function TdxCustomContainerReportLink.GetDesignerClass: TdxReportLinkDesignWindowClass; +begin + Result := inherited GetDesignerClass; + if (Result = nil) and ((Component is TForm) {$IFDEF DELPHI5} or (Component is TFrame) {$ENDIF}) then + Result := TdxfmCustomContainerDesignWindow; +end; + +function TdxCustomContainerReportLink.GetEmptyPagesCanExist: Boolean; +begin + Result := True; +end; + +procedure TdxCustomContainerReportLink.GetImageLists(AProc: TdxPSGetImageListProc); +var + I: Integer; +begin + inherited; + for I := 0 to DefinitionCount - 1 do + Producers[Definitions[I].Component].GetImageLists(AProc); +end; + +procedure TdxCustomContainerReportLink.InternalRestoreDefaults; +begin + inherited; + + OptionsBehavior.RestoreDefaults; + OptionsDesignerTabs.RestoreDefaults; + //OptionsItemPlace.RestoreDefaults; {.2} + OptionsPagination.RestoreDefaults; + OptionsRefinements.RestoreDefaults; + OptionsTransparent.RestoreDefaults; + + SupportedCustomDraw := False; +end; + +function TdxCustomContainerReportLink.IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; +begin + Result := SupportedCustomDraw and (Item <> nil) and (Item.Data <> 0); +end; + +procedure TdxCustomContainerReportLink.MakeDelimiters(AReportCells: TdxReportCells; + AHorzDelimiters, AVertDelimiters: TList); +begin + inherited; + dxPSUtl.dxAppendList(DelimitersHorz, AHorzDelimiters); + dxPSUtl.dxAppendList(DelimitersVert, AVertDelimiters); +end; + +function TdxCustomContainerReportLink.BuildContainer(AContainer: TWinControl; + AParentBuilder: TdxPSContainerBuilder; AParentHost: TdxReportCell = nil): TdxReportCell; +begin + with CreateBuilder(AContainer, AParentBuilder, AParentHost) do + try + Result := Build; + finally + Free; + end; +end; + +function TdxCustomContainerReportLink.CreateBuilder(AContainer: TWinControl; + AParentBuilder: TdxPSContainerBuilder; AParentHost: TdxReportCell = nil): TdxPSContainerBuilder; +begin + Result := dxContainerBuilderFactory.CreateBuilder(Self, AContainer, AParentBuilder, AParentHost); +end; + +function TdxCustomContainerReportLink.CreateItemDefinition(AComponent: TComponent; + AnItem: TdxReportVisualItem): TdxPSCustomContainerItemDefinition; +begin + with Producers[AComponent] do + begin + Result := DefinitionClass.Create(Self, AComponent, AnItem); + InitializeOptionsPlace(Result.OptionsPlace); + end; + AddDefinition(Result); +end; + +function TdxCustomContainerReportLink.GetProducer(Component: TComponent): TdxPSCustomProducer; +begin + Result := ProducerCache[dxPSContainerItemProducerFactory[Component, Component = Container], Component]; +end; + +procedure TdxCustomContainerReportLink.DoCustomDrawItem(ACanvas: TCanvas; + AnItem: TAbstractdxReportCellData; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawItem) then + FOnCustomDrawItem(Self, ACanvas, AnItem, TComponent(TObject(AnItem.Data)), ADone); +end; + +procedure TdxCustomContainerReportLink.DoGetComponentCaption(AComponent: TComponent; + var ACaption: string); +begin + if Assigned(FOnGetComponentCaption) then + FOnGetComponentCaption(Self, AComponent, ACaption) +end; + +function TdxCustomContainerReportLink.DoGetReportLink(AComponent: TComponent): TBasedxReportLink; +begin + Result := nil; + //if OptionsBehavior.ConsumeExistingLinks then + Result := FindAggregatedLinkByComponent(AComponent); + if Assigned(FOnGetComponentReportLink) then + FOnGetComponentReportLink(Self, AComponent, Result); + if Result <> nil then + Result.Initialize; +end; + +procedure TdxCustomContainerReportLink.DoInitializeItem(AnItem: TdxReportVisualItem); +begin + if Assigned(FOnInitializeItem) then + FOnInitializeItem(Self, AnItem, TComponent(TObject(AnItem.Data))); +end; + +procedure TdxCustomContainerReportLink.DoInitializeItemOptionsPlace(AnItem: TdxReportVisualItem); +begin + if Assigned(FOnInitializeItemOptionsPlace) then + FOnInitializeItemOptionsPlace(Self, AnItem, TComponent(TObject(AnItem.Data)), + DefinitionsByReportItem[AnItem].OptionsPlace); +end; + +procedure TdxCustomContainerReportLink.DoInitializeReportLink(AReportLink: TBasedxReportLink; + AStage: TdxPSReportLinkProcessingStage); +begin + if Assigned(FOnInitializeReportLink) then + FOnInitializeReportLink(Self, AReportLink, AStage); +end; + +function TdxCustomContainerReportLink.DoIsComponentProcessed(AComponent: TComponent): Boolean; +var + Index: Integer; +begin + Result := (not (AComponent is TControl) or + (TControl(AComponent).Visible and not IsRectEmpty(TControl(AComponent).BoundsRect))) and + not FindHiddenComponent(AComponent, Index) and not FindExcludedComponent(AComponent, Index); + if Assigned(FOnIsComponentProcessed) then + FOnIsComponentProcessed(Self, AComponent, Result); +end; + +procedure TdxCustomContainerReportLink.CreateOptions; +begin + FOptionsBehavior := GetOptionsBehaviorClass.Create(Self); + FOptionsDesignerTabs := GetOptionsDesignerTabsClass.Create(Self); + //FOptionsItemPlace := GetOptionsItemPlaceClass.Create(Self); {.2} + FOptionsPagination := GetOptionsPaginationClass.Create(Self); + FOptionsRefinements := GetOptionsRefinementsClass.Create(Self); + FOptionsTransparent := GetOptionsTransparentClass.Create(Self); +end; + +procedure TdxCustomContainerReportLink.DestroyOptions; +begin + FreeAndNil(FOptionsTransparent); + FreeAndNil(FOptionsRefinements); + FreeAndNil(FOptionsPagination); + //FreeAndNil(FOptionsItemPlace); {.2} + FreeAndNil(FOptionsDesignerTabs); + FreeAndNil(FOptionsBehavior); +end; + +function TdxCustomContainerReportLink.GetOptionsBehaviorClass: TdxCustomContainerReportLinkOptionsBehaviorClass; +begin + Result := TdxCustomContainerReportLinkOptionsBehavior; +end; + +function TdxCustomContainerReportLink.GetOptionsDesignerTabsClass: TdxCustomContainerReportLinkOptionsDesignerTabsClass; +begin + Result := TdxCustomContainerReportLinkOptionsDesignerTabs; +end; + +function TdxCustomContainerReportLink.GetOptionsItemPlaceClass: TdxCustomContainerReportLinkOptionsItemPlaceClass; +begin + Result := TdxCustomContainerReportLinkOptionsItemPlace; +end; + +function TdxCustomContainerReportLink.GetOptionsPaginationClass: TdxCustomContainerReportLinkOptionsPaginationClass; +begin + Result := TdxCustomContainerReportLinkOptionsPagination; +end; + +function TdxCustomContainerReportLink.GetOptionsRefinementsClass: TdxCustomContainerReportLinkOptionsRefinementsClass; +begin + Result := TdxCustomContainerReportLinkOptionsRefinements; +end; + +function TdxCustomContainerReportLink.GetOptionsTransparentClass: TdxCustomContainerReportLinkOptionsTransparentClass; +begin + Result := TdxCustomContainerReportLinkOptionsTransparent; +end; + +procedure TdxCustomContainerReportLink.OptionsModified(AnOptions: TdxCustomContainerReportLinkOptions); +begin + LinkModified(True); +end; + +procedure TdxCustomContainerReportLink.PrepareConstruct; +begin + ClearDefinitions; + FScreenDC := GetDC(0); + CreateRootLookAndFeel; +end; + +procedure TdxCustomContainerReportLink.UnprepareConstruct; +begin + if not AbortBuilding then + begin + PullReportItems; + AddDelimiters; + end; + ReleaseDC(0, FScreenDC); +end; + +procedure TdxCustomContainerReportLink.AddDefinition(ADefinition: TdxPSCustomContainerItemDefinition); +begin + FDefinitions.Add(ADefinition); +end; + +procedure TdxCustomContainerReportLink.ClearDefinitions; +var + I: Integer; +begin + for I := 0 to DefinitionCount - 1 do + Definitions[I].Free; + FDefinitions.Clear; +end; + +function TdxCustomContainerReportLink.FindDefinition(AComponent: TComponent; + out AnIndex: Integer): Boolean; +begin + AnIndex := FDefinitions.IndexOf(DefinitionsByContainerItem[AComponent]); + Result := AnIndex <> -1; +end; + +function TdxCustomContainerReportLink.FindDefinition(AnItem: TdxReportVisualItem; + out AnIndex: Integer): Boolean; +begin + AnIndex := FDefinitions.IndexOf(DefinitionsByReportItem[AnItem]); + Result := AnIndex <> -1; +end; + +procedure TdxCustomContainerReportLink.FreeAndNilDefinitions; +begin + ClearDefinitions; + FreeAndNil(FDefinitions); +end; + +procedure TdxCustomContainerReportLink.DeleteDefinition(Index: Integer); +begin + Definitions[Index].Free; + FDefinitions.Delete(Index); +end; + +procedure TdxCustomContainerReportLink.AddControl(ATreeView: TTreeView; + AParent: TTreeNode; AControl: TControl); +var + Index, I: Integer; + Control: TControl; +begin + AParent := AddNode(ATreeView, AParent, AControl, not FindExcludedComponent(AControl, Index)); + if AControl is TWinControl then + for I := 0 to TWinControl(AControl).ControlCount - 1 do + begin + Control := TWinControl(AControl).Controls[I]; + if Producers[AControl].CanProcessChild(Control) and not FindHiddenComponent(Control, Index) then + AddControl(ATreeView, AParent, Control); + end; +end; + +procedure TdxCustomContainerReportLink.AddHiddenControl(ATreeView: TTreeView; + AParent: TTreeNode; AControl: TControl); +var + Index, I: Integer; + Control: TControl; +begin + AParent := AddNode(ATreeView, AParent, AControl, not FindHiddenComponent(AControl, Index)); + if AControl is TWinControl then + for I := 0 to TWinControl(AControl).ControlCount - 1 do + begin + Control := TWinControl(AControl).Controls[I]; + if Producers[AControl].CanProcessChild(Control) then + AddHiddenControl(ATreeView, AParent, Control); + end; +end; + +function TdxCustomContainerReportLink.AddNode(ATreeView: TTreeView; + AParent: TTreeNode; AComponent: TComponent; AChecked: Boolean): TTreeNode; + + function PrepareText(const S: string): string; + + procedure DoTrancateString(var S: string); + begin + if Length(S) > 255 then + begin + Delete(S, 256, Length(S) - 255); + Delete(S, Length(S) - 3, 3); + S := S + '...'; + end; + end; + + begin + Result := S; + DoTrancateString(Result); + Result := RemoveAccelChars(Result, False); + end; + +var + NodeObject: TdxNodeObject; + S: string; +begin + NodeObject := CreateNodeObject(AComponent, AChecked); + S := PrepareText(NodeObject.Caption); + Result := ATreeView.Items.AddChildObject(AParent, S, NodeObject); + Result.StateIndex := dxPSUtl.dxCheckStateImageIndexMap(NodeObject.State); +end; + +function TdxCustomContainerReportLink.CreateNodeObject(AComponent: TComponent; + AChecked: Boolean): TdxNodeObject; +const + StateMap: array[Boolean] of TCheckBoxState = (cbUnchecked, cbChecked); +begin + Result := TdxNodeObject.Create; + with Result do + begin + Caption := Producers[AComponent].ProducingObjectFriendlyName; + Component := AComponent; + DoGetComponentCaption(AComponent, Caption); + State := StateMap[AChecked]; + end; +end; + +function TdxCustomContainerReportLink.IsComponentEditable(AComponent: TComponent): Boolean; +begin + Result := AComponent <> Container; +end; + +procedure TdxCustomContainerReportLink.LoadControlsTree(ATreeView: TTreeView); +begin + ATreeView.Items.Clear; + if Container <> nil then + AddControl(ATreeView, nil, Container); +end; + +procedure TdxCustomContainerReportLink.LoadHiddenControlsTree(ATreeView: TTreeView); +begin + ATreeView.Items.Clear; + if Container <> nil then + AddHiddenControl(ATreeView, nil, Container); +end; + +procedure TdxCustomContainerReportLink.InstallAggregatedReportLinksController(AnInstall: Boolean); +var + I: Integer; +begin + for I := 0 to AggregatedReportLinkCount - 1 do + with TBasedxReportLinkAccess(AggregatedReportLinks[I]) do + if AnInstall then + Controller := Self + else + Controller := nil; +end; + +function TdxCustomContainerReportLink.GetComponentByName(const AName: string): TComponent; +begin + if AName <> '' then + begin + Result := Container.FindChildControl(AName); + if (Result = nil) and (Container <> nil) and (Container.Owner <> nil) then + Result := Container.Owner.FindComponent(AName); + end + else + Result := nil; +end; + +function TdxCustomContainerReportLink.GetPreparedFontIndex(AFont: TFont): Integer; +begin + Result := GetPreparedFontIndex(AFont, True, AFont.Name, AFont.Color, AFont.Style); +end; + +function TdxCustomContainerReportLink.GetPreparedFontIndex(AFont: TFont; AnIsFontSubstitutable: Boolean; + const AFontName: string; AFontColor: TColor; AFontStyle: TFontStyles): Integer; +begin + PreparationFont.Assign(AFont); + if AnIsFontSubstitutable and not dxIsTrueTypeFont(AFont) then + PreparationFont.Name := Font.Name + else + PreparationFont.Name := AFontName; + PreparationFont.Color := AFontColor; + PreparationFont.Style := AFontStyle; + Result := AddFontToPool(PreparationFont); +end; + +function TdxCustomContainerReportLink.IsComponentProcessed(AComponent: TComponent): Boolean; +begin + Result := DefinitionsByContainerItem[AComponent] <> nil; +end; + +procedure TdxCustomContainerReportLink.AddDelimiters; +var + I: Integer; +begin + DelimitersHorz.Clear; + DelimitersVert.Clear; + for I := 0 to DefinitionCount - 1 do + with Definitions[I] do + begin + AddDelimitersHorz(DelimitersHorz); + AddDelimitersVert(DelimitersVert); + end; +end; + +procedure TdxCustomContainerReportLink.CreateRootLookAndFeel; +begin + ReportCells.LookAndFeel := CreateGroupLookAndFeel(TdxPSReportGroupStandardLookAndFeel); + with ReportCells.LookAndFeel do + begin + FontIndex := AddFontToPool(Control_GetFont(Container)); + CaptionFontIndex := ReportCells.LookAndFeel.FontIndex; + Color := Control_GetColor(Container); + end; +end; + +procedure TdxCustomContainerReportLink.HideDesignerTabs(ADesignWindow: TdxfmCustomContainerDesignWindow); +begin + if not IsDesigning then + with OptionsDesignerTabs do + begin + ADesignWindow.ReportLinksTab.TabVisible := + ReportLinks and ((AggregatedReportLinkCount <> 0) or not AutoHideReportLinksIfEmpty); + ADesignWindow.ControlsTab.TabVisible := Controls; + end; +end; + +procedure TdxCustomContainerReportLink.PullReportItems; + + procedure PullNestedItem(AnItem: TdxReportVisualItem); + begin + with AnItem do + begin + Left := Left + Parent.Left; + Top := Top + Parent.Top; + Parent := Parent.Parent; + end; + end; + + function NeedToBeEliminated(AnItem: TdxReportVisualItem): Boolean; + const + MaxHeight = High(Word) div 2; + begin + Result := AnItem.Height > MaxHeight; + end; + + procedure EnumNestedItems(ACell: TdxReportCell; APull: Boolean); + var + I, Index: Integer; + Item: TdxReportVisualItem; + begin + for I := ACell.CellCount - 1 downto 0 do + begin + Item := ACell.Cells[I]; + if APull then PullNestedItem(Item); + + if NeedToBeEliminated(Item) then + begin + EnumNestedItems(TdxReportCell(Item), True); + if FindDefinition(Item, Index) then DeleteDefinition(Index); + Item.Free; + end; + end; + + for I := ACell.DataItemCount - 1 downto 0 do + begin + Item := ACell.DataItems[I]; + if NeedToBeEliminated(Item) then + begin + if FindDefinition(Item, Index) then DeleteDefinition(Index); + Item.Free; + end + else + if APull then PullNestedItem(Item); + end; + end; + +begin + if IsWin95Or98 then EnumNestedItems(RootCell, False); +end; + +procedure TdxCustomContainerReportLink.RepositionControls; + + procedure EnumContainer(AContainer: TWinControl); + var + I: Integer; + Control: TControl; + begin + for I := 0 to AContainer.ControlCount - 1 do + begin + Control := AContainer.Controls[I]; + if IsComponentProcessed(Control) then + begin + if Control is TWinControl then + EnumContainer(TWinControl(Control)); + Producers[Control].Reposition; + end; + end; + end; + +begin + EnumContainer(Container); + Producers[Container].Reposition; +end; + +function TdxCustomContainerReportLink.NeedTwoPassRendering: Boolean; +begin + Result := True; +end; + +function TdxCustomContainerReportLink.IsScaleGridLines: Boolean; +begin + Result := True; +end; + +function TdxCustomContainerReportLink.GetAggregatedReportLink(Index: Integer): TBasedxReportLink; +begin + Result := TBasedxReportLink(FAggregatedReportLinks.Objects[Index]); +end; + +function TdxCustomContainerReportLink.GetAggregatedReportLinkCount: Integer; +begin + Result := FAggregatedReportLinks.Count; +end; + +function TdxCustomContainerReportLink.GetContainer: TWinControl; +begin + Result := TWinControl(Component); +end; + +function TdxCustomContainerReportLink.GetController: TdxCustomContainerReportLink; +begin + Result := inherited Controller as TdxCustomContainerReportLink; +end; + +function TdxCustomContainerReportLink.GetDefinition(Index: Integer): TdxPSCustomContainerItemDefinition; +begin + Result := TdxPSCustomContainerItemDefinition(FDefinitions[Index]); +end; + +function TdxCustomContainerReportLink.GetDefinitionByContainerItem(Component: TComponent): TdxPSCustomContainerItemDefinition; +var + I: Integer; +begin + for I := 0 to DefinitionCount - 1 do + begin + Result := Definitions[I]; + if Result.Component = Component then Exit; + end; + Result := nil; +end; + +function TdxCustomContainerReportLink.GetDefinitionByReportItem(Item: TdxReportVisualItem): TdxPSCustomContainerItemDefinition; +var + I: Integer; +begin + for I := 0 to DefinitionCount - 1 do + begin + Result := Definitions[I]; + if Result.ReportItem = Item then Exit; + end; + Result := nil; +end; + +function TdxCustomContainerReportLink.GetDefinitionCount: Integer; +begin + Result := FDefinitions.Count; +end; + +function TdxCustomContainerReportLink.GetDelimitersHorzCount: Integer; +begin + Result := DelimitersHorz.Count; +end; + +function TdxCustomContainerReportLink.GetDelimitersHorzItem(Index: Integer): Integer; +begin + Result := Integer(DelimitersHorz[Index]); +end; + +function TdxCustomContainerReportLink.GetDelimitersVertCount: Integer; +begin + Result := DelimitersVert.Count; +end; + +function TdxCustomContainerReportLink.GetDelimitersVertItem(Index: Integer): Integer; +begin + Result := Integer(DelimitersVert[Index]); +end; + +function TdxCustomContainerReportLink.GetDesignWindow: TdxfmCustomContainerDesignWindow; +begin + Result := inherited DesignWindow as TdxfmCustomContainerDesignWindow; +end; + +function TdxCustomContainerReportLink.GetExcludedComponent(Index: Integer): TComponent; +begin + Result := TComponent(FExcludedComponents.Objects[Index]); +end; + +function TdxCustomContainerReportLink.GetExcludedComponentCount: Integer; +begin + Result := FExcludedComponents.Count; +end; + +function TdxCustomContainerReportLink.GetHiddenComponent(Index: Integer): TComponent; +begin + Result := TComponent(FHiddenComponents.Objects[Index]); +end; + +function TdxCustomContainerReportLink.GetHiddenComponentCount: Integer; +begin + Result := FHiddenComponents.Count; +end; + +function TdxCustomContainerReportLink.GetProducerByClass(ProducerClass: TdxPSCustomProducerClass; + Component: TComponent): TdxPSCustomProducer; +begin + Result := ProducerCache[ProducerClass, Component]; +end; + +function TdxCustomContainerReportLink.GetRootCell: TdxReportCell; +begin + Result := ReportCells.Cells; +end; + +function TdxCustomContainerReportLink.GetTopLevelContainer: TWinControl; +begin + if IsAggregated then + Result := Controller.TopLevelContainer + else + Result := Container; +end; + +procedure TdxCustomContainerReportLink.SetController(Value: TdxCustomContainerReportLink); +begin + inherited Controller := Value; +end; + +procedure TdxCustomContainerReportLink.SetOnCustomDrawItem(Value: TdxContainerReportLinkCustomDrawItemEvent); +begin + if @FOnCustomDrawItem <> @Value then + begin + FOnCustomDrawItem := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxCustomContainerReportLink.SetOptionsBehavior(Value: TdxCustomContainerReportLinkOptionsBehavior); +begin + OptionsBehavior.Assign(Value); +end; + +procedure TdxCustomContainerReportLink.SetOptionsDesignerTabs(Value: TdxCustomContainerReportLinkOptionsDesignerTabs); +begin + OptionsDesignerTabs.Assign(Value); +end; +{.2} +{procedure TdxCustomContainerReportLink.SetOptionsItemPlace(Value: TdxCustomContainerReportLinkOptionsItemPlace); +begin + OptionsItemPlace.Assign(Value); +end;} + +procedure TdxCustomContainerReportLink.SetOptionsPagination(Value: TdxCustomContainerReportLinkOptionsPagination); +begin + OptionsPagination.Assign(Value); +end; + +procedure TdxCustomContainerReportLink.SetOptionsRefinements(Value: TdxCustomContainerReportLinkOptionsRefinements); +begin + OptionsRefinements.Assign(Value); +end; + +procedure TdxCustomContainerReportLink.SetOptionsTransparent(Value: TdxCustomContainerReportLinkOptionsTransparent); +begin + OptionsTransparent.Assign(Value); +end; + +procedure TdxCustomContainerReportLink.SetSupportedCustomDraw(Value: Boolean); +begin + if FSupportedCustomDraw <> Value then + begin + FSupportedCustomDraw := Value; + LinkModified(True); + end; +end; + +procedure TdxCustomContainerReportLink.LoadAggregatedReportLinks; +var + I: Integer; + Component: TComponent; +begin + if Owner <> nil then + for I := AggregatedReportLinkCount - 1 downto 0 do + begin + Component := Owner.FindComponent(FAggregatedReportLinks[I]); + if Component <> nil then + FAggregatedReportLinks.Objects[I] := Component + else + FAggregatedReportLinks.Delete(I); + end; +end; + +procedure TdxCustomContainerReportLink.ReadAggregatedReportLinks(Stream: TStream); +begin + FAggregatedReportLinks.LoadFromStream(Stream); +end; + +procedure TdxCustomContainerReportLink.WriteAggregatedReportLinks(Stream: TStream); +begin + FAggregatedReportLinks.SaveToStream(Stream); +end; + +procedure TdxCustomContainerReportLink.LoadExcludedComponents; +var + I: Integer; + Component: TComponent; +begin + if Owner <> nil then + for I := ExcludedComponentCount - 1 downto 0 do + begin + Component := Owner.FindComponent(FExcludedComponents[I]); + if Component <> nil then + FExcludedComponents.Objects[I] := Component + else + FExcludedComponents.Delete(I); + end; +end; + +procedure TdxCustomContainerReportLink.ReadExcludedComponents(Stream: TStream); +begin + FExcludedComponents.LoadFromStream(Stream); +end; + +procedure TdxCustomContainerReportLink.WriteExcludedComponents(Stream: TStream); +begin + FExcludedComponents.SaveToStream(Stream); +end; + +procedure TdxCustomContainerReportLink.LoadHiddenComponents; +var + I: Integer; + Component: TComponent; +begin + if Owner <> nil then + for I := HiddenComponentCount - 1 downto 0 do + begin + Component := Owner.FindComponent(FHiddenComponents[I]); + if Component <> nil then + FHiddenComponents.Objects[I] := Component + else + FHiddenComponents.Delete(I); + end; +end; + +procedure TdxCustomContainerReportLink.ReadHiddenComponents(Stream: TStream); +begin + FHiddenComponents.LoadFromStream(Stream); +end; + +procedure TdxCustomContainerReportLink.WriteHiddenComponents(Stream: TStream); +begin + FHiddenComponents.SaveToStream(Stream); +end; + +{ TdxPSContainerDesignWindow } + +constructor TdxfmCustomContainerDesignWindow.Create(AOwner: TComponent); +begin + inherited; + {$IFDEF DELPHI5} + tvControls.OnAdvancedCustomDrawItem := TreeView_AdvancedCustomDrawItem; + tvHiddenControls.OnAdvancedCustomDrawItem := TreeView_AdvancedCustomDrawItem; + {$ENDIF} + PageControl1.ActivePage := tshOptions; + FLastActiveTab := PageControl1.ActivePage; + {$IFDEF WMCONTEXTMENU} + SubstituteTreeViewsWndProc; + {$ENDIF} +end; + +destructor TdxfmCustomContainerDesignWindow.Destroy; +begin + {$IFDEF WMCONTEXTMENU} + RestoreTreeViewsWndProc; + {$ENDIF} + TreeView_FreeNodeObjects(tvControls); + TreeView_FreeNodeObjects(tvHiddenControls); + inherited; +end; + +procedure TdxfmCustomContainerDesignWindow.BeforeConstruction; +begin + inherited; + Options := Options + [foSizeableDialog]; +end; + +procedure TdxfmCustomContainerDesignWindow.DoInitialize; +begin + inherited; + + dxPSUtl.dxCreateCheckMarkImages(ilControls); + RefreshHiddenControlsTree; + RefreshControlsTree; + RefreshReportLinksList; + + with ReportLink.OptionsPagination do + begin + chbxPaginateByControlDetails.Checked := ControlDetails; + chbxPaginateByControls.Checked := Controls; + end; + chbxPaginateByGroups.Visible := False; + chbxPaginateByItems.Visible := False; + + {.2} + {with ReportLink.OptionsItemPlace do + begin + chbxExpandHeight.Checked := ExpandHeight; + chbxExpandWidth.Checked := ExpandWidth; + chbxShrinkHeight.Checked := ShrinkHeight; + chbxShrinkWidth.Checked := ShrinkWidth; + end;} + + with ReportLink.OptionsTransparent do + begin + chbxTransparentContainers.Checked := Containers; + chbxTransparentControls.Checked := Controls; + chbxTransparentRoot.Checked := Root; + chbxTransparentGraphics.Checked := Graphics; + end; + chbxTransparentGroups.Visible := False; + chbxTransparentItems.Visible := False; + + pnlAvailableLinksSite.Visible := ReportLink.IsDesigning; + pnlMoveButtonsSite.Visible := ReportLink.IsDesigning; + lblAggregatedLinks.Visible := ReportLink.IsDesigning; + if not ReportLink.IsDesigning then + begin + lbxAggregatedLinks.Align := alClient; + lbxAggregatedLinks.DragMode := dmManual; + lbxAggregatedLinks.MultiSelect := False; + btnLinksDesign.Top := btnControlsCheckAll.Top; + btnLinksRemoveInconsistents.Visible := False; + end; + + lblSize.Visible := False; + bvlSize.Visible := False; + imgSize.Visible := False; + chbxAutoWidth.Visible := False; +end; + +procedure TdxfmCustomContainerDesignWindow.LoadStrings; +begin + inherited; + tshOptions.Caption := cxGetResourceString(@sdxOptions); + lblTransparents.Caption := cxGetResourceString(@sdxTransparents); + chbxTransparentContainers.Caption := cxGetResourceString(@sdxContainers); + chbxTransparentControls.Caption := cxGetResourceString(@sdxControls); + chbxTransparentRoot.Caption := cxGetResourceString(@sdxRoot); + chbxTransparentGraphics.Caption := cxGetResourceString(@sdxGraphics); + chbxTransparentGroups.Caption := cxGetResourceString(@sdxGroups); + chbxTransparentItems.Caption := cxGetResourceString(@sdxItems); + + (*lblControlsPlace.Caption := cxGetResourceString(@sdxControlsPlace); + chbxExpandHeight.Caption := cxGetResourceString(@sdxExpandHeight); + chbxExpandWidth.Caption := cxGetResourceString(@sdxExpandWidth); + chbxShrinkHeight.Caption := cxGetResourceString(@sdxShrinkHeight); + chbxShrinkWidth.Caption := cxGetResourceString(@sdxShrinkWidth);*) + + lblPagination.Caption := cxGetResourceString(@sdxPagination); + chbxPaginateByControlDetails.Caption := cxGetResourceString(@sdxPaginateByControlDetails); + chbxPaginateByControls.Caption := cxGetResourceString(@sdxPaginateByControls); + chbxPaginateByGroups.Caption := cxGetResourceString(@sdxPaginateByGroups); + chbxPaginateByItems.Caption := cxGetResourceString(@sdxPaginateByItems); + + lblSize.Caption := cxGetResourceString(@sdxSize); + chbxAutoWidth.Caption := cxGetResourceString(@sdxAutoWidth); + + tshReportLinks.Caption := cxGetResourceString(@sdxReportLinksTab); + lblAvailableLinks.Caption := cxGetResourceString(@sdxAvailableLinks); + lblAggregatedLinks.Caption := cxGetResourceString(@sdxAggregatedLinks); + btnLinksDesign.Caption := cxGetResourceString(@sdxBtnDesign); + btnLinksRemoveInconsistents.Caption := cxGetResourceString(@sdxBtnRemoveInconsistents); + + tshControls.Caption := cxGetResourceString(@sdxControlsTab); + btnControlsCheckAll.Caption := cxGetResourceString(@sdxCheckAll); + btnControlsExpandAll.Caption := cxGetResourceString(@sdxExpandAll); + + tshHiddenControls.Caption := cxGetResourceString(@sdxHiddenControlsTab); + btnHiddenControlsCheckAll.Caption := cxGetResourceString(@sdxCheckAll); + btnHiddenControlsExpandAll.Caption := cxGetResourceString(@sdxExpandAll); + + miControlsCheckAll.Caption := cxGetResourceString(@sdxCheckAll); + miControlsCheckAllChildren.Caption := cxGetResourceString(@sdxCheckAllChildren); + miControlsUncheckAllChildren.Caption := cxGetResourceString(@sdxUncheckAllChildren); + miControlsExpandAll.Caption := cxGetResourceString(@sdxExpandAll); +end; + +procedure TdxfmCustomContainerDesignWindow.UpdateControlsState; +var + Root: TTreeNode; +begin + inherited; + sbtnAdd.Enabled := CanAggregate; + sbtnRemove.Enabled := CanDisaggregate; + btnLinksDesign.Enabled := CanDesign; + btnLinksRemoveInconsistents.Enabled := CanRemoveInconsistents; + + Root := TreeView_GetRoot(tvControls); + tvControls.Enabled := Root <> nil; + btnControlsCheckAll.Enabled := (Root <> nil) and TreeView_HasUncheckedChildren(Root); + btnControlsExpandAll.Enabled := (Root <> nil) and (Root.Count <> 0); + + Root := TreeView_GetRoot(tvHiddenControls); + tvHiddenControls.Enabled := Root <> nil; + btnHiddenControlsCheckAll.Enabled := (Root <> nil) and TreeView_HasUncheckedChildren(Root); + btnHiddenControlsExpandAll.Enabled := (Root <> nil) and (Root.Count <> 0); + + tshHiddenControls.HandleNeeded; + if tshHiddenControls.HandleAllocated then + tshHiddenControls.TabVisible := IsDesigning; +end; + +function TdxfmCustomContainerDesignWindow.GetActiveTreeView: TTreeView; +begin + if PageControl1.ActivePage = tshControls then + Result := tvControls + else + Result := tvHiddenControls; +end; + +procedure TdxfmCustomContainerDesignWindow.InitializeControlsTree; +var + Root: TTreeNode; +begin + ReportLink.LoadControlsTree(tvControls); + + Root := TreeView_GetRoot(tvControls); + if Root <> nil then + begin + TreeView_NormalizeNode(Root); + Root.Expand(False); + end; +end; + +procedure TdxfmCustomContainerDesignWindow.InitializeHiddenControlsTree; +var + Root: TTreeNode; +begin + ReportLink.LoadHiddenControlsTree(tvHiddenControls); + + Root := TreeView_GetRoot(tvHiddenControls); + if Root <> nil then + begin + TreeView_NormalizeNode(Root); + Root.Expand(False); + end; +end; + +function TdxfmCustomContainerDesignWindow.IsBoldNode(ANode: TTreeNode): Boolean; +begin + Result := not TreeView_IsNodeEditable(ANode); +end; + +procedure TdxfmCustomContainerDesignWindow.RefreshControlsTree; +begin + if not (dwsInitialize in State) then tvControls.Items.BeginUpdate; + try + InitializeControlsTree; + finally + if not (dwsInitialize in State) then tvControls.Items.EndUpdate; + end; +end; + +procedure TdxfmCustomContainerDesignWindow.RefreshHiddenControlsTree; +begin + if not (dwsInitialize in State) then tvHiddenControls.Items.BeginUpdate; + try + InitializeHiddenControlsTree; + finally + if not (dwsInitialize in State) then tvHiddenControls.Items.EndUpdate; + end; +end; + +procedure TdxfmCustomContainerDesignWindow.RefreshReportLinksList; +begin + if ReportLink.IsDesigning then RefreshAvailableLinks; + RefreshAggregatedLinks; +end; + +procedure TdxfmCustomContainerDesignWindow.SetOptionsPaginationByIndex(AnIndex: Integer; + AValue: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsPagination do + case AnIndex of + 0: ControlDetails := AValue; + 1: Controls := AValue; + end; + Modified := True; +end; + +procedure TdxfmCustomContainerDesignWindow.SetOptionsSizeByIndex(AnIndex: Integer; + AValue: Boolean); +begin +end; + +{.2} +{procedure TdxfmCustomContainerDesignWindow.SetOptionsPlaceByIndex(AnIndex: Integer; + AValue: Boolean); +begin + if LockControlsUpdate then Exit; + + with ContainerReportLink.OptionsItemPlace do + case AnIndex of + 0: ExpandHeight := AValue; + 1: ExpandWidth := AValue; + 2: ShrinkHeight := AValue; + 3: ShrinkWidth := AValue; + end; + Modified := True; +end;} + +procedure TdxfmCustomContainerDesignWindow.SetOptionsTransparentByIndex(AnIndex: Integer; + AValue: Boolean); +begin + if LockControlsUpdate then Exit; + with ReportLink.OptionsTransparent do + case AnIndex of + 0: Root := AValue; + 1: Controls := AValue; + 2: Containers := AValue; + 3: Graphics := AValue; + end; + Modified := True; +end; + +{$IFDEF DELPHI5} + +procedure TdxfmCustomContainerDesignWindow.TreeView_AdvancedCustomDrawItem( + Sender: TCustomTreeView; Node: TTreeNode; State: TCustomDrawState; + Stage: TCustomDrawStage; var PaintImages, DefaultDraw: Boolean); + + procedure DrawNodeExtraText; + const + HighlightColor = clBlue; + var + S: string; + R: TRect; + TextColor, BkColor: COLORREF; + X, Y: Integer; + begin + with Sender.Canvas do + begin + S := '[' + TreeView_GetNodeObject(Node).Component.ClassName + ']'; + R := Node.DisplayRect(True); + with R do + begin + Left := Right; + Inc(Right, 2 + TextWidth(S) + 2); + X := Left + 1; + Y := Top + (Bottom - Top - TextHeight(S)) div 2; + end; + + TextColor := SetTextColor(Handle, ColorToRGB(HighlightColor)); + BkColor := SetBkColor(Handle, ColorToRGB(clWindow)); + ExtTextOut(Handle, X, Y, ETO_OPAQUE, @R, PChar(S), Length(S), nil); + SetBkColor(Handle, BkColor); + SetTextColor(Handle, TextColor); + end; + end; + +begin + if TBasedxReportLinkAccess(ReportLink).IsDesigning and (Stage = cdPostPaint) and + (TreeView_GetNodeObject(Node) <> nil) then + begin + DrawNodeExtraText; + DefaultDraw := False; + end; +end; + +{$ENDIF} + +procedure TdxfmCustomContainerDesignWindow.TreeView_BeginUpdate; +begin + dxPSCore.dxPSStartWait; + ActiveTreeView.Items.BeginUpdate; +end; + +procedure TdxfmCustomContainerDesignWindow.TreeView_CheckAllChildren(ANode: TTreeNode; + AChecked: Boolean); + + procedure DoCheckAllChildren(ANode: TTreeNode); + const + StateMap: array[Boolean, Boolean] of TCheckBoxState = ((cbGrayed, cbChecked), (cbUnchecked, cbChecked)); + var + I: Integer; + Node: TTreeNode; + begin + for I := 0 to ANode.Count - 1 do + begin + Node := ANode[I]; + TreeView_SetNodeState(Node, StateMap[TreeView_IsNodeEditable(Node), AChecked]); + DoCheckAllChildren(Node); + end; + end; + +begin + DoCheckAllChildren(ANode); +end; + +procedure TdxfmCustomContainerDesignWindow.TreeView_EndUpdate; +begin + ActiveTreeView.Items.EndUpdate; + dxPSCore.dxPSStopWait; +end; + +procedure TdxfmCustomContainerDesignWindow.TreeView_FreeNodeObjects(ATreeView: TTreeView); + + procedure FreeNodeObject(ANode: TTreeNode); + var + I: Integer; + begin + TObject(ANode.Data).Free; + for I := 0 to ANode.Count - 1 do + FreeNodeObject(ANode[I]); + end; + +var + Root: TTreeNode; +begin + Root := TreeView_GetRoot(ATreeView); + if Root <> nil then + FreeNodeObject(Root); +end; + +function TdxfmCustomContainerDesignWindow.TreeView_GetNodeObject(ANode: TTreeNode): TdxNodeObject; +begin + Result := TdxNodeObject(ANode.Data); +end; + +function TdxfmCustomContainerDesignWindow.TreeView_getRoot(ATreeView: TTreeView): TTreeNode; +begin + Result := ATreeView.Items.GetFirstNode; +end; + +function TdxfmCustomContainerDesignWindow.TreeView_HasCheckedChildren(ANode: TTreeNode): Boolean; +var + I: Integer; + Node: TTreeNode; +begin + Result := True; + for I := 0 to ANode.Count - 1 do + begin + Node := ANode[I]; + if TreeView_GetNodeObject(Node).State <> cbUnchecked then + Exit; + if (Node.Count <> 0) and TreeView_HasCheckedChildren(Node) then + Exit; + end; + Result := False; +end; + +function TdxfmCustomContainerDesignWindow.TreeView_HasRoot(ATreeView: TTreeView): Boolean; +begin + Result := TreeView_GetRoot(ATreeView) <> nil; +end; + +function TdxfmCustomContainerDesignWindow.TreeView_HasUncheckedChildren(ANode: TTreeNode): Boolean; +var + I: Integer; + Node: TTreeNode; +begin + Result := True; + for I := 0 to ANode.Count - 1 do + begin + Node := ANode[I]; + if TreeView_GetNodeObject(Node).State <> cbChecked then + Exit; + if (Node.Count <> 0) and TreeView_HasUncheckedChildren(Node) then + Exit; + end; + Result := False; +end; + +function TdxfmCustomContainerDesignWindow.TreeView_IsNodeEditable(ANode: TTreeNode): Boolean; +begin + Result := (ANode <>nil) and ReportLink.IsComponentEditable(TreeView_GetNodeObject(ANode).Component); +end; + +procedure TdxfmCustomContainerDesignWindow.TreeView_NormalizeNode(ANode: TTreeNode); + + procedure DoUpdateNodeState(ANode: TTreeNode); + var + NodeObject: TdxNodeObject; + begin + NodeObject := TreeView_GetNodeObject(ANode); + if (NodeObject.State = cbChecked) and TreeView_HasUncheckedChildren(ANode) then + NodeObject.State := cbGrayed; + TreeView_UpdateNodeImage(ANode); + end; + +var + I: Integer; + Node: TTreeNode; +begin + for I := 0 to ANode.Count - 1 do + begin + Node := ANode[I]; + if Node.Count <> 0 then + TreeView_NormalizeNode(Node); + end; + DoUpdateNodeState(ANode); +end; + +procedure TdxfmCustomContainerDesignWindow.TreeView_SetNodeState(ANode: TTreeNode; + AState: TCheckBoxState); +var + NodeObject: TdxNodeObject; + Component: TComponent; +begin + NodeObject := TreeView_GetNodeObject(ANode); + NodeObject.State := AState; + + Component := NodeObject.Component; + case NodeObject.State of + cbUnchecked: + if ActiveTreeView = tvHiddenControls then + ReportLink.HideComponent(Component) + else + ReportLink.ExcludeComponent(Component); + cbChecked: + if ActiveTreeView = tvHiddenControls then + ReportLink.UnhideComponent(Component) + else + ReportLink.UnexcludeComponent(Component); + end; + TreeView_UpdateNodeImage(ANode); + + Modified := True; +end; + +procedure TdxfmCustomContainerDesignWindow.TreeView_ToggleNodeState(ANode: TTreeNode); +const + StateToggles: array[TCheckBoxState] of TCheckBoxState = (cbChecked, cbUnchecked, cbChecked); +var + NodeObject: TdxNodeObject; +begin + if (ANode <> nil) and TreeView_IsNodeEditable(ANode) then + begin + NodeObject := TreeView_GetNodeObject(ANode); + TreeView_SetNodeState(ANode, StateToggles[NodeObject.State]); + TreeView_CheckAllChildren(ANode, NodeObject.State = cbChecked); + if ANode.Parent <> nil then + TreeView_UpdateNodesState(ANode.Parent); + end; +end; + +procedure TdxfmCustomContainerDesignWindow.TreeView_UpdateNodeImage(ANode: TTreeNode); +begin + ANode.StateIndex := dxPSUtl.dxCheckStateImageIndexMap(TreeView_GetNodeObject(ANode).State); +end; + +procedure TdxfmCustomContainerDesignWindow.TreeView_UpdateNodesState(ANode: TTreeNode); + + procedure DoUpdateNodeState(ANode: TTreeNode); + begin + with TreeView_GetNodeObject(ANode) do + case State of + cbUnchecked, + cbChecked: + if TreeView_HasUncheckedChildren(ANode) then + State := cbGrayed; + cbGrayed: + if not TreeView_HasUncheckedChildren(ANode) then + State := cbChecked; + end; + TreeView_UpdateNodeImage(ANode); + end; + +begin + DoUpdateNodeState(ANode); + if ANode.Parent <> nil then + TreeView_UpdateNodesState(ANode.Parent); +end; + +function TdxfmCustomContainerDesignWindow.GetAggregatedLink(Index: Integer): TBasedxReportLink; +begin + Result := TBasedxReportLink(lbxAggregatedLinks.Items.Objects[Index]); +end; + +function TdxfmCustomContainerDesignWindow.GetAggregatedLinkCount: Integer; +begin + Result := lbxAggregatedLinks.Items.Count; +end; + +function TdxfmCustomContainerDesignWindow.GetAggregatedLinkSelected(Index: Integer): Boolean; +begin + Result := lbxAggregatedLinks.Selected[Index]; +end; + +function TdxfmCustomContainerDesignWindow.GetAvailableLink(Index: Integer): TBasedxReportLink; +begin + Result := TBasedxReportLink(lbxAvailableLinks.Items.Objects[Index]); +end; + +function TdxfmCustomContainerDesignWindow.GetAvailableLinkCount: Integer; +begin + Result := lbxAvailableLinks.Items.Count; +end; + +function TdxfmCustomContainerDesignWindow.GetAvailableLinkSelected(Index: Integer): Boolean; +begin + Result := lbxAvailableLinks.Selected[Index]; +end; + +function TdxfmCustomContainerDesignWindow.GetControlsTab: TTabSheet; +begin + Result := tshControls; +end; + +function TdxfmCustomContainerDesignWindow.GetHiddenControlsTab: TTabSheet; +begin + Result := tshHiddenControls; +end; + +function TdxfmCustomContainerDesignWindow.GetReportLink: TdxCustomContainerReportLink; +begin + Result := inherited ReportLink as TdxCustomContainerReportLink; +end; + +function TdxfmCustomContainerDesignWindow.GetReportLinksTab: TTabSheet; +begin + Result := tshReportLinks; +end; + +function TdxfmCustomContainerDesignWindow.GetSelectedReportLink: TBasedxReportLink; +begin + with lbxAggregatedLinks do + if (not ReportLink.IsDesigning or (SelCount = 1)) and (ItemIndex <> -1) then + Result := TBasedxReportLink(Items.Objects[ItemIndex]) + else + Result := nil +end; + +procedure TdxfmCustomContainerDesignWindow.DoCheckAllChildren(ANode: TTreeNode; + AChecked: Boolean); +begin + if ANode <> nil then + begin + TreeView_BeginUpdate; + try + TreeView_CheckAllChildren(ANode, AChecked); + TreeView_UpdateNodesState(ANode); + finally + TreeView_EndUpdate; + end; + FAreHiddenControlsChanged := True; + Modified := True; + end; +end; + +procedure TdxfmCustomContainerDesignWindow.DoToggleNodeState(ANode: TTreeNode); +begin + if TreeView_IsNodeEditable(ANode) then + begin + TreeView_BeginUpdate; + try + TreeView_ToggleNodeState(ANode); + finally + TreeView_EndUpdate; + end; + FAreHiddenControlsChanged := True; + //UpdateControlsState; + Modified := True; + end; +end; + +function TdxfmCustomContainerDesignWindow.CanAggregate: Boolean; +begin + Result := lbxAvailableLinks.SelCount <> 0; +end; + +function TdxfmCustomContainerDesignWindow.CanDesign: Boolean; +begin + Result := (SelectedReportLink <> nil) and SelectedReportLink.CheckToDesign; +end; + +function TdxfmCustomContainerDesignWindow.CanDisaggregate: Boolean; +begin + Result := ReportLink.IsDesigning and (lbxAggregatedLinks.SelCount <> 0); +end; + +function TdxfmCustomContainerDesignWindow.CanRemoveInconsistents: Boolean; +begin + Result := ReportLink.HasInconsistentlyAggregatedLinks; +end; + +{function TdxfmCustomContainerDesignWindow.CanSelectAll(AListBox: TListBox): Boolean; +begin + with AListBox do + Result := (Items.Count <> 0) and (Items.Count <> SelCount); +end;} + +procedure TdxfmCustomContainerDesignWindow.DoAggregateSelectedLinks; +var + I: Integer; +begin + for I := 0 to AvailableLinkCount - 1 do + if AvailableLinkSelected[I] then + ReportLink.AggregateLink(AvailableLinks[I]); + + RefreshReportLinksList; + UpdateControlsState; + Modified := True; +end; + +procedure TdxfmCustomContainerDesignWindow.DoDisaggregateSelectedLinks; +var + I: Integer; +begin + for I := 0 to AggregatedLinkCount - 1 do + if AggregatedLinkSelected[I] then + ReportLink.DisaggregateLink(AggregatedLinks[I]); + + RefreshReportLinksList; + UpdateControlsState; + Modified := True; +end; + +procedure TdxfmCustomContainerDesignWindow.RefreshAvailableLinks; +var + I: Integer; + Link: TBasedxReportLink; +begin + with lbxAvailableLinks do + begin + Items.BeginUpdate; + try + Items.Clear; + for I := 0 to ReportLink.ComponentPrinter.LinkCount - 1 do + begin + Link := ReportLink.ComponentPrinter[I]; + if ReportLink.IsLinkAggregable(Link) and not ReportLink.IsLinkAggregated(Link) then + Items.AddObject(Link.Name, Link); + end; + ItemIndex := Items.Count - 1; + if ItemIndex <> -1 then + Selected[ItemIndex] := True; + finally + Items.EndUpdate; + end; + end; +end; + +procedure TdxfmCustomContainerDesignWindow.RefreshAggregatedLinks; +var + I: Integer; + Link: TBasedxReportLink; +begin + with lbxAggregatedLinks do + begin + Items.BeginUpdate; + try + Items.Clear; + for I := 0 to ReportLink.AggregatedReportLinkCount - 1 do + begin + Link := ReportLink.AggregatedReportLinks[I]; + Items.AddObject(Link.Name, Link); + end; + ItemIndex := Items.Count - 1; + if ItemIndex <> -1 then + Selected[ItemIndex] := True; + finally + Items.EndUpdate; + end; + end; +end; + +procedure TdxfmCustomContainerDesignWindow.DoSelectAll(AListBox: TListBox); +{$IFNDEF DELPHI6} +var + I: Integer; +{$ENDIF} +begin + {$IFDEF DELPHI6} + AListBox.SelectAll; + {$ELSE} + for I := 0 to AListBox.Items.Count - 1 do + AListBox.Selected[I] := True; + {$ENDIF} +end; + +{$IFDEF WMCONTEXTMENU} + +procedure TdxfmCustomContainerDesignWindow.ControlsTreeViewWndProc(var Message: TMessage); +begin + FControlsTreeViewWndProc(Message); + if Message.Msg = WM_CONTEXTMENU then + ProcessContextMenu(TWMContextMenu(Message), tvControls); +end; + +procedure TdxfmCustomContainerDesignWindow.HiddenControlsTreeViewWndProc(var Message: TMessage); +begin + FHiddenControlsTreeViewWndProc(Message); + if Message.Msg = WM_CONTEXTMENU then + ProcessContextMenu(TWMContextMenu(Message), tvHiddenControls); +end; + +procedure TdxfmCustomContainerDesignWindow.ProcessContextMenu(AMessage: TWMContextMenu; + ATreeView: TTreeView); +var + KeyState: TKeyboardState; +begin + GetKeyboardState(KeyState); + with AMessage do + TreeViewMouseUp(ATreeView, mbRight, KeyboardStateToShiftState(KeyState), Pos.X, Pos.Y) +end; + +procedure TdxfmCustomContainerDesignWindow.RestoreTreeViewsWndProc; +begin + tvControls.WindowProc := FControlsTreeViewWndProc; + tvHiddenControls.WindowProc := FHiddenControlsTreeViewWndProc; +end; + +procedure TdxfmCustomContainerDesignWindow.SubstituteTreeViewsWndProc; +begin + FControlsTreeViewWndProc := tvControls.WindowProc; + tvControls.WindowProc := ControlsTreeViewWndProc; + + FHiddenControlsTreeViewWndProc := tvHiddenControls.WindowProc; + tvHiddenControls.WindowProc := HiddenControlsTreeViewWndProc; +end; + +{$ENDIF} + +procedure TdxfmCustomContainerDesignWindow.TreeViewClick(Sender: TObject); +var + TreeView: TTreeView; + Pt: TPoint; + HitTest: THitTests; +begin + TreeView := TTreeView(Sender); + Pt := TreeView.ScreenToClient(Mouse.CursorPos); + HitTest := TreeView.GetHitTestInfoAt(Pt.X, Pt.Y); + if htOnStateIcon in HitTest then + DoToggleNodeState(TreeView.GetNodeAt(Pt.X, Pt.Y)); +end; + +procedure TdxfmCustomContainerDesignWindow.TreeViewKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if Key = VK_SPACE then + begin + DoToggleNodeState(TTreeView(Sender).Selected); + Key := 0; + end; +end; + +procedure TdxfmCustomContainerDesignWindow.TreeViewKeyPress(Sender: TObject; + var Key: Char); +begin + if Key = #32 then Key := #0; +end; + +procedure TdxfmCustomContainerDesignWindow.TreeViewMouseUp(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + Pt: TPoint; + Node: TTreeNode; +begin + if Button = mbRight then + begin + Pt := MakePoint(X, Y); + {$IFDEF DELPHI5} + {$IFNDEF DELPHI7} + Pt := TTreeView(Sender).ScreenToClient(Pt); + {$ENDIF} + {$ENDIF} + Node := TTreeView(Sender).GetNodeAt(Pt.X, Pt.Y); + if Node <> nil then + begin + Node.Focused := True; + Node.Selected := True; + end; + dxPSPopupMan.dxPSPopupMenuController.ShowPopupAtMousePos(nil, pmControls); + end; +end; + +procedure TdxfmCustomContainerDesignWindow.TreeViewCheckAllClick(Sender: TObject); +begin + DoCheckAllChildren(TreeView_GetRoot(ActiveTreeView), True); +end; + +procedure TdxfmCustomContainerDesignWindow.TreeViewCheckAllChildrenClick(Sender: TObject); +begin + DoCheckAllChildren(ActiveTreeView.Selected, True); +end; + +procedure TdxfmCustomContainerDesignWindow.TreeViewUncheckAllChildrenClick(Sender: TObject); +begin + DoCheckAllChildren(ActiveTreeView.Selected, False); +end; + +procedure TdxfmCustomContainerDesignWindow.TreeViewExpandAllClick(Sender: TObject); +begin + ActiveTreeView.FullExpand; +end; + +procedure TdxfmCustomContainerDesignWindow.HideStandardControlsClick(Sender: TObject); +begin + ReportLink.HideStandardControls; +end; + +procedure TdxfmCustomContainerDesignWindow.UnhideStandardControlsClick(Sender: TObject); +begin + ReportLink.UnhideStandardControls; +end; + +procedure TdxfmCustomContainerDesignWindow.TreeViewCustomDrawItem( + Sender: TCustomTreeView; Node: TTreeNode; State: TCustomDrawState; + var DefaultDraw: Boolean); +const + FontColors: array[Boolean] of TColor = (clGrayText, clWindowText); + SelectedBkColors: array[Boolean] of TColor = (clBtnFace, clHighlight); + SelectedFontColors: array[Boolean] of TColor = (clGrayText, clHighlightText); +begin + if (Node = nil) or (TreeView_GetNodeObject(Node) = nil) then Exit; + if IsBoldNode(Node) then + begin + if cdsSelected in State then + begin + Sender.Canvas.Brush.Color := SelectedBkColors[Sender.Focused]; + if Sender.Focused then + Sender.Canvas.Font.Color := SelectedFontColors[TreeView_IsNodeEditable(Node)] + else + Sender.Canvas.Font.Color := FontColors[TreeView_IsNodeEditable(Node)]; + end + else + begin + Sender.Canvas.Brush.Color := clWindow; + Sender.Canvas.Font.Color := FontColors[TreeView_IsNodeEditable(Node)]; + end; + Sender.Canvas.Font.Style := Sender.Canvas.Font.Style + [fsBold]; + end; +end; + +procedure TdxfmCustomContainerDesignWindow.DesignClick(Sender: TObject); +begin + Modified := CanDesign and SelectedReportLink.DesignReport; +end; + +procedure TdxfmCustomContainerDesignWindow.pmControlsPopup(Sender: TObject); +var + Node: TTreeNode; +begin + Node := TreeView_GetRoot(ActiveTreeView); + miControlsCheckAll.Enabled := (Node <> nil) and TreeView_HasUncheckedChildren(Node); + miControlsExpandAll.Enabled := (Node <> nil) and (Node.Count <> 0); +// miControlsCheckStandardControls.Visible := ActiveTreeView = tvHiddenControls; +// miControlsCheckStandardControls.Enabled := Node <> nil; +// miControlsUncheckStandardControls.Visible := ActiveTreeView = tvHiddenControls; +// miControlsUncheckStandardControls.Enabled := Node <> nil; + + Node := ActiveTreeView.Selected; + miControlsCheckAllChildren.Enabled := (Node <> nil) and (Node.Count <> 0) and + TreeView_HasUncheckedChildren(Node); + miControlsUncheckAllChildren.Enabled := (Node <> nil) and (Node.Count <> 0) and + TreeView_HasCheckedChildren(Node); +end; + +procedure TdxfmCustomContainerDesignWindow.lbxAggregatedLinksClick(Sender: TObject); +begin + UpdateControlsState; +end; + +procedure TdxfmCustomContainerDesignWindow.TreeViewChange(Sender: TObject; + Node: TTreeNode); +begin + //UpdateControlsState; +end; + +procedure TdxfmCustomContainerDesignWindow.PageControl1Change(Sender: TObject); +begin + UpdateControlsState; + FAreHiddenControlsChanged := False; + FLastActiveTab := PageControl1.ActivePage; +end; + +procedure TdxfmCustomContainerDesignWindow.PageControl1Changing(Sender: TObject; + var AllowChange: Boolean); +begin + if FAreHiddenControlsChanged and (FLastActiveTab = HiddenControlsTab) then + RefreshControlsTree; +end; + +procedure TdxfmCustomContainerDesignWindow.TransparentClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsTransparentByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmCustomContainerDesignWindow.PaginationClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsPaginationByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmCustomContainerDesignWindow.SizeClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsSizeByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmCustomContainerDesignWindow.sbtnAddClick(Sender: TObject); +begin + DoAggregateSelectedLinks; +end; + +procedure TdxfmCustomContainerDesignWindow.sbtnRemoveClick(Sender: TObject); +begin + DoDisaggregateSelectedLinks; +end; + +procedure TdxfmCustomContainerDesignWindow.tshReportLinksResize(Sender: TObject); +const + TopMargin = 22; +var + W, H: Integer; +begin + if ReportLink.IsDesigning then + begin + W := (pnlLinkListsSite.ClientWidth - pnlMoveButtonsSite.Width) div 2; + pnlAvailableLinksSite.Width := W; + pnlAggregatedLinksSite.Width := W; + + H := TopMargin + (sbtnAdd.Parent.ClientHeight - TopMargin) div 2; + sbtnAdd.Top := H - sbtnAdd.Height - 3; + sbtnRemove.Top := H + 3; + end; +end; + +procedure TdxfmCustomContainerDesignWindow.lbxAvailableLinksKeyDown( + Sender: TObject; var Key: Word; Shift: TShiftState); +begin + if (Key = Ord('A')) and (ssCtrl in Shift) then + DoSelectAll(TListBox(Sender)); +end; + +procedure TdxfmCustomContainerDesignWindow.lbxAggregatedLinksKeyDown( + Sender: TObject; var Key: Word; Shift: TShiftState); +begin + if (Key = Ord('A')) and (ssCtrl in Shift) then + DoSelectAll(TListBox(Sender)); +end; + +procedure TdxfmCustomContainerDesignWindow.lbxAvailableLinksDragOver( + Sender, Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); +begin + Accept := (Source = lbxAggregatedLinks) and (lbxAggregatedLinks.SelCount <> 0); +end; + +procedure TdxfmCustomContainerDesignWindow.lbxAvailableLinksDragDrop( + Sender, Source: TObject; X, Y: Integer); +begin + DoDisaggregateSelectedLinks; +end; + +procedure TdxfmCustomContainerDesignWindow.lbxAggregatedLinksDragOver( + Sender, Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); +begin + Accept := (Source = lbxAvailableLinks) and (lbxAvailableLinks.SelCount <> 0); +end; + +procedure TdxfmCustomContainerDesignWindow.lbxAggregatedLinksDragDrop( + Sender, Source: TObject; X, Y: Integer); +begin + DoAggregateSelectedLinks; +end; + +procedure TdxfmCustomContainerDesignWindow.lbxAggregatedLinksDblClick(Sender: TObject); +begin + if CanDisaggregate then + DoDisaggregateSelectedLinks + else + if CanDesign then btnLinksDesign.Click; +end; + +procedure TdxfmCustomContainerDesignWindow.lbxAvailableLinksDblClick(Sender: TObject); +begin + if CanAggregate then DoAggregateSelectedLinks; +end; + +procedure TdxfmCustomContainerDesignWindow.btnLinksRemoveInconsistentsClick( + Sender: TObject); +begin + if CanRemoveInconsistents then + begin + ReportLink.DisaggregateInconsistentLinks; + RefreshReportLinksList; + end; +end; + +procedure TdxfmCustomContainerDesignWindow.lbxAggregatedLinksDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +var + R: TRect; + Link: TBasedxReportLink; + S: string; + X, Y: Integer; +begin + R := Rect; + with TCustomListBox(Control) do + begin + Link := TBasedxReportLink(Items.Objects[Index]); + + Canvas.FillRect(R); + + S := Link.ReportDocument.Caption; + with R do + begin + X := Left + 1; + Y := Top + (Bottom - Top - Canvas.TextHeight(S)) div 2; + end; + if (Control = lbxAggregatedLinks) and not ReportLink.IsLinkAggregatedConsistently(Link) and not (odSelected in State) then + Canvas.Font.Color := clGrayText; + Canvas.TextRect(R, X, Y, S); + + if IsDesigning and (Link.Component <> nil) then + begin + Inc(R.Left, 1 + 1 + Canvas.TextWidth(S) + 1); + X := R.Left + 2; + S := '[' + Link.Component.Name + ']'; + if ((Control = lbxAvailableLinks) or ReportLink.IsLinkAggregatedConsistently(Link)) and not (odSelected in State) then + Canvas.Font.Color := clBlue; + Canvas.TextRect(R, X, Y, S); + end; + + //if odFocused in State then Canvas.DrawFocusRect(Rect); + end; +end; + +procedure RegisterAssistants; +begin + TdxPSContainerBuilder.Register; + + TdxPSNativePrintableControlProducer.Register; + + TdxPSControlAsMetafileProducer.Register; + TdxPSWinControlAsMetafileProducer.Register; + + TdxPSCustomContainerItemProducer.Register; + TdxPSContainerControlProducer.Register; + TdxPSBevelProducer.Register; + TdxPSPaintBoxProducer.Register; + TdxPSShapeProducer.Register; + TdxPSCustomLabelProducer.Register; + TdxPSContainerCustomWinControlProducer.Register; + TdxPSContainerWinControlProducer.Register; + TdxPSDateTimePickerProducer.Register; + TdxPSCustomHotKeyProducer.Register; + TdxPSCustomStaticTextProducer.Register; + TdxPSCustomEditProducer.Register; + TdxPSCustomMemoProducer.Register; + TdxPSCustomComboBoxProducer.Register; + TdxPSCustomCheckBoxProducer.Register; + TdxPSRadioButtonProducer.Register; + + //TdxPSCustomContainerProducer.Register; + TdxPSCustomPanelProducer.Register; + TdxPSCustomGroupBoxProducer.Register; + TdxPSCustomRadioGroupProducer.Register; + + TdxPSTabControlProducer.Register; + TdxPSTabSheetProducer.Register; + TdxPSPageControlProducer.Register; + TdxPSNotebookPageProducer.Register; + TdxPSNotebookProducer.Register; + TdxPSTabbedNotebookPageProducer.Register; + TdxPSTabbedNotebookProducer.Register; + TdxPSScrollingWinControlProducer.Register; + TdxPSCustomFormProducer.Register; + {$IFDEF DELPHI5} + TdxPSCustomFrameProducer.Register; + {$ENDIF} + {$IFDEF DELPHI6} + TdxPSCustomComboBoxExProducer.Register; + {$ENDIF} +end; + +procedure RegisterItems; +begin + TdxReportWinControlHost.Register; + TdxReportNativePrintableControlHost.Register; +end; + +procedure UnregisterAssistants; +begin + TdxPSNativePrintableControlProducerFactory.ReleaseInstance; + TdxPSContainerItemProducerFactory.ReleaseInstance; + TdxPSContainerBuilderFactory.ReleaseInstance; +end; + +procedure UnregisterItems; +begin + TdxReportNativePrintableControlHost.Unregister; + TdxReportWinControlHost.Unregister; +end; + +initialization + RegisterAssistants; + RegisterItems; + + dxPSRegisterContainers(StandardContainers); + +finalization + dxPSUnregisterContainers(StandardContainers); + + UnregisterItems; + UnregisterAssistants; + + FreeAndNil(FInternalComponentPrinter); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSCore.pas b/official/x.35/ExpressPrinting System/Sources/dxPSCore.pas new file mode 100644 index 00000000..d8e4c159 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSCore.pas @@ -0,0 +1,25958 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSCore; + +interface + +{$I cxVer.inc} + +{$IFNDEF DELPHI6} +{$IFNDEF BCB} +{$L+} // to avoid internal error in Delphi5 +{$ENDIF} +{$ENDIF} + +(*$HPPEMIT '#include *) +{$IFDEF CBUILDER5} + (*$HPPEMIT '#define HRGN unsigned'*) +{$ELSE} + (*$HPPEMIT '#define HRGN int'*) +{$ENDIF} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, StdCtrls, ExtCtrls, + ActiveX, Menus, Forms, ImgList, {$IFDEF DELPHI5} Contnrs, {$ENDIF} cxClasses, + dxBase, dxPSGlbl, dxPSSngltn, dxPSEngn, dxPSESys, dxPSForm, dxBkgnd, dxPrnPg, + dxPgsDlg, dxPrnDlg, dxWrap, dxPSTextOut, dxPSFillPatterns; + +type + EdxPrintEngine = class(Exception); + EdxReportLink = class(EdxPrintEngine); + EdxPSExplorer = class(EdxPrintEngine); + EdxComponentPrinter = class(EdxPrintEngine); + + EdxInvalidStorageVersion = class(EdxComponentPrinter) + private + FVersion: UINT; + public + constructor Create(AVersion: UINT); + property Version: UINT read FVersion write FVersion; + end; + + TCustomdxPSExplorerContextCommand = class; + + IdxPSExplorerContextCommandBuilder = interface + ['{EE36E842-FD6A-4A89-A343-A32828AEFE3D}'] + procedure AddExplorerContextCommand(ACommand: TCustomdxPSExplorerContextCommand); + procedure UpdateExplorerContextCommands; + end; + + IdxPSExplorerContextCommands = interface + ['{DC3A582D-7E33-410F-A235-680A846824D3}'] + procedure BuildCommandSet(ABuilder: IdxPSExplorerContextCommandBuilder); + end; + + IdxPSExplorerContextCommands2 = interface + ['{E4D68CF3-AD07-4220-B892-92C8F9B3F966}'] + procedure FinalizeCommand(ACommand: TCustomdxPSExplorerContextCommand); + procedure InitializeCommand(ACommand: TCustomdxPSExplorerContextCommand); + end; + + IdxReportLinkController = interface + ['{120F53E4-1B09-46EF-B42D-04AB8BBCC374}'] + function GetControlSiteBounds(AControl: TControl): TRect; + end; + + TdxPSReportDocument = class; + TdxPSReportRenderer = class; + TdxReportLinkClass = class of TBasedxReportLink; + TBasedxReportLink = class; + TdxCompositionReportLink = class; + TCustomdxComponentPrinter = class; + TCustomdxPSExplorerTreeContainer = class; + TAbstractdxReportLinkDesigner = class; + TAbstractdxPreviewWindowDesigner = class; + TAbstractdxReportLinkDesignWindow = class; + TdxReportLinkDesignWindowClass = class of TAbstractdxReportLinkDesignWindow; + TBasedxPreviewWindow = class; + + TdxReportVisualItemClass = class of TdxReportVisualItem; + TdxReportVisualItem = class; + TdxReportCellDataClass = class of TAbstractdxReportCellData; + TAbstractdxReportCellData = class; + TdxReportCellClass = class of TdxReportCell; + TdxReportCell = class; + TdxReportCellsClass = class of TdxReportCells; + TdxReportCells = class; + + TdxPSCellBorderClass = class of TdxPSCustomCellBorder; + TdxPSCustomCellBorder = class; + TdxPSCellBorderPainterClass = class of TdxPSCellBorderPainter; + TdxPSCellBorderPainter = class; + + TdxPSReportGroupLookAndFeelClass = class of TdxPSReportGroupLookAndFeel; + TdxPSReportGroupLookAndFeel = class; + TdxPSReportGroupLookAndFeelPainterClass = class of TdxPSReportGroupLookAndFeelPainter; + TdxPSReportGroupLookAndFeelPainter = class; + + + { Data Reader\Writer } + + TdxPSDataReaderClass = class of TdxPSDataReader; + + TdxPSDataReader = class(TReader) + protected + class function SupportsStorageVersion(AVersion: Integer): Boolean; virtual; + public + class procedure Register; virtual; + class procedure Unregister; virtual; + + function ReadCellBorderClass: TdxPSCellBorderClass; + function ReadClass: TClass; + function ReadFillPatternClass: TdxPSFillPatternClass; + function ReadFont(AFont: TFont): TFont; + function ReadGraphicClass: TGraphicClass; + procedure ReadImage(AnImage: TGraphic); + procedure ReadImageList(AnImageList: TCustomImageList); + function ReadLinkClass: TdxReportLinkClass; + function ReadLookAndFeelClass: TdxPSReportGroupLookAndFeelClass; + function ReadPoint: TPoint; + function ReadPSVersion: TdxPSVersion; + function ReadRect: TRect; + procedure SkipBytes(Count: {$IFDEF DELPHI6} Int64 {$ELSE} Integer {$ENDIF}); + end; + + TdxPSDataWriterClass = class of TdxPSDataWriter; + + TdxPSDataWriter = class(TWriter) + protected + class function SupportsStorageVersion(AVersion: Integer): Boolean; virtual; + public + class procedure Register; virtual; + class procedure Unregister; virtual; + + procedure WriteClassName(AClass: TClass); overload; + procedure WriteClassName(AnObject: TObject); overload; + procedure WriteFont(AFont: TFont); + procedure WriteImage(AnImage: TGraphic); + procedure WriteImageList(AnImageList: TCustomImageList); + procedure WritePoint(const Pt: TPoint); + procedure WritePSVersion(const AVersion: TdxPSVersion); + procedure WriteRect(const R: TRect); + end; + + { Report Renderers } + + TdxWindowScalePair = record + Numerator: Integer; + Denominator: Integer; + end; + + TdxContinuedIndexPair = class + public + StartIndex: Integer; + EndIndex: Integer; + end; + + TdxPageOverlayIndexes = class(TList) + private + function GetItem(Index: Integer): Integer; + procedure SetItem(Index, Value: Integer); + public + function Add(AValue: Integer): Integer; + property Items[Index: Integer]: Integer read GetItem write SetItem; default; + end; + + TdxPSReportRenderInfo = class; + + TdxPSPageRenderInfoClass = class of TdxPSPageRenderInfo; + + TdxPSPageRenderInfo = class + private + FIndexPairs: TList; + FIsEmptyPage: Boolean; + FIsEmptyPageCalculated: Boolean; + FOverlays: TList; + FPageIndex: Integer; + FRenderInfo: TdxPSReportRenderInfo; + function GetColIndex: Integer; + function GetFooterBounds: TRect; + function GetHeaderBounds: TRect; + function GetIndexPair(Index: Integer): TdxContinuedIndexPair; + function GetIndexPairCount: Integer; + function GetIsBottomPage: Boolean; + function GetIsEmptyPage: Boolean; + function GetIsTopPage: Boolean; + function GetOverlay(Index: Integer): TdxPageOverlayIndexes; + function GetOverlayCount: Integer; + function GetPrinterPage: TdxPrinterPage; + function GetReportCells: TdxReportCells; + function GetReportLink: TBasedxReportLink; + function GetRowIndex: Integer; + function GetTitleBounds: TRect; + function GetTitleHeight: Integer; + procedure SetIndexPair(Index: Integer; Value: TdxContinuedIndexPair); + + procedure FreeAndNilIndexPairs; + procedure FreeAndNilOverlays; + protected + function AreRectsIntersected(const R1, R2: TRect): Boolean; + + procedure CalculateBounds; virtual; + function CalculateIndexPairCount: Integer; virtual; + procedure CalculateIndexPairs; virtual; + function CalculateIsEmptyPage: Boolean; virtual; + procedure CalculateOffsets; + procedure CalculateOverlayIndexes; + + property IsEmptyPageCalculated: Boolean read FIsEmptyPageCalculated write FIsEmptyPageCalculated; + public + ContentBounds: TRect; + DataOffset: TPoint; + DetailBounds: TRect; + TitleOffset: TPoint; + constructor Create(ARenderInfo: TdxPSReportRenderInfo; APageIndex: Integer); virtual; + destructor Destroy; override; + procedure Calculate; virtual; + + function HasDetails: Boolean; virtual; + function HasFooter: Boolean; virtual; + function HasHeader: Boolean; virtual; + function HasTitle: Boolean; virtual; + + property ColIndex: Integer read GetColIndex; + property FooterBounds: TRect read GetFooterBounds; + property HeaderBounds: TRect read GetHeaderBounds; + property IndexPairCount: Integer read GetIndexPairCount; + property IndexPairs[Index: Integer]: TdxContinuedIndexPair read GetIndexPair write SetIndexPair; + property IsBottomPage: Boolean read GetIsBottomPage; + property IsEmptyPage: Boolean read GetIsEmptyPage; + property IsTopPage: Boolean read GetIsTopPage; + property OverlayCount: Integer read GetOverlayCount; + property Overlays[Index: Integer]: TdxPageOverlayIndexes read GetOverlay; + property PageIndex: Integer read FPageIndex; + property PrinterPage: TdxPrinterPage read GetPrinterPage; + property RenderInfo: TdxPSReportRenderInfo read FRenderInfo; + property ReportCells: TdxReportCells read GetReportCells; + property ReportLink: TBasedxReportLink read GetReportLink; + property RowIndex: Integer read GetRowIndex; + property TitleBounds: TRect read GetTitleBounds; + property TitleHeight: Integer read GetTitleHeight; + end; + + TdxPSReportRenderInfoClass = class of TdxPSReportRenderInfo; + + TdxPSReportRenderInfo = class + private + FBaseContentFont: TFont; + FDelimitersX: TList; + FDelimitersY: TList; + FEmptyPageCount: Integer; + FGridLinesColor: TColor; + FHardDelimitersY: TList; + //FIsTitleHeightCalculated: Boolean; + FLockCounter: Integer; + FPageDelimitersX: TList; + FPageDelimitersY: TList; + FPageRenderInfos: TList; + FReportLink: TBasedxReportLink; + //FTitleHeight: Integer; + function GetBreakPagesByHardDelimiters: Boolean; + function GetDelimiterX(Index: Integer): Integer; + function GetDelimiterXCount: Integer; + function GetDelimiterY(Index: Integer): Integer; + function GetDelimiterYCount: Integer; + function GetEmptyPageCount: Integer; + function GetFooterHeight: Integer; + function GetHeaderHeight: Integer; + function GetLocked: Boolean; + function GetPageDelimiterX(Index: Integer): Integer; + function GetPageDelimiterXCount: Integer; + function GetPageDelimiterY(Index: Integer): Integer; + function GetPageDelimiterYCount: Integer; + function GetPageRenderInfo(Index: Integer): TdxPSPageRenderInfo; + function GetPageRenderInfoCount: Integer; + function GetPrinterPage: TdxPrinterPage; + function GetReportCells: TdxReportCells; + function GetReportHeight: Integer; + function GetReportWidth: Integer; + function GetScaleFactor: Integer; + function GetTitleAdjustOnReportScale: Boolean; + function GetTitleFont: TFont; + function GetTitleText: string; + function GetUseHardVertDelimiters: Boolean; + function GetUseHorzDelimiters: Boolean; + function GetUseVertDelimiters: Boolean; + function GetTitleHeight: Integer; + procedure SetBaseContentFont(Value: TFont); + + function IsNonEmptyPage(const ABounds: TRect): Boolean; + protected + function CalculateEmptyPageCount: Integer; virtual; + procedure CalculateHeaderAndFooterBounds; virtual; + function CalculatePageContentHeight(APageIndex: Integer): Integer; virtual; + function CalculatePageContentWidth(APageIndex: Integer): Integer; virtual; + procedure CalculatePageCount; virtual; + procedure CalculatePageDelimiters; virtual; + function CalculatePageDetailBounds(APageCol, APageRow: Integer): TRect; virtual; + procedure CalculatePageHeaderAndFooterBounds; virtual; + procedure CalculatePageRenderInfos; virtual; + procedure CalculatePageRealAndVirtualIndexes(APageIndex: Integer; out AVirtualPageIndex, ARealPageIndex: Integer); virtual; + //function CalculateTitleHeight: Integer; virtual; + procedure CalculateTitleBounds; virtual; + procedure DoCalculate; virtual; + + function GetNonEmptyPageCount: Integer; virtual; + function GetPageColCount: Integer; virtual; + function GetPageRowCount: Integer; virtual; + function GetPageSize: TPoint; virtual; + function GetPaintSize: TPoint; virtual; + function GetUnitsPerInch: Integer; virtual; + function GetWindowScalePair: TdxWindowScalePair; virtual; + procedure SetUnitsPerInch(Value: Integer); virtual; + + procedure ClearPageRenderInfos; + function CreatePageRenderInfo(APageIndex: Integer): TdxPSPageRenderInfo; virtual; + procedure FreeAndNilPageRenderInfos; + function GetPageRenderInfoClass: TdxPSPageRenderInfoClass; virtual; + procedure Refresh; virtual; + + function HasPageTitle(APageIndex: Integer): Boolean; + function IsHardDelimiter(AValue: Integer): Boolean; + + procedure ReadData(AReader: TdxPSDataReader); virtual; + procedure ReadDelimiters(AReader: TdxPSDataReader); + procedure WriteData(AWriter: TdxPSDataWriter); virtual; + procedure WriteDelimiters(AWriter: TdxPSDataWriter); + + procedure AddPageDelimiterX(AValue: Integer); + procedure AddPageDelimiterY(AValue: Integer); + procedure PageDelimiterXClear; + procedure PageDelimiterYClear; + + procedure AddStandardDelimiters; + procedure EliminateDuplicatesAndSortDelimiters(AList: TList); + procedure GetDelimiters; + procedure MakeDelimiters; + procedure MakeHardDelimiters; + procedure TrancateDelimiters(AList: TList; AValue: Integer); + + function LoMetricRectToInternalUnits(const R: TRect): TRect; + function LoMetricValueToInternalUnits(Value: Integer): Integer; virtual; + function RealPageIndexToVirtualPageIndex(APageIndex: Integer; ATakeIntoAccountEmptyPages: Boolean): Integer; virtual; + function VirtualPageIndexToRealPageIndex(APageIndex: Integer): Integer; virtual; + + property DelimiterXList: TList read FDelimitersX; + property DelimiterYList: TList read FDelimitersY; + property HardDelimiterYList: TList read FHardDelimitersY; + public + CanUseHFOnEveryPageMode: Boolean; + FooterBounds: TRect; + HeaderBounds: TRect; + PageFooterBounds: TRect; + PageHeaderBounds: TRect; + TitleBounds: TRect; + VirtualPageCount: Integer; + + constructor Create(AReportLink: TBasedxReportLink); virtual; + destructor Destroy; override; + + procedure Calculate; + function CalculateTitleHeight: Integer; virtual; + function CanRenderPage(AVirtualPageIndex: Integer): Boolean; virtual; + function IsDrawPageFootNoteOnPage(APageIndex: Integer): Boolean; virtual; + function IsDrawPageTitleOnPage(APageIndex: Integer): Boolean; virtual; + + procedure Lock; + procedure Unlock; + + property BaseContentFont: TFont read FBaseContentFont write SetBaseContentFont; + property BreakPagesByHardDelimiters: Boolean read GetBreakPagesByHardDelimiters; + property DelimitersX[Index: Integer]: Integer read GetDelimiterX; + property DelimiterXCount: Integer read GetDelimiterXCount; + property DelimitersY[Index: Integer]: Integer read GetDelimiterY; + property DelimiterYCount: Integer read GetDelimiterYCount; + property EmptyPageCount: Integer read GetEmptyPageCount; + property FooterHeight: Integer read GetFooterHeight; + property GridLinesColor: TColor read FGridLinesColor write FGridLinesColor; + property HeaderHeight: Integer read GetHeaderHeight; + property Locked: Boolean read GetLocked; + property NonEmptyPageCount: Integer read GetNonEmptyPageCount; + property PageColCount: Integer read GetPageColCount; + property PageDelimitersX[Index: Integer]: Integer read GetPageDelimiterX; + property PageDelimiterXCount: Integer read GetPageDelimiterXCount; + property PageDelimitersY[Index: Integer]: Integer read GetPageDelimiterY; + property PageDelimiterYCount: Integer read GetPageDelimiterYCount; + property PageRenderInfoCount: Integer read GetPageRenderInfoCount; + property PageRenderInfos[Index: Integer]: TdxPSPageRenderInfo read GetPageRenderInfo; + property PageRowCount: Integer read GetPageRowCount; + property PageSize: TPoint read GetPageSize; + property PaintSize: TPoint read GetPaintSize; + property PrinterPage: TdxPrinterPage read GetPrinterPage; + property ReportCells: TdxReportCells read GetReportCells; + property ReportHeight: Integer read GetReportHeight; + property ReportLink: TBasedxReportLink read FReportLink; + property ReportWidth: Integer read GetReportWidth; + property ScaleFactor: Integer read GetScaleFactor; + property TitleAdjustOnReportScale: Boolean read GetTitleAdjustOnReportScale; + property TitleFont: TFont read GetTitleFont; + property TitleHeight: Integer read GetTitleHeight; + property TitleText: string read GetTitleText; + property UnitsPerInch: Integer read GetUnitsPerInch write SetUnitsPerInch; + property UseHardVertDelimiters: Boolean read GetUseHardVertDelimiters; + property UseHorzDelimiters: Boolean read GetUseHorzDelimiters; + property UseVertDelimiters: Boolean read GetUseVertDelimiters; + property WindowScalePair: TdxWindowScalePair read GetWindowScalePair; + end; + + TdxCellCheckPos = (ccpLeft, ccpCenter, ccpRight); + TdxCellEdgeKind = (cekInner, cekOuter); + TdxCellEdgeMode = (cemPattern, cem3DEffects); + TdxCellEdgeStyle = (cesRaised, cesSunken); + TdxCellSide = (csLeft, csTop, csRight, csBottom); + TdxCellSides = set of TdxCellSide; + TdxCellSortOrder = (csoNone, csoUp, csoDown); + TdxCellUpDown = csoUp..csoDown; + TdxCheckButtonEdgeStyle = (cbesNone, cbes3D, cbesSoft3D, cbesBoldFlat, cbesUltraFlat, cbesSingle); + TdxGraphicDrawMode = (gdmNone, gdmCenter, gdmStretch, gdmStretchProportional, gdmCenterAndStretchProportional); + TdxImageLayout = (ilImageTopLeft, ilImageTopCenter, ilImageTopRight, ilImageCenterLeft, + ilImageCenterCenter, ilImageCenterRight, ilImageBottomLeft, ilImageBottomCenter, ilImageBottomRight); + + TdxCellImageBuffering = (cibDefault, cibNone, cibAlways); +{$IFDEF BCB} + TdxCellImageActualBuffering = TdxCellImageBuffering; +{$ELSE} + TdxCellImageActualBuffering = cibNone..cibAlways; +{$ENDIF} + + TdxPSCellBorderSalientType = (bstOuter, bstInner); + + TdxPSTreeLineMode = (tlmNone, tlmVertical, tlmCross, tlmTopRightCorner, tlmBottomRightCorner); + TdxPSTreeLinePart = (tlpTop, tlpRight, tlpBottom); + TdxPSTreeLineParts = set of TdxPSTreeLinePart; + TdxPSTreeLineStyle = (tlsSolid, tlsDot); + + TdxPSCellBorderPainter = class + private + FItem: TdxReportVisualItem; + FRenderer: TdxPSReportRenderer; + function GetLineThickness: Integer; + protected + class function GetBorderBounds(const R: TRect; ASide: TdxCellSide; ALineThickness: Integer): TRect; virtual; + class function GetBottomShadowBounds(const R: TRect; AShadowDepth: Integer): TRect; + class function GetBottomShadowRestSpaceBounds(const R: TRect; AShadowDepth: Integer): TRect; + class function GetRightShadowBounds(const R: TRect; AShadowDepth: Integer): TRect; + class function GetRightShadowRestSpaceBounds(const R: TRect; AShadowDepth: Integer): TRect; + class procedure InflateRect(var R: TRect; ASides: TdxCellSides; ALineThickness: Integer); + public + constructor Create(ARenderer: TdxPSReportRenderer); virtual; + + class procedure DrawFrame(DC: HDC; R: TRect; ASides: TdxCellSides; + ATLBrush, ABRBrush: HBRUSH; ALineThickness: Integer; AThickness: Integer = 1); + class procedure DrawShadow(DC: HDC; const R: TRect; AShadowDepth: Integer; + AShadowBrush, ARestSpaceBrush: HBRUSH); + procedure Paint(DC: HDC); virtual; + + function BorderClass: TdxPSCellBorderClass; overload; virtual; + function Item: TdxReportVisualItem; overload; virtual; + function Renderer: TdxPSReportRenderer; overload; virtual; + + property LineThickness: Integer read GetLineThickness; + end; + + TdxPSCustomCellBorder = class(TPersistent) + protected + class function Edge3DSoft: Boolean; virtual; + class function Edge3DStyle: TdxCellEdgeStyle; virtual; + class function EdgeMode: TdxCellEdgeMode; virtual; + + class function GetBorderEdgeSalient(ASide: TdxCellSide; ASalient: TdxPSCellBorderSalientType): Integer; virtual; + class function GetPainterClass: TdxPSCellBorderPainterClass; virtual; + public + class procedure Register; virtual; + class procedure Unregister; virtual; + + class function Solid: Boolean; virtual; + class function Thickness: Integer; virtual; + end; + + TdxPSCellNullBorderPainter = class(TdxPSCellBorderPainter) + public + procedure Paint(DC: HDC); override; + end; + + TdxPSCellNullBorder = class(TdxPSCustomCellBorder) + protected + class function GetPainterClass: TdxPSCellBorderPainterClass; override; + public + class function Thickness: Integer; override; + end; + + TdxPSCellFlatBorder = class(TdxPSCustomCellBorder) + protected + class function GetPainterClass: TdxPSCellBorderPainterClass; override; + end; + + TdxPSCellBoldFlatBorder = class(TdxPSCellFlatBorder) + public + class function Thickness: Integer; override; + end; + + TdxPSCellUltraFlatBorder = class(TdxPSCellFlatBorder) + public + class function Thickness: Integer; override; + end; + + TdxPSCell3DBorderClass = class of TdxPSCustomCell3DBorder; + + TdxPSCell3DBorderPainter = class(TdxPSCellBorderPainter) + public + class procedure Draw3DFrame(DC: HDC; R: TRect; ASides: TdxCellSides; + AOuterTLBrush, AOuterBRBrush, AInnerTLBrush, AInnerBRBrush: HBRUSH; + ALineThickness: Integer); overload; virtual; + class procedure Draw3DFrame(DC: HDC; R: TRect; ASides: TdxCellSides; + ACellBorders: TdxPSCell3DBorderClass; ALineThickness: Integer); overload; virtual; + procedure Paint(DC: HDC); override; + + function BorderClass: TdxPSCell3DBorderClass; reintroduce; overload; + end; + + TdxPSCustomCell3DBorder = class(TdxPSCustomCellBorder) + protected + class function EdgeMode: TdxCellEdgeMode; override; + + class function GetBorderEdgeSalient(ASide: TdxCellSide; ASalient: TdxPSCellBorderSalientType): Integer; override; + class function GetPainterClass: TdxPSCellBorderPainterClass; override; + public + class function Solid: Boolean; override; + class function Thickness: Integer; override; + + class function BottomRightInnerBrush: HBRUSH; virtual; + class function BottomRightInnerColor: TColor; virtual; + class function BottomRightOuterBrush: HBRUSH; virtual; + class function BottomRightOuterColor: TColor; virtual; + class function TopLeftInnerBrush: HBRUSH; virtual; + class function TopLeftInnerColor: TColor; virtual; + class function TopLeftOuterBrush: HBRUSH; virtual; + class function TopLeftOuterColor: TColor; virtual; + end; + + TdxPSCellRaisedBorder = class(TdxPSCustomCell3DBorder) + protected + class function Edge3DSoft: Boolean; override; + class function Edge3DStyle: TdxCellEdgeStyle; override; + public + class function BottomRightInnerBrush: HBRUSH; override; + class function BottomRightInnerColor: TColor; override; + class function BottomRightOuterBrush: HBRUSH; override; + class function BottomRightOuterColor: TColor; override; + class function TopLeftInnerBrush: HBRUSH; override; + class function TopLeftInnerColor: TColor; override; + class function TopLeftOuterBrush: HBRUSH; override; + class function TopLeftOuterColor: TColor; override; + end; + + TdxPSCellRaisedSoftBorder = class(TdxPSCellRaisedBorder) + protected + class function Edge3DSoft: Boolean; override; + public + class function BottomRightInnerBrush: HBRUSH; override; + class function BottomRightInnerColor: TColor; override; + end; + + TdxPSCellSunkenBorder = class(TdxPSCustomCell3DBorder) + protected + class function Edge3DSoft: Boolean; override; + class function Edge3DStyle: TdxCellEdgeStyle; override; + public + class function BottomRightInnerBrush: HBRUSH; override; + class function BottomRightInnerColor: TColor; override; + class function BottomRightOuterBrush: HBRUSH; override; + class function BottomRightOuterColor: TColor; override; + class function TopLeftInnerBrush: HBRUSH; override; + class function TopLeftInnerColor: TColor; override; + class function TopLeftOuterBrush: HBRUSH; override; + class function TopLeftOuterColor: TColor; override; + end; + + TdxPSCellSunkenSoftBorder = class(TdxPSCellSunkenBorder) + protected + class function Edge3DSoft: Boolean; override; + public + class function BottomRightInnerBrush: HBRUSH; override; + class function BottomRightInnerColor: TColor; override; + class function TopLeftInnerBrush: HBRUSH; override; + class function TopLeftInnerColor: TColor; override; + end; + + TdxPSCellTwistedBorderPainter = class(TdxPSCell3DBorderPainter) + public + {$IFDEF BCB} + class procedure Draw3DFrame(DC: HDC; R: TRect; ASides: TdxCellSides; + ACellBorders: TdxPSCell3DBorderClass; ALineThickness: Integer); override; + {$ENDIF} + class procedure Draw3DFrame(DC: HDC; R: TRect; ASides: TdxCellSides; + AOuterTLBrush, AOuterBRBrush, AInnerTLBrush, AInnerBRBrush: HBRUSH; ALineThickness: Integer); override; + end; + + TdxPSCellTwistedBorder = class(TdxPSCustomCell3DBorder) + protected + class function GetPainterClass: TdxPSCellBorderPainterClass; override; + end; + + TdxPSCellEtchedBorder = class(TdxPSCellTwistedBorder) + public + class function BottomRightInnerBrush: HBRUSH; override; + class function BottomRightInnerColor: TColor; override; + class function BottomRightOuterBrush: HBRUSH; override; + class function BottomRightOuterColor: TColor; override; + class function TopLeftInnerBrush: HBRUSH; override; + class function TopLeftInnerColor: TColor; override; + class function TopLeftOuterBrush: HBRUSH; override; + class function TopLeftOuterColor: TColor; override; + end; + + TdxPSCellBumpedBorder = class(TdxPSCellTwistedBorder) + public + class function BottomRightInnerBrush: HBRUSH; override; + class function BottomRightInnerColor: TColor; override; + class function BottomRightOuterBrush: HBRUSH; override; + class function BottomRightOuterColor: TColor; override; + class function TopLeftInnerBrush: HBRUSH; override; + class function TopLeftInnerColor: TColor; override; + class function TopLeftOuterBrush: HBRUSH; override; + class function TopLeftOuterColor: TColor; override; + end; + + TdxPSColorBorderPainter = class(TdxPSCellBorderPainter) + protected + function GetSideColor(ASide: TdxCellSide): TColor; virtual; + public + procedure Paint(DC: HDC); override; + property SideColor[ASide: TdxCellSide]: TColor read GetSideColor; + end; + + TdxPSColorBorder = class(TdxPSCellUltraFlatBorder{TdxPSCustomCellBorder}) + protected + class function GetPainterClass: TdxPSCellBorderPainterClass; override; + end; + + TdxPSBackgroundBitmapPool = class + private + FItems: TList; + function GetCount: Integer; + function GetItem(Index: Integer): TBitmap; + protected + procedure ReadData(AReader: TdxPSDataReader); + procedure WriteData(AWriter: TdxPSDataWriter); + public + constructor Create; + destructor Destroy; override; + procedure Assign(Source: TdxPSBackgroundBitmapPool); + + function Add(ABitmap: TBitmap): Integer; + procedure Clear; + procedure Delete(AnIndex: Integer); + function Find(ABitmap: TBitmap; out AnIndex: Integer): Boolean; + + property Count: Integer read GetCount; + property Items[Index: Integer]: TBitmap read GetItem; default; + end; + + TdxPSBrushPoolItem = class + private + FBrush: HBRUSH; + FColor: TColor; + function GetBrush: HBRUSH; + public + constructor Create(AColor: TColor); + destructor Destroy; override; + + property Brush: HBRUSH read GetBrush; + property Color: TColor read FColor; + end; + + TdxPSReportBrushPool = class + private + FItems: TList; + function GetBrush(AColor: TColor): HBRUSH; + function GetCount: Integer; + function GetItem(Index: Integer): TdxPSBrushPoolItem; + protected + function Add(AColor: TColor): Integer; + public + constructor Create; + destructor Destroy; override; + + procedure Clear; + function IndexOf(AColor: TColor): Integer; + + property Brushes[AColor: TColor]: HBRUSH read GetBrush; default; + property Count: Integer read GetCount; + property Items[Index: Integer]: TdxPSBrushPoolItem read GetItem; + end; + + TdxPSReportRendererClass = class of TdxPSReportRenderer; + + TdxPSFontPoolItem = class + private + FFont: TFont; + FOriginalSize: Integer; + procedure SetFont(Value: TFont); + public + constructor Create(AFont: TFont); + destructor Destroy; override; + + property Font: TFont read FFont write SetFont; + property OriginalSize: Integer read FOriginalSize write FOriginalSize; + end; + + TdxPSReportFontPool = class + private + FItems: TList; + function GetCount: Integer; + function GetFont(Index: Integer): TFont; + function GetItem(Index: Integer): TdxPSFontPoolItem; + protected + FLocked: Boolean; + function CreateFont(AFont: TFont): Integer; + procedure FontChanged(Sender: TObject); + procedure PrepareFonts(UPI: Integer); + + procedure ReadData(AReader: TdxPSDataReader); + procedure WriteData(AWriter: TdxPSDataWriter); + public + constructor Create; + destructor Destroy; override; + + function Add(AFont: TFont): Integer; + procedure Clear; + function IndexOf(AFont: TFont): Integer; + + property Count: Integer read GetCount; + property Fonts[Index: Integer]: TFont read GetFont; default; + property Items[Index: Integer]: TdxPSFontPoolItem read GetItem; + end; + + TdxPSCachedGraphicInfo = class + protected + Renderer: TdxPSReportRenderer; + SourceGraphic, PreparedGraphic: TGraphic; + UnitsPerInch: Integer; + UnitsPerPixel: Integer; + ViewPortRect: TRect; + ZoomFactor: Integer; + procedure SaveModeInfo; + public + constructor Create(ARenderer: TdxPSReportRenderer); virtual; + function Check(ASourceGraphic: TGraphic; ABitmap: TBitmap; var APreparedGraphic: TGraphic): Boolean; + procedure Clear; + end; + + TdxPSRenderStage = (rsFirstPass, rsSecondPass); + TdxPSRenderStages = set of TdxPSRenderStage; + + TdxPSReportRenderer = class + private + FBorderColor: TColor; + FBorderPainters: TList; + FBrushPool: TdxPSReportBrushPool; + FCachedGraphicInfo: TdxPSCachedGraphicInfo; + FCanvas: TCanvas; + FCheckBitmap: TBitmap; + FDC: HDC; + FDrawBitmap: TBitmap; + FDrawMask: TBitmap; + FGroupLookAndFeelPainters: TList; + FHFStrings: TStrings; + FIsRendering: Boolean; + FLineThickness: Integer; + FMarlettFont10: TFont; + FMarlettFont8: TFont; + FPPI: Integer; + FPrevMode: Integer; + FPrevWindowExt: TSize; + FPrevWindowOrg: TPoint; + FPrevViewPortExt: TSize; + FPrevViewPortOrg: TPoint; + FRenderingPageIndex: Integer; // virtual index + FRenderStage: TdxPSRenderStages; + FReportLink: TBasedxReportLink; + FSaveColor: TColor; + FSaveFont: TFont; + FSavePixelsPerInch: Integer; + FSymbolFont: TFont; + FUnitsPerPixel: Integer; + FViewPortRect: TRect; + FZoomFactor: Integer; + function GetBorderPainterItem(Index: Integer): TdxPSCellBorderPainter; + function GetBorderPainterCount: Integer; + function GetGroupLookAndFeelPainter(Index: Integer): TdxPSReportGroupLookAndFeelPainter; + function GetGroupLookAndFeelPainterCount: Integer; + function GetHalfLineThickness: Integer; + function GetIsPrinting: Boolean; + function GetPageRenderInfo: TdxPSPageRenderInfo; + function GetRenderInfo: TdxPSReportRenderInfo; + function GetReportCells: TdxReportCells; + protected + function CustomDrawReportItem(AnItem: TAbstractdxReportCellData): Boolean; + procedure Get3DBorderBrushes(AnItem: TdxReportVisualItem; var AOuterTLBrush, AOuterBRBrush, AInnerTLBrush, AInnerBRBrush: HBRUSH); + procedure Get3DBorderColors(AnItem: TdxReportVisualItem; var AOuterTLColor, AOuterBRColor, AInnerTLColor, AInnerBRColor: TColor); + + function GetUnitsPerInch: Integer; virtual; + + function CreateBorderPainter(AClass: TdxPSCellBorderPainterClass): TdxPSCellBorderPainter; + function FindBorderPainter(AClass: TdxPSCellBorderPainterClass): TdxPSCellBorderPainter; + procedure FreeAndNilBorderPainters; + + function CreateReportGroupLookAndFeelPainter(AClass: TdxPSReportGroupLookAndFeelPainterClass): TdxPSReportGroupLookAndFeelPainter; + function FindReportGroupLookAndFeelPainter(AClass: TdxPSReportGroupLookAndFeelPainterClass): TdxPSReportGroupLookAndFeelPainter; + procedure FreeAndNilReportGroupLookAndFeelPainters; + + procedure PrepareCanvasForCustomDraw(AFont: TFont; AColor: TColor); + procedure PrepareFonts; + procedure PrepareGDIObjects; virtual; + procedure PrepareLogicalCoordinates; virtual; + procedure PrepareLogicalUnits; virtual; + function PreparedPageIndex(APageIndex: Integer): Integer; + procedure PrepareRenderPage; virtual; + procedure PrepareWindow; virtual; + procedure PrepareViewPort; virtual; + procedure RenderCell(ACell: TdxReportCell; const OriginRect: TRect); + procedure RenderDelimiters; + procedure RenderEntirePage(ARealPageIndex: Integer); virtual; + procedure RenderPageContent; virtual; + procedure RenderPageContentPart(ACell: TdxReportCell;StartIndex, EndIndex: Integer; const OriginRect: TRect); + procedure RenderPageOverlay(AnOverlayIndex: Integer; AnOverlay: TdxPageOverlayIndexes; const OriginRect: TRect); virtual; + procedure RenderPageBackground(ARealPageIndex: Integer); virtual; + procedure RenderPageFooter(ARealPageIndex: Integer); virtual; + procedure RenderPageHeader(ARealPageIndex: Integer); virtual; + procedure RenderPageHeaderOrFooter(HF: TCustomdxPageObject; APageIndex: Integer; ARect: TRect); virtual; + procedure RenderPageHeaderOrFooterContent(HF: TCustomdxPageObject; APageIndex: Integer; ARect: TRect; + ATitleParts: TdxPageTitleParts; ADrawBackground: Boolean); virtual; + procedure RenderPageHeaderOrFooterContentPart(ATitlePart: TdxPageTitlePart; AStrings: TStrings; + ATextAlignY: TdxTextAlignY; ALineHeight, ADestWidth, ADestHeight: Integer; const ARect: TRect); + procedure RenderPageTitleContent(const AText: string; ARect: TRect; ATextAlignX: TdxTextAlignX; + ATextAlignY: TdxTextAlignY; AColor: TColor; AFont: TFont; ATransparent: Boolean); virtual; + procedure RenderPageTitle; virtual; + procedure RestoreMapMode; virtual; + procedure SaveMapMode; virtual; + procedure UnprepareCanvasForCustomDraw; + procedure UnprepareGDIObjects; virtual; + procedure UnprepareLogicalUnits; virtual; + procedure UnprepareRenderPage; virtual; + + property BorderPainterCount: Integer read GetBorderPainterCount; + property BorderPainters[Index: Integer]: TdxPSCellBorderPainter read GetBorderPainterItem; + property BrushPool: TdxPSReportBrushPool read FBrushPool; + property CachedGraphicInfo: TdxPSCachedGraphicInfo read FCachedGraphicInfo; + property GroupLookAndFeelPainterCount: Integer read GetGroupLookAndFeelPainterCount; + property GroupLookAndFeelPainters[Index: Integer]: TdxPSReportGroupLookAndFeelPainter read GetGroupLookAndFeelPainter; + public + constructor Create(AReportLink: TBasedxReportLink); virtual; + destructor Destroy; override; + + function CalcTextHeight(DC: HDC; const AText: string; AWordBreak: Boolean; + AFont: TFont = nil; ABaseWidth: Integer = -1): Integer; + function CalcTextLineCount(DC: HDC; const AText: string; AFont: TFont = nil; + ABaseWidth: Integer = -1): Integer; + function CalcTextPatternHeight(DC: HDC; AFont: TFont = nil): Integer; + function CalcTextRect(DC: HDC; const AText: string; var ARect: TRect; + AWordBreak: Boolean; AFont: TFont = nil): Integer; overload; + function CalcTextRect(DC: HDC; const AText: string; var ARect: TRect; + AFormat: DWORD; AFont: TFont = nil): Integer; overload; + function CalcTextWidth(DC: HDC; const AText: string; AFont: TFont = nil): Integer; + + procedure DrawCheckBox(DC: HDC; var R: TRect; AChecked, AEnabled, AIsRadio: Boolean; + AEdgeStyle: TdxCheckButtonEdgeStyle; ABorderColor: TColor = clWindowText); virtual; + procedure DrawEdge(DC: HDC; var R: TRect; AEdgeMode: TdxCellEdgeMode; + AEdge3DEdge: TdxCellEdgeStyle; ASides: TdxCellSides; ASoft: Boolean; + ABorderColor: TColor = -1); virtual; + procedure DrawEllipse(DC: HDC; R: TRect; AForeColor, ABackColor: TColor; + APattern: TdxPSFillPatternClass; ABorderColor: TColor; + ABorderThickness: Integer = 1); virtual; + procedure DrawExpandButton(DC: HDC; var R: TRect; + AExpanded, ADrawBorder, AEdge3D, AEdge3DSoft, AShadow, AFillInterior: Boolean; + ABorderColor, AInteriorColor: TColor); virtual; + procedure DrawGlyph(DC: HDC; const R: TRect; AGlyph: Byte); // Draw indvidual glyph from Font (used to render SortMark, ExpandButton, CheckBox Glyphs and so on) + procedure DrawGraphic(DC: HDC; var R: TRect; const AClipRect: TRect; + AImageList: TCustomImageList; AImageIndex: Integer; AGraphic: TGraphic; + AGraphicTransparent, ATransparent: Boolean; AColor: TColor); virtual; + procedure DrawGraphicEx(DC: HDC; R: TRect; const AClipRect: TRect; + AImageList: TCustomImageList; AImageIndex: Integer; AGraphic: TGraphic; + AGraphicTransparent, ATransparent: Boolean; AColor, ABkColor: TColor; + APattern: TdxPSFillPatternClass; AnActualImageBuffering: TdxCellImageActualBuffering = cibAlways); virtual; + procedure DrawRectangle(DC: HDC; R: TRect; AForeColor, ABackColor: TColor; + AContentPattern: TdxPSFillPatternClass; ABorderColor: TColor; + ABorderThickness: Integer = 1); virtual; + procedure DrawRoundRect(DC: HDC; R: TRect; AnEllipseWidth, AnEllipseHeight: Integer; + AForeColor, ABackColor: TColor; AContentPattern: TdxPSFillPatternClass; + ABorderColor: TColor; ABorderThickness: Integer = 1); virtual; + procedure DrawSortMark(DC: HDC; var R: TRect; ASortOrder: TdxCellSortOrder; AMono: Boolean); virtual; + procedure DrawText(DC: HDC; var R: TRect; AMaxLineCount: Integer; + ALeftIndent, ARightIndent: Integer; const AText: string; AFont: TFont; + ABkColor: TColor; ATextAlignX: TdxTextAlignX; ATextAlignY: TdxTextAlignY; + AFillBackground, AMultiline, AEndEllipsis: Boolean; APreventLeftTextExceed: Boolean = True; + APreventTopTextExceed: Boolean = True; AHidePrefix: Boolean = True); + procedure DrawTextEx(DC: HDC; var R: TRect; AMaxLineCount: Integer; + ALeftIndent, ARightIndent: Integer; const AText: string; AFont: TFont; AFormat: DWORD); + function MakeTextFormat(ATextAlignX: TdxTextAlignX; ATextAlignY: TdxTextAlignY; + AMultiline, AEndEllipsis, APreventLeftTextExceed, APreventTopTextExceed, AHidePrefix: Boolean): DWORD; + procedure FillEllipse(DC: HDC; const R: TRect; AColor: TColor); virtual; + procedure FillEllipseEx(DC: HDC; const R: TRect; AForeColor, ABackColor: TColor; APattern: TdxPSFillPatternClass); virtual; + procedure FillRect(DC: HDC; const R: TRect; AColor: TColor); virtual; + procedure FillRectEx(DC: HDC; const R: TRect; AForeColor, ABackColor: TColor; APattern: TdxPSFillPatternClass); virtual; + procedure FillRoundRect(DC: HDC; const R: TRect; + AnEllipseWidth, AnEllipseHeight: Integer; AColor: TColor); virtual; + procedure FillRoundRectEx(DC: HDC; const R: TRect; AnEllipseWidth, AnEllipseHeight: Integer; + AForeColor, ABackColor: TColor; APattern: TdxPSFillPatternClass); virtual; + procedure FillRgn(DC: HDC; Rgn: HRGN; AColor: TColor); virtual; + procedure FillRgnEx(DC: HDC; Rgn: HRGN; AForeColor, ABackColor: TColor; APattern: TdxPSFillPatternClass); virtual; + procedure FrameEllipse(DC: HDC; R: TRect; AColor: TColor; AThickness: Integer = 1); + procedure FrameRect(DC: HDC; R: TRect; AColor: TColor; ASides: TdxCellSides = [csLeft..csBottom]; + AThickness: Integer = 1); virtual; + procedure FrameRoundRect(DC: HDC; R: TRect; AnEllipseWidth, AnEllipseHeight: Integer; + AColor: TColor; AThickness: Integer = 1); virtual; + + function GetBorderPainter(AClass: TdxPSCellBorderPainterClass): TdxPSCellBorderPainter; + function GetBrushByColor(AColor: TColor): HBRUSH; + function GetPatternBrush(APattern: TdxPSFillPatternClass; AColor: TColor): HBRUSH; + function GetReportGroupLookAndFeelPainter(AClass: TdxPSReportGroupLookAndFeelPainterClass): TdxPSReportGroupLookAndFeelPainter; + + function ExcludeClipRect(const R: TRect): Integer; + function GetClipRgn: HRGN; + function IntersectClipRect(const R: TRect): HRGN; + procedure RestoreClipRgn(var Rgn: HRGN); + + procedure RenderPage(ACanvas: TCanvas; const APageBounds: TRect; + APageIndex, AContinuousPageIndex, AZoomFactor: Integer); virtual; + + property BorderColor: TColor read FBorderColor; + property Canvas: TCanvas read FCanvas write FCanvas; + property DC: HDC read FDC write FDC; + property HalfLineThickness: Integer read GetHalfLineThickness; + property IsPrinting: Boolean read GetIsPrinting; + property IsRendering: Boolean read FIsRendering; + property LineThickness: Integer read FLineThickness write FLineThickness; + property MarlettFont10: TFont read FMarlettFont10; + property MarlettFont8: TFont read FMarlettFont8; + property PageRenderInfo: TdxPSPageRenderInfo read GetPageRenderInfo; + property PPI: Integer read FPPI write FPPI; // PixelsPerInch for current DC + property RenderInfo: TdxPSReportRenderInfo read GetRenderInfo; + property RenderingPageIndex: Integer read FRenderingPageIndex; // virtual + property RenderStage: TdxPSRenderStages read FRenderStage; + property ReportCells: TdxReportCells read GetReportCells; + property ReportLink: TBasedxReportLink read FReportLink; + property SymbolFont: TFont read FSymbolFont; + property UnitsPerInch: Integer read GetUnitsPerInch; + property UnitsPerPixel: Integer read FUnitsPerPixel write FUnitsPerPixel; + property ViewPortRect: TRect read FViewPortRect; + property ZoomFactor: Integer read FZoomFactor; + end; + + { Report Items } + + TdxReportItemClass = class of TdxReportItem; + + TdxReportItem = class(TPersistent) + private + FData: Integer; + FParent: TdxReportCell; + function GetIndex: Integer; + function GetReportCells: TdxReportCells; virtual; + procedure SetIndex(Value: Integer); + procedure SetParent(Value: TdxReportCell); + protected + function AsCell: TdxReportCell; + function GetTopLevelParent: TdxReportCell; + class function IsCell: Boolean; virtual; + + procedure ReadData(AReader: TdxPSDataReader); virtual; + procedure WriteData(AWriter: TdxPSDataWriter); virtual; + class function Serializable: Boolean; virtual; + public + constructor Create(AParent: TdxReportCell); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + class function ReportItemClass: TdxReportItemClass; + + class procedure Register; virtual; + class procedure Unregister; virtual; + + function Clone(AParent: TdxReportCell): TdxReportItem; + function GetNextSibling: TdxReportItem; + function GetPrevSibling: TdxReportItem; + function HasParent: Boolean; + function IsFirstItem: Boolean; + function IsLastItem: Boolean; + + property Data: Integer read FData write FData; + property Index: Integer read GetIndex write SetIndex; + property Parent: TdxReportCell read FParent write SetParent; + property ReportCells: TdxReportCells read GetReportCells; + property TopLevelParent: TdxReportCell read GetTopLevelParent; + end; + + TdxReportVisualItem = class(TdxReportItem) + private + FBackgroundBitmapIndex: Integer; + FBorderClass: TdxPSCellBorderClass; + FBorderColor: TColor; + FBoundsRect: TRect; + FCellSideColors: array[TdxCellSide] of TColor; + FColor: TColor; + FFontIndex: Integer; + FFormat: DWORD; + function GetAbsoluteOrigin: TPoint; + function GetAbsoluteRect: TRect; + function GetBackgroundBitmap: TBitmap; + function GetBackgroundBitmapHeight: Integer; + function GetBackgroundBitmapPool: TdxPSBackgroundBitmapPool; + function GetBackgroundBitmapTileOrigin: TPoint; + function GetBackgroundBitmapTileStartIndexX: Integer; + function GetBackgroundBitmapTileStartIndexY: Integer; + function GetBackgroundBitmapTileStopIndexX: Integer; + function GetBackgroundBitmapTileStopIndexY: Integer; + function GetBackgroundBitmapWidth: Integer; + function GetBorderBrush: HBRUSH; + function GetBorderColor: TColor; + function GetCellSides: TdxCellSides; + function GetCellSideColors(ASide: TdxCellSide): TColor; + function GetContentBrush: HBRUSH; + function GetEdge3DSoft: Boolean; + function GetEdge3DStyle: TdxCellEdgeStyle; + function GetEdgeMode: TdxCellEdgeMode; + function GetExcludeFromClipRgn: Boolean; + function GetFont: TFont; + function GetHeight: Integer; + function GetIsPrinting: Boolean; + function GetLeft: Integer; + function GetLineThickness: Integer; + function GetOrigin: TPoint; + function GetParentBrush: HBRUSH; + function GetParentColor: TColor; + function GetRenderer: TdxPSReportRenderer; + function GetShadowBrush: HBRUSH; + function GetShowShadow: Boolean; + function GetTop: Integer; + function GetTransparent: Boolean; + function GetWidth: Integer; + function GetVisible: Boolean; + procedure SetBackgroundBitmapIndex(Value: Integer); + procedure SetBorderClass(Value: TdxPSCellBorderClass); + procedure SetBoundsRect(const Value: TRect); + procedure SetCellSides(Value: TdxCellSides); + procedure SetCellSideColors(ASide: TdxCellSide; AValue: TColor); + procedure SetColor(Value: TColor); + procedure SetEdge3DSoft(Value: Boolean); + procedure SetEdge3DStyle(Value: TdxCellEdgeStyle); + procedure SetEdgeMode(Value: TdxCellEdgeMode); + procedure SetExcludeFromClipRgn(Value: Boolean); + procedure SetFont(Value: TFont); + procedure SetFormat(Value: DWORD); + procedure SetHeight(Value: Integer); + procedure SetLeft(Value: Integer); + procedure SetOrigin(const Value: TPoint); + procedure SetShowShadow(Value: Boolean); + procedure SetTop(Value: Integer); + procedure SetTransparent(Value: Boolean); + procedure SetWidth(Value: Integer); + procedure SetVisible(Value: Boolean); + protected + procedure BoundsChanged; virtual; + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); virtual; + procedure DoExcludeFromClipRgn(DC: HDC; const R: TRect; var AResult: Integer); + + function GetBackgroundBitmapTileBounds(Col, Row: Integer): TRect; virtual; + function GetBackgroundBounds(DC: HDC): TRect; virtual; + function GetBorderClass: TdxPSCellBorderClass; virtual; + function GetBorderEdgeBounds(ASide: TdxCellSide; const AOuterRect: TRect): TRect; virtual; + function GetBorderEdgeClass(ASide: TdxCellSide): TdxPSCellBorderClass; virtual; + function GetBorderEdgeSalient(ASide: TdxCellSide; ASalient: TdxPSCellBorderSalientType): Integer; virtual; + function GetBorderEdgeThickness(ASide: TdxCellSide): Integer; virtual; + function GetBorderBounds(DC: HDC): TRect; virtual; + + function GetBorderOuterBoundsRelativeTo(DC: HDC; const R: TRect): TRect; + function GetInnerBoundsRelativeTo(DC: HDC; const R: TRect): TRect; + function GetOuterBoundsRelativeTo(DC: HDC; const R: TRect): TRect; + + function GetBorderPainter: TdxPSCellBorderPainter; + function GetBorderPainterClass: TdxPSCellBorderPainterClass; virtual; + procedure InitBorderPainter(ABorderPainter: TdxPSCellBorderPainter); virtual; + function HasBorderColoration: Boolean; virtual; + + function GetFormatBit(ABit: DWORD): Boolean; + procedure SetFormatBit(ABit: DWORD; Value: Boolean); + + function GetContentBkColor: TColor; virtual; + function GetContentPattern: TdxPSFillPatternClass; virtual; + function GetShadowColor: TColor; virtual; + function GetShadowDepth: Integer; virtual; + procedure SetContentBkColor(Value: TColor); virtual; + procedure SetContentPattern(Value: TdxPSFillPatternClass); virtual; + procedure SetFontIndex(Value: Integer); virtual; + procedure SetShadowColor(Value: TColor); virtual; + procedure SetShadowDepth(Value: Integer); virtual; + + function IsBackgroundBitmapDrawn: Boolean; virtual; + function IsBackgroundDrawn: Boolean; virtual; + function IsBordersDrawn: Boolean; virtual; + + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + + property BackgroundBitmapHeight: Integer read GetBackgroundBitmapHeight; + property BackgroundBitmapTileBounds[Col, Row: Integer]: TRect read GetBackgroundBitmapTileBounds; + property BackgroundBitmapTileOrigin: TPoint read GetBackgroundBitmapTileOrigin; + property BackgroundBitmapTileStartIndexX: Integer read GetBackgroundBitmapTileStartIndexX; + property BackgroundBitmapTileStartIndexY: Integer read GetBackgroundBitmapTileStartIndexY; + property BackgroundBitmapTileStopIndexX: Integer read GetBackgroundBitmapTileStopIndexX; + property BackgroundBitmapTileStopIndexY: Integer read GetBackgroundBitmapTileStopIndexY; + property BackgroundBitmapWidth: Integer read GetBackgroundBitmapWidth; + + property Format: DWORD read FFormat write SetFormat; + property IsPrinting: Boolean read GetIsPrinting; + property LineThickness: Integer read GetLineThickness; + property Renderer: TdxPSReportRenderer read GetRenderer; + public + constructor Create(AParent: TdxReportCell); override; + procedure Assign(Source: TPersistent); override; + + procedure AdjustContent(DC: HDC); virtual; + + procedure DrawBackground(DC: HDC); virtual; + procedure DrawBackgroundBitmap(DC: HDC); virtual; + procedure DrawBackgroundBitmapTile(DC: HDC; const Rect: TRect); virtual; + procedure DrawBackgroundRect(DC: HDC; const R: TRect); + procedure DrawBorders(DC: HDC); virtual; + + function GetBorderOuterBounds(DC: HDC): TRect; virtual; + function GetInnerBounds(DC: HDC): TRect; virtual; + function GetOuterBounds(DC: HDC): TRect; virtual; + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); virtual; + + function CalculateLineCount(DC: HDC): Integer; virtual; + + function MeasureBordersHeight(DC: HDC): Integer; virtual; + function MeasureBordersWidth(DC: HDC): Integer; virtual; + function MeasureContentHeight(DC: HDC): Integer; virtual; + function MeasureContentWidth(DC: HDC): Integer; virtual; + function MeasureFontHeight(DC: HDC): Integer; virtual; + function MeasureHeight(DC: HDC): Integer; virtual; + function MeasureWidth(DC: HDC): Integer; virtual; + + // for backward compatibility + class function MapBorderClass(AEdgeMode: TdxCellEdgeMode; AEdgeStyle: TdxCellEdgeStyle; ASoft: Boolean): TdxPSCellBorderClass; + + property AbsoluteOrigin: TPoint read GetAbsoluteOrigin; + property AbsoluteRect: TRect read GetAbsoluteRect; + property BackgroundBitmap: TBitmap read GetBackgroundBitmap; + property BackgroundBitmapIndex: Integer read FBackgroundBitmapIndex write SetBackgroundBitmapIndex; + property BackgroundBitmapPool: TdxPSBackgroundBitmapPool read GetBackgroundBitmapPool; + property BorderBrush: HBRUSH read GetBorderBrush; + property BorderClass: TdxPSCellBorderClass read GetBorderClass write SetBorderClass; + property BorderColor: TColor read GetBorderColor write FBorderColor; // clDefault; + property BorderEdgeClasses[Side: TdxCellSide]: TdxPSCellBorderClass read GetBorderEdgeClass; + property BorderEdgeSalients[Side: TdxCellSide; Salient: TdxPSCellBorderSalientType]: Integer read GetBorderEdgeSalient; + property BorderEdgeThicknesses[Side: TdxCellSide]: Integer read GetBorderEdgeThickness; + property BorderPainter: TdxPSCellBorderPainter read GetBorderPainter; + property BorderPainterClass: TdxPSCellBorderPainterClass read GetBorderPainterClass; + property BoundsRect: TRect read FBoundsRect write SetBoundsRect; + property CellSides: TdxCellSides read GetCellSides write SetCellSides; {csAll} + property CellSideColors[ASide: TdxCellSide]: TColor read GetCellSideColors write SetCellSideColors; + property Color: TColor read FColor write SetColor; + property ContentBkColor: TColor read GetContentBkColor write SetContentBkColor; + property ContentBrush: HBRUSH read GetContentBrush; + property ContentPattern: TdxPSFillPatternClass read GetContentPattern write SetContentPattern; + property Edge3DSoft: Boolean read GetEdge3DSoft write SetEdge3DSoft; // obsolete - use BorderClass instead + property Edge3DStyle: TdxCellEdgeStyle read GetEdge3DStyle write SetEdge3DStyle; // obsolete - use BorderClass instead + property EdgeMode: TdxCellEdgeMode read GetEdgeMode write SetEdgeMode; // obsolete - use BorderClass instead + property ExcludeFromClipRgn: Boolean read GetExcludeFromClipRgn write SetExcludeFromClipRgn; + property Font: TFont read GetFont write SetFont; + property FontIndex: Integer read FFontIndex write SetFontIndex; + property Height: Integer read GetHeight write SetHeight; + property Left: Integer read GetLeft write SetLeft; + property Origin: TPoint read GetOrigin write SetOrigin; + property ParentBrush: HBRUSH read GetParentBrush; + property ParentColor: TColor read GetParentColor; + property ShadowBrush: HBRUSH read GetShadowBrush; + property ShadowColor: TColor read GetShadowColor write SetShadowColor; + property ShadowDepth: Integer read GetShadowDepth write SetShadowDepth; + property ShowShadow: Boolean read GetShowShadow write SetShowShadow; + property Top: Integer read GetTop write SetTop; + property Transparent: Boolean read GetTransparent write SetTransparent; + property Width: Integer read GetWidth write SetWidth; + property Visible: Boolean read GetVisible write SetVisible; + end; + + TdxReportCell = class(TdxReportVisualItem) + private + FCellList: TList; + FDataList: TList; + FReportCells: TdxReportCells; + function GetAbsoluteIndex: Integer; + function GetCellCount: Integer; + function GetCell(Index: Integer): TdxReportCell; + function GetClipChildren: Boolean; + function GetDataItemCount: Integer; + function GetDataItem(Index: Integer): TAbstractdxReportCellData; + function GetIsTopLevel: Boolean; + function GetLevel: Integer; + function GetReportCells: TdxReportCells; override; + procedure CellListNeeded; + procedure CellListRelease; + procedure DataListNeeded; + procedure DataListRelease; + procedure InsertCell(AnItem: TdxReportCell); + procedure InsertDataItem(AnItem: TdxReportItem); + procedure InsertItem(AnItem: TdxReportItem); + procedure MoveCell(ACurIndex, ANewIndex: Integer); + procedure MoveDataItem(ACurIndex, ANewIndex: Integer); + procedure MoveItem(AnItem: TdxReportItem; ACurIndex, ANewIndex: Integer); + procedure RemoveCell(AnItem: TdxReportCell); + procedure RemoveDataItem(AnItem: TdxReportItem); + procedure RemoveItem(AnItem: TdxReportItem); + procedure SetClipChildren(Value: Boolean); + protected + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); override; + function GetBackgroundBitmapTileBounds(Col, Row: Integer): TRect; override; + function GetBackgroundBounds(DC: HDC): TRect; override; + function GetBorderBounds(DC: HDC): TRect; override; + class function IsCell: Boolean; override; + + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + + procedure ReadCells(AReader: TdxPSDataReader); virtual; + procedure ReadDataItems(AReader: TdxPSDataReader); virtual; + procedure ReadProperties(AReader: TdxPSDataReader); virtual; + procedure WriteCells(AWriter: TdxPSDataWriter); virtual; + procedure WriteDataItems(AWriter: TdxPSDataWriter); virtual; + procedure WriteProperties(AWriter: TdxPSDataWriter); virtual; + public + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + procedure DrawContent(DC: HDC; DrawRect: TRect; const OriginRect: TRect; AStage: TdxPSRenderStages); virtual; + procedure DrawItself(DC: HDC; AStage: TdxPSRenderStages); virtual; + procedure DrawNestedCells(DC: HDC; DrawRect: TRect; const OriginRect: TRect; AStage: TdxPSRenderStages); virtual; + procedure DrawNestedDataItems(DC: HDC; const OriginRect: TRect; AStage: TdxPSRenderStages); virtual; + function ExcludeNestedItems(DC: HDC; const OriginRect: TRect): Integer; virtual; + + function GetBorderOuterBounds(DC: HDC): TRect; override; + function GetInnerBounds(DC: HDC): TRect; override; + function GetOuterBounds(DC: HDC): TRect; override; + + function MeasureHeight(DC: HDC): Integer; override; + function MeasureWidth(DC: HDC): Integer; override; + + function AddCell: TdxReportCell; + function AddDataItem(AClass: TdxReportCellDataClass): TAbstractdxReportCellData; + procedure AllocateSpaceForCells(ACapacity: Integer); + procedure AllocateSpaceForDatas(ACapacity: Integer); + procedure ClearAll; + procedure ClearCells; + procedure ClearDataItems; + procedure DeleteCell(Index: Integer); + procedure DeleteDataItem(Index: Integer); + function FirstCell: TdxReportCell; + function HasChildren: Boolean; + function IndexOf(AnItem: TdxReportItem): Integer; + function LastCell: TdxReportCell; + + property AbsoluteIndex: Integer read GetAbsoluteIndex; + property CellCount: Integer read GetCellCount; + property Cells[Index: Integer]: TdxReportCell read GetCell; default; + property ClipChildren: Boolean read GetClipChildren write SetClipChildren; + property DataItemCount: Integer read GetDataItemCount; + property DataItems[Index: Integer]: TAbstractdxReportCellData read GetDataItem; + property IsTopLevel: Boolean read GetIsTopLevel; + property Level: Integer read GetLevel; + end; + + TdxReportGroup = class; + + TdxPSReportGroupLookAndFeelPainter = class + private + FGroup: TdxReportGroup; + FLookAndFeel: TdxPSReportGroupLookAndFeel; + FRenderer: TdxPSReportRenderer; + protected + procedure DrawBorders(DC: HDC); virtual; + procedure DrawCaptionText(DC: HDC); virtual; + procedure Initialize(ALookAndFeel: TdxPSReportGroupLookAndFeel; AGroup: TdxReportGroup); virtual; + + function Group: TdxReportGroup; overload; virtual; + function LookAndFeel: TdxPSReportGroupLookAndFeel; overload; virtual; + public + constructor Create(ARenderer: TdxPSReportRenderer); virtual; + procedure Paint(DC: HDC); virtual; + property Renderer: TdxPSReportRenderer read FRenderer; + end; + + TdxPSReportGroupLookAndFeel = class(TPersistent) + private + FCaptionHeight: Integer; + FCaptionFontIndex: Integer; + FCaptionIndent: Integer; + FColor: TColor; + FData: Pointer; + FFontIndex: Integer; + FReportCells: TdxReportCells; + function GetCaptionFont: TFont; + function GetFont: TFont; + function GetRenderer: TdxPSReportRenderer; + procedure SetCaptionFont(Value: TFont); + procedure SetCaptionFontIndex(Value: Integer); + procedure SetFont(Value: TFont); + procedure SetFontIndex(Value: Integer); + protected + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); virtual; + + procedure ReadData(AReader: TdxPSDataReader); virtual; + procedure WriteData(AWriter: TdxPSDataWriter); virtual; + + function GetBorderEdgeThickness(AGroup: TdxReportGroup; ASide: TdxCellSide): Integer; virtual; + function GetBorderThickness: Integer; virtual; + function GetColor: TColor; virtual; + procedure SetBorderThickness(Value: Integer); virtual; + + function GetCaptionAreaHeight: Integer; virtual; + function GetCaptionBounds(AGroup: TdxReportGroup): TRect; virtual; + function GetCaptionColor: TColor; virtual; + function GetCaptionHeight: Integer; virtual; + function GetCaptionIndent: Integer; virtual; + function GetCaptionLeftRestSpaceBounds(AGroup: TdxReportGroup): TRect; virtual; + function GetCaptionRightRestSpaceBounds(AGroup: TdxReportGroup): TRect; virtual; + function GetCaptionTextBounds(AGroup: TdxReportGroup): TRect; virtual; + + function GetPainter: TdxPSReportGroupLookAndFeelPainter; + class function GetPainterClass: TdxPSReportGroupLookAndFeelPainterClass; virtual; + + property BorderThickness: Integer read GetBorderThickness write SetBorderThickness; + property CaptionAreaHeight: Integer read GetCaptionAreaHeight; + property CaptionColor: TColor read GetCaptionColor; + property CaptionHeight: Integer read GetCaptionHeight; + property CaptionIndent: Integer read GetCaptionIndent; + property Renderer: TdxPSReportRenderer read GetRenderer; + property ReportCells: TdxReportCells read FReportCells; + public + constructor Create(AReportCells: TdxReportCells); virtual; + procedure Assign(Source: TPersistent); override; + + class function BorderClass: TdxPSCellBorderClass; virtual; + class function DefaultBorderSides: TdxCellSides; virtual; + class function Name: string; virtual; + + class procedure Register; virtual; + class procedure Unregister; virtual; + + procedure Paint(DC: HDC; AGroup: TdxReportGroup); + procedure Prepare(DC: HDC); virtual; + + property CaptionFont: TFont read GetCaptionFont write SetCaptionFont; + property CaptionFontIndex: Integer read FCaptionFontIndex write SetCaptionFontIndex; + property Color: TColor read GetColor write FColor; + property Data: Pointer read FData write FData; + property Font: TFont read GetFont write SetFont; + property FontIndex: Integer read FFontIndex write SetFontIndex; + end; + + TdxPSReportGroupNullLookAndFeel = class; + + TdxPSReportGroupNullLookAndFeelPainter = class(TdxPSReportGroupLookAndFeelPainter) + public + procedure Paint(DC: HDC); override; + end; + + TdxPSReportGroupNullLookAndFeel = class(TdxPSReportGroupLookAndFeel) + protected + function GetBorderThickness: Integer; override; + function GetCaptionHeight: Integer; override; + class function GetPainterClass: TdxPSReportGroupLookAndFeelPainterClass; override; + public + class function BorderClass: TdxPSCellBorderClass; override; + class function DefaultBorderSides: TdxCellSides; override; + class function Name: string; override; + end; + + TdxPSReportGroupStandardLookAndFeel = class; + + TdxPSReportGroupStandardLookAndFeelPainter = class(TdxPSReportGroupLookAndFeelPainter) + protected + procedure DrawBorders(DC: HDC); override; + procedure DrawCaptionRestSpace(DC: HDC); virtual; + function LookAndFeel: TdxPSReportGroupStandardLookAndFeel; reintroduce; overload; + public + procedure Paint(DC: HDC); override; + end; + + TdxPSReportGroupStandardLookAndFeel = class(TdxPSReportGroupLookAndFeel) + protected + class function GetPainterClass: TdxPSReportGroupLookAndFeelPainterClass; override; + public + class function BorderClass: TdxPSCellBorderClass; override; + class function Name: string; override; + + property CaptionAreaHeight; + property CaptionFont; + property CaptionFontIndex; + end; + + TdxPSReportGroupOfficeLookAndFeel = class(TdxPSReportGroupStandardLookAndFeel) + protected + function GetCaptionIndent: Integer; override; + public + class function DefaultBorderSides: TdxCellSides; override; + class function Name: string; override; + end; + + TdxPSReportGroupWebLookAndFeel = class; + + TdxPSReportGroupWebLookAndFeelPainter = class(TdxPSReportGroupLookAndFeelPainter) + protected + procedure DrawBorders(DC: HDC); override; + procedure DrawCaptionSeparator(DC: HDC); virtual; + function LookAndFeel: TdxPSReportGroupWebLookAndFeel; reintroduce; overload; + public + procedure Paint(DC: HDC); override; + end; + + TdxPSReportGroupWebLookAndFeel = class(TdxPSReportGroupLookAndFeel) + private + FBorderColor: TColor; + FBorderThickness: Integer; + FCaptionColor: TColor; + FCaptionSeparatorColor: TColor; + FCaptionSeparatorThickness: Integer; + procedure SetCaptionSeparatorThickness(Value: Integer); + protected + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); override; + + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + + function GetBorderEdgeThickness(AGroup: TdxReportGroup; ASide: TdxCellSide): Integer; override; + function GetBorderThickness: Integer; override; + procedure SetBorderThickness(Value: Integer); override; + + function GetBorderColor: TColor; virtual; + function GetCaptionColor: TColor; override; + function GetCaptionSeparatorColor: TColor; virtual; + + function GetCaptionAreaHeight: Integer; override; + function GetCaptionBounds(AGroup: TdxReportGroup): TRect; override; + function GetCaptionLeftRestSpaceBounds(AGroup: TdxReportGroup): TRect; override; + function GetCaptionRightRestSpaceBounds(AGroup: TdxReportGroup): TRect; override; + function GetCaptionSeparatorBounds(AGroup: TdxReportGroup): TRect; virtual; + function GetCaptionTextBounds(AGroup: TdxReportGroup): TRect; override; + + class function GetPainterClass: TdxPSReportGroupLookAndFeelPainterClass; override; + public + constructor Create(AReportCells: TdxReportCells); override; + procedure Assign(Source: TPersistent); override; + + class function BorderClass: TdxPSCellBorderClass; override; + class function Name: string; override; + + property BorderColor: TColor read GetBorderColor write FBorderColor; + property BorderThickness; + property CaptionAreaHeight; + property CaptionColor write FCaptionColor; + property CaptionFont; + property CaptionSeparatorColor: TColor read GetCaptionSeparatorColor write FCaptionSeparatorColor; + property CaptionSeparatorThickness: Integer read FCaptionSeparatorThickness write SetCaptionSeparatorThickness; + end; + + TdxReportGroup = class(TdxReportCell) + private + FCaptionText: string; + FCaptionTextWidth: Integer; + FLookAndFeel: TdxPSReportGroupLookAndFeel; + //FStreamedLookAndFeelIndex: Integer; + function GetCaptionAlignment: TdxTextAlignX; + function GetCaptionTextWidth: Integer; + function GetCaptionTransparent: Boolean; + function GetLookAndFeel: TdxPSReportGroupLookAndFeel; + function GetLookAndFeelIndex: Integer; + function GetShowCaption: Boolean; + function GetUseOwnBorderClass: Boolean; + procedure SetCaptionAlignment(Value: TdxTextAlignX); + procedure SetCaptionTransparent(Value: Boolean); + procedure SetLookAndFeel(Value: TdxPSReportGroupLookAndFeel); + procedure SetShowCaption(Value: Boolean); + procedure SetUseOwnBorderClass(Value: Boolean); + protected + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); override; + procedure InternalDrawBorders(DC: HDC); virtual; + + function GetBorderClass: TdxPSCellBorderClass; override; + function GetBorderEdgeSalient(ASide: TdxCellSide; ASalient: TdxPSCellBorderSalientType): Integer; override; + function GetBorderEdgeThickness(ASide: TdxCellSide): Integer; override; + function InternalGetBorderEdgeThickness(ASide: TdxCellSide): Integer; + + function IsBordersDrawn: Boolean; override; + + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + + property CaptionTextWidth: Integer read GetCaptionTextWidth; + property LookAndFeelIndex: Integer read GetLookAndFeelIndex; + public + constructor Create(AParent: TdxReportCell); override; + procedure Assign(Source: TPersistent); override; + + procedure DrawBorders(DC: HDC); override; + + procedure CalculateCaptionTextWidth(DC: HDC); + function GetBorderOuterBounds(DC: HDC): TRect; override; + + property CaptionAlignment: TdxTextAlignX read GetCaptionAlignment write SetCaptionAlignment; + property CaptionText: string read FCaptionText write FCaptionText; + property CaptionTransparent: Boolean read GetCaptionTransparent write SetCaptionTransparent; + property LookAndFeel: TdxPSReportGroupLookAndFeel read GetLookAndFeel write SetLookAndFeel; + property ShowCaption: Boolean read GetShowCaption write SetShowCaption; + property UseOwnBorderClass: Boolean read GetUseOwnBorderClass write SetUseOwnBorderClass; + end; + + TdxReportCells = class(TPersistent) + private + FBorderColor: TColor; + FBorderWidth: Integer; + FCells: TdxReportCell; + FExpandButtonBorderColor: TColor; + FFooterCells: TdxReportCell; + FGroupBorderColor: TColor; + FGroupCaptionColor: TColor; + FGroupCaptionSeparatorColor: TColor; + FGroupColor: TColor; + FHeaderCells: TdxReportCell; + FImageLists: TList; + FLookAndFeel: TdxPSReportGroupLookAndFeel; + FLookAndFeels: TList; + FOverlays: TList; + FOwnImageLists: Boolean; + FShadowColor: TColor; + FShadowDepth: Integer; + FReportLink: TBasedxReportLink; + FTreeLineColor: TColor; + FTreeLineStyle: TdxPSTreeLineStyle; + function GetAreFooterCellsAllocated: Boolean; + function GetAreHeaderCellsAllocated: Boolean; + function GetBoundsRect: TRect; + function GetCount: Integer; + function GetFont: TFont; + function GetFooterBoundsRect: TRect; + function GetFooterCellCount: Integer; + function GetFooterCells: TdxReportCell; + function GetHeaderBoundsRect: TRect; + function GetHeaderCellCount: Integer; + function GetHeaderCells: TdxReportCell; + function GetImageList(Index: Integer): TCustomImageList; + function GetImageListCount: Integer; + function GetLookAndFeel(Index: Integer): TdxPSReportGroupLookAndFeel; + function GetLookAndFeelCount: Integer; + function GetOverlay(Index: Integer): TdxReportCell; + function GetOverlayCount: Integer; + function GetRenderer: TdxPSReportRenderer; + procedure SetBorderColor(Value: TColor); + procedure SetShadowColor(Value: TColor); + procedure SetShadowDepth(Value: Integer); + procedure SetTreeLineColor(Value: TColor); + + procedure CreateFooterCells; + procedure CreateHeaderCells; + protected + procedure AfterReadData(AReader: TdxPSDataReader); virtual; + procedure AfterWriteData(AWriter: TdxPSDataWriter); virtual; + procedure BeforeReadData(AReader: TdxPSDataReader); virtual; + procedure BeforeWriteData(AWriter: TdxPSDataWriter); virtual; + + procedure ReadCells(AReader: TdxPSDataReader); + procedure ReadHeaderCells(AReader: TdxPSDataReader); + procedure ReadFooterCells(AReader: TdxPSDataReader); + procedure ReadImageLists(AReader: TdxPSDataReader); + procedure ReadLookAndFeels(AReader: TdxPSDataReader); + procedure ReadOverlayCells(AReader: TdxPSDataReader); + procedure ReadProperties(AReader: TdxPSDataReader); + + procedure WriteCells(AWriter: TdxPSDataWriter); + procedure WriteFooterCells(AWriter: TdxPSDataWriter); + procedure WriteHeaderCells(AWriter: TdxPSDataWriter); + procedure WriteImageLists(AWriter: TdxPSDataWriter); + procedure WriteLookAndFeels(AWriter: TdxPSDataWriter); + procedure WriteOverlayCells(AWriter: TdxPSDataWriter); + procedure WriteProperties(AWriter: TdxPSDataWriter); + + function CalculateOverlaysHeight: Integer; + function CalculateOverlaysWidth: Integer; + function CalculateTotalHeight: Integer; + function CalculateTotalWidth: Integer; + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); virtual; + function GetCellTopLevelParent(AnItem: TdxReportItem): TdxReportCell; virtual; + + procedure FreeAndNilReportGroupLookAndFeels; + procedure PrepareReportGroupsLookAndFeels(DC: HDC); + + procedure AddImageList(AnImageList: TCustomImageList); + procedure ClearImageLists; + procedure FreeAndNilImageLists; + procedure GetImageLists; + + property ImageListCount: Integer read GetImageListCount; + property OwnImageLists: Boolean read FOwnImageLists write FOwnImageLists; + property Renderer: TdxPSReportRenderer read GetRenderer; + public + constructor Create(AReportLink: TBasedxReportLink); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + procedure ClearItems; + + procedure ClearLookAndFeels; + function CreateGroupLookAndFeel(AClass: TdxPSReportGroupLookAndFeelClass; ACheckExisting: Boolean = True): TdxPSReportGroupLookAndFeel; + function FindGroupLookAndFeelByClass(AClass: TdxPSReportGroupLookAndFeelClass): TdxPSReportGroupLookAndFeel; + function FindGroupLookAndFeelByData(AData: Pointer): TdxPSReportGroupLookAndFeel; + function IndexOfImageList(AnImageList: TCustomImageList): Integer; + function IndexOfReportGroupLookAndFeel(ALookAndFeel: TdxPSReportGroupLookAndFeel): Integer; + + procedure DoProgress(const APercentDone: Double); + + function AddOverlay: TdxReportCell; + procedure AppendOverlays(Source: TdxReportCells; AnOffsetX: Integer = 0; AnOffsetY: Integer = 0); + procedure AssignOverlays(Source: TdxReportCells; AnOffsetX: Integer = 0; AnOffsetY: Integer = 0); + procedure ClearOverlays; + procedure DeleteOverlay(AnOverlay: TdxReportCell); + procedure FreeAndNilOverlays; + function HasOverlays: Boolean; + function IndexOfOverlay(AnOverlay: TdxReportCell): Integer; + + function GetFontByIndex(AnIndex: Integer): TFont; + function GetIndexByFont(AFont: TFont): Integer; + + procedure ReadData(AReader: TdxPSDataReader); virtual; + procedure WriteData(AWriter: TdxPSDataWriter); virtual; + + property AreFooterCellsAllocated: Boolean read GetAreFooterCellsAllocated; + property AreHeaderCellsAllocated: Boolean read GetAreHeaderCellsAllocated; + property BorderColor: TColor read FBorderColor write SetBorderColor; + property BorderWidth: Integer read FBorderWidth write FBorderWidth; + property BoundsRect: TRect read GetBoundsRect; + property Cells: TdxReportCell read FCells; + property Count: Integer read GetCount; + property ExpandButtonBorderColor: TColor read FExpandButtonBorderColor write FExpandButtonBorderColor default clBlack; + property Font: TFont read GetFont; + property FooterBoundsRect: TRect read GetFooterBoundsRect; + property FooterCellCount: Integer read GetFooterCellCount; + property FooterCells: TdxReportCell read GetFooterCells; + property GroupBorderColor: TColor read FGroupBorderColor write FGroupBorderColor; + property GroupCaptionColor: TColor read FGroupCaptionColor write FGroupCaptionColor; + property GroupCaptionSeparatorColor: TColor read FGroupCaptionSeparatorColor write FGroupCaptionSeparatorColor; + property GroupColor: TColor read FGroupColor write FGroupColor; + property HeaderBoundsRect: TRect read GetHeaderBoundsRect; + property HeaderCellCount: Integer read GetHeaderCellCount; + property HeaderCells: TdxReportCell read GetHeaderCells; + property ImageLists[Index: Integer]: TCustomImageList read GetImageList; + property LookAndFeel: TdxPSReportGroupLookAndFeel read FLookAndFeel write FLookAndFeel; + property LookAndFeelCount: Integer read GetLookAndFeelCount; + property LookAndFeels[Index: Integer]: TdxPSReportGroupLookAndFeel read GetLookAndFeel; + property OverlayCount: Integer read GetOverlayCount; + property Overlays[Index: Integer]: TdxReportCell read GetOverlay; + property ReportLink: TBasedxReportLink read FReportLink; + property ShadowColor: TColor read FShadowColor write SetShadowColor; + property ShadowDepth: Integer read FShadowDepth write SetShadowDepth; + property TreeLineColor: TColor read FTreeLineColor write SetTreeLineColor; + property TreeLineStyle: TdxPSTreeLineStyle read FTreeLineStyle write FTreeLineStyle default tlsDot; + end; + + TAbstractdxReportCellData = class(TdxReportVisualItem) + private + function GetBreakByChars: Boolean; + function GetEndEllipsis: Boolean; + function GetHidePrefix: Boolean; + function GetMultiline: Boolean; + function GetPreventLeftTextExceed: Boolean; + function GetPreventTopTextExceed: Boolean; + function GetSortOrder: TdxCellSortOrder; + function GetTextAlignX: TdxTextAlignX; + function GetTextAlignY: TdxTextAlignY; + procedure SetBreakByChars(Value: Boolean); + procedure SetEndEllipsis(Value: Boolean); + procedure SetHidePrefix(Value: Boolean); + procedure SetMultiline(Value: Boolean); + procedure SetPreventLeftTextExceed(Value: Boolean); + procedure SetPreventTopTextExceed(Value: Boolean); + procedure SetSortOrder(Value: TdxCellSortOrder); + procedure SetTextAlignX(Value: TdxTextAlignX); + procedure SetTextAlignY(Value: TdxTextAlignY); + protected + function CustomDraw(DC: HDC): Boolean; virtual; + function GetAbsoluteEffectiveBounds(DC: HDC; AStage: TdxPSRenderStages): TRect; virtual; + function GetDefaultDTFormat: DWORD; virtual; + function GetEffectiveBounds(DC: HDC; AStage: TdxPSRenderStages): TRect; virtual; + function GetDTFormat: DWORD; virtual; + function IsCustomDrawn: Boolean; virtual; + function IsDrawingNeeded(DC: HDC; AStage: TdxPSRenderStages; const ARect: TRect): Boolean; virtual; + function IsDrawn(DC: HDC; AStage: TdxPSRenderStages; const ARect: TRect): Boolean; virtual; + + property BreakByChars: Boolean read GetBreakByChars write SetBreakByChars default True; + property EndEllipsis: Boolean read GetEndEllipsis write SetEndEllipsis default False; + property HidePrefix: Boolean read GetHidePrefix write SetHidePrefix default False; + property Multiline: Boolean read GetMultiline write SetMultiline default False; + property PreventLeftTextExceed: Boolean read GetPreventLeftTextExceed write SetPreventLeftTextExceed; + property PreventTopTextExceed: Boolean read GetPreventTopTextExceed write SetPreventTopTextExceed; + property SortOrder: TdxCellSortOrder read GetSortOrder write SetSortOrder default csoNone; + property TextAlignX: TdxTextAlignX read GetTextAlignX write SetTextAlignX default taLeft; + property TextAlignY: TdxTextAlignY read GetTextAlignY write SetTextAlignY default taCenterY; + public + constructor Create(AParent: TdxReportCell); override; + + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); virtual; + function GetCustomDrawID: Integer; virtual; + + function MeasureContentHeight(DC: HDC): Integer; override; + function MeasureContentWidth(DC: HDC): Integer; override; + + property DefaultDTFormat: DWORD read GetDefaultDTFormat; + property DTFormat: DWORD read GetDTFormat; + end; + + TdxReportCellBoxClass = class of TdxReportCellBox; + + TdxReportCellBox = class(TAbstractdxReportCellData); + + TdxReportCellTextClass = class of TdxReportCellText; + + TdxReportCellText = class(TAbstractdxReportCellData) + private + FIndent: Cardinal; + function GetAdjustFont: Boolean; + function GetIndent: Integer; + procedure SetAdjustFont(Value: Boolean); + procedure SetIndent(Value: Integer); + protected + function GetText: string; virtual; abstract; + procedure SetText(const Value: string); virtual; abstract; + + function GetSortMarkBounds(DC: HDC): TRect; virtual; + function GetTextBounds(DC: HDC): TRect; virtual; + function IsSortMarkDrawn: Boolean; virtual; + function IsTextDrawn: Boolean; virtual; + + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + + property AdjustFont: Boolean read GetAdjustFont write SetAdjustFont; + property Indent: Integer read GetIndent write SetIndent; + public + procedure Assign(Source: TPersistent); override; + + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + procedure DrawSortMark(DC: HDC); virtual; + procedure DrawText(DC: HDC); virtual; + + function CalculateLineCount(DC: HDC): Integer; override; + function MeasureContentHeight(DC: HDC): Integer; override; + function MeasureContentWidth(DC: HDC): Integer; override; + function MeasureFontHeight(DC: HDC): Integer; override; + + property EndEllipsis; + property HidePrefix; + property Multiline; + property SortOrder; + property Text: string read GetText write SetText; + end; + + TdxReportCellStringClass = class of TdxReportCellString; + + TdxReportCellString = class(TdxReportCellText) + private + FText: string; + protected + function GetText: string; override; + procedure SetText(const Value: string); override; + public + property AdjustFont; + property Indent; + property PreventLeftTextExceed; + property PreventTopTextExceed; + property TextAlignX; + property TextAlignY; + end; + + TdxReportCellImageContainer = class(TdxReportCellString) + private + function GetImageTransparent: Boolean; + procedure SetImageTransparent(Value: Boolean); + protected + function GetImageAreaBounds(DC: HDC): TRect; virtual; + function GetImageBounds(DC: HDC): TRect; virtual; + procedure GetImageSizes(var AImageWidth, AImageHeight: Integer); virtual; + function HasImage: Boolean; virtual; + function IsImageBackgroundDrawn: Boolean; virtual; + function IsImageDrawn: Boolean; virtual; + function IsTextBackgroundDrawn: Boolean; virtual; + property ImageTransparent: Boolean read GetImageTransparent write SetImageTransparent default True; + public + constructor Create(AParent: TdxReportCell); override; + procedure Assign(Source: TPersistent); override; + + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + procedure DrawImage(DC: HDC); virtual; + procedure DrawImageBackground(DC: HDC); virtual; + procedure DrawTextBackground(DC: HDC); virtual; + end; + + TdxCustomReportCellCheckClass = class of TdxCustomReportCellCheck; + + TdxCustomReportCellCheck = class(TdxReportCellImageContainer) + private + function GetBoldBorder: Boolean; + function GetButtonEdgeStyle: TdxCheckButtonEdgeStyle; + function GetChecked: Boolean; + function GetCheckPos: TdxCellCheckPos; + function GetEnabled: Boolean; + function GetFlatBorder: Boolean; + function GetState: TCheckBoxState; + procedure SetBoldBorder(Value: Boolean); + procedure SetButtonEdgeStyle(Value: TdxCheckButtonEdgeStyle); + procedure SetCheckPos(Value: TdxCellCheckPos); + procedure SetEnabled(Value: Boolean); + procedure SetFlatBorder(Value: Boolean); + protected + function GetCheckBounds(DC: HDC): TRect; virtual; + function GetImageAreaBounds(DC: HDC): TRect; override; + function GetImageBounds(DC: HDC): TRect; override; + procedure GetImageSizes(var AImageWidth, AImageHeight: Integer); override; + function GetTextBounds(DC: HDC): TRect; override; + function HasImage: Boolean; override; + function IsImageBackgroundDrawn: Boolean; override; + class function IsRadio: Boolean; virtual; + procedure SetChecked(Value: Boolean); virtual; + + property BoldBorder: Boolean read GetBoldBorder write SetBoldBorder; // obsolete + property FlatBorder: Boolean read GetFlatBorder write SetFlatBorder; // obsolete + property State: TCheckBoxState read GetState; + public + constructor Create(AParent: TdxReportCell); override; + + procedure DrawCheck(DC: HDC); virtual; + procedure DrawImage(DC: HDC); override; + + function MeasureContentHeight(DC: HDC): Integer; override; + function MeasureContentWidth(DC: HDC): Integer; override; + + property ButtonEdgeStyle: TdxCheckButtonEdgeStyle read GetButtonEdgeStyle write SetButtonEdgeStyle default cbesUltraFlat; + property Checked: Boolean read GetChecked write SetChecked default False; + property CheckPos: TdxCellCheckPos read GetCheckPos write SetCheckPos default ccpCenter; + property Enabled: Boolean read GetEnabled write SetEnabled default True; + end; + + TdxReportCellCheck = class(TdxCustomReportCellCheck) + public + property BoldBorder; + property FlatBorder; + property State; + end; + + TdxCustomReportCellRadio = class(TdxReportCellCheck) + protected + class function IsRadio: Boolean; override; + end; + + TdxReportCellRadio = class(TdxCustomReportCellRadio) + end; + + TdxCustomReportCellCheckImage = class(TdxReportCellCheck) + private + function GetGlyphPartialBounds: TRect; + protected + procedure GetImageSizes(var AImageWidth, AImageHeight: Integer); override; + + function GetGlyph: TBitmap; virtual; + function GetGlyphCount: Integer; virtual; + function GetGlyphIndex: Integer; virtual; + procedure SetGlyph(Value: TBitmap); virtual; + procedure SetGlyphCount(Value: Integer); virtual; + + function HasGlyph: Boolean; virtual; + procedure ReleaseGlyph; virtual; + + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + + property Glyph: TBitmap read GetGlyph write SetGlyph; + property GlyphCount: Integer read GetGlyphCount write SetGlyphCount; + property GlyphIndex: Integer read GetGlyphIndex; + property GlyphPartialBounds: TRect read GetGlyphPartialBounds; + public + constructor Create(AParent: TdxReportCell); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + procedure DrawCheck(DC: HDC); override; + procedure DrawCheckGlyph(DC: HDC); virtual; + end; + + TdxReportCellCheckImage = class(TdxCustomReportCellCheckImage) + private + FGlyph: TBitmap; + protected + function GetGlyphCount: Integer; override; + function GetGlyph: TBitmap; override; + procedure SetGlyph(Value: TBitmap); override; + procedure SetGlyphCount(Value: Integer); override; + + function HasGlyph: Boolean; override; + procedure ReleaseGlyph; override; + public + property Glyph; + property GlyphCount; + property GlyphIndex; + property GlyphPartialBounds; + end; + + TdxCustomReportButtonGroupClass = class of TdxCustomReportButtonGroup; + + TdxCustomReportButtonGroup = class(TdxReportGroup) + private + FColumnCount: Integer; + FInterColumnsMinSpace: Integer; + FInterRowsMinSpace: Integer; + FIndents: TRect; + FItemSize: TSize; + function GetButtonEdgeStyle: TdxCheckButtonEdgeStyle; + function GetCheckPos: TdxCellCheckPos; + function GetItem(Index: Integer): TdxCustomReportCellCheck; + function GetItemColumn(Index: Integer): Integer; + function GetItemCount: Integer; + function GetItemRow(Index: Integer): Integer; + function GetRowCount: Integer; + procedure SetButtonEdgeStyle(Value: TdxCheckButtonEdgeStyle); + procedure SetCheckPos(Value: TdxCellCheckPos); + procedure SetColumnCount(Value: Integer); + procedure SetInterColumnsMinSpace(Value: Integer); + procedure SetInterRowsMinSpace(Value: Integer); + procedure SetIndents(Value: TRect); + protected + FLocked: Boolean; + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); override; + procedure SetFontIndex(Value: Integer); override; + + procedure ReadDataItems(AReader: TdxPSDataReader); override; + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + + class function GetItemClass: TdxCustomReportCellCheckClass; virtual; + procedure InitializeItem(AnItem: TdxCustomReportCellCheck); virtual; + + property ItemSize: TSize read FItemSize; + property Locked: Boolean read FLocked write FLocked; + public + constructor Create(AParent: TdxReportCell); override; + procedure Assign(Source: TPersistent); override; + + procedure AdjustContent(DC: HDC); override; + + function MeasureContentHeight(DC: HDC): Integer; override; + function MeasureContentWidth(DC: HDC): Integer; override; + + function Add(const AText: string = ''): TdxCustomReportCellCheck; + procedure Clear; + procedure Delete(Index: Integer); + function FindItem(const ACaption: string): Integer; + + property ButtonEdgeStyle: TdxCheckButtonEdgeStyle read GetButtonEdgeStyle write SetButtonEdgeStyle default cbesUltraFlat; + property CheckPos: TdxCellCheckPos read GetCheckPos write SetCheckPos default ccpCenter; + property ColumnCount: Integer read FColumnCount write SetColumnCount; + property Indents: TRect read FIndents write SetIndents; + property InterColumnsMinSpace: Integer read FInterColumnsMinSpace write SetInterColumnsMinSpace; + property InterRowsMinSpace: Integer read FInterRowsMinSpace write SetInterRowsMinSpace; + property ItemColumns[Index: Integer]: Integer read GetItemColumn; + property ItemCount: Integer read GetItemCount; + property ItemRows[Index: Integer]: Integer read GetItemRow; + property Items[Index: Integer]: TdxCustomReportCellCheck read GetItem; + property RowCount: Integer read GetRowCount; + end; + + TdxReportRadioGroup = class(TdxCustomReportButtonGroup) + private + function GetItem(Index: Integer): TdxCustomReportCellRadio; + function GetItemIndex: Integer; + procedure SetItemIndex(Value: Integer); + protected + class function GetItemClass: TdxCustomReportCellCheckClass; override; + public + function Add(const AText: string = ''): TdxCustomReportCellRadio; + property ItemIndex: Integer read GetItemIndex write SetItemIndex; + property Items[Index: Integer]: TdxCustomReportCellRadio read GetItem; + end; + + TdxReportCheckGroup = class(TdxCustomReportButtonGroup) + private + FGlyph: TBitmap; + FGlyphCount: Integer; + function GetGlyph: TBitmap; + function GetItem(Index: Integer): TdxCustomReportCellCheckImage; + function GetItemChecked(Index: Integer): Boolean; + function GetItemEnabled(Index: Integer): Boolean; + function GetItemState(Index: Integer): TCheckBoxState; + procedure SetGlyph(Value: TBitmap); + procedure SetGlyphCount(Value: Integer); + procedure SetItemChecked(Index: Integer; Value: Boolean); + procedure SetItemEnabled(Index: Integer; Value: Boolean); + protected + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + + class function GetItemClass: TdxCustomReportCellCheckClass; override; + procedure InitializeItem(AnItem: TdxCustomReportCellCheck); override; + public + constructor Create(AParent: TdxReportCell); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + function Add(const AText: string = ''): TdxCustomReportCellCheckImage; + function HasGlyph: Boolean; + procedure ReleaseGlyph; + + property Glyph: TBitmap read GetGlyph write SetGlyph; + property GlyphCount: Integer read FGlyphCount write SetGlyphCount; + property Items[Index: Integer]: TdxCustomReportCellCheckImage read GetItem; + property ItemsChecked[Index: Integer]: Boolean read GetItemChecked write SetItemChecked; + property ItemsEnabled[Index: Integer]: Boolean read GetItemEnabled write SetItemEnabled; + property ItemsState[Index: Integer]: TCheckBoxState read GetItemState; + end; + + TCustomdxReportCellImageContainer = class(TdxReportCellImageContainer) + private + FImage: TGraphic; + FImageIndex: Integer; + FImageList: TCustomImageList; + procedure SetImage(Value: TGraphic); + protected + function GetActualImageBuffering: TdxCellImageActualBuffering; virtual; + function GetImageBuffering: TdxCellImageBuffering; virtual; + procedure GetImageSizes(var AImageWidth, AImageHeight: Integer); override; + function HasImage: Boolean; override; + procedure SetImageBuffering(Value: TdxCellImageBuffering); virtual; + + function GetImageListIndex: Integer; + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + + property ActualImageBuffering: TdxCellImageActualBuffering read GetActualImageBuffering; + property ImageBuffering: TdxCellImageBuffering read GetImageBuffering write SetImageBuffering; + public + constructor Create(AParent: TdxReportCell); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + function CreateImage(AGraphicClass: TGraphicClass): TGraphic; virtual; + procedure DrawImage(DC: HDC); override; + + property Image: TGraphic read FImage write SetImage; + property ImageIndex: Integer read FImageIndex write FImageIndex; + property ImageList: TCustomImageList read FImageList write FImageList; + property ImageTransparent; + end; + + TdxReportCellImageClass = class of TdxReportCellImage; + + TdxReportCellImage = class(TCustomdxReportCellImageContainer) + private + function GetImageLayout: TdxImageLayout; + function GetIsTextDrawnForCenteredImage: Boolean; + function GetIsTextShiftedForHorizontallyCenteredImage: Boolean; + function GetMakeSpaceForEmptyImage: Boolean; + procedure SetImageLayout(Value: TdxImageLayout); + procedure SetIsTextDrawnForCenteredImage(Value: Boolean); + procedure SetIsTextShiftedForHorizontallyCenteredImage(Value: Boolean); + procedure SetMakeSpaceForEmptyImage(Value: Boolean); + protected + function GetHalfContentWidth(DC: HDC): Integer; + function GetImageAreaBounds(DC: HDC): TRect; override; + function GetImageBounds(DC: HDC): TRect; override; + function GetTextBounds(DC: HDC): TRect; override; + function IsImageBackgroundDrawn: Boolean; override; + function IsTextDrawn: Boolean; override; + function IsTextBackgroundDrawn: Boolean; override; + public + constructor Create(AParent: TdxReportCell); override; + procedure Assign(Source: TPersistent); override; + + function MeasureContentHeight(DC: HDC): Integer; override; + function MeasureContentWidth(DC: HDC): Integer; override; + + property ImageLayout: TdxImageLayout read GetImageLayout write SetImageLayout default ilImageCenterLeft; + property ImageTransparent; + property IsTextDrawnForCenteredImage: Boolean read GetIsTextDrawnForCenteredImage write SetIsTextDrawnForCenteredImage default False; + property IsTextShiftedForHorizontallyCenteredImage: Boolean read GetIsTextShiftedForHorizontallyCenteredImage write SetIsTextShiftedForHorizontallyCenteredImage default True; + property MakeSpaceForEmptyImage: Boolean read GetMakeSpaceForEmptyImage write SetMakeSpaceForEmptyImage default True; + end; + + TdxReportCellGraphicClass = class of TdxReportCellGraphic; + + TdxReportCellGraphic = class(TCustomdxReportCellImageContainer) + private + function GetCenter: Boolean; + function GetDrawMode: TdxGraphicDrawMode; + function GetStretch: Boolean; + procedure SetCenter(Value: Boolean); + procedure SetDrawMode(Value: TdxGraphicDrawMode); + procedure SetStretch(Value: Boolean); + protected + function GetImageBounds(DC: HDC): TRect; override; + function GetImageBuffering: TdxCellImageBuffering; override; + function GetTextBounds(DC: HDC): TRect; override; + procedure SetImageBuffering(Value: TdxCellImageBuffering); override; + public + constructor Create(AParent: TdxReportCell); override; + //procedure Assign(Source: TPersistent); override; + + function MeasureFontHeight(DC: HDC): Integer; override; + function MeasureContentHeight(DC: HDC): Integer; override; + function MeasureContentWidth(DC: HDC): Integer; override; + + property Center: Boolean read GetCenter write SetCenter; + property DrawMode: TdxGraphicDrawMode read GetDrawMode write SetDrawMode default gdmNone; + property ImageBuffering; + property ImageTransparent; + property Stretch: Boolean read GetStretch write SetStretch; + end; + + TdxReportCellExpandButtonAlignHorz = (bahLeft, bahCenter, bahRight); + TdxReportCellExpandButtonAlignVert = (bavTop, bavCenter, bavBottom); + + TdxReportCellExpandButtonClass = class of TdxReportCellExpandButton; + + TdxReportCellExpandButton = class(TAbstractdxReportCellData) + private + FButtonInteriorColor: TColor; + FButtonSize: Integer; + function GetActualButtonSize: Integer; + function GetButtonBorder3D: Boolean; + function GetButtonBorder3DSoft: Boolean; + function GetButtonBorderShadow: Boolean; + function GetButtonExpanded: Boolean; + function GetButtonTransparent: Boolean; + function GetKeepOddSize: Boolean; + function GetShowButton: Boolean; + function GetShowButtonBorder: Boolean; + function GetTreeLineMode: TdxPSTreeLineMode; + procedure SetButtonBorder3D(Value: Boolean); + procedure SetButtonBorder3DSoft(Value: Boolean); + procedure SetButtonBorderShadow(Value: Boolean); + procedure SetButtonExpanded(Value: Boolean); + procedure SetButtonTransparent(Value: Boolean); + procedure SetKeepOddSize(Value: Boolean); + procedure SetShowButton(Value: Boolean); + procedure SetShowButtonBorder(Value: Boolean); + procedure SetTreeLineMode(Value: TdxPSTreeLineMode); + protected + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); override; + + function AreTreeLinesDrawn: Boolean; + function CalculateButtonBounds: TRect; virtual; + + function GetButtonAlignHorz: TdxReportCellExpandButtonAlignHorz; virtual; + function GetButtonAlignVert: TdxReportCellExpandButtonAlignVert; virtual; + function GetButtonIndents: TRect; virtual; + procedure SetButtonAlignHorz(Value: TdxReportCellExpandButtonAlignHorz); virtual; + procedure SetButtonAlignVert(Value: TdxReportCellExpandButtonAlignVert); virtual; + + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor Create(AParent: TdxReportCell); override; + procedure Assign(Source: TPersistent); override; + + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + procedure DrawExpandButton(DC: HDC); virtual; + procedure DrawTreeLines(DC: HDC); virtual; + + function GetButtonBounds(DC: HDC): TRect; virtual; + + property ActualButtonSize: Integer read GetActualButtonSize; + property ButtonAlignHorz: TdxReportCellExpandButtonAlignHorz read GetButtonAlignHorz write SetButtonAlignHorz default bahCenter; + property ButtonAlignVert: TdxReportCellExpandButtonAlignVert read GetButtonAlignVert write SetButtonAlignVert default bavCenter; + property ButtonBorder3D: Boolean read GetButtonBorder3D write SetButtonBorder3D default False; + property ButtonBorder3DSoft: Boolean read GetButtonBorder3DSoft write SetButtonBorder3DSoft default False; + property ButtonBorderShadow: Boolean read GetButtonBorderShadow write SetButtonBorderShadow default False; + property ButtonExpanded: Boolean read GetButtonExpanded write SetButtonExpanded default False; + property ButtonIndents: TRect read GetButtonIndents; + property ButtonInteriorColor: TColor read FButtonInteriorColor write FButtonInteriorColor default clNone; + property ButtonSize: Integer read FButtonSize write FButtonSize default 9; + property ButtonTransparent: Boolean read GetButtonTransparent write SetButtonTransparent default True; + property KeepOddSize: Boolean read GetKeepOddSize write SetKeepOddSize default True; + property ShowButton: Boolean read GetShowButton write SetShowButton default False; + property ShowButtonBorder: Boolean read GetShowButtonBorder write SetShowButtonBorder default True; + property TreeLineMode: TdxPSTreeLineMode read GetTreeLineMode write SetTreeLineMode default tlmNone; + end; + + TdxReportCellExpandButtonEx = class(TdxReportCellExpandButton) + private + FFormatEx: DWORD; + protected + function GetButtonAlignHorz: TdxReportCellExpandButtonAlignHorz; override; + function GetButtonAlignVert: TdxReportCellExpandButtonAlignVert; override; + function GetButtonIndents: TRect; override; + procedure SetButtonAlignHorz(Value: TdxReportCellExpandButtonAlignHorz); override; + procedure SetButtonAlignVert(Value: TdxReportCellExpandButtonAlignVert); override; + + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + + property FormatEx: DWORD read FFormatEx write FFormatEx; + end; + + { Explorer } + + TdxPSExplorerRefreshStage = (ersBefore, ersAfter); + + TCustomdxPSExplorerItemStateInfo = record + Count: Integer; + UniqueIDSize: Integer; + // UniqueID: TBytes follows by UniqueIDSize with Length UniqueIDSize + end; + + TCustomdxPSExplorer = class; + TCustomdxPSExplorerItem = class; + TdxPSExplorerFolder = class; + TdxPSExplorerItem = class; + + + IdxPSExplorerTreeContainerHost = interface + ['{4E52E062-EDCF-4A58-8212-45EAE673F506}'] + function GetFlat: Boolean; + function GetReportLink: TBasedxReportLink; + function GetTreeContainerParent: TWinControl; + + procedure UpdateState; + + property Flat: Boolean read GetFlat; + property ReportLink: TBasedxReportLink read GetReportLink; + property TreeContainerParent: TWinControl read GetTreeContainerParent; + end; + + + TdxPSExplorerChangeNotifier = class + private + FExplorer: TCustomdxPSExplorer; + procedure SetExplorer(Value: TCustomdxPSExplorer); + protected + procedure ExplorerRefresh(AStage: TdxPSExplorerRefreshStage); virtual; abstract; + procedure FolderPopulated(AFolder: TdxPSExplorerFolder); virtual; abstract; + procedure ItemAdded(AnItem: TCustomdxPSExplorerItem); virtual; abstract; + procedure ItemDataLoaded(AnItem: TdxPSExplorerItem); virtual; abstract; + procedure ItemDataUnloaded(AnItem: TdxPSExplorerItem); virtual; abstract; + procedure ItemDeleted(AnItem: TCustomdxPSExplorerItem); virtual; abstract; + procedure ItemParentChanged(AnItem: TCustomdxPSExplorerItem); virtual; abstract; + procedure ItemPropertiesChanged(AnItem: TCustomdxPSExplorerItem); virtual; abstract; + procedure ItemRenamed(AnItem: TCustomdxPSExplorerItem); virtual; abstract; + public + constructor Create(AnExplorer: TCustomdxPSExplorer); + destructor Destroy; override; + + property Explorer: TCustomdxPSExplorer read FExplorer write SetExplorer; + end; + + TdxPSExplorerChangeNotifierAdapter = class(TdxPSExplorerChangeNotifier) + protected + procedure ExplorerRefresh(AStage: TdxPSExplorerRefreshStage); override; + procedure FolderPopulated(AFolder: TdxPSExplorerFolder); override; + procedure ItemAdded(AnItem: TCustomdxPSExplorerItem); override; + procedure ItemDataLoaded(AnItem: TdxPSExplorerItem); override; + procedure ItemDataUnloaded(AnItem: TdxPSExplorerItem); override; + procedure ItemDeleted(AnItem: TCustomdxPSExplorerItem); override; + procedure ItemParentChanged(AnItem: TCustomdxPSExplorerItem); override; + procedure ItemPropertiesChanged(AnItem: TCustomdxPSExplorerItem); override; + procedure ItemRenamed(AnItem: TCustomdxPSExplorerItem); override; + end; + + TdxPSExplorerTreeChangeNotifier = class(TdxPSExplorerChangeNotifierAdapter) + private + FTreeContainer: TCustomdxPSExplorerTreeContainer; + protected + procedure ExplorerRefresh(AStage: TdxPSExplorerRefreshStage); override; + procedure FolderPopulated(AFolder: TdxPSExplorerFolder); override; + procedure ItemAdded(AnItem: TCustomdxPSExplorerItem); override; + procedure ItemDataLoaded(AnItem: TdxPSExplorerItem); override; + procedure ItemDataUnloaded(AnItem: TdxPSExplorerItem); override; + procedure ItemDeleted(AnItem: TCustomdxPSExplorerItem); override; + procedure ItemParentChanged(AnItem: TCustomdxPSExplorerItem); override; + procedure ItemPropertiesChanged(AnItem: TCustomdxPSExplorerItem); override; + procedure ItemRenamed(AnItem: TCustomdxPSExplorerItem); override; + public + constructor Create(ATreeContainer: TCustomdxPSExplorerTreeContainer; ARegister: Boolean = True); + property TreeContainer: TCustomdxPSExplorerTreeContainer read FTreeContainer; + end; + + TCustomdxPSExplorerTreeContainerClass = class of TCustomdxPSExplorerTreeContainer; + + TCustomdxPSExplorerTreeContainer = class + private + FControl: TWinControl; + FChangeNotifier: TdxPSExplorerTreeChangeNotifier; + FExplorer: TCustomdxPSExplorer; + FHost: IdxPSExplorerTreeContainerHost; + protected + { Next virtual (abstract) methods must be overriden in descendants } + procedure AddItem(AParent: TdxPSExplorerFolder; AnItem: TCustomdxPSExplorerItem); virtual; abstract; + procedure Clear; virtual; abstract; + procedure DeleteItem(AnItem: TCustomdxPSExplorerItem); virtual; + procedure InvalidateItem(AnItem: TCustomdxPSExplorerItem); virtual; + procedure MoveItem(AnItem: TCustomdxPSExplorerItem); virtual; abstract; + procedure RenameItem(AnItem: TCustomdxPSExplorerItem); virtual; abstract; + + function GetCreationParent: TdxPSExplorerFolder; virtual; abstract; + function GetFocusedItem: TCustomdxPSExplorerItem; virtual; abstract; + function GetIsEditing: Boolean; virtual; abstract; + function GetIsFolderSelected: Boolean; virtual; abstract; + function GetIsItemSelected: Boolean; virtual; abstract; + function GetIsRootSelected: Boolean; virtual; abstract; + function GetSelectedFolder: TdxPSExplorerFolder; virtual; abstract; + function GetSelectedItem: TCustomdxPSExplorerItem; virtual; abstract; + function GetSelectedItemText: string; virtual; abstract; + procedure SetFocusedItem(Value: TCustomdxPSExplorerItem); virtual; abstract; + procedure SetSelectedItem(Value: TCustomdxPSExplorerItem); virtual; abstract; + procedure SetSelectedItemText(const Value: string); virtual; abstract; + + procedure RestoreState; virtual; + procedure SaveState; virtual; + + procedure CreateTreeContainer; + procedure InitializeTreeContainer; virtual; + procedure ProcessKeyDown(var Key: Word; Shift: TShiftState); virtual; + procedure ProcessKeyPress(var Key: Char); virtual; + + property ChangeNotifier: TdxPSExplorerTreeChangeNotifier read FChangeNotifier; + property Host: IdxPSExplorerTreeContainerHost read FHost; + public + constructor Create(AnExplorer: TCustomdxPSExplorer; AHost: IdxPSExplorerTreeContainerHost); virtual; + destructor Destroy; override; + + class function ControlClass: TWinControlClass; virtual; + class procedure Register; + class procedure Unregister; + + procedure BeginUpdate; virtual; + procedure EndUpdate; virtual; + + { Follow virtual (abstract) methods must be overriden in descendants } + function BeginEdit(AnImmediate: Boolean = True): Boolean; virtual; abstract; + procedure EndEdit(ACancel: Boolean); virtual; abstract; + + procedure CollapseItem(AnItem: TCustomdxPSExplorerItem; ARecursive: Boolean = False); virtual; abstract; + procedure ExpandItem(AnItem: TCustomdxPSExplorerItem; ARecursive: Boolean = False); virtual; abstract; + procedure MakeItemVisible(AnItem: TCustomdxPSExplorerItem); virtual; abstract; + + function CanCreateFolder: Boolean; virtual; + function CanCreateItem: Boolean; virtual; + function CanDeleteSelection: Boolean; virtual; + function CanLoadSelectedItemData: Boolean; virtual; + function CanRefresh: Boolean; virtual; + function CanRenameSelectedItem: Boolean; virtual; + function CanShowPropertySheetsForSelectedItem: Boolean; virtual; + function CanUnloadItemData: Boolean; virtual; + function CreateItem: TdxPSExplorerItem; virtual; + procedure DeleteSelection(AShowMessage: Boolean = True); virtual; + function IsSelectedItemCurrentlyLoaded: Boolean; + procedure LoadSelectedItemData; virtual; + procedure RenameSelectedItem; virtual; + function ShowSelectedItemPropertySheets: Boolean; + procedure UnloadItemData; virtual; + + { Follow abstract methods must be overriden in descendants } + function GetDropTarget(X, Y: Integer): TdxPSExplorerFolder; virtual; abstract; + function GetItemAt(X, Y: Integer): TCustomdxPSExplorerItem; virtual; abstract; + + function CanFocus: Boolean; virtual; + procedure SetFocus; virtual; + + procedure RefreshSorting(ANode: TObject); overload; virtual; + procedure RefreshSorting(AFolder: TdxPSExplorerFolder); overload; virtual; + + property Control: TWinControl read FControl; + property CreationParent: TdxPSExplorerFolder read GetCreationParent; + property Explorer: TCustomdxPSExplorer read FExplorer; + property FocusedItem: TCustomdxPSExplorerItem read GetFocusedItem write SetFocusedItem; + property IsEditing: Boolean read GetIsEditing; + property IsFolderSelected: Boolean read GetIsFolderSelected; + property IsItemSelected: Boolean read GetIsItemSelected; + property IsRootSelected: Boolean read GetIsRootSelected; + property SelectedFolder: TdxPSExplorerFolder read GetSelectedFolder; + property SelectedItem: TCustomdxPSExplorerItem read GetSelectedItem write SetSelectedItem; + property SelectedItemText: string read GetSelectedItemText write SetSelectedItemText; + end; + + TdxPSExplorerTreeBuilderClass = class of TdxPSExplorerTreeBuilder; + + TdxPSExplorerTreeBuilder = class + protected + class procedure BuildTree(AnExplorer: TCustomdxPSExplorer; + ATreeContainer: TCustomdxPSExplorerTreeContainer); virtual; + class procedure CreateFolderNode(ATreeContainer: TCustomdxPSExplorerTreeContainer; + AParent, AFolder: TdxPSExplorerFolder); virtual; + class procedure CreateItemNode(ATreeContainer: TCustomdxPSExplorerTreeContainer; + AParent: TdxPSExplorerFolder; AnItem: TCustomdxPSExplorerItem); virtual; + class procedure PopulateTreeFolder(ATreeContainer: TCustomdxPSExplorerTreeContainer; + AFolder: TdxPSExplorerFolder); virtual; + public + class procedure Register; + class procedure Unregister; + end; + + TdxPSStreamMode = (smRead, smWrite, smReadWrite); + + TCustomdxPSExplorerItemPropertySheetsClass = class of TCustomdxPSExplorerItemPropertySheets; + + TCustomdxPSExplorerItemPropertySheets = class(TCustomdxPSForm) + private + FExplorerItem: TCustomdxPSExplorerItem; + class function FormClass: TCustomdxPSExplorerItemPropertySheetsClass; + protected + procedure Done; virtual; + procedure Initialize; virtual; + public + constructor CreateEx(AnExplorerItem: TCustomdxPSExplorerItem); virtual; + + class function Execute(AnExplorerItem: TCustomdxPSExplorerItem): Boolean; + function ExplorerItem: TCustomdxPSExplorerItem; overload; virtual; + end; + + TCustomdxPSExplorerItemComparator = class + public + class function CompareItems(AnItem1, AnItem2: Pointer): Integer; + end; + + TCustomdxPSExplorerItemHelper = class + public + class function GetHasChildren(AFolder: TdxPSExplorerFolder): Boolean; virtual; + class function GetImageIndex(AnItem: TCustomdxPSExplorerItem): Integer; virtual; + class function GetSelectedIndex(AnItem: TCustomdxPSExplorerItem): Integer; virtual; + class procedure SetHasChildren(AFolder: TdxPSExplorerFolder; Value: Boolean); virtual; + end; + + TCustomdxPSExplorerItemClass = class of TCustomdxPSExplorerItem; + + TCustomdxPSExplorerItem = class + private + FExplorer: TCustomdxPSExplorer; + FName: string; + FParent: TdxPSExplorerFolder; + FWindowHandle: HWND; + procedure SetParent(Value: TdxPSExplorerFolder); + protected + function CompareTo(AnItem: TCustomdxPSExplorerItem): Integer; virtual; + + function DoDelete: Boolean; virtual; + function DoMove(AParent: TdxPSExplorerFolder): Boolean; virtual; + function DoRename(var ANewName: string): Boolean; virtual; + + function GetDisplayName: string; virtual; + function GetImageIndex: Integer; virtual; + function GetInfoTip: string; virtual; + function GetNewName(AReportLink: TBasedxReportLink): string; virtual; + function GetSelectedIndex: Integer; virtual; + + procedure InternalDelete; virtual; + procedure InternalMove(AParent: TdxPSExplorerFolder); virtual; + procedure InternalRename(const AName: string); virtual; + procedure SetName(const Value: string); virtual; + + function GetItemStateInfo: TCustomdxPSExplorerItemStateInfo; virtual; + procedure WriteState(AStream: TStream); virtual; + + procedure WndProc(var Message: TMessage); virtual; + public + constructor Create(AnExplorer: TCustomdxPSExplorer; AParent: TdxPSExplorerFolder); virtual; + destructor Destroy; override; + + function Explorer: TCustomdxPSExplorer; overload; virtual; + + function CanAccept(AnItem: TCustomdxPSExplorerItem): Boolean; virtual; + function CanDelete: Boolean; virtual; + function CanMove: Boolean; virtual; + function CanMoveTo(AParent: TCustomdxPSExplorerItem): Boolean; overload; virtual; + function CanRename: Boolean; virtual; + function CanRenameTo(const AName: string): Boolean; virtual; + procedure Delete; virtual; + function GetUniqueID(out AnUniqueID: TBytes): Integer; virtual; // returns Length of needed memory + function HasAsParent(AnItem: TCustomdxPSExplorerItem): Boolean; + function IsNameChanged(const ANewName: string): Boolean; virtual; + + class function HasPropertySheets: Boolean; + class function PropertySheetsClass: TCustomdxPSExplorerItemPropertySheetsClass; virtual; + function ShowPropertySheets: Boolean; + + function CannotRenameMessageText(const AOldName, ANewName: string): string; virtual; + function DeleteMessageText: string; virtual; + function OverwriteMessageText(Dest: TCustomdxPSExplorerItem): string; virtual; + + property DisplayName: string read GetDisplayName; + property InfoTip: string read GetInfoTip; + property Name: string read FName write SetName; + property Parent: TdxPSExplorerFolder read FParent write SetParent; + end; + + TdxPSExplorerFolderHelper = class(TCustomdxPSExplorerItemHelper) + public + class function GetHasChildren(AFolder: TdxPSExplorerFolder): Boolean; override; + class procedure SetHasChildren(AFolder: TdxPSExplorerFolder; Value: Boolean); override; + end; + + TdxPSExplorerFolderClass = class of TdxPSExplorerFolder; + + TdxPSExplorerFolder = class(TCustomdxPSExplorerItem) + private + FFolders: TList; + FHasChildren: Boolean; + FItems: TList; + function GetFolder(Index: Integer): TdxPSExplorerFolder; + function GetFolderCount: Integer; + function GetHasChildren: Boolean; + function GetIsRoot: Boolean; + function GetItem(Index: Integer): TdxPSExplorerItem; + function GetItemCount: Integer; + function GetItemList(AnItem: TCustomdxPSExplorerItem): TList; overload; + function GetItemList(AnItemClass: TCustomdxPSExplorerItemClass): TList; overload; + procedure SetHasChildren(Value: Boolean); + protected + function CompareTo(AnItem: TCustomdxPSExplorerItem): Integer; override; + function GetImageIndex: Integer; override; + function GetNewName(AReportLink: TBasedxReportLink): string; override; + function GetSelectedIndex: Integer; override; + + function GetItemStateInfo: TCustomdxPSExplorerItemStateInfo; override; + procedure WriteState(AStream: TStream); override; + + procedure LoadData; virtual; + + procedure Add(AnItem: TCustomdxPSExplorerItem); + procedure Remove(AnItem: TCustomdxPSExplorerItem); + + procedure FreeAndNilFolders; + procedure FreeAndNilItems; + + property HasChildren: Boolean read GetHasChildren write SetHasChildren; + public + constructor Create(AnExplorer: TCustomdxPSExplorer; AParent: TdxPSExplorerFolder); override; + destructor Destroy; override; + + function CanAccept(AnItem: TCustomdxPSExplorerItem): Boolean; override; + function CanRenameTo(const AName: string): Boolean; override; + function CreateFolder: TdxPSExplorerFolder; virtual; + function CreateItem(AReportLink: TBasedxReportLink): TdxPSExplorerItem; virtual; + procedure Populate; + + procedure Delete; override; + procedure DeleteFolders; virtual; + procedure DeleteItems; virtual; + + function HasFolders: Boolean; virtual; + function HasItems: Boolean; virtual; + function HasLoadedItem: Boolean; virtual; + + function FolderByName(const AName: string): TdxPSExplorerFolder; virtual; + function ItemByName(const AName: string): TdxPSExplorerItem; virtual; + + function CannotRenameMessageText(const AOldName, ANewName: string): string; override; + function DeleteMessageText: string; override; + function OverwriteMessageText(Dest: TCustomdxPSExplorerItem): string; override; + + property FolderCount: Integer read GetFolderCount; + property Folders[Index: Integer]: TdxPSExplorerFolder read GetFolder; default; + property IsRoot: Boolean read GetIsRoot; + property ItemCount: Integer read GetItemCount; + property Items[Index: Integer]: TdxPSExplorerItem read GetItem; + end; + + TdxPSExplorerItemClass = class of TdxPSExplorerItem; + + TdxPSExplorerItem = class(TCustomdxPSExplorerItem) + private + FHasInvalidData: Boolean; + FReportDocument: TdxPSReportDocument; + function GetIsCurrentlyLoaded: Boolean; + procedure SetHasInvalidData(Value: Boolean); + protected + function CompareTo(AnItem: TCustomdxPSExplorerItem): Integer; override; + function DoDelete: Boolean; override; + function GetFormCaption: string; virtual; + function GetImageIndex: Integer; override; + function GetInfoTip: string; override; + function GetNewName(AReportLink: TBasedxReportLink): string; override; + function GetSelectedIndex: Integer; override; + procedure InternalDelete; override; + + procedure DocumentChanged(Sender: TObject); virtual; + procedure SaveDocument; virtual; + + procedure SetReportData(AReportLink: TBasedxReportLink); virtual; + + property FormCaption: string read GetFormCaption; + public + constructor Create(AnExplorer: TCustomdxPSExplorer; AParent: TdxPSExplorerFolder); override; + destructor Destroy; override; + + function CanLoadData: Boolean; virtual; + function CanRenameTo(const AName: string): Boolean; override; + + function CannotRenameMessageText(const AOldName, ANewName: string): string; override; + function DataLoadErrorText: string; virtual; + function DeleteMessageText: string; override; + function OverwriteMessageText(Dest: TCustomdxPSExplorerItem): string; override; + + function CreateDataStream(AMode: TdxPSStreamMode): TStream; virtual; + procedure RetrieveReportData(AReportLink: TBasedxReportLink); virtual; + + function IsLoading: Boolean; virtual; + procedure Load(AReportLink: TBasedxReportLink); + procedure Unload; + + class function PropertySheetsClass: TCustomdxPSExplorerItemPropertySheetsClass; override; + + property HasInvalidData: Boolean read FHasInvalidData write SetHasInvalidData; + property IsCurrentlyLoaded: Boolean read GetIsCurrentlyLoaded; + property ReportDocument: TdxPSReportDocument read FReportDocument; + end; + + TCustomdxPSExplorerContextCommandClass = class of TCustomdxPSExplorerContextCommand; + + TCustomdxPSExplorerContextCommand = class(TPersistent) + private + FBitmap: TBitmap; + FCaption: string; + FData: Integer; + FExplorer: TCustomdxPSExplorer; + FHint: string; + FShortCut: TShortCut; + procedure SetBitmap(Value: TBitmap); + public + constructor Create(AnExplorer: TCustomdxPSExplorer); virtual; + destructor Destroy; override; + + function Enabled: Boolean; virtual; + procedure Execute; virtual; + + function Explorer: TCustomdxPSExplorer; overload; virtual; + + property Bitmap: TBitmap read FBitmap write SetBitmap; + property Caption: string read FCaption write FCaption; + property Data: Integer read FData Write FData; + property Hint: string read FHint write FHint; + property ShortCut: TShortCut read FShortCut write FShortCut; + end; + + TdxPSExplorerContextCommandSeparator = class(TCustomdxPSExplorerContextCommand) + public + constructor Create(AnExplorer: TCustomdxPSExplorer); override; + function Enabled: Boolean; override; + end; + + TdxPSExplorerRefreshContextCommand = class(TCustomdxPSExplorerContextCommand) + public + constructor Create(AnExplorer: TCustomdxPSExplorer); override; + procedure Execute; override; + end; + + TdxPSExplorerState = (esItemCreating, esFolderCreating, esLoading, esRefreshing); + TdxPSExplorerStates = set of TdxPSExplorerState; + + TdxPSExplorerItemDataLoadErrorEvent = procedure(Sender: TCustomdxPSExplorer; + AnItem: TdxPSExplorerItem; var AShowErrorMessage: Boolean; var AText: string) of object; + + TdxPSExplorerClass = class of TCustomdxPSExplorer; + + TCustomdxPSExplorer = class(TComponent, {$IFNDEF DELPHI6} IUnknown, {$ENDIF} + IdxPSExplorerContextCommands, IdxPSExplorerContextCommands2) + private + FActiveFolder: TdxPSExplorerFolder; + FCommands: TList; + FFilterLinkClass: TComponentClass; + FLoadedItem: TdxPSExplorerItem; + FLoadingCounter: Integer; + FLockCounter: Integer; + FNotifiers: TList; + FRefreshCounter: Integer; + FRoot: TdxPSExplorerFolder; + FState: TdxPSExplorerStates; + FStateStream: TStream; + FOnItemDataLoadError: TdxPSExplorerItemDataLoadErrorEvent; + function GetCommand(Index: Integer): TCustomdxPSExplorerContextCommand; + function GetCommandCount: Integer; + function GetFilterLink: string; + function GetNotifier(Index: Integer): TdxPSExplorerChangeNotifier; + function GetNotifierCount: Integer; + function GetRoot: TdxPSExplorerFolder; + procedure SetFilterLink(const Value: string); + protected + {$IFNDEF DELPHI6} + { IUnknown } + function QueryInterface(const IID: TGUID; out Obj): HRESULT; override; + function _Addref: Integer; stdcall; + function _Release: Integer; stdcall; + {$ENDIF} + + { IdxPSExplorerContextCommands } + procedure BuildCommandSet(ABuilder: IdxPSExplorerContextCommandBuilder); virtual; + { IdxPSExplorerContextCommands2 } + procedure FinalizeCommand(ACommand: TCustomdxPSExplorerContextCommand); virtual; + procedure InitializeCommand(ACommand: TCustomdxPSExplorerContextCommand); virtual; + + function AddCommand(ACommandClass: TCustomdxPSExplorerContextCommandClass): TCustomdxPSExplorerContextCommand; + function AddCommandSeparator: TdxPSExplorerContextCommandSeparator; + procedure ClearCommands; + function CreateCommand(ACommandClass: TCustomdxPSExplorerContextCommandClass): TCustomdxPSExplorerContextCommand; + function CreateCommandSeparator: TdxPSExplorerContextCommandSeparator; + function FindCommand(ACommandClass: TCustomdxPSExplorerContextCommandClass): TCustomdxPSExplorerContextCommand; + procedure FreeAndNilCommands; + + class function AcceptItemNameChar(AnItem: TCustomdxPSExplorerItem; Ch: Char): Boolean; virtual; + function CreateItemDataStream(AnItem: TdxPSExplorerItem; AMode: TdxPSStreamMode): TStream; virtual; abstract; + class function GetFolderClass: TdxPSExplorerFolderClass; virtual; + class function GetItemClass: TdxPSExplorerItemClass; virtual; + class function GetRootFolderClass: TdxPSExplorerFolderClass; virtual; + function GetRootDisplayName: string; virtual; + procedure LoadData(AFolder: TdxPSExplorerFolder); + + function CanDelete(AnItem: TCustomdxPSExplorerItem): Boolean; virtual; + function CanMove(AnItem: TCustomdxPSExplorerItem): Boolean; virtual; + function CanMoveTo(AnItem, AParent: TCustomdxPSExplorerItem): Boolean; virtual; + function CanRename(AnItem: TCustomdxPSExplorerItem): Boolean; virtual; + function CanRenameTo(AnItem: TCustomdxPSExplorerItem; const AName: string): Boolean; virtual; + procedure Delete(AnItem: TCustomdxPSExplorerItem); virtual; + procedure MoveTo(AnItem: TCustomdxPSExplorerItem; AParent: TdxPSExplorerFolder); virtual; + procedure PopulateFolder(AFolder: TdxPSExplorerFolder); virtual; + procedure RenameTo(AnItem: TCustomdxPSExplorerItem; AName: string); virtual; + + procedure AfterRefresh; + procedure BeforeRefresh; + procedure DoRefresh; virtual; + procedure RootNeeded; + + procedure DoItemDataLoadError(AnItem: TdxPSExplorerItem); dynamic; + procedure DoLoadData(AFolder: TdxPSExplorerFolder); virtual; abstract; + procedure InternalSetLoadedItem(Value: TdxPSExplorerItem); + + procedure PopulateTreeFolder(ATreeContainer: TCustomdxPSExplorerTreeContainer; AFolder: TdxPSExplorerFolder); + + procedure LoadState; + procedure SaveState; + + procedure NotifyFolderPopulated(AFolder: TdxPSExplorerFolder); + procedure NotifyItemAdded(AnItem: TCustomdxPSExplorerItem); + procedure NotifyItemDataLoaded(AnItem: TdxPSExplorerItem); + procedure NotifyItemDataUnloaded(AnItem: TdxPSExplorerItem); + procedure NotifyItemDeleted(AnItem: TCustomdxPSExplorerItem); + procedure NotifyItemParentChanged(AnItem: TCustomdxPSExplorerItem); + procedure NotifyItemPropertiesChanged(AnItem: TCustomdxPSExplorerItem); + procedure NotifyItemRenamed(AnItem: TCustomdxPSExplorerItem); + procedure NotifyRefresh(AStage: TdxPSExplorerRefreshStage); + + function AreNotificationsLocked: Boolean; + function IndexOfNotifier(ANotifier: TdxPSExplorerChangeNotifier): Integer; + procedure LockNotifications; + procedure ReleaseAndNilNotifiers; + procedure UnlockNotifications; + + procedure BeginLoading; + procedure EndLoading; + function IsLoading: Boolean; + + property CommandCount: Integer read GetCommandCount; + property Commands[Index: Integer]: TCustomdxPSExplorerContextCommand read GetCommand; + property NotifierCount: Integer read GetNotifierCount; + property Notifiers[Index: Integer]: TdxPSExplorerChangeNotifier read GetNotifier; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + function LoadedItem: TdxPSExplorerItem; overload; virtual; + + function CanCreateFolder: Boolean; virtual; + function CanCreateItem: Boolean; virtual; + function CreateNewFolder(AParent: TdxPSExplorerFolder): TdxPSExplorerFolder; virtual; + function CreateNewItem(AParent: TdxPSExplorerFolder; AReportLink: TBasedxReportLink): TdxPSExplorerItem; virtual; + + procedure BuildTree(ATreeContainer: TCustomdxPSExplorerTreeContainer); + function CreateTree(const AHost: IdxPSExplorerTreeContainerHost): TCustomdxPSExplorerTreeContainer; + + function FindCustomItemByUniqueID(const AnUniqueID: TBytes): TCustomdxPSExplorerItem; virtual; + procedure LoadItemData(AnItem: TdxPSExplorerItem; AReportLink: TBasedxReportLink); overload; + procedure UnloadItemData(AnItem: TdxPSExplorerItem); overload; + procedure Refresh; virtual; + + procedure RegisterNotifier(ANotifier: TdxPSExplorerChangeNotifier); + procedure UnregisterNotifier(ANotifier: TdxPSExplorerChangeNotifier); + + property ActiveFolder: TdxPSExplorerFolder read FActiveFolder Write FActiveFolder; + property FilterLinkClass: TComponentClass read FFilterLinkClass write FFilterLinkClass; + property Root: TdxPSExplorerFolder read GetRoot; + property State: TdxPSExplorerStates read FState; + published + property FilterLink: string read GetFilterLink write SetFilterLink; + property OnItemDataLoadError: TdxPSExplorerItemDataLoadErrorEvent read FOnItemDataLoadError write FOnItemDataLoadError; + end; + + TdxReportFootNoteMode = (fnmNone, fnmOnLastPage, fnmOnEveryBottomPage); + TdxReportTitleMode = (tmNone, tmOnFirstPage, tmOnEveryTopPage); + + TdxReportTitle = class(TPersistent) + private + FAdjustOnReportScale: Boolean; + FColor: TColor; + FDefaultFont: TFont; + FFont: TFont; + FLockCalcViewInfos: Boolean; + FMode: TdxReportTitleMode; + FReportLink: TBasedxReportLink; + FText: string; + FTextAlignX: TdxTextAlignX; + FTextAlignY: TdxTextAlignY; + FTransparent: Boolean; + FUpdateCount: Integer; + function IsFontStored: Boolean; + procedure SetAdjustOnReportScale(Value: Boolean); + procedure SetColor(Value: TColor); + procedure SetFont(Value: TFont); + procedure SetMode(Value: TdxReportTitleMode); + procedure SetText(const Value: string); + procedure SetTextAlignX(Value: TdxTextAlignX); + procedure SetTextAlignY(Value: TdxTextAlignY); + procedure SetTransparent(Value: Boolean); + + procedure CalculateRenderInfos; + procedure FontChanged(Sender: TObject); + protected + procedure DoRestoreDefaults; virtual; + procedure InitializeDefaultFont(AFont: TFont); virtual; + + procedure ReadData(AReader: TdxPSDataReader); virtual; + procedure WriteData(AWriter: TdxPSDataWriter); virtual; + + property LockCalcViewInfos: Boolean read FLockCalcViewInfos; + public + constructor Create(AReportLink: TBasedxReportLink); + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + procedure BeginUpdate; + procedure CancelUpdate; + procedure EndUpdate; + + function DefaultFont: TFont; virtual; + procedure RestoreDefaults; + + property ReportLink: TBasedxReportLink read FReportLink; + published + property AdjustOnReportScale: Boolean read FAdjustOnReportScale write SetAdjustOnReportScale default False; + property Color: TColor read FColor write SetColor default clWhite; + property Font: TFont read FFont write SetFont stored IsFontStored; + property Mode: TdxReportTitleMode read FMode write SetMode default tmOnEveryTopPage; + property Text: string read FText write SetText; + property TextAlignX: TdxTextAlignX read FTextAlignX write SetTextAlignX default taCenterX; + property TextAlignY: TdxTextAlignY read FTextAlignY write SetTextAlignY default taCenterY; + property Transparent: Boolean read FTransparent write SetTransparent default True; + end; + + TdxPSReportDocumentClass = class of TdxPSReportDocument; + + TdxPSReportDocument = class(TPersistent) + private + FCaption: string; + FCreationDate: TDateTime; + FCreator: string; + FDescription: string; + FIsCaptionAssigned: Boolean; + FIsCreatorAssigned: Boolean; + FIsDescriptionAssigned: Boolean; + FPreview: TMetafile; + FReportLink: TBasedxReportLink; + FUpdateCount: Integer; + FOnChanged: TNotifyEvent; + function GetCaption: string; + function GetCreator: string; + function GetDescription: string; + function IsCaptionStored: Boolean; + function IsCreatorStored: Boolean; + function IsDesciptionStored: Boolean; + procedure SetCaption(const Value: string); + procedure SetCreationDate(const Value: TDateTime); + procedure SetCreator(const Value: string); + procedure SetDescription(const Value: string); + + procedure ReadIsCaptionAssigned(Reader: TReader); + procedure ReadIsCreatorAssigned(Reader: TReader); + procedure ReadIsDescriptionAssigned(Reader: TReader); + procedure WriteIsCaptionAssigned(Writer: TWriter); + procedure WriteIsCreatorAssigned(Writer: TWriter); + procedure WriteIsDescriptionAssigned(Writer: TWriter); + protected + procedure DefineProperties(Filer: TFiler); override; + + procedure Changed; virtual; + procedure DoAssign(Source: TdxPSReportDocument); virtual; + procedure DoRestoreDefaults; virtual; + function GetInfoTip: string; virtual; + + procedure ReadData(AReader: TdxPSDataReader); virtual; + procedure WriteData(AWriter: TdxPSDataWriter); virtual; + + property UpdateCount: Integer read FUpdateCount write FUpdateCount; + public + constructor Create(AReportLink: TBasedxReportLink); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + procedure BeginUpdate; + procedure CancelUpdate; + procedure EndUpdate; + function IsUpdateLocked: Boolean; + + function DefaultCaption: string; virtual; + function DefaultCreator: string; virtual; + function DefaultDescription: string; virtual; + + procedure RestoreDefaults; + procedure RetrievePreview; virtual; + + property InfoTip: string read GetInfoTip; + property Preview: TMetafile read FPreview; + property ReportLink: TBasedxReportLink read FReportLink; + + property OnChanged: TNotifyEvent read FOnChanged write FOnChanged; + published + property Caption: string read GetCaption write SetCaption stored IsCaptionStored; + property CreationDate: TDateTime read FCreationDate write SetCreationDate; + property Creator: string read GetCreator write SetCreator stored IsCreatorStored; + property Description: string read GetDescription write SetDescription stored IsDesciptionStored; + end; + + TdxPSDataStorageOffsetTableClass = class of TdxPSDataStorageOffsetTable; + + TdxPSDataStorageOffsetTable = class + protected + procedure DoAssign(Source: TdxPSDataStorageOffsetTable); virtual; + public + Information: Longint; + Document: Longint; + Title: Longint; + Data: Longint; + Reserved1: Longint; + Reserved2: Longint; + Reserved3: Longint; + Reserved4: Longint; + constructor Create(ATemplate: TdxPSDataStorageOffsetTable = nil); virtual; + procedure Assign(Source: TdxPSDataStorageOffsetTable); virtual; + procedure Clear; virtual; + procedure ReadData(AReader: TdxPSDataReader); virtual; + procedure WriteData(AWriter: TdxPSDataWriter); virtual; + end; + PdxPSDataStorageOffsetTable = TdxPSDataStorageOffsetTable; // for backward compatibility + + TdxPSDataStorageInfoClass = class of TdxPSDataStorageInfo; + + TdxPSDataStorageInfo = class + public + StorageVersion: Integer; + PrintingSystemVersion: TdxPSVersion; + LinkClassName: string[255]; + ComponentClassName: string[255]; + LinkClass: TdxReportLinkClass; + ComponentClass: TComponentClass; + constructor Create(AReportLink: TBasedxReportLink); virtual; + procedure ReadData(AReader: TdxPSDataReader); virtual; + procedure WriteData(AWriter: TdxPSDataWriter); virtual; + end; + PdxPSDataStorageInfo = TdxPSDataStorageInfo; // for backward compatibility + + TdxAssignedFormatValue = (fvDate, fvTime, fvPageNumber); + TdxAssignedFormatValues = set of TdxAssignedFormatValue; + + TdxReportLinkState = (rlsDataLoading, rlsDataSaving); + TdxReportLinkStates = set of TdxReportLinkState; + + TdxReportLinkDataSource = (rldsComponent, rldsExternalStorage); + + TdxCustomDrawReportLinkTitleEvent = procedure(Sender: TBasedxReportLink; + ACanvas: TCanvas; ARect: TRect; ANom, ADenom: Integer; + var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var AColor: TColor; AFont: TFont; var ADone: Boolean) of object; + + TdxCustomDrawReportLinkHFEvent = procedure(Sender: TObject; ACanvas: TCanvas; + APageIndex: Integer; var ARect: TRect; ANom, ADenom: Integer; + var ADefaultDrawText, ADefaultDrawBackground: Boolean) of object; + + TdxFilterStyleEvent = procedure(Sender: TBasedxReportLink; + AStyle: TBasedxPrintStyle; var ASupported: Boolean) of object; + + TdxMeasureReportLinkTitleEvent = procedure(Sender: TBasedxReportLink; + var AHeight: Integer) of object; + + TdxPSGetImageListProc = procedure(AnImageList: TCustomImageList) of object; + + + IdxPSNativeWin32ControlHandleSupport = interface + ['{4B649281-A283-4CAC-98D4-08E779A7F9C8}'] + function GetNativeHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; + procedure SetNativeHandle(Value: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}); + property NativeHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF} read GetNativeHandle write SetNativeHandle; + end; + + + TBasedxReportLink = class(TComponent {$IFNDEF DELPHI6}, IUnknown {$ENDIF}) + private + FActive: Boolean; + FAssignedFormatValues: TdxAssignedFormatValues; + FBuiltIn: Boolean; + FComponent: TComponent; + FComponentPrinter: TCustomdxComponentPrinter; + FController: TBasedxReportLink; + FCurrentPage: Integer; + FData: Pointer; + FDateFormat: Integer; + FDataSource: TdxReportLinkDataSource; + FDataStream: TStream; + FDefaultFont: TFont; + FDesignerCaption: string; + FDesignerHelpContext: THelpContext; + FDesignWindow: TAbstractdxReportLinkDesignWindow; + FFont: TFont; + FFootersOnEveryPage: Boolean; + FHeadersOnEveryPage: Boolean; + FInternalStreaming: Boolean; + FIsDesignerCaptionAssigned: Boolean; + FIsInvalidReport: Boolean; + FPageNumberFormat: TdxPageNumberFormat; + FPrinterPage: TdxPrinterPage; + FRebuildNeeded: Boolean; + FRenderer: TdxPSReportRenderer; + FRenderInfo: TdxPSReportRenderInfo; + FReportCells: TdxReportCells; + FReportDocument: TdxPSReportDocument; + FReportTitle: TdxReportTitle; + FSavedReportDocument: TdxPSReportDocument; + FSavedReportTitle: TdxReportTitle; + FScaleFonts: Boolean; + FShowDesigner: Boolean; + FShowEmptyPages: Boolean; + FShowPageFooter: Boolean; + FShowPageHeader: Boolean; + FState: TdxReportLinkStates; + FStartPageIndex: Integer; + FStorageName: string; + FStyleManager: TdxPrintStyleManager; + FSubscriber: TdxEventSubscriber; + FTimeFormat: Integer; + FTransparent: Boolean; + FUseHorzDelimiters: Boolean; + FUseVertDelimiters: Boolean; + + FBackgroundBitmapPool: TdxPSBackgroundBitmapPool; + FFontPool: TdxPSReportFontPool; + FPainting: Boolean; + FPrepared: Boolean; + FStreamedActive: Boolean; + + FOnChangeComponent: TNotifyEvent; + FOnCustomDrawPageFooter: TdxCustomDrawReportLinkHFEvent; + FOnCustomDrawPageHeader: TdxCustomDrawReportLinkHFEvent; + FOnCustomDrawReportLinkTitle: TdxCustomDrawReportLinkTitleEvent; + FOnDataSourceChanged: TNotifyEvent; + FOnDestroy: TNotifyEvent; + FOnFilterStyle: TdxFilterStyleEvent; + FOnMeasureReportLinkTitle: TdxMeasureReportLinkTitleEvent; + + function GetAbortBuilding: Boolean; + function GetCaption: string; + function GetCurrentPrintStyle: TBasedxPrintStyle; + function GetDateFormat: Integer; + function GetDateTime: TDateTime; + function GetDescription: string; + function GetDesignerCaption: string; + function GetFontPool: TdxPSReportFontPool; + function GetHasDesignWindow: Boolean; + function GetHasPreviewWindow: Boolean; + function GetIndex: Integer; + function GetIsAggregated: Boolean; + function GetIsBuilding: Boolean; + function GetIsCurrentLink: Boolean; + function GetPageHeight: Integer; + function GetPageNumberFormat: TdxPageNumberFormat; + function GetPageWidth: Integer; + function GetPreviewWindow: TBasedxPreviewWindow; + function GetRealPrinterPage: TdxPrinterPage; + function GetReportTitleMode: TdxReportTitleMode; + function GetReportTitleText: string; + function GetRenderer: TdxPSReportRenderer; + function GetRenderInfo: TdxPSReportRenderInfo; + function GetRenderStage: TdxPSRenderStages; + function GetShowEmptyPages: Boolean; + function GetShowPageFooter: Boolean; + function GetShowPageHeader: Boolean; + ///function GetShrinkToPageHeight: Boolean; + function GetShrinkToPageWidth: Boolean; + function GetStartPageIndex: Integer; + function GetTimeFormat: Integer; + function GetVirtualPageCount: Integer; + function IsDateFormatStored: Boolean; + function IsDesignerCaptionStored: Boolean; + function IsPageNumberFormatStored: Boolean; + function IsTimeFormatStored: Boolean; + procedure SetAbortBuilding(Value: Boolean); + procedure SetAssignedFormatValues(Value: TdxAssignedFormatValues); + procedure SetCaption(const Value: string); + procedure SetComponentPrinter(Value: TCustomdxComponentPrinter); + procedure SetCurrentPage(Value: Integer); + procedure SetDateFormat(Value: Integer); + procedure SetDataSource(Value: TdxReportLinkDataSource); + procedure SetDateTime(const Value: TDateTime); + procedure SetDesignerCaption(const Value: string); + procedure SetDescription(const Value: string); + procedure SetIndex(Value: Integer); + procedure SetIsCurrentLink(Value: Boolean); + procedure SetPageNumberFormat(Value: TdxPageNumberFormat); + procedure SetPrinterPage(Value: TdxPrinterPage); + procedure SetRealPrinterPage(Value: TdxPrinterPage); + procedure SetReportDocument(Value: TdxPSReportDocument); + procedure SetReportTitle(Value: TdxReportTitle); + procedure SetReportTitleMode(Value: TdxReportTitleMode); + procedure SetReportTitleText(const Value: string); + procedure SetShowEmptyPages(Value: Boolean); + procedure SetShowPageFooter(Value: Boolean); + procedure SetShowPageHeader(Value: Boolean); + //procedure SetShrinkToPageHeight(Value: Boolean); + procedure SetShrinkToPageWidth(Value: Boolean); + procedure SetStartPageIndex(Value: Integer); + procedure SetStorageName(const Value: string); + procedure SetStyleManager(Value: TdxPrintStyleManager); + procedure SetTimeFormat(Value: Integer); + procedure SetUseHorzDelimiters(Value: Boolean); + procedure SetUseVertDelimiters(Value: Boolean); + + procedure AssignFormats(AnItem: TdxAssignedFormatValue; AValue: Boolean); + function CurrentComposition: TdxCompositionReportLink; + procedure PaintPage(ACanvas: TCanvas; const APageBounds: TRect; + APageIndex, AContinuousPageIndex, AZoomFactor: Integer); virtual; + function ValidateMargins: Boolean; + + procedure DefineStylesClick(Sender: TObject); + procedure StyleClick(Sender: TObject); + + procedure ReadBuiltIn(Reader: TReader); + procedure ReadComponentName(AReader: TReader); + procedure ReadIsDesignerCaptionAssigned(Reader: TReader); + procedure ReadStyleManagerName(AReader: TReader); + procedure WriteBuiltIn(Writer: TWriter); + procedure WriteComponentName(AWriter: TWriter); + procedure WriteIsDesignerCaptionAssigned(Writer: TWriter); + procedure WriteStyleManagerName(AWriter: TWriter); + protected + FColor: TColor; + FFontIndex: Integer; + {$IFNDEF DELPHI6} + { IUnknown } + function QueryInterface(const IID: TGUID; out Obj): HRESULT; override; + function _Addref: Integer; stdcall; + function _Release: Integer; stdcall; + {$ENDIF} + procedure AssignTo(Dest: TPersistent); override; + procedure DefineProperties(Filer: TFiler); override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure ReadState(Reader: TReader); override; + procedure SetName(const NewName: TComponentName); override; + procedure SetParentComponent(AParent: TComponent); override; + + { Render Info} + procedure CalculateRenderInfos; + procedure ClearGDIPools; + function CreateRenderInfo: TdxPSReportRenderInfo; virtual; + procedure FreeRenderInfos; + function GetRenderInfoClass: TdxPSReportRenderInfoClass; virtual; + + function CreateRenderer: TdxPSReportRenderer; virtual; + procedure FreeRenderer; + function GetRendererClass: TdxPSReportRendererClass; virtual; + + procedure InitializeDefaultFont(AFont: TFont); virtual; + procedure InternalGetDelimiters(ADelimitersHorz, ADelimitersVert: TList); + + function IsEntirePageCustomDrawn: Boolean; + function IsHeaderOrFooterCustomDrawn(AHFObject: TCustomdxPageObject): Boolean; + function IsTitleCustomDrawn: Boolean; + + function NeedCalcEmptyPages: Boolean; + function PageReady(APageIndex: Integer): Boolean; {obsolete: always returns True} + procedure PrepareFonts(UPI: Integer); + + procedure PrepareLongOperation; + procedure UnprepareLongOperation; + + function CreateReportDocument: TdxPSReportDocument; + procedure DocumentChanged(Sender: TObject); virtual; + class function GetReportDocumentClass: TdxPSReportDocumentClass; virtual; + + function CreateReportCells: TdxReportCells; virtual; + function GetReportCellsClass: TdxReportCellsClass; virtual; + + { Read/Write Data } + class function CreateDataReader(AStream: TStream): TdxPSDataReader; + class function CreateDataWriter(AStream: TStream): TdxPSDataWriter; + class function GetDataReaderClass: TdxPSDataReaderClass; virtual; + class function GetDataWriterClass: TdxPSDataWriterClass; virtual; + procedure InternalLoadDataFromStream(AStream: TStream); + procedure InternalReadData(AReader: TdxPSDataReader); virtual; + procedure InternalWriteData(AWriter: TdxPSDataWriter); virtual; + function IsRebuildNeededAndAllowed(ACheckPreviewMode: Boolean): Boolean; + + function RetrieveStorageInfo: TdxPSDataStorageInfo; virtual; + procedure ReadData(AReader: TdxPSDataReader); virtual; + class function ReadOffsetTable(AReader: TdxPSDataReader): TdxPSDataStorageOffsetTable; virtual; + class procedure ReadReportDocument(AReader: TdxPSDataReader; AReportDocument: TdxPSReportDocument); virtual; + class function ReadStorageInfo(AReader: TdxPSDataReader): TdxPSDataStorageInfo; virtual; + class procedure SkipStorageInfo(AReader: TdxPSDataReader); + procedure ReadTitle(AReader: TdxPSDataReader); virtual; + procedure WriteData(AWriter: TdxPSDataWriter); virtual; + class procedure WriteOffsetTable(AWriter: TdxPSDataWriter; AnOffsetTable: TdxPSDataStorageOffsetTable); virtual; + class procedure WriteReportDocument(AWriter: TdxPSDataWriter; AReportDocument: TdxPSReportDocument); virtual; + class procedure WriteStorageInfo(AWriter: TdxPSDataWriter; AStorageInfo: TdxPSDataStorageInfo); virtual; + procedure WriteTitle(AWriter: TdxPSDataWriter); virtual; + + { Read/Write Link Data} + procedure ReadBackgroundBitmapPool(AReader: TdxPSDataReader); + procedure ReadFontPool(AReader: TdxPSDataReader); + procedure ReadRenderInfo(AReader: TdxPSDataReader); + procedure ReadReportData(AReader: TdxPSDataReader); + procedure WriteBackgroundBitmapPool(AWriter: TdxPSDataWriter); + procedure WriteFontPool(AWriter: TdxPSDataWriter); + procedure WriteRenderInfo(AWriter: TdxPSDataWriter); + procedure WriteReportData(AWriter: TdxPSDataWriter); + + { properties read/write virtual methods } + function GetAllowContinuousPageIndexes: Boolean; virtual; + function GetAlwaysBufferedGraphics: Boolean; virtual; + function GetContinuousPageIndexes: Boolean; virtual; + function GetEmptyPagesCanExist: Boolean; virtual; + function GetRealScaleFactor: Integer; virtual; + function GetReportHeight: Integer; virtual; + function GetReportWidth: Integer; virtual; + function IsFontStored: Boolean; virtual; + procedure SetActive(Value: Boolean); virtual; + procedure SetColor(Value: TColor); virtual; + procedure SetComponent(Value: TComponent); virtual; + procedure SetContinuousPageIndexes(Value: Boolean); virtual; + procedure SetFont(Value: TFont); virtual; + procedure SetFootersOnEveryPage(Value: Boolean); virtual; + procedure SetHeadersOnEveryPage(Value: Boolean); virtual; + procedure SetTransparent(Value: Boolean); virtual; + + procedure FontChanged(Sender: TObject); virtual; + procedure LinkModified(Value: Boolean); virtual; + + procedure AfterDesignReport(ADone: Boolean); virtual; + procedure BeforeDesignReport; virtual; + + procedure AfterPrinting; virtual; + procedure BeforePrinting; virtual; + + function CalculateActualScaleFactor: Integer; virtual; + function CannotActivateReportErrorString: string; virtual; + procedure ConstructReport(AReportCells: TdxReportCells); virtual; + procedure ConvertCoords; virtual; + + procedure CustomDraw(AnItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); virtual; + function GetDesignerClass: TdxReportLinkDesignWindowClass; virtual; + procedure DoApplyInDesigner; virtual; + procedure DoCreateReport; virtual; + procedure DoCreateReportData; + procedure DoDataProviderDontPresent; dynamic; + procedure DoDestroyReport; virtual; + procedure DoPageParamsChanged; virtual; + procedure CopyDataStreamFrom(AStream: TStream); + procedure FinalizeDataStream; virtual; + function GetBreakPagesByHardDelimiters: Boolean; virtual; + function GetCriticalSize(AReportCells: TdxReportCells): Integer; virtual; + procedure GetImageLists(AProc: TdxPSGetImageListProc); virtual; + function GetPageCount: Integer; virtual; + function GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; virtual; + function GetUseHardVertDelimiters: Boolean; virtual; + function GetVisiblePageCount: Integer; virtual; + procedure InternalActivate; virtual; + procedure InternalRestoreDefaults; virtual; + procedure InternalRestoreFromOriginal; virtual; + function IsDrawFootersOnEveryPage: Boolean; virtual; + function IsDrawHeadersOnEveryPage: Boolean; virtual; + function IsScaleGridLines: Boolean; virtual; + function IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; virtual; + procedure MakeDelimiters(AReportCells: TdxReportCells; AHorzDelimiters, AVertDelimiters: TList); virtual; + procedure MakeHardDelimiters(AReportCells: TdxReportCells; AVertDelimiters: TList); virtual; + procedure PageParamsChanged(Sender: TdxPrinterPage; AStyle: TBasedxPrintStyle; + AUpdateCodes: TdxPrinterPageUpdateCodes); virtual; + function PossibleCustomDraw(AnItem: TAbstractdxReportCellData): Boolean; virtual; + procedure PrepareReportGroupsLookAndFeels; + procedure RetrievePageAsImage(APageIndex: Integer; AGraphicClass: TGraphicClass; AGraphic: TGraphic); + procedure RetrievePageAsImageCallBack(AComponentPrinter: TCustomdxComponentPrinter; + AReportLink: TBasedxReportLink; AIndex, APageIndex: Integer; const AGraphic: TGraphic; + AData: Pointer; var AContinue: Boolean); + procedure ShowEmptyPagesChanged; virtual; + procedure ShowPageFooterChanged; virtual; + procedure ShowPageHeaderChanged; virtual; + procedure StdProcessDataSourceDontPresent; virtual; + procedure TunePixelsNumerator(AReportCells: TdxReportCells); virtual; + + procedure ComponentUnsupportedError(AComponent: TComponent); + + procedure DoChangeComponent; dynamic; + procedure DoCustomDrawEntirePage(ACanvas: TCanvas; R: TRect; ARealPageIndex: Integer); virtual; + procedure DoCustomDrawPageHeaderOrFooter(AHFObject: TCustomdxPageObject; + ACanvas: TCanvas; APageIndex: Integer; R: TRect; + var ADefaultDrawText, ADefaultDrawBackground: Boolean); virtual; + procedure DoParentCustomDrawPageHeaderOrFooter( + AHFObject: TCustomdxPageObject; ACanvas: TCanvas; APageIndex: Integer; + R: TRect; var ADefaultDrawText, ADefaultDrawBackground: Boolean; + APixelsNumerator: Integer); virtual; + procedure DoParentCustomDrawReportTitle(ACanvas: TCanvas; R: TRect; + var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var AColor: TColor; AFont: TFont; var ADone: Boolean; + APixelsNumerator: Integer); virtual; + procedure DoCustomDrawPageTitle(ACanvas: TCanvas; R: TRect; + var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var AColor: TColor; AFont: TFont; var ADone: Boolean); virtual; + + procedure DoDataSourceChanged; dynamic; + procedure DoDestroy; dynamic; + procedure DoMeasureReportLinkTitle(var AHeight: Integer); virtual; + procedure DoProgress(const APercentDone: Double); dynamic; + function IsComposable(AComposition: TdxCompositionReportLink): Boolean; virtual; + function IsSupportedStyle(APrintStyle: TBasedxPrintStyle): Boolean; virtual; + function NeedTwoPassRendering: Boolean; virtual; + + procedure DesignerModified; + procedure DesignerUpdate(TheAll: Boolean); + function IsDesigning: Boolean; + function IsDestroying: Boolean; + function IsLoading: Boolean; + + property AllowContinuousPageIndexes: Boolean read GetAllowContinuousPageIndexes; + property AlwaysBufferedGraphics: Boolean read GetAlwaysBufferedGraphics; + property BackgroundBitmapPool: TdxPSBackgroundBitmapPool read FBackgroundBitmapPool; + property BreakPagesByHardDelimiters: Boolean read GetBreakPagesByHardDelimiters; + property Color: TColor read FColor write SetColor default clWhite; + property ContinuousPageIndexes: Boolean read GetContinuousPageIndexes write SetContinuousPageIndexes default False; + //property Controller: TBasedxReportLink read FController write FController; + property DataStream: TStream read FDataStream; + property Font: TFont read FFont write SetFont stored IsFontStored; + property FontPool: TdxPSReportFontPool read GetFontPool; + property FootersOnEveryPage: Boolean read FFootersOnEveryPage write SetFootersOnEveryPage default False; + property HeadersOnEveryPage: Boolean read FHeadersOnEveryPage write SetHeadersOnEveryPage default False; + property InternalStreaming: Boolean read FInternalStreaming write FInternalStreaming; + property IsBuilding: Boolean read GetIsBuilding; + property IsInvalidReport: Boolean read FIsInvalidReport; //stored in external storage + property PageHeight: Integer read GetPageHeight; + property PageWidth: Integer read GetPageWidth; + property Renderer: TdxPSReportRenderer read GetRenderer; + property RenderInfo: TdxPSReportRenderInfo read GetRenderInfo; + property ScaleFonts: Boolean read FScaleFonts write FScaleFonts default True; + property State: TdxReportLinkStates read FState; + property Transparent: Boolean read FTransparent write SetTransparent default True; + property UseHardVertDelimiters: Boolean read GetUseHardVertDelimiters; + property UseHorzDelimiters: Boolean read FUseHorzDelimiters write SetUseHorzDelimiters default True; + property UseVertDelimiters: Boolean read FUseVertDelimiters write SetUseVertDelimiters default True; + property VirtualPageCount: Integer read GetVirtualPageCount; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure BeforeDestruction; override; + procedure Assign(Source: TPersistent); override; + function GetParentComponent: TComponent; override; + function HasParent: Boolean; override; + + procedure LoadFromRegistry(const APath: string); + procedure SaveToRegistry(const APath: string); + + class function Aggregable: Boolean; virtual; + class function CanBeUsedAsStub: Boolean; virtual; // when data loaded from external storage + class function Serializable: Boolean; virtual; + + function DefaultDateFormat: Integer; virtual; + function DefaultDesignerCaption: string; virtual; + function DefaultFont: TFont; virtual; + function DefaultPageNumberFormat: TdxPageNumberFormat; virtual; + function DefaultTimeFormat: Integer; virtual; + + procedure RestoreDefaults; virtual; + procedure RestoreFromOriginal; virtual; + + function CheckToDesign: Boolean; + function DataProviderPresent: Boolean; virtual; + function DesignerExists(AComponentClass: TComponentClass): Boolean; virtual; + function DesignReport: Boolean; + procedure DestroyReport; virtual; + procedure GetPageColRowCount(out APageColCount, APageRowCount: Integer); virtual; + procedure Initialize; virtual; + function IsEmptyPage(AVirtualPageIndex: Integer): Boolean; virtual; + function IsEmptyReport: Boolean; virtual; + procedure RebuildReport; virtual; + { Use this routine when you attempt to assign ReportLink to Component that actually is in a DLL } + { Don't use this routine in regular cases, i.e. ReportLink is in the same executable file } + procedure SetComponentUnconditionally(Value: TComponent); + + class procedure GetSupportedComponentList(AList: TdxClassList); + class function IsSupportedCompClass(AComponentClass: TClass): Boolean; virtual; + class function LinkClass: TdxReportLinkClass; + class function Supports(AnObject: TObject{TComponent}): Boolean; overload; + class function Supports(AClass: TClass): Boolean; overload; + + function Print(AShowDialog: Boolean; APPrintDlgData: PdxPrintDlgData): Boolean; + procedure PrintEx(APageNums: TdxPageNumbers; ACopies: Integer; ACollate: Boolean); + procedure PrintPages(const APageIndexes: array of Integer); + procedure PrintPagesEx(const APageIndexes: array of Integer; APageNums: TdxPageNumbers; + ACopyCount: Integer; ACollate: Boolean); + + procedure Preview(Modal: Boolean = True); + function PreviewExists: Boolean; + + procedure BuildPageSetupMenu(ARootItem: TComponent; AData: Pointer; + AIncludeDefineItem: Boolean = True); + procedure DefinePrintStylesDlg; + procedure GetFilteredStyles(AStrings: TStrings); + function PageSetup: Boolean; + function PageSetupEx(AActivePageIndex: Integer; AShowPreviewBtn, AShowPrintBtn: Boolean; + out APreviewBtnClicked, APrintBtnClicked: Boolean): Boolean; overload; + function PageSetupEx(AActivePageIndex: Integer; + APreviewBtnClicked, APrintBtnClicked: PBoolean): Boolean; overload; {$IFDEF DELPHI6} deprecated; {$ENDIF} + + function ShowDateTimeFormatsDlg: Boolean; + function ShowPageNumberFormatsDlg: Boolean; + function ShowTitlePropertiesDlg: Boolean; + + function SupportsScaling: Boolean; virtual; + + function CanChangeTitle: Boolean; + function SupportsTitle: Boolean; virtual; + + function CanLoadData: Boolean; virtual; + function CanSaveData: Boolean; virtual; + function CanUnloadData: Boolean; virtual; + function GetNewReportStorageName: string; virtual; + procedure LoadDataFromFile(const AName: string); virtual; + procedure LoadDataFromStream(AStream: TStream); virtual; + procedure SaveDataToFile(const AName: string); virtual; + procedure SaveDataToStream(AStream: TStream); virtual; + + class function ExtractComponentClass(AStream: TStream; ARaiseException: Boolean = False): TComponentClass; + class function ExtractLinkClass(AStream: TStream; ARaiseException: Boolean = False): TdxReportLinkClass; + class function ExtractOffsetTable(AStream: TStream; ARaiseException: Boolean = False): TdxPSDataStorageOffsetTable; + class function ExtractReportDocument(AStream: TStream; ARaiseException: Boolean = False): TdxPSReportDocument; + class function ExtractStorageInfo(AStream: TStream; ARaiseException: Boolean = False): TdxPSDataStorageInfo; + class function ExtractStorageVersion(AStream: TStream; ARaiseException: Boolean = False): Integer; + class procedure FinalizeStorageInfo(var AStorageInfo: TdxPSDataStorageInfo); + class function PossibleDataStorage(AStream: TStream; ARaiseException: Boolean = False): Boolean; overload; + class function PossibleDataStorage(const AFileName: string; ARaiseException: Boolean = False): Boolean; overload; + + function AddBackgroundBitmapToPool(ABitmap: TBitmap): Integer; + function AddFontToPool(AFont: TFont): Integer; + + function CreateGroupLookAndFeel(AClass: TdxPSReportGroupLookAndFeelClass; ACheckExisting: Boolean = True): TdxPSReportGroupLookAndFeel; + function FindGroupLookAndFeelByClass(AClass: TdxPSReportGroupLookAndFeelClass): TdxPSReportGroupLookAndFeel; + function IndexOfReportGroupLookAndFeel(ALookAndFeel: TdxPSReportGroupLookAndFeel): Integer; + + procedure DrawPageHeader(APageIndex: Integer; ARect: TRect; + ATitleParts: TdxPageTitleParts; ADrawBackground: Boolean); + procedure DrawPageFooter(APageIndex: Integer; ARect: TRect; + ATitleParts: TdxPageTitleParts; ADrawBackground: Boolean); + + procedure DrawCheckBox(Canvas: TCanvas; var R: TRect; Checked, Enabled, FlatBorder: Boolean; + BoldBorder: Boolean = False); overload; virtual; + procedure DrawCheckBox(Canvas: TCanvas; var R: TRect; Checked, Enabled, IsRadio: Boolean; + EdgeStyle: TdxCheckButtonEdgeStyle; BorderColor: TColor = clWindowText); overload; virtual; + procedure drawEdge(Canvas: TCanvas; var R: TRect; EdgeMode: TdxCellEdgeMode; + InnerEdge, OuterEdge: TdxCellEdgeStyle; Sides: TdxCellSides = [csLeft..csBottom]; + Soft: Boolean = True); virtual; + procedure DrawEllipse(Canvas: TCanvas; R: TRect; ForeColor, BkColor: TColor; + Pattern: TdxPSFillPatternClass; BorderColor: TColor; BorderThickness: Integer = 1); virtual; + procedure DrawExpandButton(Canvas: TCanvas; var R: TRect; + Expanded, DrawBorder, Edge3D, Edge3DSoft, Shadow, FillInterior: Boolean; + BorderColor, InteriorColor: TColor); virtual; + procedure DrawGlyph(DC: HDC; const R: TRect; AGlyph: Byte); + procedure DrawGraphic(Canvas: TCanvas; var R: TRect; const ClipRect: TRect; + ImageList: TCustomImageList; ImageIndex: Integer; Graphic: TGraphic; + GraphicTransparent, Transparent: Boolean; BkColor: TColor); virtual; + procedure DrawGraphicEx(Canvas: TCanvas; var R: TRect; const ClipRect: TRect; + ImageList: TCustomImageList; ImageIndex: Integer; Graphic: TGraphic; + GraphicTransparent, Transparent: Boolean; BkColor, ForeColor: TColor; + Pattern: TdxPSFillPatternClass; AnActualImageBuffering: TdxCellImageActualBuffering = cibAlways); virtual; + procedure DrawRectangle(Canvas: TCanvas; R: TRect; ForeColor, BkColor: TColor; + ContentPattern: TdxPSFillPatternClass; BorderColor: TColor; + BorderThickness: Integer = 1); virtual; + procedure DrawRoundRect(Canvas: TCanvas; R: TRect; CornerWidth, CornerHeight: Integer; + ForeColor, BkColor: TColor; ContentPattern: TdxPSFillPatternClass; + BorderColor: TColor; BorderThickness: Integer = 1); virtual; + procedure DrawSortMark(Canvas: TCanvas; var R: TRect; SortOrder: TdxCellSortOrder; Mono: Boolean); virtual; + procedure drawText(Canvas: TCanvas; var R: TRect; AIndent: Integer; + const Text: string; Font: TFont; BkColor: TColor; TextAlignX: TdxTextAlignX; + TextAlignY: TdxTextAlignY; FillBackground, Multiline, EndEllipsis: Boolean); virtual; + procedure drawTextEx(Canvas: TCanvas; var R: TRect; MaxLineCount: Integer; + LeftIndent, RightIndent: Integer; const Text: string; Font: TFont; + BkColor: TColor; TextAlignX: TdxTextAlignX; TextAlignY: TdxTextAlignY; + FillBackground, Multiline, EndEllipsis, PreventLeftTextExceed, PreventTopTextExceed: Boolean); virtual; + procedure FillEllipse(Canvas: TCanvas; const R: TRect; Color: TColor); virtual; + procedure FillEllipseEx(Canvas: TCanvas; const R: TRect; ForeColor, BkColor: TColor; Pattern: TdxPSFillPatternClass); virtual; + procedure FillRectEx(Canvas: TCanvas; const R: TRect; ForeColor, BkColor: TColor; Pattern: TdxPSFillPatternClass); virtual; + procedure FillRoundRect(Canvas: TCanvas; const R: TRect; CornerWidth, CornerHeight: Integer; Color: TColor); virtual; + procedure FillRoundRectEx(Canvas: TCanvas; const R: TRect; CornerWidth, CornerHeight: Integer; + ForeColor, BkColor: TColor; Pattern: TdxPSFillPatternClass); virtual; + procedure FillRgnEx(Canvas: TCanvas; Rgn: HRGN; ForeColor, BkColor: TColor; Pattern: TdxPSFillPatternClass); virtual; + procedure FrameEllipse(Canvas: TCanvas; R: TRect; Color: TColor; Thickness: Integer = 1); + procedure frameRect(Canvas: TCanvas; R: TRect; Color: TColor; Sides: TdxCellSides = [csLeft..csBottom]; + Thickness: Integer = 1); + procedure FrameRoundRect(Canvas: TCanvas; R: TRect; CornerWidth, CornerHeight: Integer; + Color: TColor; Thickness: Integer = 1); virtual; + + { for internal use only } + function RealPageIndexToVirtualPageIndex(APageIndex: Integer; + ATakeIntoAccountEmptyPages: Boolean): Integer; virtual; + function VirtualPageIndexToRealPageIndex(APageIndex: Integer): Integer; virtual; + + property AbortBuilding: Boolean read GetAbortBuilding write SetAbortBuilding; + property BuiltIn: Boolean read FBuiltIn write FBuiltIn; + property ComponentPrinter: TCustomdxComponentPrinter read FComponentPrinter write SetComponentPrinter; + property Controller: TBasedxReportLink read FController write FController; + property CurrentPage: Integer read FCurrentPage write SetCurrentPage; + property CurrentPrintStyle: TBasedxPrintStyle read GetCurrentPrintStyle; + property Data: Pointer read FData write FData; + property DataSource: TdxReportLinkDataSource read FDataSource write SetDataSource; + property DesignWindow: TAbstractdxReportLinkDesignWindow read FDesignWindow; + property EmptyPagesCanExist: Boolean read GetEmptyPagesCanExist; + property HasDesignWindow: Boolean read GetHasDesignWindow; + property HasPreviewWindow: Boolean read GetHasPreviewWindow; + property IsAggregated: Boolean read GetIsAggregated; + property PageCount: Integer read GetPageCount; + property PreviewWindow: TBasedxPreviewWindow read GetPreviewWindow; + property RealPrinterPage: TdxPrinterPage read GetRealPrinterPage write SetRealPrinterPage; + property RealScaleFactor: Integer read GetRealScaleFactor; + property RebuildNeeded: Boolean read FRebuildNeeded; + property RenderStage: TdxPSRenderStages read GetRenderStage; + property ReportCells: TdxReportCells read FReportCells; + property ReportHeight: Integer read GetReportHeight; + property ReportWidth: Integer read GetReportWidth; + property ShowEmptyPages: Boolean read GetShowEmptyPages write SetShowEmptyPages default False; + property VisiblePageCount: Integer read GetVisiblePageCount; + published + property Active: Boolean read FActive write SetActive default False; + property Caption: string read GetCaption write SetCaption stored False; + property Component: TComponent read FComponent write SetComponent; + property Description: string read GetDescription write SetDescription stored False; + property DateFormat: Integer read GetDateFormat write SetDateFormat stored IsDateFormatStored default 0; + property DateTime: TDateTime read GetDateTime write SetDateTime stored False; + property DesignerCaption: string read GetDesignerCaption write SetDesignerCaption stored IsDesignerCaptionStored; + property DesignerHelpContext: THelpContext read FDesignerHelpContext write FDesignerHelpContext default 0; + property Index: Integer read GetIndex write SetIndex stored False; + property IsCurrentLink: Boolean read GetIsCurrentLink write SetIsCurrentLink stored False; + property PageNumberFormat: TdxPageNumberFormat read GetPageNumberFormat write SetPageNumberFormat stored IsPageNumberFormatStored; + property PrinterPage: TdxPrinterPage read FPrinterPage write SetPrinterPage; + property ReportDocument: TdxPSReportDocument read FReportDocument write SetReportDocument; + property ReportTitle: TdxReportTitle read FReportTitle write SetReportTitle; + property ReportTitleMode: TdxReportTitleMode read GetReportTitleMode write SetReportTitleMode stored False default tmOnEveryTopPage; + property ReportTitleText: string read GetReportTitleText write SetReportTitleText stored False; + property ShowDesigner: Boolean read FShowDesigner write FShowDesigner stored False; + property ShowPageFooter: Boolean read GetShowPageFooter write SetShowPageFooter default True; + property ShowPageHeader: Boolean read GetShowPageHeader write SetShowPageHeader default True; + //property ShrinkToPageHeight: Boolean read GetShrinkToPageHeight write SetShrinkToPageHeight default False; + property ShrinkToPageWidth: Boolean read GetShrinkToPageWidth write SetShrinkToPageWidth default False; + property StartPageIndex: Integer read GetStartPageIndex write SetStartPageIndex default 1; + property StorageName: string read FStorageName write SetStorageName; + property StyleManager: TdxPrintStyleManager read FStyleManager write SetStyleManager; + property TimeFormat: Integer read GetTimeFormat write SetTimeFormat stored IsTimeFormatStored default 0; + property AssignedFormatValues: TdxAssignedFormatValues read FAssignedFormatValues write SetAssignedFormatValues default []; //must be last + + property OnChangeComponent: TNotifyEvent read FOnChangeComponent write FOnChangeComponent; + property OnCustomDrawPageFooter: TdxCustomDrawReportLinkHFEvent read FOnCustomDrawPageFooter write FOnCustomDrawPageFooter; + property OnCustomDrawPageHeader: TdxCustomDrawReportLinkHFEvent read FOnCustomDrawPageHeader write FOnCustomDrawPageHeader; + property OnCustomDrawReportLinkTitle: TdxCustomDrawReportLinkTitleEvent read FOnCustomDrawReportLinkTitle write FOnCustomDrawReportLinkTitle; + property OnDataSourceChanged: TNotifyEvent read FOnDataSourceChanged write FOnDataSourceChanged; + property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy; + property OnFilterStyle: TdxFilterStyleEvent read FOnFilterStyle write FOnFilterStyle; + property OnMeasureReportLinkTitle: TdxMeasureReportLinkTitleEvent read FOnMeasureReportLinkTitle write FOnMeasureReportLinkTitle; + end; + + TdxCompositionLinkItem = class(TCollectionItem) + private + FBuiltIn: Boolean; + FReportLink: TBasedxReportLink; + FLoadingReportLinkName: string; + procedure SetReportLink(Value: TBasedxReportLink); + procedure ReadData(Reader: TReader); + procedure ReadLinkName(Reader: TReader); + procedure WriteData(Writer: TWriter); + procedure WriteLinkName(Writer: TWriter); + protected + procedure DefineProperties(Filer: TFiler); override; + procedure SetIndex(Value: Integer); override; + function Composition: TdxCompositionReportLink; + public + constructor Create(Collection: TCollection); override; + procedure Assign(Source: TPersistent); override; + property BuiltIn: Boolean read FBuiltIn write FBuiltIn; + published + property ReportLink: TBasedxReportLink read FReportLink write SetReportLink; + end; + + TdxCompositionLinkItems = class(TCollection) + private + FComposition: TdxCompositionReportLink; + FDontNeedRebuild: Boolean; + function GetItem(Index: Integer): TdxCompositionLinkItem; + procedure SetItem(Index: Integer; Value: TdxCompositionLinkItem); + protected + procedure CorrectLinksAfterLoadings; + function GetOwner: TPersistent; override; + procedure Update(Item: TCollectionItem); override; + public + constructor Create(AComposition: TdxCompositionReportLink); + + function Add: TdxCompositionLinkItem; + function AddLink(AReportLink: TBasedxReportLink): TdxCompositionLinkItem; + procedure DeleteItemsByLink(AReportLink: TBasedxReportLink); + procedure DeleteNonBuiltIns; + procedure GetLinkEntries(AReportLink: TBasedxReportLink; AList: TList); // returns list of Items + function IndexOfLink(AReportLink: TBasedxReportLink): Integer; // returns first entry for AReportLink in Items + function IsLinkComposable(AReportLink: TBasedxReportLink): Boolean; + function LinkExists(AReportLink: TBasedxReportLink): Boolean; + function NextAssignedItem(AnItem: TdxCompositionLinkItem): TdxCompositionLinkItem; + function NonBuiltInsExists: Boolean; + function PrevAssignedItem(AnItem: TdxCompositionLinkItem): TdxCompositionLinkItem; + + property Composition: TdxCompositionReportLink read FComposition; + property Items[Index: Integer]: TdxCompositionLinkItem read GetItem write SetItem; default; + end; + + TdxPSCompositionReportRenderInfo = class(TdxPSReportRenderInfo) + private + FNonEmptyPageCount: Integer; + FPageColCount: Integer; + FPageRowCount: Integer; + FStartIndexes: TList; + function GetReportLink: TdxCompositionReportLink; + function GetStartIndex(Index: Integer): Integer; + function GetStartIndexCount: Integer; + procedure SetStartIndex(Index: Integer; Value: Integer); + protected + function CalculateNonEmptyPageCount: Integer; virtual; + function CalculatePageColCount: Integer; virtual; + function CalculatePageRowCount: Integer; virtual; + + procedure DoCalculate; override; + procedure Refresh; override; + + function GetNonEmptyPageCount: Integer; override; + function GetPageColCount: Integer; override; + function GetPageRowCount: Integer; override; + + function RealPageIndexToVirtualPageIndex(APageIndex: Integer; ATakeIntoAccountEmptyPages: Boolean): Integer; override; + function VirtualPageIndexToRealPageIndex(APageIndex: Integer): Integer; override; + + procedure GetCompositionLinkItemByPageIndexAndFixIndex(APageIndex: Integer; + var APageIndexRelativeToLink: Integer; var AnItem: TdxCompositionLinkItem); + public + constructor Create(AReportLink: TBasedxReportLink); override; + destructor Destroy; override; + + property ReportLink: TdxCompositionReportLink read GetReportLink; + property StartIndexCount: Integer read GetStartIndexCount; + property StartIndexes[Index: Integer]: Integer read GetStartIndex write SetStartIndex; + end; + + TdxPSCompositionReportRenderer = class(TdxPSReportRenderer) + private + function GetRenderInfo: TdxPSCompositionReportRenderInfo; + function GetReportLink: TdxCompositionReportLink; + public + procedure RenderPage(ACanvas: TCanvas; const APageBounds: TRect; + APageIndex, AContinuousPageIndex, AZoomFactor: Integer); override; + + property RenderInfo: TdxPSCompositionReportRenderInfo read GetRenderInfo; + property ReportLink: TdxCompositionReportLink read GetReportLink; + end; + + TdxPSReportCompositionDocument = class(TdxPSReportDocument) + private + function GetReportLink: TdxCompositionReportLink; + public + function DefaultDescription: string; override; + property ReportLink: TdxCompositionReportLink read GetReportLink; + end; + + TdxCompositionReportLinkEvent = procedure(Sender: TdxCompositionReportLink; + AItem: TdxCompositionLinkItem) of object; + + TdxCompositionState = (csRebuildReportLink); + TdxCompositionStates = set of TdxCompositionState; + + TdxCompositionOption = (coCanEdit, coShowDescription); + TdxCompositionOptions = set of TdxCompositionOption; + + TdxCompositionReportLink = class(TBasedxReportLink) + private + FCompositionState: TdxCompositionStates; + FContinuousPageIndexes: Boolean; + FDesignerOptions: TdxCompositionOptions; + FInvalidatedLinks: TList; + FItems: TdxCompositionLinkItems; + FOnAfterBuildReport: TdxCompositionReportLinkEvent; + FOnBeforeBuildReport: TdxCompositionReportLinkEvent; + function GetRenderer: TdxPSCompositionReportRenderer; + function GetRenderInfo: TdxPSCompositionReportRenderInfo; + function GetReportDocument: TdxPSReportCompositionDocument; + procedure SetItems(Value: TdxCompositionLinkItems); + procedure SetReportDocument(Value: TdxPSReportCompositionDocument); + + procedure ActivateLink(AReportLink: TBasedxReportLink); + procedure UpdateComposition(AUpdateCodes: TdxPrinterPageUpdateCodes); + protected + procedure Notification(AComponent: TComponent; AOperation: TOperation); override; + + procedure ConstructReport(AReportCells: TdxReportCells); override; + procedure DoCreateReport; override; + function GetRendererClass: TdxPSReportRendererClass; override; + function GetRenderInfoClass: TdxPSReportRenderInfoClass; override; + procedure InternalRestoreDefaults; override; + procedure InternalRestoreFromOriginal; override; + procedure ShowEmptyPagesChanged; override; + procedure ShowPageFooterChanged; override; + procedure ShowPageHeaderChanged; override; + procedure StdProcessDataSourceDontPresent; override; + + function GetAllowContinuousPageIndexes: Boolean; override; + function GetContinuousPageIndexes: Boolean; override; + function GetEmptyPagesCanExist: Boolean; override; + function GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; override; + function GetReportHeight: Integer; override; + function GetReportWidth: Integer; override; + procedure SetContinuousPageIndexes(Value: Boolean); override; + + procedure DoAfterBuildReport(AItem: TdxCompositionLinkItem); dynamic; + procedure DoBeforeBuildReport(AItem: TdxCompositionLinkItem); dynamic; + + class function GetReportDocumentClass: TdxPSReportDocumentClass; override; + + property Renderer: TdxPSCompositionReportRenderer read GetRenderer; + property RenderInfo: TdxPSCompositionReportRenderInfo read GetRenderInfo; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + function DefaultDesignerCaption: string; override; + + { for internal use only } + function RealPageIndexToVirtualPageIndex(APageIndex: Integer; + ATakeIntoAccountEmptyPages: Boolean): Integer; override; + function VirtualPageIndexToRealPageIndex(APageIndex: Integer): Integer; override; + + class function CanBeUsedAsStub: Boolean; override; + class function Serializable: Boolean; override; + function DataProviderPresent: Boolean; override; + function IsEmptyPage(AVirtualPageIndex: Integer): Boolean; override; + function SupportsTitle: Boolean; override; + + procedure GetItems(AStrings: TStrings; AExcludeUnassigned: Boolean); + + property CompositionState: TdxCompositionStates read FCompositionState; + property ReportDocument: TdxPSReportCompositionDocument read GetReportDocument write SetReportDocument; + published + property ContinuousPageIndexes default True; + property DesignerOptions: TdxCompositionOptions read FDesignerOptions write FDesignerOptions + default [coCanEdit, coShowDescription]; + property Items: TdxCompositionLinkItems read FItems write SetItems; + + property OnAfterBuildReport: TdxCompositionReportLinkEvent read FOnAfterBuildReport write FOnAfterBuildReport; + property OnBeforeBuildReport: TdxCompositionReportLinkEvent read FOnBeforeBuildReport write FOnBeforeBuildReport; + end; + + { Report PropertySheets } + + TdxReportLinkDesignWindowState = (dwsInitialize); + TdxReportLinkDesignWindowStates = set of TdxReportLinkDesignWindowState; + + TAbstractdxReportLinkDesignWindow = class(TCustomdxPSForm) + private + FApplyed: Boolean; + FModified: Boolean; + FPrevKeyPreview: Boolean; + FReportLink: TBasedxReportLink; + function GetComponent: TComponent; + function GetIsDesigning: Boolean; + function IsCaptionStored: Boolean; + procedure SetModified(Value: Boolean); + procedure WMHelp(var message: TWMHelp); message WM_HELP; + protected + FState: TdxReportLinkDesignWindowStates; + procedure CreateWnd; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + + procedure AfterRebuildReport; virtual; + procedure BeforeRebuildReport; virtual; + + procedure Initialize; virtual; + procedure LoadStrings; virtual; + procedure UpdateControlsState; virtual; + + property Applyed: Boolean read FApplyed write FApplyed; + property Component: TComponent read GetComponent; + public + constructor Create(AOwner: TComponent); override; + function Execute: Boolean; virtual; + + property IsDesigning: Boolean read GetIsDesigning; + property Modified: Boolean read FModified write SetModified; + property ReportLink: TBasedxReportLink read FReportLink write FReportLink; + property State: TdxReportLinkDesignWindowStates read FState; + published + property Caption stored IsCaptionStored; + end; + + TStandarddxReportLinkDesignWindow = class(TAbstractdxReportLinkDesignWindow) + private + FAtLeastOneTimeApplied: Boolean; + FUpdateControlsCount: Integer; + procedure SetAtLeastOneTimeApplied(Value: Boolean); + + procedure CreateStdButtons; + procedure PlaceStdButtons; + procedure RegroupStdButtons; + protected + {$IFDEF DELPHI7} + FPrevPreviewHostWindowProc: TWndMethod; + {$ENDIF} + procedure Resize; override; + + function CanApply: Boolean; virtual; + procedure DoApply; virtual; + procedure Initialize; override; + procedure LoadStrings; override; + procedure UpdateControlsState; override; + + procedure ApplyClick(Sender: TObject); virtual; + procedure RestoreDefaultsClick(Sender: TObject); virtual; + procedure RestoreOriginalClick(Sender: TObject); virtual; + procedure TitlePropertiesClick(Sender: TObject); virtual; + + procedure DoInitialize; virtual; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; virtual; + procedure PreviewHostWindowProc(var Message: TMessage); virtual; + {$ENDIF} + procedure PaintPreview(ACanvas: TCanvas; R: TRect); virtual; + procedure UpdatePreview; virtual; + + property AtLeastOneTimeApplied: Boolean read FAtLeastOneTimeApplied write SetAtLeastOneTimeApplied; + {$IFDEF DELPHI7} + property PreviewHost: TCustomPanel read GetPreviewHost; + {$ENDIF} + property UpdateControlsCount: Integer read FUpdateControlsCount; + public + constructor Create(AOwner: TComponent); override; + {$IFDEF DELPHI7} + destructor Destroy; override; + {$ENDIF} + + procedure BeginUpdateControls; virtual; + procedure EndUpdateControls; virtual; + function LockControlsUpdate: Boolean; + published + btnApply: TButton; + btnCancel: TButton; + btnHelp: TButton; + btnOK: TButton; + btnRestoreDefaults: TButton; + btnRestoreOriginal: TButton; + btnTitleProperties: TButton; + end; + + { Print Styles } + + TdxPSPrintStyle = class(TBasedxPrintStyle) + private + FOnAfterGenerating: TNotifyEvent; + FOnAfterPrinting: TNotifyEvent; + FOnBeforeGenerating: TNotifyEvent; + FOnBeforePrinting: TNotifyEvent; + procedure AfterGenerating; + procedure BeforeGenerating; + protected + procedure AddStdHFFunctions; virtual; + + procedure DoAfterGenerating; virtual; + procedure DoAfterPrinting; override; + procedure DoBeforeGenerating; virtual; + procedure DoBeforePrinting; override; + + procedure InitializeDefaultStyleGlyph(ABitmap: TBitmap); override; + public + constructor Create(AOwner: TComponent); override; + + function DefaultPageFooterText(APart: TdxPageTitlePart): string; override; + function DefaultStyleCaption: string; override; + published + property OnAfterGenerating: TNotifyEvent read FOnAfterGenerating write FOnAfterGenerating; + property OnAfterPrinting: TNotifyEvent read FOnAfterPrinting write FOnAfterPrinting; + property OnBeforeGenerating: TNotifyEvent read FOnBeforeGenerating write FOnBeforeGenerating; + property OnBeforePrinting: TNotifyEvent read FOnBeforePrinting write FOnBeforePrinting; + end; + + { Preview Window} + + TdxPreviewEnableOption = (peoCanChangeMargins, peoHelp, peoPageBackground, peoPageSetup, + peoPreferences, peoPrint, peoReportDesign); + TdxPreviewEnableOptions = set of TdxPreviewEnableOption; + TdxPreviewVisibleOption = (pvoHelp, pvoPageBackground, pvoPageSetup, pvoPreferences, + pvoPrint, pvoReportDesign, pvoPrintStyles, pvoReportFileOperations, pvoPageMargins); + TdxPreviewVisibleOptions = set of TdxPreviewVisibleOption; + TdxPSPreviewState = (prsNone, prsEditHeaders, prsEditFooters); + TdxPSThumbnailsSize = (tsSmall, tsLarge); + + {$IFDEF OLEDRAGANDDROP} + {$ENDIF} + + TdxPreviewWindowClass = class of TBasedxPreviewWindow; + + TBasedxPreviewWindow = class(TCustomdxPSForm, {$IFNDEF DELPHI6} IUnknown, {$ENDIF} + IdxPSExplorerContextCommandBuilder {$IFDEF OLEDRAGANDDROP}, IDropTarget{$ENDIF}) + private + {$IFDEF OLEDRAGANDDROP} + FDraggedFileName: string; + {$ENDIF} + function GetReportLink: TBasedxReportLink; + protected + {$IFNDEF DELPHI6} + { IUnknown } + function QueryInterface(const IID: TGUID; out Obj): HRESULT; override; + function _Addref: Integer; stdcall; + function _Release: Integer; stdcall; + {$ENDIF} + {$IFDEF OLEDRAGANDDROP} + { IDropTarget } + function IDropTarget.DragEnter = IDropTarget_DragEnter; + function IDropTarget.DragOver = IDropTarget_DragOver; + function IDropTarget.DragLeave = IDropTarget_DragLeave; + function IDropTarget.Drop = IDropTarget_Drop; + + function IDropTarget_DragEnter(const DataObj: IDataObject; grfKeyState: Longint; + Pt: TPoint; var dwEffect: Longint): HRESULT; stdcall; + function IDropTarget_DragOver(grfKeyState: Longint; Pt: TPoint; + var dwEffect: Longint): HRESULT; stdcall; + function IDropTarget_DragLeave: HRESULT; stdcall; + function IDropTarget_Drop(const DataObj: IDataObject; grfKeyState: Longint; Pt: TPoint; + var dwEffect: Longint): HRESULT; stdcall; + {$ENDIF} + + procedure AddExplorerContextCommand(ACommand: TCustomdxPSExplorerContextCommand); virtual; + procedure UpdateExplorerContextCommands; virtual; + + function GetActivePageIndex: Integer; virtual; abstract; + function GetBackground: TdxBackground; virtual; abstract; + function GetComponentPrinter: TCustomdxComponentPrinter; virtual; abstract; + function GetExplorerTree: TCustomdxPSExplorerTreeContainer; virtual; + function GetHFEditPart: TdxPageTitlePart; virtual; + function GetPageCount: Integer; virtual; abstract; + function GetPreviewEnableOptions: TdxPreviewEnableOptions; virtual; abstract; + function GetPreviewVisibleOptions: TdxPreviewVisibleOptions; virtual; abstract; + function GetSaveZoomPosition: Boolean; virtual; abstract; + function GetShowExplorer: Boolean; virtual; + function GetShowThumbnails: Boolean; virtual; + function GetState: TdxPSPreviewState; virtual; + function GetThumbnailsSize: TdxPSThumbnailsSize; virtual; abstract; + function GetVisiblePageSize: TPoint; virtual; abstract; + function GetZoomFactor: Integer; virtual; abstract; + procedure SetActivePageIndex(Value: Integer); virtual; abstract; + procedure SetBackground(const Value: TdxBackground); virtual; abstract; + procedure SetComponentPrinter(const Value: TCustomdxComponentPrinter); virtual; abstract; + procedure SetHFEditPart(const Value: TdxPageTitlePart); virtual; abstract; + procedure SetPageCount(Value: Integer); virtual; abstract; + procedure SetPreviewEnableOptions(const Value: TdxPreviewEnableOptions); virtual; abstract; + procedure SetPreviewVisibleOptions(const Value: TdxPreviewVisibleOptions); virtual; abstract; + procedure SetSaveZoomPosition(Value: Boolean); virtual; abstract; + procedure SetShowExplorer(Value: Boolean); virtual; + procedure SetShowThumbnails(Value: Boolean); virtual; + procedure SetState(const Value: TdxPSPreviewState); virtual; abstract; + procedure SetThumbnailsSize(const Value: TdxPSThumbnailsSize); virtual; abstract; + procedure SetZoomFactor(Value: Integer); virtual; abstract; + + procedure BeginUpdate; virtual; + procedure CancelUpdate; virtual; + procedure EndUpdate; virtual; + function Locked: Boolean; virtual; + procedure UpdateCaption; + + procedure CreationComplete; virtual; + procedure PaintPage(Sender: TObject; ACanvas: TCanvas; ARect: TRect; APageIndex: Integer); virtual; + procedure PaintThumbnailPage(Sender: TObject; ACanvas: TCanvas; ARect: TRect; APageIndex: Integer); virtual; + + {$IFDEF OLEDRAGANDDROP} + function CanDrop: Boolean; virtual; + function DoCanAccept: Boolean; virtual; + procedure DoDrop; virtual; + property DraggedFileName: string read FDraggedFileName; + {$ENDIF} + public + destructor Destroy; override; + + procedure GoToFirstPage; virtual; abstract; + procedure GoToLastPage; virtual; abstract; + procedure GoToNextPage; virtual; abstract; + procedure GoToPrevPage; virtual; abstract; + + procedure InitContent; virtual; + procedure InvalidateContent; virtual; + procedure InvalidatePage(APageIndex: Integer); virtual; + procedure InvalidateAllPages; virtual; + procedure InvalidatePagesContent; virtual; + procedure InvalidatePagesHeaderContent; virtual; + procedure InvalidatePagesFooterContent; virtual; + + procedure RebuildReport; virtual; + + procedure UpdateControls; virtual; + + property ActivePageIndex: Integer read GetActivePageIndex write SetActivePageIndex; + property Background: TdxBackground read GetBackground write SetBackground; + property ComponentPrinter: TCustomdxComponentPrinter read GetComponentPrinter write SetComponentPrinter; + property EnableOptions: TdxPreviewEnableOptions read GetPreviewEnableOptions write SetPreviewEnableOptions; + property ExplorerTree: TCustomdxPSExplorerTreeContainer read GetExplorerTree; + property HFEditPart: TdxPageTitlePart read GetHFEditPart write SetHFEditPart; + property PageCount: Integer read GetPageCount write SetPageCount; + property ReportLink: TBasedxReportLink read GetReportLink; + property SaveZoomPosition: Boolean read GetSaveZoomPosition write SetSaveZoomPosition; + property ShowExplorer: Boolean read GetShowExplorer write SetShowExplorer; + property ShowThumbnails: Boolean read GetShowThumbnails write SetShowThumbnails; + property State: TdxPSPreviewState read GetState write SetState; + property ThumbnailsSize: TdxPSThumbnailsSize read GetThumbnailsSize write SetThumbnailsSize; + property VisibleOptions: TdxPreviewVisibleOptions read GetPreviewVisibleOptions write SetPreviewVisibleOptions; + property VisiblePageSize: TPoint read GetVisiblePageSize; + property ZoomFactor: Integer read GetZoomFactor write SetZoomFactor; + end; + + TdxPreviewOptions = class; + + TdxComponentPrinterThumbnailsOptions = class(TPersistent) + private + FDefaultFont: TFont; + FFont: TFont; + FPreviewOptions: TdxPreviewOptions; + FShowPageNumbers: Boolean; + procedure SetFont(Value: TFont); + procedure SetShowPageNumbers(Value: Boolean); + protected + procedure InitializeDefaultFont(AFont: TFont); virtual; + function IsFontStored: Boolean; virtual; + public + constructor Create(APreviewOptions: TdxPreviewOptions); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + function DefaultFont: TFont; virtual; + procedure RestoreDefaults; virtual; + + property PreviewOptions: TdxPreviewOptions read FPreviewOptions; + published + property Font: TFont read FFont write SetFont stored IsFontStored; + property ShowPageNumbers: Boolean read FShowPageNumbers write SetShowPageNumbers default True; + end; + + TdxPreviewOptions = class(TdxBaseObject) + private + FCaption: string; + FComponentPrinter: TCustomdxComponentPrinter; + FDefaultIcon: TIcon; + FEnableOptions: TdxPreviewEnableOptions; + FIcon: TIcon; + FHelpContext: THelpContext; + FIsBoundsAssigned: Boolean; + FIsCaptionAssigned: Boolean; + FIsIconAssigned: Boolean; + FRect: TRect; + FSavePosition: Boolean; + FSaveZoomPosition: Boolean; + FShowExplorer: Boolean; + FThumbnailsOptions: TdxComponentPrinterThumbnailsOptions; + FVisibleOptions: TdxPreviewVisibleOptions; + FWindowState: TWindowState; + function GetCaption: string; + function GetHelpFile: string; + function GetIcon: TIcon; + function GetPosition(index: Integer): Integer; + function GetRect: TRect; + function GetRegistryPath: string; + function IsBoundsStored: Boolean; + function IsCaptionStored: Boolean; + function IsIconStored: Boolean; + procedure SetCaption(const Value: string); + procedure SetEnableOptions(Value: TdxPreviewEnableOptions); + procedure SetHelpContext(Value: THelpContext); + procedure SetHelpFile(const Value: string); + procedure SetIcon(Value: TIcon); + procedure SetPosition(Index: Integer; Value: Integer); + procedure SetRect(Value: TRect); + procedure SetRegistryPath(const Value: string); + procedure SetShowExplorer(Value: Boolean); + procedure SetThumbnailsOptions(Value: TdxComponentPrinterThumbnailsOptions); + procedure SetVisibleOptions(Value: TdxPreviewVisibleOptions); + procedure SetWindowState(Value: TWindowState); + + function HasPreviewWindow: Boolean; + function PreviewWindow: TBasedxPreviewWindow; + + procedure ReadBoundsRect(Stream: TStream); + procedure ReadIsCaptionAssigned(Reader: TReader); + procedure ReadIsIconAssigned(Reader: TReader); + procedure WriteBoundsRect(Stream: TStream); + procedure WriteIsCaptionAssigned(Writer: TWriter); + procedure WriteIsIconAssigned(Writer: TWriter); + protected + procedure DefineProperties(Filer: TFiler); override; + + procedure DoAssign(Source: TdxBaseObject); override; + procedure DoRestoreDefaults; override; + + function GetIsIconAssigned: Boolean; + procedure IconChanged(Sender: TObject); virtual; + procedure InitializeDefaultIcon(AnIcon: TIcon); virtual; + procedure RefreshIsIconAssigned; + public + constructor Create; override; + destructor Destroy; override; + + function DefaultCaption: string; virtual; + function DefaultIcon: TIcon; virtual; + function DefaultRect: TRect; virtual; + + procedure RestoreOriginalIcon; + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); + + property ComponentPrinter: TCustomdxComponentPrinter read FComponentPrinter; + property IsIconAssigned: Boolean read FIsIconAssigned; + property Rect: TRect read GetRect write SetRect; + published + property EnableOptions: TdxPreviewEnableOptions read FEnableOptions write SetEnableOptions + default [peoCanChangeMargins, peoPageBackground, peoPageSetup, peoPreferences, peoPrint, peoReportDesign]; + property Caption: string read GetCaption write SetCaption stored IsCaptionStored; + property Height: Integer index 0 read GetPosition write SetPosition stored False; + property HelpFile: string read GetHelpFile write SetHelpFile stored False; + property HelpContext: THelpContext read FHelpContext write SetHelpContext default 0; + property Icon: TIcon read GetIcon write SetIcon stored IsIconStored; + property Left: Integer index 1 read GetPosition write SetPosition stored False; + property RegistryPath: string read GetRegistryPath write SetRegistryPath stored False; + property SavePosition: Boolean read FSavePosition write FSavePosition stored False default True; + property SaveZoomPosition: Boolean read FSaveZoomPosition write FSaveZoomPosition default True; + property ShowExplorer: Boolean read FShowExplorer write SetShowExplorer default False; + property ThumbnailsOptions: TdxComponentPrinterThumbnailsOptions read FThumbnailsOptions write SetThumbnailsOptions; + property Top: Integer index 2 read GetPosition write SetPosition stored False; + property VisibleOptions: TdxPreviewVisibleOptions read FVisibleOptions write SetVisibleOptions + default [pvoPageSetup, pvoPageBackground, pvoPreferences, pvoPrint, pvoReportDesign, pvoPrintStyles, + pvoReportFileOperations, pvoPageMargins]; + property Width: Integer index 3 read GetPosition write SetPosition stored False; + property WindowState: TWindowState read FWindowState write SetWindowState default wsNormal; + end; + + { ComponentPrinter } + + TdxBeforeDesignReportEvent = procedure(Sender: TObject; AReportLink: TBasedxReportLink; + ADesignWindow: TAbstractdxReportLinkDesignWindow) of object; + + TdxCustomDrawPageEvent = procedure(Sender: TObject; AReportLink: TBasedxReportLink; + ACanvas: TCanvas; APageIndex: Integer; ARect: TRect; ANom, ADenom: Integer) of object; + + TdxCustomDrawReportTitleEvent = procedure(Sender: TObject; AReportLink: TBasedxReportLink; + ACanvas: TCanvas; ARect: TRect; ANom, ADenom: Integer; + var TextAlignX: TdxTextAlignX; var TextAlignY: TdxTextAlignY; + var AColor: TColor; AFont: TFont; var ADone: Boolean) of object; + + TdxCustomDrawPageHFEvent = procedure(Sender: TObject; AReportLink: TBasedxReportLink; + ACanvas: TCanvas; APageIndex: Integer; var ARect: TRect; ANom, ADenom: Integer; + var ADefaultDrawText, ADefaultDrawBackground: Boolean) of object; + + TdxDesignReportEvent = procedure(Sender: TObject; AReportLink: TBasedxReportLink; + var ADone: Boolean) of object; + + TdxGenerateReportProgressEvent = procedure(Sender: TObject; + AReportLink: TBasedxReportLink; APercentDone: Double {'##0.00'}) of object; + + TdxGetPrintTitleEvent = procedure(Sender: TObject; AReportLink: TBasedxReportLink; + var ATitle: string) of object; + + TdxPrintDlgDataEvent = procedure(Sender: TObject; AReportLink: TBasedxReportLink; + var APrintDlgData: TdxPrintDlgData) of object; + + TdxMeasureReportTitleEvent = procedure(Sender: TObject; AReportLink: TBasedxReportLink; + var AHeight: Integer) of object; + + TdxNewPageEvent = procedure(Sender: TObject; AReportLink: TBasedxReportLink; + APageIndex: Integer) of object; + + TdxPageSetupEvent = procedure(Sender: TObject; AReportLink: TBasedxReportLink; + ADone: Boolean) of object; + + TdxPreviewEvent = procedure(Sender: TObject; AReportLink: TBasedxReportLink) of object; + + TdxPrintDeviceProblemEvent = procedure(Sender: TObject; var ADone: Boolean) of object; + + TdxReportLinkNotifyEvent = procedure(Sender: TObject; AReportLink: TBasedxReportLink) of object; + + TdxStartPrintEvent = procedure(Sender: TObject; AReportLink: TBasedxReportLink; + APageCount: Integer) of object; + + TdxCPOption = (cpoAutoRebuildBeforePreview, cpoAutoRebuildBeforePrint, + cpoGenerateReportProgressEvent, cpoShowHourGlass, cpoDropStorageModeAfterPreview); + TdxCPOptions = set of TdxCPOption; + + TdxCPState = (cpsBuilding, cpsDesigning, cpsPreviewing, cpsPrinting, cpsPrintDialog, + cpsPageSetupDialog, cpsDefineStylesDialog, cpsCustomizing, cpsLoading, cpsSaving, + cpsExplore); + TdxCPStates = set of TdxCPState; + + TdxPSBuildStage = (bsStart, bsProgress, bsEnd); + TdxPSPrintStage = (psStart, psProgress, psEnd); + + TdxPSComponentPrinterExplorerChangeNotifier = class(TdxPSExplorerChangeNotifierAdapter) + private + FComponentPrinter: TCustomdxComponentPrinter; + protected + procedure ItemDataUnloaded(AnItem: TdxPSExplorerItem); override; + public + constructor Create(AComponentPrinter: TCustomdxComponentPrinter); + property ComponentPrinter: TCustomdxComponentPrinter read FComponentPrinter; + end; + + TCustomdxComponentPrinter = class(TComponent) + private + FAbortBuilding: Boolean; + FAbortPrinting: Boolean; + FAutoUpdateDateTime: Boolean; + FBeepAfterLongOperations: Boolean; + FCurrentLink: TBasedxReportLink; + FDateFormat: Integer; + FExplorer: TCustomdxPSExplorer; + FExplorerChangeNotifier: TdxPSComponentPrinterExplorerChangeNotifier; + FExplorerStubLink: TBasedxReportLink; + FInternalStreaming: Boolean; + FLongOperationTime: Integer; + FOptions: TdxCPOptions; + FPageNumberFormat: TdxPageNumberFormat; + FPreviewOptions: TdxPreviewOptions; + FPreviewWindow: TBasedxPreviewWindow; + FPreviewWindowDesigner: TAbstractdxPreviewWindowDesigner; + FPrintFileList: TStrings; + FPrintTitle: string; + FReportLinkDesigner: TAbstractdxReportLinkDesigner; + FReportLinks: TList; + FState: TdxCPStates; + FTimeFormat: Integer; + FVersion: Integer; + + FOnAddReportLink: TdxReportLinkNotifyEvent; + FOnAfterPreview: TdxPreviewEvent; + FOnBeforeDesignReport: TdxBeforeDesignReportEvent; + FOnBeforePreview: TdxPreviewEvent; + FOnChangeComponent: TdxReportLinkNotifyEvent; + FOnChangeCurrentLink: TNotifyEvent; + FOnCustomDrawPage: TdxCustomDrawPageEvent; + FOnCustomDrawPageFooter: TdxCustomDrawPageHFEvent; + FOnCustomDrawPageHeader: TdxCustomDrawPageHFEvent; + FOnCustomDrawReportTitle: TdxCustomDrawReportTitleEvent; + FOnDeleteReportLink: TdxReportLinkNotifyEvent; + FOnDesignReport: TdxDesignReportEvent; + FOnEndGenerateReport: TdxReportLinkNotifyEvent; + FOnEndPrint: TdxReportLinkNotifyEvent; + FOnFinalizePrintDlgData: TdxPrintDlgDataEvent; + FOnGenerateReportProgress: TdxGenerateReportProgressEvent; + FOnGetPrintTitle: TdxGetPrintTitleEvent; + FOnInitializePrintDlgData: TdxPrintDlgDataEvent; + FOnMeasureReportTitle: TdxMeasureReportTitleEvent; + FOnNewPage: TdxNewPageEvent; + FOnPageSetup: TdxPageSetupEvent; + FOnPrintDeviceBusy: TdxPrintDeviceProblemEvent; + FOnPrintDeviceError: TdxPrintDeviceProblemEvent; + FOnStartGenerateReport: TdxReportLinkNotifyEvent; + FOnStartPrint: TdxStartPrintEvent; + + FEndTime: DWORD; + FHFTextEntryChooseSubscriber: TdxEventSubscriber; + FLongOperationCounter: Integer; + FMemoryStream: TStream; + FModalPreview: Boolean; + FPrintAll: Boolean; + FSaveCollate: Boolean; + FSaveCopies: Integer; + FSavePageIndex: Integer; + FSavePrintToFile: Boolean; + FStartTime: DWORD; + FWindowHandle: HWND; + function GetCurrentLinkIndex: Integer; + function GetExplorerRealStubLink: TBasedxReportLink; + function GetIsExplorerMode: Boolean; + function GetLinkCount: Integer; + function GetPreviewCaption: string; + function GetReportLink(index: Integer): TBasedxReportLink; + procedure SetAbortBuilding(Value: Boolean); + procedure SetAbortPrinting(Value: Boolean); + procedure SetAutoUpdateDateTime(Value: Boolean); + procedure SetCurrentLink(Value: TBasedxReportLink); + procedure SetCurrentLinkIndex(Value: Integer); + procedure SetDateFormat(Value: Integer); + procedure SetExplorer(Value: TCustomdxPSExplorer); + procedure SetExplorerStubLink(Value: TBasedxReportLink); + procedure SetLongOperationTime(Value: Integer); + procedure SetPageNumberFormat(Value: TdxPageNumberFormat); + procedure SetPreviewOptions(Value: TdxPreviewOptions); + procedure SetupPreviewProperties(APreviewWindow: TBasedxPreviewWindow); + procedure SetPrintFileList(Value: TStrings); + procedure SetReportLink(index: Integer; Value: TBasedxReportLink); + procedure SetTimeFormat(Value: Integer); + + function BeginPrintPages(const Source: string; out APageIndexes: TIntegers): Boolean; + procedure EndPrintPages(var APageIndexes: TIntegers); + + function CreatePreviewWindow(AReportLink: TBasedxReportLink): TBasedxPreviewWindow; + procedure DestroyPreviewWindow; + + procedure FinalizeDefaultPrintDlgData(AReportLink: TBasedxReportLink; var APrintDlgData: TdxPrintDlgData); virtual; + procedure InitializeDefaultPrintDlgData(AReportLink: TBasedxReportLink; out APrintDlgData: TdxPrintDlgData); virtual; + + procedure InitDevModeFromPrinterPageSettings(APrinterPage: TdxPrinterPage); + + function PrintDialog(AReportLink: TBasedxReportLink; var APrintDlgData: TdxPrintDlgData): Boolean; + function PrintPagesAsStringEx(const APages: string; APageNums: TdxPageNumbers; + ACopyCount: Integer; ACollate: Boolean; AReportLink: TBasedxReportLink = nil): Boolean; + procedure PrnDlgPageSetup(Sender: TObject; var ADone: Boolean; + APreviewBtnClicked, APrintBtnClicked: PBoolean); + + procedure RaiseBuildingEvent(AReportLink: TBasedxReportLink; + const APercentCompleted: Double; AStage: TdxPSBuildStage); + procedure RaisePrintingEvent(AReportLink: TBasedxReportLink; + APageIndex, APageCount: Integer; AStage: TdxPSPrintStage); + + procedure ActivateLink(AReportLink: TBasedxReportLink); + function CheckLink(Value: TBasedxReportLink): TBasedxReportLink; + function CreateLink(ALinkClass: TdxReportLinkClass; + AComponent: TComponent; AOwner: TComponent): TBasedxReportLink; + procedure DeactivateLink(AReportLink: TBasedxReportLink); + procedure InsertLink(Value: TBasedxReportLink); + procedure MoveLink(ACurIndex, ANewIndex: Integer); + procedure RemoveLink(Value: TBasedxReportLink); + procedure ResyncCurrentLink(AIndex: Integer); + + procedure OnHFTextEntryChosen(Sender: TObject; const AEntry: string); + + { design-time support } + procedure DesignerModified; + procedure DesignerUpdate(AnItem: TBasedxReportLink); + function IsDesigning: Boolean; + function IsDestroying: Boolean; + function IsLoading: Boolean; + + procedure ShowExistingPreviewWindow; + procedure WndProc(var Message: TMessage); + protected + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + procedure Loaded; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure SetChildOrder(Child: TComponent; Order: Integer); override; + procedure SetName(const NewName: TComponentName); override; + + procedure DoAddReportLink(AReportLink: TBasedxReportLink); dynamic; + procedure DoAfterPreview(AReportLink: TBasedxReportLink); dynamic; + procedure DoBeforeDesignReport(AReportLink: TBasedxReportLink); dynamic; + procedure DoBeforeDestroyReport(AReportLink: TBasedxReportLink); dynamic; + procedure DoBeforePreview(AReportLink: TBasedxReportLink); dynamic; + procedure DoChangeComponent(AReportLink: TBasedxReportLink); dynamic; + procedure DoChangeCurrentLink; dynamic; + procedure DoCustomDrawEntirePage(AReportLink: TBasedxReportLink; ACanvas: TCanvas; + APageIndex: Integer; ARect: TRect; ANom, ADenom: Integer); virtual; + procedure DoCustomDrawPageHeaderOrFooter(AReportLink: TBasedxReportLink; + AHFObject: TCustomdxPageObject; ACanvas: TCanvas; APageIndex: Integer; + R: TRect; var ADefaultDrawText, ADefaultDrawBackground: Boolean; + APixelsNumerator: Integer = 0); virtual; + procedure DoCustomDrawReportTitle(AReportLink: TBasedxReportLink; ACanvas: TCanvas; + ARect: TRect; var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var AColor: TColor; AFont: TFont; var ADone: Boolean; + APixelsNumerator: Integer = 0); virtual; + procedure DoDeleteReportLink(AReportLink: TBasedxReportLink); dynamic; + procedure DoDesignReport(AReportLink: TBasedxReportLink; ADone: Boolean); dynamic; + procedure DoEndPrint(AReportLink: TBasedxReportLink); dynamic; + procedure DoFinalizePrintDlgData(AReportLink: TBasedxReportLink; var APrintDlgData: TdxPrintDlgData); dynamic; + procedure DoInitializePrintDlgData(AReportLink: TBasedxReportLink; var APrintDlgData: TdxPrintDlgData); dynamic; + procedure DoMeasureReportTitle(AReportLink: TBasedxReportLink; var AHeight: Integer); virtual; + procedure DoNewPage(AReportLink: TBasedxReportLink; APageIndex: Integer); dynamic; + procedure DoPageParamsChanged(AReportLink: TBasedxReportLink); + procedure DoPageSetup(AReportLink: TBasedxReportLink; ADone: Boolean); dynamic; + procedure DoPrintDeviceBusy; dynamic; + procedure DoPrintDeviceError; dynamic; + procedure DoProgress(AReportLink: TBasedxReportLink; const PercentDone: Double); dynamic; + procedure DoStartPrint(AReportLink: TBasedxReportLink; FullPageCount: Integer); dynamic; + procedure DoStartUpdateReport(AReportLink: TBasedxReportLink); dynamic; + procedure DoEndUpdateReport(AReportLink: TBasedxReportLink); dynamic; + function GetPrintTitle(AReportLink: TBasedxReportLink): string; dynamic; + procedure StdProcessPrintDeviceBusy; virtual; + procedure StdProcessPrintDeviceError; virtual; + + function IsCustomPrintDlgData: Boolean; + + function IsForegroundPreviewWindow: Boolean; + function IsGenerateReportProgressEvent: Boolean; + function IsRebuildBeforeOutput(AForceRebuild: Boolean): Boolean; + function IsRebuildBeforePreview: Boolean; + function IsRebuildBeforePrint: Boolean; + function IsShowHourGlass: Boolean; + + procedure PaintThumbnailPage(ACanvas: TCanvas; APageIndex: Integer; + const APageBounds, AContentBounds: TRect; AReportLink: TBasedxReportLink = nil); + procedure PaintThumbnailPageIndex(ACanvas: TCanvas; const R: TRect; APageIndex: Integer); + + procedure FormatChanged(AReportLink: TBasedxReportLink); + procedure PreparePageSetup; + procedure PrepareBuildReport(AReportLink: TBasedxReportLink); + procedure PrepareLongOperation; + procedure PreparePrintDevice; + procedure PrepareReport(AReportLink: TBasedxReportLink); + procedure PrintPage(AReportLink: TBasedxReportLink; APageIndex: Integer); virtual; + procedure UnprepareBuildReport(AReportLink: TBasedxReportLink); + procedure UnprepareLongOperation; + procedure UnpreparePageSetup; + procedure UnpreparePrintDevice; + procedure UnprepareReport(AReportLink: TBasedxReportLink); + + { Stream loading } + procedure AfterLoadFromStream(AStream: TStream); + procedure BeforeLoadFromStream(AStream: TStream); + procedure ErrorLoadFromStream(AStream: TStream); + procedure LoadItselfFromStream(AStream: TStream); + procedure LoadLinksFromStream(AStream: TStream); + procedure LoadVersionFromStream(AStream: TStream; var AVersion: Integer); + procedure PrepareLoadFromStream(AStream: TStream); + procedure UnprepareLoadFromStream(AStream: TStream); + { Stream saving} + procedure PrepareSaveToStream(AStream: TStream); + procedure SaveItselfToStream(AStream: TStream); + procedure SaveLinksToStream(AStream: TStream); + procedure SaveVersionToStream(AStream: TStream); + procedure UnprepareSaveToStream(AStream: TStream); + + property ExplorerChangeNotifier: TdxPSComponentPrinterExplorerChangeNotifier read FExplorerChangeNotifier; + property PreviewCaption: string read GetPreviewCaption; + property OnAfterPreview: TdxPreviewEvent read FOnAfterPreview write FOnAfterPreview; + property OnBeforeDesignReport: TdxBeforeDesignReportEvent read FOnBeforeDesignReport write FOnBeforeDesignReport; + property OnBeforePreview: TdxPreviewEvent read FOnBeforePreview write FOnBeforePreview; + property OnChangeComponent: TdxReportLinkNotifyEvent read FOnChangeComponent write FOnChangeComponent; + property OnChangeCurrentLink: TNotifyEvent read FOnChangeCurrentLink write FOnChangeCurrentLink; + property OnCustomDrawPageHeader: TdxCustomDrawPageHFEvent read FOnCustomDrawPageHeader write FOnCustomDrawPageHeader; + property OnCustomDrawPageFooter: TdxCustomDrawPageHFEvent read FOnCustomDrawPageFooter write FOnCustomDrawPageFooter; + property OnCustomDrawReportTitle: TdxCustomDrawReportTitleEvent read FOnCustomDrawReportTitle write FOnCustomDrawReportTitle; + property OnDesignReport: TdxDesignReportEvent read FOnDesignReport write FOnDesignReport; + property OnMeasureReportTitle: TdxMeasureReportTitleEvent read FOnMeasureReportTitle write FOnMeasureReportTitle; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + function AddComposition: TdxCompositionReportLink; + function AddEmptyLink(ALinkClass: TdxReportLinkClass): TBasedxReportLink; + function AddEmptyLinkEx(ALinkClass: TdxReportLinkClass; AOwner: TComponent): TBasedxReportLink; + function AddLink(AComponent: TComponent): TBasedxReportLink; + function AddLinkEx(AComponent: TComponent; AOwner: TComponent): TBasedxReportLink; + procedure AssignReportLinks(Source: TCustomdxComponentPrinter); + function CreateLinkFromFile(const AFileName: string): TBasedxReportLink; + function CreateLinkFromStream(AStream: TStream): TBasedxReportLink; + procedure DeleteAllLinks; + procedure DeleteLink(AIndex: Integer); + procedure DestroyReport(AReportLink: TBasedxReportLink = nil); + function FindLinkByComponent(Value: TComponent; ACanCreate: Boolean = False): TBasedxReportLink; + procedure GetLinks(AList: TList); + function IndexOfLink(AReportLink: TBasedxReportLink): Integer; overload; + function IndexOfLink(const AName: string): Integer; overload; + function IndexOfLinkByName(const AName: string): Integer; + function LinkByName(const AName: string): TBasedxReportLink; + procedure RebuildReport(AReportLink: TBasedxReportLink = nil); + + class function GetNewLinkName(AReportLink: TBasedxReportLink): string; + class function IsSupportedCompClass(AComponentClass: TClass): Boolean; overload; + class function IsSupportedCompClass(AComponent: TObject{TComponent}): Boolean; overload; + + { composition support } + function CurrentCompositionByLink(AReportLink: TBasedxReportLink): TdxCompositionReportLink; + procedure GetCompositionsByLink(AReportLink: TBasedxReportLink; ACompositions: TList); + procedure GetItems(AComposition: TdxCompositionReportLink; AStrings: TStrings; AExcludeAssigned: Boolean); + function IsLinkInComposition(AReportLink: TBasedxReportLink; AComposition: TdxCompositionReportLink): Boolean; + function IsLinkInCurrentComposition(AReportLink: TBasedxReportLink): Boolean; + + procedure Explore; + + function DesignerExists(AReportLink: TBasedxReportLink = nil): Boolean; + function DesignerExistsByComponent(AComponent: TComponent): Boolean; + function DesignReport(AReportLink: TBasedxReportLink = nil): Boolean; + + procedure DrawPageFooter(AReportLink: TBasedxReportLink; APageIndex: Integer; + ARect: TRect; ATitleParts: TdxPageTitleParts; ADrawBackground: Boolean); + procedure DrawPageHeader(AReportLink: TBasedxReportLink; APageIndex: Integer; + ARect: TRect; ATitleParts: TdxPageTitleParts; ADrawBackground: Boolean); + + procedure GetPageColRowCount(out ACol, ARow: Integer; AReportLink: TBasedxReportLink = nil); + function GetPageCount(AReportLink: TBasedxReportLink = nil): Integer; + + function PageSetup(AReportLink: TBasedxReportLink = nil): Boolean; + function PageSetupEx(AActivePageIndex: Integer; AShowPreviewBtn, AShowPrintBtn: Boolean; + out APreviewBtnClicked, APrintBtnClicked: Boolean; AReportLink: TBasedxReportLink = nil): Boolean; overload; + function PageSetupEx(AActivePageIndex: Integer; APreviewBtnClicked, APrintBtnClicked: PBoolean; + AReportLink: TBasedxReportLink = nil): Boolean; overload; {$IFDEF DELPHI6} deprecated; {$ENDIF} + + procedure PaintPage(ACanvas: TCanvas; APageIndex: Integer; + const APageBounds, AContentBounds: TRect; AReportLink: TBasedxReportLink = nil); + + procedure Preview(AModal: Boolean = True; AReportLink: TBasedxReportLink = nil); + function PreviewExists: Boolean; + + function Print(AShowDialog: Boolean; APPrintDlgData: PdxPrintDlgData; + AReportLink: TBasedxReportLink = nil): Boolean; + procedure PrintEx(APageNums: TdxPageNumbers; ACopies: Integer; ACollate: Boolean; + AReportLink: TBasedxReportLink = nil); + procedure PrintPages(const APageIndexes: array of Integer; + AReportLink: TBasedxReportLink = nil); + procedure PrintPagesEx(const APageIndexes: array of Integer; + APageNums: TdxPageNumbers; ACopyCount: Integer; ACollate: Boolean; + AReportLink: TBasedxReportLink = nil); + + procedure LoadFromFile(const AName: string); + procedure LoadFromStream(AStream: TStream); + procedure SaveToFile(const AName: string); + procedure SaveToStream(AStream: TStream); + + property AbortBuilding: Boolean read FAbortBuilding write SetAbortBuilding; + property AbortPrinting: Boolean read FAbortPrinting write SetAbortPrinting; + property AutoUpdateDateTime: Boolean read FAutoUpdateDateTime write SetAutoUpdateDateTime default True; + property BeepAfterLongOperations: Boolean read FBeepAfterLongOperations write FBeepAfterLongOperations default True; + property CurrentLink: TBasedxReportLink read FCurrentLink write SetCurrentLink; + property CurrentLinkIndex: Integer read GetCurrentLinkIndex write SetCurrentLinkIndex; + property DateFormat: Integer read FDateFormat write SetDateFormat default 0; + property Explorer: TCustomdxPSExplorer read FExplorer write SetExplorer; + property ExplorerRealStubLink: TBasedxReportLink read GetExplorerRealStubLink; + property ExplorerStubLink: TBasedxReportLink read FExplorerStubLink write SetExplorerStubLink; + property IsExplorerMode: Boolean read GetIsExplorerMode; + property LinkCount: Integer read GetLinkCount; + property LongOperationTime: Integer read FLongOperationTime write SetLongOperationTime default 5000; {ms} + property Options: TdxCPOptions read FOptions write FOptions + default [Low(TdxCPOption)..High(TdxCPOption)]; {dxDefaultCPOptions} + property PageNumberFormat: TdxPageNumberFormat read FPageNumberFormat write SetPageNumberFormat default pnfNumeral; + property PreviewOptions: TdxPreviewOptions read FPreviewOptions write SetPreviewOptions; + property PreviewWindow: TBasedxPreviewWindow read FPreviewWindow; + property PrintFileList: TStrings read FPrintFileList write SetPrintFileList; + property PrintTitle: string read FPrintTitle write FPrintTitle; + property ReportLink[Index: Integer]: TBasedxReportLink read GetReportLink write SetReportLink; default; + property State: TdxCPStates read FState; + property TimeFormat: Integer read FTimeFormat write SetTimeFormat default 0; + property Version: Integer read FVersion write FVersion; + + property PreviewWindowDesigner: TAbstractdxPreviewWindowDesigner read FPreviewWindowDesigner; + property ReportLinkDesigner: TAbstractdxReportLinkDesigner read FReportLinkDesigner; + + property OnAddReportLink: TdxReportLinkNotifyEvent read FOnAddReportLink write FOnAddReportLink; + property OnCustomDrawPage: TdxCustomDrawPageEvent read FOnCustomDrawPage write FOnCustomDrawPage; + property OnDeleteReportLink: TdxReportLinkNotifyEvent read FOnDeleteReportLink write FOnDeleteReportLink; + property OnEndGenerateReport: TdxReportLinkNotifyEvent read FOnEndGenerateReport write FOnEndGenerateReport; + property OnEndPrint: TdxReportLinkNotifyEvent read FOnEndPrint write FOnEndPrint; + property OnFinalizePrintDlgData: TdxPrintDlgDataEvent read FOnFinalizePrintDlgData write FOnFinalizePrintDlgData; + property OnGenerateReportProgress: TdxGenerateReportProgressEvent read FOnGenerateReportProgress write FOnGenerateReportProgress; + property OnGetPrintTitle: TdxGetPrintTitleEvent read FOnGetPrintTitle write FOnGetPrintTitle; + property OnInitializePrintDlgData: TdxPrintDlgDataEvent read FOnInitializePrintDlgData write FOnInitializePrintDlgData; + property OnNewPage: TdxNewPageEvent read FOnNewPage write FOnNewPage; + property OnPageSetup: TdxPageSetupEvent read FOnPageSetup write FOnPageSetup; + property OnPrintDeviceBusy: TdxPrintDeviceProblemEvent read FOnPrintDeviceBusy write FOnPrintDeviceBusy; + property OnPrintDeviceError: TdxPrintDeviceProblemEvent read FOnPrintDeviceError write FOnPrintDeviceError; + property OnStartGenerateReport: TdxReportLinkNotifyEvent read FOnStartGenerateReport write FOnStartGenerateReport; + property OnStartPrint: TdxStartPrintEvent read FOnStartPrint write FOnStartPrint; + end; + + TdxEnumPagesAsImagesProc = procedure(AComponentPrinter: TCustomdxComponentPrinter; + AReportLink: TBasedxReportLink; AIndex, APageIndex: Integer; + const AGraphic: TGraphic; AData: Pointer; + var AContinue: Boolean) of object; + + TdxExportProgressEvent = procedure(Sender: TCustomdxComponentPrinter; + AReportLink: TBasedxReportLink; APageCount, AIndex, APageIndex: Integer; + AData: Pointer) of object; + + TdxExportPrepareGraphicEvent = procedure(Sender: TCustomdxComponentPrinter; + AReportLink: TBasedxReportLink; const AGraphic: TGraphic; + AData: Pointer) of object; + + TdxExportGetPageFileNameEvent = procedure(Sender: TCustomdxComponentPrinter; + AIndex, APageIndex: Integer; var AFileName: string) of object; + + TdxOnFilterComponentEvent = procedure(Sender: TObject; var AComponent: TComponent; + var ACaption, ADescription: string; var Accept: Boolean) of object; + + TdxOnGetSupportedComponentsEvent = procedure(Sender: TObject; AComponents: TStrings) of object; + + TdxCPCustomizeDlgOption = (cdoShowDescription); + TdxCPCustomizeDlgOptions = set of TdxCPCustomizeDlgOption; + + TdxComponentPrinter = class(TCustomdxComponentPrinter) + private + FCustomizeDlgOptions: TdxCPCustomizeDlgOptions; + FOverWriteAll: Boolean; + FOverWriteExistingFiles: Boolean; + FOverWriteFile: Boolean; + FOnExportGetPageFileName: TdxExportGetPageFileNameEvent; + FOnExportPrepareGraphic: TdxExportPrepareGraphicEvent; + FOnExportProgress: TdxExportProgressEvent; + FOnFilterComponent: TdxOnFilterComponentEvent; + FOnGetSupportedComponents: TdxOnGetSupportedComponentsEvent; + procedure WritePageAsImageToDisk(AComponentPrinter: TCustomdxComponentPrinter; + AReportLink: TBasedxReportLink; AIndex, APageIndex: Integer; + const AGraphic: TGraphic; AData: Pointer; + var AContinue: Boolean); + protected + procedure Loaded; override; + function DoFilterComponent(AComponent: TComponent; var ACaption, ADescription: string): Boolean; dynamic; + procedure GetDefaultExportPageFileName(AIndex, APageIndex: Integer; var AFileName: string); dynamic; + procedure GetExportPageFileName(AIndex, APageIndex: Integer; var AFileName: string); dynamic; + function GetSupportedComponents(AComponents: TStrings): Boolean; dynamic; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + procedure ShowCustomizeDlg; + + procedure LoadFromRegistry(const APath: string); + procedure SaveToRegistry(const APath: string); + + procedure EnumPagesAsImages(const APageIndexes: array of Integer; + AGraphicClass: TGraphicClass; ADrawBackground: Boolean; + ACallBackProc: TdxEnumPagesAsImagesProc; ACallBackData, AProgressData, + APrepareData: Pointer; + AReportLink: TBasedxReportLink = nil); + procedure SavePagesAsImagesToDisk(const APageIndexes: array of Integer; + AGraphicClass: TGraphicClass; ADrawBackground: Boolean; const AFileMask: string; + AProgressData, APrepareData: Pointer; + AReportLink: TBasedxReportLink = nil); + published + property AutoUpdateDateTime; + property BeepAfterLongOperations; + property CurrentLink; + property CustomizeDlgOptions: TdxCPCustomizeDlgOptions read FCustomizeDlgOptions write FCustomizeDlgOptions + default [cdoShowDescription]; + property DateFormat; + property Explorer; + property ExplorerStubLink; + property LongOperationTime; + property Options; + property OverWriteExistingFiles: Boolean read FOverWriteExistingFiles write FOverWriteExistingFiles default False; + property PageNumberFormat; + property PreviewOptions; + property PrintTitle; + property TimeFormat; + property Version; + + property OnAddReportLink; + property OnAfterPreview; + property OnBeforeDesignReport; + property OnBeforePreview; + property OnChangeComponent; + property OnChangeCurrentLink; + property OnCustomDrawPage; + property OnCustomDrawPageFooter; + property OnCustomDrawPageHeader; + property OnCustomDrawReportTitle; + property OnDeleteReportLink; + property OnDesignReport; + property OnEndGenerateReport; + property OnEndPrint; + property OnExportGetPageFileName: TdxExportGetPageFileNameEvent read FOnExportGetPageFileName write FOnExportGetPageFileName; + property OnExportPrepareGraphic: TdxExportPrepareGraphicEvent read FOnExportPrepareGraphic write FOnExportPrepareGraphic; + property OnExportProgress: TdxExportProgressEvent read FOnExportProgress write FOnExportProgress; + property OnFilterComponent: TdxOnFilterComponentEvent read FOnFilterComponent write FOnFilterComponent; + property OnFinalizePrintDlgData; + property OnGetPrintTitle; + property OnGenerateReportProgress; + property OnGetSupportedComponents: TdxOnGetSupportedComponentsEvent read FOnGetSupportedComponents write FOnGetSupportedComponents; + property OnInitializePrintDlgData; + property OnMeasureReportTitle; + property OnNewPage; + property OnPageSetup; + property OnPrintDeviceBusy; + property OnPrintDeviceError; + property OnStartGenerateReport; + property OnStartPrint; + end; + + TAbstractdxPreviewWindowDesigner = class + private + FComponentPrinter: TCustomdxComponentPrinter; + protected + procedure Activate; virtual; abstract; + procedure Modified; virtual; abstract; + public + constructor Create(AComponentPrinter: TCustomdxComponentPrinter); + destructor Destroy; override; + + property ComponentPrinter: TCustomdxComponentPrinter read FComponentPrinter; + end; + + TAbstractdxReportLinkDesigner = class + private + FComponentPrinter: TCustomdxComponentPrinter; + protected + procedure Modified; virtual; abstract; + procedure Update(Item: TBasedxReportLink); virtual; abstract; + public + constructor Create(AComponentPrinter: TCustomdxComponentPrinter); + destructor Destroy; override; + + procedure BeginUpdate; virtual; abstract; + procedure CancelUpdate; virtual; abstract; + procedure EndUpdate; virtual; abstract; + + property ComponentPrinter: TCustomdxComponentPrinter read FComponentPrinter; + end; + +{ This si a routine for fast PrintPreview and(or) Printing an individual component. + You MUST add "unit" contained "Link" that supports the "AComponent" into the uses + clause of the your unit } + +function dxPrintComponent(AComponent: TComponent; APrintPreview: Boolean = True; + APrintDialog: Boolean = False; const AReportTitle: string = ''; + const APrintTitle: string = ''): Boolean; + +{ Enum Pages as Images routines } + +procedure dxPSEnumReportPages(AComponentPrinter: TdxComponentPrinter; + AReportLink: TBasedxReportLink; const APageIndexes: array of Integer; + AGraphicClass: TGraphicClass; AnExportBackground: Boolean; + ACallBackProc: TdxEnumPagesAsImagesProc; + ACallBackData: Pointer; + AProgressProc: TdxExportProgressEvent; + AProgressData: Pointer; + APrepareGraphicProc: TdxExportPrepareGraphicEvent; + APrepareData: Pointer); + +{ ReportLinks registration routines } + +procedure dxPSRegisterReportLink(ALinkClass: TdxReportLinkClass; + AComponentClass: TComponentClass; ADesignerClass: TdxReportLinkDesignWindowClass); +procedure dxPSUnregisterReportLink(ALinkClass: TdxReportLinkClass; + AComponentClass: TComponentClass; ADesignerClass: TdxReportLinkDesignWindowClass); +procedure dxPSUnregisterReportLinks(const ALinkClasses: array of TdxReportLinkClass); + +function dxPSDesignerClassByCompClass(AComponentClass: TClass): TdxReportLinkDesignWindowClass; overload; +function dxPSDesignerClassByCompClass(AComponent: TObject{TComponent}): TdxReportLinkDesignWindowClass; overload; + +function dxPSDesignerClassByLinkClass(ALinkClass: TClass): TdxReportLinkDesignWindowClass; overload; +function dxPSDesignerClassByLinkClass(ALink: TObject{TBasedxReportLink}): TdxReportLinkDesignWindowClass; overload; + +function dxPSLinkClassByCompClass(AComponentClass: TClass): TdxReportLinkClass; overload; +function dxPSLinkClassByCompClass(AComponent: TObject{TComponent}): TdxReportLinkClass; overload; + +procedure dxPSGetActiveReportLinksList(AClassList: TdxClassList); +procedure dxPSGetReportLinksList(AClassList: TdxClassList); +procedure dxPSGetLinkSupportedComponentsList(AClassList: TdxClassList; ALinkClass: TClass); overload; +procedure dxPSGetLinkSupportedComponentsList(AClassList: TdxClassList; ALink: TObject{TBasedxReportLink}); overload; +procedure dxPSGetSupportedComponentsList(AClassList: TdxClassList); + +function dxPSIsSupportedCompClass(AComponentClass: TClass): Boolean; overload; +function dxPSIsSupportedCompClass(AComponent: TObject{TComponent}): Boolean; overload; + +{ PreviewWindow registration routines } + +function dxPSGetPreviewWindowClassByClassName(const AClassName: string): TdxPreviewWindowClass; +procedure dxPSGetPreviewWindowList(AStrings: TStrings); +procedure dxPSRegisterPreviewWindow(APreviewWindowClass: TdxPreviewWindowClass); +procedure dxPSUnregisterPreviewWindow(APreviewWindowClass: TdxPreviewWindowClass = nil); + +{ Units convertation routines } + +function OnePixel: Integer; +function PixelsNumerator: Integer; +function PixelsDenominator: Integer; + +{ Helpers } + +procedure FixupRect(DC: HDC; var R: TRect); +procedure Get3DBorderBrushes(AEdgeStyle: TdxCellEdgeStyle; ASoft: Boolean; + var AOuterTLBrush, AOuterBRBrush, AInnerTLBrush, AInnerBRBrush: HBRUSH); +procedure Get3DBorderColors(AEdgeStyle: TdxCellEdgeStyle; ASoft: Boolean; + var AOuterTLColor, AOuterBRColor, AInnerTLColor, AInnerBRColor: TColor); + +function dxPSExplorerImages: TCustomImageList; + +procedure dxPSStartWait; +procedure dxPSStopWait; + +const + CM_FREEEXPLORERITEM = WM_DX + 25; + + cemSingle = cemPattern; // obsolete: declared only for backward compatibility + cesNone = cesRaised; // obsolete: declared only for backward compatibility + + csAll = [csLeft..csBottom]; + csTopLeft = [csLeft, csTop]; + csBottomRight = [csRight, csBottom]; + csLeftRight = [csLeft, csRight]; + csTopBottom = [csTop, csBottom]; + + tlpAll: TdxPSTreeLineParts = [tlpTop, tlpRight, tlpBottom]; + + dxAlignment: array[TdxTextAlignX] of TAlignment = (taLeftJustify, taCenter, taRightJustify, taCenter, taCenter); + dxCalcFormat: array[Boolean] of UINT = + (DXTO_CALCRECT or DXTO_AUTOINDENTS {or DXTO_EXPANDTABS} or DXTO_CHARBREAK or DXTO_SINGLELINE, + DXTO_CALCRECT or DXTO_AUTOINDENTS or DXTO_EXPANDTABS or DXTO_CHARBREAK or DXTO_WORDBREAK); + + dxDrawTextTextAlignX: array[TdxTextAlignX] of UINT = (DT_LEFT, DT_CENTER, DT_RIGHT, DT_CENTER, DT_CENTER); + dxDrawTextTextAlignY: array[TdxTextAlignY] of UINT = (DT_TOP, DT_VCENTER, DT_BOTTOM, DT_TOP); + + dxImageLayout: array[TAlignment] of TdxImageLayout = (ilImageCenterLeft, ilImageCenterRight, ilImageCenterCenter); + dxMultilineTextAlignY: array[Boolean] of TdxTextAlignY = (taCenterY, taTop); + dxTextAlignX: array[TAlignment] of TdxTextAlignX = (taLeft, taRight, taCenterX); + dxTextAlignY: array[TTextLayout] of TdxTextAlignY = (taTop, taCenterY, taBottom); + + //TdxCellEdgeStyle = (cesRaised, cesSunken) + dxCellBorderClassMap: array[TdxCellEdgeStyle, Boolean] of TdxPSCellBorderClass = + ((TdxPSCellRaisedBorder, TdxPSCellRaisedSoftBorder), + (TdxPSCellSunkenBorder, TdxPSCellSunkenSoftBorder)); + dxDefaultCPOptions = + [cpoAutoRebuildBeforePreview, cpoAutoRebuildBeforePrint, + cpoGenerateReportProgressEvent, cpoShowHourGlass, cpoDropStorageModeAfterPreview]; + dxDefaultPreviewEnableOptions = + [peoCanChangeMargins, peoPageBackground, peoPageSetup, peoPreferences, + peoPrint, peoReportDesign]; + dxDefaultPreviewVisibleOptions = + [pvoPageBackground, pvoPageSetup, pvoPreferences, pvoPrint, pvoReportDesign, + pvoPrintStyles, pvoReportFileOperations, pvoPageMargins]; + + dxThumbnailsZoomFactors: array[TdxPSThumbnailsSize] of Integer = (5, 10); + + dxDefaultBkColor = clWhite; + dxDefaultBreakByChars = True; + dxDefaultCellSides = csAll; + dxDefaultCheckFlatBorder = True; + dxDefaultCheckPos = ccpCenter; + dxDefaultColor = clWhite; + dxDefaultContentColor = dxDefaultColor; + dxDefaultCrossSignCrossSize = 9; // pixels + dxDefaultEdgeMode = cemPattern; + dxDefaultEdge3DSoft = True; + dxDefaultEdge3DStyle = cesRaised; + dxDefaultEndEllipsis = False; + dxDefaultExpandButtonBorderColor = clBlack; + dxDefaultFixedColor = clBtnFace; //clSilver; + dxDefaultFixedTransparent = False; + dxDefaultFont: array[0..LF_FACESIZE - 1] of Char = 'Times New Roman'; + dxDefaultGridLineColor = clBlack; + dxDefaultGroupBorderColor = clBtnFace; + dxDefaultGroupCaptionColor = clBtnFace; + dxDefaultGroupCaptionSeparatorColor = clBtnFace; + dxDefaultGroupColor = clBtnFace; + dxDefaultHidePrefix = False; + dxDefaultMultiline = False; + dxDefaultShadowColor = clBlack; + dxDefaultShadowDepth = 3; + dxDefaultSortOrder = csoNone; + dxDefaultPreventLeftTextExceed = True; + dxDefaultPreventTopTextExceed = True; + dxDefaultReportGroupCaptionIndent = 5; + dxDefaultReportGroupLookAndFeel: TdxPSReportGroupLookAndFeelClass = TdxPSReportGroupStandardLookAndFeel; + dxDefaultTextAlignX = taLeft; + dxDefaultTextAlignY = taCenterY; + dxDefaultTransparent = True; + dxDefaultTreeLineColor = clGray; + + dxPSDefaultFontCharSet = DEFAULT_CHARSET; + dxPSDefaultFontColor = clBlack; + dxPSDefaultFontName = 'Times New Roman'; + dxPSDefaultFontSize = 8; + dxPSDefaultFontStyle = []; + + dxPSDefaultPreviewThumbnailsFontColor = clBlue; + dxPSDefaultPreviewThumbnailsFontName = 'Tahoma'; + dxPSDefaultPreviewThumbnailsFontSize = 48; + dxPSDefaultPreviewThumbnailsFontStyle = []; + + dxPSDefaultReportTitleFontColor = clBlack; + dxPSDefaultReportTitleFontName = dxPSDefaultFontName; + dxPSDefaultReportTitleFontSize = 14; + dxPSDefaultReportTitleFontStyle = [fsBold]; + + dxRadioGroupInterColumnsMinSpace = 1; + dxRadioGroupInterRowsMinSpace = 1; + dxRadioGroupBoundsIndent = 2; + + dxTextSpace = 2; + + dxPSReportFileLongExtension = 'ExpressPrinting System-Report'; //Don't Localize + dxPSReportFileShortExtension = 'rps'; //Don't Localize + + dxSortMarkRgnSize = 16; + dxSortMarkWidth = 8; + dxSortMarkHeight = 7; + + sdxDocumentCaptionSeparator = '-'; + +var + FUnitsPerInch: Integer = 4800; + FDontPrintTransparentImages: Boolean = False; // affects only on Printout + + iiExplorerFolderCollapsed: Integer = -1; + iiExplorerFolderExpanded: Integer = -1; + iiExplorerItem: Integer = -1; + iiExplorerItemHasInvalidData: Integer = -1; + iiDriveTypes: array[TdxDriveType] of Integer = (-1, -1, -1, -1, -1, -1, -1); + +implementation + +uses + {$IFDEF DELPHI7} + Themes, + UxTheme, + {$ENDIF} + {$IFDEF DELPHI6} + Variants, + {$ENDIF} + {$IFNDEF CBUILDER6} + dxPSCPDsg, + {$ENDIF} + {$IFDEF USEJPEGIMAGE} + Jpeg, + {$ENDIF} + TypInfo, Registry, Consts, CommCtrl, Dialogs, ShlObj, ShellAPI, dxPSRes, + dxPSImgs, dxPSUtl, dxPSEvnt, dxPSEdgePatterns, dxfmDTFmt, dxfmPNFmt, dxPSfmTtl, + dxfmChFN, dxPrnDev, dxPSPgsMnuBld, dxPSfmReportProperties, dxPSXplorerTreeView, + dxPSCompsProvider, dxPSfmCompositionDsg, dxPSPrVwStd; + +function OffsetWindowOrgEx(DC: HDC; X, Y: Integer; Pt: PPoint): BOOL; stdcall; external gdi32 name 'OffsetWindowOrgEx'; + +const + FExplorerImages: TCustomImageList = nil; + + // Image Indexes of Drive Types in ExplorerImages + DriveTypeImageIndexMap: array[TdxDriveType] of Integer = (-1, -1, 7, 8, 9, 11, 12); + + // Page "Update Codes" that force us to Rebuild Report or Recalculate ViewInfos + SignificantPrinterPageUpdateCodes: TdxPrinterPageUpdateCodes = [ucMarginLeft, ucMarginTop, ucMarginRight, ucMarginBottom, ucScale]; + + MaxGlyphCount = 6; // Max Glyph count used in TdxCustomReportCellCheckImage + PtPerInch = 72; // Typographic Point per Inch + + // Consts used in TCustomdxReportCellImageContainer to recognize Image kind saved in Stream + imstImageList = 0; + imstShellLargeImageList = 1; + imstShellSmallImageList = 2; + imstImage = 3; + + // New ItemLink Name Template + sdxNewLinkNameTemplate = 'Link%d'; // Don't Localize + + // Const used to store/load various Report Data to/from Windows Registry or Stream(File) + sdxNil = 'nil'; // Don't Localize + sdxFilePort = 'FILE:'; // Don't Localize + + sdxAssignedDateFormat = 'OwnDateFormat'; // Don't Localize + sdxAssignedTimeFormat = 'OwnTimeFormat'; // Don't Localize + sdxAssignedPageNumberFormat = 'OwnPageNumberFormat'; // Don't Localize + sdxAutoUpdateDateTime = 'AutoUpdateDateTime'; // Don't Localize + sdxDateFormat = 'DateFormat'; // Don't Localize + sdxPageNumberFormat = 'PageNumberFormat'; // Don't Localize + sdxPrintDlgFilesRegistryPath = '\PrintDialogFiles'; // Don't Localize + sdxStartPageIndex = 'StartPageIndex'; // Don't Localize + sdxTimeFormat = 'TimeFormat'; // Don't Localize + dxFormatTextAdjustFont = Integer($80000000); + +var + FPixelsDenominator: Integer; + FPixelsNumerator: Integer; + + FSaveCursor: TCursor; + FWaitCounter: Integer = 0; + +type + {$IFDEF DELPHI7} + TCustomPanelAccess = class(TCustomPanel); + {$ENDIF} + + TdxLinkList = class; + + TdxReportLinkRegItem = class + private + FLinkList: TdxLinkList; + protected + property LinkList: TdxLinkList read FLinkList; + public + ComponentClass: TComponentClass; + DesignerClass: TdxReportLinkDesignWindowClass; + LinkClass: TdxReportLinkClass; + constructor Create(ALinkClass: TdxReportLinkClass; AComponentClass: TComponentClass; + ADesignerClass: TdxReportLinkDesignWindowClass); + destructor Destroy; override; + + function IsEqual(ALinkClass: TdxReportLinkClass; AComponentClass: TComponentClass = nil; + ADesignerClass: TdxReportLinkDesignWindowClass = nil): Boolean; + function IsLastLinkClass: Boolean; + end; + + TdxLinkList = class({$IFDEF DELPHI5}TObjectList{$ELSE}TList{$ENDIF}) + private + function GetItem(Index: Integer): TdxReportLinkRegItem; + protected + function GetLinkClassCount(ALinkClass: TdxReportLinkClass): Integer; + public + procedure Add(ALinkClass: TdxReportLinkClass; AComponentClass: TComponentClass; + ADesignerClass: TdxReportLinkDesignWindowClass); + {$IFNDEF DELPHI5} + procedure Clear; override; + procedure Delete(Index: Integer); + {$ENDIF} + + function Find(out AnIndex: Integer; ALinkClass: TdxReportLinkClass; AComponentClass: TComponentClass = nil; + ADesignerClass: TdxReportLinkDesignWindowClass = nil): Boolean; overload; + function Find(ALinkClass: TdxReportLinkClass; AComponentClass: TComponentClass = nil; + ADesignerClass: TdxReportLinkDesignWindowClass = nil): Boolean; overload; + + function FindDesignerByLink(ALinkClass: TClass): TdxReportLinkDesignWindowClass; overload; + function FindDesignerByLink(ALink: TObject{TBasedxReportLink}): TdxReportLinkDesignWindowClass; overload; + + function FindLinkByComponent(AComponentClass: TClass): TdxReportLinkClass; overload; + function FindLinkByComponent(AComponent: TObject{TComponent}): TdxReportLinkClass; overload; + + procedure GetLinks(AClassList: TdxClassList; AnExcludeInactive: Boolean = True); + procedure GetSupportedComponents(AClassList: TdxClassList; ALinkClass: TClass = nil); overload; + procedure GetSupportedComponents(AClassList: TdxClassList; ALink: TObject{TBasedxReportLink}); overload; + + procedure UnregisterLink(ALinkClass: TdxReportLinkClass; AComponentClass: TComponentClass = nil; + ADesignerClass: TdxReportLinkDesignWindowClass = nil); + procedure UnregisterLinks(const ALinkClasses: array of TdxReportLinkClass); + + property Items[Index: Integer]: TdxReportLinkRegItem read GetItem; + end; + +const + FLinkList: TdxLinkList = nil; + FPreviewWindowList: TdxClassList = nil; + +type + TdxPSExplorerTreeContainerFactory = class(TdxCustomClassFactory) + private + function GetActiveTreeContainerClass: TCustomdxPSExplorerTreeContainerClass; + public + class function Instance: TdxPSExplorerTreeContainerFactory; reintroduce; overload; + property ActiveTreeContainerClass: TCustomdxPSExplorerTreeContainerClass read GetActiveTreeContainerClass; + end; + + TdxPSExplorerTreeBuilderFactory = class(TdxCustomClassFactory) + private + // because of CLR :-( + function GetActiveBuilderClass: TdxPSExplorerTreeBuilderClass; + public + class function Instance: TdxPSExplorerTreeBuilderFactory; reintroduce; overload; + property ActiveBuilderClass: TdxPSExplorerTreeBuilderClass read GetActiveBuilderClass; + end; + + TdxPSReaderFactory = class(TdxCustomClassFactory) + private + function GetActualReaderClass: TdxPSDataReaderClass; + function GetReaderClass(Version: Integer): TdxPSDataReaderClass; + public + class function Instance: TdxPSReaderFactory; reintroduce; overload; + + property ActualReaderClass: TdxPSDataReaderClass read GetActualReaderClass; + property ReaderClasses[Version: Integer]: TdxPSDataReaderClass read GetReaderClass; default; + end; + + TdxPSWriterFactory = class(TdxCustomClassFactory) + private + function GetActualWriterClass: TdxPSDataWriterClass; + function GetWriterClass(Version: Integer): TdxPSDataWriterClass; + public + class function Instance: TdxPSWriterFactory; reintroduce; overload; + + property ActualWriterClass: TdxPSDataWriterClass read GetActualWriterClass; + property WriterClasses[Version: Integer]: TdxPSDataWriterClass read GetWriterClass; default; + end; + + +{ TdxReportLinkRegItem } + +constructor TdxReportLinkRegItem.Create(ALinkClass: TdxReportLinkClass; + AComponentClass: TComponentClass; ADesignerClass: TdxReportLinkDesignWindowClass); +begin + inherited Create; + LinkClass := ALinkClass; + ComponentClass := AComponentClass; + DesignerClass := ADesignerClass; + if GetClass(LinkClass.ClassName) = nil then + RegisterClass(LinkClass); +end; + +destructor TdxReportLinkRegItem.Destroy; +begin + if IsLastLinkClass and (GetClass(LinkClass.ClassName) <> nil) then + UnregisterClass(LinkClass); + inherited; +end; + +function TdxReportLinkRegItem.IsEqual(ALinkClass: TdxReportLinkClass; + AComponentClass: TComponentClass = nil; ADesignerClass: TdxReportLinkDesignWindowClass = nil): Boolean; +begin + Result := (LinkClass = ALinkClass) and + ((ComponentClass = nil) or (ComponentClass = AComponentClass)) and + ((DesignerClass = nil) or (DesignerClass = ADesignerClass)); +end; + +function TdxReportLinkRegItem.IsLastLinkClass: Boolean; +begin + Result := LinkList.GetLinkClassCount(LinkClass) = 1; +end; + +{ TdxLinkList } + +procedure TdxLinkList.Add(ALinkClass: TdxReportLinkClass; AComponentClass: TComponentClass; + ADesignerClass: TdxReportLinkDesignWindowClass); +var + Item: TdxReportLinkRegItem; +begin + if not Find(ALinkClass, AComponentClass, ADesignerClass) then + begin + Item := TdxReportLinkRegItem.Create(ALinkClass, AComponentClass, ADesignerClass); + Item.FLinkList := Self; + Insert(0, Item); + end; +end; + +{$IFNDEF DELPHI5} +procedure TdxLinkList.Clear; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].Free; + inherited; +end; + +procedure TdxLinkList.Delete(Index: Integer); +begin + Items[Index].Free; + inherited; +end; +{$ENDIF} + +function TdxLinkList.Find(out AnIndex: Integer; ALinkClass: TdxReportLinkClass; + AComponentClass: TComponentClass = nil; ADesignerClass: TdxReportLinkDesignWindowClass = nil): Boolean; +var + I: Integer; +begin + AnIndex := -1; + for I := 0 to FLinkList.Count - 1 do + if Items[I].IsEqual(ALinkClass, AComponentClass, ADesignerClass) then + begin + AnIndex := I; + Break; + end; + Result := AnIndex <> -1; +end; + +function TdxLinkList.Find(ALinkClass: TdxReportLinkClass; AComponentClass: TComponentClass = nil; + ADesignerClass: TdxReportLinkDesignWindowClass = nil): Boolean; +var + Index: Integer; +begin + Result := Find(Index, ALinkClass, AComponentClass, ADesignerClass); +end; + +function TdxLinkList.FindDesignerByLink(ALinkClass: TClass): TdxReportLinkDesignWindowClass; +var + I: Integer; + Item: TdxReportLinkRegItem; +begin + if ALinkClass <> nil then + for I := 0 to Count - 1 do + begin + Item := Items[I]; + if Item.LinkClass = ALinkClass then + begin + Result := Item.DesignerClass; + Exit; + end; + end; + Result := nil; +end; + +function TdxLinkList.FindDesignerByLink(ALink: TObject{TBasedxReportLink}): TdxReportLinkDesignWindowClass; +begin + if ALink <> nil then + Result := FindDesignerByLink(ALink.ClassType) + else + Result := nil; +end; + +function TdxLinkList.FindLinkByComponent(AComponentClass: TClass): TdxReportLinkClass; +var + I: Integer; + Item: TdxReportLinkRegItem; +begin + Result := nil; + if AComponentClass <> nil then + for I := 0 to Count - 1 do + begin + Item := Items[I]; + if AComponentClass.InheritsFrom(Item.ComponentClass) then + begin + Result := Item.LinkClass; + if AComponentClass = Item.ComponentClass then Exit; + end; + end; +end; + +function TdxLinkList.FindLinkByComponent(AComponent: TObject{TComponent}): TdxReportLinkClass; +begin + if AComponent <> nil then + Result := FindLinkByComponent(AComponent.ClassType) + else + Result := nil; +end; + +procedure TdxLinkList.GetLinks(AClassList: TdxClassList; AnExcludeInactive: Boolean = True); +var + Buffer: TdxClassList; + I: Integer; + Item: TdxReportLinkRegItem; + ComponentClass: TComponentClass; + LinkClass: TdxReportLinkClass; +begin + Buffer := TdxClassList.Create; + try + for I := 0 to Count - 1 do + begin + Item := Items[I]; + ComponentClass := Item.ComponentClass; + if not AnExcludeInactive or (ComponentClass = nil) or (Buffer.IndexOf(ComponentClass) = -1) then + begin + LinkClass := Item.LinkClass; + if AClassList.IndexOf(LinkClass) = -1 then + AClassList.Add(LinkClass); + if AnExcludeInactive and (ComponentClass <> nil) then + Buffer.Add(ComponentClass); + end; + end; + finally + Buffer.Free; + end; +end; + +procedure TdxLinkList.GetSupportedComponents(AClassList: TdxClassList; ALinkClass: TClass = nil); +var + I: Integer; + Item: TdxReportLinkRegItem; + ComponentClass: TComponentClass; +begin + for I := 0 to Count - 1 do + begin + Item := Items[I]; + if (ALinkClass = nil) or (Item.LinkClass = ALinkClass) then + begin + ComponentClass := Item.ComponentClass; + if AClassList.IndexOf(ComponentClass) = -1 then + AClassList.Add(ComponentClass); + end; + end; +end; + +procedure TdxLinkList.GetSupportedComponents(AClassList: TdxClassList; ALink: TObject{TBasedxReportLink}); +var + LinkClass: TClass; +begin + if ALink <> nil then + LinkClass := ALink.ClassType + else + LinkClass := nil; + GetSupportedComponents(AClassList, LinkClass); +end; + +procedure TdxLinkList.UnregisterLink(ALinkClass: TdxReportLinkClass; + AComponentClass: TComponentClass = nil; ADesignerClass: TdxReportLinkDesignWindowClass = nil); +var + Index: Integer; +begin + if Find(Index, ALinkClass, AComponentClass, ADesignerClass) then + Delete(Index); +end; + +procedure TdxLinkList.UnregisterLinks(const ALinkClasses: array of TdxReportLinkClass); +var + I: Integer; +begin + for I := Low(ALinkClasses) to High(ALinkClasses) do + UnregisterLink(ALinkClasses[I]); +end; + +function TdxLinkList.GetLinkClassCount(ALinkClass: TdxReportLinkClass): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + if Items[I].LinkClass = ALinkClass then Inc(Result); +end; + +function TdxLinkList.GetItem(Index: Integer): TdxReportLinkRegItem; +begin + Result := inherited Items[Index] as TdxReportLinkRegItem; +end; + +{ TdxPSExplorerTreeContainerFactory } + +function dxPSExplorerTreeContainerFactory: TdxPSExplorerTreeContainerFactory; +begin + Result := TdxPSExplorerTreeContainerFactory.Instance; +end; + +class function TdxPSExplorerTreeContainerFactory.Instance: TdxPSExplorerTreeContainerFactory; +begin + Result := inherited Instance as TdxPSExplorerTreeContainerFactory; +end; + +function TdxPSExplorerTreeContainerFactory.GetActiveTreeContainerClass: TCustomdxPSExplorerTreeContainerClass; +begin + Result := TCustomdxPSExplorerTreeContainerClass(Items[0]); +end; + +{ TdxPSExplorerTreeBuilderFactory } + +function dxPSExplorerTreeBuilderFactory: TdxPSExplorerTreeBuilderFactory; +begin + Result := TdxPSExplorerTreeBuilderFactory.Instance; +end; + +function dxPSExplorerTreeBuilderFactory_ActiveBuilderClass: TdxPSExplorerTreeBuilderClass; +begin + Result := dxPSExplorerTreeBuilderFactory.ActiveBuilderClass; +end; + +class function TdxPSExplorerTreeBuilderFactory.Instance: TdxPSExplorerTreeBuilderFactory; +begin + Result := inherited Instance as TdxPSExplorerTreeBuilderFactory; +end; + + // because of CLR :-( +function TdxPSExplorerTreeBuilderFactory.GetActiveBuilderClass: TdxPSExplorerTreeBuilderClass; +begin + Result := TdxPSExplorerTreeBuilderClass(Items[Count - 1]); +end; + +{ TdxPSReaderFactory } + +function dxPSReaderFactory: TdxPSReaderFactory; +begin + Result := TdxPSReaderFactory.Instance; +end; + +class function TdxPSReaderFactory.Instance: TdxPSReaderFactory; +begin + Result := inherited Instance as TdxPSReaderFactory +end; + +function TdxPSReaderFactory.GetActualReaderClass: TdxPSDataReaderClass; +begin + Result := ReaderClasses[dxPSGlbl.dxPSStorageVersion]; +end; + +function TdxPSReaderFactory.GetReaderClass(Version: Integer): TdxPSDataReaderClass; +var + I: Integer; +begin + for I := Count - 1 to 0 do + begin + Result := TdxPSDataReaderClass(Items[I]); + if Result.SupportsStorageVersion(Version) then Exit; + end; + Result := nil; +end; + +{ TdxPSWriterFactory } + +function dxPSWriterFactory: TdxPSWriterFactory; +begin + Result := TdxPSWriterFactory.Instance; +end; + +class function TdxPSWriterFactory.Instance: TdxPSWriterFactory; +begin + Result := inherited Instance as TdxPSWriterFactory; +end; + +function TdxPSWriterFactory.GetActualWriterClass: TdxPSDataWriterClass; +begin + Result := WriterClasses[dxPSGlbl.dxPSStorageVersion]; +end; + +function TdxPSWriterFactory.GetWriterClass(Version: Integer): TdxPSDataWriterClass; +var + I: Integer; +begin + for I := Count - 1 to 0 do + begin + Result := TdxPSDataWriterClass(Items[I]); + if Result.SupportsStorageVersion(Version) then Exit; + end; + Result := nil; +end; + +{ units convertation routines } + +function OnePixel: Integer; +begin + Result := FPixelsNumerator div FPixelsDenominator; + if Result = 0 then Result := 1; +end; + +function PixelsNumerator: Integer; +begin + Result := FPixelsNumerator; +end; + +function PixelsDenominator: Integer; +begin + Result := FPixelsDenominator; +end; + +{ Helpers } + +procedure FixupRect(DC: HDC; var R: TRect); +begin + if DC <> 0 then + begin + LPtoDP(DC, R, 2); + DPtoLP(DC, R, 2); + end; +end; + +const + InnerBorderBRColors: array[TdxCellEdgeStyle, Boolean] of Integer = + ((COLOR_BTNSHADOW, COLOR_BTNFACE), (COLOR_BTNSHADOW, COLOR_BTNFACE)); + InnerBorderTLColors: array[TdxCellEdgeStyle, Boolean] of Integer = + ((COLOR_BTNHIGHLIGHT, COLOR_BTNHIGHLIGHT), (COLOR_BTNSHADOW, COLOR_BTNFACE)); + + OuterBorderBRColors: array[TdxCellEdgeStyle, Boolean] of Integer = + ((COLOR_WINDOWTEXT, COLOR_WINDOWTEXT), (COLOR_BTNHIGHLIGHT, COLOR_BTNHIGHLIGHT)); + OuterBorderTLColors: array[TdxCellEdgeStyle, Boolean] of Integer = + ((COLOR_WINDOWTEXT, COLOR_WINDOWTEXT), (COLOR_WINDOWTEXT, COLOR_WINDOWTEXT)); + +procedure Get3DBorderBrushes(AEdgeStyle: TdxCellEdgeStyle; ASoft: Boolean; + var AOuterTLBrush, AOuterBRBrush, AInnerTLBrush, AInnerBRBrush: HBRUSH); +begin + AOuterTLBrush := GetSysColorBrush(OuterBorderTLColors[AEdgeStyle, ASoft]); + AOuterBRBrush := GetSysColorBrush(OuterBorderBRColors[AEdgeStyle, ASoft]); + AInnerTLBrush := GetSysColorBrush(InnerBorderTLColors[AEdgeStyle, ASoft]); + AInnerBRBrush := GetSysColorBrush(InnerBorderBRColors[AEdgeStyle, ASoft]); +end; + +procedure Get3DBorderColors(AEdgeStyle: TdxCellEdgeStyle; ASoft: Boolean; + var AOuterTLColor, AOuterBRColor, AInnerTLColor, AInnerBRColor: TColor); +begin + AOuterTLColor := GetSysColor(OuterBorderTLColors[AEdgeStyle, ASoft]); + AOuterBRColor := GetSysColor(OuterBorderBRColors[AEdgeStyle, ASoft]); + AInnerTLColor := GetSysColor(InnerBorderTLColors[AEdgeStyle, ASoft]); + AInnerBRColor := GetSysColor(InnerBorderBRColors[AEdgeStyle, ASoft]); +end; + +function dxPSExplorerImages: TCustomImageList; + + function AddShellIconByIndex(AnIndex: Integer): Integer; + var + Icon: TIcon; + begin + if AnIndex <> -1 then + begin + Icon := TIcon.Create; + try + dxPSUtl.ShellSmallImages.GetIcon(AnIndex, Icon); + Result := FExplorerImages.AddIcon(Icon); + finally + Icon.Free; + end + end + else + Result := -1; + end; + + function LoadIcon(AnExtraFlags: UINT): Integer; + const + Flags = SHGFI_USEFILEATTRIBUTES or SHGFI_ICON or SHGFI_SYSICONINDEX; + var + FileInfo: TSHFileInfo; + begin + FillChar(FileInfo, SizeOf(FileInfo), 0); + FileInfo.dwAttributes := SFGAO_FOLDER; + try + SHGetFileInfo('', FILE_ATTRIBUTE_DIRECTORY, FileInfo, SizeOf(FileInfo), Flags or AnExtraFlags); + finally + DestroyIcon(FileInfo.hIcon); + end; + Result := AddShellIconByIndex(FileInfo.iIcon); + end; + + function LoadBitmap(const AResName: string): Integer; + var + Bitmap: TBitmap; + begin + Bitmap := TBitmap.Create; + try + Bitmap_LoadFromResourceName(Bitmap, AResName); + FExplorerImages.AddMasked(Bitmap, clFuchsia); + Result := FExplorerImages.Count - 1; + finally + Bitmap.Free; + end; + end; + +var + I: TdxDriveType; +begin + if FExplorerImages = nil then + begin + FExplorerImages := TImageList.Create(nil); + FExplorerImages.Handle := ImageList_Duplicate(dxPSUtl.ShellSmallImages.Handle); + FExplorerImages.Clear; + + iiExplorerFolderCollapsed := LoadIcon(0); + iiExplorerFolderExpanded := LoadIcon(SHGFI_OPENICON); + iiExplorerItem := LoadBitmap(IDB_DXPSEXPLORERITEM_SMALL); + iiExplorerItemHasInvalidData := LoadBitmap(IDB_DXPSEXPLORERITEM_INVALID); + + for I := Low(TdxDriveType) to High(TdxDriveType) do + //iiDriveTypes[I] := AddShellIconByIndex(DriveTypeImageIndexMap[I]); + end; + Result := FExplorerImages; +end; + +procedure dxPSStartWait; +begin + if FWaitCounter = 0 then + begin + FSaveCursor := Screen.Cursor; + Screen.Cursor := crHourGlass; + end; + Inc(FWaitCounter); +end; + +procedure dxPSStopWait; +begin + if FWaitCounter <> 0 then + begin + Dec(FWaitCounter); + if FWaitCounter = 0 then Screen.Cursor := FSaveCursor; + end; +end; + +{ ReportLinks Registration and Utilities} + +function dxPSIndexOfRegItem(ALinkClass: TdxReportLinkClass; AComponentClass: TComponentClass; + ADesignerClass: TdxReportLinkDesignWindowClass): Integer; +begin + if FLinkList <> nil then + FLinkList.Find(Result, ALinkClass, AComponentClass, ADesignerClass) + else + Result := -1; +end; + +procedure dxPSRegisterReportLink(ALinkClass: TdxReportLinkClass; AComponentClass: TComponentClass; + ADesignerClass: TdxReportLinkDesignWindowClass); +begin + if (ALinkClass = nil) or + ((AComponentClass <> nil) and (dxPSIndexOfRegItem(ALinkClass, AComponentClass, ADesignerClass) <> -1)) then + Exit; + + if FLinkList = nil then + FLinkList := TdxLinkList.Create; + FLinkList.Add(ALinkClass, AComponentClass, ADesignerClass); +end; + +procedure dxPSUnregisterReportLink(ALinkClass: TdxReportLinkClass; + AComponentClass: TComponentClass; ADesignerClass: TdxReportLinkDesignWindowClass); +begin + if FLinkList <> nil then + FLinkList.UnregisterLink(ALinkClass, AComponentClass, ADesignerClass); +end; + +procedure dxPSUnregisterReportLinks(const ALinkClasses: array of TdxReportLinkClass); +begin + if FLinkList <> nil then + FLinkList.UnregisterLinks(ALinkClasses); +end; + +procedure dxPSUnregisterAllReportLinks; +begin + if FLinkList <> nil then + begin + FLinkList.Clear; + FreeAndNil(FLinkList); + end; +end; + +function dxPSDesignerClassByCompClass(AComponentClass: TClass): TdxReportLinkDesignWindowClass; +var + LinkClass: TdxReportLinkClass; +begin + LinkClass := dxPSLinkClassByCompClass(AComponentClass); + Result := dxPSDesignerClassByLinkClass(LinkClass); +end; + +function dxPSDesignerClassByCompClass(AComponent: TObject{TComponent}): TdxReportLinkDesignWindowClass; +begin + if AComponent <> nil then + Result := dxPSDesignerClassByCompClass(AComponent.ClassType) + else + Result := nil; +end; + +function dxPSLinkClassByCompClass(AComponentClass: TClass): TdxReportLinkClass; +begin + if FLinkList <> nil then + Result := FLinkList.FindLinkByComponent(AComponentClass) + else + Result := nil; +end; + +function dxPSLinkClassByCompClass(AComponent: TObject{TComponent}): TdxReportLinkClass; +begin + if FLinkList <> nil then + Result := FLinkList.FindLinkByComponent(AComponent) + else + Result := nil; +end; + +function dxPSDesignerClassByLinkClass(ALinkClass: TClass): TdxReportLinkDesignWindowClass; +begin + if FLinkList <> nil then + Result := FLinkList.FindDesignerByLink(ALinkClass) + else + Result := nil; +end; + +function dxPSDesignerClassByLinkClass(ALink: TObject{TBasedxReportLink}): TdxReportLinkDesignWindowClass; +begin + if ALink <> nil then + Result := FLinkList.FindDesignerByLink(ALink) + else + Result := nil; +end; + +procedure dxPSGetActiveReportLinksList(AClassList: TdxClassList); +begin + if FLinkList <> nil then + FLinkList.GetLinks(AClassList, True); +end; + +procedure dxPSGetReportLinksList(AClassList: TdxClassList); +begin + if FLinkList <> nil then + FLinkList.GetLinks(AClassList, False); +end; + +procedure dxPSGetLinkSupportedComponentsList(AClassList: TdxClassList; ALinkClass: TClass); +begin + if FLinkList <> nil then + FLinkList.GetSupportedComponents(AClassList, ALinkClass); +end; + +procedure dxPSGetLinkSupportedComponentsList(AClassList: TdxClassList; ALink: TObject{TBasedxReportLink}); +begin + if FLinkList <> nil then + FLinkList.GetSupportedComponents(AClassList, ALink); +end; + +procedure dxPSGetSupportedComponentsList(AClassList: TdxClassList); +begin + if FLinkList <> nil then + FLinkList.GetSupportedComponents(AClassList); +end; + +function dxPSIsSupportedCompClass(AComponentClass: TClass): Boolean; +begin + Result := dxPSLinkClassByCompClass(AComponentClass) <> nil; +end; + +function dxPSIsSupportedCompClass(AComponent: TObject{TComponent}): Boolean; +begin + Result := dxPSLinkClassByCompClass(AComponent) <> nil; +end; + +{ PreviewWindows Registration and Utilities} + +function GetPreviewClass: TdxPreviewWindowClass; +begin + Result := nil; + if (FPreviewWindowList <> nil) and (FPreviewWindowList.Count <> 0) then + Result := TdxPreviewWindowClass(FPreviewWindowList.Last); +end; + +function dxPSIndexOfPreviewWindowClass(APreviewWindowClass: TdxPreviewWindowClass): Integer; +begin + if FPreviewWindowList <> nil then + for Result := 0 to FPreviewWindowList.Count - 1 do + if TdxPreviewWindowClass(FPreviewWindowList[Result]) = APreviewWindowClass then + Exit; + Result := -1; +end; + +function dxPSGetPreviewWindowClassByClassName(const AClassName: string): TdxPreviewWindowClass; +var + I: Integer; +begin + if FPreviewWindowList <> nil then + for I := 0 to FPreviewWindowList.Count - 1 do + begin + Result := TdxPreviewWindowClass(FPreviewWindowList[I]); + if (Result <> nil) and Result.ClassNameIs(AClassName) then Exit; + end; + Result := nil; +end; + +procedure dxPSGetPreviewWindowList(AStrings: TStrings); +var + I: Integer; + PreviewWindowClass: TdxPreviewWindowClass; +begin + if FPreviewWindowList <> nil then + begin + AStrings.BeginUpdate; + try + for I := 0 to FPreviewWindowList.Count - 1 do + begin + PreviewWindowClass := TdxPreviewWindowClass(FPreviewWindowList[I]); + if PreviewWindowClass <> nil then + AStrings.AddObject(PreviewWindowClass.ClassName, TObject(PreviewWindowClass)); + end; + finally + AStrings.EndUpdate; + end; + end; +end; + +procedure dxPSRegisterPreviewWindow(APreviewWindowClass: TdxPreviewWindowClass); +begin + if FPreviewWindowList = nil then + FPreviewWindowList := TdxClassList.Create; + FPreviewWindowList.Add(APreviewWindowClass); +end; + +procedure dxPSUnregisterPreviewWindow(APreviewWindowClass: TdxPreviewWindowClass = nil); +var + Index: Integer; +begin + if FPreviewWindowList <> nil then + begin + if APreviewWindowClass = nil then + Index := FPreviewWindowList.Count - 1 + else + Index := dxPSIndexOfPreviewWindowClass(APreviewWindowClass); + + if Index <> -1 then + begin + FPreviewWindowList.Delete(Index); + if FPreviewWindowList.Count = 0 then FreeAndNil(FPreviewWindowList); + end; + end; +end; + +procedure dxPSUnregisterAllPreviewWindows; +begin + while FPreviewWindowList <> nil do dxPSUnregisterPreviewWindow(nil); +end; + +function dxPrintComponent(AComponent: TComponent; + APrintPreview: Boolean = True; APrintDialog: Boolean = False; + const AReportTitle: string = ''; const APrintTitle: string = ''): Boolean; +var + ComponentPrinter: TdxComponentPrinter; + ReportLink: TBasedxReportLink; +begin + try + ComponentPrinter := TdxComponentPrinter.Create(nil); + try + ComponentPrinter.PrintTitle := APrintTitle; + ReportLink := ComponentPrinter.AddLink(AComponent); + Result := ReportLink <> nil; + if Result then + try + ReportLink.ReportTitleText := AReportTitle; + if APrintPreview then + ReportLink.Preview(True) + else + begin + ReportLink.PrinterPage.InitFromPrintDevice; + ReportLink.Print(APrintDialog, nil); + end; + finally + ReportLink.Free; + end + finally + ComponentPrinter.Free; + end; + except + Result := False; + end; +end; + +type + TdxPSRunTimeComponentsProvider = class(TAbstractdxPSComponentsProvider) + public + procedure GetComponents(AComponentPrinter: TdxComponentPrinter; AReportLink: TBasedxReportLink; + AComponents: TStrings; AnOptions: TdxPSGetComponentOptions); override; + end; + +procedure TdxPSRunTimeComponentsProvider.GetComponents(AComponentPrinter: TdxComponentPrinter; + AReportLink: TBasedxReportLink; AComponents: TStrings; AnOptions: TdxPSGetComponentOptions); + + procedure ProcessComponent(AComponent: TComponent); + var + Caption: string; + Description: string; + Item: TdxComponentItem; + begin + Caption := AComponent.Name; + Description := ''; + if (AComponentPrinter.FindLinkByComponent(AComponent) = nil) and + (((AReportLink = nil) and dxPSIsSupportedCompClass(AComponent)) or + ((AReportLink <> nil) and AReportLink.Supports(AComponent))) and + AComponentPrinter.DoFilterComponent(AComponent, Caption, Description) then + begin + Item := dxPSCreateComponentItem(AComponent, Caption, Description); + AComponents.AddObject(Item.Caption, Item); + end; + end; + +var + Owner: TComponent; + I: Integer; +begin + if not AComponentPrinter.GetSupportedComponents(AComponents) then + begin + //Item := dxPSCreateComponentItem(nil, 'Composition', ''); + //AComponents.AddObject(Item.Caption, Item); + + Owner := AComponentPrinter.Owner; + if Owner <> nil then + begin + ProcessComponent(Owner); + for I := 0 to Owner.ComponentCount - 1 do + ProcessComponent(Owner.Components[I]); + end; + end; +end; + +{ EdxInvalidStorageVersion } + +constructor EdxInvalidStorageVersion.Create(AVersion: UINT); +begin + FVersion := AVersion; + inherited CreateFmt(cxGetResourceString(@sdxInvalidStorageVersion), [Version]); +end; + +{ TdxPSDataReader } + +class procedure TdxPSDataReader.Register; +begin + dxPSReaderFactory.Register(Self); +end; + +class procedure TdxPSDataReader.Unregister; +begin + dxPSReaderFactory.Unregister(Self); +end; + +function TdxPSDataReader.ReadClass: TClass; +begin + Result := GetClass(ReadString); +end; + +function TdxPSDataReader.ReadCellBorderClass: TdxPSCellBorderClass; +begin + Result := TdxPSCellBorderClass(ReadClass); + if Result = nil then + Result := TdxPSCellUltraFlatBorder; +end; + +function TdxPSDataReader.ReadFillPatternClass: TdxPSFillPatternClass; +begin + Result := TdxPSFillPatternClass(ReadClass); + if Result = nil then + Result := TdxPSSolidFillPattern; +end; + +function TdxPSDataReader.ReadFont(AFont: TFont): TFont; +begin + Result := AFont; + if Result = nil then Result := TFont.Create; + + with Result do + begin + Charset := TFontCharset(ReadInteger); + Color := ReadInteger; + Name := ReadString; + Pitch := TFontPitch(ReadInteger); + Size := ReadInteger; + Style := TFontStyles(Byte(ReadInteger)); + end; +end; + +function TdxPSDataReader.ReadGraphicClass: TGraphicClass; +begin + Result := TGraphicClass(ReadClass); +end; + +procedure TdxPSDataReader.ReadImage(AnImage: TGraphic); +var + MemoryStream: TMemoryStream; + HasMask: Boolean; + Mask: TBitmap; +begin + MemoryStream := TMemoryStream.Create; + try + MemoryStream.Size := {$IFDEF DELPHI6} Self.ReadInt64 {$ELSE} Self.ReadInteger {$ENDIF}; + if MemoryStream.Size <> 0 then + begin + Self.Read(MemoryStream.Memory^, MemoryStream.Size); + MemoryStream.Position := 0; + AnImage.LoadFromStream(MemoryStream); + + MemoryStream.Read(HasMask , SizeOf(HasMask)); + if HasMask then + begin + Mask := TBitmap.Create; + try + Mask.LoadFromStream(MemoryStream); + TBitmap(AnImage).MaskHandle := Mask.ReleaseHandle; + finally + Mask.Free; + end; + end; + end; + finally + MemoryStream.Free; + end; +end; + +procedure TdxPSDataReader.ReadImageList(AnImageList: TCustomImageList); +var + MemoryStream: TMemoryStream; + Adapter: IStream; +begin + MemoryStream := TMemoryStream.Create; + try + MemoryStream.Size := {$IFDEF DELPHI6} Self.ReadInt64 {$ELSE} Self.ReadInteger {$ENDIF}; + if MemoryStream.Size <> 0 then + begin + Self.Read(MemoryStream.Memory^, MemoryStream.Size); + MemoryStream.Position := 0; + Adapter := TStreamAdapter.Create(MemoryStream); + AnImageList.Handle := CommCtrl.ImageList_Read(Adapter); + end; + finally + MemoryStream.Free; + end; +end; + +function TdxPSDataReader.ReadLinkClass: TdxReportLinkClass; +begin + Result := TdxReportLinkClass(ReadClass); +end; + +function TdxPSDataReader.ReadLookAndFeelClass: TdxPSReportGroupLookAndFeelClass; +begin + Result := TdxPSReportGroupLookAndFeelClass(ReadClass); + if Result = nil then + Result := TdxPSReportGroupNullLookAndFeel; +end; + +function TdxPSDataReader.ReadPoint: TPoint; +begin + Read(Result, SizeOf(Result)); +end; + +function TdxPSDataReader.ReadPSVersion: TdxPSVersion; +begin + Read(Result, SizeOf(Result)); +end; + +function TdxPSDataReader.ReadRect: TRect; +begin + Read(Result, SizeOf(Result)); +end; + +procedure TdxPSDataReader.SkipBytes(Count: {$IFDEF DELPHI6} Int64 {$ELSE} Integer {$ENDIF}); +var + Buffer: TBytes; +begin + SetLength(Buffer, Count); + Read(Buffer, Length(Buffer)); +end; + +class function TdxPSDataReader.SupportsStorageVersion(AVersion: Integer): Boolean; +begin + Result := True; +end; + +{ TdxPSDataWriter } + +class procedure TdxPSDataWriter.Register; +begin + dxPSWriterFactory.Register(Self); +end; + +class procedure TdxPSDataWriter.Unregister; +begin + dxPSWriterFactory.Unregister(Self); +end; + +procedure TdxPSDataWriter.WriteClassName(AClass: TClass); +begin + if AClass <> nil then + WriteString(AClass.ClassName) + else + WriteString(sdxNil); +end; + +procedure TdxPSDataWriter.WriteClassName(AnObject: TObject); +begin + if AnObject <> nil then + WriteClassName(AnObject.ClassType) + else + WriteString(sdxNil); +end; + +procedure TdxPSDataWriter.WriteFont(AFont: TFont); +begin + with AFont do + begin + WriteInteger(Charset); + WriteInteger(Color); + WriteString(Name); + WriteInteger(Integer(Pitch)); + WriteInteger(Size); + WriteInteger(Integer(Byte(Style))); + end; +end; + +procedure TdxPSDataWriter.WriteImage(AnImage: TGraphic); +var + MemoryStream: TMemoryStream; + HasMask: Boolean; + Mask: TBitmap; +begin + MemoryStream:= TMemoryStream.Create; + try + AnImage.SaveToStream(MemoryStream); + + HasMask := (AnImage is TBitmap) and (TBitmap(AnImage).MaskHandle <> 0); + MemoryStream.Write(HasMask, SizeOf(HasMask)); + if HasMask then + begin + Mask := TBitmap.Create; + try + Mask.Monochrome := True; + Mask.Handle := TBitmap(AnImage).MaskHandle; + Mask.SaveToStream(MemoryStream); + finally + Mask.Free; + end; + end; + + Self.WriteInteger(MemoryStream.Size); + Self.Write(MemoryStream.Memory^, MemoryStream.Size); + finally + MemoryStream.Free; + end; +end; + +procedure TdxPSDataWriter.WriteImageList(AnImageList: TCustomImageList); +var + MemoryStream: TMemoryStream; + Adapter: IStream; +begin + MemoryStream := TMemoryStream.Create; + try + Adapter := TStreamAdapter.Create(MemoryStream); + CommCtrl.ImageList_Write(AnImageList.Handle, Adapter); + + Self.WriteInteger(MemoryStream.Size); + Self.Write(MemoryStream.Memory^, MemoryStream.Size); + finally + MemoryStream.Free; + end; +end; + +procedure TdxPSDataWriter.WritePoint(const Pt: TPoint); +begin + Write(Pt, SizeOf(Pt)); +end; + +procedure TdxPSDataWriter.WritePSVersion(const AVersion: TdxPSVersion); +begin + Write(AVersion, SizeOf(AVersion)); +end; + +procedure TdxPSDataWriter.WriteRect(const R: TRect); +begin + Write(R, SizeOf(R)); +end; + +class function TdxPSDataWriter.SupportsStorageVersion(AVersion: Integer): Boolean; +begin + Result := True; +end; + +{ TdxPageOverlayIndexes } + +function TdxPageOverlayIndexes.Add(AValue: Integer): Integer; +begin + Result := inherited Add(TObject(AValue)); +end; + +function TdxPageOverlayIndexes.GetItem(Index: Integer): Integer; +begin + Result := Integer(inherited Items[Index]); +end; + +procedure TdxPageOverlayIndexes.SetItem(Index, Value: Integer); +begin + inherited Items[Index] := TObject(Value); +end; + +{ TdxPSPageRenderInfo } + +constructor TdxPSPageRenderInfo.Create(ARenderInfo: TdxPSReportRenderInfo; + APageIndex: Integer); +begin + inherited Create; + FPageIndex := APageIndex; + FRenderInfo := ARenderInfo; + FIndexPairs := TList.Create; + FOverlays := TList.Create; +end; + +destructor TdxPSPageRenderInfo.Destroy; +begin + FreeAndNilOverlays; + FreeAndNilIndexPairs; + inherited; +end; + +procedure TdxPSPageRenderInfo.Calculate; +begin + CalculateBounds; + CalculateOffsets; + FIndexPairs.Count := CalculateIndexPairCount; + CalculateIndexPairs; + CalculateOverlayIndexes; +end; + +function TdxPSPageRenderInfo.HasDetails: Boolean; +begin + Result := not IsRectEmpty(DetailBounds); +end; + +function TdxPSPageRenderInfo.HasFooter: Boolean; +begin + Result := not IsRectEmpty(FooterBounds) and (RenderInfo.CanUseHFOnEveryPageMode or IsBottomPage); +end; + +function TdxPSPageRenderInfo.HasHeader: Boolean; +begin + Result := not IsRectEmpty(HeaderBounds) and (RenderInfo.CanUseHFOnEveryPageMode or IsTopPage); +end; + +function TdxPSPageRenderInfo.HasTitle: Boolean; +begin + Result := RenderInfo.IsDrawPageTitleOnPage(PageIndex); +end; + +function TdxPSPageRenderInfo.AreRectsIntersected(const R1, R2: TRect): Boolean; +var + R: TRect; +begin + if R1.Top = R1.Bottom then + Result := (R1.Top >= R2.Top) and (R1.Top <= R2.Bottom) // bear in mind that R.Top = R.Bottom + else + Result := Windows.IntersectRect(R, R1, R2); +end; + +procedure TdxPSPageRenderInfo.CalculateBounds; +var + H: Integer; +begin + DetailBounds := RenderInfo.CalculatePageDetailBounds(ColIndex, RowIndex); + + ContentBounds := DetailBounds; + Inc(ContentBounds.Bottom, HeaderBounds.Bottom - HeaderBounds.Top); + Inc(ContentBounds.Bottom, FooterBounds.Bottom - FooterBounds.Top); + + H := MulDiv(RenderInfo.PaintSize.Y, 100, RenderInfo.ScaleFactor); + if HasTitle then + Dec(H, TitleHeight); + + with ContentBounds do + if Bottom - Top > H then + Bottom := Top + H; +end; + +function TdxPSPageRenderInfo.CalculateIndexPairCount: Integer; +var + EndIndex, TopSide, StartIndex: Integer; + R: TRect; +begin + if (RenderInfo.EmptyPageCount > 0) or ReportLink.NeedCalcEmptyPages then + begin + EndIndex := {AStartIndex } -1; + Result := 0; + TopSide := DetailBounds.Top; + while (TopSide < DetailBounds.Bottom) and (EndIndex < ReportCells.Count) do + begin + Inc(Result); + StartIndex := EndIndex + 1; + repeat + R := ReportCells.Cells[StartIndex].AbsoluteRect; + Inc(StartIndex); + until (StartIndex = ReportCells.Count) or AreRectsIntersected(R, DetailBounds); + Dec(StartIndex); + + EndIndex := StartIndex; + repeat + R := ReportCells.Cells[EndIndex].AbsoluteRect; + Inc(EndIndex); + until (EndIndex = ReportCells.Count) or not AreRectsIntersected(R, DetailBounds); + Dec(EndIndex); + if EndIndex <> ReportCells.Count - 1 then + Dec(EndIndex); + if EndIndex < StartIndex then + EndIndex := StartIndex; + + TopSide := R.Bottom; + end; + end + else + Result := 1; +end; + +procedure TdxPSPageRenderInfo.CalculateIndexPairs; +var + EndIndex, I, StartIndex: Integer; + R: TRect; + Intersected: Boolean; +begin + if IndexPairCount <> 0 then + begin + EndIndex := {AStartIndex } -1; + for I := 0 to IndexPairCount - 1 do + begin + StartIndex := EndIndex + 1; + repeat + R := ReportCells.Cells[StartIndex].AbsoluteRect; + Inc(StartIndex); + until (StartIndex = ReportCells.Count) or AreRectsIntersected(R, DetailBounds); + Dec(StartIndex); + EndIndex := StartIndex; + // fix 2.1 + Intersected := True; + while (EndIndex < ReportCells.Count) and Intersected do + begin + R := ReportCells.Cells[EndIndex].AbsoluteRect; + Intersected := AreRectsIntersected(R, DetailBounds); + Inc(EndIndex); + end; + //Dec(EndIndex, 1 + Ord(EndIndex <> ReportCells.Count)); + Dec(EndIndex); + if EndIndex <> ReportCells.Count - 1 then + Dec(EndIndex); + if EndIndex < StartIndex then + EndIndex := StartIndex; + + IndexPairs[I].StartIndex := StartIndex; + IndexPairs[I].EndIndex := EndIndex; + end; + end + else + DetailBounds := NullRect; //TODO: TdxPSPageRenderInfo.CalculateIndexPairs +end; + +function TdxPSPageRenderInfo.CalculateIsEmptyPage: Boolean; +begin + Result := not RenderInfo.IsNonEmptyPage(DetailBounds); +end; + +procedure TdxPSPageRenderInfo.CalculateOffsets; +var + FullRect: TRect; + MarginsOffset: TPoint; + DataSize, PaintSize: Integer; +begin + FullRect := ContentBounds; + OffsetRect(FullRect, -FullRect.Left, -FullRect.Top); + FullRect := ScaleRect(FullRect, RenderInfo.ScaleFactor, 100, RenderInfo.ScaleFactor, 100); + + MarginsOffset := PrinterPage.MarginsLoMetric.TopLeft; + + // horz. + DataOffset.X := RenderInfo.LoMetricValueToInternalUnits(MarginsOffset.X); + if HasTitle then + TitleOffset.X := DataOffset.X; + if RenderInfo.PrinterPage.CenterOnPageH then + begin + DataSize := FullRect.Right - FullRect.Left; + PaintSize := RenderInfo.PaintSize.X; + if DataSize < RenderInfo.PaintSize.X then + Inc(DataOffset.X, MulDiv((PaintSize - DataSize) div 2, 100, RenderInfo.ScaleFactor)); + end; + + // vert. + DataOffset.Y := RenderInfo.LoMetricValueToInternalUnits(MarginsOffset.Y); + if HasTitle then + begin + TitleOffset.Y := DataOffset.Y; + Inc(DataOffset.Y, RenderInfo.TitleHeight); + end; + if RenderInfo.PrinterPage.CenterOnPageV then + begin + DataSize := FullRect.Bottom - FullRect.Top; + PaintSize := RenderInfo.PaintSize.Y; + if HasTitle then + Dec(PaintSize, RenderInfo.TitleBounds.Bottom - RenderInfo.TitleBounds.Top); + if DataSize < PaintSize then + Inc(DataOffset.Y, MulDiv((PaintSize - DataSize) div 2, 100, RenderInfo.ScaleFactor)); + end; +end; + +procedure TdxPSPageRenderInfo.CalculateOverlayIndexes; + + function CreateOverlayIndexes(AnOverlay: TdxReportCell): TdxPageOverlayIndexes; + var + I: Integer; + R: TRect; + begin + Result := TdxPageOverlayIndexes.Create; + + for I := 0 to AnOverlay.CellCount - 1 do + if IntersectRect(R, AnOverlay[I].AbsoluteRect, DetailBounds) then + Result.Add(I); + end; + +var + I: Integer; +begin + if (ReportCells = nil) or not ReportCells.HasOverlays then Exit; + + FOverlays.Count := ReportCells.OverlayCount; + for I := 0 to ReportCells.OverlayCount - 1 do + FOverlays[I] := CreateOverlayIndexes(ReportCells.Overlays[I]); +end; + +function TdxPSPageRenderInfo.GetColIndex: Integer; +begin + Result := PageIndex mod RenderInfo.PageColCount; +end; + +function TdxPSPageRenderInfo.GetFooterBounds: TRect; +begin + Result := RenderInfo.FooterBounds; +end; + +function TdxPSPageRenderInfo.GetHeaderBounds: TRect; +begin + Result := RenderInfo.HeaderBounds; +end; + +function TdxPSPageRenderInfo.GetIndexPair(Index: Integer): TdxContinuedIndexPair; +begin + Result := TdxContinuedIndexPair(FIndexPairs[Index]); + if Result = nil then + begin + Result := TdxContinuedIndexPair.Create; + FIndexPairs[Index] := Result; + end; +end; + +function TdxPSPageRenderInfo.GetIndexPairCount: Integer; +begin + Result := FIndexPairs.Count; +end; + +function TdxPSPageRenderInfo.GetIsBottomPage: Boolean; +begin + Result := PageIndex >= RenderInfo.PageRenderInfoCount - RenderInfo.PageColCount; +end; + +function TdxPSPageRenderInfo.GetIsEmptyPage: Boolean; +begin + if not FIsEmptyPageCalculated then + begin + FIsEmptyPageCalculated := True; + FIsEmptyPage := CalculateIsEmptyPage; + end; + Result := FIsEmptyPage; +end; + +function TdxPSPageRenderInfo.GetIsTopPage: Boolean; +begin + Result := PageIndex < RenderInfo.PageColCount; +end; + +function TdxPSPageRenderInfo.GetOverlay(Index: Integer): TdxPageOverlayIndexes; +begin + Result := TdxPageOverlayIndexes(FOverlays[Index]); +end; + +function TdxPSPageRenderInfo.GetOverlayCount: Integer; +begin + Result := FOverlays.Count; +end; + +function TdxPSPageRenderInfo.GetPrinterPage: TdxPrinterPage; +begin + Result := RenderInfo.PrinterPage; +end; + +function TdxPSPageRenderInfo.GetReportCells: TdxReportCells; +begin + Result := ReportLink.FReportCells; +end; + +function TdxPSPageRenderInfo.GetReportLink: TBasedxReportLink; +begin + Result := RenderInfo.ReportLink; +end; + +function TdxPSPageRenderInfo.GetRowIndex: Integer; +begin + Result := PageIndex div RenderInfo.PageColCount; +end; + +function TdxPSPageRenderInfo.GetTitleBounds: TRect; +begin + Result := RenderInfo.TitleBounds; +end; + +function TdxPSPageRenderInfo.GetTitleHeight: Integer; +begin + with TitleBounds do + Result := Bottom - Top; +end; + +procedure TdxPSPageRenderInfo.SetIndexPair(Index: Integer; Value: TdxContinuedIndexPair); +begin + FIndexPairs[Index] := Value; +end; + +procedure TdxPSPageRenderInfo.FreeAndNilIndexPairs; +var + I: Integer; +begin + for I := 0 to IndexPairCount - 1 do + IndexPairs[I].Free; + FreeAndNil(FIndexPairs); +end; + +procedure TdxPSPageRenderInfo.FreeAndNilOverlays; +var + I: Integer; +begin + for I := 0 to OverlayCount - 1 do + Overlays[I].Free; + FreeAndNil(FOverlays); +end; + +{ TdxPSReportRenderInfo } + +constructor TdxPSReportRenderInfo.Create(AReportLink: TBasedxReportLink); +begin + inherited Create; + FReportLink := AReportLink; + FBaseContentFont := TFont.Create; + FDelimitersX := TList.Create; + FDelimitersY := TList.Create; + FHardDelimitersY := TList.Create; + FPageDelimitersX := TList.Create; + FPageDelimitersY := TList.Create; + FPageRenderInfos := TList.Create; +end; + +destructor TdxPSReportRenderInfo.Destroy; +begin + FreeAndNilPageRenderInfos; + FreeAndNil(FBaseContentFont); + FreeAndNil(FPageDelimitersY); + FreeAndNil(FPageDelimitersX); + FreeAndNil(FHardDelimitersY); + FreeAndNil(FDelimitersY); + FreeAndNil(FDelimitersX); + inherited; +end; + +procedure TdxPSReportRenderInfo.Calculate; +begin + if not Locked then + begin + Lock; + try + Refresh; + DoCalculate; + finally + Unlock; + end; + end; +end; + +function TdxPSReportRenderInfo.CanRenderPage(AVirtualPageIndex: Integer): Boolean; +begin + Result := not (ReportLink.ShowEmptyPages and PageRenderInfos[AVirtualPageIndex].IsEmptyPage); +end; + +function TdxPSReportRenderInfo.IsDrawPageFootNoteOnPage(APageIndex: Integer): Boolean; +begin + Result := False; + {case ReportLink.ReportTitleMode of + fnmNone: + Result := False; + fnmOnLastPage: + Result := APageIndex = PageCount - 1; + else + Result := APageIndex < PageCount - PageColCount; + end;} +end; + +function TdxPSReportRenderInfo.IsDrawPageTitleOnPage(APageIndex: Integer): Boolean; +begin + case ReportLink.ReportTitleMode of + tmNone: + Result := False; + tmOnFirstPage: + Result := APageIndex = 0; + else + Result := APageIndex < PageColCount; + end; +end; + +procedure TdxPSReportRenderInfo.Lock; +begin + Inc(FLockCounter); +end; + +procedure TdxPSReportRenderInfo.Unlock; +begin + if FLockCounter <> 0 then Dec(FLockCounter); +end; + +function TdxPSReportRenderInfo.CalculateEmptyPageCount: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to PageRenderInfoCount - 1 do + if PageRenderInfos[I].IsEmptyPage then Inc(Result); +end; + +procedure TdxPSReportRenderInfo.CalculateHeaderAndFooterBounds; +begin + if ReportCells <> nil then + begin + if ReportLink.IsDrawFootersOnEveryPage or (ReportLink.DataSource = rldsExternalStorage) then + FooterBounds := ReportCells.FooterBoundsRect; + if ReportLink.IsDrawHeadersOnEveryPage or (ReportLink.DataSource = rldsExternalStorage) then + HeaderBounds := ReportCells.HeaderBoundsRect; + end; +end; + +function TdxPSReportRenderInfo.CalculatePageContentHeight(APageIndex: Integer): Integer; +var + HeaderH, FooterH, TitleH: Integer; +begin + Result := PaintSize.Y; + + HeaderH := MulDiv(HeaderHeight, ScaleFactor, 100); + FooterH := MulDiv(FooterHeight, ScaleFactor, 100); + TitleH := 0; + if IsDrawPageTitleOnPage(APageIndex) then + TitleH := MulDiv(TitleHeight, ScaleFactor, 100); + if APageIndex = 0 then + CanUseHFOnEveryPageMode := Result > HeaderH + FooterH + TitleH; + + if Result < HeaderH + FooterH + TitleH then + FooterH := 0; + if (Result < HeaderH + TitleH) and (APageIndex > FPageDelimitersX.Count - 1) then + HeaderH := 0; + + Dec(Result, HeaderH + FooterH + TitleH); +// if Result < 0 then Result := 0; +end; + +function TdxPSReportRenderInfo.CalculatePageContentWidth(APageIndex: Integer): Integer; +begin + Result := PaintSize.X; +end; + +procedure TdxPSReportRenderInfo.CalculatePageCount; +begin + VirtualPageCount := PageColCount * PageRowCount; + FPageRenderInfos.Capacity := VirtualPageCount; +end; + +procedure TdxPSReportRenderInfo.CalculatePageDelimiters; +var + I, PageIndex, Offset, PageContentWidth, PagePaintHeight, CurDelimiter, + Delimiter, HardDelimiterIndex: Integer; +begin + // Horz. + I := 0; + PageIndex := 0; + CurDelimiter := 0; + + AddPageDelimiterX(0); + while I < DelimiterXCount do + begin + PageContentWidth := CalculatePageContentWidth(PageIndex); + Offset := PageDelimitersX[PageIndex]; + while (I < DelimiterXCount) and + (MulDiv(DelimitersX[I] - Offset, ScaleFactor, 100) <= PageContentWidth) do + Inc(I); + if I < DelimiterXCount then + begin + Dec(I); + CurDelimiter := DelimitersX[I]; + if Offset - CurDelimiter >= 0 then + CurDelimiter := Offset + MulDiv(PageContentWidth, 100, ScaleFactor); + AddPageDelimiterX(CurDelimiter); + Inc(PageIndex); + end; + end; + + I := PageDelimitersX[PageDelimiterXCount - 1]; + if I <> ReportWidth then + begin + Inc(I, ReportWidth); + if PageDelimiterXCount > 1 then Dec(I, CurDelimiter); + AddPageDelimiterX(I); + end; + if PageDelimiterXCount = 1 then PageDelimiterXClear; + + // Vert. + I := 0; + PageIndex := 0; + AddPageDelimiterY(0); + while I < DelimiterYCount do + begin + PagePaintHeight := CalculatePageContentHeight(PageIndex); + if PagePaintHeight <= 0 then + begin + AddPageDelimiterY(0); + Inc(PageIndex); + Continue; + end; + Offset := PageDelimitersY[PageIndex]; + HardDelimiterIndex := -1; + while I < DelimiterYCount do + begin + Delimiter := DelimitersY[I]; + if MulDiv(Delimiter - Offset, ScaleFactor, 100) > PagePaintHeight then + Break; + if IsHardDelimiter(Delimiter) then + begin + HardDelimiterIndex := I; + if BreakPagesByHardDelimiters then Break; + end; + Inc(I); + end; + + if I < DelimiterYCount then + begin + if HardDelimiterIndex <> -1 then + I := HardDelimiterIndex + else + Dec(I); + CurDelimiter := DelimitersY[I]; + if HardDelimiterIndex <> -1 then + Inc(I); + if Offset - CurDelimiter >= 0 then + CurDelimiter := Offset + MulDiv(PagePaintHeight, 100, ScaleFactor); + AddPageDelimiterY(CurDelimiter); + Inc(PageIndex); + end; + end; + + I := PageDelimitersY[PageDelimiterYCount - 1]; + if I <> ReportHeight then + begin + Inc(I, ReportHeight); + if PageDelimiterYCount > 1 then Dec(I, CurDelimiter); + AddPageDelimiterY(I); + end; + if PageDelimiterYCount = 1 then PageDelimiterYClear; +end; + +function TdxPSReportRenderInfo.CalculatePageDetailBounds(APageCol, APageRow: Integer): TRect; +begin + Result := MakeRect(PageDelimitersX[APageCol], PageDelimitersY[APageRow], + PageDelimitersX[APageCol + 1], PageDelimitersY[APageRow + 1]); +end; + +procedure TdxPSReportRenderInfo.CalculatePageHeaderAndFooterBounds; +begin + if ReportLink.ShowPageHeader then + PageHeaderBounds := LoMetricRectToInternalUnits(PrinterPage.HeaderRectLoMetric); + if ReportLink.ShowPageFooter then + PageFooterBounds := LoMetricRectToInternalUnits(PrinterPage.FooterRectLoMetric); +end; + +procedure TdxPSReportRenderInfo.CalculatePageRenderInfos; +var + I: Integer; + PageRenderInfo: TdxPSPageRenderInfo; +begin + for I := 0 to VirtualPageCount - 1 do + begin + PageRenderInfo := CreatePageRenderInfo(I); + PageRenderInfo.Calculate; + end; +end; + +procedure TdxPSReportRenderInfo.CalculatePageRealAndVirtualIndexes(APageIndex: Integer; + out AVirtualPageIndex, ARealPageIndex: Integer); +begin + AVirtualPageIndex := RealPageIndexToVirtualPageIndex(APageIndex, False); + ARealPageIndex := VirtualPageIndexToRealPageIndex(APageIndex); +end; + +function TdxPSReportRenderInfo.CalculateTitleHeight: Integer; +const + CalcFormat: UINT = DT_CALCRECT or DT_EDITCONTROL or DT_WORDBREAK; +var + L, PrevFontHeight: Integer; + DC: HDC; + PrevFont: HFONT; + R: TRect; +begin + Result := 0; + PrevFontHeight := TitleFont.Height; + if TitleAdjustOnReportScale then + TitleFont.Height := MulDiv(PrevFontHeight, ScaleFactor, 100); + try + L := Length(TitleText); + if L <> 0 then + begin + DC := GetDC(0); + try + PrevFont := SelectObject(DC, TitleFont.Handle); + R := PrinterPage.PaintRectPixels; + OffsetRect(R, -R.Left, -R.Top); + Result := 4 + Windows.DrawText(DC, PChar(TitleText), L, R, CalcFormat); + SelectObject(DC, PrevFont); + finally + ReleaseDC(0, DC); + end; + end; + ReportLink.DoMeasureReportLinkTitle(Result); + finally + if TitleAdjustOnReportScale then + TitleFont.Height := PrevFontHeight + end; + R := PrinterPage.PaintRectPixels; + L := (R.Bottom - R.Top) div 2; + if Result > L then Result := L; + if Result < 0 then Result := 0; +end; + +procedure TdxPSReportRenderInfo.CalculateTitleBounds; +begin + TitleBounds.Right := MulDiv(PaintSize.X, 100, ScaleFactor); + TitleBounds.Bottom := MulDiv(CalculateTitleHeight, + 100 * PixelsNumerator, ScaleFactor * PixelsDenominator); +end; + +procedure TdxPSReportRenderInfo.DoCalculate; +begin + if ReportCells <> nil then + begin + BaseContentFont := ReportCells.Font; + GridLinesColor := ReportCells.BorderColor; + end; + + CalculateTitleBounds; + CalculateHeaderAndFooterBounds; + CalculatePageDelimiters; + CalculatePageCount; + CalculatePageHeaderAndFooterBounds; + CalculatePageRenderInfos; +end; + +function TdxPSReportRenderInfo.GetNonEmptyPageCount: Integer; +begin + Result := VirtualPageCount - EmptyPageCount; +end; + +function TdxPSReportRenderInfo.GetPageColCount: Integer; +begin + Result := PageDelimiterXCount - 1; + if Result < 0 then Result := 0; + if (Result = 0) and (ReportCells <> nil) and (ReportCells.HeaderCellCount <> 0) and (ReportCells.FooterCellCount <> 0) then + Result := 1; +end; + +function TdxPSReportRenderInfo.GetPageRowCount: Integer; +begin + Result := PageDelimiterYCount - 1; + if Result < 0 then Result := 0; + if (Result = 0) and (ReportCells <> nil) and (ReportCells.HeaderCellCount <> 0) and (ReportCells.FooterCellCount <> 0) then + Result := 1; +end; + +function TdxPSReportRenderInfo.GetPageSize: TPoint; +begin + with PrinterPage.RealPageSizeLoMetric do + begin + Result.X := MulDiv(X, UnitsPerInch, 254); + Result.Y := MulDiv(Y, UnitsPerInch, 254); + end; +end; + +function TdxPSReportRenderInfo.GetPaintSize: TPoint; +begin + with PrinterPage.PaintRectLoMetric do + begin + Result.X := MulDiv(Right - Left, UnitsPerInch, 254); + Result.Y := MulDiv(Bottom - Top, UnitsPerInch, 254); + end; +end; + +function TdxPSReportRenderInfo.GetUnitsPerInch: Integer; +begin + Result := FUnitsPerInch; +end; + +function TdxPSReportRenderInfo.GetWindowScalePair: TdxWindowScalePair; +begin + Result.Numerator := 100; + Result.Denominator := ScaleFactor; +end; + +procedure TdxPSReportRenderInfo.SetUnitsPerInch(Value: Integer); +begin + FUnitsPerInch := Value; +end; + +procedure TdxPSReportRenderInfo.ClearPageRenderInfos; +var + I: Integer; +begin + for I := 0 to PageRenderInfoCount - 1 do + PageRenderInfos[I].Free; + FPageRenderInfos.Clear; +end; + +function TdxPSReportRenderInfo.CreatePageRenderInfo(APageIndex: Integer): TdxPSPageRenderInfo; +begin + Result := GetPageRenderInfoClass.Create(Self, APageIndex); + FPageRenderInfos.Add(Result); +end; + +procedure TdxPSReportRenderInfo.FreeAndNilPageRenderInfos; +begin + ClearPageRenderInfos; + FreeAndNil(FPageRenderInfos); +end; + +function TdxPSReportRenderInfo.GetPageRenderInfoClass: TdxPSPageRenderInfoClass; +begin + Result := TdxPSPageRenderInfo; +end; + +procedure TdxPSReportRenderInfo.Refresh; +begin + ClearPageRenderInfos; + FPageDelimitersX.Clear; + FPageDelimitersY.Clear; + + CanUseHFOnEveryPageMode := True; + + //FIsTitleHeightCalculated := False; + FEmptyPageCount := -1; + VirtualPageCount := 0; + + FooterBounds := NullRect; + HeaderBounds := NullRect; + PageFooterBounds := NullRect; + PageHeaderBounds := NullRect; + TitleBounds := NullRect; + FPixelsNumerator := Self.UnitsPerInch; +end; + +function TdxPSReportRenderInfo.HasPageTitle(APageIndex: Integer): Boolean; +begin + Result := not IsRectEmpty(TitleBounds) and IsDrawPageTitleOnPage(APageIndex); +end; + +function TdxPSReportRenderInfo.IsHardDelimiter(AValue: Integer): Boolean; +begin + Result := FHardDelimitersY.IndexOf(TObject(AValue)) <> -1; +end; + +procedure TdxPSReportRenderInfo.ReadData(AReader: TdxPSDataReader); +begin + ReadDelimiters(AReader); +end; + +procedure TdxPSReportRenderInfo.ReadDelimiters(AReader: TdxPSDataReader); + + procedure ReadList(AList: TList); + begin + AList.Clear; + AList.Count := AReader.ReadInteger; + AReader.Read(AList.List^, AList.Count * SizeOf(Pointer)); + end; + +begin + ReadList(FDelimitersX); + ReadList(FDelimitersY); +end; + +procedure TdxPSReportRenderInfo.WriteData(AWriter: TdxPSDataWriter); +begin + WriteDelimiters(AWriter); +end; + +procedure TdxPSReportRenderInfo.WriteDelimiters(AWriter: TdxPSDataWriter); + + procedure WriteList(AList: TList); + begin + AWriter.WriteInteger(AList.Count); + AWriter.Write(AList.List^, AList.Count * SizeOf(Pointer)); + end; + +begin + WriteList(FDelimitersX); + WriteList(FDelimitersY); +end; + +procedure TdxPSReportRenderInfo.AddPageDelimiterX(AValue: Integer); +begin + FPageDelimitersX.Add(TObject(AValue)); +end; + +procedure TdxPSReportRenderInfo.AddPageDelimiterY(AValue: Integer); +begin + FPageDelimitersY.Add(TObject(AValue)); +end; + +procedure TdxPSReportRenderInfo.PageDelimiterXClear; +begin + FPageDelimitersX.Clear; +end; + +procedure TdxPSReportRenderInfo.PageDelimiterYClear; +begin + FPageDelimitersY.Clear; +end; + +procedure TdxPSReportRenderInfo.AddStandardDelimiters; +begin + DelimiterXList.Add(TObject(Integer(0))); + DelimiterXList.Add(TObject(Integer(ReportWidth))); + DelimiterYList.Add(TObject(Integer(0))); + DelimiterYList.Add(TObject(Integer(ReportHeight))); +end; + +function CompareProc(Item1, Item2: Pointer ): Integer; +begin + Result := Integer(Item1) - Integer(Item2); +end; + +procedure TdxPSReportRenderInfo.EliminateDuplicatesAndSortDelimiters(AList: TList); +var + Duplicates: TList; + I: Integer; + V: Pointer; +begin + Duplicates := TList.Create; + try + for I := 0 to AList.Count - 1 do + begin + V := AList[I]; + if Duplicates.IndexOf(V) = -1 then Duplicates.Add(V); + end; + Duplicates.Sort(CompareProc); + AList.Clear; + AList.Count := Duplicates.Count; + V := AList.List; + Move(Duplicates.List^, V^, Duplicates.Count * SizeOf(Pointer)); + finally + Duplicates.Free; + end; +end; + +procedure TdxPSReportRenderInfo.GetDelimiters; +begin + DelimiterXList.Clear; + DelimiterYList.Clear; + HardDelimiterYList.Clear; + + if UseHorzDelimiters or UseVertDelimiters then + begin + MakeDelimiters; + if UseHardVertDelimiters then + begin + MakeHardDelimiters; + EliminateDuplicatesAndSortDelimiters(HardDelimiterYList); + TrancateDelimiters(HardDelimiterYList, ReportLink.ReportHeight); + end; + end; + + AddStandardDelimiters; + + EliminateDuplicatesAndSortDelimiters(DelimiterXList); + TrancateDelimiters(DelimiterXList, ReportLink.ReportWidth); + EliminateDuplicatesAndSortDelimiters(DelimiterYList); + TrancateDelimiters(DelimiterYList, ReportLink.ReportHeight); +end; + +procedure TdxPSReportRenderInfo.MakeDelimiters; +begin + ReportLink.MakeDelimiters(ReportCells, DelimiterXList, DelimiterYList); +end; + +procedure TdxPSReportRenderInfo.MakeHardDelimiters; +begin + ReportLink.MakeHardDelimiters(ReportCells, HardDelimiterYList); +end; + +procedure TBasedxReportLink.PageParamsChanged(Sender: TdxPrinterPage; + AStyle: TBasedxPrintStyle; AUpdateCodes: TdxPrinterPageUpdateCodes); +begin + if (RealPrinterPage = Sender) and IsCurrentLink and + (SignificantPrinterPageUpdateCodes * AUpdateCodes <> []) then + begin + if Active then + if GetRebuildOnPageParamsChange(AUpdateCodes) then + RebuildReport + else + CalculateRenderInfos; + DoPageParamsChanged; + end; +end; + +function TBasedxReportLink.PossibleCustomDraw(AnItem: TAbstractdxReportCellData): Boolean; +begin + Result := (DataSource = rldsComponent) and IsSupportedCustomDraw(AnItem); +end; + +procedure TBasedxReportLink.PrepareReportGroupsLookAndFeels; +var + DC: HDC; +begin + if ReportCells <> nil then + begin + DC := GetDC(0); + try + ReportCells.PrepareReportGroupsLookAndFeels(DC); + finally + ReleaseDC(0, DC); + end; + end; +end; + +procedure TdxPSReportRenderInfo.TrancateDelimiters(AList: TList; AValue: Integer); +var + I: Integer; +begin + I := AList.Count - 1; + while (I > -1) and (Integer(AList[I]) > AValue) do + begin + AList.Delete(I); + Dec(I); + end; +end; + +function TdxPSReportRenderInfo.LoMetricRectToInternalUnits(const R: TRect): TRect; +begin + with Result do + begin + Left := LoMetricValueToInternalUnits(R.Left); + Top := LoMetricValueToInternalUnits(R.Top); + Right := LoMetricValueToInternalUnits(R.Right); + Bottom := LoMetricValueToInternalUnits(R.Bottom); + end; +end; + +function TdxPSReportRenderInfo.LoMetricValueToInternalUnits(Value: Integer): Integer; +begin + Result := MulDiv(Value, 100 * UnitsPerInch, 254 * ScaleFactor); +end; + +function TdxPSReportRenderInfo.RealPageIndexToVirtualPageIndex(APageIndex: Integer; + ATakeIntoAccountEmptyPages: Boolean): Integer; +var + I: Integer; +begin + Result := APageIndex; + if (EmptyPageCount > 0) and (not ReportLink.ShowEmptyPages or ATakeIntoAccountEmptyPages) then + begin + I := 0; + while (I < VirtualPageCount) and (I <> Result) do + begin + if PageRenderInfos[I].IsEmptyPage then Inc(Result); + Inc(I); + end; + while (Result < VirtualPageCount) and PageRenderInfos[Result].IsEmptyPage do + Inc(Result); + if Result = VirtualPageCount then Dec(Result); + end; +end; + +function TdxPSReportRenderInfo.VirtualPageIndexToRealPageIndex(APageIndex: Integer): Integer; +var + I: Integer; +begin + Result := APageIndex; + if (EmptyPageCount = 0) or not ReportLink.ShowEmptyPages then + Exit; + for I := 0 to APageIndex do + if PageRenderInfos[I].IsEmptyPage then Dec(Result); +end; + +function TdxPSReportRenderInfo.GetPrinterPage: TdxPrinterPage; +begin + Result := ReportLink.RealPrinterPage; +end; + +function TdxPSReportRenderInfo.GetReportCells: TdxReportCells; +begin + Result := ReportLink.FReportCells; +end; + +function TdxPSReportRenderInfo.GetReportHeight: Integer; +begin + Result := ReportLink.ReportHeight; +end; + +function TdxPSReportRenderInfo.GetReportWidth: Integer; +begin + Result := ReportLink.ReportWidth; +end; + +function TdxPSReportRenderInfo.GetScaleFactor: Integer; +begin + Result := ReportLink.RealScaleFactor; +end; + +function TdxPSReportRenderInfo.GetTitleAdjustOnReportScale: Boolean; +begin + Result := ReportLink.ReportTitle.AdjustOnReportScale; +end; + +function TdxPSReportRenderInfo.GetTitleFont: TFont; +begin + Result := ReportLink.ReportTitle.Font; +end; + +function TdxPSReportRenderInfo.GetTitleText: string; +begin + Result := ReportLink.ReportTitleText; +end; + +function TdxPSReportRenderInfo.GetBreakPagesByHardDelimiters: Boolean; +begin + Result := UseHardVertDelimiters and ReportLink.BreakPagesByHardDelimiters; +end; + +function TdxPSReportRenderInfo.GetDelimiterX(Index: Integer): Integer; +begin + Result := Integer(FDelimitersX.List^[Index]); +end; + +function TdxPSReportRenderInfo.GetDelimiterXCount: Integer; +begin + Result := FDelimitersX.Count; +end; + +function TdxPSReportRenderInfo.GetDelimiterY(Index: Integer): Integer; +begin + Result := Integer(FDelimitersY.List^[Index]); +end; + +function TdxPSReportRenderInfo.GetDelimiterYCount: Integer; +begin + Result := FDelimitersY.Count; +end; + +function TdxPSReportRenderInfo.GetEmptyPageCount: Integer; +begin + if FEmptyPageCount = -1 then + if ReportLink.NeedCalcEmptyPages then + FEmptyPageCount := CalculateEmptyPageCount + else + FEmptyPageCount := 0; + Result := FEmptyPageCount; +end; + +function TdxPSReportRenderInfo.GetFooterHeight: Integer; +begin + with FooterBounds do + Result := Bottom - Top; +end; + +function TdxPSReportRenderInfo.GetHeaderHeight: Integer; +begin + with HeaderBounds do + Result := Bottom - Top; +end; + +function TdxPSReportRenderInfo.GetLocked: Boolean; +begin + Result := FLockCounter <> 0; +end; + +function TdxPSReportRenderInfo.GetPageDelimiterX(Index: Integer): Integer; +begin + Result := Integer(FPageDelimitersX.List^[Index]); +end; + +function TdxPSReportRenderInfo.GetPageDelimiterXCount: Integer; +begin + Result := FPageDelimitersX.Count; +end; + +function TdxPSReportRenderInfo.GetPageDelimiterY(Index: Integer): Integer; +begin + Result := Integer(FPageDelimitersY.List^[Index]); +end; + +function TdxPSReportRenderInfo.GetPageDelimiterYCount: Integer; +begin + Result := FPageDelimitersY.Count; +end; + +function TdxPSReportRenderInfo.GetPageRenderInfo(Index: Integer): TdxPSPageRenderInfo; +begin + Result := TdxPSPageRenderInfo(FPageRenderInfos[Index]); +end; + +function TdxPSReportRenderInfo.GetPageRenderInfoCount: Integer; +begin + Result := FPageRenderInfos.Count; +end; + +function TdxPSReportRenderInfo.GetUseHardVertDelimiters: Boolean; +begin + Result := ReportLink.UseHardVertDelimiters; +end; + +function TdxPSReportRenderInfo.GetUseHorzDelimiters: Boolean; +begin + Result := ReportLink.UseHorzDelimiters; +end; + +function TdxPSReportRenderInfo.GetUseVertDelimiters: Boolean; +begin + Result := ReportLink.UseVertDelimiters; +end; + +function TdxPSReportRenderInfo.GetTitleHeight: Integer; +begin + with TitleBounds do + Result := Bottom - Top; +end; + +procedure TdxPSReportRenderInfo.SetBaseContentFont(Value: TFont); +begin + BaseContentFont.Assign(Value); +end; + +function TdxPSReportRenderInfo.IsNonEmptyPage(const ABounds: TRect): Boolean; +var + I: Integer; + R: TRect; +begin + Result := False; + if ReportCells <> nil then + for I := 0 to ReportCells.Count - 1 do + begin + R := ReportCells.Cells[I].AbsoluteRect; + Result := IntersectRect(R, R, ABounds); + if Result then Exit; + end; +end; + +{ TdxPSCellBorderPainter } + +constructor TdxPSCellBorderPainter.Create(ARenderer: TdxPSReportRenderer); +begin + inherited Create; + FRenderer := ARenderer; +end; + +class procedure TdxPSCellBorderPainter.DrawFrame(DC: HDC; R: TRect; ASides: TdxCellSides; + ATLBrush, ABRBrush: HBRUSH; ALineThickness: Integer; AThickness: Integer = 1); +var + I: Integer; + Side: TdxCellSide; + BorderBounds: TRect; +begin + for I := 0 to AThickness - 1 do + begin + for Side := csLeft to csBottom do + if Side in ASides then + begin + BorderBounds := GetBorderBounds(R, Side, ALineThickness); + if RectVisible(DC, BorderBounds) then + if Side in csTopLeft then + Windows.FillRect(DC, BorderBounds, ATLBrush) + else + Windows.FillRect(DC, BorderBounds, ABRBrush); + end; + InflateRect(R, ASides, ALineThickness); + end; +end; + +class procedure TdxPSCellBorderPainter.DrawShadow(DC: HDC; const R: TRect; + AShadowDepth: Integer; AShadowBrush, ARestSpaceBrush: HBRUSH); +begin + Windows.FillRect(DC, GetBottomShadowBounds(R, AShadowDepth), AShadowBrush); + Windows.FillRect(DC, GetBottomShadowRestSpaceBounds(R, AShadowDepth), ARestSpaceBrush); + Windows.FillRect(DC, GetRightShadowBounds(R, AShadowDepth), AShadowBrush); + Windows.FillRect(DC, GetRightShadowRestSpaceBounds(R, AShadowDepth), ARestSpaceBrush); +end; + +procedure TdxPSCellBorderPainter.Paint(DC: HDC); +var + R: TRect; +begin + with Item do + begin + R := GetBorderOuterBounds(DC); + DrawFrame(DC, R, CellSides, BorderBrush, BorderBrush, LineThickness, BorderClass.Thickness); + if ShowShadow and (ShadowDepth <> 0) then + DrawShadow(DC, R, ShadowDepth, ShadowBrush, ParentBrush); + end; +end; + +function TdxPSCellBorderPainter.BorderClass: TdxPSCellBorderClass; +begin + Result := Item.BorderClass; +end; + +function TdxPSCellBorderPainter.Item: TdxReportVisualItem; +begin + Result := FItem; +end; + +function TdxPSCellBorderPainter.Renderer: TdxPSReportRenderer; +begin + Result := FRenderer; +end; + +class function TdxPSCellBorderPainter.GetBorderBounds(const R: TRect; + ASide: TdxCellSide; ALineThickness: Integer): TRect; +begin + Result := R; + with Result do + case ASide of + csLeft: + Right := Left + ALineThickness; + csTop: + Bottom := Top + ALineThickness; + csRight: + Left := Right - ALineThickness; + csBottom: + Top := Bottom - ALineThickness; + end; +end; + +class function TdxPSCellBorderPainter.GetBottomShadowBounds(const R: TRect; + AShadowDepth: Integer): TRect; +begin + with Result do + begin + Left := R.Left + AShadowDepth; + Top := R.Bottom; + Right := R.Right + AShadowDepth; + Bottom := Top + AShadowDepth; + end; +end; + +class function TdxPSCellBorderPainter.GetBottomShadowRestSpaceBounds(const R: TRect; + AShadowDepth: Integer): TRect; +begin + with Result do + begin + Left := R.Left; + Top := R.Bottom; + Right := Left + AShadowDepth; + Bottom := Top + AShadowDepth; + end; +end; + +class function TdxPSCellBorderPainter.GetRightShadowBounds(const R: TRect; + AShadowDepth: Integer): TRect; +begin + with Result do + begin + Left := R.Right; + Top := R.Top + AShadowDepth; + Right := Left + AShadowDepth; + Bottom := Bottom; + end; +end; + +class function TdxPSCellBorderPainter.GetRightShadowRestSpaceBounds(const R: TRect; + AShadowDepth: Integer): TRect; +begin + with Result do + begin + Left := R.Right; + Top := R.Top; + Right := Left + AShadowDepth; + Bottom := Top + AShadowDepth; + end; +end; + +class procedure TdxPSCellBorderPainter.InflateRect(var R: TRect; ASides: TdxCellSides; + ALineThickness: Integer); +begin + if csLeft in ASides then Inc(R.Left, ALineThickness); + if csTop in ASides then Inc(R.Top, ALineThickness); + if csRight in ASides then Dec(R.Right, ALineThickness); + if csBottom in ASides then Dec(R.Bottom, ALineThickness); +end; + +function TdxPSCellBorderPainter.GetLineThickness: Integer; +begin + Result := Renderer.LineThickness; +end; + +{ TdxPSCustomCellBorder } + +class procedure TdxPSCustomCellBorder.Register; +begin + if GetClass(ClassName) = nil then RegisterClass(Self); +end; + +class procedure TdxPSCustomCellBorder.Unregister; +begin +end; + +class function TdxPSCustomCellBorder.Solid: Boolean; +begin + Result := True; +end; + +class function TdxPSCustomCellBorder.Thickness: Integer; +begin + Result := 0; +end; + +class function TdxPSCustomCellBorder.Edge3DSoft: Boolean; +begin + Result := False; +end; + +class function TdxPSCustomCellBorder.Edge3DStyle: TdxCellEdgeStyle; +begin + Result := cesRaised; +end; + +class function TdxPSCustomCellBorder.EdgeMode: TdxCellEdgeMode; +begin + Result := cemPattern; +end; + +class function TdxPSCustomCellBorder.GetBorderEdgeSalient(ASide: TdxCellSide; + ASalient: TdxPSCellBorderSalientType): Integer; +begin + if ASalient = bstOuter then + if ASide in csTopLeft then + Result := 1 + Thickness div 2 + else + Result := (Thickness - 1) div 2 + else + if ASide in csTopLeft then + Result := (Thickness - 1) div 2 + else + Result := 1 + Thickness div 2 +end; + +class function TdxPSCustomCellBorder.GetPainterClass: TdxPSCellBorderPainterClass; +begin + Result := TdxPSCellBorderPainter; +end; + +{ TdxPSCellNullBorderPainter } + +procedure TdxPSCellNullBorderPainter.Paint(DC: HDC); +begin + with Item do + if ShowShadow and (ShadowDepth <> 0) then + DrawShadow(DC, GetBorderOuterBounds(DC), ShadowDepth, ShadowBrush, ParentBrush); +end; + +{ TdxPSNullCellEdge } + +class function TdxPSCellNullBorder.GetPainterClass: TdxPSCellBorderPainterClass; +begin + Result := TdxPSCellNullBorderPainter; +end; + +class function TdxPSCellNullBorder.Thickness: Integer; +begin + Result := 0; +end; + +{ TdxPSCellFlatBorder } + +class function TdxPSCellFlatBorder.GetPainterClass: TdxPSCellBorderPainterClass; +begin + Result := inherited GetPainterClass;//TdxPSCellFlatBorderPainter; //TODO: +end; + +{ TdxPSCellBoldFlatBorder } + +class function TdxPSCellBoldFlatBorder.Thickness: Integer; +begin + Result := 2; +end; + +{ TdxPSCellUltraFlatBorder } + +class function TdxPSCellUltraFlatBorder.Thickness: Integer; +begin + Result := 1; +end; + +{ TdxPSCell3DBorderPainter } + +class procedure TdxPSCell3DBorderPainter.Draw3DFrame(DC: HDC; R: TRect; ASides: TdxCellSides; + AOuterTLBrush, AOuterBRBrush, AInnerTLBrush, AInnerBRBrush: HBRUSH; ALineThickness: Integer); +begin + DrawFrame(DC, R, ASides, AOuterTLBrush, AOuterBRBrush, ALineThickness); + InflateRect(R, ASides, ALineThickness); + DrawFrame(DC, R, ASides, AInnerTLBrush, AInnerBRBrush, ALineThickness); +end; + +class procedure TdxPSCell3DBorderPainter.Draw3DFrame(DC: HDC; R: TRect; ASides: TdxCellSides; + ACellBorders: TdxPSCell3DBorderClass; ALineThickness: Integer); +begin + with ACellBorders do + Draw3DFrame(DC, R, ASides, TopLeftOuterBrush, BottomRightOuterBrush, + TopLeftInnerBrush, BottomRightInnerBrush, ALineThickness); +end; + +procedure TdxPSCell3DBorderPainter.Paint(DC: HDC); +var + R: TRect; +begin + with Item do + begin + R := GetBorderOuterBounds(DC); + Draw3DFrame(DC, R, CellSides, Self.BorderClass, LineThickness); + if ShowShadow and (ShadowDepth <> 0) then + DrawShadow(DC, R, ShadowDepth, ShadowBrush, ParentBrush); + end; +end; + +function TdxPSCell3DBorderPainter.BorderClass: TdxPSCell3DBorderClass; +begin + Result := TdxPSCell3DBorderClass(inherited BorderClass); +end; + +{ TdxPSCustomCell3DBorder } + +class function TdxPSCustomCell3DBorder.Solid: Boolean; +begin + Result := False; +end; + +class function TdxPSCustomCell3DBorder.Thickness: Integer; +begin + Result := 2; +end; + +class function TdxPSCustomCell3DBorder.BottomRightInnerBrush: HBRUSH; +begin + Result := NULL_BRUSH; +end; + +class function TdxPSCustomCell3DBorder.BottomRightInnerColor: TColor; +begin + Result := clNone; +end; + +class function TdxPSCustomCell3DBorder.BottomRightOuterBrush: HBRUSH; +begin + Result := NULL_BRUSH; +end; + +class function TdxPSCustomCell3DBorder.BottomRightOuterColor: TColor; +begin + Result := clNone; +end; + +class function TdxPSCustomCell3DBorder.TopLeftInnerBrush: HBRUSH; +begin + Result := NULL_BRUSH; +end; + +class function TdxPSCustomCell3DBorder.TopLeftInnerColor: TColor; +begin + Result := clNone; +end; + +class function TdxPSCustomCell3DBorder.TopLeftOuterBrush: HBRUSH; +begin + Result := NULL_BRUSH; +end; + +class function TdxPSCustomCell3DBorder.TopLeftOuterColor: TColor; +begin + Result := clNone; +end; + +class function TdxPSCustomCell3DBorder.EdgeMode: TdxCellEdgeMode; +begin + Result := cem3DEffects; +end; + +class function TdxPSCustomCell3DBorder.GetBorderEdgeSalient(ASide: TdxCellSide; + ASalient: TdxPSCellBorderSalientType): Integer; +begin + if ASalient = bstOuter then + if ASide in csTopLeft then + Result := Thickness div 2 + else + Result := (Thickness - 1) div 2 + else + if ASide in csTopLeft then + Result := (Thickness - 1) div 2 + else + Result := Thickness div 2 +end; + +class function TdxPSCustomCell3DBorder.GetPainterClass: TdxPSCellBorderPainterClass; +begin + Result := TdxPSCell3DBorderPainter; +end; + +{ TdxPSCellRaisedBorder } + +class function TdxPSCellRaisedBorder.BottomRightInnerBrush: HBRUSH; +begin + Result := GetSysColorBrush(COLOR_BTNSHADOW); +end; + +class function TdxPSCellRaisedBorder.BottomRightInnerColor: TColor; +begin + Result := clBtnShadow; +end; + +class function TdxPSCellRaisedBorder.BottomRightOuterBrush: HBRUSH; +begin + Result := GetSysColorBrush(COLOR_WINDOWTEXT); +end; + +class function TdxPSCellRaisedBorder.BottomRightOuterColor: TColor; +begin + Result := clWindowText; +end; + +class function TdxPSCellRaisedBorder.TopLeftInnerBrush: HBRUSH; +begin + Result := GetSysColorBrush(COLOR_BTNHIGHLIGHT); +end; + +class function TdxPSCellRaisedBorder.TopLeftInnerColor: TColor; +begin + Result := clBtnHighlight; +end; + +class function TdxPSCellRaisedBorder.TopLeftOuterBrush: HBRUSH; +begin + Result := GetSysColorBrush(COLOR_WINDOWTEXT); +end; + +class function TdxPSCellRaisedBorder.TopLeftOuterColor: TColor; +begin + Result := clWindowText; +end; + +class function TdxPSCellRaisedBorder.Edge3DSoft: Boolean; +begin + Result := False; +end; + +class function TdxPSCellRaisedBorder.Edge3DStyle: TdxCellEdgeStyle; +begin + Result := cesRaised; +end; + +{ TdxPSCellRaisedSoftBorder } + +class function TdxPSCellRaisedSoftBorder.BottomRightInnerBrush: HBRUSH; +begin + Result := GetSysColorBrush(COLOR_BTNFACE); +end; + +class function TdxPSCellRaisedSoftBorder.BottomRightInnerColor: TColor; +begin + Result := clBtnFace; +end; + +class function TdxPSCellRaisedSoftBorder.Edge3DSoft: Boolean; +begin + Result := True; +end; + +{ TdxPSCellSunkenBorder } + +class function TdxPSCellSunkenBorder.BottomRightInnerBrush: HBRUSH; +begin + Result := GetSysColorBrush(COLOR_BTNFACE); +end; + +class function TdxPSCellSunkenBorder.BottomRightInnerColor: TColor; +begin + Result := clBtnFace; +end; + +class function TdxPSCellSunkenBorder.BottomRightOuterBrush: HBRUSH; +begin + Result := GetSysColorBrush(COLOR_BTNHIGHLIGHT); +end; + +class function TdxPSCellSunkenBorder.BottomRightOuterColor: TColor; +begin + Result := clBtnHighlight; +end; + +class function TdxPSCellSunkenBorder.TopLeftInnerBrush: HBRUSH; +begin + Result := GetSysColorBrush(COLOR_BTNSHADOW); +end; + +class function TdxPSCellSunkenBorder.TopLeftInnerColor: TColor; +begin + Result := clBtnShadow; +end; + +class function TdxPSCellSunkenBorder.TopLeftOuterBrush: HBRUSH; +begin + Result := GetSysColorBrush(COLOR_WINDOWTEXT); +end; + +class function TdxPSCellSunkenBorder.TopLeftOuterColor: TColor; +begin + Result := clWindowText; +end; + +class function TdxPSCellSunkenBorder.Edge3DSoft: Boolean; +begin + Result := False; +end; + +class function TdxPSCellSunkenBorder.Edge3DStyle: TdxCellEdgeStyle; +begin + Result := cesSunken; +end; + +{ TdxPSCellSunkenSoftBorder } + +class function TdxPSCellSunkenSoftBorder.BottomRightInnerBrush: HBRUSH; +begin + Result := GetSysColorBrush(COLOR_BTNFACE); +end; + +class function TdxPSCellSunkenSoftBorder.BottomRightInnerColor: TColor; +begin + Result := clBtnFace; +end; + +class function TdxPSCellSunkenSoftBorder.TopLeftInnerBrush: HBRUSH; +begin + Result := GetSysColorBrush(COLOR_BTNFACE); +end; + +class function TdxPSCellSunkenSoftBorder.TopLeftInnerColor: TColor; +begin + Result := clBtnFace; +end; + +class function TdxPSCellSunkenSoftBorder.Edge3DSoft: Boolean; +begin + Result := True; +end; + +{ TdxPSCellEtchedBorderPainter } + +{$IFDEF BCB} +class procedure TdxPSCellTwistedBorderPainter.Draw3DFrame(DC: HDC; R: TRect; + ASides: TdxCellSides; ACellBorders: TdxPSCell3DBorderClass; ALineThickness: Integer); +begin + inherited; +end; +{$ENDIF} + +class procedure TdxPSCellTwistedBorderPainter.Draw3DFrame(DC: HDC; R: TRect; ASides: TdxCellSides; + AOuterTLBrush, AOuterBRBrush, AInnerTLBrush, AInnerBRBrush: HBRUSH; ALineThickness: Integer); +begin + Inc(R.Left, ALineThickness); + Inc(R.Top, ALineThickness); + DrawFrame(DC, R, ASides, AInnerTLBrush, AInnerBRBrush, ALineThickness); + Windows.OffsetRect(R, -ALineThickness, -ALineThickness); + DrawFrame(DC, R, ASides, AOuterTLBrush, AOuterBRBrush, ALineThickness); +end; + +{ TdxPSCellTwistedBorder } + +class function TdxPSCellTwistedBorder.GetPainterClass: TdxPSCellBorderPainterClass; +begin + Result := TdxPSCellTwistedBorderPainter; +end; + +{ TdxPSCellEtchedBorder } + +class function TdxPSCellEtchedBorder.BottomRightInnerBrush: HBRUSH; +begin + Result := GetSysColorBrush(COLOR_BTNHIGHLIGHT); +end; + +class function TdxPSCellEtchedBorder.BottomRightInnerColor: TColor; +begin + Result := clBtnHighLight; +end; + +class function TdxPSCellEtchedBorder.BottomRightOuterBrush: HBRUSH; +begin + Result := GetSysColorBrush(COLOR_WINDOWTEXT); +end; + +class function TdxPSCellEtchedBorder.BottomRightOuterColor: TColor; +begin + Result := clWindowText; +end; + +class function TdxPSCellEtchedBorder.TopLeftInnerBrush: HBRUSH; +begin + Result := GetSysColorBrush(COLOR_BTNHIGHLIGHT); +end; + +class function TdxPSCellEtchedBorder.TopLeftInnerColor: TColor; +begin + Result := clBtnHighLight; +end; + +class function TdxPSCellEtchedBorder.TopLeftOuterBrush: HBRUSH; +begin + Result := GetSysColorBrush(COLOR_WINDOWTEXT); +end; + +class function TdxPSCellEtchedBorder.TopLeftOuterColor: TColor; +begin + Result := clWindowText; +end; + +{ TdxPSCellBumpedBorder } + +class function TdxPSCellBumpedBorder.BottomRightInnerBrush: HBRUSH; +begin + Result := GetSysColorBrush(COLOR_WINDOWTEXT); +end; + +class function TdxPSCellBumpedBorder.BottomRightInnerColor: TColor; +begin + Result := clWindowText; +end; + +class function TdxPSCellBumpedBorder.BottomRightOuterBrush: HBRUSH; +begin + Result := GetSysColorBrush(COLOR_BTNHIGHLIGHT); +end; + +class function TdxPSCellBumpedBorder.BottomRightOuterColor: TColor; +begin + Result := clBtnHighLight; +end; + +class function TdxPSCellBumpedBorder.TopLeftInnerBrush: HBRUSH; +begin + Result := GetSysColorBrush(COLOR_WINDOWTEXT); +end; + +class function TdxPSCellBumpedBorder.TopLeftInnerColor: TColor; +begin + Result := clWindowText; +end; + +class function TdxPSCellBumpedBorder.TopLeftOuterBrush: HBRUSH; +begin + Result := GetSysColorBrush(COLOR_BTNHIGHLIGHT); +end; + +class function TdxPSCellBumpedBorder.TopLeftOuterColor: TColor; +begin + Result := clBtnHighLight; +end; + +{ TdxPSCellBorderPainter } + +procedure TdxPSColorBorderPainter.Paint(DC: HDC); +var + R: TRect; + Side: TdxCellSide; + BorderBounds: TRect; +begin + with Item do + begin + R := GetBorderOuterBounds(DC); +// SelectClipRgn(DC, 0); + if RectVisible(DC, R) then + begin + for Side := csBottom downto csLeft do + if Side in CellSides then + begin + BorderBounds := Self.GetBorderBounds(R, Side, Renderer.LineThickness); + Windows.FillRect(DC, BorderBounds, + Renderer.GetBrushByColor(SideColor[Side])); + end; + end; + end; +end; + +function TdxPSColorBorderPainter.GetSideColor(ASide: TdxCellSide): TColor; +begin + Result := FItem.FCellSideColors[ASide]; +end; + +{ TdxPSColorBorder } + +class function TdxPSColorBorder.GetPainterClass: TdxPSCellBorderPainterClass; +begin + Result := TdxPSColorBorderPainter; +end; + +{ TdxPSBackgroundBitmapPool } + +constructor TdxPSBackgroundBitmapPool.Create; +begin + inherited Create; + FItems := TList.Create; +end; + +destructor TdxPSBackgroundBitmapPool.Destroy; +begin + Clear; + FreeAndNil(FItems); + inherited Destroy; +end; + +procedure TdxPSBackgroundBitmapPool.Assign(Source: TdxPSBackgroundBitmapPool); +var + I: Integer; +begin + Clear; + for I := 0 to Source.Count - 1 do + Add(Source.Items[I]); +end; + +function TdxPSBackgroundBitmapPool.Add(ABitmap: TBitmap): Integer; +begin + if not Find(ABitmap, Result) then Result := FItems.Add(ABitmap); +end; + +procedure TdxPSBackgroundBitmapPool.Clear; +begin + FItems.Clear; +end; + +procedure TdxPSBackgroundBitmapPool.Delete(AnIndex: Integer); +begin + FItems.Delete(AnIndex); +end; + +function TdxPSBackgroundBitmapPool.Find(ABitmap: TBitmap; out AnIndex: Integer): Boolean; +var + I: Integer; +begin + AnIndex := -1; + for I := 0 to Count - 1 do + if dxPSUtl.dxAreGraphicsEqual(Items[I], ABitmap) then + begin + AnIndex := I; + Break; + end; + Result := AnIndex <> -1; +end; + +procedure TdxPSBackgroundBitmapPool.ReadData(AReader: TdxPSDataReader); +var + Bitmap: TBitmap; +begin + AReader.ReadListBegin; + try + while not AReader.EndOfList do + begin + Bitmap := TBitmap.Create; + try + AReader.ReadImage(Bitmap); + Add(Bitmap); + except + Bitmap.Free; + raise; + end; + end; + finally + AReader.ReadListEnd; + end; +end; + +procedure TdxPSBackgroundBitmapPool.WriteData(AWriter: TdxPSDataWriter); +var + I: Integer; +begin + AWriter.WriteListBegin; + try + for I := 0 to Count - 1 do + AWriter.WriteImage(Items[I]); + finally + AWriter.WriteListEnd; + end; +end; + +function TdxPSBackgroundBitmapPool.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxPSBackgroundBitmapPool.GetItem(Index: Integer): TBitmap; +begin + if Index <> -1 then + Result := TBitmap(FItems[Index]) + else + Result := nil; +end; + +{ TdxPSBrushPoolItem } + +constructor TdxPSBrushPoolItem.Create(AColor: TColor); +begin + inherited Create; + FBrush := NULL_BRUSH; + FColor := ColorToRGB(AColor); +end; + +destructor TdxPSBrushPoolItem.Destroy; +begin + if FBrush <> NULL_BRUSH then + begin + DeleteObject(FBrush); + FBrush := NULL_BRUSH; + end; + inherited; +end; + +function TdxPSBrushPoolItem.GetBrush: HBRUSH; +begin + if FBrush = NULL_BRUSH then + FBrush := CreateSolidBrush(Color); + Result := FBrush; +end; + +{ TdxPSReportBrushPool } + +constructor TdxPSReportBrushPool.Create; +begin + inherited Create; + FItems := TList.Create; +end; + +destructor TdxPSReportBrushPool.Destroy; +begin + Clear; + FreeAndNil(FItems); + inherited; +end; + +procedure TdxPSReportBrushPool.Clear; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].Free; + FItems.Clear; +end; + +function TdxPSReportBrushPool.IndexOf(AColor: TColor): Integer; +begin + AColor := ColorToRGB(AColor); + for Result := 0 to Count - 1 do + if Items[Result].Color = AColor then Exit; + Result := -1; +end; + +function TdxPSReportBrushPool.Add(AColor: TColor): Integer; +begin + Result := Count; + FItems.Add(TdxPSBrushPoolItem.Create(AColor)); +end; + +function TdxPSReportBrushPool.GetBrush(AColor: TColor): HBRUSH; +var + Index: Integer; +begin + Index := IndexOf(AColor); + if Index = -1 then + Index := Add(AColor); + Result := Items[Index].Brush; +end; + +function TdxPSReportBrushPool.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxPSReportBrushPool.GetItem(Index: Integer): TdxPSBrushPoolItem; +begin + Result := TdxPSBrushPoolItem(FItems[Index]); +end; + +{ TdxPSFontPoolItem } + +constructor TdxPSFontPoolItem.Create(AFont: TFont); +begin + inherited Create; + FFont := TFont.Create; + Font := AFont; + OriginalSize := Font.Size; +end; + +destructor TdxPSFontPoolItem.Destroy; +begin + FreeAndNil(FFont); + inherited; +end; + +procedure TdxPSFontPoolItem.SetFont(Value: TFont); +begin + Font.Assign(Value); +end; + +{ TdxPSReportFontPool } + +constructor TdxPSReportFontPool.Create; +begin + inherited Create; + FItems := TList.Create; +end; + +destructor TdxPSReportFontPool.Destroy; +begin + Clear; + FreeAndNil(FItems); + inherited; +end; + +function TdxPSReportFontPool.Add(AFont: TFont): Integer; +begin + Result := IndexOf(AFont); + if Result = -1 then + Result := CreateFont(AFont); +end; + +procedure TdxPSReportFontPool.Clear; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].Free; + FItems.Clear; +end; + +function TdxPSReportFontPool.IndexOf(AFont: TFont): Integer; +begin + for Result := 0 to Count - 1 do + if dxAreFontsEqual(Fonts[Result], AFont) then Exit; + Result := -1; +end; + +function TdxPSReportFontPool.CreateFont(AFont: TFont): Integer; +var + Item: TdxPSFontPoolItem; +begin + Result := Count; + Item := TdxPSFontPoolItem.Create(AFont); + FItems.Add(Item); + Item.Font.OnChange := FontChanged; +end; + +procedure TdxPSReportFontPool.FontChanged(Sender: TObject); +begin + if not FLocked then Add(TFont(Sender)); +end; + +procedure TdxPSReportFontPool.PrepareFonts(UPI: Integer); +var + I: Integer; +begin + FLocked := True; + try + for I := 0 to Count - 1 do + with Items[I] do + Font.Height := -MulDiv(OriginalSize, UPI, PtPerInch); + finally + FLocked := False; + end; +end; + +procedure TdxPSReportFontPool.ReadData(AReader: TdxPSDataReader); +var + Font: TFont; +begin + Clear; + Font := TFont.Create; + try + AReader.ReadListBegin; + try + while not AReader.EndOfList do + begin + AReader.ReadFont(Font); + Font.Size := AReader.ReadInteger; + Add(Font); + end; + finally + AReader.ReadListEnd; + end; + finally + Font.Free; + end; +end; + +procedure TdxPSReportFontPool.WriteData(AWriter: TdxPSDataWriter); +var + I: Integer; + Item: TdxPSFontPoolItem; +begin + AWriter.WriteListBegin; + try + for I := 0 to Count - 1 do + begin + Item := Items[I]; + AWriter.WriteFont(Item.Font); + AWriter.WriteInteger(Item.OriginalSize); + end; + finally + AWriter.WriteListEnd; + end; +end; + +function TdxPSReportFontPool.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxPSReportFontPool.GetFont(Index: Integer): TFont; +begin + Result := Items[Index].Font; +end; + +function TdxPSReportFontPool.GetItem(Index: Integer): TdxPSFontPoolItem; +begin + Result := TdxPSFontPoolItem(FItems[Index]); +end; + +{ TdxPSCachedGraphicInfo } + +constructor TdxPSCachedGraphicInfo.Create(ARenderer: TdxPSReportRenderer); +begin + Renderer := ARenderer; +end; + +function TdxPSCachedGraphicInfo.Check( + ASourceGraphic: TGraphic; ABitmap: TBitmap; var APreparedGraphic: TGraphic): Boolean; +begin + Result := ASourceGraphic <> nil; + if Result then + begin + Result := (ASourceGraphic = SourceGraphic) and (UnitsPerInch = Renderer.UnitsPerInch) and + (UnitsPerPixel = Renderer.UnitsPerPixel) and (ZoomFactor = Renderer.ZoomFactor) and + (ABitmap.Width = ASourceGraphic.Width) and (ABitmap.Height = ASourceGraphic.Height); + if Result then + APreparedGraphic := PreparedGraphic + else + begin + PreparedGraphic := APreparedGraphic; + SourceGraphic := ASourceGraphic; + SaveModeInfo; + end; + APreparedGraphic := ABitmap; + end; +end; + +procedure TdxPSCachedGraphicInfo.Clear; +begin + SourceGraphic := nil; + UnitsPerInch := 0; + UnitsPerPixel := 0; + ZoomFactor := 0; +end; + +procedure TdxPSCachedGraphicInfo.SaveModeInfo; +begin + UnitsPerInch := Renderer.UnitsPerInch; + UnitsPerPixel := Renderer.UnitsPerPixel; + ZoomFactor := Renderer.ZoomFactor; +end; + +{ TdxPSReportRenderer } + +constructor TdxPSReportRenderer.Create(AReportLink: TBasedxReportLink); + + function CreateBitmap: TBitmap; + begin + Result := TBitmap.Create; + with Result do + try + { Delphi4 bug ? - we have to assign image sizes manually at the first time of creating one } + Height := 16; + Width := 16; + HandleType := bmDIB; + except + Result.Free; + raise; + end; + end; + + function CreateFont(const AName: string; ASize: Integer): TFont; + begin + Result := TFont.Create; + Result.Name := AName; + Result.Size := ASize; + Result.Charset := SYMBOL_CHARSET;//DEFAULT_CHARSET; + dxPSUtl.SetFontAsNonAntialiased(Result); + end; + +begin + inherited Create; + FCachedGraphicInfo := TdxPSCachedGraphicInfo.Create(Self); + FBorderPainters := TList.Create; + FBrushPool := TdxPSReportBrushPool.Create; + FReportLink := AReportLink; + FCheckBitmap := CreateBitmap; + FDrawBitmap := CreateBitmap; + FDrawMask := CreateBitmap; + FGroupLookAndFeelPainters := TList.Create; + FHFStrings := TStringList.Create; + FLineThickness := 1; + FMarlettFont10 := CreateFont('Marlett', 10); + FMarlettFont8 := CreateFont('Marlett', 8); + FSymbolFont := CreateFont('Symbol', 7); + FSaveFont := TFont.Create; +end; + +destructor TdxPSReportRenderer.Destroy; +begin + FreeAndNil(FSaveFont); + FreeAndNil(FSymbolFont); + FreeAndNil(FMarlettFont10); + FreeAndNil(FMarlettFont8); + FreeAndNil(FHFStrings); + FreeAndNilReportGroupLookAndFeelPainters; + FreeAndNil(FDrawMask); + FreeAndNil(FDrawBitmap); + FreeAndNil(FCheckBitmap); + FreeAndNil(FBrushPool); + FreeAndNil(FCachedGraphicInfo); + FreeAndNilBorderPainters; + inherited Destroy; +end; + +function TdxPSReportRenderer.CustomDrawReportItem(AnItem: TAbstractdxReportCellData): Boolean; +var + R: TRect; + ARgn: HRGN; +begin + Result := False; + R := AnItem.GetOuterBounds(DC); + ARgn := GetClipRgn; + Windows.IntersectClipRect(DC, R.Left, R.Top, R.Right, R.Bottom); + ReportLink.CustomDraw(AnItem, Canvas, R, AnItem.BoundsRect, Result); + RestoreClipRgn(ARgn); +end; + +procedure TdxPSReportRenderer.Get3DBorderBrushes(AnItem: TdxReportVisualItem; + var AOuterTLBrush, AOuterBRBrush, AInnerTLBrush, AInnerBRBrush: HBRUSH); +begin + dxPSCore.Get3DBorderBrushes(AnItem.Edge3DStyle, AnItem.Edge3DSoft, + AOuterTLBrush, AOuterBRBrush, AInnerTLBrush, AInnerBRBrush); +end; + +procedure TdxPSReportRenderer.Get3DBorderColors(AnItem: TdxReportVisualItem; + var AOuterTLColor, AOuterBRColor, AInnerTLColor, AInnerBRColor: TColor); +begin + dxPSCore.Get3DBorderColors(AnItem.Edge3DStyle, AnItem.Edge3DSoft, + AOuterTLColor, AOuterBRColor, AInnerTLColor, AInnerBRColor); +end; + +procedure TdxPSReportRenderer.RenderPageTitleContent(const AText: string; ARect: TRect; + ATextAlignX: TdxTextAlignX; ATextAlignY: TdxTextAlignY; AColor: TColor; AFont: TFont; + ATransparent: Boolean); +const + cFormat: DWORD = DXTO_AUTOINDENTS or DXTO_EXPANDTABS or DXTO_PATTERNEDTEXT or DXTO_CHARBREAK; +var + PrevFontSize, UPI: Integer; + Rgn: HRGN; + Done: Boolean; + Format: DWORD; +begin + PrevFontSize := AFont.Size; + UPI := UnitsPerInch; + if not ReportLink.ReportTitle.AdjustOnReportScale then + UPI := MulDiv(UPI, 100, ReportLink.RealScaleFactor); + AFont.Size := MulDiv(PrevFontSize, UPI, Screen.PixelsPerInch); //PPI); + + Rgn := IntersectClipRect(ARect); + try + Done := False; + if ReportLink.IsTitleCustomDrawn then + begin + PrepareCanvasForCustomDraw(AFont, AColor); + ReportLink.DoCustomDrawPageTitle(Canvas, ARect, ATextAlignX, ATextAlignY, AColor, AFont, Done); + SetBkMode(DC, Windows.TRANSPARENT); + end; + + if not Done then + begin + if not ATransparent then + FillRect(DC, ARect, AColor); + Format := cFormat or MakeTextFormat(ATextAlignX, ATextAlignY, True, False, True, True, True); + DrawTextEx(DC, ARect, 0, 0, 0, AText, AFont, Format); + end; + + if ReportLink.IsTitleCustomDrawn then UnprepareCanvasForCustomDraw; + finally + RestoreClipRgn(Rgn); + end; + AFont.Size := PrevFontSize; +end; + +function TdxPSReportRenderer.CalcTextHeight(DC: HDC; const AText: string; + AWordBreak: Boolean; AFont: TFont = nil; ABaseWidth: Integer = -1): Integer; +var + R: TRect; +begin + if ABaseWidth = -1 then ABaseWidth := 5; + R := MakeRect(0, 0, ABaseWidth, 5); + Result := CalcTextRect(DC, AText, R, AWordBreak, AFont); +end; + +function TdxPSReportRenderer.CalcTextLineCount(DC: HDC; const AText: string; + AFont: TFont = nil; ABaseWidth: Integer = -1): Integer; +var + R: TRect; +begin + if AText <> '' then + begin + if ABaseWidth = -1 then + ABaseWidth := 2 * dxTextSpace + 1; + R := MakeRect(0, 0, ABaseWidth, 5); + Result := dxTextOut(DC, AText, R, dxCalcFormat[True] or DXTO_CALCROWCOUNT, AFont, 0, 0, 0); + end + else + Result := 0 +end; + +function TdxPSReportRenderer.CalcTextPatternHeight(DC: HDC; AFont: TFont = nil): Integer; +begin + Result := CalcTextHeight(DC, 'Wg', False, AFont, -1); +end; + +function TdxPSReportRenderer.CalcTextRect(DC: HDC; const AText: string; + var ARect: TRect; AWordBreak: Boolean; AFont: TFont = nil): Integer; +const + CalcFormats: array[Boolean] of UINT = + (DXTO_CALCROWCOUNT or DXTO_AUTOINDENTS or DXTO_CHARBREAK or DXTO_SINGLELINE, + DXTO_CALCROWCOUNT or DXTO_AUTOINDENTS or DXTO_EXPANDTABS or DXTO_CHARBREAK or DXTO_WORDBREAK); +begin + Result := CalcTextRect(DC, AText, ARect, CalcFormats[AWordBreak], AFont); +end; + +function TdxPSReportRenderer.CalcTextRect(DC: HDC; const AText: string; + var ARect: TRect; AFormat: DWORD; AFont: TFont = nil): Integer; +var + ATextParams: TdxTextParams; + ATextRows: TdxTextRows; + AFontHandle: HFont; +begin + if (AText <> '') and (AText[1] <> #0) then + begin + if AFont <> nil then + AFontHandle := SelectObject(DC, AFont.Handle) + else + AFontHandle := 0; + ARect.Bottom := MaxInt; + InflateRect(ARect, -dxTextSpace * LineThickness, 0); + ATextParams := dxCalcTextParams(DC, AFormat); + ATextRows := dxMakeTextRows(DC, AText, ARect, ATextParams); + ARect.Bottom := ARect.Top + ATextRows.Count * ATextParams.FullRowHeight + + 3 * LineThickness * dxTextSpace; + ATextRows.Free; + if AFontHandle <> 0 then + SelectObject(DC, AFontHandle); + Result := ARect.Bottom - ARect.Top; + end + else + Result := 0; +end; + +(* +// todo: old version +function TdxPSReportRenderer.CalcTextRect(DC: HDC; const AText: string; + var ARect: TRect; AFormat: DWORD; AFont: TFont = nil): Integer; +begin + if AText <> '' then + begin + dxTextOut(DC, AText, ARect, AFormat or DXTO_CALCRECT, AFont, 0, 0, 0); + Result := ARect.Bottom - ARect.Top; + end + else + Result := 0; +end; +*) + +function TdxPSReportRenderer.CalcTextWidth(DC: HDC; const AText: string; + AFont: TFont = nil): Integer; +var + R: TRect; +begin + R := MakeRect(0, 0, 5 * LineThickness, 5 * LineThickness); + dxTextOut(DC, AText, R, dxCalcFormat[False], AFont, 0, 0, 0); + Result := R.Right - R.Left; +end; + +procedure TdxPSReportRenderer.DrawCheckBox(DC: HDC; var R: TRect; + AChecked, AEnabled, AIsRadio: Boolean; AEdgeStyle: TdxCheckButtonEdgeStyle; + ABorderColor: TColor = clWindowText); +const + Enabled: array[Boolean] of UINT = (DFCS_BUTTON3STATE or DFCS_INACTIVE, 0); + Checked: array[Boolean] of UINT = (0, DFCS_CHECKED); + //FlatBorder: array[Boolean] of UINT = (0, DFCS_FLAT); + Radio: array[Boolean] of UINT = (0, DFCS_BUTTONRADIO); + InteriorIndexes: array[Boolean] of UINT = (CheckInteriorIndex, RadioInteriorIndex); + MarkIndexes: array[Boolean] of UINT = (CheckMarkIndex, RadioBeanIndex); + TopLeftArcInnerIndexes: array[Boolean] of UINT = (CheckTopLeftArcInnerIndex, RadioTopLeftArcInnerIndex); + BottomRightArcInnerIndexes: array[Boolean] of UINT = (CheckBottomRightArcInnerIndex, RadioBottomRightArcInnerIndex); + TopLeftArcOuterIndexes: array[Boolean] of UINT = (CheckTopLeftArcOuterIndex, RadioTopLeftArcOuterIndex); + BottomRightArcOuterIndexes: array[Boolean] of UINT = (CheckBottomRightArcOuterIndex, RadioBottomRightArcOuterIndex); +var + F: HFONT; + C: TColor; +begin + if AEdgeStyle <> cbes3D then + begin +// todo: commented for AB9777 +// if AIsRadio then OffsetRect(R, 0, LineThickness); + + F := SelectObject(DC, MarlettFont10.Handle); + C := GetTextColor(DC); + + if AEnabled then + SetTextColor(DC, ColorToRGB(clWindow)) + else + SetTextColor(DC, ColorToRGB(clBtnFace)); + dxPSUtl.DrawGlyph(DC, R, InteriorIndexes[AIsRadio]); + //actually it's a mask, that means we should paint by halftone brush over here + + if AChecked then + begin + SetTextColor(DC, ColorToRGB(clWindowText)); + dxPSUtl.DrawGlyph(DC, R, MarkIndexes[AIsRadio]); + end; + + if AEdgeStyle <> cbesNone then + begin + case AEdgeStyle of + cbesSoft3D: + SetTextColor(DC, ColorToRGB(clBtnFace)); + cbesSingle, + cbesBoldFlat: + SetTextColor(DC, ColorToRGB(ABorderColor)); + cbesUltraFlat: + SetTextColor(DC, ColorToRGB(clWindowText)); + end; + + dxPSUtl.DrawGlyph(DC, R, TopLeftArcInnerIndexes[AIsRadio]); + dxPSUtl.DrawGlyph(DC, R, BottomRightArcInnerIndexes[AIsRadio]); + + if AEdgeStyle in [cbesSoft3D, cbesBoldFlat] then + begin + if AEdgeStyle = cbesSoft3D then + SetTextColor(DC, ColorToRGB(clBtnShadow)); + dxPSUtl.DrawGlyph(DC, R, TopLeftArcOuterIndexes[AIsRadio]); + if AEdgeStyle = cbesSoft3D then + SetTextColor(DC, ColorToRGB(clBtnHighlight)); + dxPSUtl.DrawGlyph(DC, R, BottomRightArcOuterIndexes[AIsRadio]); + end; + + SelectObject(DC, F); + SetTextColor(DC, C); + end; + end + else + DrawFrameControl(DC, R, DFC_BUTTON, DFCS_TRANSPARENT or Radio[AIsRadio] or Enabled[AEnabled] or Checked[AChecked]); +end; + +procedure TdxPSReportRenderer.DrawEdge(DC: HDC; var R: TRect; AEdgeMode: TdxCellEdgeMode; + AEdge3DEdge: TdxCellEdgeStyle; ASides: TdxCellSides; ASoft: Boolean; ABorderColor: TColor = -1); +var + Brush: HBRUSH; + CellBorders: TdxPSCell3DBorderClass; +begin + case AEdgeMode of + cemPattern: + begin + if ABorderColor = -1 then ABorderColor := RenderInfo.GridLinesColor; + Brush := GetBrushByColor(ABorderColor); + TdxPSCellBorderPainter.DrawFrame(DC, R, ASides, Brush, Brush, LineThickness); + end; + cem3DEffects: + begin + CellBorders := TdxPSCell3DBorderClass(TdxReportVisualItem.MapBorderClass(AEdgeMode, AEdge3DEdge, ASoft)); + TdxPSCell3DBorderPainter.Draw3DFrame(DC, R, ASides, CellBorders, LineThickness); + end; + end; +end; + +procedure TdxPSReportRenderer.DrawEllipse(DC: HDC; R: TRect; + AForeColor, ABackColor: TColor; APattern: TdxPSFillPatternClass; + ABorderColor: TColor; ABorderThickness: Integer = 1); +begin + FrameEllipse(DC, R, ABorderColor, ABorderThickness); + InflateRect(R, -ABorderThickness * LineThickness, -ABorderThickness * LineThickness); + FillEllipseEx(DC, R, AForeColor, ABackColor, APattern); +end; + +procedure TdxPSReportRenderer.DrawExpandButton(DC: HDC; var R: TRect; + AExpanded, ADrawBorder, AEdge3D, AEdge3DSoft, AShadow, AFillInterior: Boolean; + ABorderColor, AInteriorColor: TColor); + + procedure DrawGlyph(DC: HDC; const R: TRect; AGlyph: Byte); + var + Ch: Char; + Size: TSize; + X, Y: Integer; + begin + Ch := Chr(AGlyph); + GetTextExtentPoint32(DC, @Ch, 1, Size); + with R do + begin + X := Left + (Right - Left - Size.cX) div 2; + Y := Top + (Bottom - Top - Size.cY) div 2; + end; + ExtTextOut(DC, X, Y, 0, @R, @Ch, 1, nil); + end; + +const + InnerBottomRight3DColors: array[Boolean] of TColor = (clBtnShadow, clBtnFace); + OuterFlatColors: array[Boolean] of TColor = (clWindowText, clBtnShadow); + CrossHireIndexes: array[Boolean] of Byte = (dxPSUtl.PlusSignIndex, dxPSUtl.MinusSignIndex); +var + F: HFONT; + C: TColor; +begin + SetBkMode(DC, TRANSPARENT); + F := GetCurrentObject(DC, OBJ_FONT); + C := GetTextColor(DC); + + SelectObject(DC, MarlettFont8.Handle); + if ADrawBorder then + begin + if AEdge3D then + begin + SetTextColor(DC, ColorToRGB(ABorderColor)); + DrawGlyph(DC, R, dxPSUtl.CheckTopLeftArcOuterIndex); + DrawGlyph(DC, R, dxPSUtl.CheckBottomRightArcOuterIndex); + end; + + if AFillInterior then + begin + SetTextColor(DC, ColorToRGB(AInteriorColor)); + DrawGlyph(DC, R, dxPSUtl.CheckInteriorIndex); + end; + + if not AEdge3D then + begin + SetTextColor(DC, ColorToRGB(ABorderColor));//OuterFlatColors[AEdge3DSoft])); + DrawGlyph(DC, R, dxPSUtl.CheckTopLeftArcInnerIndex); + DrawGlyph(DC, R, dxPSUtl.CheckBottomRightArcInnerIndex); + if AShadow then + begin + OffsetRect(R, LineThickness, LineThickness); + SetTextColor(DC, ColorToRGB(clBtnShadow)); + DrawGlyph(DC, R, dxPSUtl.CheckBottomRightArcInnerIndex); + OffsetRect(R, -LineThickness, -LineThickness); + end; + end + else + begin + SetTextColor(DC, ColorToRGB(clBtnHighlight)); + DrawGlyph(DC, R, dxPSUtl.CheckTopLeftArcInnerIndex); + SetTextColor(DC, ColorToRGB(InnerBottomRight3DColors[AEdge3DSoft])); + DrawGlyph(DC, R, dxPSUtl.CheckBottomRightArcInnerIndex); + end; + end; + + // cross-hire + SelectObject(DC, SymbolFont.Handle); + SetTextColor(DC, ColorToRGB(clWindowText)); + OffsetRect(R, 0, -LineThickness); + DrawGlyph(DC, R, CrossHireIndexes[AExpanded]); + + SetTextColor(DC, C); + SelectObject(DC, F); +end; + +procedure TdxPSReportRenderer.DrawGlyph(DC: HDC; const R: TRect; AGlyph: Byte); +begin + dxPSUtl.DrawGlyph(DC, R, AGlyph); +end; + +procedure TdxPSReportRenderer.DrawGraphic(DC: HDC; var R: TRect; const AClipRect: TRect; + AImageList: TCustomImageList; AImageIndex: Integer; AGraphic: TGraphic; + AGraphicTransparent, ATransparent: Boolean; AColor: TColor); +begin + DrawGraphicEx(DC, R, AClipRect, AImageList, AImageIndex, AGraphic, + AGraphicTransparent, ATransparent, AColor, clWindow, TdxPSSolidFillPattern, cibAlways); +end; + +procedure TdxPSReportRenderer.DrawGraphicEx(DC: HDC; R: TRect; const AClipRect: TRect; + AImageList: TCustomImageList; AImageIndex: Integer; AGraphic: TGraphic; + AGraphicTransparent, ATransparent: Boolean; AColor, ABkColor: TColor; + APattern: TdxPSFillPatternClass; AnActualImageBuffering: TdxCellImageActualBuffering = cibAlways); + + procedure GetImage(ABitmap: TBitmap; AImageList: TCustomImageList; + AImageIndex: Integer; AType: TImageType); + + {$IFNDEF DELPHI6} + function GetColor(Value: TColor): DWORD; + begin + Result := ColorToRGB(Value); + case Result of + clNone: Result := CLR_NONE; + clDefault: Result := CLR_DEFAULT; + end; + end; + {$ENDIF} + + {$IFNDEF DELPHI6} + const + DrawingStyles: array[TDrawingStyle] of Longint = + (ILD_FOCUS, ILD_SELECTED, ILD_NORMAL, ILD_TRANSPARENT); + Images: array[TImageType] of Longint = (0, ILD_MASK); + {$ENDIF} + begin + ABitmap.Handle := 0; + ABitmap.Height := AImageList.Height; + ABitmap.Width := AImageList.Width; + ABitmap.Transparent := True; + {$IFNDEF DELPHI6} + with AImageList do + if HandleAllocated then + ImageList_DrawEx(Handle, AImageIndex, ABitmap.Canvas.Handle, 0, 0, 0, 0, + GetColor(BkColor), GetColor(BlendColor), + DrawingStyles[DrawingStyle] or Images[ImageType]); + {$ELSE} + AImageList.Draw(ABitmap.Canvas, 0, 0, AImageIndex, dsNormal, AType); + {$ENDIF} + end; + +var + Tmp: TBitmap; + G: TGraphic; + Rgn, Rgn2, RestRgn: HRGN; + SaveTransparent: Boolean; +begin + Rgn := 0; + if (R.Right - R.Left > AClipRect.Right - AClipRect.Left) or + (R.Bottom - R.Top > AClipRect.Bottom - AClipRect.Top) then + Rgn := IntersectClipRect(AClipRect); + + if not ATransparent then + if not AGraphicTransparent then + begin + RestRgn := CreateRectRgnIndirect(AClipRect); + Rgn2 := CreateRectRgnIndirect(R); + if CombineRgn(RestRgn, RestRgn, Rgn2, RGN_DIFF) > NULLREGION then + FillRgnEx(DC, RestRgn, AColor, ABkColor, APattern); + DeleteObject(Rgn2); + DeleteObject(RestRgn); + end + else + FillRectEx(DC, AClipRect, AColor, ABkColor, APattern); + + if AnActualImageBuffering = cibAlways then {v3.2} + //if ReportLink.AlwaysBufferedGraphics then + begin + if AImageList <> nil then + begin + GetImage(FDrawBitmap, AImageList, AImageIndex, itImage); + {!!!} FDrawBitmap.HandleType := bmDIB; + GetImage(FDrawMask, AImageList, AImageIndex, itMask); + {!!!} FDrawMask.HandleType := bmDIB; + FDrawBitmap.MaskHandle := FDrawMask.Handle; + end + else + begin + if not CachedGraphicInfo.Check(AGraphic, FDrawBitmap, G) then + with FDrawBitmap do + begin + Handle := 0; + Width := AGraphic.Width; + Height := AGraphic.Height; + HandleType := bmDIB; + //if AGraphic is TBitmap then + // MaskHandle := TBitmap(AGraphic).MaskHandle; + Canvas.Draw(0, 0, AGraphic); + end; + end; + G := FDrawBitmap; + end + else + G := AGraphic; + + if (G <> nil) and not G.Empty then + begin + SaveTransparent := G.Transparent; + G.Transparent := (not IsPrinting or not FDontPrintTransparentImages) and + AGraphicTransparent and not (G is TIcon); + + if not IsRectEmpty(R) then + begin + if IsPrinting and (AImageList <> nil) then + begin + Tmp := TBitmap.Create; + try + Tmp.HandleType := bmDIB; // !!! + Tmp.Width := FDrawBitmap.Width; + Tmp.Height := FDrawBitmap.Height; + StretchBlt(Tmp.Canvas.Handle, 0, 0, Tmp.Width, Tmp.Height, FCanvas.Handle, + R.Left, R.Top, R.Right - R.Left, R.Bottom - R.Top, srcCopy); + AImageList.Draw(Tmp.Canvas, 0, 0, AImageIndex{$IFDEF DELPHI6}, dsTransparent, itImage{$ENDIF}); + FCanvas.StretchDraw(R, Tmp); + finally + Tmp.Free; + end; + end + else + begin + if G is TBitmap then // save mask handle - delphi bug SC - DB19634 + FDrawMask.Handle := TBitmap(G).MaskHandle; + FCanvas.StretchDraw(R, G{FDrawBitmap}); + end; + end; + if AGraphicTransparent and not (G is TIcon) then + G.Transparent := SaveTransparent; + end; + + if Rgn <> 0 then RestoreClipRgn(Rgn); + FDrawMask.Handle := 0; + FDrawBitmap.MaskHandle := 0; +end; + +procedure TdxPSReportRenderer.DrawRectangle(DC: HDC; R: TRect; + AForeColor, ABackColor: TColor; AContentPattern: TdxPSFillPatternClass; + ABorderColor: TColor; ABorderThickness: Integer = 1); +begin + FrameRect(DC, R, ABorderColor, csAll, ABorderThickness); + InflateRect(R, -ABorderThickness * LineThickness, -ABorderThickness * LineThickness); + FillRectEx(DC, R, AForeColor, ABackColor, AContentPattern); +end; + +procedure TdxPSReportRenderer.DrawRoundRect(DC: HDC; R: TRect; + AnEllipseWidth, AnEllipseHeight: Integer; AForeColor, ABackColor: TColor; + AContentPattern: TdxPSFillPatternClass; ABorderColor: TColor; + ABorderThickness: Integer = 1); +begin + FrameRoundRect(DC, R, AnEllipseWidth, AnEllipseHeight, ABorderColor, ABorderThickness); + + AnEllipseHeight := + MulDiv(AnEllipseHeight, R.Bottom - R.Top - 2 * ABorderThickness * LineThickness, R.Bottom - R.Top); + AnEllipseWidth := + MulDiv(AnEllipseWidth, R.Right - R.Left - 2 * ABorderThickness * LineThickness, R.Right - R.Left); + InflateRect(R, -ABorderThickness * LineThickness, -ABorderThickness * LineThickness); + + FillRoundRectEx(DC, R, AnEllipseWidth, AnEllipseHeight, AForeColor, ABackColor, AContentPattern); +end; + +procedure TdxPSReportRenderer.DrawSortMark(DC: HDC; var R: TRect; + ASortOrder: TdxCellSortOrder; AMono: Boolean); +const + GlyphIndexes: array[TdxCellSortOrder] of Byte = (0, SortUpMarkIndex, SortDownMarkIndex); +var + F: HFONT; + C: TColor; + Ch: Char; + Size: TSize; +begin + if ASortOrder <> csoNone then + begin + F := SelectObject(DC, MarlettFont10.Handle); + C := SetTextColor(DC, ColorTORGB(clWindowText)); + Ch := Chr(GlyphIndexes[ASortOrder]); + GetTextExtentPoint32(DC, @Ch, 1, Size); + with R do + R := Bounds(Left + (Right - Left - Size.cX) div 2, Top + (Bottom - Top - Size.cY) div 2, Size.cX, Size.cY); + dxPSUtl.DrawGlyph(DC, R, GlyphIndexes[ASortOrder]); + SelectObject(DC, F); + SetTextColor(DC, C); + end; +end; + +procedure TdxPSReportRenderer.DrawText(DC: HDC; var R: TRect; AMaxLineCount: Integer; + ALeftIndent, ARightIndent: Integer; const AText: string; AFont: TFont; + ABkColor: TColor; ATextAlignX: TdxTextAlignX; ATextAlignY: TdxTextAlignY; + AFillBackground, AMultiline, AEndEllipsis: Boolean; APreventLeftTextExceed: Boolean = True; + APreventTopTextExceed: Boolean = True; AHidePrefix: Boolean = True); +var + Format: DWORD; +begin + if AFillBackground then FillRect(DC, R, ABkColor); + Format := DXTO_AUTOINDENTS or DXTO_EXPANDTABS or DXTO_PATTERNEDTEXT or DXTO_CHARBREAK or + MakeTextFormat(ATextAlignX, ATextAlignY, AMultiline, AEndEllipsis, + APreventLeftTextExceed, APreventTopTextExceed, AHidePrefix); + + DrawTextEx(DC, R, AMaxLineCount, ALeftIndent, ARightIndent, AText, AFont, Format); +end; + +procedure TdxPSReportRenderer.DrawTextEx(DC: HDC; var R: TRect; AMaxLineCount: Integer; + ALeftIndent, ARightIndent: Integer; const AText: string; AFont: TFont; AFormat: DWORD); +begin + dxTextOut(DC, AText, R, AFormat, AFont, AMaxLineCount, + MulDiv(ALeftIndent, PPI, 96), MulDiv(ARightIndent, PPI, 96)); +end; + +function TdxPSReportRenderer.MakeTextFormat(ATextAlignX: TdxTextAlignX; + ATextAlignY: TdxTextAlignY; AMultiline, AEndEllipsis, APreventLeftTextExceed, + APreventTopTextExceed, AHidePrefix: Boolean): DWORD; +const + dxEndEllipsis: array[Boolean] of UINT = (0, DXTO_END_ELLIPSIS); + dxHidePrefix: array[Boolean] of UINT = (0, DXTO_HIDEPREFIX); + dxPreventLeftExceed: array[Boolean] of UINT = (0, DXTO_PREVENT_LEFT_EXCEED); + dxPreventTopExceed: array[Boolean] of UINT = (0, DXTO_PREVENT_TOP_EXCEED); + dxWordBreak: array[Boolean] of UINT = (DXTO_SINGLELINE, DXTO_WORDBREAK); +begin + Result := dxMakeFormat(ATextAlignX, ATextAlignY) or + dxEndEllipsis[AEndEllipsis] or + dxHidePrefix[AHidePrefix] or + dxPreventLeftExceed[APreventLeftTextExceed] or + dxPreventTopExceed[APreventTopTextExceed] or + dxWordBreak[AMultiline]; +end; + +procedure TdxPSReportRenderer.FillEllipse(DC: HDC; const R: TRect; AColor: TColor); +begin + FillEllipseEx(DC, R, AColor, clWhite, TdxPSSolidFillPattern); +end; + +procedure TdxPSReportRenderer.FillEllipseEx(DC: HDC; const R: TRect; + AForeColor, ABackColor: TColor; APattern: TdxPSFillPatternClass); +var + Pen: HPEN; + Rgn: HRGN; +begin + Pen := SelectObject(DC, GetStockObject(NULL_PEN)); + Rgn := CreateEllipticRgnIndirect(R); + FillRgnEx(DC, Rgn, AForeColor, ABackColor, APattern); + DeleteObject(Rgn); + SelectObject(DC, Pen); +end; + +procedure TdxPSReportRenderer.FillRect(DC: HDC; const R: TRect; AColor: TColor); +begin + FillRectEx(DC, R, AColor, clWhite, TdxPSSolidFillPattern); +end; + +procedure TdxPSReportRenderer.FillRectEx(DC: HDC; const R: TRect; AForeColor, ABackColor: TColor; + APattern: TdxPSFillPatternClass); +var + BrushOrg: TPoint; +begin + if APattern = nil then Exit; + + GetBrushOrgEx(DC, BrushOrg); + if APattern.RequiredBrushOrigin then + begin + BrushOrg := R.TopLeft; + Windows.LPToDP(DC, BrushOrg, 1); + SetBrushOrgEx(DC, BrushOrg.X mod APattern.Dimensions.cX, BrushOrg.Y mod APattern.Dimensions.cY, @BrushOrg); + end; + + if not APattern.Solid then + begin + ABackColor := SetBkColor(DC, ColorToRGB(ABackColor)); + AForeColor := SetTextColor(DC, ColorToRGB(AForeColor)); + end; + + Windows.FillRect(DC, R, GetPatternBrush(APattern, ColorToRGB(AForeColor))); + + if not APattern.Solid then + begin + SetBkColor(DC, ABackColor); + SetTextColor(DC, AForeColor); + end; + + if APattern.RequiredBrushOrigin then + SetBrushOrgEx(DC, BrushOrg.X, BrushOrg.Y, nil); +end; + +procedure TdxPSReportRenderer.FillRoundRect(DC: HDC; const R: TRect; + AnEllipseWidth, AnEllipseHeight: Integer; AColor: TColor); +begin + FillRoundRectEx(DC, R, AnEllipseWidth, AnEllipseHeight, AColor, clWhite, TdxPSSolidFillPattern); +end; + +procedure TdxPSReportRenderer.FillRoundRectEx(DC: HDC; const R: TRect; + AnEllipseWidth, AnEllipseHeight: Integer; AForeColor, ABackColor: TColor; + APattern: TdxPSFillPatternClass); +var + Pen: HPEN; + Rgn: HRGN; +begin + Pen := SelectObject(DC, GetStockObject(NULL_PEN)); + with R do + Rgn := CreateRoundRectRgn(Left, Top, Right, Bottom, AnEllipseWidth, AnEllipseHeight); + FillRgnEx(DC, Rgn, AForeColor, ABackColor, APattern); + DeleteObject(Rgn); + SelectObject(DC, Pen); +end; + +procedure TdxPSReportRenderer.FillRgn(DC: HDC; Rgn: HRGN; AColor: TColor); +begin + FillRgnEx(DC, Rgn, AColor, clWhite, TdxPSSolidFillPattern); +end; + +procedure TdxPSReportRenderer.FillRgnEx(DC: HDC; Rgn: HRGN; AForeColor, ABackColor: TColor; + APattern: TdxPSFillPatternClass); +var + BrushOrg: TPoint; + R: TRect; +begin + if APattern = nil then Exit; + + GetBrushOrgEx(DC, BrushOrg); + if APattern.RequiredBrushOrigin and (GetRgnBox(Rgn, R) <> NULLREGION) then + begin + BrushOrg := R.TopLeft; + Windows.LPToDP(DC, BrushOrg, 1); + SetBrushOrgEx(DC, BrushOrg.X mod APattern.Dimensions.cX, BrushOrg.Y mod APattern.Dimensions.cY, @BrushOrg); + end; + + if not APattern.Solid then + begin + AForeColor := SetTextColor(DC, ColorToRGB(AForeColor)); + ABackColor := SetBkColor(DC, ColorToRGB(ABackColor)); + end; + + Windows.FillRgn(DC, Rgn, GetPatternBrush(APattern, AForeColor)); + + if not APattern.Solid then + begin + SetBkColor(DC, ABackColor); + SetTextColor(DC, AForeColor); + end; + + if APattern.RequiredBrushOrigin then + SetBrushOrgEx(DC, BrushOrg.X, BrushOrg.Y, nil); +end; + +procedure TdxPSReportRenderer.FrameEllipse(DC: HDC; R: TRect; AColor: TColor; + AThickness: Integer = 1); +var + OuterRgn, InnerRgn: HRGN; +begin + OuterRgn := CreateEllipticRgnIndirect(R); + InflateRect(R, -AThickness * LineThickness, -AThickness * LineThickness); + InnerRgn := CreateEllipticRgnIndirect(R); + CombineRgn(OuterRgn, OuterRgn, InnerRgn, RGN_DIFF); + FillRgn(DC, OuterRgn, AColor); + DeleteObject(InnerRgn); + DeleteObject(OuterRgn); +end; + +procedure TdxPSReportRenderer.FrameRect(DC: HDC; R: TRect; AColor: TColor; + ASides: TdxCellSides = [csLeft..csBottom]; AThickness: Integer = 1); +var + Brush: HBRUSH; + I: Integer; +begin + Brush := SelectObject(DC, GetPatternBrush(TdxPSSolidFillPattern, AColor)); + AColor := SetTextColor(DC, ColorToRGB(AColor)); + for I := 0 to AThickness - 1 do + begin + with R do + begin + if csLeft in ASides then + PatBlt(DC, Left, Top, LineThickness, Bottom - Top, PATCOPY); + if csTop in ASides then + PatBlt(DC, Left, Top, Right - Left, LineThickness, PATCOPY); + if csRight in ASides then + PatBlt(DC, Right - LineThickness, Top, LineThickness, Bottom - Top, PATCOPY); + if csBottom in ASides then + PatBlt(DC, Left, Bottom - LineThickness, Right - Left, LineThickness, PATCOPY); + + end; + InflateRect(R, -LineThickness, -LineThickness); + end; + SetTextColor(DC, AColor); + SelectObject(DC, Brush); +end; + +procedure TdxPSReportRenderer.FrameRoundRect(DC: HDC; R: TRect; + AnEllipseWidth, AnEllipseHeight: Integer; AColor: TColor; + AThickness: Integer = 1); +var + OuterRgn, InnerRgn: HRGN; +begin + with R do + OuterRgn := CreateRoundRectRgn(Left, Top, Right, Bottom, AnEllipseWidth, AnEllipseHeight); + AnEllipseHeight := MulDiv(AnEllipseHeight, R.Bottom - R.Top - 2 * AThickness * LineThickness, R.Bottom - R.Top); + AnEllipseWidth := MulDiv(AnEllipseWidth, R.Right - R.Left - 2 * AThickness * LineThickness, R.Right - R.Left); + InflateRect(R, -AThickness * LineThickness, -AThickness * LineThickness); + with R do + InnerRgn := CreateRoundRectRgn(Left, Top, Right, Bottom, AnEllipseWidth, AnEllipseHeight); + CombineRgn(OuterRgn, OuterRgn, InnerRgn, RGN_DIFF); + FillRgn(DC, OuterRgn, AColor); + DeleteObject(InnerRgn); + DeleteObject(OuterRgn); +end; + +function TdxPSReportRenderer.GetBorderPainter(AClass: TdxPSCellBorderPainterClass): TdxPSCellBorderPainter; +begin + Result := FindBorderPainter(AClass); + if Result = nil then + Result := CreateBorderPainter(AClass); +end; + +function TdxPSReportRenderer.GetBrushByColor(AColor: TColor): HBRUSH; +begin + {if IsSysColor(AColor) then //TODO: GetSysColorBrush + Result := GetSysColorBrush(AColor) + else} + if (AColor = clNone) or (AColor = clDefault) then + Result := GetStockObject(NULL_BRUSH) + else + Result := BrushPool.Brushes[AColor]; +end; + +function TdxPSReportRenderer.GetPatternBrush(APattern: TdxPSFillPatternClass; AColor: TColor): HBRUSH; +begin + if APattern.Solid then + Result := BrushPool.Brushes[AColor] + else + Result := dxPSFillPatternFactory.Items[APattern, IsPrinting].Brush.Handle; +end; + +function TdxPSReportRenderer.GetReportGroupLookAndFeelPainter(AClass: TdxPSReportGroupLookAndFeelPainterClass): TdxPSReportGroupLookAndFeelPainter; +begin + Result := FindReportGroupLookAndFeelPainter(AClass); + if Result = nil then + Result := CreateReportGroupLookAndFeelPainter(AClass); +end; + +function TdxPSReportRenderer.ExcludeClipRect(const R: TRect): Integer; +begin + with R do + Result := Windows.ExcludeClipRect(DC, Left, Top, Right, Bottom); +end; + +function TdxPSReportRenderer.GetClipRgn: HRGN; +begin + Result := CreateRectRgn(0, 0, 0, 0); + if Windows.GetClipRgn(DC, Result) <> 1 then + begin + DeleteObject(Result); + Result := 0; + end; +end; + +function TdxPSReportRenderer.IntersectClipRect(const R: TRect): HRGN; +begin + Result := dxPSUtl.IntersectClipRect(DC, R); +end; + +procedure TdxPSReportRenderer.RestoreClipRgn(var Rgn: HRGN); +begin + dxPSUtl.RestoreClipRgn(DC, Rgn); +end; + +procedure TdxPSReportRenderer.RenderPage(ACanvas: TCanvas; const APageBounds: TRect; + APageIndex, AContinuousPageIndex, AZoomFactor: Integer); +var + VirtualPageIndex, RealPageIndex: Integer; + Composition: TdxCompositionReportLink; +begin + RenderInfo.CalculatePageRealAndVirtualIndexes(APageIndex, VirtualPageIndex, RealPageIndex); + + if not RenderInfo.CanRenderPage(VirtualPageIndex) then Exit; + + Composition := ReportLink.CurrentComposition; + if (Composition = nil) or not Composition.ContinuousPageIndexes then + AContinuousPageIndex := RealPageIndex + else + if Composition <> nil then + AContinuousPageIndex := Composition.VirtualPageIndexToRealPageIndex(AContinuousPageIndex); + + dxHFFormatObject.CurrentPage := PreparedPageIndex(AContinuousPageIndex) + 1; + + FCanvas := ACanvas; + FDC := FCanvas.Handle; + FPPI := GetDeviceCaps(DC, LOGPIXELSX); + FViewPortRect := APageBounds; + FZoomFactor := AZoomFactor; + FRenderingPageIndex := VirtualPageIndex; + PrepareRenderPage; + try + RenderPageBackground(RealPageIndex); + RenderPageHeader(RealPageIndex); + RenderPageFooter(RealPageIndex); + if RenderInfo.HasPageTitle(RealPageIndex) then RenderPageTitle; + if ReportLink.NeedTwoPassRendering then + begin + FRenderStage := [rsFirstPass]; + RenderPageContent; + FRenderStage := [rsSecondPass]; + RenderPageContent; + end + else + begin + FRenderStage := [rsFirstPass, rsSecondPass]; + RenderPageContent; + end; + finally + FRenderStage := []; + UnprepareRenderPage; + end; + RenderEntirePage(RealPageIndex); +end; + +procedure TdxPSReportRenderer.RenderDelimiters; +var + I, Delimiter: Integer; + R: TRect; +begin + for I := 0 to RenderInfo.DelimiterXCount - 1 do + begin + Delimiter := RenderInfo.DelimitersX[I]; + R := MakeBounds(Delimiter, 0, 2 * LineThickness, 20 * LineThickness); + //OffsetRect(R, 0, -PageRenderInfo.DataOffset.Y); + FillRect(DC, R, GetSysColorBrush(COLOR_HIGHLIGHT)); + end; +end; + +procedure TdxPSReportRenderer.RenderPageBackground(ARealPageIndex: Integer); +var + R: TRect; +begin + if IsPrinting then + with ReportLink.RealPrinterPage.Background do + begin + R := RenderInfo.PageHeaderBounds; + R.Bottom := RenderInfo.PageFooterBounds.Top; + if (Mode = bmNone) or ((Mode = bmPicture) and (PictureMode in [ppmCenter, ppmProportional])) then + Windows.FillRect(DC, R, GetStockObject(WHITE_BRUSH)); + PaintEx(Canvas, R, PixelsNumerator * 100, PixelsDenominator * RenderInfo.ScaleFactor); + end; +end; + +procedure TdxPSReportRenderer.RenderPageFooter(ARealPageIndex: Integer); +var + R: TRect; +begin + R := RenderInfo.PageFooterBounds; + if not IsRectEmpty(R) and (IsPrinting or RectVisible(DC, R)) then + RenderPageHeaderOrFooter(ReportLink.RealPrinterPage.PageFooter, ARealPageIndex, R); +end; + +procedure TdxPSReportRenderer.RenderPageHeader(ARealPageIndex: Integer); +var + R: TRect; +begin + R := RenderInfo.PageHeaderBounds; + if not IsRectEmpty(R) and (IsPrinting or RectVisible(DC, R)) then + RenderPageHeaderOrFooter(ReportLink.RealPrinterPage.PageHeader, ARealPageIndex, R); +end; + +procedure TdxPSReportRenderer.RenderPageHeaderOrFooter(HF: TCustomdxPageObject; + APageIndex: Integer; ARect: TRect); +const + TitleParts: array[Boolean] of TdxPageTitleParts = ([], [tpLeft..tpRight]); +var + PrevFontHeight: Integer; + Rgn: HRGN; + DefaultDrawText, DefaultDrawBackground: Boolean; + PrevFont: HFONT; + PrevFontColor: COLORREF; +begin + PrevFontHeight := HF.Font.Height; + HF.Font.Height := -MulDiv(HF.Font.Size, MulDiv(UnitsPerInch, 100, ReportLink.RealScaleFactor), PtPerInch); + + SetBkMode(DC, TRANSPARENT); + + Rgn := IntersectClipRect(ARect); + try + DefaultDrawText := True; + DefaultDrawBackground := True; + + PrevFont := SelectObject(DC, HF.Font.Handle); + PrevFontColor := SetTextColor(DC, ColorToRGB(HF.Font.Color)); + + if ReportLink.IsHeaderOrFooterCustomDrawn(HF) then + begin + //PrepareCanvasForCustomDraw(@HF.Font, nil); + ReportLink.DoCustomDrawPageHeaderOrFooter(HF, Canvas, APageIndex, ARect, DefaultDrawText, DefaultDrawBackground); + SetBkMode(DC, TRANSPARENT); + end; + + if DefaultDrawText or DefaultDrawBackground then + RenderPageHeaderOrFooterContent(HF, APageIndex, ARect, TitleParts[DefaultDrawText], DefaultDrawBackground); + + //if ReportLink.IsHeaderOrFooterCustomDrawn(HF) then UnprepareCanvasForCustomDraw; + + SetTextColor(DC, PrevFontColor); + SelectObject(DC, PrevFont); + finally + RestoreClipRgn(Rgn); + end; + HF.Font.Height := PrevFontHeight; +end; + +procedure TdxPSReportRenderer.RenderPageHeaderOrFooterContentPart(ATitlePart: TdxPageTitlePart; + AStrings: TStrings; ATextAlignY: TdxTextAlignY; ALineHeight, ADestWidth, ADestHeight: Integer; + const ARect: TRect); +const + uFormat = DT_SINGLELINE or DT_VCENTER or DT_NOCLIP or DT_EDITCONTROL; +var + FullHeight: Integer; + R: TRect; + I: Integer; + S: string; + TextSize: TSize; +begin + if ATextAlignY = taTop then + FullHeight := ARect.Top + else + begin + FullHeight := AStrings.Count * ALineHeight; + if ATextAlignY = taCenterY then + FullHeight := ARect.Top + (ADestHeight - FullHeight) div 2 + else {taBottom} + FullHeight := ARect.Top + ADestHeight - FullHeight; + end; + if FullHeight < ARect.Top then + FullHeight := ARect.Top; + R := MakeRect(ARect.Left, FullHeight, ARect.Right, FullHeight + ALineHeight); + + for I := 0 to AStrings.Count - 1 do + begin + S := AStrings[I]; + if S <> '' then + begin + GetTextExtentPoint32(DC, PChar(S), Length(S), TextSize); + if ADestWidth > TextSize.cX then + case ATitlePart of + tpLeft: + R.Right := R.Left + TextSize.cX; + tpCenter: + begin + R.Left := ARect.Left + (ADestWidth - TextSize.cX) div 2; + R.Right := R.Left + TextSize.cX; + end; + tpRight: + R.Left := R.Right - TextSize.cX; + end; + if RectVisible(DC, R) then + begin + Windows.DrawText(DC, PChar(S), Length(S), R, uFormat or DT_LEFT); + ExcludeClipRect(R); + end; + R.Right := ARect.Right; + end; + OffsetRect(R, 0, ALineHeight); + end; +end; + +procedure TdxPSReportRenderer.RenderPageHeaderOrFooterContent(HF: TCustomdxPageObject; + APageIndex: Integer; ARect: TRect; ATitleParts: TdxPageTitleParts; ADrawBackground: Boolean); +var + TextSize: TSize; + LineHeight, DestWidth, DestHeight: Integer; + TextAlignY: TdxTextAlignY; +begin + if ADrawBackground then + HF.Background.PaintEx(Canvas, ARect, PixelsNumerator * 100, PixelsDenominator * RenderInfo.ScaleFactor); + + if ATitleParts = [] then + Exit; + + GetTextExtentPoint32(DC, 'Hg', 2, TextSize); + LineHeight := TextSize.cY; + DestWidth := ARect.Right - ARect.Left; + DestHeight := ARect.Bottom - ARect.Top; + + if tpLeft in ATitleParts then + begin + if ReportLink.RealPrinterPage.ReverseTitlesOnEvenPages and Odd(APageIndex) then + begin + FHFStrings.Text := dxProcessHFString(HF.RightTitle.Text); + TextAlignY := HF.TextAlignY[tpRight]; + end + else + begin + FHFStrings.Text := dxProcessHFString(HF.LeftTitle.Text); + TextAlignY := HF.TextAlignY[tpLeft]; + end; + RenderPageHeaderOrFooterContentPart(tpLeft, FHFStrings, TextAlignY, + LineHeight, DestWidth, DestHeight, ARect); + end; + + if tpRight in ATitleParts then + begin + if ReportLink.RealPrinterPage.ReverseTitlesOnEvenPages and Odd(APageIndex) then + begin + FHFStrings.Text := dxProcessHFString(HF.LeftTitle.Text); + TextAlignY := HF.TextAlignY[tpLeft]; + end + else + begin + FHFStrings.Text := dxProcessHFString(HF.RightTitle.Text); + TextAlignY := HF.TextAlignY[tpRight]; + end; + RenderPageHeaderOrFooterContentPart(tpRight, FHFStrings, TextAlignY, + LineHeight, DestWidth, DestHeight, ARect); + end; + + if tpCenter in ATitleParts then + begin + FHFStrings.Text := dxProcessHFString(HF.CenterTitle.Text); + TextAlignY := HF.TextAlignY[tpCenter]; + RenderPageHeaderOrFooterContentPart(tpCenter, FHFStrings, TextAlignY, + LineHeight, DestWidth, DestHeight, ARect); + end; +end; + +procedure TdxPSReportRenderer.RenderPageTitle; +var + R: TRect; +begin + R := RenderInfo.TitleBounds; + OffsetWindowOrgEx(DC, -PageRenderInfo.TitleOffset.X, -PageRenderInfo.TitleOffset.Y, nil); + if RectVisible(DC, R) then + with ReportLink.ReportTitle do + RenderPageTitleContent(Text, R, TextAlignX, TextAlignY, Color, Font, Transparent); + OffsetWindowOrgEx(DC, PageRenderInfo.TitleOffset.X, PageRenderInfo.TitleOffset.Y, nil); +end; + +procedure TdxPSReportRenderer.RenderCell(ACell: TdxReportCell; const OriginRect: TRect); +var + R: TRect; +begin + if ACell.Visible then + begin + R := ACell.BoundsRect; + { Transform R into the coordinate space of page } + OffsetRect(R, -OriginRect.Left, -OriginRect.Top); + if (R.Left <> 0) or (R.Top <> 0) then + OffsetWindowOrgEx(DC, -R.Left, -R.Top, nil); + ACell.DrawContent(DC, MakeRect(0, 0, R.Right - R.Left, R.Bottom - R.Top), OriginRect, RenderStage); + if (R.Left <> 0) or (R.Top <> 0) then + OffsetWindowOrgEx(DC, R.Left, R.Top, nil); + end; +end; + +procedure TdxPSReportRenderer.RenderEntirePage(ARealPageIndex: Integer); +var + Rgn: HRGN; +begin + if ReportLink.IsEntirePageCustomDrawn then + begin + Rgn := IntersectClipRect(ViewPortRect); + try + ReportLink.DoCustomDrawEntirePage(Canvas, ViewPortRect, ARealPageIndex); + finally + RestoreClipRgn(Rgn); + end; + end; +end; + +procedure TdxPSReportRenderer.RenderPageContent; +var + R: TRect; + Rgn: HRGN; + PrevFont: HFONT; + PrevFontColor: COLORREF; + I, H, StartIndex, EndIndex: Integer; + PrevWindowOrg: TPoint; +begin + OffsetWindowOrgEx(DC, -PageRenderInfo.DataOffset.X - LineThickness, + -PageRenderInfo.DataOffset.Y - LineThickness, @PrevWindowOrg); + R := PageRenderInfo.ContentBounds; + OffsetRect(R, -R.Left, -R.Top); +// InflateRect(R, LineThickness, LineThickness); // for double + Dec(R.Left, LineThickness); + Dec(R.Top, LineThickness); + + Rgn := dxPSUtl.IntersectClipRect(DC, R, True); + SetBkMode(DC, Windows.TRANSPARENT); + with RenderInfo.BaseContentFont do + begin + PrevFont := SelectObject(DC, Handle); + PrevFontColor := SetTextColor(DC, ColorToRGB(Color)); + end; + + with PageRenderInfo do + begin + if HasHeader then + begin + R := HeaderBounds; + OffsetRect(R, DetailBounds.Left, 0); + with ReportCells do + RenderPageContentPart(HeaderCells, 0, HeaderCells.CellCount - 1, R); + ExcludeClipRect(HeaderBounds); + OffsetWindowOrgEx(DC, 0, -(HeaderBounds.Bottom - HeaderBounds.Top), nil); + end; + + if HasDetails then + begin + EndIndex := 0; + for I := 0 to IndexPairCount - 1 do + begin + StartIndex := IndexPairs[I].StartIndex; + EndIndex := IndexPairs[I].EndIndex; + RenderPageContentPart(ReportCells.Cells, StartIndex, EndIndex, DetailBounds); + end; + for I := 0 to OverlayCount - 1 do + RenderPageOverlay(I, Overlays[I], DetailBounds); + + H := 0; + if not IsBottomPage then + H := DetailBounds.Bottom + else + if ReportCells.Cells.CellCount > EndIndex then + H := ReportCells.Cells[EndIndex].BoundsRect.Bottom; + Dec(H, DetailBounds.Top); + OffsetWindowOrgEx(DC, 0, -H, nil); + end; + + if HasFooter then + begin + R := FooterBounds; + OffsetRect(R, DetailBounds.Left, 0); + with ReportCells do + RenderPageContentPart(FooterCells, 0, FooterCells.CellCount - 1, R); + end; + end; + RestoreClipRgn(Rgn); + SetBkMode(DC, Windows.OPAQUE); + SetTextColor(DC, PrevFontColor); + SelectObject(DC, PrevFont); + SetWindowOrgEx(DC, PrevWindowOrg.X, PrevWindowOrg.Y, nil); +end; + +procedure TdxPSReportRenderer.RenderPageContentPart(ACell: TdxReportCell; + StartIndex, EndIndex: Integer; const OriginRect: TRect); +var + I: Integer; +begin + for I := StartIndex to EndIndex do + RenderCell(ACell[I], OriginRect); +end; + +procedure TdxPSReportRenderer.RenderPageOverlay(AnOverlayIndex: Integer; + AnOverlay: TdxPageOverlayIndexes; const OriginRect: TRect); +var + OverlayCell: TdxReportCell; + I: Integer; +begin + OverlayCell := ReportCells.Overlays[AnOverlayIndex]; + for I := 0 to AnOverlay.Count - 1 do + RenderCell(OverlayCell.Cells[AnOverlay[I]], OriginRect); +end; + +function TdxPSReportRenderer.GetUnitsPerInch: Integer; +begin + Result := RenderInfo.UnitsPerInch; +end; + +function TdxPSReportRenderer.CreateBorderPainter(AClass: TdxPSCellBorderPainterClass): TdxPSCellBorderPainter; +begin + Result := AClass.Create(Self); + FBorderPainters.Add(Result); +end; + +function TdxPSReportRenderer.FindBorderPainter(AClass: TdxPSCellBorderPainterClass): TdxPSCellBorderPainter; +var + I: Integer; +begin + for I := 0 to BorderPainterCount - 1 do + begin + Result := BorderPainters[I]; + if Result.ClassType = AClass then Exit; + end; + Result := nil; +end; + +procedure TdxPSReportRenderer.FreeAndNilBorderPainters; +var + I: Integer; +begin + for I := 0 to BorderPainterCount - 1 do + BorderPainters[I].Free; + FreeAndNil(FBorderPainters); +end; + +function TdxPSReportRenderer.CreateReportGroupLookAndFeelPainter(AClass: TdxPSReportGroupLookAndFeelPainterClass): TdxPSReportGroupLookAndFeelPainter; +begin + Result := AClass.Create(Self); + FGroupLookAndFeelPainters.Add(Result); +end; + +function TdxPSReportRenderer.FindReportGroupLookAndFeelPainter(AClass: TdxPSReportGroupLookAndFeelPainterClass): TdxPSReportGroupLookAndFeelPainter; +var + I: Integer; +begin + for I := 0 to GroupLookAndFeelPainterCount - 1 do + begin + Result := GroupLookAndFeelPainters[I]; + if Result.ClassType = AClass then Exit; + end; + Result := nil; +end; + +procedure TdxPSReportRenderer.FreeAndNilReportGroupLookAndFeelPainters; +var + I: Integer; +begin + for I := 0 to GroupLookAndFeelPainterCount - 1 do + GroupLookAndFeelPainters[I].Free; + FreeAndNil(FGroupLookAndFeelPainters); +end; + +function TdxPSReportRenderer.GetBorderPainterItem(Index: Integer): TdxPSCellBorderPainter; +begin + Result := TdxPSCellBorderPainter(FBorderPainters[Index]); +end; + +function TdxPSReportRenderer.GetBorderPainterCount: Integer; +begin + Result := FBorderPainters.Count; +end; + +function TdxPSReportRenderer.GetGroupLookAndFeelPainter(Index: Integer): TdxPSReportGroupLookAndFeelPainter; +begin + Result := TdxPSReportGroupLookAndFeelPainter(FGroupLookAndFeelPainters[Index]); +end; + +function TdxPSReportRenderer.GetGroupLookAndFeelPainterCount: Integer; +begin + Result := FGroupLookAndFeelPainters.Count; +end; + +function TdxPSReportRenderer.GetHalfLineThickness: Integer; +begin + Result := LineThickness div 2; +end; + +function TdxPSReportRenderer.GetIsPrinting: Boolean; +begin + Result := IsPrinterDC(DC); +end; + +function TdxPSReportRenderer.GetPageRenderInfo: TdxPSPageRenderInfo; +begin + Result := RenderInfo.PageRenderInfos[RenderingPageIndex]; +end; + +function TdxPSReportRenderer.GetRenderInfo: TdxPSReportRenderInfo; +begin + Result := FReportLink.RenderInfo; +end; + +function TdxPSReportRenderer.GetReportCells: TdxReportCells; +begin + Result := ReportLink.FReportCells; +end; + +procedure TdxPSReportRenderer.PrepareCanvasForCustomDraw(AFont: TFont; AColor: TColor); +begin + FSavePixelsPerInch := Canvas.Font.PixelsPerInch; + FSaveFont.Assign(Canvas.Font); + if (AFont <> nil) then + begin + Canvas.Font.PixelsPerInch := AFont.PixelsPerInch; + Canvas.Font := AFont; + end; + FSaveColor := Canvas.Brush.Color; + Canvas.Brush.Color := AColor; +end; + +procedure TdxPSReportRenderer.UnprepareCanvasForCustomDraw; +begin + Canvas.Brush.Color := FSaveColor; + Canvas.Brush.Style := bsClear; + Canvas.Font.PixelsPerInch := FSavePixelsPerInch; + Canvas.Font := FSaveFont; + SetBkMode(DC, Windows.TRANSPARENT); +end; + +procedure TdxPSReportRenderer.PrepareFonts; +var + UPI: Integer; +begin + UPI := RenderInfo.UnitsPerInch; + if not ReportLink.ScaleFonts and (ReportLink.RealScaleFactor <> 100) then + UPI := MulDiv(UPI, 100, ReportLink.RealScaleFactor); + ReportLink.PrepareFonts(UPI); + MarlettFont10.Height := -MulDiv(10, UnitsPerInch, PtPerInch); + dxPSUtl.SetFontAsNonAntialiased(MarlettFont10); + MarlettFont8.Height := -MulDiv(8, UnitsPerInch, PtPerInch); + dxPSUtl.SetFontAsNonAntialiased(MarlettFont8); + SymbolFont.Height := -MulDiv(7, UnitsPerInch, PtPerInch); + dxPSUtl.SetFontAsNonAntialiased(SymbolFont); +end; + +procedure TdxPSReportRenderer.PrepareGDIObjects; +begin + FBorderColor := ColorToRGB(RenderInfo.GridLinesColor); +end; + +procedure TdxPSReportRenderer.PrepareLogicalCoordinates; +begin + SetMapMode(DC, MM_ISOTROPIC); + PrepareWindow; + PrepareViewPort; +// MoveToEx(DC, 0, 0, nil); +end; + +procedure TdxPSReportRenderer.PrepareLogicalUnits; +var + R: TRect; + UnitsPerPt: Integer; +begin + R := MakeRect(0, 0, 1, 1); + DPToLP(DC, R, 2); + UnitsPerPixel := R.Right - R.Left; + //if Odd(FUnitsPerPixel) then Dec(FUnitsPerPixel); + if UnitsPerPixel = 0 then UnitsPerPixel := 1; + + UnitsPerPt := MulDiv(UnitsPerPixel, PPI, PtPerInch); + + if not IsPrinting then + begin + LineThickness := 1 * UnitsPerPixel; + if (ZoomFactor > 100) and ReportLink.IsScaleGridLines then + LineThickness := LineThickness * (ZoomFactor div 100); + end + else + LineThickness := MulDiv(UnitsPerPt, 1, 2); + + FPixelsNumerator := RenderInfo.UnitsPerInch; +end; + +function TdxPSReportRenderer.PreparedPageIndex(APageIndex: Integer): Integer; +var + RowIndex, ColIndex: Integer; +begin + if RenderInfo.PrinterPage.PageOrder = poDownThenOver then + begin + RowIndex := APageIndex div RenderInfo.PageColCount; + ColIndex := APageIndex mod RenderInfo.PageColCount; + Result := RowIndex + ColIndex * RenderInfo.PageRowCount; + end + else + Result := APageIndex; +end; + +procedure TdxPSReportRenderer.PrepareRenderPage; +begin + RenderInfo.Lock; + SaveMapMode; + PrepareLogicalCoordinates; + PrepareLogicalUnits; + PrepareFonts; + PrepareGDIObjects; + FIsRendering := True; +end; + +procedure TdxPSReportRenderer.PrepareWindow; +begin + with RenderInfo do + begin + SetWindowExtEx(DC, PageSize.X, PageSize.Y, nil); + ScaleWindowExtEx(DC, WindowScalePair.Numerator, WindowScalePair.Denominator, + WindowScalePair.Numerator, WindowScalePair.Denominator, nil); + end; +end; + +procedure TdxPSReportRenderer.PrepareViewPort; +begin + with ViewPortRect do + begin + SetViewPortExtEx(DC, Right - Left, Bottom - Top, nil); + SetViewPortOrgEx(DC, Left, Top, nil); + end; +end; + +procedure TdxPSReportRenderer.RestoreMapMode; +begin + SetMapMode(DC, FPrevMode); + SetWindowExtEx(DC, FPrevWindowExt.cX, FPrevWindowExt.cY, nil); + SetViewPortOrgEx(DC, FPrevViewPortOrg.X, FPrevViewPortOrg.Y, nil); + SetViewPortExtEx(DC, FPrevViewPortExt.cX, FPrevViewPortExt.cY, nil); + SetWindowOrgEx(DC, FPrevWindowOrg.X, FPrevWindowOrg.Y, nil); +end; + +procedure TdxPSReportRenderer.SaveMapMode; +begin + FPrevMode := GetMapMode(DC); + GetWindowExtEx(DC, FPrevWindowExt); + GetWindowOrgEx(DC, FPrevWindowOrg); + GetViewPortExtEx(DC, FPrevViewPortExt); + GetViewPortOrgEx(DC, FPrevViewPortOrg); +end; + +procedure TdxPSReportRenderer.UnprepareLogicalUnits; +begin + LineThickness := 1; +end; + +procedure TdxPSReportRenderer.UnprepareGDIObjects; +begin +end; + +procedure TdxPSReportRenderer.UnprepareRenderPage; +begin + FIsRendering := False; + UnprepareLogicalUnits; + UnprepareGDIObjects; + RestoreMapMode; + RenderInfo.Unlock; +end; + +{ TdxReportItem } + +constructor TdxReportItem.Create(AParent: TdxReportCell); +begin + inherited Create; + Parent := AParent; +end; + +destructor TdxReportItem.Destroy; +begin + SetParent(nil); + inherited Destroy; +end; + +procedure TdxReportItem.Assign(Source: TPersistent); +begin + if Source is TdxReportItem then + Data := TdxReportItem(Source).Data + else + inherited; +end; + +class function TdxReportItem.ReportItemClass: TdxReportItemClass; +begin + Result := TdxReportItemClass(GetTypeData(ClassInfo)^.ClassType); +end; + +class procedure TdxReportItem.Register; +begin + if GetClass(ClassName) = nil then RegisterClass(Self); +end; + +class procedure TdxReportItem.Unregister; +begin + UnregisterClass(Self); +end; + +function TdxReportItem.Clone(AParent: TdxReportCell): TdxReportItem; +begin + Result := ReportItemClass.Create(AParent); + try + Result.Assign(Self); + except + Result.Free; + raise; + end; +end; + +function TdxReportItem.GetNextSibling: TdxReportItem; +var + Index: Integer; +begin + Result := nil; + if not HasParent then Exit; + Index := Parent.IndexOf(Self); + + if IsCell then + begin + if Index < Parent.CellCount - 1 then + Result := TdxReportItem(Parent.FCellList[Index + 1]); + end + else + if Index < Parent.DataItemCount - 1 then + Result := TdxReportItem(Parent.FDataList[Index + 1]); +end; + +function TdxReportItem.GetPrevSibling: TdxReportItem; +var + Index: Integer; +begin + Result := nil; + if not HasParent then Exit; + Index := Parent.IndexOf(Self); + if Index < 1 then Exit; + + if IsCell then + Result := TdxReportItem(Parent.FCellList[Index - 1]) + else + Result := TdxReportItem(Parent.FDataList[Index - 1]); +end; + +function TdxReportItem.HasParent: Boolean; +begin + Result := Parent <> nil; +end; + +function TdxReportItem.IsFirstItem: Boolean; +begin + Result := GetPrevSibling = nil; +end; + +function TdxReportItem.IsLastItem: Boolean; +begin + Result := GetNextSibling = nil; +end; + +function TdxReportItem.AsCell: TdxReportCell; +begin + if IsCell then + Result := TdxReportCell(Self) + else + Result := nil; +end; + +function TdxReportItem.GetTopLevelParent: TdxReportCell; +begin + if ReportCells <> nil then + Result := ReportCells.GetCellTopLevelParent(Self) + else + Result := nil; +end; + +class function TdxReportItem.IsCell: Boolean; +begin + Result := False; +end; + +procedure TdxReportItem.ReadData(AReader: TdxPSDataReader); +begin + Data := AReader.ReadInteger; +end; + +procedure TdxReportItem.WriteData(AWriter: TdxPSDataWriter); +begin + AWriter.WriteInteger(Data); +end; + +class function TdxReportItem.Serializable: Boolean; +begin + Result := True; +end; + +function TdxReportItem.GetIndex: Integer; +begin + if Parent <> nil then + Result := Parent.IndexOf(Self) + else + Result := -1; +end; + +function TdxReportItem.GetReportCells: TdxReportCells; +begin + if Parent <> nil then + Result := Parent.ReportCells + else + Result := nil; +end; + +procedure TdxReportItem.SetIndex(Value: Integer); +var + CurIndex: Integer; +begin + if Parent = nil then Exit; + if Value < 0 then Value := 0; + + if IsCell then + begin + if Value > Parent.CellCount - 1 then + Value := Parent.CellCount - 1 + end + else + if Value > Parent.DataItemCount - 1 then + Value := Parent.DataItemCount - 1; + CurIndex := GetIndex; + if CurIndex <> Value then + Parent.MoveItem(Self, CurIndex, Value); +end; + +procedure TdxReportItem.SetParent(Value: TdxReportCell); +begin + if Parent <> Value then + begin + if Parent <> nil then Parent.RemoveItem(Self); + if Value <> nil then Value.InsertItem(Self); + end; +end; + +{ TdxReportVisualItem } + +constructor TdxReportVisualItem.Create(AParent: TdxReportCell); +begin + inherited; + FBackgroundBitmapIndex := -1; + if HasBorderColoration then + FBorderClass := TdxPSColorBorder + else + FBorderClass := TdxPSCellUltraFlatBorder; + FBorderColor := clDefault; + CellSides := dxDefaultCellSides; // csAll + FColor := dxDefaultContentColor; // clWhite + ShowShadow := False; + Transparent := dxDefaultTransparent; // True + Visible := True; +end; + +procedure TdxReportVisualItem.Assign(Source: TPersistent); +begin + inherited; + if Source is TdxReportVisualItem then + with TdxReportVisualItem(Source) do + begin + Self.BackgroundBitmapIndex := BackgroundBitmapIndex; + Self.BorderClass := BorderClass; + Self.BorderColor := BorderColor; + Self.BoundsRect := BoundsRect; + Self.Color := Color; + Self.ContentBkColor := ContentBkColor; + Self.ContentPattern := ContentPattern; + Self.FontIndex := FontIndex; + Self.Format := Format; + Self.ShadowColor := ShadowColor; + Self.ShadowDepth := ShadowDepth; + Self.FCellSideColors := FCellSideColors; + end; +end; + +procedure TdxReportVisualItem.AdjustContent(DC: HDC); +begin +end; + +procedure TdxReportVisualItem.DrawBackground(DC: HDC); +begin + DrawBackgroundRect(DC, GetBackgroundBounds(DC)); +end; + +procedure TdxReportVisualItem.DrawBackgroundBitmap(DC: HDC); +var + Rgn: HRGN; + I, J: Integer; + R: TRect; +begin + Rgn := Renderer.IntersectClipRect(GetBackgroundBounds(DC)); + try + for I := BackgroundBitmapTileStartIndexX to BackgroundBitmapTileStopIndexX do + for J := BackgroundBitmapTileStartIndexY to BackgroundBitmapTileStopIndexY do + begin + R := BackgroundBitmapTileBounds[I, J]; + if RectVisible(DC, R) then DrawBackgroundBitmapTile(DC, R); + end; + finally + Renderer.RestoreClipRgn(Rgn); + end; +end; + +procedure TdxReportVisualItem.DrawBackgroundBitmapTile(DC: HDC; const Rect: TRect); +begin + Renderer.DrawGraphicEx(DC, Rect, GetBackgroundBounds(DC), nil, -1, BackgroundBitmap, + False, False, clNone, clNone, nil, cibAlways); +end; + +procedure TdxReportVisualItem.DrawBackgroundRect(DC: HDC; const R: TRect); +begin + if not IsRectEmpty(R) then + Renderer.FillRectEx(DC, R, Color, ContentBkColor, ContentPattern); +end; + +procedure TdxReportVisualItem.DrawBorders(DC: HDC); +begin + BorderPainter.Paint(DC); +end; + +function TdxReportVisualItem.GetBorderOuterBounds(DC: HDC): TRect; +begin + Result := GetBorderOuterBoundsRelativeTo(DC, GetOuterBounds(DC)); +end; + +function TdxReportVisualItem.GetInnerBounds(DC: HDC): TRect; +begin + Result := GetInnerBoundsRelativeTo(DC, BoundsRect); +end; + +function TdxReportVisualItem.GetOuterBounds(DC: HDC): TRect; +begin + Result := GetOuterBoundsRelativeTo(DC, BoundsRect); +end; + +procedure TdxReportVisualItem.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); +begin + if (ALeft <> Left) or (ATop <> Top) or (AWidth <> Width) or (AHeight <> Height) then + begin + FBoundsRect.Left := ALeft; + FBoundsRect.Top := ATop; + FBoundsRect.Right := ALeft + AWidth; + FBoundsRect.Bottom := ATop + AHeight; + BoundsChanged; + end; +end; + +function TdxReportVisualItem.CalculateLineCount(DC: HDC): Integer; +begin + Result := 1; +end; + +function TdxReportVisualItem.MeasureBordersHeight(DC: HDC): Integer; +begin + Result := 0; + if csTop in CellSides then + Inc(Result, GetBorderEdgeThickness(csTop) - 1); + if csBottom in CellSides then + Inc(Result, GetBorderEdgeThickness(csBottom) - 1); + if ShowShadow then + Inc(Result, ShadowDepth); +end; + +function TdxReportVisualItem.MeasureBordersWidth(DC: HDC): Integer; +begin + Result := 0; + if csLeft in CellSides then + Inc(Result, GetBorderEdgeThickness(csLeft) - 1); + if csRight in CellSides then + Inc(Result, GetBorderEdgeThickness(csRight) - 1); + if ShowShadow then + Inc(Result, ShadowDepth); +end; + +function TdxReportVisualItem.MeasureContentHeight(DC: HDC): Integer; +begin + Result := 0; +end; + +function TdxReportVisualItem.MeasureContentWidth(DC: HDC): Integer; +begin + Result := 0; +end; + +function TdxReportVisualItem.MeasureFontHeight(DC: HDC): Integer; +begin + Result := Height; +end; + +function TdxReportVisualItem.MeasureHeight(DC: HDC): Integer; +begin + Result := MeasureBordersHeight(DC) + MeasureContentHeight(DC); +end; + +function TdxReportVisualItem.MeasureWidth(DC: HDC): Integer; +begin + Result := MeasureBordersWidth(DC) + MeasureContentWidth(DC); +end; + +class function TdxReportVisualItem.MapBorderClass(AEdgeMode: TdxCellEdgeMode; + AEdgeStyle: TdxCellEdgeStyle; ASoft: Boolean): TdxPSCellBorderClass; +begin + if AEdgeMode = cem3DEffects then + Result := dxCellBorderClassMap[AEdgeStyle, ASoft] + else + Result := TdxPSCellUltraFlatBorder; +end; + +procedure TdxReportVisualItem.BoundsChanged; +begin +end; + +procedure TdxReportVisualItem.ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); +begin + with FBoundsRect do + begin + Left := MulDiv(Left, APixelsNumerator, APixelsDenominator); + Right := MulDiv(Right, APixelsNumerator, APixelsDenominator); + Top := MulDiv(Top, APixelsNumerator, APixelsDenominator); + Bottom := MulDiv(Bottom, APixelsNumerator, APixelsDenominator); + end; +end; + +procedure TdxReportVisualItem.DoExcludeFromClipRgn(DC: HDC; const R: TRect; + var AResult: Integer); +var + R2: TRect; +begin + if ExcludeFromClipRgn and not Transparent and Visible and IntersectRect(R2, GetAbsoluteRect, R) then + begin + R2 := GetOuterBounds(DC); + if not IsRectEmpty(R2) then + AResult := Renderer.ExcludeClipRect(R2); + end; +end; + +function TdxReportVisualItem.GetBackgroundBitmapTileBounds(Col, Row: Integer): TRect; +begin + Result := MakeBounds(Left + BackgroundBitmapWidth * Col, Top + BackgroundBitmapHeight * Row, + BackgroundBitmapWidth, BackgroundBitmapHeight); + with BackgroundBitmapTileOrigin do + OffsetRect(Result, X, Y); +end; + +function TdxReportVisualItem.GetBackgroundBounds(DC: HDC): TRect; +begin + Result := GetInnerBounds(DC); +end; + +function TdxReportVisualItem.GetBorderClass: TdxPSCellBorderClass; +begin + Result := FBorderClass; +end; + +function TdxReportVisualItem.GetBorderEdgeClass(ASide: TdxCellSide): TdxPSCellBorderClass; +begin + Result := BorderClass; +end; + +function TdxReportVisualItem.GetBorderEdgeBounds(ASide: TdxCellSide; const AOuterRect: TRect): TRect; +begin + Result := AOuterRect; + with Result do + case ASide of + csLeft: + Right := Left + LineThickness * BorderEdgeThicknesses[csLeft]; + csTop: + Bottom := Top + LineThickness * BorderEdgeThicknesses[csTop]; + csRight: + Left := Right - LineThickness * BorderEdgeThicknesses[csRight]; + csBottom: + Top := Bottom - LineThickness * BorderEdgeThicknesses[csBottom]; + end; +end; + +function TdxReportVisualItem.GetBorderEdgeSalient(ASide: TdxCellSide; ASalient: TdxPSCellBorderSalientType): Integer; +begin + Result := BorderEdgeClasses[ASide].GetBorderEdgeSalient(ASide, ASalient); +end; + +function TdxReportVisualItem.GetBorderEdgeThickness(ASide: TdxCellSide): Integer; +begin + Result := BorderEdgeClasses[ASide].Thickness; +end; + +function TdxReportVisualItem.GetBorderBounds(DC: HDC): TRect; +begin + Result := FBoundsRect; +end; + +function TdxReportVisualItem.GetBorderOuterBoundsRelativeTo(DC: HDC; const R: TRect): TRect; +begin + Result := R; + if ShowShadow then + begin + Dec(Result.Right, ShadowDepth); + Dec(Result.Bottom, ShadowDepth); + end; + //FixupRect(DC, Result); +end; + +function TdxReportVisualItem.GetInnerBoundsRelativeTo(DC: HDC; const R: TRect): TRect; +var + LineThickness: Integer; +begin + Result := GetOuterBoundsRelativeTo(DC, R); + LineThickness := Self.LineThickness; + + with Result do + begin + if csLeft in CellSides then + Inc(Left, LineThickness * BorderEdgeThicknesses[csLeft]); + if csTop in CellSides then + Inc(Top, LineThickness * BorderEdgeThicknesses[csTop]); + if csRight in CellSides then + Dec(Right, LineThickness * BorderEdgeThicknesses[csRight]); + if csBottom in CellSides then + Dec(Bottom, LineThickness * BorderEdgeThicknesses[csBottom]); + + if ShowShadow then + begin + Dec(Right, ShadowDepth); + Dec(Bottom, ShadowDepth); + end; + end; + FixupRect(DC, Result); +end; + +function TdxReportVisualItem.GetOuterBoundsRelativeTo(DC: HDC; const R: TRect): TRect; +var + LineThickness: Integer; +begin + Result := R; + LineThickness := Self.LineThickness; + + with Result do + begin + if csLeft in CellSides then + Dec(Left, LineThickness * BorderEdgeSalients[csLeft, bstOuter]); + if csTop in CellSides then + Dec(Top, LineThickness * BorderEdgeSalients[csTop, bstOuter]); + if csRight in CellSides then + Inc(Right, LineThickness * BorderEdgeSalients[csRight, bstOuter]); + if csBottom in CellSides then + Inc(Bottom, LineThickness * BorderEdgeSalients[csBottom, bstOuter]); + end; + FixupRect(DC, Result); +end; + +function TdxReportVisualItem.GetBorderPainter: TdxPSCellBorderPainter; +begin + Result := Renderer.GetBorderPainter(BorderPainterClass); + InitBorderPainter(Result); +end; + +function TdxReportVisualItem.GetBorderPainterClass: TdxPSCellBorderPainterClass; +begin + Result := BorderClass.GetPainterClass; +end; + +procedure TdxReportVisualItem.InitBorderPainter(ABorderPainter: TdxPSCellBorderPainter); +begin + ABorderPainter.FItem := Self; +end; + +function TdxReportVisualItem.HasBorderColoration: Boolean; +begin + Result := False; // todo MSN; +end; + +function TdxReportVisualItem.GetFormatBit(ABit: DWORD): Boolean; +begin + Result := Format and ABit = ABit; +end; + +procedure TdxReportVisualItem.SetFormatBit(ABit: DWORD; Value: Boolean); +begin + Format := Format and not ABit; + if Value then + Format := Format or ABit; +end; + +function TdxReportVisualItem.GetContentBkColor: TColor; +begin + Result := Color; +end; + +function TdxReportVisualItem.GetContentPattern: TdxPSFillPatternClass; +begin + Result := TdxPSSolidFillPattern; +end; + +function TdxReportVisualItem.GetShadowColor: TColor; +begin + if ReportCells <> nil then + Result := ReportCells.ShadowColor + else + Result := dxDefaultShadowColor; +end; + +function TdxReportVisualItem.GetShadowDepth: Integer; +begin + if ReportCells <> nil then + Result := ReportCells.ShadowDepth + else + Result := dxDefaultShadowDepth; +end; + +procedure TdxReportVisualItem.SetContentBkColor(Value: TColor); +begin +end; + +procedure TdxReportVisualItem.SetContentPattern(Value: TdxPSFillPatternClass); +begin +end; + +procedure TdxReportVisualItem.SetFontIndex(Value: Integer); +begin + if Value < -1 then Value := -1; + FFontIndex := Value; +end; + +procedure TdxReportVisualItem.SetShadowColor(Value: TColor); +begin +end; + +procedure TdxReportVisualItem.SetShadowDepth(Value: Integer); +begin +end; + +function TdxReportVisualItem.IsBackgroundBitmapDrawn: Boolean; +begin + Result := (BackgroundBitmapIndex <> -1) and not BackgroundBitmap.Empty; +end; + +function TdxReportVisualItem.IsBackgroundDrawn: Boolean; +begin + Result := not Transparent; +end; + +function TdxReportVisualItem.IsBordersDrawn: Boolean; +begin + Result := (CellSides <> []) or ShowShadow; +end; + +procedure TdxReportVisualItem.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + with AReader do + begin + BackgroundBitmapIndex := ReadInteger; + BoundsRect := ReadRect; + BorderClass := ReadCellBorderClass; + if HasBorderColoration then + TRect(FCellSideColors) := ReadRect; + BorderColor := ReadInteger; + Color := ReadInteger; + ContentBkColor := ReadInteger; + ContentPattern := ReadFillPatternClass; + FontIndex := ReadInteger; + Read(FFormat, SizeOf(Format)); + end; +end; + +procedure TdxReportVisualItem.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + with AWriter do + begin + WriteInteger(BackgroundBitmapIndex); + WriteRect(BoundsRect); + WriteClassName(BorderClass); + if HasBorderColoration then + WriteRect(TRect(FCellSideColors)); + WriteInteger(BorderColor); + WriteInteger(Color); + WriteInteger(ContentBkColor); + WriteClassName(ContentPattern); + WriteInteger(FontIndex); + Write(Format, SizeOf(Format)); + end; +end; + +function TdxReportVisualItem.GetAbsoluteOrigin: TPoint; +var + Item: TdxReportVisualItem; + Origin: TPoint; +begin + Result := NullPoint; + Item := Self; + while Item <> nil do + begin + Origin := Item.GetOrigin; + Inc(Result.X, Origin.X); + Inc(Result.Y, Origin.Y); + Item := Item.Parent; + end; +end; + +function TdxReportVisualItem.GetAbsoluteRect: TRect; +begin + with Result do + begin + TopLeft := AbsoluteOrigin; + Right := Left + Width; + Bottom := Top + Height; + end; +end; + +function TdxReportVisualItem.GetBackgroundBitmap: TBitmap; +begin + Result := BackgroundBitmapPool[BackgroundBitmapIndex]; +end; + +function TdxReportVisualItem.GetBackgroundBitmapHeight: Integer; +begin + Result := BackgroundBitmap.Height * Renderer.UnitsPerPixel; +end; + +function TdxReportVisualItem.GetBackgroundBitmapPool: TdxPSBackgroundBitmapPool; +begin + if (ReportCells <> nil) and (ReportCells.ReportLink <> nil) then + Result := ReportCells.ReportLink.BackgroundBitmapPool + else + Result := nil; +end; + +function TdxReportVisualItem.GetBackgroundBitmapTileOrigin: TPoint; +begin + Result := AbsoluteOrigin; + Result.X := -Result.X; + Result.Y := -Result.Y; +end; + +function TdxReportVisualItem.GetBackgroundBitmapTileStartIndexX: Integer; +begin + Result := Abs(BackgroundBitmapTileOrigin.X) div BackgroundBitmapWidth; +end; + +function TdxReportVisualItem.GetBackgroundBitmapTileStartIndexY: Integer; +begin + Result := Abs(BackgroundBitmapTileOrigin.Y) div BackgroundBitmapHeight; +end; + +function TdxReportVisualItem.GetBackgroundBitmapTileStopIndexX: Integer; +begin + Result := (Width + Abs(BackgroundBitmapTileOrigin.X)) div BackgroundBitmapWidth; +end; + +function TdxReportVisualItem.GetBackgroundBitmapTileStopIndexY: Integer; +begin + Result := (Height + Abs(BackgroundBitmapTileOrigin.Y)) div BackgroundBitmapHeight; +end; + +function TdxReportVisualItem.GetBackgroundBitmapWidth: Integer; +begin + Result := BackgroundBitmap.Width * Renderer.UnitsPerPixel; +end; + +function TdxReportVisualItem.GetBorderBrush: HBRUSH; +begin + Result := Renderer.GetBrushByColor(BorderColor); +end; + +function TdxReportVisualItem.GetBorderColor: TColor; +begin + Result := FBorderColor; + if Result = clDefault then Result := ReportCells.BorderColor; +end; + +function TdxReportVisualItem.GetCellSides: TdxCellSides; +begin + Result := TdxCellSides(Byte(Format and dxPSGlbl.dxFormatRect)); +end; + +function TdxReportVisualItem.GetCellSideColors(ASide: TdxCellSide): TColor; +begin + Result := FCellSideColors[ASide]; +end; + +function TdxReportVisualItem.GetContentBrush: HBRUSH; +begin + Result := dxPSFillPatternFactory.Items[ContentPattern, IsPrinting].Brush.Handle; +end; + +function TdxReportVisualItem.GetEdge3DSoft: Boolean; +begin + Result := BorderClass.Edge3DSoft; +end; + +function TdxReportVisualItem.GetEdge3DStyle: TdxCellEdgeStyle; +begin + Result := BorderClass.Edge3DStyle; +end; + +function TdxReportVisualItem.GetEdgeMode: TdxCellEdgeMode; +begin + Result := BorderClass.EdgeMode; +end; + +function TdxReportVisualItem.GetExcludeFromClipRgn: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatExcludeFromClipRgn); +end; + +function TdxReportVisualItem.GetFont: TFont; +begin + if (FontIndex <> -1) and (ReportCells <> nil) then + Result := ReportCells.GetFontByIndex(FontIndex) + else + Result := nil; +end; + +function TdxReportVisualItem.GetHeight: Integer; +begin + with BoundsRect do + Result := Bottom - Top; +end; + +function TdxReportVisualItem.GetIsPrinting: Boolean; +begin + Result := Renderer.IsPrinting; +end; + +function TdxReportVisualItem.GetLeft: Integer; +begin + Result := BoundsRect.Left; +end; + +function TdxReportVisualItem.GetLineThickness: Integer; +begin + Result := Renderer.LineThickness; +end; + +function TdxReportVisualItem.GetOrigin: TPoint; +begin + Result := BoundsRect.TopLeft; +end; + +function TdxReportVisualItem.GetParentBrush: HBRUSH; +begin + Result := Renderer.GetBrushByColor(ParentColor); +end; + +function TdxReportVisualItem.GetParentColor: TColor; +var + ItemParent: TdxReportCell; +begin + ItemParent := Parent; + while (ItemParent <> nil) and ItemParent.Transparent do + ItemParent := ItemParent.Parent; + + if ItemParent <> nil then + Result := ItemParent.Color + else + Result := clNone; +end; + +function TdxReportVisualItem.GetRenderer: TdxPSReportRenderer; +begin + Result := ReportCells.Renderer; +end; + +function TdxReportVisualItem.GetShadowBrush: HBRUSH; +begin + Result := Renderer.GetBrushByColor(ShadowColor); +end; + +function TdxReportVisualItem.GetShowShadow: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatShowShadow); +end; + +function TdxReportVisualItem.GetTop: Integer; +begin + Result := BoundsRect.Top; +end; + +function TdxReportVisualItem.GetTransparent: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatTransparent); +end; + +function TdxReportVisualItem.GetWidth: Integer; +begin + with BoundsRect do + Result := Right - Left; +end; + +function TdxReportVisualItem.GetVisible: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatVisible); +end; + +procedure TdxReportVisualItem.SetBackgroundBitmapIndex(Value: Integer); +begin + if Value < -1 then Value := -1; + FBackgroundBitmapIndex := Value; +end; + +procedure TdxReportVisualItem.SetBorderClass(Value: TdxPSCellBorderClass); +begin + if Value = nil then Value := TdxPSCellUltraFlatBorder; + FBorderClass := Value; +end; + +procedure TdxReportVisualItem.SetBoundsRect(const Value: TRect); +begin + with Value do + SetBounds(Left, Top, Right - Left, Bottom - Top); +end; + +procedure TdxReportVisualItem.SetCellSides(Value: TdxCellSides); +begin + if CellSides <> Value then + Format := Format and not dxPSGlbl.dxFormatRect or Byte(Value); +end; + +procedure TdxReportVisualItem.SetCellSideColors( + ASide: TdxCellSide; AValue: TColor); +begin + FCellSideColors[ASide] := AValue; +end; + +procedure TdxReportVisualItem.SetColor(Value: TColor); +begin + FColor := ColorToRGB(Value); +end; + +procedure TdxReportVisualItem.SetEdge3DSoft(Value: Boolean); +begin + BorderClass := MapBorderClass(EdgeMode, Edge3DStyle, Value); +end; + +procedure TdxReportVisualItem.SetEdge3DStyle(Value: TdxCellEdgeStyle); +begin + BorderClass := MapBorderClass(EdgeMode, Value, Edge3DSoft); +end; + +procedure TdxReportVisualItem.SetEdgeMode(Value: TdxCellEdgeMode); +begin + BorderClass := MapBorderClass(Value, Edge3DStyle, Edge3DSoft); +end; + +procedure TdxReportVisualItem.SetExcludeFromClipRgn(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatExcludeFromClipRgn, Value); +end; + +procedure TdxReportVisualItem.SetFont(Value: TFont); +begin + if ReportCells <> nil then + FontIndex := ReportCells.GetIndexByFont(Value); +end; + +procedure TdxReportVisualItem.SetFormat(Value: DWORD); +begin + FFormat := Value; +end; + +procedure TdxReportVisualItem.SetHeight(Value: Integer); +begin + SetBounds(Left, Top, Width, Value); +end; + +procedure TdxReportVisualItem.SetLeft(Value: Integer); +begin + SetBounds(Value, Top, Width, Height); +end; + +procedure TdxReportVisualItem.SetOrigin(const Value: TPoint); +begin + SetBounds(Value.X, Value.Y, Width, Height); +end; + +procedure TdxReportVisualItem.SetShowShadow(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatShowShadow, Value); +end; + +procedure TdxReportVisualItem.SetTop(Value: Integer); +begin + SetBounds(Left, Value, Width, Height); +end; + +procedure TdxReportVisualItem.SetTransparent(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatTransparent, Value); +end; + +procedure TdxReportVisualItem.SetWidth(Value: Integer); +begin + SetBounds(Left, Top, Value, Height); +end; + +procedure TdxReportVisualItem.SetVisible(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatVisible, Value); +end; + +{ TdxReportCell } + +destructor TdxReportCell.Destroy; +begin + SetParent(nil); + ClearDataItems; + ClearCells; + inherited Destroy; +end; + +procedure TdxReportCell.Assign(Source: TPersistent); + + procedure DoAssign(ASource, ADest: TdxReportCell); + var + I: Integer; + DestCell: TdxReportCell; + begin + for I := 0 to ASource.CellCount - 1 do + begin + DestCell := TdxReportCell.Create(ADest); + DestCell.Assign(ASource.Cells[I]); + end; + + for I := 0 to ASource.DataItemCount - 1 do + ASource.DataItems[I].Clone(ADest); + end; + +begin + if (Source is TdxReportCell) and (Source <> Self) then + begin + ClearAll; + inherited; + DoAssign(TdxReportCell(Source), Self); + end + else + inherited; +end; + +procedure TdxReportCell.DrawContent(DC: HDC; DrawRect: TRect; const OriginRect: TRect; + AStage: TdxPSRenderStages); +var + R: TRect; + ContentRgn, Rgn: HRGN; +begin + if ClipChildren then + begin + R := DrawRect; + Dec(R.Left, BorderClass.Thickness * LineThickness); // BorderClass.Thickness - v3.2 + Dec(R.Top, BorderClass.Thickness * LineThickness); // BorderClass.Thickness - v3.2 + ContentRgn := Renderer.IntersectClipRect(R); + end + else + ContentRgn := Renderer.GetClipRgn; + + try + Rgn := Renderer.GetClipRgn; + if ExcludeNestedItems(DC, OriginRect) <> NULLREGION then + begin + DrawItself(DC, AStage); + DrawNestedDataItems(DC, OriginRect, AStage); + end; + Renderer.RestoreClipRgn(Rgn); + + DrawNestedCells(DC, DrawRect, OriginRect, AStage); + //DrawNestedDataItems(DC, OriginRect, AStage); + finally + Renderer.RestoreClipRgn(ContentRgn); + end; +end; + +procedure TdxReportCell.DrawItself(DC: HDC; AStage: TdxPSRenderStages); +begin + if rsFirstPass in AStage then + begin + if IsBackgroundBitmapDrawn then + DrawBackgroundBitmap(DC) + else + if IsBackgroundDrawn then + DrawBackground(DC); + + if IsBordersDrawn then DrawBorders(DC); + end; +end; + +procedure TdxReportCell.DrawNestedCells(DC: HDC; DrawRect: TRect; const OriginRect: TRect; + AStage: TdxPSRenderStages); +var + I: Integer; + R: TRect; +begin + for I := 0 to CellCount - 1 do + with Cells[I] do + if Visible then + begin + DrawRect := BoundsRect; + if {RectVisible(DC, DrawRect) and }IntersectRect(R, GetAbsoluteRect, OriginRect) then + with BoundsRect do + begin + if (Left <> 0) or (Top <> 0) then OffsetWindowOrgEx(DC, -Left, -Top, nil); + OffsetRect(DrawRect, -Left, -Top); + DrawContent(DC, DrawRect, OriginRect, AStage); + if (Left <> 0) or (Top <> 0) then OffsetWindowOrgEx(DC, Left, Top, nil); + end; + end; +end; + +procedure TdxReportCell.DrawNestedDataItems(DC: HDC; const OriginRect: TRect; AStage: TdxPSRenderStages); + + function PrepareCustomDraw(AnItem: TAbstractdxReportCellData): TAbstractdxReportCellData; + begin + Result := TAbstractdxReportCellData(AnItem.Clone(nil)); + Renderer.PrepareCanvasForCustomDraw(AnItem.Font, AnItem.Color); + end; + + procedure UnprepareCustomDraw(AnItem: TAbstractdxReportCellData; var ASavedItem: TAbstractdxReportCellData); + begin + if AnItem.FontIndex = -1 then + with ReportCells.GetFontByIndex(ASavedItem.FontIndex) do + begin + SelectObject(DC, Handle); + SetTextColor(DC, ColorToRGB(Color)); + end; + AnItem.Assign(ASavedItem); + FreeAndNil(ASavedItem); + Renderer.UnprepareCanvasForCustomDraw; + end; + +var + I: Integer; + Item, SavedItem: TAbstractdxReportCellData; + IsCustomDrawn: Boolean; +begin + for I := DataItemCount - 1 downto 0 do + begin + Item := DataItems[I]; + if Item.IsDrawingNeeded(DC, AStage, OriginRect) then + begin + SavedItem := nil; + IsCustomDrawn := Item.IsCustomDrawn; + if IsCustomDrawn then SavedItem := PrepareCustomDraw(Item); + try + if not Item.CustomDraw(DC) then Item.DrawContent(DC, AStage); + finally + if IsCustomDrawn then UnprepareCustomDraw(Item, SavedItem); + end; + end; + end; +end; + +function TdxReportCell.ExcludeNestedItems(DC: HDC; const OriginRect: TRect): Integer; + + procedure ExcludeNestedCells(DC: HDC; const OriginRect: TRect; var AResult: Integer); + var + I: Integer; + begin + for I := 0 to CellCount - 1 do + with Cells[I] do + begin + DoExcludeFromClipRgn(DC, OriginRect, AResult); + if AResult = NULLREGION then Break; + end; + end; + + procedure ExcludeNestedDataItems(DC: HDC; const OriginRect: TRect; var AResult: Integer); + var + I: Integer; + begin + for I := 0 to DataItemCount - 1 do + with DataItems[I] do + begin + DoExcludeFromClipRgn(DC, OriginRect, AResult); + if AResult = NULLREGION then Break; + end; + end; + +begin + Result := SIMPLEREGION; + ExcludeNestedCells(DC, OriginRect, Result); + if Result <> NULLREGION then + ExcludeNestedDataItems(DC, OriginRect, Result); +end; + +function TdxReportCell.GetBorderOuterBounds(DC: HDC): TRect; +begin +// Result := GetOuterBounds(DC); + Result := BoundsRect; + OffsetRect(Result, -Result.Left, -Result.Top); + Result := GetBorderOuterBoundsRelativeTo(DC, GetOuterBoundsRelativeTo(DC, Result)); +end; + +function TdxReportCell.GetInnerBounds(DC: HDC): TRect; +begin + Result := BoundsRect; + OffsetRect(Result, -Result.Left, -Result.Top); + Result := GetInnerBoundsRelativeTo(DC, Result); +end; + +function TdxReportCell.GetOuterBounds(DC: HDC): TRect; +begin + Result := BoundsRect; + OffsetRect(Result, -Result.Left, -Result.Top); + Result := GetOuterBoundsRelativeTo(DC, Result); +end; + +function TdxReportCell.MeasureHeight(DC: HDC): Integer; +begin + Result := Height; +end; + +function TdxReportCell.MeasureWidth(DC: HDC): Integer; +begin + Result := Width; +end; + +procedure TdxReportCell.InsertCell(AnItem: TdxReportCell); +begin + CellListNeeded; + FCellList.Add(AnItem); + AnItem.FReportCells := FReportCells; +end; + +procedure TdxReportCell.InsertDataItem(AnItem: TdxReportItem); +begin + DataListNeeded; + FDataList.Add(AnItem); +end; + +procedure TdxReportCell.InsertItem(AnItem: TdxReportItem); +begin + if AnItem.IsCell then + InsertCell(AnItem.AsCell) + else + InsertDataItem(AnItem); + AnItem.FParent := Self; +end; + +procedure TdxReportCell.MoveCell(ACurIndex, ANewIndex: Integer); +begin + FCellList.Move(ACurIndex, ANewIndex); +end; + +procedure TdxReportCell.MoveDataItem(ACurIndex, ANewIndex: Integer); +begin + FDataList.Move(ACurIndex, ANewIndex); +end; + +procedure TdxReportCell.MoveItem(AnItem: TdxReportItem; ACurIndex, ANewIndex: Integer); +begin + if AnItem.IsCell then + MoveCell(ACurIndex, ANewIndex) + else + MoveDataItem(ACurIndex, ANewIndex); +end; + +procedure TdxReportCell.RemoveCell(AnItem: TdxReportCell); +begin + if FCellList <> nil then + begin + FCellList.Remove(AnItem); + CellListRelease; + end +end; + +procedure TdxReportCell.RemoveDataItem(AnItem: TdxReportItem); +begin + if FDataList <> nil then + begin + FDataList.Remove(AnItem); + DataListRelease; + end; +end; + +procedure TdxReportCell.RemoveItem(AnItem: TdxReportItem); +begin + if AnItem.IsCell then + RemoveCell(AnItem.AsCell) + else + RemoveDataItem(AnItem); + AnItem.FParent := nil; +end; + +procedure TdxReportCell.SetClipChildren(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatClipChildren, Value); +end; + +function TdxReportCell.GetAbsoluteIndex: Integer; +var + Cell: TdxReportCell; +begin + Cell := Self; + Result := 0; + while Cell <> nil do + begin + Inc(Result, Cell.Index); + Cell := Cell.Parent; + end; +end; + +function TdxReportCell.GetLevel: Integer; +var + Cell: TdxReportCell; +begin + Result := 0; + Cell := Parent; + while Cell <> nil do + begin + Inc(Result); + Cell := Cell.Parent; + end; +end; + +procedure TdxReportCell.AllocateSpaceForCells(ACapacity: Integer); +begin + CellListNeeded; + if ACapacity > FCellList.Capacity then FCellList.Capacity := ACapacity; +end; + +procedure TdxReportCell.AllocateSpaceForDatas(ACapacity: Integer); +begin + DataListNeeded; + if ACapacity > FDataList.Capacity then FDataList.Capacity := ACapacity; +end; + +function TdxReportCell.GetReportCells: TdxReportCells; +begin + Result := FReportCells; +end; + +procedure TdxReportCell.CellListNeeded; +begin + if FCellList = nil then FCellList := TList.Create; +end; + +procedure TdxReportCell.CellListRelease; +begin + if CellCount = 0 then FreeAndNil(FCellList); +end; + +procedure TdxReportCell.DataListNeeded; +begin + if FDataList = nil then FDataList := TList.Create; +end; + +procedure TdxReportCell.DataListRelease; +begin + if DataItemCount = 0 then FreeAndNil(FDataList); +end; + +procedure TdxReportCell.ClearAll; +begin + ClearCells; + ClearDataItems; +end; + +procedure TdxReportCell.ClearCells; +begin + if FCellList <> nil then + begin + while CellCount > 0 do Cells[CellCount - 1].Free; + CellListRelease; + end; +end; + +procedure TdxReportCell.ClearDataItems; +begin + if FDataList <> nil then + begin + while DataItemCount > 0 do DataItems[DataItemCount - 1].Free; + DataListRelease; + end; +end; + +function TdxReportCell.GetCell(Index: Integer): TdxReportCell; +begin + Result := TdxReportCell(FCellList[Index]); +end; + +function TdxReportCell.GetClipChildren: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatClipChildren); +end; + +function TdxReportCell.GetCellCount: Integer; +begin + if FCellList <> nil then + Result := FCellList.Count + else + Result := 0; +end; + +function TdxReportCell.GetDataItem(Index: Integer): TAbstractdxReportCellData; +begin + Result := TAbstractdxReportCellData(FDataList[Index]); +end; + +function TdxReportCell.GetIsTopLevel: Boolean; +begin + Result := Level = 1; +end; + +function TdxReportCell.GetDataItemCount: Integer; +begin + if FDataList <> nil then + Result := FDataList.Count + else + Result := 0; +end; + +function TdxReportCell.IndexOf(AnItem: TdxReportItem): Integer; +begin + Result := -1; + if AnItem.IsCell then + begin + if FCellList <> nil then + Result := FCellList.IndexOf(AnItem) + end + else + if FDataList <> nil then + Result := FDataList.IndexOf(AnItem); +end; + +class function TdxReportCell.IsCell: Boolean; +begin + Result := True; +end; + +procedure TdxReportCell.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + ReadProperties(AReader); + ReadCells(AReader); + ReadDataItems(AReader); +end; + +procedure TdxReportCell.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + WriteProperties(AWriter); + WriteCells(AWriter); + WriteDataItems(AWriter); +end; + +procedure TdxReportCell.ReadCells(AReader: TdxPSDataReader); + + procedure LoadCell; + var + CellClassName: string; + CellClass: TdxReportCellClass; + Cell: TdxReportCell; + begin + CellClassName := AReader.ReadString; + CellClass := TdxReportCellClass(GetClass(CellClassName)); + if CellClass = nil then + Assert(CellClass <> nil); + if CellClass <> nil then + begin + Cell := CellClass.Create(Self); + Cell.ReadData(AReader); + end; + end; + +begin + ClearCells; + AReader.ReadListBegin; + try + while not AReader.EndOfList do LoadCell; + finally + AReader.ReadListEnd; + end; +end; + +procedure TdxReportCell.ReadDataItems(AReader: TdxPSDataReader); + + procedure LoadDataItem; + var + DataItemClassName: string; + DataItemClass: TdxReportCellDataClass; + DataItem: TAbstractdxReportCellData; + begin + try + DataItemClassName := AReader.ReadString; + DataItemClass := TdxReportCellDataClass(GetClass(DataItemClassName)); + Assert(DataItemClass <> nil); + except + ShowMessage(DataItemClassName); + raise; + end; + if DataItemClass <> nil then + begin + DataItem := DataItemClass.Create(Self); + DataItem.ReadData(AReader); + end; + end; + +begin + ClearDataItems; + AReader.ReadListBegin; + try + while not AReader.EndOfList do + LoadDataItem; + finally + AReader.ReadListEnd; + end; +end; + +procedure TdxReportCell.ReadProperties(AReader: TdxPSDataReader); +begin +end; + +procedure TdxReportCell.WriteCells(AWriter: TdxPSDataWriter); +var + I: Integer; +begin + AWriter.WriteListBegin; + try + for I := 0 to CellCount - 1 do + with Cells[I] do + if Serializable then + begin + AWriter.WriteString(ClassName); + WriteData(AWriter); + end; + finally + AWriter.WriteListEnd; + end; +end; + +procedure TdxReportCell.WriteDataItems(AWriter: TdxPSDataWriter); +var + I: Integer; +begin + AWriter.WriteListBegin; + try + for I := 0 to DataItemCount - 1 do + with DataItems[I] do + if Serializable then + begin + AWriter.WriteString(ClassName); + WriteData(AWriter); + end; + finally + AWriter.WriteListEnd; + end; +end; + +procedure TdxReportCell.WriteProperties(AWriter: TdxPSDataWriter); +begin +end; + +function TdxReportCell.AddCell: TdxReportCell; +begin + Result := TdxReportCell.Create(Self); +end; + +function TdxReportCell.AddDataItem(AClass: TdxReportCellDataClass): TAbstractdxReportCellData; +begin + Result := AClass.Create(Self); +end; + +procedure TdxReportCell.DeleteCell(Index: Integer); +var + Cell: TdxReportCell; +begin + Cell := Cells[Index]; + Cell.Parent := nil; +end; + +procedure TdxReportCell.DeleteDataItem(Index: Integer); +var + DataItem: TAbstractdxReportCellData; +begin + DataItem := DataItems[Index]; + DataItem.Parent := nil; +end; + +function TdxReportCell.LastCell: TdxReportCell; +begin + if CellCount > 0 then + Result := TdxReportCell(FCellList.Last) + else + Result := nil; +end; + +function TdxReportCell.FirstCell: TdxReportCell; +begin + if CellCount > 0 then + Result := TdxReportCell(FCellList.First) + else + Result := nil; +end; + +function TdxReportCell.HasChildren: Boolean; +begin + Result := CellCount > 0; +end; + +procedure TdxReportCell.ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); +var + I: Integer; +begin + for I := 0 to DataItemCount - 1 do + DataItems[I].ConvertCoords(PixelsNumerator, PixelsDenominator); + for I := 0 to CellCount - 1 do + Cells[I].ConvertCoords(PixelsNumerator, PixelsDenominator); + inherited; +end; + +function TdxReportCell.GetBackgroundBitmapTileBounds(Col, Row: Integer): TRect; +begin + Result := inherited GetBackgroundBitmapTileBounds(Col, Row); + OffsetRect(Result, -Left, -Top); +end; + +function TdxReportCell.GetBackgroundBounds(DC: HDC): TRect; +var + R: TRect; +begin + R := BoundsRect; + OffsetRect(R, -R.Left, -R.Top); + Result := GetInnerBoundsRelativeTo(DC, R); +end; + +function TdxReportCell.GetBorderBounds(DC: HDC): TRect; +begin + Result := inherited GetBorderBounds(DC); + OffsetRect(Result, -Result.Left, -Result.Top); +end; + +{ TdxPSReportGroupLookAndFeelPainter } + +constructor TdxPSReportGroupLookAndFeelPainter.Create(ARenderer: TdxPSReportRenderer); +begin + inherited Create; + FRenderer := ARenderer; +end; + +procedure TdxPSReportGroupLookAndFeelPainter.Paint(DC: HDC); +begin +end; + +procedure TdxPSReportGroupLookAndFeelPainter.DrawBorders(DC: HDC); +begin +end; + +procedure TdxPSReportGroupLookAndFeelPainter.DrawCaptionText(DC: HDC); +var + R: TRect; +begin + R := LookAndFeel.GetCaptionTextBounds(Group); + if RectVisible(DC, R) then + Renderer.DrawText(DC, R, 1, 0, 0, Group.CaptionText, LookAndFeel.CaptionFont, + LookAndFeel.GetCaptionColor, Group.CaptionAlignment, taCenterY, not Group.CaptionTransparent, + False, False, False, False, True); +end; + +procedure TdxPSReportGroupLookAndFeelPainter.Initialize(ALookAndFeel: TdxPSReportGroupLookAndFeel; + AGroup: TdxReportGroup); +begin + FGroup := AGroup; + FLookAndFeel := ALookAndFeel; +end; + +function TdxPSReportGroupLookAndFeelPainter.Group: TdxReportGroup; +begin + Result := FGroup; +end; + +function TdxPSReportGroupLookAndFeelPainter.LookAndFeel: TdxPSReportGroupLookAndFeel; +begin + Result := FLookAndFeel; +end; + +{ TdxPSReportGroupLookAndFeel } + +constructor TdxPSReportGroupLookAndFeel.Create(AReportCells: TdxReportCells); +begin + inherited Create; + FReportCells := AReportCells; + FCaptionFontIndex := -1; + FCaptionHeight := 0; + FCaptionIndent := dxDefaultReportGroupCaptionIndent; + FColor := dxDefaultGroupColor; + FFontIndex := -1; +end; + +procedure TdxPSReportGroupLookAndFeel.Assign(Source: TPersistent); +begin + if Source is TdxPSReportGroupLookAndFeel then + with TdxPSReportGroupLookAndFeel(Source) do + begin + Self.CaptionFontIndex := CaptionFontIndex; + Self.FCaptionIndent := CaptionIndent; + Self.Color := Color; + Self.FontIndex := FontIndex; + end + else + inherited; +end; + +class function TdxPSReportGroupLookAndFeel.BorderClass: TdxPSCellBorderClass; +begin + Result := TdxPSCellEtchedBorder; +end; + +class function TdxPSReportGroupLookAndFeel.DefaultBorderSides: TdxCellSides; +begin + Result := csAll; +end; + +class function TdxPSReportGroupLookAndFeel.Name: string; +begin + Result := ''; +end; + +class procedure TdxPSReportGroupLookAndFeel.Register; +begin + if GetClass(ClassName) = nil then RegisterClass(Self); +end; + +class procedure TdxPSReportGroupLookAndFeel.Unregister; +begin +end; + +procedure TdxPSReportGroupLookAndFeel.Paint(DC: HDC; AGroup: TdxReportGroup); +begin + with GetPainter do + begin + Initialize(Self, AGroup); + Paint(DC); + end; +end; + +procedure TdxPSReportGroupLookAndFeel.Prepare(DC: HDC); +begin + FCaptionHeight := 2 * Renderer.CalcTextPatternHeight(DC, CaptionFont) div 2; +end; + +procedure TdxPSReportGroupLookAndFeel.ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); +begin + FCaptionHeight := MulDiv(FCaptionHeight, APixelsNumerator, APixelsDenominator); + FCaptionIndent := MulDiv(FCaptionIndent, APixelsNumerator, APixelsDenominator); +end; + +procedure TdxPSReportGroupLookAndFeel.ReadData(AReader: TdxPSDataReader); +begin + FCaptionHeight := AReader.ReadInteger; + CaptionFontIndex := AReader.ReadInteger; + FCaptionIndent := AReader.ReadInteger; + Color := AReader.ReadInteger; + Data := Pointer(AReader.ReadInteger); + FontIndex := AReader.ReadInteger; +end; + +procedure TdxPSReportGroupLookAndFeel.WriteData(AWriter: TdxPSDataWriter); +begin + AWriter.WriteInteger(CaptionHeight); + AWriter.WriteInteger(CaptionFontIndex); + AWriter.WriteInteger(CaptionIndent); + AWriter.WriteInteger(Color); + AWriter.WriteInteger(Integer(Data)); + AWriter.WriteInteger(FontIndex); +end; + +function TdxPSReportGroupLookAndFeel.GetBorderEdgeThickness(AGroup: TdxReportGroup; + ASide: TdxCellSide): Integer; +begin + if ASide = csTop then + begin + Result := BorderThickness; + if Renderer.IsRendering and (Renderer.LineThickness <> 0) then + Result := Result * Renderer.LineThickness; + if AGroup.ShowCaption then + Inc(Result, CaptionAreaHeight); + if Renderer.IsRendering and (Renderer.LineThickness <> 0) then + Result := Result div Renderer.LineThickness; + end + else + Result := AGroup.InternalGetBorderEdgeThickness(ASide); +end; + +function TdxPSReportGroupLookAndFeel.GetBorderThickness: Integer; +begin + Result := 0; +end; + +function TdxPSReportGroupLookAndFeel.GetColor: TColor; +begin + Result := FColor; + if Result = clDefault then Result := ReportCells.GroupColor; +end; + +procedure TdxPSReportGroupLookAndFeel.SetBorderThickness(Value: Integer); +begin +end; + +function TdxPSReportGroupLookAndFeel.GetCaptionAreaHeight: Integer; +begin + Result := CaptionHeight; +end; + +function TdxPSReportGroupLookAndFeel.GetCaptionBounds(AGroup: TdxReportGroup): TRect; +begin + Result := AGroup.BoundsRect; + Result.Bottom := Result.Top + CaptionHeight; +end; + +function TdxPSReportGroupLookAndFeel.GetCaptionColor: TColor; +begin + Result := Color; +end; + +function TdxPSReportGroupLookAndFeel.GetCaptionHeight: Integer; +begin + Result := FCaptionHeight; +end; + +function TdxPSReportGroupLookAndFeel.GetCaptionIndent: Integer; +begin + Result := FCaptionIndent; +end; + +function TdxPSReportGroupLookAndFeel.GetCaptionLeftRestSpaceBounds(AGroup: TdxReportGroup): TRect; +begin + if not AGroup.Transparent then + begin + Result := GetCaptionBounds(AGroup); + Result.Right := GetCaptionTextBounds(AGroup).Left; + end + else + Result := dxPSGlbl.NullRect; +end; + +function TdxPSReportGroupLookAndFeel.GetCaptionRightRestSpaceBounds(AGroup: TdxReportGroup): TRect; +begin + if not AGroup.Transparent then + begin + Result := GetCaptionBounds(AGroup); + Result.Left := GetCaptionTextBounds(AGroup).Right; + end + else + Result := dxPSGlbl.NullRect; +end; + +function TdxPSReportGroupLookAndFeel.GetCaptionTextBounds(AGroup: TdxReportGroup): TRect; +var + TextWidth: Integer; +begin + Result := NullRect; + if AGroup.ShowCaption then + begin + TextWidth := AGroup.CaptionTextWidth; + if TextWidth <> 0 then + begin + Result := AGroup.BoundsRect; + OffsetRect(Result, -Result.Left, -Result.Top); + InflateRect(Result, -CaptionIndent, 0); + + if not IsRectEmpty(Result) then + with Result do + begin + case AGroup.CaptionAlignment of + taLeft: + Right := Left + TextWidth; + taCenterX: + begin + Inc(Left, (Right - Left - TextWidth) div 2); + Right := Left + TextWidth; + end; + taRight: + Left := Right - TextWidth; + end; + Bottom := Top + CaptionHeight; + end; + end; + end; +end; + +function TdxPSReportGroupLookAndFeel.GetPainter: TdxPSReportGroupLookAndFeelPainter; +begin + Result := Renderer.GetReportGroupLookAndFeelPainter(GetPainterClass); +end; + +class function TdxPSReportGroupLookAndFeel.GetPainterClass: TdxPSReportGroupLookAndFeelPainterClass; +begin + Result := nil; // Actually method must be declared as "abstract" but "C++" syntax does not allow us to use "static virtual abstract" methods +end; + +function TdxPSReportGroupLookAndFeel.GetCaptionFont: TFont; +begin + if CaptionFontIndex <> -1 then + Result := ReportCells.GetFontByIndex(CaptionFontIndex) + else + Result := nil; +end; + +function TdxPSReportGroupLookAndFeel.GetFont: TFont; +begin + if FontIndex <> -1 then + Result := ReportCells.GetFontByIndex(FontIndex) + else + Result := nil; +end; + +function TdxPSReportGroupLookAndFeel.GetRenderer: TdxPSReportRenderer; +begin + Result := ReportCells.Renderer; +end; + +procedure TdxPSReportGroupLookAndFeel.SetCaptionFont(Value: TFont); +begin + CaptionFontIndex := ReportCells.GetIndexByFont(Value); +end; + +procedure TdxPSReportGroupLookAndFeel.SetCaptionFontIndex(Value: Integer); +begin + if Value < -1 then Value := -1; + FCaptionFontIndex := Value; +end; + +procedure TdxPSReportGroupLookAndFeel.SetFont(Value: TFont); +begin + FontIndex := ReportCells.GetIndexByFont(Value); +end; + +procedure TdxPSReportGroupLookAndFeel.SetFontIndex(Value: Integer); +begin + if Value < -1 then Value := -1; + FFontIndex := Value; +end; + +{ TdxPSReportGroupNullLookAndFeelPainter } + +procedure TdxPSReportGroupNullLookAndFeelPainter.Paint(DC: HDC); +begin +end; + +{ TdxPSReportGroupNullLookAndFeel } + +class function TdxPSReportGroupNullLookAndFeel.BorderClass: TdxPSCellBorderClass; +begin + Result := TdxPSCellUltraFlatBorder; +end; + +class function TdxPSReportGroupNullLookAndFeel.DefaultBorderSides: TdxCellSides; +begin + Result := []; +end; + +class function TdxPSReportGroupNullLookAndFeel.Name: string; +begin + Result := cxGetResourceString(@sdxReportGroupNullLookAndFeel); +end; + +function TdxPSReportGroupNullLookAndFeel.GetBorderThickness: Integer; +begin + Result := 1; +end; + +function TdxPSReportGroupNullLookAndFeel.GetCaptionHeight: Integer; +begin + Result := 0; +end; + +class function TdxPSReportGroupNullLookAndFeel.GetPainterClass: TdxPSReportGroupLookAndFeelPainterClass; +begin + Result := TdxPSReportGroupNullLookAndFeelPainter; +end; + +{ TdxPSReportGroupStandardLookAndFeelPainter } + +procedure TdxPSReportGroupStandardLookAndFeelPainter.Paint(DC: HDC); +var + Rgn: HRGN; +begin + DrawCaptionRestSpace(DC); + DrawCaptionText(DC); + if Group.IsBordersDrawn then + begin + Rgn := Renderer.ExcludeClipRect(LookAndFeel.GetCaptionTextBounds(Group)); + DrawBorders(DC); + Renderer.RestoreClipRgn(Rgn); + end; +end; + +procedure TdxPSReportGroupStandardLookAndFeelPainter.DrawBorders(DC: HDC); +begin + Group.InternalDrawBorders(DC); +end; + +procedure TdxPSReportGroupStandardLookAndFeelPainter.DrawCaptionRestSpace(DC: HDC); + + procedure DrawCaptionPart(const R: TRect); + begin + if RectVisible(DC, R) then + Renderer.FillRect(DC, R, LookAndFeel.Color); + end; + +begin + DrawCaptionPart(LookAndFeel.GetCaptionLeftRestSpaceBounds(Group)); + DrawCaptionPart(LookAndFeel.GetCaptionRightRestSpaceBounds(Group)); +end; + +function TdxPSReportGroupStandardLookAndFeelPainter.LookAndFeel: TdxPSReportGroupStandardLookAndFeel; +begin + Result := inherited LookAndFeel as TdxPSReportGroupStandardLookAndFeel; +end; + +{ TdxPSReportGroupStandardLookAndFeel } + +class function TdxPSReportGroupStandardLookAndFeel.BorderClass: TdxPSCellBorderClass; +begin + Result := TdxPSCellEtchedBorder; +end; + +class function TdxPSReportGroupStandardLookAndFeel.Name: string; +begin + Result := cxGetResourceString(@sdxReportGroupStandardLookAndFeel); +end; + +class function TdxPSReportGroupStandardLookAndFeel.GetPainterClass: TdxPSReportGroupLookAndFeelPainterClass; +begin + Result := TdxPSReportGroupStandardLookAndFeelPainter; +end; + +{ TdxPSReportGroupOfficeLookAndFeel } + +class function TdxPSReportGroupOfficeLookAndFeel.DefaultBorderSides: TdxCellSides; +begin + Result := [csTop]; +end; + +class function TdxPSReportGroupOfficeLookAndFeel.Name: string; +begin + Result := cxGetResourceString(@sdxReportGroupOfficeLookAndFeel); +end; + +function TdxPSReportGroupOfficeLookAndFeel.GetCaptionIndent: Integer; +begin + Result := 0; +end; + +{ TdxPSReportGroupWebLookAndFeelPainter } + +procedure TdxPSReportGroupWebLookAndFeelPainter.Paint(DC: HDC); +begin + DrawBorders(DC); + DrawCaptionText(DC); + DrawCaptionSeparator(DC); +end; + +procedure TdxPSReportGroupWebLookAndFeelPainter.DrawBorders(DC: HDC); +var + R: TRect; +begin + R := Group.BoundsRect; + OffsetRect(R, -R.Left, -R.Top); + Renderer.FrameRect(DC, R, LookAndFeel.BorderColor, Group.CellSides, LookAndFeel.BorderThickness); +end; + +procedure TdxPSReportGroupWebLookAndFeelPainter.DrawCaptionSeparator(DC: HDC); +var + R: TRect; +begin + R := LookAndFeel.GetCaptionSeparatorBounds(Group); + if RectVisible(DC, R) then + Renderer.FillRect(DC, R, LookAndFeel.CaptionSeparatorColor); +end; + +function TdxPSReportGroupWebLookAndFeelPainter.LookAndFeel: TdxPSReportGroupWebLookAndFeel; +begin + Result := inherited LookAndFeel as TdxPSReportGroupWebLookAndFeel; +end; + +{ TdxPSReportGroupWebLookAndFeel } + +constructor TdxPSReportGroupWebLookAndFeel.Create(AReportCells: TdxReportCells); +begin + inherited Create(AReportCells); + BorderColor := clDefault; + BorderThickness := 1; + CaptionColor := clDefault; + CaptionSeparatorColor := clDefault; + CaptionSeparatorThickness := 0; +end; + +procedure TdxPSReportGroupWebLookAndFeel.Assign(Source: TPersistent); +begin + if Source is TdxPSReportGroupWebLookAndFeel then + with TdxPSReportGroupWebLookAndFeel(Source) do + begin + Self.BorderColor := BorderColor; + Self.BorderThickness := BorderThickness; + Self.CaptionColor := CaptionColor; + Self.CaptionSeparatorColor := CaptionSeparatorColor; + Self.CaptionSeparatorThickness := CaptionSeparatorThickness; + end; + inherited; +end; + +class function TdxPSReportGroupWebLookAndFeel.BorderClass: TdxPSCellBorderClass; +begin + Result := TdxPSCellUltraFlatBorder; +end; + +class function TdxPSReportGroupWebLookAndFeel.Name: string; +begin + Result := cxGetResourceString(@sdxReportGroupWebLookAndFeel); +end; + +procedure TdxPSReportGroupWebLookAndFeel.ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); +begin + inherited; + CaptionSeparatorThickness := MulDiv(CaptionSeparatorThickness, APixelsNumerator, APixelsDenominator); +end; + +procedure TdxPSReportGroupWebLookAndFeel.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + BorderColor := AReader.ReadInteger; + BorderThickness := AReader.ReadInteger; + CaptionColor := AReader.ReadInteger; + CaptionSeparatorColor := AReader.ReadInteger; + CaptionSeparatorThickness := AReader.ReadInteger; +end; + +procedure TdxPSReportGroupWebLookAndFeel.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteInteger(BorderColor); + AWriter.WriteInteger(BorderThickness); + AWriter.WriteInteger(CaptionColor); + AWriter.WriteInteger(CaptionSeparatorColor); + AWriter.WriteInteger(CaptionSeparatorThickness); +end; + +function TdxPSReportGroupWebLookAndFeel.GetBorderEdgeThickness(AGroup: TdxReportGroup; + ASide: TdxCellSide): Integer; +begin + if ASide = csTop then + Result := inherited GetBorderEdgeThickness(AGroup, ASide) + else + Result := BorderThickness; +end; + +function TdxPSReportGroupWebLookAndFeel.GetBorderThickness: Integer; +begin + Result := FBorderThickness; +end; + +procedure TdxPSReportGroupWebLookAndFeel.SetBorderThickness(Value: Integer); +begin + if Value < 0 then Value := 0; + FBorderThickness := Value; +end; + +function TdxPSReportGroupWebLookAndFeel.GetCaptionAreaHeight: Integer; +begin + Result := inherited GetCaptionAreaHeight + CaptionSeparatorThickness; +end; + +function TdxPSReportGroupWebLookAndFeel.GetCaptionBounds(AGroup: TdxReportGroup): TRect; +begin + if AGroup.ShowCaption then + begin + Result := AGroup.BoundsRect; + OffsetRect(Result, -Result.Left, -Result.Top); + InflateRect(Result, -BorderThickness * Renderer.LineThickness, -BorderThickness * Renderer.LineThickness); + Result.Bottom := Result.Top + CaptionHeight; + end + else + Result := NullRect; +end; + +function TdxPSReportGroupWebLookAndFeel.GetCaptionLeftRestSpaceBounds(AGroup: TdxReportGroup): TRect; +begin + Result := NullRect; +end; + +function TdxPSReportGroupWebLookAndFeel.GetCaptionRightRestSpaceBounds(AGroup: TdxReportGroup): TRect; +begin + Result := NullRect; +end; + +function TdxPSReportGroupWebLookAndFeel.GetCaptionSeparatorBounds(AGroup: TdxReportGroup): TRect; +begin + Result := GetCaptionBounds(AGroup); + if AGroup.ShowCaption then + begin + Result.Top := Result.Bottom; + Result.Bottom := Result.Top + CaptionSeparatorThickness; + end; +end; + +function TdxPSReportGroupWebLookAndFeel.GetCaptionTextBounds(AGroup: TdxReportGroup): TRect; +begin + Result := GetCaptionBounds(AGroup); +end; + +class function TdxPSReportGroupWebLookAndFeel.GetPainterClass: TdxPSReportGroupLookAndFeelPainterClass; +begin + Result := TdxPSReportGroupWebLookAndFeelPainter; +end; + +function TdxPSReportGroupWebLookAndFeel.GetBorderColor: TColor; +begin + Result := FBorderColor; + if Result = clDefault then Result := ReportCells.GroupBorderColor; +end; + +function TdxPSReportGroupWebLookAndFeel.GetCaptionColor: TColor; +begin + Result := FCaptionColor; + if Result = clDefault then Result := ReportCells.GroupCaptionColor; +end; + +function TdxPSReportGroupWebLookAndFeel.GetCaptionSeparatorColor: TColor; +begin + Result := FCaptionSeparatorColor; + if Result = clDefault then Result := ReportCells.GroupCaptionSeparatorColor; +end; + +procedure TdxPSReportGroupWebLookAndFeel.SetCaptionSeparatorThickness(Value: Integer); +begin + if Value < 0 then Value := 0; + FCaptionSeparatorThickness := Value; +end; + +{ TdxReportGroup } + +constructor TdxReportGroup.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + CaptionAlignment := taLeft; + ClipChildren := True; + ShowCaption := True; +end; + +procedure TdxReportGroup.Assign(Source: TPersistent); +begin + if Source is TdxReportGroup then + begin + inherited; + with TdxReportGroup(Source) do + begin + Self.CaptionText := CaptionText; + Self.LookAndFeel := LookAndFeel; + end; + end + else + inherited; +end; + +procedure TdxReportGroup.DrawBorders(DC: HDC); +begin + if LookAndFeel <> nil then + LookAndFeel.Paint(DC, Self) + else + inherited DrawBorders(DC); +end; + +procedure TdxReportGroup.CalculateCaptionTextWidth(DC: HDC); +var + F: TFont; +begin + FCaptionTextWidth := 0; + if CaptionText <> '' then + begin + if LookAndFeel <> nil then + F := LookAndFeel.CaptionFont + else + F := Font; + + FCaptionTextWidth := Renderer.CalcTextWidth(DC, CaptionText, F); + if FCaptionTextWidth > 0 then + Inc(FCaptionTextWidth, 2 + 2); + end; +end; + +function TdxReportGroup.GetBorderOuterBounds(DC: HDC): TRect; +begin + Result := inherited GetBorderOuterBounds(DC); + if ShowCaption and (LookAndFeel <> nil) then + Inc(Result.Top, LookAndFeel.CaptionHeight div 2); +end; + +procedure TdxReportGroup.ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); +begin + inherited; + FCaptionTextWidth := MulDiv(FCaptionTextWidth, APixelsNumerator, APixelsDenominator); +end; + +procedure TdxReportGroup.InternalDrawBorders(DC: HDC); +begin + inherited DrawBorders(DC); +end; + +function TdxReportGroup.GetBorderClass: TdxPSCellBorderClass; +begin + if UseOwnBorderClass or (LookAndFeel = nil) then + Result := inherited GetBorderClass + else + Result := LookAndFeel.BorderClass; +end; + +function TdxReportGroup.GetBorderEdgeSalient(ASide: TdxCellSide; ASalient: TdxPSCellBorderSalientType): Integer; +begin + if LookAndFeel <> nil then + if ASalient = bstOuter then + Result := 0 + else + Result := GetBorderEdgeThickness(ASide) + else + Result := inherited GetBorderEdgeSalient(ASide, ASalient); +end; + +function TdxReportGroup.GetBorderEdgeThickness(ASide: TdxCellSide): Integer; +begin + if LookAndFeel <> nil then + Result := LookAndFeel.GetBorderEdgeThickness(Self, ASide) + else + Result := inherited GetBorderEdgeThickness(ASide); +end; + +function TdxReportGroup.InternalGetBorderEdgeThickness(ASide: TdxCellSide): Integer; +begin + Result := inherited GetBorderEdgeThickness(ASide); +end; + +function TdxReportGroup.IsBordersDrawn: Boolean; +begin + Result := inherited IsBordersDrawn or (CaptionText <> ''); +end; + +procedure TdxReportGroup.ReadData(AReader: TdxPSDataReader); +var + Index: Integer; +begin + inherited ReadData(AReader); + CaptionText := AReader.ReadString; + FCaptionTextWidth := AReader.ReadInteger; + + Index := AReader.ReadInteger; + if Index <> -1 then + LookAndFeel := ReportCells.LookAndFeels[Index]; +end; + +procedure TdxReportGroup.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteString(CaptionText); + AWriter.WriteInteger(CaptionTextWidth); + AWriter.WriteInteger(LookAndFeelIndex); +end; + +function TdxReportGroup.GetCaptionAlignment: TdxTextAlignX; +begin + Result := TdxTextAlignX((Format and dxPSGlbl.dxFormatTextAlignXMask) shr dxPSGlbl.dxFormatTextAlignXOffset); +end; + +function TdxReportGroup.GetCaptionTextWidth: Integer; +begin + Result := FCaptionTextWidth; +end; + +function TdxReportGroup.GetCaptionTransparent: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatGroupCaptionTransparent); +end; + +function TdxReportGroup.GetLookAndFeel: TdxPSReportGroupLookAndFeel; +begin + Result := FLookAndFeel; + if Result = nil then + if Parent is TdxReportGroup then + Result := TdxReportGroup(Parent).LookAndFeel + else + Result := ReportCells.LookAndFeel; +end; + +function TdxReportGroup.GetLookAndFeelIndex: Integer; +begin + if FLookAndFeel <> nil then + Result := ReportCells.IndexOfReportGroupLookAndFeel(LookAndFeel) + else + Result := -1; +end; + +function TdxReportGroup.GetShowCaption: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatGroupShowCaption); +end; + +function TdxReportGroup.GetUseOwnBorderClass: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatOwnBorderClass); +end; + +procedure TdxReportGroup.SetCaptionAlignment(Value: TdxTextAlignX); +begin + Format := Format and not dxPSGlbl.dxFormatTextAlignXMask or (Byte(Value) shl dxPSGlbl.dxFormatTextAlignXOffset); +end; + +procedure TdxReportGroup.SetCaptionTransparent(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatGroupCaptionTransparent, Value); +end; + +procedure TdxReportGroup.SetLookAndFeel(Value: TdxPSReportGroupLookAndFeel); +begin + FLookAndFeel := Value; +end; + +procedure TdxReportGroup.SetShowCaption(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatGroupShowCaption, Value); +end; + +procedure TdxReportGroup.SetUseOwnBorderClass(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatOwnBorderClass, Value); +end; + +{ TdxReportCells } + +constructor TdxReportCells.Create(AReportLink: TBasedxReportLink); +begin + inherited Create; + FReportLink := AReportLink; + + BorderColor := dxDefaultGridLineColor; + BorderWidth := 1; + ExpandButtonBorderColor := dxDefaultExpandButtonBorderColor; + GroupBorderColor := dxDefaultGroupBorderColor; + GroupCaptionColor := dxDefaultGroupCaptionColor; + GroupCaptionSeparatorColor := dxDefaultGroupCaptionSeparatorColor; + GroupColor := dxDefaultGroupColor; + ShadowColor := dxDefaultShadowColor; + ShadowDepth := dxDefaultShadowDepth; + TreeLineColor := dxDefaultTreeLineColor; + TreeLineStyle := tlsDot; + + FLookAndFeels := TList.Create; + FLookAndFeel := CreateGroupLookAndFeel(dxDefaultReportGroupLookAndFeel); + CreateGroupLookAndFeel(TdxPSReportGroupNullLookAndFeel); + + FImageLists := TList.Create; + + FCells := TdxReportCell.Create(nil); + FCells.FReportCells := Self; + FCells.Color := dxDefaultContentColor; +end; + +destructor TdxReportCells.Destroy; +begin + FreeAndNil(FCells); + FreeAndNilReportGroupLookAndFeels; + FreeAndNil(FFooterCells); + FreeAndNil(FHeaderCells); + FreeAndNilOverlays; + FreeAndNilImageLists; + inherited; +end; + +procedure TdxReportCells.Assign(Source: TPersistent); +begin + if Source is TdxReportCells then + with TdxReportCells(Source) do + begin + Self.BorderColor := BorderColor; + Self.BorderWidth := BorderWidth; + Self.ExpandButtonBorderColor := ExpandButtonBorderColor; + Self.GroupBorderColor := GroupBorderColor; + Self.GroupCaptionColor := GroupCaptionColor; + Self.GroupCaptionSeparatorColor := GroupCaptionSeparatorColor; + Self.GroupColor := GroupColor; + Self.ShadowColor := ShadowColor; + Self.ShadowDepth := ShadowDepth; + Self.TreeLineColor := TreeLineColor; + Self.TreeLineStyle := TreeLineStyle; + + Self.Cells.Assign(Cells); + if AreHeaderCellsAllocated then Self.HeaderCells.Assign(HeaderCells); + if AreFooterCellsAllocated then Self.FooterCells.Assign(FooterCells); + if HasOverlays then Self.AssignOverlays(TdxReportCells(Source)); + end + else + inherited; +end; + +procedure TdxReportCells.ClearItems; +begin + FCells.ClearCells; + FCells.ClearDataItems; +end; + +procedure TdxReportCells.ClearLookAndFeels; +var + I: Integer; +begin + for I := 0 to LookAndFeelCount - 1 do + LookAndFeels[I].Free; + FLookAndFeels.Clear; +end; + +function TdxReportCells.CreateGroupLookAndFeel(AClass: TdxPSReportGroupLookAndFeelClass; + ACheckExisting: Boolean = True): TdxPSReportGroupLookAndFeel; +begin + if ACheckExisting then + Result := FindGroupLookAndFeelByClass(AClass) + else + Result := nil; + + if Result = nil then + begin + Result := AClass.Create(Self); + FLookAndFeels.Add(Result); + end; +end; + +function TdxReportCells.FindGroupLookAndFeelByClass(AClass: TdxPSReportGroupLookAndFeelClass): TdxPSReportGroupLookAndFeel; +var + I: Integer; +begin + for I := 0 to LookAndFeelCount - 1 do + begin + Result := LookAndFeels[I]; + if Result.ClassType = AClass then Exit; + end; + Result := nil; +end; + +function TdxReportCells.FindGroupLookAndFeelByData(AData: Pointer): TdxPSReportGroupLookAndFeel; +var + I: Integer; +begin + for I := 0 to LookAndFeelCount - 1 do + begin + Result := LookAndFeels[I]; + if Result.Data = AData then Exit; + end; + Result := nil; +end; + +function TdxReportCells.IndexOfReportGroupLookAndFeel(ALookAndFeel: TdxPSReportGroupLookAndFeel): Integer; +begin + Result := FLookAndFeels.IndexOf(ALookAndFeel); +end; + +procedure TdxReportCells.DoProgress(const APercentDone: Double); +begin + if ReportLink <> nil then ReportLink.DoProgress(APercentDone); +end; + +function TdxReportCells.AddOverlay: TdxReportCell; +begin + Result := TdxReportCell.Create(nil); + Result.FReportCells := Self; + if FOverlays = nil then FOverlays := TList.Create; + FOverlays.Add(Result); +end; + +procedure TdxReportCells.AppendOverlays(Source: TdxReportCells; + AnOffsetX: Integer = 0; AnOffsetY: Integer = 0); + + procedure OffsetOverlayCells(AnOverlay: TdxReportCell; AnOffsetX, AnOffsetY: Integer); + var + I: Integer; + begin + if (AnOffsetX <> 0) or (AnOffsetY <> 0) then + for I := 0 to AnOverlay.CellCount - 1 do + with AnOverlay.Cells[I] do + begin + Left := Left + AnOffsetX; + Top := Top + AnOffsetY; + end; + end; + + procedure OffsetOverlayDataItems(AnOverlay: TdxReportCell; AnOffsetX, AnOffsetY: Integer); + var + I: Integer; + begin + if (AnOffsetX <> 0) or (AnOffsetY <> 0) then + for I := 0 to AnOverlay.DataItemCount - 1 do + with AnOverlay.DataItems[I] do + begin + Left := Left + AnOffsetX; + Top := Top + AnOffsetY; + end; + end; + +var + I: Integer; + Overlay: TdxReportCell; +begin + for I := 0 to Source.OverlayCount - 1 do + begin + Overlay := AddOverlay; + Overlay.Assign(Source.Overlays[I]); + OffsetOverlayCells(Overlay, AnOffsetX, AnOffsetY); + OffsetOverlayDataItems(Overlay, AnOffsetX, AnOffsetY); + end; +end; + +procedure TdxReportCells.AssignOverlays(Source: TdxReportCells; + AnOffsetX: Integer = 0; AnOffsetY: Integer = 0); +begin + ClearOverlays; + AppendOverlays(Source, AnOffsetX, AnOffsetY); +end; + +procedure TdxReportCells.ClearOverlays; +var + I: Integer; +begin + for I := 0 to OverlayCount - 1 do + Overlays[I].Free; + if FOverlays <> nil then + FOverlays.Clear; +end; + +procedure TdxReportCells.DeleteOverlay(AnOverlay: TdxReportCell); +var + Index: Integer; +begin + Index := IndexOfOverlay(AnOverlay); + if Index <> -1 then + begin + Overlays[Index].Free; + if OverlayCount = 0 then FreeAndNil(FOverlays); + end; +end; + +procedure TdxReportCells.FreeAndNilOverlays; +begin + ClearOverlays; + FreeAndNil(FOverlays); +end; + +function TdxReportCells.HasOverlays: Boolean; +begin + Result := FOverlays <> nil; +end; + +function TdxReportCells.IndexOfOverlay(AnOverlay: TdxReportCell): Integer; +begin + if HasOverlays then + Result := FOverlays.IndexOf(AnOverlay) + else + Result := -1; +end; + +function TdxReportCells.GetFontByIndex(AnIndex: Integer): TFont; +begin + Result := ReportLink.FontPool[AnIndex]; +end; + +function TdxReportCells.GetIndexByFont(AFont: TFont): Integer; +begin + Result := ReportLink.FontPool.Add(AFont); +end; + +procedure TdxReportCells.ReadData(AReader: TdxPSDataReader); +begin + BeforeReadData(AReader); + try + ClearItems; + try + ReadLookAndFeels(AReader); + ReadCells(AReader); + ReadFooterCells(AReader); + ReadHeaderCells(AReader); + ReadOverlayCells(AReader); + ReadProperties(AReader); + except + ClearItems; + raise; + end; + finally + AfterReadData(AReader); + end; +end; + +procedure TdxReportCells.WriteData(AWriter: TdxPSDataWriter); +begin + BeforeWriteData(AWriter); + try + WriteLookAndFeels(AWriter); + WriteCells(AWriter); + WriteFooterCells(AWriter); + WriteHeaderCells(AWriter); + WriteOverlayCells(AWriter); + WriteProperties(AWriter); + finally + AfterWriteData(AWriter); + end; +end; + +procedure TdxReportCells.AfterReadData(AReader: TdxPSDataReader); +begin +end; + +procedure TdxReportCells.AfterWriteData(AWriter: TdxPSDataWriter); +begin + ClearImageLists; +end; + +procedure TdxReportCells.BeforeReadData(AReader: TdxPSDataReader); +begin + ClearImageLists; + OwnImageLists := True; + ReadImageLists(AReader); +end; + +procedure TdxReportCells.BeforeWriteData(AWriter: TdxPSDataWriter); +begin + ClearImageLists; + OwnImageLists := False; + GetImageLists; + WriteImageLists(AWriter); +end; + +procedure TdxReportCells.ReadCells(AReader: TdxPSDataReader); +begin + Cells.ReadData(AReader); +end; + +procedure TdxReportCells.ReadFooterCells(AReader: TdxPSDataReader); +begin + if AReader.ReadBoolean then FooterCells.ReadData(AReader); +end; + +procedure TdxReportCells.ReadHeaderCells(AReader: TdxPSDataReader); +begin + if AReader.ReadBoolean then HeaderCells.ReadData(AReader); +end; + +procedure TdxReportCells.ReadImageLists(AReader: TdxPSDataReader); +var + ImageList: TImageList; +begin + AReader.ReadListBegin; + try + while not AReader.EndOfList do + begin + ImageList := TImageList.Create(nil); + AReader.ReadImageList(ImageList); + FImageLists.Add(Imagelist); + end; + finally + AReader.ReadListEnd; + end; +end; + +procedure TdxReportCells.ReadLookAndFeels(AReader: TdxPSDataReader); +var + LookAndFeelClass: TdxPSReportGroupLookAndFeelClass; + Index: Integer; +begin + ClearLookAndFeels; + + AReader.ReadListBegin; + try + while not AReader.EndOfList do + begin + LookAndFeelClass := AReader.ReadLookAndFeelClass; + CreateGroupLookAndFeel(LookAndFeelClass, False).ReadData(AReader); + end; + finally + AReader.ReadListEnd; + end; + Index := AReader.ReadInteger; + if Index <> -1 then + LookAndFeel := LookAndFeels[Index] + else + LookAndFeel := nil; + + {if LookAndFeelCount = 0 then + begin + FLookAndFeel := CreateGroupLookAndFeel(dxDefaultReportGroupLookAndFeel); + CreateGroupLookAndFeel(TdxPSReportGroupNullLookAndFeel); + end + else + FLookAndFeel := LookAndFeels[0];} +end; + +procedure TdxReportCells.ReadOverlayCells(AReader: TdxPSDataReader); +begin + ClearOverlays; + AReader.ReadListBegin; + try + while not AReader.EndOfList do + AddOverlay.ReadData(AReader); + finally + AReader.ReadListEnd; + end; +end; + +procedure TdxReportCells.ReadProperties(AReader: TdxPSDataReader); +begin + with AReader do + begin + BorderColor := ReadInteger; + BorderWidth := ReadInteger; + ExpandButtonBorderColor := ReadInteger; + GroupBorderColor := ReadInteger; + GroupCaptionColor := ReadInteger; + GroupCaptionSeparatorColor := ReadInteger; + GroupColor := ReadInteger; + ShadowColor := ReadInteger; + ShadowDepth := ReadInteger; + TreeLineColor := ReadInteger; + TreeLineStyle := TdxPSTreeLineStyle(ReadInteger); + end; +end; + +procedure TdxReportCells.WriteCells(AWriter: TdxPSDataWriter); +begin + Cells.WriteData(AWriter); +end; + +procedure TdxReportCells.WriteFooterCells(AWriter: TdxPSDataWriter); +begin + AWriter.WriteBoolean(AreFooterCellsAllocated); + if AreFooterCellsAllocated then FooterCells.WriteData(AWriter); +end; + +procedure TdxReportCells.WriteHeaderCells(AWriter: TdxPSDataWriter); +begin + AWriter.WriteBoolean(AreHeaderCellsAllocated); + if AreHeaderCellsAllocated then HeaderCells.WriteData(AWriter); +end; + +procedure TdxReportCells.WriteImageLists(AWriter: TdxPSDataWriter); +var + I: Integer; +begin + AWriter.WriteListBegin; + try + for I := 0 to FImageLists.Count - 1 do + AWriter.WriteImageList(TCustomImageList(FImageLists[I])); + finally + AWriter.WriteListEnd; + end; +end; + +procedure TdxReportCells.WriteLookAndFeels(AWriter: TdxPSDataWriter); +var + I: Integer; + LookAndFeel: TdxPSReportGroupLookAndFeel; +begin + AWriter.WriteListBegin; + try + for I := 0 to LookAndFeelCount - 1 do + begin + LookAndFeel := LookAndFeels[I]; + AWriter.WriteClassName(LookAndFeel); + LookAndFeel.WriteData(AWriter); + end; + finally + AWriter.WriteListEnd; + end; + + AWriter.WriteInteger(IndexOfReportGroupLookAndFeel(Self.LookAndFeel)); +end; + +procedure TdxReportCells.WriteOverlayCells(AWriter: TdxPSDataWriter); +var + I: Integer; +begin + AWriter.WriteListBegin; + try + for I := 0 to OverlayCount - 1 do + Overlays[I].WriteData(AWriter); + finally + AWriter.WriteListEnd; + end; +end; + +procedure TdxReportCells.WriteProperties(AWriter: TdxPSDataWriter); +begin + with AWriter do + begin + WriteInteger(BorderColor); + WriteInteger(BorderWidth); + WriteInteger(ExpandButtonBorderColor); + WriteInteger(GroupBorderColor); + WriteInteger(GroupCaptionColor); + WriteInteger(GroupCaptionSeparatorColor); + WriteInteger(GroupColor); + WriteInteger(ShadowColor); + WriteInteger(ShadowDepth); + WriteInteger(TreeLineColor); + WriteInteger(Integer(TreeLineStyle)); + end; +end; + +function TdxReportCells.CalculateOverlaysHeight: Integer; +var + I, V: Integer; +begin + Result := 0; + for I := 0 to OverlayCount - 1 do + begin + V := Overlays[I].GetAbsoluteRect.Bottom; + if Result < V then Result := V; + end; +end; + +function TdxReportCells.CalculateOverlaysWidth: Integer; +var + I, V: Integer; +begin + Result := 0; + for I := 0 to OverlayCount - 1 do + begin + V := Overlays[I].GetAbsoluteRect.Right; + if Result < V then Result := V; + end; +end; + +function TdxReportCells.CalculateTotalHeight: Integer; +var + V: Integer; +begin + Result := Cells.Height; + V := CalculateOverlaysHeight; + if Result < V then Result := V; +end; + +function TdxReportCells.CalculateTotalWidth: Integer; +var + V: Integer; +begin + Result := Cells.Width; + V := CalculateOverlaysWidth; + if Result < V then Result := V; +end; + +procedure TdxReportCells.ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); +var + I: Integer; +begin + Cells.ConvertCoords(APixelsNumerator, APixelsDenominator); + ShadowDepth := MulDiv(ShadowDepth, APixelsNumerator, APixelsDenominator); + + for I := 0 to LookAndFeelCount - 1 do + LookAndFeels[I].ConvertCoords(APixelsNumerator, APixelsDenominator); + + if AreFooterCellsAllocated then + FFooterCells.ConvertCoords(APixelsNumerator, APixelsDenominator); + if AreHeaderCellsAllocated then + HeaderCells.ConvertCoords(APixelsNumerator, APixelsDenominator); + + if HasOverlays then + for I := 0 to OverlayCount - 1 do + Overlays[I].ConvertCoords(APixelsNumerator, APixelsDenominator); +end; + +function TdxReportCells.GetCellTopLevelParent(AnItem: TdxReportItem): TdxReportCell; + + function IsParentInTopLevels(AnItem: TdxReportItem): Boolean; + var + I: Integer; + begin + Result := (AnItem = Cells) or + (AreHeaderCellsAllocated and (AnItem = HeaderCells)) or + (AreFooterCellsAllocated and (AnItem = FooterCells)); + + if not Result then + for I := 0 to OverlayCount - 1 do + begin + Result := AnItem = Overlays[I]; + if Result then Exit; + end; + end; + +begin + Result := AnItem.Parent; + if Result <> nil then + while (Result.Parent <> nil) and not IsParentInTopLevels(Result.Parent) do + Result := Result.Parent; +end; +procedure TdxReportCells.FreeAndNilReportGroupLookAndFeels; +begin + ClearLookAndFeels; + FreeAndNil(FLookAndFeels); +end; + +procedure TdxReportCells.PrepareReportGroupsLookAndFeels(DC: HDC); +var + I: Integer; +begin + for I := 0 to LookAndFeelCount - 1 do + LookAndFeels[I].Prepare(DC); +end; + +procedure TdxReportCells.AddImageList(AnImageList: TCustomImageList); +begin + if (AnImageList <> nil) and (FImageLists.IndexOf(AnImageList) = -1) then + FImageLists.Add(AnImageList); +end; + +procedure TdxReportCells.ClearImageLists; +var + I: Integer; +begin + if OwnImageLists then + for I := 0 to ImageListCount - 1 do + ImageLists[I].Free; + FImageLists.Clear; +end; + +procedure TdxReportCells.FreeAndNilImageLists; +begin + ClearImageLists; + FreeAndNil(FImageLists); +end; + +procedure TdxReportCells.GetImageLists; +begin + ReportLink.GetImageLists(AddImageList); +end; + +function TdxReportCells.IndexOfImageList(AnImageList: TCustomImageList): Integer; +begin + Result := FImageLists.IndexOf(AnImageList); +end; + +function TdxReportCells.GetAreFooterCellsAllocated: Boolean; +begin + Result := FFooterCells <> nil; +end; + +function TdxReportCells.GetAreHeaderCellsAllocated: Boolean; +begin + Result := FHeaderCells <> nil; +end; + +function TdxReportCells.GetBoundsRect: TRect; +begin + Result := Cells.BoundsRect; +end; + +function TdxReportCells.GetCount: Integer; +begin + Result := Cells.CellCount; +end; + +function TdxReportCells.GetFooterCells: TdxReportCell; +begin + if not AreFooterCellsAllocated then CreateFooterCells; + Result := FFooterCells; +end; + +function TdxReportCells.GetHeaderCells: TdxReportCell; +begin + if not AreHeaderCellsAllocated then CreateHeaderCells; + Result := FHeaderCells; +end; + +function TdxReportCells.GetImageList(Index: Integer): TCustomImageList; +begin + if Index = -1 then + Result := nil + else + Result := TCustomImageList(FImageLists[Index]); +end; + +function TdxReportCells.GetImageListCount: Integer; +begin + if FImageLists <> nil then + Result := FImageLists.Count + else + Result := 0; +end; + +function TdxReportCells.GetLookAndFeel(Index: Integer): TdxPSReportGroupLookAndFeel; +begin + Result := TdxPSReportGroupLookAndFeel(FLookAndFeels[Index]); +end; + +function TdxReportCells.GetLookAndFeelCount: Integer; +begin + Result := FLookAndFeels.Count; +end; + +function TdxReportCells.GetOverlay(Index: Integer): TdxReportCell; +begin + if HasOverlays then + Result := TdxReportCell(FOverlays[Index]) + else + Result := nil; +end; + +function TdxReportCells.GetOverlayCount: Integer; +begin + if HasOverlays then + Result := FOverlays.Count + else + Result := 0; +end; + +function TdxReportCells.GetRenderer: TdxPSReportRenderer; +begin + Result := ReportLink.Renderer; +end; + +procedure TdxReportCells.SetBorderColor(Value: TColor); +begin + if Value = clDefault then + FBorderColor := dxDefaultGridLineColor + else + FBorderColor := ColorToRGB(Value); +end; + +procedure TdxReportCells.SetShadowColor(Value: TColor); +begin + if Value = clDefault then + FShadowColor := dxDefaultShadowColor + else + FShadowColor := ColorToRGB(Value); +end; + +procedure TdxReportCells.SetShadowDepth(Value: Integer); +begin + if Value < 0 then Value := 0; + FShadowDepth := Value; +end; + +procedure TdxReportCells.SetTreeLineColor(Value: TColor); +begin + if Value = clDefault then + FTreeLineColor := dxDefaultTreeLineColor + else + FTreeLineColor := ColorToRGB(Value); +end; + +procedure TdxReportCells.CreateFooterCells; +begin + FFooterCells := TdxReportCell.Create(nil); + FFooterCells.FReportCells := Self; + FFooterCells.Color := dxDefaultFixedColor; +end; + +procedure TdxReportCells.CreateHeaderCells; +begin + FHeaderCells := TdxReportCell.Create(nil); + FHeaderCells.FReportCells := Self; + FHeaderCells.Color := dxDefaultFixedColor; +end; + +function TdxReportCells.GetFont: TFont; +begin + Result := Cells.Font; +end; + +function TdxReportCells.GetFooterBoundsRect: TRect; +begin + if AreFooterCellsAllocated then + Result := FFooterCells.BoundsRect + else + Result := NullRect; +end; + +function TdxReportCells.GetHeaderBoundsRect: TRect; +begin + if AreHeaderCellsAllocated then + Result := FHeaderCells.BoundsRect + else + Result := NullRect; +end; + +function TdxReportCells.GetFooterCellCount: Integer; +begin + if AreFooterCellsAllocated then + Result := FFooterCells.CellCount + else + Result := 0; +end; + +function TdxReportCells.GetHeaderCellCount: Integer; +begin + if AreHeaderCellsAllocated then + Result := FHeaderCells.CellCount + else + Result := 0; +end; + +{ TAbstractdxReportCellData } + +constructor TAbstractdxReportCellData.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + BreakByChars := dxDefaultBreakByChars; // True + EndEllipsis := dxDefaultEndEllipsis; // False + HidePrefix := dxDefaultHidePrefix; // False + Multiline := dxDefaultMultiline; // False + PreventLeftTextExceed := dxDefaultPreventLeftTextExceed; // True + PreventTopTextExceed := dxDefaultPreventTopTextExceed; // True + SortOrder := dxDefaultSortOrder; // csoNone + TextAlignX := dxDefaultTextAlignX; // taLeft + TextAlignY := dxDefaultTextAlignY; // taCenterY +end; + +procedure TAbstractdxReportCellData.DrawContent(DC: HDC; AStage: TdxPSRenderStages); +begin + if IsBackgroundBitmapDrawn then + DrawBackgroundBitmap(DC) + else + if IsBackgroundDrawn then + DrawBackground(DC); + + if IsBordersDrawn then DrawBorders(DC); +end; + +function TAbstractdxReportCellData.GetCustomDrawID: Integer; +begin + Result := Data; +end; + +function TAbstractdxReportCellData.MeasureContentHeight(DC: HDC): Integer; +begin + Result := Height; +end; + +function TAbstractdxReportCellData.MeasureContentWidth(DC: HDC): Integer; +begin + Result := Width; +end; + +function TAbstractdxReportCellData.CustomDraw(DC: HDC): Boolean; +begin + Result := IsCustomDrawn and Renderer.CustomDrawReportItem(Self); +end; + +function TAbstractdxReportCellData.GetAbsoluteEffectiveBounds(DC: HDC; AStage: TdxPSRenderStages): TRect; +begin + Result := GetEffectiveBounds(DC, AStage); + if Parent <> nil then + with Parent.AbsoluteOrigin do + OffsetRect(Result, X, Y); +end; + +function TAbstractdxReportCellData.GetDefaultDTFormat: DWORD; +begin + Result := DXTO_AUTOINDENTS or DXTO_EXPANDTABS or DXTO_PATTERNEDTEXT or DXTO_CHARBREAK or DXTO_EDITCONTROL; +end; + +function TAbstractdxReportCellData.GetEffectiveBounds(DC: HDC; AStage: TdxPSRenderStages): TRect; +begin + Result := GetOuterBounds(DC); +end; + +function TAbstractdxReportCellData.GetDTFormat: DWORD; +const + dxEndEllipsis: array[Boolean] of UINT = (0, DXTO_END_ELLIPSIS); + dxHidePrefix: array[Boolean] of UINT = (0, DXTO_HIDEPREFIX); + dxPreventLeftExceed: array[Boolean] of UINT = (0, DXTO_PREVENT_LEFT_EXCEED); + dxPreventTopExceed: array[Boolean] of UINT = (0, DXTO_PREVENT_TOP_EXCEED); + dxWordBreak: array[Boolean] of UINT = (DXTO_SINGLELINE, DXTO_WORDBREAK); +begin + Result := DefaultDTFormat or + dxMakeFormat(TextAlignX, TextAlignY) or + dxEndEllipsis[EndEllipsis] or + dxHidePrefix[HidePrefix] or + dxPreventLeftExceed[PreventLeftTextExceed] or + dxPreventTopExceed[PreventTopTextExceed] or + dxWordBreak[Multiline]; +end; + +function TAbstractdxReportCellData.IsCustomDrawn: Boolean; +begin + with GetReportCells do + Result := (ReportLink <> nil) and ReportLink.PossibleCustomDraw(Self); +end; + +function TAbstractdxReportCellData.IsDrawingNeeded(DC: HDC; AStage: TdxPSRenderStages; + const ARect: TRect): Boolean; +begin + Result := Visible and RectVisible(DC, GetEffectiveBounds(DC, AStage)) and IsDrawn(DC, AStage, ARect); +end; + +function TAbstractdxReportCellData.IsDrawn(DC: HDC; AStage: TdxPSRenderStages; + const ARect: TRect): Boolean; +var + R: TRect; +begin + Result := IntersectRect(R, GetAbsoluteEffectiveBounds(DC, AStage), ARect); +end; + +function TAbstractdxReportCellData.GetSortOrder: TdxCellSortOrder; +begin + Result := TdxCellSortOrder((Format and dxPSGlbl.dxFormatSortOrderMask) shr dxPSGlbl.dxFormatSortOrderOffset); +end; + +function TAbstractdxReportCellData.GetBreakByChars: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatBreakByChars); +end; + +function TAbstractdxReportCellData.GetEndEllipsis: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatEndEllipsis); +end; + +function TAbstractdxReportCellData.GetHidePrefix: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatHidePrefix); +end; + +function TAbstractdxReportCellData.GetMultiline: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatMultiline); +end; + +function TAbstractdxReportCellData.GetPreventLeftTextExceed: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatPreventLeftTextExceed); +end; + +function TAbstractdxReportCellData.GetPreventTopTextExceed: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatPreventTopTextExceed); +end; + +function TAbstractdxReportCellData.GetTextAlignX: TdxTextAlignX; +begin + Result := TdxTextAlignX((Format and dxPSGlbl.dxFormatTextAlignXMask) shr dxPSGlbl.dxFormatTextAlignXOffset); +end; + +function TAbstractdxReportCellData.GetTextAlignY: TdxTextAlignY; +begin + Result := TdxTextAlignY((Format and dxPSGlbl.dxFormatTextAlignYMask) shr dxPSGlbl.dxFormatTextAlignYOffset); +end; + +procedure TAbstractdxReportCellData.SetBreakByChars(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatBreakByChars, Value); +end; + +procedure TAbstractdxReportCellData.SetEndEllipsis(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatEndEllipsis, Value); +end; + +procedure TAbstractdxReportCellData.SetHidePrefix(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatHidePrefix, Value); +end; + +procedure TAbstractdxReportCellData.SetMultiline(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatMultiline, Value); +end; + +procedure TAbstractdxReportCellData.SetPreventLeftTextExceed(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatPreventLeftTextExceed, Value); +end; + +procedure TAbstractdxReportCellData.SetPreventTopTextExceed(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatPreventTopTextExceed, Value); +end; + +procedure TAbstractdxReportCellData.SetSortOrder(Value: TdxCellSortOrder); +begin + Format := Format and not dxPSGlbl.dxFormatSortOrderMask or (Byte(Value) shl dxPSGlbl.dxFormatSortOrderOffset); +end; + +procedure TAbstractdxReportCellData.SetTextAlignX(Value: TdxTextAlignX); +begin + Format := Format and not dxPSGlbl.dxFormatTextAlignXMask or (Byte(Value) shl dxPSGlbl.dxFormatTextAlignXOffset); +end; + +procedure TAbstractdxReportCellData.SetTextAlignY(Value: TdxTextAlignY); +begin + Format := Format and not dxPSGlbl.dxFormatTextAlignYMask or (Byte(Value) shl dxPSGlbl.dxFormatTextAlignYOffset); +end; + +{ TdxReportCellText } + +procedure TdxReportCellText.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TdxReportCellText then + begin + SetText(TdxReportCellText(Source).GetText); + Indent := TdxReportCellText(Source).Indent; + end; +end; + +procedure TdxReportCellText.DrawContent(DC: HDC; AStage: TdxPSRenderStages); +begin + + if IsBackgroundBitmapDrawn then + DrawBackgroundBitmap(DC) + else + if IsBackgroundDrawn then + DrawBackground(DC); + + if IsTextDrawn then DrawText(DC); + if IsSortMarkDrawn then DrawSortMark(DC); + if IsBordersDrawn then DrawBorders(DC); +end; + +procedure TdxReportCellText.DrawSortMark(DC: HDC); +var + R: TRect; +begin + R := GetSortMarkBounds(DC); + if not IsRectEmpty(R) then + Renderer.DrawSortMark(DC, R, SortOrder, EdgeMode = cemPattern); +end; + +procedure TdxReportCellText.DrawText(DC: HDC); +var + R: TRect; + F: TFont; + S: string; + + ASaveFont: HFONT; + ALimit: Integer; + ATextParams: TdxTextParams; + AFont: TFont; + + function ExceedBounds: Boolean; + var + TextBounds: TRect; + begin + TextBounds := R; + SelectObject(DC, F.Handle); + Windows.DrawText(DC, PChar(S), -1, TextBounds, DT_CALCRECT); + Result := (R.Right - R.Left) < (TextBounds.Right - TextBounds.Left); + end; + +begin + R := GetTextBounds(DC); + if not IsRectEmpty(R) then + begin + S := GetText; + AFont := GetFont; + ASaveFont := GetCurrentObject(DC, OBJ_FONT); + if Multiline or not AdjustFont then + Renderer.DrawTextEx(DC, R, 0, Indent, 0, S, AFont, DTFormat) + else + begin + SelectObject(DC, AFont.Handle); + ATextParams := dxCalcTextParams(DC, DTFormat); + if ATextParams.PatternedText then + Renderer.DrawTextEx(DC, R, 0, Indent, 0, S, AFont, DTFormat) + else + begin + F := TFont.Create; + try + F.Assign(AFont); + ALimit := MulDiv(F.Size, 2, 3); + while ExceedBounds and (F.Size > ALimit) do + F.Size := F.Size - 1; + SetTextColor(DC, ColorToRgb(AFont.Color)); + Windows.DrawText(DC, PChar(S), -1, R, 0); + finally + F.Free; + end; + end; + end; + SelectObject(DC, ASaveFont); + end; +end; + +function TdxReportCellText.CalculateLineCount(DC: HDC): Integer; +begin + Result := Renderer.CalcTextLineCount(DC, Text, Font, Width - Indent); +end; + +function TdxReportCellText.MeasureContentHeight(DC: HDC): Integer; +begin + Result := Renderer.CalcTextHeight(DC, Text, Multiline, Font, Width - Indent); + if (SortOrder <> csoNone) and (Result < dxSortMarkRgnSize) then + Result := dxSortMarkRgnSize; +end; + +function TdxReportCellText.MeasureContentWidth(DC: HDC): Integer; +begin + if Multiline then + Result := inherited MeasureContentWidth(DC) + else + Result := Renderer.CalcTextWidth(DC, Text, Font); + if SortOrder <> csoNone then + Inc(Result, dxSortMarkRgnSize); +end; + +function TdxReportCellText.MeasureFontHeight(DC: HDC): Integer; +begin + Result := Renderer.CalcTextPatternHeight(DC, Font); + if (SortOrder <> csoNone) and (Result < dxSortMarkRgnSize) then + Result := dxSortMarkRgnSize; + if Result <> 0 then + Inc(Result, MeasureBordersHeight(DC)); +end; + +function TdxReportCellText.GetSortMarkBounds(DC: HDC): TRect; +begin + Result := GetInnerBounds(DC); + Result.Left := Result.Right - MulDiv(dxSortMarkRgnSize, PixelsNumerator, PixelsDenominator); +end; + +function TdxReportCellText.GetTextBounds(DC: HDC): TRect; +begin + Result := GetInnerBounds(DC); + if IsSortMarkDrawn then + Result.Right := GetSortMarkBounds(DC).Left; +end; + +function TdxReportCellText.IsSortMarkDrawn: Boolean; +begin + Result := SortOrder <> csoNone; +end; + +function TdxReportCellText.IsTextDrawn: Boolean; +begin + Result := GetText <> ''; +end; + +procedure TdxReportCellText.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FIndent := AReader.ReadInteger; + Text := AReader.ReadString; +end; + +procedure TdxReportCellText.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteInteger(Integer(FIndent)); + AWriter.WriteString(Text) +end; + +function TdxReportCellText.GetAdjustFont: Boolean; +begin + Result := FIndent and dxFormatTextAdjustFont <> 0; +end; + +function TdxReportCellText.GetIndent: Integer; +begin + Result := FIndent and not dxFormatTextAdjustFont; +end; + +procedure TdxReportCellText.SetAdjustFont(Value: Boolean); +begin + Integer(FIndent) := Integer(FIndent) and not dxFormatTextAdjustFont; + if Value then + Integer(FIndent) := Integer(FIndent) or dxFormatTextAdjustFont; +end; + +procedure TdxReportCellText.SetIndent(Value: Integer); +begin + FIndent := (FIndent and dxFormatTextAdjustFont) or + (Cardinal(Value) and not dxFormatTextAdjustFont); +end; + +{ TdxReportCellString } + +function TdxReportCellString.GetText: string; +begin + Result := FText; +end; + +procedure TdxReportCellString.SetText(const Value: string); +begin + FText := Value; +end; + +{ TdxReportCellImageContainer } + +constructor TdxReportCellImageContainer.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + ImageTransparent := True; +end; + +procedure TdxReportCellImageContainer.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TdxReportCellImageContainer then + ImageTransparent := TdxReportCellImageContainer(Source).ImageTransparent; +end; + +procedure TdxReportCellImageContainer.DrawContent(DC: HDC; AStage: TdxPSRenderStages); +begin + if IsBackgroundBitmapDrawn then DrawBackgroundBitmap(DC); + if IsTextBackgroundDrawn then DrawTextBackground(DC); + if IsTextDrawn then DrawText(DC); + if IsImageBackgroundDrawn then DrawImageBackground(DC); + if IsImageDrawn then DrawImage(DC); + if IsSortMarkDrawn then DrawSortMark(DC); + if IsBordersDrawn then DrawBorders(DC); +end; + +procedure TdxReportCellImageContainer.DrawImage(DC: HDC); +begin +end; + +procedure TdxReportCellImageContainer.DrawImageBackground(DC: HDC); +begin + DrawBackgroundRect(DC, GetImageAreaBounds(DC)); +end; + +procedure TdxReportCellImageContainer.DrawTextBackground(DC: HDC); +var + R: TRect; +begin + R := GetTextBounds(DC); + if IsSortMarkDrawn then + R.Right := GetSortMarkBounds(DC).Right; + DrawBackgroundRect(DC, R); +end; + +function TdxReportCellImageContainer.GetImageAreaBounds(DC: HDC): TRect; +begin + Result := GetInnerBounds(DC); + if IsSortMarkDrawn then + Result.Right := GetSortMarkBounds(DC).Left; +end; + +function TdxReportCellImageContainer.GetImageBounds(DC: HDC): TRect; +begin + Result := dxPSGlbl.NullRect; +end; + +procedure TdxReportCellImageContainer.GetImageSizes(var AImageWidth, AImageHeight: Integer); +begin + AImageWidth := 0; + AImageHeight := 0; +end; + +function TdxReportCellImageContainer.HasImage: Boolean; +begin + Result := False; +end; + +function TdxReportCellImageContainer.IsImageBackgroundDrawn: Boolean; +begin + Result := inherited IsBackgroundDrawn and not IsImageDrawn and not IsBackgroundBitmapDrawn; +end; + +function TdxReportCellImageContainer.IsImageDrawn: Boolean; +begin + Result := HasImage; +end; + +function TdxReportCellImageContainer.IsTextBackgroundDrawn: Boolean; +begin + Result := not Transparent and not IsBackgroundBitmapDrawn; +end; + +function TdxReportCellImageContainer.GetImageTransparent: Boolean; +begin + Result := (Format and dxPSGlbl.dxFormatImageTransparent) = dxPSGlbl.dxFormatImageTransparent; +end; + +procedure TdxReportCellImageContainer.SetImageTransparent(Value: Boolean); +const + dxImageTransparent: array[Boolean] of DWORD = (0, dxPSGlbl.dxFormatImageTransparent); +begin + Format := Format and not dxPSGlbl.dxFormatImageTransparent or dxImageTransparent[Value]; +end; + +{ TdxReportCellCheck } + +constructor TdxCustomReportCellCheck.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + Checked := False; + //BorderColor := clWindowText; + ButtonEdgeStyle := cbesUltraFlat; + CheckPos := dxDefaultCheckPos; + Enabled := True; +end; + +procedure TdxCustomReportCellCheck.DrawCheck(DC: HDC); +var + R: TRect; +begin + R := GetCheckBounds(DC); + if RectVisible(DC, R) then + Renderer.DrawCheckBox(DC, R, Checked, Enabled, IsRadio, ButtonEdgeStyle, BorderColor); +end; + +procedure TdxCustomReportCellCheck.DrawImage(DC: HDC); +begin + DrawCheck(DC); +end; + +function TdxCustomReportCellCheck.MeasureContentHeight(DC: HDC): Integer; +var + TextHeight: Integer; +begin + Result := 1 + CheckHeight + 1; + TextHeight := inherited MeasureContentHeight(DC); + if Result < TextHeight then Result := TextHeight; +end; + +function TdxCustomReportCellCheck.MeasureContentWidth(DC: HDC): Integer; +begin + Result := 1 + CheckWidth + 1; + if CheckPos <> ccpCenter then + Inc(Result, inherited MeasureContentWidth(DC)); +end; + +function TdxCustomReportCellCheck.GetCheckBounds(DC: HDC): TRect; +var + W, H: Integer; +begin + Result := GetImageAreaBounds(DC); + if not IsRectEmpty(Result) then + begin + GetImageSizes(W, H); + with Result do + begin + Inc(Left, (Right - Left - W) div 2); + Inc(Top, (Bottom - Top - H) div 2); + Right := Left + W; + Bottom := Top + H; + end; + FixupRect(DC, Result); + end; +end; + +function TdxCustomReportCellCheck.GetImageAreaBounds(DC: HDC): TRect; +var + W, H: Integer; +begin + GetImageSizes(W, H); + if (W <> 0) and (H <> 0) then + begin + Result := inherited GetImageAreaBounds(DC); + with Result do + case CheckPos of + ccpLeft: + Right := Left + W + 2 * Renderer.UnitsPerPixel; + ccpRight: + Left := Right - (W + 2 * Renderer.UnitsPerPixel); + end; + end + else + Result := dxPSGlbl.NullRect; +end; + +function TdxCustomReportCellCheck.GetImageBounds(DC: HDC): TRect; +begin + Result := GetCheckBounds(DC); +end; + +procedure TdxCustomReportCellCheck.GetImageSizes(var AImageWidth, AImageHeight: Integer); +begin + AImageWidth := MulDiv(dxPSGlbl.CheckWidth, PixelsNumerator, PixelsDenominator); + AImageHeight := MulDiv(dxPSGlbl.CheckHeight, PixelsNumerator, PixelsDenominator); +end; + +function TdxCustomReportCellCheck.GetTextBounds(DC: HDC): TRect; +begin + if CheckPos <> ccpCenter then + begin + Result := inherited GetTextBounds(DC); + case CheckPos of + ccpLeft: + Result.Left := GetImageAreaBounds(DC).Right; + ccpRight: + Result.Right := GetImageAreaBounds(DC).Left; + end; + end + else + Result := dxPSGlbl.NullRect; +end; + +function TdxCustomReportCellCheck.HasImage: Boolean; +begin + Result := True; +end; + +function TdxCustomReportCellCheck.IsImageBackgroundDrawn: Boolean; +begin + Result := not Transparent and not IsBackgroundBitmapDrawn; +end; + +class function TdxCustomReportCellCheck.IsRadio: Boolean; +begin + Result := False; +end; + +procedure TdxCustomReportCellCheck.SetChecked(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatCheckChecked, Value); +end; + +function TdxCustomReportCellCheck.GetState: TCheckBoxState; +begin + if Enabled then + if Checked then + Result := cbChecked + else + Result := cbUnchecked + else + Result := cbGrayed; +end; + +function TdxCustomReportCellCheck.GetBoldBorder: Boolean; +begin + Result := ButtonEdgeStyle = cbesBoldFlat; +end; + +function TdxCustomReportCellCheck.GetButtonEdgeStyle: TdxCheckButtonEdgeStyle; +begin + Result := TdxCheckButtonEdgeStyle((Format and dxPSGlbl.dxFormatCheckButtonEdgeStyleMask) shr dxPSGlbl.dxFormatCheckButtonEdgeStyleOffset); +end; + +function TdxCustomReportCellCheck.GetChecked: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatCheckChecked); +end; + +function TdxCustomReportCellCheck.GetCheckPos: TdxCellCheckPos; +begin + Result := TdxCellCheckPos((Format and dxPSGlbl.dxFormatCheckPosMask) shr dxPSGlbl.dxFormatCheckPosOffset); +end; + +function TdxCustomReportCellCheck.GetEnabled: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatCheckEnabled); +end; + +function TdxCustomReportCellCheck.GetFlatBorder: Boolean; +begin + Result := ButtonEdgeStyle = cbesUltraFlat; +end; + +procedure TdxCustomReportCellCheck.SetBoldBorder(Value: Boolean); +begin + if Value then + ButtonEdgeStyle := cbesBoldFlat; +end; + +procedure TdxCustomReportCellCheck.SetButtonEdgeStyle(Value: TdxCheckButtonEdgeStyle); +begin + Format := Format and not dxPSGlbl.dxFormatCheckButtonEdgeStyleMask or (Byte(Value) shl dxPSGlbl.dxFormatCheckButtonEdgeStyleOffset); +end; + +procedure TdxCustomReportCellCheck.SetCheckPos(Value: TdxCellCheckPos); +begin + if Value = ccpCenter then + SetText(''); + Format := Format and not dxPSGlbl.dxFormatCheckPosMask or (Byte(Value) shl dxPSGlbl.dxFormatCheckPosOffset); +end; + +procedure TdxCustomReportCellCheck.SetEnabled(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatCheckEnabled, Value); +end; + +procedure TdxCustomReportCellCheck.SetFlatBorder(Value: Boolean); +begin + if Value then + ButtonEdgeStyle := cbesUltraFlat + else + ButtonEdgeStyle := cbes3D; +end; + +{ TdxCustomReportCellRadio } + +class function TdxCustomReportCellRadio.IsRadio: Boolean; +begin + Result := True; +end; + +{ TdxCustomReportCellCheckImage } + +constructor TdxCustomReportCellCheckImage.Create(AParent: TdxReportCell); +begin + inherited; + GlyphCount := 1; +end; + +destructor TdxCustomReportCellCheckImage.Destroy; +begin + ReleaseGlyph; + inherited; +end; + +procedure TdxCustomReportCellCheckImage.Assign(Source: TPersistent); +begin + if Source is TdxCustomReportCellCheckImage then + with TdxCustomReportCellCheckImage(Source) do + begin + Self.GlyphCount := GlyphCount; + if HasGlyph then + Self.SetGlyph(Glyph) + else + Self.ReleaseGlyph; + end; + inherited; +end; + +procedure TdxCustomReportCellCheckImage.DrawCheck(DC: HDC); +begin + if HasGlyph and not Glyph.Empty and (GlyphCount <> 0) then + DrawCheckGlyph(DC) + else + inherited; +end; + +procedure TdxCustomReportCellCheckImage.DrawCheckGlyph(DC: HDC); +var + R: TRect; +begin + if HasGlyph and (GlyphCount <> 0) then + begin + R := GlyphPartialBounds; + OffsetRect(R, -R.Left, -R.Top); + //R := Rect(0, 0, Glyph.Height, Glyph.Height); {3.1} + with Renderer.FCheckBitmap do + begin + Height := R.Bottom - R.Top; + Width := R.Right - R.Left; + Canvas.Brush.Color := clWhite; + Canvas.FillRect(R); + Canvas.CopyRect(R, Glyph.Canvas, GlyphPartialBounds); + end; + Renderer.CachedGraphicInfo.Clear; + Renderer.DrawGraphicEx(DC, GetCheckBounds(DC), GetImageAreaBounds(DC), nil, 0, + Renderer.FCheckBitmap, True, True, Color, ContentBkColor, ContentPattern, cibAlways); + end; +end; + +procedure TdxCustomReportCellCheckImage.GetImageSizes(var AImageWidth, AImageHeight: Integer); +begin + if HasGlyph and not Glyph.Empty and (GlyphCount <> 0) then + begin + AImageWidth := MulDiv(Glyph.Width div GlyphCount, PixelsNumerator, PixelsDenominator); + AImageHeight := MulDiv(Glyph.Height, PixelsNumerator, PixelsDenominator); + end + else + inherited; +end; + +function TdxCustomReportCellCheckImage.GetGlyph: TBitmap; +begin + Result := nil; +end; + +function TdxCustomReportCellCheckImage.GetGlyphCount: Integer; +begin + Result := 1; +end; + +function TdxCustomReportCellCheckImage.GetGlyphIndex: Integer; +//cbUnchecked, cbChecked, cbGrayed +const + GlyphIndexes: array[TCheckBoxState] of Integer = (0, 1, 2); +begin + Result := GlyphIndexes[State]; + if (State = cbGrayed) and (GlyphCount < 3) then + Result := 0; + if Result > GlyphCount - 1 then + Result := GlyphCount - 1; +end; + +procedure TdxCustomReportCellCheckImage.SetGlyph(Value: TBitmap); +begin +end; + +procedure TdxCustomReportCellCheckImage.SetGlyphCount(Value: Integer); +begin +end; + +function TdxCustomReportCellCheckImage.HasGlyph: Boolean; +begin + Result := False; +end; + +procedure TdxCustomReportCellCheckImage.ReleaseGlyph; +begin +end; + +procedure TdxCustomReportCellCheckImage.ReadData(AReader: TdxPSDataReader); +begin + inherited; + if AReader.ReadBoolean then AReader.ReadImage(Glyph); +end; + +procedure TdxCustomReportCellCheckImage.WriteData(AWriter: TdxPSDataWriter); +begin + inherited; + AWriter.WriteBoolean(HasGlyph); + if HasGlyph then AWriter.WriteImage(Glyph); +end; + +function TdxCustomReportCellCheckImage.GetGlyphPartialBounds: TRect; +begin + if HasGlyph and (GlyphCount <> 0) then + if GlyphCount = 1 then + Result := MakeBounds(0, 0, Glyph.Width, Glyph.Height) + else + Result := MakeBounds((Glyph.Width div GlyphCount) * GlyphIndex, 0, Glyph.Height, Glyph.Height) + else + Result := dxPSGlbl.NullRect; +end; + +{ TdxReportCellCheckImage } + +function TdxReportCellCheckImage.GetGlyph: TBitmap; +begin + if FGlyph = nil then + FGlyph := TBitmap.Create; + Result := FGlyph; +end; + +function TdxReportCellCheckImage.GetGlyphCount: Integer; +begin + Result := (Format and dxPSGlbl.dxFormatCheckGlyphCountMask) shr dxPSGlbl.dxFormatCheckGlyphCountOffset; +end; + +procedure TdxReportCellCheckImage.SetGlyph(Value: TBitmap); +begin + if Value = nil then + ReleaseGlyph + else + Glyph.Assign(Value); +end; + +procedure TdxReportCellCheckImage.SetGlyphCount(Value: Integer); +begin +// if Value < 1 then {3.1} +// Value := 1; + if Value < 0 then Value := 0; + if Value > MaxGlyphCount then + Value := MaxGlyphCount; + + Format := Format and not dxPSGlbl.dxFormatCheckGlyphCountMask or (DWORD(Value) shl dxPSGlbl.dxFormatCheckGlyphCountOffset); +end; + +function TdxReportCellCheckImage.HasGlyph: Boolean; +begin + Result := FGlyph <> nil; +end; + +procedure TdxReportCellCheckImage.ReleaseGlyph; +begin + FreeAndNil(FGlyph); +end; + +{ TdxCustomReportButtonGroup } + +constructor TdxCustomReportButtonGroup.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + FColumnCount := 1; + FInterColumnsMinSpace := dxRadioGroupInterColumnsMinSpace; + FInterRowsMinSpace := dxRadioGroupInterRowsMinSpace; + FIndents := MakeRect(dxRadioGroupBoundsIndent, dxRadioGroupBoundsIndent, dxRadioGroupBoundsIndent, dxRadioGroupBoundsIndent); + ShowCaption := False; +end; + +procedure TdxCustomReportButtonGroup.Assign(Source: TPersistent); +begin + if Source is TdxCustomReportButtonGroup then + with TdxCustomReportButtonGroup(Source) do + begin + Self.ColumnCount := ColumnCount; + Self.InterColumnsMinSpace := InterColumnsMinSpace; + Self.InterRowsMinSpace := InterRowsMinSpace; + Self.Indents := Indents; + end; + inherited; +end; + +procedure TdxCustomReportButtonGroup.AdjustContent(DC: HDC); +type + TViewInfo = record + ColumnWidth: Integer; + ItemsArea: TRect; + RowHeight: Integer; + end; + +var + ViewInfo: TViewInfo; + + procedure CalcItemSizes; + var + I, Value: Integer; + begin + FItemSize.cX := 0; + for I := 0 to ItemCount - 1 do + begin + Value := Items[I].MeasureContentWidth(DC); + if FItemSize.cX < Value then FItemSize.cX := Value; + end; + // todo: 4 - difference between PS and cxRadioGroup AB9777 + FItemSize.cY := Items[0].MeasureContentHeight(DC) - 4; + end; + + procedure CalcViewInfo; + begin + FillChar(ViewInfo, SizeOf(TViewInfo), 0); + with ViewInfo do + begin + ItemsArea := BoundsRect; + OffsetRect(ItemsArea, -ItemsArea.Left, -ItemsArea.Top); + if ShowCaption then + ItemsArea := GetInnerBoundsRelativeTo(DC, ItemsArea); + + Inc(ItemsArea.Left, Indents.Left); + if ShowCaption then + Dec(ItemsArea.Top, Indents.Top) + else + Inc(ItemsArea.Top, Indents.Top); + Dec(ItemsArea.Right, Indents.Right); + Dec(ItemsArea.Bottom, Indents.Bottom); + + if not IsRectEmpty(ItemsArea) then + begin + ColumnWidth := (ItemsArea.Right - ItemsArea.Left) div ColumnCount; + if ColumnWidth < ItemSize.cX + InterColumnsMinSpace then + ColumnWidth := ItemSize.cX + InterColumnsMinSpace; + + RowHeight := (ItemsArea.Bottom - ItemsArea.Top) div RowCount; + if RowHeight < ItemSize.cY then + RowHeight := ItemSize.cY; +{ if (RowCount > 1) and (RowHeight < ItemSize.cY + (1 * RowCount) + InterRowsMinSpace) then + RowHeight := ItemSize.cY - (1 * RowCount) + InterRowsMinSpace;} + end; + end; + end; + + function GetColumnRect(AnIndex: Integer): TRect; + begin + with ViewInfo do + begin + Result := ItemsArea; + Result.Right := Result.Left + ColumnWidth; + OffsetRect(Result, AnIndex * ColumnWidth, 0); + end; + end; + + function GetRowRect(AnIndex: Integer): TRect; + begin + with ViewInfo do + begin + Result := ItemsArea; + Result.Bottom := Result.Top + RowHeight; + OffsetRect(Result, 0, AnIndex * RowHeight); + end; + end; + + function GetItemBounds(AnIndex: Integer): TRect; + var + Delta: Integer; + begin + with GetColumnRect(ItemColumns[AnIndex]) do + begin + Result.Left := Left; + Result.Right := Right; + end; + with GetRowRect(ItemRows[AnIndex]) do + begin + Result.Top := Top; + Result.Bottom := Bottom; + end; + + Delta := (Result.Bottom - Result.Top - ItemSize.cY) div 2; + InflateRect(Result, 0, -Delta); + end; + + procedure CheckItemVisibility(AnItem: TdxReportVisualItem); + var + R: TRect; + begin + AnItem.Visible := IntersectRect(R, AnItem.BoundsRect, ViewInfo.ItemsArea); + end; + +var + I, J, Index: Integer; + Item: TdxCustomReportCellCheck; +begin + if ItemCount <> 0 then + begin + CalcItemSizes; + CalcViewInfo; + if not IsRectEmpty(ViewInfo.ItemsArea) then + for I := 0 to ColumnCount - 1 do + for J := 0 to RowCount - 1 do + begin + Index := I * RowCount + J; + if Index > ItemCount - 1 then Break; + + Item := Items[Index]; + Item.BoundsRect := GetItemBounds(Index); + CheckItemVisibility(Item); + end; + end; +end; + +function TdxCustomReportButtonGroup.MeasureContentHeight(DC: HDC): Integer; +begin + Result := RowCount * (ItemSize.cY + InterRowsMinSpace) - InterRowsMinSpace; + Inc(Result, Indents.Top + Indents.Bottom); + if RowCount <> 0 then + Inc(Result, 2 * dxPSTextOut.dxTextSpace); +end; + +function TdxCustomReportButtonGroup.MeasureContentWidth(DC: HDC): Integer; +begin + Result := ColumnCount * (ItemSize.cX + InterColumnsMinSpace) - InterColumnsMinSpace; + Inc(Result, Indents.Left + Indents.Right); +end; + +function TdxCustomReportButtonGroup.Add(const AText: string = ''): TdxCustomReportCellCheck; +begin + Result := GetItemClass.Create(Self); + Result.Text := AText; + Result.BoundsRect := MakeRect(0, 0, -1, 0); + InitializeItem(Result); +end; + +procedure TdxCustomReportButtonGroup.Clear; +begin + ClearDataItems; +end; + +procedure TdxCustomReportButtonGroup.Delete(Index: Integer); +begin + DeleteDataItem(Index); +end; + +function TdxCustomReportButtonGroup.FindItem(const ACaption: string): Integer; +begin + for Result := 0 to ItemCount - 1 do + if Items[Result].Text = ACaption then Exit; + Result := -1; +end; + +procedure TdxCustomReportButtonGroup.ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); +var + R: TRect; +begin + inherited; + R := Indents; + with R do + begin + Left := MulDiv(Left, APixelsNumerator, APixelsDenominator); + Right := MulDiv(Right, APixelsNumerator, APixelsDenominator); + Top := MulDiv(Top, APixelsNumerator, APixelsDenominator); + Bottom := MulDiv(Bottom, APixelsNumerator, APixelsDenominator); + end; + Indents := R; + + InterColumnsMinSpace := MulDiv(InterColumnsMinSpace, APixelsNumerator, APixelsDenominator); + InterRowsMinSpace := MulDiv(InterRowsMinSpace, APixelsNumerator, APixelsDenominator); +end; + +procedure TdxCustomReportButtonGroup.SetFontIndex(Value: Integer); +var + I: Integer; +begin + inherited; + for I := 0 to ItemCount - 1 do + Items[I].FontIndex := Value; +end; + +procedure TdxCustomReportButtonGroup.ReadDataItems(AReader: TdxPSDataReader); +begin + FLocked := True; + try + inherited; + finally + FLocked := False; + end; +end; + +procedure TdxCustomReportButtonGroup.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + ColumnCount := AReader.ReadInteger; + InterColumnsMinSpace := AReader.ReadInteger; + InterRowsMinSpace := AReader.ReadInteger; + Indents := AReader.ReadRect; +end; + +procedure TdxCustomReportButtonGroup.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteInteger(ColumnCount); + AWriter.WriteInteger(InterColumnsMinSpace); + AWriter.WriteInteger(InterRowsMinSpace); + AWriter.WriteRect(Indents); +end; + +class function TdxCustomReportButtonGroup.GetItemClass: TdxCustomReportCellCheckClass; +begin + Result := TdxCustomReportCellCheck; +end; + +procedure TdxCustomReportButtonGroup.InitializeItem(AnItem: TdxCustomReportCellCheck); +begin + AnItem.ButtonEdgeStyle := ButtonEdgeStyle; + AnItem.CellSides := []; + AnItem.CheckPos := CheckPos; + AnItem.Color := Color; + AnItem.FontIndex := FontIndex; + AnItem.TextAlignY := taCenterY; + AnItem.Transparent := True; +end; + +function TdxCustomReportButtonGroup.GetButtonEdgeStyle: TdxCheckButtonEdgeStyle; +begin + Result := TdxCheckButtonEdgeStyle((Format and dxPSGlbl.dxFormatCheckButtonEdgeStyleMask) shr dxPSGlbl.dxFormatCheckButtonEdgeStyleOffset); +end; + +function TdxCustomReportButtonGroup.GetCheckPos: TdxCellCheckPos; +begin + Result := TdxCellCheckPos((Format and dxPSGlbl.dxFormatCheckPosMask) shr dxPSGlbl.dxFormatCheckPosOffset); +end; + +function TdxCustomReportButtonGroup.GetItem(Index: Integer): TdxCustomReportCellCheck; +begin + Result := DataItems[Index] as TdxCustomReportCellCheck; +end; + +function TdxCustomReportButtonGroup.GetItemColumn(Index: Integer): Integer; +begin + Result := Index div RowCount; +end; + +function TdxCustomReportButtonGroup.GetItemCount: Integer; +begin + Result := DataItemCount; +end; + +function TdxCustomReportButtonGroup.GetItemRow(Index: Integer): Integer; +begin + Result := Index mod RowCount; +end; + +function TdxCustomReportButtonGroup.GetRowCount: Integer; +begin + Result := ItemCount div ColumnCount; + if (ItemCount <> 0) and (ItemCount mod ColumnCount <> 0) then + Inc(Result); +end; + +procedure TdxCustomReportButtonGroup.SetButtonEdgeStyle(Value: TdxCheckButtonEdgeStyle); +var + I: Integer; +begin + Format := Format and not dxPSGlbl.dxFormatCheckButtonEdgeStyleMask or (Byte(Value) shl dxPSGlbl.dxFormatCheckButtonEdgeStyleOffset); + + for I := 0 to ItemCount - 1 do + Items[I].ButtonEdgeStyle := Value; +end; + +procedure TdxCustomReportButtonGroup.SetCheckPos(Value: TdxCellCheckPos); +var + I: Integer; +begin + Format := Format and not dxPSGlbl.dxFormatCheckPosMask or (Byte(Value) shl dxPSGlbl.dxFormatCheckPosOffset); + + if Value = ccpCenter then + for I := 0 to ItemCount - 1 do + Items[I].Text := '' +end; + +procedure TdxCustomReportButtonGroup.SetColumnCount(Value: Integer); +begin + if Value < 1 then Value := 1; + FColumnCount := Value; +end; + +procedure TdxCustomReportButtonGroup.SetInterColumnsMinSpace(Value: Integer); +begin + if Value < 0 then Value := 0; + FInterColumnsMinSpace := Value; +end; + +procedure TdxCustomReportButtonGroup.SetInterRowsMinSpace(Value: Integer); +begin + if Value < 0 then Value := 0; + FInterRowsMinSpace := Value; +end; + +procedure TdxCustomReportButtonGroup.SetIndents(Value: TRect); +begin + with Value do + begin + if Left < 0 then Left := 0; + if Top < 0 then Top := 0; + if Right < 0 then Right := 0; + if Bottom < 0 then Bottom := 0; + end; + FIndents := Value; +end; + +{ TdxReportCellRadioGroupButton } + +type + TdxReportCellRadioGroupButton = class(TdxCustomReportCellRadio) + private + function GetParent: TdxReportRadioGroup; + protected + procedure SetChecked(Value: Boolean); override; + public + property Checked write SetChecked; + property Enabled; + property Parent: TdxReportRadioGroup read GetParent; + end; + + // for backward compatibility with saved reports + TdxReportCellGroupButton = class(TdxReportCellRadioGroupButton); + +function TdxReportCellRadioGroupButton.GetParent: TdxReportRadioGroup; +begin + Result := inherited Parent as TdxReportRadioGroup; +end; + +procedure TdxReportCellRadioGroupButton.SetChecked(Value: Boolean); +begin + inherited SetChecked(Value); + if Value then + Parent.ItemIndex := Index + else + Parent.ItemIndex := -1; +end; + +{ TdxReportRadioGroup } + +function TdxReportRadioGroup.Add(const AText: string = ''): TdxCustomReportCellRadio; +begin + Result := inherited Add(AText) as TdxCustomReportCellRadio; +end; + +class function TdxReportRadioGroup.GetItemClass: TdxCustomReportCellCheckClass; +begin + Result := TdxReportCellRadioGroupButton; +end; + +function TdxReportRadioGroup.GetItem(Index: Integer): TdxCustomReportCellRadio; +begin + Result := inherited Items[Index] as TdxCustomReportCellRadio; +end; + +function TdxReportRadioGroup.GetItemIndex: Integer; +begin + for Result := 0 to ItemCount - 1 do + if Items[Result].Checked then Exit; + Result := -1; +end; + +procedure TdxReportRadioGroup.SetItemIndex(Value: Integer); +var + AnItemIndex: Integer; +begin + if Locked then Exit; + + if Value < -1 then + Value := -1; + if Value > ItemCount - 1 then + Value := ItemCount - 1; + + AnItemIndex := ItemIndex; + if AnItemIndex <> Value then + begin + Locked := True; + try + if AnItemIndex <> -1 then + Items[AnItemIndex].Checked := False; + if Value <> -1 then + Items[Value].Checked := True; + finally + Locked := False; + end; + end; +end; + +{ TdxReportCellCheckGroupButton } + +type + TdxReportCellCheckGroupButton = class(TdxCustomReportCellCheckImage) + private + function GetParent: TdxReportCheckGroup; + protected + function GetGlyph: TBitmap; override; + function GetGlyphCount: Integer; override; + function HasGlyph: Boolean; override; + public + property Parent: TdxReportCheckGroup read GetParent; + end; + +{ TdxReportCellCheckGroupButton } + +function TdxReportCellCheckGroupButton.GetGlyph: TBitmap; +begin + if Parent <> nil then + Result := Parent.Glyph + else + Result := inherited GetGlyph; +end; + +function TdxReportCellCheckGroupButton.GetGlyphCount: Integer; +begin + if Parent <> nil then + Result := Parent.GlyphCount + else + Result := inherited GetGlyphCount; +end; + +function TdxReportCellCheckGroupButton.HasGlyph: Boolean; +begin + Result := (Parent <> nil) and Parent.HasGlyph; +end; + +function TdxReportCellCheckGroupButton.GetParent: TdxReportCheckGroup; +begin + Result := inherited Parent as TdxReportCheckGroup; +end; + +{ TdxReportCheckGroup } + +constructor TdxReportCheckGroup.Create(AParent: TdxReportCell); +begin + inherited; + GlyphCount := 1; +end; + +destructor TdxReportCheckGroup.Destroy; +begin + ReleaseGlyph; + inherited; +end; + +procedure TdxReportCheckGroup.Assign(Source: TPersistent); +begin + if Source is TdxReportCheckGroup then + with TdxReportCheckGroup(Source) do + begin + if HasGlyph then + Self.Glyph := Glyph + else + Self.ReleaseGlyph; + Self.GlyphCount := GlyphCount; + end; +end; + +function TdxReportCheckGroup.Add(const AText: string = ''): TdxCustomReportCellCheckImage; +begin + Result := inherited Add(AText) as TdxCustomReportCellCheckImage; +end; + +function TdxReportCheckGroup.HasGlyph: Boolean; +begin + Result := FGlyph <> nil;//) and not FGlyph.Empty; +end; + +procedure TdxReportCheckGroup.ReleaseGlyph; +begin + FreeAndNil(FGlyph); +end; + +procedure TdxReportCheckGroup.ReadData(AReader: TdxPSDataReader); +begin + inherited; + GlyphCount := AReader.ReadInteger; + if AReader.ReadBoolean then AReader.ReadImage(Glyph); +end; + +procedure TdxReportCheckGroup.WriteData(AWriter: TdxPSDataWriter); +begin + inherited; + AWriter.WriteInteger(GlyphCount); + AWriter.WriteBoolean(HasGlyph); + if HasGlyph then AWriter.WriteImage(Glyph); +end; + +class function TdxReportCheckGroup.GetItemClass: TdxCustomReportCellCheckClass; +begin + Result := TdxReportCellCheckGroupButton; +end; + +procedure TdxReportCheckGroup.InitializeItem(AnItem: TdxCustomReportCellCheck); +begin + inherited; +end; + +function TdxReportCheckGroup.GetGlyph: TBitmap; +begin + if FGlyph = nil then + FGlyph := TBitmap.Create; + Result := FGlyph; +end; + +function TdxReportCheckGroup.GetItem(Index: Integer): TdxCustomReportCellCheckImage; +begin + Result := inherited Items[Index] as TdxCustomReportCellCheckImage; +end; + +function TdxReportCheckGroup.GetItemChecked(Index: Integer): Boolean; +begin + Result := Items[Index].Checked; +end; + +function TdxReportCheckGroup.GetItemEnabled(Index: Integer): Boolean; +begin + Result := Items[Index].Enabled; +end; + +function TdxReportCheckGroup.GetItemState(Index: Integer): TCheckBoxState; +begin + Result := Items[Index].State; +end; + +procedure TdxReportCheckGroup.SetGlyph(Value: TBitmap); +begin + Glyph.Assign(Value); +end; + +procedure TdxReportCheckGroup.SetGlyphCount(Value: Integer); +begin + if Value < 0 then Value := 0; {3.1 1 -> 0} + if Value > MaxGlyphCount then Value := MaxGlyphCount; + FGlyphCount := Value; +end; + +procedure TdxReportCheckGroup.SetItemChecked(Index: Integer; Value: Boolean); +begin + Items[Index].Checked := Value; +end; + +procedure TdxReportCheckGroup.SetItemEnabled(Index: Integer; Value: Boolean); +begin + Items[Index].Enabled := Value; +end; + +{ TCustomdxReportCellImageContainer } + +constructor TCustomdxReportCellImageContainer.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + ImageIndex := -1; + ImageTransparent := True; +end; + +destructor TCustomdxReportCellImageContainer.Destroy; +begin + FreeAndNil(FImage); + inherited Destroy; +end; + +procedure TCustomdxReportCellImageContainer.Assign(Source: TPersistent); +begin + inherited; + if Source is TCustomdxReportCellImageContainer then + with TCustomdxReportCellImageContainer(Source) do + begin + Self.SetImage(FImage); + Self.ImageTransparent := ImageTransparent; + Self.ImageIndex := ImageIndex; + Self.ImageList := ImageList; + end; +end; + +function TCustomdxReportCellImageContainer.CreateImage(AGraphicClass: TGraphicClass): TGraphic; +begin + if (FImage = nil) or (FImage.ClassType <> AGraphicClass) then + begin + FreeAndNil(FImage); + FImage := dxPSUtl.CreateGraphic(AGraphicClass); + end; + Result := FImage; +end; + +procedure TCustomdxReportCellImageContainer.DrawImage(DC: HDC); +begin + Renderer.CachedGraphicInfo.Clear; + Renderer.DrawGraphicEx(DC, GetImageBounds(DC), GetImageAreaBounds(DC), ImageList, + ImageIndex, FImage, ImageTransparent, IsBackgroundBitmapDrawn or Transparent, + Color, ContentBkColor, ContentPattern, ActualImageBuffering); +end; + +function TCustomdxReportCellImageContainer.GetActualImageBuffering: TdxCellImageActualBuffering; +begin + Result := ImageBuffering; + if Result = cibDefault then + if (ReportCells <> nil) and (ReportCells.ReportLink <> nil) then + if ReportCells.ReportLink.AlwaysBufferedGraphics then + Result := cibAlways + else + Result := cibNone + else + Result := cibAlways; +end; + +function TCustomdxReportCellImageContainer.GetImageBuffering: TdxCellImageBuffering; +begin + Result := cibDefault; +end; + +procedure TCustomdxReportCellImageContainer.GetImageSizes(var AImageWidth, AImageHeight: Integer); +begin + if ImageList <> nil then + begin + AImageWidth := MulDiv(ImageList.Width, PixelsNumerator, PixelsDenominator); + AImageHeight := MulDiv(ImageList.Height, PixelsNumerator, PixelsDenominator); + end + else + if FImage <> nil then + begin + AImageWidth := MulDiv(Image.Width, PixelsNumerator, PixelsDenominator); + AImageHeight := MulDiv(Image.Height, PixelsNumerator, PixelsDenominator); + end + else + inherited; +end; + +function TCustomdxReportCellImageContainer.HasImage: Boolean; +begin + Result := ((FImage <> nil) and not Image.Empty) or + ((ImageList <> nil) and (ImageIndex > -1) and (ImageIndex < ImageList.Count)); +end; + +procedure TCustomdxReportCellImageContainer.SetImageBuffering(Value: TdxCellImageBuffering); +begin +end; + +function TCustomdxReportCellImageContainer.GetImageListIndex: Integer; +begin + Result := ReportCells.IndexOfImageList(ImageList); +end; + +procedure TCustomdxReportCellImageContainer.ReadData(AReader: TdxPSDataReader); +var + SourceType, BytesToSkip: Integer; + GraphicClass: TGraphicClass; +begin + inherited ReadData(AReader); + + if AReader.ReadBoolean then // HasImage + begin + SourceType := AReader.ReadInteger; + case SourceType of + imstImageList: + begin + ImageList := ReportCells.ImageLists[AReader.ReadInteger]; + ImageIndex := AReader.ReadInteger; + end; + + {imstShellLargeImageList: + begin + ImageList := dxPSUtl.ShellLargeImages; + ImageIndex := AReader.ReadInteger; + end; + + imstShellSmallImageList: + begin + ImageList := dxPSUtl.ShellSmallImages; + ImageIndex := AReader.ReadInteger; + end;} + imstShellLargeImageList, + imstShellSmallImageList, + imstImage: + begin + GraphicClass := AReader.ReadGraphicClass; + if GraphicClass = nil then + begin + Image := nil; + BytesToSkip := {$IFDEF DELPHI6} AReader.ReadInt64 {$ELSE} AReader.ReadInteger {$ENDIF}; + AReader.SkipBytes(BytesToSkip); + end + else + AReader.ReadImage(CreateImage(GraphicClass)); + end; + end; + end; +end; + +procedure TCustomdxReportCellImageContainer.WriteData(AWriter: TdxPSDataWriter); + + function RetrieveSourceType: Integer; + begin + if ImageList <> nil then + if (ImageList = dxPSUtl.ShellLargeImages) or + (ImageList.HandleAllocated and (ImageList.Handle = dxPSUtl.ShellLargeImages.Handle)) then + Result := imstShellLargeImageList + else + if (ImageList = dxPSUtl.ShellSmallImages) or + (ImageList.HandleAllocated and (ImageList.Handle = dxPSUtl.ShellSmallImages.Handle)) then + Result := imstShellSmallImageList + else + Result := imstImageList + else + Result := imstImage; + end; + + function RetrieveImage(ASourceType: Integer; AnImageIndex: Integer): TGraphic; + begin + case ASourceType of + imstShellLargeImageList: + begin + Result := TBitmap.Create; + dxPSUtl.ShellLargeImages.GetBitmap(AnImageIndex, TBitmap(Result)); + end; + + imstShellSmallImageList: + begin + Result := TBitmap.Create; + dxPSUtl.ShellSmallImages.GetBitmap(AnImageIndex, TBitmap(Result)); + end; + else + Result := Self.Image; + end; + end; + +var + SourceType: Integer; + Buffer: TGraphic; +begin + inherited WriteData(AWriter); + + AWriter.WriteBoolean(HasImage); + if HasImage then + begin + SourceType := RetrieveSourceType; + AWriter.WriteInteger(SourceType); + case SourceType of + imstImageList: + begin + AWriter.WriteInteger(GetImageListIndex); + AWriter.WriteInteger(ImageIndex); + end; + + else + begin + Buffer := RetrieveImage(SourceType, ImageIndex); + try + AWriter.WriteString(Buffer.ClassName); + AWriter.WriteImage(Buffer); + finally + if Buffer <> Self.Image then Buffer.Free; + end; + end; + { imstShellLargeImageList, + imstShellSmallImageList: + AWriter.WriteInteger(ImageIndex); + imstImage: + begin + AWriter.WriteString(Image.ClassName); + AWriter.WriteImage(Image); + end;} + end; + end; +end; + +procedure TCustomdxReportCellImageContainer.SetImage(Value: TGraphic); +begin + if Value <> nil then + begin + CreateImage(TGraphicClass(Value.ClassType)); + Image.Assign(Value); + + if Width = 0 then Width := Image.Width; + if Height = 0 then Height := Image.Height; + end + else + FreeAndNil(FImage); +end; + +{ TdxReportCellImage } + +constructor TdxReportCellImage.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + ImageLayout := ilImageCenterLeft; + IsTextDrawnForCenteredImage := False; + IsTextShiftedForHorizontallyCenteredImage := True; + MakeSpaceForEmptyImage := True; +end; + +procedure TdxReportCellImage.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TdxReportCellImage then + begin + ImageLayout := TdxReportCellImage(Source).ImageLayout; + MakeSpaceForEmptyImage := TdxReportCellImage(Source).MakeSpaceForEmptyImage; + end; +end; + +function TdxReportCellImage.MeasureContentHeight(DC: HDC): Integer; +var + TextHeight: Integer; +begin + if ImageList <> nil then + Result := ImageList.Height + else + if FImage <> nil then + Result := Image.Height + else + Result := 0; + + if Result <> 0 then Inc(Result, 2); + + if ImageLayout in [ilImageTopLeft, ilImageCenterLeft, ilImageBottomLeft, ilImageTopRight, ilImageCenterRight, ilImageBottomRight] then + begin + TextHeight := inherited MeasureContentHeight(DC); + if Result < TextHeight then Result := TextHeight; + end + else + if ImageLayout in [ilImageTopCenter, ilImageBottomCenter] then + if not IsTextShiftedForHorizontallyCenteredImage then + begin + TextHeight := inherited MeasureContentHeight(DC); + if TextHeight > Result then Result := TextHeight; + end + else + Inc(Result, inherited MeasureContentHeight(DC)) + else + if IsTextDrawnForCenteredImage then + begin + TextHeight := inherited MeasureContentHeight(DC); + if TextHeight > Result then Result := TextHeight; + end; +end; + +function TdxReportCellImage.MeasureContentWidth(DC: HDC): Integer; +var + TextWidth: Integer; +begin + if ImageList <> nil then + Result := ImageList.Width + else + if FImage <> nil then + Result := Image.Width + else + Result := 0; + + if Result <> 0 then Inc(Result, 2); + + if ImageLayout in [ilImageTopLeft, ilImageCenterLeft, ilImageBottomLeft, ilImageTopRight, ilImageCenterRight, ilImageBottomRight] then + Inc(Result, inherited MeasureContentHeight(DC)) + else + if (ImageLayout in [ilImageTopCenter, ilImageBottomCenter]) or ((ImageLayout = ilImageCenterCenter) and IsTextDrawnForCenteredImage) then + begin + TextWidth := inherited MeasureContentWidth(DC); + if Result < TextWidth then Result := TextWidth; + end; +end; + +function TdxReportCellImage.GetHalfContentWidth(DC: HDC): Integer; +var + W, H: Integer; +begin + GetImageSizes(W, H); + if IsTextDrawnForCenteredImage and not IsTextShiftedForHorizontallyCenteredImage and + (ImageLayout in [ilImageTopCenter, ilImageCenterCenter, ilImageBottomCenter]) then + Result := (Renderer.CalcTextWidth(DC, Text, Font) + W) div 2 + Renderer.LineThickness + else + Result := 0; +end; + +function TdxReportCellImage.GetImageAreaBounds(DC: HDC): TRect; +var + W, H: Integer; + R: TRect; +begin + GetImageSizes(W, H); + if (W <> 0) and (H <> 0) then + begin + Result := inherited GetImageAreaBounds(DC); + with Result do + begin + case ImageLayout of + ilImageTopLeft: + Right := Left + W + 2 * Renderer.UnitsPerPixel; + ilImageTopCenter: + begin + if not IsTextShiftedForHorizontallyCenteredImage then + begin + Inc(Left, (Right - Left - W) div 2 + Renderer.UnitsPerPixel); + Right := Left + W + Renderer.UnitsPerPixel; + end; + Bottom := Top + H + 2 * Renderer.UnitsPerPixel; + end; + ilImageTopRight: + Left := Right - W - 2 * Renderer.UnitsPerPixel; + ilImageCenterLeft: + Right := Left + W + 2 * Renderer.UnitsPerPixel; + ilImageCenterCenter: + if not IsTextShiftedForHorizontallyCenteredImage then + begin + Inc(Left, (Right - Left - W) div 2 + Renderer.UnitsPerPixel); + Right := Left + W + Renderer.UnitsPerPixel; + Inc(Top, (Bottom - Top - H) div 2 + Renderer.UnitsPerPixel); + Bottom := Top + H + Renderer.UnitsPerPixel; + end; + ilImageCenterRight: + Left := Right - W - 2 * Renderer.UnitsPerPixel; + ilImageBottomLeft: + Right := Left + W + 2 * Renderer.UnitsPerPixel; + ilImageBottomCenter: + begin + if not IsTextShiftedForHorizontallyCenteredImage then + begin + Inc(Left, (Right - Left - W) div 2 + Renderer.UnitsPerPixel); + Right := Left + W + Renderer.UnitsPerPixel; + end; + Top := Bottom - H - 2 * Renderer.UnitsPerPixel; + end; + ilImageBottomRight: + Left := Right - W - 2 * Renderer.UnitsPerPixel; + end; + R := GetInnerBounds(DC); + OffsetRect(Result, -GetHalfContentWidth(DC), 0); + if Left < R.Left then Left := R.Left; + if Top < R.Top then Top := R.Top; + if Right > R.Right then Right := R.Right; + if Bottom > R.Bottom then Bottom := R.Bottom; + end; + end + else + Result := NullRect; +end; + +function TdxReportCellImage.GetImageBounds(DC: HDC): TRect; +var + W, H: Integer; +begin + Result := GetImageAreaBounds(DC); + if not IsRectEmpty(Result) then + begin + GetImageSizes(W, H); + with Result do + begin + case ImageLayout of + ilImageTopLeft, + ilImageTopCenter, + ilImageTopRight: + Inc(Top, LineThickness); + + ilImageCenterLeft, + ilImageCenterCenter, + ilImageCenterRight: + Inc(Top, (Bottom - Top - H) div 2); + + ilImageBottomLeft, + ilImageBottomCenter, + ilImageBottomRight: + Top := Bottom - H - LineThickness; + end; + Inc(Left, (Right - Left - W) div 2); + Right := Left + W; + Bottom := Top + H; +// CorrectBounds(Result, DC); + end; + end; +end; + +function TdxReportCellImage.GetTextBounds(DC: HDC): TRect; +var + R: TRect; +begin + Result := inherited GetTextBounds(DC); + if IsImageDrawn or MakeSpaceForEmptyImage then + begin + if not ((ImageLayout in [ilImageTopCenter, ilImageCenterCenter, ilImageBottomCenter]) and + not IsTextShiftedForHorizontallyCenteredImage) then + begin + R := GetImageBounds(DC); + if not IsRectEmpty(R) then + with Result do + case ImageLayout of + ilImageTopLeft, ilImageCenterLeft, ilImageBottomLeft: + Left := R.Right; + ilImageTopRight, ilImageCenterRight, ilImageBottomRight: + Right := R.Left; + ilImageTopCenter: + if IsTextShiftedForHorizontallyCenteredImage then + Top := R.Bottom; + ilImageCenterCenter: + if not IsTextDrawn then //TODO: TdxReportCellImage.GetTextBounds( + Result := NullRect; + ilImageBottomCenter: + if IsTextShiftedForHorizontallyCenteredImage then + Bottom := R.Top; + end; + end; + end; +end; + +function TdxReportCellImage.IsImageBackgroundDrawn: Boolean; +begin + Result := inherited IsImageBackgroundDrawn and MakeSpaceForEmptyImage and + not ((ImageLayout in [ilImageTopCenter, ilImageCenterCenter, ilImageBottomCenter]) and + not IsTextShiftedForHorizontallyCenteredImage); +end; + +function TdxReportCellImage.IsTextDrawn: Boolean; +begin + Result := inherited IsTextDrawn and ((ImageLayout <> ilImageCenterCenter) or IsTextDrawnForCenteredImage); +end; + +function TdxReportCellImage.IsTextBackgroundDrawn: Boolean; +begin + Result := inherited IsTextBackgroundDrawn and + (not (ImageLayout in [ilImageTopCenter, ilImageCenterCenter, ilImageBottomCenter]) or + IsTextDrawnForCenteredImage or not HasImage); +end; + +function TdxReportCellImage.GetImageLayout: TdxImageLayout; +begin + Result := TdxImageLayout((Format and dxPSGlbl.dxFormatImageLayoutMask) shr dxPSGlbl.dxFormatImageLayoutOffset); +end; + +function TdxReportCellImage.GetIsTextDrawnForCenteredImage: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatIsTextDrawnForCenteredImage); +end; + +function TdxReportCellImage.GetIsTextShiftedForHorizontallyCenteredImage: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatIsTextShiftedForHorizontallyCenteredImage); +end; + +function TdxReportCellImage.GetMakeSpaceForEmptyImage: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatMakeSpaceForEmptyImage); +end; + +procedure TdxReportCellImage.SetImageLayout(Value: TdxImageLayout); +begin + Format := Format and not dxPSGlbl.dxFormatImageLayoutMask or (Byte(Value) shl dxPSGlbl.dxFormatImageLayoutOffset); +end; + +procedure TdxReportCellImage.SetIsTextDrawnForCenteredImage(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatIsTextDrawnForCenteredImage, Value); +end; + +procedure TdxReportCellImage.SetIsTextShiftedForHorizontallyCenteredImage(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatIsTextShiftedForHorizontallyCenteredImage, Value); +end; + +procedure TdxReportCellImage.SetMakeSpaceForEmptyImage(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatMakeSpaceForEmptyImage, Value); +end; + +{ TdxReportCellGraphic } + +constructor TdxReportCellGraphic.Create(AParent: TdxReportCell); +begin + inherited; + ImageBuffering := cibAlways; +end; + +{procedure TdxReportCellGraphic.Assign(Source: TPersistent); +begin + inherited; + if Source is TdxReportCellGraphic then + DrawMode := TdxReportCellGraphic(Source).DrawMode; +end;} + +function TdxReportCellGraphic.MeasureFontHeight(DC: HDC): Integer; +begin + Result := Renderer.CalcTextPatternHeight(DC, Renderer.RenderInfo.BaseContentFont); +end; + +function TdxReportCellGraphic.MeasureContentHeight(DC: HDC): Integer; +begin + if ImageList <> nil then + Result := ImageList.Height + else + if FImage <> nil then + begin + Result := Image.Height; + if Stretch and (Result > 0) and (Image.Width > 0) then + Result := Round(Result * Width / Image.Width); + end + else + Result := 0; +end; + +function TdxReportCellGraphic.MeasureContentWidth(DC: HDC): Integer; +begin + if ImageList <> nil then + Result := ImageList.Width + else + if FImage <> nil then + Result := Image.Width + else + Result := 0; +end; + +function TdxReportCellGraphic.GetImageBounds(DC: HDC): TRect; +var + W, H, cW, cH: Integer; + R: TRect; +begin + GetImageSizes(W, H); + if (W <> 0) and (H <> 0) then + begin + R := GetImageAreaBounds(DC); + with Result do + begin + case DrawMode of + gdmNone: + begin + Result.TopLeft := R.TopLeft; + Right := Left + W; + Bottom := Top + H; + end; + gdmCenter: + begin + Left := R.Left + (R.Right - R.Left - W) div 2; + Top := R.Top + (R.Bottom - R.Top - H) div 2; + Right := Left + W; + Bottom := Top + H; + end; + gdmStretch: + Result := R; + gdmStretchProportional, + gdmCenterAndStretchProportional: + begin + TopLeft := R.TopLeft; + cW := R.Right - R.Left; + cH := R.Bottom - R.Top; + if W / H > cW / cH then + begin + Right := Left + cW; + Bottom := Top + MulDiv(cW, H, W); + end + else + begin + Bottom := Top + cH; + Right := Left + MulDiv(cH, W, H); + end; + end; + end; + if DrawMode = gdmCenterAndStretchProportional then + begin + W := Right - Left; + H := Bottom - Top; + Left := R.Left + (R.Right - R.Left - W) div 2; + Top := R.Top + (R.Bottom - R.Top - H) div 2; + Right := Left + W; + Bottom := Top + H; + end; + end; + end + else + Result := dxPSGlbl.NullRect; +end; + +function TdxReportCellGraphic.GetImageBuffering: TdxCellImageBuffering; +begin + Result := TdxCellImageBuffering((Format and dxPSGlbl.dxFormatGraphicBufferingMask) shr dxPSGlbl.dxFormatGraphicBufferingOffset); +end; + +function TdxReportCellGraphic.GetTextBounds(DC: HDC): TRect; +begin + Result := dxPSGlbl.NullRect; +end; + +procedure TdxReportCellGraphic.SetImageBuffering(Value: TdxCellImageBuffering); +begin + Format := Format and not dxPSGlbl.dxFormatGraphicBufferingMask or (Byte(Value) shl dxPSGlbl.dxFormatGraphicBufferingOffset); +end; + +function TdxReportCellGraphic.GetCenter: Boolean; +begin + Result := DrawMode = gdmCenter; +end; + +function TdxReportCellGraphic.GetDrawMode: TdxGraphicDrawMode; +begin + Result := TdxGraphicDrawMode((Format and dxPSGlbl.dxFormatGraphicDrawModeMask) shr dxPSGlbl.dxFormatGraphicDrawModeOffset); +end; + +function TdxReportCellGraphic.GetStretch: Boolean; +begin + Result := (DrawMode = gdmStretchProportional) or (DrawMode = gdmCenterAndStretchProportional); +end; + +procedure TdxReportCellGraphic.SetCenter(Value: Boolean); +begin + if Value then + if Stretch then + DrawMode := gdmCenterAndStretchProportional + else + DrawMode := gdmCenter; +end; + +procedure TdxReportCellGraphic.SetDrawMode(Value: TdxGraphicDrawMode); +begin + Format := Format and not dxPSGlbl.dxFormatGraphicDrawModeMask or (Byte(Value) shl dxPSGlbl.dxFormatGraphicDrawModeOffset); +end; + +procedure TdxReportCellGraphic.SetStretch(Value: Boolean); +begin + if Value then + if Center then + DrawMode := gdmCenterAndStretchProportional + else + DrawMode := gdmStretchProportional; +end; + +{ TdxReportCellExpandButton } + +constructor TdxReportCellExpandButton.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + ButtonAlignHorz := bahCenter; + ButtonAlignVert := bavCenter; + ButtonBorder3D := False; + ButtonBorder3DSoft := False; + ButtonBorderShadow := False; + ButtonExpanded := False; + ButtonInteriorColor := clNone; + ButtonSize := dxDefaultCrossSignCrossSize; // 9 + ButtonTransparent := True; + KeepOddSize := True; + ShowButton := False; + ShowButtonBorder := True; + TreeLineMode := tlmNone; +end; + +procedure TdxReportCellExpandButton.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TdxReportCellExpandButton then + begin + ButtonBorder3D := TdxReportCellExpandButton(Source).ButtonBorder3D; + ButtonBorder3DSoft := TdxReportCellExpandButton(Source).ButtonBorder3DSoft; + ButtonBorderShadow := TdxReportCellExpandButton(Source).ButtonBorderShadow; + ButtonExpanded := TdxReportCellExpandButton(Source).ButtonExpanded; + ButtonInteriorColor := TdxReportCellExpandButton(Source).ButtonInteriorColor; + ButtonSize := TdxReportCellExpandButton(Source).ButtonSize; + ButtonTransparent := TdxReportCellExpandButton(Source).ButtonTransparent; + KeepOddSize := TdxReportCellExpandButton(Source).KeepOddSize; + ShowButton := TdxReportCellExpandButton(Source).ShowButton; + ShowButtonBorder := TdxReportCellExpandButton(Source).ShowButtonBorder; + TreeLineMode := TdxReportCellExpandButton(Source).TreeLineMode; + end; +end; + +procedure TdxReportCellExpandButton.DrawContent(DC: HDC; AStage: TdxPSRenderStages); +begin + if IsBackgroundBitmapDrawn then + DrawBackgroundBitmap(DC) + else + if IsBackgroundDrawn then + DrawBackground(DC); + if ShowButton then DrawExpandButton(DC); + if AreTreeLinesDrawn then DrawTreeLines(DC); + if IsBordersDrawn then DrawBorders(DC); +end; + +procedure TdxReportCellExpandButton.DrawExpandButton(DC: HDC); +var + R: TRect; +begin + R := GetButtonBounds(DC); + if RectVisible(DC, R) then + Renderer.DrawExpandButton(DC, R, ButtonExpanded, ShowButtonBorder, + ButtonBorder3D, ButtonBorder3DSoft, ButtonBorderShadow, not ButtonTransparent, + ReportCells.ExpandButtonBorderColor, ButtonInteriorColor); +end; + +procedure TdxReportCellExpandButton.DrawTreeLines(DC: HDC); +type + TdxTreeLinesDrawInfo = record + TopRect: TRect; + RightRect: TRect; + BottomRect: TRect; + end; + + function GetTreeLineParts: TdxPSTreeLineParts; + const + Parts: array[TdxPSTreeLineMode] of TdxPSTreeLineParts = + ([], [tlpTop, tlpBottom], [tlpTop, tlpRight, tlpBottom], + [tlpBottom, tlpRight], [tlpTop, tlpRight]); + begin + Result := Parts[TreeLineMode]; + end; + + procedure DrawTreeLine(const R: TRect; APattern: TdxPSFillPatternClass); + var + BkColor: TColor; + begin + if RectVisible(DC, R) then + begin + if Transparent then + BkColor := clWindow + else + BkColor := Color; + Renderer.FillRectEx(DC, R, ReportCells.TreeLineColor, BkColor, APattern); + end; + end; + + procedure CalculateDrawInfo(const AButtonRect: TRect; var ADrawInfo: TdxTreeLinesDrawInfo); + begin + with ADrawInfo do + begin + TopRect := BoundsRect; + with TopRect do + begin + Inc(Left, (Right - Left) div 2 - Renderer.LineThickness div 2); + Right := Left + Renderer.UnitsPerPixel; + Dec(Bottom, (Bottom - Top) div 2); + end; + if csTop in CellSides then + Dec(TopRect.Top, Renderer.LineThickness); + + RightRect := BoundsRect; + with RightRect do + begin + Inc(Left, (Right - Left) div 2); + Inc(Top, (Bottom - Top) div 2 - Renderer.LineThickness div 2); + Bottom := Top + Renderer.UnitsPerPixel; + end; + if csRight in CellSides then + Dec(RightRect.Right, Renderer.LineThickness); + + BottomRect := BoundsRect; + with BottomRect do + begin + Inc(Left, (Right - Left) div 2 - Renderer.LineThickness div 2); + Right := Left + Renderer.UnitsPerPixel; + Inc(Top, (Bottom - Top) div 2); + end; + if csBottom in CellSides then + Dec(BottomRect.Bottom, Renderer.LineThickness); + + if not IsRectEmpty(AButtonRect) then + begin + TopRect.Bottom := AButtonRect.Top - Renderer.LineThickness; + RightRect.Left := AButtonRect.Right + Renderer.LineThickness; + BottomRect.Top := AButtonRect.Bottom + Renderer.LineThickness; + end; + end; + end; + +const + Patterns: array[TdxPSTreeLineStyle] of TdxPSFillPatternClass = (TdxPSSolidFillPattern, TdxPSGray50FillPattern); +var + Parts: TdxPSTreeLineParts; + Pattern: TdxPSFillPatternClass; + DrawInfo: TdxTreeLinesDrawInfo; +begin + Parts := GetTreeLineParts; + Pattern := Patterns[ReportCells.TreeLineStyle]; + + CalculateDrawInfo(GetButtonBounds(DC), DrawInfo); + with DrawInfo do + begin + if tlpTop in Parts then DrawTreeLine(TopRect, Pattern); + if tlpBottom in Parts then DrawTreeLine(BottomRect, Pattern); + if tlpRight in Parts then DrawTreeLine(RightRect, Pattern); + end; +end; + +function TdxReportCellExpandButton.GetButtonBounds(DC: HDC): TRect; +begin + if ShowButton then + begin + Result := CalculateButtonBounds; + FixupRect(DC, Result); + end + else + Result := dxPSGlbl.NullRect; +end; + +procedure TdxReportCellExpandButton.ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); +begin + inherited; + ButtonSize := MulDiv(ButtonSize, APixelsNumerator, APixelsDenominator); +end; + +function TdxReportCellExpandButton.AreTreeLinesDrawn: Boolean; +begin + Result := TreeLineMode <> tlmNone; +end; + +function TdxReportCellExpandButton.CalculateButtonBounds: TRect; +var + ButtonSize: Integer; +begin + Result := BoundsRect; + with Result do + begin + ButtonSize := ActualButtonSize; + case ButtonAlignHorz of + bahLeft: + begin + Inc(Left, ButtonIndents.Left); + Right := Left + ButtonSize; + end; + bahCenter: + begin + Inc(Left, (Right - Left - ButtonSize) div 2); + Right := Left + ButtonSize; + end; + bahRight: + begin + Dec(Right, ButtonIndents.Right); + Left := Right - ButtonSize; + end; + end; + + case ButtonAlignVert of + bavTop: + begin + Inc(Top, ButtonIndents.Top); + Bottom := Top + ButtonSize; + end; + bavCenter: + begin + Inc(Top, (Bottom - Top - ButtonSize) div 2); + Bottom := Top + ButtonSize; + end; + bavBottom: + begin + Dec(Bottom, ButtonIndents.Bottom); + Top := Bottom - ButtonSize; + end; + end; + + if Right < Left then Right := Left; + if Bottom < Top then Bottom := Top; + end; +end; + +function TdxReportCellExpandButton.GetButtonAlignHorz: TdxReportCellExpandButtonAlignHorz; +begin + Result := bahCenter; +end; + +function TdxReportCellExpandButton.GetButtonAlignVert: TdxReportCellExpandButtonAlignVert; +begin + Result := bavCenter; +end; + +function TdxReportCellExpandButton.GetButtonIndents: TRect; +begin + if Renderer <> nil then + Result := MakeRect(LineThickness, LineThickness, LineThickness, LineThickness) + else + Result := NullRect; +end; + +procedure TdxReportCellExpandButton.SetButtonAlignHorz(Value: TdxReportCellExpandButtonAlignHorz); +begin +end; + +procedure TdxReportCellExpandButton.SetButtonAlignVert(Value: TdxReportCellExpandButtonAlignVert); +begin +end; + +procedure TdxReportCellExpandButton.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + ButtonInteriorColor := AReader.ReadInteger; + ButtonSize := AReader.ReadInteger; +end; + +procedure TdxReportCellExpandButton.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteInteger(ButtonInteriorColor); + AWriter.WriteInteger(ButtonSize); +end; + +function TdxReportCellExpandButton.GetActualButtonSize: Integer; +var + LineThickness: Integer; +begin + Result := ButtonSize; + + LineThickness := Renderer.LineThickness; + if (Result mod LineThickness) > (LineThickness div 2) then + Inc(Result, LineThickness - (Result mod LineThickness)) + else + Dec(Result, Result mod LineThickness); +end; + +function TdxReportCellExpandButton.GetButtonBorder3D: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatExpandButtonBorder3D); +end; + +function TdxReportCellExpandButton.GetButtonBorder3DSoft: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatExpandButtonBorder3DSoft); +end; + +function TdxReportCellExpandButton.GetButtonBorderShadow: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatExpandButtonBorderShadow); +end; + +function TdxReportCellExpandButton.GetButtonExpanded: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatExpandButtonExpanded); +end; + +function TdxReportCellExpandButton.GetButtonTransparent: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatExpandButtonTransparent); +end; + +function TdxReportCellExpandButton.GetShowButtonBorder: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatExpandButtonShowBorder); +end; + +function TdxReportCellExpandButton.GetKeepOddSize: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatExpandButtonKeepOddSize); +end; + +function TdxReportCellExpandButton.GetShowButton: Boolean; +begin + Result := GetFormatBit(dxPSGlbl.dxFormatExpandButtonVisible); +end; + +function TdxReportCellExpandButton.GetTreeLineMode: TdxPSTreeLineMode; +begin + Result := TdxPSTreeLineMode((Format and dxPSGlbl.dxFormatTreeLineModeMask) shr dxPSGlbl.dxFormatTreeLineModeOffset); +end; + +procedure TdxReportCellExpandButton.SetButtonBorder3D(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatExpandButtonBorder3D, Value); +end; + +procedure TdxReportCellExpandButton.SetButtonBorder3DSoft(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatExpandButtonBorder3DSoft, Value); +end; + +procedure TdxReportCellExpandButton.SetButtonBorderShadow(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatExpandButtonBorderShadow, Value); +end; + +procedure TdxReportCellExpandButton.SetButtonExpanded(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatExpandButtonExpanded, Value); +end; + +procedure TdxReportCellExpandButton.SetButtonTransparent(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatExpandButtonTransparent, Value); +end; + +procedure TdxReportCellExpandButton.SetKeepOddSize(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatExpandButtonKeepOddSize, Value); +end; + +procedure TdxReportCellExpandButton.SetShowButton(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatExpandButtonVisible, Value); +end; + +procedure TdxReportCellExpandButton.SetShowButtonBorder(Value: Boolean); +begin + SetFormatBit(dxPSGlbl.dxFormatExpandButtonShowBorder, Value); +end; + +procedure TdxReportCellExpandButton.SetTreeLineMode(Value: TdxPSTreeLineMode); +begin + Format := Format and not dxPSGlbl.dxFormatTreeLineModeMask or (Byte(Value) shl dxPSGlbl.dxFormatTreeLineModeOffset); +end; + +{ TdxReportCellExpandButtonEx } + +function TdxReportCellExpandButtonEx.GetButtonAlignHorz: TdxReportCellExpandButtonAlignHorz; +begin + Result := TdxReportCellExpandButtonAlignHorz((FormatEx and dxPSGlbl.dxFormatExButtonAlignHorzMask) shr dxPSGlbl.dxFormatExButtonAlignHorzOffset); +end; + +function TdxReportCellExpandButtonEx.GetButtonAlignVert: TdxReportCellExpandButtonAlignVert; +begin + Result := TdxReportCellExpandButtonAlignVert((FormatEx and dxPSGlbl.dxFormatExButtonAlignVertMask) shr dxPSGlbl.dxFormatExButtonAlignVertOffset); +end; + +function TdxReportCellExpandButtonEx.GetButtonIndents: TRect; +begin + Result := inherited GetButtonIndents; + if Renderer <> nil then + with Result do + begin + Inc(Top, 5 * LineThickness); + Inc(Bottom, 5 * LineThickness); + end; +end; + +procedure TdxReportCellExpandButtonEx.SetButtonAlignHorz(Value: TdxReportCellExpandButtonAlignHorz); +begin + FormatEx := FormatEx and not dxPSGlbl.dxFormatExButtonAlignHorzMask or (Byte(Value) shl dxPSGlbl.dxFormatExButtonAlignHorzOffset); +end; + +procedure TdxReportCellExpandButtonEx.SetButtonAlignVert(Value: TdxReportCellExpandButtonAlignVert); +begin + FormatEx := FormatEx and not dxPSGlbl.dxFormatExButtonAlignVertMask or (Byte(Value) shl dxPSGlbl.dxFormatExButtonAlignVertOffset); +end; + +procedure TdxReportCellExpandButtonEx.ReadData(AReader: TdxPSDataReader); +begin + inherited; + FormatEx := AReader.ReadInteger; +end; + +procedure TdxReportCellExpandButtonEx.WriteData(AWriter: TdxPSDataWriter); +begin + inherited; + AWriter.WriteInteger(FormatEx); +end; + +{ TdxPSExplorerChangeNotifier } + +constructor TdxPSExplorerChangeNotifier.Create(AnExplorer: TCustomdxPSExplorer); +begin + inherited Create; + Explorer := AnExplorer; +end; + +destructor TdxPSExplorerChangeNotifier.Destroy; +begin + Explorer := nil; + inherited Destroy; +end; + +procedure TdxPSExplorerChangeNotifier.SetExplorer(Value: TCustomdxPSExplorer); +begin + if FExplorer <> Value then + begin + if FExplorer <> nil then + FExplorer.UnregisterNotifier(Self); + if Value <> nil then + Value.RegisterNotifier(Self); + end; +end; + +{ TdxPSExplorerChangeNotifierAdapter } + +procedure TdxPSExplorerChangeNotifierAdapter.ExplorerRefresh(AStage: TdxPSExplorerRefreshStage); +begin +end; + +procedure TdxPSExplorerChangeNotifierAdapter.FolderPopulated(AFolder: TdxPSExplorerFolder); +begin +end; + +procedure TdxPSExplorerChangeNotifierAdapter.ItemAdded(AnItem: TCustomdxPSExplorerItem); +begin +end; + +procedure TdxPSExplorerChangeNotifierAdapter.ItemDataLoaded(AnItem: TdxPSExplorerItem); +begin +end; + +procedure TdxPSExplorerChangeNotifierAdapter.ItemDataUnloaded(AnItem: TdxPSExplorerItem); +begin +end; + +procedure TdxPSExplorerChangeNotifierAdapter.ItemDeleted(AnItem: TCustomdxPSExplorerItem); +begin +end; + +procedure TdxPSExplorerChangeNotifierAdapter.ItemParentChanged(AnItem: TCustomdxPSExplorerItem); +begin +end; + +procedure TdxPSExplorerChangeNotifierAdapter.ItemPropertiesChanged(AnItem: TCustomdxPSExplorerItem); +begin +end; + +procedure TdxPSExplorerChangeNotifierAdapter.ItemRenamed(AnItem: TCustomdxPSExplorerItem); +begin +end; + +{ TdxPSExplorerTreeChangeNotifier } + +constructor TdxPSExplorerTreeChangeNotifier.Create(ATreeContainer: TCustomdxPSExplorerTreeContainer; + ARegister: Boolean = True); +begin + Assert(ATreeContainer <> nil); + FTreeContainer := ATreeContainer; + inherited Create(TreeContainer.Explorer); +end; + +procedure TdxPSExplorerTreeChangeNotifier.ExplorerRefresh(AStage: TdxPSExplorerRefreshStage); +begin + case AStage of + ersBefore: + begin + TreeContainer.EndEdit(True); + TreeContainer.BeginUpdate; + TreeContainer.SaveState; + end; + ersAfter: + begin + if Explorer <> nil then Explorer.BuildTree(TreeContainer); + TreeContainer.RestoreState; + TreeContainer.RefreshSorting(nil); + TreeContainer.EndUpdate; + end; + end; +end; + +procedure TdxPSExplorerTreeChangeNotifier.FolderPopulated(AFolder: TdxPSExplorerFolder); +begin + if Explorer <> nil then Explorer.PopulateTreeFolder(TreeContainer, AFolder); +end; + +procedure TdxPSExplorerTreeChangeNotifier.ItemAdded(AnItem: TCustomdxPSExplorerItem); +begin + with TreeContainer do + begin + AddItem(CreationParent, AnItem); + SelectedItem := AnItem; + if Control.Focused then BeginEdit(True); + end; +end; + +procedure TdxPSExplorerTreeChangeNotifier.ItemDataLoaded(AnItem: TdxPSExplorerItem); +begin + TreeContainer.MakeItemVisible(AnItem); + TreeContainer.InvalidateItem(AnItem); +end; + +procedure TdxPSExplorerTreeChangeNotifier.ItemDataUnloaded(AnItem: TdxPSExplorerItem); +begin + TreeContainer.InvalidateItem(AnItem); +end; + +procedure TdxPSExplorerTreeChangeNotifier.ItemDeleted(AnItem: TCustomdxPSExplorerItem); +begin + TreeContainer.DeleteItem(AnItem); +end; + +procedure TdxPSExplorerTreeChangeNotifier.ItemParentChanged(AnItem: TCustomdxPSExplorerItem); +begin + TreeContainer.MoveItem(AnItem); +end; + +procedure TdxPSExplorerTreeChangeNotifier.ItemPropertiesChanged(AnItem: TCustomdxPSExplorerItem); +begin + if TreeContainer.SelectedItem = AnItem then + TreeContainer.SelectedItemText := AnItem.DisplayName; +end; + +procedure TdxPSExplorerTreeChangeNotifier.ItemRenamed(AnItem: TCustomdxPSExplorerItem); +begin + TreeContainer.RenameItem(AnItem); +end; + +{ TCustomdxPSExplorerTreeContainer } + +constructor TCustomdxPSExplorerTreeContainer.Create(AnExplorer: TCustomdxPSExplorer; + AHost: IdxPSExplorerTreeContainerHost); +begin + Assert(AnExplorer <> nil); + Assert(AHost <> nil); + + inherited Create; + FExplorer := AnExplorer; + FHost := AHost; + + CreateTreeContainer; + FChangeNotifier := TdxPSExplorerTreeChangeNotifier.Create(Self, True); +end; + +destructor TCustomdxPSExplorerTreeContainer.Destroy; +begin + FreeAndNil(FControl); + FreeAndNil(FChangeNotifier); + inherited Destroy; +end; + +class function TCustomdxPSExplorerTreeContainer.ControlClass: TWinControlClass; +begin + Result := nil; +end; + +class procedure TCustomdxPSExplorerTreeContainer.Register; +begin + dxPSExplorerTreeContainerFactory.Register(Self); +end; + +class procedure TCustomdxPSExplorerTreeContainer.Unregister; +begin + dxPSExplorerTreeContainerFactory.Unregister(Self); +end; + +procedure TCustomdxPSExplorerTreeContainer.BeginUpdate; +begin +end; + +procedure TCustomdxPSExplorerTreeContainer.EndUpdate; +begin +end; + +function TCustomdxPSExplorerTreeContainer.CanCreateFolder: Boolean; +begin + Result := Explorer.CanCreateFolder and not IsEditing and IsFolderSelected; +end; + +function TCustomdxPSExplorerTreeContainer.CanCreateItem: Boolean; +begin + Result := Explorer.CanCreateItem and not IsEditing; +end; + +function TCustomdxPSExplorerTreeContainer.CanDeleteSelection: Boolean; +begin + Result := not IsEditing and Explorer.CanDelete(SelectedItem); +end; + +function TCustomdxPSExplorerTreeContainer.CanLoadSelectedItemData: Boolean; +begin + Result := (Control <> nil) and Control.Focused and not IsEditing and + IsItemSelected and TdxPSExplorerItem(SelectedItem).CanLoadData; +end; + +function TCustomdxPSExplorerTreeContainer.CanRefresh: Boolean; +begin + Result := not IsEditing; +end; + +function TCustomdxPSExplorerTreeContainer.CanRenameSelectedItem: Boolean; +begin + Result := not IsEditing and Explorer.CanRename(SelectedItem); +end; + +function TCustomdxPSExplorerTreeContainer.CanShowPropertySheetsForSelectedItem: Boolean; +begin + Result := not IsEditing and (SelectedItem <> nil) and SelectedItem.HasPropertySheets; +end; + +function TCustomdxPSExplorerTreeContainer.CanUnloadItemData: Boolean; +begin + Result := not IsEditing and (Host.ReportLink <> nil) and + Host.ReportLink.CanUnloadData and (Explorer.LoadedItem <> nil); +end; + +function TCustomdxPSExplorerTreeContainer.CreateItem: TdxPSExplorerItem; +begin + if CanCreateItem then + Result := Explorer.CreateNewItem(CreationParent, Host.ReportLink) + else + Result := nil; +end; + +procedure TCustomdxPSExplorerTreeContainer.DeleteSelection(AShowMessage: Boolean = True); +begin + if CanDeleteSelection and (not AShowMessage or dxPSUtl.MessageQuestion(SelectedItem.DeleteMessageText)) then + SelectedItem.Delete; +end; + +function TCustomdxPSExplorerTreeContainer.IsSelectedItemCurrentlyLoaded: Boolean; +var + Item: TCustomdxPSExplorerItem; +begin + Item := SelectedItem; + Result := (Item is TdxPSExplorerItem) and TdxPSExplorerItem(Item).IsCurrentlyLoaded; +end; + +procedure TCustomdxPSExplorerTreeContainer.LoadSelectedItemData; +begin + if CanLoadSelectedItemData then + Explorer.LoadItemData(TdxPSExplorerItem(SelectedItem), Host.ReportLink); +end; + +procedure TCustomdxPSExplorerTreeContainer.RenameSelectedItem; +begin + if CanRenameSelectedItem then BeginEdit(True); +end; + +function TCustomdxPSExplorerTreeContainer.ShowSelectedItemPropertySheets: Boolean; +begin + Result := CanShowPropertySheetsForSelectedItem and TdxPSExplorerItem(SelectedItem).ShowPropertySheets; +end; + +procedure TCustomdxPSExplorerTreeContainer.UnloadItemData; +begin + if CanUnloadItemData then + Explorer.UnloadItemData(Explorer.LoadedItem); +end; + +function TCustomdxPSExplorerTreeContainer.CanFocus: Boolean; +begin + Result := (Control <> nil) and Control.CanFocus; +end; + +procedure TCustomdxPSExplorerTreeContainer.SetFocus; +begin + if (Control <> nil) and Control.CanFocus and not IsRectEmpty(Control.ClientRect) then + Control.SetFocus; +end; + +procedure TCustomdxPSExplorerTreeContainer.RefreshSorting(ANode: TObject); +begin +end; + +procedure TCustomdxPSExplorerTreeContainer.RefreshSorting(AFolder: TdxPSExplorerFolder); +begin + +end; + +procedure TCustomdxPSExplorerTreeContainer.DeleteItem(AnItem: TCustomdxPSExplorerItem); +begin + EndEdit(False); +end; + +procedure TCustomdxPSExplorerTreeContainer.InvalidateItem(AnItem: TCustomdxPSExplorerItem); +begin +end; + +procedure TCustomdxPSExplorerTreeContainer.RestoreState; +begin +end; + +procedure TCustomdxPSExplorerTreeContainer.SaveState; +begin +end; + +procedure TCustomdxPSExplorerTreeContainer.CreateTreeContainer; +begin + if FControl = nil then + begin + FControl := ControlClass.Create(nil); + FControl.Parent := Host.TreeContainerParent; + InitializeTreeContainer; + end; +end; + +procedure TCustomdxPSExplorerTreeContainer.InitializeTreeContainer; +begin +end; + +procedure TCustomdxPSExplorerTreeContainer.ProcessKeyDown(var Key: Word; Shift: TShiftState); +var + PopupMenu: TPopupMenu; + MenuItem: TMenuItem; +begin + PopupMenu := dxPSUtl.Control_GetPopupMenu(Control); + if PopupMenu <> nil then + begin + MenuItem := PopupMenu.FindItem(Key, fkShortCut); + if (MenuItem <> nil) and MenuItem.Enabled and MenuItem.Visible then + begin + MenuItem.Click; + Key := 0; + Exit; + end + end; + + if not IsEditing then + case Key of + VK_F2: + if Shift = [] then BeginEdit(True); + VK_F5: + if Shift = [] then Explorer.Refresh; + VK_DELETE: + if Shift = [] then DeleteSelection(True); + VK_ESCAPE: + Host.UpdateState; + VK_RETURN: + if ssCtrl in Shift then LoadSelectedItemData; + end; +end; + +procedure TCustomdxPSExplorerTreeContainer.ProcessKeyPress(var Key: Char); +begin + if IsEditing and not Explorer.AcceptItemNameChar(SelectedItem, Key) then + Key := #0; +end; + +{ TdxPSExplorerTreeBuilder } + +class procedure TdxPSExplorerTreeBuilder.Register; +begin + dxPSExplorerTreeBuilderFactory.Register(Self); +end; + +class procedure TdxPSExplorerTreeBuilder.Unregister; +begin + dxPSExplorerTreeBuilderFactory.Unregister(Self); +end; + +class procedure TdxPSExplorerTreeBuilder.BuildTree(AnExplorer: TCustomdxPSExplorer; + ATreeContainer: TCustomdxPSExplorerTreeContainer); +begin + with ATreeContainer do + begin + BeginUpdate; + try + Clear; + CreateFolderNode(ATreeContainer, nil, AnExplorer.Root); + ExpandItem(AnExplorer.Root); + SelectedItem := AnExplorer.Root; + finally + EndUpdate; + end; + end; +end; + +class procedure TdxPSExplorerTreeBuilder.CreateFolderNode(ATreeContainer: TCustomdxPSExplorerTreeContainer; + AParent, AFolder: TdxPSExplorerFolder); +begin + CreateItemNode(ATreeContainer, AParent, AFolder); + PopulateTreeFolder(ATreeContainer, AFolder); +end; + +class procedure TdxPSExplorerTreeBuilder.CreateItemNode(ATreeContainer: TCustomdxPSExplorerTreeContainer; + AParent: TdxPSExplorerFolder; AnItem: TCustomdxPSExplorerItem); +begin + ATreeContainer.AddItem(AParent, AnItem); +end; + +class procedure TdxPSExplorerTreeBuilder.PopulateTreeFolder(ATreeContainer: TCustomdxPSExplorerTreeContainer; + AFolder: TdxPSExplorerFolder); +var + I: Integer; +begin + with ATreeContainer do + begin + BeginUpdate; + try + for I := 0 to AFolder.FolderCount - 1 do + CreateFolderNode(ATreeContainer, AFolder, AFolder.Folders[I]); + for I := 0 to AFolder.ItemCount - 1 do + CreateItemNode(ATreeContainer, AFolder, AFolder.Items[I]); + finally + EndUpdate; + end; + //RefreshSorting(AFolder); {3.1} + end; +end; + +{ TdxPSExplorerItemPropertySheets } + +constructor TCustomdxPSExplorerItemPropertySheets.CreateEx(AnExplorerItem: TCustomdxPSExplorerItem); +begin + Create(nil); + FExplorerItem := AnExplorerItem; +end; + +class function TCustomdxPSExplorerItemPropertySheets.Execute(AnExplorerItem: TCustomdxPSExplorerItem): Boolean; +begin + with FormClass.CreateEx(AnExplorerItem) do + try + Initialize; + try + Result := ShowModal = mrOK; + finally + Done; + end; + finally + Free; + end; +end; + +function TCustomdxPSExplorerItemPropertySheets.ExplorerItem: TCustomdxPSExplorerItem; +begin + Result := FExplorerItem; +end; + +procedure TCustomdxPSExplorerItemPropertySheets.Done; +begin +end; + +procedure TCustomdxPSExplorerItemPropertySheets.Initialize; +begin +end; + +class function TCustomdxPSExplorerItemPropertySheets.FormClass: TCustomdxPSExplorerItemPropertySheetsClass; +begin + Result := TCustomdxPSExplorerItemPropertySheetsClass(Self); +end; + +{ TCustomdxPSExplorerItemComparator } + +class function TCustomdxPSExplorerItemComparator.CompareItems( + AnItem1, AnItem2: Pointer): Integer; +begin + Result := TCustomdxPSExplorerItem(AnItem1).CompareTo(TCustomdxPSExplorerItem(AnItem2)); +end; + +{ TCustomdxPSExplorerItemHelper } + +class function TCustomdxPSExplorerItemHelper.GetHasChildren(AFolder: TdxPSExplorerFolder): Boolean; +begin + Result := False; +end; + +class function TCustomdxPSExplorerItemHelper.GetImageIndex(AnItem: TCustomdxPSExplorerItem): Integer; +begin + Result := AnItem.GetImageIndex; +end; + +class function TCustomdxPSExplorerItemHelper.GetSelectedIndex(AnItem: TCustomdxPSExplorerItem): Integer; +begin + Result := AnItem.GetSelectedIndex; +end; + +class procedure TCustomdxPSExplorerItemHelper.SetHasChildren(AFolder: TdxPSExplorerFolder; Value: Boolean); +begin +end; + +{ TCustomdxPSExplorerItem } + +constructor TCustomdxPSExplorerItem.Create(AnExplorer: TCustomdxPSExplorer; + AParent: TdxPSExplorerFolder); +begin + inherited Create; + Assert(AnExplorer <> nil); + FExplorer := AnExplorer; + Parent := AParent; + FName := GetNewName(nil); + FWindowHandle := dxPSUtl.dxAllocatehWnd(WndProc); +end; + +destructor TCustomdxPSExplorerItem.Destroy; +begin + dxPSUtl.dxDeallocatehWnd(FWindowHandle); + if Parent <> nil then Parent.Remove(Self); + inherited; +end; + +function TCustomdxPSExplorerItem.Explorer: TCustomdxPSExplorer; +begin + Result := FExplorer; +end; + +function TCustomdxPSExplorerItem.CanAccept(AnItem: TCustomdxPSExplorerItem): Boolean; +begin + Result := False; +end; + +function TCustomdxPSExplorerItem.CanDelete: Boolean; +begin + Result := True; +end; + +function TCustomdxPSExplorerItem.CanMove: Boolean; +begin + Result := (Explorer = nil) or Explorer.CanMove(Self); +end; + +function TCustomdxPSExplorerItem.CanMoveTo(AParent: TCustomdxPSExplorerItem): Boolean; +begin + Result := ((Explorer = nil) or Explorer.CanMoveTo(Self, AParent)) and + (AParent <> nil) and AParent.CanAccept(Self); +end; + +function TCustomdxPSExplorerItem.CanRename: Boolean; +begin + Result := (Explorer = nil) or Explorer.CanRename(Self); +end; + +function TCustomdxPSExplorerItem.CanRenameTo(const AName: string): Boolean; +begin + Result := (Explorer = nil) or Explorer.CanRenameTo(Self, AName); +end; + +procedure TCustomdxPSExplorerItem.Delete; +begin + if CanDelete and (Explorer <> nil) then + Explorer.Delete(Self); +end; + +function TCustomdxPSExplorerItem.GetUniqueID(out AnUniqueID: TBytes): Integer; +begin + SetLength(AnUniqueID, 0); + Result := 0; +end; + +function TCustomdxPSExplorerItem.HasAsParent(AnItem: TCustomdxPSExplorerItem): Boolean; +var + ItemParent: TCustomdxPSExplorerItem; +begin + Result := not ((AnItem = nil) or (Parent = Self)); + if Result then + begin + ItemParent := Parent; + while (ItemParent <> nil) and (ItemParent <> AnItem) do + ItemParent := ItemParent.Parent; + Result := ItemParent <> nil; + end; +end; + +function TCustomdxPSExplorerItem.IsNameChanged(const ANewName: string): Boolean; +begin + Result := not dxSameStr(ANewName, Name); +end; + +class function TCustomdxPSExplorerItem.HasPropertySheets: Boolean; +begin + Result := PropertySheetsClass <> nil; +end; + +class function TCustomdxPSExplorerItem.PropertySheetsClass: TCustomdxPSExplorerItemPropertySheetsClass; +begin + Result := nil; +end; + +function TCustomdxPSExplorerItem.ShowPropertySheets: Boolean; +begin + Result := HasPropertySheets and PropertySheetsClass.Execute(Self); +end; + +function TCustomdxPSExplorerItem.CannotRenameMessageText(const AOldName, ANewName: string): string; +begin + Result := ''; +end; + +function TCustomdxPSExplorerItem.DeleteMessageText: string; +begin + Result := ''; +end; + +function TCustomdxPSExplorerItem.OverwriteMessageText(Dest: TCustomdxPSExplorerItem): string; +begin + Result := ''; +end; + +function TCustomdxPSExplorerItem.GetDisplayName: string; +begin + Result := Name; +end; + +function TCustomdxPSExplorerItem.CompareTo(AnItem: TCustomdxPSExplorerItem): Integer; +begin + Result := 0; +end; + +function TCustomdxPSExplorerItem.DoDelete: Boolean; +begin + Result := True; +end; + +function TCustomdxPSExplorerItem.DoMove(AParent: TdxPSExplorerFolder): Boolean; +begin + Result := True; +end; + +function TCustomdxPSExplorerItem.DoRename(var ANewName: string): Boolean; +begin + Result := True; +end; + +function TCustomdxPSExplorerItem.GetImageIndex: Integer; +begin + Result := -1; +end; + +function TCustomdxPSExplorerItem.GetInfoTip: string; +begin + Result := ''; +end; + +function TCustomdxPSExplorerItem.GetNewName(AReportLink: TBasedxReportLink): string; +begin + Result := ''; +end; + +function TCustomdxPSExplorerItem.GetSelectedIndex: Integer; +begin + Result := -1; +end; + +procedure TCustomdxPSExplorerItem.InternalDelete; +begin + if IsWindow(FWindowHandle) then + PostMessage(FWindowHandle, CM_FREEEXPLORERITEM, 0, 0); +end; + +procedure TCustomdxPSExplorerItem.InternalMove(AParent: TdxPSExplorerFolder); +begin + if Parent <> nil then Parent.Remove(Self); + if AParent <> nil then AParent.Add(Self); +end; + +procedure TCustomdxPSExplorerItem.InternalRename(const AName: string); +begin + FName := AName; +end; + +procedure TCustomdxPSExplorerItem.SetName(const Value: string); +begin + if (FName <> Value) and CanRenameTo(Value) then + Explorer.RenameTo(Self, Value); +end; + +function GetItemStateInfoSize: Integer; +begin + Result := SizeOf(TCustomdxPSExplorerItemStateInfo); +end; + +function TCustomdxPSExplorerItem.GetItemStateInfo: TCustomdxPSExplorerItemStateInfo; +var + Bytes: TBytes; +begin + FillChar(Result, GetItemStateInfoSize, 0); + Result.Count := 0; + Result.UniqueIDSize := GetUniqueID(Bytes); +end; + +procedure TCustomdxPSExplorerItem.WriteState(AStream: TStream); +var + ItemInfo: TCustomdxPSExplorerItemStateInfo; + Bytes: TBytes; +begin + ItemInfo := GetItemStateInfo; + AStream.WriteBuffer(ItemInfo, GetItemStateInfoSize); + if ItemInfo.UniqueIDSize <> 0 then + begin + GetUniqueID(Bytes); + AStream.WriteBuffer(Pointer(Bytes)^, ItemInfo.UniqueIDSize); + end; +end; + +procedure TCustomdxPSExplorerItem.WndProc(var Message: TMessage); +begin + with Message do + if Msg = CM_FREEEXPLORERITEM then + Free + else + Result := DefWindowProc(FWindowHandle, Msg, wParam, lParam); +end; + +procedure TCustomdxPSExplorerItem.SetParent(Value: TdxPSExplorerFolder); +begin + if (FParent <> Value) and CanMoveTo(Value) then + Explorer.MoveTo(Self, Value); +end; + +{ TdxPSExplorerFolderHelper } + +class function TdxPSExplorerFolderHelper.GetHasChildren(AFolder: TdxPSExplorerFolder): Boolean; +begin + Result := AFolder.HasChildren; +end; + +class procedure TdxPSExplorerFolderHelper.SetHasChildren(AFolder: TdxPSExplorerFolder; + Value: Boolean); +begin + AFolder.HasChildren := Value; +end; + +{ TdxPSExplorerFolder } + +constructor TdxPSExplorerFolder.Create(AnExplorer: TCustomdxPSExplorer; + AParent: TdxPSExplorerFolder); +begin + inherited Create(AnExplorer, AParent); + FFolders := TList.Create; + FItems := TList.Create; +end; + +destructor TdxPSExplorerFolder.Destroy; +begin + FreeAndNilFolders; + FreeAndNilItems; + inherited Destroy; +end; + +function TdxPSExplorerFolder.CanAccept(AnItem: TCustomdxPSExplorerItem): Boolean; +begin + Result := (AnItem <> Self) and (AnItem.Parent <> Self) and not HasAsParent(AnItem); +end; + +function TdxPSExplorerFolder.CanRenameTo(const AName: string): Boolean; +begin + Result := inherited CanRenameTo(AName) and ((Parent = nil) or (Parent.FolderByName(AName) = nil)); +end; + +function TdxPSExplorerFolder.CreateFolder: TdxPSExplorerFolder; +begin + Result := Explorer.CreateNewFolder(Self); +end; + +function TdxPSExplorerFolder.CreateItem(AReportLink: TBasedxReportLink): TdxPSExplorerItem; +begin + Result := Explorer.CreateNewItem(Self, AReportLink); +end; + +procedure TdxPSExplorerFolder.Populate; +begin + Explorer.PopulateFolder(Self); +end; + +procedure TdxPSExplorerFolder.Delete; +begin + if CanDelete then + begin + DeleteFolders; + DeleteItems; + end; + inherited Delete; +end; + +procedure TdxPSExplorerFolder.DeleteFolders; +var + I: Integer; +begin + for I := FolderCount - 1 downto 0 do + Folders[I].Delete; +end; + +procedure TdxPSExplorerFolder.DeleteItems; +var + I: Integer; +begin + for I := ItemCount - 1 downto 0 do + Items[I].Delete; +end; + +function TdxPSExplorerFolder.HasFolders: Boolean; +begin + Result := FolderCount <> 0; +end; + +function TdxPSExplorerFolder.HasItems: Boolean; +begin + Result := ItemCount <> 0; +end; + +function TdxPSExplorerFolder.HasLoadedItem: Boolean; +var + I: Integer; +begin + if Explorer.LoadedItem <> nil then + begin + Result := True; + for I := 0 to ItemCount - 1 do + if Items[I] = Explorer.LoadedItem then Exit; + for I := 0 to FolderCount - 1 do + if Folders[I].HasLoadedItem then Exit; + Result := False; + end + else + Result := False; +end; + +function TdxPSExplorerFolder.FolderByName(const AName: string): TdxPSExplorerFolder; +var + I: Integer; +begin + Populate; + for I := 0 to FolderCount - 1 do + begin + Result := Folders[I]; + if Result.Name = AName then Exit; + end; + Result := nil; +end; + +function TdxPSExplorerFolder.ItemByName(const AName: string): TdxPSExplorerItem; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + begin + Result := Items[I]; + if Result.Name = AName then Exit; + end; + Result := nil; +end; + +function TdxPSExplorerFolder.CannotRenameMessageText(const AOldName, ANewName: string): string; +begin + Result := Format(cxGetResourceString(@sdxCannotRenameFolderText), [AOldName, ANewName]); +end; + +function TdxPSExplorerFolder.DeleteMessageText: string; +begin + if HasFolders or HasItems then + Result := Format(cxGetResourceString(@sdxDeleteNonEmptyFolderMessageText), [DisplayName]) + else + Result := Format(cxGetResourceString(@sdxDeleteFolderMessageText), [DisplayName]); +end; + +function TdxPSExplorerFolder.OverwriteMessageText(Dest: TCustomdxPSExplorerItem): string; +begin + Result := Format(cxGetResourceString(@sdxOverwriteFolderMessageText), [Dest.DisplayName, DisplayName]); +end; + +function TdxPSExplorerFolder.CompareTo(AnItem: TCustomdxPSExplorerItem): Integer; +begin + if AnItem is TdxPSExplorerFolder then + Result := CompareText(DisplayName, AnItem.DisplayName) + else + Result := -1; +end; + +function TdxPSExplorerFolder.GetItemStateInfo: TCustomdxPSExplorerItemStateInfo; +begin + Result := inherited GetItemStateInfo; + Result.Count := FolderCount + ItemCount; +end; + +procedure TdxPSExplorerFolder.WriteState(AStream: TStream); +var + I: Integer; +begin + inherited; + for I := 0 to FolderCount - 1 do + Folders[I].WriteState(AStream); + for I := 0 to ItemCount - 1 do + Items[I].WriteState(AStream); +end; + +procedure TdxPSExplorerFolder.LoadData; +begin + Explorer.LoadData(Self); +end; + +function TdxPSExplorerFolder.GetImageIndex: Integer; +begin + Result := iiExplorerFolderCollapsed; +end; + +function TdxPSExplorerFolder.GetNewName(AReportLink: TBasedxReportLink): string; +var + Index: Integer; + Template: string; +begin + Result := cxGetResourceString(@sdxNewExplorerFolderItem); + if (Parent <> nil) and (Parent.FolderByName(Result) <> nil) then + begin + Index := 1; + Template := Result; + repeat + Inc(Index); + Result := Template + ' (' + IntToStr(Index) + ')'; + until Parent.FolderByName(Result) = nil; + end; +end; + +function TdxPSExplorerFolder.GetSelectedIndex: Integer; +begin + Result := iiExplorerFolderExpanded; +end; + +procedure TdxPSExplorerFolder.Add(AnItem: TCustomdxPSExplorerItem); +begin + GetItemList(AnItem).Add(AnItem); + AnItem.FParent := Self; + HasChildren := True; +end; + +procedure TdxPSExplorerFolder.Remove(AnItem: TCustomdxPSExplorerItem); +begin + AnItem.FParent := nil; + GetItemList(AnItem).Remove(AnItem); + if FolderCount + ItemCount = 0 then + HasChildren := False; +end; + +procedure TdxPSExplorerFolder.FreeAndNilFolders; +var + I: Integer; +begin + for I := FolderCount - 1 downto 0 do + Folders[I].Free; + FreeAndNil(FFolders); +end; + +procedure TdxPSExplorerFolder.FreeAndNilItems; +var + I: Integer; +begin + for I := ItemCount - 1 downto 0 do + Items[I].Free; + FreeAndNil(FItems); +end; + +function TdxPSExplorerFolder.GetFolder(Index: Integer): TdxPSExplorerFolder; +begin + Result := TdxPSExplorerFolder(FFolders[Index]); +end; + +function TdxPSExplorerFolder.GetFolderCount: Integer; +begin + if FFolders <> nil then + Result := FFolders.Count + else + Result := 0; +end; + +function TdxPSExplorerFolder.GetHasChildren: Boolean; +begin + Result := FHasChildren or (FolderCount + ItemCount <> 0); +end; + +function TdxPSExplorerFolder.GetIsRoot: Boolean; +begin + Result := Self = Explorer.Root; +end; + +function TdxPSExplorerFolder.GetItem(Index: Integer): TdxPSExplorerItem; +begin + Result := TdxPSExplorerItem(FItems[Index]); +end; + +function TdxPSExplorerFolder.GetItemCount: Integer; +begin + if FItems <> nil then + Result := FItems.Count + else + Result := 0; +end; + +function TdxPSExplorerFolder.GetItemList(AnItem: TCustomdxPSExplorerItem): TList; +begin + Result := GetItemList(TCustomdxPSExplorerItemClass(AnItem.ClassType)); +end; + +function TdxPSExplorerFolder.GetItemList(AnItemClass: TCustomdxPSExplorerItemClass): TList; +begin + if AnItemClass.InheritsFrom(TdxPSExplorerItem) then + Result := FItems + else + if AnItemClass.InheritsFrom(TdxPSExplorerFolder) then + Result := FFolders + else + Result := nil; +end; + +procedure TdxPSExplorerFolder.SetHasChildren(Value: Boolean); +begin + FHasChildren := Value or (FolderCount + ItemCount <> 0); +end; + +{ TdxPSExplorerItem } + +constructor TdxPSExplorerItem.Create(AnExplorer: TCustomdxPSExplorer; AParent: TdxPSExplorerFolder); +begin + inherited; + FReportDocument := TdxPSReportDocument.Create(nil); + FReportDocument.OnChanged := DocumentChanged; +end; + +destructor TdxPSExplorerItem.Destroy; +begin + FreeAndNil(FReportDocument); + inherited; +end; + +function TdxPSExplorerItem.CanLoadData: Boolean; +begin + Result := not HasInvalidData and not IsCurrentlyLoaded; +end; + +function TdxPSExplorerItem.CanRenameTo(const AName: string): Boolean; +begin + Result := inherited CanRenameTo(AName) and ((Parent = nil) or (Parent.ItemByName(AName) = nil)); +end; + +function TdxPSExplorerItem.CannotRenameMessageText(const AOldName, ANewName: string): string; +begin + Result := Format(cxGetResourceString(@sdxCannotRenameItemText), [AOldName, ANewName]); +end; + +function TdxPSExplorerItem.DataLoadErrorText: string; +begin + Result := cxGetResourceString(@sdxDataLoadErrorText); +end; + +function TdxPSExplorerItem.DeleteMessageText: string; +begin + Result := Format(cxGetResourceString(@sdxDeleteItemMessageText), [DisplayName]); +end; + +function TdxPSExplorerItem.OverwriteMessageText(Dest: TCustomdxPSExplorerItem): string; +begin + Result := Format(cxGetResourceString(@sdxOverwriteItemMessageText), [Dest.DisplayName, DisplayName]); +end; + +function TdxPSExplorerItem.CreateDataStream(AMode: TdxPSStreamMode): TStream; +begin + Result := Explorer.CreateItemDataStream(Self, AMode); +end; + +procedure TdxPSExplorerItem.RetrieveReportData(AReportLink: TBasedxReportLink); +var + Stream: TStream; +begin + if AReportLink <> nil then + begin + Stream := CreateDataStream(smWrite); + if Stream <> nil then + try + AReportLink.SaveDataToStream(Stream); + finally + Stream.Free; + end; + end; +end; + +function TdxPSExplorerItem.IsLoading: Boolean; +begin + Result := (Explorer <> nil) and Explorer.IsLoading; +end; + +procedure TdxPSExplorerItem.Load(AReportLink: TBasedxReportLink); +begin + if Explorer <> nil then + Explorer.LoadItemData(Self, AReportLink); +end; + +procedure TdxPSExplorerItem.Unload; +begin + Explorer.UnloadItemData(Self); +end; + +class function TdxPSExplorerItem.PropertySheetsClass: TCustomdxPSExplorerItemPropertySheetsClass; +begin + Result := TdxfmPSReportProperties; +end; + +function TdxPSExplorerItem.CompareTo(AnItem: TCustomdxPSExplorerItem): Integer; +begin + if AnItem is TdxPSExplorerItem then + Result := CompareText(DisplayName, AnItem.DisplayName) + else + Result := 1; +end; + +function TdxPSExplorerItem.DoDelete: Boolean; +begin + if IsCurrentlyLoaded then Unload; + Result := inherited DoDelete; +end; + +function TdxPSExplorerItem.GetFormCaption: string; +begin + Result := Name; +end; + +function TdxPSExplorerItem.GetImageIndex: Integer; +begin + if HasInvalidData then + Result := iiExplorerItemHasInvalidData + else + Result := iiExplorerItem; +end; + +function TdxPSExplorerItem.GetInfoTip: string; +begin + Result := ReportDocument.InfoTip; +end; + +function TdxPSExplorerItem.GetNewName(AReportLink: TBasedxReportLink): string; +var + Index: Integer; + Template: string; +begin + Result := cxGetResourceString(@sdxNewReport); + if AReportLink <> nil then + Result := AReportLink.GetNewReportStorageName; + if (Parent <> nil) and (Parent.ItemByName(Result) <> nil) then + begin + Index := 1; + Template := Result; + repeat + Inc(Index); + Result := Template + ' (' + IntToStr(Index) + ')'; + until Parent.ItemByName(Result) = nil; + end; +end; + +function TdxPSExplorerItem.GetSelectedIndex: Integer; +begin + if HasInvalidData then + Result := iiExplorerItemHasInvalidData + else + Result := iiExplorerItem; +end; + +procedure TdxPSExplorerItem.InternalDelete; +begin + SaveDocument; + inherited; +end; + +procedure TdxPSExplorerItem.DocumentChanged(Sender: TObject); +begin + if not IsLoading then + begin + Name := ReportDocument.Caption; + Explorer.NotifyItemPropertiesChanged(Self); + end; +end; + +procedure TdxPSExplorerItem.SaveDocument; +var + Stream: TStream; + OffsetTable: TdxPSDataStorageOffsetTable; + P: Integer; + Writer: TdxPSDataWriter; +begin + Stream := CreateDataStream(smWrite); + if Stream <> nil then + try + OffsetTable := TBasedxReportLink.ExtractOffsetTable(Stream, True); + try + P := Stream.Position; + try + Stream.Position := OffsetTable.Document; + Writer := TBasedxReportLink.CreateDataWriter(Stream); + try + ReportDocument.WriteData(Writer); + finally + Writer.Free; + end; + finally + Stream.Position := P; + end; + finally + OffsetTable.Free; + end; + finally + Stream.Free; + end; +end; + +procedure TdxPSExplorerItem.SetReportData(AReportLink: TBasedxReportLink); +var + Stream: TStream; +begin + if AReportLink <> nil then + begin + Stream := CreateDataStream(smRead); + if Stream <> nil then + try + try + AReportLink.LoadDataFromStream(Stream); + except + AReportLink.FinalizeDataStream; + HasInvalidData := True; + raise; + end; + finally + Stream.Free; + end; + end; +end; + +function TdxPSExplorerItem.GetIsCurrentlyLoaded: Boolean; +begin + Result := Explorer.LoadedItem = Self; +end; + +procedure TdxPSExplorerItem.SetHasInvalidData(Value: Boolean); +begin + if FHasInvalidData <> Value then + begin + FHasInvalidData := Value; + end; +end; + +{ TCustomdxPSExplorerContextCommand } + +constructor TCustomdxPSExplorerContextCommand.Create(AnExplorer: TCustomdxPSExplorer); +begin + inherited Create; + FBitmap := TBitmap.Create; + FExplorer := AnExplorer; +end; + +destructor TCustomdxPSExplorerContextCommand.Destroy; +begin + FBitmap.Free; + inherited; +end; + +function TCustomdxPSExplorerContextCommand.Enabled: Boolean; +begin + Result := True; +end; + +procedure TCustomdxPSExplorerContextCommand.Execute; +begin +end; + +function TCustomdxPSExplorerContextCommand.Explorer: TCustomdxPSExplorer; +begin + Result := FExplorer; +end; + +procedure TCustomdxPSExplorerContextCommand.SetBitmap(Value: TBitmap); +begin + Bitmap.Assign(Value); +end; + +{ TdxPSExplorerContextCommandSeparator } + +constructor TdxPSExplorerContextCommandSeparator.Create(AnExplorer: TCustomdxPSExplorer); +begin + inherited; + Caption := dxPSGlbl.cMenuSeparator; +end; + +function TdxPSExplorerContextCommandSeparator.Enabled: Boolean; +begin + Result := False; +end; + +{ TdxPSExplorerRefreshContextCommand } + +constructor TdxPSExplorerRefreshContextCommand.Create(AnExplorer: TCustomdxPSExplorer); +begin + inherited; + Caption := cxGetResourceString(@sdxMenuExplorerRefresh); + Hint := cxGetResourceString(@sdxHintExplorerRefresh); + ShortCut := Menus.TextToShortCut('F5'); + Bitmap_LoadFromResourceName(Bitmap, IDB_DXPSREFRESH); + Bitmap.Transparent := True; +end; + +procedure TdxPSExplorerRefreshContextCommand.Execute; +begin + Explorer.Refresh; +end; + +{ TCustomdxPSExplorer } + +constructor TCustomdxPSExplorer.Create(AOwner: TComponent); +begin + inherited; + FNotifiers := TList.Create; + FCommands := TList.Create; +end; + +destructor TCustomdxPSExplorer.Destroy; +begin + FreeAndNilCommands; + ReleaseAndNilNotifiers; + FreeAndNil(FRoot); + inherited; +end; + +function TCustomdxPSExplorer.LoadedItem: TdxPSExplorerItem; +begin + Result := FLoadedItem; +end; + +function TCustomdxPSExplorer.CanCreateFolder: Boolean; +begin + Result := True; +end; + +function TCustomdxPSExplorer.CanCreateItem: Boolean; +begin + Result := True; +end; + +function TCustomdxPSExplorer.CreateNewFolder(AParent: TdxPSExplorerFolder): TdxPSExplorerFolder; +begin + Include(FState, esFolderCreating); + try + Result := GetFolderClass.Create(Self, AParent); + //DoCreateNewFolder(Result); + NotifyItemAdded(Result); + finally + Exclude(FState, esFolderCreating); + end; +end; + +function TCustomdxPSExplorer.CreateNewItem(AParent: TdxPSExplorerFolder; + AReportLink: TBasedxReportLink): TdxPSExplorerItem; +begin + Include(FState, esItemCreating); + try + Result := GetItemClass.Create(Self, AParent); + Result.FName := Result.GetNewName(AReportLink); + AReportLink.ReportDocument.RetrievePreview; + with Result.ReportDocument do + begin + BeginUpdate; + try + Assign(AReportLink.ReportDocument); + finally + CancelUpdate; + end; + end; + + //DoCreateNewItem(Result); + NotifyItemAdded(Result); + finally + Exclude(FState, esItemCreating); + end; +end; + +procedure TCustomdxPSExplorer.BuildTree(ATreeContainer: TCustomdxPSExplorerTreeContainer); +begin + dxPSExplorerTreeBuilderFactory_ActiveBuilderClass.BuildTree(Self, ATreeContainer); + //dxPSExplorerTreeBuilderFactory.ActiveBuilderClass.BuildTree(Self, ATreeContainer); + if LoadedItem <> nil then + ATreeContainer.MakeItemVisible(LoadedItem); +end; + +function TCustomdxPSExplorer.CreateTree(const AHost: IdxPSExplorerTreeContainerHost): TCustomdxPSExplorerTreeContainer; +begin + Result := dxPSExplorerTreeContainerFactory.ActiveTreeContainerClass.Create(Self, AHost); +end; + +function TCustomdxPSExplorer.FindCustomItemByUniqueID(const AnUniqueID: TBytes): TCustomdxPSExplorerItem; +begin + Result := nil; +end; + +procedure TCustomdxPSExplorer.LoadItemData(AnItem: TdxPSExplorerItem; + AReportLink: TBasedxReportLink); +begin + if LoadedItem <> nil then + NotifyItemDataUnloaded(LoadedItem); + + try + AnItem.SetReportData(AReportLink); + FLoadedItem := AnItem; + NotifyItemDataLoaded(AnItem); + except + FLoadedItem := nil; + DoItemDataLoadError(AnItem); + end; +end; + +procedure TCustomdxPSExplorer.UnloadItemData(AnItem: TdxPSExplorerItem); +begin + FLoadedItem := nil; + NotifyItemDataUnloaded(AnItem); +end; + +procedure TCustomdxPSExplorer.Refresh; +begin + BeforeRefresh; + try + DoRefresh; + finally + AfterRefresh; + end; +end; + +procedure TCustomdxPSExplorer.RegisterNotifier(ANotifier: TdxPSExplorerChangeNotifier); +begin + if IndexOfNotifier(ANotifier) = -1 then + begin + FNotifiers.Add(ANotifier); + ANotifier.FExplorer := Self; + end; +end; + +procedure TCustomdxPSExplorer.UnregisterNotifier(ANotifier: TdxPSExplorerChangeNotifier); +begin + FNotifiers.Remove(ANotifier); + ANotifier.FExplorer := nil; +end; + +{$IFNDEF DELPHI6} + +{ IUnknown } + +function TCustomdxPSExplorer.QueryInterface(const IID: TGUID; out Obj): HRESULT; +begin + if GetInterface(IID, Obj) then + Result := S_OK + else + Result := E_NOINTERFACE; +end; + +function TCustomdxPSExplorer._Addref: Integer; +begin + Result := -1; +end; + +function TCustomdxPSExplorer._Release: Integer; +begin + Result := -1; +end; + +{$ENDIF} + +{ IdxPSExplorerContextCommands } + +procedure TCustomdxPSExplorer.BuildCommandSet(ABuilder: IdxPSExplorerContextCommandBuilder); +begin + Assert(ABuilder <> nil); + ABuilder.AddExplorerContextCommand(AddCommandSeparator); + ABuilder.AddExplorerContextCommand(AddCommand(TdxPSExplorerRefreshContextCommand)); +end; + +procedure TCustomdxPSExplorer.FinalizeCommand(ACommand: TCustomdxPSExplorerContextCommand); +begin +end; + +procedure TCustomdxPSExplorer.InitializeCommand(ACommand: TCustomdxPSExplorerContextCommand); +begin +end; + +function TCustomdxPSExplorer.AddCommand(ACommandClass: TCustomdxPSExplorerContextCommandClass): TCustomdxPSExplorerContextCommand; +begin + Result := FindCommand(ACommandClass); + if Result = nil then + Result := CreateCommand(ACommandClass); +end; + +function TCustomdxPSExplorer.AddCommandSeparator: TdxPSExplorerContextCommandSeparator; +begin + Result := AddCommand(TdxPSExplorerContextCommandSeparator) as TdxPSExplorerContextCommandSeparator; +end; + +procedure TCustomdxPSExplorer.ClearCommands; +var + I: Integer; +begin + for I := 0 to CommandCount - 1 do + Commands[I].Free; + FCommands.Clear; +end; + +function TCustomdxPSExplorer.CreateCommand(ACommandClass: TCustomdxPSExplorerContextCommandClass): TCustomdxPSExplorerContextCommand; +begin + Result := ACommandClass.Create(Self); + FCommands.Add(Result); +end; + +function TCustomdxPSExplorer.CreateCommandSeparator: TdxPSExplorerContextCommandSeparator; +begin + Result := TdxPSExplorerContextCommandSeparator.Create(Self); +end; + +function TCustomdxPSExplorer.FindCommand(ACommandClass: TCustomdxPSExplorerContextCommandClass): TCustomdxPSExplorerContextCommand; +var + I: Integer; +begin + for I := 0 to CommandCount - 1 do + begin + Result := Commands[I]; + if Result.ClassType = ACommandClass then Exit; + end; + Result := nil; +end; + +procedure TCustomdxPSExplorer.FreeAndNilCommands; +begin + ClearCommands; + FreeAndNil(FCommands); +end; + +class function TCustomdxPSExplorer.AcceptItemNameChar(AnItem: TCustomdxPSExplorerItem; + Ch: Char): Boolean; +begin + Result := True; +end; + +class function TCustomdxPSExplorer.GetFolderClass: TdxPSExplorerFolderClass; +begin + Result := TdxPSExplorerFolder; +end; + +class function TCustomdxPSExplorer.GetItemClass: TdxPSExplorerItemClass; +begin + Result := TdxPSExplorerItem; +end; + +class function TCustomdxPSExplorer.GetRootFolderClass: TdxPSExplorerFolderClass; +begin + Result := TdxPSExplorerFolder; +end; + +function TCustomdxPSExplorer.GetRootDisplayName: string; +begin + Result := cxGetResourceString(@sdxExplorerRootFolderCaption); +end; + +procedure TCustomdxPSExplorer.LoadData(AFolder: TdxPSExplorerFolder); +begin + BeginLoading; + try + LockNotifications; + try + dxPSStartWait; + try + DoLoadData(AFolder); + finally + dxPSStopWait; + end; + finally + UnlockNotifications + end; + finally + EndLoading; + end; +end; + +function TCustomdxPSExplorer.CanDelete(AnItem: TCustomdxPSExplorerItem): Boolean; +begin + Result := (AnItem <> nil) and (AnItem <> Root); +end; + +function TCustomdxPSExplorer.CanMove(AnItem: TCustomdxPSExplorerItem): Boolean; +begin + Result := (AnItem <> nil) and (AnItem <> Root) and (AnItem <> LoadedItem); +end; + +function TCustomdxPSExplorer.CanMoveTo(AnItem: TCustomdxPSExplorerItem; + AParent: TCustomdxPSExplorerItem): Boolean; +begin + Result := CanMove(AnItem); +end; + +function TCustomdxPSExplorer.CanRename(AnItem: TCustomdxPSExplorerItem): Boolean; +begin + Result := (AnItem <> nil) and (AnItem <> Root) and (AnItem <> LoadedItem); +end; + +function TCustomdxPSExplorer.CanRenameTo(AnItem: TCustomdxPSExplorerItem; + const AName: string): Boolean; +begin + Result := CanRename(AnItem); +end; + +procedure TCustomdxPSExplorer.Delete(AnItem: TCustomdxPSExplorerItem); +begin + if not (esLoading in State) then + if AnItem.DoDelete then + begin + NotifyItemDeleted(AnItem); + AnItem.InternalDelete; + end; +end; + +procedure TCustomdxPSExplorer.MoveTo(AnItem: TCustomdxPSExplorerItem; + AParent: TdxPSExplorerFolder); +begin + if AnItem.DoMove(AParent) then + begin + AnItem.InternalMove(AParent); + NotifyItemParentChanged(AnItem); + end; +end; + +procedure TCustomdxPSExplorer.PopulateFolder(AFolder: TdxPSExplorerFolder); +begin + if AFolder.HasChildren and (AFolder.FolderCount + AFolder.ItemCount = 0) then + begin + LoadData(AFolder); + NotifyFolderPopulated(AFolder); + end; +end; + +procedure TCustomdxPSExplorer.RenameTo(AnItem: TCustomdxPSExplorerItem; AName: string); +begin + if AnItem.DoRename(AName) then + begin + AnItem.InternalRename(AName); + NotifyItemRenamed(AnItem); + end; +end; + +procedure TCustomdxPSExplorer.AfterRefresh; +begin + Dec(FRefreshCounter); + if FRefreshCounter = 0 then + begin + UnlockNotifications; + LoadState; + NotifyRefresh(ersAfter); + Exclude(FState, esRefreshing); + end; +end; + +procedure TCustomdxPSExplorer.BeforeRefresh; +begin + if FRefreshCounter = 0 then + begin + Include(FState, esRefreshing); + SaveState; + NotifyRefresh(ersBefore); + LockNotifications; + end; + Inc(FRefreshCounter); +end; + +procedure TCustomdxPSExplorer.DoRefresh; +begin + if LoadedItem <> nil then LoadedItem.Unload; + FreeAndNil(FRoot); +end; + +procedure TCustomdxPSExplorer.RootNeeded; +begin + Root; +end; + +procedure TCustomdxPSExplorer.DoItemDataLoadError(AnItem: TdxPSExplorerItem); +var + S: string; + ShowError: Boolean; +begin + S := AnItem.DataLoadErrorText; + ShowError := True; + if Assigned(FOnItemDataLoadError) then + FOnItemDataLoadError(Self, AnItem, ShowError, S); + if ShowError then + MessageError(S); +end; + +procedure TCustomdxPSExplorer.InternalSetLoadedItem(Value: TdxPSExplorerItem); +begin + if Value <> nil then //? + FLoadedItem := Value; +end; + +procedure TCustomdxPSExplorer.PopulateTreeFolder(ATreeContainer: TCustomdxPSExplorerTreeContainer; + AFolder: TdxPSExplorerFolder); +begin + dxPSExplorerTreeBuilderFactory_ActiveBuilderClass.PopulateTreeFolder(ATreeContainer, AFolder); + //dxPSExplorerTreeBuilderFactory.ActiveBuilderClass.PopulateTreeFolder(ATreeContainer, AFolder); +end; + +procedure TCustomdxPSExplorer.LoadState; + + function ReadItem: TCustomdxPSExplorerItem; + var + ItemInfo: TCustomdxPSExplorerItemStateInfo; + Bytes: TBytes; + I: Integer; + begin + FStateStream.ReadBuffer(ItemInfo, GetItemStateInfoSize); + if ItemInfo.UniqueIDSize <> 0 then + begin + SetLength(Bytes, ItemInfo.UniqueIDSize); + FStateStream.ReadBuffer(Pointer(Bytes)^, ItemInfo.UniqueIDSize); + Result := FindCustomItemByUniqueID(Bytes); + end + else + Result := nil; + for I := 0 to ItemInfo.Count - 1 do + ReadItem; + end; + + procedure ReadLoadedItem; + var + Buffer: Integer; + begin + FStateStream.ReadBuffer(Buffer , SizeOf(Buffer)); + if Buffer <> 0 then + InternalSetLoadedItem(TdxPSExplorerItem(ReadItem)); + end; + +begin + if FStateStream <> nil then + try + FStateStream.Position := 0; + ReadItem; + ReadLoadedItem; + finally + FreeAndNil(FStateStream); + end; +end; + +procedure TCustomdxPSExplorer.SaveState; + + procedure WriteLoadedItem; + var + Flag: Integer; + begin + Flag := Ord(LoadedItem <> nil); + FStateStream.WriteBuffer(Flag, SizeOf(Flag)); + if LoadedItem <> nil then + LoadedItem.WriteState(FStateStream); + end; + +begin + if FRoot <> nil then + begin + FStateStream := TMemoryStream.Create; + try + Root.WriteState(FStateStream); + WriteLoadedItem; + except + FreeAndNil(FStateStream); + raise; + end; + end; +end; + +procedure TCustomdxPSExplorer.NotifyFolderPopulated(AFolder: TdxPSExplorerFolder); +var + I: Integer; +begin + if not AreNotificationsLocked then + for I := 0 to NotifierCount - 1 do + Notifiers[I].FolderPopulated(AFolder); +end; + +procedure TCustomdxPSExplorer.NotifyItemAdded(AnItem: TCustomdxPSExplorerItem); +var + I: Integer; +begin + if not AreNotificationsLocked then + for I := 0 to NotifierCount - 1 do + Notifiers[I].ItemAdded(AnItem); +end; + +procedure TCustomdxPSExplorer.NotifyItemDataLoaded(AnItem: TdxPSExplorerItem); +var + I: Integer; +begin + if not AreNotificationsLocked then + for I := 0 to NotifierCount - 1 do + Notifiers[I].ItemDataLoaded(AnItem); +end; + +procedure TCustomdxPSExplorer.NotifyItemDataUnloaded(AnItem: TdxPSExplorerItem); +var + I: Integer; +begin + if not AreNotificationsLocked then + for I := 0 to NotifierCount - 1 do + Notifiers[I].ItemDataUnloaded(AnItem); +end; + +procedure TCustomdxPSExplorer.NotifyItemDeleted(AnItem: TCustomdxPSExplorerItem); +var + I: Integer; +begin + if not AreNotificationsLocked then + for I := 0 to NotifierCount - 1 do + Notifiers[I].ItemDeleted(AnItem); +end; + +procedure TCustomdxPSExplorer.NotifyItemParentChanged(AnItem: TCustomdxPSExplorerItem); +var + I: Integer; +begin + if not AreNotificationsLocked then + for I := 0 to NotifierCount - 1 do + Notifiers[I].ItemParentChanged(AnItem); +end; + +procedure TCustomdxPSExplorer.NotifyItemPropertiesChanged(AnItem: TCustomdxPSExplorerItem); +var + I: Integer; +begin + if not AreNotificationsLocked then + for I := 0 to NotifierCount - 1 do + Notifiers[I].ItemPropertiesChanged(AnItem); +end; + +procedure TCustomdxPSExplorer.NotifyItemRenamed(AnItem: TCustomdxPSExplorerItem); +var + I: Integer; +begin + if not AreNotificationsLocked then + for I := 0 to NotifierCount - 1 do + Notifiers[I].ItemRenamed(AnItem); +end; + +procedure TCustomdxPSExplorer.NotifyRefresh(AStage: TdxPSExplorerRefreshStage); +var + I: Integer; +begin + if not AreNotificationsLocked then + for I := 0 to NotifierCount - 1 do + Notifiers[I].ExplorerRefresh(AStage); +end; + +function TCustomdxPSExplorer.AreNotificationsLocked: Boolean; +begin + Result := FLockCounter <> 0; +end; + +function TCustomdxPSExplorer.IndexOfNotifier(ANotifier: TdxPSExplorerChangeNotifier): Integer; +begin + Result := FNotifiers.IndexOf(ANotifier); +end; + +procedure TCustomdxPSExplorer.LockNotifications; +begin + Inc(FLockCounter); +end; + +procedure TCustomdxPSExplorer.ReleaseAndNilNotifiers; +var + I: Integer; +begin + for I := 0 to NotifierCount - 1 do + Notifiers[I].Explorer := nil; + FreeAndNil(FNotifiers); +end; + +procedure TCustomdxPSExplorer.UnlockNotifications; +begin + Dec(FLockCounter); +end; + +procedure TCustomdxPSExplorer.BeginLoading; +begin + if FLoadingCounter = 0 then Include(FState, esLoading); + Inc(FLoadingCounter); +end; + +procedure TCustomdxPSExplorer.EndLoading; +begin + Dec(FLoadingCounter); + if FLoadingCounter = 0 then Exclude(FState, esLoading); +end; + +function TCustomdxPSExplorer.IsLoading: Boolean; +begin + Result := FLoadingCounter <> 0; +end; + +function TCustomdxPSExplorer.GetCommand(Index: Integer): TCustomdxPSExplorerContextCommand; +begin + Result := TCustomdxPSExplorerContextCommand(FCommands[Index]); +end; + +function TCustomdxPSExplorer.GetCommandCount: Integer; +begin + Result := FCommands.Count; +end; + +function TCustomdxPSExplorer.GetFilterLink: string; +begin + if FilterLinkClass <> nil then + Result := FilterLinkClass.ClassName + else + Result := ''; +end; + +function TCustomdxPSExplorer.GetNotifier(Index: Integer): TdxPSExplorerChangeNotifier; +begin + Result := TdxPSExplorerChangeNotifier(FNotifiers[Index]); +end; + +function TCustomdxPSExplorer.GetNotifierCount: Integer; +begin + Result := FNotifiers.Count; +end; + +function TCustomdxPSExplorer.GetRoot: TdxPSExplorerFolder; +begin + if FRoot = nil then + begin + BeginLoading; + try + LockNotifications; + try + FRoot := GetRootFolderClass.Create(Self, nil); + FRoot.FName := GetRootDisplayName; + LoadData(FRoot); + finally + UnlockNotifications; + end; + finally + EndLoading; + end; + end; + Result := FRoot; +end; + +procedure TCustomdxPSExplorer.SetFilterLink(const Value: string); +var + ComponentClass: TComponentClass; +begin + if Value <> '' then + begin + ComponentClass := TComponentClass(GetClass(Value)); + if dxPSIsSupportedCompClass(ComponentClass) then + FilterLinkClass := ComponentClass; + end + else + FilterLinkClass := nil; +end; + +{ TdxReportTitle } + +constructor TdxReportTitle.Create(AReportLink: TBasedxReportLink); +begin + inherited Create; + FReportLink := AReportLink; + FFont := TFont.Create; + DoRestoreDefaults; + FFont.OnChange := FontChanged; +end; + +destructor TdxReportTitle.Destroy; +begin + FreeAndNil(FDefaultFont); + FreeAndNil(FFont); + inherited; +end; + +procedure TdxReportTitle.Assign(Source: TPersistent); +begin + if Source is TdxReportTitle then + begin + BeginUpdate; + try + with TdxReportTitle(Source) do + begin + Self.AdjustOnReportScale := AdjustOnReportScale; + Self.Color := Color; + Self.Font := Font; + Self.Mode := Mode; + Self.Text := Text; + Self.TextAlignX := TextAlignX; + Self.TextAlignY := TextAlignY; + Self.Transparent := Transparent; + end; + finally + EndUpdate; + end; + end + else + inherited; +end; + +procedure TdxReportTitle.BeginUpdate; +begin + Inc(FUpdateCount); +end; + +procedure TdxReportTitle.CancelUpdate; +begin + if FUpdateCount <> 0 then Dec(FUpdateCount); +end; + +procedure TdxReportTitle.EndUpdate; +begin + if FUpdateCount <> 0 then + begin + Dec(FUpdateCount); + if FUpdateCount = 0 then CalculateRenderInfos; + end; +end; + +function TdxReportTitle.DefaultFont: TFont; +begin + if FDefaultFont = nil then + begin + FDefaultFont := TFont.Create; + InitializeDefaultFont(FDefaultFont); + end; + Result := FDefaultFont; +end; + +procedure TdxReportTitle.RestoreDefaults; +begin + BeginUpdate; + try + DoRestoreDefaults; + finally + EndUpdate; + end; +end; + +procedure TdxReportTitle.DoRestoreDefaults; +begin + FAdjustOnReportScale := False; + FColor := clWhite; + FLockCalcViewInfos := True; + try + Font := DefaultFont; + finally + FLockCalcViewInfos := False; + end; + FMode := tmOnEveryTopPage; + FTextAlignX := taCenterX; + FTextAlignY := taCenterY; + FTransparent := True; +end; + +procedure TdxReportTitle.InitializeDefaultFont(AFont: TFont); +begin + AFont.Color := dxPSDefaultReportTitleFontColor; + AFont.Name := dxPSDefaultReportTitleFontName; + AFont.Size := dxPSDefaultReportTitleFontSize; + AFont.Style := dxPSDefaultReportTitleFontStyle; +end; + +procedure TdxReportTitle.ReadData(AReader: TdxPSDataReader); +begin + BeginUpdate; + try + with AReader do + begin + AdjustOnReportScale := ReadBoolean; + Color := ReadInteger; + ReadFont(Font); + Mode := TdxReportTitleMode(ReadInteger); + Text := ReadString; + TextAlignX := TdxTextAlignX(ReadInteger); + TextAlignY := TdxTextAlignY(ReadInteger); + Transparent := ReadBoolean; + end; + finally + CancelUpdate; + end; +end; + +procedure TdxReportTitle.WriteData(AWriter: TdxPSDataWriter); +begin + with AWriter do + begin + WriteBoolean(AdjustOnReportScale); + WriteInteger(Color); + WriteFont(Font); + WriteInteger(Integer(Mode)); + WriteString(Text); + WriteInteger(Integer(TextAlignX)); + WriteInteger(Integer(TextAlignY)); + WriteBoolean(Transparent); + end; +end; + +function TdxReportTitle.IsFontStored: Boolean; +begin + Result := not dxPSUtl.dxAreFontsEqual(Font, DefaultFont); +end; + +procedure TdxReportTitle.SetAdjustOnReportScale(Value: Boolean); +begin + if FAdjustOnReportScale <> Value then + begin + FAdjustOnReportScale := Value; + CalculateRenderInfos; + end; +end; + +procedure TdxReportTitle.SetColor(Value: TColor); +begin + FColor := Value; +end; + +procedure TdxReportTitle.SetFont(Value: TFont); +begin + Font.Assign(Value); +end; + +procedure TdxReportTitle.SetMode(Value: TdxReportTitleMode); +begin + if FMode <> Value then + begin + FMode := Value; + CalculateRenderInfos; + end; +end; + +procedure TdxReportTitle.SetText(const Value: string); +begin + if FText <> Value then + begin + FText := Value; + CalculateRenderInfos; + end; +end; + +procedure TdxReportTitle.SetTextAlignX(Value: TdxTextAlignX); +begin + if Value in [taLeft, taCenterX, taRight] then // backward compatibility + FTextAlignX := Value; +end; + +procedure TdxReportTitle.SetTextAlignY(Value: TdxTextAlignY); +begin + if Value in [taTop, taCenterY, taBottom] then // backward compatibility + FTextAlignY := Value; +end; + +procedure TdxReportTitle.SetTransparent(Value: Boolean); +begin + FTransparent := Value; +end; + +procedure TdxReportTitle.CalculateRenderInfos; +begin + if (FUpdateCount = 0) and (ReportLink <> nil) then //and (FReportLink.CurrentComposition = nil) then + ReportLink.CalculateRenderInfos; +end; + +procedure TdxReportTitle.FontChanged(Sender: TObject); +begin + if not LockCalcViewInfos then CalculateRenderInfos; +end; + +{ TdxReportLinkPrinterPage } + +type + TdxReportLinkPrinterPage = class(TdxPrinterPage) + private + FReportLink: TBasedxReportLink; + protected + function GetOwner: TPersistent; override; + function GetSupportsScaling: Boolean; override; + procedure PageParamsChanged(AUpdateCodes: TdxPrinterPageUpdateCodes); override; + public + property ReportLink: TBasedxReportLink read FReportLink; + end; + + +function TdxReportLinkPrinterPage.GetOwner: TPersistent; +begin + Result := ReportLink; +end; + +function TdxReportLinkPrinterPage.GetSupportsScaling: Boolean; +begin + Result := ReportLink.SupportsScaling; +end; + +procedure TdxReportLinkPrinterPage.PageParamsChanged(AUpdateCodes: TdxPrinterPageUpdateCodes); +begin + inherited; + if UpdateCount = 0 then + ReportLink.PageParamsChanged(Self, nil, AUpdateCodes); +end; + +{ TdxPSReportDocument } + +constructor TdxPSReportDocument.Create(AReportLink: TBasedxReportLink); +begin + inherited Create; + FReportLink := AReportLink; + FPreview := TMetafile.Create; +end; + +destructor TdxPSReportDocument.Destroy; +begin + FreeAndNil(FPreview); + inherited; +end; + +procedure TdxPSReportDocument.Assign(Source: TPersistent); +begin + if Source is TdxPSReportDocument then + begin + BeginUpdate; + try + DoAssign(TdxPSReportDocument(Source)); + finally + EndUpdate; + end; + end + else + inherited; +end; + +procedure TdxPSReportDocument.BeginUpdate; +begin + Inc(FUpdateCount); +end; + +procedure TdxPSReportDocument.CancelUpdate; +begin + if FUpdateCount <> 0 then Dec(FUpdateCount); +end; + +procedure TdxPSReportDocument.EndUpdate; +begin + if FUpdateCount <> 0 then + begin + Dec(FUpdateCount); + if UpdateCount = 0 then Changed; + end; +end; + +function TdxPSReportDocument.IsUpdateLocked: Boolean; +begin + Result := UpdateCount <> 0; +end; + +function TdxPSReportDocument.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxNewReport); +end; + +function TdxPSReportDocument.DefaultCreator: string; +begin + Result := dxPSUtl.GetUserName; +end; + +function TdxPSReportDocument.DefaultDescription: string; +begin + Result := ''; +end; + +procedure TdxPSReportDocument.RestoreDefaults; +begin + BeginUpdate; + try + DoRestoreDefaults; + finally + EndUpdate; + end; +end; + +procedure TdxPSReportDocument.RetrievePreview; +begin + Preview.Clear; + if ReportLink <> nil then + ReportLink.RetrievePageAsImage(0, TMetafile, Preview); +end; + +procedure TdxPSReportDocument.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('IsCaptionAssigned', ReadIsCaptionAssigned, WriteIsCaptionAssigned, + FIsCaptionAssigned and (Caption = '')); + Filer.DefineProperty('IsCreatorAssigned', ReadIsCreatorAssigned, WriteIsCreatorAssigned, + FIsCreatorAssigned and (Creator = '')); + Filer.DefineProperty('IsDescriptionAssigned', ReadIsDescriptionAssigned, WriteIsDescriptionAssigned, + FIsDescriptionAssigned and (Description = '')); +end; + +procedure TdxPSReportDocument.Changed; +begin + if not IsUpdateLocked then + if Assigned(FOnChanged) then FOnChanged(Self); +end; + +procedure TdxPSReportDocument.DoAssign(Source: TdxPSReportDocument); +begin + Caption := Source.Caption; + CreationDate := Source.CreationDate; + Creator := Source.Creator; + Description := Source.Description; + Preview.Assign(Source.Preview); + FIsCaptionAssigned := Source.FIsCaptionAssigned; + FIsCreatorAssigned := Source.FIsCreatorAssigned; + FIsDescriptionAssigned := Source.FIsDescriptionAssigned; +end; + +procedure TdxPSReportDocument.DoRestoreDefaults; +begin + FIsCaptionAssigned := False; + FisCreatorAssigned := False; + FIsDescriptionAssigned := False; +end; + +function TdxPSReportDocument.GetInfoTip: string; +const + CRLF = #13#10; +begin + Result := ''; + + if Caption <> '' then + begin + if Result <> '' then Result := Result + CRLF; + Result := Result + DropAmpersand(cxGetResourceString(@sdxCaption)) + ' ' + Caption; + end; + + if Creator <> '' then + begin + if Result <> '' then Result := Result + CRLF; + Result := Result + DropAmpersand(cxGetResourceString(@sdxCreator)) + ' ' + Creator; + end; + + if Result <> '' then Result := Result + CRLF; + Result := Result + DropAmpersand(cxGetResourceString(@sdxCreationDate)) + ' ' + DateToStr(CreationDate); + + if Description <> '' then + begin + if Result <> '' then Result := Result + CRLF; + Result := Result + DropAmpersand(cxGetResourceString(@sdxDescription)) + ' ' + Description; + end; +end; + +procedure TdxPSReportDocument.ReadData(AReader: TdxPSDataReader); +begin + BeginUpdate; + try + with AReader do + begin + Caption := ReadString; + CreationDate := ReadDate; + Creator := ReadString; + Description := ReadString; + ReadImage(Preview); + end; + finally + EndUpdate; + end; +end; + +procedure TdxPSReportDocument.WriteData(AWriter: TdxPSDataWriter); +begin + RetrievePreview; + with AWriter do + begin + WriteString(Caption); + WriteDate(CreationDate); + WriteString(Creator); + WriteString(Description); + WriteImage(Preview); + end; +end; + +function TdxPSReportDocument.GetCaption: string; +begin + if FIsCaptionAssigned then + Result := FCaption + else + Result := DefaultCaption; +end; + +function TdxPSReportDocument.GetCreator: string; +begin + if FIsCreatorAssigned then + Result := FCreator + else + Result := DefaultCreator; +end; + +function TdxPSReportDocument.GetDescription: string; +begin + if FIsDescriptionAssigned then + Result := FDescription + else + Result := DefaultDescription; +end; + +function TdxPSReportDocument.IsCaptionStored: Boolean; +begin + Result := FIsCaptionAssigned and (FCaption <> DefaultCaption); +end; + +function TdxPSReportDocument.IsCreatorStored: Boolean; +begin + Result := FIsCreatorAssigned and (FCreator <> DefaultCreator); +end; + +function TdxPSReportDocument.IsDesciptionStored: Boolean; +begin + Result := FIsDescriptionAssigned and (FDescription <> DefaultDescription); +end; + +procedure TdxPSReportDocument.SetCaption(const Value: string); +begin + if Caption <> Value then + begin + FCaption := Value; + FIsCaptionAssigned := True; + Changed; + end; +end; + +procedure TdxPSReportDocument.SetCreationDate(const Value: TDateTime); +begin + if FCreationDate <> Value then + begin + FCreationDate := Value; + Changed; + end; +end; + +procedure TdxPSReportDocument.SetCreator(const Value: string); +begin + if FCreator <> Value then + begin + FIsCreatorAssigned := True; + FCreator := Value; + Changed; + end; +end; + +procedure TdxPSReportDocument.SetDescription(const Value: string); +begin + if FDescription <> Value then + begin + FIsDescriptionAssigned := True; + FDescription := Value; + Changed; + end; +end; + +procedure TdxPSReportDocument.ReadIsCaptionAssigned(Reader: TReader); +begin + FIsCaptionAssigned := Reader.ReadBoolean; +end; + +procedure TdxPSReportDocument.ReadIsCreatorAssigned(Reader: TReader); +begin + FIsCreatorAssigned := Reader.ReadBoolean; +end; + +procedure TdxPSReportDocument.ReadIsDescriptionAssigned(Reader: TReader); +begin + FIsDescriptionAssigned := Reader.ReadBoolean; +end; + +procedure TdxPSReportDocument.WriteIsCaptionAssigned(Writer: TWriter); +begin + Writer.WriteBoolean(FIsCaptionAssigned); +end; + +procedure TdxPSReportDocument.WriteIsCreatorAssigned(Writer: TWriter); +begin + Writer.WriteBoolean(FIsCreatorAssigned); +end; + +procedure TdxPSReportDocument.WriteIsDescriptionAssigned(Writer: TWriter); +begin + Writer.WriteBoolean(FIsDescriptionAssigned); +end; + +{ TdxPSDataStorageOffsetTable } + +constructor TdxPSDataStorageOffsetTable.Create(ATemplate: TdxPSDataStorageOffsetTable = nil); +begin + inherited Create; + Assign(ATemplate); +end; + +procedure TdxPSDataStorageOffsetTable.Assign(Source: TdxPSDataStorageOffsetTable); +begin + Clear; + if Source <> nil then DoAssign(Source); +end; + +procedure TdxPSDataStorageOffsetTable.Clear; +begin + Information := 0; + Document := 0; + Title := 0; + Data := 0; + Reserved1 := 0; + Reserved2 := 0; + Reserved3 := 0; + Reserved4 := 0; +end; + +type + TdxPSDataStorageOffsetTableInfo = record + Information: Longint; + Document: Longint; + Title: Longint; + Data: Longint; + Reserved1: Longint; + Reserved2: Longint; + Reserved3: Longint; + Reserved4: Longint; + end; + +procedure TdxPSDataStorageOffsetTable.ReadData(AReader: TdxPSDataReader); +var + MemSize: Integer; + Info: TdxPSDataStorageOffsetTableInfo; +begin + AReader.Read(MemSize, SizeOf(MemSize)); + AReader.Read(Info, MemSize); + + Information := Info.Information; + Document := Info.Document; + Title := Info.Title; + Data := Info.Data; + Reserved1 := Info.Reserved1; + Reserved2 := Info.Reserved2; + Reserved3 := Info.Reserved3; + Reserved4 := Info.Reserved4; +end; + +procedure TdxPSDataStorageOffsetTable.WriteData(AWriter: TdxPSDataWriter); +var + MemSize: Integer; + Info: TdxPSDataStorageOffsetTableInfo; +begin + MemSize := SizeOf(Info); + Info.Information := Information; + Info.Document := Document; + Info.Title := Title; + Info.Data := Data; + Info.Reserved1 := Reserved1; + Info.Reserved2 := Reserved2; + Info.Reserved3 := Reserved3; + Info.Reserved4 := Reserved4; + + AWriter.Write(MemSize, SizeOf(MemSize)); + AWriter.Write(Info, MemSize); +end; + +procedure TdxPSDataStorageOffsetTable.DoAssign(Source: TdxPSDataStorageOffsetTable); +begin + Information := Source.Information; + Document := Source.Document; + Title := Source.Title; + Data := Source.Data; + Reserved1 := Source.Reserved1; + Reserved2 := Source.Reserved2; + Reserved3 := Source.Reserved3; + Reserved4 := Source.Reserved4; +end; + +{ TdxPSDataStorageInfo } + +constructor TdxPSDataStorageInfo.Create(AReportLink: TBasedxReportLink); +begin + inherited Create; + StorageVersion := dxPSGlbl.dxPSStorageVersion; + PrintingSystemVersion := dxPSGlbl.dxPSVersion; + if AReportLink <> nil then + begin + LinkClassName := AReportLink.ClassName; + LinkClass := TdxReportLinkClass(Classes.GetClass(LinkClassName)); + if AReportLink.Component <> nil then + begin + ComponentClassName := AReportLink.Component.ClassName; + ComponentClass := TComponentClass(Classes.GetClass(ComponentClassName)); + end; + end; +end; + +procedure TdxPSDataStorageInfo.ReadData(AReader: TdxPSDataReader); +begin + with AReader do + begin + StorageVersion := ReadInteger; + PrintingSystemVersion := ReadPSVersion; + LinkClassName := ReadString; + ComponentClassName := ReadString; + LinkClass := TdxReportLinkClass(Classes.GetClass(LinkClassName)); + ComponentClass := TComponentClass(Classes.GetClass(ComponentClassName)); + end; +end; + +procedure TdxPSDataStorageInfo.WriteData(AWriter: TdxPSDataWriter); +begin + with AWriter do + begin + WriteInteger(StorageVersion); + WritePSVersion(PrintingSystemVersion); + WriteClassName(LinkClass); + WriteClassName(ComponentClass); + end; +end; + +{ TBasedxReportLink } + +constructor TBasedxReportLink.Create(AOwner: TComponent); +begin + inherited; + FBackgroundBitmapPool := TdxPSBackgroundBitmapPool.Create; + FBuiltIn := IsDesigning; + FColor := dxDefaultContentColor; {clWhite} + FCurrentPage := 1; + FFont := TFont.Create; + FFont.Assign(DefaultFont); + FFont.OnChange := FontChanged; + FDataSource := rldsComponent; + FPageNumberFormat := pnfNumeral; + FPrinterPage := TdxReportLinkPrinterPage.Create; + TdxReportLinkPrinterPage(FPrinterPage).FReportLink := Self; + FReportDocument := CreateReportDocument; + FReportDocument.OnChanged := DocumentChanged; + FReportTitle := TdxReportTitle.Create(Self); + FSavedReportTitle := TdxReportTitle.Create(nil); + FSavedReportDocument := CreateReportDocument; + FScaleFonts := True; + FShowPageFooter := True; + FShowPageHeader := True; + FSubscriber := TdxPageParamsChangedSubscriber.Create([TdxSMPageParamsChangedEvent]); + TdxPageParamsChangedSubscriber(FSubscriber).OnPageParamsChanged := PageParamsChanged; + FStartPageIndex := 1; + FTransparent := True; + FUseHorzDelimiters := True; + FUseVertDelimiters := True; +end; + +destructor TBasedxReportLink.Destroy; +begin + {$IFNDEF DELPHI5} + Destroying; + {$ENDIF} + ComponentPrinter := nil; + Component := nil; + DoDestroyReport; {v2.0} + FreeAndNil(FRenderer); + FreeAndNil(FRenderInfo); + FreeAndNil(FSubscriber); + FreeAndNil(FSavedReportDocument); + FreeAndNil(FSavedReportTitle); + FreeAndNil(FReportTitle); + FreeAndNil(FReportDocument); + FreeAndNil(FPrinterPage); + FreeAndNil(FFontPool); + FreeAndNil(FFont); + FreeAndNil(FDefaultFont); + FinalizeDataStream; + FreeAndNil(FBackgroundBitmapPool); + inherited; +end; + +procedure TBasedxReportLink.BeforeDestruction; +begin + inherited; + DoDestroy; +end; + +procedure TBasedxReportLink.Assign(Source: TPersistent); +begin + if Source is TBasedxReportLink then + with TBasedxReportLink(Source) do + begin + Self.Color := Color; + Self.DesignerCaption := DesignerCaption; + Self.Font := Font; + Self.FootersOnEveryPage := FootersOnEveryPage; + Self.HeadersOnEveryPage := HeadersOnEveryPage; + Self.PageNumberFormat := PageNumberFormat; + Self.RealPrinterPage.BeginUpdate; + try + Self.RealPrinterPage := RealPrinterPage; + finally + Self.RealPrinterPage.CancelUpdate; + end; + Self.ReportDocument := ReportDocument; + Self.ReportTitle := ReportTitle; + Self.ScaleFonts := ScaleFonts; + Self.ShowEmptyPages := ShowEmptyPages; + Self.ShowPageFooter := ShowPageFooter; + Self.ShowPageHeader := ShowPageHeader; + Self.ShrinkToPageWidth := ShrinkToPageWidth; + Self.TimeFormat := TimeFormat; + Self.Transparent := Transparent; + + Self.FIsDesignerCaptionAssigned := FIsDesignerCaptionAssigned; + end + else + if Source is TBasedxPrintStyle then + PrinterPage := TBasedxPrintStyle(Source).PrinterPage + else + inherited; +end; + +function TBasedxReportLink.GetParentComponent: TComponent; +begin + Result := ComponentPrinter; +end; + +function TBasedxReportLink.HasParent: Boolean; +begin + Result := ComponentPrinter <> nil; +end; + +procedure TBasedxReportLink.LoadFromRegistry(const APath: string); +var + AssignedFormat: Boolean; + Registry: TRegistry; +begin + if APath = '' then Exit; + Registry := TRegistry.Create; + with Registry do + try + if OpenKey(APath, False) then + try + AssignedFormat := ValueExists(sdxAssignedDateFormat) and ReadBool(sdxAssignedDateFormat); + if AssignedFormat and ValueExists(sdxDateFormat) then + DateFormat := ReadInteger(sdxDateFormat); + + AssignedFormat := ValueExists(sdxAssignedTimeFormat) and ReadBool(sdxAssignedTimeFormat); + if AssignedFormat and ValueExists(sdxTimeFormat) then + TimeFormat := ReadInteger(sdxTimeFormat); + + AssignedFormat := ValueExists(sdxAssignedPageNumberFormat) and ReadBool(sdxAssignedPageNumberFormat); + if AssignedFormat and ValueExists(sdxPageNumberFormat) then + PageNumberFormat := TdxPageNumberFormat(ReadInteger(sdxPageNumberFormat)); + + if ValueExists(sdxStartPageIndex) then + StartPageIndex := ReadInteger(sdxStartPageIndex); + except + on ERegistryException do + else + raise; + end; + finally + Free; + end; +end; + +procedure TBasedxReportLink.SaveToRegistry(const APath: string); +var + Registry: TRegistry; +begin + if APath = '' then Exit; + Registry := TRegistry.Create; + with Registry do + try + if OpenKey(APath, True) then + try + WriteBool(sdxAssignedDateFormat, fvDate in AssignedFormatValues); + if fvDate in AssignedFormatValues then + WriteInteger(sdxDateFormat, DateFormat); + + WriteBool(sdxAssignedTimeFormat, fvTime in AssignedFormatValues); + if fvTime in AssignedFormatValues then + WriteInteger(sdxTimeFormat, TimeFormat); + + WriteBool(sdxAssignedPageNumberFormat, fvPageNumber in AssignedFormatValues); + if fvPageNumber in AssignedFormatValues then + WriteInteger(sdxPageNumberFormat, Integer(PageNumberFormat)); + + WriteInteger(sdxStartPageIndex, StartPageIndex); + except + on ERegistryException do + else + raise; + end; + finally + Free; + end; +end; + +class function TBasedxReportLink.Aggregable: Boolean; +begin + Result := True; +end; + +class function TBasedxReportLink.CanBeUsedAsStub: Boolean; +begin + Result := True; +end; + +class function TBasedxReportLink.Serializable: Boolean; +begin + Result := True; +end; + +function TBasedxReportLink.DefaultDateFormat: Integer; +begin + if not (fvDate in AssignedFormatValues) and (ComponentPrinter <> nil) then + Result := ComponentPrinter.DateFormat + else + Result := 0; +end; + +function TBasedxReportLink.DefaultDesignerCaption: string; +begin + Result := cxGetResourceString(@sdxReportDesignerCaption); +end; + +function TBasedxReportLink.DefaultFont: TFont; +begin + if FDefaultFont = nil then + begin + FDefaultFont := TFont.Create; + InitializeDefaultFont(FDefaultFont); + end; + Result := FDefaultFont; +end; + +function TBasedxReportLink.DefaultPageNumberFormat: TdxPageNumberFormat; +begin + if not (fvPageNumber in AssignedFormatValues) and (ComponentPrinter <> nil) then + Result := ComponentPrinter.PageNumberFormat + else + Result := pnfNumeral; +end; + +function TBasedxReportLink.DefaultTimeFormat: Integer; +begin + if not (fvTime in AssignedFormatValues) and (ComponentPrinter <> nil) then + Result := ComponentPrinter.TimeFormat + else + Result := 0; +end; + +procedure TBasedxReportLink.RestoreDefaults; +begin + InternalRestoreDefaults; +end; + +procedure TBasedxReportLink.RestoreFromOriginal; +begin + if Component <> nil then InternalRestoreFromOriginal; +end; + +function TBasedxReportLink.CheckToDesign: Boolean; +begin + Result := (DataSource = rldsComponent) and (GetDesignerClass <> nil); +end; + +function TBasedxReportLink.DataProviderPresent: Boolean; +begin + if DataSource = rldsComponent then + Result := Component <> nil + else + Result := PossibleDataStorage(DataStream, False); +end; + +function TBasedxReportLink.DesignerExists(AComponentClass: TComponentClass): Boolean; +begin + Result := GetDesignerClass <> nil; +end; + +function TBasedxReportLink.DesignReport: Boolean; +var + DesignWindowClass: TdxReportLinkDesignWindowClass; + SaveLink: TBasedxReportLink; +begin + Result := False; + DesignWindowClass := GetDesignerClass; + if DesignWindowClass <> nil then + begin + FDesignWindow := DesignWindowClass.Create(nil); + try + DesignWindow.ReportLink := Self; + SaveLink := LinkClass.Create(nil); + try + SaveLink.Assign(Self); + BeforeDesignReport; + try + Result := DesignWindow.Execute; + finally + AfterDesignReport(Result); + end; + if not Result and not DesignWindow.Applyed then + Assign(SaveLink); + finally + SaveLink.Free; + end; + finally + FreeAndNil(FDesignWindow); + end; + end; +end; + +procedure TBasedxReportLink.DestroyReport; +begin + Active := False; +end; + +procedure TBasedxReportLink.GetPageColRowCount(out APageColCount, APageRowCount: Integer); +begin + APageColCount := RenderInfo.PageColCount; + APageRowCount := RenderInfo.PageRowCount; +end; + +procedure TBasedxReportLink.Initialize; +begin +end; + +function TBasedxReportLink.IsEmptyPage(AVirtualPageIndex: Integer): Boolean; +begin + if (AVirtualPageIndex > -1) and (AVirtualPageIndex < RenderInfo.VirtualPageCount) then + Result := RenderInfo.PageRenderInfos[AVirtualPageIndex].IsEmptyPage + else + Result := True; +end; + +function TBasedxReportLink.IsEmptyReport: Boolean; +begin + Result := (FRenderInfo = nil) or (RenderInfo.NonEmptyPageCount = 0); +end; + +procedure TBasedxReportLink.RebuildReport; +begin + if HasDesignWindow then DesignWindow.BeforeRebuildReport; + try + Active := False; + Active := True; + finally + if HasDesignWindow then DesignWindow.AfterRebuildReport; + end; +end; + +procedure TBasedxReportLink.SetComponentUnconditionally(Value: TComponent); +begin + FComponent := Value; + if Active or FStreamedActive then + try + if FStreamedActive then FStreamedActive := False; + RebuildReport; + if not IsLoading and (ComponentPrinter <> nil) and not ComponentPrinter.AutoUpdateDateTime then + begin + DateTime := Now; + DesignerModified; + end; + LinkModified(False); + except + on E: Exception do + begin + FComponent := nil; + if IsDesigning then + ShowException(E, ExceptAddr) + else + raise; + end; + end; + if Value <> nil then + Value.FreeNotification(Self); +end; + +class procedure TBasedxReportLink.GetSupportedComponentList(AList: TdxClassList); +begin + dxPSGetLinkSupportedComponentsList(AList, LinkClass); +end; + +class function TBasedxReportLink.IsSupportedCompClass(AComponentClass: TClass): Boolean; +begin + Result := dxPSIsSupportedCompClass(AComponentClass) and (dxPSLinkClassByCompClass(AComponentClass) = LinkClass); +end; + +class function TBasedxReportLink.LinkClass: TdxReportLinkClass; +begin + Result := TdxReportLinkClass(GetTypeData(ClassInfo)^.ClassType); +end; + +class function TBasedxReportLink.Supports(AnObject: TObject): Boolean; +begin + Result := (AnObject <> nil) and Supports(AnObject.ClassType); +end; + +class function TBasedxReportLink.Supports(AClass: TClass): Boolean; +begin + Result := (AClass <> nil) and AClass.InheritsFrom(TComponent) and IsSupportedCompClass(AClass); +end; + +function TBasedxReportLink.Print(AShowDialog: Boolean; + APPrintDlgData: PdxPrintDlgData): Boolean; +begin + if ComponentPrinter <> nil then + begin + ComponentPrinter.CurrentLink := Self; + Result := ComponentPrinter.Print(AShowDialog, APPrintDlgData, Self); + end + else + Result := False; +end; + +procedure TBasedxReportLink.PrintEx(APageNums: TdxPageNumbers; + ACopies: Integer; ACollate: Boolean); +begin + if ComponentPrinter <> nil then + begin + ComponentPrinter.CurrentLink := Self; + ComponentPrinter.PrintEx(APageNums, ACopies, ACollate, Self); + end; +end; + +procedure TBasedxReportLink.PrintPages(const APageIndexes: array of Integer); +begin + if ComponentPrinter <> nil then + begin + ComponentPrinter.CurrentLink := Self; + ComponentPrinter.PrintPages(APageIndexes, Self); + end; +end; + +procedure TBasedxReportLink.PrintPagesEx(const APageIndexes: array of Integer; + APageNums: TdxPageNumbers; ACopyCount: Integer; ACollate: Boolean); +begin + if ComponentPrinter <> nil then + begin + ComponentPrinter.CurrentLink := Self; + ComponentPrinter.PrintPagesEx(APageIndexes, APageNums, ACopyCount, ACollate, Self); + end; +end; + +procedure TBasedxReportLink.BuildPageSetupMenu(ARootItem: TComponent; + AData: Pointer; AIncludeDefineItem: Boolean = True); +var + MenuBuilder: TAbstractdxPSPageSetupMenuBuilder; + Styles: TStringList; +begin + if StyleManager = nil then Exit; + MenuBuilder := dxPSPageSetupMenuBuilderFactory.ActiveBuilder.Create; + try + try + Styles := TStringList.Create; + try + GetFilteredStyles(Styles); + MenuBuilder.BuildPageSetupMenu(ARootItem, AData, AIncludeDefineItem, + Styles, CurrentPrintStyle, StyleClick, DefineStylesClick); + finally + Styles.Free; + end; + except + Application.HandleException(Self); + end; + finally + MenuBuilder.Free; + end; +end; + +procedure TBasedxReportLink.DefinePrintStylesDlg; +var + PreviewBtnClicked, PrintBtnClicked: Boolean; +begin + if StyleManager <> nil then + begin + if ComponentPrinter <> nil then + Include(ComponentPrinter.FState, cpsDefineStylesDialog); + + try + StyleManager.DefinePrintStylesDlg(PreviewBtnClicked, PrintBtnClicked); + finally + if ComponentPrinter <> nil then + Exclude(ComponentPrinter.FState, cpsDefineStylesDialog); + end; + + if PrintBtnClicked then + Print(True, nil) + else + if PreviewBtnClicked then Preview(True); + end; +end; + +procedure TBasedxReportLink.GetFilteredStyles(AStrings: TStrings); +var + I: Integer; + Style: TBasedxPrintStyle; +begin + if StyleManager <> nil then + for I := 0 to StyleManager.Count - 1 do + begin + Style := StyleManager.Styles[I]; + if IsSupportedStyle(Style) then + AStrings.AddObject(Style.StyleCaption, Style); + end; +end; + +function TBasedxReportLink.PageSetup: Boolean; +var + PreviewBtnClicked, PrintBtnClicked: Boolean; +begin + Result := PageSetupEx(0, True, True, PreviewBtnClicked, PrintBtnClicked); + if PreviewBtnClicked then + Preview(True) + else + if PrintBtnClicked then + Result := Print(True, nil); +end; + +function TBasedxReportLink.PageSetupEx(AActivePageIndex: Integer; + AShowPreviewBtn, AShowPrintBtn: Boolean; + out APreviewBtnClicked, APrintBtnClicked: Boolean): Boolean; +var + PrintStyle: TBasedxPrintStyle; + PrintStyleExists: Boolean; +begin + PrintStyle := CurrentPrintStyle; + PrintStyleExists := PrintStyle <> nil; + if not PrintStyleExists then + PrintStyle := TdxPSPrintStyle.Create(nil); + try + if (ComponentPrinter <> nil) and (dxPrintDevice <> nil) and (dxPrintDevice.DeviceMode <> nil) then + PrinterPage.InitFromPrintDevice; + if not PrintStyleExists then PrintStyle.Assign(Self); + if ComponentPrinter <> nil then ComponentPrinter.PreparePageSetup; + try + if not DataProviderPresent then + begin + AShowPreviewBtn := False; + AShowPrintBtn := False; + end; + Result := PrintStyle.PageSetup(AActivePageIndex, AShowPreviewBtn, AShowPrintBtn, + APreviewBtnClicked, APrintBtnClicked); + finally + if ComponentPrinter <> nil then ComponentPrinter.UnpreparePageSetup; + end; + if Result and not PrintStyleExists then + begin + Self.Assign(PrintStyle); + if ComponentPrinter <> nil then + ComponentPrinter.InitDevModeFromPrinterPageSettings(PrinterPage); + end; + if ComponentPrinter <> nil then ComponentPrinter.DoPageSetup(Self, Result); + finally + if not PrintStyleExists then PrintStyle.Free; + end; +end; + +function TBasedxReportLink.PageSetupEx(AActivePageIndex: Integer; + APreviewBtnClicked, APrintBtnClicked: PBoolean): Boolean; +var + ShowPreviewBtn, ShowPrintBtn, PreviewBtnClicked, PrintBtnClicked: Boolean; +begin + ShowPreviewBtn := APreviewBtnClicked <> nil; + ShowPrintBtn := APrintBtnClicked <> nil; + Result := PageSetupEx(AActivePageIndex, ShowPreviewBtn, ShowPrintBtn, PreviewBtnClicked, PrintBtnClicked); + + if ShowPreviewBtn then + APreviewBtnClicked^ := PreviewBtnClicked; + + if ShowPrintBtn then + APrintBtnClicked^ := PrintBtnClicked; +end; + +procedure TBasedxReportLink.Preview(Modal: Boolean = True); +begin + if ComponentPrinter <> nil then + begin + ComponentPrinter.CurrentLink := Self; + ComponentPrinter.Preview(Modal, Self); + end; +end; + +function TBasedxReportLink.PreviewExists: Boolean; +begin + Result := IsCurrentLink and ComponentPrinter.PreviewExists; +end; + +function TBasedxReportLink.ShowDateTimeFormatsDlg: Boolean; +var + Data: TdxDateTimeFormatDlgData; +begin + FillChar(Data, SizeOf(TdxDateTimeFormatDlgData), 0); + with Data do + begin + DateFormats := dxPgsDlg.DateFormats; + TimeFormats := dxPgsDlg.TimeFormats; + DateFormatIndex := DateFormat; + TimeFormatIndex := TimeFormat; + if ComponentPrinter <> nil then + AutoUpdateDateTime := ComponentPrinter.AutoUpdateDateTime; + ShowAsDefaultButton := True; + end; + Result := dxShowDateTimeFormatDlg(Data); + if Result then + begin + if ComponentPrinter <> nil then + begin + ComponentPrinter.AutoUpdateDateTime := Data.AutoUpdateDateTime; + if Data.SetDateTimeFormatAsDefault then + begin + ComponentPrinter.DateFormat := Data.DateFormatIndex; + ComponentPrinter.TimeFormat := Data.TimeFormatIndex; + end; + end; + DateFormat := Data.DateFormatIndex; + TimeFormat := Data.TimeFormatIndex; + end; +end; + +function TBasedxReportLink.ShowPageNumberFormatsDlg: Boolean; +var + Data: TdxPageNumberFormatDlgData; +begin + FillChar(Data, SizeOf(TdxPageNumberFormatDlgData), 0); + with Data do + begin + PageNumberFormats := dxPgsDlg.PageNumberFormats; + PageNumberFormat := Self.PageNumberFormat; + AllowContinueFromPrevSection := AllowContinuousPageIndexes; + if AllowContinueFromPrevSection then + ContinueFromPrevSection := ContinuousPageIndexes; + StartPageIndex := Self.StartPageIndex; + ShowAsDefaultButton := True; + end; + Result := dxShowPageNumberFormatDlg(Data); + if Result then + begin + if (ComponentPrinter <> nil) and Data.SetPageNumberFormatAsDefault then + ComponentPrinter.PageNumberFormat := Data.PageNumberFormat; + PageNumberFormat := Data.PageNumberFormat; + StartPageIndex := Data.StartPageIndex; + if AllowContinuousPageIndexes then + ContinuousPageIndexes := Data.ContinueFromPrevSection; + end; +end; + +function TBasedxReportLink.ShowTitlePropertiesDlg: Boolean; +begin + Result := False; + if CanChangeTitle then + begin + Result := dxShowReportTitlePropertiesDlg(ReportTitle); + if Result and PreviewExists and DataProviderPresent then + RebuildReport; + end; +end; + +function TBasedxReportLink.SupportsScaling: Boolean; +begin + Result := True; +end; + +function TBasedxReportLink.CanChangeTitle: Boolean; +begin + Result := SupportsTitle and not IsAggregated and (DataSource = rldsComponent) and + ((ComponentPrinter = nil) or not ComponentPrinter.IsExplorerMode); +end; + +function TBasedxReportLink.SupportsTitle: Boolean; +begin + Result := True; +end; + +function TBasedxReportLink.CanLoadData: Boolean; +begin + Result := True; +end; + +function TBasedxReportLink.CanSaveData: Boolean; +begin + Result := Serializable and not IsEmptyReport and (DataSource = rldsComponent); +end; + +function TBasedxReportLink.CanUnloadData: Boolean; +begin + Result := DataSource = rldsExternalStorage; +end; + +function TBasedxReportLink.GetNewReportStorageName: string; +const + CRLF = #13#10; +var + P, I: Integer; +begin + Result := ReportTitle.Text; + if Result = '' then + Result := ReportDocument.Caption; + if Result <> '' then + begin + P := Pos(CRLF, Result); + if P <> 0 then + Result := Copy(Result, 1, P - 1); + end; + if Result = '' then + Result := cxGetResourceString(@sdxNewReport); + + for I := 1 to Length(dxPSUtl.InvalidFileNameChars) do + Result := StringReplace(Result, dxPSUtl.InvalidFileNameChars[I], '_', [rfReplaceAll, rfIgnoreCase]); +end; + +procedure TBasedxReportLink.LoadDataFromFile(const AName: string); +var + Stream: TStream; +begin + Stream := TFileStream.Create(AName, fmOpenRead or fmShareDenyWrite); + try + FStorageName := AName; + LoadDataFromStream(Stream); + finally + Stream.Free; + end; +end; + +procedure TBasedxReportLink.LoadDataFromStream(AStream: TStream); +begin + if PossibleDataStorage(AStream, True) then + begin + CopyDataStreamFrom(AStream); + if DataSource <> rldsExternalStorage then + DataSource := rldsExternalStorage + else + if IsRebuildNeededAndAllowed(True) then + RebuildReport; + end; +end; + +procedure TBasedxReportLink.SaveDataToFile(const AName: string); +var + Stream: TStream; +begin + try + Stream := TFileStream.Create(AName, fmCreate);// or fmOpenWrite); + try + SaveDataToStream(Stream); + finally + Stream.Free; + end; + except + // TODO: File is locked + end; +end; + +procedure TBasedxReportLink.SaveDataToStream(AStream: TStream); +var + Writer: TdxPSDataWriter; +begin + if DataProviderPresent and (FReportCells = nil) then RebuildReport; + + if ReportCells <> nil then //HasData + begin + PrepareLongOperation; + try + Include(FState, rlsDataSaving); + try + Writer := CreateDataWriter(AStream); + try + InternalWriteData(Writer); + finally + Writer.Free; + end; + finally + Exclude(FState, rlsDataSaving); + end; + finally + UnprepareLongOperation; + end; + end; +end; + +class function TBasedxReportLink.ExtractComponentClass(AStream: TStream; + ARaiseException: Boolean = False): TComponentClass; +var + StorageInfo: TdxPSDataStorageInfo; +begin + try + StorageInfo := ExtractStorageInfo(AStream, ARaiseException); + try + Result := StorageInfo.ComponentClass; + finally + FinalizeStorageInfo(StorageInfo); + end; + except + Result := nil; + if ARaiseException then raise; + end; +end; + +class function TBasedxReportLink.ExtractLinkClass(AStream: TStream; + ARaiseException: Boolean = False): TdxReportLinkClass; +var + StorageInfo: TdxPSDataStorageInfo; +begin + try + StorageInfo := ExtractStorageInfo(AStream, ARaiseException); + try + Result := StorageInfo.LinkClass; + finally + FinalizeStorageInfo(StorageInfo); + end; + except + Result := nil; + if ARaiseException then raise; + end; +end; + +class function TBasedxReportLink.ExtractOffsetTable(AStream: TStream; + ARaiseException: Boolean = False): TdxPSDataStorageOffsetTable; +var + P: {$IFDEF DELPHI6} Int64 {$ELSE} Integer {$ENDIF}; + Reader: TdxPSDataReader; +begin + Result := nil; + try + P := AStream.Position; + try + AStream.Position := 0; + Reader := CreateDataReader(AStream); + try + Result := ReadOffsetTable(Reader); + finally + Reader.Free; + end; + finally + AStream.Position := P; + end; + except + FreeAndNil(Result); + if ARaiseException then raise; + end; +end; + +class function TBasedxReportLink.ExtractReportDocument(AStream: TStream; + ARaiseException: Boolean = False): TdxPSReportDocument; +var + OffsetTable: TdxPSDataStorageOffsetTable; + P: {$IFDEF DELPHI6} Int64 {$ELSE} Integer {$ENDIF}; + Reader: TdxPSDataReader; +begin + Result := nil; + try + OffsetTable := ExtractOffsetTable(AStream, ARaiseException); + if OffsetTable <> nil then + try + P := AStream.Position; + AStream.Position := OffsetTable.Document; + try + Reader := CreateDataReader(AStream); + try + Result := GetReportDocumentClass.Create(nil); + ReadReportDocument(Reader, Result); + finally + Reader.Free; + end; + finally + AStream.Position := P; + end; + finally + OffsetTable.Free; + end; + except + FreeAndNil(Result); + if ARaiseException then raise; + end; +end; + +class function TBasedxReportLink.ExtractStorageInfo(AStream: TStream; + ARaiseException: Boolean = False): TdxPSDataStorageInfo; +var + OffsetTable: TdxPSDataStorageOffsetTable; + P: {$IFDEF DELPHI6} Int64 {$ELSE} Integer {$ENDIF}; + Reader: TdxPSDataReader; +begin + try + OffsetTable := ExtractOffsetTable(AStream, ARaiseException); + if OffsetTable <> nil then + try + P := AStream.Position; + AStream.Position := OffsetTable.Information; + try + Reader := CreateDataReader(AStream); + try + Result := ReadStorageInfo(Reader); + finally + Reader.Free; + end; + finally + AStream.Position := P; + end; + finally + OffsetTable.Free; + end; + except + FreeAndNil(Result); + if ARaiseException then raise; + end; +end; + +class function TBasedxReportLink.ExtractStorageVersion(AStream: TStream; + ARaiseException: Boolean = False): Integer; +var + StorageInfo: TdxPSDataStorageInfo; +begin + try + StorageInfo := ExtractStorageInfo(AStream, ARaiseException); + try + Result := StorageInfo.StorageVersion; + finally + FinalizeStorageInfo(StorageInfo); + end; + except + Result := dxPSGlbl.dxPSInvalidStorageVersion; + if ARaiseException then raise; + end; +end; + +class procedure TBasedxReportLink.FinalizeStorageInfo(var AStorageInfo: TdxPSDataStorageInfo); +begin + FreeAndNil(AStorageInfo); +end; + +class function TBasedxReportLink.PossibleDataStorage(AStream: TStream; + ARaiseException: Boolean = False): Boolean; +begin + Result := AStream <> nil; + if Result then + try + Result := ExtractStorageVersion(AStream, ARaiseException) = dxPSGlbl.dxPSStorageVersion; + except + Result := False; + if ARaiseException then raise; + end; +end; + +class function TBasedxReportLink.PossibleDataStorage(const AFileName: string; + ARaiseException: Boolean = False): Boolean; +var + Stream: TFileStream; +begin + Result := FileExists(AFileName); + if Result then + try + Stream := TFileStream.Create(AFileName, fmOpenRead or fmShareDenyWrite); + try + Result := PossibleDataStorage(Stream, ARaiseException); + finally + Stream.Free; + end; + except + Result := False; + if ARaiseException then raise; + end; +end; + +function TBasedxReportLink.AddBackgroundBitmapToPool(ABitmap: TBitmap): Integer; +begin + Result := BackgroundBitmapPool.Add(ABitmap); +end; + +function TBasedxReportLink.AddFontToPool(AFont: TFont): Integer; +begin + Result := FontPool.Add(AFont); +end; + +function TBasedxReportLink.CreateGroupLookAndFeel(AClass: TdxPSReportGroupLookAndFeelClass; + ACheckExisting: Boolean = True): TdxPSReportGroupLookAndFeel; +begin + if ReportCells <> nil then + Result := ReportCells.CreateGroupLookAndFeel(AClass, ACheckExisting) + else + Result := nil; +end; + +function TBasedxReportLink.FindGroupLookAndFeelByClass(AClass: TdxPSReportGroupLookAndFeelClass): TdxPSReportGroupLookAndFeel; +begin + if ReportCells <> nil then + Result := ReportCells.FindGroupLookAndFeelByClass(AClass) + else + Result := nil; +end; + +function TBasedxReportLink.IndexOfReportGroupLookAndFeel(ALookAndFeel: TdxPSReportGroupLookAndFeel): Integer; +begin + if ReportCells <> nil then + Result := ReportCells.IndexOfReportGroupLookAndFeel(ALookAndFeel) + else + Result := -1; +end; + +procedure TBasedxReportLink.DrawPageHeader(APageIndex: Integer; ARect: TRect; + ATitleParts: TdxPageTitleParts; ADrawBackground: Boolean); +begin + if FPainting then + Renderer.RenderPageHeaderOrFooterContent(RealPrinterPage.PageHeader, + APageIndex, ARect, ATitleParts, ADrawBackground); +end; + +procedure TBasedxReportLink.DrawPageFooter(APageIndex: Integer; ARect: TRect; + ATitleParts: TdxPageTitleParts; ADrawBackground: Boolean); +begin + if FPainting then + Renderer.RenderPageHeaderOrFooterContent(RealPrinterPage.PageFooter, + APageIndex, ARect, ATitleParts, ADrawBackground); +end; + +procedure TBasedxReportLink.DrawCheckBox(Canvas: TCanvas; var R: TRect; + Checked, Enabled, FlatBorder: Boolean; BoldBorder: Boolean = False); +var + EdgeStyle: TdxCheckButtonEdgeStyle; +begin + if FPainting then + begin + EdgeStyle := cbes3D; + if FlatBorder then + EdgeStyle := cbesUltraFlat + else + if BoldBorder then + EdgeStyle := cbesBoldFlat; + Renderer.DrawCheckBox(Canvas.Handle, R, Checked, Enabled, False, EdgeStyle); + end; +end; + +procedure TBasedxReportLink.DrawCheckBox(Canvas: TCanvas; var R: TRect; + Checked, Enabled, IsRadio: Boolean; EdgeStyle: TdxCheckButtonEdgeStyle; + BorderColor: TColor = clWindowText); +begin + if FPainting then + Renderer.DrawCheckBox(Canvas.Handle, R, Checked, Enabled, IsRadio, EdgeStyle, BorderColor); +end; + +procedure TBasedxReportLink.DrawEdge(Canvas: TCanvas; var R: TRect; + EdgeMode: TdxCellEdgeMode; InnerEdge, OuterEdge: TdxCellEdgeStyle; + Sides: TdxCellSides = [csLeft..csBottom]; Soft: Boolean = True); +begin + if FPainting then + Renderer.DrawEdge(Canvas.Handle, R, EdgeMode, {InnerEdge, } OuterEdge, Sides, Soft, -1); +end; + +procedure TBasedxReportLink.DrawEllipse(Canvas: TCanvas; R: TRect; ForeColor, BkColor: TColor; + Pattern: TdxPSFillPatternClass; BorderColor: TColor; BorderThickness: Integer = 1); +begin + if FPainting then + Renderer.DrawEllipse(Canvas.Handle, R, ForeColor, BkColor, Pattern, BorderColor, BorderThickness); +end; + +procedure TBasedxReportLink.DrawExpandButton(Canvas: TCanvas; var R: TRect; + Expanded, DrawBorder, Edge3D, Edge3DSoft, Shadow, FillInterior: Boolean; + BorderColor, InteriorColor: TColor); +begin + if FPainting then + Renderer.DrawExpandButton(Canvas.Handle, R, Expanded, DrawBorder, Edge3D, + Edge3DSoft, Shadow, FillInterior, BorderColor, InteriorColor); +end; + +procedure TBasedxReportLink.DrawGlyph(DC: HDC; const R: TRect; AGlyph: Byte); +begin + if FPainting then + Renderer.DrawGlyph(DC, R, AGlyph); +end; + +procedure TBasedxReportLink.DrawGraphic(Canvas: TCanvas; var R: TRect; + const ClipRect: TRect; ImageList: TCustomImageList; ImageIndex: Integer; + Graphic: TGraphic; GraphicTransparent, Transparent: Boolean; BkColor: TColor); +begin + if FPainting then + Renderer.DrawGraphic(Canvas.Handle, R, ClipRect, ImageList, ImageIndex, + Graphic, GraphicTransparent, Transparent, BkColor); +end; + +procedure TBasedxReportLink.DrawGraphicEx(Canvas: TCanvas; var R: TRect; + const ClipRect: TRect; ImageList: TCustomImageList; ImageIndex: Integer; + Graphic: TGraphic; GraphicTransparent, Transparent: Boolean; + BkColor, ForeColor: TColor; Pattern: TdxPSFillPatternClass; + AnActualImageBuffering: TdxCellImageActualBuffering = cibAlways); +begin + if FPainting then + Renderer.DrawGraphicEx(Canvas.Handle, R, ClipRect, ImageList, ImageIndex, + Graphic, GraphicTransparent, Transparent, BkColor, ForeColor, Pattern, + AnActualImageBuffering); +end; + +procedure TBasedxReportLink.DrawRectangle(Canvas: TCanvas; R: TRect; + ForeColor, BkColor: TColor; ContentPattern: TdxPSFillPatternClass; BorderColor: TColor; + BorderThickness: Integer = 1); +begin + if FPainting then + Renderer.DrawRectangle(Canvas.Handle, R, ForeColor, BkColor, ContentPattern, + BorderColor, BorderThickness); +end; + +procedure TBasedxReportLink.DrawRoundRect(Canvas: TCanvas; R: TRect; + CornerWidth, CornerHeight: Integer; ForeColor, BkColor: TColor; + ContentPattern: TdxPSFillPatternClass; BorderColor: TColor; + BorderThickness: Integer = 1); +begin + if FPainting then + Renderer.DrawRoundRect(Canvas.Handle, R, CornerWidth, CornerHeight, + ForeColor, BkColor, ContentPattern, BorderColor, BorderThickness); +end; + +procedure TBasedxReportLink.DrawSortMark(Canvas: TCanvas; var R: TRect; + SortOrder: TdxCellSortOrder; Mono: Boolean); +begin + if FPainting and (SortOrder <> csoNone) then + Renderer.DrawSortMark(Canvas.Handle, R, SortOrder, Mono); +end; + +procedure TBasedxReportLink.DrawText(Canvas: TCanvas; var R: TRect; AIndent: Integer; + const Text: string; Font: TFont; BkColor: TColor; TextAlignX: TdxTextAlignX; + TextAlignY: TdxTextAlignY; FillBackground, Multiline, EndEllipsis: Boolean); +begin + if FPainting then + Renderer.DrawText(Canvas.Handle, R, 0, AIndent, 0, Text, Font, BkColor, + TextAlignX, TextAlignY, FillBackground, Multiline, EndEllipsis, True, True); +end; + +procedure TBasedxReportLink.DrawTextEx(Canvas: TCanvas; var R: TRect; + MaxLineCount: Integer; LeftIndent, RightIndent: Integer; const Text: string; + Font: TFont; BkColor: TColor; TextAlignX: TdxTextAlignX; TextAlignY: TdxTextAlignY; + FillBackground, Multiline, EndEllipsis, PreventLeftTextExceed, + PreventTopTextExceed: Boolean); +begin + if FPainting then + Renderer.DrawText(Canvas.Handle, R, MaxLineCount, LeftIndent, RightIndent, + Text, Font, BkColor, TextAlignX, TextAlignY, FillBackground, Multiline, + EndEllipsis, PreventLeftTextExceed, PreventTopTextExceed); +end; + +procedure TBasedxReportLink.FillEllipse(Canvas: TCanvas; const R: TRect; Color: TColor); +begin + if FPainting then + Renderer.FillEllipse(Canvas.Handle, R, Color); +end; + +procedure TBasedxReportLink.FillEllipseEx(Canvas: TCanvas; const R: TRect; + ForeColor, BkColor: TColor; Pattern: TdxPSFillPatternClass); +begin + if FPainting then + Renderer.FillEllipseEx(Canvas.Handle, R, ForeColor, BkColor, Pattern); +end; + +procedure TBasedxReportLink.FillRectEx(Canvas: TCanvas; const R: TRect; + ForeColor, BkColor: TColor; Pattern: TdxPSFillPatternClass); +begin + if FPainting then + Renderer.FillRectEx(Canvas.Handle, R, ForeColor, BkColor, Pattern); +end; + +procedure TBasedxReportLink.FillRoundRect(Canvas: TCanvas; const R: TRect; + CornerWidth, CornerHeight: Integer; Color: TColor); +begin + if FPainting then + Renderer.FillRoundRect(Canvas.Handle, R, CornerWidth, CornerHeight, Color); +end; + +procedure TBasedxReportLink.FillRoundRectEx(Canvas: TCanvas; const R: TRect; + CornerWidth, CornerHeight: Integer; ForeColor, BkColor: TColor; + Pattern: TdxPSFillPatternClass); +begin + if FPainting then + Renderer.FillRoundRectEx(Canvas.Handle, R, CornerWidth, CornerHeight, + ForeColor, BkColor, Pattern); +end; + +procedure TBasedxReportLink.FillRgnEx(Canvas: TCanvas; Rgn: HRGN; + ForeColor, BkColor: TColor; Pattern: TdxPSFillPatternClass); +begin + if FPainting then + Renderer.FillRgnEx(Canvas.Handle, Rgn, ForeColor, BkColor, Pattern); +end; + +procedure TBasedxReportLink.FrameEllipse(Canvas: TCanvas; R: TRect; Color: TColor; + Thickness: Integer = 1); +begin + if FPainting then + Renderer.FrameEllipse(Canvas.Handle, R, Color, Thickness); +end; + +procedure TBasedxReportLink.FrameRect(Canvas: TCanvas; R: TRect; Color: TColor; + Sides: TdxCellSides = [csLeft..csBottom]; Thickness: Integer = 1); +begin + if FPainting then + Renderer.FrameRect(Canvas.Handle, R, Color, Sides, Thickness); +end; + +procedure TBasedxReportLink.FrameRoundRect(Canvas: TCanvas; R: TRect; + CornerWidth, CornerHeight: Integer; Color: TColor; Thickness: Integer = 1); +begin + if FPainting then + Renderer.FrameRoundRect(Canvas.Handle, R, CornerWidth, CornerHeight, Color, Thickness); +end; + +function TBasedxReportLink.RealPageIndexToVirtualPageIndex(APageIndex: Integer; + ATakeIntoAccountEmptyPages: Boolean): Integer; +begin + Result := RenderInfo.RealPageIndexToVirtualPageIndex(APageIndex, ATakeIntoAccountEmptyPages); +end; + +function TBasedxReportLink.VirtualPageIndexToRealPageIndex(APageIndex: Integer): Integer; +begin + Result := RenderInfo.VirtualPageIndexToRealPageIndex(APageIndex); +end; + +{$IFNDEF DELPHI6} + +{ IUnknown } + +function TBasedxReportLink.QueryInterface(const IID: TGUID; out Obj): HRESULT; +begin + if GetInterface(IID, Obj) then + Result := S_OK + else + Result := E_NOINTERFACE; +end; + +function TBasedxReportLink._Addref: Integer; +begin + Result := -1; +end; + +function TBasedxReportLink._Release: Integer; +begin + Result := -1; +end; + +{$ENDIF} + +procedure TBasedxReportLink.AssignTo(Dest: TPersistent); +begin + if Dest is TBasedxPrintStyle then + TBasedxPrintStyle(Dest).PrinterPage := PrinterPage + else + inherited; +end; + +procedure TBasedxReportLink.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('BuiltInReportLink', ReadBuiltIn, WriteBuiltIn, True); + Filer.DefineProperty('IsDesignerCaptionAssigned', ReadIsDesignerCaptionAssigned, WriteIsDesignerCaptionAssigned, + FIsDesignerCaptionAssigned and (DesignerCaption = '')); + Filer.DefineProperty('LinkedComponentName', + ReadComponentName, WriteComponentName, InternalStreaming and (Component <> nil)); + Filer.DefineProperty('StyleManagerName', + ReadStyleManagerName, WriteStyleManagerName, InternalStreaming and (StyleManager <> nil)); +end; + +procedure TBasedxReportLink.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if Operation = opRemove then + begin + if AComponent = Component then Component := nil; + if AComponent = StyleManager then StyleManager := nil; + end; +end; + +procedure TBasedxReportLink.ReadState(Reader: TReader); +begin + inherited ReadState(Reader); + if Reader.Parent is TCustomdxComponentPrinter then + ComponentPrinter := Reader.Parent as TCustomdxComponentPrinter; +end; + +procedure TBasedxReportLink.SetName(const NewName: TComponentName); +begin + inherited SetName(NewName); + if Caption = '' then Caption := NewName; + DesignerUpdate(False); +end; + +procedure TBasedxReportLink.SetParentComponent(AParent: TComponent); +begin + inherited; + if not IsLoading then + ComponentPrinter := AParent as TCustomdxComponentPrinter; +end; + +procedure TBasedxReportLink.FontChanged(Sender: TObject); +begin + LinkModified(True); +end; + +procedure TBasedxReportLink.LinkModified(Value: Boolean); +var + Compositions: TList; + I: Integer; +begin + FRebuildNeeded := Value; + if ComponentPrinter <> nil then + begin + Compositions := TList.Create; + try + ComponentPrinter.GetCompositionsByLink(Self, Compositions); + for I := 0 to Compositions.Count - 1 do + TdxCompositionReportLink(Compositions[I]).LinkModified(Value); + finally + Compositions.Free; + end; + end; +end; + +function TBasedxReportLink.IsFontStored: Boolean; +begin + Result := not dxPSUtl.dxAreFontsEqual(Font, DefaultFont); +end; + +procedure TBasedxReportLink.SetColor(Value: TColor); +begin + if FColor <> Value then + begin + FColor := Value; + LinkModified(True); + end; +end; + +procedure TBasedxReportLink.SetContinuousPageIndexes(Value: Boolean); +begin +end; + +procedure TBasedxReportLink.SetFont(Value: TFont); +begin + Font.Assign(Value); +end; + +procedure TBasedxReportLink.SetTransparent(Value: Boolean); +begin + if FTransparent <> Value then + begin + FTransparent := Value; + LinkModified(True); + end; +end; + +procedure TBasedxReportLink.AfterDesignReport(ADone: Boolean); +begin + if ComponentPrinter <> nil then + ComponentPrinter.DoDesignReport(Self, ADone); +end; + +procedure TBasedxReportLink.BeforeDesignReport; +begin + if ComponentPrinter <> nil then + ComponentPrinter.DoBeforeDesignReport(Self); +end; + +procedure TBasedxReportLink.AfterPrinting; +begin + if CurrentPrintStyle <> nil then CurrentPrintStyle.AfterPrinting; +end; + +procedure TBasedxReportLink.BeforePrinting; +begin + if CurrentPrintStyle <> nil then CurrentPrintStyle.BeforePrinting; +end; + +function TBasedxReportLink.GetBreakPagesByHardDelimiters: Boolean; +begin + Result := False; +end; + +function TBasedxReportLink.CalculateActualScaleFactor: Integer; +begin + with RealPrinterPage do + begin + // Get Result in internal units -> convert from LoMetric to Inches and then from Inches to internal units (units used inside PS) + Result := MulDiv(PaintRectLoMetric.Right - PaintRectLoMetric.Left, FUnitsPerInch, 254); + // Take into account ScaleFactor + Result := MulDiv(Result, 100, ReportWidth) - 1; + end; +end; + +function TBasedxReportLink.CannotActivateReportErrorString: string; +begin + if DataSource = rldsComponent then + Result := cxGetResourceString(@sdxMissingComponent) + else + Result := cxGetResourceString(@sdxInvalidExternalStorage); +end; + +function TBasedxReportLink.CurrentComposition: TdxCompositionReportLink; +begin + if ComponentPrinter <> nil then + Result := ComponentPrinter.CurrentCompositionByLink(Self) + else + Result := nil; +end; + +procedure TBasedxReportLink.SetRealPrinterPage(Value: TdxPrinterPage); +begin + RealPrinterPage.Assign(Value); +end; + +function TBasedxReportLink.GetAllowContinuousPageIndexes: Boolean; +begin + Result := False; +end; + +function TBasedxReportLink.GetAlwaysBufferedGraphics: Boolean; +begin + Result := True; +end; + +function TBasedxReportLink.GetContinuousPageIndexes: Boolean; +begin + Result := False; +end; + +function TBasedxReportLink.GetEmptyPagesCanExist: Boolean; +begin + Result := False; +end; + +procedure TBasedxReportLink.SetFootersOnEveryPage(Value: Boolean); +begin + if not IsAggregated then FFootersOnEveryPage := Value +end; + +procedure TBasedxReportLink.SetHeadersOnEveryPage(Value: Boolean); +begin + if not IsAggregated then FHeadersOnEveryPage := Value +end; + +function TBasedxReportLink.GetRealScaleFactor: Integer; +begin + with RealPrinterPage do + if ScaleMode = smAdjust then + Result := ScaleFactor + else + Result := CalculateActualScaleFactor; +end; + +function TBasedxReportLink.GetReportHeight: Integer; +begin + if ReportCells <> nil then + Result := ReportCells.CalculateTotalHeight + else + Result := 0; +end; + +function TBasedxReportLink.GetReportWidth: Integer; +begin + if ReportCells <> nil then + Result := ReportCells.CalculateTotalWidth + else + Result := 0; +end; + +procedure TBasedxReportLink.DefineStylesClick(Sender: TObject); +begin + DefinePrintStylesDlg; +end; + +procedure TBasedxReportLink.StyleClick(Sender: TObject); +var + PreviewBtnClicked, PrintBtnClicked: Boolean; + PrevCurrentStyle, Style: TBasedxPrintStyle; +begin + if StyleManager = nil then Exit; + + try + Style := dxPSPageSetupMenuBuilderFactory.ActiveBuilder.ExtractPrintStyleFromObj(Sender); + except + Style := nil; + Application.HandleException(Self); + end; + if Style = nil then Exit; + + PrevCurrentStyle := StyleManager.CurrentStyle; + StyleManager.CurrentStyle := Style; + + if (ComponentPrinter <> nil) and not ComponentPrinter.IsForegroundPreviewWindow then + begin + if not PageSetupEx(0, True, True, PreviewBtnClicked, PrintBtnClicked) then + StyleManager.CurrentStyle := PrevCurrentStyle; + + if PrintBtnClicked then + Print(True, nil) + else + if PreviewBtnClicked then Preview(True); + end; +end; + +procedure TBasedxReportLink.SetCurrentPage(Value: Integer); +begin + if Value < 1 then + Value := 1; + if Value > PageCount then + Value := PageCount; + FCurrentPage := Value; +end; + +procedure TBasedxReportLink.DoCustomDrawEntirePage(ACanvas: TCanvas; R: TRect; + ARealPageIndex: Integer); +var + Nom: Integer; +begin + with ComponentPrinter do + begin + Nom := 100; + if PreviewExists then + Nom := PreviewWindow.ZoomFactor; + DoCustomDrawEntirePage(Self, ACanvas, ARealPageIndex, R, Nom, 100); + end; +end; + +procedure TBasedxReportLink.DoCustomDrawPageHeaderOrFooter(AHFObject: TCustomdxPageObject; + ACanvas: TCanvas; APageIndex: Integer; R: TRect; + var ADefaultDrawText, ADefaultDrawBackground: Boolean); +begin + DoParentCustomDrawPageHeaderOrFooter(AHFObject, ACanvas, APageIndex, R, + ADefaultDrawText, ADefaultDrawBackground, PixelsNumerator); + if ADefaultDrawText or ADefaultDrawBackground then + if AHFObject is TdxPageHeader then + begin + if Assigned(FOnCustomDrawPageHeader) then + FOnCustomDrawPageHeader(Self, ACanvas, APageIndex, R, + PixelsNumerator, PixelsDenominator, ADefaultDrawText, ADefaultDrawBackground) + end + else + if Assigned(FOnCustomDrawPageFooter) then + FOnCustomDrawPageFooter(Self, ACanvas, APageIndex, R, + PixelsNumerator, PixelsDenominator, ADefaultDrawText, ADefaultDrawBackground); +end; + +procedure TBasedxReportLink.DoCustomDrawPageTitle(ACanvas: TCanvas; R: TRect; + var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var AColor: TColor; AFont: TFont; var ADone: Boolean); +begin + DoParentCustomDrawReportTitle(ACanvas, R, ATextAlignX, ATextAlignY, + AColor, AFont, ADone, PixelsNumerator); + if not ADone and Assigned(FOnCustomDrawReportLinkTitle) then + FOnCustomDrawReportLinkTitle(Self, ACanvas, R, PixelsNumerator, + PixelsDenominator, ATextAlignX, ATextAlignY, AColor, AFont, ADone); +end; + +procedure TBasedxReportLink.DoParentCustomDrawPageHeaderOrFooter( + AHFObject: TCustomdxPageObject; ACanvas: TCanvas; APageIndex: Integer; + R: TRect; var ADefaultDrawText, ADefaultDrawBackground: Boolean; + APixelsNumerator: Integer); +begin + ComponentPrinter.DoCustomDrawPageHeaderOrFooter(Self, AHFObject, ACanvas, + APageIndex, R, ADefaultDrawText, ADefaultDrawBackground, APixelsNumerator); +end; + +procedure TBasedxReportLink.DoParentCustomDrawReportTitle(ACanvas: TCanvas; R: TRect; + var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var AColor: TColor; AFont: TFont; var ADone: Boolean; APixelsNumerator: Integer); +begin + ComponentPrinter.DoCustomDrawReportTitle(Self, ACanvas, R, ATextAlignX, ATextAlignY, + AColor, AFont, ADone, APixelsNumerator); +end; + +procedure TBasedxReportLink.PaintPage(ACanvas: TCanvas; const APageBounds: TRect; + APageIndex, AContinuousPageIndex, AZoomFactor: Integer); //; ARenderer: TdxPSReportRenderer); +begin + FPainting := True; + try + Renderer.RenderPage(ACanvas, APageBounds, APageIndex, AContinuousPageIndex, AZoomFactor); + finally + FPainting := False; + end; +end; + +function TBasedxReportLink.IsEntirePageCustomDrawn: Boolean; +begin + Result := Assigned(ComponentPrinter.FOnCustomDrawPage); +end; + +function TBasedxReportLink.IsHeaderOrFooterCustomDrawn(AHFObject: TCustomdxPageObject): Boolean; +begin + if AHFObject is TdxPageHeader then + Result := Assigned(ComponentPrinter.FOnCustomDrawPageHeader) or Assigned(FOnCustomDrawPageHeader) + else + Result := Assigned(ComponentPrinter.FOnCustomDrawPageFooter) or Assigned(FOnCustomDrawPageFooter); +end; + +function TBasedxReportLink.IsTitleCustomDrawn: Boolean; +begin + Result := + Assigned(ComponentPrinter.FOnCustomDrawReportTitle) or + Assigned(FOnCustomDrawReportLinkTitle); +end; + +function TBasedxReportLink.IsComposable(AComposition: TdxCompositionReportLink): Boolean; +begin + Result := True; +end; + +function TBasedxReportLink.IsSupportedStyle(APrintStyle: TBasedxPrintStyle): Boolean; +begin + Result := True; + if Assigned(FOnFilterStyle) then + begin + FOnFilterStyle(Self, APrintStyle, Result); + if not Result and (APrintStyle = CurrentPrintStyle) then + Result := True; + end; +end; + +function TBasedxReportLink.NeedTwoPassRendering: Boolean; +begin + Result := False; +end; + +procedure TBasedxReportLink.DesignerModified; +begin + if ComponentPrinter <> nil then ComponentPrinter.DesignerModified; +end; + +procedure TBasedxReportLink.DesignerUpdate(TheAll: Boolean); +begin + if ComponentPrinter <> nil then + if TheAll then + ComponentPrinter.DesignerUpdate(nil) + else + ComponentPrinter.DesignerUpdate(Self); +end; + +function TBasedxReportLink.IsDesigning: Boolean; +begin + Result := csDesigning in ComponentState; +end; + +function TBasedxReportLink.IsDestroying: Boolean; +begin + Result := csDestroying in ComponentState; +end; + +function TBasedxReportLink.IsLoading: Boolean; +begin + Result := csLoading in ComponentState; +end; + +procedure TBasedxReportLink.DoMeasureReportLinkTitle(var AHeight: Integer); +begin + if ComponentPrinter <> nil then + ComponentPrinter.DoMeasureReportTitle(Self, AHeight); + if Assigned(FOnMeasureReportLinkTitle) then + FOnMeasureReportLinkTitle(Self, AHeight); +end; + +function TBasedxReportLink.GetCriticalSize(AReportCells: TdxReportCells): Integer; +begin + with AReportCells.BoundsRect do + Result := Right - Left; +end; + +procedure TBasedxReportLink.GetImageLists(AProc: TdxPSGetImageListProc); +begin +end; + +function TBasedxReportLink.NeedCalcEmptyPages: Boolean; +begin + Result := EmptyPagesCanExist and not ShrinkToPageWidth; +end; + +function TBasedxReportLink.PageReady(APageIndex: Integer): Boolean; +begin + Result := True; +end; + +procedure TBasedxReportLink.PrepareFonts(UPI: Integer); +begin + if FFontPool <> nil then FontPool.PrepareFonts(UPI); +end; + +procedure TBasedxReportLink.PrepareLongOperation; +begin + if ComponentPrinter <> nil then ComponentPrinter.PrepareLongOperation; +end; + +procedure TBasedxReportLink.UnprepareLongOperation; +begin + if ComponentPrinter <> nil then ComponentPrinter.UnprepareLongOperation; +end; + +function TBasedxReportLink.CreateReportDocument: TdxPSReportDocument; +begin + Result := GetReportDocumentClass.Create(Self); +end; + +procedure TBasedxReportLink.DocumentChanged(Sender: TObject); +begin + if IsCurrentLink then + dxHFFormatObject.DateTime := DateTime; +end; + +class function TBasedxReportLink.GetReportDocumentClass: TdxPSReportDocumentClass; +begin + Result := TdxPSReportDocument; +end; + +function TBasedxReportLink.CreateReportCells: TdxReportCells; +begin + Result := GetReportCellsClass.Create(Self); +end; + +function TBasedxReportLink.GetReportCellsClass: TdxReportCellsClass; +begin + Result := TdxReportCells; +end; + +class function TBasedxReportLink.CreateDataReader(AStream: TStream): TdxPSDataReader; +begin + Result := TdxPSDataReader.Create(AStream, 4096); +end; + +class function TBasedxReportLink.CreateDataWriter(AStream: TStream): TdxPSDataWriter; +begin + Result := TdxPSDataWriter.Create(AStream, 4096); +end; + +class function TBasedxReportLink.GetDataReaderClass: TdxPSDataReaderClass; +begin + Result := dxPSReaderFactory.ActualReaderClass; +end; + +class function TBasedxReportLink.GetDataWriterClass: TdxPSDataWriterClass; +begin + Result := dxPSWriterFactory.ActualWriterClass; +end; + +procedure TBasedxReportLink.InternalLoadDataFromStream(AStream: TStream); +var + Reader: TdxPSDataReader; +begin + Include(FState, rlsDataLoading); + try + Reader := CreateDataReader(AStream); + try + try + InternalReadData(Reader); + except + ClearGDIPools; + AddFontToPool(Font); + ReportTitle.Assign(FSavedReportTitle); + ReportDocument.Assign(FSavedReportDocument); + raise; + end; + finally + Reader.Free; + end; + finally + Exclude(FState, rlsDataLoading); + end; +end; + +procedure TBasedxReportLink.InternalReadData(AReader: TdxPSDataReader); +var + OffsetTable: TdxPSDataStorageOffsetTable; +begin + OffsetTable := ReadOffsetTable(AReader); + try + AReader.Position := OffsetTable.Information; + SkipStorageInfo(AReader); + + AReader.Position := OffsetTable.Document; + ReadReportDocument(AReader, ReportDocument); + + AReader.Position := OffsetTable.Title; + ReadTitle(AReader); + + AReader.Position := OffsetTable.Data; + ReadData(AReader); + finally + OffsetTable.Free; + end; +end; + +procedure TBasedxReportLink.InternalWriteData(AWriter: TdxPSDataWriter); +var + OffsetTable: TdxPSDataStorageOffsetTable; + P: Longint; +begin + WriteOffsetTable(AWriter, nil); + + OffsetTable := TdxPSDataStorageOffsetTable.Create(nil); + try + OffsetTable.Information := AWriter.Position; + WriteStorageInfo(AWriter, RetrieveStorageInfo); + + OffsetTable.Document := AWriter.Position; + WriteReportDocument(AWriter, ReportDocument); + + OffsetTable.Title := AWriter.Position; + WriteTitle(AWriter); + + OffsetTable.Data := AWriter.Position; + WriteData(AWriter); + + P := AWriter.Position; + AWriter.Position := 0; + + WriteOffsetTable(AWriter, OffsetTable); + finally + OffsetTable.Free; + end; + AWriter.Position := P; +end; + +function TBasedxReportLink.IsRebuildNeededAndAllowed(ACheckPreviewMode: Boolean): Boolean; +begin + Result := IsCurrentLink and DataProviderPresent and not IsAggregated and + (not ACheckPreviewMode or PreviewExists); +end; + +function TBasedxReportLink.RetrieveStorageInfo: TdxPSDataStorageInfo; +begin + Result := TdxPSDataStorageInfo.Create(Self); +end; + +procedure TBasedxReportLink.ReadData(AReader: TdxPSDataReader); +begin + ReadReportData(AReader); + ReadRenderInfo(AReader); + ReadBackgroundBitmapPool(AReader); + ReadFontPool(AReader); +end; + +class function TBasedxReportLink.ReadOffsetTable(AReader: TdxPSDataReader): TdxPSDataStorageOffsetTable; +begin + Result := TdxPSDataStorageOffsetTable.Create(nil); + Result.ReadData(AReader); +end; + +class procedure TBasedxReportLink.ReadReportDocument(AReader: TdxPSDataReader; + AReportDocument: TdxPSReportDocument); +begin + AReportDocument.ReadData(AReader); +end; + +class function TBasedxReportLink.ReadStorageInfo(AReader: TdxPSDataReader): TdxPSDataStorageInfo; +begin + Result := TdxPSDataStorageInfo.Create(nil); + Result.ReadData(AReader); +end; + +class procedure TBasedxReportLink.SkipStorageInfo(AReader: TdxPSDataReader); +var + StorageInfo: TdxPSDataStorageInfo; +begin + StorageInfo := nil; + try + StorageInfo := ReadStorageInfo(AReader); + except + FreeAndNil(StorageInfo); + raise; + end; +end; + +procedure TBasedxReportLink.ReadTitle(AReader: TdxPSDataReader); +begin + ReportTitle.ReadData(AReader); +end; + +procedure TBasedxReportLink.WriteData(AWriter: TdxPSDataWriter); +begin + WriteReportData(AWriter); + WriteRenderInfo(AWriter); + WriteBackgroundBitmapPool(AWriter); + WriteFontPool(AWriter); +end; + +class procedure TBasedxReportLink.WriteOffsetTable(AWriter: TdxPSDataWriter; + AnOffsetTable: TdxPSDataStorageOffsetTable); +var + OffsetTable: TdxPSDataStorageOffsetTable; +begin + OffsetTable := TdxPSDataStorageOffsetTable.Create(AnOffsetTable); + try + OffsetTable.WriteData(AWriter); + finally + OffsetTable.Free; + end; +end; + +class procedure TBasedxReportLink.WriteStorageInfo(AWriter: TdxPSDataWriter; + AStorageInfo: TdxPSDataStorageInfo); +begin + AStorageInfo.WriteData(AWriter); +end; + +class procedure TBasedxReportLink.WriteReportDocument(AWriter: TdxPSDataWriter; + AReportDocument: TdxPSReportDocument); +begin + AReportDocument.WriteData(AWriter); +end; + +procedure TBasedxReportLink.WriteTitle(AWriter: TdxPSDataWriter); +begin + ReportTitle.WriteData(AWriter); +end; + +procedure TBasedxReportLink.ReadBackgroundBitmapPool(AReader: TdxPSDataReader); +begin + BackgroundBitmapPool.ReadData(AReader); +end; + +procedure TBasedxReportLink.ReadReportData(AReader: TdxPSDataReader); +begin + if FReportCells = nil then FReportCells := TdxReportCells.Create(Self); + ReportCells.ReadData(AReader); +end; + +procedure TBasedxReportLink.ReadFontPool(AReader: TdxPSDataReader); +begin + FontPool.ReadData(AReader); +end; + +procedure TBasedxReportLink.ReadRenderInfo(AReader: TdxPSDataReader); +begin + RenderInfo.ReadData(AReader); +end; + +procedure TBasedxReportLink.WriteBackgroundBitmapPool(AWriter: TdxPSDataWriter); +begin + BackgroundBitmapPool.WriteData(AWriter); +end; + +procedure TBasedxReportLink.WriteFontPool(AWriter: TdxPSDataWriter); +begin + FontPool.WriteData(AWriter); +end; + +procedure TBasedxReportLink.WriteReportData(AWriter: TdxPSDataWriter); +begin + ReportCells.WriteData(AWriter); +end; + +procedure TBasedxReportLink.WriteRenderInfo(AWriter: TdxPSDataWriter); +begin + RenderInfo.WriteData(AWriter); +end; + +procedure TBasedxReportLink.SetActive(Value: Boolean); +begin + if (csReading in ComponentState) and Value then + FStreamedActive := Value + else + if (FActive <> Value) and (ComponentPrinter <> nil) then + if Value then + ComponentPrinter.ActivateLink(Self) + else + ComponentPrinter.DeactivateLink(Self); +end; + +procedure TBasedxReportLink.SetComponent(Value: TComponent); +begin + if not (csReading in ComponentState) then + begin + if FComponent <> Value then + begin + if PreviewExists then + ComponentPrinter.DestroyPreviewWindow; + + if Value = nil then + begin + Active := False; + FComponent := nil; + end + else + if IsSupportedCompClass(TComponentClass(Value.ClassType)) then + SetComponentUnconditionally(Value) + else + ComponentUnsupportedError(Value); + + if not IsDestroying and not IsLoading then + begin + DoChangeComponent; + if ComponentPrinter <> nil then ComponentPrinter.DoChangeComponent(Self); + DesignerUpdate(False); + end; + end; + end + else + FComponent := Value; +end; + +procedure TBasedxReportLink.SetShowPageFooter(Value: Boolean); +begin + if FShowPageFooter <> Value then + begin + FShowPageFooter := Value; + ShowPageFooterChanged; + end; +end; + +procedure TBasedxReportLink.SetShowPageHeader(Value: Boolean); +begin + if FShowPageHeader <> Value then + begin + FShowPageHeader := Value; + ShowPageHeaderChanged; + end; +end; + +{procedure TBasedxReportLink.SetShrinkToPageHeight(Value: Boolean); +begin + +end;} + +procedure TBasedxReportLink.SetShrinkToPageWidth(Value: Boolean); +const + ScaleModeMap: array[Boolean] of TdxScaleMode = (smAdjust, smFit); +begin + if ShrinkToPageWidth <> Value then + begin + PrepareLongOperation; + try + with RealPrinterPage do + begin + BeginUpdate; + try + if Value then + begin + FitToPagesByTall := 1; + FitToPagesByWide := 1; + end; + ScaleMode := ScaleModeMap[Value]; + finally + EndUpdate; + end; + end; + finally + UnprepareLongOperation; + end; + end; +end; + +procedure TBasedxReportLink.SetShowEmptyPages(Value: Boolean); +begin + if FShowEmptyPages <> Value then + begin + FShowEmptyPages := Value; + ShowEmptyPagesChanged; + end; +end; + +procedure TBasedxReportLink.SetDateTime(const Value: TDateTime); +begin + ReportDocument.CreationDate := Value; +end; + +procedure TBasedxReportLink.SetDesignerCaption(const Value: string); +begin + if DesignerCaption <> Value then + begin + FDesignerCaption := Value; + FIsDesignerCaptionAssigned := True; + end; +end; + +procedure TBasedxReportLink.SetDescription(const Value: string); +begin + ReportDocument.Description := Value; +end; + +function TBasedxReportLink.GetDateFormat: Integer; +begin + if not (fvDate in AssignedFormatValues) and (ComponentPrinter <> nil) then + Result := ComponentPrinter.DateFormat + else + Result := FDateFormat; +end; + +function TBasedxReportLink.GetDateTime: TDateTime; +begin + Result := ReportDocument.CreationDate; +end; + +function TBasedxReportLink.GetDescription: string; +begin + Result := ReportDocument.Description; +end; + +function TBasedxReportLink.GetDesignerCaption: string; +begin + if FIsDesignerCaptionAssigned then + Result := FDesignerCaption + else + Result := DefaultDesignerCaption; +end; + +function TBasedxReportLink.GetIndex: Integer; +begin + if ComponentPrinter <> nil then + Result := ComponentPrinter.IndexOfLink(Self) + else + Result := -1; +end; + +function TBasedxReportLink.GetIsAggregated: Boolean; +begin + Result := Controller <> nil; +end; + +function TBasedxReportLink.GetIsBuilding: Boolean; +begin + Result := (ComponentPrinter <> nil) and (cpsBuilding in ComponentPrinter.State); +end; + +function TBasedxReportLink.GetIsCurrentLink: Boolean; +begin + Result := (ComponentPrinter <> nil) and (ComponentPrinter.CurrentLink = Self); +end; + +function TBasedxReportLink.GetPageHeight: Integer; +begin + with RealPrinterPage.PaintRectPixels do + Result := Bottom - Top - 1; +end; + +function TBasedxReportLink.GetPageNumberFormat: TdxPageNumberFormat; +begin + if not (fvPageNumber in AssignedFormatValues) and (ComponentPrinter <> nil) then + Result := ComponentPrinter.PageNumberFormat + else + Result := FPageNumberFormat; +end; + +function TBasedxReportLink.GetPageWidth: Integer; +begin + with RealPrinterPage.PaintRectPixels do + Result := Right - Left - 1; +end; + +function TBasedxReportLink.GetPreviewWindow: TBasedxPreviewWindow; +begin + if ComponentPrinter <> nil then + Result := ComponentPrinter.PreviewWindow + else + Result := nil; +end; + +function TBasedxReportLink.GetRealPrinterPage: TdxPrinterPage; +var + Style: TBasedxPrintStyle; + Composition: TdxCompositionReportLink; +begin + Result := nil; + if ComponentPrinter <> nil then + begin + Composition := ComponentPrinter.CurrentCompositionByLink(Self); + if Composition <> nil then Result := Composition.RealPrinterPage; + end; + if Result = nil then + begin + Style := CurrentPrintStyle; + if Style <> nil then + Result := Style.PrinterPage + else + Result := FPrinterPage; + end; +end; + +function TBasedxReportLink.GetReportTitleMode: TdxReportTitleMode; +begin + Result := ReportTitle.Mode; +end; + +function TBasedxReportLink.GetReportTitleText: string; +begin + Result := ReportTitle.Text; +end; + +function TBasedxReportLink.GetRenderer: TdxPSReportRenderer; +begin + if FRenderer = nil then FRenderer := CreateRenderer; + Result := FRenderer; +end; + +function TBasedxReportLink.GetRenderInfo: TdxPSReportRenderInfo; +begin + if FRenderInfo = nil then FRenderInfo := CreateRenderInfo; + Result := FRenderInfo; +end; + +function TBasedxReportLink.GetRenderStage: TdxPSRenderStages; +begin + if FPainting and (FRenderer <> nil) then + Result := Renderer.RenderStage + else + Result := []; +end; + +function TBasedxReportLink.GetShowEmptyPages: Boolean; +var + Composition: TdxCompositionReportLink; +begin + Result := FShowEmptyPages; + if ComponentPrinter <> nil then + begin + Composition := ComponentPrinter.CurrentCompositionByLink(Self); + if Composition <> nil then Result := Composition.ShowEmptyPages; + end; +end; + +function TBasedxReportLink.GetShowPageFooter: Boolean; +var + Composition: TdxCompositionReportLink; +begin + Result := FShowPageFooter; + if ComponentPrinter <> nil then + begin + Composition := ComponentPrinter.CurrentCompositionByLink(Self); + if Composition <> nil then Result := Composition.ShowPageFooter; + end; +end; + +function TBasedxReportLink.GetShowPageHeader: Boolean; +var + Composition: TdxCompositionReportLink; +begin + Result := FShowPageHeader; + if ComponentPrinter <> nil then + begin + Composition := ComponentPrinter.CurrentCompositionByLink(Self); + if Composition <> nil then Result := Composition.ShowPageHeader; + end; +end; + +{function TBasedxReportLink.GetShrinkToPageHeight: Boolean; +begin + with RealPrinterPage do + Result := (ScaleMode = smFit) and (FitToPagesByTall = 1); +end;} + +function TBasedxReportLink.GetShrinkToPageWidth: Boolean; +begin + with RealPrinterPage do + Result := (ScaleMode = smFit);// and (FitToPagesByWide = 1); +end; + +function TBasedxReportLink.GetStartPageIndex: Integer; +begin + Result := FStartPageIndex; +end; + +function TBasedxReportLink.GetTimeFormat: Integer; +begin + if not (fvTime in AssignedFormatValues) and (ComponentPrinter <> nil) then + Result := ComponentPrinter.TimeFormat + else + Result := FTimeFormat; +end; + +function TBasedxReportLink.GetVirtualPageCount: Integer; +begin + Result := RenderInfo.VirtualPageCount; +end; + +function TBasedxReportLink.IsDateFormatStored: Boolean; +begin + Result := fvDate in AssignedFormatValues; +end; + +function TBasedxReportLink.IsDesignerCaptionStored: Boolean; +begin + Result := FIsDesignerCaptionAssigned and (DesignerCaption <> DefaultDesignerCaption); +end; + +function TBasedxReportLink.IsTimeFormatStored: Boolean; +begin + Result := fvTime in AssignedFormatValues; +end; + +function TBasedxReportLink.IsPageNumberFormatStored: Boolean; +begin + Result := fvPageNumber in AssignedFormatValues; +end; + +procedure TBasedxReportLink.SetDateFormat(Value: Integer); +begin + if Value < 0 then Value := 0; + if Value > dxPgsDlg.DateFormats.Count - 1 then + Value := dxPgsDlg.DateFormats.Count - 1; + //if FDateFormat <> Value then + begin + FDateFormat := Value; + AssignFormats(fvDate, FDateFormat <> DefaultDateFormat); + if IsCurrentLink then + dxHFFormatObject.DateFormat := dxPgsDlg.DateFormats[FDateFormat]; + end; +end; + +procedure TBasedxReportLink.SetTimeFormat(Value: Integer); +begin + if Value < 0 then Value := 0; + if Value > dxPgsDlg.TimeFormats.Count - 1 then + Value := dxPgsDlg.TimeFormats.Count - 1; + //if FTimeFormat <> Value then + begin + FTimeFormat := Value; + AssignFormats(fvTime, FTimeFormat <> DefaultTimeFormat); + if IsCurrentLink then + dxHFFormatObject.TimeFormat := dxPgsDlg.TimeFormats[FTimeFormat]; + end; +end; + +procedure TBasedxReportLink.SetPageNumberFormat(Value: TdxPageNumberFormat); +begin + //if FPageNumberFormat <> Value then + begin + FPageNumberFormat := Value; + AssignFormats(fvPageNumber, FPageNumberFormat <> DefaultPageNumberFormat); + if IsCurrentLink then + dxHFFormatObject.PageNumberFormat := FPageNumberFormat; + end; +end; + +procedure TBasedxReportLink.SetAbortBuilding(Value: Boolean); +begin + if ComponentPrinter <> nil then + ComponentPrinter.AbortBuilding := Value; +end; + +procedure TBasedxReportLink.SetAssignedFormatValues(Value: TdxAssignedFormatValues); +begin + if DateFormat = DefaultDateFormat then + Exclude(Value, fvDate); + if TimeFormat = DefaultTimeFormat then + Exclude(Value, fvTime); + if PageNumberFormat = DefaultPageNumberFormat then + Exclude(Value, fvPageNumber); + if FAssignedFormatValues <> Value then + begin + FAssignedFormatValues := Value; + DesignerModified; + end; +end; + +procedure TBasedxReportLink.SetCaption(const Value: string); +begin + ReportDocument.Caption := Value; +end; + +function TBasedxReportLink.GetAbortBuilding: Boolean; +begin + Result := (ComponentPrinter <> nil) and ComponentPrinter.AbortBuilding; +end; + +function TBasedxReportLink.GetCaption: string; +begin + Result := ReportDocument.Caption; +end; + +function TBasedxReportLink.GetCurrentPrintStyle: TBasedxPrintStyle; +begin + if StyleManager <> nil then + Result := StyleManager.CurrentStyle + else + Result := nil; +end; + +function TBasedxReportLink.GetFontPool: TdxPSReportFontPool; +begin + if not IsAggregated then + begin + if FFontPool = nil then FFontPool := TdxPSReportFontPool.Create; + Result := FFontPool; + end + else + Result := Controller.FontPool; +end; + +function TBasedxReportLink.GetHasDesignWindow: Boolean; +begin + Result := DesignWindow <> nil; +end; + +function TBasedxReportLink.GetHasPreviewWindow: Boolean; +begin + Result := (ComponentPrinter <> nil) and (ComponentPrinter.PreviewWindow <> nil); +end; + +procedure TBasedxReportLink.RetrievePageAsImage(APageIndex: Integer; AGraphicClass: TGraphicClass; + AGraphic: TGraphic); +begin + if ComponentPrinter <> nil then + TdxComponentPrinter(ComponentPrinter).EnumPagesAsImages([APageIndex], + AGraphicClass, False, RetrievePageAsImageCallBack, AGraphic, nil, nil, Self); +end; + +procedure TBasedxReportLink.RetrievePageAsImageCallBack(AComponentPrinter: TCustomdxComponentPrinter; + AReportLink: TBasedxReportLink; AIndex, APageIndex: Integer; const AGraphic: TGraphic; + AData: Pointer; var AContinue: Boolean); +begin + TGraphic(AData).Assign(AGraphic); +end; + +procedure TBasedxReportLink.ShowEmptyPagesChanged; +begin + if EmptyPagesCanExist and (CurrentComposition = nil) then + CalculateRenderInfos; +end; + +procedure TBasedxReportLink.ShowPageFooterChanged; +begin + if CurrentComposition = nil then CalculateRenderInfos; +end; + +procedure TBasedxReportLink.ShowPageHeaderChanged; +begin + if CurrentComposition = nil then CalculateRenderInfos; +end; + +procedure TBasedxReportLink.StdProcessDataSourceDontPresent; +begin + raise EdxReportLink.Create(CannotActivateReportErrorString); +end; + +procedure TBasedxReportLink.TunePixelsNumerator(AReportCells: TdxReportCells); +const + MaxReportWidth = $7FFF; + MinFactor = 2; +var + Wo, W: Integer; +begin + Wo := GetCriticalSize(AReportCells); + W := MulDiv(Wo, RenderInfo.UnitsPerInch, PixelsDenominator); + if W > MaxReportWidth then + with RenderInfo do + begin + UnitsPerInch := MulDiv(PixelsDenominator, MaxReportWidth, Wo); + UnitsPerInch := UnitsPerInch - UnitsPerInch mod Screen.PixelsPerInch; + if UnitsPerInch < MinFactor * Screen.PixelsPerInch then + UnitsPerInch := MinFactor * Screen.PixelsPerInch; + end; +end; + +procedure TBasedxReportLink.CalculateRenderInfos; +begin + if DataProviderPresent then + begin + PrepareLongOperation; + try + RenderInfo.Calculate; + finally + UnprepareLongOperation; + end; + end; +end; + +procedure TBasedxReportLink.ClearGDIPools; +begin + BackgroundBitmapPool.Clear; + Renderer.BrushPool.Clear; + if (FFontPool <> nil) and not IsAggregated then + FontPool.Clear; +end; + +function TBasedxReportLink.CreateRenderInfo: TdxPSReportRenderInfo; +begin + Result := GetRenderInfoClass.Create(Self); +end; + +procedure TBasedxReportLink.FreeRenderInfos; +begin + FreeAndNil(FRenderInfo); +end; + +function TBasedxReportLink.GetRenderInfoClass: TdxPSReportRenderInfoClass; +begin + Result := TdxPSReportRenderInfo; +end; + +function TBasedxReportLink.CreateRenderer: TdxPSReportRenderer; +begin + Result := GetRendererClass.Create(Self); +end; + +procedure TBasedxReportLink.FreeRenderer; +begin + FreeAndNil(FRenderer); +end; + +function TBasedxReportLink.GetRendererClass: TdxPSReportRendererClass; +begin + Result := TdxPSReportRenderer; +end; + +procedure TBasedxReportLink.InitializeDefaultFont(AFont: TFont); +begin + AFont.CharSet := dxPSDefaultFontCharSet; + AFont.Color := dxPSDefaultFontColor; + AFont.Name := dxPSDefaultFontName; + AFont.Size := dxPSDefaultFontSize; + AFont.Style := dxPSDefaultFontStyle; +end; + +procedure TBasedxReportLink.InternalGetDelimiters(ADelimitersHorz, ADelimitersVert: TList); +begin + dxPSUtl.dxAppendList(RenderInfo.DelimiterXList, ADelimitersHorz); + dxPSUtl.dxAppendList(RenderInfo.DelimiterYList, ADelimitersVert); +end; + +function TBasedxReportLink.GetPageCount: Integer; +begin + Result := RenderInfo.NonEmptyPageCount; + if IsCurrentLink then + dxHFFormatObject.TotalPages := Result; +end; + +function TBasedxReportLink.GetUseHardVertDelimiters: Boolean; +begin + Result := False; +end; + +function TBasedxReportLink.GetVisiblePageCount: Integer; +begin + if ShowEmptyPages then + Result := VirtualPageCount + else + Result := PageCount; +end; + +function TBasedxReportLink.GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; +begin + Result := False; +end; + +procedure TBasedxReportLink.SetStorageName(const Value: string); +begin + if FStorageName <> Value then + begin + FStorageName := Value; + if FileExists(FStorageName) and (DataSource = rldsExternalStorage) then + LoadDataFromFile(FStorageName); + end; +end; + +procedure TBasedxReportLink.SetStyleManager(Value: TdxPrintStyleManager); +begin + if FStyleManager <> Value then + begin + FStyleManager := Value; + if Value <> nil then + Value.FreeNotification(Self); + if not IsDestroying then + PageParamsChanged(RealPrinterPage, CurrentPrintStyle, ucAll); + end; +end; + +procedure TBasedxReportLink.SetPrinterPage(Value: TdxPrinterPage); +begin + PrinterPage.Assign(Value); +end; + +procedure TBasedxReportLink.SetReportDocument(Value: TdxPSReportDocument); +begin + ReportDocument.Assign(Value); +end; + +procedure TBasedxReportLink.SetReportTitleMode(Value: TdxReportTitleMode); +begin + ReportTitle.Mode := Value; +end; + +procedure TBasedxReportLink.SetReportTitleText(const Value: string); +begin + ReportTitle.Text := Value; +end; + +procedure TBasedxReportLink.SetReportTitle(Value: TdxReportTitle); +begin + ReportTitle.Assign(Value); +end; + +procedure TBasedxReportLink.SetComponentPrinter(Value: TCustomdxComponentPrinter); +begin + if FComponentPrinter <> Value then + begin + if FComponentPrinter <> nil then FComponentPrinter.RemoveLink(Self); + if Value <> nil then Value.InsertLink(Self); + end; +end; + +procedure TBasedxReportLink.SetIsCurrentLink(Value: Boolean); +begin + if Value then + if not (csReading in ComponentState) and (ComponentPrinter <> nil) then + ComponentPrinter.CurrentLink := Self; +end; + +procedure TBasedxReportLink.SetDataSource(Value: TdxReportLinkDataSource); +begin + if FDataSource <> Value then + begin + FDataSource := Value; + DoDataSourceChanged; + end; +end; + +procedure TBasedxReportLink.SetIndex(Value: Integer); +var + CurIndex: Integer; +begin + if ComponentPrinter = nil then Exit; + if Value < 0 then Value := 0; + if Value > ComponentPrinter.LinkCount - 1 then + Value := ComponentPrinter.LinkCount - 1; + CurIndex := GetIndex; + if CurIndex <> Value then + ComponentPrinter.MoveLink(CurIndex, Value); +end; + +procedure TBasedxReportLink.ReadBuiltIn(Reader: TReader); +begin + FBuiltIn := Reader.ReadBoolean; +end; + +function GetFullName(AComponent: TComponent): string; +begin + if AComponent = nil then + Result := '' + else + begin + Result := AComponent.Name; + while (AComponent.Name <> '') and (AComponent.Owner <> nil) do + begin + AComponent := AComponent.Owner; + if AComponent.Name <> '' then + Result := AComponent.Name + '.' + Result; + end; + end; +end; + +function GetComponentByName(const AName: string): TComponent; + + procedure CheckOwner(AOwner: TComponent); + var + I: Integer; + AComponent: TComponent; + begin + if Result <> nil then Exit; + for I := 0 to AOwner.ComponentCount - 1 do + begin + AComponent := AOwner.Components[I]; + if SameText(GetFullName(AComponent), AName) then + begin + Result := AComponent; + break; + end + else + CheckOwner(AComponent); + end; + end; + +var + AOwner: TComponent; +begin + Result := nil; + AOwner := Application; + while AOwner.Owner <> nil do + AOwner := AOwner.Owner; + CheckOwner(AOwner); +end; + +procedure TBasedxReportLink.ReadComponentName(AReader: TReader); +begin + Component := GetComponentByName(AReader.ReadString); +end; + +procedure TBasedxReportLink.ReadIsDesignerCaptionAssigned(Reader: TReader); +begin + FIsDesignerCaptionAssigned := Reader.ReadBoolean; +end; + +procedure TBasedxReportLink.ReadStyleManagerName(AReader: TReader); +begin + StyleManager := GetComponentByName(AReader.ReadString) as TdxPrintStyleManager; +end; + +procedure TBasedxReportLink.WriteBuiltIn(Writer: TWriter); +begin + Writer.WriteBoolean(FBuiltIn); +end; + +procedure TBasedxReportLink.WriteComponentName(AWriter: TWriter); +begin + AWriter.WriteString(GetFullName(Component)); +end; + +procedure TBasedxReportLink.WriteIsDesignerCaptionAssigned(Writer: TWriter); +begin + Writer.WriteBoolean(FIsDesignerCaptionAssigned); +end; + +procedure TBasedxReportLink.WriteStyleManagerName(AWriter: TWriter); +begin + AWriter.WriteString(GetFullName(StyleManager)); +end; + +procedure TBasedxReportLink.InternalActivate; +begin + if DataProviderPresent then + try + AbortBuilding := False; + try + DoCreateReport; + finally + FRebuildNeeded := False; + FActive := True; + if AbortBuilding then + begin + FRebuildNeeded := True; + DoDestroyReport; + end; + end; + except + on E: Exception do + begin + DoDestroyReport; + if IsDesigning then + ShowException(E, ExceptAddr) + else + raise; + end; + end + else + DoDataProviderDontPresent; +end; + +procedure TBasedxReportLink.InternalRestoreDefaults; +begin + Transparent := True; + Color := dxDefaultContentColor; {clWhite} + Font := DefaultFont; + FootersOnEveryPage := False; + HeadersOnEveryPage := False; + + PageNumberFormat := DefaultPageNumberFormat; + DateFormat := DefaultDateFormat; + TimeFormat := DefaultTimeFormat; + + FIsDesignerCaptionAssigned := False; +end; + +procedure TBasedxReportLink.InternalRestoreFromOriginal; +begin + if Component is TControl then + begin + Color := dxPSUtl.Control_GetColor(TControl(Component)); + Font := dxPSUtl.Control_GetFont(TControl(Component)); + end; +end; + +procedure TBasedxReportLink.SetUseHorzDelimiters(Value: Boolean); +begin + if FUseHorzDelimiters <> Value then + begin + FUseHorzDelimiters := Value; + LinkModified(True); + end; +end; + +procedure TBasedxReportLink.SetUseVertDelimiters(Value: Boolean); +begin + if FUseVertDelimiters <> Value then + begin + FUseVertDelimiters := Value; + LinkModified(True); + end; +end; + +procedure TBasedxReportLink.AssignFormats(AnItem: TdxAssignedFormatValue; AValue: Boolean); +begin + if AValue then + Include(FAssignedFormatValues, AnItem) + else + Exclude(FAssignedFormatValues, AnItem); +end; + +function TBasedxReportLink.ValidateMargins: Boolean; +begin + Result := RealPrinterPage.ValidateMargins; + if not Result then + begin + Result := MessageQuestion(cxGetResourceString(@sdxOutsideMarginsMessage)); + if Result then + RealPrinterPage.FixMarginsOutSide; + end; +end; + +procedure TBasedxReportLink.SetStartPageIndex(Value: Integer); +begin + if Value < 1 then Value := 1; + if FStartPageIndex <> Value then + begin + FStartPageIndex := Value; + dxHFFormatObject.StartPageIndex := Value; + end; +end; + +procedure TBasedxReportLink.DoDestroy; +begin + if Assigned(FOnDestroy) then FOnDestroy(Self); +end; + +procedure TBasedxReportLink.ComponentUnsupportedError(AComponent: TComponent); +begin + if not IsDesigning then + raise EdxReportLink.CreateFmt(cxGetResourceString(@sdxComponentNotSupportedByLink), [AComponent.ClassName]); +end; + +procedure TBasedxReportLink.DoChangeComponent; +begin + if Assigned(FOnChangeComponent) then FOnChangeComponent(Self); +end; + +procedure TBasedxReportLink.DoProgress(const APercentDone: Double); +begin + if (ComponentPrinter <> nil) and not IsAggregated then + ComponentPrinter.DoProgress(Self, APercentDone); +end; + +function TBasedxReportLink.GetDesignerClass: TdxReportLinkDesignWindowClass; +begin + if Component <> nil then + Result := dxPSDesignerClassByCompClass(TComponentClass(Component.ClassType)) + else + Result := dxPSDesignerClassByLinkClass(LinkClass); +end; + +procedure TBasedxReportLink.DoApplyInDesigner; +begin + RebuildReport; +end; + +procedure TBasedxReportLink.DoCreateReport; +begin + if FReportCells = nil then + FReportCells := CreateReportCells; + DoCreateReportData; + + if not AbortBuilding and not IsInvalidReport then + if not IsAggregated then + begin + if IsWin95Or98 then + TunePixelsNumerator(FReportCells); + FPixelsNumerator := RenderInfo.UnitsPerInch; + if DataSource = rldsComponent then + begin + PrepareReportGroupsLookAndFeels; + ConvertCoords; + RenderInfo.GetDelimiters; + end; + CalculateRenderInfos; + end + else + if DataSource = rldsComponent then RenderInfo.GetDelimiters; +end; + +procedure TBasedxReportLink.DoCreateReportData; +var + ReraiseException: Boolean; +begin + case DataSource of + rldsComponent: + ConstructReport(FReportCells); + + rldsExternalStorage: + try + InternalLoadDataFromStream(DataStream); + DataStream.Position := 0; + except + ReraiseException := (ComponentPrinter <> nil) and (ComponentPrinter.Explorer <> nil); + if not ReraiseException then + MessageError(Format(cxGetResourceString(@sdxReportFileLoadError), [StorageName])); + + FIsInvalidReport := True; + try + DataSource := rldsComponent; + finally + FIsInvalidReport := False; + end; + if ReraiseException then raise; + end; + end; +end; + +procedure TBasedxReportLink.DoDataProviderDontPresent; +begin + if (ComponentPrinter = nil) or (ComponentPrinter.CurrentCompositionByLink(Self) = nil) then + StdProcessDataSourceDontPresent; +end; + +procedure TBasedxReportLink.DoDestroyReport; +begin + FActive := False; + + PrepareLongOperation; + try + FreeAndNil(FReportCells); + if FRenderInfo <> nil then RenderInfo.Refresh; + if ComponentPrinter <> nil then ComponentPrinter.DoBeforeDestroyReport(Self); + finally + UnprepareLongOperation; + end; +end; + +procedure TBasedxReportLink.DoPageParamsChanged; +begin + if ComponentPrinter <> nil then + ComponentPrinter.DoPageParamsChanged(Self); +end; + +procedure TBasedxReportLink.CopyDataStreamFrom(AStream: TStream); +begin + AStream.Position := 0; + FinalizeDataStream; + FDataStream := TMemoryStream.Create; + FDataStream.CopyFrom(AStream, AStream.Size); + FDataStream.Position := 0; +end; + +procedure TBasedxReportLink.FinalizeDataStream; +begin + FreeAndNil(FDataStream); +end; + +function TBasedxReportLink.IsDrawFootersOnEveryPage: Boolean; +begin + Result := FootersOnEveryPage; +end; + +function TBasedxReportLink.IsDrawHeadersOnEveryPage: Boolean; +begin + Result := HeadersOnEveryPage; +end; + +procedure TBasedxReportLink.ConstructReport(AReportCells: TdxReportCells); +begin + ClearGDIPools; + AddFontToPool(Font); +end; + +procedure TBasedxReportLink.ConvertCoords; +begin + FReportCells.ConvertCoords(PixelsNumerator, PixelsDenominator); +end; + +procedure TBasedxReportLink.MakeDelimiters(AReportCells: TdxReportCells; + AHorzDelimiters, AVertDelimiters: TList); +begin +end; + +procedure TBasedxReportLink.MakeHardDelimiters(AReportCells: TdxReportCells; + AVertDelimiters: TList); +begin +end; + +procedure TBasedxReportLink.DoDataSourceChanged; +begin + if Assigned(FOnDataSourceChanged) then FOnDataSourceChanged(Self); + if IsRebuildNeededAndAllowed(True) then + begin + if DataSource = rldsComponent then + begin + ReportDocument.Assign(FSavedReportDocument); + ReportTitle.BeginUpdate; + try + ReportTitle.Assign(FSavedReportTitle); + finally + ReportTitle.CancelUpdate; + end; + end + else + begin + FSavedReportDocument.Assign(ReportDocument); + FSavedReportTitle.Assign(ReportTitle); + end; + RebuildReport; + end + else + if DataSource = rldsComponent then + DestroyReport; +end; + +procedure TBasedxReportLink.CustomDraw(AnItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); +begin +end; + +function TBasedxReportLink.IsScaleGridLines: Boolean; +begin + Result := True; +end; + +function TBasedxReportLink.IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; +begin + Result := False; +end; + +{ TdxCompositionLinkItem } + +constructor TdxCompositionLinkItem.Create(Collection: TCollection); +begin + inherited Create(Collection); + FBuiltIn := (Composition <> nil) and Composition.IsDesigning; +end; + +procedure TdxCompositionLinkItem.Assign(Source: TPersistent); + + function IsInheritedForm: Boolean; + begin + with Composition do + Result := (csUpdating in ComponentState) or (csUpdating in ComponentPrinter.ComponentState) or + ((ComponentPrinter.Owner <> nil) and (csUpdating in ComponentPrinter.Owner.ComponentState)); + end; + +begin + if Source is TdxCompositionLinkItem then + with TdxCompositionLinkItem(Source) do + if (ReportLink <> nil) and (Self.Composition <> nil) and (Self.Composition.ComponentPrinter <> nil) and IsInheritedForm then + Self.ReportLink := Self.Composition.ComponentPrinter.LinkByName(ReportLink.Name) + else + Self.ReportLink := ReportLink + else + inherited; +end; + +procedure TdxCompositionLinkItem.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('BuiltInCompositionItem', ReadData, WriteData, True); + Filer.DefineProperty('LinkName', ReadLinkName, WriteLinkName, + Composition.InternalStreaming and (ReportLink <> nil)); +end; + +procedure TdxCompositionLinkItem.SetIndex(Value: Integer); +begin + if Collection <> nil then + TdxCompositionLinkItems(Collection).FDontNeedRebuild := True; + inherited; +end; + +function TdxCompositionLinkItem.Composition: TdxCompositionReportLink; +begin + if Collection <> nil then + Result := TdxCompositionLinkItems(Collection).Composition + else + Result := nil; +end; + +procedure TdxCompositionLinkItem.SetReportLink(Value: TBasedxReportLink); +begin + if (FReportLink <> Value) and (Collection <> nil) and + ((Value = nil) or TdxCompositionLinkItems(Collection).IsLinkComposable(Value)) then + begin + if (FReportLink <> nil) and (Composition <> nil) and Composition.IsCurrentLink and + Composition.PreviewExists and not TdxCompositionLinkItems(Collection).LinkExists(Value) then + Composition.ComponentPrinter.DestroyPreviewWindow; + FReportLink := Value; + if Collection <> nil then + TdxCompositionLinkItems(Collection).FDontNeedRebuild := False; + Changed(True); + end; +end; + +procedure TdxCompositionLinkItem.ReadData(Reader: TReader); +begin + FBuiltIn := Reader.ReadBoolean; +end; + +procedure TdxCompositionLinkItem.ReadLinkName(Reader: TReader); +begin + FLoadingReportLinkName := Reader.ReadString; +end; + +procedure TdxCompositionLinkItem.WriteData(Writer: TWriter); +begin + Writer.WriteBoolean(FBuiltIn); +end; + +procedure TdxCompositionLinkItem.WriteLinkName(Writer: TWriter); +begin + Writer.WriteString(GetFullName(ReportLink)); +end; + +{ TdxCompositionLinkItems } + +constructor TdxCompositionLinkItems.Create(AComposition: TdxCompositionReportLink); +begin + inherited Create(TdxCompositionLinkItem); + FComposition := AComposition; +end; + +function TdxCompositionLinkItems.Add: TdxCompositionLinkItem; +begin + Result := TdxCompositionLinkItem(inherited Add); +end; + +function TdxCompositionLinkItems.AddLink(AReportLink: TBasedxReportLink): TdxCompositionLinkItem; +begin + if IsLinkComposable(AReportLink) then + begin + Result := Add; + Result.ReportLink := AReportLink; + end + else + Result := nil; +end; + +procedure TdxCompositionLinkItems.DeleteItemsByLink(AReportLink: TBasedxReportLink); +var + List: TList; + I: Integer; +begin + List := TList.Create; + try + GetLinkEntries(AReportLink, List); + if List.Count <> 0 then + begin + BeginUpdate; + try + for I := 0 to List.Count - 1 do + TObject(List[I]).Free; + finally + EndUpdate; + end; + end; + finally + List.Free; + end; +end; + +procedure TdxCompositionLinkItems.DeleteNonBuiltIns; +var + I: Integer; + Item: TdxCompositionLinkItem; +begin + BeginUpdate; + try + for I := Count - 1 downto 0 do + begin + Item := Items[I]; + if not Item.BuiltIn then Item.Free; + end; + finally + EndUpdate; + end; +end; + +procedure TdxCompositionLinkItems.GetLinkEntries(AReportLink: TBasedxReportLink; AList: TList); +var + I: Integer; + Item: TdxCompositionLinkItem; +begin + for I := 0 to Count - 1 do + begin + Item := Items[I]; + if Item.ReportLink = AReportLink then AList.Add(Item); + end; +end; + +function TdxCompositionLinkItems.IndexOfLink(AReportLink: TBasedxReportLink): Integer; +begin + for Result := 0 to Count - 1 do + if AReportLink = Items[Result].ReportLink then + Exit; + Result := -1; +end; + +function TdxCompositionLinkItems.IsLinkComposable(AReportLink: TBasedxReportLink): Boolean; +begin + Result := (AReportLink <> nil) and (Composition <> nil) and AReportLink.IsComposable(Composition) and + (AReportLink.ComponentPrinter = Composition.ComponentPrinter) and + not (AReportLink is TdxCompositionReportLink); +end; + +function TdxCompositionLinkItems.LinkExists(AReportLink: TBasedxReportLink): Boolean; +var + List: TList; +begin + List := TList.Create; + try + GetLinkEntries(AReportLink, List); + Result := List.Count <> 0; + finally + List.Free; + end; +end; + +function TdxCompositionLinkItems.NextAssignedItem(AnItem: TdxCompositionLinkItem): TdxCompositionLinkItem; +var + Index: Integer; +begin + if AnItem <> nil then + Index := AnItem.Index + 1 + else + Index := Count; + while (Index < Count) and (Items[Index].ReportLink = nil) do + Inc(Index); + if Index < Count then + Result := Items[Index] + else + Result := nil; +end; + +function TdxCompositionLinkItems.NonBuiltInsExists: Boolean; +var + I: Integer; +begin + Result := True; + for I := 0 to Count - 1 do + if not Items[I].BuiltIn then Exit; + Result := False; +end; + +function TdxCompositionLinkItems.PrevAssignedItem(AnItem: TdxCompositionLinkItem): TdxCompositionLinkItem; +var + Index: Integer; +begin + if AnItem <> nil then + Index := AnItem.Index - 1 + else + Index := -1; + while (Index > -1) and (Items[Index].ReportLink = nil) do + Dec(Index); + if Index > -1 then + Result := Items[Index] + else + Result := nil; +end; + +procedure TdxCompositionLinkItems.CorrectLinksAfterLoadings; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].FReportLink := GetComponentByName(Items[I].FLoadingReportLinkName) as TBasedxReportLink; +end; + +function TdxCompositionLinkItems.GetOwner: TPersistent; +begin + Result := Composition; +end; + +procedure TdxCompositionLinkItems.Update(Item: TCollectionItem); +begin + if (Composition <> nil) and not Composition.IsDestroying and not Composition.IsLoading then + if FDontNeedRebuild or not Composition.DataProviderPresent then + begin + Composition.UpdateComposition(ucAll); + FDontNeedRebuild := False; + end + else + if Composition.DataProviderPresent then // TODO: Check non PreviewState + Composition.RebuildReport; +end; + +function TdxCompositionLinkItems.GetItem(Index: Integer): TdxCompositionLinkItem; +begin + Result := TdxCompositionLinkItem(inherited Items[Index]); +end; + +procedure TdxCompositionLinkItems.SetItem(Index: Integer; Value: TdxCompositionLinkItem); +begin + inherited SetItem(Index, Value); +end; + +{ TdxPSCompositionReportRenderInfo } + +constructor TdxPSCompositionReportRenderInfo.Create(AReportLink: TBasedxReportLink); +begin + inherited; + FStartIndexes := TList.Create; +end; + +destructor TdxPSCompositionReportRenderInfo.Destroy; +begin + FreeAndNil(FStartIndexes); + inherited; +end; + +function TdxPSCompositionReportRenderInfo.CalculateNonEmptyPageCount: Integer; +var + Items: TStrings; + I: Integer; + RenderInfo: TdxPSReportRenderInfo; +begin + Result := 0; + Items := TStringList.Create; + try + ReportLink.GetItems(Items, True); + for I := 0 to Items.Count - 1 do + begin + RenderInfo := TdxCompositionLinkItem(Items.Objects[I]).ReportLink.RenderInfo; + Inc(Result, RenderInfo.NonEmptyPageCount); + end; + finally + Items.Free; + end; +end; + +function TdxPSCompositionReportRenderInfo.CalculatePageColCount: Integer; +var + Items: TStrings; + I: Integer; + RenderInfo: TdxPSReportRenderInfo; +begin + Result := 0; + Items := TStringList.Create; + try + ReportLink.GetItems(Items, True); + for I := 0 to Items.Count - 1 do + begin + RenderInfo := TdxCompositionLinkItem(Items.Objects[I]).ReportLink.RenderInfo; + if Result < RenderInfo.PageColCount then + Result := RenderInfo.PageColCount; + end; + finally + Items.Free; + end; +end; + +function TdxPSCompositionReportRenderInfo.CalculatePageRowCount: Integer; +var + Items: TStrings; + I: Integer; + RenderInfo: TdxPSReportRenderInfo; +begin + Result := 0; + Items := TStringList.Create; + try + ReportLink.GetItems(Items, True); + for I := 0 to Items.Count - 1 do + begin + RenderInfo := TdxCompositionLinkItem(Items.Objects[I]).ReportLink.RenderInfo; + if Result < RenderInfo.PageRowCount then + Result := RenderInfo.PageRowCount; + end; + finally + Items.Free; + end; +end; + +procedure TdxPSCompositionReportRenderInfo.DoCalculate; +var + Items: TStrings; + PrevPageCount, I: Integer; + Link: TBasedxReportLink; +begin + Items := TStringList.Create; + try + ReportLink.GetItems(Items, True); + FStartIndexes.Count := Items.Count; + + PrevPageCount := 0; + for I := 0 to Items.Count - 1 do + begin + Link := TdxCompositionLinkItem(Items.Objects[I]).ReportLink; + Link.CalculateRenderInfos; + if I = 0 then + StartIndexes[I] := 0 + else + StartIndexes[I] := StartIndexes[I - 1] + PrevPageCount; + + if ReportLink.ShowEmptyPages then + PrevPageCount := Link.RenderInfo.VirtualPageCount + else + PrevPageCount := Link.RenderInfo.NonEmptyPageCount; + + Inc(VirtualPageCount, Link.VirtualPageCount); + end; + finally + Items.Free; + end; +end; + +procedure TdxPSCompositionReportRenderInfo.Refresh; +begin + FNonEmptyPageCount := -1; + FPageColCount := -1; + FPageRowCount := -1; + FStartIndexes.Clear; + inherited; +end; + +function TdxPSCompositionReportRenderInfo.GetNonEmptyPageCount: Integer; +begin + if FNonEmptyPageCount = -1 then + FNonEmptyPageCount := CalculateNonEmptyPageCount; + Result := FNonEmptyPageCount; +end; + +function TdxPSCompositionReportRenderInfo.GetPageColCount: Integer; +begin + if FPageColCount = -1 then + FPageColCount := CalculatePageColCount; + Result := FPageColCount; +end; + +function TdxPSCompositionReportRenderInfo.GetPageRowCount: Integer; +begin + if FPageRowCount = -1 then + FPageRowCount := CalculatePageRowCount; + Result := FPageColCount; +end; + +function TdxPSCompositionReportRenderInfo.RealPageIndexToVirtualPageIndex(APageIndex: Integer; + ATakeIntoAccountEmptyPages: Boolean): Integer; +var + Item: TdxCompositionLinkItem; +begin + GetCompositionLinkItemByPageIndexAndFixIndex(APageIndex, APageIndex, Item); + if Item <> nil then + Result := Item.ReportLink.RealPageIndexToVirtualPageIndex(APageIndex, ATakeIntoAccountEmptyPages) + else + Result := APageIndex; +end; + +function TdxPSCompositionReportRenderInfo.VirtualPageIndexToRealPageIndex(APageIndex: Integer): Integer; +var + Item: TdxCompositionLinkItem; +begin + GetCompositionLinkItemByPageIndexAndFixIndex(APageIndex, APageIndex, Item); + if Item <> nil then + Result := Item.ReportLink.VirtualPageIndexToRealPageIndex(APageIndex) + else + Result := APageIndex; +end; + +procedure TdxPSCompositionReportRenderInfo.GetCompositionLinkItemByPageIndexAndFixIndex( + APageIndex: Integer; var APageIndexRelativeToLink: Integer; var AnItem: TdxCompositionLinkItem); + + function GetPageCount(ARenderInfo: TdxPSReportRenderInfo): Integer; + begin + if ReportLink.ShowEmptyPages then + Result := ARenderInfo.VirtualPageCount + else + Result := ARenderInfo.NonEmptyPageCount; + end; + +var + Items: TStrings; + I: Integer; +begin + APageIndexRelativeToLink := APageIndex; + if (APageIndex = -1) or (FStartIndexes = nil) then + begin + AnItem := nil; + Exit; + end; + + Items := TStringList.Create; + try + ReportLink.GetItems(Items, True); + for I := 0 to Items.Count - 1 do + begin + AnItem := TdxCompositionLinkItem(Items.Objects[I]); + if (StartIndexes[I] <= APageIndex) and (APageIndex < StartIndexes[I] + GetPageCount(AnItem.ReportLink.RenderInfo)) then + begin + Dec(APageIndexRelativeToLink, StartIndexes[I]); + Exit; + end; + end; + AnItem := nil; + finally + Items.Free; + end; +end; + +function TdxPSCompositionReportRenderInfo.GetReportLink: TdxCompositionReportLink; +begin + Result := inherited ReportLink as TdxCompositionReportLink; +end; + +function TdxPSCompositionReportRenderInfo.GetStartIndex(Index: Integer): Integer; +begin + Result := Integer(FStartIndexes[Index]); +end; + +function TdxPSCompositionReportRenderInfo.GetStartIndexCount: Integer; +begin + Result := FStartIndexes.Count; +end; + +procedure TdxPSCompositionReportRenderInfo.SetStartIndex(Index: Integer; Value: Integer); +begin + FStartIndexes[Index] := TObject(Value); +end; + +{ TdxPSCompositionReportRenderer } + +procedure TdxPSCompositionReportRenderer.RenderPage(ACanvas: TCanvas; + const APageBounds: TRect; APageIndex, AContinuousPageIndex, AZoomFactor: Integer); +var + LinkPageIndex: Integer; + Item: TdxCompositionLinkItem; +begin + RenderInfo.GetCompositionLinkItemByPageIndexAndFixIndex(APageIndex, LinkPageIndex, Item); + if (Item <> nil) and (Item.ReportLink <> nil) then + begin + if not ReportLink.ContinuousPageIndexes then + dxHFFormatObject.TotalPages := Item.ReportLink.PageCount; + Item.ReportLink.PaintPage(ACanvas, APageBounds, LinkPageIndex, AContinuousPageIndex, AZoomFactor); + end; +end; + +function TdxPSCompositionReportRenderer.GetRenderInfo: TdxPSCompositionReportRenderInfo; +begin + Result := inherited RenderInfo as TdxPSCompositionReportRenderInfo; +end; + +function TdxPSCompositionReportRenderer.GetReportLink: TdxCompositionReportLink; +begin + Result := inherited ReportLink as TdxCompositionReportLink; +end; + +{ TdxPSReportCompositionDocument } + +function TdxPSReportCompositionDocument.DefaultDescription: string; +begin + Result := cxGetResourceString(@sdxComposition); +end; + +function TdxPSReportCompositionDocument.GetReportLink: TdxCompositionReportLink; +begin + Result := inherited ReportLink as TdxCompositionReportLink; +end; + +{ TdxCompositionReportLink } + +constructor TdxCompositionReportLink.Create(AOwner: TComponent); +begin + inherited; + FContinuousPageIndexes := True; + ReportDocument.Description := cxGetResourceString(@sdxComposition); + FDesignerOptions := [coCanEdit, coShowDescription]; + FItems := TdxCompositionLinkItems.Create(Self); +end; + +destructor TdxCompositionReportLink.Destroy; +begin + FreeAndNil(FItems); + inherited; +end; + +procedure TdxCompositionReportLink.Assign(Source: TPersistent); +begin + if Source is TdxCompositionReportLink then + with TdxCompositionReportLink(Source) do + begin + Self.ContinuousPageIndexes := ContinuousPageIndexes; + Self.DesignerOptions := DesignerOptions; + end; + inherited; +end; + +function TdxCompositionReportLink.DefaultDesignerCaption: string; +begin + Result := cxGetResourceString(@sdxCompositionDesignerCaption); +end; + +function TdxCompositionReportLink.RealPageIndexToVirtualPageIndex(APageIndex: Integer; + ATakeIntoAccountEmptyPages: Boolean): Integer; +var + PageIndexRelativeToLink: Integer; + CurrentItem, Item: TdxCompositionLinkItem; +begin + Result := 0; + RenderInfo.GetCompositionLinkItemByPageIndexAndFixIndex(APageIndex, PageIndexRelativeToLink, CurrentItem); + Item := Items.PrevAssignedItem(CurrentItem); + while Item <> nil do + begin + Inc(Result, Item.ReportLink.VirtualPageCount); + Item := Items.PrevAssignedItem(Item); + end; + if CurrentItem <> nil then + Inc(Result, CurrentItem.ReportLink.RealPageIndexToVirtualPageIndex(PageIndexRelativeToLink, ATakeIntoAccountEmptyPages)); +end; + +function TdxCompositionReportLink.VirtualPageIndexToRealPageIndex(APageIndex: Integer): Integer; +var + PageIndexRelativeToLink: Integer; + CurrentItem, Item: TdxCompositionLinkItem; +begin + Result := 0; + RenderInfo.GetCompositionLinkItemByPageIndexAndFixIndex(APageIndex, PageIndexRelativeToLink, CurrentItem); + Item := Items.PrevAssignedItem(CurrentItem); + while Item <> nil do + begin + Inc(Result, 1 + Item.ReportLink.VirtualPageIndexToRealPageIndex(Item.ReportLink.VirtualPageCount - 1)); + Item := Items.PrevAssignedItem(Item); + end; + if CurrentItem <> nil then + Inc(Result, CurrentItem.ReportLink.VirtualPageIndexToRealPageIndex(PageIndexRelativeToLink)); +end; + +class function TdxCompositionReportLink.CanBeUsedAsStub: Boolean; +begin + Result := False; +end; + +function TdxCompositionReportLink.DataProviderPresent: Boolean; +var + I: Integer; + ReportLink: TBasedxReportLink; +begin + Result := True; + for I := 0 to Items.Count - 1 do + begin + ReportLink := Items[I].ReportLink; + if (ReportLink <> nil) and ReportLink.DataProviderPresent then + Exit; + end; + Result := False; +end; + +function TdxCompositionReportLink.IsEmptyPage(AVirtualPageIndex: Integer): Boolean; +var + PageIndexRelativeToLink: Integer; + CurrentItem: TdxCompositionLinkItem; +begin + RenderInfo.GetCompositionLinkItemByPageIndexAndFixIndex(AVirtualPageIndex, PageIndexRelativeToLink, CurrentItem); + Result := (CurrentItem <> nil) and + CurrentItem.ReportLink.IsEmptyPage(PageIndexRelativeToLink); +end; + +function TdxCompositionReportLink.SupportsTitle: Boolean; +begin + Result := False; +end; + +procedure TdxCompositionReportLink.GetItems(AStrings: TStrings; AExcludeUnassigned: Boolean); +var + I: Integer; + Item: TdxCompositionLinkItem; + S: string; +begin + AStrings.BeginUpdate; + try + for I := 0 to Items.Count - 1 do + begin + Item := Items[I]; + if (Item.ReportLink = nil) and AExcludeUnassigned then + Continue; + if Item.ReportLink = nil then + S := '' + else + S := Item.ReportLink.Caption; + AStrings.AddObject(S, Item); + end; + finally + AStrings.EndUpdate; + end; +end; + +procedure TdxCompositionReportLink.Notification(AComponent: TComponent; AOperation: TOperation); +var + List: TList; + I: Integer; +begin + inherited; + if (AOperation = opRemove) and (AComponent is TBasedxReportLink) and (AComponent <> Self) then + begin + List := TList.Create; + try + Items.GetLinkEntries(TBasedxReportLink(AComponent), List); + for I := 0 to List.Count - 1 do + TdxCompositionLinkItem(List[I]).ReportLink := nil; + finally + List.Free; + end; + end; +end; + +function TdxCompositionReportLink.GetContinuousPageIndexes: Boolean; +begin + Result := FContinuousPageIndexes; +end; + +procedure TdxCompositionReportLink.SetContinuousPageIndexes(Value: Boolean); +begin + if ContinuousPageIndexes <> Value then + begin + FContinuousPageIndexes := Value; + // TODO: Refresh preview + //if PreviewExists then PreviewWindow.InvalidateAllPages; + end; +end; + +function TdxCompositionReportLink.GetAllowContinuousPageIndexes: Boolean; +begin + Result := True; +end; + +function TdxCompositionReportLink.GetEmptyPagesCanExist: Boolean; +var + I: Integer; + ReportLink: TBasedxReportLink; +begin + Result := True; + for I := 0 to Items.Count - 1 do + begin + ReportLink := Items[I].ReportLink; + if (ReportLink <> nil) and ReportLink.GetEmptyPagesCanExist then + Exit; + end; + Result := False; +end; + +function TdxCompositionReportLink.GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; +var + I: Integer; + ReportLink: TBasedxReportLink; +begin + Result := True; + for I := 0 to Items.Count - 1 do + begin + ReportLink := Items[I].ReportLink; + if (ReportLink <> nil) and ReportLink.GetRebuildOnPageParamsChange(AUpdateCodes) then + Exit; + end; + Result := False; +end; + +procedure TdxCompositionReportLink.ConstructReport(AReportCells: TdxReportCells); +begin +end; + +procedure TdxCompositionReportLink.DoCreateReport; +var + I: Integer; + Item: TdxCompositionLinkItem; + ReportLink: TBasedxReportLink; +begin + Include(FCompositionState, csRebuildReportLink); + try + for I := 0 to Items.Count - 1 do + begin + Item := Items[I]; + ReportLink := Item.ReportLink; + if (ReportLink <> nil) and ReportLink.DataProviderPresent and + ((FInvalidatedLinks = nil) or (FInvalidatedLinks.IndexOf(ReportLink) <> -1)) then + begin + DoBeforeBuildReport(Item); + try + ReportLink.RebuildReport; + finally + DoAfterBuildReport(Item); + end; + end; + DoProgress(100 * (I + 1) / Items.Count); + if AbortBuilding then Break; + end; + finally + Exclude(FCompositionState, csRebuildReportLink); + end; + + if not AbortBuilding then CalculateRenderInfos; +end; + +function TdxCompositionReportLink.GetRendererClass: TdxPSReportRendererClass; +begin + Result := TdxPSCompositionReportRenderer; +end; + +function TdxCompositionReportLink.GetRenderInfoClass: TdxPSReportRenderInfoClass; +begin + Result := TdxPSCompositionReportRenderInfo; +end; + +function TdxCompositionReportLink.GetReportHeight: Integer; +var + I: Integer; + ReportLink: TBasedxReportLink; +begin + Result := 0; + for I := 0 to Items.Count - 1 do + begin + ReportLink := Items[I].ReportLink; + if ReportLink <> nil then + Inc(Result, ReportLink.ReportHeight); + end; +end; + +function TdxCompositionReportLink.GetReportWidth: Integer; +var + I, V: Integer; + ReportLink: TBasedxReportLink; +begin + Result := 0; + for I := 0 to Items.Count - 1 do + begin + ReportLink := Items[I].ReportLink; + if ReportLink <> nil then + begin + V := ReportLink.ReportWidth; + if Result < V then Result := V; + end; + end; +end; + +procedure TdxCompositionReportLink.InternalRestoreDefaults; +var + I: Integer; + ReportLink: TBasedxReportLink; +begin + FContinuousPageIndexes := True; + ReportDocument.Description := cxGetResourceString(@sdxComposition); + FDesignerCaption := cxGetResourceString(@sdxCompositionDesignerCaption); + FDesignerOptions := [coCanEdit, coShowDescription]; + for I := 0 to Items.Count - 1 do + begin + ReportLink := Items[I].ReportLink; + if ReportLink <> nil then + ReportLink.RestoreDefaults; + end; +end; + +procedure TdxCompositionReportLink.InternalRestoreFromOriginal; +var + I: Integer; + ReportLink: TBasedxReportLink; +begin + for I := 0 to Items.Count - 1 do + begin + ReportLink := Items[I].ReportLink; + if ReportLink <> nil then + ReportLink.RestoreFromOriginal; + end; +end; + +procedure TdxCompositionReportLink.ShowEmptyPagesChanged; +begin + if EmptyPagesCanExist then CalculateRenderInfos; +end; + +procedure TdxCompositionReportLink.ShowPageFooterChanged; +begin + CalculateRenderInfos; +end; + +procedure TdxCompositionReportLink.ShowPageHeaderChanged; +begin + CalculateRenderInfos; +end; + +procedure TdxCompositionReportLink.StdProcessDataSourceDontPresent; +begin +// raise EdxReportLink.Create(cxGetResourceString(@sdxDataSourceDontPresent)); +end; + +procedure TdxCompositionReportLink.DoAfterBuildReport(AItem: TdxCompositionLinkItem); +begin + if Assigned(FOnAfterBuildReport) then FOnAfterBuildReport(Self, AItem); +end; + +procedure TdxCompositionReportLink.DoBeforeBuildReport(AItem: TdxCompositionLinkItem); +begin + if Assigned(FOnBeforeBuildReport) then FOnBeforeBuildReport(Self, AItem); +end; + +class function TdxCompositionReportLink.GetReportDocumentClass: TdxPSReportDocumentClass; +begin + Result := TdxPSReportCompositionDocument; +end; + +class function TdxCompositionReportLink.Serializable: Boolean; +begin + Result := False; +end; + +function TdxCompositionReportLink.GetRenderer: TdxPSCompositionReportRenderer; +begin + Result := inherited Renderer as TdxPSCompositionReportRenderer; +end; + +function TdxCompositionReportLink.GetRenderInfo: TdxPSCompositionReportRenderInfo; +begin + Result := inherited RenderInfo as TdxPSCompositionReportRenderInfo; +end; + +function TdxCompositionReportLink.GetReportDocument: TdxPSReportCompositionDocument; +begin + Result := inherited ReportDocument as TdxPSReportCompositionDocument; +end; + +procedure TdxCompositionReportLink.SetItems(Value: TdxCompositionLinkItems); +begin + FItems.Assign(Value); +end; + +procedure TdxCompositionReportLink.SetReportDocument(Value: TdxPSReportCompositionDocument); +begin + inherited ReportDocument := Value; +end; + +procedure TdxCompositionReportLink.ActivateLink(AReportLink: TBasedxReportLink); +begin + Include(FCompositionState, csRebuildReportLink); + try + FInvalidatedLinks := TList.Create; + try + FInvalidatedLinks.Add(AReportLink); + RebuildReport; + finally + FreeAndNil(FInvalidatedLinks); + end; + finally + Exclude(FCompositionState, csRebuildReportLink); + end; +end; + +procedure TdxCompositionReportLink.UpdateComposition(AUpdateCodes: TdxPrinterPageUpdateCodes); +begin + PageParamsChanged(RealPrinterPage, CurrentPrintStyle, AUpdateCodes); +end; + +{ TAbstractdxReportLinkDesignWindow } + +constructor TAbstractdxReportLinkDesignWindow.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Caption := cxGetResourceString(@sdxReportDesignerCaption); +end; + +function TAbstractdxReportLinkDesignWindow.Execute: Boolean; +begin + Include(FState, dwsInitialize); + try + Initialize; + finally + Exclude(FState, dwsInitialize); + end; + Result := (ReportLink <> nil) and (ShowModal = mrOK);// and Modified and not Applyed; +end; + +procedure TAbstractdxReportLinkDesignWindow.CreateWnd; +begin + inherited; + if Icon.Handle = 0 then + Icon_LoadFromResourceName(Icon, IDB_DXPSREPORTDESIGNER); + SendMessage(Handle, WM_SETICON, 1, Icon.Handle); +end; + +procedure TAbstractdxReportLinkDesignWindow.KeyDown(var Key: Word; Shift: TShiftState); +begin + if (ReportLink <> nil) and ReportLink.PreviewExists and ReportLink.IsBuilding and (Key = VK_ESCAPE) then + ReportLink.AbortBuilding := True + else + inherited; +end; + +procedure TAbstractdxReportLinkDesignWindow.AfterRebuildReport; +begin + KeyPreview := FPrevKeyPreview; +end; + +procedure TAbstractdxReportLinkDesignWindow.BeforeRebuildReport; +begin + FPrevKeyPreview := KeyPreview; + KeyPreview := True; +end; + +procedure TAbstractdxReportLinkDesignWindow.Initialize; +begin + LoadStrings; + Caption := ReportLink.DesignerCaption; + if ReportLink.IsDesigning and (Component <> nil) then + Caption := Caption + ' : ' + Component.Name; + if ReportLink.DesignerHelpContext <> 0 then + HelpContext := ReportLink.DesignerHelpContext; +end; + +procedure TAbstractdxReportLinkDesignWindow.LoadStrings; +begin +end; + +procedure TAbstractdxReportLinkDesignWindow.UpdateControlsState; +begin +end; + +function TAbstractdxReportLinkDesignWindow.GetComponent: TComponent; +begin + if ReportLink <> nil then + Result := ReportLink.Component + else + Result := nil; +end; + +function TAbstractdxReportLinkDesignWindow.GetIsDesigning: Boolean; +begin + Result := (ReportLink <> nil) and Reportlink.IsDesigning; +end; + +function TAbstractdxReportLinkDesignWindow.IsCaptionStored: Boolean; +begin //TODO: TAbstractdxReportLinkDesignWindow.IsCaptionStored + Result := Caption <> cxGetResourceString(@sdxReportDesignerCaption); +end; + +procedure TAbstractdxReportLinkDesignWindow.SetModified(Value: Boolean); +begin + FModified := Value; + if Modified and Applyed then Applyed := False; + UpdateControlsState; +end; + +procedure TAbstractdxReportLinkDesignWindow.WMHelp(var Message: TWMHelp); +var + Control: TWinControl; + ContextID: Integer; +begin + if csDesigning in ComponentState then + inherited + else + begin + ContextID := 0; + with Message.HelpInfo^ do + if iContextType = HELPINFO_WINDOW then + begin + Control := FindControl(hItemHandle); + if Control = nil then Exit; + Control := GetParentForm(Control); + if Control = nil then Exit; + ContextID := Control.HelpContext; + end; + if ContextID <> 0 then Application.HelpContext(ContextID); + end; +end; + +{ TStandarddxReportLinkDesignWindow } + +constructor TStandarddxReportLinkDesignWindow.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + CreateStdButtons; + {$IFDEF DELPHI7} + if PreviewHost <> nil then + begin + if ThemeServices.ThemesEnabled then + begin + TCustomPanelAccess(PreviewHost).BevelInner := bvNone; + TCustomPanelAccess(PreviewHost).BevelOuter := bvNone; + end; + FPrevPreviewHostWindowProc := PreviewHost.WindowProc; + PreviewHost.WindowProc := PreviewHostWindowProc; + end; + {$ENDIF} +end; + +{$IFDEF DELPHI7} +destructor TStandarddxReportLinkDesignWindow.Destroy; +begin + if PreviewHost <> nil then + PreviewHost.WindowProc := FPrevPreviewHostWindowProc; + inherited; +end; +{$ENDIF} + +procedure TStandarddxReportLinkDesignWindow.PlaceStdButtons; +const + btnWidth = 75; + btnLargeWidth = 115; + btnHeight = 23; + btnFirstOffsetX: array[Boolean] of Integer = (4, 10); + btnOffsetX = 4; + btnOffsetY = 6; +var + AWidth, ALargeWidth, AHeight, AOffsetX, AFirstOffsetX, AOffsetY: Integer; +begin + AWidth := MulDiv(btnWidth, Screen.PixelsPerInch, 96); + ALargeWidth := MulDiv(btnLargeWidth, Screen.PixelsPerInch, 96); + AHeight := MulDiv(btnHeight, Screen.PixelsPerInch, 96); + AFirstOffsetX := MulDiv(btnFirstOffsetX[foSizeableDialog in Options], Screen.PixelsPerInch, 96); + AOffsetX := MulDiv(btnOffsetX, Screen.PixelsPerInch, 96); + AOffsetY := MulDiv(btnOffsetY, Screen.PixelsPerInch, 96); + + if btnHelp.Visible then + begin + btnHelp.BoundsRect := + MakeBounds(ClientWidth - AFirstOffsetX - AWidth, ClientHeight - AOffsetY - AHeight, AWidth, AHeight); + btnApply.BoundsRect := + MakeBounds(btnHelp.Left - AOffsetX - AWidth, ClientHeight - AOffsetY - AHeight, AWidth, AHeight); + end + else + btnApply.BoundsRect := + MakeBounds(ClientWidth - AFirstOffsetX - AWidth, ClientHeight - AOffsetY - AHeight, AWidth, AHeight); + + btnCancel.BoundsRect := + MakeBounds(btnApply.Left - AOffsetX - AWidth, ClientHeight - AOffsetY - AHeight, AWidth, AHeight); + btnOK.BoundsRect := + MakeBounds(btnCancel.Left - AOffsetX - AWidth, ClientHeight - AOffsetY - AHeight, AWidth, AHeight); + btnRestoreOriginal.BoundsRect := + MakeBounds(AOffsetX, ClientHeight - AOffsetY - AHeight, ALargeWidth, AHeight); + btnRestoreDefaults.BoundsRect := + MakeBounds(btnRestoreOriginal.BoundsRect.Right + AOffsetX, ClientHeight - AOffsetY - AHeight, ALargeWidth, AHeight); + btnTitleProperties.BoundsRect := + MakeBounds(AOffsetX, ClientHeight - AOffsetY - AHeight, ALargeWidth, AHeight); +end; + +procedure TStandarddxReportLinkDesignWindow.CreateStdButtons; +begin + btnHelp := TButton.Create(Self); + try + btnHelp.Name := sdxHelpButtonName; + except + end; + btnHelp.Parent := Self; + + btnApply := TButton.Create(Self); + btnApply.Parent := Self; + btnApply.TabOrder := btnHelp.TabOrder - 1; + btnApply.OnClick := ApplyClick; + + btnCancel := TButton.Create(Self); + btnCancel.Parent := Self; + btnCancel.Cancel := True; + btnCancel.ModalResult := mrCancel; + btnCancel.TabOrder := btnApply.TabOrder - 1; + + btnOK := TButton.Create(Self); + btnOK.Parent := Self; + btnOK.Default := True; + btnOK.ModalResult := mrOK; + btnOK.TabOrder := btnCancel.TabOrder - 1; + + btnRestoreOriginal := TButton.Create(Self); + btnRestoreOriginal.Parent := Self; + btnRestoreOriginal.TabOrder := btnOK.TabOrder - 1; + btnRestoreOriginal.OnClick := RestoreOriginalClick; + + btnRestoreDefaults := TButton.Create(Self); + btnRestoreDefaults.Parent := Self; + btnRestoreDefaults.TabOrder := btnRestoreOriginal.TabOrder - 1; + btnRestoreDefaults.OnClick := RestoreDefaultsClick; + + btnTitleProperties := TButton.Create(Self); + btnTitleProperties.Parent := Self; + btnTitleProperties.OnClick := TitlePropertiesClick; +end; + +procedure TStandarddxReportLinkDesignWindow.RestoreOriginalClick(Sender: TObject); +begin + BeginUpdateControls; + try + if ReportLink <> nil then ReportLink.RestoreFromOriginal; + DoInitialize; + finally + EndUpdateControls; + end; + Modified := True; +end; + +procedure TStandarddxReportLinkDesignWindow.RestoreDefaultsClick(Sender: TObject); +begin + BeginUpdateControls; + try + if ReportLink <> nil then ReportLink.RestoreDefaults; + DoInitialize; + finally + EndUpdateControls; + end; + Modified := True; +end; + +procedure TStandarddxReportLinkDesignWindow.TitlePropertiesClick(Sender: TObject); +begin + if (ReportLink <> nil) and ReportLink.ShowTitlePropertiesDlg then + begin + if not ReportLink.AbortBuilding then + begin + AtLeastOneTimeApplied := True; + Applyed := True; + end; + UpdateControlsState; + end; +end; + +procedure TStandarddxReportLinkDesignWindow.ApplyClick(Sender: TObject); +begin + DoApply; +end; + +procedure TStandarddxReportLinkDesignWindow.RegroupStdButtons; +var + StartTabOrder: Integer; +begin + Resize; + if HelpContext = 0 then + begin + btnOK.BoundsRect := btnCancel.BoundsRect; + btnCancel.BoundsRect := btnApply.BoundsRect; + btnApply.BoundsRect := btnHelp.BoundsRect; + btnHelp.Visible := False; + end + else + BorderIcons := BorderIcons + [biHelp]; + + btnRestoreOriginal.Visible := ReportLink.IsDesigning; + btnRestoreDefaults.Visible := ReportLink.IsDesigning; + if btnTitleProperties.Visible then + btnTitleProperties.Visible := ReportLink.CanChangeTitle and not ReportLink.IsDesigning; + if ReportLink.IsDesigning then + begin + btnRestoreOriginal.TabOrder := 0; + btnRestoreDefaults.TabOrder := 1; + end + else + if ReportLink.CanChangeTitle then + btnTitleProperties.TabOrder := 0; + + StartTabOrder := 1 + Byte(ReportLink.IsDesigning); + btnOk.TabOrder := StartTabOrder; + btnCancel.TabOrder := StartTabOrder + 1; + btnApply.TabOrder := StartTabOrder + 2; + btnHelp.TabOrder := StartTabOrder + 3; +end; + +procedure TStandarddxReportLinkDesignWindow.Resize; +begin + PlaceStdButtons; + inherited; +end; + +function TStandarddxReportLinkDesignWindow.CanApply: Boolean; +begin + Result := (ReportLink <> nil) and ReportLink.DataProviderPresent and + ReportLink.PreviewExists and Modified and not Applyed and not ReportLink.IsAggregated; +end; + +procedure TStandarddxReportLinkDesignWindow.DoApply; +begin + try + ReportLink.DoApplyInDesigner; + except + Application.HandleException(Self); + ModalResult := mrCancel; + raise; + end; + if not ReportLink.AbortBuilding then + begin + AtLeastOneTimeApplied := True; + Applyed := True; + end; + UpdateControlsState; +end; + +procedure TStandarddxReportLinkDesignWindow.Initialize; +begin + BeginUpdateControls; + try + inherited; + RegroupStdButtons; + DoInitialize; + finally + UpdateControlsState; + EndUpdateControls; + end; +end; + +procedure TStandarddxReportLinkDesignWindow.LoadStrings; +begin + inherited; + btnOK.Caption := cxGetResourceString(@sdxBtnOK); + btnCancel.Caption := cxGetResourceString(@sdxBtnCancel); + btnApply.Caption := cxGetResourceString(@sdxBtnApply); + btnHelp.Caption := cxGetResourceString(@sdxBtnHelp); + btnRestoreDefaults.Caption := cxGetResourceString(@sdxBtnRestoreDefaults); + btnRestoreOriginal.Caption := cxGetResourceString(@sdxBtnRestoreOriginal); + btnTitleProperties.Caption := cxGetResourceString(@sdxBtnTitleProperties); +end; + +procedure TStandarddxReportLinkDesignWindow.UpdateControlsState; +begin + if btnTitleProperties <> nil then + btnTitleProperties.Enabled := not ReportLink.IsAggregated; + if btnApply <> nil then + btnApply.Enabled := CanApply; + if btnRestoreOriginal <> nil then + btnRestoreOriginal.Enabled := (ReportLink <> nil) and ReportLink.DataProviderPresent; +end; + +procedure TStandarddxReportLinkDesignWindow.DoInitialize; +begin +end; + +{$IFDEF DELPHI7} + +function TStandarddxReportLinkDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := nil; +end; + +procedure TStandarddxReportLinkDesignWindow.PreviewHostWindowProc(var Message: TMessage); +var + Control: TWinControl; + R: TRect; + Details: TThemedElementDetails; + DC: HDC; + PS: TPaintStruct; +begin + if ThemeServices.ThemesEnabled and (Message.Msg = WM_PAINT) then + begin + Control := PreviewHost; + DC := BeginPaint(Control.Handle, PS); + try + R := Control.ClientRect; + Details := ThemeServices.GetElementDetails(ttBody); + ThemeServices.DrawElement(DC, Details, Control.Parent.ClientRect); + + Details := ThemeServices.GetElementDetails(teEditTextNormal); + ThemeServices.DrawEdge(DC, Details, R, BDR_SUNKENOUTER, BF_RECT or BF_FLAT); + InflateRect(R, -1, -1); + ThemeServices.DrawEdge(DC, Details, R, BDR_RAISEDINNER, BF_RECT or BF_FLAT); + finally + EndPaint(Control.Handle, PS); + end; + end + else + FPrevPreviewHostWindowProc(Message); +end; + +{$ENDIF} + +procedure TStandarddxReportLinkDesignWindow.PaintPreview(ACanvas: TCanvas; R: TRect); +{$IFDEF DELPHI7} +var + Details: TThemedElementDetails; +{$ENDIF} +begin + {$IFDEF DELPHI7} + if (PreviewHost <> nil) and ThemeServices.ThemesEnabled then + begin + Details := ThemeServices.GetElementDetails(ttBody); + ThemeServices.DrawElement(ACanvas.Handle, Details, PreviewHost.Parent.ClientRect); + Exit; + end; + {$ENDIF} + ACanvas.Brush.Color := clWindow; + ACanvas.FillRect(R); +end; + +procedure TStandarddxReportLinkDesignWindow.UpdatePreview; +begin +end; + +procedure TStandarddxReportLinkDesignWindow.BeginUpdateControls; +begin + Inc(FUpdateControlsCount); +end; + +procedure TStandarddxReportLinkDesignWindow.EndUpdateControls; +begin + if FUpdateControlsCount > 0 then + begin + Dec(FUpdateControlsCount); + if FUpdateControlsCount = 0 then UpdatePreview; + end; +end; + +function TStandarddxReportLinkDesignWindow.LockControlsUpdate: Boolean; +begin + Result := FUpdateControlsCount <> 0; +end; + +procedure TStandarddxReportLinkDesignWindow.SetAtLeastOneTimeApplied(Value: Boolean); +begin + if FAtLeastOneTimeApplied <> Value then + begin + FAtLeastOneTimeApplied := Value; + if FAtLeastOneTimeApplied then + btnCancel.Caption := cxGetResourceString(@sdxBtnClose) + else + btnCancel.Caption := cxGetResourceString(@sdxBtnCancel); + end; +end; + +{ TdxPSPrintStyle } + +constructor TdxPSPrintStyle.Create(AOwner: TComponent); +begin + inherited; + AddStdHFFunctions; +end; + +function TdxPSPrintStyle.DefaultPageFooterText(APart: TdxPageTitlePart): string; +const + CRLF = #13#10; +var + Index: Integer; +begin + Index := -1; + if dxHFFunctionLibrary <> nil then + case APart of + tpCenter: + Index := dxHFFunctionLibrary.IndexOfByClass(TdxHFPageNumberFunction); + tpRight: + Index := dxHFFunctionLibrary.IndexOfByClass(TdxHFDateFunction); + end; + + if Index <> -1 then + Result := dxHFFunctionLibrary[Index].TemplateString + CRLF + else + Result := inherited DefaultPageFooterText(APart); +end; + +function TdxPSPrintStyle.DefaultStyleCaption: string; +begin + Result := cxGetResourceString(@sdxStandardStyle); +end; + +procedure TdxPSPrintStyle.AddStdHFFunctions; +var + Index: Integer; +begin + if dxHFFunctionLibrary = nil then Exit; + with PrinterPage.PageFooter do + begin + Index := dxHFFunctionLibrary.IndexOfByClass(TdxHFPageNumberFunction); + if Index <> -1 then + CenterTitle.Text := dxHFFunctionLibrary[Index].TemplateString; + Index := dxHFFunctionLibrary.IndexOfByClass(TdxHFDateFunction); + if Index <> -1 then + RightTitle.Text := dxHFFunctionLibrary[Index].TemplateString; + end; +end; + +procedure TdxPSPrintStyle.AfterGenerating; +begin + DoAfterGenerating; +end; + +procedure TdxPSPrintStyle.BeforeGenerating; +begin + DoBeforeGenerating; +end; + +procedure TdxPSPrintStyle.DoAfterGenerating; +begin + if Assigned(FOnAfterGenerating) then FOnAfterGenerating(Self); +end; + +procedure TdxPSPrintStyle.DoAfterPrinting; +begin + if Assigned(FOnAfterPrinting) then FOnAfterPrinting(Self); +end; + +procedure TdxPSPrintStyle.DoBeforeGenerating; +begin + if Assigned(FOnBeforeGenerating) then FOnBeforeGenerating(Self); +end; + +procedure TdxPSPrintStyle.DoBeforePrinting; +begin + if Assigned(FOnBeforePrinting) then FOnBeforePrinting(Self); +end; + +procedure TdxPSPrintStyle.InitializeDefaultStyleGlyph(ABitmap: TBitmap); +begin + inherited; + Bitmap_LoadFromResourceName(ABitmap, IDB_DXPSPRINTSTYLE_STANDARD); +end; + +{ TBasedxPreviewWindow } + +destructor TBasedxPreviewWindow.Destroy; +begin + if ComponentPrinter <> nil then + begin + Exclude(ComponentPrinter.FState, cpsPreviewing); + if not ComponentPrinter.FModalPreview then + ComponentPrinter.DoAfterPreview(ReportLink); + ComponentPrinter.FPreviewWindow := nil; + end; + inherited; +end; + +procedure TBasedxPreviewWindow.InitContent; +begin +end; + +procedure TBasedxPreviewWindow.InvalidateContent; +begin +end; + +procedure TBasedxPreviewWindow.InvalidatePage(APageIndex: Integer); +begin +end; + +procedure TBasedxPreviewWindow.InvalidateAllPages; +begin +end; + +procedure TBasedxPreviewWindow.InvalidatePagesContent; +begin +end; + +procedure TBasedxPreviewWindow.InvalidatePagesHeaderContent; +begin +end; + +procedure TBasedxPreviewWindow.InvalidatePagesFooterContent; +begin +end; + +procedure TBasedxPreviewWindow.CreationComplete; +begin +end; + +procedure TBasedxPreviewWindow.RebuildReport; +begin + if ReportLink <> nil then ReportLink.RebuildReport; +end; + +procedure TBasedxPreviewWindow.UpdateCaption; +begin + if ComponentPrinter <> nil then + Caption := ComponentPrinter.PreviewCaption; +end; + +procedure TBasedxPreviewWindow.UpdateControls; +begin + UpdateCaption; + UpdateExplorerContextCommands; + if (ComponentPrinter <> nil) and (ComponentPrinter.PreviewWindowDesigner <> nil) then + ComponentPrinter.PreviewWindowDesigner.Modified; +end; + +{$IFNDEF DELPHI6} + +{ IUnknown } + +function TBasedxPreviewWindow.QueryInterface(const IID: TGUID; out Obj): HRESULT; +begin + if GetInterface(IID, Obj) then + Result := S_OK + else + Result := E_NOINTERFACE; +end; + +function TBasedxPreviewWindow._Addref: Integer; +begin + Result := -1; +end; + +function TBasedxPreviewWindow._Release: Integer; +begin + Result := -1; +end; + +{$ENDIF} + +{$IFDEF OLEDRAGANDDROP} + +const + DropEffects: array[Boolean] of Longint = (DROPEFFECT_NONE, DROPEFFECT_COPY); + +function TBasedxPreviewWindow.IDropTarget_DragEnter(const DataObj: IDataObject; + grfKeyState: Longint; Pt: TPoint; var dwEffect: Longint): HRESULT; +var + Format: TFormatETC; + Medium: TSTGMedium; + BufferSize: DWORD; + Buffer: PChar ; +begin + FillChar(Format, SizeOf(Format), 0); + with Format do + begin + cfFormat := CF_HDROP; + dwAspect := DVASPECT_CONTENT; + lindex := -1; + tymed := TYMED_HGLOBAL; + end; + DataObj._AddRef; + try + FDraggedFileName := ''; + if (DataObj.GetData(Format, Medium) = S_OK) and (DragQueryFile(Medium.hGlobal, $FFFFFFFF, nil, 0) <> 0) then + try + BufferSize := DragQueryFile(Medium.hGlobal, 0, nil, 0); + Buffer := StrAlloc(BufferSize + 1); + try + if BufferSize = DragQueryFile(Medium.hGlobal, 0, Buffer, BufferSize) then + FDraggedFileName := StrPas(Buffer); + finally + StrDispose(Buffer); + end; + finally + if Medium.unkForRelease = nil then ReleaseSTGMedium(Medium); + end; + finally + DataObj._Release; + end; + + dwEffect := DropEffects[CanDrop and DoCanAccept]; + if dwEffect = DROPEFFECT_NONE then FDraggedFileName := ''; + + Result := S_OK; +end; + +function TBasedxPreviewWindow.IDropTarget_DragOver(grfKeyState: Longint; Pt: TPoint; + var dwEffect: Longint): HRESULT; +begin + dwEffect := DropEffects[CanDrop]; + Result := S_OK; +end; + +function TBasedxPreviewWindow.IDropTarget_DragLeave: HRESULT; +begin + Result := S_OK; +end; + +function TBasedxPreviewWindow.IDropTarget_Drop(const DataObj: IDataObject; + grfKeyState: Longint; Pt: TPoint; var dwEffect: Longint): HRESULT; +begin + dwEffect := DropEffects[CanDrop]; + if dwEffect = DROPEFFECT_COPY then DoDrop; + Result := S_OK; +end; + +{$ENDIF} + +procedure TBasedxPreviewWindow.AddExplorerContextCommand(ACommand: TCustomdxPSExplorerContextCommand); +begin +end; + +procedure TBasedxPreviewWindow.UpdateExplorerContextCommands; +begin +end; + +function TBasedxPreviewWindow.GetExplorerTree: TCustomdxPSExplorerTreeContainer; +begin + Result := nil; +end; + +function TBasedxPreviewWindow.GetHFEditPart: TdxPageTitlePart; +begin + Result := tpLeft; +end; + +function TBasedxPreviewWindow.GetShowExplorer: Boolean; +begin + Result := False; +end; + +function TBasedxPreviewWindow.GetShowThumbnails: Boolean; +begin + Result := False; +end; + +function TBasedxPreviewWindow.GetState: TdxPSPreviewState; +begin + Result := prsNone; +end; + +procedure TBasedxPreviewWindow.SetShowExplorer(Value: Boolean); +begin +end; + +procedure TBasedxPreviewWindow.SetShowThumbnails(Value: Boolean); +begin +end; + +procedure TBasedxPreviewWindow.BeginUpdate; +begin +end; + +procedure TBasedxPreviewWindow.CancelUpdate; +begin +end; + +procedure TBasedxPreviewWindow.EndUpdate; +begin +end; + +function TBasedxPreviewWindow.Locked: Boolean; +begin + Result := False; +end; + +procedure TBasedxPreviewWindow.PaintPage(Sender: TObject; ACanvas: TCanvas; + ARect: TRect; APageIndex: Integer); +begin + ComponentPrinter.PaintPage(ACanvas, APageIndex, ARect, ARect, nil); +end; + +procedure TBasedxPreviewWindow.PaintThumbnailPage(Sender: TObject; ACanvas: TCanvas; + ARect: TRect; APageIndex: Integer); +begin + ComponentPrinter.PaintThumbnailPage(ACanvas, APageIndex, ARect, ARect, nil); +end; + +{$IFDEF OLEDRAGANDDROP} + +function TBasedxPreviewWindow.CanDrop: Boolean; +begin + Result := DraggedFileName <> ''; +end; + +function TBasedxPreviewWindow.DoCanAccept: Boolean; +begin + Result := (ReportLink <> nil) and ReportLink.CanLoadData and + ReportLink.PossibleDataStorage(DraggedFileName, False); +end; + +procedure TBasedxPreviewWindow.DoDrop; +begin + if ReportLink <> nil then + begin + ReportLink.DataSource := rldsExternalStorage; + ReportLink.StorageName := DraggedFileName; + RebuildReport; + UpdateControls; + Application.BringToFront; + end; +end; + +{$ENDIF} + +function TBasedxPreviewWindow.GetReportLink: TBasedxReportLink; +begin + if ComponentPrinter <> nil then + Result := ComponentPrinter.CurrentLink + else + Result := nil; +end; + +{ TdxComponentPrinterThumbnailsOptions } + +constructor TdxComponentPrinterThumbnailsOptions.Create(APreviewOptions: TdxPreviewOptions); +begin + inherited Create; + FPreviewOptions := APreviewOptions; + FFont := TFont.Create; + RestoreDefaults; +end; + +destructor TdxComponentPrinterThumbnailsOptions.Destroy; +begin + FreeAndNil(FDefaultFont); + FreeAndNil(FFont); + inherited; +end; + +procedure TdxComponentPrinterThumbnailsOptions.Assign(Source: TPersistent); +begin + if Source is TdxComponentPrinterThumbnailsOptions then + with TdxComponentPrinterThumbnailsOptions(Source) do + begin + Self.Font := Font; + Self.ShowPageNumbers := ShowPageNumbers; + end + else + inherited; +end; + +function TdxComponentPrinterThumbnailsOptions.DefaultFont: TFont; +begin + if FDefaultFont = nil then + begin + FDefaultFont := TFont.Create; + InitializeDefaultFont(FDefaultFont); + end; + Result := FDefaultFont; +end; + +procedure TdxComponentPrinterThumbnailsOptions.RestoreDefaults; +begin + inherited; + Font := DefaultFont; + ShowPageNumbers := True; +end; + +procedure TdxComponentPrinterThumbnailsOptions.InitializeDefaultFont(AFont: TFont); +begin + AFont.Color := dxPSDefaultPreviewThumbnailsFontColor; + AFont.Name := dxPSDefaultPreviewThumbnailsFontName; + AFont.Size := dxPSDefaultPreviewThumbnailsFontSize; + AFont.Style := dxPSDefaultPreviewThumbnailsFontStyle +end; + +function TdxComponentPrinterThumbnailsOptions.IsFontStored: Boolean; +begin + Result := not dxPSUtl.dxAreFontsEqual(Font, DefaultFont); +end; + +procedure TdxComponentPrinterThumbnailsOptions.SetFont(Value: TFont); +begin + Font.Assign(Value); +end; + +procedure TdxComponentPrinterThumbnailsOptions.SetShowPageNumbers(Value: Boolean); +begin + if FShowPageNumbers <> Value then + begin + FShowPageNumbers := Value; + //TODO: TdxComponentPrinterThumbnailsOptions.SetShowPageNumbers + // if HasPreviewThumbnails then invalidate Preview.Thumbnails + end; +end; + +{ TdxPreviewOptions } + +constructor TdxPreviewOptions.Create; +begin + inherited; + FEnableOptions := dxDefaultPreviewEnableOptions; + FIcon := TIcon.Create; + FIcon.OnChange := IconChanged; + FSavePosition := True; + FSaveZoomPosition := True; + FThumbnailsOptions := TdxComponentPrinterThumbnailsOptions.Create(Self); + FWindowState := wsNormal; + FVisibleOptions := dxDefaultPreviewVisibleOptions; +end; + +destructor TdxPreviewOptions.Destroy; +begin + FreeAndNil(FDefaultIcon); + FreeAndNil(FThumbnailsOptions); + FreeAndNil(FIcon); + inherited; +end; + +function TdxPreviewOptions.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintPreview); +end; + +function TdxPreviewOptions.DefaultIcon: TIcon; +begin + if FDefaultIcon = nil then + begin + FDefaultIcon := TIcon.Create; + InitializeDefaultIcon(FDefaultIcon); + end; + Result := FDefaultIcon; +end; + +function TdxPreviewOptions.DefaultRect: TRect; +begin + Result := dxPSUtl.GetDesktopWorkArea; +end; + +procedure TdxPreviewOptions.RestoreOriginalIcon; +begin + //FIcon.Handle := 0; + FIsIconAssigned := False; + if ComponentPrinter <> nil then ComponentPrinter.DesignerModified; +end; + +procedure TdxPreviewOptions.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); +begin + Rect := MakeBounds(ALeft, ATop, AWidth, AHeight); +end; + +procedure TdxPreviewOptions.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineBinaryProperty('PreviewBoundsRect', ReadBoundsRect, WriteBoundsRect, + IsBoundsStored); + Filer.DefineProperty('IsCaptionAssigned', ReadIsCaptionAssigned, WriteIsCaptionAssigned, + FIsCaptionAssigned and (Caption = '')); + Filer.DefineProperty('IsIconAssigned', ReadIsIconAssigned, WriteIsIconAssigned, + FIsIconAssigned and Icon.Empty); +end; + +procedure TdxPreviewOptions.DoAssign(Source: TdxBaseObject); +begin + inherited; + with TdxPreviewOptions(Source) do + begin + Self.Caption := Caption; + Self.EnableOptions := EnableOptions; + Self.HelpContext := HelpContext; + Self.HelpFile := HelpFile; + Self.Icon := Icon; + Self.Rect := Rect; + Self.SavePosition := SavePosition; + Self.SaveZoomPosition := SaveZoomPosition; + Self.ThumbnailsOptions := ThumbnailsOptions; + Self.WindowState := WindowState; + Self.VisibleOptions := VisibleOptions; + + Self.FIsBoundsAssigned := FIsBoundsAssigned; + Self.FIsCaptionAssigned := FIsCaptionAssigned; + Self.FIsIconAssigned := FIsIconAssigned; + end; +end; + +procedure TdxPreviewOptions.DoRestoreDefaults; +begin + inherited; + FEnableOptions := dxDefaultPreviewEnableOptions; + + FSavePosition := True; + FSaveZoomPosition := True; + ThumbnailsOptions.RestoreDefaults; + FWindowState := wsNormal; + FVisibleOptions := dxDefaultPreviewVisibleOptions; + + FIsBoundsAssigned := False; + FIsCaptionAssigned := False; + FIsIconAssigned := False; +end; + +function TdxPreviewOptions.GetIsIconAssigned: Boolean; +begin + Result := not dxPSUtl.dxAreGraphicsEqual(FIcon, DefaultIcon); +end; + +procedure TdxPreviewOptions.IconChanged(Sender: TObject); +begin + FIsIconAssigned := True; +end; + +procedure TdxPreviewOptions.InitializeDefaultIcon(AnIcon: TIcon); +begin + Icon_LoadFromResourcename(AnIcon, IDB_DXPSPREVIEW); +end; + +procedure TdxPreviewOptions.RefreshIsIconAssigned; +begin + // FIsIconAssigned := dxPSUtl.dxAreGraphicsEqual(FIcon, DefaultIcon); +end; + +function TdxPreviewOptions.GetCaption: string; +begin + if FIsCaptionAssigned then + Result := FCaption + else + Result := DefaultCaption; +end; + +function TdxPreviewOptions.GetHelpFile: string; +begin + Result := dxPSEngine.HelpFile; +end; + +function TdxPreviewOptions.GetIcon: TIcon; +begin + if FIsIconAssigned or ((ComponentPrinter <> nil) and (csLoading in ComponentPrinter.ComponentState)) then + Result := FIcon + else + Result := DefaultIcon; +end; + +function TdxPreviewOptions.GetPosition(Index: Integer): Integer; +begin + with Rect do + case Index of + 0: Result := Bottom - Top; + 1: Result := Left; + 2: Result := Top; + else + Result := Right - Left; + end; +end; + +function TdxPreviewOptions.GetRect: TRect; +begin + if FIsBoundsAssigned then + Result := FRect + else + Result := DefaultRect; +end; + +function TdxPreviewOptions.GetRegistryPath: string; +begin + Result := dxPSEngine.RealRegistryPath; +end; + +function TdxPreviewOptions.IsBoundsStored: Boolean; +begin + Result := FIsBoundsAssigned and not EqualRect(FRect, DefaultRect); +end; + +function TdxPreviewOptions.IsCaptionStored: Boolean; +begin + Result := FIsCaptionAssigned and (FCaption <> DefaultCaption); +end; + +function TdxPreviewOptions.IsIconStored: Boolean; +begin + Result := FIsIconAssigned and not dxPSUtl.dxAreGraphicsEqual(FIcon, DefaultIcon); +end; + +procedure TdxPreviewOptions.SetEnableOptions(Value: TdxPreviewEnableOptions); +begin + if FEnableOptions <> Value then + begin + FEnableOptions := Value; + if HasPreviewWindow then + PreviewWindow.SetPreviewEnableOptions(FEnableOptions); + end; +end; + +procedure TdxPreviewOptions.SetCaption(const Value: string); +begin + if Caption <> Value then + begin + FCaption := Value; + FIsCaptionAssigned := True; + if HasPreviewWindow then PreviewWindow.Caption := Caption; + end; +end; + +procedure TdxPreviewOptions.SetHelpContext(Value: THelpContext); +begin + FHelpContext := Value; + if HasPreviewWindow then PreviewWindow.HelpContext := FHelpContext; +end; + +procedure TdxPreviewOptions.SetHelpFile(const Value: string); +begin + dxPSEngine.HelpFile := Value; + if HasPreviewWindow then PreviewWindow.HelpFile := Value; +end; + +procedure TdxPreviewOptions.SetIcon(Value: TIcon); +begin + FIcon.Assign(Value); +end; + +procedure TdxPreviewOptions.SetPosition(Index: Integer; Value: Integer); +var + R: TRect; +begin + R := Self.Rect; + case Index of + 0: R.Bottom := R.Top + Value; + 1: R.Left := Value; + 2: R.Top := Value; + 3: R.Right := R.Left + Value; + end; + Self.Rect := R; +end; + +procedure TdxPreviewOptions.SetRect(Value: TRect); +begin + with Value do + begin + if Right < Left then Right := Left; + if Bottom < Top then Bottom := Top; + end; + + if not EqualRect(FRect, Value) then + begin + FRect := Value; + FIsBoundsAssigned := True; + end; +end; + +procedure TdxPreviewOptions.SetRegistryPath(const Value: string); +begin + dxPSEngine.RegistryPath := Value; +end; + +procedure TdxPreviewOptions.SetShowExplorer(Value: Boolean); +begin + if FShowExplorer <> Value then + begin + FShowExplorer := Value; + if HasPreviewWindow then PreviewWindow.ShowExplorer := ShowExplorer; + end; +end; + +procedure TdxPreviewOptions.SetThumbnailsOptions(Value: TdxComponentPrinterThumbnailsOptions); +begin + ThumbnailsOptions.Assign(Value); +end; + +procedure TdxPreviewOptions.SetWindowState(Value: TWindowState); +begin + FWindowState := Value; + if HasPreviewWindow then PreviewWindow.WindowState := FWindowState; +end; + +procedure TdxPreviewOptions.SetVisibleOptions(Value: TdxPreviewVisibleOptions); +begin + if FVisibleOptions <> Value then + begin + FVisibleOptions := Value; + if HasPreviewWindow then + PreviewWindow.SetPreviewVisibleOptions(FVisibleOptions); + end; +end; + +function TdxPreviewOptions.HasPreviewWindow: Boolean; +begin + Result := (ComponentPrinter <> nil) and not ComponentPrinter.IsDesigning and + ComponentPrinter.PreviewExists; +end; + +function TdxPreviewOptions.PreviewWindow: TBasedxPreviewWindow; +begin + Result := ComponentPrinter.PreviewWindow; +end; + +procedure TdxPreviewOptions.ReadBoundsRect(Stream: TStream); +var + R: TRect; +begin + Stream.ReadBuffer(R, SizeOf(R)); + Rect := R; +end; + +procedure TdxPreviewOptions.ReadIsCaptionAssigned(Reader: TReader); +begin + FIsCaptionAssigned := Reader.ReadBoolean; +end; + +procedure TdxPreviewOptions.ReadIsIconAssigned(Reader: TReader); +begin + FIsIconAssigned := Reader.ReadBoolean; +end; + +procedure TdxPreviewOptions.WriteBoundsRect(Stream: TStream); +begin + Stream.WriteBuffer(FRect, SizeOf(TRect)); +end; + +procedure TdxPreviewOptions.WriteIsCaptionAssigned(Writer: TWriter); +begin + Writer.WriteBoolean(FIsCaptionAssigned); +end; + +procedure TdxPreviewOptions.WriteIsIconAssigned(Writer: TWriter); +begin + Writer.WriteBoolean(FIsIconAssigned); +end; + +{ TdxPSComponentPrinterExplorerChangeNotifier } + +constructor TdxPSComponentPrinterExplorerChangeNotifier.Create(AComponentPrinter: TCustomdxComponentPrinter); +begin + Assert(AComponentPrinter <> nil); + FComponentPrinter := AComponentPrinter; + inherited Create(nil); +end; + +procedure TdxPSComponentPrinterExplorerChangeNotifier.ItemDataUnloaded(AnItem: TdxPSExplorerItem); +begin + if (AnItem.Explorer = Explorer) and (ComponentPrinter.CurrentLink <> nil) and not ComponentPrinter.IsDestroying then + begin + ComponentPrinter.CurrentLink.DataSource := rldsComponent; + ComponentPrinter.CurrentLink.FinalizeDataStream; + end; +end; + +{ TCustomdxComponentPrinter } + +constructor TCustomdxComponentPrinter.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + if AOwner <> nil then AOwner.FreeNotification(Self); + FAutoUpdateDateTime := True; + FBeepAfterLongOperations := True; + FCurrentLink := nil; + FDateFormat := 0; + FExplorerChangeNotifier := TdxPSComponentPrinterExplorerChangeNotifier.Create(Self); + FInternalStreaming := False; + FLongOperationTime := 5000; + FPageNumberFormat := pnfNumeral; + FReportLinkDesigner := nil; + FPreviewWindowDesigner := nil; + FPrintTitle := ''; + FState := []; + FPreviewOptions := TdxPreviewOptions.Create; + FPreviewOptions.FComponentPrinter := Self; + FPrintFileList := TStringList.Create; + FOptions := dxDefaultCPOptions; + FReportLinks := TList.Create; + FSaveCopies := 1; + FSaveCollate := False; + FTimeFormat := 0; + FHFTextEntryChooseSubscriber := TdxHFTextEntryChooseSubscriber.Create([TdxHFTextEntryChooseEvent]); + TdxHFTextEntryChooseSubscriber(FHFTextEntryChooseSubscriber).OnHFTextEntryChoose := OnHFTextEntryChosen; + FWindowHandle := dxPSUtl.dxAllocatehWnd(WndProc); + FVersion := 0; +end; + +destructor TCustomdxComponentPrinter.Destroy; +begin + {$IFNDEF DELPHI5} + Destroying; + {$ENDIF} + dxPSUtl.dxDeallocatehWnd(FWindowHandle); + FreeAndNil(FHFTextEntryChooseSubscriber); + FreeAndNil(FPrintFileList); + FreeAndNil(FPreviewWindowDesigner); + FreeAndNil(FReportLinkDesigner); + if not IsDesigning then DestroyPreviewWindow; + FreeAndNil(FPreviewOptions); + FreeAndNil(FExplorerChangeNotifier); + DeleteAllLinks; + FreeAndNil(FReportLinks); + inherited; +end; + +procedure TCustomdxComponentPrinter.GetChildren(Proc: TGetChildProc; Root: TComponent); +var + I: Integer; + ReportLink: TBasedxReportLink; +begin + if not FInternalStreaming then + for I := 0 to LinkCount - 1 do + begin + ReportLink := Self.ReportLink[I]; + if Root = ReportLink.Owner then Proc(ReportLink); + end; +end; + +procedure TCustomdxComponentPrinter.Loaded; +begin + inherited; + PreviewOptions.RefreshIsIconAssigned; +end; + +procedure TCustomdxComponentPrinter.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if Operation = opRemove then + begin + if AComponent = Explorer then Explorer := nil; + if AComponent = ExplorerStubLink then ExplorerStubLink := nil; + end; +end; + +procedure TCustomdxComponentPrinter.SetChildOrder(Child: TComponent; Order: Integer); +begin + inherited; + if FReportLinks.IndexOf(Child) > -1 then + (Child as TBasedxReportLink).Index := Order; +end; + +procedure TCustomdxComponentPrinter.SetName(const NewName: TComponentName); +var + AName: string; + OldName: string; + P, I: Integer; + Link: TBasedxReportLink; +begin + OldName := Name; + inherited SetName(NewName); + if IsDesigning and (LinkCount > 0) then + try + if ReportLinkDesigner <> nil then + ReportLinkDesigner.BeginUpdate; + try + for I := 0 to LinkCount - 1 do + begin + Link := ReportLink[I]; + P := Pos(OldName, Link.Name); + if P = 0 then + AName := Name + Link.Name + else + AName := Copy(Link.Name, 1, P - 1) + Name + + Copy(Link.Name, P + Length(OldName), Length(Link.Name) - P - Length(OldName) + 1); + Link.Name := AName; + end; + finally + if ReportLinkDesigner <> nil then + ReportLinkDesigner.EndUpdate; + end; + except + on EComponentError do ; {Ignore rename errors } + end; +end; + +procedure TCustomdxComponentPrinter.SetExplorer(Value: TCustomdxPSExplorer); +begin + if FExplorer <> Value then + begin + FExplorer := Value; + if Explorer <> nil then + Explorer.FreeNotification(Self); + ExplorerChangeNotifier.Explorer := Explorer; + end; +end; + +procedure TCustomdxComponentPrinter.SetExplorerStubLink(Value: TBasedxReportLink); +begin + if FExplorerStubLink <> Value then + if (Value = nil) or Value.CanBeUsedAsStub then + begin + FExplorerStubLink := Value; + if Value <> nil then + Value.FreeNotification(Self); + end; +end; + +procedure TCustomdxComponentPrinter.SetLongOperationTime(Value: Integer); +begin + if Value < 0 then Value := 0; + if FLongOperationTime <> Value then + FLongOperationTime := Value; +end; + +procedure TCustomdxComponentPrinter.SetPreviewOptions(Value: TdxPreviewOptions); +begin + PreviewOptions.Assign(Value); +end; + +function TCustomdxComponentPrinter.IsCustomPrintDlgData: Boolean; +begin + Result := Assigned(FOnInitializePrintDlgData); +end; + +function TCustomdxComponentPrinter.IsForegroundPreviewWindow: Boolean; +begin + Result := (cpsPreviewing in State) and (PreviewWindow <> nil) and + (GetForegroundWindow = PreviewWindow.Handle); +end; + +function TCustomdxComponentPrinter.IsGenerateReportProgressEvent: Boolean; +begin + Result := not IsDesigning and not IsLoading and (cpoGenerateReportProgressEvent in Options); +end; + +function TCustomdxComponentPrinter.IsRebuildBeforeOutput(AForceRebuild: Boolean): Boolean; +begin + Result := AForceRebuild or IsDesigning; + if CurrentLink <> nil then + Result := Result or CurrentLink.RebuildNeeded or (CurrentLink.DataSource = rldsExternalStorage); +end; + +function TCustomdxComponentPrinter.IsRebuildBeforePreview: Boolean; +begin + Result := IsRebuildBeforeOutput(cpoAutoRebuildBeforePreview in Options); +end; + +function TCustomdxComponentPrinter.IsRebuildBeforePrint: Boolean; +begin + Result := IsRebuildBeforeOutput(cpoAutoRebuildBeforePrint in Options); +end; + +function TCustomdxComponentPrinter.IsShowHourGlass: Boolean; +begin + Result := cpoShowHourGlass in Options; +end; + +procedure TCustomdxComponentPrinter.PaintThumbnailPage(ACanvas: TCanvas; + APageIndex: Integer; const APageBounds, AContentBounds: TRect; + AReportLink: TBasedxReportLink = nil); +begin + AReportLink := CheckLink(AReportLink); + if AReportLink = nil then Exit; + + AReportLink.PaintPage(ACanvas, APageBounds, APageIndex, APageIndex, + dxThumbnailsZoomFactors[PreviewWindow.ThumbnailsSize]); + + if PreviewOptions.ThumbnailsOptions.ShowPageNumbers then + PaintThumbnailPageIndex(ACanvas, APageBounds, AReportLink.Renderer.PreparedPageIndex(APageIndex)); +end; + +procedure TCustomdxComponentPrinter.PaintThumbnailPageIndex(ACanvas: TCanvas; + const R: TRect; APageIndex: Integer); +var + FontSize: Integer; +begin + with PreviewOptions.ThumbnailsOptions do + begin + FontSize := Font.Size; + if PreviewWindow.ThumbnailsSize = tsSmall then + Font.Size := Font.Size div 2; + dxPSUtl.DrawBlendedText(ACanvas, R, IntToStr(APageIndex + 1), Font); + Font.Size := FontSize; + end; +end; + +function TCustomdxComponentPrinter.GetCurrentLinkIndex: Integer; +begin + if CurrentLink <> nil then + Result := CurrentLink.Index + else + Result := -1; +end; + +function TCustomdxComponentPrinter.GetExplorerRealStubLink: TBasedxReportLink; +begin + Result := FExplorerStubLink; + if Result = nil then + Result := AddEmptyLink(TBasedxReportLink); +end; + +function TCustomdxComponentPrinter.GetIsExplorerMode: Boolean; +begin + Result := cpsExplore in State; +end; + +function TCustomdxComponentPrinter.GetLinkCount: Integer; +begin + Result := FReportLinks.Count; +end; + +function TCustomdxComponentPrinter.GetPreviewCaption: string; +begin + if cpsExplore in State then + Result := cxGetResourceString(@sdxReportExplorer) + else + Result := PreviewOptions.Caption; + + if (Explorer <> nil) and (Explorer.LoadedItem <> nil) then + Result := Result + ' ' + sdxDocumentCaptionSeparator + ' ' + Explorer.LoadedItem.FormCaption + else + if (CurrentLink <> nil) and (CurrentLink.DataSource = rldsExternalStorage) and (CurrentLink.StorageName <> '') then + Result := Result + ' ' + sdxDocumentCaptionSeparator + ' ' + CurrentLink.StorageName; +end; + +function TCustomdxComponentPrinter.GetReportLink(Index: Integer): TBasedxReportLink; +begin + Result := TBasedxReportLink(FReportLinks[Index]); +end; + +procedure TCustomdxComponentPrinter.SetAbortBuilding(Value: Boolean); +begin + FAbortBuilding := Value; +end; + +procedure TCustomdxComponentPrinter.SetAbortPrinting(Value: Boolean); +begin + FAbortPrinting := Value; +end; + +procedure TCustomdxComponentPrinter.SetAutoUpdateDateTime(Value: Boolean); +begin + if FAutoUpdateDateTime <> Value then + FAutoUpdateDateTime := Value; +end; + +procedure TCustomdxComponentPrinter.SetDateFormat(Value: Integer); +begin + if Value < 0 then Value := 0; + if Value > dxPgsDlg.DateFormats.Count - 1 then + Value := dxPgsDlg.DateFormats.Count - 1; + if FDateFormat <> Value then + FDateFormat := Value; +end; + +procedure TCustomdxComponentPrinter.SetCurrentLink(Value: TBasedxReportLink); +begin + if (CurrentLink <> Value) and (IndexOfLink(Value) > -1) then + begin + if PreviewExists then DestroyPreviewWindow; + FCurrentLink := Value; + DoChangeCurrentLink; + FormatChanged(FCurrentLink); + if FCurrentLink <> nil then + FCurrentLink.PrinterPage.ApplyToPrintDevice; + DesignerUpdate(Value);//nil); + end; +end; + +procedure TCustomdxComponentPrinter.SetCurrentLinkIndex(Value: Integer); +begin + if Value < 0 then Value := 0; + if Value > LinkCount - 1 then + Value := LinkCount - 1; + if Value > -1 then + CurrentLink := ReportLink[Value]; +end; + +procedure TCustomdxComponentPrinter.SetPageNumberFormat(Value: TdxPageNumberFormat); +begin + if FPageNumberFormat <> Value then + FPageNumberFormat := Value; +end; + +procedure TCustomdxComponentPrinter.SetPrintFileList(Value: TStrings); +begin + FPrintFileList.Assign(Value); +end; + +procedure TCustomdxComponentPrinter.SetReportLink(Index: Integer; Value: TBasedxReportLink); +begin + ReportLink[Index].Assign(Value); +end; + +procedure TCustomdxComponentPrinter.SetTimeFormat(Value: Integer); +begin + if Value < 0 then Value := 0; + if Value > dxPgsDlg.TimeFormats.Count - 1 then + Value := dxPgsDlg.TimeFormats.Count - 1; + if FTimeFormat <> Value then + FTimeFormat := Value; +end; + +function TCustomdxComponentPrinter.BeginPrintPages(const Source: string; + out APageIndexes: TIntegers): Boolean; +begin + Result := MakePageIndexes(Source, APageIndexes); +end; + +procedure TCustomdxComponentPrinter.EndPrintPages(var APageIndexes: TIntegers); +begin + SetLength(APageIndexes, 0); +end; + +function TCustomdxComponentPrinter.CreatePreviewWindow(AReportLink: TBasedxReportLink): TBasedxPreviewWindow; +var + PreviewClass: TdxPreviewWindowClass; +begin + Result := nil; + PreviewClass := GetPreviewClass; + if PreviewClass <> nil then + try + Result := PreviewClass.Create(nil); + Result.BeginUpdate; + try + Result.SetComponentPrinter(Self); + SetupPreviewProperties(Result); + Result.CreationComplete; + finally + Result.EndUpdate; + end; + except + FreeAndNil(Result); + raise; + end + else + raise EdxComponentPrinter.Create(cxGetResourceString(@sdxPreviewNotRegistered)); +end; + +procedure TCustomdxComponentPrinter.DestroyPreviewWindow; +begin + if cpsPrinting in State then + AbortPrinting := True; + FreeAndNil(FPreviewWindow); +end; + +procedure TCustomdxComponentPrinter.FinalizeDefaultPrintDlgData(AReportLink: TBasedxReportLink; + var APrintDlgData: TdxPrintDlgData); +begin + FreeAndNil(APrintDlgData.DialogData.FileList); + DoFinalizePrintDlgData(AReportLink, APrintDlgData); +end; + +procedure TCustomdxComponentPrinter.InitializeDefaultPrintDlgData(AReportLink: TBasedxReportLink; + out APrintDlgData: TdxPrintDlgData); +const + BtnEnabledOn: TdxPrintDlgButtons = [pdbPreview, pdbPageSetup, pdbHelp]; + BtnVisibleOn: TdxPrintDlgButtons = [pdbPreview, pdbPageSetup, pdbHelp]; + OptEnabledOn: TdxPrintDlgOptions = [pdoCurrentPage]; + OptVisibleOn: TdxPrintDlgOptions = [pdoCurrentPage]; +begin + FillChar(APrintDlgData, SizeOf(TdxPrintDlgData), 0); + with APrintDlgData do + begin + DialogData.Collate := False; + DialogData.Copies := 1; + DialogData.FileList := TStringList.Create; + DialogData.FileList.Assign(PrintFileList); + DialogData.MaxRange := CurrentLink.PageCount; // (v2.2) + if DialogData.MaxRange = 0 then DialogData.MaxRange := -1; + DialogData.MinRange := 1; + if CurrentLink.PageCount = 0 then DialogData.MinRange := 0; + DialogData.PageCount := CurrentLink.PageCount; + DialogData.PageNums := pnAll; + DialogData.PageRanges := prAll; + if DialogData.PageCount > 0 then {v3.2} + DialogData.Pages := '1-' + IntToStr(DialogData.PageCount); + DialogData.PrintToFile := FSavePrintToFile; + if not IsDesigning and (not (cpsPreviewing in State) or (pvoPrintStyles in PreviewOptions.VisibleOptions)) then + DialogData.StyleManager := CurrentLink.StyleManager; + DialogData.PageCount := CurrentLink.PageCount; + + Title := cxGetResourceString(@sdxPrintDialogCaption); + + OptionsEnabled := pdoDefaultOptionsEnabled + OptEnabledOn; + OptionsVisible := pdoDefaultOptionsVisible + OptVisibleOn; + ButtonsEnabled := pdbDefault + BtnEnabledOn; + ButtonsVisible := pdbDefault + BtnVisibleOn; + if cpsPreviewing in State then + ButtonsVisible := ButtonsVisible - [pdbPreview]; + + Events.OnPageSetup := PrnDlgPageSetup; + IsCheckUserInput := True; + end; + DoInitializePrintDlgData(AReportLink, APrintDlgData); +end; + +procedure TCustomdxComponentPrinter.InitDevModeFromPrinterPageSettings( + APrinterPage: TdxPrinterPage); +begin + if (dxPrintDevice = nil) or (dxPrintDevice.DeviceMode = nil) then Exit; + dxPrintDevice.DeviceMode^.dmOrientation := Byte(APrinterPage.Orientation) + 1; + dxPrintDevice.DeviceMode^.dmColor := Byte(not APrinterPage.GrayShading) + 1; +end; + +function TCustomdxComponentPrinter.PrintDialog(AReportLink: TBasedxReportLink; + var APrintDlgData: TdxPrintDlgData): Boolean; +var + PreviewBtnClicked: Boolean; +begin + Include(FState, cpsPrintDialog); + try + Result := dxPrnDlg.dxPrintDialog(APrintDlgData); + PreviewBtnClicked := APrintDlgData.PreviewBtnClicked; + if Result then + begin + FSavePrintToFile := APrintDlgData.DialogData.PrintToFile; + PrintFileList := APrintDlgData.DialogData.FileList; + if AReportLink <> nil then + AReportLink.PrinterPage.InitFromPrintDevice; + if not PreviewBtnClicked then + with APrintDlgData.DialogData do + begin + if PrintToFile then + dxPrintDevice.FileName := FileName + else + dxPrintDevice.FileName := ''; + FPrintAll := PageRanges = prAll; + if PageRanges in [prCurrent, prRange] then + begin + if PageRanges = prCurrent then + Pages := IntToStr(AReportLink.CurrentPage); + Result := PrintPagesAsStringEx(Pages, PageNums, Copies, Collate, AReportLink); + end + else // prAll + PrintEx(PageNums, Copies, Collate, AReportLink); + end; + end; + finally + FPrintAll := False; + Exclude(FState, cpsPrintDialog); + end; + + if PreviewBtnClicked then Preview(True, AReportLink); +end; + +function TCustomdxComponentPrinter.PrintPagesAsStringEx(const APages: string; + APageNums: TdxPageNumbers; ACopyCount: Integer; ACollate: Boolean; + AReportLink: TBasedxReportLink = nil): Boolean; +var + PageIndexes: TIntegers; +begin + if BeginPrintPages(APages, PageIndexes) then + try + PrintPagesEx(PageIndexes, APageNums, ACopyCount, ACollate, AReportLink); + Result := True; + finally + EndPrintPages(PageIndexes); + end + else + Result := False; +end; + +procedure TCustomdxComponentPrinter.PrnDlgPageSetup(Sender: TObject; + var ADone: Boolean; APreviewBtnClicked, APrintBtnClicked: PBoolean); +var + ShowPreviewBtn, ShowPrintBtn, PreviewBtnClicked, PrintBtnClicked: Boolean; +begin + ShowPreviewBtn := APreviewBtnClicked <> nil; + ShowPrintBtn := APrintBtnClicked <> nil; + ADone := (CurrentLink <> nil) and + PageSetupEx(0, ShowPreviewBtn, ShowPrintBtn, PreviewBtnClicked, PrintBtnClicked, CurrentLink); + if (ADone or PreviewBtnClicked) and PreviewExists then + begin + CurrentLink.CalculateRenderInfos; + with PreviewWindow do + begin + InitContent; + InvalidateContent; + UpdateControls; + end; + end; + + if ShowPreviewBtn then + APreviewBtnClicked^ := PreviewBtnClicked; + + if ShowPrintBtn then + APrintBtnClicked^ := PrintBtnClicked; +end; + +procedure TCustomdxComponentPrinter.RaiseBuildingEvent(AReportLink: TBasedxReportLink; + const APercentCompleted: Double; AStage: TdxPSBuildStage); +var + Event: TdxEvent; +begin + if CurrentCompositionByLink(AReportLink) <> nil then Exit; + Event := TdxPSBuildEvent.Create(Self, AReportLink, APercentCompleted, AStage); + dxPSProcessEvent(Event) +end; + +procedure TCustomdxComponentPrinter.RaisePrintingEvent(AReportLink: TBasedxReportLink; + APageIndex, APageCount: Integer; AStage: TdxPSPrintStage); +var + Event: TdxEvent; +begin + Event := TdxPSPrintEvent.Create(Self, AReportLink, APageIndex, APageCount, AStage); + dxPSProcessEvent(Event); +end; + +procedure TCustomdxComponentPrinter.ActivateLink(AReportLink: TBasedxReportLink); + + function IsCompositionActivatation(AComposition: TdxCompositionReportLink): Boolean; + begin + Result := (AComposition <> nil) and not (csRebuildReportLink in AComposition.CompositionState); + end; + +var + Composition: TdxCompositionReportLink; +begin + Composition := CurrentCompositionByLink(AReportLink); + if (AReportLink is TdxCompositionReportLink) or (Composition = nil) or IsCompositionActivatation(Composition) then + begin + PrepareBuildReport(AReportLink); + PrepareLongOperation; + if AReportLink.CurrentPrintStyle is TdxPSPrintStyle then + TdxPSPrintStyle(AReportLink.CurrentPrintStyle).BeforeGenerating; + end; + try + if IsCompositionActivatation(Composition) then + Composition.ActivateLink(AReportLink) + else + AReportLink.InternalActivate; + + if AutoUpdateDateTime then + if IsCompositionActivatation(Composition) and (Composition.DataSource = rldsComponent) then + Composition.DateTime := Now + else + if AReportLink.DataSource = rldsComponent then + AReportLink.DateTime := Now; + finally + if (AReportLink is TdxCompositionReportLink) or (Composition = nil) or IsCompositionActivatation(Composition) then + begin + if AReportLink.CurrentPrintStyle is TdxPSPrintStyle then + TdxPSPrintStyle(AReportLink.CurrentPrintStyle).AfterGenerating; + UnprepareLongOperation; + UnprepareBuildReport(AReportLink); + end; + end; +end; + +function TCustomdxComponentPrinter.CheckLink(Value: TBasedxReportLink): TBasedxReportLink; +begin + if Value <> nil then CurrentLink := Value; + Result := CurrentLink; +end; + +function TCustomdxComponentPrinter.CreateLink(ALinkClass: TdxReportLinkClass; + AComponent: TComponent; AOwner: TComponent): TBasedxReportLink; +var + LinkClass: TdxReportLinkClass; +begin + Result := nil; + LinkClass := ALinkClass; + if AComponent <> nil then + if IsSupportedCompClass(AComponent) then + LinkClass := dxPSLinkClassByCompClass(TComponentClass(AComponent.ClassType)) + else + if IsDesigning then + raise EdxComponentPrinter.Create(cxGetResourceString(@sdxComponentNotSupported)); + if LinkClass = nil then Exit; + Result := LinkClass.Create(AOwner); + if AComponent <> nil then + Result.Component := AComponent; + Result.SetComponentPrinter(Self); + DoAddReportLink(Result); + DesignerModified; +end; + +procedure TCustomdxComponentPrinter.DeactivateLink(AReportLink: TBasedxReportLink); +begin + AReportLink.DoDestroyReport; +end; + +procedure TCustomdxComponentPrinter.InsertLink(Value: TBasedxReportLink); +begin + FReportLinks.Add(Value); + Value.FComponentPrinter := Self; + if LinkCount = 1 then Value.IsCurrentLink := True; +end; + +procedure TCustomdxComponentPrinter.MoveLink(ACurIndex, ANewIndex: Integer); +begin + FReportLinks.Move(ACurIndex, ANewIndex); + DesignerUpdate(nil); +end; + +procedure TCustomdxComponentPrinter.RemoveLink(Value: TBasedxReportLink); +var + Index: Integer; +begin + if not IsDestroying and (FCurrentLink = Value) then + begin + if PreviewExists then DestroyPreviewWindow; + Index := Value.Index; + end + else + Index := -1; + FReportLinks.Remove(Value); + Value.FComponentPrinter := nil; + if Index <> -1 then + ResyncCurrentLink(Index); + DoDeleteReportLink(Value); +end; + +procedure TCustomdxComponentPrinter.ResyncCurrentLink(AIndex: Integer); +begin + if AIndex > LinkCount - 1 then + AIndex := LinkCount - 1; + if AIndex < 0 then + begin + FCurrentLink := nil; + DoChangeCurrentLink; + end + else + CurrentLink := ReportLink[AIndex]; +end; + +procedure TCustomdxComponentPrinter.OnHFTextEntryChosen(Sender: TObject; const AEntry: string); +var + PagePart: TCustomdxPageObject; + Part1, Part2, Part3: string; +begin + if (CurrentLink <> nil) and (TdxPrintStyleManager(Sender) = CurrentLink.StyleManager) then + begin + if PreviewExists then + case PreviewWindow.State of + prsEditHeaders: + PagePart := CurrentLink.RealPrinterPage.PageHeader; + prsEditFooters: + PagePart := CurrentLink.RealPrinterPage.PageFooter; + else //prsNone + Exit; + end + else + PagePart := CurrentLink.RealPrinterPage.PageHeader; + + if PagePart <> nil then + begin + dxPSSplitAutoHFTextEntry(AEntry, Part1, Part2, Part3); + if (Part2 = '') and (Part3 = '') then + PagePart.Titles[PreviewWindow.HFEditPart].Add(Part1) + else + with PagePart do + begin + if Part1 <> '' then LeftTitle.Add(Part1); + if Part2 <> '' then CenterTitle.Add(Part2); + if Part3 <> '' then RightTitle.Add(Part3); + end; + + if PreviewExists then + case PreviewWindow.State of + prsEditHeaders: + PreviewWindow.InvalidatePagesHeaderContent; + prsEditFooters: + PreviewWindow.InvalidatePagesFooterContent; + end; + end; + end; +end; + +procedure TCustomdxComponentPrinter.DesignerModified; +begin + if ReportLinkDesigner <> nil then ReportLinkDesigner.Modified; +end; + +procedure TCustomdxComponentPrinter.DesignerUpdate(AnItem: TBasedxReportLink); +begin + if ReportLinkDesigner <> nil then ReportLinkDesigner.Update(AnItem); +end; + +function TCustomdxComponentPrinter.IsDesigning: Boolean; +begin + Result := csDesigning in ComponentState; +end; + +function TCustomdxComponentPrinter.IsDestroying: Boolean; +begin + Result := csDestroying in ComponentState; +end; + +function TCustomdxComponentPrinter.IsLoading: Boolean; +begin + Result := csLoading in ComponentState; +end; + +procedure TCustomdxComponentPrinter.ShowExistingPreviewWindow; +const + Flags: array[Boolean] of UINT = (SW_SHOW, SW_RESTORE or SW_SHOWNORMAL); +var + WindowPlacement: TWindowPlacement; + Wnd: THandle; +begin + WindowPlacement.Length := SizeOf(WindowPlacement); + Wnd := PreviewWindow.Handle; + GetWindowPlacement(Wnd, @WindowPlacement); + ShowWindow(Wnd, Flags[WindowPlacement.ShowCmd = SW_SHOWMINIMIZED]); + SetForegroundWindow(Wnd); +end; + +procedure TCustomdxComponentPrinter.WndProc(var Message: TMessage); +var + I: Integer; +begin + with Message do + begin + case Msg of + WM_SETTINGCHANGE: +// if (PChar(message.lParam) = 'devices') then + begin + RereadDefaultPrinterPage; + for I := 0 to LinkCount - 1 do + TdxReportLinkPrinterPage(ReportLink[I].PrinterPage).SynchronizeMeasurementUnits; + DesignerModified; + end; + end; + Result := DefWindowProc(FWindowHandle, Msg, wParam, lParam); + end; +end; + +procedure TCustomdxComponentPrinter.FormatChanged(AReportLink: TBasedxReportLink); +begin + dxHFFormatObject.DateFormat := dxPgsDlg.DateFormats[AReportLink.DateFormat]; + dxHFFormatObject.DateTime := AReportLink.DateTime; + dxHFFormatObject.PageNumberFormat := AReportLink.PageNumberFormat; + dxHFFormatObject.StartPageIndex := AReportLink.StartPageIndex; + dxHFFormatObject.TimeFormat := dxPgsDlg.TimeFormats[AReportLink.TimeFormat]; +end; + +procedure TCustomdxComponentPrinter.AssignReportLinks(Source: TCustomdxComponentPrinter); +var + SaveOwner: TComponent; + I: Integer; + Link: TBasedxReportLink; +begin + if LinkCount > 0 then + SaveOwner := ReportLink[0].Owner + else + SaveOwner := Owner; + DeleteAllLinks; + if Source <> nil then + for I := 0 to Source.LinkCount - 1 do + begin + Link := Source.ReportLink[I]; + with AddEmptyLinkEx(Link.LinkClass, SaveOwner) do + begin + Component := Link.Component; + Assign(Link); + end; + end; +end; + +function TCustomdxComponentPrinter.CreateLinkFromFile(const AFileName: string): TBasedxReportLink; +var + Stream: TFileStream; +begin + try + Stream := TFileStream.Create(AFileName, fmOpenRead or fmShareDenyWrite); + try + Result := CreateLinkFromStream(Stream); + finally + Stream.Free; + end; + except + FreeAndNil(Result); + raise; + end; +end; + +function TCustomdxComponentPrinter.CreateLinkFromStream(AStream: TStream): TBasedxReportLink; +var + StorageInfo: TdxPSDataStorageInfo; +begin + try + StorageInfo := TBasedxReportLink.ExtractStorageInfo(AStream, False); + if StorageInfo.StorageVersion = dxPSStorageVersion then + if StorageInfo.LinkClass <> nil then + begin + Result := StorageInfo.LinkClass.Create(Self.Owner); + Result.InternalLoadDataFromStream(AStream); + end + else + raise EdxReportLink.CreateFmt(cxGetResourceString(@sdxLinkIsNotIncludedInUsesClause), [StorageInfo.LinkClassName]) + else + raise EdxInvalidStorageVersion.Create(StorageInfo.StorageVersion); + except + FreeAndNil(Result); + raise; + end; +end; + +function TCustomdxComponentPrinter.AddComposition: TdxCompositionReportLink; +begin + Result := AddEmptyLinkEx(TdxCompositionReportLink, Self.Owner) as TdxCompositionReportLink; +end; + +function TCustomdxComponentPrinter.AddEmptyLink(ALinkClass: TdxReportLinkClass): TBasedxReportLink; +begin + Result := AddEmptyLinkEx(ALinkClass, Self.Owner); +end; + +function TCustomdxComponentPrinter.AddEmptyLinkEx(ALinkClass: TdxReportLinkClass; + AOwner: TComponent): TBasedxReportLink; +begin + Result := CreateLink(ALinkClass, nil, AOwner); +end; + +function TCustomdxComponentPrinter.AddLink(AComponent: TComponent): TBasedxReportLink; +begin + Result := AddLinkEx(AComponent, Self.Owner); +end; + +function TCustomdxComponentPrinter.AddLinkEx(AComponent: TComponent; + AOwner: TComponent): TBasedxReportLink; +begin + Result := CreateLink(nil, AComponent, AOwner); +end; + +procedure TCustomdxComponentPrinter.DeleteAllLinks; +begin + while LinkCount > 0 do DeleteLink(LinkCount - 1); +end; + +procedure TCustomdxComponentPrinter.DeleteLink(AIndex: Integer); +var + Link: TBasedxReportLink; +begin + if (AIndex > -1) and (AIndex < LinkCount) then + begin + Link := ReportLink[AIndex]; + Link.Free; + end; +end; + +procedure TCustomdxComponentPrinter.DestroyReport(AReportLink: TBasedxReportLink = nil); +begin + AReportLink := CheckLink(AReportLink); + if AReportLink <> nil then AReportLink.DestroyReport; +end; + +function TCustomdxComponentPrinter.FindLinkByComponent(Value: TComponent; + ACanCreate: Boolean = False): TBasedxReportLink; +var + I: Integer; +begin + if Value <> nil then + for I := 0 to LinkCount - 1 do + begin + Result := ReportLink[I]; + if Result.Component = Value then Exit; + end; + + if ACanCreate then + Result := AddLink(Value) + else + Result := nil; +end; + +procedure TCustomdxComponentPrinter.GetLinks(AList: TList); +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + AList.Add(ReportLink[I]); +end; + +function TCustomdxComponentPrinter.IndexOfLink(AReportLink: TBasedxReportLink): Integer; +begin + Result := FReportLinks.IndexOf(AReportLink); +end; + +function TCustomdxComponentPrinter.IndexOfLink(const AName: string): Integer; +begin + Result := IndexOfLinkByName(AName); +end; + +function TCustomdxComponentPrinter.IndexOfLinkByName(const AName: string): Integer; +begin + Result := IndexOfLink(LinkByName(AName)); +end; + +function TCustomdxComponentPrinter.LinkByName(const AName: string): TBasedxReportLink; +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + begin + Result := ReportLink[I]; + if Result.Name = AName then Exit; + end; + Result := nil; +end; + +procedure TCustomdxComponentPrinter.RebuildReport(AReportLink: TBasedxReportLink = nil); +begin + if AReportLink = nil then AReportLink := CurrentLink; + if AReportLink <> nil then AReportLink.RebuildReport; +end; + +function TCustomdxComponentPrinter.CurrentCompositionByLink(AReportLink: TBasedxReportLink): TdxCompositionReportLink; +var + I: Integer; + Link: TBasedxReportLink; +begin + for I := 0 to LinkCount - 1 do + begin + Link := ReportLink[I]; + if (Link is TdxCompositionReportLink) and + TdxCompositionReportLink(Link).IsCurrentLink and + TdxCompositionReportLink(Link).Items.LinkExists(AReportLink) then + begin + Result := TdxCompositionReportLink(Link); + Exit; + end; + end; + Result := nil; +end; + +procedure TCustomdxComponentPrinter.GetCompositionsByLink(AReportLink: TBasedxReportLink; + ACompositions: TList); +var + I: Integer; + Link: TBasedxReportLink; +begin + for I := 0 to LinkCount - 1 do + begin + Link := ReportLink[I]; + if (Link is TdxCompositionReportLink) and + TdxCompositionReportLink(Link).Items.LinkExists(AReportLink) then + ACompositions.Add(Link); + end; +end; + +procedure TCustomdxComponentPrinter.GetItems(AComposition: TdxCompositionReportLink; + AStrings: TStrings; AExcludeAssigned: Boolean); +var + I: Integer; + Item: TBasedxReportLink; +begin + if AComposition.ComponentPrinter = Self then + begin + AStrings.BeginUpdate; + try + for I := 0 to LinkCount - 1 do + begin + Item := ReportLink[I]; + if not (Item is TdxCompositionReportLink) and + (not AExcludeAssigned or not IsLinkInComposition(Item, AComposition)) then + AStrings.AddObject(Item.Caption, Item); + end; + finally + AStrings.EndUpdate; + end; + end; +end; + +function TCustomdxComponentPrinter.IsLinkInComposition(AReportLink: TBasedxReportLink; + AComposition: TdxCompositionReportLink): Boolean; +var + List: TList; +begin + List := TList.Create; + try + GetCompositionsByLink(AReportLink, List); + Result := List.IndexOf(AComposition) <> -1; + finally + List.Free; + end; +end; + +function TCustomdxComponentPrinter.IsLinkInCurrentComposition(AReportLink: TBasedxReportLink): Boolean; +begin + Result := (CurrentLink is TdxCompositionReportLink) and + IsLinkInComposition(AReportLink, TdxCompositionReportLink(CurrentLink)); +end; + +class function TCustomdxComponentPrinter.GetNewLinkName(AReportLink: TBasedxReportLink): string; +begin + Result := sdxNewLinkNameTemplate; +end; + +class function TCustomdxComponentPrinter.IsSupportedCompClass(AComponentClass: TClass): Boolean; +begin + Result := dxPSIsSupportedCompClass(AComponentClass); +end; + +class function TCustomdxComponentPrinter.IsSupportedCompClass(AComponent: TObject{TComponent}): Boolean; +begin + Result := dxPSIsSupportedCompClass(AComponent); +end; + +procedure TCustomdxComponentPrinter.PreparePageSetup; +begin + Include(FState, cpsPageSetupDialog); +end; + +procedure TCustomdxComponentPrinter.UnpreparePageSetup; +begin + Exclude(FState, cpsPageSetupDialog); +end; + +procedure TCustomdxComponentPrinter.PrepareBuildReport(AReportLink: TBasedxReportLink); +begin + Include(FState, cpsBuilding); + DoStartUpdateReport(AReportLink); +end; + +procedure TCustomdxComponentPrinter.UnprepareBuildReport(AReportLink: TBasedxReportLink); +begin + Exclude(FState, cpsBuilding); + DoEndUpdateReport(AReportLink); + if PreviewExists then + with PreviewWindow do + if PageCount <> AReportLink.PageCount then + begin + PageCount := AReportLink.PageCount; + ActivePageIndex := FSavePageIndex; + if (PageCount <> 0) and (ActivePageIndex = -1) then + ActivePageIndex := 0; + end + else + InvalidateContent; +end; + +procedure TCustomdxComponentPrinter.PrepareLongOperation; +begin + if IsDestroying then Exit; + if FLongOperationCounter = 0 then + begin + FStartTime := GetTickCount; + if IsShowHourGlass then dxPSStartWait; + end; + Inc(FLongOperationCounter); +end; + +procedure TCustomdxComponentPrinter.UnprepareLongOperation; +begin + if IsDestroying then Exit; + if FLongOperationCounter <> 0 then + begin + Dec(FLongOperationCounter); + if FLongOperationCounter = 0 then + begin + if IsShowHourGlass then + dxPSStopWait; + if BeepAfterLongOperations then + begin + FEndTime := GetTickCount; + if FEndTime - FStartTime > DWORD(LongOperationTime) then Beep; + end; + end; + end; +end; + +procedure TCustomdxComponentPrinter.LoadFromFile(const AName: string); +var + Stream: TFileStream; +begin + if (AName <> '') and FileExists(AName) then + begin + Stream := TFileStream.Create(AName, fmOpenRead or fmShareDenyWrite); + try + LoadFromStream(Stream); + finally + Stream.Free; + end; + end; +end; + +procedure TCustomdxComponentPrinter.LoadFromStream(AStream: TStream); +var + Version: Integer; +begin + LoadVersionFromStream(AStream, Version); + if Version <> Self.Version then Exit; + + PrepareLoadFromStream(AStream); + try + BeforeLoadFromStream(AStream); + try + try + LoadLinksFromStream(AStream); + LoadItselfFromStream(AStream); + except + ErrorLoadFromStream(AStream); + end; + finally + AfterLoadFromStream(AStream); + end; + finally + UnprepareLoadFromStream(AStream); + end; +end; + +procedure TCustomdxComponentPrinter.AfterLoadFromStream(AStream: TStream); +begin + FMemoryStream.Free; +end; + +procedure TCustomdxComponentPrinter.SaveToFile(const AName: string); +var + Stream: TFileStream; +begin + if ValidateFileName(AName) then + begin + Stream := TFileStream.Create(AName, fmCreate); + try + SaveToStream(Stream); + finally + Stream.Free; + end; + end; +end; + +procedure TCustomdxComponentPrinter.SaveToStream(AStream: TStream); +begin + PrepareSaveToStream(AStream); + try + SaveVersionToStream(AStream); + SaveLinksToStream(AStream); + SaveItselfToStream(AStream); + finally + UnprepareSaveToStream(AStream); + end; +end; + +procedure TCustomdxComponentPrinter.DoCustomDrawEntirePage(AReportLink: TBasedxReportLink; + ACanvas: TCanvas; APageIndex: Integer; ARect: TRect; ANom, ADenom: Integer); +begin + if Assigned(FOnCustomDrawPage) then + FOnCustomDrawPage(Self, AReportLink, ACanvas, APageIndex, ARect, ANom, ADenom); +end; + +procedure TCustomdxComponentPrinter.DoNewPage(AReportLink: TBasedxReportLink; + APageIndex: Integer); +begin + AReportLink := CheckLink(AReportLink); + if AReportLink <> nil then + begin + if Assigned(FOnNewPage) then FOnNewPage(Self, AReportLink, APageIndex); + RaisePrintingEvent(AReportLink, APageIndex, 0, psProgress); + end; +end; + +procedure TCustomdxComponentPrinter.DoEndPrint(AReportLink: TBasedxReportLink); +begin + AReportLink := CheckLink(AReportLink); + if AReportLink <> nil then + begin + if Assigned(FOnEndPrint) then FOnEndPrint(Self, AReportLink); + RaisePrintingEvent(AReportLink, 0, 0, psEnd); + end; + AbortPrinting := False; +end; + +procedure TCustomdxComponentPrinter.DoStartPrint(AReportLink: TBasedxReportLink; + FullPageCount: Integer); +begin + AReportLink := CheckLink(AReportLink); + if AReportLink <> nil then + begin + if Assigned(FOnStartPrint) then FOnStartPrint(Self, AReportLink, FullPageCount); + RaisePrintingEvent(AReportLink, 0, FullPageCount, psStart); + end; +end; + +procedure TCustomdxComponentPrinter.DoAddReportLink(AReportLink: TBasedxReportLink); +begin + if not IsLoading and not FInternalStreaming then + if Assigned(FOnAddReportLink) then FOnAddReportLink(Self, AReportLink); +end; + +procedure TCustomdxComponentPrinter.DoAfterPreview(AReportLink: TBasedxReportLink); +begin + if cpoDropStorageModeAfterPreview in Options then + AReportLink.DataSource := rldsComponent; + if Assigned(FOnAfterPreview) then FOnAfterPreview(Self, AReportLink); +end; + +procedure TCustomdxComponentPrinter.DoBeforeDesignReport(AReportLink: TBasedxReportLink); +begin + if Assigned(FOnBeforeDesignReport) then + FOnBeforeDesignReport(Self, AReportLink, AReportLink.DesignWindow); +end; + +procedure TCustomdxComponentPrinter.DoBeforeDestroyReport(AReportLink: TBasedxReportLink); +begin + if PreviewExists then + begin + FSavePageIndex := PreviewWindow.ActivePageIndex; + PreviewWindow.PageCount := 0; + end + else + FSavePageIndex := -1; +end; + +procedure TCustomdxComponentPrinter.DoBeforePreview(AReportLink: TBasedxReportLink); +begin + if (PreviewWindow <> nil) and Assigned(FOnBeforePreview) then + FOnBeforePreview(Self, AReportLink); +end; + +procedure TCustomdxComponentPrinter.DoChangeComponent(AReportLink: TBasedxReportLink); +begin + if not IsLoading and Assigned(FOnChangeComponent) then + FOnChangeComponent(Self, AReportLink); +end; + +procedure TCustomdxComponentPrinter.DoChangeCurrentLink; +begin + if not IsLoading and not IsDestroying and Assigned(FOnChangeCurrentLink) then + FOnChangeCurrentLink(Self); +end; + +procedure TCustomdxComponentPrinter.DoDeleteReportLink(AReportLink: TBasedxReportLink); +begin + if not IsLoading then + if Assigned(FOnDeleteReportLink) then FOnDeleteReportLink(Self, AReportLink); +end; + +procedure TCustomdxComponentPrinter.DoFinalizePrintDlgData(AReportLink: TBasedxReportLink; + var APrintDlgData: TdxPrintDlgData); +begin + if Assigned(FOnFinalizePrintDlgData) then + FOnFinalizePrintDlgData(Self, AReportLink, APrintDlgData); +end; + +procedure TCustomdxComponentPrinter.DoInitializePrintDlgData(AReportLink: TBasedxReportLink; + var APrintDlgData: TdxPrintDlgData); +begin + if Assigned(FOnInitializePrintDlgData) then + FOnInitializePrintDlgData(Self, AReportLink, APrintDlgData); +end; + +procedure TCustomdxComponentPrinter.DoMeasureReportTitle(AReportLink: TBasedxReportLink; + var AHeight: Integer); +begin + if Assigned(FOnMeasureReportTitle) then + FOnMeasureReportTitle(Self, AReportLink, AHeight); +end; + +procedure TCustomdxComponentPrinter.DoDesignReport(AReportLink: TBasedxReportLink; + ADone: Boolean); +begin + if Assigned(FOnDesignReport) then + FOnDesignReport(Self, AReportLink, ADone); + + if ADone then + with AReportLink do + if DesignWindow.Modified and not DesignWindow.Applyed and IsRebuildNeededAndAllowed(False) then + RebuildReport; +end; + +procedure TCustomdxComponentPrinter.DoPrintDeviceBusy; +var + Done: Boolean; +begin + Done := False; + if Assigned(FOnPrintDeviceBusy) then FOnPrintDeviceBusy(Self, Done); + if not Done then StdProcessPrintDeviceBusy; +end; + +procedure TCustomdxComponentPrinter.StdProcessPrintDeviceBusy; +begin + MessageError(cxGetResourceString(@sdxPrintDeviceIsBusy)); +end; + +procedure TCustomdxComponentPrinter.DoPrintDeviceError; +var + Done: Boolean; +begin + Done := False; + if Assigned(FOnPrintDeviceError) then FOnPrintDeviceError(Self, Done); + if not Done then StdProcessPrintDeviceError; +end; + +procedure TCustomdxComponentPrinter.StdProcessPrintDeviceError; +begin + MessageError(cxGetResourceString(@sdxPrintDeviceError)); +end; + +procedure TCustomdxComponentPrinter.DoPageParamsChanged(AReportLink: TBasedxReportLink); +begin + if cpsPreviewing in State then + begin + PreviewWindow.InitContent; + PreviewWindow.UpdateControls; + end; +end; + +procedure TCustomdxComponentPrinter.DoPageSetup(AReportLink: TBasedxReportLink; + ADone: Boolean); +begin + if Assigned(FOnPageSetup) then FOnPageSetup(Self, AReportLink, ADone); +end; + +procedure TCustomdxComponentPrinter.DoProgress(AReportLink: TBasedxReportLink; + const PercentDone: Double); + + procedure ProcessKeyboardMessages; + var + Msg: TMsg; + begin + while PeekMessage(Msg, 0, WM_KEYFIRST, WM_KEYLAST, PM_NOREMOVE) do + begin + case Integer(GetMessage(Msg, 0, WM_KEYFIRST, WM_KEYLAST)) of + -1: Break; + 0: begin + PostQuitMessage(Msg.wParam); + Break; + end; + end; + DispatchMessage(Msg); + end; + end; + +begin + if IsGenerateReportProgressEvent then + if Assigned(FOnGenerateReportProgress) then FOnGenerateReportProgress(Self, AReportLink, PercentDone); + ProcessKeyboardMessages; + //Delay(20); + RaiseBuildingEvent(AReportLink, PercentDone, bsProgress); +end; + +procedure TCustomdxComponentPrinter.DoStartUpdateReport(AReportLink: TBasedxReportLink); +begin + if IsGenerateReportProgressEvent then + if Assigned(FOnStartGenerateReport) then FOnStartGenerateReport(Self, AReportLink); + RaiseBuildingEvent(AReportLink, 0, bsStart); +end; + +procedure TCustomdxComponentPrinter.DoEndUpdateReport(AReportLink: TBasedxReportLink); +begin + if IsGenerateReportProgressEvent then + if Assigned(FOnEndGenerateReport) then FOnEndGenerateReport(Self, AReportLink); + RaiseBuildingEvent(AReportLink, 0, bsEnd); +end; + +function TCustomdxComponentPrinter.GetPrintTitle(AReportLink: TBasedxReportLink): string; +begin + Result := FPrintTitle; + if Assigned(FOnGetPrintTitle) then + begin + AReportLink := CheckLink(AReportLink); + if AReportLink <> nil then FOnGetPrintTitle(Self, AReportLink, Result); + end; +end; + +function TCustomdxComponentPrinter.PreviewExists: Boolean; +begin + Result := (PreviewWindow <> nil) and (cpsPreviewing in State); +end; + +procedure TCustomdxComponentPrinter.SetupPreviewProperties(APreviewWindow: TBasedxPreviewWindow); + + function GetCaption: string; + begin + if IsExplorerMode then + Result := cxGetResourceString(@sdxReportExplorer) + else + Result := PreviewOptions.Caption; + end; + +begin + if not IsDesigning then + begin + {$IFDEF DELPHI9} + APreviewWindow.PopupMode := pmAuto; + {$ENDIF} + if not APreviewWindow.AreBoundsAssigned then + APreviewWindow.BoundsRect := PreviewOptions.Rect; + APreviewWindow.EnableOptions := PreviewOptions.EnableOptions; + APreviewWindow.HelpContext := PreviewOptions.HelpContext; + APreviewWindow.HelpFile := PreviewOptions.HelpFile; + APreviewWindow.VisibleOptions := PreviewOptions.VisibleOptions; + if not APreviewWindow.AreBoundsAssigned then + APreviewWindow.WindowState := PreviewOptions.WindowState; + end; + APreviewWindow.Caption := GetCaption; + APreviewWindow.Icon := PreviewOptions.Icon; + APreviewWindow.SaveZoomPosition := PreviewOptions.SaveZoomPosition; + APreviewWindow.ShowExplorer := PreviewOptions.ShowExplorer; +end; + +procedure TCustomdxComponentPrinter.Preview(AModal: Boolean = True; + AReportLink: TBasedxReportLink = nil); +begin + AReportLink := CheckLink(AReportLink); + if AReportLink = nil then Exit; + if not PreviewExists then + begin + if AReportLink.DataProviderPresent and (IsDesigning or IsRebuildBeforePreview) then + begin + AReportLink.PrinterPage.InitFromPrintDevice; + try + RebuildReport(AReportLink); + if AbortBuilding then Exit; + except + if Explorer <> nil then + begin + with Explorer do + begin + if LoadedItem <> nil then + DoItemDataLoadError(LoadedItem); + FLoadedItem := nil; //!!! + end; + if not (cpsExplore in State) then Exit; + end; + end; + DesignerModified; + end + else + if AutoUpdateDateTime then AReportLink.DateTime := Now; + + if Explorer <> nil then Explorer.Refresh; + InitDevModeFromPrinterPageSettings(AReportLink.PrinterPage); + FPreviewWindow := CreatePreviewWindow(AReportLink); + if IsExplorerMode and (PreviewWindow <> nil) then + PreviewWindow.ExplorerTree.MakeItemVisible(Explorer.LoadedItem); + Include(FState, cpsPreviewing); + DoBeforePreview(AReportLink); + FModalPreview := AModal; + if AModal then + try + FPreviewWindow.ShowModal; + finally + DoAfterPreview(AReportLink); + FreeAndNil(FPreviewWindow); + end + else + FPreviewWindow.Show; + end + else + ShowExistingPreviewWindow; +end; + +procedure TCustomdxComponentPrinter.PaintPage(ACanvas: TCanvas; + APageIndex: Integer; const APageBounds, AContentBounds: TRect; + AReportLink: TBasedxReportLink = nil); +var + ZoomFactor: Integer; +begin + AReportLink := CheckLink(AReportLink); + if AReportLink = nil then Exit; + + ZoomFactor := 100; + if (PreviewWindow <> nil) and IsDisplayDC(ACanvas.Handle) then + ZoomFactor := PreviewWindow.ZoomFactor; + + AReportLink.PaintPage(ACanvas, APageBounds, APageIndex, APageIndex, ZoomFactor); +end; + +procedure TCustomdxComponentPrinter.DoCustomDrawReportTitle(AReportLink: TBasedxReportLink; + ACanvas: TCanvas; ARect: TRect; var ATextAlignX: TdxTextAlignX; + var ATextAlignY: TdxTextAlignY; var AColor: TColor; AFont: TFont; + var ADone: Boolean; APixelsNumerator: Integer = 0); +begin + if Assigned(FOnCustomDrawReportTitle) then + begin + if APixelsNumerator = 0 then + APixelsNumerator := PixelsNumerator; + FOnCustomDrawReportTitle(Self, AReportLink, ACanvas, ARect, APixelsNumerator, + PixelsDenominator, ATextAlignX, ATextAlignY, AColor, AFont, ADone); + end; +end; + +procedure TCustomdxComponentPrinter.DoCustomDrawPageHeaderOrFooter( + AReportLink: TBasedxReportLink; AHFObject: TCustomdxPageObject; + ACanvas: TCanvas; APageIndex: Integer; R: TRect; + var ADefaultDrawText, ADefaultDrawBackground: Boolean; + APixelsNumerator: Integer = 0); +begin + if APixelsNumerator = 0 then + APixelsNumerator := PixelsNumerator; + if AHFObject is TdxPageHeader then + begin + if Assigned(FOnCustomDrawPageHeader) then + FOnCustomDrawPageHeader(Self, AReportLink, ACanvas, APageIndex, R, + APixelsNumerator, PixelsDenominator, ADefaultDrawText, ADefaultDrawBackground) + end + else + if Assigned(FOnCustomDrawPageFooter) then + FOnCustomDrawPageFooter(Self, AReportLink, ACanvas, APageIndex, R, + APixelsNumerator, PixelsDenominator, ADefaultDrawText, ADefaultDrawBackground); +end; + +procedure TCustomdxComponentPrinter.PrintPage(AReportLink: TBasedxReportLink; + APageIndex: Integer); +var + R: TRect; +begin + if AbortPrinting then Exit; + AReportLink := CheckLink(AReportLink); + if AReportLink = nil then Exit; + + with dxPrintDevice do + begin + R := MakeBounds(0, 0, PageWidth, PageHeight); + InflateRect(R, PhysOffsetX, PhysOffsetY); + end; + PaintPage(dxPrintDevice.Canvas, APageIndex, R, R, AReportLink); +end; + +procedure TCustomdxComponentPrinter.PrintPages(const APageIndexes: array of Integer; + AReportLink: TBasedxReportLink = nil); +begin + PrintPagesEx(APageIndexes, pnAll, 1, False, AReportLink); +end; + +procedure TCustomdxComponentPrinter.PrintPagesEx(const APageIndexes: array of Integer; + APageNums: TdxPageNumbers; ACopyCount: Integer; ACollate: Boolean; + AReportLink: TBasedxReportLink = nil); + + function GetTotalPageCount: Integer; + begin + Result := ACopyCount * Length(APageIndexes); + if APageNums <> pnAll then + begin + if (APageNums = pnOdd) and Odd(Result) then + Inc(Result); + Result := Result div 2; + end; + end; + + procedure GetActualPageIndexes(out AnActualPageIndexes: TIntegers); + + function AreAllPagesInRange: Boolean; + var + I: Integer; + begin + if FPrintAll then + Result := True + else + begin + Result := Length(APageIndexes) = AReportLink.PageCount; + if Result then + for I := 1 to AReportLink.PageCount do + begin + Result := APageIndexes[I - 1] = I; + if not Result then Exit; + end; + end; + end; + + var + IsRecombineNeeded: Boolean; + ColCount, RowCount, I, J, K: Integer; + begin + SetLength(AnActualPageIndexes, Length(APageIndexes)); + IsRecombineNeeded := AReportLink.RealPrinterPage.PageOrder = poDownThenOver; + if IsRecombineNeeded then + begin + AReportLink.GetPageColRowCount(ColCount, RowCount); + IsRecombineNeeded := (ColCount <> 1) and (RowCount <> 1) and AreAllPagesInRange; + end; + + if IsRecombineNeeded then + begin + K := 0; + for I := 0 to ColCount - 1 do + for J := 0 to RowCount - 1 do + begin + AnActualPageIndexes[K] := APageIndexes[I + J * ColCount]; + Inc(K); + end; + end + else + for I := 0 to Length(APageIndexes) - 1 do + AnActualPageIndexes[I] := APageIndexes[I]; + end; + + function CanPrintPage(AIndex, APageIndex: Integer): Boolean; + begin + Result := not ((APageIndex < 0) or + (APageIndex > AReportLink.PageCount - 1) or + ((APageNums = pnEven) and not Odd(AIndex)) or + ((APageNums = pnOdd) and Odd(AIndex))); + end; + + procedure DoPrintPage(var ACurrentPage: Integer; APageIndex: Integer); + begin + if ACurrentPage > 0 then + begin + DoNewPage(AReportLink, ACurrentPage); + dxPrintDevice.NewPage; + end; + if Application.Terminated then AbortPrinting := True; + if not AbortPrinting then PrintPage(AReportLink, APageIndex); + Inc(ACurrentPage); + end; + +var + CurrentPage, Index, PageIndex, CopyIndex: Integer; + ActualPageIndexes: TIntegers; +begin + AReportLink := CheckLink(AReportLink); + + if (AReportLink = nil) or not AReportLink.DataProviderPresent then Exit; + + PrepareReport(AReportLink); + try + if AbortBuilding or (AReportLink.PageCount = 0) then Exit; + + dxInitPrintDevice(True); + if dxPrintDevice.Printing then + begin + DoPrintDeviceBusy; + Exit; + end; + + if not AReportLink.ValidateMargins then Exit; + + if ACopyCount < 1 then ACopyCount := 1; + GetActualPageIndexes(ActualPageIndexes); + + AReportLink.BeforePrinting; + try + try + Include(FState, cpsPrinting); + try + PreparePrintDevice; + try + dxPrintDevice.Title := GetPrintTitle(AReportLink); + if dxPrintDevice.BeginDoc > 0 then + try + DoStartPrint(AReportLink, GetTotalPageCount); + + CurrentPage := 0; + if not ACollate and (ACopyCount > 1) then + for Index := 0 to Length(ActualPageIndexes) - 1 do + begin + PageIndex := ActualPageIndexes[Index] - 1; + if not CanPrintPage(Index, PageIndex) then Continue; + for CopyIndex := 1 to ACopyCount do + begin + DoPrintPage(CurrentPage, PageIndex); + if AbortPrinting then Break; + end; + if AbortPrinting then Break; + end + else + for CopyIndex := 1 to ACopyCount do + begin + for Index := 0 to Length(ActualPageIndexes) - 1 do + begin + PageIndex := ActualPageIndexes[Index] - 1; + if not CanPrintPage(Index, PageIndex) then Continue; + DoPrintPage(CurrentPage, PageIndex); + if AbortPrinting then Break; + end; + if AbortPrinting then Break; + end; + finally + if dxPrintDevice.Printing then + if AbortPrinting then + dxPrintDevice.Abort + else + dxPrintDevice.EndDoc; + DoEndPrint(AReportLink); + end + else + if (dxPrintDevice.CurrentPort = nil) or + (StrIComp(dxPrintDevice.CurrentPort, sdxFilePort) <> 0) then + DoPrintDeviceError; + finally + UnpreparePrintDevice; + end; + finally + Exclude(FState, cpsPrinting); + end; + except + if dxPrintDevice.Printing then + try + dxPrintDevice.Abort; + except + Application.HandleException(Self); + end; + DoPrintDeviceError; + end; + finally + AReportLink.AfterPrinting; + end; + finally + UnprepareReport(AReportLink); + end; +end; + +function TCustomdxComponentPrinter.Print(AShowDialog: Boolean; + APPrintDlgData: PdxPrintDlgData; + AReportLink: TBasedxReportLink = nil): Boolean; + + function GetPrintDlgData(AReportLink: TBasedxReportLink): TdxPrintDlgData; + begin + if APPrintDlgData <> nil then + Result := APPrintDlgData^ + else + InitializeDefaultPrintDlgData(AReportLink, Result); + end; + + procedure DonePrintDlgData(AReportLink: TBasedxReportLink; var APrintDlgData: TdxPrintDlgData); + begin + if APPrintDlgData = nil then + FinalizeDefaultPrintDlgData(AReportLink, APrintDlgData); + end; + +var + PrintDlgData: TdxPrintDlgData; +begin + Result := False; + AReportLink := CheckLink(AReportLink); + if AReportLink = nil then Exit; + InitDevModeFromPrinterPageSettings(AReportLink.PrinterPage); + try + if not AShowDialog then + begin + PrepareReport(AReportLink); + PrintDlgData := GetPrintDlgData(AReportLink); + try + if not AbortBuilding and (AReportLink.PageCount > 0) then + with PrintDlgData.DialogData do + Result := PrintPagesAsStringEx(Pages, PageNums, Copies, Collate, AReportLink) + else + Result := False; + finally + UnprepareReport(AReportLink); + end; + end + else + begin + PrintDlgData := GetPrintDlgData(AReportLink); + Result := PrintDialog(AReportLink, PrintDlgData); + end; + finally + DonePrintDlgData(AReportLink, PrintDlgData); + end; +end; + +procedure TCustomdxComponentPrinter.PrepareReport(AReportLink: TBasedxReportLink); +begin + if not AReportLink.FPrepared then + if AReportLink.DataProviderPresent then + begin + if not PreviewExists and (IsDesigning or IsRebuildBeforePrint) then + begin + RebuildReport(AReportLink); + DesignerModified; + end + else + if AutoUpdateDateTime then AReportLink.DateTime := Now; + + AReportLink.FPrepared := True; + end + else + AReportLink.FPrepared := False; +end; + +procedure TCustomdxComponentPrinter.UnprepareReport(AReportLink: TBasedxReportLink); +begin + AReportLink.FPrepared := False; +end; + +procedure TCustomdxComponentPrinter.BeforeLoadFromStream(AStream: TStream); +begin + FMemoryStream := TMemoryStream.Create; + SaveToStream(FMemoryStream); + DeleteAllLinks; +end; + +procedure TCustomdxComponentPrinter.ErrorLoadFromStream(AStream: TStream); +begin + DeleteAllLinks; + FMemoryStream.Position := 0; + LoadFromStream(FMemoryStream); + Application.HandleException(Self); +end; + +procedure TCustomdxComponentPrinter.PrepareLoadFromStream(AStream: TStream); +begin + FInternalStreaming := True; + Include(FState, cpsLoading); +end; + +procedure TCustomdxComponentPrinter.UnprepareLoadFromStream(AStream: TStream); +begin + Exclude(FState, cpsLoading); + FInternalStreaming := False; +end; + +procedure TCustomdxComponentPrinter.LoadItselfFromStream(AStream: TStream); +var + I: Integer; +begin + AStream.ReadComponent(Self); + Loaded; + for I := 0 to LinkCount - 1 do + ReportLink[I].Loaded; +end; + +procedure TCustomdxComponentPrinter.LoadLinksFromStream(AStream: TStream); +var + Count, I: Integer; + Links: TList; +begin + AStream.ReadBuffer(Count, SizeOf(Count)); + + Links := TList.Create; + try + Links.Count := Count; + + for I := 0 to Count - 1 do + begin + Links[I] := AStream.ReadComponent(nil); + Owner.InsertComponent(TComponent(Links[I])); + end; + + for I := 0 to Count - 1 do + begin + TBasedxReportLink(Links[I]).ComponentPrinter := Self; + if TObject(Links[I]) is TdxCompositionReportLink then + TdxCompositionReportLink(Links[I]).Items.CorrectLinksAfterLoadings; + end; + finally + Links.Free; + end; +end; + +procedure TCustomdxComponentPrinter.LoadVersionFromStream(AStream: TStream; var AVersion: Integer); +begin + AStream.ReadBuffer(AVersion , SizeOf(AVersion)); +end; + +procedure TCustomdxComponentPrinter.PrepareSaveToStream(AStream: TStream); +begin + FInternalStreaming := True; + Include(FState, cpsSaving); +end; + +procedure TCustomdxComponentPrinter.UnprepareSaveToStream(AStream: TStream); +begin + Exclude(FState, cpsSaving); + FInternalStreaming := False; +end; + +procedure TCustomdxComponentPrinter.SaveItselfToStream(AStream: TStream); +begin + AStream.WriteComponent(Self); +end; + +procedure TCustomdxComponentPrinter.SaveLinksToStream(AStream: TStream); +var + I: Integer; +begin + I := LinkCount; + AStream.WriteBuffer(I , SizeOf(I)); + for I := 0 to LinkCount - 1 do + begin + ReportLink[I].InternalStreaming := True; + AStream.WriteComponent(ReportLink[I]); + end; +end; + +procedure TCustomdxComponentPrinter.SaveVersionToStream(AStream: TStream); +begin + AStream.WriteBuffer(Version , SizeOf(Version)); +end; + +procedure TCustomdxComponentPrinter.PrintEx(APageNums: TdxPageNumbers; + ACopies: Integer; ACollate: Boolean; AReportLink: TBasedxReportLink = nil); +begin + AReportLink := CheckLink(AReportLink); + if AReportLink <> nil then + begin + PrepareReport(AReportLink); + try + if not AbortBuilding and (AReportLink.PageCount > 0) then + begin + FPrintAll := True; + try + PrintPagesAsStringEx('1-' + Trim(IntToStr(AReportLink.PageCount)), APageNums, ACopies, ACollate, AReportLink); + finally + FPrintAll := False; + end; + end; + finally + UnprepareReport(AReportLink); + end; + end; +end; + +procedure TCustomdxComponentPrinter.PreparePrintDevice; +begin + if dxPrintDevice.Copies > 1 then + begin + FSaveCopies := dxPrintDevice.Copies; + dxPrintDevice.Copies := 1; + end; + if dxPrintDevice.Collate then + begin + FSaveCollate := dxPrintDevice.Collate; + dxPrintDevice.Collate := False; + end; + CurrentLink.RealPrinterPage.ApplyToPrintDevice; + + dxPSEdgePatternFactory.ResetPrintItems; + dxPSFillPatternFactory.ResetPrintItems; +end; + +procedure TCustomdxComponentPrinter.UnpreparePrintDevice; +begin + if FSaveCopies > 1 then + dxPrintDevice.Copies := FSaveCopies; + FSaveCopies := 1; + if FSaveCollate then + dxPrintDevice.Collate := FSaveCollate; + FSaveCollate := False; +end; + +procedure TCustomdxComponentPrinter.GetPageColRowCount(out ACol, ARow: Integer; + AReportLink: TBasedxReportLink = nil); +begin + AReportLink := CheckLink(AReportLink); + if AReportLink = nil then + begin + ACol := 0; + ARow := 0; + end + else + AReportLink.GetPageColRowCount(ACol, ARow); +end; + +function TCustomdxComponentPrinter.GetPageCount(AReportLink: TBasedxReportLink = nil): Integer; +begin + AReportLink := CheckLink(AReportLink); + if AReportLink <> nil then + Result := AReportLink.PageCount + else + Result := 0; +end; + +function TCustomdxComponentPrinter.PageSetup(AReportLink: TBasedxReportLink): Boolean; +begin + AReportLink := CheckLink(AReportLink); + Result := (AReportLink <> nil) and AReportLink.PageSetup; +end; + +function TCustomdxComponentPrinter.PageSetupEx(AActivePageIndex: Integer; + AShowPreviewBtn, AShowPrintBtn: Boolean; out APreviewBtnClicked, APrintBtnClicked: Boolean; + AReportLink: TBasedxReportLink = nil): Boolean; +begin + AReportLink := CheckLink(AReportLink); + Result := (AReportLink <> nil) and + AReportLink.PageSetupEx(AActivePageIndex, AShowPreviewBtn, AShowPrintBtn, APreviewBtnClicked, APrintBtnClicked); +end; + +function TCustomdxComponentPrinter.PageSetupEx(AActivePageIndex: Integer; + APreviewBtnClicked, APrintBtnClicked: PBoolean; + AReportLink: TBasedxReportLink = nil): Boolean; +var + ShowPreviewBtn, ShowPrintBtn, PreviewBtnClicked, PrintBtnClicked: Boolean; +begin + AReportLink := CheckLink(AReportLink); + if AReportLink <> nil then + begin + ShowPreviewBtn := APreviewBtnClicked <> nil; + ShowPrintBtn := APrintBtnClicked <> nil; + Result := AReportLink.PageSetupEx(AActivePageIndex, ShowPreviewBtn, ShowPrintBtn, PreviewBtnClicked, PrintBtnClicked); + + if ShowPreviewBtn then + APreviewBtnClicked^ := PreviewBtnClicked; + + if ShowPrintBtn then + APrintBtnClicked^ := PrintBtnClicked; + end + else + Result := False; +end; + +procedure TCustomdxComponentPrinter.Explore; +var + PrevCurrentLink: TBasedxReportLink; +begin + if Explorer <> nil then + begin + Include(FState, cpsExplore); + try + PrevCurrentLink := CurrentLink; + CurrentLink := ExplorerRealStubLink; + try + CurrentLink.DataSource := rldsExternalStorage; + Preview(True); + finally + if ExplorerStubLink = nil then { Link had been created manually before } + CurrentLink.Free; + CurrentLink := PrevCurrentLink; + end; + finally + Exclude(FState, cpsExplore); + end; + end; +end; + +function TCustomdxComponentPrinter.DesignerExists(AReportLink: TBasedxReportLink = nil): Boolean; +begin + AReportLink := CheckLink(AReportLink); + Result := (AReportLink <> nil) and (AReportLink.GetDesignerClass <> nil); +end; + +function TCustomdxComponentPrinter.DesignerExistsByComponent(AComponent: TComponent): Boolean; +begin + Result := (AComponent <> nil) and (dxPSDesignerClassByCompClass(TComponentClass(AComponent.ClassType)) <> nil); +end; + +function TCustomdxComponentPrinter.DesignReport(AReportLink: TBasedxReportLink): Boolean; +begin + AReportLink := CheckLink(AReportLink); + if AReportLink <> nil then + begin + Include(FState, cpsDesigning); + try + Result := AReportLink.DesignReport; + finally + Exclude(FState, cpsDesigning); + end; + end + else + Result := False; +end; + +procedure TCustomdxComponentPrinter.DrawPageHeader(AReportLink: TBasedxReportLink; + APageIndex: Integer; ARect: TRect; + ATitleParts: TdxPageTitleParts; ADrawBackground: Boolean); +begin + AReportLink.DrawPageHeader(APageIndex, ARect, ATitleParts, ADrawBackground); +end; + +procedure TCustomdxComponentPrinter.DrawPageFooter(AReportLink: TBasedxReportLink; + APageIndex: Integer; ARect: TRect; + ATitleParts: TdxPageTitleParts; ADrawBackground: Boolean); +begin + AReportLink.DrawPageFooter(APageIndex, ARect, ATitleParts, ADrawBackground); +end; + +{ TdxComponentPrinter } + +constructor TdxComponentPrinter.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FCustomizeDlgOptions := [cdoShowDescription]; + FOverWriteExistingFiles := False; +end; + +destructor TdxComponentPrinter.Destroy; +begin + if not IsDesigning and (dxPSEngine.RealRegistryPath <> '') then + SaveToRegistry(dxPSEngine.RealRegistryPath); + inherited Destroy; +end; + +procedure TdxComponentPrinter.ShowCustomizeDlg; +{$IFNDEF CBUILDER6} +var + Data: TdxCPDesignerDlgData; +{$ENDIF} +begin +{$IFNDEF CBUILDER6} + FillChar(Data, SizeOf(TdxCPDesignerDlgData), 0); + Data.ComponentPrinter := Self; + if cdoShowDescription in CustomizeDlgOptions then + Include(Data.Options, doShowDescription); + Include(FState, cpsCustomizing); + try + dxShowCPDesignerDlg(Data); + finally + Exclude(FState, cpsCustomizing); + end; +{$ENDIF} +end; + +procedure TdxComponentPrinter.Loaded; +begin + inherited Loaded; + if (LinkCount > 0) and (CurrentLink = nil) then + CurrentLink := ReportLink[0]; + if not IsDesigning then + LoadFromRegistry(dxPSEngine.RealRegistryPath); +end; + +procedure TdxComponentPrinter.SaveToRegistry(const APath: string); + + procedure SaveFormats(const APath: string); + begin + with TRegistry.Create do + try + if OpenKey(APath, True) then + try + try + WriteBool(sdxAutoUpdateDateTime, AutoUpdateDateTime); + WriteInteger(sdxDateFormat, DateFormat); + WriteInteger(sdxTimeFormat, TimeFormat); + WriteInteger(sdxPageNumberFormat, Integer(PageNumberFormat)); + except + on ERegistryException do + { ignore } + else + raise; + end; + finally + CloseKey; + end; + finally + Free; + end; + end; + +begin + if APath = '' then Exit; + SaveFormats(APath); + dxSaveStringsToRegistry(APath + sdxPrintDlgFilesRegistryPath + '\' + Name, FPrintFileList); +end; + +procedure TdxComponentPrinter.LoadFromRegistry(const APath: string); + + procedure LoadFormats(const APath: string); + begin + with TRegistry.Create do + try + if OpenKey(APath, False) then + try + try + if ValueExists(sdxAutoUpdateDateTime) then + AutoUpdateDateTime := ReadBool(sdxAutoUpdateDateTime); + if ValueExists(sdxDateFormat) then + DateFormat := ReadInteger(sdxDateFormat); + if ValueExists(sdxTimeFormat) then + TimeFormat := ReadInteger(sdxTimeFormat); + if ValueExists(sdxPageNumberFormat) then + PageNumberFormat := TdxPageNumberFormat(ReadInteger(sdxPageNumberFormat)); + except + on ERegistryException do + { ignore } + else + raise; + end; + finally + CloseKey; + end; + finally + Free; + end; + end; + +begin + if APath = '' then Exit; + LoadFormats(APath); + dxLoadStringsFromRegistry(APath + sdxPrintDlgFilesRegistryPath + '\' + Name, FPrintFileList); +end; + +function TdxComponentPrinter.DoFilterComponent(AComponent: TComponent; + var ACaption, ADescription: string): Boolean; +begin + Result := True; + if Assigned(FOnFilterComponent) then + FOnFilterComponent(Self, AComponent, ACaption, ADescription, Result); +end; + +procedure TdxComponentPrinter.GetDefaultExportPageFileName(AIndex, + APageIndex: Integer; var AFileName: string); +begin + AFileName := Format(AFileName, [APageIndex]); +end; + +procedure TdxComponentPrinter.GetExportPageFileName(AIndex, APageIndex: Integer; + var AFileName: string); +begin + if Assigned(FOnExportGetPageFileName) then + FOnExportGetPageFileName(Self, AIndex, APageIndex, AFileName) + else + GetDefaultExportPageFileName(AIndex, APageIndex, AFileName); +end; + +function TdxComponentPrinter.GetSupportedComponents(AComponents: TStrings): Boolean; +begin + Result := Assigned(FOnGetSupportedComponents); + if Result then + FOnGetSupportedComponents(Self, AComponents); +end; + +procedure TdxComponentPrinter.EnumPagesAsImages(const APageIndexes: array of Integer; + AGraphicClass: TGraphicClass; ADrawBackground: Boolean; ACallBackProc: TdxEnumPagesAsImagesProc; + ACallBackData, AProgressData, APrepareData: Pointer; + AReportLink: TBasedxReportLink = nil); +begin + AReportLink := CheckLink(AReportLink); + if AReportLink = nil then Exit; + dxPSEnumReportPages(Self, AReportLink, APageIndexes, AGraphicClass, ADrawBackground, + ACallBackProc, ACallBackData, OnExportProgress, AProgressData, + OnExportPrepareGraphic, APrepareData); +end; + +procedure TdxComponentPrinter.WritePageAsImageToDisk(AComponentPrinter: TCustomdxComponentPrinter; + AReportLink: TBasedxReportLink; AIndex, APageIndex: Integer; const AGraphic: TGraphic; + AData: Pointer; var AContinue: Boolean); +const + Buttons: TMsgDlgButtons = [mbYes, mbYesToAll, mbNo, mbCancel {, mbHelp}]; +var + FileName: string; + MessageResult: Word; + MessageText: string; +begin + if AData = nil then Exit; + FileName := string(AData); + GetExportPageFileName(AIndex, APageIndex, FileName); + if not ValidateFileName(FileName) then Exit; + + FOverWriteFile := True; + if FileExists(FileName) and not OverWriteExistingFiles and not FOverWriteAll then + begin + FOverWriteFile := False; + Beep; + MessageText := Format(cxGetResourceString(@sdxConfirmOverWrite), [FileName]); + MessageResult := MessageDlg(MessageText, mtWarning, Buttons, 0); + case MessageResult of + mrYes: + FOverWriteFile := True; + mrYesToAll: + begin + FOverWriteFile := True; + FOverWriteAll := True; + end; + mrNo: + begin + AContinue := dxShowChooseFileNameDlg(FileName); + if AContinue then FOverWriteFile := True; + end; + mrCancel: + AContinue := False; + end; + end; + if FOverWriteFile then + begin + if AGraphic is TBitmap then + TBitmap(AGraphic).HandleType := bmDIB; + AGraphic.SaveToFile(FileName); + end; +end; + +procedure TdxComponentPrinter.SavePagesAsImagesToDisk(const APageIndexes: array of Integer; + AGraphicClass: TGraphicClass; ADrawBackground: Boolean; const AFileMask: string; + AProgressData, APrepareData: Pointer; + AReportLink: TBasedxReportLink = nil); +var + PFileMask: PChar; +begin + FOverWriteAll := False; + PrepareLongOperation; + try + PFileMask := PChar(AFileMask); + EnumPagesAsImages(APageIndexes, AGraphicClass, ADrawBackground, + WritePageAsImageToDisk, PFileMask, AProgressData, APrepareData, + AReportLink); + finally + FOverWriteAll := False; + UnprepareLongOperation; + end; +end; + +{ TAbstractdxPreviewWindowDesigner } + +constructor TAbstractdxPreviewWindowDesigner.Create(AComponentPrinter: TCustomdxComponentPrinter); +begin + inherited Create; + FComponentPrinter := AComponentPrinter; + if FComponentPrinter <> nil then + FComponentPrinter.FPreviewWindowDesigner := Self; +end; + +destructor TAbstractdxPreviewWindowDesigner.Destroy; +begin + if FComponentPrinter <> nil then + FComponentPrinter.FPreviewWindowDesigner := nil; + inherited Destroy; +end; + +{ TAbstractdxReportLinkDesigner } + +constructor TAbstractdxReportLinkDesigner.Create(AComponentPrinter: TCustomdxComponentPrinter); +begin + inherited Create; + FComponentPrinter := AComponentPrinter; + if FComponentPrinter <> nil then + FComponentPrinter.FReportLinkDesigner := Self; +end; + +destructor TAbstractdxReportLinkDesigner.Destroy; +begin + if FComponentPrinter <> nil then + FComponentPrinter.FReportLinkDesigner := nil; + inherited Destroy; +end; + +{ export } + +procedure dxPSEnumReportPages(AComponentPrinter: TdxComponentPrinter; + AReportLink: TBasedxReportLink; const APageIndexes: array of Integer; + AGraphicClass: TGraphicClass; AnExportBackground: Boolean; + ACallBackProc: TdxEnumPagesAsImagesProc; + ACallBackData: Pointer; + AProgressProc: TdxExportProgressEvent; + AProgressData: Pointer; + APrepareGraphicProc: TdxExportPrepareGraphicEvent; + APrepareData: Pointer); + + procedure GetPPI(out APPI: TPoint); + var + DC: HDC; + begin + DC := GetDC(0); + try + APPI.X := GetDeviceCaps(DC, LOGPIXELSX); + APPI.Y := GetDeviceCaps(DC, LOGPIXELSY); + finally + ReleaseDC(0, DC); + end; + end; + + function AreAllPagesEnumerated: Boolean; + begin + Result := (Low(APageIndexes) = High(APageIndexes)) and (APageIndexes[0] = -1); + end; + + procedure GetPageBounds(out R: TRect); + begin + with AReportLink.RealPrinterPage.PageSizePixels do + R := MakeRect(0, 0, X, Y); + end; + + procedure PreparePageIndexes(out AnActualPageIndexes: TIntegers); + var + I: Integer; + begin + if AreAllPagesEnumerated then + begin + SetLength(AnActualPageIndexes, AReportLink.PageCount); + for I := 0 to AReportLink.PageCount - 1 do + AnActualPageIndexes[I] := I; + end + else + begin + SetLength(AnActualPageIndexes, Length(APageIndexes)); + for I := 0 to Length(APageIndexes) - 1 do + AnActualPageIndexes[I] := APageIndexes[I]; + end; + end; + + function CreatePageAsMetafile(const ABounds: TRect; const APPI: TPoint; APageIndex: Integer): TMetafile; +{ const + HundredsMMInInch = 2540;} + var + MetaCanvas: TCanvas; + begin + Result := TMetafile.Create; + try + with ABounds do + begin + Result.Width := Right - Left; + Result.Height := Bottom - Top; +{ Result.MMHeight := MulDiv(Bottom - Top, HundredsMMInInch, APPI.X); + Result.MMWidth := MulDiv(Right - Left, HundredsMMInInch, APPI.Y);} + end; + + MetaCanvas := TMetafileCanvas.Create(Result, 0); + try + if AGraphicClass.InheritsFrom(TMetafile) and Assigned(APrepareGraphicProc) then + APrepareGraphicProc(AComponentPrinter, AReportLink, Result, APrepareData); + + if not AnExportBackground or AReportLink.RealPrinterPage.Background.IsEmpty then + begin + MetaCanvas.Brush.Color := clWhite; + MetaCanvas.FillRect(ABounds); + end + else + AReportLink.RealPrinterPage.Background.Paint(MetaCanvas, ABounds); + + if (-1 < APageIndex) and (APageIndex < AReportLink.PageCount) then + AComponentPrinter.PaintPage(MetaCanvas, APageIndex, ABounds, ABounds, AReportLink); + finally + MetaCanvas.Free; + end; + except + Result.Free; + raise; + end; + end; + + function CreatePageAsGraphic(const ABounds: TRect; const APPI: TPoint; APageIndex: Integer): TGraphic; + var + Metafile: TMetafile; + Bitmap: TBitmap; + begin + Metafile := CreatePageAsMetafile(ABounds, APPI, APageIndex); + try + if not AGraphicClass.InheritsFrom(TMetafile) then + begin + Bitmap := TBitmap.Create; + try + Bitmap.Height := Metafile.Height; + Bitmap.Width := Metafile.Width; + if AGraphicClass.InheritsFrom(TBitmap) and Assigned(APrepareGraphicProc) then + APrepareGraphicProc(AComponentPrinter, AReportLink, Bitmap, APrepareData); + Bitmap.Canvas.Draw(0, 0, Metafile); + + if not AGraphicClass.InheritsFrom(TBitmap) then + begin + Result := dxPSUtl.CreateGraphic(AGraphicClass); + try + if Assigned(APrepareGraphicProc) then + APrepareGraphicProc(AComponentPrinter, AReportLink, Result, APrepareData); + Result.Assign(Bitmap); + except + Result.Free; + raise; + end; + end + else + Result := Bitmap; + finally + if not AGraphicClass.InheritsFrom(TBitmap) then Bitmap.Free; + end; + end + else + Result := Metafile; + finally + if not AGraphicClass.InheritsFrom(TMetafile) then Metafile.Free; + end; + end; + +var + PPI: TPoint; + PageCount, I, PageIndex: Integer; + ActualPageIndexes: TIntegers; + ContinueExport: Boolean; + R: TRect; + Graphic: TGraphic; +begin + if (AComponentPrinter = nil) or (AReportLink = nil) or not Assigned(ACallBackProc) then + Exit; + + if AGraphicClass = nil then AGraphicClass := TMetafile; + + GetPPI(PPI); + PreparePageIndexes(ActualPageIndexes); + try + GetPageBounds(R); + ContinueExport := True; + PageCount := Length(ActualPageIndexes); + for I := 0 to PageCount - 1 do + begin + PageIndex := ActualPageIndexes[I]; + Graphic := CreatePageAsGraphic(R, PPI, PageIndex); + try + ACallBackProc(AComponentPrinter, AReportLink, I, PageIndex, Graphic, ACallBackData, ContinueExport); + finally + Graphic.Free; + end; + if not ContinueExport then Break; + if Assigned(AProgressProc) then + AProgressProc(AComponentPrinter, AReportLink, PageCount, I, PageIndex, AProgressData); + end; + finally + SetLength(ActualPageIndexes, 0); + end; +end; + +procedure InitializeUnits; +begin + if IsWin95Or98 then FUnitsPerInch := 960; + FPixelsNumerator := FUnitsPerInch; + FPixelsDenominator := Screen.PixelsPerInch; +end; + +procedure RegisterAssistants; +begin + TdxPSExplorerTreeBuilder.Register; + TdxPSRunTimeComponentsProvider.Register; + + TdxPSDataReader.Register; + TdxPSDataWriter.Register; + + TdxPSCustomCellBorder.Register; + TdxPSCellNullBorder.Register; + TdxPSCellFlatBorder.Register; + TdxPSCellBoldFlatBorder.Register; + TdxPSCellUltraFlatBorder.Register; + TdxPSCustomCell3DBorder.Register; + TdxPSCellRaisedBorder.Register; + TdxPSCellRaisedSoftBorder.Register; + TdxPSCellSunkenBorder.Register; + TdxPSCellSunkenSoftBorder.Register; + TdxPSCellTwistedBorder.Register; + TdxPSCellEtchedBorder.Register; + TdxPSCellBumpedBorder.Register; + TdxPSColorBorder.Register; + + TdxPSReportGroupNullLookAndFeel.Register; + TdxPSReportGroupStandardLookAndFeel.Register; + TdxPSReportGroupOfficeLookAndFeel.Register; + TdxPSReportGroupWebLookAndFeel.Register; +end; + +procedure RegisterGraphicClasses; +const + GraphicClassCount = 3 {$IFDEF USEJPEGIMAGE} + 1 {$ENDIF}; + GraphicClasses: array[0..GraphicClassCount - 1] of TGraphicClass = + (TBitmap, TMetafile, TIcon{$IFDEF USEJPEGIMAGE}, TJPEGImage{$ENDIF}); +var + I: Integer; + GraphicClass: TGraphicClass; +begin + for I := Low(GraphicClasses) to High(GraphicClasses) do + begin + GraphicClass := GraphicClasses[I]; + if GetClass(GraphicClass.ClassName) = nil then + RegisterClass(GraphicClass); + end; +end; + +procedure RegisterItems; +begin + TdxReportCell.Register; + TdxReportGroup.Register; + TdxReportRadioGroup.Register; + TdxReportCheckGroup.Register; + + TdxReportCellBox.Register; + TdxReportCellString.Register; + TdxReportCellCheck.Register; + TdxReportCellRadio.Register; + TdxReportCellCheckImage.Register; + TdxReportCellRadioGroupButton.Register; + TdxReportCellGroupButton.Register; + TdxReportCellCheckGroupButton.Register; + TdxReportCellImage.Register; + TdxReportCellGraphic.Register; + TdxReportCellExpandButton.Register; + TdxReportCellExpandButtonEx.Register; +end; + +procedure UnregisterAssistants; +begin + TdxPSDataWriter.Unregister; + TdxPSDataReader.Unregister; + + TdxPSRunTimeComponentsProvider.Unregister; + TdxPSExplorerTreeBuilder.Unregister; +end; + +procedure UnregisterItems; +begin + TdxReportCellExpandButtonEx.Unregister; + TdxReportCellExpandButton.Unregister; + TdxReportCellGraphic.Unregister; + TdxReportCellImage.Unregister; + TdxReportCellCheckGroupButton.Unregister; + TdxReportCellGroupButton.Unregister; + TdxReportCellRadioGroupButton.Unregister; + TdxReportCellCheckImage.Unregister; + TdxReportCellRadio.Unregister; + TdxReportCellCheck.Unregister; + TdxReportCellString.Unregister; + TdxReportCellBox.Unregister; + + TdxReportCheckGroup.Unregister; + TdxReportRadioGroup.Unregister; + TdxReportGroup.Unregister; + TdxReportCell.Unregister; +end; + +initialization + {$IFDEF OLEDRAGANDDROP} + OleInitialize(nil); + {$ENDIF} + + dxPgsDlg.dxPSRegisterPrintStyle(TdxPSPrintStyle, True); + dxPSRegisterReportLink(TdxCompositionReportLink, nil, TdxfmCompositionDesignWindow); + + InitializeUnits; + + RegisterAssistants; + RegisterGraphicClasses; + RegisterItems; + +finalization + UnregisterItems; + UnregisterAssistants; + + dxPSUnregisterAllReportLinks; + dxPgsDlg.dxPSUnregisterPrintStyle(TdxPSPrintStyle); + dxPSUnregisterAllPreviewWindows; + + FreeAndNil(FExplorerImages); + + {$IFDEF OLEDRAGANDDROP} + OleUninitialize; + {$ENDIF} + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSDBBasedXplorer.pas b/official/x.35/ExpressPrinting System/Sources/dxPSDBBasedXplorer.pas new file mode 100644 index 00000000..8a1f260f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSDBBasedXplorer.pas @@ -0,0 +1,1109 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSDBBasedXplorer; + +interface + +{$I cxVer.inc} + +uses + {$IFDEF DELPHI6} + Variants, + {$ENDIF} + SysUtils, Classes, DB, cxClasses, dxPSGlbl, dxPSCore; + +const + fnmBase = 0; + fnmID = fnmBase + 0; + fnmName = fnmBase + 1; + fnmParentID = fnmBase + 2; + fnmData = fnmBase + 3; + +type + TdxDBBasedExplorerItemType = (eitFolder, eitItem); + + PdxDBBasedExplorerItemUniqueID = ^TdxDBBasedExplorerItemUniqueID; + TdxDBBasedExplorerItemUniqueID = record + ID: Integer; + ItemType: TdxDBBasedExplorerItemType; + end; + + TdxPSDBBasedExplorerItem = class; + TdxPSDBBasedExplorer = class; + + TdxPSDBBasedExplorerFolder = class(TdxPSExplorerFolder) + private + FID: Integer; + FParentID: Integer; + function GetFolder(Index: Integer): TdxPSDBBasedExplorerFolder; + function GetItem(Index: Integer): TdxPSDBBasedExplorerItem; + procedure SetParentID(Value: Integer); + protected + procedure InternalMove(AParent: TdxPSExplorerFolder); override; + public + constructor Create(AnExplorer: TCustomdxPSExplorer; AParent: TdxPSExplorerFolder); override; + + function CanMoveTo(AParentID: Integer): Boolean; overload; virtual; + function Explorer: TdxPSDBBasedExplorer; reintroduce; overload; + function GetUniqueID(out AnUniqueID: TBytes): Integer; override; + + property Folders[Index: Integer]: TdxPSDBBasedExplorerFolder read GetFolder; default; + property ID: Integer read FID; + property Items[Index: Integer]: TdxPSDBBasedExplorerItem read GetItem; + property ParentID: Integer read FParentID write SetParentID; + end; + + TdxPSDBBasedExplorerItem = class(TdxPSExplorerItem) + private + FID: Integer; + FParentID: Integer; + procedure SetParentID(Value: Integer); + protected + procedure InternalMove(AParent: TdxPSExplorerFolder); override; + procedure SaveDocument; override; + procedure SaveItem; virtual; + public + constructor Create(AnExplorer: TCustomdxPSExplorer; AParent: TdxPSExplorerFolder); override; + + function CanMoveTo(AParentID: Integer): Boolean; overload; virtual; + function DataLoadErrorText: string; override; + function Explorer: TdxPSDBBasedExplorer; reintroduce; overload; + function GetUniqueID(out AnUniqueID: TBytes): Integer; override; + + property ID: Integer read FID; + property ParentID: Integer read FParentID write SetParentID; + end; + + TCustomdxPSDBBasedExplorerFieldNamesMap = class(TPersistent) + private + FExplorer: TdxPSDBBasedExplorer; + FItems: TStringList; + function GetCount: Integer; + protected + function GetItem(Index: Integer): string; + procedure SetItem(Index: Integer; const Value: string); + + procedure Changed; dynamic; + function GetMapCount: Integer; virtual; + procedure InitializeItems; virtual; + + property Count: Integer read GetCount; + property Items[Index: Integer]: string read GetItem write SetItem; default; + property MapCount: Integer read GetMapCount; + public + constructor Create(AnExplorer: TdxPSDBBasedExplorer); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + property Explorer: TdxPSDBBasedExplorer read FExplorer; + end; + + TdxPSDBBasedExplorerFieldNamesMapClass = class of TCustomdxPSDBBasedExplorerFieldNamesMap; + + TdxPSDBBasedExplorerFieldNamesMap = class(TCustomdxPSDBBasedExplorerFieldNamesMap) + protected + function GetMapCount: Integer; override; + published + property ID: string Index fnmID read GetItem write SetItem; + property Name: string Index fnmName read GetItem write SetItem; + property ParentID: string Index fnmParentID read GetItem write SetItem; + end; + + TdxPSDBBasedExplorerFoldersFieldNamesMapClass = class of TdxPSDBBasedExplorerFoldersFieldNamesMap; + + TdxPSDBBasedExplorerFoldersFieldNamesMap = class(TdxPSDBBasedExplorerFieldNamesMap); + + TdxPSDBBasedExplorerItemsFieldNamesMapClass = class of TdxPSDBBasedExplorerItemsFieldNamesMap; + + TdxPSDBBasedExplorerItemsFieldNamesMap = class(TdxPSDBBasedExplorerFieldNamesMap) + protected + function GetMapCount: Integer; override; + published + property Data: string Index fnmData read GetItem write SetItem; + end; + + TdxPSDBBasedExplorerLoadErrorEvent = procedure(Sender: TdxPSDBBasedExplorer; ADataSet: TDataSet) of object; + + TdxPSDBBasedExplorer = class(TCustomdxPSExplorer) + private + FFolderList: TList; + FFolders: TDataSet; + FFoldersFieldNamesMap: TdxPSDBBasedExplorerFoldersFieldNamesMap; + FItemList: TList; + FItems: TDataSet; + FItemsFieldNamesMap: TdxPSDBBasedExplorerItemsFieldNamesMap; + FOnLoadError: TdxPSDBBasedExplorerLoadErrorEvent; + function GetRoot: TdxPSDBBasedExplorerFolder; + procedure SetFolders(Value: TDataSet); + procedure SetFoldersFieldNamesMap(Value: TdxPSDBBasedExplorerFoldersFieldNamesMap); + procedure SetItems(Value: TDataSet); + procedure SetItemsFieldNamesMap(Value: TdxPSDBBasedExplorerItemsFieldNamesMap); + protected + function CreateItemDataStream(AnItem: TdxPSExplorerItem; AMode: TdxPSStreamMode): TStream; override; + class function GetFolderClass: TdxPSExplorerFolderClass; override; + class function GetItemClass: TdxPSExplorerItemClass; override; + class function GetRootFolderClass: TdxPSExplorerFolderClass; override; + procedure DoLoadData(AFolder: TdxPSExplorerFolder); override; + function CanDelete(AnItem: TCustomdxPSExplorerItem): Boolean; override; + function CanMoveTo(AnItem, AParent: TCustomdxPSExplorerItem): Boolean; override; + function CanRenameTo(AnItem: TCustomdxPSExplorerItem; const AName: string): Boolean; override; + procedure Delete(AnItem: TCustomdxPSExplorerItem); override; + procedure MoveTo(AnItem: TCustomdxPSExplorerItem; AParent: TdxPSExplorerFolder); override; + procedure RenameTo(AnItem: TCustomdxPSExplorerItem; AName: string); override; + + procedure DoRefresh; override; + + class function GetFoldersFieldNamesMapClass: TdxPSDBBasedExplorerFoldersFieldNamesMapClass; virtual; + class function GetItemsFieldNamesMapClass: TdxPSDBBasedExplorerItemsFieldNamesMapClass; virtual; + + function AreIDsEqual(AnID1, AnID2: Integer): Boolean; + procedure Changed; dynamic; + function CheckDataSets: Boolean; virtual; + function CheckItemDataSet(AnItem: TCustomdxPSExplorerItem): Boolean; overload; virtual; + function CheckItemDataSet(AnItemClass: TCustomdxPSExplorerItemClass): Boolean; overload; virtual; + function CreateDataStream(AMode: TBlobStreamMode): TStream; virtual; + function GetItemDataSet(AnItem: TCustomdxPSExplorerItem): TDataSet; overload; virtual; + function GetItemDataSet(AnItemClass: TCustomdxPSExplorerItemClass): TDataSet; overload; virtual; + function GetItemFieldNamesMap(AnItem: TCustomdxPSExplorerItem): TdxPSDBBasedExplorerFieldNamesMap; overload; virtual; + function GetItemFieldNamesMap(AnItemClass: TCustomdxPSExplorerItemClass): TdxPSDBBasedExplorerFieldNamesMap; overload; virtual; + function GetUniqueFolderID: Integer; virtual; + function GetUniqueItemID: Integer; virtual; + function IsFolderIDAutoIncField: Boolean; + function IsItemIDAutoIncField: Boolean; + + procedure LoadFolderFromCurrentRecord(AFolder: TdxPSDBBasedExplorerFolder); virtual; + procedure LoadItemFromCurrentRecord(AnItem: TdxPSDBBasedExplorerItem); virtual; + procedure SaveFolderToCurrentRecord(AFolder: TdxPSDBBasedExplorerFolder); virtual; + procedure SaveItemToCurrentRecord(AnItem: TdxPSDBBasedExplorerItem; AReportLink: TBasedxReportLink); virtual; + + procedure DoLoadError(ADataSet: TDataSet); dynamic; + + function GetFieldValue(ADataSet: TDataSet; const AName: string): Variant; + function IsFieldNameValid(ADataSet: TDataSet; const AName: string): Boolean; + procedure SetFieldValue(ADataSet: TDataSet; const AName: string; const Value: Variant); + + function LocateItem(AnItem: TCustomdxPSExplorerItem): Boolean; + procedure PrepareIterate(ADataSet: TDataSet; out ABookmark: TBookmark); + procedure UnprepareIterate(ADataSet: TDataSet; var ABookmark: TBookmark); + + property FolderList: TList read FFolderList; + property ItemList: TList read FItemList; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + function AreFieldNameMapsValid: Boolean; virtual; + + function CanCreateFolder: Boolean; override; + function CanCreateItem: Boolean; override; + function CreateNewFolder(AParent: TdxPSExplorerFolder): TdxPSExplorerFolder; override; + function CreateNewItem(AParent: TdxPSExplorerFolder; AReportLink: TBasedxReportLink): TdxPSExplorerItem; override; + + function FindCustomItemByUniqueID(const AnUniqueID: TBytes): TCustomdxPSExplorerItem; override; + function FindFolderByID(AnID: Integer): TdxPSDBBasedExplorerFolder; virtual; + function FindItemByID(AnID: Integer): TdxPSDBBasedExplorerItem; virtual; + + function LoadedItem: TdxPSDBBasedExplorerItem; reintroduce; overload; + + property Root: TdxPSDBBasedExplorerFolder read GetRoot; + published + property Folders: TDataSet read FFolders write SetFolders; + property FoldersFieldNamesMap: TdxPSDBBasedExplorerFoldersFieldNamesMap read FFoldersFieldNamesMap write SetFoldersFieldNamesMap; + property Items: TDataSet read FItems write SetItems; + property ItemsFieldNamesMap: TdxPSDBBasedExplorerItemsFieldNamesMap read FItemsFieldNamesMap write SetItemsFieldNamesMap; + property OnLoadError: TdxPSDBBasedExplorerLoadErrorEvent read FOnLoadError write FOnLoadError; + end; + +implementation + +uses + {$IFNDEF DELPHI5} dxPSUtl, {$ENDIF} dxPSRes; + +const + RootIDValue: Integer = 0; + +function VarToInt(const V: Variant): Integer; +begin + try + if {$IFDEF DELPHI6}Variants.{$ENDIF}VarIsNull(V) then + Result := 0 + else + Result := V; + except + Result := 0; + end; +end; + +{ TdxPSDBBasedExplorerFolder } + +constructor TdxPSDBBasedExplorerFolder.Create(AnExplorer: TCustomdxPSExplorer; + AParent: TdxPSExplorerFolder); +begin + inherited; + FID := RootIDValue; + if AParent <> nil then + FParentID := TdxPSDBBasedExplorerFolder(AParent).ID; +end; + +function TdxPSDBBasedExplorerFolder.CanMoveTo(AParentID: Integer): Boolean; +var + Parent: TdxPSDBBasedExplorerFolder; +begin + Parent := Explorer.FindFolderByID(AParentID); + Result := (Parent <> nil) and CanMoveTo(Parent); +end; + +function TdxPSDBBasedExplorerFolder.Explorer: TdxPSDBBasedExplorer; +begin + Result := inherited Explorer as TdxPSDBBasedExplorer; +end; + +function TdxPSDBBasedExplorerFolder.GetUniqueID(out AnUniqueID: TBytes): Integer; +var + UniqueID: TdxDBBasedExplorerItemUniqueID; +begin + UniqueID.ID := ID; + UniqueID.ItemType := eitFolder; + SetLength(AnUniqueID, SizeOf(UniqueID)); + Move(UniqueID, Pointer(AnUniqueID)^, SizeOf(UniqueID)); + Result := Length(AnUniqueID); +end; + +procedure TdxPSDBBasedExplorerFolder.InternalMove(AParent: TdxPSExplorerFolder); +begin + FParentID := RootIDValue; + if AParent <> nil then + FParentID := TdxPSDBBasedExplorerFolder(AParent).ID; + inherited; +end; + +function TdxPSDBBasedExplorerFolder.GetFolder(Index: Integer): TdxPSDBBasedExplorerFolder; +begin + Result := inherited Folders[Index] as TdxPSDBBasedExplorerFolder; +end; + +function TdxPSDBBasedExplorerFolder.GetItem(Index: Integer): TdxPSDBBasedExplorerItem; +begin + Result := inherited Items[Index] as TdxPSDBBasedExplorerItem; +end; + +procedure TdxPSDBBasedExplorerFolder.SetParentID(Value: Integer); +begin + if (ParentID <> Value) and CanMoveTo(Value) then + Parent := Explorer.FindFolderByID(Value); +end; + +{ TdxPSDBBasedExplorerItem } + +constructor TdxPSDBBasedExplorerItem.Create(AnExplorer: TCustomdxPSExplorer; + AParent: TdxPSExplorerFolder); +begin + inherited; + FID := RootIDValue; + FParentID := RootIDValue; + if AParent <> nil then + FParentID := TdxPSDBBasedExplorerFolder(AParent).ID; +end; + +function TdxPSDBBasedExplorerItem.CanMoveTo(AParentID: Integer): Boolean; +var + Parent: TdxPSDBBasedExplorerFolder; +begin + Parent := Explorer.FindFolderByID(AParentID); + Result := (Parent <> nil) and CanMoveTo(Parent); +end; + +function TdxPSDBBasedExplorerItem.DataLoadErrorText: string; +begin + Result := cxGetResourceString(@sdxDBBasedExplorerItemDataLoadError); +end; + +function TdxPSDBBasedExplorerItem.Explorer: TdxPSDBBasedExplorer; +begin + Result := inherited Explorer as TdxPSDBBasedExplorer; +end; + +function TdxPSDBBasedExplorerItem.GetUniqueID(out AnUniqueID: TBytes): Integer; +var + UniqueID: TdxDBBasedExplorerItemUniqueID; +begin + UniqueID.ID := ID; + UniqueID.ItemType := eitItem; + SetLength(AnUniqueID, SizeOf(UniqueID)); + Move(UniqueID, Pointer(AnUniqueID)^, SizeOf(UniqueID)); + Result := Length(AnUniqueID); +end; + +procedure TdxPSDBBasedExplorerItem.InternalMove(AParent: TdxPSExplorerFolder); +begin + FParentID := RootIDValue; + if AParent <> nil then + FParentID := TdxPSDBBasedExplorerFolder(AParent).ID; + inherited; +end; + +procedure TdxPSDBBasedExplorerItem.SaveDocument; +begin + if Explorer <> nil then SaveItem; + inherited; +end; + +procedure TdxPSDBBasedExplorerItem.SaveItem; +begin + with Explorer do + if CheckItemDataSet(Self) and LocateItem(Self) then + begin + SetFieldValue(Items, FoldersFieldNamesMap.Name, Name); + end; +end; + +procedure TdxPSDBBasedExplorerItem.SetParentID(Value: Integer); +begin + if (ParentID <> Value) and CanMoveTo(Value) then + Parent := Explorer.FindFolderByID(Value); +end; + +{ TCustomdxPSDBBasedExplorerFieldNamesMap } + +constructor TCustomdxPSDBBasedExplorerFieldNamesMap.Create(AnExplorer: TdxPSDBBasedExplorer); +begin + inherited Create; + FExplorer := AnExplorer; + FItems := TStringList.Create; + InitializeItems; +end; + +destructor TCustomdxPSDBBasedExplorerFieldNamesMap.Destroy; +begin + FreeAndNil(FItems); + inherited; +end; + +procedure TCustomdxPSDBBasedExplorerFieldNamesMap.Assign(Source: TPersistent); +begin + if Source is TCustomdxPSDBBasedExplorerFieldNamesMap then + FItems.Assign(TCustomdxPSDBBasedExplorerFieldNamesMap(Source).FItems) + else + inherited; +end; + +function TCustomdxPSDBBasedExplorerFieldNamesMap.GetItem(Index: Integer): string; +begin + Result := FItems[Index]; +end; + +procedure TCustomdxPSDBBasedExplorerFieldNamesMap.SetItem(Index: Integer; const Value: string); +begin + if FItems[Index] <> Value then + begin + FItems[Index] := Value; + Changed; + end; +end; + +procedure TCustomdxPSDBBasedExplorerFieldNamesMap.Changed; +begin + if Explorer <> nil then Explorer.Changed; +end; + +function TCustomdxPSDBBasedExplorerFieldNamesMap.GetMapCount: Integer; +begin + Result := 0; +end; + +procedure TCustomdxPSDBBasedExplorerFieldNamesMap.InitializeItems; +var + I: Integer; +begin + for I := 0 to MapCount - 1 do + FItems.Add(''); +end; + +function TCustomdxPSDBBasedExplorerFieldNamesMap.GetCount: Integer; +begin + Result := FItems.Count; +end; + +{ TdxPSDBBasedExplorerFieldNamesMap } + +function TdxPSDBBasedExplorerFieldNamesMap.GetMapCount: Integer; +begin + Result := inherited GetMapCount + 3; {6 -> if include Creator, DateTimeCreated} +end; + +{ TdxPSDBBasedExplorerItemsFieldNamesMap } + +function TdxPSDBBasedExplorerItemsFieldNamesMap.GetMapCount: Integer; +begin + Result := inherited GetMapCount + 1; +end; + +{ TdxPSDBBasedExplorer } + +constructor TdxPSDBBasedExplorer.Create(AOwner: TComponent); +begin + inherited; + FFoldersFieldNamesMap := GetFoldersFieldNamesMapClass.Create(Self); + FItemsFieldNamesMap := GetItemsFieldNamesMapClass.Create(Self); +end; + +destructor TdxPSDBBasedExplorer.Destroy; +begin + FreeAndNil(FItemsFieldNamesMap); + FreeAndNil(FFoldersFieldNamesMap); + FreeAndNil(FItemList); + FreeAndNil(FFolderList); + inherited; +end; + +function TdxPSDBBasedExplorer.AreFieldNameMapsValid: Boolean; +begin + Result := IsFieldNameValid(Items, ItemsFieldNamesMap.ID) and + IsFieldNameValid(Items, ItemsFieldNamesMap.Name) and + IsFieldNameValid(Items, ItemsFieldNamesMap.ParentID) and + IsFieldNameValid(Items, ItemsFieldNamesMap.Data) and + IsFieldNameValid(Folders, FoldersFieldNamesMap.ID) and + IsFieldNameValid(Folders, FoldersFieldNamesMap.Name) and + IsFieldNameValid(Folders, FoldersFieldNamesMap.ParentID); +end; + +function TdxPSDBBasedExplorer.CanCreateFolder: Boolean; +begin + Result := CheckDataSets; +end; + +function TdxPSDBBasedExplorer.CanCreateItem: Boolean; +begin + Result := CheckDataSets; +end; + +function TdxPSDBBasedExplorer.CreateNewFolder(AParent: TdxPSExplorerFolder): TdxPSExplorerFolder; +begin + if CanCreateFolder then + begin + BeginLoading; + try + Folders.Append; + Result := inherited CreateNewFolder(AParent); + if not IsFolderIDAutoIncField then + TdxPSDBBasedExplorerFolder(Result).FID := GetUniqueFolderID; + SaveFolderToCurrentRecord(Result as TdxPSDBBasedExplorerFolder); + Folders.Post; + if IsFolderIDAutoIncField then + TdxPSDBBasedExplorerFolder(Result).FID := GetFieldValue(Folders, FoldersFieldNamesMap.ID); + + + if FolderList <> nil then FolderList.Add(Result); + finally + EndLoading; + end; + end + else + Result := nil; +end; + +function TdxPSDBBasedExplorer.CreateNewItem(AParent: TdxPSExplorerFolder; + AReportLink: TBasedxReportLink): TdxPSExplorerItem; +begin + if CanCreateItem then + begin + BeginLoading; + try + Items.Append; + Result := inherited CreateNewItem(AParent, AReportLink); + if not IsItemIDAutoIncField then + TdxPSDBBasedExplorerItem(Result).FID := GetUniqueItemID; + SaveItemToCurrentRecord(Result as TdxPSDBBasedExplorerItem, AReportLink); + Items.Post; + if IsItemIDAutoIncField then + TdxPSDBBasedExplorerItem(Result).FID := GetFieldValue(Items, ItemsFieldNamesMap.ID); + + if ItemList <> nil then ItemList.Add(Result); + finally + EndLoading; + end; + end + else + Result := nil; +end; + +function TdxPSDBBasedExplorer.FindCustomItemByUniqueID(const AnUniqueID: TBytes): TCustomdxPSExplorerItem; +var + UniqueID: TdxDBBasedExplorerItemUniqueID; +begin + Move(Pointer(AnUniqueID)^, UniqueID, SizeOf(UniqueID)); + with UniqueID do + if ItemType = eitFolder then + Result := FindFolderByID(ID) + else + Result := FindItemByID(ID); +end; + +function TdxPSDBBasedExplorer.FindFolderByID(AnID: Integer): TdxPSDBBasedExplorerFolder; +var + I: Integer; +begin + RootNeeded; + if Root.ID <> AnID then + begin + if FolderList <> nil then + for I := 0 to FolderList.Count - 1 do + begin + Result := TdxPSDBBasedExplorerFolder(FolderList[I]); + if AreIDsEqual(Result.ID, AnID) then Exit; + end; + Result := nil; + end + else + Result := Root; +end; + +function TdxPSDBBasedExplorer.FindItemByID(AnID: Integer): TdxPSDBBasedExplorerItem; +var + I: Integer; +begin + RootNeeded; + if ItemList <> nil then + for I := 0 to ItemList.Count - 1 do + begin + Result := TdxPSDBBasedExplorerItem(ItemList[I]); + if AreIDsEqual(Result.ID, AnID) then Exit; + end; + Result := nil; +end; + +function TdxPSDBBasedExplorer.LoadedItem: TdxPSDBBasedExplorerItem; +begin + Result := inherited LoadedItem as TdxPSDBBasedExplorerItem; +end; + +function TdxPSDBBasedExplorer.CreateItemDataStream(AnItem: TdxPSExplorerItem; + AMode: TdxPSStreamMode): TStream; +const + BlobStreamModesMap: array[TdxPSStreamMode] of TBlobStreamMode = (bmRead, bmWrite, bmReadWrite); +begin + if IsFieldNameValid(Items, ItemsFieldNamesMap.Data) and LocateItem(AnItem) then + Result := CreateDataStream(BlobStreamModesMap[AMode]) + else + Result := nil; +end; + +class function TdxPSDBBasedExplorer.GetFolderClass: TdxPSExplorerFolderClass; +begin + Result := TdxPSDBBasedExplorerFolder; +end; + +class function TdxPSDBBasedExplorer.GetItemClass: TdxPSExplorerItemClass; +begin + Result := TdxPSDBBasedExplorerItem; +end; + +class function TdxPSDBBasedExplorer.GetRootFolderClass: TdxPSExplorerFolderClass; +begin + Result := TdxPSDBBasedExplorerFolder; +end; + +procedure TdxPSDBBasedExplorer.DoLoadData(AFolder: TdxPSExplorerFolder); + + procedure LoadFolders; + var + Bookmark: TBookmark; + Folder: TdxPSExplorerFolder; + begin + PrepareIterate(Folders, Bookmark); + try + Folders.First; + while not Folders.EOF do + begin + try + Folder := GetFolderClass.Create(Self, nil) as TdxPSDBBasedExplorerFolder; + LoadFolderFromCurrentRecord(Folder as TdxPSDBBasedExplorerFolder); + FolderList.Add(Folder); + except + DoLoadError(Folders); + end; + Folders.Next; + end; + finally + UnprepareIterate(Folders, Bookmark); + end; + end; + + function DoFilterLinkClass: Boolean; + var + Stream: TStream; + begin + Result := True; + if FilterLinkClass <> nil then + begin + Stream := CreateDataStream(bmRead); + try + Result := FilterLinkClass = TBasedxReportLink.ExtractComponentClass(Stream, False); + finally + Stream.Free; + end; + end; + end; + + procedure LoadItems; + + procedure LoadItemReportDocument(AnItem: TdxPSDBBasedExplorerItem); + var + Stream: TStream; + ReportDocument: TdxPSReportDocument; + begin + Stream := CreateDataStream(bmRead); + try + ReportDocument := TBasedxReportLink.ExtractReportDocument(Stream, True); + try + AnItem.ReportDocument.Assign(ReportDocument); + finally + ReportDocument.Free; + end; + finally + Stream.Free; + end; + end; + + var + Bookmark: TBookmark; + Item: TdxPSDBBasedExplorerItem; + begin + PrepareIterate(Items, Bookmark); + try + Items.First; + while not Items.EOF do + begin + try + if DoFilterLinkClass then + begin + Item := GetItemClass.Create(Self, nil) as TdxPSDBBasedExplorerItem; + LoadItemFromCurrentRecord(Item); + LoadItemReportDocument(Item); + ItemList.Add(Item) + end; + except + DoLoadError(Items); + end; + Items.Next; + end; + finally + UnprepareIterate(Items, Bookmark); + end; + end; + + procedure BuildTree; + + procedure BuildFolders; + var + I: Integer; + Folder, Parent: TdxPSDBBasedExplorerFolder; + begin + for I := 0 to FolderList.Count - 1 do + begin + Folder := TdxPSDBBasedExplorerFolder(FolderList[I]); + if not AreIDsEqual(Folder.ParentID, TdxPSDBBasedExplorerFolder(Root).ID) then + begin + Parent := FindFolderByID(Folder.ParentID); + if Parent <> nil then + if not Parent.HasAsParent(Folder) then + Folder.Parent := Parent + else + raise EdxPSExplorer.CreateFmt(cxGetResourceString(@sdxCyclicIDReferences), [Folder.Name, Parent.Name]); + end + else + Folder.Parent := Root; + end; + end; + + procedure BuildItems; + var + I: Integer; + Parent: TdxPSDBBasedExplorerFolder; + Item: TdxPSDBBasedExplorerItem; + begin + for I := 0 to ItemList.Count - 1 do + begin + Item := TdxPSDBBasedExplorerItem(ItemList[I]); + if not AreIDsEqual(Item.ParentID, TdxPSDBBasedExplorerFolder(Root).ID) then + begin + Parent := FindFolderByID(Item.ParentID); + if Parent <> nil then + if not Parent.HasAsParent(Item) then + Item.Parent := Parent + else + raise EdxPSExplorer.CreateFmt(cxGetResourceString(@sdxCyclicIDReferences), [Item.Name, Parent.Name]); + end + else + Item.Parent := Root; + end; + end; + + begin + BuildFolders; + BuildItems; + end; + +begin + if CheckDataSets and AreFieldNameMapsValid then + begin + FFolderList := TList.Create; + FItemList := TList.Create; + + LoadFolders; + LoadItems; + BuildTree; + end; +end; + +function TdxPSDBBasedExplorer.CanDelete(AnItem: TCustomdxPSExplorerItem): Boolean; +begin + Result := inherited CanDelete(AnItem) and CheckItemDataSet(AnItem); +end; + +function TdxPSDBBasedExplorer.CanMoveTo(AnItem, AParent: TCustomdxPSExplorerItem): Boolean; +begin + Result := inherited CanMoveTo(AnItem, AParent) and ((esLoading in State) or CheckItemDataSet(AnItem)); +end; + +function TdxPSDBBasedExplorer.CanRenameTo(AnItem: TCustomdxPSExplorerItem; + const AName: string): Boolean; +begin + Result := inherited CanRenameTo(AnItem, AName) and ((esLoading in State) or CheckItemDataSet(AnItem)); +end; + +procedure TdxPSDBBasedExplorer.Delete(AnItem: TCustomdxPSExplorerItem); +begin + if not (esLoading in State) and CanDelete(AnItem) and LocateItem(AnItem) then + if AnItem is TdxPSExplorerFolder then + begin + FolderList.Remove(AnItem); + Folders.Delete; + end + else + begin + ItemList.Remove(AnItem); + Items.Delete; + end; + + inherited; +end; + +procedure TdxPSDBBasedExplorer.MoveTo(AnItem: TCustomdxPSExplorerItem; + AParent: TdxPSExplorerFolder); +var + ParentID: Integer; +begin + if not (esLoading in State) and CanMoveTo(AnItem, AParent) and LocateItem(AnItem) then + with GetItemDataSet(AnItem) do + begin + Edit; + ParentID := RootIDValue; + if AParent <> nil then + ParentID := TdxPSDBBasedExplorerFolder(AParent).ID; + FieldValues[GetItemFieldNamesMap(AnItem).ParentID] := ParentID; + Post; + end; + inherited; +end; + +procedure TdxPSDBBasedExplorer.RenameTo(AnItem: TCustomdxPSExplorerItem; AName: string); +begin + if not (esLoading in State) and LocateItem(AnItem) then + with GetItemDataSet(AnItem) do + begin + Edit; + FieldValues[GetItemFieldNamesMap(AnItem).Name] := AName; + Post; + end; + inherited; +end; + +procedure TdxPSDBBasedExplorer.DoRefresh; +begin + inherited; + FreeAndNil(FFolderList); + FreeAndNil(FItemList); +end; + +class function TdxPSDBBasedExplorer.GetFoldersFieldNamesMapClass: TdxPSDBBasedExplorerFoldersFieldNamesMapClass; +begin + Result := TdxPSDBBasedExplorerFoldersFieldNamesMap; +end; + +class function TdxPSDBBasedExplorer.GetItemsFieldNamesMapClass: TdxPSDBBasedExplorerItemsFieldNamesMapClass; +begin + Result := TdxPSDBBasedExplorerItemsFieldNamesMap; +end; + +function TdxPSDBBasedExplorer.AreIDsEqual(AnID1, AnID2: Integer): Boolean; +begin + Result := AnID1 = AnID2; +end; + +procedure TdxPSDBBasedExplorer.Changed; +begin +end; + +function TdxPSDBBasedExplorer.CheckDataSets: Boolean; +begin + Result := CheckItemDataSet(TdxPSDBBasedExplorerFolder) and CheckItemDataSet(TdxPSDBBasedExplorerItem); +end; + +function TdxPSDBBasedExplorer.CheckItemDataSet(AnItem: TCustomdxPSExplorerItem): Boolean; +begin + Result := CheckItemDataSet(TdxPSExplorerItemClass(AnItem.ClassType)); +end; + +function TdxPSDBBasedExplorer.CheckItemDataSet(AnItemClass: TCustomdxPSExplorerItemClass): Boolean; +var + DataSet: TDataSet; +begin + DataSet := GetItemDataSet(AnItemClass); + Result := (DataSet <> nil) and DataSet.Active; +end; + +function TdxPSDBBasedExplorer.CreateDataStream(AMode: TBlobStreamMode): TStream; +begin + Result := Items.CreateBlobStream(Items.FindField(ItemsFieldNamesMap.Data), AMode); +end; + +function TdxPSDBBasedExplorer.GetItemDataSet(AnItem: TCustomdxPSExplorerItem): TDataSet; +begin + Result := GetItemDataSet(TCustomdxPSExplorerItemClass(AnItem.ClassType)); +end; + +function TdxPSDBBasedExplorer.GetItemDataSet(AnItemClass: TCustomdxPSExplorerItemClass): TDataSet; +begin + if AnItemClass.InheritsFrom(TdxPSDBBasedExplorerFolder) then + Result := Folders + else + if AnItemClass.InheritsFrom(TdxPSDBBasedExplorerItem) then + Result := Items + else + Result := nil; +end; + +function TdxPSDBBasedExplorer.GetItemFieldNamesMap(AnItem: TCustomdxPSExplorerItem): TdxPSDBBasedExplorerFieldNamesMap; +begin + Result := GetItemFieldNamesMap(TdxPSExplorerItemClass(AnItem.ClassType)); +end; + +function TdxPSDBBasedExplorer.GetItemFieldNamesMap(AnItemClass: TCustomdxPSExplorerItemClass): TdxPSDBBasedExplorerFieldNamesMap; +begin + if AnItemClass.InheritsFrom(TdxPSDBBasedExplorerFolder) then + Result := FoldersFieldNamesMap + else + if AnItemClass.InheritsFrom(TdxPSDBBasedExplorerItem) then + Result := ItemsFieldNamesMap + else + Result := nil; +end; + +function TdxPSDBBasedExplorer.GetUniqueFolderID: Integer; +var + I, ID: Integer; +begin + if FolderList <> nil then + begin + Result := -1; + for I := 0 to FolderList.Count - 1 do + begin + ID := TdxPSDBBasedExplorerFolder(FolderList.List[I]).ID; + if ID > Result then Result := ID; + end; + Inc(Result); + end + else + Result := 0; +end; + +function TdxPSDBBasedExplorer.GetUniqueItemID: Integer; +var + I, ID: Integer; +begin + if ItemList <> nil then + begin + Result := -1; + for I := 0 to ItemList.Count - 1 do + begin + ID := TdxPSDBBasedExplorerItem(ItemList.List[I]).ID; + if ID > Result then Result := ID; + end; + Inc(Result); + end + else + Result := 0; +end; + +procedure TdxPSDBBasedExplorer.LoadFolderFromCurrentRecord(AFolder: TdxPSDBBasedExplorerFolder); +begin + AFolder.FID := GetFieldValue(Folders, FoldersFieldNamesMap.ID); + AFolder.FParentID := VarToInt(GetFieldValue(Folders, FoldersFieldNamesMap.ParentID)); + AFolder.Name := VarToStr(GetFieldValue(Folders, FoldersFieldNamesMap.Name)); +end; + +procedure TdxPSDBBasedExplorer.LoadItemFromCurrentRecord(AnItem: TdxPSDBBasedExplorerItem); +begin + AnItem.FID := GetFieldValue(Items, ItemsFieldNamesMap.ID); + AnItem.FParentID := VarToInt(GetFieldValue(Items, ItemsFieldNamesMap.ParentID)); + AnItem.Name := VarToStr(GetFieldValue(Items, ItemsFieldNamesMap.Name)); +end; + +procedure TdxPSDBBasedExplorer.SaveFolderToCurrentRecord(AFolder: TdxPSDBBasedExplorerFolder); +begin + if not IsFolderIDAutoIncField then + SetFieldValue(Folders, FoldersFieldNamesMap.ID, AFolder.ID); + SetFieldValue(Folders, FoldersFieldNamesMap.Name, AFolder.Name); + SetFieldValue(Folders, FoldersFieldNamesMap.ParentID, AFolder.ParentID); +end; + +procedure TdxPSDBBasedExplorer.SaveItemToCurrentRecord(AnItem: TdxPSDBBasedExplorerItem; + AReportLink: TBasedxReportLink); +begin + if not IsItemIDAutoIncField then + SetFieldValue(Items, ItemsFieldNamesMap.ID, AnItem.ID); + SetFieldValue(Items, ItemsFieldNamesMap.Name, AnItem.Name); + SetFieldValue(Items, ItemsFieldNamesMap.ParentID, AnItem.ParentID); + AnItem.RetrieveReportData(AReportLink); +end; + +procedure TdxPSDBBasedExplorer.DoLoadError(ADataSet: TDataSet); +begin + if Assigned(FOnLoadError) then FOnLoadError(Self, ADataSet); +end; + +function TdxPSDBBasedExplorer.GetFieldValue(ADataSet: TDataSet; const AName: string): Variant; +begin + if IsFieldNameValid(ADataSet, AName) then + Result := ADataSet[AName] + else + Result := Null; +end; + +function TdxPSDBBasedExplorer.IsFieldNameValid(ADataSet: TDataSet; const AName: string): Boolean; +begin + Result := (AName <> '') and (ADataSet <> nil) and (ADataSet.FindField(AName) <> nil); +end; + +procedure TdxPSDBBasedExplorer.SetFieldValue(ADataSet: TDataSet; const AName: string; + const Value: Variant); +begin + if IsFieldNameValid(ADataSet, AName) then + ADataSet[AName] := Value; +end; + +function TdxPSDBBasedExplorer.LocateItem(AnItem: TCustomdxPSExplorerItem): Boolean; +begin + Result := True; + if esLoading in State then Exit; + + if AnItem is TdxPSDBBasedExplorerItem then + Result := IsFieldNameValid(Items, ItemsFieldNamesMap.ID) and + Items.Locate(ItemsFieldNamesMap.ID, TdxPSDBBasedExplorerItem(AnItem).ID, []) + else + if AnItem is TdxPSDBBasedExplorerFolder then + Result := IsFieldNameValid(Folders, FoldersFieldNamesMap.ID) and + Folders.Locate(FoldersFieldNamesMap.ID, TdxPSDBBasedExplorerFolder(AnItem).ID, []); +end; + +procedure TdxPSDBBasedExplorer.PrepareIterate(ADataSet: TDataSet; out ABookmark: TBookmark); +begin + ADataSet.DisableControls; + ABookmark := nil; + if ADataSet.Active and (ADataSet.RecordCount > 0) then + ABookmark := ADataSet.GetBookmark; +end; + +procedure TdxPSDBBasedExplorer.UnprepareIterate(ADataSet: TDataSet; var ABookmark: TBookmark); +begin + if ABookmark <> nil then + begin + if ADataSet.Active and ADataSet.BookmarkValid(ABookmark) then + ADataSet.GotoBookmark(ABookmark); + ADataSet.FreeBookmark(ABookmark); + ABookmark := nil; + end; + ADataSet.EnableControls; +end; + +function TdxPSDBBasedExplorer.IsFolderIDAutoIncField: Boolean; +begin + Result := Folders.FieldByName(FoldersFieldNamesMap.ID) is TAutoIncField; +end; + +function TdxPSDBBasedExplorer.IsItemIDAutoIncField: Boolean; +begin + Result := Items.FieldByName(ItemsFieldNamesMap.ID) is TAutoIncField; +end; + +function TdxPSDBBasedExplorer.GetRoot: TdxPSDBBasedExplorerFolder; +begin + Result := inherited Root as TdxPSDBBasedExplorerFolder; +end; + +procedure TdxPSDBBasedExplorer.SetFolders(Value: TDataSet); +begin + if FFolders <> Value then + begin + FFolders := Value; + //FDataLink.DataSource := FFolders.DataSource; + //if Value <> nil then Value.FreeNotification(Self); + + Changed; + end; +end; + +procedure TdxPSDBBasedExplorer.SetFoldersFieldNamesMap(Value: TdxPSDBBasedExplorerFoldersFieldNamesMap); +begin + FoldersFieldNamesMap.Assign(Value); +end; + +procedure TdxPSDBBasedExplorer.SetItems(Value: TDataSet); +begin + if FItems <> Value then + begin + FItems := Value; + Changed; + end; +end; + +procedure TdxPSDBBasedExplorer.SetItemsFieldNamesMap(Value: TdxPSDBBasedExplorerItemsFieldNamesMap); +begin + ItemsFieldNamesMap.Assign(Value); +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSDBBasedXplorerReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSDBBasedXplorerReg.pas new file mode 100644 index 00000000..4400e95f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSDBBasedXplorerReg.pas @@ -0,0 +1,209 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSDBBasedXplorerReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + {$IFDEF DELPHI6} + DesignIntf, {$IFDEF CBUILDER10}DesignEditors,{$ENDIF} + {$ELSE} + DsgnIntf, + {$ENDIF} + {$IFDEF DELPHI5} + {$IFNDEF CBUILDER10}DBReg,{$ENDIF} + {$ENDIF} + Classes, DB, dxPSGlbl, dxPSDBBasedXplorer; + +type +{$IFDEF CBUILDER10} + TDBStringProperty = class(TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValueList(List: TStrings); virtual; + procedure GetValues(Proc: TGetStrProc); override; + end; +{$ENDIF} + + TdxDBFieldNameProperty = class(TDBStringProperty) + protected + function AcceptField(AField: TField): Boolean; virtual; + function GetDataSet: TDataSet; virtual; + procedure GetValueList(List: TStrings); override; + public + property DataSet: TDataSet read GetDataSet; + end; + + TdxDBFolderFieldNameProperty = class(TdxDBFieldNameProperty) + protected + function GetDataSet: TDataSet; override; + end; + + TdxDBFolderIDFieldNameProperty = class(TdxDBFolderFieldNameProperty) + protected + function AcceptField(AField: TField): Boolean; override; + end; + + TdxDBItemFieldNameProperty = class(TdxDBFieldNameProperty) + protected + function GetDataSet: TDataSet; override; + end; + + TdxDBItemDataFieldNameProperty = class(TdxDBItemFieldNameProperty) + protected + function AcceptField(AField: TField): Boolean; override; + end; + + TdxDBItemIDFieldNameProperty = class(TdxDBItemFieldNameProperty) + protected + function AcceptField(AField: TField): Boolean; override; + end; + +{$IFDEF CBUILDER10} + +function TDBStringProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList, paSortList, paMultiSelect]; +end; + +procedure TDBStringProperty.GetValueList(List: TStrings); +begin +end; + +procedure TDBStringProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; + Values: TStringList; +begin + Values := TStringList.Create; + try + GetValueList(Values); + for I := 0 to Values.Count - 1 do Proc(Values[I]); + finally + Values.Free; + end; +end; + +{$ENDIF} + +{ TdxDBFieldNameProperty } + +function TdxDBFieldNameProperty.AcceptField(AField: TField): Boolean; +begin + Result := True; +end; + +function TdxDBFieldNameProperty.GetDataSet: TDataSet; +begin + Result := nil; +end; + +procedure TdxDBFieldNameProperty.GetValueList(List: TStrings); +var + I: Integer; + Field: TField; +begin + if DataSet <> nil then + begin + DataSet.GetFieldNames(List); + + for I := List.Count - 1 downto 0 do + begin + Field := TField(List.Objects[I]); + if not AcceptField(Field) then List.Delete(I); + end; + end; +end; + +{ TdxDBFolderFieldNameProperty } + +function TdxDBFolderFieldNameProperty.GetDataSet: TDataSet; +begin + Result := TdxPSDBBasedExplorerFoldersFieldNamesMap(GetComponent(0)).Explorer.Folders; +end; + +{ TdxDBFolderDBFieldNameProperty } + +function TdxDBFolderIDFieldNameProperty.AcceptField(AField: TField): Boolean; +begin + Result := (AField is TIntegerField) or (AField is TSmallintField) or + (AField is TLargeintField ) or (AField is TWordField) or (AField is TAutoIncField); +end; + +{ TdxDBItemFieldNameProperty } + +function TdxDBItemFieldNameProperty.GetDataSet: TDataSet; +begin + Result := TdxPSDBBasedExplorerItemsFieldNamesMap(GetComponent(0)).Explorer.Items; +end; + +{ TdxDBItemDataFieldNameProperty } + +function TdxDBItemDataFieldNameProperty.AcceptField(AField: TField): Boolean; +begin + Result := AField is TBlobField; +end; + +{ TdxDBItemIDFieldNameProperty } + +function TdxDBItemIDFieldNameProperty.AcceptField(AField: TField): Boolean; +begin + Result := (AField is TIntegerField) or (AField is TSmallintField) or + (AField is TLargeintField ) or (AField is TWordField) or (AField is TAutoIncField); +end; + +procedure Register; +begin + RegisterComponents(sdxPSComponentPage, [TdxPSDBBasedExplorer]); + + RegisterPropertyEditor(TypeInfo(string), TdxPSDBBasedExplorerFoldersFieldNamesMap, 'ID', TdxDBFolderIDFieldNameProperty); + RegisterPropertyEditor(TypeInfo(string), TdxPSDBBasedExplorerFoldersFieldNamesMap, 'Name', TdxDBFolderFieldNameProperty); + RegisterPropertyEditor(TypeInfo(string), TdxPSDBBasedExplorerFoldersFieldNamesMap, 'ParentID', TdxDBFolderIDFieldNameProperty); + + RegisterPropertyEditor(TypeInfo(string), TdxPSDBBasedExplorerItemsFieldNamesMap, 'ID', TdxDBItemIDFieldNameProperty); + RegisterPropertyEditor(TypeInfo(string), TdxPSDBBasedExplorerItemsFieldNamesMap, 'Name', TdxDBItemFieldNameProperty); + RegisterPropertyEditor(TypeInfo(string), TdxPSDBBasedExplorerItemsFieldNamesMap, 'ParentID', TdxDBItemIDFieldNameProperty); + RegisterPropertyEditor(TypeInfo(string), TdxPSDBBasedExplorerItemsFieldNamesMap, 'Data', TdxDBItemDataFieldNameProperty); +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSDBCtrlLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSDBCtrlLnkReg.pas new file mode 100644 index 00000000..1dd82507 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSDBCtrlLnkReg.pas @@ -0,0 +1,55 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSDBCtrlLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + Classes, dxPSDBCtrlLnks; + +procedure Register; +begin + RegisterNoIcon([TdxDBImageReportLink, TdxDBListBoxReportLink, + TdxDBRichEditReportLink, TdxDBMemoReportLink]); +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSDBCtrlLnks.pas b/official/x.35/ExpressPrinting System/Sources/dxPSDBCtrlLnks.pas new file mode 100644 index 00000000..126c8109 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSDBCtrlLnks.pas @@ -0,0 +1,206 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSDBCtrlLnks; + +interface + +{$I cxVer.inc} + +uses + Graphics, DBCtrls, dxPSCore, dxPSGraphicLnk, dxPSLbxLnk, dxPSTextLnk, + dxPSRELnk; + +type + TdxDBImageReportLink = class(TCustomdxPictureReportLink) + private + function GetDBImage: TDBImage; + protected + procedure InternalRestoreDefaults; override; + procedure InternalRestoreFromOriginal; override; + + function GetGraphicHeight: Integer; override; + function GetGraphicWidth: Integer; override; + function GetPicture: TPicture; override; + public + function DataProviderPresent: Boolean; override; + property DBImage: TDBImage read GetDBImage; + published + property BorderColor; + property DrawBorder; + property Transparent; + property TransparentColor; + end; + + TdxDBListBoxReportLink = class(TCustomdxListBoxReportLinkControl) + private + function GetDBListBox: TDBListBox; + public + property DBListBox: TDBListBox read GetDBListBox; + published + property Color; + property EndEllipsis; + property EvenColor; + property EvenFont; + property Font; + property OddColor; + property OddFont; + property Options; + property Multiline; + property PaintItemsGraphics; + property RowAutoHeight; + property ScaleFonts; + property SupportedCustomDraw; + property Transparent; + property TransparentGraphics; + property UseHorzDelimiters; + property UseVertDelimiters; + property Width; + + property OnCustomDrawItem; + property OnInitializeItem; + end; + + TdxDBRichEditReportLink = class(TCustomdxRichEditReportLink) + private + function GetDBRichEdit: TDBRichEdit; + public + property DBRichEdit: TDBRichEdit read GetDBRichEdit; + end; + + TdxDBMemoReportLink = class(TdxCustomMemoReportLink) + private + function GetMemo: TDBMemo; + public + property Memo: TDBMemo read GetMemo; + end; + +implementation + +{ TdxDBImageReportLink } + +function TdxDBImageReportLink.DataProviderPresent: Boolean; +begin + if DataSource = rldsComponent then + Result := DBImage <> nil + else + Result := inherited DataProviderPresent; +end; + +procedure TdxDBImageReportLink.InternalRestoreDefaults; +begin + inherited; + Center := True; + Stretch := False; +end; + +procedure TdxDBImageReportLink.InternalRestoreFromOriginal; +begin + inherited; + Center := DBImage.Center; + Stretch := DBImage.Stretch; +end; + +function TdxDBImageReportLink.GetGraphicHeight: Integer; +begin + if DBImage <> nil then + begin + Result := DBImage.Height; + if IsAggregated and (Result < inherited GetGraphicHeight) then + Result := inherited GetGraphicHeight; + end + else + Result := inherited GetGraphicHeight; +end; + +function TdxDBImageReportLink.GetGraphicWidth: Integer; +begin + if DBImage <> nil then + begin + Result := DBImage.Width; + if IsAggregated and (Result < inherited GetGraphicWidth) then + Result := inherited GetGraphicWidth; + end + else + Result := inherited GetGraphicWidth; +end; + +function TdxDBImageReportLink.GetPicture: TPicture; +begin + if DBImage <> nil then + Result := DBImage.Picture + else + Result := inherited GetPicture; +end; + +function TdxDBImageReportLink.GetDBImage: TDBImage; +begin + Result := inherited Component as TDBImage; +end; + +{ TdxDBListBoxReportLink } + +function TdxDBListBoxReportLink.GetDBListBox: TDBListBox; +begin + Result := inherited Component as TDBListBox; +end; + +{ TdxDBRichEditReportLink } + +function TdxDBRichEditReportLink.GetDBRichEdit: TDBRichEdit; +begin + Result := inherited Component as TDBRichEdit; +end; + +{ TdxDBMemoReportLink } + +function TdxDBMemoReportLink.GetMemo: TDBMemo; +begin + Result := inherited Component as TDBMemo; +end; + +initialization + dxPSRegisterReportLink(TdxDBImageReportLink, TDBImage, nil); + dxPSRegisterReportLink(TdxDBListBoxReportLink, TDBListBox, TdxLBxReportLinkDesignWindow); + dxPSRegisterReportLink(TdxDBRichEditReportLink, TDBRichEdit, nil); + dxPSRegisterReportLink(TdxDBMemoReportLink, TDBMemo, TdxfmTextReportLinkDesignWindow); + +finalization + dxPSUnregisterReportLink(TdxDBMemoReportLink, TDBMemo, TdxfmTextReportLinkDesignWindow); + dxPSUnregisterReportLink(TdxDBRichEditReportLink, TDBRichEdit, nil); + dxPSUnregisterReportLink(TdxDBListBoxReportLink, TDBListBox, TdxLBxReportLinkDesignWindow); + dxPSUnregisterReportLink(TdxDBImageReportLink, TDBImage, nil); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSDBCtrlProducers.pas b/official/x.35/ExpressPrinting System/Sources/dxPSDBCtrlProducers.pas new file mode 100644 index 00000000..5bdfc637 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSDBCtrlProducers.pas @@ -0,0 +1,129 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSDBCtrlProducers; + +interface + +{$I cxVer.inc} + +uses + Controls, Graphics, DB, DBCtrls, dxPSCore, dxPSContainerLnk; + +type + TdxPSDBEditProducer = class(TdxPSCustomEditProducer) + private + function Field: TField; + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + public + function Control: TDBEdit; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPSDBLookupComboBoxProducer = class(TdxPSContainerWinControlProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + public + function Control: TDBLookupComboBox; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + +implementation + +uses + dxPSDBCtrlLnks; + +{ TdxPSDBEditProducer } + +function TdxPSDBEditProducer.Control: TDBEdit; +begin + Result := inherited Control as TDBEdit; +end; + +class function TdxPSDBEditProducer.ControlClass: TControlClass; +begin + Result := TDBEdit; +end; + +procedure TdxPSDBEditProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + if Field <> nil then + TdxReportCellString(AnItem).TextAlignX := dxPSCore.dxTextAlignX[Field.Alignment]; +end; + +function TdxPSDBEditProducer.Field: TField; +begin + Result := Control.Field; +end; + +{ TdxPSDBLookupComboBoxProducer } + +function TdxPSDBLookupComboBoxProducer.Control: TDBLookupComboBox; +begin + Result := inherited Control as TDBLookupComboBox; +end; + +class function TdxPSDBLookupComboBoxProducer.ControlClass: TControlClass; +begin + Result := TDBLookupComboBox; +end; + +procedure TdxPSDBLookupComboBoxProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + TdxReportCellString(AnItem).Text := Control.Text; +end; + +procedure RegisterAssistants; +begin + TdxPSDBEditProducer.Register; + TdxPSDBLookupComboBoxProducer.Register; +end; + +procedure UnregisterAssistants; +begin + TdxPSDBLookupComboBoxProducer.Unregister; + TdxPSDBEditProducer.Unregister; +end; + +initialization + RegisterAssistants; + +finalization + UnregisterAssistants; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSDBTCLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSDBTCLnk.pas new file mode 100644 index 00000000..ba6c6607 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSDBTCLnk.pas @@ -0,0 +1,74 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSDBTCLnk; + +interface + +{$I cxVer.inc} + +uses + Classes, DBChart, dxPSTCLnk; + +type + TdxDBTeeChartReportLink = class(TCustomdxTeeChartReportLink) + private + function GetDBChart: TDBChart; + public + property DBChart: TDBChart read GetDBChart; + property GraphicClass; + published + property GraphicClassName; + property OnCreateGraphic; + property OnGetGraphicClass; + end; + +implementation + +uses + dxPSCore; + +function TdxDBTeeChartReportLink.GetDBChart: TDBChart; +begin + Result := inherited Chart as TDBChart; +end; + +initialization + dxPSRegisterReportLink(TdxDBTeeChartReportLink, TDBChart, nil); + +finalization + dxPSUnregisterReportLink(TdxDBTeeChartReportLink, TDBChart, nil); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSDBTCLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSDBTCLnkReg.pas new file mode 100644 index 00000000..abec287b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSDBTCLnkReg.pas @@ -0,0 +1,62 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSDBTCLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI9} + DesignIntf, +{$ENDIF} + Classes, dxPSDBTCLnk; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterNoIcon([TdxDBTeeChartReportLink]); +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSDsgImgs.res b/official/x.35/ExpressPrinting System/Sources/dxPSDsgImgs.res new file mode 100644 index 00000000..31c9e507 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Sources/dxPSDsgImgs.res differ diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSDsgProxies.pas b/official/x.35/ExpressPrinting System/Sources/dxPSDsgProxies.pas new file mode 100644 index 00000000..818d257e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSDsgProxies.pas @@ -0,0 +1,412 @@ +{******************************************************************* +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSDsgProxies; + +interface + +{$I cxVer.inc} + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignEditors, ComponentDesigner, + {$ELSE} + DsgnIntf, LibIntf, + {$ENDIF} + Classes, ImgList, Controls, ComCtrls, dxBase, dxPSSngltn; + +const + NodeUncheckedStateIndex = 0; + NodeCheckedStateIndex = 1; + NodeParticallyCheckedStateIndex = 2; + +type + {$IFDEF DELPHI6} + TFormDesigner = IDesigner; + IPersistent = TPersistent; + IComponent = TComponent; + {$ELSE} + TFormDesigner = IFormDesigner; + {$ENDIF} + + {$IFDEF DELPHI6} + TdxDesignSelectionList = IDesignerSelections; + {$ELSE} + {$IFDEF DELPHI5} + TdxDesignSelectionList = TDesignerSelectionList; + {$ELSE} + TdxDesignSelectionList = TComponentList; + {$ENDIF} + {$ENDIF} + + {$IFDEF DELPHI6} + TdxDesignEnvironment = IDesignEnvironment; + {$ElSE} + {$IFDEF DELPHI5} + TdxDesignEnvironment = IDelphiIDE; + {$ELSE} + TdxDesignEnvironment = TIDelphiIDE; + {$ENDIF} + {$ENDIF} + +function IdeEnvironment: TdxDesignEnvironment; + +{ helpers } +function CreateDesignSelectionList: TdxDesignSelectionList; +procedure FreeDesignSelectionList(const ASelections: TdxDesignSelectionList); +procedure RestoreDesignSelection(const ADesigner: TFormDesigner; var AList: TdxDesignSelectionList); +procedure SaveDesignSelection(const ADesigner: TFormDesigner; out AList: TdxDesignSelectionList); +function GetBaseRegistryKey: string; + +{$IFNDEF DELPHI6} +function TryExtractPersistent(Component: IPersistent): TPersistent; +{$ENDIF} + +type + TdxIdeComponentImageItem = class + private + FComponentClass: TComponentClass; + FImageIndex: Integer; + public + constructor Create(AImageIndex: Integer; AComponentClass: TComponentClass); + property ComponentClass: TComponentClass read FComponentClass; + property ImageIndex: Integer read FImageIndex; + end; + + TdxIdeImagesProvider = class(TBasedxPSSingleton) + private + FImages: TCustomImageList; + FItems: TList; + function GetCount: Integer; + function GetImageIndex(ComponentClass: TComponentClass): Integer; + function GetImageIndexByComponentClassName(const ClassName: string): Integer; + function GetImageIndexByObject(AnObject: TPersistent): Integer; + function GetItem(Index: Integer): TdxIdeComponentImageItem; + protected + procedure FinalizeInstance; override; + procedure InitializeInstance; override; + + procedure Add(AImageIndex: Integer; AComponentClass: TComponentClass); + procedure ClearItems; + function ImageIndexByComponentClass(AComponentClass: TComponentClass): Integer; + property Items[Index: Integer]: TdxIdeComponentImageItem read GetItem; + public + class function Instance: TdxIdeImagesProvider; reintroduce; overload; + procedure Refresh; + + property Count: Integer read GetCount; + property ImageIndexes[ComponentClass: TComponentClass]: Integer read GetImageIndex; default; + property ImageIndexesByComponentClassName[const ClassName: string]: Integer read GetImageIndexByComponentClassName; + property ImageIndexesByObject[AnObject: TPersistent]: Integer read GetImageIndexByObject; + property Images: TCustomImageList read FImages; + end; + +function dxIdeImagesProvider: TdxIdeImagesProvider; + +implementation + +uses + ToolsAPI, + {$IFDEF DELPHI9} + PaletteAPI, + {$ENDIF} + Forms, Windows, Graphics, StdCtrls, SysUtils, dxPSCore, dxPSUtl; + +{$IFNDEF DELPHI6} +const + CompIconSize = 28; +{$ENDIF} + +type + IdxIDEPaletteItem = {$IFDEF DELPHI9}IInternalPaletteItem{$ELSE}IPaletteItem{$ENDIF}; + {$IFDEF DELPHI6} + IdxIDEPalletePaint = {$IFDEF DELPHI9}INTAPalettePaintIcon{$ELSE}IPalettePaint{$ENDIF}; + {$ENDIF} + +function IdeEnvironment: TdxDesignEnvironment; +begin + {$IFDEF DELPHI6} + if ActiveDesigner <> nil then + Result := ActiveDesigner.Environment + else + Result := nil; + {$ELSE} + Result := DelphiIDE; + {$ENDIF} +end; + +function CreateDesignSelectionList: TdxDesignSelectionList; +begin + {$IFDEF DELPHI6} + Result := CreateSelectionList; + {$ELSE} + {$IFDEF DELPHI5} + Result := TDesignerSelectionList.Create; + {$ELSE} + Result := TComponentList.Create; + {$ENDIF} + {$ENDIF} +end; + +procedure FreeDesignSelectionList(const ASelections: TdxDesignSelectionList); +begin + {$IFNDEF DELPHI6} + ASelections.Free; + {$ENDIF} +end; + +procedure RestoreDesignSelection(const ADesigner: TFormDesigner; var AList: TdxDesignSelectionList); +begin + ADesigner.SetSelections(AList); + FreeDesignSelectionList(AList); +end; + +procedure SaveDesignSelection(const ADesigner: TFormDesigner; out AList: TdxDesignSelectionList); +begin + AList := CreateDesignSelectionList; + ADesigner.GetSelections(AList); +end; + +function GetBaseRegistryKey: string; +begin + Result := (BorlandIDEServices as IOTAServices).GetBaseRegistryKey; +end; + +{$IFNDEF DELPHI6} +function TryExtractPersistent(Component: IPersistent): TPersistent; +begin + Result := DsgnIntf.TryExtractPersistent(Component); +end; +{$ENDIF} + +{ TdxIdeComponentImageItem } + +constructor TdxIdeComponentImageItem.Create(AImageIndex: Integer; AComponentClass: TComponentClass); +begin + inherited Create; + FComponentClass := AComponentClass; + FImageIndex := AImageIndex; +end; + +{ TdxIdeImagesProvider } + +function dxIdeImagesProvider: TdxIdeImagesProvider; +begin + Result := TdxIdeImagesProvider.Instance; +end; + +class function TdxIdeImagesProvider.Instance: TdxIdeImagesProvider; +begin + Result := inherited Instance as TdxIdeImagesProvider; +end; + +procedure TdxIdeImagesProvider.FinalizeInstance; +begin + FImages.Free; + ClearItems; + FItems.Free; + inherited; +end; + +procedure TdxIdeImagesProvider.InitializeInstance; +begin + inherited; + FImages := TImageList.CreateSize(CompIconSize + 1, CompIconSize + 1); // plus one for frame + FItems := TList.Create; +end; + +procedure TdxIdeImagesProvider.Add(AImageIndex: Integer; AComponentClass: TComponentClass); +begin + FItems.Add(TdxIdeComponentImageItem.Create(AImageIndex, AComponentClass)); +end; + +procedure TdxIdeImagesProvider.ClearItems; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].Free; + FItems.Clear; +end; + +function TdxIdeImagesProvider.ImageIndexByComponentClass(AComponentClass: TComponentClass): Integer; +var + I: Integer; + Item: TdxIdeComponentImageItem; +begin + Result := -1; + if AComponentClass <> nil then + begin + {$IFDEF DELPHI5} + if AComponentClass.InheritsFrom(TFrame) then + AComponentClass := TFrame; + {$ENDIF} + if AComponentClass.InheritsFrom(TForm) then + AComponentClass := TForm; + + for I := 0 to Count - 1 do + begin + Item := Items[I]; + if AComponentClass = Item.ComponentClass then + begin + Result := Item.ImageIndex; + Exit; + end; + end; + end; +end; + +procedure TdxIdeImagesProvider.Refresh; + + { TPaintItemStyle = set of (piDown, piSelected, piFramed, piGosted);} + + function GetComponentImage(APaletteItem: IdxIDEPaletteItem; ABitmap: TBitmap): Boolean; + var + R: TRect; + {$IFDEF DELPHI6} + Painter: IdxIDEPalletePaint; + {$ENDIF} + begin + R := MakeRect(0, 0, ABitmap.Width, ABitmap.Height); + ABitmap.Canvas.Brush.Color := clBtnFace; + ABitmap.Canvas.FillRect(R); + {$IFDEF DELPHI6} + Result := Supports(APaletteItem, IdxIDEPalletePaint, Painter); + {$IFDEF DELPHI9} + if Result then + begin + Painter.Paint(ABitmap.Canvas, 0, 0, pi24x24); + DrawEdge(ABitmap.Canvas.Handle, R, BDR_RAISEDINNER, BF_RECT); + end; + {$ELSE} + if Result then + Painter.Paint(ABitmap.Canvas, 0, 0, [piFramed]); + {$ENDIF} + {$ELSE} + Result := True; + APaletteItem.Paint(ABitmap.Canvas, 0, 0); + DrawEdge(ABitmap.Canvas.Handle, R, BDR_RAISEDINNER, BF_RECT); + {$ENDIF} + end; + + function AddComponentToImages(ABitmap: TBitmap; AComponentClass: TComponentClass): Integer; + var + PaletteItem: IdxIDEPaletteItem; + begin + Result := -1; + if IdeEnvironment = nil then Exit; + + PaletteItem := IdeEnvironment.GetPaletteItem(AComponentClass); + if (PaletteItem <> nil) and GetComponentImage(PaletteItem, ABitmap) then + begin + FImages.Add(ABitmap, nil); + Result := FImages.Count - 1; + end; + end; + +var + List: TdxClassList; + Bitmap: TBitmap; + I, ImageIndex: Integer; + ComponentClass: TComponentClass; +begin + FImages.Clear; + ClearItems; + + List := TdxClassList.Create; + try + Bitmap := TBitmap.Create; + try + Bitmap.Width := FImages.Width; + Bitmap.Height := FImages.Height; + dxPSCore.dxPSGetSupportedComponentsList(List); + for I := 0 to List.Count - 1 do + begin + ComponentClass := TComponentClass(List[I]); + if ComponentClass <> nil then + begin + ImageIndex := AddComponentToImages(Bitmap, ComponentClass); + Add(ImageIndex, ComponentClass); + end; + end; + finally + Bitmap.Free; + end; + finally + List.Free; + end; +end; + +function TdxIdeImagesProvider.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxIdeImagesProvider.GetImageIndex(ComponentClass: TComponentClass): Integer; +begin + Result := ImageIndexByComponentClass(ComponentClass); +end; + +function TdxIdeImagesProvider.GetImageIndexByComponentClassName(const ClassName: string): Integer; +var + AClass: TClass; +begin + AClass := Classes.GetClass(ClassName); + if AClass.InheritsFrom(TComponent) then + Result := ImageIndexes[TComponentClass(AClass)] + else + Result := -1; +end; + +function TdxIdeImagesProvider.GetImageIndexByObject(AnObject: TPersistent): Integer; +begin + if AnObject is TComponent then + Result := ImageIndexes[TComponentClass(AnObject.ClassType)] + else + Result := -1; +end; + +function TdxIdeImagesProvider.GetItem(Index: Integer): TdxIdeComponentImageItem; +begin + Result := TdxIdeComponentImageItem(FItems[Index]); +end; + +initialization + +finalization + TdxIdeImagesProvider.ReleaseInstance; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSDsgUtils.pas b/official/x.35/ExpressPrinting System/Sources/dxPSDsgUtils.pas new file mode 100644 index 00000000..8056e8d0 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSDsgUtils.pas @@ -0,0 +1,68 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSDsgUtils; + +interface + +{$I cxVer.inc} + +uses + Classes, TypInfo; + +procedure HideProperty(PropertyType: PTypeInfo; ComponentClass: TClass; const PropertyName: string); +function TryStartWEBPage(const APage: string): Boolean; + +implementation + +uses + {$IFDEF DELPHI6} + DesignIntf, + {$ELSE} + DsgnIntf, + {$ENDIF} + Windows, ShellAPI; + +procedure HideProperty(PropertyType: PTypeInfo; ComponentClass: TClass; const PropertyName: string); +begin + RegisterPropertyEditor(PropertyType, ComponentClass, PropertyName, nil); +end; + +function TryStartWEBPage(const APage: string): Boolean; +begin + Result := ShellExecute(0, nil, PChar(APage), nil, nil, SW_SHOWNORMAL) >= 32; +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSESys.pas b/official/x.35/ExpressPrinting System/Sources/dxPSESys.pas new file mode 100644 index 00000000..259e0f84 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSESys.pas @@ -0,0 +1,371 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire coVisntents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSESys; + +interface + +{$I cxVer.inc} + +uses + Classes, dxPSSngltn, dxBase; + +type + TdxEventSubscriber = class; + + TdxEventClass = class of TdxEvent; + TdxEvent = class; + + TdxPSEventSystem = class(TBasedxPSSingleton) + private + FEventClasses: TdxClassList; + FSubscribers: TList; + function GetEventClass(Index: Integer): TdxEventClass; + function GetEventCount: Integer; + function GetSubscriber(Index: Integer): TdxEventSubscriber; + function GetSubscriberCount: Integer; + protected + procedure FinalizeInstance; override; + procedure InitializeInstance; override; + + procedure MoveSubscriber(ACurIndex, ANewIndex: Integer); + public + class function Instance: TdxPSEventSystem; reintroduce; overload; + + procedure ProcessEvent(var AEvent: TdxEvent); + + function IndexOfEventClass(AEventClass: TdxEventClass): Integer; + procedure RegisterEventClass(AEventClass: TdxEventClass); + procedure UnregisterEventClass(AEventClass: TdxEventClass); + + function IndexOfSubscriber(ASubscriber: TdxEventSubscriber): Integer; + procedure RegisterSubscriber(ASubscriber: TdxEventSubscriber); + procedure UnregisterSubscriber(ASubscriber: TdxEventSubscriber); + + property EventClasses[Index: Integer]: TdxEventClass read GetEventClass; + property EventCount: Integer read GetEventCount; + property SubscriberCount: Integer read GetSubscriberCount; + property Subscribers[Index: Integer]: TdxEventSubscriber read GetSubscriber; + end; + + TdxEventSubscriber = class + private + FActiveEvent: TdxEvent; + FEnabled: Boolean; + FEventClasses: TdxClassList; + FRegistered: Boolean; + function GetEventClass(Index: Integer): TdxEventClass; + function GetEventCount: Integer; + function GetIndex: Integer; + procedure SetIndex(Value: Integer); + procedure SetRegistered(Value: Boolean); + + procedure ProcessEvent(AEvent: TdxEvent); + protected + procedure DoProcessEvent; virtual; abstract; + public + constructor Create(const AEventClasses: array of TdxEventClass); + destructor Destroy; override; + + procedure Add(AEventClass: TdxEventClass); + procedure Remove(AEventClass: TdxEventClass); + function SupportsEventClass(AEventClass: TdxEventClass): Boolean; + + property ActiveEvent: TdxEvent read FActiveEvent; + property Enabled: Boolean read FEnabled write FEnabled default True; + property EventClasses[Index: Integer]: TdxEventClass read GetEventClass; + property EventCount: Integer read GetEventCount; + property Index: Integer read GetIndex write SetIndex; + property Registered: Boolean read FRegistered write SetRegistered default True; + end; + + TdxEvent = class + private + FBreak: Boolean; + FRegistered: Boolean; + FSender: TObject; + procedure SetRegistered(Value: Boolean); + public + constructor Create(ASender: TObject); + function EventClass: TdxEventClass; + + property Break: Boolean read FBreak write FBreak; + property Registered: Boolean read FRegistered write SetRegistered; + property Sender: TObject read FSender; + end; + +function dxPSEventSystem: TdxPSEventSystem; +procedure dxPSProcessEvent(var AEvent: TdxEvent); + +implementation + +uses + SysUtils, Forms, TypInfo {$IFNDEF DELPHI5}, dxPSUtl{$ENDIF}; + +function dxPSEventSystem: TdxPSEventSystem; +begin + Result := TdxPSEventSystem.Instance; +end; + +procedure dxPSProcessEvent(var AEvent: TdxEvent); +begin + dxPSEventSystem.ProcessEvent(AEvent); +end; + +{ TdxPSEventSystem } + +class function TdxPSEventSystem.Instance: TdxPSEventSystem; +begin + Result := inherited Instance as TdxPSEventSystem; +end; + +procedure TdxPSEventSystem.ProcessEvent(var AEvent: TdxEvent); +var + I: Integer; + Subscriber: TdxEventSubscriber; +begin + if (AEvent <> nil) and AEvent.Registered then + try + for I := 0 to SubscriberCount - 1 do + begin + Subscriber := Subscribers[I]; + if Subscriber.Enabled and Subscriber.SupportsEventClass(AEvent.EventClass) then + begin + try + Subscriber.ProcessEvent(AEvent); + except + Application.HandleException(Self); + end; + if AEvent.Break then Break; + end; + end; + finally + FreeAndNil(AEvent); + end; +end; + +function TdxPSEventSystem.IndexOfEventClass(AEventClass: TdxEventClass): Integer; +begin + Result := FEventClasses.IndexOf(AEventClass); +end; + +procedure TdxPSEventSystem.RegisterEventClass(AEventClass: TdxEventClass); +begin + if AEventClass <> nil then FEventClasses.Add(AEventClass, True); +end; + +procedure TdxPSEventSystem.UnregisterEventClass(AEventClass: TdxEventClass); +begin + FEventClasses.Remove(AEventClass); +end; + +function TdxPSEventSystem.IndexOfSubscriber(ASubscriber: TdxEventSubscriber): Integer; +begin + Result := FSubscribers.IndexOf(ASubscriber); +end; + +procedure TdxPSEventSystem.RegisterSubscriber(ASubscriber: TdxEventSubscriber); +begin + if (ASubscriber <> nil) and (IndexOfSubscriber(ASubscriber) = -1) then + FSubscribers.Add(ASubscriber); +end; + +procedure TdxPSEventSystem.UnregisterSubscriber(ASubscriber: TdxEventSubscriber); +begin + FSubscribers.Remove(ASubscriber); +end; + +procedure TdxPSEventSystem.InitializeInstance; +begin + inherited; + FEventClasses := TdxClassList.Create; + FSubscribers := TList.Create; +end; + +procedure TdxPSEventSystem.FinalizeInstance; +begin + while EventCount > 0 do + UnregisterEventClass(EventClasses[EventCount - 1]); + FreeAndNil(FEventClasses); + + while SubscriberCount > 0 do + UnregisterSubscriber(Subscribers[SubscriberCount - 1]); + FreeAndNil(FSubscribers); + + inherited; +end; + +function TdxPSEventSystem.GetEventClass(Index: Integer): TdxEventClass; +begin + Result := TdxEventClass(FEventClasses[Index]); +end; + +function TdxPSEventSystem.GetEventCount: Integer; +begin + Result := FEventClasses.Count; +end; + +function TdxPSEventSystem.GetSubscriber(Index: Integer): TdxEventSubscriber; +begin + Result := TdxEventSubscriber(FSubscribers[Index]); +end; + +function TdxPSEventSystem.GetSubscriberCount: Integer; +begin + Result := FSubscribers.Count; +end; + +procedure TdxPSEventSystem.MoveSubscriber(ACurIndex, ANewIndex: Integer); +begin + FSubscribers.Move(ACurIndex, ANewIndex); +end; + +{ TdxEventSubscriber } + +constructor TdxEventSubscriber.Create(const AEventClasses: array of TdxEventClass); +var + I: Integer; +begin + inherited Create; + FEnabled := True; + FEventClasses := TdxClassList.Create; + for I := Low(AEventClasses) to High(AEventClasses) do + Add(AEventClasses[I]); + Registered := True; +end; + +destructor TdxEventSubscriber.Destroy; +begin + Registered := False; + while EventCount <> 0 do + Remove(EventClasses[EventCount - 1]); + FreeAndNil(FEventClasses); + inherited; +end; + +procedure TdxEventSubscriber.SetRegistered(Value: Boolean); +begin + if FRegistered <> Value then + begin + FRegistered := Value; + if FRegistered then + dxPSEventSystem.RegisterSubscriber(Self) + else + dxPSEventSystem.UnregisterSubscriber(Self); + end; +end; + +function TdxEventSubscriber.GetEventClass(Index: Integer): TdxEventClass; +begin + Result := TdxEventClass(FEventClasses[Index]); +end; + +function TdxEventSubscriber.GetEventCount: Integer; +begin + Result := FEventClasses.Count; +end; + +function TdxEventSubscriber.GetIndex: Integer; +begin + Result := dxPSEventSystem.IndexOfSubscriber(Self); +end; + +procedure TdxEventSubscriber.SetIndex(Value: Integer); +var + CurIndex: Integer; +begin + if Registered then + begin + if Value < 0 then Value := 0; + if Value > dxPSEventSystem.SubscriberCount - 1 then + Value := dxPSEventSystem.SubscriberCount - 1; + CurIndex := GetIndex; + if CurIndex <> Value then + dxPSEventSystem.MoveSubscriber(CurIndex, Value); + end; +end; + +procedure TdxEventSubscriber.Add(AEventClass: TdxEventClass); +begin + if not SupportsEventClass(AEventClass) then FEventClasses.Add(AEventClass); +end; + +procedure TdxEventSubscriber.Remove(AEventClass: TdxEventClass); +begin + FEventClasses.Remove(AEventClass); +end; + +function TdxEventSubscriber.SupportsEventClass(AEventClass: TdxEventClass): Boolean; +begin + Result := (AEventClass <> nil) and (FEventClasses.IndexOf(AEventClass) <> -1); +end; + +procedure TdxEventSubscriber.ProcessEvent(AEvent: TdxEvent); +begin + FActiveEvent := AEvent; + try + DoProcessEvent; + finally + FActiveEvent := nil; + end; +end; + +{ TdxEvent } + +constructor TdxEvent.Create(ASender: TObject); +begin + inherited Create; + FSender := ASender; + SetRegistered(True); +end; + +function TdxEvent.EventClass: TdxEventClass; +begin + Result := TdxEventClass(ClassType); +end; + +procedure TdxEvent.SetRegistered(Value: Boolean); +begin + if FRegistered <> Value then + begin + FRegistered := Value; + if FRegistered then + dxPSEventSystem.RegisterEventClass(EventClass) + else + dxPSEventSystem.UnregisterEventClass(EventClass); + end; +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSEdgePatterns.pas b/official/x.35/ExpressPrinting System/Sources/dxPSEdgePatterns.pas new file mode 100644 index 00000000..1dc1119e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSEdgePatterns.pas @@ -0,0 +1,465 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSEdgePatterns; + +interface + +{$I cxVer.inc} + +uses + Classes, Windows, Graphics, dxPSSngltn, dxBase, dxPSCore; + +type + TdxPSCellEdgePatternOrientation = (cepoHorizontal, cepoVertical); + + TdxPSEdgePattern = class(TdxPSCustomCellBorder) + public + class procedure Register; override; + class procedure Unregister; override; + + class function Bits(Index: Integer): DWORD; virtual; + class function Name: string; virtual; + class function RequiredBrushOrigin: Boolean; virtual; + class function RequiredScaling: Boolean; virtual; + class function SignificantBitCount: Integer; virtual; + class function Solid: Boolean; override; + class function Thickness: Integer; override; + end; + + TdxPSEdgePatternClass = class of TdxPSEdgePattern; + + TdxPSSolidEdgePattern = class(TdxPSEdgePattern) + public + class function Bits(Index: Integer): DWORD; override; + class function Name: string; override; + class function RequiredBrushOrigin: Boolean; override; + class function RequiredScaling: Boolean; override; + class function SignificantBitCount: Integer; override; + class function Solid: Boolean; override; + class function Thickness: Integer; override; + end; + + TdxPSEdgePatternItem = class + private + FBitmaps: array[TdxPSCellEdgePatternOrientation] of TBitmap; + FBrushes: array[TdxPSCellEdgePatternOrientation] of TBrush; + function GetBitmap(Orientation: TdxPSCellEdgePatternOrientation): TBitmap; + function GetBrush(Orientation: TdxPSCellEdgePatternOrientation): TBrush; + protected + procedure Initialize(APattern: TdxPSEdgePatternClass; AIsPrinting: Boolean); virtual; + public + constructor Create(APattern: TdxPSEdgePatternClass; AIsPrinting: Boolean); + destructor Destroy; override; + property Bitmaps[Orientation: TdxPSCellEdgePatternOrientation]: TBitmap read GetBitmap; + property Brushes[Orientation: TdxPSCellEdgePatternOrientation]: TBrush read GetBrush; + end; + + TdxPSEdgePatternFactory = class(TBasedxPSSingleton) + private + FItems: TList; + FPatterns: TdxClassList; + FPrintItems: TList; + function GetCount: Integer; + function GetInternalItem(Index: Integer; IsPrinting: Boolean): TdxPSEdgePatternItem; + function GetItem(Pattern: TdxPSEdgePatternClass; IsPrinting: Boolean): TdxPSEdgePatternItem; + function GetPattern(Index: Integer): TdxPSEdgePatternClass; + procedure SetInternalItem(Index: Integer; IsPrinting: Boolean; Value: TdxPSEdgePatternItem); + + procedure AddPattern(APattern: TdxPSEdgePatternClass); + procedure RemovePattern(APattern: TdxPSEdgePatternClass); + + function HasItem(APattern: TdxPSEdgePatternClass): Boolean; + function HasPrintItem(APattern: TdxPSEdgePatternClass): Boolean; + + procedure RemovePatternItem(APattern: TdxPSEdgePatternClass); + procedure RemovePatternPrintItem(APattern: TdxPSEdgePatternClass); + protected + procedure FinalizeInstance; override; + procedure InitializeInstance; override; + function IndexOf(APattern: TdxPSEdgePatternClass): Integer; + property InternalItems[Index: Integer; IsPrinting: Boolean]: TdxPSEdgePatternItem read GetInternalItem write SetInternalItem; + public + class function Instance: TdxPSEdgePatternFactory; reintroduce; overload; + procedure Register(APattern: TdxPSEdgePatternClass); + procedure Unregister(APattern: TdxPSEdgePatternClass); + + procedure ResetPrintItems; + + property Count: Integer read GetCount; + property Items[Pattern: TdxPSEdgePatternClass; IsPrinting: Boolean]: TdxPSEdgePatternItem read GetItem; default; + property Patterns[Index: Integer]: TdxPSEdgePatternClass read GetPattern; + end; + +function dxPSEdgePatternFactory: TdxPSEdgePatternFactory; + +implementation + +uses + SysUtils, Forms, cxClasses, dxPSRes, dxPrnDev, dxPSUtl; + +function dxPSEdgePatternFactory: TdxPSEdgePatternFactory; +begin + Result := TdxPSEdgePatternFactory.Instance; +end; + +{ TcxPSEdgePattern } + +class procedure TdxPSEdgePattern.Register; +begin + inherited; + dxPSEdgePatternFactory.Register(Self); +end; + +class procedure TdxPSEdgePattern.Unregister; +begin + inherited; + dxPSEdgePatternFactory.Unregister(Self); +end; + +class function TdxPSEdgePattern.Bits(Index: Integer): DWORD; +begin + Result := 0; +end; + +class function TdxPSEdgePattern.Name: string; +begin + Result := ''; +end; + +class function TdxPSEdgePattern.RequiredBrushOrigin: Boolean; +begin + Result := True; +end; + +class function TdxPSEdgePattern.RequiredScaling: Boolean; +begin + Result := True; +end; + +class function TdxPSEdgePattern.SignificantBitCount: Integer; +begin + Result := 0; +end; + +class function TdxPSEdgePattern.Solid: Boolean; +begin + Result := False; +end; + +class function TdxPSEdgePattern.Thickness: Integer; +begin + Result := 0; +end; + +{ TdxPSSolidEdgePattern } + +class function TdxPSSolidEdgePattern.Bits(Index: Integer): DWORD; +begin + Result := $FFFFFFFF; +end; + +class function TdxPSSolidEdgePattern.Name: string; +begin + Result := cxGetResourceString(@sdxSolidEdgePattern); +end; + +class function TdxPSSolidEdgePattern.RequiredBrushOrigin: Boolean; +begin + Result := False; +end; + +class function TdxPSSolidEdgePattern.RequiredScaling: Boolean; +begin + Result := False; +end; + +class function TdxPSSolidEdgePattern.SignificantBitCount: Integer; +begin + Result := 8; +end; + +class function TdxPSSolidEdgePattern.Solid: Boolean; +begin + Result := True; +end; + +class function TdxPSSolidEdgePattern.Thickness: Integer; +begin + Result := 1; +end; + +{ TdxPSEdgePatternItem } + +constructor TdxPSEdgePatternItem.Create(APattern: TdxPSEdgePatternClass; AIsPrinting: Boolean); +begin + inherited Create; + FBitmaps[cepoHorizontal] := TBitmap.Create; + FBitmaps[cepoVertical] := TBitmap.Create; + FBrushes[cepoHorizontal] := TBrush.Create; + FBrushes[cepoVertical] := TBrush.Create; + Initialize(APattern, AIsPrinting); +end; + +destructor TdxPSEdgePatternItem.Destroy; +begin + FBrushes[cepoVertical].Free; + FBrushes[cepoHorizontal].Free; + FBitmaps[cepoVertical].Free; + FBitmaps[cepoHorizontal].Free; + inherited Destroy; +end; + +procedure TdxPSEdgePatternItem.Initialize(APattern: TdxPSEdgePatternClass; AIsPrinting: Boolean); + + procedure ScaleBitmap(ABitmap: TBitmap); + var + H, W, Numerator, Denominator: Integer; + TempBitmap: TBitmap; + begin + H := ABitmap.Height; + W := ABitmap.Width; + Numerator := GetDeviceCaps(dxPrintDevice.Handle, LOGPIXELSY); + Denominator := Screen.PixelsPerInch; + TempBitmap := TBitmap.Create; + try + TempBitmap.HandleType := bmDIB; + TempBitmap.Assign(ABitmap); + ABitmap.Height := H * Numerator div Denominator; + ABitmap.Height := ABitmap.Height - ABitmap.Height mod H; + ABitmap.Width := W * Numerator div Denominator; + ABitmap.Width := ABitmap.Width - ABitmap.Width mod W; + ABitmap.Canvas.StretchDraw(MakeRect(0, 0, ABitmap.Width, ABitmap.Height), TempBitmap); + finally + TempBitmap.Free; + end; + end; + + procedure InitializeOrientation(AOrientation: TdxPSCellEdgePatternOrientation); + const + Colors: array[Boolean] of TColor = (clWhite, clBlack); + var + Size, I, J: Integer; + Color: TColor; + begin + Size := APattern.SignificantBitCount; + with FBitmaps[AOrientation] do + begin + Width := Size; + Height := Size; + Monochrome := True; + HandleType := bmDIB; + for I := 0 to Size - 1 do + for J := 0 to Size - 1 do + begin + Color := Colors[APattern.Bits(Ord(Odd(J))) and (1 shl I) <> 0]; + if AOrientation = cepoVertical then + Canvas.Pixels[J, I] := Color + else + Canvas.Pixels[I, J] := Color; + end; + end; + + if AIsPrinting and APattern.RequiredScaling then + ScaleBitmap(FBitmaps[AOrientation]); + FBrushes[AOrientation].Bitmap := FBitmaps[AOrientation]; + end; + +begin + InitializeOrientation(cepoHorizontal); + InitializeOrientation(cepoVertical); +end; + +function TdxPSEdgePatternItem.GetBitmap(Orientation: TdxPSCellEdgePatternOrientation): TBitmap; +begin + Result := FBitmaps[Orientation]; +end; + +function TdxPSEdgePatternItem.GetBrush(Orientation: TdxPSCellEdgePatternOrientation): TBrush; +begin + Result := FBrushes[Orientation]; +end; + +{ TdxPSEdgePatternFactory } + +class function TdxPSEdgePatternFactory.Instance: TdxPSEdgePatternFactory; +begin + Result := inherited Instance as TdxPSEdgePatternFactory; +end; + +procedure TdxPSEdgePatternFactory.Register(APattern: TdxPSEdgePatternClass); +begin + if IndexOf(APattern) = -1 then AddPattern(APattern); +end; + +procedure TdxPSEdgePatternFactory.Unregister(APattern: TdxPSEdgePatternClass); +begin + RemovePattern(APattern); +end; + +procedure TdxPSEdgePatternFactory.ResetPrintItems; +var + I: Integer; +begin + for I := 0 to FPrintItems.Count - 1 do + begin + TObject(FPrintItems[I]).Free; + FPrintItems[I] := nil; + end; +end; + +procedure TdxPSEdgePatternFactory.FinalizeInstance; + + procedure FreeObjectList(AList: TList); + var + I: Integer; + begin + for I := 0 to AList.Count - 1 do + TObject(AList[I]).Free; + AList.Free; + end; + +begin + FreeObjectList(FItems); + FreeObjectList(FPrintItems); + FreeAndNil(FPatterns); + inherited; +end; + +procedure TdxPSEdgePatternFactory.InitializeInstance; +begin + inherited; + FItems := TList.Create; + FPatterns := TdxClassList.Create; + FPrintItems := TList.Create; +end; + +function TdxPSEdgePatternFactory.IndexOf(APattern: TdxPSEdgePatternClass): Integer; +begin + Result := FPatterns.IndexOf(APattern); +end; + +function TdxPSEdgePatternFactory.GetCount: Integer; +begin + Result := FPatterns.Count; +end; + +function TdxPSEdgePatternFactory.GetInternalItem(Index: Integer; + IsPrinting: Boolean): TdxPSEdgePatternItem; +begin + if IsPrinting then + Result := TdxPSEdgePatternItem(FPrintItems[Index]) + else + Result := TdxPSEdgePatternItem(FItems[Index]); +end; + +function TdxPSEdgePatternFactory.GetItem(Pattern: TdxPSEdgePatternClass; + IsPrinting: Boolean): TdxPSEdgePatternItem; +var + Index: Integer; +begin + if Pattern <> nil then + begin + Index := IndexOf(Pattern); + if Index = -1 then + raise Exception.CreateFmt(cxGetResourceString(@sdxPatternIsNotRegistered), [Pattern.ClassName]); + if InternalItems[Index, IsPrinting] = nil then + InternalItems[Index, IsPrinting] := TdxPSEdgePatternItem.Create(Pattern, IsPrinting); + Result := InternalItems[Index, IsPrinting]; + end + else + Result := nil; +end; + +function TdxPSEdgePatternFactory.GetPattern(Index: Integer): TdxPSEdgePatternClass; +begin + Result := TdxPSEdgePatternClass(FPatterns[Index]); +end; + +procedure TdxPSEdgePatternFactory.SetInternalItem(Index: Integer; IsPrinting: Boolean; + Value: TdxPSEdgePatternItem); +begin + if IsPrinting then + FPrintItems[Index] := Value + else + FItems[Index] := Value; +end; + +procedure TdxPSEdgePatternFactory.AddPattern(APattern: TdxPSEdgePatternClass); +begin + FPatterns.Add(APattern); + FItems.Add(nil); + FPrintItems.Add(nil); +end; + +procedure TdxPSEdgePatternFactory.RemovePattern(APattern: TdxPSEdgePatternClass); +begin + if HasItem(APattern) then RemovePatternItem(APattern); + if HasPrintItem(APattern) then RemovePatternPrintItem(APattern); + FPatterns.Remove(APattern) +end; + +function TdxPSEdgePatternFactory.HasItem(APattern: TdxPSEdgePatternClass): Boolean; +begin + Result := InternalItems[IndexOf(APattern), False] <> nil; +end; + +function TdxPSEdgePatternFactory.HasPrintItem(APattern: TdxPSEdgePatternClass): Boolean; +begin + Result := InternalItems[IndexOf(APattern), True] <> nil; +end; + +procedure TdxPSEdgePatternFactory.RemovePatternItem(APattern: TdxPSEdgePatternClass); +var + Item: TdxPSEdgePatternItem; +begin + Item := Items[APattern, False]; + FItems.Remove(Item); + Item.Free; +end; + +procedure TdxPSEdgePatternFactory.RemovePatternPrintItem(APattern: TdxPSEdgePatternClass); +var + Item: TdxPSEdgePatternItem; +begin + Item := Items[APattern, True]; + FPrintItems.Remove(Item); + Item.Free; +end; + +initialization + TdxPSSolidEdgePattern.Register; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSEngn.pas b/official/x.35/ExpressPrinting System/Sources/dxPSEngn.pas new file mode 100644 index 00000000..e0cb0032 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSEngn.pas @@ -0,0 +1,321 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire coVisntents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSEngn; + +interface + +{$I cxVer.inc} + +uses + dxPSESys, Classes, Graphics, SysUtils, dxPSGlbl, dxPSSngltn; + +type + TdxPSEngine = class(TBasedxPSSingleton) + private + FDesignTimeRegistryPath: string; + FHelpFile: string; + FInitialDir: string; + FLookAndFeel: TdxPSLookAndFeel; + FRegistryPath: string; + FSaveFormsPosition: Boolean; + FUseNativeLookAndFeel: Boolean; + function GetAppName: string; + function GetRealRegistryPath: string; + function GetThemesEnabled: Boolean; + protected + procedure InitializeInstance; override; + public + class function Instance: TdxPSEngine; reintroduce; overload; + property AppName: string read GetAppName; + property DesignTimeRegistryPath: string read FDesignTimeRegistryPath; + property HelpFile: string read FHelpFile write FHelpFile; + property InitialDir: string read FInitialDir write FInitialDir; + property LookAndFeel: TdxPSLookAndFeel read FLookAndFeel write FLookAndFeel; + property RealRegistryPath: string read GetRealRegistryPath; + property RegistryPath: string read FRegistryPath write FRegistryPath; + property SaveFormsPosition: Boolean read FSaveFormsPosition write FSaveFormsPosition; + property ThemesEnabled: Boolean read GetThemesEnabled; + property UseNativeLookAndFeel: Boolean read FUseNativeLookAndFeel write FUseNativeLookAndFeel; + end; + + TdxPSEngineController = class(TComponent) + private + FHelpFile: string; + FLookAndFeel: TdxPSLookAndFeel; + FRegistryPath: string; + FSaveFormsPosition: Boolean; + FUseNativeLookAndFeel: Boolean; + procedure SetHelpFile(const Value: string); + procedure SetLookAndFeel(Value: TdxPSLookAndFeel); + procedure SetRegistryPath(const Value: string); + procedure SetSaveFormsPosition(Value: Boolean); + procedure SetUseNativeLookAndFeel(Value: Boolean); + function IsCurrent: Boolean; + function IsDesigning: Boolean; + protected + procedure Loaded; override; + procedure InitializeEngine; virtual; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Activate; + published + property HelpFile: string read FHelpFile write SetHelpFile; + property LookAndFeel: TdxPSLookAndFeel read FLookAndFeel write SetLookAndFeel default pslfStandard; + property RegistryPath: string read FRegistryPath write SetRegistryPath; + property SaveFormsPosition: Boolean read FSaveFormsPosition write SetSaveFormsPosition default True; + property UseNativeLookAndFeel: Boolean read FUseNativeLookAndFeel write SetUseNativeLookAndFeel default True; + end; + +function dxPSEngine: TdxPSEngine; + +implementation + +uses + Forms, {$IFDEF DELPHI7} Themes, {$ENDIF} dxPSRes, dxPSUtl; + +function dxPSEngine: TdxPSEngine; +begin + Result := TdxPSEngine.Instance; +end; + +{ TdxPSEngine } + +class function TdxPSEngine.Instance: TdxPSEngine; +begin + Result := inherited Instance as TdxPSEngine; +end; + +procedure TdxPSEngine.InitializeInstance; +begin + inherited; + FDesignTimeRegistryPath := dxPSGlbl.sdxPSRegPathDesignTime; + FSaveFormsPosition := True; + if IsDesignTime then + LookAndFeel := pslfFlat; + FUseNativeLookAndFeel := True; +end; + +function TdxPSEngine.GetAppName: string; +begin + Result := ChangeFileExt(ExtractFileName(Application.ExeName), ''); +end; + +function TdxPSEngine.GetRealRegistryPath: string; +begin + if IsDesignTime then + Result := DesignTimeRegistryPath + else + Result := RegistryPath; +end; + +function TdxPSEngine.GetThemesEnabled: Boolean; +begin + {$IFDEF DELPHI7} + Result := ThemeServices.ThemesEnabled; + {$ELSE} + Result := False; + {$ENDIF} +end; + +{ TdxPSEngineControllerList } + +type + TdxPSEngineControllerList = class + private + FItems: TList; + function GetCount: Integer; + function GetActiveController: TdxPSEngineController; + procedure SetActiveController(Value: TdxPSEngineController); + public + destructor Destroy; override; + + procedure Add(Value: TdxPSEngineController); + function IndexOf(Value: TdxPSEngineController): Integer; + procedure Remove(Value: TdxPSEngineController); + + property ActiveController: TdxPSEngineController read GetActiveController write SetActiveController; + property Count: Integer read GetCount; + end; + +const + FEngineControllerList: TdxPSEngineControllerList = nil; + +function dxPSEngineControllerList: TdxPSEngineControllerList; +begin + if FEngineControllerList = nil then + FEngineControllerList := TdxPSEngineControllerList.Create; + Result := FEngineControllerList; +end; + +destructor TdxPSEngineControllerList.Destroy; +begin + FreeAndNil(FItems); + inherited; +end; + +procedure TdxPSEngineControllerList.Add(Value: TdxPSEngineController); +begin + if FItems = nil then FItems := TList.Create; + FItems.Add(Value); +end; + +function TdxPSEngineControllerList.IndexOf(Value: TdxPSEngineController): Integer; +begin + if FItems <> nil then + Result := FItems.IndexOf(Value) + else + Result := -1 +end; + +procedure TdxPSEngineControllerList.Remove(Value: TdxPSEngineController); +begin + if IndexOf(Value) > -1 then + begin + FItems.Remove(Value); + if Count = 0 then FreeAndNil(FItems); + end; +end; + +function TdxPSEngineControllerList.GetActiveController: TdxPSEngineController; +begin + if FItems <> nil then + Result := TdxPSEngineController(FItems[Count - 1]) + else + Result := nil; +end; + +function TdxPSEngineControllerList.GetCount: Integer; +begin + if FItems <> nil then + Result := FItems.Count + else + Result := 0; +end; + +procedure TdxPSEngineControllerList.SetActiveController(Value: TdxPSEngineController); +begin + if (FItems <> nil) and (IndexOf(Value) < Count - 1) then + begin + FItems.Remove(Value); + FItems.Add(Value); + end; +end; + +{ TdxPSEngineController } + +constructor TdxPSEngineController.Create(AOwner: TComponent); +begin + inherited; + FSaveFormsPosition := True; + FUseNativeLookAndFeel := True; + dxPSEngineControllerList.Add(Self); +end; + +destructor TdxPSEngineController.Destroy; +begin + dxPSEngineControllerList.Remove(Self); + inherited; +end; + +procedure TdxPSEngineController.Activate; +begin + dxPSEngineControllerList.ActiveController := Self; +end; + +function TdxPSEngineController.IsCurrent: Boolean; +begin + Result := dxPSEngineControllerList.ActiveController = Self; +end; + +function TdxPSEngineController.IsDesigning: Boolean; +begin + Result := csDesigning in ComponentState; +end; + +procedure TdxPSEngineController.Loaded; +begin + inherited; + if not IsDesigning and IsCurrent then InitializeEngine; +end; + +procedure TdxPSEngineController.InitializeEngine; +begin + dxPSEngine.HelpFile := HelpFile; + dxPSEngine.RegistryPath := RegistryPath; +end; + +procedure TdxPSEngineController.SetHelpFile(const Value: string); +begin + FHelpFile := Value; + if IsCurrent then + dxPSEngine.HelpFile := HelpFile; +end; + +procedure TdxPSEngineController.SetLookAndFeel(Value: TdxPSLookAndFeel); +begin + FLookAndFeel := Value; + if IsCurrent then + dxPSEngine.LookAndFeel := LookAndFeel; +end; + +procedure TdxPSEngineController.SetRegistryPath(const Value: string); +begin + FRegistryPath := Value; + if IsCurrent then + dxPSEngine.RegistryPath := RegistryPath; +end; + +procedure TdxPSEngineController.SetSaveFormsPosition(Value: Boolean); +begin + FSaveFormsPosition := Value; + if IsCurrent then + dxPSEngine.SaveFormsPosition := SaveFormsPosition; +end; + +procedure TdxPSEngineController.SetUseNativeLookAndFeel(Value: Boolean); +begin + FUseNativeLookAndFeel := Value; + if IsCurrent then + dxPSEngine.UseNativeLookAndFeel := UseNativeLookAndFeel; +end; + +initialization + +finalization + FreeAndNil(FEngineControllerList); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSEvnt.pas b/official/x.35/ExpressPrinting System/Sources/dxPSEvnt.pas new file mode 100644 index 00000000..68005645 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSEvnt.pas @@ -0,0 +1,350 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire coVisntents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSEvnt; + +interface + +{$I cxVer.inc} + +uses + Classes, dxPSESys, dxPrnPg, dxPgsDlg, dxPSCore; + +type + TdxSMPageParamsChangedEvent = class(TdxEvent) + private + FPrintStyle: TBasedxPrintStyle; + FUpdateCodes: TdxPrinterPageUpdateCodes; + public + constructor Create(ASender: TObject; APrintStyle: TBasedxPrintStyle; AUpdateCodes: TdxPrinterPageUpdateCodes); + property PrintStyle: TBasedxPrintStyle read FPrintStyle; + property UpdateCodes: TdxPrinterPageUpdateCodes read FUpdateCodes; + end; + + TdxSMStyleListChangedEvent = class(TdxEvent); + + TdxStyleListChangedSubscriber = class(TdxEventSubscriber) + private + FOnStyleListChanged: TNotifyEvent; + protected + procedure DoProcessEvent; override; + public + procedure StyleListChanged(Sender: TObject); dynamic; + property OnStyleListChanged: TNotifyEvent read FOnStyleListChanged write FOnStyleListChanged; + end; + + TdxPageParamsChangedSubscriber = class(TdxEventSubscriber) + private + FOnPageParamsChanged: TdxPageParamsChangedEvent; + protected + procedure DoProcessEvent; override; + public + procedure PageParamsChanged(Sender: TObject; AStyle: TBasedxPrintStyle; AUpdateCodes: TdxPrinterPageUpdateCodes); dynamic; + property OnPageParamsChanged: TdxPageParamsChangedEvent read FOnPageParamsChanged write FOnPageParamsChanged; + end; + + TdxComponentPrinterEvent = class(TdxEvent) + private + function GetComponentPrinter: TdxComponentPrinter; + public + property ComponentPrinter: TdxComponentPrinter read GetComponentPrinter; + end; + + TdxPSPrintEvent = class(TdxComponentPrinterEvent) + private + FPageCount: Integer; + FPageIndex: Integer; + FReportLink: TBasedxReportLink; + FStage: TdxPSPrintStage; + public + constructor Create(Sender: TObject; AReportLink: TBasedxReportLink; + APageIndex, APageCount: Integer; AStage: TdxPSPrintStage); + + property PageCount: Integer read FPageCount; + property PageIndex: Integer read FPageIndex; + property ReportLink: TBasedxReportLink read FReportLink; + property Stage: TdxPSPrintStage read FStage; + end; + + TdxPSBuildEvent = class(TdxComponentPrinterEvent) + private + FPercentCompleted: Double; + FReportLink: TBasedxReportLink; + FStage: TdxPSBuildStage; + public + constructor Create(Sender: TObject; AReportLink: TBasedxReportLink; + const APercentCompleted: Double; AStage: TdxPSBuildStage); + + property PercentCompleted: Double read FPercentCompleted; + property ReportLink: TBasedxReportLink read FReportLink; + property Stage: TdxPSBuildStage read FStage; + end; + + TdxPSPrintReportSubscriber = class(TdxEventSubscriber) + private + FOnEndPrint: TdxReportLinkNotifyEvent; + FOnProgressPrint: TdxNewPageEvent; + FOnStartPrint: TdxStartPrintEvent; + protected + procedure DoProcessEvent; override; + public + procedure EndPrint(Sender: TObject; AReportLink: TBasedxReportLink); dynamic; + procedure ProgressPrint(Sender: TObject; AReportLink: TBasedxReportLink; APageIndex: Integer); dynamic; + procedure StartPrint(Sender: TObject; AReportLink: TBasedxReportLink; APageCount: Integer); dynamic; + + property OnEndPrint: TdxReportLinkNotifyEvent read FOnEndPrint write FOnEndPrint; + property OnProgressPrint: TdxNewPageEvent read FOnProgressPrint write FOnProgressPrint; + property OnStartPrint: TdxStartPrintEvent read FOnStartPrint write FOnStartPrint; + end; + + TdxPSBuildReportSubscriber = class(TdxEventSubscriber) + private + FOnEndGenerateReport: TdxReportLinkNotifyEvent; + FOnGenerateReportProgress: TdxGenerateReportProgressEvent; + FOnStartGenerateReport: TdxReportLinkNotifyEvent; + protected + procedure DoProcessEvent; override; + public + procedure EndBuild(Sender: TObject; AReportLink: TBasedxReportLink); dynamic; + procedure ProgressBuild(Sender: TObject; AReportLink: TBasedxReportLink; APercentCompleted: Double); dynamic; + procedure StartBuild(Sender: TObject; AReportLink: TBasedxReportLink); dynamic; + + property OnEndGenerateReport: TdxReportLinkNotifyEvent read FOnEndGenerateReport write FOnEndGenerateReport; + property OnGenerateReportProgress: TdxGenerateReportProgressEvent read FOnGenerateReportProgress write FOnGenerateReportProgress; + property OnStartGenerateReport: TdxReportLinkNotifyEvent read FOnStartGenerateReport write FOnStartGenerateReport; + end; + + TdxHFTextEntriesChangedEvent = class(TdxEvent); + + TdxNoParamsEvent = procedure of object; + + TdxHFTextEntriesChangedSubscriber = class(TdxEventSubscriber) + private + FOnHFTextEntriesChanged: TdxNoParamsEvent; + protected + procedure DoProcessEvent; override; + public + property OnHFTextEntriesChanged: TdxNoParamsEvent read FOnHFTextEntriesChanged write FOnHFTextEntriesChanged; + end; + + TdxHFTextEntryChooseEvent = class(TdxEvent) + private + FEntry: string; + public + constructor Create(Sender: TObject; const AEntry: string); + property Entry: string read FEntry; + end; + + TdxHFTextEntryEvent = procedure(Sender: TObject; const AEntry: string) of object; + + TdxHFTextEntryChooseSubscriber = class(TdxEventSubscriber) + private + FOnHFTextEntryChoose: TdxHFTextEntryEvent; + protected + procedure DoProcessEvent; override; + public + property OnHFTextEntryChoose: TdxHFTextEntryEvent read FOnHFTextEntryChoose write FOnHFTextEntryChoose; + end; + +implementation + +{ TdxSMPageParamsChangedEvent } + +constructor TdxSMPageParamsChangedEvent.Create(ASender: TObject; + APrintStyle: TBasedxPrintStyle; AUpdateCodes: TdxPrinterPageUpdateCodes); +begin + inherited Create(ASender); + FPrintStyle := APrintStyle; + FUpdateCodes := AUpdateCodes; +end; + +{ TdxStyleListChangedSubscriber } + +procedure TdxStyleListChangedSubscriber.DoProcessEvent; +begin + if ActiveEvent is TdxSMStyleListChangedEvent then + StyleListChanged(ActiveEvent.Sender) +end; + +procedure TdxStyleListChangedSubscriber.StyleListChanged(Sender: TObject); +begin + if Assigned(FOnStyleListChanged) then FOnStyleListChanged(Sender); +end; + +{ TdxPageParamsChangedSubscriber } + +procedure TdxPageParamsChangedSubscriber.DoProcessEvent; +begin + if ActiveEvent is TdxSMPageParamsChangedEvent then + with TdxSMPageParamsChangedEvent(ActiveEvent) do + PageParamsChanged(PrintStyle.PrinterPage, PrintStyle, UpdateCodes); +end; + +procedure TdxPageParamsChangedSubscriber.PageParamsChanged(Sender: TObject; + AStyle: TBasedxPrintStyle; AUpdateCodes: TdxPrinterPageUpdateCodes); +begin + if Assigned(FOnPageParamsChanged) then + FOnPageParamsChanged(TdxPrinterPage(Sender), AStyle, AUpdateCodes); +end; + +{ TdxComponentPrinterEvent } + +function TdxComponentPrinterEvent.GetComponentPrinter: TdxComponentPrinter; +begin + Result := TdxComponentPrinter(Sender); +end; + +{ TdxPSPrintEvent } + +constructor TdxPSPrintEvent.Create(Sender: TObject; AReportLink: TBasedxReportLink; + APageIndex, APageCount: Integer; AStage: TdxPSPrintStage); +begin + inherited Create(Sender); + FReportLink := AReportLink; + FPageIndex := APageIndex; + FPageCount := APageCount; + FStage := AStage; +end; + +{ TdxPSBuildEvent } + +constructor TdxPSBuildEvent.Create(Sender: TObject; AReportLink: TBasedxReportLink; + const APercentCompleted: Double; AStage: TdxPSBuildStage); +begin + inherited Create(Sender); + FReportLink := AReportLink; + FPercentCompleted := APercentCompleted; + FStage := AStage; +end; + +{ TdxPSBuildReportSubscriber } + +procedure TdxPSBuildReportSubscriber.DoProcessEvent; +begin + if ActiveEvent is TdxPSBuildEvent then + with TdxPSBuildEvent(ActiveEvent) do + case Stage of + bsStart: + StartBuild(ComponentPrinter, ReportLink); + bsProgress: + ProgressBuild(ComponentPrinter, ReportLink, PercentCompleted); + bsEnd: + EndBuild(ComponentPrinter, ReportLink); + end; +end; + +procedure TdxPSBuildReportSubscriber.EndBuild(Sender: TObject; + AReportLink: TBasedxReportLink); +begin + if Assigned(FOnEndGenerateReport) then + FOnEndGenerateReport(Sender, AReportLink); +end; + +procedure TdxPSBuildReportSubscriber.ProgressBuild(Sender: TObject; + AReportLink: TBasedxReportLink; APercentCompleted: Double); +begin + if Assigned(FOnGenerateReportProgress) then + FOnGenerateReportProgress(Sender, AReportLink, APercentCompleted); +end; + +procedure TdxPSBuildReportSubscriber.StartBuild(Sender: TObject; + AReportLink: TBasedxReportLink); +begin + if Assigned(FOnStartGenerateReport) then + FOnStartGenerateReport(Sender, AReportLink); +end; + +{ TdxPSPrintReportSubscriber } + +procedure TdxPSPrintReportSubscriber.DoProcessEvent; +begin + if ActiveEvent is TdxPSPrintEvent then + with TdxPSPrintEvent(ActiveEvent) do + case Stage of + psStart: + StartPrint(ComponentPrinter, ReportLink, PageCount); + psProgress: + ProgressPrint(ComponentPrinter, ReportLink, PageIndex); + psEnd: + EndPrint(ComponentPrinter, ReportLink); + end; +end; + +procedure TdxPSPrintReportSubscriber.EndPrint(Sender: TObject; + AReportLink: TBasedxReportLink); +begin + if Assigned(FOnEndPrint) then FOnEndPrint(Sender, AReportLink); +end; + +procedure TdxPSPrintReportSubscriber.ProgressPrint(Sender: TObject; + AReportLink: TBasedxReportLink; APageIndex: Integer); +begin + if Assigned(FOnProgressPrint) then + FOnProgressPrint(Sender, AReportLink, APageIndex); +end; + +procedure TdxPSPrintReportSubscriber.StartPrint(Sender: TObject; + AReportLink: TBasedxReportLink; APageCount: Integer); +begin + if Assigned(FOnStartPrint) then + FOnStartPrint(Sender, AReportLink, APageCount); +end; + +{ TdxHFTextEntriesChangedSubscriber } + +procedure TdxHFTextEntriesChangedSubscriber.DoProcessEvent; +begin + if ActiveEvent is TdxHFTextEntriesChangedEvent then + if Assigned(FOnHFTextEntriesChanged) then FOnHFTextEntriesChanged; +end; + +{ TdxHFTextEntryChooseEvent } + +constructor TdxHFTextEntryChooseEvent.Create(Sender: TObject; const AEntry: string); +begin + inherited Create(Sender); + FEntry := AEntry; +end; + +{ TdxHFTextEntryChooseSubscriber } + +procedure TdxHFTextEntryChooseSubscriber.DoProcessEvent; +begin + if ActiveEvent is TdxHFTextEntryChooseEvent then + if Assigned(FOnHFTextEntryChoose) then + FOnHFTextEntryChoose(ActiveEvent.Sender, TdxHFTextEntryChooseEvent(ActiveEvent).Entry); +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSExcelEdgePatterns.pas b/official/x.35/ExpressPrinting System/Sources/dxPSExcelEdgePatterns.pas new file mode 100644 index 00000000..92b3fc34 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSExcelEdgePatterns.pas @@ -0,0 +1,428 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSExcelEdgePatterns; + +interface + +{$I cxVer.inc} + +uses + {$IFDEF DELPHI6} Types,{$ENDIF} Windows, dxPSCore, dxPSEdgePatterns; + +type + TdxPSMediumSolidEdgePattern = class(TdxPSSolidEdgePattern) + public + class function Name: string; override; + class function Thickness: Integer; override; + end; + + TdxPSThickSolidEdgePattern = class(TdxPSSolidEdgePattern) + public + class function Name: string; override; + class function Thickness: Integer; override; + end; + + TdxPSDottedEdgePattern = class(TdxPSEdgePattern) + public + class function Bits(Index: Integer): DWORD; override; + class function Name: string; override; + class function SignificantBitCount: Integer; override; + class function Thickness: Integer; override; + end; + + TdxPSDashedEdgePattern = class(TdxPSEdgePattern) + public + class function Bits(Index: Integer): DWORD; override; + class function Name: string; override; + class function SignificantBitCount: Integer; override; + class function Thickness: Integer; override; + end; + + TdxPSDashDotDotEdgePattern = class(TdxPSEdgePattern) + public + class function Bits(Index: Integer): DWORD; override; + class function Name: string; override; + class function SignificantBitCount: Integer; override; + class function Thickness: Integer; override; + end; + + TdxPSDashDotEdgePattern = class(TdxPSEdgePattern) + public + class function Bits(Index: Integer): DWORD; override; + class function Name: string; override; + class function SignificantBitCount: Integer; override; + class function Thickness: Integer; override; + end; + + TdxPSSlantedDashDotEdgePattern = class(TdxPSEdgePattern) + public + class function Bits(Index: Integer): DWORD; override; + class function Name: string; override; + class function SignificantBitCount: Integer; override; + class function Thickness: Integer; override; + end; + + TdxPSMediumDashDotDotEdgePattern = class(TdxPSEdgePattern) + public + class function Bits(Index: Integer): DWORD; override; + class function Name: string; override; + class function SignificantBitCount: Integer; override; + class function Thickness: Integer; override; + end; + + TdxPSHairEdgePattern = class(TdxPSEdgePattern) + public + class function Bits(Index: Integer): DWORD; override; + class function Name: string; override; + class function SignificantBitCount: Integer; override; + class function Thickness: Integer; override; + end; + + TdxPSMediumDashDotEdgePattern = class(TdxPSEdgePattern) + public + class function Bits(Index: Integer): DWORD; override; + class function Name: string; override; + class function SignificantBitCount: Integer; override; + class function Thickness: Integer; override; + end; + + TdxPSMediumDashedEdgePattern = class(TdxPSEdgePattern) + public + class function Bits(Index: Integer): DWORD; override; + class function Name: string; override; + class function SignificantBitCount: Integer; override; + class function Thickness: Integer; override; + end; + + TdxPSDoubleLineSolidEdgePattern = class(TdxPSEdgePattern) + public + class function Bits(Index: Integer): DWORD; override; + class function Name: string; override; + class function SignificantBitCount: Integer; override; + class function Thickness: Integer; override; + end; + +implementation + +uses + cxClasses, dxPSRes; + +{ TdxPSMediumSolidEdgePattern } + +class function TdxPSMediumSolidEdgePattern.Name: string; +begin + Result := cxGetResourceString(@sdxMediumSolidEdgePattern); +end; + +class function TdxPSMediumSolidEdgePattern.Thickness: Integer; +begin + Result := 2; +end; + +{ TdxPSThickSolidEdgePattern } + +class function TdxPSThickSolidEdgePattern.Name: string; +begin + Result := cxGetResourceString(@sdxThickSolidEdgePattern); +end; + +class function TdxPSThickSolidEdgePattern.Thickness: Integer; +begin + Result := 3; +end; + +{ TdxPSDottedEdgePattern } + +class function TdxPSDottedEdgePattern.Bits(Index: Integer): DWORD; +begin + Result := $EEEEEEEE; +end; + +class function TdxPSDottedEdgePattern.Name: string; +begin + Result := cxGetResourceString(@sdxSlantedDashDotEdgePattern); +end; + +class function TdxPSDottedEdgePattern.SignificantBitCount: Integer; +begin + Result := 8; +end; + +class function TdxPSDottedEdgePattern.Thickness: Integer; +begin + Result := 1; +end; + +{ TdxPSDashedEdgePattern } + +class function TdxPSDashedEdgePattern.Bits(Index: Integer): DWORD; +begin + Result := $33333333; +end; + +class function TdxPSDashedEdgePattern.Name: string; +begin + Result := cxGetResourceString(@sdxDashedEdgePattern); +end; + +class function TdxPSDashedEdgePattern.SignificantBitCount: Integer; +begin + Result := 8; +end; + +class function TdxPSDashedEdgePattern.Thickness: Integer; +begin + Result := 1; +end; + +{ TdxPSDashDotDotEdgePattern } + +class function TdxPSDashDotDotEdgePattern.Bits(Index: Integer): DWORD; +begin + Result := $FF1C7FC7; +end; + +class function TdxPSDashDotDotEdgePattern.Name: string; +begin + Result := cxGetResourceString(@sdxDashDotDotEdgePattern); +end; + +class function TdxPSDashDotDotEdgePattern.SignificantBitCount: Integer; +begin + Result := 24; +end; + +class function TdxPSDashDotDotEdgePattern.Thickness: Integer; +begin + Result := 1; +end; + +{ TdxPSDashDotEdgePattern } + +class function TdxPSDashDotEdgePattern.Bits(Index: Integer): DWORD; +begin + Result := $FFFC7FC7; +end; + +class function TdxPSDashDotEdgePattern.Name: string; +begin + Result := cxGetResourceString(@sdxDashDotEdgePattern); +end; + +class function TdxPSDashDotEdgePattern.SignificantBitCount: Integer; +begin + Result := 18; +end; + +class function TdxPSDashDotEdgePattern.Thickness: Integer; +begin + Result := 1; +end; + +{ TdxPSSlantedDashDotEdgePattern } + +class function TdxPSSlantedDashDotEdgePattern.Bits(Index: Integer): DWORD; +begin + if Index = 0 then + Result := $FFFFEFFE + else + Result := $FFFCF3FF; +end; + +class function TdxPSSlantedDashDotEdgePattern.Name: string; +begin + Result := cxGetResourceString(@sdxHairEdgePattern); +end; + +class function TdxPSSlantedDashDotEdgePattern.SignificantBitCount: Integer; +begin + Result := 18; +end; + +class function TdxPSSlantedDashDotEdgePattern.Thickness: Integer; +begin + Result := 2; +end; + +{ TdxPSMediumDashDotDotEdgePattern } + +class function TdxPSMediumDashDotDotEdgePattern.Bits(Index: Integer): DWORD; +begin + Result := $FF1C7FC7; +end; + +class function TdxPSMediumDashDotDotEdgePattern.Name: string; +begin + Result := cxGetResourceString(@sdxMediumDashDotDotEdgePattern); +end; + +class function TdxPSMediumDashDotDotEdgePattern.SignificantBitCount: Integer; +begin + Result := 24; +end; + +class function TdxPSMediumDashDotDotEdgePattern.Thickness: Integer; +begin + Result := 2; +end; + +{ TdxPSHairEdgePattern } + +class function TdxPSHairEdgePattern.Bits(Index: Integer): DWORD; +begin + Result := $55555555; +end; + +class function TdxPSHairEdgePattern.Name: string; +begin + Result := cxGetResourceString(@sdxDottedEdgePattern); +end; + +class function TdxPSHairEdgePattern.SignificantBitCount: Integer; +begin + Result := 8; +end; + +class function TdxPSHairEdgePattern.Thickness: Integer; +begin + Result := 1; +end; + +{ TdxPSMediumDashDotEdgePattern } + +class function TdxPSMediumDashDotEdgePattern.Bits(Index: Integer): DWORD; +begin + Result := $FFFC71FF; +end; + +class function TdxPSMediumDashDotEdgePattern.Name: string; +begin + Result := cxGetResourceString(@sdxMediumDashDotEdgePattern); +end; + +class function TdxPSMediumDashDotEdgePattern.SignificantBitCount: Integer; +begin + Result := 18; +end; + +class function TdxPSMediumDashDotEdgePattern.Thickness: Integer; +begin + Result := 2; +end; + +{ TdxPSMediumDashedEdgePattern } + +class function TdxPSMediumDashedEdgePattern.Bits(Index: Integer): DWORD; +begin + Result := $FFFFF1FF; +end; + +class function TdxPSMediumDashedEdgePattern.Name: string; +begin + Result := cxGetResourceString(@sdxMediumDashedEdgePattern); +end; + +class function TdxPSMediumDashedEdgePattern.SignificantBitCount: Integer; +begin + Result := 12; +end; + +class function TdxPSMediumDashedEdgePattern.Thickness: Integer; +begin + Result := 2; +end; + +{ TdxPSDoubleLineSolidEdgePattern } + +class function TdxPSDoubleLineSolidEdgePattern.Bits(Index: Integer): DWORD; +begin + Result := $FFFFFFFF * DWORD(Ord(not Odd(Index))); +end; + +class function TdxPSDoubleLineSolidEdgePattern.Name: string; +begin + Result := cxGetResourceString(@sdxDoubleLineEdgePattern); +end; + +class function TdxPSDoubleLineSolidEdgePattern.SignificantBitCount: Integer; +begin + Result := 8; +end; + +class function TdxPSDoubleLineSolidEdgePattern.Thickness: Integer; +begin + Result := 3; +end; + +procedure RegisterPatterns; +begin + TdxPSMediumSolidEdgePattern.Register; + TdxPSThickSolidEdgePattern.Register; + TdxPSDottedEdgePattern.Register; + TdxPSDashedEdgePattern.Register; + TdxPSDashDotDotEdgePattern.Register; + TdxPSDashDotEdgePattern.Register; + TdxPSSlantedDashDotEdgePattern.Register; + TdxPSMediumDashDotDotEdgePattern.Register; + TdxPSHairEdgePattern.Register; + TdxPSMediumDashDotEdgePattern.Register; + TdxPSMediumDashedEdgePattern.Register; + TdxPSDoubleLineSolidEdgePattern.Register; +end; + +procedure UnregisterPatterns; +begin + TdxPSDoubleLineSolidEdgePattern.Unregister; + TdxPSMediumDashedEdgePattern.Unregister; + TdxPSMediumDashDotEdgePattern.Unregister; + TdxPSHairEdgePattern.Unregister; + TdxPSMediumDashDotDotEdgePattern.Unregister; + TdxPSSlantedDashDotEdgePattern.Unregister; + TdxPSDashDotEdgePattern.Unregister; + TdxPSDashDotDotEdgePattern.Unregister; + TdxPSDashedEdgePattern.Unregister; + TdxPSDottedEdgePattern.Unregister; + TdxPSThickSolidEdgePattern.Unregister; + TdxPSMediumSolidEdgePattern.Unregister; +end; + +initialization + RegisterPatterns; + +finalization + UnregisterPatterns; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSExcelFillPatterns.pas b/official/x.35/ExpressPrinting System/Sources/dxPSExcelFillPatterns.pas new file mode 100644 index 00000000..8aae6d7f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSExcelFillPatterns.pas @@ -0,0 +1,423 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSExcelFillPatterns; + +interface + +{$I cxVer.inc} + +uses + dxPSFillPatterns; + +type + { TdxPSSolidFillPattern, TdxPSGray50FillPattern are standard fill patterns. + They are in dxPSFillPatterns.pas } + + TdxPSGray75FillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSGray25FillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSGray125FillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSGray625FillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSHorizontalStripeFillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSVerticalStripeFillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSReverseDiagonalStripeFillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSDiagonalStripeFillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSDiagonalCrossHatchFillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSThickCrossHatchFillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSThinHorizontalStripeFillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSThinVerticalStripeFillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSThinReverseDiagonalStripeFillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSThinDiagonalStripeFillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSThinHorizontalCrossHatchFillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSThinDiagonalCrossHatchFillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + +implementation + +uses + cxClasses, dxPSRes; + +{ TdxPSGray75FillPattern } + +class procedure TdxPSGray75FillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($1111, $4444, $1111, $4444, $1111, $4444, $1111, $4444); +begin + APattern := Bits; +end; + +class function TdxPSGray75FillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxGray75FillPattern); +end; + +{ TdxPSGray25FillPattern } + +class procedure TdxPSGray25FillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($EEEE, $BBBB, $EEEE, $BBBB, $EEEE, $BBBB, $EEEE, $BBBB); +begin + APattern := Bits; +end; + +class function TdxPSGray25FillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxGray25FillPattern); +end; + +{ TdxPSGray125FillPattern } + +class procedure TdxPSGray125FillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($FFFF, $EEEE, $FFFF, $BBBB, $FFFF, $EEEE, $FFFF, $BBBB); +begin + APattern := Bits; +end; + +class function TdxPSGray125FillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxGray125FillPattern); +end; + +{ TdxPSGray625FillPattern } + +class procedure TdxPSGray625FillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($FFFF, $FBFB, $FFFF, $BFBF, $FFFF, $FBFB, $FFFF, $BFBF); +begin + APattern := Bits; +end; + +class function TdxPSGray625FillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxGray625FillPattern); +end; + +{ TdxPSHorizontalStripeFillPattern } + +class procedure TdxPSHorizontalStripeFillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($0000, $0000, $FFFF, $FFFF, $0000, $0000, $FFFF, $FFFF); +begin + APattern := Bits; +end; + +class function TdxPSHorizontalStripeFillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxHorizontalStripeFillPattern); +end; + +{ TdxPSVerticalStripeFillPattern } + +class procedure TdxPSVerticalStripeFillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($9999, $9999, $9999, $9999, $9999, $9999, $9999, $9999); +begin + APattern := Bits; +end; + +class function TdxPSVerticalStripeFillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxVerticalStripeFillPattern); +end; + +{ TdxPSReverseDiagonalStripeFillPattern } + +class procedure TdxPSReverseDiagonalStripeFillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($CCCC, $6666, $3333, $9999, $CCCC, $6666, $3333, $9999); +begin + APattern := Bits; +end; + +class function TdxPSReverseDiagonalStripeFillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxReverseDiagonalStripeFillPattern); +end; + +{ TdxPSDiagonalStripeFillPattern } + +class procedure TdxPSDiagonalStripeFillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($CCCC, $9999, $3333, $6666, $CCCC, $9999, $3333, $6666); +begin + APattern := Bits; +end; + +class function TdxPSDiagonalStripeFillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxDiagonalStripeFillPattern); +end; + +{ TdxPSDiagonalCrossHatchFillPattern } + +class procedure TdxPSDiagonalCrossHatchFillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($CCCC, $CCCC, $3333, $3333, $CCCC, $CCCC, $3333, $3333); +begin + APattern := Bits; +end; + +class function TdxPSDiagonalCrossHatchFillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxDiagonalCrossHatchFillPattern); +end; + +{ TdxPSThickCrossHatchFillPattern } + +class procedure TdxPSThickCrossHatchFillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($CCCC, $0000, $3333, $0000, $CCCC, $0000, $3333, $0000); +begin + APattern := Bits; +end; + +class function TdxPSThickCrossHatchFillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxThickCrossHatchFillPattern); +end; + +{ TdxPSThinHorizontalStripeFillPattern } + +class procedure TdxPSThinHorizontalStripeFillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($0000, $FFFF, $FFFF, $FFFF, $0000, $FFFF, $FFFF, $FFFF); +begin + APattern := Bits; +end; + +class function TdxPSThinHorizontalStripeFillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxThinHorizontalStripeFillPattern); +end; + +{ TdxPSThinVerticalStripeFillPattern } + +class procedure TdxPSThinVerticalStripeFillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($BBBB, $BBBB, $BBBB, $BBBB, $BBBB, $BBBB, $BBBB, $BBBB); +begin + APattern := Bits; +end; + +class function TdxPSThinVerticalStripeFillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxThinVerticalStripeFillPattern); +end; + +{ TdxPSThinReverseDiagonalStripeFillPattern } + +class procedure TdxPSThinReverseDiagonalStripeFillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($DDDD, $EEEE, $7777, $BBBB, $DDDD, $EEEE, $7777, $BBBB); +begin + APattern := Bits; +end; + +class function TdxPSThinReverseDiagonalStripeFillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxThinReverseDiagonalStripeFillPattern); +end; + +{ TdxPSThinDiagonalStripeFillPattern } + +class procedure TdxPSThinDiagonalStripeFillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($EEEE, $DDDD, $BBBB, $7777, $EEEE, $DDDD, $BBBB, $7777); +begin + APattern := Bits; +end; + +class function TdxPSThinDiagonalStripeFillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxThinDiagonalStripeFillPattern); +end; + +{ TdxPSThinHorizontalCrossHatchFillPattern } + +class procedure TdxPSThinHorizontalCrossHatchFillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($0000, $BBBB, $BBBB, $BBBB, $0000, $BBBB, $BBBB, $BBBB); +begin + APattern := Bits; +end; + +class function TdxPSThinHorizontalCrossHatchFillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxThinHorizontalCrossHatchFillPattern); +end; + +{ TdxPSThinDiagonalCrossHatchFillPattern } + +class procedure TdxPSThinDiagonalCrossHatchFillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($BBBB, $5555, $EEEE, $5555, $BBBB, $5555, $EEEE, $5555); +begin + APattern := Bits; +end; + +class function TdxPSThinDiagonalCrossHatchFillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxThinDiagonalCrossHatchFillPattern); +end; + +procedure RegisterPatterns; +begin + TdxPSGray75FillPattern.Register; + TdxPSGray25FillPattern.Register; + TdxPSGray125FillPattern.Register; + TdxPSGray625FillPattern.Register; + TdxPSHorizontalStripeFillPattern.Register; + TdxPSVerticalStripeFillPattern.Register; + TdxPSReverseDiagonalStripeFillPattern.Register; + TdxPSDiagonalStripeFillPattern.Register; + TdxPSDiagonalCrossHatchFillPattern.Register; + TdxPSThickCrossHatchFillPattern.Register; + TdxPSThinHorizontalStripeFillPattern.Register; + TdxPSThinVerticalStripeFillPattern.Register; + TdxPSThinReverseDiagonalStripeFillPattern.Register; + TdxPSThinDiagonalStripeFillPattern.Register; + TdxPSThinHorizontalCrossHatchFillPattern.Register; + TdxPSThinDiagonalCrossHatchFillPattern.Register; +end; + +procedure UnregisterPatterns; +begin + TdxPSThinDiagonalCrossHatchFillPattern.Unregister; + TdxPSThinHorizontalCrossHatchFillPattern.Unregister; + TdxPSThinDiagonalStripeFillPattern.Unregister; + TdxPSThinReverseDiagonalStripeFillPattern.Unregister; + TdxPSThinVerticalStripeFillPattern.Unregister; + TdxPSThinHorizontalStripeFillPattern.Unregister; + TdxPSThickCrossHatchFillPattern.Unregister; + TdxPSDiagonalCrossHatchFillPattern.Unregister; + TdxPSDiagonalStripeFillPattern.Unregister; + TdxPSReverseDiagonalStripeFillPattern.Unregister; + TdxPSVerticalStripeFillPattern.Unregister; + TdxPSHorizontalStripeFillPattern.Unregister; + TdxPSGray625FillPattern.Unregister; + TdxPSGray125FillPattern.Unregister; + TdxPSGray25FillPattern.Unregister; + TdxPSGray75FillPattern.Unregister; +end; + +initialization + RegisterPatterns; + +finalization + UnregisterPatterns; + +end. + + + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSExtDlgs.pas b/official/x.35/ExpressPrinting System/Sources/dxPSExtDlgs.pas new file mode 100644 index 00000000..580b0418 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSExtDlgs.pas @@ -0,0 +1,377 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSExtDlgs; + +interface + +{$I cxVer.inc} + +uses + Messages, Windows, SysUtils, Classes, Controls, Forms, StdCtrls, Graphics, + ExtCtrls, Buttons, Dialogs, cxClasses, dxPSCore, dxExtCtrls; + +type + TdxPSOpenReportDialog = class(TOpenDialog) + private + FPrevFileName: string; + FPreviewRect: TRect; + FReportDocument: TdxPSReportDocument; + + btnPreview: TSpeedButton; + lblPreview: TLabel; + pnlPicture: TPanel; + pnlToolBar: TPanel; + sbxPreview: TdxPSImageScrollBox; + function GetGraphic: TGraphic; + function GetHasDocument: Boolean; + function GetIsDocumentValid: Boolean; + procedure PreviewClick(Sender: TObject); + protected + procedure DoClose; override; + procedure DoSelectionChange; override; + procedure DoShow; override; + function TaskModalDialog(DialogFunc: Pointer; var DialogData): Bool; override; + procedure CreateControls; virtual; + procedure Initialize; virtual; + function IsSelectedFileValid: Boolean; virtual; + procedure LoadReportDocument; + procedure LoadStrings; virtual; + procedure PlacePreviewPanelInitial; + procedure UpdateControls; virtual; + + property Graphic: TGraphic read GetGraphic; + property HasDocument: Boolean read GetHasDocument; + property IsDocumentValid: Boolean read GetIsDocumentValid; + property PreviewRect: TRect read FPreviewRect; + property ReportDocument: TdxPSReportDocument read FReportDocument; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function Execute: Boolean; override; + end; + + TdxPSSaveReportDialog = class(TdxPSOpenReportDialog) + public + constructor Create(AOwner: TComponent); override; + function Execute: Boolean; override; + end; + +const + sdxPicturePanel = 'pnlPicture'; // Don't localize + sdxPreviewButton = 'btnPreview'; // Don't localize + sdxPreviewLabel = 'lblPreview'; // Don't localize + sdxPreviewScrollBox = 'sbxPreview'; // Don't localize + sdxPreviewToolBar = 'pnlToolBar'; // Don't localize + +implementation + +uses + CommDlg, dxPSRes, dxPSImgs, dxPSUtl, dxPCPrVw; + +{$R dxPSExtDlgs.res} + +{ TdxPSOpenReportDialog } + +constructor TdxPSOpenReportDialog.Create(AOwner: TComponent); +begin + inherited; + CreateControls; + DefaultExt := dxPSCore.dxPSReportFileShortExtension; + Filter := Format('%s (*.%1:s)|*.%1:s', [cxGetResourceString(@sdxPSReportFiles), dxPSCore.dxPSReportFileShortExtension]); + Options := Options + [ofPathMustExist, ofFileMustExist]; + Title := cxGetResourceString(@sdxLoadReportDataToFileTitle); +end; + +destructor TdxPSOpenReportDialog.Destroy; +begin + FreeAndNil(FReportDocument); + inherited; +end; + +function TdxPSOpenReportDialog.Execute: Boolean; +begin + if NewStyleControls and not (ofOldStyleDialog in Options) then + Template := 'DXPSDLGTEMPLATE' + else + Template := nil; + Result := inherited Execute; +end; + +procedure TdxPSOpenReportDialog.DoClose; +begin + inherited; + Application.HideHint; +end; + +procedure TdxPSOpenReportDialog.DoSelectionChange; +begin + if FileName <> FPrevFileName then + begin + FPrevFileName := FileName; + if IsSelectedFileValid then + LoadReportDocument; + UpdateControls; + end; + inherited; +end; + +procedure TdxPSOpenReportDialog.DoShow; +begin + Initialize; + inherited; +end; + +function TdxPSOpenReportDialog.TaskModalDialog(DialogFunc: Pointer; var DialogData): Bool; +var + Wnd: HWND; +begin + Wnd := SetParent(Handle, GetForegroundWindow); + TOpenFileName(DialogData).hInstance := hInstance; + Result := inherited TaskModalDialog(DialogFunc, DialogData); + SetParent(Handle, Wnd); +end; + +procedure TdxPSOpenReportDialog.CreateControls; + + procedure CreatePicturePanel; + begin + pnlPicture := TPanel.Create(Self); + with pnlPicture do + begin + Name := sdxPicturePanel; + Caption := ''; + BevelInner := bvNone; + BevelOuter := bvNone; + TabOrder := 1; + + SetBounds(204, 5, 169, 200); + end; + end; + + procedure CreatePreviewToolBar; + begin + pnlToolBar := TPanel.Create(Self); + with pnlToolBar do + begin + Parent := pnlPicture; + Align := alTop; + BevelInner := bvNone; + BevelOuter := bvNone; + Height := 31; //29 + Name := sdxPreviewToolBar; + Caption := ''; + TabOrder := 0; + end; + end; + + procedure CreatePreviewLabel; + begin + lblPreview := TLabel.Create(Self); + with lblPreview do + begin + Parent := pnlToolBar; + AutoSize := False; + Caption := ''; + Name := sdxPreviewLabel; + + SetBounds(2, 6, 157, 23); + end; + end; + + procedure CreatePreviewButton; + begin + btnPreview := TSpeedButton.Create(Self); + with btnPreview do + begin + Parent := pnlToolBar; + Enabled := False; + Bitmap_LoadFromResourceName(Glyph, IDB_DXPSPREVIEW); + Name := sdxPreviewButton; + ParentShowHint := False; + ShowHint := True; + + SetBounds(77, 1, 23, 22); + + OnClick := PreviewClick; + end; + end; + + procedure CreatePreviewScrollBox; + begin + sbxPreview := TdxPSImageScrollBox.Create(Self); + with sbxPreview do + begin + Parent := pnlPicture; + Align := alClient; + Ctl3D := True; + HorzScrollBar.Tracking := True; + Name := sdxPreviewScrollBox; + TabOrder := 1; + VertScrollBar.Tracking := True; + + OnDblClick := PreviewClick; + end; + end; + + {procedure CreateCreatorPanel; + begin + pnlCreatr := TPanel.Create(Self); + with pnlCreator do + begin + Parent := pnlPicture; + Align := alBottom; + Name := sdxCreatorPanel; + end; + end;} + +begin + CreatePicturePanel; + CreatePreviewToolBar; + CreatePreviewLabel; + CreatePreviewButton; + CreatePreviewScrollBox; +end; + +function TdxPSOpenReportDialog.IsSelectedFileValid: Boolean; +begin + Result := FileExists(FileName) and (GetFileAttributes(PChar(FileName)) <> $FFFFFFFF); +end; + +procedure TdxPSOpenReportDialog.LoadReportDocument; +var + Stream: TFileStream; +begin + FreeAndNil(FReportDocument); + Stream := TFileStream.Create(FileName, fmOpenRead or fmShareDenyWrite); + try + try + FReportDocument := TBasedxReportLink.ExtractReportDocument(Stream, True); + except + FReportDocument := nil; + end; + finally + Stream.Free; + end; +end; + +procedure TdxPSOpenReportDialog.Initialize; +begin + LoadStrings; + PlacePreviewPanelInitial; + UpdateControls; +end; + +procedure TdxPSOpenReportDialog.LoadStrings; +begin + lblPreview.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)) + ':'; + btnPreview.Hint := DropAmpersand(cxGetResourceString(@sdxPreview)); +end; + +procedure TdxPSOpenReportDialog.PlacePreviewPanelInitial; +var + R: TRect; +begin + R := GetStaticRect; + + Windows.GetClientRect(Handle, FPreviewRect); + FPreviewRect.Left := R.Left + (R.Right - R.Left); + Inc(FPreviewRect.Top, 4); + + pnlPicture.ParentWindow := Handle; + pnlPicture.Realign; + pnlPicture.BoundsRect := PreviewRect; + + btnPreview.Left := pnlToolBar.BoundsRect.Right - btnPreview.Width - 2; +end; + +procedure TdxPSOpenReportDialog.UpdateControls; +begin + btnPreview.Enabled := IsDocumentValid; + + sbxPreview.Enabled := IsDocumentValid; + sbxPreview.Picture.Assign(Graphic); + if IsDocumentValid then + sbxPreview.HintText := '' + else + if FileExists(FileName) then + sbxPreview.HintText := cxGetResourceString(@sdxReportDocumentIsCorrupted) + else + sbxPreview.HintText := cxGetResourceString(@sdxNone); +end; + +function TdxPSOpenReportDialog.GetGraphic: TGraphic; +begin + if ReportDocument <> nil then + Result := ReportDocument.Preview + else + Result := nil; +end; + +function TdxPSOpenReportDialog.GetHasDocument: Boolean; +begin + Result := ReportDocument <> nil; +end; + +function TdxPSOpenReportDialog.GetIsDocumentValid: Boolean; +begin + Result := Graphic <> nil; +end; + +procedure TdxPSOpenReportDialog.PreviewClick(Sender: TObject); +begin + dxPCPrVw.dxShowPicturePreview(Graphic); +end; + +{ TdxPSSaveReportDialog } + +constructor TdxPSSaveReportDialog.Create(AOwner: TComponent); +begin + inherited; + Options := Options + [ofOverwritePrompt]; + Title := cxGetResourceString(@sdxSaveReportDataToFileTitle); +end; + +function TdxPSSaveReportDialog.Execute: Boolean; +begin + if NewStyleControls and not (ofOldStyleDialog in Options) then + Template := 'DXPSDLGTEMPLATE' + else + Template := nil; + Result := DoExecute(@GetSaveFileName); +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSExtDlgs.res b/official/x.35/ExpressPrinting System/Sources/dxPSExtDlgs.res new file mode 100644 index 00000000..3c35386c Binary files /dev/null and b/official/x.35/ExpressPrinting System/Sources/dxPSExtDlgs.res differ diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSFileBasedXplorer.pas b/official/x.35/ExpressPrinting System/Sources/dxPSFileBasedXplorer.pas new file mode 100644 index 00000000..460c6120 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSFileBasedXplorer.pas @@ -0,0 +1,1486 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSFileBasedXplorer; + +interface + +{$I cxVer.inc} + +uses + Windows, Classes, SysUtils, cxClasses, dxPSGlbl, dxPSCore; + +type + TdxPSFileBasedExplorer = class; + TdxPSFileBasedExplorerItem = class; + + TdxPSFileBasedExplorerFolder = class(TdxPSExplorerFolder) + private + function GetFolder(Index: Integer): TdxPSFileBasedExplorerFolder; + function GetFullQualifiedDirName: string; + function GetFullQualifiedDirPath: string; + function GetIsVolume: Boolean; + function GetItem(Index: Integer): TdxPSFileBasedExplorerItem; + protected + function DoDelete: Boolean; override; + function DoMove(AParent: TdxPSExplorerFolder): Boolean; override; + function DoRename(var ANewName: string): Boolean; override; + + function GetDirName: string; virtual; + function GetDisplayName: string; override; + public + function CannotRenameMessageText(const AOldName, ANewName: string): string; override; + function CanMoveTo(AParent: TCustomdxPSExplorerItem): Boolean; override; + function CanRenameTo(const AName: string): Boolean; override; + function Explorer: TdxPSFileBasedExplorer; reintroduce; overload; + function GetUniqueID(out AnUniqueID: TBytes): Integer; override; + function ItemByName(const AName: string): TdxPSExplorerItem; override; + + function FindFolderByFullQualifiedDirName(const AFullQualifiedDirName: string): TdxPSFileBasedExplorerFolder; + function FindItemByFullQualifiedFileName(const AFullQualifiedName: string): TdxPSFileBasedExplorerItem; + + property DirName: string read GetDirName; + property Folders[Index: Integer]: TdxPSFileBasedExplorerFolder read GetFolder; default; + property FullQualifiedDirName: string read GetFullQualifiedDirName; + property FullQualifiedDirPath: string read GetFullQualifiedDirPath; + property IsVolume: Boolean read GetIsVolume; + property Items[Index: Integer]: TdxPSFileBasedExplorerItem read GetItem; + end; + + TdxPSFileBasedExplorerRootFolder = class(TdxPSFileBasedExplorerFolder) + private + function GetDriveType: TdxDriveType; + function GetVolumeLabel: string; + protected + function GetImageIndex: Integer; override; + function GetSelectedIndex: Integer; override; + public + property VolumeLabel: string read GetVolumeLabel; + property DriveType: TdxDriveType read GetDriveType; + end; + + TdxPSFileBasedExplorerItem = class(TdxPSExplorerItem) + private + FIsIOOutwardlyControlled: Boolean; + function GetFullQualifiedFileName: string; + function GetFullQualifiedFilePath: string; + protected + function AcquireExtension(const AName: string): string; + function SuppressExtension(const AName: string): string; + + function DoDelete: Boolean; override; + function DoMove(AParent: TdxPSExplorerFolder): Boolean; override; + function DoRename(var ANewName: string): Boolean; override; + + function GetDisplayName: string; override; + function GetFileName: string; virtual; + function GetFileSize: Int64; virtual; // in bytes + function GetFormCaption: string; override; + function GetInfoTip: string; override; + function GetNewName(AReportLink: TBasedxReportLink): string; override; + procedure SetName(const Value: string); override; + + property IsIOOutwardlyControlled: Boolean read FIsIOOutwardlyControlled write FIsIOOutwardlyControlled; + public + function CannotRenameMessageText(const AOldName, ANewName: string): string; override; + function CanMoveTo(AParent: TCustomdxPSExplorerItem): Boolean; override; + function CanRenameTo(const AName: string): Boolean; override; + function DataLoadErrorText: string; override; + function Explorer: TdxPSFileBasedExplorer; reintroduce; overload; + function GetUniqueID(out AnUniqueID: TBytes): Integer; override; + function IsNameChanged(const ANewName: string): Boolean; override; + + property FileName: string read GetFileName; + property FileSize: Int64 read GetFileSize; + property FullQualifiedFileName: string read GetFullQualifiedFileName; + property FullQualifiedFilePath: string read GetFullQualifiedFilePath; + end; + + TdxPSFileBasedExplorerContextCommandClass = class of TdxPSFileBasedExplorerContextCommand; + + TdxPSFileBasedExplorerContextCommand = class(TCustomdxPSExplorerContextCommand) + public + function Explorer: TdxPSFileBasedExplorer; reintroduce; overload; + end; + + TdxPSFileBasedExplorerSetAsRootContextCommand = class(TdxPSFileBasedExplorerContextCommand) + public + constructor Create(AnExplorer: TCustomdxPSExplorer); override; + function Enabled: Boolean; override; + procedure Execute; override; + end; + + TdxPSFileBasedExplorerChangeRootContextCommand = class(TdxPSFileBasedExplorerContextCommand) + public + constructor Create(AnExplorer: TCustomdxPSExplorer); override; + function Enabled: Boolean; override; + procedure Execute; override; + end; + + TdxPSFileBasedExplorerGoToUpOneLevelContextCommand = class(TdxPSFileBasedExplorerContextCommand) + public + constructor Create(AnExplorer: TCustomdxPSExplorer); override; + function Enabled: Boolean; override; + procedure Execute; override; + end; + + TdxPSFileBasedExplorerLoadErrorEvent = procedure(Sender: TdxPSFileBasedExplorer; + const AName: string) of object; + + TdxPSFileBasedExplorerOption = (eoLoadAll, eoShowIOErrors, eoStoreToRegistry); + TdxPSFileBasedExplorerOptions = set of TdxPSFileBasedExplorerOption; + + TdxPSFileBasedExplorer = class(TCustomdxPSExplorer) + private + FIOLockCounter: Integer; + FIOStatus: Word; + FLastLoadedFileName: string; + FOptions: TdxPSFileBasedExplorerOptions; + FRootPath: string; + FOnLoadError: TdxPSFileBasedExplorerLoadErrorEvent; + function GetActiveFolder: TdxPSFileBasedExplorerFolder; + function GetActiveFolderPath: string; + function GetRealRootPath: string; + function GetRoot: TdxPSFileBasedExplorerRootFolder; + procedure SetActiveFolder(Value: TdxPSFileBasedExplorerFolder); + procedure SetOptions(Value: TdxPSFileBasedExplorerOptions); + procedure SetRootPath(const Value: string); + protected + procedure Loaded; override; + + { IdxPSExplorerBuildContextCommands } + procedure BuildCommandSet(ABuilder: IdxPSExplorerContextCommandBuilder); override; + { IdxPSExplorerContextCommands2 } + procedure FinalizeCommand(ACommand: TCustomdxPSExplorerContextCommand); override; + procedure InitializeCommand(ACommand: TCustomdxPSExplorerContextCommand); override; + + class function AcceptItemNameChar(AnItem: TCustomdxPSExplorerItem; Ch: Char): Boolean; override; + + function AcquireExtension(const AName: string): string; + function SuppressExtension(const AName: string): string; + + procedure CreateAndCloseFile(const AName: string); + function CreateDataStream(const AFileName: string; AMode: TdxPSStreamMode): TStream; + function CreateItemDataStream(AnItem: TdxPSExplorerItem; AMode: TdxPSStreamMode): TStream; override; + + procedure DoLoadData(AFolder: TdxPSExplorerFolder); override; + procedure DoLoadError(const AName: string); dynamic; + procedure RestoreLoadedItem; virtual; + procedure SaveLoadedItem; virtual; + + class function GetFolderClass: TdxPSExplorerFolderClass; override; + class function GetItemClass: TdxPSExplorerItemClass; override; + class function GetRootFolderClass: TdxPSExplorerFolderClass; override; + function GetRegistryPath: string; virtual; + function GetRootDisplayName: string; override; + procedure MoveTo(AnItem: TCustomdxPSExplorerItem; AParent: TdxPSExplorerFolder); override; + + procedure BeginIO; + procedure EndIO; + + procedure CheckIOError(AnIOResult: Boolean); + procedure ProcessIOError(AnUnconditionalRaiseException: Boolean = False); virtual; + + property IOStatus: Word read FIOStatus write FIOStatus; + property RegistryPath: string read GetRegistryPath; + public + constructor Create(AOwner: TComponent); override; + procedure BeforeDestruction; override; + + procedure LoadFromRegistry(const APath: string); virtual; + procedure SaveToRegistry(const APath: string); virtual; + + class function FileExtension: string; virtual; + procedure PopulatePath(APath: string); + + function CreateNewFolder(AParent: TdxPSExplorerFolder): TdxPSExplorerFolder; override; + function CreateNewItem(AParent: TdxPSExplorerFolder; AReportLink: TBasedxReportLink): TdxPSExplorerItem; override; + + function FindCustomItemByUniqueID(const AnUniqueID: TBytes): TCustomdxPSExplorerItem; override; + function FindFolderByFullQualifiedDirName(const AFullQualifiedDirName: string): TdxPSFileBasedExplorerFolder; + function FindItemByFullQualifiedFileName(const AFullQualifiedName: string): TdxPSFileBasedExplorerItem; + + function LoadedItem: TdxPSFileBasedExplorerItem; reintroduce; overload; + procedure LoadItemData(const AFullQualifiedFileName: string; AReportLink: TBasedxReportLink); overload; + procedure UnloadItemData(const AFullQualifiedFileName: string); overload; + + function CanGoToUpOneLevel: Boolean; virtual; + procedure GoToUpOneLevel; + function ShowChangeRootPathDlg: Boolean; + + function CanSetActiveFolderAsRoot: Boolean; virtual; + procedure SetActiveFolderAsRoot; + + property ActiveFolder: TdxPSFileBasedExplorerFolder read GetActiveFolder write SetActiveFolder; + property ActiveFolderPath: string read GetActiveFolderPath; + property RealRootPath: string read GetRealRootPath; + property Root: TdxPSFileBasedExplorerRootFolder read GetRoot; + published + property Options: TdxPSFileBasedExplorerOptions read FOptions write SetOptions default [eoShowIOErrors]; + property RootPath: string read FRootPath write SetRootPath; + property OnLoadError: TdxPSFileBasedExplorerLoadErrorEvent read FOnLoadError write FOnLoadError; + end; + +implementation + +uses + {$IFDEF DELPHI6} RTLConsts, {$ELSE} FileCtrl, Consts, {$ENDIF} Menus, + Dialogs, Controls, Registry, ShellAPI, dxPSUtl, dxPSRes, dxPSImgs, + dxPSEngn; + +const + sdxRegistryRootPath = '\Explorers\'; // Don't localize + sdxRootPath = 'RootPath'; // Don't localize + +{ Helpers } + +function FirstPathDelimiter(const Source: string): Integer; +begin + Result := Pos(dxPSGlbl.PathDelimiter, Source); +end; + +function HasExtension(const AName, AExtension: string): Boolean; +begin + Result := dxSameText(ExtractFileExt(AName), AExtension); +end; + +procedure IOError; +begin + {$IFDEF DELPHI6} + RaiseLastOSError; + {$ELSE} + RaiseLastWin32Error; + {$ENDIF} +end; + +function RemoveTrailingBackSlash(const Source: string): string; +var + I: Integer; +begin + I := Length(Source); + while (I <> 0) and (Source[I] = '\') do + Dec(I); + + if I > 0 then + Result := Copy(Source, 1, I) + else + Result := ''; +end; + +function ShellRemoveFile(const AName: string; AConfirmation: Boolean): Boolean; +const + ConfirmationMap: array[Boolean] of FILEOP_FLAGS = (FOF_NOCONFIRMATION, 0); +var + FOS: TSHFileOpStruct; +begin + FillChar(FOS, SizeOf(FOS), 0); + with FOS do + begin + Wnd := 0; + pFrom := PChar(AName + #0); + wFunc := FO_DELETE; + fFlags := FOF_ALLOWUNDO or FOF_NOERRORUI or FOF_SILENT or ConfirmationMap[AConfirmation]; + end; + Result := (SHFileOperation(FOS) = 0) and not FOS.fAnyOperationsAborted; +end; + +function ShellRemoveFolder(const APath: string): Boolean; +var + FOS: TSHFileOpStruct; +begin + FillChar(FOS, SizeOf(FOS), 0); + with FOS do + begin + Wnd := 0; + pFrom := PChar(APath + #0); + wFunc := FO_DELETE; + fFlags := FOF_ALLOWUNDO or FOF_NOCONFIRMATION or FOF_NOERRORUI or FOF_SILENT; + end; + Result := SHFileOperation(FOS) = 0; +end; + +function ValidateFileName(const AName: string): Boolean; + + function HasAnyChar(const S, AChars: string): Boolean; + var + I: Integer; + begin + Result := False; + for I := 1 to Length(AChars) do + begin + Result := Pos(AChars[I], S) > 0; + if Result then Exit; + end; + end; + +begin + Result := (Trim(AName) <> '') and not HasAnyChar(AName, dxPSUtl.InvalidFileNameChars); +end; + +{ TdxPSFileBasedExplorerFolder } + +function TdxPSFileBasedExplorerFolder.CannotRenameMessageText(const AOldName, ANewName: string): string; +begin + if not ValidateFileName(ANewName) then + Result := cxGetResourceString(@sdxInvalidFolderName) + else + Result := inherited CannotRenameMessageText(AOldName, ANewName); +end; + +function TdxPSFileBasedExplorerFolder.CanMoveTo(AParent: TCustomdxPSExplorerItem): Boolean; +// Name is equal '' in creation phase +begin + Result := inherited CanMoveTo(AParent) and (AParent <> nil) and + ((esLoading in Explorer.State) or (Name = '') or + CanRenameTo(TdxPSFileBasedExplorerFolder(AParent).FullQualifiedDirName + '\' + Name)); +end; + +function TdxPSFileBasedExplorerFolder.CanRenameTo(const AName: string): Boolean; +begin + Result := inherited CanRenameTo(AName) and ValidateFileName(ExtractFileName(AName)); +end; + +function TdxPSFileBasedExplorerFolder.Explorer: TdxPSFileBasedExplorer; +begin + Result := inherited Explorer as TdxPSFileBasedExplorer; +end; + +function TdxPSFileBasedExplorerFolder.GetUniqueID(out AnUniqueID: TBytes): Integer; +begin + Result := Length(FullQualifiedDirName); + SetLength(AnUniqueID, Result); + Move(Pointer(FullQualifiedDirName)^, Pointer(AnUniqueID)^, Result); +end; + +function TdxPSFileBasedExplorerFolder.ItemByName(const AName: string): TdxPSExplorerItem; +begin + Result := inherited ItemByName(Explorer.AcquireExtension(AName)); +end; + +function TdxPSFileBasedExplorerFolder.FindFolderByFullQualifiedDirName(const AFullQualifiedDirName: string): TdxPSFileBasedExplorerFolder; + + function InternalFindFolder(AFolder: TdxPSFileBasedExplorerFolder; ADirName: string): TdxPSFileBasedExplorerFolder; + var + P: Integer; + FolderName: string; + begin + P := FirstPathDelimiter(ADirName); + if P <> 0 then + begin + FolderName := Copy(ADirName, 1, P - 1); + Result := TdxPSFileBasedExplorerFolder(AFolder.FolderByName(FolderName)); + if Result <> nil then + begin + System.Delete(ADirName, 1, P); + Result := InternalFindFolder(Result, ADirName); + end; + end + else + Result := TdxPSFileBasedExplorerFolder(AFolder.FolderByName(ADirName)); + end; + +var + S, DirName: string; +begin + Result := nil; + S := dxPSUtl.GetLongFileName(AFullQualifiedDirName); + if Pos(FullQualifiedDirName, S) = 1 then + begin + DirName := Copy(S, Length(FullQualifiedDirName) + 1 + 1{PathDelimiter}, Length(S)); + if DirName = '' then + Result := Self + else + Result := InternalFindFolder(Self, DirName); + end; +end; + +function TdxPSFileBasedExplorerFolder.FindItemByFullQualifiedFileName(const AFullQualifiedName: string): TdxPSFileBasedExplorerItem; +var + S: string; + Folder: TdxPSFileBasedExplorerFolder; + SuppressedName: string; +begin + S := dxPSUtl.GetLongFileName(AFullQualifiedName); + Folder := FindFolderByFullQualifiedDirName(ExtractFileDir(S)); + if Folder <> nil then + begin + SuppressedName := Explorer.SuppressExtension(ExtractFileName(S)); + Result := TdxPSFileBasedExplorerItem(Folder.ItemByName(SuppressedName)); + end + else + Result := nil; +end; + +function TdxPSFileBasedExplorerFolder.DoDelete: Boolean; +begin + Result := inherited DoDelete; + if Result and DirectoryExists(FullQualifiedDirName) then + begin + ShellRemoveFolder(FullQualifiedDirName); + Result := not DirectoryExists(FullQualifiedDirName); + end; +end; + +function TdxPSFileBasedExplorerFolder.DoMove(AParent: TdxPSExplorerFolder): Boolean; +const + Buttons: TMsgDlgButtons = [mbYes, mbYesToAll, mbNo, mbCancel{, mbHelp}]; + + function MoveFiles(AParent: TdxPSFileBasedExplorerFolder): Boolean; + var + I: Integer; + Item: TdxPSFileBasedExplorerItem; + begin + for I := ItemCount - 1 downto 0 do + begin + Item := Items[I]; + Item.IsIOOutwardlyControlled := True; + try + if Explorer.IOStatus <> mrYesToAll then + if FileExists(AParent.FullQualifiedDirName + '\' + Item.Name) then + begin + Explorer.IOStatus := MessageDlg(Item.OverwriteMessageText(AParent), mtWarning, Buttons, 0); + if Explorer.IOStatus = mrCancel then + Break; + if Explorer.IOStatus = mrNo then + Continue; + end; + Item.Parent := AParent; + finally + Item.IsIOOutwardlyControlled := False; + end; + end; + Result := Explorer.IOStatus <> mrCancel; + end; + + function MoveFolders(AParent: TdxPSFileBasedExplorerFolder): Boolean; + var + I: Integer; + Folder: TdxPSExplorerFolder; + begin + for I := FolderCount - 1 downto 0 do + begin + Folder := Folders[I]; + Folder.Populate; + Folder.Parent := AParent; + if Explorer.IOStatus = mrCancel then Break; + end; + Result := Explorer.IOStatus <> mrCancel; + end; + +var + DestName: string; + NewParent: TdxPSFileBasedExplorerFolder; +begin + Result := inherited DoMove(AParent); + if Result and ([esLoading, esFolderCreating] * Explorer.State = []) then + begin + if Explorer.IOStatus = mrCancel then + begin + Result := False; + Exit; + end; + + if not DirectoryExists(FullQualifiedDirName) then + begin + Result := False; + Delete; + Exit; + end; + + DestName := TdxPSFileBasedExplorerFolder(AParent).FullQualifiedDirName + '\' + DirName; + if DirectoryExists(DestName) then + begin + Populate; + NewParent := TdxPSFileBasedExplorerFolder(AParent).FindFolderByFullQualifiedDirName(DestName); + NewParent.Populate; + + if Explorer.IOStatus <> mrYesToAll then + begin + Explorer.IOStatus := MessageDlg(OverwriteMessageText(AParent), mtWarning, Buttons, 0); + if Explorer.IOStatus in [mrNo, mrCancel] then + begin + Result := False; + Exit; + end; + end; + + Result := MoveFolders(NewParent) and MoveFiles(NewParent); + if Result then + begin + Result := RemoveDir(FullQualifiedDirName); + Explorer.CheckIOError(Result); + if not DirectoryExists(FullQualifiedDirName) then Delete; + end; + end + else + begin + Result := RenameFile(FullQualifiedDirName, DestName); + Explorer.CheckIOError(Result); + end; + end; +end; + +function TdxPSFileBasedExplorerFolder.DoRename(var ANewName: string): Boolean; +begin + Result := inherited DoRename(ANewName); + if Result and not (esLoading in Explorer.State) then + begin + Result := RenameFile(FullQualifiedDirName, FullQualifiedDirPath + ANewName); + Explorer.CheckIOError(Result); + end; +end; + +function TdxPSFileBasedExplorerFolder.GetDirName: string; +begin + Result := Name; +end; + +function TdxPSFileBasedExplorerFolder.GetDisplayName: string; +begin + Result := DirName; +end; + +function TdxPSFileBasedExplorerFolder.GetIsVolume: Boolean; +begin + Result := ExtractFileDir(FullQualifiedDirName) = FullQualifiedDirName; +end; + +function TdxPSFileBasedExplorerFolder.GetFolder(Index: Integer): TdxPSFileBasedExplorerFolder; +begin + Result := inherited Folders[Index] as TdxPSFileBasedExplorerFolder; +end; + +function TdxPSFileBasedExplorerFolder.GetFullQualifiedDirName: string; +begin + Result := FullQualifiedDirPath; + if IsRoot then + Result := RemoveTrailingBackSlash(Result) + else + Result := Result + DirName; +end; + +function TdxPSFileBasedExplorerFolder.GetFullQualifiedDirPath: string; +begin + if IsRoot then + Result := Explorer.RealRootPath + else + Result := TdxPSFileBasedExplorerFolder(Parent).FullQualifiedDirName; + Result := Result + '\'; +end; + +function TdxPSFileBasedExplorerFolder.GetItem(Index: Integer): TdxPSFileBasedExplorerItem; +begin + Result := inherited Items[Index] as TdxPSFileBasedExplorerItem; +end; + +{ TdxPSFileBasedExplorerRootFolder } + +function TdxPSFileBasedExplorerRootFolder.GetImageIndex: Integer; +begin + if IsVolume and not (DriveType in [dxPSGlbl.dtUnknown, dxPSGlbl.dtNoRootDir]) then + Result := dxPSCore.iiDriveTypes[DriveType] + else + Result := inherited GetImageIndex; +end; + +function TdxPSFileBasedExplorerRootFolder.GetSelectedIndex: Integer; +begin + if IsVolume and not (DriveType in [dxPSGlbl.dtUnknown, dxPSGlbl.dtNoRootDir]) then + Result := dxPSCore.iiDriveTypes[DriveType] + else + Result := inherited GetSelectedIndex; +end; + +function TdxPSFileBasedExplorerRootFolder.GetDriveType: TdxDriveType; +begin + Result := TdxDriveType(Windows.GetDriveType(PChar(FullQualifiedDirPath))); +end; + +function TdxPSFileBasedExplorerRootFolder.GetVolumeLabel: string; +begin + if IsVolume then + Result := dxPSUtl.GetVolumeName(FullQualifiedDirPath) + else + Result := ''; +end; + +{ TdxPSFileBasedExplorerItem } + +function TdxPSFileBasedExplorerItem.AcquireExtension(const AName: string): string; +begin + if Explorer <> nil then + Result := Explorer.AcquireExtension(AName) + else + Result := AName; +end; + +function TdxPSFileBasedExplorerItem.SuppressExtension(const AName: string): string; +begin + if Explorer <> nil then + Result := Explorer.SuppressExtension(AName) + else + Result := AName; +end; + +function TdxPSFileBasedExplorerItem.CannotRenameMessageText(const AOldName, ANewName: string): string; +begin + if not ValidateFileName(ANewName) then + Result := cxGetResourceString(@sdxInvalidReportName) + else + Result := inherited CannotRenameMessageText(AOldName, ANewName); +end; + +function TdxPSFileBasedExplorerItem.CanMoveTo(AParent: TCustomdxPSExplorerItem): Boolean; +// Name is equal '' in creation phase +begin + Result := inherited CanMoveTo(AParent) and (AParent <> nil) and + ((esLoading in Explorer.State) or (Name = '') or + CanRenameTo(TdxPSFileBasedExplorerFolder(AParent).FullQualifiedDirName + '\' + Name)); +end; + +function TdxPSFileBasedExplorerItem.CanRenameTo(const AName: string): Boolean; +begin + Result := inherited CanRenameTo(AName) and ValidateFileName(ExtractFileName(AName)); +end; + +function TdxPSFileBasedExplorerItem.DataLoadErrorText: string; +begin + Result := cxGetResourceString(@sdxFileBasedExplorerItemDataLoadError); +end; + +function TdxPSFileBasedExplorerItem.Explorer: TdxPSFileBasedExplorer; +begin + Result := inherited Explorer as TdxPSFileBasedExplorer; +end; + +function TdxPSFileBasedExplorerItem.GetUniqueID(out AnUniqueID: TBytes): Integer; +begin + Result := Length(FullQualifiedFileName); + SetLength(AnUniqueID, Result); + Move(Pointer(FullQualifiedFileName)^, Pointer(AnUniqueID)^, Result); +end; + +function TdxPSFileBasedExplorerItem.IsNameChanged(const ANewName: string): Boolean; +begin + Result := inherited IsNameChanged(AcquireExtension(ANewName)); +end; + +function TdxPSFileBasedExplorerItem.DoDelete: Boolean; +begin + Result := inherited DoDelete; + if Result and FileExists(FullQualifiedFileName) then + Result := ShellRemoveFile(FullQualifiedFileName, False) and not FileExists(FullQualifiedFileName); +end; + +function TdxPSFileBasedExplorerItem.GetDisplayName: string; +begin + Result := SuppressExtension(FileName); +end; + +function TdxPSFileBasedExplorerItem.GetFileName: string; +begin + Result := AcquireExtension(Name); +end; + +function TdxPSFileBasedExplorerItem.GetFileSize: Int64; // in bytes +var + FileName: string; + FileHandle: THandle; + LowPart, HighPart: DWORD; +begin + Result := 0; + FileName := FullQualifiedFileName; + if FileExists(FileName) then + begin + FileHandle := FileOpen(FileName, fmOpenRead or fmShareDenyWrite); + if FileHandle > 0 then + try + LowPart := Windows.GetFileSize(FileHandle, @HighPart); + if LowPart <> INVALID_FILE_SIZE then + begin + TULargeInteger(Result).LowPart := LowPart; + TULargeInteger(Result).HighPart := HighPart; + end + finally + FileClose(FileHandle); + end; + end; +end; + +function TdxPSFileBasedExplorerItem.GetFormCaption: string; +begin + Result := FullQualifiedFileName; +end; + +function TdxPSFileBasedExplorerItem.GetInfoTip: string; +const + CRLF = #13#10; +var + FileSize: Int64; +begin + Result := inherited GetInfoTip; + + FileSize := Self.FileSize; + if FileSize > 0 then + Result := Result + CRLF + dxPSUtl.DropAmpersand(cxGetResourceString(@sdxSize))+ ': ' + dxPSUtl.FormatFileSize(FileSize); +end; + +function TdxPSFileBasedExplorerItem.GetNewName(AReportLink: TBasedxReportLink): string; +begin + Result := Explorer.AcquireExtension(inherited GetNewName(AReportLink)); +end; + +function TdxPSFileBasedExplorerItem.DoMove(AParent: TdxPSExplorerFolder): Boolean; +var + CancelOperation: Boolean; + DestName: string; + Item: TdxPSExplorerItem; +begin + Result := inherited DoMove(AParent); + if Result and ([esLoading, esItemCreating] * Explorer.State = []) then + begin + if not FileExists(FullQualifiedFileName) then + begin + Delete; + Result := False; + Exit; + end; + + CancelOperation := False; + DestName := TdxPSFileBasedExplorerFolder(AParent).FullQualifiedDirName + '\' + Name; + if FileExists(DestName) then + begin + if IsIOOutwardlyControlled then + CancelOperation := not ShellRemoveFile(DestName, False) + else + CancelOperation := not MessageQuestion(OverwriteMessageText(AParent)) or not ShellRemoveFile(DestName, False); + if not CancelOperation then + begin + Item := AParent.ItemByName(Name); + if Item <> nil then Item.Delete; + end; + end; + + Result := not CancelOperation; + if Result then + begin + Result := RenameFile(FullQualifiedFileName, DestName); + Explorer.CheckIOError(Result); + end; + end; +end; + +function TdxPSFileBasedExplorerItem.DoRename(var ANewName: string): Boolean; +var + ExtensionedName: string; +begin + ExtensionedName := AcquireExtension(ANewName); + Result := inherited DoRename(ExtensionedName); + if Result and not (esLoading in Explorer.State) and + not dxSameText(FullQualifiedFileName, FullQualifiedFilePath + ExtensionedName) then + begin + Result := RenameFile(FullQualifiedFileName, FullQualifiedFilePath + ExtensionedName); + Explorer.CheckIOError(Result); + end; +end; + +procedure TdxPSFileBasedExplorerItem.SetName(const Value: string); +begin + inherited SetName(AcquireExtension(Value)); +end; + +function TdxPSFileBasedExplorerItem.GetFullQualifiedFileName: string; +begin + Result := FullQualifiedFilePath + FileName; +end; + +function TdxPSFileBasedExplorerItem.GetFullQualifiedFilePath: string; +begin + if Parent <> nil then + if Parent.IsRoot then + Result := Explorer.RealRootPath + else + Result := TdxPSFileBasedExplorerFolder(Parent).FullQualifiedDirName + else + Result := ''; + + Result := Result + '\'; +end; + +{ TdxPSFileBasedExplorerContextCommand } + +function TdxPSFileBasedExplorerContextCommand.Explorer: TdxPSFileBasedExplorer; +begin + Result := inherited Explorer as TdxPSFileBasedExplorer; +end; + +{ TdxPSFileBasedExplorerSetAsRootContextCommand } + +constructor TdxPSFileBasedExplorerSetAsRootContextCommand.Create(AnExplorer: TCustomdxPSExplorer); +begin + inherited; + Caption := cxGetResourceString(@sdxMenuExplorerSetAsRoot); + Hint := cxGetResourceString(@sdxHintExplorerSetAsRoot); +end; + +function TdxPSFileBasedExplorerSetAsRootContextCommand.Enabled: Boolean; +begin + Result := Explorer.CanSetActiveFolderAsRoot; +end; + +procedure TdxPSFileBasedExplorerSetAsRootContextCommand.Execute; +begin + if Enabled then + Explorer.SetActiveFolderAsRoot; +end; + +{ TdxPSFileBasedExplorerChangeRootContextCommand } + +constructor TdxPSFileBasedExplorerChangeRootContextCommand.Create(AnExplorer: TCustomdxPSExplorer); +begin + inherited; + Caption := cxGetResourceString(@sdxMenuExplorerChangeRootPath); + Hint := cxGetResourceString(@sdxHintExplorerChangeRootPath); +end; + +function TdxPSFileBasedExplorerChangeRootContextCommand.Enabled: Boolean; +begin + Result := True; +end; + +procedure TdxPSFileBasedExplorerChangeRootContextCommand.Execute; +begin + Explorer.ShowChangeRootPathDlg; +end; + +{ TdxPSFileBasedExplorerGoToUpOneLevelContextCommand } + +constructor TdxPSFileBasedExplorerGoToUpOneLevelContextCommand.Create(AnExplorer: TCustomdxPSExplorer); +begin + inherited; + Caption := cxGetResourceString(@sdxMenuExplorerGoToUpOneLevel); + Hint := cxGetResourceString(@sdxHintExplorerGoToUpOneLevel); + ShortCut := Menus.TextToShortCut('Alt+2'); + Bitmap_LoadFromResourceName(Bitmap, IDB_DXPSGOTOUPONELEVEL); + Bitmap.Transparent := True; +end; + +function TdxPSFileBasedExplorerGoToUpOneLevelContextCommand.Enabled: Boolean; +begin + Result := Explorer.CanGoToUpOneLevel; +end; + +procedure TdxPSFileBasedExplorerGoToUpOneLevelContextCommand.Execute; +begin + if Enabled then + Explorer.GoToUpOneLevel; +end; + +{ TdxPSFileBasedExplorer } + +constructor TdxPSFileBasedExplorer.Create(AOwner: TComponent); +begin + inherited; + FOptions := [eoShowIOErrors]; +end; + +procedure TdxPSFileBasedExplorer.BeforeDestruction; +begin + if (eoStoreToRegistry in Options) and (RegistryPath <> '') then + SaveToRegistry(RegistryPath); + inherited; +end; + +procedure TdxPSFileBasedExplorer.LoadFromRegistry(const APath: string); +var + Registry: TRegistry; +begin + Registry := TRegistry.Create; + with Registry do + try + if OpenKey(APath, False) then + begin + if ValueExists(sdxRootPath) then + FRootPath := ReadString(sdxRootPath); + end; + finally + Free; + end; +end; + +procedure TdxPSFileBasedExplorer.SaveToRegistry(const APath: string); +var + Registry: TRegistry; +begin + Registry := TRegistry.Create; + with Registry do + try + if OpenKey(APath, True) then + begin + WriteString(sdxRootPath, RootPath); + end; + finally + Free; + end; +end; + +class function TdxPSFileBasedExplorer.FileExtension: string; +begin + Result := dxPSCore.dxPSReportFileShortExtension; +end; + +procedure TdxPSFileBasedExplorer.PopulatePath(APath: string); + + procedure InternalPopulateFolder(AFolder: TdxPSFileBasedExplorerFolder; ADirName: string); + var + P: Integer; + FolderName: string; + begin + P := FirstPathDelimiter(ADirName); + if P <> 0 then + FolderName := Copy(ADirName, 1, P - 1) + else + FolderName := ADirName; + + AFolder := TdxPSFileBasedExplorerFolder(AFolder.FolderByName(FolderName)); + if AFolder <> nil then + if P <> 0 then + begin + System.Delete(ADirName, 1, P); + InternalPopulateFolder(AFolder, ADirName); + end + else + AFolder.Populate; + end; + +begin + APath := dxPSUtl.GetLongFileName(APath); + APath := RemoveTrailingBackSlash(APath); + if DirectoryExists(APath) then + if Pos(RealRootPath + '\', APath) = 1 then + begin + System.Delete(APath, 1, Length(RealRootPath) + 1); + InternalPopulateFolder(Root, APath); + end; +end; + +function TdxPSFileBasedExplorer.CreateNewFolder(AParent: TdxPSExplorerFolder): TdxPSExplorerFolder; +var + DirectoryName: string; +begin + if CanCreateFolder then + begin + Result := inherited CreateNewFolder(AParent); + try + DirectoryName := TdxPSFileBasedExplorerFolder(Result).FullQualifiedDirName; + {$IFNDEF DELPHI5} + ForceDirectories(DirectoryName); + if not DirectoryExists(DirectoryName) then + {$ELSE} + if not ForceDirectories(DirectoryName) then + {$ENDIF} + ProcessIOError(True); + except + FreeAndNil(Result); + if eoShowIOErrors in Options then raise; + end; + end + else + Result := nil; +end; + +function TdxPSFileBasedExplorer.CreateNewItem(AParent: TdxPSExplorerFolder; + AReportLink: TBasedxReportLink): TdxPSExplorerItem; +var + FileName: string; +begin + if CanCreateItem then + begin + Result := inherited CreateNewItem(AParent, AReportLink); + try + FileName := TdxPSFileBasedExplorerItem(Result).FullQualifiedFileName; + CreateAndCloseFile(FileName); + Result.RetrieveReportData(AReportLink); + except + if FileExists(FileName) then ShellRemoveFile(FileName, False); + FreeAndNil(Result); + if eoShowIOErrors in Options then raise; + end; + end + else + Result := nil; +end; + +function TdxPSFileBasedExplorer.FindCustomItemByUniqueID(const AnUniqueID: TBytes): TCustomdxPSExplorerItem; +var + Name: string; +begin + SetLength(Name, Length(AnUniqueID)); + Move(Pointer(AnUniqueID)^, Pointer(Name)^, Length(Name)); + Result := FindFolderByFullQualifiedDirName(Name); + if Result = nil then + Result := FindItemByFullQualifiedFileName(Name); +end; + +function TdxPSFileBasedExplorer.FindFolderByFullQualifiedDirName(const AFullQualifiedDirName: string): TdxPSFileBasedExplorerFolder; +begin + Result := Root.FindFolderByFullQualifiedDirName(AFullQualifiedDirName); +end; + +function TdxPSFileBasedExplorer.FindItemByFullQualifiedFileName(const AFullQualifiedName: string): TdxPSFileBasedExplorerItem; +begin + Result := Root.FindItemByFullQualifiedFileName(AFullQualifiedName); +end; + +function TdxPSFileBasedExplorer.LoadedItem: TdxPSFileBasedExplorerItem; +begin + Result := inherited LoadedItem as TdxPSFileBasedExplorerItem; +end; + +procedure TdxPSFileBasedExplorer.LoadItemData(const AFullQualifiedFileName: string; + AReportLink: TBasedxReportLink); +var + S: string; + Item: TdxPSFileBasedExplorerItem; +begin + S := dxPSUtl.GetLongFileName(AFullQualifiedFileName); + PopulatePath(ExtractFileDir(S)); + Item := FindItemByFullQualifiedFileName(S); + if Item <> nil then Item.Load(AReportLink); +end; + +procedure TdxPSFileBasedExplorer.UnloadItemData(const AFullQualifiedFileName: string); +var + Item: TdxPSExplorerItem; +begin + Item := FindItemByFullQualifiedFileName(dxPSUtl.GetLongFileName(AFullQualifiedFileName)); + if Item <> nil then Item.Unload; +end; + +function TdxPSFileBasedExplorer.CanGoToUpOneLevel: Boolean; +begin + Result := not Root.IsVolume; +end; + +procedure TdxPSFileBasedExplorer.GoToUpOneLevel; +begin + if CanGotoUpOneLevel then + RootPath := ExtractFileDir(RealRootPath); +end; + +function TdxPSFileBasedExplorer.ShowChangeRootPathDlg: Boolean; +var + S: string; +begin + S := RealRootPath; + Result := dxPSUtl.ShowSystemSelectFolderDlg(S); + if Result then RootPath := S; +end; + +function TdxPSFileBasedExplorer.CanSetActiveFolderAsRoot: Boolean; +begin + Result := (ActiveFolderPath <> '') and //ValidateFileName(ActiveFolderPath) and + not dxSameText(RootPath, ActiveFolderPath); +end; + +procedure TdxPSFileBasedExplorer.SetActiveFolderAsRoot; +begin + if CanSetActiveFolderAsRoot then + RootPath := ActiveFolderPath; +end; + +procedure TdxPSFileBasedExplorer.Loaded; +begin + inherited; + if (eoStoreToRegistry in Options) and (RegistryPath <> '') then + LoadFromRegistry(RegistryPath); +end; + +{ IdxPSExplorerBuildContextCommands } + +procedure TdxPSFileBasedExplorer.BuildCommandSet(ABuilder: IdxPSExplorerContextCommandBuilder); +begin + inherited; + ABuilder.AddExplorerContextCommand(AddCommandSeparator); + ABuilder.AddExplorerContextCommand(AddCommand(TdxPSFileBasedExplorerChangeRootContextCommand)); + ABuilder.AddExplorerContextCommand(AddCommand(TdxPSFileBasedExplorerSetAsRootContextCommand)); + ABuilder.AddExplorerContextCommand(AddCommand(TdxPSFileBasedExplorerGoToUpOneLevelContextCommand)); +end; + +procedure TdxPSFileBasedExplorer.FinalizeCommand(ACommand: TCustomdxPSExplorerContextCommand); +begin + inherited; +end; + +procedure TdxPSFileBasedExplorer.InitializeCommand(ACommand: TCustomdxPSExplorerContextCommand); +begin + inherited; +end; + +class function TdxPSFileBasedExplorer.AcceptItemNameChar(AnItem: TCustomdxPSExplorerItem; + Ch: Char): Boolean; +begin + Result := Pos(Ch, InvalidFileNameChars) = 0; +end; + +function TdxPSFileBasedExplorer.AcquireExtension(const AName: string): string; +begin + Result := ChangeFileExt(SuppressExtension(AName), '.' + FileExtension); +end; + +function TdxPSFileBasedExplorer.SuppressExtension(const AName: string): string; +begin + Result := ChangeFileExt(AName, ''); +end; + +procedure TdxPSFileBasedExplorer.CreateAndCloseFile(const AName: string); +var + DirectoryName: string; +begin + DirectoryName := ExtractFileDir(AName); + if not DirectoryExists(DirectoryName) then + begin + {$IFNDEF DELPHI5} + ForceDirectories(DirectoryName); + if not DirectoryExists(DirectoryName) then + {$ELSE} + if not ForceDirectories(DirectoryName) then + {$ENDIF} + ProcessIOError(True); + end; + + with TFileStream.Create(AName, fmCreate) do + Free; +end; + +function TdxPSFileBasedExplorer.CreateDataStream(const AFileName: string; + AMode: TdxPSStreamMode): TStream; +const + FileModesMap: array[TdxPSStreamMode] of Word = + (fmOpenRead or fmShareDenyWrite, fmCreate or fmOpenWrite or fmShareDenyWrite, fmOpenReadWrite); +begin + if FileExists(AFileName) then + try + Result := TFileStream.Create(AFileName, FileModesMap[AMode]); + except + Result := nil; + end + else + Result := nil; +end; + +function TdxPSFileBasedExplorer.CreateItemDataStream(AnItem: TdxPSExplorerItem; + AMode: TdxPSStreamMode): TStream; +begin + Result := CreateDataStream((AnItem as TdxPSFileBasedExplorerItem).FullQualifiedFileName, AMode); +end; + +procedure TdxPSFileBasedExplorer.DoLoadData(AFolder: TdxPSExplorerFolder); + + function AddChildFolder(AParent: TdxPSExplorerFolder; const ASearchRec: TSearchRec): TdxPSExplorerFolder; + begin + Result := GetFolderClass.Create(Self, AParent); + Result.Name := ASearchRec.Name; + end; + + function AddChildItem(AParent: TdxPSExplorerFolder; const ASearchRec: TSearchRec; + const AFileName: string): TdxPSExplorerItem; + var + Stream: TStream; + ReportDocument: TdxPSReportDocument; + begin + Result := GetItemClass.Create(Self, AParent); + try + Result.Name := ASearchRec.Name; + + Stream := CreateDataStream(AFileName, smRead); + try + ReportDocument := TBasedxReportLink.ExtractReportDocument(Stream, True); + try + Result.ReportDocument.Assign(ReportDocument); + Result.ReportDocument.Caption := SuppressExtension(Result.Name); + finally + ReportDocument.Free; + end; + finally + Stream.Free; + end; + except + Result.Free; + raise; + end; + end; + + function DoFilterLinkClass(const AFileName: string): Boolean; + var + Stream: TStream; + begin + Result := True; + if FilterLinkClass <> nil then + begin + Stream := CreateDataStream(AFileName, smRead); + try + Result := FilterLinkClass = TBasedxReportLink.ExtractComponentClass(Stream, False); + finally + Stream.Free; + end; + end; + end; + + function IsValidReportFile(const AName: string): Boolean; + begin + Result := HasExtension(AName, '.' + FileExtension) and DoFilterLinkClass(AName); + end; + + function IsDirectoryEmpty(APath: string): Boolean; + var + Found: Integer; + SearchRec: TSearchRec; + begin + Result := True; + Found := FindFirst(APath + '\*.*', faAnyFile, SearchRec); + try + while Found = 0 do + begin + if (SearchRec.Name <> '.') and (SearchRec.Name <> '..') then + begin + Result := not ((SearchRec.Attr and faDirectory <> 0) or IsValidReportFile(APath + '\' + SearchRec.Name)); + if not Result then Break; + end; + Found := FindNext(SearchRec); + end + finally + FindClose(SearchRec); + end; + end; + + procedure LoadDirectory(AParent: TdxPSExplorerFolder; const APath: string); + var + Found: Integer; + SearchRec: TSearchRec; + Folder: TdxPSExplorerFolder; + FileName: string; + begin + Found := SysUtils.FindFirst(APath + '\*.*', faDirectory, SearchRec); + try + while Found = 0 do + begin + if (SearchRec.Name <> '.') and (SearchRec.Name <> '..') then + begin + try + FileName := APath + '\' + SearchRec.Name; + if SearchRec.Attr and faDirectory <> 0 then + begin + Folder := AddChildFolder(AParent, SearchRec); + if eoLoadAll in Options then + LoadDirectory(Folder, FileName) + else + TdxPSExplorerFolderHelper.SetHasChildren(Folder, not IsDirectoryEmpty(FileName)); + end + else + if IsValidReportFile(FileName) then + AddChildItem(AParent, SearchRec, FileName); + except + DoLoadError(SearchRec.Name); + end; + end; + Found := SysUtils.FindNext(SearchRec); + end; + finally + SysUtils.FindClose(SearchRec); + end; + end; + +begin + LoadDirectory(AFolder, TdxPSFileBasedExplorerFolder(AFolder).FullQualifiedDirName); +end; + +procedure TdxPSFileBasedExplorer.DoLoadError(const AName: string); +begin + if Assigned(FOnLoadError) then FOnLoadError(Self, AName); +end; + +procedure TdxPSFileBasedExplorer.RestoreLoadedItem; +begin + if FLastLoadedFileName <> '' then + begin + InternalSetLoadedItem(FindItemByFullQualifiedFileName(FLastLoadedFileName)); + FLastLoadedFileName := ''; + end; +end; + +procedure TdxPSFileBasedExplorer.SaveLoadedItem; +begin + if LoadedItem <> nil then + FLastLoadedFileName := LoadedItem.FullQualifiedFileName + else + FLastLoadedFileName := ''; +end; + +class function TdxPSFileBasedExplorer.GetFolderClass: TdxPSExplorerFolderClass; +begin + Result := TdxPSFileBasedExplorerFolder; +end; + +class function TdxPSFileBasedExplorer.GetRootFolderClass: TdxPSExplorerFolderClass; +begin + Result := TdxPSFileBasedExplorerRootFolder; +end; + +class function TdxPSFileBasedExplorer.GetItemClass: TdxPSExplorerItemClass; +begin + Result := TdxPSFileBasedExplorerItem; +end; + +function TdxPSFileBasedExplorer.GetRegistryPath: string; +begin + if dxPSEngine.RealRegistryPath <> '' then + Result := dxPSEngine.RealRegistryPath + sdxRegistryRootPath + Name + else + Result := ''; +end; + +function TdxPSFileBasedExplorer.GetRootDisplayName: string; +begin + if not Root.IsVolume then + begin + if dxSameText(RealRootPath, RemoveTrailingBackSlash(RootPath)) then + Result := RootPath + else + Result := inherited GetRootDisplayName + ' (' + RealRootPath + ')'; + Result := RemoveTrailingBackSlash(Result); + end + else + Result := Root.VolumeLabel + ' (' + RemoveTrailingBackSlash(RootPath) + ')'; +end; + +procedure TdxPSFileBasedExplorer.MoveTo(AnItem: TCustomdxPSExplorerItem; + AParent: TdxPSExplorerFolder); +begin + BeginIO; + try + inherited; + finally + EndIO; + end; +end; + +procedure TdxPSFileBasedExplorer.BeginIO; +begin + if FIOLockCounter = 0 then IOStatus := mrNone; + Inc(FIOLockCounter); +end; + +procedure TdxPSFileBasedExplorer.EndIO; +begin + Dec(FIOLockCounter); +end; + +procedure TdxPSFileBasedExplorer.CheckIOError(AnIOResult: Boolean); +begin + if not AnIOResult then ProcessIOError; +end; + +procedure TdxPSFileBasedExplorer.ProcessIOError(AnUnconditionalRaiseException: Boolean = False); +begin + if AnUnconditionalRaiseException or (eoShowIOErrors in Options) then + IOError; +end; + +function TdxPSFileBasedExplorer.GetActiveFolder: TdxPSFileBasedExplorerFolder; +begin + Result := inherited ActiveFolder as TdxPSFileBasedExplorerFolder; +end; + +function TdxPSFileBasedExplorer.GetActiveFolderPath: string; +begin + if ActiveFolder <> nil then + Result := ActiveFolder.FullQualifiedDirName + else + Result := ''; +end; + +function TdxPSFileBasedExplorer.GetRealRootPath: string; +begin + if RootPath <> '' then + Result := RootPath + else + Result := GetCurrentDir; + Result := RemoveTrailingBackSlash(Result); +end; + +function TdxPSFileBasedExplorer.GetRoot: TdxPSFileBasedExplorerRootFolder; +begin + Result := inherited Root as TdxPSFileBasedExplorerRootFolder; +end; + +procedure TdxPSFileBasedExplorer.SetActiveFolder(Value: TdxPSFileBasedExplorerFolder); +begin + inherited ActiveFolder := Value; +end; + +procedure TdxPSFileBasedExplorer.SetOptions(Value: TdxPSFileBasedExplorerOptions); +var + ChangedBits: TdxPSFileBasedExplorerOptions; +begin + if FOptions <> Value then + begin + ChangedBits := FOptions + Value - FOptions * Value; + FOptions := Value; + if [eoLoadAll] * ChangedBits <> [] then Refresh; + end; +end; + +procedure TdxPSFileBasedExplorer.SetRootPath(const Value: string); +var + S: string; +begin + S := dxPSUtl.GetLongFileName(Value); + if not dxSameText(FRootPath, S) then + if not dxSameText(RealRootPath, Value) then + begin + BeforeRefresh; + try + FRootPath := S; + Refresh; + finally + AfterRefresh; + end; + end + else + FRootPath := S; +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSFillPatterns.pas b/official/x.35/ExpressPrinting System/Sources/dxPSFillPatterns.pas new file mode 100644 index 00000000..7e71f80f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSFillPatterns.pas @@ -0,0 +1,455 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSFillPatterns; + +interface + +{$I cxVer.inc} + +uses + Classes, Windows, {$IFDEF DELPHI6} Types, {$ENDIF} Graphics, dxBase, + dxPSSngltn; + +type + TdxPSPatternBitRow = Word; + TdxPSPatternBitRows = array[0..7] of TdxPSPatternBitRow; + + TdxPSFillPatternClass = class of TdxPSFillPattern; + + TdxPSFillPattern = class(TPersistent) + public + class procedure Register; virtual; + class procedure Unregister; virtual; + + class procedure Bits(var APattern: TdxPSPatternBitRows); virtual; + class function Dimensions: TSize; virtual; + class function Name: string; virtual; + class function RequiredBrushOrigin: Boolean; virtual; + class function RequiredScaling: Boolean; virtual; + class function Solid: Boolean; virtual; + end; + + TdxPSSolidFillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + class function RequiredBrushOrigin: Boolean; override; + class function RequiredScaling: Boolean; override; + class function Solid: Boolean; override; + end; + + TdxPSGray50FillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSFillPatternItem = class + private + FBitmap: TBitmap; + FBrush: TBrush; + FPattern: TdxPSFillPatternClass; + protected + procedure Initialize(AIsPrinting: Boolean); + public + constructor Create(APattern: TdxPSFillPatternClass; AIsPrinting: Boolean); + destructor Destroy; override; + + property Bitmap: TBitmap read FBitmap; + property Brush: TBrush read FBrush; + property Pattern: TdxPSFillPatternClass read FPattern; + end; + + TdxPSFillPatternFactory = class(TBasedxPSSingleton) + private + FItems: TList; + FPatterns: TdxClassList; + FPrintItems: TList; + + function GetCount: Integer; + function GetInternalItem(Index: Integer; IsPrinting: Boolean): TdxPSFillPatternItem; + function GetItem(Pattern: TdxPSFillPatternClass; IsPrinting: Boolean): TdxPSFillPatternItem; + function GetPattern(Index: Integer): TdxPSFillPatternClass; + procedure SetInternalItem(Index: Integer; IsPrinting: Boolean; Value: TdxPSFillPatternItem); + + procedure AddPattern(APattern: TdxPSFillPatternClass); + procedure RemovePattern(APattern: TdxPSFillPatternClass); + + function HasItem(APattern: TdxPSFillPatternClass): Boolean; + function HasPrintItem(APattern: TdxPSFillPatternClass): Boolean; + + procedure RemovePatternItem(APattern: TdxPSFillPatternClass); + procedure RemovePatternPrintItem(APattern: TdxPSFillPatternClass); + protected + procedure FinalizeInstance; override; + procedure InitializeInstance; override; + function IndexOf(APattern: TdxPSFillPatternClass): Integer; + property InternalItems[Index: Integer; IsPrinting: Boolean]: TdxPSFillPatternItem read GetInternalItem write SetInternalItem; + public + class function Instance: TdxPSFillPatternFactory; reintroduce; overload; + procedure Register(APattern: TdxPSFillPatternClass); + procedure Unregister(APattern: TdxPSFillPatternClass); + + procedure ResetPrintItems; + property Count: Integer read GetCount; + property Items[Pattern: TdxPSFillPatternClass; IsPrinting: Boolean]: TdxPSFillPatternItem read GetItem; default; + property Patterns[Index: Integer]: TdxPSFillPatternClass read GetPattern; + end; + +function dxPSFillPatternFactory: TdxPSFillPatternFactory; + +implementation + +uses + SysUtils, Forms, cxClasses, dxPSRes, dxPrnDev, dxPSUtl; + +function dxPSFillPatternFactory: TdxPSFillPatternFactory; +begin + Result := TdxPSFillPatternFactory.Instance; +end; + +{ TdxPSFillPattern } + +class procedure TdxPSFillPattern.Register; +begin + dxPSFillPatternFactory.Register(Self); +end; + +class procedure TdxPSFillPattern.Unregister; +begin + dxPSFillPatternFactory.Unregister(Self); +end; + +class procedure TdxPSFillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000); +begin + APattern := Bits; +end; + +class function TdxPSFillPattern.Dimensions: TSize; +begin + Result.cX := 8; + Result.cY := 8; +end; + +class function TdxPSFillPattern.Name: string; +begin + Result := ''; +end; + +class function TdxPSFillPattern.RequiredBrushOrigin: Boolean; +begin + Result := True; +end; + +class function TdxPSFillPattern.RequiredScaling: Boolean; +begin + Result := True; +end; + +class function TdxPSFillPattern.Solid: Boolean; +begin + Result := False; +end; + +{ TdxPSSolidFillPattern } + +class procedure TdxPSSolidFillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000); +begin + APattern := Bits; +end; + +class function TdxPSSolidFillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxSolidFillPattern); +end; + +class function TdxPSSolidFillPattern.RequiredBrushOrigin: Boolean; +begin + Result := False; +end; + +class function TdxPSSolidFillPattern.RequiredScaling: Boolean; +begin + Result := False; +end; + +class function TdxPSSolidFillPattern.Solid: Boolean; +begin + Result := True; +end; + +{ TdxPSGray50FillPattern } + +class procedure TdxPSGray50FillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($5555, $AAAA, $5555, $AAAA, $5555, $AAAA, $5555, $AAAA); +begin + APattern := Bits; +end; + +class function TdxPSGray50FillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxGray50FillPattern); +end; + +{ TdxPSFillPatternItem } + +constructor TdxPSFillPatternItem.Create(APattern: TdxPSFillPatternClass; AIsPrinting: Boolean); +begin + inherited Create; + FBitmap := TBitmap.Create; + FBrush := TBrush.Create; + FPattern := APattern; + Initialize(AIsPrinting); +end; + +destructor TdxPSFillPatternItem.Destroy; +begin + FBrush.Free; + FBitmap.Free; + inherited Destroy; +end; + +procedure TdxPSFillPatternItem.Initialize(AIsPrinting: Boolean); + + procedure ScaleBitmap(ABitmap: TBitmap); + var + Numerator, Denominator: Integer; + TempBitmap: TBitmap; + begin + Numerator := GetDeviceCaps(dxPrintDevice.Handle, LOGPIXELSY); + Denominator := Screen.PixelsPerInch; + TempBitmap := TBitmap.Create; + try + TempBitmap.Assign(ABitmap); + ABitmap.Height := ABitmap.Height * Numerator div Denominator; + ABitmap.Width := ABitmap.Width * Numerator div Denominator; + ABitmap.Canvas.StretchDraw(Rect(0, 0, ABitmap.Width, ABitmap.Height), TempBitmap); + finally + TempBitmap.Free; + end; + end; + +const + Colors: array[Boolean] of TColor = (clWhite, clBlack); +var + Size: TSize; + I, J: Integer; + PatternBits: TdxPSPatternBitRows; + PatternRow: TdxPSPatternBitRow; +begin + Size := Pattern.Dimensions; + if Size.cX < 8 then Size.cX := 8; + if Size.cY < 8 then Size.cY := 8; + + with Bitmap, Canvas do + begin + Width := Size.cX; + Height := Size.cY; + Monochrome := True; + Pattern.Bits(PatternBits); + for I := 0 to Size.cY - 1 do + begin + PatternRow := PatternBits[I]; + for J := 0 to Size.cX - 1 do + Pixels[J, I] := Colors[PatternRow and (1 shl J) = 0]; + end; + end; + + if AIsPrinting and Pattern.RequiredScaling then + ScaleBitmap(Bitmap); + Brush.Bitmap := Bitmap; +end; + +{ TdxPSFillPatternFactory } + +class function TdxPSFillPatternFactory.Instance: TdxPSFillPatternFactory; +begin + Result := inherited Instance as TdxPSFillPatternFactory; +end; + +procedure TdxPSFillPatternFactory.Register(APattern: TdxPSFillPatternClass); +begin + if IndexOf(APattern) = -1 then + begin + AddPattern(APattern); + Classes.RegisterClass(APattern); + end; +end; + +procedure TdxPSFillPatternFactory.Unregister(APattern: TdxPSFillPatternClass); +begin + RemovePattern(APattern); + //Classes.UnregisterClass(APattern); +end; + +procedure TdxPSFillPatternFactory.ResetPrintItems; +var + I: Integer; +begin + for I := 0 to FPrintItems.Count - 1 do + begin + TObject(FPrintItems[I]).Free; + FPrintItems[I] := nil; + end; +end; + +procedure TdxPSFillPatternFactory.FinalizeInstance; + + procedure FreeObjectList(AList: TList); + var + I: Integer; + begin + for I := 0 to AList.Count - 1 do + TObject(AList[I]).Free; + AList.Free; + end; + +begin + FreeObjectList(FItems); + FreeObjectList(FPrintItems); + FreeAndNil(FPatterns); + inherited; +end; + +procedure TdxPSFillPatternFactory.InitializeInstance; +begin + inherited; + FItems := TList.Create; + FPatterns := TdxClassList.Create; + FPrintItems := TList.Create; +end; + +function TdxPSFillPatternFactory.IndexOf(APattern: TdxPSFillPatternClass): Integer; +begin + Result := FPatterns.IndexOf(APattern); +end; + +function TdxPSFillPatternFactory.GetCount: Integer; +begin + Result := FPatterns.Count; +end; + +function TdxPSFillPatternFactory.GetInternalItem(Index: Integer; IsPrinting: Boolean): TdxPSFillPatternItem; +begin + if IsPrinting then + Result := TdxPSFillPatternItem(FPrintItems[Index]) + else + Result := TdxPSFillPatternItem(FItems[Index]); +end; + +function TdxPSFillPatternFactory.GetItem(Pattern: TdxPSFillPatternClass; IsPrinting: Boolean): TdxPSFillPatternItem; +var + Index: Integer; +begin + if Pattern <> nil then + begin + Index := IndexOf(Pattern); + if Index = -1 then + raise Exception.CreateFmt(cxGetResourceString(@sdxPatternIsNotRegistered), [Pattern.ClassName]); + if InternalItems[Index, IsPrinting] = nil then + InternalItems[Index, IsPrinting] := TdxPSFillPatternItem.Create(Pattern, IsPrinting); + Result := InternalItems[Index, IsPrinting]; + end + else + Result := nil; +end; + +function TdxPSFillPatternFactory.GetPattern(Index: Integer): TdxPSFillPatternClass; +begin + Result := TdxPSFillPatternClass(FPatterns[Index]); +end; + +procedure TdxPSFillPatternFactory.SetInternalItem(Index: Integer; IsPrinting: Boolean; + Value: TdxPSFillPatternItem); +begin + if IsPrinting then + FPrintItems[Index] := Value + else + FItems[Index] := Value; +end; + +procedure TdxPSFillPatternFactory.AddPattern(APattern: TdxPSFillPatternClass); +begin + FPatterns.Add(APattern); + FItems.Add(nil); + FPrintItems.Add(nil); +end; + +procedure TdxPSFillPatternFactory.RemovePattern(APattern: TdxPSFillPatternClass); +begin + if HasItem(APattern) then RemovePatternItem(APattern); + if HasPrintItem(APattern) then RemovePatternPrintItem(APattern); + FPatterns.Remove(APattern); +end; + +function TdxPSFillPatternFactory.HasItem(APattern: TdxPSFillPatternClass): Boolean; +begin + Result := InternalItems[IndexOf(APattern), False] <> nil; +end; + +function TdxPSFillPatternFactory.HasPrintItem(APattern: TdxPSFillPatternClass): Boolean; +begin + Result := InternalItems[IndexOf(APattern), True] <> nil; +end; + +procedure TdxPSFillPatternFactory.RemovePatternItem(APattern: TdxPSFillPatternClass); +var + Item: TdxPSFillPatternItem; +begin + Item := Items[APattern, False]; + FItems.Remove(Item); + Item.Free; +end; + +procedure TdxPSFillPatternFactory.RemovePatternPrintItem(APattern: TdxPSFillPatternClass); +var + Item: TdxPSFillPatternItem; +begin + Item := Items[APattern, True]; + FPrintItems.Remove(Item); + Item.Free; +end; + +initialization + TdxPSSolidFillPattern.Register; + TdxPSGray50FillPattern.Register; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSForm.pas b/official/x.35/ExpressPrinting System/Sources/dxPSForm.pas new file mode 100644 index 00000000..ab2008a0 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSForm.pas @@ -0,0 +1,372 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSForm; + +interface + +{$I cxVer.inc} + +uses + Windows, Classes, Controls, Messages, Forms, Registry; + +type + TdxPSFormOption = (foSizeableDialog); + TdxPSFormOptions = set of TdxPSFormOption; + + TdxPSFormClass = class of TCustomdxPSForm; + + TCustomdxPSForm = class(TForm) + private + FAreBoundsAssigned: Boolean; + FOptions: TdxPSFormOptions; + function GetActualRegistryPath: string; + function GetGripperBounds: TRect; + + procedure DrawSizeGrip; + procedure InternalLoadPosition(const APath: string); + procedure InternalSavePosition(const APath: string); + function PtInGripperBounds(const Pt: TPoint): Boolean; + procedure SetupHelpEventHandler; + procedure WMNCCreate(var message: TWMNCCreate); message WM_NCCREATE; + procedure WMNCDestroy(var message: TWMNCCreate); message WM_NCDESTROY; + procedure WMNCHitTest(var message: TWMNCHitTest); message WM_NCHITTEST; + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure Paint; override; + procedure Resize; override; + procedure BeforeConstruction; virtual; + function CanLoadFromOrSaveToRegistry: Boolean; virtual; + procedure HelpButtonClick(Sender: TObject); virtual; + function IsFormSizeable: Boolean; virtual; + + property GripperBounds: TRect read GetGripperBounds; + public + destructor Destroy; override; + procedure AfterConstruction; override; + procedure BeforeDestruction; override; + procedure LoadFromRegistry(const APath: string); virtual; + procedure SaveToRegistry(const APath: string); virtual; + + property ActualRegistryPath: string read GetActualRegistryPath; + property AreBoundsAssigned: Boolean read FAreBoundsAssigned; + property Options: TdxPSFormOptions read FOptions write FOptions; + end; + +implementation + +uses + Types, SysUtils, StdCtrls, + {$IFDEF DELPHI7} + Themes, + {$ENDIF} + dxPSGlbl, dxPSUtl, dxPSEngn; + +const + sdxFormLayouts = '\FormLayouts'; // Don't localize + sdxWindowState = 'WindowState'; // Don't localize + sdxLeft = 'Left'; // Don't localize + sdxTop = 'Top'; // Don't localize + sdxWidth = 'Width'; // Don't localize + sdxHeight = 'Height'; // Don't localize + sdxScreenWidth = 'ScreenWidth'; // Don't localize + sdxScreenHeight = 'ScreenHeight'; // Don't localize + +destructor TCustomdxPSForm.Destroy; +begin + inherited; +end; + +procedure TCustomdxPSForm.AfterConstruction; +begin + inherited; + if CanLoadFromOrSaveToRegistry then LoadFromRegistry(ActualRegistryPath); + SetupHelpEventHandler; +end; + +procedure TCustomdxPSForm.BeforeDestruction; +begin + if CanLoadFromOrSaveToRegistry then SaveToRegistry(ActualRegistryPath); + inherited; +end; + +procedure TCustomdxPSForm.LoadFromRegistry(const APath: string); +begin + if dxPSEngine.SaveFormsPosition then InternalLoadPosition(APath); +end; + +procedure TCustomdxPSForm.SaveToRegistry(const APath: string); +begin + if dxPSEngine.SaveFormsPosition then InternalSavePosition(APath); +end; + +procedure TCustomdxPSForm.CreateParams(var Params: TCreateParams); +begin + BeforeConstruction; + inherited; + if foSizeableDialog in Options then + Params.Style := Params.Style or WS_THICKFRAME; + if IsLibrary then // v3 -> Integrate PS into Windows Shell + Params.WndParent := GetForegroundWindow; +end; + +procedure TCustomdxPSForm.Paint; +begin + inherited; + if foSizeableDialog in Options then DrawSizeGrip; +end; + +procedure TCustomdxPSForm.Resize; +begin + inherited; + if foSizeableDialog in Options then Invalidate; +end; + +procedure TCustomdxPSForm.BeforeConstruction; +begin + HelpFile := dxPSEngine.HelpFile; +end; + +function TCustomdxPSForm.CanLoadFromOrSaveToRegistry: Boolean; +begin + Result := dxPSEngine.RealRegistryPath <> ''; +end; + +procedure TCustomdxPSForm.HelpButtonClick(Sender: TObject); +begin + if HelpContext <> 0 then Application.HelpContext(HelpContext); +end; + +function TCustomdxPSForm.IsFormSizeable: Boolean; +begin + Result := HandleAllocated and + (GetWindowLong(Handle, GWL_STYLE) and WS_THICKFRAME = WS_THICKFRAME);// and (dwoSizeable in Options); +end; + +function TCustomdxPSForm.GetActualRegistryPath: string; +begin + Result := dxPSEngine.RealRegistryPath + sdxFormLayouts + '\' + DropT(ClassName); +end; + +function TCustomdxPSForm.GetGripperBounds: TRect; +var + GripSize: Integer; +begin + GripSize := GetSystemMetrics(SM_CXVSCROLL) - 4 * Ord(not dxPSEngine.ThemesEnabled); + Result := Bounds(ClientWidth - GripSize, ClientHeight - GripSize, GripSize, GripSize); +end; + +procedure TCustomdxPSForm.DrawSizeGrip; +begin + {$IFDEF DELPHI7} + if dxPSEngine.ThemesEnabled then + with ThemeServices do + DrawElement(Canvas.Handle, GetElementDetails(tsGripper), GripperBounds) + else + {$ENDIF} + DrawFrameControl(Canvas.Handle, GripperBounds, DFC_SCROLL, DFCS_SCROLLSIZEGRIP); +end; + +procedure TCustomdxPSForm.InternalLoadPosition(const APath: string); +var + Registry: TRegistry; + R: TRect; + ScreenWidth, ScreenHeight: Integer; +begin + Registry := TRegistry.Create; + try + with Registry do + if OpenKey(APath, False) then + try + if ValueExists(sdxWindowState) then + WindowState := TWindowState(ReadInteger(sdxWindowState)); + + R := BoundsRect; + + if ValueExists(sdxLeft) then R.Left := ReadInteger(sdxLeft); + if ValueExists(sdxTop) then R.Top := ReadInteger(sdxTop); + + if IsFormSizeable then + begin + if ValueExists(sdxWidth) then + R.Right := R.Left + ReadInteger(sdxWidth) + else + R.Right := R.Left + Width; + + if ValueExists(sdxHeight) then + R.Bottom := R.Top + ReadInteger(sdxHeight) + else + R.Bottom := R.Top + Height; + end + else + begin + R.Right := R.Left + Width; + R.Bottom := R.Top + Height; + end; + + if WindowState <> wsMaximized then + begin + Position := poDesigned; + if ValueExists(sdxScreenWidth) then + ScreenWidth := ReadInteger(sdxScreenWidth) + else + ScreenWidth := Screen.Width; + if ValueExists(sdxScreenHeight) then + ScreenHeight := ReadInteger(sdxScreenHeight) + else + ScreenHeight := Screen.Height; + + if (Screen.Width <> ScreenWidth) or (Screen.Height <> ScreenHeight) then + begin + if R.Right > Screen.Width then + R.Right := Screen.Width; + if R.Bottom > Screen.Height then + R.Bottom := Screen.Height; + end; + BoundsRect := R; + end; + FAreBoundsAssigned := True; + except + on ERegistryException do + { ignore } + else + raise; + end; + finally + Registry.Free; + end; +end; + +procedure TCustomdxPSForm.InternalSavePosition(const APath: string); +var + Registry: TRegistry; + WindowPlacement: TWindowPlacement; + R: TRect; +begin + Registry := TRegistry.Create; + try + with Registry do + if OpenKey(APath, True) then + try + WriteInteger(sdxScreenWidth, Screen.Width); + WriteInteger(sdxScreenHeight, Screen.Height); + WriteInteger(sdxWindowState, Integer(WindowState)); + + FillChar(WindowPlacement, SizeOf(TWindowPlacement), 0); + WindowPlacement.Length := SizeOf(TWindowPlacement); + if not GetWindowPlacement(Handle, @WindowPlacement) then + Exit; + R := WindowPlacement.rcNormalPosition; + + WriteInteger(sdxLeft, R.Left); + WriteInteger(sdxTop, R.Top); + if IsFormSizeable then + begin + WriteInteger(sdxWidth, R.Right - R.Left); + WriteInteger(sdxHeight, R.Bottom - R.Top); + end; + except + on ERegistryException do + { ignore } + else + raise; + end; + finally + Registry.Free; + end; +end; + +function TCustomdxPSForm.PtInGripperBounds(const Pt: TPoint): Boolean; +begin + Result := PtInRect(GripperBounds, Pt); +end; + +procedure TCustomdxPSForm.SetupHelpEventHandler; +var + Button: TComponent; +begin + Button := FindComponent(sdxHelpButtonName); + if Button is TButton then + TButton(Button).OnClick := HelpButtonClick; +end; + +procedure TCustomdxPSForm.WMNCCreate(var message: TWMNCCreate); +const + TypeDataSize = 32; +var + HasItem: Boolean; + SysMenu: HMENU; + Info: TMenuItemInfo; + P: Pointer; + S: array[0..TypeDataSize - 1] of Char; +begin + HasItem := False; + SysMenu := 0; + if foSizeableDialog in Options then + begin + SysMenu := GetSystemMenu(Handle, False); + Info.cbSize := SizeOf(Info) - SizeOf(HBITMAP); + Info.fMask := MIIM_ID or MIIM_TYPE; + P := @S[0]; + Info.dwTypeData := P; + Info.cch := TypeDataSize; + HasItem := GetMenuItemInfo(SysMenu, SC_SIZE, False, Info); + end; + inherited; + if HasItem then + InsertMenuItem(SysMenu, 0, True, Info); +end; + +procedure TCustomdxPSForm.WMNCDestroy(var message: TWMNCCreate); +begin + if foSizeableDialog in Options then GetSystemMenu(Handle, True); + inherited; +end; + +procedure TCustomdxPSForm.WMNCHitTest(var message: TWMNCHitTest); +var + Pt: TPoint; +begin + inherited; + if foSizeableDialog in Options then + begin + Pt := SmallPointToPoint(message.Pos); + Pt := ScreenToClient(Pt); + if PtInGripperBounds(Pt) then message.Result := HTBOTTOMRIGHT; + end; +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSGlbl.pas b/official/x.35/ExpressPrinting System/Sources/dxPSGlbl.pas new file mode 100644 index 00000000..cd16c3b3 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSGlbl.pas @@ -0,0 +1,789 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSGlbl; + +interface + +(*$HPPEMIT '#include ' *) + +{$I cxVer.inc} + +uses + Classes, Windows, Messages, SysUtils, Graphics, Menus, Dialogs, ExtDlgs; + +type + TDWORDBits = 0..31; + + {$IFNDEF DELPHI6} + PBoolean = ^Boolean; + {$ENDIF} + + + PBooleanArray = ^TBooleanArray; + TBooleanArray = array[0..0] of Boolean; + + PIntArray = ^TIntArray; + TIntArray = array[0..0] of Integer; + + TRects = array of TRect; + TIntegers = array of Integer; + + TdxDriveType = (dtUnknown, dtNoRootDir, dtRemovable, dtFixed, dtRemote, dtCDROM, dtRamDisk); + + TdxPageOrder = (poOverThenDown, poDownThenOver); + + TdxPageNumberFormat = (pnfNumeral, pnfChars, pnfUpperChars, pnfRoman, pnfUpperRoman); + + TdxUpDownGlyph = (udgUp, udgDown); + + TdxPSLookAndFeel = (pslfStandard, pslfFlat, pslfWinXP, pslfOffice11); + + { Moved here from dxPSCore.pas } + TdxTextAlignX = (taLeft, taCenterX, taRight, taJustifyX, taDistributeX); + TdxTextAlignY = (taTop, taCenterY, taBottom, taDistributeY); + + TdxPSVersion = record + Major: Integer; + Minor: Integer; + SubMinor: Integer; + end; + +const + NullPoint: TPoint = (X: 0; Y: 0); + NullRect: TRect = (Left: 0; Top: 0; Right: 0; Bottom: 0); + NullDC = 0; + + {$IFNDEF DELPHI6} + clCream = TColor($A6CAF0); + clMoneyGreen = TColor($C0DCC0); + clSkyBlue = TColor($FFFBF0); + clMedGray = TColor($A4A0A0); + {$ENDIF} + + {$IFDEF DELPHI5} + cMenuSeparator = Menus.cLineCaption; + {$ELSE} + cMenuSeparator = '-'; + {$ENDIF} + cPageRangeSeparator = '-'; + cPageSeparator = ','; + + WM_DX = WM_APP + 100; + WMPS_PRINTSTYLELISTCHANGED = WM_DX + 1; + WMPS_PRINTERLISTCHANGED = WM_DX + 2; + WMPS_INITIALIZEPRINTER = WM_DX + 3; + + GLYPH_UPARROW = 53; + GLYPH_DOWNARROW = 54; + + APPCOMMAND_BROWSER_BACKWARD = 1; + {$EXTERNALSYM APPCOMMAND_BROWSER_BACKWARD} + APPCOMMAND_BROWSER_FORWARD = 2; + {$EXTERNALSYM APPCOMMAND_BROWSER_FORWARD} + APPCOMMAND_BROWSER_HOME = 7; + {$EXTERNALSYM APPCOMMAND_BROWSER_HOME} + APPCOMMAND_HELP = 27; + {$EXTERNALSYM APPCOMMAND_HELP} + APPCOMMAND_FIND = 28; + {$EXTERNALSYM APPCOMMAND_FIND} + APPCOMMAND_NEW = 29; + {$EXTERNALSYM APPCOMMAND_NEW} + APPCOMMAND_OPEN = 30; + {$EXTERNALSYM APPCOMMAND_OPEN} + APPCOMMAND_CLOSE = 31; + {$EXTERNALSYM APPCOMMAND_CLOSE} + APPCOMMAND_SAVE = 32; + {$EXTERNALSYM APPCOMMAND_SAVE} + APPCOMMAND_PRINT = 33; + {$EXTERNALSYM APPCOMMAND_PRINT} + APPCOMMAND_UNDO = 34; + {$EXTERNALSYM APPCOMMAND_UNDO} + APPCOMMAND_REDO = 35; + {$EXTERNALSYM APPCOMMAND_REDO} + APPCOMMAND_COPY = 36; + {$EXTERNALSYM APPCOMMAND_COPY} + APPCOMMAND_CUT = 37; + {$EXTERNALSYM APPCOMMAND_CUT} + APPCOMMAND_PASTE = 38; + {$EXTERNALSYM APPCOMMAND_PASTE} + + FAPPCOMMAND_MOUSE = $00008000; + {$EXTERNALSYM FAPPCOMMAND_MOUSE} + FAPPCOMMAND_KEY = $00000000; + {$EXTERNALSYM FAPPCOMMAND_KEY} + FAPPCOMMAND_OEM = $00001000; + {$EXTERNALSYM FAPPCOMMAND_OEM} + FAPPCOMMAND_MASK = $0000F000; + {$EXTERNALSYM FAPPCOMMAND_MASK} + + {$IFNDEF DELPHI7} + WM_APPCOMMAND = $0319; + {$IFDEF CBUILDER5} + {$EXTERNALSYM WM_APPCOMMAND} + {$ENDIF} + {$ENDIF} + + HDF_SORTDOWN = $0200; + HDF_SORTUP = $0400; + + {$IFDEF CBUILDER6} + {$EXTERNALSYM HDF_SORTDOWN} + {$EXTERNALSYM HDF_SORTUP} + {$ENDIF} + + {$IFNDEF DELPHI7} + CS_DROPSHADOW = $20000; + {$IFDEF CBUILDER6} + {$EXTERNALSYM CS_DROPSHADOW} + {$ENDIF} + + BIF_NEWDIALOGSTYLE = $0040; + {$IFDEF CBUILDER5} + {$EXTERNALSYM BIF_NEWDIALOGSTYLE} + {$ENDIF} + {$ENDIF} + + {$EXTERNALSYM UNLEN} + UNLEN = 256; // Max computer user name (lmcons.h) + + { Cell Sides } + dxFormatLeftSide = $00000001; + dxFormatTopSide = $00000002; + dxFormatRightSide = $00000004; + dxFormatBottomSide = $00000008; + dxFormatRect = $0000000F; + { Horizontal Alignment } + dxFormatTextAlignXOffset = $00000004; + dxFormatTextAlignXLeft = $00000000; + dxFormatTextAlignXCenter = $00000010; + dxFormatTextAlignXRight = $00000020; + dxFormatTextAlignXJustify = $00000030; + dxFormatTextAlignXDistribute = $00000040; + dxFormatTextAlignXMask = + dxFormatTextAlignXLeft or dxFormatTextAlignXCenter or dxFormatTextAlignXRight or + dxFormatTextAlignXJustify or dxFormatTextAlignXDistribute; + { Vertical Alignment } + dxFormatTextAlignYOffset = $00000007; + dxFormatTextAlignYTop = $00000000; + dxFormatTextAlignYCenter = $00000080; + dxFormatTextAlignYBottom = $00000100; + dxFormatTextAlignYDistribute = $00000180; + dxFormatTextAlignYMask = + dxFormatTextAlignYTop or dxFormatTextAlignYCenter or + dxFormatTextAlignYBottom or dxFormatTextAlignYDistribute; + { Text Attributes } + dxFormatEndEllipsis = $00000200; + dxFormatMultiline = $00000400; + dxFormatTransparent = $00000800; + dxFormatBreakByChars = $40000000; + dxFormatHidePrefix = $00080000; + { Checkmark Attributes } + dxFormatCheckChecked = $00001000; + dxFormatCheckEnabled = $00002000; + dxFormatCheckButtonEdgeStyleOffset = $0000000E; + dxFormatCheckEdgeStyleNone = $00000000; + dxFormatCheckEdgeStyle3D = $00004000; + dxFormatCheckEdgeStyleSoft3D = $00008000; + dxFormatCheckEdgeStyleBoldFlat = $0000C000; + dxFormatCheckEdgeStyleUltraFlat = $00010000; + dxFormatCheckEdgeStyleSingle = $00014000; + dxFormatCheckButtonEdgeStyleMask = + dxFormatCheckEdgeStyle3D or dxFormatCheckEdgeStyleSoft3D or + dxFormatCheckEdgeStyleBoldFlat or dxFormatCheckEdgeStyleUltraFlat or + dxFormatCheckEdgeStyleSingle; + dxFormatCheckFlat = $00004000; // obsolete + dxFormatCheckBold = $00008000; // obsolete + { Text Exceeds} + dxFormatPreventLeftTextExceed = $00100000; + dxFormatPreventTopTextExceed = $00200000; + { Sort Order } + dxFormatSortOrderOffset = $00000016; + dxFormatSortNo = $00000000; + dxFormatSortUp = $00400000; + dxFormatSortDown = $00800000; + dxFormatSortOrderMask = dxFormatSortUp or dxFormatSortDown; + { Misc } + dxFormatMakeSpaceForEmptyImage = $01000000; + dxFormatImageTransparent = $02000000; + dxFormatIsTextDrawnForCenteredImage = $10000000; + dxFormatIsTextShiftedForHorizontallyCenteredImage = $20000000; + { Check Mark position } + dxFormatCheckPosOffset = $0000001A; + dxFormatCheckPosLeft = $00000000; + dxFormatCheckPosCenter = $04000000; + dxFormatCheckPosRight = $08000000; + dxFormatCheckPosMask = dxFormatCheckPosCenter or dxFormatCheckPosRight; + dxFormatCheckGlyphCountOffset = $0000001C; + dxFormatCheckGlyphCountMask = $70000000; // we use 3 bits for GlyphCount + { Shadow } + dxFormatShowShadow = $00020000; + { Cliping } + dxFormatExcludeFromClipRgn = $00040000; + dxFormatVisible = $80000000; + { ReportCells } + dxFormatClipChildren = $00080000; + { ReportGroups } + dxFormatOwnBorderClass = $00000200; // dxFormatEndEllipsis + + { Bits Overriding } + { since we don't need some FormatBits for rendering several items we are allowed to safely override them } + + { Image Layout } + { overriden bits ->> dxFormatCheckChecked, dxFormatCheckEnabled, dxFormatCheckEdgeStyleXXX } + dxFormatImageLayoutOffset = $0000000C; + dxFormatImageLayoutTopLeft = $00000000; + dxFormatImageLayoutTopCenter = $00001000; + dxFormatImageLayoutTopRight = $00002000; + dxFormatImageLayoutCenterLeft = $00003000; + dxFormatImageLayoutCenterCenter = $00004000; + dxFormatImageLayoutCenterRight = $00005000; + dxFormatImageLayoutBottomLeft = $00006000; + dxFormatImageLayoutBottomCenter = $00007000; + dxFormatImageLayoutBottomRight = $00008000; + dxFormatImageLayoutMask = + dxFormatImageLayoutTopLeft or dxFormatImageLayoutTopCenter or + dxFormatImageLayoutTopRight or dxFormatImageLayoutCenterLeft or + dxFormatImageLayoutCenterCenter or dxFormatImageLayoutCenterRight or + dxFormatImageLayoutBottomLeft or dxFormatImageLayoutBottomCenter or + dxFormatImageLayoutBottomRight; + { Graphic DrawMode } + { overriden bits ->> Text Horz. Alignment } + dxFormatGraphicDrawModeOffset = $00000004; + dxFormatGraphicDrawModeNone = $00000000; + dxFormatGraphicDrawModeCenter = $00000010; + dxFormatGraphicDrawModeStretch = $00000020; + dxFormatGraphicDrawModeStretchProportional = $00000030; + dxFormatGraphicDrawModeCenterAndStretchProportional = $00000040; + dxFormatGraphicDrawModeMask = + dxFormatGraphicDrawModeCenter or dxFormatGraphicDrawModeStretch or + dxFormatGraphicDrawModeStretchProportional or dxFormatGraphicDrawModeCenterAndStretchProportional; + { Graphic Buffering } + { overriden bits ->> Text Vert. Alignment } + dxFormatGraphicBufferingOffset = $00000007; + dxFormatGraphicBufferingDefault = $00000000; + dxFormatGraphicBufferingNone = $00000080; + dxFormatGraphicBufferingAlways = $00000100; + dxFormatGraphicBufferingMask = + dxFormatGraphicBufferingNone or dxFormatGraphicBufferingAlways; + { Expand Button } + { overriden bits ->> Text Alignment (Horz and Vert), dxFormatEndEllipsis, dxFormatMultiline and dxFormatCheckChecked } + dxFormatExpandButtonBorder3D = $00000010; + dxFormatExpandButtonBorder3DSoft = $00000020; + dxFormatExpandButtonBorderShadow = $00000040; + dxFormatExpandButtonExpanded = $00000080; + dxFormatExpandButtonKeepOddSize = $00000100; + dxFormatExpandButtonTransparent = $00000200; + dxFormatExpandButtonShowBorder = $00000400; + dxFormatExpandButtonVisible = $00001000; + { TreeLines } + { overriden bits ->> dxFormatSortXXX and dxFormatMakeSpaceForEmptyImage } + dxFormatTreeLineModeOffset = $00000016; + dxFormatTreeLineModeNone = $00000000; + dxFormatTreeLineModeVertical = $00400000; + dxFormatTreeLineModeCross = $00800000; + dxFormatTreeLineModeTopRightCorner = $00C00000; + dxFormatTreeLineModeBottomRightCorner = $01000000; + dxFormatTreeLineModeMask = + dxFormatTreeLineModeVertical or dxFormatTreeLineModeCross or + dxFormatTreeLineModeTopRightCorner or dxFormatTreeLineModeBottomRightCorner; + { ExpandButtonEx -> FormatEx codes } + dxFormatExButtonAlignHorzOffset = $00000000; + dxFormatExButtonAlignHorzLeft = $00000000; + dxFormatExButtonAlignHorzCenter = $00000001; + dxFormatExButtonAlignHorzRight = $00000002; + dxFormatExButtonAlignHorzMask = + dxFormatExButtonAlignHorzCenter or dxFormatExButtonAlignHorzRight; + dxFormatExButtonAlignVertOffset = $00000002; + dxFormatExButtonAlignVertTop = $00000000; + dxFormatExButtonAlignVertCenter = $00000004; + dxFormatExButtonAlignVertBottom = $00000008; + dxFormatExButtonAlignVertMask = + dxFormatExButtonAlignVertCenter or dxFormatExButtonAlignVertBottom; + { Shapes } + { overriden bits ->> dxFormatImageLayoutXXX } + dxFormatShapeTransparent = $10000000; + { Report groups } + { overriden bits ->> dxFormatImageLayoutXXX } + dxFormatGroupShowCaption = $10000000; + dxFormatGroupCaptionTransparent = $20000000; + + sdxPSRegPath = 'Software\Developer Express\PrintingSystem'; // Don't localize + sdxPSRegPathCustomColors = '\CustomColors'; // Don't localize + sdxPSRegPathDesignTime = sdxPSRegPath + '\DesignTime'; // Don't localize + sdxPSRegPathRunTime = sdxPSRegPath + '\RunTime'; // Don't localize + sdxPSRegPathRunTimeFormLayouts = '\Developer Express\PrintingSystem\FormLayouts'; // Don't localize + + dxDefaultMinPrintableArea: Integer = 50000; // In thousandths of mm + dxDefaultInitialMargins: TRect = (Left: 12700; Top: 12700; Right: 12700; Bottom: 12700); // In thousandths of mm + dxDefaultPhysicalPaperOffsets: TPoint = (X: 6350; Y: 6350); // In thousandths of mm + dxDefaultInitialHeader: Integer = 6350; // In thousandths of mm + dxDefaultInitialFooter: Integer = 6350; // In thousandths of mm + + dxStyleGlyphSize: TPoint = (X: 32; Y: 32); + + { HelpContext constants } + + { DesignTime } + dxhcAddEmptyLinkDlg: THelpContext = 0; + dxhcAddLinkDlg: THelpContext = 0; + dxhcAddStyleDlg: THelpContext = 0; + dxhcEditDescriptionDlg: THelpContext = 0; + dxhcPrintStylesDesignWindow: THelpContext = 0; + dxhcReportLinkDesignWindow: THelpContext = 0; + + { DesignTime - RunTime } + dxhcCompositionReportLinkDesigner: THelpContext = 0; + dxhcStringGridReportLinkDesigner: THelpContext = 0; + dxhcDrawGridReportLinkDesigner: THelpContext = 0; + dxhcListBoxReportLinkDesigner: THelpContext = 0; + dxhcCheckListBoxReportLinkDesigner: THelpContext = 0; + dxhcListViewReportLinkDesigner: THelpContext = 0; + dxhcTextReportLinkDesigner: THelpContext = 0; + dxhcTreeViewReportLinkDesigner: THelpContext = 0; + dxhcTreeListReportLinkDesigner: THelpContext = 0; + dxhcOrgChartReportLinkDesigner: THelpContext = 0; + dxhcFlowChartReportLinkDesigner: THelpContext = 0; + dxhcInspectorGridReportLinkDesigner: THelpContext = 0; + dxhcMasterViewReportLinkDesigner: THelpContext = 0; + dxhccxMCListBoxReportLinkDesigner: THelpContext = 0; + dxhccxSpreadSheetReportLinkDesigner: THelpContext = 0; + dxhccxGridReportLinkDesigner: THelpContext = 0; + dxhccxTreeListReportLinkDesigner: THelpContext = 0; + dxhccxVerticalGridReportLinkDesigner: THelpContext = 0; + dxhccxSchedulerReportLinkDesigner: THelpContext = 0; + dxhccxPivotGridReportLinkDesigner: THelpContext = 0; + + dxhcPrintDlg: THelpContext = 0; + dxhcPageSetupDlg: THelpContext = 0; + dxhcFEFDlg: THelpContext = 0; + dxhcPreviewPreferencesDlg: THelpContext = 0; + dxhcZoomDlg: THelpContext = 0; + dxhcDefinePrintStyleDlg: THelpContext = 0; + dxhcDateTimeFormatDlg: THelpContext = 0; + dxhcPageNumberFormatDlg: THelpContext = 0; + dxhcTitlePropertiesDlg: THelpContext = 0; + dxhcAutoHFTextEntriesDlg: THelpContext = 0; + dxhcAddItemsToCompositionDlg: THelpContext = 0; + dxhcAddComponentsToComponentPrinterDlg: THelpContext = 0; + dxhcSelectComponentsDlg: THelpContext = 0; + dxhcPrintSetupDlg: THelpContext = 0; + dxhcPSReportPropertiesDlg: THelpContext = 0; + + dxPSGlblVersion = '3.35'; + dxPSVersion: TdxPSVersion = (Major: 0; Minor: 0; SubMinor: 0); + dxPSStorageVersion: Integer = 1; + dxPSInvalidStorageVersion: Integer = -1; + + sdxHelpButtonName = 'btnHelp'; // Don't localize + sdxPSComponentPage = 'ExpressPrinting System'; // Don't localize + +var + AskPrinterForSupportedFonts: Boolean = False; + + IsComCtrlVersion471: Boolean; + IsComCtrlVersion500: Boolean; + IsComCtrlVersion600: Boolean; + + IsDesignTime: Boolean = False; + + IsWin95Or98: Boolean; + IsWinMeOr2K: Boolean; + IsWin2KOrXP: Boolean; + IsWinXP: Boolean; + IsWinNT: Boolean; + + CheckHeight: Integer; + CheckWidth: Integer; + + PathDelimiter: Char; + PercentSymbol: Char = '%' ; //TODO: move up + + PSCanShowHintFunc: function: Boolean = nil; + +function CanShowHints: Boolean; +function GetPSRegRoot: string; +function dxPSVer: Integer; +function dxPSVerMajor: Integer; +function dxPSVerMinor: Integer; +function dxPSVerSubMinor: Integer; +function dxPSVersionString: string; + +function ColorDialog: TColorDialog; +function FontDialog: TFontDialog; +function FontDialogDevice: TFontDialogDevice; + +function StringToPSVersion(AVersion: string; const ASeparator: string = '.'): TdxPSVersion; +function ComparePSVersions(V1, V2: TdxPSVersion): Integer; + +function GET_APPCOMMAND_LPARAM(lParam: LPARAM): Integer; +{$EXTERNALSYM GET_APPCOMMAND_LPARAM} +function GET_DEVICE_LPARAM(lParam: LPARAM): Integer; +{$EXTERNALSYM GET_DEVICE_LPARAM} +function GET_MOUSEORKEY_LPARAM(lParam: LPARAM): Integer; +{$EXTERNALSYM GET_MOUSEORKEY_LPARAM} +function GET_FLAGS_LPARAM(lParam: LPARAM): Integer; +{$EXTERNALSYM GET_FLAGS_LPARAM} +function GET_KEYSTATE_LPARAM(lParam: LPARAM): Integer; +{$EXTERNALSYM GET_KEYSTATE_LPARAM} + +implementation + +uses + Registry, ComCtrls, dxPSUtl, dxPSEngn, dxPrnDev; + +{$IFNDEF DELPHI7} +const + {$IFNDEF DELPHI5} + ComCtlVersionIE5 = $00050000; + {$ENDIF} + ComCtlVersionIE6 = $00060000; +{$ENDIF} + +var + FColorDialog: TColorDialog; + FFontDialog: TFontDialog; + +function CanShowHints: Boolean; +begin + Result := not Assigned(PSCanShowHintFunc) or PSCanShowHintFunc; +end; + +function GetPSRegRoot: string; +const + Paths: array[Boolean] of string = (sdxPSRegPathRunTime, sdxPSRegPathDesignTime); +begin + Result := Paths[IsDesignTime]; +end; + +function dxPSVer: Integer; +begin + Result := dxPSVersion.Major; +end; + +function dxPSVerMajor: Integer; +begin + Result := dxPSVersion.Major; +end; + +function dxPSVerMinor: Integer; +begin + Result := dxPSVersion.Minor; +end; + +function dxPSVerSubMinor: Integer; +begin + Result := dxPSVersion.SubMinor; +end; + +function dxPSVersionString: string; +begin + Result := dxPSGlblVersion; +end; + +{ TdxPSColorDialog } + +type + TdxPSColorDialog = class(TColorDialog) + private + function GetRegistryPath: string; + protected + procedure RestoreCustomColors; + procedure SaveCustomColors; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property RegistryPath: string read GetRegistryPath; + end; + +constructor TdxPSColorDialog.Create(AOwner: TComponent); +begin + inherited; + Options := Options + [cdFullOpen]; + if RegistryPath <> '' then RestoreCustomColors; +end; + +destructor TdxPSColorDialog.Destroy; +begin + if RegistryPath <> '' then SaveCustomColors; + inherited; +end; + +procedure TdxPSColorDialog.RestoreCustomColors; +var + Registry: TRegistry; + Path, S: string; + Strings: TStringList; + I: Integer; +begin + Registry := TRegistry.Create; + with Registry do + try + Path := RegistryPath; + if OpenKey(Path, False) then + begin + CustomColors.Clear; + Strings := TStringList.Create; + try + GetValueNames(Strings); + for I := 0 to Strings.Count - 1 do + begin + S := Strings[I]; + if ValueExists(S) then + try + S := S + '=' + ReadString(S); + except + on ERegistryException do + Continue + else + raise; + end; + ColorDialog.CustomColors.Add(S); + end; + finally + Strings.Free; + end; + end; + finally + Free; + end; +end; + +procedure TdxPSColorDialog.SaveCustomColors; +var + Registry: TRegistry; + Path, S: string; + I, P: Integer; +begin + Registry := TRegistry.Create; + with Registry do + try + Path := RegistryPath; + if KeyExists(Path) then + DeleteKey(Path); + + if OpenKey(Path, True) then + for I := 0 to ColorDialog.CustomColors.Count - 1 do + begin + S := CustomColors[I]; + P := Pos('=', S); + if P <> 0 then + begin + S := Copy(S, 1, P - 1); + try + WriteString(S, ColorDialog.CustomColors.Values[S]); + except + on ERegistryException do + else + raise; + end; + end; + end; + finally + Free; + end; +end; + +function TdxPSColorDialog.GetRegistryPath: string; +begin + Result := dxPSEngn.dxPSEngine.RealRegistryPath; + if Result <> '' then + Result := Result + sdxPSRegPathCustomColors; +end; + +function ColorDialog: TColorDialog; +begin + if FColorDialog = nil then + FColorDialog := TdxPSColorDialog.Create(nil); + Result := FColorDialog; +end; + +{ TdxPSFontDialog } + +type + TdxPSFontDialog = class(TFontDialog) + public + constructor Create(AOwner: TComponent); override; + function Execute: Boolean; override; + end; + +constructor TdxPSFontDialog.Create(AOwner: TComponent); +begin + inherited; + Options := [fdEffects, fdScalableOnly, fdTrueTypeOnly]; +end; + +function TdxPSFontDialog.Execute: Boolean; +begin + Device := FontDialogDevice; + Result := inherited Execute; +end; + +function FontDialog: TFontDialog; +begin + if FFontDialog = nil then + FFontDialog := TdxPSFontDialog.Create(nil); + Result := FFontDialog; +end; + +function FontDialogDevice: TFontDialogDevice; +begin + if AskPrinterForSupportedFonts and dxPrnDev.dxInitPrintDevice(False) then + Result := fdPrinter + else + Result := fdScreen; +end; + +function GET_APPCOMMAND_LPARAM(lParam: LPARAM): Integer; +begin + Result := Shortint(HiWord(lParam) and not FAPPCOMMAND_MASK); +end; + +function GET_DEVICE_LPARAM(lParam: LPARAM): Integer; +begin + Result := Word(HiWord(lParam) and FAPPCOMMAND_MASK); +end; + +function GET_MOUSEORKEY_LPARAM(lParam: LPARAM): Integer; +begin + Result := GET_DEVICE_LPARAM(lParam); +end; + +function GET_FLAGS_LPARAM(lParam: LPARAM): Integer; +begin + Result := LoWord(lParam); +end; + +function GET_KEYSTATE_LPARAM(lParam: LPARAM): Integer; +begin + Result := GET_FLAGS_LPARAM(lParam); +end; + +function StringToPSVersion(AVersion: string; const ASeparator: string = '.'): TdxPSVersion; + + function GetVersionFromPos(var AVersion: string): Integer; + var + ACode: Integer; + ANextPos: Integer; + begin + ANextPos := Pos(ASeparator, AVersion); + if (ANextPos = 0) then + ANextPos := Length(AVersion) + 1; + Val(Copy(AVersion, 1, ANextPos - 1), Result, ACode); + AVersion := Copy(AVersion, ANextPos + 1, MaxInt); + end; + +begin + Result.Major := GetVersionFromPos(AVersion); + Result.Minor := GetVersionFromPos(AVersion); + Result.SubMinor := GetVersionFromPos(AVersion); +end; + +function ComparePSVersions(V1, V2: TdxPSVersion): Integer; + + function ComparePart(I1, I2: Integer): Integer; + begin + if I1 > I2 then + Result := 1 + else + if I1 < I2 then + Result := -1 + else + Result := 0; + end; + +begin + Result := ComparePart(V1.Major, V2.Major); + if Result = 0 then + begin + Result := ComparePart(V1.Minor, V2.Minor); + if Result = 0 then + Result := ComparePart(V1.SubMinor, V2.SubMinor); + end; +end; + +procedure InitVersionInfo; +begin + dxPSVersion := StringToPSVersion(dxPSGlblVersion); +end; + +procedure InitPlatform; +begin + IsWin95Or98 := Win32Platform = VER_PLATFORM_WIN32_WINDOWS; + IsWinNT := (Win32Platform = VER_PLATFORM_WIN32_NT) and (Win32MajorVersion >= 4); + IsWinMeOr2K := ((Win32Platform = VER_PLATFORM_WIN32_WINDOWS) and (Win32MajorVersion >= 90)) or + ((Win32Platform = VER_PLATFORM_WIN32_NT) and (Win32MajorVersion >= 5)); + IsWin2KOrXP := (Win32Platform = VER_PLATFORM_WIN32_NT) and (Win32MajorVersion >= 5); + IsWinXP := (Win32Platform = VER_PLATFORM_WIN32_NT) and (Win32MajorVersion >= 5) and (Win32MinorVersion > 0); +end; + +procedure InitComCtlrs; +begin + IsComCtrlVersion471 := ComCtrls.GetComCtlVersion >= ComCtlVersionIE401; + IsComCtrlVersion500 := ComCtrls.GetComCtlVersion >= ComCtlVersionIE5; + IsComCtrlVersion600 := ComCtrls.GetComCtlVersion >= ComCtlVersionIE6; +end; + +procedure InitGlobalConsts; +begin + with TBitmap.Create do + try + Handle := LoadBitmap(0, PChar(OBM_CHECKBOXES)); + + CheckWidth := Width div 4; + CheckHeight := Height div 3; + finally + Free; + end; + + {$IFDEF DELPHI6} + PathDelimiter := SysUtils.PathDelim; + {ELSE} + PathDelimiter := '\'; + {$ENDIF} + +end; + +initialization + InitPlatform; + InitComCtlrs; + InitGlobalConsts; + InitVersionInfo; + +finalization + FreeAndNil(FColorDialog); + FreeAndNil(FFontDialog); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSGrLnks.pas b/official/x.35/ExpressPrinting System/Sources/dxPSGrLnks.pas new file mode 100644 index 00000000..a2a0c551 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSGrLnks.pas @@ -0,0 +1,722 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSGrLnks; + +interface + +{$I cxVer.inc} + +uses + Windows, Forms, Classes, Graphics, StdCtrls, Grids, dxPSCore, dxPSBaseGridLnk, + dxPSGlbl; + +type + TdxGridPaintOption = (gpoBorder, gpoHorzLines, gpoVertLines, gpoFixedHorzLines, gpoFixedVertLines); + TdxGridPaintOptions = set of TdxGridPaintOption; + + TCustomdxGridReportLink = class(TAbstractdxGridReportLink) + private + FOptions: TdxGridPaintOptions; + function GetCustomGrid: TCustomGrid; + function GetOptions: TdxGridPaintOptions; + procedure SetOptions(Value: TdxGridPaintOptions); + protected + FSourceFontIndex: Integer; + procedure InternalRestoreDefaults; override; + procedure InternalRestoreFromOriginal; override; + + function GetColCount: Integer; override; + function GetFixedColCount: Integer; override; + function GetFixedRowCount: Integer; override; + function GetRowCount: Integer; override; + + function GetSelectionRect: TRect; override; + function GetSourceCellColor(ACol, ARow: Integer): TColor; override; + function GetSourceCellEdgeMode(ACol, ARow: Integer): TdxCellEdgeMode; override; + function GetSourceCellFont(ACol, ARow: Integer): TFont; override; + function GetSourceCellFontIndex(ACol, ARow: Integer): Integer; override; + function GetSourceCellTransparent(ACol, ARow: Integer): Boolean; override; + function GetSourceColWidth(ACol: Integer): Integer; override; + function GetSourceRowHeight(ARow: Integer): Integer; override; + + function IsDrawBorder: Boolean; override; + function IsDrawFixedHorzLines: Boolean; override; + function IsDrawFixedVertLines: Boolean; override; + function IsDrawHorzLines: Boolean; override; + function IsDrawVertLines: Boolean; override; + + procedure PrepareConstruct(AReportCells: TdxReportCells); override; + + property CustomGrid: TCustomGrid read GetCustomGrid; + public + procedure Assign(Source: TPersistent); override; + + property AutoWidth; + property DrawMode; + property Effects3D; + property EvenColor; + property EvenFont; + property FixedColor; + property FixedFont; + property FixedTransparent; + property GridLineColor; + property HeadersOnEveryPage; + property IncludeFixed; + property OddColor; + property OddFont; + property OnlySelected; + property Options: TdxGridPaintOptions read GetOptions write SetOptions + default [gpoBorder, gpoHorzLines, gpoVertLines, gpoFixedHorzLines, gpoFixedVertLines]; + property Soft3D; + property SupportedCustomDraw; + property Transparent; + end; + + TdxCustomDrawItemEvent = procedure(Sender: TBasedxReportLink; + Index: Integer; ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; + var AText: string; AFont: TFont; var AColor: TColor; + var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean) of object; + + TdxCustomListBoxReportLink = class(TAbstractdxGridReportLink) + private + FCustomDrawFontChanged: Boolean; + FIsWidthAssigned: Boolean; + FSaveFont: TFont; + FTextAlignX: TdxTextAlignX; + FTextAlignY: TdxTextAlignY; + FWidth: Integer; + FOnCustomDrawItem: TdxCustomDrawItemEvent; + function GetWidth: Integer; + function IsWidthStored: Boolean; + procedure SetTextAlignX(Value: TdxTextAlignX); + procedure SetTextAlignY(Value: TdxTextAlignY); + procedure SetWidth(Value: Integer); + procedure CustomDrawFontChanged(Sender: TObject); + protected + procedure CustomDraw(AItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); override; + procedure DoCustomDrawItem(Index: Integer; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var AText: string; AFont: TFont; + var AColor: TColor; var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean); virtual; + procedure InternalRestoreDefaults; override; + procedure InternalRestoreFromOriginal; override; + function IsSupportedCustomDraw(AItem: TAbstractdxReportCellData): Boolean; override; + + function GetColCount: Integer; override; + function GetRowCount: Integer; override; + + function GetCellSides(ACol, ARow: Integer): TdxCellSides; override; + function GetCellText(ACol, ARow: Integer): string; override; + function GetCellTextAlignX(ACol, ARow: Integer): TdxTextAlignX; override; + function GetCellTextAlignY(ACol, ARow: Integer): TdxTextAlignY; override; + function GetSourceColWidth(ACol: Integer): Integer; override; + function GetSourceRowHeight(ARow: Integer): Integer; override; + function GetSelectedColCount: Integer; override; + function GetSelectedRowCount: Integer; override; + function HasSelection: Boolean; override; + function HasSelectionInRow(ARow: Integer): Boolean; override; + function IsDrawBorder: Boolean; override; + function IsDrawHorzLines: Boolean; override; + function IsSelectedCell(ACol, ARow: Integer): Boolean; override; + function IsSelectedRow(ARow: Integer): Boolean; override; + + function GetCustomListBox: TCustomListBox; virtual; + + property CustomListBox: TCustomListBox read GetCustomListBox; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function DefaultWidth: Integer; virtual; + + property AutoWidth; + property DrawMode; + property EndEllipsis; + property GridLineColor; + property OnlySelected; + property SupportedCustomDraw; + property TextAlignX: TdxTextAlignX read FTextAlignX write SetTextAlignX default taLeft; + property TextAlignY: TdxTextAlignY read FTextAlignY write SetTextAlignY default taCenterY; + property Width: Integer read GetWidth write SetWidth stored IsWidthStored; + property OnCustomDrawItem: TdxCustomDrawItemEvent read FOnCustomDrawItem write FOnCustomDrawItem; + end; + +const + dxDefaultGridPaintOptions: TdxGridPaintOptions = + [gpoBorder, gpoHorzLines, gpoVertLines, gpoFixedHorzLines, gpoFixedVertLines]; + dxDefaultListBoxWidth = 400; + +implementation + +uses + dxPSRes, SysUtils, dxPSUtl; + +type + TCustomGridAccess = class(TCustomGrid); + TCustomListBoxAccess = class(TCustomListBox); + +{ CustomGrid Helpers } + +function GridGetColCount(ACustomGrid: TCustomGrid): Integer; +begin + Result := TCustomGridAccess(ACustomGrid).ColCount; +end; + +function GridGetColor(ACustomGrid: TCustomGrid): TColor; +begin + Result := TCustomGridAccess(ACustomGrid).Color; +end; + +function GridGetColWidth(ACustomGrid: TCustomGrid; AColIndex: Integer): Integer; +begin + Result := TCustomGridAccess(ACustomGrid).ColWidths[AColIndex]; +end; + +function GridGetFixedColor(ACustomGrid: TCustomGrid): TColor; +begin + Result := TCustomGridAccess(ACustomGrid).FixedColor; +end; + +function GridGetFixedCols(ACustomGrid: TCustomGrid): Integer; +begin + Result := TCustomGridAccess(ACustomGrid).FixedCols; +end; + +function GridGetFixedRows(ACustomGrid: TCustomGrid): Integer; +begin + Result := TCustomGridAccess(ACustomGrid).FixedRows; +end; + +function GridGetFont(ACustomGrid: TCustomGrid): TFont; +begin + Result := TCustomGridAccess(ACustomGrid).Font; +end; + +function GridGetOptions(ACustomGrid: TCustomGrid): TGridOptions; +begin + Result := TCustomGridAccess(ACustomGrid).Options; +end; + +function GridGetBorderStyle(ACustomGrid: TCustomGrid): TBorderStyle; +begin + Result := TCustomGridAccess(ACustomGrid).BorderStyle; +end; + +function GridGetRowCount(ACustomGrid: TCustomGrid): Integer; +begin + Result := TCustomGridAccess(ACustomGrid).RowCount; +end; + +function GridGetRowHeight(ACustomGrid: TCustomGrid; ARowIndex: Integer): Integer; +begin + Result := TCustomGridAccess(ACustomGrid).RowHeights[ARowIndex]; +end; + +function GridGetSelection(ACustomGrid: TCustomGrid): TRect; +begin + Result := TRect(TCustomGridAccess(ACustomGrid).Selection); +end; + +{ CustomListBox Helpers } + +function ListBoxGetItemHeight(ACustomListBox: TCustomListBox): Integer; +begin + Result := TCustomListBoxAccess(ACustomListBox).ItemHeight; +end; + +function ListBoxGetItemText(ACustomListBox: TCustomListBox; AnIndex: Integer): string; +begin + Result := TCustomListBoxAccess(ACustomListBox).Items[AnIndex]; +end; + +function ListBoxGetStyle(ACustomListBox: TCustomListBox): TListBoxStyle; +begin + Result := TCustomListBoxAccess(ACustomListBox).Style; +end; + +function ListBoxMeasureItem(ACustomListBox: TCustomListBox; AnIndex: Integer): Integer; +begin + TCustomListBoxAccess(ACustomListBox).MeasureItem(AnIndex, Result); +end; + + +{ TCustomdxGridReportLink } + +procedure TCustomdxGridReportLink.Assign(Source: TPersistent); +begin + inherited; + if Source is TCustomdxGridReportLink then + Options := TCustomdxGridReportLink(Source).Options; +end; + +procedure TCustomdxGridReportLink.InternalRestoreDefaults; +begin + inherited; + Options := dxDefaultGridPaintOptions; {[Low(TdxDrawGridPaintOption)..High(TdxDrawGridPaintOption)]} +end; + +procedure TCustomdxGridReportLink.InternalRestoreFromOriginal; + + procedure XorOption(var AOptions: TdxGridPaintOptions; AElement: TdxGridPaintOption; + Value: Boolean); + begin + if Value then + AOptions := AOptions + [AElement] + else + AOptions := AOptions - [AElement]; + end; + +var + Opt: TdxGridPaintOptions; +begin + inherited; + FixedColor := GridGetFixedColor(CustomGrid); + Opt := Options; + XorOption(Opt, gpoFixedVertLines, goFixedVertLine in GridGetOptions(CustomGrid)); + XorOption(Opt, gpoFixedHorzLines, goFixedHorzLine in GridGetOptions(CustomGrid)); + XorOption(Opt, gpoVertLines, goVertLine in GridGetOptions(CustomGrid)); + XorOption(Opt, gpoHorzLines, goHorzLine in GridGetOptions(CustomGrid)); + XorOption(Opt, gpoBorder, GridGetBorderStyle(CustomGrid) <> bsNone); + Options := Opt; +end; + +function TCustomdxGridReportLink.IsDrawBorder: Boolean; +begin + Result := gpoBorder in Options; +end; + +function TCustomdxGridReportLink.IsDrawHorzLines: Boolean; +begin + Result := gpoHorzLines in Options; +end; + +function TCustomdxGridReportLink.IsDrawVertLines: Boolean; +begin + Result := gpoVertLines in Options; +end; + +function TCustomdxGridReportLink.IsDrawFixedHorzLines: Boolean; +begin + Result := gpoFixedHorzLines in Options; +end; + +function TCustomdxGridReportLink.IsDrawFixedVertLines: Boolean; +begin + Result := gpoFixedVertLines in Options; +end; + +function TCustomdxGridReportLink.GetColCount: Integer; +begin + Result := GridGetColCount(CustomGrid); +end; + +function TCustomdxGridReportLink.GetSourceColWidth(ACol: Integer): Integer; +begin + Result := GridGetColWidth(CustomGrid, ACol); +end; + +function TCustomdxGridReportLink.GetSourceRowHeight(ARow: Integer): Integer; +begin + Result := GridGetRowHeight(CustomGrid, ARow); +end; + +function TCustomdxGridReportLink.GetFixedColCount: Integer; +begin + Result := GridGetFixedCols(CustomGrid); +end; + +function TCustomdxGridReportLink.GetFixedRowCount: Integer; +begin + Result := GridGetFixedRows(CustomGrid); +end; + +function TCustomdxGridReportLink.GetRowCount: Integer; +begin + Result := GridGetRowCount(CustomGrid); +end; + +function TCustomdxGridReportLink.GetSelectionRect: TRect; +begin + Result := GridGetSelection(CustomGrid); +end; + +function TCustomdxGridReportLink.GetSourceCellColor(ACol, ARow: Integer): TColor; +begin + if IsFixedCell(ACol, ARow) then + Result := GridGetFixedColor(CustomGrid) + else + Result := GridGetColor(CustomGrid); +end; + +function TCustomdxGridReportLink.GetSourceCellEdgeMode(ACol, ARow: Integer): TdxCellEdgeMode; +const + EdgeModes: array[Boolean] of TdxCellEdgeMode = (cemPattern, cem3DEffects); +begin + Result := EdgeModes[IsFixedCell(ACol, ARow)]; +end; + +function TCustomdxGridReportLink.GetSourceCellFont(ACol, ARow: Integer): TFont; +begin + Result := GridGetFont(CustomGrid); +end; + +function TCustomdxGridReportLink.GetSourceCellFontIndex(ACol, ARow: Integer): Integer; +begin + Result := FSourceFontIndex; +end; + +function TCustomdxGridReportLink.GetSourceCellTransparent(ACol, ARow: Integer): Boolean; +begin + Result := not IsFixedCell(ACol, ARow); +end; + +procedure TCustomdxGridReportLink.PrepareConstruct(AReportCells: TdxReportCells); +begin + inherited; + FSourceFontIndex := AddFontToPool(GridGetFont(CustomGrid)); +end; + +function TCustomdxGridReportLink.GetCustomGrid: TCustomGrid; +begin + Result := TCustomGrid(Component); +end; + +function TCustomdxGridReportLink.GetOptions: TdxGridPaintOptions; +begin + Result := FOptions; +end; + +procedure TCustomdxGridReportLink.SetOptions(Value: TdxGridPaintOptions); +begin + if FOptions <> Value then + begin + FOptions := Value; + LinkModified(True); + end; +end; + +{ TdxCustomListBoxReportLink } + +constructor TdxCustomListBoxReportLink.Create(AOwner: TComponent); +begin + inherited; + FTextAlignX := taLeft; + FTextAlignY := taCenterY; + FSaveFont := TFont.Create; + FSaveFont.OnChange := CustomDrawFontChanged; +end; + +destructor TdxCustomListBoxReportLink.Destroy; +begin + FreeAndNil(FSaveFont); + inherited; +end; + +procedure TdxCustomListBoxReportLink.Assign(Source: TPersistent); +begin + if Source is TdxCustomListBoxReportLink then + with TdxCustomListBoxReportLink(Source) do + begin + Self.FIsWidthAssigned := FIsWidthAssigned; + Self.AutoWidth := AutoWidth; + Self.TextAlignX := TextAlignX; + Self.TextAlignY := TextAlignY; + Self.Width := Width; + end; + inherited; +end; + +function TdxCustomListBoxReportLink.DefaultWidth: Integer; +begin + Result := dxDefaultListBoxWidth; +end; + +function TdxCustomListBoxReportLink.GetCustomListBox: TCustomListBox; +begin + Result := TCustomListBox(Component); +end; + +function TdxCustomListBoxReportLink.IsSelectedCell(ACol, ARow: Integer): Boolean; +begin + Result := IsSelectedRow(ARow); +end; + +function TdxCustomListBoxReportLink.IsSelectedRow(ARow: Integer): Boolean; +begin + Result := HasSelection and CustomListBox.Selected[ARow]; +end; + +procedure TdxCustomListBoxReportLink.CustomDraw(AItem: TAbstractdxReportCellData; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); +var + AColor: TColor; + AText: string; + ATextAlignX: TdxTextAlignX; + ATextAlignY: TdxTextAlignY; +begin + with TdxReportCellString(AItem) do + begin + AColor := ColorToRGB(Color); + if Transparent then AColor := clNone; + FSaveFont.Assign(Font); + FCustomDrawFontChanged := False; + AText := Text; + ATextAlignX := TextAlignX; + ATextAlignY := TextAlignY; + DoCustomDrawItem(AItem.Parent.Index, ACanvas, ABoundsRect, AClientRect, AText, + FSaveFont, AColor, ATextAlignX, ATextAlignY, ADone); + if not ADone then + begin + if FCustomDrawFontChanged then + begin + SelectObject(ACanvas.Handle, FSaveFont.Handle); + SetTextColor(ACanvas.Handle, ColorToRGB(FSaveFont.Color)); + FontIndex := -1; + end; + if AColor <> clNone then + begin + Color := AColor; + AItem.Transparent := False; + end; + Text := AText; + TextAlignX := ATextAlignX; + TextAlignY := ATextAlignY; + end; + end; +end; + +procedure TdxCustomListBoxReportLink.DoCustomDrawItem(Index: Integer; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var AText: string; + AFont: TFont; var AColor: TColor; var ATextAlignX: TdxTextAlignX; + var ATextAlignY: TdxTextAlignY; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawItem) then + FOnCustomDrawItem(Self, Index, ACanvas, ABoundsRect, AClientRect, AText, + AFont, AColor, ATextAlignX, ATextAlignY, ADone); +end; + +procedure TdxCustomListBoxReportLink.InternalRestoreDefaults; +begin + inherited; + TextAlignX := dxPSCore.dxDefaultTextAlignX; {taLeft} + TextAlignY := dxPSCore.dxDefaultTextAlignY; {taCenterY} + FIsWidthAssigned := False; +end; + +procedure TdxCustomListBoxReportLink.InternalRestoreFromOriginal; +begin + inherited; + Width := CustomListBox.Width; +end; + +function TdxCustomListBoxReportLink.IsSupportedCustomDraw(AItem: TAbstractdxReportCellData): Boolean; +begin + Result := inherited IsSupportedCustomDraw(AItem) and Assigned(FOnCustomDrawItem); +end; + +function TdxCustomListBoxReportLink.GetColCount: Integer; +begin + Result := 1; +end; + +function TdxCustomListBoxReportLink.GetRowCount: Integer; +begin + Result := CustomListBox.Items.Count; +end; + +function TdxCustomListBoxReportLink.GetCellText(ACol, ARow: Integer): string; +begin + Result := ListBoxGetItemText(CustomListBox, ARow); +end; + +function TdxCustomListBoxReportLink.GetCellTextAlignX(ACol, ARow: Integer): TdxTextAlignX; +begin + Result := FTextAlignX; +end; + +function TdxCustomListBoxReportLink.GetCellTextAlignY(ACol, ARow: Integer): TdxTextAlignY; +begin + Result := FTextAlignY; +end; + +function TdxCustomListBoxReportLink.GetCellSides(ACol, ARow: Integer): TdxCellSides; + + function IsFirstItem(AItemIndex: Integer): Boolean; + var + I: Integer; + begin + if not OnlySelected or (CustomListBox.SelCount = 0) then + Result := AItemIndex = 0 + else + begin + for I := 0 to CustomListBox.Items.Count - 1 do + if CustomListBox.Selected[I] then + begin + Result := AItemIndex = I; + Exit; + end; + Result := False; + end; + end; + + function IsLastItem(AItemIndex: Integer): Boolean; + var + I: Integer; + begin + if not OnlySelected or (CustomListBox.SelCount = 0) then + Result := AItemIndex = CustomListBox.Items.Count - 1 + else + begin + for I := CustomListBox.Items.Count - 1 downto 0 do + if CustomListBox.Selected[I] then + begin + Result := AItemIndex = I; + Exit; + end; + Result := False; + end; + end; + +begin + Result := csAll; + if not IsDrawBorder then + begin + Result := Result - [csLeft, csRight]; + if IsFirstItem(ARow) then Exclude(Result, csTop); + if IsLastItem(ARow) then Exclude(Result, csBottom); + end; + if not IsDrawHorzLines then + begin + if not IsFirstItem(ARow) then Exclude(Result, csTop); + if not IsLastItem(ARow) then Exclude(Result, csBottom); + end; +end; + +function TdxCustomListBoxReportLink.GetSelectedColCount: Integer; +begin + Result := 1; +end; + +function TdxCustomListBoxReportLink.GetSelectedRowCount: Integer; +begin + Result := CustomListBox.SelCount; +end; + +function TdxCustomListBoxReportLink.GetSourceColWidth(ACol: Integer): Integer; +begin + if IsAggregated then + Result := CustomListBox.Width + else + Result := Width; +end; + +function TdxCustomListBoxReportLink.GetSourceRowHeight(ARow: Integer): Integer; +begin + Result := 4 + ListBoxGetItemHeight(CustomListBox); + if ListBoxGetStyle(CustomListBox) = lbOwnerDrawVariable then + Result := ListBoxMeasureItem(CustomListBox, ARow); + if Result < 2 then Result := 2; +end; + +function TdxCustomListBoxReportLink.HasSelection: Boolean; +begin + Result := inherited HasSelection and (CustomListBox.SelCount > 0); +end; + +function TdxCustomListBoxReportLink.HasSelectionInRow(ARow: Integer): Boolean; +begin + Result := IsSelectedRow(ARow); +end; + +function TdxCustomListBoxReportLink.IsDrawBorder: Boolean; +begin + Result := True; +end; + +function TdxCustomListBoxReportLink.IsDrawHorzLines: Boolean; +begin + Result := True; +end; + +function TdxCustomListBoxReportLink.GetWidth: Integer; +begin + if FIsWidthAssigned then + Result := FWidth + else + Result := DefaultWidth; +end; + +function TdxCustomListBoxReportLink.IsWidthStored: Boolean; +begin + Result := FIsWidthAssigned and (Width <> DefaultWidth); +end; + +procedure TdxCustomListBoxReportLink.SetTextAlignX(Value: TdxTextAlignX); +begin + if FTextAlignX <> Value then + begin + FTextAlignX := Value; + LinkModified(True); + end; +end; + +procedure TdxCustomListBoxReportLink.SetTextAlignY(Value: TdxTextAlignY); +begin + if FTextAlignY <> Value then + begin + FTextAlignY := Value; + LinkModified(True); + end; +end; + +procedure TdxCustomListBoxReportLink.SetWidth(Value: Integer); +begin + if FWidth <> Value then + begin + FIsWidthAssigned := True; + FWidth := Value; + if not AutoWidth then LinkModified(True); + end; +end; + +procedure TdxCustomListBoxReportLink.CustomDrawFontChanged(Sender: TObject); +begin + FCustomDrawFontChanged := True; +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSGraphicLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSGraphicLnk.pas new file mode 100644 index 00000000..0a0dcd6a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSGraphicLnk.pas @@ -0,0 +1,525 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSGraphicLnk; + +interface + +{$I cxVer.inc} + +uses + Classes, Windows, Graphics, ExtCtrls, dxPSGlbl, dxPSCore, dxBkgnd; + +type + TCustomdxGraphicReportLink = class(TBasedxReportLink) + private + FBorderColor: TColor; + FCenter: Boolean; + FDrawBorder: Boolean; + FProportional: Boolean; + FStretch: Boolean; + FTransparentColor: TColor; + procedure SetBorderColor(Value: TColor); + procedure SetCenter(Value: Boolean); + procedure SetDrawBorder(Value: Boolean); + procedure SetProportional(Value: Boolean); + procedure SetStretch(Value: Boolean); + procedure SetTransparentColor(Value: TColor); + protected + function GetAlwaysBufferedGraphics: Boolean; override; + function GetCriticalSize(AReportCells: TdxReportCells): Integer; override; + function CalculateActualScaleFactor: Integer; override; + procedure ConstructReport(AReportCells: TdxReportCells); override; + procedure InternalRestoreDefaults; override; + + function GetGraphic: TGraphic; virtual; + function GetGraphicClass: TGraphicClass; virtual; + function GetGraphicHeight: Integer; virtual; + function GetGraphicWidth: Integer; virtual; + function GetDrawMode: TdxGraphicDrawMode; virtual; + procedure InitializeGraphicItem(AnItem: TdxReportCellGraphic); virtual; + + property BorderColor: TColor read FBorderColor write SetBorderColor default clBlack; + property Center: Boolean read FCenter write SetCenter default False; + property DrawBorder: Boolean read FDrawBorder write SetDrawBorder default False; + property DrawMode: TdxGraphicDrawMode read GetDrawMode; + property GraphicHeight: Integer read GetGraphicHeight; + property GraphicWidth: Integer read GetGraphicWidth; + property Proportional: Boolean read FProportional write SetProportional default False; + property Stretch: Boolean read FStretch write SetStretch default False; + property TransparentColor: TColor read FTransparentColor write SetTransparentColor default clWindow; + public + constructor Create(AOwner: TComponent); override; + procedure Assign(Source: TPersistent); override; + class function Aggregable: Boolean; override; + end; + + TCustomdxPictureReportLink = class(TCustomdxGraphicReportLink) + protected + function GetGraphic: TGraphic; override; + function GetGraphicHeight: Integer; override; + function GetGraphicWidth: Integer; override; + function GetPicture: TPicture; virtual; + + property Picture: TPicture read GetPicture; + public + function DataProviderPresent: Boolean; override; + end; + + TdxPictureReportLink = class(TCustomdxPictureReportLink) + private + FPicture: TPicture; + procedure SetPicture(Value: TPicture); + procedure PictureChanged(Sender: TObject); + protected + function GetPicture: TPicture; override; + procedure SetComponent(Value: TComponent); override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + published + property BorderColor; + property DrawBorder; + property Picture write SetPicture; + property Transparent; + property TransparentColor; + end; + +implementation + +uses + SysUtils, cxClasses, dxPSUtl, dxPSRes; + +const + CellSidesMap: array[Boolean] of TdxCellSides = ([], csAll); + +{ TCustomdxGraphicReportLink } + +constructor TCustomdxGraphicReportLink.Create(AOwner: TComponent); +begin + inherited; + FBorderColor := dxDefaultGridLineColor; + FCenter := False; + FDrawBorder := False; + FProportional := False; + FStretch := False; + FTransparentColor := clWindow; +end; + +procedure TCustomdxGraphicReportLink.Assign(Source: TPersistent); +begin + inherited; + if Source is TCustomdxGraphicReportLink then + with TCustomdxGraphicReportLink(Source) do + begin + Self.BorderColor := BorderColor; + Self.Center := Center; + Self.DrawBorder := DrawBorder; + Self.Proportional := Proportional; + Self.Stretch := Stretch; + Self.TransparentColor := TransparentColor; + end; +end; + +class function TCustomdxGraphicReportLink.Aggregable: Boolean; +begin + Result := True;//}False; +end; + +function TCustomdxGraphicReportLink.GetAlwaysBufferedGraphics: Boolean; +begin + Result := False; +end; + +function TCustomdxGraphicReportLink.GetCriticalSize(AReportCells: TdxReportCells): Integer; +begin + with AReportCells.BoundsRect do + begin + Result := Right - Left; + if Result < Bottom - Top then + Result := Bottom - Top; + end; +end; + +function TCustomdxGraphicReportLink.CalculateActualScaleFactor: Integer; +var + PaintW, PaintH: Integer; +begin + if (ReportWidth <> 0) and (ReportHeight <> 0) then + begin + with RealPrinterPage do + begin + PaintW := PaintRectLoMetric.Right - PaintRectLoMetric.Left; + PaintH := PaintRectLoMetric.Bottom - PaintRectLoMetric.Top; + if ReportTitle.Mode <> tmNone then + Dec(PaintH, MulDiv(Renderer.RenderInfo.TitleHeight, 254, FUnitsPerInch)); + + PaintW := FitToPagesByWide * MulDiv(PaintW, FUnitsPerInch, 254); + PaintH := FitToPagesByTall * MulDiv(PaintH, FUnitsPerInch, 254); + end; + if ReportWidth / ReportHeight > PaintW / PaintH then + Result := MulDiv(PaintW, 100, ReportWidth) - 1 + else + Result := MulDiv(PaintH, 100, ReportHeight) - 1; + end + else + Result := 1; +end; + +procedure TCustomdxGraphicReportLink.ConstructReport(AReportCells: TdxReportCells); +var + Graphic: TGraphic; + Cell: TdxReportCell; + Data: TdxReportCellGraphic; +begin + inherited; + Graphic := GetGraphic; + if Graphic <> nil then + try + AReportCells.Cells.Color := Color; + AReportCells.Cells.CellSides := CellSidesMap[DrawBorder]; + AReportCells.BorderColor := BorderColor; + + Cell := TdxReportCell.Create(AReportCells.Cells); + Cell.CellSides := []; + + Data := TdxReportCellGraphic.Create(Cell); + Data.BoundsRect := MakeRect(0, 0, GraphicWidth, GraphicHeight); + Data.Image := Graphic; + InitializeGraphicItem(Data); + + Cell.BoundsRect := Data.BoundsRect; + AReportCells.Cells.BoundsRect := Cell.BoundsRect; + AReportCells.DoProgress(100); + finally + Graphic.Free; + end; +end; + +procedure TCustomdxGraphicReportLink.InternalRestoreDefaults; +begin + inherited; + BorderColor := dxDefaultGridLineColor; + Center := False; + DrawBorder := False; + Proportional := False; + Stretch := False; + TransparentColor := clWindow; +end; + +function TCustomdxGraphicReportLink.GetGraphic: TGraphic; +begin + Result := nil; +end; + +function TCustomdxGraphicReportLink.GetGraphicClass: TGraphicClass; +begin + Result := nil; +end; + +function TCustomdxGraphicReportLink.GetGraphicHeight: Integer; +var + Graphic: TGraphic; +begin + Graphic := GetGraphic; + if Graphic <> nil then + try + Result := Graphic.Height; + finally + Graphic.Free; + end + else + Result := 0; +end; + +function TCustomdxGraphicReportLink.GetGraphicWidth: Integer; +var + Graphic: TGraphic; +begin + Graphic := GetGraphic; + if Graphic <> nil then + try + Result := Graphic.Width; + finally + Graphic.Free; + end + else + Result := 0; +end; + +function TCustomdxGraphicReportLink.GetDrawMode: TdxGraphicDrawMode; +begin + if Stretch then + if Proportional then + if Center then + Result := gdmCenterAndStretchProportional + else + Result := gdmStretchProportional + else + Result := gdmStretch + else + if Center then + Result := gdmCenter + else + Result := gdmNone; +end; + +procedure TCustomdxGraphicReportLink.InitializeGraphicItem(AnItem: TdxReportCellGraphic); +const + ImageBufferingMap: array[Boolean] of TdxCellImageBuffering = (cibAlways, cibNone); +begin + AnItem.Color := Color; + AnItem.CellSides := CellSidesMap[DrawBorder]; + AnItem.ImageBuffering := ImageBufferingMap[(GetGraphicClass <> nil) and GetGraphicClass.InheritsFrom(TMetafile)]; + AnItem.ImageTransparent := Transparent; + AnItem.Transparent := True; +end; + +procedure TCustomdxGraphicReportLink.SetBorderColor(Value: TColor); +begin + if FBorderColor <> Value then + begin + FBorderColor := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxGraphicReportLink.SetCenter(Value: Boolean); +begin + if FCenter <> Value then + begin + FCenter := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxGraphicReportLink.SetDrawBorder(Value: Boolean); +begin + if FDrawBorder <> Value then + begin + FDrawBorder := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxGraphicReportLink.SetProportional(Value: Boolean); +begin + if FProportional <> Value then + begin + FProportional := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxGraphicReportLink.SetStretch(Value: Boolean); +begin + if FStretch <> Value then + begin + FStretch := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxGraphicReportLink.SetTransparentColor(Value: TColor); +begin + if FTransparentColor <> Value then + begin + FTransparentColor := Value; + LinkModified(True); + end; +end; + +{ TCustomdxPictureReportLink } + +function TCustomdxPictureReportLink.DataProviderPresent: Boolean; +begin + if DataSource = rldsComponent then + Result := (Picture <> nil) and (Picture.Graphic <> nil) and not Picture.Graphic.Empty + else + Result := inherited DataProviderPresent; +end; + +function TCustomdxPictureReportLink.GetGraphic: TGraphic; + + function CalculateGraphicBounds(ADest, AGraphic: TGraphic): TRect; + var + X, Y, V: Integer; + begin + case DrawMode of + gdmNone, + gdmCenter: + begin + Result := MakeBounds(0, 0, AGraphic.Width, AGraphic.Height); + if DrawMode = gdmCenter then + begin + X := Result.Left + (ADest.Width - AGraphic.Width) div 2; + Y := Result.Top + (ADest.Height - AGraphic.Height) div 2; + OffsetRect(Result, X, Y); + end; + end; + + gdmStretchProportional, + gdmCenterAndStretchProportional: + begin + if AGraphic.Width / AGraphic.Height > ADest.Width / ADest.Height then + begin + V := MulDiv(AGraphic.Height, ADest.Width, AGraphic.Width); + Result := MakeBounds(0, 0, ADest.Width, V); + end + else + begin + V := MulDiv(AGraphic.Width, ADest.Height, AGraphic.Height); + Result := MakeBounds(0, 0, V, ADest.Height); + end; + if DrawMode = gdmCenterAndStretchProportional then + if Result.Right - Result.Left = ADest.Width then + OffsetRect(Result, 0, (ADest.Height - (Result.Bottom - Result.Top)) div 2) + else + OffsetRect(Result, (ADest.Width - (Result.Right - Result.Left)) div 2, 0); + end; + else // gdmStretch + Result := MakeBounds(0, 0, ADest.Width, ADest.Height); + end; + end; + +var + R: TRect; +begin + if DataProviderPresent then + begin + Result := TBitmap.Create; + with TBitmap(Result) do + try + Height := GraphicHeight; + Width := GraphicWidth; + if Self.Transparent then + begin + Canvas.Brush.Color := TransparentColor; + Canvas.FillRect(MakeRect(0, 0, Width, Height)); + end; + if Picture.Graphic <> nil then + begin + R := CalculateGraphicBounds(Result, Picture.Graphic); + Canvas.StretchDraw(R, Picture.Graphic); + end; + + Transparent := Self.Transparent; + if Transparent then + TransparentColor := Self.TransparentColor; + HandleType := bmDIB; + except + Free; + raise; + end + end + else + Result := inherited GetGraphic; +end; + +function TCustomdxPictureReportLink.GetGraphicHeight: Integer; +begin + if Picture <> nil then + Result := Picture.Height + else + Result := inherited GetGraphicHeight; +end; + +function TCustomdxPictureReportLink.GetGraphicWidth: Integer; +begin + if Picture <> nil then + Result := Picture.Width + else + Result := inherited GetGraphicWidth; +end; + +function TCustomdxPictureReportLink.GetPicture: TPicture; +begin + Result := nil; +end; + +{ TdxPictureReportLink } + +constructor TdxPictureReportLink.Create(AOwner: TComponent); +begin + inherited; + ReportDocument.Description := cxGetResourceString(@sdxTPicture); + Transparent := False; + FPicture := TPicture.Create; + FPicture.OnChange := PictureChanged; + LinkModified(False); +end; + +destructor TdxPictureReportLink.Destroy; +begin + FreeAndNil(FPicture); + inherited; +end; + +procedure TdxPictureReportLink.Assign(Source: TPersistent); +begin + inherited; + if Source is TdxPictureReportLink then + Picture := TdxPictureReportLink(Source).Picture; +end; + +function TdxPictureReportLink.GetPicture: TPicture; +begin + Result := FPicture; +end; + +procedure TdxPictureReportLink.SetPicture(Value: TPicture); +begin + Picture.Assign(Value); +end; + +procedure TdxPictureReportLink.SetComponent(Value: TComponent); +begin +end; + +procedure TdxPictureReportLink.PictureChanged(Sender: TObject); +begin + LinkModified(True); + DesignerModified; + DesignerUpdate(False); +end; + +initialization + dxPSRegisterReportLink(TdxPictureReportLink, nil, nil); + +finalization + dxPSUnregisterReportLink(TdxPictureReportLink, nil, nil); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSHFToolBarBld.pas b/official/x.35/ExpressPrinting System/Sources/dxPSHFToolBarBld.pas new file mode 100644 index 00000000..c27ec1a7 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSHFToolBarBld.pas @@ -0,0 +1,175 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire coVisntents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSHFToolBarBld; + +interface + +{$I cxVer.inc} + +uses + Classes, ComCtrls, Controls, ImgList; + +type + TdxPSHFToolBarBuilder = class + public + class procedure Build(AToolBar: TToolBar; + AImageList: TCustomImageList; + AIncludeAutoTextEntries: Boolean; AFunctionList, AAutoHFTextEntries: TStrings; + AOnButtonClick, AOnAutoTextEntriesClick: TNotifyEvent; ACenteringToolbar: Boolean); + class procedure ShowAutoHFTextEntriesPopup(Sender: TObject); + end; + +implementation + +uses + Windows, ExtCtrls, Buttons, Menus, Graphics, SysUtils, cxClasses, dxPSGlBl, + dxPSUtl, dxPgSDlg, dxPSRes, dxPSPopupMan; + +var + FDropDownGlyph: TBitmap; + +class procedure TdxPSHFToolBarBuilder.Build(AToolBar: TToolBar; + AImageList: TCustomImageList; AIncludeAutoTextEntries: Boolean; + AFunctionList, AAutoHFTextEntries: TStrings; AOnButtonClick, + AOnAutoTextEntriesClick: TNotifyEvent; ACenteringToolbar: Boolean); +var + S: string; + DC: HDC; + TextSize: TSize; + MenuButton: TSpeedButton; + AutoHFTextEntriesPopup: TPopupMenu; + MenuItem: TMenuItem; + I, SummaryWidth, MaxButtonCount, MenuButtonWidth: Integer; +begin + while AToolBar.ButtonCount > 0 do + AToolBar.Buttons[0].Free; + + S := cxGetResourceString(@sdxMenuInsertAutoTextEntriesSubItem); + + MenuButtonWidth := 0; + if AIncludeAutoTextEntries then + begin + DC := GetDC(0); + GetTextExtentPoint32(DC, PChar(S), Length(S), TextSize); + ReleaseDC(0, DC); + MenuButtonWidth := 3 * 2 + TextSize.cX + 16; + end; + + if AFunctionList.Count > 0 then + begin + AImageList.AllocBy := AFunctionList.Count; + for I := 0 to AFunctionList.Count - 1 do + with TdxHFCustomFunction(AFunctionList.Objects[I]) do + if (Glyph <> nil) and not Glyph.Empty then + AImageList.AddMasked(Glyph, Glyph.Canvas.Pixels[0, Glyph.Height - 1]); + AToolBar.Images := AImageList; + + SummaryWidth := MenuButtonWidth + AToolBar.ButtonWidth * AFunctionList.Count + 4; + if SummaryWidth > AToolBar.Parent.Width - 4 then + begin + SummaryWidth := AToolBar.Parent.Width - 4; + MaxButtonCount := (SummaryWidth - 4 - MenuButtonWidth) div AToolBar.ButtonWidth; + SummaryWidth := MenuButtonWidth + MaxButtonCount * AToolBar.ButtonWidth + 4; + end + else + MaxButtonCount := AFunctionList.Count; + + AToolBar.Width := SummaryWidth; + if ACenteringToolbar then + AToolBar.Left := (AToolBar.Parent.Width - AToolBar.Width) div 2; + + for I := 0 to MaxButtonCount - 1 do + with TToolButton.Create(AToolBar) do + begin + Parent := AToolBar; + Tag := MakeTTag(I); + ImageIndex := Integer(Tag); + Hint := TdxHFCustomFunction(AFunctionList.Objects[I]).Hint; + OnClick := AOnButtonClick; + end; + end; + + if AIncludeAutoTextEntries then + begin + MenuButton := TSpeedButton.Create(AToolBar); + MenuButton.Parent := AToolBar; + MenuButton.SetBounds(0, 0, MenuButtonWidth, AToolBar.Height); + MenuButton.Caption := S; + MenuButton.Layout := blGlyphRight; + MenuButton.Glyph := FDropDownGlyph; + + AutoHFTextEntriesPopup := TPopupMenu.Create(AToolBar); + {$IFDEF DELPHI5} + AutoHFTextEntriesPopup.AutoHotkeys := maManual; + {$ENDIF} + if AAutoHFTextEntries <> nil then + for I := 0 to AAutoHFTextEntries.Count - 1 do + begin + MenuItem := TMenuItem.Create(AToolBar); + MenuItem.Caption := AAutoHFTextEntries[I]; + MenuItem.Tag := MakeTTag(I); + MenuItem.OnClick := AOnAutoTextEntriesClick; + AutoHFTextEntriesPopup.Items.Add(MenuItem); + end; + + MenuButton.Tag := MakeTTag(AutoHFTextEntriesPopup); + MenuButton.OnClick := ShowAutoHFTextEntriesPopup; + end; + + AToolBar.Visible := AToolBar.ButtonCount > 0; +end; + +class procedure TdxPSHFToolBarBuilder.ShowAutoHFTextEntriesPopup(Sender: TObject); +var + Button: TControl; +begin + Button := TControl(Sender); + if TTagToObj(Button.Tag) is TPopupMenu then + dxPSPopupMenuController.ShowPopup(Button.ClientOrigin.X, Button.ClientOrigin.Y + Button.Height, + nil, TPopupMenu(TTagToObj(Button.Tag))); +end; + +initialization + FDropDownGlyph := CreateArrowBitmap(udgDown, 12); + +finalization + FreeAndNil(FDropDownGlyph); + +end. + + + + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSImgLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSImgLnk.pas new file mode 100644 index 00000000..8d347aa9 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSImgLnk.pas @@ -0,0 +1,136 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSImgLnk; + +interface + +{$I cxVer.inc} + +uses + Graphics, ExtCtrls, dxPSGraphicLnk; + +type + TdxImageReportLink = class(TCustomdxPictureReportLink) + private + function GetImage: TImage; + protected + procedure InternalRestoreFromOriginal; override; + + function GetGraphicHeight: Integer; override; + function GetGraphicWidth: Integer; override; + function GetPicture: TPicture; override; + public + function DataProviderPresent: Boolean; override; + property Image: TImage read GetImage; + published + property BorderColor; + property Center; + property DrawBorder; + property Proportional; + property Stretch; + property Transparent; + property TransparentColor; + end; + +implementation + +uses + dxPSCore; + +function TdxImageReportLink.DataProviderPresent: Boolean; +begin + if DataSource = rldsComponent then + Result := Image <> nil + else + Result := inherited DataProviderPresent; +end; + +procedure TdxImageReportLink.InternalRestoreFromOriginal; +begin + inherited; + Center := Image.Center; + {$IFDEF DELPHI6} + Proportional := Image.Proportional; + {$ENDIF} + Stretch := Image.Stretch; +end; + +function TdxImageReportLink.GetGraphicHeight: Integer; +begin + if Image <> nil then + begin + Result := Image.Height; + // 3.2 + //if IsAggregated and (Result < inherited GetGraphicHeight) then + // Result := inherited GetGraphicHeight; + end + else + Result := inherited GetGraphicHeight; +end; + +function TdxImageReportLink.GetGraphicWidth: Integer; +begin + if Image <> nil then + begin + Result := Image.Width; + // 3.2 + //if IsAggregated and (Result < inherited GetGraphicWidth) then + // Result := inherited GetGraphicWidth; + end + else + Result := inherited GetGraphicWidth; +end; + +function TdxImageReportLink.GetPicture: TPicture; +begin + if Image <> nil then + Result := Image.Picture + else + Result := inherited GetPicture; +end; + +function TdxImageReportLink.GetImage: TImage; +begin + Result := TImage(Component); +end; + +initialization + dxPSRegisterReportLink(TdxImageReportLink, TImage, nil); + +finalization + dxPSUnregisterReportLink(TdxImageReportLink, TImage, nil); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSImgs.pas b/official/x.35/ExpressPrinting System/Sources/dxPSImgs.pas new file mode 100644 index 00000000..cb95db2b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSImgs.pas @@ -0,0 +1,117 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSImgs; + +interface + +{$I cxVer.inc} + +const + // Bitmaps + IDB_DXPSPRINT = 'IDB_DXPSPRINT'; + IDB_DXPSPREVIEW = 'IDB_DXPSPREVIEW'; + IDB_DXPSPAGESETUP = 'IDB_DXPSPAGESETUP'; + IDB_DXPSWEB = 'IDB_DXPSWEB'; + IDB_DXPSREPORTDESIGNER = 'IDB_DXPSREPORTDESIGNER'; + IDB_DXPSREPORTPROPERTIES = 'IDB_DXPSREPORTPROPERTIES'; + + IDB_DXPSDEFINEPRINTSTYLES = 'IDB_DXPSDEFINEPRINTSTYLES'; + IDB_DXPSPRINTSTYLE_STANDARD = 'IDB_DXPSPRINTSTYLE_STANDARD'; + IDB_DXPSPRINTSTYLE_MEMO = 'IDB_DXPSPRINTSTYLE_MEMO'; + + IDB_DXPSBKTEXTURES = 'IDB_DXPSBKTEXTURES'; + IDB_DXPSBKPATTERNS = 'IDB_DXPSBKPATTERNS'; + + IDB_DXPSSELECTMANYPAGES = 'IDB_DXPSSELECTMANYPAGES'; + IDB_DXPSWARNINGSIGN = 'IDB_DXPSWARNINGSIGN'; + + IDB_DXPSFUNCTION_PAGENUMBER = 'IDB_DXPSFUNCTION_PAGENUMBER'; + IDB_DXPSFUNCTION_TOTALPAGES = 'IDB_DXPSFUNCTION_TOTALPAGES'; + IDB_DXPSFUNCTION_PAGENUMBEROFPAGES = 'IDB_DXPSFUNCTION_PAGENUMBEROFPAGES'; + IDB_DXPSFUNCTION_DATETIME = 'IDB_DXPSFUNCTION_DATETIME'; + IDB_DXPSFUNCTION_DATE = 'IDB_DXPSFUNCTION_DATE'; + IDB_DXPSFUNCTION_TIME = 'IDB_DXPSFUNCTION_TIME'; + IDB_DXPSFUNCTION_USERNAME = 'IDB_DXPSFUNCTION_USERNAME'; + IDB_DXPSFUNCTION_MACHINENAME = 'IDB_DXPSFUNCTION_MACHINENAME'; + + IDB_DXPSPREVIEW_ANCHORSCROLLFULL = 'IDB_DXPSPREVIEW_ANCHORSCROLLFULL'; + IDB_DXPSPREVIEW_ANCHORSCROLLHORZ = 'IDB_DXPSPREVIEW_ANCHORSCROLLHORZ'; + IDB_DXPSPREVIEW_ANCHORSCROLLVERT = 'IDB_DXPSPREVIEW_ANCHORSCROLLVERT'; + + IDB_DXPSEXPLORERITEM_SMALL = 'IDB_DXPSEXPLORERITEM_SMALL'; + IDB_DXPSEXPLORERITEM_LARGE = 'IDB_DXPSEXPLORERITEM_LARGE'; + IDB_DXPSEXPLORERITEM_COMPOSITIONSMALL = 'IDB_DXPSEXPLORERITEM_COMPOSITIONSMALL'; + IDB_DXPSEXPLORERITEM_INVALID = 'IDB_DXPSEXPLORERITEM_INVALID'; + + IDB_DXPSREFRESH = 'IDB_DXPSREFRESH'; + IDB_DXPSGOTOUPONELEVEL = 'IDB_DXPSGOTOUPONELEVEL'; + IDB_DXPSCOPY = 'IDB_DXPSCOPY'; + IDB_DXPSSAVE = 'IDB_DXPSSAVE'; + + IDB_DXPSDRAWMODE_STRICT = 'IDB_DXPSDRAWMODE_STRICT'; + IDB_DXPSDRAWMODE_ODDEVEN = 'IDB_DXPSDRAWMODE_ODDEVEN'; + IDB_DXPSDRAWMODE_CHESS = 'IDB_DXPSDRAWMODE_CHESS'; + IDB_DXPSDRAWMODE_BORROW = 'IDB_DXPSDRAWMODE_BORROW'; + + IDB_DXPSCARBMW760LI = 'IDB_DXPSCARBMW760LI'; + IDB_DXPSCARLOGOS = 'IDB_DXPSCARLOGOS'; + + // Cursors + IDC_DXPSPREVIEW_MARGINSMOVEHORZ = 'IDC_DXPSPREVIEW_MARGINSMOVEHORZ'; + IDC_DXPSPREVIEW_MARGINSMOVEVERT = 'IDC_DXPSPREVIEW_MARGINSMOVEVERT'; + IDC_DXPSPREVIEW_ZOOMIN = 'IDC_DXPSPREVIEW_ZOOMIN'; + IDC_DXPSPREVIEW_ZOOMOUT = 'IDC_DXPSPREVIEW_ZOOMOUT'; + IDC_DXPSPREVIEW_SCROLLFULL = 'IDC_DXPSPREVIEW_SCROLLFULL'; + IDC_DXPSPREVIEW_SCROLLHORZ = 'IDC_DXPSPREVIEW_SCROLLHORZ'; + IDC_DXPSPREVIEW_SCROLLVERT = 'IDC_DXPSPREVIEW_SCROLLVERT'; + IDC_DXPSPREVIEW_WHEELSCROLLUP = 'IDC_DXPSPREVIEW_WHEELSCROLLUP'; + IDC_DXPSPREVIEW_WHEELSCROLLRIGHT = 'IDC_DXPSPREVIEW_WHEELSCROLLRIGHT'; + IDC_DXPSPREVIEW_WHEELSCROLLDOWN = 'IDC_DXPSPREVIEW_WHEELSCROLLDOWN'; + IDC_DXPSPREVIEW_WHEELSCROLLLEFT = 'IDC_DXPSPREVIEW_WHEELSCROLLLEFT'; + IDC_DXPSPREVIEW_WHEELSCROLLTOPRIGHT = 'IDC_DXPSPREVIEW_WHEELSCROLLTOPRIGHT'; + IDC_DXPSPREVIEW_WHEELSCROLLTOPLEFT = 'IDC_DXPSPREVIEW_WHEELSCROLLTOPLEFT'; + IDC_DXPSPREVIEW_WHEELSCROLLBOTTOMRIGHT = 'IDC_DXPSPREVIEW_WHEELSCROLLBOTTOMRIGHT'; + IDC_DXPSPREVIEW_WHEELSCROLLBOTTOMLEFT = 'IDC_DXPSPREVIEW_WHEELSCROLLBOTTOMLEFT'; + +implementation + +{$R dxPSImgs.res} + +(* + {$R dxPSImgs.res} +*) + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSImgs.res b/official/x.35/ExpressPrinting System/Sources/dxPSImgs.res new file mode 100644 index 00000000..4084eab3 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Sources/dxPSImgs.res differ diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSLVLnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSLVLnk.dfm new file mode 100644 index 00000000..b1ec1764 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSLVLnk.dfm @@ -0,0 +1,699 @@ +object dxfmLVReportLinkDesignWindow: TdxfmLVReportLinkDesignWindow + Left = 489 + Top = 374 + BorderStyle = bsDialog + Caption = 'dxfmLVReportLinkDesignWindow' + ClientHeight = 354 + ClientWidth = 555 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 38 + Width = 547 + Height = 281 + ActivePage = tshColor + MultiLine = True + TabOrder = 0 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = 'Options' + object pnlOptions: TPanel + Left = 0 + Top = 0 + Width = 539 + Height = 253 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblShow: TLabel + Left = 5 + Top = 12 + Width = 26 + Height = 13 + Caption = 'Show' + end + object Bevel11: TBevel + Left = 40 + Top = 17 + Width = 194 + Height = 4 + Shape = bsBottomLine + end + object imgGrid: TImage + Left = 6 + Top = 37 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object Bevel1: TBevel + Left = 89 + Top = 98 + Width = 145 + Height = 4 + Shape = bsBottomLine + end + object lblOnEveryPage: TLabel + Left = 5 + Top = 147 + Width = 72 + Height = 13 + Caption = 'On Every Page' + end + object Image1: TImage + Left = 6 + Top = 174 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888777777777777777708888888888 + 888887FFFFFFFFFFFFFFF08888888888888887F7777777777777F07777708888 + 888887F7777777777777F0FFFFF08888888887F7777777777777F07777F07777 + 708887FFFFFFFFFFFFFFF07777F0FFFFF08887F777777777777FF07777F07777 + F08887FFFFFFFFFFFFFFF0FFFFF07777F08887F77777777777FFF077FFF07777 + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777777FFFFF0777FF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777FFFFFFFF07FFFF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF0777FF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF077FFF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777777F077FFF077FF + F08887F7777777777777F0FFFFF0FFFFF08887F7777777777777F0FFFFF07FFF + F08887FFFFFFFFFFFFFFF07777F0FFFFF0888000000000000000007777F077FF + F08888888887F7777777777777F0FFFFF08888888887FFFFFFFFFFFFFFF07777 + F0888888888000000000000000007777F08888888888888887F7777777777777 + F08888888888888887FFFFFFFFFFFFFFF0888888888888888000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object Bevel10: TBevel + Left = 83 + Top = 152 + Width = 151 + Height = 4 + Shape = bsBottomLine + end + object chbxShowVertLines: TCheckBox + Tag = 2 + Left = 95 + Top = 73 + Width = 143 + Height = 17 + Caption = 'Vertical Lines' + TabOrder = 2 + OnClick = chbxShowBordersClick + end + object chbxShowBorders: TCheckBox + Left = 95 + Top = 30 + Width = 143 + Height = 17 + Caption = 'Border' + TabOrder = 0 + OnClick = chbxShowBordersClick + end + object chbxShowHorzLines: TCheckBox + Tag = 1 + Left = 95 + Top = 51 + Width = 143 + Height = 17 + Caption = 'Horizontal Lines' + TabOrder = 1 + OnClick = chbxShowBordersClick + end + object chbxShowColumnHeaders: TCheckBox + Left = 95 + Top = 114 + Width = 143 + Height = 17 + Caption = '&Column Headers' + TabOrder = 3 + OnClick = chbxShowColumnHeadersClick + end + object chbxHeadersOnEveryPage: TCheckBox + Left = 95 + Top = 168 + Width = 143 + Height = 17 + Caption = 'Headers' + TabOrder = 4 + OnClick = chbxHeadersOnEveryPageClick + end + object lblPreview: TStaticText + Left = 244 + Top = 1 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 5 + end + end + end + object tshColor: TTabSheet + Caption = 'Color' + object pnlColor: TPanel + Left = 0 + Top = 0 + Width = 539 + Height = 253 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblGridLinesColor: TLabel + Left = 6 + Top = 217 + Width = 81 + Height = 13 + Caption = '&Grid Lines Color: ' + end + object bvlGridLineColorHost: TBevel + Left = 91 + Top = 213 + Width = 128 + Height = 21 + Visible = False + end + object lblDrawMode: TLabel + Left = 5 + Top = 16 + Width = 58 + Height = 13 + Caption = 'Draw &Mode:' + FocusControl = cbxDrawMode + end + object gbxTransparentHeaders: TGroupBox + Left = 5 + Top = 141 + Width = 225 + Height = 58 + Caption = ' ' + TabOrder = 4 + object lblHeadersColor: TLabel + Left = 6 + Top = 24 + Width = 75 + Height = 13 + Caption = 'Headers Color: ' + end + object bvlHeadersColorHost: TBevel + Left = 86 + Top = 22 + Width = 128 + Height = 21 + Visible = False + end + end + object gbxTransparent: TGroupBox + Left = 5 + Top = 50 + Width = 225 + Height = 84 + Caption = ' ' + TabOrder = 2 + object lblColor: TLabel + Left = 6 + Top = 26 + Width = 35 + Height = 13 + Caption = 'Co&lor : ' + end + object bvlColorHost: TBevel + Left = 86 + Top = 22 + Width = 128 + Height = 21 + Visible = False + end + object lblEvenColor: TLabel + Left = 6 + Top = 53 + Width = 59 + Height = 13 + Caption = 'E&ven Color: ' + end + object bvlEvenColorHost: TBevel + Left = 86 + Top = 49 + Width = 128 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 18 + Top = 48 + Width = 15 + Height = 17 + TabOrder = 1 + OnClick = chbxTransparentClick + end + object chbxTransparentHeaders: TCheckBox + Tag = 1 + Left = 18 + Top = 139 + Width = 15 + Height = 17 + Caption = 'T&ransparent Headers' + TabOrder = 3 + OnClick = chbxTransparentClick + end + object cbxDrawMode: TComboBox + Left = 69 + Top = 11 + Width = 162 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 0 + OnClick = cbxDrawModeClick + OnDrawItem = cbxDrawModeDrawItem + Items.Strings = ( + 'Simpe' + 'Odd\Even Rows Mode' + 'Chess' + 'Borrow From Source') + end + object stTransparent: TStaticText + Left = 33 + Top = 50 + Width = 69 + Height = 17 + Caption = ' Transparent ' + FocusControl = chbxTransparent + TabOrder = 5 + OnClick = stTransparentClick + end + object stTransparentHeaders: TStaticText + Left = 33 + Top = 140 + Width = 112 + Height = 17 + Caption = ' Transaprent Headers ' + FocusControl = chbxTransparentHeaders + TabOrder = 6 + OnClick = stTransparentHeadersClick + end + end + end + object tshFont: TTabSheet + Caption = 'Font' + object pnlFont: TPanel + Left = 0 + Top = 0 + Width = 539 + Height = 253 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object btnFont: TButton + Left = 8 + Top = 9 + Width = 110 + Height = 23 + Caption = 'Fo&nt...' + TabOrder = 0 + OnClick = btnFontClick + end + object edFont: TEdit + Left = 8 + Top = 38 + Width = 221 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + end + object btnHeadersFont: TButton + Tag = 2 + Left = 8 + Top = 129 + Width = 110 + Height = 23 + Caption = 'Headers Font...' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 4 + OnClick = btnFontClick + end + object edFixedFont: TEdit + Left = 8 + Top = 158 + Width = 221 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 5 + end + object btnEvenFont: TButton + Tag = 1 + Left = 8 + Top = 69 + Width = 110 + Height = 23 + Caption = 'E&ven Font...' + TabOrder = 2 + OnClick = btnFontClick + end + object edEvenFont: TEdit + Left = 8 + Top = 98 + Width = 221 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 3 + end + end + end + object tshBehaviors: TTabSheet + Caption = 'Behaviors' + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 539 + Height = 253 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Image3: TImage + Left = 7 + Top = 35 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblSelection: TLabel + Left = 5 + Top = 12 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object Bevel3: TBevel + Left = 53 + Top = 17 + Width = 181 + Height = 4 + Shape = bsBottomLine + end + object lblLookAndFeel: TLabel + Left = 5 + Top = 83 + Width = 67 + Height = 13 + Caption = 'Look And Feel' + end + object Bevel15: TBevel + Left = 85 + Top = 87 + Width = 149 + Height = 4 + Shape = bsBottomLine + end + object Image8: TImage + Left = 7 + Top = 106 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D08777777777780877777788807DCCCCDCCDDD0877777777778787777788 + 8F07D08888888888880888888888807DCCCCCCCCDD0888888888888788888888 + 8F07D00000000000000000000000007DCCCCDCCDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F7777777FF07DDDDDDDDDDD0F777777777FF7F7777777 + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F777777FFF07DDDDDDDDDDD0F777777FFFFF7F777777F + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F7777777777F7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F77777FFFF07DDDDDDDDDDD0F77777777FFF7F77777FF + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D00000000000000000000000007DCDDDDCDDDD0000000000000000000000 + 0007D08888888888880888888888807DCCCCDCCDDD0777777777777777777777 + 7707D08888888888880888888888807DCCCCCCCCDD0F88888888888788888888 + 8707D08000000008880880000000807DCCCCDCCDDD0F00000000888788000000 + 8707D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + F707D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblMiscellaneous: TLabel + Left = 5 + Top = 151 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + end + object Bevel4: TBevel + Left = 78 + Top = 156 + Width = 156 + Height = 4 + Shape = bsBottomLine + end + object Image5: TImage + Left = 7 + Top = 174 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000008088F07DDDDDDDDDDDD0800000000000000000000 + 807DD0F0FFFF8FFFF8FFFF0FFF0F07DDDDDDDDDDDD0F0F77FFF8F777F8F777F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCDDDDCDDDD0F0F00FFF8F00FF8F00FF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCCCCCDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCDDDDCDDDD0F0FFFFFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCCCCDCCDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCCCCCDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCDCCDDD0F0FFFFFF8F0FFF8F0FFF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0777777777777770FFF0F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F0F8887F8887F8880FFF8F07DDDDDDDDDDDD0F0F888887F88887F88880 + F07DD0F0F0087F0087F0080FFF0F07DDDDDDDDDDDD0F0F800087F80087F80080 + F07DD0F0FFFF7FFFF7FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF7FFFFF7FFFFF0 + F07DD0800000000000000008080807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxIncludeFixed: TCheckBox + Left = 95 + Top = 55 + Width = 143 + Height = 17 + Caption = '&Including fixed cells' + TabOrder = 1 + OnClick = chbxIncludeFixedClick + end + object chbxOnlySelected: TCheckBox + Left = 95 + Top = 32 + Width = 143 + Height = 17 + Caption = 'Only &selected cells' + TabOrder = 0 + OnClick = chbxOnlySelectedClick + end + object chbxUse3DEffects: TCheckBox + Tag = 12 + Left = 95 + Top = 104 + Width = 143 + Height = 17 + Caption = '&Use 3D Effects' + TabOrder = 2 + OnClick = chbxUse3DEffectsClick + end + object chbxUseSoft3D: TCheckBox + Tag = 13 + Left = 95 + Top = 127 + Width = 143 + Height = 17 + Caption = 'Soft &3D' + TabOrder = 3 + OnClick = chbxUseSoft3DClick + end + object chbxRowAutoHeight: TCheckBox + Left = 95 + Top = 199 + Width = 136 + Height = 17 + Caption = '&Row Auto Height' + TabOrder = 5 + OnClick = chbxRowAutoHeightClick + end + object chbxAutoWidth: TCheckBox + Left = 95 + Top = 176 + Width = 136 + Height = 17 + Caption = 'AutoWidth' + TabOrder = 4 + OnClick = chbxAutoWidthClick + end + end + end + end + object pnlPreview: TPanel + Left = 252 + Top = 81 + Width = 290 + Height = 229 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + end + object pnlHint: TPanel + Left = 4 + Top = 5 + Width = 547 + Height = 27 + Alignment = taLeftJustify + BevelOuter = bvNone + BorderStyle = bsSingle + Color = clInfoBk + Ctl3D = False + ParentCtl3D = False + TabOrder = 2 + object imgHint: TImage + Left = 7 + Top = 5 + Width = 16 + Height = 16 + Transparent = True + end + object lblHint: TLabel + Left = 30 + Top = 6 + Width = 370 + Height = 13 + Caption = ' Most Options Are Being Taken Into Account Only In Detailed View' + Font.Charset = DEFAULT_CHARSET + Font.Color = clInfoText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + ParentFont = False + Transparent = True + end + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSLVLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSLVLnk.pas new file mode 100644 index 00000000..605e0339 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSLVLnk.pas @@ -0,0 +1,2474 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSLVLnk; + +interface + +{$I cxVer.inc} + +uses + Classes, Windows, Graphics, Controls, ComCtrls, CommCtrl, ExtCtrls, StdCtrls, + ImgList, Dialogs, {$IFDEF REGISTERSHELLCTRLS} ShellCtrls, {$ENDIF} dxPSGlbl, + dxPSCore, dxExtCtrls, dxPrnPg, dxPSBaseGridLnk; + +const + dxListViewAttributeIDBase = 0; + dxListViewUnderfinedID = dxListViewAttributeIDBase + 0; + dxListViewItemID = dxListViewAttributeIDBase + 1; + dxListViewHeaderID = dxListViewAttributeIDBase + 2; + +type + TdxfmLVReportLinkDesignWindow = class; + + TListViewItemSize = record + Width: Word; + Height: Word; + end; + + TdxListViewPaintOption = (lvpoBorder, lvpoHorzLines, lvpoVertLines); + TdxListViewPaintOptions = set of TdxListViewPaintOption; + + TCustomdxNativeListViewReportLink = class(TAbstractdxGridReportLink, IdxPSNativeWin32ControlHandleSupport) + private + FInternalItems: TList; + FLargeImages: TCustomImageList; + FOptions: TdxListViewPaintOptions; + FSmallImages: TCustomImageList; + FStateImages: TCustomImageList; + function GetHeaderColor: TColor; + function GetHeaderFont: TFont; + function GetHeaderTransparent: Boolean; + function GetIncludeHeaders: Boolean; + function GetImages: TCustomImageList; + function GetInternalItem(Index: Integer): TAbstractdxReportCellData; + function GetInternalItemCount: Integer; + function GetOptions: TdxListViewPaintOptions; + procedure SetHeaderColor(Value: TColor); + procedure SetHeaderFont(Value: TFont); + procedure SetHeaderTransparent(Value: Boolean); + procedure SetIncludeHeaders(Value: Boolean); + procedure SetOptions(Value: TdxListViewPaintOptions); + protected + FColumnCount: Integer; + FColumnIndexes: TList; + FColumnWidth: Integer; + FHeaderHeight: Integer; + FInternalItemsCreating: Boolean; + FItemSpaceHorz: Integer; + FItemSpaceVert: Integer; + FRowCount: Integer; + FRowHeight: Integer; + + procedure GetImageLists(AProc: TdxPSGetImageListProc); override; + function GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; override; + procedure InternalRestoreDefaults; override; + procedure InternalRestoreFromOriginal; override; + + procedure AssignData(ACol, ARow: Integer; ADataItem: TAbstractdxReportCellData); override; + function CanCalculateColumnAutoWidths: Boolean; override; + function CreateDataItem(AParent: TdxReportCell; ACol, ARow: Integer; + const ABounds: TRect): TAbstractdxReportCellData; override; + function GetDataItemClass(ACol: Integer; ARow: Integer = 0): TdxReportCellDataClass; override; + + function GetActualColIndex(ACol: Integer): Integer; override; + function GetCellColor(ACol, ARow: Integer): TColor; override; + function GetCellFontIndex(ACol, ARow: Integer): Integer; override; + function GetCellImageIndex(ACol, ARow: Integer): Integer; override; + function GetCellImageLayout(ACol, ARow: Integer): TdxImageLayout; override; + function GetCellImageList(ACol, ARow: Integer): TCustomImageList; override; + function GetCellMultiline(ACol, ARow: Integer): Boolean; override; + function GetCellSides(ACol, ARow: Integer): TdxCellSides; override; + function GetCellText(ACol, ARow: Integer): string; override; + function GetCellTextAlignX(ACol, ARow: Integer): TdxTextAlignX; override; + function GetCellTextAlignY(ACol, ARow: Integer): TdxTextAlignY; override; + function GetColCount: Integer; override; + function GetColSortOrder(ACol: Integer): TdxCellSortOrder; override; + function GetFixedRowCount: Integer; override; + function GetRowCount: Integer; override; + function GetSelectedColCount: Integer; override; + function GetSelectedRowCount: Integer; override; + function GetSourceColWidth(ACol: Integer): Integer; override; + function GetSourceRowHeight(ARow: Integer): Integer; override; + function HasColumnHeaderImage(ACol: Integer): Boolean; override; + function HasSelection: Boolean; override; + function HasSelectionInRow(ARow: Integer): Boolean; override; + function IsDrawBorder: Boolean; override; + function IsDrawFixedHorzLines: Boolean; override; + function IsDrawFixedVertLines: Boolean; override; + function IsDrawHorzLines: Boolean; override; + function IsDrawVertLines: Boolean; override; + function IsProcessedCol(ACol: Integer): Boolean; override; + function IsSelectedCell(ACol, ARow: Integer): Boolean; override; + function IsSelectedRow(ARow: Integer): Boolean; override; + procedure SetDrawMode(Value: TdxGridDrawMode); override; + + procedure PrepareConstruct(AReportCells: TdxReportCells); override; + procedure UnprepareConstruct(AReportCells: TdxReportCells); override; + + { IdxPSNativeWin32ControlHandleSupport } + function GetNativeHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; + procedure SetNativeHandle(Value: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}); + + function LV_AreCheckBoxes: Boolean; + function LV_AreColumnHeadersClickable: Boolean; + function LV_AreGridLines: Boolean; + function LV_GetColumnCount: Integer; + function LV_GetColumnHeaderImageIndex(ACol: Integer): Integer; + function LV_GetColumnHeaderImageLayout(ACol: Integer): TdxImageLayout; + function LV_GetColumnHeaderSortOrder(ACol: Integer): TdxCellSortOrder; + function LV_GetColumnHeaderText(ACol: Integer): string; + function LV_GetColumnHeaderTextAlignX(ACol: Integer): TdxTextAlignX; + function LV_GetColumnWidth(ACol: Integer): Integer; + function LV_GetHeaderHeight: Integer; + function LV_GetHeaderWindow: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; + function LV_GetIconArrangement: TIconArrangement; + function LV_GetIsItemChecked(AIndex: Integer): Boolean; + function LV_GetIsItemSelected(AIndex: Integer): Boolean; + function LV_GetItemCount: Integer; + function LV_GetItemSpacing: TListViewItemSize; + function LV_GetItemImageIndex(ACol, ARow: Integer): Integer; + function LV_GetItemStateIndex(ACol, ARow: Integer): Integer; + function LV_GetItemText(ACol, ARow: Integer): string; + function LV_GetRowHeight: Integer; + function LV_GetSelectedCount: Integer; + function LV_GetSelectedIndex: Integer; + //function LV_GetViewStyle: TViewStyle; + function LV_HasColumnHeaderImage(ACol: Integer): Boolean; + function LV_HasColumnHeaders: Boolean; + function LV_IsOwnerData: Boolean; + + function GetListViewHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; virtual; abstract; + function GetShowColumnHeaders: Boolean; virtual; + function HasSupportForInvisibledColumnHeaders: Boolean; virtual; + procedure SetListViewHandle(Value: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}); virtual; abstract; + procedure SetShowColumnHeaders(Value: Boolean); virtual; + + function CheckImages: Boolean; virtual; + function CheckSmallImages: Boolean; virtual; + function CheckStateImages: Boolean; virtual; + procedure ClearImages; virtual; + procedure CreateImages; virtual; + procedure DeleteImages; virtual; + function GetLargeImages: TCustomImageList; virtual; + function GetSmallImages: TCustomImageList; virtual; + function GetStateImages: TCustomImageList; virtual; + function HasLargeImages: Boolean; virtual; + function HasSmallImages: Boolean; virtual; + function HasStateImages: Boolean; virtual; + + procedure AddExtraImage(AParent: TdxReportCell; ACol, ARow: Integer; R: TRect); + function IsExtraImageRequired(ACol, ARow: Integer): Boolean; virtual; + + procedure CalculateColumnIndexes; + function CalculateHeaderRowHeight: Integer; + function CalculateRowHeight: Integer; + + function CanHasStateImage(ACol, ARow: Integer): Boolean; + function IsItemChecked(ARow: Integer): Boolean; virtual; + procedure LoadAllOwnerData; virtual; + + procedure CalculateInternalItemsViewInfo; + procedure CreateExtraInternalItems(ATemporaryParent: TdxReportCell); + procedure CreateInternalItems(ATemporaryParent: TdxReportCell); + function GetFlatInternalItemIndex(ACol, ARow: Integer): Integer; + procedure InitializeInternalItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + function PlaceInternalItem(AParent: TdxReportCell; ACol, ARow: Integer; R: TRect): TAbstractdxReportCellData; virtual; + procedure SetupInternalItemsCellSides; + + function IsIconStyle: Boolean; virtual; + function IsReportStyle: Boolean; virtual; + + property Images: TCustomImageList read GetImages; + property InternalItemCount: integer read GetInternalItemCount; + property InternalItems[Index: Integer]: TAbstractdxReportCellData read GetInternalItem; + property LargeImages: TCustomImageList read GetLargeImages; + property ListViewHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF} read GetListViewHandle write SetListViewHandle; + property Options: TdxListViewPaintOptions read GetOptions write SetOptions + default [Low(TdxListViewPaintOption)..High(TdxListViewPaintOption)]; + property SmallImages: TCustomImageList read GetSmallImages; + property ShowColumnHeaders: Boolean read GetShowColumnHeaders write SetShowColumnHeaders default True; + property StateImages: TCustomImageList read GetStateImages; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + class function Aggregable: Boolean; override; + procedure Initialize; override; + + function LV_GetViewStyle: TViewStyle; + + property AutoWidth; + property Color; + property DrawMode write SetDrawMode; + property Effects3D; + property EndEllipsis; + property EvenColor; + property EvenFont; + property Font; + property GridLineColor; + property HeaderColor: TColor read GetHeaderColor write SetHeaderColor default clBtnFace; {dxDefaultFixedColor} + property HeaderFont: TFont read GetHeaderFont write SetHeaderFont stored IsFixedFontStored; + property HeadersOnEveryPage; + property HeaderTransparent: Boolean read GetHeaderTransparent write SetHeaderTransparent default False; + property IncludeHeaders: Boolean read GetIncludeHeaders write SetIncludeHeaders default True; + property OnlySelected; + property RowAutoHeight; + property Soft3D; + property Transparent; + end; + + TdxNativeListViewReportLink = class(TCustomdxNativeListViewReportLink) + private + FListViewHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; + protected + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + + function GetDesignerClass: TdxReportLinkDesignWindowClass; override; + + function GetListViewHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; override; + procedure SetListViewHandle(Value: {$IFDEF BCB}Integer {$ELSE} HWND{$ENDIF}); override; + public + function DataProviderPresent: Boolean; override; + property ListViewHandle; + published + property AutoWidth; + property Color; + property DrawMode write SetDrawMode; + property Effects3D; + property EndEllipsis; + property Font; + property GridLineColor; + property HeaderColor; + property HeaderFont; + property HeadersOnEveryPage; + property HeaderTransparent; + property OnlySelected; + property Options; + property RowAutoHeight; + property IncludeHeaders; + property Soft3D; + property Transparent; + end; + + TdxCustomDrawListViewHeaderEvent = procedure(Sender: TBasedxReportLink; + ACanvas: TCanvas; ARect: TRect; AHeaderIndex: Integer; + AnItem: TdxReportCellImage; var ADone: Boolean) of object; + + TdxCustomDrawListViewItemEvent = procedure(Sender: TBasedxReportLink; + ACanvas: TCanvas; ARect: TRect; AListItem: TListItem; ASubItem: Integer; + AnItem: TdxReportCellImage; var ADone: Boolean) of object; + + + TdxListViewReportLinkCustomDrawInfo = record + AttributeID: Integer; + case Integer of + dxListViewItemID: (ListItem: TListItem; SubItem: Integer); + dxListViewHeaderID: (HeaderIndex: Integer); + end; + + + TCustomdxListViewReportLink = class(TCustomdxNativeListViewReportLink) + private + FShowColumnHeaders: Boolean; + FOnCustomDrawHeader: TdxCustomDrawListViewHeaderEvent; + FOnCustomDrawItem: TdxCustomDrawListViewItemEvent; + FOnInitializeHeader: TdxCustomGridReportLinkInitializeItemEvent; + procedure SetOnCustomDrawHeader(Value: TdxCustomDrawListViewHeaderEvent); + procedure SetOnCustomDrawItem(Value: TdxCustomDrawListViewItemEvent); + protected + procedure AssignData(ACol, ARow: Integer; ADataItem: TAbstractdxReportCellData); override; + procedure CustomDraw(AItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); override; + procedure DoInitializeHeader(ACol, ARow: Integer; ADataItem: TAbstractdxReportCellData); dynamic; + procedure DoInitializeItem(ACol, ARow: Integer; ADataItem: TAbstractdxReportCellData); override; + procedure InternalRestoreFromOriginal; override; + procedure InternalRestoreDefaults; override; + procedure PrepareConstruct(AReportCells: TdxReportCells); override; + + function GetListViewHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; override; + function GetShowColumnHeaders: Boolean; override; + function HasSupportForInvisibledColumnHeaders: Boolean; override; + procedure InitializeInternalItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); override; + function IsItemChecked(ARow: Integer): Boolean; override; + procedure LoadAllOwnerData; override; + + procedure SetListViewHandle(Value: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}); override; + procedure SetShowColumnHeaders(Value: Boolean); override; + + function GetLargeImages: TCustomImageList; override; + function GetSmallImages: TCustomImageList; override; + function GetStateImages: TCustomImageList; override; + + function GetCustomListView: TCustomListView; virtual; + + procedure DoCustomDrawHeader(ACanvas: TCanvas; ARect: TRect; AHeaderIndex: Integer; + AnItem: TdxReportCellImage; var ADone: Boolean); dynamic; + procedure DoCustomDrawItem(ACanvas: TCanvas; ARect: TRect; AListItem: TListItem; + ASubItem: Integer; AnItem: TdxReportCellImage; var ADone: Boolean); dynamic; + procedure GetCustomDrawInfo(AnItem: TAbstractdxReportCellData; + var ACustomDrawInfo: TdxListViewReportLinkCustomDrawInfo); virtual; + + property CustomListView: TCustomListView read GetCustomListView; + public + procedure Assign(Source: TPersistent); override; + + class function Aggregable: Boolean; override; + + property ShowColumnHeaders; + property SupportedCustomDraw; + property OnCustomDrawHeader: TdxCustomDrawListViewHeaderEvent read FOnCustomDrawHeader write SetOnCustomDrawHeader; + property OnCustomDrawItem: TdxCustomDrawListViewItemEvent read FOnCustomDrawItem write SetOnCustomDrawItem; + property OnInitializeHeader: TdxCustomGridReportLinkInitializeItemEvent read FOnInitializeHeader write FOnInitializeHeader; + end; + + TdxListViewReportLink = class(TCustomdxListViewReportLink) + private + function GetListView: TListView; + public + property ListView: TListView read GetListView; + published + property AutoWidth; + property Color; + property DrawMode write SetDrawMode; + property Effects3D; + property EndEllipsis; + property Font; + property GridLineColor; + property HeaderColor; + property HeaderFont; + property HeadersOnEveryPage; + property HeaderTransparent; + property OnlySelected; + property Options; + property RowAutoHeight; + property IncludeHeaders; + property ShowColumnHeaders; + property Soft3D; + property SupportedCustomDraw; + property Transparent; + + property OnCustomDrawHeader; + property OnCustomDrawItem; + property OnInitializeHeader; + property OnInitializeItem; + end; + + {$IFDEF REGISTERSHELLCTRLS} + TCustomdxShellListViewReportLink = class(TCustomdxListViewReportLink) + private + function GetShellListView: TShellListView; + protected + function HasStateImages: Boolean; override; + procedure CreateImages; override; + procedure DeleteImages; override; + function GetLargeImages: TCustomImageList; override; + function GetSmallImages: TCustomImageList; override; + function GetStateImages: TCustomImageList; override; + + property ShellListView: TShellListView read GetShellListView; + end; + + TdxShellListViewReportLink = class(TCustomdxShellListViewReportLink) + public + property ShellListView; + published + property AutoWidth; + property Color; + property DrawMode write SetDrawMode; + property Effects3D; + property EndEllipsis; + property Font; + property GridLineColor; + property HeaderColor; + property HeaderFont; + property HeadersOnEveryPage; + property HeaderTransparent; + property OnlySelected; + property Options; + property RowAutoHeight; + property IncludeHeaders; + property ShowColumnHeaders; + property Soft3D; + property SupportedCustomDraw; + property Transparent; + + property OnCustomDrawHeader; + property OnCustomDrawItem; + property OnInitializeHeader; + property OnInitializeItem; + end; + + {$ENDIF} + + TdxfmLVReportLinkDesignWindow = class(TStandarddxReportLinkDesignWindow) + PageControl1: TPageControl; + tshOptions: TTabSheet; + pnlOptions: TPanel; + lblShow: TLabel; + Bevel11: TBevel; + imgGrid: TImage; + chbxShowVertLines: TCheckBox; + chbxShowBorders: TCheckBox; + chbxShowHorzLines: TCheckBox; + tshColor: TTabSheet; + pnlColor: TPanel; + lblGridLinesColor: TLabel; + bvlGridLineColorHost: TBevel; + gbxTransparentHeaders: TGroupBox; + lblHeadersColor: TLabel; + bvlHeadersColorHost: TBevel; + gbxTransparent: TGroupBox; + lblColor: TLabel; + bvlColorHost: TBevel; + lblEvenColor: TLabel; + bvlEvenColorHost: TBevel; + chbxTransparent: TCheckBox; + chbxTransparentHeaders: TCheckBox; + tshFont: TTabSheet; + pnlFont: TPanel; + btnFont: TButton; + edFont: TEdit; + btnHeadersFont: TButton; + edFixedFont: TEdit; + btnEvenFont: TButton; + edEvenFont: TEdit; + tshBehaviors: TTabSheet; + Panel1: TPanel; + Image3: TImage; + lblSelection: TLabel; + Bevel3: TBevel; + lblLookAndFeel: TLabel; + Bevel15: TBevel; + Image8: TImage; + chbxIncludeFixed: TCheckBox; + chbxOnlySelected: TCheckBox; + chbxUse3DEffects: TCheckBox; + chbxUseSoft3D: TCheckBox; + pnlPreview: TPanel; + pnlHint: TPanel; + imgHint: TImage; + lblHint: TLabel; + chbxShowColumnHeaders: TCheckBox; + Bevel1: TBevel; + lblDrawMode: TLabel; + cbxDrawMode: TComboBox; + lblMiscellaneous: TLabel; + Bevel4: TBevel; + Image5: TImage; + chbxRowAutoHeight: TCheckBox; + lblOnEveryPage: TLabel; + Image1: TImage; + Bevel10: TBevel; + chbxHeadersOnEveryPage: TCheckBox; + lblPreview: TStaticText; + chbxAutoWidth: TCheckBox; + stTransparent: TStaticText; + stTransparentHeaders: TStaticText; + procedure cbxDrawModeClick(Sender: TObject); + procedure chbxShowBordersClick(Sender: TObject); + procedure chbxRowAutoHeightClick(Sender: TObject); + procedure chbxTransparentClick(Sender: TObject); + procedure ccbxColorChange(Sender: TObject); + procedure btnFontClick(Sender: TObject); + procedure chbxHeadersOnEveryPageClick(Sender: TObject); + procedure chbxOnlySelectedClick(Sender: TObject); + procedure chbxIncludeFixedClick(Sender: TObject); + procedure chbxUse3DEffectsClick(Sender: TObject); + procedure chbxUseSoft3DClick(Sender: TObject); + procedure pbxPreviewPaint(Sender: TObject); + procedure chbxShowColumnHeadersClick(Sender: TObject); + procedure PageControl1Change(Sender: TObject); + procedure cbxDrawModeDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure chbxAutoWidthClick(Sender: TObject); + procedure stTransparentClick(Sender: TObject); + procedure stTransparentHeadersClick(Sender: TObject); + private + FccbxColor: TdxPSColorCombo; + FccbxEvenColor: TdxPSColorCombo; + FccbxFixedColor: TdxPSColorCombo; + FccbxGridLineColor: TdxPSColorCombo; + FPreviewBox: TdxPSPaintPanel; + function GetReportLink: TCustomdxNativeListViewReportLink; + + procedure CreateControls; + procedure CMDialogChar(var message: TCMDialogChar); message CM_DIALOGCHAR; + protected + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + procedure LoadStrings; override; + procedure PaintPreview(ACanvas: TCanvas; R: TRect); override; + procedure UpdateControlsState; override; + procedure UpdatePreview; override; + public + constructor Create(AOwner: TComponent); override; + property ReportLink: TCustomdxNativeListViewReportLink read GetReportLink; + end; + +const + dxDefaultListViewOptions = [Low(TdxListViewPaintOption)..High(TdxListViewPaintOption)]; + +implementation + +{$R *.DFM} + +// TODO: Tile and Group View (Windows XP) + +uses + Messages, Forms, SysUtils, cxClasses, dxPSRes, dxPSUtl, dxPrnDev; + +const + LVM_GETVIEW = LVM_FIRST + 143; + + LV_VIEW_ICON = $00000000; + LV_VIEW_DETAILS = $00000001; + LV_VIEW_SMALLICON = $00000002; + LV_VIEW_LIST = $00000003; + LV_VIEW_TILE = $00000004; + LV_VIEW_MAX = $00000004; + +type + TCustomListViewAccess = class(TListView); + + +{ ListView Helpers } + +function ListViewGetItems(AControl: TCustomListView): TListItems; +begin + Result := TCustomListViewAccess(AControl).Items; +end; + +function ListViewGetLargeImages(AControl: TCustomListView): TCustomImageList; +begin + Result := TCustomListViewAccess(AControl).LargeImages; +end; + +function ListViewGetSmallImages(AControl: TCustomListView): TCustomImageList; +begin + Result := TCustomListViewAccess(AControl).SmallImages; +end; + +function ListViewGetShowColumnHeaders(AControl: TCustomListView): Boolean; +begin + Result := TCustomListViewAccess(AControl).ShowColumnHeaders; +end; + +function ListViewGetStateImages(AControl: TCustomListView): TCustomImageList; +begin + Result := TCustomListViewAccess(AControl).StateImages; +end; + +procedure ListViewOwnerDataFetch(AControl: TCustomListView; AnIndex: Integer; ARequest: TItemRequest); +begin + with TCustomListViewAccess(AControl) do + OwnerDataFetch(Items[AnIndex], ARequest); +end; + +{ Utilities } +function ListView_GetView(AWnd: HWND): DWORD; +begin + Result := SendMessage(AWnd, LVM_GETVIEW, 0, 0); +end; + +{ TCustomdxNativeListViewReportLink } + +constructor TCustomdxNativeListViewReportLink.Create(AOwner: TComponent); +begin + inherited; + CreateImages; + FColumnIndexes := TList.Create; +end; + +destructor TCustomdxNativeListViewReportLink.Destroy; +begin + DeleteImages; + FreeAndNil(FColumnIndexes); + inherited; +end; + +procedure TCustomdxNativeListViewReportLink.Assign(Source: TPersistent); +begin + if Source is TCustomdxNativeListViewReportLink then + with TCustomdxNativeListViewReportLink(Source) do + begin + Self.Options := Options; + end; + inherited; +end; + +class function TCustomdxNativeListViewReportLink.Aggregable: Boolean; +begin + Result := False; +end; + +procedure TCustomdxNativeListViewReportLink.Initialize; +begin + inherited; + FColumnCount := 0; + FRowCount := 0; + FreeAndNil(FInternalItems); +end; + +procedure TCustomdxNativeListViewReportLink.GetImageLists(AProc: TdxPSGetImageListProc); +begin + inherited; + if HasLargeImages then AProc(LargeImages); + if HasSmallImages then AProc(SmallImages); + if HasStateImages then AProc(StateImages); +end; + +function TCustomdxNativeListViewReportLink.GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; +begin + case LV_GetViewStyle of + vsIcon, + vsSmallIcon: + if LV_GetIconArrangement = iaTop then + Result := AUpdateCodes * uaMarginsVert <> [] + else + Result := AUpdateCodes * uaMarginsHorz <> []; + vsList: + Result := AUpdateCodes * uaMarginsHorz <> []; + else // vsReport + Result := inherited GetRebuildOnPageParamsChange(AUpdateCodes); + end; +end; + +procedure TCustomdxNativeListViewReportLink.InternalRestoreDefaults; +begin + inherited; + Options := dxDefaultListViewOptions; +end; + +procedure TCustomdxNativeListViewReportLink.InternalRestoreFromOriginal; +begin + inherited; + HeaderFont := Font; + if IsWindow(ListViewHandle) and IsReportStyle then + begin + Options := [lvpoBorder]; + if LV_AreGridLines then + Options := Options + [lvpoHorzLines, lvpoVertLines]; + Effects3D := LV_AreColumnHeadersClickable; + end + else + begin + Effects3D := False; + Options := []; + end; +end; + +procedure TCustomdxNativeListViewReportLink.AssignData(ACol, ARow: Integer; + ADataItem: TAbstractdxReportCellData); +begin + if IsReportStyle or (GetFlatInternalItemIndex(ACol, ARow) < LV_GetItemCount) then + begin + inherited; + with TdxReportCellImage(ADataItem) do + MakeSpaceForEmptyImage := ACol = 0; // TODO: Check HasImageList + end; +end; + +function TCustomdxNativeListViewReportLink.CanCalculateColumnAutoWidths: Boolean; +begin + Result := IsReportStyle; +end; + +function TCustomdxNativeListViewReportLink.CreateDataItem(AParent: TdxReportCell; + ACol, ARow: Integer; const ABounds: TRect): TAbstractdxReportCellData; +var + ImageWidth: Integer; + R: TRect; +begin + R := ABounds; + if IsReportStyle or FInternalItemsCreating then + begin + ImageWidth := 0; + if IsExtraImageRequired(ACol, ARow) then + begin + ImageWidth := StateImages.Width; + Inc(R.Left, ImageWidth); + end; + Result := inherited CreateDataItem(AParent, ACol, ARow, R); + if IsExtraImageRequired(ACol, ARow) then + AddExtraImage(AParent, ACol, ARow, Rect(0, R.Top, ImageWidth, R.Bottom)); + end + else + Result := PlaceInternalItem(AParent, ACol, ARow, R); +end; + +function TCustomdxNativeListViewReportLink.GetDataItemClass(ACol: Integer; + ARow: Integer = 0): TdxReportCellDataClass; +begin + Result := TdxReportCellImage; +end; + +function TCustomdxNativeListViewReportLink.GetActualColIndex(ACol: Integer): Integer; +begin + if IsReportStyle then + Result := Integer(FColumnIndexes[ACol]) + else + Result := ACol; +end; + +function TCustomdxNativeListViewReportLink.GetCellColor(ACol, ARow: Integer): TColor; +begin + if IsReportStyle then + Result := inherited GetCellColor(ACol, ARow) + else + Result := Color; +end; + +function TCustomdxNativeListViewReportLink.GetCellFontIndex(ACol, ARow: Integer): Integer; +begin + if IsReportStyle then + Result := inherited GetCellFontIndex(ACol, ARow) + else + Result := FFontIndex; +end; + +function TCustomdxNativeListViewReportLink.GetCellImageIndex(ACol, ARow: Integer): Integer; +begin + if IsReportStyle then + if IsFixedRow(ARow) then + if LV_HasColumnHeaderImage(ACol) then + Result := LV_GetColumnHeaderImageIndex(ACol) + else + Result := -1 + else + Result := LV_GetItemImageIndex(ACol, ARow - Ord(ShowColumnHeaders)) + else + Result := LV_GetItemImageIndex(ACol, ARow); +end; + +function TCustomdxNativeListViewReportLink.GetCellImageLayout(ACol, ARow: Integer): TdxImageLayout; +begin + if IsReportStyle then + if IsFixedRow(ARow) then + Result := LV_GetColumnHeaderImageLayout(ACol) + else + Result := ilImageCenterLeft + else + if IsIconStyle then + Result := ilImageTopCenter + else + Result := ilImageCenterLeft; +end; + +function TCustomdxNativeListViewReportLink.GetCellImageList(ACol, ARow: Integer): TCustomImageList; +begin + if IsReportStyle then + if IsFixedRow(ARow) then + if LV_HasColumnHeaderImage(ACol) then + Result := LargeImages + else + Result := nil + else + Result := Images + else + Result := Images; +end; + +function TCustomdxNativeListViewReportLink.GetCellMultiline(ACol, ARow: Integer): Boolean; +begin + Result := IsIconStyle or inherited GetCellMultiline(ACol, ARow) +end; + +function TCustomdxNativeListViewReportLink.GetCellSides(ACol, ARow: Integer): TdxCellSides; + + function IsCellMostLeft(ACol, ARow: Integer): Boolean; + begin + Result := ACol = 0; + end; + + function IsCellMostTop(ACol, ARow: Integer): Boolean; + begin + Result := (IsReportStyle and LV_HasColumnHeaders and (ARow < 2)) or (ARow = 0); + end; + + function IsCellMostRight(ACol, ARow: Integer): Boolean; + begin + Result := ACol = ColCount - 1; + end; + + function IsCellMostBottom(ACol, ARow: Integer): Boolean; + begin + Result := ARow = RowCount - 1; + end; + +begin + Result := csAll; + if not IsFixedCell(ACol, ARow) then + begin + if not IsDrawBorder then + begin + if IsCellMostLeft(ACol, ARow) then Exclude(Result, csLeft); + if IsCellMostTop(ACol, ARow) then Exclude(Result, csTop); + if IsCellMostRight(ACol, ARow) then Exclude(Result, csRight); + if IsCellMostBottom(ACol, ARow) then Exclude(Result, csBottom); + end; + if not IsDrawHorzLines then + begin + if not IsCellMostTop(ACol, ARow) then Exclude(Result, csTop); + if not IsCellMostBottom(ACol, ARow) then Exclude(Result, csBottom); + end; + if not IsDrawVertLines then + begin + if not IsCellMostLeft(ACol, ARow) then Exclude(Result, csLeft); + if not IsCellMostRight(ACol, ARow) then Exclude(Result, csRight); + end; + + if IsExtraImageRequired(ACol, ARow) then Exclude(Result, csLeft); + end; +end; + +function TCustomdxNativeListViewReportLink.GetCellText(ACol, ARow: Integer): string; +begin + if IsReportStyle then + if IsFixedRow(ARow) then + Result := LV_GetColumnHeaderText(ACol) + else + Result := LV_GetItemText(ACol, ARow - Ord(ShowColumnHeaders)) + else + Result := LV_GetItemText(ACol, ARow); +end; + +function TCustomdxNativeListViewReportLink.GetCellTextAlignX(ACol, ARow: Integer): TdxTextAlignX; +begin + case LV_GetViewStyle of + vsIcon: + Result := taCenterX; + vsSmallIcon, + vsList: + Result := taLeft; + else // vsReport: + Result := LV_GetColumnHeaderTextAlignX(ACol) + end; +end; + +function TCustomdxNativeListViewReportLink.GetCellTextAlignY(ACol, ARow: Integer): TdxTextAlignY; +begin + if IsIconStyle then + Result := taTop + else + Result := inherited GetCellTextAlignY(ACol, ARow); +end; + +function TCustomdxNativeListViewReportLink.GetColCount: Integer; +begin + if IsReportStyle then + Result := LV_GetColumnCount + else + Result := FColumnCount; +end; + +function TCustomdxNativeListViewReportLink.GetColSortOrder(ACol: Integer): TdxCellSortOrder; +begin + if IsReportStyle and ShowColumnHeaders then + Result := LV_GetColumnHeaderSortOrder(ACol) + else + Result := csoNone; +end; + +function TCustomdxNativeListViewReportLink.GetFixedRowCount: Integer; +begin + Result := Ord(IsReportStyle and ShowColumnHeaders and (not HasSelection or IncludeHeaders)); +end; + +function TCustomdxNativeListViewReportLink.GetRowCount: Integer; +begin + if IsReportStyle then + Result := LV_GetItemCount + Ord(ShowColumnHeaders) + else + Result := FRowCount; +end; + +function TCustomdxNativeListViewReportLink.GetSelectedColCount: Integer; +begin + Result := LV_GetColumnCount; +end; + +function TCustomdxNativeListViewReportLink.GetSelectedRowCount: Integer; +begin + Result := LV_GetSelectedCount; +end; + +function TCustomdxNativeListViewReportLink.GetSourceColWidth(ACol: Integer): Integer; +begin + if IsReportStyle then + Result := LV_GetColumnWidth(ACol) + else + Result := FColumnWidth; +end; + +function TCustomdxNativeListViewReportLink.GetSourceRowHeight(ARow: Integer): Integer; +begin + if IsFixedRow(ARow) then + Result := FHeaderHeight + else + Result := FRowHeight; +end; + +function TCustomdxNativeListViewReportLink.HasColumnHeaderImage(ACol: Integer): Boolean; +begin + Result := LV_HasColumnHeaderImage(ACol); +end; + +function TCustomdxNativeListViewReportLink.HasSelection: Boolean; +begin + Result := OnlySelected and IsReportStyle and (LV_GetSelectedCount <> 0) and (LV_GetSelectedIndex <> -1); +end; + +function TCustomdxNativeListViewReportLink.HasSelectionInRow(ARow: Integer): Boolean; +begin + Result := IsSelectedRow(ARow); +end; + +function TCustomdxNativeListViewReportLink.IsDrawBorder: Boolean; +begin + Result := lvpoBorder in Options; +end; + +function TCustomdxNativeListViewReportLink.IsDrawHorzLines: Boolean; +begin + Result := lvpoHorzLines in Options; +end; + +function TCustomdxNativeListViewReportLink.IsDrawVertLines: Boolean; +begin + Result := lvpoVertLines in Options; +end; + +function TCustomdxNativeListViewReportLink.IsDrawFixedHorzLines: Boolean; +begin + Result := lvpoBorder in Options; +end; + +function TCustomdxNativeListViewReportLink.IsDrawFixedVertLines: Boolean; +begin + Result := lvpoBorder in Options; +end; + +function TCustomdxNativeListViewReportLink.IsProcessedCol(ACol: Integer): Boolean; +begin + Result := True; +end; + +function TCustomdxNativeListViewReportLink.IsSelectedCell(ACol, ARow: Integer): Boolean; +begin + Result := IsSelectedRow(ARow); +end; + +function TCustomdxNativeListViewReportLink.IsSelectedRow(ARow: Integer): Boolean; +begin + if IsFixedRow(ARow) then + Result := IncludeHeaders + else + Result := HasSelection and LV_GetIsItemSelected(ARow - Ord(ShowColumnHeaders)); +end; + +procedure TCustomdxNativeListViewReportLink.SetDrawMode(Value: TdxGridDrawMode); +begin + if Value = gdmBorrowSource then Value := gdmStrict; + inherited; +end; + +procedure TCustomdxNativeListViewReportLink.PrepareConstruct(AReportCells: TdxReportCells); +begin + ClearImages; + + EndEllipsis := IsReportStyle or EndEllipsis; + + if LV_IsOwnerData then LoadAllOwnerData; + + FRowHeight := CalculateRowHeight; + FHeaderHeight := CalculateHeaderRowHeight; + + if not IsReportStyle then + begin + FInternalItems := TList.Create; + if LV_GetItemCount <> 0 then + begin + CreateInternalItems(AReportCells.Cells); + if InternalItemCount <> 0 then + begin + CalculateInternalItemsViewInfo; + CreateExtraInternalItems(AReportCells.Cells); + SetupInternalItemsCellSides; + end; + end; + end + else + CalculateColumnIndexes; + + inherited; +end; + +procedure TCustomdxNativeListViewReportLink.UnprepareConstruct(AReportCells: TdxReportCells); +begin + FColumnCount := 0; + FRowCount := 0; + FreeAndNil(FInternalItems); + inherited; +end; + +{ IdxPSNativeWin32ControlHandleSupport } + +function TCustomdxNativeListViewReportLink.GetNativeHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; +begin + Result := GetListViewHandle; +end; + +procedure TCustomdxNativeListViewReportLink.SetNativeHandle(Value: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}); +begin + SetListViewHandle(Value); +end; + +function TCustomdxNativeListViewReportLink.LV_AreCheckBoxes: Boolean; +begin + Result := ListView_GetExtendedListViewStyle(ListViewHandle) and LVS_EX_CHECKBOXES = LVS_EX_CHECKBOXES; +end; + +function TCustomdxNativeListViewReportLink.LV_AreColumnHeadersClickable: Boolean; +begin + Result := GetWindowLong(ListViewHandle, GWL_STYLE) and LVS_NOSORTHEADER <> LVS_NOSORTHEADER; +end; + +function TCustomdxNativeListViewReportLink.LV_AreGridLines: Boolean; +begin + Result := ListView_GetExtendedListViewStyle(ListViewHandle) and LVS_EX_GRIDLINES = LVS_EX_GRIDLINES; +end; + +function TCustomdxNativeListViewReportLink.LV_GetColumnCount: Integer; +var + Header: HWND; +begin + Header := ListView_GetHeader(ListViewHandle); + if Header <> 0 then + Result := Header_GetItemCount(Header) + else + Result := 0; +end; + +function TCustomdxNativeListViewReportLink.LV_GetColumnHeaderImageIndex(ACol: Integer): Integer; +var + Column: TLVColumn; +begin + FillChar(Column, SizeOf(Column), 0); + Column.Mask := LVCF_FMT or LVCF_IMAGE; + ListView_GetColumn(ListViewHandle, ACol, Column); + if Column.fmt and LVCFMT_COL_HAS_IMAGES = LVCFMT_COL_HAS_IMAGES then + Result := Column.iImage + else + Result := -1; +end; + +function TCustomdxNativeListViewReportLink.LV_GetColumnHeaderImageLayout(ACol: Integer): TdxImageLayout; +const + ImageLayoutsMap: array[Boolean] of TdxImageLayout = (ilImageCenterLeft, ilImageCenterRight); +var + Column: TLVColumn; +begin + FillChar(Column, SizeOf(Column), 0); + Column.Mask := LVCF_FMT; + ListView_GetColumn(ListViewHandle, ACol, Column); + Result := ImageLayoutsMap[Column.fmt and LVCFMT_BITMAP_ON_RIGHT = LVCFMT_BITMAP_ON_RIGHT]; +end; + +function TCustomdxNativeListViewReportLink.LV_GetColumnHeaderSortOrder(ACol: Integer): TdxCellSortOrder; +var + Header: HWND; + Item: THDItem; +begin + Result := csoNone; + if dxPSGlbl.IsWinXP or dxPSGlbl.IsComCtrlVersion600 then + begin + Header := LV_GetHeaderWindow; + if IsWindow(Header) then + begin + FillChar(Item, SizeOf(Item), 0); + Item.Mask := HDI_FORMAT; + Header_GetItem(Header, ACol, Item); + if Item.fmt and HDF_SORTDOWN = HDF_SORTDOWN then + Result := csoDown + else + if Item.fmt and HDF_SORTUP = HDF_SORTUP then + Result := csoUp + end; + end; +end; + +function TCustomdxNativeListViewReportLink.LV_GetColumnHeaderText(ACol: Integer): string; +const + BufferLength = 4096; +var + Column: TLVColumn; + Buffer: array[0..BufferLength - 1] of Char; + PBuffer: Pointer ; +begin + FillChar(Column, SizeOf(Column), 0); + PBuffer := @Buffer; + Column.Mask := LVCF_TEXT; + Column.pszText := PBuffer; + Column.cchTextMax := SizeOf(Buffer); + ListView_GetColumn(ListViewHandle, ACol, Column); + Result := (Column.pszText); +end; + +function TCustomdxNativeListViewReportLink.LV_GetColumnHeaderTextAlignX(ACol: Integer): TdxTextAlignX; +var + Column: TLVColumn; +begin + FillChar(Column, SizeOf(Column), 0); + Column.Mask := LVCF_FMT; + ListView_GetColumn(ListViewHandle, ACol, Column); + Column.fmt := Column.fmt and LVCFMT_JUSTIFYMASK; + + if Column.fmt and LVCFMT_CENTER = LVCFMT_CENTER then + Result := taCenterX + else + if Column.fmt and LVCFMT_RIGHT = LVCFMT_RIGHT then + Result := taRight + else + Result := taLeft; +end; + +function TCustomdxNativeListViewReportLink.LV_GetColumnWidth(ACol: Integer): Integer; +begin + Result := ListView_GetColumnWidth(ListViewHandle, ACol); +end; + +function TCustomdxNativeListViewReportLink.LV_GetHeaderHeight: Integer; +var + Header: HWND; + R: TRect; +begin + Header := LV_GetHeaderWindow; + if IsWindow(Header) then + begin + GetWindowRect(Header, R); + Result := R.Bottom - R.Top; + end + else + Result := 0; +end; + +function TCustomdxNativeListViewReportLink.LV_GetHeaderWindow: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; +begin + Result := ListView_GetHeader(ListViewHandle); +end; + +function TCustomdxNativeListViewReportLink.LV_GetIconArrangement: TIconArrangement; +const + IconArrangements: array[Boolean] of TIconArrangement = (iaLeft, iaTop); +begin + Result := IconArrangements[(GetWindowLong(ListViewHandle, GWL_STYLE) and LVS_ALIGNMASK) = 0]; +end; + +function TCustomdxNativeListViewReportLink.LV_GetIsItemChecked(AIndex: Integer): Boolean; +begin + Result := ListView_GetCheckState(ListViewHandle, AIndex) <> 0; +end; + +function TCustomdxNativeListViewReportLink.LV_GetIsItemSelected(AIndex: Integer): Boolean; +begin + Result := ListView_GetItemState(ListViewHandle, AIndex, LVIS_SELECTED) <> 0; +end; + +function TCustomdxNativeListViewReportLink.LV_GetItemCount: Integer; +begin + Result := ListView_GetItemCount(ListViewHandle); +end; + +function TCustomdxNativeListViewReportLink.LV_GetItemImageIndex(ACol, ARow: Integer): Integer; + + procedure InternalGetImageIndex(var AnImageIndex: Integer); + var + Item: TLVItem; + begin + FillChar(Item, SizeOf(Item), 0); + Item.Mask := LVIF_IMAGE; + Item.iImage := AnImageIndex; + Item.iItem := ARow; + Item.iSubItem := ACol; + if ListView_GetItem(ListViewHandle, Item) then + AnImageIndex := Item.iImage + else + AnImageIndex := -1; + end; + +begin + if (ACol = 0) or not LV_AreCheckBoxes then + begin + Result := I_IMAGECALLBACK; + InternalGetImageIndex(Result); + {if Result = -1 then + begin + Result := 0; + InternalGetImageIndex(Result); + end; } + end + else + Result := -1; +end; + +function TCustomdxNativeListViewReportLink.LV_GetItemSpacing: TListViewItemSize; +const + Params: array[TViewStyle] of Integer = (0, 1, 1, 1); +var + Spacing: Longint; +begin + Spacing := ListView_GetItemSpacing(ListViewHandle, Params[LV_GetViewStyle]); + Result.Width := LoWord(Spacing); + Result.Height := HiWord(Spacing); +end; + +function TCustomdxNativeListViewReportLink.LV_GetItemStateIndex(ACol, ARow: Integer): Integer; +var + Item: TLVItem; +begin + if CanHasStateImage(ACol, ARow) then + begin + FillChar(Item, SizeOf(Item), 0); + Item.Mask := LVIF_IMAGE; + Item.StateMask := LVIS_STATEIMAGEMASK; + Item.iItem := ARow - Ord(IsReportStyle and ShowColumnHeaders); + Item.iSubItem := ACol; + ListView_GetItem(ListViewHandle, Item); + Result := (Item.State shr 12) - 1; + end + else + Result := -1; +end; + +function TCustomdxNativeListViewReportLink.LV_GetItemText(ACol, ARow: Integer): string; +const + BufferLength = 4096; +var + Buffer: array[0..BufferLength - 1] of Char; +begin + ListView_GetItemText(ListViewHandle, ARow, ACol, Buffer, BufferLength); + Result := Buffer; +end; + +function TCustomdxNativeListViewReportLink.LV_GetRowHeight: Integer; +begin + Result := HiWord(ListView_GetItemSpacing(ListViewHandle, 1)); +end; + +function TCustomdxNativeListViewReportLink.LV_GetSelectedCount: Integer; +begin + Result := ListView_GetSelectedCount(ListViewHandle); +end; + +function TCustomdxNativeListViewReportLink.LV_GetSelectedIndex: Integer; +begin + Result := ListView_GetNextItem(ListViewHandle, -1, LVNI_ALL or LVNI_SELECTED); +end; + +function TCustomdxNativeListViewReportLink.LV_GetViewStyle: TViewStyle; +const + ViewStylesMap: array[LVS_ICON..LVS_LIST] of TViewStyle = (vsIcon, vsReport, vsSmallIcon, vsList); +var + ViewStyle: DWORD; +begin + if dxPSGlbl.IsComCtrlVersion600 then + ViewStyle := ListView_GetView(ListViewHandle) + else + ViewStyle := GetWindowLong(ListViewHandle, GWL_STYLE); + Result := ViewStylesMap[ViewStyle and LVS_TYPEMASK]; +end; + +function TCustomdxNativeListViewReportLink.LV_HasColumnHeaderImage(ACol: Integer): Boolean; +var + Column: TLVColumn; +begin + FillChar(Column, SizeOf(Column), 0); + Column.Mask := LVCF_FMT; + ListView_GetColumn(ListViewHandle, ACol, Column); + Result := Column.fmt and LVCFMT_COL_HAS_IMAGES = LVCFMT_COL_HAS_IMAGES; +end; + +function TCustomdxNativeListViewReportLink.LV_HasColumnHeaders: Boolean; +begin + Result := GetWindowLong(ListViewHandle, GWL_STYLE) and LVS_NOCOLUMNHEADER <> LVS_NOCOLUMNHEADER; +end; + +function TCustomdxNativeListViewReportLink.LV_IsOwnerData: Boolean; +begin + Result := GetWindowLong(ListViewHandle, GWL_STYLE) and LVS_OWNERDATA = LVS_OWNERDATA; +end; + +function TCustomdxNativeListViewReportLink.GetShowColumnHeaders: Boolean; +begin + Result := LV_HasColumnHeaders; +end; + +function TCustomdxNativeListViewReportLink.HasSupportForInvisibledColumnHeaders: Boolean; +begin + Result := False; +end; + +procedure TCustomdxNativeListViewReportLink.SetShowColumnHeaders(Value: Boolean); +begin +end; + +function TCustomdxNativeListViewReportLink.CheckImages: Boolean; +begin + Result := HasLargeImages and (Images.Width <> 0) and (Images.Height <> 0); +end; + +function TCustomdxNativeListViewReportLink.CheckSmallImages: Boolean; +begin + Result := HasSmallImages and (SmallImages.Width <> 0) and (SmallImages.Height <> 0); +end; + +function TCustomdxNativeListViewReportLink.CheckStateImages: Boolean; +begin + Result := HasStateImages and (StateImages.Width <> 0) and (StateImages.Height <> 0); +end; + +procedure TCustomdxNativeListViewReportLink.ClearImages; +begin + if not IsAggregated then + begin + if FLargeImages <> nil then FLargeImages.Clear; + if FSmallImages <> nil then FSmallImages.Clear; + if FStateImages <> nil then FStateImages.Clear; + end; +end; + +procedure TCustomdxNativeListViewReportLink.CreateImages; +begin + FLargeImages := TImageList.Create(nil); + FSmallImages := TImageList.Create(nil); + FStateImages := TImageList.Create(nil); +end; + +procedure TCustomdxNativeListViewReportLink.DeleteImages; +begin + FreeAndNil(FStateImages); + FreeAndNil(FSmallImages); + FreeAndNil(FLargeImages); +end; + +function TCustomdxNativeListViewReportLink.GetLargeImages: TCustomImageList; +begin + if FLargeImages.Count = 0 then + CopyImages(ListView_GetImageList(ListViewHandle, LVSIL_NORMAL), FLargeImages); + Result := FLargeImages; +end; + +function TCustomdxNativeListViewReportLink.GetSmallImages: TCustomImageList; +begin + if FSmallImages.Count = 0 then + CopyImages(ListView_GetImageList(ListViewHandle, LVSIL_SMALL), FSmallImages); + Result := FSmallImages; +end; + +function TCustomdxNativeListViewReportLink.GetStateImages: TCustomImageList; +begin + if FStateImages.Count = 0 then + CopyImages(ListView_GetImageList(ListViewHandle, LVSIL_STATE), FStateImages); + Result := FStateImages; +end; + +function TCustomdxNativeListViewReportLink.HasLargeImages: Boolean; +begin + Result := ListView_GetImageList(ListViewHandle, LVSIL_NORMAL) <> 0; +end; + +function TCustomdxNativeListViewReportLink.HasSmallImages: Boolean; +begin + Result := ListView_GetImageList(ListViewHandle, LVSIL_SMALL) <> 0; +end; + +function TCustomdxNativeListViewReportLink.HasStateImages: Boolean; +begin + Result := ListView_GetImageList(ListViewHandle, LVSIL_STATE) <> 0; +end; + +procedure TCustomdxNativeListViewReportLink.AddExtraImage(AParent: TdxReportCell; + ACol, ARow: Integer; R: TRect); +const + ItemClasses: array [Boolean] of TdxReportCellDataClass = (TdxReportCellImage, TdxReportCellCheck); +var + Item: TAbstractdxReportCellData; +begin + Item := ItemClasses[LV_AreCheckBoxes].Create(AParent); + with Item do + begin + Item.BoundsRect := R; + AssignData(ACol, ARow, Item); + TdxReportCellText(Item).Text := ''; + if R.Right <> R.Left then + Item.CellSides := GetCellSides(ACol, ARow) - [csRight]; + if IsDrawBorder then + Item.CellSides := Item.CellSides + [csLeft]; + DoInitializeItem(ACol, ARow, Item); + end; + + if LV_AreCheckBoxes then + begin + TdxReportCellCheck(Item).Checked := IsItemChecked(ARow); + TdxReportCellCheck(Item).BoldBorder := True; + end + else + begin + TdxReportCellImage(Item).ImageList := StateImages; + TdxReportCellImage(Item).ImageIndex := LV_GetItemStateIndex(ACol, ARow); + TdxReportCellImage(Item).MakeSpaceForEmptyImage := True; + end; +end; + +function TCustomdxNativeListViewReportLink.IsExtraImageRequired(ACol, ARow: Integer): Boolean; +begin + Result := IsReportStyle and (ACol = 0) and not IsFixedRow(ARow) and CheckStateImages; +end; + +procedure TCustomdxNativeListViewReportLink.CalculateColumnIndexes; +begin + FColumnIndexes.Clear; + FColumnIndexes.Count := ColCount; + ListView_GetColumnOrderArray(ListViewHandle, FColumnIndexes.Count, PInteger(FColumnIndexes.List)); +end; + +function TCustomdxNativeListViewReportLink.CalculateHeaderRowHeight: Integer; +var + MinRowHeight: Integer; +begin + Result := 1 + LV_GetHeaderHeight + 1; + MinRowHeight := Renderer.CalcTextPatternHeight(ScreenDC, HeaderFont); + if Result < MinRowHeight then + Result := MinRowHeight +end; + +function TCustomdxNativeListViewReportLink.CalculateRowHeight: Integer; +var + MinRowHeight: Integer; +begin + Result := 1 + LV_GetRowHeight + 1; + MinRowHeight := Renderer.CalcTextPatternHeight(ScreenDC, Font); + if Result < MinRowHeight then + Result := MinRowHeight +end; + +function TCustomdxNativeListViewReportLink.CanHasStateImage(ACol, ARow: Integer): Boolean; +begin + Result := not LV_AreCheckBoxes and (not IsReportStyle or ((ACol = 0) and not IsFixedRow(ARow))); +end; + +function TCustomdxNativeListViewReportLink.IsItemChecked(ARow: Integer): Boolean; +begin + Result := IsReportStyle and not IsFixedRow(ARow) and LV_GetIsItemChecked(ARow - Ord(ShowColumnHeaders)); +end; + +procedure TCustomdxNativeListViewReportLink.LoadAllOwnerData; +var + Item: TNMLVCacheHint; +begin + with Item, hdr do + begin + hwndFrom := ListViewHandle; + idFrom:= ListViewHandle; + code := LVN_ODCACHEHINT; + iFrom := 0; + iTo := LV_GetItemCount - 1; + end; + SendMessage(ListViewHandle, WM_NOTIFY, ListViewHandle, Integer(@Item)); +end; + +procedure TCustomdxNativeListViewReportLink.CalculateInternalItemsViewInfo; + + procedure CalculateItemSize(var AWidth, AHeight: Integer); + var + I, CurWidth, CurHeight: Integer; + begin + with LV_GetItemSpacing do + begin + AWidth := Width; + AHeight := Height; + end; + + for I := 0 to InternalItemCount - 1 do + with InternalItems[I] do + if IsIconStyle then + begin + CurHeight := MeasureContentHeight(ScreenDC); + if AHeight < CurHeight then AHeight := CurHeight; + end + else + begin + CurWidth := MeasureContentWidth(ScreenDC); + if AWidth < CurWidth then AWidth := CurWidth; + end; + end; + + procedure CalculateColRowCount(AWidth, AHeight: Integer); + begin + if (LV_GetViewStyle = vsList) or (LV_GetIconArrangement = iaLeft) then + begin + FRowCount := (AvailableSiteHeight - FItemSpaceVert) div (FRowHeight + FItemSpaceVert); + if (FRowCount = 0) and (InternalItemCount <> 0) then + FRowCount := 1; + if FRowCount > InternalItemCount then + FRowCount := InternalItemCount; + FColumnCount := InternalItemCount div FRowCount; + if InternalItemCount mod FRowCount <> 0 then + Inc(FColumnCount); + end + else + begin + FColumnCount := (AvailableSiteWidth - FItemSpaceHorz) div (FColumnWidth + FItemSpaceHorz); + if (FColumnCount = 0) and (InternalItemCount <> 0) then + FColumnCount := 1; + if FColumnCount > InternalItemCount then + FColumnCount := InternalItemCount; + + FRowCount := InternalItemCount div FColumnCount; + if InternalItemCount mod FColumnCount <> 0 then + Inc(FRowCount); + end; + end; + +begin + CalculateItemSize(FColumnWidth, FRowHeight); + CalculateColRowCount(FColumnWidth, FRowHeight); +end; + +procedure TCustomdxNativeListViewReportLink.CreateExtraInternalItems(ATemporaryParent: TdxReportCell); +var + I: Integer; + R: TRect; + LVItemCount: Integer; + Item: TAbstractdxReportCellData; +begin + if InternalItemCount <> 0 then + begin + with LV_GetItemSpacing do + R := Rect(0, 0, Width, Height); + + FInternalItemsCreating := True; + try + LVItemCount := LV_GetItemCount; + for I := 0 to ColCount * RowCount - LVItemCount - 1 do + begin + Item := CreateDataItem(ATemporaryParent, 0, LVItemCount + I, R); + FInternalItems.Add(Item); + end; + finally + FInternalItemsCreating := False; + end; + end; +end; + +procedure TCustomdxNativeListViewReportLink.CreateInternalItems(ATemporaryParent: TdxReportCell); +var + R: TRect; + I: Integer; + Item: TAbstractdxReportCellData; +begin + if LV_GetItemCount = 0 then Exit; + + with LV_GetItemSpacing do + R := Rect(0, 0, Width, Height); + FInternalItemsCreating := True; + try + for I := 0 to LV_GetItemCount - 1 do + if not OnlySelected or (LV_GetSelectedCount = 0) or LV_GetIsItemSelected(I) then + begin + Item := CreateDataItem(ATemporaryParent, 0, I, R); + FInternalItems.Add(Item); + end; + finally + FInternalItemsCreating := False; + end; +end; + +function TCustomdxNativeListViewReportLink.GetFlatInternalItemIndex(ACol, ARow: Integer): Integer; +begin + if (LV_GetViewStyle = vsList) or (LV_GetIconArrangement = iaLeft) then + Result := ACol * FRowCount + ARow + else + Result := ARow * FColumnCount + ACol; +end; + +procedure TCustomdxNativeListViewReportLink.InitializeInternalItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +begin +end; + +function TCustomdxNativeListViewReportLink.PlaceInternalItem(AParent: TdxReportCell; + ACol, ARow: Integer; R: TRect): TAbstractdxReportCellData; +var + Index: Integer; +begin + Index := GetFlatInternalItemIndex(ACol, ARow); + if Index < InternalItemCount then + begin + Result := InternalItems[Index]; + Result.Parent := AParent; + Result.BoundsRect := R; + InitializeInternalItem(Result, Index); + end + else + Result := nil; +end; + +procedure TCustomdxNativeListViewReportLink.SetupInternalItemsCellSides; +var + Col, Row, Index: Integer; +begin + for Col := 0 to ColCount - 1 do + for Row := 0 to RowCount - 1 do + begin + Index := GetFlatInternalItemIndex(Col, Row); + if Index < InternalItemCount then + InternalItems[Index].CellSides := GetCellSides(Col, Row); + end; +end; + +function TCustomdxNativeListViewReportLink.IsIconStyle: Boolean; +begin + Result := LV_GetViewStyle = vsIcon; +end; + +function TCustomdxNativeListViewReportLink.IsReportStyle: Boolean; +begin + Result := LV_GetViewStyle = vsReport; +end; + +function TCustomdxNativeListViewReportLink.GetHeaderColor: TColor; +begin + Result := FixedColor; +end; + +function TCustomdxNativeListViewReportLink.GetHeaderFont: TFont; +begin + Result := FixedFont; +end; + +function TCustomdxNativeListViewReportLink.GetHeaderTransparent: Boolean; +begin + Result := FixedTransparent; +end; + +function TCustomdxNativeListViewReportLink.GetIncludeHeaders: Boolean; +begin + Result := IncludeFixed; +end; + +function TCustomdxNativeListViewReportLink.GetImages: TCustomImageList; +begin + if IsIconStyle then + Result := LargeImages + else + Result := SmallImages; +end; + +function TCustomdxNativeListViewReportLink.GetInternalItem(Index: Integer): TAbstractdxReportCellData; +begin + Result := TAbstractdxReportCellData(FInternalItems[Index]); +end; + +function TCustomdxNativeListViewReportLink.GetInternalItemCount: Integer; +begin + Result := FInternalItems.Count; +end; + +function TCustomdxNativeListViewReportLink.GetOptions: TdxListViewPaintOptions; +begin + Result := FOptions; +end; + +procedure TCustomdxNativeListViewReportLink.SetHeaderColor(Value: TColor); +begin + FixedColor := Value; +end; + +procedure TCustomdxNativeListViewReportLink.SetHeaderFont(Value: TFont); +begin + FixedFont := Value; +end; + +procedure TCustomdxNativeListViewReportLink.SetHeaderTransparent(Value: Boolean); +begin + FixedTransparent := Value; +end; + +procedure TCustomdxNativeListViewReportLink.SetIncludeHeaders(Value: Boolean); +begin + IncludeFixed := Value; +end; + +procedure TCustomdxNativeListViewReportLink.SetOptions(Value: TdxListViewPaintOptions); +begin + if FOptions <> Value then + begin + FOptions := Value; + //if lvpoBestColumnWidth in Options then RowAutoHeight := False; + LinkModified(True); + end; +end; + +{ TdxNativeListViewReportLink } + +function TdxNativeListViewReportLink.DataProviderPresent: Boolean; +begin + if DataSource = rldsComponent then + Result := IsWindow(ListViewHandle) + else + Result := inherited DataProviderPresent; +end; + +procedure TdxNativeListViewReportLink.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if (Operation = opRemove) and (AComponent is TWinControl) and TWinControl(Component).HandleAllocated and + (TWinControl(Component).Handle = ListViewHandle) then + ListViewHandle := 0; +end; + +function TdxNativeListViewReportLink.GetDesignerClass: TdxReportLinkDesignWindowClass; +begin + Result := TdxfmLVReportLinkDesignWindow; +end; + +function TdxNativeListViewReportLink.GetListViewHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; +begin + Result := FListViewHandle; +end; + +procedure TdxNativeListViewReportLink.SetListViewHandle( + Value: {$IFDEF BCB}Integer {$ELSE} HWND{$ENDIF}); +begin + // TODO: invalid report data + if (FListViewHandle <> Value) and IsWindow(Value) then + begin + FListViewHandle := Value; + LinkModified(True); + end; +end; + +{ TCustomdxListViewReportLink } + +procedure TCustomdxListViewReportLink.Assign(Source: TPersistent); +begin + if Source is TCustomdxListViewReportLink then + with TCustomdxListViewReportLink(Source) do + begin + Self.ShowColumnHeaders := ShowColumnHeaders; + end; + inherited; +end; + +class function TCustomdxListViewReportLink.Aggregable: Boolean; +begin + Result := True; +end; + +procedure TCustomdxListViewReportLink.AssignData(ACol, ARow: Integer; + ADataItem: TAbstractdxReportCellData); +begin + inherited; + + if IsReportStyle then + if IsFixedRow(ARow) then + begin + ADataItem.Parent.Data := 0; + ADataItem.Data := ACol; + end + else + begin + ADataItem.Parent.Data := Integer(TObject(ListViewGetItems(CustomListView)[ARow - Ord(ShowColumnHeaders)])); + ADataItem.Data := ACol - 1; + end; +end; + +procedure TCustomdxListViewReportLink.CustomDraw(AItem: TAbstractdxReportCellData; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); +var + DrawInfo: TdxListViewReportLinkCustomDrawInfo; +begin + GetCustomDrawInfo(AItem, DrawInfo); + with DrawInfo do + case AttributeID of + dxListViewHeaderID: + DoCustomDrawHeader(ACanvas, ABoundsRect, HeaderIndex, TdxReportCellImage(AItem), ADone); + dxListViewItemID: + DoCustomDrawItem(ACanvas, ABoundsRect, ListItem, SubItem, TdxReportCellImage(AItem), ADone); + end; +end; + +procedure TCustomdxListViewReportLink.DoInitializeHeader(ACol, ARow: Integer; + ADataItem: TAbstractdxReportCellData); +begin + if Assigned(FOnInitializeHeader) then + FOnInitializeHeader(Self, ARow, ACol, ADataItem); +end; + +procedure TCustomdxListViewReportLink.DoInitializeItem(ACol, ARow: Integer; + ADataItem: TAbstractdxReportCellData); +begin + if IsFixedRow(ARow) then + DoInitializeHeader(ACol, ARow, ADataItem) + else + inherited; +end; + +procedure TCustomdxListViewReportLink.InternalRestoreFromOriginal; +begin + inherited; + ShowColumnHeaders := ListViewGetShowColumnHeaders(CustomListView); +end; + +procedure TCustomdxListViewReportLink.InternalRestoreDefaults; +begin + inherited; + ShowColumnHeaders := True; +end; + +procedure TCustomdxListViewReportLink.PrepareConstruct(AReportCells: TdxReportCells); +begin + CustomListView.HandleNeeded; + inherited; +end; + +function TCustomdxListViewReportLink.GetListViewHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; +begin + Result := CustomListView.Handle; +end; + +function TCustomdxListViewReportLink.GetShowColumnHeaders: Boolean; +begin + Result := FShowColumnHeaders; +end; + +function TCustomdxListViewReportLink.HasSupportForInvisibledColumnHeaders: Boolean; +begin + Result := True; +end; + +procedure TCustomdxListViewReportLink.InitializeInternalItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +begin + inherited; + if AnIndex < LV_GetItemCount then + begin + AnItem.Data := Integer(TObject(ListViewGetItems(CustomListView)[AnIndex])); + AnItem.Parent.Data := 0; + end; +end; + +function TCustomdxListViewReportLink.IsItemChecked(ARow: Integer): Boolean; +begin + Result := IsReportStyle and not IsFixedRow(ARow) and + ListViewGetItems(CustomListView)[ARow - Ord(ShowColumnHeaders)].Checked; +end; + +procedure TCustomdxListViewReportLink.LoadAllOwnerData; +const + Request: TItemRequest = [irText, irImage, irState]; +var + I: Integer; +begin + inherited; + for I := 0 to LV_GetItemCount - 1 do + ListViewOwnerDataFetch(CustomListView, I, Request); +end; + +procedure TCustomdxListViewReportLink.SetListViewHandle( + Value: {$IFDEF BCB}Integer {$ELSE} HWND{$ENDIF}); +begin +end; + +procedure TCustomdxListViewReportLink.SetShowColumnHeaders(Value: Boolean); +begin + if FShowColumnHeaders <> Value then + begin + FShowColumnHeaders := Value; + LinkModified(True); + end; +end; + +function TCustomdxListViewReportLink.GetLargeImages: TCustomImageList; +begin + if IsAggregated then + Result := ListViewGetLargeImages(CustomListView) + else + Result := inherited GetLargeImages; +end; + +function TCustomdxListViewReportLink.GetSmallImages: TCustomImageList; +begin + if IsAggregated then + Result := ListViewGetSmallImages(CustomListView) + else + Result := inherited GetSmallImages; +end; + +function TCustomdxListViewReportLink.GetStateImages: TCustomImageList; +begin + if IsAggregated then + Result := ListViewGetStateImages(CustomListView) + else + Result := inherited GetStateImages; +end; + +function TCustomdxListViewReportLink.GetCustomListView: TCustomListView; +begin + Result := TCustomListView(Component); +end; + +procedure TCustomdxListViewReportLink.DoCustomDrawHeader(ACanvas: TCanvas; + ARect: TRect; AHeaderIndex: Integer; AnItem: TdxReportCellImage; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawHeader) then + FOnCustomDrawHeader(Self, ACanvas, ARect, AHeaderIndex, AnItem, ADone); +end; + +procedure TCustomdxListViewReportLink.DoCustomDrawItem(ACanvas: TCanvas; + ARect: TRect; AListItem: TListItem; ASubItem: Integer; AnItem: TdxReportCellImage; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawItem) then + FOnCustomDrawItem(Self, ACanvas, ARect, AListItem, ASubItem, AnItem, ADone); +end; + +procedure TCustomdxListViewReportLink.GetCustomDrawInfo(AnItem: TAbstractdxReportCellData; + var ACustomDrawInfo: TdxListViewReportLinkCustomDrawInfo); +begin + FillChar(ACustomDrawInfo, SizeOf(ACustomDrawInfo), 0); + with ACustomDrawInfo do + begin + if IsReportStyle and (AnItem.Parent.Data = 0) then + AttributeID := dxListViewHeaderID + else + AttributeID := dxListViewItemID; + + case AttributeID of + dxListViewHeaderID: + HeaderIndex := AnItem.Data; + dxListViewItemID: + if IsReportStyle then + begin + ListItem := TObject(AnItem.Parent.Data) as TListItem; + SubItem := AnItem.Data; + end + else + ListItem := TObject(AnItem.Data) as TListItem; + end; + end; +end; + +procedure TCustomdxListViewReportLink.SetOnCustomDrawHeader(Value: TdxCustomDrawListViewHeaderEvent); +begin + if @OnCustomDrawHeader <> @Value then + begin + OnCustomDrawHeader := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TCustomdxListViewReportLink.SetOnCustomDrawItem(Value: TdxCustomDrawListViewItemEvent); +begin + if @FOnCustomDrawItem <> @Value then + begin + FOnCustomDrawItem:= Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +{ TdxListViewReportLink } + +function TdxListViewReportLink.GetListView: TListView; +begin + Result := TListView(Component); +end; + +{$IFDEF REGISTERSHELLCTRLS} + +{ TCustomdxShellListViewReportLink } + +function TCustomdxShellListViewReportLink.HasStateImages: Boolean; +begin + Result := not IsReportStyle or inherited HasStateImages; +end; + +procedure TCustomdxShellListViewReportLink.CreateImages; +begin +end; + +procedure TCustomdxShellListViewReportLink.DeleteImages; +begin +end; + +function TCustomdxShellListViewReportLink.GetLargeImages: TCustomImageList; +begin + Result := dxPSUtl.ShellLargeImages; +end; + +function TCustomdxShellListViewReportLink.GetSmallImages: TCustomImageList; +begin + Result := dxPSUtl.ShellSmallImages; +end; + +function TCustomdxShellListViewReportLink.GetStateImages: TCustomImageList; +begin + Result := dxPSUtl.ShellSmallImages; +end; + +function TCustomdxShellListViewReportLink.GetShellListView: TShellListView; +begin + Result := TShellListView(Component); +end; + +{$ENDIF} + +{ TdxfmLVReportLinkDesignWindow } + +constructor TdxfmLVReportLinkDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxPSGlbl.dxhcListViewReportLinkDesigner; + inherited; + CreateControls; + PageControl1.ActivePage := PageControl1.Pages[0]; + imgHint.Picture.Assign(dxExtCtrls.WarningSignBitmap); +end; + +procedure TdxfmLVReportLinkDesignWindow.DoInitialize; +begin + inherited; + + chbxShowBorders.Checked := lvpoBorder in ReportLink.Options; + chbxShowHorzLines.Checked := lvpoHorzLines in ReportLink.Options; + chbxShowVertLines.Checked := lvpoVertLines in ReportLink.Options; + chbxShowColumnHeaders.Visible := ReportLink.HasSupportForInvisibledColumnHeaders; + chbxShowColumnHeaders.Checked := ReportLink.ShowColumnHeaders; + + chbxAutoWidth.Checked := ReportLink.AutoWidth; + chbxRowAutoHeight.Checked := ReportLink.RowAutoHeight; + with cbxDrawMode do + ItemIndex := Items.IndexOfObject(TObject(ReportLink.DrawMode)); + + chbxTransparent.Checked := ReportLink.Transparent; + TdxPSColorCombo(FccbxColor).ColorValue := ColorToRGB(ReportLink.Color); + TdxPSColorCombo(FccbxEvenColor).ColorValue := ColorToRGB(ReportLink.EvenColor); + chbxTransparentHeaders.Checked := ReportLink.HeaderTransparent; + TdxPSColorCombo(FccbxFixedColor).ColorValue := ColorToRGB(ReportLink.HeaderColor); + TdxPSColorCombo(FccbxGridLineColor).ColorValue := ColorToRGB(ReportLink.GridLineColor); + + FontInfoToText(ReportLink.Font, edFont); + FontInfoToText(ReportLink.EvenFont, edEvenFont); + FontInfoToText(ReportLink.HeaderFont, edFixedFont); + + chbxHeadersOnEveryPage.Checked := ReportLink.HeadersOnEveryPage; + chbxOnlySelected.Checked := ReportLink.OnlySelected; + chbxIncludeFixed.Checked := ReportLink.IncludeFixed; + + chbxUse3DEffects.Checked := ReportLink.Effects3D; + chbxUseSoft3D.Checked := ReportLink.Soft3D; +end; + +{$IFDEF DELPHI7} +function TdxfmLVReportLinkDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +procedure TdxfmLVReportLinkDesignWindow.LoadStrings; +begin + inherited; + + lblHint.Caption := cxGetResourceString(@sdxHintListViewDesignerMessage); + + tshOptions.Caption := cxGetResourceString(@sdxOptions); + tshFont.Caption := cxGetResourceString(@sdxFonts); + tshColor.Caption := cxGetResourceString(@sdxColors); + tshBehaviors.Caption := cxGetResourceString(@sdxBehaviors); + lblPreview.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + lblShow.Caption := cxGetResourceString(@sdxShow); + chbxShowBorders.Caption := cxGetResourceString(@sdxBorderLines); + chbxShowHorzLines.Caption := cxGetResourceString(@sdxHorzLines); + chbxShowVertLines.Caption := cxGetResourceString(@sdxVertLines); + chbxShowColumnHeaders.Caption := cxGetResourceString(@sdxColumnHeaders); + + lblMiscellaneous.Caption := cxGetResourceString(@sdxMiscellaneous); + chbxAutoWidth.Caption := cxGetResourceString(@sdxAutoWidth); + chbxRowAutoHeight.Caption := cxGetResourceString(@sdxRowAutoHeight); + lblDrawMode.Caption := cxGetResourceString(@sdxDrawMode); + with cbxDrawMode.Items do + begin + BeginUpdate; + try + Clear; + AddObject(cxGetResourceString(@sdxDrawModeStrict), TObject(gdmStrict)); + AddObject(cxGetResourceString(@sdxDrawModeOddEven), TObject(gdmOddEven)); + AddObject(cxGetResourceString(@sdxDrawModeChess), TObject(gdmChess)); + finally + EndUpdate; + end; + end; + + stTransparent.Caption := ' ' + cxGetResourceString(@sdxTransparent) + ' '; + lblColor.Caption := cxGetResourceString(@sdxColor); + lblEvenColor.Caption := cxGetResourceString(@sdxEvenColor); + stTransparentHeaders.Caption := ' ' + cxGetResourceString(@sdxHeadersTransparent) + ' '; + lblHeadersColor.Caption := cxGetResourceString(@sdxHeaderColor); + lblGridLinesColor.Caption := cxGetResourceString(@sdxGridLinesColor); + + btnFont.Caption := cxGetResourceString(@sdxBtnFont); + btnEvenFont.Caption := cxGetResourceString(@sdxBtnEvenFont); + btnHeadersFont.Caption := cxGetResourceString(@sdxBtnHeadersFont); + + lblOnEveryPage.Caption := cxGetResourceString(@sdxOnEveryPage); + chbxHeadersOnEveryPage.Caption := cxGetResourceString(@sdxHeadersOnEveryPage); + + lblSelection.Caption := cxGetResourceString(@sdxSelection); + chbxOnlySelected.Caption := cxGetResourceString(@sdxOnlySelected); + chbxIncludeFixed.Caption := cxGetResourceString(@sdxIncludeFixed); + + lblLookAndFeel.Caption := cxGetResourceString(@sdxLookAndFeel); + chbxUse3DEffects.Caption := cxGetResourceString(@sdxUse3DEffects); + chbxUseSoft3D.Caption := cxGetResourceString(@sdxSoft3D); +end; + +procedure TdxfmLVReportLinkDesignWindow.PaintPreview(ACanvas: TCanvas; R: TRect); +begin + inherited; + dxPSDrawGridPreview(ACanvas, R, ReportLink, False, ReportLink.ShowColumnHeaders); +end; + +procedure TdxfmLVReportLinkDesignWindow.UpdateControlsState; +begin + inherited; + FccbxColor.Enabled := not chbxTransparent.Checked; + lblColor.Enabled := FccbxColor.Enabled; + FccbxEvenColor.Enabled := not chbxTransparent.Checked and (ReportLink.DrawMode in [gdmOddEven, gdmChess]); + lblEvenColor.Enabled := FccbxEvenColor.Enabled; + FccbxFixedColor.Enabled := not chbxTransparentHeaders.Checked; + lblHeadersColor.Enabled := FccbxFixedColor.Enabled; + + btnEvenFont.Enabled := ReportLink.DrawMode in [gdmOddEven, gdmChess]; + if ReportLink.DrawMode in [gdmOddEven, gdmChess] then + begin + lblColor.Caption := cxGetResourceString(@sdxOddColor); + btnFont.Caption := cxGetResourceString(@sdxBtnOddFont); + end + else + begin + lblColor.Caption := cxGetResourceString(@sdxColor); + btnFont.Caption := cxGetResourceString(@sdxBtnFont); + end; + chbxHeadersOnEveryPage.Enabled := not ReportLink.IsAggregated; + chbxIncludeFixed.Enabled := chbxOnlySelected.Enabled and chbxOnlySelected.Checked; + chbxUseSoft3D.Enabled := chbxUse3DEffects.Checked; +end; + +procedure TdxfmLVReportLinkDesignWindow.UpdatePreview; +begin + FPreviewBox.Invalidate; +end; + +function TdxfmLVReportLinkDesignWindow.GetReportLink: TCustomdxNativeListViewReportLink; +begin + Result := inherited ReportLink as TCustomdxNativeListViewReportLink; +end; + +procedure TdxfmLVReportLinkDesignWindow.CreateControls; + + function CreateColorCombo(AParent: TWinControl; AHost: TControl; + ATag: Integer; AAutoColor: TColor; ALabel: TLabel): TdxPSColorCombo; + begin + Result := TdxPSColorCombo.Create(Self); + with Result do + begin + BoundsRect := AHost.BoundsRect; + Tag := MakeTTag(ATag); + Parent := AParent; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := AAutoColor; + OnChange := ccbxColorChange; + end; + ALabel.FocusControl := Result; + AHost.Visible := False; + end; + + procedure CreatePreviewBox; + var + R: TRect; + begin + FPreviewBox := TdxPSPaintPanel.Create(Self); + with FPreviewBox do + begin + Parent := pnlPreview; + R := pnlPreview.BoundsRect; + OffsetRect(R, -R.Left, -R.Top); + InflateRect(R, -1, -1); + BoundsRect := R; + EdgeInner := esNone; + EdgeOuter := esNone; + OnPaint := pbxPreviewPaint; + end; + end; + +begin + CreatePreviewBox; + + FccbxColor := + CreateColorCombo(gbxTransparent, bvlColorHost, 0, dxDefaultColor, lblColor); + FccbxEvenColor := + CreateColorCombo(gbxTransparent, bvlEvenColorHost, 1, dxDefaultColor, lblEvenColor); + FccbxFixedColor := + CreateColorCombo(gbxTransparentHeaders, bvlHeadersColorHost, 2, dxDefaultFixedColor, lblHeadersColor); + FccbxGridLineColor := + CreateColorCombo(pnlColor, bvlGridLineColorHost, 3, dxDefaultGridLineColor, lblGridLinesColor); +end; + +procedure TdxfmLVReportLinkDesignWindow.CMDialogChar(var message: TCMDialogChar); +var + I: Integer; +begin + inherited; + with PageControl1 do + for I := 0 to PageCount - 1 do + if IsAccel(message.CharCode, Pages[I].Caption) then + begin + message.Result := 1; + ActivePage := Pages[I]; + Exit; + end; +end; + +procedure TdxfmLVReportLinkDesignWindow.cbxDrawModeClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TComboBox(Sender) do + ReportLink.DrawMode := TdxGridDrawMode(Items.Objects[ItemIndex]); + Modified := True; + UpdatePreview; +end; + +procedure TdxfmLVReportLinkDesignWindow.cbxDrawModeDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +begin + dxPSBaseGridLnk.dxPSDrawComboDrawModeItem(Control, Index, Rect, State); +end; + +procedure TdxfmLVReportLinkDesignWindow.chbxShowBordersClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TCheckBox(Sender) do + if Checked then + ReportLink.Options := ReportLink.Options + [TdxListViewPaintOption(TTagToInt(Tag))] + else + ReportLink.Options := ReportLink.Options - [TdxListViewPaintOption(TTagToInt(Tag))]; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmLVReportLinkDesignWindow.chbxShowColumnHeadersClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.ShowColumnHeaders := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmLVReportLinkDesignWindow.chbxAutoWidthClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.AutoWidth := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxfmLVReportLinkDesignWindow.chbxRowAutoHeightClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.RowAutoHeight := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxfmLVReportLinkDesignWindow.chbxTransparentClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + case TTagToInt(TCheckBox(Sender).Tag) of + 0: ReportLink.Transparent := TCheckBox(Sender).Checked; + 1: ReportLink.HeaderTransparent := TCheckBox(Sender).Checked; + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmLVReportLinkDesignWindow.stTransparentClick(Sender: TObject); +begin + if chbxTransparent.CanFocus then ActiveControl := chbxTransparent; + chbxTransparent.Checked := not chbxTransparent.Checked; +end; + +procedure TdxfmLVReportLinkDesignWindow.stTransparentHeadersClick(Sender: TObject); +begin + if chbxTransparentHeaders.CanFocus then ActiveControl := chbxTransparentHeaders; + chbxTransparentHeaders.Checked := not chbxTransparentHeaders.Checked; +end; + +procedure TdxfmLVReportLinkDesignWindow.ccbxColorChange(Sender: TObject); +var + AColor: TColor; +begin + if LockControlsUpdate then Exit; + AColor := TdxPSColorCombo(Sender).ColorValue; + case TTagToInt(TdxPSColorCombo(Sender).Tag) of + 0: ReportLink.Color := AColor; + 1: ReportLink.EvenColor := AColor; + 2: ReportLink.FixedColor := AColor; + 3: ReportLink.GridLineColor := AColor; + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmLVReportLinkDesignWindow.btnFontClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + + with dxPSGlbl.FontDialog do + begin + case TTagToInt(TButton(Sender).Tag) of + 0: Font := ReportLink.Font; + 1: Font := ReportLink.EvenFont; + 2: Font := ReportLink.HeaderFont; + end; + + if Execute then + begin + case TTagToInt(TButton(Sender).Tag) of + 0: + begin + ReportLink.Font := Font; + FontInfoToText(ReportLink.Font, edFont); + end; + 1: + begin + ReportLink.EvenFont := Font; + FontInfoToText(ReportLink.EvenFont, edEvenFont); + end; + 2: + begin + ReportLink.FixedFont := Font; + FontInfoToText(ReportLink.HeaderFont, edFixedFont); + end; + end; + Modified := True; + UpdatePreview; + end; + end; +end; + +procedure TdxfmLVReportLinkDesignWindow.chbxHeadersOnEveryPageClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.HeadersOnEveryPage := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxfmLVReportLinkDesignWindow.chbxOnlySelectedClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OnlySelected := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxfmLVReportLinkDesignWindow.chbxIncludeFixedClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.IncludeFixed := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxfmLVReportLinkDesignWindow.chbxUse3DEffectsClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.Effects3D := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmLVReportLinkDesignWindow.chbxUseSoft3DClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.Soft3D := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmLVReportLinkDesignWindow.pbxPreviewPaint(Sender: TObject); +begin + with FPreviewBox do + PaintPreview(Canvas, ClientRect); +end; + +procedure TdxfmLVReportLinkDesignWindow.PageControl1Change(Sender: TObject); +begin + lblPreview.Parent := TPageControl(Sender).ActivePage; +end; + +initialization + dxPSRegisterReportLink(TdxListViewReportLink, TListView, TdxfmLVReportLinkDesignWindow); + {$IFDEF REGISTERSHELLCTRLS} + dxPSRegisterReportLink(TdxShellListViewReportLink, TShellListView, TdxfmLVReportLinkDesignWindow); + {$ENDIF} + +finalization + {$IFDEF REGISTERSHELLCTRLS} + dxPSUnregisterReportLink(TdxShellListViewReportLink, TShellListView, TdxfmLVReportLinkDesignWindow); + {$ENDIF} + dxPSUnregisterReportLink(TdxListViewReportLink, TListView, TdxfmLVReportLinkDesignWindow); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSLbxLnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSLbxLnk.dfm new file mode 100644 index 00000000..1e229d01 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSLbxLnk.dfm @@ -0,0 +1,738 @@ +object dxLBxReportLinkDesignWindow: TdxLBxReportLinkDesignWindow + Left = 441 + Top = 302 + BorderStyle = bsDialog + Caption = 'dxLbxReportLinkDesigner' + ClientHeight = 253 + ClientWidth = 553 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 4 + Width = 545 + Height = 214 + ActivePage = tshColor + MultiLine = True + TabOrder = 1 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = '&Options' + object pnlOptions: TPanel + Left = 0 + Top = 0 + Width = 537 + Height = 186 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblShow: TLabel + Left = 5 + Top = 13 + Width = 26 + Height = 13 + Caption = 'Show' + end + object Bevel11: TBevel + Left = 39 + Top = 17 + Width = 209 + Height = 4 + Shape = bsBottomLine + end + object Bevel4: TBevel + Left = 91 + Top = 84 + Width = 156 + Height = 4 + Shape = bsBottomLine + end + object imgGrid: TImage + Left = 10 + Top = 35 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object chbxPaintItemGraphics: TCheckBox + Left = 90 + Top = 103 + Width = 159 + Height = 17 + Caption = '&Paint item graphics' + TabOrder = 2 + OnClick = chbxPaintItemGraphicsClick + end + object chbxShowBorders: TCheckBox + Left = 90 + Top = 32 + Width = 159 + Height = 17 + Caption = 'Border' + TabOrder = 0 + OnClick = chbxShowBordersClick + end + object chbxShowHorzLines: TCheckBox + Tag = 1 + Left = 90 + Top = 54 + Width = 159 + Height = 17 + Caption = 'Horizontal Lines' + TabOrder = 1 + OnClick = chbxShowBordersClick + end + object chbxTransparentGraphics: TCheckBox + Tag = 1 + Left = 90 + Top = 127 + Width = 159 + Height = 17 + Caption = '&Transparent Graphics' + TabOrder = 3 + OnClick = chbxTransparentGraphicsClick + end + object lblPreview: TStaticText + Left = 257 + Top = 1 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 4 + end + end + end + object tshColor: TTabSheet + Caption = '&Color' + object pnlColor: TPanel + Left = 0 + Top = 0 + Width = 537 + Height = 186 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblGridLinesColor: TLabel + Left = 15 + Top = 150 + Width = 84 + Height = 13 + Caption = '&Grid Lines Color : ' + OnClick = lblComboClick + end + object bvlLineColorHolder: TBevel + Left = 97 + Top = 146 + Width = 135 + Height = 21 + Visible = False + end + object lblDrawMode: TLabel + Left = 5 + Top = 13 + Width = 58 + Height = 13 + Caption = 'Draw &Mode:' + FocusControl = cbxDrawMode + OnClick = lblComboClick + end + object gbxTransparent: TGroupBox + Left = 6 + Top = 46 + Width = 237 + Height = 86 + Caption = ' ' + TabOrder = 2 + object lblColor: TLabel + Left = 9 + Top = 24 + Width = 35 + Height = 13 + Caption = 'Co&lor : ' + OnClick = lblComboClick + end + object bvlColorHolder: TBevel + Left = 90 + Top = 20 + Width = 135 + Height = 21 + Visible = False + end + object lblEvenColor: TLabel + Left = 9 + Top = 48 + Width = 59 + Height = 13 + Caption = 'E&ven Color: ' + OnClick = lblComboClick + end + object bvlEvenColorHolder: TBevel + Left = 90 + Top = 49 + Width = 135 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 18 + Top = 44 + Width = 15 + Height = 17 + Caption = 'T&ransparent' + TabOrder = 1 + OnClick = chbxTransparentClick + end + object cbxDrawMode: TComboBox + Left = 95 + Top = 8 + Width = 148 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 0 + OnClick = cbxDrawModeClick + OnDrawItem = cbxDrawModeDrawItem + Items.Strings = ( + 'Simpe' + 'Odd\Even Rows Mode' + 'Chess' + 'Borrow From Source') + end + object stTransparent: TStaticText + Left = 33 + Top = 45 + Width = 76 + Height = 17 + Caption = ' &Transparent ' + FocusControl = chbxTransparent + TabOrder = 3 + OnClick = stTransparentClick + end + end + end + object tshFont: TTabSheet + Caption = '&Font' + object pnlFont: TPanel + Left = 0 + Top = 0 + Width = 537 + Height = 186 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object btnFont: TButton + Left = 8 + Top = 9 + Width = 110 + Height = 23 + Caption = 'Fo&nt ...' + TabOrder = 0 + OnClick = btnFontClick + end + object edFont: TEdit + Left = 8 + Top = 37 + Width = 233 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + end + object btnEvenFont: TButton + Tag = 1 + Left = 8 + Top = 68 + Width = 110 + Height = 23 + Caption = 'E&ven Font ...' + TabOrder = 2 + OnClick = btnFontClick + end + object edEvenFont: TEdit + Left = 8 + Top = 97 + Width = 233 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 3 + end + end + end + object tshBehaviors: TTabSheet + Caption = '&Behaviors' + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 537 + Height = 186 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Image3: TImage + Left = 10 + Top = 35 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblSelection: TLabel + Left = 5 + Top = 13 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object Bevel3: TBevel + Left = 54 + Top = 16 + Width = 194 + Height = 5 + Shape = bsBottomLine + end + object lblMiscellaneous: TLabel + Left = 5 + Top = 88 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + end + object imgMiscellaneous: TImage + Left = 10 + Top = 110 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000008088F07DDDDDDDDDDDD0800000000000000000000 + 807DD0F0FFFF8FFFF8FFFF0FFF0F07DDDDDDDDDDDD0F0F77FFF8F777F8F777F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCDDDDCDDDD0F0F00FFF8F00FF8F00FF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCCCCCDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCDDDDCDDDD0F0FFFFFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCCCCDCCDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCCCCCDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCDCCDDD0F0FFFFFF8F0FFF8F0FFF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0777777777777770FFF0F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F0F8887F8887F8880FFF8F07DDDDDDDDDDDD0F0F888887F88887F88880 + F07DD0F0F0087F0087F0080FFF0F07DDDDDDDDDDDD0F0F800087F80087F80080 + F07DD0F0FFFF7FFFF7FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF7FFFFF7FFFFF0 + F07DD0800000000000000008080807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object Bevel1: TBevel + Left = 79 + Top = 92 + Width = 169 + Height = 4 + Shape = bsBottomLine + end + object chbxOnlySelected: TCheckBox + Left = 90 + Top = 32 + Width = 148 + Height = 17 + Caption = 'Only &selected cells' + TabOrder = 0 + OnClick = chbxOnlySelectedClick + end + object chbxRowAutoHeight: TCheckBox + Left = 90 + Top = 130 + Width = 148 + Height = 17 + Caption = '&Row Auto Height' + TabOrder = 2 + OnClick = chbxRowAutoHeightClick + end + object chbxAutoWidth: TCheckBox + Left = 90 + Top = 106 + Width = 148 + Height = 17 + Caption = 'AutoWidth' + TabOrder = 1 + OnClick = chbxAutoWidthClick + end + end + end + end + object pnlPreview: TPanel + Left = 265 + Top = 47 + Width = 273 + Height = 160 + BevelInner = bvLowered + BevelOuter = bvNone + Color = clWindow + TabOrder = 0 + end + object ilPreview: TImageList + Left = 5 + Top = 223 + Bitmap = { + 494C010101000500040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000002000000001002000000000000020 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000084000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000840000008400000084000000FF000000840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000084 + 000000840000FFFFFF0000FF0000FFFFFF0000FF000000840000008400000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 0000FFFFFF0000FF0000FFFFFF0000FF000000FF000000840000008400000084 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF0000FF0000FFFFFF0000FF0000FFFFFF0000FF000000840000008400000084 + 0000008400000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 0000FFFFFF00FFFFFF0000FF000000FF000000FF000000840000008400000084 + 0000008400000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF0000FF000000FF000000FF000000FF000000FF000000FF0000008400000084 + 0000008400000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF00000084 + 0000008400000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF00000084 + 0000008400000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000084 + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF + 0000008400000084000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000084000000FF000000FF000000FF000000FF000000FF0000008400000084 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000084000000FF000000FF00000084000000840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000840000008400000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFF000000000000FFFF000000000000 + FF3F000000000000F81F000000000000E00F000000000000C007000000000000 + C003000000000000C003000000000000C003000000000000C003000000000000 + C003000000000000E003000000000000F00F000000000000F83F000000000000 + FCFF000000000000FFFF00000000000000000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSLbxLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSLbxLnk.pas new file mode 100644 index 00000000..6c0cbc6a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSLbxLnk.pas @@ -0,0 +1,807 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSLbxLnk; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ComCtrls, ExtCtrls, checklst, ImgList, dxPSGlbl, dxPSCore, + dxPSBaseGridLnk, dxPSGrLnks; + +type + TdxListBoxPaintOption = (lbxpoBorder, lbxpoHorzLines); + TdxListBoxPaintOptions = set of TdxListBoxPaintOption; + + TCustomdxListBoxReportLinkControl = class(TdxCustomListBoxReportLink) + private + FOptions: TdxListBoxPaintOptions; + FPaintItemsGraphics: Boolean; + FTransparentGraphics: Boolean; + function GetOptions: TdxListBoxPaintOptions; + procedure SetOptions(Value: TdxListBoxPaintOptions); + procedure SetPaintItemsGraphics(Value: Boolean); + procedure SetTransparentGraphics(Value: Boolean); + protected + procedure AssignData(ACol, ARow: Integer; ADataItem: TAbstractdxReportCellData); override; + function GetDataItemClass(ACol: Integer; ARow: Integer = 0): TdxReportCellDataClass; override; + procedure InternalRestoreDefaults; override; + function IsDrawBorder: Boolean; override; + function IsDrawHorzLines: Boolean; override; + procedure SetDrawMode(Value: TdxGridDrawMode); override; + + function GetCellHasImage(ACol, ARow: Integer): Boolean; override; + function GetCellImage(ACol, ARow: Integer): TGraphic; override; + function GetCellImageTransparent(ACol, ARow: Integer): Boolean; override; + public + procedure Assign(Source: TPersistent); override; + + property Options: TdxListBoxPaintOptions read GetOptions write SetOptions default [lbxpoBorder..lbxpoHorzLines]; + property PaintItemsGraphics: Boolean read FPaintItemsGraphics write SetPaintItemsGraphics default False; + property TransparentGraphics: Boolean read FTransparentGraphics write SetTransparentGraphics default False; + end; + + TdxListBoxReportLink = class(TCustomdxListBoxReportLinkControl) + private + function GetListBox: TListBox; + public + property ListBox: TListBox read GetListBox; + published + property AutoWidth; + property Color; + property EndEllipsis; + property EvenColor; + property EvenFont; + property Font; + property OddColor; + property OddFont; + property Options; + property Multiline; + property PaintItemsGraphics; + property RowAutoHeight; + property ScaleFonts; + property SupportedCustomDraw; + property Transparent; + property TransparentGraphics; + property UseCustomPageBreaks; + property UseHorzDelimiters; + property UseVertDelimiters; + property Width; + + property OnCustomDrawItem; + property OnGetCustomPageBreaks; + property OnInitializeItem; + end; + + TdxLBxReportLinkDesignWindow = class(TStandarddxReportLinkDesignWindow) + pnlPreview: TPanel; + PageControl1: TPageControl; + tshOptions: TTabSheet; + pnlOptions: TPanel; + tshColor: TTabSheet; + pnlColor: TPanel; + tshFont: TTabSheet; + pnlFont: TPanel; + btnFont: TButton; + edFont: TEdit; + lblGridLinesColor: TLabel; + gbxTransparent: TGroupBox; + lblColor: TLabel; + chbxTransparent: TCheckBox; + ilPreview: TImageList; + bvlColorHolder: TBevel; + bvlLineColorHolder: TBevel; + tshBehaviors: TTabSheet; + Panel1: TPanel; + Image3: TImage; + lblSelection: TLabel; + Bevel3: TBevel; + chbxOnlySelected: TCheckBox; + lblEvenColor: TLabel; + bvlEvenColorHolder: TBevel; + btnEvenFont: TButton; + edEvenFont: TEdit; + chbxPaintItemGraphics: TCheckBox; + lblShow: TLabel; + Bevel11: TBevel; + chbxShowBorders: TCheckBox; + chbxShowHorzLines: TCheckBox; + Bevel4: TBevel; + chbxTransparentGraphics: TCheckBox; + imgGrid: TImage; + lblDrawMode: TLabel; + cbxDrawMode: TComboBox; + lblPreview: TStaticText; + chbxRowAutoHeight: TCheckBox; + lblMiscellaneous: TLabel; + imgMiscellaneous: TImage; + Bevel1: TBevel; + chbxAutoWidth: TCheckBox; + stTransparent: TStaticText; + procedure chbxOnlySelectedClick(Sender: TObject); + procedure ccbxColorChange(Sender: TObject); + procedure btnFontClick(Sender: TObject); + procedure pbxPreviewPaint(Sender: TObject); + procedure chbxPaintItemGraphicsClick(Sender: TObject); + procedure chbxTransparentClick(Sender: TObject); + procedure lblComboClick(Sender: TObject); + procedure chbxShowBordersClick(Sender: TObject); + procedure cbxDrawModeClick(Sender: TObject); + procedure chbxRowAutoHeightClick(Sender: TObject); + procedure chbxTransparentGraphicsClick(Sender: TObject); + procedure PageControl1Change(Sender: TObject); + procedure cbxDrawModeDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure chbxAutoWidthClick(Sender: TObject); + procedure stTransparentClick(Sender: TObject); + private + FccbxColor: TCustomComboBox; + FccbxEvenColor: TCustomComboBox; + FccbxGridLineColor: TCustomComboBox; + FItemCount: Integer; + FPaintWidth: Integer; + FPaintHeight: Integer; + FPreviewBox: TCustomPanel; + FPreviewFont: TFont; + FRectHeight: Integer; + FRectWidth: Integer; + procedure CreateControls; + function GetReportLink: TCustomdxListBoxReportLinkControl; + procedure CMDialogChar(var message: TCMDialogChar); message CM_DIALOGCHAR; + protected + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + procedure LoadStrings; override; + procedure PaintPreview(ACanvas: TCanvas; R: TRect); override; + procedure UpdateControlsState; override; + procedure UpdatePreview; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + property ReportLink: TCustomdxListBoxReportLinkControl read GetReportLink; + end; + +const + dxDefaultListBoxPaintOptions: TdxListBoxPaintOptions = + [Low(TdxListBoxPaintOption)..High(TdxListBoxPaintOption)]; + + dxListBoxStrings: array[0..5] of string = + ('Sample Text Row #1', 'Sample Text Row #2', 'Sample Text Row #3', + 'Sample Text Row #4', 'Sample Text Row #5', 'Sample Text Row #6'); + +implementation + +{$R *.DFM} + +uses + CommCtrl, cxClasses, dxExtCtrls, dxPSRes, dxPrnDev, dxPSUtl; + +{$IFNDEF DELPHI6} +type + TCustomListBoxAccess = class(TCustomListBox); +{$ENDIF} + +{ CustomListBox Helpers } + +function ListBoxGetMultiSelect(ACustomListBox: TCustomListBox): Boolean; +begin + {$IFDEF DELPHI6} + Result := ACustomListBox.MultiSelect; + {$ELSE} + Result := TCustomListBoxAccess(ACustomListBox).MultiSelect; + {$ENDIF} +end; + + { TCustomdxListBoxReportLinkControl } + +procedure TCustomdxListBoxReportLinkControl.Assign(Source: TPersistent); +begin + inherited; + if Source is TCustomdxListBoxReportLinkControl then + begin + Options := TCustomdxListBoxReportLinkControl(Source).Options; + PaintItemsGraphics := TCustomdxListBoxReportLinkControl(Source).PaintItemsGraphics; + end; +end; + +procedure TCustomdxListBoxReportLinkControl.AssignData(ACol, ARow: Integer; + ADataItem: TAbstractdxReportCellData); +var + Obj: TObject; +begin + inherited; + if ADataItem is TdxReportCellImage then + with TdxReportCellImage(ADataItem) do + begin + ImageTransparent := TransparentGraphics; + MakeSpaceForEmptyImage := True; + Obj := CustomListBox.Items.Objects[ARow]; + if Obj is TGraphic then + Image := TGraphic(Obj); + end; +end; + +function TCustomdxListBoxReportLinkControl.GetDataItemClass(ACol: Integer; + ARow: Integer = 0): TdxReportCellDataClass; +begin + if PaintItemsGraphics then + Result := TdxReportCellImage + else + Result := inherited GetDataItemClass(ACol, ARow); +end; + +procedure TCustomdxListBoxReportLinkControl.InternalRestoreDefaults; +begin + inherited; + Options := dxDefaultListBoxPaintOptions; {[Low(TdxListBoxPaintOptions)..High(TdxListBoxPaintOptions)]} + PaintItemsGraphics := False; + TransparentGraphics := False; +end; + +function TCustomdxListBoxReportLinkControl.IsDrawBorder: Boolean; +begin + Result := lbxpoBorder in Options; +end; + +function TCustomdxListBoxReportLinkControl.IsDrawHorzLines: Boolean; +begin + Result := lbxpoHorzLines in Options; +end; + +procedure TCustomdxListBoxReportLinkControl.SetDrawMode(Value: TdxGridDrawMode); +begin + if Value > gdmOddEven then Value := gdmOddEven; + inherited SetDrawMode(Value); +end; + +function TCustomdxListBoxReportLinkControl.GetCellHasImage(ACol, ARow: Integer): Boolean; +begin + if PaintItemsGraphics then + try + Result := CustomListBox.Items.Objects[ARow] is TGraphic; + except + Result := False; + end + else + Result := False; +end; + +function TCustomdxListBoxReportLinkControl.GetCellImage(ACol, ARow: Integer): TGraphic; +begin + Result := TGraphic(CustomListBox.Items.Objects[ARow]); +end; + +function TCustomdxListBoxReportLinkControl.GetCellImageTransparent(ACol, ARow: Integer): Boolean; +begin + Result := TransparentGraphics;; +end; + +function TCustomdxListBoxReportLinkControl.GetOptions: TdxListBoxPaintOptions; +begin + Result := FOptions; +end; + +procedure TCustomdxListBoxReportLinkControl.SetOptions(Value: TdxListBoxPaintOptions); +begin + if FOptions <> Value then + begin + FOptions := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxListBoxReportLinkControl.SetPaintItemsGraphics(Value: Boolean); +begin + if FPaintItemsGraphics <> Value then + begin + FPaintItemsGraphics := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxListBoxReportLinkControl.SetTransparentGraphics(Value: Boolean); +begin + if FTransparentGraphics <> Value then + begin + FTransparentGraphics := Value; + LinkModified(True); + end; +end; + +{ TdxListBoxReportLink } + +function TdxListBoxReportLink.GetListBox: TListBox; +begin + Result := inherited Component as TListBox; +end; + +{ TdxLBxReportLinkDesignWindow } + +constructor TdxLBxReportLinkDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxhcListBoxReportLinkDesigner; + inherited; + CreateControls; + FItemCount := 5; + FRectWidth := FPreviewBox.Width - 15; + FRectHeight := (FPreviewBox.Height - 15) div FItemCount; + FPaintWidth := FRectWidth + 1; + FPaintHeight := FItemCount * (FRectHeight + 1); + PageControl1.ActivePage := PageControl1.Pages[0]; + FPreviewFont := TFont.Create; +end; + +destructor TdxLBxReportLinkDesignWindow.Destroy; +begin + FreeAndNil(FPreviewFont); + inherited; +end; + +procedure TdxLBxReportLinkDesignWindow.CreateControls; +var + R: TRect; +begin + FccbxColor := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(FccbxColor) do + begin + BoundsRect := bvlColorHolder.BoundsRect; + Tag := MakeTTag(0); + Parent := gbxTransparent; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := dxDefaultColor; +// DropDownCount := Items.Count; + OnChange := ccbxColorChange; + end; + lblColor.FocusControl := FccbxColor; + + FccbxEvenColor := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(FccbxEvenColor) do + begin + BoundsRect := bvlEvenColorHolder.BoundsRect; + Tag := MakeTTag(1); + Parent := gbxTransparent; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := dxDefaultColor; +// DropDownCount := Items.Count; + OnChange := ccbxColorChange; + end; + lblEvenColor.FocusControl := FccbxEvenColor; + + FccbxGridLineColor := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(FccbxGridLineColor) do + begin + BoundsRect := bvlLineColorHolder.BoundsRect; + Tag := MakeTTag(2); + Parent := pnlColor; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := dxDefaultGridLineColor; +// DropDownCount := Items.Count; + OnChange := ccbxColorChange; + end; + + lblGridLinesColor.FocusControl := FccbxGridLineColor; + FPreviewBox := TdxPSPaintPanel.Create(Self); + with TdxPSPaintPanel(FPreviewBox) do + begin + Parent := pnlPreview; + R := pnlPreview.BoundsRect; + OffsetRect(R, -R.Left, -R.Top); + InflateRect(R, -1, -1); + BoundsRect := R; + EdgeInner := esNone; + EdgeOuter := esNone; + OnPaint := pbxPreviewPaint; + end; +end; + +{$IFDEF DELPHI7} +function TdxLBxReportLinkDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +procedure TdxLBxReportLinkDesignWindow.LoadStrings; +begin + inherited; + tshOptions.Caption := cxGetResourceString(@sdxOptions); + tshFont.Caption := cxGetResourceString(@sdxFonts); + tshColor.Caption := cxGetResourceString(@sdxColors); + tshBehaviors.Caption := cxGetResourceString(@sdxBehaviors); + lblPreview.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + lblShow.Caption := cxGetResourceString(@sdxShow); + chbxShowBorders.Caption := cxGetResourceString(@sdxBorderLines); + chbxShowHorzLines.Caption := cxGetResourceString(@sdxHorzLines); + chbxPaintItemGraphics.Caption := cxGetResourceString(@sdxPaintItemsGraphics); + chbxTransparentGraphics.Caption := cxGetResourceString(@sdxTransparentGraphics); + + lblDrawMode.Caption := cxGetResourceString(@sdxDrawMode); + with cbxDrawMode.Items do + begin + BeginUpdate; + try + Clear; + AddObject(cxGetResourceString(@sdxDrawModeStrict), TObject(gdmStrict)); + AddObject(cxGetResourceString(@sdxDrawModeOddEven), TObject(gdmOddEven)); + finally + EndUpdate; + end; + end; + + stTransparent.Caption := ' ' + cxGetResourceString(@sdxTransparent) + ' '; + lblColor.Caption := cxGetResourceString(@sdxColor); + lblEvenColor.Caption := cxGetResourceString(@sdxEvenColor); + lblGridLinesColor.Caption := cxGetResourceString(@sdxGridLinesColor); + + btnFont.Caption := cxGetResourceString(@sdxBtnFont); + btnEvenFont.Caption := cxGetResourceString(@sdxBtnEvenFont); + + lblSelection.Caption := cxGetResourceString(@sdxSelection); + chbxOnlySelected.Caption := cxGetResourceString(@sdxOnlySelected); + lblMiscellaneous.Caption := cxGetResourceString(@sdxMiscellaneous); + chbxAutoWidth.Caption := cxGetResourceString(@sdxAutoWidth); + chbxRowAutoHeight.Caption := cxGetResourceString(@sdxRowAutoHeight); +end; + +function TdxLBxReportLinkDesignWindow.GetReportLink: TCustomdxListBoxReportLinkControl; +begin + Result := inherited ReportLink as TCustomdxListBoxReportLinkControl; +end; + +procedure TdxLBxReportLinkDesignWindow.CMDialogChar(var message: TCMDialogChar); +var + I: Integer; +begin + inherited; + with PageControl1 do + for I := 0 to PageControl1.PageCount - 1 do + if IsAccel(message.CharCode, Pages[I].Caption) then + begin + message.Result := 1; + ActivePage := Pages[I]; + Exit; + end; +end; + +procedure TdxLBxReportLinkDesignWindow.UpdateControlsState; + + function IsPaintItemsGraphics: Boolean; + var + I: Integer; + Obj: TObject; + begin + Result := True; + with ReportLink.CustomListBox do + for I := 0 to Items.Count - 1 do + begin + Obj := Items.Objects[I]; + try + if Obj is TGraphic then Exit; + except + end; + end; + Result := False; + end; + +begin + inherited; + + FccbxColor.Enabled := not chbxTransparent.Checked; + lblColor.Enabled := FccbxColor.Enabled; + FccbxEvenColor.Enabled := not chbxTransparent.Checked and + (ReportLink.DrawMode in [gdmOddEven, gdmChess]); + lblEvenColor.Enabled := FccbxEvenColor.Enabled; + + chbxOnlySelected.Enabled := + (ReportLink.CustomListBox = nil) or ListBoxGetMultiSelect(ReportLink.CustomListBox); + chbxPaintItemGraphics.Enabled := + (ReportLink.CustomListBox = nil) or IsPaintItemsGraphics; + chbxTransparentGraphics.Enabled := chbxPaintItemGraphics.Checked; + if ReportLink.DrawMode in [gdmOddEven, gdmChess] then + begin + lblColor.Caption := cxGetResourceString(@sdxOddColor); + btnFont.Caption := cxGetResourceString(@sdxBtnOddFont); + end + else + begin + lblColor.Caption := cxGetResourceString(@sdxColor); + btnFont.Caption := cxGetResourceString(@sdxBtnFont); + end; + btnEvenFont.Enabled := ReportLink.DrawMode in [gdmOddEven, gdmChess]; +// (ReportLink.ListBox.Style in [lbOwnerDrawVariable, lbOwnerDrawFixed]); +end; + +procedure TdxLBxReportLinkDesignWindow.DoInitialize; +begin + inherited; + with cbxDrawMode do + ItemIndex := Items.IndexOfObject(TObject(ReportLink.DrawMode)); + + chbxShowBorders.Checked := lbxpoBorder in ReportLink.Options; + chbxShowHorzLines.Checked := lbxpoHorzLines in ReportLink.Options; + chbxPaintItemGraphics.Checked := ReportLink.PaintItemsGraphics; + chbxTransparentGraphics.Checked := ReportLink.TransparentGraphics; + + chbxTransparent.Checked := ReportLink.Transparent; + TdxPSColorCombo(FccbxColor).ColorValue := ReportLink.Color; + TdxPSColorCombo(FccbxEvenColor).ColorValue := ReportLink.EvenColor; + TdxPSColorCombo(FccbxGridLineColor).ColorValue := ReportLink.GridLineColor; + + FontInfoToText(ReportLink.Font, edFont); + FontInfoToText(ReportLink.EvenFont, edEvenFont); + + chbxOnlySelected.Checked := ReportLink.OnlySelected; + chbxAutoWidth.Checked := ReportLink.AutoWidth; + chbxRowAutoHeight.Checked := ReportLink.RowAutoHeight; +end; + +procedure TdxLBxReportLinkDesignWindow.PaintPreview(ACanvas: TCanvas; R: TRect); +const + C = 6; +var + DC: hDC; + Brush: HBRUSH; + I, dY, Offset: Integer; + R2: TRect; + PrevBkMode: Integer; + PrevFont: HFONT; + PrevFontColor: COLORREF; + S: string; +begin + inherited; + DC := ACanvas.Handle; + //FillRect(DC, R, HBRUSH(COLOR_WINDOW + 1)); + InflateRect(R, -4, -4); + R2 := R; + dY := (R.Bottom - R.Top) div C; + with ReportLink do + begin + Brush := SelectObject(DC, CreateSolidBrush(ColorToRGB(GridLineColor))); + for I := 0 to C do + if (((I = 0) or (I = C)) and IsDrawBorder) or ((I > 0) and (I < C) and IsDrawHorzLines) then + begin + R := MakeRect(R2.Left + 1, R2.Top + I * dY, R2.Right - 1, R2.Top + I * dY + 1); + PatBlt(DC, R.Left, R.Top, R.Right - R.Left, R.Bottom - R.Top, PATCOPY); + end; + if IsDrawBorder then + begin + R := MakeRect(R2.Left, R2.Top, R2.Left + 1, R2.Top + dY * C + 1); + PatBlt(DC, R.Left, R.Top, R.Right - R.Left, R.Bottom - R.Top, PATCOPY); + R := MakeRect(R2.Right - 1, R2.Top, R2.Right, R2.Top + dY * C + 1); + PatBlt(DC, R.Left, R.Top, R.Right - R.Left, R.Bottom - R.Top, PATCOPY); + end; + DeleteObject(SelectObject(DC, Brush)); + PrevBkMode := SetBkMode(DC, Windows.TRANSPARENT); + PrevFont := GetCurrentObject(DC, OBJ_FONT); + PrevFontColor := GetTextColor(DC); + for I := 0 to C - 1 do + begin + R := MakeRect(R2.Left + 1, R2.Top + I * dY + 1, R2.Right - 1, R2.Top + (I + 1) * dY + + Ord(not IsDrawHorzLines and (I < C - 1))); + if not Transparent then + begin + Brush := CreateSolidBrush(ColorToRGB(ReportLink.GetCellColor(0, I))); + FillRect(DC, R, Brush); + DeleteObject(Brush); + end; + Offset := 1; + if PaintItemsGraphics then + begin + Inc(R.Left); + ImageList_DrawEx(ilPreview.Handle, 0, DC, R.Left, R.Top + (dY - ilPreview.Height) div 2, + 0, 0, CLR_NONE, CLR_NONE, ILD_NORMAL); + Inc(Offset, ilPreview.Width + 1); + end; + Inc(R.Left, Offset); + InflateRect(R, -2, -2); + FPreviewFont.Assign(ReportLink.GetCellFont(0, I)); + FPreviewFont.Size := 8; + SelectObject(DC, FPreviewFont.Handle); + SetTextColor(DC, ColorToRGB(FPreviewFont.Color)); + S := dxListBoxStrings[I]; + Windows.DrawText(DC, PChar(S), Length(S), R, + DT_NOPREFIX or DT_SINGLELINE or dxDrawTextTextAlignX[TextAlignX] or dxDrawTextTextAlignY[TextAlignY]); + end; + SetTextColor(DC, PrevFontColor); + SelectObject(DC, PrevFont); + SetBkMode(DC, PrevBkMode); + end; +end; + +procedure TdxLBxReportLinkDesignWindow.chbxOnlySelectedClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OnlySelected := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxLBxReportLinkDesignWindow.chbxPaintItemGraphicsClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PaintItemsGraphics := TCheckBox(Sender).Checked; + Modified := True; + FPreviewBox.Invalidate; +end; + +procedure TdxLBxReportLinkDesignWindow.chbxTransparentGraphicsClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.TransparentGraphics := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxLBxReportLinkDesignWindow.chbxAutoWidthClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.AutoWidth := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxLBxReportLinkDesignWindow.chbxRowAutoHeightClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.RowAutoHeight := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxLBxReportLinkDesignWindow.cbxDrawModeClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TComboBox(Sender) do + ReportLink.DrawMode := TdxGridDrawMode(Items.Objects[ItemIndex]); + Modified := True; + UpdatePreview; +end; + +procedure TdxLBxReportLinkDesignWindow.cbxDrawModeDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +begin + dxPSBaseGridLnk.dxPSDrawComboDrawModeItem(Control, Index, Rect, State); +end; + +procedure TdxLBxReportLinkDesignWindow.chbxShowBordersClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TCheckBox(Sender) do + if Checked then + ReportLink.Options := ReportLink.Options + [TdxListBoxPaintOption(TTagToInt(Tag))] + else + ReportLink.Options := ReportLink.Options - [TdxListBoxPaintOption(TTagToInt(Tag))]; + Modified := True; + UpdatePreview; +end; + +procedure TdxLBxReportLinkDesignWindow.chbxTransparentClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.Transparent := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TdxLBxReportLinkDesignWindow.stTransparentClick(Sender: TObject); +begin + if chbxTransparent.CanFocus then ActiveControl := chbxTransparent; + chbxTransparent.Checked := not chbxTransparent.Checked; +end; + +procedure TdxLBxReportLinkDesignWindow.UpdatePreview; +begin + FPreviewBox.Invalidate; +end; + +procedure TdxLBxReportLinkDesignWindow.ccbxColorChange(Sender: TObject); +var + AColor: TColor; +begin + if LockControlsUpdate then Exit; + AColor := TdxPSColorCombo(Sender).ColorValue; + case TTagToInt(TdxPSColorCombo(Sender).Tag) of + 0: ReportLink.Color := AColor; + 1: ReportLink.EvenColor := AColor; + 2: ReportLink.GridLineColor := AColor; + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxLBxReportLinkDesignWindow.btnFontClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + + with dxPSGlbl.FontDialog do + begin + case TTagToInt(TComponent(Sender).Tag) of + 0: Font := ReportLink.Font; + 1: Font := ReportLink.EvenFont; + end; + + if Execute then + begin + case TTagToInt(TComponent(Sender).Tag) of + 0: + begin + ReportLink.Font := Font; + FontInfoToText(ReportLink.Font, edFont); + end; + 1: + begin + ReportLink.EvenFont := Font; + FontInfoToText(ReportLink.EvenFont, edEvenFont); + end; + end; + Modified := True; + UpdatePreview; + end; + end; +end; + +procedure TdxLBxReportLinkDesignWindow.pbxPreviewPaint(Sender: TObject); +begin + with TdxPSPaintPanel(Sender) do + PaintPreview(Canvas, ClientRect); +end; + +procedure TdxLBxReportLinkDesignWindow.lblComboClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; + TCustomComboBox(ActiveControl).DroppedDown := True; +end; + +procedure TdxLBxReportLinkDesignWindow.PageControl1Change(Sender: TObject); +begin + lblPreview.Parent := TPageControl(Sender).ActivePage; +end; + +initialization + dxPSRegisterReportLink(TdxListBoxReportLink, TListBox, TdxLBxReportLinkDesignWindow); + +finalization + dxPSUnregisterReportLink(TdxListBoxReportLink, TListBox, TdxLBxReportLinkDesignWindow); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSLnkReg.pas new file mode 100644 index 00000000..906e8035 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSLnkReg.pas @@ -0,0 +1,196 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignEditors, + {$ELSE} + DsgnIntf, + {$ENDIF} + Classes, dxPSCore, dxPSStdGrLnk, dxPSGrLnks, dxPSLbxLnk, dxPSChLbxLnk, + dxPSTVLnk, dxPSRELnk, dxPSGraphicLnk, dxPSImgLnk, dxPSTextLnk; + +type + TdxGridOptionsPropertyEditor = class(TSetProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + + TdxListBoxOptionsPropertyEditor = class(TSetProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + + TdxCheckListBoxOptionsPropertyEditor = class(TSetProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + + TdxTreeViewOptionsPropertyEditor = class(TSetProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + +{ TdxGridOptionsPropertyEditor } + +function TdxGridOptionsPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog]; +end; + +procedure TdxGridOptionsPropertyEditor.Edit; +var + I: Integer; + Component: TPersistent; +begin + inherited; + Component := GetComponent(0); + if TCustomdxGridReportLink(Component).DesignReport then + begin + Designer.Modified; + if PropCount > 1 then + for I := 1 to PropCount - 1 do + GetComponent(I).Assign(Component); + end; +end; + +{ TdxListBoxOptionsPropertyEditor } + +function TdxListBoxOptionsPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog]; +end; + +procedure TdxListBoxOptionsPropertyEditor.Edit; +var + I: Integer; + Component: TPersistent; +begin + inherited; + Component := GetComponent(0); + if TdxListBoxReportLink(Component).DesignReport then + begin + Designer.Modified; + if PropCount > 1 then + for I := 1 to PropCount - 1 do + GetComponent(I).Assign(Component); + end; +end; + +{ TdxCheckListBoxOptionsPropertyEditor } + +function TdxCheckListBoxOptionsPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog]; +end; + +procedure TdxCheckListBoxOptionsPropertyEditor.Edit; +var + I: Integer; + Component: TPersistent; +begin + inherited; + Component := GetComponent(0); + if TdxCheckListBoxReportLink(Component).DesignReport then + begin + Designer.Modified; + if PropCount > 1 then + for I := 1 to PropCount - 1 do + GetComponent(I).Assign(Component); + end; +end; + +{ TdxTreeViewOptionsPropertyEditor } + +function TdxTreeViewOptionsPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog]; +end; + +procedure TdxTreeViewOptionsPropertyEditor.Edit; +var + I: Integer; + Component: TPersistent; +begin + inherited; + Component := GetComponent(0); + if TdxTreeViewReportLink(Component).DesignReport then + begin + Designer.Modified; + if PropCount > 1 then + for I := 1 to PropCount - 1 do + GetComponent(I).Assign(Component); + end; +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterNoIcon([TdxStringGridReportLink, TdxDrawGridReportLink, + TdxListBoxReportLink, TdxCheckListBoxReportLink, TdxTreeViewReportLink, + TdxRichEditReportLink, TdxImageReportLink, TdxMemoReportLink]); + + RegisterPropertyEditor(TypeInfo(TdxGridPaintOptions), + TdxDrawGridReportLink, 'Options', TdxGridOptionsPropertyEditor); + RegisterPropertyEditor(TypeInfo(TdxListBoxPaintOptions), + TdxListBoxReportLink, 'Options', TdxListBoxOptionsPropertyEditor); + RegisterPropertyEditor(TypeInfo(TdxCheckListBoxPaintOptions), + TdxCheckListBoxReportLink, 'Options', TdxCheckListBoxOptionsPropertyEditor); + RegisterPropertyEditor(TypeInfo(TdxTreeViewPaintOptions), + TdxTreeViewReportLink, 'Options', TdxTreeViewOptionsPropertyEditor); + + RegisterPropertyEditor(TypeInfo(string), TAbstractdxRichEditReportLink, 'DesignerCaption', nil); + RegisterPropertyEditor(TypeInfo(THelpContext), TAbstractdxRichEditReportLink, 'DesignerHelpContext', nil); +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSMD.pas b/official/x.35/ExpressPrinting System/Sources/dxPSMD.pas new file mode 100644 index 00000000..5f0b514d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSMD.pas @@ -0,0 +1,659 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSMD; + +interface + +{$I cxVer.inc} + +uses + Classes, Windows, SysUtils, DB; + +type + TdxEasyMemData = class; + + TdxMemoryRecord = class(TPersistent) + private + FData: Pointer; + FDataSet: TdxEasyMemData; + FID: Integer; + function GetIndex: Integer; + procedure SetDataSet(Value: TdxEasyMemData); + procedure SetIndex(Value: Integer); + public + constructor Create(ADataSet: TdxEasyMemData); + destructor Destroy; override; + + property Data: Pointer read FData; + property DataSet: TdxEasyMemData read FDataSet; + property ID: Integer read FID write FID; + property Index: Integer read GetIndex write SetIndex; + end; + + PdxRecInfo = ^TdxRecInfo; + TdxRecInfo = record + Bookmark: Integer; + BookmarkFlag: TBookmarkFlag; + end; + + TdxEasyMemData = class(TDataSet) + private + FActive: Boolean; + FCurrentRecIndex: Integer; + FFieldOffsets: PWordArray; + FLastID: Integer; + FRecBufSize: Integer; + FRecInfoOfs: Integer; + FRecords: TList; + + function GetMemRecord(Index: Integer): TdxMemoryRecord; + + function AddRecord(AIndex: Integer): TdxMemoryRecord; + procedure ClearRecords; + function FindRecordByID(AID: Integer): TdxMemoryRecord; + function IndexOf(ARecord: TdxMemoryRecord): Integer; + procedure InsertRecord(ARecord: TdxMemoryRecord); + procedure RemoveRecord(ARecord: TdxMemoryRecord); + + procedure CheckSupportedFields; + procedure MoveBufferToRecord(ABuffer: PChar; ARecord: TdxMemoryRecord); + procedure MoveData(ACurIndex, ANewIndex: Integer); + procedure MoveRecordToBuffer(ARecord: TdxMemoryRecord; ABuffer: PChar); + + procedure CalcFieldOffsets; + procedure FreeFieldOffsets; + function GetFieldDataPtr(ABuffer: PChar; AField: TField): Pointer; + protected + function AllocRecordBuffer: PChar; override; + procedure FreeRecordBuffer(var Buffer: PChar); override; + procedure GetBookmarkData(Buffer: PChar; Data: Pointer); override; + function GetBookmarkFlag(Buffer: PChar): TBookmarkFlag; override; + function GetRecord(Buffer: PChar; GetMode: TGetMode; DoCheck: Boolean): TGetResult; override; + function GetRecordSize: Word; override; + procedure InternalAddRecord(Buffer: Pointer; Append: Boolean); override; + procedure InternalClose; override; + procedure InternalDelete; override; + procedure InternalFirst; override; + procedure InternalGotoBookmark(Bookmark: Pointer); override; + procedure InternalHandleException; override; + procedure InternalInitFieldDefs; override; + procedure InternalInitRecord(Buffer: PChar); override; + procedure InternalLast; override; + procedure InternalOpen; override; + procedure InternalPost; override; + procedure InternalSetToRecord(Buffer: PChar); override; + function IsCursorOpen: Boolean; override; + procedure SetBookmarkFlag(Buffer: PChar; Value: TBookmarkFlag); override; + procedure SetBookmarkData(Buffer: PChar; Data: Pointer); override; + procedure SetFieldData(Field: TField; Buffer: Pointer); override; + + function GetRecordCount: Integer; override; + function GetRecNo: Integer; override; + procedure SetRecNo(Value: Integer); override; + + property Records[Index: Integer]: TdxMemoryRecord read GetMemRecord; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + function BookmarkValid(Bookmark: TBookmark): Boolean; override; + function CompareBookmarks(Bookmark1, Bookmark2: TBookmark): Integer; override; + function GetFieldData(Field: TField; Buffer: Pointer): Boolean; override; + function Locate(const KeyFields: string; const KeyValues: Variant; + Options: TLocateOptions): Boolean; override; + end; + +implementation + +uses + DbConsts, Forms; + +{ TdxMemoryRecord } + +constructor TdxMemoryRecord.Create(ADataSet: TdxEasyMemData); +begin + if ADataSet = nil then + raise Exception.Create('Invalid Owner'); + inherited Create; + SetDataSet(ADataSet); +end; + +destructor TdxMemoryRecord.Destroy; +begin + SetDataSet(nil); + inherited Destroy; +end; + +function TdxMemoryRecord.GetIndex: Integer; +begin + Result := FDataSet.IndexOf(Self); +end; + +procedure TdxMemoryRecord.SetIndex(Value: Integer); +var + Ind: Integer; +begin + Ind := GetIndex; + if Ind <> Value then + FDataSet.MoveData(Ind, Value); +end; + +procedure TdxMemoryRecord.SetDataSet(Value: TdxEasyMemData); +begin + if Value <> DataSet then + begin + if DataSet <> nil then DataSet.RemoveRecord(Self); + if Value <> nil then Value.InsertRecord(Self); + end; +end; + +{ TdxEasyMemData } + +const + dxMemDSSupportedFieldTypes = + [ftString, ftSmallint, ftInteger, ftWord, ftBoolean, ftFloat, ftCurrency, ftDate, ftTime, ftDateTime]; + +constructor TdxEasyMemData.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FCurrentRecIndex := -1; + FLastID := -1; + FRecords := TList.Create; +end; + +destructor TdxEasyMemData.Destroy; +begin + ClearRecords; + FRecords.Free; + FreeFieldOffsets; + inherited Destroy; +end; + +function TdxEasyMemData.GetRecordCount: Integer; +begin + Result:= FRecords.Count; +end; + +function TdxEasyMemData.GetRecNo: Longint; +begin + UpdateCursorPos; + if (FCurrentRecIndex = -1) and (RecordCount > 0) then + Result := 1 + else + Result := FCurrentRecIndex + 1; +end; + +procedure TdxEasyMemData.SetRecNo(Value: Integer); +begin + if (Value > -1) and (Value < RecordCount) then + begin + FCurrentRecIndex := Value - 1; + Resync([]); + end; +end; + +function TdxEasyMemData.GetMemRecord(Index: Integer): TdxMemoryRecord; +begin + Result := TdxMemoryRecord(FRecords[Index]); +end; + +function TdxEasyMemData.IndexOf(ARecord: TdxMemoryRecord): Integer; +begin + Result := FRecords.IndexOf(ARecord); +end; + +function TdxEasyMemData.FindRecordByID(AID: Integer): TdxMemoryRecord; +var + I: Integer; +begin + for I := 0 to RecordCount - 1 do + begin + Result := Records[I]; + if Result.ID = AID then Exit; + end; + Result := nil; +end; + +procedure TdxEasyMemData.MoveBufferToRecord(ABuffer: PChar; ARecord: TdxMemoryRecord); +begin + Move(ABuffer^, ARecord.Data^, FRecInfoOfs); +end; + +procedure TdxEasyMemData.MoveRecordToBuffer(ARecord: TdxMemoryRecord; ABuffer: PChar); +begin + Move(ARecord.Data^, ABuffer^, FRecInfoOfs); + with PdxRecInfo(ABuffer + FRecInfoOfs)^ do + begin + Bookmark := ARecord.ID; + BookmarkFlag := bfCurrent; + end; +end; + +procedure TdxEasyMemData.MoveData(ACurIndex, ANewIndex: Integer); +begin + FRecords.Move(ACurIndex, ANewIndex); +end; + +procedure TdxEasyMemData.ClearRecords; +begin + while RecordCount > 0 do Records[RecordCount - 1].Free; +end; + +function TdxEasyMemData.AddRecord(AIndex: Integer): TdxMemoryRecord; +begin + Result := TdxMemoryRecord.Create(Self); + Result.Index := AIndex; +end; + +procedure TdxEasyMemData.InsertRecord(ARecord: TdxMemoryRecord); +begin + FRecords.Add(ARecord); + Inc(FLastID); + ARecord.FID := FLastID; + ReallocMem(ARecord.FData, FRecInfoOfs); + ARecord.FDataSet := Self; +end; + +procedure TdxEasyMemData.RemoveRecord(ARecord: TdxMemoryRecord); +begin + FRecords.Remove(ARecord); + ReallocMem(ARecord.FData, 0); + ARecord.FDataSet := nil; +end; + +procedure TdxEasyMemData.CalcFieldOffsets; +var + Offset, I: Integer; +begin + ReallocMem(FFieldOffsets, FieldCount * SizeOf(Word)); + Offset := 0; + for I := 0 to FieldCount - 1 do + begin + FFieldOffsets^[I] := Offset; + Inc(Offset, Fields[I].DataSize + 1); + end; +end; + +procedure TdxEasyMemData.FreeFieldOffsets; +begin + ReallocMem(FFieldOffsets, 0); +end; + +function TdxEasyMemData.AllocRecordBuffer: PChar; +begin + Result := StrAlloc(FRecBufSize); +end; + +procedure TdxEasyMemData.FreeRecordBuffer(var Buffer: PChar); +begin + StrDispose(Buffer); + Buffer := nil; +end; + +procedure TdxEasyMemData.InternalInitRecord(Buffer: PChar); +begin + FillChar(Buffer^, FRecBufSize, 0); +end; + +procedure TdxEasyMemData.CheckSupportedFields; +var + I: Integer; +begin + for I := 0 to FieldCount - 1 do + if not (Fields[I].DataType in dxMemDSSupportedFieldTypes) then + DatabaseErrorFmt('Unsupported field type: %s', [Fields[I].FieldName]); +end; + +procedure TdxEasyMemData.InternalOpen; +begin + CheckSupportedFields; + FLastID := FRecords.Count; + FCurrentRecIndex := -1; + + CalcFieldOffsets; + if FFieldOffsets <> nil then + FRecInfoOfs := FFieldOffsets^[FieldCount - 1] + Fields[FieldCount - 1].DataSize + 1 + else + FRecInfoOfs := 0; + FRecBufSize := FRecInfoOfs + SizeOf(TdxRecInfo); + BookmarkSize := SizeOf(Integer); + + InternalInitFieldDefs; + if DefaultFields then CreateFields; + BindFields(True); + FActive := True; +end; + +procedure TdxEasyMemData.InternalClose; +begin + FActive := False; + ClearRecords; + BindFields(False); + if DefaultFields then DestroyFields; + FLastID := 0; + FCurrentRecIndex := -1; +end; + +function TdxEasyMemData.IsCursorOpen: Boolean; +begin + Result := FActive; +end; + +procedure TdxEasyMemData.InternalInitFieldDefs; +var + I: Integer; +begin + FieldDefs.Clear; + for I := 0 to FieldCount - 1 do + with Fields[I] do + FieldDefs.Add(FieldName, DataType, Size, Required); +end; + +procedure TdxEasyMemData.InternalPost; +var + Index: Integer; +begin + if State = dsEdit then + MoveBufferToRecord(ActiveBuffer, Records[FCurrentRecIndex]) + else + if FCurrentRecIndex >= RecordCount then + begin + MoveBufferToRecord(ActiveBuffer, AddRecord(RecordCount - 1)); + FCurrentRecIndex := RecordCount - 1; + end + else + begin + Index := FCurrentRecIndex; + if Index = -1 then Index := 0; + MoveBufferToRecord(ActiveBuffer, Records[Index]); + FCurrentRecIndex := Index; + end; +end; + +procedure TdxEasyMemData.InternalSetToRecord(Buffer: PChar); +begin + InternalGotoBookmark(@PdxRecInfo(Buffer + FRecInfoOfs)^.Bookmark); +end; + +procedure TdxEasyMemData.InternalFirst; +begin + FCurrentRecIndex := -1; +end; + +procedure TdxEasyMemData.InternalLast; +begin + FCurrentRecIndex := FRecords.Count; +end; + +procedure TdxEasyMemData.InternalAddRecord(Buffer: Pointer; Append: Boolean); +var + Rec: TdxMemoryRecord; + Index: Integer; +begin + if Append then + begin + Rec := AddRecord(RecordCount - 1); + FCurrentRecIndex := RecordCount - 1; + end + else + begin + Index := FCurrentRecIndex; + if Index = -1 then Index := 0; + Rec := AddRecord(Index); + FCurrentRecIndex := Index; + end; + MoveBufferToRecord(Buffer, Rec); +end; + +procedure TdxEasyMemData.InternalDelete; +begin + Records[FCurrentRecIndex].Free; + if FCurrentRecIndex >= RecordCount then Dec(FCurrentRecIndex); + if RecordCount = 0 then FLastID := 0; +end; + +procedure TdxEasyMemData.InternalHandleException; +begin + Application.HandleException(Self); +end; + +function TdxEasyMemData.GetRecordSize: Word; +begin + Result := FRecInfoOfs; +end; + +function TdxEasyMemData.GetRecord(Buffer: PChar; GetMode: TGetMode; + DoCheck: Boolean): TGetResult; +begin + Result := grOk; + case GetMode of + gmCurrent: + if (FCurrentRecIndex < 0) or (FCurrentRecIndex >= RecordCount) then + Result := grError; + gmNext: + if FCurrentRecIndex >= RecordCount - 1 then + Result := grEOF + else + Inc(FCurrentRecIndex); + gmPrior: + if FCurrentRecIndex < 1 then + begin + Result := grBOF; + FCurrentRecIndex := -1; + end + else + Dec(FCurrentRecIndex); + end; + + if Result = grOk then + MoveRecordToBuffer(Records[FCurrentRecIndex], Buffer) + else + if (Result = grError) and DoCheck then + DatabaseError('No records'); +end; + +function TdxEasyMemData.GetFieldDataPtr(ABuffer: PChar; AField: TField): Pointer; +var + Index: Integer; +begin + Index := FieldDefs.IndexOf(AField.FieldName); + if (Index > -1) and (ABuffer <> nil) and + (FieldDefs[Index].DataType in dxMemDSSupportedFieldTypes) then + Result := PChar(ABuffer) + FFieldOffsets[Index] + else + Result := nil; +end; + +function TdxEasyMemData.GetFieldData(Field: TField; Buffer: Pointer): Boolean; +var + Data: PChar; +begin + Result := False; + if (State in [dsEdit, dsInsert]) or ((State = dsBrowse) and not IsEmpty) then + Data := GetFieldDataPtr(ActiveBuffer, Field) + else + Exit; + + if Data <> nil then + begin + Result := Boolean(Data[0]); + Inc(Data); + if (Field.DataType = ftString) then + Result := Result and (StrLen(Data) > 0); + if Result then + Move(Data^, Buffer^, Field.DataSize); + end; +end; + +procedure TdxEasyMemData.SetFieldData(Field: TField; Buffer: Pointer); +var + CurrentBuffer, Data: PChar; +begin + if not (State in dsWriteModes) then + DatabaseError(SNotEditing, Self); + + if (State in [dsEdit, dsInsert]) or ((State = dsBrowse) and not IsEmpty) then + CurrentBuffer := ActiveBuffer + else + Exit; + + Field.Validate(Buffer); + Data := GetFieldDataPtr(CurrentBuffer, Field); + if Data <> nil then + begin + Boolean(Data[0]) := LongBool(Buffer); + Inc(Data); + if LongBool(Buffer) then + Move(Buffer^, Data^, Field.DataSize) + else + FillChar(Data^, Field.DataSize, 0); + end; + + if not (State in [dsCalcFields, dsFilter, dsNewValue]) then + DataEvent(deFieldChange, Longint(Field)); +end; + +function TdxEasyMemData.BookmarkValid(Bookmark: TBookmark): Boolean; +begin + Result := FActive and (Integer(Bookmark^) > -1) and (Integer(Bookmark^) <= FLastID); +end; + +function TdxEasyMemData.CompareBookmarks(Bookmark1, Bookmark2: TBookmark): Integer; +begin + Result := Integer(Bookmark1) - Integer(Bookmark2); +end; + +procedure TdxEasyMemData.GetBookmarkData(Buffer: PChar; Data: Pointer); +begin + Move(PdxRecInfo(Buffer + FRecInfoOfs)^.Bookmark, Data^, SizeOf(Integer)); +end; + +procedure TdxEasyMemData.SetBookmarkData(Buffer: PChar; Data: Pointer); +begin + Move(Data^, PdxRecInfo(Buffer + FRecInfoOfs)^.Bookmark, SizeOf(Integer)); +end; + +function TdxEasyMemData.GetBookmarkFlag(Buffer: PChar): TBookmarkFlag; +begin + Result := PdxRecInfo(Buffer + FRecInfoOfs)^.BookmarkFlag; +end; + +procedure TdxEasyMemData.SetBookmarkFlag(Buffer: PChar; Value: TBookmarkFlag); +begin + PdxRecInfo(Buffer + FRecInfoOfs)^.BookmarkFlag := Value; +end; + +procedure TdxEasyMemData.InternalGotoBookmark(Bookmark: TBookmark); +var + Rec: TdxMemoryRecord; +begin + Rec := FindRecordByID(Integer(Bookmark^)); + if Rec <> nil then + FCurrentRecIndex := Rec.Index; +end; + +function TdxEasyMemData.Locate(const KeyFields: string; const KeyValues: Variant; + Options: TLocateOptions): Boolean; +var + Fields: TList; + Bookmark: TBookmarkStr; + + function CompareRecord: Boolean; + + function CompareOneField(AField: TField; const AValue: Variant): Boolean; + var + AsString: string; + begin + if AField.DataType = ftString then + begin + AsString := AField.AsString; + if loPartialKey in Options then + System.Delete(AsString, Length(AValue) + 1, MaxInt); + if loCaseInsensitive in Options then + Result := AnsiCompareText(AsString, AValue) = 0 + else + Result := AnsiCompareStr(AsString, AValue) = 0; + end + else + Result := AField.Value = AValue; + end; + + var + I: Integer; + begin + if Fields.Count = 1 then + Result := CompareOneField(Fields.First, KeyValues) + else + begin + I := 0; + while (I < Fields.Count) and not CompareOneField(Fields[I], KeyValues[I]) do + Inc(I); + Result := I < Fields.Count; + end; + end; + +begin + Result := False; + CheckBrowseMode; + if (RecordCount = 0) or (KeyFields = '') then Exit; + + Fields := TList.Create; + try + GetFieldList(Fields, KeyFields); + { suddenly the luck } + Result := CompareRecord; + if Result then Exit; + + DisableControls; + try + Bookmark := Self.Bookmark; + try + First; + while not EOF and not CompareRecord do Next; + Result := not EOF; + finally + if not Result and BookmarkValid(PChar(Bookmark)) then + Self.Bookmark := Bookmark; + end; + finally + EnableControls; + end; + finally + Fields.Free; + end; +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSPgsMnuBld.pas b/official/x.35/ExpressPrinting System/Sources/dxPSPgsMnuBld.pas new file mode 100644 index 00000000..aa3adbb6 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSPgsMnuBld.pas @@ -0,0 +1,229 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire coVisntents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSPgsMnuBld; + +interface + +{$I cxVer.inc} + +uses + Classes, cxClasses, dxPgsDlg, dxPSSngltn, dxBase; + +type + TdxPSPageSetupMenuBuilderClass = class of TAbstractdxPSPageSetupMenuBuilder; + + TAbstractdxPSPageSetupMenuBuilder = class + public + constructor Create; virtual; + procedure BuildPageSetupMenu(ARootItem: TObject; AData: Pointer; + AIncludeDefineItem: Boolean; AStyles: TStringList; ACurrentStyle: TBasedxPrintStyle; + AOnStyleClick, AOnDefineStylesClick: TNotifyEvent); virtual; abstract; + class function ExtractPrintStyleFromObj(Obj: TObject): TBasedxPrintStyle; virtual; + end; + + TdxStandardPSPageSetupMenuBuilder = class(TAbstractdxPSPageSetupMenuBuilder) + public + procedure BuildPageSetupMenu(ARootItem: TObject; AData: Pointer; + AIncludeDefineItem: Boolean; AStyles: TStringList; ACurrentStyle: TBasedxPrintStyle; + AOnStyleClick, AOnDefineStylesClick: TNotifyEvent); override; + class function ExtractPrintStyleFromObj(Obj: TObject): TBasedxPrintStyle; override; + end; + + TdxPSPageSetupMenuBuilderFactory = class(TBasedxPSSingleton) + private + FBuilders: TdxClassList; + function GetActiveBuilder: TdxPSPageSetupMenuBuilderClass; + function GetBuilder(Index: Integer): TdxPSPageSetupMenuBuilderClass; + function GetCount: Integer; + protected + procedure FinalizeInstance; override; + procedure InitializeInstance; override; + public + class function Instance: TdxPSPageSetupMenuBuilderFactory; reintroduce; overload; + procedure RegisterBuilder(ABuilder: TdxPSPageSetupMenuBuilderClass); + procedure UnregisterBuilder(ABuilder: TdxPSPageSetupMenuBuilderClass); + + property ActiveBuilder: TdxPSPageSetupMenuBuilderClass read GetActiveBuilder; + property Builders[Index: Integer]: TdxPSPageSetupMenuBuilderClass read GetBuilder; + property Count: Integer read GetCount; + end; + +function dxPSPageSetupMenuBuilderFactory: TdxPSPageSetupMenuBuilderFactory; + +implementation + +uses + Menus, SysUtils, dxPSUtl, dxPSRes; + +function dxPSPageSetupMenuBuilderFactory: TdxPSPageSetupMenuBuilderFactory; +begin + Result := TdxPSPageSetupMenuBuilderFactory.Instance; +end; + +{ TdxPSAutoHFTextMenuBuilderFactory } + +class function TdxPSPageSetupMenuBuilderFactory.Instance: TdxPSPageSetupMenuBuilderFactory; +begin + Result := inherited Instance as TdxPSPageSetupMenuBuilderFactory; +end; + +procedure TdxPSPageSetupMenuBuilderFactory.RegisterBuilder(ABuilder: TdxPSPageSetupMenuBuilderClass); +begin + if ABuilder <> nil then FBuilders.Add(ABuilder); +end; + +procedure TdxPSPageSetupMenuBuilderFactory.UnregisterBuilder(ABuilder: TdxPSPageSetupMenuBuilderClass); +begin + FBuilders.Remove(ABuilder); +end; + +procedure TdxPSPageSetupMenuBuilderFactory.FinalizeInstance; +begin + FreeAndNil(FBuilders); + inherited; +end; + +procedure TdxPSPageSetupMenuBuilderFactory.InitializeInstance; +begin + inherited; + FBuilders := TdxClassList.Create; +end; + +function TdxPSPageSetupMenuBuilderFactory.GetActiveBuilder: TdxPSPageSetupMenuBuilderClass; +begin + if Count <> 0 then + Result := Builders[Count - 1] + else + Result := TdxStandardPSPageSetupMenuBuilder; +end; + +function TdxPSPageSetupMenuBuilderFactory.GetBuilder(Index: Integer): TdxPSPageSetupMenuBuilderClass; +begin + Result := TdxPSPageSetupMenuBuilderClass(FBuilders[Index]); +end; + +function TdxPSPageSetupMenuBuilderFactory.GetCount: Integer; +begin + Result := FBuilders.Count; +end; + +{ TAbstractdxPSPageSetupMenuBuilder } + +constructor TAbstractdxPSPageSetupMenuBuilder.Create; +begin + inherited Create; +end; + +class function TAbstractdxPSPageSetupMenuBuilder.ExtractPrintStyleFromObj(Obj: TObject): TBasedxPrintStyle; +begin + Result := nil; +end; + +{ TStandarddxPageSetupMenuBuilder } + +class function TdxStandardPSPageSetupMenuBuilder.ExtractPrintStyleFromObj(Obj: TObject): TBasedxPrintStyle; +begin + Result := TBasedxPrintStyle(TTagToObj(TMenuItem(Obj).Tag)); +end; + +procedure TdxStandardPSPageSetupMenuBuilder.BuildPageSetupMenu(ARootItem: TObject; + AData: Pointer; AIncludeDefineItem: Boolean; + AStyles: TStringList; ACurrentStyle: TBasedxPrintStyle; + AOnStyleClick, AOnDefineStylesClick: TNotifyEvent); + + procedure AddMenuItem(AParent: TMenuItem; AStyle: TBasedxPrintStyle); + var + MenuItem: TMenuItem; + begin + MenuItem := TMenuItem.Create(AParent); + with MenuItem do + begin + Caption := AStyle.StyleCaption; + GroupIndex := 1; + Hint := AStyle.Description; + RadioItem := True; + Tag := MakeTTag(AStyle); + OnClick := AOnStyleClick; + end; + AParent.Add(MenuItem); + end; + + procedure ClearMenuItems(AMenuItem: TMenuItem); + var + CurItem: TMenuItem; + begin + with AMenuItem do + while Count > 0 do + begin + CurItem := Items[Count - 1]; + Remove(CurItem); + CurItem.Free; + end; + end; + +var + MenuItem: TMenuItem; + I: Integer; + MI: TMenuItem; +begin + if not (ARootItem is TMenuItem) then Exit; + MenuItem := TMenuItem(ARootItem); + ClearMenuItems(MenuItem); + + for I := 0 to AStyles.Count - 1 do + AddMenuItem(MenuItem, TBasedxPrintStyle(AStyles.Objects[I])); + if AStyles.Count > 0 then + MenuItem[ACurrentStyle.Index].Checked := True; + + if AIncludeDefineItem then + begin + if MenuItem.Count > 0 then + MenuItem.Add(NewLine); + + MI := TMenuItem.Create(MenuItem); + MI.Caption := cxGetResourceString(@sdxDefinePrintStylesMenuItem); + MI.Checked := False; + MI.Tag := MakeTTag(-1); + MI.OnClick := AOnDefineStylesClick; + MenuItem.Add(MI); + end; +end; + +initialization + dxPSPageSetupMenuBuilderFactory.RegisterBuilder(TdxStandardPSPageSetupMenuBuilder); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSPopupMan.pas b/official/x.35/ExpressPrinting System/Sources/dxPSPopupMan.pas new file mode 100644 index 00000000..e586aa3e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSPopupMan.pas @@ -0,0 +1,505 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSPopupMan; + +interface + +{$I cxVer.inc} + +uses + Classes, Controls, Windows, Menus, dxBase, dxPSSngltn; + +type + TdxPSPopupMenuBuilderClass = class of TAbstractdxPSPopupMenuBuilder; + + TAbstractdxPSPopupMenuBuilder = class + protected + function BuildPopup(const AControl: TControl; + const APopupMenu: TPopupMenu): TComponent; virtual; abstract; + class function CanShowPopup(const APopupMenu: TPopupMenu): Boolean; virtual; + procedure FreePopup(var APopupMenu: TComponent); virtual; abstract; + procedure InvokePopup(const X, Y: Integer; const AControl: TControl; + const APopupMenu: TComponent); virtual; abstract; + class function RequireProcessDoPopup: Boolean; virtual; + public + constructor Create; virtual; + end; + + TdxStandardPSPopupMenuBuilder = class(TAbstractdxPSPopupMenuBuilder) + protected + function BuildPopup(const AControl: TControl; + const APopupMenu: TPopupMenu): TComponent; override; + procedure FreePopup(var APopupMenu: TComponent); override; + procedure InvokePopup(const X, Y: Integer; const AControl: TControl; + const APopupMenu: TComponent); override; + end; + + TdxPSPopupMenuController = class(TBasedxPSSingleton) + private + FBuilders: TdxClassList; + FControls: TList; + FKbdHook: HHOOK; + FMouseHook: HHOOK; + FNexus: TComponent; + function GetActiveBuilder: TdxPSPopupMenuBuilderClass; + function GetBuilder(Index: Integer): TdxPSPopupMenuBuilderClass; + function GetBuilderCount: Integer; + function GetControl(Index: Integer): TControl; + function GetControlCount: Integer; + + procedure FreeAndNilControls; + protected + procedure FinalizeInstance; override; + procedure InitializeInstance; override; + + function IndexOfControl(AControl: TControl): Integer; + procedure Notification(AComponent: TComponent; AOperation: TOperation); + function TryShowPopup(AControl: TControl; Pt: TPoint): Boolean; + + property Nexus: TComponent read FNexus; + public + class function Instance: TdxPSPopupMenuController; reintroduce; overload; + + procedure ShowPopup(const X, Y: Integer; const AControl: TControl; const APopupMenu: TPopupMenu); + procedure ShowPopupAtMousePos(const AControl: TControl; const APopupMenu: TPopupMenu); + + procedure RegisterBuilder(ABuilder: TdxPSPopupMenuBuilderClass); + procedure UnregisterBuilder(ABuilder: TdxPSPopupMenuBuilderClass); + + procedure RegisterControl(AControl: TControl); + procedure UnregisterControl(AControl: TControl); + + property ActiveBuilder: TdxPSPopupMenuBuilderClass read GetActiveBuilder; + property BuilderCount: Integer read GetBuilderCount; + property Builders[Index: Integer]: TdxPSPopupMenuBuilderClass read GetBuilder; + property ControlCount: Integer read GetControlCount; + property Controls[Index: Integer]: TControl read GetControl; + end; + +function dxPSPopupMenuController: TdxPSPopupMenuController; + +implementation + +uses + SysUtils, Messages, Forms, dxPSGlbl, dxPSUtl; + +type + TdxPSPopupMenuControllerNexus = class(TComponent) + private + FController: TdxPSPopupMenuController; + constructor CreateEx(AController: TdxPSPopupMenuController); + protected + procedure Notification(AComponent: TComponent; AOperation: TOperation); override; + public + property Controller: TdxPSPopupMenuController read FController; + end; + +function dxPSPopupMenuController: TdxPSPopupMenuController; +begin + Result := TdxPSPopupMenuController.Instance; +end; + +{$IFDEF DELPHI5} +procedure EatWMContextMenu(Wnd: HWND); +var + Msg: TMsg; +begin + PeekMessage(Msg, Wnd, WM_CONTEXTMENU, WM_CONTEXTMENU, PM_REMOVE); +end; +{$ENDIF} + +function dxPSPopupManKbdHook(Code: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall; + + function IsProcessKey(AKey, AKeyData: Longint; AKeyPressed: Boolean): Boolean; + begin + Result := + ((AKey = VK_F10) and (GetAsyncKeyState(VK_SHIFT) < 0)) or + ((AKey = VK_APPS) and ((AKeyData shr 29) and 1 <> 1)); + end; + + function GetVCLControl(Wnd: HWND): TWinControl; + begin + repeat + Result := FindControl(Wnd); + if Result <> nil then Exit; + Wnd := GetParent(Wnd); + until Wnd = 0; + end; + +const + KbdMessages: array[Boolean] of Cardinal = (WM_KEYUP, WM_KEYDOWN); +var + KeyPressed: Boolean; + Wnd: HWND; + Control: TWinControl; + R: LRESULT; +begin + Result := 0; + KeyPressed := (lParam shr 31) and 1 <> 1; + if (Code >= 0) and IsProcessKey(wParam, lParam, KeyPressed) then + begin + Wnd := GetFocus; + Control := GetVCLControl(Wnd); + if Control <> nil then + begin + if dxPSPopupMenuController.IndexOfControl(Control) > -1 then + begin + {$IFDEF DELPHI5} + EatWMContextMenu(Wnd); + {$ENDIF} + dxPSPopupMenuController.TryShowPopup(Control, Control.ClientToScreen(NullPoint)); + Result := 1; + end; + end; + end; + R := CallNextHookEx(dxPSPopupMenuController.FKbdHook, Code, wParam, lParam); + if Result = 0 then Result := R; +end; + +function dxPSPopupManMouseHook(Code: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall; + + function FindControl(Wnd: HWND; const Pt: TPoint): TControl; + + function IsRegisteredControl(AControl: TControl; const Pt: TPoint): Boolean; + begin + Result := PtInRect(AControl.ClientRect, AControl.ScreenToClient(Pt)) and + (dxPSPopupMenuController.IndexOfControl(AControl) > -1); + end; + + function FindInChildren(AControl: TWinControl; const Pt: TPoint): TControl; + var + I: Integer; + begin + for I := 0 to AControl.ControlCount - 1 do + begin + Result := AControl.Controls[I]; + if IsRegisteredControl(Result, Pt) then Exit; + end; + Result := nil; + end; + + function FindInParents(AControl: TWinControl; const Pt: TPoint): TWinControl; + begin + Result := AControl; + while Result <> nil do + begin + if IsRegisteredControl(Result, Pt) then Exit; + Result := Result.Parent; + end; + end; + + var + TargetControl: TWinControl; + begin + Result := nil; + TargetControl := Controls.FindControl(Wnd); + if TargetControl = nil then Exit; + Result := FindInChildren(TargetControl, Pt); + if Result = nil then + begin + Result := TargetControl; + if dxPSPopupMenuController.IndexOfControl(Result) > -1 then Exit; + Result := FindInParents(TargetControl, Pt); + end; + end; + +var + MouseHookStruct: TMouseHookStruct; + Control: TControl; + Rslt: LRESULT; +begin + Result := 0; + if (Code >= 0) and ((wParam = WM_RBUTTONUP) or (wParam = WM_RBUTTONDOWN)) then + begin + MouseHookStruct := PMouseHookStruct(lParam)^; + with MouseHookStruct do + begin + Control := FindControl(HWND, Pt); + if Control <> nil then + begin + if wParam = WM_RBUTTONUP then + begin + (*{$IFDEF DELPHI5} + EatWMContextMenu(HWND); + {$ENDIF}*) + dxPSPopupMenuController.TryShowPopup(Control, Pt); + end; + Result := 1; + end; + end; + end; + Rslt := CallNextHookEx(dxPSPopupMenuController.FMouseHook, Code, wParam, lParam); + if Result = 0 then Result := Rslt; +end; + +{ TdxPSPopupMenuControllerNexus } + +constructor TdxPSPopupMenuControllerNexus.CreateEx(AController: TdxPSPopupMenuController); +begin + inherited Create(nil); + FController := AController; +end; + +procedure TdxPSPopupMenuControllerNexus.Notification(AComponent: TComponent; AOperation: TOperation); +begin + inherited; + Controller.Notification(AComponent, AOperation); +end; + +{ TdxPSPopupMenuController } + +class function TdxPSPopupMenuController.Instance: TdxPSPopupMenuController; +begin + Result := inherited Instance as TdxPSPopupMenuController; +end; + +procedure TdxPSPopupMenuController.ShowPopup(const X, Y: Integer; + const AControl: TControl; const APopupMenu: TPopupMenu); +var + PopupMenuBuilder: TAbstractdxPSPopupMenuBuilder; + PopupMenu: TComponent; +begin + if APopupMenu = nil then Exit; + + if AControl <> nil then + dxPSUtl.Control_SendCancelMode(AControl, nil); + + if ActiveBuilder.RequireProcessDoPopup then + dxPSUtl.PopupMenu_DoPopup(APopupMenu); + + PopupMenuBuilder := ActiveBuilder.Create; + with PopupMenuBuilder do + try + PopupMenu := BuildPopup(AControl, APopupMenu); + if PopupMenu <> nil then + try + try + InvokePopup(X, Y, AControl, PopupMenu); + except + Application.HandleException(Self); + end; + finally + FreePopup(PopupMenu); + end; + finally + Free; + end; +end; + +procedure TdxPSPopupMenuController.ShowPopupAtMousePos(const AControl: TControl; + const APopupMenu: TPopupMenu); +begin + with Mouse.CursorPos do + ShowPopup(X, Y, AControl, APopupMenu); +end; + +procedure TdxPSPopupMenuController.RegisterBuilder(ABuilder: TdxPSPopupMenuBuilderClass); +begin + FBuilders.Add(ABuilder); +end; + +procedure TdxPSPopupMenuController.UnregisterBuilder(ABuilder: TdxPSPopupMenuBuilderClass); +begin + FBuilders.Remove(ABuilder); +end; + +procedure TdxPSPopupMenuController.RegisterControl(AControl: TControl); +begin + if (AControl <> nil) and (IndexOfControl(AControl) = -1) then + begin + FControls.Add(AControl); + AControl.FreeNotification(Nexus); + end; +end; + +procedure TdxPSPopupMenuController.UnregisterControl(AControl: TControl); +begin + FControls.Remove(AControl); + {$IFDEF DELPHI5} + if (AControl <> nil) and (Nexus <> nil) then + AControl.RemoveFreeNotification(Nexus); + {$ENDIF} +end; + +procedure TdxPSPopupMenuController.FinalizeInstance; +begin + if FMouseHook <> 0 then UnhookWindowsHookEx(FMouseHook); + if FKbdHook <> 0 then UnhookWindowsHookEx(FKbdHook); + FreeAndNil(FBuilders); + FreeAndNilControls; + FreeAndNil(FNexus); + inherited; +end; + +procedure TdxPSPopupMenuController.InitializeInstance; +begin + inherited; + FBuilders := TdxClassList.Create; + FControls := TList.Create; + FKbdHook := SetWindowsHookEx(WH_KEYBOARD, dxPSPopupManKbdHook, 0, GetCurrentThreadId); + FMouseHook := SetWindowsHookEx(WH_MOUSE, dxPSPopupManMouseHook, 0, GetCurrentThreadId); + FNexus := TdxPSPopupMenuControllerNexus.CreateEx(Self); +end; + +function TdxPSPopupMenuController.IndexOfControl(AControl: TControl): Integer; +begin + Result := FControls.IndexOf(AControl); +end; + +procedure TdxPSPopupMenuController.Notification(AComponent: TComponent; AOperation: TOperation); +begin + if (AOperation = opRemove) and (AComponent is TControl) then + UnregisterControl(TControl(AComponent)); +end; + +function TdxPSPopupMenuController.TryShowPopup(AControl: TControl; Pt: TPoint): Boolean; + + function GetPopupMenu(var AControl: TControl): TPopupMenu; + begin + if AControl <> nil then + begin + Result := dxPSUtl.Control_GetPopupMenu(AControl); + while (Result = nil) and (AControl.Parent <> nil) do + begin + AControl := AControl.Parent; + Result := dxPSUtl.Control_GetPopupMenu(AControl); + end; + end + else + Result := nil; + end; + + function CheckPopupMenu(AControl: TControl; const Pt: TPoint): TPopupMenu; + begin + Result := GetPopupMenu(AControl); + if (Result <> nil) and not Result.AutoPopup then + Result := nil; + + if (Result <> nil) and (Pt.X >= 0) and + not PtInRect(AControl.ClientRect, AControl.ScreenToClient(Pt)) then + Result := nil; + end; + +var + PopupMenu: TPopupMenu; +begin + PopupMenu := CheckPopupMenu(AControl, Pt); + Result := (PopupMenu <> nil) and ActiveBuilder.CanShowPopup(PopupMenu); + if not Result then Exit; + dxPSUtl.Control_DoContextPopup(AControl, Pt, Result); + if Result then Exit; + + Result := True; + if Pt.X < 0 then + Pt := AControl.ClientToScreen(NullPoint); + ShowPopup(Pt.X, Pt.Y, AControl, PopupMenu); +end; + +function TdxPSPopupMenuController.GetActiveBuilder: TdxPSPopupMenuBuilderClass; +begin + if BuilderCount <> 0 then + Result := Builders[BuilderCount - 1] + else + Result := TdxStandardPSPopupMenuBuilder; +end; + +function TdxPSPopupMenuController.GetBuilder(Index: Integer): TdxPSPopupMenuBuilderClass; +begin + Result := TdxPSPopupMenuBuilderClass(FBuilders[Index]); +end; + +function TdxPSPopupMenuController.GetBuilderCount: Integer; +begin + Result := FBuilders.Count; +end; + +function TdxPSPopupMenuController.GetControl(Index: Integer): TControl; +begin + Result := TControl(FControls[Index]); +end; + +function TdxPSPopupMenuController.GetControlCount: Integer; +begin + Result := FControls.Count; +end; + +procedure TdxPSPopupMenuController.FreeAndNilControls; +begin + while ControlCount > 0 do + UnregisterControl(Controls[ControlCount - 1]); + FreeAndNil(FControls); +end; + +{ TAbstractdxPSPopupMenuBuilder } + +constructor TAbstractdxPSPopupMenuBuilder.Create; +begin + inherited Create; +end; + +class function TAbstractdxPSPopupMenuBuilder.CanShowPopup(const APopupMenu: TPopupMenu): Boolean; +begin + Result := True; +end; + +class function TAbstractdxPSPopupMenuBuilder.RequireProcessDoPopup: Boolean; +begin + Result := False; +end; + +{ TdxStandardPSPopupMenuBuilder } + +function TdxStandardPSPopupMenuBuilder.BuildPopup(const AControl: TControl; + const APopupMenu: TPopupMenu): TComponent; +begin + Result := APopupMenu; + TPopupMenu(Result).PopupComponent := AControl; +end; + +procedure TdxStandardPSPopupMenuBuilder.FreePopup(var APopupMenu: TComponent); +begin +end; + +procedure TdxStandardPSPopupMenuBuilder.InvokePopup(const X, Y: Integer; + const AControl: TControl; const APopupMenu: TComponent); +begin + TPopupMenu(APopupMenu).Popup(X, Y); +end; + +initialization + dxPSPopupMenuController.RegisterBuilder(TdxStandardPSPopupMenuBuilder); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSPrVwAdv.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSPrVwAdv.dfm new file mode 100644 index 00000000..e8e7f7a8 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSPrVwAdv.dfm @@ -0,0 +1,3491 @@ +object dxfmPreviewWdxBar: TdxfmPreviewWdxBar + Left = 352 + Top = 204 + Width = 893 + Height = 461 + Caption = 'Print Preview' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Icon.Data = { + 0000010001001010100000000000280100001600000028000000100000002000 + 00000100040000000000C0000000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000 + 00000000000000000000000000000FFFFFFFFFF000000FFFFFFF000070000FFF + FFF0788707000FFFFF0788E770000FFFFF08888780000FFFFF08E88780000FFF + FF07EE8770000FFFFFF0788700000FFFFFFF000000000FFFFFFFFFF000000FFF + FFFF000000000FFFFFFF080000000FFFFFFF000000000000000000000000FFFF + 0000000C00000008000000010000000300000003000000030000000300000003 + 000000070000000F0000000F0000000F0000001F0000003F0000007F0000} + KeyPreview = True + Menu = MainMenu1 + OldCreateOrder = True + Position = poDefault + ShowHint = True + PixelsPerInch = 96 + TextHeight = 13 + object dxBarManager: TdxBarManager + AutoHideEmptyBars = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Bars = < + item + Caption = 'MenuBar' + DockedDockingStyle = dsTop + DockedLeft = 0 + DockedTop = 0 + DockingStyle = dsTop + FloatLeft = 0 + FloatTop = 0 + FloatClientWidth = 0 + FloatClientHeight = 0 + IsMainMenu = True + ItemLinks = < + item + Item = bbFile + Visible = True + end + item + Item = bbExplorer + Visible = True + end + item + Item = bbEdit + Visible = True + end + item + Item = bbView + Visible = True + end + item + Item = bbInsert + Visible = True + end + item + Item = bbFormat + Visible = True + end + item + Item = bbGoToPage + Visible = True + end + item + Item = bbTools + Visible = True + end + item + Item = bbHelp + Visible = True + end> + MultiLine = True + Name = 'Build-In Menus' + OneOnRow = True + Row = 0 + UseOwnFont = False + Visible = True + WholeRow = False + end + item + Caption = 'Standard' + DockedDockingStyle = dsTop + DockedLeft = 0 + DockedTop = 23 + DockingStyle = dsTop + FloatLeft = 332 + FloatTop = 321 + FloatClientWidth = 554 + FloatClientHeight = 22 + ItemLinks = < + item + Item = bbFileDesign + Visible = True + end + item + BeginGroup = True + Item = bbFileLoad + Visible = True + end + item + Item = bbFileClose + Visible = True + end + item + Item = bbFileSave + Visible = True + end + item + BeginGroup = True + Item = bbFilePrint + Visible = True + end + item + Item = bbFilePrintDialog + Visible = True + end + item + Item = bbFilePageSetup + Visible = True + end + item + BeginGroup = True + Item = bbViewExplorer + Visible = True + end + item + Item = bbViewThumbnails + Visible = True + end + item + BeginGroup = True + Item = bbFormatTitle + Visible = True + end + item + BeginGroup = True + Item = bbZoomPercent100 + Visible = True + end + item + Item = bbZoomPageWidth + Visible = True + end + item + Item = bbZoomWholePage + Visible = True + end + item + Item = bbZoomTwoPages + Visible = True + end + item + Item = bbZoomMultiplePages + Visible = True + end + item + Item = cbxPredefinedZoom + Visible = True + end + item + BeginGroup = True + Item = bbFormatPageBackground + Visible = True + end + item + Item = bbFormatShrinkToPageWidth + Visible = True + end + item + BeginGroup = True + Item = bbGoToFirstPage + Visible = True + end + item + Item = bbGoToPrevPage + Visible = True + end + item + Item = seActivePage + UserDefine = [udWidth] + UserWidth = 63 + Visible = True + end + item + Item = bbGoToNextPage + Visible = True + end + item + Item = bbGoToLastPage + Visible = True + end + item + BeginGroup = True + Item = bbFileExit + Visible = True + end> + Name = 'Standard' + OneOnRow = True + Row = 1 + UseOwnFont = False + Visible = True + WholeRow = False + end + item + AllowClose = False + Caption = 'Header and Footer' + DockedDockingStyle = dsTop + DockedLeft = 50 + DockedTop = 0 + DockingStyle = dsNone + FloatLeft = 523 + FloatTop = 228 + FloatClientWidth = 601 + FloatClientHeight = 22 + Hidden = True + ItemLinks = < + item + Item = bsiInsertAutoText + Visible = True + end + item + BeginGroup = True + Item = bbInsertHFPageNumber + UserDefine = [udPaintStyle] + Visible = True + end + item + Item = bbInsertHFTotalPages + UserDefine = [udPaintStyle] + Visible = True + end + item + Item = bbInsertHFPageOfPages + Visible = True + end + item + Item = bbFormatPageNumbering + Visible = True + end + item + BeginGroup = True + Item = bbInsertHFDateTime + Visible = True + end + item + Item = bbInsertHFDate + Visible = True + end + item + Item = bbInsertHFTime + Visible = True + end + item + Item = bbFormatDateTime + Visible = True + end + item + BeginGroup = True + Item = bbInsertHFUserName + Visible = True + end + item + Item = bbInsertHFMachineName + UserDefine = [udPaintStyle] + Visible = True + end + item + BeginGroup = True + Item = bbFormatHFClear + Visible = True + end + item + BeginGroup = True + Item = bbFormatHFBackground + Visible = True + end + item + BeginGroup = True + Item = bbFilePageSetup + Visible = True + end + item + Item = bbViewHFSwitchHeaderFooter + Visible = True + end + item + Item = bbViewSwitchToLeftPart + Visible = True + end + item + Item = bbViewSwitchToCenterPart + Visible = True + end + item + Item = bbViewSwitchToRightPart + Visible = True + end + item + BeginGroup = True + Item = bbViewHFClose + Visible = True + end> + Name = 'Header and Footer' + OneOnRow = True + Row = 0 + UseOwnFont = False + Visible = False + WholeRow = False + end + item + Caption = 'Shortcut Menus' + DockedDockingStyle = dsTop + DockedLeft = 0 + DockedTop = 0 + DockingStyle = dsNone + FloatLeft = 293 + FloatTop = 319 + FloatClientWidth = 188 + FloatClientHeight = 19 + Hidden = True + ItemLinks = < + item + Item = bsiShortcutPreview + Visible = True + end + item + Item = bsiShortCutExplorer + Visible = True + end + item + Item = bsiShortcutThumbnails + Visible = True + end> + Name = 'Shortcut Menus' + NotDocking = [dsLeft, dsTop, dsRight, dsBottom] + OneOnRow = False + Row = 0 + UseOwnFont = False + Visible = False + WholeRow = False + end + item + Caption = 'AutoText' + DockedDockingStyle = dsTop + DockedLeft = 0 + DockedTop = 0 + DockingStyle = dsNone + FloatLeft = 460 + FloatTop = 288 + FloatClientWidth = 124 + FloatClientHeight = 22 + ItemLinks = < + item + Item = bbInsertEditAutoText + Visible = True + end + item + BeginGroup = True + Item = bsiInsertAutoText + Visible = True + end> + Name = 'AutoText' + OneOnRow = False + Row = 0 + UseOwnFont = False + Visible = False + WholeRow = False + end + item + Caption = 'Explorer' + DockedDockingStyle = dsTop + DockedLeft = 0 + DockedTop = 49 + DockingStyle = dsTop + FloatLeft = 461 + FloatTop = 349 + FloatClientWidth = 23 + FloatClientHeight = 22 + ItemLinks = < + item + Item = bbExplorerCreateNewFolder + Visible = True + end + item + Item = bbExplorerDelete + Visible = True + end + item + Item = bbExplorerProperties + Visible = True + end> + Name = 'Explorer' + OneOnRow = True + Row = 2 + UseOwnFont = False + Visible = False + WholeRow = False + end> + Categories.Strings = ( + 'File' + 'Explorer' + 'Edit' + 'Insert' + 'View' + 'Format' + 'Zoom' + 'Tools' + 'Go' + 'Help' + 'Built-in Menus' + 'Shortcut Menus' + 'New Menu') + Categories.ItemsVisibles = ( + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2) + Categories.Visibles = ( + True + True + True + True + True + True + True + True + True + True + True + False + True) + Images = ilToolBar + LargeImages = ilToolBar + MenusShowRecentItemsFirst = False + PopupMenuLinks = < + item + PopupMenu = pmPreview + end + item + PopupMenu = pmThumbnails + end> + ShowShortCutInHint = True + StoreInRegistry = True + StretchGlyphs = False + Style = bmsFlat + UseSystemFont = True + OnBarVisibleChange = dxBarManagerBarVisibleChange + OnHideCustomizingForm = dxBarManagerHideCustomizingForm + OnShowCustomizingForm = dxBarManagerShowCustomizingForm + Left = 63 + Top = 197 + DockControlHeights = ( + 0 + 0 + 49 + 0) + object bbFile: TdxBarSubItem + Caption = '&File' + Category = 10 + Visible = ivAlways + ItemLinks = < + item + Item = bbFileDesign + Visible = True + end + item + Item = bbFileRebuild + Visible = True + end + item + BeginGroup = True + Item = bbFileLoad + Visible = True + end + item + Item = bbFileClose + Visible = True + end + item + BeginGroup = True + Item = bbFileSave + Visible = True + end + item + BeginGroup = True + Item = bbFilePrintDialog + Visible = True + end + item + Item = bbFilePageSetup + Visible = True + end + item + BeginGroup = True + Item = bbFileExit + Visible = True + end> + end + object bbFileDesign: TdxBarButton + Caption = '&Design...' + Category = 0 + Hint = 'ReportDesign|' + Visible = ivNever + ImageIndex = 0 + ShortCut = 16452 + OnClick = DesignClick + end + object bbFileRebuild: TdxBarButton + Caption = 'Rebuild' + Category = 0 + Hint = 'Rebuild' + Visible = ivAlways + ShortCut = 16500 + OnClick = bbFileRebuildClick + end + object bbViewMargins: TdxBarButton + Caption = '&Margins' + Category = 4 + Hint = 'Margins' + Visible = ivAlways + ButtonStyle = bsChecked + Down = True + ShortCut = 16461 + OnClick = bbViewMarginsClick + end + object bbZoomPercent100: TdxBarButton + Caption = '&Percent 100' + Category = 6 + Hint = 'Zoom 100 %' + Visible = ivAlways + ImageIndex = 5 + ShortCut = 16604 + OnClick = ZoomClick + end + object bbZoomPageWidth: TdxBarButton + Tag = 1 + Caption = '&Fit To Window' + Category = 6 + Hint = 'Zoom Page Width' + Visible = ivAlways + ImageIndex = 6 + ShortCut = 16432 + OnClick = ZoomClick + end + object bbZoomWholePage: TdxBarButton + Tag = 2 + Caption = '&One Page' + Category = 6 + Hint = 'Zoom One Page' + Visible = ivAlways + ImageIndex = 7 + ShortCut = 16433 + OnClick = ZoomClick + end + object bbZoomTwoPages: TdxBarButton + Tag = 3 + Caption = '&Two Page' + Category = 6 + Hint = 'Zoom Two Page' + Visible = ivAlways + ImageIndex = 8 + ShortCut = 16434 + OnClick = ZoomClick + end + object bbExplorer: TdxBarSubItem + Caption = 'E&xplorer' + Category = 10 + Visible = ivAlways + ItemLinks = < + item + Item = bbExplorerCreateNewFolder + Visible = True + end + item + BeginGroup = True + Item = bbExplorerDelete + Visible = True + end + item + Item = bbExplorerRename + Visible = True + end + item + BeginGroup = True + Item = bbExplorerProperties + Visible = True + end> + end + object bbGoToFirstPage: TdxBarButton + Caption = '&First Page' + Category = 8 + Hint = 'Go to First Page' + Visible = ivAlways + ImageIndex = 13 + ShortCut = 36 + OnClick = GoToPageClick + end + object bbGoToPrevPage: TdxBarButton + Tag = 1 + Caption = '&Previous Page' + Category = 8 + Hint = 'Go to Prev Page' + Visible = ivAlways + ImageIndex = 14 + ShortCut = 33 + OnClick = GoToPageClick + end + object bbGoToNextPage: TdxBarButton + Tag = 2 + Caption = '&Next Page' + Category = 8 + Hint = 'Go to Next Page' + Visible = ivAlways + ImageIndex = 15 + ShortCut = 34 + OnClick = GoToPageClick + end + object bbGoToLastPage: TdxBarButton + Tag = 3 + Caption = '&Last Page' + Category = 8 + Hint = 'Go to Last Page' + Visible = ivAlways + ImageIndex = 16 + ShortCut = 35 + OnClick = GoToPageClick + end + object bbEdit: TdxBarSubItem + Caption = '&Edit' + Category = 10 + Visible = ivNever + ItemLinks = < + item + Item = bbEditFind + Visible = True + end + item + Item = bbEditFindNext + Visible = True + end + item + BeginGroup = True + Item = bbEditReplace + Visible = True + end> + end + object bbZoomFourPages: TdxBarButton + Tag = 4 + Caption = 'Four Page' + Category = 6 + Hint = 'Zoom Four Page' + Visible = ivAlways + ImageIndex = 9 + ShortCut = 16436 + OnClick = ZoomClick + end + object bbZoomMultiplePages: TdxBarButton + Caption = '&Multiple Pages' + Category = 6 + Hint = 'Multiple Pages' + Visible = ivAlways + ImageIndex = 10 + OnClick = bbZoomMultiplePagesClick + end + object bbZoomWidenToSourceWidth: TdxBarButton + Tag = 5 + Caption = 'Widen To Source Width' + Category = 6 + Hint = 'Widen to source width' + Visible = ivAlways + ImageIndex = 11 + OnClick = ZoomClick + end + object seActivePage: TdxBarSpinEdit + Caption = '&Active Page :' + Category = 8 + Hint = 'Active Page :' + Visible = ivAlways + OnChange = seActivePageChange + Width = 100 + OnButtonClick = seActivePageButtonClick + end + object cbxPredefinedZoom: TdxBarImageCombo + Caption = '&Zoom :' + Category = 6 + Hint = 'Zoom :' + Visible = ivAlways + Text = '100%' + OnChange = cbxPredefinedZoomChange + Glyph.Data = { + F6000000424DF600000000000000760000002800000010000000100000000100 + 0400000000008000000000000000000000001000000010000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888 + 8888008888888888888800088888888888888000888888888888880008700007 + 88888880000888800888888807EE88887088888708E88888807888808E888888 + 88088880888888888808888088888888E808888088888888E80888870888888E + E078888807888EEE708888888008888008888888887000078888} + Width = 100 + OnClick = cbxPredefinedZoomClick + ShowEditor = True + Images = ilToolBar + Items.Strings = ( + '500%' + '200%' + '150%' + '100%' + '75%' + '50%' + '25%' + '10%' + 'Page Width' + 'Whole Page' + 'Two Pages' + 'Four Pages' + 'Widen To Source Width') + ItemIndex = 3 + ImageIndexes = ( + -1 + -1 + -1 + 5 + -1 + -1 + -1 + -1 + 6 + 7 + 8 + 9 + 11) + end + object bbFileLoad: TdxBarButton + Caption = '&Load...' + Category = 0 + Hint = 'Load' + Visible = ivAlways + ImageIndex = 43 + ShortCut = 16463 + OnClick = ExplorerLoadDataClick + end + object bbZoomSetup: TdxBarButton + Caption = '&Setup ...' + Category = 6 + Hint = 'Setup ' + Visible = ivAlways + PaintStyle = psCaption + OnClick = bbZoomSetupClick + end + object bbToolsOptions: TdxBarButton + Caption = '&Options...' + Category = 7 + Hint = 'Options' + Visible = ivAlways + OnClick = bbToolsOptionsClick + end + object bbViewMarginBar: TdxBarButton + Caption = 'MarginBar' + Category = 4 + Hint = 'Margin Bar' + Visible = ivAlways + ButtonStyle = bsChecked + Down = True + OnClick = bbViewMarginBarClick + end + object bbFileSave: TdxBarButton + Caption = '&Save...' + Category = 0 + Hint = 'Save' + Visible = ivAlways + ImageIndex = 38 + ShortCut = 16467 + OnClick = FileSaveClick + end + object bbViewStatusBar: TdxBarButton + Caption = 'StatusBar' + Category = 4 + Hint = 'StatusBar' + Visible = ivAlways + ButtonStyle = bsChecked + Down = True + OnClick = bbViewStatusBarClick + end + object bbHelpTopics: TdxBarButton + Caption = '&Help Topics...' + Category = 9 + Hint = 'Help' + Visible = ivAlways + ImageIndex = 17 + OnClick = HelpClick + end + object bbViewExplorer: TdxBarButton + Caption = 'E&xplorer' + Category = 4 + Hint = 'Explorer' + Visible = ivAlways + ButtonStyle = bsChecked + ImageIndex = 48 + ShortCut = 16472 + OnClick = bbViewExplorerClick + end + object bsiShortcutPreview: TdxBarSubItem + Caption = 'Preview' + Category = 11 + Visible = ivInCustomizing + ItemLinks = <> + end + object bsiInsertHFAutoText: TdxBarSubItem + Caption = 'AutoText' + Category = 3 + Visible = ivAlways + Detachable = True + DetachingBar = 4 + ItemLinks = < + item + Item = bbInsertEditAutoText + Visible = True + end + item + BeginGroup = True + Item = bliInsertAutoTextEntries + Visible = True + end> + end + object bbInsertEditAutoText: TdxBarButton + Caption = 'AutoTe&xt...' + Category = 3 + Hint = 'AutoText' + Visible = ivAlways + ImageIndex = 33 + end + object bsiInsertAutoText: TdxBarSubItem + Caption = 'Insert AutoText' + Category = 3 + Visible = ivAlways + ItemLinks = < + item + Item = bliInsertAutoTextEntries + Visible = True + end> + end + object bliInsertAutoTextEntries: TdxBarListItem + Caption = 'List of AutoText Entries' + Category = 3 + Visible = ivAlways + ShowNumbers = False + end + object bbInsertHFPageNumber: TdxBarButton + Caption = '&Page Number' + Category = 3 + Hint = 'Insert Page Number' + Visible = ivAlways + ImageIndex = 19 + ShortCut = 41040 + OnClick = InsertHFClick + end + object bbInsertHFTotalPages: TdxBarButton + Tag = 1 + Caption = '&Number of Pages' + Category = 3 + Hint = 'Insert Number of Pages' + Visible = ivAlways + ImageIndex = 21 + OnClick = InsertHFClick + end + object bbInsertHFPageOfPages: TdxBarButton + Tag = 2 + Caption = 'Page Number Of Pages' + Category = 3 + Hint = 'Insert Page Number Of Pages' + Visible = ivAlways + ImageIndex = 20 + OnClick = InsertHFClick + end + object bbInsertHFDateTime: TdxBarButton + Tag = 3 + Caption = 'Date and Time' + Category = 3 + Hint = 'Insert Date and Time' + Visible = ivAlways + ImageIndex = 23 + OnClick = InsertHFClick + end + object bbInsertHFDate: TdxBarButton + Tag = 4 + Caption = '&Date' + Category = 3 + Hint = 'Insert Date' + Visible = ivAlways + ImageIndex = 24 + ShortCut = 41028 + OnClick = InsertHFClick + end + object bbInsertHFTime: TdxBarButton + Tag = 5 + Caption = '&Time' + Category = 3 + Hint = 'Insert Time' + Visible = ivAlways + ImageIndex = 25 + ShortCut = 41044 + OnClick = InsertHFClick + end + object bbInsertHFUserName: TdxBarButton + Tag = 6 + Caption = '&User Name' + Category = 3 + Hint = 'Insert User Name' + Visible = ivAlways + ImageIndex = 27 + OnClick = InsertHFClick + end + object bbInsert: TdxBarSubItem + Caption = '&Insert' + Category = 10 + Visible = ivAlways + ItemLinks = < + item + Item = bsiInsertHFAutoText + Visible = True + end + item + BeginGroup = True + Item = bbInsertHFPageNumber + Visible = True + end + item + Item = bbInsertHFTotalPages + Visible = True + end + item + Item = bbInsertHFPageOfPages + Visible = True + end + item + BeginGroup = True + Item = bbInsertHFDateTime + Visible = True + end + item + Item = bbInsertHFDate + Visible = True + end + item + Item = bbInsertHFTime + Visible = True + end + item + BeginGroup = True + Item = bbInsertHFUserName + Visible = True + end + item + Item = bbInsertHFMachineName + Visible = True + end> + end + object bbView: TdxBarSubItem + Caption = '&View' + Category = 10 + Visible = ivAlways + ItemLinks = < + item + Item = bbViewMargins + Visible = True + end + item + BeginGroup = True + Item = bbViewMarginBar + Visible = True + end + item + Item = bbViewStatusBar + Visible = True + end + item + Item = bbViewExplorer + Visible = True + end + item + Item = bbViewThumbnails + Visible = True + end + item + BeginGroup = True + Item = bbViewToolbars + Visible = True + end + item + BeginGroup = True + Item = bbFormatHeaderAndFooter + Visible = True + end + item + BeginGroup = True + Item = bbViewZoom + Visible = True + end + item + BeginGroup = True + Item = bbViewPageHeaders + Visible = True + end + item + Item = bbViewPageFooters + Visible = True + end> + end + object bbViewZoom: TdxBarSubItem + Caption = 'Zoom' + Category = 10 + Visible = ivAlways + ItemLinks = < + item + Item = bbZoomPercent100 + Visible = True + end + item + BeginGroup = True + Item = bbZoomPageWidth + Visible = True + end + item + Item = bbZoomWholePage + Visible = True + end + item + Item = bbZoomTwoPages + Visible = True + end + item + Item = bbZoomFourPages + Visible = True + end + item + Item = bbZoomMultiplePages + Visible = True + end + item + BeginGroup = True + Item = bbZoomWidenToSourceWidth + Visible = True + end + item + BeginGroup = True + Item = bbZoomSetup + Visible = True + end> + end + object bbFormatHeaderAndFooter: TdxBarButton + Caption = '&Header and Footer' + Category = 5 + Hint = 'Header and Footer' + Visible = ivAlways + AllowAllUp = True + ButtonStyle = bsChecked + ImageIndex = 36 + OnClick = bbFormatHeaderAndFooterClick + end + object bbFormatDateTime: TdxBarButton + Caption = 'Date and &Time...' + Category = 5 + Hint = 'Date and Time' + Visible = ivAlways + ImageIndex = 26 + OnClick = bbFormatDateTimeClick + end + object bbFormatPageNumbering: TdxBarButton + Caption = 'Page &Numbering...' + Category = 5 + Hint = 'Page Numbering' + Visible = ivAlways + ImageIndex = 22 + OnClick = bbFormatPageNumbersClick + end + object bbEditFind: TdxBarButton + Caption = 'Find...' + Category = 2 + Hint = 'Find' + Visible = ivNever + ShortCut = 16454 + end + object bbFormatPageBackground: TdxBarButton + Caption = 'Page Bac&kground...' + Category = 5 + Hint = 'Background' + Visible = ivAlways + ImageIndex = 4 + ShortCut = 16459 + OnClick = PageBackgroundClick + end + object bbFormatShrinkToPageWidth: TdxBarButton + Caption = '&Shrink To Page' + Category = 5 + Hint = 'Shrink To Page' + Visible = ivAlways + AllowAllUp = True + ButtonStyle = bsChecked + ImageIndex = 12 + OnClick = bbFormatShrinkToPageWidthClick + end + object bbEditFindNext: TdxBarButton + Caption = 'Find &Next' + Category = 2 + Hint = 'Find Next' + Visible = ivNever + ShortCut = 114 + end + object bbEditReplace: TdxBarButton + Caption = '&Replace...' + Category = 2 + Hint = 'Replace' + Visible = ivNever + ShortCut = 16466 + end + object bbFormatShowHideEmptyPages: TdxBarButton + Caption = 'Show/Hide EmptyPages' + Category = 5 + Hint = 'Show/Hide Empty Pages' + Visible = ivAlways + ButtonStyle = bsChecked + OnClick = bbFormatShowHideEmptyPagesClick + end + object bbViewThumbnails: TdxBarButton + Caption = 'Th&umbnails' + Category = 4 + Hint = 'Thumbnails' + Visible = ivAlways + ButtonStyle = bsChecked + ImageIndex = 49 + ShortCut = 16469 + OnClick = bbViewThumbnailsClick + end + object bbFormatHFBackground: TdxBarButton + Caption = 'Header and Footer Background ...' + Category = 5 + Hint = 'Header and Footer Background ' + Visible = ivAlways + ImageIndex = 34 + OnClick = bbFormatHFBackgroundClick + end + object bbThumbnailsSmall: TdxBarButton + Caption = '&Small Thumbnails' + Category = 4 + Hint = 'Small Thumbnails' + Visible = ivAlways + ButtonStyle = bsChecked + OnClick = bbThumbnailsSizeClick + end + object bbToolsCustomize: TdxBarButton + Caption = '&Customize...' + Category = 7 + Hint = 'Customize' + Visible = ivAlways + OnClick = bbToolsCustomizeClick + end + object bbThumbnailsLarge: TdxBarButton + Tag = 1 + Caption = '&Large Thumbnails' + Category = 4 + Hint = 'Large Thumbnails' + Visible = ivAlways + ButtonStyle = bsChecked + Down = True + OnClick = bbThumbnailsSizeClick + end + object bbViewPages: TdxBarSubItem + Caption = 'Pages' + Category = 10 + Visible = ivNever + ItemLinks = <> + end + object bbViewToolbars: TdxBarToolbarsListItem + Caption = '&Toolbars' + Category = 4 + Visible = ivAlways + end + object bbHelpAbout: TdxBarButton + Caption = '&About...' + Category = 9 + Hint = 'About' + Visible = ivNever + end + object bbViewPageHeaders: TdxBarButton + Caption = 'Page &Headers' + Category = 4 + Hint = 'Page Headers' + Visible = ivAlways + ButtonStyle = bsChecked + Down = True + OnClick = bbViewPageHeadersClick + end + object bbViewPageFooters: TdxBarButton + Caption = 'Page &Footers' + Category = 4 + Hint = 'Page Footers' + Visible = ivAlways + ButtonStyle = bsChecked + Down = True + OnClick = bbViewPageFootersClick + end + object bbViewSwitchToLeftPart: TdxBarButton + Caption = 'Switch To Left Part' + Category = 4 + Hint = 'Switch To Left Part' + Visible = ivAlways + ButtonStyle = bsChecked + GroupIndex = 1 + Down = True + ImageIndex = 30 + OnClick = SwitchPartClick + end + object bbFormat: TdxBarSubItem + Caption = '&Format' + Category = 10 + Visible = ivAlways + ItemLinks = < + item + Item = bbFormatTitle + Visible = True + end + item + BeginGroup = True + Item = bbFormatPageNumbering + Visible = True + end + item + Item = bbFormatDateTime + Visible = True + end + item + BeginGroup = True + Item = bbFormatShrinkToPageWidth + Visible = True + end + item + Item = bbFormatShowHideEmptyPages + Visible = True + end + item + BeginGroup = True + Item = bbFormatPageBackground + Visible = True + end> + end + object bbGoToPage: TdxBarSubItem + Caption = '&Go' + Category = 10 + Visible = ivAlways + ItemLinks = < + item + Item = bbGoToFirstPage + Visible = True + end + item + Item = bbGoToPrevPage + Visible = True + end + item + BeginGroup = True + Item = seActivePage + Visible = True + end + item + BeginGroup = True + Item = bbGoToNextPage + Visible = True + end + item + Item = bbGoToLastPage + Visible = True + end> + end + object bbFormatHFClear: TdxBarButton + Caption = 'Clea&r Text' + Category = 5 + Hint = 'Clear Text' + Visible = ivAlways + OnClick = bbFormatHFClearClick + end + object bsiNewMenuNewMenu: TdxBarSubItem + Caption = 'New Item' + Category = 12 + Visible = ivAlways + ItemLinks = <> + end + object bbFileClose: TdxBarButton + Caption = '&Unload' + Category = 0 + Hint = 'Unload' + Visible = ivAlways + ImageIndex = 44 + ShortCut = 16499 + OnClick = bbFileCloseClick + end + object bbFilePrint: TdxBarButton + Caption = 'Print' + Category = 0 + Hint = 'Print' + Visible = ivNever + ImageIndex = 1 + OnClick = PrintClick + end + object bbInsertHFMachineName: TdxBarButton + Tag = 7 + Caption = '&Machine Name' + Category = 3 + Hint = 'Insert Machine Name' + Visible = ivAlways + ImageIndex = 28 + OnClick = InsertHFClick + end + object bbFilePrintDialog: TdxBarButton + Tag = 1 + Caption = '&Print...' + Category = 0 + Hint = 'Print Dialog' + Visible = ivNever + ImageIndex = 2 + ShortCut = 16464 + OnClick = PrintClick + end + object bbTools: TdxBarSubItem + Caption = '&Tools' + Category = 10 + Visible = ivAlways + ItemLinks = < + item + Item = bbToolsCustomize + Visible = True + end + item + Item = bbToolsOptions + Visible = True + end> + end + object bbExplorerCreateNewFolder: TdxBarButton + Caption = 'Create &Folder...' + Category = 1 + Hint = 'Create Folder' + Visible = ivAlways + ImageIndex = 40 + ShortCut = 32821 + OnClick = ExplorerCreateNewFolderClick + end + object bbHelp: TdxBarSubItem + Caption = '&Help' + Category = 10 + Visible = ivAlways + ItemLinks = < + item + Item = bbHelpTopics + Visible = True + end + item + BeginGroup = True + Item = bbHelpAbout + Visible = True + end> + end + object bbFilePageSetup: TdxBarButton + Tag = 2 + Caption = 'Page set&up...' + Category = 0 + Hint = 'Page Setup ' + Visible = ivNever + ButtonStyle = bsDropDown + DropDownMenu = pmPrintStyles + ImageIndex = 3 + OnClick = PageSetupClick + end + object bbViewSwitchToCenterPart: TdxBarButton + Tag = 1 + Caption = 'Switch To Center Part' + Category = 4 + Hint = 'Switch To Center Part' + Visible = ivAlways + ButtonStyle = bsChecked + GroupIndex = 1 + ImageIndex = 31 + OnClick = SwitchPartClick + end + object bliPrintStyles: TdxBarListItem + Caption = 'Print Styles' + Category = 0 + Visible = ivAlways + ShowCheck = True + ShowNumbers = False + end + object bsiShortCutExplorer: TdxBarSubItem + Caption = 'Explorer' + Category = 11 + Visible = ivAlways + ItemLinks = <> + end + object bbDefinePrintStyles: TdxBarButton + Caption = 'Define Print Styles...' + Category = 0 + Hint = 'Define Print Styles' + Visible = ivAlways + end + object bbExplorerDelete: TdxBarButton + Caption = '&Delete...' + Category = 1 + Hint = 'Delete' + Visible = ivAlways + ImageIndex = 39 + ShortCut = 46 + OnClick = ExplorerDeleteItemClick + end + object bbExplorerRename: TdxBarButton + Caption = '&Rename...' + Category = 1 + Hint = 'Rename' + Visible = ivAlways + ShortCut = 113 + OnClick = ExplorerRenameItemClick + end + object bbFormatTitle: TdxBarButton + Caption = 'Title...' + Category = 5 + Hint = 'Title' + Visible = ivAlways + ImageIndex = 45 + OnClick = bbFormatTitleClick + end + object bbViewSwitchToRightPart: TdxBarButton + Tag = 2 + Caption = 'Switch To Right Part' + Category = 4 + Hint = 'Switch To Right Part' + Visible = ivAlways + ButtonStyle = bsChecked + GroupIndex = 1 + ImageIndex = 32 + OnClick = SwitchPartClick + end + object bbViewHFSwitchHeaderFooter: TdxBarButton + Caption = '&Show Header/Footer' + Category = 4 + Hint = 'Show Header/Footer' + Visible = ivAlways + AllowAllUp = True + ButtonStyle = bsChecked + ImageIndex = 29 + OnClick = bbViewHFSwitchHeaderFooterClick + end + object bbViewHFClose: TdxBarButton + Caption = '&Close' + Category = 4 + Hint = 'Close Header and Footer' + Visible = ivAlways + OnClick = bbViewHFCloseClick + end + object bsiShortcutThumbnails: TdxBarSubItem + Caption = 'Thumbnails' + Category = 11 + Visible = ivAlways + ItemLinks = <> + end + object bbExplorerProperties: TdxBarButton + Caption = '&Properties...' + Category = 1 + Hint = 'P&roperties' + Visible = ivAlways + ImageIndex = 46 + ShortCut = 32781 + OnClick = bbExplorerPropertiesClick + end + object bbFileExit: TdxBarButton + Caption = '&Close' + Category = 0 + Hint = 'Close' + Visible = ivAlways + OnClick = CloseClick + end + end + object ilToolBar: TImageList + AllocBy = 48 + Left = 35 + Top = 197 + Bitmap = { + 494C010132003600040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 000000000000360000002800000040000000E0000000010020000000000000E0 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FF000000FFFF000080000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FFFF00008000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080800000808000008080000080 + 8000008080000080800000808000008080000080800000808000FF000000FFFF + 0000800000000080800000808000000000000000000000000000808080000000 + 0000000000000000000080808000000000000000000000000000808080000000 + 0000000000000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF00FF000000FFFF00008000 + 000000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000FFFF00C0C0C000000000000000000000000000C0C0C0008000000000FF + FF0000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF00C0C0C00000000000FFFF0000C0C0C000FFFF000000000000C0C0C00000FF + FF0000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000000000FFFF0000C0C0C000FFFF0000C0C0C000FFFF00000000000000FF + FF0000FFFF0000FFFF0000808000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000000000C0C0C000FFFF0000C0C0C000FFFF0000C0C0C0000000000000FF + FF0000FFFF0000FFFF0000808000000000000000000000000000808080000000 + 0000000000000000000080808000000000000000000000000000808080000000 + 0000000000000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000000000FFFF0000C0C0C000FFFF0000C0C0C000FFFF00000000000000FF + FF0000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF00C0C0C00000000000FFFF0000C0C0C000FFFF000000000000C0C0C00000FF + FF0000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000FFFF00C0C0C000000000000000000000000000C0C0C00000FFFF0000FF + FF0000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000808000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000008080800000FFFF000000 + 0000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000FFFF + FF00000000000000000000000000000000000000000000000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF0000000000000000FFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000FFFF + FF00808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000808080000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF00000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00000000000000 + 0000FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00C0C0C000FFFFFF00FFFFFF00C0C0C000FFFFFF00C0C0C000FFFFFF00C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF0000FFFF00FFFFFF00000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00C0C0C000FFFFFF00FFFFFF00C0C0C000FFFFFF00C0C0C000FFFFFF00C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00000000000000 + 0000FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF00000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00C0C0C000FFFFFF00FFFFFF00C0C0C000FFFFFF00C0C0C000FFFFFF00C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF00FFFFFF000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00000000000000 + 0000FFFFFF00FFFFFF00FFFFFF0000000000C0C0C00000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00000000000000000000000000FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF00000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000808080000000000000000000FFFFFF0000000000C0C0 + C00000000000FFFFFF0000000000C0C0C00000000000C0C0C000000000000000 + 000000000000000000008000000080000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000808080000000000000000000000000000000000000000000FFFF + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF00FFFFFF0000000000808080000000000000000000FFFFFF00FFFFFF000000 + 0000C0C0C00000000000C0C0C00000000000C0C0C00000000000C0C0C000C0C0 + C000C0C0C0000000000080000000800000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 000000000000000000000000000080000000000000000000000000000000FFFF + FF000000FF000000000000000000000000000000000000000000000000000000 + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 000000000000C0C0C00000000000C0C0C00000000000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C00080000000800000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000080000000000000000000000000000000FFFF + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 00000000000000000000C0C0C00000000000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000800000008000000000000000000000000000000000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000080000000000000008000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C0000000000080000000800000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000800000008000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080000000800000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000800000008000000080000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF00000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF008000000080000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF00000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00000000000000000000000000000000000000000000000000FFFF + FF0000FFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0080000000800000008000000080000000800000008000 + 0000FFFFFF00FFFFFF0000000000000000000000000000FFFF00000000000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000000000000000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF008000000080000000FFFFFF00FFFFFF00FFFF + FF0080000000FFFFFF00000000000000000000000000FFFFFF0000FFFF000000 + 0000008080000080800000808000008080000080800000808000008080000080 + 80000080800000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF00000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF00FFFF + FF0080000000FFFFFF0000000000000000000000000000FFFF00FFFFFF0000FF + FF00000000000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF008080800000FFFF00FFFFFF0000FFFF008080 + 800000FFFF0000FFFF0000FFFF00808080000000000000FFFF00FFFFFF000000 + 000000000000000000000000000000000000FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF008080800000FFFF0000FFFF008080 + 800000FFFF00FFFFFF008080800000FFFF0000000000FFFFFF0000FFFF00FFFF + FF00000000000000000000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF0080000000FFFFFF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF008080800000FFFF008080 + 8000FFFFFF008080800000FFFF00000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF000000000000000000000000000000000000000000FFFF + FF0080000000FFFFFF00FFFFFF00FFFFFF008000000080000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF0080808000808080008080800080808000FFFF + FF008080800080808000808080008080800000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00800000008000000080000000800000008000000080000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000FFFF00FFFFFF0000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000FFFF008080800000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008000000080000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF0000000000000000008080800000FFFF008080 + 800000FFFF008080800000FFFF0000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080800000FFFF00000000008080 + 8000FFFFFF00000000008080800000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000008080800000FFFF0000000000000000008080 + 8000808080000000000000000000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0008000 + 8000C0C0C0000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF000000000000000000000000000000000000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000008000 + 8000800080008000800080008000800080008000800080008000800080008000 + 8000800080000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0008000 + 8000C0C0C0000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF000000000000000000000000000000000000000000FFFF + FF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000FFFFFF000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0008000 + 8000C0C0C0000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0008000 + 8000C0C0C0000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000FFFFFF000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0008000 + 8000C0C0C0000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000008080000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF0000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0008000 + 8000C0C0C0000000000000000000000000000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000FFFFFF000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0008000 + 8000C0C0C0000000000000000000000000000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0008000 + 8000C0C0C0000000000000000000000000000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 00000000000000000000000000000000000000000000000000000000000000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF000000 + 000000000000000000000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0008000 + 8000C0C0C0000000000000000000000000000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000000000000000 + 0000000000000000000000000000000000000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF0000000000000000000000000000000000000000000000000000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000008000 + 800080008000800080008000800080008000800080008000800000000000C0C0 + C000000000000000000000000000000000000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C0C0C00000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840084848400848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008484840000FFFF00848484008484 + 840000FFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084848400FFFFFF008484 + 8400FFFFFF00FFFFFF0000FFFF000000000000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008484840000FFFF0000FFFF0000FF + FF0000FFFF000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000084848400000000008484 + 840000000000FFFFFF0000FFFF00000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008484840084848400848484008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF0000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000848484008484 + 84008484840000000000FFFFFF00FFFFFF0000FFFF0084848400FFFFFF00FFFF + FF0000FFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000C6C6C600C6C6C600C6C6 + C600848484008484840000000000FFFFFF00FFFFFF008400000084848400FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00C6C6C600C6C6C600C6C6 + C600C6C6C60084848400848484000000000000FFFF008400000084000000FFFF + FF0000FFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF0000000000FFFF + FF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00C6C6C600C6C6 + C600C6C6C600C6C6C6008484840084848400840000008400000084000000FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF000000 + 0000FFFFFF0000000000FFFFFF0000000000C6C6C600FFFFFF00FFFFFF00C6C6 + C60000000000C6C6C600C6C6C60084848400840000008400000084000000FFFF + FF0000FFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000848400008484000000 + 0000FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF0000000000FFFF + FF0000000000FFFFFF00000000000000000000000000C6C6C600FFFFFF000000 + 00008400000000000000C6C6C60084000000840000008400000084848400FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00000000000000 + 000000000000FFFFFF00000000000000000000000000FFFFFF00000000000000 + 000000000000FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF000000000000848400008484000000000000000000FFFFFF000000 + 0000FFFFFF000000000000000000000000000000000000000000C6C6C600FFFF + FF0084000000C6C6C60084848400840000008400000084848400FFFFFF0000FF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF000000 + 0000C6C6C600FFFFFF00C6C6C60000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008484840084848400848484008484 + 84008484840000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000008484000000000000000000000000008400000000000000C6C6 + C60084000000848484000000000084848400FFFFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF0000000000000000000000000000000000FFFFFF00FFFFFF00C6C6 + C600000000000000000000000000C6C6C600FFFFFF00FFFFFF00000000000000 + 000000000000FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008484840000FFFF0000FFFF0000FF + FF0000FFFF0000000000000000000000000000000000FFFFFF00FFFFFF000084 + 8400FFFFFF0000848400FFFFFF0000848400FFFFFF0000848400FFFFFF000084 + 8400FFFFFF000084840000000000000000000000000084000000C6C6C6000000 + 0000840000000000000084848400000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00848484008484840084848400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008484840000FFFF00848484008484 + 840000FFFF0000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000084840000000000000000000000000084000000C6C6C600C6C6 + C600840000008484840000FFFF000000000000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF000084 + 8400FFFFFF0000848400FFFFFF0000848400FFFFFF0000848400FFFFFF000084 + 8400FFFFFF000000000000000000000000000000000084848400840000008400 + 00008484840084848400848484000000000000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF000000000000000000000000000000000000FFFF008484 + 84008484840000FFFF0084848400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF008484840000FFFF00848484008484840000FFFF0084848400FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000848484008484840084848400848484008484840000000000000000000000 + 0000848484008484840084848400848484000000000000000000000000000000 + 0000FFFFFF008484840084848400848484008484840084848400848484008484 + 84008484840000FFFF000000000000000000000000000000000000FFFF0000FF + FF0000FFFF0000FFFF0084848400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF008484840000FFFF0000FFFF0000FFFF0000FFFF0084848400FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00C6C6C600C6C6C600848484000000000000000000FFFF + FF00848484008484840084848400848484000000000084848400848484000000 + 000000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000000000000000000000000000848484008484 + 8400848484008484840084848400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00848484008484840084848400848484008484840084848400FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF000000000000000000848484008484840000000000FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFF + FF000000000000000000848484008484840000000000FFFFFF00848484008484 + 840084848400848484008484840084848400FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000084848400840000008400 + 00008400000084000000840000008400000084000000FFFFFF0000000000FFFF + FF00FFFFFF00FFFFFF00848484008484840000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000084848400840000008400 + 00008400000084000000840000008400000084000000FFFFFF0000000000FFFF + FF000000000000000000848484008484840000000000FFFFFF00848484008484 + 840084848400848484008484840084848400FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000084848400840000008400 + 00008400000084000000840000008400000084000000FFFFFF0000000000FFFF + FF000000000000000000848484008484840000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000084848400840000008400 + 00008400000084000000840000008400000084000000FFFFFF0000000000FFFF + FF008484840084848400848484008484840000000000FFFFFF00848484008484 + 840084848400848484008484840084848400FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000084848400840000008400 + 00008400000084000000840000008400000084000000FFFFFF0000000000FFFF + FF008484840084848400848484008484840000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484008484 + 8400848484008484840084848400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00848484008484840084848400848484008484840084848400FFFF + FF00FFFFFF000000000000000000000000000000000084848400848484008484 + 840084848400848484008484840084848400848484008484840000000000FFFF + FF00848484008484840084848400848484000000000084848400848484008484 + 840084848400848484008484840084848400848484000000000000FFFF00FFFF + FF0000FFFF00FFFFFF000000000000000000000000000000000000FFFF0000FF + FF0000FFFF0000FFFF0084848400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF008484840000FFFF0000FFFF0000FFFF0000FFFF0084848400FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484008484 + 84008484840000FFFF000000000000000000000000000000000000FFFF008484 + 84008484840000FFFF0084848400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF008484840000FFFF00848484008484840000FFFF0084848400FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00C6C6C600FFFFFF00C6C6C600FFFFFF00C6C6 + C600FFFFFF00C6C6C600FFFFFF00000000000000000000000000000000000000 + 000000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000FFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000C6C6C600000000000000000000000000000000000000 + 00000000000000000000C6C6C6000000000000000000000000000000000000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00000000000000000000000000000000008400000084000000840000008400 + 0000840000008400000000000000FFFFFF0000FFFF00FFFFFF0000000000FFFF + FF0000FFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000C6C6C600FFFFFF00C6C6 + C600FFFFFF0000000000FFFFFF00C6C6C600FFFFFF00C6C6C600FFFFFF00C6C6 + C600FFFFFF00C6C6C600FFFFFF0000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF0000000000000000000000000084000000FFFFFF00C6C6C600FFFF + FF00C6C6C600FFFFFF000000000000FFFF00FFFFFF0000FFFF000000000000FF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000C6C6C600C6C6C60000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 00000000000000000000C6C6C600FFFFFF00C6C6C6000000840000008400FFFF + FF00C6C6C600FFFFFF00C6C6C600000000000000000000000000FFFFFF0000FF + FF000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000000000000000000000000084000000C6C6C600FFFFFF000000 + 8400FFFFFF0000008400000084000000000000FFFF00FFFFFF0000000000FFFF + FF0000FFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000C6C6C6000000000000000000000000000000 + 00000000000000000000000000000000000000000000C6C6C600FFFFFF00C6C6 + C600FFFFFF0000000000FFFFFF00C6C6C600FFFFFF000000840000008400C6C6 + C600FFFFFF00C6C6C600FFFFFF000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF00000000000000000084000000FFFFFF00C6C6C6000000 + 8400C6C6C60000008400C6C6C600FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000C6C6C600C6C6C600C6C6C600C6C6C6000000 + 00000000000000000000000000000000000000000000FFFFFF00848484000000 + 84000000840000000000C6C6C600FFFFFF00C6C6C600FFFFFF00000084000000 + 8400C6C6C600FFFFFF00C6C6C600000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00000000000000000084000000C6C6C600000084000000 + 8400FFFFFF00C6C6C60000008400C6C6C600C6C6C60000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000C6C6C600C6C6C600C6C6C6000000 + 00000000000000000000000000000000000000000000C6C6C600000084000000 + 8400FFFFFF0000000000FFFFFF00C6C6C600FFFFFF00C6C6C600FFFFFF000000 + 840000008400C6C6C600FFFFFF000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00000000000000000000000000000000000000 + 000000000000FFFFFF00000000000000000084000000FFFFFF00C6C6C6000000 + 8400C6C6C60084000000FFFFFF0084000000C6C6C600C6C6C600000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000C6C6C600C6C6C600C6C6C600C6C6C600C6C6 + C6000000000000000000000000000000000000000000FFFFFF00848484000000 + 84000000840000000000C6C6C600FFFFFF000000840000008400000084000000 + 840000008400FFFFFF00C6C6C600000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00000000000000000084000000C6C6C600FFFFFF00C6C6 + C600FFFFFF00C6C6C600FFFFFF00C6C6C600C6C6C60000000000C6C6C6000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000C6C6C600C6C6C600C6C6C600000000000000 + 00000000000000000000000000000000000000000000C6C6C600000084000000 + 8400FFFFFF0000000000FFFFFF00C6C6C600FFFFFF00C6C6C600FFFFFF00C6C6 + C600FFFFFF00C6C6C600FFFFFF000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000000000008400000084000000840000008400 + 0000840000000000000000000000C6C6C60000000000C6C6C60000000000C6C6 + C600000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000C6C6C600C6C6C6000000 + 00000000000000000000000000000000000000000000FFFFFF00848484000000 + 8400000084000000000084000000840000008400000084000000840000008400 + 0000840000008400000084000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000000000000000000000000084000000FF00000084000000FF00 + 0000FF00000000000000C6C6C60000000000C6C6C60000000000C6C6C6000000 + 0000C6C6C600C6C6C60000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C6000000000000000000000000000000000000000000C6C6C600FFFFFF00C6C6 + C600FFFFFF000000000084000000840000008400000084000000840000008400 + 000084000000840000008400000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF000000000000000000000000008400000084000000840000008400 + 0000840000008400000000000000C6C6C60000000000C6C6C60000000000C6C6 + C600C6C6C600C6C6C600C6C6C600000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084000000840000008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000FF + FF00FFFFFF0000FFFF00FFFFFF0000000000FFFFFF0000FFFF00FFFFFF0000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000C6C6C60000000000C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084000000840000008400 + 0000840000008400000084000000840000008400000084000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF00FFFFFF0000000000FFFF + FF0000FFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0084000000FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0084000000FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF008400000084000000840000008400000084000000FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF008400 + 0000FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00840000008400000084000000840000008400 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF0084000000FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00840000008400 + 000084000000840000008400000084000000FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000FFFF00000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0084000000FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0084000000FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000008400000084000000840000008400 + 0000840000008400000000000000FFFFFF0000FFFF00FFFFFF0000000000FFFF + FF0000FFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF0084000000FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF008400 + 00008400000084000000840000008400000084000000FFFFFF00FFFFFF000000 + 00000000000000000000000000000000000084000000FFFFFF00C6C6C600FFFF + FF00C6C6C600FFFFFF000000000000FFFF00FFFFFF0000FFFF000000000000FF + FF00FFFFFF0000FFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0084000000FFFFFF0084000000FFFFFF00FFFFFF00000000000000 + 00000000000000000000000000000000000084000000C6C6C600FFFFFF000000 + 8400FFFFFF0000008400000084000000000000FFFF00FFFFFF0000000000FFFF + FF0000FFFF00000000000000000000000000000000000000000000000000FFFF + FF008400000084000000840000008400000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF0084000000FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000000000000000 + 00000000000000000000000000000000000084000000FFFFFF00C6C6C6000000 + 8400C6C6C60000008400C6C6C600FFFFFF000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF008400000084000000840000008400000084000000FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000FFFFFF000000000000000000000000000000 + 00000000000000000000000000008400000084000000C6C6C600000084000000 + 8400FFFFFF00C6C6C60000008400C6C6C6008400000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000008400000084000000FFFFFF00C6C6C6000000 + 8400C6C6C6000000840000008400FFFFFF008400000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 0000FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 00000000000000000000000000008400000084000000C6C6C600FFFFFF00C6C6 + C600FFFFFF00C6C6C600FFFFFF00C6C6C6008400000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000FFFFFF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000840000008400000084000000840000008400 + 0000840000008400000084000000840000008400000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000008400000084000000FF00000084000000FF00 + 0000FF000000FF00000084000000FF0000008400000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000840000008400000084000000840000008400 + 0000840000008400000084000000840000008400000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 840084848400848484008484840084848400848484000000000000FFFF000000 + 0000848484000000000000000000000000000000000000000000000000000000 + 0000000000008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF000000 + 0000000000008484840000000000000000000000000000000000000000000000 + 0000848484008484840000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 8400848484008484840000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFF0000000000000000000000000000FFFF + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00FFFFFF00FFFFFF008400000084000000FFFFFF00FFFFFF0000FF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400848484000000000000FFFF0000FFFF0000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF0084000000FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFF0000FFFF00008484840000000000FFFF + 0000FFFF00000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400000000000000000000FFFF0000FFFF0000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF0084000000FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000000000000FFFF + 0000FFFF0000FFFF000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00FFFFFF00FFFFFF008400000084848400FFFFFF00FFFFFF0000FF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400848484000000000000FFFF0000FFFF0000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF0084000000840000008400000084000000840000008400000084000000FFFF + FF00FFFFFF0000000000000000000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF00000000 + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000FFFF00FFFFFF008484840084000000C6C6C600FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400848484000000000000FFFF0000FFFF0084848400000000000000 + 000000000000848484008484840084848400000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF0084000000FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000000000000FFFF + 0000FFFF0000FFFF000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00FFFFFF00FFFFFF0000FFFF0084848400840000008484840000FF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400848484000000000000FFFF0000FFFF0000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF0084000000FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFF0000FFFF00008484840000000000FFFF + 0000FFFF00000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF008400000084848400FFFFFF00FFFFFF008400000084000000FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400848484000000000000FFFF0000FFFF0084848400000000000000 + 000000000000848484008484840084848400000000000000000000000000FFFF + FF00FFFFFF008400000084000000840000008400000084000000840000008400 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFF0000000000000000000000000000FFFF + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00840000008400000000FFFF00C6C6C600840000008400000000FF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 8400848484000000000000FFFF0000FFFF0000FFFF0000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF0084000000FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00C6C6C60084000000840000008400000084000000C6C6C600FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 84000000000000FFFF0000FFFF0000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF0084000000FFFFFF00FFFFFF0084000000FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FF000000FF000000FF00 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FF000000FF000000FF00 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000FFFF0000000000000000000000000000FFFF000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFF0000000000000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C600C6C6C600C6C6C600C6C6C60000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + 0000FFFF00000000000084848400FFFF0000FFFF000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFF0000FFFF00000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C600FF000000FF000000FF00000000000000FFFFFF00FF000000FF000000FF00 + 0000FFFFFF000000000000000000000000000000000000000000FFFF0000FFFF + 0000FFFF000000000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000000000000000000000000000000000000000000000000000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 000000000000000000000000000000000000000000008484000000000000C6C6 + C600C6C6C600C6C6C600C6C6C60000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFF0000FFFF0000FFFF + 000000000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF000000000000000000000000000000000000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000000000000000000000000000000000000000000000000000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000000000000000000000000000000000008484000000000000C6C6 + C600FF000000FF000000FF000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFF0000FFFF + 0000FFFF000000000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000000000000000000000000000000000000000000000000000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 000000000000000000000000000000000000000000008484000000000000C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C6000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + 0000FFFF00000000000084848400FFFF0000FFFF000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFF0000FFFF00000000 + 000000000000000000000000000000000000000000008484000000000000C6C6 + C600FF000000FF000000FF000000C6C6C6000000000000000000000000000000 + 0000000000000000000084000000000000000000000000000000000000000000 + 0000FFFF0000000000000000000000000000FFFF000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFF0000000000000000 + 000000000000000000000000000000000000000000008484000000000000C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C6000000000000000000000000000000 + 0000000000008400000084000000840000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084840000848400008484 + 0000848400008484000000000000000000000000000000000000840000000000 + 0000000000000000000084000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008400 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 8400848400008484840084840000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 8400848400008484840084840000000000000000000084840000000000000000 + 0000000000000000000000000000848400008484840000000000000000000000 + 0000000000000000000084848400000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 84008484000084848400848400000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084840000000000000000 + 0000000000000000000000000000848400008484840000000000000000000000 + 000000000000000000008484840000000000000000008484840000000000FFFF + FF00FFFFFF00FFFFFF0000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF000000000084840000000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 00008484840084840000848484000000000000000000FFFFFF00FFFFFF000000 + 000000000000FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF0000000000FFFFFF00FFFFFF0000000000000000008484840000000000FFFF + FF00FFFFFF00FFFFFF0000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF000000000084840000000000000000000084840000000000000000 + 000000000000FFFFFF0000000000848400008484840000000000000000000000 + 0000FFFFFF000000000084848400000000000000000084848400000000000000 + 0000000000008484840000000000000000000000000084840000000000000000 + 00000000000084848400848400000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000FFFFFF000000 + 000000000000000000008484840000000000000000008484840000000000FFFF + FF00FFFFFF00FFFFFF0000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF00000000008484000000000000000000008484000000000000FFFF + FF00000000008484000000000000FFFFFF00000000008484840000000000FFFF + FF000000000084840000848484000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084848400000000000000 + 000000000000FFFFFF0000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF000000000084840000000000000000000084840000000000000000 + 0000000000000000000000000000848400008484840000000000000000000000 + 000000000000000000008484840000000000000000008484840000000000FFFF + FF00000000008484840000000000FFFFFF00000000008484000000000000FFFF + FF000000000084848400848400000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000000000000000 + 0000FFFFFF000000000084848400000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 8400848400008484840084840000000000000000000084840000000000000000 + 0000000000008484000000000000000000000000000084840000000000000000 + 00000000000084840000848484000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000000000000000008484840000000000FFFF + FF00000000000000000000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF000000000084840000000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 0000848484008484000084848400000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 84008484000084848400848400000000000000000000FFFFFF0000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF0000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000FFFFFF000000 + 0000FFFFFF000000000084848400000000000000000084848400000000000000 + 0000000000000000000000000000848484008484000000000000000000000000 + 0000000000000000000084840000000000000000000084840000000000000000 + 0000000000008484000000000000000000000000000084840000000000000000 + 0000000000008484000084848400000000008484840000000000FF000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FF0000000000000084848400000000008484840000000000FFFF + FF0000000000FFFFFF0000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF00000000008484000000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000FFFFFF00FFFF + FF00FFFFFF00000000008484840000000000000000008484840000000000FFFF + FF00000000008484840000000000FFFFFF00000000008484840000000000FFFF + FF000000000084848400848400000000000000000000FF000000FF0000000000 + 0000FFFFFF00FF000000000000000000000000000000FFFFFF00FF000000FFFF + FF0000000000FF000000FF00000000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000FFFFFF00FFFF + FF00FFFFFF000000000084848400000000000000000084848400000000000000 + 000000000000FFFFFF0000000000848484008484000000000000000000000000 + 0000FFFFFF00000000008484000000000000000000008484000000000000FFFF + FF00000000008484000000000000FFFFFF00000000008484000000000000FFFF + FF00000000008484000084848400000000008484840000000000FF000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FF00000000000000848484000000000084848400000000000000 + 0000000000000000000000000000848484008484000000000000000000000000 + 000000000000000000008484000000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000FFFFFF00FFFF + FF00FFFFFF000000000084848400000000000000000084848400000000000000 + 0000000000008484840000000000000000000000000084848400000000000000 + 00000000000084848400848400000000000000000000FFFFFF0000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF00000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 0000848484008484000084848400000000000000000084848400000000000000 + 0000000000000000000000000000848484008484000000000000000000000000 + 0000000000000000000084840000000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 00008484840084840000848484000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 0000848484008484000084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084848400FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 840084840000848484008484000000000000000000000000000084848400FFFF + FF000000000000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF0000FFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084840000848484000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000848484008484000084848400000000000000000000000000848484000000 + 00008484840000000000FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00000000000000000084848400848400000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000008484840084840000000000000000000000000000000000008484 + 8400848484008484840000000000FFFFFF00FFFFFF0000FFFF0084848400FFFF + FF00FFFFFF0000FFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084840000848484000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000008484000084848400000000000000000000000000C6C6C600C6C6 + C600C6C6C600848484008484840000000000FFFFFF00FFFFFF00840000008484 + 8400FFFFFF00FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084848400848400000000 + 0000FFFFFF00840000008400000084000000840000008400000084000000FFFF + FF000000000084848400848400000000000000000000FFFFFF00C6C6C600C6C6 + C600C6C6C600C6C6C60084848400848484000000000000FFFF00840000008400 + 0000FFFFFF0000FFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084840000848484000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0000000000848400008484840000000000C6C6C600FFFFFF00FFFFFF00C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084000000840000008400 + 0000FFFFFF00FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF0000000000FFFFFF00FFFFFF00000000000000000084848400848400000000 + 0000FFFFFF0084000000840000008400000084000000FFFFFF00FFFFFF00FFFF + FF000000000084848400848400000000000000000000C6C6C600FFFFFF00FFFF + FF00C6C6C60000000000C6C6C600C6C6C6008484840084000000840000008400 + 0000FFFFFF0000FFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF0000000000FF00 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF00000000000000FFFFFF00000000000000000084840000848484000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000008484000084848400000000000000000000000000C6C6C600FFFF + FF00000000008400000000000000C6C6C6008400000084000000840000008484 + 8400FFFFFF00FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000FF000000FF00 + 000000000000FFFFFF0000000000FF000000FF00000000000000FFFFFF000000 + 0000FF000000FF00000000000000000000000000000084848400848400000000 + 0000FFFFFF00840000008400000084000000840000008400000084000000FFFF + FF0000000000848484008484000000000000000000000000000000000000C6C6 + C600FFFFFF0084000000C6C6C60084848400840000008400000084848400FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF0000000000FF00 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF00000000000000FFFFFF00000000000000000084840000848484000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000008484000084848400000000000000000000000000840000000000 + 0000C6C6C60084000000848484000000000084848400FFFFFF00FFFFFF000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF0000000000FFFFFF00FFFFFF00000000000000000084848400848400000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000848484008484000000000000000000000000000084000000C6C6 + C60000000000840000000000000084848400FFFFFF0000FFFF00FFFFFF008484 + 8400C6C6C60000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 000084848400848400008484840000000000000000000000000084000000C6C6 + C600C6C6C600840000008484840000FFFF00FFFFFF00FFFFFF00FFFFFF008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484008400 + 0000840000008484840084848400848484008484840084848400848484008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084848400848484008484840000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400000000008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000008484840000000000000000000000000000000000C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C6000000000000000000000000000000000000000000C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C6000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484000000 + 00000000000000000000C6C6C600C6C6C600C6C6C60000000000000000000000 + 0000000000000000000084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C60000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C60000000000000000000000000000000000000000000000 + 000000000000FFFFFF008484840000000000FFFFFF0000000000000000000000 + 000000000000000000000000000000000000000000008484840000000000C6C6 + C600848484000000000000000000C6C6C600C6C6C6000000000084848400C6C6 + C6000000000000000000848484000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C60000FFFF0000FFFF0000FFFF00C6C6C600C6C6 + C6000000000000000000000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C60000FFFF0000FFFF0000FFFF00C6C6C600C6C6 + C600000000000000000000000000000000000000000084848400FFFFFF00FFFF + FF00FFFFFF00848484008484840000000000FFFFFF00FFFFFF00848484008484 + 840084848400848484000000000000000000000000000000000084848400C6C6 + C60084848400C6C6C600C6C6C6008484840000000000C6C6C600848484008484 + 84008484840084848400000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084848400C6C6C600C6C6 + C60000000000C6C6C600000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084848400C6C6C600C6C6 + C60000000000C6C6C60000000000000000000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000000000000000000000000000000000 + 0000C6C6C600C6C6C60000000000FFFFFF00FFFFFF0000000000C6C6C6000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C600C6C6C600000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C600C6C6C600000000000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000008484840000000000C6C6C6000000 + 0000C6C6C60000000000C6C6C600C6C6C600C6C6C600FFFFFF00848484000000 + 0000C6C6C600C6C6C600000000008484840000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C60000000000C6C6C6000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C60000000000C6C6C600000000000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000008484840000000000C6C6C600C6C6 + C600FFFFFF00000000008484840000000000C6C6C600FFFFFF0084848400C6C6 + C600C6C6C600C6C6C60000000000848484000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C60000000000C6C6C60000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C60000000000C6C6C60000000000000000000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000008484840000000000000000000000 + 0000FFFFFF00000000008484840084848400C6C6C60000000000C6C6C6000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000C6C6C60000000000C6C6C60000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000C6C6C60000000000C6C6C600848484000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000000000000000000000000000000000 + 0000C6C6C600FFFFFF00000000000000000000000000C6C6C600C6C6C6000000 + 0000000000008484840000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008484 + 0000FFFF0000FFFF0000FFFF0000000000000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00848484000000000000000000000000000000000084848400C6C6 + C60084848400C6C6C600FFFFFF00FFFFFF00C6C6C600C6C6C600848484008484 + 8400848484000000000084848400000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000084848400000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + 0000848400000000000000000000848484000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00848484000000000000000000000000008484840000000000C6C6 + C600848484000000000000000000C6C6C6000000000000000000C6C6C600C6C6 + C600000000008484840000000000000000000000000000000000000000000000 + 000000000000FFFFFF000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000FFFF00008484 + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000000000000000000000000000000000000000000084848400FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000848484000000 + 00008484840000000000C6C6C600C6C6C600C6C6C60000000000848484000000 + 0000848484000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000084848400000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + 0000848400000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400000000000000000000000000000000000000000084848400000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00848484008484 + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084848400848484008484840000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000E00000000100010000000000000700000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFF18000000000008000800000000000 + 0000800000000000000080000000000000008000000000000000800000000000 + 0000800000000000000080000000000000008000000000000000800000000000 + 0000800000000000000080000000000000018000000000008007800000000000 + C007800000000000E007FFFF00000000FFFFE001FFFFFFFFFFFFC001000F8000 + 8003C001000F80008003C001000F80008003C001000F80008003C001000F8000 + 8003C001000F80008003C001000F80008003C001000F80008003C00100048000 + 8003C00100008000C1FEC00100008001E3FEC001F800C07FFFF5C001FC00E0FF + FFF3C003FE04FFFFFFF1FFFFFFFFFFFFFFFFFFFFC001FFFF00010001C001FFFF + 00010001C001001F00010001C001000F00010001C001000700010001C0010003 + 00010001C001000100000001C001000000000001C001001F00010001C001001F + 00000001C001001F00000003C0018FF1808180FFC001FFF9C124C1FFC003FF75 + FE66FFFFC007FF8FFFE7FFFFC00FFFFFC001FFFFFFFFFFFFC001C003C001FFFF + C001C0038031FFF9C001C0038031E7FFC001C0038031C3F3C001C0038001C3E7 + C001C0038001E1C7C001C0038001F08FC001C0038FF1F81FC001C0038FF1FC3F + C001C0038FF1F81FC001C0038FF1F09FC003C0038FF1C1C7C007C0078FF183E3 + C00FC00F80018FF1FFFFC01FFFFFFFFFFFFFFFFFFE0080008003FFFF80000000 + 8003FF81800000008003FF00800000008003FE00800300008003FE0000030000 + 8003FC80000300008003FA000003000080038000000300008003000100030000 + 8003000180030000800300018003000080030001800000008003000180000000 + 8003000580000000FFFF8003FE0000018001FFFFFFFFFFFF8001E00180038003 + DFFBE00180038003F070000180038003E060000180038003802C000180038003 + 000C003F800380030000003F80038003000C003F800380030000003F80038003 + 0000003F80038003000000018003800300000001800380030000000180038003 + FFFFE00180038003FFFFE001FFFFFFFFFFFFFFFFFC01FFFFF800F83FFC01FFFF + F800E00F8001F7DF0000C0070001F63F000080030001F83F000080030003FC1F + 000000010007F80F00000001003FF00F00000001000FF00700000001000FF00F + 000000010003F00F000080030001F007000080030000F8070000C007FE00FC1F + 001FE00FFE00FFFF001FF83FFF80FFFFFFFFFFFFFFFFFFFFC003C003000FFF07 + C003C003000FFE03C003C003140FFC01C003C003000FFC01C003C003000F8001 + C003C003000F0001C003C003000F0001C003C003000F0003C003C003052F0007 + C003C0030052003FC003C00302AC003FC003C003815E003FE003E003C0BE003F + F003F003E07C003FF803F803FF82007FFFFFFFEFFDFFFFFFFFFFFFCFF9FFFFFF + FFFFE007F1FFC003FDDFC003E1FFC003FCCF80030007C003FC478003C03FC003 + 00038003C037C00300018003C027C00300008003C000C00300018003C000C003 + 00038003C000C003FC478003C027C003FCCF8003C037C003FDDF8003C03FE003 + FFFF8003C03FF003FFFFC007FFFFF803FFFFFFFFFFFFFFFFFE03FFFFFFFFFFFF + FE03FFFFFFFFFFFFFE03FBBFFEFFFF7FFE03F33FFCFFFF3FC003E23FF8FFFF1F + C003C000F003C00F00038000E003C00700030000C003C00300038000E003C007 + 007FC000F003C00F007DE23FF8FFFF1F0078F33FFCFFFF3F007DFBBFFEFFFF7F + 01DDFFFFFFFFFFFF01E3FFFFFFFFFFFFFFFF8001FFFFFFFF8001000080018081 + 0000000000000080000000000000008000000000000000800000000000000100 + 0000000000000100000000000000018000000000000000800000000000000000 + 0000000000000100000000000000018000000000000000800000000000000080 + 8001000080018081FFFF8001FFFFFFFFFFFFFFFFFFFFFFFFC001800180018001 + C001000000000000C001000000000000C001000000000000C001000000000000 + 8001000000000000000100000000000000010000000000000001000000000000 + 8001000000000000C001000000000000C001000000000000C003000000000000 + C007800180018001C00FFFFFFFFFFFFFFC7FFFFFFFFFFFFFFC27C007C007FFFF + EC2380038003F83FC4010001000100018001000100010001C003000100010001 + E000000000000001000000000000000100008000800000010003C000C0000001 + E001E001E0000001C001E007800000018003F00780070101C407F00380008383 + EC3FF803F000FFFFFC7FFFFFF800FFFF00000000000000000000000000000000 + 000000000000} + end + object pmPreview: TdxBarPopupMenu + BarManager = dxBarManager + ItemLinks = < + item + Item = bbFileDesign + Visible = True + end + item + BeginGroup = True + Item = bbFilePageSetup + Visible = True + end + item + BeginGroup = True + Item = bbFormatShrinkToPageWidth + Visible = True + end + item + BeginGroup = True + Item = cbxPredefinedZoom + Visible = True + end + item + Item = bbZoomWholePage + Visible = True + end + item + BeginGroup = True + Item = bbGoToFirstPage + Visible = True + end + item + Item = bbGoToPrevPage + Visible = True + end + item + BeginGroup = True + Item = seActivePage + Visible = True + end + item + BeginGroup = True + Item = bbGoToNextPage + Visible = True + end + item + Item = bbGoToLastPage + Visible = True + end> + UseOwnFont = False + Left = 91 + Top = 197 + end + object MainMenu1: TMainMenu + Left = 7 + Top = 197 + end + object pmPrintStyles: TdxBarPopupMenu + BarManager = dxBarManager + ItemLinks = < + item + Item = bliPrintStyles + Visible = True + end + item + BeginGroup = True + Item = bbDefinePrintStyles + Visible = True + end> + UseOwnFont = False + Left = 119 + Top = 197 + end + object TimerHint: TTimer + Enabled = False + OnTimer = TimerHintTimer + Left = 8 + Top = 246 + end + object pmExplorer: TdxBarPopupMenu + BarManager = dxBarManager + ItemLinks = < + item + Item = bbFileLoad + Visible = True + end + item + Item = bbFileClose + Visible = True + end + item + BeginGroup = True + Item = bbExplorerCreateNewFolder + Visible = True + end + item + BeginGroup = True + Item = bbExplorerDelete + Visible = True + end + item + Item = bbExplorerRename + Visible = True + end + item + BeginGroup = True + Item = bbExplorerProperties + Visible = True + end> + UseOwnFont = False + OnPopup = pmExplorerPopup + Left = 147 + Top = 197 + end + object pmThumbnails: TdxBarPopupMenu + BarManager = dxBarManager + ItemLinks = < + item + Item = bbThumbnailsSmall + Visible = True + end + item + Item = bbThumbnailsLarge + Visible = True + end> + UseOwnFont = False + Left = 175 + Top = 197 + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSPrVwAdv.pas b/official/x.35/ExpressPrinting System/Sources/dxPSPrVwAdv.pas new file mode 100644 index 00000000..ad467a6e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSPrVwAdv.pas @@ -0,0 +1,1707 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSPrVwAdv; + +interface + +{$I cxVer.inc} + +uses + Windows, SysUtils, Classes, Messages, Graphics, Controls, ComCtrls, StdCtrls, + ExtCtrls, Forms, Menus, ImgList, dxPSCore, dxPSESys, dxPrevw, dxPSPrvw, dxBar, + dxBarPopupMenuEd, dxBarExtItems, cxClasses; + +type + TdxfmPreviewWdxBar = class(TCustomdxPSPreviewWindow) + dxBarManager: TdxBarManager; + bbFile: TdxBarSubItem; + bbToolsOptions: TdxBarButton; + bbFileDesign: TdxBarButton; + bbFilePrint: TdxBarButton; + bbFilePrintDialog: TdxBarButton; + bbView: TdxBarSubItem; + bbZoomPercent100: TdxBarButton; + bbZoomPageWidth: TdxBarButton; + bbZoomWholePage: TdxBarButton; + bbZoomTwoPages: TdxBarButton; + bbGoToPage: TdxBarSubItem; + bbGoToFirstPage: TdxBarButton; + bbGoToPrevPage: TdxBarButton; + bbGoToNextPage: TdxBarButton; + bbGoToLastPage: TdxBarButton; + bbHelp: TdxBarSubItem; + bbHelpTopics: TdxBarButton; + bbZoomFourPages: TdxBarButton; + ilToolBar: TImageList; + bbZoomWidenToSourceWidth: TdxBarButton; + seActivePage: TdxBarSpinEdit; + pmPreview: TdxBarPopupMenu; + MainMenu1: TMainMenu; + bbViewToolbars: TdxBarToolbarsListItem; + bbZoomMultiplePages: TdxBarButton; + cbxPredefinedZoom: TdxBarImageCombo; + bbZoomSetup: TdxBarButton; + bbFileExit: TdxBarButton; + bbFormatShrinkToPageWidth: TdxBarButton; + bbViewMargins: TdxBarButton; + bbViewMarginBar: TdxBarButton; + bbViewStatusBar: TdxBarButton; + bsiShortcutPreview: TdxBarSubItem; + bsiInsertHFAutoText: TdxBarSubItem; + bbInsertHFPageNumber: TdxBarButton; + bbInsertHFTotalPages: TdxBarButton; + bbInsertHFPageOfPages: TdxBarButton; + bbInsertHFDate: TdxBarButton; + bbInsertHFTime: TdxBarButton; + bbInsertHFDateTime: TdxBarButton; + bbViewHFSwitchHeaderFooter: TdxBarButton; + bbInsertHFUserName: TdxBarButton; + bbInsertHFMachineName: TdxBarButton; + bbViewHFClose: TdxBarButton; + bbFormatHeaderAndFooter: TdxBarButton; + bbViewSwitchToLeftPart: TdxBarButton; + bbViewSwitchToCenterPart: TdxBarButton; + bbViewSwitchToRightPart: TdxBarButton; + bbFormatHFClear: TdxBarButton; + bbFormat: TdxBarSubItem; + bbEdit: TdxBarSubItem; + bbFilePageSetup: TdxBarButton; + bliInsertAutoTextEntries: TdxBarListItem; + bbInsertEditAutoText: TdxBarButton; + bbFormatHFBackground: TdxBarButton; + bbFormatDateTime: TdxBarButton; + bbFormatPageNumbering: TdxBarButton; + bbEditFind: TdxBarButton; + bbEditFindNext: TdxBarButton; + bbEditReplace: TdxBarButton; + bbViewPageHeaders: TdxBarButton; + bbViewPageFooters: TdxBarButton; + bbViewPages: TdxBarSubItem; + bbFormatPageBackground: TdxBarButton; + bbViewZoom: TdxBarSubItem; + bbToolsCustomize: TdxBarButton; + bbTools: TdxBarSubItem; + bbHelpAbout: TdxBarButton; + bbInsert: TdxBarSubItem; + bbFormatShowHideEmptyPages: TdxBarButton; + bsiNewMenuNewMenu: TdxBarSubItem; + pmPrintStyles: TdxBarPopupMenu; + bliPrintStyles: TdxBarListItem; + bbDefinePrintStyles: TdxBarButton; + bsiInsertAutoText: TdxBarSubItem; + TimerHint: TTimer; + bbFileLoad: TdxBarButton; + bbExplorerCreateNewFolder: TdxBarButton; + bbExplorerDelete: TdxBarButton; + bbExplorerRename: TdxBarButton; + bbExplorer: TdxBarSubItem; + bbFileSave: TdxBarButton; + bbViewExplorer: TdxBarButton; + pmExplorer: TdxBarPopupMenu; + bsiShortCutExplorer: TdxBarSubItem; + bbFileClose: TdxBarButton; + bbFormatTitle: TdxBarButton; + pmThumbnails: TdxBarPopupMenu; + bbViewThumbnails: TdxBarButton; + bbThumbnailsSmall: TdxBarButton; + bbThumbnailsLarge: TdxBarButton; + bsiShortcutThumbnails: TdxBarSubItem; + bbExplorerProperties: TdxBarButton; + bbFileRebuild: TdxBarButton; + procedure PageSetupClick(Sender: TObject); + procedure ZoomClick(Sender: TObject); + procedure GoToPageClick(Sender: TObject); + procedure CloseClick(Sender: TObject); + procedure DesignClick(Sender: TObject); + procedure PageBackgroundClick(Sender: TObject); + procedure bbViewMarginsClick(Sender: TObject); + procedure HelpClick(Sender: TObject); + procedure bbViewMarginBarClick(Sender: TObject); + procedure bbViewStatusBarClick(Sender: TObject); + procedure seActivePageChange(Sender: TObject); + procedure cbxPredefinedZoomChange(Sender: TObject); + procedure seActivePageButtonClick(Sender: TdxBarSpinEdit; + Button: TdxBarSpinEditButton); + procedure bbZoomMultiplePagesClick(Sender: TObject); + procedure bbZoomSetupClick(Sender: TObject); + procedure cbxPredefinedZoomClick(Sender: TObject); + procedure bbFormatShrinkToPageWidthClick(Sender: TObject); + procedure miCustomizePopupClick(Sender: TObject); + procedure dxBarManagerBarVisibleChange(Sender: TdxBarManager; ABar: TdxBar); + procedure bbViewHFCloseClick(Sender: TObject); + procedure bbFormatHeaderAndFooterClick(Sender: TObject); + procedure InsertHFClick(Sender: TObject); + procedure bbViewHFSwitchHeaderFooterClick(Sender: TObject); + procedure bbFormatDateTimeClick(Sender: TObject); + procedure SwitchPartClick(Sender: TObject); + procedure bbFormatHFClearClick(Sender: TObject); + procedure bbFormatHFBackgroundClick(Sender: TObject); + procedure PrintClick(Sender: TObject); + procedure bbFormatPageNumbersClick(Sender: TObject); + procedure bbViewPageHeadersClick(Sender: TObject); + procedure bbViewPageFootersClick(Sender: TObject); + procedure bbToolsCustomizeClick(Sender: TObject); + procedure dxBarManagerShowCustomizingForm(Sender: TObject); + procedure dxBarManagerHideCustomizingForm(Sender: TObject); + procedure bbFormatShowHideEmptyPagesClick(Sender: TObject); + procedure bbToolsOptionsClick(Sender: TObject); + procedure TimerHintTimer(Sender: TObject); + procedure FileSaveClick(Sender: TObject); + procedure ExplorerLoadDataClick(Sender: TObject); + procedure ExplorerCreateNewFolderClick(Sender: TObject); + procedure ExplorerDeleteItemClick(Sender: TObject); + procedure ExplorerRenameItemClick(Sender: TObject); + procedure bbViewExplorerClick(Sender: TObject); + procedure pmExplorerPopup(Sender: TObject); + procedure bbFileCloseClick(Sender: TObject); + procedure bbFormatTitleClick(Sender: TObject); + procedure bbThumbnailsSizeClick(Sender: TObject); + procedure bbViewThumbnailsClick(Sender: TObject); + procedure bbExplorerPropertiesClick(Sender: TObject); + procedure bbFileRebuildClick(Sender: TObject); + private + FExplorerContextCommands: TList; + function GetExplorerContextCommand(Index: Integer): TCustomdxPSExplorerContextCommand; + function GetExplorerContextCommandCount: Integer; + + function CalcWindowPos(Sender: TObject): TPoint; + procedure DoShowExplorerPopup(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure EnableItemsWhileBuilding(Value: Boolean); + procedure PostCreateFolderMessage; + procedure SetBarItemVisibility(Item: TdxBarItem; Value: Boolean); + + function ShortcutBar: TdxBar; + procedure ShowShortCutBar(Value: Boolean); + + procedure EnabledHFItems(Value: Boolean); + function HFBar: TdxBar; + procedure ShowHFBar(Value: Boolean); + procedure UpdateHFState(Value: Boolean); + + procedure LoadBarManagerFromRegistry(const APath: string); + procedure SaveBarManagerToRegistry(const APath: string); + protected + procedure Activate; override; + procedure WndProc(var Message: TMessage); override; + + procedure AddExplorerContextCommand(ACommand: TCustomdxPSExplorerContextCommand); override; + procedure ExplorerContextCommandClick(Sender: TObject); virtual; + procedure UpdateExplorerContextCommands; override; + + procedure DoAfterPrintReport(AShowDialog: Boolean); override; + procedure DoPreviewDblClick(APreview: TdxPreview); override; + procedure DoPreviewZoomFactorChanged(APreview: TdxPreview); override; + procedure DoPreviewZoomModeChanged(APreview: TdxPreview); override; + procedure DoShowHFToolBar(Value: Boolean); override; + function GetPreviewCanShowMarginHint(APreview: TdxPreview): Boolean; override; + procedure HFTextEntriesChanged; override; + procedure LoadStrings; override; + procedure StyleListChanged(Sender: TObject); override; + + property ExplorerContextCommandCount: Integer read GetExplorerContextCommandCount; + property ExplorerContextCommands[Index: Integer]: TCustomdxPSExplorerContextCommand read GetExplorerContextCommand; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure AfterConstruction; override; + + procedure InitContent; override; + procedure LoadFromRegistry(const APath: string); override; + procedure SaveToRegistry(const APath: string); override; + procedure UpdateControls; override; + end; + +implementation + +{$R *.DFM} + +uses +{$IFDEF EXPRESSBARS5} + cxLookAndFeels, dxThemeManager, +{$ENDIF} + Registry, CommCtrl, Math, dxPSRes, dxPrnPg, dxPSGlbl, dxPSPopupMan, + dxPSUtl, dxPSPgsMnuBld, dxPSEngn, dxPgsDlg, dxPSEvnt, dxPSAutoHFTextMnuBld, + dxPSfmAutoHFTextFmt, dxPrnDev; + +const + WM_CREATEFOLDER = WM_DX + 50; + PageSelectorImageIndex = 35; + + sdxToolBars = '\ToolBars'; // Don't Localize + +type + TWinControlAccess = class(TWinControl); + + TdxBarPSPopupMenuBuilder = class(TAbstractdxPSPopupMenuBuilder) + private + FBarHostForm: TCustomForm; + FBarManager: TdxBarManager; + protected + function BuildPopup(const AControl: TControl; + const APopupMenu: TPopupMenu): TComponent; override; + class function CanShowPopup(const APopupMenu: TPopupMenu): Boolean; override; + procedure FreePopup(var APopupMenu: TComponent); override; + procedure InvokePopup(const X, Y: Integer; const AControl: TControl; + const APopupMenu: TComponent); override; + class function RequireProcessDoPopup: Boolean; override; + public + constructor Create; override; + destructor Destroy; override; + end; + + TdxBarPSPageSetupMenuBuilder = class(TAbstractdxPSPageSetupMenuBuilder) + public + procedure BuildPageSetupMenu(ARootItem: TObject; AData: Pointer; + AIncludeDefineItem: Boolean; AStyles: TStringList; ACurrentStyle: TBasedxPrintStyle; + AOnStyleClick, AOnDefineStylesClick: TNotifyEvent); override; + class function ExtractPrintStyleFromObj(Obj: TObject): TBasedxPrintStyle; override; + end; + + TdxBarPSAutoHFTextMenuBuilder = class(TAbstractdxPSAutoHFTextMenuBuilder) + public + procedure BuildAutoHFTextEntriesMenu(ARootItem: TObject; AData: Pointer; + AIncludeSetupAutoHFTextEntriesItem: Boolean; AAutoHFTextEntries: TStrings; + AOnHFTextEntriesClick, AOnSetupHFTextEntriesClick: TNotifyEvent); override; + class function ExtractAutoHFTextEntryIndexFromObj(Obj: TObject): Integer; override; + end; + +function VisibleToBarItemVisible(AValue: Boolean): TdxBarItemVisible; +{ivNever, ivInCustomizing, ivAlways} +begin + Result := TdxBarItemVisible(2 * Byte(AValue)); +end; + +function dxBar_DoesNotHaveActivePopup: Boolean; +begin + Result := dxBar.ActiveBarControl = nil; +end; + +procedure SetupBarManagerStyle(ABarManager: TdxBarManager); +const +{$IFDEF EXPRESSBARS5} + BarManagerStyleMap: array[dxPSGlbl.TdxPSLookAndFeel] of dxBar.TdxBarManagerStyle = + (dxBar.bmsEnhanced, dxBar.bmsFlat, dxBar.bmsXP, dxBar.bmsOffice11); +{$ELSE} + BarManagerStyleMap: array[dxPSGlbl.TdxPSLookAndFeel] of dxBar.TdxBarManagerStyle = + (dxBar.bmsEnhanced, dxBar.bmsFlat, dxBar.bmsFlat, dxBar.bmsFlat); +{$ENDIF} +begin + with dxPSEngine do + {$IFDEF EXPRESSBARS5} + if UseNativeLookAndFeel and dxThemeManager.AreVisualStylesAvailable then + begin + ABarManager.Style := dxBar.bmsUseLookAndFeel; + ABarManager.LookAndFeel.NativeStyle := True; + end + else + ABarManager.Style := BarManagerStyleMap[LookAndFeel]; + {$ElSE} + ABarManager.Style := BarManagerStyleMap[LookAndFeel]; + {$ENDIF} +end; + +{ TdxBarPSPopupMenuBuilder } + +constructor TdxBarPSPopupMenuBuilder.Create; +begin + inherited; + FBarHostForm := TCustomForm.CreateNew(nil); + FBarManager := TdxBarManager.Create(FBarHostForm); + SetupBarManagerStyle(FBarManager); +end; + +destructor TdxBarPSPopupMenuBuilder.Destroy; +begin + FBarHostForm.Free; + inherited; +end; + +class function TdxBarPSPopupMenuBuilder.CanShowPopup(const APopupMenu: TPopupMenu): Boolean; +begin + Result := inherited CanShowPopup(APopupMenu) and dxBar_DoesNotHaveActivePopup; +end; + +function TdxBarPSPopupMenuBuilder.BuildPopup(const AControl: TControl; + const APopupMenu: TPopupMenu): TComponent; + + function IsSeparator(ABarItem: TdxBarItem): Boolean; + begin + Result := ABarItem.Caption = '-'; + end; + + function CreateItem(AMenuItem: TMenuItem): TdxBarItem; + const + BarItemClasses: array[Boolean] of TdxBarItemClass = (TdxBarButton, TdxBarSubItem); + var + BarItemClass: TdxBarItemClass; + begin + Result := nil; + BarItemClass := BarItemClasses[AMenuItem.Count > 0]; + if BarItemClass = nil then Exit; + + Result := BarItemClass.Create(FBarHostForm); + + Result.Action := AMenuItem.Action; + Result.ImageIndex := AMenuItem.ImageIndex; + Result.Glyph := AMenuItem.Bitmap; + Result.Caption := AMenuItem.Caption; + Result.Enabled := AMenuItem.Enabled; + Result.HelpContext := AMenuItem.HelpContext; + Result.Hint := AMenuItem.Hint; + Result.ShortCut := AMenuItem.ShortCut; + Result.Tag := AMenuItem.Tag; + Result.Visible := VisibleToBarItemVisible(AMenuItem.Visible); + if not (Result is TdxBarSubItem) then + Result.OnClick := AMenuItem.OnClick; + if Result is TdxBarButton then + begin + if AMenuItem.Checked or AMenuItem.RadioItem then + TdxBarButton(Result).ButtonStyle := bsChecked; + if AMenuItem.RadioItem then + TdxBarButton(Result).GroupIndex := AMenuItem.GroupIndex; + TdxBarButton(Result).Down := AMenuItem.Checked; + end; + end; + + procedure FixBeginGroup(AItemLinks: TdxBarItemLinks); + var + I: Integer; + ItemLink: TdxBarItemLink; + begin + for I := AItemLinks.Count - 1 downto 0 do + begin + ItemLink := AItemLinks.Items[I]; + if IsSeparator(ItemLink.Item) then + begin + ItemLink.Free; + if I < AItemLinks.Count then + AItemLinks.Items[I].BeginGroup := True; + end; + end; + end; + + procedure ProcessSubMenu(AItemLinks: TdxBarItemLinks; AMenuItem: TMenuItem); + var + I: Integer; + MI: TMenuItem; + Item: TdxBarItem; + begin + for I := 0 to AMenuItem.Count - 1 do + begin + MI := AMenuItem.Items[I]; + Item := CreateItem(MI); + if Item <> nil then + begin + AItemLinks.Add.Item := Item; + if Item is TdxBarSubItem then + ProcessSubMenu(TdxBarSubItem(Item).ItemLinks, MI); + end; + end; + FixBeginGroup(AItemLinks); + end; + +begin + Result := nil; + if (APopupMenu <> nil) and (APopupMenu.Items.Count > 0) then + begin + Result := TdxBarPopupMenu.Create(FBarHostForm); + try + FBarManager.Images := APopupMenu.Images; + ProcessSubMenu(TdxBarPopupMenu(Result).ItemLinks, APopupMenu.Items); + except + FBarManager.Images := nil; + Result.Free; + raise; + end; + end; +end; + +procedure TdxBarPSPopupMenuBuilder.FreePopup(var APopupMenu: TComponent); +var + I: Integer; +begin + for I := 0 to FBarManager.ItemCount - 1 do + FBarManager.Items[I].Free; + FreeAndNil(APopupMenu); +end; + +procedure TdxBarPSPopupMenuBuilder.InvokePopup(const X, Y: Integer; + const AControl: TControl; const APopupMenu: TComponent); +begin + if APopupMenu is TdxBarPopupMenu then + TdxBarPopupMenu(APopupMenu).Popup(X, Y); +end; + +class function TdxBarPSPopupMenuBuilder.RequireProcessDoPopup: Boolean; +begin + Result := True; +end; + +{ TdxBarPSPageSetupMenuBuilder } + +class function TdxBarPSPageSetupMenuBuilder.ExtractPrintStyleFromObj(Obj: TObject): TBasedxPrintStyle; +begin + with TdxBarListItem(Obj) do + Result := TBasedxPrintStyle(Items.Objects[ItemIndex]); +end; + +procedure TdxBarPSPageSetupMenuBuilder.BuildPageSetupMenu(ARootItem: TObject; + AData: Pointer; AIncludeDefineItem: Boolean; + AStyles: TStringList; ACurrentStyle: TBasedxPrintStyle; + AOnStyleClick, AOnDefineStylesClick: TNotifyEvent); +begin + if not (ARootItem is TdxBarListItem) then Exit; + + with TdxBarListItem(ARootItem) do + begin + Items.Clear; + Items := AStyles; + if Items.Count > 0 then ItemIndex := ACurrentStyle.Index; + OnClick := AOnStyleClick; + end; + + if AIncludeDefineItem and (TObject(AData) is TdxBarButton) then + with TdxBarButton(AData) do + begin + Caption := cxGetResourceString(@sdxDefinePrintStylesMenuItem); + OnClick := AOnDefineStylesClick; + end; +end; + +{ TdxBarPSAutoHFTextMenuBuilder } + +procedure TdxBarPSAutoHFTextMenuBuilder.BuildAutoHFTextEntriesMenu(ARootItem: TObject; + AData: Pointer; AIncludeSetupAutoHFTextEntriesItem: Boolean; + AAutoHFTextEntries: TStrings; AOnHFTextEntriesClick, AOnSetupHFTextEntriesClick: TNotifyEvent); +begin + if not (ARootItem is TdxBarListItem) then Exit; + + with TdxBarListItem(ARootItem) do + begin + Items.Clear; + Items := AAutoHFTextEntries; + OnClick := AOnHFTextEntriesClick; + end; + + if AIncludeSetupAutoHFTextEntriesItem and (TObject(AData) is TdxBarButton) then + with TdxBarButton(AData) do + begin + Caption := cxGetResourceString(@sdxMenuInsertEditAutoTextEntries); + OnClick := AOnSetupHFTextEntriesClick; + end; +end; + +class function TdxBarPSAutoHFTextMenuBuilder.ExtractAutoHFTextEntryIndexFromObj(Obj: TObject): Integer; +begin + Result := TdxBarListItem(Obj).ItemIndex; +end; + +{ utility routines } + +function AddPercentageChar(const S: string): string; +begin + Result := S; + if Result[Length(Result)] <> PercentSymbol then + Result := Result + PercentSymbol; +end; + +procedure ProcessMessages; +begin + //Application.ProcessMessages; +end; + +{ TdxfmPreviewWdxBar } + +constructor TdxfmPreviewWdxBar.Create(AOwner: TComponent); +begin + inherited; + FExplorerContextCommands := TList.Create; + SetupBarManagerStyle(dxBarManager); +end; + +destructor TdxfmPreviewWdxBar.Destroy; +begin + FreeAndNil(FExplorerContextCommands); + inherited; +end; + +procedure TdxfmPreviewWdxBar.AfterConstruction; +var + Bar: TdxBar; +begin + inherited; + cbxPredefinedZoom.DropDownCount := PredefinedZooms.Count; + seActivePage.Value := 1; + + ShowHFBar(False); + Bar := ShortCutBar; + if Bar <> nil then Bar.Hidden := True; + + dxBarManager.PopupMenuLinks[0].Control := Preview; + dxBarManager.PopupMenuLinks[1].Control := ThumbnailsPreview; +end; + +procedure TdxfmPreviewWdxBar.InitContent; + + procedure AddEndEllipsis(AnItem: TdxBarButton); + begin + with AnItem do + if AnsiLastChar(Caption) <> '.' then Caption := dxPSUtl.AddEndEllipsis(Caption); + end; + +begin + inherited; + + if ReportLink <> nil then + seActivePage.MaxValue := ReportLink.PageCount; + cbxPredefinedZoom.Text := IntToStr(ZoomFactor) + PercentSymbol; + + if IsExplorerAvailable then + TWinControlAccess(ExplorerTree.Control).OnMouseUp := DoShowExplorerPopup; + + if not IsExplorerAvailable then + begin + AddEndEllipsis(bbFileSave); + AddEndEllipsis(bbFileLoad); + end; +end; + +procedure TdxfmPreviewWdxBar.LoadFromRegistry(const APath: string); +begin + inherited; + LoadBarManagerFromRegistry(APath); +end; + +procedure TdxfmPreviewWdxBar.SaveToRegistry(const APath: string); +begin + inherited; + SaveBarManagerToRegistry(APath); +end; + +procedure TdxfmPreviewWdxBar.UpdateControls; +const + ButtonStyles: array[Boolean] of TdxBarButtonStyle = (bsDefault, bsDropDown); +var + Bar: TdxBar; + PagesExists, B: Boolean; + PageXCount, PageYCount, Index: Integer; +begin + if Locked or (csDestroying in ComponentState) then Exit; + + inherited; + + PagesExists := FPreview.PageCount > 0; + BeginUpdate; + try + EnableItemsWhileBuilding(True); + + bbFileDesign.Enabled := CanDesign; + bbFileRebuild.Enabled := CanRebuild; + bbFileSave.Enabled := CanSaveReport; + bbFileLoad.Enabled := CanLoadReport; + bbFileClose.Enabled := CanUnloadReport; + bbFilePrint.Enabled := CanPrint; + bbFilePrintDialog.Enabled := CanPrintDialog; + bbFilePageSetup.Enabled := CanPageSetup; + bbFilePageSetup.ButtonStyle := ButtonStyles[CanPrintStyle]; + bbFileExit.Enabled := not IsPrinting; + + bbExplorer.Enabled := IsExplorerAvailable; + bbExplorerCreateNewFolder.Enabled := IsExplorerAvailable and ExplorerTree.CanCreateFolder; + bbExplorerDelete.Enabled := IsExplorerAvailable and ExplorerTree.CanDeleteSelection; + bbExplorerRename.Enabled := IsExplorerAvailable and ExplorerTree.CanRenameSelectedItem; + bbExplorerProperties.Enabled := IsExplorerAvailable and ExplorerTree.CanShowPropertySheetsForSelectedItem; + + bbFormatShowHideEmptyPages.Down := (ReportLink <> nil) and ReportLink.ShowEmptyPages; + bbFormatTitle.Enabled := (ReportLink <> nil) and ReportLink.CanChangeTitle; + bbFormatPageBackground.Enabled := IsEnabled(peoPageBackground) and not IsPrinting; + bbFormatShrinkToPageWidth.Enabled := PagesExists and not IsPrinting; + if ReportLink <> nil then + begin + bbFormatShrinkToPageWidth.Down := ReportLink.ShrinkToPageWidth; + SetBarItemVisibility(bbFormatShowHideEmptyPages, ReportLink.EmptyPagesCanExist); + bbFormatShowHideEmptyPages.Down := ReportLink.ShowEmptyPages; + end; + + bbZoomPageWidth.Enabled := PagesExists; + bbZoomPercent100.Enabled := PagesExists; + bbZoomWholePage.Enabled := PagesExists; + bbZoomTwoPages.Enabled := PagesExists and (FPreview.PageCount > 1); + bbZoomFourPages.Enabled := PagesExists and (FPreview.PageCount > 3); + bbZoomMultiplePages.Enabled := PagesExists; + if ReportLink <> nil then + begin + ReportLink.GetPageColRowCount(PageXCount, PageYCount); + bbZoomWidenToSourceWidth.Enabled := PageXCount > 1; + end; + cbxPredefinedZoom.Enabled := bbZoomPageWidth.Enabled; + bbZoomSetup.Enabled := bbZoomPageWidth.Enabled; + + bbGoToFirstPage.Enabled := PagesExists and (FPreview.SelPageIndex <> 0); + bbGoToPrevPage.Enabled := PagesExists and (Preview.SelPageIndex <> 0); + bbGoToNextPage.Enabled := PagesExists and (Preview.SelPageIndex <> FPreview.PageCount - 1); + bbGoToLastPage.Enabled := PagesExists and (Preview.SelPageIndex <> FPreview.PageCount - 1); + seActivePage.Enabled := Preview.PageCount > 1; + + bbHelp.Enabled := IsEnabled(peoHelp); + bbHelpTopics.Enabled := IsEnabled(peoHelp); + //bbHelpAbout.Enabled := IsEnabled(peoHelp); + + bbViewMargins.Down := ShowPageMargins; + bbViewMarginBar.Down := ShowMarginBar; + bbViewStatusBar.Down := ShowStatusBar; + SetBarItemVisibility(bbViewExplorer, IsExplorerAvailable); + bbViewExplorer.Down := ShowExplorer; + bbViewThumbnails.Down := ShowThumbnails; + bbThumbnailsSmall.Down := ThumbnailsSize = tsSmall; + bbThumbnailsLarge.Down := ThumbnailsSize = tsLarge; + if ReportLink <> nil then + begin + bbViewPageHeaders.Down := ReportLink.ShowPageHeader; + bbViewPageFooters.Down := ReportLink.ShowPageFooter; + end; + + SetBarItemVisibility(bbFileDesign, IsVisible(pvoReportDesign)); + SetBarItemVisibility(bbFileSave, IsCommandSaveReportVisible); + SetBarItemVisibility(bbFileLoad, IsCommandLoadReportVisible); + SetBarItemVisibility(bbFileClose, IsCommandUnloadReportVisible); + SetBarItemVisibility(bbFilePrint, IsVisible(pvoPrint)); + SetBarItemVisibility(bbFilePrintDialog, IsVisible(pvoPrint)); + SetBarItemVisibility(bbFilePageSetup, IsVisible(pvoPageSetup)); + + SetBarItemVisibility(bbExplorer, IsExplorerAvailable); + SetBarItemVisibility(bbExplorerCreateNewFolder, IsExplorerAvailable); + SetBarItemVisibility(bbExplorerDelete, IsExplorerAvailable); + SetBarItemVisibility(bbExplorerRename, IsExplorerAvailable); + SetBarItemVisibility(bbExplorerProperties, IsExplorerAvailable); + SetBarItemVisibility(bsiShortcutExplorer, IsExplorerAvailable); + + B := (ReportLink <> nil) and (ReportLink.StyleManager <> nil); + SetBarItemVisibility(bsiInsertHFAutoText, B); + SetBarItemVisibility(bbInsertEditAutoText, B); + SetBarItemVisibility(bsiInsertAutoText, B); + SetBarItemVisibility(bliInsertAutoTextEntries, B); + SetBarItemVisibility(bbFormatPageBackground, IsVisible(pvoPageBackground)); + SetBarItemVisibility(bbHelp, IsVisible(pvoHelp)); + SetBarItemVisibility(bbHelpTopics, IsVisible(pvoHelp)); + //SetBarItemVisibility(bbHelpAbout, IsVisible(pvoHelp)); + + if seActivePage.Enabled then + begin + seActivePage.MinValue := 1; + if ReportLink <> nil then + begin + seActivePage.MaxValue := ReportLink.PageCount; + seActivePage.Value := ReportLink.VirtualPageIndexToRealPageIndex(FPreview.SelPageIndex) + 1; + end + end + else + seActivePage.Value := -1; + + if IsBuilding or IsPrinting then + EnableItemsWhileBuilding(False); + + if HFBar <> nil then + EnabledHFItems(HFBar.Visible); + + { Categories visibility } + + { Edit } + Index := dxBarManager.Categories.IndexOf(DropAmpersand(cxGetResourceString(@sdxMenuEdit))); + if Index <> -1 then + dxBarManager.CategoryVisible[Index] := False; + + { Help } + Index := dxBarManager.Categories.IndexOf(DropAmpersand(cxGetResourceString(@sdxMenuHelp))); + if Index <> -1 then + dxBarManager.CategoryVisible[Index] := + (bbHelpTopics.Visible = ivAlways) or (bbHelpAbout.Visible = ivAlways); + + { Shortcut Menus } + Index := dxBarManager.Categories.IndexOf(DropAmpersand(cxGetResourceString(@sdxMenuShortCutMenus))); + if Index <> -1 then + dxBarManager.CategoryVisible[Index] := False; + + { Explorer } + Index := dxBarManager.Categories.IndexOf(DropAmpersand(cxGetResourceString(@sdxMenuExplorer))); + if Index <> -1 then + dxBarManager.CategoryVisible[Index] := IsExplorerAvailable; + + { AutoText } + Bar := dxBarManager.BarByCaption(cxGetResourceString(@sdxAutoTextBar)); + if Bar <> nil then + Bar.Hidden := not IsAutoHFTextEntriesAvailable; + + { Explorer } + Bar := dxBarManager.BarByCaption(cxGetResourceString(@sdxExplorerToolBar)); + if Bar <> nil then + Bar.Hidden := not IsExplorerAvailable; + + UpdateExplorerContextCommands; + finally + CancelUpdate; + end; +end; + +procedure TdxfmPreviewWdxBar.bbViewMarginsClick(Sender: TObject); +begin + if Locked then Exit; + ShowPageMargins := TdxBarButton(Sender).Down; +end; + +procedure TdxfmPreviewWdxBar.bbViewMarginBarClick(Sender: TObject); +begin + if Locked then Exit; + ShowMarginBar := TdxBarButton(Sender).Down; +end; + +procedure TdxfmPreviewWdxBar.bbViewStatusBarClick(Sender: TObject); +begin + if Locked then Exit; + ShowStatusBar := TdxBarButton(Sender).Down; +end; + +procedure TdxfmPreviewWdxBar.bbViewExplorerClick(Sender: TObject); +begin + if Locked then Exit; + ShowExplorer := TdxBarButton(Sender).Down; +end; + +procedure TdxfmPreviewWdxBar.pmExplorerPopup(Sender: TObject); +begin + UpdateControls; +end; + +procedure TdxfmPreviewWdxBar.bbThumbnailsSizeClick(Sender: TObject); +begin + ThumbnailsSize := TdxPSThumbnailsSize(TTagToInt(TComponent(Sender).Tag)); +end; + +procedure TdxfmPreviewWdxBar.bbViewThumbnailsClick(Sender: TObject); +begin + if Locked then Exit; + ShowThumbnails := TdxBarButton(Sender).Down; +end; + +procedure TdxfmPreviewWdxBar.DesignClick(Sender: TObject); +begin + DoDesignReport; +end; + +procedure TdxfmPreviewWdxBar.bbFileRebuildClick(Sender: TObject); +begin + if CanRebuild then RebuildReport; +end; + +procedure TdxfmPreviewWdxBar.PrintClick(Sender: TObject); +const + BtnClicked: Boolean = False; +begin + if BtnClicked then Exit; + ProcessMessages; + BtnClicked := True; + try + DoPrintReport(Boolean(TTagToInt(TComponent(Sender).Tag))); + finally + BtnClicked := False; + end; +end; + +procedure TdxfmPreviewWdxBar.PageSetupClick(Sender: TObject); +const + BtnClicked: Boolean = False; +begin + if BtnClicked then Exit; + ProcessMessages; + BtnClicked := True; + try + DoPageSetupReport(0); + finally + BtnClicked := False; + end; +end; + +procedure TdxfmPreviewWdxBar.FileSaveClick(Sender: TObject); +begin + DoExplorerCreateNewItem; +end; + +procedure TdxfmPreviewWdxBar.ExplorerLoadDataClick(Sender: TObject); +begin + ProcessMessages; + DoExplorerLoadItemData; +end; + +procedure TdxfmPreviewWdxBar.bbFileCloseClick(Sender: TObject); +begin + ProcessMessages; + DoExplorerUnloadItemData; +end; + +procedure TdxfmPreviewWdxBar.ExplorerCreateNewFolderClick(Sender: TObject); +begin + ExplorerTree.FocusedItem := ExplorerTree.SelectedItem; + PostCreateFolderMessage; +end; + +procedure TdxfmPreviewWdxBar.PostCreateFolderMessage; +begin + PostMessage(Handle, WM_CREATEFOLDER, 0, 0); +end; + +procedure TdxfmPreviewWdxBar.ExplorerDeleteItemClick(Sender: TObject); +begin + ProcessMessages; + DoExplorerDeleteItem; +end; + +procedure TdxfmPreviewWdxBar.ExplorerRenameItemClick(Sender: TObject); +begin + ProcessMessages; + DoExplorerRenameItem; +end; + +procedure TdxfmPreviewWdxBar.bbExplorerPropertiesClick( + Sender: TObject); +begin + DoExplorerItemShowPropertySheets; +end; + +procedure TdxfmPreviewWdxBar.PageBackgroundClick(Sender: TObject); +begin + ProcessMessages; + DoShowPageBackgroundDlg(CalcWindowPos(Sender)); +end; + +procedure TdxfmPreviewWdxBar.bbFormatShrinkToPageWidthClick(Sender: TObject); +begin + if ReportLink <> nil then + begin + ReportLink.ShrinkToPageWidth := not ReportLink.ShrinkToPageWidth; + DoShrinkToPageWidth(ReportLink.ShrinkToPageWidth); + end; +end; + +procedure TdxfmPreviewWdxBar.bbFormatShowHideEmptyPagesClick(Sender: TObject); +begin + if Locked then Exit; + DoShowEmptyPages(TdxBarButton(Sender).Down); +end; + +procedure TdxfmPreviewWdxBar.bbZoomSetupClick(Sender: TObject); +begin + ProcessMessages; + DoShowZoomDlg; +end; + +procedure TdxfmPreviewWdxBar.cbxPredefinedZoomClick(Sender: TObject); +begin + ProcessMessages; + DoShowZoomDlg; +end; + +procedure TdxfmPreviewWdxBar.bbZoomMultiplePagesClick(Sender: TObject); +var + Link: TdxBarItemLink; + R: TRect; + YShift: Integer; +begin + Link := TdxBarItem(Sender).ClickItemLink; + if (Link <> nil) and (Link.Control <> nil) then + begin + R := Link.ItemRect; + MapWindowPoints(Link.BarControl.Handle, 0, R, 2); + YShift := R.Bottom - R.Top; + end + else + begin + GetWindowRect(Preview.Handle, R); + OffsetRect(R, 3, 0); + YShift := 3; + end; + DoShowMultiplySelectPagesDlg(ilToolBar, PageSelectorImageIndex, R.TopLeft, YShift); +end; + +procedure TdxfmPreviewWdxBar.GoToPageClick(Sender: TObject); +begin + case TTagToInt(TComponent(Sender).Tag) of + 0: GoToFirstPage; + 1: GoToPrevPage; + 2: GoToNextPage; + 3: GoToLastPage; + end; +end; + +procedure TdxfmPreviewWdxBar.CloseClick(Sender: TObject); +begin + Close; +end; + +procedure TdxfmPreviewWdxBar.HelpClick(Sender: TObject); +begin + ProcessMessages; + DoInvokeHelp; +end; + +procedure TdxfmPreviewWdxBar.Activate; +begin + inherited; + TimerHint.Enabled := True; +end; + +procedure TdxfmPreviewWdxBar.WndProc(var Message: TMessage); +begin + if Message.Msg = WM_CREATEFOLDER then + begin + ExplorerTree.SelectedItem := ExplorerTree.FocusedItem; + DoExplorerCreateNewFolder; + end + else + inherited; +end; + +procedure TdxfmPreviewWdxBar.AddExplorerContextCommand(ACommand: TCustomdxPSExplorerContextCommand); + + procedure AddBarControl(AnItemLinks: TdxBarItemLinks; ABarButton: TdxBarButton); + begin + with AnItemLinks.Add do + begin + Item := ABarButton; + Index := 0; + BringToTopInRecentList(True); + end; + end; + + procedure BeginGroup(AnItemLinks: TdxBarItemLinks); + begin + if AnItemLinks.Count <> 0 then + AnItemLinks[0].BeginGroup := True; + end; + +var + BarButton: TdxBarButton; +begin + if ACommand is TdxPSExplorerContextCommandSeparator then + begin + BeginGroup(bbExplorer.ItemLinks); + BeginGroup(dxBarManager.BarByCaption(cxGetResourceString(@sdxExplorerBar)).ItemLinks); + BeginGroup(pmExplorer.ItemLinks); + end + else + begin + BarButton := TdxBarButton.Create(Self); + with BarButton do + begin + Glyph := ACommand.Bitmap; + Caption := ACommand.Caption; + Enabled := ACommand.Enabled; + Hint := ACommand.Hint; + ShortCut := ACommand.ShortCut; + Tag := MakeTTag(ACommand); + + Category := dxBarManager.Categories.IndexOf(DropAmpersand(cxGetResourceString(@sdxMenuExplorer))); + OnClick := ExplorerContextCommandClick; + end; + + AddBarControl(bbExplorer.ItemLinks, BarButton); + AddBarControl(dxBarManager.BarByCaption(cxGetResourceString(@sdxExplorerBar)).ItemLinks, BarButton); + AddBarControl(pmExplorer.ItemLinks, BarButton); + ACommand.Data := Integer(BarButton); + + if FExplorerContextCommands.IndexOf(ACommand) = -1 then + FExplorerContextCommands.Add(ACommand); + end; +end; + +procedure TdxfmPreviewWdxBar.ExplorerContextCommandClick(Sender: TObject); +var + Command: TCustomdxPSExplorerContextCommand; + CommandSet2: IdxPSExplorerContextCommands2; +begin + Command := TCustomdxPSExplorerContextCommand(TTagToObj(TdxBarButton(Sender).Tag)); + if Supports(TObject(Explorer), IdxPSExplorerContextCommands2, CommandSet2) then + begin + CommandSet2.InitializeCommand(Command); + try + if Command.Enabled then Command.Execute; {.1} + finally + CommandSet2.FinalizeCommand(Command); + end; + end; + UpdateControls; +end; + +procedure TdxfmPreviewWdxBar.UpdateExplorerContextCommands; +var + I: Integer; +begin + if not (csDestroying in ComponentState) then + for I := 0 to ExplorerContextCommandCount - 1 do + with ExplorerContextCommands[I] do + TdxBarButton(Data).Enabled := Enabled; +end; + +procedure TdxfmPreviewWdxBar.DoAfterPrintReport(AShowDialog: Boolean); +begin + if AShowDialog then + bbFilePrint.Hint := cxGetResourceString(@sdxHintFilePrint) + GetCurrentPrinterAsHint; +end; + +procedure TdxfmPreviewWdxBar.DoPreviewDblClick(APreview: TdxPreview); +begin + ShowHFBar(False); +end; + +procedure TdxfmPreviewWdxBar.DoPreviewZoomFactorChanged(APreview: TdxPreview); +begin + cbxPredefinedZoom.Text := AddPercentageChar(IntToStr(ZoomFactor)); +end; + +procedure TdxfmPreviewWdxBar.DoPreviewZoomModeChanged(APreview: TdxPreview); +begin + cbxPredefinedZoom.Text := AddPercentageChar(IntToStr(ZoomFactor)); +end; + +function TdxfmPreviewWdxBar.GetPreviewCanShowMarginHint(APreview: TdxPreview): Boolean; +begin + Result := ActiveBarControl = nil; +end; + +procedure TdxfmPreviewWdxBar.HFTextEntriesChanged; +begin + if IsAutoHFTextEntriesAvailable then + ReportLink.StyleManager.BuildAutoHFTextEntriesMenu(bliInsertAutoTextEntries, bbInsertEditAutoText, True); +end; + +procedure TdxfmPreviewWdxBar.LoadStrings; +begin + inherited; + with dxBarManager do + begin + Bars[0].Caption := cxGetResourceString(@sdxMenuBar); + Bars[1].Caption := cxGetResourceString(@sdxStandardBar); + Bars[2].Caption := cxGetResourceString(@sdxHeaderFooterBar); + Bars[3].Caption := cxGetResourceString(@sdxShortCutMenusBar); + Bars[4].Caption := cxGetResourceString(@sdxAutoTextBar); + Bars[5].Caption := cxGetResourceString(@sdxExplorerBar); + + Categories[0] := DropAmpersand(cxGetResourceString(@sdxMenuFile)); + Categories[1] := DropAmpersand(cxGetResourceString(@sdxMenuExplorer)); + Categories[2] := DropAmpersand(cxGetResourceString(@sdxMenuEdit)); + Categories[3] := DropAmpersand(cxGetResourceString(@sdxMenuInsert)); + Categories[4] := DropAmpersand(cxGetResourceString(@sdxMenuView)); + Categories[5] := DropAmpersand(cxGetResourceString(@sdxMenuFormat)); + Categories[6] := DropAmpersand(cxGetResourceString(@sdxMenuZoom)); + Categories[7] := DropAmpersand(cxGetResourceString(@sdxMenuTools)); + Categories[8] := DropAmpersand(cxGetResourceString(@sdxMenuGotoPage)); + Categories[9] := DropAmpersand(cxGetResourceString(@sdxMenuHelp)); + Categories[10] := DropAmpersand(cxGetResourceString(@sdxMenuBuiltInMenus)); + Categories[11] := DropAmpersand(cxGetResourceString(@sdxMenuShortCutMenus)); + Categories[12] := DropAmpersand(cxGetResourceString(@sdxMenuNewMenu)); + end; + + bbFile.Caption := cxGetResourceString(@sdxMenuFile); + bbFileSave.Caption := cxGetResourceString(@sdxMenuFileSave); + bbFileLoad.Caption := cxGetResourceString(@sdxMenuFileLoad); + bbFileClose.Caption := cxGetResourceString(@sdxMenuFileClose); + bbFileDesign.Caption := cxGetResourceString(@sdxMenuFileDesign); + bbFilePrintDialog.Caption := cxGetResourceString(@sdxMenuFilePrint); + bbFilePrint.Caption := DropEndEllipsis(cxGetResourceString(@sdxMenuFilePrint)); + bbFileRebuild.Caption := cxGetResourceString(@sdxMenuFileRebuild); +// bbFilePrintSetup.Caption := cxGetResourceString(@sdxMenuFilePrintSetup); + bliPrintStyles.Caption := cxGetResourceString(@sdxMenuPrintStyles); + bbFilePageSetup.Caption := cxGetResourceString(@sdxMenuFilePageSetup); + bbFileExit.Caption := cxGetResourceString(@sdxMenuFileExit); + + bbExplorer.Caption := cxGetResourceString(@sdxMenuExplorer); + bbExplorerCreateNewFolder.Caption := cxGetResourceString(@sdxMenuExplorerCreateFolder); + bbExplorerDelete.Caption := cxGetResourceString(@sdxMenuExplorerDelete); + bbExplorerRename.Caption := cxGetResourceString(@sdxMenuExplorerRename); + bbExplorerProperties.Caption := cxGetResourceString(@sdxMenuExplorerProperties); + + bbEdit.Caption := cxGetResourceString(@sdxMenuEdit); + bbEditFind.Caption := cxGetResourceString(@sdxMenuEditFind); + bbEditFindNext.Caption := cxGetResourceString(@sdxMenuEditFindNext); + bbEditReplace.Caption := cxGetResourceString(@sdxMenuEditReplace); + + bbInsert.Caption := cxGetResourceString(@sdxMenuInsert); + bsiInsertHFAutoText.Caption := cxGetResourceString(@sdxMenuInsertAutoText); + bbInsertEditAutoText.Caption := cxGetResourceString(@sdxMenuInsertEditAutoTextEntries); + bsiInsertAutoText.Caption := cxGetResourceString(@sdxMenuInsertAutoTextEntriesSubItem); + bliInsertAutoTextEntries.Caption := cxGetResourceString(@sdxMenuInsertAutoTextEntries); + bbInsertHFPageNumber.Caption := cxGetResourceString(@sdxMenuInsertPageNumber); + bbInsertHFTotalPages.Caption := cxGetResourceString(@sdxMenuInsertTotalPages); + bbInsertHFPageOfPages.Caption := cxGetResourceString(@sdxMenuInsertPageOfPages); + bbInsertHFDateTime.Caption := cxGetResourceString(@sdxMenuInsertDateTime); + bbInsertHFDate.Caption := cxGetResourceString(@sdxMenuInsertDate); + bbInsertHFTime.Caption := cxGetResourceString(@sdxMenuInsertTime); + bbInsertHFUserName.Caption := cxGetResourceString(@sdxMenuInsertUserName); + bbInsertHFMachineName.Caption := cxGetResourceString(@sdxMenuInsertMachineName); + + bbView.Caption := cxGetResourceString(@sdxMenuView); + bbViewMargins.Caption := cxGetResourceString(@sdxMenuViewMargins); + bbViewMarginBar.Caption := cxGetResourceString(@sdxMenuViewMarginsStatusBar); + bbViewStatusBar.Caption := cxGetResourceString(@sdxMenuViewPagesStatusBar); + bbViewExplorer.Caption := cxGetResourceString(@sdxMenuViewExplorer); + bbViewThumbnails.Caption := cxGetResourceString(@sdxMenuViewThumbnails); + bbThumbnailsSmall.Caption := cxGetResourceString(@sdxMenuThumbnailsSmall); + bbThumbnailsLarge.Caption := cxGetResourceString(@sdxMenuThumbnailsLarge); + bbViewToolbars.Caption := cxGetResourceString(@sdxMenuViewToolBars); + bbViewZoom.Caption := cxGetResourceString(@sdxMenuZoom); + + bbZoomPercent100.Caption := cxGetResourceString(@sdxMenuZoomPercent100); + bbZoomPageWidth.Caption := cxGetResourceString(@sdxMenuZoomPageWidth); + bbZoomWholePage.Caption := cxGetResourceString(@sdxMenuZoomWholePage); + bbZoomTwoPages.Caption := cxGetResourceString(@sdxMenuZoomTwoPages); + bbZoomFourPages.Caption := cxGetResourceString(@sdxMenuZoomFourPages); + bbZoomMultiplePages.Caption := cxGetResourceString(@sdxMenuZoomMultiplyPages); + bbZoomWidenToSourceWidth.Caption := cxGetResourceString(@sdxMenuZoomWidenToSourceWidth); + bbZoomSetup.Caption := cxGetResourceString(@sdxMenuZoomSetup); + bbViewPages.Caption := cxGetResourceString(@sdxMenuPages); + bbViewPageHeaders.Caption := cxGetResourceString(@sdxMenuViewPagesHeaders); + bbViewPageFooters.Caption := cxGetResourceString(@sdxMenuViewPagesFooters); + bbViewSwitchToLeftPart.Caption := cxGetResourceString(@sdxMenuViewSwitchToLeftPart); + bbViewSwitchToRightPart.Caption := cxGetResourceString(@sdxMenuViewSwitchToRightPart); + bbViewSwitchToCenterPart.Caption := cxGetResourceString(@sdxMenuViewSwitchToCenterPart); + bbViewHFSwitchHeaderFooter.Caption := cxGetResourceString(@sdxMenuViewHFSwitchHeaderFooter); + bbViewHFClose.Caption := cxGetResourceString(@sdxMenuViewHFClose); + + bbFormat.Caption := cxGetResourceString(@sdxMenuFormat); + bbFormatTitle.Caption := cxGetResourceString(@sdxMenuFormatTitle); + bbFormatHeaderAndFooter.Caption := cxGetResourceString(@sdxMenuFormatHeaderAndFooter); + bbFormatDateTime.Caption := cxGetResourceString(@sdxMenuFormatDateTime); + bbFormatPageNumbering.Caption := cxGetResourceString(@sdxMenuFormatPageNumbering); + bbFormatPageBackground.Caption := cxGetResourceString(@sdxMenuFormatPageBackground); + bbFormatShrinkToPageWidth.Caption := cxGetResourceString(@sdxMenuFormatShrinkToPage); + bbFormatShowHideEmptyPages.Caption := cxGetResourceString(@sdxMenuShowEmptyPages); + bbFormatHFBackground.Caption := cxGetResourceString(@sdxMenuFormatHFBackground); + bbFormatHFClear.Caption := cxGetResourceString(@sdxMenuFormatHFClear); + + bbGotoPage.Caption := cxGetResourceString(@sdxMenuGotoPage); + bbGotoFirstPage.Caption := cxGetResourceString(@sdxMenuGotoPageFirst); + bbGotoPrevPage.Caption := cxGetResourceString(@sdxMenuGotoPagePrev); + bbGotoNextPage.Caption := cxGetResourceString(@sdxMenuGotoPageNext); + bbGotoLastPage.Caption := cxGetResourceString(@sdxMenuGotoPageLast); + + bbTools.Caption := cxGetResourceString(@sdxMenuTools); + bbToolsCustomize.Caption := cxGetResourceString(@sdxMenuToolsCustomize); + bbToolsOptions.Caption := cxGetResourceString(@sdxMenuToolsOptions); + + bbHelp.Caption := cxGetResourceString(@sdxMenuHelp); + bbHelpTopics.Caption := cxGetResourceString(@sdxMenuHelpTopics); + bbHelpAbout.Caption := cxGetResourceString(@sdxMenuHelpAbout); + + cbxPredefinedZoom.Caption := cxGetResourceString(@sdxMenuZoom) + ':'; + cbxPredefinedZoom.Items[8] := cxGetResourceString(@sdxPageWidth); + cbxPredefinedZoom.Items[9] := cxGetResourceString(@sdxWholePage); + cbxPredefinedZoom.Items[10] := cxGetResourceString(@sdxTwoPages); + cbxPredefinedZoom.Items[11] := cxGetResourceString(@sdxFourPages); + cbxPredefinedZoom.Items[12] := cxGetResourceString(@sdxWidenToSourceWidth); + seActivePage.Caption := cxGetResourceString(@sdxMenuActivePage); + + bsiShortcutPreview.Caption := cxGetResourceString(@sdxMenuShortcutPreview); + bsiShortcutExplorer.Caption := cxGetResourceString(@sdxMenuShortcutExplorer); + bsiShortcutThumbnails.Caption := cxGetResourceString(@sdxMenuShortcutThumbnails); + + bsiNewMenuNewMenu.Caption := cxGetResourceString(@sdxMenuNewMenu); + + { hints } + bbFileDesign.Hint := cxGetResourceString(@sdxHintFileDesign); + bbFileSave.Hint := cxGetResourceString(@sdxHintFileSave); + bbFileLoad.Hint := cxGetResourceString(@sdxHintFileLoad); + bbFileClose.Hint := cxGetResourceString(@sdxHintFileClose); + bbFilePrint.Hint := cxGetResourceString(@sdxHintFilePrint) + dxPSPrVw.GetCurrentPrinterAsHint; + bbFilePrintDialog.Hint := cxGetResourceString(@sdxHintFilePrintDialog); +// bbFilePrintSetup.Hint := cxGetResourceString(@sdxHintFilePrintSetup); + bbFilePageSetup.Hint := cxGetResourceString(@sdxHintFilePageSetup); + bbFileExit.Hint := cxGetResourceString(@sdxHintFileExit); + + bbExplorerCreateNewFolder.Hint := cxGetResourceString(@sdxHintExplorerCreateFolder); + bbExplorerDelete.Hint := cxGetResourceString(@sdxHintExplorerDelete); + bbExplorerRename.Hint := cxGetResourceString(@sdxHintExplorerRename); + bbExplorerProperties.Hint := cxGetResourceString(@sdxHintExplorerProperties); + + bbEditFind.Hint := cxGetResourceString(@sdxHintEditFind); + bbEditFindNext.Hint := cxGetResourceString(@sdxHintEditFindNext); + bbEditReplace.Hint := cxGetResourceString(@sdxHintEditReplace); + + bbInsertEditAutoText.Hint := cxGetResourceString(@sdxHintInsertEditAutoTextEntries); + bbInsertHFPageNumber.Hint := cxGetResourceString(@sdxHintInsertPageNumber); + bbInsertHFTotalPages.Hint := cxGetResourceString(@sdxHintInsertTotalPages); + bbInsertHFPageOfPages.Hint := cxGetResourceString(@sdxHintInsertPageOfPages); + bbInsertHFDateTime.Hint := cxGetResourceString(@sdxHintInsertDateTime); + bbInsertHFDate.Hint := cxGetResourceString(@sdxHintInsertDate); + bbInsertHFTime.Hint := cxGetResourceString(@sdxHintInsertTime); + bbInsertHFUserName.Hint := cxGetResourceString(@sdxHintInsertUserName); + bbInsertHFMachineName.Hint := cxGetResourceString(@sdxHintInsertMachineName); + + bbViewMargins.Hint := cxGetResourceString(@sdxHintViewMargins); + bbViewMarginBar.Hint := cxGetResourceString(@sdxHintViewMarginsStatusBar); + bbViewStatusBar.Hint := cxGetResourceString(@sdxHintViewPagesStatusBar); + bbViewExplorer.Hint := cxGetResourceString(@sdxHintViewExplorer); + bbViewThumbnails.Hint := cxGetResourceString(@sdxHintViewThumbnails); + bbThumbnailsSmall.Hint := cxGetResourceString(@sdxHintThumbnailsSmall); + bbThumbnailsLarge.Hint := cxGetResourceString(@sdxHintThumbnailsLarge); + cbxPredefinedZoom.Hint := cxGetResourceString(@sdxHintViewZoom); + bbZoomPercent100.Hint := cxGetResourceString(@sdxHintZoomPercent100); + bbZoomPageWidth.Hint := cxGetResourceString(@sdxHintZoomPageWidth); + bbZoomWholePage.Hint := cxGetResourceString(@sdxHintZoomWholePage); + bbZoomTwoPages.Hint := cxGetResourceString(@sdxHintZoomTwoPages); + bbZoomFourPages.Hint := cxGetResourceString(@sdxHintZoomFourPages); + bbZoomMultiplePages.Hint := cxGetResourceString(@sdxHintZoomMultiplyPages); + bbZoomWidenToSourceWidth.Hint := cxGetResourceString(@sdxHintZoomWidenToSourceWidth); + bbZoomSetup.Hint := cxGetResourceString(@sdxHintZoomSetup); + bbViewPageHeaders.Hint := cxGetResourceString(@sdxHintViewPagesHeaders); + bbViewPageFooters.Hint := cxGetResourceString(@sdxHintViewPagesFooters); + bbViewSwitchToLeftPart.Hint := cxGetResourceString(@sdxHintViewSwitchToLeftPart); + bbViewSwitchToRightPart.Hint := cxGetResourceString(@sdxHintViewSwitchToRightPart); + bbViewSwitchToCenterPart.Hint := cxGetResourceString(@sdxHintViewSwitchToCenterPart); + bbViewHFSwitchHeaderFooter.Hint := cxGetResourceString(@sdxHintViewHFSwitchHeaderFooter); + bbViewHFClose.Hint := cxGetResourceString(@sdxHintViewHFClose); + + bbFormatTitle.Hint := cxGetResourceString(@sdxHintFormatTitle); + bbFormatDateTime.Hint := cxGetResourceString(@sdxHintFormatDateTime); + bbFormatPageNumbering.Hint := cxGetResourceString(@sdxHintFormatPageNumbering); + bbFormatPageBackground.Hint := cxGetResourceString(@sdxHintFormatPageBackground); + bbFormatShrinkToPageWidth.Hint := cxGetResourceString(@sdxHintFormatShrinkToPage); + bbFormatHFBackground.Hint := cxGetResourceString(@sdxHintFormatHFBackground); + bbFormatHFClear.Hint := cxGetResourceString(@sdxHintFormatHFClear); + + bbGotoFirstPage.Hint := cxGetResourceString(@sdxHintGotoPageFirst); + bbGotoPrevPage.Hint := cxGetResourceString(@sdxHintGotoPagePrev); + bbGotoNextPage.Hint := cxGetResourceString(@sdxHintGotoPageNext); + bbGotoLastPage.Hint := cxGetResourceString(@sdxHintGotoPageLast); + seActivePage.Hint := cxGetResourceString(@sdxHintActivePage); + + bbToolsCustomize.Hint := cxGetResourceString(@sdxHintToolsCustomize); + bbToolsOptions.Hint := cxGetResourceString(@sdxHintToolsOptions); + + bbHelpTopics.Hint := cxGetResourceString(@sdxHintHelpTopics); + bbHelpAbout.Hint := cxGetResourceString(@sdxHintHelpAbout); +end; + +procedure TdxfmPreviewWdxBar.StyleListChanged(Sender: TObject); +begin + if Sender = ReportLink.StyleManager then + ReportLink.BuildPageSetupMenu(bliPrintStyles, bbDefinePrintStyles, True); +end; + +procedure TdxfmPreviewWdxBar.ZoomClick(Sender: TObject); +var + PageXCount, PageYCount: Integer; + ZoomMode: TdxPreviewZoomMode; +begin + case TTagToInt(TComponent(Sender).Tag) of + 0: ZoomMode := pzmNone; + 1: ZoomMode := pzmPageWidth; + else + ZoomMode := pzmPages; + end; + PageXCount := 1; + PageYCount := 1; + if ZoomMode = pzmPages then + case TTagToInt(TComponent(Sender).Tag) of + 3: PageXCount := 2; + 4: + begin + PageXCount := 2; + PageYCount := 2; + end; + 5: ReportLink.GetPageColRowCount(PageXCount, PageYCount); + end; + DoSetupZoomFactor(100, PageXCount, PageYCount, ZoomMode); +end; + +procedure TdxfmPreviewWdxBar.SetBarItemVisibility(Item: TdxBarItem; Value: Boolean); +begin + Item.Visible := VisibleToBarItemVisible(Value); +end; + +procedure TdxfmPreviewWdxBar.DoShowHFToolBar(Value: Boolean); +begin + ShowHFBar(Value); +end; + +procedure TdxfmPreviewWdxBar.seActivePageChange(Sender: TObject); +var + V: Integer; +begin + if Locked then Exit; + V := seActivePage.IntCurValue; + if V < seActivePage.MinValue then V := Round(seActivePage.MinValue); + if V > seActivePage.MaxValue then V := Round(seActivePage.MaxValue); + DoActivePageChanged(V - 1); +end; + +procedure TdxfmPreviewWdxBar.seActivePageButtonClick( + Sender: TdxBarSpinEdit; Button: TdxBarSpinEditButton); +begin + if Locked then Exit; + case Button of + sbUp: + GoToNextPage; + sbDown: + GoToPrevPage; + end; +end; + +procedure TdxfmPreviewWdxBar.cbxPredefinedZoomChange(Sender: TObject); +begin + SetZoomFactorByText(cbxPredefinedZoom.Text); + if cbxPredefinedZoom.DroppedDown then Windows.SetFocus(Preview.Handle); + UpdateControls; + cbxPredefinedZoom.Text := AddPercentageChar(IntToStr(ZoomFactor)); +end; + +procedure TdxfmPreviewWdxBar.dxBarManagerBarVisibleChange(Sender: TdxBarManager; + ABar: TdxBar); +begin + if ABar = HFBar then UpdateHFState(ABar.Visible); +end; + +procedure TdxfmPreviewWdxBar.miCustomizePopupClick(Sender: TObject); +begin + ShowdxBarSubMenuEditor(pmPreview.ItemLinks); +end; + +procedure TdxfmPreviewWdxBar.bbViewHFCloseClick(Sender: TObject); +begin + DoShowHFToolBar(False); +end; + +procedure TdxfmPreviewWdxBar.bbFormatHeaderAndFooterClick(Sender: TObject); +begin + DoShowHFToolBar(TdxBarButton(Sender).Down); +end; + +procedure TdxfmPreviewWdxBar.InsertHFClick(Sender: TObject); +begin + DoInsertHF(HFFunctionList[TTagToInt(TComponent(Sender).Tag)]); +end; + +procedure TdxfmPreviewWdxBar.bbFormatHFClearClick(Sender: TObject); +begin + DoClearHF; +end; + +procedure TdxfmPreviewWdxBar.bbViewHFSwitchHeaderFooterClick(Sender: TObject); +begin + if TdxBarButton(Sender).Down then + State := prsEditFooters + else + State := prsEditHeaders; +end; + +procedure TdxfmPreviewWdxBar.bbFormatDateTimeClick(Sender: TObject); +begin + ProcessMessages; + DoShowFormatDateTimeDlg; +end; + +procedure TdxfmPreviewWdxBar.bbFormatTitleClick(Sender: TObject); +begin + ProcessMessages; + DoFormatTitle; +end; + +procedure TdxfmPreviewWdxBar.bbFormatPageNumbersClick(Sender: TObject); +begin + ProcessMessages; + DoShowFormatPageNumbersDlg; +end; + +procedure TdxfmPreviewWdxBar.SwitchPartClick(Sender: TObject); +begin + HFEditPart := TdxPageTitlePart(TTagToInt(TdxBarButton(Sender).Tag)); +end; + +procedure TdxfmPreviewWdxBar.bbFormatHFBackgroundClick(Sender: TObject); +begin + ProcessMessages; + DoShowHFBackgroundDlg(CalcWindowPos(Sender)); +end; + +procedure TdxfmPreviewWdxBar.bbViewPageHeadersClick(Sender: TObject); +begin + if Locked then Exit; + DoShowPageHeaders(TdxBarButton(Sender).Down); +end; + +procedure TdxfmPreviewWdxBar.bbViewPageFootersClick(Sender: TObject); +begin + if Locked then Exit; + DoShowPageFooters(TdxBarButton(Sender).Down); +end; + +procedure TdxfmPreviewWdxBar.bbToolsCustomizeClick(Sender: TObject); +begin + dxBarManager.Customizing(True); +end; + +procedure TdxfmPreviewWdxBar.bbToolsOptionsClick(Sender: TObject); +begin + DoShowOptionsDlg; +end; + +procedure TdxfmPreviewWdxBar.dxBarManagerShowCustomizingForm(Sender: TObject); +begin + ShowShortCutBar(True); +end; + +procedure TdxfmPreviewWdxBar.dxBarManagerHideCustomizingForm(Sender: TObject); +begin + ShowShortCutBar(False); +end; + +function TdxfmPreviewWdxBar.GetExplorerContextCommand(Index: Integer): TCustomdxPSExplorerContextCommand; +begin + Result := TCustomdxPSExplorerContextCommand(FExplorerContextCommands.Items[Index]); +end; + +function TdxfmPreviewWdxBar.GetExplorerContextCommandCount: Integer; +begin + Result := FExplorerContextCommands.Count; +end; + +function TdxfmPreviewWdxBar.CalcWindowPos(Sender: TObject): TPoint; +var + Link: TdxBarItemLink; + R: TRect; +begin + Link := TdxBarItem(Sender).ClickItemLink; + if (Link <> nil) and (Link.Control <> nil) then + begin + R := Link.ItemRect; + MapWindowPoints(Link.BarControl.Handle, 0, R, 2); + Result.X := R.Left; + Result.Y := R.Bottom; + end + else + Result := Preview.ClientOrigin; +end; + +procedure TdxfmPreviewWdxBar.EnableItemsWhileBuilding(Value: Boolean); +var + Items: TList; + I, J: Integer; +begin + Items := TList.Create; + try + for I := 0 to dxBarManager.Categories.Count - 1 do + begin + dxBarManager.GetItemsByCategory(I, Items); + for J := 0 to Items.Count - 1 do + TdxBarItem(Items[J]).Enabled := Value; + end; + finally + Items.Free; + end; + bbFileExit.Enabled := True; +end; + +procedure TdxfmPreviewWdxBar.DoShowExplorerPopup(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + if Button = mbRight then + pmExplorer.PopupFromCursorPos; +end; + +function TdxfmPreviewWdxBar.ShortcutBar: TdxBar; +begin + Result := dxBarManager.BarByCaption(DropAmpersand(cxGetResourceString(@sdxShortCutMenusBar))); +end; + +procedure TdxfmPreviewWdxBar.ShowShortCutBar(Value: Boolean); +var + Bar: TdxBar; +begin + Bar := ShortcutBar; + if Bar <> nil then + begin + Bar.Hidden := not Value; + Bar.Visible := False; + if Value then + begin + bsiShortcutPreview.ItemLinks := pmPreview.ItemLinks; + bsiShortcutExplorer.ItemLinks := pmExplorer.ItemLinks; + bsiShortcutThumbnails.ItemLinks := pmThumbnails.ItemLinks; + end + else + begin + pmPreview.ItemLinks := bsiShortcutPreview.ItemLinks; + pmExplorer.ItemLinks := bsiShortcutExplorer.ItemLinks; + pmThumbnails.ItemLinks := bsiShortcutThumbnails.ItemLinks; + end; + end; +end; + +procedure TdxfmPreviewWdxBar.EnabledHFItems(Value: Boolean); +begin + bbInsertHFPageNumber.Enabled := Value; + bbInsertHFTotalPages.Enabled := Value; + bbInsertHFPageOfPages.Enabled := Value; + bbInsertHFDate.Enabled := Value; + bbInsertHFTime.Enabled := Value; + bbInsertHFDateTime.Enabled := Value; + bbViewHFSwitchHeaderFooter.Enabled := Value; + bbInsertHFUserName.Enabled := Value; + bbInsertHFMachineName.Enabled := Value; + bbViewHFClose.Enabled := Value; + bbViewSwitchToLeftPart.Enabled := Value; + bbViewSwitchToCenterPart.Enabled := Value; + bbViewSwitchToRightPart.Enabled := Value; + bbFormatHFClear.Enabled := Value; + + bliInsertAutoTextEntries.Enabled := Value; + bbFormatHFBackground.Enabled := Value; +end; + +function TdxfmPreviewWdxBar.HFBar: TdxBar; +begin + Result := dxBarManager.BarByCaption(DropAmpersand(cxGetResourceString(@sdxHeaderFooterBar))); +end; + +procedure TdxfmPreviewWdxBar.ShowHFBar(Value: Boolean); +var + Bar: TdxBar; +begin + Bar := HFBar; + if Bar <> nil then Bar.Visible := Value; +end; + +procedure TdxfmPreviewWdxBar.UpdateHFState(Value: Boolean); +begin + EnabledHFItems(Value); + if Preview <> nil then + if Value then + Preview.OptionsZoom := Preview.OptionsZoom - [pozZoomOnClick] + else + Preview.OptionsZoom := Preview.OptionsZoom + [pozZoomOnClick]; + bbFormatHeaderAndFooter.Down := Value; + + if Value then + if bbViewHFSwitchHeaderFooter.Down then + State := prsEditFooters + else + State := prsEditHeaders + else + State := prsNone; +end; + +procedure TdxfmPreviewWdxBar.LoadBarManagerFromRegistry(const APath: string); +var + IsSameVersion: Boolean; +begin + with TRegistry.Create do + try + IsSameVersion := OpenKey(APath + '\Version', False); + if IsSameVersion then + try + IsSameVersion := ValueExists('Major') and ValueExists('Minor'); + if IsSameVersion then + IsSameVersion := (ReadInteger('Major') = dxPSVerMajor) and + (ReadInteger('Minor') = dxPSVerMinor); + except + on ERegistryException do + IsSameVersion := False + else + raise; + end; + finally + Free; + end; + + if IsSameVersion then + begin + dxBarManager.LoadFromRegistry(APath + sdxToolBars); + pmPreview.ItemLinks := bsiShortcutPreview.ItemLinks; + pmExplorer.ItemLinks := bsiShortcutExplorer.ItemLinks; + pmThumbnails.ItemLinks := bsiShortcutThumbnails.ItemLinks; + end + else + begin + bsiShortcutPreview.ItemLinks := pmPreview.ItemLinks; + bsiShortcutExplorer.ItemLinks := pmExplorer.ItemLinks; + bsiShortcutThumbnails.ItemLinks := pmThumbnails.ItemLinks; + end; +end; + +procedure TdxfmPreviewWdxBar.SaveBarManagerToRegistry(const APath: string); +begin + with TRegistry.Create do + try + if OpenKey(APath + '\Version', True) then + try + WriteInteger('Major', dxPSVerMajor); + WriteInteger('Minor', dxPSVerMinor); + except + on ERegistryException do + else + raise; + end; + finally + Free; + end; + dxBarManager.SaveToRegistry(APath + sdxToolBars); +end; + +procedure TdxfmPreviewWdxBar.TimerHintTimer(Sender: TObject); +begin + bbFilePrint.Hint := cxGetResourceString(@sdxHintFilePrint) + GetCurrentPrinterAsHint; + TTimer(Sender).Enabled := False; +end; + +initialization + dxPSPopupMenuController.RegisterBuilder(TdxBarPSPopupMenuBuilder); + dxPSAutoHFTextMenuBuilderFactory.RegisterBuilder(TdxBarPSAutoHFTextMenuBuilder); + dxPSPageSetupMenuBuilderFactory.RegisterBuilder(TdxBarPSPageSetupMenuBuilder); + + dxPSRegisterPreviewWindow(TdxfmPreviewWdxBar); + + dxPSGlbl.PSCanShowHintFunc := dxBar_DoesNotHaveActivePopup; + +finalization + dxPSGlbl.PSCanShowHintFunc := nil; + + dxPSUnregisterPreviewWindow(TdxfmPreviewWdxBar); + + dxPSPageSetupMenuBuilderFactory.UnregisterBuilder(TdxBarPSPageSetupMenuBuilder); + dxPSAutoHFTextMenuBuilderFactory.UnregisterBuilder(TdxBarPSAutoHFTextMenuBuilder); + dxPSPopupMenuController.UnregisterBuilder(TdxBarPSPopupMenuBuilder); + +end. + + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSPrVwDsg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSPrVwDsg.pas new file mode 100644 index 00000000..263506da --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSPrVwDsg.pas @@ -0,0 +1,102 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSPrVwDsg; + +interface + +{$I cxVer.inc} + +uses + {$IFDEF DELPHI6} + DesignIntf, + {$ELSE} + DsgnIntf, + {$ENDIF} + dxPSDsgProxies, dxPSCore; + +procedure dxShowPreviewWindow(AComponentPrinter: TCustomdxComponentPrinter; + AFormDesigner: TFormDesigner); + +implementation + +type + TdxPreviewWindowDesigner = class(TAbstractdxPreviewWindowDesigner) + private + FFormDesigner: TFormDesigner; + protected + procedure Activate; override; + procedure Modified; override; + public + constructor Create(AComponentPrinter: TCustomdxComponentPrinter; AFormDesigner: TFormDesigner); + destructor Destroy; override; + end; + +procedure dxShowPreviewWindow(AComponentPrinter: TCustomdxComponentPrinter; + AFormDesigner: TFormDesigner); +begin + if AComponentPrinter.PreviewWindowDesigner = nil then + TdxPreviewWindowDesigner.Create(AComponentPrinter, AFormDesigner); + TdxPreviewWindowDesigner(AComponentPrinter.PreviewWindowDesigner).Activate; +end; + +{ TdxPreviewWindowDesigner } + +constructor TdxPreviewWindowDesigner.Create(AComponentPrinter: TCustomdxComponentPrinter; + AFormDesigner: TFormDesigner); +begin + inherited Create(AComponentPrinter); + FFormDesigner := AFormDesigner; +end; + +destructor TdxPreviewWindowDesigner.Destroy; +begin + FFormDesigner := nil; + inherited; +end; + +procedure TdxPreviewWindowDesigner.Activate; +begin + ComponentPrinter.Preview(True, nil); + Modified; +end; + +procedure TdxPreviewWindowDesigner.Modified; +begin + if FFormDesigner <> nil then FFormDesigner.Modified; +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSPrVwOpt.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSPrVwOpt.dfm new file mode 100644 index 00000000..75b2675f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSPrVwOpt.dfm @@ -0,0 +1,181 @@ +object dxfmOptions: TdxfmOptions + Left = 310 + Top = 187 + ActiveControl = chbxShowMargins + BorderStyle = bsDialog + Caption = 'Preferences' + ClientHeight = 247 + ClientWidth = 536 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 5 + Top = 4 + Width = 526 + Height = 207 + ActivePage = tshGeneral + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + TabStop = False + object tshGeneral: TTabSheet + Caption = 'General' + object gbxShow: TGroupBox + Left = 6 + Top = 4 + Width = 250 + Height = 104 + Caption = ' &Show ' + TabOrder = 0 + object chbxShowMargins: TCheckBox + Left = 10 + Top = 22 + Width = 230 + Height = 17 + Caption = '&Margins' + TabOrder = 0 + OnClick = FormChanged + end + object chbxShowMarginsHints: TCheckBox + Left = 10 + Top = 49 + Width = 230 + Height = 17 + Caption = 'Margins &hints' + TabOrder = 1 + OnClick = FormChanged + end + object chbxShowMarginsHintsWhileDragging: TCheckBox + Left = 10 + Top = 75 + Width = 230 + Height = 17 + Caption = 'Margins hints while &dragging' + TabOrder = 2 + OnClick = FormChanged + end + end + object gbxMeasurementUnits: TGroupBox + Left = 6 + Top = 109 + Width = 250 + Height = 61 + TabOrder = 2 + object lblMeasurementUnits: TLabel + Left = 8 + Top = 12 + Width = 95 + Height = 13 + Caption = '&Measurement units:' + FocusControl = cbxMeasurementUnits + OnClick = lblMeasurementUnitsClick + end + object cbxMeasurementUnits: TComboBox + Left = 8 + Top = 28 + Width = 232 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + OnChange = FormChanged + Items.Strings = ( + 'Default' + 'Inches' + 'Millimeters') + end + end + object gbxMarginsColor: TGroupBox + Left = 261 + Top = 109 + Width = 250 + Height = 61 + TabOrder = 3 + object lblMarginsColor: TLabel + Left = 8 + Top = 12 + Width = 67 + Height = 13 + Caption = '&Margins color:' + OnClick = lblMarginsColorClick + end + object bvlMarginColorHolder: TBevel + Left = 8 + Top = 28 + Width = 231 + Height = 21 + Visible = False + end + end + object gbxZoomOpt: TGroupBox + Left = 261 + Top = 4 + Width = 250 + Height = 104 + TabOrder = 1 + object lblZoomStep: TLabel + Left = 10 + Top = 54 + Width = 58 + Height = 13 + Caption = 'Zoom &Step :' + OnClick = lblZoomStepClick + end + object bvlZoomStepHolder: TBevel + Left = 103 + Top = 50 + Width = 67 + Height = 21 + Visible = False + end + object chbxZoomOnRoll: TCheckBox + Left = 10 + Top = 22 + Width = 230 + Height = 17 + Caption = '&Zoom on roll with IntelliMouse' + TabOrder = 0 + OnClick = FormChanged + end + end + end + end + object btnOk: TButton + Left = 294 + Top = 218 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 375 + Top = 218 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object btnHelp: TButton + Left = 456 + Top = 218 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Caption = '&Help' + TabOrder = 3 + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSPrVwOpt.pas b/official/x.35/ExpressPrinting System/Sources/dxPSPrVwOpt.pas new file mode 100644 index 00000000..205f71ab --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSPrVwOpt.pas @@ -0,0 +1,273 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSPrVwOpt; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls, ComCtrls, dxPreVw, dxPSForm, dxPrnPg; + +type + PdxPreviewOptionsDlgData = ^TdxPreviewOptionsDlgData; + TdxPreviewOptionsDlgData = record + MarginColor: TColor; + MeasurementUnits: TdxMeasurementUnits; + ShowMarginsHintWhileDragging: Boolean; + ShowMarginHints: Boolean; + ShowMargins: Boolean; + ZoomOnMouseRoll: Boolean; + ZoomStep: Integer; + end; + + TdxfmOptions = class(TCustomdxPSForm) + PageControl1: TPageControl; + tshGeneral: TTabSheet; + gbxShow: TGroupBox; + gbxMeasurementUnits: TGroupBox; + lblMeasurementUnits: TLabel; + cbxMeasurementUnits: TComboBox; + chbxShowMargins: TCheckBox; + chbxShowMarginsHints: TCheckBox; + chbxShowMarginsHintsWhileDragging: TCheckBox; + gbxMarginsColor: TGroupBox; + lblMarginsColor: TLabel; + btnOk: TButton; + btnCancel: TButton; + btnHelp: TButton; + bvlMarginColorHolder: TBevel; + gbxZoomOpt: TGroupBox; + chbxZoomOnRoll: TCheckBox; + lblZoomStep: TLabel; + bvlZoomStepHolder: TBevel; + procedure FormChanged(Sender: TObject); + procedure lblMeasurementUnitsClick(Sender: TObject); + procedure lblMarginsColorClick(Sender: TObject); + procedure lblZoomStepClick(Sender: TObject); + private + FControlsUpdating: Boolean; + FData: TdxPreviewOptionsDlgData; + FModified: Boolean; + FccbxColor: TCustomComboBox; + FseZoomStep: TCustomEdit; + procedure CheckModified; + procedure CreateControls; + procedure LoadStrings; + procedure StartSettings; + procedure UpdateControlsState; + public + constructor Create(AOwner: TComponent); override; + function Execute: Boolean; + end; + +function dxShowPSPreviewOptionsDlg(var AData: TdxPreviewOptionsDlgData): Boolean; + +implementation + +{$R *.DFM} + +uses + cxClasses, dxExtCtrls, dxPSGlbl, dxPSRes, dxPSUtl; + +function dxShowPSPreviewOptionsDlg(var AData: TdxPreviewOptionsDlgData): Boolean; +var + Dialog: TdxfmOptions; +begin + Dialog := TdxfmOptions.Create(nil); + try + Dialog.FData := AData; + Result := Dialog.Execute; + if Result then + AData := Dialog.FData; + finally + Dialog.Free; + end; +end; + +{ TdxfmOptions } + +constructor TdxfmOptions.Create(AOwner: TComponent); +begin + inherited; + HelpContext := dxPSGlbl.dxhcPreviewPreferencesDlg; + CreateControls; + LoadStrings; +end; + +procedure TdxfmOptions.LoadStrings; +begin + Caption := cxGetResourceString(@sdxPreferenceDlgCaption); + gbxShow.Caption := cxGetResourceString(@sdxPreferenceDlgShow); + tshGeneral.Caption := dxPSUtl.DropAmpersand(cxGetResourceString(@sdxPreferenceDlgTab1)); + lblMeasurementUnits.Caption := cxGetResourceString(@sdxPreferenceDlgMeasurementUnits); + with cbxMeasurementUnits.Items do + begin + BeginUpdate; + try + Clear; + Add(cxGetResourceString(@sdxUnitsDefaultName)); + Add(cxGetResourceString(@sdxUnitsInchesName)); + Add(cxGetResourceString(@sdxUnitsMillimetersName)); + finally + EndUpdate; + end; + end; + chbxShowMargins.Caption := cxGetResourceString(@sdxPreferenceDlgMargins); + chbxShowMarginsHints.Caption := cxGetResourceString(@sdxPreferenceDlgMarginsHints); + chbxShowMarginsHintsWhileDragging.Caption := cxGetResourceString(@sdxPreferenceDlgMargingWhileDragging); + lblMarginsColor.Caption := cxGetResourceString(@sdxPreferenceDlgMarginsColor); + + gbxZoomOpt.Caption := cxGetResourceString(@sdxZoomParameters); + chbxZoomOnRoll.Caption := cxGetResourceString(@sdxPreferenceDlgZoomScroll); + lblZoomStep.Caption := cxGetResourceString(@sdxPreferenceDlgZoomStep); + + btnOK.Caption := cxGetResourceString(@sdxBtnOK); + btnCancel.Caption := cxGetResourceString(@sdxBtnCancel); + btnHelp.Caption := cxGetResourceString(@sdxBtnHelp); +end; + +procedure TdxfmOptions.CheckModified; +begin + FModified := True; + UpdateControlsState; +end; + +procedure TdxfmOptions.UpdateControlsState; +begin +// btnOk.Enabled := FModified; + chbxZoomOnRoll.Enabled := dxPSUtl.IsIntelliMousePresent; +end; + +procedure TdxfmOptions.StartSettings; +begin + FModified := False; + FControlsUpdating := True; + try + chbxShowMargins.Checked := FData.ShowMargins; + chbxShowMarginsHints.Checked := FData.ShowMarginHints; + chbxShowMarginsHintsWhileDragging.Checked := FData.ShowMarginsHintWhileDragging; + chbxZoomOnRoll.Checked := FData.ZoomOnMouseRoll; + + cbxMeasurementUnits.ItemIndex := Integer(FData.MeasurementUnits); + TdxPSColorCombo(FccbxColor).ColorValue := FData.MarginColor; + TdxPSSpinEdit(FseZoomStep).Value := FData.ZoomStep; + + btnHelp.Visible := HelpContext <> 0; + if HelpContext = 0 then + begin + btnOK.BoundsRect := btnCancel.BoundsRect; + btnCancel.BoundsRect := btnHelp.BoundsRect; + end; + finally + FControlsUpdating := False; + end; + UpdateControlsState; +end; + +procedure TdxfmOptions.CreateControls; +begin + FccbxColor := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(FccbxColor) do + begin + Parent := gbxMarginsColor; + BoundsRect := bvlMarginColorHolder.BoundsRect; + ShowColorName := True; + ColorTypes := [ctPure]; + ShowAutoColor := True; + AutoColor := clWindowText; + ShowCustomColor := False; + OnChange := FormChanged; + end; + lblMarginsColor.FocusControl := FccbxColor; + + FseZoomStep := TdxPSSpinEdit.Create(Self); + with TdxPSSpinEdit(FseZoomStep) do + begin + Parent := gbxZoomOpt; + BoundsRect := bvlZoomStepHolder.BoundsRect; + MaxValue := 20; + MinValue := 1; + DefaultValue := Value; + LegendText := PercentSymbol; + OnChange := FormChanged; + end; + lblZoomStep.FocusControl := FseZoomStep; +end; + +function TdxfmOptions.Execute: Boolean; +begin + StartSettings; + Result := (ShowModal = mrOk) and FModified; + + if Result then + begin + FData.MeasurementUnits := TdxMeasurementUnits(cbxMeasurementUnits.ItemIndex); + FData.MarginColor := TdxPSColorCombo(FccbxColor).ColorValue; + FData.ZoomStep := TdxPSSpinEdit(FseZoomStep).AsInteger; + + FData.ShowMargins := chbxShowMargins.Checked; + FData.ShowMarginHints := chbxShowMarginsHints.Checked; + FData.ShowMarginsHintWhileDragging := chbxShowMarginsHintsWhileDragging.Checked; + FData.ZoomOnMouseRoll := chbxZoomOnRoll.Checked; + end; +end; + +procedure TdxfmOptions.FormChanged(Sender: TObject); +begin + if FControlsUpdating then Exit; + CheckModified; +end; + +procedure TdxfmOptions.lblMeasurementUnitsClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; + TComboBox(ActiveControl).DroppedDown := True; +end; + +procedure TdxfmOptions.lblMarginsColorClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; + TCustomComboBox(ActiveControl).DroppedDown := True; +end; + +procedure TdxfmOptions.lblZoomStepClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSPrVwStd.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSPrVwStd.dfm new file mode 100644 index 00000000..794bc138 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSPrVwStd.dfm @@ -0,0 +1,2330 @@ +object dxfmStdPreview: TdxfmStdPreview + Left = 260 + Top = 90 + Width = 1004 + Height = 492 + Caption = 'Preview' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Icon.Data = { + 0000010001001010100000000000280100001600000028000000100000002000 + 00000100040000000000C0000000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000 + 00000000000000000000000000000FFFFFFFFFF000000FFFFFFF000070000FFF + FFF0788707000FFFFF0788E770000FFFFF08888780000FFFFF08E88780000FFF + FF07EE8770000FFFFFF0788700000FFFFFFF000000000FFFFFFFFFF000000FFF + FFFF000000000FFFFFFF080000000FFFFFFF000000000000000000000000FFFF + 0000000C00000008000000010000000300000003000000030000000300000003 + 000000070000000F0000000F0000000F0000001F0000003F0000007F0000} + KeyPreview = True + Menu = MainMenu1 + OldCreateOrder = True + Position = poDefault + PixelsPerInch = 96 + TextHeight = 13 + object ToolBar: TToolBar + Left = 0 + Top = 0 + Width = 996 + Height = 30 + BorderWidth = 2 + ButtonHeight = 24 + ButtonWidth = 28 + EdgeBorders = [ebTop, ebBottom] + Flat = True + Images = ilToolBarSmall + Indent = 4 + ParentShowHint = False + PopupMenu = pmToolBar + ShowHint = True + TabOrder = 0 + Wrapable = False + object tbReportDesigner: TToolButton + Left = 4 + Top = 0 + Hint = 'Ctrl+D' + Caption = 'Design' + ImageIndex = 0 + OnClick = DesignClick + end + object tbFileLoad: TToolButton + Left = 32 + Top = 0 + Hint = 'Ctrl+O' + Caption = 'tbFileLoad' + ImageIndex = 23 + OnClick = FileLoadClick + end + object tbFileUnload: TToolButton + Left = 60 + Top = 0 + Caption = 'tbFileUnload' + ImageIndex = 24 + OnClick = FileCloseClick + end + object tbFileSave: TToolButton + Left = 88 + Top = 0 + Hint = 'Ctrl+S' + Caption = 'tbFileSave' + ImageIndex = 19 + OnClick = FileSaveClick + end + object tbSeparator1: TToolButton + Left = 116 + Top = 0 + Width = 8 + Caption = 'tbSeparator1' + ImageIndex = 0 + Style = tbsSeparator + end + object tbPrint: TToolButton + Left = 124 + Top = 0 + Caption = 'Print' + ImageIndex = 1 + OnClick = PrintClick + end + object tbPrintDialog: TToolButton + Tag = 1 + Left = 152 + Top = 0 + Hint = 'Ctrl+P' + Caption = 'PrintDialog' + ImageIndex = 2 + OnClick = PrintClick + end + object tbPageSetup: TToolButton + Tag = 2 + Left = 180 + Top = 0 + Caption = 'PageSetup' + DropdownMenu = pmPrintStyles + ImageIndex = 3 + Style = tbsDropDown + OnClick = PageSetupClick + end + object tbSeparator3: TToolButton + Left = 221 + Top = 0 + Width = 8 + Caption = 'tbSeparator3' + ImageIndex = 0 + Style = tbsSeparator + end + object tbViewExplorer: TToolButton + Left = 229 + Top = 0 + Caption = 'tbViewExplorer' + ImageIndex = 30 + Style = tbsCheck + OnClick = ViewExplorerClick + end + object tbViewThumbnails: TToolButton + Left = 257 + Top = 0 + Caption = 'tbViewThumbnails' + ImageIndex = 31 + Style = tbsCheck + OnClick = ViewThumbnailsClick + end + object tbSeparator2: TToolButton + Left = 285 + Top = 0 + Width = 8 + Caption = 'tbSeparator2' + ImageIndex = 0 + Style = tbsSeparator + end + object tbShrinkToPageWidth: TToolButton + Left = 293 + Top = 0 + AllowAllUp = True + Caption = 'tbShrinkToPageWidth' + Grouped = True + ImageIndex = 12 + OnClick = ShrinkToPageWidthClick + end + object tbPageBackground: TToolButton + Left = 321 + Top = 0 + Hint = 'Ctrl+K' + Caption = 'PageBackground' + ImageIndex = 4 + OnClick = PageBackgroundClick + end + object ToolButton5: TToolButton + Left = 349 + Top = 0 + Width = 8 + Caption = 'ToolButton5' + ImageIndex = 19 + Style = tbsSeparator + end + object tbPercent100: TToolButton + Left = 357 + Top = 0 + Hint = 'Ctrl+\' + Caption = '100 percent' + ImageIndex = 5 + OnClick = ZoomClick + end + object tbPageWidth: TToolButton + Tag = 1 + Left = 385 + Top = 0 + Hint = 'Ctrl+0' + Caption = 'Page Width' + ImageIndex = 6 + OnClick = ZoomClick + end + object tbOnePage: TToolButton + Tag = 2 + Left = 413 + Top = 0 + Hint = 'Ctrl+1' + Caption = 'Whole Page' + ImageIndex = 7 + OnClick = ZoomClick + end + object tbTwoPage: TToolButton + Tag = 3 + Left = 441 + Top = 0 + Hint = 'Ctrl+2' + Caption = 'Two Pages' + ImageIndex = 8 + OnClick = ZoomClick + end + object tbFourPage: TToolButton + Tag = 4 + Left = 469 + Top = 0 + Hint = 'Ctrl+4' + Caption = 'Four Pages' + ImageIndex = 9 + OnClick = ZoomClick + end + object tbMultiplePages: TToolButton + Left = 497 + Top = 0 + Caption = 'tbMultiplePages' + ImageIndex = 10 + OnClick = tbMultiplePagesClick + end + object tbWidenToSourceWidth: TToolButton + Tag = 5 + Left = 525 + Top = 0 + Hint = 'Ctrl+W' + Caption = 'Source Width' + ImageIndex = 11 + OnClick = ZoomClick + end + object tbSeparator4: TToolButton + Left = 553 + Top = 0 + Width = 8 + Caption = 'tbSeparator4' + ImageIndex = 18 + Style = tbsSeparator + end + object pnlZoomCbx: TPanel + Left = 561 + Top = 0 + Width = 138 + Height = 24 + BevelOuter = bvNone + TabOrder = 0 + OnResize = pnlZoomCbxResize + end + object tbSeparator5: TToolButton + Left = 699 + Top = 0 + Width = 8 + Caption = 'tbSeparator5' + ImageIndex = 19 + Style = tbsSeparator + end + object tbGotoFirstPage: TToolButton + Left = 707 + Top = 0 + Caption = 'First Page' + ImageIndex = 13 + OnClick = GoToPageClick + end + object tbGotoPrevPage: TToolButton + Tag = 1 + Left = 735 + Top = 0 + Caption = 'Prev Page' + ImageIndex = 14 + OnClick = GoToPageClick + end + object ToolButton2: TToolButton + Left = 763 + Top = 0 + Width = 8 + Caption = 'ToolButton2' + ImageIndex = 20 + Style = tbsSeparator + end + object pnlCurrentPage: TPanel + Left = 771 + Top = 0 + Width = 59 + Height = 24 + BevelOuter = bvNone + TabOrder = 1 + OnResize = pnlCurrentPageResize + end + object ToolButton1: TToolButton + Left = 830 + Top = 0 + Width = 8 + Caption = 'ToolButton1' + ImageIndex = 19 + Style = tbsSeparator + end + object tbGotoNextPage: TToolButton + Tag = 2 + Left = 838 + Top = 0 + Caption = 'Next Page' + ImageIndex = 15 + OnClick = GoToPageClick + end + object tbGotoLastPage: TToolButton + Tag = 3 + Left = 866 + Top = 0 + Caption = 'Last Page' + ImageIndex = 16 + OnClick = GoToPageClick + end + object tbSeparator8: TToolButton + Left = 894 + Top = 0 + Width = 8 + Caption = 'tbSeparator8' + ImageIndex = 0 + Style = tbsSeparator + end + object tbHelp: TToolButton + Left = 902 + Top = 0 + Hint = 'F1' + Caption = 'Help' + ImageIndex = 17 + OnClick = HelpClick + end + object tbClose: TToolButton + Left = 930 + Top = 0 + Caption = 'Close' + ImageIndex = 18 + OnClick = CloseClick + end + end + object pmToolBar: TPopupMenu + OnPopup = pmToolBarPopup + Left = 47 + Top = 56 + object pmiFlatBtns: TMenuItem + Caption = '&Flat Buttons' + Checked = True + GroupIndex = 2 + OnClick = pmiFlatBtnsClick + end + object pmiLargeBtns: TMenuItem + Caption = '&Large Buttons' + Checked = True + GroupIndex = 2 + OnClick = pmiLargeBtnsClick + end + end + object MainMenu1: TMainMenu + Left = 19 + Top = 56 + object miFile: TMenuItem + Caption = '&File' + object miFileDesign: TMenuItem + Caption = '&Design...' + ShortCut = 16452 + OnClick = DesignClick + end + object miFileRebuild: TMenuItem + Caption = 'Rebuild' + ShortCut = 16500 + OnClick = miFileRebuildClick + end + object miLine32: TMenuItem + Caption = '-' + end + object miFileLoad: TMenuItem + Caption = 'Load...' + ShortCut = 16463 + OnClick = FileLoadClick + end + object miFileClose: TMenuItem + Caption = 'Unload' + ShortCut = 16499 + OnClick = FileCloseClick + end + object miLine30: TMenuItem + Caption = '-' + end + object miFileSave: TMenuItem + Caption = '&Save...' + ShortCut = 16467 + OnClick = FileSaveClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miFilePrint: TMenuItem + Tag = 1 + Caption = '&Print...' + ShortCut = 16464 + OnClick = PrintClick + end + object miFilePageSetup: TMenuItem + Tag = 2 + Caption = 'Page Set&up...' + OnClick = PageSetupClick + end + object miFilePrintStyles: TMenuItem + Caption = 'Print Styles' + end + object miLine3: TMenuItem + Caption = '-' + end + object miFilePreferences: TMenuItem + Caption = 'Pre&ferences...' + OnClick = OptionsClick + end + object miLine1: TMenuItem + Caption = '-' + end + object miFileExit: TMenuItem + Caption = '&Close' + OnClick = CloseClick + end + end + object miExplorer: TMenuItem + Caption = 'E&xplorer' + object miExplorerCreateNewFolder: TMenuItem + Caption = 'New &Folder' + ShortCut = 32821 + OnClick = ExplorerCreateNewFolderClick + end + object miLine31: TMenuItem + Caption = '-' + end + object miExplorerDelete: TMenuItem + Caption = '&Delete...' + ShortCut = 46 + OnClick = ExplorerDeleteClick + end + object miExplorerRename: TMenuItem + Caption = '&Rename' + ShortCut = 113 + OnClick = ExplorerRenameClick + end + object miLine39: TMenuItem + Caption = '-' + end + object miExplorerProperties: TMenuItem + Caption = 'P&roperties...' + ShortCut = 32889 + OnClick = ExplorerPropertiesClick + end + end + object miEdit: TMenuItem + Caption = '&Edit' + Visible = False + object miEditFind: TMenuItem + Caption = '&Find ...' + ShortCut = 16454 + end + object miEditFindNext: TMenuItem + Caption = 'Find Ne&xt' + ShortCut = 114 + end + object N6: TMenuItem + Caption = '-' + end + object miEditReplace: TMenuItem + Caption = '&Replace ...' + ShortCut = 16466 + end + end + object miView: TMenuItem + Caption = '&View' + object miViewMargins: TMenuItem + Caption = '&Margins' + Checked = True + ShortCut = 16461 + OnClick = miViewMarginsClick + end + object miLine4: TMenuItem + Caption = '-' + end + object miViewFlatTBtns: TMenuItem + Caption = '&Flat toolbar buttons' + Checked = True + OnClick = pmiFlatBtnsClick + end + object miViewLargeTBtns: TMenuItem + Caption = '&Large toolbar buttons' + Checked = True + OnClick = pmiLargeBtnsClick + end + object miLine5: TMenuItem + Caption = '-' + end + object miViewToolBar: TMenuItem + Caption = '&Toolbar' + Checked = True + Visible = False + end + object miViewMarginBar: TMenuItem + Caption = '&MarginBar' + Checked = True + OnClick = miViewMarginBarClick + end + object miViewStatusBar: TMenuItem + Caption = '&StatusBar' + Checked = True + OnClick = miViewStatusBarClick + end + object miViewExplorer: TMenuItem + Caption = 'E&xplorer' + ShortCut = 16472 + OnClick = ViewExplorerClick + end + object miViewThumbnails: TMenuItem + Caption = 'Th&umbnails' + ShortCut = 16469 + OnClick = ViewThumbnailsClick + end + object N1: TMenuItem + Caption = '-' + end + object miViewZoom: TMenuItem + Caption = '&Zoom' + object miZoomPercent100: TMenuItem + Caption = '&Percent 100' + ShortCut = 16604 + OnClick = ZoomClick + end + object miLine6: TMenuItem + Caption = '-' + end + object miZoomPageWidth: TMenuItem + Tag = 1 + Caption = 'Page &Width' + ShortCut = 16432 + OnClick = ZoomClick + end + object miZoomWholePage: TMenuItem + Tag = 2 + Caption = 'W&hole Page' + ShortCut = 16433 + OnClick = ZoomClick + end + object miZoomTwoPages: TMenuItem + Tag = 3 + Caption = '&Two Pages' + ShortCut = 16434 + OnClick = ZoomClick + end + object miZoomFourPages: TMenuItem + Tag = 4 + Caption = '&Four Pages ' + ShortCut = 16436 + OnClick = ZoomClick + end + object miLine7: TMenuItem + Caption = '-' + end + object miZoomWidenToSourceWidth: TMenuItem + Tag = 5 + Caption = '&Widen to source width' + ShortCut = 16471 + OnClick = ZoomClick + end + object miLine20: TMenuItem + Caption = '-' + end + object miZoomSetup: TMenuItem + Caption = '&Setup ...' + OnClick = miZoomSetupClick + end + end + object N5: TMenuItem + Caption = '-' + end + object miViewPageHeaders: TMenuItem + Caption = 'Page &Headers' + Checked = True + OnClick = miViewPageHeadersClick + end + object miViewPageFooters: TMenuItem + Caption = '&Page Footers' + Checked = True + OnClick = miViewPageFootersClick + end + end + object miFormat: TMenuItem + Caption = '&Format' + object miFormatAutoText: TMenuItem + Caption = '&AutoText...' + OnClick = miFormatAutoTextClick + end + object miLine14: TMenuItem + Caption = '-' + end + object miFormatTitle: TMenuItem + Caption = 'Title...' + OnClick = miFormatTitleClick + end + object N7: TMenuItem + Caption = '-' + Hint = 'miLine38' + end + object miFormatDateTime: TMenuItem + Caption = 'Date And &Time ...' + OnClick = miFormatDateTimeClick + end + object miFormatPageNumbering: TMenuItem + Caption = 'Page &Numbering ...' + OnClick = miFormatPageNumberingClick + end + object N4: TMenuItem + Caption = '-' + end + object miFormatShowHideEmptyPages: TMenuItem + Caption = 'Show/Hide Empty Pages' + Checked = True + OnClick = miFormatShowHideEmptyPagesClick + end + object miFormatShrinkToPageWidth: TMenuItem + Caption = '&Shrink To Page' + Checked = True + OnClick = ShrinkToPageWidthClick + end + object miLine13: TMenuItem + Caption = '-' + end + object miFormatPageBackground: TMenuItem + Caption = 'Page bac&kground ...' + ShortCut = 16459 + OnClick = PageBackgroundClick + end + end + object miGoToPage: TMenuItem + Caption = '&Go' + object miGoToFirstPage: TMenuItem + Caption = '&First Page' + ShortCut = 36 + OnClick = GoToPageClick + end + object miGoToPrevPage: TMenuItem + Tag = 1 + Caption = '&Previous Page' + ShortCut = 33 + OnClick = GoToPageClick + end + object miLine8: TMenuItem + Caption = '-' + end + object miGoToNextPage: TMenuItem + Tag = 2 + Caption = '&Next Page' + ShortCut = 34 + OnClick = GoToPageClick + end + object miGoToLastPage: TMenuItem + Tag = 3 + Caption = '&Last Page' + ShortCut = 35 + OnClick = GoToPageClick + end + end + object miHelp: TMenuItem + Caption = '&Help' + object miHelpTopics: TMenuItem + Caption = '&Help Topics ...' + OnClick = HelpClick + end + object N3: TMenuItem + Caption = '-' + Visible = False + end + object miHelpAbout: TMenuItem + Caption = '&About ..' + Visible = False + end + end + end + object pmPreview: TPopupMenu + OnPopup = pmPreviewPopup + Left = 75 + Top = 56 + object pmiReportDesign: TMenuItem + Caption = '&Design ...' + Default = True + ShortCut = 16452 + OnClick = DesignClick + end + object miLine11: TMenuItem + Caption = '-' + end + object pmiPageSetup: TMenuItem + Caption = 'Page Set&up ...' + OnClick = PageSetupClick + end + object pmiFilePrintStyles: TMenuItem + Caption = 'Print Styles' + end + object pmiReportShrinkToPageWidth: TMenuItem + Caption = '&Shrink To Page' + Checked = True + OnClick = ShrinkToPageWidthClick + end + object miLine10: TMenuItem + Caption = '-' + end + object pmiZoom: TMenuItem + Caption = '&Zoom ' + object pmiZoomPercent100: TMenuItem + Caption = '&Percent 100' + ShortCut = 16604 + OnClick = ZoomClick + end + object miLine12: TMenuItem + Caption = '-' + end + object pmiZoomPageWidth: TMenuItem + Tag = 1 + Caption = 'Page &Width' + ShortCut = 16432 + OnClick = ZoomClick + end + object pmiZoomWholePage: TMenuItem + Tag = 2 + Caption = 'W&hole Page' + ShortCut = 16433 + OnClick = ZoomClick + end + object pmiZoomTwoPages: TMenuItem + Tag = 3 + Caption = '&Two Pages' + ShortCut = 16434 + OnClick = ZoomClick + end + object pmiZoomFourPages: TMenuItem + Tag = 4 + Caption = '&Four Pages' + ShortCut = 16436 + OnClick = ZoomClick + end + object miLine9: TMenuItem + Caption = '-' + end + object pmiZoomWidenToSourceWidth: TMenuItem + Tag = 5 + Caption = 'Widen to &source width' + ShortCut = 16471 + OnClick = ZoomClick + end + end + object N2: TMenuItem + Caption = '-' + end + object pmiGoToFirstPage: TMenuItem + Caption = 'First Page' + ShortCut = 36 + OnClick = GoToPageClick + end + object pmiGoToPrevPage: TMenuItem + Tag = 1 + Caption = 'Previous Page' + ShortCut = 33 + OnClick = GoToPageClick + end + object pmiGoToNextPage: TMenuItem + Tag = 2 + Caption = 'Next Page' + ShortCut = 34 + OnClick = GoToPageClick + end + object pmiGoToLastPage: TMenuItem + Tag = 3 + Caption = 'Last Page' + ShortCut = 35 + OnClick = GoToPageClick + end + end + object ilToolBarSmall: TImageList + AllocBy = 29 + Left = 47 + Top = 107 + Bitmap = { + 494C010120002200040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000009000000001002000000000000090 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FF000000FFFF000080000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FFFF00008000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF00FFFFFF0000000000FFFF + FF0000FFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000008080800000808000008080000080 + 8000008080000080800000808000008080000080800000808000FF000000FFFF + 0000800000000080800000808000000000000000000000000000808080000000 + 0000000000000000000080808000000000000000000000000000808080000000 + 0000000000000000000080808000000000000000000000000000000000000000 + 000000000000000000000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00000000000000000000000000FFFFFF00FFFFFF00C0C0 + C000FFFFFF00C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF00FF000000FFFF00008000 + 000000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF008000 + 0000FFFFFF0080000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000FFFF00C0C0C000000000000000000000000000C0C0C0008000000000FF + FF0000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000FFFF00000000000000 + 00000000000000000000000000000000000000000000FFFFFF00800000008000 + 000080000000800000008000000080000000FFFFFF00FFFFFF00FFFFFF000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF00C0C0C00000000000FFFF0000C0C0C000FFFF000000000000C0C0C00000FF + FF0000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF000000000080808000000000008000000080000000800000008000 + 0000800000008000000000000000FFFFFF0000FFFF00FFFFFF0000000000FFFF + FF0000FFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080000000FFFFFF0080000000FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000000000FFFF0000C0C0C000FFFF0000C0C0C000FFFF00000000000000FF + FF0000FFFF0000FFFF0000808000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 80008080800080808000808080000000000080000000FFFFFF00C0C0C000FFFF + FF00C0C0C000FFFFFF000000000000FFFF00FFFFFF0000FFFF000000000000FF + FF00FFFFFF0000FFFF00000000000000000000000000FFFFFF00FFFFFF008000 + 00008000000080000000800000008000000080000000FFFFFF00FFFFFF000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000000000C0C0C000FFFF0000C0C0C000FFFF0000C0C0C0000000000000FF + FF0000FFFF0000FFFF0000808000000000000000000000000000808080000000 + 0000000000000000000080808000000000000000000000000000808080000000 + 00000000000000000000808080000000000080000000C0C0C000FFFFFF000000 + 8000FFFFFF0000008000000080000000000000FFFF00FFFFFF0000000000FFFF + FF0000FFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080000000FFFFFF0080000000FFFFFF00FFFFFF00000000000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000000000FFFF0000C0C0C000FFFF0000C0C0C000FFFF00000000000000FF + FF0000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF0000000000808080000000000080000000FFFFFF00C0C0C0000000 + 8000C0C0C00000008000C0C0C000FFFFFF000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00C0C0C000FFFFFF00C0C0C000FFFFFF0000000000C0C0C0000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF00C0C0C00000000000FFFF0000C0C0C000FFFF000000000000C0C0C00000FF + FF0000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF0000000000808080000000000080000000C0C0C000000080000000 + 8000FFFFFF00C0C0C00000008000C0C0C0008000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000FFFFFF0000000000C0C0C00000000000C0C0 + C0000000000000000000000000008000000080808000FFFFFF0000FFFF0000FF + FF0000FFFF00C0C0C000000000000000000000000000C0C0C00000FFFF0000FF + FF0000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF0000000000808080000000000080000000FFFFFF00C0C0C0000000 + 8000C0C0C0000000800000008000FFFFFF008000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF0000000000C0C0C00000000000C0C0C00000000000C0C0C0000000 + 0000C0C0C000C0C0C000000000008000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000808000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 80008080800080808000808080000000000080000000C0C0C000FFFFFF00C0C0 + C000FFFFFF00C0C0C000FFFFFF00C0C0C0008000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000FFFFFF00FFFFFF0000000000C0C0C00000000000C0C0C00000000000C0C0 + C000C0C0C000C0C0C000C0C0C000800000008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008000000080000000800000008000 + 0000800000008000000080000000800000008000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF0000000000C0C0C00000000000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C00080000000000000008080800000FFFF000000 + 0000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000FFFF + FF00000000000000000000000000000000000000000000000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF0000000000000000FFFF000000000080000000FF00000080000000FF00 + 0000FF000000FF00000080000000FF0000008000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C00000000000800000000000000000000000808080000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008000000080000000800000008000 + 0000800000008000000080000000800000008000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000800000000000000000000000000000000000 + 0000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000FFFF + FF00808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000808080000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF008000000080000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00000000000000 + 0000FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0080000000800000008000000080000000800000008000 + 0000FFFFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00C0C0C000FFFFFF00FFFFFF00C0C0C000FFFFFF00C0C0C000FFFFFF00C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF008000000080000000FFFFFF00FFFFFF00FFFF + FF0080000000FFFFFF000000000000000000000000000000000000000000FFFF + FF00C0C0C000FFFFFF00FFFFFF00C0C0C000FFFFFF00C0C0C000FFFFFF00C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00000000000000 + 0000FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF00FFFF + FF0080000000FFFFFF000000000000000000000000000000000000000000FFFF + FF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00C0C0C000FFFFFF00FFFFFF00C0C0C000FFFFFF00C0C0C000FFFFFF00C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF0080000000FFFFFF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00000000000000 + 0000FFFFFF00FFFFFF00FFFFFF0000000000C0C0C00000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF0080000000FFFFFF00FFFFFF00FFFFFF008000000080000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000808080000000000000000000FFFFFF0000000000C0C0 + C00000000000FFFFFF0000000000C0C0C00000000000C0C0C000000000000000 + 0000000000000000000080000000800000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000808080000000000000000000000000000000000000000000FFFF + FF00FFFFFF00800000008000000080000000800000008000000080000000FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF00FFFFFF0000000000808080000000000000000000FFFFFF00FFFFFF000000 + 0000C0C0C00000000000C0C0C00000000000C0C0C00000000000C0C0C000C0C0 + C000C0C0C000000000008000000080000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 000000000000000000000000000080000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008000000080000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF000000FF000000000000000000000000000000000000000000000000000000 + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 000000000000C0C0C00000000000C0C0C00000000000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C00080000000800000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000080000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 00000000000000000000C0C0C00000000000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C00080000000800000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000080000000000000008000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C0000000000080000000800000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000080000000800000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080000000800000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000800000008000000080000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF00000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF00000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00000000000000000000000000000000000000000000000000FFFF + FF0000FFFF00FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000FFFF00000000000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000000000000000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF0000000000000000000000000000000000FFFFFF0000FFFF000000 + 0000008080000080800000808000008080000080800000808000008080000080 + 80000080800000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF00000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000FFFF00FFFFFF0000FF + FF00000000000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF008080800000FFFF00FFFFFF0000FFFF008080 + 800000FFFF0000FFFF0000FFFF00808080000000000000FFFF00FFFFFF000000 + 000000000000000000000000000000000000FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF008080800000FFFF0000FFFF008080 + 800000FFFF00FFFFFF008080800000FFFF0000000000FFFFFF0000FFFF00FFFF + FF00000000000000000000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF008080800000FFFF008080 + 8000FFFFFF008080800000FFFF00000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF0080808000808080008080800080808000FFFF + FF008080800080808000808080008080800000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF0000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000FFFF008080800000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF0000000000000000008080800000FFFF008080 + 800000FFFF008080800000FFFF0000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080800000FFFF00000000008080 + 8000FFFFFF00000000008080800000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000008080800000FFFF0000000000000000008080 + 8000808080000000000000000000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 840084848400848484008484840084848400848484000000000000FFFF000000 + 0000848484000000000000000000000000000000000000000000000000000000 + 0000000000008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF000000 + 0000000000008484840000000000000000000000000000000000000000000000 + 0000848484008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 8400848484008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFF0000000000000000000000000000FFFF + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00FFFFFF00FFFFFF008400000084000000FFFFFF00FFFFFF0000FF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400848484000000000000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFF0000FFFF00008484840000000000FFFF + 0000FFFF00000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400000000000000000000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 80000080800000808000000000000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000000000000FFFF + 0000FFFF0000FFFF000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00FFFFFF00FFFFFF008400000084848400FFFFFF00FFFFFF0000FF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400848484000000000000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 00000080800000808000000000000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF00000000 + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000FFFF00FFFFFF008484840084000000C6C6C600FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400848484000000000000FFFF0000FFFF0084848400000000000000 + 0000000000008484840084848400848484000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000808000000000000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000000000000FFFF + 0000FFFF0000FFFF000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00FFFFFF00FFFFFF0000FFFF0084848400840000008484840000FF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400848484000000000000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFF0000FFFF00008484840000000000FFFF + 0000FFFF00000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF008400000084848400FFFFFF00FFFFFF008400000084000000FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400848484000000000000FFFF0000FFFF0084848400000000000000 + 0000000000008484840084848400848484000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFF0000000000000000000000000000FFFF + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00840000008400000000FFFF00C6C6C600840000008400000000FF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 8400848484000000000000FFFF0000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00C6C6C60084000000840000008400000084000000C6C6C600FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 84000000000000FFFF0000FFFF0000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C0C0C00000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FF000000FF000000FF00 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FF000000FF000000FF00 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000FFFF0000000000000000000000000000FFFF000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFF0000000000000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C600C6C6C600C6C6C600C6C6C60000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + 0000FFFF00000000000084848400FFFF0000FFFF000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFF0000FFFF00000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C600FF000000FF000000FF00000000000000FFFFFF00FF000000FF000000FF00 + 0000FFFFFF000000000000000000000000000000000000000000FFFF0000FFFF + 0000FFFF000000000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000000000000000000000000000000000000000000000000000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 000000000000000000000000000000000000000000008484000000000000C6C6 + C600C6C6C600C6C6C600C6C6C60000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFF0000FFFF0000FFFF + 000000000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF000000000000000000000000000000000000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000000000000000000000000000000000000000000000000000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000000000000000000000000000000000008484000000000000C6C6 + C600FF000000FF000000FF000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFF0000FFFF + 0000FFFF000000000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000000000000000000000000000000000000000000000000000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 000000000000000000000000000000000000000000008484000000000000C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C6000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + 0000FFFF00000000000084848400FFFF0000FFFF000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFF0000FFFF00000000 + 000000000000000000000000000000000000000000008484000000000000C6C6 + C600FF000000FF000000FF000000C6C6C6000000000000000000000000000000 + 0000000000000000000084000000000000000000000000000000000000000000 + 0000FFFF0000000000000000000000000000FFFF000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFF0000000000000000 + 000000000000000000000000000000000000000000008484000000000000C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C6000000000000000000000000000000 + 0000000000008400000084000000840000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084840000848400008484 + 0000848400008484000000000000000000000000000000000000840000000000 + 0000000000000000000084000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008400 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 8400848400008484840084840000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 8400848400008484840084840000000000000000000084840000000000000000 + 0000000000000000000000000000848400008484840000000000000000000000 + 0000000000000000000084848400000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 84008484000084848400848400000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084840000000000000000 + 0000000000000000000000000000848400008484840000000000000000000000 + 000000000000000000008484840000000000000000008484840000000000FFFF + FF00FFFFFF00FFFFFF0000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF000000000084840000000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 00008484840084840000848484000000000000000000FFFFFF00FFFFFF000000 + 000000000000FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF0000000000FFFFFF00FFFFFF0000000000000000008484840000000000FFFF + FF00FFFFFF00FFFFFF0000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF000000000084840000000000000000000084840000000000000000 + 000000000000FFFFFF0000000000848400008484840000000000000000000000 + 0000FFFFFF000000000084848400000000000000000084848400000000000000 + 0000000000008484840000000000000000000000000084840000000000000000 + 00000000000084848400848400000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000FFFFFF000000 + 000000000000000000008484840000000000000000008484840000000000FFFF + FF00FFFFFF00FFFFFF0000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF00000000008484000000000000000000008484000000000000FFFF + FF00000000008484000000000000FFFFFF00000000008484840000000000FFFF + FF000000000084840000848484000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084848400000000000000 + 000000000000FFFFFF0000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF000000000084840000000000000000000084840000000000000000 + 0000000000000000000000000000848400008484840000000000000000000000 + 000000000000000000008484840000000000000000008484840000000000FFFF + FF00000000008484840000000000FFFFFF00000000008484000000000000FFFF + FF000000000084848400848400000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000000000000000 + 0000FFFFFF000000000084848400000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 8400848400008484840084840000000000000000000084840000000000000000 + 0000000000008484000000000000000000000000000084840000000000000000 + 00000000000084840000848484000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000000000000000008484840000000000FFFF + FF00000000000000000000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF000000000084840000000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 0000848484008484000084848400000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 84008484000084848400848400000000000000000000FFFFFF0000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF0000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000FFFFFF000000 + 0000FFFFFF000000000084848400000000000000000084848400000000000000 + 0000000000000000000000000000848484008484000000000000000000000000 + 0000000000000000000084840000000000000000000084840000000000000000 + 0000000000008484000000000000000000000000000084840000000000000000 + 0000000000008484000084848400000000008484840000000000FF000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FF0000000000000084848400000000008484840000000000FFFF + FF0000000000FFFFFF0000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF00000000008484000000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000FFFFFF00FFFF + FF00FFFFFF00000000008484840000000000000000008484840000000000FFFF + FF00000000008484840000000000FFFFFF00000000008484840000000000FFFF + FF000000000084848400848400000000000000000000FF000000FF0000000000 + 0000FFFFFF00FF000000000000000000000000000000FFFFFF00FF000000FFFF + FF0000000000FF000000FF00000000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000FFFFFF00FFFF + FF00FFFFFF000000000084848400000000000000000084848400000000000000 + 000000000000FFFFFF0000000000848484008484000000000000000000000000 + 0000FFFFFF00000000008484000000000000000000008484000000000000FFFF + FF00000000008484000000000000FFFFFF00000000008484000000000000FFFF + FF00000000008484000084848400000000008484840000000000FF000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FF00000000000000848484000000000084848400000000000000 + 0000000000000000000000000000848484008484000000000000000000000000 + 000000000000000000008484000000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000FFFFFF00FFFF + FF00FFFFFF000000000084848400000000000000000084848400000000000000 + 0000000000008484840000000000000000000000000084848400000000000000 + 00000000000084848400848400000000000000000000FFFFFF0000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF00000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 0000848484008484000084848400000000000000000084848400000000000000 + 0000000000000000000000000000848484008484000000000000000000000000 + 0000000000000000000084840000000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 00008484840084840000848484000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 0000848484008484000084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084848400FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 840084840000848484008484000000000000000000000000000084848400FFFF + FF000000000000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF0000FFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084840000848484000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000848484008484000084848400000000000000000000000000848484000000 + 00008484840000000000FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00000000000000000084848400848400000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000008484840084840000000000000000000000000000000000008484 + 8400848484008484840000000000FFFFFF00FFFFFF0000FFFF0084848400FFFF + FF00FFFFFF0000FFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084840000848484000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000008484000084848400000000000000000000000000C6C6C600C6C6 + C600C6C6C600848484008484840000000000FFFFFF00FFFFFF00840000008484 + 8400FFFFFF00FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084848400848400000000 + 0000FFFFFF00840000008400000084000000840000008400000084000000FFFF + FF000000000084848400848400000000000000000000FFFFFF00C6C6C600C6C6 + C600C6C6C600C6C6C60084848400848484000000000000FFFF00840000008400 + 0000FFFFFF0000FFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084840000848484000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0000000000848400008484840000000000C6C6C600FFFFFF00FFFFFF00C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084000000840000008400 + 0000FFFFFF00FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF0000000000FFFFFF00FFFFFF00000000000000000084848400848400000000 + 0000FFFFFF0084000000840000008400000084000000FFFFFF00FFFFFF00FFFF + FF000000000084848400848400000000000000000000C6C6C600FFFFFF00FFFF + FF00C6C6C60000000000C6C6C600C6C6C6008484840084000000840000008400 + 0000FFFFFF0000FFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF0000000000FF00 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF00000000000000FFFFFF00000000000000000084840000848484000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000008484000084848400000000000000000000000000C6C6C600FFFF + FF00000000008400000000000000C6C6C6008400000084000000840000008484 + 8400FFFFFF00FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000FF000000FF00 + 000000000000FFFFFF0000000000FF000000FF00000000000000FFFFFF000000 + 0000FF000000FF00000000000000000000000000000084848400848400000000 + 0000FFFFFF00840000008400000084000000840000008400000084000000FFFF + FF0000000000848484008484000000000000000000000000000000000000C6C6 + C600FFFFFF0084000000C6C6C60084848400840000008400000084848400FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF0000000000FF00 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF00000000000000FFFFFF00000000000000000084840000848484000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000008484000084848400000000000000000000000000840000000000 + 0000C6C6C60084000000848484000000000084848400FFFFFF00FFFFFF000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF0000000000FFFFFF00FFFFFF00000000000000000084848400848400000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000848484008484000000000000000000000000000084000000C6C6 + C60000000000840000000000000084848400FFFFFF0000FFFF00FFFFFF008484 + 8400C6C6C60000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 000084848400848400008484840000000000000000000000000084000000C6C6 + C600C6C6C600840000008484840000FFFF00FFFFFF00FFFFFF00FFFFFF008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484008400 + 0000840000008484840084848400848484008484840084848400848484008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084848400848484008484840000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400000000008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000008484840000000000000000000000000000000000C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C6000000000000000000000000000000000000000000C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C6000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484000000 + 00000000000000000000C6C6C600C6C6C600C6C6C60000000000000000000000 + 0000000000000000000084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C60000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C60000000000000000000000000000000000000000000000 + 000000000000FFFFFF008484840000000000FFFFFF0000000000000000000000 + 000000000000000000000000000000000000000000008484840000000000C6C6 + C600848484000000000000000000C6C6C600C6C6C6000000000084848400C6C6 + C6000000000000000000848484000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C60000FFFF0000FFFF0000FFFF00C6C6C600C6C6 + C6000000000000000000000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C60000FFFF0000FFFF0000FFFF00C6C6C600C6C6 + C600000000000000000000000000000000000000000084848400FFFFFF00FFFF + FF00FFFFFF00848484008484840000000000FFFFFF00FFFFFF00848484008484 + 840084848400848484000000000000000000000000000000000084848400C6C6 + C60084848400C6C6C600C6C6C6008484840000000000C6C6C600848484008484 + 84008484840084848400000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084848400C6C6C600C6C6 + C60000000000C6C6C600000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084848400C6C6C600C6C6 + C60000000000C6C6C60000000000000000000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000000000000000000000000000000000 + 0000C6C6C600C6C6C60000000000FFFFFF00FFFFFF0000000000C6C6C6000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C600C6C6C600000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C600C6C6C600000000000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000008484840000000000C6C6C6000000 + 0000C6C6C60000000000C6C6C600C6C6C600C6C6C600FFFFFF00848484000000 + 0000C6C6C600C6C6C600000000008484840000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C60000000000C6C6C6000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C60000000000C6C6C600000000000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000008484840000000000C6C6C600C6C6 + C600FFFFFF00000000008484840000000000C6C6C600FFFFFF0084848400C6C6 + C600C6C6C600C6C6C60000000000848484000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C60000000000C6C6C60000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C60000000000C6C6C60000000000000000000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000008484840000000000000000000000 + 0000FFFFFF00000000008484840084848400C6C6C60000000000C6C6C6000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000C6C6C60000000000C6C6C60000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000C6C6C60000000000C6C6C600848484000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000000000000000000000000000000000 + 0000C6C6C600FFFFFF00000000000000000000000000C6C6C600C6C6C6000000 + 0000000000008484840000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008484 + 0000FFFF0000FFFF0000FFFF0000000000000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00848484000000000000000000000000000000000084848400C6C6 + C60084848400C6C6C600FFFFFF00FFFFFF00C6C6C600C6C6C600848484008484 + 8400848484000000000084848400000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000084848400000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + 0000848400000000000000000000848484000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00848484000000000000000000000000008484840000000000C6C6 + C600848484000000000000000000C6C6C6000000000000000000C6C6C600C6C6 + C600000000008484840000000000000000000000000000000000000000000000 + 000000000000FFFFFF000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000FFFF00008484 + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000000000000000000000000000000000000000000084848400FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000848484000000 + 00008484840000000000C6C6C600C6C6C600C6C6C60000000000848484000000 + 0000848484000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000084848400000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + 0000848400000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400000000000000000000000000000000000000000084848400000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00848484008484 + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084848400848484008484840000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000900000000100010000000000800400000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFF18000FF07000F80008000 + FE03000F00008000FC01000F00008000FC01000F000080008001000F00008000 + 0001000F000080000001000F000080000003000F000080000007000F00008000 + 003F000200008000003F000000008000003F800000018000003FC00080078000 + 003FE000C0078000007FFF82E007FFFFFFFFC001E001FFFFFFFFC001C001000F + 8003C001C001000F8003C001C001000F8003C001C001000F8003C001C001000F + 8003C001C001000F8003C001C001000F8003C001C001000F8003C001C0010004 + 8003C001C0010000C1FEC001C0010000E3FEC001C001F800FFF5C003C001FC00 + FFF3C007C003FE04FFF1C00FFFFFFFFFFFFFFFFFFFFFFFFF00010001FFFFFFFF + 00010001FFF9001F00010001E7FF000F00010001C3F3000700010001C3E70003 + 00010001E1C7000100000001F08F000000000001F81F001F00010001FC3F001F + 00000001F81F001F00000003F09F8FF1808180FFC1C7FFF9C124C1FF83E3FF75 + FE66FFFF8FF1FF8FFFE7FFFFFFFFFFFFFFFFFFEFFDFFFFFFFFFFFFCFF9FFC001 + FFFFE007F1FF8031FDDFC003E1FF8031FCCF800300078031FC478003C03F8001 + 00038003C037800100018003C027800100008003C0008FF100018003C0008FF1 + 00038003C0008FF1FC478003C0278FF1FCCF8003C0378FF1FDDF8003C03F8FF1 + FFFF8003C03F8001FFFFC007FFFFFFFFFFFFFFFFFFFFFFFFFE03FFFFFFFFFFFF + FE03FFFFFFFFFFFFFE03FBBFFEFFFF7FFE03F33FFCFFFF3FC003E23FF8FFFF1F + C003C000F003C00F00038000E003C00700030000C003C00300038000E003C007 + 007FC000F003C00F007DE23FF8FFFF1F0078F33FFCFFFF3F007DFBBFFEFFFF7F + 01DDFFFFFFFFFFFF01E3FFFFFFFFFFFFFFFF8001FFFFFFFF8001000080018081 + 0000000000000080000000000000008000000000000000800000000000000100 + 0000000000000100000000000000018000000000000000800000000000000000 + 0000000000000100000000000000018000000000000000800000000000000080 + 8001000080018081FFFF8001FFFFFFFFFFFFFFFFFFFFFFFFC001800180018001 + C001000000000000C001000000000000C001000000000000C001000000000000 + 8001000000000000000100000000000000010000000000000001000000000000 + 8001000000000000C001000000000000C001000000000000C003000000000000 + C007800180018001C00FFFFFFFFFFFFFFC7FFFFFFFFFFFFFFC27C007C007FFFF + EC2380038003F83FC4010001000100018001000100010001C003000100010001 + E000000000000001000000000000000100008000800000010003C000C0000001 + E001E001E0000001C001E007800000018003F00780070101C407F00380008383 + EC3FF803F000FFFFFC7FFFFFF800FFFF00000000000000000000000000000000 + 000000000000} + end + object ilStub: TImageList + AllocBy = 2 + Left = 19 + Top = 107 + Bitmap = { + 494C010102000500040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000002000000001002000000000000020 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840084848400848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084848400000000000000000000000000000000008484 + 84000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000084848400FFFF0000FFFF00000000000000000000000000000000 + 00008484840000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 84000000000000000000FFFF0000000000000000000000000000000000000000 + 00000000000000000000848484000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFF000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 000000000000FFFFFF00000000000000000000000000FFFFFF00000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFF000000000000000000000000000000000000FFFFFF00FFFFFF000000 + 0000C6C6C600FFFFFF00C6C6C60000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFF000000000000000000000000000000000000FFFFFF00FFFFFF00C6C6 + C600000000000000000000000000C6C6C600FFFFFF00FFFFFF00000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 840000000000000000000000000000000000000000000000000000000000FFFF + 0000FFFF000000000000848484000000000000000000FFFFFF00FFFFFF00FFFF + FF00848484008484840084848400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000084848400000000000000000000000000FFFF0000FFFF0000FFFF + 00008484840000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084848400000000000000000000000000000000008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFF8000000000003FFF000000000000 + 1FFF0000000000008FFF000000000000C40F000000000000E1E7000000000000 + F0F3000000000000E5F9000000000000EBFD000000000000EFFD000000000000 + EFF5000000000000EFF5000000000000E7E1000000000000F383000000000000 + F9E7000000000000FC0F00010000000000000000000000000000000000000000 + 000000000000} + end + object pmPrintStyles: TPopupMenu + OnPopup = pmPrintStylesPopup + Left = 103 + Top = 56 + end + object pmDesigners: TPopupMenu + Left = 131 + Top = 56 + end + object Timer1: TTimer + Enabled = False + OnTimer = Timer1Timer + Left = 19 + Top = 159 + end + object pmExplorer: TPopupMenu + OnPopup = pmExplorerPopup + Left = 159 + Top = 56 + object pmiExplorerLoadData: TMenuItem + Caption = 'Load' + Default = True + ShortCut = 16397 + OnClick = FileLoadClick + end + object pmiExplorerUnloadData: TMenuItem + Caption = 'Unload' + ShortCut = 16499 + OnClick = FileCloseClick + end + object miLine33: TMenuItem + Caption = '-' + end + object pmiExplorerCreateFolder: TMenuItem + Caption = 'New Folder' + ShortCut = 32821 + OnClick = ExplorerCreateNewFolderClick + end + object miLine34: TMenuItem + Caption = '-' + end + object pmiExplorerDelete: TMenuItem + Caption = '&Delete...' + ShortCut = 46 + OnClick = ExplorerDeleteClick + end + object pmiExplorerRename: TMenuItem + Caption = '&Rename' + ShortCut = 113 + OnClick = ExplorerRenameClick + end + object miLine40: TMenuItem + Caption = '-' + end + object pmiExplorerProperties: TMenuItem + Caption = '&Properties...' + ShortCut = 32781 + OnClick = ExplorerPropertiesClick + end + end + object pmThumbnails: TPopupMenu + OnPopup = pmThumbnailsPopup + Left = 187 + Top = 56 + object pmiSmallThumbnails: TMenuItem + Caption = '&Small Thumbnails' + Checked = True + GroupIndex = 1 + RadioItem = True + OnClick = pmiThumbnailsSizeClick + end + object pmiLargeThumbnails: TMenuItem + Tag = 1 + Caption = '&Large Thumbnails' + GroupIndex = 1 + RadioItem = True + OnClick = pmiThumbnailsSizeClick + end + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSPrVwStd.pas b/official/x.35/ExpressPrinting System/Sources/dxPSPrVwStd.pas new file mode 100644 index 00000000..6a630ec4 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSPrVwStd.pas @@ -0,0 +1,2679 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSPrVwStd; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, ComCtrls, + StdCtrls, ExtCtrls, ToolWin, Menus, ImgList, dxPSCore, dxExtCtrls, dxPrevw, + dxPSPrvw; + +type + TdxfmStdPreview = class(TCustomdxPSPreviewWindow) + pmToolBar: TPopupMenu; + pmiFlatBtns: TMenuItem; + pmiLargeBtns: TMenuItem; + MainMenu1: TMainMenu; + miFilePageSetup: TMenuItem; + miFilePrint: TMenuItem; + miFilePreferences: TMenuItem; + miLine1: TMenuItem; + miFileExit: TMenuItem; + miView: TMenuItem; + miViewMargins: TMenuItem; + miLine4: TMenuItem; + miViewFlatTBtns: TMenuItem; + miViewLargeTBtns: TMenuItem; + miViewZoom: TMenuItem; + miZoomPercent100: TMenuItem; + miLine6: TMenuItem; + miZoomPageWidth: TMenuItem; + miZoomWholePage: TMenuItem; + miZoomTwoPages: TMenuItem; + miZoomFourPages: TMenuItem; + miGoToPage: TMenuItem; + miGoToFirstPage: TMenuItem; + miGoToPrevPage: TMenuItem; + miLine8: TMenuItem; + miGoToNextPage: TMenuItem; + miGoToLastPage: TMenuItem; + miFileDesign: TMenuItem; + miFile: TMenuItem; + miFormatPageBackground: TMenuItem; + miHelp: TMenuItem; + miHelpTopics: TMenuItem; + miLine5: TMenuItem; + miViewToolBar: TMenuItem; + miViewMarginBar: TMenuItem; + miViewStatusBar: TMenuItem; + miLine7: TMenuItem; + miZoomWidenToSourceWidth: TMenuItem; + pmPreview: TPopupMenu; + pmiZoomPercent100: TMenuItem; + miLine10: TMenuItem; + pmiZoomPageWidth: TMenuItem; + pmiZoomWholePage: TMenuItem; + pmiZoomTwoPages: TMenuItem; + pmiZoomFourPages: TMenuItem; + pmiZoomWidenToSourceWidth: TMenuItem; + miLine9: TMenuItem; + miLine11: TMenuItem; + pmiGoToFirstPage: TMenuItem; + pmiGoToPrevPage: TMenuItem; + pmiGoToNextPage: TMenuItem; + pmiGoToLastPage: TMenuItem; + miLine20: TMenuItem; + miZoomSetup: TMenuItem; + pmiReportShrinkToPageWidth: TMenuItem; + miFormatShrinkToPageWidth: TMenuItem; + miLine12: TMenuItem; + pmiReportDesign: TMenuItem; + pmiZoom: TMenuItem; + ilToolBarSmall: TImageList; + ilStub: TImageList; + miLine2: TMenuItem; + miLine3: TMenuItem; + miFormat: TMenuItem; + miLine13: TMenuItem; + miFormatDateTime: TMenuItem; + N4: TMenuItem; + miFormatPageNumbering: TMenuItem; + N5: TMenuItem; + miEdit: TMenuItem; + miEditFind: TMenuItem; + miEditFindNext: TMenuItem; + N6: TMenuItem; + miEditReplace: TMenuItem; + miFormatAutoText: TMenuItem; + miViewPageHeaders: TMenuItem; + miViewPageFooters: TMenuItem; + N1: TMenuItem; + pmiPageSetup: TMenuItem; + N2: TMenuItem; + miHelpAbout: TMenuItem; + N3: TMenuItem; + miFormatShowHideEmptyPages: TMenuItem; + pmPrintStyles: TPopupMenu; + miFilePrintStyles: TMenuItem; + pmiFilePrintStyles: TMenuItem; + miLine14: TMenuItem; + pmDesigners: TPopupMenu; + ToolBar: TToolBar; + tbReportDesigner: TToolButton; + tbSeparator1: TToolButton; + tbPrint: TToolButton; + tbPrintDialog: TToolButton; + tbPageSetup: TToolButton; + tbSeparator2: TToolButton; + tbPageBackground: TToolButton; + tbShrinkToPageWidth: TToolButton; + tbSeparator3: TToolButton; + tbPercent100: TToolButton; + tbPageWidth: TToolButton; + tbOnePage: TToolButton; + tbTwoPage: TToolButton; + tbFourPage: TToolButton; + tbMultiplePages: TToolButton; + tbWidenToSourceWidth: TToolButton; + tbSeparator4: TToolButton; + pnlZoomCbx: TPanel; + tbSeparator5: TToolButton; + tbGotoFirstPage: TToolButton; + tbGotoPrevPage: TToolButton; + ToolButton2: TToolButton; + pnlCurrentPage: TPanel; + ToolButton1: TToolButton; + tbGotoNextPage: TToolButton; + tbGotoLastPage: TToolButton; + tbSeparator8: TToolButton; + tbHelp: TToolButton; + tbClose: TToolButton; + Timer1: TTimer; + miViewExplorer: TMenuItem; + miExplorer: TMenuItem; + miExplorerCreateNewFolder: TMenuItem; + miLine31: TMenuItem; + miExplorerDelete: TMenuItem; + miExplorerRename: TMenuItem; + miFileSave: TMenuItem; + tbFileSave: TToolButton; + miFileLoad: TMenuItem; + miLine32: TMenuItem; + pmExplorer: TPopupMenu; + pmiExplorerLoadData: TMenuItem; + miLine33: TMenuItem; + pmiExplorerCreateFolder: TMenuItem; + miLine34: TMenuItem; + pmiExplorerDelete: TMenuItem; + pmiExplorerRename: TMenuItem; + miFileClose: TMenuItem; + pmiExplorerUnloadData: TMenuItem; + miFormatTitle: TMenuItem; + N7: TMenuItem; + tbFileLoad: TToolButton; + miLine30: TMenuItem; + miViewThumbnails: TMenuItem; + pmThumbnails: TPopupMenu; + pmiSmallThumbnails: TMenuItem; + pmiLargeThumbnails: TMenuItem; + pmiExplorerProperties: TMenuItem; + miExplorerProperties: TMenuItem; + miLine40: TMenuItem; + miLine39: TMenuItem; + tbViewExplorer: TToolButton; + tbViewThumbnails: TToolButton; + ToolButton5: TToolButton; + tbFileUnload: TToolButton; + miFileRebuild: TMenuItem; + procedure pmiFlatBtnsClick(Sender: TObject); + procedure pmiLargeBtnsClick(Sender: TObject); + procedure PageSetupClick(Sender: TObject); + procedure PrintClick(Sender: TObject); + procedure ZoomClick(Sender: TObject); + procedure GoToPageClick(Sender: TObject); + procedure CloseClick(Sender: TObject); + procedure cbxPredefinedZoomClick(Sender: TObject); + procedure cbxPredefinedZoomCloseUp(Sender: TObject; AAccept: Boolean); + procedure cbxPredefinedZoomExit(Sender: TObject); + procedure cbxPredefinedZoomKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure seActivePageExit(Sender: TObject); + procedure seKeyPress(Sender: TObject; var Key: Char); + procedure seActivePageButtonClick(Sender: TObject; + ButtonType: TdxButtonType; Button: TUDBtnType); + procedure DesignClick(Sender: TObject); + procedure PageBackgroundClick(Sender: TObject); + procedure pnlZoomCbxResize(Sender: TObject); + procedure pnlCurrentPageResize(Sender: TObject); + procedure OptionsClick(Sender: TObject); + procedure miViewMarginsClick(Sender: TObject); + procedure HelpClick(Sender: TObject); + procedure miViewMarginBarClick(Sender: TObject); + procedure miViewStatusBarClick(Sender: TObject); + procedure pmToolBarPopup(Sender: TObject); + procedure pmPreviewPopup(Sender: TObject); + procedure tbMultiplePagesClick(Sender: TObject); + procedure miZoomSetupClick(Sender: TObject); + procedure ShrinkToPageWidthClick(Sender: TObject); + procedure miFormatDateTimeClick(Sender: TObject); + procedure miFormatPageNumberingClick(Sender: TObject); + procedure miViewPageHeadersClick(Sender: TObject); + procedure miViewPageFootersClick(Sender: TObject); + procedure miFormatShowHideEmptyPagesClick(Sender: TObject); + procedure pmPrintStylesPopup(Sender: TObject); + procedure miFormatAutoTextClick(Sender: TObject); + procedure Timer1Timer(Sender: TObject); + procedure ViewExplorerClick(Sender: TObject); + procedure ExplorerCreateNewFolderClick(Sender: TObject); + procedure FileSaveClick(Sender: TObject); + procedure ExplorerDeleteClick(Sender: TObject); + procedure ExplorerRenameClick(Sender: TObject); + procedure FileLoadClick(Sender: TObject); + procedure pmExplorerPopup(Sender: TObject); + procedure FileCloseClick(Sender: TObject); + procedure miFormatTitleClick(Sender: TObject); + procedure ViewThumbnailsClick(Sender: TObject); + procedure pmiThumbnailsSizeClick(Sender: TObject); + procedure pmThumbnailsPopup(Sender: TObject); + procedure ExplorerPropertiesClick(Sender: TObject); + procedure miFileRebuildClick(Sender: TObject); + private + FExplorerContextCommandMenuItems: TList; + FExplorerContextCommandPopupMenuItems: TList; + FExplorerContextCommandToolButtons: TList; + FFlatCtrls: Boolean; + FLargeBtns: Boolean; + + FcbxPredefinedZoom: TCustomEdit; + FilToolBarLarge: TImageList; + FseActivePage: TCustomEdit; + + function GetExplorerContextCommandMenuItem(Index: Integer): TMenuItem; + function GetExplorerContextCommandMenuItemCount: Integer; + function GetExplorerContextCommandPopupMenuItem(Index: Integer): TMenuItem; + function GetExplorerContextCommandPopupMenuItemCount: Integer; + function GetExplorerContextCommandToolButton(Index: Integer): TToolButton; + function GetExplorerContextCommandToolButtonCount: Integer; + + procedure SetFlatCtrls(Value: Boolean); + procedure SetLargeBtns(Value: Boolean); + + procedure ArrangeToolBarCtrls; + procedure AssignToolBarImages; + function CalculateWindowPos(Sender: TObject): TPoint; + procedure CheckItem(AParent: TMenuItem); + function CreateLargeImages(ASource: TCustomImageList): TImageList; + procedure DoShowExplorerPopup(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure LoadPropertiesFromRegistry(const APath: string); + procedure SavePropertiesToRegistry(const APath: string); + procedure SetupFlatCtrls; + procedure WMInitMenu(var Message: TWMInitMenu); message WM_INITMENU; + protected + procedure Activate; override; + procedure DoShow; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + + procedure AddExplorerContextCommand(ACommand: TCustomdxPSExplorerContextCommand); override; + procedure UpdateExplorerContextCommands; override; + procedure ExplorerContextCommandClick(Sender: TObject); virtual; + + procedure CreateControls; override; + procedure DoAfterPrintReport(AShowDialog: Boolean); override; + procedure DoPreviewZoomFactorChanged(APreview: TdxPreview); override; + procedure DoPreviewZoomModeChanged(APreview: TdxPreview); override; + procedure LoadStrings; override; + procedure StyleListChanged(Sender: TObject); override; + + property ExplorerContextCommandMenuItemCount: Integer read GetExplorerContextCommandMenuItemCount; + property ExplorerContextCommandMenuItems[Index: Integer]: TMenuItem read GetExplorerContextCommandMenuItem; + property ExplorerContextCommandPopupMenuItemCount: Integer read GetExplorerContextCommandPopupMenuItemCount; + property ExplorerContextCommandPopupMenuItems[Index: Integer]: TMenuItem read GetExplorerContextCommandPopupMenuItem; + property ExplorerContextCommandToolButtonCount: Integer read GetExplorerContextCommandToolButtonCount; + property ExplorerContextCommandToolButtons[Index: Integer]: TToolButton read GetExplorerContextCommandToolButton; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure AfterConstruction; override; + + procedure InitContent; override; + procedure LoadFromRegistry(const APath: string); override; + procedure SaveToRegistry(const APath: string); override; + procedure UpdateControls; override; + + property FlatCtrls: Boolean read FFlatCtrls write SetFlatCtrls; + property LargeBtns: Boolean read FLargeBtns write SetLargeBtns; + end; + +implementation + +{$R *.DFM} + +uses + Registry, CommCtrl, Math, {$IFDEF DELPHI7}Themes, UxTheme, {$ENDIF} cxClasses, + dxPSGlbl, dxPSEngn, dxPgsDlg, dxPSRes, dxPSImgs, dxPrnDev, dxPSPopupMan, dxPSUtl; + +const + ToolBarHeight: array[Boolean] of Integer = (38, 54); + ToolBtnSize: array[Boolean] of TSize = ((cx: 25; cy: 24), (cx: 40; cy: 40)); + +{ '500%, 200%, 150%, 100%, 75%, 50%, 25%, 10%, + "Page Width", "Whole Page", "Two Pages", "Four Pages", "Widen To Source Width' } + + ZoomItemCount = 13; + ZoomItemIndexes: array[0..ZoomItemCount - 1] of Integer = + (-1, -1, -1, 5, -1, -1, -1, -1, 6, 7, 8, 9, 11); + + // strings used when saving(loading) properties to(from) registry + + sdxFlatCtrls = 'FlatCtrls'; + sdxLargeBtns = 'LargeBtns'; + +var + ToolBarImages: array[Boolean] of TImageList; + +type + TControlAccess = class(TControl); + + TdxZoomFactorComboEdit = class; + + TdxPopupBox = class(TListBox) + private + function GetEdit: TdxZoomFactorComboEdit; + function GetTextColor(Index: Integer; State: TOwnerDrawState): TColor; + {$IFDEF DELPHI5} + procedure WMContextMenu(var message: TWMContextMenu); message WM_CONTEXTMENU; + {$ENDIF} + procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure WMRButtonUp(var Message: TWMRButtonUp); message WM_RBUTTONUP; + procedure CMHintShow(var Message: TCMHintShow); message CM_HINTSHOW; + procedure CNCommand(var Message: TWMCommand); message CN_COMMAND; + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure WndProc(var message: TMessage); override; + + property Edit: TdxZoomFactorComboEdit read GetEdit; + public + constructor Create(AOwner: TComponent); override; + end; + + TdxPopupBoxItem = class + public + Enabled: Boolean; + ImageIndex: Integer; + constructor Create(AEnabled: Boolean; AnImageIndex: Integer); + end; + + TdxCloseUpEvent = procedure(Sender: TObject; AAccept: Boolean) of object; + + TdxZoomFactorComboEdit = class(TCustomEdit) + private + FBorderWidth: Integer; + FButtonWidth: Integer; + FDropDownCount: Integer; + FDroppedDown: Boolean; + FFlat: Boolean; + FImages: TImageList; + FImagesChangeLink: TChangeLink; + FIsMousePressed: Boolean; + FItemIndex: Integer; + FItemList: TList; + FItems: TStrings; + FLockChanges: Boolean; + FPopupBox: TdxPopupBox; + FSaveText: string; + FOnCloseUp: TdxCloseUpEvent; + FOnDropDown: TNotifyEvent; + function GetButtonRect: TRect; + function GetHotTrackAllowed: Boolean; + function GetImageIndex(Index: Integer): Integer; + function GetItemEnabled(Index: Integer): Boolean; + function GetMouseInButtonBounds: Boolean; + function GetMouseInControlBounds: Boolean; + function GetMousePos: TPoint; + function GetPopupItem(Index: Integer): TdxPopupBoxItem; + procedure SetDropDownCount(Value: Integer); + procedure SetDroppedDown(Value: Boolean); + procedure SetFlat(Value: Boolean); + procedure SetImages(Value: TImageList); + procedure SetImageIndex(Index: Integer; Value: Integer); + procedure SetIsMousePressed(Value: Boolean); + procedure SetItemEnabled(Index: Integer; Value: Boolean); + procedure SetItemIndex(Value: Integer); + procedure SetItems(Value: TStrings); + + procedure CloseUp(Accept: Boolean); + procedure DrawBorder(DC: HDC); + procedure DrawButton(DC: HDC); + procedure DrawNonClientArea; + procedure DropDown; + procedure InvalidateNCArea; + procedure MakeZoomItems; + procedure WMCaptureChanged(var Message: TMessage); message WM_CAPTURECHANGED; + {$IFDEF DELPHI5} + procedure WMContextMenu(var Message: TWMContextMenu); message WM_CONTEXTMENU; + {$ENDIF} + procedure WMKillFocus(var Message: TWMKillFocus); message WM_KILLFOCUS; + procedure WMMouseMove(var Message: TWMMouseMove); message WM_MOUSEMOVE; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + procedure WMNCLButtonDown(var Message: TWMNCLButtonDown); message WM_NCLBUTTONDOWN; + procedure WMNCLButtonUp(var Message: TWMNCLButtonDown); message WM_NCLBUTTONUP; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure WMRButtonUp(var Message: TWMRButtonUp); message WM_RBUTTONUP; + procedure WMSetText(var Message: TWMSetText); message WM_SETTEXT; + procedure CMCancelMode(var Message: TCMCancelMode); message CM_CANCELMODE; + procedure CMHintShow(var Message: TCMHintShow); message CM_HINTSHOW; + protected + procedure Change; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure DoEnter; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure WndProc(var message: TMessage); override; + + function AddItem(AnEnabled: Boolean; AnItemIndex: Integer): Integer; + procedure InsertItem(AnIndex: Integer; AnEnabled: Boolean; AnItemIndex: Integer); + procedure RemoveItem(AnIndex: Integer); + + property BorderWidth: Integer read FBorderWidth; + property ButtonRect: TRect read GetButtonRect; + property ButtonWidth: Integer read FButtonWidth; + property HotTrackAllowed: Boolean read GetHotTrackAllowed; + property IsMousePressed: Boolean read FIsMousePressed write SetIsMousePressed; + property MouseInButtonBounds: Boolean read GetMouseInButtonBounds; + property MouseInControlBounds: Boolean read GetMouseInControlBounds; + property MousePos: TPoint read GetMousePos; + property PopupBox: TdxPopupBox read FPopupBox; + property PopupItems[Index: Integer]: TdxPopupBoxItem read GetPopupItem; + public + constructor Create(Owner: TComponent); override; + destructor Destroy; override; + + function FindItemIndexByText(const AText: string): Integer; + procedure SelectNext; + procedure SelectPrev; + + property DroppedDown: Boolean read FDroppedDown write SetDroppedDown; + property ItemEnabled[Index: Integer]: Boolean read GetItemEnabled write SetItemEnabled; + property ImageIndexes[Index: Integer]: Integer read GetImageIndex write SetImageIndex; + published + property DropDownCount: Integer read FDropDownCount write SetDropDownCount default 8; + property Flat: Boolean read FFlat write SetFlat default False; + property Images: TImageList read FImages write SetImages; + property ItemIndex: Integer read FItemIndex write SetItemIndex; + property Items: TStrings read FItems write SetItems; + + property OnClick; + property OnCloseUp: TdxCloseUpEvent read FOnCloseUp write FOnCloseUp; + property OnDropDown: TNotifyEvent read FOnDropDown write FOnDropDown; + end; + +{ Utility Routines } + +function AddPercentSign(const S: string): string; +begin + Result := S; + if S[Length(S)] <> PercentSymbol then + Result := Result + PercentSymbol; +end; + +{ TdxPopupBox } + +constructor TdxPopupBox.Create(AOwner: TComponent); +begin + inherited; + Style := lbOwnerDrawVariable; + ControlStyle := ControlStyle - [csCaptureMouse]; +end; + +procedure TdxPopupBox.CreateParams(var Params: TCreateParams); +begin + inherited; + with Params do + begin + Style := Style or WS_BORDER or LBS_OWNERDRAWFIXED and not LBS_WANTKEYBOARDINPUT; + ExStyle := WS_EX_TOOLWINDOW or WS_EX_TOPMOST; + WindowClass.Style := CS_SAVEBITS; + end; +end; + +procedure TdxPopupBox.CreateWnd; +begin + inherited; + Windows.SetParent(Handle, 0); + CallWindowProc(DefWndProc, Handle, WM_SETFOCUS, 0, 0); + Items := Edit.Items; +end; + +procedure TdxPopupBox.DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); +const + TextColor: array[Boolean] of TColor = (clWindowText, clHighlightText); +var + S: string; +begin + Canvas.FillRect(Rect); + with Edit do + if (Images <> nil) and (ImageIndexes[Index] > -1) then + Images.Draw(Canvas, Rect.Left + 1, Rect.Top + 1, ImageIndexes[Index], ItemEnabled[Index]); + + if Edit.Images <> nil then + Inc(Rect.Left, Edit.Images.Width + 5); + Canvas.Font.Color := GetTextColor(Index, State); + Canvas.Brush.Style := bsClear; + S := Items[Index]; + DrawText(Canvas.Handle, PChar(S), Length(S), Rect, DT_LEFT or DT_VCENTER or DT_SINGLELINE or DT_NOPREFIX); +end; + +procedure TdxPopupBox.MouseMove(Shift: TShiftState; X, Y: Integer); +var + Index: Integer; +begin + inherited; + Index := ItemAtPos(MakePoint(X, Y), True); + if (Index > -1) and Edit.ItemEnabled[Index] then + ItemIndex := Index; +end; + +procedure TdxPopupBox.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +var + Accept: Boolean; + Pt: TPoint; +begin + inherited; + if Button = mbLeft then + begin + Pt := MakePoint(X, Y); + Accept := PtInRect(MakeRect(0, 0, Width, Height), Pt) and Edit.ItemEnabled[ItemAtPos(Pt, True)]; + Edit.CloseUp(Accept); + end; +end; + +procedure TdxPopupBox.WndProc(var Message: TMessage); +begin + if not ((Message.Msg = LB_SETCURSEL) and ((Message.wParam = -1) or not Edit.ItemEnabled[Message.wParam])) then + inherited; +end; + +function TdxPopupBox.GetEdit: TdxZoomFactorComboEdit; +begin + Result := TdxZoomFactorComboEdit(Owner); +end; + +function TdxPopupBox.GetTextColor(Index: Integer; State: TOwnerDrawState): TColor; +begin + if Edit.ItemEnabled[Index] then + if odSelected in State then + Result := clHighlightText + else + Result := clWindowText + else + Result := clGrayText; +end; + +{$IFDEF DELPHI5} + +procedure TdxPopupBox.WMContextMenu(var Message: TWMContextMenu); +begin + //DefaultHandler(message); +end; + +{$ENDIF} + +procedure TdxPopupBox.WMLButtonDown(var Message: TWMLButtonDown); +var + Index: Integer; +begin + Index := ItemAtPos(SmallPointToPoint(Message.Pos), True); + if (Index > -1) and Edit.ItemEnabled[Index] then + inherited; +end; + +procedure TdxPopupBox.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + InflateRect(Message.CalcSize_Params^.rgrc[0], -2, -2); +end; + +procedure TdxPopupBox.WMNCPaint(var Message: TWMNCPaint); +var + R: TRect; + DC: HDC; +begin + GetWindowRect(Handle, R); + OffsetRect(R, -R.Left, -R.Top); + DC := GetWindowDC(Handle); + try + DrawEdge(DC, R, EDGE_RAISED, BF_ADJUST or BF_RECT); + finally + ReleaseDC(Handle, DC); + end; +end; + +procedure TdxPopupBox.WMRButtonUp(var Message: TWMRButtonUp); +begin + DefaultHandler(Message); +end; + +procedure TdxPopupBox.CMHintShow(var Message: TCMHintShow); +begin + Message.Result := 1; +end; + +procedure TdxPopupBox.CNCommand(var Message: TWMCommand); +begin + inherited; + if (Message.NotifyCode = CBN_SELCHANGE) and Edit.ItemEnabled[ItemIndex] then + begin + Edit.FLockChanges := True; + try + Edit.Text := Items[ItemIndex]; + finally + Edit.FLockChanges := False; + end; + end; +end; + +type + TdxComboEditStrings = class(TStringList) + private + FComboEdit: TdxZoomFactorComboEdit; + protected + procedure SetUpdateState(Updating: Boolean); override; + public + constructor Create(AComboEdit: TdxZoomFactorComboEdit); + destructor Destroy; override; + + function Add(const S: string): Integer; override; + procedure Clear; override; + procedure Delete(Index: Integer); override; + procedure Insert(Index: Integer; const S: string); override; + property ComboEdit: TdxZoomFactorComboEdit read FComboEdit; + end; + +constructor TdxComboEditStrings.Create(AComboEdit: TdxZoomFactorComboEdit); +begin + inherited Create; + FComboEdit := AComboEdit; +end; + +destructor TdxComboEditStrings.Destroy; +begin + Clear; + inherited; +end; + +function TdxComboEditStrings.Add(const S: string): Integer; +begin + inherited Add(S); + Result := ComboEdit.AddItem(True, -1); +end; + +procedure TdxComboEditStrings.Insert(Index: Integer; const S: string); +begin + inherited; + ComboEdit.InsertItem(Index, True, -1); +end; + +procedure TdxComboEditStrings.Delete(Index: Integer); +begin + ComboEdit.RemoveItem(Index); + inherited; +end; + +procedure TdxComboEditStrings.Clear; +var + I: Integer; +begin + for I := Count - 1 downto 0 do + Delete(I); + inherited; +end; + +procedure TdxComboEditStrings.SetUpdateState(Updating: Boolean); +begin + SendMessage(ComboEdit.Handle, WM_SETREDRAW, Ord(not Updating), 0); + if not Updating then ComboEdit.Refresh; +end; + +{ TdxPopupBoxItem } + +constructor TdxPopupBoxItem.Create(AEnabled: Boolean; AnImageIndex: Integer); +begin + inherited Create; + Enabled := AEnabled; + ImageIndex := AnImageIndex; +end; + +{ TdxZoomFactorComboEdit } + +constructor TdxZoomFactorComboEdit.Create(Owner: TComponent); +begin + inherited; + FBorderWidth := 3; + FDropDownCount := 8; + FItemIndex := -1; + + FImagesChangeLink := TChangeLink.Create; + + FItemList := TList.Create; + FItems := TdxComboEditStrings.Create(Self); + MakeZoomItems; + + FFlat := True; + ControlStyle := ControlStyle - [csSetCaption, csFramed]; + Ctl3D := False; + BorderStyle := Forms.bsNone; + Parent := Owner as TWinControl; + FButtonWidth := GetSystemMetrics(SM_CXVSCROLL); + + FPopupBox := TdxPopupBox.Create(Self); + FPopupBox.Parent := Self; + FPopupBox.Visible := False; + FPopupBox.IntegralHeight := False; +end; + +destructor TdxZoomFactorComboEdit.Destroy; +begin + FItems.Free; + FItemList.Free; + FImagesChangeLink.Free; + FPopupBox.Free; + inherited; +end; + +function TdxZoomFactorComboEdit.FindItemIndexByText(const AText: string): Integer; +begin + Result := FItems.IndexOf(AText); +end; + +procedure TdxZoomFactorComboEdit.SelectNext; +begin + if ItemIndex < Items.Count then + ItemIndex := ItemIndex + 1; +end; + +procedure TdxZoomFactorComboEdit.SelectPrev; +begin + if ItemIndex > 0 then + {begin + V := IntToStr(Drop + end + else} + ItemIndex := ItemIndex - 1; +end; + +procedure TdxZoomFactorComboEdit.Change; +begin + if FLockChanges then Exit; + inherited; +end; + +procedure TdxZoomFactorComboEdit.CreateParams(var Params: TCreateParams); +begin + inherited; + Params.Style := Params.Style or WS_CLIPCHILDREN; +end; + +procedure TdxZoomFactorComboEdit.DoEnter; +begin + FSaveText := Text; + inherited; +end; + +procedure TdxZoomFactorComboEdit.KeyDown(var Key: Word; Shift: TShiftState); +begin + if Shift = [] then + case Key of + VK_UP: SelectPrev; + VK_DOWN: SelectNext; + end; + inherited; +end; + +procedure TdxZoomFactorComboEdit.KeyPress(var Key: Char); +begin + inherited; + if (Key = Char(VK_RETURN)) or (Key = Char(VK_ESCAPE)) then Key := #0; +end; + +procedure TdxZoomFactorComboEdit.WndProc(var Message: TMessage); + + procedure ProcessDropDownKeys(var Key: Word; Shift: TShiftState); + + function IsDropDownKey: Boolean; + begin + if ssAlt in Shift then + Result := (Key = VK_F4) or (Key = VK_DOWN) + else + Result := Key = VK_F4; + end; + + begin + if IsDropDownKey then + begin + if DroppedDown then + CloseUp(False) + else + DropDown; + Key := 0; + end; + + if not (ssAlt in Shift) then + begin + if (Key = VK_RETURN) and DroppedDown then + begin + CloseUp(True); + Key := 0; + end; + + if Key = VK_ESCAPE then + begin + if DroppedDown then + CloseUp(False) + else + Text := FSaveText; + Key := 0; + end; + end; + end; + +var + CharKey: Word; +begin + case Message.Msg of + WM_KEYDOWN, + WM_SYSKEYDOWN, + WM_CHAR: + begin + with TWMKey(Message) do + begin + CharKey := CharCode; + ProcessDropDownKeys(CharKey, KeyDataToShiftState(KeyData)); + CharCode := CharKey; + if CharCode = 0 then Exit; + + if ((CharCode = VK_UP) or (CharCode = VK_DOWN)) and PopupBox.Visible then + begin + with Message do + SendMessage(PopupBox.Handle, Msg, wParam, lParam); + Exit; + end; + end; + end; + + CM_ENABLEDCHANGED, + CM_MOUSEENTER, + CM_MOUSELEAVE, + WM_SETFOCUS, + WM_KILLFOCUS: + InvalidateNCArea; + end; + inherited; +end; + +function TdxZoomFactorComboEdit.AddItem(AnEnabled: Boolean; AnItemIndex: Integer): Integer; +begin + Result := FItemList.Add(TdxPopupBoxItem.Create(AnEnabled, AnItemIndex)); +end; + +procedure TdxZoomFactorComboEdit.InsertItem(AnIndex: Integer; AnEnabled: Boolean; + AnItemIndex: Integer); +begin + FItemList.Insert(AnIndex, TdxPopupBoxItem.Create(AnEnabled, AnItemIndex)); +end; + +procedure TdxZoomFactorComboEdit.RemoveItem(AnIndex: Integer); +begin + PopupItems[AnIndex].Free; + FItemList.Delete(AnIndex); +end; + +function TdxZoomFactorComboEdit.GetButtonRect: TRect; +begin + GetWindowRect(Handle, Result); + InflateRect(Result, -BorderWidth, -BorderWidth); + Result.Left := Result.Right - ButtonWidth; +end; + +function TdxZoomFactorComboEdit.GetHotTrackAllowed: Boolean; +begin + Result := Flat and not (csDesigning in ComponentState) and + (Focused or (MouseInControlBounds and GetParentForm(Self).Active)); +end; + +function TdxZoomFactorComboEdit.GetImageIndex(Index: Integer): Integer; +begin + Result := PopupItems[Index].ImageIndex; +end; + +function TdxZoomFactorComboEdit.GetItemEnabled(Index: Integer): Boolean; +begin + Result := PopupItems[Index].Enabled; +end; + +function TdxZoomFactorComboEdit.GetMouseInButtonBounds: Boolean; +begin + Result := PtInRect(ButtonRect, MousePos); +end; + +function TdxZoomFactorComboEdit.GetMouseInControlBounds: Boolean; +var + R: TRect; +begin + GetWindowRect(Handle, R); + Result := PtInRect(R, MousePos); +end; + +function TdxZoomFactorComboEdit.GetMousePos: TPoint; +begin + GetCursorPos(Result); +end; + +function TdxZoomFactorComboEdit.GetPopupItem(Index: Integer): TdxPopupBoxItem; +begin + Result := TdxPopupBoxItem(FItemList[Index]); +end; + +procedure TdxZoomFactorComboEdit.SetDropDownCount(Value: Integer); +begin + if Value < 1 then + Value := 1; + if FDropDownCount <> Value then + FDropDownCount := Value; +end; + +procedure TdxZoomFactorComboEdit.SetDroppedDown(Value: Boolean); +begin + if FDroppedDown <> Value then + begin + FDroppedDown := Value; + if DroppedDown then + DropDown + else + CloseUp(False); + end; +end; + +procedure TdxZoomFactorComboEdit.SetFlat(Value: Boolean); +const + BorderStyleMap: array[Boolean] of TBorderStyle = (bsSingle, bsNone); +begin + if FFlat <> Value then + begin + FFlat := Value; + Ctl3D := not Flat; + BorderStyle := BorderStyleMap[Flat]; + end; +end; + +procedure TdxZoomFactorComboEdit.SetImageIndex(Index: Integer; Value: Integer); +begin + PopupItems[Index].ImageIndex := Value; +end; + +procedure TdxZoomFactorComboEdit.SetIsMousePressed(Value: Boolean); +begin + if FIsMousePressed <> Value then + begin + FIsMousePressed := Value; + InvalidateNCArea; + end; +end; + +procedure TdxZoomFactorComboEdit.SetImages(Value: TImageList); +begin + if Images <> nil then + Images.UnregisterChanges(FImagesChangeLink); + FImages := Value; + if Images <> nil then + begin + Images.RegisterChanges(FImagesChangeLink); + Images.FreeNotification(Self); + PopupBox.ItemHeight := Images.Height + 2; + end; +end; + +procedure TdxZoomFactorComboEdit.SetItemEnabled(Index: Integer; Value: Boolean); +begin + PopupItems[Index].Enabled := Value; +end; + +procedure TdxZoomFactorComboEdit.SetItemIndex(Value: Integer); +begin + if Value < -1 then + Value := -1; + if Value > Items.Count - 1 then + Value := Items.Count - 1; + if FItemIndex <> Value then + begin + FItemIndex := Value; + if FItemIndex > -1 then + Text := Items[FItemIndex] + else + Text := ''; + end; +end; + +procedure TdxZoomFactorComboEdit.SetItems(Value: TStrings); +begin + Items.Assign(Value); +end; + +procedure TdxZoomFactorComboEdit.CloseUp(Accept: Boolean); +begin + if PopupBox.Visible then + begin + FDroppedDown := False; + if GetCapture <> 0 then + SendMessage(GetCapture, WM_CANCELMODE, 0, 0); + SetWindowPos(FPopupBox.Handle, 0, 0, 0, 0, 0, + SWP_NOZORDER or SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE or SWP_HIDEWINDOW); + if Accept and (PopupBox.ItemIndex <> -1) then + Text := PopupBox.Items.Strings[FPopupBox.ItemIndex]; + PopupBox.Visible := False; + + if Assigned(FOnCloseUp) then FOnCloseUp(Self, Accept); + if Accept then Click; + + Invalidate; + InvalidateNCArea; + end; +end; + +procedure TdxZoomFactorComboEdit.DrawBorder(DC: HDC); +var + R: TRect; + Color: COLORREF; + {$IFDEF DELPHI7} + Details: TThemedElementDetails; + {$ENDIF} +begin + GetWindowRect(Handle, R); + OffsetRect(R, -R.Left, -R.Top); + if not Flat then + begin + {$IFDEF DELPHI7} + with ThemeServices do + if ThemesEnabled then + begin + Details := GetElementDetails(teEditTextNormal); + DrawEdge(DC, Details, R, BDR_RAISEDOUTER, BF_RECT or BF_FLAT); + InflateRect(R, -1, -1); + DrawEdge(DC, Details, R, BDR_RAISEDINNER, BF_RECT or BF_MONO); + InflateRect(R, -1, -1); + DrawEdge(DC, Details, R, BDR_RAISEDINNER, BF_RECT or BF_MONO); + Exit; + end; + {$ENDIF} + DrawEdge(DC, R, EDGE_SUNKEN, BF_RECT); + InflateRect(R, -2, -2); + FrameRect(DC, R, GetSysColorBrush(COLOR_WINDOW)); + end + else + begin + if HotTrackAllowed then + begin + DrawEdge(DC, R, BDR_SUNKENOUTER, BF_RECT); + InflateRect(R, -1, -1); + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + end + else + begin + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + InflateRect(R, -1, -1); + if Enabled then + Color := COLOR_BTNFACE + else + Color := COLOR_WINDOW; + FrameRect(DC, R, GetSysColorBrush(Color)); + end; + InflateRect(R, -1, -1); + FrameRect(DC, R, GetSysColorBrush(COLOR_WINDOW)); + end; +end; + +procedure TdxZoomFactorComboEdit.DrawButton(DC: HDC); + + {$IFDEF DELPHI7} + function GetThemeState(ADowned: Boolean): TThemedComboBox; + begin + if not Enabled then + Result := tcDropDownButtonDisabled + else + if ADowned then + Result := tcDropDownButtonPressed + else + if MouseInButtonBounds then + Result := tcDropDownButtonHot + else + Result := tcDropDownButtonNormal; + end; + {$ENDIF} + + function ButtonRect: TRect; + begin + Result := BoundsRect; + OffsetRect(Result, -Result.Left, -Result.Top); + InflateRect(Result, -BorderWidth, -BorderWidth); + Result.Left := Result.Right - ButtonWidth; + end; + +const + Pusheds: array[Boolean] of UINT = (0, DFCS_PUSHED); + Enableds: array[Boolean] of UINT = (DFCS_INACTIVE, 0); + Downeds: array[Boolean] of UINT = (BDR_RAISEDOUTER, BDR_SUNKENINNER); + InnerEdges: array[Boolean] of UINT = (BDR_RAISEDINNER, 0); + OuterEdges: array[Boolean] of UINT = (0, BDR_SUNKENOUTER); +var + R: TRect; + Downed: Boolean; +begin + R := ButtonRect; + Downed := DroppedDown or (MouseInButtonBounds and IsMousePressed); + {$IFDEF DELPHI7} + with ThemeServices do + if ThemesEnabled then + begin + DrawElement(DC, GetElementDetails(GetThemeState(Downed)), R); + Exit; + end; + {$ENDIF} + + DrawFrameControl(DC, R, DFC_SCROLL, DFCS_FLAT or DFCS_SCROLLCOMBOBOX or Pusheds[Downed] or Enableds[Enabled]); + DrawEdge(DC, R, OuterEdges[Downed] or InnerEdges[Downed] or Downeds[Downed], BF_RECT); + + ExcludeClipRect(DC, R.Left, R.Top, R.Right, R.Bottom); +end; + +procedure TdxZoomFactorComboEdit.DrawNonClientArea; +var + DC: HDC; +begin + DC := GetWindowDC(Handle); + try + DrawBorder(DC); + DrawButton(DC); + finally + ReleaseDC(Handle, DC); + end; +end; + +procedure TdxZoomFactorComboEdit.DropDown; +var + ADesktopBounds: TRect; + + function CalculatePopupPos: TPoint; + begin + Result := Parent.ClientToScreen(MakePoint(Left, Top)); + with Result do + begin + if X + PopupBox.Width > ADesktopBounds.Right then + X := ADesktopBounds.Right - PopupBox.Width; + if X < ADesktopBounds.Left then X := ADesktopBounds.Left; + + Inc(Y, Height); + if Y + PopupBox.Height > Screen.Height then + if Y - (PopupBox.Height + Height) > 0 then + Dec(Y, PopupBox.Height + Height) + else + Y := 0; + end; + end; + +var + Pt: TPoint; +begin + ADesktopBounds := GetDesktopWorkArea(Parent.ClientToScreen(MakePoint(Left, Top))); + if (PopupBox <> nil) and not PopupBox.Visible then + begin + FDroppedDown := True; + SelectAll; + + PopupBox.Width := Width; + PopupBox.Height := DropDownCount * PopupBox.ItemHeight + 4; + PopupBox.Color := Color; + PopupBox.Font := Font; + PopupBox.ItemIndex := PopupBox.Items.IndexOf(Text); + + Pt := CalculatePopupPos; + SetWindowPos(PopupBox.Handle, HWND_TOP, Pt.X, Pt.Y, 0, 0, SWP_NOSIZE or SWP_NOACTIVATE or SWP_SHOWWINDOW); + PopupBox.Visible := True; + Invalidate; + Windows.SetFocus(Handle); + + if Assigned(FOnDropDown) then FOnDropDown(Self); + end; +end; + +procedure TdxZoomFactorComboEdit.InvalidateNCArea; +const + Flags: UINT = SWP_FRAMECHANGED or SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE or SWP_NOZORDER; +begin + SetWindowPos(Handle, 0, 0, 0, 0, 0, Flags); +end; + +procedure TdxZoomFactorComboEdit.MakeZoomItems; +begin + with Items do + begin + Clear; + Add('500' + PercentSymbol); + Add('200' + PercentSymbol); + Add('150' + PercentSymbol); + Add('100' + PercentSymbol); + Add('75' + PercentSymbol); + Add('50' + PercentSymbol); + Add('25' + PercentSymbol); + Add('10' + PercentSymbol); + Add(cxGetResourceString(@sdxPageWidth)); + Add(cxGetResourceString(@sdxWholePage)); + Add(cxGetResourceString(@sdxTwoPages)); + Add(cxGetResourceString(@sdxFourPages)); + Add(cxGetResourceString(@sdxWidenToSourceWidth)); + end; +end; + +procedure TdxZoomFactorComboEdit.WMCaptureChanged(var Message: TMessage); +begin + inherited; + IsMousePressed := False; +end; + +{$IFDEF DELPHI5} + +procedure TdxZoomFactorComboEdit.WMContextMenu(var Message: TWMContextMenu); +begin + if DroppedDown then + DefaultHandler(Message) + else + inherited; +end; + +{$ENDIF} + +procedure TdxZoomFactorComboEdit.WMKillFocus(var Message: TWMKillFocus); +begin + inherited; + IsMousePressed := False; + CloseUp(False); +end; + +procedure TdxZoomFactorComboEdit.WMMouseMove(var Message: TWMMouseMove); +begin + inherited; + if not MouseInButtonBounds then + Perform(WM_NCLBUTTONUP, 0, TMessage(Message).lParam); +end; + +procedure TdxZoomFactorComboEdit.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + with Message.CalcSize_Params^ do + begin + InflateRect(rgrc[0], -FBorderWidth, -FBorderWidth); + Dec(rgrc[0].Right, FButtonWidth); + end; +end; + +procedure TdxZoomFactorComboEdit.WMNCHitTest(var Message: TWMNCHitTest); +begin + inherited; + if MouseInButtonBounds then + message.Result := HTBORDER + else + Perform(WM_NCLBUTTONUP, 0, TMessage(Message).lParam); +end; + +procedure TdxZoomFactorComboEdit.WMNCLButtonDown(var Message: TWMNCLButtonDown); +begin + inherited; + if MouseInButtonBounds then + begin + IsMousePressed := True; + DroppedDown := not FPopupBox.Visible; + end; +end; + +procedure TdxZoomFactorComboEdit.WMNCLButtonUp(var message: TWMNCLButtonDown); +begin + inherited; + IsMousePressed := False; +end; + +procedure TdxZoomFactorComboEdit.WMNCPaint(var Message: TWMNCPaint); +begin + DrawNonClientArea; +end; + +procedure TdxZoomFactorComboEdit.WMRButtonUp(var Message: TWMRButtonUp); +begin + if DroppedDown then + DefaultHandler(Message) + else + inherited; +end; + +procedure TdxZoomFactorComboEdit.WMSetText(var Message: TWMSetText); +var + Index: Integer; +begin + inherited; + Index := FindItemIndexByText(Text); + if Index <> -1 then + ItemIndex := Index; +end; + +procedure TdxZoomFactorComboEdit.CMCancelMode(var Message: TCMCancelMode); +begin + if (Message.Sender <> Self) and (Message.Sender <> FPopupBox) then + CloseUp(False); +end; + +procedure TdxZoomFactorComboEdit.CMHintShow(var Message: TCMHintShow); +begin + Message.Result := Integer(DroppedDown); +end; + +{ TdxfmStdPreview } + +constructor TdxfmStdPreview.Create(AOwner: TComponent); +begin + inherited; + FExplorerContextCommandMenuItems := TList.Create; + FExplorerContextCommandPopupMenuItems := TList.Create; + FExplorerContextCommandToolButtons := TList.Create; +end; + +destructor TdxfmStdPreview.Destroy; +begin + FreeAndNil(FExplorerContextCommandToolButtons); + FreeAndNil(FExplorerContextCommandPopupMenuItems); + FreeAndNil(FExplorerContextCommandMenuItems); + inherited; +end; + +procedure TdxfmStdPreview.AfterConstruction; +begin + FFlatCtrls := True; + FLargeBtns := False; + inherited; + ToolBar.HandleNeeded; + ToolBar.Realign; +end; + +procedure TdxfmStdPreview.Activate; +begin + inherited; + Timer1.Enabled := True; +end; + +procedure TdxfmStdPreview.DoShow; +begin + inherited; + ToolBar.Realign; +end; + +procedure TdxfmStdPreview.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited; + if (Key = Ord('Z')) and (ssAlt in Shift) and FcbxPredefinedZoom.CanFocus then + ActiveControl := FcbxPredefinedZoom; + if (Key = Ord('A')) and (ssAlt in Shift) and FseActivePage.CanFocus then + ActiveControl := FseActivePage; +end; + +procedure TdxfmStdPreview.AddExplorerContextCommand(ACommand: TCustomdxPSExplorerContextCommand); + + function IsCommandSeparator(ACommand: TCustomdxPSExplorerContextCommand): Boolean; + begin + Result := ACommand is TdxPSExplorerContextCommandSeparator; + end; + + function AddExplorerContextCommandMenuItem(AParent: TMenuItem; ACommand: TCustomdxPSExplorerContextCommand): TMenuItem; + begin + Result := TMenuItem.Create(Self); + with Result do + begin + Bitmap := ACommand.Bitmap; + Caption := ACommand.Caption; + Enabled := ACommand.Enabled; + Hint := ACommand.Hint; + ShortCut := ACommand.ShortCut; + Tag := MakeTTag(ACommand); + + OnClick := ExplorerContextCommandClick; + end; + AParent.Insert(0, Result); + end; + +var + MenuItem: TMenuItem; +begin + MenuItem := AddExplorerContextCommandMenuItem(pmExplorer.Items, ACommand); + if not IsCommandSeparator(ACommand) and (FExplorerContextCommandPopupMenuItems.IndexOf(MenuItem) = -1) then + FExplorerContextCommandPopupMenuItems.Add(MenuItem); + + MenuItem := AddExplorerContextCommandMenuItem(miExplorer, ACommand); + if not IsCommandSeparator(ACommand) and (FExplorerContextCommandMenuItems.IndexOf(MenuItem) = -1) then + FExplorerContextCommandMenuItems.Add(MenuItem); +end; + +procedure TdxfmStdPreview.UpdateExplorerContextCommands; + + procedure UpdateMenuItems; + var + I: Integer; + begin + for I := 0 to ExplorerContextCommandMenuItemCount - 1 do + with ExplorerContextCommandMenuItems[I] do + Enabled := TCustomdxPSExplorerContextCommand(TTagToObj(Tag)).Enabled; + end; + + procedure UpdatePopupMenuItems; + var + I: Integer; + begin + for I := 0 to ExplorerContextCommandPopupMenuItemCount - 1 do + with ExplorerContextCommandPopupMenuItems[I] do + Enabled := TCustomdxPSExplorerContextCommand(TTagToObj(Tag)).Enabled; + end; + + procedure UpdateToolButtons; + var + I: Integer; + begin + for I := 0 to ExplorerContextCommandToolButtonCount - 1 do + with ExplorerContextCommandToolButtons[I] do + Enabled := TCustomdxPSExplorerContextCommand(TTagToObj(Tag)).Enabled; + end; + +begin + if not (csDestroying in ComponentState) then + begin + UpdateMenuItems; + UpdatePopupMenuItems; + UpdateToolButtons; + end; +end; + +procedure TdxfmStdPreview.ExplorerContextCommandClick(Sender: TObject); +var + Command: TCustomdxPSExplorerContextCommand; + CommandSet2: IdxPSExplorerContextCommands2; +begin + Command := TCustomdxPSExplorerContextCommand(TTagToObj(TMenuItem(Sender).Tag)); + if Supports(TObject(Explorer), IdxPSExplorerContextCommands2, CommandSet2) then + begin + CommandSet2.InitializeCommand(Command); + try + if Command.Enabled then Command.Execute; {.1} + finally + CommandSet2.FinalizeCommand(Command); + end; + end; +end; + +procedure TdxfmStdPreview.CreateControls; +begin + inherited; + + FseActivePage := TdxPSSpinEdit.Create(Self); + with TdxPSSpinEdit(FseActivePage) do + begin + Parent := pnlCurrentPage; + Width := pnlCurrentPage.Width - Left; + //MaxValue := Preview.PageCount; + Value := 1; + OnKeyPress := seKeyPress; + OnButtonClick := seActivePageButtonClick; + OnExit := seActivePageExit; + end; + + FcbxPredefinedZoom := TdxZoomFactorComboEdit.Create(pnlZoomCbx); + with TdxZoomFactorComboEdit(FcbxPredefinedZoom) do + begin + Height := FseActivePage.Height; + DropDownCount := PredefinedZooms.Count; + OnClick := cbxPredefinedZoomClick; + OnCloseUp := cbxPredefinedZoomCloseUp; + OnExit := cbxPredefinedZoomExit; + OnKeyDown := cbxPredefinedZoomKeyDown; + end; + + FilToolBarLarge := CreateLargeImages(ilToolBarSmall); + ToolBarImages[False] := ilToolBarSmall; + ToolBarImages[True] := FilToolBarLarge; + ArrangeToolBarCtrls; + AssignToolBarImages; + SetupFlatCtrls; + + Preview.PopupMenu := pmPreview; + + pmToolBar.OwnerDraw := True; + pmToolBar.Images := ilToolBarSmall; + + pmPrintStyles.OwnerDraw := True; + pmPrintStyles.Images := ilToolBarSmall; + + Menu.Images := ilToolBarSmall; + pmPreview.Images := ilToolBarSmall; + + miFileDesign.ImageIndex := 0; + miFileSave.ImageIndex := 19; + miFileLoad.ImageIndex := 23; + miFileClose.ImageIndex := 24; + miFilePrint.ImageIndex := 2; + miFilePageSetup.ImageIndex := 3; + miFormatPageBackground.ImageIndex := 4; + miFormatShrinkToPageWidth.ImageIndex := 12; + + miExplorerCreateNewFolder.ImageIndex := 20; + miExplorerDelete.ImageIndex := 22; + miExplorerProperties.ImageIndex := 29; + + miViewExplorer.ImageIndex := 30; + miViewThumbnails.ImageIndex := 31; + + miZoomPercent100.ImageIndex := 5; + miZoomPageWidth.ImageIndex := 6; + miZoomWholePage.ImageIndex := 7; + miZoomTwoPages.ImageIndex := 8; + miZoomFourPages.ImageIndex := 9; + miZoomWidenToSourceWidth.ImageIndex := 11; + + miFormatTitle.ImageIndex := 26; + miFormatDateTime.ImageIndex := 28; + miFormatPageNumbering.ImageIndex := 29; + + miGoToFirstPage.ImageIndex := 13; + miGoToPrevPage.ImageIndex := 14; + miGoToNextPage.ImageIndex := 15; + miGoToLastPage.ImageIndex := 16; + miHelpTopics.ImageIndex := 17; + + pmDesigners.OwnerDraw := True; + pmDesigners.Images := ilToolBarSmall; + + pmiReportDesign.ImageIndex := 0; + pmiPageSetup.ImageIndex := 3; + pmiReportShrinkToPageWidth.ImageIndex := 12; + + pmiZoomPercent100.ImageIndex := 5; + pmiZoomPageWidth.ImageIndex := 6; + pmiZoomWholePage.ImageIndex := 7; + pmiZoomTwoPages.ImageIndex := 8; + pmiZoomFourPages.ImageIndex := 9; + pmiZoomWidenToSourceWidth.ImageIndex := 11; + + pmiGoToFirstPage.ImageIndex := 13; + pmiGoToPrevPage.ImageIndex := 14; + pmiGoToNextPage.ImageIndex := 15; + pmiGoToLastPage.ImageIndex := 16; + + pmExplorer.OwnerDraw := True; + pmExplorer.Images := ilToolBarSmall; + + pmiExplorerLoadData.ImageIndex := 23; + pmiExplorerUnloadData.ImageIndex := 24; + pmiExplorerCreateFolder.ImageIndex := 20; + pmiExplorerDelete.ImageIndex := 22; + pmiExplorerProperties.ImageIndex := 29; + + pmThumbnails.Images := ilStub; +end; + +procedure TdxfmStdPreview.LoadStrings; + + procedure SetHint(AButton: TControl; const AHint: string; AMenuItem: TMenuItem = nil); + var + S: string; + begin + if AMenuItem <> nil then + S := ShortCutToText(AMenuItem.ShortCut) + else + S := AButton.Hint; + AButton.Hint := AHint; + if Length(S) > 0 then + AButton.Hint := AButton.Hint + ' (' + S + ')'; + end; + +begin + inherited; + + { menus } + miFile.Caption := cxGetResourceString(@sdxMenuFile); + miFileDesign.Caption := cxGetResourceString(@sdxMenuFileDesign); + miFileRebuild.Caption := cxGetResourceString(@sdxMenuFileRebuild); + miFileSave.Caption := cxGetResourceString(@sdxMenuFileSave); + miFileLoad.Caption := cxGetResourceString(@sdxMenuFileLoad); + miFileClose.Caption := cxGetResourceString(@sdxMenuFileClose); + miFilePrint.Caption := cxGetResourceString(@sdxMenuFilePrint); + miFilePageSetup.Caption := cxGetResourceString(@sdxMenuFilePageSetup); + miFilePrintStyles.Caption := cxGetResourceString(@sdxMenuPrintStyles); + pmiFilePrintStyles.Caption := cxGetResourceString(@sdxMenuPrintStyles); + miFilePreferences.Caption := cxGetResourceString(@sdxMenuToolsOptions); + miFileExit.Caption := cxGetResourceString(@sdxMenuFileExit); + + miExplorer.Caption := cxGetResourceString(@sdxMenuExplorer); + miExplorerCreateNewFolder.Caption := cxGetResourceString(@sdxMenuExplorerCreateFolder); + miExplorerDelete.Caption := cxGetResourceString(@sdxMenuExplorerDelete); + miExplorerRename.Caption := cxGetResourceString(@sdxMenuExplorerRename); + miExplorerProperties.Caption := cxGetResourceString(@sdxMenuExplorerProperties); + + miEdit.Caption := cxGetResourceString(@sdxMenuEdit); + miEditFind.Caption := cxGetResourceString(@sdxMenuEditFind); + miEditFindNext.Caption := cxGetResourceString(@sdxMenuEditFindNext); + miEditReplace.Caption := cxGetResourceString(@sdxMenuEditReplace); + + miView.Caption := cxGetResourceString(@sdxMenuView); + miViewMargins.Caption := cxGetResourceString(@sdxMenuViewMargins); + miViewLargeTBtns.Caption := cxGetResourceString(@sdxMenuViewLargeToolBarButtons); + miViewFlatTBtns.Caption := cxGetResourceString(@sdxMenuViewFlatToolBarButtons); + miViewMarginBar.Caption := cxGetResourceString(@sdxMenuViewMarginsStatusBar); + miViewStatusBar.Caption := cxGetResourceString(@sdxMenuViewPagesStatusBar); + miViewExplorer.Caption := cxGetResourceString(@sdxMenuViewExplorer); + miViewThumbnails.Caption := cxGetResourceString(@sdxMenuViewThumbnails); + miViewZoom.Caption := cxGetResourceString(@sdxMenuZoom); + miViewPageHeaders.Caption := cxGetResourceString(@sdxMenuViewPagesHeaders); + miViewPageFooters.Caption := cxGetResourceString(@sdxMenuViewPagesFooters); + + miZoomPercent100.Caption := cxGetResourceString(@sdxMenuZoomPercent100); + miZoomPageWidth.Caption := cxGetResourceString(@sdxMenuZoomPageWidth); + miZoomWholePage.Caption := cxGetResourceString(@sdxMenuZoomWholePage); + miZoomTwoPages.Caption := cxGetResourceString(@sdxMenuZoomTwoPages); + miZoomFourPages.Caption := cxGetResourceString(@sdxMenuZoomFourPages); + miZoomWidenToSourceWidth.Caption := cxGetResourceString(@sdxMenuZoomWidenToSourceWidth); + miZoomSetup.Caption := cxGetResourceString(@sdxMenuZoomSetup); + + miFormat.Caption := cxGetResourceString(@sdxMenuFormat); +// miFormatHeaderAndFooter.Caption := cxGetResourceString(@sdxMenuFormatHeaderAndFooter); + miFormatTitle.Caption := cxGetResourceString(@sdxMenuFormatTitle); + miFormatShowHideEmptyPages.Caption := cxGetResourceString(@sdxMenuShowEmptyPages); + miFormatAutoText.Caption := cxGetResourceString(@sdxMenuInsertEditAutoTextEntries); + miFormatDateTime.Caption := cxGetResourceString(@sdxMenuFormatDateTime); + miFormatPageNumbering.Caption := cxGetResourceString(@sdxMenuFormatPageNumbering); + miFormatPageBackground.Caption := cxGetResourceString(@sdxMenuFormatPageBackground); + miFormatShrinkToPageWidth.Caption := cxGetResourceString(@sdxMenuFormatShrinkToPage); + + miGotoPage.Caption := cxGetResourceString(@sdxMenuGotoPage); + miGotoFirstPage.Caption := cxGetResourceString(@sdxMenuGotoPageFirst); + miGotoPrevPage.Caption := cxGetResourceString(@sdxMenuGotoPagePrev); + miGotoNextPage.Caption := cxGetResourceString(@sdxMenuGotoPageNext); + miGotoLastPage.Caption := cxGetResourceString(@sdxMenuGotoPageLast); + + miHelp.Caption := cxGetResourceString(@sdxMenuHelp); + miHelpTopics.Caption := cxGetResourceString(@sdxMenuHelpTopics); + miHelpAbout.Caption := cxGetResourceString(@sdxMenuHelpAbout); + + { popup menus } + pmiReportDesign.Caption := cxGetResourceString(@sdxMenuFileDesign); + pmiPageSetup.Caption := cxGetResourceString(@sdxMenuFilePageSetup); + pmiReportShrinkToPageWidth.Caption := cxGetResourceString(@sdxMenuFormatShrinkToPage); + pmiZoom.Caption := cxGetResourceString(@sdxMenuZoom); + pmiZoomPercent100.Caption := cxGetResourceString(@sdxMenuZoomPercent100); + pmiZoomPageWidth.Caption := cxGetResourceString(@sdxMenuZoomPageWidth); + pmiZoomWholePage.Caption := cxGetResourceString(@sdxMenuZoomWholePage); + pmiZoomTwoPages.Caption := cxGetResourceString(@sdxMenuZoomTwoPages); + pmiZoomFourPages.Caption := cxGetResourceString(@sdxMenuZoomFourPages); + pmiZoomWidenToSourceWidth.Caption := cxGetResourceString(@sdxMenuZoomWidenToSourceWidth); + + pmiGotoFirstPage.Caption := cxGetResourceString(@sdxMenuGotoPageFirst); + pmiGotoPrevPage.Caption := cxGetResourceString(@sdxMenuGotoPagePrev); + pmiGotoNextPage.Caption := cxGetResourceString(@sdxMenuGotoPageNext); + pmiGotoLastPage.Caption := cxGetResourceString(@sdxMenuGotoPageLast); + + pmiExplorerLoadData.Caption := cxGetResourceString(@sdxMenuFileLoad); + pmiExplorerUnloadData.Caption := cxGetResourceString(@sdxMenuFileClose); + pmiExplorerCreateFolder.Caption := cxGetResourceString(@sdxMenuExplorerCreateFolder); + pmiExplorerDelete.Caption := cxGetResourceString(@sdxMenuExplorerDelete); + pmiExplorerRename.Caption := cxGetResourceString(@sdxMenuExplorerRename); + pmiExplorerProperties.Caption := cxGetResourceString(@sdxMenuExplorerProperties); + + pmiSmallThumbnails.Caption := cxGetResourceString(@sdxMenuThumbnailsSmall); + pmiLargeThumbnails.Caption := cxGetResourceString(@sdxMenuThumbnailsLarge); + + pmiFlatBtns.Caption := cxGetResourceString(@sdxMenuViewFlatToolBarButtons); + pmiLargeBtns.Caption := cxGetResourceString(@sdxMenuViewLargeToolBarButtons); + + { toolbar hints } + SetHint(tbReportDesigner, cxGetResourceString(@sdxHintFileDesign), miFileDesign); + tbPrint.Hint := cxGetResourceString(@sdxHintFilePrint) + dxPSPrVw.GetCurrentPrinterAsHint; + SetHint(tbFileLoad, cxGetResourceString(@sdxHintFileLoad), miFileLoad); + SetHint(tbFileUnload, cxGetResourceString(@sdxHintFileClose), miFileClose); + SetHint(tbFileSave, cxGetResourceString(@sdxHintFileSave), miFileSave); + SetHint(tbPrintDialog, cxGetResourceString(@sdxHintFilePrintDialog)); + SetHint(tbPageSetup, cxGetResourceString(@sdxHintFilePageSetup), miFilePageSetup); + SetHint(tbPageBackground, cxGetResourceString(@sdxHintFormatPageBackground)); + SetHint(tbShrinkToPageWidth, cxGetResourceString(@sdxHintFormatShrinkToPage)); + + SetHint(tbViewExplorer, cxGetResourceString(@sdxHintViewExplorer), miViewExplorer); + SetHint(tbViewThumbnails, cxGetResourceString(@sdxHintViewThumbnails), miViewThumbnails); + + SetHint(FcbxPredefinedZoom, cxGetResourceString(@sdxHintViewZoom)); + SetHint(tbPercent100, cxGetResourceString(@sdxHintZoomPercent100), miZoomPercent100); + SetHint(tbPageWidth, cxGetResourceString(@sdxHintZoomPageWidth), miZoomPageWidth); + SetHint(tbOnePage, cxGetResourceString(@sdxHintZoomWholePage), miZoomWholePage); + SetHint(tbTwoPage, cxGetResourceString(@sdxHintZoomTwoPages), miZoomTwoPages); + SetHint(tbFourPage, cxGetResourceString(@sdxHintZoomFourPages), miZoomFourPages); + SetHint(tbMultiplePages, cxGetResourceString(@sdxHintZoomMultiplyPages)); + SetHint(tbWidenToSourceWidth, cxGetResourceString(@sdxHintZoomWidenToSourceWidth), miZoomWidenToSourceWidth); + + SetHint(tbGotoFirstPage, cxGetResourceString(@sdxHintGotoPageFirst), pmiGotoFirstPage); + SetHint(tbGotoPrevPage, cxGetResourceString(@sdxHintGotoPagePrev), pmiGotoPrevPage); + SetHint(tbGotoNextPage, cxGetResourceString(@sdxHintGotoPageNext), pmiGotoNextPage); + SetHint(tbGotoLastPage, cxGetResourceString(@sdxHintGotoPageLast), pmiGotoLastPage); + SetHint(FseActivePage, cxGetResourceString(@sdxHintActivePage)); + + SetHint(tbHelp, cxGetResourceString(@sdxHintHelpTopics), miHelp); + SetHint(tbClose, cxGetResourceString(@sdxHintFileExit), miFileExit); +end; + +procedure TdxfmStdPreview.StyleListChanged(Sender: TObject); +begin + with ReportLink do + if Sender = StyleManager then + begin + BuildPageSetupMenu(pmPrintStyles.Items, nil, True); + BuildPageSetupMenu(miFilePrintStyles, nil, True); + BuildPageSetupMenu(pmiFilePrintStyles, nil, True); + end; +end; + +procedure TdxfmStdPreview.InitContent; +begin + inherited; + + ThumbnailsPreview.PopupMenu := pmThumbnails; + + if IsExplorerAvailable then + TControlAccess(ExplorerTree.Control).OnMouseUp := DoShowExplorerPopup; + + if ComponentPrinter <> nil then + TdxPSSpinEdit(FseActivePage).MaxValue := ReportLink.PageCount; + FcbxPredefinedZoom.Text := IntToStr(ZoomFactor) + PercentSymbol; + + if not IsExplorerAvailable then + begin + miFileSave.Caption := dxPSUtl.AddEndEllipsis(miFileSave.Caption); + miFileLoad.Caption := dxPSUtl.AddEndEllipsis(miFileLoad.Caption); + end; +end; + +function TdxfmStdPreview.CalculateWindowPos(Sender: TObject): TPoint; +var + R: TRect; +begin + if Sender is TToolButton then + begin + R := TToolButton(Sender).BoundsRect; + MapWindowPoints(ToolBar.Handle, 0, R, 2); + Result.X := R.Left; + Result.Y := R.Bottom; + end + else + Result := Preview.ClientOrigin; +end; + +procedure TdxfmStdPreview.CheckItem(AParent: TMenuItem); +var + Style: TBasedxPrintStyle; + I: Integer; + Item: TMenuItem; +begin + if CanPrintStyle then + begin + Style := ReportLink.StyleManager.CurrentStyle; + for I := 0 to AParent.Count - 1 do + begin + Item := AParent[I]; + if TTagToObj(Item.Tag) = Style then + begin + Item.Checked := True; + Exit; + end; + end; + end; +end; + +function TdxfmStdPreview.CreateLargeImages(ASource: TCustomImageList): TImageList; + + procedure DrawItem(ABitmap: TBitmap; AnImageIndex: Integer; const ASourceBounds, ADestBounds: TRect); + var + B: TBitmap; + begin + B := TBitmap.Create; + try + with ASourceBounds do + begin + B.Width := Right - Left; + B.Height := Bottom - Top; + end; + B.Canvas.Brush.Color := clFuchsia; + B.Canvas.FillRect(ASourceBounds); + ASource.Draw(B.Canvas, 0, 0, AnImageIndex); + ABitmap.Canvas.CopyRect(ADestBounds, B.Canvas, ASourceBounds); + finally + B.Free; + end; + end; + +var + DestBounds, SourceBounds: TRect; + Image: TBitmap; + I: Integer; +begin + Result := TImageList.Create(Self); + + Result.Width := 2 * ASource.Width; + Result.Height := 2 * ASource.Height; + Result.AllocBy := ASource.Count; + + DestBounds := MakeBounds(0, 0, Result.Width, Result.Height); + SourceBounds := MakeBounds(0, 0, ASource.Width, ASource.Height); + + Image := TBitmap.Create; + try + Image.Width := Result.Width; + Image.Height := Result.Height; + for I := 0 to ASource.Count - 1 do + begin + DrawItem(Image, I, SourceBounds, DestBounds); + Result.AddMasked(Image, clDefault); + end; + finally + Image.Free; + end; +end; + +procedure TdxfmStdPreview.DoAfterPrintReport(AShowDialog: Boolean); +begin + if AShowDialog then + tbPrint.Hint := cxGetResourceString(@sdxHintFilePrint) + GetCurrentPrinterAsHint; +end; + +procedure TdxfmStdPreview.DoPreviewZoomFactorChanged(APreview: TdxPreview); +begin + FcbxPredefinedZoom.Text := AddPercentSign(IntToStr(ZoomFactor)); + //FPreview.ZoomMode := pzmNone; +end; + +procedure TdxfmStdPreview.DoPreviewZoomModeChanged(APreview: TdxPreview); +begin + FcbxPredefinedZoom.Text := AddPercentSign(IntToStr(ZoomFactor)); +end; + +function TdxfmStdPreview.GetExplorerContextCommandMenuItem(Index: Integer): TMenuItem; +begin + Result := TMenuItem(FExplorerContextCommandMenuItems.Items[Index]); +end; + +function TdxfmStdPreview.GetExplorerContextCommandMenuItemCount: Integer; +begin + Result := FExplorerContextCommandMenuItems.Count; +end; + +function TdxfmStdPreview.GetExplorerContextCommandPopupMenuItem(Index: Integer): TMenuItem; +begin + Result := TMenuItem(FExplorerContextCommandPopupMenuItems.Items[Index]); +end; + +function TdxfmStdPreview.GetExplorerContextCommandPopupMenuItemCount: Integer; +begin + Result := FExplorerContextCommandPopupMenuItems.Count; +end; + +function TdxfmStdPreview.GetExplorerContextCommandToolButton(Index: Integer): TToolButton; +begin + Result := TToolButton(FExplorerContextCommandToolButtons.Items[Index]); +end; + +function TdxfmStdPreview.GetExplorerContextCommandToolButtonCount: Integer; +begin + Result := FExplorerContextCommandToolButtons.Count; +end; + +procedure TdxfmStdPreview.SetFlatCtrls(Value: Boolean); +begin + if FFlatCtrls <> Value then + begin + FFlatCtrls := Value; + SetupFlatCtrls; + if not Locked then UpdateControls; + end; +end; + +procedure TdxfmStdPreview.SetLargeBtns(Value: Boolean); +begin + if FLargeBtns <> Value then + begin + FLargeBtns := Value; + AssignToolBarImages; + ArrangeToolBarCtrls; + if not Locked then UpdateControls; + end; +end; + +procedure TdxfmStdPreview.AssignToolBarImages; +var + I: Integer; +begin + ToolBar.Images := ToolBarImages[FLargeBtns]; + with TdxZoomFactorComboEdit(FcbxPredefinedZoom) do + begin + Images := ToolBarImages[FLargeBtns]; + for I := 0 to Items.Count - 1 do + ImageIndexes[I] := ZoomItemIndexes[I]; + end; +end; + +procedure TdxfmStdPreview.ArrangeToolBarCtrls; +const + Widths: array[Boolean] of Integer = (140, 160); +begin + with ToolBar do + begin + Height := ToolBarHeight[FLargeBtns]; + ButtonWidth := ToolBtnSize[FLargeBtns].cx; + ButtonHeight := ToolBtnSize[FLargeBtns].cy; + end; + pnlZoomCbx.Width := Widths[LargeBtns]; + TdxZoomFactorComboEdit(FcbxPredefinedZoom).Width := pnlZoomCbx.Width; + TdxZoomFactorComboEdit(FcbxPredefinedZoom).Perform(CM_RECREATEWND, 0, 0); +end; + +procedure TdxfmStdPreview.SetupFlatCtrls; +begin + ToolBar.Flat := FFlatCtrls; + TdxZoomFactorComboEdit(FcbxPredefinedZoom).Flat := FFlatCtrls; + TdxPSSpinEdit(FseActivePage).Flat := FFlatCtrls; +end; + +procedure TdxfmStdPreview.miViewMarginsClick(Sender: TObject); +begin + if Locked then Exit; + ShowPageMargins := not ShowPageMargins; +end; + +procedure TdxfmStdPreview.pmiFlatBtnsClick(Sender: TObject); +begin + if Locked then Exit; + FlatCtrls := not FlatCtrls; +end; + +procedure TdxfmStdPreview.pmiLargeBtnsClick(Sender: TObject); +begin + if Locked then Exit; + LargeBtns := not LargeBtns; + if Assigned(Preview) then Preview.Invalidate; +end; + +procedure TdxfmStdPreview.miViewMarginBarClick(Sender: TObject); +begin + if Locked then Exit; + ShowMarginBar := not ShowMarginBar; +end; + +procedure TdxfmStdPreview.miViewStatusBarClick(Sender: TObject); +begin + if Locked then Exit; + ShowStatusBar := not ShowStatusBar; +end; + +procedure TdxfmStdPreview.DesignClick(Sender: TObject); +begin + tbReportDesigner.Down := True; + try + DoDesignReport; + finally + tbReportDesigner.Down := False; + end; +end; + +procedure TdxfmStdPreview.miFileRebuildClick(Sender: TObject); +begin + RebuildReport; +end; + +procedure TdxfmStdPreview.PageBackgroundClick(Sender: TObject); +begin + tbPageBackground.Down := True; + try + DoShowPageBackgroundDlg(CalculateWindowPos(Sender)); + finally + tbPageBackground.Down := False; + end; +end; + +procedure TdxfmStdPreview.pnlZoomCbxResize(Sender: TObject); +begin + with TPanel(Sender) do + FcbxPredefinedZoom.Top := (Height - FcbxPredefinedZoom.Height) div 2 + 1; +end; + +procedure TdxfmStdPreview.pnlCurrentPageResize(Sender: TObject); +begin + with TPanel(Sender) do + FseActivePage.Top := (Height - FseActivePage.Height) div 2 + 1; +end; + +procedure TdxfmStdPreview.PrintClick(Sender: TObject); +const + BtnClicked: Boolean = False; +begin + if BtnClicked then Exit; + BtnClicked := True; + try + tbPrintDialog.Down := True; + try + DoPrintReport(Boolean(TTagToInt(TComponent(Sender).Tag))); + finally + tbPrintDialog.Down := False; + end; + finally + BtnClicked := False; + end; +end; + +procedure TdxfmStdPreview.PageSetupClick(Sender: TObject); +const + BtnClicked: Boolean = False; +begin + if BtnClicked then Exit; + BtnClicked := True; + try + tbPageSetup.Down := True; + try + DoPageSetupReport(0); + finally + tbPageSetup.Down := False; + end; + finally + BtnClicked := False; + end; +end; + +procedure TdxfmStdPreview.ZoomClick(Sender: TObject); +var + PageXCount, PageYCount: Integer; + ZoomMode: TdxPreviewZoomMode; +begin + case TTagToInt(TComponent(Sender).Tag) of + 0: ZoomMode := pzmNone; + 1: ZoomMode := pzmPageWidth; + else + ZoomMode := pzmPages; + end; + PageXCount := 1; + PageYCount := 1; + if ZoomMode = pzmPages then + case TTagToInt(TComponent(Sender).Tag) of + 3: PageXCount := 2; + 4: begin + PageXCount := 2; + PageYCount := 2; + end; + 5: ReportLink.GetPageColRowCount(PageXCount, PageYCount); + end; + DoSetupZoomFactor(100, PageXCount, PageYCount, ZoomMode); +end; + +procedure TdxfmStdPreview.ShrinkToPageWidthClick(Sender: TObject); +begin + if Locked then Exit; + if ReportLink <> nil then + begin + ReportLink.ShrinkToPageWidth := not ReportLink.ShrinkToPageWidth; + DoShrinkToPageWidth(ReportLink.ShrinkToPageWidth); + end; +end; + +procedure TdxfmStdPreview.miFormatShowHideEmptyPagesClick(Sender: TObject); +begin + if Locked then Exit; + TMenuItem(Sender).Checked := not TMenuItem(Sender).Checked; + DoShowEmptyPages(TMenuItem(Sender).Checked); +end; + +procedure TdxfmStdPreview.miZoomSetupClick(Sender: TObject); +begin + DoShowZoomDlg; +end; + +procedure TdxfmStdPreview.tbMultiplePagesClick(Sender: TObject); +var + Origin: TPoint; + YShift: Integer; +begin + Origin := TToolButton(Sender).ClientOrigin; + YShift := TToolButton(Sender).Height; + + tbMultiplePages.Down := True; + try + DoShowMultiplySelectPagesDlg(ilStub, 1, Origin, YShift); + finally + tbMultiplePages.Down := False; + end; +end; + +procedure TdxfmStdPreview.GoToPageClick(Sender: TObject); +begin + case TTagToInt(TComponent(Sender).Tag) of + 0: GoToFirstPage; + 1: GoToPrevPage; + 2: GoToNextPage; + 3: GoToLastPage; + end; +end; + +procedure TdxfmStdPreview.CloseClick(Sender: TObject); +begin + Close; +end; + +procedure TdxfmStdPreview.HelpClick(Sender: TObject); +begin + DoInvokeHelp; +end; + +procedure TdxfmStdPreview.UpdateControls; +const + ButtonStyles: array[Boolean] of TToolButtonStyle = (tbsButton, tbsDropDown); +var + HasPages: Boolean; + PrevStyle: TToolButtonStyle; +begin + if Locked then Exit; + inherited; + HasPages := FPreview.PageCount > 0; + BeginUpdate; + try + { toolbar enabled } + tbReportDesigner.Enabled := CanDesign; + tbFileLoad.Enabled := CanLoadReport; + tbFileUnload.Enabled := CanUnloadReport; + tbFileSave.Enabled := CanSaveReport; + tbPrint.Enabled := CanPrint; + tbPrintDialog.Enabled := CanPrintDialog; + tbPageSetup.Enabled := CanPageSetup; + PrevStyle := tbPageSetup.Style; + tbPageSetup.Style := ButtonStyles[CanPrintStyle]; + if PrevStyle <> tbPageSetup.Style then + if tbPageSetup.Style = tbsButton then + begin + tbPageSetup.Width := ToolBtnSize[LargeBtns].cx; + SendMessage(ToolBar.Handle, CM_RECREATEWND, 0, 0); + tbPageSetup.DropDownMenu := nil; + end + else + tbPageSetup.DropDownMenu := pmPrintStyles; + + tbClose.Enabled := not IsPrinting; + + tbPageBackground.Enabled := IsEnabled(peoPageBackground) and not IsPrinting; + tbShrinkToPageWidth.Enabled := HasPages and not IsPrinting; + + tbViewExplorer.Visible := IsExplorerAvailable; + tbViewExplorer.Down := ShowExplorer; + tbViewThumbnails.Down := ShowThumbnails; + + tbPercent100.Enabled := HasPages; + tbPageWidth.Enabled := HasPages; + tbOnePage.Enabled := HasPages; + tbTwoPage.Enabled := (Preview.PageCount > 1); + tbFourPage.Enabled := (Preview.PageCount > 3); + tbMultiplePages.Enabled := HasPages; + tbWidenToSourceWidth.Enabled := HasPages and not IsPrinting; + if ReportLink <> nil then + tbShrinkToPageWidth.Down := ReportLink.ShrinkToPageWidth; + + with TdxZoomFactorComboEdit(FcbxPredefinedZoom) do + begin + Enabled := HasPages; + ItemEnabled[Items.Count - 3] := Preview.PageCount > 1; + ItemEnabled[Items.Count - 2] := Preview.PageCount > 3; + end; + + tbGoToFirstPage.Enabled := HasPages and (Preview.SelPageIndex <> 0); + tbGoToPrevPage.Enabled := HasPages and (Preview.SelPageIndex <> 0); + tbGoToNextPage.Enabled := HasPages and (Preview.SelPageIndex <> Preview.PageCount - 1); + tbGoToLastPage.Enabled := HasPages and (Preview.SelPageIndex <> Preview.PageCount - 1); + FseActivePage.Enabled := Preview.PageCount > 1; + + tbHelp.Enabled := IsEnabled(peoHelp); + + { menus enabled} + miFileDesign.Enabled := tbReportDesigner.Enabled; + miFileRebuild.Enabled := CanRebuild; + miFileSave.Enabled := tbFileSave.Enabled; + miFileLoad.Enabled := tbFileLoad.Enabled; + miFileClose.Enabled := tbFileUnload.Enabled; + miFilePrint.Enabled := tbPrint.Enabled; + miFilePageSetup.Enabled := tbPageSetup.Enabled; + miFilePrintStyles.Enabled := tbPageSetup.Enabled; + miFilePreferences.Enabled := IsEnabled(peoPreferences); + miFileExit.Enabled := tbClose.Enabled; + + if miFileDesign.Enabled and (ReportLink <> nil) then + miFileDesign.Enabled := IsEnabled(peoReportDesign) and HasPages and ReportLink.CheckToDesign; + + miExplorer.Enabled := IsExplorerAvailable; + miExplorerCreateNewFolder.Enabled := IsExplorerAvailable and ExplorerTree.CanCreateFolder; + miExplorerDelete.Enabled := IsExplorerAvailable and ExplorerTree.CanDeleteSelection; + if miExplorerDelete.Enabled then + miExplorerDelete.ShortCut := ShortCut(VK_DELETE, []) + else + miExplorerDelete.ShortCut := 0; + miExplorerRename.Enabled := IsExplorerAvailable and ExplorerTree.CanRenameSelectedItem; + miExplorerProperties.Enabled := IsExplorerAvailable and ExplorerTree.CanShowPropertySheetsForSelectedItem; + + miFormatAutoText.Enabled := IsAutoHFTextEntriesAvailable; + miFormatTitle.Enabled := ReportLink.CanChangeTitle; + miFormatPageBackground.Enabled := tbPageBackground.Enabled; + miFormatShowHideEmptyPages.Enabled := HasPages and not IsBuilding and not IsPrinting; + if ReportLink <> nil then + begin + miFormatShowHideEmptyPages.Visible := ReportLink.EmptyPagesCanExist; + miFormatShowHideEmptyPages.Checked := ReportLink.ShowEmptyPages; + end; + miFormatShrinkToPageWidth.Enabled := tbShrinkToPageWidth.Enabled; + miFormatShrinkToPageWidth.Checked := tbShrinkToPageWidth.Down; + + miViewMargins.Checked := ShowPageMargins; + miViewStatusBar.Checked := ShowStatusBar; + miViewMarginBar.Checked := ShowMarginBar; + miViewExplorer.Visible := IsExplorerAvailable; + miViewExplorer.Checked := ShowExplorer; + miViewThumbnails.Checked := ShowThumbnails; + miViewPageHeaders.Enabled := HasPages and not IsBuilding and not IsPrinting; + miViewPageFooters.Enabled := HasPages and not IsBuilding and not IsPrinting; + if ReportLink <> nil then + begin + miViewPageHeaders.Checked := ReportLink.ShowPageHeader; + miViewPageFooters.Checked := ReportLink.ShowPageFooter; + end; + + miViewZoom.Enabled := HasPages; + if miViewZoom.Enabled then + begin + miZoomPageWidth.Enabled := tbPageWidth.Enabled; + miZoomPercent100.Enabled := tbPercent100.Enabled; + miZoomWholePage.Enabled := tbOnePage.Enabled; + miZoomTwoPages.Enabled := tbTwoPage.Enabled; + miZoomFourPages.Enabled := tbFourPage.Enabled; + miZoomWidenToSourceWidth.Enabled := tbWidenToSourceWidth.Enabled; + end; + + miGoToPage.Enabled := HasPages; + miGotoFirstPage.Enabled := tbGotoFirstPage.Enabled; + miGotoPrevPage.Enabled := tbGotoPrevPage.Enabled; + miGotoNextPage.Enabled := tbGotoNextPage.Enabled; + miGotoLastPage.Enabled := tbGotoLastPage.Enabled; + + miHelp.Enabled := tbHelp.Enabled; + + if ToolBar.Visible then + begin + tbReportDesigner.Visible := IsVisible(pvoReportDesign); + tbFileLoad.Visible := IsCommandLoadReportVisible; + tbFileUnload.Visible := IsCommandUnloadReportVisible; + tbFileSave.Visible := IsCommandSaveReportVisible; + + tbSeparator1.Visible := tbReportDesigner.Visible; + + tbPrint.Visible := IsVisible(pvoPrint); + tbPrintDialog.Visible := IsVisible(pvoPrint); + tbPageSetup.Visible := IsVisible(pvoPageSetup); + tbSeparator2.Visible := (IsVisible(pvoPrint) or IsVisible(pvoPageSetup)); + + tbPageBackground.Visible := IsVisible(pvoPageBackground); + tbSeparator3.Visible := IsVisible(pvoPageBackground); + + tbHelp.Visible := IsVisible(pvoHelp); + //tbSeparator8.Visible := tbHelp.Visible; + end; + + { menus visibility } + miFileLoad.Visible := IsCommandLoadReportVisible; + miFileSave.Visible := IsCommandSaveReportVisible; + miFileClose.Visible := IsCommandUnloadReportVisible; + miFilePreferences.Visible := IsVisible(pvoPreferences); + miLine1.Visible := miFilePreferences.Visible; + + miFileDesign.Visible := IsVisible(pvoReportDesign); + miLine2.Visible := miFileDesign.Visible; + miFilePrint.Visible := tbPrint.Visible; + miFilePageSetup.Visible := tbPageSetup.Visible; + miFilePrintStyles.Visible := CanPrintStyle; + miFormatPageBackground.Visible := tbPageBackground.Visible; + miLine3.Visible := (miFilePrint.Visible or miFilePageSetup.Visible or miFilePrintStyles.Visible); + miLine13.Visible := miFormatPageBackground.Visible; + + miFormatAutoText.Visible := (ReportLink <> nil) and (ReportLink.StyleManager <> nil); + miLine14.Visible := miFormatAutoText.Visible; + + miViewMargins.Checked := (povMargins in Preview.OptionsView); + miHelp.Visible := IsVisible(pvoHelp); + + miExplorer.Visible := IsExplorerAvailable; + //miLine30.Visible := IsExplorerAvailable; + + pmiFlatBtns.Checked := FFlatCtrls; {popup} + pmiLargeBtns.Checked := FLargeBtns; {popup} + miViewFlatTBtns.Checked := FFlatCtrls; + miViewLargeTBtns.Checked := FLargeBtns; + + if ToolBar.Visible then + begin + with TdxPSSpinEdit(FseActivePage) do + if Enabled then + begin + MinValue := 1; + if ReportLink <> nil then + begin + MaxValue := ReportLink.PageCount; + Value := ReportLink.VirtualPageIndexToRealPageIndex(FPreview.SelPageIndex) + 1; + end + end + else + AsInteger := -1; + end; + + UpdateExplorerContextCommands; + finally + CancelUpdate; + end; + ToolBar.Update; +end; + +procedure TdxfmStdPreview.cbxPredefinedZoomClick(Sender: TObject); +begin + SetZoomFactorByText(FcbxPredefinedZoom.Text); + UpdateControls; + FcbxPredefinedZoom.Text := AddPercentSign(IntToStr(ZoomFactor)); +end; + +procedure TdxfmStdPreview.cbxPredefinedZoomCloseUp(Sender: TObject; AAccept: Boolean); +begin + Windows.SetFocus(Preview.Handle); +end; + +procedure TdxfmStdPreview.cbxPredefinedZoomExit(Sender: TObject); +begin + cbxPredefinedZoomClick(nil); +end; + +procedure TdxfmStdPreview.cbxPredefinedZoomKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if (Key = VK_RETURN) or (Key = VK_ESCAPE) then + Windows.SetFocus(Preview.Handle); +end; + +procedure TdxfmStdPreview.seActivePageExit(Sender: TObject); +begin + if Locked then Exit; + DoActivePageChanged(TdxPSSpinEdit(FseActivePage).AsInteger - 1); +end; + +procedure TdxfmStdPreview.seKeyPress(Sender: TObject; var Key: Char); +begin + if Key = Char(VK_RETURN) then seActivePageExit(Sender); +end; + +procedure TdxfmStdPreview.seActivePageButtonClick(Sender: TObject; + ButtonType: TdxButtonType; Button: TUDBtnType); +begin + case Button of + btNext: + GoToNextPage; + btPrev: + GoToPrevPage; + end; +end; + +procedure TdxfmStdPreview.OptionsClick(Sender: TObject); +begin + DoShowOptionsDlg; +end; + +procedure TdxfmStdPreview.SaveToRegistry(const APath: string); +begin + inherited; + SavePropertiesToRegistry(APath) +end; + +procedure TdxfmStdPreview.LoadFromRegistry(const APath: string); +begin + inherited; + LoadPropertiesFromRegistry(APath); +end; + +procedure TdxfmStdPreview.SavePropertiesToRegistry(const APath: string); + + procedure DoStore(const ARegistryPath: string); + begin + with TRegistry.Create do + try + if OpenKey(ARegistryPath, True) then + try + WriteBool(sdxFlatCtrls, FlatCtrls); + WriteBool(sdxLargeBtns, LargeBtns); + except + on ERegistryException do + else + raise; + end; + finally + Free; + end; + end; + +begin + DoStore(APath); + if IsDesignTime and (dxPSEngine.RegistryPath <> '') then + DoStore(dxPSEngine.RegistryPath); +end; + +procedure TdxfmStdPreview.DoShowExplorerPopup(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + if Button = mbRight then + pmExplorer.Popup(Mouse.CursorPos.X, Mouse.CursorPos.Y); +end; + +procedure TdxfmStdPreview.LoadPropertiesFromRegistry(const APath: string); +var + Registry: TRegistry; +begin + Registry := TRegistry.Create; + with Registry do + try + if OpenKey(APath, False) then + try + if ValueExists(sdxFlatCtrls) then + FlatCtrls := ReadBool(sdxFlatCtrls); + if ValueExists(sdxLargeBtns) then + LargeBtns := ReadBool(sdxLargeBtns); + except + on ERegistryException do + { ignore } + else + raise; + end; + finally + Free; + end; +end; + +procedure TdxfmStdPreview.pmToolBarPopup(Sender: TObject); +begin + pmiFlatBtns.Checked := FlatCtrls; + pmiLargeBtns.Checked := LargeBtns; +end; + +procedure TdxfmStdPreview.pmPreviewPopup(Sender: TObject); +begin + pmiReportDesign.Enabled := miFileDesign.Enabled; + pmiReportDesign.Visible := miFileDesign.Visible; + pmiPageSetup.Enabled := miFilePageSetup.Enabled; + pmiPageSetup.Visible := miFilePageSetup.Visible; + pmiFilePrintStyles.Visible := CanPrintStyle; + CheckItem(pmiFilePrintStyles); + miLine11.Visible := pmiReportDesign.Visible; + pmiReportShrinkToPageWidth.Checked := miFormatShrinkToPageWidth.Checked; + pmiReportShrinkToPageWidth.Enabled := miFormatShrinkToPageWidth.Enabled; + pmiZoom.Enabled := FPreview.PageCount > 0; + pmiZoomPercent100.Enabled := miZoomPercent100.Enabled; + pmiZoomPageWidth.Enabled := miZoomPageWidth.Enabled; + pmiZoomWholePage.Enabled := miZoomWholePage.Enabled; + pmiZoomTwoPages.Enabled := miZoomTwoPages.Enabled; + pmiZoomFourPages.Enabled := miZoomFourPages.Enabled; + pmiZoomWidenToSourceWidth.Enabled := miZoomWidenToSourceWidth.Enabled; + pmiGotoFirstPage.Enabled := miGotoFirstPage.Enabled; + pmiGotoPrevPage.Enabled := miGotoPrevPage.Enabled; + pmiGotoNextPage.Enabled := miGotoNextPage.Enabled; + pmiGotoLastPage.Enabled := miGotoLastPage.Enabled; +end; + +procedure TdxfmStdPreview.pmPrintStylesPopup(Sender: TObject); +begin + CheckItem(TPopupMenu(Sender).Items); +end; + +procedure TdxfmStdPreview.miFormatAutoTextClick(Sender: TObject); +begin + if IsAutoHFTextEntriesAvailable then + ReportLink.StyleManager.ShowAutoHFTextEntriesDlg; +end; + +procedure TdxfmStdPreview.miFormatDateTimeClick(Sender: TObject); +begin + DoShowFormatDateTimeDlg; +end; + +procedure TdxfmStdPreview.miFormatPageNumberingClick(Sender: TObject); +begin + DoShowFormatPageNumbersDlg; +end; + +procedure TdxfmStdPreview.miViewPageHeadersClick(Sender: TObject); +begin + if Locked then Exit; + with TMenuItem(Sender) do + begin + Checked := not Checked; + DoShowPageHeaders(Checked); + end; +end; + +procedure TdxfmStdPreview.miViewPageFootersClick(Sender: TObject); +begin + if Locked then Exit; + with TMenuItem(Sender) do + begin + Checked := not Checked; + DoShowPageFooters(Checked); + end; +end; + +procedure TdxfmStdPreview.ViewExplorerClick(Sender: TObject); +begin + if not Locked then + ShowExplorer := not ShowExplorer; +end; + +procedure TdxfmStdPreview.ViewThumbnailsClick(Sender: TObject); +begin + if not Locked then + ShowThumbnails := not ShowThumbnails; +end; + +procedure TdxfmStdPreview.Timer1Timer(Sender: TObject); +begin + tbPrint.Hint := cxGetResourceString(@sdxHintFilePrint) + GetCurrentPrinterAsHint; + TTimer(Sender).Enabled := False; +end; + +procedure TdxfmStdPreview.FileSaveClick(Sender: TObject); +const + BtnClicked: Boolean = False; +begin + if BtnClicked then Exit; + BtnClicked := True; + try + if not IsExplorerAvailable then tbFileSave.Down := True; + try + DoExplorerCreateNewItem; + finally + if not IsExplorerAvailable then tbFileSave.Down := False; + end; + finally + BtnClicked := False; + end; +end; + +procedure TdxfmStdPreview.ExplorerCreateNewFolderClick(Sender: TObject); +begin + DoExplorerCreateNewFolder; +end; + +procedure TdxfmStdPreview.ExplorerDeleteClick(Sender: TObject); +begin + DoExplorerDeleteItem; +end; + +procedure TdxfmStdPreview.ExplorerRenameClick(Sender: TObject); +begin + DoExplorerRenameItem; +end; + +procedure TdxfmStdPreview.ExplorerPropertiesClick(Sender: TObject); +begin + DoExplorerItemShowPropertySheets; +end; + +procedure TdxfmStdPreview.FileLoadClick(Sender: TObject); +const + BtnClicked: Boolean = False; +begin + if BtnClicked then Exit; + BtnClicked := True; + try + if not IsExplorerAvailable then tbFileLoad.Down := True; + try + DoExplorerLoadItemData; + finally + if not IsExplorerAvailable then tbFileLoad.Down := False; + end; + finally + BtnClicked := False; + end; +end; + +procedure TdxfmStdPreview.FileCloseClick(Sender: TObject); +begin + DoExplorerUnloadItemData; +end; + +procedure TdxfmStdPreview.pmExplorerPopup(Sender: TObject); +begin + UpdateExplorerContextCommands; + pmiExplorerLoadData.Enabled := CanLoadReport; + pmiExplorerUnloadData.Enabled := CanUnloadReport; + pmiExplorerCreateFolder.Enabled := IsExplorerAvailable and ExplorerTree.CanCreateFolder; + pmiExplorerDelete.Enabled := IsExplorerAvailable and ExplorerTree.CanDeleteSelection; + pmiExplorerRename.Enabled := IsExplorerAvailable and ExplorerTree.CanRenameSelectedItem; + pmiExplorerProperties.Enabled := IsExplorerAvailable and ExplorerTree.CanShowPropertySheetsForSelectedItem; +end; + +procedure TdxfmStdPreview.miFormatTitleClick(Sender: TObject); +begin + DoFormatTitle; +end; + +procedure TdxfmStdPreview.pmiThumbnailsSizeClick(Sender: TObject); +begin + ThumbnailsSize := TdxPSThumbnailsSize(TTagToInt(TComponent(Sender).Tag)); +end; + +procedure TdxfmStdPreview.pmThumbnailsPopup(Sender: TObject); +begin + if ThumbnailsSize = tsSmall then + pmiSmallThumbnails.Checked := True + else + pmiLargeThumbnails.Checked := True; +end; + +procedure TdxfmStdPreview.WMInitMenu(var Message: TWMInitMenu); +begin + inherited; + CheckItem(miFilePrintStyles); +end; + +initialization + dxPSRegisterPreviewWindow(TdxfmStdPreview); + +finalization + dxPSUnregisterPreviewWindow(nil); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSPrvw.pas b/official/x.35/ExpressPrinting System/Sources/dxPSPrvw.pas new file mode 100644 index 00000000..cd5a5c2d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSPrvw.pas @@ -0,0 +1,3430 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSPrVw; + +interface + +{$I cxVer.inc} + +uses + Windows, Classes, SysUtils, Messages, Controls, ExtCtrls, ComCtrls, Buttons, + ImgList, Dialogs, Forms, dxPSGlbl, dxPSCore, dxPSESys, dxPrevw, dxPSPrVwOpt, + dxPrnPg, dxExtCtrls, dxBkgnd; + +type + TfmPreviewStatusSection = (ssCurrentPage, ssPageCount, ssPaperSize, ssStatus); + TfmPreviewStatusSections = set of TfmPreviewStatusSection; + + TdxPSExplorerVisibiltyState = (evsUndefined, evsHidden, evsShown); + TdxPSThumbnailsVisibiltyState = (tvsUndefined, tvsHidden, tvsShown); + TdxPSPageMarginsVisibilityState = (mvsUndefined, mvsHidden, mvsShown); + + TdxPSPreviewWindowStatusBarMode = (psbmNormal, psbmProgress); + + TCustomdxPSPreviewWindow = class; + + TdxPSPreviewExplorerChangeNotifier = class(TdxPSExplorerChangeNotifierAdapter) + private + FPreview: TCustomdxPSPreviewWindow; + protected + procedure ItemDataLoaded(AnItem: TdxPSExplorerItem); override; + procedure ItemDataUnloaded(AnItem: TdxPSExplorerItem); override; + public + constructor Create(APreview: TCustomdxPSPreviewWindow); + property Preview: TCustomdxPSPreviewWindow read FPreview; + end; + + TCustomdxPSPreviewWindow = class(TBasedxPreviewWindow, IdxPSExplorerTreeContainerHost) + private + FBuildEventsSubscriber: TdxEventSubscriber; + FComponentPrinter: TCustomdxComponentPrinter; + FCurrentProgressValue: Integer; + FEnableOptions: TdxPreviewEnableOptions; + FFullPageCount: Integer; + FHFEditPart: TdxPageTitlePart; + FHFFunctionList: TStringList; + FHFTextEntriesChangedSubscriber: TdxEventSubscriber; + FLastOpCompleted: Integer; + FLastValidZoomFactor: Integer; + FLockPageSelection: Boolean; + FPredefinedZooms: TStringList; + FPrintEventsSubscriber: TdxEventSubscriber; + FProgressBar: TProgressBar; + FSaveExplorerPaneWidth: Integer; + FSaveExplorerVisibility: TdxPSExplorerVisibiltyState; + FSavePageMarginsVisibility: TdxPSPageMarginsVisibilityState; + FSaveThumbnailsPaneWidth: Integer; + FSaveThumbnailsVisibility: TdxPSThumbnailsVisibiltyState; + FSaveZoomPosition: Boolean; + FShowExplorer: Boolean; + FShowMarginBar: Boolean; + FShowStatusBar: Boolean; + FShowThumbnails: Boolean; + FState: TdxPSPreviewState; + FStyleEventsSubscriber: TdxEventSubscriber; + FThumbnailsSize: TdxPSThumbnailsSize; + FUpdateCount: Integer; + FVisibleOptions: TdxPreviewVisibleOptions; + function GetExplorer: TCustomdxPSExplorer; + function GetExplorerPaneWidth: Integer; + function GetFlat: Boolean; + function GetIsExplorerAvailable: Boolean; + function GetIsExplorerMode: Boolean; + function GetPrinterPage: TdxPrinterPage; + function GetProgressStatusPanel: TStatusPanel; + function GetShowMarginBar: Boolean; + function GetShowPageMargins: Boolean; + function GetShowStatusBar: Boolean; + function GetStatusTextPanel: TStatusPanel; + function GetThumbnailsPaneWidth: Integer; + procedure SetExplorerPaneWidth(Value: Integer); + procedure SetShowMarginBar(Value: Boolean); + procedure SetShowPageMargins(Value: Boolean); + procedure SetShowStatusBar(Value: Boolean); + procedure SetThumbnailsPaneWidth(Value: Integer); + + procedure DrawStatusFrame(AStatusBar: TStatusBar; var R: TRect); + procedure DrawStatusText(AStatusBar: TStatusBar; APanel: TStatusPanel; + const R: TRect; AHighlighted, AMarginBar: Boolean); + procedure FillEffectsApply(Sender: TObject); + + procedure ExplorerClose(Sender: TObject); + procedure ExplorerSplitterCanResize(Sender: TObject; var NewSize: Integer; var Accept: Boolean); + procedure ExplorerSplitterMouseUp(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + procedure ExplorerToolBarResize(Sender: TObject); + procedure MarginBarDblClick(Sender: TObject); + procedure MarginBarDrawPanel(StatusBar: TStatusBar; Panel: TStatusPanel; const Rect: TRect); + procedure PreviewAfterDragMargin(Sender: TObject; AMargin: TdxPreviewPageMargin); + procedure PreviewBeforeDragMargin(Sender: TObject; AMargin: TdxPreviewPageMargin); + procedure PreviewCalcPageCount(Sender: TObject); + procedure PreviewCanShowMarginHint(Sender: TObject; var ACanShowHint: Boolean); + procedure PreviewDblClick(Sender: TObject); + procedure PreviewDragMargin(Sender: TObject; AMargin: TdxPreviewPageMargin); + procedure PreviewMarginsChanged(Sender: TObject; AMargin: TdxPreviewPageMargin); + procedure PreviewSelectedPageChanged(Sender: TObject; APageIndex: Integer); + procedure PreviewSelectingPage(Sender: TObject; APageIndex: Integer; var ACanSelect: Boolean); + procedure PreviewZoomFactorChanged(Sender: TObject); + procedure PreviewZoomModeChanged(Sender: TObject); + procedure StatusBarDblClick(Sender: TObject); + procedure StatusBarDrawPanel(StatusBar: TStatusBar; Panel: TStatusPanel; const Rect: TRect); + procedure StatusBarMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); + procedure ThumbnailsPreviewSelectedPageChanged(Sender: TObject; APageIndex: Integer); + procedure ThumbnailsSplitterCanResize(Sender: TObject; var NewSize: Integer; var Accept: Boolean); + procedure ThumbnailsSplitterMouseUp(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + + procedure EndGenerateReport(Sender: TObject; AReportLink: TBasedxReportLink); + procedure GenerateReportProgress(Sender: TObject; AReportLink: TBasedxReportLink; APercentDone: Double); + procedure StartGenerateReport(Sender: TObject; AReportLink: TBasedxReportLink); + + procedure EndPrint(Sender: TObject; AReportLink: TBasedxReportLink); + procedure NewPage(Sender: TObject; AReportLink: TBasedxReportLink; APageIndex: Integer); + procedure StartPrint(Sender: TObject; AReportLink: TBasedxReportLink; FullPageCount: Integer); + + procedure LoadZooms; + procedure UpdateMarginBar; + procedure UpdateStatusText; + procedure WMAppCommand(var Message: TMessage); message WM_APPCOMMAND; + procedure WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); message WM_GETMINMAXINFO; + procedure WMSettingChange(var Message: TWMSettingChange); message WM_SETTINGCHANGE; + procedure WMSize(var Message: TWMSize); message WM_SIZE; + protected + FExplorerChangeNotifier: TdxPSPreviewExplorerChangeNotifier; + FExplorerCloseButton: TSpeedButton; + FExplorerPane: TPanel; + FExplorerSplitter: TSplitter; + FExplorerToolBar: TPanel; + FExplorerTree: TCustomdxPSExplorerTreeContainer; + FExplorerTreeHost: TPanel; + FMarginBar: TStatusBar; + FPreview: TdxPreview; + FPreviewPane: TPanel; + FStatusBar: TStatusBar; + FThumbnailsPane: TPanel; + FThumbnailsPreview: TdxPreview; + FThumbnailsSplitter: TSplitter; + + FAreMarginsValid: Boolean; + FReleased: Boolean; + + procedure Activate; override; + procedure DoClose(var AAction: TCloseAction); override; + procedure DoShow; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure WndProc(var message: TMessage); override; + + function GetActivePageIndex: Integer; override; + function GetBackground: TdxBackground; override; + function GetComponentPrinter: TCustomdxComponentPrinter; override; + function GetExplorerTree: TCustomdxPSExplorerTreeContainer; override; + function GetHFEditPart: TdxPageTitlePart; override; + function GetPageCount: Integer; override; + function GetPreviewEnableOptions: TdxPreviewEnableOptions; override; + function GetPreviewVisibleOptions: TdxPreviewVisibleOptions; override; + function GetSaveZoomPosition: Boolean; override; + function GetShowExplorer: Boolean; override; + function GetShowThumbnails: Boolean; override; + function GetState: TdxPSPreviewState; override; + function GetStatusPanelBounds(AStatusBar: TStatusBar; AIndex: Integer): TRect; + function GetThumbnailsSize: TdxPSThumbnailsSize; override; + function GetVisiblePageSize: TPoint; override; + function GetZoomFactor: Integer; override; + procedure SetActivePageIndex(Value: Integer); override; + procedure SetBackground(const Value: TdxBackground); override; + procedure SetComponentPrinter(const Value: TCustomdxComponentPrinter); override; + procedure SetHFEditPart(const Value: TdxPageTitlePart); override; + procedure SetPageCount(Value: Integer); override; + procedure SetPreviewEnableOptions(const Value: TdxPreviewEnableOptions); override; + procedure SetPreviewVisibleOptions(const Value: TdxPreviewVisibleOptions); override; + procedure SetSaveZoomPosition(Value: Boolean); override; + procedure SetShowExplorer(Value: Boolean); override; + procedure SetShowThumbnails(Value: Boolean); override; + procedure SetState(const Value: TdxPSPreviewState); override; + procedure SetThumbnailsSize(const Value: TdxPSThumbnailsSize); override; + procedure SetZoomFactor(Value: Integer); override; + + procedure Resize; override; + + procedure CreationComplete; override; + + procedure BeginUpdate; override; + procedure CancelUpdate; override; + procedure EndUpdate; override; + function Locked: Boolean; override; + + {$IFDEF OLEDRAGANDDROP} + function DoCanAccept: Boolean; override; + {$ENDIF} + + function CanChangeMargins: Boolean; + function CanClosePreviewWindow: Boolean; virtual; + function CanDesign: Boolean; + function CanLoadReport: Boolean; + function CanPageSetup: Boolean; + function CanPrint: Boolean; + function CanPrintDialog: Boolean; + function CanPrintStyle: Boolean; + function CanRebuild: Boolean; + function CanSaveReport: Boolean; + function CanUnloadReport: Boolean; + function IsCommandLoadReportVisible: Boolean; + function IsCommandSaveReportVisible: Boolean; + function IsCommandUnloadReportVisible: Boolean; + + procedure DoActivePageChanged(AValue: Integer); + procedure DoClearHF; + procedure DoDesignReport; + procedure DoExplorerButtonsPosUpdate; + procedure DoExplorerCreateNewFolder; + procedure DoExplorerCreateNewItem; + procedure DoExplorerDeleteItem; + function DoExplorerItemShowPropertySheets: Boolean; + procedure DoExplorerLoadItemData; + procedure DoExplorerShowToggled(Value: Boolean); + procedure DoExplorerRenameItem; + procedure DoExplorerUnloadItemData; + procedure DoFormatTitle; + procedure DoInsertHF(const S: string); + procedure DoInvokeHelp; + procedure DoLoadReportLinkDataFromFile; + procedure DoPageSetupReport(APageIndex: Integer); + procedure DoPrintReport(AShowDialog: Boolean); + procedure DoSaveReportLinkDataToFile; + procedure DoSetupZoomFactor(AZoomFactor, APageXCount, APageYCount: Integer; + AZoomMode: TdxPreviewZoomMode); + procedure DoShowEmptyPages(Value: Boolean); + procedure DoShowFormatDateTimeDlg; + procedure DoShowFormatPageNumbersDlg; + procedure DoShowHFBackgroundDlg(const Pt: TPoint); + procedure DoShowMultiplySelectPagesDlg(AImageList:TCustomImageList; + AImageIndex: Integer; const Pt: TPoint; AYShift: Integer); + procedure DoShowOptionsDlg; + procedure DoShowPageBackgroundDlg(const Pt: TPoint); + procedure DoShowPageFooters(Value: Boolean); + procedure DoShowPageHeaders(Value: Boolean); + procedure DoShowZoomDlg; + procedure DoShrinkToPageWidth(Value: Boolean); + procedure DoThumbnailsToggleShow(Value: Boolean); + procedure DoUnloadReportLinkData; + + procedure FixupPreviewWidth; + procedure PreviewPaneResize(Sender: TObject); + procedure ThumbnailsPreviewResize(Sender: TObject); + procedure UpdateThumbnailsSize; + + function IsAutoHFTextEntriesAvailable: Boolean; + function IsBuilding: Boolean; + function IsEnabled(AnOption: TdxPreviewEnableOption): Boolean; + function IsPrinting: Boolean; + function IsProgressState: Boolean; + function IsSizeGripActuallyShown: Boolean; + function IsStatusTextPanel(APanel: TStatusPanel): Boolean; + function IsVisible(AnOption: TdxPreviewVisibleOption): Boolean; + procedure InvalidateStatusPanel(AStatusBar: TStatusBar; AIndex: Integer); + procedure InvalidatePagesHeadersOrFooters; + function IsMarginValueStatusPanel(APanel: TStatusPanel): Boolean; + function MarginStatusPanel(AMargin: TdxPreviewPageMargin): TStatusPanel; + procedure PrepareProgress; + function ProgressBarGetMaxValue: Integer; + procedure ProgressBarHide; + procedure ProgressBarPlace; + procedure ProgressBarRefresh; + procedure ProgressBarShow; + procedure UnprepareProgress; + procedure RefreshStatusBar(AStatusSections: TfmPreviewStatusSections); + procedure RefreshMarginBar(AMargin: TdxPreviewPageMargin); + function SectionStatusPanel(AStatusSection: TfmPreviewStatusSection): TStatusPanel; + procedure SectionStatusPanelSetText(AStatusSection: TfmPreviewStatusSection; const AText: string); + procedure SetZoomFactorByText(const AText: string); + procedure UpdateStatusBarPanelWidths(AStatusBar: TStatusBar); + + procedure LoadPropertiesFromRegistry(const APath: string); + procedure SavePropertiesToRegistry(const APath: string); + procedure SavePreferences(AData: TdxPreviewOptionsDlgData); + + procedure CreateControls; virtual; + procedure CreateEventSubscribers; virtual; + procedure CreateExplorerPane; virtual; + procedure CreateExplorerSplitter; virtual; + procedure CreateExplorerToolBar; virtual; + procedure CreateExplorerTreeHost; virtual; + procedure CreateMarginBar; virtual; + procedure CreatePreview; virtual; + procedure CreatePreviewPane; virtual; + procedure CreateProgressBar; virtual; + procedure CreateStatusBar; virtual; + procedure CreateThumbnailsPane; virtual; + procedure CreateThumbnailsSplitter; virtual; + procedure CreateThumbnailsPreview; virtual; + procedure RefreshStatusPanels(AStatusBarMode: TdxPSPreviewWindowStatusBarMode); virtual; + + procedure DoAfterPrintReport(AShowDialog: Boolean); virtual; + procedure DoPreviewAfterDragMargin(APreview: TdxPreview; AMargin: TdxPreviewPageMargin); virtual; + procedure DoPreviewBeforeDragMargin(APreview: TdxPreview; AMargin: TdxPreviewPageMargin); virtual; + procedure DoPreviewDblClick(APreview: TdxPreview); virtual; + procedure DoPreviewDragMargin(APreview: TdxPreview; AMargin: TdxPreviewPageMargin); virtual; + procedure DoPreviewMarginChanged(APreview: TdxPreview; AMargin: TdxPreviewPageMargin); virtual; + procedure DoPreviewZoomFactorChanged(APreview: TdxPreview); virtual; + procedure DoPreviewZoomModeChanged(APreview: TdxPreview); virtual; + procedure DoShowHFToolBar(Value: Boolean); virtual; + function GetPreviewCanShowMarginHint(APreview: TdxPreview): Boolean; virtual; + procedure HFTextEntriesChanged; virtual; + procedure LoadStrings; virtual; + procedure StyleListChanged(Sender: TObject); virtual; + function ValidateMargins: Boolean; virtual; + + { IdxPSExplorerTreeContainerHost } + function IdxPSExplorerTreeContainerHost.GetFlat = IdxPSExplorerTreeContainerHost_GetFlat; + function IdxPSExplorerTreeContainerHost.GetReportLink = IdxPSExplorerTreeContainerHost_GetReportLink; + function IdxPSExplorerTreeContainerHost_GetFlat: Boolean; + function IdxPSExplorerTreeContainerHost_GetReportLink: TBasedxReportLink; + function GetTreeContainerParent: TWinControl; + procedure UpdateState; + + property HFFunctionList: TStringList read FHFFunctionList; + property PredefinedZooms: TStringList read FPredefinedZooms; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure AfterConstruction; override; + procedure BeforeDestruction; override; + function CloseQuery: Boolean; override; + + procedure GoToFirstPage; override; + procedure GoToLastPage; override; + procedure GoToNextPage; override; + procedure GoToPrevPage; override; + procedure InitContent; override; + procedure InvalidateContent; override; + procedure InvalidatePage(APageIndex: Integer); override; + procedure InvalidateAllPages; override; + procedure InvalidatePagesContent; override; + procedure InvalidatePagesHeaderContent; override; + procedure InvalidatePagesFooterContent; override; + procedure LoadFromRegistry(const APath: string); override; + procedure SaveToRegistry(const APath: string); override; + procedure UpdateControls; override; + + property Explorer: TCustomdxPSExplorer read GetExplorer; + property IsExplorerAvailable: Boolean read GetIsExplorerAvailable; + property ExplorerCloseButton: TSpeedButton read FExplorerCloseButton; + property ExplorerPane: TPanel read FExplorerPane; + property ExplorerPaneWidth: Integer read GetExplorerPaneWidth write SetExplorerPaneWidth; + property ExplorerSplitter: TSplitter read FExplorerSplitter; + property ExplorerToolBar: TPanel read FExplorerToolBar; + property ExplorerTreeHost: TPanel read FExplorerTreeHost; + property Flat: Boolean read GetFlat; + property IsExplorerMode: Boolean read GetIsExplorerMode; + property MarginBar: TStatusBar read FMarginBar; + property Preview: TdxPreview read FPreview; + property PreviewPane: TPanel read FPreviewPane; + property ProgressBar: TProgressBar read FProgressBar; + property ProgressStatusPanel: TStatusPanel read GetProgressStatusPanel; + property PrinterPage: TdxPrinterPage read GetPrinterPage; + property ShowMarginBar: Boolean read GetShowMarginBar write SetShowMarginBar; + property ShowPageMargins: Boolean read GetShowPageMargins write SetShowPageMargins; + property ShowStatusBar: Boolean read GetShowStatusBar write SetShowStatusBar; + property StatusBar: TStatusBar read FStatusBar; + property StatusTextPanel: TStatusPanel read GetStatusTextPanel; + property ThumbnailsPane: TPanel read FThumbnailsPane; + property ThumbnailsPaneWidth: Integer read GetThumbnailsPaneWidth write SetThumbnailsPaneWidth; + property ThumbnailsPreview: TdxPreview read FThumbnailsPreview; + property ThumbnailsSplitter: TSplitter read FThumbnailsSplitter; + end; + + TdxPSStatusBar = class(TStatusBar) + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure Resize; override; + end; + +function GetCurrentPrinterAsHint: string; + +function AddStatusPanel(AStatusBar: TStatusBar; AAlignment: TAlignment; + AStyle: TStatusPanelStyle; ABevel: TStatusPanelBevel; const AText: string; + AWidth: Integer): TStatusPanel; + +// runtime created component names + +const + sdxExplorerCloseButton = 'ExplorerCloseButton'; // Don't localize + sdxExplorerPane = 'ExplorerPane'; // Don't localize + sdxExplorerSplitter = 'ExplorerSplitter'; // Don't localize + sdxExplorerToolBar = 'ExplorerToolBar'; // Don't localize + sdxExplorerTreeHost = 'ExplorerTreeHost'; // Don't localize + sdxMarginBar = 'MarginBar'; // Don't localize + sdxPreviewControl = 'PreviewControl'; // Don't localize + sdxPreviewPane = 'PreviewPane'; // Don't localize + sdxProgressBar = 'ProgressBar'; // Don't localize + sdxStatusBar = 'StatusBar'; // Don't localize + sdxThumbnailsPane = 'ThumbnailsPane'; // Don't localize + sdxThumbnailsPreviewControl = 'ThumbnailsPreview'; // Don't localize + sdxThumbnailsSplitter = 'ThumbnailsSplitter'; // Don't localize + +implementation + +uses + CommCtrl, Math, Registry, Graphics, {$IFDEF DELPHI7} UxTheme, Themes, {$ENDIF} + ShlObj, ShellApi, {$IFDEF OLEDRAGANDDROP} ActiveX, {$ENDIF} cxClasses, dxPSRes, + dxPrnDev, dxPSUtl, dxPgsDlg, dxfmClr, dxfmMnPg, dxfmDTFmt, dxfmPNFmt, dxPSEngn, + dxPSExtDlgs, dxPSPopupMan, dxPSEvnt, dxfmZoom; + +type + TSplitterAccess = class(TSplitter); + +function MinPreviewSize: TPoint; +begin + Result.X := 200; + Result.Y := 200; +end; + +const + CloseGlyphIndex = 114; + DefaultExplorerPaneWidth: Integer = 220; + DefaultThumbnailsPaneWidth: Integer = 400; + PredefinedZoomValueCount: Integer = 8; + //MinPreviewSize: TPoint = (X: 200; Y: 200); + + Bevels: array[Boolean] of TStatusPanelBevel = (pbLowered, pbNone); + LookAndFeels: array[Boolean] of TdxPreviewLookAndFeel = (plfStandard, plfUltraFlat); + pssAll: TfmPreviewStatusSections = [ssCurrentPage, ssPageCount, ssPaperSize, ssStatus]; + + WMPS_UPDATEMARGINS = WM_DX + 25; + WMPS_UPDATESTATUSPROGRESS = WM_DX + 26; + + // used as registry key(value) names when storing properties in registry + + //sdxPreviewControl = 'PreviewControl'; // Don't localize + sdxShowMarginBar = 'MarginBar'; // Don't localize + sdxShowStatusBar = 'StatusBar'; // Don't localize + sdxExplorerVisibilityState = 'ExplorerVisibility'; // Don't localize + sdxExplorerPaneWidth = 'ExplorerPaneWidth'; // Don't localize + sdxThumbnailsVisibilityState = 'ThumbnailsVisibility'; // Don't localize + sdxThumbnailsPaneWidth = 'ThumbnailsPaneWidth'; // Don't localize + +var + ClosePaneGlyph: TBitmap; + +{function IsEscKeyPressed(AWnd: HWND): Boolean; +var + Msg: TMsg; +begin + Result := PeekMessage(Msg, AWnd, WM_KEYFIRST, WM_KEYLAST, PM_NOREMOVE) and + (LoWord(Msg.wParam) = VK_ESCAPE); +end;} + +{ Color Management - mostly borrowed from dxBar.pas } + +function GetActualColor(AColor: COLORREF): COLORREF; +var + DC: HDC; +begin + DC := GetDC(0); + Result := GetNearestColor(DC, AColor); + ReleaseDC(0, DC); +end; + +function GetLightColor(ABtnFaceColorPart, AHighlightColorPart, AWindowColorPart: Integer): TColor; +var + ABtnFaceColor, AHighlightColor, AWindowColor: TColor; + + function GetLightIndex(ABtnFaceValue, AHighlightValue, AWindowValue: Byte): Integer; + begin + Result := + MulDiv(ABtnFaceValue, ABtnFaceColorPart, 100) + + MulDiv(AHighlightValue, AHighlightColorPart, 100) + + MulDiv(AWindowValue, AWindowColorPart, 100); + if Result < 0 then Result := 0; + if Result > 255 then Result := 255; + end; + +begin + ABtnFaceColor := GetSysColor(COLOR_BTNFACE); + AHighlightColor := GetSysColor(COLOR_HIGHLIGHT); + AWindowColor := GetSysColor(COLOR_WINDOW); + if (ABtnFaceColor = 0) or (ABtnFaceColor = $FFFFFF) then + Result := AHighlightColor + else + Result := RGB( + GetLightIndex(GetRValue(ABtnFaceColor), GetRValue(AHighlightColor), GetRValue(AWindowColor)), + GetLightIndex(GetGValue(ABtnFaceColor), GetGValue(AHighlightColor), GetGValue(AWindowColor)), + GetLightIndex(GetBValue(ABtnFaceColor), GetBValue(AHighlightColor), GetBValue(AWindowColor))); +end; + +function GetUltraFlatButtonBorderColor: TColor; +begin + Result := GetActualColor(GetLightColor(-2, 30, 20)); +end; + +function GetUltraFlatButtonDownedColor: TColor; +begin + Result := GetActualColor(GetLightColor(14, 44, 40)); +end; + +function GetUltraFlatButtonSelColor: TColor; +begin + Result := GetActualColor(GetLightColor(-2, 30, 72)); +end; + +{ flat status bars } + +function GetFlatStatusPanelHighlightColor: TColor; +begin + Result := FindNearestColor(GetLightColor(-22, 30, 72)); +end; + +function GetFlatStatusPanelColor: TColor; +var + Offset: Byte; +begin + Offset := (255 - GetGValue(ColorToRGB(clBtnFace))) div 4; + Result := FindNearestColor(OffsetColor(clBtnFace, Offset, Offset, Offset)); +end; + +function GetStatusColor(AStatusBar: TStatusBar): TColor; +begin + Result := AStatusBar.Color; +end; + +function GetStatusPanelBkColor(AStatusBar: TStatusBar; AFlat, AHighlighted: Boolean): TColor; +begin + if AHighlighted then + if AFlat then + Result := GetFlatStatusPanelHighLightColor + else + Result := clHighLight + else + if AFlat then + Result := GetFlatStatusPanelColor + else + Result := GetStatusColor(AStatusBar); + Result := ColorToRGB(Result); +end; + +function GetStatusPanelTextColor(AStatusBar: TStatusBar; AFlat, AHighlighted: Boolean): TColor; +begin + if AFlat or not AHighlighted then + Result := AStatusBar.Font.Color + else + Result := clHighlightText; + Result := ColorToRGB(Result); +end; + +type + TdxPSExplorerToolBar = class(TPanel) + private + FFlat: Boolean; + procedure SetFlat(Value: Boolean); + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + protected + {$IFDEF DELPHI7} + procedure Paint; override; + {$ENDIF} + public + property Flat: Boolean read FFlat write SetFlat; + end; + + TdxPSExplorerCloseButton = class(TSpeedButton) + private + FUltraFlat: Boolean; + protected + procedure Paint; override; + public + property UltraFlat: Boolean read FUltraFlat write FUltraFlat; + end; + +{ TdxPSExplorerToolBar } + +{$IFDEF DELPHI7} + +procedure TdxPSExplorerToolBar.Paint; +var + Details: TThemedElementDetails; + DC: HDC; + F: HFONT; +begin + with ThemeServices do + if ThemesEnabled then + begin + Details := GetElementDetails(thHeaderItemLeftNormal); + DC := Canvas.Handle; + DrawElement(DC, Details, ClientRect, nil); + F := SelectObject(DC, Font.Handle); + DrawText(DC, Details, Caption, ClientRect, DT_LEFT or DT_VCENTER or DT_SINGLELINE, 0); + SelectObject(DC, F); + end + else + inherited; +end; + +{$ENDIF} + +procedure TdxPSExplorerToolBar.SetFlat(Value: Boolean); +begin + if FFlat <> Value then + begin + FFlat := Value; + RecreateWnd; + end; +end; + +procedure TdxPSExplorerToolBar.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + InflateRect(Message.CalcSize_Params^.rgrc[0], -1, -1); +end; + +procedure TdxPSExplorerToolBar.WMNCPaint(var Message: TWMNCPaint); +var + DC: HDC; + R: TRect; +begin + GetWindowRect(Handle, R); + OffsetRect(R, -R.Left, -R.Top); + DC := GetWindowDC(Handle); + try + if Flat then + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNSHADOW)) + else + DrawEdge(DC, R, BDR_RAISEDINNER, BF_RECT); + finally + ReleaseDC(Handle, DC); + end; +end; + +{ TdxPSExplorerCloseButton } + +procedure TdxPSExplorerCloseButton.Paint; +var + R, GlyphRect: TRect; +begin + if UltraFlat then + begin + R := ClientRect; + if MouseInControl then + Canvas.Brush.Color := GetUltraFlatButtonBorderColor + else + Canvas.Brush.Color := clBtnFace; + Canvas.FrameRect(R); + + InflateRect(R, -1, -1); + if MouseInControl then + if FState in [bsDown] then + Canvas.Brush.Color := GetUltraFlatButtonDownedColor + else + Canvas.Brush.Color := GetUltraFlatButtonSelColor + else + Canvas.Brush.Color := clBtnFace; + + Canvas.FillRect(R); + InflateRect(R, -1, -1); + + with R do + begin + Inc(Left, 1 + (Right - Left - Glyph.Width) div 2); + Inc(Top, 1 + (Bottom - Top - Glyph.Height) div 2); + Right := Left + Glyph.Width; + Bottom := Top + Glyph.Height; + end; + GlyphRect := Rect(0, 0, Glyph.Width, Glyph.Height); + Canvas.BrushCopy(R, Glyph, GlyphRect, clBtnFace); + end + else + inherited; +end; + +{ helpers } + +function GetCurrentPrinterAsHint: string; +begin + Result := dxPrintDevice.CurrentDevice; + if Result <> '' then + Result := ' (' + Result + ')'; +end; + +function AddStatusPanel(AStatusBar: TStatusBar; AAlignment: TAlignment; + AStyle: TStatusPanelStyle; ABevel: TStatusPanelBevel; const AText: string; + AWidth: Integer): TStatusPanel; +begin + Result := AStatusBar.Panels.Add; + with Result do + begin + Alignment := AAlignment; + Bevel := ABevel; + Style := AStyle; + Text := AText; + if (AWidth <> -1) and (AText <> '') then + begin + Width := AStatusBar.Canvas.TextWidth(AText); + if Width > 0 then Width := 3 + Width + 3; + if Width < AWidth then Width := AWidth; + end + else + Width := AWidth; + end; +end; + +function LoMetricToThousandthsOfInch(Value: Integer): Integer; +begin + Result := MulDiv(Value, 1000, 254); +end; + +function LoMetricToThousandthsOfMM(Value: Integer): Integer; +begin + Result := 100 * Value; +end; + +function DropPercentChar(const S: string): string; +var + I: Integer; +begin + I := Length(S); + while (I > 0) and (S[I] = PercentSymbol) do Dec(I); + Result := Copy(S, 1, I); +end; + +{ TdxPSPreviewExplorerChangeNotifier } + +constructor TdxPSPreviewExplorerChangeNotifier.Create(APreview: TCustomdxPSPreviewWindow); +begin + FPreview := APreview; + inherited Create(Preview.Explorer); +end; + +procedure TdxPSPreviewExplorerChangeNotifier.ItemDataLoaded(AnItem: TdxPSExplorerItem); +begin + Preview.UpdateControls; +end; + +procedure TdxPSPreviewExplorerChangeNotifier.ItemDataUnloaded(AnItem: TdxPSExplorerItem); +begin + Preview.UpdateControls; +end; + +{ TCustomdxPSPreviewWindow } + +constructor TCustomdxPSPreviewWindow.Create(AOwner: TComponent); +begin + inherited; + FState := prsNone; + FHFEditPart := tpLeft; + FEnableOptions := [Low(TdxPreviewEnableOption)..High(TdxPreviewEnableOption)] - [peoHelp]; + FLastValidZoomFactor := 100; + FVisibleOptions := [Low(TdxPreviewVisibleOption)..High(TdxPreviewVisibleOption)] - [pvoHelp]; + FSaveExplorerVisibility := evsUndefined; + FSavePageMarginsVisibility := mvsUndefined; + FSaveThumbnailsVisibility := tvsUndefined; + FShowExplorer := False; + FShowThumbnails := False; + FSaveExplorerPaneWidth := DefaultExplorerPaneWidth; + FSaveThumbnailsPaneWidth := DefaultThumbnailsPaneWidth; + FThumbnailsSize := tsLarge; +end; + +destructor TCustomdxPSPreviewWindow.Destroy; +begin + dxPSPopupMan.dxPSPopupMenuController.UnregisterControl(ThumbnailsPreview); + DoExplorerUnloadItemData; + FreeAndNil(FExplorerChangeNotifier); + FreeAndNil(FExplorerTree); + FreeAndNil(FHFTextEntriesChangedSubscriber); + FreeAndNil(FBuildEventsSubscriber); + FreeAndNil(FPrintEventsSubscriber); + FreeAndNil(FPredefinedZooms); + FreeAndNil(FStyleEventsSubscriber); + FreeAndNil(FHFFunctionList); + inherited; +end; + +procedure TCustomdxPSPreviewWindow.AfterConstruction; +begin + FSaveZoomPosition := True; + FShowStatusBar := True; + FShowMarginBar := True; + LoadZooms; + FHFFunctionList := TStringList.Create; + dxGetHFFunctionsList(FHFFunctionList); + CreateControls; + LoadStrings; + inherited; +end; + +procedure TCustomdxPSPreviewWindow.BeforeDestruction; +{$IFDEF OLEDRAGANDDROP} +var + DropTarget: IDropTarget; +{$ENDIF} +begin + {$IFDEF OLEDRAGANDDROP} + if Supports(TObject(Self), IDropTarget, DropTarget) then + CoLockObjectExternal(DropTarget, False, True); + RevokeDragDrop(Preview.Handle); + {$ENDIF} + inherited; +end; + +procedure TCustomdxPSPreviewWindow.Activate; +begin + ActiveControl := FPreview; + inherited; +end; + +function TCustomdxPSPreviewWindow.CloseQuery: Boolean; +begin + Result := CanClosePreviewWindow; + if Result then + Result := inherited CloseQuery; +end; + +procedure TCustomdxPSPreviewWindow.DoClose(var AAction: TCloseAction); +begin + inherited; + AAction := caFree; +end; + +procedure TCustomdxPSPreviewWindow.DoShow; +begin + inherited; + //Bug in Win2K and ComCtl32.dll since IE 5.0 ? + PostMessage(Handle, WMPS_UPDATEMARGINS, 0, 0); +end; + +procedure TCustomdxPSPreviewWindow.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited; + if (Key = VK_ESCAPE) and (ComponentPrinter <> nil) then + begin + if IsBuilding then ComponentPrinter.AbortBuilding := True; + if IsPrinting then ComponentPrinter.AbortPrinting := True; + end; +end; + +procedure TCustomdxPSPreviewWindow.WndProc(var Message: TMessage); +begin + if Message.Msg = WM_DRAWITEM then + if PDrawItemStruct(Message.lParam)^.hwndItem = StatusBar.Handle then + begin + StatusBar.Dispatch(Message); + Exit; + end; + inherited; + case message.Msg of + WMPS_UPDATEMARGINS: + UpdateMarginBar; + WMPS_UPDATESTATUSPROGRESS: + UpdateStatusText; + end; +end; + +procedure TCustomdxPSPreviewWindow.CreateControls; +{$IFDEF OLEDRAGANDDROP} +var + DropTarget: IDropTarget; +{$ENDIF} +begin + CreateProgressBar; + CreateStatusBar; + CreateExplorerPane; + CreateExplorerSplitter; + CreatePreviewPane; + CreatePreview; + CreateMarginBar; + CreateThumbnailsPane; + CreateThumbnailsSplitter; + CreateThumbnailsPreview; + + CreateEventSubscribers; + {$IFDEF OLEDRAGANDDROP} + if Supports(TObject(Self), IDropTarget, DropTarget) then + begin + RegisterDragDrop(Preview.Handle, DropTarget); + CoLockObjectExternal(DropTarget, True, False); + end; + {$ENDIF} +end; + +procedure TCustomdxPSPreviewWindow.CreateEventSubscribers; +begin + FPrintEventsSubscriber := TdxPSPrintReportSubscriber.Create([TdxPSPrintEvent]); + TdxPSPrintReportSubscriber(FPrintEventsSubscriber).OnEndPrint := EndPrint; + TdxPSPrintReportSubscriber(FPrintEventsSubscriber).OnProgressPrint := NewPage; + TdxPSPrintReportSubscriber(FPrintEventsSubscriber).OnStartPrint := StartPrint; + + FBuildEventsSubscriber := TdxPSBuildReportSubscriber.Create([TdxPSBuildEvent]); + TdxPSBuildReportSubscriber(FBuildEventsSubscriber).OnEndGenerateReport := EndGenerateReport; + TdxPSBuildReportSubscriber(FBuildEventsSubscriber).OnGenerateReportProgress := GenerateReportProgress; + TdxPSBuildReportSubscriber(FBuildEventsSubscriber).OnStartGenerateReport := StartGenerateReport; + + FStyleEventsSubscriber := TdxStyleListChangedSubscriber.Create([TdxSMStyleListChangedEvent]); + TdxStyleListChangedSubscriber(FStyleEventsSubscriber).OnStyleListChanged := StyleListChanged; + + FHFTextEntriesChangedSubscriber := TdxHFTextEntriesChangedSubscriber.Create([TdxHFTextEntriesChangedEvent]); + TdxHFTextEntriesChangedSubscriber(FHFTextEntriesChangedSubscriber).OnHFTextEntriesChanged := HFTextEntriesChanged; +end; + +procedure TCustomdxPSPreviewWindow.CreateExplorerPane; +const + BevelOuters: array[Boolean] of TBevelCut = (bvLowered, bvNone); +begin + FExplorerPane := TPanel.Create(Self); + with ExplorerPane do + begin + Parent := Self; + Align := alLeft; + BevelOuter := bvNone; + BevelOuter := BevelOuters[Flat]; + BorderStyle := bsNone; + Caption := ''; + Name := sdxExplorerPane; + end; + CreateExplorerToolBar; + CreateExplorerTreeHost; +end; + +procedure TCustomdxPSPreviewWindow.CreateExplorerSplitter; +begin + FExplorerSplitter := TSplitter.Create(Self); + with ExplorerSplitter do + begin + Parent := Self; + Align := alLeft; + Left := ExplorerPane.Left + ExplorerPane.Width + 1; + Name := sdxExplorerSplitter; + ResizeStyle := rsUpdate; + Width := 5; + + OnCanResize := ExplorerSplitterCanResize; + end; + TSplitterAccess(ExplorerSplitter).OnMouseUp := ExplorerSplitterMouseUp; +end; + +procedure TCustomdxPSPreviewWindow.CreateExplorerToolBar; + + function CalculateHeight: Integer; + var + DC: HDC; + F: HFONT; + Size: TSize; + begin + DC := GetDC(0); + try + F := SelectObject(DC, FExplorerToolBar.Font.Handle); + GetTextExtentPoint32(DC, 'Wg', 2, Size); + Result := MulDiv(Size.cY, 3, 2); + SelectObject(DC, F); + finally + ReleaseDC(0, DC); + end; + end; + + procedure DoCreateToolBar; + begin + FExplorerToolBar := TdxPSExplorerToolBar.Create(Self); + with TdxPSExplorerToolBar(FExplorerToolBar) do + begin + Parent := ExplorerPane; + Align := alTop; + Alignment := taLeftJustify; + BevelOuter := bvNone;//bvRaised; + BorderStyle := bsNone; + Caption := ' ' + cxGetResourceString(@sdxExplorerCaption); + Flat := Self.Flat; + Height := CalculateHeight; + Name := sdxExplorerToolBar; + OnResize := ExplorerToolBarResize; + end; + end; + + procedure DoCreateCloseButton; + begin + FExplorerCloseButton := TdxPSExplorerCloseButton.Create(Self); + with TdxPSExplorerCloseButton(FExplorerCloseButton) do + begin + Parent := FExplorerToolBar; + + Height := Parent.ClientHeight - 4; + Width := Height + 2; + Left := Parent.ClientWidth - Width - 1; + Top := 1; + + Flat := True; + Glyph := ClosePaneGlyph; + Hint := cxGetResourceString(@sdxCloseExplorerHint); + {$IFDEF DELPHI7} + if not ThemeServices.ThemesEnabled then + Margin := 3; + {$ELSE} + Margin := 3; + {$ENDIF} + Name := sdxExplorerCloseButton; + ShowHint := True; + Transparent := False; + UltraFlat := Self.Flat; + OnClick := ExplorerClose; + end; + end; + +begin + DoCreateToolBar; + DoCreateCloseButton; +end; + +procedure TCustomdxPSPreviewWindow.CreateExplorerTreeHost; +begin + FExplorerTreeHost := TPanel.Create(Self); + with FExplorerTreeHost do + begin + Parent := ExplorerPane; + Align := alClient; + BevelInner := bvNone; + BevelOuter := bvNone; + BorderStyle := bsNone; + Name := sdxExplorerTreeHost; + end; +end; + +procedure TCustomdxPSPreviewWindow.CreateMarginBar; +begin + FMarginBar := TdxPSStatusBar.Create(Self); + with FMarginBar do + begin + Parent := FPreviewPane; + Align := alTop; + Canvas.Font := Font; + Height := 2 * GetSystemMetrics(SM_CXBORDER) + 2 * (3 + Ord(Flat)) + Canvas.TextHeight('Wq'); + Name := sdxMarginBar; + SizeGrip := False; + + OnDblClick := MarginBarDblClick; + OnDrawPanel := MarginBarDrawPanel; + end; + + AddStatusPanel(FMarginBar, taLeftJustify, psOwnerDraw, pbNone, DropAmpersand(cxGetResourceString(@sdxMargins)), 55); + AddStatusPanel(FMarginBar, taRightJustify, psOwnerDraw, pbNone, DropAmpersand(cxGetResourceString(@sdxLeft)), 40); + AddStatusPanel(FMarginBar, taRightJustify, psOwnerDraw, Bevels[Flat], '', 70); + AddStatusPanel(FMarginBar, taRightJustify, psOwnerDraw, pbNone, DropAmpersand(cxGetResourceString(@sdxTop)), 40); + AddStatusPanel(FMarginBar, taRightJustify, psOwnerDraw, Bevels[Flat], '', 70); + AddStatusPanel(FMarginBar, taRightJustify, psOwnerDraw, pbNone, DropAmpersand(cxGetResourceString(@sdxRight)), 50); + AddStatusPanel(FMarginBar, taRightJustify, psOwnerDraw, Bevels[Flat], '', 70); + AddStatusPanel(FMarginBar, taRightJustify, psOwnerDraw, pbNone, DropAmpersand(cxGetResourceString(@sdxBottom)), 60); + AddStatusPanel(FMarginBar, taRightJustify, psOwnerDraw, Bevels[Flat], '', 70); + AddStatusPanel(FMarginBar, taRightJustify, psOwnerDraw, pbNone, DropAmpersand(cxGetResourceString(@sdxHeader2)), 50); + AddStatusPanel(FMarginBar, taRightJustify, psOwnerDraw, Bevels[Flat], '', 70); + AddStatusPanel(FMarginBar, taRightJustify, psOwnerDraw, pbNone, DropAmpersand(cxGetResourceString(@sdxFooter2)), 50); + AddStatusPanel(FMarginBar, taRightJustify, psOwnerDraw, Bevels[Flat], '', 70); + AddStatusPanel(FMarginBar, taRightJustify, psOwnerDraw, pbNone, '', -1); +end; + +procedure TCustomdxPSPreviewWindow.CreatePreview; +begin + FPreview := TdxPreview.Create(Self); + with FPreview do + begin + Parent := FPreviewPane; + Align := alClient; + LookAndFeel := LookAndFeels[Flat]; + if IsWin95Or98 then + OptionsBehavior := OptionsBehavior - [pobThumbTracking]; + Name := sdxPreviewControl; + OnCanShowMarginHint := PreviewCanShowMarginHint; + OnDblClick := PreviewDblClick; + OnSelectingPage := PreviewSelectingPage; + + TdxPreviewPageBackground(PageBackground).OnApply := FillEffectsApply; + end; +end; + +procedure TCustomdxPSPreviewWindow.CreatePreviewPane; +begin + FPreviewPane := TPanel.Create(Self); + with FPreviewPane do + begin + Parent := Self; + Align := alClient; + BevelInner := bvNone; + BevelOuter := bvNone; + Caption := ''; + Name := sdxPreviewPane; + + OnResize := PreviewPaneResize; + end; +end; + +procedure TCustomdxPSPreviewWindow.CreateProgressBar; +begin + FProgressBar := TProgressBar.Create(Self); + with ProgressBar do + begin + Name := sdxProgressBar; + BorderWidth := 2; + end; +end; + +procedure TCustomdxPSPreviewWindow.CreateStatusBar; +begin + FStatusBar := TdxPSStatusBar.Create(Self); + with FStatusBar do + begin + Parent := Self; + Canvas.Font := Font; + Height := 2 * GetSystemMetrics(SM_CXBORDER) + 2 * (3 + Ord(Flat)) + Canvas.TextHeight('Wq'); + ShowHint := True; + Name := sdxStatusBar; + end; + RefreshStatusPanels(psbmNormal); +end; + +procedure TCustomdxPSPreviewWindow.CreateThumbnailsPane; +begin + FThumbnailsPane := TPanel.Create(Self); + with ThumbnailsPane do + begin + Parent := PreviewPane; + + Align := alRight; + BevelInner := bvNone; + BevelOuter := bvNone; + Caption := ''; + Name := sdxThumbnailsPane; + + OnResize := ThumbnailsPreviewResize; + end; +end; + +procedure TCustomdxPSPreviewWindow.CreateThumbnailsSplitter; +begin + FThumbnailsSplitter := TSplitter.Create(Self); + with ThumbnailsSplitter do + begin + Parent := PreviewPane; + Align := alRight; + Left := FThumbnailsPane.Left - 1; + ResizeStyle := rsUpdate; + Width := 5; + Name := sdxThumbnailsSplitter; + + OnCanResize := ThumbnailsSplitterCanResize; + end; + TSplitterAccess(ThumbnailsSplitter).OnMouseUp := ThumbnailsSplitterMouseUp; +end; + +procedure TCustomdxPSPreviewWindow.CreateThumbnailsPreview; +begin + FThumbnailsPreview := TdxPreview.Create(Self); + with ThumbnailsPreview do + begin + Parent := FThumbnailsPane; + Align := alClient; + LookAndFeel := LookAndFeels[Flat]; + MinZoomFactor := 5; + Name := sdxThumbnailsPreviewControl; + OptionsBehavior := OptionsBehavior + [pobNonCenterizePages]; + if IsWin95Or98 then + OptionsBehavior := OptionsBehavior - [pobThumbTracking]; + OptionsView := OptionsView - [povMargins]; + OptionsZoom := OptionsZoom - [pozZoomOnClick]; + SelectionFrameThickness := 4; + ZoomFactor := dxThumbnailsZoomFactors[ThumbnailsSize]; + + OnSelectedPageChanged := ThumbnailsPreviewSelectedPageChanged; + OnSelectingPage := PreviewSelectingPage; + end; +end; + +procedure TCustomdxPSPreviewWindow.RefreshStatusPanels(AStatusBarMode: TdxPSPreviewWindowStatusBarMode); + + function GetProgressModeCaption: string; + begin + if IsBuilding then + Result := cxGetResourceString(@sdxBuildingReportStatusText) + else + if IsPrinting then + Result := cxGetResourceString(@sdxPrintingReportStatusText) + else + Result := ''; + end; + +begin + StatusBar.Panels.Clear; + StatusBar.Panels.BeginUpdate; + try + case AStatusBarMode of + psbmNormal: + begin + AddStatusPanel(StatusBar, taRightJustify, psOwnerDraw, pbNone, DropAmpersand(cxGetResourceString(@sdxPage)) + ':', 40); + AddStatusPanel(StatusBar, taRightJustify, psOwnerDraw, Bevels[Flat], '', 45); + AddStatusPanel(StatusBar, taCenter, psOwnerDraw, pbNone, cxGetResourceString(@sdxOf), 30); + AddStatusPanel(StatusBar, taRightJustify, psOwnerDraw, Bevels[Flat], '', 45); + AddStatusPanel(StatusBar, taLeftJustify, psOwnerDraw, pbNone, cxGetResourceString(@sdxPages), 50); + AddStatusPanel(StatusBar, taLeftJustify, psOwnerDraw, Bevels[Flat], '', 4); + AddStatusPanel(StatusBar, taRightJustify, psOwnerDraw, pbNone, cxGetResourceString(@sdxPaperSize), 80); + AddStatusPanel(StatusBar, taLeftJustify, psOwnerDraw, Bevels[Flat], '', 150); + AddStatusPanel(StatusBar, taRightJustify, psOwnerDraw, pbNone, cxGetResourceString(@sdxStatus), 60); + AddStatusPanel(StatusBar, taLeftJustify, psOwnerDraw, Bevels[Flat], cxGetResourceString(@sdxStatusReady), -1); + + StatusBar.OnDblClick := StatusBarDblClick; + StatusBar.OnDrawPanel := StatusBarDrawPanel; + StatusBar.OnMouseMove := StatusBarMouseMove; + end; + + psbmProgress: + begin + // !!! Update GetProgressStatusPanel in case of change ProgressBar Site Index + + //AddStatusPanel(StatusBar, taLeftJustify, psText, pbNone, GetProgressModeCaption, 2); + AddStatusPanel(StatusBar, taLeftJustify, psText, pbNone, '', 300); //ProgressBar Site + AddStatusPanel(StatusBar, taLeftJustify, psText, pbNone, GetProgressModeCaption, -1); + //AddStatusPanel(StatusBar, taLeftJustify, psText, pbNone, cxGetResourceString(@sdxPressEscToCancel), -1); + StatusBar.OnDblClick := nil; + StatusBar.OnDrawPanel := nil; + StatusBar.OnMouseMove := nil; + end; + end; + finally + StatusBar.Panels.EndUpdate; + end; + StatusBar.Refresh; +end; + +procedure TCustomdxPSPreviewWindow.BeginUpdate; +begin + Preview.BeginUpdate; + Inc(FUpdateCount); +end; + +procedure TCustomdxPSPreviewWindow.CancelUpdate; +begin + if FUpdateCount <> 0 then + begin + Preview.CancelUpdate; + Dec(FUpdateCount); + end; +end; + +procedure TCustomdxPSPreviewWindow.EndUpdate; +begin + if FUpdateCount <> 0 then + begin + Preview.EndUpdate; + Dec(FUpdateCount); + if FUpdateCount = 0 then UpdateControls; + end; +end; + +function TCustomdxPSPreviewWindow.Locked: Boolean; +begin + Result := FUpdateCount <> 0; +end; + +{$IFDEF OLEDRAGANDDROP} +function TCustomdxPSPreviewWindow.DoCanAccept: Boolean; +begin + Result := inherited DoCanAccept and IsVisible(pvoReportFileOperations); +end; +{$ENDIF} + +procedure TCustomdxPSPreviewWindow.LoadZooms; +begin + FPredefinedZooms := TStringList.Create; + with FPredefinedZooms do + begin + AddObject('500' + PercentSymbol, TObject(Integer(500))); + AddObject('200' + PercentSymbol, TObject(Integer(200))); + AddObject('150' + PercentSymbol, TObject(Integer(150))); + AddObject('100' + PercentSymbol, TObject(Integer(100))); + AddObject( '75' + PercentSymbol, TObject(Integer(75))); + AddObject( '50' + PercentSymbol, TObject(Integer(50))); + AddObject( '25' + PercentSymbol, TObject(Integer(25))); + AddObject( '10' + PercentSymbol, TObject(Integer(10))); + AddObject(cxGetResourceString(@sdxPageWidth), TObject(Integer(-1))); + AddObject(cxGetResourceString(@sdxWholePage), TObject(Integer(-1))); + AddObject(cxGetResourceString(@sdxTwoPages), TObject(Integer(-1))); + AddObject(cxGetResourceString(@sdxFourPages), TObject(Integer(-1))); + AddObject(cxGetResourceString(@sdxWidenToSourceWidth), TObject(Integer(-1))); + end; +end; + +function TCustomdxPSPreviewWindow.CanClosePreviewWindow: Boolean; +begin + Result := True; + if not FReleased and (ComponentPrinter <> nil) then + begin + Result := not (IsBuilding or IsPrinting) or Application.Terminated; + FReleased := not Application.Terminated and + (IsBuilding or (IsPrinting and MessageQuestion(cxGetResourceString(@sdxAbortPrinting)))); + if FReleased then ComponentPrinter.AbortPrinting := True; {1. - Abort} + end; +end; + +function TCustomdxPSPreviewWindow.GetActivePageIndex: Integer; +begin + if Preview <> nil then + Result := Preview.SelPageIndex + else + Result := 0; +end; + +function TCustomdxPSPreviewWindow.GetBackground: TdxBackground; +begin + if Preview <> nil then + Result := Preview.PageBackground + else + Result := nil; +end; + +function TCustomdxPSPreviewWindow.GetComponentPrinter: TCustomdxComponentPrinter; +begin + Result := FComponentPrinter; +end; + +function TCustomdxPSPreviewWindow.GetExplorerTree: TCustomdxPSExplorerTreeContainer; +begin + Result := FExplorerTree; +end; + +function TCustomdxPSPreviewWindow.GetState: TdxPSPreviewState; +begin + Result := FState; +end; + +function TCustomdxPSPreviewWindow.GetStatusPanelBounds(AStatusBar: TStatusBar; + AIndex: Integer): TRect; +begin + AStatusBar.Perform(SB_GETRECT, AIndex, Integer(@Result)); +end; + +function TCustomdxPSPreviewWindow.GetThumbnailsSize: TdxPSThumbnailsSize; +begin + Result := FThumbnailsSize; +end; + +function TCustomdxPSPreviewWindow.GetVisiblePageSize: TPoint; +begin + if Preview <> nil then + Result := Preview.VisiblePageSize + else + Result := Point(0, 0); +end; + +function TCustomdxPSPreviewWindow.GetZoomFactor: Integer; +begin + if Preview <> nil then + Result := Preview.ZoomFactor + else + Result := 100; +end; + +function TCustomdxPSPreviewWindow.GetExplorer: TCustomdxPSExplorer; +begin + if ComponentPrinter <> nil then + Result := ComponentPrinter.Explorer + else + Result := nil; +end; + +function TCustomdxPSPreviewWindow.GetExplorerPaneWidth: Integer; +begin + if ExplorerPane <> nil then + Result := ExplorerPane.Width + else + Result := 0; +end; + +function TCustomdxPSPreviewWindow.GetFlat: Boolean; +begin + Result := (dxPSEngine.LookAndFeel in [pslfFlat, pslfOffice11]) + {$IFDEF DELPHI7} + and (not dxPSEngine.UseNativeLookAndFeel or not ThemeServices.ThemesEnabled) + {$ENDIF}; +end; + +function TCustomdxPSPreviewWindow.GetIsExplorerAvailable: Boolean; +begin + Result := Explorer <> nil; +end; + +function TCustomdxPSPreviewWindow.GetIsExplorerMode: Boolean; +begin + Result := (ComponentPrinter <> nil) and (ComponentPrinter.Explorer <> nil);//Mode = cpmExplorer); +end; + +function TCustomdxPSPreviewWindow.GetPrinterPage: TdxPrinterPage; +begin + if ReportLink <> nil then + Result := ReportLink.RealPrinterPage + else + Result := nil; +end; + +function TCustomdxPSPreviewWindow.GetPreviewEnableOptions: TdxPreviewEnableOptions; +begin + Result := FEnableOptions; +end; + +function TCustomdxPSPreviewWindow.GetPreviewVisibleOptions: TdxPreviewVisibleOptions; +begin + Result := FVisibleOptions; +end; + +function TCustomdxPSPreviewWindow.GetHFEditPart: TdxPageTitlePart; +begin + Result := FHFEditPart; +end; + +function TCustomdxPSPreviewWindow.GetPageCount: Integer; +begin + if Preview <> nil then + Result := Preview.PageCount + else + Result := 0; +end; + +function TCustomdxPSPreviewWindow.GetSaveZoomPosition: Boolean; +begin + Result := FSaveZoomPosition; +end; + +function TCustomdxPSPreviewWindow.GetShowExplorer: Boolean; +begin + Result := FShowExplorer; +end; + +function TCustomdxPSPreviewWindow.GetShowThumbnails: Boolean; +begin + Result := FShowThumbnails; +end; + +function TCustomdxPSPreviewWindow.GetProgressStatusPanel: TStatusPanel; +begin + //with StatusBar do + Result := StatusBar.Panels[0]; +end; + +function TCustomdxPSPreviewWindow.GetShowMarginBar: Boolean; +begin + Result := FShowMarginBar; +end; + +function TCustomdxPSPreviewWindow.GetShowPageMargins: Boolean; +begin + Result := pvoPageMargins in VisibleOptions; +end; + +function TCustomdxPSPreviewWindow.GetShowStatusBar: Boolean; +begin + Result := FShowStatusBar; +end; + +function TCustomdxPSPreviewWindow.GetStatusTextPanel: TStatusPanel; +begin + with StatusBar do + Result := Panels[Panels.Count - 1]; +end; + +function TCustomdxPSPreviewWindow.GetThumbnailsPaneWidth: Integer; +begin + if ThumbnailsPane <> nil then + Result := ThumbnailsPane.Width + else + Result := 0; +end; + +procedure TCustomdxPSPreviewWindow.SetActivePageIndex(Value: Integer); +begin + if Preview <> nil then + Preview.SelPageIndex := Value; +end; + +procedure TCustomdxPSPreviewWindow.SetState(const Value: TdxPSPreviewState); +begin + FState := Value; +end; + +procedure TCustomdxPSPreviewWindow.SetThumbnailsSize(const Value: TdxPSThumbnailsSize); +begin + if FThumbnailsSize <> Value then + begin + FThumbnailsSize := Value; + UpdateThumbnailsSize; + UpdateControls; + end; +end; + +procedure TCustomdxPSPreviewWindow.SetZoomFactor(Value: Integer); +begin + if Preview <> nil then + Preview.ZoomFactor := Value; +end; + +procedure TCustomdxPSPreviewWindow.CreationComplete; +begin + inherited; + if FSavePageMarginsVisibility <> mvsUndefined then + ShowPageMargins := FSavePageMarginsVisibility = mvsShown; +end; + +procedure TCustomdxPSPreviewWindow.Resize; +begin + inherited Resize; + if FStatusBar <> nil then + FStatusBar.Invalidate; +end; + +procedure TCustomdxPSPreviewWindow.SetBackground(const Value: TdxBackground); +begin + if Preview <> nil then + Preview.PageBackground := Value; + UpdateControls; +end; + +procedure TCustomdxPSPreviewWindow.SetComponentPrinter(const Value: TCustomdxComponentPrinter); +var + ExplorerTreeContainerHost: IdxPSExplorerTreeContainerHost; + ExplorerContextCommands: IdxPSExplorerContextCommands; + ExplorerContextCommandBuilder: IdxPSExplorerContextCommandBuilder; +begin + FComponentPrinter := Value; + if ComponentPrinter = nil then Exit; + + { Preview } + SaveZoomPosition := ComponentPrinter.PreviewOptions.SaveZoomPosition; + with Preview do + begin + OnDrawPageContent := PaintPage; + OnCalcPageCount := PreviewCalcPageCount; + OnSelectedPageChanged := PreviewSelectedPageChanged; + OnAfterDragMargin := PreviewAfterDragMargin; + OnBeforeDragMargin := PreviewBeforeDragMargin; + OnDragMargin := PreviewDragMargin; + OnMarginChanged := PreviewMarginsChanged; + OnZoomFactorChanged := PreviewZoomFactorChanged; + OnZoomModeChanged := PreviewZoomModeChanged; + end; + + { Thumbnails } + with ThumbnailsPreview do + begin + OnDrawPageContent := PaintThumbnailPage; + OnCalcPageCount := PreviewCalcPageCount; + end; + if FSaveThumbnailsPaneWidth <> -1 then + ThumbnailsPaneWidth := FSaveThumbnailsPaneWidth; + ShowThumbnails := FSaveThumbnailsVisibility = tvsShown; + DoThumbnailsToggleShow(ShowThumbnails); + + { Explorer } + ExplorerPane.Visible := IsExplorerAvailable; + if FSaveExplorerPaneWidth <> -1 then + ExplorerPaneWidth := FSaveExplorerPaneWidth; + FExplorerSplitter.Visible := IsExplorerAvailable; + if IsExplorerAvailable and Supports(TObject(Self), IdxPSExplorerTreeContainerHost, ExplorerTreeContainerHost) then + begin + FExplorerTree := Explorer.CreateTree(ExplorerTreeContainerHost); + Explorer.BuildTree(ExplorerTree); + FExplorerChangeNotifier := TdxPSPreviewExplorerChangeNotifier.Create(Self); + end; + if IsExplorerAvailable and + Supports(TObject(Explorer), IdxPSExplorerContextCommands, ExplorerContextCommands) and + Supports(TObject(Self), IdxPSExplorerContextCommandBuilder, ExplorerContextCommandBuilder) then + ExplorerContextCommands.BuildCommandSet(ExplorerContextCommandBuilder); + + ShowExplorer := IsExplorerAvailable and (FSaveExplorerVisibility = evsShown); + DoExplorerShowToggled(ShowExplorer); + + InitContent; + UpdateControls; + FAreMarginsValid := ValidateMargins; + StyleListChanged(ReportLink.StyleManager); +end; + +procedure TCustomdxPSPreviewWindow.SetHFEditPart(const Value: TdxPageTitlePart); +begin + FHFEditPart := Value; +end; + +procedure TCustomdxPSPreviewWindow.SetPageCount(Value: Integer); +begin + if Preview <> nil then + Preview.PageCount := Value; + if ThumbnailsPreview <> nil then + ThumbnailsPreview.PageCount := Value; +end; + +procedure TCustomdxPSPreviewWindow.SetPreviewEnableOptions(const Value: TdxPreviewEnableOptions); +begin + FEnableOptions := Value; + if (ReportLink <> nil) and not ReportLink.CheckToDesign then + FEnableOptions := FEnableOptions - [peoReportDesign]; + UpdateControls; +end; + +procedure TCustomdxPSPreviewWindow.SetPreviewVisibleOptions(const Value: TdxPreviewVisibleOptions); +begin + FVisibleOptions := Value; + if FPreview <> nil then + begin + with FPreview do + if pvoPageMargins in FVisibleOptions then + OptionsView := OptionsView + [povMargins] + else + OptionsView := OptionsView - [povMargins]; + UpdateControls; + end; +end; + +procedure TCustomdxPSPreviewWindow.SetSaveZoomPosition(Value: Boolean); +begin + FSaveZoomPosition := Value; + if FPreview <> nil then + if SaveZoomPosition then + FPreview.OptionsStore := FPreview.OptionsStore + [posZoom] + else + FPreview.OptionsStore := FPreview.OptionsStore - [posZoom]; +end; + +procedure TCustomdxPSPreviewWindow.SetShowExplorer(Value: Boolean); +begin + if IsExplorerAvailable then + begin + if FShowExplorer <> Value then + begin + FShowExplorer := Value; + DoExplorerShowToggled(FShowExplorer); + end; + end + else + FShowExplorer := False; +end; + +procedure TCustomdxPSPreviewWindow.SetShowThumbnails(Value: Boolean); +begin + if FShowThumbnails <> Value then + begin + FShowThumbnails := Value; + DoThumbnailsToggleShow(FShowThumbnails); + end; +end; + +procedure TCustomdxPSPreviewWindow.SetExplorerPaneWidth(Value: Integer); +begin + if ExplorerPane <> nil then + ExplorerPane.Width := Value; +end; + +procedure TCustomdxPSPreviewWindow.SetShowMarginBar(Value: Boolean); +begin + if FShowMarginBar <> Value then + begin + FShowMarginBar := Value; + if not (csLoading in ComponentState) then UpdateControls; + end; +end; + +procedure TCustomdxPSPreviewWindow.SetShowPageMargins(Value: Boolean); +begin + if (pvoPageMargins in VisibleOptions) <> Value then + if Value then + VisibleOptions := VisibleOptions + [pvoPageMargins] + else + VisibleOptions := VisibleOptions - [pvoPageMargins]; +end; + +procedure TCustomdxPSPreviewWindow.SetShowStatusBar(Value: Boolean); +begin + if FShowStatusBar <> Value then + begin + FShowStatusBar := Value; + UpdateControls; + end; +end; + +procedure TCustomdxPSPreviewWindow.SetThumbnailsPaneWidth(Value: Integer); +begin + if ThumbnailsPane <> nil then + ThumbnailsPane.Width := Value; +end; + +procedure TCustomdxPSPreviewWindow.GoToFirstPage; +begin + if Preview <> nil then + Preview.SelectFirstPage; +end; + +procedure TCustomdxPSPreviewWindow.GoToLastPage; +begin + if Preview <> nil then + Preview.SelectLastPage; +end; + +procedure TCustomdxPSPreviewWindow.GoToNextPage; +begin + if Preview <> nil then + Preview.SelectNextPage; +end; + +procedure TCustomdxPSPreviewWindow.GoToPrevPage; +begin + if Preview <> nil then + Preview.SelectPrevPage; +end; + +procedure TCustomdxPSPreviewWindow.HFTextEntriesChanged; +begin +end; + +procedure TCustomdxPSPreviewWindow.LoadStrings; +begin + with FStatusBar do + begin + Panels[0].Text := DropAmpersand(cxGetResourceString(@sdxPage)) + ':'; + Panels[2].Text := LowerCase(cxGetResourceString(@sdxOf)); + Panels[4].Text := cxGetResourceString(@sdxPages); + Panels[6].Text := cxGetResourceString(@sdxPaperSize); + Panels[8].Text := cxGetResourceString(@sdxStatus); + Panels[9].Text := cxGetResourceString(@sdxStatusReady); + end; +end; + +procedure TCustomdxPSPreviewWindow.StyleListChanged(Sender: TObject); +begin +end; + +function TCustomdxPSPreviewWindow.ValidateMargins: Boolean; +begin + Result := (PrinterPage = nil) or PrinterPage.ValidateMargins; +end; + +{ IdxPSExplorerTreeContainerHost } + +function TCustomdxPSPreviewWindow.IdxPSExplorerTreeContainerHost_GetFlat: Boolean; +begin + Result := Flat; +end; + +function TCustomdxPSPreviewWindow.IdxPSExplorerTreeContainerHost_GetReportLink: TBasedxReportLink; +begin + Result := Self.ReportLink; +end; + +function TCustomdxPSPreviewWindow.GetTreeContainerParent: TWinControl; +begin + Result := FExplorerTreeHost; +end; + +procedure TCustomdxPSPreviewWindow.UpdateState; +var + Item: TCustomdxPSExplorerItem; +begin + if not (csDestroying in ComponentState) then + begin + Item := ExplorerTree.FocusedItem; + if Item is TdxPSExplorerFolder then + ComponentPrinter.Explorer.ActiveFolder := TdxPSExplorerFolder(Item) + else + ComponentPrinter.Explorer.ActiveFolder := nil; + UpdateControls; + end; +end; + +procedure TCustomdxPSPreviewWindow.InitContent; +const + PreviewPaperOrientationMap: array[TdxPrinterOrientation] of TdxPreviewPaperOrientation = (ppoPortrait, ppoLandscape); +var + Link: TBasedxReportLink; + Page: TdxPrinterPage; + R: TRect; +begin + Link := ReportLink; + Page := PrinterPage; + FPreview.OriginalPageSize.Point := Page.PageSizeLoMetric; + if not Page.AutoSwapMargins then + FPreview.OptionsBehavior := FPreview.OptionsBehavior - [pobAutoSwapMargins]; + FPreview.Orientation := TdxPreviewPaperOrientation(Page.Orientation); + FPreview.MinUsefulSize := Point(Page.MinPrintableAreaLoMetric, Page.MinPrintableAreaLoMetric); + FPreview.PageCount := Link.VisiblePageCount; + if FThumbnailsPreview <> nil then + begin + FThumbnailsPreview.PageCount := Link.VisiblePageCount; + FThumbnailsPreview.Orientation := PreviewPaperOrientationMap[Link.RealPrinterPage.Orientation]; + end; + FPreview.MaxZoomFactor := 500; + FPreview.MinZoomFactor := 10; + FPreview.MinHeaderSize := 0; + FPreview.MinFooterSize := 0; + + FPreview.MeasurementUnits := TdxPreviewMeasurementUnits(Page.MeasurementUnits); + R := Page.MinMarginsLoMetric; + FPreview.Margins.Left.MinValue := R.Left; + FPreview.Margins.Top.MinValue := R.Top; + FPreview.Margins.Right.MinValue := R.Right; + FPreview.Margins.Bottom.MinValue := R.Bottom; + + R := Page.MarginsLoMetric; + FPreview.Margins.Header.Value := Page.HeaderLoMetric; + FPreview.Margins.Footer.Value := Page.FooterLoMetric; + FPreview.Margins.Left.Value := R.Left; + FPreview.Margins.Top.Value := R.Top; + FPreview.Margins.Right.Value := R.Right; + FPreview.Margins.Bottom.Value := R.Bottom; + FPreview.MinFooterSize := 0; + FPreview.MinHeaderSize := 0; + FPreview.PageBackground := Page.Background; + + if not SaveZoomPosition then FPreview.ZoomFactor := 100; + HFTextEntriesChanged; + + UpdateStatusText; +end; + +procedure TCustomdxPSPreviewWindow.InvalidateContent; +begin + if Preview <> nil then Preview.Invalidate; + if ThumbnailsPreview <> nil then ThumbnailsPreview.Invalidate; +end; + +procedure TCustomdxPSPreviewWindow.InvalidatePage(APageIndex: Integer); +begin + if Preview <> nil then + Preview.InvalidatePage(APageIndex); + if ThumbnailsPreview <> nil then + ThumbnailsPreview.InvalidatePage(APageIndex); +end; + +procedure TCustomdxPSPreviewWindow.InvalidateAllPages; +begin + if Preview <> nil then + Preview.InvalidatePages; + if ThumbnailsPreview <> nil then + ThumbnailsPreview.InvalidatePages; +end; + +procedure TCustomdxPSPreviewWindow.InvalidatePagesContent; +begin + if Preview <> nil then + Preview.InvalidatePagesContent; + if ThumbnailsPreview <> nil then + ThumbnailsPreview.InvalidatePagesContent; +end; + +procedure TCustomdxPSPreviewWindow.InvalidatePagesHeaderContent; +begin + if Preview <> nil then + Preview.InvalidatePagesHeader; + if ThumbnailsPreview <> nil then + ThumbnailsPreview.InvalidatePagesHeader; +end; + +procedure TCustomdxPSPreviewWindow.InvalidatePagesFooterContent; +begin + if Preview <> nil then + Preview.InvalidatePagesFooter; + if ThumbnailsPreview <> nil then + ThumbnailsPreview.InvalidatePagesFooter; +end; + +procedure TCustomdxPSPreviewWindow.UpdateControls; +begin + if Locked then Exit; + inherited; + BeginUpdate; + try + if CanChangeMargins then + Preview.OptionsBehavior := Preview.OptionsBehavior + [pobAllowDragMargins] + else + Preview.OptionsBehavior := Preview.OptionsBehavior - [pobAllowDragMargins]; + + RefreshStatusBar(pssAll); + RefreshMarginBar(nil); + + FMarginBar.Visible := ShowMarginBar; + FStatusBar.Visible := ShowStatusBar; + FMarginBar.ShowHint := CanChangeMargins; + + //if ComponentPrinter <> nil then + // Preview.Enabled := not (cpsPrinting in ComponentPrinter.State); + finally + CancelUpdate; + end; +end; + +// event handlers + +procedure TCustomdxPSPreviewWindow.ExplorerClose(Sender: TObject); +begin + ShowExplorer := False; +end; + +procedure TCustomdxPSPreviewWindow.ExplorerSplitterCanResize(Sender: TObject; + var NewSize: Integer; var Accept: Boolean); + + function CalculateNewSize: Integer; + begin + Result := ExplorerSplitter.Parent.ClientWidth - MinPreviewSize.X - ExplorerSplitter.Width; + end; + +var + Size: Integer; +begin + Accept := PreviewPane.Width >= MinPreviewSize.X; + Size := CalculateNewSize; + if NewSize > Size then + NewSize := Size; +end; + +procedure TCustomdxPSPreviewWindow.ExplorerSplitterMouseUp(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + if ExplorerPane.Width <> 0 then + FSaveExplorerPaneWidth := ExplorerPane.Width; +end; + +procedure TCustomdxPSPreviewWindow.ExplorerToolBarResize(Sender: TObject); +begin + DoExplorerButtonsPosUpdate; +end; + +procedure TCustomdxPSPreviewWindow.DrawStatusFrame(AStatusBar: TStatusBar; var R: TRect); +begin + with AStatusBar.Canvas do + begin + Brush.Color := GetStatusColor(AStatusBar); + FillRect(Rect(R.Left, R.Bottom - 1, R.Right, R.Bottom)); + + Dec(R.Bottom); + Brush.Color := clBtnShadow; + FrameRect(R); + end; + InflateRect(R, -1, -1); +end; + +procedure TCustomdxPSPreviewWindow.DrawStatusText(AStatusBar: TStatusBar; + APanel: TStatusPanel; const R: TRect; AHighlighted, AMarginBar: Boolean); +const + BrushStyles: array[Boolean] of TBrushStyle = (bsClear, bsSolid); +var + S: string; + W, X, Y: Integer; +begin + with AStatusBar.Canvas do + begin + Font.Color := GetStatusPanelTextColor(AStatusBar, Flat, AHighlighted); + if AMarginBar and IsMarginValueStatusPanel(APanel) then + Brush.Color := GetStatusPanelBkColor(AStatusBar, Flat, AHighlighted) + else + Brush.Color := AStatusBar.Color; + Brush.Style := BrushStyles[AHighlighted or Flat]; + + S := APanel.Text; + W := TextWidth(S); + with R do + begin + if W > Right - Left - 2 then + W := Right - Left - 2; + X := Right - W - 1; + if X < Left + 1 then + X := Left + 1; + Y := Top + 1 + Byte(not Flat); + end; + TextRect(R, X, Y, S); + end; +end; + +procedure TCustomdxPSPreviewWindow.FillEffectsApply(Sender: TObject); +begin + FPreview.PageBackground := TdxBackground(Sender); + UpdateControls; +end; + +procedure TCustomdxPSPreviewWindow.PreviewMarginsChanged(Sender: TObject; AMargin: TdxPreviewPageMargin); +var + V: Integer; +begin + if Locked then Exit; + + V := AMargin.Value; + case FPreview.ActualMeasurementUnits of + pmuInches: + V := LoMetricToThousandthsOfInch(V); + pmuMillimeters: + V := LoMetricToThousandthsOfMM(V); + end; + + if PrinterPage <> nil then + if AMargin is TdxPreviewPageMarginLeft then + PrinterPage.Margins.Left := V + else if AMargin is TdxPreviewPageMarginTop then + PrinterPage.Margins.Top := V + else if AMargin is TdxPreviewPageMarginRight then + PrinterPage.Margins.Right := V + else if AMargin is TdxPreviewPageMarginBottom then + PrinterPage.Margins.Bottom := V + else if AMargin is TdxPreviewPageMarginFooter then + PrinterPage.Footer := V + else if AMargin is TdxPreviewPageMarginHeader then + PrinterPage.Header := V; + + DoPreviewMarginChanged(TdxPreview(Sender), AMargin); +end; + +procedure TCustomdxPSPreviewWindow.PreviewAfterDragMargin(Sender: TObject; AMargin: TdxPreviewPageMargin); +begin + DoPreviewAfterDragMargin(TdxPreview(Sender), AMargin); + UpdateControls; +end; + +procedure TCustomdxPSPreviewWindow.PreviewBeforeDragMargin(Sender: TObject; AMargin: TdxPreviewPageMargin); +begin + DoPreviewBeforeDragMargin(TdxPreview(Sender), AMargin); + UpdateControls; +end; + +procedure TCustomdxPSPreviewWindow.PreviewDragMargin(Sender: TObject; AMargin: TdxPreviewPageMargin); +begin + DoPreviewDragMargin(TdxPreview(Sender), AMargin); +end; + +procedure TCustomdxPSPreviewWindow.PreviewCalcPageCount(Sender: TObject); +begin + if ReportLink <> nil then + begin + Preview.PageCount := ReportLink.VisiblePageCount; + if Preview.DraggingMargin = nil then UpdateControls; + + ThumbnailsPreview.PageCount := Preview.PageCount; + end; +end; + +procedure TCustomdxPSPreviewWindow.PreviewZoomFactorChanged(Sender: TObject); +begin + DoPreviewZoomFactorChanged(TdxPreview(Sender)); +end; + +procedure TCustomdxPSPreviewWindow.PreviewZoomModeChanged(Sender: TObject); +begin + DoPreviewZoomModeChanged(TdxPreview(Sender)); +end; + +procedure TCustomdxPSPreviewWindow.PreviewCanShowMarginHint(Sender: TObject; + var ACanShowHint: Boolean); +begin + ACanShowHint := GetPreviewCanShowMarginHint(TdxPreview(Sender)); +end; + +procedure TCustomdxPSPreviewWindow.PreviewSelectingPage(Sender: TObject; + APageIndex: Integer; var ACanSelect: Boolean); +begin + if (ReportLink <> nil) and ReportLink.ShowEmptyPages and ReportLink.IsEmptyPage(APageIndex) then + ACanSelect := False; +end; + +procedure TCustomdxPSPreviewWindow.PreviewSelectedPageChanged(Sender: TObject; APageIndex: Integer); +begin + if ReportLink <> nil then + ReportLink.CurrentPage := ReportLink.VirtualPageIndexToRealPageIndex(APageIndex) + 1; + + //SectionStatusPanel(ssCurrentPage).Text := IntToStr(ReportLink.CurrentPage); + UpdateControls; + FStatusBar.Update; + if not FLockPageSelection then + begin + if (APageIndex = -1) and (ThumbnailsPreview.PageCount <> 0) then + APageIndex := 0; + ThumbnailsPreview.SelPageIndex := APageIndex; + end; +end; + +procedure TCustomdxPSPreviewWindow.PreviewDblClick(Sender: TObject); +var + HitTests: TdxPreviewHitTests; + Pt: TPoint; +begin + DoPreviewDblClick(TdxPreview(Sender)); + GetCursorPos(Pt); + Pt := FPreview.ScreenToClient(Pt); + HitTests := FPreview.GetHitInfoAt(Pt.X, Pt.Y); + if (phtNoWhere in HitTests) and CanDesign then + DoDesignReport + else + if (HitTests * phtMargins <> []) and CanChangeMargins and CanPageSetup then + DoPageSetupReport(1); +end; + +procedure TCustomdxPSPreviewWindow.StatusBarDblClick(Sender: TObject); +var + R: TRect; + Pt: TPoint; +begin + if CanPageSetup then + begin + R := GetStatusPanelBounds(StatusBar, 7); + MapWindowPoints(StatusBar.Handle, 0, R, 2); + GetCursorPos(Pt); + if PtInRect(R, Pt) then DoPageSetupReport(0); + end; +end; + +procedure TCustomdxPSPreviewWindow.StatusBarDrawPanel(StatusBar: TStatusBar; + Panel: TStatusPanel; const Rect: TRect); + + function GetStatusColor: TColor; + begin + if ValidateMargins then + Result := clBtnFace + else + Result := clInfoBk; + end; + + procedure DrawStatusStateText(const R: TRect); + var + X, Y: Integer; + begin + with StatusBar.Canvas do + begin + Brush.Color := GetStatusColor; + FillRect(R); + Brush.Style := bsClear; + X := R.Left + 2; + Y := R.Top + (R.Bottom - R.Top - TextHeight('Wg')) div 2; + TextRect(R, X, Y, Panel.Text); + Brush.Style := bsSolid; + end; + end; + +const + FramedPanelIndexes: set of Byte = [1, 3, 5, 7, 9]; +var + R: TRect; +begin + R := Rect; + if Flat and (Panel.Index in FramedPanelIndexes) then + begin + if IsSizeGripActuallyShown and (Panel.Index = StatusBar.Panels.Count - 1) then + Dec(R.Right, GetSystemMetrics(SM_CXVSCROLL)); + DrawStatusFrame(StatusBar, R); + end; + if IsStatusTextPanel(Panel) then + DrawStatusStateText(R) + else + DrawStatusText(StatusBar, Panel, R, False, False); +end; + +procedure TCustomdxPSPreviewWindow.StatusBarMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +const + PtInRect: Boolean = False; +var + R: TRect; + Pt: TPoint; +begin + if CanPageSetup then + begin + R := GetStatusPanelBounds(StatusBar, 7); + Pt := Point(X, Y); + if Windows.PtInRect(R, Pt) xor PtInRect then + begin + PtInRect := not PtInRect; + Application.CancelHint; + if PtInRect then + StatusBar.Hint := cxGetResourceString(@sdxHintDoubleClickForChangePaperSize) + else + StatusBar.Hint := ''; + end; + end; +end; + +procedure TCustomdxPSPreviewWindow.ThumbnailsPreviewSelectedPageChanged(Sender: TObject; + APageIndex: Integer); +begin + if FLockPageSelection then Exit; + + FLockPageSelection := True; + try + Preview.SelPageIndex := APageIndex; + finally + FLockPageSelection := False; + end; +end; + +procedure TCustomdxPSPreviewWindow.ThumbnailsSplitterCanResize(Sender: TObject; + var NewSize: Integer; var Accept: Boolean); + + function CalculateNewSize: Integer; + begin + Result := ThumbnailsSplitter.Parent.ClientWidth - MinPreviewSize.X - ThumbnailsSplitter.Width; + end; + +var + Size: Integer; +begin + Accept := Preview.Width >= MinPreviewSize.X; + Size := CalculateNewSize; + if NewSize > Size then NewSize := Size; +end; + +procedure TCustomdxPSPreviewWindow.ThumbnailsSplitterMouseUp(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + if ThumbnailsPane.Width <> 0 then + FSaveThumbnailsPaneWidth := ThumbnailsPane.Width; +end; + +procedure TCustomdxPSPreviewWindow.MarginBarDblClick(Sender: TObject); +begin + if CanPageSetup then DoPageSetupReport(1); +end; + +procedure TCustomdxPSPreviewWindow.MarginBarDrawPanel(StatusBar: TStatusBar; + Panel: TStatusPanel; const Rect: TRect); + + function IsHighlighted: Boolean; + begin + Result := (Preview.DraggingMargin <> nil) and (MarginStatusPanel(Preview.DraggingMargin) = Panel); + end; + +var + R: TRect; +begin + R := Rect; + if Flat and IsMarginValueStatusPanel(Panel) then + DrawStatusFrame(StatusBar, R); + DrawStatusText(StatusBar, Panel, R, IsHighlighted, True); +end; + +procedure TCustomdxPSPreviewWindow.DoShowFormatDateTimeDlg; +begin + if ReportLink.ShowDateTimeFormatsDlg then + begin + Preview.InvalidatePagesHeader; + Preview.InvalidatePagesFooter; + end; +end; + +procedure TCustomdxPSPreviewWindow.DoShowFormatPageNumbersDlg; +begin + if ReportLink.ShowPageNumberFormatsDlg then + begin + Preview.InvalidatePagesHeader; + Preview.InvalidatePagesFooter; + end; +end; + +procedure TCustomdxPSPreviewWindow.DoShowHFToolBar(Value: Boolean); +begin +end; + +procedure TCustomdxPSPreviewWindow.DoShowZoomDlg; +begin + dxZoomDlg(Preview); +end; + +procedure TCustomdxPSPreviewWindow.DoShowPageBackgroundDlg(const Pt: TPoint); +begin + if dxChooseBackgroundDlg(Preview.PageBackground, Pt, dxDefaultBackgroundDlgData) then + if PrinterPage <> nil then + PrinterPage.Background := Preview.PageBackground; +end; + +procedure TCustomdxPSPreviewWindow.DoShowMultiplySelectPagesDlg(AImageList: TCustomImageList; + AImageIndex: Integer; const Pt: TPoint; AYShift: Integer); +var + Origin: TPoint; + MaxColCount, MaxRowCount, ColCount, RowCount: Integer; +begin + Origin := Pt; + Inc(Origin.Y, AYShift); + MaxColCount := + Floor((FPreview.ClientWidth - 2 * FPreview.Indent) / + (FPreview.Indent + MulDiv(FPreview.PageSize.X, FPreview.MinZoomFactor, 100))); +// AMaxColCount := (MulDiv(Preview.ClientWidth, 100, Preview.ZoomFactor) - dxPreviewIndent) div +// (MulDiv(Preview.PageSize.X, 10, 100) + dxPreviewIndent); + MaxRowCount := + Floor((FPreview.ClientHeight - 2 * FPreview.Indent) / + (FPreview.Indent + MulDiv(FPreview.PageSize.Y, FPreview.MinZoomFactor, 100))); + + if MaxColCount = 0 then MaxColCount := 1; + if MaxRowCount = 0 then MaxRowCount := 1; + if MaxColCount > 3 then + ColCount := 3 + else + ColCount := MaxColCount; + if MaxRowCount > 2 then + RowCount := 2 + else + RowCount := MaxRowCount; + + if dxChooseMultiplePages(AImageList, AImageIndex, Origin, AYShift, + MaxColCount, MaxRowCount, ColCount, RowCount) then + begin + FPreview.ZoomMode := pzmPages; + FPreview.SetPageXYCount(ColCount, RowCount); + end; +end; + +procedure TCustomdxPSPreviewWindow.DoShowEmptyPages(Value: Boolean); +begin + if ReportLink <> nil then + begin + ReportLink.ShowEmptyPages := Value; + if FPreview.PageCount <> ReportLink.VisiblePageCount then + begin + FPreview.PageCount := ReportLink.VisiblePageCount; + if ThumbnailsPreview <> nil then + ThumbnailsPreview.PageCount := ReportLink.VisiblePageCount; + end + else + FPreview.Invalidate; + end; + UpdateControls; +end; + +procedure TCustomdxPSPreviewWindow.DoShowOptionsDlg; +var + Data: TdxPreviewOptionsDlgData; +begin + FillChar(Data, SizeOf(TdxPreviewOptionsDlgData), 0); + with Data do + begin + MarginColor := Preview.MarginColor; + MeasurementUnits := TdxMeasurementUnits(Preview.MeasurementUnits); + ShowMarginsHintWhileDragging := pohShowOnDrag in Preview.OptionsHint; + ShowMarginHints := pohShowForMargins in Preview.OptionsHint; + ShowMargins := povMargins in Preview.OptionsView; + ZoomOnMouseRoll := pozZoomOnMouseRoll in Preview.OptionsZoom; + ZoomStep := Preview.ZoomStep; + end; + + if dxShowPSPreviewOptionsDlg(Data) then SavePreferences(Data); + + UpdateControls; +end; + +procedure TCustomdxPSPreviewWindow.DoShrinkToPageWidth(Value: Boolean); +begin + if ReportLink <> nil then + if FPreview.PageCount <> ReportLink.VisiblePageCount then + begin + FPreview.PageCount := ReportLink.VisiblePageCount; + if ThumbnailsPreview <> nil then + ThumbnailsPreview.PageCount := ReportLink.VisiblePageCount; + end + else + FPreview.Invalidate; + UpdateControls; +end; + +procedure TCustomdxPSPreviewWindow.DoThumbnailsToggleShow(Value: Boolean); +begin + if Value then + begin + if FSaveThumbnailsPaneWidth <> -1 then + ThumbnailsPane.Width := FSaveThumbnailsPaneWidth + else + ThumbnailsPane.Width := DefaultThumbnailsPaneWidth; + ThumbnailsSplitter.Left := ThumbnailsPane.Left - ThumbnailsSplitter.Width; + + FixupPreviewWidth; + end + else + begin + ThumbnailsPane.Width := 0; + ThumbnailsPane.Left := ThumbnailsPane.Parent.Width; + end; + + if Visible and Enabled then + if not Value then + if Preview.CanFocus then + ActiveControl := Preview + else + ActiveControl := nil + else + ThumbnailsPreview.SetFocus; + + UpdateControls; +end; + +procedure TCustomdxPSPreviewWindow.DoUnloadReportLinkData; +begin + ReportLink.DataSource := rldsComponent; +end; + +procedure TCustomdxPSPreviewWindow.FixupPreviewWidth; +var + AvailableWidth: Integer; +begin + if Preview.Width < MinPreviewSize.X then + begin + AvailableWidth := PreviewPane.ClientWidth - MinPreviewSize.X - ThumbnailsSplitter.Width; + if AvailableWidth < 0 then + AvailableWidth := 0; + + if ShowThumbnails and (ThumbnailsPane.Width > AvailableWidth) then + ThumbnailsPane.Width := AvailableWidth; + end; +end; + +procedure TCustomdxPSPreviewWindow.PreviewPaneResize(Sender: TObject); +begin + if ShowThumbnails then + if Preview.Width < MinPreviewSize.X then + begin + ThumbnailsPane.Width := PreviewPane.ClientWidth - MinPreviewSize.X - ThumbnailsSplitter.Width; + Preview.Width := MinPreviewSize.X; + end; + ShowExplorer := ExplorerPane.Width <> 0; +end; + +procedure TCustomdxPSPreviewWindow.ThumbnailsPreviewResize(Sender: TObject); +begin + ShowThumbnails := ThumbnailsPane.Width <> 0; +end; + +procedure TCustomdxPSPreviewWindow.UpdateThumbnailsSize; +begin + ThumbnailsPreview.ZoomFactor := dxPSCore.dxThumbnailsZoomFactors[ThumbnailsSize]; +end; + +procedure TCustomdxPSPreviewWindow.DoDesignReport; +begin + if ReportLink <> nil then + begin + ReportLink.DesignReport; + UpdateControls; + end; +end; + +procedure TCustomdxPSPreviewWindow.DoLoadReportLinkDataFromFile; +var + Dialog: TdxPSOpenReportDialog; +begin + if ReportLink <> nil then + begin + Dialog := TdxPSOpenReportDialog.Create(nil); + with Dialog do + try + if Execute then + ReportLink.LoadDataFromFile(FileName); + finally + Free; + end; + end; +end; + +procedure TCustomdxPSPreviewWindow.DoPageSetupReport(APageIndex: Integer); +var + PreviewBtnClicked, PrintBtnClicked: Boolean; +begin + if ComponentPrinter.PageSetupEx(APageIndex, False, CanPrintDialog, PreviewBtnClicked, PrintBtnClicked, nil) then + begin + InitContent; + UpdateControls; + end; + InvalidatePagesContent; + if PrintBtnClicked then + DoPrintReport(True); +end; + +procedure TCustomdxPSPreviewWindow.DoPrintReport(AShowDialog: Boolean); +begin + ComponentPrinter.Print(AShowDialog, nil, nil); + {if AShowDialog then }UpdateControls; + DoAfterPrintReport(AShowDialog); + if FReleased then Release; +end; + +procedure TCustomdxPSPreviewWindow.DoSaveReportLinkDataToFile; +var + fsDialog: TdxPSSaveReportDialog; +begin + if ReportLink <> nil then + begin + fsDialog := TdxPSSaveReportDialog.Create(nil); + with fsDialog do + try + FileName := ReportLink.GetNewReportStorageName; + if Execute then + begin + FileName := ChangeFileExt(FileName, '.' + dxPSCore.dxPSReportFileShortExtension); + ReportLink.SaveDataToFile(FileName); + end; + finally + Free; + end; + end; +end; + +function TCustomdxPSPreviewWindow.CanDesign: Boolean; +begin + Result := IsVisible(pvoReportDesign) and IsEnabled(peoReportDesign) and + (ReportLink <> nil) and ReportLink.CheckToDesign and not IsPrinting and not IsBuilding; +end; + +function TCustomdxPSPreviewWindow.CanPrint: Boolean; +begin + Result := IsVisible(pvoPrint) and IsEnabled(peoPrint) and (ReportLink <> nil) and + (ReportLink.PageCount > 0) and (dxPrnDev.dxGetDefaultPrinter <> '') and not IsPrinting; +end; + +function TCustomdxPSPreviewWindow.CanPrintDialog: Boolean; +begin + Result := CanPrint; +end; + +function TCustomdxPSPreviewWindow.CanPrintStyle: Boolean; +begin + Result := (ReportLink <> nil) and (ReportLink.StyleManager <> nil) and + IsVisible(pvoPrintStyles); +end; + +function TCustomdxPSPreviewWindow.CanRebuild: Boolean; +begin + Result := (ReportLink <> nil) and ReportLink.DataProviderPresent and + (ComponentPrinter.State * [cpsBuilding, cpsPrinting] = []) +end; + +function TCustomdxPSPreviewWindow.CanLoadReport: Boolean; +begin + if IsExplorerAvailable then + Result := (ExplorerTree <> nil) and ExplorerTree.CanLoadSelectedItemData and not IsBuilding + else + Result := IsVisible(pvoReportFileOperations) and (ReportLink <> nil) and + ReportLink.CanLoadData and not IsBuilding; +end; + +function TCustomdxPSPreviewWindow.CanPageSetup: Boolean; +begin + Result := IsVisible(pvoPageSetup) and IsEnabled(peoPageSetup) + and (ComponentPrinter <> nil) and not IsPrinting; +end; + +function TCustomdxPSPreviewWindow.CanChangeMargins: Boolean; +begin + Result := IsEnabled(peoCanChangeMargins) and not IsPrinting and not IsBuilding; +end; + +function TCustomdxPSPreviewWindow.CanSaveReport: Boolean; +begin + if not ComponentPrinter.IsExplorerMode then + begin + if IsExplorerAvailable and (ReportLink = nil) then + Result := (ExplorerTree <> nil) and ExplorerTree.CanCreateItem + else + Result := (ReportLink <> nil) and IsVisible(pvoReportFileOperations) and ReportLink.CanSaveData; + end + else + Result := False; +end; + +function TCustomdxPSPreviewWindow.CanUnloadReport: Boolean; +begin + if IsExplorerAvailable then + Result := (ExplorerTree <> nil) and ExplorerTree.CanUnloadItemData + else + Result := IsVisible(pvoReportFileOperations) and (ReportLink <> nil) and + ReportLink.CanUnloadData; +end; + +function TCustomdxPSPreviewWindow.IsCommandLoadReportVisible: Boolean; +begin + Result := IsExplorerAvailable or IsVisible(pvoReportFileOperations); +end; + +function TCustomdxPSPreviewWindow.IsCommandSaveReportVisible: Boolean; +begin + Result := IsExplorerAvailable or IsVisible(pvoReportFileOperations); +end; + +function TCustomdxPSPreviewWindow.IsCommandUnloadReportVisible: Boolean; +begin + Result := IsExplorerAvailable or IsVisible(pvoReportFileOperations); +end; + +function TCustomdxPSPreviewWindow.IsEnabled(AnOption: TdxPreviewEnableOption): Boolean; +begin + Result := AnOption in FEnableOptions; +end; + +function TCustomdxPSPreviewWindow.IsVisible(AnOption: TdxPreviewVisibleOption): Boolean; +begin + Result := AnOption in FVisibleOptions; +end; + +function TCustomdxPSPreviewWindow.IsAutoHFTextEntriesAvailable: Boolean; +begin + Result := (ReportLink <> nil) and (ReportLink.StyleManager <> nil); +end; + +function TCustomdxPSPreviewWindow.IsBuilding: Boolean; +begin + Result := (ComponentPrinter <> nil) and (cpsBuilding in ComponentPrinter.State); +end; + +function TCustomdxPSPreviewWindow.IsPrinting: Boolean; +begin + Result := ((ComponentPrinter <> nil) and (cpsPrinting in ComponentPrinter.State)) or + dxPrintDevice.Printing; +end; + +function TCustomdxPSPreviewWindow.IsProgressState: Boolean; +begin + Result := (ComponentPrinter <> nil) and + (ComponentPrinter.State * [cpsBuilding, cpsPrinting] <> []); +end; + +function TCustomdxPSPreviewWindow.IsSizeGripActuallyShown: Boolean; +begin + Result := StatusBar.SizeGrip and (WindowState = wsNormal); +end; + +function TCustomdxPSPreviewWindow.IsStatusTextPanel(APanel: TStatusPanel): Boolean; +begin + Result := APanel = StatusTextPanel; +end; + +procedure TCustomdxPSPreviewWindow.InvalidateStatusPanel(AStatusBar: TStatusBar; + AIndex: Integer); +var + R: TRect; +begin + R := GetStatusPanelBounds(AStatusBar, AIndex); + InvalidateRect(AStatusBar.Handle, @R, False); +end; + +procedure TCustomdxPSPreviewWindow.InvalidatePagesHeadersOrFooters; +begin + case State of + prsEditHeaders: + FPreview.InvalidatePagesHeader; + prsEditFooters: + FPreview.InvalidatePagesFooter; + end; +end; + +procedure TCustomdxPSPreviewWindow.RefreshStatusBar(AStatusSections: TfmPreviewStatusSections); +begin + if not IsProgressState then + begin + if ReportLink <> nil then + begin + if ssCurrentPage in AStatusSections then + SectionStatusPanelSetText(ssCurrentPage, IntToStr(ReportLink.CurrentPage)); + if ssPageCount in AStatusSections then + SectionStatusPanelSetText(ssPageCount, IntToStr(ReportLink.PageCount)); + end; + + if ssPaperSize in AStatusSections then + SectionStatusPanelSetText(ssPaperSize, FPreview.PageSizeToString); + + if ssStatus in AStatusSections then + begin + InvalidateStatusPanel(StatusBar, StatusBar.Panels.Count - 1); + StatusBar.Update; + end; + UpdateStatusBarPanelWidths(StatusBar); + end; +end; + +procedure TCustomdxPSPreviewWindow.RefreshMarginBar(AMargin: TdxPreviewPageMargin); +begin + with FPreview do + if AMargin = nil then + begin + MarginStatusPanel(Margins.Left).Text := MarginValueToString(Margins.Left.Value); + MarginStatusPanel(Margins.Top).Text := MarginValueToString(Margins.Top.Value); + MarginStatusPanel(Margins.Right).Text := MarginValueToString(Margins.Right.Value); + MarginStatusPanel(Margins.Bottom).Text := MarginValueToString(Margins.Bottom.Value); + MarginStatusPanel(Margins.Header).Text := MarginValueToString(Margins.Header.Value); + MarginStatusPanel(Margins.Footer).Text := MarginValueToString(Margins.Footer.Value); + end + else + MarginStatusPanel(AMargin).Text := MarginValueToString(AMargin.DraggingValue); +end; + +function TCustomdxPSPreviewWindow.IsMarginValueStatusPanel(APanel: TStatusPanel): Boolean; +const + Indexes: set of Byte = [2, 4, 6, 8, 10, 12]; +begin + Result := APanel.Index in Indexes; +end; + +function TCustomdxPSPreviewWindow.MarginStatusPanel(AMargin: TdxPreviewPageMargin): TStatusPanel; +//pmLeft, pmTop, pmRight, pmBottom, pmHeader, pmFooter +var + Index: Integer; +begin + if AMargin is TdxPreviewPageMarginLeft then + Index := 2 + else if AMargin is TdxPreviewPageMarginTop then + Index := 4 + else if AMargin is TdxPreviewPageMarginRight then + Index := 6 + else if AMargin is TdxPreviewPageMarginBottom then + Index := 8 + else if AMargin is TdxPreviewPageMarginFooter then + Index := 12 + else //if AMargin is TdxPreviewPageMarginHeader then + Index := 10; + Result := FMarginBar.Panels[Index]; +end; + +function TCustomdxPSPreviewWindow.SectionStatusPanel(AStatusSection: TfmPreviewStatusSection): TStatusPanel; +const + Indexes: array [TfmPreviewStatusSection] of Integer = (1, 3, 7, 9); +begin + if Indexes[AStatusSection] < FStatusBar.Panels.Count then + Result := FStatusBar.Panels[Indexes[AStatusSection]] + else + Result := nil; +end; + +procedure TCustomdxPSPreviewWindow.SectionStatusPanelSetText( + AStatusSection: TfmPreviewStatusSection; const AText: string); +begin + if SectionStatusPanel(AStatusSection) <> nil then + SectionStatusPanel(AStatusSection).Text := AText; +end; + +procedure TCustomdxPSPreviewWindow.DoPreviewMarginChanged(APreview: TdxPreview; + AMargin: TdxPreviewPageMargin); +begin + if FPreview.DraggingMargin = nil then RefreshMarginBar(AMargin); +end; + +procedure TCustomdxPSPreviewWindow.DoPreviewAfterDragMargin(APreview: TdxPreview; + AMargin: TdxPreviewPageMargin); +var + MarginsValid: Boolean; +begin + RefreshMarginBar(AMargin); + MarginsValid := ValidateMargins; + if (MarginsValid <> FAreMarginsValid) and not MarginsValid then + SysUtils.Beep; + FAreMarginsValid := MarginsValid; + UpdateStatusText; + RefreshStatusBar([ssStatus]); +end; + +procedure TCustomdxPSPreviewWindow.DoPreviewBeforeDragMargin(APreview: TdxPreview; + AMargin: TdxPreviewPageMargin); +begin + RefreshMarginBar(AMargin); +end; + +procedure TCustomdxPSPreviewWindow.DoPreviewDragMargin(APreview: TdxPreview; + AMargin: TdxPreviewPageMargin); +begin + RefreshMarginBar(AMargin); +end; + +procedure TCustomdxPSPreviewWindow.DoPreviewZoomFactorChanged(APreview: TdxPreview); +begin +end; + +procedure TCustomdxPSPreviewWindow.DoPreviewZoomModeChanged(APreview: TdxPreview); +begin +end; + +function TCustomdxPSPreviewWindow.GetPreviewCanShowMarginHint(APreview: TdxPreview): Boolean; +begin + Result := True; +end; + +procedure TCustomdxPSPreviewWindow.DoPreviewDblClick(APreview: TdxPreview); +begin +end; + +procedure TCustomdxPSPreviewWindow.DoAfterPrintReport(AShowDialog: Boolean); +begin +end; + +procedure TCustomdxPSPreviewWindow.DoSetupZoomFactor(AZoomFactor, APageXCount, + APageYCount: Integer; AZoomMode: TdxPreviewZoomMode); +begin + FPreview.ZoomMode := AZoomMode; + case FPreview.ZoomMode of + pzmNone: + FPreview.ZoomFactor := AZoomFactor; + pzmPages: + FPreview.SetPageXYCount(APageXCount, APageYCount); + end; + UpdateControls; +end; + +procedure TCustomdxPSPreviewWindow.DoActivePageChanged(AValue: Integer); +begin + if ReportLink <> nil then + if ReportLink.ShowEmptyPages then + ActivePageIndex := ReportLink.RealPageIndexToVirtualPageIndex(AValue, True) + else + ActivePageIndex := AValue; +end; + +procedure TCustomdxPSPreviewWindow.DoExplorerButtonsPosUpdate; +begin + FExplorerCloseButton.Left := FExplorerToolBar.ClientWidth - FExplorerCloseButton.Width - 1; +end; + +procedure TCustomdxPSPreviewWindow.DoExplorerCreateNewFolder; +begin + if (ExplorerTree <> nil) and ExplorerTree.CanCreateFolder then + Explorer.CreateNewFolder(ExplorerTree.CreationParent); +end; + +procedure TCustomdxPSPreviewWindow.DoExplorerCreateNewItem; +begin + if CanSaveReport then + if IsExplorerAvailable then + begin + if ExplorerTree <> nil then + begin + ExplorerTree.CreateItem; + ShowExplorer := True; + end; + end + else + DoSaveReportLinkDataToFile; +end; + +procedure TCustomdxPSPreviewWindow.DoExplorerDeleteItem; +begin + if ExplorerTree <> nil then ExplorerTree.DeleteSelection; +end; + +function TCustomdxPSPreviewWindow.DoExplorerItemShowPropertySheets: Boolean; +begin + Result := (ExplorerTree <> nil) and ExplorerTree.ShowSelectedItemPropertySheets; +end; + +procedure TCustomdxPSPreviewWindow.DoExplorerLoadItemData; +begin + if CanLoadReport then + if IsExplorerAvailable then + ExplorerTree.LoadSelectedItemData + else + DoLoadReportLinkDataFromFile; +end; + +procedure TCustomdxPSPreviewWindow.DoExplorerRenameItem; +begin + ExplorerTree.BeginEdit; +end; + +procedure TCustomdxPSPreviewWindow.DoExplorerShowToggled(Value: Boolean); +begin + if ExplorerPane <> nil then + begin + if Value then + begin + if FSaveExplorerPaneWidth <> -1 then + ExplorerPane.Width := FSaveExplorerPaneWidth + else + ExplorerPane.Width := DefaultExplorerPaneWidth; + ExplorerSplitter.Left := ExplorerPane.Width + 1; + end + else + begin + ExplorerPane.Width := 0; + ExplorerPane.Left := 0; + end; + + if Visible and Enabled then + begin + if not Value then + if Preview.CanFocus then + ActiveControl := Preview + else + ActiveControl := nil + else + if ExplorerTree <> nil then + ExplorerTree.SetFocus; + end; + + UpdateControls; + end; +end; + +procedure TCustomdxPSPreviewWindow.DoExplorerUnloadItemData; +begin + if CanUnloadReport then + if IsExplorerAvailable then + ExplorerTree.UnloadItemData + else + DoUnloadReportLinkData; +end; + +procedure TCustomdxPSPreviewWindow.DoFormatTitle; +begin + ReportLink.ShowTitlePropertiesDlg; +end; + +procedure TCustomdxPSPreviewWindow.DoInsertHF(const S: string); +var + Strings: TStrings; +begin + case State of + prsEditHeaders: + Strings := PrinterPage.PageHeader.Titles[HFEditPart]; + prsEditFooters: + Strings := PrinterPage.PageFooter.Titles[HFEditPart]; + else + Exit; + end; + Strings.Text := Strings.Text + S; + InvalidatePagesHeadersOrFooters; +end; + +procedure TCustomdxPSPreviewWindow.DoInvokeHelp; +begin + if HelpContext <> 0 then Application.HelpContext(HelpContext); +end; + +procedure TCustomdxPSPreviewWindow.DoClearHF; +begin + if PrinterPage = nil then Exit; + case State of + prsEditHeaders: + PrinterPage.PageHeader.Titles[HFEditPart].Text := ''; + prsEditFooters: + PrinterPage.PageFooter.Titles[HFEditPart].Text := ''; + end; + InvalidatePagesHeadersOrFooters; +end; + +procedure TCustomdxPSPreviewWindow.DoShowHFBackgroundDlg(const Pt: TPoint); +var + Background: TdxBackground; +begin + case State of + prsEditHeaders: + Background := PrinterPage.PageHeader.Background; + prsEditFooters: + Background := PrinterPage.PageFooter.Background; + else + Exit; + end; + if dxChooseBackgroundDlg(Background, Pt, dxDefaultBackgroundDlgData) then + InvalidatePagesHeadersOrFooters; +end; + +procedure TCustomdxPSPreviewWindow.DoShowPageHeaders(Value: Boolean); +begin + ReportLink.ShowPageHeader := Value; + FPreview.InvalidatePagesHeader; +end; + +procedure TCustomdxPSPreviewWindow.DoShowPageFooters(Value: Boolean); +begin + ReportLink.ShowPageFooter := Value; + FPreview.InvalidatePagesFooter; +end; + +procedure TCustomdxPSPreviewWindow.PrepareProgress; +begin + RefreshStatusPanels(psbmProgress); + ProgressBarShow; + FLastOpCompleted := 0; + FCurrentProgressValue := 0; +end; + +function TCustomdxPSPreviewWindow.ProgressBarGetMaxValue: Integer; +begin + if cpsPrinting in ComponentPrinter.State then + Result := FFullPageCount + else + Result := 100; +end; + +procedure TCustomdxPSPreviewWindow.ProgressBarHide; +begin + ProgressBar.Parent := nil; +end; + +procedure TCustomdxPSPreviewWindow.ProgressBarPlace; +var + R: TRect; +begin + R := GetStatusPanelBounds(StatusBar, ProgressStatusPanel.Index); + InflateRect(R, -1, -1); + if Flat then Dec(R.Bottom); + ProgressBar.BoundsRect := R; +end; + +procedure TCustomdxPSPreviewWindow.ProgressBarRefresh; +begin + //UpdateStatusText; + ProgressBar.Position := FCurrentProgressValue; +end; + +procedure TCustomdxPSPreviewWindow.ProgressBarShow; +begin + ProgressBar.Position := 0; + ProgressBar.Max := ProgressBarGetMaxValue; + ProgressBar.Parent := StatusBar; + ProgressBarPlace; +end; + +procedure TCustomdxPSPreviewWindow.UnprepareProgress; +begin + ProgressBarHide; + RefreshStatusPanels(psbmNormal); + UpdateControls; + PostMessage(Handle, WMPS_UPDATESTATUSPROGRESS, 0, 0); +end; + +procedure TCustomdxPSPreviewWindow.GenerateReportProgress(Sender: TObject; + AReportLink: TBasedxReportLink; APercentDone: Double {mask : '##0.00'}); +begin + if Sender <> ComponentPrinter then Exit; + FCurrentProgressValue := Trunc(APercentDone); + ProgressBarRefresh; + //if IsEscKeyPressed(Handle) then ComponentPrinter.AbortBuilding := True; +end; + +procedure TCustomdxPSPreviewWindow.EndGenerateReport(Sender: TObject; + AReportLink: TBasedxReportLink); +begin + if Sender <> ComponentPrinter then Exit; + UnprepareProgress; + if Preview.SelPageIndex > ReportLink.PageCount - 1 then + Preview.SelPageIndex := ReportLink.PageCount - 1; +end; + +procedure TCustomdxPSPreviewWindow.StartGenerateReport(Sender: TObject; + AReportLink: TBasedxReportLink); +begin + if Sender <> ComponentPrinter then Exit; + + Preview.PageCount := 0; + Preview.Update; + + ThumbnailsPreview.PageCount := 0; + ThumbnailsPreview.Update; + + PrepareProgress; + UpdateControls; +end; + +procedure TCustomdxPSPreviewWindow.EndPrint(Sender: TObject; AReportLink: TBasedxReportLink); +begin + if Sender <> ComponentPrinter then Exit; + UnprepareProgress; + UpdateControls; +end; + +procedure TCustomdxPSPreviewWindow.NewPage(Sender: TObject; AReportLink: TBasedxReportLink; + APageIndex: Integer); +begin + if Sender <> ComponentPrinter then Exit; + FCurrentProgressValue := APageIndex; + ProgressBarRefresh; +end; + +procedure TCustomdxPSPreviewWindow.StartPrint(Sender: TObject; AReportLink: TBasedxReportLink; + FullPageCount: Integer); +begin + if Sender <> ComponentPrinter then Exit; + FFullPageCount := FullPageCount; + UpdateControls; + PrepareProgress; +end; + +procedure TCustomdxPSPreviewWindow.UpdateMarginBar; +var + I: Integer; + R: TRect; +begin + with MarginBar do + begin + //dxRecreateWnd(MarginBar); + Perform(CM_RECREATEWND, 0, 0); + Refresh; + Canvas.Font := Font; + for I := 0 to Panels.Count - 1 do + if Panels[I].Style = psOwnerDraw then + begin + R := GetStatusPanelBounds(MarginBar, I); + InflateRect(R, -1, -1); + MarginBarDrawPanel(FMarginBar, Panels[I], R); + end; + end; +end; + +procedure TCustomdxPSPreviewWindow.SetZoomFactorByText(const AText: string); +var + V, I, PageXCount, PageYCount: Integer; +begin + I := FPredefinedZooms.IndexOf(AText); + if I > -1 then + if I < PredefinedZoomValueCount then + begin + FPreview.ZoomMode := pzmNone; + FPreview.ZoomFactor := Integer(FPredefinedZooms.Objects[I]); + end + else + begin + if I = PredefinedZoomValueCount then + FPreview.ZoomMode := pzmPageWidth + else + FPreview.ZoomMode := pzmPages; + + case I - PredefinedZoomValueCount of + 1: FPreview.SetPageXYCount(1, 1); + 2: FPreview.SetPageXYCount(2, 1); + 3: FPreview.SetPageXYCount(2, 2); + 4: begin + ReportLink.GetPageColRowCount(PageXCount, PageYCount); + FPreview.SetPageXYCount(PageXCount, 1); + end; + end; + end + else + begin + try + V := StrToInt(DropPercentChar(AText)); + except + try + V := Round(StrToFloat(DropPercentChar(AText))); + except + V := FLastValidZoomFactor; + end; + end; + FPreview.ZoomFactor := V; + end; + FLastValidZoomFactor := FPreview.ZoomFactor; +end; + +procedure TCustomdxPSPreviewWindow.UpdateStatusBarPanelWidths(AStatusBar: TStatusBar); + + procedure UpdateStatusBarPanelWidth(APanel: TStatusPanel); + var + TextWidth: Integer; + begin + TextWidth := AStatusBar.Canvas.TextWidth(APanel.Text); + if TextWidth = 0 then + APanel.Width := 4 + else + if APanel.Width < 3 + TextWidth + 3 then + APanel.Width := 3 + TextWidth + 3; + end; + +var + I: Integer; +begin + for I := 0 to AStatusBar.Panels.Count - 1 do + UpdateStatusBarPanelWidth(AStatusBar.Panels[I]); +end; + +procedure TCustomdxPSPreviewWindow.SavePreferences(AData: TdxPreviewOptionsDlgData); +begin + with Preview do + begin + if AData.ShowMarginHints then + OptionsHint := OptionsHint + [pohShowForMargins] + else + OptionsHint := OptionsHint - [pohShowForMargins]; + + if AData.ShowMarginsHintWhileDragging then + OptionsHint := OptionsHint + [pohShowOnDrag] + else + OptionsHint := OptionsHint - [pohShowOnDrag]; + + if AData.ZoomOnMouseRoll then + OptionsZoom := OptionsZoom + [pozZoomOnMouseRoll] + else + OptionsZoom := OptionsZoom - [pozZoomOnMouseRoll]; + + ZoomStep := AData.ZoomStep; + MarginColor := AData.MarginColor; + MeasurementUnits := + dxPreVw.TdxPreviewMeasurementUnits(AData.MeasurementUnits); + end; + + ShowPageMargins := AData.ShowMargins; + PrinterPage.MeasurementUnits := AData.MeasurementUnits; +end; + +procedure TCustomdxPSPreviewWindow.SaveToRegistry(const APath: string); +begin + inherited; + SavePropertiesToRegistry(APath); +end; + +procedure TCustomdxPSPreviewWindow.LoadFromRegistry(const APath: string); +begin + inherited; + LoadPropertiesFromRegistry(APath); +end; + +procedure TCustomdxPSPreviewWindow.SavePropertiesToRegistry(const APath: string); + + procedure DoStore(const ARegistryPath: string); + begin + Preview.SaveToRegistry(ARegistryPath + '\' + sdxPreviewControl); + + with TRegistry.Create do + try + if OpenKey(ARegistryPath, True) then + try + WriteBool(sdxShowMarginBar, ShowMarginBar); + WriteBool(sdxShowStatusBar, ShowStatusBar); + + WriteInteger(sdxExplorerVisibilityState, Ord(ShowExplorer) + 1); + if ExplorerPaneWidth <> 0 then + WriteInteger(sdxExplorerPaneWidth, ExplorerPaneWidth); + + WriteInteger(sdxThumbnailsVisibilityState, Ord(ShowThumbnails) + 1); + if ThumbnailsPaneWidth <> 0 then + WriteInteger(sdxThumbnailsPaneWidth, ThumbnailsPaneWidth); + except + on ERegistryException do + else + raise; + end; + finally + Free; + end; + end; + +begin + DoStore(APath); + if IsDesignTime and (dxPSEngine.RegistryPath <> '') then + DoStore(dxPSEngine.RegistryPath); +end; + +procedure TCustomdxPSPreviewWindow.LoadPropertiesFromRegistry(const APath: string); +begin + FPreview.LoadFromRegistry(APath + '\' + sdxPreviewControl); + if povMargins in FPreview.OptionsView then + FSavePageMarginsVisibility := mvsShown + else + FSavePageMarginsVisibility := mvsHidden; + + with TRegistry.Create do + try + if OpenKey(APath, False) then + try + if ValueExists(sdxShowMarginBar) then + FShowMarginBar := ReadBool(sdxShowMarginBar); + + if ValueExists(sdxShowStatusBar) then + FShowStatusBar := ReadBool(sdxShowStatusBar); + + if ValueExists(sdxExplorerVisibilityState) then + FSaveExplorerVisibility := TdxPSExplorerVisibiltyState(ReadInteger(sdxExplorerVisibilityState)) + else + FSaveExplorerVisibility := evsUndefined; + + if ValueExists(sdxExplorerPaneWidth) then + FSaveExplorerPaneWidth := ReadInteger(sdxExplorerPaneWidth); + + if ValueExists(sdxThumbnailsVisibilityState) then + FSaveThumbnailsVisibility := TdxPSThumbnailsVisibiltyState(ReadInteger(sdxThumbnailsVisibilityState)) + else + FSaveThumbnailsVisibility := tvsUndefined; + + if ValueExists(sdxThumbnailsPaneWidth) then + FSaveThumbnailsPaneWidth := ReadInteger(sdxThumbnailsPaneWidth); + except + on ERegistryException do + else + raise; + end; + finally + Free; + end; +end; + +procedure TCustomdxPSPreviewWindow.UpdateStatusText; + + function GetStatusText: string; + begin + if ValidateMargins then + Result := cxGetResourceString(@sdxStatusReady) + else + Result := cxGetResourceString(@sdxOutsideMargins); + end; + +begin + StatusTextPanel.Text := GetStatusText; + StatusBar.Update; +end; + +procedure TCustomdxPSPreviewWindow.WMAppCommand(var Message: TMessage); +begin + with Message do + case dxPSGlbl.GET_APPCOMMAND_LPARAM(lParam) of + APPCOMMAND_BROWSER_BACKWARD: + begin + GotoPrevPage; + Result := 1; + end; + + APPCOMMAND_BROWSER_FORWARD: + begin + GotoNextPage; + Result := 1; + end; + + APPCOMMAND_BROWSER_HOME: + begin + GotoFirstPage; + Result := 1; + end; + + APPCOMMAND_HELP: + begin + DoInvokeHelp; + Result := 1; + end; + + APPCOMMAND_OPEN: + begin + DoExplorerLoadItemData; + Result := 1; + end; + APPCOMMAND_CLOSE: + begin + Close; + Result := 1; + end; + + APPCOMMAND_SAVE: + begin + Result := Ord(CanSaveReport); + if Result = 1 then DoExplorerCreateNewItem; + end; + + APPCOMMAND_PRINT: + begin + DoPrintReport(True); + Result := 1; + end; + end; + inherited; +end; + +procedure TCustomdxPSPreviewWindow.WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); +begin + inherited; + with Message.MinMaxInfo.ptMinTrackSize do + begin + X := 360; + Y := 300; + end; +end; + +procedure TCustomdxPSPreviewWindow.WMSettingChange(var Message: TWMSettingChange); +begin + inherited; + with Message do + if (Flag = 0) and (Section = 'intl') then + begin + RefreshMarginBar(nil); + RefreshStatusBar([ssPaperSize]); + end; +end; + +procedure TCustomdxPSPreviewWindow.WMSize(var Message: TWMSize); +begin + inherited; +{ if (StatusBar <> nil) and (Message.SizeType = SIZE_MAXIMIZED) and Flat then + StatusBar.Invalidate; } +end; + +{ TdxPSStatusBar } + +procedure TdxPSStatusBar.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + WindowClass.style := WindowClass.style or CS_HREDRAW or CS_VREDRAW; +end; + +procedure TdxPSStatusBar.Resize; +begin + inherited Resize; + Invalidate; + Update; +end; + +initialization + ClosePaneGlyph := dxPSUtl.CreateGlyphBitmap(CloseGlyphIndex, 0, 0, 7); + +finalization + FreeAndNil(ClosePaneGlyph); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSRELnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSRELnk.pas new file mode 100644 index 00000000..2acdfde2 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSRELnk.pas @@ -0,0 +1,1017 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSRELnk; + +interface + +{$I cxVer.inc} + +uses + Classes, Windows, Graphics, Controls, ComCtrls, RichEdit, dxPSCore, dxPSGlbl, + dxPrnPg, dxPSContainerLnk; + +type + TAbstractdxRichEditReportLink = class; + + TdxPSCustomRichEditProducer = class(TdxPSContainerCustomWinControlProducer) + protected + function CreateImage: TGraphic; virtual; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + public + function Control: TCustomRichEdit; reintroduce; overload; + class function ControlClass: TControlClass; override; + + function ProducingObjectFriendlyName: string; override; + end; + + TdxPSREPageRenderInfo = class(TdxPSPageRenderInfo) + public + FirstChar: Integer; + LastChar: Integer; + DetailsTwipsRect: TRect; + procedure AdjustTwipsRect; virtual; + procedure Calculate; override; + procedure CalculateBounds; override; + end; + + TdxPSREReportLinkRenderInfo = class(TdxPSReportRenderInfo) + private + FDetailsTwipsRect: TRect; + FFormatRange: TFormatRange; + FPageSize: TPoint; + FPageTwipsRect: TRect; + function GetPageRenderInfo(Index: Integer): TdxPSREPageRenderInfo; + function GetREHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; + function GetReportLink: TAbstractdxRichEditReportLink; + + procedure DoFormatRichEdit; + procedure FormatRichEdit; + procedure PrepareFormatRange; + procedure SetupFormatRangeForNonSelection; + procedure UnprepareFormatRange; + protected + FirstChar: Integer; + LastChar: Integer; + + procedure CalculatePageRenderInfos; override; + procedure DoCalculate; override; + procedure Refresh; override; + + function GetPageRenderInfoClass: TdxPSPageRenderInfoClass; override; + function GetPageColCount: Integer; override; + function GetPageRowCount: Integer; override; + function GetPageSize: TPoint; override; + function GetUnitsPerInch: Integer; override; + function GetWindowScalePair: TdxWindowScalePair; override; + + function LoMetricValueToInternalUnits(Value: Integer): Integer; override; + + property PageRenderInfos[Index: Integer]: TdxPSREPageRenderInfo read GetPageRenderInfo; + property REHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF} read GetREHandle; + property ReportLink: TAbstractdxRichEditReportLink read GetReportLink; + end; + + TdxPSREReportRenderer = class(TdxPSReportRenderer) + private + function GetREHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; + function GetPageRenderInfo: TdxPSREPageRenderInfo; + function GetRenderInfo: TdxPSREReportLinkRenderInfo; + function GetReportLink: TAbstractdxRichEditReportLink; + protected + function GetUnitsPerInch: Integer; override; + procedure PrepareRects; + procedure PrepareRenderPage; override; + procedure RenderPageContent; override; + procedure UnprepareRects; + procedure UnprepareRenderPage; override; + + property REHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF} read GetREHandle; + property PageRenderInfo: TdxPSREPageRenderInfo read GetPageRenderInfo; + property RenderInfo: TdxPSREReportLinkRenderInfo read GetRenderInfo; + property ReportLink: TAbstractdxRichEditReportLink read GetReportLink; + end; + + TdxRichEditVersion = 1..2; + + TAbstractdxRichEditReportLink = class(TBasedxReportLink, IdxPSNativeWin32ControlHandleSupport) + private + FOnlySelected: Boolean; + FRichEditVersion: TdxRichEditVersion; + function GetHasText: Boolean; + procedure SetOnlySelected(Value: Boolean); + procedure SetRichEditVersion(Value: TdxRichEditVersion); + procedure GetCharRange(var ASelStart, ASelLength: Integer); + protected + procedure ConstructReport(AReportCells: TdxReportCells); override; + procedure DoCustomDrawPageHeaderOrFooter(AHFObject: TCustomdxPageObject; + ACanvas: TCanvas; APageIndex: Integer; R: TRect; + var ADefaultDrawText, ADefaultDrawBackground: Boolean); override; + procedure DoCustomDrawPageTitle(ACanvas: TCanvas; R: TRect; + var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var AColor: TColor; AFont: TFont; var ADone: Boolean); override; + function GetRealScaleFactor: Integer; override; + function GetRendererClass: TdxPSReportRendererClass; override; + function GetRenderInfoClass: TdxPSReportRenderInfoClass; override; + procedure InternalRestoreDefaults; override; + + { IdxPSNativeWin32ControlHandleSupport } + function GetNativeHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; + procedure SetNativeHandle(Value: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}); + + function GetRichEditHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; virtual; abstract; + function TryLoadRichEditDLL(AVersion: Integer): Boolean; + + property HasText: Boolean read GetHasText; + public + constructor Create(AOwner: TComponent); override; + + class function Aggregable: Boolean; override; + class function CanBeUsedAsStub: Boolean; override; + class function Serializable: Boolean; override; + function SupportsScaling: Boolean; override; + + property REHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF} read GetRichEditHandle; + published + property OnlySelected: Boolean read FOnlySelected write SetOnlySelected default False; + property RichEditVersion: TdxRichEditVersion read FRichEditVersion write SetRichEditVersion default 1; + end; + + TCustomdxRichEditReportLink = class(TAbstractdxRichEditReportLink) + protected + function GetCustomRichEdit: TCustomRichEdit; virtual; + function GetRichEditHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; override; + + property CustomRichEdit: TCustomRichEdit read GetCustomRichEdit; + end; + + TdxRichEditReportLink = class(TCustomdxRichEditReportLink) + private + function GetRichEdit: TRichEdit; + public + property RichEdit: TRichEdit read GetRichEdit; + end; + +function GetRichEditAsGraphic(AWnd: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; + ABkColor: TColor; const AMargins: TRect; AGraphicClass: TGraphicClass = nil; {TMetafile} + AWidth: Integer = -1; AHeight: Integer = -1; AMaxHeight: Integer = -1; ARefDC: HDC = 0): TGraphic; overload; + +implementation + +uses + {$IFDEF DELPHI6} + Types, + {$ENDIF} + SysUtils, Messages, Forms, dxPSUtl; + +const + TextOffset = 2; + +{ Helpers } + +function GetTextLengthEx(AHandle: HWND; const ATextLengthEx: TGetTextLengthEx): Integer; +begin + Result := SendMessage(AHandle, EM_GETTEXTLENGTHEX, WPARAM(@ATextLengthEx), 0); +End; + +{ Utilities } + +function GetRichEditAsGraphic(AWnd: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; + ABkColor: TColor; const AMargins: TRect; AGraphicClass: TGraphicClass = nil; {TMetafile} + AWidth: Integer = -1; AHeight: Integer = -1; AMaxHeight: Integer = -1; ARefDC: HDC = 0): TGraphic; +const + TwipsPerInch = 1440; + + function CalculateRichEditHeight(DC: HDC; const APPI: TPoint; AWidth: Integer; + out AMaxChars: Integer): Integer; + + function CalculateCharCount: Integer; + //var + // ClsName: array[0..1023] of Char; + begin + //GetClassName(AWnd, @ClsName, 1023); + Result := SendMessage(AWnd, WM_GETTEXTLENGTH, 0, 0); + end; + + function CalculateMaxHeight: Integer; + begin + Result := AMaxHeight; + if Result <> -1 then + Result := MulDiv(Result, TwipsPerInch, APPI.Y); + end; + + var + CharCount, MaxHeight: Integer; + FormatRange: TFormatRange; + begin + CharCount := CalculateCharCount; + if CharCount = 0 then + begin + Result := 0; + Exit; + end; + + MaxHeight := CalculateMaxHeight; + + FillChar(FormatRange, SizeOf(FormatRange), 0); + if MaxHeight = -1 then + begin + Result := 0; + repeat + FormatRange.hdc := DC; + FormatRange.hdcTarget := DC; + FormatRange.rc.Right := MulDiv(AWidth - (AMargins.Left + AMargins.Right), TwipsPerInch, APPI.X); + FormatRange.rc.Bottom := TwipsPerInch; + FormatRange.rcPage := FormatRange.rc; + FormatRange.chrg.cpMax := -1; + + FormatRange.chrg.cpMin := SendMessage(AWnd, EM_FORMATRANGE, 0, Longint(@FormatRange)); + Inc(Result, FormatRange.rc.Bottom - FormatRange.rc.Top); + until (FormatRange.chrg.cpMin >= CharCount) or (FormatRange.chrg.cpMin = -1); + AMaxChars := -1; + end + else + begin + FormatRange.hdc := DC; + FormatRange.hdcTarget := DC; + FormatRange.rc.Right := MulDiv(AWidth - 2 * TextOffset, TwipsPerInch, APPI.X); + FormatRange.rc.Bottom := MaxHeight; + FormatRange.rcPage := FormatRange.rc; + FormatRange.chrg.cpMax := -1; + AMaxChars := SendMessage(AWnd, EM_FORMATRANGE, 0, Longint(@FormatRange)); + if AMaxChars = 0 then + AMaxChars := -1; + Result := FormatRange.rc.Bottom - FormatRange.rc.Top; + end; + SendMessage(AWnd, EM_FORMATRANGE, 0, 0); + Result := MulDiv(Result, APPI.Y, TwipsPerInch) + AMargins.Top + AMargins.Bottom; + end; + + function PrepareFormatRange(DC: HDC; const APPI: TPoint; + AWidth, AHeight: Integer{In Twips}; AMaxChars: Integer): TFormatRange; + + function CalculateRenderBounds(const R: TRect): TRect; + begin + Result := R; + with Result do + begin + Inc(Left, MulDiv(AMargins.Left, TwipsPerInch, APPI.X)); + Inc(Top, MulDiv(AMargins.Top, TwipsPerInch, APPI.Y)); + Dec(Right, MulDiv(AMargins.Right, TwipsPerInch, APPI.X)); + Dec(Bottom, MulDiv(AMargins.Bottom, TwipsPerInch, APPI.Y)); + end; + end; + + begin + FillChar(Result, SizeOf(Result), 0); + with Result do + begin + Result.hdc := DC; + Result.hdcTarget := DC; + Result.rcPage.Right := AWidth; + Result.rcPage.Bottom := AHeight; + Result.rc := CalculateRenderBounds(rcPage); + Result.chrg.cpMin := 0; + Result.chrg.cpMax := AMaxChars; + end; + end; + + procedure RenderRichEdit(DC: HDC; const AFormatRange: TFormatRange); + begin + SetMapMode(DC, MM_TEXT); + SendMessage(AWnd, EM_FORMATRANGE, 0, 0); + try + SendMessage(AWnd, EM_FORMATRANGE, 1, Longint(@AFormatRange)); + finally + SendMessage(AWnd, EM_FORMATRANGE, 0, 0); + end; + end; + + function GetRichEditAsMetafile(DC: HDC; const APPI: TPoint; AWidth, AHeight: Integer; + AMaxChars: Integer): TMetafile; + const + HundredsMMPerInch = 2540; + var + MetaCanvas: TMetafileCanvas; + FormatRange: TFormatRange; + begin + Result := TMetafile.Create; + try + Result.MMWidth := MulDiv(AWidth, HundredsMMPerInch, APPI.X); + Result.MMHeight := MulDiv(AHeight, HundredsMMPerInch, APPI.Y); + MetaCanvas := TMetafileCanvas.Create(Result, DC); + try + MetaCanvas.Brush.Color := ABkColor; + MetaCanvas.FillRect(MakeRect(0, 0, AWidth + 1, AHeight + 1)); + + AWidth := MulDiv(Result.MMWidth, TwipsPerInch, HundredsMMPerInch); + AHeight := MulDiv(Result.MMHeight, TwipsPerInch, HundredsMMPerInch); + FormatRange := PrepareFormatRange(MetaCanvas.Handle, APPI, AWidth, AHeight, AMaxChars); + RenderRichEdit(MetaCanvas.Handle, FormatRange); + finally + MetaCanvas.Free; + end; + except + FreeAndNil(Result); + raise; + end; + end; + + function GetRichEditAsBitmap(DC: HDC; const APPI: TPoint; AWidth, AHeight: Integer; + AMaxChars: Integer): TBitmap; + var + FormatRange: TFormatRange; + begin + Result := TBitmap.Create; + try + Result.Width := AWidth; + Result.Height := AHeight; + + Result.Canvas.Brush.Color := ABkColor; + Result.Canvas.FillRect(MakeRect(0, 0, AWidth, AHeight)); + + AWidth := MulDiv(AWidth, TwipsPerInch, APPI.X); + AHeight := MulDiv(AHeight, TwipsPerInch, APPI.Y); + FormatRange := PrepareFormatRange(Result.Canvas.Handle, APPI, AWidth, AHeight, AMaxChars); + Result.Canvas.Handle := CreateCompatibleDC(DC); + RenderRichEdit(Result.Canvas.Handle, FormatRange); + Result.HandleType := bmDIB; + except + FreeAndNil(Result); + raise; + end; + end; + +var + DC: HDC; + PPI: TPoint; + R: TRect; + W, H, MaxChars: Integer; + Bitmap: TBitmap; +begin + DC := ARefDC; + if DC = 0 then DC := GetDC(0); + try + PPI.X := GetDeviceCaps(DC, LOGPIXELSX); + PPI.Y := GetDeviceCaps(DC, LOGPIXELSY); + + W := AWidth; + H := AHeight; + if (W = -1) or (H = -1) then + begin + GetWindowRect(AWnd, R); + with R do + begin + if W = -1 then W := Right - Left; + if H = -1 then H := CalculateRichEditHeight(DC, PPI, W, MaxChars); + end; + end; + + if (H = 0) or (W = 0) then + begin + Result := nil; + Exit; + end; + + if AGraphicClass = nil then AGraphicClass := TMetafile; + if not AGraphicClass.InheritsFrom(TMetafile) then + begin + Bitmap := GetRichEditAsBitmap(DC, PPI, W, H, MaxChars); + try + if AGraphicClass <> TBitmap then + begin + Result := dxPSUtl.CreateGraphic(AGraphicClass); + try + Result.Assign(Bitmap); + except + FreeAndNil(Bitmap); + FreeAndNil(Result); + raise; + end; + end + else + Result := Bitmap; + finally + if AGraphicClass <> TBitmap then Bitmap.Free; + end; + end + else + Result := GetRichEditAsMetafile(DC, PPI, W, H, MaxChars); + + finally + if ARefDC = 0 then ReleaseDC(0, DC); + end; +end; + +{ TdxPSCustomRichEditProducer } + +function TdxPSCustomRichEditProducer.Control: TCustomRichEdit; +begin + Result := inherited Control as TCustomRichEdit; +end; + +class function TdxPSCustomRichEditProducer.ControlClass: TControlClass; +begin + Result := TCustomRichEdit; +end; + +function TdxPSCustomRichEditProducer.ProducingObjectFriendlyName: string; +begin + Result := ''; + if not IsDesigning and (RichEdit_GetLines(Control).Count <> 0) then + Result := dxPSContainerLnk.dxPSMakeFriendlyNameFromStrings(RichEdit_GetLines(Control)); + if Result = '' then + Result := inherited ProducingObjectFriendlyName; +end; + +function TdxPSCustomRichEditProducer.CreateImage: TGraphic; + + function GetMargins: TRect; + begin + Result := MakeRect(dxTextSpace, dxTextSpace, dxTextSpace, dxTextSpace); + end; + + function GetMaxHeight: Integer; + begin + if Definition.OptionsPlace.ExpandHeight then + Result := -1 + else + Result := Control.Height; + end; + +begin + Result := GetRichEditAsGraphic(Control.Handle, Control_GetColor(Control), + GetMargins, TMetafile, Control.Width, -1, GetMaxHeight, DC); +end; + +procedure TdxPSCustomRichEditProducer.InitializeItem(AnItem: TdxReportVisualItem); +var + Graphic: TGraphic; +begin + inherited; + with TdxReportCellGraphic(AnItem) do + begin + CellSides := BorderStyleMap[RichEdit_GetBorderStyle(Control)]; + Color := Control_GetColor(Control); + Graphic := Self.CreateImage; + try + Image := Graphic; + finally + Graphic.Free; + end; + Transparent := False; + end; +end; + +function TdxPSCustomRichEditProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellGraphic; +end; + +{ TdxPSREPageRenderInfo } + +procedure TdxPSREPageRenderInfo.AdjustTwipsRect; +begin + if HasTitle then + Inc(DetailsTwipsRect.Top, MulDiv(TitleHeight, 1440, RenderInfo.UnitsPerInch)); +end; + +procedure TdxPSREPageRenderInfo.Calculate; +begin + CalculateBounds; + CalculateOffsets; +end; + +procedure TdxPSREPageRenderInfo.CalculateBounds; +begin + DetailBounds := PrinterPage.PaintRectPixels; +end; + +{ TdxPSREReportLinkRenderInfo } + +procedure TdxPSREReportLinkRenderInfo.CalculatePageRenderInfos; +var + I: Integer; +begin + FormatRichEdit; + for I := 0 to VirtualPageCount - 1 do + PageRenderInfos[I].Calculate; +end; + +procedure TdxPSREReportLinkRenderInfo.DoCalculate; +begin + FPageSize := inherited GetPageSize; + CalculateTitleBounds; + CalculateHeaderAndFooterBounds; + CalculatePageHeaderAndFooterBounds; + CalculatePageRenderInfos; +end; + +procedure TdxPSREReportLinkRenderInfo.Refresh; +begin + inherited; + FillChar(FFormatRange, SizeOf(TFormatRange), 0); + FirstChar := 0; + LastChar := 0; + FDetailsTwipsRect := dxPSGlbl.NullRect; + FPageTwipsRect := dxPSGlbl.NullRect; +end; + +function TdxPSREReportLinkRenderInfo.GetPageRenderInfoClass: TdxPSPageRenderInfoClass; +begin + Result := TdxPSREPageRenderInfo; +end; + +function TdxPSREReportLinkRenderInfo.GetPageColCount: Integer; +begin + Result := 1; +end; + +function TdxPSREReportLinkRenderInfo.GetPageRowCount: Integer; +begin + Result := VirtualPageCount; +end; + +function TdxPSREReportLinkRenderInfo.GetPageSize: TPoint; +begin + Result := FPageSize; +end; + +function TdxPSREReportLinkRenderInfo.GetUnitsPerInch: Integer; +begin + Result := Screen.PixelsPerInch; +end; + +function TdxPSREReportLinkRenderInfo.GetWindowScalePair: TdxWindowScalePair; +begin + Result.Numerator := 100; + Result.Denominator := 100; +end; + +function TdxPSREReportLinkRenderInfo.LoMetricValueToInternalUnits(Value: Integer): Integer; +begin + // We don't have to take into account the ScaleFactor + Result := MulDiv(Value, UnitsPerInch, 254); +end; + +function TdxPSREReportLinkRenderInfo.GetPageRenderInfo(Index: Integer): TdxPSREPageRenderInfo; +begin + Result := inherited PageRenderInfos[Index] as TdxPSREPageRenderInfo; +end; + +function TdxPSREReportLinkRenderInfo.GetREHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; +begin + Result := ReportLink.REHandle; +end; + +function TdxPSREReportLinkRenderInfo.GetReportLink: TAbstractdxRichEditReportLink; +begin + Result := inherited ReportLink as TAbstractdxRichEditReportLink; +end; + +procedure TdxPSREReportLinkRenderInfo.DoFormatRichEdit; +var + PageRenderInfo: TdxPSREPageRenderInfo; +begin + VirtualPageCount := 0; + repeat + PageRenderInfo := CreatePageRenderInfo(VirtualPageCount) as TdxPSREPageRenderInfo; + if VirtualPageCount = 0 then + PageRenderInfo.FirstChar := FirstChar + else + PageRenderInfo.FirstChar := PageRenderInfos[VirtualPageCount - 1].LastChar; + + FFormatRange.chrg.cpMin := PageRenderInfo.FirstChar; + FFormatRange.rcPage := FPageTwipsRect; + + PageRenderInfo.DetailsTwipsRect := FDetailsTwipsRect; + PageRenderInfo.AdjustTwipsRect; + FFormatRange.rc := PageRenderInfo.DetailsTwipsRect; + + PageRenderInfo.LastChar := SendMessage(REHandle, EM_FORMATRANGE, 0, Longint(@FFormatRange)); + if PageRenderInfo.LastChar > LastChar then + PageRenderInfo.LastChar := LastChar; + Inc(VirtualPageCount); + + until (PageRenderInfo.LastChar >= LastChar) or (PageRenderInfo.LastChar = -1); +end; + +procedure TdxPSREReportLinkRenderInfo.FormatRichEdit; +begin + PrepareFormatRange; + try + if LastChar > 0 then + DoFormatRichEdit; + finally + UnprepareFormatRange; + end; +end; + +procedure TdxPSREReportLinkRenderInfo.PrepareFormatRange; +var + SelStart, SelLength: Integer; +begin + FPageTwipsRect.BottomRight := ScalePoint(PrinterPage.RealPageSizeLoMetric, 1440, 254); + FDetailsTwipsRect := ScaleRect(PrinterPage.PaintRectLoMetric, 1440, 254, 1440, 254); + + ReportLink.GetCharRange(SelStart, SelLength); + if SelLength <> 0 then + begin + FirstChar := SelStart; + LastChar := SelStart + SelLength; + end + else + SetupFormatRangeForNonSelection; + + with FFormatRange do + begin + hDC := GetDC(0); + hdcTarget := hDC; + rc := FDetailsTwipsRect; + rcPage := FPageTwipsRect; + if SelLength = 0 then + chrg.cpMax := -1 + else + chrg.cpMax := LastChar; + end; + + SendMessage(REHandle, EM_FORMATRANGE, 0, 0); +end; + +procedure TdxPSREReportLinkRenderInfo.SetupFormatRangeForNonSelection; +var + TextLenEx: TGetTextLengthEx; +begin + FirstChar := 0; + if ReportLink.RichEditVersion > 1 then + begin + with TextLenEx do + begin + Flags := GTL_DEFAULT; + CodePage := CP_ACP; + end; + LastChar := GetTextLengthEx(REHandle, TextLenEx); + end + else + LastChar := SendMessage(REHandle, WM_GETTEXTLENGTH, 0, 0); +end; + +procedure TdxPSREReportLinkRenderInfo.UnprepareFormatRange; +begin + SendMessage(REHandle, EM_FORMATRANGE, 0, 0); + ReleaseDC(0, FFormatRange.hDC); +end; + +{ TdxPSREReportLinkRenderInfo } + +function TdxPSREReportRenderer.GetUnitsPerInch: Integer; +begin + if IsPrinterDC(DC) then + Result := PPI + else + Result := inherited GetUnitsPerInch; +end; + +procedure TdxPSREReportRenderer.PrepareRects; +begin + with RenderInfo do + begin + FPageSize.X := MulDiv(FPageSize.X, PPI, UnitsPerInch); + FPageSize.Y := MulDiv(FPageSize.Y, PPI, UnitsPerInch); + PageHeaderBounds := ScaleRect(PageHeaderBounds, PPI, UnitsPerInch, PPI, UnitsPerInch); + PageFooterBounds := ScaleRect(PageFooterBounds, PPI, UnitsPerInch, PPI, UnitsPerInch); + TitleBounds := ScaleRect(TitleBounds, PPI, UnitsPerInch, PPI, UnitsPerInch); + PageRenderInfo.TitleOffset := ScalePoint(PageRenderInfo.TitleOffset, PPI, UnitsPerInch); + end; +end; + +procedure TdxPSREReportRenderer.PrepareRenderPage; +begin + PrepareRects; + inherited; +end; + +procedure TdxPSREReportRenderer.RenderPageContent; +var + FormatRange: TFormatRange; + ClipRect: TRect; + Rgn: HRGN; + LastChar: Integer; +begin + FillChar(FormatRange, SizeOf(TFormatRange), 0); + with FormatRange do + begin + hDC := DC; + hdcTarget := DC;{3.1} + rc := PageRenderInfo.DetailsTwipsRect; + rcPage := RenderInfo.FPageTwipsRect; + chrg.cpMin := PageRenderInfo.FirstChar; + chrg.cpMax := PageRenderInfo.LastChar; + end; + + ClipRect := ScaleRect(PageRenderInfo.DetailBounds, PPI, RenderInfo.UnitsPerInch, PPI, RenderInfo.UnitsPerInch); + + Rgn := IntersectClipRect(ClipRect); + + SendMessage(REHandle, EM_FORMATRANGE, 0, 0); + try + LastChar := SendMessage(REHandle, EM_FORMATRANGE, 1, Longint(@FormatRange)); + + if PageRenderInfo.LastChar <> LastChar then + begin + PageRenderInfo.LastChar := LastChar; + if RenderingPageIndex < RenderInfo.VirtualPageCount - 1 then + RenderInfo.PageRenderInfos[RenderingPageIndex + 1].FirstChar := LastChar; + + // Small trick: because Print output does not equal Preview output, + // we should invalidate Preview window after Print-Out + if IsPrinterDC(DC) and ReportLink.ComponentPrinter.PreviewExists then + ReportLink.ComponentPrinter.PreviewWindow.InvalidatePage(RenderingPageIndex); + end; + finally + SendMessage(REHandle, EM_FORMATRANGE, 0, 0); + end; + + RestoreClipRgn(Rgn); +end; + +procedure TdxPSREReportRenderer.UnprepareRects; +begin + with RenderInfo do + begin + FPageSize.X := MulDiv(FPageSize.X, UnitsPerInch, PPI); + FPageSize.Y := MulDiv(FPageSize.Y, UnitsPerInch, PPI); + PageHeaderBounds := ScaleRect(PageHeaderBounds, UnitsPerInch, PPI, UnitsPerInch, PPI); + PageFooterBounds := ScaleRect(PageFooterBounds, UnitsPerInch, PPI, UnitsPerInch, PPI); + TitleBounds := ScaleRect(TitleBounds, UnitsPerInch, PPI, UnitsPerInch, PPI); + PageRenderInfo.TitleOffset := ScalePoint(PageRenderInfo.TitleOffset, UnitsPerInch, PPI); + end; +end; + +procedure TdxPSREReportRenderer.UnprepareRenderPage; +begin + inherited; + UnprepareRects; +end; + +function TdxPSREReportRenderer.GetREHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; +begin + Result := ReportLink.REHandle; +end; + +function TdxPSREReportRenderer.GetPageRenderInfo: TdxPSREPageRenderInfo; +begin + Result := inherited PageRenderInfo as TdxPSREPageRenderInfo; +end; + +function TdxPSREReportRenderer.GetRenderInfo: TdxPSREReportLinkRenderInfo; +begin + Result := inherited RenderInfo as TdxPSREReportLinkRenderInfo; +end; + +function TdxPSREReportRenderer.GetReportLink: TAbstractdxRichEditReportLink; +begin + Result := inherited ReportLink as TAbstractdxRichEditReportLink; +end; + +{ TAbstractdxRichEditReportLink } + +constructor TAbstractdxRichEditReportLink.Create(AOwner: TComponent); +begin + inherited; + FRichEditVersion := 1; +end; + +class function TAbstractdxRichEditReportLink.Aggregable: Boolean; +begin + Result := False; +end; + +class function TAbstractdxRichEditReportLink.CanBeUsedAsStub: Boolean; +begin + Result := False; +end; + +class function TAbstractdxRichEditReportLink.Serializable: Boolean; +begin + Result := False; +end; + +function TAbstractdxRichEditReportLink.SupportsScaling: Boolean; +begin + Result := False; +end; + +procedure TAbstractdxRichEditReportLink.ConstructReport(AReportCells: TdxReportCells); +begin +end; + +procedure TAbstractdxRichEditReportLink.DoCustomDrawPageHeaderOrFooter( + AHFObject: TCustomdxPageObject; ACanvas: TCanvas; APageIndex: Integer; + R: TRect; var ADefaultDrawText, ADefaultDrawBackground: Boolean); +var + APixelsNumerator: Integer; +begin + APixelsNumerator := Renderer.PPI; + DoParentCustomDrawPageHeaderOrFooter(AHFObject, ACanvas, APageIndex, R, + ADefaultDrawText, ADefaultDrawBackground, APixelsNumerator); + if ADefaultDrawText or ADefaultDrawBackground then + if AHFObject is TdxPageHeader then + begin + if Assigned(OnCustomDrawPageHeader) then + OnCustomDrawPageHeader(Self, ACanvas, APageIndex, R, + APixelsNumerator, PixelsDenominator, ADefaultDrawText, + ADefaultDrawBackground) + end + else + if Assigned(OnCustomDrawPageFooter) then + OnCustomDrawPageFooter(Self, ACanvas, APageIndex, R, + APixelsNumerator, PixelsDenominator, ADefaultDrawText, + ADefaultDrawBackground); +end; + +procedure TAbstractdxRichEditReportLink.DoCustomDrawPageTitle(ACanvas: TCanvas; + R: TRect; var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var AColor: TColor; AFont: TFont; var ADone: Boolean); +var + APixelsNumerator: Integer; +begin + APixelsNumerator := Renderer.PPI; + DoParentCustomDrawReportTitle(ACanvas, R, ATextAlignX, ATextAlignY, + AColor, AFont, ADone, APixelsNumerator); + if not ADone and Assigned(OnCustomDrawReportLinkTitle) then + OnCustomDrawReportLinkTitle(Self, ACanvas, R, APixelsNumerator, + PixelsDenominator, ATextAlignX, ATextAlignY, AColor, AFont, ADone); +end; + +function TAbstractdxRichEditReportLink.GetRealScaleFactor: Integer; +begin + Result := 100; +end; + +function TAbstractdxRichEditReportLink.GetRendererClass: TdxPSReportRendererClass; +begin + Result := TdxPSREReportRenderer; +end; + +function TAbstractdxRichEditReportLink.GetRenderInfoClass: TdxPSReportRenderInfoClass; +begin + Result := TdxPSREReportLinkRenderInfo; +end; + +procedure TAbstractdxRichEditReportLink.InternalRestoreDefaults; +begin + inherited; + OnlySelected := False; +end; + +{ IdxPSNativeWin32ControlHandleSupport } + +function TAbstractdxRichEditReportLink.GetNativeHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; +begin + Result := REHandle; +end; + +procedure TAbstractdxRichEditReportLink.SetNativeHandle(Value: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}); +begin +end; + +function TAbstractdxRichEditReportLink.TryLoadRichEditDLL(AVersion: Integer): Boolean; +const + REVersions: array[Boolean] of string = ('RICHED32.DLL', 'RICHED20.DLL'); +var + OldError: Longint; + LibHandle: THandle; +begin + OldError := SetErrorMode(SEM_NOOPENFILEERRORBOX); + try + LibHandle := LoadLibrary(PChar(REVersions[AVersion > 1])); + try + if (LibHandle > 0) and (LibHandle < HINSTANCE_ERROR) then + LibHandle := 0; + Result := LibHandle <> 0; + finally + if LibHandle <> 0 then FreeLibrary(LibHandle); + end; + finally + SetErrorMode(OldError); + end; +end; + +function TAbstractdxRichEditReportLink.GetHasText: Boolean; +begin + Result := (REHandle <> 0) and (SendMessage(REHandle, WM_GETTEXTLENGTH, 0, 0) > 0); +end; + +procedure TAbstractdxRichEditReportLink.SetOnlySelected(Value: Boolean); +begin + if FOnlySelected <> Value then + begin + FOnlySelected := Value; + LinkModified(True); + end; +end; + +procedure TAbstractdxRichEditReportLink.SetRichEditVersion(Value: TdxRichEditVersion); +begin + if FRichEditVersion <> Value then + if TryLoadRichEditDLL(Value) then + begin + FRichEditVersion := Value; + LinkModified(True); + end; +end; + +procedure TAbstractdxRichEditReportLink.GetCharRange(var ASelStart, ASelLength: Integer); +var + CharRange: TCharRange; +begin + ASelStart := 0; + ASelLength := 0; + if (REHandle <> 0) and OnlySelected and HasText then + begin + SendMessage(REHandle, EM_EXGETSEL, 0, Longint(@CharRange)); + ASelStart := CharRange.cpMin; + ASelLength := CharRange.cpMax - CharRange.cpMin; + end; +end; + +{ TCustomdxRichEditReportLink } + +function TCustomdxRichEditReportLink.GetCustomRichEdit: TCustomRichEdit; +begin + Result := TCustomRichEdit(Component); +end; + +function TCustomdxRichEditReportLink.GetRichEditHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; +begin + if CustomRichEdit <> nil then + begin + CustomRichEdit.HandleNeeded; + Result := CustomRichEdit.Handle; + end + else + Result := 0; +end; + +{ TdxRichEditReportLink } + +function TdxRichEditReportLink.GetRichEdit: TRichEdit; +begin + Result := inherited Component as TRichEdit; +end; + +{ Assistants } + +procedure RegisterProducers; +begin + TdxPSCustomRichEditProducer.Register; +end; + +procedure UnregisterProducers; +begin + TdxPSCustomRichEditProducer.Unregister; +end; + +initialization + dxPSRegisterReportLink(TdxRichEditReportLink, TRichEdit, nil); + RegisterProducers; + +finalization + UnregisterProducers; + dxPSUnregisterReportLink(TdxRichEditReportLink, TRichEdit, nil); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSRELnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSRELnkReg.pas new file mode 100644 index 00000000..590d3e35 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSRELnkReg.pas @@ -0,0 +1,61 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSRELnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + {$IFDEF DELPHI6} + DesignIntf, + {$ELSE} + DsgnIntf, + {$ENDIF} + Classes, dxPSRELnk; + +procedure Register; +begin + RegisterNoIcon([TdxRichEditReportLink]); + RegisterPropertyEditor(TypeInfo(string), TdxRichEditReportLink, 'DesignerCaption', nil); + RegisterPropertyEditor(TypeInfo(THelpContext), TdxRichEditReportLink, 'DesignerHelpContext', nil); +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSReg.pas new file mode 100644 index 00000000..0b6eecfd --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSReg.pas @@ -0,0 +1,2599 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSReg; + +interface + +{$I cxVer.inc} + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignEditors, + {$ELSE} + DsgnIntf, + {$ENDIF} + PicEdit, + Classes, dxPSCore; + +type + TdxReportLinkComponentPropertyEditor = class(TComponentProperty) + private + FComponents: TStringList; + function GetReportLink: TBasedxReportLink; + protected + procedure AddComponent(const AName: string); + procedure GetComponents; virtual; + function IsComponentValid(AComponent: TComponent): Boolean; virtual; + public + destructor Destroy; override; + procedure Initialize; override; + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + property ReportLink: TBasedxReportLink read GetReportLink; + end; + +procedure Register; + +implementation + +{$R dxPSDsgImgs.res} + +{$IFNDEF DELPHI6} + {Delphi6 and up versions don't support Bitmaps in MenuItem} + {$IFDEF DELPHI5} + {$DEFINE IDE_MENUBITMAPS} + {$ENDIF} +{$ENDIF} + +{.$DEFINE LIMITED_EDITION} + +uses + {$IFDEF DELPHI6} + DesignConst, DesignMenus, VCLEditors, RTLConsts, + {$ELSE} + Consts, + {$ENDIF} + ToolsAPI, + Windows, SysUtils, ShellAPI, FileCtrl, Graphics, Dialogs, Controls, ExtCtrls, + TabNotBk, ImgList, Forms, TypInfo, + {$IFDEF IDE_MENUBITMAPS} Menus, {$ENDIF} + {$IFNDEF LIMITED_EDITION} dxRegEd, {$ENDIF} + dxPSGlbl, dxPSUtl, dxWrap, dxBase, dxPSEngn, dxPreVw, dxPrnPg, dxBkgnd, + dxPrnDev, dxPgsDlg, dxPrnDlg, dxPPAttr, dxPSfmTtl, dxPSFileBasedXplorer, + dxPSGraphicLnk, dxPSContainerLnk, dxPSTextLnk, dxBrhDlg, dxPSfmEditDesc, + dxPSPrVwDsg, dxPSfmStlAdd, dxPSfmLnkDsg, dxPSfmLnkAdd, dxPSfmLnkAddE, + dxPSDsgProxies, dxPSfmStlDsg; + +const + sdxDefault = 'Default'; + sdxRestoreDefaultIcon = 'Type "default" to restore original Icon'; + sdxRestoreDefaultGlyph = 'Type "default" to restore original Glyph'; + sdxCreateNewStyleManager = ''; + + sdxReportLinks = 'ReportLinks...'; + sdxPrintStyles = 'PrintStyles...'; + sdxAddNewStyle = '&Add...'; + sdxAddNewLink = '&Add...'; + sdxAddNewEmtpyLink = 'Add E&mpty...'; + sdxPageBackground = 'Page Bac&kground...'; + sdxClearBackground = 'Clea&r Background'; + sdxRestoreDefaults = 'Rest&ore Defaults'; + sdxRestoreOriginal = 'Restore Or&iginal'; + sdxMakeCurrent = '&Make Current'; + sdxPageSetupDialog = 'PageSetup Dialog...'; + sdxPageSetup = 'Page Set&up...'; + sdxPrintDialog = 'Print Dialog...'; + sdxPrint = '&Print...'; + sdxPrintPreview = 'Print Pre&view...'; + sdxShowReportDesigner = 'Show D&esigner...'; + sdxCreateFolders = 'Create &Folders'; + sdxDesignerNoAvailable = 'Designer not available'; + sdxClickForPageSetup = 'Click for Page Setup...'; + sdxCustomPaperSize = 'CustomSize - DMPAPER_USER #'; + sdxCustomBin = 'CustomBin - DMBIN_USER #'; + sdxInThousandths = '(in thousandths)'; + sdxWEBPage = 'http://www.devexpress.com'; + sdxDevex = 'Developer Express Inc.'; + sdxPrintingSystem: string = 'ExpressPrinting System '; + + IDB_DXPSDESIGN_BIN_AUTOTRAY = 'IDB_DXPSDESIGN_BIN_AUTOTRAY'; + IDB_DXPSDESIGN_BIN_MANUALTRAY = 'IDB_DXPSDESIGN_BIN_MANUALTRAY'; + IDB_DXPSDESIGN_PAPERORIENTATION_LANDSCAPE = 'IDB_DXPSDESIGN_PAPERORIENTATION_LANDSCAPE'; + IDB_DXPSDESIGN_PAPERORIENTATION_PORTRAIT = 'IDB_DXPSDESIGN_PAPERORIENTATION_PORTRAIT'; + IDB_DXPSDESIGN_PAPER_ENVELOPE = 'IDB_DXPSDESIGN_PAPER_ENVELOPE'; + IDB_DXPSDESIGN_PAPER_STANDARD = 'IDB_DXPSDESIGN_PAPER_STANDARD'; + IDB_DXPSDESIGN_PRINTORDER_OVERTHENDOWN = 'IDB_DXPSDESIGN_PRINTORDER_OVERTHENDOWN'; + IDB_DXPSDESIGN_PRINTORDER_DOWNTHENOVER = 'IDB_DXPSDESIGN_PRINTORDER_DOWNTHENOVER'; + + IDB_DXPSDESIGN_DOADD = 'IDB_DXPSDESIGN_DOADD'; + IDB_DXPSDESIGN_DOADDEMPTY = 'IDB_DXPSDESIGN_DOADDEMPTY'; + IDB_DXPSDESIGN_DODESIGNER = 'IDB_DXPSDESIGN_DODESIGNER'; + IDB_DXPSDESIGN_DOPAGEBACKGROUND = 'IDB_DXPSDESIGN_DOPAGEBACKGROUND'; + IDB_DXPSDESIGN_DOPAGESETUP = 'IDB_DXPSDESIGN_DOPAGESETUP'; + IDB_DXPSDESIGN_DOPREVIEW = 'IDB_DXPSDESIGN_DOPREVIEW'; + IDB_DXPSDESIGN_DOPRINT = 'IDB_DXPSDESIGN_DOPRINT'; + IDB_DXPSDESIGN_DOPROPERTIES = 'IDB_DXPSDESIGN_DOPROPERTIES'; + IDB_DXPSDESIGN_DOWEB = 'IDB_DXPSDESIGN_DOWEB'; + +{$IFDEF IDE_MENUBITMAPS} +var + FBmpWEB: TBitmap; + FBmpItems: TBitmap; + FBmpPrint: TBitmap; + FBmpPageSetup: TBitmap; + FBmpPageBackground: TBitmap; + FBmpDesigner: TBitmap; + FBmpPrintPreview: TBitmap; + FBmpNewEmpty: TBitmap; + FBmpNew: TBitmap; +{$ENDIF} + +{$IFDEF DELPHI5} +var + ilPapers: TImageList; + ilBins: TImageList; + ilPrintOrders: TImageList; + ilPaperOrientations: TImageList; +{$ENDIF} + +type + TdxComponentPrinterEditor = class(TComponentEditor) + public + procedure ExecuteVerb(Index: Integer); override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + {$IFDEF IDE_MENUBITMAPS} + procedure PrepareItem(Index: Integer; const AItem: TMenuItem); override; + {$ENDIF} + end; + + TdxReportLinkEditor = class(TComponentEditor) + private + function ReportLink: TBasedxReportLink; + public + procedure ExecuteVerb(Index: Integer); override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + {$IFDEF DELPHI5} + procedure PrepareItem(Index: Integer; + const AItem: {$IFDEF DELPHI6} IMenuItem {$ELSE} TMenuItem {$ENDIF}); override; + {$ENDIF} + end; + + TdxPrintStyleManagerEditor = class(TComponentEditor) + public + procedure ExecuteVerb(Index: Integer); override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + {$IFDEF IDE_MENUBITMAPS} + procedure PrepareItem(Index: Integer; const AItem: TMenuItem); override; + {$ENDIF} + end; + + TdxPrintStyleEditor = class(TComponentEditor) + private + function PrintStyle: TBasedxPrintStyle; + public + procedure ExecuteVerb(Index: Integer); override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + {$IFDEF DELPHI5} + procedure PrepareItem(Index: Integer; + const AItem: {$IFDEF DELPHI6} IMenuItem {$ELSE} TMenuItem{$ENDIF}); override; + {$ENDIF} + end; + + TdxPageSetupDialogEditor = class(TComponentEditor) + public + procedure ExecuteVerb(Index: Integer); override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + {$IFDEF DELPHI5} + procedure PrepareItem(Index: Integer; + const AItem: {$IFDEF DELPHI6} IMenuItem {$ELSE} TMenuItem{$ENDIF}); override; + {$ENDIF} + end; + + TdxPrintDialogEditor = class(TComponentEditor) + public + procedure ExecuteVerb(Index: Integer); override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + {$IFDEF IDE_MENUBITMAPS} + procedure PrepareItem(Index: Integer; const AItem: TMenuItem); override; + {$ENDIF} + end; + + TCustomdxPSExplorerEditor = class(TComponentEditor) + public + procedure ExecuteVerb(Index: Integer); override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + {$IFDEF IDE_MENUBITMAPS} + procedure PrepareItem(Index: Integer; const AItem: TMenuItem); override; + {$ENDIF} + end; + + TdxEngineControllerEditor = class(TComponentEditor) + public + procedure ExecuteVerb(Index: Integer); override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + {$IFDEF IDE_MENUBITMAPS} + procedure PrepareItem(Index: Integer; const AItem: TMenuItem); override; + {$ENDIF} + end; + + TdxCompositionReportLinkPropertyEditor = class(TComponentProperty) + private + FComponents: TStringList; + function GetItems: TdxCompositionLinkItems; + procedure CheckProc(const S: string); + function IsComponentValid(AComponent: TComponent): Boolean; + protected + public + destructor Destroy; override; + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure Initialize; override; + property Items: TdxCompositionLinkItems read GetItems; + end; + + TdxIndexPropertyEditor = class(TIntegerProperty) + public + function GetAttributes: TPropertyAttributes; override; + end; + + TdxReportLinkDesignerPropertyEditor = class(TPropertyEditor) + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure Edit; override; + end; + + TdxPSExplorerFilterPropertyEditor = class(TStringProperty + {$IFDEF DELPHI6}, ICustomPropertyListDrawing {$ENDIF}) + protected + {$IFDEF DELPHI5} + function GetImageIndex(const Value: string): Integer; + function GetImageList: TCustomImageList; + {$ENDIF} + function IsAcceptableComponentClass(AComponentClass: TClass): Boolean; virtual; + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + {$IFDEF DELPHI5} + procedure ListMeasureWidth(const Value: string; ACanvas: TCanvas; + var AWidth: Integer); {$IFNDEF DELPHI6} override; {$ENDIF} + procedure ListMeasureHeight(const Value: string; ACanvas: TCanvas; + var AHeight: Integer); {$IFNDEF DELPHI6} override; {$ENDIF} + procedure ListDrawValue(const Value: string; ACanvas: TCanvas; + const ARect: TRect; ASelected: Boolean); {$IFNDEF DELPHI6} override; {$ENDIF} + + property ImageIndexes[const Value: string]: Integer read GetImageIndex; + property ImageList: TCustomImageList read GetImageList; + {$ENDIF} + end; + +{$IFDEF DELPHI5} + + TdxPrintStyleImageIndexPropertyEditor = class(TIntegerProperty + {$IFDEF DELPHI6} + ,ICustomPropertyDrawing, ICustomPropertyListDrawing + {$ENDIF}) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure ListMeasureHeight(const Value: string; ACanvas: TCanvas; + var AHeight: Integer); {$IFNDEF DELPHI6} override;{$ENDIF} + procedure ListMeasureWidth(const Value: string; + ACanvas: TCanvas; var AWidth: Integer); {$IFNDEF DELPHI6} override;{$ENDIF} + procedure ListDrawValue(const Value: string; ACanvas: TCanvas; + const ARect: TRect; ASelected: Boolean); {$IFNDEF DELPHI6} override;{$ENDIF} + procedure PropDrawValue(ACanvas: TCanvas; const ARect: TRect; + ASelected: Boolean); {$IFNDEF DELPHI6} override;{$ENDIF} + {$IFDEF DELPHI6} + { ICustomPropertyDrawing } + procedure PropDrawName(ACanvas: TCanvas; const ARect: TRect; + ASelected: Boolean); + {$ENDIF} + end; + + TdxCustomDrawListPropertyEditor = class(TEnumProperty + {$IFDEF DELPHI6}, ICustomPropertyListDrawing {$ENDIF}) + protected + function GetImageIndex(const Value: string): Integer; virtual; abstract; + function GetImageList: TImageList; virtual; abstract; + public + procedure ListMeasureWidth(const Value: string; ACanvas: TCanvas; + var AWidth: Integer); {$IFNDEF DELPHI6} override; {$ENDIF} + procedure ListMeasureHeight(const Value: string; ACanvas: TCanvas; + var AHeight: Integer); {$IFNDEF DELPHI6} override; {$ENDIF} + procedure ListDrawValue(const Value: string; ACanvas: TCanvas; + const ARect: TRect; ASelected: Boolean); {$IFNDEF DELPHI6} override; {$ENDIF} + + property ImageIndexes[const Value: string]: Integer read GetImageIndex; + property ImageList: TImageList read GetImageList; + end; + + TdxPaperOrientationPropertyEditor = class(TdxCustomDrawListPropertyEditor) + protected + function GetImageIndex(const Value: string): Integer; override; + function GetImageList: TImageList; override; + end; + + TdxPrintOrderPropertyEditor = class(TdxCustomDrawListPropertyEditor) + protected + function GetImageIndex(const Value: string): Integer; override; + function GetImageList: TImageList; override; + end; + +{$ENDIF} + + TdxPathPropertyEditor = class(TStringProperty) + private + function GetExplorer(Index: Integer): TdxPSFileBasedExplorer; + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + property Explorers[Index: Integer]: TdxPSFileBasedExplorer read GetExplorer; + end; + + TdxRegistryPathPropertyEditor = class(TStringProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + + TdxExplorerStubLinkPropertyEditor = class(TComponentProperty) + public + procedure GetValues(Proc: TGetStrProc); override; + end; + + TdxCustomContainerReportLinkComponentPropertyEditor = class(TdxReportLinkComponentPropertyEditor + {$IFDEF DELPHI6}, ICustomPropertyListDrawing {$ENDIF}) + {$IFDEF DELPHI5} + private + function GetImageIndex(const Value: string): Integer; + function GetImages: TCustomImageList; + {$ENDIF} + protected + procedure GetComponents; override; + function GetProject: IOTAProject; + function IsComponentValid(AComponent: TComponent): Boolean; override; + function IsSupportedModuleType(const AModuleType: TOTAModuleType): Boolean; + {$IFDEF DELPHI5} + public + procedure Initialize; override; + procedure ListMeasureWidth(const Value: string; ACanvas: TCanvas; + var AWidth: Integer); {$IFNDEF DELPHI6} override; {$ENDIF} + procedure ListMeasureHeight(const Value: string; ACanvas: TCanvas; + var AHeight: Integer); {$IFNDEF DELPHI6} override; {$ENDIF} + procedure ListDrawValue(const Value: string; ACanvas: TCanvas; + const ARect: TRect; ASelected: Boolean); {$IFNDEF DELPHI6} override; {$ENDIF} + + property ImageIndexes[const Value: string]: Integer read GetImageIndex; + property Images: TCustomImageList read GetImages; + {$ENDIF} + end; + + TdxMeasurementUnitsPropertyEditor = class(TEnumProperty) + public + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + function GetValue: string; override; + end; + + TdxPrinterPagePropertyEditor = class(TClassProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + + TdxReportTitlePropertyEditor = class(TClassProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + + TdxReportTitleTextAlignXPropertyEditor = class(TEnumProperty) + public + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + TdxReportTitleTextAlignYPropertyEditor = class(TEnumProperty) + public + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + TdxHeaderFooterTextAlignYPropertyEditor = class(TEnumProperty) + public + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + TdxPrinterPagePropertyEditor2 = class(TClassProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + + TdxPointWrapperEditor = class(TClassProperty) + private + function PointWrapper: TdxPointWrapper; + public + function GetValue: string; override; + end; + + TdxRectWrapperEditor = class(TClassProperty) + private + function RectWrapper: TdxRectWrapper; + public + function GetValue: string; override; + end; + + TdxBackgroundPropertyEditor = class(TClassProperty) + private + function GetBackground: TdxBackground; + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + property Background: TdxBackground read GetBackground; + end; + + TdxBrushPropertyEditor = class(TClassProperty) + private + function GetBrush: TBrush; + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + property Brush: TBrush read GetBrush; + end; + + TTTFontPropertyEditor = class(TFontProperty) + public + procedure Edit; override; + end; + + TdxShowPgsDlgPropertyEditor = class(TPropertyEditor) + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure Edit; override; + end; + + TdxStyleGlyphPropertyEditor = class(TGraphicProperty) + private + function GetPrintStyle: TBasedxPrintStyle; + public + function GetValue: string; override; + procedure SetValue(const Value: string); override; + property PrintStyle: TBasedxPrintStyle read GetPrintStyle; + end; + + TdxCustomListDrawingIntegerPropertyEditor = class(TIntegerProperty + {$IFDEF DELPHI6}, ICustomPropertyListDrawing {$ENDIF}) + {$IFDEF DELPHI5} + protected + function GetImageIndex(const Value: string): Integer; virtual; abstract; + function GetImageList: TImageList; virtual; abstract; + public + procedure ListMeasureWidth(const Value: string; ACanvas: TCanvas; + var AWidth: Integer); {$IFNDEF DELPHI6} override; {$ENDIF} + procedure ListMeasureHeight(const Value: string; ACanvas: TCanvas; + var AHeight: Integer); {$IFNDEF DELPHI6} override; {$ENDIF} + procedure ListDrawValue(const Value: string; ACanvas: TCanvas; + const ARect: TRect; ASelected: Boolean); {$IFNDEF DELPHI6} override; {$ENDIF} + + property ImageIndexes[const Value: string]: Integer read GetImageIndex; + property ImageList: TImageList read GetImageList; + {$ENDIF} + end; + + TdxDMPaperPropertyEditor = class(TdxCustomListDrawingIntegerPropertyEditor) + {$IFDEF DELPHI5} + protected + function GetImageIndex(const Value: string): Integer; override; + function GetImageList: TImageList; override; + {$ENDIF} + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + TdxPaperSourcePropertyEditor = class(TdxCustomListDrawingIntegerPropertyEditor) + {$IFDEF DELPHI5} + protected + function GetImageIndex(const Value: string): Integer; override; + function GetImageList: TImageList; override; + {$ENDIF} + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + TdxPageNumberFormatsPropertyEditor = class(TIntegerProperty) + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + TdxReportLinkStyleManagerPropertyEditor = class(TComponentProperty) + private + function GetRoot: TComponent; + function GetUniqueName: string; + protected + function CanCreateStyleManager: Boolean; + function CreateNewStyleManager: TdxPrintStyleManager; + property Root: TComponent read GetRoot; + property UniqueName: string read GetUniqueName; + public + {$IFDEF DELPHI5} + function AutoFill: Boolean; override; + {$ELSE} + procedure Edit; override; + {$ENDIF} + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + TdxReportDocumentDescriptionPropertyEditor = class(TStringProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + + TdxDateFormatsPropertyEditor = class(TIntegerProperty) + private + FStrings: TStrings; + protected + public + destructor Destroy; override; + procedure Initialize; override; + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + TdxTimeFormatsPropertyEditor = class(TIntegerProperty) + private + FStrings: TStrings; + protected + public + destructor Destroy; override; + procedure Initialize; override; + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + TdxAutoHFTextEntriesPropertyEditor = class(TClassProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + + TdxPreviewIconPropertyEditor = class(TGraphicProperty) + private + function GetPreviewOptions: TdxPreviewOptions; + public + function GetValue: string; override; + procedure SetValue(const Value: string); override; + property PreviewOptions: TdxPreviewOptions read GetPreviewOptions; + end; + + TdxTextReportLinkAlignmentPropertyEditor = class(TEnumProperty) + public + procedure GetValues(Proc: TGetStrProc); override; + end; + +{$IFDEF DELPHI6} + + TdxComponentPrinterSelectionEditor = class(TSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + + TdxPrintStyleManagerSelectionEditor = class(TSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + + TdxPageSetupDialogSelectionEditor = class(TSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + + TdxPrintDialogSelectionEditor = class(TSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + +{$ENDIF} + +function TryStartWEBPage(const APage: string): Boolean; +begin + Result := ShellExecute(0, nil, PChar(APage), nil, nil, SW_SHOWNORMAL) >= 32; +end; + +{ TdxComponentPrinterEditor } + +procedure TdxComponentPrinterEditor.ExecuteVerb(Index: Integer); +begin + case Index of + 0: dxShowReportLinkDesigner(TCustomdxComponentPrinter(Component), Designer); + 3: TryStartWEBPage(sdxWEBPage); + end; +end; + +function TdxComponentPrinterEditor.GetVerb(Index: Integer): string; +begin + case Index of + 0: Result := sdxReportLinks; + 1: Result := '-'; + 2: Result := sdxPrintingSystem; + 3: Result := sdxWEBPage; + 4: Result := sdxDevex; + end +end; + +function TdxComponentPrinterEditor.GetVerbCount: Integer; +begin + Result := inherited GetVerbCount + 5; +end; + +{$IFDEF IDE_MENUBITMAPS} +procedure TdxComponentPrinterEditor.PrepareItem(Index: Integer; const AItem: TMenuItem); +begin + case Index of + 0: AItem.Bitmap := FBmpItems; + 3: AItem.Bitmap := FBmpWEB; + end +end; +{$ENDIF} + +{ TdxReportLinkEditor } + +function TdxReportLinkEditor.ReportLink: TBasedxReportLink; +begin + Result := TBasedxReportLink(Component); +end; + +procedure TdxReportLinkEditor.ExecuteVerb(Index: Integer); +begin + case Index of + 0: + if ReportLink.ComponentPrinter.DesignReport(ReportLink) then Designer.Modified; + 1: + begin + ReportLink.IsCurrentLink := True; + Designer.Modified; + end; + 3: + begin + ReportLink.RestoreFromOriginal; + Designer.Modified; + end; + 4: + begin + ReportLink.RestoreDefaults; + ReportLink.PrinterPage.RestoreDefaults; + Designer.Modified; + end; + 6: + if ReportLink.PrinterPage.Background.SetupEffects then + Designer.Modified; + 7: + begin + ReportLink.PrinterPage.Background.Mode := bmNone; + ReportLink.PrinterPage.Background.Picture := nil; + Designer.Modified; + end; + 9: + if ReportLink.PageSetup then Designer.Modified; + 10: + dxShowPreviewWindow(ReportLink.ComponentPrinter, Designer); + 11: + if ReportLink.Print(True, nil) then Designer.Modified; + end; +end; + +function TdxReportLinkEditor.GetVerb(Index: Integer): string; +begin + case Index of + 0: Result := sdxShowReportDesigner; + 1: Result := sdxMakeCurrent; + 2: Result := '-'; + 3: Result := sdxRestoreOriginal; + 4: Result := sdxRestoreDefaults; + 5: Result := '-'; + 6: Result := sdxPageBackground; + 7: Result := sdxClearBackground; + 8: Result := '-'; + 9: Result := sdxPageSetup; + 10: Result := sdxPrintPreview; + 11: Result := sdxPrint; + end; +end; + +function TdxReportLinkEditor.GetVerbCount: Integer; +begin + Result := 12; +end; + +{$IFDEF DELPHI5} +procedure TdxReportLinkEditor.PrepareItem(Index: Integer; + const AItem: {$IFDEF DELPHI6} IMenuItem {$ELSE} TMenuItem{$ENDIF}); +begin + case Index of + 0: + begin + AItem.Enabled := TBasedxReportLink(Component).CheckToDesign; + {$IFDEF IDE_MENUBITMAPS} + AItem.Bitmap := FBmpDesigner; + {$ENDIF} + end; + 1: AItem.Enabled := not TBasedxReportLink(Component).IsCurrentLink; + {$IFDEF IDE_MENUBITMAPS} + 6: AItem.Bitmap := FBmpPageBackground; + 9: AItem.Bitmap := FBmpPageSetup; + {$ENDIF} + 10: + begin + AItem.Enabled := TBasedxReportLink(Component).DataProviderPresent; + {$IFDEF IDE_MENUBITMAPS} + AItem.Bitmap := FBmpPrintPreview; + {$ENDIF} + end; + 11: + begin + AItem.Enabled := TBasedxReportLink(Component).DataProviderPresent; + {$IFDEF IDE_MENUBITMAPS} + AItem.Bitmap := FBmpPrint; + {$ENDIF} + end; + end; +end; +{$ENDIF} + +{ TdxReportLinkComponentPropertyEditor } + +destructor TdxReportLinkComponentPropertyEditor.Destroy; +begin + FComponents.Free; + inherited Destroy; +end; + +procedure TdxReportLinkComponentPropertyEditor.Initialize; +begin + inherited Initialize; + FComponents := TStringList.Create; +end; + +function TdxReportLinkComponentPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes - [paMultiSelect]; +end; + +procedure TdxReportLinkComponentPropertyEditor.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + GetComponents; + for I := 0 to FComponents.Count - 1 do + Proc(FComponents[I]); +end; + +function TdxReportLinkComponentPropertyEditor.GetReportLink: TBasedxReportLink; +begin + Result := TBasedxReportLink(GetComponent(0)); +end; + +procedure TdxReportLinkComponentPropertyEditor.AddComponent(const AName: string); +begin + if IsComponentValid(Designer.GetComponent(AName)) then FComponents.Add(AName); +end; + +procedure TdxReportLinkComponentPropertyEditor.GetComponents; +begin + FComponents.Clear; + Designer.GetComponentNames(GetTypeData(PTypeInfo(TComponent.ClassInfo)), AddComponent); +end; + +function TdxReportLinkComponentPropertyEditor.IsComponentValid(AComponent: TComponent): Boolean; +begin + Result := (AComponent <> nil) and not (AComponent is TBasedxReportLink) and + not (AComponent is TCustomdxComponentPrinter) and ReportLink.Supports(AComponent); +end; + +{ TdxCompositionReportLinkPropertyEditor } + +destructor TdxCompositionReportLinkPropertyEditor.Destroy; +begin + FComponents.Free; + inherited Destroy; +end; + +function TdxCompositionReportLinkPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes - [paMultiSelect]; +end; + +procedure TdxCompositionReportLinkPropertyEditor.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + FComponents.Clear; + Designer.GetComponentNames(GetTypeData(PTypeInfo(TComponent.ClassInfo)), CheckProc); + for I := 0 to FComponents.Count - 1 do + Proc(FComponents[I]); +end; + +procedure TdxCompositionReportLinkPropertyEditor.Initialize; +begin + inherited Initialize; + FComponents := TStringList.Create; +end; + +function TdxCompositionReportLinkPropertyEditor.GetItems: TdxCompositionLinkItems; +begin + Result := TdxCompositionLinkItems(TdxCompositionLinkItem(GetComponent(0)).Collection); +end; + +procedure TdxCompositionReportLinkPropertyEditor.CheckProc(const S: string); +begin + if IsComponentValid(Designer.GetComponent(S)) then + FComponents.Add(S); +end; + +function TdxCompositionReportLinkPropertyEditor.IsComponentValid(AComponent: TComponent): Boolean; +begin + Result := (AComponent is TBasedxReportLink) and Items.IsLinkComposable(TBasedxReportLink(AComponent)); +end; + +{ TdxIndexPropertyEditor } + +function TdxIndexPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes - [paMultiSelect]; +end; + +{ TdxReportLinkDesignerPropertyEditor } + +function TdxReportLinkDesignerPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paReadOnly]; + if TBasedxReportLink(GetComponent(0)).CheckToDesign then + Result := Result + [paDialog]; +end; + +function TdxReportLinkDesignerPropertyEditor.GetValue: string; +begin + if TBasedxReportLink(GetComponent(0)).CheckToDesign then + Result := DropAmpersand(sdxShowReportDesigner) + else + Result := sdxDesignerNoAvailable; +end; + +procedure TdxReportLinkDesignerPropertyEditor.Edit; +begin + if TBasedxReportLink(GetComponent(0)).DesignReport then + Designer.Modified; +end; + +{ TdxPSExplorerFilterPropertyEditor } + +function TdxPSExplorerFilterPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [{$IFNDEF DELPHI6}paReadOnly, {$ENDIF} paValueList, paSortList]; +end; + +procedure TdxPSExplorerFilterPropertyEditor.GetValues(Proc: TGetStrProc); +var + List: TdxClassList; + I: Integer; + ComponentClass: TClass; +begin + List := TdxClassList.Create; + try + dxIdeImagesProvider.Refresh; + dxPSGetSupportedComponentsList(List); + for I := 0 to List.Count - 1 do + begin + ComponentClass := List[I]; + if IsAcceptableComponentClass(ComponentClass) then Proc(ComponentClass.ClassName); + end; + finally + List.Free; + end; +end; + +{$IFDEF DELPHI5} + +procedure TdxPSExplorerFilterPropertyEditor.ListMeasureWidth(const Value: string; + ACanvas: TCanvas; var AWidth: Integer); +begin + Inc(AWidth, 1 + ImageList.Height + 2); +end; + +procedure TdxPSExplorerFilterPropertyEditor.ListMeasureHeight(const Value: string; + ACanvas: TCanvas; var AHeight: Integer); +begin + AHeight := 1 + ImageList.Height + 1; +end; + +procedure TdxPSExplorerFilterPropertyEditor.ListDrawValue(const Value: string; + ACanvas: TCanvas; const ARect: TRect; ASelected: Boolean); +var + R: TRect; +begin + R := ARect; + ACanvas.FillRect(R); + ImageList.Draw(ACanvas, R.Left + 1, R.Top + 1, ImageIndexes[Value]); + Inc(R.Left, 1 + ImageList.Width + 2); + InflateRect(R, 0, -(R.Bottom - R.Top - ACanvas.TextHeight(Value)) div 2); + + {$IFDEF DELPHI6} + DefaultPropertyListDrawValue(Value, ACanvas, R, ASelected); + {$ELSE} + inherited ListDrawValue(Value, ACanvas, R, ASelected); + {$ENDIF} +end; + +function TdxPSExplorerFilterPropertyEditor.GetImageIndex(const Value: string): Integer; +begin + Result := dxIdeImagesProvider.ImageIndexes[TComponentClass(GetClass(Value))]; +end; + +function TdxPSExplorerFilterPropertyEditor.GetImageList: TCustomImageList; +begin + Result := dxIdeImagesProvider.Images; +end; +{$ENDIF} + +function TdxPSExplorerFilterPropertyEditor.IsAcceptableComponentClass(AComponentClass: TClass): Boolean; +begin + Result := (AComponentClass <> nil) and + not AComponentClass.InheritsFrom(ExtCtrls.TPage) and + not AComponentClass.InheritsFrom(TabNotBk.TTabPage); +end; + +{$IFDEF DELPHI5} + +{ TdxPrintStyleImageIndexPropertyEditor } + +function TdxPrintStyleImageIndexPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paMultiSelect, paValueList, paSortList, paRevertable]; +end; + +procedure TdxPrintStyleImageIndexPropertyEditor.GetValues(Proc: TGetStrProc); +var + PrintStyle: TBasedxPrintStyle; + I: Integer; +begin + PrintStyle := TBasedxPrintStyle(GetComponent(0)); + if PrintStyle.StyleManager.Images <> nil then + for I := 0 to PrintStyle.StyleManager.Images.Count - 1 do + Proc(IntToStr(I)); +end; + +procedure TdxPrintStyleImageIndexPropertyEditor.ListMeasureHeight(const Value: string; + ACanvas: TCanvas; var AHeight: Integer); +var + Images: TCustomImageList; +begin + Images := TBasedxPrintStyle(GetComponent(0)).StyleManager.Images; + if Images <> nil then + AHeight := Images.Height + 2 + 2; +end; + +procedure TdxPrintStyleImageIndexPropertyEditor.ListMeasureWidth(const Value: string; + ACanvas: TCanvas; var AWidth: Integer); +var + Images: TCustomImageList; +begin + Images := TBasedxPrintStyle(GetComponent(0)).StyleManager.Images; + if Images <> nil then + AWidth := AWidth + Images.Width + 2 + 2; +end; + +procedure TdxPrintStyleImageIndexPropertyEditor.ListDrawValue(const Value: string; + ACanvas: TCanvas; const ARect: TRect; ASelected: Boolean); +var + R: TRect; + Images: TCustomImageList; + I: Integer; +begin + R := ARect; + ACanvas.FillRect(R); + Images := TBasedxPrintStyle(GetComponent(0)).StyleManager.Images; + if Images <> nil then + try + I := StrToInt(Value); + if (I > -1) and (I < Images.Count) then + begin + Images.Draw(ACanvas, R.Left + 2, R.Top + 2, I); + Inc(R.Left, Images.Width + 2); + end; + except + end; + {$IFDEF DELPHI6} + DefaultPropertyListDrawValue(Value, ACanvas, R, ASelected); + {$ELSE} + inherited ListDrawValue(Value, ACanvas, R, ASelected); + {$ENDIF} +end; + +procedure TdxPrintStyleImageIndexPropertyEditor.PropDrawValue(ACanvas: TCanvas; + const ARect: TRect; ASelected: Boolean); +var + S: string; +begin + S := GetVisualValue; + if (S <> '') and ASelected then + ListDrawValue(S, ACanvas, ARect, ASelected) + else + {$IFDEF DELPHI6} + DefaultPropertyDrawValue(Self, ACanvas, ARect); + {$ELSE} + inherited PropDrawValue(ACanvas, ARect, ASelected); + {$ENDIF} +end; + +{$IFDEF DELPHI6} + +{ ICustomPropertyDrawing } + +procedure TdxPrintStyleImageIndexPropertyEditor.PropDrawName(ACanvas: TCanvas; + const ARect: TRect; ASelected: Boolean); +begin + DefaultPropertyDrawName(Self, ACanvas, ARect); +end; + +{$ENDIF} + +{ TdxCustomDrawListPropertyEditor } + +procedure TdxCustomDrawListPropertyEditor.ListMeasureWidth(const Value: string; + ACanvas: TCanvas; var AWidth: Integer); +var + W: Integer; +begin + W := 1 + ImageList.Width + 1 + 2 + ACanvas.TextWidth(Value) + 2; + if W > AWidth then AWidth := W; +end; + +procedure TdxCustomDrawListPropertyEditor.ListMeasureHeight(const Value: string; + ACanvas: TCanvas; var AHeight: Integer); +begin + AHeight := ImageList.Height + 2; +end; + +procedure TdxCustomDrawListPropertyEditor.ListDrawValue(const Value: string; + ACanvas: TCanvas; const ARect: TRect; ASelected: Boolean); +var + R: TRect; +begin + ACanvas.FillRect(ARect); + ImageList.Draw(ACanvas, ARect.Left + 1, ARect.Top + 1, ImageIndexes[Value]); + R := ARect; + Inc(R.Left, 1 + ImageList.Width + 1); + ACanvas.TextRect(R, R.Left + 1, R.Top + (R.Bottom - R.Top - ACanvas.TextHeight(Value)) div 2, Value); +end; + +{ TdxPaperOrientationPropertyEditor } + +function TdxPaperOrientationPropertyEditor.GetImageIndex(const Value: string): Integer; +begin + Result := GetEnumValue(TypeInfo(TdxPrinterOrientation), Value); +end; + +function TdxPaperOrientationPropertyEditor.GetImageList: TImageList; +begin + Result := ilPaperOrientations; +end; + +{ TdxPrintOrderPropertyEditor } + +function TdxPrintOrderPropertyEditor.GetImageIndex(const Value: string): Integer; +begin + Result := GetEnumValue(TypeInfo(TdxPageOrder), Value); +end; + +function TdxPrintOrderPropertyEditor.GetImageList: TImageList; +begin + Result := ilPrintOrders; +end; + +{$ENDIF} + +{ TdxPathPropertyEditor } + +procedure TdxPathPropertyEditor.Edit; +var + I: Integer; +begin + if Explorers[0].ShowChangeRootPathDlg then + for I := 1 to PropCount - 1 do + Explorers[I].RootPath := Explorers[0].RootPath; +end; + +function TdxPathPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paMultiSelect, paDialog]; +end; + +function TdxPathPropertyEditor.GetExplorer(Index: Integer): TdxPSFileBasedExplorer; +begin + Result := TdxPSFileBasedExplorer(GetComponent(Index)); +end; + +{ TdxRegistryPathPropertyEditor } + +procedure TdxRegistryPathPropertyEditor.Edit; +var + S: string; +begin + S := Value; +{$IFNDEF LIMITED_EDITION} + if dxGetRegistryPath(S) then + begin + Value := S; + Designer.Modified; + end; + {$ENDIF} +end; + +function TdxRegistryPathPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes {$IFNDEF LIMITED_EDITION}+ [paDialog]{$ENDIF}; +end; + +{ TdxExplorerStubLinkPropertyEditor } + +procedure TdxExplorerStubLinkPropertyEditor.GetValues(Proc: TGetStrProc); +var + Links: TList; + I: Integer; + Link: TBasedxReportLink; +begin + Links := TList.Create; + try + TdxComponentPrinter(GetComponent(0)).GetLinks(Links); + for I := 0 to Links.Count - 1 do + begin + Link := TBasedxReportLink(Links[I]); + if Link.CanBeUsedAsStub then Proc(Link.Name); + end; + finally + Links.Free; + end; +end; + +{ TdxCustomContainerReportLinkComponentPropertyEditor } + +{$IFDEF DELPHI5} + +procedure TdxCustomContainerReportLinkComponentPropertyEditor.Initialize; +begin + inherited; + dxPSDsgProxies.dxIdeImagesProvider.Refresh; +end; + +procedure TdxCustomContainerReportLinkComponentPropertyEditor.ListMeasureWidth(const Value: string; + ACanvas: TCanvas; var AWidth: Integer); +var + W: Integer; +begin + W := 1 + Images.Width + 1 + 2 + ACanvas.TextWidth(Value) + 2; + if W > AWidth then AWidth := W; +end; + +procedure TdxCustomContainerReportLinkComponentPropertyEditor.ListMeasureHeight(const Value: string; + ACanvas: TCanvas; var AHeight: Integer); +begin + Aheight := 1 + Images.Height + 1; +end; + +procedure TdxCustomContainerReportLinkComponentPropertyEditor.ListDrawValue(const Value: string; + ACanvas: TCanvas; const ARect: TRect; ASelected: Boolean); +var + X, Y: Integer; +begin + ACanvas.FillRect(ARect); + Images.Draw(ACanvas, ARect.Left + 1, ARect.Top + 1, ImageIndexes[Value]); + with ARect do + begin + X := Left + 1 + Images.Width + 1 + 2; + Y := Top + (Bottom - Top - ACanvas.TextHeight(Value)) div 2; + end; + ACanvas.Brush.Style := bsClear; + ACanvas.TextRect(ARect, X, Y, Value); + ACanvas.Brush.Style := bsSolid; +end; + +{$ENDIF} + +procedure TdxCustomContainerReportLinkComponentPropertyEditor.GetComponents; +var + Project: IOTAProject; + I: Integer; + ModuleInfo: IOTAModuleInfo; +begin + inherited GetComponents; + + Project := GetProject; + if Project <> nil then + for I := 0 to Project.GetModuleCount - 1 do + begin + ModuleInfo := Project.GetModule(I); + if IsSupportedModuleType(ModuleInfo.ModuleType) then + AddComponent(ModuleInfo.FormName); + end; +end; + +function TdxCustomContainerReportLinkComponentPropertyEditor.GetProject: IOTAProject; +var + Module: IOTAModule; + HasMultipleProjects: Boolean; + I: Integer; + ProjectGroup: IOTAProjectGroup; + Project: IOTAProject; +begin + Result := nil; + HasMultipleProjects := False; + with BorlandIDEServices as IOTAModuleServices do + for I := 0 to GetModuleCount - 1 do + begin + Module := GetModule(I); + if Supports(Module, IOTAProjectGroup, ProjectGroup) then + begin + Result := ProjectGroup.ActiveProject; + Exit; + end + else + if Supports(Module, IOTAProject, Project) then + if Result = nil then + Result := Project + else + HasMultipleProjects := True; + end; + if HasMultipleProjects then Result := nil; +end; + +function TdxCustomContainerReportLinkComponentPropertyEditor.IsComponentValid(AComponent: TComponent): Boolean; +begin + Result := inherited IsComponentValid(AComponent) and + ((AComponent = nil) or (AComponent = Designer.GetRoot) or (AComponent.Owner = Designer.GetRoot)); +end; + +function TdxCustomContainerReportLinkComponentPropertyEditor.IsSupportedModuleType( + const AModuleType: TOTAModuleType): Boolean; +{$IFNDEF DELPHI6} +const + omtForm = 0; +{$ENDIF} +begin + Result := AModuleType = omtForm; +end; + +{$IFDEF DELPHI5} + +function TdxCustomContainerReportLinkComponentPropertyEditor.GetImageIndex(const Value: string): Integer; +begin + Result := dxPSDsgProxies.dxIdeImagesProvider.ImageIndexesByObject[Designer.GetObject(Value)]; +end; + +function TdxCustomContainerReportLinkComponentPropertyEditor.GetImages: TCustomImageList; +begin + Result := dxPSDsgProxies.dxIdeImagesProvider.Images; +end; + +{$ENDIF} + +{ TdxMeasurementUnitsPropertyEditor } + +procedure TdxMeasurementUnitsPropertyEditor.GetValues(Proc: TGetStrProc); + + function DropPrefix(const Source: string): string; + const + Prefix: string = 'mu'; + var + P: Integer; + begin + Result := Source; + P := Pos(Result, Prefix); + if P <> 0 then + Delete(Result, P, Length(Prefix)); + end; + +const + Default: string = 'muDefault'; +var + EnumType: PTypeInfo; + I: Integer; + EnumName, S: string; +begin + EnumType := GetPropType; + with GetTypeData(EnumType)^ do + for I := MinValue to MaxValue do + begin + EnumName := GetEnumName(EnumType, I); + if CompareStr(EnumName, Default) = 0 then + begin + S := GetEnumName(TypeInfo(TdxMeasurementUnits), Integer(GetDefaultMeasurementUnits)); + EnumName := EnumName + ' (' + DropPrefix(S) + ')'; + end; + Proc(EnumName); + end; +end; + +function TdxMeasurementUnitsPropertyEditor.GetValue: string; +begin + Result := inherited GetValue + ' ' + sdxInThousandths; +end; + +procedure TdxMeasurementUnitsPropertyEditor.SetValue(const Value: string); + + function IsDefaultMeasurementUnitsValue: Boolean; + var + DefaultEnumName: string; + begin + DefaultEnumName := GetEnumName(TypeInfo(TdxMeasurementUnits), Integer(muDefault)); + Result := Pos(DefaultEnumName, Value) <> 0; + end; + +begin + if IsDefaultMeasurementUnitsValue then + SetOrdValue(Integer(muDefault)) + else + inherited; +end; + +{ TdxPrinterPagePropertyEditor } + +procedure TdxPrinterPagePropertyEditor.Edit; +var + ReportLink: TBasedxReportLink; + I: Integer; +begin + ReportLink := TBasedxReportLink(GetComponent(0)); + if ReportLink.PageSetup then + begin + if PropCount > 1 then + for I := 1 to PropCount - 1 do + TBasedxReportLink(GetComponent(I)).PrinterPage.Assign(ReportLink.PrinterPage); + Designer.Modified; + end; +end; + +function TdxPrinterPagePropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog]; +end; + +{ TdxReportTitlePropertyEditor } + +procedure TdxReportTitlePropertyEditor.Edit; +var + ReportLink: TBasedxReportLink; + I: Integer; +begin + ReportLink := TBasedxReportLink(GetComponent(0)); + if ReportLink.ShowTitlePropertiesDlg then + begin + if PropCount > 1 then + for I := 1 to PropCount - 1 do + TBasedxReportLink(GetComponent(I)).ReportTitle.Assign(ReportLink.ReportTitle); + Designer.Modified; + end; +end; + +function TdxReportTitlePropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog]; +end; + +{ TdxReportTitleTextAlignXPropertyEditor } + +procedure TdxReportTitleTextAlignXPropertyEditor.GetValues(Proc: TGetStrProc); +var + EnumType: PTypeInfo; + I: Integer; +begin + EnumType := GetPropType; + for I := Integer(taLeft) to Integer(taRight) do + Proc(GetEnumName(EnumType, I)); +end; + +procedure TdxReportTitleTextAlignXPropertyEditor.SetValue(const Value: string); +var + I: Integer; +begin + I := GetEnumValue(GetPropType, Value); + if not (TdxTextAlignX(I) in [taLeft, taCenterX, taRight]) then + {$IFDEF DELPHI5} + raise EPropertyError.CreateRes(@SInvalidPropertyValue); + {$ELSE} + raise EPropertyError.Create(SInvalidPropertyValue); + {$ENDIF} + SetOrdValue(I); +end; + +{ TdxReportTitleTextAlignYPropertyEditor } + +procedure TdxReportTitleTextAlignYPropertyEditor.GetValues(Proc: TGetStrProc); +var + EnumType: PTypeInfo; + I: Integer; +begin + EnumType := GetPropType; + for I := Integer(taTop) to Integer(taBottom) do + Proc(GetEnumName(EnumType, I)); +end; + +procedure TdxReportTitleTextAlignYPropertyEditor.SetValue(const Value: string); +var + I: Integer; +begin + I := GetEnumValue(GetPropType, Value); + if not (TdxTextAlignY(I) in [taTop, taCenterY, taBottom]) then + {$IFDEF DELPHI5} + raise EPropertyError.CreateRes(@SInvalidPropertyValue); + {$ELSE} + raise EPropertyError.Create(SInvalidPropertyValue); + {$ENDIF} + SetOrdValue(I); +end; + +{ TdxHeaderFooterTextAlignYPropertyEditor } + +procedure TdxHeaderFooterTextAlignYPropertyEditor.GetValues(Proc: TGetStrProc); +var + EnumType: PTypeInfo; + I: Integer; +begin + EnumType := GetPropType; + for I := Integer(taTop) to Integer(taBottom) do + Proc(GetEnumName(EnumType, I)); +end; + +procedure TdxHeaderFooterTextAlignYPropertyEditor.SetValue(const Value: string); +var + I: Integer; +begin + I := GetEnumValue(GetPropType, Value); + if not (TdxTextAlignY(I) in [taTop, taCenterY, taBottom]) then + {$IFDEF DELPHI5} + raise EPropertyError.CreateRes(@SInvalidPropertyValue); + {$ELSE} + raise EPropertyError.Create(SInvalidPropertyValue); + {$ENDIF} + SetOrdValue(I); +end; + +{ TdxPrinterPagePropertyEditor2 } + +procedure TdxPrinterPagePropertyEditor2.Edit; +var + I: Integer; + PrintStyle: TBasedxPrintStyle; +begin + PrintStyle := TBasedxPrintStyle(GetComponent(0)); + if PrintStyle.PageSetup then + begin + if PropCount > 1 then + for I := 1 to PropCount - 1 do + TBasedxPrintStyle(GetComponent(I)).PrinterPage.Assign(PrintStyle.PrinterPage); + Designer.Modified; + end; +end; + +function TdxPrinterPagePropertyEditor2.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog]; +end; + +{ TdxPointWrapperEditor } + +function TdxPointWrapperEditor.PointWrapper: TdxPointWrapper; +begin + Result := TdxPointWrapper(GetOrdValue); +end; + +function TdxPointWrapperEditor.GetValue: string; +var + Pt: TdxPointWrapper; +begin + Pt := PointWrapper; + if Pt <> nil then + with Pt do + Result := Format('(X: %d; Y: %d)', [X, Y]) + else + Result := inherited GetValue; +end; + +{ TdxRectWrapperEditor } + +function TdxRectWrapperEditor.RectWrapper: TdxRectWrapper; +begin + Result := TdxRectWrapper(GetOrdValue); +end; + +function TdxRectWrapperEditor.GetValue: string; +var + R: TdxRectWrapper; +begin + R := RectWrapper; + if R <> nil then + with R do + Result := Format('(Bottom: %d; Left: %d; Right: %d; Top: %d)', [Bottom, Left, Right, Top]) + else + Result := inherited GetValue; +end; + +{ TdxBackgroundPropertyEditor } + +procedure TdxBackgroundPropertyEditor.Edit; +var + I: Integer; +begin + if Background.SetupEffects then + begin + for I := 1 to PropCount - 1 do + TdxBackground(GetOrdValueAt(I)).Assign(Background); + Designer.Modified; + end; +end; + +function TdxBackgroundPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog]; +end; + +function TdxBackgroundPropertyEditor.GetBackground: TdxBackground; +begin + Result := TdxBackground(GetOrdValueAt(0)); +end; + +{ TdxBrushPropertyEditor } + +procedure TdxBrushPropertyEditor.Edit; +var + I: Integer; +begin + if ChooseBrush(Brush) then + begin + for I := 1 to PropCount - 1 do + TBrush(GetOrdValueAt(I)).Assign(Brush); + Designer.Modified; + end; +end; + +function TdxBrushPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog]; +end; + +function TdxBrushPropertyEditor.GetBrush: TBrush; +begin + Result := TBrush(GetOrdValue); +end; + +{ TTTFontPropertyEditor } + +procedure TTTFontPropertyEditor.Edit; +const + hcDFontEditor = 25000; +var + FontDialog: TFontDialog; +begin + FontDialog := TFontDialog.Create(Application); + try + FontDialog.Font := TFont(GetOrdValue); + FontDialog.Device := dxPSGlbl.FontDialogDevice; + FontDialog.HelpContext := hcDFontEditor; + FontDialog.Options := [fdEffects, fdScalableOnly, fdTrueTypeOnly]; + if FontDialog.Execute then + SetOrdValue(Longint(FontDialog.Font)); + finally + FontDialog.Free; + end; +end; + +{ TdxPrintStyleManagerEditor } + +procedure TdxPrintStyleManagerEditor.ExecuteVerb(Index: Integer); +begin + case Index of + 0: dxShowPrintStylesDesigner(TdxPrintStyleManager(Component), Designer); + 3: TryStartWEBPage(sdxWEBPage); + end; +end; + +function TdxPrintStyleManagerEditor.GetVerb(Index: Integer): string; +begin + case Index of + 0: Result := sdxPrintStyles; + 1: Result := '-'; + 2: Result := sdxPrintingSystem; + 3: Result := sdxWEBPage; + 4: Result := sdxDevex; + end +end; + +function TdxPrintStyleManagerEditor.GetVerbCount: Integer; +begin + Result := inherited GetVerbCount + 5; +end; + +{$IFDEF IDE_MENUBITMAPS} +procedure TdxPrintStyleManagerEditor.PrepareItem(Index: Integer; const AItem: TMenuItem); +begin + case Index of + 0: AItem.Bitmap := FBmpItems; + 3: AItem.Bitmap := FBmpWEB; + end +end; +{$ENDIF} + +{ TdxPrintStyleEditor } + +function TdxPrintStyleEditor.PrintStyle: TBasedxPrintStyle; +begin + Result := TBasedxPrintStyle(Component); +end; + +procedure TdxPrintStyleEditor.ExecuteVerb(Index: Integer); +begin + case Index of + 0: + if PrintStyle.PageSetup then Designer.Modified; + 1: + begin + PrintStyle.IsCurrentStyle := True; + Designer.Modified; + end; + 3:begin + PrintStyle.RestoreDefaults; + Designer.Modified; + end; + 5: + if PrintStyle.PrinterPage.Background.SetupEffects then + Designer.Modified; + 6: + begin + PrintStyle.PrinterPage.Background.Mode := bmNone; + PrintStyle.PrinterPage.Background.Picture := nil; + Designer.Modified; + end; + end; +end; + +function TdxPrintStyleEditor.GetVerb(Index: Integer): string; +begin + case Index of + 0: Result := sdxPageSetup; + 1: Result := sdxMakeCurrent; + 2: Result := '-'; + 3: Result := sdxRestoreDefaults; + 4: Result := '-'; + 5: Result := sdxPageBackground; + 6: Result := sdxClearBackground; + end; +end; + +function TdxPrintStyleEditor.GetVerbCount: Integer; +begin + Result := 7; +end; + +{$IFDEF DELPHI5} +procedure TdxPrintStyleEditor.PrepareItem(Index: Integer; + const AItem: {$IFDEF DELPHI6} IMenuItem {$ELSE} TMenuItem{$ENDIF}); +begin + case Index of + {$IFDEF IDE_MENUBITMAPS} + 0: AItem.Bitmap := FBmpPageSetup; + {$ENDIF} + 1: AItem.Enabled := not TBasedxPrintStyle(Component).IsCurrentStyle; + {$IFDEF IDE_MENUBITMAPS} + 5: AItem.Bitmap := FBmpPageBackground; + {$ENDIF} + end; +end; +{$ENDIF} + +{ TdxPageSetupDialogEditor } + +procedure TdxPageSetupDialogEditor.ExecuteVerb(Index: Integer); +begin + case Index of + 0: TdxPageSetupDialog(Component).Execute; + 3: TryStartWEBPage(sdxWEBPage); + end; +end; + +function TdxPageSetupDialogEditor.GetVerb(Index: Integer): string; +begin + case Index of + 0: Result := sdxPageSetupDialog; + 1: Result := '-'; + 2: Result := sdxPrintingSystem; + 3: Result := sdxWEBPage; + 4: Result := sdxDevex; + end; +end; + +function TdxPageSetupDialogEditor.GetVerbCount: Integer; +begin + Result := inherited GetVerbCount + 5; +end; + +{$IFDEF DELPHI5} +procedure TdxPageSetupDialogEditor.PrepareItem(Index: Integer; + const AItem: {$IFDEF DELPHI6} IMenuItem {$ELSE} TMenuItem{$ENDIF}); +begin + case Index of + 0: + begin + {$IFDEF IDE_MENUBITMAPS} + AItem.Bitmap := FBmpPageSetup; + {$ENDIF} + AItem.Enabled := TdxPageSetupDialog(Component).PrintStyle <> nil; + end; + 3: + {$IFDEF IDE_MENUBITMAPS} + AItem.Bitmap := FBmpWEB; + {$ENDIF} + end; +end; +{$ENDIF} + +{ TdxPrintDialogEditor } + +procedure TdxPrintDialogEditor.ExecuteVerb(Index: Integer); +begin + case Index of + 0: TdxPrintDialog(Component).Execute; + 3: TryStartWEBPage(sdxWEBPage); + end; +end; + +function TdxPrintDialogEditor.GetVerb(Index: Integer): string; +begin + case Index of + 0: Result := sdxPrintDialog; + 1: Result := '-'; + 2: Result := sdxPrintingSystem; + 3: Result := sdxWEBPage; + 4: Result := sdxDevex; + end; +end; + +function TdxPrintDialogEditor.GetVerbCount: Integer; +begin + Result := inherited GetVerbCount + 5; +end; + +{$IFDEF IDE_MENUBITMAPS} +procedure TdxPrintDialogEditor.PrepareItem(Index: Integer; const AItem: TMenuItem); +begin + case Index of + 0: AItem.Bitmap := FBmpPrint; + 3: AItem.Bitmap := FBmpWEB; + end; +end; +{$ENDIF} + +{ TCustomdxPSExplorerEditor } + +procedure TCustomdxPSExplorerEditor.ExecuteVerb(Index: Integer); +begin + if Index = 1 then TryStartWEBPage(sdxWEBPage); +end; + +function TCustomdxPSExplorerEditor.GetVerb(Index: Integer): string; +begin + case Index of + 0: Result := sdxPrintingSystem; + 1: Result := sdxWEBPage; + 2: Result := sdxDevex; + end; +end; + +function TCustomdxPSExplorerEditor.GetVerbCount: Integer; +begin + Result := inherited GetVerbCount + 3; +end; + +{$IFDEF IDE_MENUBITMAPS} +procedure TCustomdxPSExplorerEditor.PrepareItem(Index: Integer; const AItem: TMenuItem); +begin + if Index = 1 then + AItem.Bitmap := FBmpWEB; +end; +{$ENDIF} + +{ TdxEngineControllerEditor } + +procedure TdxEngineControllerEditor.ExecuteVerb(Index: Integer); +begin + if Index = 1 then TryStartWEBPage(sdxWEBPage); +end; + +function TdxEngineControllerEditor.GetVerb(Index: Integer): string; +begin + case Index of + 0: Result := sdxPrintingSystem; + 1: Result := sdxWEBPage; + 2: Result := sdxDevex; + end; +end; + +function TdxEngineControllerEditor.GetVerbCount: Integer; +begin + Result := inherited GetVerbCount + 3; +end; + +{$IFDEF IDE_MENUBITMAPS} +procedure TdxEngineControllerEditor.PrepareItem(Index: Integer; const AItem: TMenuItem); +begin + if Index = 1 then AItem.Bitmap := FBmpWEB; +end; +{$ENDIF} + +{ TdxShowPgsDlgPropertyEditor } + +procedure TdxShowPgsDlgPropertyEditor.Edit; +begin + if TBasedxPrintStyle(GetComponent(0)).PageSetup then + Designer.Modified; +end; + +function TdxShowPgsDlgPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paDialog, paReadOnly]; +end; + +function TdxShowPgsDlgPropertyEditor.GetValue: string; +begin + Result := sdxClickForPageSetup; +end; + +{ TdxStyleGlyphPropertyEditor } + +function TdxStyleGlyphPropertyEditor.GetValue: string; +begin + Result := inherited GetValue; + if PrintStyle.IsStyleGlyphAssigned then + Result := Result + ' - ' + sdxRestoreDefaultGlyph; +end; + +procedure TdxStyleGlyphPropertyEditor.SetValue(const Value: string); +begin + if CompareText(Value, sdxDefault) = 0 then + PrintStyle.RestoreDefaultGlyph + else + inherited; +end; + +function TdxStyleGlyphPropertyEditor.GetPrintStyle: TBasedxPrintStyle; +begin + Result := TBasedxPrintStyle(GetComponent(0)); +end; + +{ TdxCustomListDrawingIntegerPropertyEditor } + +{$IFDEF DELPHI5} + +procedure TdxCustomListDrawingIntegerPropertyEditor.ListMeasureWidth(const Value: string; + ACanvas: TCanvas; var AWidth: Integer); +var + W: Integer; +begin + W := 1 + ImageList.Width + 1 + 2 + ACanvas.TextWidth(Value) + 2; + if W > AWidth then AWidth := W; +end; + +procedure TdxCustomListDrawingIntegerPropertyEditor.ListMeasureHeight(const Value: string; + ACanvas: TCanvas; var AHeight: Integer); +begin + AHeight := ImageList.Height + 2; +end; + +procedure TdxCustomListDrawingIntegerPropertyEditor.ListDrawValue(const Value: string; + ACanvas: TCanvas; const ARect: TRect; ASelected: Boolean); +var + R: TRect; +begin + ACanvas.FillRect(ARect); + ImageList.Draw(ACanvas, ARect.Left + 1, ARect.Top + 1, ImageIndexes[Value]); + R := ARect; + Inc(R.Left, 1 + ImageList.Width + 1); + ACanvas.TextRect(R, R.Left + 1, R.Top + (R.Bottom - R.Top - ACanvas.TextHeight(Value)) div 2, Value); +end; + +{$ENDIF} + +{ TdxDMPaperPropertyEditor } + +function TdxDMPaperPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [{$IFNDEF DELPHI6}paReadOnly,{$ENDIF} paDialog, paValueList]; +end; + +function TdxDMPaperPropertyEditor.GetValue: string; +var + Index: Integer; +begin + Index := dxPPAttr.Papers.FindByDMPaper(GetOrdValue); + if Index <> -1 then + Result := dxPPAttr.Papers[Index].Name + else + Result := sdxCustomPaperSize + IntToStr(GetOrdValue); +end; + +procedure TdxDMPaperPropertyEditor.SetValue(const Value: string); +var + Index: Integer; +begin + Index := dxPPAttr.Papers.FindByName(Value); + if Index <> -1 then + SetOrdValue(dxPPAttr.Papers[Index].DMPaper) + else + inherited SetValue(Value); +end; + +procedure TdxDMPaperPropertyEditor.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to dxPPAttr.Papers.Count - 1 do + Proc(dxPPAttr.Papers[I].Name); +end; + +{$IFDEF DELPHI5} + +function TdxDMPaperPropertyEditor.GetImageIndex(const Value: string): Integer; +begin + Result := Integer(dxIsEnvelopePaper(Value)); +end; + +function TdxDMPaperPropertyEditor.GetImageList: TImageList; +begin + Result := ilPapers; +end; + +{$ENDIF} + +{ TdxPaperSourcePropertyEditor } + +function TdxPaperSourcePropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [{$IFNDEF DELPHI6}paReadOnly,{$ENDIF} paDialog, paValueList]; +end; + +function TdxPaperSourcePropertyEditor.GetValue: string; +var + Index: Integer; +begin + Index := dxPPAttr.Bins.FindByValue(GetOrdValue); + if Index <> -1 then + Result := dxPPAttr.Bins[Index].Name + else + Result := sdxCustomBin + IntToStr(GetOrdValue); +end; + +procedure TdxPaperSourcePropertyEditor.SetValue(const Value: string); +var + Index: Integer; +begin + Index := dxPPAttr.Bins.FindByName(Value); + if Index <> -1 then + SetOrdValue(dxPPAttr.Bins[Index].Value) + else + inherited SetValue(Value); +end; + +procedure TdxPaperSourcePropertyEditor.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to dxPPAttr.Bins.Count - 1 do + Proc(dxPPAttr.Bins[I].Name); +end; + +{$IFDEF DELPHI5} + +function TdxPaperSourcePropertyEditor.GetImageIndex(const Value: string): Integer; +begin + Result := Integer(not dxIsAutoSelectBin(Value)); +end; + +function TdxPaperSourcePropertyEditor.GetImageList: TImageList; +begin + Result := ilBins; +end; + +{$ENDIF} + +{ TdxPageNumberFormatEditor } + +function TdxPageNumberFormatsPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [{$IFNDEF DELPHI6}paReadOnly, {$ENDIF} paDialog, paValueList]; +end; + +function TdxPageNumberFormatsPropertyEditor.GetValue: string; +begin + Result := PageNumberFormats[GetOrdValue]; +end; + +procedure TdxPageNumberFormatsPropertyEditor.SetValue(const Value: string); +var + I: Integer; +begin + // case insensitive - PageNumberFormats.IndexOf(Value); + for I := 0 to PageNumberFormats.Count - 1 do + if dxSameStr(PageNumberFormats[I], Value) then + begin + SetOrdValue(I); + Exit; + end; + inherited SetValue(Value); +end; + +procedure TdxPageNumberFormatsPropertyEditor.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to PageNumberFormats.Count - 1 do + Proc(PageNumberFormats[I]); +end; + +{ TdxReportLinkStyleManagerPropertyEditor } + +{$IFDEF DELPHI5} +function TdxReportLinkStyleManagerPropertyEditor.AutoFill: Boolean; +begin + Result := False; +end; +{$ELSE} +procedure TdxReportLinkStyleManagerPropertyEditor.Edit; +begin +end; +{$ENDIF} + +procedure TdxReportLinkStyleManagerPropertyEditor.GetValues(Proc: TGetStrProc); +begin + if CanCreateStyleManager then Proc(sdxCreateNewStyleManager); + inherited; +end; + +procedure TdxReportLinkStyleManagerPropertyEditor.SetValue(const Value: string); +begin + if Value = sdxCreateNewStyleManager then + SetOrdValue(Integer(CreateNewStyleManager)) + else + inherited; +end; + +function TdxReportLinkStyleManagerPropertyEditor.CanCreateStyleManager: Boolean; +begin + {$IFDEF DELPHI5} + Result := (Root <> nil) and not Designer.IsSourceReadOnly and not (csInline in Root.ComponentState); + {$ELSE} + Result := True; + {$ENDIF} +end; + +function TdxReportLinkStyleManagerPropertyEditor.CreateNewStyleManager: TdxPrintStyleManager; +begin + Result := TdxPrintStyleManager.Create(Root); + Result.Name := UniqueName; +end; + +function TdxReportLinkStyleManagerPropertyEditor.GetUniqueName: string; +var + S: string; +begin + S := TdxPrintStyleManager.ClassName; + S := Copy(S, 2, Length(S) - 1); + Result := Designer.UniqueName(S); +end; + +function TdxReportLinkStyleManagerPropertyEditor.GetRoot: TComponent; +begin + Result := Designer.{$IFDEF DELPHI6}Root{$ELSE}GetRoot{$ENDIF}; +end; + +{ TdxReportDocumentDescriptionPropertyEditor } + +procedure TdxReportDocumentDescriptionPropertyEditor.Edit; +var + S: string; +begin + S := Value; + if dxPSfmEditDesc.dxEditDescriptionDlg(S) then + begin + Value := S; + Designer.Modified; + end; +end; + +function TdxReportDocumentDescriptionPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog]; +end; + +{ TdxDateFormatEditor } + +procedure TdxDateFormatsPropertyEditor.Initialize; +begin + inherited Initialize; + FStrings := TStringList.Create; + GetFormatedDateStrings(Now, DateFormats, FStrings); +end; + +destructor TdxDateFormatsPropertyEditor.Destroy; +begin + FStrings.Free; + inherited Destroy; +end; + +function TdxDateFormatsPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [{$IFNDEF DELPHI6}paReadOnly, {$ENDIF} paDialog, paValueList]; +end; + +function TdxDateFormatsPropertyEditor.GetValue: string; +begin + Result := FStrings[GetOrdValue]; +end; + +procedure TdxDateFormatsPropertyEditor.SetValue(const Value: string); +var + Index: Integer; +begin + Index := FStrings.IndexOf(Value); + if Index <> -1 then + SetOrdValue(Index) + else + inherited SetValue(Value); +end; + +procedure TdxDateFormatsPropertyEditor.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to FStrings.Count - 1 do + Proc(FStrings[I]); +end; + +{ TdxTimeFormatEditor } + +procedure TdxTimeFormatsPropertyEditor.Initialize; +begin + inherited Initialize; + FStrings := TStringList.Create; + GetFormatedTimeStrings(Now, TimeFormats, FStrings); +end; + +destructor TdxTimeFormatsPropertyEditor.Destroy; +begin + FStrings.Free; + inherited Destroy; +end; + +function TdxTimeFormatsPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [{$IFNDEF DELPHI6}paReadOnly, {$ENDIF} paDialog, paValueList]; +end; + +function TdxTimeFormatsPropertyEditor.GetValue: string; +begin + Result := FStrings[GetOrdValue]; +end; + +procedure TdxTimeFormatsPropertyEditor.SetValue(const Value: string); +var + Index: Integer; +begin + Index := FStrings.IndexOf(Value); + if Index <> -1 then + SetOrdValue(Index) + else + inherited SetValue(Value); +end; + +procedure TdxTimeFormatsPropertyEditor.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to FStrings.Count - 1 do + Proc(FStrings[I]); +end; + +{ TdxAutoHFTextEntriesPropertyEditor } + +procedure TdxAutoHFTextEntriesPropertyEditor.Edit; +begin + TdxPrintStyleManager(GetComponent(0)).ShowAutoHFTextEntriesDlg; +end; + +function TdxAutoHFTextEntriesPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paReadOnly, paDialog]; +end; + +{ TdxPreviewIconPropertyEditor } + +function TdxPreviewIconPropertyEditor.GetValue: string; +begin + Result := inherited GetValue; + if PreviewOptions.IsIconAssigned then + Result := Result + ' - ' + sdxRestoreDefaultIcon; +end; + +procedure TdxPreviewIconPropertyEditor.SetValue(const Value: string); +begin + if CompareText(Value, sdxDefault) = 0 then + PreviewOptions.RestoreOriginalIcon + else + inherited; +end; + +function TdxPreviewIconPropertyEditor.GetPreviewOptions: TdxPreviewOptions; +begin + Result := TdxPreviewOptions(GetComponent(0)); +end; + +{ TdxTextReportLinkAlignmentPropertyEditor } + +procedure TdxTextReportLinkAlignmentPropertyEditor.GetValues(Proc: TGetStrProc); +var + EnumType: PTypeInfo; +begin + EnumType := GetPropType; + Proc(GetEnumName(EnumType, Integer(taLeft))); + Proc(GetEnumName(EnumType, Integer(taCenterX))); + Proc(GetEnumName(EnumType, Integer(taRight))); + Proc(GetEnumName(EnumType, Integer(taDistributeX))); +end; + +{$IFDEF DELPHI6} + +{ TdxComponentPrinterSelectionEditor } + +procedure TdxComponentPrinterSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + Proc('dxPSGlbl'); + Proc('dxPSUtl'); + Proc('dxPSEngn'); + Proc('dxPrnPg'); + Proc('dxBkgnd'); + Proc('dxWrap'); + Proc('dxPrnDev'); + Proc('dxPSCompsProvider'); + Proc('dxPSFillPatterns'); + Proc('dxPSEdgePatterns'); +end; + +{ TdxPrintStyleManagerSelectionEditor } + +procedure TdxPrintStyleManagerSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + Proc('dxPSGlbl'); + Proc('dxPSUtl'); + Proc('dxPrnPg'); + Proc('dxBkgnd'); + Proc('dxWrap'); + Proc('dxPrnDev'); +end; + +{ TdxPageSetupDialogSelectionEditor } + +procedure TdxPageSetupDialogSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + Proc('dxPSGlbl'); + Proc('dxPSUtl'); + Proc('dxPrnPg'); + Proc('dxBkgnd'); + Proc('dxWrap'); +end; + +{ TdxPrintDialogSelectionEditor } + +procedure TdxPrintDialogSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + Proc('dxPrnDev'); +end; + +{$ENDIF} + +procedure HideProperty(PropertyType: PTypeInfo; + ComponentClass: TClass; const PropertyName: string); +begin + RegisterPropertyEditor(PropertyType, ComponentClass, PropertyName, nil); +end; + +procedure Register; +begin + dxPSGlbl.IsDesignTime := True; + + RegisterComponents(sdxPSComponentPage, + [TdxComponentPrinter, TdxPrintStyleManager, + TdxPrintDialog, TdxPageSetupDialog, + TdxPSEngineController, TdxPSFileBasedExplorer]); + + RegisterNoIcon([TBasedxReportLink, TdxCompositionReportLink, TdxCustomContainerReportLink]); + RegisterNoIcon([TdxPictureReportLink, TdxTextReportLink]); + RegisterNoIcon([TBasedxPrintStyle, TdxPSPrintStyle]); + + RegisterComponentEditor(TdxComponentPrinter, TdxComponentPrinterEditor); + RegisterComponentEditor(TdxPrintStyleManager, TdxPrintStyleManagerEditor); + RegisterComponentEditor(TBasedxReportLink, TdxReportLinkEditor); + RegisterComponentEditor(TBasedxPrintStyle, TdxPrintStyleEditor); + RegisterComponentEditor(TdxPageSetupDialog, TdxPageSetupDialogEditor); + RegisterComponentEditor(TdxPrintDialog, TdxPrintDialogEditor); + RegisterComponentEditor(TCustomdxPSExplorer, TCustomdxPSExplorerEditor); + RegisterComponentEditor(TdxPSEngineController, TdxEngineControllerEditor); + + RegisterPropertyEditor(TypeInfo(string), TdxPSFileBasedExplorer, 'RootPath', TdxPathPropertyEditor); + RegisterPropertyEditor(TypeInfo(Integer), TdxComponentPrinter, 'DateFormat', TdxDateFormatsPropertyEditor); + RegisterPropertyEditor(TypeInfo(Integer), TdxComponentPrinter, 'TimeFormat', TdxTimeFormatsPropertyEditor); + RegisterPropertyEditor(TypeInfo(TIcon), TdxPreviewOptions, 'Icon', TdxPreviewIconPropertyEditor); + RegisterPropertyEditor(TypeInfo(TdxPageNumberFormat), TdxComponentPrinter, 'PageNumberFormat', TdxPageNumberFormatsPropertyEditor); + RegisterPropertyEditor(TypeInfo(string), TdxComponentPrinter, 'RegistryPath', TdxRegistryPathPropertyEditor); + RegisterPropertyEditor(TypeInfo(TBasedxReportLink), TdxComponentPrinter, 'ExplorerStubLink', TdxExplorerStubLinkPropertyEditor); + + RegisterPropertyEditor(TypeInfo(TComponent), TBasedxReportLink, 'Component', TdxReportLinkComponentPropertyEditor); + RegisterPropertyEditor(TypeInfo(TComponent), TdxCustomContainerReportLink, 'Component', TdxCustomContainerReportLinkComponentPropertyEditor); + RegisterPropertyEditor(TypeInfo(Integer), TBasedxReportLink, 'Index', TdxIndexPropertyEditor); + RegisterPropertyEditor(TypeInfo(Boolean), TBasedxReportLink, 'ShowDesigner', TdxReportLinkDesignerPropertyEditor); + RegisterPropertyEditor(TypeInfo(TdxPrinterPage), TBasedxReportLink, 'PrinterPage', TdxPrinterPagePropertyEditor); + RegisterPropertyEditor(TypeInfo(TdxReportTitle), TBasedxReportLink, 'ReportTitle', TdxReportTitlePropertyEditor); + RegisterPropertyEditor(TypeInfo(TFont), TBasedxReportLink, '', TTTFontPropertyEditor); + RegisterPropertyEditor(TypeInfo(Integer), TBasedxReportLink, 'DateFormat', TdxDateFormatsPropertyEditor); + RegisterPropertyEditor(TypeInfo(Integer), TBasedxReportLink, 'TimeFormat', TdxTimeFormatsPropertyEditor); + RegisterPropertyEditor(TypeInfo(TdxPageNumberFormat), TBasedxReportLink, 'PageNumberFormat', TdxPageNumberFormatsPropertyEditor); + RegisterPropertyEditor(TypeInfo(TdxPrintStyleManager), TBasedxReportLink, 'StyleManager', TdxReportLinkStyleManagerPropertyEditor); + + RegisterPropertyEditor(TypeInfo(string), TdxPSReportDocument, 'Description', TdxReportDocumentDescriptionPropertyEditor); + + {$IFDEF DELPHI5} + RegisterPropertyEditor(TypeInfo(Integer), TBasedxPrintStyle, 'ImageIndex', TdxPrintStyleImageIndexPropertyEditor); + {$ENDIF} + RegisterPropertyEditor(TypeInfo(string), TCustomdxPSExplorer, 'FilterLink', TdxPSExplorerFilterPropertyEditor); + + {$IFDEF DELPHI5} + RegisterPropertyEditor(TypeInfo(TdxPrinterOrientation), nil, '', TdxPaperOrientationPropertyEditor); + RegisterPropertyEditor(TypeInfo(TdxPageOrder), nil, '', TdxPrintOrderPropertyEditor); + {$ENDIF} + + RegisterPropertyEditor(TypeInfo(TComponent), TdxCompositionLinkItem, 'ReportLink', TdxCompositionReportLinkPropertyEditor); + + RegisterPropertyEditor(TypeInfo(TStrings), TdxPrintStyleManager, 'AutoHFTextEntries', TdxAutoHFTextEntriesPropertyEditor); + + RegisterPropertyEditor(TypeInfo(Boolean), TBasedxPrintStyle, 'ShowPageSetupDlg', TdxShowPgsDlgPropertyEditor); + RegisterPropertyEditor(TypeInfo(TdxPrinterPage), TBasedxPrintStyle, 'PrinterPage', TdxPrinterPagePropertyEditor2); + RegisterPropertyEditor(TypeInfo(Integer), TBasedxPrintStyle, 'Index', TdxIndexPropertyEditor); + RegisterPropertyEditor(TypeInfo(TBitmap), TBasedxPrintStyle, 'StyleGlyph', TdxStyleGlyphPropertyEditor); + + RegisterPropertyEditor(TypeInfo(Integer), TdxPrinterPage, 'DMPaper', TdxDMPaperPropertyEditor); + RegisterPropertyEditor(TypeInfo(Integer), TdxPrinterPage, 'PaperSource', TdxPaperSourcePropertyEditor); + RegisterPropertyEditor(TypeInfo(TdxMeasurementUnits), TdxPrinterPage, 'MeasurementUnits', TdxMeasurementUnitsPropertyEditor); + RegisterPropertyEditor(TypeInfo(TdxTextAlignY), TCustomdxPageObject, '', TdxHeaderFooterTextAlignYPropertyEditor); + + RegisterPropertyEditor(TypeInfo(TdxTextAlignX), TdxReportTitle, 'TextAlignX', TdxReportTitleTextAlignXPropertyEditor); + RegisterPropertyEditor(TypeInfo(TdxTextAlignY), TdxReportTitle, 'TextAlignY', TdxReportTitleTextAlignYPropertyEditor); + + RegisterPropertyEditor(TypeInfo(TdxBackground), nil, '', TdxBackgroundPropertyEditor); + + RegisterPropertyEditor(TypeInfo(TdxPointWrapper), nil, '', TdxPointWrapperEditor); + RegisterPropertyEditor(TypeInfo(TdxRectWrapper), nil, '', TdxRectWrapperEditor); + + RegisterPropertyEditor(TypeInfo(string), TdxPSEngineController, 'RegistryPath', TdxRegistryPathPropertyEditor); + RegisterPropertyEditor(TypeInfo(string), TdxPageSetupDialog, 'RegistryPath', TdxRegistryPathPropertyEditor); + RegisterPropertyEditor(TypeInfo(string), TdxPrintDialog, 'RegistryPath', TdxRegistryPathPropertyEditor); + + RegisterPropertyEditor(TypeInfo(TBrush), nil, '', TdxBrushPropertyEditor); + + RegisterPropertyEditor(TypeInfo(TdxTextAlignX), TdxCustomTextReportLink, 'Alignment', TdxTextReportLinkAlignmentPropertyEditor); + + {$IFDEF DELPHI6} + RegisterSelectionEditor(TCustomdxComponentPrinter, TdxComponentPrinterSelectionEditor); + RegisterSelectionEditor(TdxPrintStyleManager, TdxPrintStyleManagerSelectionEditor); + RegisterSelectionEditor(TdxPageSetupDialog, TdxPageSetupDialogSelectionEditor); + RegisterSelectionEditor(TdxPrintDialog, TdxPrintDialogSelectionEditor); + {$ENDIF} + + // hide unneeded property editors + HideProperty(TypeInfo(string), TdxPreviewOptions, 'HelpFile'); + HideProperty(TypeInfo(string), TdxPreviewOptions, 'RegistryPath'); + HideProperty(TypeInfo(Boolean), TdxPreviewOptions, 'SavePosition'); + HideProperty(TypeInfo(string), TBasedxReportLink, 'ReportTitleText'); + HideProperty(TypeInfo(string), TBasedxReportLink, 'Caption'); + HideProperty(TypeInfo(TDateTime), TBasedxReportLink, 'DateTime'); + HideProperty(TypeInfo(string), TBasedxReportLink, 'Description'); + HideProperty(TypeInfo(TdxReportTitleMode), TBasedxReportLink, 'ReportTitleMode'); + + HideProperty(TypeInfo(TComponent), TdxCompositionReportLink, 'Component'); + HideProperty(TypeInfo(TdxReportTitle), TdxCompositionReportLink, 'ReportTitle'); + HideProperty(TypeInfo(TNotifyEvent), TdxCompositionReportLink, 'OnChangeComponent'); + HideProperty(TypeInfo(TdxCustomDrawReportLinkHFEvent), TdxCompositionReportLink, 'OnCustomDrawPageFooter'); + HideProperty(TypeInfo(TdxCustomDrawReportLinkHFEvent), TdxCompositionReportLink, 'OnCustomDrawPageHeader'); + HideProperty(TypeInfo(TdxCustomDrawReportLinkTitleEvent), TdxCompositionReportLink, 'OnCustomDrawReportLinkTitle'); + HideProperty(TypeInfo(TdxMeasureReportLinkTitleEvent), TdxCompositionReportLink, 'OnMeasureReportLinkTitle'); + +// HideProperty(TypeInfo(TComponent), TdxCustomReportLink, 'Component'); +// HideProperty(TypeInfo(TNotifyEvent), TdxCustomReportLink, 'OnChangeComponent'); + + HideProperty(TypeInfo(TComponent), TdxPictureReportLink, 'Component'); + HideProperty(TypeInfo(TNotifyEvent), TdxPictureReportLink, 'OnChangeComponent'); + + HideProperty(TypeInfo(TComponent), TdxTextReportLink, 'Component'); + HideProperty(TypeInfo(TNotifyEvent), TdxTextReportLink, 'OnChangeComponent'); +end; + +const + ResFileName: string = 'dxPSDsgImgs'; + +{$IFDEF IDE_MENUBITMAPS} + +function LoadBitmap(const AResName: string): TBitmap; +begin + Result := TBitmap.Create; + Result.LoadFromResourceName(HInstance, AResName); + //Bitmap_LoadFromResourceName(Result, AResName, ResFileName); + Result.Transparent := True; +end; + +{$ENDIF} + +{$IFDEF DELPHI5} + +function CreateImageList(AnAllocBy: Integer): TImageList; +begin + Result := TImageList.Create(nil); + Result.AllocBy := AnAllocBy; +end; + +procedure LoadImage(AImageList: TImageList; const AResName: string; AMasked: Boolean); +var + Bitmap: TBitmap; +begin + Bitmap := TBitmap.Create; + try + Bitmap.LoadFromResourceName(FindResourceHInstance(hInstance), AResName); + //Bitmap_LoadFromResourceName(Bitmap, AResName, ResFileName); + AImageList.Height := Bitmap.Height; + AImageList.Width := Bitmap.Width; + if AMasked then + AImageList.AddMasked(Bitmap, clDefault) + else + AImageList.Add(Bitmap, nil); + finally + Bitmap.Free; + end; +end; + +function CreatePaperImages: TImageList; +begin + Result := CreateImageList(2); + LoadImage(Result, 'IDB_DXPSDESIGN_PAPER_STANDARD', True); + LoadImage(Result, 'IDB_DXPSDESIGN_PAPER_ENVELOPE', True); +end; + +function CreateBinImages: TImageList; +begin + Result := CreateImageList(2); + LoadImage(Result, 'IDB_DXPSDESIGN_BIN_AUTOTRAY', True); + LoadImage(Result, 'IDB_DXPSDESIGN_BIN_MANUALTRAY', True); +end; + +function CreatePrintOrderImages: TImageList; +begin + Result := CreateImageList(2); + LoadImage(Result, 'IDB_DXPSDESIGN_PRINTORDER_OVERTHENDOWN', False); + LoadImage(Result, 'IDB_DXPSDESIGN_PRINTORDER_DOWNTHENOVER', False); +end; + +function CreatePaperOrientationImages: TImageList; +begin + Result := CreateImageList(2); + LoadImage(Result, 'IDB_DXPSDESIGN_PAPERORIENTATION_PORTRAIT', True); + LoadImage(Result, 'IDB_DXPSDESIGN_PAPERORIENTATION_LANDSCAPE', True); +end; + +{$ENDIF} + +initialization + sdxPrintingSystem := sdxPrintingSystem + ' ' + dxPSGlbl.dxPSVersionString; + + {$IFDEF DELPHI5} + ilPapers := CreatePaperImages; + ilBins := CreateBinImages; + ilPrintOrders := CreatePrintOrderImages; + ilPaperOrientations := CreatePaperOrientationImages; + {$ENDIF} + + {$IFDEF IDE_MENUBITMAPS} + FBmpDesigner := LoadBitmap('IDB_DXPSDESIGN_DODESIGNER'); + FBmpNewEmpty := LoadBitmap('IDB_DXPSDESIGN_DOADDEMPTY'); + FBmpNew := LoadBitmap('IDB_DXPSDESIGN_DOADD'); + FBmpPrintPreview := LoadBitmap('IDB_DXPSDESIGN_DOPREVIEW'); + FBmpPageBackground := LoadBitmap('IDB_DXPSDESIGN_DOPAGEBACKGROUND'); + FBmpPrint := LoadBitmap('IDB_DXPSDESIGN_DOPRINT'); + FBmpPageSetup := LoadBitmap('IDB_DXPSDESIGN_DOPAGESETUP'); + FBmpItems := LoadBitmap('IDB_DXPSDESIGN_DOPROPERTIES'); + FBmpWEB := LoadBitmap('IDB_DXPSDESIGN_DOWEB'); + {$ENDIF} + +finalization + {$IFDEF DELPHI5} + FreeAndNil(ilPapers); + FreeAndNil(ilBins); + FreeAndNil(ilPrintOrders); + FreeAndNil(ilPaperOrientations); + {$ENDIF} + + {$IFDEF IDE_MENUBITMAPS} + FreeAndNil(FBmpWEB); + FreeAndNil(FBmpItems); + FreeAndNil(FBmpPageSetup); + FreeAndNil(FBmpPrint); + FreeAndNil(FBmpPageBackground); + FreeAndNil(FBmpPrintPreview); + FreeAndNil(FBmpNew); + FreeAndNil(FBmpNewEmpty); + FreeAndNil(FBmpDesigner); + {$ENDIF} + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSRes.pas b/official/x.35/ExpressPrinting System/Sources/dxPSRes.pas new file mode 100644 index 00000000..d37861fa --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSRes.pas @@ -0,0 +1,1712 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSRes; + +interface + +{$I cxVer.inc} + +resourcestring + sdxBtnOK = 'OK'; + sdxBtnOKAccelerated = '&OK'; + sdxBtnCancel = 'Cancel'; + sdxBtnClose = 'Close'; + sdxBtnApply = '&Apply'; + sdxBtnHelp = '&Help'; + sdxBtnFix = '&Fix'; + sdxBtnNew = '&New...'; + sdxBtnIgnore = '&Ignore'; + sdxBtnYes = '&Yes'; + sdxBtnNo = '&No'; + sdxBtnEdit = '&Edit...'; + sdxBtnReset = '&Reset'; + sdxBtnAdd = '&Add'; + sdxBtnAddComposition = 'Add &Composition'; + sdxBtnDefault = '&Default...'; + sdxBtnDelete = '&Delete...'; + sdxBtnDescription = '&Description...'; + sdxBtnCopy = '&Copy...'; + sdxBtnYesToAll = 'Yes To &All'; + sdxBtnRestoreDefaults = '&Restore Defaults'; + sdxBtnRestoreOriginal = 'Restore &Original'; + sdxBtnTitleProperties = 'Title Properties...'; + sdxBtnProperties = 'P&roperties...'; + sdxBtnNetwork = 'Net&work...'; + sdxBtnBrowse = '&Browse...'; + sdxBtnPageSetup = 'Pa&ge Setup...'; + sdxBtnPrintPreview = 'Print Pre&view...'; + sdxBtnPreview = 'Pre&view...'; + sdxBtnPrint = 'Print...'; + sdxBtnOptions = '&Options...'; + sdxBtnStyleOptions = 'Style Options...'; + sdxBtnDefinePrintStyles = '&Define Styles...'; + sdxBtnPrintStyles = 'Print Styles'; + sdxBtnBackground = 'Background'; + sdxBtnShowToolBar = 'Show &ToolBar'; + sdxBtnDesign = 'D&esign...'; + sdxBtnMoveUp = 'Move &Up'; + sdxBtnMoveDown = 'Move Dow&n'; + + sdxBtnMoreColors = '&More Colors...'; + sdxBtnFillEffects = '&Fill Effects...'; + sdxBtnNoFill = '&No Fill'; + sdxBtnAutomatic = '&Automatic'; + sdxBtnNone = '&None'; + + sdxBtnOtherTexture = 'Other Te&xture...'; + sdxBtnInvertColors = 'I&nvert Colors'; + sdxBtnSelectPicture = 'Se&lect Picture...'; + + sdxEditReports = 'Edit Reports'; + sdxComposition = 'Composition'; + sdxReportTitleDlgCaption = 'Report Title'; + sdxMode = '&Mode:'; + sdxText = '&Text'; + sdxProperties = '&Properties'; + sdxAdjustOnScale = '&Adjust on Scale'; + sdxTitleModeNone = 'None'; + sdxTitleModeOnEveryTopPage = 'On Every Top Page'; + sdxTitleModeOnFirstPage = 'On First Page'; + + sdxEditDescription = 'Edit Description'; + sdxRename = 'Rena&me'; + sdxSelectAll = '&Select All'; + + sdxAddReport = 'Add Report'; + sdxAddAndDesignReport = 'Add and D&esign Report...'; + sdxNewCompositionCaption = 'New Composition'; + sdxName = '&Name:'; + sdxCaption = '&Caption:'; + sdxAvailableSources = '&Available Source(s)'; + sdxOnlyComponentsInActiveForm = 'Only Components in Active &Form'; + sdxOnlyComponentsWithoutLinks = 'Only Components &without Existing ReportLinks'; + sdxItemName = 'Name'; + sdxItemDescription = 'Description'; + + sdxConfirmDeleteItem = 'Do you want to delete next items: %s ?'; + sdxAddItemsToComposition = 'Add Items to Composition'; + sdxHideAlreadyIncludedItems = 'Hide Already &Included Items'; + sdxAvailableItems = 'A&vailable Items'; + sdxItems = '&Items'; + sdxEnable = '&Enable'; + sdxOptions = 'Options'; + sdxShow = 'Show'; + sdxPaintItemsGraphics = '&Paint Item Graphics'; + sdxDescription = '&Description:'; + + sdxNewReport = 'NewReport'; + + sdxOnlySelected = 'Only &Selected'; + sdxExtendedSelect = '&Extended Select'; + sdxIncludeFixed = '&Include Fixed'; + + sdxFonts = 'Fonts'; + sdxBtnFont = 'Fo&nt...'; + sdxBtnEvenFont = 'E&ven Font...'; + sdxBtnOddFont = 'Odd Fo&nt...'; + sdxBtnFixedFont = 'F&ixed Font...'; + sdxBtnGroupFont = 'Grou&p Font...'; + sdxBtnChangeFont = 'Change Fo&nt...'; + + sdxFont = 'Font'; + sdxOddFont = 'Odd Font'; + sdxEvenFont = 'Even Font'; + sdxPreviewFont = 'Preview Font'; + sdxCaptionNodeFont = 'Level Caption Font'; + sdxGroupNodeFont = 'Group Node Font'; + sdxGroupFooterFont = 'Group Footer Font'; + sdxHeaderFont = 'Header Font'; + sdxFooterFont = 'Footer Font'; + sdxBandFont = 'Band Font'; + + sdxTransparent = '&Transparent'; + sdxFixedTransparent = 'Fi&xed Transparent'; + sdxCaptionTransparent = 'Caption Transparent'; + sdxGroupTransparent = 'Group Transparent'; + + sdxGraphicAsTextValue = '(GRAPHIC)'; + sdxColors = 'Colors'; + sdxColor = 'Co&lor:'; + sdxOddColor = 'Odd Co&lor:'; + sdxEvenColor = 'E&ven Color:'; + sdxPreviewColor = '&Preview Color:'; + sdxBandColor = '&Band Color:'; + sdxLevelCaptionColor = 'Le&vel Caption Color:'; + sdxHeaderColor = 'H&eader Color:'; + sdxGroupNodeColor = 'Group &Node Color:'; + sdxGroupFooterColor = '&Group Footer Color:'; + sdxFooterColor = 'Foo&ter Color:'; + sdxFixedColor = 'F&ixed Color:'; + sdxGroupColor = 'Grou&p Color:'; + sdxCaptionColor = 'Caption Color:'; + sdxGridLinesColor = 'Gri&d Line Color:'; + + sdxBands = '&Bands'; + sdxLevelCaptions = 'Levels &Caption'; + sdxHeaders = 'H&eaders'; + sdxFooters = 'Foote&rs'; + sdxGroupFooters = '&Group Footers'; + sdxPreview = 'Previe&w'; + sdxPreviewLineCount = 'Preview Line Coun&t:'; + sdxAutoCalcPreviewLineCount = 'A&uto Calculate Preview Lines'; + + sdxGrid = 'Grid Lines'; + sdxNodesGrid = 'Node Grid Lines'; + sdxGroupFooterGrid = 'GroupFooter Grid Lines'; + + sdxStateImages = '&State Images'; + sdxImages = '&Images'; + + sdxTextAlign = 'Text&Align'; + sdxTextAlignHorz = 'Hori&zontally'; + sdxTextAlignVert = '&Vertically'; + sdxTextAlignLeft = 'Left'; + sdxTextAlignCenter = 'Center'; + sdxTextAlignRight = 'Right'; + sdxTextAlignTop = 'Top'; + sdxTextAlignVCenter = 'Center'; + sdxTextAlignBottom = 'Bottom'; + sdxBorderLines = '&Border'; + sdxHorzLines = 'Hori&zontal Lines'; + sdxVertLines = '&Vertical Lines'; + sdxFixedHorzLines = 'Fi&xed Horizontal Lines'; + sdxFixedVertLines = 'Fixe&d Vertical Lines'; + sdxFlatCheckMarks = 'F&lat CheckMarks'; + sdxCheckMarksAsText = '&Display CheckMarks as Text'; + + sdxRowAutoHeight = 'Ro&w AutoHeight'; + sdxEndEllipsis = '&EndEllipsis'; + + sdxDrawBorder = '&Draw Border'; + sdxFullExpand = 'Full &Expand'; + sdxBorderColor = '&Border Color:'; + sdxAutoNodesExpand = 'A&uto Nodes Expand'; + sdxExpandLevel = 'Expand &Level:'; + sdxFixedRowOnEveryPage = 'Fixed Rows'; + + sdxDrawMode = 'Draw &Mode:'; + sdxDrawModeStrict = 'Strict'; + sdxDrawModeOddEven = 'Odd/Even Rows Mode'; + sdxDrawModeChess = 'Chess Mode'; + sdxDrawModeBorrow = 'Borrow From Source'; + + sdx3DEffects = '3D Effects'; + sdxUse3DEffects = 'Use &3D Effects'; + sdxSoft3D = 'Sof&t3D'; + + sdxBehaviors = 'Behaviors'; + sdxMiscellaneous = 'Miscellaneous'; + sdxOnEveryPage = 'On Every Page'; + sdxNodeExpanding = 'Node Expanding'; + sdxSelection = 'Selection'; + sdxNodeAutoHeight = '&Node Auto Height'; + sdxTransparentGraphics = '&Transparent Graphics'; + sdxAutoWidth = 'Auto &Width'; + + sdxDisplayGraphicsAsText = 'Display Graphic As &Text'; + sdxTransparentColumnGraphics = 'Transparent &Graphics'; + + sdxBandsOnEveryPage = 'Bands'; + sdxHeadersOnEveryPage = 'Headers'; + sdxFootersOnEveryPage = 'Footers'; + sdxGraphics = '&Graphics'; + + { Common messages } + + sdxOutOfResources = 'Out of Resources'; + sdxFileAlreadyExists = 'File "%s" Already Exists.'; + sdxConfirmOverWrite = 'File "%s" already exists. Overwrite ?'; + sdxInvalidFileName = 'Invalid File Name "%s"'; + sdxRequiredFileName = 'Enter file name.'; + sdxOutsideMarginsMessage = + 'One or more margins are set outside the printable area of the page.' + #13#10 + + 'Do you want to continue ?'; + sdxOutsideMarginsMessage2 = + 'One or more margins are set outside the printable area of the page.' + #13#10 + + 'Choose the Fix button to increase the appropriate margins.'; + sdxInvalidMarginsMessage = + 'One or more margins are set to the invalid values.' + #13#10 + + 'Choose the Fix button to correct this problem.' + #13#10 + + 'Choose the Restore button to restore original values.'; + sdxInvalidMargins = 'One or more margins has invalid values'; + sdxOutsideMargins = 'One or more margins are set outside the printable area of the page'; + sdxThereAreNowItemsForShow = 'There are no items in this view'; + + { Color palette } + + sdxPageBackground = ' Page Background'; + sdxPenColor = 'Pen Color'; + sdxFontColor = 'Font Color'; + sdxBrushColor = 'Brush Color'; + sdxHighLight = 'HighLight'; + + { Color names } + + sdxColorBlack = 'Black'; + sdxColorDarkRed = 'Dark Red'; + sdxColorRed = 'Red'; + sdxColorPink = 'Pink'; + sdxColorRose = 'Rose'; + sdxColorBrown = 'Brown'; + sdxColorOrange = 'Orange'; + sdxColorLightOrange = 'Light Orange'; + sdxColorGold = 'Gold'; + sdxColorTan = 'Tan'; + sdxColorOliveGreen = 'Olive Green'; + sdxColorDrakYellow = 'Dark Yellow'; + sdxColorLime = 'Lime'; + sdxColorYellow = 'Yellow'; + sdxColorLightYellow = 'Light Yellow'; + sdxColorDarkGreen = 'Dark Green'; + sdxColorGreen = 'Green'; + sdxColorSeaGreen = 'Sea Green'; + sdxColorBrighthGreen = 'Bright Green'; + sdxColorLightGreen = 'Light Green'; + sdxColorDarkTeal = 'Dark Teal'; + sdxColorTeal = 'Teal'; + sdxColorAqua = 'Aqua'; + sdxColorTurquoise = 'Turquoise'; + sdxColorLightTurquoise = 'Light Turquoise'; + sdxColorDarkBlue = 'Dark Blue'; + sdxColorBlue = 'Blue'; + sdxColorLightBlue = 'Light Blue'; + sdxColorSkyBlue = 'Sky Blue'; + sdxColorPaleBlue = 'Pale Blue'; + sdxColorIndigo = 'Indigo'; + sdxColorBlueGray = 'Blue Gray'; + sdxColorViolet = 'Violet'; + sdxColorPlum = 'Plum'; + sdxColorLavender = 'Lavender'; + sdxColorGray80 = 'Gray-80%'; + sdxColorGray50 = 'Gray-50%'; + sdxColorGray40 = 'Gray-40%'; + sdxColorGray25 = 'Gray-25%'; + sdxColorWhite = 'White'; + + { FEF Dialog } + + sdxTexture = '&Texture'; + sdxPattern = '&Pattern'; + sdxPicture = 'P&icture'; + sdxForeground = '&Foreground'; + sdxBackground = '&Background'; + sdxSample = 'Sample:'; + + sdxFEFCaption = 'Fill Effects'; + sdxPaintMode = 'Paint &Mode'; + sdxPaintModeCenter = 'Center'; + sdxPaintModeStretch = 'Stretch'; + sdxPaintModeTile = 'Tile'; + sdxPaintModeProportional = 'Proportional'; + + { Pattern names } + + sdxPatternGray5 = '5%'; + sdxPatternGray10 = '10%'; + sdxPatternGray20 = '20%'; + sdxPatternGray25 = '25%'; + sdxPatternGray30 = '30%'; + sdxPatternGray40 = '40%'; + sdxPatternGray50 = '50%'; + sdxPatternGray60 = '60%'; + sdxPatternGray70 = '70%'; + sdxPatternGray75 = '75%'; + sdxPatternGray80 = '80%'; + sdxPatternGray90 = '90%'; + sdxPatternLightDownwardDiagonal = 'Light downward diagonal'; + sdxPatternLightUpwardDiagonal = 'Light upward diagonal'; + sdxPatternDarkDownwardDiagonal = 'Dark downward diagonal'; + sdxPatternDarkUpwardDiagonal = 'Dark upward diagonal'; + sdxPatternWideDownwardDiagonal = 'Wide downward diagonal'; + sdxPatternWideUpwardDiagonal = 'Wide upward diagonal'; + sdxPatternLightVertical = 'Light vertical'; + sdxPatternLightHorizontal = 'Light horizontal'; + sdxPatternNarrowVertical = 'Narrow vertical'; + sdxPatternNarrowHorizontal = 'Narrow horizontal'; + sdxPatternDarkVertical = 'Dark vertical'; + sdxPatternDarkHorizontal = 'Dark horizontal'; + sdxPatternDashedDownward = 'Dashed downward'; + sdxPatternDashedUpward = 'Dashed upward'; + sdxPatternDashedVertical = 'Dashed vertical'; + sdxPatternDashedHorizontal = 'Dashed horizontal'; + sdxPatternSmallConfetti = 'Small confetti'; + sdxPatternLargeConfetti = 'Large confetti'; + sdxPatternZigZag = 'Zig zag'; + sdxPatternWave = 'Wave'; + sdxPatternDiagonalBrick = 'Diagonal brick'; + sdxPatternHorizantalBrick = 'Horizontal brick'; + sdxPatternWeave = 'Weave'; + sdxPatternPlaid = 'Plaid'; + sdxPatternDivot = 'Divot'; + sdxPatternDottedGrid = 'Dottedgrid'; + sdxPatternDottedDiamond = 'Dotted diamond'; + sdxPatternShingle = 'Shingle'; + sdxPatternTrellis = 'Trellis'; + sdxPatternSphere = 'Sphere'; + sdxPatternSmallGrid = 'Small grid'; + sdxPatternLargeGrid = 'Large grid'; + sdxPatternSmallCheckedBoard = 'Small checked board'; + sdxPatternLargeCheckedBoard = 'Large checked board'; + sdxPatternOutlinedDiamond = 'Outlined diamond'; + sdxPatternSolidDiamond = 'Solid diamond'; + + { Texture names } + + sdxTextureNewSprint = 'Newsprint'; + sdxTextureGreenMarble = 'Green marble'; + sdxTextureBlueTissuePaper = 'Blue tissue paper'; + sdxTexturePapyrus = 'Papyrus'; + sdxTextureWaterDroplets = 'Water droplets'; + sdxTextureCork = 'Cork'; + sdxTextureRecycledPaper = 'Recycled paper'; + sdxTextureWhiteMarble = 'White marble'; + sdxTexturePinkMarble = 'Pink marble'; + sdxTextureCanvas = 'Canvas'; + sdxTexturePaperBag = 'Paper bag'; + sdxTextureWalnut = 'Walnut'; + sdxTextureParchment = 'Parchment'; + sdxTextureBrownMarble = 'Brown marble'; + sdxTexturePurpleMesh = 'Purple mesh'; + sdxTextureDenim = 'Denim'; + sdxTextureFishFossil = 'Fish fossil'; + sdxTextureOak = 'Oak'; + sdxTextureStationary = 'Stationary'; + sdxTextureGranite = 'Granite'; + sdxTextureBouquet = 'Bouquet'; + sdxTextureWonenMat = 'Woven mat'; + sdxTextureSand = 'Sand'; + sdxTextureMediumWood = 'Medium wood'; + + sdxFSPCaption = 'Picture Preview'; + sdxWidth = 'Width'; + sdxHeight = 'Height'; + + { Brush Dialog } + + sdxBrushDlgCaption = 'Brush properties'; + sdxStyle = '&Style:'; + + { Enter New File Name dialog } + + sdxENFNCaption = 'Choose New File Name'; + sdxEnterNewFileName = 'Enter New File Name'; + + { Define styles dialog } + + sdxDefinePrintStylesCaption = 'Define Print Styles'; + sdxDefinePrintStylesTitle = 'Print &Styles:'; + sdxDefinePrintStylesWarningDelete = 'Do you want to delete "%s" ?'; + sdxDefinePrintStylesWarningClear = 'Do you want to delete all not built-in styles ?'; + sdxClear = 'C&lear...'; + + { Print device } + + sdxCustomSize = 'Custom Size'; + sdxDefaultTray = 'Default Tray'; + sdxInvalidPrintDevice = 'Printer selected is not valid'; + sdxNotPrinting = 'Printer is not currently printing'; + sdxPrinting = 'Printing in progress'; + sdxDeviceOnPort = '%s on %s'; + sdxPrinterIndexError = 'Printer index out of range'; + sdxNoDefaultPrintDevice = 'There is no default printer selected'; + + { Edit AutoText Entries Dialog } + + sdxAutoTextDialogCaption = 'Edit AutoText Entries'; + sdxEnterAutoTextEntriesHere = ' Enter A&utoText Entries Here: '; + + { Print dialog } + + sdxPrintDialogCaption = 'Print'; + sdxPrintDialogPrinter = ' Printer '; + sdxPrintDialogName = '&Name:'; + sdxPrintDialogStatus = 'Status:'; + sdxPrintDialogType = 'Type:'; + sdxPrintDialogWhere = 'Where:'; + sdxPrintDialogComment = 'Comment:'; + sdxPrintDialogPrintToFile = 'Print to &File'; + sdxPrintDialogPageRange = ' Page range '; + sdxPrintDialogAll = '&All'; + sdxPrintDialogCurrentPage = 'Curr&ent Page'; + sdxPrintDialogSelection = '&Selection'; + sdxPrintDialogPages = '&Pages:'; + sdxPrintDialogRangeLegend = + 'Enter page number and/or page ranges' + #10#13 + + 'separated by commas. For example: 1,3,5-12.'; + sdxPrintDialogCopies = ' Copies '; + sdxPrintDialogNumberOfPages = 'N&umber of Pages:'; + sdxPrintDialogNumberOfCopies = 'Number of &Copies:'; + sdxPrintDialogCollateCopies = 'Colla&te Copies'; + sdxPrintDialogAllPages = 'All'; + sdxPrintDialogEvenPages = 'Even'; + sdxPrintDialogOddPages = 'Odd'; + sdxPrintDialogPrintStyles = ' Print St&yles '; + + { PrintToFile Dialog } + + sdxPrintDialogOpenDlgTitle = 'Choose File Name'; + sdxPrintDialogOpenDlgAllFiles = 'All Files'; + sdxPrintDialogOpenDlgPrinterFiles = 'Printer Files'; + sdxPrintDialogPageNumbersOutOfRange = 'Page numbers out of range (%d - %d)'; + sdxPrintDialogInvalidPageRanges = 'Invalid page ranges'; + sdxPrintDialogRequiredPageNumbers = 'Enter page numbers'; + sdxPrintDialogNoPrinters = + 'No printers are installed. To install a printer, ' + + 'point to Settings on the Windows Start menu, click Printers, and then double-click Add Printer. ' + + 'Follow the instructions in the wizard.'; + sdxPrintDialogInPrintingState = 'Printer is currently printing.' + #10#13 + + 'Please wait.'; + + { Printer State } + + sdxPrintDialogPSPaused = 'Paused'; + sdxPrintDialogPSPendingDeletion = 'Pending Deletion'; + sdxPrintDialogPSBusy = 'Busy'; + sdxPrintDialogPSDoorOpen = 'Door Open'; + sdxPrintDialogPSError = 'Error'; + sdxPrintDialogPSInitializing = 'Initializing'; + sdxPrintDialogPSIOActive = 'IO Active'; + sdxPrintDialogPSManualFeed = 'Manual Feed'; + sdxPrintDialogPSNoToner = 'No Toner'; + sdxPrintDialogPSNotAvailable = 'Not Available'; + sdxPrintDialogPSOFFLine = 'Offline'; + sdxPrintDialogPSOutOfMemory = 'Out of Memory'; + sdxPrintDialogPSOutBinFull = 'Output Bin Full'; + sdxPrintDialogPSPagePunt = 'Page Punt'; + sdxPrintDialogPSPaperJam = 'Paper Jam'; + sdxPrintDialogPSPaperOut = 'Paper Out'; + sdxPrintDialogPSPaperProblem = 'Paper Problem'; + sdxPrintDialogPSPrinting = 'Printing'; + sdxPrintDialogPSProcessing = 'Processing'; + sdxPrintDialogPSTonerLow = 'Toner Low'; + sdxPrintDialogPSUserIntervention = 'User Intervention'; + sdxPrintDialogPSWaiting = 'Waiting'; + sdxPrintDialogPSWarningUp = 'Warming Up'; + sdxPrintDialogPSReady = 'Ready'; + sdxPrintDialogPSPrintingAndWaiting = 'Printing: %d document(s) waiting'; + + sdxLeftMargin = 'Left Margin'; + sdxTopMargin = 'Top Margin'; + sdxRightMargin = 'Right Margin'; + sdxBottomMargin = 'Bottom Margin'; + sdxGutterMargin = 'Gutter'; + sdxHeaderMargin = 'Header'; + sdxFooterMargin = 'Footer'; + + sdxUnitsInches = '"'; + sdxUnitsCentimeters = 'cm'; + sdxUnitsMillimeters = 'mm'; + sdxUnitsPoints = 'pt'; + sdxUnitsPicas = 'pi'; + + sdxUnitsDefaultName = 'Default'; + sdxUnitsInchesName = 'Inches'; + sdxUnitsCentimetersName = 'Centimeters'; + sdxUnitsMillimetersName = 'Millimeters'; + sdxUnitsPointsName = 'Points'; + sdxUnitsPicasName = 'Picas'; + + sdxPrintPreview = 'Print Preview'; + sdxReportDesignerCaption = 'Format Report'; + sdxCompositionDesignerCaption = 'Composition Editor'; + + sdxComponentNotSupportedByLink = 'Component "%s" not supported by TdxComponentPrinter'; + sdxComponentNotSupported = 'Component "%s" not supported by TdxComponentPrinter'; + sdxPrintDeviceNotReady = 'Printer has not been installed or is not ready'; + sdxUnableToGenerateReport = 'Unable to generate report'; + sdxPreviewNotRegistered = 'There is no registered preview form'; + sdxComponentNotAssigned = '%s' + #13#10 + 'Not assigned "Component" property'; + sdxPrintDeviceIsBusy = 'Printer is busy'; + sdxPrintDeviceError = 'Printer has encountered error !'; + sdxMissingComponent = 'Missing "Component" property'; + sdxDataProviderDontPresent = 'There are no Links with Assigned Component in Composition'; + sdxBuildingReport = 'Building report: Completed %d%%'; // obsolete + sdxPrintingReport = 'Printing report: Completed %d page(s). Press Esc to cancel'; // obsolete + sdxDefinePrintStylesMenuItem = 'Define Print &Styles...'; + sdxAbortPrinting = 'Abort printing ?'; + sdxStandardStyle = 'Standard Style'; + + sdxFontStyleBold = 'Bold'; + sdxFontStyleItalic = 'Italic'; + sdxFontStyleUnderline = 'Underline'; + sdxFontStyleStrikeOut = 'StrikeOut'; + sdxPt = 'pt.'; + + sdxNoPages = 'There are no pages to display'; + sdxPageWidth = 'Page Width'; + sdxWholePage = 'Whole Page'; + sdxTwoPages = 'Two Pages'; + sdxFourPages = 'Four Pages'; + sdxWidenToSourceWidth = 'Widen to Source Width'; + + sdxMenuBar = 'MenuBar'; + sdxStandardBar = 'Standard'; + sdxHeaderFooterBar = 'Header and Footer'; + sdxShortcutMenusBar = 'Shortcut Menus'; + sdxAutoTextBar = 'AutoText'; + + sdxMenuFile = '&File'; + sdxMenuFileDesign = '&Design...'; + sdxMenuFilePrint = '&Print...'; + sdxMenuFilePageSetup = 'Page Set&up...'; + sdxMenuPrintStyles = 'Print Styles'; + sdxMenuFileExit = '&Close'; + + sdxMenuEdit = '&Edit'; + sdxMenuEditCut = 'Cu&t'; + sdxMenuEditCopy = '&Copy'; + sdxMenuEditPaste = '&Paste'; + sdxMenuEditDelete = '&Delete'; + sdxMenuEditFind = '&Find...'; + sdxMenuEditFindNext = 'Find Ne&xt'; + sdxMenuEditReplace = '&Replace...'; + + sdxMenuLoad = '&Load...'; + sdxMenuPreview = 'Pre&view...'; + + sdxMenuInsert = '&Insert'; + sdxMenuInsertAutoText = '&AutoText'; + sdxMenuInsertEditAutoTextEntries = 'AutoTe&xt...'; + sdxMenuInsertAutoTextEntries = 'List of AutoText Entries'; + sdxMenuInsertAutoTextEntriesSubItem = 'In&sert AutoText'; + sdxMenuInsertPageNumber = '&Page Number'; + sdxMenuInsertTotalPages = '&Number of Pages'; + sdxMenuInsertPageOfPages = 'Pa&ge Number of Pages'; + sdxMenuInsertDateTime = 'Date and Time'; + sdxMenuInsertDate = '&Date'; + sdxMenuInsertTime = '&Time'; + sdxMenuInsertUserName = '&User Name'; + sdxMenuInsertMachineName = '&Machine Name'; + + sdxMenuView = '&View'; + sdxMenuViewMargins = '&Margins'; + sdxMenuViewFlatToolBarButtons = '&Flat ToolBar Buttons'; + sdxMenuViewLargeToolBarButtons = '&Large ToolBar Buttons'; + sdxMenuViewMarginsStatusBar = 'M&argins Bar'; + sdxMenuViewPagesStatusBar = '&Status Bar'; + sdxMenuViewToolBars = '&Toolbars'; + sdxMenuViewPagesHeaders = 'Page &Headers'; + sdxMenuViewPagesFooters = 'Page Foote&rs'; + sdxMenuViewSwitchToLeftPart = 'Switch to Left Part'; + sdxMenuViewSwitchToRightPart = 'Switch to Right Part'; + sdxMenuViewSwitchToCenterPart = 'Switch to Center Part'; + sdxMenuViewHFSwitchHeaderFooter = '&Show Header/Footer'; + sdxMenuViewHFClose = '&Close'; + + sdxMenuZoom = '&Zoom'; + sdxMenuZoomPercent100 = 'Percent &100'; + sdxMenuZoomPageWidth = 'Page &Width'; + sdxMenuZoomWholePage = 'W&hole Page'; + sdxMenuZoomTwoPages = '&Two Pages'; + sdxMenuZoomFourPages = '&Four Pages'; + sdxMenuZoomMultiplyPages = '&Multiple Pages'; + sdxMenuZoomWidenToSourceWidth = 'Widen To S&ource Width'; + sdxMenuZoomSetup = '&Setup...'; + + sdxMenuPages = '&Pages'; + + sdxMenuGotoPage = '&Go'; + sdxMenuGotoPageFirst = '&First Page'; + sdxMenuGotoPagePrev = '&Previous Page'; + sdxMenuGotoPageNext = '&Next Page'; + sdxMenuGotoPageLast = '&Last Page'; + sdxMenuActivePage = '&Active Page:'; + + sdxMenuFormat = 'F&ormat'; + sdxMenuFormatHeaderAndFooter = '&Header and Footer'; + sdxMenuFormatAutoTextEntries = '&Auto Text Entries...'; + sdxMenuFormatDateTime = 'Date And &Time...'; + sdxMenuFormatPageNumbering = 'Page &Numbering...'; + sdxMenuFormatPageBackground = 'Bac&kground...'; + sdxMenuFormatShrinkToPage = '&Fit to Page'; + sdxMenuShowEmptyPages = 'Show &Empty Pages'; + sdxMenuFormatHFBackground = 'Header/Footer Background...'; + sdxMenuFormatHFClear = 'Clear Text'; + + sdxMenuTools = '&Tools'; + sdxMenuToolsCustomize = '&Customize...'; + sdxMenuToolsOptions = '&Options...'; + + sdxMenuHelp = '&Help'; + sdxMenuHelpTopics = 'Help &Topics...'; + sdxMenuHelpAbout = '&About...'; + + sdxMenuShortcutPreview = 'Preview'; + sdxMenuShortcutAutoText = 'AutoText'; + + sdxMenuBuiltInMenus = 'Built-in Menus'; + sdxMenuShortCutMenus = 'Shortcut Menus'; + sdxMenuNewMenu = 'New Menu'; + + { Hints } + + sdxHintFileDesign = 'Design Report'; + sdxHintFilePrint = 'Print'; + sdxHintFilePrintDialog = 'Print Dialog'; + sdxHintFilePageSetup = 'Page Setup'; + sdxHintFileExit = 'Close Preview'; + + sdxHintEditFind = 'Find'; + sdxHintEditFindNext = 'Find Next'; + sdxHintEditReplace = 'Replace'; + + sdxHintInsertEditAutoTextEntries = 'Edit AutoText Entries'; + sdxHintInsertPageNumber = 'Insert Page Number'; + sdxHintInsertTotalPages = 'Insert Number of Pages'; + sdxHintInsertPageOfPages = 'Insert Page Number of Pages'; + sdxHintInsertDateTime = 'Insert Date and Time'; + sdxHintInsertDate = 'Insert Date'; + sdxHintInsertTime = 'Insert Time'; + sdxHintInsertUserName = 'Insert User Name'; + sdxHintInsertMachineName = 'Insert Machine Name'; + + sdxHintViewMargins = 'View Margins'; + sdxHintViewLargeButtons = 'View Large Buttons'; + sdxHintViewMarginsStatusBar = 'View Margins Status Bar'; + sdxHintViewPagesStatusBar = 'View Page Status Bar'; + sdxHintViewPagesHeaders = 'View Page Header'; + sdxHintViewPagesFooters = 'View Page Footer'; + sdxHintViewSwitchToLeftPart = 'Switch to Left Header/Footer Part'; + sdxHintViewSwitchToRightPart = 'Switch to Right Header/Footer Part'; + sdxHintViewSwitchToCenterPart = 'Switch to Center Header/Footer Part'; + sdxHintViewHFSwitchHeaderFooter = 'Switch Between Header and Footer'; + sdxHintViewHFClose = 'Close'; + + sdxHintViewZoom = 'Zoom'; + sdxHintZoomPercent100 = 'Zoom 100%'; + sdxHintZoomPageWidth = 'Zoom Page Width'; + sdxHintZoomWholePage = 'Whole Page'; + sdxHintZoomTwoPages = 'Two Pages'; + sdxHintZoomFourPages = 'Four Pages'; + sdxHintZoomMultiplyPages = 'Multiple Pages'; + sdxHintZoomWidenToSourceWidth = 'Widen To Source Width'; + sdxHintZoomSetup = 'Setup Zoom Factor'; + + sdxHintFormatDateTime = 'Format Date and Time'; + sdxHintFormatPageNumbering = 'Format Page Number'; + sdxHintFormatPageBackground = 'Background'; + sdxHintFormatShrinkToPage = 'Fit To Page'; + sdxHintFormatHFBackground = 'Header/Footer Background'; + sdxHintFormatHFClear = 'Clear Header/Footer Text'; + + sdxHintGotoPageFirst = 'First Page'; + sdxHintGotoPagePrev = 'Previous Page'; + sdxHintGotoPageNext = 'Next Page'; + sdxHintGotoPageLast = 'Last Page'; + sdxHintActivePage = 'Active Page'; + + sdxHintToolsCustomize = 'Customize Toolbars'; + sdxHintToolsOptions = 'Options'; + + sdxHintHelpTopics = 'Help Topics'; + sdxHintHelpAbout = 'About'; + + sdxPopupMenuLargeButtons = '&Large Buttons'; + sdxPopupMenuFlatButtons = '&Flat Buttons'; + + sdxPaperSize = 'Paper Size:'; + sdxStatus = 'Status:'; + sdxStatusReady = 'Ready'; + sdxStatusPrinting = 'Printing. Completed %d page(s)'; + sdxStatusGenerateReport = 'Generating Report. Completed %d%%'; + + sdxHintDoubleClickForChangePaperSize = 'Double Click for Change Paper Size'; + sdxHintDoubleClickForChangeMargins = 'Double Click for Change Margins'; + + { Date&Time Formats Dialog } + + sdxDTFormatsCaption = 'Date and Time'; + sdxDTFormatsAvailableDateFormats = '&Available Date Formats:'; + sdxDTFormatsAvailableTimeFormats = 'Available &Time Formats:'; + sdxDTFormatsAutoUpdate = '&Update Automatically'; + sdxDTFormatsChangeDefaultFormat = + 'Do you want to change the default date and time formats to match "%s" - "%s" ?'; + + { PageNumber Formats Dialog } + + sdxPNFormatsCaption = 'Page Number Format'; + sdxPageNumbering = 'Page Numbering'; + sdxPNFormatsNumberFormat = 'Number &Format:'; + sdxPNFormatsContinueFromPrevious = '&Continue from Previous Section'; + sdxPNFormatsStartAt = 'Start &At:'; + sdxPNFormatsChangeDefaultFormat = + 'Do you want to change the default Page numbering format to match "%s" ?'; + + { Zoom Dialog } + + sdxZoomDlgCaption = 'Zoom'; + sdxZoomDlgZoomTo = ' Zoom To '; + sdxZoomDlgPageWidth = 'Page &Width'; + sdxZoomDlgWholePage = 'W&hole Page'; + sdxZoomDlgTwoPages = '&Two Pages'; + sdxZoomDlgFourPages = '&Four Pages'; + sdxZoomDlgManyPages = '&Many Pages:'; + sdxZoomDlgPercent = 'P&ercent:'; + sdxZoomDlgPreview = ' Preview '; + sdxZoomDlgFontPreview = ' 12pt Times New Roman '; + sdxZoomDlgFontPreviewString = 'AaBbCcDdEeXxYyZz'; + + { Select page X x Y } + + sdxPages = 'Pages'; + sdxCancel = 'Cancel'; + + { Preferences dialog } + + sdxPreferenceDlgCaption = 'Options'; + sdxPreferenceDlgTab1 = '&General'; + sdxPreferenceDlgTab2 = ''; + sdxPreferenceDlgTab3 = ''; + sdxPreferenceDlgTab4 = ''; + sdxPreferenceDlgTab5 = ''; + sdxPreferenceDlgTab6 = ''; + sdxPreferenceDlgTab7 = ''; + sdxPreferenceDlgTab8 = ''; + sdxPreferenceDlgTab9 = ''; + sdxPreferenceDlgTab10 = ''; + sdxPreferenceDlgShow = ' &Show '; + sdxPreferenceDlgMargins = '&Margins '; + sdxPreferenceDlgMarginsHints = 'Margins &Hints'; + sdxPreferenceDlgMargingWhileDragging = 'Margins Hints While &Dragging'; + sdxPreferenceDlgLargeBtns = '&Large Toolbar Buttons'; + sdxPreferenceDlgFlatBtns = '&Flat Toolbar Buttons'; + sdxPreferenceDlgMarginsColor = 'Margins &Color:'; + sdxPreferenceDlgMeasurementUnits = 'Measurement &Units:'; + sdxPreferenceDlgSaveForRunTimeToo = 'Save for &RunTime too'; + sdxPreferenceDlgZoomScroll = '&Zoom on roll with IntelliMouse'; + sdxPreferenceDlgZoomStep = 'Zoom Ste&p:'; + + { Page Setup } + + sdxCloneStyleCaptionPrefix = 'Copy (%d) of '; + sdxInvalideStyleCaption = 'The style name "%s" already exists. Please supply another name.'; + + sdxPageSetupCaption = 'Page Setup'; + sdxStyleName = 'Style &Name:'; + + sdxPage = '&Page'; + sdxMargins = '&Margins'; + sdxHeaderFooter = '&Header\Footer'; + sdxScaling = '&Scaling'; + + sdxPaper = ' Paper '; + sdxPaperType = 'T&ype'; + sdxPaperDimension = 'Dimension'; + sdxPaperWidth = '&Width:'; + sdxPaperHeight = 'H&eight:'; + sdxPaperSource = 'Paper so&urce'; + + sdxOrientation = ' Orientation '; + sdxPortrait = 'P&ortrait'; + sdxLandscape = '&Landscape'; + sdxPrintOrder = ' Print Order '; + sdxDownThenOver = '&Down, then over'; + sdxOverThenDown = 'O&ver, then down'; + sdxShading = ' Shading '; + sdxPrintUsingGrayShading = 'Print using &gray shading'; + + sdxCenterOnPage = 'Center on page'; + sdxHorizontally = 'Hori&zontally'; + sdxVertically = '&Vertically'; + + sdxHeader = 'Header '; + sdxBtnHeaderFont = '&Font...'; + sdxBtnHeaderBackground = '&Background'; + sdxFooter = 'Footer '; + sdxBtnFooterFont = 'Fo&nt...'; + sdxBtnFooterBackground = 'Back&ground'; + + sdxTop = '&Top:'; + sdxLeft = '&Left:'; + sdxRight = 'Ri&ght:'; + sdxBottom = '&Bottom:'; + sdxHeader2 = 'H&eader:'; + sdxFooter2 = 'Foote&r:'; + + sdxAlignment = 'Alignment'; + sdxVertAlignment = ' Vertical Alignment '; + sdxReverseOnEvenPages = '&Reverse on even pages'; + + sdxAdjustTo = '&Adjust To:'; + sdxFitTo = '&Fit To:'; + sdxPercentOfNormalSize = '% normal size'; + sdxPagesWideBy = 'page(s) &wide by'; + sdxTall = '&tall'; + + sdxOf = 'Of'; + sdxLastPrinted = 'Last Printed '; + sdxFileName = 'Filename '; + sdxFileNameAndPath = 'Filename and path '; + sdxPrintedBy = 'Printed By '; + sdxPrintedOn = 'Printed On '; + sdxCreatedBy = 'Created By '; + sdxCreatedOn = 'Created On '; + sdxConfidential = 'Confidential'; + + { HF function } + + sdxHFFunctionNameUnknown = 'Unknown'; + sdxHFFunctionNamePageNumber = 'Page Number'; + sdxHFFunctionNameTotalPages = 'Total Pages'; + sdxHFFunctionNamePageOfPages = 'Page # of Pages #'; + sdxHFFunctionNameDateTime = 'Date and Time'; + sdxHFFunctionNameDate = 'Date'; + sdxHFFunctionNameTime = 'Time'; + sdxHFFunctionNameUserName = 'User Name'; + sdxHFFunctionNameMachineName = 'Machine Name'; + + sdxHFFunctionHintPageNumber = 'Page Number'; + sdxHFFunctionHintTotalPages = 'Total Pages'; + sdxHFFunctionHintPageOfPages = 'Page # of Pages #'; + sdxHFFunctionHintDateTime = 'Date and Time Printed'; + sdxHFFunctionHintDate = 'Date Printed'; + sdxHFFunctionHintTime = 'Time Printed'; + sdxHFFunctionHintUserName = 'User Name'; + sdxHFFunctionHintMachineName = 'Machine Name'; + + sdxHFFunctionTemplatePageNumber = 'Page #'; + sdxHFFunctionTemplateTotalPages = 'Total Pages'; + sdxHFFunctionTemplatePageOfPages = 'Page # of Pages #'; + sdxHFFunctionTemplateDateTime = 'Date & Time Printed'; + sdxHFFunctionTemplateDate = 'Date Printed'; + sdxHFFunctionTemplateTime = 'Time Printed'; + sdxHFFunctionTemplateUserName = 'User Name'; + sdxHFFunctionTemplateMachineName = 'Machine Name'; + + { Designer strings } + + { Months } + + sdxJanuary = 'January'; + sdxFebruary = 'February'; + sdxMarch = 'March'; + sdxApril = 'April'; + sdxMay = 'May'; + sdxJune = 'June'; + sdxJuly = 'July'; + sdxAugust = 'August'; + sdxSeptember = 'September'; + sdxOctober = 'October'; + sdxNovember = 'November'; + sdxDecember = 'December'; + + sdxEast = 'East'; + sdxWest = 'West'; + sdxSouth = 'South'; + sdxNorth = 'North'; + + sdxTotal = 'Total'; + + { dxFlowChart } + + sdxPlan = 'Plan'; + sdxSwimmingPool = 'Swimming-pool'; + sdxAdministration = 'Administration'; + sdxPark = 'Park'; + sdxCarParking = 'Car-Parking'; + + { dxOrgChart } + + sdxCorporateHeadquarters = 'Corporate' + #13#10 + 'Headquarters'; + sdxSalesAndMarketing = 'Sales and' + #13#10 + 'Marketing'; + sdxEngineering = 'Engineering'; + sdxFieldOfficeCanada = 'Field Office:' + #13#10 + 'Canada'; + + { dxMasterView } + + sdxOrderNoCaption = 'OrderNo'; + sdxNameCaption = 'Name'; + sdxCountCaption = 'Count'; + sdxCompanyCaption = 'Company'; + sdxAddressCaption = 'Address'; + sdxPriceCaption = 'Price'; + sdxCashCaption = 'Cash'; + + sdxName1 = 'Jennie Valentine'; + sdxName2 = 'Sam Hill'; + sdxCompany1 = 'Jennie Inc.'; + sdxCompany2 = 'Daimler-Chrysler AG'; + sdxAddress1 = '123 Home Lane'; + sdxAddress2 = '9333 Holmes Dr.'; + + { dxTreeList } + + sdxCountIs = 'Count is: %d'; + sdxRegular = 'Regular'; + sdxIrregular = 'Irregular'; + + sdxTLBand = 'Item Data'; + sdxTLColumnName = 'Name'; + sdxTLColumnAxisymmetric = 'Axisymmetric'; + sdxTLColumnItemShape = 'Shape'; + + sdxItemShapeAsText = '(Graphic)'; + + sdxItem1Name = 'Cylinder'; + sdxItem2Name = 'Cone'; + sdxItem3Name = 'Pyramid'; + sdxItem4Name = 'Box'; + sdxItem5Name = 'Free Surface'; + + sdxItem1Description = ''; + sdxItem2Description = 'Axisymmetric geometry figure'; + sdxItem3Description = 'Axisymmetric geometry figure'; + sdxItem4Description = 'Acute-angled geometry figure'; + sdxItem5Description = ''; + sdxItem6Description = ''; + sdxItem7Description = 'Simple extrusion surface'; + + { PS 2.3 } + + { Patterns common } + + sdxPatternIsNotRegistered = 'Pattern "%s" is not registered'; + + { Excel edge patterns } + + sdxSolidEdgePattern = 'Solid'; + sdxThinSolidEdgePattern = 'Medium Solid'; + sdxMediumSolidEdgePattern = 'Medium Solid'; + sdxThickSolidEdgePattern = 'Thick Solid'; + sdxDottedEdgePattern = 'Dotted'; + sdxDashedEdgePattern = 'Dashed'; + sdxDashDotDotEdgePattern = 'Dash Dot Dot'; + sdxDashDotEdgePattern = 'Dash Dot'; + sdxSlantedDashDotEdgePattern = 'Slanted Dash Dot'; + sdxMediumDashDotDotEdgePattern = 'Medium Dash Dot Dot'; + sdxHairEdgePattern = 'Hair'; + sdxMediumDashDotEdgePattern = 'Medium Dash Dot'; + sdxMediumDashedEdgePattern = 'Medium Dashed'; + sdxDoubleLineEdgePattern = 'Double Line'; + + { Excel fill patterns names} + + sdxSolidFillPattern = 'Solid'; + sdxGray75FillPattern = '75% Gray'; + sdxGray50FillPattern = '50% Gray'; + sdxGray25FillPattern = '25% Gray'; + sdxGray125FillPattern = '12.5% Gray'; + sdxGray625FillPattern = '6.25% Gray'; + sdxHorizontalStripeFillPattern = 'Horizontal Stripe'; + sdxVerticalStripeFillPattern = 'Vertical Stripe'; + sdxReverseDiagonalStripeFillPattern = 'Reverse Diagonal Stripe'; + sdxDiagonalStripeFillPattern = 'Diagonal Stripe'; + sdxDiagonalCrossHatchFillPattern = 'Diagonal Cross Hatch'; + sdxThickCrossHatchFillPattern = 'Thick Cross Hatch'; + sdxThinHorizontalStripeFillPattern = 'Thin Horizontal Stripe'; + sdxThinVerticalStripeFillPattern = 'Thin Vertical Stripe'; + sdxThinReverseDiagonalStripeFillPattern = 'Thin Reverse Diagonal Stripe'; + sdxThinDiagonalStripeFillPattern = 'Thin Diagonal Stripe'; + sdxThinHorizontalCrossHatchFillPattern = 'Thin Horizontal Cross Hatch'; + sdxThinDiagonalCrossHatchFillPattern = 'Thin Diagonal Cross Hatch'; + + { cxSpreadSheet } + + sdxShowRowAndColumnHeadings = '&Row and Column Headings'; + sdxShowGridLines = 'GridLines'; + sdxSuppressSourceFormats = '&Suppress Source Formats'; + sdxRepeatHeaderRowAtTop = 'Repeat Header Row at Top'; + sdxDataToPrintDoesNotExist = + 'Cannot activate ReportLink because PrintingSystem did not find anything to print.'; + + { Designer strings } + + { Short names of month } + + sdxJanuaryShort = 'Jan'; + sdxFebruaryShort = 'Feb'; + sdxMarchShort = 'March'; + sdxAprilShort = 'April'; + sdxMayShort = 'May'; + sdxJuneShort = 'June'; + sdxJulyShort = 'July'; + sdxAugustShort = 'Aug'; + sdxSeptemberShort = 'Sept'; + sdxOctoberShort = 'Oct'; + sdxNovemberShort = 'Nov'; + sdxDecemberShort = 'Dec'; + + { TreeView } + + sdxTechnicalDepartment = 'Technical Department'; + sdxSoftwareDepartment = 'Software Department'; + sdxSystemProgrammers = 'Core Developers'; + sdxEndUserProgrammers = 'GUI Developers'; + sdxBetaTesters = 'Beta Testers'; + sdxHumanResourceDepartment = 'Human Resource Department'; + + { misc. } + + sdxTreeLines = '&TreeLines'; + sdxTreeLinesColor = 'T&ree Line Color:'; + sdxExpandButtons = 'E&xpand Buttons'; + sdxCheckMarks = 'Check Marks'; + sdxTreeEffects = 'Tree Effects'; + sdxAppearance = 'Appearance'; + + { Designer previews } + + { Localize if you want (they are used inside FormatReport dialog -> ReportPreview) } + + sdxCarLevelCaption = 'Cars'; + + sdxManufacturerBandCaption = 'Manufacturer Data'; + sdxModelBandCaption = 'Car Data'; + + sdxManufacturerNameColumnCaption = 'Name'; + sdxManufacturerLogoColumnCaption = 'Logo'; + sdxManufacturerCountryColumnCaption = 'Country'; + sdxCarModelColumnCaption = 'Model'; + sdxCarIsSUVColumnCaption = 'SUV'; + sdxCarPhotoColumnCaption = 'Photo'; + + sdxCarManufacturerName1 = 'BMW'; + sdxCarManufacturerName2 = 'Ford'; + sdxCarManufacturerName3 = 'Audi'; + sdxCarManufacturerName4 = 'Land Rover'; + + sdxCarManufacturerCountry1 = 'Germany'; + sdxCarManufacturerCountry2 = 'United States'; + sdxCarManufacturerCountry3 = 'Germany'; + sdxCarManufacturerCountry4 = 'United Kingdom'; + + sdxCarModel1 = 'X5 4.8is'; + sdxCarModel2 = 'Excursion'; + sdxCarModel3 = 'S8 Quattro'; + sdxCarModel4 = 'G4 Challenge'; + + sdxTrue = 'True'; + sdxFalse = 'False'; + + { PS 2.4 } + + { dxPrnDev.pas } + + sdxAuto = 'Auto'; + sdxCustom = 'Custom'; + sdxEnv = 'Env'; + + { Grid 4 } + + sdxLookAndFeelFlat = 'Flat'; + sdxLookAndFeelStandard = 'Standard'; + sdxLookAndFeelUltraFlat = 'UltraFlat'; + + sdxViewTab = 'View'; + sdxBehaviorsTab = 'Behaviors'; + sdxPreviewTab = 'Preview'; + sdxCardsTab = 'Cards'; + + sdxFormatting = 'Formatting'; + sdxLookAndFeel = 'Look and Feel'; + sdxLevelCaption = '&Caption'; + sdxFilterBar = '&Filter Bar'; + sdxRefinements = 'Refinements'; + sdxProcessSelection = 'Process &Selection'; + sdxProcessExactSelection = 'Process E&xact Selection'; + sdxExpanding = 'Expanding'; + sdxGroups = '&Groups'; + sdxDetails = '&Details'; + sdxStartFromActiveDetails = 'Start from Active Details'; + sdxOnlyActiveDetails = 'Only Active Details'; + sdxVisible = '&Visible'; + sdxPreviewAutoHeight = 'A&uto Height'; + sdxPreviewMaxLineCount = '&Max Line Count: '; + sdxSizes = 'Sizes'; + sdxKeepSameWidth = '&Keep Same Width'; + sdxKeepSameHeight = 'Keep Same &Height'; + sdxFraming = 'Framing'; + sdxSpacing = 'Spacing'; + sdxShadow = 'Shadow'; + sdxDepth = '&Depth:'; + sdxPosition = '&Position'; + sdxPositioning = 'Positioning'; + sdxHorizontal = 'H&orizontal:'; + sdxVertical = 'V&ertical:'; + + sdxSummaryFormat = 'Count = 0'; + + sdxCannotUseOnEveryPageMode = + 'Cannot Use OnEveryPage Mode'+ #13#10 + + #13#10 + + 'You should or(and)' + #13#10 + + ' - Collapse all Master Records' + #13#10 + + ' - Toggle "Unwrap" Option off on "Behaviors" Tab'; + + sdxIncorrectBandHeadersState = + 'Cannot Use BandHeaders OnEveryPage Mode' + #13#10 + + #13#10 + + 'You should either:' + #13#10 + + ' - Set Caption OnEveryPage Option On' + #13#10 + + ' - Set Caption Visible Option Off'; + sdxIncorrectHeadersState = + 'Cannot Use Headers OnEveryPage Mode' + #13#10 + + #13#10 + + 'You should either:' + #13#10 + + ' - Set Caption and Band OnEveryPage Option On' + #13#10 + + ' - Set Caption and Band Visible Option Off'; + sdxIncorrectFootersState = + 'Cannot Use Footers OnEveryPage Mode' + #13#10 + + #13#10 + + 'You should either:' + #13#10 + + ' - Set FilterBar OnEveryPage Option On' + #13#10 + + ' - Set FilterBar Visible Option Off'; + + sdxCharts = 'Charts'; + + { PS 3 } + + sdxTPicture = 'TPicture'; + sdxCopy = '&Copy'; + sdxSave = '&Save...'; + sdxBaseStyle = 'Base Style'; + + sdxComponentAlreadyExists = 'Component named "%s" already exists'; + sdxInvalidComponentName = '"%s" is not a valid component name'; + + { shapes } + + sdxRectangle = 'Rectangle'; + sdxSquare = 'Square'; + sdxEllipse = 'Ellipse'; + sdxCircle = 'Circle'; + sdxRoundRect = 'RoundRect'; + sdxRoundSquare = 'RoundSquare'; + + { standard pattern names} + + sdxHorizontalFillPattern = 'Horizontal'; + sdxVerticalFillPattern = 'Vertical'; + sdxFDiagonalFillPattern = 'FDiagonal'; + sdxBDiagonalFillPattern = 'BDiagonal'; + sdxCrossFillPattern = 'Cross'; + sdxDiagCrossFillPattern = 'DiagCros'; + + { explorer } + + sdxCyclicIDReferences = 'Cyclic ID references %s and %s'; + sdxLoadReportDataToFileTitle = 'Load Report'; + sdxSaveReportDataToFileTitle = 'Save Report As'; + sdxInvalidExternalStorage = 'Invalid External Storage'; + sdxLinkIsNotIncludedInUsesClause = + 'ReportFile contains ReportLink "%0:s"' + #13#10 + + 'Unit with declaration of "%0:s" must be included in uses clause'; + sdxInvalidStorageVersion = 'Invalid Storage Verison: %d'; + sdxPSReportFiles = 'Report Files'; + sdxReportFileLoadError = + 'Cannot load Report File "%s".' + #13#10 + + 'File is corrupted or is locked by another User or Application.' + #13#10 + + #13#10 + + 'Original Report will be restored.'; + + sdxNone = '(None)'; + sdxReportDocumentIsCorrupted = '(File is not a ReportDocument or Corrupted)'; + + sdxCloseExplorerHint = 'Close Explorer'; + sdxExplorerCaption = 'Explorer'; + sdxExplorerRootFolderCaption = 'Root'; + sdxNewExplorerFolderItem = 'New Folder'; + sdxCopyOfItem = 'Copy of '; + sdxReportExplorer = 'Report Explorer'; + + sdxDataLoadErrorText = 'Cannot load Report Data'; + sdxDBBasedExplorerItemDataLoadError = + 'Cannot load Report Data.' + #13#10 + + 'Data are corrupted or are locked'; + sdxFileBasedExplorerItemDataLoadError = + 'Cannot load Report Data.' + #13#10 + + 'File is corruted or is locked by another User or Application'; + sdxDeleteNonEmptyFolderMessageText = 'Folder "%s" is not Empty. Delete anyway?'; + sdxDeleteFolderMessageText = 'Delete Folder "%s" ?'; + sdxDeleteItemMessageText = 'Delete Item "%s" ?'; + sdxCannotRenameFolderText = 'Cannot rename folder "%s". A folder with name "%s" already exists. Specify a different name.'; + sdxCannotRenameItemText = 'Cannot rename item "%s". An item with name "%s" already exists. Specify a different name.'; + sdxOverwriteFolderMessageText = + 'This folder "%s" already contains folder named "%s".' + #13#10 + + #13#10 + + 'If the items in existing folder have the same name as items in the' + #13#10 + + 'folder you are moving or copying, they will be replaced. Do you still?' + #13#10 + + 'want to move or copy the folder?'; + sdxOverwriteItemMessageText = + 'This Folder "%s" already contains item named "%s".' + #13#10 + + #13#10 + + 'Would you like to overwrite existing item?'; + sdxSelectNewRoot = 'Select new Root Directory where the Reports will be stored'; + sdxInvalidFolderName = 'Invalid Folder Name "%s"'; + sdxInvalidReportName = 'Invalid Report Name "%s"'; + + sdxExplorerBar = 'Explorer'; + + sdxMenuFileSave = '&Save'; + sdxMenuFileSaveAs = 'Save &As...'; + sdxMenuFileLoad = '&Load'; + sdxMenuFileClose = 'U&nload'; + sdxHintFileSave = 'Save Report'; + sdxHintFileSaveAs = 'Save Report As'; + sdxHintFileLoad = 'Load Report'; + sdxHintFileClose = 'Unload Report'; + + sdxMenuExplorer = 'E&xplorer'; + sdxMenuExplorerCreateFolder = 'Create &Folder'; + sdxMenuExplorerDelete = '&Delete...'; + sdxMenuExplorerRename = 'Rena&me'; + sdxMenuExplorerProperties = '&Properties...'; + sdxMenuExplorerRefresh = 'Refresh'; + sdxMenuExplorerChangeRootPath = 'Change Root...'; + sdxMenuExplorerSetAsRoot = 'Set As Root'; + sdxMenuExplorerGoToUpOneLevel = 'Up One Level'; + + sdxHintExplorerCreateFolder = 'Create New Folder'; + sdxHintExplorerDelete = 'Delete'; + sdxHintExplorerRename = 'Rename'; + sdxHintExplorerProperties = 'Properties'; + sdxHintExplorerRefresh = 'Refresh'; + sdxHintExplorerChangeRootPath = 'Change Root'; + sdxHintExplorerSetAsRoot = 'Set Current Folder as Root'; + sdxHintExplorerGoToUpOneLevel = 'Up One Level'; + + sdxMenuViewExplorer = 'E&xplorer'; + sdxHintViewExplorer = 'Show Explorer'; + + sdxSummary = 'Summary'; + sdxCreator = 'Creato&r:'; + sdxCreationDate = 'Create&d:'; + + sdxMenuViewThumbnails = 'Th&umbnails'; + sdxMenuThumbnailsLarge = '&Large Thumbnails'; + sdxMenuThumbnailsSmall = '&Small Thumbnails'; + + sdxHintViewThumbnails = 'Show Thumbnails'; + sdxHintThumbnailsLarge = 'Switch to large thumbnails'; + sdxHintThumbnailsSmall = 'Switch to small thumbnails'; + + sdxMenuFormatTitle = 'T&itle...'; + sdxHintFormatTitle = 'Format Report Title'; + + sdxHalf = 'Half'; + sdxPredefinedFunctions = ' Predefined Functions '; // dxPgsDlg.pas + sdxZoomParameters = ' Zoom &Parameters '; // dxPSPrvwOpt.pas + + sdxWrapData = '&Wrap Data'; + + sdxMenuShortcutExplorer = 'Explorer'; + sdxExplorerToolBar = 'Explorer'; + + sdxMenuShortcutThumbnails = 'Thumbnails'; + + { TreeView New} + + sdxButtons = 'Buttons'; + + { ListView } + + sdxBtnHeadersFont = '&Headers Font...'; + sdxHeadersTransparent = 'Transparent &Headers'; + sdxHintListViewDesignerMessage = ' Most Options Are Being Taken Into Account Only In Detailed View'; + sdxColumnHeaders = '&Column Headers'; + + { Group LookAndFeel Names } + + sdxReportGroupNullLookAndFeel = 'Null'; + sdxReportGroupStandardLookAndFeel = 'Standard'; + sdxReportGroupOfficeLookAndFeel = 'Office'; + sdxReportGroupWebLookAndFeel = 'Web'; + + sdxLayoutGroupDefaultCaption = 'Layout Group'; + sdxLayoutItemDefaultCaption = 'Layout Item'; + + { Designer Previews} + + { Localize if you want (they are used inside FormatReport dialog -> ReportPreview) } + + sdxCarManufacturerName5 = 'DaimlerChrysler AG'; + sdxCarManufacturerCountry5 = 'Germany'; + sdxCarModel5 = 'Maybach 62'; + + sdxLuxurySedans = 'Luxury Sedans'; + sdxCarManufacturer = 'Manufacturer'; + sdxCarModel = 'Model'; + sdxCarEngine = 'Engine'; + sdxCarTransmission = 'Transmission'; + sdxCarTires = 'Tires'; + sdx760V12Manufacturer = 'BMW'; + sdx760V12Model = '760Li V12'; + sdx760V12Engine = '6.0L DOHC V12 438 HP 48V DI Valvetronic 12-cylinder engine with 6.0-liter displacement, dual overhead cam valvetrain'; + sdx760V12Transmission = 'Elec 6-Speed Automatic w/Steptronic'; + sdx760V12Tires = 'P245/45R19 Fr - P275/40R19 Rr Performance. Low Profile tires with 245mm width, 19.0" rim'; + + { Styles } + + sdxBandHeaderStyle = 'BandHeader'; + sdxCaptionStyle = 'Caption'; + sdxCardCaptionRowStyle = 'Card Caption Row'; + sdxCardRowCaptionStyle = 'Card Row Caption'; + sdxCategoryStyle = 'Category'; + sdxContentStyle = 'Content'; + sdxContentEvenStyle = 'Content Even Rows'; + sdxContentOddStyle = 'Content Odd Rows'; + sdxFilterBarStyle = 'Filter Bar'; + sdxFooterStyle = 'Footer'; + sdxFooterRowStyle = 'Footer Row'; + sdxGroupStyle = 'Group'; + sdxHeaderStyle = 'Header'; + sdxIndentStyle = 'Indent'; + sdxPreviewStyle = 'Preview'; + sdxSelectionStyle = 'Selection'; + + sdxStyles = 'Styles'; + sdxStyleSheets = 'Style Sheets'; + sdxBtnTexture = '&Texture...'; + sdxBtnTextureClear = 'Cl&ear'; + sdxBtnColor = 'Co&lor...'; + sdxBtnSaveAs = 'Save &As...'; + sdxBtnRename = '&Rename...'; + + sdxLoadBitmapDlgTitle = 'Load Texture'; + + sdxDeleteStyleSheet = 'Delete StyleSheet Named "%s"?'; + sdxUnnamedStyleSheet = 'Unnamed'; + sdxCreateNewStyleQueryNamePrompt = 'Enter New StyleSheet Name: '; + sdxStyleSheetNameAlreadyExists = 'StyleSheet named "%s" Already Exists'; + + sdxCannotLoadImage = 'Cannot Load Image "%s"'; + sdxUseNativeStyles = '&Use Native Styles'; + sdxSuppressBackgroundBitmaps = '&Suppress Background Textures'; + sdxConsumeSelectionStyle = 'Consume Selection Style'; + + { Grid4 new } + + sdxSize = 'Size'; + sdxLevels = 'Levels'; + sdxUnwrap = '&Unwrap'; + sdxUnwrapTopLevel = 'Un&wrap Top Level'; + sdxRiseActiveToTop = 'Rise Active Level onto Top'; + sdxCannotUseOnEveryPageModeInAggregatedState = + 'Cannot Use OnEveryPage Mode'+ #13#10 + + 'While Performing in Aggregated State'; + + sdxPagination = 'Pagination'; + sdxByBands = 'By Bands'; + sdxByColumns = 'By Columns'; + sdxByRows = 'By &Rows'; + sdxByTopLevelGroups = 'By TopLevel Groups'; + sdxOneGroupPerPage = 'One Group Per Page'; + + sdxSkipEmptyViews = 'Skip Empty Views'; + + {* For those who will translate *} + {* You should also check "sdxCannotUseOnEveryPageMode" resource string - see above *} + {* It was changed to "- Toggle "Unwrap" Option off on "Behaviors" Tab"*} + + { TL 4 } + sdxBorders = 'Borders'; + sdxExplicitlyExpandNodes = 'Explicitly Expand Nodes'; + sdxNodes = '&Nodes'; + sdxSeparators = 'Separators'; + sdxThickness = 'Thickness'; + sdxTLIncorrectHeadersState = + 'Cannot Use Headers OnEveryPage Mode' + #13#10 + + #13#10 + + 'You should either:' + #13#10 + + ' - Set Band OnEveryPage Option On' + #13#10 + + ' - Set Band Visible Option Off'; + + { cxVerticalGrid } + + sdxRows = '&Rows'; + + sdxMultipleRecords = '&Multiple Records'; + sdxBestFit = '&Best Fit'; + sdxKeepSameRecordWidths = '&Keep Same Record Widths'; + sdxWrapRecords = '&Wrap Records'; + + sdxByWrapping = 'By &Wrapping'; + sdxOneWrappingPerPage = '&One Wrapping Per Page'; + + {new in 3.01} + sdxCurrentRecord = 'Current Record'; + sdxLoadedRecords = 'Loaded Records'; + sdxAllRecords = 'All Records'; + + { Container Designer } + + sdxPaginateByControlDetails = 'Control Details'; + sdxPaginateByControls = 'Controls'; + sdxPaginateByGroups = 'Groups'; + sdxPaginateByItems = 'Items'; + + sdxControlsPlace = 'Controls Place'; + sdxExpandHeight = 'Expand Height'; + sdxExpandWidth = 'Expand Width'; + sdxShrinkHeight = 'Shrink Height'; + sdxShrinkWidth = 'Shrink Width'; + + sdxCheckAll = 'Check &All'; + sdxCheckAllChildren = 'Check All &Children'; + sdxControlsTab = 'Controls'; + sdxExpandAll = 'E&xpand All'; + sdxHiddenControlsTab = 'Hidden Controls'; + sdxReportLinksTab = 'Aggregated Designers'; + sdxAvailableLinks = '&Available Links:'; + sdxAggregatedLinks = 'A&ggregated Links:'; + sdxTransparents = 'Transparents'; + sdxUncheckAllChildren = 'Uncheck &All Children'; + + sdxRoot = '&Root'; + sdxRootBorders = 'Root &Borders'; + sdxControls = '&Controls'; + sdxContainers = 'C&ontainers'; + + sdxHideCustomContainers = '&Hide Custom Containers'; + + { General } + + // FileSize abbreviation + + sdxBytes = 'Bytes'; + sdxKiloBytes = 'KB'; + sdxMegaBytes = 'MB'; + sdxGigaBytes = 'GB'; + + // Misc. + + sdxThereIsNoPictureToDisplay = 'There is no picture to display'; + sdxInvalidRootDirectory = 'Directory "%s" does not exists. Continue selection ?'; + sdxPressEscToCancel = 'Press Esc to cancel'; + sdxMenuFileRebuild = '&Rebuild'; + sdxBuildingReportStatusText = 'Building report - Press Esc to cancel'; + sdxPrintingReportStatusText = 'Printing report - Press Esc to cancel'; + + sdxBuiltIn = '[BuiltIn]'; + sdxUserDefined = '[User Defined]'; + sdxNewStyleRepositoryWasCreated = 'New StyleRepository "%s" was created and assigned'; + + { new in PS 3.1} + sdxLineSpacing = '&Line spacing:'; + sdxTextAlignJustified = 'Justified'; + sdxSampleText = 'Sample Text Sample Text'; + + sdxCardsRows = '&Cards'; + sdxTransparentRichEdits = 'Transparent &RichEdit Content'; + + sdxIncorrectFilterBarState = + 'Cannot Use FilterBar OnEveryPage Mode' + #13#10 + + #13#10 + + 'You should either:' + #13#10 + + ' - Set Caption OnEveryPage Option On' + #13#10 + + ' - Set Caption Visible Option Off'; + sdxIncorrectBandHeadersState2 = + 'Cannot Use BandHeaders OnEveryPage Mode' + #13#10 + + #13#10 + + 'You should either:' + #13#10 + + ' - Set Caption and FilterBar OnEveryPage Option On' + #13#10 + + ' - Set Caption and FilterBar Visible Option Off'; + sdxIncorrectHeadersState2 = + 'Cannot Use Headers OnEveryPage Mode' + #13#10 + + #13#10 + + 'You should either:' + #13#10 + + ' - Set Caption, FilterBar and Band OnEveryPage Option On' + #13#10 + + ' - Set Caption, FilterBar and Band Visible Option Off'; + + { new in PS 3.2} + sdxAvailableReportLinks = 'Available ReportLinks'; + sdxBtnRemoveInconsistents = 'Remove Unneeded'; + sdxColumnHeadersOnEveryPage = 'Column &Headers'; + + { Scheduler } + + sdxNotes = 'Notes'; + sdxTaskPad = 'TaskPad'; + sdxPrimaryTimeZone = 'Primary'; + sdxSecondaryTimeZone = 'Secondary'; + + sdxDay = 'Day'; + sdxWeek = 'Week'; + sdxMonth = 'Month'; + + sdxSchedulerSchedulerHeader = 'Scheduler Header'; + sdxSchedulerContent = 'Content'; + sdxSchedulerDateNavigatorContent = 'DateNavigator Content'; + sdxSchedulerDateNavigatorHeader = 'DateNavigator Header'; + sdxSchedulerDayHeader = 'Day Header'; + sdxSchedulerEvent = 'Event'; + sdxSchedulerResourceHeader = 'Resource Header'; + sdxSchedulerNotesAreaBlank = 'Notes Area (Blank)'; + sdxSchedulerNotesAreaLined = 'Notes Area (Lined)'; + sdxSchedulerTaskPad = 'TaskPad'; + sdxSchedulerTimeRuler = 'Time Ruler'; + + sdxPrintStyleNameDaily = 'Daily'; + sdxPrintStyleNameWeekly = 'Weekly'; + sdxPrintStyleNameMonthly = 'Monthly'; + sdxPrintStyleNameDetails = 'Details'; + sdxPrintStyleNameMemo = 'Memo'; + sdxPrintStyleNameTrifold = 'Trifold'; + + sdxPrintStyleCaptionDaily = 'Daily Style'; + sdxPrintStyleCaptionWeekly = 'Weekly Style'; + sdxPrintStyleCaptionMonthly = 'Monthly Style'; + sdxPrintStyleCaptionDetails = 'Calendar Details Style'; + sdxPrintStyleCaptionMemo = 'Memo Style'; + sdxPrintStyleCaptionTimeLine = 'TimeLine Style'; + sdxPrintStyleCaptionTrifold = 'Tri-fold Style'; + sdxPrintStyleCaptionYearly = 'Yearly Style'; + sdxPrintStyleShowEventImages = 'Show Event Images'; + sdxPrintStyleShowResourceImages = 'Show Resource Images'; + + sdxTabPrintStyles = 'Print Styles'; + + sdxPrintStyleDontPrintWeekEnds = '&Don''t Print Weekends'; + sdxPrintStyleWorkTimeOnly = '&Work Time Only'; + + sdxPrintStyleInclude = 'Include:'; + sdxPrintStyleIncludeTaskPad = 'Task&Pad'; + sdxPrintStyleIncludeNotesAreaBlank = 'Notes Area (&Blank)'; + sdxPrintStyleIncludeNotesAreaLined = 'Notes Area (&Lined)'; + sdxPrintStyleLayout = '&Layout:'; + sdxPrintStylePrintFrom = 'Print &From:'; + sdxPrintStylePrintTo = 'Print &To:'; + + sdxPrintStyleDailyLayout1PPD = '1 page/day'; + sdxPrintStyleDailyLayout2PPD = '2 pages/day'; + + sdxPrintStyleWeeklyArrange = '&Arrange:'; + sdxPrintStyleWeeklyArrangeT2B = 'Top to bottom'; + sdxPrintStyleWeeklyArrangeL2R = 'Left to right'; + sdxPrintStyleWeeklyLayout1PPW = '1 page/week'; + sdxPrintStyleWeeklyLayout2PPW = '2 pages/week'; + sdxPrintStyleWeeklyDaysLayout = '&Days layout:'; + sdxPrintStyleWeeklyDaysLayoutTC = 'Two columns'; + sdxPrintStyleWeeklyDaysLayoutOC = 'One column'; + + sdxPrintStyleMemoStartEachItemOnNewPage = 'Start Each Item On New Page'; + sdxPrintStyleMemoPrintOnlySelectedEvents = 'Print Only Selected Events'; + + sdxPrintStyleMonthlyLayout1PPM = '1 page/month'; + sdxPrintStyleMonthlyLayout2PPM = '2 pages/month'; + sdxPrintStyleMonthlyPrintExactly1MPP = 'Print &Exactly One Month Per Page'; + + sdxPrintStyleTrifoldSectionModeDailyCalendar = 'Daily Calendar'; + sdxPrintStyleTrifoldSectionModeWeeklyCalendar = 'Weekly Calendar'; + sdxPrintStyleTrifoldSectionModeMonthlyCalendar = 'Monthly Calendar'; + sdxPrintStyleTrifoldSectionModeTaskPad = 'TaskPad'; + sdxPrintStyleTrifoldSectionModeNotesBlank = 'Notes (Blank)'; + sdxPrintStyleTrifoldSectionModeNotesLined = 'Notes (Lined)'; + sdxPrintStyleTrifoldSectionLeft = '&Left Section:'; + sdxPrintStyleTrifoldSectionMiddle = '&Monthly Section:'; + sdxPrintStyleTrifoldSectionRight = '&Right Section:'; + + sdxPrintStyleMonthPerPage = '&Months/Page:'; + sdxPrintStyleYearly1MPP = '1 month/page'; + sdxPrintStyleYearly2MPP = '2 months/page'; + sdxPrintStyleYearly3MPP = '3 months/page'; + sdxPrintStyleYearly4MPP = '4 months/page'; + sdxPrintStyleYearly6MPP = '6 months/page'; + sdxPrintStyleYearly12MPP = '12 months/page'; + sdxPrintStylePrimaryPageHeadersOnly = 'Primary page headers only'; + + sdxPrintStyleDetailsStartNewPageEach = 'Start a New Page Each:'; + + sdxSuppressContentColoration = 'Suppress &Content Coloration'; + sdxOneResourcePerPage = 'One &Resource Per Page'; + + sdxPrintRanges = 'Print Ranges'; + sdxPrintRangeStart = '&Start:'; + sdxPrintRangeEnd = '&End:'; + sdxHideDetailsOfPrivateAppointments = '&Hide Details of Private Appointments'; + sdxResourceCountPerPage = '&Resources/Page:'; + + sdxSubjectLabelCaption = 'Subject:'; + sdxLocationLabelCaption = 'Location:'; + sdxStartLabelCaption = 'Start:'; + sdxFinishLabelCaption = 'End:'; + sdxShowTimeAsLabelCaption = 'Show Time As:'; + sdxRecurrenceLabelCaption = 'Recurrence:'; + sdxRecurrencePatternLabelCaption = 'Recurrence Pattern:'; + + //messages + sdxSeeAboveMessage = 'Please See Above'; + sdxAllDayMessage = 'All Day'; + sdxContinuedMessage = 'Continued'; + sdxShowTimeAsFreeMessage = 'Free'; + sdxShowTimeAsTentativeMessage = 'Tentative'; + sdxShowTimeAsOutOfOfficeMessage = 'Out of Office'; + + sdxRecurrenceNoneMessage = '(none)'; + scxRecurrenceDailyMessage = 'Daily'; + scxRecurrenceWeeklyMessage = 'Weekly'; + scxRecurrenceMonthlyMessage = 'Monthly'; + scxRecurrenceYearlyMessage = 'Yearly'; + + //error messages + sdxInconsistentTrifoldStyle = 'The Tri-fold style requires at least one calendar section. ' + + 'Select Daily, Weekly, or Monthly Calendar for one of section under Options.'; + sdxBadTimePrintRange = 'The hours to print are not valid. The start time must precede the end time.'; + sdxBadDatePrintRange = 'The date in the End box cannot be prior to the date in the Start box.'; + sdxCannotPrintNoSelectedItems = 'Cannot print unless an item is selected. Select an item, and then try to print again.'; + sdxCannotPrintNoItemsAvailable = 'No items available within the specified print range.'; + + { PivotGrid } + + sdxColumnFields = '&Column Fields'; + sdxDataFields = '&Data Fields'; + sdxFiterFields = '&Filter Fields'; + sdxRowFields = '&Row Fields'; + + sdxAutoColumnsExpand = 'A&uto Columns Expand'; + sdxAutoRowsExpand = 'Auto &Rows Expand'; + + // styles + sdxPivotGridColumnHeader = 'Column Header'; + sdxPivotGridContent = 'Content'; + sdxPivotGridFieldHeader = 'Field Header'; + sdxPivotGridHeaderBackground = 'Header Background'; + sdxPivotGridRowHeader = 'Row Header'; + + // PivotPreview fields + sdxUnitPrice = 'Unit Price'; + sdxCarName = 'Car Name'; + sdxQuantity = 'Quantity'; + sdxPaymentAmount = 'Payment Amount'; + sdxPurchaseQuarter = 'Purchase Quarter'; + sdxPurchaseMonth = 'Purchase Month'; + sdxPaymentType = 'Payment Type'; + sdxCompanyName = 'Company Name'; + +implementation + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSShapes.pas b/official/x.35/ExpressPrinting System/Sources/dxPSShapes.pas new file mode 100644 index 00000000..5dc8c20e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSShapes.pas @@ -0,0 +1,538 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSShapes; + +interface + +{$I cxVer.inc} + +uses + Classes, Windows, Graphics, dxBase, dxPSCore, dxPSFillPatterns; + +type + TdxReportCellShapeClass = class of TCustomdxReportCellShape; + + TdxPSShapeFactory = class(TdxCustomClassFactory) + private + function GetItem(Index: Integer): TdxReportCellShapeClass; + public + class function Instance: TdxPSShapeFactory; reintroduce; overload; + procedure GetList(const AStrings: TStrings); + property Items[Index: Integer]: TdxReportCellShapeClass read GetItem; default; + end; + + TCustomdxReportCellShape = class(TAbstractdxReportCellData) + private + FContentBkColor: TColor; + FContentPattern: TdxPSFillPatternClass; + FShapeBorderColor: TColor; + FShapeBorderThickness: Integer; + FShapeColor: TColor; + function GetShapeTransparent: Boolean; + procedure SetShapeBorderThickness(Value: Integer); + procedure SetShapeTransparent(Value: Boolean); + protected + function GetContentBkColor: TColor; override; + function GetContentPattern: TdxPSFillPatternClass; override; + procedure SetContentBkColor(Value: TColor); override; + procedure SetContentPattern(Value: TdxPSFillPatternClass); override; + + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + + function GetShapeCenter: TPoint; virtual; + function GetShapeHeight: Integer; virtual; + function GetShapeRect: TRect; virtual; + function GetShapeWidth: Integer; virtual; + public + constructor Create(AParent: TdxReportCell); override; + procedure Assign(Source: TPersistent); override; + + class function Name: string; virtual; + class procedure RegisterShape; virtual; + class procedure UnregisterShape; virtual; + + property ShapeBorderColor: TColor read FShapeBorderColor write FShapeBorderColor; + property ShapeBorderThickness: Integer read FShapeBorderThickness write SetShapeBorderThickness; + property ShapeCenter: TPoint read GetShapeCenter; + property ShapeColor: TColor read FShapeColor write FShapeColor; + property ShapeHeight: Integer read GetShapeHeight; + property ShapeRect: TRect read GetShapeRect; + property ShapeTransparent: Boolean read GetShapeTransparent write SetShapeTransparent; + property ShapeWidth: Integer read GetShapeWidth; + end; + + TCustomdxReportCellEllipseShape = class(TCustomdxReportCellShape) + private + function GetRadiusHorz: Integer; + function GetRadiusVert: Integer; + protected + property RadiusHorz: Integer read GetRadiusHorz; + property RadiusVert: Integer read GetRadiusVert; + public + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + end; + + TdxReportCellEllipse = class(TCustomdxReportCellEllipseShape) + public + class function Name: string; override; + property RadiusHorz; + property RadiusVert; + end; + + TdxReportCellCircle = class(TCustomdxReportCellEllipseShape) + private + function GetRadius: Integer; + protected + function GetShapeHeight: Integer; override; + function GetShapeWidth: Integer; override; + public + class function Name: string; override; + property Radius: Integer read GetRadius; + end; + + TCustomdxReportCellRectangle = class(TCustomdxReportCellShape) + protected + function GetShapeRect: TRect; override; + public + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + end; + + TdxReportCellRectangle = class(TCustomdxReportCellRectangle) + public + class function Name: string; override; + end; + + TdxReportCellSquare = class(TCustomdxReportCellRectangle) + protected + function GetShapeHeight: Integer; override; + function GetShapeWidth: Integer; override; + public + class function Name: string; override; + end; + + TdxReportCellRoundRect = class(TCustomdxReportCellRectangle) + private + FEllipseHeight: Integer; + FEllipseWidth: Integer; + procedure SetEllipseHeight(Value: Integer); + procedure SetEllipseWidth(Value: Integer); + protected + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); override; + public + constructor Create(AParent: TdxReportCell); override; + procedure Assign(Source: TPersistent); override; + + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + class function Name: string; override; + + property EllipseHeight: Integer read FEllipseHeight write SetEllipseHeight; + property EllipseWidth: Integer read FEllipseWidth write SetEllipseWidth; + end; + + TdxReportCellRoundSquare = class(TdxReportCellRoundRect) + protected + function GetShapeHeight: Integer; override; + function GetShapeWidth: Integer; override; + public + class function Name: string; override; + end; + +implementation + +uses + cxClasses, dxPSGlbl, dxPSRes, dxPSUtl; + +{ TdxPSShapeFactory } + +function dxPSShapeFactory: TdxPSShapeFactory; +begin + Result := TdxPSShapeFactory.Instance; +end; + +class function TdxPSShapeFactory.Instance: TdxPSShapeFactory; +begin + Result := inherited Instance as TdxPSShapeFactory; +end; + +procedure TdxPSShapeFactory.GetList(const AStrings: TStrings); +var + I: Integer; + Shape: TdxReportCellShapeClass; +begin + AStrings.BeginUpdate; + try + for I := 0 to Count - 1 do + begin + Shape := Items[I]; + AStrings.AddObject(Shape.Name, TObject(Shape)); + end; + finally + AStrings.EndUpdate; + end; +end; + +function TdxPSShapeFactory.GetItem(Index: Integer): TdxReportCellShapeClass; +begin + Result := TdxReportCellShapeClass(inherited Items[Index]); +end; + +{ TCustomdxReportCellShape } + +constructor TCustomdxReportCellShape.Create(AParent: TdxReportCell); +begin + inherited; + FShapeBorderColor := clBlack; + FShapeBorderThickness := 1; +end; + +procedure TCustomdxReportCellShape.Assign(Source: TPersistent); +begin + inherited; + if Source is TCustomdxReportCellShape then + with TCustomdxReportCellShape(Source) do + begin + Self.ShapeBorderColor := ShapeBorderColor; + Self.ShapeBorderThickness := ShapeBorderThickness; + Self.ShapeColor := ShapeColor; + end; +end; + +class function TCustomdxReportCellShape.Name: string; +begin + Result := ''; +end; + +class procedure TCustomdxReportCellShape.RegisterShape; +begin + dxPSShapeFactory.Register(Self); +end; + +class procedure TCustomdxReportCellShape.UnregisterShape; +begin + dxPSShapeFactory.Unregister(Self); +end; + +function TCustomdxReportCellShape.GetContentBkColor: TColor; +begin + Result := FContentBkColor; +end; + +function TCustomdxReportCellShape.GetContentPattern: TdxPSFillPatternClass; +begin + Result := FContentPattern; +end; + +procedure TCustomdxReportCellShape.SetContentBkColor(Value: TColor); +begin + FContentBkColor := Value; +end; + +procedure TCustomdxReportCellShape.SetContentPattern(Value: TdxPSFillPatternClass); +begin + FContentPattern := Value; +end; + +procedure TCustomdxReportCellShape.ReadData(AReader: TdxPSDataReader); +begin + inherited; + ShapeBorderColor := AReader.ReadInteger; + ShapeBorderThickness := AReader.ReadInteger; + ShapeColor := AReader.ReadInteger; +end; + +procedure TCustomdxReportCellShape.WriteData(AWriter: TdxPSDataWriter); +begin + inherited; + AWriter.WriteInteger(ShapeBorderColor); + AWriter.WriteInteger(ShapeBorderThickness); + AWriter.WriteInteger(ShapeColor); +end; + +function TCustomdxReportCellShape.GetShapeCenter: TPoint; +begin + Result.X := Left + Width div 2; + Result.Y := Top + Height div 2; +end; + +function TCustomdxReportCellShape.GetShapeHeight: Integer; +begin + Result := Height; +end; + +function TCustomdxReportCellShape.GetShapeRect: TRect; +var + SW, SH: Integer; +begin + SH := ShapeHeight; + SW := ShapeWidth; + with ShapeCenter do + Result := MakeBounds(X - SW div 2, Y - SH div 2, SW, SH); +end; + +function TCustomdxReportCellShape.GetShapeWidth: Integer; +begin + Result := Width; +end; + +function TCustomdxReportCellShape.GetShapeTransparent: Boolean; +begin + Result := GetFormatBit(dxFormatShapeTransparent); +end; + +procedure TCustomdxReportCellShape.SetShapeBorderThickness(Value: Integer); +begin + if Value < 0 then Value := 0; + FShapeBorderThickness := Value; +end; + +procedure TCustomdxReportCellShape.SetShapeTransparent(Value: Boolean); +begin + SetFormatBit(dxFormatShapeTransparent, Value); +end; + +{ TCustomdxReportCellEllipseShape } + +procedure TCustomdxReportCellEllipseShape.DrawContent(DC: HDC; AStage: TdxPSRenderStages); +begin + Renderer.DrawEllipse(DC, ShapeRect, ShapeColor, ContentBkColor, ContentPattern, + ShapeBorderColor, ShapeBorderThickness); +end; + +function TCustomdxReportCellEllipseShape.GetRadiusHorz: Integer; +begin + Result := ShapeWidth div 2; +end; + +function TCustomdxReportCellEllipseShape.GetRadiusVert: Integer; +begin + Result := ShapeHeight div 2; +end; + +{ TdxReportCellEllipse } + +class function TdxReportCellEllipse.Name: string; +begin + Result := cxGetResourcestring(@sdxEllipse); +end; + +{ TdxReportCellCircle } + +class function TdxReportCellCircle.Name: string; +begin + Result := cxGetResourcestring(@sdxCircle); +end; + +function TdxReportCellCircle.GetShapeHeight: Integer; +begin + if Width > Height then + Result := inherited GetShapeHeight + else + Result := ShapeWidth; +end; + +function TdxReportCellCircle.GetShapeWidth: Integer; +begin + if Width > Height then + Result := ShapeHeight + else + Result := inherited GetShapeWidth; +end; + +function TdxReportCellCircle.GetRadius: Integer; +begin + Result := RadiusHorz; +end; + +{ TCustomdxReportCellRectangle } + +procedure TCustomdxReportCellRectangle.DrawContent(DC: HDC; AStage: TdxPSRenderStages); +begin + Renderer.DrawRectangle(DC, ShapeRect, ShapeColor, ContentBkColor, ContentPattern, + ShapeBorderColor, ShapeBorderThickness); +end; + +function TCustomdxReportCellRectangle.GetShapeRect: TRect; +var + SH, SW: Integer; +begin + SH := ShapeHeight; + SW := ShapeWidth; + with ShapeCenter do + Result := MakeBounds(X - SW div 2, Y - SH div 2, SW, SH); +end; + +{ TdxReportCellRectangle } + +class function TdxReportCellRectangle.Name: string; +begin + Result := cxGetResourcestring(@sdxRectangle); +end; + +{ TdxReportCellSquare } + +class function TdxReportCellSquare.Name: string; +begin + Result := cxGetResourcestring(@sdxSquare); +end; + +function TdxReportCellSquare.GetShapeHeight: Integer; +begin + if Width > Height then + Result := inherited GetShapeHeight + else + Result := ShapeWidth; +end; + +function TdxReportCellSquare.GetShapeWidth: Integer; +begin + if Width > Height then + Result := ShapeHeight + else + Result := inherited GetShapeWidth; +end; + +{ TdxReportCellRoundRect } + +constructor TdxReportCellRoundRect.Create(AParent: TdxReportCell); +begin + inherited; + FEllipseHeight := 2; + FEllipseWidth := 2; +end; + +procedure TdxReportCellRoundRect.Assign(Source: TPersistent); +begin + inherited; + if Source is TdxReportCellRoundRect then + with TdxReportCellRoundRect(Source) do + begin + Self.EllipseHeight := EllipseHeight; + Self.EllipseWidth := EllipseWidth; + end; +end; + +procedure TdxReportCellRoundRect.DrawContent(DC: HDC; AStage: TdxPSRenderStages); +begin + Renderer.DrawRoundRect(DC, ShapeRect, EllipseWidth, EllipseHeight, ShapeColor, + ContentBkColor, ContentPattern, ShapeBorderColor, ShapeBorderThickness); +end; + +class function TdxReportCellRoundRect.Name: string; +begin + Result := cxGetResourcestring(@sdxRoundRect); +end; + +procedure TdxReportCellRoundRect.ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); +begin + inherited; + FEllipseHeight := MulDiv(FEllipseHeight, APixelsNumerator, APixelsDenominator); + FEllipseWidth := MulDiv(FEllipseWidth, APixelsNumerator, APixelsDenominator); +end; + +procedure TdxReportCellRoundRect.SetEllipseHeight(Value: Integer); +begin + if Value < 0 then Value := 0; + FEllipseHeight := Value; +end; + +procedure TdxReportCellRoundRect.SetEllipseWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + FEllipseWidth := Value; +end; + +{ TdxReportCellRoundSquare } + +class function TdxReportCellRoundSquare.Name: string; +begin + Result := cxGetResourcestring(@sdxRoundSquare); +end; + +function TdxReportCellRoundSquare.GetShapeHeight: Integer; +begin + if Width > Height then + Result := inherited GetShapeHeight + else + Result := ShapeWidth; +end; + +function TdxReportCellRoundSquare.GetShapeWidth: Integer; +begin + if Width > Height then + Result := ShapeHeight + else + Result := inherited GetShapeWidth; +end; + +procedure RegisterItems; +begin + TdxReportCellEllipse.Register; + TdxReportCellCircle.Register; + TdxReportCellRectangle.Register; + TdxReportCellSquare.Register; + TdxReportCellRoundRect.Register; + TdxReportCellRoundSquare.Register; +end; + +procedure RegisterShapes; +begin + TdxReportCellEllipse.RegisterShape; + TdxReportCellCircle.RegisterShape; + TdxReportCellRectangle.RegisterShape; + TdxReportCellSquare.RegisterShape; + TdxReportCellRoundRect.RegisterShape; + TdxReportCellRoundSquare.RegisterShape; +end; + +procedure UnregisterItems; +begin + TdxReportCellRoundSquare.Unregister; + TdxReportCellRoundRect.Unregister; + TdxReportCellSquare.Unregister; + TdxReportCellRectangle.Unregister; + TdxReportCellCircle.Unregister; + TdxReportCellEllipse.Unregister; +end; + +initialization + RegisterItems; + RegisterShapes; + +finalization + UnregisterItems; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSSngltn.pas b/official/x.35/ExpressPrinting System/Sources/dxPSSngltn.pas new file mode 100644 index 00000000..3eb89635 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSSngltn.pas @@ -0,0 +1,289 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSSngltn; + +interface + +{$I cxVer.inc} + +uses + Windows, SysUtils; + +type + EdxPSSingleton = class(Exception); + + TBasedxPSSingletonClass = class of TBasedxPSSingleton; + + TBasedxPSSingleton = class + private + class function GetInstance(AccessCode: Integer): TBasedxPSSingleton; virtual; + class function IndexOf: Integer; + procedure Register; virtual; + procedure Unregister; virtual; + protected + constructor CreateInstance(Dummy: Integer); + procedure FinalizeInstance; virtual; + procedure InitializeInstance; virtual; + public + constructor Create; virtual; + destructor Destroy; override; + class function Instance: TBasedxPSSingleton; overload; virtual; + class procedure ReleaseInstance; virtual; + end; + +implementation + +uses + Classes; + +const + SingletonAccess = 0; + SingletonCreate = 1; + SingletonRelease = 2; + +const + rsdxSingletonAccessOnlyThroughInstance = 'Access class %s through Instance only'; + rsdxSingletonIllegalAccessCode = 'Illegal AccessCode %d in GetInstance'; + +type + TdxPSSingletonFactory = class (TBasedxPSSingleton) + private + FItems: TList; + function GetCount: Integer; + function GetItem(Index: Integer): TBasedxPSSingleton; + function GetItemClass(Index: Integer): TBasedxPSSingletonClass; + + class function GetInstance(AccessCode: Integer): TBasedxPSSingleton; override; + procedure Register; override; + procedure Unregister; override; + protected + procedure FinalizeInstance; override; + procedure RegisterSingleton(ASingleton: TBasedxPSSingleton); + procedure UnregisterSingleton(ASingleton: TBasedxPSSingleton); + public + function IndexOf(ASingletonClass: TBasedxPSSingletonClass): Integer; + class function Instance: TdxPSSingletonFactory; reintroduce; overload; + property Count: Integer read GetCount; + property ItemClasses[Index: Integer]: TBasedxPSSingletonClass read GetItemClass; + property Items[Index: Integer]: TBasedxPSSingleton read GetItem; default; + end; + +function SingletonFactory: TdxPSSingletonFactory; +begin + Result := TdxPSSingletonFactory.Instance; +end; + +function HasSingletonFactory: Boolean; +begin + Result := TdxPSSingletonFactory.GetInstance(SingletonAccess) <> nil; +end; + +procedure SingletonError(const message: string); +begin + raise EdxPSSingleton.Create(message); +end; + +{ TdxPSSingletonFactory } + +function TdxPSSingletonFactory.IndexOf(ASingletonClass: TBasedxPSSingletonClass): Integer; +begin + for Result := 0 to Count - 1 do + if ItemClasses[Result] = ASingletonClass then Exit; + Result := -1; +end; + +class function TdxPSSingletonFactory.Instance: TdxPSSingletonFactory; +begin + Result := inherited Instance as TdxPSSingletonFactory; +end; + +procedure TdxPSSingletonFactory.FinalizeInstance; +begin + while Count <> 0 do Items[Count - 1].ReleaseInstance; + inherited FinalizeInstance; +end; + +procedure TdxPSSingletonFactory.RegisterSingleton(ASingleton: TBasedxPSSingleton); +begin + if FItems = nil then FItems := TList.Create; + FItems.Add(ASingleton); +end; + +procedure TdxPSSingletonFactory.UnregisterSingleton(ASingleton: TBasedxPSSingleton); +begin + FItems.Remove(ASingleton); + if Count = 0 then + begin + FItems.Free; + FItems := nil; + end; +end; + +function TdxPSSingletonFactory.GetCount: Integer; +begin + if FItems <> nil then + Result := FItems.Count + else + Result := 0; +end; + +class function TdxPSSingletonFactory.GetInstance(AccessCode: Integer): TBasedxPSSingleton; +const + FInstance: TdxPSSingletonFactory = nil; +begin + case AccessCode of + SingletonAccess: + ; + SingletonCreate: + if FInstance = nil then FInstance := CreateInstance(0); + SingletonRelease: + FInstance := nil; + else + SingletonError(Format(rsdxSingletonIllegalAccessCode, [AccessCode])); + end; + Result := FInstance; +end; + +function TdxPSSingletonFactory.GetItem(Index: Integer): TBasedxPSSingleton; +begin + Result := TBasedxPSSingleton(FItems[Index]); +end; + +function TdxPSSingletonFactory.GetItemClass(Index: Integer): TBasedxPSSingletonClass; +begin + Result := TBasedxPSSingletonClass(Items[Index].ClassType); +end; + +procedure TdxPSSingletonFactory.Register; +begin +end; + +procedure TdxPSSingletonFactory.Unregister; +begin + if GetInstance(SingletonAccess) = Self then GetInstance(SingletonRelease); +end; + +{ TBasedxPSSingleton } + +constructor TBasedxPSSingleton.Create; +begin + inherited Create; + SingletonError(Format(rsdxSingletonAccessOnlyThroughInstance, [ClassName])); +end; + +destructor TBasedxPSSingleton.Destroy; +begin + FinalizeInstance; + Unregister; + inherited; +end; + +class function TBasedxPSSingleton.Instance: TBasedxPSSingleton; +begin + Result := GetInstance(SingletonCreate); +end; + +class procedure TBasedxPSSingleton.ReleaseInstance; +begin + GetInstance(SingletonAccess).Free; +end; + +constructor TBasedxPSSingleton.CreateInstance(Dummy: Integer); +begin + inherited Create; + Register; + InitializeInstance; +end; + +procedure TBasedxPSSingleton.FinalizeInstance; +begin +end; + +procedure TBasedxPSSingleton.InitializeInstance; +begin +end; + +class function TBasedxPSSingleton.GetInstance(AccessCode: Integer): TBasedxPSSingleton; +var + Index: Integer; +begin + case AccessCode of + SingletonAccess: + ; + SingletonCreate: + if IndexOf = -1 then CreateInstance(0); + else + SingletonError(Format(rsdxSingletonIllegalAccessCode, [AccessCode])); + end; + + {Note: + Just imagine: we have some descendant of TBasedxPSSingleton that had been initialized + and finalized inside another package. This Singleton MUST be finalized manually. + One trick: If this Singleton had never ever been initialized before + (i.e. GetInstance(SingletonCreate) had never been called) and others Singletons + dont exist then SingletonFactory had never been initialized in one's part. + This means we MUST return nil here silently } + + Result := nil; + if HasSingletonFactory then + begin + Index := IndexOf; + if Index <> -1 then + Result := SingletonFactory[Index]; + end; +end; + +class function TBasedxPSSingleton.IndexOf: Integer; +begin + Result := SingletonFactory.IndexOf(Self); +end; + +procedure TBasedxPSSingleton.Register; +begin + SingletonFactory.RegisterSingleton(Self); +end; + +procedure TBasedxPSSingleton.Unregister; +begin + SingletonFactory.UnregisterSingleton(Self); +end; + +initialization + +finalization + TdxPSSingletonFactory.ReleaseInstance; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSStandardFillPatterns.pas b/official/x.35/ExpressPrinting System/Sources/dxPSStandardFillPatterns.pas new file mode 100644 index 00000000..10b36d2a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSStandardFillPatterns.pas @@ -0,0 +1,184 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSStandardFillPatterns; + +interface + +{$I cxVer.inc} + +uses + dxPSFillPatterns; + +type + TdxPSHorizontalFillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSVerticalFillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSFDiagonalFillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSBDiagonalFillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSCrossFillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + + TdxPSDiagCrossFillPattern = class(TdxPSFillPattern) + public + class procedure Bits(var APattern: TdxPSPatternBitRows); override; + class function Name: string; override; + end; + +implementation + +uses + cxClasses, dxPSRes; + +{ TdxPSHorizontalFillPattern } + +class procedure TdxPSHorizontalFillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($FFFF, $0000, $FFFF, $FFFF, $FFFF, $FFFF, $FFFF, $FFFF); +begin + APattern := Bits; +end; + +class function TdxPSHorizontalFillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxHorizontalFillPattern); +end; + +{ TdxPSVerticalFillPattern } + +class procedure TdxPSVerticalFillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($FFBF, $FFBF, $FFBF, $FFBF, $FFBF, $FFBF, $FFBF, $FFBF); +begin + APattern := Bits; +end; + +class function TdxPSVerticalFillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxVerticalFillPattern); +end; + +{ TdxPSFDiagonalFillPattern } + +class procedure TdxPSFDiagonalFillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($FFFE, $FFFD, $FFFB, $FFF7, $FFEF, $FFDF, $FFBF, $FF7F); +begin + APattern := Bits; +end; + +class function TdxPSFDiagonalFillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxFDiagonalFillPattern); +end; + +{ TdxPSBDiagonalFillPattern } + +class procedure TdxPSBDiagonalFillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($FF7F, $FFBF, $FFDF, $FFEF, $FFF7, $FFFB, $FFFD, $FFFE); +begin + APattern := Bits; +end; + +class function TdxPSBDiagonalFillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxBDiagonalFillPattern); +end; + +{ TdxPSCrossFillPattern } + +class procedure TdxPSCrossFillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($FFBF, $0000, $FFBF, $FFBF, $FFBF, $FFBF, $FFBF, $FFBF); +begin + APattern := Bits; +end; + +class function TdxPSCrossFillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxCrossFillPattern); +end; + +{ TdxPSDiagCrossFillPattern } + +class procedure TdxPSDiagCrossFillPattern.Bits(var APattern: TdxPSPatternBitRows); +const + Bits: TdxPSPatternBitRows = ($FF7E, $FFBD, $FFDB, $FFE7, $FFE7, $FFDB, $FFBD, $FF7E); +begin + APattern := Bits; +end; + +class function TdxPSDiagCrossFillPattern.Name: string; +begin + Result := cxGetResourceString(@sdxDiagCrossFillPattern); +end; + +procedure RegisterPatterns; +begin + TdxPSHorizontalFillPattern.Register; + TdxPSVerticalFillPattern.Register; + TdxPSFDiagonalFillPattern.Register; + TdxPSBDiagonalFillPattern.Register; + TdxPSCrossFillPattern.Register; + TdxPSDiagCrossFillPattern.Register; +end; + +initialization + RegisterPatterns; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSStdGrLnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSStdGrLnk.dfm new file mode 100644 index 00000000..941f8bbf --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSStdGrLnk.dfm @@ -0,0 +1,676 @@ +object dxGridReportLinkDesignWindow: TdxGridReportLinkDesignWindow + Left = 346 + Top = 298 + BorderStyle = bsDialog + Caption = 'dxGridReportLinkDesigner' + ClientHeight = 314 + ClientWidth = 579 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 6 + Width = 571 + Height = 273 + ActivePage = tshColor + MultiLine = True + TabOrder = 0 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = '&Options' + object pnlOptions: TPanel + Left = 0 + Top = 0 + Width = 563 + Height = 245 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblShow: TLabel + Left = 5 + Top = 13 + Width = 26 + Height = 13 + Caption = 'Show' + end + object Bevel11: TBevel + Left = 40 + Top = 18 + Width = 210 + Height = 4 + Shape = bsBottomLine + end + object imgGrid: TImage + Left = 6 + Top = 32 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblOnEveryPage: TLabel + Left = 8 + Top = 151 + Width = 72 + Height = 13 + Caption = 'On Every Page' + end + object Image1: TImage + Left = 10 + Top = 172 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888777777777777777708888888888 + 888887FFFFFFFFFFFFFFF08888888888888887F7777777777777F07777708888 + 888887F7777777777777F0FFFFF08888888887F7777777777777F07777F07777 + 708887FFFFFFFFFFFFFFF07777F0FFFFF08887F777777777777FF07777F07777 + F08887FFFFFFFFFFFFFFF0FFFFF07777F08887F77777777777FFF077FFF07777 + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777777FFFFF0777FF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777FFFFFFFF07FFFF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF0777FF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF077FFF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777777F077FFF077FF + F08887F7777777777777F0FFFFF0FFFFF08887F7777777777777F0FFFFF07FFF + F08887FFFFFFFFFFFFFFF07777F0FFFFF0888000000000000000007777F077FF + F08888888887F7777777777777F0FFFFF08888888887FFFFFFFFFFFFFFF07777 + F0888888888000000000000000007777F08888888888888887F7777777777777 + F08888888888888887FFFFFFFFFFFFFFF0888888888888888000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object Bevel10: TBevel + Left = 88 + Top = 156 + Width = 162 + Height = 4 + Shape = bsBottomLine + end + object chbxShowVertLines: TCheckBox + Tag = 2 + Left = 90 + Top = 75 + Width = 161 + Height = 17 + Caption = 'Vertical Lines' + TabOrder = 2 + OnClick = chbxShowBordersClick + end + object chbxShowFixedHorzLines: TCheckBox + Tag = 3 + Left = 90 + Top = 98 + Width = 161 + Height = 17 + Caption = 'Fixed &Horizontal Lines' + TabOrder = 3 + OnClick = chbxShowBordersClick + end + object chbxShowFixedVertLines: TCheckBox + Tag = 4 + Left = 90 + Top = 121 + Width = 161 + Height = 17 + Caption = 'Fixed &Vertical Lines' + TabOrder = 4 + OnClick = chbxShowBordersClick + end + object chbxShowBorders: TCheckBox + Left = 90 + Top = 30 + Width = 161 + Height = 17 + Caption = 'Border' + TabOrder = 0 + OnClick = chbxShowBordersClick + end + object chbxShowHorzLines: TCheckBox + Tag = 1 + Left = 90 + Top = 52 + Width = 161 + Height = 17 + Caption = 'Horizontal Lines' + TabOrder = 1 + OnClick = chbxShowBordersClick + end + object chbxFixedRowsOnEveryPage: TCheckBox + Left = 91 + Top = 173 + Width = 161 + Height = 17 + Caption = 'Fi&xed Rows' + TabOrder = 5 + OnClick = chbxFixedRowsOnEveryPageClick + end + object lblPreview: TStaticText + Left = 264 + Top = 2 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 6 + end + end + end + object tshColor: TTabSheet + Caption = '&Color' + object pnlColor: TPanel + Left = 0 + Top = 0 + Width = 563 + Height = 245 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblGridLinesColor: TLabel + Left = 6 + Top = 218 + Width = 79 + Height = 13 + Caption = '&Grid lines color : ' + OnClick = lblColorClick + end + object bvlLineColorHolder: TBevel + Left = 91 + Top = 214 + Width = 146 + Height = 21 + Visible = False + end + object lblDrawMode: TLabel + Left = 5 + Top = 21 + Width = 58 + Height = 13 + Caption = 'Draw &Mode:' + FocusControl = cbxDrawMode + OnClick = lblColorClick + end + object gbxFixedTransparent: TGroupBox + Left = 5 + Top = 144 + Width = 243 + Height = 58 + Caption = ' ' + TabOrder = 4 + object lblFixedColor: TLabel + Left = 6 + Top = 24 + Width = 62 + Height = 13 + Caption = 'F&ixed color : ' + OnClick = lblColorClick + end + object bvlFixedColorHolder: TBevel + Left = 86 + Top = 22 + Width = 146 + Height = 21 + Visible = False + end + end + object gbxTransparent: TGroupBox + Left = 5 + Top = 52 + Width = 243 + Height = 84 + Caption = ' ' + TabOrder = 2 + object lblColor: TLabel + Left = 6 + Top = 24 + Width = 35 + Height = 13 + Caption = 'Co&lor : ' + OnClick = lblColorClick + end + object bvlColorHolder: TBevel + Left = 86 + Top = 20 + Width = 146 + Height = 21 + Visible = False + end + object lblEvenColor: TLabel + Left = 6 + Top = 51 + Width = 59 + Height = 13 + Caption = 'E&ven Color: ' + OnClick = lblColorClick + end + object bvlEvenColorHolder: TBevel + Left = 86 + Top = 47 + Width = 146 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 18 + Top = 50 + Width = 15 + Height = 17 + Caption = 'T&ransparent' + TabOrder = 1 + OnClick = chbxTransparentClick + end + object chbxFixedTransparent: TCheckBox + Tag = 1 + Left = 18 + Top = 142 + Width = 15 + Height = 17 + Caption = 'Fixed T&ransparent' + TabOrder = 3 + OnClick = chbxTransparentClick + end + object cbxDrawMode: TComboBox + Left = 69 + Top = 16 + Width = 179 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 0 + OnClick = cbxDrawModeClick + OnDrawItem = cbxDrawModeDrawItem + Items.Strings = ( + 'Simpe' + 'Odd\Even Rows Mode' + 'Chess' + 'Borrow From Source') + end + object stTransparent: TStaticText + Left = 33 + Top = 51 + Width = 76 + Height = 17 + Caption = ' &Transparent ' + FocusControl = chbxTransparent + TabOrder = 5 + OnClick = stTransparentClick + end + object stFixedTransparent: TStaticText + Left = 33 + Top = 143 + Width = 105 + Height = 17 + Caption = ' Fixed T&ransparent ' + FocusControl = chbxFixedTransparent + TabOrder = 6 + OnClick = stFixedTransparentClick + end + end + end + object tshFont: TTabSheet + Caption = '&Font' + object pnlFont: TPanel + Left = 0 + Top = 0 + Width = 563 + Height = 245 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object btnFont: TButton + Left = 8 + Top = 9 + Width = 110 + Height = 23 + Caption = 'Fo&nt ...' + TabOrder = 0 + OnClick = btnFontClick + end + object edFont: TEdit + Left = 8 + Top = 38 + Width = 239 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + end + object btnFixedFont: TButton + Tag = 2 + Left = 8 + Top = 133 + Width = 110 + Height = 23 + Caption = 'Fi&xed Font ...' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 4 + OnClick = btnFontClick + end + object edFixedFont: TEdit + Left = 8 + Top = 162 + Width = 239 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 5 + end + object btnEvenFont: TButton + Tag = 1 + Left = 7 + Top = 71 + Width = 110 + Height = 23 + Caption = 'E&ven Font ...' + TabOrder = 2 + OnClick = btnFontClick + end + object edEvenFont: TEdit + Left = 8 + Top = 100 + Width = 239 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 3 + end + end + end + object tshBehaviors: TTabSheet + Caption = '&Behaviors' + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 563 + Height = 245 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Image3: TImage + Left = 7 + Top = 34 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblSelection: TLabel + Left = 5 + Top = 13 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object Bevel3: TBevel + Left = 55 + Top = 18 + Width = 195 + Height = 4 + Shape = bsBottomLine + end + object lblLookAndFeel: TLabel + Left = 5 + Top = 85 + Width = 67 + Height = 13 + Caption = 'Look And Feel' + end + object Bevel15: TBevel + Left = 84 + Top = 89 + Width = 166 + Height = 4 + Shape = bsBottomLine + end + object Image8: TImage + Left = 7 + Top = 106 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D08777777777780877777788807DCCCCDCCDDD0877777777778787777788 + 8F07D08888888888880888888888807DCCCCCCCCDD0888888888888788888888 + 8F07D00000000000000000000000007DCCCCDCCDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F7777777FF07DDDDDDDDDDD0F777777777FF7F7777777 + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F777777FFF07DDDDDDDDDDD0F777777FFFFF7F777777F + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F7777777777F7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F77777FFFF07DDDDDDDDDDD0F77777777FFF7F77777FF + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D00000000000000000000000007DCDDDDCDDDD0000000000000000000000 + 0007D08888888888880888888888807DCCCCDCCDDD0777777777777777777777 + 7707D08888888888880888888888807DCCCCCCCCDD0F88888888888788888888 + 8707D08000000008880880000000807DCCCCDCCDDD0F00000000888788000000 + 8707D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + F707D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object bvlMiscellaneous: TBevel + Left = 81 + Top = 160 + Width = 169 + Height = 3 + Shape = bsBottomLine + end + object lblMiscellaneous: TLabel + Left = 5 + Top = 154 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + end + object imgMiscellaneous: TImage + Left = 7 + Top = 177 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000008088F07DDDDDDDDDDDD0800000000000000000000 + 807DD0F0FFFF8FFFF8FFFF0FFF0F07DDDDDDDDDDDD0F0F77FFF8F777F8F777F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCDDDDCDDDD0F0F00FFF8F00FF8F00FF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCCCCCDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCDDDDCDDDD0F0FFFFFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCCCCDCCDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCCCCCDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCDCCDDD0F0FFFFFF8F0FFF8F0FFF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0777777777777770FFF0F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F0F8887F8887F8880FFF8F07DDDDDDDDDDDD0F0F888887F88887F88880 + F07DD0F0F0087F0087F0080FFF0F07DDDDDDDDDDDD0F0F800087F80087F80080 + F07DD0F0FFFF7FFFF7FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF7FFFFF7FFFFF0 + F07DD0800000000000000008080807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxIncludeFixed: TCheckBox + Left = 90 + Top = 52 + Width = 161 + Height = 17 + Caption = '&Including fixed cells' + TabOrder = 1 + OnClick = chbxIncludeFixedClick + end + object chbxOnlySelected: TCheckBox + Left = 90 + Top = 30 + Width = 161 + Height = 17 + Caption = 'Only &selected cells' + TabOrder = 0 + OnClick = chbxOnlySelectedClick + end + object chbxUse3DEffects: TCheckBox + Tag = 12 + Left = 91 + Top = 100 + Width = 161 + Height = 17 + Caption = '&Use 3D Effects' + TabOrder = 2 + OnClick = chbxUse3DEffectsClick + end + object chbxUseSoft3D: TCheckBox + Tag = 13 + Left = 91 + Top = 122 + Width = 161 + Height = 17 + Caption = 'Soft &3D' + TabOrder = 3 + OnClick = chbxUseSoft3DClick + end + object chbxRowAutoHeight: TCheckBox + Left = 90 + Top = 200 + Width = 161 + Height = 17 + Caption = '&Row Auto Height' + TabOrder = 5 + OnClick = chbxRowAutoHeightClick + end + object chbxAutoWidth: TCheckBox + Left = 90 + Top = 178 + Width = 161 + Height = 17 + Caption = 'AutoWidth' + TabOrder = 4 + OnClick = chbxAutoWidthClick + end + end + end + end + object pnlPreview: TPanel + Left = 272 + Top = 50 + Width = 294 + Height = 215 + BevelInner = bvLowered + BevelOuter = bvNone + Color = clWindow + TabOrder = 1 + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSStdGrLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSStdGrLnk.pas new file mode 100644 index 00000000..db875970 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSStdGrLnk.pas @@ -0,0 +1,1014 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSStdGrLnk; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + Grids, StdCtrls, ExtCtrls, ComCtrls, CheckLst, dxPSRes, dxPSCore, dxPSGrLnks, + dxPSGlbl, dxPSBaseGridLnk; + +type + TStddxGridReportLink = class(TCustomdxGridReportLink) + private + FSaveFont: TFont; + FCustomDrawFontChanged: Boolean; + procedure CustomDrawFontChanged(Sender: TObject); + protected + class function IsDrawGridLink: Boolean; virtual; + class function IsStringGridLink: Boolean; virtual; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + end; + + TdxCustomDrawTextCellEvent = procedure(Sender: TBasedxReportLink; + ACol, ARow: Integer; ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; + var AText: string; AFont: TFont; var AColor: TColor; + var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean) of object; + + TdxStringGridReportLink = class(TStddxGridReportLink) + private + FTextAlignX: TdxTextAlignX; + FTextAlignY: TdxTextAlignY; + FOnCustomDrawCell: TdxCustomDrawTextCellEvent; + function GetStringGrid: TStringGrid; + procedure SetTextAlignX(Value: TdxTextAlignX); + procedure SetTextAlignY(Value: TdxTextAlignY); + protected + procedure InternalRestoreDefaults; override; + class function IsStringGridLink: Boolean; override; + + function GetCellText(ACol, ARow: Integer): string; override; + function GetCellTextAlignX(ACol, ARow: Integer): TdxTextAlignX; override; + function GetCellTextAlignY(ACol, ARow: Integer): TdxTextAlignY; override; + procedure SetDrawMode(Value: TdxGridDrawMode); override; + + procedure CustomDraw(AItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); override; + procedure DoCustomDrawCell(ACol, ARow: Integer; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var AText: string; AFont: TFont; + var AColor: TColor; var ATextAlignX: TdxTextAlignX; + var ATextAlignY: TdxTextAlignY; var ADone: Boolean); virtual; + function IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; override; + public + procedure Assign(Source: TPersistent); override; + property StringGrid: TStringGrid read GetStringGrid; + published + property AutoWidth; + property Color; + property DrawMode; + property Effects3D; + property EndEllipsis; + property EvenColor; + property EvenFont; + property FixedColor; + property FixedFont; + property FixedTransparent; + property Font; + property GridLineColor; + property HeadersOnEveryPage; + property IncludeFixed; + property Multiline; + property OddColor; + property OddFont; + property OnlySelected; + property Options; + property RowAutoHeight; + property ScaleFonts; + property Soft3D; + property SupportedCustomDraw; + property TextAlignX: TdxTextAlignX read FTextAlignX write SetTextAlignX default taLeft; + property TextAlignY: TdxTextAlignY read FTextAlignY write SetTextAlignY default taCenterY; + property Transparent; + property UseCustomPageBreaks; + property UseHorzDelimiters; + property UseVertDelimiters; + + property OnCustomDrawCell: TdxCustomDrawTextCellEvent read FOnCustomDrawCell write FOnCustomDrawCell; + property OnGetCustomPageBreaks; + property OnInitializeItem; + end; + + TdxCustomDrawCellEvent = procedure(Sender: TBasedxReportLink; + ACol, ARow: Integer; ACanvas: TCanvas; ABoundsRect, AClientRect: TRect) of object; + + TdxCustomDrawCellExEvent = procedure(Sender: TBasedxReportLink; + ACol, ARow: Integer; ACanvas: TCanvas; AFont: TFont; ABoundsRect, AClientRect: TRect; + var ADone: Boolean) of object; + + TdxDrawGridReportLink = class(TStddxGridReportLink) + private + FDefaultDrawing: Boolean; + FOnCustomDrawCell: TdxCustomDrawCellEvent; + FOnCustomDrawCellEx: TdxCustomDrawCellExEvent; + function GetDrawGrid: TDrawGrid; + procedure SetDefaultDrawing(Value: Boolean); + protected + procedure InternalRestoreDefaults; override; + procedure InternalRestoreFromOriginal; override; + + function GetCellText(ACol, ARow: Integer): string; override; + function GetDataItemClass(ACol: Integer; ARow: Integer = 0): TdxReportCellDataClass; override; + procedure SetDrawMode(Value: TdxGridDrawMode); override; + + procedure CustomDraw(AItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); override; + procedure DoCustomDrawCell(ACol, ARow: Integer; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect); virtual; + procedure DoCustomDrawCellEx(ACol, ARow: Integer; ACanvas: TCanvas; + AFont: TFont; ABoundsRect, AClientRect: TRect); virtual; + class function IsDrawGridLink: Boolean; override; + function IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; override; + public + procedure Assign(Source: TPersistent); override; + class function Serializable: Boolean; override; + + property DrawGrid: TDrawGrid read GetDrawGrid; + published + property AutoWidth; + property Color; + property DefaultDrawing: Boolean read FDefaultDrawing write SetDefaultDrawing default True; + property DrawMode; + property Effects3D; + property EvenColor; + property EvenFont; + property FixedColor; + property FixedFont; + property FixedTransparent; + property Font; + property GridLineColor; + property HeadersOnEveryPage; + property IncludeFixed; + property OddColor; + property OnlySelected; + property Options; + property ScaleFonts; + property Soft3D; + property SupportedCustomDraw default True; + property Transparent; + property UseCustomPageBreaks; + property UseHorzDelimiters; + property UseVertDelimiters; + + property OnCustomDrawCell: TdxCustomDrawCellEvent read FOnCustomDrawCell write FOnCustomDrawCell; + property OnCustomDrawCellEx: TdxCustomDrawCellExEvent read FOnCustomDrawCellEx write FOnCustomDrawCellEx; + property OnGetCustomPageBreaks; + property OnInitializeItem; + end; + + TdxGridReportLinkDesignWindow = class(TStandarddxReportLinkDesignWindow) + PageControl1: TPageControl; + tshOptions: TTabSheet; + tshColor: TTabSheet; + tshFont: TTabSheet; + pnlOptions: TPanel; + pnlColor: TPanel; + pnlFont: TPanel; + lblGridLinesColor: TLabel; + btnFont: TButton; + edFont: TEdit; + btnFixedFont: TButton; + edFixedFont: TEdit; + chbxTransparent: TCheckBox; + gbxTransparent: TGroupBox; + lblColor: TLabel; + chbxFixedTransparent: TCheckBox; + gbxFixedTransparent: TGroupBox; + lblFixedColor: TLabel; + bvlFixedColorHolder: TBevel; + bvlLineColorHolder: TBevel; + bvlColorHolder: TBevel; + pnlPreview: TPanel; + lblEvenColor: TLabel; + bvlEvenColorHolder: TBevel; + btnEvenFont: TButton; + edEvenFont: TEdit; + chbxShowVertLines: TCheckBox; + chbxShowFixedHorzLines: TCheckBox; + chbxShowFixedVertLines: TCheckBox; + chbxShowBorders: TCheckBox; + chbxShowHorzLines: TCheckBox; + lblShow: TLabel; + Bevel11: TBevel; + tshBehaviors: TTabSheet; + Panel1: TPanel; + chbxIncludeFixed: TCheckBox; + chbxOnlySelected: TCheckBox; + Image3: TImage; + lblSelection: TLabel; + Bevel3: TBevel; + lblLookAndFeel: TLabel; + Bevel15: TBevel; + Image8: TImage; + chbxUse3DEffects: TCheckBox; + chbxUseSoft3D: TCheckBox; + imgGrid: TImage; + lblDrawMode: TLabel; + cbxDrawMode: TComboBox; + lblOnEveryPage: TLabel; + Image1: TImage; + Bevel10: TBevel; + chbxFixedRowsOnEveryPage: TCheckBox; + chbxRowAutoHeight: TCheckBox; + bvlMiscellaneous: TBevel; + lblMiscellaneous: TLabel; + imgMiscellaneous: TImage; + lblPreview: TStaticText; + chbxAutoWidth: TCheckBox; + stTransparent: TStaticText; + stFixedTransparent: TStaticText; + procedure ccbxColorChange(Sender: TObject); + procedure btnFontClick(Sender: TObject); + procedure pbxPreviewPaint(Sender: TObject); + procedure chbxOnlySelectedClick(Sender: TObject); + procedure chbxIncludeFixedClick(Sender: TObject); + procedure chbxTransparentClick(Sender: TObject); + procedure lblColorClick(Sender: TObject); + procedure chbxRowAutoHeightClick(Sender: TObject); + procedure chbxFixedRowsOnEveryPageClick(Sender: TObject); + procedure chbxShowBordersClick(Sender: TObject); + procedure cbxDrawModeClick(Sender: TObject); + procedure chbxUse3DEffectsClick(Sender: TObject); + procedure chbxUseSoft3DClick(Sender: TObject); + procedure PageControl1Change(Sender: TObject); + procedure cbxDrawModeDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure chbxAutoWidthClick(Sender: TObject); + procedure stFixedTransparentClick(Sender: TObject); + procedure stTransparentClick(Sender: TObject); + private + FccbxColor: TCustomComboBox; + FccbxEvenColor: TCustomComboBox; + FccbxFixedColor: TCustomComboBox; + FccbxGridLineColor: TCustomComboBox; + FPreviewBox: TCustomControl; + function GetReportLink: TStddxGridReportLink; + procedure CreateControls; + procedure CMDialogChar(var message: TCMDialogChar); message CM_DIALOGCHAR; + protected + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + procedure LoadStrings; override; + procedure PaintPreview(ACanvas: TCanvas; R: TRect); override; + procedure UpdateControlsState; override; + procedure UpdatePreview; override; + public + constructor Create(AOwner: TComponent); override; + + property ReportLink: TStddxGridReportLink read GetReportLink; + end; + +implementation + +{$R *.DFM} + +uses + cxClasses, dxExtCtrls, dxPrnDev, dxPSUtl; + +{ TStddxGridReportLink } + +constructor TStddxGridReportLink.Create(AOwner: TComponent); +begin + inherited; + FSaveFont := TFont.Create; + FSaveFont.OnChange := CustomDrawFontChanged; +end; + +destructor TStddxGridReportLink.Destroy; +begin + FreeAndNil(FSaveFont); + inherited; +end; + +class function TStddxGridReportLink.IsDrawGridLink: Boolean; +begin + Result := False; +end; + +class function TStddxGridReportLink.IsStringGridLink: Boolean; +begin + Result := False; +end; + +procedure TStddxGridReportLink.CustomDrawFontChanged(Sender: TObject); +begin + FCustomDrawFontChanged := True; +end; + +{ TdxStringGridReportLink } + +procedure TdxStringGridReportLink.Assign(Source: TPersistent); +begin + inherited; + if Source is TdxStringGridReportLink then + begin + TextAlignX := TdxStringGridReportLink(Source).TextAlignX; + TextAlignY := TdxStringGridReportLink(Source).TextAlignY; + end; +end; + +class function TdxStringGridReportLink.IsStringGridLink: Boolean; +begin + Result := True; +end; + +procedure TdxStringGridReportLink.InternalRestoreDefaults; +begin + inherited; + TextAlignX := dxPSCore.dxDefaultTextAlignX; {taLeft} + TextAlignY := dxPSCore.dxDefaultTextAlignY; {taCenterY} +end; + +function TdxStringGridReportLink.GetStringGrid: TStringGrid; +begin + Result := TStringGrid(Component); +end; + +procedure TdxStringGridReportLink.SetTextAlignX(Value: TdxTextAlignX); +begin + if FTextAlignX <> Value then + begin + FTextAlignX := Value; + LinkModified(True); + end; +end; + +function TdxStringGridReportLink.GetCellText(ACol, ARow: Integer): string; +begin + Result := StringGrid.Cells[ACol, ARow]; +end; + +function TdxStringGridReportLink.GetCellTextAlignX(ACol, ARow: Integer): TdxTextAlignX; +begin + if DrawMode <> gdmBorrowSource then + Result := FTextAlignX + else + Result := inherited GetCellTextAlignX(ACol, ARow); +end; + +function TdxStringGridReportLink.GetCellTextAlignY(ACol, ARow: Integer): TdxTextAlignY; +begin + if DrawMode <> gdmBorrowSource then + Result := FTextAlignY + else + Result := inherited GetCellTextAlignY(ACol, ARow); +end; + +procedure TdxStringGridReportLink.SetTextAlignY(Value: TdxTextAlignY); +begin + if FTextAlignY <> Value then + begin + FTextAlignY := Value; + LinkModified(True); + end; +end; + +procedure TdxStringGridReportLink.SetDrawMode(Value: TdxGridDrawMode); +begin + if Value > gdmChess then Value := gdmChess; + inherited SetDrawMode(Value); +end; + +function TdxStringGridReportLink.IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; +begin + Result := inherited IsSupportedCustomDraw(Item) and Assigned(FOnCustomDrawCell); +end; + +procedure TdxStringGridReportLink.CustomDraw(AItem: TAbstractdxReportCellData; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); +var + AColor: TColor; + AText: string; + ACol, ARow: Integer; + ATextAlignX: TdxTextAlignX; + ATextAlignY: TdxTextAlignY; +begin + with TdxReportCellString(AItem) do + begin + GetCellColRow(AItem, ACol, ARow); + AColor := ColorToRGB(Color); + if Transparent then AColor := clNone; + FSaveFont.Assign(Font); + FCustomDrawFontChanged := False; + AText := Text; + ATextAlignX := TextAlignX; + ATextAlignY := TextAlignY; + DoCustomDrawCell(ACol, ARow, ACanvas, ABoundsRect, AClientRect, AText, + FSaveFont, AColor, ATextAlignX, ATextAlignY, ADone); + if not ADone then + begin + if FCustomDrawFontChanged then + begin + SelectObject(ACanvas.Handle, FSaveFont.Handle); + SetTextColor(ACanvas.Handle, ColorToRGB(FSaveFont.Color)); + FontIndex := -1; + end; + if AColor <> clNone then + begin + AItem.Color := AColor; + AItem.Transparent := False; + end; + Text := AText; + TextAlignX := ATextAlignX; + TextAlignY := ATextAlignY; + end; + end; +end; + +procedure TdxStringGridReportLink.DoCustomDrawCell(ACol, ARow: Integer; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var AText: string; AFont: TFont; var AColor: TColor; + var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawCell) then + FOnCustomDrawCell(Self, ACol, ARow, ACanvas, ABoundsRect, AClientRect, AText, + AFont, AColor, ATextAlignX, ATextAlignY, ADone); +end; + +type + TdxReportCustomDrawCellData = class(TAbstractdxReportCellData) + private + FDefaultDrawing: Boolean; + protected + class function Serializable: Boolean; override; + function CustomDraw(DC: HDC): Boolean; override; + public + constructor Create(AParent: TdxReportCell); override; + procedure Assign(Source: TPersistent); override; + property DefaultDrawing: Boolean read FDefaultDrawing write FDefaultDrawing; + end; + +constructor TdxReportCustomDrawCellData.Create(AParent: TdxReportCell); +begin + inherited; + DefaultDrawing := True; +end; + +procedure TdxReportCustomDrawCellData.Assign(Source: TPersistent); +begin + inherited; + if Source is TdxReportCustomDrawCellData then + DefaultDrawing := TdxReportCustomDrawCellData(Source).DefaultDrawing; +end; + +class function TdxReportCustomDrawCellData.Serializable: Boolean; +begin + Result := False; +end; + +function TdxReportCustomDrawCellData.CustomDraw(DC: HDC): Boolean; +begin + if DefaultDrawing then + begin + if IsBackgroundDrawn then DrawBackground(DC); + if IsBordersDrawn then DrawBorders(DC); + end; + inherited CustomDraw(DC); + Result := True; +end; + +{ TdxDrawGridReportLink } + +procedure TdxDrawGridReportLink.Assign(Source: TPersistent); +begin + inherited; + if Source is TdxDrawGridReportLink then + DefaultDrawing := TdxDrawGridReportLink(Source).DefaultDrawing; +end; + +class function TdxDrawGridReportLink.Serializable: Boolean; +begin + Result := False; +end; + +class function TdxDrawGridReportLink.IsDrawGridLink: Boolean; +begin + Result := True; +end; + +procedure TdxDrawGridReportLink.InternalRestoreDefaults; +begin + inherited; + DefaultDrawing := True; + SupportedCustomDraw := True; +end; + +function TdxDrawGridReportLink.GetCellText(ACol, ARow: Integer): string; +begin + Result := ''; +end; + +procedure TdxDrawGridReportLink.InternalRestoreFromOriginal; +begin + inherited; + if DrawGrid <> nil then + DefaultDrawing := DrawGrid.DefaultDrawing; +end; + +function TdxDrawGridReportLink.GetDrawGrid: TDrawGrid; +begin + Result := TDrawGrid(Component); +end; + +procedure TdxDrawGridReportLink.SetDefaultDrawing(Value: Boolean); +begin + if DefaultDrawing <> Value then + begin + FDefaultDrawing := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxDrawGridReportLink.SetDrawMode(Value: TdxGridDrawMode); +begin + if Value > gdmChess then Value := gdmChess; + inherited SetDrawMode(Value); +end; + +function TdxDrawGridReportLink.GetDataItemClass(ACol: Integer; ARow: Integer = 0): TdxReportCellDataClass; +begin + Result := TdxReportCustomDrawCellData; +end; + +procedure TdxDrawGridReportLink.CustomDraw(AItem: TAbstractdxReportCellData; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); +var + ACol, ARow: Integer; +begin + with TdxReportCustomDrawCellData(AItem) do + begin + GetCellColRow(AItem, ACol, ARow); + FSaveFont.Assign(Font); + DoCustomDrawCellEx(ACol, ARow, ACanvas, FSaveFont, ABoundsRect, AClientRect); + end; + ADone := True; +end; + +procedure TdxDrawGridReportLink.DoCustomDrawCellEx(ACol, ARow: Integer; + ACanvas: TCanvas; AFont: TFont; ABoundsRect, AClientRect: TRect); +var + ADone: Boolean; +begin + ADone := False; + if Assigned(FOnCustomDrawCellEx) then + FOnCustomDrawCellEx(Self, ACol, ARow, ACanvas, AFont, ABoundsRect, AClientRect, ADone); + if not ADone then + DoCustomDrawCell(ACol, ARow, ACanvas, ABoundsRect, AClientRect); +end; + +procedure TdxDrawGridReportLink.DoCustomDrawCell(ACol, ARow: Integer; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect); +begin + if Assigned(FOnCustomDrawCell) then + FOnCustomDrawCell(Self, ACol, ARow, ACanvas, ABoundsRect, AClientRect); +end; + +function TdxDrawGridReportLink.IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; +begin + Result := inherited IsSupportedCustomDraw(Item) and + (Assigned(FOnCustomDrawCellEx) or Assigned(FOnCustomDrawCell)); +end; + +{ TdxSGrReportLinkDesignWindow } + +constructor TdxGridReportLinkDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxPSGlbl.dxhcStringGridReportLinkDesigner; + inherited; + CreateControls; + PageControl1.ActivePage := PageControl1.Pages[0]; +end; + +function TdxGridReportLinkDesignWindow.GetReportLink: TStddxGridReportLink; +begin + Result := inherited ReportLink as TStddxGridReportLink; +end; + +{$IFDEF DELPHI7} +function TdxGridReportLinkDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +procedure TdxGridReportLinkDesignWindow.LoadStrings; +begin + inherited; + tshOptions.Caption := cxGetResourceString(@sdxOptions); + tshFont.Caption := cxGetResourceString(@sdxFonts); + tshColor.Caption := cxGetResourceString(@sdxColors); + tshBehaviors.Caption := cxGetResourceString(@sdxBehaviors); + lblPreview.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + lblShow.Caption := cxGetResourceString(@sdxShow); + chbxShowBorders.Caption := cxGetResourceString(@sdxBorderLines); + chbxShowHorzLines.Caption := cxGetResourceString(@sdxHorzLines); + chbxShowVertLines.Caption := cxGetResourceString(@sdxVertLines); + chbxShowFixedHorzLines.Caption := cxGetResourceString(@sdxFixedHorzLines); + chbxShowFixedVertLines.Caption := cxGetResourceString(@sdxFixedVertLines); + + lblMiscellaneous.Caption := cxGetResourceString(@sdxMiscellaneous); + chbxRowAutoHeight.Caption := cxGetResourceString(@sdxRowAutoHeight); + chbxAutoWidth.Caption := cxGetResourceString(@sdxAutoWidth); + lblDrawMode.Caption := cxGetResourceString(@sdxDrawMode); + with cbxDrawMode.Items do + begin + BeginUpdate; + try + Clear; + AddObject(cxGetResourceString(@sdxDrawModeStrict), TObject(gdmStrict)); + AddObject(cxGetResourceString(@sdxDrawModeOddEven), TObject(gdmOddEven)); + AddObject(cxGetResourceString(@sdxDrawModeChess), TObject(gdmChess)); + finally + EndUpdate; + end; + end; + + stTransparent.Caption := ' ' + cxGetResourceString(@sdxTransparent) + ' '; + lblColor.Caption := cxGetResourceString(@sdxColor); + lblEvenColor.Caption := cxGetResourceString(@sdxEvenColor); + stFixedTransparent.Caption := ' ' + cxGetResourceString(@sdxFixedTransparent) + ' '; + lblFixedColor.Caption := cxGetResourceString(@sdxFixedColor); + lblGridLinesColor.Caption := cxGetResourceString(@sdxGridLinesColor); + + btnFont.Caption := cxGetResourceString(@sdxBtnFont); + btnEvenFont.Caption := cxGetResourceString(@sdxBtnEvenFont); + btnFixedFont.Caption := cxGetResourceString(@sdxBtnFixedFont); + + lblOnEveryPage.Caption := cxGetResourceString(@sdxOnEveryPage); + chbxFixedRowsOnEveryPage.Caption := cxGetResourceString(@sdxFixedRowOnEveryPage); + + lblSelection.Caption := cxGetResourceString(@sdxSelection); + chbxOnlySelected.Caption := cxGetResourceString(@sdxOnlySelected); + chbxIncludeFixed.Caption := cxGetResourceString(@sdxIncludeFixed); + + lblLookAndFeel.Caption := cxGetResourceString(@sdxLookAndFeel); + chbxUse3DEffects.Caption := cxGetResourceString(@sdxUse3DEffects); + chbxUseSoft3D.Caption := cxGetResourceString(@sdxSoft3D); +end; + +procedure TdxGridReportLinkDesignWindow.DoInitialize; +begin + inherited; + chbxShowBorders.Checked := gpoBorder in ReportLink.Options; + chbxShowHorzLines.Checked := gpoHorzLines in ReportLink.Options; + chbxShowVertLines.Checked := gpoVertLines in ReportLink.Options; + chbxShowFixedHorzLines.Checked := gpoFixedHorzLines in ReportLink.Options; + chbxShowFixedVertLines.Checked := gpoFixedVertLines in ReportLink.Options; + + chbxRowAutoHeight.Visible := ReportLink.IsStringGridLink; + if chbxRowAutoHeight.Visible then + chbxRowAutoHeight.Checked := TdxStringGridReportLink(ReportLink).RowAutoHeight; + chbxAutoWidth.Checked := ReportLink.AutoWidth; + + with cbxDrawMode do + ItemIndex := Items.IndexOfObject(TObject(ReportLink.DrawMode)); + chbxTransparent.Checked := ReportLink.Transparent; + TdxPSColorCombo(FccbxColor).ColorValue := ColorToRGB(ReportLink.Color); + TdxPSColorCombo(FccbxEvenColor).ColorValue := ColorToRGB(ReportLink.EvenColor); + chbxFixedTransparent.Checked := ReportLink.FixedTransparent; + TdxPSColorCombo(FccbxFixedColor).ColorValue := ColorToRGB(ReportLink.FixedColor); + TdxPSColorCombo(FccbxGridLineColor).ColorValue := ColorToRGB(ReportLink.GridLineColor); + + FontInfoToText(ReportLink.Font, edFont); + FontInfoToText(ReportLink.EvenFont, edEvenFont); + FontInfoToText(ReportLink.FixedFont, edFixedFont); + + chbxFixedRowsOnEveryPage.Checked := ReportLink.HeadersOnEveryPage; + chbxOnlySelected.Checked := ReportLink.OnlySelected; + chbxIncludeFixed.Checked := ReportLink.IncludeFixed; + + chbxUse3DEffects.Checked := ReportLink.Effects3D; + chbxUseSoft3D.Checked := ReportLink.Soft3D; +end; + +procedure TdxGridReportLinkDesignWindow.PaintPreview(ACanvas: TCanvas; R: TRect); +begin + inherited; + dxPSDrawGridPreview(ACanvas, R, ReportLink); +end; + +procedure TdxGridReportLinkDesignWindow.UpdateControlsState; +begin + inherited; + + FccbxColor.Enabled := not chbxTransparent.Checked; + lblColor.Enabled := FccbxColor.Enabled; + FccbxEvenColor.Enabled := + not chbxTransparent.Checked and (ReportLink.DrawMode in [gdmOddEven, gdmChess]); + lblEvenColor.Enabled := FccbxEvenColor.Enabled; + FccbxFixedColor.Enabled := not chbxFixedTransparent.Checked; + lblFixedColor.Enabled := FccbxFixedColor.Enabled; + + btnEvenFont.Enabled := ReportLink.DrawMode in [gdmOddEven, gdmChess]; + if ReportLink.DrawMode in [gdmOddEven, gdmChess] then + begin + lblColor.Caption := cxGetResourceString(@sdxOddColor); + btnFont.Caption := cxGetResourceString(@sdxBtnOddFont); + end + else + begin + lblColor.Caption := cxGetResourceString(@sdxColor); + btnFont.Caption := cxGetResourceString(@sdxBtnFont); + end; + chbxFixedRowsOnEveryPage.Enabled := not ReportLink.IsAggregated; + chbxIncludeFixed.Enabled := chbxOnlySelected.Enabled and chbxOnlySelected.Checked; + chbxUseSoft3D.Enabled := chbxUse3DEffects.Checked; +end; + +procedure TdxGridReportLinkDesignWindow.UpdatePreview; +begin + FPreviewBox.Invalidate; +end; + +procedure TdxGridReportLinkDesignWindow.CreateControls; + + function CreateColorCombo(AParent: TWinControl; AHost: TControl; + ATag: Integer; AAutoColor: TColor; ALabel: TLabel): TdxPSColorCombo; + begin + Result := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(Result) do + begin + BoundsRect := AHost.BoundsRect; + Tag := MakeTTag(ATag); + Parent := AParent; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := AAutoColor; + OnChange := ccbxColorChange; + end; + ALabel.FocusControl := Result; + AHost.Visible := False; + end; + + procedure CreatePreviewBox; + var + R: TRect; + begin + FPreviewBox := TdxPSPaintPanel.Create(Self); + with TdxPSPaintPanel(FPreviewBox) do + begin + Parent := pnlPreview; + R := pnlPreview.BoundsRect; + OffsetRect(R, -R.Left, -R.Top); + InflateRect(R, -1, -1); + BoundsRect := R; + EdgeInner := esNone; + EdgeOuter := esNone; + OnPaint := pbxPreviewPaint; + end; + end; + +begin + CreatePreviewBox; + + FccbxColor := + CreateColorCombo(gbxTransparent, bvlColorHolder, 0, dxDefaultColor, lblColor); + FccbxEvenColor := + CreateColorCombo(gbxTransparent, bvlEvenColorHolder, 1, dxDefaultColor, lblEvenColor); + FccbxFixedColor := + CreateColorCombo(gbxFixedTransparent, bvlFixedColorHolder, 2, dxDefaultFixedColor, lblFixedColor); + FccbxGridLineColor := + CreateColorCombo(pnlColor, bvlLineColorHolder, 3, dxDefaultGridLineColor, lblGridLinesColor); +end; + +procedure TdxGridReportLinkDesignWindow.CMDialogChar(var message: TCMDialogChar); +var + I: Integer; +begin + inherited; + with PageControl1 do + for I := 0 to PageCount - 1 do + if IsAccel(message.CharCode, Pages[I].Caption) then + begin + message.Result := 1; + ActivePage := Pages[I]; + Exit; + end; +end; + +procedure TdxGridReportLinkDesignWindow.pbxPreviewPaint(Sender: TObject); +begin + with TdxPSPaintPanel(Sender) do + PaintPreview(Canvas, ClientRect); +end; + +procedure TdxGridReportLinkDesignWindow.ccbxColorChange(Sender: TObject); +var + AColor: TColor; +begin + if LockControlsUpdate then Exit; + AColor := TdxPSColorCombo(Sender).ColorValue; + case TTagToInt(TdxPSColorCombo(Sender).Tag) of + 0: ReportLink.Color := AColor; + 1: ReportLink.EvenColor := AColor; + 2: ReportLink.FixedColor := AColor; + 3: ReportLink.GridLineColor := AColor; + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxGridReportLinkDesignWindow.btnFontClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + + with dxPSGlbl.FontDialog do + begin + case TTagToInt(TButton(Sender).Tag) of + 0: Font := ReportLink.Font; + 1: Font := ReportLink.EvenFont; + 2: Font := ReportLink.FixedFont; + end; + + if Execute then + begin + case TTagToInt(TButton(Sender).Tag) of + 0: + begin + ReportLink.Font := Font; + FontInfoToText(ReportLink.Font, edFont); + end; + 1: + begin + ReportLink.EvenFont := Font; + FontInfoToText(ReportLink.EvenFont, edEvenFont); + end; + 2: + begin + ReportLink.FixedFont := Font; + FontInfoToText(ReportLink.FixedFont, edFixedFont); + end; + end; + Modified := True; + UpdatePreview; + end; + end; +end; + +procedure TdxGridReportLinkDesignWindow.chbxRowAutoHeightClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + if ReportLink.IsStringGridLink then + TdxStringGridReportLink(ReportLink).RowAutoHeight := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxGridReportLinkDesignWindow.chbxAutoWidthClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.AutoWidth := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxGridReportLinkDesignWindow.cbxDrawModeClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TComboBox(Sender) do + ReportLink.DrawMode := TdxGridDrawMode(Items.Objects[ItemIndex]); + Modified := True; + UpdatePreview; +end; + +procedure TdxGridReportLinkDesignWindow.cbxDrawModeDrawItem( + Control: TWinControl; Index: Integer; Rect: TRect; + State: TOwnerDrawState); +begin + dxPSBaseGridLnk.dxPSDrawComboDrawModeItem(Control, Index, Rect, State); +end; + +procedure TdxGridReportLinkDesignWindow.chbxOnlySelectedClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OnlySelected := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxGridReportLinkDesignWindow.chbxIncludeFixedClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.IncludeFixed := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxGridReportLinkDesignWindow.chbxUse3DEffectsClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.Effects3D := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TdxGridReportLinkDesignWindow.chbxUseSoft3DClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.Soft3D := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TdxGridReportLinkDesignWindow.chbxShowBordersClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TCheckBox(Sender) do + if Checked then + ReportLink.Options := ReportLink.Options + [TdxGridPaintOption(TTagToInt(Tag))] + else + ReportLink.Options := ReportLink.Options - [TdxGridPaintOption(TTagToInt(Tag))]; + Modified := True; + UpdatePreview; +end; + +procedure TdxGridReportLinkDesignWindow.chbxFixedRowsOnEveryPageClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.HeadersOnEveryPage := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxGridReportLinkDesignWindow.chbxTransparentClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + case TTagToInt(TCheckBox(Sender).Tag) of + 0: ReportLink.Transparent := TCheckBox(Sender).Checked; + 1: ReportLink.FixedTransparent := TCheckBox(Sender).Checked; + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxGridReportLinkDesignWindow.stFixedTransparentClick(Sender: TObject); +begin + if chbxFixedTransparent.CanFocus then ActiveControl := chbxFixedTransparent; + chbxFixedTransparent.Checked := not chbxFixedTransparent.Checked; +end; + +procedure TdxGridReportLinkDesignWindow.stTransparentClick(Sender: TObject); +begin + if chbxTransparent.CanFocus then ActiveControl := chbxTransparent; + chbxTransparent.Checked := not chbxTransparent.Checked; +end; + +procedure TdxGridReportLinkDesignWindow.lblColorClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; + TCustomComboBox(ActiveControl).DroppedDown := True; +end; + +procedure TdxGridReportLinkDesignWindow.PageControl1Change(Sender: TObject); +begin + lblPreview.Parent := TPageControl(Sender).ActivePage; +end; + +initialization + dxPSRegisterReportLink(TdxStringGridReportLink, TStringGrid, TdxGridReportLinkDesignWindow); + dxPSRegisterReportLink(TdxDrawGridReportLink, TDrawGrid, TdxGridReportLinkDesignWindow); + +finalization + dxPSUnregisterReportLink(TdxDrawGridReportLink, TDrawGrid, TdxGridReportLinkDesignWindow); + dxPSUnregisterReportLink(TdxStringGridReportLink, TStringGrid, TdxGridReportLinkDesignWindow); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSTCLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSTCLnk.pas new file mode 100644 index 00000000..6ad020e0 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSTCLnk.pas @@ -0,0 +1,302 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSTCLnk; + +interface + +{$I cxVer.inc} + +uses + Classes, Chart, Graphics, dxPSCore, dxPSGraphicLnk; + +type + + TdxPSTeeChartReportLinkGetGraphicClassEvent = procedure(Sender: TBasedxReportLink; + var AGraphicClass: TGraphicClass) of object; + TdxPSTeeChartReportLinkCreateGraphicEvent = procedure(Sender: TBasedxReportLink; + var AGraphic: TGraphic) of object; + + TCustomdxTeeChartReportLink = class(TCustomdxGraphicReportLink) + private + FGraphicClass: TGraphicClass; + FIsGraphicClassAssigned: Boolean; + FOnCreateGraphic: TdxPSTeeChartReportLinkCreateGraphicEvent; + FOnGetGraphicClass: TdxPSTeeChartReportLinkGetGraphicClassEvent; + function GetChart: TCustomChart; + function GetGraphicClassName: string; + function GetGraphicClassValue: TGraphicClass; + function IsGraphicClassNameStored: Boolean; + procedure SetGraphicClassName(const Value: string); + procedure SetGraphicClassValue(Value: TGraphicClass); + protected + procedure ConstructReport(AReportCells: TdxReportCells); override; + + procedure InternalRestoreDefaults; override; + + function GetGraphic: TGraphic; override; + function GetGraphicClass: TGraphicClass; override; + function GetGraphicHeight: Integer; override; + function GetGraphicWidth: Integer; override; + + procedure CreateGraphicStandard(var AGraphic: TGraphic); virtual; + function DoCreateGraphic(var AGraphic: TGraphic): Boolean; dynamic; + procedure DoGetGraphicClass(var AGraphicClass: TGraphicClass); dynamic; + + property Chart: TCustomChart read GetChart; + property GraphicClass: TGraphicClass read GetGraphicClassValue write SetGraphicClassValue; + property GraphicClassName: string read GetGraphicClassName write SetGraphicClassName stored IsGraphicClassNameStored; + property OnCreateGraphic: TdxPSTeeChartReportLinkCreateGraphicEvent read FOnCreateGraphic write FOnCreateGraphic; + property OnGetGraphicClass: TdxPSTeeChartReportLinkGetGraphicClassEvent read FOnGetGraphicClass write FOnGetGraphicClass; + public + procedure Assign(Source: TPersistent); override; + class function Aggregable: Boolean; override; + + function DefaultGraphicClass: TGraphicClass; virtual; + end; + + TdxTeeChartReportLink = class(TCustomdxTeeChartReportLink) + private + function GetChart: TChart; + public + property Chart: TChart read GetChart; + property GraphicClass; + published + property GraphicClassName; + property OnCreateGraphic; + property OnGetGraphicClass; + end; + +implementation + +uses + {$IFDEF USEJPEGIMAGE} + Jpeg, + {$ENDIF} + SysUtils, dxPSUtl; + +procedure TCustomdxTeeChartReportLink.Assign(Source: TPersistent); +begin + if Source is TCustomdxTeeChartReportLink then + with TCustomdxTeeChartReportLink(Source) do + begin + Self.GraphicClass := GraphicClass; + Self.FIsGraphicClassAssigned := FIsGraphicClassAssigned; + end; + inherited; +end; + +class function TCustomdxTeeChartReportLink.Aggregable: Boolean; +begin + Result := True; +end; + +function TCustomdxTeeChartReportLink.DefaultGraphicClass: TGraphicClass; +begin + Result := TBitmap; +end; + +procedure TCustomdxTeeChartReportLink.ConstructReport( + AReportCells: TdxReportCells); +var + Cell: TdxReportCell; + ControllerIntf: IdxReportLinkController; +begin + inherited ConstructReport(AReportCells); + if (AReportCells.Count > 0) and Aggregable and + SysUtils.Supports(TObject(Controller), IdxReportLinkController, ControllerIntf) then + begin + Cell := AReportCells.Cells[AReportCells.Count - 1]; + if (Cell.DataItemCount > 0) and + (Cell.DataItems[Cell.DataItemCount - 1] is TdxReportCellGraphic) then + begin + TdxReportCellGraphic(Cell.DataItems[Cell.DataItemCount - 1]).DrawMode := gdmStretch; + end; + end; +end; + +procedure TCustomdxTeeChartReportLink.InternalRestoreDefaults; +begin + inherited; + FIsGraphicClassAssigned := False; +end; + +function TCustomdxTeeChartReportLink.DoCreateGraphic(var AGraphic: TGraphic): Boolean; +begin + AGraphic := nil; + if Assigned(FOnCreateGraphic) then FOnCreateGraphic(Self, AGraphic); + Result := AGraphic <> nil; +end; + +function TCustomdxTeeChartReportLink.GetGraphic: TGraphic; +begin + if not DoCreateGraphic(Result) then CreateGraphicStandard(Result) +end; + +function TCustomdxTeeChartReportLink.GetGraphicClass: TGraphicClass; +begin + Result := GraphicClass; + DoGetGraphicClass(Result); + if Result = nil then Result := DefaultGraphicClass; +end; + +function TCustomdxTeeChartReportLink.GetGraphicHeight: Integer; +var + ControllerIntf: IdxReportLinkController; +begin + if Chart <> nil then + begin + Result := Chart.Height; + if Aggregable and SysUtils.Supports(TObject(Controller), IdxReportLinkController, ControllerIntf) then + begin + with ControllerIntf.GetControlSiteBounds(Chart) do + Result := Bottom - Top - 1 + end; + end + else + Result := inherited GetGraphicHeight; +end; + +function TCustomdxTeeChartReportLink.GetGraphicWidth: Integer; +var + ControllerIntf: IdxReportLinkController; +begin + if Chart <> nil then + begin + Result := Chart.Width; + if Aggregable and SysUtils.Supports(TObject(Controller), IdxReportLinkController, ControllerIntf) then + begin + with ControllerIntf.GetControlSiteBounds(Chart) do + Result := Right - Left - 1 + end; + end + else + Result := inherited GetGraphicWidth; +end; + +procedure TCustomdxTeeChartReportLink.CreateGraphicStandard(var AGraphic: TGraphic); +var + OwnGraphicClass: TGraphicClass; + {$IFDEF USEJPEGIMAGE} + B: TBitmap; + {$ENDIF} +begin + OwnGraphicClass := GraphicClass; + + if OwnGraphicClass.InheritsFrom(TBitmap) then + AGraphic := Chart.TeeCreateBitmap(Color, Chart.ClientRect) + else + {$IFDEF USEJPEGIMAGE} + if OwnGraphicClass.InheritsFrom(TJPEGImage) then + begin + B := Chart.TeeCreateBitmap(Color, Chart.ClientRect); + try + AGraphic := TJPEGImage.Create; + try + AGraphic.Assign(B); + except + FreeAndNil(AGraphic); + raise; + end; + finally + B.Free; + end; + end + else + {$ENDIF} + AGraphic := Chart.TeeCreateMetafile(True, Chart.ClientRect); +end; + +procedure TCustomdxTeeChartReportLink.DoGetGraphicClass(var AGraphicClass: TGraphicClass); +begin + if Assigned(FOnGetGraphicClass) then FOnGetGraphicClass(Self, AGraphicClass); +end; + +function TCustomdxTeeChartReportLink.GetChart: TCustomChart; +begin + Result := inherited Component as TCustomChart; +end; + +function TCustomdxTeeChartReportLink.GetGraphicClassName: string; +begin + Result := GraphicClass.ClassName; +end; + +function TCustomdxTeeChartReportLink.GetGraphicClassValue: TGraphicClass; +begin + if FIsGraphicClassAssigned then + Result := FGraphicClass + else + Result := DefaultGraphicClass; +end; + +function TCustomdxTeeChartReportLink.IsGraphicClassNameStored: Boolean; +begin + Result := FIsGraphicClassAssigned and (GraphicClass <> DefaultGraphicClass); +end; + +procedure TCustomdxTeeChartReportLink.SetGraphicClassName(const Value: string); +var + ValueClass: TPersistentClass; +begin + ValueClass := GetClass(Value); + if (ValueClass <> nil) and ValueClass.InheritsFrom(TGraphic) then + GraphicClass := TGraphicClass(ValueClass); +end; + +procedure TCustomdxTeeChartReportLink.SetGraphicClassValue(Value: TGraphicClass); +begin + if FGraphicClass <> Value then + begin + FGraphicClass := Value; + FIsGraphicClassAssigned := True; + LinkModified(True); + end; +end; + +{ TdxTeeChartReportLink } + +function TdxTeeChartReportLink.GetChart: TChart; +begin + Result := inherited Chart as TChart; +end; + +initialization + dxPSRegisterReportLink(TdxTeeChartReportLink, TChart, nil); + +finalization + dxPSUnregisterReportLink(TdxTeeChartReportLink, TChart, nil); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSTCLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSTCLnkReg.pas new file mode 100644 index 00000000..8c79df23 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSTCLnkReg.pas @@ -0,0 +1,93 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSTCLnkReg; + +interface + +{$I cxVer.inc} + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignEditors, + {$ELSE} + DsgnIntf, + {$ENDIF} + Classes; + +procedure Register; + +type + TdxTeeChartReportLinkGraphicClassNamePropertyEditor = class(TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + end; + +implementation + +uses + {$IFDEF USEJPEGIMAGE} + Jpeg, + {$ENDIF} + Graphics, dxPSTCLnk; + +{ TdxTeeChartReportLinkGraphicClassNamePropertyEditor } + +function TdxTeeChartReportLinkGraphicClassNamePropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paValueList, paSortList {$IFNDEF DELPHI6}, paReadOnly{$ENDIF}] +end; + +procedure TdxTeeChartReportLinkGraphicClassNamePropertyEditor.GetValues(Proc: TGetStrProc); +begin + Proc(TBitmap.ClassName); + Proc(TMetafile.ClassName); + {$IFDEF USEJPEGIMAGE} + Proc(TJPEGImage.ClassName); + {$ENDIF} +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterNoIcon([TdxTeeChartReportLink]); + RegisterPropertyEditor(TypeInfo(string), TCustomdxTeeChartReportLink, 'GraphicClassName', TdxTeeChartReportLinkGraphicClassNamePropertyEditor); +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSTVLnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSTVLnk.dfm new file mode 100644 index 00000000..4772d4e0 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSTVLnk.dfm @@ -0,0 +1,930 @@ +object dxfmTVReportLinkDesignWindow: TdxfmTVReportLinkDesignWindow + Left = 370 + Top = 405 + ActiveControl = chbxTransparent + BorderStyle = bsDialog + Caption = 'dxfmTVReportLinkDesignWindow' + ClientHeight = 279 + ClientWidth = 582 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 4 + Width = 574 + Height = 240 + ActivePage = tshColors + Anchors = [akLeft, akTop, akRight, akBottom] + MultiLine = True + TabOrder = 0 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = '&Options' + object pnlOptions: TPanel + Left = 0 + Top = 0 + Width = 566 + Height = 212 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblShow: TLabel + Left = 6 + Top = 12 + Width = 26 + Height = 13 + Caption = 'Show' + end + object Bevel11: TBevel + Left = 41 + Top = 17 + Width = 207 + Height = 4 + Shape = bsBottomLine + end + object imgGrid: TImage + Left = 6 + Top = 36 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object Bevel2: TBevel + Left = 63 + Top = 80 + Width = 185 + Height = 4 + Shape = bsBottomLine + end + object Bevel3: TBevel + Left = 63 + Top = 147 + Width = 185 + Height = 4 + Shape = bsBottomLine + end + object chbxShowBorders: TCheckBox + Left = 63 + Top = 30 + Width = 113 + Height = 17 + Caption = '&Border' + TabOrder = 0 + OnClick = chbxShowClick + end + object chbxShowGrid: TCheckBox + Tag = 1 + Left = 63 + Top = 51 + Width = 113 + Height = 17 + Caption = '&Grid' + TabOrder = 1 + OnClick = chbxShowClick + end + object chbxShowStateImages: TCheckBox + Tag = 2 + Left = 63 + Top = 163 + Width = 113 + Height = 17 + Caption = 'State Images' + TabOrder = 4 + OnClick = chbxShowClick + end + object chbxShowImages: TCheckBox + Tag = 3 + Left = 63 + Top = 184 + Width = 113 + Height = 17 + Caption = 'Images' + TabOrder = 5 + OnClick = chbxShowClick + end + object chbxShowTreeLines: TCheckBox + Tag = 4 + Left = 63 + Top = 98 + Width = 113 + Height = 17 + Caption = 'TreeLines' + TabOrder = 2 + OnClick = chbxShowClick + end + object chbxShowButtons: TCheckBox + Tag = 5 + Left = 63 + Top = 119 + Width = 113 + Height = 17 + Caption = 'Buttons' + TabOrder = 3 + OnClick = chbxShowClick + end + object lblPreview: TStaticText + Left = 264 + Top = 2 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 6 + end + end + end + object tshColors: TTabSheet + Caption = '&Color' + object pnlColor: TPanel + Left = 0 + Top = 0 + Width = 566 + Height = 212 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblGridLinesColor: TLabel + Left = 10 + Top = 88 + Width = 81 + Height = 13 + Caption = '&Grid Lines Color: ' + OnClick = lblColorClick + end + object bvlGridLineColorHost: TBevel + Left = 91 + Top = 84 + Width = 150 + Height = 21 + Visible = False + end + object bvlTreeLineColorHost: TBevel + Left = 91 + Top = 114 + Width = 150 + Height = 21 + end + object lblTreeLinesColor: TLabel + Left = 10 + Top = 118 + Width = 78 + Height = 13 + Caption = 'TreeLines Color:' + end + object gbxTransparent: TGroupBox + Left = 5 + Top = 13 + Width = 247 + Height = 59 + Caption = ' ' + TabOrder = 1 + object lblColor: TLabel + Left = 6 + Top = 24 + Width = 32 + Height = 13 + Caption = 'Co&lor: ' + OnClick = lblColorClick + end + object bvlColorHost: TBevel + Left = 86 + Top = 20 + Width = 150 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 18 + Top = 11 + Width = 15 + Height = 17 + TabOrder = 0 + OnClick = chbxTransparentClick + end + object stTransparent: TStaticText + Left = 33 + Top = 12 + Width = 76 + Height = 17 + Caption = ' &Transparent ' + FocusControl = chbxTransparent + TabOrder = 2 + OnClick = stTransparentClick + end + end + end + object tshFonts: TTabSheet + Caption = '&Font' + object pnlFont: TPanel + Left = 0 + Top = 0 + Width = 566 + Height = 212 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object btnFont: TButton + Left = 8 + Top = 16 + Width = 110 + Height = 23 + Caption = 'Fo&nt ...' + TabOrder = 0 + OnClick = btnFontClick + end + object edFont: TEdit + Left = 8 + Top = 47 + Width = 235 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + Text = 'edFont' + end + end + end + object tshBehaviors: TTabSheet + Caption = '&Behaviors' + object pnlBehaviors: TPanel + Left = 0 + Top = 0 + Width = 566 + Height = 212 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblExpanding: TLabel + Left = 5 + Top = 12 + Width = 50 + Height = 13 + Caption = 'Expanding' + end + object Bevel13: TBevel + Left = 65 + Top = 17 + Width = 173 + Height = 4 + Shape = bsBottomLine + end + object bvlExpandLevelHolder: TBevel + Left = 163 + Top = 61 + Width = 69 + Height = 21 + Visible = False + end + object lblExpandLevel: TLabel + Left = 89 + Top = 65 + Width = 71 + Height = 13 + Caption = 'Expand &level : ' + OnClick = lblExpandLevelClick + end + object Image4: TImage + Left = 7 + Top = 40 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 7778800000000000000000000000078888888888880000000000000000000000 + 007880FFF7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7FF777777FFF77777FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F8F7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7F7F8888FF7F88888FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F8F7777777777777777777078888888888880F7F7F888FFF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F0788077777777777777777777770788C8888C88880F7FF888888FFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880F0F7777777FFFFFFFFFFFF0788CCCCCCCC880F77777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7F7F8888FF7F88888FF7 + F0788077777777777777777777770788C8888C88880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F7F7F8888FF7F888888F7 + F0788077777777777777777777770788CCCC8CC8880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCCCCCC880F7FF88888FFFFFFFFFFF7 + F07880F0F777777FFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F77777777777777777777 + F078800000000000000000000000078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F888888880F88888888888078888888888880F77777777777777777777 + F07880F877778880F87777777778078888888888880F77777777777777777777 + F07880FFFFFFFFF0FFFFFFFFFFFF078888888888880FFFFFFFFFFFFFFFFFFFFF + F078800000000000000000000000088888888888880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object Bevel1: TBevel + Left = 81 + Top = 99 + Width = 157 + Height = 4 + Shape = bsBottomLine + end + object lblMiscellaneous: TLabel + Left = 6 + Top = 94 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + end + object Image5: TImage + Left = 7 + Top = 121 + Width = 32 + Height = 32 + Picture.Data = { + 055449636F6E0000010003001010000000000000680500003600000020200000 + 00000000A80800009E0500003030000000000000A80E0000460E000028000000 + 1000000020000000010008000000000040010000000000000000000000010000 + 00000000FFFFFF00000080000080800080800000C0C0C000C0DCC000F0CAA600 + 4080800040400000FF800000804000000040800080FFFF00FFFF8000FF808000 + 4080FF0081818100000081000081810081810000000033000000660000009900 + 0000CC0000333300003366000033FF000066CC000066FF000099FF0000CCCC00 + 3300330033006600330099003300CC0033330000333333003333660033339900 + 3333CC003333FF00336666003366990074CAFF003366FF003399000033993300 + 33996600339999003399CC003399FF0033CC330033CC990033CCCC0033CCFF00 + 33FFFF0066000000663300006633330066336600663399006633FF0066660000 + 6666330066666600666699006666CC0066990000669933006699660066999900 + 6699CC006699FF0066CC330066CC990066CCCC004CCEFF0066FF330066FFCC00 + 999900009933990099333300996600009966330099336600996699009966CC00 + 9999330099996600999999009999CC009999FF0099CC000099CC330066CC6600 + 99CC990099CCCC0099CCFF0099CC660099FF990099FFFF00CC009900CC333300 + CC336600CC339900CC660000CC66330099666600CC669900CC66CC00CC990000 + CC993300CC996600CC999900CC99CC00CC99FF00CCCC0000CCCC3300CCCC6600 + CCCC9900CCCCCC00CCCCFF00CCFF0000CCFF330099FF6600CCFF9900CCFFCC00 + CCFFFF00FF333300FF336600FF660000FF663300CC666600FF669900FF66CC00 + FF990000FF993300FF996600FF999900FF99CC00FF99FF00FFCC0000FFCC3300 + FFCC6600FFCC9900FFCCCC00FFCCFF00FFFF3300FFFF9900FFFFCC006666FF00 + 66FFFF00FFFF6600C1C1C1005F5F5F00777777008686860096969600CBCBCB00 + B2B2B200D7D7D700DDDDDD00E3E3E300EAEAEA00F1F1F100F8F8F800F0FBFF00 + A4A0A000808080000000FF0000FF0000FF00FF00FFFF00007AE9FF007D780000 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 00000000FFFFFFFFFFFFFFFF9B40FFFFFFFFFFFFFFFFFFFF9B9AFFFF4747FFFF + 9C40FFFFFF242424A7309A6B36369A9C3607FFFFFF789C9C4B36313636363636 + 36FFFFFFFFA2A09A9A4736364B290736079A9AFFFFA2A04B363636614B022936 + 363636FFFFA2A0A0613536644B02293624FFFFFFFFA2409F463636644B022936 + 0724FFFFFFA2409F0061780C4B02294636FFFFFFFFA2404040A078640C4B2924 + FFFFFFFFFFA2A0A0A0A09F9F4A789B24FFFFFFFFFFA2409F00A0787878789B24 + FFFFFFFFFFA2409F00A09F9F9F789B24FFFFFFFFFFA2404040A0787878789B24 + FFFFFFFFFFA2A0A0A0A0A0A0A0A09B24FFFFFFFFFFA2A2A2A2A2A2A2A2A2A29A + FFFFFFFFFF3FFFFFF333FFFF8003FFFF8007FFFF8001FFFF8001FFFF8007FFFF + 8003FFFF8007FFFF800FFFFF800FFFFF800FFFFF800FFFFF800FFFFF800FFFFF + 800FFFFF28000000200000004000000001000800000000008004000000000000 + 000000000001000000000000FFFFFF00000080000080800080800000C0C0C000 + C0DCC000F0CAA6004080800040400000FF800000804000000040800080FFFF00 + FFFF8000FF8080004080FF008181810000008100008181008181000000003300 + 00006600000099000000CC0000333300003366000033FF000066CC000066FF00 + 0099FF0000CCCC003300330033006600330099003300CC003333000033333300 + 33336600333399003333CC003333FF00336666003366990074CAFF003366FF00 + 339900003399330033996600339999003399CC003399FF0033CC330033CC9900 + 33CCCC0033CCFF0033FFFF006600000066330000663333006633660066339900 + 6633FF00666600006666330066666600666699006666CC006699000066993300 + 66996600669999006699CC006699FF0066CC330066CC990066CCCC004CCEFF00 + 66FF330066FFCC00999900009933990099333300996600009966330099336600 + 996699009966CC009999330099996600999999009999CC009999FF0099CC0000 + 99CC330066CC660099CC990099CCCC0099CCFF0099CC660099FF990099FFFF00 + CC009900CC333300CC336600CC339900CC660000CC66330099666600CC669900 + CC66CC00CC990000CC993300CC996600CC999900CC99CC00CC99FF00CCCC0000 + CCCC3300CCCC6600CCCC9900CCCCCC00CCCCFF00CCFF0000CCFF330099FF6600 + CCFF9900CCFFCC00CCFFFF00FF333300FF336600FF660000FF663300CC666600 + FF669900FF66CC00FF990000FF993300FF996600FF999900FF99CC00FF99FF00 + FFCC0000FFCC3300FFCC6600FFCC9900FFCCCC00FFCCFF00FFFF3300FFFF9900 + FFFFCC006666FF0066FFFF00FFFF6600C1C1C1005F5F5F007777770086868600 + 96969600CBCBCB00B2B2B200D7D7D700DDDDDD00E3E3E300EAEAEA00F1F1F100 + F8F8F800F0FBFF00A4A0A000808080000000FF0000FF0000FF00FF00FFFF0000 + 7AE9FF007D7800007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F0000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF409C40 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9B9AFFFFFF9B469B + FFFFFF9B4040FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D9B9A9AFFFF473647 + FFFF9B9D9B9A9AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D079A409A9B473647 + 9A9A9BA707079AFFFFFFFFFFFFFFFFFFFFFF24242424244B363107409B343647 + 9A404631353646FFFFFFFFFFFFFFFFFFFFFF789C9C9C9C4B3636363636363636 + 3636363635FFFFFFFFFFFFFFFFFFFFFFFFFFA1A09C409A9A4736363661616161 + 4C363635409A9AFFFFFFFFFFFFFFFFFFFFFFA1A040409A404636364C4B460229 + 4C363635409A9A9AFFFFFFFFFFFFFFFFFFFFA1A04C47303031364C644C4B3002 + 074C363636363635FFFFFFFFFFFFFFFFFFFFA1A0A061363636364C644C4B3002 + 29313636074747FFFFFFFFFFFFFFFFFFFFFFA140A1A3A007303636644C4B3002 + 2936362924FFFFFFFFFFFFFFFFFFFFFFFFFFA1409FA20430353636644C4B3002 + 293636302924FFFFFFFFFFFFFFFFFFFFFFFFA1409F00A261364C60644C4B3002 + 294C35363607FFFFFFFFFFFFFFFFFFFFFFFFA1409F0000A16104A0644C4B3002 + 299A476135FFFFFFFFFFFFFFFFFFFFFFFFFFA1404040404004A0A06461644B30 + 079A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0A0A0A0A0A078640C644B + 469A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0A0A0A0A0A078A04A4A4A + A09A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA140A1A2A1A1A2A0A07878787878 + 789A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1409F04A700A2A0A09F9F9F9F9F + 789A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1409FA7009DA2A0A07878787878 + 789A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1409FA0A0A0A2A0A09F9F9F9F9F + 789A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA140404040409CA0A07878787878 + 789A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0A0A0A0A0A0A0A0A0A0A0 + A09A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA2A2A2A2A2A2A2A2A2A2A2A2A2A2 + A2A19AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8FFFFFF38E3F + FFE18C1FFFE0001FFC00001FFC00007FFC00001FFC00000FFC00000FFC00001F + FC00007FFC00003FFC00003FFC00007FFC0001FFFC0001FFFC0001FFFC0001FF + FC0001FFFC0001FFFC0001FFFC0001FFFC0001FFFC0001FFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFF2800000030000000600000000100080000000000 + 800A000000000000000000000001000000000000FFFFFF000000800000808000 + 80800000C0C0C000C0DCC000F0CAA6004080800040400000FF80000080400000 + 0040800080FFFF00FFFF8000FF8080004080FF00818181000000810000818100 + 818100000000330000006600000099000000CC0000333300003366000033FF00 + 0066CC000066FF000099FF0000CCCC003300330033006600330099003300CC00 + 333300003333330033336600333399003333CC003333FF003366660033669900 + 74CAFF003366FF00339900003399330033996600339999003399CC003399FF00 + 33CC330033CC990033CCCC0033CCFF0033FFFF00660000006633000066333300 + 66336600663399006633FF00666600006666330066666600666699006666CC00 + 669900006699330066996600669999006699CC006699FF0066CC330066CC9900 + 66CCCC004CCEFF0066FF330066FFCC0099990000993399009933330099660000 + 9966330099336600996699009966CC009999330099996600999999009999CC00 + 9999FF0099CC000099CC330066CC660099CC990099CCCC0099CCFF0099CC6600 + 99FF990099FFFF00CC009900CC333300CC336600CC339900CC660000CC663300 + 99666600CC669900CC66CC00CC990000CC993300CC996600CC999900CC99CC00 + CC99FF00CCCC0000CCCC3300CCCC6600CCCC9900CCCCCC00CCCCFF00CCFF0000 + CCFF330099FF6600CCFF9900CCFFCC00CCFFFF00FF333300FF336600FF660000 + FF663300CC666600FF669900FF66CC00FF990000FF993300FF996600FF999900 + FF99CC00FF99FF00FFCC0000FFCC3300FFCC6600FFCC9900FFCCCC00FFCCFF00 + FFFF3300FFFF9900FFFFCC006666FF0066FFFF00FFFF6600C1C1C1005F5F5F00 + 777777008686860096969600CBCBCB00B2B2B200D7D7D700DDDDDD00E3E3E300 + EAEAEA00F1F1F100F8F8F800F0FBFF00A4A0A000808080000000FF0000FF0000 + FF00FF00FFFF00007AE9FF007D7800007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F0000000000FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF409B9B + 40FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFF9B9B9B9BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9C9B9AFFFFFFFF9B4646 + 9BFFFFFFFF9B4040FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFA79D9B9A9AFFFFFF47363647FFFFFF9B9D9B409AFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA79D079A9A9A409B473636 + 479A9A9B9D9D07079AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF24 + 2424242424A73636309A9A409B463636479A9A9B9D46353607FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF789C9C9C9C9C4B36363631400746353636 + 479A9A073536363546FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0A0A0A79D9D4C36363636363636363636363636363635FFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A09C409A9A9A473636363661616161 + 614C36363635409A9A9AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0789B409A9A9A46363636614C460202294C363636359A9A9A9A9AFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A047463030303136364C614B4B3030 + 02074C3636363030303030FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0A04C4C3636363636364C644C4B30300229313636363636363636FFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0616161616136364C0C4C4B3030 + 02293636363607474747FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A09BA3A3A3A00730363636974C4B303002293636362924FFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A09B9FA2A2040707363636974C4B3030 + 0229363636302424FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A09B9F000078303636364C0C4C4B303002294C4C36360724FFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A09B9F0000A24C364C60780C4C4B3030 + 02299B4736363607FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A09B9F000000A16178A0780C4C4B303002299B24476135FFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A09B9B9B9B9B9B04A0A078644C64604B + 30299B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0A0A0A0A0A0A0A0A0A078647F0C4C4E4B079B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0A0A0A0A0A0A0A07805640C0C4B + 4B469B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0A0A0A0A0A0A0A0A0A07878784A4A4A4A789B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A040A2A2A2A2A2A2A0A0787878787878 + 78789B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0409F009D00A1A2A0A078787878787878789B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0409F9D789DA1A2A0A09F9F9F9F9F9F + 9F789B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0409F00009DA1A2A0A078787878787878789B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0409FA0A0A0A0A2A0A09F9F9F9F9F9F + 9F789B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A04040404040409CA0A078787878787878789B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0A0A0A0A0A0A0A0787878787878 + 78789B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A09B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2 + A2A2A29AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF87FFFFFFFFFFFFFF87FFFFFFFFFFFFC787 + 8FFFFFFFFFFF838707FFFFFFFFFF800007FFFFFFFFE0000007FFFFFFFFE00000 + 07FFFFFFFFE000001FFFFFFFFFE0000003FFFFFFFFE0000001FFFFFFFFE00000 + 01FFFFFFFFE0000001FFFFFFFFE0000003FFFFFFFFE000001FFFFFFFFFE00000 + 0FFFFFFFFFE000000FFFFFFFFFE000000FFFFFFFFFE000001FFFFFFFFFE00000 + FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000 + FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000 + FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + end + object chbxAutoNodesExpand: TCheckBox + Left = 88 + Top = 37 + Width = 154 + Height = 17 + Caption = '&Auto Node Expanded' + TabOrder = 0 + OnClick = chbxAutoNodesExpandClick + end + object chbxNodeAutoHeight: TCheckBox + Left = 88 + Top = 140 + Width = 111 + Height = 17 + Caption = '&Node Auto Height' + TabOrder = 1 + OnClick = chbxNodeAutoHeightClick + end + object chbxAutoWidth: TCheckBox + Left = 88 + Top = 117 + Width = 97 + Height = 17 + Caption = 'Auto &Width' + TabOrder = 2 + OnClick = chbxAutoWidthClick + end + end + end + end + object pnlPreview: TPanel + Left = 272 + Top = 46 + Width = 295 + Height = 185 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + end + object ilPreview: TImageList + Left = 5 + Top = 247 + Bitmap = { + 494C010102000500040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000002000000001002000000000000020 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000084000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008484840000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000840000008400000084000000FF000000840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000848484008484840084848400C6C6C60084848400000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000084 + 000000840000FFFFFF0000FF0000FFFFFF0000FF000000840000008400000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 840084848400FFFFFF00C6C6C600FFFFFF00C6C6C60084848400848484000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 0000FFFFFF0000FF0000FFFFFF0000FF000000FF000000840000008400000084 + 000000000000000000000000000000000000000000000000000084848400C6C6 + C600FFFFFF00C6C6C600FFFFFF00C6C6C600C6C6C60084848400848484008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF0000FF0000FFFFFF0000FF0000FFFFFF0000FF000000840000008400000084 + 000000840000000000000000000000000000000000000000000084848400FFFF + FF00C6C6C600FFFFFF00C6C6C600FFFFFF00C6C6C60084848400848484008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 0000FFFFFF00FFFFFF0000FF000000FF000000FF000000840000008400000084 + 000000840000000000000000000000000000000000000000000084848400C6C6 + C600FFFFFF00FFFFFF00C6C6C600C6C6C600C6C6C60084848400848484008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF0000FF000000FF000000FF000000FF000000FF000000FF0000008400000084 + 000000840000000000000000000000000000000000000000000084848400FFFF + FF00C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600848484008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF00000084 + 000000840000000000000000000000000000000000000000000084848400C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF00000084 + 000000840000000000000000000000000000000000000000000084848400C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000084 + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF + 0000008400000084000000000000000000000000000000000000000000008484 + 8400C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6 + C600848484008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000084000000FF000000FF000000FF000000FF000000FF0000008400000084 + 0000000000000000000000000000000000000000000000000000000000000000 + 000084848400C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600848484008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000084000000FF000000FF00000084000000840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000084848400C6C6C600C6C6C6008484840084848400000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000840000008400000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084848400848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFF00000000FFFFFFFF00000000 + FF3FFF3F00000000F81FF81F00000000E00FE00F00000000C007C00700000000 + C003C00300000000C003C00300000000C003C00300000000C003C00300000000 + C003C00300000000E003E00300000000F00FF00F00000000F83FF83F00000000 + FCFFFCFF00000000FFFFFFFF0000000000000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSTVLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSTVLnk.pas new file mode 100644 index 00000000..3ed55d71 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSTVLnk.pas @@ -0,0 +1,2028 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSTVLnk; + +interface + +{$I cxVer.inc} + +uses + Classes, Windows, Messages, Graphics, Controls, Forms, Dialogs, StdCtrls, + ImgList, CommCtrl, ExtCtrls, ComCtrls, {$IFDEF REGISTERSHELLCTRLS}ShellCtrls, {$ENDIF} + dxPSCore, dxPSGlbl, dxPSRes; + +type + TdxfmTVReportLinkDesignWindow = class; + + TdxTreeViewPaintOption = (tvpoBorder, tvpoGrid, tvpoStateImages, tvpoImages, tvpoTreeLines, tvpoButtons); + TdxTreeViewPaintOptions = set of TdxTreeViewPaintOption; + + TCustomdxNativeTreeViewReportLink = class(TBasedxReportLink, IdxPSNativeWin32ControlHandleSupport) + private + FActualWidth: Integer; + FAutoNodesExpand: Boolean; + FAutoWidth: Boolean; + FExpandLevel: Integer; + FExplicitTreeViewExpand: Boolean; + FGridLineColor: TColor; + FImages: TCustomImageList; + FIsWidthAssigned: Boolean; + FNodeAutoHeight: Boolean; + FOptions: TdxTreeViewPaintOptions; + FStateImages: TCustomImageList; + FTreeLineColor: TColor; + FWidth: Integer; + function GetOptions: TdxTreeViewPaintOptions; + function GetWidth: Integer; + function IsWidthStored: Boolean; + procedure SetAutoNodesExpand(Value: Boolean); + procedure SetAutoWidth(Value: Boolean); + procedure SetExpandLevel(Value: Integer); + procedure SetExplicitTreeViewExpand(Value: Boolean); + procedure SetGridLineColor(Value: TColor); + procedure SetNodeAutoHeight(Value: Boolean); + procedure SetOptions(Value: TdxTreeViewPaintOptions); + procedure SetTreeLineColor(Value: TColor); + procedure SetWidth(Value: Integer); + + procedure CalcNodesHeight; + function CanDrawImages: Boolean; + function CanDrawStateImages: Boolean; + function GetCellSides(ANode: HTREEITEM): TdxCellSides; + function GetNodeHeight(Index: Integer): Integer; + function IsDrawBorder: Boolean; + function IsDrawGrid: Boolean; + function IsDrawNodeImages(ANode: HTREEITEM): Boolean; + function IsDrawNodeStateImages(ANode: HTREEITEM): Boolean; + function IsFirstNode(ANode: HTREEITEM): Boolean; + function IsLastNode(ANode: HTREEITEM): Boolean; + function IsValidNodeImageIndex(ANode: HTREEITEM): Boolean; + function IsValidNodeStateIndex(ANode: HTREEITEM): Boolean; + protected + FIndent: Integer; + FNodeHeight: Integer; + FNodeHeights: TList; + FNodeList: TList; + FScreenDC: HDC; + + procedure AssignData(ANode: HTREEITEM; ADataItem: TAbstractdxReportCellData); virtual; + procedure ConstructReport(AReportCells: TdxReportCells); override; + procedure GetImageLists(AProc: TdxPSGetImageListProc); override; + procedure InitializeItem(ANode: HTREEITEM; ADataItem: TAbstractdxReportCellData); virtual; + procedure InternalRestoreDefaults; override; + procedure MakeDelimiters(AReportCells: TdxReportCells; AHorzDelimiters, + AVertDelimiters: TList); override; + procedure PrepareContruct; virtual; + procedure UnprepareContruct; virtual; + + function CheckImages: Boolean; + function CheckStateImages: Boolean; + procedure ClearImages; virtual; + procedure CreateImages; virtual; + procedure DeleteImages; virtual; + function GetImages: TCustomImageList; virtual; + function GetStateImages: TCustomImageList; virtual; + function HasImages: Boolean; virtual; + function HasStateImages: Boolean; virtual; + + function GetDataClass(ANode: HTREEITEM): TdxReportCellDataClass; virtual; + function GetTreeViewHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; virtual; abstract; + procedure SetTreeViewHandle(Value: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}); virtual; abstract; + procedure DoExplicitTreeViewExpand(ALevel: Integer = -1); virtual; + + { IdxPSNativeWin32ControlHandleSupport } + function GetNativeHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; virtual; + procedure SetNativeHandle(Value: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}); virtual; + + { TreeView native access helpers } + function TV_IsNodeExpanded(AItem: HTREEITEM): Boolean; + function TV_IsNodeParentExists(AItem: HTREEITEM): Boolean; + function TV_IsNodeFirstChild(AItem: HTREEITEM): Boolean; + function TV_IsNodeLastChild(AItem: HTREEITEM): Boolean; + function TV_IsShowButtons: Boolean; + function TV_IsShowLines: Boolean; + function TV_IsShowRoot: Boolean; + function TV_GetNodeCount(AItem: HTREEITEM): Integer; + function TV_GetNodeHasChildren(AItem: HTREEITEM): Boolean; + function TV_GetNodeImageIndex(AItem: HTREEITEM): Integer; + function TV_GetNodeLevel(AItem: HTREEITEM): Integer; + function TV_GetNodeParent(AItem: HTREEITEM): HTREEITEM; + function TV_GetNodeParentAtLevel(AItem: HTREEITEM; ALevel: Integer): HTREEITEM; + function TV_GetNodeStateIndex(AItem: HTREEITEM): Integer; + function TV_GetNodeText(AItem: HTREEITEM): string; + + property Images: TCustomImageList read GetImages; + property StateImages: TCustomImageList read GetStateImages; + property TreeViewHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF} read GetTreeViewHandle write SetTreeViewHandle; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + class function Aggregable: Boolean; override; + function DefaultWidth: Integer; virtual; + procedure Initialize; override; + + property AutoNodesExpand: Boolean read FAutoNodesExpand write SetAutoNodesExpand default False; + property AutoWidth: Boolean read FAutoWidth write SetAutoWidth default True; + property Color; + property ExpandLevel: Integer read FExpandLevel write SetExpandLevel default -1; + property ExplicitTreeViewExpand: Boolean read FExplicitTreeViewExpand write SetExplicitTreeViewExpand default False; + property Font; + property GridLineColor: TColor read FGridLineColor write SetGridLineColor default clBlack; + property Options: TdxTreeViewPaintOptions read GetOptions write SetOptions + default [tvpoStateImages, tvpoImages, tvpoTreeLines, tvpoButtons]; + property NodeAutoHeight: Boolean read FNodeAutoHeight write SetNodeAutoHeight default False; + property ScaleFonts; + property Transparent; + property TreeLineColor: TColor read FTreeLineColor write SetTreeLineColor default clGray; + property Width: Integer read GetWidth write SetWidth stored IsWidthStored; + end; + + TdxNativeTreeViewReportLink = class(TCustomdxNativeTreeViewReportLink) + private + FTreeViewHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; + protected + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + + function GetDesignerClass: TdxReportLinkDesignWindowClass; override; + + function GetTreeViewHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; override; + procedure SetTreeViewHandle(Value: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}); override; + public + function DataProviderPresent: Boolean; override; + property TreeViewHandle; + published + property AutoNodesExpand; + property AutoWidth; + property Color; + property ExpandLevel; + property ExplicitTreeViewExpand; + property Font; + property GridLineColor; + property Options; + property NodeAutoHeight; + property ScaleFonts; + property Transparent; + property TreeLineColor; + property UseVertDelimiters; + property Width; + end; + + TdxTVInitializeNodeEvent = procedure(Sender: TBasedxReportLink; ANode: TTreeNode; + AnItem: TdxReportCellString) of object; + + TdxTVCustomDrawNodeEvent = procedure(Sender: TBasedxReportLink; ANode: TTreeNode; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var AText: string; + AFont: TFont; var AColor: TColor; var ATextAlignX: TdxTextAlignX; + var ATextAlignY: TdxTextAlignY; var ADone: Boolean) of object; + + TCustomdxTreeViewReportLink = class(TCustomdxNativeTreeViewReportLink) + private + FCustomDrawFontChanged: Boolean; + FSaveFont: TFont; + FSupportedCustomDraw: Boolean; + FOnCustomDrawNode: TdxTVCustomDrawNodeEvent; + FOnInitializeNode: TdxTVInitializeNodeEvent; + procedure SetSupportedCustomDraw(Value: Boolean); + procedure CustomDrawFontChanged(Sender: TObject); + protected + procedure InitializeItem(ANode: HTREEITEM; ADataItem: TAbstractdxReportCellData); override; + procedure InternalRestoreDefaults; override; + function IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; override; + + function GetImages: TCustomImageList; override; + function GetStateImages: TCustomImageList; override; + + function GetCustomTreeView: TCustomTreeView; virtual; + function GetTreeViewHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; override; + procedure SetTreeViewHandle(Value: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}); override; + + procedure CustomDraw(AItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); override; + procedure DoCustomDrawNode(ANode: TTreeNode; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var AText: string; AFont: TFont; + var AColor: TColor; var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean); virtual; + procedure DoInitializeNode(ANode: TTreeNode; AnItem: TAbstractdxReportCellData); dynamic; + + property CustomTreeView: TCustomTreeView read GetCustomTreeView; + property OnCustomDrawNode: TdxTVCustomDrawNodeEvent read FOnCustomDrawNode write FOnCustomDrawNode; + property OnInitializeNode: TdxTVInitializeNodeEvent read FOnInitializeNode write FOnInitializeNode; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + class function Aggregable: Boolean; override; + + property SupportedCustomDraw: Boolean read FSupportedCustomDraw write SetSupportedCustomDraw default False; + end; + + TdxTreeViewReportLink = class(TCustomdxTreeViewReportLink) + private + function GetTreeView: TTreeView; + public + property TreeView: TTreeView read GetTreeView; + published + property AutoNodesExpand; + property AutoWidth; + property Color; + property ExpandLevel; + property ExplicitTreeViewExpand; + property Font; + property GridLineColor; + property Options; + property ScaleFonts; + property SupportedCustomDraw; + property Transparent; + property TreeLineColor; + property UseVertDelimiters; + property Width; + + property OnCustomDrawNode; + property OnInitializeNode; + end; + + {$IFDEF REGISTERSHELLCTRLS} + + TCustomdxShellTreeViewReportLink = class(TCustomdxTreeViewReportLink) + private + function GetShellTreeView: TShellTreeView; + protected + procedure CreateImages; override; + procedure DeleteImages; override; + function GetImages: TCustomImageList; override; + function GetStateImages: TCustomImageList; override; + function HasStateImages: Boolean; override; + + property ShellTreeView: TShellTreeView read GetShellTreeView; + end; + + TdxShellTreeViewReportLink = class(TCustomdxShellTreeViewReportLink) + public + property ShellTreeView; + published + property AutoNodesExpand; + property AutoWidth; + property Color; + property ExpandLevel; + property ExplicitTreeViewExpand; + property Font; + property GridLineColor; + property Options; + property ScaleFonts; + property SupportedCustomDraw; + property Transparent; + property TreeLineColor; + property UseVertDelimiters; + property Width; + + property OnCustomDrawNode; + property OnInitializeNode; + end; + + {$ENDIF} + + TdxfmTVReportLinkDesignWindow = class(TStandarddxReportLinkDesignWindow) + PageControl1: TPageControl; + tshOptions: TTabSheet; + pnlOptions: TPanel; + tshColors: TTabSheet; + pnlColor: TPanel; + lblGridLinesColor: TLabel; + bvlGridLineColorHost: TBevel; + gbxTransparent: TGroupBox; + lblColor: TLabel; + bvlColorHost: TBevel; + chbxTransparent: TCheckBox; + tshFonts: TTabSheet; + pnlFont: TPanel; + btnFont: TButton; + edFont: TEdit; + pnlPreview: TPanel; + ilPreview: TImageList; + lblShow: TLabel; + chbxShowBorders: TCheckBox; + Bevel11: TBevel; + chbxShowGrid: TCheckBox; + chbxShowStateImages: TCheckBox; + chbxShowImages: TCheckBox; + tshBehaviors: TTabSheet; + pnlBehaviors: TPanel; + lblExpanding: TLabel; + Bevel13: TBevel; + chbxAutoNodesExpand: TCheckBox; + bvlExpandLevelHolder: TBevel; + lblExpandLevel: TLabel; + Image4: TImage; + imgGrid: TImage; + chbxShowTreeLines: TCheckBox; + bvlTreeLineColorHost: TBevel; + lblTreeLinesColor: TLabel; + chbxShowButtons: TCheckBox; + Bevel1: TBevel; + lblMiscellaneous: TLabel; + Image5: TImage; + chbxNodeAutoHeight: TCheckBox; + chbxAutoWidth: TCheckBox; + Bevel2: TBevel; + Bevel3: TBevel; + lblPreview: TStaticText; + stTransparent: TStaticText; + procedure btnFontClick(Sender: TObject); + procedure chbxTransparentClick(Sender: TObject); + procedure lblExpandLevelClick(Sender: TObject); + procedure lblColorClick(Sender: TObject); + procedure chbxAutoNodesExpandClick(Sender: TObject); + procedure chbxNodeAutoHeightClick(Sender: TObject); + procedure chbxShowClick(Sender: TObject); + procedure chbxAutoWidthClick(Sender: TObject); + procedure PageControl1Change(Sender: TObject); + procedure stTransparentClick(Sender: TObject); + private + FccbxColor: TCustomComboBox; + FccbxGridLineColor: TCustomComboBox; + FccbxTreeLineColor: TCustomComboBox; + FseExpandLevel: TCustomEdit; + FPreviewBox: TCustomControl; + FPreviewFont: TFont; + procedure ccbxColorChange(Sender: TObject); + procedure CreateControls; + procedure ExpandLevelChange(Sender: TObject); + function GetReportLink: TCustomdxNativeTreeViewReportLink; + procedure pbxPreviewPaint(Sender: TObject); + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + protected + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + procedure LoadStrings; override; + procedure PaintPreview(ACanvas: TCanvas; R: TRect); override; + procedure UpdateControlsState; override; + procedure UpdatePreview; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property ReportLink: TCustomdxNativeTreeViewReportLink read GetReportLink; + end; + +const + dxDefaultTreeViewPaintOptions: TdxTreeViewPaintOptions = + [tvpoStateImages, tvpoImages, tvpoTreeLines, tvpoButtons]; + +implementation + +{$R *.DFM} + +uses + ClipBrd, SysUtils, cxClasses, dxPrnDev, dxPSUtl, dxExtCtrls; + +const + dxDefaultTVLinkWidth = 400; + +type + TCustomTreeViewAccess = class(TCustomTreeView); + +{ TreeView Helpers } + +function TreeViewGetImages(AControl: TCustomTreeView): TCustomImageList; +begin + Result := TCustomTreeViewAccess(AControl).Images; +end; + +function TreeViewGetItems(AControl: TCustomTreeView): TTreeNodes; +begin + Result := TCustomTreeViewAccess(AControl).Items; +end; + +function TreeViewGetStateImages(AControl: TCustomTreeView): TCustomImageList; +begin + Result := TCustomTreeViewAccess(AControl).StateImages; +end; + +{ Utilities } + +function GetDesignerString(AnIndex: Integer): string; +begin + case AnIndex of + 0: Result := cxGetResourceString(@sdxTechnicalDepartment); + 1: Result := cxGetResourceString(@sdxSoftwareDepartment); + 2: Result := cxGetResourceString(@sdxSystemProgrammers); + 3: Result := cxGetResourceString(@sdxEndUserProgrammers); + 4: Result := cxGetResourceString(@sdxBetaTesters); + else + Result := cxGetResourceString(@sdxHumanResourceDepartment); + end; +end; + +{ TCustomdxNativeTreeViewReportLink } + +constructor TCustomdxNativeTreeViewReportLink.Create(AOwner: TComponent); +begin + inherited; + InternalRestoreDefaults; + LinkModified(False); + FNodeList := TList.Create; + CreateImages; +end; + +destructor TCustomdxNativeTreeViewReportLink.Destroy; +begin + DeleteImages; + FreeAndNil(FNodeList); + inherited; +end; + +procedure TCustomdxNativeTreeViewReportLink.Assign(Source: TPersistent); +begin + if Source is TCustomdxNativeTreeViewReportLink then + with TCustomdxNativeTreeViewReportLink(Source) do + begin + Self.FIsWidthAssigned := FIsWidthAssigned; + Self.AutoNodesExpand := AutoNodesExpand; + Self.AutoWidth := AutoWidth; + Self.ExpandLevel := ExpandLevel; + Self.ExplicitTreeViewExpand := ExplicitTreeViewExpand; + Self.GridLineColor := GridLineColor; + Self.Options := Options; + Self.TreeLineColor := TreeLineColor; + Self.Width := Width; + end; + inherited; +end; + +class function TCustomdxNativeTreeViewReportLink.Aggregable: Boolean; +begin + Result := True; +end; + +function TCustomdxNativeTreeViewReportLink.DefaultWidth: Integer; +begin + Result := dxDefaultTVLinkWidth; +end; + +procedure TCustomdxNativeTreeViewReportLink.Initialize; +begin + inherited; + FreeAndNil(FNodeHeights); +end; + +procedure TCustomdxNativeTreeViewReportLink.AssignData(ANode: HTREEITEM; + ADataItem: TAbstractdxReportCellData); +begin + ADataItem.Data := Integer(ANode); + ADataItem.CellSides := GetCellSides(ANode); + ADataItem.Transparent := True; + TdxReportCellString(ADataItem).Text := TV_GetNodeText(ANode); + TdxReportCellString(ADataItem).Multiline := NodeAutoHeight and not AutoWidth; +end; + +procedure TCustomdxNativeTreeViewReportLink.ConstructReport(AReportCells: TdxReportCells); + + procedure InsertNodeIndent(AParentCell: TdxReportCell; ANode: HTREEITEM; var ALeftOffset: Integer); + + function GetIndentShowButton(AtLevel: Integer; ANode: HTREEITEM): Boolean; + begin + Result := (tvpoButtons in Options) and (TV_GetNodeParentAtLevel(ANode, AtLevel) = ANode) and + TV_GetNodeHasChildren(ANode); + end; + + function GetIndentButtonExpanded(ANode: HTREEITEM): Boolean; + begin + if AutoNodesExpand then + if ExplicitTreeViewExpand then + Result := TV_IsNodeExpanded(ANode) and ((ExpandLevel = -1) or (ExpandLevel > TV_GetNodeLevel(ANode))) + else + Result := TV_GetNodeCount(ANode) <> 0 + else + Result := TV_IsNodeExpanded(ANode); + end; + + function GetIndentTreeLineMode(AtLevel: Integer; ANode: HTREEITEM): TdxPSTreeLineMode; + var + Parent: HTREEITEM; + begin + if tvpoTreeLines in Options then + begin + Parent := TV_GetNodeParentAtLevel(ANode, AtLevel); + if Parent = ANode then + if TV_IsNodeLastChild(ANode) then + Result := tlmBottomRightCorner + else + if not TV_IsNodeParentExists(ANode) and TV_IsNodeFirstChild(ANode) then + Result := tlmTopRightCorner + else + Result := tlmCross + else + if TV_IsNodeLastChild(Parent) then + Result := tlmNone + else + Result := tlmVertical; + end + else + Result := tlmNone + end; + + function GetIndentCellSides(I, ALevel: Integer; ANode: HTREEITEM): TdxCellSides; + begin + Result := []; + if IsDrawGrid then + begin + if (I <> 0) or IsDrawBorder then + Include(Result, csLeft); + if I <> 0 then + Include(Result, csRight); + +{2.0} if (I = ALevel) or (not TV_IsNodeParentExists(ANode) and (not IsFirstNode(ANode) or IsDrawBorder)) then + Include(Result, csTop); + + if (TV_GetNodeCount(ANode) = 0) or (not TV_IsNodeExpanded(ANode) and not AutoNodesExpand) then + begin + if I = ALevel then + begin + if not IsFirstNode(ANode) or IsDrawBorder then + Include(Result, csTop); + if not IsLastNode(ANode) or IsDrawBorder then + Include(Result, csBottom); + end + else + if TV_IsNodeLastChild(ANode) then + Include(Result, csBottom); + end; + end; + if IsDrawBorder then + begin + if I = 0 then + Include(Result, csLeft); + if IsFirstNode(ANode) then + Include(Result, csTop); + if IsLastNode(ANode) then + Include(Result, csBottom); + end; + end; + + var + MaxLevel, I: Integer; + begin + MaxLevel := TV_GetNodeLevel(ANode) - Ord(not TV_IsShowRoot); + for I := 0 to MaxLevel do + begin + with TdxReportCellExpandButton.Create(AParentCell) do + begin + BoundsRect := MakeBounds(ALeftOffset, 0, FIndent, Parent.Height); + CellSides := GetIndentCellSides(I, MaxLevel, ANode); + ShowButton := GetIndentShowButton(MaxLevel - I, ANode); + if ShowButton then + begin + ButtonExpanded := GetIndentButtonExpanded(ANode); + ButtonSize := 9; + end; + TreeLineMode := GetIndentTreeLineMode(MaxLevel - I, ANode); + end; + Inc(ALeftOffset, FIndent); + end; + end; + + procedure InsertImage(AParentCell: TdxReportCell; ANode: HTREEITEM; + AImageList: TCustomImageList; AImageIndex: Integer; var ALeftOffset: Integer); + + function GetImageCellSides(ANode: HTREEITEM; AnItem: TdxReportVisualItem): TdxCellSides; + begin + Result := []; + if IsDrawBorder then + begin + if (TV_GetNodeLevel(ANode) = 0) and AnItem.IsFirstItem then + Include(Result, csLeft); + if IsFirstNode(ANode) then + Include(Result, csTop); + if IsLastNode(ANode) then + Include(Result, csBottom); + end; + if IsDrawGrid then + begin + if not IsFirstNode(ANode) or IsDrawBorder then + Include(Result, csTop); + if not IsLastNode(ANode) or IsDrawBorder then + Include(Result, csBottom); + end; + end; + + var + Item: TdxReportCellGraphic; + begin + Item := TdxReportCellGraphic.Create(AParentCell); + with Item do + begin + CellSides := GetImageCellSides(ANode, Item); + DrawMode := gdmCenter; + Transparent := True; + + BoundsRect := MakeBounds(ALeftOffset, 0, 0, Parent.Height); + Width := AImageList.Width; + if Width < FIndent then Width := FIndent; + + ImageList := AImageList; + ImageIndex := AImageIndex; + Inc(ALeftOffset, Width); + end; + end; + + procedure ProcessNode(ANode: HTREEITEM; Index: Integer); + var + LeftOffset, V: Integer; + Cell: TdxReportCell; + PrevSibl: TdxReportVisualItem; + DataItem: TAbstractdxReportCellData; + begin + Cell := TdxReportCell.Create(AReportCells.Cells); + with Cell do + begin + PrevSibl := TdxReportVisualItem(GetPrevSibling); + V := 0; + if PrevSibl <> nil then + V := PrevSibl.BoundsRect.Bottom; + BoundsRect := MakeBounds(0, V, FActualWidth, GetNodeHeight(Index)); + CellSides := []; + if IsDrawBorder then + begin + CellSides := CellSides + [csLeft, csRight]; + if IsFirstNode(ANode) then + CellSides := CellSides + [csTop]; + if IsLastNode(ANode) then + CellSides := CellSides + [csBottom]; + end; + + Color := Self.Color; + Transparent := Self.Transparent; + end; + + LeftOffset := 0; + InsertNodeIndent(Cell, ANode, LeftOffset); + if IsDrawNodeStateImages(ANode) then + InsertImage(Cell, ANode, StateImages, TV_GetNodeStateIndex(ANode), LeftOffset); + if IsDrawNodeImages(ANode) then + InsertImage(Cell, ANode, Images, TV_GetNodeImageIndex(ANode), LeftOffset); + + DataItem := GetDataClass(ANode).Create(Cell); + DataItem.BoundsRect := MakeRect(LeftOffset, 0, FActualWidth, Cell.Height); + InitializeItem(ANode, DataItem); + end; + + procedure AdjustCellsWidth; + + function GetRealWidth: Integer; + var + W, I: Integer; + Size: TSize; + Item: TdxReportVisualItem; + PrevFont: HFONT; + Node: HTREEITEM; + begin + Result := 0; + FScreenDC := GetDC(0); + try + PrevFont := SelectObject(FScreenDC, Font.Handle); + for I := 0 to AReportCells.Cells.CellCount - 1 do + begin + W := 0; + Node := HTREEITEM(FNodeList[I]); + Inc(W, (TV_GetNodeLevel(Node) + Ord(TV_IsShowRoot)) * FIndent); + + if IsDrawNodeStateImages(Node) then Inc(W, StateImages.Width); + if IsDrawNodeImages(Node) then Inc(W, Images.Width); + + with AReportCells.Cells[I] do + Item := DataItems[DataItemCount - 1]; + with TdxReportCellString(Item) do + GetTextExtentPoint32(FScreenDC, PChar(Text), Length(Text), Size); + + Inc(W, Size.cX + 10); + if W > Result then Result := W; + end; + SelectObject(FScreenDC, PrevFont); + finally + ReleaseDC(0, FScreenDC); + end; + end; + + var + I: Integer; + Item: TdxReportVisualItem; + begin + FActualWidth := GetRealWidth; + for I := 0 to AReportCells.Cells.CellCount - 1 do + begin + Item := AReportCells.Cells[I]; + Item.Width := FActualWidth; + with TdxReportCell(Item) do + Item := DataItems[DataItemCount - 1]; + with Item, BoundsRect do + BoundsRect := MakeRect(Left, Top, FActualWidth, Bottom); + end; + end; + + procedure AddNodes; + + procedure AddNode(ANode: HTREEITEM); + begin + FNodeList.Add(ANode); + if TV_IsNodeExpanded(ANode) or AutoNodesExpand then + begin + ANode := TreeView_GetChild(TreeViewHandle, ANode); + while ANode <> nil do + begin + if (ExpandLevel = -1) or (TV_GetNodeLevel(ANode) <= ExpandLevel) then + AddNode(ANode); + ANode := TreeView_GetNextSibling(TreeViewHandle, ANode); + end; + end; + end; + + var + Node: HTREEITEM; + begin + FNodeList.Clear; + if TreeView_GetCount(TreeViewHandle) = 0 then Exit; + + if AutoNodesExpand and ExplicitTreeViewExpand then + DoExplicitTreeViewExpand(ExpandLevel); + + Node := TreeView_GetRoot(TreeViewHandle); + while Node <> nil do + begin + AddNode(Node); + Node := TreeView_GetNextSibling(TreeViewHandle, Node); + end; + end; + + procedure IterateNodes; + var + I: Integer; + begin + with FNodeList do + for I := 0 to Count - 1 do + begin + ProcessNode(HTREEITEM(Items[I]), I); + AReportCells.DoProgress(MulDiv(I, 100, Count)); + if AbortBuilding then Break; + end; + end; + +begin + if TreeViewHandle = 0 then Exit; + inherited; + + AddNodes; + if FNodeList.Count = 0 then Exit; + + AReportCells.Cells.FontIndex := 0; + AReportCells.Cells.Transparent := Transparent; + AReportCells.Cells.Color := Color; + AReportCells.BorderColor := GridLineColor; + AReportCells.ExpandButtonBorderColor := clGrayText; + AReportCells.TreeLineColor := TreeLineColor; + + PrepareContruct; + try + IterateNodes; + if not AbortBuilding and AutoWidth then + AdjustCellsWidth; + finally + UnprepareContruct; + end; + + if not AbortBuilding then + with AReportCells do + Cells.BoundsRect := MakeRect(0, 0, FActualWidth, Cells.LastCell.BoundsRect.Bottom); +end; + +procedure TCustomdxNativeTreeViewReportLink.GetImageLists(AProc: TdxPSGetImageListProc); +begin + inherited; + AProc(Images); + AProc(StateImages); +end; + +procedure TCustomdxNativeTreeViewReportLink.InitializeItem(ANode: HTREEITEM; + ADataItem: TAbstractdxReportCellData); +begin + AssignData(ANode, ADataItem); +end; + +procedure TCustomdxNativeTreeViewReportLink.InternalRestoreDefaults; +begin + inherited; + FAutoNodesExpand := False; + FAutoWidth := True; + FExpandLevel := -1; + FExplicitTreeViewExpand := False; + FGridLineColor := dxDefaultGridLineColor; + FTreeLineColor := dxDefaultTreeLineColor; + FNodeAutoHeight := False; + FOptions := dxDefaultTreeViewPaintOptions; + FIsWidthAssigned := False; +end; + +procedure TCustomdxNativeTreeViewReportLink.MakeDelimiters(AReportCells: TdxReportCells; + AHorzDelimiters, AVertDelimiters: TList); +var + I, V: Integer; +begin + inherited; + if UseVertDelimiters then + with AReportCells, Cells do + for I := 1 to CellCount - 2 do + begin + V := Cells[I].BoundsRect.Bottom; + AVertDelimiters.Add(TObject(V)); + end; +end; + +procedure TCustomdxNativeTreeViewReportLink.PrepareContruct; +var + R: TRect; +begin + SendMessage(TreeViewHandle, WM_SETREDRAW, 0, 0); + + ClearImages; + + FIndent := TreeView_GetIndent(TreeViewHandle); + if not Odd(FIndent) then Inc(FIndent); + + FScreenDC := GetDC(0); + try + FNodeHeight := Renderer.CalcTextPatternHeight(FScreenDC, Font); + + if CanDrawStateImages and (FNodeHeight < StateImages.Height + 2) then + FNodeHeight := StateImages.Height + 2; + if CanDrawImages and (FNodeHeight < Images.Height + 2) then + FNodeHeight := Images.Height + 2; + + if AutoWidth then + FActualWidth := 0 + else + if NodeAutoHeight then + begin + GetClientRect(TreeViewHandle, R); + FActualWidth := R.Right - R.Left; + end + else + FActualWidth := Self.Width; + + if NodeAutoHeight and not AutoWidth then + CalcNodesHeight; + finally + ReleaseDC(0, FScreenDC); + end; +end; + +procedure TCustomdxNativeTreeViewReportLink.UnprepareContruct; +begin + FreeAndNil(FNodeHeights); + + SendMessage(TreeViewHandle, WM_SETREDRAW, 1, 0); + InvalidateRect(TreeViewHandle, nil, False); +end; + +function TCustomdxNativeTreeViewReportLink.GetDataClass(ANode: HTREEITEM): TdxReportCellDataClass; +begin + Result := TdxReportCellString; +end; + +function TCustomdxNativeTreeViewReportLink.CheckImages: Boolean; +begin + Result := HasImages and (Images.Width <> 0) and (Images.Height <> 0); +end; + +function TCustomdxNativeTreeViewReportLink.CheckStateImages: Boolean; +begin + Result := HasStateImages and (StateImages.Width <> 0) and (StateImages.Height <> 0); +end; + +procedure TCustomdxNativeTreeViewReportLink.ClearImages; +begin + if not IsAggregated then + begin + if FImages <> nil then FImages.Clear; + if FStateImages <> nil then FStateImages.Clear; + end; +end; + +procedure TCustomdxNativeTreeViewReportLink.CreateImages; +begin + FImages := TImageList.Create(nil); + FStateImages := TImageList.Create(Self); +end; + +procedure TCustomdxNativeTreeViewReportLink.DeleteImages; +begin + FreeAndNil(FStateImages); + FreeAndNil(FImages); +end; + +function TCustomdxNativeTreeViewReportLink.GetImages: TCustomImageList; +begin + if FImages.Count = 0 then + CopyImages(TreeView_GetImageList(TreeViewHandle, TVSIL_NORMAL), FImages); + Result := FImages; +end; + +function TCustomdxNativeTreeViewReportLink.GetStateImages: TCustomImageList; +begin + if FStateImages.Count = 0 then + CopyImages(TreeView_GetImageList(TreeViewHandle, TVSIL_STATE), FStateImages); + Result := FStateImages; +end; + +function TCustomdxNativeTreeViewReportLink.HasImages: Boolean; +begin + Result := TreeView_GetImageList(TreeViewHandle, TVSIL_NORMAL) <> 0; +end; + +function TCustomdxNativeTreeViewReportLink.HasStateImages: Boolean; +begin + Result := TreeView_GetImageList(TreeViewHandle, TVSIL_STATE) <> 0; +end; + +procedure TCustomdxNativeTreeViewReportLink.DoExplicitTreeViewExpand(ALevel: Integer = -1); + + procedure ExpandNode(ANode: HTREEITEM); + begin + TreeView_Expand(TreeViewHandle, ANode, TVE_EXPAND); + if ALevel <> -1 then + begin + Dec(ALevel); + if ALevel = -1 then Exit; + end; + + ANode := TreeView_GetChild(TreeViewHandle, ANode); + while ANode <> nil do + begin + ExpandNode(ANode); + ANode := TreeView_GetNextSibling(TreeViewHandle, ANode); + end; + end; + +var + Node: HTREEITEM; +begin + if ALevel < -1 then ALevel := -1; + + Node := TreeView_GetRoot(TreeViewHandle); + if ALevel <> -1 then + begin + Dec(ALevel); + if ALevel = -1 then Exit; + end; + + while Node <> nil do + begin + ExpandNode(Node); + Node := TreeView_GetNextSibling(TreeViewHandle, Node); + end; +end; + +{ IdxPSNativeWin32ControlHandleSupport } + +function TCustomdxNativeTreeViewReportLink.GetNativeHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; +begin + Result := TreeViewHandle; +end; + +procedure TCustomdxNativeTreeViewReportLink.SetNativeHandle(Value: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}); +begin + TreeViewHandle := Value; +end; + +function TCustomdxNativeTreeViewReportLink.TV_GetNodeCount(AItem: HTREEITEM): Integer; +var + Child: HTREEITEM; +begin + Result := 0; + Child := TreeView_GetChild(TreeViewHandle, AItem); + while Child <> nil do + begin + Inc(Result); + Child := TreeView_GetNextSibling(TreeViewHandle, Child); + end; +end; + +function TCustomdxNativeTreeViewReportLink.TV_GetNodeHasChildren(AItem: HTREEITEM): Boolean; +var + Item: TTVItem; +begin + FillChar(Item, Sizeof(Item), 0); + Item.Mask := TVIF_CHILDREN; + Item.hItem := AItem; + TreeView_GetItem(TreeViewHandle, Item); + Result := Item.cChildren <> 0; +end; + +function TCustomdxNativeTreeViewReportLink.TV_GetNodeImageIndex(AItem: HTREEITEM): Integer; +var + Item: TTVItem; +begin + FillChar(Item, Sizeof(Item), 0); + Item.Mask := TVIF_IMAGE; + Item.hItem := AItem; + TreeView_GetItem(TreeViewHandle, Item); + Result := Item.iImage; +end; + +function TCustomdxNativeTreeViewReportLink.TV_GetNodeLevel(AItem: HTREEITEM): Integer; +var + Parent: HTREEITEM; +begin + Result := 0; + Parent := TV_GetNodeParent(AItem); + while Parent <> nil do + begin + Inc(Result); + Parent := TV_GetNodeParent(Parent); + end; +end; + +function TCustomdxNativeTreeViewReportLink.TV_GetNodeParent(AItem: HTREEITEM): HTREEITEM; +begin + Result := TreeView_GetParent(TreeViewHandle, AItem); +end; + +function TCustomdxNativeTreeViewReportLink.TV_GetNodeParentAtLevel(AItem: HTREEITEM; + ALevel: Integer): HTREEITEM; +begin + Result := AItem; + while ALevel > 0 do + begin + Result := TV_GetNodeParent(Result); + Dec(ALevel); + end; +end; + +function TCustomdxNativeTreeViewReportLink.TV_GetNodeStateIndex(AItem: HTREEITEM): Integer; +var + Item: TTVItem; +begin + FillChar(Item, SizeOf(Item), 0); + Item.Mask := TVIF_IMAGE; + Item.StateMask := TVIS_STATEIMAGEMASK; + Item.hItem := AItem; + TreeView_GetItem(TreeViewHandle, Item); + Result := (Item.State and TVIS_STATEIMAGEMASK) shr 12; + if Result = 0 then Result := -1; +end; + +function TCustomdxNativeTreeViewReportLink.TV_GetNodeText(AItem: HTREEITEM): string; +const + BufferLength = 4096; +var + Item: TTVItem; + Buffer: array[0..BufferLength - 1] of Char; + PBuffer: Pointer; +begin + FillChar(Item, Sizeof(Item), 0); + PBuffer := @Buffer; + Item.Mask := TVIF_TEXT; + Item.hItem := AItem; + Item.pszText := PBuffer; + Item.cchTextMax := BufferLength; + TreeView_GetItem(TreeViewHandle, Item); + Result := (Item.pszText); +end; + +function TCustomdxNativeTreeViewReportLink.TV_IsNodeExpanded(AItem: HTREEITEM): Boolean; +var + Item: TTVItem; +begin + FillChar(Item, Sizeof(Item), 0); + Item.Mask := TVIF_STATE; + Item.hItem := AItem; + TreeView_GetItem(TreeViewHandle, Item); + Result := Item.State and TVIS_EXPANDED = TVIS_EXPANDED; +end; + +function TCustomdxNativeTreeViewReportLink.TV_IsNodeParentExists(AItem: HTREEITEM): Boolean; +begin + Result := TV_GetNodeParent(AItem) <> nil; +end; + +function TCustomdxNativeTreeViewReportLink.TV_IsNodeFirstChild(AItem: HTREEITEM): Boolean; +begin + Result := TreeView_GetPrevSibling(TreeViewHandle, AItem) = nil; +end; + +function TCustomdxNativeTreeViewReportLink.TV_IsNodeLastChild(AItem: HTREEITEM): Boolean; +begin + Result := TreeView_GetNextSibling(TreeViewHandle, AItem) = nil; +end; + +function TCustomdxNativeTreeViewReportLink.TV_IsShowButtons: Boolean; +begin + Result := GetWindowLong(TreeViewHandle, GWL_STYLE) and TVS_HASBUTTONS = TVS_HASBUTTONS; +end; + +function TCustomdxNativeTreeViewReportLink.TV_IsShowLines: Boolean; +begin + Result := GetWindowLong(TreeViewHandle, GWL_STYLE) and TVS_HASLINES = TVS_HASLINES; +end; + +function TCustomdxNativeTreeViewReportLink.TV_IsShowRoot: Boolean; +begin + Result := GetWindowLong(TreeViewHandle, GWL_STYLE) and TVS_LINESATROOT = TVS_LINESATROOT; +end; + +function TCustomdxNativeTreeViewReportLink.GetOptions: TdxTreeViewPaintOptions; +begin + Result := FOptions; +end; + +function TCustomdxNativeTreeViewReportLink.GetWidth: Integer; +begin + if FIsWidthAssigned then + Result := FWidth + else + Result := DefaultWidth; +end; + +function TCustomdxNativeTreeViewReportLink.IsWidthStored: Boolean; +begin + Result := FIsWidthAssigned and (Width <> DefaultWidth); +end; + +procedure TCustomdxNativeTreeViewReportLink.SetAutoNodesExpand(Value: Boolean); +begin + if FAutoNodesExpand <> Value then + begin + FAutoNodesExpand := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxNativeTreeViewReportLink.SetAutoWidth(Value: Boolean); +begin + if FAutoWidth <> Value then + begin + FAutoWidth := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxNativeTreeViewReportLink.SetExpandLevel(Value: Integer); +begin + if Value < -1 then Value := -1; + if FExpandLevel <> Value then + begin + FExpandLevel := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxNativeTreeViewReportLink.SetExplicitTreeViewExpand(Value: Boolean); +begin + FExplicitTreeViewExpand := Value; +end; + +procedure TCustomdxNativeTreeViewReportLink.SetGridLineColor(Value: TColor); +begin + if FGridLineColor <> Value then + begin + FGridLineColor := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxNativeTreeViewReportLink.SetNodeAutoHeight(Value: Boolean); +begin + if FNodeAutoHeight <> Value then + begin + FNodeAutoHeight := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxNativeTreeViewReportLink.SetOptions(Value: TdxTreeViewPaintOptions); +begin + if FOptions <> Value then + begin + FOptions := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxNativeTreeViewReportLink.SetTreeLineColor(Value: TColor); +begin + if FTreeLineColor <> Value then + begin + FTreeLineColor := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxNativeTreeViewReportLink.SetWidth(Value: Integer); +begin + if FWidth <> Value then + begin + FIsWidthAssigned := True; + FWidth := Value; + if not AutoWidth then LinkModified(True); + end; +end; + +procedure TCustomdxNativeTreeViewReportLink.CalcNodesHeight; +var + I, W, H: Integer; + Node: HTREEITEM; + R: TRect; +begin + FNodeHeights := TList.Create; + FNodeHeights.Capacity := FNodeList.Count; + for I := 0 to FNodeList.Count - 1 do + begin + Node := HTREEITEM(FNodeList[I]); + W := FActualWidth - (TV_GetNodeLevel(Node) + 1) * FIndent; + if CanDrawStateImages then Dec(W, StateImages.Width + 2); + if CanDrawImages then Dec(W, Images.Width + 2); + + R := MakeRect(0, 0, W, 0); + H := Renderer.CalcTextRect(FScreenDC, TV_GetNodeText(Node), R, False, nil); + if H < FNodeHeight then H := FNodeHeight; + if not Odd(H) then Inc(H); + FNodeHeights.Add(Pointer(H)); + end; +end; + +function TCustomdxNativeTreeViewReportLink.CanDrawImages: Boolean; +begin + Result := (tvpoImages in Options) and CheckImages and Images.HandleAllocated; +end; + +function TCustomdxNativeTreeViewReportLink.CanDrawStateImages: Boolean; +begin + Result := (tvpoStateImages in Options) and CheckStateImages and StateImages.HandleAllocated; +end; + +function TCustomdxNativeTreeViewReportLink.GetCellSides(ANode: HTREEITEM): TdxCellSides; +var + IsAnyImagesExists: Boolean; +begin + Result := []; + IsAnyImagesExists := IsDrawNodeImages(ANode) or IsDrawNodeStateImages(ANode); + if IsDrawGrid then + begin + if not IsFirstNode(ANode) or IsDrawBorder then + Include(Result, csTop); + if not IsLastNode(ANode) or IsDrawBorder then + Include(Result, csBottom); + if IsDrawBorder and (TV_GetNodeLevel(ANode) = 0) and not IsAnyImagesExists then + Include(Result, csLeft); + end; + if IsDrawBorder then + begin + Include(Result, csRight); + if (TV_GetNodeLevel(ANode) = 0) and not IsAnyImagesExists then + Include(Result, csLeft); + if IsFirstNode(ANode) then + Include(Result, csTop); + if IsLastNode(ANode) then + Include(Result, csBottom); + end; +end; + +function TCustomdxNativeTreeViewReportLink.GetNodeHeight(Index: Integer): Integer; +begin + if FNodeHeights <> nil then + Result := Integer(FNodeHeights[Index]) + else + Result := FNodeHeight; +end; + +function TCustomdxNativeTreeViewReportLink.IsDrawBorder: Boolean; +begin + Result := tvpoBorder in Options; +end; + +function TCustomdxNativeTreeViewReportLink.IsDrawGrid: Boolean; +begin + Result := tvpoGrid in Options; +end; + +function TCustomdxNativeTreeViewReportLink.IsDrawNodeImages(ANode: HTREEITEM): Boolean; +begin + Result := CanDrawImages and IsValidNodeImageIndex(ANode); +end; + +function TCustomdxNativeTreeViewReportLink.IsDrawNodeStateImages(ANode: HTREEITEM): Boolean; +begin + Result := CanDrawStateImages and IsValidNodeStateIndex(ANode); +end; + +function TCustomdxNativeTreeViewReportLink.IsFirstNode(ANode: HTREEITEM): Boolean; +begin + Result := TObject(ANode) = FNodeList.First; +end; + +function TCustomdxNativeTreeViewReportLink.IsLastNode(ANode: HTREEITEM): Boolean; +begin + Result := TObject(ANode) = FNodeList.Last; +end; + +function TCustomdxNativeTreeViewReportLink.IsValidNodeImageIndex(ANode: HTREEITEM): Boolean; +var + ImageIndex: Integer; +begin + ImageIndex := TV_GetNodeImageIndex(ANode); + Result := (ImageIndex > -1) and (ImageIndex < Images.Count); +end; + +function TCustomdxNativeTreeViewReportLink.IsValidNodeStateIndex(ANode: HTREEITEM): Boolean; +var + StateIndex: Integer; +begin + StateIndex := TV_GetNodeStateIndex(ANode); + Result := (StateIndex > -1) and (StateIndex < StateImages.Count); +end; + +{ TdxNativeTreeViewReportLink } + +function TdxNativeTreeViewReportLink.DataProviderPresent: Boolean; +begin + if DataSource = rldsComponent then + Result := IsWindow(TreeViewHandle) + else + Result := inherited DataProviderPresent; +end; + +procedure TdxNativeTreeViewReportLink.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (AComponent is TWinControl) and TWinControl(Component).HandleAllocated and + (TWinControl(Component).Handle = TreeViewHandle) then + TreeViewHandle := 0; +end; + +function TdxNativeTreeViewReportLink.GetDesignerClass: TdxReportLinkDesignWindowClass; +begin + Result := TdxfmTVReportLinkDesignWindow; +end; + +function TdxNativeTreeViewReportLink.GetTreeViewHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; +begin + Result := FTreeViewHandle; +end; + +procedure TdxNativeTreeViewReportLink.SetTreeViewHandle(Value: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}); +begin + if (FTreeViewHandle <> Value) and IsWindow(Value) then + begin + FTreeViewHandle := Value; + LinkModified(True); + end; +end; + +{ TCustomdxTreeViewReportLink } + +constructor TCustomdxTreeViewReportLink.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FSaveFont := TFont.Create; + FSaveFont.OnChange := CustomDrawFontChanged; +end; + +destructor TCustomdxTreeViewReportLink.Destroy; +begin + FSaveFont.Free; + inherited Destroy; +end; + +procedure TCustomdxTreeViewReportLink.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TCustomdxTreeViewReportLink then + SupportedCustomDraw := TCustomdxTreeViewReportLink(Source).SupportedCustomDraw; +end; + +class function TCustomdxTreeViewReportLink.Aggregable: Boolean; +begin + Result := True; +end; + +procedure TCustomdxTreeViewReportLink.InitializeItem(ANode: HTREEITEM; + ADataItem: TAbstractdxReportCellData); +begin + inherited; + DoInitializeNode(TreeViewGetItems(CustomTreeView).GetNode(ANode), ADataItem); +end; + +procedure TCustomdxTreeViewReportLink.InternalRestoreDefaults; +begin + inherited InternalRestoreDefaults; + FSupportedCustomDraw := False; +end; + +function TCustomdxTreeViewReportLink.IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; +begin + Result := SupportedCustomDraw; + if Result and (Item <> nil) then + Result := (Item.Data <> 0) and Assigned(FOnCustomDrawNode); +end; + +function TCustomdxTreeViewReportLink.GetImages: TCustomImageList; +begin + if IsAggregated then + Result := TreeViewGetImages(CustomTreeView) + else + Result := inherited GetImages; +end; + +function TCustomdxTreeViewReportLink.GetStateImages: TCustomImageList; +begin + if IsAggregated then + Result := TreeViewGetStateImages(CustomTreeView) + else + Result := inherited GetStateImages; +end; + +function TCustomdxTreeViewReportLink.GetCustomTreeView: TCustomTreeView; +begin + Result := TCustomTreeView(Component); +end; + +function TCustomdxTreeViewReportLink.GetTreeViewHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; +begin + Result := CustomTreeView.Handle; +end; + +procedure TCustomdxTreeViewReportLink.SetTreeViewHandle(Value: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}); +begin + +end; + +{procedure TCustomdxTreeViewReportLink.DoExplicitTreeViewExpand; +begin + TreeView.FullExpand; +end;} + +procedure TCustomdxTreeViewReportLink.CustomDraw(AItem: TAbstractdxReportCellData; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); +var + AColor: TColor; + AText: string; + ATextAlignX: TdxTextAlignX; + ATextAlignY: TdxTextAlignY; +begin + if AItem.Data = 0 then Exit; + with TdxReportCellString(AItem) do + begin + AColor := ColorToRGB(Color); + if Transparent then AColor := clNone; + FSaveFont.Assign(Font); + FCustomDrawFontChanged := False; + AText := Text; + ATextAlignX := TextAlignX; + ATextAlignY := TextAlignY; + DoCustomDrawNode(TreeViewGetItems(CustomTreeView).GetNode(HTREEITEM(Data)), + ACanvas, ABoundsRect, AClientRect, AText, FSaveFont, AColor, ATextAlignX, ATextAlignY, ADone); + if not ADone then + begin + if FCustomDrawFontChanged then + begin + SelectObject(ACanvas.Handle, FSaveFont.Handle); + SetTextColor(ACanvas.Handle, ColorToRGB(FSaveFont.Color)); + FontIndex := -1; + end; + if AColor <> clNone then + begin + Color := AColor; + Transparent := False; + end; + Text := AText; + TextAlignX := ATextAlignX; + TextAlignY := ATextAlignY; + end; + end; +end; + +procedure TCustomdxTreeViewReportLink.DoCustomDrawNode(ANode: TTreeNode; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var AText: string; AFont: TFont; + var AColor: TColor; var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawNode) then + FOnCustomDrawNode(Self, ANode, ACanvas, ABoundsRect, AClientRect, AText, AFont, + AColor, ATextAlignX, ATextAlignY, ADone); +end; + +procedure TCustomdxTreeViewReportLink.DoInitializeNode(ANode: TTreeNode; + AnItem: TAbstractdxReportCellData); +begin + if Assigned(FOnInitializeNode) then + FOnInitializeNode(Self, ANode, TdxReportCellString(AnItem)); +end; + +procedure TCustomdxTreeViewReportLink.SetSupportedCustomDraw(Value: Boolean); +begin + if FSupportedCustomDraw <> Value then + begin + FSupportedCustomDraw := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxTreeViewReportLink.CustomDrawFontChanged(Sender: TObject); +begin + FCustomDrawFontChanged := True; +end; + +{ TdxTreeViewReportLink } + +function TdxTreeViewReportLink.GetTreeView: TTreeView; +begin + Result := TTreeView(Component); +end; + +{$IFDEF REGISTERSHELLCTRLS} + +{ TCustomdxShellTreeViewReportLink } + +procedure TCustomdxShellTreeViewReportLink.CreateImages; +begin +end; + +procedure TCustomdxShellTreeViewReportLink.DeleteImages; +begin +end; + +function TCustomdxShellTreeViewReportLink.GetImages: TCustomImageList; +begin + Result := dxPSUtl.ShellSmallImages; +end; + +function TCustomdxShellTreeViewReportLink.GetStateImages: TCustomImageList; +begin + Result := dxPSUtl.ShellSmallImages; +end; + +function TCustomdxShellTreeViewReportLink.HasStateImages: Boolean; +begin + Result := False; +end; + +function TCustomdxShellTreeViewReportLink.GetShellTreeView: TShellTreeView; +begin + Result := TShellTreeView(Component); +end; + +{$ENDIF} + +{ TdxTVReportLinkDesignWindow } + +constructor TdxfmTVReportLinkDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxhcTreeViewReportLinkDesigner; + inherited; + CreateControls; + PageControl1.ActivePage := PageControl1.Pages[0]; + FPreviewFont := TFont.Create; +end; + +destructor TdxfmTVReportLinkDesignWindow.Destroy; +begin + FreeAndNil(FPreviewFont); + inherited; +end; + +procedure TdxfmTVReportLinkDesignWindow.DoInitialize; +begin + inherited; + chbxShowBorders.Checked := ReportLink.IsDrawBorder; + chbxShowGrid.Checked := ReportLink.IsDrawGrid; + + chbxShowTreeLines.Checked := tvpoTreeLines in ReportLink.Options; + chbxShowButtons.Checked := tvpoButtons in ReportLink.Options; + + chbxShowStateImages.Checked := tvpoStateImages in ReportLink.Options; + chbxShowImages.Checked := tvpoImages in ReportLink.Options; + + chbxTransparent.Checked := ReportLink.Transparent; + TdxPSColorCombo(FccbxColor).ColorValue := ReportLink.Color; + TdxPSColorCombo(FccbxGridLineColor).ColorValue := ReportLink.GridLineColor; + TdxPSColorCombo(FccbxTreeLineColor).ColorValue := ReportLink.TreeLineColor; + + FontInfoToText(ReportLink.Font, edFont); + + chbxAutoWidth.Checked := ReportLink.AutoWidth; + chbxNodeAutoHeight.Checked := ReportLink.NodeAutoHeight; + + chbxAutoNodesExpand.Checked := ReportLink.AutoNodesExpand; + TdxPSSpinEdit(FseExpandLevel).Value := ReportLink.ExpandLevel; +end; + +{$IFDEF DELPHI7} +function TdxfmTVReportLinkDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +procedure TdxfmTVReportLinkDesignWindow.LoadStrings; +begin + inherited; + tshOptions.Caption := cxGetResourceString(@sdxOptions); + tshFonts.Caption := cxGetResourceString(@sdxFonts); + tshColors.Caption := cxGetResourceString(@sdxColors); + tshBehaviors.Caption := cxGetResourceString(@sdxBehaviors); + lblPreview.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + lblShow.Caption := cxGetResourceString(@sdxShow); + chbxShowBorders.Caption := cxGetResourceString(@sdxBorderLines); + chbxShowGrid.Caption := cxGetResourceString(@sdxGrid); + chbxShowTreeLines.Caption := cxGetResourceString(@sdxTreeLines); + chbxShowButtons.Caption := cxGetResourceString(@sdxButtons); + chbxShowImages.Caption := cxGetResourceString(@sdxImages); + chbxShowStateImages.Caption := cxGetResourceString(@sdxStateImages); + + lblMiscellaneous.Caption := cxGetResourceString(@sdxMiscellaneous); + chbxAutoWidth.Caption := cxGetResourceString(@sdxAutoWidth); + chbxNodeAutoHeight.Caption := cxGetResourceString(@sdxNodeAutoHeight); + + stTransparent.Caption := ' ' + cxGetResourceString(@sdxTransparent) + ' '; + lblColor.Caption := cxGetResourceString(@sdxColor); + lblGridLinesColor.Caption := cxGetResourceString(@sdxGridLinesColor); + lblTreeLinesColor.Caption := cxGetResourceString(@sdxTreeLinesColor); + + btnFont.Caption := cxGetResourceString(@sdxBtnFont); + + lblExpanding.Caption := cxGetResourceString(@sdxExpanding); + chbxAutoNodesExpand.Caption := cxGetResourceString(@sdxAutoNodesExpand); + lblExpandLevel.Caption := cxGetResourceString(@sdxExpandLevel); +end; + +procedure TdxfmTVReportLinkDesignWindow.PaintPreview(ACanvas: TCanvas; R: TRect); +const + C: Integer = 6; + uFlags: UINT = DT_LEFT or DT_VCENTER or DT_SINGLELINE; +var + BR: TRect; + I, K, Offset, H, X, Y: Integer; + PrevMode: Integer; + PrevColor: COLORREF; + PrevFont: HFONT; + DC: HDC; + BorderBrush: HBRUSH; + FillBrush: HBRUSH; + + procedure DrawLine(const R: TRect); + begin + FillRect(DC, R, BorderBrush); + end; + + procedure DoDrawImage(X, Y, Index: Integer); + begin + ilPreview.Draw(ACanvas, X, Y, Index); + end; + + procedure DrawStateImage(X, Y: Integer); + begin + DoDrawImage(X, Y, 0); + end; + + procedure DrawImage(X, Y: Integer); + begin + DoDrawImage(X, Y, 1); + end; + + procedure DrawText(const S: string; R: TRect); + begin + if RectVisible(DC, R) then + Windows.DrawText(DC, PChar(S), Length(S), R, uFlags); + end; + +begin + inherited; + + BorderBrush := CreateSolidBrush(ColorToRGB(ReportLink.GridLineColor)); + BR := R; + OffsetRect(BR, -BR.Left, -BR.Top); + InflateRect(BR, -3, -3); + H := (BR.Bottom - BR.Top) div C; + BR.Bottom := BR.Top + H * C + 1; + DC := ACanvas.Handle; + + if ReportLink.IsDrawBorder and RectVisible(DC, BR) then + FrameRect(DC, BR, BorderBrush); + if not ReportLink.Transparent then + begin + if ReportLink.IsDrawBorder then + InflateRect(BR, -1, -1); + if RectVisible(DC, BR) then + begin + FillBrush := CreateSolidBrush(ColorToRGB(ReportLink.Color)); + FillRect(DC, BR, FillBrush); + DeleteObject(FillBrush); + end; + if ReportLink.IsDrawBorder then + InflateRect(BR, 1, 1); + end; + + // grid lines + if ReportLink.IsDrawGrid then + begin + // horz + for I := 0 to 4 do + begin + K := 1; + if I in [0, 4] then K := 0; + + X := BR.Left + K * H; + Y := BR.Top + (I + 1) * H; + DrawLine(MakeRect(X, Y, BR.Right, Y + 1)); + end; + // vert + X := BR.Left + H; + Y := BR.Top + H; + DrawLine(MakeRect(X, Y, X + 1, Y + 4 * H)); + DrawLine(MakeRect(X + H, Y + H, X + H + 1, Y + 3 * H)); + end; + + DeleteObject(BorderBrush); + + PrevMode := SetBkMode(DC, TRANSPARENT); + FPreviewFont.Assign(ReportLink.Font); + FPreviewFont.Size := 8; + PrevFont := SelectObject(DC, FPreviewFont.Handle); + PrevColor := SetTextColor(DC, ColorToRGB(FPreviewFont.Color)); + + for I := 0 to 5 do + begin + K := I; + if I > 2 then K := 5 - I; + Offset := 0; + if tvpoStateImages in ReportLink.Options then + begin + DrawStateImage(Offset + BR.Left + K * H + 1, BR.Top + I * H + 5); + Inc(Offset, ilPreview.Width); + end; + if tvpoImages in ReportLink.Options then + begin + DrawImage(Offset + BR.Left + K * H + 1, BR.Top + I * H + 5); + Inc(Offset, ilPreview.Width); + end; + Inc(Offset, 2); + + X := Offset + BR.Left + K * H; + Y := BR.Top + I * H; + DrawText(GetDesignerString(I), MakeRect(X, Y, BR.Right, Y + H)); + end; + + SelectObject(DC, PrevFont); + SetTextColor(DC, PrevColor); + SetBkMode(DC, PrevMode); +end; + +procedure TdxfmTVReportLinkDesignWindow.UpdateControlsState; +begin + inherited; + chbxNodeAutoHeight.Enabled := not chbxAutoWidth.Checked; + FccbxColor.Enabled := not chbxTransparent.Checked; + lblColor.Enabled := not chbxTransparent.Checked; + FseExpandLevel.Enabled := chbxAutoNodesExpand.Checked; +end; + +procedure TdxfmTVReportLinkDesignWindow.UpdatePreview; +begin + FPreviewBox.Invalidate; +end; + +procedure TdxfmTVReportLinkDesignWindow.ccbxColorChange(Sender: TObject); +var + AColor: TColor; +begin + if LockControlsUpdate then Exit; + AColor := TdxPSColorCombo(Sender).ColorValue; + case TTagToInt(TdxPSColorCombo(Sender).Tag) of + 0: ReportLink.Color := AColor; + 1: ReportLink.GridLineColor := AColor; + 2: ReportLink.TreeLineColor := AColor; + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmTVReportLinkDesignWindow.CreateControls; + + function CreateColorCombo(AParent: TWinControl; AHost: TControl; + ATag: Integer; AAutoColor: TColor; ALabel: TLabel): TdxPSColorCombo; + begin + Result := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(Result) do + begin + BoundsRect := AHost.BoundsRect; + Tag := MakeTTag(ATag); + Parent := AParent; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := AAutoColor; + OnChange := ccbxColorChange; + end; + ALabel.FocusControl := Result; + AHost.Visible := False; + end; + +var + R: TRect; +begin + FccbxColor := + CreateColorCombo(gbxTransparent, bvlColorHost, 0, dxDefaultColor, lblColor); + FccbxGridLineColor := + CreateColorCombo(pnlColor, bvlGridLineColorHost, 1, dxDefaultGridLineColor, lblGridLinesColor); + FccbxTreeLineColor := + CreateColorCombo(pnlColor, bvlTreeLineColorHost, 2, dxDefaultTreeLineColor, lblTreeLinesColor); + + FPreviewBox := TdxPSPaintPanel.Create(Self); + with TdxPSPaintPanel(FPreviewBox) do + begin + Parent := pnlPreview; + R := pnlPreview.BoundsRect; + OffsetRect(R, -R.Left, -R.Top); + InflateRect(R, -1, -1); + BoundsRect := R; + EdgeInner := esNone; + EdgeOuter := esNone; + OnPaint := pbxPreviewPaint; + end; + FseExpandLevel := TdxPSSpinEdit.Create(Self); + with TdxPSSpinEdit(FseExpandLevel) do + begin + BoundsRect := bvlExpandLevelHolder.BoundsRect; + MinValue := -1; + MaxValue := 100; + Flat := False; + Parent := pnlBehaviors; + OnChange := ExpandLevelChange; + end; + lblExpandLevel.FocusControl := FseExpandLevel; +end; + +procedure TdxfmTVReportLinkDesignWindow.ExpandLevelChange(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.ExpandLevel := TdxPSSpinEdit(Sender).AsInteger; + Modified := True; +end; + +function TdxfmTVReportLinkDesignWindow.GetReportLink: TCustomdxNativeTreeViewReportLink; +begin + Result := inherited ReportLink as TCustomdxNativeTreeViewReportLink; +end; + +procedure TdxfmTVReportLinkDesignWindow.pbxPreviewPaint(Sender: TObject); +begin + with TdxPSPaintPanel(Sender) do + begin + FillRect(Canvas.Handle, ClientRect, GetSysColorBrush(COLOR_WINDOW)); + PaintPreview(Canvas, ClientRect); + end; +end; + +procedure TdxfmTVReportLinkDesignWindow.CMDialogChar(var Message: TCMDialogChar); +var + I: Integer; +begin + inherited; + with PageControl1 do + for I := 0 to PageCount - 1 do + if IsAccel(Message.CharCode, Pages[I].Caption) then + begin + Message.Result := 1; + ActivePage := Pages[I]; + Exit; + end; +end; + +procedure TdxfmTVReportLinkDesignWindow.chbxShowClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TCheckBox(Sender) do + if Checked then + ReportLink.Options := ReportLink.Options + [TdxTreeViewPaintOption(TTagToInt(Tag))] + else + ReportLink.Options := ReportLink.Options - [TdxTreeViewPaintOption(TTagToInt(Tag))]; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmTVReportLinkDesignWindow.chbxAutoWidthClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.AutoWidth := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxfmTVReportLinkDesignWindow.chbxNodeAutoHeightClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.NodeAutoHeight := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxfmTVReportLinkDesignWindow.btnFontClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + + dxPSGlbl.FontDialog.Font := ReportLink.Font; + if dxPSGlbl.FontDialog.Execute then + begin + ReportLink.Font := dxPSGlbl.FontDialog.Font; + FontInfoToText(ReportLink.Font, edFont); + Modified := True; + UpdatePreview; + end; +end; + +procedure TdxfmTVReportLinkDesignWindow.chbxTransparentClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.Transparent := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmTVReportLinkDesignWindow.stTransparentClick(Sender: TObject); +begin + if chbxTransparent.CanFocus then ActiveControl := chbxTransparent; + chbxTransparent.Checked := not chbxTransparent.Checked; +end; + +procedure TdxfmTVReportLinkDesignWindow.chbxAutoNodesExpandClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.AutoNodesExpand := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxfmTVReportLinkDesignWindow.lblExpandLevelClick(Sender: TObject); +begin + if TLabel(Sender).FocusControl <> nil then + ActiveControl := TLabel(Sender).FocusControl; +end; + +procedure TdxfmTVReportLinkDesignWindow.lblColorClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; + TCustomComboBox(ActiveControl).DroppedDown := True; +end; + +procedure TdxfmTVReportLinkDesignWindow.PageControl1Change(Sender: TObject); +begin + lblPreview.Parent := TPageControl(Sender).ActivePage; +end; + +initialization + dxPSRegisterReportLink(TdxTreeViewReportLink, TTreeView, TdxfmTVReportLinkDesignWindow); + {$IFDEF REGISTERSHELLCTRLS} + dxPSRegisterReportLink(TdxShellTreeViewReportLink, TShellTreeView, TdxfmTVReportLinkDesignWindow); + {$ENDIF} + +finalization + {$IFDEF REGISTERSHELLCTRLS} + dxPSUnregisterReportLink(TdxShellTreeViewReportLink, TShellTreeView, TdxfmTVReportLinkDesignWindow); + {$ENDIF} + dxPSUnregisterReportLink(TdxTreeViewReportLink, TTreeView, TdxfmTVReportLinkDesignWindow); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSTextLnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSTextLnk.dfm new file mode 100644 index 00000000..7cc72ae2 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSTextLnk.dfm @@ -0,0 +1,528 @@ +object dxfmTextReportLinkDesignWindow: TdxfmTextReportLinkDesignWindow + Left = 480 + Top = 279 + BorderStyle = bsDialog + Caption = 'dxfmTextReportLinkDesignWindow' + ClientHeight = 285 + ClientWidth = 580 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 7 + Width = 572 + Height = 243 + ActivePage = tshOptions + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + object tshOptions: TTabSheet + Caption = 'Options' + object lblLineSpacing: TLabel + Left = 9 + Top = 65 + Width = 63 + Height = 13 + Caption = '&Line Spacing:' + end + object lblAlignment: TLabel + Left = 9 + Top = 28 + Width = 51 + Height = 13 + Caption = '&Alignment:' + FocusControl = cbxAlignment + end + object bvlLineSpacingSite: TBevel + Left = 100 + Top = 60 + Width = 140 + Height = 21 + Visible = False + end + object Bevel2: TBevel + Left = 319 + Top = 8 + Width = 236 + Height = 4 + Shape = bsBottomLine + end + object lblPreview: TLabel + Left = 267 + Top = 3 + Width = 38 + Height = 13 + Caption = 'Preview' + end + object Bevel1: TBevel + Left = 10 + Top = 99 + Width = 231 + Height = 4 + Shape = bsBottomLine + end + object pnlPreview: TPanel + Left = 267 + Top = 23 + Width = 290 + Height = 183 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvLowered + Color = clWindow + TabOrder = 0 + object pbxPreview: TPaintBox + Left = 1 + Top = 1 + Width = 288 + Height = 181 + Align = alClient + OnPaint = pbxPreviewPaint + end + end + object btnFont: TButton + Left = 9 + Top = 123 + Width = 110 + Height = 23 + Caption = 'Fo&nt ...' + TabOrder = 2 + OnClick = btnFontClick + end + object edFont: TEdit + Left = 9 + Top = 151 + Width = 231 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 3 + end + object cbxAlignment: TComboBox + Left = 100 + Top = 23 + Width = 140 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 1 + OnClick = cbxAlignmentClick + OnDrawItem = cbxAlignmentDrawItem + end + end + end + object ilAlignments: TImageList + Left = 13 + Top = 254 + Bitmap = { + 494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFF003FC00FF0030003FFFFFFFFFFFFFFFF0003000300030003 + FFFFFFFFFFFFFFFF003FC00FF0030003FFFFFFFFFFFFFFFF0003000300030003 + FFFFFFFFFFFFFFFF003FC00FF0030003FFFFFFFFFFFFFFFF0003000300030003 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSTextLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSTextLnk.pas new file mode 100644 index 00000000..2f014bd8 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSTextLnk.pas @@ -0,0 +1,861 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSTextLnk; + +interface + +{$I cxVer.inc} + +uses + Windows, Classes, Graphics, Controls, StdCtrls, ExtCtrls, ComCtrls, dxPSCore, + dxPrnPg, dxPSTextOut, dxPSGlbl, dxExtCtrls, ImgList; + +type + TdxCustomTextReportLink = class; + TdxfmTextReportLinkDesignWindow = class; + + TdxTextReportLinkCustomDrawRowEvent = procedure(Sender: TdxCustomTextReportLink; + ACanvas: TCanvas; AnItem: TdxReportCellString; var ADone: Boolean) of object; + + TdxTextReportLinkInitializeRowEvent = procedure(Sender: TdxCustomTextReportLink; + AnItem: TdxReportCellString) of object; + + TdxCustomTextReportLink = class(TBasedxReportLink) + private + FAlignment: TdxTextAlignX; + FDelimiters: TList; + FFontIndex: Integer; + FScreenDC: HDC; + FSupportedCustomDraw: Boolean; + FTextRowHeight: Integer; + FTextRowItemHeight: Integer; + FTextRowSpacing: Double; + FOnCustomDrawRow: TdxTextReportLinkCustomDrawRowEvent; + FOnInitializeRow: TdxTextReportLinkInitializeRowEvent; + function GetDelimiter(Index: Integer): Integer; + function GetDelimiterCount: Integer; + function GetDesignWindow: TdxfmTextReportLinkDesignWindow; + function GetTextBounds: TRect; + function IsTextRowSpacingStored: Boolean; + procedure SetAlignment(Value: TdxTextAlignX); + procedure SetOnCustomDrawRow(Value: TdxTextReportLinkCustomDrawRowEvent); + procedure SetSupportedCustomDraw(Value: Boolean); + procedure SetTextRowSpacing(Value: Double); + protected + procedure ConstructReport(AReportCells: TdxReportCells); override; + procedure ConvertCoords; override; + procedure CustomDraw(AItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); override; + function GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; override; + procedure InternalRestoreDefaults; override; + function IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; override; + procedure MakeDelimiters(AReportCells: TdxReportCells; AHorzDelimiters, AVertDelimiters: TList); override; + + procedure AddDelimiter(Value: Integer); overload; + procedure AddDelimiter(AItem: TdxReportVisualItem); overload; + + procedure AdjustHostBounds(AHost: TdxReportCell); + procedure CalculateTextRowHeight; virtual; + function CreateHost(AReportCells: TdxReportCells): TdxReportCell; virtual; + function CreateItem(AParent: TdxReportCell; const ATextRow: TdxTextRow): TdxReportCellString; virtual; + procedure CreateItems(AHost: TdxReportCell); + function GetTextRowBoundsWidth: Integer; virtual; + procedure InitializeHost(AHost: TdxReportCell); virtual; + procedure InitializeItem(AItem: TdxReportCellString; const AText: string); virtual; + + procedure DoConstructReport(AReportCells: TdxReportCells); virtual; + procedure PrepareConstruct(AReportCells: TdxReportCells); virtual; + procedure UnprepareConstruct(AReportCells: TdxReportCells); virtual; + + function GetText: string; virtual; + function GetTextFormat: DWORD; virtual; + function GetTextItemClass: TdxReportCellStringClass; virtual; + + procedure DoCustomDrawRow(ACanvas: TCanvas; AnItem: TdxReportCellString; var ADone: Boolean); dynamic; + procedure DoInitializeRow(AnItem: TdxReportCellString); dynamic; + + property DelimiterCount: Integer read GetDelimiterCount; + property DelimiterList: TList read FDelimiters; + property Delimiters[Index: Integer]: Integer read GetDelimiter; + property FontIndex: Integer read FFontIndex; + property ScreenDC: HDC read FScreenDC; + property TextBounds: TRect read GetTextBounds; + property TextFormat: DWORD read GetTextFormat; + property TextRowBoundsWidth: Integer read GetTextRowBoundsWidth; + property TextRowHeight: Integer read FTextRowHeight write FTextRowHeight; + property TextRowItemHeight: Integer read FTextRowItemHeight write FTextRowItemHeight; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + class function Aggregable: Boolean; override; + function DataProviderPresent: Boolean; override; + + property Alignment: TdxTextAlignX read FAlignment write SetAlignment default taLeft; + property Color; + property DesignWindow: TdxfmTextReportLinkDesignWindow read GetDesignWindow; + property Font; + property ScaleFonts; + property SupportedCustomDraw: Boolean read FSupportedCustomDraw write SetSupportedCustomDraw default False; + property Text: string read GetText; + property TextRowSpacing: Double read FTextRowSpacing write SetTextRowSpacing stored IsTextRowSpacingStored; + property Transparent; + property UseHorzDelimiters; + + property OnCustomDrawRow: TdxTextReportLinkCustomDrawRowEvent read FOnCustomDrawRow write SetOnCustomDrawRow; + property OnInitializeRow: TdxTextReportLinkInitializeRowEvent read FOnInitializeRow write FOnInitializeRow; + end; + + TdxCustomStringsReportLink = class(TdxCustomTextReportLink) + protected + function GetStrings: TStrings; virtual; abstract; + function GetText: string; override; + function GetTextFormat: DWORD; override; + public + property Strings: TStrings read GetStrings; + end; + + TdxTextReportLink = class(TdxCustomStringsReportLink) + private + FStrings: TStrings; + procedure StringsChanged(Sender: TObject); + protected + function GetStrings: TStrings; override; + procedure SetStrings(Value: TStrings); virtual; + procedure SetText(const Value: string); + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + property Text write SetText; + published + property Alignment; + property Color; + property Font; + property ScaleFonts; + property Strings write SetStrings; + property TextRowSpacing; + property SupportedCustomDraw; + property UseHorzDelimiters; + property Transparent; + + property OnCustomDrawRow; + property OnInitializeRow; + end; + + TdxCustomMemoReportLink = class(TdxCustomStringsReportLink) + protected + function GetTextRowBoundsWidth: Integer; override; + procedure InternalRestoreFromOriginal; override; + + function GetCustomMemo: TCustomMemo; virtual; + function GetStrings: TStrings; override; + property CustomMemo: TCustomMemo read GetCustomMemo; + published + property Alignment; + property Color; + property Font; + property ScaleFonts; + property SupportedCustomDraw; + property TextRowSpacing; + property UseHorzDelimiters; + property Transparent; + + property OnCustomDrawRow; + property OnInitializeRow; + end; + + TdxMemoReportLink = class(TdxCustomMemoReportLink) + private + function GetMemo: TMemo; + public + property Memo: TMemo read GetMemo; + end; + + TdxfmTextReportLinkDesignWindow = class(TStandarddxReportLinkDesignWindow) + PageControl1: TPageControl; + tshOptions: TTabSheet; + pnlPreview: TPanel; + pbxPreview: TPaintBox; + btnFont: TButton; + edFont: TEdit; + lblLineSpacing: TLabel; + lblAlignment: TLabel; + cbxAlignment: TComboBox; + bvlLineSpacingSite: TBevel; + Bevel2: TBevel; + lblPreview: TLabel; + Bevel1: TBevel; + ilAlignments: TImageList; + procedure cbxAlignmentClick(Sender: TObject); + procedure btnFontClick(Sender: TObject); + procedure pbxPreviewPaint(Sender: TObject); + procedure cbxAlignmentDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + private + seLineSpacing: TdxPSSpinEdit; + function GetReportLink: TdxCustomTextReportLink; + procedure LineSpacingChanged(Sender: TObject); + protected + procedure DoInitialize; override; + procedure LoadStrings; override; + procedure UpdatePreview; override; + + procedure CreateControls; + public + constructor Create(AOwner: TComponent); override; + property ReportLink: TdxCustomTextReportLink read GetReportLink; + end; + +implementation + +{$R *.dfm} + +uses + SysUtils, cxClasses, dxPSUtl, dxPSRes; + +type + TCustomMemoAccess = class(TCustomMemo); + + +{ TdxCustomTextReportLink } + +constructor TdxCustomTextReportLink.Create(AOwner: TComponent); +begin + inherited; + FDelimiters := TList.Create; + InternalRestoreDefaults; + LinkModified(False); +end; + +destructor TdxCustomTextReportLink.Destroy; +begin + FreeAndNil(FDelimiters); + inherited; +end; + +procedure TdxCustomTextReportLink.Assign(Source: TPersistent); +begin + if Source is TdxCustomTextReportLink then + with TdxCustomTextReportLink(Source) do + begin + Self.Alignment := Alignment; + Self.SupportedCustomDraw := SupportedCustomDraw; + Self.TextRowSpacing := TextRowSpacing; + end; + inherited; +end; + +class function TdxCustomTextReportLink.Aggregable: Boolean; +begin + Result := False; +end; + +function TdxCustomTextReportLink.DataProviderPresent: Boolean; +begin + if DataSource = rldsComponent then + Result := Text <> '' + else + Result := inherited DataProviderPresent; +end; + +procedure TdxCustomTextReportLink.ConstructReport(AReportCells: TdxReportCells); +begin + PrepareConstruct(AReportCells); + try + DoConstructReport(AReportCells); + finally + UnprepareConstruct(AReportCells) + end; +end; + +procedure TdxCustomTextReportLink.ConvertCoords; + + procedure ConvertDelimiters(ADelimiters: TList); + var + I, Value: Integer; + begin + for I := 0 to ADelimiters.Count - 1 do + begin + Value := Integer(ADelimiters[I]); + Value := MulDiv(Value, PixelsNumerator, PixelsDenominator); + ADelimiters[I] := Pointer(Value); + end; + end; + +begin + inherited; + ConvertDelimiters(DelimiterList); +end; + +procedure TdxCustomTextReportLink.CustomDraw(AItem: TAbstractdxReportCellData; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); +begin + DoCustomDrawRow(ACanvas, TdxReportCellString(AItem), ADone); +end; + +function TdxCustomTextReportLink.GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; +begin + Result := AUpdateCodes * uaMarginsVert <> []; +end; + +procedure TdxCustomTextReportLink.InternalRestoreDefaults; +begin + inherited; + Alignment := taLeft; + TextRowSpacing := 1; + SupportedCustomDraw := False; +end; + +function TdxCustomTextReportLink.IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; +begin + Result := SupportedCustomDraw and (Item <> nil); +end; + +procedure TdxCustomTextReportLink.MakeDelimiters(AReportCells: TdxReportCells; + AHorzDelimiters, AVertDelimiters: TList); +begin + inherited; + dxPSUtl.dxCopyList(DelimiterList, AVertDelimiters); +end; + +procedure TdxCustomTextReportLink.AddDelimiter(Value: Integer); +begin + FDelimiters.Add(TObject(Value)); +end; + +procedure TdxCustomTextReportLink.AddDelimiter(AItem: TdxReportVisualItem); +begin + with AItem.AbsoluteRect do + begin + AddDelimiter(Top); + AddDelimiter(Bottom); + end; +end; + +procedure TdxCustomTextReportLink.AdjustHostBounds(AHost: TdxReportCell); +begin + with AHost do + if DataItemCount <> 0 then + begin + Left := 0; + Top := 0; + Width := DataItems[0].Width; + Height := DataItems[DataItemCount - 1].BoundsRect.Bottom; + end; +end; + +procedure TdxCustomTextReportLink.CalculateTextRowHeight; +var + AFontHandle: HFont; +begin + AFontHandle := SelectObject(ScreenDC, Font.Handle); + FTextRowHeight := Round(FTextRowSpacing * dxCalcTextExtents(ScreenDC, 'Wg', 2, False).cy); + SelectObject(ScreenDC, AFontHandle); + FTextRowItemHeight := Round(FTextRowSpacing * Renderer.CalcTextPatternHeight(ScreenDC, Font)); +end; + +function TdxCustomTextReportLink.CreateHost(AReportCells: TdxReportCells): TdxReportCell; +begin + Result := TdxReportCell.Create(AReportCells.Cells); + InitializeHost(Result); +end; + +function TdxCustomTextReportLink.CreateItem(AParent: TdxReportCell; + const ATextRow: TdxTextRow): TdxReportCellString; + + function ExtractString(ATextRow: TdxTextRow): string; + begin + with ATextRow do + SetString(Result, Text, CharCount); + end; + + procedure PlaceItem(AItem: TdxReportCellString); + begin + with Result do + begin + Left := 0; + Top := Index * TextRowHeight; + Width := TextRowBoundsWidth; + Height := TextRowItemHeight; + end; + end; + +begin + Result := GetTextItemClass.Create(AParent); + PlaceItem(Result); + InitializeItem(Result, ExtractString(ATextRow)); + DoInitializeRow(Result); +end; + +procedure TdxCustomTextReportLink.CreateItems(AHost: TdxReportCell); +var + F: HFONT; + TextParams: TdxTextParams; + TextRows: TdxTextRows; + I: Integer; + Item: TdxReportCellString; + PercentsDone: Double; +begin + F := SelectObject(ScreenDC, Font.Handle); + try + TextParams := dxPSTextOut.dxCalcTextParams(ScreenDC, TextFormat); + TextRows := dxMakeTextRows(ScreenDC, Text, TextBounds, TextParams); + if TextRows <> nil then + try + for I := 0 to TextRows.Count - 1 do + begin + Item := CreateItem(AHost, TextRows[I]); + AddDelimiter(Item); + + PercentsDone := (I + 1) * 100 / TextRows.Count; + DoProgress(PercentsDone); + if AbortBuilding then Break; + end; + finally + TextRows.Free; + end; + finally + SelectObject(ScreenDC, F); + end; +end; + +function TdxCustomTextReportLink.GetTextRowBoundsWidth: Integer; +begin + with RealPrinterPage.PaintRectPixels do + Result := Right - Left - 1; +end; + +procedure TdxCustomTextReportLink.InitializeHost(AHost: TdxReportCell); +begin + AHost.CellSides := []; + AHost.Transparent := True; +end; + +procedure TdxCustomTextReportLink.InitializeItem(AItem: TdxReportCellString; + const AText: string); +begin + AItem.CellSides := []; + AItem.FontIndex := FontIndex; + AItem.Text := AText; + AItem.TextAlignX := Alignment; + AItem.Transparent := Transparent; +end; + +procedure TdxCustomTextReportLink.DoConstructReport(AReportCells: TdxReportCells); +var + Host: TdxReportCell; + R: TRect; +begin + Host := CreateHost(AReportCells); + CreateItems(Host); + if not AbortBuilding then + begin + AdjustHostBounds(Host); + + R := Host.BoundsRect; + OffsetRect(R, -R.Left, -R.Top); + AReportCells.Cells.BoundsRect := R; + end; +end; + +procedure TdxCustomTextReportLink.PrepareConstruct(AReportCells: TdxReportCells); +begin + FScreenDC := GetDC(0); + FDelimiters.Clear; + FFontIndex := AddFontToPool(Font); + CalculateTextRowHeight; +end; + +procedure TdxCustomTextReportLink.UnprepareConstruct(AReportCells: TdxReportCells); +begin + ReleaseDC(0, FScreenDC); +end; + +function TdxCustomTextReportLink.GetText: string; +begin + Result := ''; +end; + +function TdxCustomTextReportLink.GetTextFormat: DWORD; +begin + Result := DXTO_WORDBREAK or DXTO_EXPANDTABS or dxPSTextOut.dxMakeFormat(Alignment, taTop); +end; + +function TdxCustomTextReportLink.GetTextItemClass: TdxReportCellStringClass; +begin + Result := TdxReportCellString; +end; + +procedure TdxCustomTextReportLink.DoCustomDrawRow(ACanvas: TCanvas; + AnItem: TdxReportCellString; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawRow) then + FOnCustomDrawRow(Self, ACanvas, AnItem, ADone); +end; + +procedure TdxCustomTextReportLink.DoInitializeRow(AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeRow) then FOnInitializeRow(Self, AnItem); +end; + +function TdxCustomTextReportLink.GetDelimiter(Index: Integer): Integer; +begin + Result := Integer(FDelimiters[Index]); +end; + +function TdxCustomTextReportLink.GetDelimiterCount: Integer; +begin + Result := FDelimiters.Count; +end; + +function TdxCustomTextReportLink.GetDesignWindow: TdxfmTextReportLinkDesignWindow; +begin + Result := inherited DesignWindow as TdxfmTextReportLinkDesignWindow; +end; + +function TdxCustomTextReportLink.GetTextBounds: TRect; +begin + Result := RealPrinterPage.PaintRectPixels; + Dec(Result.Right); + InflateRect(Result, -1, -1); + Result.Bottom := MaxInt; // no limit +end; + +function TdxCustomTextReportLink.IsTextRowSpacingStored: Boolean; +begin + Result := Abs(TextRowSpacing - 1) > 0.001; +end; + +procedure TdxCustomTextReportLink.SetAlignment(Value: TdxTextAlignX); +begin + if Value = taJustifyX then + Value := taDistributeX; + if FAlignment <> Value then + begin + FAlignment := Value; + LinkModified(True); + end; +end; + +procedure TdxCustomTextReportLink.SetOnCustomDrawRow(Value: TdxTextReportLinkCustomDrawRowEvent); +begin + if @FOnCustomDrawRow <> @Value then + begin + FOnCustomDrawRow := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxCustomTextReportLink.SetSupportedCustomDraw(Value: Boolean); +begin + if FSupportedCustomDraw <> Value then + begin + FSupportedCustomDraw := Value; + if Assigned(FOnCustomDrawRow) then LinkModified(True); + end; +end; + +procedure TdxCustomTextReportLink.SetTextRowSpacing(Value: Double); +begin + if Value < 1 then Value := 1; + if FTextRowSpacing <> Value then + begin + FTextRowSpacing := Value; + LinkModified(True); + end; +end; + +{ TdxCustomStringsReportLink } + +function TdxCustomStringsReportLink.GetText: string; +begin + if Strings <> nil then + Result := Strings.Text + else + Result := ''; +end; + +function TdxCustomStringsReportLink.GetTextFormat: DWORD; +begin + Result := inherited GetTextFormat or DXTO_CHARBREAK; +end; + +{ TdxTextReportLink } + +constructor TdxTextReportLink.Create(AOwner: TComponent); +begin + inherited; + FStrings := TStringList.Create; + TStringList(FStrings).OnChange := StringsChanged; +end; + +destructor TdxTextReportLink.Destroy; +begin + FreeAndNil(FStrings); + inherited; +end; + +procedure TdxTextReportLink.Assign(Source: TPersistent); +begin + if Source is TdxTextReportLink then + Text := TdxTextReportLink(Source).Text; + inherited; +end; + +function TdxTextReportLink.GetStrings: TStrings; +begin + Result := FStrings; +end; + +procedure TdxTextReportLink.SetStrings(Value: TStrings); +begin + Strings.Assign(Value); +end; + +procedure TdxTextReportLink.SetText(const Value: string); +begin + Strings.Text := Value; +end; + +procedure TdxTextReportLink.StringsChanged(Sender: TObject); +begin + LinkModified(True); +end; + +{ TdxCustomMemoReportLink } + +function TdxCustomMemoReportLink.GetTextRowBoundsWidth: Integer; +var + ControllerIntf: IdxReportLinkController; +begin + if IsAggregated and SysUtils.Supports(TObject(Controller), IdxReportLinkController, ControllerIntf) then + with ControllerIntf.GetControlSiteBounds(CustomMemo) do + Result := Right - Left - 1 + else + Result := inherited GetTextRowBoundsWidth; +end; + +procedure TdxCustomMemoReportLink.InternalRestoreFromOriginal; +begin + inherited; + Alignment := dxPSCore.dxTextAlignX[TCustomMemoAccess(CustomMemo).Alignment]; +end; + +function TdxCustomMemoReportLink.GetCustomMemo: TCustomMemo; +begin + Result := inherited Component as TCustomMemo; +end; + +function TdxCustomMemoReportLink.GetStrings: TStrings; +begin + if CustomMemo <> nil then + Result := CustomMemo.Lines + else + Result := nil; +end; + +{ TdxMemoReportLink } + +function TdxMemoReportLink.GetMemo: TMemo; +begin + Result := inherited Component as TMemo; +end; + +{ TdxfmTextReportLinkDesignWindow } + +constructor TdxfmTextReportLinkDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxPSGlbl.dxhcTextReportLinkDesigner; + inherited; + CreateControls; +end; + +procedure TdxfmTextReportLinkDesignWindow.DoInitialize; +begin + inherited; + cbxAlignment.ItemIndex := cbxAlignment.Items.IndexOfObject(TObject(ReportLink.Alignment)); + seLineSpacing.Value := ReportLink.TextRowSpacing; + FontInfoToText(ReportLink.Font, edFont); +end; + +procedure TdxfmTextReportLinkDesignWindow.LoadStrings; +begin + inherited; + tshOptions.Caption := cxGetResourceString(@sdxOptions); + lblPreview.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + lblAlignment.Caption := AddColon(cxGetResourceString(@sdxAlignment)); + lblLineSpacing.Caption := cxGetResourceString(@sdxLineSpacing); + with cbxAlignment do + begin + Items.BeginUpdate; + try + Items.AddObject(cxGetResourceString(@sdxTextAlignLeft), TObject(taLeft)); + Items.AddObject(cxGetResourceString(@sdxTextAlignCenter), TObject(taCenterX)); + Items.AddObject(cxGetResourceString(@sdxTextAlignRight), TObject(taRight)); + Items.AddObject(cxGetResourceString(@sdxTextAlignJustified), TObject(taDistributeX)); + finally + Items.EndUpdate; + end; + end; + btnFont.Caption := cxGetResourceString(@sdxBtnFont); +end; + +procedure TdxfmTextReportLinkDesignWindow.UpdatePreview; +begin + pbxPreview.Invalidate; +end; + +procedure TdxfmTextReportLinkDesignWindow.CreateControls; +begin + seLineSpacing := TdxPSSpinEdit.Create(Self); + with seLineSpacing do + begin + BoundsRect := bvlLineSpacingSite.BoundsRect; + Decimal := 1; + Increment := 0.1; + MaxValue := 10; + MinValue := 1; + Flat := False; + Parent := tshOptions; + ValueType := svtFloat; + TabOrder := cbxAlignment.TabOrder + 1; + OnChange := LineSpacingChanged; + end; +end; + +function TdxfmTextReportLinkDesignWindow.GetReportLink: TdxCustomTextReportLink; +begin + Result := inherited ReportLink as TdxCustomTextReportLink; +end; + +procedure TdxfmTextReportLinkDesignWindow.LineSpacingChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.TextRowSpacing := TdxPSSpinEdit(Sender).Value; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmTextReportLinkDesignWindow.cbxAlignmentClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + + with TComboBox(Sender) do + ReportLink.Alignment := TdxTextAlignX(Items.Objects[ItemIndex]); + Modified := True; + UpdatePreview; +end; + +procedure TdxfmTextReportLinkDesignWindow.btnFontClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + + dxPSGlbl.FontDialog.Font := ReportLink.Font; + if dxPSGlbl.FontDialog.Execute then + begin + ReportLink.Font := dxPSGlbl.FontDialog.Font; + FontInfoToText(ReportLink.Font, edFont); + Modified := True; + UpdatePreview; + end; +end; + +procedure TdxfmTextReportLinkDesignWindow.pbxPreviewPaint(Sender: TObject); + + function GetText: string; + const + RowCount: Integer = 10; + var + Line: string; + I: Integer; + begin + Line := cxGetResourceString(@sdxSampleText); + Result := ''; + for I := 0 to RowCount - 1 do + Result := Result + Line + #13#10; + end; + +var + Format: DWORD; + R: TRect; +begin + Format := DXTO_DEFAULT_FORMAT + DXTO_WORDBREAK + DXTO_CHARBREAK + + dxMakeFormat(ReportLink.Alignment, taTop); + with TPaintBox(Sender) do + begin + Canvas.Font := ReportLink.Font; + Canvas.Font.Size := 8; + R := ClientRect; + dxTextOut(Canvas.Handle, GetText, R, Format, Canvas.Font, 0, 0, 0, clDefault, ReportLink.TextRowSpacing); + end; +end; + +procedure TdxfmTextReportLinkDesignWindow.cbxAlignmentDrawItem( + Control: TWinControl; Index: Integer; Rect: TRect; + State: TOwnerDrawState); +var + X, Y: Integer; +begin + with TComboBox(Control) do + begin + Canvas.FillRect(Rect); + with Rect do + begin + X := Left + 1; + Y := Top + 1; + end; + ilAlignments.Draw(Canvas, X, Y, Index); + + with Rect do + begin + X := Left + 1 + ilAlignments.Width + 1 + 2; + Y := Top + (Bottom - Top - Canvas.TextHeight('Wq')) div 2; + end; + Canvas.TextOut(X, Y, Items[Index]); + end; +end; + +initialization + dxPSRegisterReportLink(TdxTextReportLink, nil, TdxfmTextReportLinkDesignWindow); + dxPSRegisterReportLink(TdxMemoReportLink, TMemo, TdxfmTextReportLinkDesignWindow); + +finalization + dxPSUnregisterReportLink(TdxMemoReportLink, TMemo, TdxfmTextReportLinkDesignWindow); + dxPSUnregisterReportLink(TdxTextReportLink, nil, TdxfmTextReportLinkDesignWindow); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSTextOut.pas b/official/x.35/ExpressPrinting System/Sources/dxPSTextOut.pas new file mode 100644 index 00000000..9ea212c1 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSTextOut.pas @@ -0,0 +1,1137 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSTextOut; + +interface + +{$I cxVer.inc} + +uses + Windows, Classes, Graphics, {$IFDEF DELPHI5} Contnrs, {$ENDIF} dxPSGlbl; + +{type + TdxTextAlignX = (taLeft, taCenterX, taRight, taJustifyX, taDistributeX); + TdxTextAlignY = (taTop, taCenterY, taBottom, taDistributeY);} + +const + DXTO_LEFT = $00000000; + DXTO_CENTER_HORIZONTALLY = $00000001; + DXTO_RIGHT = $00000002; + DXTO_JUSTIFY_HORIZONTALLY = $00000003; + DXTO_DISTRIBUTE_HORIZONTALLY = $00000004; + + DXTO_TOP = $00000000; + DXTO_CENTER_VERTICALLY = $00000010; + DXTO_BOTTOM = $00000020; + DXTO_DISTRIBUTE_VERTICALLY = $00000030; + + DXTO_WORDBREAK = $00000100; + DXTO_SINGLELINE = $00000200; + DXTO_EXPANDTABS = $00000400; + DXTO_END_ELLIPSIS = $00000800; + + DXTO_PATTERNEDTEXT = $00001000; + DXTO_EXTERNALLEADING = $00002000; + DXTO_EDITCONTROL = $00004000; + DXTO_NOCLIP = $00008000; + + DXTO_AUTOINDENTS = $00010000; + DXTO_CHARBREAK = $00020000; + DXTO_PREVENT_LEFT_EXCEED = $00040000; + DXTO_PREVENT_TOP_EXCEED = $00080000; + + DXTO_CALCRECT = $00100000; + DXTO_CALCROWCOUNT = $00200000; + + DXTO_NOPREFIX = $00000000; + DXTO_HIDEPREFIX = $01000000; + + DXTO_DEFAULT_FORMAT = DXTO_AUTOINDENTS or DXTO_PATTERNEDTEXT; + +type + TdxVerticalTextOutDirection = (vtdTopToBottom, vtdBottomToTop); + + TdxTextParams = record + RowHeight: Integer; + tmExternalLeading: Integer; + FullRowHeight: Integer; + OnePixel: Integer; + EndEllipsisWidth: Integer; + BreakChar: Char; + Bold: Boolean; + TextAlignX: TdxTextAlignX; + TextAlignY: TdxTextAlignY; + WordBreak: Boolean; + SingleLine: Boolean; + ExpandTabs: Boolean; + EndEllipsis: Boolean; + PatternedText: Boolean; + ExternalLeading: Boolean; + EditControl: Boolean; + NoClip: Boolean; + AutoIndents: Boolean; + PreventLeftExceed: Boolean; + PreventTopExceed: Boolean; + CharBreak: Boolean; + CalcRowCount: Boolean; + CalcRect: Boolean; + HidePrefix: Boolean; + end; + + TdxTextRow = class + public + Text: PChar; + CharCount: Integer; + TextExtents: TSize; + BreakCount: Integer; + TextOriginX: Integer; + TextOriginY: Integer; + procedure CalculateExtents(DC: HDC; const ATextParams: TdxTextParams); virtual; + end; + + TdxTextRows = class({$IFDEF DELPHI5}TObjectList{$ELSE}TList{$ENDIF}) + private + function GetItem(Index: Integer): TdxTextRow; + procedure SetItem(Index: Integer; Value: TdxTextRow); + public + function CalculateMaxWidth: Integer; + {$IFNDEF DELPHI5} + procedure Clear; override; + {$ENDIF} + property Items[Index: Integer]: TdxTextRow read GetItem write SetItem; default; + end; + +function dxCalcTextParams(DC: HDC; AFormat: DWORD; const ALineSpacingFactor: Double = 1.0): TdxTextParams; +function dxCalcTextExtents(DC: HDC; AText: PChar; ATextLength: Integer; AExpandTabs: Boolean): TSize; +function dxMakeFormat(ATextAlignX: TdxTextAlignX; ATextAlignY: TdxTextAlignY): DWORD; +function dxMakeTextRows(DC: HDC; const Source: string; const R: TRect; + const ATextParams: TdxTextParams): TdxTextRows; +procedure dxPlaceTextRows(DC: HDC; const R: TRect; var ATextParams: TdxTextParams; + ATextRows: TdxTextRows; ARowCount: Integer); +function dxPrepareRect(const R: TRect; const ATextParams: TdxTextParams; + ALeftIndent: Integer = 0; ARightIndent: Integer = 0): TRect; +procedure dxTextRowsOut(DC: HDC; const R: TRect; const ATextParams: TdxTextParams; + ATextRows: TdxTextRows; ARowCount: Integer); + +function dxTextOut(DC: HDC; S: string; var R: TRect; AFormat: DWORD; + AFont: TFont = nil; AMaxLineCount: Integer = 0; ALeftIndent: Integer = 0; + ARightIndent: Integer = 0; ATextColor: TColor = clDefault; // -> current TextColor is used + const ALineSpacingFactor: Double = 1.0): Integer; + +procedure dxRotatedTextOut(DC: HDC; const ABounds: TRect; const AText: string; AFont: TFont; + AAlignHorz: TdxTextAlignX = taCenterX; AAlignVert: TdxTextAlignY = taCenterY; AWordBreak: Boolean = True; + ALeftExceed: Boolean = True; ARightExceed: Boolean = True; ADirection: TdxVerticalTextOutDirection = vtdBottomToTop; + AFontSize: Integer = 0); + +const + dxEndEllipsisChars = '...'; + dxMinVisuallyVisibleTextHeight = 6; + dxTextSpace = 2; + +implementation + +uses + SysUtils, cxClasses, cxControls, cxGraphics, dxPSUtl; + +function GetTabbedTextExtent(hDC: HDC; lpString: PChar; nCount, nTabPositions: Integer; + lpnTabStopPositions: Pointer): DWORD; stdcall; external user32 name 'GetTabbedTextExtentA'; +function TabbedTextOut(hDC: HDC; X, Y: Integer; lpString: PChar; nCount, nTabPositions: Integer; + lpnTabStopPositions: Pointer; nTabOrigin: Integer): Longint; stdcall; external user32 name 'TabbedTextOutA'; + +const + Tab: Char = #9; + CR: Char = #13; + LF: Char = #10; + Space: Char = ' '; + + DXTO_HORZ_ALIGN_MASK = DXTO_CENTER_HORIZONTALLY or DXTO_RIGHT or DXTO_JUSTIFY_HORIZONTALLY or DXTO_DISTRIBUTE_HORIZONTALLY; + DXTO_VERT_ALIGN_MASK = DXTO_CENTER_VERTICALLY or DXTO_BOTTOM or DXTO_DISTRIBUTE_VERTICALLY; + DXTO_VERT_ALIGN_OFFSET = 4; + +var + FillPatterns: array[Boolean] of HBRUSH; + +{ TdxTextRow } + +procedure TdxTextRow.CalculateExtents(DC: HDC; const ATextParams: TdxTextParams); +begin + TextExtents := dxCalcTextExtents(DC, Text, CharCount, ATextParams.ExpandTabs); +end; + +{ TdxTextRows } + +function TdxTextRows.CalculateMaxWidth: Integer; +var + I, V: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + begin + V := Items[I].TextExtents.cX; + if V > Result then Result := V; + end; +end; + +{$IFNDEF DELPHI5} +procedure TdxTextRows.Clear; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].Free; + inherited; +end; +{$ENDIF} + +function TdxTextRows.GetItem(Index: Integer): TdxTextRow; +begin + Result := TdxTextRow(inherited Items[Index]); +end; + +procedure TdxTextRows.SetItem(Index: Integer; Value: TdxTextRow); +begin + inherited Items[Index] := Value; +end; + +{ utility routines } + +function CreateTextRow(DC: HDC; var Source: PChar; var ALength: Integer; + AWidth: Integer; AIsLastRow: Boolean; const ATextParams: TdxTextParams): TdxTextRow; + + function GetCharAt(P: PChar; ACharIndex: Integer; ACharSize: Integer): Char; + begin + Result := P[ACharIndex]; + end; + + function CharIsBreak(Ch: Char): Boolean; overload; + begin + Result := (Ch = Space) or (Ch = Tab); //Q99343 don't use ATextParams.BreakChar (bug with Segoe UI) + end; + + function CharIsBreak(P: PChar; ACharIndex: Integer; ACharSize: Integer): Boolean; overload; + begin + Result := CharIsBreak(GetCharAt(P, ACharIndex, ACharSize)); + end; + + procedure IncPChar(var P: PChar; AnOffset: Integer); + begin + Inc(P, AnOffset); + end; + +var + R: TRect; + TotalTextWidth, BreakPos, CharSize, I: Integer; + PDBCSSource: PChar; + BreakByWords, BreakByChars, IsSpecialProcessedRow, HasCRSequence: Boolean; + Ch: Char; + Size: TSize; +begin + Result := TdxTextRow.Create; + if Source = nil then Exit; + + TotalTextWidth := 0; + BreakPos := -1; + CharSize := 1; + PDBCSSource := Source; + + with ATextParams do + begin + BreakByWords := not SingleLine and (WordBreak or (TextAlignX in [taJustifyX, taDistributeX])); + BreakByChars := BreakByWords and CharBreak; + IsSpecialProcessedRow := not NoClip and not (TextAlignX in [taJustifyX, taDistributeX]) and AIsLastRow and EndEllipsis; + end; + + with Result do + begin + for I := 0 to ALength - 1 do + begin + if SysLocale.FarEast then + begin + CharSize := cxStrCharLength(PDBCSSource); + if StrByteType(Source, I) = mbTrailByte then + Continue; + Inc(PDBCSSource, CharSize); + end; + CharCount := I + 1 + CharSize - 1 ; + + Ch := GetCharAt(Source, I, CharSize); + + if CharIsBreak(Ch) then + begin + Inc(BreakCount); + BreakPos := I; + end; + + //todo: DB53862 + if ((Ch = CR) or (Ch = LF)) {and not IsSpecialProcessedRow and not ATextParams.SingleLine} then + begin + Dec(CharCount); + if ATextParams.TextAlignX = taJustifyX then BreakCount := 0; + Break; + end; + + if BreakByWords or IsSpecialProcessedRow or ATextParams.SingleLine then + begin + if not ATextParams.ExpandTabs then + begin + Windows.GetTextExtentPoint32(DC, @Ch, CharSize, Size); + Inc(TotalTextWidth, Size.cX); + end + else + begin + if AWidth > High(Word) then + begin + R := NullRect; + DrawText(DC, Source, CharCount, R, + DT_SINGLELINE or DT_NOPREFIX or DT_CALCRECT or DT_EXPANDTABS); + TotalTextWidth := R.Right - R.Left; + end + else + TotalTextWidth := LoWord(GetTabbedTextExtent(DC, Source, CharCount, 0, nil)); + end; + + if TotalTextWidth >= AWidth then + begin + if ATextParams.SingleLine or IsSpecialProcessedRow or + ((TotalTextWidth = AWidth) and ((I = ALength - 1) or CharIsBreak(Source, I + 1, CharSize))) then + Break + else + if (BreakPos <> -1) then//and ((TotalTextWidth > AWidth) or ATextParams.CalcRect) then + begin + if not ATextParams.CalcRect then + CharCount := BreakPos + 1; + Break; + end + else + if BreakByChars then + begin + if (TotalTextWidth > AWidth) and (CharCount > CharSize) then + Dec(CharCount, CharSize); + Break; + end; + end; + end; + end; + Text := Source; + + // truncate trailing spaces + if ATextParams.TextAlignX in [taJustifyX, taDistributeX] then + while (CharCount > 0) and CharIsBreak(Source, CharCount - 1, CharSize) do + begin + if BreakCount > 0 then Dec(BreakCount); + Dec(CharCount, CharSize ); + end; + end; + + Result.CalculateExtents(DC, ATextParams); + + HasCRSequence := False; + IncPChar(Source, Result.CharCount); + Dec(ALength, Result.CharCount); + I := 0; + while (I < ALength) and (GetCharAt(Source, I, CharSize) = Space) do //Q99343 don't use ATextParams.BreakChar (bug with Segoe UI) + Inc(I); + if I < ALength then + begin + if GetCharAt(Source, I, CharSize) = Tab then Inc(I); + HasCRSequence := GetCharAt(Source, I, CharSize) = CR; + if GetCharAt(Source, I, CharSize) = CR then Inc(I); + if GetCharAt(Source, I, CharSize) = LF then Inc(I); + end; + IncPChar(Source, I); + Dec(ALength, I); + + // doesn't justify last row like Excel does? + if ((ALength = 0) or HasCRSequence) and (ATextParams.TextAlignX = taJustifyX) then + Result.BreakCount := 0; +end; + +function dxCalcTextParams(DC: HDC; AFormat: DWORD; const ALineSpacingFactor: Double = 1.0): TdxTextParams; +var + TextMetric: TTextMetric; + R: TRect; +begin + FillChar(Result, SizeOf(Result), 0); + GetTextMetrics(DC, TextMetric); + with Result do + begin + BreakChar := TextMetric.tmBreakChar; + RowHeight := dxCalcTextExtents(DC, 'Wg', 2, False).cY; + Bold := TextMetric.tmWeight >= FW_BOLD; + + TextAlignX := TdxTextAlignX(AFormat and DXTO_HORZ_ALIGN_MASK); + TextAlignY := TdxTextAlignY(AFormat and DXTO_VERT_ALIGN_MASK shr DXTO_VERT_ALIGN_OFFSET); + + AutoIndents := AFormat and DXTO_AUTOINDENTS <> 0; + CalcRect := AFormat and DXTO_CALCRECT <> 0; + CalcRowCount := AFormat and DXTO_CALCROWCOUNT <> 0; + CharBreak := (AFormat and DXTO_CHARBREAK <> 0) or SysLocale.FarEast; + EditControl := AFormat and DXTO_EDITCONTROL <> 0; + EndEllipsis := AFormat and DXTO_END_ELLIPSIS <> 0; + ExternalLeading := AFormat and DXTO_EXTERNALLEADING <> 0; + ExpandTabs := AFormat and DXTO_EXPANDTABS <> 0; + NoClip := AFormat and DXTO_NOCLIP <> 0; + PatternedText := AFormat and DXTO_PATTERNEDTEXT <> 0; + PreventLeftExceed := AFormat and DXTO_PREVENT_LEFT_EXCEED <> 0; + PreventTopExceed := AFormat and DXTO_PREVENT_TOP_EXCEED <> 0; + SingleLine := AFormat and DXTO_SINGLELINE <> 0; + WordBreak := AFormat and DXTO_WORDBREAK <> 0; + HidePrefix := AFormat and DXTO_HIDEPREFIX <> 0; + + R := Rect(0, 0, 1, 1); + DPtoLP(DC, R, 2); + OnePixel := R.Right - R.Left; + + if ExternalLeading then + tmExternalLeading := TextMetric.tmExternalLeading; + FullRowHeight := Round((RowHeight + tmExternalLeading) * ALineSpacingFactor); + + if PatternedText then + begin + R := Rect(0, 0, dxMinVisuallyVisibleTextHeight, dxMinVisuallyVisibleTextHeight); + DPtoLP(DC, R, 2); + PatternedText := RowHeight < R.Bottom - R.Top; + end; + + EndEllipsisWidth := dxCalcTextExtents(DC, dxEndEllipsisChars, Length(dxEndEllipsisChars), False).cX; + end; +end; + +function dxCalcTextExtents(DC: HDC; AText: PChar; ATextLength: Integer; + AExpandTabs: Boolean): TSize; +var + R: TRect; +begin + if AExpandTabs then + begin +{ //todo: CB41669 textextent.cx can greate then max of LoWord + V := GetTabbedTextExtent(DC, AText, ATextLength, 0, nil); + Result.cX := LoWord(V); + Result.cY := HiWord(V);} + R := Rect(0, 0, 0, 0); + DrawText(DC, AText, ATextLength, R, DT_SINGLELINE or DT_NOPREFIX or DT_CALCRECT or DT_EXPANDTABS); + Result.cx := R.Right - R.Left; + Result.cy := R.Bottom - R.Right; + end + else + GetTextExtentPoint32(DC, AText, ATextLength, Result); +end; + +function dxMakeFormat(ATextAlignX: TdxTextAlignX; ATextAlignY: TdxTextAlignY): DWORD; +begin + Result := Byte(ATextAlignX) or (Byte(ATextAlignY) shl DXTO_VERT_ALIGN_OFFSET); +end; + +function dxMakeTextRows(DC: HDC; const Source: string; const R: TRect; const ATextParams: TdxTextParams): TdxTextRows; + + function CheckIsLastRow(ATotalHeight, H: Integer): Boolean; + begin + with ATextParams do + if SingleLine then + Result := True + else + if (R.Bottom <> MaxInt) and (TextAlignY = taTop) and not CalcRect then + begin + if (EditControl{ or EndEllipsis}) and not NoClip then + Result := ATotalHeight + FullRowHeight > H + else + Result := ATotalHeight > H + end + else + Result := False; + end; + +var + P: PChar; + TextRow: TdxTextRow; + IsLastRow: Boolean; + TotalHeight, L, H, W: Integer; +begin + if (Source <> '') and (Source[1] <> #0) then + begin + P := Pointer(Source); + Result := TdxTextRows.Create; + if ATextParams.CalcRect and ATextParams.SingleLine then + begin + TextRow := TdxTextRow.Create; + TextRow.Text := P; + TextRow.CharCount := Length(Source); + TextRow.CalculateExtents(DC, ATextParams); + Result.Add(TextRow); + end + else + begin + IsLastRow := False; + TotalHeight := 0; + L := Length(Source); + W := R.Right - R.Left; + H := R.Bottom - R.Top; + + while (P^ <> #0) and not IsLastRow do + begin + Inc(TotalHeight, ATextParams.FullRowHeight); + IsLastRow := CheckIsLastRow(TotalHeight, H); + TextRow := CreateTextRow(DC, P, L, W, IsLastRow, ATextParams); + Result.Add(TextRow); + if not IsLastRow then IsLastRow := L = 0; + end; + end; + end + else + Result := nil; +end; + +procedure dxPlaceTextRows(DC: HDC; const R: TRect; var ATextParams: TdxTextParams; + ATextRows: TdxTextRows; ARowCount: Integer); + + procedure CalcExtraAndTopRowOffset(out AExtra, ATopRowOffset: Integer); + var + H: Integer; + begin + AExtra := 0; + with ATextParams do + begin + if (ARowCount > 1) and (TextAlignY = taDistributeY) then + begin + H := R.Bottom - R.Top; + Dec(H, RowHeight); + if H / (ARowCount - 1) > RowHeight then + begin + FullRowHeight := H div (ARowCount - 1); + AExtra := H mod (ARowCount - 1); + end; + end; + + case TextAlignY of + taCenterY: + ATopRowOffset := R.Top + (R.Bottom - R.Top - ARowCount * FullRowHeight) div 2; + taBottom: + ATopRowOffset := R.Bottom - ARowCount * FullRowHeight + tmExternalLeading; + else + ATopRowOffset := R.Top; + end; + + if PreventTopExceed and (ATopRowOffset < R.Top) then + ATopRowOffset := R.Top; + end; + end; + + procedure PlaceRows(AExtra, ATopRowOffset: Integer); + var + I: Integer; + begin + for I := 0 to ARowCount - 1 do + with ATextRows[I] do + begin + // Horizontally + case ATextParams.TextAlignX of + taCenterX: + TextOriginX := R.Left + (R.Right - R.Left - TextExtents.cX) div 2; + taRight: + TextOriginX := R.Right - TextExtents.cX; + else + TextOriginX := R.Left; + end; + if ATextParams.PreventLeftExceed and (TextOriginX < R.Left) then + TextOriginX := R.Left; + + // Vertically + TextOriginY := ATopRowOffset; + Inc(ATopRowOffset, ATextParams.FullRowHeight); + if AExtra > 0 then + begin + Inc(ATopRowOffset); + Dec(AExtra); + end; + end; + end; + +var + Extra, TopRowOffset: Integer; +begin + CalcExtraAndTopRowOffset(Extra, TopRowOffset); + PlaceRows(Extra, TopRowOffset); +end; + +function dxPrepareRect(const R: TRect; const ATextParams: TdxTextParams; + ALeftIndent, ARightIndent: Integer): TRect; +begin + Result := R; + with Result, ATextParams do + begin + if AutoIndents then + InflateRect(Result, -dxTextSpace * OnePixel, -dxTextSpace * OnePixel); + Inc(Left, ALeftIndent * OnePixel); + Dec(Right, ARightIndent * OnePixel); + end; +end; + +function dxUnprepareRect(const R: TRect; const ATextParams: TdxTextParams; + ALeftIndent: Integer = 0; ARightIndent: Integer = 0): TRect; +begin + Result := R; + with Result, ATextParams do + begin + Dec(Left, ALeftIndent * OnePixel); + Inc(Right, ARightIndent * OnePixel); + if AutoIndents then + InflateRect(Result, dxTextSpace * OnePixel, dxTextSpace * OnePixel); + end; +end; + +procedure dxTextRowsOut(DC: HDC; const R: TRect; const ATextParams: TdxTextParams; + ATextRows: TdxTextRows; ARowCount: Integer); + + procedure OutTextRowAsPattern(const ATextRow: TdxTextRow; R: TRect); + var + BkColor: COLORREF; + begin + InflateRect(R, 0, -ATextParams.OnePixel); + with R do + begin + if Bottom <= Top then + Bottom := Top + ATextParams.OnePixel; + Left := ATextRow.TextOriginX; + if Right > Left + ATextRow.TextExtents.cX then + Right := Left + ATextRow.TextExtents.cX; + end; + + BkColor := SetBkColor(DC, ColorToRGB(clWindow)); + FillRect(DC, R, FillPatterns[ATextParams.Bold]); + SetBkColor(DC, BkColor); + end; + + procedure OutTextRow(const ATextRow: TdxTextRow); + begin + with ATextRow do + if ATextParams.ExpandTabs then + TabbedTextOut(DC, TextOriginX, TextOriginY, Text, CharCount, 0, nil, 0) + else + ExtTextOut(DC, TextOriginX, TextOriginY, 0, nil, Text, CharCount, nil); + end; + + procedure PrepareEndEllipsis(var ATextRow: TdxTextRow; var AWidth: Integer); + var + CharNumber: Integer; + Size: TSize; + begin + Dec(AWidth, ATextParams.EndEllipsisWidth); + if AWidth < 0 then AWidth := 0; + with ATextRow do + begin + GetTextExtentExPoint(DC, Text, CharCount, AWidth, @CharNumber, nil, Size); + if CharNumber = 0 then Inc(CharNumber); + CharCount := CharNumber; + end; + ATextRow.CalculateExtents(DC, ATextParams); + end; + + procedure OutEndEllipsis(const ATextRow: TdxTextRow; var ARowRect: TRect); + var + fuOptions: UINT; + begin + Inc(ARowRect.Left, ATextRow.TextExtents.cX); + if ARowRect.Left < ARowRect.Right then + begin + fuOptions := 0; + if not ATextParams.NoClip and (ARowRect.Left + ATextParams.EndEllipsisWidth > ARowRect.Right) then + fuOptions := ETO_CLIPPED; + ExtTextOut(DC, ARowRect.Left, ATextRow.TextOriginY, fuOptions, @ARowRect, + dxEndEllipsisChars, Length(dxEndEllipsisChars), nil); + end; + end; + + function IntersectClipRect(const R: TRect): HRGN; + begin + Result := CreateRectRgn(0, 0, 0, 0); + if GetClipRgn(DC, Result) = -1 then + begin + DeleteObject(Result); + Result := 0; + end; + with R do + Windows.IntersectClipRect(DC, Left, Top, Right, Bottom); + end; + + procedure RestoreClipRgn(var ARgn: HRGN); + begin + SelectClipRgn(DC, ARgn); + if ARgn <> 0 then + begin + DeleteObject(ARgn); + ARgn := 0 + end; + end; + +var + RowRect: TRect; + W, I, BreakExtra, PrevBkMode: Integer; + NeedClipping, NeedEndEllipsis: Boolean; + TextRow: TdxTextRow; + AClipRgn: HRGN; + AIsMetaFile: Boolean; +begin + W := R.Right - R.Left; + RowRect := R; + AIsMetaFile := IsMetaFileDC(DC); + AClipRgn := 0; + PrevBkMode := SetBkMode(DC, Windows.TRANSPARENT); + for I := 0 to ARowCount - 1 do + begin + TextRow := ATextRows[I]; + with TextRow, ATextParams do + begin + if CharCount <> 0 then + begin + RowRect.Top := TextOriginY; + RowRect.Bottom := RowRect.Top + FullRowHeight; + if RectVisible(DC, RowRect) then + begin + if PatternedText then + OutTextRowAsPattern(TextRow, RowRect) + else + begin + NeedEndEllipsis := EndEllipsis and (TextExtents.cX > W) and (I = ARowCount - 1); + + BreakExtra := 0; + if (TextAlignX in [taJustifyX, taDistributeX]) and not NeedEndEllipsis then + begin + BreakExtra := W - TextExtents.cX; + if (BreakCount <> 0) and (BreakExtra > 0) then + SetTextJustification(DC, BreakExtra, BreakCount); + end; + + NeedClipping := not NoClip and ((TextExtents.cX > W) or (RowRect.Top < R.Top) or (RowRect.Bottom > R.Bottom)); + + if NeedClipping then + begin + if RowRect.Top < R.Top then RowRect.Top := R.Top; + if RowRect.Bottom > R.Bottom then RowRect.Bottom := R.Bottom; + if not AIsMetaFile then + AClipRgn := IntersectClipRect(RowRect); + end; + + if NeedEndEllipsis then PrepareEndEllipsis(TextRow, W); + OutTextRow(TextRow); + if NeedEndEllipsis then OutEndEllipsis(TextRow, RowRect); + + if NeedClipping and not AIsMetaFile then + RestoreClipRgn(AClipRgn); + + if BreakExtra > 0 then SetTextJustification(DC, 0, 0); + end; + end; + end; + end; + end; + SetBkMode(DC, PrevBkMode); +end; + +function dxTextOut(DC: HDC; S: string; var R: TRect; AFormat: DWORD; + AFont: TFont = nil; AMaxLineCount: Integer = 0; ALeftIndent: Integer = 0; + ARightIndent: Integer = 0; ATextColor: TColor = clDefault; + const ALineSpacingFactor: Double = 1.0): Integer; + + function ProcessText(const ATextParams: TdxTextParams; const ATextRect: TRect): Boolean; + begin + if ATextParams.CalcRect then + Result := (ATextRect.Right - ATextRect.Left) > 0 + else + Result := not IsRectEmpty(ATextRect); + end; + +var + PrevFont: HFONT; + PrevFontColor: COLORREF; + TextHeight: Integer; + TextParams: TdxTextParams; + TextRect: TRect; + TextRows: TdxTextRows; + RowCount: Integer; +begin + PrevFont := GetCurrentObject(DC, OBJ_FONT); + PrevFontColor := GetTextColor(DC); + if AFont <> nil then + begin + PrevFont := SelectObject(DC, AFont.Handle); + SetTextColor(DC, ColorToRGB(AFont.Color)); + end; + if ATextColor <> clDefault then + SetTextColor(DC, ColorToRGB(ATextColor)); + + TextParams := dxCalcTextParams(DC, AFormat, ALineSpacingFactor); + TextRect := dxPrepareRect(R, TextParams, ALeftIndent, ARightIndent); + + TextHeight := 0; + RowCount := 0; + if ProcessText(TextParams, TextRect) then + begin + if TextParams.HidePrefix then S := RemoveAccelChars(S, False); + + TextRows := dxMakeTextRows(DC, S, TextRect, TextParams); + if TextRows <> nil then + try + RowCount := TextRows.Count; + if TextParams.CalcRect then + begin + TextRect.Right := TextRect.Left + TextRows.CalculateMaxWidth; + if not TextParams.SingleLine then + begin + TextRows.Free; + TextRows := dxMakeTextRows(DC, S, TextRect, TextParams); + RowCount := TextRows.Count; + end; + dxPlaceTextRows(DC, TextRect, TextParams, TextRows, RowCount); + TextRect.Bottom := TextRect.Top + TextRows[RowCount - 1].TextOriginY + TextParams.RowHeight; + R := dxUnprepareRect(TextRect, TextParams, ALeftIndent, ARightIndent); + end + else + begin + if (AMaxLineCount > 0) and (RowCount > AMaxLineCount) then + RowCount := AMaxLineCount; + dxPlaceTextRows(DC, TextRect, TextParams, TextRows, RowCount); + dxTextRowsOut(DC, TextRect, TextParams, TextRows, RowCount); + end; + TextHeight := TextRows[RowCount - 1].TextOriginY + TextParams.RowHeight - TextRect.Top; + finally + TextRows.Free; + end; + end; + + if TextParams.CalcRowCount or (TextHeight = 0) then + Result := RowCount + else + Result := TextHeight; + + SelectObject(DC, PrevFont); + SetTextColor(DC, PrevFontColor); +end; + +procedure CreateFillPatterns; +const + BoldPatternBits: array[0..7] of Word = ($0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000); + StandardPatternBits: array[0..7] of Word = ($5555, $AAAA, $5555, $AAAA, $5555, $AAAA, $5555, $AAAA); + + function AllocPBits(AnIsBold: Boolean): Pointer ; + begin + if AnIsBold then + Result := @BoldPatternBits + else + Result := @StandardPatternBits; + end; + + procedure FreePBits(var APBits: Pointer ); + begin + end; + + function CreateFillPattern(AnIsBold: Boolean): HBRUSH; + var + PBits: Pointer ; + Bitmap: HBITMAP; + begin + PBits := AllocPBits(AnIsBold); + try + Bitmap := CreateBitmap(8, 8, 1, 1, PBits); + try + Result := CreatePatternBrush(Bitmap); + finally + DeleteObject(Bitmap); + end; + finally + FreePBits(PBits); + end; + end; + +begin + FillPatterns[False] := CreateFillPattern(False); + FillPatterns[True] := CreateFillPattern(True); +end; + +procedure DestroyFillPatterns; +begin + if FillPatterns[False] <> 0 then DeleteObject(FillPatterns[False]); + if FillPatterns[True] <> 0 then DeleteObject(FillPatterns[True]); +end; + +procedure dxRotatedTextOut(DC: HDC; const ABounds: TRect; const AText: string; AFont: TFont; + AAlignHorz: TdxTextAlignX = taCenterX; AAlignVert: TdxTextAlignY = taCenterY; AWordBreak: Boolean = True; + ALeftExceed: Boolean = True; ARightExceed: Boolean = True; ADirection: TdxVerticalTextOutDirection = vtdBottomToTop; + AFontSize: Integer = 0); + +const + Angles: array[TdxVerticalTextOutDirection] of Integer = (-900, 900); + Flags: array[TdxVerticalTextOutDirection] of Integer = + (TA_LEFT or TA_BOTTOM or TA_NOUPDATECP, TA_LEFT or TA_TOP or TA_NOUPDATECP); + + procedure AddRow(AList: TList; AFirstChar: PChar; ACount, AWidth: Integer); + begin + AList.Add(AFirstChar); + AList.Add(Pointer(ACount)); + AList.Add(Pointer(AWidth)); + end; + + function CreateRotatedFont: HFONT; + var + ALogFont: TLogFont; + begin + FillChar(ALogFont, SizeOf(ALogFont), 0); + cxGetFontData(AFont.Handle, ALogFont); + if AFontSize <> 0 then + ALogFont.lfHeight := -MulDiv(AFontSize, GetDeviceCaps(DC, LOGPIXELSY), 72); + ALogFont.lfEscapement := Angles[ADirection]; + ALogFont.lfOutPrecision := OUT_TT_ONLY_PRECIS; + Result := CreateFontIndirect(ALogFont); + end; + + function TextSize(ACurrentChar: PChar; ACharCount: Integer): TSize; + begin + GetTextExtentPoint32(DC, ACurrentChar, ACharCount, Result); + end; + + function GetNextChar(AFirstChar: PChar; ALen: Integer = 1): PChar; + begin + Result := AFirstChar; + while ALen > 0 do + begin + if Result^ in LeadBytes then + Inc(Integer(Result)); + Inc(Integer(Result)); + Dec(ALen); + end; + end; + + function TextWidth(const AFirstChar: PChar; ACharCount: Integer): Integer; + var + ASize: TSize; + begin + GetTextExtentPoint32(DC, AFirstChar, ACharCount, ASize); + Result := ASize.cx; + end; + + function MakeRow(var AFirstChar: PChar; ALastChar: PChar; + ACharCount, ARowCharCount: Integer; ATextRows: TList): Integer; + begin + // make break and move first point to current point + AddRow(ATextRows, AFirstChar, ARowCharCount, TextWidth(AFirstChar, ARowCharCount)); + if ALastChar^ = ' ' then + begin + Dec(ACharCount); + ALastChar := GetNextChar(ALastChar); + end; + AFirstChar := ALastChar; + Result := ACharCount - ARowCharCount; + end; + + procedure CalculateWordWrappedTextRows(AFirstChar: PChar; + ACharCount, ATextWidth: Integer; ATextRows: TList); + var + ACurrentChar, APrevBreakChar: PChar; + AIsBreakChar, AHasPrevBreak: Boolean; + APos, APrevBreakPos, AWidth: Integer; + begin + while ACharCount > 0 do + begin + ACurrentChar := AFirstChar; + APos := 0; + AHasPrevBreak := False; + AWidth := 0; + APrevBreakPos := 0; + APrevBreakChar := ' '; + while APos < ACharCount do + begin + ACurrentChar := GetNextChar(ACurrentChar); + Inc(APos); + AIsBreakChar := (ACurrentChar^ = Space) or (ACurrentChar^ = #13) or (ACurrentChar^ = #10); + if AIsBreakChar or (APos = ACharCount) then + begin + AWidth := TextWidth(AFirstChar, APos); + if AWidth < ATextWidth then + begin + AHasPrevBreak := AIsBreakChar; + APrevBreakPos := APos; + APrevBreakChar := ACurrentChar; + end; + end; + if (AIsBreakChar and ((AWidth > ATextWidth) or (ACurrentChar^ in [#13, #10]))) or (APos = ACharCount) then + begin + if AHasPrevBreak and (AWidth > ATextWidth) then + begin + APos := APrevBreakPos; + ACurrentChar := APrevBreakChar; + end; + ACharCount := MakeRow(AFirstChar, ACurrentChar, ACharCount, APos, ATextRows); + Break; + end; + end; + end; + end; + + function ProcessHorizontalAlignemnt(const ATextBounds: TRect; + AWidth: Integer): Integer; + var + ARightPos, ALeftPos: Integer; + begin + if ADirection = vtdBottomToTop then + begin + ARightPos := ATextBounds.Top + AWidth; + ALeftPos := ATextBounds.Bottom; + end + else + begin + ALeftPos := ATextBounds.Top; + ARightPos := ATextBounds.Bottom - AWidth; + end; + if AAlignHorz = taLeft then + Result := ALeftPos + else + if AAlignHorz = taRight then + Result := ARightPos + else + begin + if ADirection = vtdBottomToTop then + Result := (ATextBounds.Top + ATextBounds.Bottom + AWidth) div 2 + else + Result := (ATextBounds.Top + ATextBounds.Bottom - AWidth) div 2 + end; + if AWidth > (ATextBounds.Bottom - ATextBounds.Top) then + begin + if ARightExceed then + Result := ARightPos + else + if ALeftExceed then + Result := ALeftPos; + end; + end; + + function ProcessVerticalAlignemnt(const ATextBounds: TRect; + ARowHeight, ARowCount: Integer): Integer; + begin + if ADirection = vtdBottomToTop then + begin + // align by horizontally + if AAlignVert = taBottom then + begin + Result := ATextBounds.Right - ARowHeight * ARowCount; + if Result < ATextBounds.Left then + Result := ATextBounds.Left; + end + else + if AAlignVert = taCenterY then + Result := (ATextBounds.Left + ATextBounds.Right - ARowHeight * ARowCount) div 2 + else + Result := ATextBounds.Left; + if Result < ATextBounds.Left then + Result := ATextBounds.Left; + end + else + begin + if AAlignVert = taTop then + Result := ATextBounds.Right - ARowHeight + else + if AAlignVert = taCenterY then + Result := (ATextBounds.Left - ARowHeight + ATextBounds.Right + ARowHeight * (ARowCount - 1)) div 2 + else + Result := ATextBounds.Left + ARowHeight * (ARowCount - 1); + if Result > (ATextBounds.Right - ARowHeight) then + Result := ATextBounds.Right - ARowHeight; + end; + end; + + procedure PlaceTextRows(ATextRows: TList; ATextBounds: TRect); + var + ASize: TSize; + I, ALeft, ATop, ARowCount, AWidth: Integer; + begin + GetTextExtentPoint32(DC, 'Wg', 2, ASize); + ARowCount := ATextRows.Count div 3; + ALeft := ProcessVerticalAlignemnt(ATextBounds, ASize.cy, ARowCount); + for I := 0 to ARowCount - 1 do + begin + // align by vertically + AWidth := Integer(ATextRows.List^[I * 3 + 2]); + ATop := ProcessHorizontalAlignemnt(ATextBounds, AWidth); + // out text row + ExtTextOut(DC, ALeft, ATop, 0{ETO_CLIPPED}, @ATextBounds, + PChar(ATextRows.List^[I * 3]), Integer(ATextRows.List^[I * 3 + 1]), nil); + // offset place and check visibility + if ADirection = vtdBottomToTop then + Inc(ALeft, ASize.cy) + else + Dec(ALeft, ASize.cy); + if (ALeft < ATextBounds.Left) or (ALeft > ATextBounds.Right) then + Break; + end; + end; + +var +// ASize: TSize; + ATextRows: TList; + AFontHandle: HFONT; + ATextBounds: TRect; + ACharCount, AMode, AWidth: Integer; +begin + ACharCount := Length(AText); + if ACharCount = 0 then Exit; + ATextBounds := ABounds; + InflateRect(ATextBounds, -2, -2); + AWidth := ATextBounds.Bottom - ATextBounds.Top; + AFontHandle := SelectObject(DC, CreateRotatedFont); + AMode := SetBkMode(DC, Windows.TRANSPARENT); + ATextRows := TList.Create; + try + ATextRows.Capacity := Length(AText) * 3; + SetTextAlign(DC, Flags[ADirection]); + if not AWordBreak then + AddRow(ATextRows, @AText[1], ACharCount, TextWidth(@AText[1], ACharCount)) + else + CalculateWordWrappedTextRows(@AText[1], ACharCount, AWidth, ATextRows); + PlaceTextRows(ATextRows, ATextBounds); + finally + SetBkMode(DC, AMode); + AFontHandle := SelectObject(DC, AFontHandle); + DeleteObject(AFontHandle); + ATextRows.Free; + end; +end; + +initialization + CreateFillPatterns; + +finalization + DestroyFillPatterns; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSUtl.pas b/official/x.35/ExpressPrinting System/Sources/dxPSUtl.pas new file mode 100644 index 00000000..31000e35 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSUtl.pas @@ -0,0 +1,2521 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSUtl; + +interface + +{$I cxVer.inc} + +uses + {$IFDEF DELPHI6} + Variants, + {$ENDIF} + Classes, Windows, SysUtils, Graphics, Messages, Controls, StdCtrls, ComCtrls, + Dialogs, CommCtrl, Forms, Menus, ImgList, TypInfo, Registry, cxClasses, cxGraphics, + dxPSGlbl, dxPrnDev; + +const + // Marlett Font + CheckMarkIndex = 98; + CheckTopLeftArcOuterIndex = 99; + CheckBottomRightArcOuterIndex = 100; + CheckTopLeftArcInnerIndex = 101; + CheckBottomRightArcInnerIndex = 102; + CheckInteriorIndex = 103; + + RadioBeanIndex = 105; + RadioTopLeftArcOuterIndex = 106; + RadioBottomRightArcOuterIndex = 107; + RadioTopLeftArcInnerIndex = 108; + RadioBottomRightArcInnerIndex = 109; + RadioInteriorIndex = 110; + + SortUpMarkIndex = 116; + SortDownMarkIndex = 117; + + // Symbol Font + PlusSignIndex = 43; + MinusSignIndex = 45; + + InvalidFileNameChars = '<>:"|/\'; + +function Min(A, B: Integer): Integer; +function Max(A, B: Integer): Integer; +function MinMax(A, B, C: Integer): Integer; +function SetLoWord(AValue: Integer; ALoWord: Word): Integer; +function SetHiWord(AValue: Integer; AHiWord: Word): Integer; +function SetLoHiWords(AValue: Integer; ALoWord, AHiWord: Word): Integer; +function ScalePoint(const Pt: TPoint; Numerator, Denominator: Integer): TPoint; +function ScaleRect(const R: TRect; ANumeratorW, ADenominatorW, ANumeratorH, ADenominatorH: Integer): TRect; overload; +function ScaleRect(const R: TRect; ANumerator, ADenominator: Integer): TRect; overload; +function ArePointsEqual(const Pt1, Pt2: TPoint): Boolean; + +// GDI +function GetRgnData(ARgn: HRGN; out ARgnDataHeader: TRgnDataHeader; out ARects: TRects): Integer; +function ExcludeClipRect(DC: HDC; const R: TRect): HRGN; overload; +function ExcludeClipRect(DC: HDC; ALeft, ATop, ARight, ABottom: Integer): HRGN; overload; +function IntersectClipRect(DC: HDC; const R: TRect; AlwaysClip: Boolean = False): HRGN; overload; +function IntersectClipRect(DC: HDC; ALeft, ATop, ARight, ABottom: Integer; AlwaysClip: Boolean = False): HRGN; overload; +function RectVisible(DC: HDC; const ARect: TRect): Boolean; +procedure RestoreClipRgn(DC: HDC; var ARgn: HRGN); + +function dxAreBitmapsEqual(ABitmap1, ABitmap2: TBitmap): Boolean; +function dxAreBrushesEqual(ABrush1, ABrush2: TBrush): Boolean; +function dxAreGraphicsEqual(AGraphic1, AGraphic2: TGraphic): Boolean; +function dxAreFontsEqual(AFont1, AFont2: TFont): Boolean; +function dxArePensEqual(APen1, APen2: TPen): Boolean; +function dxIsTrueTypeFont(AFont: TFont): Boolean; + +function FindNearestColor(AColor: TColor): TColor; +function InvertColor(AColor: TColor): TColor; +function OffsetColor(AColor: TColor; ARed, AGreen, ABlue: Byte): TColor; + +function IsDisplayDC(DC: HDC): Boolean; +function IsMetafileDC(DC: HDC): Boolean; +function IsPrinterDC(DC: HDC): Boolean; + +function PatternBrush: HBRUSH; +procedure SetFontAsNonAntialiased(AFont: TFont); +procedure ForcePictureToBitmap(APicture: TPicture); + +function CreateGraphic(AGraphicClass: TGraphicClass): TGraphic; +function IconToBitmap(AnIcon: TIcon): TBitmap; +function CreateArrowBitmap(AUpDownGlyph: TdxUpDownGlyph; AWidth: Integer = 16; + AHeight: Integer = 16; AFontSize: Integer = 12): TBitmap; +function CreateDoubleArrowBitmap(AUpDownGlyph: TdxUpDownGlyph; AWidth: Integer = 16; + AHeight: Integer = 16; AFontSize: Integer = 8): TBitmap; +function CreateGlyphBitmap(AGlyphIndex: Integer; AWidth: Integer = 16; + AHeight: Integer = 16; AFontSize: Integer = 12): TBitmap; +procedure DrawBlendedText(ACanvas: TCanvas; const R: TRect; const AText: string; AFont: TFont); +procedure DrawGlyph(DC: HDC; const R: TRect; AGlyph: Byte); +procedure DrawSizeGrip(DC: HDC; R: TRect); +procedure TransparentDraw(DrawDC: HDC; Brush: HBRUSH; const R: TRect; ABitmap: TBitmap); + +// System +function CopyDeviceMode(Src: HGLOBAL): HGLOBAL; +function GetDesktopWorkArea: TRect; overload; +function GetDesktopWorkArea(const P: TPoint): TRect; overload; +function GetLongFileName(const Source: string): string; +function GetMachineName: string; +function GetUserName: string; +function GetVolumeName(const APath: string): string; +function IsIntelliMousePresent: Boolean; +function IsNetworkPresent: Boolean; +function IsVolume(const APath: string): Boolean; +function IsWin32Version(AMajor: Integer; AMinor: Integer = 0): Boolean; +function PopulateShellImages(FullInit: Boolean): Boolean; +function ShellLargeImages: TImageList; +function ShellSmallImages: TImageList; +function ShowSystemSelectFolderDlg(var ADirPath: string): Boolean; +function FormatFileSize(const AFileSize: Int64): string; +function ValidateFileName(const FileName: string): Boolean; +procedure Delay(Value: DWORD); //milliseconds + +procedure MessageError(const AMessage: string); +procedure MessageWarning(const AMessage: string); +function MessageQuestion(const AMessage: string): Boolean; + +// string processing +function AddColon(const Source: string): string; +function AddEndEllipsis(const Source: string): string; +function DropAmpersand(const Source: string): string; +function DropColon(const Source: string): string; +function DropEndEllipsis(const Source: string): string; +function DropT(const Source: string): string; +function ReplaceSubStr(const Source, OldChars, NewChars: string): string; +function ReplicateChar(const S: string; ACount: Integer): string; + +function dxBoolToStr(AValue: Boolean): string; +function dxSameStr(const S1, S2: string): Boolean; +function dxSameText(const S1, S2: string): Boolean; + +function FormatFontInfo(AFont: TFont): string; +procedure FontInfoToText(AFont: TFont; AEdit: TEdit); + +function MakePageIndexes(const Source: string; out AnOutput: TIntegers): Boolean; + +// Number metrics conversation +function Chars2Int(const AText: string; AnUpperCase: Boolean): Integer; +function Int2Chars(AValue: Integer; AnUpperCase: Boolean): string; +function Roman2Int(AText: string; AnUpperCase: Boolean): Integer; +function Int2Roman(AValue: Integer; AnUpperCase: Boolean): string; + +//RTTI +function HasPropertyEx(AClass: TClass; const AName: string; ATypeKinds: TTypeKinds): Boolean; overload; +function HasPropertyEx(AnObject: TObject; const AName: string; ATypeKinds: TTypeKinds): Boolean; overload; +function HasProperty(AClass: TClass; const AName: string): Boolean; overload; +function HasProperty(AnObject: TObject; const AName: string): Boolean; overload; + +function GetProperty(AnObject: TObject; const AName: string): Variant; +procedure SetProperty(AnObject: TObject; const AName: string; const AValue: Variant); + +procedure dxDrawComboBoxItem(ACanvas: TCanvas; const R: TRect; const AText: string; + AnImageList: TCustomImageList; AnImageIndex: Integer; AState: TOwnerDrawState); +procedure dxLoadStringsFromRegistry(const APath: string; AStrings: TStrings); +procedure dxSaveStringsToRegistry(const APath: string; AStrings: TStrings); +procedure dxLoadListViewColumnsFromRegistry(AListView: TListView; const APath: string); +procedure dxSaveListViewColumnsToRegistry(AListView: TListView; const APath: string); +procedure dxRestoreListViewSelection(AListView: TListView; ASelection: TList); +procedure dxSaveListViewSelection(AListView: TListView; ASelection: TList); + +procedure CopyImages(ASourceHandle: HIMAGELIST; ADest: TCustomImageList); + +procedure PlaceButtons(const AButtons: array of TButton; ABtnOffsetX, ARightOrigin, ATopOrigin: Integer); + +procedure dxAppendList(ASource, ADest: TList); +procedure dxCopyList(ASource, ADest: TList); +procedure dxShiftIntegerListValues(AList: TList; AValue: Integer); + +function dxCheckStateImageIndexMap(AState: TCheckBoxState): Integer; +procedure dxCreateCheckMarkImages(AnImageList: TCustomImageList); + +function dxPSDrawModeImages: TCustomImageList; + +{$IFNDEF DELPHI5} +procedure FreeAndNil(var Obj); +{$ENDIF} + +// VCL Helpers - introduced mostly because of Delphi.Net + +function dxAllocatehWnd(AMethod: TWndMethod): HWND; +procedure dxDeallocatehWnd(AWnd: HWND); +procedure dxRecreateWnd(AControl: TWinControl); + +function MakeBounds(ALeft, ATop, AWidth, AHeight: Integer): TRect; +function MakePoint(X, Y: Integer): TPoint; +function MakeRect(ALeft, ATop, ARight, ABottom: Integer): TRect; overload; +function MakeRect(const ATopLeft, ABottomRight: TPoint): TRect; overload; + +function TTagToInt(AValue: Integer ): Integer; +function TTagToObj(AValue: Integer ): TObject; +function TTagToClass(AValue: Integer ): TClass; + +function MakeTTag(AValue: Integer): Integer ; overload; +function MakeTTag(AValue: TObject): Integer ; overload; +function MakeTTag(AValue: TClass): Integer ; overload; + +function Control_GetColor(AControl: TControl): TColor; +function Control_GetControlStyle(AControl: TControl): TControlStyle; +function Control_GetCtl3D(AControl: TWinControl): Boolean; +function Control_GetFont(AControl: TControl): TFont; +function Control_GetPopupMenu(AControl: TControl): TPopupMenu; +function Control_GetText(AControl: TControl): string; +procedure Control_SetParentBackground(AControl: TWinControl; Value: Boolean); + +procedure Control_DoContextPopup(AControl: TControl; const Pt: TPoint; var AHandled: Boolean); +procedure Control_PaintWindow(AControl: TWinControl; DC: HDC); +procedure Control_SendCancelMode(AControl, ASender: TControl); +procedure Control_UpdateBoundsRect(AControl: TControl; const R: TRect); overload; +procedure Control_UpdateBoundsRect(AControl: TControl; ALeft, ARight, AWidth, AHeight: Integer); overload; + +procedure PopupMenu_DoPopup(APopupMenu: TPopupMenu); + +function RichEdit_GetBorderStyle(AControl: TCustomRichEdit): TBorderStyle; +function RichEdit_GetLines(AControl: TCustomRichEdit): TStrings; + +procedure Bitmap_LoadFromResourceName(ABitmap: TBitmap; const AResName: string; ABaseName: string = 'dxPSImgs'); +procedure Icon_LoadFromResourceName(AIcon: TIcon; const AResName: string; ABaseName: string = 'dxPSImgs'); + +function IsDelphiObject(AData: DWORD): Boolean; + +implementation + +uses + {$IFDEF DELPHI6} + Types, + StrUtils, + {$ENDIF} + {$IFDEF USEJPEGIMAGE} + Jpeg, + {$ENDIF} + Consts, ActiveX, ShlObj, ShellAPI, FileCtrl, dxPSRes, dxPSImgs; + + +const + CharCount = 26; + Chars: array[Boolean] of string[CharCount] = (('abcdefghijklmnopqrstuvwxyz'), ('ABCDEFGHIJKLMNOPQRSTUVWXYZ')); + + ColumnPath = '\ColumnWidths'; // Don't Localize + ColumnPattern = 'Column%d'; // Don't Localize + +var + FDrawModeImages: TCustomImageList; + FPatternBrush: HBRUSH; + FShellLargeImages: TImageList; + FShellSmallImages: TImageList; + FNonTrueTypeFonts: TStringList; + FTrueTypeFonts: TStringList; + +type + + TControlAccess = class(TControl); + TCustomRichEditAccess = class(TCustomRichEdit); + TGraphicAccess = class(TGraphic); + {$IFNDEF DELPHI6} + TGraphicAccessClass = class of TGraphicAccess; + {$ENDIF} + {$IFDEF DELPHI5} + TPopupMenuAccess = class(TPopupMenu); + {$ENDIF} + TWinControlAccess = class(TWinControl); + + +function FontStyleNames(AFontStyle: TFontStyle): string; +begin + case AFontStyle of + fsBold: + Result := cxGetResourceString(@sdxFontStyleBold); + fsItalic: + Result := cxGetResourceString(@sdxFontStyleItalic); + fsUnderline: + Result := cxGetResourceString(@sdxFontStyleUnderline); + else + Result := cxGetResourceString(@sdxFontStyleStrikeOut); + end; +end; + +function NonTrueTypeFonts: TStringList; +begin + if FNonTrueTypeFonts = nil then + begin + FNonTrueTypeFonts := TStringList.Create; + FNonTrueTypeFonts.Sorted := True; + end; + Result := FNonTrueTypeFonts; +end; + +function TrueTypeFonts: TStringList; +begin + if FTrueTypeFonts = nil then + begin + FTrueTypeFonts := TStringList.Create; + FTrueTypeFonts.Sorted := True; + end; + Result := FTrueTypeFonts; +end; + +function Min(A, B: Integer): Integer; +begin + Result := A; + if A > B then Result := B; +end; + +function Max(A, B: Integer): Integer; +begin + Result := A; + if B > A then Result := B; +end; + +function MinMax(A, B, C: Integer): Integer; +begin + if B > C then + Result := A + else + if A < B then + Result := B + else + if A > C then + Result := C + else + Result := A; +end; + +function SetLoWord(AValue: Integer; ALoWord: Word): Integer; +begin + Result := (AValue and Integer($0000FFFF)) or (ALoWord shl 16); +end; + +function SetHiWord(AValue: Integer; AHiWord: Word): Integer; +begin + Result := (AValue and Integer($FFFF0000)) or (AHiWord and $FFFF); +end; + +function SetLoHiWords(AValue: Integer; ALoWord, AHiWord: Word): Integer; +begin + Result := SetHiWord(SetLoWord(AValue, ALoWord), AHiWord); +end; + +function ScaleRect(const R: TRect; ANumeratorW, ADenominatorW, ANumeratorH, + ADenominatorH: Integer): TRect; +begin + with Result do + begin + Left := MulDiv(R.Left, ANumeratorW, ADenominatorW); + Top := MulDiv(R.Top, ANumeratorH, ADenominatorH); + Right := MulDiv(R.Right, ANumeratorW, ADenominatorW); + Bottom := MulDiv(R.Bottom, ANumeratorH, ADenominatorH); + end; +end; + +function ScaleRect(const R: TRect; ANumerator, ADenominator: Integer): TRect; +begin + Result := ScaleRect(R, ANumerator, ADenominator, ANumerator, ADenominator); +end; + +function ScalePoint(const Pt: TPoint; Numerator, Denominator: Integer): TPoint; +begin + Result.X := MulDiv(Pt.X, Numerator, Denominator); + Result.Y := MulDiv(Pt.Y, Numerator, Denominator); +end; + +function ArePointsEqual(const Pt1, Pt2: TPoint): Boolean; +begin + Result := (Pt1.X = Pt2.X) and (Pt1.Y = Pt2.Y); +end; + +function GetRgnData(ARgn: HRGN; out ARgnDataHeader: TRgnDataHeader; + out ARects: TRects): Integer; +var + Size: Integer; + RgnData: PRgnData; + I: Integer; +begin + Size := GetRegionData(ARgn, 0, nil); + RgnData := AllocMem(SizeOf(TRgnDataHeader) + SizeOf(TRect) * (Size - SizeOf(TRgnDataHeader))); + try + GetRegionData(ARgn, Size, RgnData); + ARgnDataHeader := RgnData.rdh; + Result := RgnData.rdh.nCount; + SetLength(ARects, Result); + for I := 0 to Result - 1 do + Move(RgnData.Buffer[I * SizeOf(TRect)], ARects[I], SizeOf(TRect)); + finally + FreeMem(RgnData, Size); + end; +end; + +function ExcludeClipRect(DC: HDC; const R: TRect): HRGN; +begin + with R do + Result := ExcludeClipRect(DC, Left, Top, Right, Bottom); +end; + +function ExcludeClipRect(DC: HDC; ALeft, ATop, ARight, ABottom: Integer): HRGN; +begin + Result := Windows.CreateRectRgn(0, 0, 0, 0); + if Windows.GetClipRgn(DC, Result) <> 1 then + begin + Windows.DeleteObject(Result); + Result := 0; + end; + Windows.ExcludeClipRect(DC, ALeft, ATop, ARight, ABottom); +end; + +function IntersectClipRect(DC: HDC; const R: TRect; AlwaysClip: Boolean = False): HRGN; +begin + with R do + Result := IntersectClipRect(DC, Left, Top, Right, Bottom); +end; + +function IntersectClipRect(DC: HDC; ALeft, ATop, ARight, ABottom: Integer; AlwaysClip: Boolean = False): HRGN; +begin + Result := Windows.CreateRectRgn(0, 0, 0, 0); + if Windows.GetClipRgn(DC, Result) <> 1 then + begin + Windows.DeleteObject(Result); + Result := 0; + end + else + if IsMetaFileDC(DC) then + begin + Result := Windows.CreateRectRgn(0, 0, 320000, 320000); + if Windows.SelectClipRgn(DC, Result) = ERROR then + begin + DeleteObject(Result); + Result := 0; + Exit; + end; + end; + Windows.IntersectClipRect(DC, ALeft, ATop, ARight, ABottom); +end; + +function RectVisible(DC: HDC; const ARect: TRect): Boolean; +begin + if IsMetafileDC(DC) then + Result := True + else + Result := Windows.RectVisible(DC, ARect); +end; + +procedure RestoreClipRgn(DC: HDC; var ARgn: HRGN); +begin + Windows.SelectClipRgn(DC, ARgn); + if ARgn <> 0 then Windows.DeleteObject(ARgn); + ARgn := 0; +end; + +function dxBoolToStr(AValue: Boolean): string; +begin + {$IFDEF DELPHI6} + Result := SysUtils.BoolToStr(AValue, True); + {$ELSE} + if AValue then + Result := cxGetResourceString(@sdxTrue) + else + Result := cxGetResourceString(@sdxFalse); + {$ENDIF} +end; + +function dxSameStr(const S1, S2: string): Boolean; +begin + {$IFDEF DELPHI6} + Result := AnsiSameStr(S1, S2); + {$ELSE} + Result := AnsiCompareStr(S1, S2) = 0; + {$ENDIF} +end; + +function dxSameText(const S1, S2: string): Boolean; +begin + {$IFDEF DELPHI6} + Result := AnsiSameText(S1, S2); + {$ELSE} + Result := AnsiCompareText(S1, S2) = 0; + {$ENDIF} +end; + +function dxAreBitmapsEqual(ABitmap1, ABitmap2: TBitmap): Boolean; +begin + Result := dxAreGraphicsEqual(ABitmap1, ABitmap2); +end; + +function dxAreBrushesEqual(ABrush1, ABrush2: TBrush): Boolean; +begin + Result := ((ABrush1 = nil) and (ABrush2 = nil)) or + ((ABrush1 <> nil) and (ABrush2 <> nil) and + (ABrush1.Color = ABrush2.Color) and + (ABrush1.Style = ABrush2.Style)); +end; + +function dxAreFontsEqual(AFont1, AFont2: TFont): Boolean; +begin + Result := ((AFont1 = nil) and (AFont2 = nil)) or + ((AFont1 <> nil) and (AFont2 <> nil) and + (AFont1.Color = AFont2.Color) and + (AFont1.Name = AFont2.Name) and + (AFont1.Pitch = AFont2.Pitch) and + (AFont1.Style = AFont2.Style) and + (AFont1.Size = AFont2.Size)); // and +// (AFont1.Charset = AFont2.Charset)); +end; + +function dxAreGraphicsEqual(AGraphic1, AGraphic2: TGraphic): Boolean; +begin + Result := (AGraphic1 = AGraphic2) or ((AGraphic1 <> nil) and + TGraphicAccess(AGraphic1).Equals(AGraphic2)); +end; + +function dxArePensEqual(APen1, APen2: TPen): Boolean; +begin + Result := ((APen1 = nil) and (APen2 = nil)) or + ((APen1 <> nil) and (APen2 <> nil) and + (APen1.Color = APen2.Color) and + (APen1.Mode = APen2.Mode) and + (APen1.Style = APen2.Style) and + (APen1.Width = APen2.Width)); +end; + +function FormatFontInfo(AFont: TFont): string; +var + S: string; + FS: TFontStyle; +begin + Result := ''; + if AFont = nil then Exit; + + Result := Format('%d %s %s ', [AFont.Size, cxGetResourceString(@sdxPt), AFont.Name]); + if AFont.Style <> [] then + begin + Result := Result + ' ['; + S := ''; + for FS := Low(TFontStyle) to High(TFontStyle) do + if FS in AFont.Style then + begin + if S <> '' then + S := S + ', '; + S := S + FontStyleNames(FS); + end; + Result := Result + S + ']'; + end; +end; + +procedure FontInfoToText(AFont: TFont; AEdit: TEdit); +begin + AEdit.Text := FormatFontInfo(AFont); + if ColorToRGB(AFont.Color) <> ColorToRGB(AEdit.Color) then + AEdit.Font.Color := AFont.Color + else + AEdit.Font.Color := clWindowText; +end; + +type + PSearchBuffer = ^TSearchBuffer; + TSearchBuffer = record + FontName: string; + IsTrueType: Boolean; + end; + +function EnumFontsProc(var AnEnumLogFont: TEnumLogFont; var ATextMetric: TNewTextMetric; + AFontType: Integer; AData: LPARAM): Integer; stdcall; +begin + with AnEnumLogFont.elfLogFont do + begin + Result := Integer(not (StrIComp(PChar(PSearchBuffer(AData)^.FontName), PChar(@lfFaceName[0])) = 0)); + if Result = 0 then + PSearchBuffer(AData)^.IsTrueType := AFontType and TRUETYPE_FONTTYPE = TRUETYPE_FONTTYPE; + end; +end; + +function dxIsTrueTypeFont(AFont: TFont): Boolean; + + function CalculateIsTrueTypeFont(AFont: TFont): Boolean; + var + DC: HDC; + SearchBuffer: PSearchBuffer; + begin + DC := GetDC(0); + try + try + New(SearchBuffer); + try + SearchBuffer^.FontName := AFont.Name; + EnumFontFamilies(DC, nil, @EnumFontsProc, LPARAM(SearchBuffer)); + Result := SearchBuffer^.IsTrueType; + finally + Finalize(SearchBuffer^.FontName); + Dispose(PSearchBuffer(SearchBuffer)); + end; + except + Result := False; + end; + finally + ReleaseDC(0, DC); + end; + end; + +begin + Result := TrueTypeFonts.IndexOf(AFont.Name) <> -1; // found in TT Fonts + if not Result then + begin + Result := NonTrueTypeFonts.IndexOf(AFont.Name) = -1; // not found in non TT Fonts + if Result then + begin + Result := CalculateIsTrueTypeFont(AFont); + if Result then + TrueTypeFonts.Add(AFont.Name) + else + NonTrueTypeFonts.Add(AFont.Name); + end; + end; +end; + +function FindNearestColor(AColor: TColor): TColor; +var + DC: HDC; +begin + DC := GetDC(0); + Result := GetNearestColor(DC, AColor); + ReleaseDC(0, DC); +end; + +function InvertColor(AColor: TColor): TColor; +begin + Result := $FFFFFF xor ColorToRGB(AColor); +end; + +function OffsetColor(AColor: TColor; ARed, AGreen, ABlue: Byte): TColor; +var + Red, Green, Blue: Integer; +begin + AColor := ColorToRGB(AColor); + Red := GetRValue(AColor) + ARed; + if Red > High(Byte) then Red := High(Byte); + if Red < Low(Byte) then Red := Low(Byte); + + Green := GetGValue(AColor) + AGreen; + if Green > High(Byte) then Green := High(Byte); + if Green < Low(Byte) then Green := Low(Byte); + + Blue := GetBValue(AColor) + ABlue; + if Blue > High(Byte) then Blue := High(Byte); + if Blue < Low(Byte) then Blue := Low(Byte); + + Result := RGB(Red, Green, Blue); +end; + +function IsDisplayDC(DC: HDC): Boolean; +begin + Result := GetDeviceCaps(DC, TECHNOLOGY) = DT_RASDISPLAY; +end; + +function IsMetafileDC(DC: HDC): Boolean; +begin + Result := GetObjectType(DC) in [OBJ_METADC, OBJ_ENHMETADC]; +end; + +function IsPrinterDC(DC: HDC): Boolean; +begin + Result := GetDeviceCaps(DC, TECHNOLOGY) = DT_RASPRINTER; +end; + +function CreatePatternBrush: HBRUSH; +var + PatternBitmap: HBITMAP; + DC: HDC; + X, Y: Integer; +begin + PatternBitmap := CreateBitmap(8, 8, 1, 1, nil); + try + DC := CreateCompatibleDC(0); + PatternBitmap := SelectObject(DC, PatternBitmap); + for X := 0 to 7 do + for Y := 0 to 7 do + SetPixel(DC, X, Y, $FFFFFF * Byte(Odd(X) = Odd(Y))); + PatternBitmap := SelectObject(DC, PatternBitmap); + DeleteDC(DC); + + Result := Windows.CreatePatternBrush(PatternBitmap); + finally + DeleteObject(PatternBitmap); + end; +end; + +function PatternBrush: HBRUSH; +begin + if FPatternBrush = 0 then + FPatternBrush := CreatePatternBrush; + Result := FPatternBrush; +end; + +procedure SetFontAsNonAntialiased(AFont: TFont); +var + LogFont: TLogFont; +begin + cxGetFontData(AFont.Handle, LogFont); + LogFont.lfQuality := {LogFont.lfQuality and not} NONANTIALIASED_QUALITY; + AFont.Handle := CreateFontIndirect(LogFont); +end; + +procedure ForcePictureToBitmap(APicture: TPicture); +var + B: TBitmap; +begin + with APicture do + if (Graphic <> nil) and not Graphic.InheritsFrom(TBitmap) then + if not Graphic.InheritsFrom(TIcon) then + begin + B := TBitmap.Create; + try + B.Assign(Graphic); + Bitmap := B; + finally + B.Free; + end; + end + else + Bitmap := IconToBitmap(TIcon(Graphic)); +end; + +function CreateGraphic(AGraphicClass: TGraphicClass): TGraphic; +begin + {$IFDEF DELPHI6} + Result := AGraphicClass.Create; + {$ELSE} + Result := TGraphicAccessClass(AGraphicClass).Create; + {$ENDIF} +end; + +function IconToBitmap(AnIcon: TIcon): TBitmap; +//var +// IconInfo: TIconInfo; +begin + Result := TBitmap.Create; + with Result do + begin + Height := AnIcon.Height; + Width := AnIcon.Width; + //GetIconInfo(AnIcon.Handle, IconInfo); + //MaskHandle := IconInfo.hbmMask; + Transparent := True; + Canvas.Draw(0, 0, AnIcon); + end; +end; + +function CreateArrowBitmap(AUpDownGlyph: TdxUpDownGlyph; AWidth: Integer = 16; + AHeight: Integer = 16; AFontSize: Integer = 12): TBitmap; +const + GlyphIndexes: array[TdxUpDownGlyph] of Integer = (GLYPH_UPARROW, GLYPH_DOWNARROW); +begin + Result := CreateGlyphBitmap(GlyphIndexes[AUpDownGlyph], AWidth, AHeight, AFontSize); +end; + +function CreateDoubleArrowBitmap(AUpDownGlyph: TdxUpDownGlyph; AWidth: Integer = 16; + AHeight: Integer = 16; AFontSize: Integer = 8): TBitmap; +const + GlyphIndexes: array[TdxUpDownGlyph] of Integer = (GLYPH_UPARROW, GLYPH_DOWNARROW); + OffsetUp = 2; + OffsetDown = -1; +var + B1, B2: TBitmap; +begin + B1 := CreateGlyphBitmap(GlyphIndexes[AUpDownGlyph], AWidth, AHeight, AFontSize); + try + B1.Transparent := True; + B2 := CreateGlyphBitmap(GlyphIndexes[AUpDownGlyph], AWidth, AHeight, AFontSize); + try + B2.Transparent := True; + Result := TBitmap.Create; + with Result do + begin + Width := AWidth; + Height := AHeight; + Canvas.Brush.Color := clBtnFace; + Canvas.FillRect(Rect(0, 0, AWidth, AHeight)); + Canvas.Draw(0, OffsetUp, B1); + Canvas.Draw(0, OffsetDown, B2); + end; + finally + B2.Free; + end; + finally + B1.Free; + end; +end; + +function CreateGlyphBitmap(AGlyphIndex: Integer; AWidth: Integer = 16; + AHeight: Integer = 16; AFontSize: Integer = 12): TBitmap; +var + W, H, X, Y: Integer; + Ch: Char; +begin + W := AWidth; + H := AHeight; + if W = 0 then W := 16; + if H = 0 then H := 16; + + Result := TBitmap.Create; + with Result do + begin + Width := W; + Height := H; + + Canvas.Brush.Color := clBtnFace; + Canvas.FillRect(Rect(0, 0, Width, Height)); + + Canvas.Font.Name := 'Marlett'; + Canvas.Font.Size := AFontSize; + Canvas.Font.Color := clWindowText; + Canvas.Font.Charset := SYMBOL_CHARSET; + Ch := Chr(AGlyphIndex); + X := 0; + Y := 0; + if (AWidth <> 0) and (AHeight <> 0) then + begin + X := (Width - Canvas.TextWidth(Ch)) div 2; + Y := (Height - Canvas.TextHeight(Ch)) div 2; + end + else + begin + Width := Canvas.TextWidth(Ch); + Height := Canvas.TextHeight(Ch); + end; + + Canvas.TextOut(X, Y, Ch); + end; +end; + +procedure DrawBlendedText(ACanvas: TCanvas; const R: TRect; const AText: string; AFont: TFont); +var + MemDC: HDC; + MemBitmap: HBITMAP; + + procedure PrepareOffScreenStructures(DC: HDC; ASize: TSize); + begin + MemBitmap := CreateCompatibleBitmap(DC, ASize.cX, ASize.cY); + MemDC := CreateCompatibleDC(DC); + MemBitmap := SelectObject(MemDC, MemBitmap); + end; + + procedure CreateTextOutClipPath(const R: TRect; const AText: string; AFont: TFont); + var + F: HFONT; + C: TColor; + BkMode: Integer; + begin + FillRect(MemDC, R, GetStockObject(WHITE_BRUSH)); + + F := SelectObject(MemDC, AFont.Handle); + C := SetTextColor(MemDC, $FFFFFF); + BkMode := SetBkMode(MemDC, Windows.TRANSPARENT); + + BeginPath(MemDC); + TextOut(MemDC, 0, 0, PChar(AText), Length(AText)); + EndPath(MemDC); + + SetBkMode(MemDC, BkMode); + SetTextColor(MemDC, C); + SelectObject(MemDC, F); + + SelectClipPath(MemDC, RGN_COPY); + end; + + procedure PatternTextOutClipPath(const R: TRect; ATextColor: TColor); + var + BkColor: COLORREF; + begin + ATextColor := SetTextColor(MemDC, ATextColor); + BkColor := SetBkColor(MemDC, $FFFFFF); + FillRect(MemDC, R, PatternBrush); + SetTextColor(MemDC, ATextColor); + SetBkColor(MemDC, BkColor); + end; + + procedure UnprepareOffScreenStructures; + begin + MemBitmap := SelectObject(MemDC, MemBitmap); + DeleteDC(MemDC); + DeleteObject(MemBitmap); + end; + +var + DC: HDC; + Size: TSize; + MemRect: TRect; + F: HFONT; + X, Y: Integer; +begin + DC := ACanvas.Handle; + F := SelectObject(DC, AFont.Handle); + GetTextExtentPoint(DC, PChar(AText), Length(AText), Size); + + MemRect := MakeRect(0, 0, Size.cX, Size.cY); + + PrepareOffScreenStructures(DC, Size); + try + CreateTextOutClipPath(MemRect, AText, AFont); + PatternTextOutClipPath(MemRect, ColorToRGB(AFont.Color)); + SelectClipRgn(MemDC, 0); + + with R do + begin + X := Left + (Right - Left - Size.cX) div 2; + Y := Top + (Bottom - Top - Size.cY) div 2; + end; + BitBlt(DC, X, Y, Size.cX, Size.cY, MemDC, 0, 0, SRCAND); + finally + UnprepareOffScreenStructures; + end; + SelectObject(DC, F); +end; + +procedure DrawGlyph(DC: HDC; const R: TRect; AGlyph: Byte); +var + C: Char; +begin + C := Chr(AGlyph); + ExtTextOut(DC, R.Left, R.Top, 0, @R, @C, 1, nil); +end; + +procedure DrawSizeGrip(DC: HDC; R: TRect); +var + V: Integer; +begin + V := GetSystemMetrics(SM_CXVSCROLL); + R := MakeRect(R.Right - V, R.Bottom - V, R.Right, R.Bottom); + DrawFrameControl(DC, R, DFC_SCROLL, DFCS_SCROLLSIZEGRIP); +end; + +procedure TransparentDraw(DrawDC: HDC; Brush: HBRUSH; const R: TRect; + ABitmap: TBitmap); +const + ROP_DSPDxax = $00E20746; +var + BW, BH: Integer; + DC, MaskDC: HDC; + B, MaskHandle: HBITMAP; + ATextColor, ABackColor: COLORREF; + ABrush: HBRUSH; +begin + with R do + begin + BW := ABitmap.Width; + BH := ABitmap.Height; + + DC := CreateCompatibleDC(DrawDC); + B := SelectObject(DC, CreateCompatibleBitmap(DrawDC, BW, BH)); + try + BitBlt(DC, 0, 0, BW, BH, ABitmap.Canvas.Handle, 0, 0, SRCCOPY); + + MaskDC := CreateCompatibleDC(DrawDC); + MaskHandle := SelectObject(MaskDC, CreateBitmap(BW, BH, 1, 1, nil)); + try + ABackColor := SetBkColor(DC, ColorToRGB(ABitmap.TransparentColor){GetPixel(DC, 0, BH - 1)}); + BitBlt(MaskDC, 0, 0, BW, BH, DC, 0, 0, SRCCOPY); + SetBkColor(DC, ABackColor); + + ATextColor := SetTextColor(DC, 0); + ABackColor := SetBkColor(DC, $FFFFFF); + ABrush := SelectObject(DC, Brush); + BitBlt(DC, 0, 0, BW, BH, MaskDC, 0, 0, ROP_DSPDxax); + SelectObject(DC, ABrush); + SetTextColor(DC, ATextColor); + SetBkColor(DC, ABackColor); + finally + DeleteObject(SelectObject(MaskDC, MaskHandle)); + DeleteDC(MaskDC); + end; + + BitBlt(DrawDC, Left, Top, Right - Left, Bottom - Top, DC, 0, 0, SRCCOPY); + finally + DeleteObject(SelectObject(DC, B)); + DeleteDC(DC); + end; + end; +end; + +{.$WARN SYMBOL_DEPRECATED OFF} + +function CopyDeviceMode(Src: HGLOBAL): HGLOBAL; +var + Size: Integer; + SrcPtr, DestPtr: PChar; +begin + if Src <> 0 then + begin + Size := GlobalSize(Src); + Result := GlobalAlloc(GHND, Size); + if Result <> 0 then + begin + SrcPtr := GlobalLock(Src); + if SrcPtr <> nil then + try + DestPtr := GlobalLock(Result); + if DestPtr <> nil then + try + Move(SrcPtr^, DestPtr^, Size); + finally + GlobalUnlock(Result); + end; + finally + GlobalUnlock(Src); + end; + end; + end + else + Result := 0; +end; + +{.$WARN SYMBOL_DEPRECATED ON} + +function GetDesktopWorkArea: TRect; + + function IntersectionArea(const ABounds: TRect; APoint: TPoint; var Area: TRect): Integer; + var + R: TRect; + begin + Area := GetDesktopWorkArea(APoint); + if IntersectRect(R, ABounds, Area) then + Result := Abs(R.Right - R.Left) * Abs(R.Bottom - R.Top) + else + Result := 0; + end; + +var + R, R1: TRect; +begin + if Application.MainForm <> nil then + begin + Result := Application.MainForm.BoundsRect; + if IntersectionArea(Result, Result.TopLeft, R) > + IntersectionArea(Result, Result.BottomRight, R1) then + Result := R + else + Result := R1; + end + else + SystemParametersInfo(SPI_GETWORKAREA, 0, @Result, 0); +end; + +function GetDesktopWorkArea(const P: TPoint): TRect; +const + MONITOR_DEFAULTTONEAREST = $2; +type + HMONITOR = type Integer; + PMonitorInfo = ^TMonitorInfo; + TMonitorInfo = record + cbSize: DWORD; + rcMonitor: TRect; + rcWork: TRect; + dwFalgs: DWORD; + end; +var + AUser32DLL: THandle; + Info: TMonitorInfo; + GetMonitorInfo: function(hMonitor: HMONITOR; lpMonitorInfo: PMonitorInfo): Boolean; stdcall; + MonitorFromPoint: function(ptScreenCoords: TPoint; dwFlags: DWORD): HMONITOR; stdcall; +begin + AUser32DLL := LoadLibrary('USER32'); + if AUser32DLL > 32 then + begin + GetMonitorInfo := GetProcAddress(AUser32DLL, 'GetMonitorInfoA'); + MonitorFromPoint := GetProcAddress(AUser32DLL, 'MonitorFromPoint'); + end + else + begin + GetMonitorInfo := nil; + MonitorFromPoint := nil; + end; + + if @GetMonitorInfo = nil then + SystemParametersInfo(SPI_GETWORKAREA, 0, @Result, 0) + else + begin + Info.cbSize := SizeOf(Info); + GetMonitorInfo(MonitorFromPoint(P, MONITOR_DEFAULTTONEAREST), @Info); + Result := Info.rcWork; + end; + FreeLibrary(AUser32DLL); +end; + +function GetLongFileName(const Source: string): string; +var + Handle: THandle; + Proc: function(ShortPathName, LongPathName: PChar; cchBuffer: Integer): Integer; stdcall; + Buffer: array[0..MAX_PATH] of Char; +begin + Handle := GetModuleHandle(kernel32); + if Handle <> 0 then + begin + @Proc := GetProcAddress(Handle, 'GetLongPathNameA'); + if (@Proc <> nil) and (Proc(PChar(Source), Buffer, SizeOf(Buffer)) <> 0) then + Result := Buffer + else + Result := Source; + end + else + Result := Source; +end; + +function GetMachineName: string; +var + BufferSize: DWORD; + Buffer: array[0..MAX_COMPUTERNAME_LENGTH + 1] of Char ; +begin + BufferSize := MAX_COMPUTERNAME_LENGTH + 1; + GetComputerName(Buffer, BufferSize); + Result := Buffer; +end; + +function GetUserName: string; +var + BufferSize: DWORD; + Buffer: array[0..UNLEN + 1] of Char ; +begin + BufferSize := UNLEN + 1; + Windows.GetUserName(Buffer, BufferSize); + Result := Buffer; +end; + +function GetVolumeName(const APath: string): string; +var + PrevErrorMode: UINT; + Buffer: array[Byte] of Char; + L, Flags: DWORD; +begin + PrevErrorMode := Windows.SetErrorMode(SEM_FAILCRITICALERRORS); + try + if GetVolumeInformation(PChar(APath), @Buffer, SizeOf(Buffer), nil, L, Flags, nil, 0) then + Result := Buffer + else + Result := ''; + finally + Windows.SetErrorMode(PrevErrorMode); + end; +end; + +function IsIntelliMousePresent: Boolean; +begin + Result := Boolean(GetSystemMetrics(SM_MOUSEWHEELPRESENT)); +end; + +function IsNetworkPresent: Boolean; +begin + Result := GetSystemMetrics(SM_NETWORK) and $01 = $01; +end; + +function IsVolume(const APath: string): Boolean; +begin + Result := ExtractFileDir(APath) = APath; +end; + +function IsWin32Version(AMajor: Integer; AMinor: Integer = 0): Boolean; +begin + Result := (Win32MajorVersion > AMajor) or + ((Win32MajorVersion = AMajor) and (Win32MinorVersion >= AMinor)); +end; + +function PopulateShellImages(FullInit: Boolean): Boolean; +var + ShellDLLLoaded: Boolean; + ShellDLL: HMODULE; + Proc: function(FullInit: BOOL): BOOL; stdcall; +begin + Result := False; + if dxPSGlbl.IsWinNT then + begin + ShellDLLLoaded := False; + ShellDLL := GetModuleHandle(ShellAPI.Shell32); + if ShellDLL = 0 then + begin + ShellDLL := LoadLibrary(ShellAPI.Shell32); + if ShellDLL <= Windows.HINSTANCE_ERROR then + ShellDLL := 0; + ShellDLLLoaded := ShellDLL <> 0; + end; + if ShellDLL <> 0 then + try + Proc := GetProcAddress(ShellDll, PChar(660)); + Result := (@Proc <> nil) and Proc(FullInit); + finally + if ShellDLLLoaded then FreeLibrary(ShellDll); + end; + end; +end; + +function ShellLargeImages: TImageList; +var + FileInfo: TSHFileInfo; +begin + if FShellLargeImages = nil then + begin + FShellLargeImages := TImageList.Create(nil); + FShellLargeImages.ShareImages := True; + try + FillChar(FileInfo, SizeOf(FileInfo), 0); + FShellLargeImages.Handle := SHGetFileInfo('', 0, FileInfo, SizeOf(FileInfo), SHGFI_SYSICONINDEX or SHGFI_LARGEICON); + finally + if FileInfo.hIcon <> 0 then Windows.DestroyIcon(FileInfo.hIcon); + end; + end; + Result := FShellLargeImages; +end; + +function ShellSmallImages: TImageList; +var + FileInfo: TSHFileInfo; +begin + if FShellSmallImages = nil then + begin + FShellSmallImages := TImageList.Create(nil); + FShellSmallImages.ShareImages := True; + try + FillChar(FileInfo, SizeOf(FileInfo), 0); + FShellSmallImages.Handle := SHGetFileInfo('', 0, FileInfo, SizeOf(FileInfo), SHGFI_SYSICONINDEX or SHGFI_SMALLICON); + finally + if FileInfo.hIcon <> 0 then Windows.DestroyIcon(FileInfo.hIcon); + end; + end; + Result := FShellSmallImages; +end; + +function BFFCallBack(Wnd: HWND; uMsg: UINT; lParam, lpData: LPARAM): Integer; stdcall; +var + Path: PChar absolute lParam; + B: Boolean; + Buffer: array[0..MAX_PATH] of Char; + S: string; +begin + Result := 0; + if uMsg = BFFM_INITIALIZED then + begin + B := not dxPSGlbl.IsWin95Or98 or (IsVolume(Path) and DirectoryExists(Path)); + if B then + SendMessage(Wnd, BFFM_SETSELECTION, WPARAM(True), lpData); + end; + + if uMsg = BFFM_SELCHANGED then + begin + B := SHGetPathFromIDList(PItemIDList(lParam), @Buffer); + if B then + begin + SetString(S, PChar(@Buffer), MAX_PATH); + B := DirectoryExists(S); + end; + SendMessage(Wnd, BFFM_ENABLEOK, 0, Ord(B)); + end; + + if (uMsg = BFFM_VALIDATEFAILEDA) or (uMsg = BFFM_VALIDATEFAILEDW) then + begin + S := Format(cxGetResourceString(@sdxInvalidRootDirectory), [Path]); + Result := Ord(MessageQuestion(S)); + if Result = 1 then + SendMessage(Wnd, BFFM_ENABLEOK, 0, 0); + end; +end; + +function ShowSystemSelectFolderDlg(var ADirPath: string): Boolean; +const + EditBoxFlags: array[Boolean] of UINT = (0, BIF_EDITBOX); + NewDialogStyleFlags: array[Boolean] of UINT = (0, BIF_NEWDIALOGSTYLE); + ValidateFlags: array[Boolean] of UINT = (0, BIF_VALIDATE); +var + ShellMalloc: IMalloc; + Buffer: PChar; + BrowseInfo: TBrowseInfo; + PrevErrorMode: Cardinal; + WindowList: Pointer ; + IDList: PItemIDList ; +begin + if (ShGetMalloc(ShellMalloc) = S_OK) and (ShellMalloc <> nil) then + begin + Buffer := ShellMalloc.Alloc(MAX_PATH); + try + FillChar(BrowseInfo, SizeOf(TBrowseInfo), 0); + BrowseInfo.hwndOwner := Application.Handle; + BrowseInfo.pszDisplayName := Buffer; + BrowseInfo.lpszTitle := PChar(cxGetResourceString(@sdxSelectNewRoot)); + + BrowseInfo.ulFlags := BIF_RETURNONLYFSDIRS or EditBoxFlags[IsComCtrlVersion471] or + NewDialogStyleFlags[IsComCtrlVersion500] or ValidateFlags[IsComCtrlVersion471]; + if IsVolume(ADirPath) then + ADirPath := ADirPath + '\'; + BrowseInfo.lpfn := BFFCallBack; + BrowseInfo.lParam := LPARAM(PChar(ADirPath)); + + WindowList := DisableTaskWindows(0); + try + PrevErrorMode := SetErrorMode(SEM_FAILCRITICALERRORS); + try + IDList := SHBrowseForFolder(BrowseInfo); + Result := IDList <> nil; + if Result then + begin + SHGetPathFromIDList(IDList, Buffer); + ShellMalloc.Free(IDList); + if Buffer <> #0 then ADirPath := Buffer; + end; + finally + SetErrorMode(PrevErrorMode); + end; + finally + EnableTaskWindows(WindowList); + end; + finally + ShellMalloc.Free(Buffer); + end; + end + else + Result := False; +end; + +function FormatFileSize(const AFileSize: Int64): string; +const + FormatTemplate = '##0.#'; + KiloByte = 1024; + MegaByte = KiloByte * KiloByte; + GigaByte = KiloByte * MegaByte; +begin + if AFileSize > GigaByte then + Result := FormatFloat(FormatTemplate, AFileSize / GigaByte) + ' ' + cxGetResourceString(@sdxGigaBytes) + else + if AFileSize > MegaByte then + Result := FormatFloat(FormatTemplate, AFileSize / MegaByte) + ' ' + cxGetResourceString(@sdxMegaBytes) + else + if AFileSize > KiloByte then + Result := FormatFloat(FormatTemplate, AFileSize / KiloByte) + ' ' + cxGetResourceString(@sdxKiloBytes) + else + Result := FormatFloat(FormatTemplate, AFileSize) + ' ' + cxGetResourceString(@sdxBytes); +end; + +function ValidateFileName(const FileName: string): Boolean; + + function HasChars(const Str, Substr: string): Boolean; + var + I: Integer; + begin + Result := False; + for I := 1 to Length(Substr) do + if Pos(Substr[I], Str) > 0 then + begin + Result := True; + Break; + end; + end; + +begin + Result := (Trim(FileName) <> '') and not HasChars(FileName, '<>"[]|'); + if Result then + Result := Pos('\', ExtractFileName(FileName)) = 0; +end; + +procedure Delay(Value: DWORD); //milliseconds +var + T: DWORD; +begin + T := GetTickCount; + while GetTickCount - T < Value do ; +end; + +{ Strings management routines } + +function ReplaceSubStr(const Source, OldChars, NewChars: string): string; +var + L, P: Integer; +begin + Result := Source; + P := Pos(OldChars, Result); + if P > 0 then + begin + L := Length(OldChars); + while P > 0 do + begin + Delete(Result, P, L); + if NewChars <> #0 then + Insert(NewChars, Result, P); + P := Pos(OldChars, Result); + end; + end; +end; + +function ReplicateChar(const S: string; ACount: Integer): string; +{$IFNDEF DELPHI6} +var + I: Integer; +{$ENDIF} +begin + {$IFDEF DELPHI6} + Result := DupeString(S, ACount); + {$ElSE} + Result := ''; + for I := 0 to ACount - 1 do + Result := Result + S; + {$ENDIF} +end; + +procedure SplitString(const ASource, ASeparator: string; AStrings: TStrings); +var + P, L: Integer; + Buffer: string; +begin + Buffer := ASource; + P := Pos(ASeparator, Buffer); + if P > 0 then + begin + L := Length(ASeparator); + while P > 0 do + begin + if P > 1 then + AStrings.Add(Copy(Buffer, 1, P + L - 2)); + Delete(Buffer, 1, P + L - 1); + P := Pos(ASeparator, Buffer); + end; + end; + if Length(Buffer) > 0 then AStrings.Add(Buffer); +end; + +function MakePageIndexes(const Source: string; out AnOutput: TIntegers): Boolean; + + function ProcessRange(const S: string; out AnArray: TIntegers): Boolean; + var + V1, V2, P, Code1, Code2, I: Integer; + SLeft, SRight: string; + begin + V1 := 0; + V2 := 0; + P := Pos(dxPSGlbl.cPageRangeSeparator, S); + Result := P <> 0; + if Result then + begin + SLeft := Copy(S, 1, P - 1); + SRight := Copy(S, P + 1, Length(S) - P); + Val(SLeft, V1, Code1); + Val(SRight, V2, Code2); + Result := (Code1 = 0) and (Code2 = 0) and (V2 >= V1); + end; + + if Result then + begin + SetLength(AnArray, V2 - V1 + 1); + for I := V1 to V2 do + AnArray[I - V1] := I; + end + else + SetLength(AnArray, 0); + end; + +var + Buffer: string; + Strings: TStrings; + S: string; + I, V, Code, L, J: Integer; + SubRange: TIntegers; +begin + SetLength(AnOutput, 0); + try + Buffer := StringReplace(Source, ' ', '', [rfReplaceAll, rfIgnoreCase]); + if Length(Buffer) > 0 then + begin + Strings := TStringList.Create; + try + SplitString(Buffer, dxPSGlbl.cPageSeparator, Strings); + for I := 0 to Strings.Count - 1 do + begin + S := Strings[I]; + Val(S, V, Code); + if (Code <> 0) or (V < 0) then + if ProcessRange(S, SubRange) then + begin + L := Length(AnOutput); + SetLength(AnOutput, L + Length(SubRange)); + for J := L to L + Length(SubRange) - 1 do + AnOutput[J] := SubRange[J - L]; + end + else + Abort + else + begin + SetLength(AnOutput, Length(AnOutput) + 1); + AnOutput[Length(AnOutput) - 1] := V; + end; + end; + finally + Strings.Free; + end; + end; + except + SetLength(AnOutput, 0); + end; + Result := Length(AnOutput) <> 0; +end; + +function Int2Roman(AValue: Integer; AnUpperCase: Boolean): string; +const + Max = 13; + RomanNumbers: array[1..Max] of Integer = + (1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900, 1000); + RomanStrings: array[Boolean, 1..Max] of string = + (('i', 'iv', 'v', 'ix', 'x', 'xl', 'l', 'xc', 'c', 'cd', 'd', 'cm', 'm'), + ('I', 'IV', 'V', 'IX', 'X', 'XL', 'L', 'XC', 'C', 'CD', 'D', 'CM', 'M')); +var + Index: Integer; +begin + Result := ''; + Index := Max; + while AValue > 0 do + begin + while AValue < RomanNumbers[Index] do + Dec(Index); + while AValue >= RomanNumbers[Index] do + begin + Dec(AValue, RomanNumbers[Index]); + Result := Result + RomanStrings[AnUpperCase, Index]; + end; + end; +end; + +function Roman2Int(AText: string; AnUpperCase: Boolean): Integer; +type + TdxNumberOrder = (noOnes, noTens, noHundreds); + TdxRomanNumber = 1..9; +const + RomanNumbers: array[TdxNumberOrder, TdxRomanNumber] of Integer = + (( 1, 2, 3, 4, 5, 6, 7, 8, 9), + ( 10, 20, 30, 40, 50, 60, 70, 80, 90), + (100, 200, 300, 400, 500, 600, 700, 800, 900)); + RomanThousand: array[Boolean] of string = ('m', 'M'); + RomanStrings: array[Boolean, TdxNumberOrder, TdxRomanNumber] of string = + ((('i', 'ii', 'iii', 'iv', 'v', 'vi', 'vii', 'viii', 'ix'), + ('x', 'xx', 'xxx', 'xl', 'l', 'lx', 'lxx', 'lxxx', 'lc'), + ('c', 'cc', 'ccc', 'cd', 'd', 'dc', 'dcc', 'dccc', 'dm')), + (('I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'), + ('X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'), + ('C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM'))); +var + Number: TdxRomanNumber; + Order: TdxNumberOrder; +begin + Result := 0; + while (Length(AText) > 0) and (AText[1] = RomanThousand[AnUpperCase]) do + begin + Delete(AText, 1, 1); + Inc(Result, 1000); + end; + if AText <> '' then + for Order := noHundreds downto noOnes do + begin + Number := High(TdxRomanNumber); + while (Number > 0) and (Pos(RomanStrings[AnUpperCase, Order, Number], AText) <> 1) do + Dec(Number); + if Number > 0 then + begin + Inc(Result, RomanNumbers[Order, Number]); + Delete(AText, 1, Length(RomanStrings[AnUpperCase, Order, Number])); + if AText = '' then Exit; + end; + end; + if AText <> '' then Result := -1; +end; + +function Chars2Int(const AText: string; AnUpperCase: Boolean): Integer; +begin + Result := CharCount * (Length(AText) - 1) + Pos(AText[1], Chars[AnUpperCase]); +end; + +function Int2Chars(AValue: Integer; AnUpperCase: Boolean): string; +var + I, C: Integer; +begin + I := AValue mod CharCount; + if I = 0 then I := CharCount; + C := AValue div CharCount; + if I <> 0 then Inc(C); + Result := ReplicateChar(Chars[AnUpperCase][I], C); +end; + +function AddColon(const Source: string): string; +begin + Result := Source; + if Pos(':', Result) <> (Length(Result) - Length(':') + 1) then + Result := Result + ':'; +end; + +function AddEndEllipsis(const Source: string): string; +begin + Result := Source; + if Pos('...', Result) <> (Length(Result) - Length('...') + 1) then + Result := Result + '...'; +end; + +function DropAmpersand(const Source: string): string; +var + I: Integer; +begin + Result := ''; + for I := 1 to Length(Source) do + if Source[I] <> '&' then + Result := Result + Source[I]; +end; + +function DropColon(const Source: string): string; +begin + Result := Source; + if Result[Length(Result)] = ':' then + Delete(Result, Length(Result), 1); +end; + +function DropEndEllipsis(const Source: string): string; +begin + Result := Source; + while (Length(Result) > 0) and (Result[Length(Result)] = '.') do + Delete(Result, Length(Result), 1); +end; + +procedure MessageError(const AMessage: string); +begin + MessageBeep(MB_ICONEXCLAMATION); + Application.MessageBox(PChar(AMessage), PChar(Application.Title), MB_OK or MB_ICONERROR); +end; + +procedure MessageWarning(const AMessage: string); +begin + MessageBeep(MB_ICONEXCLAMATION); + Application.MessageBox(PChar(AMessage), PChar(Application.Title), MB_OK or MB_ICONEXCLAMATION); +end; + +function MessageQuestion(const AMessage: string): Boolean; +begin + MessageBeep(MB_ICONQUESTION); + Result := (ID_YES = Application.MessageBox(PChar(AMessage), PChar(Application.Title), + MB_YESNO or MB_ICONQUESTION or MB_DEFBUTTON1)); +end; + +function DropT(const Source: string): string; +begin + Result := Source; + if Result[1] = 'T' then Delete(Result, 1, 1); +end; + +function HasPropertyEx(AClass: TClass; const AName: string; ATypeKinds: TTypeKinds): Boolean; +var + PropList: PPropList; + PropCount: Integer; + I: Integer; +begin + PropCount := GetPropList(AClass.ClassInfo, ATypeKinds, nil); + if PropCount > 0 then + begin + PropList := AllocMem(PropCount * SizeOf(PPropInfo)); + try + PropCount := GetPropList(AClass.ClassInfo, ATypeKinds, PropList); + I := 0; + while (I < PropCount) and (CompareText(PropList^[I].Name, AName) <> 0) do + Inc(I); + Result := I < PropCount; + finally + FreeMem(PropList, PropCount * SizeOf(PPropInfo)); + end; + end + else + Result := False; +end; + +function HasPropertyEx(AnObject: TObject; const AName: string; ATypeKinds: TTypeKinds): Boolean; +begin + Result := HasPropertyEx(AnObject.ClassType, AName, ATypeKinds); +end; + +function HasProperty(AClass: TClass; const AName: string): Boolean; +begin + Result := HasPropertyEx(AClass, AName, tkAny); +end; + +function HasProperty(AnObject: TObject; const AName: string): Boolean; +begin + Result := HasPropertyEx(AnObject, AName, tkAny); +end; + +function GetProperty(AnObject: TObject; const AName: string): Variant; +{$IFNDEF DELPHI5} +var + PropInfo: PPropInfo; + TypeData: PTypeData; +{$ENDIF} +begin + Result := Null; + {$IFNDEF DELPHI5} + PropInfo := TypInfo.GetPropInfo(AnObject.ClassInfo, AName); + if PropInfo <> nil then + begin + TypeData := TypInfo.GetTypeData(PropInfo^.PropType^); + case PropInfo^.PropType^^.Kind of + tkInteger, + tkChar, + tkWChar, + tkClass: + Result := TypInfo.GetOrdProp(AnObject, PropInfo); + tkEnumeration: + if TypeData^.BaseType^ = TypeInfo(Boolean) then + Result := Boolean(GetOrdProp(AnObject, PropInfo)) + else + Result := TypInfo.GetOrdProp(AnObject, PropInfo); + tkSet: + Result := TypInfo.GetOrdProp(AnObject, PropInfo); + tkFloat: + Result := TypInfo.GetFloatProp(AnObject, PropInfo); + tkMethod: + Result := PropInfo^.PropType^.Name; + tkString, tkLString, tkWString: + Result := TypInfo.GetStrProp(AnObject, PropInfo); + tkVariant: + Result := TypInfo.GetVariantProp(AnObject, PropInfo); + tkInt64: + Result := TypInfo.GetInt64Prop(AnObject, PropInfo) + 0.0; + end; + end; + {$ELSE} + if HasProperty(AnObject, AName) then + Result := TypInfo.GetPropValue(AnObject, AName , False); + {$ENDIF} +end; + +procedure SetProperty(AnObject: TObject; const AName: string; const AValue: Variant); + +{$IFNDEF DELPHI5} + + function RangedValue(const AMin, AMax: Int64): Int64; + begin + Result := Trunc(AValue); + if Result < AMin then + Result := AMin; + if Result > AMax then + Result := AMax; + end; + + procedure SetEnumProp(AnObject: TObject; APropInfo: PPropInfo; const AValue: string); + var + Data: Longint; + begin + Data := TypInfo.GetEnumValue(APropInfo^.PropType^, AValue); + if Data >= 0 then + TypInfo.SetOrdProp(AnObject, APropInfo, Data); + end; + +var + PropInfo: PPropInfo; + TypeData: PTypeData; +{$ENDIF} +begin + {$IFNDEF DELPHI5} + PropInfo := TypInfo.GetPropInfo(AnObject.ClassInfo, AName); + if PropInfo <> nil then + begin + TypeData := TypInfo.GetTypeData(PropInfo^.PropType^); + case PropInfo.PropType^^.Kind of + tkInteger, + tkChar, + tkWChar: + TypInfo.SetOrdProp(AnObject, PropInfo, RangedValue(TypeData^.MinValue, TypeData^.MaxValue)); + tkEnumeration: + if VarType(AValue) = varString then + SetEnumProp(AnObject, PropInfo, VarToStr(AValue)) + else + TypInfo.SetOrdProp(AnObject, PropInfo, RangedValue(TypeData^.MinValue, TypeData^.MaxValue)); + tkSet: + if VarType(AValue) = varInteger then + TypInfo.SetOrdProp(AnObject, PropInfo, AValue); + tkFloat: + TypInfo.SetFloatProp(AnObject, PropInfo, AValue); + tkString, + tkLString, + tkWString: + TypInfo.SetStrProp(AnObject, PropInfo, VarToStr(AValue)); + tkVariant: + TypInfo.SetVariantProp(AnObject, PropInfo, AValue); + tkInt64: + TypInfo.SetInt64Prop(AnObject, PropInfo, RangedValue(TypeData^.MinInt64Value, TypeData^.MaxInt64Value)); + end; + end; + {$ELSE} + if HasProperty(AnObject, AName) then + TypInfo.SetPropValue(AnObject, AName, AValue); + {$ENDIF} +end; + +procedure dxDrawComboBoxItem(ACanvas: TCanvas; const R: TRect; const AText: string; + AnImageList: TCustomImageList; AnImageIndex: Integer; AState: TOwnerDrawState); + + function IsImageDrawn: Boolean; + begin + Result := (AnImageList <> nil) and (AnImageIndex > -1) and (AnImageIndex < AnImageList.Count); + end; + +var + X, Y: Integer; +begin + ACanvas.FillRect(R); + if IsImageDrawn then + begin + with R do + begin + X := Left + 1; + Y := Top + (Bottom - Top - AnImageList.Height) div 2; + end; + AnImageList.Draw(ACanvas, X, Y, AnImageIndex); + end; + + with R do + begin + X := Left + 1 + Ord(IsImageDrawn) * (AnImageList.Width + 2); + Y := Top + (Bottom - Top - ACanvas.TextHeight(AText)) div 2; + end; + ACanvas.TextOut(X, Y, AText); +end; + +procedure dxLoadStringsFromRegistry(const APath: string; AStrings: TStrings); +var + Entries: TStringList; + I: Integer; +begin + with TRegistry.Create do + try + try + if OpenKey(APath, False) then + begin + AStrings.Clear; + Entries := TStringList.Create; + try + GetValueNames(Entries); + for I := 0 to Entries.Count - 1 do + if ValueExists(Entries[I]) then + AStrings.Add(ReadString(Entries[I])); + finally + Entries.Free; + end; + end; + except + on ERegistryException do + { ignore } + else + raise; + end; + finally + Free; + end; +end; + +procedure dxSaveStringsToRegistry(const APath: string; AStrings: TStrings); +var + I: Integer; +begin + with TRegistry.Create do + try + try + if KeyExists(APath) then + DeleteKey(APath); + if OpenKey(APath, True) then + for I := 0 to AStrings.Count - 1 do + WriteString(IntToStr(I), AStrings[I]); + except + on ERegistryException do + { ignore } + else + raise; + end; + finally + Free; + end; +end; + +procedure dxLoadListViewColumnsFromRegistry(AListView: TListView; const APath: string); +var + I: Integer; + S: string; +begin + with TRegistry.Create do + try + try + if OpenKey(APath + '\' + AListView.Name + ColumnPath, False) then + begin + AListView.Columns.BeginUpdate; + try + for I := 0 to AListView.Columns.Count - 1 do + begin + S := Format(ColumnPattern, [I]); + if ValueExists(S) then + AListView.Columns[I].Width := ReadInteger(S); + end; + finally + AListView.Columns.EndUpdate; + end; + end; + except + on ERegistryException do + { ignore } + else + raise; + end; + finally + Free; + end; +end; + +procedure dxSaveListViewColumnsToRegistry(AListView: TListView; const APath: string); +var + I: Integer; + S: string; +begin + with TRegistry.Create do + try + try + S := APath + '\' + AListView.Name + ColumnPath; + if KeyExists(S) then + DeleteKey(S); + if OpenKey(S, True) then + for I := 0 to AListView.Columns.Count - 1 do + WriteInteger(Format(ColumnPattern, [I]), AListView.Columns[I].Width); + except + on ERegistryException do + { ignore } + else + raise; + end; + finally + Free; + end; +end; + +procedure dxSaveListViewSelection(AListView: TListView; ASelection: TList); +var + I: Integer; + Item: TListItem; +begin + for I := 0 to AListView.Items.Count - 1 do + begin + Item := AListView.Items[I]; + if Item.Selected then ASelection.Add(Item.Data); + end; +end; + +procedure dxRestoreListViewSelection(AListView: TListView; ASelection: TList); +var + I: Integer; + Item: TListItem; +begin + for I := 0 to ASelection.Count - 1 do + begin + Item := AListView.FindData(0, ASelection[I], True, True); + if Item <> nil then + begin + Item.Selected := True; + if I = 0 then + Item.MakeVisible(True); + end; + end; +end; + +procedure CopyImages(ASourceHandle: HIMAGELIST; ADest: TCustomImageList); +var + ImageCount, ImageWidth, ImageHeight, I: Integer; + Image, Mask: TBitmap; + R: TRect; +begin + ADest.Clear; + ImageCount := ImageList_GetImageCount(ASourceHandle); + if ImageCount = 0 then Exit; + + ImageList_GetIconSize(ASourceHandle, ImageWidth, ImageHeight); + ADest.Width := ImageWidth; + ADest.Height := ImageHeight; + + // we need to copy all color depth and alpha channel information + ADest.Handle := ImageList_Duplicate(ASourceHandle); + ADest.Clear; + {???} + R := MakeRect(0, 0, ImageWidth, ImageHeight); + Image := TBitmap.Create; + try + Image.Height := ImageHeight; + Image.Width := ImageWidth; + Mask := TBitmap.Create; + try + Mask.Monochrome := True; + Mask.Height := ImageHeight; + Mask.Width := ImageWidth; + + for I := 0 to ImageCount - 1 do + begin + with Image.Canvas do + begin + FillRect(R); + ImageList_Draw(ASourceHandle, I, Handle, 0, 0, ILD_NORMAL); + end; + with Mask.Canvas do + begin + FillRect(R); + ImageList_Draw(ASourceHandle, I, Handle, 0, 0, ILD_MASK); + end; + ADest.Add(Image, Mask); + end; + finally + Mask.Free; + end; + finally + Image.Free; + end; +end; + +procedure PlaceButtons(const AButtons: array of TButton; ABtnOffsetX, ARightOrigin, ATopOrigin: Integer); +var + DWP: HDWP; + + procedure PlaceButton(AButton: TButton; AOriginX, AOriginY: Integer); + begin + DWP := DeferWindowPos(DWP, AButton.Handle, 0, AOriginX, AOriginY, 0, 0, + SWP_NOACTIVATE or SWP_NOOWNERZORDER or SWP_NOSIZE or SWP_NOZORDER); + Control_UpdateBoundsRect(AButton, AOriginX, AOriginY, AButton.Width, AButton.Height); + end; + + procedure ShiftButtons(Index, Shift: Integer); + var + OriginX, OriginY, I: Integer; + begin + OriginY := ATopOrigin; + for I := High(AButtons) downto Index + 1 do + begin + OriginX := AButtons[I - Shift].Left; + PlaceButton(AButtons[I], OriginX, OriginY); + end; + end; + + procedure OriginalPlaceButtons; + var + OriginX, OriginY, I: Integer; + begin + OriginX := ARightOrigin; + OriginY := ATopOrigin; + for I := Low(AButtons) to High(AButtons) do + begin + Dec(OriginX, AButtons[I].Width); + if I > 0 then Dec(OriginX, ABtnOffsetX); + PlaceButton(AButtons[I], OriginX, OriginY); + end; + end; + + procedure ReplaceButtons; + var + Found: Boolean; + I, Count, StartIndex: Integer; + begin + StartIndex := 0; + Count := 1; + repeat + Found := False; + for I := StartIndex to High(AButtons) do + if not AButtons[I].Visible then + begin + Found := True; + Count := 1; + while not AButtons[I + Count].Visible do + Inc(Count); + end; + if Found then + begin + ShiftButtons(StartIndex, Count); + Inc(StartIndex, Count); + end; + until not Found; + end; + + procedure InvalidateButtons; + var + I: Integer; + begin + for I := Low(AButtons) to High(AButtons) do + AButtons[I].Invalidate; + end; + +begin + DWP := BeginDeferWindowPos(High(AButtons) - Low(AButtons)+ 1); + try + OriginalPlaceButtons; + ReplaceButtons; + finally + EndDeferWindowPos(DWP); + InvalidateButtons; + end; +end; + +procedure dxAppendList(ASource, ADest: TList); +var + PrevCount: Integer; + DestMem: PPointerList; +begin + PrevCount := ADest.Count; + ADest.Count := ADest.Count + ASource.Count; + ADest.Count := ADest.Count + ASource.Count; + if ADest.Count <> 0 then + begin + DestMem := Pointer(Integer(ADest.List) + SizeOf(Pointer) * PrevCount); + Move(ASource.List^, DestMem^, SizeOf(Pointer) * ASource.Count); + end; +end; + +procedure dxCopyList(ASource, ADest: TList); +begin + ADest.Count := ASource.Count; + Move(ASource.List^, ADest.List^, SizeOf(Pointer) * ADest.Count); +end; + +procedure dxShiftIntegerListValues(AList: TList; AValue: Integer); +var + I: Integer; +begin + with AList do + for I := 0 to Count - 1 do + List^[I] := Pointer(Integer(List^[I]) + AValue); +end; + +function dxCheckStateImageIndexMap(AState: TCheckBoxState): Integer; +const + CheckBoxStateMap: array[TCheckBoxState] of Integer = (0, 1, 2); +begin + Result := 1 + CheckBoxStateMap[AState]; +end; + +procedure dxCreateCheckMarkImages(AnImageList: TCustomImageList); +const + MaskColor: TColor = clFuchsia; + + procedure DrawCheckBox(ACanvas: TCanvas; const R: TRect; State: TCheckBoxState); + const + InteriorColors: array[Boolean] of TColor = (clWindow, clBtnFace); + var + C: TColor; + begin + with ACanvas do + begin + C := Font.Color; + + //frame + Font.Color := clBtnShadow; + DrawGlyph(Handle, R, CheckBottomRightArcInnerIndex); + DrawGlyph(Handle, R, CheckTopLeftArcInnerIndex); + + //interior + Font.Color := InteriorColors[State = cbGrayed]; + DrawGlyph(Handle, R, CheckInteriorIndex); + + //checkmark + if State in [cbChecked, cbGrayed] then + begin + Font.Color := clWindowText; + DrawGlyph(Handle, R, CheckMarkIndex); + end; + + Font.Color := C; + end; + end; + +var + Bitmap: TBitmap; + State: TCheckBoxState; + R, CheckRect: TRect; + Ch: Char; + Size: TSize; +begin + Bitmap := TBitmap.Create; + with Bitmap do + try + Width := AnImageList.Width; + Height := AnImageList.Height; + + Canvas.Font.Name := 'Marlett'; + Canvas.Font.Size := 10; + Canvas.Font.Charset := SYMBOL_CHARSET; + + R := MakeRect(0, 0, Width, Height); + Canvas.Brush.Color := MaskColor; + Canvas.FillRect(R); + AnImageList.AddMasked(Bitmap, clDefault); + + CheckRect := R; + Ch := Chr(CheckBottomRightArcInnerIndex); + Size := Canvas.TextExtent(Ch); + InflateRect(CheckRect, -(R.Right - R.Left - Size.cX) div 2, -(R.Bottom - R.Top - Size.cY) div 2); + + for State := Low(TCheckBoxState) to High(TCheckBoxState) do + begin + Canvas.Brush.Style := bsSolid; + Canvas.FillRect(R); + Canvas.Brush.Style := bsClear; + DrawCheckBox(Canvas, CheckRect, State); + + AnImageList.AddMasked(Bitmap, clDefault); + end; + finally + Bitmap.Free; + end; +end; + +function dxPSDrawModeImages: TCustomImageList; + + procedure LoadImages; + + procedure LoadImage(B: TBitmap; const AResName: string); + begin + Bitmap_LoadFromResourceName(B, AResName); + FDrawModeImages.AddMasked(B, clDefault); + end; + + var + B: TBitmap; + begin + B := TBitmap.Create; + try + LoadImage(B, IDB_DXPSDRAWMODE_STRICT); + LoadImage(B, IDB_DXPSDRAWMODE_ODDEVEN); + LoadImage(B, IDB_DXPSDRAWMODE_CHESS); + LoadImage(B, IDB_DXPSDRAWMODE_BORROW); + finally + B.Free; + end; + end; + +begin + if FDrawModeImages = nil then + begin + FDrawModeImages := TImageList.Create(nil); + LoadImages; + end; + Result := FDrawModeImages; +end; + +{$IFNDEF DELPHI5} +procedure FreeAndNil(var Obj); +var + P: TObject; +begin + P := TObject(Obj); + TObject(Obj) := nil; + P.Free; +end; +{$ENDIF} + +function dxAllocatehWnd(AMethod: TWndMethod): HWND; +begin + {$IFDEF DELPHI6} + Result := Classes.AllocatehWnd(AMethod); + {$ELSE} + Result := Forms.AllocatehWnd(AMethod); + {$ENDIF} +end; + +procedure dxDeallocatehWnd(AWnd: HWND); +begin + if IsWindow(AWnd) then + {$IFDEF DELPHI6} + Classes.DeallocatehWnd(AWnd); + {$ELSE} + Forms.DeallocatehWnd(AWnd); + {$ENDIF} +end; + +procedure dxRecreateWnd(AControl: TWinControl); +begin + TWinControlAccess(AControl).RecreateWnd; +end; + +function MakeBounds(ALeft, ATop, AWidth, AHeight: Integer): TRect; +begin + with Result do + begin + Left := ALeft; + Top := ATop; + Right := ALeft + AWidth; + Bottom := ATop + AHeight; + end; +end; + +function MakePoint(X, Y: Integer): TPoint; +begin + Result.X := X; + Result.Y := Y; +end; + +function MakeRect(ALeft, ATop, ARight, ABottom: Integer): TRect; +begin + with Result do + begin + Left := ALeft; + Top := ATop; + Right := ARight; + Bottom := ABottom; + end; +end; + +function MakeRect(const ATopLeft, ABottomRight: TPoint): TRect; +begin + with Result do + begin + TopLeft := ATopLeft; + BottomRight := ABottomRight; + end; +end; + +function TTagToInt(AValue: Integer ): Integer; +begin + Result := AValue; +end; + +function TTagToObj(AValue: Integer ): TObject; +begin + Result := TObject(AValue); +end; + +function TTagToClass(AValue: Integer ): TClass; +begin + Result := TClass(AValue); +end; + +function MakeTTag(AValue: Integer): Integer ; +begin + Result := AValue; +end; + +function MakeTTag(AValue: TObject): Integer ; +begin + Result := Integer(AValue); +end; + +function MakeTTag(AValue: TClass): Integer ; +begin + Result := Integer(AValue); +end; + +function Control_GetColor(AControl: TControl): TColor; +begin + Result := TControlAccess(AControl).Color; +end; + +function Control_GetControlStyle(AControl: TControl): TControlStyle; +begin + Result := TControlAccess(AControl).ControlStyle; +end; + +function Control_GetCtl3D(AControl: TWinControl): Boolean; +begin + Result := TWinControlAccess(AControl).Ctl3D; +end; + +function Control_GetFont(AControl: TControl): TFont; +begin + Result := TControlAccess(AControl).Font; +end; + +function Control_GetPopupMenu(AControl: TControl): TPopupMenu; +begin + Result := TControlAccess(AControl).PopupMenu; +end; + +function Control_GetText(AControl: TControl): string; +begin + Result := TControlAccess(AControl).Text; +end; + +procedure Control_SetParentBackground(AControl: TWinControl; Value: Boolean); +begin +{$IFDEF DELPHI7} + TWinControlAccess(AControl).ParentBackground := Value; +{$ENDIF} +end; + +procedure Control_DoContextPopup(AControl: TControl; const Pt: TPoint; var AHandled: Boolean); +begin + AHandled := False; + {$IFDEF DELPHI5} + TControlAccess(AControl).DoContextPopup(Pt, AHandled); + {$ENDIF} +end; + +procedure Control_PaintWindow(AControl: TWinControl; DC: HDC); +begin + TWinControlAccess(AControl).PaintWindow(DC); +end; + +procedure Control_SendCancelMode(AControl, ASender: TControl); +begin + TControlAccess(AControl).SendCancelMode(ASender); +end; + +procedure Control_UpdateBoundsRect(AControl: TControl; const R: TRect); +begin + TControlAccess(AControl).UpdateBoundsRect(R); +end; + +procedure Control_UpdateBoundsRect(AControl: TControl; ALeft, ARight, AWidth, AHeight: Integer); +begin + Control_UpdateBoundsRect(AControl, MakeBounds(ALeft, ARight, AWidth, AHeight)); +end; + +procedure PopupMenu_DoPopup(APopupMenu: TPopupMenu); +begin + {$IFDEF DELPHI5} + TPopupMenuAccess(APopupMenu).DoPopup(APopupMenu); + {$ELSE} + if Assigned(APopupMenu.OnPopup) then APopupMenu.OnPopup(APopupMenu); + {$ENDIF} +end; + +function RichEdit_GetBorderStyle(AControl: TCustomRichEdit): TBorderStyle; +begin + Result := TCustomRichEditAccess(AControl).BorderStyle; +end; + +function RichEdit_GetLines(AControl: TCustomRichEdit): TStrings; +begin + Result := TCustomRichEditAccess(AControl).Lines; +end; + +procedure Bitmap_LoadFromResourceName(ABitmap: TBitmap; const AResName: string; + ABaseName: string = 'dxPSImgs'); +begin + ABitmap.LoadFromResourceName(hInstance, AResName); +end; + +procedure Icon_LoadFromResourceName(AIcon: TIcon; const AResName: string; + ABaseName: string = 'dxPSImgs'); +var + Bitmap: TBitmap; + ImageList: TImageList; +begin + Bitmap := TBitmap.Create; + try + Bitmap_LoadFromResourceName(Bitmap, AResName); + ImageList := TImageList.CreateSize(Bitmap.Width, Bitmap.Height); + try + ImageList.AllocBy := 1; + ImageList.AddMasked(Bitmap, clDefault); + AIcon.Handle := ImageList_GetIcon(ImageList.Handle, 0, ILD_NORMAL); + finally + ImageList.Free; + end; + finally + Bitmap.Free; + end; +end; + +{$IFNDEF DELPHI6} +type + PPointer = ^Pointer; +{$ENDIF} + +function IsDelphiObject(AData: DWORD): Boolean; +var + P: Pointer; + SelfPtr: Pointer; +begin + Result := False; + + P := Pointer(AData); + if IsBadReadPtr(P, SizeOf(Pointer)) then Exit; + + P := PPointer(P)^; + if IsBadReadPtr(P, SizeOf(Pointer)) then Exit; + + SelfPtr := Pointer(Integer(P) + vmtSelfPtr); + if IsBadReadPtr(SelfPtr, SizeOf(Pointer)) then Exit; + SelfPtr := PPointer(SelfPtr)^; + + Result := P = SelfPtr; +end; + +initialization + CoInitialize(nil); + PopulateShellImages(True); + +finalization + FreeAndNil(FDrawModeImages); + if FPatternBrush <> 0 then + Windows.DeleteObject(FPatternBrush); + + FreeAndNil(FTrueTypeFonts); + FreeAndNil(FNonTrueTypeFonts); + FreeAndNil(FShellLargeImages); + FreeAndNil(FShellSmallImages); + + CoUninitialize; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSXplorerTreeView.pas b/official/x.35/ExpressPrinting System/Sources/dxPSXplorerTreeView.pas new file mode 100644 index 00000000..ea958767 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSXplorerTreeView.pas @@ -0,0 +1,1343 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSXplorerTreeView; + +interface + +{$I cxVer.inc} + +uses + Windows, Classes, Messages, CommCtrl, Graphics, Controls, ExtCtrls, ComCtrls, + Forms, dxPSCore; + +type + TCustomTreeViewClass = class of TCustomTreeView; + + TCustomdxPSExplorerTreeViewContainer = class(TCustomdxPSExplorerTreeContainer) + private + FFocusedNode: TTreeNode; + FStorageStream: TMemoryStream; + function GetRootNode: TTreeNode; + function GetTreeView: TCustomTreeView; + procedure TreeCancelEdit(Sender: TObject; ANode: TTreeNode); + procedure TreeChanged(Sender: TObject; ANode: TTreeNode); + procedure TreeCollapsing(Sender: TObject; Node: TTreeNode; var AllowCollapse: Boolean); + procedure TreeCustomDrawItem(Sender: TCustomTreeView; Node: TTreeNode; + State: TCustomDrawState; var DefaultDraw: Boolean); + procedure TreeDblClick(Sender: TObject); + procedure TreeDragDrop(Sender, Source: TObject; X, Y: Integer); + procedure TreeDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); + procedure TreeEdited(Sender: TObject; Node: TTreeNode; var S: string); + procedure TreeEditing(Sender: TObject; Node: TTreeNode; var AllowEdit: Boolean); + procedure TreeExpanding(Sender: TObject; Node: TTreeNode; var AllowExpansion: Boolean); + procedure TreeKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure TreeKeyPress(Sender: TObject; var Key: Char); + procedure TreeMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + + procedure ReadTreeViewState; + procedure WriteTreeViewState; + protected + procedure AddItem(AParent: TdxPSExplorerFolder; AnItem: TCustomdxPSExplorerItem); override; + procedure Clear; override; + procedure DeleteItem(AnItem: TCustomdxPSExplorerItem); override; + procedure InvalidateItem(AnItem: TCustomdxPSExplorerItem); override; + procedure MoveItem(AnItem: TCustomdxPSExplorerItem); override; + procedure RenameItem(AnItem: TCustomdxPSExplorerItem); override; + + function GetCreationParent: TdxPSExplorerFolder; override; + function GetFocusedItem: TCustomdxPSExplorerItem; override; + function GetIsEditing: Boolean; override; + function GetIsFolderSelected: Boolean; override; + function GetIsItemSelected: Boolean; override; + function GetIsRootSelected: Boolean; override; + function GetSelectedFolder: TdxPSExplorerFolder; override; + function GetSelectedItem: TCustomdxPSExplorerItem; override; + function GetSelectedItemText: string; override; + procedure SetFocusedItem(Value: TCustomdxPSExplorerItem); override; + procedure SetSelectedItem(Value: TCustomdxPSExplorerItem); override; + procedure SetSelectedItemText(const Value: string); override; + + procedure RestoreState; override; + procedure SaveState; override; + + procedure InitializeTreeContainer; override; + + function AddNode(AParent: TTreeNode; AnItem: TCustomdxPSExplorerItem): TTreeNode; virtual; + function CanDragNode(ANode: TTreeNode): Boolean; virtual; + function GetHitTestInfoAt(X, Y: Integer): THitTests; + function GetItemByNode(ANode: TTreeNode): TCustomdxPSExplorerItem; + function GetNodeByItem(AnItem: TCustomdxPSExplorerItem): TTreeNode; + + property FocusedNode: TTreeNode read FFocusedNode; + property RootNode: TTreeNode read GetRootNode; + property TreeView: TCustomTreeView read GetTreeView; + public + function BeginEdit(AnImmediate: Boolean = True): Boolean; override; + procedure EndEdit(ACancel: Boolean); override; + + class function ControlClass: TWinControlClass; override; + class function TreeViewClass: TCustomTreeViewClass; virtual; + + procedure CollapseItem(AnItem: TCustomdxPSExplorerItem; ARecursive: Boolean = False); override; + procedure ExpandItem(AnItem: TCustomdxPSExplorerItem; ARecursive: Boolean = False); override; + procedure MakeItemVisible(AnItem: TCustomdxPSExplorerItem); override; + + procedure BeginUpdate; override; + procedure EndUpdate; override; + + procedure RefreshSorting(ANode: TObject); override; + procedure RefreshSorting(AFolder: TdxPSExplorerFolder); override; + + function GetDropTarget(X, Y: Integer): TdxPSExplorerFolder; override; + function GetItemAt(X, Y: Integer): TCustomdxPSExplorerItem; override; + function GetItemAtMousePos: TCustomdxPSExplorerItem; + end; + + {$IFDEF DELPHI5} + {$IFNDEF DELPHI6} + {$DEFINE WMCONTEXTMENU} + {$ENDIF} + {$ENDIF} + + TdxPSExplorerTreeViewScrollArea = (etsaLeft, etsaTop, etsaRight, etsaBottom); + TdxPSExplorerTreeViewScrollAreas = set of TdxPSExplorerTreeViewScrollArea; + + TdxPSExplorerTreeView = class(TTreeView) + private + FContainer: TCustomdxPSExplorerTreeViewContainer; + FDragImage: TDragImageList; + FExpandTimer: TTimer; + FFlat: Boolean; + FSavedDropTarget: TTreeNode; + FSavedScrollActiveAreas: TdxPSExplorerTreeViewScrollAreas; + FScrollTimer: TTimer; + {$IFNDEF DELPHI6} + FOnCancelEdit: TTVChangedEvent; + {$ENDIF} + function GetIsMouseInScrollArea: Boolean; + function GetIsMouseInScrollAreaBound(ScrollArea: TdxPSExplorerTreeViewScrollArea): Boolean; + function GetScrollActiveAreas: TdxPSExplorerTreeViewScrollAreas; + function GetScrollAreaBounds(ScrollArea: TdxPSExplorerTreeViewScrollArea): TRect; + procedure SetFlat(Value: Boolean); + procedure OnExpandTimer(Sender: TObject); + procedure OnScrollTimer(Sender: TObject); + {$IFDEF WMCONTEXTMENU} + procedure WMContextMenu(var Message: TWMContextMenu); message WM_CONTEXTMENU; + {$ENDIF} + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + procedure CMHintShow(var Message: TCMHintShow); message CM_HINTSHOW; + protected + function CanCollapse(Node: TTreeNode): Boolean; override; + function CanEdit(Node: TTreeNode): Boolean; override; + function CanExpand(Node: TTreeNode): Boolean; override; + procedure Change(Node: TTreeNode); override; + procedure CreateParams(var Params: TCreateParams); override; + procedure DblClick; override; + procedure DoEndDrag(Target: TObject; X, Y: Integer); override; + procedure DoStartDrag(var DragObject: TDragObject); override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); override; + {$IFNDEF DELPHI6} + procedure Edit(const Item: TTVItem); override; + {$ENDIF} + function GetDragImages: TDragImageList; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure WndProc(var Message: TMessage); override; + + function CanDragNode(ANode: TTreeNode): Boolean; virtual; + procedure DrawFlatEdge; virtual; + function GetInfoTip(AnItem: HTREEITEM): string; + function MakeDragBitmap(ANode: TTreeNode): Graphics.TBitmap; virtual; + procedure UpdateDragMode(ANode: TTreeNode); + + property Container: TCustomdxPSExplorerTreeViewContainer read FContainer write FContainer; + property IsMouseInScrollArea: Boolean read GetIsMouseInScrollArea; + property IsMouseInScrollAreaBounds[ScrollArea: TdxPSExplorerTreeViewScrollArea]: Boolean read GetIsMouseInScrollAreaBound; + property ScrollActiveAreas: TdxPSExplorerTreeViewScrollAreas read GetScrollActiveAreas; + property ScrollAreaBounds[ScrollArea: TdxPSExplorerTreeViewScrollArea]: TRect read GetScrollAreaBounds; + public + constructor Create(AOwner: TComponent); override; + constructor CreateEx(AOwner: TComponent; AContainer: TCustomdxPSExplorerTreeViewContainer); virtual; + + procedure DragDrop(Source: TObject; X, Y: Integer); override; + + property Flat: Boolean read FFlat write SetFlat; + property OnCancelEdit{$IFNDEF DELPHI6} : TTVChangedEvent read FOnCancelEdit write FOnCancelEdit{$ENDIF}; + end; + + TdxPSExplorerTreeViewContainer = class(TCustomdxPSExplorerTreeViewContainer) + private + function GetTreeView: TdxPSExplorerTreeView; + protected + procedure InitializeTreeContainer; override; + public + class function TreeViewClass: TCustomTreeViewClass; override; + property TreeView: TdxPSExplorerTreeView read GetTreeView; + end; + +implementation + +uses + SysUtils, cxClasses, dxPSUtl, dxPSGlbl; + +const + ScrollAreaHeight = 30; + ScrollAreaWidth = 30; + +type + TCustomTreeViewAccess = class(TCustomTreeView); + + +{ TreeView Helpers } + +function TreeView_GetItems(AControl: TCustomTreeView): TTreeNodes; +begin + Result := TCustomTreeViewAccess(AControl).Items; +end; + +{ TCustomdxPSExplorerTreeViewContainer } + +function TCustomdxPSExplorerTreeViewContainer.BeginEdit(AnImmediate: Boolean = True): Boolean; +var + SelectedNode: TTreeNode; +begin + Result := CanRenameSelectedItem; + if Result then + begin + SelectedNode := TreeView.Selected; + if AnImmediate then + Result := SelectedNode.EditText + else + Result := PostMessage(TreeView.Handle, TVM_EDITLABEL, 0, lParam(SelectedNode.ItemId)); + Host.UpdateState; + end; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.EndEdit(ACancel: Boolean); +var + Node: TTreeNode; +begin + if TreeView.IsEditing then + begin + Node := TreeView.Selected; + if Node <> nil then Node.EndEdit(ACancel); + end; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.CollapseItem(AnItem: TCustomdxPSExplorerItem; + ARecursive: Boolean = False); +var + Node: TTreeNode; +begin + Node := GetNodeByItem(AnItem); + if Node <> nil then Node.Collapse(ARecursive); +end; + +procedure TCustomdxPSExplorerTreeViewContainer.ExpandItem(AnItem: TCustomdxPSExplorerItem; + ARecursive: Boolean = False); +var + Node: TTreeNode; +begin + Node := GetNodeByItem(AnItem); + if Node <> nil then + begin + dxPSCore.dxPSStartWait; + try + Node.Expand(ARecursive); + finally + dxPSCore.dxPSStopWait; + end; + end; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.MakeItemVisible(AnItem: TCustomdxPSExplorerItem); +var + Node: TTreeNode; +begin + Node := GetNodeByItem(AnItem); + if Node <> nil then + begin + Node.MakeVisible; + Node.Focused := True; + Node.Selected := True; + end; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.BeginUpdate; +begin + inherited; + TreeView_GetItems(TreeView).BeginUpdate; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.EndUpdate; +begin + TreeView_GetItems(TreeView).EndUpdate; + inherited; +end; + +function TreeSortFunc(lParam1, lParam2, lParamSort: Longint): Integer; stdcall; +begin + if lParam2 <> 0 then + Result := TCustomdxPSExplorerItemComparator.CompareItems(TTreeNode(lParam1).Data, TTreeNode(lParam2).Data) + else + Result := 0; +end; + + +procedure TCustomdxPSExplorerTreeViewContainer.RefreshSorting(ANode: TObject); +begin + if Explorer.State * [esLoading{, esRefreshing}] = [] then + if ANode <> nil then + TTreeNode(ANode).CustomSort(TreeSortFunc, (0) {$IFDEF DELPHI6}, False{$ENDIF}) + else + TreeView.CustomSort(TreeSortFunc, (0) {$IFDEF DELPHI6}, True{$ENDIF}) +end; + +procedure TCustomdxPSExplorerTreeViewContainer.RefreshSorting(AFolder: TdxPSExplorerFolder); +var + Node: TObject; +begin + if (AFolder = nil) or AFolder.IsRoot then + Node := nil + else + Node := GetNodeByItem(AFolder); + RefreshSorting(Node); +end; + +class function TCustomdxPSExplorerTreeViewContainer.ControlClass: TWinControlClass; +begin + Result := TreeViewClass; +end; + +class function TCustomdxPSExplorerTreeViewContainer.TreeViewClass: TCustomTreeViewClass; +begin + Result := TCustomTreeView; +end; + +function TCustomdxPSExplorerTreeViewContainer.GetItemAt(X, Y: Integer): TCustomdxPSExplorerItem; +begin + Result := GetItemByNode(TreeView.GetNodeAt(X, Y)) +end; + +function TCustomdxPSExplorerTreeViewContainer.GetItemAtMousePos: TCustomdxPSExplorerItem; +begin + with Control.ScreenToClient(Mouse.CursorPos) do + Result := GetItemAt(X, Y); +end; + +function TCustomdxPSExplorerTreeViewContainer.GetDropTarget(X, Y: Integer): TdxPSExplorerFolder; +var + Item: TCustomdxPSExplorerItem; +begin + if TreeView.DropTarget <> nil then + if [ComCtrls.htBelow, ComCtrls.htNowhere] * GetHitTestInfoAt(X, Y) = [] then + begin + Item := GetItemByNode(TreeView.DropTarget); + if Item is TdxPSExplorerFolder then + Result := TdxPSExplorerFolder(Item) + else + Result := nil; + end + else + Result := Explorer.Root + else + Result := Explorer.Root; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.AddItem(AParent: TdxPSExplorerFolder; + AnItem: TCustomdxPSExplorerItem); +var + Node: TTreeNode; +begin + Node := AddNode(GetNodeByItem(AParent), AnItem); + if AnItem is TdxPSExplorerFolder then + Node.HasChildren := TdxPSExplorerFolderHelper.GetHasChildren(TdxPSExplorerFolder(AnItem)); +end; + +procedure TCustomdxPSExplorerTreeViewContainer.Clear; +begin + TreeView_GetItems(TreeView).Clear; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.DeleteItem(AnItem: TCustomdxPSExplorerItem); +begin + inherited; + GetNodeByItem(AnItem).Delete; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.InvalidateItem(AnItem: TCustomdxPSExplorerItem); +var + Node: TTreeNode; + R: TRect; +begin + Node := GetNodeByItem(AnItem); + if Node <> nil then + begin + R := Node.DisplayRect(False); + InvalidateRect(TreeView.Handle, @R, True); + end; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.MoveItem(AnItem: TCustomdxPSExplorerItem); +var + Node: TTreeNode; +begin + Node := GetNodeByItem(AnItem); + if Node <> nil then { We are not in creation phase of parent assigning } + if AnItem is TdxPSExplorerFolder then + Node.MoveTo(GetNodeByItem(AnItem.Parent), naAddChildFirst) + else + Node.MoveTo(GetNodeByItem(AnItem.Parent), naAddChild); +end; + +procedure TCustomdxPSExplorerTreeViewContainer.RenameItem(AnItem: TCustomdxPSExplorerItem); +begin + GetNodeByItem(AnItem).Text := AnItem.DisplayName; +end; + +function TCustomdxPSExplorerTreeViewContainer.GetCreationParent: TdxPSExplorerFolder; +var + Item: TCustomdxPSExplorerItem; +begin + Item := SelectedItem; + if Item = nil then + Result := Explorer.Root + else + if not (Item is TdxPSExplorerFolder) then + Result := Item.Parent + else + Result := TdxPSExplorerFolder(Item); +end; + +function TCustomdxPSExplorerTreeViewContainer.GetFocusedItem: TCustomdxPSExplorerItem; +begin + Result := GetItemByNode(FocusedNode); +end; + +function TCustomdxPSExplorerTreeViewContainer.GetIsEditing: Boolean; +begin + Result := TreeView.IsEditing; +end; + +function TCustomdxPSExplorerTreeViewContainer.GetIsFolderSelected: Boolean; +begin + Result := SelectedItem is TdxPSExplorerFolder; +end; + +function TCustomdxPSExplorerTreeViewContainer.GetIsItemSelected: Boolean; +begin + Result := SelectedItem is TdxPSExplorerItem; +end; + +function TCustomdxPSExplorerTreeViewContainer.GetIsRootSelected: Boolean; +begin + Result := SelectedItem = Explorer.Root; +end; + +function TCustomdxPSExplorerTreeViewContainer.GetSelectedFolder: TdxPSExplorerFolder; +var + Item: TCustomdxPSExplorerItem; +begin + Item := SelectedItem; + if Item is TdxPSExplorerFolder then + Result := TdxPSExplorerFolder(Item) + else + Result := nil; +end; + +function TCustomdxPSExplorerTreeViewContainer.GetSelectedItem: TCustomdxPSExplorerItem; +begin + Result := GetItemByNode(TreeView.Selected); +end; + +function TCustomdxPSExplorerTreeViewContainer.GetSelectedItemText: string; +var + Node: TTreeNode; +begin + Node := GetNodeByItem(SelectedItem); + if Node <> nil then + Result := Node.Text + else + Result := ''; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.SetFocusedItem(Value: TCustomdxPSExplorerItem); +var + Node: TTreeNode; +begin + Node := GetNodeByItem(Value); + if Node <> nil then + Node.Focused := True; + FFocusedNode := Node; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.SetSelectedItem(Value: TCustomdxPSExplorerItem); +var + Node: TTreeNode; +begin + Node := GetNodeByItem(Value); + if Node <> nil then + Node.Selected := True; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.SetSelectedItemText(const Value: string); +var + Node: TTreeNode; +begin + Node := GetNodeByItem(SelectedItem); + if Node <> nil then + begin + Node.Text := Value; + //RefreshSorting(Node.Parent); {.1} + end; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.RestoreState; +begin + FStorageStream.Position := 0; + ReadTreeViewState; + FreeAndNil(FStorageStream); +end; + +procedure TCustomdxPSExplorerTreeViewContainer.SaveState; +begin + FStorageStream := TMemoryStream.Create; + WriteTreeViewState; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.InitializeTreeContainer; +begin + inherited; + TCustomTreeViewAccess(TreeView).OnCustomDrawItem := TreeCustomDrawItem; + TCustomTreeViewAccess(TreeView).OnEdited := TreeEdited; +end; + +function TCustomdxPSExplorerTreeViewContainer.AddNode(AParent: TTreeNode; + AnItem: TCustomdxPSExplorerItem): TTreeNode; +begin + Result := TreeView_GetItems(TreeView).AddChildObject(AParent, AnItem.DisplayName, AnItem); + Result.ImageIndex := TCustomdxPSExplorerItemHelper.GetImageIndex(AnItem); + Result.SelectedIndex := TCustomdxPSExplorerItemHelper.GetSelectedIndex(AnItem); +// RefreshSorting(AParent); //3.1 +end; + +function TCustomdxPSExplorerTreeViewContainer.CanDragNode(ANode: TTreeNode): Boolean; +var + Item: TCustomdxPSExplorerItem; +begin + Item := GetItemByNode(ANode); + Result := (Item <> nil) and Item.CanMove; +end; + +function TCustomdxPSExplorerTreeViewContainer.GetHitTestInfoAt(X, Y: Integer): THitTests; +begin + Result := TreeView.GetHitTestInfoAt(X, Y); +end; + +function TCustomdxPSExplorerTreeViewContainer.GetItemByNode(ANode: TTreeNode): TCustomdxPSExplorerItem; +begin + if ANode <> nil then + Result := TCustomdxPSExplorerItem(ANode.Data) + else + Result := nil; +end; + +function TCustomdxPSExplorerTreeViewContainer.GetNodeByItem(AnItem: TCustomdxPSExplorerItem): TTreeNode; + + function FindInChildren(ANode: TTreeNode): TTreeNode; + var + I: Integer; + begin + for I := 0 to ANode.Count - 1 do + begin + Result := ANode[I]; + if GetItemByNode(Result) = AnItem then + Exit; + if Result.HasChildren then + begin + Result := FindInChildren(Result); + if Result <> nil then Exit; + end; + end; + Result := nil; + end; + +begin + Result := RootNode; + if (Result <> nil) and (GetItemByNode(Result) <> AnItem) then + Result := FindInChildren(Result); +end; + +function TCustomdxPSExplorerTreeViewContainer.GetRootNode: TTreeNode; +begin + Result := TreeView_GetItems(TreeView).GetFirstNode; +end; + +function TCustomdxPSExplorerTreeViewContainer.GetTreeView: TCustomTreeView; +begin + Result := TCustomTreeView(Control); +end; + +procedure TCustomdxPSExplorerTreeViewContainer.TreeCollapsing(Sender: TObject; + Node: TTreeNode; var AllowCollapse: Boolean); +begin + AllowCollapse := GetItemByNode(Node) <> Explorer.Root; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.TreeCustomDrawItem(Sender: TCustomTreeView; + Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean); +var + Item: TCustomdxPSExplorerItem; +begin + Item := GetItemByNode(Node); + if Item is TdxPSExplorerItem then + with Sender.Canvas do + begin + if TdxPSExplorerItem(Item).IsCurrentlyLoaded then + Font.Style := Font.Style + [fsBold]; + if TdxPSExplorerItem(Item).HasInvalidData then + Font.Color := clGrayText; + end; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.TreeDblClick(Sender: TObject); +begin + if (SelectedItem <> nil) and (GetItemAtMousePos = SelectedItem) and CanLoadSelectedItemData then + LoadSelectedItemData; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.TreeDragDrop(Sender, Source: TObject; + X, Y: Integer); +begin + SelectedItem.Parent := GetDropTarget(X, Y); +end; + +procedure TCustomdxPSExplorerTreeViewContainer.TreeDragOver(Sender, Source: TObject; + X, Y: Integer; State: TDragState; var Accept: Boolean); +begin + Accept := (Source = Sender) and SelectedItem.CanMoveTo(GetDropTarget(X, Y)); +end; + +procedure TCustomdxPSExplorerTreeViewContainer.TreeCancelEdit(Sender: TObject; ANode: TTreeNode); +begin + Host.UpdateState; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.TreeChanged(Sender: TObject; ANode: TTreeNode); +begin + FFocusedNode := ANode; + Host.UpdateState; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.TreeEdited(Sender: TObject; Node: TTreeNode; + var S: string); +var + Item: TCustomdxPSExplorerItem; + ErrorText: string; +begin + if Node.Selected then Node.Focused := True; + + Item := GetItemByNode(Node); + if not dxSameStr(Item.DisplayName, S) then + if not Item.CanRenameTo(S) then + begin + ErrorText := Item.CannotRenameMessageText(Item.DisplayName, S); + dxPSUtl.MessageError(ErrorText); + BeginEdit(False); + end + else + Item.Name := S; + + Host.UpdateState; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.TreeEditing(Sender: TObject; Node: TTreeNode; + var AllowEdit: Boolean); +var + Item: TCustomdxPSExplorerItem; + Editor: HWND; +begin + Item := GetItemByNode(Node); + AllowEdit := (Item <> nil) and Item.CanRename; + if AllowEdit then + begin + TreeView.Selected.Text := Item.DisplayName; + Editor := TreeView_GetEditControl(TreeView.Handle); + if IsWindow(Editor) then + SendMessage(Editor, WM_SETTEXT, 0, Integer(PChar(Item.DisplayName))); + end; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.TreeExpanding(Sender: TObject; Node: TTreeNode; + var AllowExpansion: Boolean); +var + Item: TCustomdxPSExplorerItem; +begin + Item := GetItemByNode(Node); + if Item is TdxPSExplorerFolder then + begin + TdxPSExplorerFolder(Item).Populate; + //RefreshSorting(Item); + end; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.TreeKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + ProcessKeyDown(Key, Shift); +end; + +procedure TCustomdxPSExplorerTreeViewContainer.TreeKeyPress(Sender: TObject; + var Key: Char); +begin + ProcessKeyPress(Key); +end; + +procedure TCustomdxPSExplorerTreeViewContainer.TreeMouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + Host.UpdateState; +end; + +type + TdxNodeInfo = record + Expanded: Integer; + Count: Integer; + UniqueIDSize: Integer; + //UniqueID: TBytes with UniqueIDSize length + end; + +function GetNodeInfoSize: Integer; +begin + Result := SizeOf(TdxNodeInfo); +end; + +procedure TCustomdxPSExplorerTreeViewContainer.ReadTreeViewState; + + function ReadNode(ARecursive: Boolean): TTreeNode; + var + NodeInfo: TdxNodeInfo; + Bytes: TBytes; + Item: TCustomdxPSExplorerItem; + I: Integer; + begin + Result := nil; + FStorageStream.ReadBuffer(NodeInfo, GetNodeInfoSize); + if NodeInfo.UniqueIDSize <> 0 then + begin + SetLength(Bytes, NodeInfo.UniqueIDSize); + FStorageStream.ReadBuffer(Pointer(Bytes)^, NodeInfo.UniqueIDSize); + Item := Explorer.FindCustomItemByUniqueID(Bytes); + if Item <> nil then + begin + Result := GetNodeByItem(Item); + if Result <> nil then + Result.Expanded := NodeInfo.Expanded = 1; + end; + end; + if ARecursive then + for I := 0 to NodeInfo.Count - 1 do + ReadNode(ARecursive); + end; + + procedure ReadSelection; + var + Buffer: Integer; + begin + FStorageStream.ReadBuffer(Buffer, SizeOf(Buffer)); + if Buffer <> 0 then + TreeView.Selected := ReadNode(False); + end; + +begin + BeginUpdate; + try + ReadNode(True); + ReadSelection; + finally + EndUpdate; + end; +end; + +procedure TCustomdxPSExplorerTreeViewContainer.WriteTreeViewState; + + procedure WriteNode(ANode: TTreeNode; ARecursive: Boolean); + var + Item: TCustomdxPSExplorerItem; + NodeInfo: TdxNodeInfo; + Bytes: TBytes; + I: Integer; + begin + Item := GetItemByNode(ANode); + with NodeInfo do + begin + Expanded := Ord(ANode.Expanded); + if Expanded = 1 then + Count := ANode.Count + else + Count := 0; + UniqueIDSize := Item.GetUniqueID(Bytes); + end; + FStorageStream.WriteBuffer(NodeInfo, GetNodeInfoSize); + if NodeInfo.UniqueIDSize <> 0 then + FStorageStream.WriteBuffer(Pointer(Bytes)^, NodeInfo.UniqueIDSize); + + for I := 0 to ANode.Count - 1 do + WriteNode(ANode[I], ARecursive); + end; + + procedure WriteSelection; + var + Flag: Integer; + begin + Flag := Ord(TreeView.Selected <> nil); + FStorageStream.WriteBuffer(Flag , SizeOf(Flag)); + if TreeView.Selected <> nil then + WriteNode(TreeView.Selected, False); + end; + +begin + WriteNode(RootNode, True); + WriteSelection; +end; + +{ TdxPSExplorerTreeView } + +constructor TdxPSExplorerTreeView.Create(AOwner: TComponent); + + function CreateTimer(AnInterval: Integer; AnOnTimer: TNotifyEvent): TTimer; + begin + Result := TTimer.Create(Self); + Result.Enabled := False; + Result.Interval := AnInterval; + Result.OnTimer := AnOnTimer; + end; + +begin + inherited; + Align := alClient; + DragMode := dmAutomatic; + HideSelection := False; + Images := dxPSExplorerImages; + ShowHint := True; + ShowRoot := False; + if IsWin32Version(5, 1) then + begin + ShowLines := False; + //HotTrack := True; + end; + + FDragImage := TDragImageList.Create(Self); + + FExpandTimer := CreateTimer(500, OnExpandTimer); + FScrollTimer := CreateTimer(80, OnScrollTimer); +end; + +constructor TdxPSExplorerTreeView.CreateEx(AOwner: TComponent; + AContainer: TCustomdxPSExplorerTreeViewContainer); +begin + Create(AOwner); + FContainer := AContainer; +end; + +procedure TdxPSExplorerTreeView.DragDrop(Source: TObject; X, Y: Integer); +begin + inherited; + Container.TreeDragDrop(Self, Source, X, Y); +end; + +function TdxPSExplorerTreeView.CanCollapse(Node: TTreeNode): Boolean; +begin + Result := inherited CanCollapse(Node); + Container.TreeCollapsing(Self, Node, Result); +end; + +function TdxPSExplorerTreeView.CanEdit(Node: TTreeNode): Boolean; +begin + Result := inherited CanEdit(Node); + Container.TreeEditing(Self, Node, Result); +end; + +function TdxPSExplorerTreeView.CanExpand(Node: TTreeNode): Boolean; +begin + Result := inherited CanExpand(Node); + Container.TreeExpanding(Self, Node, Result); +end; + +procedure TdxPSExplorerTreeView.Change(Node: TTreeNode); +begin + inherited; + Container.TreeChanged(Self, Node); +end; + +procedure TdxPSExplorerTreeView.CreateParams(var Params: TCreateParams); +begin + inherited; + Params.Style := Params.Style or TVS_INFOTIP; +end; + +procedure TdxPSExplorerTreeView.DblClick; +begin + inherited; + Container.TreeDblClick(Self); +end; + +procedure TdxPSExplorerTreeView.DoEndDrag(Target: TObject; X, Y: Integer); +begin + FDragImage.Clear; + FSavedScrollActiveAreas := []; + FSavedDropTarget := nil; + FExpandTimer.Enabled := False; + FScrollTimer.Enabled := False; + inherited; +end; + +procedure TdxPSExplorerTreeView.DoStartDrag(var DragObject: TDragObject); +var + Pt: TPoint; + DragNode: TTreeNode; + Bitmap: Graphics.TBitmap; +begin + inherited; + Pt := ScreenToClient(Mouse.CursorPos); + DragNode := GetNodeAt(Pt.X, Pt.Y); + if DragNode <> nil then + begin + FDragImage.Handle := TreeView_CreateDragImage(Handle, DragNode.ItemId); + if FDragImage.Handle <> 0 then + begin + //Item := GetItemFromNode(DragNode); + //Item.Unload; + Bitmap := MakeDragBitmap(DragNode); + try + with FDragImage do + begin + Clear; + Width := Bitmap.Width; + Height := Bitmap.Height; + AddMasked(Bitmap, clDefault); + SetDragImage(0, 2, 2); + end; + finally + Bitmap.Free; + end; + end; + end; +end; + +procedure TdxPSExplorerTreeView.DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); +begin + inherited; + Container.TreeDragOver(Self, Source, X, Y, State, Accept); + if Accept and (DropTarget <> nil) and not DropTarget.Expanded then + begin + FSavedDropTarget := DropTarget; + FExpandTimer.Enabled := False; + FExpandTimer.Enabled := True; + end; + if IsMouseInScrollArea then + begin + FSavedScrollActiveAreas := ScrollActiveAreas; + FScrollTimer.Enabled := False; + FScrollTimer.Enabled := True; + end; +end; + +{$IFNDEF DELPHI6} +procedure TdxPSExplorerTreeView.Edit(const Item: TTVItem); +var + Node: TTreeNode; +begin + inherited; + if Item.pszText = nil then + begin + if (Item.State and TVIF_PARAM) <> 0 then + Node := Pointer(Item.lParam) + else + Node := Items.GetNode(Item.hItem); + if Assigned(FOnCancelEdit) then FOnCancelEdit(Self, Node); + end; +end; +{$ENDIF} + +function TdxPSExplorerTreeView.GetDragImages: TDragImageList; +begin + if FDragImage.Count <> 0 then + Result := FDragImage + else + Result := nil; +end; + +procedure TdxPSExplorerTreeView.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited; + Container.TreeKeyDown(Self, Key, Shift); +end; + +procedure TdxPSExplorerTreeView.KeyPress(var Key: Char); +begin + inherited; + Container.TreeKeyPress(Self, Key); +end; + +procedure TdxPSExplorerTreeView.MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + inherited; + Container.TreeMouseDown(Self, Button, Shift, X, Y); +end; + +procedure TdxPSExplorerTreeView.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +var + Pt: TPoint; + Node: TTreeNode; +begin + if Button = mbRight then + begin + Pt := MakePoint(X, Y); + {$IFDEF DELPHI5} + {$IFNDEF DELPHI7} + Pt := ScreenToClient(Pt); + {$ENDIF} + {$ENDIF} + Node := GetNodeAt(Pt.X, Pt.Y); + if Node <> nil then + begin + Node.Focused := True; + Node.Selected := True; + end; + end; + inherited; +end; + +procedure TdxPSExplorerTreeView.WndProc(var Message: TMessage); +var + Node: TTreeNode; +begin + if (Message.Msg = WM_LBUTTONDOWN) or (Message.Msg = WM_LBUTTONDBLCLK) then + with TWMMouse(Message) do + if Keys and MK_LBUTTON = MK_LBUTTON then + begin + Node := GetNodeAt(XPos, YPos); + if Node <> nil then + UpdateDragMode(Node); + end; + try + inherited; + except + end; +end; + +function TdxPSExplorerTreeView.CanDragNode(ANode: TTreeNode): Boolean; +begin + Result := (Container = nil) or Container.CanDragNode(ANode); +end; + +procedure TdxPSExplorerTreeView.DrawFlatEdge; +var + R: TRect; + DC: HDC; +begin + GetWindowRect(Handle, R); + OffsetRect(R, -R.Left, -R.Top); + + DC := GetWindowDC(Handle); + try + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNSHADOW)); + InflateRect(R, -1, -1); + FrameRect(DC, R, GetSysColorBrush(COLOR_WINDOW)); + finally + ReleaseDC(Handle, DC); + end; +end; + +function TdxPSExplorerTreeView.GetInfoTip(AnItem: HTREEITEM): string; +var + ExplorerItem: TCustomdxPSExplorerItem; +begin + ExplorerItem := TCustomdxPSExplorerItem(Items.GetNode(AnItem).Data); + if ExplorerItem <> nil then + Result := ExplorerItem.InfoTip + else + Result := ''; + if Result <> '' then + Result := Result + ' ' + #0#0; +end; + +function TdxPSExplorerTreeView.MakeDragBitmap(ANode: TTreeNode): Graphics.TBitmap; +const + Format: UINT = DT_LEFT or DT_CENTER or DT_END_ELLIPSIS or DT_SINGLELINE; +var + S: string; + R: TRect; +begin + S := ANode.Text; + + Result := Graphics.TBitmap.Create; + with Result do + begin + Width := Images.Width + 2 + Self.Canvas.TextWidth(S) + 1; + Height := TreeView_GetItemHeight(Self.Handle); + R := MakeRect(0, 0, Width, Height); + + Canvas.Brush.Color := clWhite; + Canvas.FillRect(R); + + Images.Draw(Canvas, 0, 0, ANode.ImageIndex); + + Canvas.Font.Assign(Self.Font); + Canvas.Brush.Style := bsClear; + Inc(R.Left, Images.Width + 2); + Windows.DrawText(Canvas.Handle, PChar(S), Length(S), R, Format); + Canvas.Brush.Style := bsSolid; + end; +end; + +procedure TdxPSExplorerTreeView.UpdateDragMode(ANode: TTreeNode); +const + DragModesMap: array[Boolean] of TDragMode = (dmManual, dmAutomatic); +begin + DragMode := DragModesMap[CanDragNode(ANode)]; +end; + +function TdxPSExplorerTreeView.GetIsMouseInScrollArea: Boolean; +var + ScrollArea: TdxPSExplorerTreeViewScrollArea; +begin + Result := True; + for ScrollArea := Low(ScrollArea) to High(ScrollArea) do + if IsMouseInScrollAreaBounds[ScrollArea] then Exit; + Result := False; +end; + +function TdxPSExplorerTreeView.GetIsMouseInScrollAreaBound(ScrollArea: TdxPSExplorerTreeViewScrollArea): Boolean; +begin + Result := PtInRect(ScrollAreaBounds[ScrollArea], ScreenToClient(Mouse.CursorPos)); +end; + +function TdxPSExplorerTreeView.GetScrollActiveAreas: TdxPSExplorerTreeViewScrollAreas; +var + ScrollArea: TdxPSExplorerTreeViewScrollArea; +begin + Result := []; + for ScrollArea := Low(ScrollArea) to High(ScrollArea) do + if IsMouseInScrollAreaBounds[ScrollArea] then + Include(Result, ScrollArea); +end; + +function TdxPSExplorerTreeView.GetScrollAreaBounds(ScrollArea: TdxPSExplorerTreeViewScrollArea): TRect; +type + TScrollBarKind = (sbkHorz, sbkVert); + + function HasScrollBar(AScrollBarKind: TScrollBarKind): Boolean; + const + ScrollBarKindMap: array[TScrollBarKind] of Integer = (WS_HSCROLL, WS_VSCROLL); + begin + Result := Windows.GetWindowLong(Handle, GWL_STYLE) and ScrollBarKindMap[AScrollBarKind] <> 0; + end; + + function ScrollBarWidth(AScrollBarKind: TScrollBarKind): Integer; + const + ScrollBarWidthIndexMap: array[TScrollBarKind] of Integer = (SM_CYHSCROLL, SM_CXVSCROLL); + begin + Result := GetSystemMetrics(ScrollBarWidthIndexMap[AScrollBarKind]); + end; + +begin + case ScrollArea of + etsaLeft: + Result := MakeRect(0, 0, ScrollAreaWidth, Height); + etsaTop: + Result := MakeRect(0, 0, Width, ScrollAreaHeight); + etsaRight: + begin + Result := MakeRect(Width - ScrollAreaWidth, 0, Width, Height); + if HasScrollBar(sbkVert) then + Dec(Result.Left, ScrollBarWidth(sbkVert)); + end; + else //etsaBottom + begin + Result := MakeRect(0, Height - ScrollAreaHeight, Width, Height); + if HasScrollBar(sbkHorz) then + Dec(Result.Top, ScrollBarWidth(sbkHorz)); + end; + end; +end; + +procedure TdxPSExplorerTreeView.SetFlat(Value: Boolean); +begin + if FFlat <> Value then + begin + FFlat := Value; + RecreateWnd; + end; +end; + +procedure TdxPSExplorerTreeView.OnExpandTimer(Sender: TObject); +begin + FExpandTimer.Enabled := False; + + if DropTarget = FSavedDropTarget then + begin + ImageList_DragShowNolock(False); + try + DropTarget.Expand(False); + finally + Update; + ImageList_DragShowNolock(True); + end; + end; +end; + +procedure TdxPSExplorerTreeView.OnScrollTimer(Sender: TObject); + + procedure DoScroll(AMessage: Cardinal; AScrollCode: Integer); + begin + Perform(AMessage, AScrollCode, 0); + end; + +const + ScrollMessages: array[TdxPSExplorerTreeViewScrollArea] of Cardinal = (WM_HSCROLL, WM_VSCROLL, WM_HSCROLL, WM_VSCROLL); + ScrollCodes: array[TdxPSExplorerTreeViewScrollArea] of Integer = (SB_LINELEFT, SB_LINEUP, SB_LINERIGHT, SB_LINEDOWN); + +var + ScrollActiveAreas: TdxPSExplorerTreeViewScrollAreas; + ScrollArea: TdxPSExplorerTreeViewScrollArea; +begin + ScrollActiveAreas := Self.ScrollActiveAreas * FSavedScrollActiveAreas; + if ScrollActiveAreas <> [] then + begin + ImageList_DragShowNolock(False); + try + for ScrollArea := Low(ScrollArea) to High(ScrollArea) do + if ScrollArea in ScrollActiveAreas then + DoScroll(ScrollMessages[ScrollArea], ScrollCodes[ScrollArea]); + finally + Update; + ImageList_DragShowNolock(True); + end; + end; + FSavedScrollActiveAreas := Self.ScrollActiveAreas; +end; + +{$IFDEF WMCONTEXTMENU} +procedure TdxPSExplorerTreeView.WMContextMenu(var Message: TWMContextMenu); +var + KeyState: TKeyboardState; +begin + inherited; + GetKeyboardState(KeyState); + MouseUp(mbRight, KeyboardStateToShiftState(KeyState), Message.Pos.X, Message.Pos.Y); +end; +{$ENDIF} + +procedure TdxPSExplorerTreeView.WMNCPaint(var Message: TWMNCPaint); +begin + inherited; + if Flat then DrawFlatEdge; +end; + +procedure TdxPSExplorerTreeView.CMHintShow(var Message: TCMHintShow); + + function HasInfoTip: Boolean; + var + Node: TTreeNode; + begin + Result := dxPSGlbl.CanShowHints; + if Result then + begin + with Message.HintInfo^.CursorPos do + Node := GetNodeAt(X, Y); + Result := (Node <> nil) and (GetInfoTip(Node.ItemId) <> ''); + end; + end; + +var + Node: TTreeNode; +begin + if HasInfoTip then + begin + with Message.HintInfo^ do + begin + Node := GetNodeAt(CursorPos.X, CursorPos.Y); + + CursorRect := Node.DisplayRect(True); + Windows.MapWindowPoints(Handle, 0, CursorRect, 2); + HintStr := GetInfoTip(Node.ItemId); + HintPos.Y := CursorRect.Top + Windows.GetSystemMetrics(SM_CYCURSOR); + HintPos.X := CursorRect.Left + Windows.GetSystemMetrics(SM_CXCURSOR); + HintMaxWidth := ClientWidth; + end; + Message.Result := 0; + end + else + inherited; +end; + +{ TdxPSExplorerTreeViewContainer } + +class function TdxPSExplorerTreeViewContainer.TreeViewClass: TCustomTreeViewClass; +begin + Result := TdxPSExplorerTreeView; +end; + +procedure TdxPSExplorerTreeViewContainer.InitializeTreeContainer; +begin + inherited; + TreeView.Container := Self; + TreeView.Flat := Host.Flat; + TreeView.OnCancelEdit := TreeCancelEdit; +end; + +function TdxPSExplorerTreeViewContainer.GetTreeView: TdxPSExplorerTreeView; +begin + Result := TdxPSExplorerTreeView(inherited TreeView) +end; + +initialization + TCustomdxPSExplorerTreeViewContainer.Register; + TdxPSExplorerTreeViewContainer.Register; + +finalization + TdxPSExplorerTreeViewContainer.Unregister; + TCustomdxPSExplorerTreeViewContainer.Unregister; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxCheckListBoxLnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPScxCheckListBoxLnk.dfm new file mode 100644 index 00000000..8779f266 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxCheckListBoxLnk.dfm @@ -0,0 +1,558 @@ +object cxfmCheckListBoxDesignWindow: TcxfmCheckListBoxDesignWindow + Left = 393 + Top = 324 + BorderStyle = bsDialog + Caption = 'cxfmCheckListBoxDesignWindow' + ClientHeight = 243 + ClientWidth = 553 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 3 + Width = 545 + Height = 204 + ActivePage = tshColor + MultiLine = True + TabOrder = 0 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = '&Options' + object pnlOptions: TPanel + Left = 0 + Top = 0 + Width = 537 + Height = 176 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblShow: TLabel + Left = 6 + Top = 13 + Width = 26 + Height = 13 + Caption = 'Show' + end + object Bevel11: TBevel + Left = 41 + Top = 17 + Width = 207 + Height = 4 + Shape = bsBottomLine + end + object lblMiscellaneous: TLabel + Left = 6 + Top = 82 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + end + object Bevel4: TBevel + Left = 79 + Top = 86 + Width = 170 + Height = 4 + Shape = bsBottomLine + end + object Image5: TImage + Left = 10 + Top = 107 + Width = 32 + Height = 32 + Picture.Data = { + 055449636F6E0000010003001010000000000000680500003600000020200000 + 00000000A80800009E0500003030000000000000A80E0000460E000028000000 + 1000000020000000010008000000000040010000000000000000000000010000 + 00000000FFFFFF00000080000080800080800000C0C0C000C0DCC000F0CAA600 + 4080800040400000FF800000804000000040800080FFFF00FFFF8000FF808000 + 4080FF0081818100000081000081810081810000000033000000660000009900 + 0000CC0000333300003366000033FF000066CC000066FF000099FF0000CCCC00 + 3300330033006600330099003300CC0033330000333333003333660033339900 + 3333CC003333FF00336666003366990074CAFF003366FF003399000033993300 + 33996600339999003399CC003399FF0033CC330033CC990033CCCC0033CCFF00 + 33FFFF0066000000663300006633330066336600663399006633FF0066660000 + 6666330066666600666699006666CC0066990000669933006699660066999900 + 6699CC006699FF0066CC330066CC990066CCCC004CCEFF0066FF330066FFCC00 + 999900009933990099333300996600009966330099336600996699009966CC00 + 9999330099996600999999009999CC009999FF0099CC000099CC330066CC6600 + 99CC990099CCCC0099CCFF0099CC660099FF990099FFFF00CC009900CC333300 + CC336600CC339900CC660000CC66330099666600CC669900CC66CC00CC990000 + CC993300CC996600CC999900CC99CC00CC99FF00CCCC0000CCCC3300CCCC6600 + CCCC9900CCCCCC00CCCCFF00CCFF0000CCFF330099FF6600CCFF9900CCFFCC00 + CCFFFF00FF333300FF336600FF660000FF663300CC666600FF669900FF66CC00 + FF990000FF993300FF996600FF999900FF99CC00FF99FF00FFCC0000FFCC3300 + FFCC6600FFCC9900FFCCCC00FFCCFF00FFFF3300FFFF9900FFFFCC006666FF00 + 66FFFF00FFFF6600C1C1C1005F5F5F00777777008686860096969600CBCBCB00 + B2B2B200D7D7D700DDDDDD00E3E3E300EAEAEA00F1F1F100F8F8F800F0FBFF00 + A4A0A000808080000000FF0000FF0000FF00FF00FFFF00007AE9FF007D780000 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 00000000FFFFFFFFFFFFFFFF9B40FFFFFFFFFFFFFFFFFFFF9B9AFFFF4747FFFF + 9C40FFFFFF242424A7309A6B36369A9C3607FFFFFF789C9C4B36313636363636 + 36FFFFFFFFA2A09A9A4736364B290736079A9AFFFFA2A04B363636614B022936 + 363636FFFFA2A0A0613536644B02293624FFFFFFFFA2409F463636644B022936 + 0724FFFFFFA2409F0061780C4B02294636FFFFFFFFA2404040A078640C4B2924 + FFFFFFFFFFA2A0A0A0A09F9F4A789B24FFFFFFFFFFA2409F00A0787878789B24 + FFFFFFFFFFA2409F00A09F9F9F789B24FFFFFFFFFFA2404040A0787878789B24 + FFFFFFFFFFA2A0A0A0A0A0A0A0A09B24FFFFFFFFFFA2A2A2A2A2A2A2A2A2A29A + FFFFFFFFFF3FFFFFF333FFFF8003FFFF8007FFFF8001FFFF8001FFFF8007FFFF + 8003FFFF8007FFFF800FFFFF800FFFFF800FFFFF800FFFFF800FFFFF800FFFFF + 800FFFFF28000000200000004000000001000800000000008004000000000000 + 000000000001000000000000FFFFFF00000080000080800080800000C0C0C000 + C0DCC000F0CAA6004080800040400000FF800000804000000040800080FFFF00 + FFFF8000FF8080004080FF008181810000008100008181008181000000003300 + 00006600000099000000CC0000333300003366000033FF000066CC000066FF00 + 0099FF0000CCCC003300330033006600330099003300CC003333000033333300 + 33336600333399003333CC003333FF00336666003366990074CAFF003366FF00 + 339900003399330033996600339999003399CC003399FF0033CC330033CC9900 + 33CCCC0033CCFF0033FFFF006600000066330000663333006633660066339900 + 6633FF00666600006666330066666600666699006666CC006699000066993300 + 66996600669999006699CC006699FF0066CC330066CC990066CCCC004CCEFF00 + 66FF330066FFCC00999900009933990099333300996600009966330099336600 + 996699009966CC009999330099996600999999009999CC009999FF0099CC0000 + 99CC330066CC660099CC990099CCCC0099CCFF0099CC660099FF990099FFFF00 + CC009900CC333300CC336600CC339900CC660000CC66330099666600CC669900 + CC66CC00CC990000CC993300CC996600CC999900CC99CC00CC99FF00CCCC0000 + CCCC3300CCCC6600CCCC9900CCCCCC00CCCCFF00CCFF0000CCFF330099FF6600 + CCFF9900CCFFCC00CCFFFF00FF333300FF336600FF660000FF663300CC666600 + FF669900FF66CC00FF990000FF993300FF996600FF999900FF99CC00FF99FF00 + FFCC0000FFCC3300FFCC6600FFCC9900FFCCCC00FFCCFF00FFFF3300FFFF9900 + FFFFCC006666FF0066FFFF00FFFF6600C1C1C1005F5F5F007777770086868600 + 96969600CBCBCB00B2B2B200D7D7D700DDDDDD00E3E3E300EAEAEA00F1F1F100 + F8F8F800F0FBFF00A4A0A000808080000000FF0000FF0000FF00FF00FFFF0000 + 7AE9FF007D7800007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F0000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF409C40 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9B9AFFFFFF9B469B + FFFFFF9B4040FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D9B9A9AFFFF473647 + FFFF9B9D9B9A9AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D079A409A9B473647 + 9A9A9BA707079AFFFFFFFFFFFFFFFFFFFFFF24242424244B363107409B343647 + 9A404631353646FFFFFFFFFFFFFFFFFFFFFF789C9C9C9C4B3636363636363636 + 3636363635FFFFFFFFFFFFFFFFFFFFFFFFFFA1A09C409A9A4736363661616161 + 4C363635409A9AFFFFFFFFFFFFFFFFFFFFFFA1A040409A404636364C4B460229 + 4C363635409A9A9AFFFFFFFFFFFFFFFFFFFFA1A04C47303031364C644C4B3002 + 074C363636363635FFFFFFFFFFFFFFFFFFFFA1A0A061363636364C644C4B3002 + 29313636074747FFFFFFFFFFFFFFFFFFFFFFA140A1A3A007303636644C4B3002 + 2936362924FFFFFFFFFFFFFFFFFFFFFFFFFFA1409FA20430353636644C4B3002 + 293636302924FFFFFFFFFFFFFFFFFFFFFFFFA1409F00A261364C60644C4B3002 + 294C35363607FFFFFFFFFFFFFFFFFFFFFFFFA1409F0000A16104A0644C4B3002 + 299A476135FFFFFFFFFFFFFFFFFFFFFFFFFFA1404040404004A0A06461644B30 + 079A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0A0A0A0A0A078640C644B + 469A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0A0A0A0A0A078A04A4A4A + A09A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA140A1A2A1A1A2A0A07878787878 + 789A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1409F04A700A2A0A09F9F9F9F9F + 789A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1409FA7009DA2A0A07878787878 + 789A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1409FA0A0A0A2A0A09F9F9F9F9F + 789A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA140404040409CA0A07878787878 + 789A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0A0A0A0A0A0A0A0A0A0A0 + A09A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA2A2A2A2A2A2A2A2A2A2A2A2A2A2 + A2A19AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8FFFFFF38E3F + FFE18C1FFFE0001FFC00001FFC00007FFC00001FFC00000FFC00000FFC00001F + FC00007FFC00003FFC00003FFC00007FFC0001FFFC0001FFFC0001FFFC0001FF + FC0001FFFC0001FFFC0001FFFC0001FFFC0001FFFC0001FFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFF2800000030000000600000000100080000000000 + 800A000000000000000000000001000000000000FFFFFF000000800000808000 + 80800000C0C0C000C0DCC000F0CAA6004080800040400000FF80000080400000 + 0040800080FFFF00FFFF8000FF8080004080FF00818181000000810000818100 + 818100000000330000006600000099000000CC0000333300003366000033FF00 + 0066CC000066FF000099FF0000CCCC003300330033006600330099003300CC00 + 333300003333330033336600333399003333CC003333FF003366660033669900 + 74CAFF003366FF00339900003399330033996600339999003399CC003399FF00 + 33CC330033CC990033CCCC0033CCFF0033FFFF00660000006633000066333300 + 66336600663399006633FF00666600006666330066666600666699006666CC00 + 669900006699330066996600669999006699CC006699FF0066CC330066CC9900 + 66CCCC004CCEFF0066FF330066FFCC0099990000993399009933330099660000 + 9966330099336600996699009966CC009999330099996600999999009999CC00 + 9999FF0099CC000099CC330066CC660099CC990099CCCC0099CCFF0099CC6600 + 99FF990099FFFF00CC009900CC333300CC336600CC339900CC660000CC663300 + 99666600CC669900CC66CC00CC990000CC993300CC996600CC999900CC99CC00 + CC99FF00CCCC0000CCCC3300CCCC6600CCCC9900CCCCCC00CCCCFF00CCFF0000 + CCFF330099FF6600CCFF9900CCFFCC00CCFFFF00FF333300FF336600FF660000 + FF663300CC666600FF669900FF66CC00FF990000FF993300FF996600FF999900 + FF99CC00FF99FF00FFCC0000FFCC3300FFCC6600FFCC9900FFCCCC00FFCCFF00 + FFFF3300FFFF9900FFFFCC006666FF0066FFFF00FFFF6600C1C1C1005F5F5F00 + 777777008686860096969600CBCBCB00B2B2B200D7D7D700DDDDDD00E3E3E300 + EAEAEA00F1F1F100F8F8F800F0FBFF00A4A0A000808080000000FF0000FF0000 + FF00FF00FFFF00007AE9FF007D7800007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F0000000000FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF409B9B + 40FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFF9B9B9B9BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9C9B9AFFFFFFFF9B4646 + 9BFFFFFFFF9B4040FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFA79D9B9A9AFFFFFF47363647FFFFFF9B9D9B409AFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA79D079A9A9A409B473636 + 479A9A9B9D9D07079AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF24 + 2424242424A73636309A9A409B463636479A9A9B9D46353607FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF789C9C9C9C9C4B36363631400746353636 + 479A9A073536363546FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0A0A0A79D9D4C36363636363636363636363636363635FFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A09C409A9A9A473636363661616161 + 614C36363635409A9A9AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0789B409A9A9A46363636614C460202294C363636359A9A9A9A9AFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A047463030303136364C614B4B3030 + 02074C3636363030303030FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0A04C4C3636363636364C644C4B30300229313636363636363636FFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0616161616136364C0C4C4B3030 + 02293636363607474747FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A09BA3A3A3A00730363636974C4B303002293636362924FFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A09B9FA2A2040707363636974C4B3030 + 0229363636302424FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A09B9F000078303636364C0C4C4B303002294C4C36360724FFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A09B9F0000A24C364C60780C4C4B3030 + 02299B4736363607FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A09B9F000000A16178A0780C4C4B303002299B24476135FFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A09B9B9B9B9B9B04A0A078644C64604B + 30299B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0A0A0A0A0A0A0A0A0A078647F0C4C4E4B079B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0A0A0A0A0A0A0A07805640C0C4B + 4B469B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0A0A0A0A0A0A0A0A0A07878784A4A4A4A789B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A040A2A2A2A2A2A2A0A0787878787878 + 78789B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0409F009D00A1A2A0A078787878787878789B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0409F9D789DA1A2A0A09F9F9F9F9F9F + 9F789B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0409F00009DA1A2A0A078787878787878789B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0409FA0A0A0A0A2A0A09F9F9F9F9F9F + 9F789B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A04040404040409CA0A078787878787878789B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0A0A0A0A0A0A0A0787878787878 + 78789B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A09B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2 + A2A2A29AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF87FFFFFFFFFFFFFF87FFFFFFFFFFFFC787 + 8FFFFFFFFFFF838707FFFFFFFFFF800007FFFFFFFFE0000007FFFFFFFFE00000 + 07FFFFFFFFE000001FFFFFFFFFE0000003FFFFFFFFE0000001FFFFFFFFE00000 + 01FFFFFFFFE0000001FFFFFFFFE0000003FFFFFFFFE000001FFFFFFFFFE00000 + 0FFFFFFFFFE000000FFFFFFFFFE000000FFFFFFFFFE000001FFFFFFFFFE00000 + FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000 + FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000 + FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + end + object imgGrid: TImage + Left = 10 + Top = 33 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object chbxShowBorders: TCheckBox + Left = 95 + Top = 30 + Width = 147 + Height = 17 + Caption = 'Border' + TabOrder = 0 + OnClick = chbxOptionsClick + end + object chbxShowHorzLines: TCheckBox + Tag = 1 + Left = 95 + Top = 52 + Width = 147 + Height = 17 + Caption = 'Horizontal Lines' + TabOrder = 1 + OnClick = chbxOptionsClick + end + object chbxFlatCheckMarks: TCheckBox + Tag = 2 + Left = 95 + Top = 104 + Width = 147 + Height = 17 + Caption = 'Flat Check &Marks' + TabOrder = 2 + OnClick = chbxOptionsClick + end + object chbxRowAutoHeight: TCheckBox + Left = 95 + Top = 150 + Width = 147 + Height = 17 + Caption = '&Row Auto Height' + TabOrder = 4 + OnClick = chbxRowAutoHeightClick + end + object lblPreview: TStaticText + Left = 258 + Top = 2 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 5 + end + object chbxAutoWidth: TCheckBox + Left = 95 + Top = 127 + Width = 147 + Height = 17 + Caption = 'AutoWidth' + TabOrder = 3 + OnClick = chbxAutoWidthClick + end + end + end + object tshColor: TTabSheet + Caption = '&Color' + object pnlColor: TPanel + Left = 0 + Top = 0 + Width = 537 + Height = 176 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblGridLinesColor: TLabel + Left = 14 + Top = 143 + Width = 81 + Height = 13 + Caption = 'Grid Lines Color: ' + end + object bvlLineColorHolder: TBevel + Left = 98 + Top = 140 + Width = 126 + Height = 21 + Visible = False + end + object lblDrawMode: TLabel + Left = 6 + Top = 18 + Width = 58 + Height = 13 + Caption = 'Draw &Mode:' + FocusControl = cbxDrawMode + end + object gbxTransparent: TGroupBox + Left = 6 + Top = 47 + Width = 230 + Height = 82 + Caption = ' ' + TabOrder = 2 + object lblColor: TLabel + Left = 9 + Top = 24 + Width = 35 + Height = 13 + Caption = 'Co&lor : ' + end + object bvlColorHolder: TBevel + Left = 92 + Top = 20 + Width = 126 + Height = 21 + Visible = False + end + object lblEvenColor: TLabel + Left = 9 + Top = 52 + Width = 59 + Height = 13 + Caption = 'E&ven Color: ' + end + object bvlEvenColorHolder: TBevel + Left = 92 + Top = 48 + Width = 126 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 19 + Top = 45 + Width = 15 + Height = 17 + TabOrder = 1 + OnClick = chbxTransparentClick + end + object cbxDrawMode: TComboBox + Left = 77 + Top = 13 + Width = 159 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 0 + OnClick = cbxDrawModeClick + OnDrawItem = cbxDrawModeDrawItem + Items.Strings = ( + 'Simpe' + 'Odd\Even Rows Mode' + 'Chess' + 'Borrow From Source') + end + object stTransparent: TStaticText + Left = 33 + Top = 46 + Width = 76 + Height = 17 + Caption = ' &Transparent ' + FocusControl = chbxTransparent + TabOrder = 3 + OnClick = stTransparentClick + end + end + end + object tshFont: TTabSheet + Caption = '&Font' + object pnlFont: TPanel + Left = 0 + Top = 0 + Width = 537 + Height = 176 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object btnFont: TButton + Left = 8 + Top = 11 + Width = 110 + Height = 23 + Caption = 'Fo&nt ...' + TabOrder = 0 + OnClick = btnFontClick + end + object edFont: TEdit + Left = 8 + Top = 39 + Width = 230 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + Text = 'edFont' + end + object btnEvenFont: TButton + Tag = 1 + Left = 9 + Top = 71 + Width = 110 + Height = 23 + Caption = 'E&ven Font ...' + TabOrder = 2 + OnClick = btnFontClick + end + object edEvenFont: TEdit + Left = 9 + Top = 100 + Width = 230 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 3 + Text = 'edFont' + end + end + end + end + object pnlPreview: TPanel + Left = 265 + Top = 46 + Width = 273 + Height = 150 + BevelOuter = bvLowered + BorderWidth = 1 + Color = clWindow + TabOrder = 1 + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxCheckListBoxLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxCheckListBoxLnk.pas new file mode 100644 index 00000000..f60ca942 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxCheckListBoxLnk.pas @@ -0,0 +1,790 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxCheckListBoxLnk; + +interface + +{$I cxVer.inc} + +uses + Classes, Windows, Messages, Controls, Graphics, StdCtrls, ExtCtrls, ComCtrls, + Dialogs, dxPSCore, dxPSForm, dxExtCtrls, dxPSBaseGridLnk, dxPSGrLnks, + cxCheckListBox, cxLookAndFeelPainters; + +type + TcxCheckListBoxReportLinkOption = (chlbxoBorder, chlbxoHorzLines, chlbxoFlatCheckMarks); + TcxCheckListBoxReportLinkOptions = set of TcxCheckListBoxReportLinkOption; + + TcxCustomCheckListBoxReportLink = class(TdxCustomListBoxReportLink) + private + FOptions: TcxCheckListBoxReportLinkOptions; + function GetcxCustomCheckListBox: TcxCustomCheckListBox; + procedure SetOptions(Value: TcxCheckListBoxReportLinkOptions); + + function IsFlatCheckMarks: Boolean; + protected + procedure AssignData(ACol, ARow: Integer; ADataItem: TAbstractdxReportCellData); override; + //function GetCellColor(ACol, ARow: Integer): TColor; override; + function GetCellFontIndex(ACol, ARow: Integer): Integer; override; + function GetDataItemClass(ACol: Integer; ARow: Integer = 0): TdxReportCellDataClass; override; + procedure InternalRestoreDefaults; override; + procedure InternalRestoreFromOriginal; override; + function IsDrawBorder: Boolean; override; + function IsDrawHorzLines: Boolean; override; + procedure SetDrawMode(Value: TdxGridDrawMode); override; + + function GetCustomListBox: TCustomListBox; override; + + property cxCustomCheckListBox: TcxCustomCheckListBox read GetcxCustomCheckListBox; + public + procedure Assign(Source: TPersistent); override; + property Options: TcxCheckListBoxReportLinkOptions read FOptions write SetOptions + default [chlbxoBorder..chlbxoFlatCheckMarks]; + end; + + TcxCheckListBoxReportLink = class(TcxCustomCheckListBoxReportLink) + private + function GetCheckListBox: TcxCheckListBox; + public + property CheckListBox: TcxCheckListBox read GetCheckListBox; + published + property AutoWidth; + property Color; + property EndEllipsis; + property EvenColor; + property EvenFont; + property Font; + property Multiline; + property OddColor; + property OddFont; + property Options; + property RowAutoHeight; + property ScaleFonts; + property SupportedCustomDraw; + property Transparent; + property UseCustomPageBreaks; + property UseHorzDelimiters; + property UseVertDelimiters; + property Width; + + property OnCustomDrawItem; + property OnGetCustomPageBreaks; + property OnInitializeItem; + end; + + TcxfmCheckListBoxDesignWindow = class(TStandarddxReportLinkDesignWindow) + PageControl1: TPageControl; + tshOptions: TTabSheet; + pnlOptions: TPanel; + lblShow: TLabel; + Bevel11: TBevel; + lblMiscellaneous: TLabel; + Bevel4: TBevel; + Image5: TImage; + imgGrid: TImage; + chbxShowBorders: TCheckBox; + chbxShowHorzLines: TCheckBox; + chbxFlatCheckMarks: TCheckBox; + chbxRowAutoHeight: TCheckBox; + tshColor: TTabSheet; + pnlColor: TPanel; + lblGridLinesColor: TLabel; + bvlLineColorHolder: TBevel; + gbxTransparent: TGroupBox; + lblColor: TLabel; + bvlColorHolder: TBevel; + lblEvenColor: TLabel; + bvlEvenColorHolder: TBevel; + chbxTransparent: TCheckBox; + tshFont: TTabSheet; + pnlFont: TPanel; + btnFont: TButton; + edFont: TEdit; + btnEvenFont: TButton; + edEvenFont: TEdit; + pnlPreview: TPanel; + lblDrawMode: TLabel; + cbxDrawMode: TComboBox; + lblPreview: TStaticText; + chbxAutoWidth: TCheckBox; + stTransparent: TStaticText; + procedure ccbxColorChange(Sender: TObject); + procedure pbxPreviewPaint(Sender: TObject); + procedure cbxDrawModeClick(Sender: TObject); + procedure chbxOptionsClick(Sender: TObject); + procedure chbxRowAutoHeightClick(Sender: TObject); + procedure chbxTransparentClick(Sender: TObject); + procedure btnFontClick(Sender: TObject); + procedure PageControl1Change(Sender: TObject); + procedure cbxDrawModeDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure chbxAutoWidthClick(Sender: TObject); + procedure stTransparentClick(Sender: TObject); + private + FccbxColor: TdxPSColorCombo; + FccbxEvenColor: TdxPSColorCombo; + FccbxGridLineColor: TdxPSColorCombo; + FItemCount: Integer; + FPaintWidth: Integer; + FPaintHeight: Integer; + FPreviewBox: TCustomPanel; + FRectWidth: Integer; + FRectHeight: Integer; + procedure CreateControls; + function GetReportLink: TcxCustomCheckListBoxReportLink; + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + protected + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + procedure LoadStrings; override; + procedure PaintPreview(ACanvas: TCanvas; R: TRect); override; + procedure UpdateControlsState; override; + procedure UpdatePreview; override; + public + constructor Create(AOwner: TComponent); override; + property ReportLink: TcxCustomCheckListBoxReportLink read GetReportLink; + end; + +const + cxDefaultCheckListBoxOptions = [chlbxoBorder, chlbxoHorzLines, chlbxoFlatCheckMarks]; + + cxCheckListBoxStrings: array[0..4] of string = + ('Sample Text Row #1', 'Sample Text Row #2', 'Sample Text Row #3', + 'Sample Text Row #4', 'Sample Text Row #5'); + +implementation + +{$R *.dfm} + +uses + SysUtils, Forms, cxClasses, cxLookAndFeels, cxCheckBox, dxPSRes, dxPSGlbl, + dxPSUtl, dxPrnDev, dxPScxEditorLnks; + +type + TcxCustomCheckListBoxAccess = class(TcxCustomCheckListBox); + +{ TdxCheckListBoxReportLink } + +procedure TcxCustomCheckListBoxReportLink.Assign(Source: TPersistent); +begin + if Source is TcxCustomCheckListBoxReportLink then + Options := TcxCustomCheckListBoxReportLink(Source).Options; + inherited; +end; + +procedure TcxCustomCheckListBoxReportLink.InternalRestoreDefaults; +begin + inherited; + Options := cxDefaultCheckListBoxOptions; +end; + +procedure TcxCustomCheckListBoxReportLink.InternalRestoreFromOriginal; +begin + inherited; + if TcxCustomCheckListBoxAccess(cxCustomCheckListBox).LookAndFeel.Kind = lfUltraFlat then + Options := Options + [chlbxoFlatCheckMarks] + else + Options := Options - [chlbxoFlatCheckMarks]; +end; + +function TcxCustomCheckListBoxReportLink.IsDrawBorder: Boolean; +begin + Result := chlbxoBorder in Options; +end; + +function TcxCustomCheckListBoxReportLink.IsDrawHorzLines: Boolean; +begin + Result := chlbxoHorzLines in Options; +end; + +procedure TcxCustomCheckListBoxReportLink.SetDrawMode(Value: TdxGridDrawMode); +begin + if Value > gdmOddEven then Value := gdmOddEven; + inherited; +end; + +function TcxCustomCheckListBoxReportLink.GetCustomListBox: TCustomListBox; +begin + if cxCustomCheckListBox <> nil then + Result := cxContainer_GetInnerControl(cxCustomCheckListBox) as TCustomListBox + else + Result := nil; +end; + +procedure TcxCustomCheckListBoxReportLink.AssignData(ACol, ARow: Integer; ADataItem: TAbstractdxReportCellData); +begin + inherited; + with TdxReportCellCheckImage(ADataItem) do + begin + CheckPos := ccpLeft; + Checked := TcxCustomCheckListBoxAccess(cxCustomCheckListBox).Items[ARow].State > cbsUnchecked; + Enabled := (TcxCustomCheckListBoxAccess(cxCustomCheckListBox).Items[ARow].State < cbsGrayed) and + TcxCustomCheckListBoxAccess(cxCustomCheckListBox).Items[ARow].Enabled; + FlatBorder := IsFlatCheckMarks; + Glyph := TcxCustomCheckListBoxAccess(cxCustomCheckListBox).Glyph; + end; +end; + +{function TcxCustomCheckListBoxReportLink.GetCellColor(ACol, ARow: Integer): TColor; +begin + if TcxCustomCheckListBoxAccess(CustomCheckListBox).Header[ARow] then + Result := TcxCustomCheckListBoxAccess(CustomCheckListBox).HeaderBackgroundColor + else + Result := inherited GetCellColor(ACol, ARow); +end; } + +function TcxCustomCheckListBoxReportLink.GetCellFontIndex(ACol, ARow: Integer): Integer; +begin + Result := inherited GetCellFontIndex(ACol, ARow); +end; + +function TcxCustomCheckListBoxReportLink.GetDataItemClass(ACol: Integer; ARow: Integer = 0): TdxReportCellDataClass; +begin + Result := TdxReportCellCheckImage; +end; + +function TcxCustomCheckListBoxReportLink.GetcxCustomCheckListBox: TcxCustomCheckListBox; +begin + Result := TcxCustomCheckListBox(Component); +end; + +procedure TcxCustomCheckListBoxReportLink.SetOptions(Value: TcxCheckListBoxReportLinkOptions); +begin + if FOptions <> Value then + begin + FOptions := Value; + LinkModified(True); + end; +end; + +function TcxCustomCheckListBoxReportLink.IsFlatCheckMarks: Boolean; +begin + Result := chlbxoFlatCheckMarks in Options; +end; + +{ TcxCheckListBoxReportLink } + +function TcxCheckListBoxReportLink.GetCheckListBox: TcxCheckListBox; +begin + Result := TcxCheckListBox(Component); +end; + +{ TcxfmCheckListBoxDesignWindow } + +constructor TcxfmCheckListBoxDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxhcCheckListBoxReportLinkDesigner; + inherited Create(AOwner); + CreateControls; + FItemCount := 5; + FRectWidth := FPreviewBox.Width - 15; + FRectHeight := (FPreviewBox.Height - 15) div FItemCount; + FPaintWidth := FRectWidth + 1; + FPaintHeight := FItemCount * (FRectHeight + 1); + PageControl1.ActivePage := PageControl1.Pages[0]; +end; + +procedure TcxfmCheckListBoxDesignWindow.CreateControls; + + function CreateColorCombo(AHost: TBevel; ATag: Integer; AnOnChange: TNotifyEvent; + ALabel: TLabel): TdxPSColorCombo; + begin + Result := TdxPSColorCombo.Create(Self); + with Result do + begin + BoundsRect := AHost.BoundsRect; + Tag := MakeTTag(ATag); + Parent := AHost.Parent; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := dxDefaultColor; + OnChange := AnOnChange + end; + ALabel.FocusControl := Result; + end; + + function CreatePreviewPane(AHost: TWinControl; AnOnPaint: TNotifyEvent): TdxPSPaintPanel; + var + R: TRect; + begin + Result := TdxPSPaintPanel.Create(Self); + with Result do + begin + Parent := AHost; + R := AHost.BoundsRect; + OffsetRect(R, -R.Left, -R.Top); + InflateRect(R, -1, -1); + BoundsRect := R; + EdgeInner := esNone; + EdgeOuter := esNone; + OnPaint := AnOnPaint + end; + end; + +begin + FccbxColor := CreateColorCombo(bvlColorHolder, 0, ccbxColorChange, lblColor); + FccbxEvenColor := CreateColorCombo(bvlEvenColorHolder, 1, ccbxColorChange, lblEvenColor); + FccbxGridLineColor := CreateColorCombo(bvlLineColorHolder, 2, ccbxColorChange, lblGridLinesColor); + + FPreviewBox := CreatePreviewPane(pnlPreview, pbxPreviewPaint); +end; + +procedure TcxfmCheckListBoxDesignWindow.DoInitialize; +begin + inherited; + + with cbxDrawMode do + ItemIndex := Items.IndexOfObject(TObject(ReportLink.DrawMode)); + chbxShowBorders.Checked := chlbxoBorder in ReportLink.Options; + chbxShowHorzLines.Checked := chlbxoHorzLines in ReportLink.Options; + chbxFlatCheckMarks.Checked := chlbxoFlatCheckMarks in ReportLink.Options; + chbxAutoWidth.Checked := ReportLink.AutoWidth; + chbxRowAutoHeight.Checked := ReportLink.RowAutoHeight; + + chbxTransparent.Checked := ReportLink.Transparent; + TdxPSColorCombo(FccbxColor).ColorValue := ReportLink.Color; + TdxPSColorCombo(FccbxEvenColor).ColorValue := ReportLink.EvenColor; + TdxPSColorCombo(FccbxGridLineColor).ColorValue := ReportLink.GridLineColor; + + FontInfoToText(ReportLink.Font, edFont); + FontInfoToText(ReportLink.EvenFont, edEvenFont); +end; + +{$IFDEF DELPHI7} +function TcxfmCheckListBoxDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +procedure TcxfmCheckListBoxDesignWindow.LoadStrings; +begin + inherited; + tshOptions.Caption := cxGetResourceString(@sdxOptions); + tshFont.Caption := cxGetResourceString(@sdxFonts); + tshColor.Caption := cxGetResourceString(@sdxColors); + lblPreview.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + lblShow.Caption := cxGetResourceString(@sdxShow); + chbxShowBorders.Caption := cxGetResourceString(@sdxBorderLines); + chbxShowHorzLines.Caption := cxGetResourceString(@sdxHorzLines); + + lblMiscellaneous.Caption := cxGetResourceString(@sdxMiscellaneous); + chbxFlatCheckMarks.Caption := cxGetResourceString(@sdxFlatCheckMarks); + chbxAutoWidth.Caption := cxGetResourceSTring(@sdxAutoWidth); + chbxRowAutoHeight.Caption := cxGetResourceString(@sdxRowAutoHeight); + + lblDrawMode.Caption := cxGetResourceString(@sdxDrawMode); + + with cbxDrawMode.Items do + begin + BeginUpdate; + try + Clear; + AddObject(cxGetResourceString(@sdxDrawModeStrict), TObject(gdmStrict)); + AddObject(cxGetResourceString(@sdxDrawModeOddEven), TObject(gdmOddEven)); + finally + EndUpdate; + end; + end; + + stTransparent.Caption := ' ' + cxGetResourceString(@sdxTransparent) + ' '; + lblColor.Caption := cxGetResourceString(@sdxColor); + lblEvenColor.Caption := cxGetResourceString(@sdxEvenColor); + lblGridLinesColor.Caption := cxGetResourceString(@sdxGridLinesColor); + + btnFont.Caption := cxGetResourceString(@sdxBtnFont); + btnEvenFont.Caption := cxGetResourceString(@sdxBtnEvenFont); +end; + +procedure TcxfmCheckListBoxDesignWindow.UpdateControlsState; +begin + inherited UpdateControlsState; + FccbxColor.Enabled := not chbxTransparent.Checked; + lblColor.Enabled := FccbxColor.Enabled; + FccbxEvenColor.Enabled := not chbxTransparent.Checked and + (ReportLink.DrawMode in [gdmOddEven, gdmChess]); + lblEvenColor.Enabled := FccbxEvenColor.Enabled; + + btnEvenFont.Enabled := ReportLink.DrawMode in [gdmOddEven, gdmChess]; + if ReportLink.DrawMode in [gdmOddEven, gdmChess] then + begin + lblColor.Caption := cxGetResourceString(@sdxOddColor); + btnFont.Caption := cxGetResourceString(@sdxBtnOddFont); + end + else + begin + lblColor.Caption := cxGetResourceString(@sdxColor); + btnFont.Caption := cxGetResourceString(@sdxBtnFont); + end; +end; + +procedure TcxfmCheckListBoxDesignWindow.UpdatePreview; +begin + FPreviewBox.Invalidate; +end; + +procedure TcxfmCheckListBoxDesignWindow.PaintPreview(ACanvas: TCanvas; R: TRect); +const + RowCount = 5; +type + TdxCheckRowViewInfo = record + State: TCheckBoxState; + Text: string; + Color: TColor; + Font: TFont; + Sides: TdxCellSides; + Rect: TRect; + BackgroundRect: TRect; + CheckRect: TRect; + TextRect: TRect; + end; + TdxCheckRowViewInfos = array of TdxCheckRowViewInfo; + + procedure CalculateViewInfos(out AViewInfos: TdxCheckRowViewInfos); + + procedure CalculateViewInfo(AnIndex: Integer; var AViewInfo: TdxCheckRowViewInfo); + const + States: array[0..RowCount - 1] of TCheckBoxState = (cbUnchecked, cbChecked, cbGrayed, cbUnchecked, cbChecked); + var + V: Integer; + begin + with AViewInfo do + begin + State := States[AnIndex]; + Text := cxCheckListBoxStrings[AnIndex]; + Color := ReportLink.GetCellColor(0, AnIndex); + + Font := TFont.Create; + Font.Assign(ReportLink.GetCellFont(0, AnIndex)); + Font.Size := 8; + + Sides := csAll; + if not ReportLink.IsDrawBorder then + begin + Sides := Sides - csLeftRight; + if AnIndex = 0 then Exclude(Sides, csTop); + if AnIndex > RowCount - 1 then Exclude(Sides, csBottom); + end; + if not ReportLink.IsDrawHorzLines then + begin + if AnIndex > 0 then Exclude(Sides, csTop); + if AnIndex > RowCount - 1 then Exclude(Sides, csBottom); + end; + + Rect := R; + InflateRect(Rect, -4, -4); + V := (Rect.Bottom - R.Top) div RowCount; + Inc(Rect.Top, (V - 1) * AnIndex); + if AnIndex <> RowCount - 1 then + Rect.Bottom := Rect.Top + V; + + BackgroundRect := Rect; + InflateRect(BackgroundRect, -1, -1); + + CheckRect := BackgroundRect; + InflateRect(CheckRect, 0, -(CheckRect.Bottom - CheckRect.Top - dxPSGlbl.CheckHeight) div 2); + Inc(CheckRect.Left, 2); + CheckRect.Right := CheckRect.Left + dxPSGlbl.CheckWidth; + + TextRect := BackgroundRect; + ACanvas.Font := Font; + V := ACanvas.TextHeight('Wq'); + InflateRect(TextRect, 0, -(TextRect.Bottom - TextRect.Top - V) div 2); + TextRect.Left := CheckRect.Right + 4; + end; + end; + + var + I: Integer; + begin + SetLength(AViewInfos, RowCount); + for I := 0 to RowCount - 1 do + CalculateViewInfo(I, AViewInfos[I]); + end; + + procedure DrawCheckRows(const AViewInfos: TdxCheckRowViewInfos); + + procedure DrawCheckRow(const AViewInfo: TdxCheckRowViewInfo); + + function GetSideRect(ASide: TdxCellSide): TRect; + begin + Result := AViewInfo.Rect; + with Result do + case ASide of + csLeft: + Right := Left + 1; + csTop: + Bottom := Top + 1; + csRight: + Left := Right - 1; + csBottom: + Top := Bottom - 1; + end; + end; + + procedure DrawSides; + var + Side: TdxCellSide; + begin + ACanvas.Brush.Style := bsSolid; + ACanvas.Brush.Color := ReportLink.GridLineColor; + + for Side := csLeft to csBottom do + if Side in AViewInfo.Sides then + ACanvas.FillRect(GetSideRect(Side)); + end; + + procedure DrawBackground; + begin + ACanvas.Brush.Style := bsSolid; + ACanvas.Brush.Color := AViewInfo.Color; + ACanvas.FillRect(AViewInfo.BackgroundRect); + end; + + procedure DrawCheck; + const + CheckStateMap: array[TCheckBoxState] of UINT = + (DFCS_BUTTONCHECK, DFCS_BUTTONCHECK or DFCS_CHECKED, DFCS_BUTTON3STATE or DFCS_CHECKED); + FlatBorderMap: array[Boolean] of UINT = (0, DFCS_FLAT); + var + uState: UINT; + begin + uState := DFCS_TRANSPARENT or CheckStateMap[AViewInfo.State] or FlatBorderMap[ReportLink.IsFlatCheckMarks]; + DrawFrameControl(ACanvas.Handle, AViewInfo.CheckRect, DFC_BUTTON, uState); + end; + + procedure DrawText; + var + R: TRect; + begin + ACanvas.Brush.Style := bsClear; + ACanvas.Font := AViewInfo.Font; + R := AViewInfo.TextRect; + ACanvas.TextRect(R, R.Left, R.Top, AViewInfo.Text); + end; + + begin + DrawSides; + if not ReportLink.Transparent then DrawBackground; + DrawCheck; + DrawText; + end; + + var + I: Integer; + begin + for I := 0 to RowCount - 1 do + DrawCheckRow(AViewInfos[I]); + end; + + procedure FreeViewInfos(var AViewInfos: TdxCheckRowViewInfos); + + procedure FreeViewInfo(var AViewInfo: TdxCheckRowViewInfo); + begin + FreeAndNil(AViewInfo.Font); + end; + + var + I: Integer; + begin + for I := 0 to RowCount - 1 do + FreeViewInfo(AViewInfos[I]); + SetLength(AViewInfos, 0); + end; + +var + ViewInfos: TdxCheckRowViewInfos; +begin + inherited; + ACanvas.Brush.Color := clWindow; + + CalculateViewInfos(ViewInfos); + try + DrawCheckRows(ViewInfos); + finally + FreeViewInfos(ViewInfos); + end; +end; + +procedure TcxfmCheckListBoxDesignWindow.ccbxColorChange(Sender: TObject); +var + Color: TColor; +begin + if LockControlsUpdate then Exit; + + Color := TdxPSColorCombo(Sender).ColorValue; + case TTagToInt(TdxPSColorCombo(Sender).Tag) of + 0: ReportLink.Color := Color; + 1: ReportLink.EvenColor := Color; + 2: ReportLink.GridLineColor := Color; + end; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmCheckListBoxDesignWindow.pbxPreviewPaint(Sender: TObject); +begin + with TdxPSPaintPanel(Sender) do PaintPreview(Canvas, ClientRect); +end; + +procedure TcxfmCheckListBoxDesignWindow.cbxDrawModeClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + + with TComboBox(Sender) do + ReportLink.DrawMode := TdxGridDrawMode(Items.Objects[ItemIndex]); + Modified := True; + UpdatePreview; +end; + +procedure TcxfmCheckListBoxDesignWindow.cbxDrawModeDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +begin + dxPSBaseGridLnk.dxPSDrawComboDrawModeItem(Control, Index, Rect, State); +end; + +procedure TcxfmCheckListBoxDesignWindow.chbxOptionsClick(Sender: TObject); +var + Option: TcxCheckListBoxReportLinkOption; +begin + if LockControlsUpdate then Exit; + + Option := TcxCheckListBoxReportLinkOption(TTagToInt(TCheckBox(Sender).Tag)); + + with ReportLink do + if TCheckBox(Sender).Checked then + Options := Options + [Option] + else + Options := Options - [Option]; + + Modified := True; + UpdatePreview; +end; + +procedure TcxfmCheckListBoxDesignWindow.chbxAutoWidthClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.AutoWidth := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TcxfmCheckListBoxDesignWindow.chbxRowAutoHeightClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.RowAutoHeight := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmCheckListBoxDesignWindow.chbxTransparentClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.Transparent := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmCheckListBoxDesignWindow.stTransparentClick(Sender: TObject); +begin + if chbxTransparent.CanFocus then ActiveControl := chbxTransparent; + chbxTransparent.Checked := not chbxTransparent.Checked; +end; + +procedure TcxfmCheckListBoxDesignWindow.btnFontClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with dxPSGlbl.FontDialog do + begin + case TTagToInt(TComponent(Sender).Tag) of + 0: Font := ReportLink.Font; + 1: Font := ReportLink.EvenFont; + end; + + if Execute then + begin + case TTagToInt(TComponent(Sender).Tag) of + 0: + begin + ReportLink.Font := Font; + FontInfoToText(ReportLink.Font, edFont); + end; + 1: + begin + ReportLink.EvenFont := Font; + FontInfoToText(ReportLink.EvenFont, edEvenFont); + end; + end; + Modified := True; + UpdatePreview; + end; + end; +end; + +function TcxfmCheckListBoxDesignWindow.GetReportLink: TcxCustomCheckListBoxReportLink; +begin + Result := inherited ReportLink as TcxCustomCheckListBoxReportLink; +end; + +procedure TcxfmCheckListBoxDesignWindow.CMDialogChar(var Message: TCMDialogChar); +var + I: Integer; +begin + with PageControl1 do + for I := 0 to PageControl1.PageCount - 1 do + if IsAccel(Message.CharCode, Pages[I].Caption) then + begin + Message.Result := 1; + ActivePage := Pages[I]; + Exit; + end; +end; + +procedure TcxfmCheckListBoxDesignWindow.PageControl1Change(Sender: TObject); +begin + lblPreview.Parent := TpageControl(Sender).ActivePage; +end; + +initialization + dxPSRegisterReportLink(TcxCheckListBoxReportLink, TcxCheckListBox, TcxfmCheckListBoxDesignWindow); + +finalization + dxPSUnregisterReportLink(TcxCheckListBoxReportLink, TcxCheckListBox, TcxfmCheckListBoxDesignWindow); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxCommon.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxCommon.pas new file mode 100644 index 00000000..acf055ef --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxCommon.pas @@ -0,0 +1,4682 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxCommon; + +{$I cxVer.inc} + +interface + +uses + Classes, Windows, Messages, Graphics, Controls, StdCtrls, ExtCtrls, ImgList, + Dialogs, ExtDlgs, cxClasses, cxControls, cxGraphics, cxLookAndFeels, cxStyles, + cxLookAndFeelPainters, cxEdit, cxTextEdit, cxMemo, cxCheckBox, cxRadioGroup, + cxBlobEdit, cxGroupBox, cxImage, cxImageComboBox, cxHyperLinkEdit, cxCurrencyEdit, + dxPSGlbl, dxBase, dxPSCore, dxPSRes; + +type + TdxCustomcxControlReportLink = class; + TdxCustomTableControlReportLink = class; + TdxfmCustomcxControlReportLinkDesignWindow = class; + + TdxReportItemViewParams = record + CellSides: TdxCellSides; + FontSize: Integer; + FontStyle: TFontStyles; + Transparent: Boolean; + NativeParams: TcxViewParams; + end; + + + IdxPSCellParams = interface + ['{F0A495A1-1F0F-4245-A437-16E21ACF9FED}'] + function GetAutoHeight: Boolean; + function GetDC: HDC; + function GetDisplayGraphicsAsText: Boolean; + function GetEndEllipsis: Boolean; + function GetFlatCheckMarks: Boolean; + function GetGraphicsText: string; + function GetMultiline: Boolean; + function GetTransparentGraphics: Boolean; + + property AutoHeight: Boolean read GetAutoHeight; + property DC: HDC read GetDC; + property DisplayGraphicsAsText: Boolean read GetDisplayGraphicsAsText; + property EndEllipsis: Boolean read GetEndEllipsis; + property FlatCheckMarks: Boolean read GetFlatCheckMarks; + property GraphicsText: string read GetGraphicsText; + property Multiline: Boolean read GetMultiline; + property TransparentGraphics: Boolean read GetTransparentGraphics; + end; + + IdxPSCellParams2 = interface + ['{09EAB051-1AC2-46FB-A7F4-D6BFA883D015}'] + function GetPreviewMarginLeft: Integer; + function GetPreviewMarginRight: Integer; + function GetPreviewMaxHeight: Integer; + function GetPreviewMaxLineCount: Integer; + function GetRichEditGraphicClass: TGraphicClass; + function GetRichEditTransparent: Boolean; + + property PreviewMarginLeft: Integer read GetPreviewMarginLeft; + property PreviewMarginRight: Integer read GetPreviewMarginRight; + property PreviewMaxHeight: Integer read GetPreviewMaxHeight; + property PreviewMaxLineCount: Integer read GetPreviewMaxLineCount; + property RichEditGraphicClass: TGraphicClass read GetRichEditGraphicClass; + property RichEditTransparent: Boolean read GetRichEditTransparent; + end; + + { Data Maps } + + TdxPSDataMapClass = class of TdxPSCustomDataMap; + + TdxPSDataMaps = class(TdxCustomClassMaps) + private + function GetMapClass(Properties: TcxCustomEditProperties): TdxPSDataMapClass; + public + class function Instance: TdxPSDataMaps; reintroduce; overload; + + function DoesItemParticipateInAutoHeightCalculation(AProperties: TcxCustomEditProperties): Boolean; + function DoesItemParticipateInAutoWidthCalculation(AProperties: TcxCustomEditProperties): Boolean; + function DoesItemParticipateInBestFitCalculation(AProperties: TcxCustomEditProperties): Boolean; + procedure GetImageLists(AProperties: TcxCustomEditProperties; AProc: TdxPSGetImageListProc); + procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); + function ItemClass(AProperties: TcxCustomEditProperties; AnIsPreview: Boolean = False): TdxReportCellDataClass; + function MeasureWidth(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; AFont: TFont; ARecordIndex: Integer = 0): Integer; + property MapClasses[Properties: TcxCustomEditProperties]: TdxPSDataMapClass read GetMapClass; default; + end; + + TdxPSCustomDataMap = class(TdxCustomClassMapItem) + protected + class function DoesItemParticipateInAutoHeightCalculation(AProperties: TcxCustomEditProperties): Boolean; virtual; + class function DoesItemParticipateInAutoWidthCalculation(AProperties: TcxCustomEditProperties): Boolean; virtual; + class function DoesItemParticipateInBestFitCalculation(AProperties: TcxCustomEditProperties): Boolean; virtual; + class procedure GetImageLists(AProperties: TcxCustomEditProperties; AProc: TdxPSGetImageListProc); virtual; + class function GetText(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue): string; virtual; + class function HasText(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue): Boolean; virtual; + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); virtual; + class function ItemClass(AProperties: TcxCustomEditProperties; AnIsPreview: Boolean = False): TdxReportCellDataClass; virtual; + class function MeasureWidth(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; AFont: TFont; ARecordIndex: Integer = 0): Integer; virtual; + class function PropertiesClass: TcxCustomEditPropertiesClass; virtual; + public + class function PairClass: TClass; override; + + class procedure Register; + class procedure Unregister; + end; + + TdxPSTextDataMap = class(TdxPSCustomDataMap) + protected + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); override; + class function ItemClass(AProperties: TcxCustomEditProperties; AnIsPreview: Boolean = False): TdxReportCellDataClass; override; + class function PropertiesClass: TcxCustomEditPropertiesClass; override; + end; + + TdxPSMemoDataMap = class(TdxPSTextDataMap) + protected + class function DoesItemParticipateInAutoWidthCalculation(AProperties: TcxCustomEditProperties): Boolean; override; + class function DoesItemParticipateInBestFitCalculation(AProperties: TcxCustomEditProperties): Boolean; override; + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); override; + class function PropertiesClass: TcxCustomEditPropertiesClass; override; + end; + + TdxPSHyperLinkDataMap = class(TdxPSTextDataMap) + protected + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); override; + class function PropertiesClass: TcxCustomEditPropertiesClass; override; + end; + + TdxPSCheckDataMap = class(TdxPSCustomDataMap) + protected + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); override; + class function ItemClass(AProperties: TcxCustomEditProperties; AnIsPreview: Boolean = False): TdxReportCellDataClass; override; + class function MeasureWidth(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; AFont: TFont; ARecordIndex: Integer = 0): Integer; override; + class function PropertiesClass: TcxCustomEditPropertiesClass; override; + end; + + TdxPSCustomButtonGroupDataMap = class(TdxPSCustomDataMap) + protected + class function ButtonGroupClass(AProperties: TcxCustomEditProperties): TdxCustomReportButtonGroupClass; virtual; + class procedure InitializeGroupButton(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; AButton: TdxCustomReportCellCheck; AnIndex: Integer); virtual; + + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); override; + class function ItemClass(AProperties: TcxCustomEditProperties; AnIsPreview: Boolean = False): TdxReportCellDataClass; override; + class function MeasureWidth(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; AFont: TFont; ARecordIndex: Integer = 0): Integer; override; + class function PropertiesClass: TcxCustomEditPropertiesClass; override; + end; + + TdxPSRadioButtonGroupDataMap = class(TdxPSCustomButtonGroupDataMap) + protected + class function ButtonGroupClass(AProperties: TcxCustomEditProperties): TdxCustomReportButtonGroupClass; override; + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); override; + + class function PropertiesClass: TcxCustomEditPropertiesClass; override; + end; + + TdxPSGraphicDataMap = class(TdxPSCustomDataMap) + protected + class function DoesItemParticipateInAutoHeightCalculation(AProperties: TcxCustomEditProperties): Boolean; override; + class function DefaultGraphicClass: TGraphicClass; virtual; + class function GetGraphic(AProperties: TcxCustomEditProperties; AGraphicClass: TGraphicClass; + const AValue: TcxEditValue): TGraphic; virtual; + class function GetGraphicClass(AProperties: TcxCustomEditProperties; ARecordIndex: Integer; AOwner: TObject = nil): TGraphicClass; virtual; + class function HasGraphic(const AValue: TcxEditValue): Boolean; virtual; + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); override; + class function ItemClass(AProperties: TcxCustomEditProperties; AnIsPreview: Boolean = False): TdxReportCellDataClass; override; + class function MeasureWidth(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; AFont: TFont; ARecordIndex: Integer = 0): Integer; override; + class function PropertiesClass: TcxCustomEditPropertiesClass; override; + end; + + TdxPSGraphicAsTextDataMap = class(TdxPSCustomDataMap) + protected + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); override; + class function ItemClass(AProperties: TcxCustomEditProperties; AnIsPreview: Boolean = False): TdxReportCellDataClass; override; + class function MeasureWidth(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; AFont: TFont; ARecordIndex: Integer = 0): Integer; override; + class function PropertiesClass: TcxCustomEditPropertiesClass; override; + end; + + TdxPSImageDataMap = class(TdxPSTextDataMap) + protected + class function DoesItemParticipateInBestFitCalculation(AProperties: TcxCustomEditProperties): Boolean; override; + class function GetComboBoxItem(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue): TcxImageComboBoxItem; virtual; + class function GetImageIndex(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue): Integer; virtual; + class procedure GetImageLists(AProperties: TcxCustomEditProperties; AProc: TdxPSGetImageListProc); override; + class function GetImages(AProperties: TcxCustomEditProperties): TCustomImageList; virtual; + class function GetText(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue): string; override; + class function HasImages(AProperties: TcxCustomEditProperties): Boolean; virtual; + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); override; + class function IsMultilinedText(AProperties: TcxCustomEditProperties): Boolean; virtual; + class function ItemClass(AProperties: TcxCustomEditProperties; AnIsPreview: Boolean = False): TdxReportCellDataClass; override; + class function MeasureWidth(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; AFont: TFont; ARecordIndex: Integer = 0): Integer; override; + class function PropertiesClass: TcxCustomEditPropertiesClass; override; + end; + + TdxPSDelegateDataMap = class(TdxPSCustomDataMap) + protected + class function DataMapClass(AProperties: TcxCustomEditProperties): TdxPSDataMapClass; virtual; + class function DoesItemParticipateInAutoHeightCalculation(AProperties: TcxCustomEditProperties): Boolean; override; + class function DoesItemParticipateInAutoWidthCalculation(AProperties: TcxCustomEditProperties): Boolean; override; + class function DoesItemParticipateInBestFitCalculation(AProperties: TcxCustomEditProperties): Boolean; override; + class procedure GetImageLists(AProperties: TcxCustomEditProperties; AProc: TdxPSGetImageListProc); override; + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); override; + class function ItemClass(AProperties: TcxCustomEditProperties; AnIsPreview: Boolean = False): TdxReportCellDataClass; override; + class function MeasureWidth(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; AFont: TFont; ARecordIndex: Integer = 0): Integer; override; + end; + + TdxPSBlobDataMap = class(TdxPSDelegateDataMap) + protected + class function DataMapClass(AProperties: TcxCustomEditProperties): TdxPSDataMapClass; override; + class function PropertiesClass: TcxCustomEditPropertiesClass; override; + end; + + TdxPSBlobDefaultDataMap = class(TdxPSTextDataMap) + protected + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); override; + end; + + TdxPSBlobTextDataMap = class(TdxPSTextDataMap) + protected + class function DoesItemParticipateInAutoWidthCalculation(AProperties: TcxCustomEditProperties): Boolean; override; + class function DoesItemParticipateInBestFitCalculation(AProperties: TcxCustomEditProperties): Boolean; override; + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); override; + end; + + TdxPSBlobPictureDataMap = class(TdxPSCustomDataMap) + protected + class procedure GetImageLists(AProperties: TcxCustomEditProperties; AProc: TdxPSGetImageListProc); override; + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); override; + class function MeasureWidth(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; AFont: TFont; ARecordIndex: Integer = 0): Integer; override; + class function ItemClass(AProperties: TcxCustomEditProperties; AnIsPreview: Boolean = False): TdxReportCellDataClass; override; + end; + + { Extra ReportItems } + + TdxReportCellPreviewText = class(TdxReportCellString) + private + FMaxLineCount: Integer; + FRightIndent: Integer; + function GetLeftIndent: Integer; + procedure SetLeftIndent(Value: Integer); + procedure SetMaxLineCount(Value: Integer); + procedure SetRightIndent(Value: Integer); + protected + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + procedure Assign(Source: TPersistent); override; + + procedure DrawText(DC: HDC); override; + + property LeftIndent: Integer read GetLeftIndent write SetLeftIndent; + property MaxLineCount: Integer read FMaxLineCount write SetMaxLineCount; + property PreventLeftTextExceed; + property PreventTopTextExceed; + property RightIndent: Integer read FRightIndent write SetRightIndent; + property TextAlignX; + property TextAlignY; + end; + + IdxReportLinkOptionsDesignerSupport = interface + ['{98EBA10A-01A5-4011-ABA0-C52CE12F5553}'] + procedure DesignerFinalize; + procedure DesignerInitialize; + function DesignerTabIndex: Integer; + end; + + { ReportLink Styles and StyleSheets } + + TdxCustomReportLinkStylesClass = class of TdxCustomReportLinkStyles; + + TdxCustomReportLinkStyles = class(TcxStyles, IdxReportLinkOptionsDesignerSupport) + private + function GetReportLink: TdxCustomcxControlReportLink; + protected + {IdxReportLinkOptionsDesignerSupport} + procedure DesignerFinalize; virtual; + procedure DesignerInitialize; virtual; + function DesignerTabIndex: Integer; virtual; + + procedure Changed(AIndex: Integer); override; + + procedure GetDefaultViewParamsByCaption(const ACaption: string; AData: Pointer; + out AParams: TcxViewParams); virtual; + class function GetStyleCaption(AnIndex: Integer): string; virtual; + function GetStyleByCaption(const Caption: string): TcxStyle; virtual; + function GetStyleIndexByCaption(const Caption: string): Integer; virtual; abstract; + procedure SetStyleByCaption(const Caption: string; Value: TcxStyle); virtual; + + property StyleIndexesByCaption[const Caption: string]: Integer read GetStyleIndexByCaption; + public + property ReportLink: TdxCustomcxControlReportLink read GetReportLink; + property StylesByCaption[const Caption: string]: TcxStyle read GetStyleByCaption write SetStyleByCaption; + end; + + TdxCustomReportLinkStyleSheetClass = class of TdxCustomReportLinkStyleSheet; + + TdxCustomReportLinkStyleSheet = class(TcxCustomStyleSheet) + public + class procedure Register; + class procedure Unregister; + end; + + { ReportLink Options } + + TdxCustomReportLinkOptionsClass = class of TdxCustomReportLinkOptions; + + TdxCustomReportLinkOptions = class(TPersistent, IUnknown, IdxReportLinkOptionsDesignerSupport) + private + FReportLink: TdxCustomcxControlReportLink; + protected + { IUnknown } + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + function QueryInterface(const IID: TGUID; out Obj): HRESULT; virtual; stdcall; + { IdxReportLinkOptionsDesignerSupport } + procedure DesignerFinalize; virtual; + procedure DesignerInitialize; virtual; + function DesignerTabIndex: Integer; virtual; + + procedure Changed; virtual; + procedure Notification(AComponent: TComponent; AOperation: TOperation); virtual; + + procedure CreateObjects; virtual; + procedure DestroyObjects; virtual; + + procedure DesignerModified; + public + constructor Create(AReportLink: TdxCustomcxControlReportLink); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; virtual; + property ReportLink: TdxCustomcxControlReportLink read FReportLink; + end; + + TdxCustomReportLinkOptionsExpandingClass = class of TdxCustomReportLinkOptionsExpanding; + + TdxCustomReportLinkOptionsExpanding = class(TdxCustomReportLinkOptions) + end; + + TdxCustomReportLinkOptionsFormattingClass = class of TdxCustomReportLinkOptionsFormatting; + + TdxCustomReportLinkOptionsFormatting = class(TdxCustomReportLinkOptions) + private + FGridLineColor: TColor; + FLookAndFeelKind: TcxLookAndFeelKind; + FSuppressBackgroundBitmaps: Boolean; + FUseLookAndFeelColors: Boolean; + FUseNativeStyles: Boolean; + procedure SetGridLineColor(Value: TColor); + procedure SetLookAndFeelKind(Value: TcxLookAndFeelKind); + procedure SetSuppressBackgroundBitmaps(Value: Boolean); + procedure SetUseLookAndFeelColors(Value: Boolean); + procedure SetUseNativeStyles(Value: Boolean); + protected + property UseLookAndFeelColors: Boolean read FUseLookAndFeelColors write SetUseLookAndFeelColors default False; // affects only in WinXP themed environment + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property GridLineColor: TColor read FGridLineColor write SetGridLineColor default clDefault; + property LookAndFeelKind: TcxLookAndFeelKind read FLookAndFeelKind write SetLookAndFeelKind default lfUltraFlat; + property SuppressBackgroundBitmaps: Boolean read FSuppressBackgroundBitmaps write SetSuppressBackgroundBitmaps default False; + property UseNativeStyles: Boolean read FUseNativeStyles write SetUseNativeStyles default False; + end; + + TdxCustomReportLinkOptionsPaginationClass = class of TdxCustomReportLinkOptionsPagination; + + TdxCustomReportLinkOptionsPagination = class(TdxCustomReportLinkOptions) + end; + + TdxCustomReportLinkOptionsRefinementsClass = class of TdxCustomReportLinkOptionsRefinements; + + TdxCustomReportLinkOptionsRefinements = class(TdxCustomReportLinkOptions) + private + FDisplayGraphicsAsText: Boolean; + FFlatCheckMarks: Boolean; + FGraphicsText: string; + FIsGraphicsTextAssigned: Boolean; + FTransparentGraphics: Boolean; + {$IFDEF DXVER500} + FTransparentRichEdits: Boolean; + {$ENDIF} + function GetGraphicsText: string; + function IsGraphicsTextStored: Boolean; + procedure SetDisplayGraphicsAsText(Value: Boolean); + procedure SetFlatCheckMarks(Value: Boolean); + procedure SetGraphicsText(const Value: string); + procedure SetTransparentGraphics(Value: Boolean); + {$IFDEF DXVER500} + procedure SetTransparentRichEdits(Value: Boolean); + {$ENDIF} + procedure ReadIsGraphicsTextAssigned(Reader: TReader); + procedure WriteIsGraphicsTextAssigned(Writer: TWriter); + protected + procedure DefineProperties(Filer: TFiler); override; + public + procedure Assign(Source: TPersistent); override; + function DefaultGraphicsText: string; virtual; + procedure RestoreDefaults; override; + published + property DisplayGraphicsAsText: Boolean read FDisplayGraphicsAsText write SetDisplayGraphicsAsText default False; + property FlatCheckMarks: Boolean read FFlatCheckMarks write SetFlatCheckMarks default True; + property GraphicsText: string read GetGraphicsText write SetGraphicsText stored IsGraphicsTextStored; + property TransparentGraphics: Boolean read FTransparentGraphics write SetTransparentGraphics default False; + {$IFDEF DXVER500} + property TransparentRichEdits: Boolean read FTransparentRichEdits write SetTransparentRichEdits default False; // you can expect slow painting when True + {$ENDIF} + end; + + TdxCustomReportLinkOptionsSizeClass = class of TdxCustomReportLinkOptionsSize; + + TdxCustomReportLinkOptionsSize = class(TdxCustomReportLinkOptions) + private + FAutoWidth: Boolean; + procedure SetAutoWidth(Value: Boolean); + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + property AutoWidth: Boolean read FAutoWidth write SetAutoWidth default False; + end; + + TdxCustomReportLinkOptionsViewClass = class of TdxCustomReportLinkOptionsView; + + TdxCustomReportLinkOptionsView = class(TdxCustomReportLinkOptions) + end; + + { ReportLink } + + TdxStyleSheetHasCaptionProc = function(const ACaption: string): Boolean of object; + + TdxCustomcxControlReportLink = class(TBasedxReportLink) + private + FDelimitersHorz: TList; + FDelimitersVert: TList; + FDesignerTabIndex: Integer; + FImageLists: TList; + FOptions: TList; + FOptionsExpanding: TdxCustomReportLinkOptionsExpanding; + FOptionsFormatting: TdxCustomReportLinkOptionsFormatting; + FOptionsPagination: TdxCustomReportLinkOptionsPagination; + FOptionsRefinements: TdxCustomReportLinkOptionsRefinements; + FOptionsSize: TdxCustomReportLinkOptionsSize; + FOptionsView: TdxCustomReportLinkOptionsView; + FScreenDC: HDC; + FStyleRepository: TcxStyleRepository; + FStyles: TdxCustomReportLinkStyles; + FSupportedCustomDraw: Boolean; + function GetActiveStyles: TdxCustomReportLinkStyles; + function GetDesignWindow: TdxfmCustomcxControlReportLinkDesignWindow; + function GetEffects3D: Boolean; + function GetImageList(Index: Integer): TCustomImageList; + function GetImageListCount: Integer; + function GetOptions(Index: Integer): TdxCustomReportLinkOptions; + function GetOptionsCount: Integer; + function GetSoft3D: Boolean; + procedure SetOptionsExpanding(Value: TdxCustomReportLinkOptionsExpanding); + procedure SetOptionsFormatting(Value: TdxCustomReportLinkOptionsFormatting); + procedure SetOptionsPagination(Value: TdxCustomReportLinkOptionsPagination); + procedure SetOptionsRefinements(Value: TdxCustomReportLinkOptionsRefinements); + procedure SetOptionsSize(Value: TdxCustomReportLinkOptionsSize); + procedure SetOptionsView(Value: TdxCustomReportLinkOptionsView); + procedure SetStyleRepository(Value: TcxStyleRepository); + procedure SetStyles(Value: TdxCustomReportLinkStyles); + procedure SetSupportedCustomDraw(Value: Boolean); + protected + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + + procedure BeforeDesignReport; override; + procedure ConvertCoords; override; + procedure GetImageLists(AProc: TdxPSGetImageListProc); override; + procedure InternalRestoreDefaults; override; + function IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; override; + procedure MakeDelimiters(AReportCells: TdxReportCells; AHorzDelimiters, AVertDelimiters: TList); override; + + procedure AddHorizontalDelimiter(ADelimiter: TdxReportCell); overload; + procedure AddHorizontalDelimiter(ADelimiter: Integer); overload; + procedure AddVerticalDelimiter(ADelimiter: TdxReportCell); overload; + procedure AddVerticalDelimiter(ADelimiter: Integer); overload; + + procedure CreateOptions; virtual; + procedure DestroyOptions; virtual; + function GetOptionsExpandingClass: TdxCustomReportLinkOptionsExpandingClass; virtual; + function GetOptionsFormattingClass: TdxCustomReportLinkOptionsFormattingClass; virtual; + function GetOptionsPaginationClass: TdxCustomReportLinkOptionsPaginationClass; virtual; + function GetOptionsRefinementsClass: TdxCustomReportLinkOptionsRefinementsClass; virtual; + function GetOptionsSizeClass: TdxCustomReportLinkOptionsSizeClass; virtual; + function GetOptionsViewClass: TdxCustomReportLinkOptionsViewClass; virtual; + procedure OptionsChanged(AnOptions: TdxCustomReportLinkOptions); virtual; + + procedure AddOptions(AnOptions: TdxCustomReportLinkOptions); + procedure NotifyOptions(AComponent: TComponent; AOperation: TOperation); + procedure RemoveOptions(AnOptions: TdxCustomReportLinkOptions); + + procedure AppendImageList(AnImageList: TCustomImageList); + function CanCreateComponent: Boolean; + procedure ConvertDelimiters(ADelimiters: TList); + function CreateStyle(const ACaption: string): TcxStyle; + function CreateStyleRepository: TcxStyleRepository; + function CreateStyleSheet(APrototype: TcxCustomStyleSheet; + const ACaption: string; AUseStyles: Boolean): TdxCustomReportLinkStyleSheet; + function FindStyleRepositoryInStyles(AStyles: TcxStyles): TcxStyleRepository; + function GetChildComponentOwner: TComponent; + function GetStyleConsumerCount(AStyle: TcxStyle): Integer; + function GetStyleRepository: TcxStyleRepository; virtual; + function GetStyleSheetCaption(ACheckProc: TdxStyleSheetHasCaptionProc; var ACaption: string): Boolean; + function InitiateStyle(const ACaption: string; var AStyle: TcxStyle; AForceCreation: Boolean): Boolean; + procedure StyleRestoreDefaults(const ACaption: string; AStyle: TcxStyle); + procedure StyleChanged(const ACaption: string; AStyle: TcxStyle); virtual; + + function GetAreNativeStylesAvailable: Boolean; virtual; + function GetStylesClass: TdxCustomReportLinkStylesClass; virtual; + function GetStyleSheetClass: TdxCustomReportLinkStyleSheetClass; virtual; + function GetStyleSheetPrototype: TdxCustomReportLinkStyleSheet; virtual; + + procedure PrepareConstruct; virtual; + procedure UnprepareConstruct; virtual; + + property ActiveStyles: TdxCustomReportLinkStyles read GetActiveStyles; + property AreNativeStylesAvailable: Boolean read GetAreNativeStylesAvailable; + property DelimitersHorz: TList read FDelimitersHorz; + property DelimitersVert: TList read FDelimitersVert; + property DesignerTabIndex: Integer read FDesignerTabIndex write FDesignerTabIndex; + property Effects3D: Boolean read GetEffects3D; + property ImageListCount: Integer read GetImageListCount; + property ImageLists[Index: Integer]: TCustomImageList read GetImageList; + property Options[Index: Integer]: TdxCustomReportLinkOptions read GetOptions; + property OptionsCount: Integer read GetOptionsCount; + property ScreenDC: HDC read FScreenDC; + property Soft3D: Boolean read GetSoft3D; + property StyleRepository: TcxStyleRepository read FStyleRepository write SetStyleRepository; + property Styles: TdxCustomReportLinkStyles read FStyles write SetStyles; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + property DesignWindow: TdxfmCustomcxControlReportLinkDesignWindow read GetDesignWindow; + property OptionsExpanding: TdxCustomReportLinkOptionsExpanding read FOptionsExpanding write SetOptionsExpanding; + property OptionsFormatting: TdxCustomReportLinkOptionsFormatting read FOptionsFormatting write SetOptionsFormatting; + property OptionsPagination: TdxCustomReportLinkOptionsPagination read FOptionsPagination write SetOptionsPagination; + property OptionsRefinements: TdxCustomReportLinkOptionsRefinements read FOptionsRefinements write SetOptionsRefinements; + property OptionsSize: TdxCustomReportLinkOptionsSize read FOptionsSize write SetOptionsSize; + property OptionsView: TdxCustomReportLinkOptionsView read FOptionsView write SetOptionsView; + property SupportedCustomDraw: Boolean read FSupportedCustomDraw write SetSupportedCustomDraw default False; + end; + + { TableReportLink Options } + + TdxCustomTableControlReportLinkOptionsClass = class of TdxCustomTableControlReportLinkOptions; + + TdxCustomTableControlReportLinkOptions = class(TdxCustomReportLinkOptions) + private + function GetReportLink: TdxCustomTableControlReportLink; + public + property ReportLink: TdxCustomTableControlReportLink read GetReportLink; + end; + + TdxCustomTableControlReportLinkOptionsOnEveryPageClass = class of TdxCustomTableControlReportLinkOptionsOnEveryPage; + + TdxCustomTableControlReportLinkOptionsOnEveryPage = class(TdxCustomTableControlReportLinkOptions) + private + FBandHeaders: Boolean; + FFooters: Boolean; + FHeaders: Boolean; + procedure SetBandHeaders(Value: Boolean); + procedure SetFooters(Value: Boolean); + procedure SetHeaders(Value: Boolean); + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property BandHeaders: Boolean read FBandHeaders write SetBandHeaders default True; + property Footers: Boolean read FFooters write SetFooters default True; + property Headers: Boolean read FHeaders write SetHeaders default True; + end; + + TdxCustomTableControlReportLinkOptionsPaginationClass = class of TdxCustomTableControlReportLinkOptionsPagination; + + TdxCustomTableControlReportLinkOptionsPagination = class(TdxCustomReportLinkOptionsPagination) + private + FBand: Boolean; + FCustom: Boolean; + function GetColumn: Boolean; + function GetRow: Boolean; + procedure SetBand(Value: Boolean); + procedure SetColumn(Value: Boolean); + procedure SetCustom(Value: Boolean); + procedure SetRow(Value: Boolean); + protected + property Band: Boolean read FBand write SetBand default False; + property Row: Boolean read GetRow write SetRow default True; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + property Column: Boolean read GetColumn write SetColumn default True; + property Custom: Boolean read FCustom write SetCustom default False; + end; + + TdxCustomTableControlReportLinkOptionsPreviewClass = class of TdxCustomTableControlReportLinkOptionsPreview; + + TdxCustomTableControlReportLinkOptionsPreview = class(TdxCustomTableControlReportLinkOptions) + private + FAutoHeight: Boolean; + FMaxLineCount: Integer; + FVisible: Boolean; + procedure SetAutoHeight(Value: Boolean); + procedure SetMaxLineCount(Value: Integer); + procedure SetVisible(Value: Boolean); + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property AutoHeight: Boolean read FAutoHeight write SetAutoHeight default True; + property MaxLineCount: Integer read FMaxLineCount write SetMaxLineCount default 0; + property Visible: Boolean read FVisible write SetVisible default True; + end; + + TdxCustomTableControlReportLinkOptionsSelectionClass = class of TdxCustomTableControlReportLinkOptionsSelection; + + TdxCustomTableControlReportLinkOptionsSelection = class(TdxCustomTableControlReportLinkOptions) + private + FProcessExactSelection: Boolean; + FProcessSelection: Boolean; + procedure SetProcessExactSelection(Value: Boolean); + procedure SetProcessSelection(Value: Boolean); + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property ProcessExactSelection: Boolean read FProcessExactSelection write SetProcessExactSelection default False; + property ProcessSelection: Boolean read FProcessSelection write SetProcessSelection default False; + end; + + TdxCustomTableControlReportLinkOptionsViewClass = class of TdxCustomTableControlReportLinkOptionsView; + + TdxCustomTableControlReportLinkOptionsView = class(TdxCustomReportLinkOptionsView) + private + FBandHeaders: Boolean; + FExpandButtons: Boolean; + FFooters: Boolean; + FHeaders: Boolean; + procedure SetBandHeaders(Value: Boolean); + procedure SetExpandButtons(Value: Boolean); + procedure SetFooters(Value: Boolean); + procedure SetHeaders(Value: Boolean); + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + property BandHeaders: Boolean read FBandHeaders write SetBandHeaders default True; + property ExpandButtons: Boolean read FExpandButtons write SetExpandButtons default True; + published + property Footers: Boolean read FFooters write SetFooters default True; + property Headers: Boolean read FHeaders write SetHeaders default True; + end; + + { ReportLink } + + TdxCustomTableControlReportLink = class(TdxCustomcxControlReportLink) + private + FOptionsOnEveryPage: TdxCustomTableControlReportLinkOptionsOnEveryPage; + FOptionsPreview: TdxCustomTableControlReportLinkOptionsPreview; + FOptionsSelection: TdxCustomTableControlReportLinkOptionsSelection; + function GetOptionsPagination: TdxCustomTableControlReportLinkOptionsPagination; + function GetOptionsView: TdxCustomTableControlReportLinkOptionsView; + procedure SetOptionsOnEveryPage(Value: TdxCustomTableControlReportLinkOptionsOnEveryPage); + procedure SetOptionsPagination(Value: TdxCustomTableControlReportLinkOptionsPagination); + procedure SetOptionsPreview(Value: TdxCustomTableControlReportLinkOptionsPreview); + procedure SetOptionsSelection(Value: TdxCustomTableControlReportLinkOptionsSelection); + procedure SetOptionsView(Value: TdxCustomTableControlReportLinkOptionsView); + protected + procedure InternalRestoreDefaults; override; + + procedure CreateOptions; override; + procedure DestroyOptions; override; + function GetOptionsOnEveryPageClass: TdxCustomTableControlReportLinkOptionsOnEveryPageClass; virtual; + function GetOptionsPaginationClass: TdxCustomReportLinkOptionsPaginationClass; override; + function GetOptionsPreviewClass: TdxCustomTableControlReportLinkOptionsPreviewClass; virtual; + function GetOptionsSelectionClass: TdxCustomTableControlReportLinkOptionsSelectionClass; virtual; + function GetOptionsViewClass: TdxCustomReportLinkOptionsViewClass; override; + public + procedure Assign(Source: TPersistent); override; + property OptionsOnEveryPage: TdxCustomTableControlReportLinkOptionsOnEveryPage read FOptionsOnEveryPage write SetOptionsOnEveryPage; + property OptionsPagination: TdxCustomTableControlReportLinkOptionsPagination read GetOptionsPagination write SetOptionsPagination; + property OptionsPreview: TdxCustomTableControlReportLinkOptionsPreview read FOptionsPreview write SetOptionsPreview; + property OptionsSelection: TdxCustomTableControlReportLinkOptionsSelection read FOptionsSelection write SetOptionsSelection; + property OptionsView: TdxCustomTableControlReportLinkOptionsView read GetOptionsView write SetOptionsView; + end; + + { Design Window } + + TdxfmCustomcxControlReportLinkDesignWindow = class(TStandarddxReportLinkDesignWindow) + private + function GetActiveStyleSheet: TcxCustomStyleSheet; + function GetAreNativeStylesAvailable: Boolean; + function GetReportLink: TdxCustomcxControlReportLink; + function GetStyleRepository: TcxStyleRepository; + procedure SetActiveStyleSheet(Value: TcxCustomStyleSheet); + procedure WMActivate(var message: TWMActivate); message WM_ACTIVATE; + protected + procedure DoInitialize; override; + + function CanCopyStyleSheet: Boolean; virtual; + function CanCreateStyleSheet: Boolean; virtual; + function CanDeleteStyleSheet: Boolean; virtual; + function CanRenameStyleSheet: Boolean; virtual; + function CanSaveStyles: Boolean; virtual; + + function PerformStyleSheetCopy: Boolean; + function PerformStyleSheetDelete: Boolean; + procedure PerformStyleSheetDrawItem(ACanvas: TCanvas; AnIndex: Integer; + R: TRect; AState: TOwnerDrawState; AEnabled: Boolean); + function PerformStyleSheetKeyDown(Sender: TObject; var AKey: Word; + AShift: TShiftState): Boolean; + function PerformStyleSheetNew: Boolean; + function PerformStyleSheetRename: Boolean; + + function PerformStylesChangeBitmap: Boolean; + function PerformStylesChangeColor: Boolean; + function PerformStylesChangeFont: Boolean; + function PerformStylesClearBitmap: Boolean; + function PerformStylesRestoreDefaults: Boolean; + function PerformStylesSaveAsStyleSheet: Boolean; + procedure RefreshStyleSheetList; + procedure RefreshStylesList; + + // next methods can be overriden + procedure DoActiveStyleSheetChanged; dynamic; + procedure DoFormActivated(AnActive: Boolean); dynamic; + procedure DoRefreshStylesList; dynamic; + procedure DoStyleChanged(const ACaption: string; AStyle: TcxStyle); dynamic; + procedure DoStylesChanged(AStrings: TStrings; ARecreate: Boolean); dynamic; + + function GetDesignerTabIndex: Integer; virtual; + procedure SetDesignerTabIndex(Value: Integer); virtual; + + // next methods must be overriden + procedure GetSelectedStyleNames(AStrings: TStrings); virtual; + procedure GetStyleNames(out AStrings: TStrings); virtual; + procedure GetStyleSheetNames(out AStrings: TStrings); virtual; + + function GetStyleConsumerCount(AStyle: TcxStyle): Integer; + function GetStyleSheetCaption(var ACaption: string): Boolean; + function HasStyleSheetWithCaption(const ACaption: string): Boolean; + procedure InitiateStyle(const ACaption: string; var AStyle: TcxStyle; AForceCreation: Boolean); + + property ActiveStyleSheet: TcxCustomStyleSheet read GetActiveStyleSheet write SetActiveStyleSheet; + property AreNativeStylesAvailable: Boolean read GetAreNativeStylesAvailable; + property DesignerTabIndex: Integer read GetDesignerTabIndex write SetDesignerTabIndex; + property ReportLink: TdxCustomcxControlReportLink read GetReportLink; + property StyleRepository: TcxStyleRepository read GetStyleRepository; + end; + + { Styles ListBox with ToolTips Support } + + TdxStyleBarViewInfo = record + BarColor: TColor; + BarFont: TFont; + BarStyleColorBoxFrameColor: TColor; + StyleCaption: string; + StyleBitmap: TBitmap; + StyleBitmapOrg: TPoint; + StyleColor: TColor; + StyleFont: TFont; + StyleTextColor: TColor; + StyleCaptionBoxBounds: TRect; + StyleColorBoxBounds: TRect; + StyleColorBoxContentBounds: TRect; + StyleFontInfoBoxBounds: TRect; + MaxWidth: Integer; + RestSpaceBounds: TRect; + end; + + TdxStylesListBox = class; + + TdxStylesListBoxToolTipsWindow = class(TCustomControl) + private + FStyleIndex: Integer; + function GetListBox: TdxStylesListBox; + procedure WMEraseBkgnd(var message: TWMEraseBkgnd); message WM_ERASEBKGND; + procedure WMNCHitTest(var message: TWMNCHitTest); message WM_NCHITTEST; + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure Paint; override; + + procedure CalculateStyleBarViewInfo(const R: TRect; var AViewInfo: TdxStyleBarViewInfo); virtual; + procedure DrawBorder(DC: HDC; const R: TRect); virtual; + procedure DrawStyle(R: TRect); virtual; + public + procedure Activate(const R: TRect; AnIndex: Integer); + procedure Deactivate; + + property ListBox: TdxStylesListBox read GetListBox; + property StyleIndex: Integer read FStyleIndex; + end; + + TdxStylesListBox = class(TListBox) + private + FHotTrackStyleIndex: Integer; + FReportLinkStyles: TdxCustomReportLinkStyles; + FToolTips: Boolean; + FToolTipsLongHideTimer: TTimer; + FToolTipsShortHideTimer: TTimer; + FToolTipsWindow: TdxStylesListBoxToolTipsWindow; + function GetHotTrackStyleBounds: TRect; + function GetHotTrackStyleName: string; + function GetStyle(Index: Integer): TcxStyle; + function GetToolTipsBounds: TRect; + procedure SetReportLinkStyles(Value: TdxCustomReportLinkStyles); + procedure SetToolTips(Value: Boolean); + + procedure ToolTipsLongHideTimerHandler(Sender: TObject); + procedure ToolTipsShortHideTimerHandler(Sender: TObject); + procedure WMHScroll(var Message: TWMHScroll); message WM_HSCROLL; + procedure WMMouseWheel(var Message: TWMMouseWheel); message WM_MOUSEWHEEL; + procedure WMVScroll(var Message: TWMVScroll); message WM_VSCROLL; + protected + procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); override; + procedure MeasureItem(Index: Integer; var Height: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + + procedure CalculateStyleBarViewInfoSizes(AnIndex: Integer; const R: TRect; + var AViewInfo: TdxStyleBarViewInfo); virtual; + procedure CalculateStyleBarViewInfoViewParams(const ACaption: string; AStyle: TcxStyle; + const R: TRect; ASelected: Boolean; var AViewInfo: TdxStyleBarViewInfo); virtual; + procedure CalculateStyleBarViewInfo(const ACaption: string; AnIndex: Integer; + AStyle: TcxStyle; const R: TRect; ASelected: Boolean; + var AViewInfo: TdxStyleBarViewInfo); + + function AreToolTipsNeeded: Boolean; + function FindHotTrackStyle(const Pt: TPoint): Integer; + function IsHotTrackStyleViolateControlBounds: Boolean; + function IsMouseOver: Boolean; + procedure ShowToolTips; + procedure UpdateToolTips(const Pt: TPoint); + + property HotTrackStyleBounds: TRect read GetHotTrackStyleBounds; + property HotTrackStyleIndex: Integer read FHotTrackStyleIndex write FHotTrackStyleIndex; + property HotTrackStyleName: string read GetHotTrackStyleName; + property ToolTipsBounds: TRect read GetToolTipsBounds; + property ToolTipsWindow: TdxStylesListBoxToolTipsWindow read FToolTipsWindow; + public + constructor Create(AOwner: TComponent); override; + + procedure HideToolTips; + function IndexOfStyle(AStyle: TcxStyle): Integer; + + property ReportLinkStyles: TdxCustomReportLinkStyles read FReportLinkStyles write SetReportLinkStyles; + property Styles[Index: Integer]: TcxStyle read GetStyle; + published + property ToolTips: Boolean read FToolTips write SetToolTips default True; + end; + +{ Helpers } + +function cxButtonGroupItem_GetCaption(AnItem: TcxButtonGroupItem): string; + +function cxBlobEditProperties_GetEditKind(AProperties: TcxCustomEditProperties): TcxBlobEditKind; +function cxBlobEditProperties_GetPaintStyle(AProperties: TcxCustomEditProperties): TcxBlobPaintStyle; + +function cxButtonGroupProperties_GetColumnCount(AProperties: TcxCustomEditProperties): Integer; +function cxButtonGroupProperties_GetItems(AProperties: TcxCustomEditProperties): TcxButtonGroupItems; + +function cxCheckBoxProperties_GetAlignment(AProperties: TcxCustomEditProperties): TAlignment; +function cxCheckBoxProperties_GetGlyph(AProperties: TcxCustomEditProperties): TBitmap; +function cxCheckBoxProperties_GetGlyphCount(AProperties: TcxCustomEditProperties): Integer; +function cxCheckBoxProperties_GetIsMultilined(AProperties: TcxCustomEditProperties): Boolean; +function cxCheckBoxProperties_GetNullStyle(AProperties: TcxCustomEditProperties): TcxCheckBoxNullValueShowingStyle; + +function cxCurrencyProperties_GetNullString(AProperties: TcxCustomEditProperties): string; + +function cxEditProperties_GetAlignment(AProperties: TcxCustomEditProperties): TcxEditAlignment; + +function cxHyperLinkEditProperties_GetLinkColor(AProperties: TcxCustomEditProperties): TColor; + +function cxMemoProperties_GetAlignment(AProperties: TcxCustomEditProperties): TAlignment; +function cxMemoProperties_GetWordWrap(AProperties: TcxCustomEditProperties): Boolean; + +function cxImageComboBoxProperties_GetDefaultDescription(AProperties: TcxCustomEditProperties): string; +function cxImageComboBoxProperties_GetDefaultImageIndex(AProperties: TcxCustomEditProperties): Integer; +function cxImageComboBoxProperties_FindItemByValue(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue): TcxImageComboBoxItem; +function cxImageComboBoxProperties_GetImageAlignment(AProperties: TcxCustomEditProperties): TcxImageAlign; +function cxImageComboBoxProperties_GetImages(AProperties: TcxCustomEditProperties): TCustomImageList; +function cxImageComboBoxProperties_GetIsMultilined(AProperties: TcxCustomEditProperties): Boolean; +function cxImageComboBoxProperties_GetItems(AProperties: TcxCustomEditProperties): TcxImageComboBoxItems; +function cxImageComboBoxProperties_GetShowDescription(AProperties: TcxCustomEditProperties): Boolean; + +function cxImageProperties_GetCaption(AProperties: TcxCustomEditProperties): string; +function cxImageProperties_GetCenter(AProperties: TcxCustomEditProperties): Boolean; +function cxImageProperties_GetStretch(AProperties: TcxCustomEditProperties): Boolean; +function cxImageProperties_GetGraphicClass(AProperties: TcxCustomEditProperties; ARecordIndex: Integer; AOwner: TObject = nil): TGraphicClass; + +function cxRadioGroupProperties_GetDisplayText(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue): string; + +{ Utilities } + +function dxPSDataMaps: TdxPSDataMaps; +procedure dxPSDrawStyleBar(ACanvas: TCanvas; R: TRect; const AViewInfo: TdxStyleBarViewInfo); +function dxPSMakecxGridLines(AHorizontal, AVertical: Boolean): TcxGridLines; +function dxPSMeasureTextWidth(DC: HDC; const AText: string; AFont: TFont): Integer; +function dxPSPreviewCarLogos(Index: Integer): TPicture; +function dxPSPreviewCarLogosAsString(Index: Integer): AnsiString; +function dxPSPictureDialog: TOpenPictureDialog; +procedure dxPSResetStyles(AStyles: TcxStyles); + +const + dxPSPreviewCarLogoCount = 5; + dxPSPreviewCarLogoWidth = 60; + dxPSPreviewCarLogoHeight = 32; + + CellSidesMap: array[TcxGridLines] of TdxCellSides = (csAll, [], csLeftRight, csTopBottom); + EdgeStyleMap: array[Boolean] of TdxCheckButtonEdgeStyle = (cbes3D, cbesUltraFlat); + EditTextAlignXMap: array[TcxEditHorzAlignment] of TdxTextAlignX = (taLeft, taRight, taCenterX); + EditTextAlignYMap: array[TcxEditVertAlignment] of TdxTextAlignY = (taTop, taBottom, taCenterY); + HeaderImageLayoutMap: array[TAlignment, TcxAlignmentVert] of TdxImageLayout = + ((ilImageTopLeft, ilImageBottomLeft, ilImageCenterLeft), + (ilImageTopRight, ilImageBottomRight, ilImageCenterRight), + (ilImageTopCenter, ilImageBottomCenter, ilImageCenterCenter)); + ImageLayoutMap: array[TcxImageAlign] of TdxImageLayout = (ilImageCenterLeft, ilImageCenterRight); + TextAlignXMap: array[TAlignment] of TdxTextAlignX = (taLeft, taRight, taCenterX); + TextAlignYMap: array[TcxAlignmentVert] of TdxTextAlignY = (taTop, taBottom, taCenterY); + +implementation + +uses + {$IFDEF DELPHI7} + Themes, + {$ENDIF} + {$IFDEF DELPHI6} + Variants, + {$ENDIF} + SysUtils, Forms, dxThemeManager, cxVariants, cxDataUtils, dxPSUtl, dxPSEngn, + dxPSImgs, dxExtCtrls; + +var + FPicture: TPicture; + FPictureDialog: TOpenPictureDialog; + FPreviewPictures: array[0..dxPSPreviewCarLogoCount - 1] of TPicture; + +type + + TcxCustomStylesAccess = class(TcxCustomStyles); + TcxButtonGroupItemAccess = class(TcxButtonGroupItem); + TcxCustomBlobEditPropertiesAccess = class(TcxCustomBlobEditProperties); + TcxCustomButtonGroupPropertiesAccess = class(TcxCustomButtonGroupProperties); + TcxCustomCheckBoxPropertiesAccess = class(TcxCustomCheckBoxProperties); + TcxCustomCurrencyEditPropertiesAccess = class(TcxCustomCurrencyEditProperties); + TcxCustomEditPropertiesAccess = class(TcxCustomEditProperties); + TcxCustomHyperLinkEditPropertiesAccess = class(TcxCustomHyperLinkEditProperties); + TcxCustomMemoPropertiesAccess = class(TcxCustomMemoProperties); + TcxCustomImageComboBoxPropertiesAccess = class(TcxCustomImageComboBoxProperties); + TcxCustomImagePropertiesAccess = class(TcxCustomImageProperties); + TcxCustomRadioGroupPropertiesAccess = class(TcxCustomRadioGroupProperties); + {$IFDEF DXVER500} + TcxOffice11LookAndFeelPainterAccess = class(TcxOffice11LookAndFeelPainter); + {$ENDIF} + + +{ Helpers } + +{ TcxStyles Helpers } + +function cxStyles_GetCount(AInstance: TcxCustomStyles): Integer; +begin + Result := TcxCustomStylesAccess(AInstance).Count; +end; + +procedure cxStyles_ResetStyles(AInstance: TcxCustomStyles); +begin + TcxCustomStylesAccess(AInstance).ResetStyles; +end; + +function cxStyles_GetStyleSheet(AInstance: TcxCustomStyles): TcxCustomStyleSheet; +begin + Result := TcxCustomStylesAccess(AInstance).StyleSheet; +end; + +procedure cxStyles_SetStyleSheet(AInstance: TcxCustomStyles; Value: TcxCustomStyleSheet); +begin + TcxCustomStylesAccess(AInstance).StyleSheet := Value; +end; + +{ ButtonGroupItem Helpers } + +function cxButtonGroupItem_GetCaption(AnItem: TcxButtonGroupItem): string; +begin + Result := TcxButtonGroupItemAccess(AnItem).Caption; +end; + +{ BlobEditProperties Helpers } + +function cxBlobEditProperties_GetEditKind(AProperties: TcxCustomEditProperties): TcxBlobEditKind; +begin + Result := TcxCustomBlobEditPropertiesAccess(AProperties).BlobEditKind; +end; + +function cxBlobEditProperties_GetPaintStyle(AProperties: TcxCustomEditProperties): TcxBlobPaintStyle; +begin + Result := TcxCustomBlobEditPropertiesAccess(AProperties).BlobPaintStyle; +end; + +{ ButtonGroupProperties Helpers } + +function cxButtonGroupProperties_GetColumnCount(AProperties: TcxCustomEditProperties): Integer; +begin + Result := TcxCustomButtonGroupPropertiesAccess(AProperties).Columns; +end; + +function cxButtonGroupProperties_GetItems(AProperties: TcxCustomEditProperties): TcxButtonGroupItems; +begin + Result := TcxCustomButtonGroupPropertiesAccess(AProperties).Items; +end; + +{ CheckBoxProperties Helpers } + +function cxCheckBoxProperties_GetAlignment(AProperties: TcxCustomEditProperties): TAlignment; +begin + Result := TcxCustomCheckBoxPropertiesAccess(AProperties).Alignment; +end; + +function cxCheckBoxProperties_GetGlyph(AProperties: TcxCustomEditProperties): TBitmap; +begin + Result := TcxCustomCheckBoxPropertiesAccess(AProperties).Glyph; +end; + +function cxCheckBoxProperties_GetGlyphCount(AProperties: TcxCustomEditProperties): Integer; +begin + Result := TcxCustomCheckBoxPropertiesAccess(AProperties).GlyphCount; +end; + +function cxCheckBoxProperties_GetIsMultilined(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := TcxCustomCheckBoxPropertiesAccess(AProperties).Multiline; +end; + +function cxCheckBoxProperties_GetNullStyle(AProperties: TcxCustomEditProperties): TcxCheckBoxNullValueShowingStyle; +begin + Result := TcxCustomCheckBoxPropertiesAccess(AProperties).NullStyle; +end; + +{ CurrencyProperties Helpers } + +function cxCurrencyProperties_GetNullString(AProperties: TcxCustomEditProperties): string; +begin + Result := TcxCustomCurrencyEditPropertiesAccess(AProperties).NullString; +end; + +{ EditProperties Helpers} + +function cxEditProperties_GetAlignment(AProperties: TcxCustomEditProperties): TcxEditAlignment; +begin + Result := TcxCustomEditPropertiesAccess(AProperties).Alignment; +end; + +{ HyperLinkEditProperties Helpers } + +function cxHyperLinkEditProperties_GetLinkColor(AProperties: TcxCustomEditProperties): TColor; +begin + Result := TcxCustomHyperLinkEditPropertiesAccess(AProperties).LinkColor; +end; + +{ MemoProperties Helpers } + +function cxMemoProperties_GetAlignment(AProperties: TcxCustomEditProperties): TAlignment; +begin + Result := TcxCustomMemoPropertiesAccess(AProperties).Alignment; +end; + +function cxMemoProperties_GetWordWrap(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := TcxCustomMemoPropertiesAccess(AProperties).WordWrap; +end; + +{ ImageComboBoxProperties Helpers } + +function cxImageComboBoxProperties_GetDefaultDescription(AProperties: TcxCustomEditProperties): string; +begin + Result := TcxCustomImageComboBoxPropertiesAccess(AProperties).DefaultDescription; +end; + +function cxImageComboBoxProperties_GetDefaultImageIndex(AProperties: TcxCustomEditProperties): Integer; +begin + Result := TcxCustomImageComboBoxPropertiesAccess(AProperties).DefaultImageIndex; +end; + +function cxImageComboBoxProperties_FindItemByValue(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue): TcxImageComboBoxItem; +begin + Result := TcxCustomImageComboBoxPropertiesAccess(AProperties).FindItemByValue(AValue); +end; + +function cxImageComboBoxProperties_GetImageAlignment(AProperties: TcxCustomEditProperties): TcxImageAlign; +begin + Result := TcxCustomImageComboBoxPropertiesAccess(AProperties).ImageAlign; +end; + +function cxImageComboBoxProperties_GetImages(AProperties: TcxCustomEditProperties): TCustomImageList; +begin + Result := TcxCustomImageComboBoxPropertiesAccess(AProperties).Images; +end; + +function cxImageComboBoxProperties_GetIsMultilined(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := TcxCustomImageComboBoxPropertiesAccess(AProperties).MultiLineText; +end; + +function cxImageComboBoxProperties_GetItems(AProperties: TcxCustomEditProperties): TcxImageComboBoxItems; +begin + Result := TcxCustomImageComboBoxPropertiesAccess(AProperties).Items; +end; + +function cxImageComboBoxProperties_GetShowDescription(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := TcxCustomImageComboBoxPropertiesAccess(AProperties).ShowDescriptions; +end; + +{ ImageProperties Helpers } + +function cxImageProperties_GetCaption(AProperties: TcxCustomEditProperties): string; +begin + Result := TcxCustomImagePropertiesAccess(AProperties).Caption; +end; + +function cxImageProperties_GetCenter(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := TcxCustomImagePropertiesAccess(AProperties).Center; +end; + +function cxImageProperties_GetStretch(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := TcxCustomImagePropertiesAccess(AProperties).Stretch; +end; + +function cxImageProperties_GetGraphicClass(AProperties: TcxCustomEditProperties; ARecordIndex: Integer; AOwner: TObject = nil): TGraphicClass; +begin + if AOwner = nil then AOwner := AProperties.Owner; + Result := TcxCustomImagePropertiesAccess(AProperties).GetGraphicClass{$IFDEF DXVER500}(AOwner, ARecordIndex){$ENDIF}; +end; + +{ RadioGroupProperties Helpers } + +function cxRadioGroupProperties_GetDisplayText(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue): string; +begin + Result := TcxCustomRadioGroupPropertiesAccess(AProperties).GetDisplayText(AValue, True); +end; + +{ Office11 LookAndFeelPainter } + +function cxOffice11LookAndFeelPainter_GetHeaderTopColor(APainterClass: TcxCustomLookAndFeelPainterClass): TColor; +begin + Result := TcxCustomLookAndFeelPainter.DefaultHeaderColor; + if (APainterClass <> nil) and APainterClass.InheritsFrom(TcxOffice11LookAndFeelPainter) then + Result := APainterClass.DefaultHeaderColor + else +end; + +{ Utilities } + +function Picture: TPicture; +begin + if FPicture = nil then FPicture := TPicture.Create; + Result := FPicture; +end; + +function dxPSMakecxGridLines(AHorizontal, AVertical: Boolean): TcxGridLines; +const + Results: array[Boolean] of TcxGridLines = (glVertical, glHorizontal); +begin + Result := glNone; + case Ord(AHorizontal) + Ord(AVertical) of + 1: Result := Results[AHorizontal]; + 2: Result := glBoth; + end; +end; + +function GetUniqueName(AOwner: TComponent; const APrefix: string): string; +var + I: Integer; +begin + I := 0; + repeat + Inc(I); + Result := APrefix + IntToStr(I); + until (I = MaxInt) or (AOwner = nil) or (AOwner.FindComponent(Result) = nil); + + if I = MaxInt then Result := ''; +end; + +procedure InitializeStyleBarViewInfo(var AViewInfo: TdxStyleBarViewInfo); +begin + FillChar(AViewInfo, SizeOf(AViewInfo), 0); + AViewInfo.BarFont := TFont.Create; + AViewInfo.StyleBitmap := TBitmap.Create; + AViewInfo.StyleFont := TFont.Create; +end; + +procedure DeinitializeStyleBarViewInfo(var AViewInfo: TdxStyleBarViewInfo); +begin + AViewInfo.BarFont.Free; + AViewInfo.StyleCaption := ''; + AViewInfo.StyleBitmap.Free; + AViewInfo.StyleFont.Free; + FillChar(AViewInfo, SizeOf(AViewInfo), 0); +end; + +procedure dxPSDrawStyleBar(ACanvas: TCanvas; R: TRect; const AViewInfo: TdxStyleBarViewInfo); +const + ColorBarWidth: Integer = 60; + + procedure DrawStyleBarCaption; + var + X, Y: Integer; + begin + with ACanvas, AViewInfo do + begin + Brush.Style := bsSolid; + Brush.Color := BarColor; + Font := BarFont; + with StyleCaptionBoxBounds do + begin + X := Left + 2; + Y := Top + (Bottom - Top - TextHeight('Wq')) div 2; + end; + TextRect(StyleCaptionBoxBounds, X, Y, StyleCaption); + end; + end; + + procedure DrawStyleBarColorBar; + var + Rgn: HRGN; + PrevBrushOrg: TPoint; + begin + with ACanvas, AViewInfo do + begin + Brush.Style := bsSolid; + Brush.Color := StyleColor; + if not StyleBitmap.Empty then + begin + Brush.Bitmap := StyleBitmap; + SetBrushOrgEx(ACanvas.Handle, StyleBitmapOrg.X, StyleBitmapOrg.Y, @PrevBrushOrg); + end; + Pen.Color := BarStyleColorBoxFrameColor; + with StyleColorBoxContentBounds do + Rectangle(Left, Top, Right, Bottom); + if not StyleBitmap.Empty then + begin + Brush.Bitmap := nil; + SetBrushOrgEx(ACanvas.Handle, PrevBrushOrg.X, PrevBrushOrg.Y, nil); + end; + + Rgn := dxPSUtl.ExcludeClipRect(Handle, StyleColorBoxContentBounds); + try + Brush.Color := BarColor; + FillRect(StyleColorBoxBounds); + finally + dxPSUtl.RestoreClipRgn(Handle, Rgn); + end; + end; + end; + + procedure DrawStyleBarFontInfo; + var + X, Y: Integer; + begin + with ACanvas, AViewInfo do + begin + Brush.Style := bsSolid; + Brush.Color := BarColor; + Font := StyleFont; + Font.Color := StyleTextColor; + with StyleFontInfoBoxBounds do + begin + X := Left + 1; + Y := Top + (Bottom - Top - TextHeight('Wq')) div 2; + end; + TextRect(StyleFontInfoBoxBounds, X, Y, dxPSUtl.FormatFontInfo(StyleFont)); + end; + end; + + procedure DrawRestSpace; + begin + with ACanvas, AViewInfo do + if RectVisible(Handle, RestSpaceBounds) then + begin + Brush.Style := bsSolid; + Brush.Color := BarColor; + FillRect(RestSpaceBounds); + end; + end; + +begin + DrawStyleBarCaption; + DrawStyleBarColorBar; + DrawStyleBarFontInfo; + DrawRestSpace; +end; + +function dxPSMeasureTextWidth(DC: HDC; const AText: string; AFont: TFont): Integer; +var + F: HFONT; + Size: TSize; +begin + F := SelectObject(DC, AFont.Handle); + GetTextExtentPoint32(DC, PChar(AText), Length(AText), Size); + Result := 2 + Size.cx + 2; + SelectObject(DC, F); +end; + +function dxPSPreviewCarLogos(Index: Integer): TPicture; + + function ExtractImage(Source: TPicture; Index: Integer): TPicture; + begin + Result := TPicture.Create; + with Result.Bitmap do + begin + Width := dxPSPreviewCarLogoWidth; + Height := dxPSPreviewCarLogoHeight; + Canvas.Draw(-Index * dxPSPreviewCarLogoWidth, 0, Source.Bitmap); + Transparent := True; + end; + end; + +var + Picture: TPicture; + I: Integer; +begin + if FPreviewPictures[0] = nil then + begin + Picture := TPicture.Create; + try + Bitmap_LoadFromResourceName(Picture.Bitmap, IDB_DXPSCARLOGOS); + for I := 0 to dxPSPreviewCarLogoCount - 1 do + FPreviewPictures[I] := ExtractImage(Picture, I); + finally + Picture.Free; + end; + end; + + if (Index > -1) and (Index < dxPSPreviewCarLogoCount) then + Result := FPreviewPictures[Index] + else + Result := nil; +end; + +function dxPSPreviewCarLogosAsString(Index: Integer): AnsiString; +begin + cxImage.SavePicture(dxPSPreviewCarLogos(Index), Result); +end; + +procedure dxPSResetStyles(AStyles: TcxStyles); +begin + cxStyles_SetStyleSheet(AStyles, nil); + cxStyles_ResetStyles(AStyles); +end; + +function dxPSPictureDialog: TOpenPictureDialog; +begin + if FPictureDialog = nil then + begin + FPictureDialog := TOpenPictureDialog.Create(nil); + FPictureDialog.Title := cxGetResourceString(@sdxLoadBitmapDlgTitle); + //if dxPSEngn.InitialDir <> '' then + // FPictureDialog.InitialDir := dxPSEngn.InitialDir; + end; + Result := FPictureDialog; +end; + +{ CLR Accessors } + + +{ TdxPSDataMaps } + +function dxPSDataMaps: TdxPSDataMaps; +begin + Result := TdxPSDataMaps.Instance; +end; + +class function TdxPSDataMaps.Instance: TdxPSDataMaps; +begin + Result := inherited Instance as TdxPSDataMaps; +end; + +function TdxPSDataMaps.DoesItemParticipateInAutoHeightCalculation(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := MapClasses[AProperties].DoesItemParticipateInAutoHeightCalculation(AProperties); +end; + +function TdxPSDataMaps.DoesItemParticipateInAutoWidthCalculation(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := MapClasses[AProperties].DoesItemParticipateInAutoWidthCalculation(AProperties); +end; + +function TdxPSDataMaps.DoesItemParticipateInBestFitCalculation(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := MapClasses[AProperties].DoesItemParticipateInBestFitCalculation(AProperties); +end; + +procedure TdxPSDataMaps.GetImageLists(AProperties: TcxCustomEditProperties; + AProc: TdxPSGetImageListProc); +begin + MapClasses[AProperties].GetImageLists(AProperties, AProc); +end; + +procedure TdxPSDataMaps.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); +begin + MapClasses[AProperties].InitializeItem(AnItem, AProperties, AValue, ACellParams, AViewParams, AnIsPreview, ARecordIndex, AOwner); +end; + +function TdxPSDataMaps.ItemClass(AProperties: TcxCustomEditProperties; + AnIsPreview: Boolean = False): TdxReportCellDataClass; +begin + Result := MapClasses[AProperties].ItemClass(AProperties, AnIsPreview); +end; + +function TdxPSDataMaps.MeasureWidth(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; AFont: TFont; + ARecordIndex: Integer = 0): Integer; +begin + Result := MapClasses[AProperties].MeasureWidth(AProperties, AValue, ACellParams, AFont, ARecordIndex); +end; + +function TdxPSDataMaps.GetMapClass(Properties: TcxCustomEditProperties): TdxPSDataMapClass; +begin + Result := TdxPSDataMapClass(PairClasses[Properties.ClassType]); +end; + +{ TdxPSCustomDataMap } + +class function TdxPSCustomDataMap.PairClass: TClass; +begin + Result := PropertiesClass; +end; + +class procedure TdxPSCustomDataMap.Register; +begin + dxPSDataMaps.Register(Self); +end; + +class procedure TdxPSCustomDataMap.Unregister; +begin + dxPSDataMaps.Unregister(Self); +end; + +class function TdxPSCustomDataMap.DoesItemParticipateInAutoHeightCalculation(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := True; +end; + +class function TdxPSCustomDataMap.DoesItemParticipateInAutoWidthCalculation(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := True; +end; + +class function TdxPSCustomDataMap.DoesItemParticipateInBestFitCalculation(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := True; +end; + +class procedure TdxPSCustomDataMap.GetImageLists(AProperties: TcxCustomEditProperties; + AProc: TdxPSGetImageListProc); +begin +end; + +class function TdxPSCustomDataMap.GetText(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue): string; +begin + Result := AProperties.GetDisplayText(AValue, True); +end; + +class function TdxPSCustomDataMap.HasText(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue): Boolean; +begin + Result := GetText(AProperties, AValue) <> ''; +end; + +class procedure TdxPSCustomDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); +begin + TdxReportCellString(AnItem).EndEllipsis := ACellParams.EndEllipsis; + TdxReportCellString(AnItem).Text := GetText(AProperties, AValue); +end; + +class function TdxPSCustomDataMap.ItemClass(AProperties: TcxCustomEditProperties; + AnIsPreview: Boolean = False): TdxReportCellDataClass; +begin + Result := TdxReportCellString; +end; + +class function TdxPSCustomDataMap.MeasureWidth(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; AFont: TFont; + ARecordIndex: Integer = 0): Integer; +begin + Result := 0; + if HasText(AProperties, AValue) then + Result := dxPSMeasureTextWidth(ACellParams.DC, GetText(AProperties, AValue), AFont); +end; + +class function TdxPSCustomDataMap.PropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomEditProperties; +end; + +{ TdxPSTextDataMap } + +class procedure TdxPSTextDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); + + procedure GetPreviewParams(out ALeftIndent, ARightIndent, AMaxLineCount: Integer); + var + CellParams2: IdxPSCellParams2; + begin + if Supports(ACellParams, IdxPSCellParams2, CellParams2) then + begin + ALeftIndent := CellParams2.PreviewMarginLeft; + ARightIndent := CellParams2.PreviewMarginRight; + AMaxLineCount := CellParams2.PreviewMaxLineCount; + end + else + begin + ALeftIndent := 20; + ARightIndent := 5; + AMaxLineCount := -1; + end; + end; + +var + LeftIndent, RightIndent, MaxLineCount: Integer; +begin + with TdxReportCellString(AnItem) do + begin + EndEllipsis := ACellParams.EndEllipsis; + Multiline := AnIsPreview or ACellParams.Multiline; + Text := GetText(AProperties, AValue); + TextAlignX := EditTextAlignXMap[cxEditProperties_GetAlignment(AProperties).Horz]; + if AnIsPreview then + TextAlignY := taTop + else + TextAlignY := EditTextAlignYMap[cxEditProperties_GetAlignment(AProperties).Vert]; + end; + if AnIsPreview then + begin + GetPreviewParams(LeftIndent, RightIndent, MaxLineCount); + if AnIsPreview then + begin + TdxReportCellPreviewText(AnItem).LeftIndent := LeftIndent; + TdxReportCellPreviewText(AnItem).RightIndent := RightIndent; + TdxReportCellPreviewText(AnItem).MaxLineCount := MaxLineCount; + end; + end; +end; + +class function TdxPSTextDataMap.ItemClass(AProperties: TcxCustomEditProperties; + AnIsPreview: Boolean = False): TdxReportCellDataClass; +const + ItemClasses: array[Boolean] of TdxReportCellDataClass = (TdxReportCellString, TdxReportCellPreviewText); +begin + Result := ItemClasses[AnIsPreview]; +end; + +class function TdxPSTextDataMap.PropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomTextEditProperties; +end; + +{ TdxPSMemoDataMap } + +class function TdxPSMemoDataMap.DoesItemParticipateInAutoWidthCalculation(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := not cxMemoProperties_GetWordWrap(AProperties); +end; + +class function TdxPSMemoDataMap.DoesItemParticipateInBestFitCalculation(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := False; +end; + +class procedure TdxPSMemoDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); +begin + inherited; + with TdxReportCellString(AnItem) do + begin + Multiline := cxMemoProperties_GetWordWrap(AProperties); + TextAlignX := TextAlignXMap[cxMemoProperties_GetAlignment(AProperties)]; + end; +end; + +class function TdxPSMemoDataMap.PropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomMemoProperties; +end; + +{ TdxPSHyperLinkDataMap } + +class procedure TdxPSHyperLinkDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); +begin + inherited; + AViewParams.FontStyle := AViewParams.FontStyle + [fsUnderline]; + AViewParams.NativeParams.TextColor := cxHyperLinkEditProperties_GetLinkColor(AProperties); +end; + +class function TdxPSHyperLinkDataMap.PropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomHyperLinkEditProperties; +end; + +{ TdxPSCheckDataMap } + +class procedure TdxPSCheckDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); +var + CheckDisplayValue: TcxEditValue; + CheckNullStyle: TcxCheckBoxNullValueShowingStyle; + CheckGlyph: TBitmap; +begin + with TdxReportCellCheckImage(AnItem) do + begin + AProperties.PrepareDisplayValue(AValue, CheckDisplayValue, False); + ButtonEdgeStyle := EdgeStyleMap[ACellParams.FlatCheckMarks]; + CheckNullStyle := cxCheckBoxProperties_GetNullStyle(AProperties); + Checked := (CheckDisplayValue = Integer(cbsChecked)) or ((CheckDisplayValue = Integer(cbsGrayed)) and (CheckNullStyle = nssGrayedChecked)); + Enabled := not ((CheckDisplayValue = Integer(cbsGrayed)) and (CheckNullStyle in [nssInactive, nssGrayedChecked])); + CheckGlyph := cxCheckBoxProperties_GetGlyph(AProperties); + if not CheckGlyph.Empty then + begin + Glyph := CheckGlyph; + GlyphCount := cxCheckBoxProperties_GetGlyphCount(AProperties); + end; + Multiline := cxCheckBoxProperties_GetIsMultilined(AProperties); + TextAlignX := dxTextAlignX[cxCheckBoxProperties_GetAlignment(AProperties)]; + TextAlignY := taCenterY; + end; +end; + +class function TdxPSCheckDataMap.ItemClass(AProperties: TcxCustomEditProperties; + AnIsPreview: Boolean = False): TdxReportCellDataClass; +begin + Result := TdxReportCellCheckImage; +end; + +class function TdxPSCheckDataMap.MeasureWidth(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; AFont: TFont; + ARecordIndex: Integer = 0): Integer; +begin + Result := 2 + dxPSGlbl.CheckWidth + 2; +end; + +class function TdxPSCheckDataMap.PropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomCheckBoxProperties; +end; + +{ TdxPSCustomButtonGroupDataMap } + +class function TdxPSCustomButtonGroupDataMap.ButtonGroupClass(AProperties: TcxCustomEditProperties): TdxCustomReportButtonGroupClass; +begin + Result := TdxCustomReportButtonGroup; +end; + +class procedure TdxPSCustomButtonGroupDataMap.InitializeGroupButton(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; AButton: TdxCustomReportCellCheck; AnIndex: Integer); +begin +end; + +class procedure TdxPSCustomButtonGroupDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); +var + GroupItems: TcxButtonGroupItems; + I: Integer; + Button: TdxCustomReportCellCheck; +begin + inherited; + with TdxCustomReportButtonGroup(AnItem) do + begin + ButtonEdgeStyle := EdgeStyleMap[ACellParams.FlatCheckMarks]; + CheckPos := ccpLeft; + ColumnCount := cxButtonGroupProperties_GetColumnCount(AProperties); + GroupItems := cxButtonGroupProperties_GetItems(AProperties); + for I := 0 to GroupItems.Count - 1 do + begin + Button := Add(cxButtonGroupItem_GetCaption(GroupItems[I])); + InitializeGroupButton(AProperties, AValue, Button, I); + end; + if AViewParams.NativeParams.Font <> nil then + Font := AViewParams.NativeParams.Font; + Indents := dxPSGlbl.NullRect; + InterColumnsMinSpace := 0; + InterRowsMinSpace := 0; + AdjustContent(ACellParams.DC); + for I := 0 to ItemCount - 1 do + Items[I].Visible := True; + end; +end; + +class function TdxPSCustomButtonGroupDataMap.ItemClass(AProperties: TcxCustomEditProperties; + AnIsPreview: Boolean = False): TdxReportCellDataClass; +begin + Result := TdxReportCellDataClass(ButtonGroupClass(AProperties)); +end; + +class function TdxPSCustomButtonGroupDataMap.MeasureWidth(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; AFont: TFont; + ARecordIndex: Integer = 0): Integer; +var + GroupItems: TcxButtonGroupItems; + GroupColumnCount: Integer; + DC: HDC; + MaxColumnWidths: array of Integer; + I, J, V, Index, RowItemCount: Integer; +begin + Result := 0; + GroupItems := cxButtonGroupProperties_GetItems(AProperties); + if GroupItems.Count <> 0 then + begin + DC := ACellParams.DC; + GroupColumnCount := cxButtonGroupProperties_GetColumnCount(AProperties); + + SetLength(MaxColumnWidths, GroupColumnCount); + RowItemCount := GroupColumnCount div GroupItems.Count; + if (GroupColumnCount mod GroupItems.Count) <> 0 then + Inc(RowItemCount); + + for I := 0 to GroupColumnCount - 1 do + for J := 0 to RowItemCount - 1 do + begin + Index := I * RowItemCount + J; + if Index < GroupItems.Count then + begin + V := dxPSMeasureTextWidth(DC, cxButtonGroupItem_GetCaption(GroupItems[Index]), AFont); + if MaxColumnWidths[I] < V then MaxColumnWidths[I] := V; + end; + end; + + for I := 0 to Length(MaxColumnWidths) - 1 do + Inc(Result, MaxColumnWidths[I]); + if Result <> 0 then + begin + Inc(Result, GroupColumnCount * dxPSGlbl.CheckWidth); + Inc(Result, (GroupColumnCount - 1) * dxPSCore.dxRadioGroupInterColumnsMinSpace); + Inc(Result, dxPSCore.dxRadioGroupBoundsIndent + dxPSCore.dxRadioGroupBoundsIndent); + end; + end; +end; + +class function TdxPSCustomButtonGroupDataMap.PropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomButtonGroupProperties; +end; + +{ TdxPSRadioButtonGroupDataMap } + +class function TdxPSRadioButtonGroupDataMap.ButtonGroupClass(AProperties: TcxCustomEditProperties): TdxCustomReportButtonGroupClass; +begin + Result := TdxReportRadioGroup; +end; + +class procedure TdxPSRadioButtonGroupDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); +begin + inherited; + with TdxReportRadioGroup(AnItem) do + ItemIndex := FindItem(cxRadioGroupProperties_GetDisplayText(AProperties, AValue)); +end; + +class function TdxPSRadioButtonGroupDataMap.PropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomRadioGroupProperties; +end; + +{ TdxPSGraphicDataMap } + +class function TdxPSGraphicDataMap.DoesItemParticipateInAutoHeightCalculation(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := True;//lcm: not cxImageProperties_GetStretch(AProperties); +end; + +class function TdxPSGraphicDataMap.DefaultGraphicClass: TGraphicClass; +begin + Result := TBitmap; +end; + +class function TdxPSGraphicDataMap.GetGraphic(AProperties: TcxCustomEditProperties; + AGraphicClass: TGraphicClass; const AValue: TcxEditValue): TGraphic; +begin + if HasGraphic(AValue) then + cxImage.LoadPicture(Picture, AGraphicClass, AValue) + else + Picture.Assign(nil); + Result := Picture.Graphic; +end; + +class function TdxPSGraphicDataMap.GetGraphicClass(AProperties: TcxCustomEditProperties; + ARecordIndex: Integer; AOwner: TObject = nil): TGraphicClass; +begin + Result := cxImageProperties_GetGraphicClass(AProperties, ARecordIndex, AOwner); + if Result = nil then + Result := DefaultGraphicClass; +end; + +class function TdxPSGraphicDataMap.HasGraphic(const AValue: TcxEditValue): Boolean; +begin + Result := not VarIsNull(AValue) and VarIsStr(AValue); +end; + +class procedure TdxPSGraphicDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); +var + GraphicClass: TGraphicClass; +begin + if HasGraphic(AValue) then + GraphicClass := GetGraphicClass(AProperties, ARecordIndex, AOwner) + else + GraphicClass := nil; + + with TdxReportCellGraphic(AnItem) do + begin + Center := cxImageProperties_GetCenter(AProperties); + Image := GetGraphic(AProperties, GraphicClass, AValue); + ImageTransparent := ((GraphicClass <> nil) and GraphicClass.InheritsFrom(TIcon)) or ACellParams.TransparentGraphics; + Stretch := (GraphicClass <> nil) and not GraphicClass.InheritsFrom(TIcon) and cxImageProperties_GetStretch(AProperties); + end; +end; + +class function TdxPSGraphicDataMap.MeasureWidth(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; AFont: TFont; + ARecordIndex: Integer = 0): Integer; +var + GraphicClass: TGraphicClass; +begin + if HasGraphic(AValue) then + begin + GraphicClass := GetGraphicClass(AProperties, ARecordIndex); + Result := GetGraphic(AProperties, GraphicClass, AValue).Width; + end + else + Result := 0; +end; + +class function TdxPSGraphicDataMap.ItemClass(AProperties: TcxCustomEditProperties; + AnIsPreview: Boolean = False): TdxReportCellDataClass; +begin + Result := TdxReportCellGraphic; +end; + +class function TdxPSGraphicDataMap.PropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomImageProperties; +end; + +{ TdxPSGraphicAsTextDataMap } + +class procedure TdxPSGraphicAsTextDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); +begin + TdxReportCellString(AnItem).Text := ACellParams.GraphicsText; + TdxReportCellString(AnItem).TextAlignX := taLeft; + TdxReportCellString(AnItem).TextAlignY := taTop; +end; + +class function TdxPSGraphicAsTextDataMap.ItemClass(AProperties: TcxCustomEditProperties; + AnIsPreview: Boolean = False): TdxReportCellDataClass; +begin + Result := TdxReportCellString; +end; + +class function TdxPSGraphicAsTextDataMap.MeasureWidth(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; AFont: TFont; + ARecordIndex: Integer = 0): Integer; +begin + Result := dxPSMeasureTextWidth(ACellParams.DC, ACellParams.GraphicsText, AFont); +end; + +class function TdxPSGraphicAsTextDataMap.PropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomImageProperties; +end; + +{ TdxPSImageDataMap } + +class function TdxPSImageDataMap.DoesItemParticipateInBestFitCalculation(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := not IsMultilinedText(AProperties); +end; + +class function TdxPSImageDataMap.GetComboBoxItem(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue): TcxImageComboBoxItem; +begin + Result := cxImageComboBoxProperties_FindItemByValue(AProperties, AValue); +end; + +class function TdxPSImageDataMap.GetImageIndex(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue): Integer; +var + CompoBoxItem: TcxImageComboBoxItem; +begin + CompoBoxItem := GetComboBoxItem(AProperties, AValue); + if CompoBoxItem <> nil then + Result := CompoBoxItem.ImageIndex + else + Result := cxImageComboBoxProperties_GetDefaultImageIndex(AProperties); +end; + +class procedure TdxPSImageDataMap.GetImageLists(AProperties: TcxCustomEditProperties; + AProc: TdxPSGetImageListProc); +begin + AProc(GetImages(AProperties)); +end; + +class function TdxPSImageDataMap.GetImages(AProperties: TcxCustomEditProperties): TCustomImageList; +begin + Result := cxImageComboBoxProperties_GetImages(AProperties); +end; + +class function TdxPSImageDataMap.GetText(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue): string; +var + CompoBoxItem: TcxImageComboBoxItem; +begin + Result := ''; + if cxImageComboBoxProperties_GetShowDescription(AProperties) then + begin + CompoBoxItem := GetComboBoxItem(AProperties, AValue); + if CompoBoxItem <> nil then + Result := CompoBoxItem.Description + else + Result := cxImageComboBoxProperties_GetDefaultDescription(AProperties); + end; +end; + +class function TdxPSImageDataMap.HasImages(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := GetImages(AProperties) <> nil; +end; + +class procedure TdxPSImageDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); +begin + inherited; + with TdxReportCellImage(AnItem) do + begin + ImageList := GetImages(AProperties); + ImageIndex := GetImageIndex(AProperties, AValue); + ImageLayout := ImageLayoutMap[cxImageComboBoxProperties_GetImageAlignment(AProperties)]; + MultiLine := IsMultilinedText(AProperties); + if not cxImageComboBoxProperties_GetShowDescription(AProperties) then + begin + ImageLayout := ilImageCenterCenter; + Text := ''; + end; + end; +end; + +class function TdxPSImageDataMap.IsMultilinedText(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := cxImageComboBoxProperties_GetIsMultilined(AProperties); +end; + +class function TdxPSImageDataMap.ItemClass(AProperties: TcxCustomEditProperties; + AnIsPreview: Boolean = False): TdxReportCellDataClass; +begin + Result := TdxReportCellImage; +end; + +class function TdxPSImageDataMap.MeasureWidth(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; AFont: TFont; + ARecordIndex: Integer = 0): Integer; +begin + Result := inherited MeasureWidth(AProperties, AValue, ACellParams, AFont, ARecordIndex); + if HasImages(AProperties) then + Inc(Result, 1 + GetImages(AProperties).Width + 1); +end; + +class function TdxPSImageDataMap.PropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomImageComboBoxProperties; +end; + +{ TdxPSDelegateDataMap } + +class function TdxPSDelegateDataMap.DataMapClass(AProperties: TcxCustomEditProperties): TdxPSDataMapClass; +begin + Result := nil; {actually should be an abstract method, but C++ syntax does not allow us "static virtual abstract" methods :-( } +end; + +class function TdxPSDelegateDataMap.DoesItemParticipateInAutoHeightCalculation(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := DataMapClass(AProperties).DoesItemParticipateInAutoHeightCalculation(AProperties); +end; + +class function TdxPSDelegateDataMap.DoesItemParticipateInAutoWidthCalculation(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := DataMapClass(AProperties).DoesItemParticipateInAutoWidthCalculation(AProperties); +end; + +class function TdxPSDelegateDataMap.DoesItemParticipateInBestFitCalculation(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := DataMapClass(AProperties).DoesItemParticipateInBestFitCalculation(AProperties); +end; + +class procedure TdxPSDelegateDataMap.GetImageLists(AProperties: TcxCustomEditProperties; + AProc: TdxPSGetImageListProc); +begin + DataMapClass(AProperties).GetImageLists(AProperties, AProc); +end; + +class procedure TdxPSDelegateDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); +begin + DataMapClass(AProperties).InitializeItem(AnItem, AProperties, AValue, ACellParams, AViewParams, AnIsPreview, ARecordIndex, AOwner); +end; + +class function TdxPSDelegateDataMap.ItemClass(AProperties: TcxCustomEditProperties; + AnIsPreview: Boolean = False): TdxReportCellDataClass; +begin + Result := DataMapClass(AProperties).ItemClass(nil, AnIsPreview); +end; + +class function TdxPSDelegateDataMap.MeasureWidth(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; AFont: TFont; + ARecordIndex: Integer = 0): Integer; +begin + Result := DataMapClass(AProperties).MeasureWidth(AProperties, AValue, ACellParams, AFont, ARecordIndex); +end; + +{ TdxPSBlobDataMap } + +class function TdxPSBlobDataMap.DataMapClass(AProperties: TcxCustomEditProperties): TdxPSDataMapClass; +const + DataMapClasses: array[TcxBlobPaintStyle] of TdxPSDataMapClass = + (TdxPSBlobDefaultDataMap, TdxPSBlobPictureDataMap, TdxPSBlobTextDataMap); +begin + Result := DataMapClasses[cxBlobEditProperties_GetPaintStyle(AProperties)]; +end; + +class function TdxPSBlobDataMap.PropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomBlobEditProperties; +end; + +{ TdxPSBlobDefaultDataMap } + +class procedure TdxPSBlobDefaultDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); +begin + inherited; + //TdxReportCellString(AnItem).Text := AValue; + TdxReportCellString(AnItem).Text := cxBlobEdit.GetBlobText(AValue, TcxCustomBlobEditProperties(AProperties), False); +end; + +{ TdxPSBlobPictureDataMap } + +class procedure TdxPSBlobPictureDataMap.GetImageLists(AProperties: TcxCustomEditProperties; + AProc: TdxPSGetImageListProc); +begin + AProc(imgBlobImages); +end; + +class procedure TdxPSBlobPictureDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); +const + ImageIndexes: array[TcxBlobEditKind] of Integer = (0, 2, 4, 6, 0); +begin + inherited; + with TdxReportCellGraphic(AnItem) do + begin + ImageList := imgBlobImages; + ImageIndex := ImageIndexes[cxBlobEditProperties_GetEditKind(AProperties)] + Ord(not cxVariants.VarIsSoftNull(AValue)); + Center := True; + end; +end; + +class function TdxPSBlobPictureDataMap.ItemClass(AProperties: TcxCustomEditProperties; + AnIsPreview: Boolean = False): TdxReportCellDataClass; +begin + Result := TdxReportCellGraphic; +end; + +class function TdxPSBlobPictureDataMap.MeasureWidth(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; AFont: TFont; + ARecordIndex: Integer = 0): Integer; +begin + Result := imgBlobImages.Width; +end; + +{ TdxPSBlobTextDataMap } + +class function TdxPSBlobTextDataMap.DoesItemParticipateInAutoWidthCalculation(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := False; +end; + +class function TdxPSBlobTextDataMap.DoesItemParticipateInBestFitCalculation(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := False; +end; + +class procedure TdxPSBlobTextDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = 0; AOwner: TObject = nil); +begin + inherited; + TdxReportCellString(AnItem).Multiline := True;//False; {3.1} + //TdxReportCellString(AnItem).EndEllipsis := True; {3.1} +end; + +{ TdxReportCellPreviewText } + +procedure TdxReportCellPreviewText.Assign(Source: TPersistent); +begin + if Source is TdxReportCellPreviewText then + with TdxReportCellPreviewText(Source) do + begin + Self.MaxLineCount := MaxLineCount; + Self.RightIndent := RightIndent; + end; + inherited; +end; + +procedure TdxReportCellPreviewText.DrawText(DC: HDC); +var + R: TRect; +begin + R := GetTextBounds(DC); + if not IsRectEmpty(R) then + Renderer.DrawTextEx(DC, R, MaxLineCount, LeftIndent, RightIndent, GetText, Font, DTFormat); +end; + +procedure TdxReportCellPreviewText.ReadData(AReader: TdxPSDataReader); +begin + inherited; + MaxLineCount := AReader.ReadInteger; + RightIndent := AReader.ReadInteger; +end; + +procedure TdxReportCellPreviewText.WriteData(AWriter: TdxPSDataWriter); +begin + inherited; + AWriter.WriteInteger(MaxLineCount); + AWriter.WriteInteger(RightIndent); +end; + +function TdxReportCellPreviewText.GetLeftIndent: Integer; +begin + Result := Indent; +end; + +procedure TdxReportCellPreviewText.SetLeftIndent(Value: Integer); +begin + Indent := Value; +end; + +procedure TdxReportCellPreviewText.SetMaxLineCount(Value: Integer); +begin + if Value < 0 then Value := 0; + FMaxLineCount := Value; +end; + +procedure TdxReportCellPreviewText.SetRightIndent(Value: Integer); +begin + if Value < 0 then Value := 0; + FRightIndent := Value; +end; + +{ TdxCustomReportLinkStyles } + +procedure TdxCustomReportLinkStyles.DesignerFinalize; +begin + if ReportLink <> nil then ReportLink.DesignerTabIndex := 0; +end; + +procedure TdxCustomReportLinkStyles.DesignerInitialize; +begin + if ReportLink <> nil then ReportLink.DesignerTabIndex := DesignerTabIndex; +end; + +function TdxCustomReportLinkStyles.DesignerTabIndex: Integer; +begin + Result := 0; +end; + +procedure TdxCustomReportLinkStyles.Changed(AIndex: Integer); +begin + inherited; + if ReportLink <> nil then + ReportLink.StyleChanged(GetStyleCaption(AIndex), Values[AIndex]); +end; + +procedure TdxCustomReportLinkStyles.GetDefaultViewParamsByCaption(const ACaption: string; + AData: Pointer; out AParams: TcxViewParams); +var + Index: Integer; +begin + FillChar(AParams, SizeOf(AParams), 0); + Index := StyleIndexesByCaption[ACaption]; + if Index = -1 then + with AParams do + begin + Bitmap := nil; + Color := clWindow; + Font := ReportLink.Font; + TextColor := Font.Color; + end + else + GetDefaultViewParams(Index, AData, AParams); +end; + +class function TdxCustomReportLinkStyles.GetStyleCaption(AnIndex: Integer): string; +begin + Result := ''; +end; + +function TdxCustomReportLinkStyles.GetStyleByCaption(const Caption: string): TcxStyle; +var + Index: Integer; +begin + Index := StyleIndexesByCaption[Caption]; + if Index <> -1 then + Result := Values[Index] + else + Result := nil; +end; + +{function TdxCustomReportLinkStyles.GetStyleIndexByCaption(const Caption: string): Integer; +begin + for Result := 0 to Count - 1 do + if dxPSUtl.dxSameText(Caption, GetStyleCaption(Items[Result].Index)) then + Exit; + Result := -1; +end;} + +procedure TdxCustomReportLinkStyles.SetStyleByCaption(const Caption: string; Value: TcxStyle); +var + Index: Integer; +begin + Index := StyleIndexesByCaption[Caption]; + if Index <> -1 then + Values[Index] := Value; +end; + +function TdxCustomReportLinkStyles.GetReportLink: TdxCustomcxControlReportLink; +begin + if GetOwner is TdxCustomcxControlReportLink then + Result := TdxCustomcxControlReportLink(GetOwner) + else + Result := nil; +end; + +{ TdxCustomReportLinkStyleSheet } + +class procedure TdxCustomReportLinkStyleSheet.Register; +begin + Classes.RegisterClass(Self); +end; + +class procedure TdxCustomReportLinkStyleSheet.Unregister; +begin + Classes.UnregisterClass(Self); +end; + +{ TdxCustomReportLinkOptions } + +constructor TdxCustomReportLinkOptions.Create(AReportLink: TdxCustomcxControlReportLink); +begin + inherited Create; + FReportLink := AReportLink; + if ReportLink <> nil then ReportLink.AddOptions(Self); + CreateObjects; + RestoreDefaults; + if ReportLink <> nil then ReportLink.LinkModified(False); +end; + +destructor TdxCustomReportLinkOptions.Destroy; +begin + DestroyObjects; + if ReportLink <> nil then ReportLink.RemoveOptions(Self); + inherited; +end; + +procedure TdxCustomReportLinkOptions.Assign(Source: TPersistent); +begin + if Source is TdxCustomReportLinkOptions then + else + inherited; +end; + +procedure TdxCustomReportLinkOptions.RestoreDefaults; +begin +end; + +{ IUnknown } +function TdxCustomReportLinkOptions.QueryInterface(const IID: TGUID; out Obj): HRESULT; +begin + if GetInterface(IID, Obj) then + Result := S_OK + else + Result := E_NOINTERFACE; +end; + +function TdxCustomReportLinkOptions._AddRef: Integer; +begin + Result := -1; +end; + +function TdxCustomReportLinkOptions._Release: Integer; +begin + Result := -1; +end; + +{ IdxReportLinkOptionsDesignerSupport } +procedure TdxCustomReportLinkOptions.DesignerFinalize; +begin + if ReportLink <> nil then ReportLink.DesignerTabIndex := 0; +end; + +procedure TdxCustomReportLinkOptions.DesignerInitialize; +begin + if ReportLink <> nil then ReportLink.DesignerTabIndex := DesignerTabIndex; +end; + +function TdxCustomReportLinkOptions.DesignerTabIndex: Integer; +begin + Result := 0; +end; + +procedure TdxCustomReportLinkOptions.Changed; +begin + if ReportLink <> nil then ReportLink.OptionsChanged(Self); +end; + +procedure TdxCustomReportLinkOptions.Notification(AComponent: TComponent; AOperation: TOperation); +begin +end; + +procedure TdxCustomReportLinkOptions.CreateObjects; +begin +end; + +procedure TdxCustomReportLinkOptions.DestroyObjects; +begin +end; + +procedure TdxCustomReportLinkOptions.DesignerModified; +begin + if ReportLink <> nil then ReportLink.DesignerModified; +end; + +{ TdxGridReportLinkOptionsFormatting } + +procedure TdxCustomReportLinkOptionsFormatting.Assign(Source: TPersistent); +begin + if Source is TdxCustomReportLinkOptionsFormatting then + with TdxCustomReportLinkOptionsFormatting(Source) do + begin + Self.GridLineColor := GridLineColor; + Self.LookAndFeelKind := LookAndFeelKind; + Self.SuppressBackgroundBitmaps := SuppressBackgroundBitmaps; + Self.UseLookAndFeelColors := UseLookAndFeelColors; + Self.UseNativeStyles := UseNativeStyles; + end; + inherited; +end; + +procedure TdxCustomReportLinkOptionsFormatting.RestoreDefaults; +begin + inherited; + GridLineColor := clDefault; + LookAndFeelKind := lfUltraFlat; + SuppressBackgroundBitmaps := False; + UseLookAndFeelColors := False; + UseNativeStyles := False; +end; + +procedure TdxCustomReportLinkOptionsFormatting.SetGridLineColor(Value: TColor); +begin + if FGridLineColor <> Value then + begin + FGridLineColor := Value; + Changed; + end; +end; + +procedure TdxCustomReportLinkOptionsFormatting.SetLookAndFeelKind(Value: TcxLookAndFeelKind); +begin + {$IFDEF DXVER500} + if Value = lfOffice11 then Value := lfFlat; + {$ENDIF} + if FLookAndFeelKind <> Value then + begin + FLookAndFeelKind := Value; + Changed; + end; +end; + +procedure TdxCustomReportLinkOptionsFormatting.SetSuppressBackgroundBitmaps(Value: Boolean); +begin + if FSuppressBackgroundBitmaps <> Value then + begin + FSuppressBackgroundBitmaps := Value; + Changed; + end; +end; + +procedure TdxCustomReportLinkOptionsFormatting.SetUseLookAndFeelColors(Value: Boolean); +begin + if FUseLookAndFeelColors <> Value then + begin + FUseLookAndFeelColors := Value; + if dxThemeManager.AreVisualStylesAvailable then Changed; + end; +end; + +procedure TdxCustomReportLinkOptionsFormatting.SetUseNativeStyles(Value: Boolean); +begin + if FUseNativeStyles <> Value then + begin + FUseNativeStyles := Value; + Changed; + end; +end; + +{ TdxCustomReportLinkOptionsRefinements } + +procedure TdxCustomReportLinkOptionsRefinements.Assign(Source: TPersistent); +begin + if Source is TdxCustomReportLinkOptionsRefinements then + with TdxCustomReportLinkOptionsRefinements(Source) do + begin + Self.DisplayGraphicsAsText := DisplayGraphicsAsText; + Self.FlatCheckMarks := FlatCheckMarks; + Self.GraphicsText := GraphicsText; + Self.TransparentGraphics := TransparentGraphics; + {$IFDEF DXVER500} + Self.TransparentRichEdits := TransparentRichEdits; + {$ENDIF} + Self.FIsGraphicsTextAssigned := FIsGraphicsTextAssigned; + end; + inherited; +end; + +function TdxCustomReportLinkOptionsRefinements.DefaultGraphicsText: string; +begin + Result := cxGetResourceString(@sdxGraphicAsTextValue); +end; + +procedure TdxCustomReportLinkOptionsRefinements.RestoreDefaults; +begin + inherited; + DisplayGraphicsAsText := False; + FlatCheckMarks := True; + GraphicsText := ''; + TransparentGraphics := False; + {$IFDEF DXVER500} + TransparentRichEdits := False; + {$ENDIF} + FIsGraphicsTextAssigned := False; +end; + +procedure TdxCustomReportLinkOptionsRefinements.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('IsGraphicsAsTextAssigned', ReadIsGraphicsTextAssigned, WriteIsGraphicsTextAssigned, + FIsGraphicsTextAssigned and (GraphicsText = '')); +end; + +function TdxCustomReportLinkOptionsRefinements.GetGraphicsText: string; +begin + if FIsGraphicsTextAssigned then + Result := FGraphicsText + else + Result := DefaultGraphicsText; +end; + +function TdxCustomReportLinkOptionsRefinements.IsGraphicsTextStored: Boolean; +begin + Result := FIsGraphicsTextAssigned and (GraphicsText <> DefaultGraphicsText); +end; + +procedure TdxCustomReportLinkOptionsRefinements.SetDisplayGraphicsAsText(Value: Boolean); +begin + if FDisplayGraphicsAsText <> Value then + begin + FDisplayGraphicsAsText := Value; + Changed; + end; +end; + +procedure TdxCustomReportLinkOptionsRefinements.SetFlatCheckMarks(Value: Boolean); +begin + if FFlatCheckMarks <> Value then + begin + FFlatCheckMarks := Value; + Changed; + end; +end; + +procedure TdxCustomReportLinkOptionsRefinements.SetGraphicsText(const Value: string); +begin + if GraphicsText <> Value then + begin + FGraphicsText := Value; + FIsGraphicsTextAssigned := True; + if DisplayGraphicsAsText then Changed; + end; +end; + +procedure TdxCustomReportLinkOptionsRefinements.SetTransparentGraphics(Value: Boolean); +begin + if FTransparentGraphics <> Value then + begin + FTransparentGraphics := Value; + Changed; + end; +end; + +{$IFDEF DXVER500} +procedure TdxCustomReportLinkOptionsRefinements.SetTransparentRichEdits(Value: Boolean); +begin + if FTransparentRichEdits <> Value then + begin + FTransparentRichEdits := Value; + Changed; + end; +end; +{$ENDIF} + +procedure TdxCustomReportLinkOptionsRefinements.ReadIsGraphicsTextAssigned(Reader: TReader); +begin + FIsGraphicsTextAssigned := Reader.ReadBoolean; +end; + +procedure TdxCustomReportLinkOptionsRefinements.WriteIsGraphicsTextAssigned(Writer: TWriter); +begin + Writer.WriteBoolean(FIsGraphicsTextAssigned); +end; + +{ TcxVerticalGridReportLinkOptionsSize } + +procedure TdxCustomReportLinkOptionsSize.Assign(Source: TPersistent); +begin + if Source is TdxCustomReportLinkOptionsSize then + with TdxCustomReportLinkOptionsSize(Source) do + begin + Self.AutoWidth := AutoWidth; + end; + inherited; +end; + +procedure TdxCustomReportLinkOptionsSize.RestoreDefaults; +begin + inherited; + AutoWidth := False; +end; + +procedure TdxCustomReportLinkOptionsSize.SetAutoWidth(Value: Boolean); +begin + if FAutoWidth <> Value then + begin + FAutoWidth := Value; + Changed; + end; +end; + +{ TdxCustomcxControlReportLink } + +constructor TdxCustomcxControlReportLink.Create(AOwner: TComponent); +begin + inherited; + FDelimitersHorz := TList.Create; + FDelimitersVert := TList.Create; + FImageLists := TList.Create; + FOptions := TList.Create; + FStyles := GetStylesClass.Create(Self); + CreateOptions; +end; + +destructor TdxCustomcxControlReportLink.Destroy; +begin + FreeAndNil(FStyles); + FreeAndNil(FImageLists); + FreeAndNil(FDelimitersVert); + FreeAndNil(FDelimitersHorz); + DestroyOptions; + FreeAndNil(FOptions); + inherited; +end; + +procedure TdxCustomcxControlReportLink.Assign(Source: TPersistent); +begin + if Source is TdxCustomcxControlReportLink then + with TdxCustomcxControlReportLink(Source) do + begin + Self.OptionsExpanding := OptionsExpanding; + Self.OptionsFormatting := OptionsFormatting; + Self.OptionsPagination := OptionsPagination; + Self.OptionsRefinements := OptionsRefinements; + Self.OptionsSize := OptionsSize; + Self.OptionsView := OptionsView; + Self.Styles := Styles; + Self.SupportedCustomDraw := SupportedCustomDraw; + end; + inherited; +end; + +procedure TdxCustomcxControlReportLink.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if (AComponent = StyleRepository) and (Operation = opRemove) then + StyleRepository := nil; + NotifyOptions(AComponent, Operation); +end; + +procedure TdxCustomcxControlReportLink.BeforeDesignReport; +begin + DesignWindow.DesignerTabIndex := FDesignerTabIndex; + inherited; +end; + +procedure TdxCustomcxControlReportLink.ConvertCoords; +begin + inherited; + ConvertDelimiters(DelimitersHorz); + ConvertDelimiters(DelimitersVert); +end; + +procedure TdxCustomcxControlReportLink.GetImageLists(AProc: TdxPSGetImageListProc); +var + I: Integer; +begin + for I := 0 to ImageListCount - 1 do + AProc(ImageLists[I]); +end; + +procedure TdxCustomcxControlReportLink.InternalRestoreDefaults; +begin + inherited; + OptionsExpanding.RestoreDefaults; + OptionsFormatting.RestoreDefaults; + OptionsPagination.RestoreDefaults; + OptionsRefinements.RestoreDefaults; + OptionsSize.RestoreDefaults; + OptionsView.RestoreDefaults; + SupportedCustomDraw := False; +end; + +function TdxCustomcxControlReportLink.IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; +begin + Result := SupportedCustomDraw; +end; + +procedure TdxCustomcxControlReportLink.MakeDelimiters(AReportCells: TdxReportCells; + AHorzDelimiters, AVertDelimiters: TList); +begin + inherited; + dxPSUtl.dxCopyList(DelimitersHorz, AHorzDelimiters); + dxPSUtl.dxCopyList(DelimitersVert, AVertDelimiters); +end; + +procedure TdxCustomcxControlReportLink.AddHorizontalDelimiter(ADelimiter: TdxReportCell); +var + R: TRect; +begin + R := ADelimiter.AbsoluteRect; + AddHorizontalDelimiter(R.Left); + AddHorizontalDelimiter(R.Right); +end; + +procedure TdxCustomcxControlReportLink.AddHorizontalDelimiter(ADelimiter: Integer); +begin + FDelimitersHorz.Add(TObject(ADelimiter)); +end; + +procedure TdxCustomcxControlReportLink.AddVerticalDelimiter(ADelimiter: TdxReportCell); +var + R: TRect; +begin + R := ADelimiter.AbsoluteRect; + AddVerticalDelimiter(R.Top); + AddVerticalDelimiter(R.Bottom); +end; + +procedure TdxCustomcxControlReportLink.AddVerticalDelimiter(ADelimiter: Integer); +begin + FDelimitersVert.Add(TObject(ADelimiter)); +end; + +procedure TdxCustomcxControlReportLink.CreateOptions; +begin + FOptionsExpanding := GetOptionsExpandingClass.Create(Self); + FOptionsFormatting := GetOptionsFormattingClass.Create(Self); + FOptionsPagination := GetOptionsPaginationClass.Create(Self); + FOptionsRefinements := GetOptionsRefinementsClass.Create(Self); + FOptionsSize := GetOptionsSizeClass.Create(Self); + FOptionsView := GetOptionsViewClass.Create(Self); +end; + +procedure TdxCustomcxControlReportLink.DestroyOptions; +begin + FreeAndNil(FOptionsView); + FreeAndNil(FOptionsSize); + FreeAndNil(FOptionsRefinements); + FreeAndNil(FOptionsPagination); + FreeAndNil(FOptionsFormatting); + FreeAndNil(FOptionsExpanding); +end; + +function TdxCustomcxControlReportLink.GetOptionsExpandingClass: TdxCustomReportLinkOptionsExpandingClass; +begin + Result := TdxCustomReportLinkOptionsExpanding; +end; + +function TdxCustomcxControlReportLink.GetOptionsFormattingClass: TdxCustomReportLinkOptionsFormattingClass; +begin + Result := TdxCustomReportLinkOptionsFormatting; +end; + +function TdxCustomcxControlReportLink.GetOptionsPaginationClass: TdxCustomReportLinkOptionsPaginationClass; +begin + Result := TdxCustomReportLinkOptionsPagination; +end; + +function TdxCustomcxControlReportLink.GetOptionsRefinementsClass: TdxCustomReportLinkOptionsRefinementsClass; +begin + Result := TdxCustomReportLinkOptionsRefinements; +end; + +function TdxCustomcxControlReportLink.GetOptionsSizeClass: TdxCustomReportLinkOptionsSizeClass; +begin + Result := TdxCustomReportLinkOptionsSize; +end; + +function TdxCustomcxControlReportLink.GetOptionsViewClass: TdxCustomReportLinkOptionsViewClass; +begin + Result := TdxCustomReportLinkOptionsView; +end; + +procedure TdxCustomcxControlReportLink.OptionsChanged(AnOptions: TdxCustomReportLinkOptions); +begin + LinkModified(True); +end; + +procedure TdxCustomcxControlReportLink.AddOptions(AnOptions: TdxCustomReportLinkOptions); +begin + FOptions.Remove(AnOptions); +end; + +procedure TdxCustomcxControlReportLink.NotifyOptions(AComponent: TComponent; AOperation: TOperation); +var + I: Integer; +begin + for I := 0 to OptionsCount - 1 do + Options[I].Notification(AComponent, AOperation); +end; + +procedure TdxCustomcxControlReportLink.RemoveOptions(AnOptions: TdxCustomReportLinkOptions); +begin + FOptions.Add(AnOptions); +end; + +procedure TdxCustomcxControlReportLink.AppendImageList(AnImageList: TCustomImageList); +begin + if (AnImageList <> nil) and (FImageLists.IndexOf(AnImageList) = -1) then + FImageLists.Add(AnImageList); +end; + +function TdxCustomcxControlReportLink.CanCreateComponent: Boolean; +begin +{$IFDEF DELPHI5} + Result := (Owner = nil) or not (csInline in Owner.ComponentState); +{$ELSE} + Result := True; +{$ENDIF} +end; + +procedure TdxCustomcxControlReportLink.ConvertDelimiters(ADelimiters: TList); +var + I, Value: Integer; +begin + for I := 0 to ADelimiters.Count - 1 do + begin + Value := Integer(ADelimiters[I]); + Value := MulDiv(Value, PixelsNumerator, PixelsDenominator); + ADelimiters[I] := Pointer(Value); + end; +end; + +function TdxCustomcxControlReportLink.CreateStyle(const ACaption: string): TcxStyle; +begin + Result := GetStyleRepository.CreateItemEx(TcxStyle, GetChildComponentOwner) as TcxStyle; + if IsDesigning then + Result.Name := GetUniqueName(GetChildComponentOwner, DropT(TcxStyle.ClassName)); + StyleRestoreDefaults(ACaption, Result); + Styles.StylesByCaption[ACaption] := Result; +end; + +function TdxCustomcxControlReportLink.CreateStyleRepository: TcxStyleRepository; +begin + Result := TcxStyleRepository.Create(Owner); + if IsDesigning then + begin + Result.Name := GetUniqueName(Owner, DropT(TcxStyleRepository.ClassName)); + DesignerModified; + MessageWarning(Format(cxGetResourceString(@sdxNewStyleRepositoryWasCreated), [Result.Name])); + end; +end; + +function TdxCustomcxControlReportLink.CreateStyleSheet(APrototype: TcxCustomStyleSheet; + const ACaption: string; AUseStyles: Boolean): TdxCustomReportLinkStyleSheet; +var + Styles: TStrings; + I: Integer; + NewStyles: TdxCustomReportLinkStyles; + Style: TcxStyle; + StyleCaption: string; +begin + Result := GetStyleRepository.CreateStyleSheetEx(GetStyleSheetClass, GetChildComponentOwner) as TdxCustomReportLinkStyleSheet; + if IsDesigning then + Result.Name := GetUniqueName(GetChildComponentOwner, DropT(GetStyleSheetClass.ClassName)); + Result.Caption := ACaption; + + if AUseStyles then + begin + DesignWindow.GetStyleNames(Styles); + NewStyles := TdxCustomReportLinkStyles(Result.GetStyles); + for I := 0 to Styles.Count - 1 do + begin + StyleCaption := Styles[I]; + Style := TcxStyle(Styles.Objects[I]); + InitiateStyle(StyleCaption, Style, Style = nil);// or (Style.AssignedValues = [])); + NewStyles.StylesByCaption[StyleCaption] := Style; + end; + end + else + begin + if APrototype = nil then + APrototype := GetStyleSheetPrototype; + if APrototype <> nil then + begin + Result.CopyFrom(APrototype); + if IsDesigning then + for I := 0 to cxStyles_GetCount(Result.GetStyles) - 1 do + begin + Style := TcxStyle(Result.GetStyles.Values[I]); + if Style <> nil then + Style.Name := GetUniqueName(GetChildComponentOwner, DropT(TcxStyle.ClassName)); + end; + end; + end; +end; + +function TdxCustomcxControlReportLink.FindStyleRepositoryInStyles(AStyles: TcxStyles): TcxStyleRepository; +var + I: Integer; + cxStyle: TcxCustomStyle; + StyleSheet: TcxCustomStyleSheet; +begin + for I := 0 to cxStyles_GetCount(AStyles) - 1 do + begin + cxStyle := AStyles.Values[I]; + if cxStyle <> nil then + begin + Result := cxStyle.StyleRepository; + if Result <> nil then + Exit; + end; + end; + Result := nil; + + StyleSheet := cxStyles_GetStyleSheet(AStyles); + if StyleSheet <> nil then + Result := StyleSheet.StyleRepository; +end; + +function TdxCustomcxControlReportLink.GetChildComponentOwner: TComponent; +begin + Result := GetStyleRepository.Owner; +end; + +function TdxCustomcxControlReportLink.GetStyleConsumerCount(AStyle: TcxStyle): Integer; + + function GetStyleConsumerCountInStyles(AStyles: TcxCustomStyles): Integer; + var + I: Integer; + begin + Result := 0; + for I := 0 to cxStyles_GetCount(AStyles) - 1 do + if AStyles.Values[I] = AStyle then + Inc(Result); + + if (Result = 0) and (cxStyles_GetStyleSheet(AStyles) <> nil) then + begin + I := GetStyleConsumerCountInStyles(cxStyles_GetStyleSheet(AStyles).GetStyles); + Inc(Result, I); + end; + end; + +begin + Result := GetStyleConsumerCountInStyles(Styles); +end; + +function TdxCustomcxControlReportLink.GetStyleRepository: TcxStyleRepository; +begin + Result := FStyleRepository; + if Result = nil then + begin + Result := FindStyleRepositoryInStyles(Styles); + if (Result = nil) and CanCreateComponent then + begin + FStyleRepository := CreateStyleRepository; + Result := FStyleRepository; + end; + end; +end; + +function TdxCustomcxControlReportLink.GetStyleSheetCaption(ACheckProc: TdxStyleSheetHasCaptionProc; + var ACaption: string): Boolean; + + function QueryStyleSheetCaption(var ACaption: string): Boolean; + begin + Result := InputQuery(Application.Title, cxGetResourceString(@sdxCreateNewStyleQueryNamePrompt), ACaption); + end; + + procedure Error(const ACaption: string); + begin + MessageError(Format(cxGetResourceString(@sdxStyleSheetNameAlreadyExists), [ACaption])); + end; + +var + Unnamed: string; + I: Integer; +begin + if ACaption = '' then + begin + I := 1; + Unnamed := cxGetResourceString(@sdxUnnamedStyleSheet); + repeat + ACaption := Unnamed + ' <' + IntToStr(I) + '>'; + Inc(I); + until not ACheckProc(ACaption) or (I = MaxInt); + end; + + repeat + Result := QueryStyleSheetCaption(ACaption); + if Result and ACheckProc(ACaption) then + Error(ACaption); + until not Result or not ACheckProc(ACaption); +end; + +function TdxCustomcxControlReportLink.InitiateStyle(const ACaption: string; + var AStyle: TcxStyle; AForceCreation: Boolean): Boolean; +begin + Result := AForceCreation or (AStyle = nil) or (GetStyleConsumerCount(AStyle) > 1); + if Result then + AStyle := CreateStyle(ACaption); +end; + +procedure TdxCustomcxControlReportLink.StyleRestoreDefaults(const ACaption: string; + AStyle: TcxStyle); +var + Params: TcxViewParams; +begin + Styles.GetDefaultViewParamsByCaption(ACaption, nil, Params); + with AStyle do + begin + Bitmap.Assign(Params.Bitmap); + Color := Params.Color; + Font := Params.Font; + TextColor := Params.TextColor; + end; +end; + +procedure TdxCustomcxControlReportLink.StyleChanged(const ACaption: string; + AStyle: TcxStyle); +begin + if DesignWindow <> nil then + DesignWindow.DoStyleChanged(ACaption, AStyle); + LinkModified(True); +end; + +function TdxCustomcxControlReportLink.GetAreNativeStylesAvailable: Boolean; +begin + Result := False; +end; + +function TdxCustomcxControlReportLink.GetStylesClass: TdxCustomReportLinkStylesClass; +begin + Result := TdxCustomReportLinkStyles; +end; + +function TdxCustomcxControlReportLink.GetStyleSheetClass: TdxCustomReportLinkStyleSheetClass; +begin + Result := TdxCustomReportLinkStyleSheet; +end; + +function TdxCustomcxControlReportLink.GetStyleSheetPrototype: TdxCustomReportLinkStyleSheet; +begin + Result := nil; +end; + +procedure TdxCustomcxControlReportLink.PrepareConstruct; +begin + FScreenDC := GetDC(0); + FDelimitersHorz.Clear; + FDelimitersVert.Clear; + FImageLists.Clear; + if OptionsRefinements.DisplayGraphicsAsText then + TdxPSGraphicAsTextDataMap.Register; +end; + +procedure TdxCustomcxControlReportLink.UnprepareConstruct; +begin + if OptionsRefinements.DisplayGraphicsAsText then + TdxPSGraphicAsTextDataMap.Unregister; + ReleaseDC(0, FScreenDC); +end; + +function TdxCustomcxControlReportLink.GetActiveStyles: TdxCustomReportLinkStyles; +begin + Result := Styles; + if Result.StyleSheet <> nil then + Result := Result.StyleSheet.GetStyles as TdxCustomReportLinkStyles; +end; + +function TdxCustomcxControlReportLink.GetDesignWindow: TdxfmCustomcxControlReportLinkDesignWindow; +begin + Result := inherited DesignWindow as TdxfmCustomcxControlReportLinkDesignWindow; +end; + +function TdxCustomcxControlReportLink.GetEffects3D: Boolean; +begin + Result := OptionsFormatting.LookAndFeelKind <> lfUltraFlat; +end; + +function TdxCustomcxControlReportLink.GetImageList(Index: Integer): TCustomImageList; +begin + Result := TCustomImageList(FImageLists[Index]); +end; + +function TdxCustomcxControlReportLink.GetImageListCount: Integer; +begin + Result := FImageLists.Count; +end; + +function TdxCustomcxControlReportLink.GetOptions(Index: Integer): TdxCustomReportLinkOptions; +begin + Result := TdxCustomReportLinkOptions(FOptions[Index]); +end; + +function TdxCustomcxControlReportLink.GetOptionsCount: Integer; +begin + if FOptions <> nil then + Result := FOptions.Count + else + Result := 0; +end; + +function TdxCustomcxControlReportLink.GetSoft3D: Boolean; +begin + Result := OptionsFormatting.LookAndFeelKind = lfFlat; +end; + +procedure TdxCustomcxControlReportLink.SetOptionsExpanding(Value: TdxCustomReportLinkOptionsExpanding); +begin + OptionsExpanding.Assign(Value); +end; + +procedure TdxCustomcxControlReportLink.SetOptionsFormatting(Value: TdxCustomReportLinkOptionsFormatting); +begin + OptionsFormatting.Assign(Value); +end; + +procedure TdxCustomcxControlReportLink.SetOptionsPagination(Value: TdxCustomReportLinkOptionsPagination); +begin + OptionsPagination.Assign(Value); +end; + +procedure TdxCustomcxControlReportLink.SetOptionsRefinements(Value: TdxCustomReportLinkOptionsRefinements); +begin + OptionsRefinements.Assign(Value); +end; + +procedure TdxCustomcxControlReportLink.SetOptionsSize(Value: TdxCustomReportLinkOptionsSize); +begin + OptionsSize.Assign(Value); +end; + +procedure TdxCustomcxControlReportLink.SetOptionsView(Value: TdxCustomReportLinkOptionsView); +begin + OptionsView.Assign(Value); +end; + +procedure TdxCustomcxControlReportLink.SetStyleRepository(Value: TcxStyleRepository); +begin + if FStyleRepository <> Value then + begin + FStyleRepository := Value; + if FStyleRepository <> nil then + FStyleRepository.FreeNotification(Self); + end; +end; + +procedure TdxCustomcxControlReportLink.SetStyles(Value: TdxCustomReportLinkStyles); +begin + Styles.Assign(Value); +end; + +procedure TdxCustomcxControlReportLink.SetSupportedCustomDraw(Value: Boolean); +begin + if FSupportedCustomDraw <> Value then + begin + FSupportedCustomDraw := Value; + LinkModified(True); + end; +end; + +{ TdxCustomTableControlReportLinkOptions } + +function TdxCustomTableControlReportLinkOptions.GetReportLink: TdxCustomTableControlReportLink; +begin + Result := inherited ReportLink as TdxCustomTableControlReportLink; +end; + +{ TdxCustomTableControlReportLinkOptionsOnEveryPage } + +procedure TdxCustomTableControlReportLinkOptionsOnEveryPage.Assign(Source: TPersistent); +begin + if Source is TdxCustomTableControlReportLinkOptionsOnEveryPage then + with TdxCustomTableControlReportLinkOptionsOnEveryPage(Source) do + begin + Self.BandHeaders := BandHeaders; + Self.Footers := Footers; + Self.Headers := Headers; + end; + inherited; +end; + +procedure TdxCustomTableControlReportLinkOptionsOnEveryPage.RestoreDefaults; +begin + inherited; + BandHeaders := True; + Headers := True; + Footers := True; +end; + +procedure TdxCustomTableControlReportLinkOptionsOnEveryPage.SetBandHeaders(Value: Boolean); +begin + if FBandHeaders <> Value then + begin + FBandHeaders := Value; + Changed; + end; +end; + +procedure TdxCustomTableControlReportLinkOptionsOnEveryPage.SetFooters(Value: Boolean); +begin + if FFooters <> Value then + begin + FFooters := Value; + Changed; + end; +end; + +procedure TdxCustomTableControlReportLinkOptionsOnEveryPage.SetHeaders(Value: Boolean); +begin + if FHeaders <> Value then + begin + FHeaders := Value; + Changed; + end; +end; + +{ TdxCustomTableControlReportLinkOptionsPagination } + +procedure TdxCustomTableControlReportLinkOptionsPagination.Assign(Source: TPersistent); +begin + if Source is TdxCustomTableControlReportLinkOptionsPagination then + with TdxCustomTableControlReportLinkOptionsPagination(Source) do + begin + Self.Band := Band; + Self.Column := Column; + Self.Custom := Custom; + Self.Row := Row; + end; + inherited; +end; + +procedure TdxCustomTableControlReportLinkOptionsPagination.RestoreDefaults; +begin + inherited; + Band := False; + Column := True; + Custom := False; + Row := True; +end; + +function TdxCustomTableControlReportLinkOptionsPagination.GetColumn: Boolean; +begin + Result := ReportLink.UseHorzDelimiters; +end; + +function TdxCustomTableControlReportLinkOptionsPagination.GetRow: Boolean; +begin + Result := ReportLink.UseVertDelimiters; +end; + +procedure TdxCustomTableControlReportLinkOptionsPagination.SetBand(Value: Boolean); +begin + if FBand <> Value then + begin + FBand := Value; + if Value then + Column := False; + Changed; + end; +end; + +procedure TdxCustomTableControlReportLinkOptionsPagination.SetColumn(Value: Boolean); +begin + ReportLink.UseHorzDelimiters := Value; + if Value then + Band := False; +end; + +procedure TdxCustomTableControlReportLinkOptionsPagination.SetCustom(Value: Boolean); +begin + if FCustom <> Value then + begin + FCustom := Value; + Changed; + end; +end; + +procedure TdxCustomTableControlReportLinkOptionsPagination.SetRow(Value: Boolean); +begin + ReportLink.UseVertDelimiters := Value; +end; + +{ TdxCustomTableControlReportLinkOptionsPreview } + +procedure TdxCustomTableControlReportLinkOptionsPreview.Assign(Source: TPersistent); +begin + if Source is TdxCustomTableControlReportLinkOptionsPreview then + with TdxCustomTableControlReportLinkOptionsPreview(Source) do + begin + Self.AutoHeight := AutoHeight; + Self.MaxLineCount := MaxLineCount; + Self.Visible := Visible; + end; + inherited; +end; + +procedure TdxCustomTableControlReportLinkOptionsPreview.RestoreDefaults; +begin + inherited; + AutoHeight := True; + MaxLineCount := 0; + Visible := True; +end; + +procedure TdxCustomTableControlReportLinkOptionsPreview.SetAutoHeight(Value: Boolean); +begin + if FAutoHeight <> Value then + begin + FAutoHeight := Value; + if Visible then Changed; + end; +end; + +procedure TdxCustomTableControlReportLinkOptionsPreview.SetMaxLineCount(Value: Integer); +begin + if Value < 0 then Value := 0; + if FMaxLineCount <> Value then + begin + FMaxLineCount := Value; + if Visible then Changed; + end; +end; + +procedure TdxCustomTableControlReportLinkOptionsPreview.SetVisible(Value: Boolean); +begin + if FVisible <> Value then + begin + FVisible := Value; + Changed; + end; +end; + +{ TdxCustomTableControlReportLinkOptionsSelection } + +procedure TdxCustomTableControlReportLinkOptionsSelection.Assign(Source: TPersistent); +begin + if Source is TdxCustomTableControlReportLinkOptionsSelection then + with TdxCustomTableControlReportLinkOptionsSelection(Source) do + begin + Self.ProcessExactSelection := ProcessExactSelection; + Self.ProcessSelection := ProcessSelection; + end; + inherited; +end; + +procedure TdxCustomTableControlReportLinkOptionsSelection.RestoreDefaults; +begin + inherited; + ProcessExactSelection := False; + ProcessSelection := False; +end; + +procedure TdxCustomTableControlReportLinkOptionsSelection.SetProcessExactSelection(Value: Boolean); +begin + if FProcessExactSelection <> Value then + begin + FProcessExactSelection := Value; + if ProcessSelection then Changed; + end; +end; + +procedure TdxCustomTableControlReportLinkOptionsSelection.SetProcessSelection(Value: Boolean); +begin + if FProcessSelection <> Value then + begin + FProcessSelection := Value; + Changed; + end; +end; + +{ TdxCustomTableControlReportLinkOptionsView } + +procedure TdxCustomTableControlReportLinkOptionsView.Assign(Source: TPersistent); +begin + if Source is TdxCustomTableControlReportLinkOptionsView then + with TdxCustomTableControlReportLinkOptionsView(Source) do + begin + Self.BandHeaders := BandHeaders; + Self.ExpandButtons := ExpandButtons; + Self.Footers := Footers; + Self.Headers := Headers; + end; + inherited; +end; + +procedure TdxCustomTableControlReportLinkOptionsView.RestoreDefaults; +begin + inherited; + BandHeaders := True; + ExpandButtons := True; + Footers := True; + Headers := True; +end; + +procedure TdxCustomTableControlReportLinkOptionsView.SetBandHeaders(Value: Boolean); +begin + if FBandHeaders <> Value then + begin + FBandHeaders := Value; + Changed; + end; +end; + +procedure TdxCustomTableControlReportLinkOptionsView.SetExpandButtons(Value: Boolean); +begin + if FExpandButtons <> Value then + begin + FExpandButtons := Value; + Changed; + end; +end; + +procedure TdxCustomTableControlReportLinkOptionsView.SetFooters(Value: Boolean); +begin + if FFooters <> Value then + begin + FFooters := Value; + Changed; + end; +end; + +procedure TdxCustomTableControlReportLinkOptionsView.SetHeaders(Value: Boolean); +begin + if FHeaders <> Value then + begin + FHeaders := Value; + Changed; + end; +end; + +{ TdxCustomTableControlReportLink } + +procedure TdxCustomTableControlReportLink.Assign(Source: TPersistent); +begin + if Source is TdxCustomTableControlReportLink then + with TdxCustomTableControlReportLink(Source) do + begin + Self.OptionsOnEveryPage := OptionsOnEveryPage; + Self.OptionsPreview := OptionsPreview; + Self.OptionsSelection := OptionsSelection; + end; + inherited; +end; + +procedure TdxCustomTableControlReportLink.InternalRestoreDefaults; +begin + inherited; + OptionsOnEveryPage.RestoreDefaults; + OptionsPreview.RestoreDefaults; + OptionsSelection.RestoreDefaults; +end; + +procedure TdxCustomTableControlReportLink.CreateOptions; +begin + inherited; + FOptionsOnEveryPage := GetOptionsOnEveryPageClass.Create(Self); + FOptionsPreview := GetOptionsPreviewClass.Create(Self); + FOptionsSelection := GetOptionsSelectionClass.Create(Self); +end; + +procedure TdxCustomTableControlReportLink.DestroyOptions; +begin + FreeAndNil(FOptionsSelection); + FreeAndNil(FOptionsPreview); + FreeAndNil(FOptionsOnEveryPage); + inherited; +end; + +function TdxCustomTableControlReportLink.GetOptionsOnEveryPageClass: TdxCustomTableControlReportLinkOptionsOnEveryPageClass; +begin + Result := TdxCustomTableControlReportLinkOptionsOnEveryPage; +end; + +function TdxCustomTableControlReportLink.GetOptionsPaginationClass: TdxCustomReportLinkOptionsPaginationClass; +begin + Result := TdxCustomReportLinkOptionsPagination; +end; + +function TdxCustomTableControlReportLink.GetOptionsPreviewClass: TdxCustomTableControlReportLinkOptionsPreviewClass; +begin + Result := TdxCustomTableControlReportLinkOptionsPreview; +end; + +function TdxCustomTableControlReportLink.GetOptionsSelectionClass: TdxCustomTableControlReportLinkOptionsSelectionClass; +begin + Result := TdxCustomTableControlReportLinkOptionsSelection; +end; + +function TdxCustomTableControlReportLink.GetOptionsViewClass: TdxCustomReportLinkOptionsViewClass; +begin + Result := TdxCustomTableControlReportLinkOptionsView; +end; + +function TdxCustomTableControlReportLink.GetOptionsPagination: TdxCustomTableControlReportLinkOptionsPagination; +begin + Result := inherited OptionsPagination as TdxCustomTableControlReportLinkOptionsPagination; +end; + +function TdxCustomTableControlReportLink.GetOptionsView: TdxCustomTableControlReportLinkOptionsView; +begin + Result := inherited OptionsView as TdxCustomTableControlReportLinkOptionsView; +end; + +procedure TdxCustomTableControlReportLink.SetOptionsOnEveryPage(Value: TdxCustomTableControlReportLinkOptionsOnEveryPage); +begin + OptionsOnEveryPage.Assign(Value); +end; + +procedure TdxCustomTableControlReportLink.SetOptionsPagination(Value: TdxCustomTableControlReportLinkOptionsPagination); +begin + inherited OptionsPagination := Value; +end; + +procedure TdxCustomTableControlReportLink.SetOptionsPreview(Value: TdxCustomTableControlReportLinkOptionsPreview); +begin + OptionsPreview.Assign(Value); +end; + +procedure TdxCustomTableControlReportLink.SetOptionsSelection(Value: TdxCustomTableControlReportLinkOptionsSelection); +begin + OptionsSelection.Assign(Value); +end; + +procedure TdxCustomTableControlReportLink.SetOptionsView(Value: TdxCustomTableControlReportLinkOptionsView); +begin + inherited OptionsView := Value; +end; + +{ TdxfmCustomcxControlReportLinkDesignWindow } + +procedure TdxfmCustomcxControlReportLinkDesignWindow.DoInitialize; +begin + inherited; + RefreshStyleSheetList; +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.CanCopyStyleSheet: Boolean; +begin + Result := CanCreateStyleSheet and (ActiveStyleSheet <> nil); +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.CanCreateStyleSheet: Boolean; +begin + Result := AreNativeStylesAvailable and ReportLink.CanCreateComponent; +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.CanDeleteStyleSheet: Boolean; +begin + Result := AreNativeStylesAvailable and (ActiveStyleSheet <> nil) and + (IsDesigning or not ActiveStyleSheet.BuiltIn); +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.CanRenameStyleSheet: Boolean; +begin + Result := AreNativeStylesAvailable and (ActiveStyleSheet <> nil) and + (IsDesigning or not ActiveStyleSheet.BuiltIn); +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.CanSaveStyles: Boolean; +begin + Result := AreNativeStylesAvailable and ReportLink.CanCreateComponent; +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.PerformStyleSheetCopy: Boolean; +var + Caption: string; +begin + Result := CanCopyStyleSheet; + if Result then + begin + Caption := ''; + if (ActiveStyleSheet <> nil) and (ActiveStyleSheet.Caption <> '') then + Caption := cxGetResourceString(@sdxCopyOfItem) + ActiveStyleSheet.Caption; + + Result := GetStyleSheetCaption(Caption); + if Result then + begin + ActiveStyleSheet := ReportLink.CreateStyleSheet(ActiveStyleSheet, Caption, False); + RefreshStyleSheetList; + end; + end; +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.PerformStyleSheetDelete: Boolean; + + function QueryDeleteStyleSheet(AStyleSheet: TcxCustomStyleSheet): Boolean; + begin + Result := dxPSUtl.MessageQuestion(Format(cxGetResourceString(@sdxDeleteStyleSheet), [AStyleSheet.Caption])); + end; + +var + StyleSheet: TcxCustomStyleSheet; + Index: Integer; +begin + Result := CanDeleteStyleSheet; + if Result then + begin + StyleSheet := ActiveStyleSheet; + Result := (StyleSheet <> nil) and QueryDeleteStyleSheet(StyleSheet); + if Result then + begin + Index := StyleSheet.Index; + StyleSheet.Free; + if Index >= StyleRepository.StyleSheetCount then + Index := StyleRepository.StyleSheetCount - 1; + if Index <> -1 then + ActiveStyleSheet := StyleRepository.StyleSheets[Index]; + RefreshStyleSheetList; + end; + end; +end; + +procedure TdxfmCustomcxControlReportLinkDesignWindow.PerformStyleSheetDrawItem(ACanvas: TCanvas; + AnIndex: Integer; R: TRect; AState: TOwnerDrawState; AEnabled: Boolean); + + function CalculateMaxWidth(AStrings: TStrings): Integer; + var + I, W: Integer; + begin + Result := 0; + with AStrings do + for I := 0 to Count - 1 do + begin + W := ACanvas.TextWidth(Strings[I]); + if Result < W then Result := W; + end; + end; + +var + StyleSheets: TStrings; + StyleSheet: TcxCustomStyleSheet; + X, Y, W: Integer; + S: string; +begin + with ACanvas do + begin + FillRect(R); + + GetStyleSheetNames(StyleSheets); + if StyleSheets <> nil then + begin + with R do + begin + X := Left + 2; + Y := Top + (Bottom - Top - TextHeight('Wq')) div 2; + end; + S := StyleSheets[AnIndex]; + if not AEnabled then + Font.Color := clBtnShadow; + TextOut(X, Y, S); + + if not IsDesigning then + begin + StyleSheet := TcxCustomStyleSheet(StyleSheets.Objects[AnIndex]); + if StyleSheet.BuiltIn then + S := cxGetResourceString(@sdxBuiltIn) + else + S := cxGetResourceString(@sdxUserDefined); + W := CalculateMaxWidth(StyleSheets); + if W <> 0 then + X := R.Left + W + 15; + + if not (odSelected in AState) and AEnabled then + Font.Color := clBlue; + TextOut(X, Y, S); + Font.Color := clWindowText; + end; + end; + end; +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.PerformStyleSheetKeyDown(Sender: TObject; + var AKey: Word; AShift: TShiftState): Boolean; +begin + Result := True; + case AKey of + VK_F2: + Result := PerformStyleSheetRename; + VK_INSERT: + if ssCtrl in AShift then + Result := PerformStyleSheetCopy + else + Result := PerformStyleSheetNew; + VK_DELETE: + Result := PerformStyleSheetDelete; + end; +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.PerformStyleSheetNew: Boolean; +var + Caption: string; +begin + Caption := ''; + Result := CanCreateStyleSheet and GetStyleSheetCaption(Caption); + if Result then + begin + ActiveStyleSheet := ReportLink.CreateStyleSheet(nil, Caption, False); + RefreshStyleSheetList; + end; +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.PerformStyleSheetRename: Boolean; +var + Caption: string; +begin + Caption := ActiveStyleSheet.Caption; + Result := CanRenameStyleSheet and GetStyleSheetCaption(Caption); + if Result then + begin + ActiveStyleSheet.Caption := Caption; + RefreshStyleSheetList; + end; +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.PerformStylesChangeBitmap: Boolean; + + procedure ShowError(const AFileName: string); + begin + dxPSUtl.MessageError(Format(cxGetResourceString(@sdxCannotLoadImage), [AFileName])); + end; + +var + Styles: TStrings; + Picture: TPicture; + I: Integer; + cxStyle: TcxStyle; +begin + Styles := TStringList.Create; + try + GetSelectedStyleNames(Styles); + Result := Styles.Count <> 0; + if Result then + begin + Picture := TPicture.Create; + try + Result := dxPSPictureDialog.Execute; + if Result then + begin + try + Picture.LoadFromFile(dxPSPictureDialog.FileName); + dxPSUtl.ForcePictureToBitmap(Picture); + except + ShowError(dxPSPictureDialog.FileName); + raise; + end; + + for I := 0 to Styles.Count - 1 do + begin + cxStyle := TcxStyle(Styles.Objects[I]); + InitiateStyle(Styles[I], cxStyle, False); + cxStyle.Bitmap := Picture.Bitmap; + end; + DoStylesChanged(Styles, False); + end; + finally + Picture.Free; + end; + end; + finally + Styles.Free; + end; +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.PerformStylesChangeColor: Boolean; +var + Styles: TStrings; + I: Integer; + cxStyle: TcxStyle; + Params: TcxViewParams; + StyleColor: TColor; +begin + Styles := TStringList.Create; + try + GetSelectedStyleNames(Styles); + Result := Styles.Count <> 0; + if Result then + begin + cxStyle := TcxStyle(Styles.Objects[0]); + if cxStyle = nil then + begin + ReportLink.Styles.GetDefaultViewParamsByCaption(Styles[0], nil, Params); + StyleColor := Params.Color; + end + else + StyleColor := cxStyle.Color; + dxPSGlbl.ColorDialog.Color := StyleColor; + + Result := dxPSGlbl.ColorDialog.Execute; + if Result then + begin + for I := 0 to Styles.Count - 1 do + begin + cxStyle := TcxStyle(Styles.Objects[I]); + InitiateStyle(Styles[I], cxStyle, False); + cxStyle.Color := dxPSGlbl.ColorDialog.Color; + end; + DoStylesChanged(Styles, False); + end; + end; + finally + Styles.Free; + end; +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.PerformStylesChangeFont: Boolean; +var + Styles: TStrings; + I: Integer; + cxStyle: TcxStyle; + Params: TcxViewParams; + StyleFont: TFont; +begin + Styles := TStringList.Create; + try + GetSelectedStyleNames(Styles); + Result := Styles.Count <> 0; + if Result then + begin + cxStyle := TcxStyle(Styles.Objects[0]); + if cxStyle = nil then + begin + ReportLink.Styles.GetDefaultViewParamsByCaption(Styles[0], nil, Params); + StyleFont := Params.Font; + StyleFont.Color := Params.TextColor; + end + else + begin + StyleFont := cxStyle.Font; + StyleFont.Color := cxStyle.TextColor; + end; + dxPSGlbl.FontDialog.Font := StyleFont; + + Result := dxPSGlbl.FontDialog.Execute; + if Result then + begin + for I := 0 to Styles.Count - 1 do + begin + cxStyle := TcxStyle(Styles.Objects[I]); + InitiateStyle(Styles[I], cxStyle, False); + cxStyle.Font := dxPSGlbl.FontDialog.Font; + cxStyle.TextColor := cxStyle.Font.Color; + end; + DoStylesChanged(Styles, True); + end; + end; + finally + Styles.Free; + end; +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.PerformStylesClearBitmap: Boolean; +var + Names: TStrings; + I: Integer; + cxStyle: TcxStyle; +begin + Names := TStringList.Create; + try + GetSelectedStyleNames(Names); + Result := Names.Count <> 0; + + for I := 0 to Names.Count - 1 do + begin + cxStyle := TcxStyle(Names.Objects[I]); + if cxStyle <> nil then + cxStyle.Bitmap := nil; + end; + DoStylesChanged(Names, False); + finally + Names.Free; + end; +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.PerformStylesRestoreDefaults: Boolean; +var + Names: TStrings; + I: Integer; + cxStyle: TcxStyle; +begin + Names := TStringList.Create; + try + GetSelectedStyleNames(Names); + Result := Names.Count <> 0; + for I := 0 to Names.Count - 1 do + begin + cxStyle := TcxStyle(Names.Objects[I]); + if cxStyle <> nil then + ReportLink.StyleRestoreDefaults(Names[I], cxStyle); + end; + DoStylesChanged(Names, True); + finally + Names.Free; + end; +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.PerformStylesSaveAsStyleSheet: Boolean; +var + Caption: string; +begin + Caption := ''; + Result := CanSaveStyles and GetStyleSheetCaption(Caption); + if Result then + begin + ActiveStyleSheet := ReportLink.CreateStyleSheet(nil, Caption, True); + RefreshStyleSheetList; + end; +end; + +procedure TdxfmCustomcxControlReportLinkDesignWindow.RefreshStyleSheetList; +var + Names: TStrings; + K, I: Integer; + Unnamed, S: string; + StyleSheet: TcxCustomStyleSheet; +begin + GetStyleSheetNames(Names); + if Names <> nil then + begin + Names.BeginUpdate; + try + Names.Clear; + if StyleRepository <> nil then + begin + K := 0; + Unnamed := cxGetResourceString(@sdxUnnamedStyleSheet); + for I := 0 to StyleRepository.StyleSheetCount - 1 do + begin + StyleSheet := StyleRepository.StyleSheets[I]; + if StyleSheet is ReportLink.GetStyleSheetClass then + begin + S := StyleSheet.Caption; + if S = '' then + begin + Inc(K); + S := Unnamed + ' <' + IntToStr(K) + '>'; + end; + Names.AddObject(S, StyleSheet); + end; + end; + end; + finally + Names.EndUpdate; + end; + DoActiveStyleSheetChanged; + end; +end; + +procedure TdxfmCustomcxControlReportLinkDesignWindow.RefreshStylesList; +begin + DoRefreshStylesList; +end; + +procedure TdxfmCustomcxControlReportLinkDesignWindow.DoActiveStyleSheetChanged; +begin + RefreshStylesList; + //DoStylesChanged(nil, True); +end; + +procedure TdxfmCustomcxControlReportLinkDesignWindow.DoFormActivated(AnActive: Boolean); +begin +end; + +procedure TdxfmCustomcxControlReportLinkDesignWindow.DoRefreshStylesList; +begin +end; + +procedure TdxfmCustomcxControlReportLinkDesignWindow.DoStyleChanged(const ACaption: string; + AStyle: TcxStyle); +begin +end; + +procedure TdxfmCustomcxControlReportLinkDesignWindow.DoStylesChanged(AStrings: TStrings; + ARecreate: Boolean); +begin +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.GetDesignerTabIndex: Integer; +begin + Result := 0; +end; + +procedure TdxfmCustomcxControlReportLinkDesignWindow.SetDesignerTabIndex(Value: Integer); +begin +end; + +procedure TdxfmCustomcxControlReportLinkDesignWindow.GetSelectedStyleNames(AStrings: TStrings); +begin +end; + +procedure TdxfmCustomcxControlReportLinkDesignWindow.GetStyleNames(out AStrings: TStrings); +begin + AStrings := nil; +end; + +procedure TdxfmCustomcxControlReportLinkDesignWindow.GetStyleSheetNames(out AStrings: TStrings); +begin + AStrings := nil; +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.GetStyleConsumerCount(AStyle: TcxStyle): Integer; +begin + Result := ReportLink.GetStyleConsumerCount(AStyle); +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.GetStyleSheetCaption(var ACaption: string): Boolean; +begin + Result := ReportLink.GetStyleSheetCaption(HasStyleSheetWithCaption, ACaption); +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.HasStyleSheetWithCaption(const ACaption: string): Boolean; +var + Strings: TStrings; + I: Integer; +begin + Result := True; + GetStyleSheetNames(Strings); + if Strings <> nil then + for I := 0 to Strings.Count - 1 do + if dxSameText(Strings[I], ACaption) then Exit; + Result := False; +end; + +procedure TdxfmCustomcxControlReportLinkDesignWindow.InitiateStyle(const ACaption: string; + var AStyle: TcxStyle; AForceCreation: Boolean); +var + Names: TStrings; +begin + if ReportLink.InitiateStyle(ACaption, AStyle, AForceCreation) then + begin + GetStyleNames(Names); + if Names <> nil then + Names.Objects[Names.IndexOf(ACaption)] := AStyle; + end; +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.GetActiveStyleSheet: TcxCustomStyleSheet; +begin + Result := ReportLink.Styles.StyleSheet; +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.GetAreNativeStylesAvailable: Boolean; +begin + Result := ReportLink.AreNativeStylesAvailable; +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.GetReportLink: TdxCustomcxControlReportLink; +begin + Result := inherited ReportLink as TdxCustomcxControlReportLink; +end; + +function TdxfmCustomcxControlReportLinkDesignWindow.GetStyleRepository: TcxStyleRepository; +begin + Result := ReportLink.StyleRepository; +end; + +procedure TdxfmCustomcxControlReportLinkDesignWindow.SetActiveStyleSheet(Value: TcxCustomStyleSheet); +begin + if ReportLink.Styles.StyleSheet <> Value then + begin + ReportLink.Styles.StyleSheet := Value; + DoActiveStyleSheetChanged; + end; +end; + +procedure TdxfmCustomcxControlReportLinkDesignWindow.WMActivate(var message: TWMActivate); +begin + inherited; + DoFormActivated(message.Active <> WA_INACTIVE); +end; + +{ TdxStylesListBoxToolTipsWindow } + +procedure TdxStylesListBoxToolTipsWindow.Activate(const R: TRect; AnIndex: Integer); +const + ShowFlags = SWP_SHOWWINDOW or SWP_NOACTIVATE; +begin + Application.CancelHint; + FStyleIndex := AnIndex; + with R do + SetWindowPos(Handle, HWND_TOPMOST, Left, Top, Right - Left, Bottom - Top, ShowFlags); + Update; +end; + +procedure TdxStylesListBoxToolTipsWindow.Deactivate; +const + HideFlags = SWP_NOZORDER or SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE or SWP_HIDEWINDOW; +begin + SetWindowPos(Handle, 0, 0, 0, 0, 0, HideFlags); + FStyleIndex := -1; +end; + +function TdxStylesListBoxToolTipsWindow.GetListBox: TdxStylesListBox; +begin + Result := TdxStylesListBox(Owner); +end; + +procedure TdxStylesListBoxToolTipsWindow.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + begin + ExStyle := WS_EX_TOOLWINDOW or WS_EX_TOPMOST; + Style := WS_POPUP;// or WS_DISABLED; + WindowClass.Style := WindowClass.Style or CS_SAVEBITS; + if IsWin32Version(5, 1) then + WindowClass.Style := WindowClass.Style or CS_DROPSHADOW; + end; +end; + +procedure TdxStylesListBoxToolTipsWindow.Paint; +var + R: TRect; +begin + R := ClientRect; + DrawBorder(Canvas.Handle, R); + InflateRect(R, -1, -1); + DrawStyle(R); +end; + +procedure TdxStylesListBoxToolTipsWindow.CalculateStyleBarViewInfo(const R: TRect; + var AViewInfo: TdxStyleBarViewInfo); +var + cxStyle: TcxStyle; + Pt: TPoint; +begin + with ListBox do + begin + cxStyle := ReportLinkStyles.StylesByCaption[HotTrackStyleName]; + CalculateStyleBarViewInfo(HotTrackStyleName, StyleIndex, cxStyle, R, False, AViewInfo); + end; + with AViewInfo do + begin + BarColor := clInfoBk; + + Pt := R.TopLeft; + MapWindowPoints(Handle, ListBox.Handle, Pt, 1); + StyleBitmapOrg.X := -(Pt.X - R.Left); + StyleBitmapOrg.Y := -(Pt.Y - R.Top); + end; +end; + +procedure TdxStylesListBoxToolTipsWindow.DrawBorder(DC: HDC; const R: TRect); +var + R2: TRect; +begin + {$IFDEF DELPHI7} + with Themes.ThemeServices do + if ThemesEnabled then + begin + DrawEdge(DC, GetElementDetails(twWindowRoot), R, BDR_RAISEDOUTER, BF_RECT); + Exit; + end; + {$ENDIF} + R2 := R; + DrawEdge(DC, R2, BDR_RAISEDOUTER, BF_RECT) +end; + +procedure TdxStylesListBoxToolTipsWindow.DrawStyle(R: TRect); +var + ViewInfo: TdxStyleBarViewInfo; +begin + dxPScxCommon.InitializeStyleBarViewInfo(ViewInfo); + try + CalculateStyleBarViewInfo(R, ViewInfo); + dxPScxCommon.dxPSDrawStyleBar(Canvas, R, ViewInfo); + finally + dxPScxCommon.DeinitializeStyleBarViewInfo(ViewInfo); + end; +end; + +procedure TdxStylesListBoxToolTipsWindow.WMEraseBkgnd(var message: TWMEraseBkgnd); +begin + message.Result := 1; +end; + +procedure TdxStylesListBoxToolTipsWindow.WMNCHitTest(var message: TWMNCHitTest); +begin + message.Result := HTTRANSPARENT; +end; + +{ TdxStylesListBox } + +constructor TdxStylesListBox.Create(AOwner: TComponent); +begin + inherited; + MultiSelect := True; + Style := lbOwnerDrawVariable; + FToolTips := True; + + HotTrackStyleIndex := -1; + + FToolTipsLongHideTimer := TTimer.Create(Self); + FToolTipsLongHideTimer.Enabled := False; + FToolTipsLongHideTimer.Interval := 5000; + FToolTipsLongHideTimer.OnTimer := ToolTipsLongHideTimerHandler; + + FToolTipsShortHideTimer := TTimer.Create(Self); + FToolTipsShortHideTimer.Enabled := False; + FToolTipsShortHideTimer.Interval := 1; + FToolTipsShortHideTimer.OnTimer := ToolTipsShortHideTimerHandler; +end; + +procedure TdxStylesListBox.HideToolTips; +begin + if ToolTipsWindow <> nil then ToolTipsWindow.Deactivate; + HotTrackStyleIndex := -1; + FToolTipsLongHideTimer.Enabled := False; + FToolTipsShortHideTimer.Enabled := False; +end; + +function TdxStylesListBox.IndexOfStyle(AStyle: TcxStyle): Integer; +begin + Result := Items.IndexOfObject(AStyle); +end; + +procedure TdxStylesListBox.DrawItem(Index: Integer; Rect: TRect; + State: TOwnerDrawState); +var + S: string; + cxStyle: TcxStyle; + ViewInfo: TdxStyleBarViewInfo; +begin + dxPScxCommon.InitializeStyleBarViewInfo(ViewInfo); + try + S := Items[Index]; + cxStyle := ReportLinkStyles.StylesByCaption[S]; + CalculateStyleBarViewInfo(S, -1, cxStyle, Rect, odSelected in State, ViewInfo); + dxPScxCommon.dxPSDrawStyleBar(Canvas, Rect, ViewInfo); + Perform(LB_SETHORIZONTALEXTENT, ViewInfo.MaxWidth, 0); + finally + dxPScxCommon.DeinitializeStyleBarViewInfo(ViewInfo); + end; +end; + +procedure TdxStylesListBox.MeasureItem(Index: Integer; var Height: Integer); +var + S: string; + H1, H2: Integer; + cxStyle: TcxStyle; + Params: TcxViewParams; + StyleFont: TFont; +begin + S := Items[Index]; + Canvas.Font := Font; + H1 := Canvas.TextHeight(S); + cxStyle := ReportLinkStyles.StylesByCaption[S]; + if cxStyle = nil then + begin + ReportLinkStyles.GetDefaultViewParamsByCaption(S, nil, Params); + StyleFont := Params.Font; + end + else + StyleFont := cxStyle.Font; + + if StyleFont <> nil then + Canvas.Font := StyleFont; + H2 := Canvas.TextHeight('Wq'); + + Height := H1; + if Height < H2 then Height := H2; + Inc(Height, 1 + 1); +end; + +procedure TdxStylesListBox.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited; + if ToolTips then UpdateToolTips(MakePoint(X, Y)); +end; + +function CompareItemsAsIntegers(AnItem1, AnItem2: Pointer): Integer; +begin + Result := Integer(AnItem2) - Integer(AnItem1); +end; + +procedure TdxStylesListBox.CalculateStyleBarViewInfoSizes(AnIndex: Integer; + const R: TRect; var AViewInfo: TdxStyleBarViewInfo); + + procedure CalculateStyleBarViewInfoSizesForRow(AnIndex: Integer; + var ACaptionMaxWidth, AFontInfoMaxWidth: Integer); + var + S: string; + cxStyle: TcxStyle; + Params: TcxViewParams; + StyleFont: TFont; + begin + S := Items[AnIndex]; + Canvas.Font := Font; + ACaptionMaxWidth := Canvas.TextWidth(S); + + cxStyle := ReportLinkStyles.StylesByCaption[S]; + if cxStyle = nil then + begin + ReportLinkStyles.GetDefaultViewParamsByCaption(S, nil, Params); + StyleFont := Params.Font; + end + else + StyleFont := cxStyle.Font; + if StyleFont <> nil then + Canvas.Font := StyleFont; + AFontInfoMaxWidth := Canvas.TextWidth(dxPSUtl.FormatFontInfo(StyleFont)) + 2; + end; + + function GetMaxValue(AList: TList): Integer; + begin + AList.Sort(CompareItemsAsIntegers); + Result := Integer(AList[0]); + end; + +const + ColorBoxWidth = 60; +var + WidthList: TList; + F: TFont; + CaptionMaxWidth, I, W, FW: Integer; +begin + WidthList := TList.Create; + try + WidthList.Count := Items.Count; + + Canvas.Font := Font; + F := TFont.Create; + try + F.Assign(Canvas.Font); + CaptionMaxWidth := 0; + for I := 0 to Items.Count - 1 do + begin + FW := Integer(WidthList[I]); + CalculateStyleBarViewInfoSizesForRow(I, W, FW); + WidthList[I] := Pointer(FW); + if W > CaptionMaxWidth then CaptionMaxWidth := W; + end; + if AnIndex <> -1 then + begin + WidthList.Count := 1; + FW := Integer(WidthList[0]); + CalculateStyleBarViewInfoSizesForRow(AnIndex, W, FW); + WidthList[0] := Pointer(FW); + Canvas.Font := F; + end; + finally + F.Free; + end; + if CaptionMaxWidth <> 0 then Inc(CaptionMaxWidth, 6); + + AViewInfo.MaxWidth := CaptionMaxWidth + ColorBoxWidth + GetMaxValue(WidthList); + + with AViewInfo do + begin + StyleCaptionBoxBounds := R; + StyleCaptionBoxBounds.Right := StyleCaptionBoxBounds.Left + CaptionMaxWidth; + + StyleColorBoxBounds := R; + StyleColorBoxBounds.Left := StyleCaptionBoxBounds.Right; + StyleColorBoxBounds.Right := StyleColorBoxBounds.Left + ColorBoxWidth; + StyleColorBoxContentBounds := StyleColorBoxBounds; + InflateRect(StyleColorBoxContentBounds, -2, -2); + + StyleFontInfoBoxBounds := R; + StyleFontInfoBoxBounds.Left := StyleColorBoxBounds.Right; + StyleFontInfoBoxBounds.Right := StyleFontInfoBoxBounds.Left + Integer(WidthList[0]); + + RestSpaceBounds := R; + RestSpaceBounds.Left := StyleFontInfoBoxBounds.Right; + end; + finally + WidthList.Free; + end; +end; + +procedure TdxStylesListBox.CalculateStyleBarViewInfoViewParams(const ACaption: string; + AStyle: TcxStyle; const R: TRect; ASelected: Boolean; var AViewInfo: TdxStyleBarViewInfo); +var + DefaultParams, Params: TcxViewParams; +begin + AViewInfo.StyleCaption := ACaption; + + ReportLinkStyles.GetDefaultViewParamsByCaption(AViewInfo.StyleCaption, nil, DefaultParams); + if AStyle <> nil then + begin + Params.Bitmap := AStyle.Bitmap; + Params.Color := AStyle.Color; + Params.Font := AStyle.Font; + Params.TextColor := clWindowText; + if Params.Color = clDefault then + Params.Color := DefaultParams.Color; + if Params.TextColor = clDefault then + Params.TextColor := DefaultParams.TextColor; + end + else + Params := DefaultParams; + + with AViewInfo do + begin + BarColor := Color; + if ASelected then + BarColor := clHighlight; + + BarStyleColorBoxFrameColor := clBtnShadow; + if ColorToRGB(BarStyleColorBoxFrameColor) = ColorToRGB(BarColor) then + BarStyleColorBoxFrameColor := clHighlightText; + + BarFont.Assign(Font); + if not Enabled then + BarFont.Color := clGrayText; + if ASelected then + BarFont.Color := clHighlightText; + if BarFont.Color = Color then + BarFont.Color := dxPSUtl.InvertColor(BarFont.Color); + + StyleBitmap.Assign(Params.Bitmap); + StyleBitmapOrg := dxPSGlbl.NullPoint; + StyleColor := Params.Color; + if Params.Font <> nil then + StyleFont.Assign(Params.Font); + + StyleTextColor := Params.TextColor; + if not Enabled then + StyleTextColor := clGrayText; + if ASelected then + StyleTextColor := clHighlightText; + if StyleTextColor = Color then + StyleTextColor := dxPSUtl.InvertColor(StyleTextColor); + end; +end; + +procedure TdxStylesListBox.CalculateStyleBarViewInfo(const ACaption: string; + AnIndex: Integer; AStyle: TcxStyle; const R: TRect; ASelected: Boolean; + var AViewInfo: TdxStyleBarViewInfo); +begin + CalculateStyleBarViewInfoSizes(AnIndex, R, AViewInfo); + CalculateStyleBarViewInfoViewParams(ACaption, AStyle, R, ASelected, AViewInfo); +end; + +function TdxStylesListBox.AreToolTipsNeeded: Boolean; +begin + Result := IsHotTrackStyleViolateControlBounds and GetParentForm(Self).Active and + dxPSGlbl.CanShowHints; +end; + +function TdxStylesListBox.FindHotTrackStyle(const Pt: TPoint): Integer; +begin + Result := ItemAtPos(Pt, True); +end; + +function TdxStylesListBox.IsHotTrackStyleViolateControlBounds: Boolean; +begin + Result := (HotTrackStyleIndex <> -1) and + ((HotTrackStyleBounds.Right - HotTrackStyleBounds.Left) > ClientWidth); +end; + +function TdxStylesListBox.IsMouseOver: Boolean; +var + Pt: TPoint; +begin + Pt := Mouse.CursorPos; + MapWindowPoints(0, Parent.Handle, Pt, 1); + Result := PtInRect(BoundsRect, Pt); +end; + +procedure TdxStylesListBox.ShowToolTips; +begin + if FToolTipsWindow = nil then + FToolTipsWindow := TdxStylesListBoxToolTipsWindow.Create(Self); + ToolTipsWindow.Activate(ToolTipsBounds, HotTrackStyleIndex); + FToolTipsLongHideTimer.Enabled := True; + FToolTipsShortHideTimer.Enabled := True; +end; + +procedure TdxStylesListBox.UpdateToolTips(const Pt: TPoint); +var + NewHotTrackStyleIndex: Integer; +begin + NewHotTrackStyleIndex := FindHotTrackStyle(Pt); + if NewHotTrackStyleIndex <> HotTrackStyleIndex then + begin + HideToolTips; + HotTrackStyleIndex := NewHotTrackStyleIndex; + if AreToolTipsNeeded then ShowToolTips; + end; +end; + +function TdxStylesListBox.GetHotTrackStyleBounds: TRect; +var + ViewInfo: TdxStyleBarViewInfo; +begin + Result := ItemRect(HotTrackStyleIndex); + MapWindowPoints(Handle, 0, Result, 2); + + dxPScxCommon.InitializeStyleBarViewInfo(ViewInfo); + try + CalculateStyleBarViewInfoSizes(HotTrackStyleIndex, Result, ViewInfo); + Result.Right := Result.Left + ViewInfo.MaxWidth; + finally + dxPScxCommon.DeinitializeStyleBarViewInfo(ViewInfo); + end; +end; + +function TdxStylesListBox.GetHotTrackStyleName: string; +begin + Result := Items[HotTrackStyleIndex]; +end; + +function TdxStylesListBox.GetStyle(Index: Integer): TcxStyle; +begin + Result := TcxStyle(Items.Objects[Index]); +end; + +function TdxStylesListBox.GetToolTipsBounds: TRect; +var + SI: TScrollInfo; +begin + Result := HotTrackStyleBounds; + + FillChar(SI, SizeOf(SI), 0); + SI.cbSize := SizeOf(SI); + SI.fMask := SIF_POS; + GetScrollInfo(Handle, SB_HORZ, SI); + + OffsetRect(Result, -SI.nPos, 0); + InflateRect(Result, 1, 1); +end; + +procedure TdxStylesListBox.SetReportLinkStyles(Value: TdxCustomReportLinkStyles); +begin + if FReportLinkStyles <> Value then + begin + FReportLinkStyles := Value; + RecreateWnd; + end; +end; + +procedure TdxStylesListBox.SetToolTips(Value: Boolean); +var + Pt: TPoint; +begin + if FToolTips <> Value then + begin + FToolTips := Value; + if ToolTips then + begin + Pt := Mouse.CursorPos; + MapWindowPoints(0, Handle, Pt, 1); + UpdateToolTips(Pt); + end + else + HideToolTips; + end; +end; + +procedure TdxStylesListBox.ToolTipsLongHideTimerHandler(Sender: TObject); +begin + HideToolTips; +end; + +procedure TdxStylesListBox.ToolTipsShortHideTimerHandler(Sender: TObject); +begin + if not IsMouseOver then HideToolTips; +end; + +procedure TdxStylesListBox.WMHScroll(var Message: TWMHScroll); +begin + inherited; + HideToolTips; +end; + +procedure TdxStylesListBox.WMMouseWheel(var Message: TWMMouseWheel); +begin + inherited; + {if message.WheelDelta > 0 then CheckUpScroll} + HideToolTips; +end; + +procedure TdxStylesListBox.WMVScroll(var Message: TWMVScroll); +begin + inherited; + HideToolTips; +end; + +procedure RegisterAssistants; +begin + TdxPSCustomDataMap.Register; + TdxPSTextDataMap.Register; + TdxPSMemoDataMap.Register; + TdxPSHyperLinkDataMap.Register; + TdxPSCheckDataMap.Register; + TdxPSRadioButtonGroupDataMap.Register; + TdxPSGraphicDataMap.Register; + TdxPSImageDataMap.Register; + TdxPSBlobDataMap.Register; +end; + +procedure RegisterItems; +begin + TdxReportCellPreviewText.Register; +end; + +procedure UnregisterAssistants; +begin + TdxPSDataMaps.ReleaseInstance; +end; + +procedure UnregisterItems; +begin + TdxReportCellPreviewText.Unregister; +end; + +procedure FreeAndNilPreviewPictures; +var + I: Integer; +begin + for I := 0 to dxPSPreviewCarLogoCount - 1 do + FreeAndNil(FPreviewPictures[I]); +end; + +initialization + RegisterAssistants; + RegisterItems; + +finalization + UnregisterItems; + UnregisterAssistants; + + FreeAndNilPreviewPictures; + FreeAndNil(FPictureDialog); + FreeAndNil(FPicture); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxCommonReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxCommonReg.pas new file mode 100644 index 00000000..3bc9e4d6 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxCommonReg.pas @@ -0,0 +1,135 @@ +unit dxPScxCommonReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignEditors, + {$ELSE} + DsgnIntf, + {$ENDIF} + SysUtils, TypInfo, Classes, cxClasses, cxLookAndFeels, dxPScxCommon; + +type + TdxReportLinkLookAndFeelKindPropertyEditor = class(TEnumProperty) + public + procedure GetValues(Proc: TGetStrProc); override; + end; + + TdxReportLinkOptionsPropertyEditor = class(TClassProperty) + private + function GetOptions: TdxCustomReportLinkOptions; + function GetReportLink: TdxCustomcxControlReportLink; + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + property Options: TdxCustomReportLinkOptions read GetOptions; + property ReportLink: TdxCustomcxControlReportLink read GetReportLink; + end; + + TdxReportLinkStylesPropertyEditor = class(TClassProperty) + private + function GetReportLink: TdxCustomcxControlReportLink; + function GetStyles: TdxCustomReportLinkStyles; + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + property Styles: TdxCustomReportLinkStyles read GetStyles; + property ReportLink: TdxCustomcxControlReportLink read GetReportLink; + end; + +{ TdxReportLinkLookAndFeelKindPropertyEditor } + +procedure TdxReportLinkLookAndFeelKindPropertyEditor.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := Integer(lfFlat) to Integer(lfUltraFlat) do + Proc(GetEnumName(GetPropType, I)); +end; + +{ TdxReportLinkOptionsPropertyEditor } + +procedure TdxReportLinkOptionsPropertyEditor.Edit; +var + DesignerSupport: IdxReportLinkOptionsDesignerSupport; +begin + if Supports(TObject(Options), IdxReportLinkOptionsDesignerSupport, DesignerSupport) then + begin + DesignerSupport.DesignerInitialize; + try + ReportLink.DesignReport; + finally + DesignerSupport.DesignerFinalize; + end; + end; +end; + +function TdxReportLinkOptionsPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog]; // TODO: ReportLink.CanDesign +end; + +function TdxReportLinkOptionsPropertyEditor.GetOptions: TdxCustomReportLinkOptions; +begin + Result := TdxCustomReportLinkOptions(GetOrdValue); +end; + +function TdxReportLinkOptionsPropertyEditor.GetReportLink: TdxCustomcxControlReportLink; +begin + Result := TdxCustomcxControlReportLink(GetComponent(0)); +end; + +{ TdxReportLinkStylesPropertyEditor } + +procedure TdxReportLinkStylesPropertyEditor.Edit; +var + DesignerSupport: IdxReportLinkOptionsDesignerSupport; +begin + if Supports(TObject(Styles), IdxReportLinkOptionsDesignerSupport, DesignerSupport) then + begin + DesignerSupport.DesignerInitialize; + try + ReportLink.DesignReport; + finally + DesignerSupport.DesignerFinalize; + end; + end; +end; + +function TdxReportLinkStylesPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog]; // TODO: ReportLink.CanDesign +end; + +function TdxReportLinkStylesPropertyEditor.GetReportLink: TdxCustomcxControlReportLink; +begin + Result := TdxCustomcxControlReportLink(GetComponent(0)); +end; + +function TdxReportLinkStylesPropertyEditor.GetStyles: TdxCustomReportLinkStyles; +begin + Result := TdxCustomReportLinkStyles(GetOrdValue); +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterPropertyEditor(TypeInfo(TcxLookAndFeelKind), TdxCustomReportLinkOptionsFormatting, + 'LookAndFeelKind', TdxReportLinkLookAndFeelKindPropertyEditor); + RegisterPropertyEditor(TypeInfo(TdxCustomReportLinkOptions), + TdxCustomcxControlReportLink, '', TdxReportLinkOptionsPropertyEditor); + RegisterPropertyEditor(TypeInfo(TdxCustomReportLinkStyles), + TdxCustomcxControlReportLink, '', TdxReportLinkStylesPropertyEditor); +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxDBEditorLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxDBEditorLnkReg.pas new file mode 100644 index 00000000..87b94212 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxDBEditorLnkReg.pas @@ -0,0 +1,54 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxDBEditorLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + Classes, dxPScxDBEditorLnks; + +procedure Register; +begin + RegisterNoIcon([TcxDBListBoxReportLink, TcxDBImageReportLink, TcxDBMemoReportLink]); +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxDBEditorLnks.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxDBEditorLnks.pas new file mode 100644 index 00000000..58311f6b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxDBEditorLnks.pas @@ -0,0 +1,111 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxDBEditorLnks; + +interface + +{$I cxVer.inc} + +uses + cxDBEdit, dxPScxEditorLnks; + +type + TcxDBListBoxReportLink = class(TcxListBoxReportLink) + private + function GetcxDBListBox: TcxDBListBox; + public + property cxDBListBox: TcxDBListBox read GetcxDBListBox; + end; + + TcxDBImageReportLink = class(TcxCustomImageReportLink) + private + function GetcxDBImage: TcxDBImage; + public + property cxDBImage: TcxDBImage read GetcxDBImage; + published + property BorderColor; + property Center; + property DrawBorder; + property Stretch; + property Transparent; + property TransparentColor; + end; + + TcxDBMemoReportLink = class(TcxCustomMemoReportLink) + private + function GetcxDBMemo: TcxDBMemo; + public + property cxDBMemo: TcxDBMemo read GetcxDBMemo; + end; + +implementation + +uses + dxPSCore, dxPSLbxLnk, dxPSTextLnk; + +{ TcxDBListBoxReportLink } + +function TcxDBListBoxReportLink.GetcxDBListBox: TcxDBListBox; +begin + Result := inherited Component as TcxDBListBox; +end; + +{ TcxDBImageReportLink } + +function TcxDBImageReportLink.GetcxDBImage: TcxDBImage; +begin + Result := inherited Component as TcxDBImage; +end; + +{ TcxDBMemoReportLink } + +function TcxDBMemoReportLink.GetcxDBMemo: TcxDBMemo; +begin + Result := inherited Component as TcxDBMemo; +end; + +initialization + dxPSRegisterReportLink(TcxDBListBoxReportLink, TcxDBListBox, dxPSLbxLnk.TdxLBxReportLinkDesignWindow); + dxPSRegisterReportLink(TcxDBImageReportLink, TcxDBImage, nil); + dxPSRegisterReportLink(TcxDBMemoReportLink, TcxDBMemo, TdxfmTextReportLinkDesignWindow); + +finalization + dxPSUnregisterReportLink(TcxDBMemoReportLink, TcxDBMemo, TdxfmTextReportLinkDesignWindow); + dxPSUnregisterReportLink(TcxDBImageReportLink, TcxDBImage, nil); + dxPSUnregisterReportLink(TcxDBListBoxReportLink, TcxDBListBox, dxPSLbxLnk.TdxLBxReportLinkDesignWindow); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxEditorLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxEditorLnkReg.pas new file mode 100644 index 00000000..92f1794d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxEditorLnkReg.pas @@ -0,0 +1,54 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxEditorLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + Classes, dxPScxEditorLnks; + +procedure Register; +begin + RegisterNoIcon([TcxListBoxReportLink, TcxImageReportLink, TcxMemoReportLink]); +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxEditorLnks.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxEditorLnks.pas new file mode 100644 index 00000000..31e10e5e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxEditorLnks.pas @@ -0,0 +1,319 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxEditorLnks; + +interface + +{$I cxVer.inc} + +uses + Classes, Graphics, Controls, StdCtrls, cxControls, cxContainer, cxListBox, + cxImage, cxEdit, cxMemo, dxPSCore, dxPSLbxLnk, dxPSGraphicLnk, dxPSTextLnk; + +type + TcxListBoxReportLink = class(TCustomdxListBoxReportLinkControl) + private + function GetcxListBox: TcxListBox; + protected + function GetCustomListBox: TCustomListBox; override; + public + property cxListBox: TcxListBox read GetcxListBox; + published + property AutoWidth; + property Color; + property EndEllipsis; + property EvenColor; + property EvenFont; + property Font; + property OddColor; + property OddFont; + property Options; + property Multiline; + property PaintItemsGraphics; + property RowAutoHeight; + property ScaleFonts; + property SupportedCustomDraw; + property Transparent; + property TransparentGraphics; + property UseCustomPageBreaks; + property UseHorzDelimiters; + property UseVertDelimiters; + property Width; + + property OnCustomDrawItem; + property OnGetCustomPageBreaks; + property OnInitializeItem; + end; + + TcxCustomImageReportLink = class(TCustomdxPictureReportLink) + private + function GetcxCustomImage: TcxCustomImage; + protected + procedure InternalRestoreDefaults; override; + procedure InternalRestoreFromOriginal; override; + + function GetDrawMode: TdxGraphicDrawMode; override; + function GetGraphicHeight: Integer; override; + function GetGraphicWidth: Integer; override; + function GetPicture: TPicture; override; + + property cxCustomImage: TcxCustomImage read GetcxCustomImage; + public + constructor Create(AOwner: TComponent); override; + function DataProviderPresent: Boolean; override; + end; + + TcxImageReportLink = class(TcxCustomImageReportLink) + private + function GetcxImage: TcxImage; + public + property cxImage: TcxImage read GetcxImage; + published + property BorderColor; + property Center; + property DrawBorder; + property Stretch; + property Transparent; + property TransparentColor; + end; + + TcxCustomMemoReportLink = class(TdxCustomMemoReportLink) + private + function GetcxCustomMemo: TcxCustomMemo; + protected + function GetCustomMemo: TCustomMemo; override; + property cxCustomMemo: TcxCustomMemo read GetcxCustomMemo; + end; + + TcxMemoReportLink = class(TcxCustomMemoReportLink) + private + function GetcxMemo: TcxMemo; + public + property cxMemo: TcxMemo read GetcxMemo; + end; + +{ Helpers } + +function cxContainer_GetInnerControl(AControl: TcxContainer): TWinControl; +function cxControl_GetHScrollBar(AControl: TcxControl): TcxControlScrollBar; +function cxControl_GetVScrollBar(AControl: TcxControl): TcxControlScrollBar; +function cxControl_GetSizeGrip(AControl: TcxControl): TcxSizeGrip; +function cxEdit_GetProperties(AControl: TcxCustomEdit): TcxCustomEditProperties; +function cxImage_GetPicture(AControl: TcxCustomImage): TPicture; + +implementation + +uses + dxPScxCommon; + +type + TcxContainerAccess = class(TcxContainer); + TcxControlAccess = class(TcxControl); + TcxCustomEditAccess = class(TcxCustomEdit); + TcxCustomImageAccess = class(TcxCustomImage); + + +{ Helpers } + +function cxContainer_GetInnerControl(AControl: TcxContainer): TWinControl; +begin + Result := TcxContainerAccess(AControl).InnerControl; +end; + +function cxControl_GetHScrollBar(AControl: TcxControl): TcxControlScrollBar; +begin + Result := TcxControlAccess(AControl).HScrollBar; +end; + +function cxControl_GetVScrollBar(AControl: TcxControl): TcxControlScrollBar; +begin + Result := TcxControlAccess(AControl).VScrollBar; +end; + +function cxControl_GetSizeGrip(AControl: TcxControl): TcxSizeGrip; +begin + Result := TcxControlAccess(AControl).SizeGrip; +end; + +function cxEdit_GetProperties(AControl: TcxCustomEdit): TcxCustomEditProperties; +begin + Result := TcxCustomEditAccess(AControl).ActiveProperties; +end; + +function cxImage_GetPicture(AControl: TcxCustomImage): TPicture; +begin + Result := TcxCustomImageAccess(AControl).Picture; +end; + +{ TcxListBoxReportLink } + +function TcxListBoxReportLink.GetCustomListBox: TCustomListBox; +begin + if cxListBox <> nil then + Result := TCustomListBox(cxContainer_GetInnerControl(cxListBox)) + else + Result := nil; +end; + +function TcxListBoxReportLink.GetcxListBox: TcxListBox; +begin + Result := inherited Component as TcxListBox; +end; + +{ TcxCustomImageReportLink } + +constructor TcxCustomImageReportLink.Create(AOwner: TComponent); +begin + inherited; + InternalRestoreDefaults; + LinkModified(False); +end; + +function TcxCustomImageReportLink.DataProviderPresent: Boolean; +begin + if DataSource = rldsComponent then + Result := cxCustomImage <> nil + else + Result := inherited DataProviderPresent; +end; + +procedure TcxCustomImageReportLink.InternalRestoreDefaults; +begin + inherited; + Center := True; +end; + +procedure TcxCustomImageReportLink.InternalRestoreFromOriginal; +begin + inherited; + Center := cxImageProperties_GetCenter(cxEdit_GetProperties(cxCustomImage)); + Stretch := cxImageProperties_GetStretch(cxEdit_GetProperties(cxCustomImage)); +end; + +function TcxCustomImageReportLink.GetDrawMode: TdxGraphicDrawMode; +begin + if Stretch then + if Center then + Result := gdmCenterAndStretchProportional + else + Result := gdmStretchProportional + else + if Center then + Result := gdmCenter + else + Result := gdmNone; +end; + +function TcxCustomImageReportLink.GetGraphicHeight: Integer; +begin + if cxCustomImage <> nil then + begin + Result := cxCustomImage.Height; + // 3.2 + //if IsAggregated and (Result < inherited GetGraphicHeight) then + // Result := inherited GetGraphicHeight; + end + else + Result := inherited GetGraphicHeight; +end; + +function TcxCustomImageReportLink.GetGraphicWidth: Integer; +begin + if cxCustomImage <> nil then + begin + Result := cxCustomImage.Width; + // 3.2 + //if IsAggregated and (Result < inherited GetGraphicWidth) then + // Result := inherited GetGraphicWidth; + end + else + Result := inherited GetGraphicWidth; +end; + +function TcxCustomImageReportLink.GetPicture: TPicture; +begin + if cxCustomImage <> nil then + Result := cxImage_GetPicture(cxCustomImage) + else + Result := inherited GetPicture; +end; + +function TcxCustomImageReportLink.GetcxCustomImage: TcxCustomImage; +begin + Result := inherited Component as TcxCustomImage; +end; + +{ TcxImageReportLink } + +function TcxImageReportLink.GetcxImage: TcxImage; +begin + Result := inherited Component as TcxImage; +end; + +{ TcxCustomMemoReportLink } + +function TcxCustomMemoReportLink.GetCustomMemo: TCustomMemo; +begin + if cxCustomMemo <> nil then + Result := TCustomMemo(cxContainer_GetInnerControl(cxCustomMemo)) + else + Result := nil; +end; + +function TcxCustomMemoReportLink.GetcxCustomMemo: TcxCustomMemo; +begin + Result := inherited Component as TcxCustomMemo; +end; + +{ TcxMemoReportLink } + +function TcxMemoReportLink.GetcxMemo: TcxMemo; +begin + Result := inherited Component as TcxMemo; +end; + +initialization + dxPSRegisterReportLink(TcxListBoxReportLink, TcxListBox, TdxLBxReportLinkDesignWindow); + dxPSRegisterReportLink(TcxImageReportLink, TcxImage, nil); + dxPSRegisterReportLink(TcxMemoReportLink, TcxMemo, TdxfmTextReportLinkDesignWindow); + +finalization + dxPSUnregisterReportLink(TcxMemoReportLink, TcxMemo, TdxfmTextReportLinkDesignWindow); + dxPSUnregisterReportLink(TcxImageReportLink, TcxImage, nil); + dxPSUnregisterReportLink(TcxListBoxReportLink, TcxListBox, TdxLBxReportLinkDesignWindow); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxEditorProducers.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxEditorProducers.pas new file mode 100644 index 00000000..10f6b281 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxEditorProducers.pas @@ -0,0 +1,1300 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxEditorProducers; + +interface + +{$I cxVer.inc} + +uses + Windows, Classes, Controls, Graphics, cxLookAndFeels, cxGraphics, cxControls, + cxContainer, cxEdit, cxMemo, cxTextEdit, cxCheckBox, cxRadioGroup, cxBlobEdit, + cxHyperLinkEdit, cxCurrencyEdit, cxGroupBox, cxDropDownEdit, cxImageComboBox, + cxImage, dxThemeManager, dxPSGlbl, dxPScxCommon, dxPSContainerLnk, dxPSCore, + cxLookAndFeelPainters; + +type + TdxPScxControlProducer = class(TdxPSContainerCustomWinControlProducer) + protected + function CanProcessChild(AChildControl: TControl): Boolean; override; + public + function Control: TcxControl; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPScxContainerProducer = class(TdxPSContainerCustomWinControlProducer) //TdxPSContainerWinControlProducer) + private + function GetIsNativeStyle: Boolean; + function GetStyle: {$IFDEF DXVER500} TcxCustomContainerStyle {$ELSE} TcxContainerStyle {$ENDIF}; + protected + function GetBorderClass: TdxPSCellBorderClass; virtual; + function GetBorderColor: TColor; virtual; + function GetContentColor: TColor; override; + function GetFont: TFont; override; + function GetFontColor: TColor; override; + function GetFontStyle: TFontStyles; override; + function GetThemedBorderColor: TColor; virtual; + + function CanProcessChild(AChildControl: TControl): Boolean; override; + function CanUseNativeStyle(AThemedObjectType: TdxThemedObjectType): Boolean; virtual; + function ObjectExpandHeight: Boolean; override; + + property BorderClass: TdxPSCellBorderClass read GetBorderClass; + property BorderColor: TColor read GetBorderColor; + property IsNativeStyle: Boolean read GetIsNativeStyle; + property ThemedBorderColor: TColor read GetThemedBorderColor; + public + function Control: TcxContainer; reintroduce; overload; + class function ControlClass: TControlClass; override; + class function HasNativeSupportForBorders: Boolean; override; + + property Style: {$IFDEF DXVER500} TcxCustomContainerStyle {$ELSE} TcxContainerStyle {$ENDIF} read GetStyle; + end; + + TdxPScxNativePrintableControlProducer = class(TdxPSNativePrintableControlProducer) + private + function GetBorderColor: TColor; + protected + function GetContentColor: TColor; override; + function GetFont: TFont; override; + procedure InitializeNativePrintableControlHost(AnItem: TdxReportVisualItem); override; + property BorderColor: TColor read GetBorderColor; + public + function Control: TcxContainer; reintroduce; overload; + class function ControlClass: TControlClass; override; + function Style: TcxContainerStyle; overload; virtual; + + class function HasNativeSupportForBorders: Boolean; override; + end; + + TdxPScxCustomEditProducer = class(TdxPScxContainerProducer) + protected + function GetControlBoundsRect: TRect; override; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ObjectShrinkHeight: Boolean; override; + public + function Control: TcxCustomEdit; reintroduce; overload; + class function ControlClass: TControlClass; override; + function Properties: TcxCustomEditProperties; virtual; + + property FontColor: TColor read GetFontColor; + end; + + TdxPScxCustomTextEditProducer = class(TdxPScxCustomEditProducer) + protected + function GetDisplayText: string; virtual; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + public + function Control: TcxCustomTextEdit; reintroduce; overload; + class function ControlClass: TControlClass; override; + function Properties: TcxCustomTextEditProperties; reintroduce; overload; + end; + + TdxPScxCustomMemoEditProducer = class(TdxPScxCustomTextEditProducer) + protected + function ObjectExpandHeight: Boolean; override; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + public + function Control: TcxCustomMemo; reintroduce; overload; + class function ControlClass: TControlClass; override; + + function ProducingObjectFriendlyName: string; override; + function Properties: TcxCustomMemoProperties; reintroduce; overload; + end; + + TcxPScxCustomHyperLinkEditProducer = class(TdxPScxCustomTextEditProducer) + protected + function GetFontColor: TColor; override; + function GetFontStyle: TFontStyles; override; + public + function Control: TcxCustomHyperLinkEdit; reintroduce; overload; + class function ControlClass: TControlClass; override; + function Properties: TcxCustomHyperLinkEditProperties; reintroduce; overload; + end; + + TcxPScxCustomCurrencyEditProducer = class(TdxPScxCustomTextEditProducer) + protected + function GetDisplayText: string; override; + public + function Control: TcxCustomCurrencyEdit; reintroduce; overload; + class function ControlClass: TControlClass; override; + function Properties: TcxCustomCurrencyEditProperties; reintroduce; overload; + end; + + TdxPScxCustomComboBoxProducer = class(TdxPScxCustomTextEditProducer) + public + function Control: TcxCustomComboBox; reintroduce; overload; + class function ControlClass: TControlClass; override; + function Properties: TcxCustomComboBoxProperties; reintroduce; overload; + end; + + TdxPScxCustomImageComboBoxProducer = class(TdxPScxCustomComboBoxProducer) + protected + procedure GetImageLists(AProc: TdxPSGetImageListProc); override; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + public + function Control: TcxCustomImageComboBox; reintroduce; overload; + class function ControlClass: TControlClass; override; + function Properties: TcxCustomImageComboBoxProperties; reintroduce; overload; + end; + + TdxPScxCustomCheckBoxProducer = class(TdxPScxCustomEditProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + public + function Control: TcxCustomCheckBox; reintroduce; overload; + class function ControlClass: TControlClass; override; + function Properties: TcxCustomCheckBoxProperties; reintroduce; overload; + end; + + TdxPScxRadioButtonProducer = class(TdxPSRadioButtonProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + public + function Control: TcxRadioButton; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPScxCustomBlobEditProducer = class(TdxPSCustomDelegateProducer) + protected + function CanProcessChild(AChildControl: TControl): Boolean; override; + function Producer: TdxPSCustomContainerItemProducer; override; + public + function Control: TcxCustomBlobEdit; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPScxDefaultBlobEditProducer = class(TdxPScxCustomTextEditProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + public + function Control: TcxCustomBlobEdit; reintroduce; overload; + end; + + TdxPScxPictureBlobProducer = class(TdxPScxCustomEditProducer) + protected + procedure GetImageLists(AProc: TdxPSGetImageListProc); override; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + public + function Control: TcxCustomBlobEdit; reintroduce; overload; + end; + + TdxPScxTextBlobEditProducer = class(TdxPScxCustomTextEditProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + public + function Control: TcxCustomBlobEdit; reintroduce; overload; + end; + + TdxPScxCustomImageEditProducer = class(TdxPScxCustomEditProducer) + protected + function GetHasImage: Boolean; virtual; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + procedure InitializeItemAsImage(AnItem: TdxReportCellGraphic); virtual; + procedure InitializeItemAsText(AnItem: TdxReportCellString); virtual; + function ItemClass: TdxReportVisualItemClass; override; + function ObjectShrinkHeight: Boolean; override; + function ObjectExpandHeight: Boolean; override; + public + function Control: TcxCustomImage; reintroduce; overload; + class function ControlClass: TControlClass; override; + function Properties: TcxCustomImageProperties; reintroduce; overload; + + property HasImage: Boolean read GetHasImage; + end; + + TdxPScxCustomGroupBoxProducer = class(TdxPScxCustomEditProducer) + protected + function CanProcessChild(AChildControl: TControl): Boolean; override; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + procedure InitializeItemLookAndFeel(AnItem: TdxReportVisualItem; ALookAndFeel: TdxPSReportGroupLookAndFeel); virtual; + function ItemClass: TdxReportVisualItemClass; override; + function LookAndFeelClass: TdxPSReportGroupLookAndFeelClass; virtual; + public + class function CanHasAvailableChildren: Boolean; override; + function Control: TcxCustomGroupBox; reintroduce; overload; + class function ControlClass: TControlClass; override; + function Properties: TcxCustomGroupBoxProperties; reintroduce; overload; + end; + + TdxPScxCustomButtonGroupProducer = class(TdxPScxCustomGroupBoxProducer) + protected + procedure CreateItems(AButtonGroup: TdxCustomReportButtonGroup); virtual; + procedure InitializeButton(AGroup: TdxCustomReportButtonGroup; + AButton: TdxCustomReportCellCheck; AnIndex: Integer); virtual; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + procedure InitializeItemLookAndFeel(AnItem: TdxReportVisualItem; ALookAndFeel: TdxPSReportGroupLookAndFeel); override; + function ItemClass: TdxReportVisualItemClass; override; + public + function Control: TcxCustomButtonGroup; reintroduce; overload; + class function ControlClass: TControlClass; override; + function Properties: TcxCustomButtonGroupProperties; reintroduce; overload; + end; + + TdxPScxCustomRadioGroupProducer = class(TdxPScxCustomButtonGroupProducer) + protected + function CanProcessChild(AChildControl: TControl): Boolean; override; + procedure InitializeButton(AGroup: TdxCustomReportButtonGroup; + AButton: TdxCustomReportCellCheck; AnIndex: Integer); override; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + public + function Control: TcxCustomRadioGroup; reintroduce; overload; + class function ControlClass: TControlClass; override; + function Properties: TcxRadioGroupProperties; reintroduce; overload; + end; + +{ Utilities } + +function cxBordersMap(ABorders: TcxBorders): TdxCellSides; + +const + CheckBorderStyleMap: array[TcxContainerBorderStyle] of TdxCheckButtonEdgeStyle = + (cbesNone, {cbesUltraFlat}cbesSingle, cbesBoldFlat, cbesSoft3D, cbes3D, cbesUltraFlat + {$IFDEF DXVER500}, cbesUltraFlat {$ENDIF}); + CheckPosMap: array[TAlignment] of TdxCellCheckPos = (ccpLeft, ccpRight, ccpCenter); + ContainerBorderStyleMap: array[TcxContainerBorderStyle] of TdxPSCellBorderClass = + (TdxPSCellNullBorder, TdxPSCellUltraFlatBorder, TdxPSCellBoldFlatBorder, + TdxPSCellSunkenSoftBorder, TdxPSCellSunkenBorder, TdxPSCellUltraFlatBorder + {$IFDEF DXVER500}, TdxPSCellUltraFlatBorder {$ENDIF}); + EditBorderStyleMap: array[TcxEditBorderStyle] of TdxPSCellBorderClass = + (TdxPSCellNullBorder, TdxPSCellUltraFlatBorder, TdxPSCellBoldFlatBorder, + TdxPSCellSunkenSoftBorder, TdxPSCellSunkenBorder, TdxPSCellUltraFlatBorder + {$IFDEF DXVER500}, TdxPSCellSunkenSoftBorder{$ENDIF}); + RadioLookAndFeelKindMap: array[TcxLookAndFeelKind] of TdxCheckButtonEdgeStyle = + (cbesSoft3D, cbes3D, cbesUltraFlat{$IFDEF DXVER500}, cbesUltraFlat {$ENDIF}); + RadioBorderStyleMap: array[TcxContainerBorderStyle] of TdxCheckButtonEdgeStyle = + (cbesNone, cbesUltraFlat, cbesBoldFlat, cbesSoft3D, cbes3D, cbesUltraFlat + {$IFDEF DXVER500}, cbesUltraFlat {$ENDIF}); + GroupBoxCaptionAlignmentMap: array[TcxCaptionAlignment] of TdxTextAlignX = + (taLeft, taCenterX, taRight, taLeft, taLeft, taLeft, taLeft, taLeft, taLeft, taLeft, taLeft, taLeft, taLeft); + +implementation + +uses + {$IFDEF DELPHI6} + Variants, + {$ELSE} + cxClasses, + {$ENDIF} + SysUtils, dxThemeConsts, dxUxTheme, cxVariants, dxPSUtl, dxPScxEditorLnks, + dxPScxListBoxLnk; + +{$IFNDEF DXVER500} +type + TcxContainerAccess = class(TcxContainer); + TcxCustomCheckBoxAccess = class(TcxCustomCheckBox); + TcxCustomCurrencyEditAccess = class(TcxCustomCurrencyEdit); + TcxCustomGroupBoxAccess = class(TcxCustomGroupBox); + TcxCustomImageComboBoxAccess = class(TcxCustomImageComboBox); +{$ENDIF} + +var + FPicture: TPicture; + +function Picture: TPicture; +begin + if FPicture = nil then FPicture := TPicture.Create; + Result := FPicture; +end; + +{ Helpers } + +function cxCheckBox_GetState(AControl: TcxCustomEdit): TcxCheckBoxState; +begin + {$IFDEF DXVER500} + Result := TcxCustomCheckBox(AControl).State; + {$ELSE} + Result := TcxCustomCheckBoxAccess(AControl).State; + {$ENDIF} +end; + +function cxCurrencyEdit_GetValue(AControl: TcxCustomEdit): Double; +begin + {$IFDEF DXVER500} + Result := TcxCustomCurrencyEdit(AControl).Value; + {$ELSE} + Result := TcxCustomCurrencyEditAccess(AControl).Value; + {$ENDIF} +end; + +function cxGroupBox_GetAlignment(AControl: TcxCustomEdit): TcxCaptionAlignment; +begin + {$IFDEF DXVER500} + Result := TcxCustomGroupBox(AControl).Alignment; + {$ELSE} + Result := TcxCustomGroupBoxAccess(AControl).Alignment; + {$ENDIF} +end; + +function cxImageComboBox_GetItemIndex(AControl: TcxCustomEdit): Integer; +begin + {$IFDEF DXVER500} + Result := TcxCustomImageComboBox(AControl).ItemIndex; + {$ELSE} + Result := TcxCustomImageComboBoxAccess(AControl).ItemIndex; + {$ENDIF} +end; + +{ Utilities} + +function cxBordersMap(ABorders: TcxBorders): TdxCellSides; +begin + Result := []; + if bLeft in ABorders then Include(Result, csLeft); + if bTop in ABorders then Include(Result, csTop); + if bRight in ABorders then Include(Result, csRight); + if bBottom in ABorders then Include(Result, csBottom); +end; + +{ TdxPScxControlProducer } + +function TdxPScxControlProducer.Control: TcxControl; +begin + Result := inherited Control as TcxControl; +end; + +class function TdxPScxControlProducer.ControlClass: TControlClass; +begin + Result := TcxControl; +end; + +function TdxPScxControlProducer.CanProcessChild(AChildControl: TControl): Boolean; +begin + Result := inherited CanProcessChild(AChildControl) and + (AChildControl <> cxControl_GetHScrollBar(Control)) and + (AChildControl <> cxControl_GetVScrollBar(Control)) and + (AChildControl <> cxControl_GetSizeGrip(Control)); +end; + +{ TdxPScxContainerProducer } + +function TdxPScxContainerProducer.Control: TcxContainer; +begin + Result := inherited Control as TcxContainer; +end; + +class function TdxPScxContainerProducer.ControlClass: TControlClass; +begin + Result := TcxContainer; +end; + +class function TdxPScxContainerProducer.HasNativeSupportForBorders: Boolean; +begin + Result := True; +end; + +function TdxPScxContainerProducer.GetBorderClass: TdxPSCellBorderClass; +begin + if CanUseNativeStyle(totEdit) then + Result := TdxPSCellUltraFlatBorder + else + Result := ContainerBorderStyleMap[Style.BorderStyle]; +end; + +function TdxPScxContainerProducer.GetBorderColor: TColor; +begin + if CanUseNativeStyle(totEdit) then + Result := ThemedBorderColor + else + if Style.BorderStyle in [cbsSingle, cbsThick] then + Result := Style.BorderColor + else + Result := dxPSCore.dxDefaultGridLineColor; +end; + +function TdxPScxContainerProducer.GetContentColor: TColor; +begin + {$IFDEF DXVER500} + Result := Style.Color; + {$ELSE} + if Control.Enabled then + Result := Style.Color + else + Result := inherited GetContentColor; + {$ENDIF} +end; + +function TdxPScxContainerProducer.GetFont: TFont; +begin + Result := Style.Font; +end; + +function TdxPScxContainerProducer.GetFontColor: TColor; +begin + {$IFDEF DXVER500} + Result := Style.TextColor; + {$ELSE} + Result := inherited GetFontColor; + {$ENDIF} +end; + +function TdxPScxContainerProducer.GetFontStyle: TFontStyles; +begin + {$IFDEF DXVER500} + Result := Style.TextStyle; + {$ELSE} + Result := inherited GetFontStyle; + {$ENDIF} +end; + +function TdxPScxContainerProducer.GetThemedBorderColor: TColor; +var + Theme: TdxTheme; + C: COLORREF; +begin + Theme := dxThemeManager.OpenTheme(totEdit); + if Succeeded(dxUxTheme.GetThemeColor(Theme, 0, 0, TMT_BORDERCOLOR, C)) then + Result := C + else + Result := dxPSCore.dxDefaultGridLineColor; +end; + +function TdxPScxContainerProducer.CanProcessChild(AChildControl: TControl): Boolean; +begin + Result := inherited CanProcessChild(AChildControl) and + not {$IFNDEF DELPHI6}cxClasses.{$ENDIF}Supports(AChildControl, IcxContainerInnerControl); +end; + +function TdxPScxContainerProducer.CanUseNativeStyle(AThemedObjectType: TdxThemedObjectType): Boolean; +begin + Result := IsNativeStyle and + {$IFDEF DXVER500} + dxThemeManager.AreVisualStylesAvailable(AThemedObjectType); + {$ELSE} + dxThemeManager.AreVisualStylesAvailable([AThemedObjectType]); + {$ENDIF} +end; + +function TdxPScxContainerProducer.ObjectExpandHeight: Boolean; +begin + Result := True; +end; + +function TdxPScxContainerProducer.GetIsNativeStyle: Boolean; +begin + Result := Style.LookAndFeel.NativeStyle; +end; + +function TdxPScxContainerProducer.GetStyle: {$IFDEF DXVER500} TcxCustomContainerStyle {$ELSE} TcxContainerStyle {$ENDIF}; +begin + {$IFDEF DXVER500} + if Control.Enabled then + Result := Control.Styles[csNormal] + else + Result := Control.Styles[csDisabled] + {$ELSE} + Result := TcxContainerAccess(Control).Style; + {$ENDIF} +end; + +{ TdxPScxNativePrintableControlProducer } + +function TdxPScxNativePrintableControlProducer.Control: TcxContainer; +begin + Result := inherited Control as TcxContainer; +end; + +class function TdxPScxNativePrintableControlProducer.ControlClass: TControlClass; +begin + Result := TcxContainer; +end; + +function TdxPScxNativePrintableControlProducer.Style: TcxContainerStyle; +begin + {$IFDEF DXVER500} + Result := Control.Styles[csNormal]; + {$ELSE} + Result := TcxContainerAccess(Control).Style; + {$ENDIF} +end; + +class function TdxPScxNativePrintableControlProducer.HasNativeSupportForBorders: Boolean; +begin + Result := True; +end; + +function TdxPScxNativePrintableControlProducer.GetContentColor: TColor; +begin + Result := Style.Color; +end; + +function TdxPScxNativePrintableControlProducer.GetFont: TFont; +begin + Result := Style.Font; +end; + +procedure TdxPScxNativePrintableControlProducer.InitializeNativePrintableControlHost(AnItem: TdxReportVisualItem); +begin + with AnItem do + begin + BorderClass := ContainerBorderStyleMap[Style.BorderStyle]; + BorderColor := Style.BorderColor; + CellSides := cxBordersMap(Style.Edges); + ShowShadow := Style.Shadow; + end; + inherited; +end; + +function TdxPScxNativePrintableControlProducer.GetBorderColor: TColor; +begin + if Style.BorderStyle in [cbsSingle, cbsThick] then + Result := Style.BorderColor + else + Result := clWindowText; +end; + +{ TdxPScxCustomEditProducer } + +function TdxPScxCustomEditProducer.Control: TcxCustomEdit; +begin + Result := inherited Control as TcxCustomEdit; +end; + +class function TdxPScxCustomEditProducer.ControlClass: TControlClass; +begin + Result := TcxCustomEdit; +end; + +function TdxPScxCustomEditProducer.Properties: TcxCustomEditProperties; +begin + Result := cxEdit_GetProperties(Control); +end; + +function TdxPScxCustomEditProducer.GetControlBoundsRect: TRect; +const + ShadowDepth: Integer = 3; // Actually should be borrowed from AnItem.ShadowDepth +begin + Result := inherited GetControlBoundsRect; + if Style.Shadow then + with Result do + begin + Dec(Right, ShadowDepth); + Dec(Bottom, ShadowDepth); + end; +end; + +procedure TdxPScxCustomEditProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + AnItem.BorderClass := BorderClass; + AnItem.BorderColor := BorderColor; + AnItem.CellSides := cxBordersMap(Style.Edges); + AnItem.ShowShadow := Style.Shadow; +end; + +function TdxPScxCustomEditProducer.ObjectShrinkHeight: Boolean; +begin + Result := False;//True; +end; + +{ TdxPScxCustomTextEditProducer } + +function TdxPScxCustomTextEditProducer.Control: TcxCustomTextEdit; +begin + Result := inherited Control as TcxCustomTextEdit; +end; + +class function TdxPScxCustomTextEditProducer.ControlClass: TControlClass; +begin + Result := TcxCustomTextEdit; +end; + +function TdxPScxCustomTextEditProducer.Properties: TcxCustomTextEditProperties; +begin + Result := inherited Properties as TcxCustomTextEditProperties; +end; + +function TdxPScxCustomTextEditProducer.GetDisplayText: string; +begin + Result := Properties.GetDisplayText(Control.EditValue, False, False); +end; + +procedure TdxPScxCustomTextEditProducer.InitializeItem(AnItem: TdxReportVisualItem); +var + EditAlignment: TcxEditAlignment; +begin + inherited; + TdxReportCellString(AnItem).Text := GetDisplayText; + EditAlignment := cxEditProperties_GetAlignment(Properties); + TdxReportCellString(AnItem).TextAlignX := EditTextAlignXMap[EditAlignment.Horz]; + TdxReportCellString(AnItem).TextAlignY := EditTextAlignYMap[EditAlignment.Vert]; +end; + +function TdxPScxCustomTextEditProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellString; +end; + +{ TdxPScxCustomMemoEditProducer } + +function TdxPScxCustomMemoEditProducer.Control: TcxCustomMemo; +begin + Result := inherited Control as TcxCustomMemo; +end; + +class function TdxPScxCustomMemoEditProducer.ControlClass: TControlClass; +begin + Result := TcxCustomMemo; +end; + +function TdxPScxCustomMemoEditProducer.ProducingObjectFriendlyName: string; +begin + Result := ''; + if not IsDesigning and (Control.Lines.Count <> 0) then + begin + Result := Control.Lines[0]; + if Length(Result) > MaxCaptionLength then + begin + Delete(Result, MaxCaptionLength, Length(Result) - MaxCaptionLength); + Result := Result + '...'; + end; + end; + if Result = '' then + Result := inherited ProducingObjectFriendlyName; +end; + +function TdxPScxCustomMemoEditProducer.Properties: TcxCustomMemoProperties; +begin + Result := inherited Properties as TcxCustomMemoProperties; +end; + +function TdxPScxCustomMemoEditProducer.ObjectExpandHeight: Boolean; +begin + Result := False; +end; + +procedure TdxPScxCustomMemoEditProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + TdxReportCellString(AnItem).MultiLine := True; + TdxReportCellString(AnItem).Text := Control.Text; + TdxReportCellString(AnItem).TextAlignX := TextAlignXMap[cxMemoProperties_GetAlignment(Properties)]; + TdxReportCellString(AnItem).TextAlignY := taTop; +end; + +{ TcxPScxCustomHyperLinkEditProducer } + +function TcxPScxCustomHyperLinkEditProducer.Control: TcxCustomHyperLinkEdit; +begin + Result := inherited Control as TcxCustomHyperLinkEdit; +end; + +class function TcxPScxCustomHyperLinkEditProducer.ControlClass: TControlClass; +begin + Result := TcxCustomHyperLinkEdit; +end; + +function TcxPScxCustomHyperLinkEditProducer.Properties: TcxCustomHyperLinkEditProperties; +begin + Result := inherited Properties as TcxCustomHyperLinkEditProperties; +end; + +function TcxPScxCustomHyperLinkEditProducer.GetFontColor: TColor; +begin + Result := cxHyperLinkEditProperties_GetLinkColor(Properties); +end; + +function TcxPScxCustomHyperLinkEditProducer.GetFontStyle: TFontStyles; +begin + Result := inherited GetFontStyle + [fsUnderline]; +end; + +{ TcxPScxCustomCurrencyEditProducer } + +function TcxPScxCustomCurrencyEditProducer.Control: TcxCustomCurrencyEdit; +begin + Result := inherited Control as TcxCustomCurrencyEdit; +end; + +class function TcxPScxCustomCurrencyEditProducer.ControlClass: TControlClass; +begin + Result := TcxCustomCurrencyEdit; +end; + +function TcxPScxCustomCurrencyEditProducer.Properties: TcxCustomCurrencyEditProperties; +begin + Result := inherited Properties as TcxCustomCurrencyEditProperties; +end; + +function TcxPScxCustomCurrencyEditProducer.GetDisplayText: string; +begin + try + Result := inherited GetDisplayText; + except + if cxCurrencyEdit_GetValue(Control) = 0 then + Result := cxCurrencyProperties_GetNullString(Properties) + else + Result := ''; + end; +end; + +{ TdxPScxCustomComboBoxProducer } + +function TdxPScxCustomComboBoxProducer.Control: TcxCustomComboBox; +begin + Result := inherited Control as TcxCustomComboBox; +end; + +class function TdxPScxCustomComboBoxProducer.ControlClass: TControlClass; +begin + Result := TcxCustomComboBox; +end; + +function TdxPScxCustomComboBoxProducer.Properties: TcxCustomComboBoxProperties; +begin + Result := inherited Properties as TcxCustomComboBoxProperties; +end; + +{ TdxPScxCustomImageComboBoxProducer } + +function TdxPScxCustomImageComboBoxProducer.Control: TcxCustomImageComboBox; +begin + Result := inherited Control as TcxCustomImageComboBox; +end; + +class function TdxPScxCustomImageComboBoxProducer.ControlClass: TControlClass; +begin + Result := TcxCustomImageComboBox; +end; + +function TdxPScxCustomImageComboBoxProducer.Properties: TcxCustomImageComboBoxProperties; +begin + Result := inherited Properties as TcxCustomImageComboBoxProperties; +end; + +procedure TdxPScxCustomImageComboBoxProducer.GetImageLists(AProc: TdxPSGetImageListProc); +begin + inherited; + AProc(cxImageComboBoxProperties_GetImages(Properties)); +end; + +procedure TdxPScxCustomImageComboBoxProducer.InitializeItem(AnItem: TdxReportVisualItem); +var + ItemIndex: Integer; + ComboItems: TcxImageComboBoxItems; +begin + inherited; + ItemIndex := cxImageComboBox_GetItemIndex(Control); + if ItemIndex <> -1 then + begin + ComboItems := cxImageComboBoxProperties_GetItems(Properties); + TdxReportCellImage(AnItem).ImageIndex := ComboItems[ItemIndex].ImageIndex; + TdxReportCellImage(AnItem).Text := ComboItems[ItemIndex].Description; + end + else + begin + TdxReportCellImage(AnItem).ImageIndex := cxImageComboBoxProperties_GetDefaultImageIndex(Properties); + TdxReportCellImage(AnItem).Text := cxImageComboBoxProperties_GetDefaultDescription(Properties); + end; + + TdxReportCellImage(AnItem).ImageLayout := ImageLayoutMap[cxImageComboBoxProperties_GetImageAlignment(Properties)]; + TdxReportCellImage(AnItem).ImageList := cxImageComboBoxProperties_GetImages(Properties); + TdxReportCellImage(AnItem).MakeSpaceForEmptyImage := True; + TdxReportCellImage(AnItem).Multiline := cxImageComboBoxProperties_GetIsMultilined(Properties); + if not cxImageComboBoxProperties_GetShowDescription(Properties) then + begin + TdxReportCellImage(AnItem).ImageLayout := ilImageCenterCenter; + TdxReportCellImage(AnItem).Text := ''; + end; +end; + +function TdxPScxCustomImageComboBoxProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellImage; +end; + +{ TdxPScxCustomCheckBoxProducer } + +function TdxPScxCustomCheckBoxProducer.Control: TcxCustomCheckBox; +begin + Result := inherited Control as TcxCustomCheckBox; +end; + +class function TdxPScxCustomCheckBoxProducer.ControlClass: TControlClass; +begin + Result := TcxCustomCheckBox; +end; + +function TdxPScxCustomCheckBoxProducer.Properties: TcxCustomCheckBoxProperties; +begin + Result := inherited Properties as TcxCustomCheckBoxProperties; +end; + +procedure TdxPScxCustomCheckBoxProducer.InitializeItem(AnItem: TdxReportVisualItem); +var + CheckNullStyle: TcxCheckBoxNullValueShowingStyle; + CheckState: TcxCheckBoxState; + CheckGlyph: TBitmap; +begin + inherited; + CheckNullStyle := cxCheckBoxProperties_GetNullStyle(Properties); + CheckState := cxCheckBox_GetState(Control); + + TdxReportCellCheckImage(AnItem).CellSides := []; + TdxReportCellCheckImage(AnItem).Checked := (CheckState = cbsChecked) or ((CheckState = cbsGrayed) and (CheckNullStyle = nssGrayedChecked)); + TdxReportCellCheckImage(AnItem).ButtonEdgeStyle := CheckBorderStyleMap[Style.BorderStyle]; + TdxReportCellCheckImage(AnItem).CheckPos := CheckPosMap[cxCheckBoxProperties_GetAlignment(Properties)]; + TdxReportCellCheckImage(AnItem).Enabled := Control.Enabled and not ((CheckState = cbsGrayed) and (CheckNullStyle in [nssInactive, nssGrayedChecked])); + + CheckGlyph := cxCheckBoxProperties_GetGlyph(Properties); + if not CheckGlyph.Empty then + begin + TdxReportCellCheckImage(AnItem).Glyph := CheckGlyph; + TdxReportCellCheckImage(AnItem).GlyphCount := cxCheckBoxProperties_GetGlyphCount(Properties); + end; + TdxReportCellCheckImage(AnItem).Multiline := cxCheckBoxProperties_GetIsMultilined(Properties); + TdxReportCellCheckImage(AnItem).Text := Control_GetText(Control); + TdxReportCellCheckImage(AnItem).TextAlignY := taCenterY; + TdxReportCellCheckImage(AnItem).TextAlignX := taLeft; +end; + +function TdxPScxCustomCheckBoxProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellCheckImage; +end; + +{ TdxPScxRadioButtonProducer } + +function TdxPScxRadioButtonProducer.Control: TcxRadioButton; +begin + Result := inherited Control as TcxRadioButton; +end; + +class function TdxPScxRadioButtonProducer.ControlClass: TControlClass; +begin + Result := TcxRadioButton; +end; + +procedure TdxPScxRadioButtonProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + TdxReportCellRadio(AnItem).ButtonEdgeStyle := RadioLookAndFeelKindMap[Control.LookAndFeel.Kind]; + TdxReportCellRadio(AnItem).Multiline := Control.WordWrap; +end; + +function TdxPScxRadioButtonProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellRadio; +end; + +{ TdxPScxCustomBlobEditProducer } + +function TdxPScxCustomBlobEditProducer.Control: TcxCustomBlobEdit; +begin + Result := inherited Control as TcxCustomBlobEdit; +end; + +class function TdxPScxCustomBlobEditProducer.ControlClass: TControlClass; +begin + Result := TcxCustomBlobEdit; +end; + +function TdxPScxCustomBlobEditProducer.CanProcessChild(AChildControl: TControl): Boolean; +begin + Result := False; +end; + +function TdxPScxCustomBlobEditProducer.Producer: TdxPSCustomContainerItemProducer; +const + ProducerClasses: array[TcxBlobPaintStyle] of TdxPSCustomContainerItemProducerClass = + (TdxPScxDefaultBlobEditProducer, TdxPScxPictureBlobProducer, TdxPScxTextBlobEditProducer); +var + ProducerClass: TdxPSCustomContainerItemProducerClass; +begin + ProducerClass := ProducerClasses[cxBlobEditProperties_GetPaintStyle(cxEdit_GetProperties(Control))]; + Result := TdxPSCustomContainerItemProducer(ReportLink.ProducersByClass[ProducerClass, Control]); +end; + +{ TdxPScxDefaultBlobEditProducer } + +function TdxPScxDefaultBlobEditProducer.Control: TcxCustomBlobEdit; +begin + Result := inherited Control as TcxCustomBlobEdit; +end; + +procedure TdxPScxDefaultBlobEditProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + TdxReportCellString(AnItem).Text := + cxBlobEdit.GetBlobText(Control.EditValue, TcxCustomBlobEditProperties(cxEdit_GetProperties(Control)), False); +end; + +{ TdxPScxPictureBlobProducer } + +function TdxPScxPictureBlobProducer.Control: TcxCustomBlobEdit; +begin + Result := inherited Control as TcxCustomBlobEdit; +end; + +procedure TdxPScxPictureBlobProducer.GetImageLists(AProc: TdxPSGetImageListProc); +begin + inherited; + AProc(imgBlobImages); +end; + +procedure TdxPScxPictureBlobProducer.InitializeItem(AnItem: TdxReportVisualItem); + + function HasEditValue: Boolean; + begin + Result := not VarIsNull(Control.EditValue) and not VarIsEmpty(Control.EditValue); + end; + +const + ImageIndexes: array[TcxBlobEditKind] of Integer = (0, 2, 4, 6, 0); +begin + inherited; + TdxReportCellGraphic(AnItem).Center := True; + TdxReportCellGraphic(AnItem).ImageList := imgBlobImages; + TdxReportCellGraphic(AnItem).ImageIndex := Ord(HasEditValue) + ImageIndexes[cxBlobEditProperties_GetEditKind(cxEdit_GetProperties(Control))]; +end; + +function TdxPScxPictureBlobProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellGraphic; +end; + +{ TdxPScxTextBlobEditProducer } + +function TdxPScxTextBlobEditProducer.Control: TcxCustomBlobEdit; +begin + Result := inherited Control as TcxCustomBlobEdit; +end; + +procedure TdxPScxTextBlobEditProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + TdxReportCellString(AnItem).EndEllipsis := True; + TdxReportCellString(AnItem).Multiline := False; + TdxReportCellString(AnItem).Text := cxBlobEdit.GetBlobText(Control.EditValue, TcxCustomBlobEditProperties(cxEdit_GetProperties(Control)), False); +end; + +{ TdxPScxCustomImageEditProducer } + +function TdxPScxCustomImageEditProducer.Control: TcxCustomImage; +begin + Result := inherited Control as TcxCustomImage; +end; + +class function TdxPScxCustomImageEditProducer.ControlClass: TControlClass; +begin + Result := TcxCustomImage; +end; + +function TdxPScxCustomImageEditProducer.Properties: TcxCustomImageProperties; +begin + Result := inherited Properties as TcxCustomImageProperties; +end; + +function TdxPScxCustomImageEditProducer.GetHasImage: Boolean; +var + ImagePicture: TPicture; +begin + ImagePicture := cxImage_GetPicture(Control); + Result := (ImagePicture.Graphic <> nil) and not ImagePicture.Graphic.Empty; +end; + +procedure TdxPScxCustomImageEditProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + if HasImage then + InitializeItemAsImage(TdxReportCellGraphic(AnItem)) + else + InitializeItemAsText(TdxReportCellString(AnItem)); +end; + +procedure TdxPScxCustomImageEditProducer.InitializeItemAsImage(AnItem: TdxReportCellGraphic); +var + GraphicClass: TClass; +begin + Picture.Assign(cxImage_GetPicture(Control)); + + if Picture.Graphic <> nil then + GraphicClass := Picture.Graphic.ClassType + else + GraphicClass := nil; + + AnItem.Center := cxImageProperties_GetCenter(Properties); + AnItem.Image := Picture.Graphic; + AnItem.ImageTransparent := ((GraphicClass <> nil) and GraphicClass.InheritsFrom(TIcon)) or + ReportLink.OptionsTransparent.Graphics; + AnItem.Stretch := (GraphicClass <> nil) and not GraphicClass.InheritsFrom(TIcon) and + cxImageProperties_GetStretch(Properties); +end; + +procedure TdxPScxCustomImageEditProducer.InitializeItemAsText(AnItem: TdxReportCellString); +begin + AnItem.Text := cxImageProperties_GetCaption(Properties); + AnItem.TextAlignX := taCenterX; + AnItem.TextAlignY := taCenterY; +end; + +function TdxPScxCustomImageEditProducer.ItemClass: TdxReportVisualItemClass; +const + ItemClasses: array[Boolean] of TdxReportCellDataClass = (TdxReportCellString, TdxReportCellGraphic); +begin + Result := ItemClasses[HasImage]; +end; + +function TdxPScxCustomImageEditProducer.ObjectShrinkHeight: Boolean; +begin + Result := False; +end; + +function TdxPScxCustomImageEditProducer.ObjectExpandHeight: Boolean; +begin + Result := False; +end; + +{ TdxPScxCustomGroupBoxProducer } + +class function TdxPScxCustomGroupBoxProducer.CanHasAvailableChildren: Boolean; +begin + Result := True; +end; + +function TdxPScxCustomGroupBoxProducer.Control: TcxCustomGroupBox; +begin + Result := inherited Control as TcxCustomGroupBox; +end; + +class function TdxPScxCustomGroupBoxProducer.ControlClass: TControlClass; +begin + Result := TcxCustomGroupBox; +end; + +function TdxPScxCustomGroupBoxProducer.Properties: TcxCustomGroupBoxProperties; +begin + Result := inherited Properties as TcxCustomGroupBoxProperties; +end; + +function TdxPScxCustomGroupBoxProducer.CanProcessChild(AChildControl: TControl): Boolean; +begin + Result := True; +end; + +procedure TdxPScxCustomGroupBoxProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + TdxReportGroup(AnItem).BorderClass := ContainerBorderStyleMap[Self.Style.BorderStyle]; + TdxReportGroup(AnItem).CaptionAlignment := GroupBoxCaptionAlignmentMap[cxGroupBox_GetAlignment(Control)]; + TdxReportGroup(AnItem).CaptionText := Control_GetText(Control); + TdxReportGroup(AnItem).CaptionTransparent := TdxReportGroup(AnItem).Transparent; + TdxReportGroup(AnItem).UseOwnBorderClass := True; + + TdxReportGroup(AnItem).LookAndFeel := ReportLink.CreateGroupLookAndFeel(LookAndFeelClass, False); + InitializeItemLookAndFeel(AnItem, TdxReportGroup(AnItem).LookAndFeel); + TdxReportGroup(AnItem).LookAndFeel.Prepare(DC); + TdxReportGroup(AnItem).CalculateCaptionTextWidth(DC); +end; + +procedure TdxPScxCustomGroupBoxProducer.InitializeItemLookAndFeel(AnItem: TdxReportVisualItem; + ALookAndFeel: TdxPSReportGroupLookAndFeel); +begin + ALookAndFeel.CaptionFontIndex := AnItem.FontIndex; + ALookAndFeel.Color := ContentColor; + ALookAndFeel.FontIndex := AnItem.FontIndex; +end; + +function TdxPScxCustomGroupBoxProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportGroup; +end; + +function TdxPScxCustomGroupBoxProducer.LookAndFeelClass: TdxPSReportGroupLookAndFeelClass; +begin + Result := TdxPSReportGroupStandardLookAndFeel; +end; + +{ TdxPScxCustomButtonGroupProducer } + +function TdxPScxCustomButtonGroupProducer.Control: TcxCustomButtonGroup; +begin + Result := inherited Control as TcxCustomButtonGroup; +end; + +class function TdxPScxCustomButtonGroupProducer.ControlClass: TControlClass; +begin + Result := TcxCustomButtonGroup; +end; + +function TdxPScxCustomButtonGroupProducer.Properties: TcxCustomButtonGroupProperties; +begin + Result := inherited Properties as TcxCustomButtonGroupProperties; +end; + +procedure TdxPScxCustomButtonGroupProducer.CreateItems(AButtonGroup: TdxCustomReportButtonGroup); +var + Items: TcxButtonGroupItems; + I: Integer; + Button: TdxCustomReportCellCheck; +begin + Items := cxButtonGroupProperties_GetItems(Properties); + for I := 0 to Items.Count - 1 do + begin + Button := AButtonGroup.Add(cxButtonGroupItem_GetCaption(Items[I])); + InitializeButton(AButtonGroup, Button, I); + end; +end; + +procedure TdxPScxCustomButtonGroupProducer.InitializeButton(AGroup: TdxCustomReportButtonGroup; + AButton: TdxCustomReportCellCheck; AnIndex: Integer); +begin + AButton.BorderColor := Style.BorderColor; + AButton.ButtonEdgeStyle := AGroup.ButtonEdgeStyle; +end; + +procedure TdxPScxCustomButtonGroupProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + TdxCustomReportButtonGroup(AnItem).ButtonEdgeStyle := RadioBorderStyleMap[Style.BorderStyle]; + TdxCustomReportButtonGroup(AnItem).ColumnCount := cxButtonGroupProperties_GetColumnCount(Properties); + CreateItems(TdxCustomReportButtonGroup(AnItem)); + TdxCustomReportButtonGroup(AnItem).ShowCaption := (TdxCustomReportButtonGroup(AnItem).CaptionText <> '') and + (cxGroupBox_GetAlignment(Control) <> alCenterCenter); + TdxCustomReportButtonGroup(AnItem).AdjustContent(DC); +end; + +procedure TdxPScxCustomButtonGroupProducer.InitializeItemLookAndFeel(AnItem: TdxReportVisualItem; + ALookAndFeel: TdxPSReportGroupLookAndFeel); +begin + inherited; +end; + +function TdxPScxCustomButtonGroupProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxCustomReportButtonGroup; +end; + +{ TdxPScxRadioGroupProducer } + +function TdxPScxCustomRadioGroupProducer.Control: TcxCustomRadioGroup; +begin + Result := inherited Control as TcxCustomRadioGroup; +end; + +class function TdxPScxCustomRadioGroupProducer.ControlClass: TControlClass; +begin + Result := TcxCustomRadioGroup; +end; + +function TdxPScxCustomRadioGroupProducer.Properties: TcxRadioGroupProperties; +begin + Result := inherited Properties as TcxRadioGroupProperties; +end; + +function TdxPScxCustomRadioGroupProducer.CanProcessChild(AChildControl: TControl): Boolean; +begin + Result := inherited CanProcessChild(AChildControl) and + not (AChildControl is TcxCustomRadioGroupButton); // RadioGroup buttons are processed inside +end; + +procedure TdxPScxCustomRadioGroupProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + TdxReportRadioGroup(AnItem).ItemIndex := Control.ItemIndex; + TdxReportRadioGroup(AnItem).CheckPos := ccpLeft; +end; + +procedure TdxPScxCustomRadioGroupProducer.InitializeButton(AGroup: TdxCustomReportButtonGroup; + AButton: TdxCustomReportCellCheck; AnIndex: Integer); +begin + inherited; + //TdxReportCellRadio(AButton).ButtonEdgeStyle := AGroup.ButtonEdgeStyle; + TdxReportCellRadio(AButton).Enabled := Control.Enabled; +end; + +function TdxPScxCustomRadioGroupProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportRadioGroup; +end; + +procedure RegisterAssistants; +begin + TdxPScxNativePrintableControlProducer.Register; + + //TdxPScxControlProducer.Register; + //TdxPScxContainerProducer.Register; + //TdxPScxCustomEditProducer.Register; + TdxPScxCustomTextEditProducer.Register; + TdxPScxCustomMemoEditProducer.Register; + TcxPScxCustomHyperLinkEditProducer.Register; + TcxPScxCustomCurrencyEditProducer.Register; + TdxPScxCustomComboBoxProducer.Register; + TdxPScxCustomImageComboBoxProducer.Register; + TdxPScxCustomCheckBoxProducer.Register; + TdxPScxRadioButtonProducer.Register; + TdxPScxCustomBlobEditProducer.Register; + TdxPScxCustomImageEditProducer.Register; + TdxPScxCustomGroupBoxProducer.Register; + TdxPScxCustomRadioGroupProducer.Register; +end; + +procedure UnregisterAssistants; +begin + TdxPScxCustomRadioGroupProducer.Unregister; + TdxPScxCustomGroupBoxProducer.Unregister; + TdxPScxCustomImageEditProducer.Unregister; + TdxPScxCustomBlobEditProducer.Unregister; + TdxPScxRadioButtonProducer.Unregister; + TdxPScxCustomCheckBoxProducer.Unregister; + TdxPScxCustomImageComboBoxProducer.Unregister; + TdxPScxCustomComboBoxProducer.Unregister; + TcxPScxCustomCurrencyEditProducer.Unregister; + TcxPScxCustomHyperLinkEditProducer.Unregister; + TdxPScxCustomMemoEditProducer.Unregister; + TdxPScxCustomTextEditProducer.Unregister; + //TdxPScxCustomEditProducer.Unregister; + //TdxPScxContainerProducer.Unregister; + //TdxPScxControlProducer.Unregister; + + TdxPScxNativePrintableControlProducer.Unregister; +end; + +initialization + RegisterAssistants; + +finalization + UnregisterAssistants; + FreeAndNil(FPicture); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxExtComCtrlsLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxExtComCtrlsLnk.pas new file mode 100644 index 00000000..8c8c1d46 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxExtComCtrlsLnk.pas @@ -0,0 +1,411 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxExtComCtrlsLnk; + +interface + +{$I cxVer.inc} + +uses + Windows, Classes, Graphics, Controls, ComCtrls, ImgList, cxListView, cxTreeView, + {$IFDEF DXVER500} cxRichEdit, cxDBRichEdit, {$ENDIF} + {$IFDEF REGISTERCXSHELLCTRLS} cxShellTreeView, cxShellListView, {$ENDIF} + dxPSCore, dxPSTVLnk, dxPSLVLnk, dxPSRELnk, dxPSContainerLnk; + +type + TcxCustomTreeViewReportLink = class(TCustomdxTreeViewReportLink) + private + function GetcxCustomTreeView: TcxCustomTreeView; + protected + function GetCustomTreeView: TCustomTreeView; override; + property cxCustomTreeView: TcxCustomTreeView read GetcxCustomTreeView; + end; + + TcxTreeViewReportLink = class(TcxCustomTreeViewReportLink) + private + function GetcxTreeView: TcxTreeView; + public + property cxTreeView: TcxTreeView read GetcxTreeView; + published + property AutoNodesExpand; + property AutoWidth; + property Color; + property ExpandLevel; + property ExplicitTreeViewExpand; + property Font; + property GridLineColor; + property Options; + property ScaleFonts; + property SupportedCustomDraw; + property Transparent; + property TreeLineColor; + property UseVertDelimiters; + property Width; + + property OnCustomDrawNode; + property OnInitializeNode; + end; + + {$IFDEF REGISTERCXSHELLCTRLS} + + TcxShellTreeViewReportLink = class(TcxCustomTreeViewReportLink) + private + function GetcxShellTreeView: TcxShellTreeView; + protected + function GetCustomTreeView: TCustomTreeView; override; + procedure CreateImages; override; + procedure DeleteImages; override; + function GetImages: TCustomImageList; override; + function GetStateImages: TCustomImageList; override; + function HasStateImages: Boolean; override; + public + property cxShellTreeView: TcxShellTreeView read GetcxShellTreeView; + published + property AutoNodesExpand; + property AutoWidth; + property Color; + property ExpandLevel; + property ExplicitTreeViewExpand; + property Font; + property GridLineColor; + property Options; + property ScaleFonts; + property SupportedCustomDraw; + property Transparent; + property TreeLineColor; + property UseVertDelimiters; + property Width; + + property OnCustomDrawNode; + property OnInitializeNode; + end; + + {$ENDIF} + + TcxCustomListViewReportLink = class(TCustomdxListViewReportLink) + private + function GetcxCustomListView: TcxCustomListView; + protected + function GetCustomListView: TCustomListView; override; + property cxCustomListView: TcxCustomListView read GetcxCustomListView; + end; + + TcxListViewReportLink = class(TcxCustomListViewReportLink) + private + function GetcxListView: TcxListView; + public + property cxListView: TcxListView read GetcxListView; + published + property AutoWidth; + property Color; + property DrawMode write SetDrawMode; + property Effects3D; + property EndEllipsis; + property HeaderColor; + property Font; + property HeaderFont; + property HeaderTransparent; + property GridLineColor; + property IncludeHeaders; + property OnlySelected; + property Options; + property RowAutoHeight; + property Soft3D; + property SupportedCustomDraw; + property Transparent; + + property OnCustomDrawHeader; + property OnCustomDrawItem; + property OnInitializeHeader; + property OnInitializeItem; + end; + + {$IFDEF REGISTERCXSHELLCTRLS} + + TcxShellListViewReportLink = class(TcxCustomListViewReportLink) + private + function GetcxShellListView: TcxShellListView; + protected + function GetCustomListView: TCustomListView; override; + + procedure CreateImages; override; + procedure DeleteImages; override; + function GetLargeImages: TCustomImageList; override; + function GetSmallImages: TCustomImageList; override; + function GetStateImages: TCustomImageList; override; + function HasStateImages: Boolean; override; + public + property cxShellListView: TcxShellListView read GetcxShellListView; + published + property AutoWidth; + property Color; + property DrawMode write SetDrawMode; + property Effects3D; + property EndEllipsis; + property Font; + property HeaderColor; + property HeaderFont; + property HeaderTransparent; + property GridLineColor; + property OnlySelected; + property Options; + property RowAutoHeight; + property IncludeHeaders; + property ShowColumnHeaders; + property Soft3D; + property SupportedCustomDraw; + property Transparent; + + property OnCustomDrawHeader; + property OnCustomDrawItem; + property OnInitializeHeader; + property OnInitializeItem; + end; + + {$ENDIF} + + {$IFDEF DXVER500} + + TcxCustomRichEditReportLink = class(TAbstractdxRichEditReportLink) + private + function GetRichEdit: TcxCustomRichEdit; + protected + function GetRichEditHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; override; + property RichEdit: TcxCustomRichEdit read GetRichEdit; + public + constructor Create(AOwner: TComponent); override; + end; + + TcxRichEditReportLink = class(TcxCustomRichEditReportLink) + private + function GetRichEdit: TcxRichEdit; + public + property RichEdit: TcxRichEdit read GetRichEdit; + end; + + {$ENDIF} + +implementation + +uses + cxControls, dxPSUtl; + +{ TcxCustomTreeViewReportLink } + +function TcxCustomTreeViewReportLink.GetCustomTreeView: TCustomTreeView; +begin + Result := cxCustomTreeView.InnerTreeView; +end; + +function TcxCustomTreeViewReportLink.GetcxCustomTreeView: TcxCustomTreeView; +begin + Result := Component as TcxCustomTreeView; +end; + +{ TcxTreeViewReportLink } + +function TcxTreeViewReportLink.GetcxTreeView: TcxTreeView; +begin + Result := Component as TcxTreeView; +end; + +{$IFDEF REGISTERCXSHELLCTRLS} + +{ TcxShellTreeViewReportLink } + +function TcxShellTreeViewReportLink.GetCustomTreeView: TCustomTreeView; +begin + Result := cxShellTreeView.InnerTreeView; +end; + +procedure TcxShellTreeViewReportLink.CreateImages; +begin +end; + +procedure TcxShellTreeViewReportLink.DeleteImages; +begin +end; + +function TcxShellTreeViewReportLink.GetImages: TCustomImageList; +begin + Result := dxPSUtl.ShellSmallImages; +end; + +function TcxShellTreeViewReportLink.GetStateImages: TCustomImageList; +begin + Result := dxPSUtl.ShellSmallImages; +end; + +function TcxShellTreeViewReportLink.HasStateImages: Boolean; +begin + Result := False; +end; + +function TcxShellTreeViewReportLink.GetcxShellTreeView: TcxShellTreeView; +begin + Result := TcxShellTreeView(Component); +end; + +{$ENDIF} + +{ TcxCustomListViewReportLink } + +function TcxCustomListViewReportLink.GetCustomListView: TCustomListView; +begin + Result := cxCustomListView.InnerListView; +end; + +function TcxCustomListViewReportLink.GetcxCustomListView: TcxCustomListView; +begin + Result := TcxCustomListView(Component); +end; + +{ TcxListViewReportLink } + +function TcxListViewReportLink.GetcxListView: TcxListView; +begin + Result := TcxListView(Component); +end; + +{$IFDEF REGISTERCXSHELLCTRLS} + +{ TcxShellListViewReportLink } + +function TcxShellListViewReportLink.GetCustomListView: TCustomListView; +begin + Result := cxShellListView.InnerListView; +end; + +procedure TcxShellListViewReportLink.CreateImages; +begin +end; + +procedure TcxShellListViewReportLink.DeleteImages; +begin +end; + +function TcxShellListViewReportLink.GetLargeImages: TCustomImageList; +begin + Result := dxPSUtl.ShellLargeImages; +end; + +function TcxShellListViewReportLink.GetSmallImages: TCustomImageList; +begin + Result := dxPSUtl.ShellSmallImages; +end; + +function TcxShellListViewReportLink.GetStateImages: TCustomImageList; +begin + Result := dxPSUtl.ShellSmallImages; +end; + +function TcxShellListViewReportLink.HasStateImages: Boolean; +begin + Result := not IsReportStyle or inherited HasStateImages; +end; + +function TcxShellListViewReportLink.GetcxShellListView: TcxShellListView; +begin + Result := TcxShellListView(Component); +end; + +{$ENDIF} + +{$IFDEF DXVER500} + +{ TcxCustomRichEditReportLink } + +constructor TcxCustomRichEditReportLink.Create(AOwner: TComponent); +begin + inherited; + RichEditVersion := 2; + LinkModified(False); +end; + +function TcxCustomRichEditReportLink.GetRichEditHandle: {$IFDEF BCB}Integer {$ELSE}HWND {$ENDIF}; +begin + if RichEdit <> nil then + Result := RichEdit.InnerControl.Handle + else + Result := 0; +end; + +function TcxCustomRichEditReportLink.GetRichEdit: TcxCustomRichEdit; +begin + Result := inherited Component as TcxCustomRichEdit; +end; + +{ TcxRichEditReportLink } + +function TcxRichEditReportLink.GetRichEdit: TcxRichEdit; +begin + Result := inherited Component as TcxRichEdit; +end; + +{$ENDIF} + +initialization + dxPSRegisterReportLink(TcxTreeViewReportLink, TcxTreeView, TdxfmTVReportLinkDesignWindow); + {$IFDEF REGISTERCXSHELLCTRLS} + dxPSRegisterReportLink(TcxShellTreeViewReportLink, TcxShellTreeView, TdxfmTVReportLinkDesignWindow); + {$ENDIF} + + dxPSRegisterReportLink(TcxListViewReportLink, TcxListView, TdxfmLVReportLinkDesignWindow); + {$IFDEF REGISTERCXSHELLCTRLS} + dxPSRegisterReportLink(TcxShellListViewReportLink, TcxShellListView, TdxfmLVReportLinkDesignWindow); + {$ENDIF} + + {$IFDEF DXVER500} + dxPSRegisterReportLink(TcxRichEditReportLink, TcxRichEdit, nil); + {$ENDIF} + +finalization + {$IFDEF DXVER500} + dxPSUnregisterReportLink(TcxRichEditReportLink, TcxRichEdit, nil); + {$ENDIF} + + {$IFDEF REGISTERCXSHELLCTRLS} + dxPSUnregisterReportLink(TcxShellListViewReportLink, TcxShellListView, TdxfmTVReportLinkDesignWindow); + {$ENDIF} + dxPSUnregisterReportLink(TcxListViewReportLink, TcxListView, TdxfmTVReportLinkDesignWindow); + + {$IFDEF REGISTERCXSHELLCTRLS} + dxPSUnregisterReportLink(TcxShellTreeViewReportLink, TcxShellTreeView, TdxfmLVReportLinkDesignWindow); + {$ENDIF} + dxPSUnregisterReportLink(TcxTreeViewReportLink, TcxTreeView, TdxfmLVReportLinkDesignWindow); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxExtCommon.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxExtCommon.pas new file mode 100644 index 00000000..9f088f87 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxExtCommon.pas @@ -0,0 +1,1411 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxExtCommon; + +interface + +{$I cxVer.inc} + +uses + Windows, Classes, Graphics, ImgList, cxEdit, cxColorComboBox, cxLookAndFeelPainters, + {$IFDEF DXVER500} cxCheckBox, cxCheckGroup, {$ENDIF} dxPSCore, dxPScxCommon; + +type + TdxReportCellColorBoxAlignment = (ccbaLeft, ccbaRight); + + TdxReportCellColorBox = class(TdxReportCellImageContainer) + private + FColorBoxFrameColor: TColor; + FColorBoxWidth: Integer; + FColorValue: TColor; + function GetColorBoxAlignment: TdxReportCellColorBoxAlignment; + function GetShowDescription: Boolean; + procedure SetColorBoxAlignment(Value: TdxReportCellColorBoxAlignment); + procedure SetShowDescription(Value: Boolean); + protected + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); override; + + function GetImageAreaBounds(DC: HDC): TRect; override; + function GetImageBounds(DC: HDC): TRect; override; + procedure GetImageSizes(var AImageWidth, AImageHeight: Integer); override; + function GetTextBounds(DC: HDC): TRect; override; + function HasImage: Boolean; override; + function IsImageBackgroundDrawn: Boolean; override; + function IsImageDrawn: Boolean; override; + + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + + procedure DrawColorBox(DC: HDC); virtual; + function GetColorBoxFrameBounds(DC: HDC): TRect; virtual; + function GetColorBoxIntreriorBounds(DC: HDC): TRect; virtual; + public + constructor Create(AParent: TdxReportCell); override; + procedure Assign(Source: TPersistent); override; + + function ActualColorBoxWidth(DC: HDC): Integer; virtual; + procedure DrawImage(DC: HDC); override; + function MeasureContentHeight(DC: HDC): Integer; override; + + property ColorBoxAlignment: TdxReportCellColorBoxAlignment read GetColorBoxAlignment write SetColorBoxAlignment; + property ColorBoxFrameColor: TColor read FColorBoxFrameColor write FColorBoxFrameColor; + property ColorBoxWidth: Integer read FColorBoxWidth write FColorBoxWidth; + property ColorValue: TColor read FColorValue write FColorValue; + property ShowDescription: Boolean read GetShowDescription write SetShowDescription; + end; + + TdxReportCellProgressBarOrientation = (pboHorizontal, pboVertical); + + TdxReportCellProgressBar = class(TdxReportCellText) + private + FMaxValue: Double; + FMinValue: Double; + FProgressColor: TColor; + FValue: Double; + function GetOrientation: TdxReportCellProgressBarOrientation; + function GetShowPercentSymbol: Boolean; + function GetShowText: Boolean; + procedure SetOrientation(Value: TdxReportCellProgressBarOrientation); + procedure SetMaxValue(Value: Double); + procedure SetMinValue(Value: Double); + procedure SetShowPercentSymbol(Value: Boolean); + procedure SetShowText(Value: Boolean); + procedure SetValue(Value: Double); + protected + function GetText: string; override; + procedure SetText(const Value: string); override; + + function GetProgressBarProgressBounds(DC: HDC): TRect; virtual; + function GetProgressBarProgressRestBounds(DC: HDC): TRect; virtual; + function IsProgressBarDrawn(DC: HDC): Boolean; virtual; + + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor Create(AParent: TdxReportCell); override; + procedure Assign(Source: TPersistent); override; + + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + procedure DrawProgressBar(DC: HDC); virtual; + procedure DrawText(DC: HDC); override; + + property MaxValue: Double read FMaxValue write SetMaxValue; + property MinValue: Double read FMinValue write SetMinValue; + property Orientation: TdxReportCellProgressBarOrientation read GetOrientation write SetOrientation; + property ProgressColor: TColor read FProgressColor write FProgressColor; + property ShowPercentSymbol: Boolean read GetShowPercentSymbol write SetShowPercentSymbol; + property ShowText: Boolean read GetShowText write SetShowText; + property Value: Double read FValue write SetValue; + end; + + TdxReportCellRichEditGraphic = class(TdxReportCellGraphic) + protected + function IsBackgroundBitmapDrawn: Boolean; override; + end; + + { Data Maps } + + TdxPSColorComboBoxDataMap = class(TdxPSTextDataMap) + protected + class function DoesItemParticipateInBestFitCalculation(AProperties: TcxCustomEditProperties): Boolean; override; + class function GetText(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue): string; override; + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = -1; AOwner: TObject = nil); override; + class function ItemClass(AProperties: TcxCustomEditProperties; AnIsPreview: Boolean = False): TdxReportCellDataClass; override; + class function MeasureWidth(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; AFont: TFont; ARecordIndex: Integer = 0): Integer; override; + class function PropertiesClass: TcxCustomEditPropertiesClass; override; + end; + + TdxPSFontNameComboBoxDataMap = class(TdxPSTextDataMap) + protected + class procedure GetImageLists(AProperties: TcxCustomEditProperties; AProc: TdxPSGetImageListProc); override; + class function GetImages(AProperties: TcxCustomEditProperties): TCustomImageList; virtual; + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = -1; AOwner: TObject = nil); override; + class function ItemClass(AProperties: TcxCustomEditProperties; AnIsPreview: Boolean = False): TdxReportCellDataClass; override; + class function MeasureWidth(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; AFont: TFont; ARecordIndex: Integer = 0): Integer; override; + class function PropertiesClass: TcxCustomEditPropertiesClass; override; + end; + + {$IFDEF REGISTERCXSHELLCTRLS} + + TdxPSShellComboBoxDataMap = class(TdxPSTextDataMap) + protected + class function GetImageIndex(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue): Integer; + class procedure GetImageLists(AProperties: TcxCustomEditProperties; AProc: TdxPSGetImageListProc); override; + class function GetImages(AProperties: TcxCustomEditProperties): TCustomImageList; + class function HasImages(AProperties: TcxCustomEditProperties): Boolean; + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = -1; AOwner: TObject = nil); override; + class function ItemClass(AProperties: TcxCustomEditProperties; AnIsPreview: Boolean = False): TdxReportCellDataClass; override; + class function PropertiesClass: TcxCustomEditPropertiesClass; override; + class function MeasureWidth(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; AFont: TFont; ARecordIndex: Integer = 0): Integer; override; + end; + + {$ENDIF} + + TdxPSLabelDataMap = class(TdxPSTextDataMap) + protected + class function DoesItemParticipateInAutoWidthCalculation(AProperties: TcxCustomEditProperties): Boolean; override; + class function DoesItemParticipateInBestFitCalculation(AProperties: TcxCustomEditProperties): Boolean; override; + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = -1; AOwner: TObject = nil); override; + class function PropertiesClass: TcxCustomEditPropertiesClass; override; + end; + + TdxPSProgressBarDataMap = class(TdxPSCustomDataMap) + protected + class function GetValue(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue): Double; + class function HasText(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue): Boolean; override; + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = -1; AOwner: TObject = nil); override; + class function ItemClass(AProperties: TcxCustomEditProperties; AnIsPreview: Boolean = False): TdxReportCellDataClass; override; + class function PropertiesClass: TcxCustomEditPropertiesClass; override; + end; + + TdxPSTrackBarDataMap = class(TdxPSCustomDataMap) + protected + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = -1; AOwner: TObject = nil); override; + class function ItemClass(AProperties: TcxCustomEditProperties; AnIsPreview: Boolean = False): TdxReportCellDataClass; override; + class function PropertiesClass: TcxCustomEditPropertiesClass; override; + end; + + {$IFDEF DXVER500} + + TdxPSCheckButtonGroupDataMap = class(TdxPSCustomButtonGroupDataMap) + protected + class function ButtonGroupClass(AProperties: TcxCustomEditProperties): TdxCustomReportButtonGroupClass; override; + class procedure InitializeGroupButton(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; AButton: TdxCustomReportCellCheck; AnIndex: Integer); override; + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = -1; AOwner: TObject = nil); override; + class function PropertiesClass: TcxCustomEditPropertiesClass; override; + end; + + TdxPSRichEditDataMap = class(TdxPSDelegateDataMap) + protected + class function DataMapClass(AProperties: TcxCustomEditProperties): TdxPSDataMapClass; override; + class function PropertiesClass: TcxCustomEditPropertiesClass; override; + end; + + TdxPSRichTextDataMap = class(TdxPSCustomDataMap) + protected + class function DoesItemParticipateInBestFitCalculation(AProperties: TcxCustomEditProperties): Boolean; override; + class procedure InitializeItem(AnItem: TAbstractdxReportCellData; AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = -1; AOwner: TObject = nil); override; + class function ItemClass(AProperties: TcxCustomEditProperties; AnIsPreview: Boolean = False): TdxReportCellDataClass; override; + end; + + {$ENDIF} + +{ Helpers } + +function ColorComboBoxProperties_GetColor(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue): TColor; +function ColorComboBoxProperties_GetColorBoxAlignment(AProperties: TcxCustomEditProperties): TdxReportCellColorBoxAlignment; +function ColorComboBoxProperties_GetColorBoxFrameColor(AProperties: TcxCustomEditProperties): TColor; +function ColorComboBoxProperties_GetColorBoxWidth(AProperties: TcxCustomEditProperties): Integer; +function ColorComboBoxProperties_GetShowDescriptions(AProperties: TcxCustomEditProperties): Boolean; +function ColorComboBoxProperties_GetText(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue): string; +function FontNameComboBox_GetShowTypeIcon(AProperties: TcxCustomEditProperties): Boolean; +function FontNameComboBox_GetTypeIconImageIndex(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue): Integer; +function ProgressBarProperties_GetMaxValue(AProperties: TcxCustomEditProperties): Double; +function ProgressBarProperties_GetMinValue(AProperties: TcxCustomEditProperties): Double; +function ProgressBarProperties_GetOrientation(AProperties: TcxCustomEditProperties): TdxReportCellProgressBarOrientation; +function ProgressBarProperties_GetProgressBarColor(AProperties: TcxCustomEditProperties): TColor; +function ProgressBarProperties_GetShowPercentSymbol(AProperties: TcxCustomEditProperties): Boolean; +function ProgressBarProperties_GetShowText(AProperties: TcxCustomEditProperties): Boolean; +{$IFDEF DXVER500} +function CheckGroupProperties_GetGlyph(AProperties: TcxCustomEditProperties): TBitmap; +function CheckGroupProperties_GetGlyphCount(AProperties: TcxCustomEditProperties): Integer; +function CheckGroupProperties_GetCheckPos(AProperties: TcxCustomEditProperties): TdxCellCheckPos; +function CheckGroupProperties_GetCheckStates(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; out ACheckStates: TcxCheckStates): Boolean; +function CheckGroupProperties_GetIsItemEnabled(AProperties: TcxCustomEditProperties; AnIndex: Integer): Boolean; +function RichEditProperties_GetIsMemoMode(AProperties: TcxCustomEditProperties): Boolean; +{$ENDIF} + +{ Utilities } + +function FontImages: TCustomImageList; + +const + dxDefaultColorBoxWidth = 30; + dxDefaultColorBoxColorValue: TColor = clWhite; + + ColorBoxAlignmentMap: array[TcxColorBoxAlign] of TdxReportCellColorBoxAlignment = (ccbaLeft, ccbaRight); + LeftRightMap: array[TLeftRight] of TdxCellCheckPos = (ccpLeft, ccpRight); + +implementation + +uses + SysUtils, Controls, cxLabel, cxProgressBar, cxTrackBar, cxFontNameComboBox, + cxExtEditUtils, {$IFDEF REGISTERCXSHELLCTRLS} cxShellComboBox, {$ENDIF} + {$IFDEF DXVER500} ComCtrls, Forms, cxRichEdit, dxPSRELnk, {$ENDIF} dxPSGlbl, + dxPSUtl, dxPSTextOut; + +type + TcxCustomColorComboBoxPropertiesAccess = class(TcxCustomColorComboBoxProperties); + TcxCustomFontNameComboBoxPropertiesAccess = class(TcxCustomFontNameComboBoxProperties); + TcxCustomProgressBarPropertiesAccess = class(TcxCustomProgressBarProperties); + {$IFDEF REGISTERCXSHELLCTRLS} + TcxCustomShellComboBoxPropertiesAccess = class(TcxCustomShellComboBoxProperties); + {$ENDIF} + {$IFDEF DXVER500} + TcxCustomCheckGroupPropertiesAccess = class(TcxCustomCheckGroupProperties); + TcxCustomRichEditPropertiesAccess = class(TcxCustomRichEditProperties); + {$ENDIF} + +const + Eps: Double = 0.001; + ProgressBarOrientationMap: array[TcxProgressBarOrientation] of TdxReportCellProgressBarOrientation = (pboHorizontal, pboVertical); + + dxFormatColorBoxShowDescription = dxPSGlbl.dxFormatCheckBold; + dxFormatColorBoxAlignmentOffset = dxPSGlbl.dxFormatSortOrderOffset; + dxFormatColorBoxAlignmentLeft = dxPSGlbl.dxFormatSortNo; + dxFormatColorBoxAlignmentRight = dxPSGlbl.dxFormatSortUp; + dxFormatColorBoxAlignmentMask = dxFormatColorBoxAlignmentLeft or dxFormatColorBoxAlignmentRight; + + dxFormatProgressBarShowPercentSymbol = dxPSGlbl.dxFormatMakeSpaceForEmptyImage; + dxFormatProgressBarShowText = dxPSGlbl.dxFormatCheckFlat; + dxFormatProgressBarOrientationOffset = dxPSGlbl.dxFormatSortOrderOffset; + dxFormatProgressBarOrientationHorizontal = dxPSGlbl.dxFormatSortNo; + dxFormatProgressBarOrientationVertical = dxPSGlbl.dxFormatSortUp; + dxFormatProgressBarOrientationMask = dxFormatProgressBarOrientationHorizontal or dxFormatProgressBarOrientationVertical; + +var + FFontImages: TCustomImageList; + {$IFDEF DXVER500} + FRichEdit: TRichEdit; + FRichEditSite: TForm; + {$ENDIF} + +{ Helpers } + +{ ColorComboBoxProperties Helpers } + +function ColorComboBoxProperties_GetColor(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue): TColor; +var + ItemIndex: Integer; + S: string; +begin + with TcxCustomColorComboBoxPropertiesAccess(AProperties) do + begin + ItemIndex := IndexByValue(AValue); + if ItemIndex <> -1 then + Result := GetColorByIndex(ItemIndex) + else + if (ColorComboStyle = cxccsComboList) and not IsVarEmpty(AValue) then + Result := DefaultColor + else + TranslateValues(AValue, Result, S); + end; +end; + +function ColorComboBoxProperties_GetColorBoxAlignment(AProperties: TcxCustomEditProperties): TdxReportCellColorBoxAlignment; +begin + Result := ColorBoxAlignmentMap[TcxCustomColorComboBoxPropertiesAccess(AProperties).ColorBoxAlign]; +end; + +function ColorComboBoxProperties_GetColorBoxFrameColor(AProperties: TcxCustomEditProperties): TColor; +begin + Result := TcxCustomColorComboBoxPropertiesAccess(AProperties).ColorBoxFrameColor; +end; + +function ColorComboBoxProperties_GetColorBoxWidth(AProperties: TcxCustomEditProperties): Integer; +begin + Result := TcxCustomColorComboBoxPropertiesAccess(AProperties).ColorBoxWidth; +end; + +function ColorComboBoxProperties_GetShowDescriptions(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := TcxCustomColorComboBoxPropertiesAccess(AProperties).ShowDescriptions; +end; + +function ColorComboBoxProperties_GetText(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue): string; +var + ItemIndex: Integer; + Color: TColor; + S: string; +begin + with TcxCustomColorComboBoxPropertiesAccess(AProperties) do + begin + ItemIndex := IndexByValue(AValue); + if (ItemIndex = -1) and ((ColorComboStyle <> cxccsComboList) or IsVarEmpty(AValue)) then + begin + TranslateValues(AValue, Color, S); + Result := S; + end + else + Result := GetDescriptionByIndex(ItemIndex); + end; +end; + +{ FontNameComboBoxProperties Helpers } + +function FontNameComboBox_GetShowTypeIcon(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := ftiShowInCombo in TcxCustomFontNameComboBoxPropertiesAccess(AProperties).ShowFontTypeIcon; +end; + +function FontNameComboBox_GetTypeIconImageIndex(AProperties: TcxCustomEditProperties; const AValue: TcxEditValue): Integer; +const + ImageIndexes: array[Boolean] of Integer = (0, 1); +var + Index: Integer; +begin + Result := -1; + if FontNameComboBox_GetShowTypeIcon(AProperties) then + with TcxCustomFontNameComboBoxPropertiesAccess(AProperties) do + begin + Index := Items.IndexOf(GetDisplayText(AValue, False)); + if Index <> -1 then + Result := ImageIndexes[Integer(Items.Objects[Index]) and TRUETYPE_FONTTYPE = 0]; + end; +end; + +{ ProgressBarProperties Helpers } + +function ProgressBarProperties_GetMaxValue(AProperties: TcxCustomEditProperties): Double; +begin + Result := TcxCustomProgressBarPropertiesAccess(AProperties).Max; +end; + +function ProgressBarProperties_GetMinValue(AProperties: TcxCustomEditProperties): Double; +begin + Result := TcxCustomProgressBarPropertiesAccess(AProperties).Min; +end; + +function ProgressBarProperties_GetOrientation(AProperties: TcxCustomEditProperties): TdxReportCellProgressBarOrientation; +begin + Result := ProgressBarOrientationMap[TcxCustomProgressBarPropertiesAccess(AProperties).Orientation]; +end; + +function ProgressBarProperties_GetProgressBarColor(AProperties: TcxCustomEditProperties): TColor; +begin + Result := TcxCustomProgressBarPropertiesAccess(AProperties).BeginColor; +end; + +function ProgressBarProperties_GetShowPercentSymbol(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := TcxCustomProgressBarPropertiesAccess(AProperties).ShowTextStyle = cxtsPercent; +end; + +function ProgressBarProperties_GetShowText(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := TcxCustomProgressBarPropertiesAccess(AProperties).ShowText; +end; + +{$IFDEF DXVER500} + +{ CheckGroupProperties Helpers } + +function CheckGroupProperties_GetGlyph(AProperties: TcxCustomEditProperties): TBitmap; +begin + Result := TcxCustomCheckGroupPropertiesAccess(AProperties).Glyph; +end; + +function CheckGroupProperties_GetGlyphCount(AProperties: TcxCustomEditProperties): Integer; +begin + Result := TcxCustomCheckGroupPropertiesAccess(AProperties).GlyphCount; +end; + +function CheckGroupProperties_GetCheckPos(AProperties: TcxCustomEditProperties): TdxCellCheckPos; +begin + Result := LeftRightMap[TcxCustomCheckGroupPropertiesAccess(AProperties).ItemAlignment]; +end; + +function CheckGroupProperties_GetCheckStates(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; out ACheckStates: TcxCheckStates): Boolean; +begin + with TcxCustomCheckGroupPropertiesAccess(AProperties) do + Result := cxCheckBox.CalculateCheckStates(AValue, Items, EditValueFormat, ACheckStates) +end; + +function CheckGroupProperties_GetIsItemEnabled(AProperties: TcxCustomEditProperties; AnIndex: Integer): Boolean; +begin + Result := TcxCustomCheckGroupPropertiesAccess(AProperties).Items[AnIndex].Enabled; +end; + +{ RichEditProperties Helpers } + +function RichEditProperties_GetIsMemoMode(AProperties: TcxCustomEditProperties): Boolean; +begin + with TcxCustomRichEditPropertiesAccess(AProperties) do + Result := MemoMode or PlainText; +end; + +{$ENDIF} + + { Utilities } + +function FontImages: TCustomImageList; + + procedure AddImage(AnImage: TBitmap); + begin + FFontImages.AddMasked(AnImage, clDefault); + end; + +begin + if FFontImages = nil then + begin + FFontImages := TImageList.Create(nil); + FFontImages.Width := cxFontNameComboBox.FTrueTypeFontBitmap.Width; + FFontImages.Height := cxFontNameComboBox.FTrueTypeFontBitmap.Height; + FFontImages.AllocBy := 2; + + AddImage(cxFontNameComboBox.FTrueTypeFontBitmap); + AddImage(cxFontNameComboBox.FNonTrueTypeFontBitmap); + end; + Result := FFontImages; +end; + +{$IFDEF DXVER500} +function RichEdit: TRichEdit; +begin + if FRichEdit = nil then + begin + FRichEditSite := TForm.Create(nil); + FRichEdit := TRichEdit.Create(nil); + FRichEdit.Parent := FRichEditSite; + end; + Result := FRichEdit; +end; +{$ENDIF} + +{ TdxReportCellColorBox } + +constructor TdxReportCellColorBox.Create(AParent: TdxReportCell); +begin + inherited; + FColorBoxFrameColor := clBtnShadow; + FColorBoxWidth := dxDefaultColorBoxWidth; + FColorValue := clBlack; +end; + +procedure TdxReportCellColorBox.Assign(Source: TPersistent); +begin + if Source is TdxReportCellColorBox then + with TdxReportCellColorBox(Source) do + begin + Self.ColorBoxFrameColor := ColorBoxFrameColor; + Self.ColorBoxWidth := ColorBoxWidth; + Self.ColorValue := ColorValue; + end; + inherited; +end; + +function TdxReportCellColorBox.ActualColorBoxWidth(DC: HDC): Integer; +var + W: Integer; +begin + Result := ColorBoxWidth; + with GetInnerBounds(DC) do + W := Right - Left; + if Result > W - 2 * LineThickness then + Result := W - 2 * LineThickness; + if Result < 0 then + Result := 0; +end; + +procedure TdxReportCellColorBox.DrawImage(DC: HDC); +begin + DrawColorBox(DC); +end; + +function TdxReportCellColorBox.MeasureContentHeight(DC: HDC): Integer; +begin + if ShowDescription then + Result := inherited MeasureContentHeight(DC) + else + Result := Height; +end; + +procedure TdxReportCellColorBox.ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); +begin + inherited; + ColorBoxWidth := MulDiv(ColorBoxWidth, APixelsNumerator, APixelsDenominator); +end; + +function TdxReportCellColorBox.GetImageAreaBounds(DC: HDC): TRect; +begin + Result := GetInnerBounds(DC); + if ShowDescription then + if ColorBoxAlignment = ccbaLeft then + Result.Right := Result.Left + ActualColorBoxWidth(DC) + 2 * LineThickness + else + Result.Left := Result.Right - ActualColorBoxWidth(DC) + 2 * LineThickness; +end; + +function TdxReportCellColorBox.GetImageBounds(DC: HDC): TRect; +begin + Result := GetImageAreaBounds(DC); + + if not IsRectEmpty(Result) then + InflateRect(Result, -LineThickness, -LineThickness); + if IsRectEmpty(Result) then + Result := NullRect; +end; + +procedure TdxReportCellColorBox.GetImageSizes(var AImageWidth, AImageHeight: Integer); +begin + AImageWidth := ActualColorBoxWidth(NullDC) + 2; + AImageHeight := Height; +end; + +function TdxReportCellColorBox.GetTextBounds(DC: HDC): TRect; +begin + if ShowDescription then + begin + Result := GetInnerBounds(DC); + if ColorBoxAlignment = ccbaLeft then + Inc(Result.Left, ActualColorBoxWidth(DC) + 2 * LineThickness) + else + Dec(Result.Right, ActualColorBoxWidth(DC) + 2 * LineThickness); + if IsRectEmpty(Result) then + Result := NullRect; + end + else + Result := NullRect; +end; + +function TdxReportCellColorBox.HasImage: Boolean; +begin + Result := True; +end; + +function TdxReportCellColorBox.IsImageBackgroundDrawn: Boolean; +begin + Result := False; +end; + +function TdxReportCellColorBox.IsImageDrawn: Boolean; +begin + Result := True; +end; + +procedure TdxReportCellColorBox.ReadData(AReader: TdxPSDataReader); +begin + inherited; + ColorBoxFrameColor := AReader.ReadInteger; + ColorBoxWidth := AReader.ReadInteger; + ColorValue := AReader.ReadInteger; +end; + +procedure TdxReportCellColorBox.WriteData(AWriter: TdxPSDataWriter); +begin + inherited; + AWriter.WriteInteger(ColorBoxFrameColor); + AWriter.WriteInteger(ColorBoxWidth); + AWriter.WriteInteger(ColorValue); +end; + +procedure TdxReportCellColorBox.DrawColorBox(DC: HDC); +begin + Renderer.FrameRect(DC, GetImageAreaBounds(DC), Color); + Renderer.FrameRect(DC, GetColorBoxFrameBounds(DC), ColorBoxFrameColor); + Renderer.FillRect(DC, GetColorBoxIntreriorBounds(DC), ColorValue); +end; + +function TdxReportCellColorBox.GetColorBoxFrameBounds(DC: HDC): TRect; +begin + Result := GetImageBounds(DC); +end; + +function TdxReportCellColorBox.GetColorBoxIntreriorBounds(DC: HDC): TRect; +begin + Result := GetColorBoxFrameBounds(DC); + if not IsRectEmpty(Result) then + InflateRect(Result, -LineThickness, -LineThickness); + if IsRectEmpty(Result) then + Result := NullRect; +end; + +function TdxReportCellColorBox.GetColorBoxAlignment: TdxReportCellColorBoxAlignment; +begin + Result := TdxReportCellColorBoxAlignment((Format and dxFormatColorBoxAlignmentMask) shr dxFormatColorBoxAlignmentOffset); +end; + +function TdxReportCellColorBox.GetShowDescription: Boolean; +begin + Result := GetFormatBit(dxFormatColorBoxShowDescription); +end; + +procedure TdxReportCellColorBox.SetColorBoxAlignment(Value: TdxReportCellColorBoxAlignment); +begin + Format := Format and not dxFormatColorBoxAlignmentMask or (Byte(Value) shl dxFormatColorBoxAlignmentOffset); +end; + +procedure TdxReportCellColorBox.SetShowDescription(Value: Boolean); +begin + SetFormatBit(dxFormatColorBoxShowDescription, Value); +end; + +{ TdxReportCellProgressBar } + +constructor TdxReportCellProgressBar.Create(AParent: TdxReportCell); +begin + inherited; + MaxValue := 100; + MinValue := 0; + Orientation := pboHorizontal; + ProgressColor := clNavy; + Value := 0; + + TextAlignX := taCenterX; + TextAlignY := taCenterY; +end; + +procedure TdxReportCellProgressBar.Assign(Source: TPersistent); +begin + if Source is TdxReportCellProgressBar then + with TdxReportCellProgressBar(Source) do + begin + Self.MaxValue := MaxValue; + Self.MinValue := MinValue; + Self.ProgressColor := ProgressColor; + Self.Value := Value; + end; + inherited; +end; + +procedure TdxReportCellProgressBar.DrawContent(DC: HDC; AStage: TdxPSRenderStages); +begin + if IsBackgroundBitmapDrawn then + DrawBackgroundBitmap(DC) + else + if IsBackgroundDrawn then + DrawBackground(DC); + + if IsProgressBarDrawn(DC) then DrawProgressBar(DC); + if IsTextDrawn then DrawText(DC); + + if IsBordersDrawn then DrawBorders(DC); +end; + +procedure TdxReportCellProgressBar.DrawProgressBar(DC: HDC); +var + R: TRect; +begin + R := GetProgressBarProgressBounds(DC); + if RectVisible(DC, R) then + Renderer.FillRect(DC, R, ProgressColor); +end; + +procedure TdxReportCellProgressBar.DrawText(DC: HDC); + + procedure DrawClippedText(var ATextRect, AClipRect: TRect; ATextColor: TColor); + var + Rgn: HRGN; + begin + ATextColor := SetTextColor(DC, ATextColor); + Rgn := Renderer.IntersectClipRect(AClipRect); + Renderer.DrawTextEx(DC, ATextRect, 0, 0, 0, Text, nil, DTFormat and not DXTO_AUTOINDENTS); + Renderer.RestoreClipRgn(Rgn); + SetTextColor(DC, ATextColor); + end; + +var + PrevFont: HFONT; + Size: TSize; + TextRect, ClipRect: TRect; +begin + PrevFont := GetCurrentObject(DC, OBJ_FONT); + SelectObject(DC, Font.Handle); + + GetTextExtentPoint32(DC, PChar(Text), Length(Text), Size); + TextRect := GetInnerBounds(DC); + InflateRect(TextRect, -(TextRect.Right - TextRect.Left - Size.cX) div 2, 0); + + if IntersectRect(ClipRect, TextRect, GetProgressBarProgressBounds(DC)) then + DrawClippedText(TextRect, ClipRect, dxPSUtl.InvertColor(ProgressColor)); + if IntersectRect(ClipRect, TextRect, GetProgressBarProgressRestBounds(DC)) then + DrawClippedText(TextRect, ClipRect, ColorToRGB(Font.Color)); + + SelectObject(DC, PrevFont); +end; + +function TdxReportCellProgressBar.GetText: string; +begin + if ShowText then + begin + Result := FloatToStr(Value); + if ShowPercentSymbol then + Result := Result + ' ' + PercentSymbol; + end + else + Result := ''; +end; + +procedure TdxReportCellProgressBar.SetText(const Value: string); +begin +end; + +function TdxReportCellProgressBar.GetProgressBarProgressBounds(DC: HDC): TRect; +begin + Result := GetInnerBounds(DC); + InflateRect(Result, -LineThickness, -LineThickness); + if IsRectEmpty(Result) then + Result := dxPSGlbl.NullRect; + + if not IsRectEmpty(Result) and (Abs(Value - MaxValue) > Eps) then + begin + with Result do + if Orientation = pboHorizontal then + Right := Left + Round((Right - Left) * (Value - MinValue) / (MaxValue - MinValue)) + else + Top := Bottom - Round((Bottom - Top) * (Value - MinValue) / (MaxValue - MinValue)); + + if IsRectEmpty(Result) then + Result := dxPSGlbl.NullRect; + end; + + if not IsRectEmpty(Result) then + dxPSCore.FixupRect(DC, Result); +end; + +function TdxReportCellProgressBar.GetProgressBarProgressRestBounds(DC: HDC): TRect; +begin + Result := GetInnerBounds(DC); + InflateRect(Result, -LineThickness, -LineThickness); + if IsRectEmpty(Result) then + Result := dxPSGlbl.NullRect; + + if not IsRectEmpty(Result) and (Abs(Value - MinValue) > Eps) then + begin + with Result do + if Orientation = pboHorizontal then + Left := Right - Round((Right - Left) * (MaxValue - Value) / (MaxValue - MinValue)) + else + Bottom := Top + Round((Bottom - Top) * (MaxValue - Value) / (MaxValue - MinValue)); + + if IsRectEmpty(Result) then + Result := dxPSGlbl.NullRect; + end; + + if not IsRectEmpty(Result) then + dxPSCore.FixupRect(DC, Result); +end; + +function TdxReportCellProgressBar.IsProgressBarDrawn(DC: HDC): Boolean; +begin + Result := not IsRectEmpty(GetProgressBarProgressBounds(DC)) or ShowText; +end; + +procedure TdxReportCellProgressBar.ReadData(AReader: TdxPSDataReader); +begin + inherited; + MaxValue := AReader.ReadFloat; + MinValue := AReader.ReadFloat; + ProgressColor := AReader.ReadInteger; + Value := AReader.ReadFloat; +end; + +procedure TdxReportCellProgressBar.WriteData(AWriter: TdxPSDataWriter); +begin + inherited; + AWriter.WriteFloat(MaxValue); + AWriter.WriteFloat(MinValue); + AWriter.WriteInteger(ProgressColor); + AWriter.WriteFloat(Value); +end; + +function TdxReportCellProgressBar.GetOrientation: TdxReportCellProgressBarOrientation; +begin + Result := TdxReportCellProgressBarOrientation((Format and dxFormatProgressBarOrientationMask) shr dxFormatProgressBarOrientationOffset); +end; + +function TdxReportCellProgressBar.GetShowPercentSymbol: Boolean; +begin + Result := GetFormatBit(dxFormatProgressBarShowPercentSymbol); +end; + +function TdxReportCellProgressBar.GetShowText: Boolean; +begin + Result := GetFormatBit(dxFormatProgressBarShowText); +end; + +procedure TdxReportCellProgressBar.SetOrientation(Value: TdxReportCellProgressBarOrientation); +begin + Format := Format and not dxFormatProgressBarOrientationMask or (Byte(Value) shl dxFormatProgressBarOrientationOffset); +end; + +procedure TdxReportCellProgressBar.SetMaxValue(Value: Double); +begin + if Value < MinValue then + Value := MinValue; + FMaxValue := Value; + SetValue(Self.Value); +end; + +procedure TdxReportCellProgressBar.SetMinValue(Value: Double); +begin + if Value > MaxValue then + Value := MaxValue; + FMinValue := Value; + SetValue(Self.Value); +end; + +procedure TdxReportCellProgressBar.SetShowPercentSymbol(Value: Boolean); +begin + SetFormatBit(dxFormatProgressBarShowPercentSymbol, Value); +end; + +procedure TdxReportCellProgressBar.SetShowText(Value: Boolean); +begin + SetFormatBit(dxFormatProgressBarShowText, Value); +end; + +procedure TdxReportCellProgressBar.SetValue(Value: Double); +begin + if Value < MinValue then Value := MinValue; + if Value > MaxValue then Value := MaxValue; + FValue := Value; +end; + +{ TdxReportCellRichEditGraphic } + +function TdxReportCellRichEditGraphic.IsBackgroundBitmapDrawn: Boolean; +begin + Result := inherited IsBackgroundBitmapDrawn and ImageTransparent; +end; + +{ TdxPSColorComboBoxDataMap } + +class function TdxPSColorComboBoxDataMap.DoesItemParticipateInBestFitCalculation(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := ColorComboBoxProperties_GetShowDescriptions(AProperties); +end; + +class function TdxPSColorComboBoxDataMap.GetText(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue): string; +begin + Result := ColorComboBoxProperties_GetText(AProperties, AValue); +end; + +class procedure TdxPSColorComboBoxDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = -1; AOwner: TObject = nil); +begin + inherited; + with TdxReportCellColorBox(AnItem) do + begin + ColorBoxAlignment := ColorComboBoxProperties_GetColorBoxAlignment(AProperties); + ColorBoxFrameColor := ColorComboBoxProperties_GetColorBoxFrameColor(AProperties); + ColorBoxWidth := ColorComboBoxProperties_GetColorBoxWidth(AProperties); + ColorValue := ColorComboBoxProperties_GetColor(AProperties, AValue); + //EndEllipsis := True; + ShowDescription := ColorComboBoxProperties_GetShowDescriptions(AProperties); + end; +end; + +class function TdxPSColorComboBoxDataMap.ItemClass(AProperties: TcxCustomEditProperties; + AnIsPreview: Boolean = False): TdxReportCellDataClass; +begin + Result := TdxReportCellColorBox; +end; + +class function TdxPSColorComboBoxDataMap.MeasureWidth(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; AFont: TFont; + ARecordIndex: Integer = 0): Integer; +begin + Result := inherited MeasureWidth(AProperties, AValue, ACellParams, AFont, ARecordIndex); + Inc(Result, 2 + dxDefaultColorBoxWidth + 2); +end; + +class function TdxPSColorComboBoxDataMap.PropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomColorComboBoxProperties; +end; + +{ TdxPSFontNameComboBoxDataMap } + +class procedure TdxPSFontNameComboBoxDataMap.GetImageLists(AProperties: TcxCustomEditProperties; + AProc: TdxPSGetImageListProc); +begin + AProc(GetImages(AProperties)); +end; + +class function TdxPSFontNameComboBoxDataMap.GetImages(AProperties: TcxCustomEditProperties): TCustomImageList; +begin + Result := FontImages; +end; + +class procedure TdxPSFontNameComboBoxDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = -1; AOwner: TObject = nil); +begin + inherited; + with TdxReportCellImage(AnItem) do + begin + if FontNameComboBox_GetShowTypeIcon(AProperties) then + begin + ImageIndex := FontNameComboBox_GetTypeIconImageIndex(AProperties, AValue); + ImageList := GetImages(AProperties); + end; + MakeSpaceForEmptyImage := True; + end; +end; + +class function TdxPSFontNameComboBoxDataMap.ItemClass(AProperties: TcxCustomEditProperties; + AnIsPreview: Boolean = False): TdxReportCellDataClass; +begin + Result := TdxReportCellImage; +end; + +class function TdxPSFontNameComboBoxDataMap.MeasureWidth(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; AFont: TFont; + ARecordIndex: Integer = 0): Integer; +begin + Result := inherited MeasureWidth(AProperties, AValue, ACellParams, AFont, ARecordIndex); + if FontNameComboBox_GetShowTypeIcon(AProperties) then + Inc(Result, 1 + GetImages(AProperties).Width + 1); +end; + +class function TdxPSFontNameComboBoxDataMap.PropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomFontNameComboBoxProperties; +end; + +{$IFDEF REGISTERCXSHELLCTRLS} + +{ TdxPSShellComboBoxDataMap } + +class function TdxPSShellComboBoxDataMap.GetImageIndex(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue): Integer; +var + Text: string; + Stub: Integer; +begin + TcxCustomShellComboBoxPropertiesAccess(AProperties).GetShellDisplayValue(AValue, False, Text, Result, Stub); +end; + +class procedure TdxPSShellComboBoxDataMap.GetImageLists(AProperties: TcxCustomEditProperties; + AProc: TdxPSGetImageListProc); +begin + AProc(GetImages(AProperties)); +end; + +class function TdxPSShellComboBoxDataMap.GetImages(AProperties: TcxCustomEditProperties): TCustomImageList; +begin + Result := dxPSUtl.ShellSmallImages; //cxShellComboBox.cxShellComboBoxImageList +end; + +class function TdxPSShellComboBoxDataMap.HasImages(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := GetImages(AProperties) <> nil; +end; + +class procedure TdxPSShellComboBoxDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = -1; AOwner: TObject = nil); +begin + inherited; + with TdxReportCellImage(AnItem) do + begin + if not TcxCustomShellComboBoxPropertiesAccess(AProperties).FastSearch then + begin + ImageList := GetImages(AProperties); + ImageIndex := GetImageIndex(AProperties, AValue); + end; + EndEllipsis := True; + MakeSpaceForEmptyImage := True; + end; +end; + +class function TdxPSShellComboBoxDataMap.ItemClass(AProperties: TcxCustomEditProperties; + AnIsPreview: Boolean = False): TdxReportCellDataClass; +begin + Result := TdxReportCellImage; +end; + +class function TdxPSShellComboBoxDataMap.PropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomShellComboBoxProperties; +end; + +class function TdxPSShellComboBoxDataMap.MeasureWidth(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; const ACellParams: IdxPSCellParams; AFont: TFont; + ARecordIndex: Integer = 0): Integer; +begin + Result := inherited MeasureWidth(AProperties, AValue, ACellParams, AFont, ARecordIndex); + if not TcxCustomShellComboBoxPropertiesAccess(AProperties).FastSearch then + Inc(Result, 1 + GetImages(AProperties).Width + 1); +end; + +{$ENDIF} + +{ TdxPSLabelDataMap } + +class function TdxPSLabelDataMap.DoesItemParticipateInAutoWidthCalculation(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := True; +end; + +class function TdxPSLabelDataMap.DoesItemParticipateInBestFitCalculation(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := True; +end; + +class procedure TdxPSLabelDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = -1; AOwner: TObject = nil); +begin + inherited; +end; + +class function TdxPSLabelDataMap.PropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomLabelProperties; +end; + +{ TdxPSProgressBarDataMap } + +class function TdxPSProgressBarDataMap.GetValue(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue): Double; + + function DropPercentSymbol(const AText: string): string; + var + P: Integer; + begin + Result := AText; + P := Pos(PercentSymbol, Result); + if P <> 0 then + begin + Delete(Result, P, Length(PercentSymbol)); + if Result[Length(Result)] = ' ' then + Delete(Result, Length(Result), 1); + end; + end; + +var + Text: string; + Code: Integer; +begin + Text := GetText(AProperties, AValue); + Text := DropPercentSymbol(Text); + Val(Text, Result, Code); + if Code <> 0 then Result := 0; +end; + +class function TdxPSProgressBarDataMap.HasText(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue): Boolean; +begin + Result := inherited HasText(AProperties, AValue) and ProgressBarProperties_GetShowText(AProperties); +end; + +class procedure TdxPSProgressBarDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = -1; AOwner: TObject = nil); +begin + inherited; + with TdxReportCellProgressBar(AnItem) do + begin + MaxValue := ProgressBarProperties_GetMaxValue(AProperties); + MinValue := ProgressBarProperties_GetMinValue(AProperties); + Multiline := False; + Orientation := ProgressBarProperties_GetOrientation(AProperties); + ProgressColor := ProgressBarProperties_GetProgressBarColor(AProperties); + ShowPercentSymbol := ProgressBarProperties_GetShowPercentSymbol(AProperties); + ShowText := ProgressBarProperties_GetShowText(AProperties); + Value := GetValue(AProperties, AValue); + end; +end; + +class function TdxPSProgressBarDataMap.ItemClass(AProperties: TcxCustomEditProperties; + AnIsPreview: Boolean = False): TdxReportCellDataClass; +begin + Result := TdxReportCellProgressBar; +end; + +class function TdxPSProgressBarDataMap.PropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomProgressBarProperties; +end; + +{ TdxPSTrackBarDataMap } + +class procedure TdxPSTrackBarDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = -1; AOwner: TObject = nil); +begin + inherited; + with TdxReportCellString(AnItem) do + begin + Multiline := False; + TextAlignX := taLeft; + TextAlignY := taCenterY; + end; +end; + +class function TdxPSTrackBarDataMap.ItemClass(AProperties: TcxCustomEditProperties; + AnIsPreview: Boolean = False): TdxReportCellDataClass; +begin + Result := TdxReportCellString; +end; + +class function TdxPSTrackBarDataMap.PropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomTrackBarProperties; +end; + +{$IFDEF DXVER500} + +{ TdxPSCheckButtonGroupDataMap } + +class function TdxPSCheckButtonGroupDataMap.ButtonGroupClass(AProperties: TcxCustomEditProperties): TdxCustomReportButtonGroupClass; +begin + Result := TdxReportCheckGroup; +end; + +class procedure TdxPSCheckButtonGroupDataMap.InitializeGroupButton(AProperties: TcxCustomEditProperties; + const AValue: TcxEditValue; AButton: TdxCustomReportCellCheck; AnIndex: Integer); +var + CheckStates: TcxCheckStates; +begin + inherited; + AButton.CheckPos := CheckGroupProperties_GetCheckPos(AProperties); + if CheckGroupProperties_GetCheckStates(AProperties, AValue, CheckStates) then + begin + AButton.Checked := CheckStates[AnIndex] in [cbsChecked, cbsGrayed]; + AButton.Enabled := (CheckStates[AnIndex] <> cbsGrayed) and CheckGroupProperties_GetIsItemEnabled(AProperties, AnIndex); + end + else + begin + AButton.Checked := False; + AButton.Enabled := True; + end; +end; + +class procedure TdxPSCheckButtonGroupDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = -1; AOwner: TObject = nil); +var + CheckGlyph: TBitmap; +begin + inherited; + with TdxReportCheckGroup(AnItem) do + begin + CheckGlyph := CheckGroupProperties_GetGlyph(AProperties); + if not CheckGlyph.Empty then + begin + Glyph := CheckGlyph; + GlyphCount := CheckGroupProperties_GetGlyphCount(AProperties); + end; + end; +end; + +class function TdxPSCheckButtonGroupDataMap.PropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomCheckGroupProperties; +end; + +{ TdxPSRichEditDataMap } + +class function TdxPSRichEditDataMap.DataMapClass(AProperties: TcxCustomEditProperties): TdxPSDataMapClass; +const + DataMapClasses: array[Boolean] of TdxPSDataMapClass = (TdxPSRichTextDataMap, TdxPSMemoDataMap); +begin + Result := DataMapClasses[RichEditProperties_GetIsMemoMode(AProperties)]; +end; + +class function TdxPSRichEditDataMap.PropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCustomRichEditProperties; +end; + +{ TdxPSRichEditDataMap } + +class function TdxPSRichTextDataMap.DoesItemParticipateInBestFitCalculation(AProperties: TcxCustomEditProperties): Boolean; +begin + Result := False; +end; + +class procedure TdxPSRichTextDataMap.InitializeItem(AnItem: TAbstractdxReportCellData; + AProperties: TcxCustomEditProperties; const AValue: TcxEditValue; + const ACellParams: IdxPSCellParams; var AViewParams: TdxReportItemViewParams; + AnIsPreview: Boolean = False; ARecordIndex: Integer = -1; AOwner: TObject = nil); + + function GetGraphicClass: TGraphicClass; + var + CellParams2: IdxPSCellParams2; + begin + if Supports(ACellParams, IdxPSCellParams2, CellParams2) then + Result := CellParams2.RichEditGraphicClass + else + Result := TMetafile; + end; + + function GetImageTransparent: Boolean; + var + CellParams2: IdxPSCellParams2; + begin + Result := Supports(ACellParams, IdxPSCellParams2, CellParams2) and CellParams2.GetRichEditTransparent; + end; + + function GetMargins: TRect; + var + CellParams2: IdxPSCellParams2; + begin + if AnIsPreview and Supports(ACellParams, IdxPSCellParams2, CellParams2) then + with Result do + begin + Left := CellParams2.PreviewMarginLeft; + Top := dxTextSpace; + Right := CellParams2.PreviewMarginRight; + Bottom := dxTextSpace; + end + else + Result := MakeRect(dxTextSpace, dxTextSpace, dxTextSpace, dxTextSpace); + end; + + function GetMaxHeight: Integer; + var + CellParams2: IdxPSCellParams2; + begin + if Supports(ACellParams, IdxPSCellParams2, CellParams2) then + Result := CellParams2.PreviewMaxHeight + else + Result := -1; + end; + +var + Graphic: TGraphic; +begin + inherited; + cxRichEdit.SetRichEditText(RichEdit, AValue); + try + RichEdit.Color := AViewParams.NativeParams.Color; + Graphic := dxPSRELnk.GetRichEditAsGraphic(RichEdit.Handle, AViewParams.NativeParams.Color, + GetMargins, GetGraphicClass, AnItem.Width, -1, GetMaxHeight, ACellParams.DC); + try + TdxReportCellRichEditGraphic(AnItem).Image := Graphic; + TdxReportCellRichEditGraphic(AnItem).ImageTransparent := GetImageTransparent; + TdxReportCellRichEditGraphic(AnItem).Transparent := GetImageTransparent; + finally + Graphic.Free; + end; + finally + cxRichEdit.SetRichEditText(RichEdit, ''); + end; +end; + +class function TdxPSRichTextDataMap.ItemClass(AProperties: TcxCustomEditProperties; + AnIsPreview: Boolean = False): TdxReportCellDataClass; +begin + Result := TdxReportCellRichEditGraphic;//TdxReportCellGraphic; +end; + +{$ENDIF} + +procedure RegisterAssistants; +begin + TdxPSColorComboBoxDataMap.Register; + TdxPSFontNameComboBoxDataMap.Register; + {$IFDEF REGISTERCXSHELLCTRLS} + TdxPSShellComboBoxDataMap.Register; + {$ENDIF} + TdxPSLabelDataMap.Register; + TdxPSProgressBarDataMap.Register; + TdxPSTrackBarDataMap.Register; + {$IFDEF DXVER500} + TdxPSCheckButtonGroupDataMap.Register; + TdxPSRichEditDataMap.Register; + {$ENDIF} +end; + +procedure RegisterItems; +begin + TdxReportCellColorBox.Register; + TdxReportCellProgressBar.Register; +end; + +procedure UnregisterAssistants; +begin + {$IFDEF DXVER500} + TdxPSRichEditDataMap.Unregister; + TdxPSCheckButtonGroupDataMap.Unregister; + {$ENDIF} + TdxPSTrackBarDataMap.Unregister; + TdxPSProgressBarDataMap.Unregister; + TdxPSLabelDataMap.Unregister; + {$IFDEF REGISTERCXSHELLCTRLS} + TdxPSShellComboBoxDataMap.Unregister; + {$ENDIF} + TdxPSFontNameComboBoxDataMap.Unregister; + TdxPSColorComboBoxDataMap.Unregister; +end; + +procedure UnregisterItems; +begin + TdxReportCellProgressBar.Unregister; + TdxReportCellColorBox.Unregister; +end; + +initialization + RegisterAssistants; + RegisterItems; + +finalization + UnregisterItems; + UnregisterAssistants; + + FreeAndNil(FFontImages); + {$IFDEF DXVER500} + FreeAndNil(FRichEdit); + FreeAndNil(FRichEditSite); + {$ENDIF} + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxExtDBEditorLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxExtDBEditorLnkReg.pas new file mode 100644 index 00000000..aef846a4 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxExtDBEditorLnkReg.pas @@ -0,0 +1,58 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxExtDBEditorLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + Classes, dxPScxExtDBEditorLnks; + +procedure Register; +begin + RegisterNoIcon([TcxDBCheckListBoxReportLink]); + {$IFDEF DXVER500} + RegisterNoIcon([TcxDBRichEditReportLink]); + {$ENDIF} +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxExtDBEditorLnks.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxExtDBEditorLnks.pas new file mode 100644 index 00000000..30da209d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxExtDBEditorLnks.pas @@ -0,0 +1,119 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxExtDBEditorLnks; + +interface + +{$I cxVer.inc} + +uses + cxDBCheckListBox, cxDBRichEdit, dxPScxCheckListBoxLnk, dxPScxExtComCtrlsLnk; + +type + TcxDBCheckListBoxReportLink = class(TcxCustomCheckListBoxReportLink) + private + function GetcxDBCheckListBox: TcxDBCheckListBox; + public + property cxDBCheckListBox: TcxDBCheckListBox read GetcxDBCheckListBox; + published + property Color; + property EndEllipsis; + property EvenColor; + property EvenFont; + property Font; + property Multiline; + property OddColor; + property OddFont; + property Options; + property RowAutoHeight; + property ScaleFonts; + property SupportedCustomDraw; + property Transparent; + property UseHorzDelimiters; + property UseVertDelimiters; + property Width; + + property OnCustomDrawItem; + property OnInitializeItem; + end; + + {$IFDEF DXVER500} + + TcxDBRichEditReportLink = class(TcxCustomRichEditReportLink) + private + function GetRichEdit: TcxDBRichEdit; + public + property RichEdit: TcxDBRichEdit read GetRichEdit; + end; + + {$ENDIF} + +implementation + +uses + dxPSCore; + +{ TcxDBCheckListBoxReportLink } + +function TcxDBCheckListBoxReportLink.GetcxDBCheckListBox: TcxDBCheckListBox; +begin + Result := inherited Component as TcxDBCheckListBox; +end; + +{$IFDEF DXVER500} + +{ TcxDBRichEditReportLink } + +function TcxDBRichEditReportLink.GetRichEdit: TcxDBRichEdit; +begin + Result := inherited Component as TcxDBRichEdit; +end; + +{$ENDIF} + +initialization + dxPSRegisterReportLink(TcxDBCheckListBoxReportLink, TcxDBCheckListBox, TcxfmCheckListBoxDesignWindow); + {$IFDEF DXVER500} + dxPSRegisterReportLink(TcxDBRichEditReportLink, TcxDBRichEdit, nil); + {$ENDIF} + +finalization + {$IFDEF DXVER500} + dxPSUnregisterReportLink(TcxDBRichEditReportLink, TcxDBRichEdit, nil); + {$ENDIF} + dxPSUnregisterReportLink(TcxDBCheckListBoxReportLink, TcxDBCheckListBox, TcxfmCheckListBoxDesignWindow); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxExtEditorLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxExtEditorLnkReg.pas new file mode 100644 index 00000000..fa89f189 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxExtEditorLnkReg.pas @@ -0,0 +1,69 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxExtEditorLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI9} + DesignIntf, +{$ENDIF} + Classes, dxPScxMCListBoxLnk, dxPScxCheckListBoxLnk, dxPScxExtComCtrlsLnk; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterNoIcon([TcxMCListBoxReportLink, TcxCheckListBoxReportLink]); + {$IFDEF DXVER500} + RegisterNoIcon([TcxRichEditReportLink]); + {$ENDIF} + RegisterNoIcon([TcxTreeViewReportLink, TcxListViewReportLink]); + {$IFDEF REGISTERCXSHELLCTRLS} + RegisterNoIcon([TcxShellListViewReportLink, TcxShellTreeViewReportLink]); + {$ENDIF} +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxExtEditorProducers.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxExtEditorProducers.pas new file mode 100644 index 00000000..7555cf6d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxExtEditorProducers.pas @@ -0,0 +1,514 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxExtEditorProducers; + +interface + +{$I cxVer.inc} + +uses + Classes, Controls, Windows, Graphics, cxFontNameComboBox, cxColorComboBox, + cxCheckComboBox, {$IFDEF REGISTERCXSHELLCTRLS} cxShellComboBox, {$ENDIF} + cxSpinButton, {$IFDEF DXVER500} cxCheckGroup, cxRichEdit, {$ENDIF} + cxLookAndFeelPainters, dxPSContainerLnk, dxPScxExtCommon, dxPScxEditorProducers, + dxPSCore; + +type + TdxPScxCustomColorComboBoxProducer = class(TdxPScxCustomTextEditProducer) + protected + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + public + function Control: TcxCustomColorComboBox; reintroduce; overload; + class function ControlClass: TControlClass; override; + function Properties: TcxCustomColorComboBoxProperties; reintroduce; overload; + end; + + {$IFDEF REGISTERCXSHELLCTRLS} + + TdxPScxCustomShellComboBoxProducer = class(TdxPScxCustomTextEditProducer) + protected + procedure GetImageLists(AProc: TdxPSGetImageListProc); override; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + public + function Control: TcxCustomShellComboBox; reintroduce; overload; + class function ControlClass: TControlClass; override; + function Properties: TcxCustomShellComboBoxProperties; reintroduce; overload; + end; + + {$ENDIF} + + TdxPScxCustomFontNameComboBoxProducer = class(TdxPScxCustomComboBoxProducer) + protected + function GetFontName: string; override; + procedure GetImageLists(AProc: TdxPSGetImageListProc); override; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function IsFontSubstitutable: Boolean; override; + function ItemClass: TdxReportVisualItemClass; override; + public + function Control: TcxCustomFontNameComboBox; reintroduce; overload; + class function ControlClass: TControlClass; override; + function Properties: TcxCustomFontNameComboBoxProperties; reintroduce; overload; + end; + + TdxPScxCustomCheckComboBoxProducer = class(TdxPScxCustomComboBoxProducer) + public + function Control: TcxCustomCheckComboBox; reintroduce; overload; + class function ControlClass: TControlClass; override; + function Properties: TcxCustomCheckComboBoxProperties; reintroduce; overload; + end; + + TdxPScxCustomSpinButtonAsMetafileProducer = class(TdxPSWinControlAsMetafileProducer) + protected + class function BuddyClass: TdxPSCustomProducerClass; override; + end; + + TdxPScxCustomSpinButtonProducer = class(TdxPScxCustomTextEditProducer) + public + function Control: TcxCustomSpinButton; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + {$IFDEF DXVER500} + + TdxPScxCustomCheckGroupProducer = class(TdxPScxCustomButtonGroupProducer) + protected + function CanProcessChild(AChildControl: TControl): Boolean; override; + procedure InitializeButton(AGroup: TdxCustomReportButtonGroup; + AButton: TdxCustomReportCellCheck; AnIndex: Integer); override; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + public + function Control: TcxCustomCheckGroup; reintroduce; overload; + class function ControlClass: TControlClass; override; + function Properties: TcxCustomCheckGroupProperties; reintroduce; overload; + end; + + TdxPScxCustomRichEditProducer = class(TdxPScxContainerProducer) + protected + function CreateImage: TGraphic; virtual; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + function ObjectExpandHeight: Boolean; override; + public + function Control: TcxCustomRichEdit; reintroduce; overload; + class function ControlClass: TControlClass; override; + + function ProducingObjectFriendlyName: string; override; + end; + + {$ENDIF} + +implementation + +uses + ImgList, SysUtils, dxPSGlbl, dxPSUtl, dxPScxCheckListBoxLnk, {dxPScxImgLnk,} + {$IFDEF REGISTERCXSHELLCTRLS} dxPScxExtComCtrlsLnk, {$ENDIF} dxPScxMCListBoxLnk, + {$IFDEF DXVER500} cxCheckBox, {$ENDIF} dxPSRELnk; + +type + TdxCustomReportCellCheckAccess = class(TdxCustomReportCellCheck); + + TcxCustomColorComboBoxAccess = class(TcxCustomColorComboBox); + TcxCustomFontNameComboBoxAccess = class(TcxCustomFontNameComboBox); + {$IFDEF DXVER500} + TcxCustomCheckGroupPropertiesAccess = class(TcxCustomCheckGroupProperties); + TcxCustomRichEditAccess = class(TcxCustomRichEdit); + {$ENDIF} + TcxCustomColorComboBoxPropertiesAccess = class(TcxCustomColorComboBoxProperties); + TcxCustomFontNameComboBoxPropertiesAccess = class(TcxCustomFontNameComboBoxProperties); + {$IFDEF REGISTERCXSHELLCTRLS} + TcxCustomShellComboBoxPropertiesAccess = class(TcxCustomShellComboBoxProperties); + {$ENDIF} + +{ TdxPScxColorComboBoxProducer } + +function TdxPScxCustomColorComboBoxProducer.Control: TcxCustomColorComboBox; +begin + Result := inherited Control as TcxCustomColorComboBox; +end; + +class function TdxPScxCustomColorComboBoxProducer.ControlClass: TControlClass; +begin + Result := TcxCustomColorComboBox; +end; + +function TdxPScxCustomColorComboBoxProducer.Properties: TcxCustomColorComboBoxProperties; +begin + Result := inherited Properties as TcxCustomColorComboBoxProperties; +end; + +procedure TdxPScxCustomColorComboBoxProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + with TcxCustomColorComboBoxPropertiesAccess(Properties) do + begin + TdxReportCellColorBox(AnItem).ColorBoxAlignment := ColorBoxAlignmentMap[ColorBoxAlign]; + TdxReportCellColorBox(AnItem).ColorBoxFrameColor := ColorBoxFrameColor; + TdxReportCellColorBox(AnItem).ColorBoxWidth := ColorBoxWidth; + TdxReportCellColorBox(AnItem).ColorValue := TcxCustomColorComboBoxAccess(Control).ColorValue; + TdxReportCellColorBox(AnItem).EndEllipsis := False; + TdxReportCellColorBox(AnItem).ShowDescription := ShowDescriptions; + end; +end; + +function TdxPScxCustomColorComboBoxProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellColorBox; +end; + +{$IFDEF REGISTERCXSHELLCTRLS} + +{ TdxPScxCustomShellComboBoxProducer } + +function TdxPScxCustomShellComboBoxProducer.Control: TcxCustomShellComboBox; +begin + Result := inherited Control as TcxCustomShellComboBox; +end; + +class function TdxPScxCustomShellComboBoxProducer.ControlClass: TControlClass; +begin + Result := TcxCustomShellComboBox; +end; + +function TdxPScxCustomShellComboBoxProducer.Properties: TcxCustomShellComboBoxProperties; +begin + Result := inherited Properties as TcxCustomShellComboBoxProperties; +end; + +procedure TdxPScxCustomShellComboBoxProducer.GetImageLists(AProc: TdxPSGetImageListProc); +begin + inherited; + AProc(dxPSUtl.ShellSmallImages); +end; + +procedure TdxPScxCustomShellComboBoxProducer.InitializeItem(AnItem: TdxReportVisualItem); +var + AText: string; + AnImageIndex, Stub: Integer; +begin + inherited; + with TcxCustomShellComboBoxPropertiesAccess(Properties) do + begin + GetShellDisplayValue(Control.EditValue, False, AText, AnImageIndex, Stub); + if not FastSearch then + begin + TdxReportCellImage(AnItem).ImageList := dxPSUtl.ShellSmallImages; //cxShellComboBox.cxShellComboBoxImageList; + TdxReportCellImage(AnItem).ImageIndex := AnImageIndex; + end; + TdxReportCellImage(AnItem).EndEllipsis := True; + TdxReportCellImage(AnItem).Text := AText; + end; +end; + +function TdxPScxCustomShellComboBoxProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellImage; +end; + +{$ENDIF} + +{ TdxPScxCustomFontNameComboBoxProducer } + +function TdxPScxCustomFontNameComboBoxProducer.Control: TcxCustomFontNameComboBox; +begin + Result := inherited Control as TcxCustomFontNameComboBox; +end; + +class function TdxPScxCustomFontNameComboBoxProducer.ControlClass: TControlClass; +begin + Result := TcxCustomFontNameComboBox; +end; + +function TdxPScxCustomFontNameComboBoxProducer.Properties: TcxCustomFontNameComboBoxProperties; +begin + Result := inherited Properties as TcxCustomFontNameComboBoxProperties; +end; + +function TdxPScxCustomFontNameComboBoxProducer.GetFontName: string; +begin + if not IsFontSubstitutable then + Result := TcxCustomFontNameComboBoxPropertiesAccess(Properties).Items[TcxCustomFontNameComboBoxAccess(Control).ItemIndex] + else + Result := inherited GetFontName; +end; + +procedure TdxPScxCustomFontNameComboBoxProducer.GetImageLists(AProc: TdxPSGetImageListProc); +begin + inherited; + AProc(FontImages); +end; + +procedure TdxPScxCustomFontNameComboBoxProducer.InitializeItem(AnItem: TdxReportVisualItem); +const + ImageIndexes: array[Boolean] of Integer = (1, 0); +var + ItemIndex: Integer; +begin + inherited; + with TcxCustomFontNameComboBoxPropertiesAccess(Properties) do + begin + ItemIndex := TcxCustomFontNameComboBoxAccess(Control).ItemIndex; + if ftiShowInCombo in ShowFontTypeIcon then + begin + TdxReportCellImage(AnItem).ImageList := FontImages; + if ItemIndex > -1 then + TdxReportCellImage(AnItem).ImageIndex := ImageIndexes[cxftTTF in ItemTypes[ItemIndex]]; + end; + TdxReportCellImage(AnItem).MakeSpaceForEmptyImage := ftiShowInCombo in ShowFontTypeIcon; + end; +end; + +function TdxPScxCustomFontNameComboBoxProducer.IsFontSubstitutable: Boolean; +begin + Result := not (TcxCustomFontNameComboBoxPropertiesAccess(Properties).UseOwnFont and + (TcxCustomFontNameComboBoxAccess(Control).ItemIndex <> -1)); +end; + +function TdxPScxCustomFontNameComboBoxProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellImage; +end; + +{ TdxPScxCustomCheckComboBoxProducer } + +function TdxPScxCustomCheckComboBoxProducer.Control: TcxCustomCheckComboBox; +begin + Result := inherited Control as TcxCustomCheckComboBox; +end; + +class function TdxPScxCustomCheckComboBoxProducer.ControlClass: TControlClass; +begin + Result := TcxCustomCheckComboBox; +end; + +function TdxPScxCustomCheckComboBoxProducer.Properties: TcxCustomCheckComboBoxProperties; +begin + Result := inherited Properties as TcxCustomCheckComboBoxProperties; +end; + +{ TdxPScxCustomSpinButtonAsMetafileProducer } + +class function TdxPScxCustomSpinButtonAsMetafileProducer.BuddyClass: TdxPSCustomProducerClass; +begin + Result := TdxPScxCustomSpinButtonProducer; +end; + +{ TdxPScxCustomSpinButtonProducer } + +function TdxPScxCustomSpinButtonProducer.Control: TcxCustomSpinButton; +begin + Result := inherited Control as TcxCustomSpinButton; +end; + +class function TdxPScxCustomSpinButtonProducer.ControlClass: TControlClass; +begin + Result := TcxCustomSpinButton; +end; + +{$IFDEF DXVER500} + +{ TdxPScxCustomCheckGroupProducer } + +function TdxPScxCustomCheckGroupProducer.Control: TcxCustomCheckGroup; +begin + Result := inherited Control as TcxCustomCheckGroup; +end; + +class function TdxPScxCustomCheckGroupProducer.ControlClass: TControlClass; +begin + Result := TcxCustomCheckGroup; +end; + +function TdxPScxCustomCheckGroupProducer.Properties: TcxCustomCheckGroupProperties; +begin + Result := inherited Properties as TcxCustomCheckGroupProperties; +end; + +function TdxPScxCustomCheckGroupProducer.CanProcessChild(AChildControl: TControl): Boolean; +begin + Result := inherited CanProcessChild(AChildControl) and + not (AChildControl is TcxCheckGroupButton); +end; + +// TcxCheckBoxState = (cbsUnchecked, cbsChecked, cbsGrayed); +procedure TdxPScxCustomCheckGroupProducer.InitializeButton(AGroup: TdxCustomReportButtonGroup; + AButton: TdxCustomReportCellCheck; AnIndex: Integer); +const + LeftRightMap: array[TLeftRight] of TdxCellCheckPos = (ccpLeft, ccpRight); +begin + inherited; + with TdxCustomReportCellCheckAccess(AButton) do + begin + CheckPos := LeftRightMap[TcxCustomCheckGroupPropertiesAccess(Properties).ItemAlignment]; + Checked := Control.States[AnIndex] in [cbsChecked, cbsGrayed]; + Enabled := (Control.States[AnIndex] <> cbsGrayed) and + TcxCustomCheckGroupPropertiesAccess(Properties).Items[AnIndex].Enabled; + end; +end; + +procedure TdxPScxCustomCheckGroupProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + with TdxReportCheckGroup(AnItem) do + if not TcxCustomCheckGroupPropertiesAccess(Properties).Glyph.Empty then + begin + Glyph := TcxCustomCheckGroupPropertiesAccess(Properties).Glyph; + GlyphCount := TcxCustomCheckGroupPropertiesAccess(Properties).GlyphCount; + end; +end; + +function TdxPScxCustomCheckGroupProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCheckGroup; +end; + +{ TdxPScxCustomRichEditProducer } + +function TdxPScxCustomRichEditProducer.Control: TcxCustomRichEdit; +begin + Result := inherited Control as TcxCustomRichEdit; +end; + +class function TdxPScxCustomRichEditProducer.ControlClass: TControlClass; +begin + Result := TcxCustomRichEdit; +end; + +function TdxPScxCustomRichEditProducer.ProducingObjectFriendlyName: string; +begin + Result := ''; + if not IsDesigning and (TcxCustomRichEditAccess(Control).Text <> '') then + Result := dxPSContainerLnk.dxPSMakeFriendlyNameFromStrings(TcxCustomRichEditAccess(Control).Lines); + if Result = '' then + Result := inherited ProducingObjectFriendlyName; +end; + +function TdxPScxCustomRichEditProducer.CreateImage: TGraphic; + + function GetMargins: TRect; + begin + Result := Rect(dxTextSpace, dxTextSpace, dxTextSpace, dxTextSpace); + end; + + function GetMaxHeight: Integer; + begin + if Definition.OptionsPlace.ExpandHeight then + Result := -1 + else + Result := Control.Height; + end; + +begin + Result := GetRichEditAsGraphic(TcxCustomRichEditAccess(Control).InnerRich.Handle, ContentColor, + GetMargins, TMetafile, Control.Width, -1, GetMaxHeight, DC) +end; + +procedure TdxPScxCustomRichEditProducer.InitializeItem(AnItem: TdxReportVisualItem); +var + Graphic: TGraphic; +begin + inherited; + with TdxReportCellGraphic(AnItem) do + begin + BorderClass := Self.BorderClass; + BorderColor := Self.BorderColor; + CellSides := cxBordersMap(Style.Edges); + Color := TcxCustomRichEditAccess(Control).Color; + ShowShadow := Style.Shadow; + + Graphic := Self.CreateImage; + try + Image := Graphic; + finally + Graphic.Free; + end; + Transparent := False; + end; +end; + +function TdxPScxCustomRichEditProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCellGraphic; +end; + +function TdxPScxCustomRichEditProducer.ObjectExpandHeight: Boolean; +begin + Result := False; +end; + +{$ENDIF} + +procedure RegisterAssistants; +begin + TdxPScxCustomColorComboBoxProducer.Register; + {$IFDEF REGISTERCXSHELLCTRLS} + TdxPScxCustomShellComboBoxProducer.Register; + {$ENDIF} + TdxPScxCustomFontNameComboBoxProducer.Register; + TdxPScxCustomCheckComboBoxProducer.Register; + TdxPScxCustomSpinButtonProducer.Register; + TdxPScxCustomSpinButtonAsMetafileProducer.Register; + {$IFDEF DXVER500} + TdxPScxCustomCheckGroupProducer.Register; + TdxPScxCustomRichEditProducer.Register; + {$ENDIF} +end; + +procedure UnregisterAssistants; +begin + {$IFDEF DXVER500} + TdxPScxCustomRichEditProducer.Unregister; + TdxPScxCustomCheckGroupProducer.Unregister; + {$ENDIF} + TdxPScxCustomSpinButtonAsMetafileProducer.Unregister; + TdxPScxCustomSpinButtonProducer.Unregister; + TdxPScxCustomCheckComboBoxProducer.Unregister; + TdxPScxCustomFontNameComboBoxProducer.Unregister; + {$IFDEF REGISTERCXSHELLCTRLS} + TdxPScxCustomShellComboBoxProducer.Unregister; + {$ENDIF} + TdxPScxCustomColorComboBoxProducer.Unregister; +end; + +initialization + RegisterAssistants; + +finalization + UnregisterAssistants; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxGrid4Lnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPScxGrid4Lnk.dfm new file mode 100644 index 00000000..9d2f79b9 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxGrid4Lnk.dfm @@ -0,0 +1,2090 @@ +object dxfmGridReportLinkDesignWindow: TdxfmGridReportLinkDesignWindow + Left = 463 + Top = 133 + BorderStyle = bsDialog + Caption = 'fmdxGridDesignWindow' + ClientHeight = 437 + ClientWidth = 648 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 4 + Width = 642 + Height = 399 + ActivePage = tshFormatting + TabOrder = 0 + OnChange = PageControl1Change + object tshView: TTabSheet + Caption = 'View' + object lblShow: TLabel + Left = 5 + Top = 8 + Width = 26 + Height = 13 + Caption = 'Show' + end + object imgShow: TImage + Left = 9 + Top = 37 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlShow: TBevel + Left = 43 + Top = 12 + Width = 266 + Height = 4 + Shape = bsBottomLine + end + object lblOnEveryPage: TLabel + Left = 5 + Top = 164 + Width = 72 + Height = 13 + Caption = 'On Every Page' + end + object imgOnEveryPage: TImage + Left = 9 + Top = 189 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888777777777777777708888888888 + 888887FFFFFFFFFFFFFFF08888888888888887F7777777777777F07777708888 + 888887F7777777777777F0FFFFF08888888887F7777777777777F07777F07777 + 708887FFFFFFFFFFFFFFF07777F0FFFFF08887F777777777777FF07777F07777 + F08887FFFFFFFFFFFFFFF0FFFFF07777F08887F77777777777FFF077FFF07777 + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777777FFFFF0777FF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777FFFFFFFF07FFFF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF0777FF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF077FFF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777777F077FFF077FF + F08887F7777777777777F0FFFFF0FFFFF08887F7777777777777F0FFFFF07FFF + F08887FFFFFFFFFFFFFFF07777F0FFFFF0888000000000000000007777F077FF + F08888888887F7777777777777F0FFFFF08888888887FFFFFFFFFFFFFFF07777 + F0888888888000000000000000007777F08888888888888887F7777777777777 + F08888888888888887FFFFFFFFFFFFFFF0888888888888888000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlOnEveryPage: TBevel + Left = 90 + Top = 168 + Width = 221 + Height = 4 + Shape = bsBottomLine + end + object bvlWarningHost: TBevel + Left = 4 + Top = 289 + Width = 313 + Height = 77 + Visible = False + end + object chbxShowBands: TCheckBox + Tag = 1 + Left = 90 + Top = 42 + Width = 200 + Height = 17 + Caption = 'Ba&nds' + TabOrder = 1 + OnClick = OptionsViewClick + end + object chbxShowHeaders: TCheckBox + Tag = 2 + Left = 90 + Top = 63 + Width = 200 + Height = 17 + Caption = '&Headers' + TabOrder = 2 + OnClick = OptionsViewClick + end + object chbxShowFooters: TCheckBox + Tag = 3 + Left = 90 + Top = 84 + Width = 200 + Height = 17 + Caption = 'Foo&ters' + TabOrder = 3 + OnClick = OptionsViewClick + end + object chbxShowGroupFooters: TCheckBox + Tag = 4 + Left = 90 + Top = 104 + Width = 200 + Height = 17 + Caption = 'G&roup Footers' + TabOrder = 4 + OnClick = OptionsViewClick + end + object chbxShowExpandButtons: TCheckBox + Tag = 5 + Left = 90 + Top = 125 + Width = 200 + Height = 17 + Caption = 'Expand Buttons' + TabOrder = 5 + OnClick = OptionsViewClick + end + object chbxBandsOnEveryPage: TCheckBox + Tag = 1 + Left = 90 + Top = 202 + Width = 200 + Height = 17 + Caption = 'Ba&nds' + TabOrder = 8 + OnClick = OptionsOnEveryPageClick + end + object chbxHeadersOnEveryPage: TCheckBox + Tag = 2 + Left = 90 + Top = 223 + Width = 200 + Height = 17 + Caption = 'Headers' + TabOrder = 9 + OnClick = OptionsOnEveryPageClick + end + object chbxFootersOnEveryPage: TCheckBox + Tag = 3 + Left = 90 + Top = 245 + Width = 200 + Height = 17 + Caption = 'Footers' + TabOrder = 10 + OnClick = OptionsOnEveryPageClick + end + object chbxFilterBarOnEveryPage: TCheckBox + Tag = 4 + Left = 90 + Top = 266 + Width = 200 + Height = 17 + Caption = 'FilterBar' + TabOrder = 11 + OnClick = OptionsOnEveryPageClick + end + object chbxCaptionsOnEveryPage: TCheckBox + Left = 90 + Top = 181 + Width = 200 + Height = 17 + Caption = 'Captions' + TabOrder = 7 + OnClick = OptionsOnEveryPageClick + end + object chbxShowCaptions: TCheckBox + Left = 90 + Top = 22 + Width = 200 + Height = 17 + Caption = 'Captions' + TabOrder = 0 + OnClick = OptionsViewClick + end + object chbxShowFilterBar: TCheckBox + Tag = 6 + Left = 90 + Top = 146 + Width = 200 + Height = 17 + Caption = 'FilterBar' + TabOrder = 6 + OnClick = OptionsViewClick + end + object lblPreviewWindow: TStaticText + Left = 323 + Top = 1 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 12 + end + end + object tshBehaviors: TTabSheet + Caption = 'Behaviors' + ImageIndex = 1 + object lblSelection: TLabel + Left = 5 + Top = 8 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object imgSelection: TImage + Left = 9 + Top = 28 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlSelection: TBevel + Left = 56 + Top = 12 + Width = 255 + Height = 4 + Shape = bsBottomLine + end + object lblExpanding: TLabel + Left = 5 + Top = 74 + Width = 50 + Height = 13 + Caption = 'Expanding' + end + object imgExpanding: TImage + Left = 9 + Top = 95 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 7778800000000000000000000000078888888888880000000000000000000000 + 007880FFF7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7FF777777FFF77777FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F8F7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7F7F8888FF7F88888FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F8F7777777777777777777078888888888880F7F7F888FFF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F0788077777777777777777777770788C8888C88880F7FF888888FFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880F0F7777777FFFFFFFFFFFF0788CCCCCCCC880F77777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7F7F8888FF7F88888FF7 + F0788077777777777777777777770788C8888C88880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F7F7F8888FF7F888888F7 + F0788077777777777777777777770788CCCC8CC8880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCCCCCC880F7FF88888FFFFFFFFFFF7 + F07880F0F777777FFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F77777777777777777777 + F078800000000000000000000000078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F888888880F88888888888078888888888880F77777777777777777777 + F07880F800008880F80000000008078888888888880F77777777777777777777 + F07880FFFFFFFFF0FFFFFFFFFFFF078888888888880FFFFFFFFFFFFFFFFFFFFF + F078800000000000000000000000088888888888880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlExpanding: TBevel + Left = 62 + Top = 79 + Width = 248 + Height = 4 + Shape = bsBottomLine + end + object lblDetails: TLabel + Left = 5 + Top = 218 + Width = 32 + Height = 13 + Caption = 'Details' + end + object bvlDetails: TBevel + Left = 47 + Top = 223 + Width = 265 + Height = 4 + Shape = bsBottomLine + end + object imgDetails: TImage + Left = 9 + Top = 239 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0889999999999999999999907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897F78FF7FF77777788F907DDDDDDDDDDDD0FF777FFFF7FFF7777FFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDDDDDDDDDDD0FF777777F7FF77777777F + F07DD0889777777777777777777907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCDDDDCDDDD0777777777777777777777 + 707DD08897F777F7FF7777888FF907DDCCCCDCCDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCCCCCCCCDD0FF7777FFF7FF7777777FF + F07DD0889777777777777777777907DDCCCCDCCDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCDDDDCDDDD0777777777777777777777 + 707DD08897F788F7FF77778FFFF907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDDDDDDDDDDD0FF777777F7FF777777777 + F07DD0889777777777777777777907DDCDDDDCDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCCCCDCCDDD0777777777777777777777 + 707DD08897F888F7FF7777788FF907DDCCCCCCCCDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCCCCDCCDDD0FF77777FF7FF7777777FF + F07DD0889000000000000000000907DDCDDDDCDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897888880F8888888888907DDDDDDDDDDDD0777777777777777777777 + 707DD08897F77780F8777777778907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFF80FFFFFFFFFFF907DDDDDDDDDDDD0FF7777FFF7FF7777777FF + F07DD0889000000000000000000907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD0889999999999999999999907DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFFFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD0F0F777777FF77777777FFF07DDDDDDDDDDDD0FF77777FF7FF77777777F + F07DD0FFFFFFFFFFFFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F888888880F8888888888807DDDDDDDDDDDD0F888888880F8888888888 + 807DD0F877778880F8777777777807DDDDDDDDDDDD0F877777880F8777777778 + 807DD0FFFFFFFFF0FFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFF0FFFFFFFFFFF + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgLevels: TImage + Left = 9 + Top = 306 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDD77777777777777777777 + 7777D0000000000000000000000007DDDDDDDDDDDDD000000000000000000000 + 0007D0888888888888888888888807DDDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFF + FF07D0F000FF8F000FF8FCCCC44F07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7F77F8F77F7F8FCC99F + 7F07D0888888888888888888888807DDDDDDDDDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0FFFFFF8FFFFFF8F666CCCF07DDDDDDDDDDDDD0F7F77F8F777FF8FCC99F + 7F07D0F0000F8F00F0F8F999999F07DDCDDDDCDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDCCCCDCCDDDD0F7888888888888888888 + 7F07D0888888888888888888888807DDCCCCCCCCDDD0F7F77F8F777FF8FC99CF + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDCCCCDCCDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0F00FFF8F0000F8F9999CCF07DDCDDDDCDDDDD0F7888888888888888888 + 7F07D0FFFFFF8FFFFFF8F99AAACF07DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0F0000F8F000FF8F9999CCF07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0888888888888888888888807DDDDDDDDDDDDD0F0000000000000000000 + 0F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFF + FF07D0F0000F8F000FF8FB99944F07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7F77F8F7777F8F777FF + 7F07D0777777777777777777777707DDDDDDDDDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0F888887F888887F888888807DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0F000087F800087F800000807DDDDDDDDDDDDD0F7F77F8F7777F8F777FF + 7F07D0F888887F888887F888888807DDDDDDDDDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0FFFFFF7FFFFFF7FFFFFFFF07DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0000000000000000000000007DDCDDDDCDDDDD0F7888888888888888888 + 7F07D7F88880777777777777777778DDCCCCDCCDDDD0F7777777777777777777 + 7F07D7F00080F87777788088888888DDCCCCCCCCDDD0F7777777777777777777 + 7F07D7F77780FFFFFFFFF088888888DDCCCCDCCDDDD0F0000000000000000000 + 0F07D7FFFFF0777777777088888888DDCDDDDCDDDDD0FFFFFFFFFFFFFFFFFFFF + FF07D7777770888888888888888888DDDDDDDDDDDDD000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblLevels: TLabel + Left = 5 + Top = 285 + Width = 30 + Height = 13 + Caption = 'Levels' + end + object bvlLevels: TBevel + Left = 47 + Top = 290 + Width = 265 + Height = 4 + Shape = bsBottomLine + end + object lblGridSize: TLabel + Left = 5 + Top = 150 + Width = 19 + Height = 13 + Caption = 'Size' + end + object bvlGridSize: TBevel + Left = 33 + Top = 154 + Width = 277 + Height = 4 + Shape = bsBottomLine + end + object imgGridSize: TImage + Left = 9 + Top = 172 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000008088F07DDDDDDDDDDDD0800000000000000000000 + 807DD0F0FFFF8FFFF8FFFF0FFF0F07DDDDDDDDDDDD0F0F77FFF8F777F8F777F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCDDDDCDDDD0F0F00FFF8F00FF8F00FF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCCCCCDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCDDDDCDDDD0F0FFFFFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCCCCDCCDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCCCCCDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCDCCDDD0F0FFFFFF8F0FFF8F0FFF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0777777777777770FFF0F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F0F8887F8887F8880FFF8F07DDDDDDDDDDDD0F0F888887F88887F88880 + F07DD0F0F0087F0087F0080FFF0F07DDDDDDDDDDDD0F0F800087F80087F80080 + F07DD0F0FFFF7FFFF7FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF7FFFFF7FFFFF0 + F07DD0800000000000000008080807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxProcessSelection: TCheckBox + Left = 90 + Top = 25 + Width = 200 + Height = 17 + Caption = 'Process Selection' + TabOrder = 0 + OnClick = OptionsSelectionClick + end + object chbxProcessExactSelection: TCheckBox + Tag = 1 + Left = 90 + Top = 46 + Width = 200 + Height = 17 + Caption = 'Process Exact Selection' + TabOrder = 1 + OnClick = OptionsSelectionClick + end + object chbxExpandGroupRows: TCheckBox + Left = 90 + Top = 89 + Width = 200 + Height = 17 + Caption = 'Groups' + TabOrder = 2 + OnClick = OptionsExpandingClick + end + object chbxExpandMasterRows: TCheckBox + Tag = 1 + Left = 90 + Top = 111 + Width = 200 + Height = 17 + Caption = 'Details' + TabOrder = 3 + OnClick = OptionsExpandingClick + end + object chbxStartFromActiveView: TCheckBox + Left = 90 + Top = 236 + Width = 200 + Height = 17 + Caption = 'Start From Active Details' + TabOrder = 6 + OnClick = OptionsDetailsClick + end + object chbxOnlyActiveView: TCheckBox + Tag = 1 + Left = 90 + Top = 258 + Width = 200 + Height = 17 + Caption = 'Only Active Details' + TabOrder = 7 + OnClick = OptionsDetailsClick + end + object chbxLevelsUnwrap: TCheckBox + Left = 90 + Top = 303 + Width = 200 + Height = 17 + Caption = '&Unwrap' + TabOrder = 8 + OnClick = OptionsLevelsClick + end + object chbxLevelsUnwrapTopLevel: TCheckBox + Tag = 1 + Left = 90 + Top = 326 + Width = 200 + Height = 17 + Caption = 'Unwrap Top Level' + TabOrder = 9 + OnClick = OptionsLevelsClick + end + object chbxLevelsRiseActiveLevelOntoTop: TCheckBox + Tag = 2 + Left = 90 + Top = 349 + Width = 200 + Height = 17 + Caption = 'Rise Active Level onto Top' + TabOrder = 10 + OnClick = OptionsLevelsClick + end + object chbxGridAutoWidth: TCheckBox + Left = 90 + Top = 169 + Width = 200 + Height = 17 + Caption = '&Auto Width' + TabOrder = 5 + OnClick = OptionsSizeClick + end + object chbxExpandCards: TCheckBox + Tag = 2 + Left = 90 + Top = 132 + Width = 200 + Height = 17 + Caption = 'Cards' + TabOrder = 4 + OnClick = OptionsExpandingClick + end + end + object tshFormatting: TTabSheet + Caption = 'Formatting' + ImageIndex = 4 + object lblLookAndFeel: TLabel + Left = 5 + Top = 8 + Width = 66 + Height = 13 + Caption = 'Look and Feel' + end + object bvlLookAndFeel: TBevel + Left = 85 + Top = 12 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object imgLookAndFeel: TImage + Left = 9 + Top = 28 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D08777777777780877777788807DCCCCDCCDDD0877777777778787777788 + 8F07D08888888888880888888888807DCCCCCCCCDD0888888888888788888888 + 8F07D00000000000000000000000007DCCCCDCCDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F7777777FF07DDDDDDDDDDD0F777777777FF7F7777777 + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F777777FFF07DDDDDDDDDDD0F777777FFFFF7F777777F + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F7777777777F7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F77777FFFF07DDDDDDDDDDD0F77777777FFF7F77777FF + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D00000000000000000000000007DCDDDDCDDDD0000000000000000000000 + 0007D08888888888880888888888807DCCCCDCCDDD0777777777777777777777 + 7707D08888888888880888888888807DCCCCCCCCDD0F88888888888788888888 + 8707D08000000008880880000000807DCCCCDCCDDD0F00000000888788000000 + 8707D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + F707D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgRefinements: TImage + Left = 9 + Top = 95 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FF7FFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF777777F + F07DD0F77777777FF7FF70888FFF07DDCCCCCCCCDD0F77777777FF7FF7FFFF7F + F07DD0FFFFFFFFFFF7FF70FF8FFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF7F00F7F + F07DD0F777777FFFF7FF70FF8FFF07DDCDDDDCDDDD0F777777FFFF7FF7F00F7F + F07DD0FFFFFFFFFFF7FF70000FFF07DDDDDDDDDDDD0FFFFFFFFFFF7FF7FFFF7F + F07DD0F77777777FF7FF777777FF07DDDDDDDDDDDD0F77777777FF7FF777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFCCCCCFFF07DDCCCCCCCCDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FCCCCCCCFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F7777777FFF7FFCCCCCFFF07DDCDDDDCDDDD0F7777777FFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7F9999999FF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F777777777F7FF99999FFF07DDDDDDDDDDDD0F777777777F7F7777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F80000888887F88888888707DDDDDDDDDDDD0F80000888887F88888888 + 707DD0F80000000087F80000008707DDDDDDDDDDDD0F80000000087F80000008 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0FFFFFFFFFFF7FFFFFFFFF707DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + 707DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblRefinements: TLabel + Left = 5 + Top = 74 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlRefinements: TBevel + Left = 70 + Top = 79 + Width = 241 + Height = 4 + Shape = bsBottomLine + end + object bvlRefinementsSeparator: TBevel + Left = 90 + Top = 168 + Width = 221 + Height = 4 + Shape = bsBottomLine + end + object lblPagination: TLabel + Left = 5 + Top = 229 + Width = 50 + Height = 13 + Caption = 'Pagination' + end + object bvlPagination: TBevel + Left = 64 + Top = 234 + Width = 247 + Height = 4 + Shape = bsBottomLine + end + object imgPagination: TImage + Left = 8 + Top = 251 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDD0000000000000000000000007DDDDDDDDDDDD77777777777777770DDDDD + DDDDD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD7FFFFFFFFFFFFFFF0DDDDD + DDDDD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD7F8888888888888F0DDDDD + DDDDD0888000000000000000088F07DDDDDDDDDDDD7F8777877778778F07770D + DDDDD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7F8888888888888F0FFF0D + DDDDD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F088F0D + DDDDD0F9F0F00F8F00F8F00F0F9F07DDDDDDDDDDDD7F8888888888888F078F07 + 770DD0F990FFFF8FFFF8FFFF099F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F088F0F + FF0DD0F99999999999999999999F07DDCDDDDCDDDD7F8FFF8FFFF8FF8F0F8F08 + 8F0DD0F990FFFF8FFFF8FFFF099F07DDCCCCDCCDDD7F8888888888888F088F07 + 8F0DD0F9F0FFFF8F00F8F00F0F9F07DDCCCCCCCCDD7F8FFF8FFFF8FF8F0F8F08 + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDCCCCDCCDDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F8F0FFFF8F00F8F00F0F8F07DDCDDDDCDDDD7F8888888888888F088F08 + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F9F0F00F8F00F8F00F0F9F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F990FFFF8FFFF8FFFF099F07DDCDDDDCDDDD7F8888888888888F088F0F + 8F0DD0F99999999999999999999F07DDCCCCDCCDDD7F8FFF8FFFF8FF8F0F8F08 + 8F0DD0F990FFFF8FFFF8FFFF099F07DDCCCCCCCCDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F9F0FFFF8F00F8F00F0F9F07DDCCCCDCCDDD7F8888888888888F088F0F + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDCDDDDCDDDD7F8777877778778F0F8F08 + 8F0DD0F8F0F00F8F00F8F00F0F8F07DDDDDDDDDDDD7F8888888888888F0F8F0F + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7FFFFFFFFFFFFFFF088F0F + 8F0DD0F8F0777777777777770F8F07DDDDDDDDDDDD0000000000000000078F08 + 8F0DD0F8F0F8887F8887F8880F8F07DDDDDDDDDDDDDDDD7F8888888888888F0F + 8F0DD0F8F0F0087F0087F0080F8F07DDDDDDDDDDDDDDDD7FFFFFFFFFFFFFFF08 + 8F0DD0F8F0FFFF7FFFF7FFFF0F8F07DDDDDDDDDDDDDDDD00000000000000000F + 8F0DD0888000000000000000088807DDDDDDDDDDDDDDDDDDDD7F888888888888 + 8F0DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDDDDDDDDDD7FFFFFFFFFFFFF + FF0DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDDDDDDDDDD00000000000000 + 000DD000000000000000000000000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object cbxLookAndFeel: TComboBox + Left = 90 + Top = 33 + Width = 212 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + OnClick = LookAndFeelClick + end + object chbxFlatCheckMarks: TCheckBox + Tag = 2 + Left = 90 + Top = 142 + Width = 200 + Height = 17 + Caption = 'Flat Check &Marks' + TabOrder = 3 + OnClick = OptionsRefinementClick + end + object chbxDisplayGraphicsAsText: TCheckBox + Tag = 1 + Left = 90 + Top = 119 + Width = 200 + Height = 17 + Caption = 'Display Graphics As &Text' + TabOrder = 2 + OnClick = OptionsRefinementClick + end + object chbxTransparentGraphics: TCheckBox + Left = 90 + Top = 96 + Width = 200 + Height = 17 + Caption = 'Transparent &Graphics' + TabOrder = 1 + OnClick = OptionsRefinementClick + end + object chbxSuppressBackgroundBitmaps: TCheckBox + Tag = 1 + Left = 90 + Top = 181 + Width = 200 + Height = 17 + Caption = 'Suppress Background Images' + TabOrder = 4 + OnClick = OptionsFormatingClick + end + object chbxConsumeSelectionStyle: TCheckBox + Tag = 2 + Left = 90 + Top = 203 + Width = 200 + Height = 17 + Caption = 'Consume Selection Style' + TabOrder = 5 + OnClick = OptionsFormatingClick + end + object chbxPaginateOneGroupPerPage: TCheckBox + Tag = 1 + Left = 90 + Top = 274 + Width = 200 + Height = 17 + Caption = 'One Group Per Page' + TabOrder = 7 + OnClick = OptionsPaginationClick + end + object chbxPaginateByTopLevelGroups: TCheckBox + Left = 90 + Top = 251 + Width = 200 + Height = 17 + Caption = 'By TopLevel Groups' + TabOrder = 6 + OnClick = OptionsPaginationClick + end + end + object tshStyles: TTabSheet + Caption = 'Styles' + ImageIndex = 5 + object bvlStyles: TBevel + Left = 118 + Top = 12 + Width = 191 + Height = 4 + Shape = bsBottomLine + end + object bvlStyleSheets: TBevel + Left = 72 + Top = 295 + Width = 237 + Height = 5 + Shape = bsBottomLine + end + object lblStyleSheets: TLabel + Left = 6 + Top = 291 + Width = 60 + Height = 13 + Caption = 'Style Sheets' + end + object bvlStylesHost: TBevel + Left = 6 + Top = 33 + Width = 228 + Height = 219 + end + object Label1: TLabel + Left = 76 + Top = 135 + Width = 68 + Height = 13 + Caption = '[ Styles Host ]' + Visible = False + end + object lblUseNativeStyles: TLabel + Left = 24 + Top = 9 + Width = 84 + Height = 13 + Caption = '&Use Native Styles' + FocusControl = chbxUseNativeStyles + OnClick = lblUseNativeStylesClick + end + object btnStyleColor: TButton + Left = 243 + Top = 61 + Width = 68 + Height = 23 + Caption = 'Co&lor...' + TabOrder = 2 + OnClick = StyleColorClick + end + object btnStyleFont: TButton + Left = 243 + Top = 33 + Width = 68 + Height = 23 + Caption = '&Font...' + TabOrder = 1 + OnClick = StyleFontClick + end + object btnStyleBackgroundBitmap: TButton + Left = 243 + Top = 97 + Width = 68 + Height = 23 + Caption = '&Bitmap...' + TabOrder = 3 + OnClick = StyleBackgroundBitmapClick + end + object chbxUseNativeStyles: TCheckBox + Left = 5 + Top = 8 + Width = 14 + Height = 17 + TabOrder = 0 + OnClick = OptionsFormatingClick + end + object cbxStyleSheets: TComboBox + Left = 6 + Top = 311 + Width = 302 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 7 + OnClick = cbxStyleSheetsClick + OnDrawItem = cbxStyleSheetsDrawItem + OnKeyDown = cbxStyleSheetsKeyDown + end + object btnStyleSheetNew: TButton + Left = 6 + Top = 343 + Width = 71 + Height = 23 + Caption = '&New...' + TabOrder = 8 + OnClick = StyleSheetNewClick + end + object btnStyleSheetCopy: TButton + Left = 83 + Top = 343 + Width = 71 + Height = 23 + Caption = '&Copy...' + TabOrder = 9 + OnClick = StyleSheetCopyClick + end + object btnStyleSheetDelete: TButton + Left = 160 + Top = 343 + Width = 71 + Height = 23 + Caption = '&Delete...' + TabOrder = 10 + OnClick = StyleSheetDeleteClick + end + object btnStylesSaveAs: TButton + Left = 123 + Top = 259 + Width = 112 + Height = 23 + Caption = 'Save &As...' + TabOrder = 6 + OnClick = StylesSaveAsClick + end + object btnStyleSheetRename: TButton + Left = 237 + Top = 343 + Width = 71 + Height = 23 + Caption = '&Rename...' + TabOrder = 11 + OnClick = StyleSheetRenameClick + end + object btnStyleBackgroundBitmapClear: TButton + Left = 243 + Top = 125 + Width = 68 + Height = 23 + Caption = 'Cle&ar' + TabOrder = 4 + OnClick = StyleBackgroundBitmapClearClick + end + object btnStyleRestoreDefaults: TButton + Left = 6 + Top = 259 + Width = 112 + Height = 23 + Caption = 'Rest&ore Defaults' + TabOrder = 5 + OnClick = StyleRestoreDefaultsClick + end + end + object tshPreview: TTabSheet + Caption = 'Preview' + ImageIndex = 2 + object lblPreviewOptions: TLabel + Left = 5 + Top = 8 + Width = 37 + Height = 13 + Caption = 'Options' + end + object bvlPreviewOptions: TBevel + Left = 50 + Top = 12 + Width = 261 + Height = 4 + Shape = bsBottomLine + end + object lblPreviewMaxLineCount: TLabel + Left = 91 + Top = 73 + Width = 78 + Height = 13 + Caption = 'Max Line Count:' + end + object bvlPreviewMaxLineCountHost: TBevel + Left = 229 + Top = 69 + Width = 68 + Height = 21 + Visible = False + end + object imgPreview: TImage + Left = 9 + Top = 28 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDD7777777777777777777777777DDDDDD0000000000000000000000000 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F888F7FF888F7F8888F7F07DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F0 + 7DDDDDD0F777777777777777777777F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCFFCCCCFFCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCFCCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCFCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCFCCFCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCFFCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F777777777777777777777F07DDDDDD0F7F888F7FF888F7FF888F7F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F88887F888887F888887F07DDDDDD0F7F00087F000087F000087F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0000000000000000000000000 + DDDD} + Transparent = True + end + object chbxPreviewVisible: TCheckBox + Left = 90 + Top = 28 + Width = 150 + Height = 17 + Caption = 'Visible' + TabOrder = 0 + OnClick = PreviewVisibleClick + end + object chbxPreviewAutoHeight: TCheckBox + Left = 90 + Top = 49 + Width = 150 + Height = 17 + Caption = 'Auto Height' + TabOrder = 1 + OnClick = PreviewAutoHeightClick + end + end + object tshCards: TTabSheet + Caption = 'Cards' + ImageIndex = 3 + object bvlCardSpaceVertHost: TBevel + Left = 231 + Top = 140 + Width = 75 + Height = 21 + Visible = False + end + object bvlCardSpaceHorzHost: TBevel + Left = 231 + Top = 112 + Width = 75 + Height = 21 + Visible = False + end + object lblCardSpaceVert: TLabel + Left = 90 + Top = 145 + Width = 39 + Height = 13 + Caption = 'Vertical:' + end + object lblCardSpaceHorz: TLabel + Left = 90 + Top = 116 + Width = 52 + Height = 13 + Caption = 'Horizontal:' + end + object imgCardSpacing: TImage + Left = 9 + Top = 112 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDD0DD0DDDDDDDDDDDDDDDDDD0DD0DDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDD00D0DDDDDDDDDDDDDDDDDD0D00DDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDD000000000000000000000000000000DDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDD00D0DDDDDDDDDDDDDDDDDD0D00DDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDD7DD0DDDDDD707000DDDDDD0DD7DDDDDDDDDDDDDDD + DDDDDDDDD0000000000000000000DDDDDD0D0D0DDDDDD0000000000000000000 + 0DDDDDDD77777777777777777770DDDDD00D0D0DDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDD0D000DDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7FFFFFFF7FFF9999FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFF9999FF7 + 0DDDDDDD7FFFFFFF7FFF9999FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFF9999FF7 + 0DDDDDDD7FFFFFFF7FCCCC99FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FCCCC99FF7 + 0DDDDDDD7FFFFFFF7FCCCC99FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FCCCC99FF7 + 0DDDDDDD7F77777F7FCCCCFFFF70DDDDDDDDDDDDDDDDD7F77777F7FCCCCFFFF7 + 0DDDDDDD7F77777F7FCCCCFFFF70DDDDDDDDDDDDDDDDD7F77777F7FCCCCFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD77777777777777777770DDDDDDDDDDDDDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7F77777F7FF777777F70DDDDDDDDDDDDDDDDD7F77777F7FF777777F7 + 0DDDDDDD7F7FFFFF7FF7FFFFFF70DDDDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD77777777777777777770DDDDDDDDDDDDDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7F77777F7FF77777FF70DDDDDDDDDDDDDDDDD7F77777F7FF777777F7 + 0DDDDDDD7F7FFFFF7FF77FFFFF70DDDDDDDDDDDDDDDDD7F7FFFFF7FF77FFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD77777777777777777770DDDDDDDDDDDDDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7F77777F7FF777777F70DDDDDDDDDDDDDDDDD7F77777F7FF777777F7 + 0DDDDDDD7F7FFFFF7FF7FFFFFF70DDDDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7777777777777777777DDDDDDDDDDDDDDDDDD7777777777777777777 + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblCardSpacing: TLabel + Left = 5 + Top = 92 + Width = 37 + Height = 13 + Caption = 'Spacing' + end + object bvlCardSpacing: TBevel + Left = 51 + Top = 97 + Width = 260 + Height = 4 + Shape = bsBottomLine + end + object bvlCardSizes: TBevel + Left = 34 + Top = 12 + Width = 277 + Height = 4 + Shape = bsBottomLine + end + object lblCardSizes: TLabel + Left = 5 + Top = 8 + Width = 24 + Height = 13 + Caption = 'Sizes' + end + object imgCardSizes: TImage + Left = 9 + Top = 28 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDD000000000000DDDDDDDDDDDDDDDDDDDDDDDD000000000000DD00000000 + 0000D7777777777770DDDDDDDDDDDDDDDDDDDDDDD7777777777770D777777777 + 7770D7FFFFF8FFFF70DDDDDDDDDDDDDDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8FFFF70DDDDDDDDDDDDDDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70DDDDDDDDDDDDDDDDDDDDDDD7FFFFF8F77F70D7FFFFF8FF + FF70D7FFFFF8FFFF70DDDDDDDDDDDDDDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70DD0000000000DDCCCCDCCDD7FFFFF8F77F70D7FFFFF8FF + FF70D7FFFFF8FFFF70D77777777770DDCCCCCCCCD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70D7FFFF8FFF70DDCCCCDCCDD7FFFFF8F77F70D7FFFFF8FF + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70D7FFFF8F7F70DDDDDDDDDDD7FFFFF8F77F70D7FFFFF8F7 + FF70D7F777F8FFFF70D7FFFF8FFF70DDDDDDDDDDD7F777F8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDDDDDDDDDD7F777F8F77F70D7F77FF8F7 + 7F70D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7888888888870D78888888870DDDDDDDDDDD7888888888870D788888888 + 8870D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDDDDDDDDDD7F777F8F77F70D7F77FF8F7 + FF70D7F777F8FFFF70D7F77F8F7F70DDDDDDDDDDD7F777F8FFFF70D7F77FF8F7 + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7888888888870D78888888870DDDDDDDDDDD7888888888870D788888888 + 8870D7FFFFF8FFFF70D7FFFF8FFF70DDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDCCCCDCCDD7F777F8F77F70D7F77FF8F7 + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDCCCCCCCCD7FFFFF8FFFF70D7FFFFF8FF + FF70D7888888888870D78888888870DDCCCCDCCDD7888888888870D788888888 + 8870D7FFFFF8FFFF70D7FFFF8FFF70DDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDDDDDDDDDD7F777F8F77F70D7F77FF8F7 + FF70D7F7FFF8FFFF70D7F7FF8F7F70DDDDDDDDDDD7F7FFF8FFFF70D7F7FFF8F7 + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D777777777777DD7777777777DDDDDDDDDDDD777777777777DD777777777 + 777DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgCardFraming: TImage + Left = 9 + Top = 189 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDD7777777777777777777DDDDDDDDDDDDDDDDDD00000000000000000 + 00DDDDDDD88888888888888888887DDDDDDDDDDDDDDDDD000000000000000000 + 00DDDDDDD8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDDDDD0FFFFFFF0FFFFFFFFF + 00DDDDD778FFFFFFF8FFF9999FF87DDDDDDDDDDDDDDD000FFFFFFF0FFF9999FF + 00DDDD8888FFFFFFF8FFF9999FF87DDDDDDDDDDDDDD0000FFFFFFF0FFF9999FF + 00DDDD8FF8FFFFFFF8FCCCC99FF87DDDCDDDDCDDDDD0FF0FFFFFFF0FCCCC99FF + 00DDDD8FF8FFFFFFF8FCCCC99FF87DDDCCCCDCCDDDD0FF0FFFFFFF0FCCCC99FF + 00DDDD8FF8F77777F8FCCCCFFFF87DDDCCCCCCCCDDD0FF0F77777F0FCCCCFFFF + 00DDDD8FF8F77777F8FCCCCFFFF87DDDCCCCDCCDDDD0FF0F77777F0FCCCCFFFF + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDCDDDDCDDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDDDDDDDDDDDD0F7000000000000000000 + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF777777F87DDDDDDDDDDDDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF7FFFFFF87DDDDDDDDDDDDDD0000F7FFFFF0FF7FFFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDDDDDDDDDDDD0F7000000000000000000 + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF77777FF87DDDDDDDDDDDDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF77FFFFF87DDDDDDDDDDDDDD0000F7FFFFF0FF77FFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDCDDDDCDDDDD0F7000000000000000000 + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDCCCCDCCDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF777777F87DDDCCCCCCCCDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF7FFFFFF87DDDCCCCDCCDDDD0000F7FFFFF0FF7FFFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDCDDDDCDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F78888888888888888888DDDDDDDDDDDDDDD0F7000000000000000000 + 0DDDDD8F7FFFFF8FF7FFFFFF87DDDDDDDDDDDDDDDDD0F7FFFFF0FF7FFFFFF00D + DDDDDD8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDDDDD0FFFFFFF0FFFFFFFFF00D + DDDDDD8888888888888888888DDDDDDDDDDDDDDDDDD0000000000000000000DD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblCardFraming: TLabel + Left = 5 + Top = 171 + Width = 38 + Height = 13 + Caption = 'Framing' + end + object bvlCardFraming: TBevel + Left = 49 + Top = 176 + Width = 262 + Height = 4 + Shape = bsBottomLine + end + object bvlCardShadowColorHost: TBevel + Left = 177 + Top = 276 + Width = 129 + Height = 21 + Visible = False + end + object lblCardShadowDepth: TLabel + Left = 90 + Top = 308 + Width = 33 + Height = 13 + Caption = 'Depth:' + end + object bvlCardShadow: TBevel + Left = 48 + Top = 260 + Width = 263 + Height = 4 + Shape = bsBottomLine + end + object lblCardShadow: TLabel + Left = 5 + Top = 255 + Width = 38 + Height = 13 + Caption = 'Shadow' + end + object lblCardShadowColor: TLabel + Left = 90 + Top = 280 + Width = 29 + Height = 13 + Caption = 'Color:' + end + object bvlCardShadowDepthHost: TBevel + Left = 177 + Top = 304 + Width = 129 + Height = 21 + Visible = False + end + object imgCardShadow: TImage + Left = 9 + Top = 276 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD0000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD0000000000000000000 + 000DDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDCDDDDCDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7FFFFFFF7FFF9999FFFFF7DDDDCCCCDCCDDDD7FFFFFFF7FFF9999FFFFF + 700DDD7FFFFFFF7FFF9999FFFFF7DDDDCCCCCCCCDDD7FFFFFFF7FFF9999FFFFF + 700DDD7FFFFFFF7FCCCC99FFFFF7DDDDCCCCDCCDDDD7FFFFFFF7FCCCC99FFFFF + 700DDD7FFFFFFF7FCCCC99FFFFF7DDDDCDDDDCDDDDD7FFFFFFF7FCCCC99FFFFF + 700DDD7F77777F7FCCCCFFFFFFF7DDDDDDDDDDDDDDD7F77777F7FCCCCFFFFFFF + 700DDD7F77777F7FCCCCFFFFFFF7DDDDDDDDDDDDDDD7F77777F7FCCCCFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7F77777F7FF777777FFFF7DDDDDDDDDDDDDDD7F77777F7FF777777FFFF + 700DDD7F7FFFFF7FF7FFFFFFFFF7DDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7F77777F7FF77777FFFFF7DDDDCDDDDCDDDDD7F77777F7FF77777FFFFF + 700DDD7F7FFFFF7FF77FFFFFFFF7DDDDCCCCDCCDDDD7F7FFFFF7FF77FFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDCCCCCCCCDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7777777777777777777777DDDDCCCCDCCDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDCDDDDCDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7F77777F7FF777777FFFF7DDDDDDDDDDDDDDD7F77777F7FF777777FFFF + 700DDD7F7FFFFF7FF7FFFFFFFFF7DDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 7DDDDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 7DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxCardsKeepSameHeight: TCheckBox + Tag = 2 + Left = 90 + Top = 70 + Width = 200 + Height = 17 + Caption = 'Keep Same Height' + TabOrder = 2 + OnClick = OptionsCardsClick + end + object chbxCardsKeepSameWidth: TCheckBox + Tag = 1 + Left = 90 + Top = 49 + Width = 200 + Height = 17 + Caption = 'Keep Same Width' + TabOrder = 1 + OnClick = OptionsCardsClick + end + object chbxCardsAutoWidth: TCheckBox + Left = 90 + Top = 28 + Width = 200 + Height = 17 + Caption = 'Auto Width' + TabOrder = 0 + OnClick = OptionsCardsClick + end + object chbxCardsVertLines: TCheckBox + Tag = 5 + Left = 90 + Top = 231 + Width = 200 + Height = 17 + Caption = 'Vertical Lines' + TabOrder = 5 + OnClick = OptionsCardsClick + end + object chbxCardsHorzLines: TCheckBox + Tag = 4 + Left = 90 + Top = 210 + Width = 200 + Height = 17 + Caption = 'Horizontal Lines' + TabOrder = 4 + OnClick = OptionsCardsClick + end + object chbxCardsBorder: TCheckBox + Tag = 3 + Left = 90 + Top = 189 + Width = 200 + Height = 17 + Caption = 'Border' + TabOrder = 3 + OnClick = OptionsCardsClick + end + end + end + object pnlPreview: TPanel + Left = 331 + Top = 44 + Width = 306 + Height = 350 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + object PreviewGrid: TcxGrid + Left = 5 + Top = 7 + Width = 296 + Height = 337 + TabOrder = 0 + LookAndFeel.NativeStyle = False + RootLevelOptions.DetailTabsPosition = dtpTop + object PreviewBandedView: TcxGridBandedTableView + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'Count = 0' + Kind = skCount + Position = spFooter + Column = colVendorName + end> + DataController.Summary.FooterSummaryItems = < + item + Format = 'Count = 0' + Kind = skCount + Column = colVendorName + end> + DataController.Summary.SummaryGroups = <> + NavigatorButtons.ConfirmDelete = False + Filtering.CustomizeDialog = False + Filtering.Visible = fvAlways + OptionsView.ScrollBars = ssNone + OptionsView.CellAutoHeight = True + OptionsView.ColumnAutoWidth = True + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.GroupFooters = gfAlwaysVisible + Preview.Column = colVendorCountry + Preview.Visible = True + OnCustomDrawColumnHeader = PreviewBandedViewCustomDrawColumnHeader + OnCustomDrawFooterCell = PreviewBandedViewCustomDrawFooterCell + Bands = < + item + Caption = 'Vendor Data' + Width = 150 + end + item + Caption = 'Car Data' + end> + OnCustomDrawBandHeader = PreviewBandedViewCustomDrawBandHeader + object colVendorName: TcxGridBandedColumn + Caption = 'Name' + PropertiesClassName = 'TcxTextEditProperties' + Options.Filtering = False + Position.BandIndex = 0 + Position.ColIndex = 0 + Position.RowIndex = 0 + end + object colVendorLogo: TcxGridBandedColumn + Caption = 'Logo' + PropertiesClassName = 'TcxImageProperties' + Properties.GraphicTransparency = gtTransparent + OnCustomDrawCell = VendorLogoCustomDrawCell + Options.Filtering = False + Position.BandIndex = 0 + Position.ColIndex = 1 + Position.RowIndex = 0 + end + object colVendorCountry: TcxGridBandedColumn + PropertiesClassName = 'TcxTextEditProperties' + Position.BandIndex = 0 + Position.ColIndex = 2 + Position.RowIndex = 0 + end + object colCarModel: TcxGridBandedColumn + Caption = 'Model' + PropertiesClassName = 'TcxTextEditProperties' + Options.Filtering = False + Position.BandIndex = 1 + Position.ColIndex = 0 + Position.RowIndex = 0 + end + object colIsSUVModel: TcxGridBandedColumn + Caption = 'SUV' + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.ValueGrayed = #39#39 + OnCustomDrawCell = IsSUVModelCustomDrawCell + HeaderAlignmentHorz = taCenter + Options.Filtering = False + Width = 30 + Position.BandIndex = 1 + Position.ColIndex = 1 + Position.RowIndex = 0 + end + end + object PreviewGridLevel: TcxGridLevel + Caption = 'Cars' + end + end + end + object pmStyles: TPopupMenu + Images = ilStylesPopup + OnPopup = pmStylesPopup + Left = 4 + Top = 408 + object miStyleFont: TMenuItem + Caption = '&Font...' + ImageIndex = 0 + OnClick = StyleFontClick + end + object miStyleColor: TMenuItem + Caption = '&Color...' + OnClick = StyleColorClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miStyleBackgroundBitmap: TMenuItem + Caption = '&Bitmap...' + ImageIndex = 1 + ShortCut = 16463 + OnClick = StyleBackgroundBitmapClick + end + object miStyleBackgroundBitmapClear: TMenuItem + Caption = 'Clear' + ImageIndex = 3 + ShortCut = 16430 + OnClick = StyleBackgroundBitmapClearClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miStyleRestoreDefaults: TMenuItem + Caption = 'Restore Defaults' + OnClick = StyleRestoreDefaultsClick + end + object milLine: TMenuItem + Caption = '-' + end + object miStylesSelectAll: TMenuItem + Caption = 'Select A&ll' + ShortCut = 16449 + OnClick = miStylesSelectAllClick + end + object miLine4: TMenuItem + Caption = '-' + end + object miStylesSaveAs: TMenuItem + Caption = 'Save &As...' + ImageIndex = 2 + ShortCut = 16467 + OnClick = StylesSaveAsClick + end + end + object ilStylesPopup: TImageList + Left = 32 + Top = 408 + Bitmap = { + 494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00000000000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF000000 + 0000008080000080800000808000008080000080800000808000008080000080 + 8000008080000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000000000000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000008080000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF00FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800080808000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00C0C0C00000FFFF00C0C0C000FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000000000008080800080808000000000008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C00000000000C0C0C00000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFC001FFFF + FE07001F8001FFF9FF9F000F8001E7FFFF9F00078001C3F3E01F00038001C3E7 + F99F00018001E1C7F99B00008001F08FF99B00018001F81FF89300018001FC3F + D80300018001F81FD9BF80018001F09FC93FE0018001C1C7C03FE001800183E3 + FFFFE00180018FF1FFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end + object cxStyleRepository1: TcxStyleRepository + Left = 60 + Top = 408 + object styleCardShadow: TcxStyle + end + object styleCardBorder: TcxStyle + AssignedValues = [svColor] + Color = clWindow + end + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxGrid4Lnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxGrid4Lnk.pas new file mode 100644 index 00000000..f80092e0 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxGrid4Lnk.pas @@ -0,0 +1,16802 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxGrid4Lnk; + +interface + +{$I cxVer.inc} + +uses + Windows, SysUtils, Messages, Classes, Graphics, Controls, StdCtrls, ComCtrls, + ExtCtrls, ImgList, Dialogs, ExtDlgs, Menus, cxGraphics, cxClasses, cxControls, + cxCustomData, cxDataStorage, cxData, cxDBData, cxGridDBDataDefinitions, cxGrid, + cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, + cxGridCardView, cxGridDBCardView, cxGridBandedTableView, cxGridDBBandedTableView, + cxGridViewData, cxGridLevel, cxStyles, cxLookAndFeels, + cxLookAndFeelPainters, cxFilter, cxTextEdit, cxEdit, cxCheckBox, cxImage, + dxBase, dxPSSngltn, dxPSCore, dxPrnPg, dxExtCtrls, dxPScxCommon; + +const + vspsGridFirst = 0; + vspsGridBandHeader = vspsGridFirst + 0; + vspsGridCaption = vspsGridFirst + 1; + vspsGridCardCaptionRow = vspsGridFirst + 2; + vspsGridCardRowCaption = vspsGridFirst + 3; + vspsGridContent = vspsGridFirst + 4; + vspsGridContentEven = vspsGridFirst + 5; + vspsGridContentOdd = vspsGridFirst + 6; + vspsGridFilterBar = vspsGridFirst + 7; + vspsGridFooter = vspsGridFirst + 8; + vspsGridGroup = vspsGridFirst + 9; + vspsGridHeader = vspsGridFirst + 10; + vspsGridPreview = vspsGridFirst + 11; + vspsGridSelection = vspsGridFirst + 12; + vspsGridLast = vspsGridFirst + 12; + + vsCardShadow = vsCardViewLast + 1; + vsCardViewLast = vsCardShadow; + + bbTabs = -1; + + dxDefaultInterCardsSpaceHorz = 4; + dxDefaultInterCardsSpaceVert = 4; + dxDefaultCardsShadowDepth = 4; + dxDefaultCardsShadowColor = clBlack; + + dxGridAttributeIDBase = 0; + dxGridUndefinedID = dxGridAttributeIDBase + 0; + dxGridBandID = dxGridAttributeIDBase + 1; + dxGridCardRowCaptionID = dxGridAttributeIDBase + 2; + dxGridCardRowDataID = dxGridAttributeIDBase + 3; + dxGridFilterBarID = dxGridAttributeIDBase + 4; + dxGridFooterID = dxGridAttributeIDBase + 5; + dxGridGroupFooterID = dxGridAttributeIDBase + 6; + dxGridHeaderID = dxGridAttributeIDBase + 7; + dxGridLevelCaptionID = dxGridAttributeIDBase + 8; + dxGridRecordID = dxGridAttributeIDBase + 9; + +type + TdxGridAttributeHostInfo = class; + TdxGridAttributeHostInfoServices = class; + TdxGridReportLink = class; + TdxGridReportLinkOptionsExpanding = class; + TdxfmGridReportLinkDesignWindow = class; + + TdxCustomGridViewAdapter = class; + TdxCustomGridViewFormatter = class; + TdxCustomGridViewBuilder = class; + + TdxCustomGridTableViewAdapter = class; + TdxCustomGridTableViewBuilder = class; + + TdxGridTableViewAdapter = class; + TdxGridTableViewFormatter = class; + TdxGridTableViewBuilder = class; + + TdxGridBandedTableViewAdapter = class; + TdxGridBandedTableViewFormatter = class; + TdxGridBandedTableViewBuilder = class; + + TdxGridCardViewBuilder = class; + + TdxGridTableViewColumnPlace = class; + TdxGridTableViewColumnPlaceController = class; + TdxCustomGridBandedTableViewItemPlace = class; + TdxGridBandedTableViewItemPlace = class; + TdxGridBandedTableViewItemPlaceController = class; + + TdxGridViewRowProducerClass = class of TdxGridViewRowProducer; + TdxGridViewRowProducer = class; + TdxGridViewCaptionProducerClass = class of TdxGridViewCaptionProducer; + TdxGridViewCaptionProducer = class; + TdxGridViewFilterBarProducerClass = class of TdxGridViewFilterBarProducer; + TdxGridViewFilterBarProducer = class; + TdxGridViewDetailsSeparatorProducerClass = class of TdxGridViewDetailsSeparatorProducer; + TdxGridViewDetailsSeparatorProducer = class; + TdxGridViewTerminatorProducerClass = class of TdxGridViewTerminatorProducer; + TdxGridViewTerminatorProducer = class; + TdxGridTableViewHeadersProducerClass = class of TdxGridTableViewHeadersProducer; + TdxGridTableViewHeadersProducer = class; + TdxGridTableViewFootersProducerClass = class of TdxGridTableViewFootersProducer; + TdxGridTableViewFootersProducer = class; + TdxGridTableViewCustomDataRowProducerClass = class of TdxGridTableViewCustomDataRowProducer; + TdxGridTableViewCustomDataRowProducer = class; + TdxGridTableViewRowSeparatorProducerClass = class of TdxGridTableViewRowSeparatorProducer; + TdxGridTableViewRowSeparatorProducer = class; + TdxGridTableViewGroupFooterProducerClass = class of TdxGridTableViewGroupFooterProducer; + TdxGridTableViewGroupFooterProducer = class; + TdxGridTableViewGroupRowSeparatorProducerClass = class of TdxGridTableViewGroupRowSeparatorProducer; + TdxGridTableViewGroupRowSeparatorProducer = class; + TdxGridTableViewBandsProducerClass = class of TdxGridTableViewBandsProducer; + TdxGridTableViewBandsProducer = class; + TdxGridCardViewCardsRowProducerClass = class of TdxGridCardViewCardsRowProducer; + TdxGridCardViewCardsRowProducer = class; + + { View Attributes } + + TdxGridAttributeClass = class of TdxGridAttribute; + TdxGridAttributeClasses = array of TdxGridAttributeClass; + TdxGridAttribute = class end; + + TdxGridBandHeader = class(TdxGridAttribute); + TdxGridCardRowCaption = class(TdxGridAttribute); + TdxGridCardRowData = class(TdxGridAttribute); + TdxGridDetails = class(TdxGridAttribute); + TdxGridExpandButton = class(TdxGridAttribute); + TdxGridFilterBar = class(TdxGridAttribute); + TdxGridFooter = class(TdxGridAttribute); + TdxGridGroupFooter = class(TdxGridAttribute); + TdxGridGroupRow = class(TdxGridAttribute); + TdxGridHeader = class(TdxGridAttribute); + TdxGridLevelCaption = class(TdxGridAttribute); + TdxGridPreview = class(TdxGridAttribute); + + TdxGridAttributeID = type Integer; + + + TdxGridCellCustomDrawInfo = record + GridAttributeID: TdxGridAttributeID; + GridView: TcxCustomGridView; + case Byte of + 0: (GridRecord: TcxCustomGridRecord; + GridColumn: TcxGridColumn; + GroupLevel: Integer; + GridBand: TcxGridBand); + 1: (GridCard: TcxGridCard; + GridCardRow: TcxGridCardViewRow); + end; + + + TdxAttributeColorKind = (ackContentColor, ackTextColor); + + TdxVerticalDetailsSeparatorKind = (vdskLeading, vdskTrailing); + + { View Helpers } + + TdxCustomGridViewHelperClass = class of TdxCustomGridViewHelper; + + TdxCustomGridViewHelper = class(TdxCustomClassMapItem) + private + FView: TcxCustomGridView; + protected + class procedure AddAttribute(var AnAtributes: TdxGridAttributeClasses; AnAttribute: TdxGridAttributeClass); + class function IsFilterBarAtBottom(AView: TcxCustomGridView): Boolean; virtual; + class function IsFilterBarAtTop(AView: TcxCustomGridView): Boolean; virtual; + class function IsOffice11StyleGrouping(AView: TcxCustomGridView): Boolean; virtual; + class function ViewClass: TcxCustomGridViewClass; virtual; + public + constructor Create(AView: TcxCustomGridView); virtual; + + class function PairClass: TClass; override; + class procedure Register; + class procedure Unregister; + + class function ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; virtual; + class procedure ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); virtual; + class function ExtractGridView(AnItem: TdxReportVisualItem): TcxCustomGridView; virtual; + class function IsAttributeSupported(AnAttribute: TdxGridAttributeClass): Boolean; virtual; + class function SupportedAttributes: TdxGridAttributeClasses; virtual; + + property View: TcxCustomGridView read FView write FView; + end; + + TdxNullGridViewHelper = class(TdxCustomGridViewHelper) + protected + class function ViewClass: TcxCustomGridViewClass; override; + public + class function IsAttributeSupported(AnAttribute: TdxGridAttributeClass): Boolean; override; + end; + + TdxCustomGridTableViewHelper = class(TdxCustomGridViewHelper) + protected + class function ExtractRecord(AnItem: TdxReportVisualItem): TcxCustomGridRecord; virtual; + class function ViewClass: TcxCustomGridViewClass; override; + public + class function ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; override; + class function SupportedAttributes: TdxGridAttributeClasses; override; + end; + + TdxGridCardViewHelper = class(TdxCustomGridTableViewHelper) + protected + class function ExtractCard(AnItem: TdxReportVisualItem): TcxGridCard; virtual; + class function ExtractCardRow(AnItem: TdxReportVisualItem): TcxGridCardViewRow; virtual; + class function ExtractRecord(AnItem: TdxReportVisualItem): TcxCustomGridRecord; override; + class function ViewClass: TcxCustomGridViewClass; override; + public + class function ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; override; + class procedure ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); override; + end; + + TdxGridTableViewHelper = class(TdxCustomGridTableViewHelper) + protected + class function ExtractColumn(AnItem: TdxReportVisualItem): TcxGridColumn; virtual; + class function ExtractGroupLevel(AnItem: TdxReportVisualItem): Integer; virtual; + class function ExtractRecord(AnItem: TdxReportVisualItem): TcxCustomGridRecord; override; + class function IsOffice11StyleGrouping(AView: TcxCustomGridView): Boolean; override; + class function ViewClass: TcxCustomGridViewClass; override; + public + class function ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; override; + class procedure ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); override; + class function SupportedAttributes: TdxGridAttributeClasses; override; + end; + + TdxGridBandedTableViewHelper = class(TdxGridTableViewHelper) + protected + class function ExtractBand(AnItem: TdxReportVisualItem): TcxGridBand; virtual; + class function ViewClass: TcxCustomGridViewClass; override; + public + class function ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; override; + class procedure ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); override; + class function SupportedAttributes: TdxGridAttributeClasses; override; + end; + + { Record Helpers } + + TdxCustomGridRecordHelperClass = class of TdxCustomGridRecordHelper; + + TdxCustomGridRecordHelper = class(TdxCustomClassMapItem) + private + FAdapter: TdxCustomGridTableViewAdapter; + FGridRecord: TcxCustomGridRecord; + protected + function Adapter: TdxCustomGridTableViewAdapter; overload; virtual; + class function ProducerClass: TdxGridTableViewCustomDataRowProducerClass; virtual; + class function RecordClass: TcxCustomGridRecordClass; virtual; + + function GetHasDetails: Boolean; virtual; + function GetHasSelectedChildren: Boolean; virtual; + function GetParent: TcxCustomGridRecord; virtual; + public + constructor Create(AAdapter: TdxCustomGridTableViewAdapter); virtual; + + class function PairClass: TClass; override; + class procedure Register; + class procedure Unregister; + + property GridRecord: TcxCustomGridRecord read FGridRecord write FGridRecord; + property HasDetails: Boolean read GetHasDetails; + property HasSelectedChildren: Boolean read GetHasSelectedChildren; + property Parent: TcxCustomGridRecord read GetParent; + end; + + TdxCustomGridRowHelper = class(TdxCustomGridRecordHelper) + protected + function Adapter: TdxGridTableViewAdapter; reintroduce; overload; + class function RecordClass: TcxCustomGridRecordClass; override; + end; + + TdxGridDataRowHelper = class(TdxCustomGridRowHelper) + private + function GetRow: TcxGridDataRow; + protected + class function ProducerClass: TdxGridTableViewCustomDataRowProducerClass; override; + class function RecordClass: TcxCustomGridRecordClass; override; + public + property Row: TcxGridDataRow read GetRow; + end; + + TdxGridGroupRowHelper = class(TdxCustomGridRowHelper) + private + function GetGroupRow: TcxGridGroupRow; + protected + class function ProducerClass: TdxGridTableViewCustomDataRowProducerClass; override; + class function RecordClass: TcxCustomGridRecordClass; override; + + function GetHasSelectedChildren: Boolean; override; + public + property GroupRow: TcxGridGroupRow read GetGroupRow; + end; + + TdxGridMasterDataRowHelper = class(TdxCustomGridRowHelper) + private + function GetDetailView: TcxCustomGridView; + function GetMasterRow: TcxGridMasterDataRow; + protected + class function ProducerClass: TdxGridTableViewCustomDataRowProducerClass; override; + class function RecordClass: TcxCustomGridRecordClass; override; + + function GetHasDetails: Boolean; override; + function GetHasSelectedChildren: Boolean; override; + public + property DetailView: TcxCustomGridView read GetDetailView; + property MasterRow: TcxGridMasterDataRow read GetMasterRow; + end; + + { caches } + + TdxRecordHelpersCache = class(TdxCustomCache) + private + FAdapter: TdxCustomGridTableViewAdapter; + function GetHelper(ARecord: TcxCustomGridRecord): TdxCustomGridRecordHelper; + function GetItem(Index: Integer): TdxCustomGridRecordHelper; + protected + function IndexOf(ARecord: TcxCustomGridRecord): Integer; + property Items[Index: Integer]: TdxCustomGridRecordHelper read GetItem; + public + constructor Create(AAdapter: TdxCustomGridTableViewAdapter); + property Adapter: TdxCustomGridTableViewAdapter read FAdapter; + property Helpers[ARecord: TcxCustomGridRecord]: TdxCustomGridRecordHelper read GetHelper; default; + end; + + TdxProducerCache = class(TdxCustomCache) + private + FBuilder: TdxCustomGridViewBuilder; + function GetItem(Index: Integer): TdxGridViewRowProducer; + function GetProducer(ProducerClass: TdxGridViewRowProducerClass): TdxGridViewRowProducer; + protected + function IndexOf(AProducerClass: TdxGridViewRowProducerClass): Integer; + property Items[Index: Integer]: TdxGridViewRowProducer read GetItem; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); + property Builder: TdxCustomGridViewBuilder read FBuilder; + property Producers[ProducerClass: TdxGridViewRowProducerClass]: TdxGridViewRowProducer read GetProducer; default; + end; + + { CustomView Adapter, Formatter and Builder } + + TdxGridViewAdapterClass = class of TdxCustomGridViewAdapter; + + TdxCustomGridViewAdapter = class + private + FGridView: TcxCustomGridView; + FMasterAdapter: TdxCustomGridViewAdapter; + function GetAbsoluteLevel: Integer; + function GetCanUseLookAndFeelColors: Boolean; + function GetCaptionText: string; + function GetDetailsSeparatorColor: TColor; + function GetDetailsSeparatorThickness: Integer; + function GetFilter: TcxDataFilterCriteria; + function GetFilterActive: Boolean; + function GetFilterEmpty: Boolean; + function GetFilterText: string; + function GetGrid: TcxCustomGrid; + function GetGridLevel: TcxGridLevel; + function GetGridWidth: Integer; + function GetHasDetailsSeparator: Boolean; + function GetLookAndFeelKind: TcxLookAndFeelKind; + function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; + function GetIsDetail: Boolean; + function GetIsMaster: Boolean; + function GetMasterGridLevel: TcxGridLevel; + function GetSummary: TcxDataSummary; + function GetThemedCaptionColor: TColor; + function GetThemedCaptionTextColor: TColor; + function GetThemedFilterBarColor: TColor; + function GetThemedFilterBarTextColor: TColor; + function GetViewWidth: Integer; + protected + procedure AfterBuilding; virtual; + procedure BeforeBuilding; virtual; + + function BackgroundBitmaps: TcxCustomGridBackgroundBitmaps; overload; virtual; + function GetBackgroundBitmap(Index: Integer): TBitmap; + function HasBackgroundBitmap(Index: Integer): Boolean; + function IsBackgroundBitmapSupported(Index: Integer): Boolean; virtual; + + function Controller: TcxCustomGridController; overload; virtual; + function DataController: TcxCustomDataController; overload; virtual; + + function CreateCloneAdapter(AClone: TcxCustomGridView): TdxCustomGridViewAdapter; + procedure ExpandAllRowsInClones(AMasterRows, AGroupRows: Boolean); virtual; + procedure ExpandAllRowsInGridView(AGridView: TcxCustomGridView; AMasterRows, AGroupRows: Boolean); + procedure ExpandAllRowsInLevel(ALevel: TcxGridLevel; AMasterRows, AGroupRows: Boolean; ARecursive: Boolean); + procedure ExpandAllRowsInItself(AMasterRows, AGroupRows: Boolean); virtual; + + function GetAreAllMasterRowsCollapsed: Boolean; virtual; + function GetAutoWidth: Boolean; virtual; + function GetCanUseOnEveryPageMode: Boolean; virtual; + function GetHasSelectedRecords: Boolean; virtual; + function GetIndentCount: Integer; virtual; + function GetIndentWidth: Integer; virtual; + function GetIsOffice11StyleGrouping: Boolean; virtual; + function GetMasterGridRecord: TcxCustomGridRecord; virtual; + function GetRecordCount: Integer; virtual; + function GetViewWidthExtra: Integer; virtual; + { Styles } + function GetCaptionViewParams: TcxViewParams; virtual; + function GetFilterBarViewParams: TcxViewParams; virtual; + function GetRootCaptionParams: TcxViewParams; virtual; + + property Filter: TcxDataFilterCriteria read GetFilter; + property Grid: TcxCustomGrid read GetGrid; + property LookAndFeelKind: TcxLookAndFeelKind read GetLookAndFeelKind; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter; + property Summary: TcxDataSummary read GetSummary; + public + constructor Create(AMasterAdapter: TdxCustomGridViewAdapter; AGridView: TcxCustomGridView); virtual; + + function GridView: TcxCustomGridView; overload; virtual; + class function GridViewClass: TcxCustomGridViewClass; virtual; + function Styles: TcxCustomGridStyles; overload; virtual; + + procedure ExpandAllRows(AnOptionsExpanding: TdxGridReportLinkOptionsExpanding; + ARecursive: Boolean); virtual; + + property AbsoluteLevel: Integer read GetAbsoluteLevel; + property AreAllMasterRowsCollapsed: Boolean read GetAreAllMasterRowsCollapsed; + property AutoWidth: Boolean read GetAutoWidth; + property CanUseOnEveryPageMode: Boolean read GetCanUseOnEveryPageMode; + property CanUseLookAndFeelColors: Boolean read GetCanUseLookAndFeelColors; + property CaptionText: string read GetCaptionText; + property DetailsSeparatorColor: TColor read GetDetailsSeparatorColor; + property DetailsSeparatorThickness: Integer read GetDetailsSeparatorThickness; + property GridLevel: TcxGridLevel read GetGridLevel; + property GridWidth: Integer read GetGridWidth; + property FilterActive: Boolean read GetFilterActive; + property FilterEmpty: Boolean read GetFilterEmpty; + property FilterText: string read GetFilterText; + property HasDetailsSeparator: Boolean read GetHasDetailsSeparator; + property HasSelectedRecords: Boolean read GetHasSelectedRecords; + property IndentCount: Integer read GetIndentCount; + property IndentWidth: Integer read GetIndentWidth; + property IsDetail: Boolean read GetIsDetail; + property IsMaster: Boolean read GetIsMaster; + property IsOffice11StyleGrouping: Boolean read GetIsOffice11StyleGrouping; + property MasterAdapter: TdxCustomGridViewAdapter read FMasterAdapter; + property MasterGridLevel: TcxGridLevel read GetMasterGridLevel; + property MasterGridRecord: TcxCustomGridRecord read GetMasterGridRecord; + property RecordCount: Integer read GetRecordCount; + property ThemedCaptionColor: TColor read GetThemedCaptionColor; + property ThemedCaptionTextColor: TColor read GetThemedCaptionTextColor; + property ThemedFilterBarColor: TColor read GetThemedFilterBarColor; + property ThemedFilterBarTextColor: TColor read GetThemedFilterBarTextColor; + property ViewWidth: Integer read GetViewWidth; + property ViewWidthExtra: Integer read GetViewWidthExtra; + end; + + TdxGridViewFormatterClass = class of TdxCustomGridViewFormatter; + + TdxCustomGridViewFormatter = class(TObject, IUnknown) + private + FBuilder: TdxCustomGridViewBuilder; + FCaptionLineHeight: Integer; + FExpandButtons: TList; + FFilterBarLineHeight: Integer; + FFont: TFont; + FLookAndFeelItems: TList; + FTransparentColor: TColor; + function GetAbsoluteLevel: Integer; + function GetAutoWidth: Boolean; + function GetDC: HDC; + function GetEdgeMode: TdxCellEdgeMode; + function GetGridWidth: Integer; + function GetExpandButton(Index: Integer): TdxReportCellExpandButton; + function GetExpandButtonCount: Integer; + function GetIndentWidth: Integer; + function GetLookAndFeelItem(Index: Integer): TdxReportVisualItem; + function GetLookAndFeelItemCount: Integer; + function GetPaginateByTopLevelGroups: Boolean; + function GetRenderer: TdxPSReportRenderer; + function GetReportLink: TdxGridReportLink; + function GetShowCaption: Boolean; + function GetShowFilterBar: Boolean; + function GetUseLookAndFeelColors: Boolean; + function GetViewAvailableWidth: Integer; + function GetViewWidthExtra: Integer; + + procedure FormatLookAndFeelItems; + procedure FormatExpandButtons; + protected + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + procedure AddDelimiters; virtual; + procedure AddHorizontalDelimiters; virtual; + procedure AddVerticalDelimiters; virtual; + + procedure AfterBuilding; virtual; + procedure BeforeBuilding; virtual; + + procedure Calculate; virtual; + procedure CalculateLineHeights; virtual; + + function GetDetailsSeparatorColor: TColor; virtual; + function GetDetailsSeparatorThickness: Integer; virtual; + function GetHasDetailsSeparator: Boolean; virtual; + + function GetSiteHeight: Integer; virtual; + function GetSiteWidth: Integer; virtual; + function GetViewWidth: Integer; virtual; + function GetViewWidthExtraAfter: Integer; virtual; // MD relation considering + function GetViewWidthExtraBefore: Integer; virtual; // MD relation considering + + function BackgroundBitmaps: TcxCustomGridBackgroundBitmaps; overload; virtual; + function GetBackgroundBitmap(Index: Integer): TBitmap; virtual; + function GetBackgroundBitmapIndex(Index: Integer): Integer; + function HasBackgroundBitmap(Index: Integer): Boolean; virtual; + function MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; virtual; + + function CalculateFontHeight(const AParams: TdxReportItemViewParams): Integer; + procedure CalculateHeight(const AParams: TdxReportItemViewParams; var AHeight: Integer); + function GetStyleFontIndex(const AParams: TdxReportItemViewParams): Integer; + function IsColorTransparent(AColor: TColor): Boolean; + procedure RegisterExpandButton(AExpandButton: TdxReportCellExpandButton); + procedure RegisterLookAndFeelItem(AnItem: TdxReportVisualItem; AEdgeStyle: TdxCellEdgeStyle); + procedure SetViewParams(AnItem: TdxReportVisualItem; const AParams: TdxReportItemViewParams); + + property DC: HDC read GetDC; + property EdgeMode: TdxCellEdgeMode read GetEdgeMode; + property ExpandButtonCount: Integer read GetExpandButtonCount; + property ExpandButtons[Index: Integer]: TdxReportCellExpandButton read GetExpandButton; + property GridWidth: Integer read GetGridWidth; + property LookAndFeelItemCount: Integer read GetLookAndFeelItemCount; + property LookAndFeelItems[Index: Integer]: TdxReportVisualItem read GetLookAndFeelItem; + property PaginateByTopLevelGroups: Boolean read GetPaginateByTopLevelGroups; + property Renderer: TdxPSReportRenderer read GetRenderer; + property ReportLink: TdxGridReportLink read GetReportLink; + property SiteHeight: Integer read GetSiteHeight; + property SiteWidth: Integer read GetSiteWidth; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); virtual; + destructor Destroy; override; + + function Adapter: TdxCustomGridViewAdapter; overload; virtual; + function Builder: TdxCustomGridViewBuilder; overload; virtual; + + { Host } + procedure DoInitializeHost(AHost: TdxReportCell); virtual; + function GetHostClass: TdxReportCellClass; virtual; + function GetRowHostClass: TdxReportCellClass; virtual; + + { Caption } + procedure DoInitializeCaption(ACaption: TdxReportCellText); virtual; + procedure DoInitializeCaptionRow(ARow: TdxReportCell); virtual; + procedure DoReportLinkInitializeCaption(ACaption: TdxReportCellText); virtual; + function GetCaptionClass: TdxReportCellTextClass; virtual; + function GetCaptionViewParams: TdxReportItemViewParams; virtual; + + { Filter Box } + procedure DoInitializeFilterBar(AFilterBar: TdxReportCellText); virtual; + procedure DoInitializeFilterBarRow(ARow: TdxReportCell); virtual; + procedure DoReportLinkInitializeFilterBar(AFilterBar: TdxReportCellText); virtual; + function GetFilterBarClass: TdxReportCellTextClass; virtual; + function GetFilterBarViewParams: TdxReportItemViewParams; virtual; + + { Details Separator } + procedure DoInitializeDetailsSeparatorRow(ARow: TdxReportCell); virtual; + procedure DoInitializeHorzDetailsSeparator(ASeparator: TdxReportCellBox); virtual; + procedure DoInitializeVertBottomDetailsSeparator(ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); virtual; + procedure DoInitializeVertDetailsSeparator(ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); virtual; + procedure DoInitializeVertTopDetailsSeparator(ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); virtual; + function GetDetailsSeparatorClass: TdxReportCellBoxClass; virtual; + + { Master Indent } + procedure DoInitializeMasterIndent(AnIndent: TdxReportCellExpandButton; AnIndex, AnIndentCount: Integer); virtual; + function GetMasterIndentClass: TdxReportCellExpandButtonClass; virtual; + + { View Terminator } + procedure DoInitializeViewTerminator(ATerminator: TdxReportCellBox); virtual; + + property AbsoluteLevel: Integer read GetAbsoluteLevel; + property AutoWidth: Boolean read GetAutoWidth; + property CaptionLineHeight: Integer read FCaptionLineHeight write FCaptionLineHeight; + property DetailsSeparatorColor: TColor read GetDetailsSeparatorColor; + property DetailsSeparatorThickness: Integer read GetDetailsSeparatorThickness; + property FilterBarLineHeight: Integer read FFilterBarLineHeight write FFilterBarLineHeight; + property HasDetailsSeparator: Boolean read GetHasDetailsSeparator; + property IndentWidth: Integer read GetIndentWidth; + property ShowCaption: Boolean read GetShowCaption; + property ShowFilterBar: Boolean read GetShowFilterBar; + property TransparentColor: TColor read FTransparentColor write FTransparentColor; + property UseLookAndFeelColors: Boolean read GetUseLookAndFeelColors; + property ViewAvailableWidth: Integer read GetViewAvailableWidth; + property ViewWidth: Integer read GetViewWidth; + property ViewWidthExtra: Integer read GetViewWidthExtra; + property ViewWidthExtraAfter: Integer read GetViewWidthExtraAfter; // MD relation considering + property ViewWidthExtraBefore: Integer read GetViewWidthExtraBefore; // MD relation considering + end; + + TdxGridViewBuilderClass = class of TdxCustomGridViewBuilder; + + TdxCustomGridViewBuilder = class(TdxCustomClassMapItem) + private + FAdapter: TdxCustomGridViewAdapter; + FDetailsBuilder: TdxCustomGridViewBuilder; + FFormatter: TdxCustomGridViewFormatter; + FGridView: TcxCustomGridView; + FMasterBuilder: TdxCustomGridViewBuilder; + FProducerCache: TdxProducerCache; + FReportLink: TdxGridReportLink; + FReportRows: TList; + function GetAbsoluteBuilder(AIndex: Integer): TdxCustomGridViewBuilder; + function GetAutoWidth: Boolean; + function GetGridLevel: TcxGridLevel; + function GetGrid: TcxCustomGrid; + function GetHost: TdxReportCell; + function GetHostInfoServices: TdxGridAttributeHostInfoServices; + function GetReportRow(Index: Integer): TdxReportCell; + function GetReportRowCount: Integer; + function GetRootBuilder: TdxCustomGridViewBuilder; + protected + procedure AddReportRow(ARow: TdxReportCell); + + procedure AfterBuilding; virtual; + procedure BeforeBuilding; virtual; + procedure DoBuild; virtual; + procedure DoBuildViewBody; virtual; + procedure DoBuildViewFooter; virtual; + procedure DoBuildViewHeader; virtual; + + function GetViewAvailableWidth: Integer; virtual; + { Caption } + procedure CreateCaption; virtual; + function GetCaptionProducer: TdxGridViewCaptionProducer; virtual; + function GetCaptionProducerClass: TdxGridViewCaptionProducerClass; virtual; + { Details Separator } + procedure CreateBottomDetailsSeparator; virtual; + procedure CreateTopDetailsSeparator; virtual; + function GetDetailsBottomSeparatorProducer: TdxGridViewDetailsSeparatorProducer; virtual; + function GetDetailsBottomSeparatorProducerClass: TdxGridViewDetailsSeparatorProducerClass; virtual; + function GetDetailsTopSeparatorProducer: TdxGridViewDetailsSeparatorProducer; virtual; + function GetDetailsTopSeparatorProducerClass: TdxGridViewDetailsSeparatorProducerClass; virtual; + { Filter Box } + procedure CreateFilterBar; virtual; + function GetFilterBarProducer: TdxGridViewFilterBarProducer; virtual; + function GetFilterBarProducerClass: TdxGridViewFilterBarProducerClass; virtual; + { View Terminator } + procedure CreateViewTerminator; virtual; + function GetViewTerminatorProducer: TdxGridViewTerminatorProducer; virtual; + function GetViewTerminatorProducerClass: TdxGridViewTerminatorProducerClass; virtual; + + function GridView: TcxCustomGridView; overload; virtual; + class function GridViewClass: TcxCustomGridViewClass; virtual; + + property GridLevel: TcxGridLevel read GetGridLevel; + property HostInfoServices: TdxGridAttributeHostInfoServices read GetHostInfoServices; + property ProducerCache: TdxProducerCache read FProducerCache; + property ReportLink: TdxGridReportLink read FReportLink; + public + constructor Create(AReportLink: TdxGridReportLink; AMasterBuilder: TdxCustomGridViewBuilder; + AGridView: TcxCustomGridView); virtual; + destructor Destroy; override; + + function Adapter: TdxCustomGridViewAdapter; overload; virtual; + class function AdapterClass: TdxGridViewAdapterClass; virtual; + class function CreateAdapter(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView): TdxCustomGridViewAdapter; virtual; + + function Formatter: TdxCustomGridViewFormatter; overload; virtual; + class function FormatterClass: TdxGridViewFormatterClass; virtual; + + procedure Build; + function IsAborted: Boolean; + procedure Progress(const APercentDone: Double); + + class function PairClass: TClass; override; + class procedure Register; + class procedure Unregister; + + property AbsoluteBuilders[Index: Integer]: TdxCustomGridViewBuilder read GetAbsoluteBuilder; + property AutoWidth: Boolean read GetAutoWidth; + property DetailsBuilder: TdxCustomGridViewBuilder read FDetailsBuilder; + property Grid: TcxCustomGrid read GetGrid; + property Host: TdxReportCell read GetHost; + property MasterBuilder: TdxCustomGridViewBuilder read FMasterBuilder; + property ReportRowCount: Integer read GetReportRowCount; + property ReportRows[Index: Integer]: TdxReportCell read GetReportRow; + property RootBuilder: TdxCustomGridViewBuilder read GetRootBuilder; + property ViewAvailableWidth: Integer read GetViewAvailableWidth; + end; + + { CustomTableView Adapter and Formatter } + + TdxGridTableAdapterForEachRecordProc = procedure(ARecord: TcxCustomGridRecord; + AData: Integer; var AContinue: Boolean) of object; + + TdxCustomGridTableViewAdapter = class(TdxCustomGridViewAdapter) + private + FDetailsLineCount: Integer; + FRecordHelpersCache: TdxRecordHelpersCache; + function GetCellEndEllipsis: Boolean; + function GetDetailsLineCount: Integer; + function GetFiltering: TcxCustomGridTableFiltering; + function GetIsGridMode: Boolean; + function GetRecord(Index: Integer): TcxCustomGridRecord; + function GetRecordHelper(ARecord: TcxCustomGridRecord): TdxCustomGridRecordHelper; + function GetSelectedRecord(Index: Integer): TcxCustomGridRecord; + function GetSelectedRecordCount: Integer; + protected + function CalculateDetailsLineCount: Integer; virtual; + + function GetContentViewParams(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem): TcxViewParams; virtual; + function GetPreviewViewParams(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem): TcxViewParams; virtual; + function GetSelectionViewParams: TcxViewParams; virtual; + function HasSelectionStyle: Boolean; + + function Controller: TcxCustomGridTableController; reintroduce; overload; + + procedure DoExpandMasterRow(ARecord: TcxCustomGridRecord; AData: Integer; + var AContinue: Boolean); + procedure ExpandAllGroupRows; virtual; + procedure ExpandAllMasterRows(AnExpandGroups: Boolean); virtual; + procedure ExpandAllRowsInItself(AMasterRows, AGroupRows: Boolean); override; + + function GetAreAllMasterRowsCollapsed: Boolean; override; + function GetCanUseOnEveryPageMode: Boolean; override; + function GetCellAutoHeight: Boolean; virtual; + function GetCellMultiline: Boolean; virtual; + function GetGridLineColor: TColor; virtual; + function GetHasSelectedRecords: Boolean; override; + function GetMasterGridRecord: TcxCustomGridRecord; override; + function GetRecordCount: Integer; override; + procedure IsMasterRowCollapsed(ARecord: TcxCustomGridRecord; AData: Integer; + var AContinue: Boolean); + + class function GetProperties(AnItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxCustomEditProperties; virtual; + class function GetPropertiesClass(AnItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxCustomEditPropertiesClass; virtual; + class function GetRepositoryItem(AnItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxEditRepositoryItem; virtual; + + property RecordHelpersCache: TdxRecordHelpersCache read FRecordHelpersCache; + public + constructor Create(AMasterAdapter: TdxCustomGridViewAdapter; AGridView: TcxCustomGridView); override; + destructor Destroy; override; + + function ForEachRecord(AProc: TdxGridTableAdapterForEachRecordProc; AData: Integer; + AProcessSelection: Boolean): Boolean; + + function GridView: TcxCustomGridTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + function Styles: TcxCustomGridTableViewStyles; reintroduce; overload; + + property CellAutoHeight: Boolean read GetCellAutoHeight; + property CellEndEllipsis: Boolean read GetCellEndEllipsis; + property CellMultiline: Boolean read GetCellMultiline; + property DetailsLineCount: Integer read GetDetailsLineCount write FDetailsLineCount; + property Filtering: TcxCustomGridTableFiltering read GetFiltering; + property GridLineColor: TColor read GetGridLineColor; + property IsGridMode: Boolean read GetIsGridMode; + property RecordHelpers[Row: TcxCustomGridRecord]: TdxCustomGridRecordHelper read GetRecordHelper; + property Records[Index: Integer]: TcxCustomGridRecord read GetRecord; + property SelectedRecordCount: Integer read GetSelectedRecordCount; + property SelectedRecords[Index: Integer]: TcxCustomGridRecord read GetSelectedRecord; + end; + + TdxCustomGridTableViewFormatter = class(TdxCustomGridViewFormatter, IdxPSCellParams, IdxPSCellParams2) + private + FRecordIndexes: TList; + FSelectedRecordList: TList; + function GetGridLineColor: TColor; + function GetRecord(Index: Integer): TcxCustomGridRecord; + function GetRecordCount: Integer; + function GetRecordIndex(ARecord: TcxCustomGridRecord): Integer; + function GetSelectedRecord(Index: Integer): TcxCustomGridRecord; + function GetSelectedRecordCount: Integer; + protected + { IdxPSCellParams } + function IdxPSCellParams.GetAutoHeight = IdxPSCellParams_GetAutoHeight; + function IdxPSCellParams.GetDC = IdxPSCellParams_GetDC; + function IdxPSCellParams.GetDisplayGraphicsAsText = IdxPSCellParams_GetDisplayGraphicsAsText; + function IdxPSCellParams.GetEndEllipsis = IdxPSCellParams_GetEndEllipsis; + function IdxPSCellParams.GetFlatCheckMarks = IdxPSCellParams_GetFlatCheckMarks; + function IdxPSCellParams.GetGraphicsText = IdxPSCellParams_GetGraphicsText; + function IdxPSCellParams.GetMultiline = IdxPSCellParams_GetMultiline; + function IdxPSCellParams.GetTransparentGraphics = IdxPSCellParams_GetTransparentGraphics; + function IdxPSCellParams_GetAutoHeight: Boolean; virtual; + function IdxPSCellParams_GetDC: HDC; virtual; + function IdxPSCellParams_GetDisplayGraphicsAsText: Boolean; virtual; + function IdxPSCellParams_GetEndEllipsis: Boolean; virtual; + function IdxPSCellParams_GetFlatCheckMarks: Boolean; virtual; + function IdxPSCellParams_GetGraphicsText: string; virtual; + function IdxPSCellParams_GetMultiline: Boolean; virtual; + function IdxPSCellParams_GetTransparentGraphics: Boolean; virtual; + { IdxPSCellParams2 } + function IdxPSCellParams2.GetPreviewMarginLeft = IdxPSCellParams2_GetPreviewMarginLeft; + function IdxPSCellParams2.GetPreviewMarginRight = IdxPSCellParams2_GetPreviewMarginRight; + function IdxPSCellParams2.GetPreviewMaxHeight = IdxPSCellParams2_GetPreviewMaxHeight; + function IdxPSCellParams2.GetPreviewMaxLineCount = IdxPSCellParams2_GetPreviewMaxLineCount; + function IdxPSCellParams2.GetRichEditGraphicClass = IdxPSCellParams2_GetRichEditGraphicClass; + function IdxPSCellParams2.GetRichEditTransparent = IdxPSCellParams2_GetRichEditTransparent; + function IdxPSCellParams2_GetPreviewMarginLeft: Integer; virtual; + function IdxPSCellParams2_GetPreviewMarginRight: Integer; virtual; + function IdxPSCellParams2_GetPreviewMaxHeight: Integer; virtual; + function IdxPSCellParams2_GetPreviewMaxLineCount: Integer; virtual; + function IdxPSCellParams2_GetRichEditGraphicClass: TGraphicClass; virtual; + function IdxPSCellParams2_GetRichEditTransparent: Boolean; virtual; + + procedure AfterBuilding; override; + procedure BeforeBuilding; override; + + procedure BuildSelectedRecordList; virtual; + function CanProcessSelectionStyle(ARecord: TcxCustomGridRecord): Boolean; + function IsSelectedRecord(ARecord: TcxCustomGridRecord): Boolean; virtual; + + function GetContentBackgroundBitmapStyleIndex(ATableItem: TcxCustomGridTableItem): Integer; virtual; + function MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; override; + + property SelectedRecordList: TList read FSelectedRecordList; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); override; + destructor Destroy; override; + + function Adapter: TdxCustomGridTableViewAdapter; reintroduce; overload; + function Builder: TdxCustomGridTableViewBuilder; reintroduce; overload; + + function IndexOfRecord(ARecord: TcxCustomGridRecord): Integer; + + { Items } + procedure DoInitializeItem(AnItem: TAbstractdxReportCellData; ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False); virtual; + function GetItemClass(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False): TdxReportCellDataClass; virtual; + function GetItemProperties(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxCustomEditProperties; virtual; + function GetItemValue(AProperties: TcxCustomEditProperties; ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxEditValue; virtual; + function GetItemViewParams(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False): TdxReportItemViewParams; virtual; + + property GridLineColor: TColor read GetGridLineColor; + property RecordCount: Integer read GetRecordCount; + property RecordIndexes[ARecord: TcxCustomGridRecord]: Integer read GetRecordIndex; + property Records[Index: Integer]: TcxCustomGridRecord read GetRecord; + property SelectedRecordCount: Integer read GetSelectedRecordCount; + property SelectedRecords[Index: Integer]: TcxCustomGridRecord read GetSelectedRecord; + end; + + TdxCustomGridTableViewBuilder = class(TdxCustomGridViewBuilder) + protected + procedure DoBuildViewFooter; override; + procedure DoBuildViewHeader; override; + + procedure DoGetCellHeight(ARecord: TcxCustomGridRecord; ATableItem: TcxCustomGridTableItem; + var AHeight: Integer); + + function GridView: TcxCustomGridTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + public + function Adapter: TdxCustomGridTableViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + function Formatter: TdxCustomGridTableViewFormatter; reintroduce; overload; + class function FormatterClass: TdxGridViewFormatterClass; override; + end; + + { GridTableView Adapter, Formatter and Builder } + + TdxGridTableViewAdapter = class(TdxCustomGridTableViewAdapter) + private + function GetColumn(Index: Integer): TcxGridColumn; + function GetColumnCount: Integer; + function GetExpandButtonColor: TColor; + function GetExpandButtonSize: Integer; + function GetFooterItemText(Index: Integer): string; + function GetFooterMultiline: Boolean; + function GetGridLines: TcxGridLines; + function GetGroupedColumn(Index: Integer): TcxGridColumn; + function GetGroupedColumnCount: Integer; + function GetGroupFootersMode: TcxGridGroupFootersMode; + function GetGroupFootersMultiline: Boolean; + function GetGroupRowSeparatorColor: TColor; + function GetGroupRowSeparatorThickness: Integer; + function GetHasFooterItem(Index: Integer): Boolean; + function GetHasPreview: Boolean; + function GetHasRowSeparators: Boolean; + function GetHeaderEndEllipsis: Boolean; + function GetInternalColumnMinWidth(Column: TcxGridColumn): Integer; + function GetInternalColumnWidth(Column: TcxGridColumn): Integer; + function GetPreviewColumn: TcxGridColumn; + function GetPreviewLeftIndent: Integer; + function GetPreviewPlace: TcxGridPreviewPlace; + function GetPreviewRightIndent: Integer; + function GetRow(Index: Integer): TcxCustomGridRow; + function GetRowCount: Integer; + function GetRowSeparatorColor: TColor; + function GetRowSeparatorThickness: Integer; + function GetShowExpandButtonsForEmptyDetails: Boolean; + function GetShowHorzGridLines: Boolean; + function GetShowVertGridLines: Boolean; + function GetThemedFooterItemColor: TColor; + function GetThemedFooterItemTextColor: TColor; + function GetThemedHeaderItemColor: TColor; + function GetThemedHeaderItemTextColor: TColor; + protected + function Controller: TcxGridTableController; reintroduce; overload; + function DataController: TcxGridDataController; reintroduce; overload; + + function GetAutoWidth: Boolean; override; + function GetCellAutoHeight: Boolean; override; + function GetCellMultiline: Boolean; override; + function GetGridLineColor: TColor; override; + function GetHeaderAutoHeight: Boolean; virtual; + function GetHeaderMultiline(Column: TcxGridColumn): Boolean; virtual; + function GetIndentCount: Integer; override; + function GetIndentWidth: Integer; override; + function GetIndicatorWidth: Integer; virtual; + function GetIsOffice11StyleGrouping: Boolean; override; + function GetViewWidthExtra: Integer; override; + + function GetDataRowHeight: Integer; virtual; + function GetDataRowHeightAssigned: Boolean; virtual; + function GetFooterHeight: Integer; virtual; + function GetFooterHeightAssigned: Boolean; virtual; + function GetGroupRowHeight: Integer; virtual; + function GetGroupRowHeightAssigned: Boolean; virtual; + function GetHeaderHeight: Integer; virtual; + function GetHeaderHeightAssigned: Boolean; virtual; + + { Styles } + function GetFilterBarViewParams: TcxViewParams; override; + function GetFooterViewParams(ARecord: TcxCustomGridRecord; + AGroupLevel: Integer; AColumn: TcxGridColumn): TcxViewParams; virtual; + function GetGroupRowViewParams(ARecord: TcxCustomGridRecord; + AGroupLevel: Integer): TcxViewParams; virtual; + function GetHeaderViewParams(AColumn: TcxGridColumn): TcxViewParams; virtual; + function GetPreviewViewParams(ARecord: TcxCustomGridRecord; + AnItem: TcxCustomGridTableItem): TcxViewParams; override; + + property InternalColumnMinWidths[Column: TcxGridColumn]: Integer read GetInternalColumnMinWidth; + property InternalColumnWidths[Column: TcxGridColumn]: Integer read GetInternalColumnWidth; + public + constructor Create(AMasterAdapter: TdxCustomGridViewAdapter; AGridView: TcxCustomGridView); override; + + function GridView: TcxGridTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + function Styles: TcxGridTableViewStyles; reintroduce; overload; + + function HasDetails(AGridRow: TcxCustomGridRow): Boolean; + + function GetGroupFooterCount(AGridRow: TcxCustomGridRow): Integer; + function GetGroupFooterItemText(ARowIndex, ALevel, AIndex: Integer): string; + function HasGroupFooter(AGridRow: TcxCustomGridRow; ALevel: Integer): Boolean; + function HasGroupFooterItem(ALevel, AIndex: Integer): Boolean; + function HasGroupFooters(AGridRow: TcxCustomGridRow): Boolean; + + property ColumnCount: Integer read GetColumnCount; + property Columns[Index: Integer]: TcxGridColumn read GetColumn; + property DataRowHeight: Integer read GetDataRowHeight; + property DataRowHeightAssigned: Boolean read GetDataRowHeightAssigned; + property ExpandButtonColor: TColor read GetExpandButtonColor; + property ExpandButtonSize: Integer read GetExpandButtonSize; + property FooterHeight: Integer read GetFooterHeight; + property FooterHeightAssigned: Boolean read GetFooterHeightAssigned; + property FooterItemTexts[Index: Integer]: string read GetFooterItemText; + property FooterMultiline: Boolean read GetFooterMultiline; + property GridLines: TcxGridLines read GetGridLines; + property GroupedColumnCount: Integer read GetGroupedColumnCount; + property GroupedColumns[Index: Integer]: TcxGridColumn read GetGroupedColumn; + property GroupFootersMode: TcxGridGroupFootersMode read GetGroupFootersMode; + property GroupFootersMultiline: Boolean read GetGroupFootersMultiline; + property GroupRowHeight: Integer read GetGroupRowHeight; + property GroupRowHeightAssigned: Boolean read GetGroupRowHeightAssigned; + property GroupRowSeparatorColor: TColor read GetGroupRowSeparatorColor; + property GroupRowSeparatorThickness: Integer read GetGroupRowSeparatorThickness; + property HasFooterItem[Index: Integer]: Boolean read GetHasFooterItem; + property HasPreview: Boolean read GetHasPreview; + property HasRowSeparators: Boolean read GetHasRowSeparators; + property HeaderAutoHeight: Boolean read GetHeaderAutoHeight; + property HeaderEndEllipsis: Boolean read GetHeaderEndEllipsis; + property HeaderHeight: Integer read GetHeaderHeight; + property HeaderHeightAssigned: Boolean read GetHeaderHeightAssigned; + property HeaderMultilines[Column: TcxGridColumn]: Boolean read GetHeaderMultiline; + property IndicatorWidth: Integer read GetIndicatorWidth; + property PreviewColumn: TcxGridColumn read GetPreviewColumn; + property PreviewLeftIndent: Integer read GetPreviewLeftIndent; + property PreviewPlace: TcxGridPreviewPlace read GetPreviewPlace; + property PreviewRightIndent: Integer read GetPreviewRightIndent; + property RowCount: Integer read GetRowCount; + property Rows[Index: Integer]: TcxCustomGridRow read GetRow; + property RowSeparatorColor: TColor read GetRowSeparatorColor; + property RowSeparatorThickness: Integer read GetRowSeparatorThickness; + property ShowExpandButtonsForEmptyDetails: Boolean read GetShowExpandButtonsForEmptyDetails; + property ShowHorzGridLines: Boolean read GetShowHorzGridLines; + property ShowVertGridLines: Boolean read GetShowVertGridLines; + property ThemedFooterItemColor: TColor read GetThemedFooterItemColor; + property ThemedFooterItemTextColor: TColor read GetThemedFooterItemTextColor; + property ThemedHeaderItemColor: TColor read GetThemedHeaderItemColor; + property ThemedHeaderItemTextColor: TColor read GetThemedHeaderItemTextColor; + end; + + TdxCustomGridTableViewItemPlaceControllerClass = class of TdxCustomGridTableViewItemPlaceController; + + TdxCustomGridTableViewItemPlaceController = class + private + FFormatter: TdxGridTableViewFormatter; + FHeaderLineCount: Integer; + FWidth: Integer; + function GetHeaderLineCount: Integer; + function GetWidth: Integer; + procedure SetWidth(Value: Integer); + protected + function CalculateWidth: Integer; virtual; + function CalculateHeaderLineCount: Integer; virtual; + function GetItemByColumn(Column: TcxGridColumn): TdxGridTableViewColumnPlace; virtual; + procedure WidthChanged; virtual; + public + constructor Create(AFormatter: TdxGridTableViewFormatter); virtual; + + procedure Calculate; virtual; + procedure Refresh; virtual; + + property Formatter: TdxGridTableViewFormatter read FFormatter; + property HeaderLineCount: Integer read GetHeaderLineCount; + property ItemsByColumn[Column: TcxGridColumn]: TdxGridTableViewColumnPlace read GetItemByColumn; default; + property Width: Integer read GetWidth write SetWidth; + end; + + TdxGridTableViewColumnPlaceClass = class of TdxGridTableViewColumnPlace; + + TdxGridTableViewColumnPlace = class + private + FColumn: TcxGridColumn; + FController: TdxGridTableViewColumnPlaceController; + FLeftBound: Integer; + FWidth: Integer; + function GetAdapter: TdxGridTableViewAdapter; + function GetCellBounds(RowIndex: Integer): TRect; + function GetCellHeight(RowIndex: Integer): Integer; + function GetFooterCellBounds: TRect; + function GetFooterLineHeight: Integer; + function GetFormatter: TdxGridTableViewFormatter; + function GetGroupFooterCellBounds(IndentCount: Integer): TRect; + function GetGroupFooterLineHeight: Integer; + function GetHeaderCellBounds: TRect; + function GetHeaderLineHeight: Integer; + function GetIndex: Integer; + function GetIsFixed: Boolean; + function GetLeftBound: Integer; + function GetMinWidth: Integer; + function GetOriginalWidth: Integer; + function GetWidth: Integer; + protected + function CalculateLeftBound: Integer; virtual; + function GetLineCount: Integer; virtual; + function GetRowIndex: Integer; virtual; + procedure InitAutoWidthItem(AnItem: TcxAutoWidthItem); virtual; + + property Adapter: TdxGridTableViewAdapter read GetAdapter; + property Formatter: TdxGridTableViewFormatter read GetFormatter; + property IsFixed: Boolean read GetIsFixed; + property LineCount: Integer read GetLineCount; + property MinWidth: Integer read GetMinWidth; + property OriginalWidth: Integer read GetOriginalWidth; + property RowIndex: Integer read GetRowIndex; + public + constructor Create(AController: TdxGridTableViewColumnPlaceController; AColumn: TcxGridColumn); virtual; + procedure Calculate(ALeftBound: Integer); virtual; + + property CellBounds[RowIndex: Integer]: TRect read GetCellBounds; + property CellHeights[RowIndex: Integer]: Integer read GetCellHeight; + property Column: TcxGridColumn read FColumn; + property Controller: TdxGridTableViewColumnPlaceController read FController; + property FooterCellBounds: TRect read GetFooterCellBounds; + property FooterLineHeight: Integer read GetFooterLineHeight; + property GroupFooterCellBounds[IndentCount: Integer]: TRect read GetGroupFooterCellBounds; + property GroupFooterLineHeight: Integer read GetGroupFooterLineHeight; + property HeaderCellBounds: TRect read GetHeaderCellBounds; + property HeaderLineHeight: Integer read GetHeaderLineHeight; + property Index: Integer read GetIndex; + property LeftBound: Integer read GetLeftBound write FLeftBound; + property Width: Integer read GetWidth write FWidth; + end; + + TdxGridTableViewColumnPlaceController = class(TdxCustomGridTableViewItemPlaceController) + private + FColumnIndexes: TList; + FItems: TList; + function GetAdapter: TdxGridTableViewAdapter; + function GetColumnIndex(Column: TcxGridColumn): Integer; + function GetItem(Index: Integer): TdxGridTableViewColumnPlace; + function GetItemCount: Integer; + procedure FreeAndNilItems; + protected + function CalculateWidth: Integer; override; + function GetItemByColumn(Column: TcxGridColumn): TdxGridTableViewColumnPlace; override; + + procedure AddItems; virtual; + procedure ClearItems; + function CreateItem(AColumn: TcxGridColumn): TdxGridTableViewColumnPlace; virtual; + function GetItemClass(AColumn: TcxGridColumn): TdxGridTableViewColumnPlaceClass; virtual; + + function CalculateItemLeftBound(AnItem: TdxGridTableViewColumnPlace): Integer; virtual; + procedure CalculateItemsWidth; virtual; + + function GetItemsAutoWidth: Boolean; virtual; + function GetItemsAvailableWidth: Integer; virtual; + + property Adapter: TdxGridTableViewAdapter read GetAdapter; + property ItemsAutoWidth: Boolean read GetItemsAutoWidth; + property ItemsAvailableWidth: Integer read GetItemsAvailableWidth; + public + constructor Create(AFormatter: TdxGridTableViewFormatter); override; + destructor Destroy; override; + + procedure Calculate; override; + procedure Refresh; override; + + function IndexOf(AnItem: TdxGridTableViewColumnPlace): Integer; overload; + function IndexOf(AColumn: TcxGridColumn): Integer; overload; + + property ColumnIndexes[Column: TcxGridColumn]: Integer read GetColumnIndex; + property ItemCount: Integer read GetItemCount; + property Items[Index: Integer]: TdxGridTableViewColumnPlace read GetItem; default; + end; + + TdxGridTableViewReportDataAdapter = class + private + FBuilder: TdxCustomGridViewBuilder; + function GetReportItem(Row: TcxCustomGridRow; Column: TcxGridColumn): TdxReportVisualItem; + function GetReportRow(Index: Integer): TdxReportCell; + function GetReportRowByGridRow(Row: TcxCustomGridRow): TdxReportCell; + function GetReportRowCount: Integer; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); virtual; + + property Builder: TdxCustomGridViewBuilder read FBuilder; + property ReportItems[Row: TcxCustomGridRow; Column: TcxGridColumn]: TdxReportVisualItem read GetReportItem; + property ReportRowCount: Integer read GetReportRowCount; + property ReportRows[Index: Integer]: TdxReportCell read GetReportRow; default; + property ReportRowsByGridRow[Row: TcxCustomGridRow]: TdxReportCell read GetReportRowByGridRow; + end; + + TdxGridTableViewFormatter = class(TdxCustomGridTableViewFormatter) + private + FColumns: TList; + FDetailsLineHeight: Integer; + FFooterLineHeight: Integer; + FGroupFooterLineHeight: Integer; + FGroupRowLineHeight: Integer; + FHeaderLineHeight: Integer; + FItemPlaceController: TdxCustomGridTableViewItemPlaceController; + FPreviewLineHeight: Integer; + FReportDataAdapter: TdxGridTableViewReportDataAdapter; + FRowHeights: TList; + function GetColumn(Index: Integer): TcxGridColumn; + function GetColumnCount: Integer; + function GetGroupRowSeparatorColor: TColor; + function GetGroupRowSeparatorThickness: Integer; + function GetHasPreview: Boolean; + function GetHeaderLineCount: Integer; + function GetPreviewAutoHeight: Boolean; + function GetPreviewColumn: TcxGridColumn; + function GetPreviewMaxLineCount: Integer; + function GetRow(Index: Integer): TcxCustomGridRow; + function GetRowCount: Integer; + function GetRowHeight(Index: Integer): Integer; + function GetRowHeightByRow(Row: TcxCustomGridRow): Integer; + function GetRowSeparatorColor: TColor; + function GetRowSeparatorThickness: Integer; + function GetShowGroupFooters: Boolean; + function GetShowFooters: Boolean; + function GetShowHeaders: Boolean; + function GetShowPreview: Boolean; + procedure SetRowHeight(Index: Integer; Value: Integer); + procedure SetRowHeightByRow(Row: TcxCustomGridRow; Value: Integer); + protected + { IdxPSCellParams2 } + function IdxPSCellParams2_GetPreviewMarginLeft: Integer; override; + function IdxPSCellParams2_GetPreviewMarginRight: Integer; override; + function IdxPSCellParams2_GetPreviewMaxHeight: Integer; override; + function IdxPSCellParams2_GetPreviewMaxLineCount: Integer; override; + + procedure AddHorizontalDelimiters; override; + procedure BeforeBuilding; override; + procedure Calculate; override; + procedure CalculateDataRowHeights; virtual; + procedure CalculateLineHeights; override; + + function GetItemPlaceControllerClass: TdxCustomGridTableViewItemPlaceControllerClass; virtual; + function MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; override; + + + // actual columns used inside building (depends on ActualVisibility of columns and selection status) + procedure BuildColumnList; virtual; + procedure BuildItemLists; virtual; + function IsColumnActuallyVisible(AColumn: TcxGridColumn): Boolean; virtual; + + function GetViewWidth: Integer; override; + + property ItemPlaceController: TdxCustomGridTableViewItemPlaceController read FItemPlaceController; + property ReportDataAdapter: TdxGridTableViewReportDataAdapter read FReportDataAdapter; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); override; + destructor Destroy; override; + + function Adapter: TdxGridTableViewAdapter; reintroduce; overload; + function Builder: TdxGridTableViewBuilder; reintroduce; overload; + + { Footers } + procedure DoInitializeFooterItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + procedure DoInitializeFooterRow(ARow: TdxReportCell); virtual; + procedure DoReportLinkInitializeFooterItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + function GetFooterItemBounds(AnIndex: Integer): TRect; virtual; + function GetFooterItemClass(AnIndex: Integer): TdxReportCellTextClass; virtual; + function GetFooterItemViewParams(AColumn: TcxGridColumn): TdxReportItemViewParams; virtual; + + { Group Footers } + procedure DoInitializeGroupFooterHost(AnItem: TdxReportVisualItem; ARecord: TcxCustomGridRecord); virtual; + procedure DoInitializeGroupFooterItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer; ARecord: TcxCustomGridRecord; AGroupLevel: Integer); virtual; + procedure DoInitializeGroupFooterRow(ARow: TdxReportCell; + ARecord: TcxCustomGridRecord; AGroupLevel: Integer); virtual; + procedure DoReportLinkInitializeGroupFooterItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer; ARecord: TcxCustomGridRecord; AGroupLevel: Integer); virtual; + function GetGroupFooterItemClass(AnIndex: Integer): TdxReportCellTextClass; virtual; + function GetGroupFooterItemBounds(AnIndex, AGroupLevel: Integer): TRect; virtual; + function GetGroupFooterItemViewParams(ARecord: TcxCustomGridRecord; AGroupLevel: Integer; + AColumn: TcxGridColumn): TdxReportItemViewParams; virtual; + + { Group Row } + procedure DoInitializeGroupRowItem(AnItem: TAbstractdxReportCellData; ARow: TcxGridGroupRow); virtual; + procedure DoInitializeGroupRow(ARow: TdxReportCell; ARecord: TcxCustomGridRecord); virtual; + function GetGroupRowClass: TdxReportCellTextClass; virtual; + function GetGroupRowViewParams(ARecord: TcxCustomGridRecord; ALevel: Integer): TdxReportItemViewParams; virtual; + + { Group Row Separator - Office11 Grouping Style } + procedure DoInitializeGroupRowSeparator(ASeparator: TAbstractdxReportCellData); virtual; + procedure DoInitializeGroupSeparatorRow(ARow: TdxReportCell); virtual; + function GetGroupRowSeparatorClass: TdxReportCellDataClass; virtual; + + { Headers } + procedure DoInitializeHeaderItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + procedure DoInitializeHeaderRow(ARow: TdxReportCell); virtual; + procedure DoReportLinkInitializeHeaderItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + function GetHeaderItemBounds(AnIndex: Integer): TRect; virtual; + function GetHeaderItemClass(AnIndex: Integer): TdxReportCellTextClass; virtual; + function GetHeaderItemViewParams(AColumn: TcxGridColumn): TdxReportItemViewParams; virtual; + + { Indents and Expand Buttons } + function CreateIndent(AParent: TdxReportCell): TdxReportCellExpandButton; virtual; + procedure DoInitializeDataRowIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); virtual; + procedure DoInitializeExpandButton(AnExpandButton: TdxReportCellExpandButton; + ARecord: TcxCustomGridRecord; AnIsMasterIndent: Boolean); virtual; + procedure DoInitializeGroupFooterIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); virtual; + procedure DoInitializeGroupRowIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); virtual; + procedure DoInitializeMasterDataRowIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); virtual; + procedure DoInitializeRowSeparatorIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); virtual; + function GetIndentClass: TdxReportCellExpandButtonClass; virtual; + function GetIndentViewParams(ARecord: TcxCustomGridRecord; + AnIndex, AnIndentCount: Integer; ANonRecordIndent: Boolean): TdxReportItemViewParams; virtual; + function HasExpandButton(ARecord: TcxCustomGridRecord): Boolean; virtual; + + { Items } + procedure DoInitializeDataRow(ARow: TdxReportCell; ARecord: TcxCustomGridRecord); virtual; + procedure DoReportLinkInitializeItem(AnItem: TAbstractdxReportCellData; + AColumn: TcxGridColumn; ARecord: TcxCustomGridRecord); virtual; + function GetItemBounds(AGridRow: TcxCustomGridRow; + AGridRowIndex, AColumnIndex: Integer): TRect; virtual; + function GetItemViewParams(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False): TdxReportItemViewParams; override; + + { Master Indent } + procedure DoInitializeMasterIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer); override; + + { Preview } + procedure DoInitializePreview(APreview: TAbstractdxReportCellData; AColumn: TcxGridColumn; + ARecord: TcxCustomGridRecord); virtual; + function GetPreviewClass(AColumn: TcxGridColumn; + ARecord: TcxCustomGridRecord): TdxReportCellDataClass; virtual; + function GetPreviewViewParams(AColumn: TcxGridColumn; + ARecord: TcxCustomGridRecord): TdxReportItemViewParams; virtual; + + { Row Separator } + procedure DoInitializeSeparatorRow(ARow: TdxReportCell); virtual; + procedure DoInitializeRowSeparator(ASeparator: TAbstractdxReportCellData); virtual; + function GetRowSeparatorClass: TdxReportCellDataClass; virtual; + + function GetReportItem(ARow: TcxCustomGridRow; AColumn: TcxGridColumn): TdxReportVisualItem; + + property ColumnCount: Integer read GetColumnCount; + property Columns[Index: Integer]: TcxGridColumn read GetColumn; + property DetailsLineHeight: Integer read FDetailsLineHeight write FDetailsLineHeight; + property FooterLineHeight: Integer read FFooterLineHeight write FFooterLineHeight; + property GroupFooterLineHeight: Integer read FGroupFooterLineHeight write FGroupFooterLineHeight; + property GroupRowLineHeight: Integer read FGroupRowLineHeight write FGroupRowLineHeight; + property GroupRowSeparatorColor: TColor read GetGroupRowSeparatorColor; + property GroupRowSeparatorThickness: Integer read GetGroupRowSeparatorThickness; + property HasPreview: Boolean read GetHasPreview; + property HeaderLineCount: Integer read GetHeaderLineCount; + property HeaderLineHeight: Integer read FHeaderLineHeight write FHeaderLineHeight; + property PreviewAutoHeight: Boolean read GetPreviewAutoHeight; + property PreviewColumn: TcxGridColumn read GetPreviewColumn; + property PreviewLineHeight: Integer read FPreviewLineHeight write FPreviewLineHeight; + property PreviewMaxLineCount: Integer read GetPreviewMaxLineCount; + property RowCount: Integer read GetRowCount; + property RowHeights[Index: Integer]: Integer read GetRowHeight write SetRowHeight; + property RowHeightsByRow[Row: TcxCustomGridRow]: Integer read GetRowHeightByRow write SetRowHeightByRow; + property Rows[Index: Integer]: TcxCustomGridRow read GetRow; + property RowSeparatorColor: TColor read GetRowSeparatorColor; + property RowSeparatorThickness: Integer read GetRowSeparatorThickness; + property ShowGroupFooters: Boolean read GetShowGroupFooters; + property ShowFooters: Boolean read GetShowFooters; + property ShowHeaders: Boolean read GetShowHeaders; + property ShowPreview: Boolean read GetShowPreview; + end; + + TdxGridTableViewBuilder = class(TdxCustomGridTableViewBuilder) + private + function GetLastReportRow: TdxReportCell; + function GetProcessedView: TcxCustomGridView; + procedure SetProcessedView(Value: TcxCustomGridView); + protected + procedure AddDelimitersHardVert(AReportRow: TdxReportCell); + + procedure DoBuildViewBody; override; + procedure DoBuildViewFooter; override; + + { Details View } + procedure CreateDetails(AMasterRow: TcxGridMasterDataRow); virtual; + procedure CreateDetailView(AGridView: TcxCustomGridView); virtual; + function GetAreDetailsBuilt: Boolean; virtual; + + { Footer } + procedure CreateFooter; virtual; + function GetFootersProducer: TdxGridTableViewFootersProducer; virtual; + function GetFootersProducerClass: TdxGridTableViewFootersProducerClass; virtual; + + { Group Footer } + procedure CreateGroupFooters(AGridRow: TcxCustomGridRow); virtual; + function GetGroupFooterProducer: TdxGridTableViewGroupFooterProducer; virtual; + function GetGroupFooterProducerClass: TdxGridTableViewGroupFooterProducerClass; virtual; + + { Header } + procedure CreateHeader; virtual; + function GetHeadersProducer: TdxGridTableViewHeadersProducer; virtual; + function GetHeadersProducerClass: TdxGridTableViewHeadersProducerClass; virtual; + + { Rows } + procedure CreateRow(AGridRow: TcxCustomGridRow; ARowIndex: Integer); virtual; + procedure CreateRows; virtual; + function GetRowProducer(AGridRow: TcxCustomGridRow): TdxGridTableViewCustomDataRowProducer; virtual; + function GetRowProducerClass(AGridRow: TcxCustomGridRow): TdxGridTableViewCustomDataRowProducerClass; virtual; + + { Row Separators } + procedure CreateRowSeparator(AGridRow: TcxCustomGridRow; AnIsLast: Boolean = False); virtual; + function GetRowSeparatorProducer: TdxGridTableViewRowSeparatorProducer; virtual; + function GetRowSeparatorProducerClass: TdxGridTableViewRowSeparatorProducerClass; virtual; + function GetShowRowSeparators: Boolean; virtual; + + { GroupRow Separators } + procedure CreateGroupRowSeparator(AGridRow: TcxGridGroupRow); virtual; + function GetGroupRowSeparatorProducer: TdxGridTableViewGroupRowSeparatorProducer; virtual; + function GetGroupRowSeparatorProducerClass: TdxGridTableViewGroupRowSeparatorProducerClass; virtual; + function GetShowGroupRowSeparators: Boolean; virtual; + + function GridView: TcxGridTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + + property LastReportRow: TdxReportCell read GetLastReportRow; + property ProcessedView: TcxCustomGridView read GetProcessedView write SetProcessedView; + public + function Adapter: TdxGridTableViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + function Formatter: TdxGridTableViewFormatter; reintroduce; overload; + class function FormatterClass: TdxGridViewFormatterClass; override; + + property AreDetailsBuilt: Boolean read GetAreDetailsBuilt; + property ShowGroupRowSeparators: Boolean read GetShowGroupRowSeparators; + property ShowRowSeparators: Boolean read GetShowRowSeparators; + end; + + { DBTableView Adapter, Formatter and Builder } + + TdxGridDBTableViewAdapter = class(TdxGridTableViewAdapter) + private + FPrevAllRecordsAreLoaded: Boolean; + protected + procedure AfterBuilding; override; + procedure BeforeBuilding; override; + function DataController: TcxGridDBDataController; reintroduce; overload; + + function DBDataModeController: TcxDBDataModeController; virtual; + procedure LoadAllRecords; virtual; + procedure UnloadAllRecords; virtual; + public + function GridView: TcxGridDBTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + end; + + TdxGridDBTableViewBuilder = class(TdxGridTableViewBuilder) + public + function Adapter: TdxGridDBTableViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + end; + + { BandedTableView Adapter, Formatter and Builder } + + TdxGridBandedTableViewAdapter = class(TdxGridTableViewAdapter) + private + FFooterLineCount: Integer; + function GetBand(Index: Integer): TcxGridBand; + function GetBandCount: Integer; + function GetBandEndEllipsis: Boolean; + function GetBandHeaderLineCount: Integer; + function GetBandHeaderMultiline: Boolean; + function GetBottomBand(Index: Integer): TcxGridBand; + function GetBottomBandCount: Integer; + function GetColumn(Index: Integer): TcxGridBandedColumn; + function GetFooterLineCount: Integer; + function GetRootBand(Index: Integer): TcxGridBand; + function GetRootBandCount: Integer; + function GetThemedBandHeaderItemColor: TColor; + function GetThemedBandHeaderItemTextColor: TColor; + protected + function CalculateDetailsLineCount: Integer; override; + function CalculateFooterLineCount: Integer; virtual; + + function GetBandHeaderHeight: Integer; virtual; + function GetBandHeaderHeightAssigned: Boolean; virtual; + function GetBandHeaderViewParams(ABand: TcxGridBand): TcxViewParams; virtual; + function GetDataRowHeightAssigned: Boolean; override; + function GetFooterHeightAssigned: Boolean; override; + function GetHeaderHeightAssigned: Boolean; override; + function GetHeaderMultiline(Column: TcxGridColumn): Boolean; override; + public + constructor Create(AMasterAdapter: TdxCustomGridViewAdapter; AGridView: TcxCustomGridView); override; + + function GridView: TcxGridBandedTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + function Styles: TcxGridBandedTableViewStyles; reintroduce; overload; + + property BandCount: Integer read GetBandCount; + property BandEndEllipsis: Boolean read GetBandEndEllipsis; + property BandHeaderHeight: Integer read GetBandHeaderHeight; + property BandHeaderHeightAssigned: Boolean read GetBandHeaderHeightAssigned; + property BandHeaderLineCount: Integer read GetBandHeaderLineCount; + property BandHeaderMultiline: Boolean read GetBandHeaderMultiline; + property Bands[Index: Integer]: TcxGridBand read GetBand; + property BottomBandCount: Integer read GetBottomBandCount; + property BottomBands[Index: Integer]: TcxGridBand read GetBottomBand; + property Columns[Index: Integer]: TcxGridBandedColumn read GetColumn; + property FooterLineCount: Integer read GetFooterLineCount write FFooterLineCount; + property RootBandCount: Integer read GetRootBandCount; + property RootBands[Index: Integer]: TcxGridBand read GetRootBand; + property ThemedBandHeaderItemColor: TColor read GetThemedBandHeaderItemColor; + property ThemedBandHeaderItemTextColor: TColor read GetThemedBandHeaderItemTextColor; + end; + + TdxGridBandedTableViewColumnPlace = class(TdxGridTableViewColumnPlace) + private + function GetColumn: TcxGridBandedColumn; + function GetController: TdxCustomGridBandedTableViewItemPlace; + function GetFormatter: TdxGridBandedTableViewFormatter; + protected + function GetLineCount: Integer; override; + function GetRowIndex: Integer; override; + public + property Column: TcxGridBandedColumn read GetColumn; + property Controller: TdxCustomGridBandedTableViewItemPlace read GetController; + property Formatter: TdxGridBandedTableViewFormatter read GetFormatter; + end; + + TdxCustomGridBandedTableViewItemPlaceClass = class of TdxCustomGridBandedTableViewItemPlace; + + TdxCustomGridBandedTableViewItemPlace = class(TdxGridTableViewColumnPlaceController) + private + FBand: TcxGridBand; + FController: TdxGridBandedTableViewItemPlaceController; + FHeight: Integer; + FLeftBound: Integer; + FMinWidth: Integer; + FParent: TdxGridBandedTableViewItemPlace; + FTopBound: Integer; + function GetAdapter: TdxGridBandedTableViewAdapter; + function GetBounds: TRect; + function GetFormatter: TdxGridBandedTableViewFormatter; + function GetHeight: Integer; + function GetIndex: Integer; + function GetIsFixed: Boolean; + function GetLeftBound: Integer; + function GetLevelIndex: Integer; + function GetMinWidth: Integer; + function GetTopBound: Integer; + function GetViewParams: TdxReportItemViewParams; + protected + function CalculateHeaderLineCount: Integer; override; + function CalculateWidth: Integer; override; + function GetItemClass(AColumn: TcxGridColumn): TdxGridTableViewColumnPlaceClass; override; + + procedure AssignWidth; + function CalculateHeight: Integer; virtual; + function CalculateLeftBound: Integer; virtual; + function CalculateLevelHeight: Integer; virtual; + function CalculateLineHeight: Integer; virtual; + function CalculateMinWidth: Integer; virtual; + function CalculateTopBound: Integer; virtual; + procedure InitAutoWidthItem(AnItem: TcxAutoWidthItem); virtual; + + function GetRowCount: Integer; virtual; + function InternalCalculateMinWidth: Integer; virtual; + function InternalCalculateWidth: Integer; virtual; + + property Adapter: TdxGridBandedTableViewAdapter read GetAdapter; + property Band: TcxGridBand read FBand; + property IsFixed: Boolean read GetIsFixed; + property LevelIndex: Integer read GetLevelIndex; + property MinWidth: Integer read GetMinWidth; + property RowCount: Integer read GetRowCount; + property ViewParams: TdxReportItemViewParams read GetViewParams; + public + constructor Create(AController: TdxGridBandedTableViewItemPlaceController; + AParent: TdxGridBandedTableViewItemPlace; ABand: TcxGridBand); reintroduce; virtual; + + property Bounds: TRect read GetBounds; + property Controller: TdxGridBandedTableViewItemPlaceController read FController; + property Formatter: TdxGridBandedTableViewFormatter read GetFormatter; + property Height: Integer read GetHeight write FHeight; + property Index: Integer read GetIndex; + property LeftBound: Integer read GetLeftBound write FLeftBound; + property Parent: TdxGridBandedTableViewItemPlace read FParent; + property TopBound: Integer read GetTopBound write FTopBound; + end; + + TdxGridBandedTableViewItemPlace = class(TdxCustomGridBandedTableViewItemPlace) + private + FChildItems: TList; + function GetChildItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; + function GetChildItemCount: Integer; + protected + function GetRowCount: Integer; override; + function InternalCalculateMinWidth: Integer; override; + function InternalCalculateWidth: Integer; override; + procedure WidthChanged; override; + + procedure CalculateChildItemWidths; + public + constructor Create(AnOwner: TdxGridBandedTableViewItemPlaceController; + AParent: TdxGridBandedTableViewItemPlace; ABand: TcxGridBand); override; + destructor Destroy; override; + + function IndexOf(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; + + property ChildItemCount: Integer read GetChildItemCount; + property ChildItems[Index: Integer]: TdxCustomGridBandedTableViewItemPlace read GetChildItem; + end; + + TdxGridBandedTableViewBottomItemPlace = class(TdxCustomGridBandedTableViewItemPlace) + protected + procedure AddItems; override; + function CalculateItemLeftBound(AnItem: TdxGridTableViewColumnPlace): Integer; override; + procedure CalculateItemsWidth; override; + function GetItemsAutoWidth: Boolean; override; + function GetItemsAvailableWidth: Integer; override; + + function GetRowCount: Integer; override; + function InternalCalculateMinWidth: Integer; override; + function InternalCalculateWidth: Integer; override; + procedure WidthChanged; override; + end; + + TdxGridBandedTableViewItemPlaceController = class(TdxCustomGridTableViewItemPlaceController) + private + FBottomItems: TList; + FHeight: Integer; + FItems: TList; + FLevelCount: Integer; + FLevelHeights: TList; + FRootItems: TList; + function GetAdapter: TdxGridBandedTableViewAdapter; + function GetAutoWidth: Boolean; + function GetAvailableWidth: Integer; + function GetBottomItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; + function GetBottomItemCount: Integer; + function GetFormatter: TdxGridBandedTableViewFormatter; + function GetHeight: Integer; + function GetItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; + function GetItemByBand(Band: TcxGridBand): TdxCustomGridBandedTableViewItemPlace; + function GetItemCount: Integer; + function GetLevelCount: Integer; + function GetLevelHeight(Index: Integer): Integer; + function GetRootItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; + function GetRootItemCount: Integer; + procedure SetLevelHeight(Index: Integer; Value: Integer); + procedure FreeAndNilItems; + protected + function CalculateHeaderLineCount: Integer; override; + function CalculateWidth: Integer; override; + function GetItemByColumn(Column: TcxGridColumn): TdxGridTableViewColumnPlace; override; + + procedure AddItems; virtual; + procedure ClearItems; + function CreateItem(ABand: TcxGridBand): TdxCustomGridBandedTableViewItemPlace; virtual; + function GetItemClass(ABand: TcxGridBand): TdxCustomGridBandedTableViewItemPlaceClass; virtual; + procedure RefreshBottomItems; + procedure RefreshItems; + procedure RefreshRootItems; + + function CalculateHeight: Integer; virtual; + function CalculateItemHeight(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; virtual; + function CalculateItemLeftBound(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; virtual; + function CalculateItemTopBound(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; virtual; + function CalculateLevelCount: Integer; virtual; + + procedure CalculateItemWidths; + procedure CalculateLevelHeights; + + property AutoWidth: Boolean read GetAutoWidth; + property Adapter: TdxGridBandedTableViewAdapter read GetAdapter; + property AvailableWidth: Integer read GetAvailableWidth; + public + constructor Create(AFormatter: TdxGridTableViewFormatter); override; + destructor Destroy; override; + + procedure Calculate; override; + procedure Refresh; override; + + function IndexOf(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; overload; + function IndexOf(ABand: TcxGridBand): Integer; overload; + function RootIndexOf(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; overload; + function RootIndexOf(ABand: TcxGridBand): Integer; overload; + + property BottomItemCount: Integer read GetBottomItemCount; + property BottomItems[Index: Integer]: TdxCustomGridBandedTableViewItemPlace read GetBottomItem; + property Formatter: TdxGridBandedTableViewFormatter read GetFormatter; + property Height: Integer read GetHeight; + property ItemCount: Integer read GetItemCount; + property Items[Index: Integer]: TdxCustomGridBandedTableViewItemPlace read GetItem; default; + property ItemsByBand[Band: TcxGridBand]: TdxCustomGridBandedTableViewItemPlace read GetItemByBand; + property LevelCount: Integer read GetLevelCount; + property LevelHeights[Index: Integer]: Integer read GetLevelHeight write SetLevelHeight; + property RootItemCount: Integer read GetRootItemCount; + property RootItems[Index: Integer]: TdxCustomGridBandedTableViewItemPlace read GetRootItem; + end; + + TdxGridBandedTableViewFormatter = class(TdxGridTableViewFormatter) + private + FBands: TList; + function GetBand(Index: Integer): TcxGridBand; + function GetBandCount: Integer; + function GetColumn(Index: Integer): TcxGridBandedColumn; + function GetItemPlaceController: TdxGridBandedTableViewItemPlaceController; + function GetShowBandHeaders: Boolean; + protected + procedure AddHorizontalDelimiters; override; + + function GetItemPlaceControllerClass: TdxCustomGridTableViewItemPlaceControllerClass; override; + + procedure BuildBandList; virtual; + procedure BuildItemLists; override; + function IsBandActuallyVisible(ABand: TcxGridBand): Boolean; virtual; + + function MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; override; + + property ItemPlaceController: TdxGridBandedTableViewItemPlaceController read GetItemPlaceController; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); override; + destructor Destroy; override; + + function Adapter: TdxGridBandedTableViewAdapter; reintroduce; overload; + function Builder: TdxGridBandedTableViewBuilder; reintroduce; overload; + + { Bands } + procedure DoInitializeBandItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + procedure DoInitializeBandRow(ARow: TdxReportCell); virtual; + procedure DoReportLinkInitializeBandItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + function GetBandItemBounds(AnIndex: Integer): TRect; virtual; + function GetBandItemClass(AnIndex: Integer): TdxReportCellTextClass; virtual; + function GetBandItemViewParams(ABand: TcxGridBand): TdxReportItemViewParams; virtual; + + property BandCount: Integer read GetBandCount; + property Bands[Index: Integer]: TcxGridBand read GetBand; + property Columns[Index: Integer]: TcxGridBandedColumn read GetColumn; + property ShowBandHeaders: Boolean read GetShowBandHeaders; + end; + + TdxGridBandedTableViewBuilder = class(TdxGridTableViewBuilder) + protected + procedure DoBuildViewBody; override; + + procedure CreateBands; virtual; + function GetBandsProducer: TdxGridTableViewBandsProducer; virtual; + function GetBandsProducerClass: TdxGridTableViewBandsProducerClass; virtual; + + function GridView: TcxGridBandedTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + public + function Adapter: TdxGridBandedTableViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + function Formatter: TdxGridBandedTableViewFormatter; reintroduce; overload; + class function FormatterClass: TdxGridViewFormatterClass; override; + end; + + { DBBandedTableView Adapter, Formatter and Builder } + + TdxGridDBBandedTableViewAdapter = class(TdxGridBandedTableViewAdapter) + private + FPrevAllRecordsAreLoaded: Boolean; + protected + procedure AfterBuilding; override; + procedure BeforeBuilding; override; + function DataController: TcxGridDBDataController; reintroduce; overload; + + function DBDataModeController: TcxDBDataModeController; virtual; + procedure LoadAllRecords; virtual; + procedure UnloadAllRecords; virtual; + public + function GridView: TcxGridDBBandedTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + end; + + TdxGridDBBandedTableViewBuilder = class(TdxGridBandedTableViewBuilder) + public + function Adapter: TdxGridDBBandedTableViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + end; + + { CardView Adapter, Formatter and Builder } + + TdxReportCard = class; + + TdxReportCardRowClass = class of TdxReportCardRow; + + TdxReportCardRow = class(TdxReportCell) + private + function GetCard: TdxReportCard; + function GetGridCardRow: TcxGridCardViewRow; + function GetHasCaption: Boolean; + function GetHeight: Integer; + function GetProperties: TcxCustomEditProperties; + function GetRowCaption: TdxReportCellText; + function GetRowData: TAbstractdxReportCellData; + function GetWidth: Integer; + procedure SetHeight(Value: Integer); + procedure SetRowCaptionWidth(Value: Integer); + procedure SetWidth(Value: Integer); + protected + procedure AdjustCellSides; virtual; + procedure CreateItems(ABuilder: TdxGridCardViewBuilder); virtual; + function MeasureCaptionWidth(DC: HDC): Integer; + function MeasureDataWidth(DC: HDC): Integer; + property Properties: TcxCustomEditProperties read GetProperties; + public + constructor CreateEx(AParent: TdxReportCell; AGridCardRow: TcxGridCardViewRow); virtual; + + function MeasureHeight(DC: HDC; ACalculateLineHeight: Boolean; + ABuilder: TdxGridCardViewBuilder): Integer; reintroduce; overload; + + property Card: TdxReportCard read GetCard; + property GridCardRow: TcxGridCardViewRow read GetGridCardRow; + property HasCaption: Boolean read GetHasCaption; + property Height: Integer read GetHeight write SetHeight; + property RowCaption: TdxReportCellText read GetRowCaption; + property RowCaptionWidth: Integer write SetRowCaptionWidth; + property RowData: TAbstractdxReportCellData read GetRowData; + property Width: Integer read GetWidth write SetWidth; + end; + + TdxCardBorderPainter = class(TdxPSCellBorderPainter) + protected + procedure DrawShadow(DC: HDC); virtual; + public + procedure Paint(DC: HDC); override; + function Card: TdxReportCard; reintroduce; overload; + end; + + TdxGridCardShadowDepth = 0..15; + TdxGridCardShadowPosition = (cspTopLeft, cspTopRight, cspBottomRight, cspBottomLeft); + + TdxReportCard = class(TdxReportCell) + private + FRowCaptionWidth: Integer; + FShadowColor: TColor; + FShadowDepth: Integer; + FShadowPosition: TdxGridCardShadowPosition; + function GetGridCard: TcxGridCard; + function GetHasShadow: Boolean; + function GetHeight: Integer; + function GetReportLink: TdxGridReportLink; + function GetRow(Index: Integer): TdxReportCardRow; + function GetRowByCardRow(CardRow: TcxGridCardViewRow): TdxReportCardRow; + function GetRowCount: Integer; + function GetRowHeight(Index: Integer): Integer; + function GetRowsAvailableHeight: Integer; + function GetRowsAvailableWidth: Integer; + function GetRowsOriginLeft: Integer; + function GetRowsOriginTop: Integer; + function GetShadowRectHorz: TRect; + function GetShadowRectVert: TRect; + function GetWidth: Integer; + procedure SetHeight(Value: Integer); + procedure SetRowCaptionWidth(Value: Integer); + procedure SetRowHeight(Index, Value: Integer); + procedure SetShadowDepth2(Value: Integer); + procedure SetWidth(Value: Integer); + protected + procedure AddVerticalDelimiters; virtual; + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); override; + procedure CreateRows(ABuilder: TdxGridCardViewBuilder); virtual; + function GetBorderPainterClass: TdxPSCellBorderPainterClass; override; + procedure ReadProperties(AReader: TdxPSDataReader); override; + procedure WriteProperties(AWriter: TdxPSDataWriter); override; + + procedure AdjustHeight; + procedure AdjustRowsCellSides; + procedure AdjustRowsPos; + procedure AdjustRowsHeight(DC: HDC; AAutoHeight: Boolean; ABuilder: TdxGridCardViewBuilder); + procedure AdjustRowsWidth(DC: HDC); + function MeasureCaptionWidth(DC: HDC): Integer; virtual; + function MeasureDataWidth(DC: HDC): Integer; virtual; + + property ReportLink: TdxGridReportLink read GetReportLink; + public + constructor Create(AParent: TdxReportCell); override; + constructor CreateEx(AParent: TdxReportCell; AGridCard: TcxGridCard); virtual; + + function GetBorderOuterBounds(DC: HDC): TRect; override; + function IndexOfCardRow(ACardRow: TcxGridCardViewRow): Integer; + + property GridCard: TcxGridCard read GetGridCard; + property HasShadow: Boolean read GetHasShadow; + property Height: Integer read GetHeight write SetHeight; + property RowCaptionWidth: Integer read FRowCaptionWidth write SetRowCaptionWidth; + property RowCount: Integer read GetRowCount; + property RowHeights[Index: Integer]: Integer read GetRowHeight write SetRowHeight; + property Rows[Index: Integer]: TdxReportCardRow read GetRow; + property RowsAvailableHeight: Integer read GetRowsAvailableHeight; + property RowsAvailableWidth: Integer read GetRowsAvailableWidth; + property RowsByCardRow[CardRow: TcxGridCardViewRow]: TdxReportCardRow read GetRowByCardRow; + property RowsOriginLeft: Integer read GetRowsOriginLeft; + property RowsOriginTop: Integer read GetRowsOriginTop; + property ShadowColor: TColor read FShadowColor write FShadowColor default clBlack; + property ShadowDepth: Integer read FShadowDepth write SetShadowDepth2 default dxDefaultCardsShadowDepth; + property ShadowRectHorz: TRect read GetShadowRectHorz; + property ShadowRectVert: TRect read GetShadowRectVert; + property ShadowPosition: TdxGridCardShadowPosition read FShadowPosition write FShadowPosition default cspBottomRight; + property Width: Integer read GetWidth write SetWidth; + end; + + TdxReportCardClass = class of TdxReportCard; + + TdxGridCardViewAdapter = class(TdxCustomGridTableViewAdapter) + private + function GetCaptionSeparator: string; + function GetCard(Index: Integer): TcxGridCard; + function GetCardCaptionWidth: Integer; + function GetCardCount: Integer; + function GetCardRow(Index: Integer): TcxGridCardViewRow; + function GetCardRowCount: Integer; + function GetCardSeparatorColor: Integer; + function GetCardSeparatorThickness: Integer; + function GetCardWidth: Integer; + function GetHasCardsSeparator: Boolean; + function GetRowAutoHeight: Boolean; + function GetRowCaptionAutoHeight: Boolean; + function GetRowCaptionEndEllipsis: Boolean; + function GetShowRowCaption(Index: Integer): Boolean; + protected + function GetAreAllMasterRowsCollapsed: Boolean; override; + + function GetCaptionRowViewParams(ARecord: TcxCustomGridRecord; + ACardRow: TcxGridCardViewRow): TcxViewParams; virtual; + function GetCardViewParams(ARecord: TcxCustomGridRecord): TcxViewParams; virtual; + function GetContentViewParams(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem): TcxViewParams; override; + function GetRowCaptionViewParams(ARecord: TcxCustomGridRecord; + ACardRow: TcxGridCardViewRow): TcxViewParams; virtual; + public + function GridView: TcxGridCardView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + function Styles: TcxGridCardViewStyles; reintroduce; overload; + + procedure GetVisibleCardRows(ACard: TcxGridCard; AList: TList); + procedure ExpandAllRows(AnOptionsExpanding: TdxGridReportLinkOptionsExpanding; ARecursive: Boolean); override; + function IsFirstRow(ACardRow: TcxGridCardViewRow): Boolean; + function IsLastRow(ACardRow: TcxGridCardViewRow): Boolean; + + property CaptionSeparator: string read GetCaptionSeparator; + property CardCaptionWidth: Integer read GetCardCaptionWidth; + property CardCount: Integer read GetCardCount; + property CardRowCount: Integer read GetCardRowCount; + property CardRows[Index: Integer]: TcxGridCardViewRow read GetCardRow; + property Cards[Index: Integer]: TcxGridCard read GetCard; + property CardSeparatorColor: Integer read GetCardSeparatorColor; + property CardSeparatorThickness: Integer read GetCardSeparatorThickness; + property CardWidth: Integer read GetCardWidth; + property HasCardsSeparator: Boolean read GetHasCardsSeparator; + property RowCaptionAutoHeight: Boolean read GetRowCaptionAutoHeight; + property RowCaptionEndEllipsis: Boolean read GetRowCaptionEndEllipsis; + property RowAutoHeight: Boolean read GetRowAutoHeight; + property ShowRowCaption[Index: Integer]: Boolean read GetShowRowCaption; + end; + + TdxGridCardViewFormatter = class(TdxCustomGridTableViewFormatter) + private + function GetAutoWidth: Boolean; + function GetCaptionAutoWidth: Boolean; + function GetCard(Index: Integer): TcxGridCard; + function GetCardCount: Integer; + function GetCardsAreaWidth: Integer; + function GetInterCardsSpaceHorz: Integer; + function GetInterCardsSpaceVert: Integer; + function GetKeepSameHeight: Boolean; + function GetKeepSameWidth: Boolean; + function GetRowAutoHeight: Boolean; + protected + procedure AddHorizontalDelimiters; override; + procedure AddVerticalDelimiters; override; + function GetViewWidth: Integer; override; + + function GetContentBackgroundBitmapStyleIndex(ATableItem: TcxCustomGridTableItem): Integer; override; + function MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; override; + + function NeedDelimitByRows: Boolean; virtual; + public + function Adapter: TdxGridCardViewAdapter; reintroduce; overload; + function Builder: TdxGridCardViewBuilder; reintroduce; overload; + + { Cards } + procedure DoInitializeCard(ACard: TdxReportCard; AGridCard: TcxGridCard); virtual; + procedure DoInitializeCardsRow(ACard: TdxReportCell); virtual; + function GetCardClass(AGridCard: TcxGridCard): TdxReportCardClass; virtual; + function GetCardViewParams(ARecord: TcxCustomGridRecord): TdxReportItemViewParams; virtual; + + { Cards Caption } + procedure DoInitializeCardRowCaption(AnItem: TdxReportCellText; + ACardRow: TcxGridCardViewRow; AGridCard: TcxGridCard); virtual; + procedure DoReportLinkInitializeCardRowCaption(AnItem: TdxReportCellText; + ACardRow: TcxGridCardViewRow; AGridCard: TcxGridCard); virtual; + function GetCardRowCaptionClass(ACardRow: TcxGridCardViewRow): TdxReportCellTextClass; virtual; + function GetCardRowCaptionViewParams(ARecord: TcxCustomGridRecord; + ACardRow: TcxGridCardViewRow): TdxReportItemViewParams; virtual; + + { Cards Data } + procedure DoReportLinkInitializeCardRowData(AnItem: TAbstractdxReportCellData; + ACardRow: TcxGridCardViewRow; AGridCard: TcxGridCard); virtual; + function GetItemViewParams(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False): TdxReportItemViewParams; override; + + property AutoWidth: Boolean read GetAutoWidth; + property CaptionAutoWidth: Boolean read GetCaptionAutoWidth; + property CardCount: Integer read GetCardCount; + property Cards[Index: Integer]: TcxGridCard read GetCard; + property CardsAreaWidth: Integer read GetCardsAreaWidth; + property InterCardsSpaceHorz: Integer read GetInterCardsSpaceHorz; + property InterCardsSpaceVert: Integer read GetInterCardsSpaceVert; + property KeepSameHeight: Boolean read GetKeepSameHeight; + property KeepSameWidth: Boolean read GetKeepSameWidth; + property RowAutoHeight: Boolean read GetRowAutoHeight; + end; + + TdxGridCardViewBuilder = class(TdxCustomGridTableViewBuilder) + private + FCards: TList; + FMaxCardWidth: Integer; + function GetCard(Index: Integer): TdxReportCard; + function GetCardCount: Integer; + + procedure AdjustCardRowsCellSides; + procedure CreateCards; + procedure ResizeCards; + protected + procedure DoBuildViewBody; override; + + function GetCardsRowProducer: TdxGridCardViewCardsRowProducer; virtual; + function GetCardsRowProducerClass: TdxGridCardViewCardsRowProducerClass; virtual; + procedure PlaceCards; virtual; + + function GridView: TcxGridCardView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + + property CardCount: Integer read GetCardCount; + property Cards[Index: Integer]: TdxReportCard read GetCard; + public + constructor Create(AReportLink: TdxGridReportLink; + AMasterBuilder: TdxCustomGridViewBuilder; AGridView: TcxCustomGridView); override; + destructor Destroy; override; + + function Adapter: TdxGridCardViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + function Formatter: TdxGridCardViewFormatter; reintroduce; overload; + class function FormatterClass: TdxGridViewFormatterClass; override; + + property MaxCardWidth: Integer read FMaxCardWidth; + end; + + { DBCardView Adapter, Formatter and Builder } + + TdxGridDBCardViewAdapter = class(TdxGridCardViewAdapter) + private + FPrevAllRecordsAreLoaded: Boolean; + protected + procedure AfterBuilding; override; + procedure BeforeBuilding; override; + function DataController: TcxGridDBDataController; reintroduce; overload; + + function DBDataModeController: TcxDBDataModeController; virtual; + procedure LoadAllRecords; virtual; + procedure UnloadAllRecords; virtual; + public + function GridView: TcxGridDBCardView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + end; + + TdxGridDBCardViewBuilder = class(TdxGridCardViewBuilder) + public + function Adapter: TdxGridDBCardViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + end; + + { Producers } + + TdxGridViewRowProducer = class + private + FBuilder: TdxCustomGridViewBuilder; + FHost: TdxReportCell; + FMasterIndents: TList; + FRow: TdxReportCell; + FRowHeight: Integer; + function GetDC: HDC; + function GetHostClass: TdxReportCellClass; + function GetIndentWidth: Integer; + function GetMasterBuilder(Index: Integer): TdxCustomGridViewBuilder; + function GetMasterIndent(Index: Integer): TdxReportCellBox; + function GetMasterIndentCount: Integer; + function GetRowHostClass: TdxReportCellClass; + function GetRowOriginX: Integer; + function GetRowWidth: Integer; + protected + procedure AddLeadingMasterIndentsAndSeparators; virtual; + procedure AddMasterIndents(AMasterFormatter: TdxCustomGridViewFormatter; + AMasterAdapter: TdxCustomGridViewAdapter; ALevel: Integer; var ALeftPos: Integer); + procedure AddMasterSeparator(AMasterFormatter: TdxCustomGridViewFormatter; + AMasterAdapter: TdxCustomGridViewAdapter; var ALeftPos: Integer; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); + procedure AddTrailingMasterSeparators; virtual; + function CalculateItemHeight(DC: HDC; AnItem: TdxReportVisualItem): Integer; virtual; + procedure CalculateRowAutoHeight; virtual; + procedure CalculateRowHeight; virtual; + function CreateDetailsSeparator(AParent: TdxReportCell): TdxReportCellBox; virtual; + function CreateMasterIndent(AParent: TdxReportCell): TdxReportCellExpandButton; virtual; + procedure CreateRow; virtual; + procedure CreateRowHost(const AHostInfo: TdxGridAttributeHostInfo); virtual; + function DoesItemParticipateInRowAutoHeightCalculation(AnItem: TdxReportVisualItem): Boolean; virtual; + function GetDetailsSeparatorClass: TdxReportCellBoxClass; virtual; + function GetMasterIndentClass: TdxReportCellExpandButtonClass; virtual; + procedure FixupMasterIndentsHeight; virtual; + procedure FixupRowDataItemHeight(AnItem: TdxReportVisualItem); virtual; + procedure FixupRowDataHeight; virtual; + procedure FixupRowHeight; virtual; + procedure FixupRowOwnHeight; virtual; + procedure InitializeDetailsSeparator(AFormatter: TdxCustomGridViewFormatter; + ASeparator: TdxReportCellBox; ASeparatorKind: TdxVerticalDetailsSeparatorKind); virtual; + procedure InitializeMasterIndent(AFormatter: TdxCustomGridViewFormatter; + AIndent: TdxReportCellExpandButton; AIndex, ALevel: Integer); virtual; + procedure InitializeHost; virtual; + procedure InitializeRow; virtual; + + function GetAutoHeight: Boolean; virtual; + function GetItemsSite: TdxReportCell; virtual; + function GetLineCount: Integer; virtual; + function GetLineHeight: Integer; virtual; + function GetWidth: Integer; virtual; + + property DC: HDC read GetDC; + property HostClass: TdxReportCellClass read GetHostClass; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); virtual; + destructor Destroy; override; + + function Adapter: TdxCustomGridViewAdapter; overload; virtual; + function Builder: TdxCustomGridViewBuilder; overload; virtual; + function Formatter: TdxCustomGridViewFormatter; overload; virtual; + + function Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; virtual; + + property AutoHeight: Boolean read GetAutoHeight; + property Host: TdxReportCell read FHost; + property IndentWidth: Integer read GetIndentWidth; + property ItemsSite: TdxReportCell read GetItemsSite; + property LineCount: Integer read GetLineCount; + property LineHeight: Integer read GetLineHeight; + property MasterBuilders[Index: Integer]: TdxCustomGridViewBuilder read GetMasterBuilder; + property MasterIndentCount: Integer read GetMasterIndentCount; + property MasterIndents[Index: Integer]: TdxReportCellBox read GetMasterIndent; + property Row: TdxReportCell read FRow; + property RowHeight: Integer read FRowHeight write FRowHeight; + property RowOriginX: Integer read GetRowOriginX; + property RowWidth: Integer read GetRowWidth; + property Width: Integer read GetWidth; + end; + + TdxGridViewCustomRowProducer = class(TdxGridViewRowProducer) + private + FItem: TAbstractdxReportCellData; + protected + procedure AddItem; virtual; + function CreateItem(AParent: TdxReportCell): TAbstractdxReportCellData; virtual; + procedure FixupRowDataHeight; override; + procedure InitializeItem; virtual; + + function GetAutoHeight: Boolean; override; + function GetItemClass: TdxReportCellDataClass; virtual; + + property Item: TAbstractdxReportCellData read FItem; + public + function Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; override; + end; + + TdxGridViewCaptionProducer = class(TdxGridViewCustomRowProducer) + private + function GetItem: TdxReportCellText; + protected + procedure InitializeItem; override; + procedure InitializeRow; override; + + function GetItemClass: TdxReportCellDataClass; override; + function GetLineHeight: Integer; override; + public + property Item: TdxReportCellText read GetItem; + end; + + TdxGridViewFilterBarProducer = class(TdxGridViewCustomRowProducer) + private + function GetItem: TdxReportCellText; + protected + procedure InitializeItem; override; + procedure InitializeRow; override; + + function GetItemClass: TdxReportCellDataClass; override; + function GetLineHeight: Integer; override; + public + property Item: TdxReportCellText read GetItem; + end; + + TdxGridViewDetailsSeparatorProducer = class(TdxGridViewCustomRowProducer) + private + function GetItem: TdxReportCellBox; + protected + procedure InitializeItem; override; + procedure InitializeRow; override; + + function GetItemClass: TdxReportCellDataClass; override; + function GetLineHeight: Integer; override; + public + property Item: TdxReportCellBox read GetItem; + end; + + TdxGridViewDetailsTopSeparatorProducer = class(TdxGridViewDetailsSeparatorProducer) + protected + procedure InitializeDetailsSeparator(AFormatter: TdxCustomGridViewFormatter; + ASeparator: TdxReportCellBox; ASeparatorKind: TdxVerticalDetailsSeparatorKind); override; + end; + + TdxGridViewDetailsBottomSeparatorProducer = class(TdxGridViewDetailsSeparatorProducer) + protected + procedure InitializeDetailsSeparator(AFormatter: TdxCustomGridViewFormatter; + ASeparator: TdxReportCellBox; ASeparatorKind: TdxVerticalDetailsSeparatorKind); override; + end; + + TdxGridViewTerminatorProducer = class(TdxGridViewDetailsSeparatorProducer) + protected + procedure InitializeItem; override; + function GetLineHeight: Integer; override; + end; + + TdxGridTableViewRowProducer = class(TdxGridViewRowProducer) + public + function Adapter: TdxGridTableViewAdapter; reintroduce; overload; + function Builder: TdxGridTableViewBuilder; reintroduce; overload; + function Formatter: TdxGridTableViewFormatter; reintroduce; overload; + end; + + TdxGridTableViewRowSubItemsProducer = class(TdxGridTableViewRowProducer) + private + FIndents: TList; + FSubItems: TList; + function GetColumn(Index: Integer): TcxGridColumn; + function GetIndent(Index: Integer): TdxReportCellExpandButton; + function GetSubItem(Index: Integer): TdxReportVisualItem; + protected + procedure AddIndents(AParent: TdxReportCell); virtual; + procedure AddSubItems(AParent: TdxReportCell); virtual; + procedure CreateRow; override; + function CreateSubItem(AnIndex: Integer; AParent: TdxReportCell): TAbstractdxReportCellData; + function IsItemIndent(AnItem: TdxReportVisualItem): Boolean; + + procedure FixupIndentsHeight; virtual; + procedure FixupRowDataHeight; override; + procedure FixupRowHeight; override; + + procedure InitializeIndentList; virtual; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); virtual; + procedure InitializeSubItemList; virtual; + + function GetHasSubItem(Index: Integer): Boolean; virtual; + function GetIndentCount: Integer; virtual; + function GetSubItemBound(Index: Integer): TRect; virtual; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; virtual; abstract; + function GetSubItemCount: Integer; virtual; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); override; + destructor Destroy; override; + + function Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; override; + + property Columns[Index: Integer]: TcxGridColumn read GetColumn; + property HasSubItem[Index: Integer]: Boolean read GetHasSubItem; + property IndentCount: Integer read GetIndentCount; + property Indents[Index: Integer]: TdxReportCellExpandButton read GetIndent; + property SubItemBounds[Index: Integer]: TRect read GetSubItemBound; + property SubItemClasses[Index: Integer]: TdxReportCellDataClass read GetSubItemClass; + property SubItemCount: Integer read GetSubItemCount; + property SubItems[Index: Integer]: TdxReportVisualItem read GetSubItem; default; + end; + + TdxGridTableViewHeadersProducer = class(TdxGridTableViewRowSubItemsProducer) + protected + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + end; + + TdxGridTableViewFootersProducer = class(TdxGridTableViewRowSubItemsProducer) + protected + procedure CalculateRowAutoHeight; override; + procedure CalculateRowHeight; override; + procedure FixupRowDataItemHeight(AnItem: TdxReportVisualItem); override; + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetHasSubItem(Index: Integer): Boolean; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + end; + + TdxGridTableViewCustomDataRowProducer = class(TdxGridTableViewRowSubItemsProducer) + private + FGridRow: TcxCustomGridRow; + FGridRowIndex: Integer; + function GetIndentArea: Integer; + function GetIndentBounds(Index: Integer): TRect; + protected + procedure AddIndents(AParent: TdxReportCell); override; + function CreateIndent(AnIndex: Integer; AParent: TdxReportCell): TdxReportCellExpandButton; virtual; + procedure InitializeIndent(AIndent: TdxReportCellExpandButton; AIndex: Integer); virtual; + + function GetIndentCount: Integer; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + public + function GridRow: TcxCustomGridRow; overload; virtual; + function Produce(AHostInfo: TdxGridAttributeHostInfo; + AGridRow: TcxCustomGridRow; AGridRowIndex: Integer): TdxReportCell; reintroduce; virtual; + + property GridRowIndex: Integer read FGridRowIndex; + property IndentArea: Integer read GetIndentArea; + property IndentBounds[Index: Integer]: TRect read GetIndentBounds; + end; + + TdxCustomGridTableViewRowSeparatorProducer = class(TdxGridTableViewCustomDataRowProducer) + protected + procedure InitializeIndent(AIndent: TdxReportCellExpandButton; AIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetSubItemCount: Integer; override; + function GetSubItemBound(Index: Integer): TRect; override; + public + function Produce(AHostInfo: TdxGridAttributeHostInfo; + AGridRow: TcxCustomGridRow): TdxReportCell; reintroduce; virtual; + end; + + TdxGridTableViewRowSeparatorProducer = class(TdxCustomGridTableViewRowSeparatorProducer) + private + FIsLast: Boolean; + protected + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetIndentCount: Integer; override; + function GetLineHeight: Integer; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + public + function Produce(AHostInfo: TdxGridAttributeHostInfo; AGridRow: TcxCustomGridRow; + AnIsLast: Boolean): TdxReportCell; reintroduce; virtual; + property IsLast: Boolean read FIsLast; + end; + + TdxGridTableViewGroupRowSeparatorProducer = class(TdxCustomGridTableViewRowSeparatorProducer) + protected + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + function GetLineHeight: Integer; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + end; + + TdxGridTableViewDataRowProducer = class(TdxGridTableViewCustomDataRowProducer) + private + FPreviewItem: TdxReportVisualItem;//TAbstractdxReportCellData; + function GetPreviewColumn: TcxGridColumn; + function GetPreviewPlace: TcxGridPreviewPlace; + protected + procedure AddPreview(AParent: TdxReportCell); virtual; + procedure AddSubItems(AParent: TdxReportCell); override; + procedure CalculateRowAutoHeight; override; + function DoesItemParticipateInRowAutoHeightCalculation(AnItem: TdxReportVisualItem): Boolean; override; + function CreatePreview(AParent: TdxReportCell): TdxReportVisualItem; virtual; + function GetPreviewClass: TdxReportCellDataClass; virtual; + procedure FixupRowDataHeight; override; + procedure InitializeIndent(AIndent: TdxReportCellExpandButton; AIndex: Integer); override; + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetCellAutoHeight: Boolean; virtual; + function GetHasPreview: Boolean; virtual; + function GetIndentCount: Integer; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + function GetPreviewHeight: Integer; virtual; + function GetPreviewLineCount: Integer; virtual; + function GetPreviewLineHeight: Integer; virtual; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + public + function GridRow: TcxGridDataRow; reintroduce; overload; + + property CellAutoHeight: Boolean read GetCellAutoHeight; + property HasPreview: Boolean read GetHasPreview; + property PreviewColumn: TcxGridColumn read GetPreviewColumn; + property PreviewHeight: Integer read GetPreviewHeight; + property PreviewItem: TdxReportVisualItem read FPreviewItem;//TAbstractdxReportCellData read FPreviewItem; + property PreviewLineCount: Integer read GetPreviewLineCount; + property PreviewLineHeight: Integer read GetPreviewLineHeight; + property PreviewPlace: TcxGridPreviewPlace read GetPreviewPlace; + end; + + TdxGridTableViewGroupRowProducer = class(TdxGridTableViewCustomDataRowProducer) + protected + procedure InitializeRow; override; + procedure InitializeIndent(AIndent: TdxReportCellExpandButton; AIndex: Integer); override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetIndentCount: Integer; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + function GetSubItemCount: Integer; override; + public + function GridRow: TcxGridGroupRow; reintroduce; overload; + end; + + TdxGridTableViewMasterRowProducer = class(TdxGridTableViewDataRowProducer) + protected + procedure InitializeIndent(AIndent: TdxReportCellExpandButton; AIndex: Integer); override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetIndentCount: Integer; override; + public + function GridRow: TcxGridMasterDataRow; reintroduce; overload; + end; + + TdxGridTableViewGroupFooterProducer = class(TdxGridTableViewCustomDataRowProducer) + private + FGroupLevel: Integer; + FIndex: Integer; + FItemsSite: TdxReportCell; + function GetGroupLevel: Integer; + function GetHostBounds: TRect; + protected + procedure AddSubItems(AParent: TdxReportCell); override; + procedure CalculateRowAutoHeight; override; + procedure FixupRowDataItemHeight(AnItem: TdxReportVisualItem); override; + procedure InitializeIndent(AIndent: TdxReportCellExpandButton; AIndex: Integer); override; + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetHasSubItem(Index: Integer): Boolean; override; + function GetIndentCount: Integer; override; + function GetItemsSite: TdxReportCell; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + public + function Produce(AHostInfo: TdxGridAttributeHostInfo; AGridRow: TcxCustomGridRow; + AGroupLevel, AnIndex: Integer): TdxReportCell; reintroduce; virtual; + + property GroupLevel: Integer read GetGroupLevel; + property HostBounds: TRect read GetHostBounds; + property Index: Integer read FIndex; + end; + + TdxGridTableViewBandsProducer = class(TdxGridTableViewRowSubItemsProducer) + protected + procedure CalculateRowHeight; override; + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + function GetSubItemCount: Integer; override; + public + function Adapter: TdxGridBandedTableViewAdapter; reintroduce; overload; + function Builder: TdxGridBandedTableViewBuilder; reintroduce; overload; + function Formatter: TdxGridBandedTableViewFormatter; reintroduce; overload; + end; + + TdxGridCardViewCardsRowProducer = class(TdxGridViewRowProducer) + protected + procedure CalculateRowHeight; override; + function GetAutoHeight: Boolean; override; + procedure InitializeRow; override; + public + function Adapter: TdxGridCardViewAdapter; reintroduce; overload; + function Builder: TdxGridCardViewBuilder; reintroduce; overload; + function Formatter: TdxGridCardViewFormatter; reintroduce; overload; + + function CreateCard(AParent: TdxReportCell; AGridCard: TcxGridCard): TdxReportCard; virtual; + procedure InjectCard(ACard: TdxReportCard; AIndex: Integer); virtual; + function Produce(AHostInfo: TdxGridAttributeHostInfo; + ARowHeight: Integer): TdxReportCell; reintroduce; virtual; + end; + + { Options } + + TdxGridReportLinkOptionsClass = class of TdxGridReportLinkOptions; + + TdxGridReportLinkOptions = class(TdxCustomReportLinkOptions) + private + function GetReportLink: TdxGridReportLink; + public + property ReportLink: TdxGridReportLink read GetReportLink; + end; + + TdxGridReportLinkOptionsCards = class; + + TdxGridReportLinkCardsShadowClass = class of TdxGridReportLinkCardsShadow; + + TdxGridReportLinkCardsShadow = class(TPersistent) + private + FColor: TColor; + FDepth: TdxGridCardShadowDepth; + FOptionsCards: TdxGridReportLinkOptionsCards; + FPosition: TdxGridCardShadowPosition; + function GetActualColor: TColor; + function GetVisible: Boolean; + procedure SetColor(Value: TColor); + procedure SetDepth(Value: TdxGridCardShadowDepth); + procedure SetPosition(Value: TdxGridCardShadowPosition); + protected + procedure Changed; dynamic; + public + constructor Create(AnOptionsCards: TdxGridReportLinkOptionsCards); virtual; + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; virtual; + + property ActualColor: TColor read GetActualColor; + property OptionsCards: TdxGridReportLinkOptionsCards read FOptionsCards; + property Visible: Boolean read GetVisible; + published + property Color: TColor read FColor write SetColor default clDefault; + property Depth: TdxGridCardShadowDepth read FDepth write SetDepth default dxDefaultCardsShadowDepth; + property Position: TdxGridCardShadowPosition read FPosition write SetPosition default cspBottomRight; + end; + + TdxGridReportLinkOptionsCardsClass = class of TdxGridReportLinkOptionsCards; + + TdxGridReportLinkOptionsCards = class(TdxGridReportLinkOptions) + private + FAutoWidth: Boolean; + FBorders: Boolean; + FInterCardsSpaceHorz: Integer; + FInterCardsSpaceVert: Integer; + FKeepSameHeight: Boolean; + FKeepSameWidth: Boolean; + FRowBordersHorz: Boolean; + FRowBordersVert: Boolean; + FShadow: TdxGridReportLinkCardsShadow; + function GetShadow: TdxGridReportLinkCardsShadow; + procedure SetAutoWidth(Value: Boolean); + procedure SetBorders(Value: Boolean); + procedure SetInterCardsSpaceHorz(Value: Integer); + procedure SetInterCardsSpaceVert(Value: Integer); + procedure SetKeepSameHeight(Value: Boolean); + procedure SetKeepSameWidth(Value: Boolean); + procedure SetRowBordersHorz(Value: Boolean); + procedure SetRowBordersVert(Value: Boolean); + procedure SetShadow(Value: TdxGridReportLinkCardsShadow); + protected + function DesignerTabIndex: Integer; override; + function GetShadowClass: TdxGridReportLinkCardsShadowClass; virtual; + public + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property AutoWidth: Boolean read FAutoWidth write SetAutoWidth default False; + property Borders: Boolean read FBorders write SetBorders default True; + property InterCardsSpaceHorz: Integer read FInterCardsSpaceHorz write SetInterCardsSpaceHorz default 4; + property InterCardsSpaceVert: Integer read FInterCardsSpaceVert write SetInterCardsSpaceVert default 4; + property KeepSameHeight: Boolean read FKeepSameHeight write SetKeepSameHeight default True; + property KeepSameWidth: Boolean read FKeepSameWidth write SetKeepSameWidth default True; + property RowBordersHorz: Boolean read FRowBordersHorz write SetRowBordersHorz default False; + property RowBordersVert: Boolean read FRowBordersVert write SetRowBordersVert default False; + property Shadow: TdxGridReportLinkCardsShadow read GetShadow write SetShadow; + end; + + TdxGridReportLinkOptionsDetailsClass = class of TdxGridReportLinkOptionsDetails; + + TdxGridReportLinkOptionsDetails = class(TdxGridReportLinkOptions) + private + FOnlyFocusedView: Boolean; + FStartFromFocusedView: Boolean; + procedure SetOnlyFocusedView(Value: Boolean); + procedure SetStartFromFocusedView(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property OnlyFocusedView: Boolean read FOnlyFocusedView write SetOnlyFocusedView default False; + property StartFromFocusedView: Boolean read FStartFromFocusedView write SetStartFromFocusedView default False; + end; + + TdxGridReportLinkOptionsExpanding = class(TdxCustomReportLinkOptionsExpanding) + private + FExpandGroupRows: Boolean; + FExpandMasterRows: Boolean; + function GetHasAny: Boolean; + function GetReportLink: TdxGridReportLink; + procedure SetExpandGroupRows(Value: Boolean); + procedure SetExpandMasterRows(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + + property HasAny: Boolean read GetHasAny; + property ReportLink: TdxGridReportLink read GetReportLink; + published + property ExpandGroupRows: Boolean read FExpandGroupRows write SetExpandGroupRows default False; + property ExpandMasterRows: Boolean read FExpandMasterRows write SetExpandMasterRows default False; + end; + + TdxGridReportLinkOptionsFormatting = class(TdxCustomReportLinkOptionsFormatting) + private + FConsumeSelectionStyle: Boolean; + function GetReportLink: TdxGridReportLink; + procedure SetConsumeSelectionStyle(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + property ReportLink: TdxGridReportLink read GetReportLink; + published + property ConsumeSelectionStyle: Boolean read FConsumeSelectionStyle write SetConsumeSelectionStyle default False; + property UseLookAndFeelColors; + end; + + TdxGridReportLinkOptionsLevelsClass = class of TdxGridReportLinkOptionsLevels; + + TdxGridReportLinkOptionsLevels = class(TdxGridReportLinkOptions) + private + FRiseActiveLevelOntoTop: Boolean; + FUnwrap: Boolean; + FUnwrapTopLevel: Boolean; + procedure SetRiseActiveLevelOntoTop(Value: Boolean); + procedure SetUnwrap(Value: Boolean); + procedure SetUnwrapTopLevel(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property RiseActiveLevelOntoTop: Boolean read FRiseActiveLevelOntoTop write SetRiseActiveLevelOntoTop default True; + property Unwrap: Boolean read FUnwrap write SetUnwrap default False; + property UnwrapTopLevel: Boolean read FUnwrapTopLevel write SetUnwrapTopLevel default True; + end; + + TdxGridReportLinkOptionsOnEveryPage = class(TdxCustomTableControlReportLinkOptionsOnEveryPage) + private + FCaption: Boolean; + FFilterBar: Boolean; + function GetReportLink: TdxGridReportLink; + procedure SetCaption(Value: Boolean); + procedure SetFilterBar(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + + function HasInstalledAttribute(AnAttribute: TdxGridAttributeClass): Boolean; virtual; + procedure SetAll; virtual; + procedure UnsetAll; virtual; + + property ReportLink: TdxGridReportLink read GetReportLink; + published + property BandHeaders; + property Caption: Boolean read FCaption write SetCaption default True; + property FilterBar: Boolean read FFilterBar write SetFilterBar default True; + property Footers; + property Headers; + end; + + TdxGridReportLinkOptionsPagination = class(TdxCustomTableControlReportLinkOptionsPagination) + private + FOneGroupPerPage: Boolean; + FTopLevelGroup: Boolean; + function GetReportLink: TdxGridReportLink; + procedure SetOneGroupPerPage(Value: Boolean); + procedure SetTopLevelGroup(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + property ReportLink: TdxGridReportLink read GetReportLink; + published + property Band; + property Column; + property Custom; + property OneGroupPerPage: Boolean read FOneGroupPerPage write SetOneGroupPerPage default False; + property Row; + property TopLevelGroup: Boolean read FTopLevelGroup write SetTopLevelGroup default False; + end; + + TdxGridReportLinkOptionsPreview = class(TdxCustomTableControlReportLinkOptionsPreview) + private + function GetReportLink: TdxGridReportLink; + protected + function DesignerTabIndex: Integer; override; + public + property ReportLink: TdxGridReportLink read GetReportLink; + end; + + TdxGridReportLinkOptionsRefinements = class(TdxCustomReportLinkOptionsRefinements) + private + function GetReportLink: TdxGridReportLink; + protected + function DesignerTabIndex: Integer; override; + public + property ReportLink: TdxGridReportLink read GetReportLink; + end; + + TdxGridReportLinkOptionsSelection = class(TdxCustomTableControlReportLinkOptionsSelection) + private + function GetReportLink: TdxGridReportLink; + protected + function DesignerTabIndex: Integer; override; + public + property ReportLink: TdxGridReportLink read GetReportLink; + end; + + TdxGridReportLinkOptionsSize = class(TdxCustomReportLinkOptionsSize) + private + function GetReportLink: TdxGridReportLink; + protected + function DesignerTabIndex: Integer; override; + public + property ReportLink: TdxGridReportLink read GetReportLink; + published + property AutoWidth; + end; + + TdxGridReportLinkOptionsView = class(TdxCustomTableControlReportLinkOptionsView) + private + FCaption: Boolean; + FFilterBar: Boolean; + FGroupFooters: Boolean; + function GetReportLink: TdxGridReportLink; + procedure SetCaption(Value: Boolean); + procedure SetFilterBar(Value: Boolean); + procedure SetGroupFooters(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + + function HasInstalledAttribute(AnAttribute: TdxGridAttributeClass): Boolean; virtual; + procedure SetAll; + procedure UnsetAll; + + property ReportLink: TdxGridReportLink read GetReportLink; + published + property BandHeaders; + property Caption: Boolean read FCaption write SetCaption default True; + property ExpandButtons; + property FilterBar: Boolean read FFilterBar write SetFilterBar default True; + property Footers; + property GroupFooters: Boolean read FGroupFooters write SetGroupFooters default True; + property Headers; + end; + + TdxGridAttributeHostInfo = class + private + FParent: TdxReportCell; + public + Origin: TPoint; + procedure Initialize(AParent: TdxReportCell); + property Parent: TdxReportCell read FParent; + end; + + TdxGridAttributeHostInfoServicesClass = class of TdxGridAttributeHostInfoServices; + + TdxGridAttributeHostInfoServices = class + private + FPageDetailsHostInfo: TdxGridAttributeHostInfo; + FPageFootersHostInfo: TdxGridAttributeHostInfo; + FPageHeadersHostInfo: TdxGridAttributeHostInfo; + FReportLink: TdxGridReportLink; + function GetActiveView: TcxCustomGridView; + function GetActiveViewHelper: TdxCustomGridViewHelperClass; + function GetArePageFootersAssigned: Boolean; + function GetArePageHeadersAssigned: Boolean; + function GetCanUseBandHeadersOnEveyPage: Boolean; + function GetCanUseCaptionOnEveryPage: Boolean; + function GetCanUseFilterBarOnEveryPage: Boolean; + function GetCanUseFootersOnEveryPage: Boolean; + function GetCanUseHeadersOnEveryPage: Boolean; + function GetIsInconsistentBandHeadersState: Boolean; + function GetIsInconsistentFilterBarState: Boolean; + function GetIsInconsistentFootersState: Boolean; + function GetIsInconsistentHeadersState: Boolean; + function GetLevelSeparatorBottomHostInfo: TdxGridAttributeHostInfo; + function GetLevelSeparatorTopHostInfo: TdxGridAttributeHostInfo; + function GetOptionsOnEveryPage: TdxGridReportLinkOptionsOnEveryPage; + function GetOptionsView: TdxGridReportLinkOptionsView; + function GetPageDetails: TdxReportCell; + function GetPageFooters: TdxReportCell; + function GetPageHeaders: TdxReportCell; + protected + procedure CreateHostInfos; + procedure DestroyHostInfos; + + function GetBandHeadersHostInfo: TdxGridAttributeHostInfo; virtual; + function GetCaptionHostInfo: TdxGridAttributeHostInfo; virtual; + function GetFilterBarHostInfo: TdxGridAttributeHostInfo; virtual; + function GetFootersHostInfo: TdxGridAttributeHostInfo; virtual; + function GetHeadersHostInfo: TdxGridAttributeHostInfo; virtual; + function GetInconsistentStateText: string; virtual; + function GetIsInconsistentState: Boolean; virtual; + function HasCells: Boolean; + function IsAttributeSupported(AnAttribute: TdxGridAttributeClass): Boolean; + + //function HasAttributeOnEveryPage: Boolean; + + property ActiveView: TcxCustomGridView read GetActiveView; + property ActiveViewHelper: TdxCustomGridViewHelperClass read GetActiveViewHelper; + property OptionsOnEveryPage: TdxGridReportLinkOptionsOnEveryPage read GetOptionsOnEveryPage; + property OptionsView: TdxGridReportLinkOptionsView read GetOptionsView; + property PageDetails: TdxReportCell read GetPageDetails; + property PageFooters: TdxReportCell read GetPageFooters; + property PageHeaders: TdxReportCell read GetPageHeaders; + public + constructor Create(AReportLink: TdxGridReportLink); virtual; + destructor Destroy; override; + procedure Initialize; + + property ArePageFootersAssigned: Boolean read GetArePageFootersAssigned; + property ArePageHeadersAssigned: Boolean read GetArePageHeadersAssigned; + property BandHeadersHostInfo: TdxGridAttributeHostInfo read GetBandHeadersHostInfo; + property CanUseBandHeadersOnEveyPage: Boolean read GetCanUseBandHeadersOnEveyPage; + property CanUseCaptionOnEveryPage: Boolean read GetCanUseCaptionOnEveryPage; + property CanUseFilterBarOnEveryPage: Boolean read GetCanUseFilterBarOnEveryPage; + property CanUseFootersOnEveryPage: Boolean read GetCanUseFootersOnEveryPage; + property CanUseHeadersOnEveryPage: Boolean read GetCanUseHeadersOnEveryPage; + property CaptionHostInfo: TdxGridAttributeHostInfo read GetCaptionHostInfo; + property FilterBarHostInfo: TdxGridAttributeHostInfo read GetFilterBarHostInfo; + property FootersHostInfo: TdxGridAttributeHostInfo read GetFootersHostInfo; + property HeadersHostInfo: TdxGridAttributeHostInfo read GetHeadersHostInfo; + property InconsistentStateText: string read GetInconsistentStateText; + property IsInconsistentBandHeadersState: Boolean read GetIsInconsistentBandHeadersState; + property IsInconsistentFilterBarState: Boolean read GetIsInconsistentFilterBarState; + property IsInconsistentFootersState: Boolean read GetIsInconsistentFootersState; + property IsInconsistentHeadersState: Boolean read GetIsInconsistentHeadersState; + property IsInconsistentState: Boolean read GetIsInconsistentState; + property LevelSeparatorBottomHostInfo: TdxGridAttributeHostInfo read GetLevelSeparatorBottomHostInfo; + property LevelSeparatorTopHostInfo: TdxGridAttributeHostInfo read GetLevelSeparatorTopHostInfo; + property PageDetailsHostInfo: TdxGridAttributeHostInfo read FPageDetailsHostInfo; + property PageFootersHostInfo: TdxGridAttributeHostInfo read FPageFootersHostInfo; + property PageHeadersHostInfo: TdxGridAttributeHostInfo read FPageHeadersHostInfo; + property ReportLink: TdxGridReportLink read FReportLink; + end; + + TdxGridReportLinkStylesClass = class of TdxGridReportLinkStyles; + + TdxGridReportLinkStyles = class(TdxCustomReportLinkStyles) + private + function GetReportLink: TdxGridReportLink; + protected + function DesignerTabIndex: Integer; override; + + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + class function GetStyleCaption(AnIndex: Integer): string; override; + function GetStyleIndexByCaption(const Caption: string): Integer; override; + + function IsCardViewStyle(AStyle: TcxStyle): Boolean; + public + procedure Assign(Source: TPersistent); override; + + procedure GetBandHeaderParams(ABand: TcxGridBand; out AParams: TcxViewParams); virtual; + procedure GetCaptionParams(ATabLevel: TcxGridLevel; out AParams: TcxViewParams); virtual; + procedure GetCardCaptionRowParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); virtual; + procedure GetCardRowCaptionParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); virtual; + procedure GetContentParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); virtual; + procedure GetFilterBarParams(out AParams: TcxViewParams); virtual; + procedure GetFooterParams(ARecord: TcxCustomGridRecord; AGroupLevel: Integer; + AItem: TcxGridColumn; out AParams: TcxViewParams); virtual; + procedure GetGroupParams(ARecord: TcxCustomGridRecord; AGroupLevel: Integer; + out AParams: TcxViewParams); virtual; + procedure GetHeaderParams(AItem: TcxGridColumn; out AParams: TcxViewParams); virtual; + procedure GetPreviewParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); virtual; + procedure GetSelectionParams(out AParams: TcxViewParams); virtual; + + property ReportLink: TdxGridReportLink read GetReportLink; + published + property BandHeader: TcxStyle Index vspsGridBandHeader read GetValue write SetValue; + property Caption: TcxStyle Index vspsGridCaption read GetValue write SetValue; + property CardCaptionRow: TcxStyle Index vspsGridCardCaptionRow read GetValue write SetValue; + property CardRowCaption: TcxStyle Index vspsGridCardRowCaption read GetValue write SetValue; + property Content: TcxStyle Index vspsGridContent read GetValue write SetValue; + property ContentEven: TcxStyle Index vspsGridContentEven read GetValue write SetValue; + property ContentOdd: TcxStyle Index vspsGridContentOdd read GetValue write SetValue; + property FilterBar: TcxStyle Index vspsGridFilterBar read GetValue write SetValue; + property Footer: TcxStyle Index vspsGridFooter read GetValue write SetValue; + property Group: TcxStyle Index vspsGridGroup read GetValue write SetValue; + property Header: TcxStyle Index vspsGridHeader read GetValue write SetValue; + property Preview: TcxStyle Index vspsGridPreview read GetValue write SetValue; + property Selection: TcxStyle Index vspsGridSelection read GetValue write SetValue; + property StyleSheet; + end; + + TdxGridReportLinkStyleSheet = class(TdxCustomReportLinkStyleSheet) + private + function GetStylesValue: TdxGridReportLinkStyles; + procedure SetStylesValue(Value: TdxGridReportLinkStyles); + public + class function GetStylesClass: TcxCustomStylesClass; override; + published + property Styles: TdxGridReportLinkStyles read GetStylesValue write SetStylesValue; + end; + + TdxGridReportLinkProcessParams = record + HasMasterDetails: Boolean; + HasMasterDetailsInTopView: Boolean; + HasOnlyCards: Boolean; + HasUnwrapableData: Boolean; + CanUseOnEveryPageMode: Boolean; + end; + + TdxGridRecordArray = array of TcxCustomGridRecord; + + TdxGridViewProc = procedure(AGridView: TcxCustomGridView) of object; + + TdxGridGetCustomPageBreaksEvent = procedure(Sender: TdxGridReportLink) of object; + + TdxGridReportLinkGetCellHeightEvent = procedure(Sender: TdxGridReportLink; + AView: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem; var AHeight: Integer) of object; + + { CustomDraw Events } + + TdxGridReportLinkCustomDrawBandCellEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxGridBandedTableView; ABand: TcxGridBand; + AnItem: TdxReportCellString; var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawCellEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; AnItem: TAbstractdxReportCellData; var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawCardRowCaptionCellEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxGridCardView; ACard: TcxGridCard; ARow: TcxGridCardViewRow; + AnItem: TdxReportCellString; var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawCardRowDataCellEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxGridCardView; ACard: TcxGridCard; ARow: TcxGridCardViewRow; + AnItem: TAbstractdxReportCellData; var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawFilterBarEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxCustomGridTableView; AnItem: TdxReportCellString; + var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawFooterCellEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; ALevel: Integer; AnItem: TdxReportCellString; + var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawHeaderCellEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxGridTableView; AColumn: TcxGridColumn; + AnItem: TdxReportCellString; var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawLevelCaptionEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxCustomGridView; AnItem: TdxReportCellString; + var ADone: Boolean) of object; + + { Initializtion Events } + + TdxGridReportLinkInitializeBandCellEvent = procedure(Sender: TdxGridReportLink; + AView: TcxGridBandedTableView; ABand: TcxGridBand; AnItem: TdxReportCellString) of object; + + TdxGridReportLinkInitializeCellEvent = procedure(Sender: TdxGridReportLink; + AView: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; AnItem: TAbstractdxReportCellData) of object; + + TdxGridReportLinkInitializeCardRowCaptionCellEvent = procedure(Sender: TdxGridReportLink; + AView: TcxGridCardView; ACard: TcxGridCard; ARow: TcxGridCardViewRow; + AnItem: TdxReportCellString) of object; + + TdxGridReportLinkInitializeCardRowDataCellEvent = procedure(Sender: TdxGridReportLink; + AView: TcxGridCardView; ACard: TcxGridCard; ARow: TcxGridCardViewRow; + AnItem: TAbstractdxReportCellData) of object; + + TdxGridReportLinkInitializeFilterBarEvent = procedure(Sender: TdxGridReportLink; + AView: TcxCustomGridTableView; AnItem: TdxReportCellString) of object; + + TdxGridReportLinkInitializeFooterCellEvent = procedure(Sender: TdxGridReportLink; + AView: TcxGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; ALevel: Integer; AnItem: TdxReportCellString) of object; + + TdxGridReportLinkInitializeHeaderCellEvent = procedure(Sender: TdxGridReportLink; + AView: TcxGridTableView; AColumn: TcxGridColumn; AnItem: TdxReportCellString) of object; + + TdxGridReportLinkInitializeLevelCaptionEvent = procedure(Sender: TdxGridReportLink; + AView: TcxCustomGridView; AnItem: TdxReportCellString) of object; + + { ReportLink } + + TdxGridReportLink = class(TdxCustomTableControlReportLink) + private + FDelimitersHardVert: TList; + FHostInfoServices: TdxGridAttributeHostInfoServices; + FOptionsCards: TdxGridReportLinkOptionsCards; + FOptionsDetails: TdxGridReportLinkOptionsDetails; + FOptionsLevels: TdxGridReportLinkOptionsLevels; + FProcessedView: TcxCustomGridView; + FProcessParams: TdxGridReportLinkProcessParams; + FReportRows: TList; + FOnCustomDrawBandCell: TdxGridReportLinkCustomDrawBandCellEvent; + FOnCustomDrawCardRowCaptionCell: TdxGridReportLinkCustomDrawCardRowCaptionCellEvent; + FOnCustomDrawCardRowDataCell: TdxGridReportLinkCustomDrawCardRowDataCellEvent; + FOnCustomDrawCell: TdxGridReportLinkCustomDrawCellEvent; + FOnCustomDrawFilterBar: TdxGridReportLinkCustomDrawFilterBarEvent; + FOnCustomDrawFooterCell: TdxGridReportLinkCustomDrawFooterCellEvent; + FOnCustomDrawHeaderCell: TdxGridReportLinkCustomDrawHeaderCellEvent; + FOnCustomDrawLevelCaption: TdxGridReportLinkCustomDrawLevelCaptionEvent; + FOnGetCellHeight: TdxGridReportLinkGetCellHeightEvent; + FOnGetCustomPageBreaks: TdxGridGetCustomPageBreaksEvent; + FOnInitializeBandCell: TdxGridReportLinkInitializeBandCellEvent; + FOnInitializeCardRowCaptionCell: TdxGridReportLinkInitializeCardRowCaptionCellEvent; + FOnInitializeCardRowDataCell: TdxGridReportLinkInitializeCardRowDataCellEvent; + FOnInitializeCell: TdxGridReportLinkInitializeCellEvent; + FOnInitializeFilterBar: TdxGridReportLinkInitializeFilterBarEvent; + FOnInitializeFooterCell: TdxGridReportLinkInitializeFooterCellEvent; + FOnInitializeHeaderCell: TdxGridReportLinkInitializeHeaderCellEvent; + FOnInitializeLevelCaption: TdxGridReportLinkInitializeLevelCaptionEvent; + function GetActiveStyles: TdxGridReportLinkStyles; + function GetActiveView: TcxCustomGridView; + function GetActiveViewHelper: TdxCustomGridViewHelperClass; + function GetActiveViewMasterRow: TcxGridMasterDataRow; + function GetActiveViewParentLevel: TcxGridLevel; + function GetDesignWindow: TdxfmGridReportLinkDesignWindow; + function GetGrid: TcxGrid; + function GetOptionsExpanding: TdxGridReportLinkOptionsExpanding; + function GetOptionsFormatting: TdxGridReportLinkOptionsFormatting; + function GetOptionsOnEveryPage: TdxGridReportLinkOptionsOnEveryPage; + function GetOptionsPagination: TdxGridReportLinkOptionsPagination; + function GetOptionsPreview: TdxGridReportLinkOptionsPreview; + function GetOptionsRefinements: TdxGridReportLinkOptionsRefinements; + function GetOptionsSelection: TdxGridReportLinkOptionsSelection; + function GetOptionsSize: TdxGridReportLinkOptionsSize; + function GetOptionsView: TdxGridReportLinkOptionsView; + function GetReportRow(Index: Integer): TdxReportCell; + function GetReportRowByGridRecord(GridRecord: TcxCustomGridRecord): TdxReportCell; + function GetReportRowCount: Integer; + function GetStyles: TdxGridReportLinkStyles; + procedure SetOnCustomDrawBandCell(Value: TdxGridReportLinkCustomDrawBandCellEvent); + procedure SetOnCustomDrawCell(Value: TdxGridReportLinkCustomDrawCellEvent); + procedure SetOnCustomDrawCardRowCaptionCell(Value: TdxGridReportLinkCustomDrawCardRowCaptionCellEvent); + procedure SetOnCustomDrawCardRowDataCell(Value: TdxGridReportLinkCustomDrawCardRowDataCellEvent); + procedure SetOnCustomDrawFilterBar(Value: TdxGridReportLinkCustomDrawFilterBarEvent); + procedure SetOnCustomDrawFooterCell(Value: TdxGridReportLinkCustomDrawFooterCellEvent); + procedure SetOnCustomDrawHeaderCell(Value: TdxGridReportLinkCustomDrawHeaderCellEvent); + procedure SetOnCustomDrawLevelCaption(Value: TdxGridReportLinkCustomDrawLevelCaptionEvent); + procedure SetOptionsCards(Value: TdxGridReportLinkOptionsCards); + procedure SetOptionsDetails(Value: TdxGridReportLinkOptionsDetails); + procedure SetOptionsExpanding(Value: TdxGridReportLinkOptionsExpanding); + procedure SetOptionsFormatting(Value: TdxGridReportLinkOptionsFormatting); + procedure SetOptionsLevels(Value: TdxGridReportLinkOptionsLevels); + procedure SetOptionsOnEveryPage(Value: TdxGridReportLinkOptionsOnEveryPage); + procedure SetOptionsPagination(Value: TdxGridReportLinkOptionsPagination); + procedure SetOptionsPreview(Value: TdxGridReportLinkOptionsPreview); + procedure SetOptionsRefinements(Value: TdxGridReportLinkOptionsRefinements); + procedure SetOptionsSelection(Value: TdxGridReportLinkOptionsSelection); + procedure SetOptionsSize(Value: TdxGridReportLinkOptionsSize); + procedure SetOptionsView(Value: TdxGridReportLinkOptionsView); + procedure SetStyles(Value: TdxGridReportLinkStyles); + protected + procedure BeforeDesignReport; override; + procedure ConstructReport(AReportCells: TdxReportCells); override; + procedure ConvertCoords; override; + procedure CustomDraw(AItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); override; + function GetBreakPagesByHardDelimiters: Boolean; override; + function GetEmptyPagesCanExist: Boolean; override; + function GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; override; + function GetUseHardVertDelimiters: Boolean; override; + procedure InternalRestoreDefaults; override; + procedure InternalRestoreFromOriginal; override; + function IsDrawFootersOnEveryPage: Boolean; override; + function IsDrawHeadersOnEveryPage: Boolean; override; + function IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; override; + procedure MakeHardDelimiters(AReportCells: TdxReportCells; AVertDelimiters: TList); override; + + function GetAreNativeStylesAvailable: Boolean; override; + function GetStylesClass: TdxCustomReportLinkStylesClass; override; + function GetStyleSheetClass: TdxCustomReportLinkStyleSheetClass; override; + function GetStyleSheetPrototype: TdxCustomReportLinkStyleSheet; override; + procedure PrepareConstruct; override; + + procedure DoCustomDrawBandCell(ACanvas: TCanvas; AView: TcxGridBandedTableView; + ABand: TcxGridBand; AnItem: TdxReportCellString; var ADone: Boolean); dynamic; + procedure DoCustomDrawCardRowCaptionCell(ACanvas: TCanvas; AView: TcxGridCardView; + ACard: TcxGridCard; ARow: TcxGridCardViewRow; AnItem: TdxReportCellString; + var ADone: Boolean); dynamic; + procedure DoCustomDrawCardRowDataCell(ACanvas: TCanvas; AView: TcxGridCardView; + ACard: TcxGridCard; ARow: TcxGridCardViewRow; AnItem: TAbstractdxReportCellData; + var ADone: Boolean); dynamic; + procedure DoCustomDrawCell(ACanvas: TCanvas; AView: TcxCustomGridTableView; + ARecord: TcxCustomGridRecord; AColumn: TcxGridColumn; + AnItem: TAbstractdxReportCellData; var ADone: Boolean); dynamic; + procedure DoCustomDrawFilterBar(ACanvas: TCanvas; AView: TcxCustomGridTableView; + AnItem: TdxReportCellString; var ADone: Boolean); dynamic; + procedure DoCustomDrawFooterCell(ACanvas: TCanvas; AView: TcxGridTableView; + ARecord: TcxCustomGridRecord; AColumn: TcxGridColumn; ALevel: Integer; + AnItem: TdxReportCellString; var ADone: Boolean); dynamic; + procedure DoCustomDrawHeaderCell(ACanvas: TCanvas; AView: TcxGridTableView; + AColumn: TcxGridColumn; AnItem: TdxReportCellString; var ADone: Boolean); dynamic; + procedure DoCustomDrawLevelCaption(ACanvas: TCanvas; AView: TcxCustomGridView; + AnItem: TdxReportCellString; var ADone: Boolean); dynamic; + procedure DoGetCellHeight(AView: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem; var AHeight: Integer); dynamic; + procedure DoGetCustomPageBreaks; dynamic; + procedure DoInitializeBandCell(AView: TcxGridBandedTableView; ABand: TcxGridBand; + AnItem: TdxReportCellString); dynamic; + procedure DoInitializeCardRowCaptionCell(AView: TcxGridCardView; ACard: TcxGridCard; + ARow: TcxGridCardViewRow; AnItem: TdxReportCellString); dynamic; + procedure DoInitializeCardRowDataCell(AView: TcxGridCardView; ACard: TcxGridCard; + ARow: TcxGridCardViewRow; AnItem: TAbstractdxReportCellData); dynamic; + procedure DoInitializeCell(AView: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; AnItem: TAbstractdxReportCellData); dynamic; + procedure DoInitializeFilterBar(AView: TcxCustomGridTableView; AnItem: TdxReportCellString); dynamic; + procedure DoInitializeFooterCell(AView: TcxGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; ALevel: Integer; AnItem: TdxReportCellString); dynamic; + procedure DoInitializeHeaderCell(AView: TcxGridTableView; AColumn: TcxGridColumn; + AnItem: TdxReportCellString); dynamic; + procedure DoInitializeLevelCaption(AView: TcxCustomGridView; AnItem: TdxReportCellString); dynamic; + + procedure CreateOptions; override; + procedure DestroyOptions; override; + function GetOptionsCardsClass: TdxGridReportLinkOptionsCardsClass; virtual; + function GetOptionsDetailsClass: TdxGridReportLinkOptionsDetailsClass; virtual; + function GetOptionsExpandingClass: TdxCustomReportLinkOptionsExpandingClass; override; + function GetOptionsFormattingClass: TdxCustomReportLinkOptionsFormattingClass; override; + function GetOptionsLevelsClass: TdxGridReportLinkOptionsLevelsClass; virtual; + function GetOptionsOnEveryPageClass: TdxCustomTableControlReportLinkOptionsOnEveryPageClass; override; + function GetOptionsPaginationClass: TdxCustomReportLinkOptionsPaginationClass; override; + function GetOptionsPreviewClass: TdxCustomTableControlReportLinkOptionsPreviewClass; override; + function GetOptionsRefinementsClass: TdxCustomReportLinkOptionsRefinementsClass; override; + function GetOptionsSelectionClass: TdxCustomTableControlReportLinkOptionsSelectionClass; override; + function GetOptionsSizeClass: TdxCustomReportLinkOptionsSizeClass; override; + function GetOptionsViewClass: TdxCustomReportLinkOptionsViewClass; override; + + procedure AddReportRow(AReportRow: TdxReportCell); + procedure AddVerticalHardDelimiter(ADelimiter: TdxReportCell); overload; + procedure AddVerticalHardDelimiter(ADelimiter: Integer); overload; + procedure BuildTopLevelView(AGridView: TcxCustomGridView); + procedure BuildTopLevelViews; + procedure BuildView(AMasterBuilder: TdxCustomGridViewBuilder; AGridView: TcxCustomGridView); + function CreateViewAdapter(AMasterAdapter: TdxCustomGridViewAdapter; AGridView: TcxCustomGridView): TdxCustomGridViewAdapter; + function CreateViewBuilder(AMasterBuilder: TdxCustomGridViewBuilder; AGridView: TcxCustomGridView): TdxCustomGridViewBuilder; + + procedure DoExpandRows; + procedure DoExpandViewRows(AGridView: TcxCustomGridView); + procedure ForEachView(AMasterRow: TcxGridMasterDataRow; AProc: TdxGridViewProc); + + function GetItemCustomDrawInfo(AnItem: TdxReportVisualItem; out ADrawInfo: TdxGridCellCustomDrawInfo): TdxGridAttributeID; virtual; + function HasSiblings(AGridView: TcxCustomGridView): Boolean; + function IsCardViewStyle(AStyle: TcxStyle): Boolean; virtual; + function IsCustomDrawn(AnAttributeID: TdxGridAttributeID): Boolean; virtual; + function IsOffice11StyleGrouping: Boolean; + + procedure CalculateProcessParams; + function CanAttributeBeUsedOnEveryPage(AnAttribute: TdxGridAttributeClass): Boolean; + function IsAttributeUsedOnEveryPage(AnAttribute: TdxGridAttributeClass): Boolean; + + property ActiveStyles: TdxGridReportLinkStyles read GetActiveStyles; + property ActiveView: TcxCustomGridView read GetActiveView; + property ActiveViewHelper: TdxCustomGridViewHelperClass read GetActiveViewHelper; + property ActiveViewMasterRow: TcxGridMasterDataRow read GetActiveViewMasterRow; + property ActiveViewParentLevel: TcxGridLevel read GetActiveViewParentLevel; + property DelimitersHardVert: TList read FDelimitersHardVert; + property HostInfoServices: TdxGridAttributeHostInfoServices read FHostInfoServices; + property ProcessParams: TdxGridReportLinkProcessParams read FProcessParams; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + procedure AddPageBreak(AGridRecord: TcxCustomGridRecord); overload; + procedure AddPageBreak(const AGridRecords: array of TcxCustomGridRecord); overload; + procedure AddPageBreak(const AGridRecords: TdxGridRecordArray); overload; + procedure AddPageBreak(AGridRecords: TList); overload; // list of TcxCustomGridRecord + + property Grid: TcxGrid read GetGrid; + property DesignWindow: TdxfmGridReportLinkDesignWindow read GetDesignWindow; + property ReportRows[Index: Integer]: TdxReportCell read GetReportRow; + property ReportRowsByGridRecord[GridRow: TcxCustomGridRecord]: TdxReportCell read GetReportRowByGridRecord; + property ReportRowCount: Integer read GetReportRowCount; + published + property Color; + property Font; + property OptionsCards: TdxGridReportLinkOptionsCards read FOptionsCards write SetOptionsCards; + property OptionsDetails: TdxGridReportLinkOptionsDetails read FOptionsDetails write SetOptionsDetails; + property OptionsExpanding: TdxGridReportLinkOptionsExpanding read GetOptionsExpanding write SetOptionsExpanding; + property OptionsFormatting: TdxGridReportLinkOptionsFormatting read GetOptionsFormatting write SetOptionsFormatting; + property OptionsLevels: TdxGridReportLinkOptionsLevels read FOptionsLevels Write SetOptionsLevels; + property OptionsOnEveryPage: TdxGridReportLinkOptionsOnEveryPage read GetOptionsOnEveryPage write SetOptionsOnEveryPage; + property OptionsPagination: TdxGridReportLinkOptionsPagination read GetOptionsPagination write SetOptionsPagination; + property OptionsPreview: TdxGridReportLinkOptionsPreview read GetOptionsPreview write SetOptionsPreview; + property OptionsRefinements: TdxGridReportLinkOptionsRefinements read GetOptionsRefinements write SetOptionsRefinements; + property OptionsSelection: TdxGridReportLinkOptionsSelection read GetOptionsSelection write SetOptionsSelection; + property OptionsSize: TdxGridReportLinkOptionsSize read GetOptionsSize write SetOptionsSize; + property OptionsView: TdxGridReportLinkOptionsView read GetOptionsView write SetOptionsView; + property ScaleFonts; + property StyleRepository; + property Styles: TdxGridReportLinkStyles read GetStyles write SetStyles; + property SupportedCustomDraw; + + property OnCustomDrawBandCell: TdxGridReportLinkCustomDrawBandCellEvent read FOnCustomDrawBandCell + write SetOnCustomDrawBandCell; + property OnCustomDrawCell: TdxGridReportLinkCustomDrawCellEvent read FOnCustomDrawCell + write SetOnCustomDrawCell; + property OnCustomDrawCardRowCaptionCell: TdxGridReportLinkCustomDrawCardRowCaptionCellEvent read FOnCustomDrawCardRowCaptionCell + write SetOnCustomDrawCardRowCaptionCell; + property OnCustomDrawCardRowDataCell: TdxGridReportLinkCustomDrawCardRowDataCellEvent read FOnCustomDrawCardRowDataCell + write SetOnCustomDrawCardRowDataCell; + property OnCustomDrawFilterBar: TdxGridReportLinkCustomDrawFilterBarEvent read FOnCustomDrawFilterBar + write SetOnCustomDrawFilterBar; + property OnCustomDrawFooterCell: TdxGridReportLinkCustomDrawFooterCellEvent read FOnCustomDrawFooterCell + write SetOnCustomDrawFooterCell; + property OnCustomDrawHeaderCell: TdxGridReportLinkCustomDrawHeaderCellEvent read FOnCustomDrawHeaderCell + write SetOnCustomDrawHeaderCell; + property OnCustomDrawLevelCaption: TdxGridReportLinkCustomDrawLevelCaptionEvent read FOnCustomDrawLevelCaption + write SetOnCustomDrawLevelCaption; + property OnGetCellHeight: TdxGridReportLinkGetCellHeightEvent read FOnGetCellHeight write FOnGetCellHeight; + property OnGetCustomPageBreaks: TdxGridGetCustomPageBreaksEvent read FOnGetCustomPageBreaks write FOnGetCustomPageBreaks; + property OnInitializeBandCell: TdxGridReportLinkInitializeBandCellEvent read FOnInitializeBandCell + write FOnInitializeBandCell; + property OnInitializeCardRowCaptionCell: TdxGridReportLinkInitializeCardRowCaptionCellEvent read FOnInitializeCardRowCaptionCell + write FOnInitializeCardRowCaptionCell; + property OnInitializeCardRowDataCell: TdxGridReportLinkInitializeCardRowDataCellEvent read FOnInitializeCardRowDataCell + write FOnInitializeCardRowDataCell; + property OnInitializeCell: TdxGridReportLinkInitializeCellEvent read FOnInitializeCell + write FOnInitializeCell; + property OnInitializeFilterBar: TdxGridReportLinkInitializeFilterBarEvent read FOnInitializeFilterBar + write FOnInitializeFilterBar; + property OnInitializeFooterCell: TdxGridReportLinkInitializeFooterCellEvent read FOnInitializeFooterCell + write FOnInitializeFooterCell; + property OnInitializeHeaderCell: TdxGridReportLinkInitializeHeaderCellEvent read FOnInitializeHeaderCell + write FOnInitializeHeaderCell; + property OnInitializeLevelCaption: TdxGridReportLinkInitializeLevelCaptionEvent read FOnInitializeLevelCaption + write FOnInitializeLevelCaption; + end; + + TcxGridCardView2OptionsView = class(TcxGridCardViewOptionsView) + private + FCardBorders: Boolean; + FGridLineColor: TColor; + FGridLines: TcxGridLines; + FShadowDepth: Integer; + function GetShadowVisible: Boolean; + procedure SetCardBorders(Value: Boolean); + procedure SetGridLineColor(Value: TColor); + procedure SetGridLines(Value: TcxGridLines); + procedure SetShadowDepth(Value: Integer); + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + property ShadowVisible: Boolean read GetShadowVisible; + published + property CardBorders: Boolean read FCardBorders write SetCardBorders default False; + property GridLineColor: TColor read FGridLineColor write SetGridLineColor default clDefault; + property GridLines: TcxGridLines read FGridLines write SetGridLines default glNone; + property ShadowDepth: Integer read FShadowDepth write SetShadowDepth; + end; + + TcxGridCardView2Styles = class(TcxGridCardViewStyles) + private + FOnGetCardShadowStyle: TcxGridGetRecordStyleEvent; + protected + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + public + procedure Assign(Source: TPersistent); override; + procedure GetCardShadowParams(ARecord: TcxCustomGridRecord; out AParams: TcxViewParams); virtual; + published + property CardShadow: TcxStyle index vsCardShadow read GetValue write SetValue; + property OnGetCardShadowStyle: TcxGridGetRecordStyleEvent read FOnGetCardShadowStyle + write FOnGetCardShadowStyle; + end; + + TcxGridCardView2 = class(TcxGridCardView) + protected + function GetOptionsViewClass: TcxCustomGridOptionsViewClass; override; + function GetStylesClass: TcxCustomGridViewStylesClass; override; + function GetViewDataClass: TcxCustomGridViewDataClass; override; + function GetViewInfoClass: TcxCustomGridViewInfoClass; override; + end; + + TdxfmGridReportLinkDesignWindow = class(TdxfmCustomcxControlReportLinkDesignWindow) + PageControl1: TPageControl; + tshView: TTabSheet; + tshBehaviors: TTabSheet; + tshPreview: TTabSheet; + tshCards: TTabSheet; + lblShow: TLabel; + imgShow: TImage; + bvlShow: TBevel; + chbxShowBands: TCheckBox; + chbxShowHeaders: TCheckBox; + chbxShowFooters: TCheckBox; + chbxShowGroupFooters: TCheckBox; + chbxShowExpandButtons: TCheckBox; + lblOnEveryPage: TLabel; + imgOnEveryPage: TImage; + bvlOnEveryPage: TBevel; + chbxBandsOnEveryPage: TCheckBox; + chbxHeadersOnEveryPage: TCheckBox; + chbxFootersOnEveryPage: TCheckBox; + chbxFilterBarOnEveryPage: TCheckBox; + chbxCaptionsOnEveryPage: TCheckBox; + bvlWarningHost: TBevel; + lblSelection: TLabel; + imgSelection: TImage; + chbxProcessSelection: TCheckBox; + chbxProcessExactSelection: TCheckBox; + bvlSelection: TBevel; + lblExpanding: TLabel; + imgExpanding: TImage; + chbxExpandGroupRows: TCheckBox; + bvlExpanding: TBevel; + chbxExpandMasterRows: TCheckBox; + lblPreviewOptions: TLabel; + bvlPreviewOptions: TBevel; + chbxPreviewVisible: TCheckBox; + chbxPreviewAutoHeight: TCheckBox; + lblPreviewMaxLineCount: TLabel; + bvlPreviewMaxLineCountHost: TBevel; + chbxShowCaptions: TCheckBox; + chbxShowFilterBar: TCheckBox; + imgPreview: TImage; + chbxStartFromActiveView: TCheckBox; + chbxOnlyActiveView: TCheckBox; + lblDetails: TLabel; + bvlDetails: TBevel; + imgDetails: TImage; + tshFormatting: TTabSheet; + lblLookAndFeel: TLabel; + bvlLookAndFeel: TBevel; + imgLookAndFeel: TImage; + cbxLookAndFeel: TComboBox; + chbxFlatCheckMarks: TCheckBox; + chbxDisplayGraphicsAsText: TCheckBox; + chbxTransparentGraphics: TCheckBox; + imgRefinements: TImage; + lblRefinements: TLabel; + bvlRefinements: TBevel; + bvlCardSpaceVertHost: TBevel; + bvlCardSpaceHorzHost: TBevel; + lblCardSpaceVert: TLabel; + lblCardSpaceHorz: TLabel; + imgCardSpacing: TImage; + lblCardSpacing: TLabel; + bvlCardSpacing: TBevel; + bvlCardSizes: TBevel; + lblCardSizes: TLabel; + imgCardSizes: TImage; + chbxCardsKeepSameHeight: TCheckBox; + chbxCardsKeepSameWidth: TCheckBox; + chbxCardsAutoWidth: TCheckBox; + chbxCardsVertLines: TCheckBox; + chbxCardsHorzLines: TCheckBox; + chbxCardsBorder: TCheckBox; + imgCardFraming: TImage; + lblCardFraming: TLabel; + bvlCardFraming: TBevel; + bvlCardShadowColorHost: TBevel; + lblCardShadowDepth: TLabel; + bvlCardShadow: TBevel; + lblCardShadow: TLabel; + lblCardShadowColor: TLabel; + bvlCardShadowDepthHost: TBevel; + imgCardShadow: TImage; + pnlPreview: TPanel; + PreviewGrid: TcxGrid; + PreviewBandedView: TcxGridBandedTableView; + colVendorName: TcxGridBandedColumn; + colVendorLogo: TcxGridBandedColumn; + colVendorCountry: TcxGridBandedColumn; + colCarModel: TcxGridBandedColumn; + colIsSUVModel: TcxGridBandedColumn; + PreviewGridLevel: TcxGridLevel; + chbxLevelsUnwrap: TCheckBox; + imgLevels: TImage; + lblLevels: TLabel; + bvlLevels: TBevel; + chbxLevelsUnwrapTopLevel: TCheckBox; + chbxLevelsRiseActiveLevelOntoTop: TCheckBox; + chbxSuppressBackgroundBitmaps: TCheckBox; + tshStyles: TTabSheet; + btnStyleColor: TButton; + btnStyleFont: TButton; + btnStyleBackgroundBitmap: TButton; + chbxUseNativeStyles: TCheckBox; + bvlStyles: TBevel; + pmStyles: TPopupMenu; + miStyleFont: TMenuItem; + miStyleBackgroundBitmap: TMenuItem; + miStyleColor: TMenuItem; + bvlStyleSheets: TBevel; + lblStyleSheets: TLabel; + cbxStyleSheets: TComboBox; + btnStyleSheetNew: TButton; + btnStyleSheetCopy: TButton; + btnStyleSheetDelete: TButton; + milLine: TMenuItem; + miStylesSaveAs: TMenuItem; + btnStylesSaveAs: TButton; + btnStyleSheetRename: TButton; + miStyleBackgroundBitmapClear: TMenuItem; + btnStyleBackgroundBitmapClear: TButton; + btnStyleRestoreDefaults: TButton; + miStyleRestoreDefaults: TMenuItem; + miLine2: TMenuItem; + miLine3: TMenuItem; + bvlStylesHost: TBevel; + ilStylesPopup: TImageList; + miStylesSelectAll: TMenuItem; + miLine4: TMenuItem; + lblGridSize: TLabel; + bvlGridSize: TBevel; + imgGridSize: TImage; + chbxGridAutoWidth: TCheckBox; + chbxConsumeSelectionStyle: TCheckBox; + bvlRefinementsSeparator: TBevel; + lblPagination: TLabel; + bvlPagination: TBevel; + imgPagination: TImage; + chbxPaginateOneGroupPerPage: TCheckBox; + chbxPaginateByTopLevelGroups: TCheckBox; + lblPreviewWindow: TStaticText; + cxStyleRepository1: TcxStyleRepository; + styleCardShadow: TcxStyle; + styleCardBorder: TcxStyle; + Label1: TLabel; + chbxExpandCards: TCheckBox; + lblUseNativeStyles: TLabel; + procedure OptionsViewClick(Sender: TObject); + procedure OptionsOnEveryPageClick(Sender: TObject); + procedure OptionsSelectionClick(Sender: TObject); + procedure OptionsExpandingClick(Sender: TObject); + procedure OptionsRefinementClick(Sender: TObject); + procedure LookAndFeelClick(Sender: TObject); + procedure PreviewVisibleClick(Sender: TObject); + procedure PreviewAutoHeightClick(Sender: TObject); + procedure OptionsCardsClick(Sender: TObject); + procedure IsSUVModelCustomDrawCell(Sender: TcxCustomGridTableView; + ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; + var ADone: Boolean); + procedure VendorLogoCustomDrawCell(Sender: TcxCustomGridTableView; + ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; + var ADone: Boolean); + procedure PreviewBandedViewCustomDrawColumnHeader( + Sender: TcxGridTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean); + procedure PreviewBandedViewCustomDrawBandHeader( + Sender: TcxGridBandedTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridBandHeaderViewInfo; var ADone: Boolean); + procedure PreviewBandedViewCustomDrawFooterCell( + Sender: TcxGridTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean); + procedure OptionsDetailsClick(Sender: TObject); + procedure OptionsSizeClick(Sender: TObject); + procedure OptionsLevelsClick(Sender: TObject); + procedure OptionsFormatingClick(Sender: TObject); + procedure StyleColorClick(Sender: TObject); + procedure StyleFontClick(Sender: TObject); + procedure StyleBackgroundBitmapClick(Sender: TObject); + procedure lbxStylesClick(Sender: TObject); + procedure pmStylesPopup(Sender: TObject); + procedure cbxStyleSheetsClick(Sender: TObject); + procedure StyleSheetNewClick(Sender: TObject); + procedure StyleSheetCopyClick(Sender: TObject); + procedure StyleSheetDeleteClick(Sender: TObject); + procedure StylesSaveAsClick(Sender: TObject); + procedure cbxStyleSheetsKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure StyleSheetRenameClick(Sender: TObject); + procedure PageControl1Change(Sender: TObject); + procedure StyleBackgroundBitmapClearClick(Sender: TObject); + procedure StyleRestoreDefaultsClick(Sender: TObject); + procedure miStylesSelectAllClick(Sender: TObject); + procedure OptionsPaginationClick(Sender: TObject); + procedure cbxStyleSheetsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure lblUseNativeStylesClick(Sender: TObject); + private + ccbxCardsShadowColor: TdxPSColorCombo; + lbxStyles: TdxStylesListBox; + PreviewCardView: TcxGridCardView2; + rowVendorName: TcxGridCardViewRow; + rowVendorLogo: TcxGridCardViewRow; + rowVendorCountry: TcxGridCardViewRow; + rowCarModel: TcxGridCardViewRow; + rowIsSuvModel: TcxGridCardViewRow; + seCardsShadowDepth: TdxPSSpinEdit; + seCardsSpaceHorz: TdxPSSpinEdit; + seCardsSpaceVert: TdxPSSpinEdit; + sePreviewMaxLineCount: TdxPSSpinEdit; + wpIncorrectOnEveryPageState: TdxPSWarningPane; + + function GetActiveStyle: TcxStyle; + function GetHasSelectedStyles: Boolean; + function GetHasSelectedStylesWithAssignedBitmap: Boolean; + function GetReportLink: TdxGridReportLink; + + procedure CardShadowDepthChanged(Sender: TObject); + procedure CardShadowColorChanged(Sender: TObject); + procedure CardSpaceHorzChanged(Sender: TObject); + procedure CardSpaceVertChanged(Sender: TObject); + procedure PreviewMaxLineCountChanged(Sender: TObject); + + function CanSelectAllStyles: Boolean; + procedure ChangeActiveView(AView: TcxCustomGridView); + procedure CreateCardView; + procedure CreateControls; + procedure CustomDrawBorders(ACanvas: TcxCanvas; AViewInfo: TcxCustomGridCellViewInfo); + procedure CustomDrawFooter(ACanvas: TcxCanvas; R: TRect; AViewInfo: TcxCustomGridCellViewInfo); + procedure CustomDrawHeader(ACanvas: TcxCanvas; R: TRect; AViewInfo: TcxCustomGridCellViewInfo); + procedure CustomDrawTextRect(ACanvas: TcxCanvas; R: TRect; AViewInfo: TcxCustomGridCellViewInfo; + ABackgroundBitmap: TBitmap); + procedure InitializePreviewGrid; + procedure InitializePreviewGridStyles; + procedure LoadDataIntoPreviewGridView(AView: TcxCustomGridTableView); + procedure RecreateStylesListBox; + procedure RestoreSelectedStyles(AList: TList); + procedure SaveSelectedStyles(AList: TList); + procedure SetActivePage; + procedure UpdatePreviewGridStyles(const ACaption: string; AStyle: TcxStyle); + procedure UpdateWarningPane; + + procedure SetOptionsCardsByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsDetailsByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsExpandingByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsFormattingByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsLevelsByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsOnEveryPageByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsPaginationByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsRefinementsByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsSelectionByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsSizeByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsViewByIndex(Index: Integer; Value: Boolean); + protected + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + procedure LoadStrings; override; + procedure UpdateControlsState; override; + procedure UpdatePreview; override; + + function GetDesignerTabIndex: Integer; override; + procedure SetDesignerTabIndex(Value: Integer); override; + + procedure DoActiveStyleSheetChanged; override; + procedure DoFormActivated(AnActive: Boolean); override; + procedure DoRefreshStylesList; override; + procedure DoStyleChanged(const ACaption: string; AStyle: TcxStyle); override; + procedure DoStylesChanged(AStrings: TStrings; ARecreate: Boolean); override; + + procedure GetSelectedStyleNames(AStrings: TStrings); override; + procedure GetStyleNames(out AStrings: TStrings); override; + procedure GetStyleSheetNames(out AStrings: TStrings); override; + + property ActiveStyle: TcxStyle read GetActiveStyle; + property HasSelectedStyles: Boolean read GetHasSelectedStyles; + property HasSelectedStylesWithAssignedBitmap: Boolean read GetHasSelectedStylesWithAssignedBitmap; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property ReportLink: TdxGridReportLink read GetReportLink; + end; + +implementation + +{$R *.DFM} + +{658 x 466 - DesignWindow} + +{.2 - IsOffice11StyleGrouping} +{.3 - chbxTransparentRichEdits} + +uses + Registry, Forms, cxVariants, cxGridStrs, cxDataUtils, dxThemeManager, + dxPSGlbl, dxPSTextOut, dxPSUtl, dxBkgnd, + dxPSPopupMan, dxPSRes, dxPSImgs; + +const + SortOrderMap: array[TcxGridSortOrder] of TdxCellSortOrder = (csoNone, csoUp, csoDown); + + ExpandButtonInteriorColor = clBtnFace; + DefaultFilterBarColor = clBtnShadow; + DefaultFilterBarTextColor = clWindow; + DefaultIndentWidth = 20; + DefaultDataRowLineHeight = 19; + DefaultGroupFooterLineHeight = 20; + DefaultGroupRowLineHeight = 20; + DefaultFooterLineHeight = 20; + FilterBarTextOffset = 3; + FirstCardOffset = 2; + FooterItemInflateHorz = 2; + FooterItemInflateVert = 3; + TabsAreaOffset = 2; + +var + FGridLinkStyleSheetPrototype: TdxGridReportLinkStyleSheet; + +type + TdxPSGridDataCellPos = TcxGridDataCellPos; + + TdxGridViewBuildersFactory = class(TdxCustomClassMaps) + private + function GetBuilderClass(GridView: TcxCustomGridView): TdxGridViewBuilderClass; + public + class function Instance: TdxGridViewBuildersFactory; reintroduce; overload; + function CreateViewAdapter(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView): TdxCustomGridViewAdapter; + function CreateViewBuilder(AReportLink: TdxGridReportLink; AMasterBuilder: TdxCustomGridViewBuilder; + AGridView: TcxCustomGridView): TdxCustomGridViewBuilder; + property BuilderClasses[GridView: TcxCustomGridView]: TdxGridViewBuilderClass read GetBuilderClass; default; + end; + + TdxViewHelpersFactory = class(TdxCustomClassMaps) + private + function GetHelperClass(GridView: TcxCustomGridView): TdxCustomGridViewHelperClass; + public + class function Instance: TdxViewHelpersFactory; reintroduce; overload; + function HelperClassByItem(AnItem: TdxReportVisualItem): TdxCustomGridViewHelperClass; + property HelperClasses[GridView: TcxCustomGridView]: TdxCustomGridViewHelperClass read GetHelperClass; default; + end; + + TdxRecordHelpersFactory = class(TdxCustomClassMaps) + private + function GetHelperClass(GridRecord: TcxCustomGridRecord): TdxCustomGridRecordHelperClass; + public + class function Instance: TdxRecordHelpersFactory; reintroduce; overload; + property HelperClasses[GridRecord: TcxCustomGridRecord]: TdxCustomGridRecordHelperClass read GetHelperClass; default; + end; + + TcxCustomGridCellPainterAccess = class(TcxCustomGridCellPainter); + TcxCustomGridCellViewInfoAccess = class(TcxCustomGridCellViewInfo); + TcxCustomGridRecordAccess = class(TcxCustomGridRecord); + TcxCustomGridTableControllerAccess = class(TcxCustomGridTableController); + TcxCustomGridTableOptionsViewAccess = class(TcxCustomGridTableOptionsView); + TcxCustomGridViewAccess = class(TcxCustomGridView); + TcxGridColumnAccess = class(TcxGridColumn); + TcxGridMasterDataRowAccess = class(TcxGridMasterDataRow); + TcxGridTableViewInfoAccess = class(TcxGridTableViewInfo); + +{ Helpers } + +{ CustomGridCellPainter Helpers } + +procedure CustomGridCellPainter_DrawBorders(AInstance: TcxCustomGridCellPainter); +begin + TcxCustomGridCellPainterAccess(AInstance).DrawBorders; +end; + +{ CustomGridCellViewInfo Helpers } + +function CustomGridCellViewInfo_GetPainterClass(AInstance: TcxCustomGridCellViewInfo): TcxCustomGridCellPainterClass; +begin + Result := TcxCustomGridCellViewInfoAccess(AInstance).GetPainterClass; +end; + +{ CustomGridRecord Helpers } + +function CustomGridRecord_GetIsParent(AInstance: TcxCustomGridRecord): Boolean; +begin + Result := TcxCustomGridRecordAccess(AInstance).IsParent; +end; + +{ CustomGridTableController Helpers } + +function CustomGridTableController_GetMultiSelect(AInstance: TcxCustomGridTableController): Boolean; +begin + Result := TcxCustomGridTableControllerAccess(AInstance).MultiSelect; +end; + +{ CustomGridTableFiltering Helpers } + +{ CustomGridTableOptionsView Helpers } + +function CustomGridTableOptionsView_GetCellAutoHeight(AInstance: TcxCustomGridTableOptionsView): Boolean; +begin + Result := TcxCustomGridTableOptionsViewAccess(AInstance).CellAutoHeight; +end; + +{ CustomGridView Helpers } + +function CustomGridView_GetBackgroundBitmaps(AInstance: TcxCustomGridView): TcxCustomGridBackgroundBitmaps; +begin + Result := TcxCustomGridViewAccess(AInstance).BackgroundBitmaps; +end; + +function CustomGridView_GetDataController(AInstance: TcxCustomGridView): TcxCustomDataController; +begin + Result := TcxCustomGridViewAccess(AInstance).DataController; +end; + +function CustomGridView_GetStyles(AInstance: TcxCustomGridView): TcxCustomGridStyles; +begin + Result := TcxCustomGridViewAccess(AInstance).Styles; +end; + +{ GridColumn Helpers } + +function GridColumn_GetFixed(AInstance: TcxGridColumn): Boolean; +begin + Result := TcxGridColumnAccess(AInstance).Fixed; +end; + +{ GridMasterDataRow Helpers } + +procedure GridMasterDataRow_DoExpand(AInstance: TcxGridMasterDataRow; ARecurse: Boolean); +begin + TcxGridMasterDataRowAccess(AInstance).DoExpand(ARecurse); +end; + +{ GridTableViewInfo Helpers } + +procedure GridTableViewInfo_CalculateExpandButtonParams(AInstance: TcxGridTableViewInfo); +begin + TcxGridTableViewInfoAccess(AInstance).CalculateExpandButtonParams; +end; + +{ Utilities } + +function GridLinkStyleSheetPrototype: TdxGridReportLinkStyleSheet; + + function CreateStyle(AColor, AFontColor: TColor): TcxStyle; + begin + Result := TcxStyle.Create(FGridLinkStyleSheetPrototype); + with Result do + begin + Color := AColor; + Font.Name := dxPSCore.dxPSDefaultFontName; + Font.Color := AFontColor; + end; + end; + +begin + if FGridLinkStyleSheetPrototype = nil then + begin + FGridLinkStyleSheetPrototype := TdxGridReportLinkStyleSheet.Create(nil); + with FGridLinkStyleSheetPrototype.Styles as TdxGridReportLinkStyles do + begin + BandHeader := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Caption := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + CardCaptionRow := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + CardRowCaption := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Content := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + ContentEven := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + ContentOdd := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + FilterBar := CreateStyle(clBtnShadow, dxPSCore.dxDefaultContentColor); + Footer := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Group := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Header := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Preview := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + Selection := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + end; + end; + Result := FGridLinkStyleSheetPrototype; +end; + +function CreatePSDataCellPos: TdxPSGridDataCellPos; +begin + Result := TdxPSGridDataCellPos.Create; +end; + +procedure FreePSDataCellPos(out ADataCellPos: TdxPSGridDataCellPos); +begin + FreeAndNil(ADataCellPos); +end; + +function IsValidPointer(const AData: Integer): Boolean; +begin + //Result := (HInstance = 0) or (FindHInstance(AData) = HInstance); //TODO: IsValidPointer( + Result := DWORD(AData) > SysInit.HInstance; +end; + +procedure _LoadAllRecords(ADBDataModeController: TcxDBDataModeController; + out APrevAllRecordsAreLoaded: Boolean); +begin + APrevAllRecordsAreLoaded := not ADBDataModeController.GridMode; + if not APrevAllRecordsAreLoaded then + ADBDataModeController.GridMode := False; +end; + +procedure _UnloadAllRecords(ADBDataModeController: TcxDBDataModeController; + const APrevAllRecordsAreLoaded: Boolean); +begin + if not APrevAllRecordsAreLoaded then + ADBDataModeController.GridMode := True; +end; + +{ TdxGridViewBuildersFactory } + +function dxGridViewBuildersFactory: TdxGridViewBuildersFactory; +begin + Result := TdxGridViewBuildersFactory.Instance; +end; + +class function TdxGridViewBuildersFactory.Instance: TdxGridViewBuildersFactory; +begin + Result := inherited Instance as TdxGridViewBuildersFactory; +end; + +function TdxGridViewBuildersFactory.CreateViewAdapter(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView): TdxCustomGridViewAdapter; +begin + Result := BuilderClasses[AGridView].CreateAdapter(AMasterAdapter, AGridView); +end; + +function TdxGridViewBuildersFactory.CreateViewBuilder(AReportLink: TdxGridReportLink; + AMasterBuilder: TdxCustomGridViewBuilder; AGridView: TcxCustomGridView): TdxCustomGridViewBuilder; +begin + Result := BuilderClasses[AGridView].Create(AReportLink, AMasterBuilder, AGridView); +end; + +function TdxGridViewBuildersFactory.GetBuilderClass(GridView: TcxCustomGridView): TdxGridViewBuilderClass; +begin + Result := TdxGridViewBuilderClass(PairClasses[GridView.ClassType]); +end; + +{ TdxViewHelpersFactory } + +function dxViewHelpersFactory: TdxViewHelpersFactory; +begin + Result := TdxViewHelpersFactory.Instance; +end; + +class function TdxViewHelpersFactory.Instance: TdxViewHelpersFactory; +begin + Result := inherited Instance as TdxViewHelpersFactory; +end; + +function TdxViewHelpersFactory.HelperClassByItem(AnItem: TdxReportVisualItem): TdxCustomGridViewHelperClass; +begin + Result := HelperClasses[TcxCustomGridView(AnItem.TopLevelParent.Data)]; +end; + +function TdxViewHelpersFactory.GetHelperClass(GridView: TcxCustomGridView): TdxCustomGridViewHelperClass; +begin + if GridView = nil then + Result := nil + else + Result := TdxCustomGridViewHelperClass(PairClasses[GridView.ClassType]); +end; + +{ TdxRecordHelpersFactory } + +function dxRecordHelpersFactory: TdxRecordHelpersFactory; +begin + Result := TdxRecordHelpersFactory.Instance; +end; + +class function TdxRecordHelpersFactory.Instance: TdxRecordHelpersFactory; +begin + Result := inherited Instance as TdxRecordHelpersFactory; +end; + +function TdxRecordHelpersFactory.GetHelperClass(GridRecord: TcxCustomGridRecord): TdxCustomGridRecordHelperClass; +begin + Result := TdxCustomGridRecordHelperClass(PairClasses[GridRecord.ClassType]); +end; + +{ TdxCustomGridViewHelper } + +constructor TdxCustomGridViewHelper.Create(AView: TcxCustomGridView); +begin + inherited Create; + FView := AView; +end; + +class function TdxCustomGridViewHelper.PairClass: TClass; +begin + Result := ViewClass; +end; + +class procedure TdxCustomGridViewHelper.Register; +begin + dxViewHelpersFactory.Register(Self); +end; + +class procedure TdxCustomGridViewHelper.Unregister; +begin + dxViewHelpersFactory.Unregister(Self); +end; + +class function TdxCustomGridViewHelper.ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; +begin + Result := dxGridUndefinedID; + if TClass(AnItem.Data) = TdxGridLevelCaption then + Result := dxGridLevelCaptionID; +end; + +class procedure TdxCustomGridViewHelper.ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); +begin + FillChar(ACustomDrawInfo, SizeOf(ACustomDrawInfo), 0); + with ACustomDrawInfo do + begin + GridAttributeID := ExtractCustomDrawID(AnItem); + GridView := ExtractGridView(AnItem); + end; +end; + +class function TdxCustomGridViewHelper.ExtractGridView(AnItem: TdxReportVisualItem): TcxCustomGridView; +begin + Result := TcxCustomGridView(AnItem.TopLevelParent.Data); +end; + +class function TdxCustomGridViewHelper.IsAttributeSupported(AnAttribute: TdxGridAttributeClass): Boolean; +var + Attributes: TdxGridAttributeClasses; + I: Integer; +begin + Attributes := SupportedAttributes; + + Result := True; + for I := Low(Attributes) to High(Attributes) do + if Attributes[I] = AnAttribute then Exit; + Result := False; +end; + +class function TdxCustomGridViewHelper.SupportedAttributes: TdxGridAttributeClasses; +begin + SetLength(Result, 0); + AddAttribute(Result, TdxGridLevelCaption); +end; + +class procedure TdxCustomGridViewHelper.AddAttribute(var AnAtributes: TdxGridAttributeClasses; + AnAttribute: TdxGridAttributeClass); +begin + SetLength(AnAtributes, Length(AnAtributes) + 1); + AnAtributes[Length(AnAtributes) - 1] := AnAttribute; +end; + +class function TdxCustomGridViewHelper.IsFilterBarAtBottom(AView: TcxCustomGridView): Boolean; +begin + Result := True; +end; + +class function TdxCustomGridViewHelper.IsFilterBarAtTop(AView: TcxCustomGridView): Boolean; +begin + Result := False; +end; + +class function TdxCustomGridViewHelper.IsOffice11StyleGrouping(AView: TcxCustomGridView): Boolean; +begin + Result := False; +end; + +class function TdxCustomGridViewHelper.ViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridView; +end; + +{ TdxNullGridViewHelper } + +class function TdxNullGridViewHelper.IsAttributeSupported(AnAttribute: TdxGridAttributeClass): Boolean; +begin + Result := True; +end; + +class function TdxNullGridViewHelper.ViewClass: TcxCustomGridViewClass; +begin + Result := nil; +end; + +{ TdxCustomGridTableViewHelper } + +class function TdxCustomGridTableViewHelper.ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; +begin + Result := inherited ExtractCustomDrawID(AnItem); + if Result = dxGridUndefinedID then + if TClass(AnItem.Data) = TdxGridFilterBar then + Result := dxGridFilterBarID; +end; + +class function TdxCustomGridTableViewHelper.SupportedAttributes: TdxGridAttributeClasses; +begin + Result := inherited SupportedAttributes; + AddAttribute(Result, TdxGridFilterBar); +end; + +class function TdxCustomGridTableViewHelper.ExtractRecord(AnItem: TdxReportVisualItem): TcxCustomGridRecord; +begin + Result := nil; +end; + +class function TdxCustomGridTableViewHelper.ViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridTableView; +end; + +{ TdxGridCardViewHelper } + +class function TdxGridCardViewHelper.ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; +begin + Result := inherited ExtractCustomDrawID(AnItem); + if Result = dxGridUndefinedID then + if (AnItem.Parent <> nil) and (AnItem.Parent is TdxReportCardRow) then + if TClass(AnItem.Data) = TdxGridCardRowCaption then + Result := dxGridCardRowCaptionID + else + Result := dxGridCardRowDataID; +end; + +class procedure TdxGridCardViewHelper.ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); +begin + with ACustomDrawInfo do + try + inherited; + if GridAttributeID in [dxGridCardRowCaptionID, dxGridCardRowDataID] then + begin + GridCard := ExtractCard(AnItem); + GridCardRow := ExtractCardRow(AnItem); + end; + except + FillChar(ACustomDrawInfo, SizeOf(ACustomDrawInfo), 0); + GridAttributeID := dxGridUndefinedID; + end; +end; + +class function TdxGridCardViewHelper.ExtractCard(AnItem: TdxReportVisualItem): TcxGridCard; +begin + Result := ExtractRecord(AnItem) as TcxGridCard; +end; + +class function TdxGridCardViewHelper.ExtractCardRow(AnItem: TdxReportVisualItem): TcxGridCardViewRow; +begin + Result := TdxReportCardRow(AnItem.Parent).GridCardRow; +end; + +class function TdxGridCardViewHelper.ExtractRecord(AnItem: TdxReportVisualItem): TcxCustomGridRecord; +begin + Result := TdxReportCard(AnItem.Parent.Parent).GridCard; +end; + +class function TdxGridCardViewHelper.ViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridCardView; +end; + +{ TdxGridTableViewHelper } + +class function TdxGridTableViewHelper.ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; +begin + Result := inherited ExtractCustomDrawID(AnItem); + if Result = dxGridUndefinedID then + if AnItem.Parent <> nil then + if TClass(AnItem.Parent.Data) = TdxGridHeader then + Result := dxGridHeaderID + else + if TClass(AnItem.Parent.Data) = TdxGridFooter then + Result := dxGridFooterID + else + if IsDelphiObject(AnItem.Parent.Data) and (TObject(AnItem.Parent.Data) is TcxCustomGridRecord) then + if (AnItem.Parent.Parent <> nil) and (AnItem.Parent.Parent.Data >= 0) and + (AnItem.Parent.Parent.Data < High(Byte)) then + Result := dxGridGroupFooterID + else + Result := dxGridRecordID; +end; + +class procedure TdxGridTableViewHelper.ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); +begin + with ACustomDrawInfo do + try + inherited; + + if GridAttributeID in [dxGridFooterID, dxGridGroupFooterID, dxGridHeaderID, dxGridRecordID] then + begin + GridColumn := ExtractColumn(AnItem); + if GridAttributeID in [dxGridRecordID, dxGridGroupFooterID] then + begin + GridRecord := ExtractRecord(AnItem); + if GridAttributeID = dxGridGroupFooterID then + GroupLevel := ExtractGroupLevel(AnItem); + end + else + GroupLevel := -1; + end; + except + FillChar(ACustomDrawInfo, SizeOf(ACustomDrawInfo), 0); + GridAttributeID := dxGridUndefinedID; + end; +end; + +class function TdxGridTableViewHelper.SupportedAttributes: TdxGridAttributeClasses; +begin + Result := inherited SupportedAttributes; + AddAttribute(Result, TdxGridDetails); + AddAttribute(Result, TdxGridExpandButton); + AddAttribute(Result, TdxGridFooter); + AddAttribute(Result, TdxGridGroupFooter); + AddAttribute(Result, TdxGridGroupRow); + AddAttribute(Result, TdxGridHeader); + AddAttribute(Result, TdxGridPreview); +end; + +class function TdxGridTableViewHelper.ExtractColumn(AnItem: TdxReportVisualItem): TcxGridColumn; +begin + Result := TcxGridColumn(AnItem.Data); +end; + +class function TdxGridTableViewHelper.ExtractGroupLevel(AnItem: TdxReportVisualItem): Integer; +begin + Result := AnItem.Parent.Parent.Data; +end; + +class function TdxGridTableViewHelper.ExtractRecord(AnItem: TdxReportVisualItem): TcxCustomGridRecord; +begin + Result := TcxCustomGridRecord(AnItem.Parent.Data); +end; + +class function TdxGridTableViewHelper.ViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridTableView; +end; + +class function TdxGridTableViewHelper.IsOffice11StyleGrouping(AView: TcxCustomGridView): Boolean; +begin + Result := False; +end; + +{ TdxGridBandedTableViewHelper } + +class function TdxGridBandedTableViewHelper.ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; +begin + Result := inherited ExtractCustomDrawID(AnItem); + if Result = dxGridUndefinedID then + if IsDelphiObject(AnItem.Data) and (TObject(AnItem.Data) is TcxGridBand) then + Result := dxGridBandID; +end; + +class procedure TdxGridBandedTableViewHelper.ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); +begin + with ACustomDrawInfo do + try + inherited; + if GridAttributeID = dxGridBandID then + GridBand := ExtractBand(AnItem); + except + FillChar(ACustomDrawInfo, SizeOf(ACustomDrawInfo), 0); + GridAttributeID := dxGridUndefinedID; + end; +end; + +class function TdxGridBandedTableViewHelper.SupportedAttributes: TdxGridAttributeClasses; +begin + Result := inherited SupportedAttributes; + AddAttribute(Result, TdxGridBandHeader); +end; + +class function TdxGridBandedTableViewHelper.ExtractBand(AnItem: TdxReportVisualItem): TcxGridBand; +begin + Result := TcxGridBand(AnItem.Data); +end; + +class function TdxGridBandedTableViewHelper.ViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridBandedTableView; +end; + +{ TdxCustomGridRecordHelper } + +constructor TdxCustomGridRecordHelper.Create(AAdapter: TdxCustomGridTableViewAdapter); +begin + inherited Create; + FAdapter := AAdapter; +end; + +class function TdxCustomGridRecordHelper.PairClass: TClass; +begin + Result := RecordClass; +end; + +class procedure TdxCustomGridRecordHelper.Register; +begin + dxRecordHelpersFactory.Register(Self); +end; + +class procedure TdxCustomGridRecordHelper.Unregister; +begin + dxRecordHelpersFactory.Unregister(Self); +end; + +function TdxCustomGridRecordHelper.Adapter: TdxCustomGridTableViewAdapter; +begin + Result := FAdapter; +end; + +class function TdxCustomGridRecordHelper.ProducerClass: TdxGridTableViewCustomDataRowProducerClass; +begin + Result := TdxGridTableViewCustomDataRowProducer; +end; + +class function TdxCustomGridRecordHelper.RecordClass: TcxCustomGridRecordClass; +begin + Result := TcxCustomGridRecord; +end; + +function TdxCustomGridRecordHelper.GetHasDetails: Boolean; +begin + Result := False; +end; + +function TdxCustomGridRecordHelper.GetHasSelectedChildren: Boolean; +begin + Result := False; +end; + +function TdxCustomGridRecordHelper.GetParent: TcxCustomGridRecord; +var + I: Integer; +begin + for I := GridRecord.Index - 1 downto 0 do + begin + Result := Adapter.Records[I]; + if CustomGridRecord_GetIsParent(Result) and (Result.Level < GridRecord.Level) then + Exit; + end; + Result := nil; +end; + +{ TdxCustomGridRowHelper } + +function TdxCustomGridRowHelper.Adapter: TdxGridTableViewAdapter; +begin + Result := inherited Adapter as TdxGridTableViewAdapter; +end; + +class function TdxCustomGridRowHelper.RecordClass: TcxCustomGridRecordClass; +begin + Result := TcxCustomGridRow; +end; + +{ TdxGridDataRowHelper } + +class function TdxGridDataRowHelper.ProducerClass: TdxGridTableViewCustomDataRowProducerClass; +begin + Result := TdxGridTableViewDataRowProducer; +end; + +class function TdxGridDataRowHelper.RecordClass: TcxCustomGridRecordClass; +begin + Result := TcxGridDataRow; +end; + +function TdxGridDataRowHelper.GetRow: TcxGridDataRow; +begin + Result := inherited GridRecord as TcxGridDataRow; +end; + +{ TdxGridGroupRowHelper } + +class function TdxGridGroupRowHelper.ProducerClass: TdxGridTableViewCustomDataRowProducerClass; +begin + Result := TdxGridTableViewGroupRowProducer; +end; + +class function TdxGridGroupRowHelper.RecordClass: TcxCustomGridRecordClass; +begin + Result := TcxGridGroupRow; +end; + +function TdxGridGroupRowHelper.GetHasSelectedChildren: Boolean; +var + GroupLevel, I: Integer; + Row: TcxCustomGridRow; +begin + GroupLevel := GroupRow.Level; + for I := GroupRow.Index + 1 to Adapter.RowCount - 1 do + begin + Row := Adapter.Rows[I]; + if Row.Level <= GroupLevel then Break; + Result := Row.Selected or Adapter.RecordHelpers[Row].HasSelectedChildren; //!!! + if Result then Exit; + end; + Result := False; +end; + +function TdxGridGroupRowHelper.GetGroupRow: TcxGridGroupRow; +begin + Result := inherited GridRecord as TcxGridGroupRow; +end; + +{ TdxGridMasterDataRowHelper } + +class function TdxGridMasterDataRowHelper.ProducerClass: TdxGridTableViewCustomDataRowProducerClass; +begin + Result := TdxGridTableViewMasterRowProducer; +end; + +class function TdxGridMasterDataRowHelper.RecordClass: TcxCustomGridRecordClass; +begin + Result := TcxGridMasterDataRow; +end; + +function TdxGridMasterDataRowHelper.GetHasDetails: Boolean; +begin + Result := MasterRow.Expanded;// and MasterRow.ActiveDetailGridViewExists //!!! +end; + +function TdxGridMasterDataRowHelper.GetHasSelectedChildren: Boolean; +begin + Result := MasterRow.Expanded; + if Result then + with dxGridViewBuildersFactory.CreateViewAdapter(Adapter, DetailView) do + try + Result := HasSelectedRecords; + finally + Free; + end; +end; + +function TdxGridMasterDataRowHelper.GetDetailView: TcxCustomGridView; +begin + if HasDetails then + Result := MasterRow.ActiveDetailGridView + else + Result := nil; +end; + +function TdxGridMasterDataRowHelper.GetMasterRow: TcxGridMasterDataRow; +begin + Result := inherited GridRecord as TcxGridMasterDataRow; +end; + +{ TdxRecordHelpersCache } + +constructor TdxRecordHelpersCache.Create(AAdapter: TdxCustomGridTableViewAdapter); +begin + inherited Create; + FAdapter := AAdapter; +end; + +function TdxRecordHelpersCache.IndexOf(ARecord: TcxCustomGridRecord): Integer; +begin + for Result := 0 to Count - 1 do + if Items[Result].RecordClass = ARecord.ClassType then + Exit; + + Result := Add(dxRecordHelpersFactory.HelperClasses[ARecord].Create(Adapter)); +end; + +function TdxRecordHelpersCache.GetHelper(ARecord: TcxCustomGridRecord): TdxCustomGridRecordHelper; +begin + Result := Items[IndexOf(ARecord)]; + Result.GridRecord := ARecord; +end; + +function TdxRecordHelpersCache.GetItem(Index: Integer): TdxCustomGridRecordHelper; +begin + Result := TdxCustomGridRecordHelper(inherited Items[Index]); +end; + +{ TdxProducerCache } + +constructor TdxProducerCache.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited Create; + FBuilder := ABuilder; +end; + +function TdxProducerCache.IndexOf(AProducerClass: TdxGridViewRowProducerClass): Integer; +begin + for Result := 0 to Count - 1 do + if Items[Result].ClassType = AProducerClass then Exit; + + Result := Add(AProducerClass.Create(Builder)); +end; + +function TdxProducerCache.GetProducer(ProducerClass: TdxGridViewRowProducerClass): TdxGridViewRowProducer; +begin + Result := Items[IndexOf(ProducerClass)]; +end; + +function TdxProducerCache.GetItem(Index: Integer): TdxGridViewRowProducer; +begin + Result := inherited Items[Index] as TdxGridViewRowProducer; +end; + +{ TdxCustomGridViewAdapter } + +constructor TdxCustomGridViewAdapter.Create(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView); +begin + inherited Create; + FMasterAdapter := AMasterAdapter; + FGridView := AGridView; + FGridView.SizeChanged(True, True); //!? +end; + +function TdxCustomGridViewAdapter.GridView: TcxCustomGridView; +begin + Result := FGridView; +end; + +class function TdxCustomGridViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridView; +end; + +function TdxCustomGridViewAdapter.Styles: TcxCustomGridStyles; +begin + Result := CustomGridView_GetStyles(GridView); +end; + +procedure TdxCustomGridViewAdapter.ExpandAllRows(AnOptionsExpanding: TdxGridReportLinkOptionsExpanding; + ARecursive: Boolean); +begin + Grid.BeginUpdate; + try + ExpandAllRowsInLevel(GridLevel, AnOptionsExpanding.ExpandMasterRows, + AnOptionsExpanding.ExpandGroupRows, ARecursive); + finally + Grid.EndUpdate; + end; +end; + +procedure TdxCustomGridViewAdapter.AfterBuilding; +begin + //GridView.CancelUpdate; +end; + +procedure TdxCustomGridViewAdapter.BeforeBuilding; +begin + //GridView.BeginUpdate; +end; + +function TdxCustomGridViewAdapter.BackgroundBitmaps: TcxCustomGridBackgroundBitmaps; +begin + Result := CustomGridView_GetBackgroundBitmaps(GridView); +end; + +function TdxCustomGridViewAdapter.GetBackgroundBitmap(Index: Integer): TBitmap; +begin + if IsBackgroundBitmapSupported(Index) then + Result := BackgroundBitmaps.GetBitmap(Index) + else + Result := nil +end; + +function TdxCustomGridViewAdapter.HasBackgroundBitmap(Index: Integer): Boolean; +var + Bitmap: TBitmap; +begin + Bitmap := BackgroundBitmaps.GetBitmap(Index); + Result := (Bitmap <> nil) and not Bitmap.Empty; +end; + +function TdxCustomGridViewAdapter.IsBackgroundBitmapSupported(Index: Integer): Boolean; +begin + Result := Index <> bbTabs; +end; + +function TdxCustomGridViewAdapter.Controller: TcxCustomGridController; +begin + Result := GridView.Controller; +end; + +function TdxCustomGridViewAdapter.DataController: TcxCustomDataController; +begin + Result := CustomGridView_GetDataController(GridView); +end; + +function TdxCustomGridViewAdapter.CreateCloneAdapter(AClone: TcxCustomGridView): TdxCustomGridViewAdapter; +begin + Result := dxGridViewBuildersFactory.CreateViewAdapter(MasterAdapter, AClone); +end; + +procedure TdxCustomGridViewAdapter.ExpandAllRowsInGridView(AGridView: TcxCustomGridView; + AMasterRows, AGroupRows: Boolean); +begin + with dxGridViewBuildersFactory.CreateViewAdapter(nil, AGridView) do + try + ExpandAllRowsInItself(AMasterRows, AGroupRows); + ExpandAllRowsInClones(AMasterRows, AGroupRows); + finally + Free; + end; +end; + +procedure TdxCustomGridViewAdapter.ExpandAllRowsInClones(AMasterRows, AGroupRows: Boolean); +var + I: Integer; + Clone: TcxCustomGridView; +begin + for I := 0 to GridView.CloneCount - 1 do + begin + Clone := GridView.Clones[I]; + with CreateCloneAdapter(Clone) do + try + ExpandAllRowsInGridView(Clone, AMasterRows, AGroupRows); + finally + Free; + end; + end; +end; + +procedure TdxCustomGridViewAdapter.ExpandAllRowsInLevel(ALevel: TcxGridLevel; + AMasterRows, AGroupRows: Boolean; ARecursive: Boolean); +var + I: Integer; +begin + ExpandAllRowsInGridView(ALevel.GridView, AMasterRows, AGroupRows); + if ARecursive then + for I := 0 to ALevel.VisibleCount - 1 do + ExpandAllRowsInLevel(ALevel.VisibleItems[I], AMasterRows, AGroupRows, ARecursive); +end; + +procedure TdxCustomGridViewAdapter.ExpandAllRowsInItself(AMasterRows, AGroupRows: Boolean); +begin +end; + +function TdxCustomGridViewAdapter.GetAreAllMasterRowsCollapsed: Boolean; +begin + Result := True; +end; + +function TdxCustomGridViewAdapter.GetAutoWidth: Boolean; +begin + Result := False; +end; + +function TdxCustomGridViewAdapter.GetCanUseOnEveryPageMode: Boolean; +begin + Result := False; +end; + +function TdxCustomGridViewAdapter.GetHasSelectedRecords: Boolean; +begin + Result := False; +end; + +function TdxCustomGridViewAdapter.GetIndentCount: Integer; +begin + Result := Ord(IsMaster); +end; + +function TdxCustomGridViewAdapter.GetIndentWidth: Integer; +begin + Result := DefaultIndentWidth; +end; + +function TdxCustomGridViewAdapter.GetIsOffice11StyleGrouping: Boolean; +begin + Result := False; +end; + +function TdxCustomGridViewAdapter.GetMasterGridRecord: TcxCustomGridRecord; +begin + Result := nil; +end; + +function TdxCustomGridViewAdapter.GetRecordCount: Integer; +begin + Result := 0; +end; + +function TdxCustomGridViewAdapter.GetViewWidthExtra: Integer; +begin + Result := Ord(IsMaster) * IndentWidth; +end; + +function TdxCustomGridViewAdapter.GetCaptionViewParams: TcxViewParams; +var + Level: TcxGridLevel; +begin + if MasterAdapter = nil then + if GridView.MasterGridView <> nil then + begin + Level := GridView.MasterGridView.Level as TcxGridLevel; + Level.Styles.GetTabParams( GridLevel, Result); + end + else + Result := GetRootCaptionParams + else + MasterAdapter.GridLevel.Styles.GetTabParams( GridLevel, Result); +end; + +function TdxCustomGridViewAdapter.GetFilterBarViewParams: TcxViewParams; +begin + Result.Color := clBtnShadow; + Result.Font := nil; + Result.TextColor := clWindow; +end; + +function TdxCustomGridViewAdapter.GetRootCaptionParams: TcxViewParams; +begin + Grid.RootLevelStyles.GetTabParams( GridLevel, Result); +end; + +function TdxCustomGridViewAdapter.GetAbsoluteLevel: Integer; +begin + Result := GridLevel.Level; +end; + +function TdxCustomGridViewAdapter.GetCanUseLookAndFeelColors: Boolean; +begin + Result := Grid.LookAndFeel.NativeStyle and dxThemeManager.AreVisualStylesAvailable; +end; + +function TdxCustomGridViewAdapter.GetCaptionText: string; +begin + Result := GridLevel.Caption; +end; + +function TdxCustomGridViewAdapter.GetDetailsSeparatorColor: TColor; +begin + Result := MasterGridLevel.Options.DetailFrameColor; +end; + +function TdxCustomGridViewAdapter.GetDetailsSeparatorThickness: Integer; +begin + Result := MasterGridLevel.Options.DetailFrameWidth; +end; + +function TdxCustomGridViewAdapter.GetFilter: TcxDataFilterCriteria; +begin + Result := DataController.Filter; +end; + +function TdxCustomGridViewAdapter.GetFilterActive: Boolean; +begin + Result := Filter.Active; +end; + +function TdxCustomGridViewAdapter.GetFilterEmpty: Boolean; +begin + Result := Filter.FilterText = ''; +end; + +function TdxCustomGridViewAdapter.GetFilterText: string; +begin + Result := Filter.FilterCaption; + if Result = '' then + Result := cxGetResourceString(@scxGridFilterIsEmpty); +end; + +function TdxCustomGridViewAdapter.GetGrid: TcxCustomGrid; +begin + Result := GridView.Control as TcxCustomGrid; +end; + +function TdxCustomGridViewAdapter.GetGridLevel: TcxGridLevel; +begin + Result := GridView.Level as TcxGridLevel; +end; + +function TdxCustomGridViewAdapter.GetGridWidth: Integer; +begin + with Grid.ClientRect do + Result := Right - Left; +end; + +function TdxCustomGridViewAdapter.GetHasDetailsSeparator: Boolean; +begin + Result := DetailsSeparatorThickness <> 0; +end; + +function TdxCustomGridViewAdapter.GetLookAndFeelKind: TcxLookAndFeelKind; +begin + Result := Grid.LookAndFeel.Kind; +end; + +function TdxCustomGridViewAdapter.GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := Grid.LookAndFeelPainter; +end; + +function TdxCustomGridViewAdapter.GetIsDetail: Boolean; +begin + Result := GridView.IsDetail; +end; + +function TdxCustomGridViewAdapter.GetIsMaster: Boolean; +begin + Result := GridView.IsMaster; +end; + +function TdxCustomGridViewAdapter.GetMasterGridLevel: TcxGridLevel; +begin + Result := GridLevel.Parent; +end; + +function TdxCustomGridViewAdapter.GetSummary: TcxDataSummary; +begin + Result := DataController.Summary; +end; + +function TdxCustomGridViewAdapter.GetThemedCaptionColor: TColor; +begin + Result := LookAndFeelPainter.DefaultTabColor; +end; + +function TdxCustomGridViewAdapter.GetThemedCaptionTextColor: TColor; +begin + Result := LookAndFeelPainter.DefaultTabTextColor; +end; + +function TdxCustomGridViewAdapter.GetThemedFilterBarColor: TColor; +begin + Result := LookAndFeelPainter.DefaultFilterBoxColor; +end; + +function TdxCustomGridViewAdapter.GetThemedFilterBarTextColor: TColor; +begin + Result := LookAndFeelPainter.DefaultFilterBoxTextColor; +end; + +function TdxCustomGridViewAdapter.GetViewWidth: Integer; +begin + Result := GridView.Control.Width; +end; + +{ TdxCustomGridViewFormatter } + +constructor TdxCustomGridViewFormatter.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited Create; + FBuilder := ABuilder; + + FLookAndFeelItems := TList.Create; + FExpandButtons := TList.Create; + FFont := TFont.Create; + + FTransparentColor := dxPSCore.dxDefaultContentColor; +end; + +destructor TdxCustomGridViewFormatter.Destroy; +begin + FreeAndNil(FFont); + FreeAndNil(FExpandButtons); + FreeAndNil(FLookAndFeelItems); + inherited; +end; + +function TdxCustomGridViewFormatter.Builder: TdxCustomGridViewBuilder; +begin + Result := FBuilder; +end; + +function TdxCustomGridViewFormatter.Adapter: TdxCustomGridViewAdapter; +begin + Result := Builder.Adapter; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeHost(AHost: TdxReportCell); +begin + AHost.CellSides := []; + AHost.Data := Integer(Adapter.GridView); + AHost.Transparent := True; +end; + +function TdxCustomGridViewFormatter.GetHostClass: TdxReportCellClass; +begin + Result := TdxReportCell; {Host} +end; + +function TdxCustomGridViewFormatter.GetRowHostClass: TdxReportCellClass; +begin + Result := TdxReportCell; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeCaption(ACaption: TdxReportCellText); +begin + SetViewParams(ACaption, GetCaptionViewParams); + if HasBackgroundBitmap(bbTabs) then + ACaption.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbTabs); + RegisterLookAndFeelItem(ACaption, cesRaised); + ACaption.Data := Integer(TdxGridLevelCaption); + ACaption.Text := Adapter.CaptionText; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeCaptionRow(ARow: TdxReportCell); +begin +end; + +procedure TdxCustomGridViewFormatter.DoReportLinkInitializeCaption(ACaption: TdxReportCellText); +begin + ReportLink.DoInitializeLevelCaption(Adapter.GridView, TdxReportCellString(ACaption)); +end; + +function TdxCustomGridViewFormatter.GetCaptionClass: TdxReportCellTextClass; +begin + Result := TdxReportCellString; +end; + +function TdxCustomGridViewFormatter.GetCaptionViewParams: TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetCaptionParams(Adapter.GridLevel, Result.NativeParams) + else + Result.NativeParams := Adapter.GetCaptionViewParams; + + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + begin + Result.NativeParams.Color := Adapter.ThemedCaptionColor; + Result.NativeParams.TextColor := Adapter.ThemedCaptionTextColor; + end; + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.FixedTransparent; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeFilterBar(AFilterBar: TdxReportCellText); +begin + SetViewParams(AFilterBar, GetFilterBarViewParams); + if HasBackgroundBitmap(bbFilterBox) then + AFilterBar.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbFilterBox); + + with AFilterBar do + begin + Data := Integer(TdxGridFilterBar); + EndEllipsis := True; + Text := Adapter.FilterText; + end; + + if not Adapter.FilterEmpty then + with TdxReportCellCheck(AFilterBar) do + begin + Checked := Adapter.FilterActive; + CheckPos := ccpLeft; + end; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeFilterBarRow(ARow: TdxReportCell); +begin +end; + +procedure TdxCustomGridViewFormatter.DoReportLinkInitializeFilterBar(AFilterBar: TdxReportCellText); +begin + ReportLink.DoInitializeFilterBar(TcxCustomGridTableView(Adapter.GridView), TdxReportCellString(AFilterBar)); +end; + +function TdxCustomGridViewFormatter.GetFilterBarClass: TdxReportCellTextClass; +const + CheckClasses: array[Boolean] of TdxReportCellTextClass = (TdxReportCellCheck, TdxReportCellString); +begin + Result := CheckClasses[Adapter.FilterEmpty]; +end; + +function TdxCustomGridViewFormatter.GetFilterBarViewParams: TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetFilterBarParams(Result.NativeParams) + else + Result.NativeParams := Adapter.GetFilterBarViewParams; + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + begin + Result.NativeParams.Color := Adapter.ThemedCaptionColor; + Result.NativeParams.TextColor := Adapter.ThemedCaptionTextColor; + end; + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.FixedTransparent; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeDetailsSeparatorRow(ARow: TdxReportCell); +begin +end; + +procedure TdxCustomGridViewFormatter.DoInitializeHorzDetailsSeparator(ASeparator: TdxReportCellBox); +begin + with ASeparator do + begin + CellSides := csTopBottom; + Color := DetailsSeparatorColor; + Transparent := False; + end; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeVertBottomDetailsSeparator(ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); +begin + DoInitializeVertDetailsSeparator(ASeparator, ASeparatorKind); + case ASeparatorKind of + vdskLeading: + ASeparator.CellSides := [csLeft, csBottom]; + vdskTrailing: + ASeparator.CellSides := [csRight, csBottom]; + end; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeVertDetailsSeparator(ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); +begin + with ASeparator do + begin + CellSides := [csLeft, csRight]; + Color := DetailsSeparatorColor; + Transparent := False; + end; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeVertTopDetailsSeparator(ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); +begin + DoInitializeVertDetailsSeparator(ASeparator, ASeparatorKind); + case ASeparatorKind of + vdskLeading: + ASeparator.CellSides := [csLeft, csTop]; + vdskTrailing: + ASeparator.CellSides := [csRight, csTop]; + end; +end; + +function TdxCustomGridViewFormatter.GetDetailsSeparatorClass: TdxReportCellBoxClass; +begin + Result := TdxReportCellBox; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeMasterIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer); +begin +end; + +function TdxCustomGridViewFormatter.GetMasterIndentClass: TdxReportCellExpandButtonClass; +begin + Result := TdxReportCellExpandButton; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeViewTerminator(ATerminator: TdxReportCellBox); +begin + ATerminator.CellSides := [csBottom]; + ATerminator.Transparent := True; +end; + +function TdxCustomGridViewFormatter.QueryInterface(const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; +function TdxCustomGridViewFormatter._AddRef: Integer; +begin + Result := 1; +end; +function TdxCustomGridViewFormatter._Release: Integer; +begin + Result := 1; +end; + +procedure TdxCustomGridViewFormatter.AddDelimiters; +begin + AddHorizontalDelimiters; + AddVerticalDelimiters; +end; + +procedure TdxCustomGridViewFormatter.AddHorizontalDelimiters; +begin +end; + +procedure TdxCustomGridViewFormatter.AddVerticalDelimiters; +var + I: Integer; +begin + if ReportLink.OptionsPagination.Row then + for I := 0 to Builder.ReportRowCount - 1 do + ReportLink.AddVerticalDelimiter(Builder.ReportRows[I]); +end; + +procedure TdxCustomGridViewFormatter.AfterBuilding; +begin + Adapter.AfterBuilding; + FormatLookAndFeelItems; + FormatExpandButtons; + AddDelimiters; +end; + +procedure TdxCustomGridViewFormatter.BeforeBuilding; +begin + Adapter.BeforeBuilding; + Calculate; +end; + +procedure TdxCustomGridViewFormatter.Calculate; +begin + CalculateLineHeights; +end; + +procedure TdxCustomGridViewFormatter.CalculateLineHeights; +begin + CaptionLineHeight := 2 * TabsAreaOffset + CalculateFontHeight(GetCaptionViewParams); + FilterBarLineHeight := 2 * FilterBarTextOffset + CalculateFontHeight(GetFilterBarViewParams); +end; + +function TdxCustomGridViewFormatter.GetDetailsSeparatorColor: TColor; +begin + Result := Adapter.DetailsSeparatorColor; + {with ReportLink.OptionsFormatting do + if UseNativeStyles then + begin + Result := FixedColor; + end;} +end; + +function TdxCustomGridViewFormatter.GetDetailsSeparatorThickness: Integer; +begin + Result := Adapter.DetailsSeparatorThickness; +end; + +function TdxCustomGridViewFormatter.GetHasDetailsSeparator: Boolean; +begin + Result := Adapter.HasDetailsSeparator; +end; + +function TdxCustomGridViewFormatter.GetSiteHeight: Integer; +var + ControllerIntf: IdxReportLinkController; +begin + if ReportLink.IsAggregated and + Supports(TObject(ReportLink.Controller), IdxReportLinkController, ControllerIntf) then + with ControllerIntf.GetControlSiteBounds(ReportLink.Grid) do + Result := Bottom - Top - 1 + else + with ReportLink.RealPrinterPage.PaintRectPixels do + Result := Bottom - Top - 1; +end; + +function TdxCustomGridViewFormatter.GetSiteWidth: Integer; +var + ControllerIntf: IdxReportLinkController; +begin + if ReportLink.IsAggregated and + Supports(TObject(ReportLink.Controller), IdxReportLinkController, ControllerIntf) then + with ControllerIntf.GetControlSiteBounds(ReportLink.Grid) do + Result := Right - Left - 1 + else + with ReportLink.RealPrinterPage.PaintRectPixels do + Result := Right - Left - 1; +end; + +function TdxCustomGridViewFormatter.GetViewWidth: Integer; +begin + Result := 0; +end; + +function TdxCustomGridViewFormatter.GetViewWidthExtraAfter: Integer; +var + I: Integer; +begin + Result := 0; + + for I := 0 to AbsoluteLevel - 1 do + with Builder.AbsoluteBuilders[I].Adapter do + if HasDetailsSeparator then Inc(Result, DetailsSeparatorThickness); + + if Adapter.HasDetailsSeparator then + Inc(Result, Adapter.DetailsSeparatorThickness); +end; + +function TdxCustomGridViewFormatter.GetViewWidthExtraBefore: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to AbsoluteLevel - 1 do + with Builder.AbsoluteBuilders[I].Adapter do + begin + Inc(Result, ViewWidthExtra); + if HasDetailsSeparator then Inc(Result, DetailsSeparatorThickness); + end; + + if Adapter.HasDetailsSeparator then + Inc(Result, Adapter.DetailsSeparatorThickness); +end; + +function TdxCustomGridViewFormatter.BackgroundBitmaps: TcxCustomGridBackgroundBitmaps; +begin + Result := Adapter.BackgroundBitmaps; +end; + +function TdxCustomGridViewFormatter.GetBackgroundBitmap(Index: Integer): TBitmap; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + Result := ReportLink.Styles.GetBitmap(MapStyleBackgroundBitmapIndex(Index)) + else + Result := Adapter.GetBackgroundBitmap(Index); +end; + +function TdxCustomGridViewFormatter.GetBackgroundBitmapIndex(Index: Integer): Integer; +begin + Result := ReportLink.AddBackgroundBitmapToPool(GetBackgroundBitmap(Index)); +end; + +function TdxCustomGridViewFormatter.HasBackgroundBitmap(Index: Integer): Boolean; +var + Bitmap: TBitmap; +begin + if not ReportLink.OptionsFormatting.SuppressBackgroundBitmaps then + begin + Bitmap := GetBackgroundBitmap(Index); + Result := (Bitmap <> nil) and not Bitmap.Empty; + end + else + Result := False; +end; + +function TdxCustomGridViewFormatter.MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; +begin + case AGridBackgroundBitmapIndex of + bbTabs: + Result := vspsGridCaption; + bbContent: + Result := vspsGridContent; + bbFilterBox: + Result := vspsGridFilterBar; + else + Result := 0; + end; +end; + +function TdxCustomGridViewFormatter.CalculateFontHeight(const AParams: TdxReportItemViewParams): Integer; +begin + Result := Renderer.CalcTextPatternHeight(DC, AParams.NativeParams.Font); +end; + +procedure TdxCustomGridViewFormatter.CalculateHeight(const AParams: TdxReportItemViewParams; + var AHeight: Integer); +var + Value: Integer; +begin + Value := CalculateFontHeight(AParams); + if Value > AHeight then AHeight := Value; +end; + +function TdxCustomGridViewFormatter.GetStyleFontIndex(const AParams: TdxReportItemViewParams): Integer; +begin + if AParams.NativeParams.Font <> nil then + begin + FFont.Assign(AParams.NativeParams.Font); + if not dxPSUtl.dxIsTrueTypeFont(FFont) then + FFont.Name := ReportLink.Font.Name; + FFont.Color := ColorToRGB(AParams.NativeParams.TextColor); + FFont.Style := FFont.Style + AParams.FontStyle; + Result := ReportLink.AddFontToPool(FFont); + end + else + Result := 0; +end; + +function TdxCustomGridViewFormatter.IsColorTransparent(AColor: TColor): Boolean; +begin + Result := ColorToRGB(AColor) = ColorToRGB(TransparentColor); +end; + +procedure TdxCustomGridViewFormatter.RegisterExpandButton(AExpandButton: TdxReportCellExpandButton); +begin + FExpandButtons.Add(AExpandButton); +end; + +procedure TdxCustomGridViewFormatter.RegisterLookAndFeelItem(AnItem: TdxReportVisualItem; + AEdgeStyle: TdxCellEdgeStyle); +begin + AnItem.EdgeMode := Self.EdgeMode; + AnItem.Edge3DStyle := AEdgeStyle; + FLookAndFeelItems.Add(AnItem); +end; + +procedure TdxCustomGridViewFormatter.SetViewParams(AnItem: TdxReportVisualItem; + const AParams: TdxReportItemViewParams); +begin + AnItem.CellSides := AParams.CellSides; + AnItem.Color := ColorToRGB(AParams.NativeParams.Color); + AnItem.FontIndex := GetStyleFontIndex(AParams); + AnItem.Transparent := AParams.Transparent; +end; + +function TdxCustomGridViewFormatter.GetAbsoluteLevel: Integer; +begin + Result := Adapter.AbsoluteLevel; + if ReportLink.OptionsDetails.StartFromFocusedView then + Dec(Result, (ReportLink.ActiveView.Level as TcxGridLevel).Level); +end; + +function TdxCustomGridViewFormatter.GetAutoWidth: Boolean; +begin + Result := ReportLink.OptionsSize.AutoWidth or Adapter.AutoWidth; +end; + +function TdxCustomGridViewFormatter.GetDC: HDC; +begin + Result := ReportLink.ScreenDC; +end; + +function TdxCustomGridViewFormatter.GetEdgeMode: TdxCellEdgeMode; +const + EdgeModeMap: array[Boolean] of TdxCellEdgeMode = (cemPattern, cem3DEffects); +begin + Result := EdgeModeMap[ReportLink.OptionsFormatting.LookAndFeelKind <> lfUltraFlat]; +end; + +function TdxCustomGridViewFormatter.GetGridWidth: Integer; +begin + Result := Adapter.GridWidth; +end; + +function TdxCustomGridViewFormatter.GetExpandButton(Index: Integer): TdxReportCellExpandButton; +begin + Result := FExpandButtons[Index]; +end; + +function TdxCustomGridViewFormatter.GetExpandButtonCount: Integer; +begin + Result := FExpandButtons.Count; +end; + +function TdxCustomGridViewFormatter.GetIndentWidth: Integer; +begin + Result := Adapter.IndentWidth; +end; + +function TdxCustomGridViewFormatter.GetLookAndFeelItem(Index: Integer): TdxReportVisualItem; +begin + Result := FLookAndFeelItems[Index]; +end; + +function TdxCustomGridViewFormatter.GetLookAndFeelItemCount: Integer; +begin + Result := FLookAndFeelItems.Count; +end; + +function TdxCustomGridViewFormatter.GetPaginateByTopLevelGroups: Boolean; +begin + Result := ReportLink.OptionsPagination.TopLevelGroup; +end; + +function TdxCustomGridViewFormatter.GetRenderer: TdxPSReportRenderer; +begin + Result := ReportLink.Renderer; +end; + +function TdxCustomGridViewFormatter.GetReportLink: TdxGridReportLink; +begin + Result := Builder.ReportLink; +end; + +function TdxCustomGridViewFormatter.GetShowCaption: Boolean; +begin + Result := ReportLink.OptionsView.Caption; +end; + +function TdxCustomGridViewFormatter.GetShowFilterBar: Boolean; +begin + Result := ReportLink.OptionsView.FilterBar; +end; + +function TdxCustomGridViewFormatter.GetUseLookAndFeelColors: Boolean; +begin + Result := ReportLink.OptionsFormatting.UseLookAndFeelColors; +end; + +function TdxCustomGridViewFormatter.GetViewAvailableWidth: Integer; +begin + if ReportLink.OptionsSize.AutoWidth then + Result := SiteWidth + else + Result := Adapter.ViewWidth; + Dec(Result, ViewWidthExtraBefore + ViewWidthExtraAfter); +end; + +function TdxCustomGridViewFormatter.GetViewWidthExtra: Integer; +begin + Result := Adapter.ViewWidthExtra; +end; + +procedure TdxCustomGridViewFormatter.FormatLookAndFeelItems; +const + Borders3D: array[TdxCellEdgeStyle, Boolean] of TdxPSCellBorderClass = + ((TdxPSCellRaisedBorder, TdxPSCellRaisedSoftBorder), + (TdxPSCellSunkenBorder, TdxPSCellSunkenSoftBorder)); +var + I: Integer; +begin + for I := 0 to LookAndFeelItemCount - 1 do + with LookAndFeelItems[I] do + if ReportLink.Effects3D then + BorderClass := Borders3D[Edge3DStyle, ReportLink.Soft3D] + else + BorderClass := TdxPSCellUltraFlatBorder; +end; + +procedure TdxCustomGridViewFormatter.FormatExpandButtons; +var + I: Integer; +begin + for I := 0 to ExpandButtonCount - 1 do + with ExpandButtons[I] do + begin + ButtonBorder3D := ReportLink.Effects3D; + ButtonBorder3DSoft := ReportLink.Soft3D; + end; +end; + +{ TdxCustomGridViewBuilder } + +constructor TdxCustomGridViewBuilder.Create(AReportLink: TdxGridReportLink; + AMasterBuilder: TdxCustomGridViewBuilder; AGridView: TcxCustomGridView); + + function GetMasterAdapter: TdxCustomGridViewAdapter; + begin + if AMasterBuilder = nil then + Result := nil + else + Result := AMasterBuilder.Adapter; + end; + +begin + inherited Create; + FReportLink := AReportLink; + FMasterBuilder := AMasterBuilder; + FGridView := AGridView; + + FAdapter := CreateAdapter(GetMasterAdapter, GridView); + FFormatter := FormatterClass.Create(Self); + FProducerCache := TdxProducerCache.Create(Self); + FReportRows := TList.Create; + + if MasterBuilder <> nil then + MasterBuilder.FDetailsBuilder := Self; +end; + +destructor TdxCustomGridViewBuilder.Destroy; +begin + if MasterBuilder <> nil then + MasterBuilder.FDetailsBuilder := nil; + FreeAndNil(FReportRows); + FreeAndNil(FProducerCache); + FreeAndNil(FFormatter); + FreeAndNil(FAdapter); + inherited; +end; + +function TdxCustomGridViewBuilder.Adapter: TdxCustomGridViewAdapter; +begin + Result := FAdapter; +end; + +class function TdxCustomGridViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxCustomGridViewAdapter; +end; + +class function TdxCustomGridViewBuilder.CreateAdapter(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView): TdxCustomGridViewAdapter; +begin + Result := AdapterClass.Create(AMasterAdapter, AGridView); +end; + +function TdxCustomGridViewBuilder.Formatter: TdxCustomGridViewFormatter; +begin + Result := FFormatter; +end; + +class function TdxCustomGridViewBuilder.FormatterClass: TdxGridViewFormatterClass; +begin + Result := TdxCustomGridViewFormatter; +end; + +procedure TdxCustomGridViewBuilder.Build; +begin + BeforeBuilding; + try + DoBuild; + finally + AfterBuilding; + end; +end; + +function TdxCustomGridViewBuilder.IsAborted: Boolean; +begin + Result := ReportLink.AbortBuilding; +end; + +procedure TdxCustomGridViewBuilder.Progress(const APercentDone: Double); +begin + ReportLink.DoProgress(APercentDone); +end; + +class function TdxCustomGridViewBuilder.PairClass: TClass; +begin + Result := GridViewClass; +end; + +class procedure TdxCustomGridViewBuilder.Register; +begin + dxGridViewBuildersFactory.Register(Self); +end; + +class procedure TdxCustomGridViewBuilder.Unregister; +begin + dxGridViewBuildersFactory.Unregister(Self); +end; + +procedure TdxCustomGridViewBuilder.AddReportRow(ARow: TdxReportCell); +begin + if ARow.Parent = ReportLink.ReportCells.Cells then + FReportRows.Add(ARow); +end; + +procedure TdxCustomGridViewBuilder.AfterBuilding; +begin + if not IsAborted then Formatter.AfterBuilding; +end; + +procedure TdxCustomGridViewBuilder.BeforeBuilding; +begin + Formatter.BeforeBuilding; +end; + +procedure TdxCustomGridViewBuilder.DoBuild; +begin + DoBuildViewHeader; + DoBuildViewBody; + if not IsAborted then DoBuildViewFooter; +end; + +procedure TdxCustomGridViewBuilder.DoBuildViewBody; +begin +end; + +procedure TdxCustomGridViewBuilder.DoBuildViewFooter; +begin +end; + +procedure TdxCustomGridViewBuilder.DoBuildViewHeader; +begin +end; + +function TdxCustomGridViewBuilder.GetViewAvailableWidth: Integer; +begin + Result := Formatter.ViewAvailableWidth; +end; + +procedure TdxCustomGridViewBuilder.CreateCaption; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetCaptionProducer.Produce(HostInfoServices.CaptionHostInfo); + AddReportRow(ReportRow); +end; + +function TdxCustomGridViewBuilder.GetCaptionProducer: TdxGridViewCaptionProducer; +begin + Result := ProducerCache[GetCaptionProducerClass] as TdxGridViewCaptionProducer; +end; + +function TdxCustomGridViewBuilder.GetCaptionProducerClass: TdxGridViewCaptionProducerClass; +begin + Result := TdxGridViewCaptionProducer; +end; + +procedure TdxCustomGridViewBuilder.CreateBottomDetailsSeparator; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetDetailsBottomSeparatorProducer.Produce(HostInfoServices.LevelSeparatorBottomHostInfo); + AddReportRow(ReportRow); +end; + +procedure TdxCustomGridViewBuilder.CreateTopDetailsSeparator; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetDetailsTopSeparatorProducer.Produce(HostInfoServices.LevelSeparatorTopHostInfo); + AddReportRow(ReportRow); +end; + +function TdxCustomGridViewBuilder.GetDetailsBottomSeparatorProducer: TdxGridViewDetailsSeparatorProducer; +begin + Result := ProducerCache[GetDetailsBottomSeparatorProducerClass] as TdxGridViewDetailsSeparatorProducer; +end; + +function TdxCustomGridViewBuilder.GetDetailsBottomSeparatorProducerClass: TdxGridViewDetailsSeparatorProducerClass; +begin + Result := TdxGridViewDetailsBottomSeparatorProducer; +end; + +function TdxCustomGridViewBuilder.GetDetailsTopSeparatorProducer: TdxGridViewDetailsSeparatorProducer; +begin + Result := ProducerCache[GetDetailsTopSeparatorProducerClass] as TdxGridViewDetailsSeparatorProducer; +end; + +function TdxCustomGridViewBuilder.GetDetailsTopSeparatorProducerClass: TdxGridViewDetailsSeparatorProducerClass; +begin + Result := TdxGridViewDetailsTopSeparatorProducer; +end; + +procedure TdxCustomGridViewBuilder.CreateFilterBar; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetFilterBarProducer.Produce(HostInfoServices.FilterBarHostInfo); + AddReportRow(ReportRow); +end; + +function TdxCustomGridViewBuilder.GetFilterBarProducer: TdxGridViewFilterBarProducer; +begin + Result := ProducerCache[GetFilterBarProducerClass] as TdxGridViewFilterBarProducer; +end; + +function TdxCustomGridViewBuilder.GetFilterBarProducerClass: TdxGridViewFilterBarProducerClass; +begin + Result := TdxGridViewFilterBarProducer; +end; + +procedure TdxCustomGridViewBuilder.CreateViewTerminator; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetViewTerminatorProducer.Produce(HostInfoServices.PageDetailsHostInfo); + AddReportRow(ReportRow); +end; + +function TdxCustomGridViewBuilder.GetViewTerminatorProducer: TdxGridViewTerminatorProducer; +begin + Result := ProducerCache[GetViewTerminatorProducerClass] as TdxGridViewTerminatorProducer; +end; + +function TdxCustomGridViewBuilder.GetViewTerminatorProducerClass: TdxGridViewTerminatorProducerClass; +begin + Result := TdxGridViewTerminatorProducer; +end; + +function TdxCustomGridViewBuilder.GridView: TcxCustomGridView; +begin + Result := FGridView; +end; + +class function TdxCustomGridViewBuilder.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridView; +end; + +function TdxCustomGridViewBuilder.GetAbsoluteBuilder(AIndex: Integer): TdxCustomGridViewBuilder; +begin + Result := RootBuilder; + while AIndex > 0 do + begin + Result := Result.DetailsBuilder; + Dec(AIndex); + end; +end; + +function TdxCustomGridViewBuilder.GetAutoWidth: Boolean; +begin + Result := Formatter.AutoWidth; +end; + +function TdxCustomGridViewBuilder.GetGridLevel: TcxGridLevel; +begin + Result := GridView.Level as TcxGridLevel; +end; + +function TdxCustomGridViewBuilder.GetGrid: TcxCustomGrid; +begin + Result := ReportLink.Grid; +end; + +function TdxCustomGridViewBuilder.GetHost: TdxReportCell; +begin + Result := ReportLink.ReportCells.Cells; +end; + +function TdxCustomGridViewBuilder.GetHostInfoServices: TdxGridAttributeHostInfoServices; +begin + Result := ReportLink.HostInfoServices; +end; + +function TdxCustomGridViewBuilder.GetReportRow(Index: Integer): TdxReportCell; +begin + Result := FReportRows[Index]; +end; + +function TdxCustomGridViewBuilder.GetReportRowCount: Integer; +begin + Result := FReportRows.Count; +end; + +function TdxCustomGridViewBuilder.GetRootBuilder: TdxCustomGridViewBuilder; +begin + Result := Self; + while Result.MasterBuilder <> nil do + Result := Result.MasterBuilder; +end; + +{ TdxCustomGridTableViewAdapter } + +constructor TdxCustomGridTableViewAdapter.Create(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView); +begin + inherited; + FRecordHelpersCache := TdxRecordHelpersCache.Create(Self); + FDetailsLineCount := -1; +end; + +destructor TdxCustomGridTableViewAdapter.Destroy; +begin + FreeAndNil(FRecordHelpersCache); + inherited; +end; + +function TdxCustomGridTableViewAdapter.ForEachRecord(AProc: TdxGridTableAdapterForEachRecordProc; + AData: Integer; AProcessSelection: Boolean): Boolean; +var + I: Integer; + Continue: Boolean; + Record_: TcxCustomGridRecord; +begin + Result := True; + if @AProc = nil then Exit; + + Continue := True; + for I := 0 to RecordCount - 1 do + begin + Record_ := Records[I]; + if not AProcessSelection or Record_.Selected then + AProc(Record_, AData, Continue); + if not Continue then + begin + Result := False; + Break; + end; + end; +end; + +function TdxCustomGridTableViewAdapter.GridView: TcxCustomGridTableView; +begin + Result := inherited GridView as TcxCustomGridTableView; +end; + +class function TdxCustomGridTableViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridTableView; +end; + +function TdxCustomGridTableViewAdapter.Styles: TcxCustomGridTableViewStyles; +begin + Result := inherited Styles as TcxCustomGridTableViewStyles; +end; + +function TdxCustomGridTableViewAdapter.CalculateDetailsLineCount: Integer; +begin + Result := 1; +end; + +function TdxCustomGridTableViewAdapter.GetContentViewParams(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem): TcxViewParams; +begin + if (ATableItem <> nil) and (ATableItem.Styles <> nil) then + ATableItem.Styles.GetContentParams(ARecord, Result) + else + Styles.GetContentParams(ARecord, ATableItem, Result); + if Result.Color = clWindow then // 3.2 + Result.Color := dxPSCore.dxDefaultContentColor; +end; + +function TdxCustomGridTableViewAdapter.GetPreviewViewParams(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem): TcxViewParams; +begin + Result := GetContentViewParams(ARecord, ATableItem); +end; + +function TdxCustomGridTableViewAdapter.GetSelectionViewParams: TcxViewParams; +begin + FillChar(Result, SizeOf(Result), 0); + with Styles.Selection do + begin + Result.Bitmap := Bitmap; + Result.Color := Color; + Result.Font := Font; + Result.TextColor := TextColor; + end; +end; + +function TdxCustomGridTableViewAdapter.HasSelectionStyle: Boolean; +begin + Result := Styles.Selection <> nil; +end; + +function TdxCustomGridTableViewAdapter.Controller: TcxCustomGridTableController; +begin + Result := inherited Controller as TcxCustomGridTableController; +end; + +procedure TdxCustomGridTableViewAdapter.DoExpandMasterRow(ARecord: TcxCustomGridRecord; + AData: Integer; var AContinue: Boolean); +begin + if (ARecord is TcxGridMasterDataRow) and ARecord.Expandable then + GridMasterDataRow_DoExpand(TcxGridMasterDataRow(ARecord), True); + {begin + ARecord.Expanded := True; + with TcxGridMasterDataRow(ARecord) do + if ActiveDetailGridViewExists then + ExpandAllRowsInGridView(ActiveDetailGridView, True, Boolean(AData)); + end;} +end; + +procedure TdxCustomGridTableViewAdapter.ExpandAllGroupRows; +begin + DataController.Groups.FullExpand; +end; + +procedure TdxCustomGridTableViewAdapter.ExpandAllMasterRows(AnExpandGroups: Boolean); +begin + ForEachRecord(DoExpandMasterRow, Integer(AnExpandGroups), False); +end; + +procedure TdxCustomGridTableViewAdapter.ExpandAllRowsInItself(AMasterRows, AGroupRows: Boolean); +begin + if AGroupRows then ExpandAllGroupRows; + if AMasterRows then ExpandAllMasterRows(AGroupRows); +end; + +function TdxCustomGridTableViewAdapter.GetAreAllMasterRowsCollapsed: Boolean; +begin + Result := ForEachRecord(IsMasterRowCollapsed, 0, False); +end; + +function TdxCustomGridTableViewAdapter.GetCanUseOnEveryPageMode: Boolean; +begin + Result := RecordCount <> 0; +end; + +function TdxCustomGridTableViewAdapter.GetHasSelectedRecords: Boolean; +var + I: Integer; +begin + Result := SelectedRecordCount <> 0; + if not Result then + for I := 0 to RecordCount - 1 do + begin + Result := RecordHelpers[Records[I]].HasSelectedChildren; + if Result then Break; + end; +end; + +function TdxCustomGridTableViewAdapter.GetMasterGridRecord: TcxCustomGridRecord; +begin + Result := GridView.MasterGridRecord; +end; + +function TdxCustomGridTableViewAdapter.GetRecordCount: Integer; +begin + Result := GridView.ViewData.RecordCount; +end; + +class function TdxCustomGridTableViewAdapter.GetProperties(AnItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxCustomEditProperties; +begin + Result := AnItem.GetProperties(ARecord); + if Result = nil then + Result := GetRepositoryItem(AnItem, ARecord).Properties; +end; + +class function TdxCustomGridTableViewAdapter.GetPropertiesClass(AnItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxCustomEditPropertiesClass; +begin + Result := TcxCustomEditPropertiesClass(GetProperties(AnItem, ARecord).ClassType); +end; + +class function TdxCustomGridTableViewAdapter.GetRepositoryItem(AnItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxEditRepositoryItem; +begin + Result := AnItem.GetRepositoryItem; +end; + +procedure TdxCustomGridTableViewAdapter.IsMasterRowCollapsed(ARecord: TcxCustomGridRecord; + AData: Integer; var AContinue: Boolean); +begin + if ARecord is TcxGridMasterDataRow then + AContinue := not ARecord.Expanded; +end; + +function TdxCustomGridTableViewAdapter.GetCellAutoHeight: Boolean; +begin + Result := CustomGridTableOptionsView_GetCellAutoHeight(GridView.OptionsView); +end; + +function TdxCustomGridTableViewAdapter.GetCellMultiline: Boolean; +begin + Result := CustomGridTableOptionsView_GetCellAutoHeight(GridView.OptionsView); +end; + +function TdxCustomGridTableViewAdapter.GetGridLineColor: TColor; +begin + Result := GridView.LookAndFeelPainter.DefaultGridLineColor; +end; + +function TdxCustomGridTableViewAdapter.GetCellEndEllipsis: Boolean; +begin + Result := GridView.OptionsView.CellEndEllipsis; +end; + +function TdxCustomGridTableViewAdapter.GetDetailsLineCount: Integer; +begin + if FDetailsLineCount = -1 then + FDetailsLineCount := CalculateDetailsLineCount; + Result := FDetailsLineCount; +end; + +function TdxCustomGridTableViewAdapter.GetFiltering: TcxCustomGridTableFiltering; +begin + Result := GridView.Filtering; +end; + +function TdxCustomGridTableViewAdapter.GetIsGridMode: Boolean; +begin + Result := DataController.IsGridMode; +end; + +function TdxCustomGridTableViewAdapter.GetRecord(Index: Integer): TcxCustomGridRecord; +begin + Result := GridView.ViewData.Records[Index]; +end; + +function TdxCustomGridTableViewAdapter.GetRecordHelper(ARecord: TcxCustomGridRecord): TdxCustomGridRecordHelper; +begin + Result := RecordHelpersCache.Helpers[ARecord]; +end; + +function TdxCustomGridTableViewAdapter.GetSelectedRecord(Index: Integer): TcxCustomGridRecord; +begin + Result := Controller.SelectedRecords[Index] +end; + +function TdxCustomGridTableViewAdapter.GetSelectedRecordCount: Integer; +begin + if CustomGridTableController_GetMultiSelect(Controller) then + Result := Controller.SelectedRecordCount + else + Result := 0; +end; + +{ TdxCustomGridTableViewFormatter } + +constructor TdxCustomGridTableViewFormatter.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited; + FRecordIndexes := TList.Create; + FSelectedRecordList := TList.Create; + //if ReportLink.OptionsSelection.ProcessSelection then BuildSelectedRecordList; {moved to BeforeBuilding in 3.03} +end; + +destructor TdxCustomGridTableViewFormatter.Destroy; +begin + FreeAndNil(FRecordIndexes); + FreeAndNil(FSelectedRecordList); + inherited; +end; + +function TdxCustomGridTableViewFormatter.Adapter: TdxCustomGridTableViewAdapter; +begin + Result := inherited Adapter as TdxCustomGridTableViewAdapter; +end; + +function TdxCustomGridTableViewFormatter.Builder: TdxCustomGridTableViewBuilder; +begin + Result := inherited Builder as TdxCustomGridTableViewBuilder; +end; + +function TdxCustomGridTableViewFormatter.IndexOfRecord(ARecord: TcxCustomGridRecord): Integer; +begin + for Result := 0 to RecordCount - 1 do + if Records[Result] = ARecord then Exit; + Result := -1; +end; + +procedure TdxCustomGridTableViewFormatter.DoInitializeItem(AnItem: TAbstractdxReportCellData; + ATableItem: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False); + + function GetContentBackgroundBitmapStyleIndex: Integer; + begin + if AnIsPreview then + Result := bbPreview + else + Result := Self.GetContentBackgroundBitmapStyleIndex(ATableItem); + end; + +var + Properties: TcxCustomEditProperties; + ViewParams: TdxReportItemViewParams; + CellValue: TcxEditValue; + ContentBackgroundBitmapStyleIndex: Integer; +begin + Properties := GetItemProperties(ATableItem, ARecord); + ViewParams := GetItemViewParams(ATableItem, ARecord, AnIsPreview); + CellValue := GetItemValue(Properties, ATableItem, ARecord); + dxPScxCommon.dxPSDataMaps.InitializeItem(AnItem, Properties, CellValue, Self, ViewParams, AnIsPreview, ARecord.RecordIndex); + dxPScxCommon.dxPSDataMaps.GetImageLists(Properties, ReportLink.AppendImageList); + SetViewParams(AnItem, ViewParams); + + ContentBackgroundBitmapStyleIndex := GetContentBackgroundBitmapStyleIndex; + if HasBackgroundBitmap(ContentBackgroundBitmapStyleIndex) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(ContentBackgroundBitmapStyleIndex); + + AnItem.Data := Integer(ATableItem); +end; + +function TdxCustomGridTableViewFormatter.GetItemClass(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False): TdxReportCellDataClass; +begin + Result := dxPSDataMaps.ItemClass(GetItemProperties(ATableItem, ARecord), AnIsPreview); +end; + +function TdxCustomGridTableViewFormatter.GetItemProperties(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxCustomEditProperties; +begin + Result := Adapter.GetProperties(ATableItem, ARecord); +end; + +function TdxCustomGridTableViewFormatter.GetItemValue(AProperties: TcxCustomEditProperties; + ATableItem: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord): TcxEditValue; +begin + if AProperties.GetEditValueSource(False) = evsValue then + Result := ARecord.Values[ATableItem.Index] + else + Result := ARecord.DisplayTexts[ATableItem.Index]; +end; + +function TdxCustomGridTableViewFormatter.GetItemViewParams(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False): TdxReportItemViewParams; +begin + FillChar(Result, 0, SizeOf(Result)); + if ReportLink.OptionsFormatting.UseNativeStyles then + if CanProcessSelectionStyle(ARecord) then + ReportLink.Styles.GetSelectionParams(Result.NativeParams) + else + if AnIsPreview then + ReportLink.Styles.GetPreviewParams(ARecord, ATableItem, Result.NativeParams) + else + ReportLink.Styles.GetContentParams(ARecord, ATableItem, Result.NativeParams) + else + if CanProcessSelectionStyle(ARecord) then + Result.NativeParams := Adapter.GetSelectionViewParams + else + if AnIsPreview then + Result.NativeParams := Adapter.GetPreviewViewParams(ARecord, ATableItem) + else + Result.NativeParams := Adapter.GetContentViewParams(ARecord, ATableItem); +end; + +{ IdxPSCellParams } + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetAutoHeight: Boolean; +begin + Result := Adapter.CellAutoHeight; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetDC: HDC; +begin + Result := Self.DC; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetDisplayGraphicsAsText: Boolean; +begin + Result := ReportLink.OptionsRefinements.DisplayGraphicsAsText; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetEndEllipsis: Boolean; +begin + Result := Adapter.CellEndEllipsis; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetFlatCheckMarks: Boolean; +begin + Result := ReportLink.OptionsRefinements.FlatCheckMarks; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetGraphicsText: string; +begin + Result := ReportLink.OptionsRefinements.GraphicsText; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetMultiline: Boolean; +begin + Result := Adapter.CellMultiline; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetTransparentGraphics: Boolean; +begin + Result := ReportLink.OptionsRefinements.TransparentGraphics; +end; + +{ IdxPSCellParams2 } +function TdxCustomGridTableViewFormatter.IdxPSCellParams2_GetPreviewMarginLeft: Integer; +begin + Result := dxTextSpace; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams2_GetPreviewMarginRight: Integer; +begin + Result := dxTextSpace; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams2_GetPreviewMaxHeight: Integer; +begin + Result := -1; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams2_GetPreviewMaxLineCount: Integer; +begin + Result := -1; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams2_GetRichEditGraphicClass: TGraphicClass; +const + GraphicClasses: array[Boolean] of TGraphicClass = (TMetafile, TBitmap); +begin + Result := GraphicClasses[IdxPSCellParams2_GetRichEditTransparent]; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams2_GetRichEditTransparent: Boolean; +begin + Result := False; +end; + +procedure TdxCustomGridTableViewFormatter.AfterBuilding; +begin + inherited; + ReportLink.ReportCells.BorderColor := GridLineColor; +end; + +procedure TdxCustomGridTableViewFormatter.BeforeBuilding; +begin + inherited; + if ReportLink.OptionsSelection.ProcessSelection then BuildSelectedRecordList; +end; + +procedure TdxCustomGridTableViewFormatter.BuildSelectedRecordList; +var + I: Integer; + ARecord: TcxCustomGridRecord; + IsRecordIncluded: Boolean; + Helper: TdxCustomGridRecordHelper; +begin + SelectedRecordList.Clear; + + for I := 0 to Adapter.RecordCount - 1 do + begin + ARecord := Adapter.Records[I]; + IsRecordIncluded := ARecord.Selected; + if not IsRecordIncluded then + begin + Helper := Adapter.RecordHelpers[ARecord]; + IsRecordIncluded := Helper.HasSelectedChildren or + (not ReportLink.OptionsSelection.ProcessExactSelection and (SelectedRecordList.IndexOf(Helper.Parent) <> -1)); + end; + + if IsRecordIncluded then + SelectedRecordList.Add(ARecord); + end; +end; + +function TdxCustomGridTableViewFormatter.CanProcessSelectionStyle(ARecord: TcxCustomGridRecord): Boolean; +begin + Result := (ARecord <> nil) and ReportLink.OptionsFormatting.ConsumeSelectionStyle and IsSelectedRecord(ARecord); + if Result and not ReportLink.OptionsFormatting.UseNativeStyles then + Result := Adapter.HasSelectionStyle; +end; + +function TdxCustomGridTableViewFormatter.IsSelectedRecord(ARecord: TcxCustomGridRecord): Boolean; +begin + Result := (SelectedRecordCount <> 0) or ARecord.Selected; +end; + +function TdxCustomGridTableViewFormatter.GetContentBackgroundBitmapStyleIndex(ATableItem: TcxCustomGridTableItem): Integer; +begin + Result := bbContent; +end; + +function TdxCustomGridTableViewFormatter.MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; +begin + case AGridBackgroundBitmapIndex of + bbContent: + Result := vspsGridContent; + else + Result := 0; + end; + + if Result = 0 then + Result := inherited MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex); +end; + +function TdxCustomGridTableViewFormatter.GetGridLineColor: TColor; +begin + Result := ReportLink.OptionsFormatting.GridLineColor; + if Result = clDefault then + Result := Adapter.GridLineColor; +end; + +function TdxCustomGridTableViewFormatter.GetRecord(Index: Integer): TcxCustomGridRecord; +begin + if SelectedRecordCount <> 0 then + Result := SelectedRecords[Index] + else + Result := Adapter.Records[Index]; +end; + +function TdxCustomGridTableViewFormatter.GetRecordCount: Integer; +begin + Result := SelectedRecordCount; + if Result = 0 then + Result := Adapter.RecordCount; +end; + +function TdxCustomGridTableViewFormatter.GetRecordIndex(ARecord: TcxCustomGridRecord): Integer; +var + RecordIndex, IndexCount, I: Integer; +begin + RecordIndex := ARecord.Index; + IndexCount := FRecordIndexes.Count; + if RecordIndex > IndexCount - 1 then + begin + FRecordIndexes.Count := RecordIndex + 1; + for I := IndexCount to FRecordIndexes.Count - 1 do + FRecordIndexes[I] := TObject(-1); + end; + Result := Integer(FRecordIndexes[RecordIndex]); + if Result = -1 then + begin + FRecordIndexes[RecordIndex] := TObject(IndexOfRecord(ARecord)); + Result := Integer(FRecordIndexes[RecordIndex]); + end; +end; + +function TdxCustomGridTableViewFormatter.GetSelectedRecord(Index: Integer): TcxCustomGridRecord; +begin + Result := FSelectedRecordList[Index]; +end; + +function TdxCustomGridTableViewFormatter.GetSelectedRecordCount: Integer; +begin + Result := FSelectedRecordList.Count; +end; + +{ TdxCustomGridTableViewBuilder } + +function TdxCustomGridTableViewBuilder.Adapter: TdxCustomGridTableViewAdapter; +begin + Result := inherited Adapter as TdxCustomGridTableViewAdapter; +end; + +class function TdxCustomGridTableViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxCustomGridTableViewAdapter; +end; + +function TdxCustomGridTableViewBuilder.Formatter: TdxCustomGridTableViewFormatter; +begin + Result := inherited Formatter as TdxCustomGridTableViewFormatter; +end; + +class function TdxCustomGridTableViewBuilder.FormatterClass: TdxGridViewFormatterClass; +begin + Result := TdxCustomGridTableViewFormatter; +end; + +procedure TdxCustomGridTableViewBuilder.DoBuildViewFooter; +begin + if Formatter.ShowFilterBar then + CreateFilterBar; + if Formatter.HasDetailsSeparator then + CreateBottomDetailsSeparator; + inherited; +end; + +procedure TdxCustomGridTableViewBuilder.DoBuildViewHeader; +begin + inherited; + if Formatter.HasDetailsSeparator then + CreateTopDetailsSeparator; + if Formatter.ShowCaption then + CreateCaption; +end; + +procedure TdxCustomGridTableViewBuilder.DoGetCellHeight(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem; var AHeight: Integer); +begin + ReportLink.DoGetCellHeight(GridView, ARecord, ATableItem, AHeight); +end; + +function TdxCustomGridTableViewBuilder.GridView: TcxCustomGridTableView; +begin + Result := inherited GridView as TcxCustomGridTableView; +end; + +class function TdxCustomGridTableViewBuilder.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridTableView; +end; + +{ TdxGridTableViewAdapter } + +constructor TdxGridTableViewAdapter.Create(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView); +begin + inherited; + GridTableViewInfo_CalculateExpandButtonParams(GridView.ViewInfo); // because LevelIndent +end; + +function TdxGridTableViewAdapter.GridView: TcxGridTableView; +begin + Result := inherited GridView as TcxGridTableView; +end; + +class function TdxGridTableViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridView; +end; + +function TdxGridTableViewAdapter.Styles: TcxGridTableViewStyles; +begin + Result := inherited Styles as TcxGridTableViewStyles; +end; + +function TdxGridTableViewAdapter.HasDetails(AGridRow: TcxCustomGridRow): Boolean; +begin + Result := RecordHelpers[AGridRow].HasDetails; +end; + +function TdxGridTableViewAdapter.GetGroupFooterCount(AGridRow: TcxCustomGridRow): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to AGridRow.Level do + if HasGroupFooter(AGridRow, I) then + Inc(Result); +end; + +function TdxGridTableViewAdapter.GetGroupFooterItemText(ARowIndex, ALevel, AIndex: Integer): string; +var + SummaryIndex: Integer; +begin + SummaryIndex := Summary.GroupFooterIndexOfItemLink[ALevel, Columns[AIndex]]; + if SummaryIndex <> -1 then + Result := Summary.GroupFooterSummaryTexts[ARowIndex, ALevel, SummaryIndex] + else + Result := ''; +end; + +function TdxGridTableViewAdapter.HasGroupFooter(AGridRow: TcxCustomGridRow; ALevel: Integer): Boolean; +begin + if GroupFootersMode <> gfInvisible then + begin + if GroupFootersMode = gfAlwaysVisible then + Dec(ALevel); + Result := (0 <= ALevel) and (ALevel < AGridRow.Level) and AGridRow.IsParentRecordLast[ALevel]; + if (AGridRow is TcxGridGroupRow) and (GroupFootersMode = gfAlwaysVisible) then + Result := Result or (ALevel = -1) and not AGridRow.Expanded; + end + else + Result := False; +end; + +function TdxGridTableViewAdapter.HasGroupFooterItem(ALevel, AIndex: Integer): Boolean; +begin + Result := Summary.GroupFooterIndexOfItemLink[ALevel, Columns[AIndex]] <> -1; +end; + +function TdxGridTableViewAdapter.HasGroupFooters(AGridRow: TcxCustomGridRow): Boolean; +begin + Result := GetGroupFooterCount(AGridRow) <> 0; +end; + +function TdxGridTableViewAdapter.Controller: TcxGridTableController; +begin + Result := inherited Controller as TcxGridTableController; +end; + +function TdxGridTableViewAdapter.DataController: TcxGridDataController; +begin + Result := GridView.DataController; +end; + +function TdxGridTableViewAdapter.GetAutoWidth: Boolean; +begin + Result := GridView.OptionsView.ColumnAutoWidth; +end; + +function TdxGridTableViewAdapter.GetCellAutoHeight: Boolean; +begin + Result := inherited GetCellAutoHeight and (DetailsLineCount = 1) and not DataRowHeightAssigned; +end; + +function TdxGridTableViewAdapter.GetCellMultiline: Boolean; +begin + Result := inherited GetCellAutoHeight;// {3.1} and not DataRowHeightAssigned;// and (DetailsLineCount <> 1); +end; + +function TdxGridTableViewAdapter.GetHeaderAutoHeight: Boolean; +begin + Result := GridView.OptionsView.HeaderAutoHeight and not HeaderHeightAssigned; +end; + +function TdxGridTableViewAdapter.GetHeaderMultiline(Column: TcxGridColumn): Boolean; +begin + Result := HeaderAutoHeight or HeaderHeightAssigned; +end; + +function TdxGridTableViewAdapter.GetIndentCount: Integer; +begin + Result := inherited GetIndentCount + GroupedColumnCount; + if (Result <> 0) and (GroupedColumnCount <> 0) and IsOffice11StyleGrouping then + Dec(Result); +end; + +function TdxGridTableViewAdapter.GetIndentWidth: Integer; +begin + Result := GridView.ViewInfo.LevelIndent; +end; + +function TdxGridTableViewAdapter.GetIndicatorWidth: Integer; +begin + if GridView.OptionsView.Indicator then + Result := GridView.OptionsView.IndicatorWidth + else + Result := 0; +end; + +function TdxGridTableViewAdapter.GetIsOffice11StyleGrouping: Boolean; +begin + Result := False; +end; + +function TdxGridTableViewAdapter.GetViewWidthExtra: Integer; +var + IndentCount: Integer; +begin + Result := inherited GetViewWidthExtra; + IndentCount := GroupedColumnCount; + if (IndentCount <> 0) and IsOffice11StyleGrouping then + Dec(IndentCount); + Inc(Result, IndentCount * IndentWidth); +end; + +function TdxGridTableViewAdapter.GetDataRowHeight: Integer; +begin + Result := GridView.OptionsView.DataRowHeight; +end; + +function TdxGridTableViewAdapter.GetDataRowHeightAssigned: Boolean; +begin + Result := DataRowHeight <> 0; +end; + +function TdxGridTableViewAdapter.GetFooterHeight: Integer; +begin + Result := GridView.OptionsView.HeaderHeight; +end; + +function TdxGridTableViewAdapter.GetFooterHeightAssigned: Boolean; +begin + Result := False;//FooterHeight <> 0; {PS 3.01} +end; + +function TdxGridTableViewAdapter.GetGroupRowHeight: Integer; +begin + Result := GridView.OptionsView.GroupRowHeight; +end; + +function TdxGridTableViewAdapter.GetGroupRowHeightAssigned: Boolean; +begin + Result := GroupRowHeight <> 0; +end; + +function TdxGridTableViewAdapter.GetHeaderHeight: Integer; +begin + Result := GridView.OptionsView.HeaderHeight; +end; + +function TdxGridTableViewAdapter.GetHeaderHeightAssigned: Boolean; +begin + Result := HeaderHeight <> 0; +end; + +function TdxGridTableViewAdapter.GetFilterBarViewParams: TcxViewParams; +begin + Styles.GetViewParams(vsFilterBox, nil, nil, Result); +end; + +function TdxGridTableViewAdapter.GetFooterViewParams(ARecord: TcxCustomGridRecord; + AGroupLevel: Integer; AColumn: TcxGridColumn): TcxViewParams; +begin + if (AColumn <> nil) and (AColumn.Styles <> nil) then + AColumn.Styles.GetFooterParams(TcxCustomGridRow(ARecord), Result) + else + Styles.GetFooterParams(TcxCustomGridRow(ARecord), AColumn, Result); +end; + +function TdxGridTableViewAdapter.GetGroupRowViewParams(ARecord: TcxCustomGridRecord; + AGroupLevel: Integer): TcxViewParams; +begin + Styles.GetGroupParams(ARecord, AGroupLevel, Result); +end; + +function TdxGridTableViewAdapter.GetHeaderViewParams(AColumn: TcxGridColumn): TcxViewParams; +begin + if (AColumn <> nil) and (AColumn.Styles <> nil) then + AColumn.Styles.GetHeaderParams(Result) + else + Styles.GetHeaderParams(AColumn, Result); + if AColumn = nil then + Result.Color := LookAndFeelPainter.DefaultHeaderBackgroundColor; +end; + +function TdxGridTableViewAdapter.GetPreviewViewParams(ARecord: TcxCustomGridRecord; + AnItem: TcxCustomGridTableItem): TcxViewParams; +begin + Styles.GetPreviewParams(ARecord, TcxGridColumn(AnItem), Result); + // 3.2 + if Result.Color = clWindow then + Result.Color := dxPSCore.dxDefaultContentColor; +end; + +function TdxGridTableViewAdapter.GetColumn(Index: Integer): TcxGridColumn; +begin + Result := GridView.VisibleColumns[Index]; +end; + +function TdxGridTableViewAdapter.GetColumnCount: Integer; +begin + Result := GridView.VisibleColumnCount; +end; + +function TdxGridTableViewAdapter.GetExpandButtonColor: TColor; +begin + Result := ExpandButtonInteriorColor; +end; + +function TdxGridTableViewAdapter.GetExpandButtonSize: Integer; +begin + Result := GridView.ViewInfo.ExpandButtonSize; +end; + +function TdxGridTableViewAdapter.GetFooterItemText(Index: Integer): string; +var + SummaryIndex: Integer; +begin + SummaryIndex := Summary.FooterSummaryItems.IndexOfItemLink(Columns[Index]); + if SummaryIndex <> -1 then + Result := Summary.FooterSummaryTexts[SummaryIndex] + else + Result := ''; +end; + +function TdxGridTableViewAdapter.GetFooterMultiline: Boolean; +begin + Result := False; +end; + +function TdxGridTableViewAdapter.GetGridLineColor: TColor; +begin + Result := GridView.OptionsView.GridLineColor; + if Result = clDefault then + Result := GridView.LookAndFeelPainter.DefaultGridLineColor; +end; + +function TdxGridTableViewAdapter.GetGridLines: TcxGridLines; +begin + Result := GridView.OptionsView.GridLines; +end; + +function TdxGridTableViewAdapter.GetGroupedColumn(Index: Integer): TcxGridColumn; +begin + Result := GridView.GroupedColumns[Index]; +end; + +function TdxGridTableViewAdapter.GetGroupedColumnCount: Integer; +begin + Result := GridView.GroupedColumnCount; +end; + +function TdxGridTableViewAdapter.GetGroupFootersMode: TcxGridGroupFootersMode; +begin + Result := GridView.OptionsView.GroupFooters; +end; + +function TdxGridTableViewAdapter.GetGroupFootersMultiline: Boolean; +begin + Result := False; +end; + +function TdxGridTableViewAdapter.GetGroupRowSeparatorColor: TColor; +begin + Result := clBtnFace; +end; + +function TdxGridTableViewAdapter.GetGroupRowSeparatorThickness: Integer; +begin + Result := 2; +end; + +function TdxGridTableViewAdapter.GetHasFooterItem(Index: Integer): Boolean; +begin + Result := Summary.FooterSummaryItems.IndexOfItemLink(Columns[Index]) <> -1; +end; + +function TdxGridTableViewAdapter.GetHasPreview: Boolean; +begin + Result := PreviewColumn <> nil; +end; + +function TdxGridTableViewAdapter.GetHasRowSeparators: Boolean; +begin + Result := RowSeparatorThickness > 0; +end; + +function TdxGridTableViewAdapter.GetHeaderEndEllipsis: Boolean; +begin + Result := GridView.OptionsView.HeaderEndEllipsis; +end; + +function TdxGridTableViewAdapter.GetInternalColumnMinWidth(Column: TcxGridColumn): Integer; +begin + Result := Column.MinWidth; + if Column.IsMostLeft then + Inc(Result, IndentCount * IndentWidth); +end; + +function TdxGridTableViewAdapter.GetInternalColumnWidth(Column: TcxGridColumn): Integer; +begin + Result := Column.Width; + if Column.IsMostLeft then + Inc(Result, IndentCount * IndentWidth); +end; + +function TdxGridTableViewAdapter.GetPreviewColumn: TcxGridColumn; +begin + Result := GridView.Preview.Column; +end; + +function TdxGridTableViewAdapter.GetPreviewLeftIndent: Integer; +begin + Result := GridView.Preview.LeftIndent; +end; + +function TdxGridTableViewAdapter.GetPreviewPlace: TcxGridPreviewPlace; +begin + Result := GridView.Preview.Place; +end; + +function TdxGridTableViewAdapter.GetPreviewRightIndent: Integer; +begin + Result := GridView.Preview.RightIndent; +end; + +function TdxGridTableViewAdapter.GetRow(Index: Integer): TcxCustomGridRow; +begin + Result := TcxCustomGridRow(Records[Index]); +end; + +function TdxGridTableViewAdapter.GetRowCount: Integer; +begin + Result := RecordCount; +end; + +function TdxGridTableViewAdapter.GetRowSeparatorColor: TColor; +begin + Result := GridView.OptionsView.RowSeparatorColor; +end; + +function TdxGridTableViewAdapter.GetRowSeparatorThickness: Integer; +begin + Result := GridView.OptionsView.RowSeparatorWidth; +end; + +function TdxGridTableViewAdapter.GetShowExpandButtonsForEmptyDetails: Boolean; +begin + Result := True; +end; + +function TdxGridTableViewAdapter.GetShowHorzGridLines: Boolean; +begin + Result := GridLines in [glBoth, glHorizontal]; +end; + +function TdxGridTableViewAdapter.GetShowVertGridLines: Boolean; +begin + Result := GridLines in [glBoth, glVertical]; +end; + +function TdxGridTableViewAdapter.GetThemedFooterItemColor: TColor; +begin + Result := LookAndFeelPainter.DefaultFooterColor; +end; + +function TdxGridTableViewAdapter.GetThemedFooterItemTextColor: TColor; +begin + Result := LookAndFeelPainter.DefaultFooterTextColor; +end; + +function TdxGridTableViewAdapter.GetThemedHeaderItemColor: TColor; +begin + Result := LookAndFeelPainter.DefaultHeaderColor; +end; + +function TdxGridTableViewAdapter.GetThemedHeaderItemTextColor: TColor; +begin + Result := LookAndFeelPainter.DefaultHeaderTextColor; +end; + +{ TdxCustomGridTableViewItemPlaceController } + +constructor TdxCustomGridTableViewItemPlaceController.Create(AFormatter: TdxGridTableViewFormatter); +begin + inherited Create; + FFormatter := AFormatter; + FHeaderLineCount := -1; + FWidth := -1; +end; + +procedure TdxCustomGridTableViewItemPlaceController.Calculate; +begin +end; + +procedure TdxCustomGridTableViewItemPlaceController.Refresh; +begin +end; + +function TdxCustomGridTableViewItemPlaceController.CalculateHeaderLineCount: Integer; +begin + Result := 1; +end; + +function TdxCustomGridTableViewItemPlaceController.CalculateWidth: Integer; +begin + Result := 0; +end; + +function TdxCustomGridTableViewItemPlaceController.GetItemByColumn(Column: TcxGridColumn): TdxGridTableViewColumnPlace; +begin + Result := nil; +end; + +procedure TdxCustomGridTableViewItemPlaceController.WidthChanged; +begin +end; + +function TdxCustomGridTableViewItemPlaceController.GetHeaderLineCount: Integer; +begin + if FHeaderLineCount = -1 then + FHeaderLineCount := CalculateHeaderLineCount; + Result := FHeaderLineCount; +end; + +function TdxCustomGridTableViewItemPlaceController.GetWidth: Integer; +begin + if FWidth = -1 then + FWidth := CalculateWidth; + Result := FWidth; +end; + +procedure TdxCustomGridTableViewItemPlaceController.SetWidth(Value: Integer); +begin + FWidth := Value; + WidthChanged; +end; + +{ TdxGridTableViewColumnPlace } + +constructor TdxGridTableViewColumnPlace.Create(AController: TdxGridTableViewColumnPlaceController; + AColumn: TcxGridColumn); +begin + inherited Create; + FController := AController; + FColumn := AColumn; + + FLeftBound := -1; + FWidth := -1; +end; + +procedure TdxGridTableViewColumnPlace.Calculate(ALeftBound: Integer); +begin + FLeftBound := ALeftBound; +end; + +function TdxGridTableViewColumnPlace.CalculateLeftBound: Integer; +begin + Result := Controller.CalculateItemLeftBound(Self); +end; + +function TdxGridTableViewColumnPlace.GetLineCount: Integer; +begin + Result := 1; +end; + +function TdxGridTableViewColumnPlace.GetRowIndex: Integer; +begin + Result := 0; +end; + +procedure TdxGridTableViewColumnPlace.InitAutoWidthItem(AnItem: TcxAutoWidthItem); +begin + AnItem.Fixed := IsFixed; + AnItem.MinWidth := MinWidth; + AnItem.Width := Width; +end; + +function TdxGridTableViewColumnPlace.GetAdapter: TdxGridTableViewAdapter; +begin + Result := Formatter.Adapter; +end; + +function TdxGridTableViewColumnPlace.GetCellBounds(RowIndex: Integer): TRect; +var + CellHeight: Integer; +begin + CellHeight := CellHeights[RowIndex]; + with Result do + begin + Left := LeftBound; + Top := Self.RowIndex * CellHeight; + Right := Left + Width; + Bottom := Top + LineCount * CellHeight; + end; + + if Column.IsMostLeft then + Inc(Result.Left, Formatter.ViewWidthExtra); +end; + +function TdxGridTableViewColumnPlace.GetCellHeight(RowIndex: Integer): Integer; +begin + Result := Formatter.RowHeights[RowIndex]; +end; + +function TdxGridTableViewColumnPlace.GetFooterCellBounds: TRect; +begin + with Result do + begin + Left := LeftBound; + Top := RowIndex * FooterLineHeight; + Right := Left + Width; + Bottom := Top + LineCount * FooterLineHeight; + end; + + InflateRect(Result, -FooterItemInflateHorz, -FooterItemInflateVert); + if Column.IsMostLeft then + Inc(Result.Left, 2); +end; + +function TdxGridTableViewColumnPlace.GetFooterLineHeight: Integer; +begin + Result := Formatter.FooterLineHeight; +end; + +function TdxGridTableViewColumnPlace.GetFormatter: TdxGridTableViewFormatter; +begin + Result := Controller.Formatter; +end; + +function TdxGridTableViewColumnPlace.GetGroupFooterCellBounds(IndentCount: Integer): TRect; +var + V: Integer; +begin + with Result do + begin + Left := LeftBound; + Top := RowIndex * GroupFooterLineHeight; + Right := Left + Width; + Bottom := Top + LineCount * GroupFooterLineHeight; + end; + + V := IndentCount * Formatter.IndentWidth; + OffsetRect(Result, -V, 0); + if Column.IsMostLeft then + Inc(Result.Left, V); + + InflateRect(Result, -FooterItemInflateHorz, -FooterItemInflateVert); + if Column.IsMostLeft then + Inc(Result.Left, 2); +end; + +function TdxGridTableViewColumnPlace.GetGroupFooterLineHeight: Integer; +begin + Result := Formatter.GroupFooterLineHeight; +end; + +function TdxGridTableViewColumnPlace.GetHeaderCellBounds: TRect; +begin + with Result do + begin + Left := LeftBound; + Top := RowIndex * HeaderLineHeight; + Right := Left + Width; + Bottom := Top + LineCount * HeaderLineHeight; + end; +end; + +function TdxGridTableViewColumnPlace.GetHeaderLineHeight: Integer; +begin + Result := Formatter.HeaderLineHeight; +end; + +function TdxGridTableViewColumnPlace.GetIndex: Integer; +begin + Result := Controller.IndexOf(Self); +end; + +function TdxGridTableViewColumnPlace.GetIsFixed: Boolean; +begin + Result := GridColumn_GetFixed(Column); +end; + +function TdxGridTableViewColumnPlace.GetLeftBound: Integer; +begin + if FLeftBound = -1 then + FLeftBound := CalculateLeftBound; + Result := FLeftBound; +end; + +function TdxGridTableViewColumnPlace.GetMinWidth: Integer; +begin + Result := Adapter.InternalColumnMinWidths[Column]; +end; + +function TdxGridTableViewColumnPlace.GetOriginalWidth: Integer; +begin + Result := Adapter.InternalColumnWidths[Column]; +end; + +function TdxGridTableViewColumnPlace.GetWidth: Integer; +begin + Result := FWidth; + if Result = -1 then + Result := OriginalWidth; +end; + +{ TdxGridTableViewColumnPlaceController } + +constructor TdxGridTableViewColumnPlaceController.Create(AFormatter: TdxGridTableViewFormatter); +begin + inherited; + FColumnIndexes := TList.Create; + FItems := TList.Create; + FWidth := -1; +end; + +destructor TdxGridTableViewColumnPlaceController.Destroy; +begin + FreeAndNilItems; + FreeAndNil(FColumnIndexes); + inherited; +end; + +procedure TdxGridTableViewColumnPlaceController.Calculate; +begin + if ItemsAutoWidth then CalculateItemsWidth; +end; + +procedure TdxGridTableViewColumnPlaceController.Refresh; +begin + FColumnIndexes.Clear; + ClearItems; + AddItems; +end; + +function TdxGridTableViewColumnPlaceController.IndexOf(AnItem: TdxGridTableViewColumnPlace): Integer; +begin + Result := FItems.IndexOf(AnItem); +end; + +function TdxGridTableViewColumnPlaceController.IndexOf(AColumn: TcxGridColumn): Integer; +begin + for Result := 0 to ItemCount - 1 do + if Items[Result].Column = AColumn then + Exit; + Result := -1; +end; + +function TdxGridTableViewColumnPlaceController.CalculateWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to ItemCount - 1 do + Inc(Result, Items[I].Width); +end; + +function TdxGridTableViewColumnPlaceController.GetItemByColumn(Column: TcxGridColumn): TdxGridTableViewColumnPlace; +var + Index: Integer; +begin + Index := ColumnIndexes[Column]; + //Index := IndexOf(Column); + if Index <> -1 then // might be -1 when we are in loading stage (Building report while loading form) + Result := Items[Index] + else + Result := nil; +end; + +procedure TdxGridTableViewColumnPlaceController.AddItems; +var + I: Integer; +begin + for I := 0 to Formatter.ColumnCount - 1 do + CreateItem(Formatter.Columns[I]); +end; + +procedure TdxGridTableViewColumnPlaceController.ClearItems; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + Items[I].Free; + FItems.Clear; +end; + +function TdxGridTableViewColumnPlaceController.CreateItem(AColumn: TcxGridColumn): TdxGridTableViewColumnPlace; +begin + Result := GetItemClass(AColumn).Create(Self, AColumn); + FItems.Add(Result); +end; + +function TdxGridTableViewColumnPlaceController.GetItemClass(AColumn: TcxGridColumn): TdxGridTableViewColumnPlaceClass; +begin + Result := TdxGridTableViewColumnPlace; +end; + +function TdxGridTableViewColumnPlaceController.CalculateItemLeftBound(AnItem: TdxGridTableViewColumnPlace): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to AnItem.Index - 1 do + Inc(Result, Items[I].Width); +end; + +procedure TdxGridTableViewColumnPlaceController.CalculateItemsWidth; +var + AutoWidthObject: TcxAutoWidthObject; + I: Integer; +begin + AutoWidthObject := TcxAutoWidthObject.Create(ItemCount); + try + for I := 0 to ItemCount - 1 do + Items[I].InitAutoWidthItem(AutoWidthObject.AddItem); + AutoWidthObject.AvailableWidth := ItemsAvailableWidth; + AutoWidthObject.Calculate; + + for I := 0 to ItemCount - 1 do + Items[I].Width := AutoWidthObject[I].AutoWidth; + finally + AutoWidthObject.Free; + end; +end; + +function TdxGridTableViewColumnPlaceController.GetItemsAutoWidth: Boolean; +begin + Result := Formatter.AutoWidth; +end; + +function TdxGridTableViewColumnPlaceController.GetItemsAvailableWidth: Integer; +begin + Result := Formatter.ViewAvailableWidth; +end; + +function TdxGridTableViewColumnPlaceController.GetAdapter: TdxGridTableViewAdapter; +begin + Result := Formatter.Adapter; +end; + +function TdxGridTableViewColumnPlaceController.GetColumnIndex(Column: TcxGridColumn): Integer; +var + ColumnIndex, IndexCount, I: Integer; +begin + ColumnIndex := Column.Index; + IndexCount := FColumnIndexes.Count; + if ColumnIndex > IndexCount - 1 then + begin + FColumnIndexes.Count := ColumnIndex + 1; + for I := IndexCount to FColumnIndexes.Count - 1 do + FColumnIndexes[I] := TObject(-1); + end; + Result := Integer(FColumnIndexes[ColumnIndex]); + if Result = -1 then + begin + FColumnIndexes[ColumnIndex] := TObject(IndexOf(Column)); + Result := Integer(FColumnIndexes[ColumnIndex]); + end; +end; + +function TdxGridTableViewColumnPlaceController.GetItem(Index: Integer): TdxGridTableViewColumnPlace; +begin + Result := FItems.List[Index]; +end; + +function TdxGridTableViewColumnPlaceController.GetItemCount: Integer; +begin + Result := FItems.Count; +end; + +procedure TdxGridTableViewColumnPlaceController.FreeAndNilItems; +begin + ClearItems; + FreeAndNil(FItems); +end; + +{ TdxGridTableViewReportDataAdapter } + +constructor TdxGridTableViewReportDataAdapter.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited Create; + FBuilder := ABuilder; +end; + +function TdxGridTableViewReportDataAdapter.GetReportItem(Row: TcxCustomGridRow; + Column: TcxGridColumn): TdxReportVisualItem; +var + ReportRow: TdxReportCell; + I: Integer; +begin + ReportRow := ReportRowsByGridRow[Row]; + if ReportRow <> nil then + for I := 0 to ReportRow.DataItemCount - 1 do + begin + Result := ReportRow.DataItems[I]; + if Result.Data = Integer(Column) then Exit; + end; + Result := nil; +end; + +function TdxGridTableViewReportDataAdapter.GetReportRow(Index: Integer): TdxReportCell; +begin + Result := Builder.ReportRows[Index]; +end; + +function TdxGridTableViewReportDataAdapter.GetReportRowByGridRow(Row: TcxCustomGridRow): TdxReportCell; +var + I: Integer; +begin + for I := 0 to ReportRowCount - 1 do + if ReportRows[I].CellCount <> 0 then + begin + Result := ReportRows[I].Cells[0]; + if Result.Data = Integer(Row) then Exit; + end; + Result := nil; +end; + +function TdxGridTableViewReportDataAdapter.GetReportRowCount: Integer; +begin + Result := Builder.ReportRowCount; +end; + +{ TdxGridTableViewFormatter } + +constructor TdxGridTableViewFormatter.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited; + FColumns := TList.Create; + FItemPlaceController := GetItemPlaceControllerClass.Create(Self); + FReportDataAdapter := TdxGridTableViewReportDataAdapter.Create(ABuilder); + FRowHeights := TList.Create; +end; + +destructor TdxGridTableViewFormatter.Destroy; +begin + FreeAndNil(FRowHeights); + FreeAndNil(FItemPlaceController); + FreeAndNil(FReportDataAdapter); + FreeAndNil(FColumns); + inherited; +end; + +function TdxGridTableViewFormatter.Adapter: TdxGridTableViewAdapter; +begin + Result := Builder.Adapter; +end; + +function TdxGridTableViewFormatter.Builder: TdxGridTableViewBuilder; +begin + Result := inherited Builder as TdxGridTableViewBuilder; +end; + +procedure TdxGridTableViewFormatter.DoInitializeFooterItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +var + Column: TcxGridColumn; +begin + Column := Columns[AnIndex]; + SetViewParams(AnItem, GetFooterItemViewParams(Column)); + if HasBackgroundBitmap(bbFooter) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbFooter); + + RegisterLookAndFeelItem(AnItem, cesSunken); + + with AnItem as TdxReportCellString do + begin + Data := Integer(Column); + Text := Adapter.FooterItemTexts[AnIndex]; + Multiline := Adapter.FooterMultiline; + TextAlignX := TextAlignXMap[Column.FooterAlignmentHorz]; + if Multiline then + TextAlignY := taTop + else + TextAlignY := taCenterY; + end; +end; + +procedure TdxGridTableViewFormatter.DoInitializeFooterRow(ARow: TdxReportCell); +begin + SetViewParams(ARow, GetFooterItemViewParams(nil)); + RegisterLookAndFeelItem(ARow, cesRaised); + ARow.Data := Integer(TdxGridFooter); +end; + +procedure TdxGridTableViewFormatter.DoReportLinkInitializeFooterItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +begin + ReportLink.DoInitializeFooterCell(Adapter.GridView, nil, Columns[AnIndex], 0, TdxReportCellString(AnItem)); +end; + +function TdxGridTableViewFormatter.GetFooterItemBounds(AnIndex: Integer): TRect; +var + Item: TdxGridTableViewColumnPlace; +begin + Item := ItemPlaceController[Columns[AnIndex]]; + if Item <> nil then + Result := Item.FooterCellBounds + else + Result := dxPSGlbl.NullRect; +end; + +function TdxGridTableViewFormatter.GetFooterItemClass(AnIndex: Integer): TdxReportCellTextClass; +begin + Result := TdxReportCellString; +end; + +function TdxGridTableViewFormatter.GetFooterItemViewParams(AColumn: TcxGridColumn): TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetFooterParams(nil, -1, AColumn, Result.NativeParams) + else + Result.NativeParams := Adapter.GetFooterViewParams(nil, -1, AColumn); + + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + if AColumn <> nil then + begin + Result.NativeParams.Color := Adapter.ThemedFooterItemColor; + Result.NativeParams.TextColor := Adapter.ThemedFooterItemTextColor; + end; + + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.FixedTransparent; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupFooterHost(AnItem: TdxReportVisualItem; + ARecord: TcxCustomGridRecord); +begin + SetViewParams(AnItem, GetGroupFooterItemViewParams(nil, -1, nil)); + RegisterLookAndFeelItem(AnItem, cesRaised); + AnItem.Data := Integer(ARecord); +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupFooterItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer; ARecord: TcxCustomGridRecord; AGroupLevel: Integer); +var + Column: TcxGridColumn; +begin + Column := Columns[AnIndex]; + SetViewParams(AnItem, GetGroupFooterItemViewParams(ARecord, AGroupLevel, Column)); + if HasBackgroundBitmap(bbFooter) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbFooter); + RegisterLookAndFeelItem(AnItem, cesSunken); + + with TdxReportCellString(AnItem) do + begin + Data := Integer(Column); + Multiline := Adapter.GetGroupFootersMultiline; + Text := Adapter.GetGroupFooterItemText(ARecord.Index, AGroupLevel, AnIndex); + TextAlignX := TextAlignXMap[Column.FooterAlignmentHorz]; + if Multiline then + TextAlignY := taTop + else + TextAlignY := taCenterY; + end; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupFooterRow(ARow: TdxReportCell; + ARecord: TcxCustomGridRecord; AGroupLevel: Integer); +begin + ARow.CellSides := csLeftRight; + ARow.Data := AGroupLevel; //v3.0 ARecord.Level; + ARow.Transparent := True; +end; + +procedure TdxGridTableViewFormatter.DoReportLinkInitializeGroupFooterItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer; ARecord: TcxCustomGridRecord; AGroupLevel: Integer); +begin + ReportLink.DoInitializeFooterCell(Adapter.GridView, ARecord, Columns[AnIndex], + AGroupLevel, TdxReportCellString(AnItem)); +end; + +function TdxGridTableViewFormatter.GetGroupFooterItemBounds(AnIndex, AGroupLevel: Integer): TRect; +var + Item: TdxGridTableViewColumnPlace; +begin + Item := ItemPlaceController[Columns[AnIndex]]; + if Item <> nil then + Result := Item.GroupFooterCellBounds[AGroupLevel] + else + Result := dxPSGlbl.NullRect; +end; + +function TdxGridTableViewFormatter.GetGroupFooterItemClass(AnIndex: Integer): TdxReportCellTextClass; +begin + Result := TdxReportCellString; +end; + +function TdxGridTableViewFormatter.GetGroupFooterItemViewParams(ARecord: TcxCustomGridRecord; + AGroupLevel: Integer; AColumn: TcxGridColumn): TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetFooterParams(ARecord, AGroupLevel, AColumn, Result.NativeParams) + else + Result.NativeParams := Adapter.GetFooterViewParams(ARecord, AGroupLevel, AColumn); + + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + if AColumn <> nil then + begin + Result.NativeParams.Color := Adapter.ThemedFooterItemColor; + Result.NativeParams.TextColor := Adapter.ThemedFooterItemTextColor; + end; + + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.FixedTransparent; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupRowItem(AnItem: TAbstractdxReportCellData; + ARow: TcxGridGroupRow); +begin + SetViewParams(AnItem, GetGroupRowViewParams(ARow, ARow.Level)); + if HasBackgroundBitmap(bbGroup) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbGroup); + + with AnItem as TdxReportCellString do + begin + Data := Integer(Adapter.GroupedColumns[ARow.Level]); + Text := ARow.DisplayText; + TextAlignX := taLeft; + if Adapter.IsOffice11StyleGrouping then TextAlignY := taBottom; {.2} + end; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupRow(ARow: TdxReportCell; + ARecord: TcxCustomGridRecord); +begin + ReportLink.AddReportRow(ARow); + + ARow.CellSides := []; + ARow.Data := Integer(ARecord); + ARow.Transparent := True; +end; + +function TdxGridTableViewFormatter.GetGroupRowClass: TdxReportCellTextClass; +begin + Result := TdxReportCellString; +end; + +function TdxGridTableViewFormatter.GetGroupRowViewParams(ARecord: TcxCustomGridRecord; + ALevel: Integer): TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + if CanProcessSelectionStyle(ARecord) then + ReportLink.Styles.GetSelectionParams(Result.NativeParams) + else + ReportLink.Styles.GetGroupParams(ARecord, ALevel, Result.NativeParams) + else + if CanProcessSelectionStyle(ARecord) then + Result.NativeParams := Adapter.GetSelectionViewParams + else + Result.NativeParams := Adapter.GetGroupRowViewParams(ARecord, ALevel); + + Result.CellSides := CellSidesMap[Adapter.GridLines] - [csLeft] + [csRight]; + if ARecord.Index = 0 then + Result.CellSides := Result.CellSides + [csTop]; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.FixedTransparent; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupRowSeparator(ASeparator: TAbstractdxReportCellData); +begin + ASeparator.CellSides := csAll; + ASeparator.Color := GroupRowSeparatorColor; + ASeparator.Transparent := IsColorTransparent(ASeparator.Color); //ReportLink.Transparent; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupSeparatorRow(ARow: TdxReportCell); +begin + ARow.CellSides := csLeftRight; + ARow.Transparent := True; +end; + +function TdxGridTableViewFormatter.GetGroupRowSeparatorClass: TdxReportCellDataClass; +begin + Result := TdxReportCellBox; +end; + +procedure TdxGridTableViewFormatter.DoInitializeHeaderItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +var + Column: TcxGridColumn; +begin + Column := Columns[AnIndex]; + SetViewParams(AnItem, GetHeaderItemViewParams(Column)); + if HasBackgroundBitmap(bbHeader) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbHeader); + RegisterLookAndFeelItem(AnItem, cesRaised); + + with AnItem as TdxReportCellImage do + begin + Data := Integer(Column); + EndEllipsis := Adapter.HeaderEndEllipsis; + if (Column.HeaderGlyph <> nil) and not Column.HeaderGlyph.Empty then + begin + Image := Column.HeaderGlyph; + ImageLayout := HeaderImageLayoutMap[Column.HeaderGlyphAlignmentHorz, Column.HeaderGlyphAlignmentVert]; + IsTextDrawnForCenteredImage := True; + IsTextShiftedForHorizontallyCenteredImage := + not (ImageLayout in [ilImageTopCenter, ilImageCenterCenter, ilImageBottomCenter]) and (Text <> ''); + end; + Multiline := Adapter.HeaderMultilines[Column]; + SortOrder := SortOrderMap[Column.SortOrder]; + Text := Column.Caption; + TextAlignX := TextAlignXMap[Column.HeaderAlignmentHorz]; + if Multiline then + TextAlignY := TextAlignYMap[Column.HeaderAlignmentVert] + else + TextAlignY := taCenterY; + Transparent := Transparent {!!! v3.1} or not IsTextShiftedForHorizontallyCenteredImage; // TODO: Check + end; +end; + +procedure TdxGridTableViewFormatter.DoInitializeHeaderRow(ARow: TdxReportCell); +begin + SetViewParams(ARow, GetHeaderItemViewParams(nil)); + ARow.Data := Integer(TdxGridHeader); +end; + +procedure TdxGridTableViewFormatter.DoReportLinkInitializeHeaderItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +begin + ReportLink.DoInitializeHeaderCell(Adapter.GridView, Columns[AnIndex], TdxReportCellString(AnItem)); +end; + +function TdxGridTableViewFormatter.GetHeaderItemBounds(AnIndex: Integer): TRect; +var + Item: TdxGridTableViewColumnPlace; +begin + Item := ItemPlaceController[Columns[AnIndex]]; + if Item <> nil then + Result := Item.HeaderCellBounds + else + Result := dxPSGlbl.NullRect; +end; + +function TdxGridTableViewFormatter.GetHeaderItemClass(AnIndex: Integer): TdxReportCellTextClass; +begin + Result := TdxReportCellImage; +end; + +function TdxGridTableViewFormatter.GetHeaderItemViewParams(AColumn: TcxGridColumn): TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetHeaderParams(AColumn, Result.NativeParams) + else + Result.NativeParams := Adapter.GetHeaderViewParams(AColumn); + + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + if AColumn <> nil then + begin + Result.NativeParams.Color := Adapter.ThemedHeaderItemColor; + Result.NativeParams.TextColor := Adapter.ThemedHeaderItemTextColor; + end; + + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.FixedTransparent; +end; + +function TdxGridTableViewFormatter.CreateIndent(AParent: TdxReportCell): TdxReportCellExpandButton; +begin + Result := GetIndentClass.Create(AParent); +end; + +procedure TdxGridTableViewFormatter.DoInitializeDataRowIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); +begin + SetViewParams(AnIndent, GetIndentViewParams(ARecord, AnIndex, AnIndentCount, False)); + if HasBackgroundBitmap(bbGroup) then + AnIndent.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbGroup); +end; + +procedure TdxGridTableViewFormatter.DoInitializeExpandButton(AnExpandButton: TdxReportCellExpandButton; + ARecord: TcxCustomGridRecord; AnIsMasterIndent: Boolean); +begin + with AnExpandButton do + begin + {3.1 added} + ButtonAlignHorz := bahCenter; + if Adapter.IsOffice11StyleGrouping and not AnIsMasterIndent then {.2} + ButtonAlignVert := bavBottom + else + ButtonAlignVert := bavCenter; + + ButtonExpanded := ARecord.Expanded; + ButtonSize := Adapter.ExpandButtonSize; + if (ReportLink.OptionsFormatting.LookAndFeelKind <> lfStandard) and not Odd(ButtonSize) then + ButtonSize := ButtonSize - 1; + ButtonInteriorColor := Adapter.ExpandButtonColor; + ButtonTransparent := IsColorTransparent(ButtonInteriorColor); + end; + RegisterExpandButton(AnExpandButton); +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupFooterIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); +begin + SetViewParams(AnIndent, GetIndentViewParams(ARecord, AnIndex, AnIndentCount, True)); + + if HasBackgroundBitmap(bbGroup) then + AnIndent.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbGroup); + +// if (AIndex = AIndentCount - 1) and Adapter.ShowHorzGridLines then +// AIndent.CellSides := AIndent.CellSides + [csBottom]; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupRowIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); +begin + SetViewParams(AnIndent, GetIndentViewParams(ARecord, AnIndex, AnIndentCount, False)); + if HasBackgroundBitmap(bbGroup) then + AnIndent.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbGroup); + + if AnIndex = AnIndentCount - 1 then + begin + AnIndent.CellSides := AnIndent.CellSides - [csRight]; + if Adapter.ShowHorzGridLines then + AnIndent.CellSides := AnIndent.CellSides + [csTop]; + //if Adapter.IsOffice11StyleGrouping then + // AnIndent.CellSides := AnIndent.CellSides + [csBottom]; + + AnIndent.ShowButton := HasExpandButton(ARecord); + if AnIndent.ShowButton then + DoInitializeExpandButton(AnIndent, ARecord, False); + end; +end; + +procedure TdxGridTableViewFormatter.DoInitializeMasterDataRowIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); +begin + { DoInitializeMasterIndent -> ARecord = nil } + SetViewParams(AnIndent, GetIndentViewParams(ARecord, AnIndex, AnIndentCount, False)); + if AnIndex = AnIndentCount - 1 then + if HasBackgroundBitmap(bbContent) then + AnIndent.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbContent) + else + else + if HasBackgroundBitmap(bbGroup) then + AnIndent.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbGroup); + + if (ARecord <> nil) and (AnIndex = AnIndentCount - 1) then + begin + AnIndent.CellSides := AnIndent.CellSides - [csRight]; + if Adapter.ShowHorzGridLines then + AnIndent.CellSides := AnIndent.CellSides + [csTop]; + if not ARecord.Expanded then + AnIndent.CellSides := AnIndent.CellSides + [csBottom]; + + AnIndent.ShowButton := ReportLink.OptionsView.ExpandButtons and ARecord.Expandable; + if AnIndent.ShowButton then + DoInitializeExpandButton(AnIndent, ARecord, True); + end; +end; + +procedure TdxGridTableViewFormatter.DoInitializeRowSeparatorIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); +begin + SetViewParams(AnIndent, GetIndentViewParams(ARecord, AnIndex, AnIndentCount, True)); + if HasBackgroundBitmap(bbGroup) then + AnIndent.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbGroup); +end; + +function TdxGridTableViewFormatter.GetIndentClass: TdxReportCellExpandButtonClass; +begin + if Adapter.IsOffice11StyleGrouping then + Result := TdxReportCellExpandButtonEx + else + Result := TdxReportCellExpandButton; +end; + +function TdxGridTableViewFormatter.GetIndentViewParams(ARecord: TcxCustomGridRecord; + AnIndex, AnIndentCount: Integer; ANonRecordIndent: Boolean): TdxReportItemViewParams; + + function IsMasterDataRowIndent: Boolean; + begin + with Adapter do + Result := AnIndex >= GroupedColumnCount - Ord(IsOffice11StyleGrouping and not (ARecord is TcxGridGroupRow)); + end; + + function GetRecord: TcxCustomGridRecord; + begin + if not ANonRecordIndent and (ARecord is TcxGridGroupRow) and (AnIndex = AnIndentCount - 1) then + Result := ARecord + else + Result := nil; + end; + +const + VertGridLinesMap: array[Boolean] of TdxCellSides = ([], csLeftRight); +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + if IsMasterDataRowIndent then + ReportLink.Styles.GetContentParams(Adapter.MasterGridRecord, nil, Result.NativeParams) + else + ReportLink.Styles.GetGroupParams(GetRecord, AnIndex, Result.NativeParams) + else + if IsMasterDataRowIndent then + Result.NativeParams := Adapter.GetContentViewParams(Adapter.MasterGridRecord, nil) + else + Result.NativeParams := Adapter.GetGroupRowViewParams(GetRecord, AnIndex); + + Result.CellSides := VertGridLinesMap[Adapter.ShowHorzGridLines]; //PS3.1 (it was Adapter.ShowVertGridLines) + if AnIndex = 0 then + Result.CellSides := Result.CellSides + [csLeft]; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); +end; + +function TdxGridTableViewFormatter.HasExpandButton(ARecord: TcxCustomGridRecord): Boolean; +begin + Result := ReportLink.OptionsView.ExpandButtons{$IFDEF VER500} and Adapter.RecordHelpers[ARecord].HasExpandButton{$ENDIF}; +end; + +procedure TdxGridTableViewFormatter.DoInitializeDataRow(ARow: TdxReportCell; + ARecord: TcxCustomGridRecord); +begin + ReportLink.AddReportRow(ARow); + + ARow.CellSides := csLeftRight; + ARow.Data := Integer(ARecord); + ARow.Transparent := True; +end; + +procedure TdxGridTableViewFormatter.DoReportLinkInitializeItem(AnItem: TAbstractdxReportCellData; + AColumn: TcxGridColumn; ARecord: TcxCustomGridRecord); +begin + ReportLink.DoInitializeCell(Adapter.GridView, ARecord, AColumn, TdxReportCellString(AnItem)); +end; + +function TdxGridTableViewFormatter.GetItemBounds(AGridRow: TcxCustomGridRow; + AGridRowIndex, AColumnIndex: Integer): TRect; +var + Item: TdxGridTableViewColumnPlace; +begin + Item := ItemPlaceController[Columns[AColumnIndex]]; + if Item <> nil then + Result := Item.CellBounds[AGridRowIndex] + else + Result := dxPSGlbl.NullRect; +end; + +function TdxGridTableViewFormatter.GetItemViewParams(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False): TdxReportItemViewParams; +begin + Result := inherited GetItemViewParams(ATableItem, ARecord, AnIsPreview); + if AnIsPreview then + begin + Result.CellSides := csLeftRight; + if Adapter.GridLines in [glBoth, glHorizontal] then + Result.CellSides := Result.CellSides + csTopBottom; + end + else + begin + Result.CellSides := CellSidesMap[Adapter.GridLines]; + if TcxGridColumn(ATableItem).IsMostLeft and (ARecord <> nil) and ARecord.Expandable then + Result.CellSides := Result.CellSides - [csLeft]; {3.1} + end; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.Transparent; +end; + +procedure TdxGridTableViewFormatter.DoInitializeMasterIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer); +begin + DoInitializeMasterDataRowIndent(AnIndent, AnIndex, AnIndentCount, nil); //Adapter.GroupedColumnCount + 1, nil); //PS3.1 changed +end; + +procedure TdxGridTableViewFormatter.DoInitializePreview(APreview: TAbstractdxReportCellData; + AColumn: TcxGridColumn; ARecord: TcxCustomGridRecord); +begin + DoInitializeItem(APreview, AColumn, ARecord, True); +end; + +function TdxGridTableViewFormatter.GetPreviewClass(AColumn: TcxGridColumn; + ARecord: TcxCustomGridRecord): TdxReportCellDataClass; +begin + Result := GetItemClass(AColumn, ARecord, True); +end; + +function TdxGridTableViewFormatter.GetPreviewViewParams(AColumn: TcxGridColumn; + ARecord: TcxCustomGridRecord): TdxReportItemViewParams; +begin + Result := GetItemViewParams(AColumn, ARecord, True) +end; + +procedure TdxGridTableViewFormatter.DoInitializeSeparatorRow(ARow: TdxReportCell); +begin + ARow.CellSides := csLeftRight; + ARow.Transparent := True; +end; + +procedure TdxGridTableViewFormatter.DoInitializeRowSeparator(ASeparator: TAbstractdxReportCellData); +begin + ASeparator.CellSides := csAll; + ASeparator.Color := RowSeparatorColor; + ASeparator.Transparent := IsColorTransparent(ASeparator.Color); //ReportLink.Transparent; +end; + +function TdxGridTableViewFormatter.GetRowSeparatorClass: TdxReportCellDataClass; +begin + Result := TdxReportCellBox; +end; + +function TdxGridTableViewFormatter.GetReportItem(ARow: TcxCustomGridRow; + AColumn: TcxGridColumn): TdxReportVisualItem; +begin + Result := ReportDataAdapter.ReportItems[ARow, AColumn]; +end; + +{ IdxPSCellParams2 } +function TdxGridTableViewFormatter.IdxPSCellParams2_GetPreviewMarginLeft: Integer; +begin + Result := Adapter.PreviewLeftIndent; +end; + +function TdxGridTableViewFormatter.IdxPSCellParams2_GetPreviewMarginRight: Integer; +begin + Result := Adapter.PreviewRightIndent; +end; + +function TdxGridTableViewFormatter.IdxPSCellParams2_GetPreviewMaxHeight: Integer; +begin + if PreviewAutoHeight then + Result := -1 + else + Result := PreviewLineHeight * PreviewMaxLineCount; +end; + +function TdxGridTableViewFormatter.IdxPSCellParams2_GetPreviewMaxLineCount: Integer; +begin + Result := PreviewMaxLineCount; +end; + +procedure TdxGridTableViewFormatter.AddHorizontalDelimiters; +var + Origin, I: Integer; + Item: TdxGridTableViewColumnPlace; + R: TRect; +begin + inherited; + if ReportLink.OptionsPagination.Column then + begin + Origin := ViewWidthExtraBefore; + for I := 0 to ColumnCount - 1 do + begin + Item := ItemPlaceController[Columns[I]]; + if Item <> nil then + begin + R := Item.HeaderCellBounds; + ReportLink.AddHorizontalDelimiter(Origin + R.Left); + ReportLink.AddHorizontalDelimiter(Origin + R.Right); + end; + end; + end; +end; + +procedure TdxGridTableViewFormatter.BeforeBuilding; +begin + BuildItemLists; + ItemPlaceController.Refresh; + inherited; +end; + +procedure TdxGridTableViewFormatter.Calculate; +begin + inherited; + ItemPlaceController.Calculate; +end; + +procedure TdxGridTableViewFormatter.CalculateDataRowHeights; +var + I, RowHeight, J, V: Integer; + Row: TcxCustomGridRow; + Column: TcxGridColumn; +begin + FRowHeights.Count := RowCount; + for I := 0 to RowCount - 1 do + begin + Row := Rows[I]; + if not (Row is TcxGridGroupRow) then + begin + RowHeight := DetailsLineHeight; + if HeaderLineCount = 1 then + for J := 0 to ColumnCount - 1 do + begin + // assign to 0, if you want to give an user ability to shrink RowHeight to smaller value + V := DetailsLineHeight; + Column := Columns[J]; + if not Column.IsPreview then + begin + Builder.DoGetCellHeight(Row, Columns[J], V); + if RowHeight < V then RowHeight := V; + end; + end + end + else + RowHeight := GroupRowLineHeight; + RowHeights[I] := RowHeight; + end; +end; + +procedure TdxGridTableViewFormatter.CalculateLineHeights; +var + I: Integer; + Column: TcxGridColumn; +begin + inherited; + FGroupFooterLineHeight := DefaultGroupFooterLineHeight; + if Adapter.GroupRowHeightAssigned then + FGroupRowLineHeight := Adapter.GroupRowHeight + else + begin + FGroupRowLineHeight := DefaultGroupRowLineHeight; + if Adapter.IsOffice11StyleGrouping then {.2} + FGroupRowLineHeight := 2 * FGroupRowLineHeight; + end; + + FFooterLineHeight := DefaultFooterLineHeight; + FHeaderLineHeight := Adapter.HeaderHeight; + + if Adapter.DataRowHeightAssigned then + FDetailsLineHeight := Adapter.DataRowHeight + else + FDetailsLineHeight := DefaultDataRowLineHeight; + + FPreviewLineHeight := DefaultDataRowLineHeight; + + for I := 0 to ColumnCount - 1 do + begin + Column := Columns[I]; + if not Adapter.HeaderHeightAssigned then + CalculateHeight(GetHeaderItemViewParams(Column), FHeaderLineHeight); + if not Adapter.FooterHeightAssigned then + begin + CalculateHeight(GetGroupFooterItemViewParams(nil, -1, Column), FGroupFooterLineHeight); + CalculateHeight(GetFooterItemViewParams(Column), FFooterLineHeight); + end; + if not Adapter.DataRowHeightAssigned and not Column.IsPreview then + CalculateHeight(GetItemViewParams(Column, nil, False), FDetailsLineHeight); + end; + + if not Adapter.GroupRowHeightAssigned then + for I := 0 to RowCount - 1 do + CalculateHeight(GetGroupRowViewParams(Rows[I], -1), FGroupRowLineHeight); + + if HasPreview then + CalculateHeight(GetItemViewParams({PreviewColumn}nil, nil, True), FPreviewLineHeight); + + Inc(FFooterLineHeight, 2 * FooterItemInflateVert + 1); + Inc(FGroupFooterLineHeight, 2 * FooterItemInflateVert + 1); + + CalculateDataRowHeights; +end; + +function TdxGridTableViewFormatter.GetItemPlaceControllerClass: TdxCustomGridTableViewItemPlaceControllerClass; +begin + Result := TdxGridTableViewColumnPlaceController; +end; + +function TdxGridTableViewFormatter.MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; +begin + case AGridBackgroundBitmapIndex of + bbFooter: + Result := vspsGridFooter; + bbGroup: + Result := vspsGridGroup; + bbHeader: + Result := vspsGridHeader; + bbPreview: + Result := vspsGridPreview; + else + Result := 0; + end; + + if Result = 0 then + Result := inherited MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex); +end; + +procedure TdxGridTableViewFormatter.BuildColumnList; +var + I: Integer; + Column: TcxGridColumn; +begin + FColumns.Clear; + for I := 0 to Adapter.ColumnCount - 1 do + begin + Column := Adapter.Columns[I]; + if IsColumnActuallyVisible(Column) then FColumns.Add(Column); + end; +end; + +procedure TdxGridTableViewFormatter.BuildItemLists; +begin + BuildColumnList; +end; + +function TdxGridTableViewFormatter.IsColumnActuallyVisible(AColumn: TcxGridColumn): Boolean; +begin + Result := AColumn.ActuallyVisible; +end; + +function TdxGridTableViewFormatter.GetViewWidth: Integer; +begin + Result := ItemPlaceController.Width; +end; + +function TdxGridTableViewFormatter.GetColumn(Index: Integer): TcxGridColumn; +begin + Result := FColumns[Index]; +end; + +function TdxGridTableViewFormatter.GetColumnCount: Integer; +begin + Result := FColumns.Count; +end; + +function TdxGridTableViewFormatter.GetGroupRowSeparatorColor: TColor; +begin + Result := Adapter.GroupRowSeparatorColor; +end; + +function TdxGridTableViewFormatter.GetGroupRowSeparatorThickness: Integer; +begin + Result := Adapter.GroupRowSeparatorThickness; +end; + +function TdxGridTableViewFormatter.GetHasPreview: Boolean; +begin + Result := Adapter.HasPreview and ShowPreview and + (PreviewAutoHeight or (PreviewMaxLineCount > 0)); +end; + +function TdxGridTableViewFormatter.GetHeaderLineCount: Integer; +begin + Result := ItemPlaceController.HeaderLineCount; +end; + +function TdxGridTableViewFormatter.GetPreviewAutoHeight: Boolean; +begin + Result := ReportLink.OptionsPreview.AutoHeight; +end; + +function TdxGridTableViewFormatter.GetPreviewColumn: TcxGridColumn; +begin + Result := Adapter.PreviewColumn; +end; + +function TdxGridTableViewFormatter.GetPreviewMaxLineCount: Integer; +begin + Result := ReportLink.OptionsPreview.MaxLineCount; +end; + +function TdxGridTableViewFormatter.GetRow(Index: Integer): TcxCustomGridRow; +begin + Result := inherited Records[Index] as TcxCustomGridRow; +end; + +function TdxGridTableViewFormatter.GetRowCount: Integer; +begin + Result := RecordCount; +end; + +function TdxGridTableViewFormatter.GetRowHeight(Index: Integer): Integer; +begin + Result := Integer(FRowHeights[Index]) +end; + +function TdxGridTableViewFormatter.GetRowHeightByRow(Row: TcxCustomGridRow): Integer; +begin + Result := {20;//}RowHeights[RecordIndexes[Row]]; +end; + +function TdxGridTableViewFormatter.GetRowSeparatorColor: TColor; +begin + Result := Adapter.RowSeparatorColor; + {with ReportLink.OptionsFormatting do + if UseNativeStyles then + begin + Result := FixedColor; + end;} +end; + +function TdxGridTableViewFormatter.GetRowSeparatorThickness: Integer; +begin + Result := Adapter.RowSeparatorThickness; +end; + +function TdxGridTableViewFormatter.GetShowGroupFooters: Boolean; +begin + Result := ReportLink.OptionsView.GroupFooters; +end; + +function TdxGridTableViewFormatter.GetShowFooters: Boolean; +begin + Result := ReportLink.OptionsView.Footers; +end; + +function TdxGridTableViewFormatter.GetShowHeaders: Boolean; +begin + Result := ReportLink.OptionsView.Headers; +end; + +function TdxGridTableViewFormatter.GetShowPreview: Boolean; +begin + Result := ReportLink.OptionsPreview.Visible; +end; + +procedure TdxGridTableViewFormatter.SetRowHeight(Index: Integer; Value: Integer); +begin + FRowHeights[Index] := TObject(Value); +end; + +procedure TdxGridTableViewFormatter.SetRowHeightByRow(Row: TcxCustomGridRow; Value: Integer); +begin + RowHeights[IndexOfRecord(Row)] := Value; +end; + +{ TdxGridTableViewBuilder } + +function TdxGridTableViewBuilder.Adapter: TdxGridTableViewAdapter; +begin + Result := inherited Adapter as TdxGridTableViewAdapter; +end; + +class function TdxGridTableViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxGridTableViewAdapter; +end; + +function TdxGridTableViewBuilder.Formatter: TdxGridTableViewFormatter; +begin + Result := inherited Formatter as TdxGridTableViewFormatter; +end; + +class function TdxGridTableViewBuilder.FormatterClass: TdxGridViewFormatterClass; +begin + Result := TdxGridTableViewFormatter; +end; + +procedure TdxGridTableViewBuilder.AddDelimitersHardVert(AReportRow: TdxReportCell); +begin + ReportLink.FDelimitersHardVert.Add(TObject(AReportRow.AbsoluteRect.Top)); +end; + +procedure TdxGridTableViewBuilder.DoBuildViewBody; +begin + if Formatter.ShowHeaders then CreateHeader; + CreateRows; + if not IsAborted and Formatter.ShowFooters then + CreateFooter; +end; + +procedure TdxGridTableViewBuilder.DoBuildViewFooter; +begin + inherited; + if not Formatter.HasDetailsSeparator then CreateViewTerminator; +end; + +procedure TdxGridTableViewBuilder.CreateDetails(AMasterRow: TcxGridMasterDataRow); +var + CurrentView: TcxCustomGridView; +begin + if AMasterRow.ActiveDetailGridViewExists then + if ReportLink.OptionsLevels.Unwrap then + begin + ProcessedView := nil; + try + if ReportLink.OptionsLevels.RiseActiveLevelOntoTop then + begin + CurrentView := AMasterRow.ActiveDetailGridView; + CreateDetailView(CurrentView); + ProcessedView := CurrentView; + end; + ReportLink.ForEachView(AMasterRow, CreateDetailView); + finally + ProcessedView := nil; + end; + end + else + CreateDetailView(AMasterRow.ActiveDetailGridView); +end; + +procedure TdxGridTableViewBuilder.CreateDetailView(AGridView: TcxCustomGridView); +begin + if AGridView <> ProcessedView then ReportLink.BuildView(Self, AGridView); +end; + +function TdxGridTableViewBuilder.GetAreDetailsBuilt: Boolean; +begin + with ReportLink.OptionsDetails do + Result := not StartFromFocusedView or not OnlyFocusedView; +end; + +procedure TdxGridTableViewBuilder.CreateFooter; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetFootersProducer.Produce(HostInfoServices.FootersHostInfo); + AddReportRow(ReportRow); +end; + +function TdxGridTableViewBuilder.GetFootersProducer: TdxGridTableViewFootersProducer; +begin + Result := ProducerCache[GetFootersProducerClass] as TdxGridTableViewFootersProducer; +end; + +function TdxGridTableViewBuilder.GetFootersProducerClass: TdxGridTableViewFootersProducerClass; +begin + Result := TdxGridTableViewFootersProducer; +end; + +procedure TdxGridTableViewBuilder.CreateGroupFooters(AGridRow: TcxCustomGridRow); +var + Producer: TdxGridTableViewGroupFooterProducer; + HostInfo: TdxGridAttributeHostInfo; + Index, I: Integer; + ReportRow: TdxReportCell; +begin + Producer := GetGroupFooterProducer; + HostInfo := HostInfoServices.PageDetailsHostInfo; + Index := 0; + for I := 0 to AGridRow.Level do + if Adapter.HasGroupFooter(AGridRow, I) then + begin + ReportRow := Producer.Produce(HostInfo, AGridRow, AGridRow.Level - I, Index); + AddReportRow(ReportRow); + Inc(Index); + end; +end; + +function TdxGridTableViewBuilder.GetGroupFooterProducer: TdxGridTableViewGroupFooterProducer; +begin + Result := ProducerCache[GetGroupFooterProducerClass] as TdxGridTableViewGroupFooterProducer; +end; + +function TdxGridTableViewBuilder.GetGroupFooterProducerClass: TdxGridTableViewGroupFooterProducerClass; +begin + Result := TdxGridTableViewGroupFooterProducer; +end; + +procedure TdxGridTableViewBuilder.CreateHeader; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetHeadersProducer.Produce(HostInfoServices.HeadersHostInfo); + AddReportRow(ReportRow); +end; + +function TdxGridTableViewBuilder.GetHeadersProducer: TdxGridTableViewHeadersProducer; +begin + Result := ProducerCache[GetHeadersProducerClass] as TdxGridTableViewHeadersProducer; +end; + +function TdxGridTableViewBuilder.GetHeadersProducerClass: TdxGridTableViewHeadersProducerClass; +begin + Result := TdxGridTableViewHeadersProducer; +end; + +procedure TdxGridTableViewBuilder.CreateRow(AGridRow: TcxCustomGridRow; ARowIndex: Integer); +var + ReportRow: TdxReportCell; +begin + ReportRow := GetRowProducer(AGridRow).Produce(HostInfoServices.PageDetailsHostInfo, AGridRow, ARowIndex); + AddReportRow(ReportRow); +end; + +function TdxGridTableViewBuilder.GetRowProducer(AGridRow: TcxCustomGridRow): TdxGridTableViewCustomDataRowProducer; +begin + Result := ProducerCache[GetRowProducerClass(AGridRow)] as TdxGridTableViewCustomDataRowProducer; +end; + +procedure TdxGridTableViewBuilder.CreateRows; +var + PrevGridRow, GridRow: TcxCustomGridRow; + I: Integer; + HasGroupDelimiter: Boolean; +begin + PrevGridRow := nil; + for I := 0 to Formatter.RowCount - 1 do + begin + GridRow := Formatter.Rows[I]; + + if (ShowRowSeparators and (I > 0)) and (not (PrevGridRow is TcxGridGroupRow) or not ShowGroupRowSeparators) then + CreateRowSeparator(GridRow, False); + + HasGroupDelimiter := Formatter.PaginateByTopLevelGroups and (I > 0) and + (GridRow.Level = 0) and (GridRow is TcxGridGroupRow); + + CreateRow(GridRow, I); + + // Hard Delimiters + if HasGroupDelimiter then + AddDelimitersHardVert(LastReportRow); + + if AreDetailsBuilt and Adapter.HasDetails(GridRow) then + CreateDetails(GridRow as TcxGridMasterDataRow); + + if ShowGroupRowSeparators and (GridRow is TcxGridGroupRow) then + CreateGroupRowSeparator(TcxGridGroupRow(GridRow)); + + if Formatter.ShowGroupFooters and Adapter.HasGroupFooters(GridRow) then + CreateGroupFooters(GridRow); + + // Last Row Separator + if (ShowRowSeparators and (I = Formatter.RowCount - 1)) and (not (GridRow is TcxGridGroupRow) or not ShowGroupRowSeparators) then + CreateRowSeparator(GridRow, True); + + // Progress + if MasterBuilder = nil then + begin + Progress(100 * (I + 1) / Formatter.RowCount); + if IsAborted then Break; + end; + + PrevGridRow := GridRow; + end; +end; + +function TdxGridTableViewBuilder.GetRowProducerClass(AGridRow: TcxCustomGridRow): TdxGridTableViewCustomDataRowProducerClass; +begin + Result := Adapter.RecordHelpers[AGridRow].ProducerClass; +end; + +procedure TdxGridTableViewBuilder.CreateRowSeparator(AGridRow: TcxCustomGridRow; + AnIsLast: Boolean = False); +var + ReportRow: TdxReportCell; +begin + ReportRow := GetRowSeparatorProducer.Produce(HostInfoServices.PageDetailsHostInfo, AGridRow, AnIsLast); + AddReportRow(ReportRow); +end; + +function TdxGridTableViewBuilder.GetRowSeparatorProducer: TdxGridTableViewRowSeparatorProducer; +begin + Result := ProducerCache[GetRowSeparatorProducerClass] as TdxGridTableViewRowSeparatorProducer; +end; + +function TdxGridTableViewBuilder.GetRowSeparatorProducerClass: TdxGridTableViewRowSeparatorProducerClass; +begin + Result := TdxGridTableViewRowSeparatorProducer; +end; + +function TdxGridTableViewBuilder.GetShowRowSeparators: Boolean; +begin + Result := Adapter.HasRowSeparators; +end; + +procedure TdxGridTableViewBuilder.CreateGroupRowSeparator(AGridRow: TcxGridGroupRow); +var + ReportRow: TdxReportCell; +begin + ReportRow := GetGroupRowSeparatorProducer.Produce(HostInfoServices.PageDetailsHostInfo, AGridRow); + AddReportRow(ReportRow); +end; + +function TdxGridTableViewBuilder.GetGroupRowSeparatorProducer: TdxGridTableViewGroupRowSeparatorProducer; +begin + Result := ProducerCache[GetGroupRowSeparatorProducerClass] as TdxGridTableViewGroupRowSeparatorProducer; +end; + +function TdxGridTableViewBuilder.GetGroupRowSeparatorProducerClass: TdxGridTableViewGroupRowSeparatorProducerClass; +begin + Result := TdxGridTableViewGroupRowSeparatorProducer; +end; + +function TdxGridTableViewBuilder.GetShowGroupRowSeparators: Boolean; +begin + Result := Adapter.IsOffice11StyleGrouping; +end; + +function TdxGridTableViewBuilder.GridView: TcxGridTableView; +begin + Result := inherited GridView as TcxGridTableView; +end; + +class function TdxGridTableViewBuilder.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridTableView; +end; + +function TdxGridTableViewBuilder.GetLastReportRow: TdxReportCell; +begin + Result := ReportRows[ReportRowCount - 1]; +end; + +function TdxGridTableViewBuilder.GetProcessedView: TcxCustomGridView; +begin + Result := ReportLink.FProcessedView; +end; + +procedure TdxGridTableViewBuilder.SetProcessedView(Value: TcxCustomGridView); +begin + ReportLink.FProcessedView := Value; +end; + +{ TdxGridDBTableViewAdapter } + +function TdxGridDBTableViewAdapter.GridView: TcxGridDBTableView; +begin + Result := inherited GridView as TcxGridDBTableView; +end; + +class function TdxGridDBTableViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridDBTableView; +end; + +procedure TdxGridDBTableViewAdapter.AfterBuilding; +begin + UnloadAllRecords; + inherited; +end; + +procedure TdxGridDBTableViewAdapter.BeforeBuilding; +begin + inherited; + LoadAllRecords; +end; + +function TdxGridDBTableViewAdapter.DataController: TcxGridDBDataController; +begin + Result := TcxGridDBDataController(inherited DataController); +end; + +function TdxGridDBTableViewAdapter.DBDataModeController: TcxDBDataModeController; +begin + Result := DataController.DataModeController; +end; + +procedure TdxGridDBTableViewAdapter.LoadAllRecords; +begin + _LoadAllRecords(DBDataModeController, FPrevAllRecordsAreLoaded); +end; + +procedure TdxGridDBTableViewAdapter.UnloadAllRecords; +begin + _UnloadAllRecords(DBDataModeController, FPrevAllRecordsAreLoaded); +end; + +{ TdxGridDBTableViewBuilder } + +function TdxGridDBTableViewBuilder.Adapter: TdxGridDBTableViewAdapter; +begin + Result := inherited Adapter as TdxGridDBTableViewAdapter; +end; + +class function TdxGridDBTableViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxGridDBTableViewAdapter; +end; + +{ TdxGridBandedTableViewAdapter } + +constructor TdxGridBandedTableViewAdapter.Create(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView); +begin + inherited; + FFooterLineCount := -1; +end; + +function TdxGridBandedTableViewAdapter.GridView: TcxGridBandedTableView; +begin + Result := inherited GridView as TcxGridBandedTableView; +end; + +class function TdxGridBandedTableViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridBandedTableView; +end; + +function TdxGridBandedTableViewAdapter.Styles: TcxGridBandedTableViewStyles; +begin + Result := inherited Styles as TcxGridBandedTableViewStyles; +end; + +function TdxGridBandedTableViewAdapter.CalculateDetailsLineCount: Integer; +var + I, J, V: Integer; + BandRows: TcxGridBandRows; +begin + Result := 0; + for I := 0 to BottomBandCount - 1 do + begin + BandRows := BottomBands[I].Rows; + V := 0; + for J := 0 to BandRows.VisibleCount - 1 do + Inc(V, BandRows[J].LineCount); + if Result < V then Result := V; + end; +end; + +function TdxGridBandedTableViewAdapter.CalculateFooterLineCount: Integer; +var + I, V: Integer; +begin + Result := 0; + for I := 0 to BottomBandCount - 1 do + begin + V := BottomBands[I].Rows.Count; + if Result < V then Result := V; + end; +end; + +function TdxGridBandedTableViewAdapter.GetBandHeaderHeight: Integer; +begin + Result := GridView.OptionsView.BandHeaderHeight; +end; + +function TdxGridBandedTableViewAdapter.GetBandHeaderHeightAssigned: Boolean; +begin + Result := BandHeaderHeight <> 0; +end; + +function TdxGridBandedTableViewAdapter.GetBandHeaderViewParams(ABand: TcxGridBand): TcxViewParams; +begin + if (ABand <> nil) and (ABand.Styles <> nil) then + ABand.Styles.GetHeaderParams(Result) + else + Styles.GetBandHeaderParams(ABand, Result); + if ABand = nil then + Result.Color := LookAndFeelPainter.DefaultHeaderBackgroundColor; +end; + +function TdxGridBandedTableViewAdapter.GetDataRowHeightAssigned: Boolean; +begin + Result := (DetailsLineCount = 1) and inherited GetDataRowHeightAssigned; +end; + +function TdxGridBandedTableViewAdapter.GetFooterHeightAssigned: Boolean; +begin + Result := (FooterLineCount = 1) and inherited GetFooterHeightAssigned; +end; + +function TdxGridBandedTableViewAdapter.GetHeaderHeightAssigned: Boolean; +begin + Result := (DetailsLineCount = 1) and inherited GetHeaderHeightAssigned; +end; + +function TdxGridBandedTableViewAdapter.GetHeaderMultiline(Column: TcxGridColumn): Boolean; +begin + Result := ((DetailsLineCount = 1) and inherited GetHeaderMultiline(Column)) or + (TcxGridBandedColumn(Column).Position.LineCount > 1); {PS 3.01} +end; + +function TdxGridBandedTableViewAdapter.GetBand(Index: Integer): TcxGridBand; +begin + Result := GridView.Bands.VisibleItems[Index]; +end; + +function TdxGridBandedTableViewAdapter.GetBandCount: Integer; +begin + Result := GridView.Bands.VisibleCount; +end; + +function TdxGridBandedTableViewAdapter.GetBandEndEllipsis: Boolean; +begin + Result := GridView.OptionsView.BandHeaderEndEllipsis; +end; + +function TdxGridBandedTableViewAdapter.GetBandHeaderLineCount: Integer; +begin + Result := GridView.OptionsView.BandHeaderLineCount; +end; + +function TdxGridBandedTableViewAdapter.GetBandHeaderMultiline: Boolean; +begin + Result := BandHeaderHeightAssigned;// or (BandHeaderLineCount > 1); {!!! v3.03} +end; + +function TdxGridBandedTableViewAdapter.GetBottomBand(Index: Integer): TcxGridBand; +begin + Result := GridView.Bands.VisibleItems[Index]; +end; + +function TdxGridBandedTableViewAdapter.GetBottomBandCount: Integer; +begin + Result := GridView.Bands.VisibleCount; +end; + +function TdxGridBandedTableViewAdapter.GetColumn(Index: Integer): TcxGridBandedColumn; +begin + Result := GridView.VisibleColumns[Index]; +end; + +function TdxGridBandedTableViewAdapter.GetFooterLineCount: Integer; +begin + if FFooterLineCount = -1 then + FFooterLineCount := CalculateFooterLineCount; + Result := FFooterLineCount; +end; + +function TdxGridBandedTableViewAdapter.GetRootBand(Index: Integer): TcxGridBand; +begin + Result := GridView.Bands.VisibleItems[Index]; +end; + +function TdxGridBandedTableViewAdapter.GetRootBandCount: Integer; +begin + Result := GridView.Bands.VisibleCount; +end; + +function TdxGridBandedTableViewAdapter.GetThemedBandHeaderItemColor: TColor; +begin + Result := LookAndFeelPainter.DefaultHeaderColor; +end; + +function TdxGridBandedTableViewAdapter.GetThemedBandHeaderItemTextColor: TColor; +begin + Result := LookAndFeelPainter.DefaultHeaderTextColor; +end; + +{ TdxGridBandedTableViewColumnPlace } + +function TdxGridBandedTableViewColumnPlace.GetLineCount: Integer; +begin + Result := Column.Position.LineCount; +end; + +function TdxGridBandedTableViewColumnPlace.GetRowIndex: Integer; +begin + Result := Column.Position.Row.LineOffset; +end; + +function TdxGridBandedTableViewColumnPlace.GetColumn: TcxGridBandedColumn; +begin + Result := inherited Column as TcxGridBandedColumn; +end; + +function TdxGridBandedTableViewColumnPlace.GetController: TdxCustomGridBandedTableViewItemPlace; +begin + Result := inherited Controller as TdxCustomGridBandedTableViewItemPlace; +end; + +function TdxGridBandedTableViewColumnPlace.GetFormatter: TdxGridBandedTableViewFormatter; +begin + Result := inherited Formatter as TdxGridBandedTableViewFormatter; +end; + +{ TdxCustomGridBandedTableViewItemPlace } + +constructor TdxCustomGridBandedTableViewItemPlace.Create(AController: TdxGridBandedTableViewItemPlaceController; + AParent: TdxGridBandedTableViewItemPlace; ABand: TcxGridBand); +begin + inherited Create(AController.Formatter); + FController := AController; + FParent := AParent; + FBand := ABand; + + FHeight := -1; + FLeftBound := -1; + FMinWidth := -1; + FTopBound := -1; +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateHeaderLineCount: Integer; +var + I: Integer; +begin + Result := 0; + with Band.Rows do + for I := 0 to VisibleCount - 1 do + Inc(Result, VisibleItems[I].LineCount); +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateWidth: Integer; +begin + Result := Band.Width; + if Result = 0 then + begin + Result := InternalCalculateWidth; + if Result = 0 then + Result := cxGridBandedTableView.cxGridDefaultEmptyBandWidth; + end; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetItemClass(AColumn: TcxGridColumn): TdxGridTableViewColumnPlaceClass; +begin + Result := TdxGridBandedTableViewColumnPlace; +end; + +procedure TdxCustomGridBandedTableViewItemPlace.AssignWidth; +begin + Width := Width; +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateHeight: Integer; +begin + Result := Controller.CalculateItemHeight(Self); +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateLevelHeight: Integer; +begin + if Adapter.BandHeaderHeightAssigned then + Result := Adapter.BandHeaderHeight + else + Result := CalculateLineHeight * Adapter.BandHeaderLineCount; +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateLineHeight: Integer; +begin + Result := 0; + Formatter.CalculateHeight(ViewParams, Result); +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateMinWidth: Integer; +begin + Result := InternalCalculateMinWidth; +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateLeftBound: Integer; +begin + Result := Controller.CalculateItemLeftBound(Self); +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateTopBound: Integer; +begin + Result := Controller.CalculateItemTopBound(Self); +end; + +function TdxCustomGridBandedTableViewItemPlace.GetRowCount: Integer; +begin + Result := 0; +end; + +function TdxCustomGridBandedTableViewItemPlace.InternalCalculateMinWidth: Integer; +begin + Result := 0; +end; + +function TdxCustomGridBandedTableViewItemPlace.InternalCalculateWidth: Integer; +begin + Result := 0; +end; + +procedure TdxCustomGridBandedTableViewItemPlace.InitAutoWidthItem(AnItem: TcxAutoWidthItem); +begin + AnItem.Fixed := IsFixed; + AnItem.MinWidth := MinWidth; + AnItem.Width := Width; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetAdapter: TdxGridBandedTableViewAdapter; +begin + Result := inherited Adapter as TdxGridBandedTableViewAdapter; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetBounds: TRect; +begin + Result := Classes.Bounds(LeftBound, TopBound, Width, Height); +end; + +function TdxCustomGridBandedTableViewItemPlace.GetFormatter: TdxGridBandedTableViewFormatter; +begin + Result := inherited Formatter as TdxGridBandedTableViewFormatter; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetHeight: Integer; +begin + if FHeight = -1 then + FHeight := CalculateHeight; + Result := FHeight; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetIndex: Integer; +begin + if Parent <> nil then + Result := Parent.IndexOf(Self) + else + Result := Controller.RootIndexOf(Self); +end; + +function TdxCustomGridBandedTableViewItemPlace.GetIsFixed: Boolean; +begin + Result := not Band.Options.Sizing; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetLeftBound: Integer; +begin + if FLeftBound = -1 then + FLeftBound := CalculateLeftBound; + Result := FLeftBound; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetLevelIndex: Integer; +begin + Result := 0; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetMinWidth: Integer; +begin + if FMinWidth = -1 then + FMinWidth := CalculateMinWidth; + Result := FMinWidth; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetTopBound: Integer; +begin + if FTopBound = -1 then + FTopBound := CalculateTopBound; + Result := FTopBound; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetViewParams: TdxReportItemViewParams; +begin + Result := Formatter.GetBandItemViewParams(Band); +end; + +{ TdxGridBandedTableViewItemPlace } + +constructor TdxGridBandedTableViewItemPlace.Create(AnOwner: TdxGridBandedTableViewItemPlaceController; + AParent: TdxGridBandedTableViewItemPlace; ABand: TcxGridBand); +begin + inherited; + FChildItems := TList.Create; +end; + +destructor TdxGridBandedTableViewItemPlace.Destroy; +begin + FreeAndNil(FChildItems); + inherited; +end; + +function TdxGridBandedTableViewItemPlace.IndexOf(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; +begin + Result := FChildItems.IndexOf(AnItem); +end; + + +function TdxGridBandedTableViewItemPlace.GetRowCount: Integer; +begin + Result := 1; +end; + +function TdxGridBandedTableViewItemPlace.InternalCalculateMinWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to ChildItemCount - 1 do + Inc(Result, ChildItems[I].MinWidth); +end; + +function TdxGridBandedTableViewItemPlace.InternalCalculateWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to ChildItemCount - 1 do + Inc(Result, ChildItems[I].Width); +end; + +procedure TdxGridBandedTableViewItemPlace.WidthChanged; +begin + inherited; + CalculateChildItemWidths; +end; + +procedure TdxGridBandedTableViewItemPlace.CalculateChildItemWidths; +var + AutoWidthObject: TcxAutoWidthObject; + I: Integer; +begin + AutoWidthObject := TcxAutoWidthObject.Create(ChildItemCount); + try + for I := 0 to ChildItemCount - 1 do + ChildItems[I].InitAutoWidthItem(AutoWidthObject.AddItem); + AutoWidthObject.AvailableWidth := Width; + AutoWidthObject.Calculate; + + for I := 0 to ChildItemCount - 1 do + ChildItems[I].Width := AutoWidthObject[I].AutoWidth; + finally + AutoWidthObject.Free; + end; +end; + +function TdxGridBandedTableViewItemPlace.GetChildItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; +begin + Result := FChildItems[Index]; +end; + +function TdxGridBandedTableViewItemPlace.GetChildItemCount: Integer; +begin + Result := FChildItems.Count; +end; + +{ TdxGridBandedTableViewBottomItemPlace } + +procedure TdxGridBandedTableViewBottomItemPlace.AddItems; +var + I, J: Integer; + Row: TcxGridBandRow; +begin + for I := 0 to Band.Rows.VisibleCount - 1 do + begin + Row := Band.Rows.VisibleItems[I]; + for J := 0 to Row.VisibleCount - 1 do + CreateItem(Row.VisibleItems[J]); + end; +end; + +function TdxGridBandedTableViewBottomItemPlace.CalculateItemLeftBound(AnItem: TdxGridTableViewColumnPlace): Integer; +var + Row: TcxGridBandRow; + I: Integer; + Item: TdxGridTableViewColumnPlace; +begin + Result := LeftBound; + Row := TdxGridBandedTableViewColumnPlace(AnItem).Column.Position.Row; + for I := 0 to TdxGridBandedTableViewColumnPlace(AnItem).Column.Position.VisibleColIndex - 1 do + begin + Item := ItemsByColumn[Row.VisibleItems[I]]; + Inc(Result, Item.Width); + end; +end; + +procedure TdxGridBandedTableViewBottomItemPlace.CalculateItemsWidth; +var + I, J: Integer; + Row: TcxGridBandRow; + AutoWidthObject: TcxAutoWidthObject; + Column: TcxGridColumn; +begin + for I := 0 to Band.Rows.VisibleCount - 1 do + begin + Row := Band.Rows.VisibleItems[I]; + AutoWidthObject := TcxAutoWidthObject.Create(Row.VisibleCount); + try + for J := 0 to Row.VisibleCount - 1 do + ItemsByColumn[Row.VisibleItems[J]].InitAutoWidthItem(AutoWidthObject.AddItem); + AutoWidthObject.AvailableWidth := ItemsAvailableWidth; + AutoWidthObject.Calculate; + + for J := 0 to Row.VisibleCount - 1 do + begin + Column := Row.VisibleItems[J]; + ItemsByColumn[Column].Width := AutoWidthObject[J].AutoWidth; + end; + finally + AutoWidthObject.Free; + end; + end; +end; + +function TdxGridBandedTableViewBottomItemPlace.GetItemsAutoWidth: Boolean; +begin + Result := True; +end; + +function TdxGridBandedTableViewBottomItemPlace.GetItemsAvailableWidth: Integer; +begin + Result := Width; +end; + +function TdxGridBandedTableViewBottomItemPlace.GetRowCount: Integer; +begin + Result := Controller.LevelCount - LevelIndex; +end; + +function TdxGridBandedTableViewBottomItemPlace.InternalCalculateMinWidth: Integer; +var + I, V, J: Integer; + Row: TcxGridBandRow; + Column: TcxGridColumn; +begin + Result := 0; + for I := 0 to Band.Rows.VisibleCount - 1 do + begin + V := 0; + Row := Band.Rows.VisibleItems[I]; + for J := 0 to Row.VisibleCount - 1 do + begin + Column := Row.VisibleItems[J]; + Inc(V, Adapter.InternalColumnMinWidths[Column]); + end; + //if Row.IsFirst then + // Inc(V, Formatter.IndentWidth * Formatter.IndentCount); + if Result < V then Result := V; + end +end; + +function TdxGridBandedTableViewBottomItemPlace.InternalCalculateWidth: Integer; +var + I, V, J: Integer; + Row: TcxGridBandRow; + Column: TcxGridColumn; +begin + Result := 0; + for I := 0 to Band.Rows.VisibleCount - 1 do + begin + V := 0; + Row := Band.Rows.VisibleItems[I]; + for J := 0 to Row.VisibleCount - 1 do + begin + Column := Row.VisibleItems[J]; + Inc(V, Adapter.InternalColumnWidths[Column]); + end; + if Result < V then Result := V; + end; +end; + +procedure TdxGridBandedTableViewBottomItemPlace.WidthChanged; +begin + inherited; + CalculateItemsWidth; +end; + +{ TdxGridBandedTableViewItemPlaceController } + +constructor TdxGridBandedTableViewItemPlaceController.Create(AFormatter: TdxGridTableViewFormatter); +begin + inherited; + FBottomItems := TList.Create; + FItems := TList.Create; + FRootItems := TList.Create; + FLevelHeights := TList.Create; + + FHeight := -1; + FLevelCount := -1; +end; + +destructor TdxGridBandedTableViewItemPlaceController.Destroy; +begin + FreeAndNil(FLevelHeights); + FreeAndNil(FRootItems); + FreeAndNilItems; + FreeAndNil(FBottomItems); + inherited; +end; + +procedure TdxGridBandedTableViewItemPlaceController.Calculate; +begin + CalculateLevelHeights; + CalculateItemWidths; +end; + +procedure TdxGridBandedTableViewItemPlaceController.Refresh; +begin + ClearItems; + AddItems; + RefreshRootItems; + RefreshBottomItems; + RefreshItems; +end; + +function TdxGridBandedTableViewItemPlaceController.IndexOf(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; +begin + Result := FItems.IndexOf(AnItem); +end; + +function TdxGridBandedTableViewItemPlaceController.IndexOf(ABand: TcxGridBand): Integer; +begin + for Result := 0 to ItemCount - 1 do + if Items[Result].Band = ABand then + Exit; + Result := -1; +end; + +function TdxGridBandedTableViewItemPlaceController.RootIndexOf(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; +begin + Result := FRootItems.IndexOf(AnItem); +end; + +function TdxGridBandedTableViewItemPlaceController.RootIndexOf(ABand: TcxGridBand): Integer; +begin + for Result := 0 to RootItemCount - 1 do + if RootItems[Result].Band = ABand then + Exit; + Result := -1; +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateHeaderLineCount: Integer; +var + I, V: Integer; +begin + Result := -1; + for I := 0 to BottomItemCount - 1 do + begin + V := BottomItems[I].HeaderLineCount; + if Result < V then Result := V; + end; +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to RootItemCount - 1 do + Inc(Result, RootItems[I].Width); +end; + +function TdxGridBandedTableViewItemPlaceController.GetItemByColumn(Column: TcxGridColumn): TdxGridTableViewColumnPlace; +var + BandPlace: TdxCustomGridBandedTableViewItemPlace; +begin + BandPlace := ItemsByBand[TcxGridBandedColumn(Column).Position.Band]; + if BandPlace <> nil then + Result := BandPlace.ItemsByColumn[Column] + else + Result := nil; +end; + +procedure TdxGridBandedTableViewItemPlaceController.AddItems; +var + I: Integer; +begin + FItems.Count := Formatter.BandCount; + for I := 0 to ItemCount - 1 do + FItems[I] := CreateItem(Formatter.Bands[I]); +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateHeight: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to LevelCount - 1 do + Inc(Result, LevelHeights[I]); +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateItemHeight(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; +var + I: Integer; +begin + Result := 0; + for I := AnItem.LevelIndex to AnItem.LevelIndex + AnItem.RowCount - 1 do + Inc(Result, LevelHeights[I]); +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateItemLeftBound(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; +var + I: Integer; +begin + if AnItem.Parent <> nil then + begin + Result := AnItem.Parent.LeftBound; + for I := 0 to AnItem.Index - 1 do + Inc(Result, AnItem.Parent.ChildItems[I].Width); + end + else + begin + Result := 0; + for I := 0 to AnItem.Index - 1 do + Inc(Result, RootItems[I].Width); + end; +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateItemTopBound(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to AnItem.LevelIndex - 1 do + Inc(Result, LevelHeights[I]); +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateLevelCount: Integer; +var + I, V: Integer; +begin + Result := 0; + if ItemCount <> 0 then + begin + for I := 0 to ItemCount - 1 do + begin + V := Items[I].LevelIndex; + if Result < V then Result := V; + end; + Inc(Result); + end; +end; + +procedure TdxGridBandedTableViewItemPlaceController.CalculateItemWidths; +var + I: Integer; + AutoWidthObject: TcxAutoWidthObject; +begin + for I := 0 to RootItemCount - 1 do + RootItems[I].AssignWidth; + + if AutoWidth then + begin + AutoWidthObject := TcxAutoWidthObject.Create(RootItemCount); + try + for I := 0 to RootItemCount - 1 do + RootItems[I].InitAutoWidthItem(AutoWidthObject.AddItem); + AutoWidthObject.AvailableWidth := AvailableWidth; + AutoWidthObject.Calculate; + + for I := 0 to RootItemCount - 1 do + RootItems[I].Width := AutoWidthObject[I].AutoWidth; + finally + AutoWidthObject.Free; + end; + end; +end; + +procedure TdxGridBandedTableViewItemPlaceController.CalculateLevelHeights; +var + I, V: Integer; + Item: TdxCustomGridBandedTableViewItemPlace; +begin + FLevelHeights.Count := LevelCount; + for I := 0 to ItemCount - 1 do + begin + Item := Items[I]; + V := Item.CalculateLevelHeight; + if LevelHeights[Item.LevelIndex] < V then + LevelHeights[Item.LevelIndex] := V; + end; +end; + +procedure TdxGridBandedTableViewItemPlaceController.ClearItems; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + Items[I].Free; + FItems.Clear; +end; + +function TdxGridBandedTableViewItemPlaceController.CreateItem(ABand: TcxGridBand): TdxCustomGridBandedTableViewItemPlace; +begin + Result := GetItemClass(ABand).Create(Self, nil, ABand); +end; + +function TdxGridBandedTableViewItemPlaceController.GetItemClass(ABand: TcxGridBand): TdxCustomGridBandedTableViewItemPlaceClass; +begin + Result := TdxGridBandedTableViewBottomItemPlace; +end; + +procedure TdxGridBandedTableViewItemPlaceController.RefreshBottomItems; +var + I: Integer; +begin + FBottomItems.Count := Adapter.BottomBandCount; + for I := 0 to BottomItemCount - 1 do + FBottomItems[I] := ItemsByBand[Adapter.BottomBands[I]]; +end; + +procedure TdxGridBandedTableViewItemPlaceController.RefreshItems; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + Items[I].Refresh; +end; + +procedure TdxGridBandedTableViewItemPlaceController.RefreshRootItems; +var + I: Integer; +begin + FRootItems.Count := Adapter.RootBandCount; + for I := 0 to RootItemCount - 1 do + FRootItems[I] := ItemsByBand[Adapter.RootBands[I]]; +end; + +function TdxGridBandedTableViewItemPlaceController.GetAdapter: TdxGridBandedTableViewAdapter; +begin + Result := Formatter.Adapter; +end; + +function TdxGridBandedTableViewItemPlaceController.GetAutoWidth: Boolean; +begin + Result := Formatter.AutoWidth; +end; + +function TdxGridBandedTableViewItemPlaceController.GetAvailableWidth: Integer; +begin + Result := Formatter.ViewAvailableWidth; +end; + +function TdxGridBandedTableViewItemPlaceController.GetBottomItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; +begin + Result := FBottomItems[Index]; +end; + +function TdxGridBandedTableViewItemPlaceController.GetBottomItemCount: Integer; +begin + Result := FBottomItems.Count; +end; + +function TdxGridBandedTableViewItemPlaceController.GetFormatter: TdxGridBandedTableViewFormatter; +begin + Result := inherited Formatter as TdxGridBandedTableViewFormatter; +end; + +function TdxGridBandedTableViewItemPlaceController.GetHeight: Integer; +begin + if FHeight = -1 then + FHeight := CalculateHeight; + Result := FHeight; +end; + +function TdxGridBandedTableViewItemPlaceController.GetItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; +begin + Result := FItems[Index]; +end; + +function TdxGridBandedTableViewItemPlaceController.GetItemByBand(Band: TcxGridBand): TdxCustomGridBandedTableViewItemPlace; +var + Index: Integer; +begin + Index := IndexOf(Band); + if Index <> -1 then + Result := Items[IndexOf(Band)] + else + Result := nil; +end; + +function TdxGridBandedTableViewItemPlaceController.GetItemCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxGridBandedTableViewItemPlaceController.GetLevelCount: Integer; +begin + if FLevelCount = -1 then + FLevelCount := CalculateLevelCount; + Result := FLevelCount; +end; + +function TdxGridBandedTableViewItemPlaceController.GetLevelHeight(Index: Integer): Integer; +begin + Result := Integer(FLevelHeights[Index]); +end; + +function TdxGridBandedTableViewItemPlaceController.GetRootItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; +begin + Result := FRootItems[Index]; +end; + +function TdxGridBandedTableViewItemPlaceController.GetRootItemCount: Integer; +begin + Result := FRootItems.Count; +end; + +procedure TdxGridBandedTableViewItemPlaceController.SetLevelHeight(Index: Integer; Value: Integer); +begin + FLevelHeights[Index] := TObject(Value); +end; + +procedure TdxGridBandedTableViewItemPlaceController.FreeAndNilItems; +begin + ClearItems; + FreeAndNil(FItems); +end; + +{ TdxGridBandedTableViewFormatter } + +constructor TdxGridBandedTableViewFormatter.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited; + FBands := TList.Create; +end; + +destructor TdxGridBandedTableViewFormatter.Destroy; +begin + FreeAndNil(FBands); + inherited; +end; + +function TdxGridBandedTableViewFormatter.Adapter: TdxGridBandedTableViewAdapter; +begin + Result := Builder.Adapter; +end; + +function TdxGridBandedTableViewFormatter.Builder: TdxGridBandedTableViewBuilder; +begin + Result := inherited Builder as TdxGridBandedTableViewBuilder; +end; + +procedure TdxGridBandedTableViewFormatter.DoInitializeBandItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +var + Band: TcxGridBand; +begin + Band := Bands[AnIndex]; + SetViewParams(AnItem, GetBandItemViewParams(Band)); + if HasBackgroundBitmap(bbBandHeader) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbBandHeader); + + RegisterLookAndFeelItem(AnItem, cesRaised); + + with AnItem as TdxReportCellString do + begin + Data := Integer(Band); + EndEllipsis := Adapter.BandEndEllipsis; + Multiline := Adapter.BandHeaderMultiline; + Text := Band.Caption; + TextAlignX := TextAlignXMap[Band.HeaderAlignmentHorz]; + TextAlignY := TextAlignYMap[Band.HeaderAlignmentVert]; + //Transparent := False; {!!! v3.03} + end; +end; + +procedure TdxGridBandedTableViewFormatter.DoInitializeBandRow(ARow: TdxReportCell); +begin + SetViewParams(ARow, GetBandItemViewParams(nil)); + ARow.Transparent := True; //??? +end; + +procedure TdxGridBandedTableViewFormatter.DoReportLinkInitializeBandItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +begin + ReportLink.DoInitializeBandCell(Adapter.GridView, Bands[AnIndex], TdxReportCellString(AnItem)); +end; + +function TdxGridBandedTableViewFormatter.GetBandItemBounds(AnIndex: Integer): TRect; +var + Item: TdxCustomGridBandedTableViewItemPlace; +begin + Item := ItemPlaceController.ItemsByBand[Bands[AnIndex]]; + if Item <> nil then + Result := Item.Bounds + else + Result := dxPSGlbl.NullRect; +end; + +function TdxGridBandedTableViewFormatter.GetBandItemClass(AnIndex: Integer): TdxReportCellTextClass; +begin + Result := TdxReportCellString; +end; + +function TdxGridBandedTableViewFormatter.GetBandItemViewParams(ABand: TcxGridBand): TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetBandHeaderParams(ABand, Result.NativeParams) + else + Result.NativeParams := Adapter.GetBandHeaderViewParams(ABand); + + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + if ABand <> nil then + begin + Result.NativeParams.Color := Adapter.ThemedBandHeaderItemColor; + Result.NativeParams.TextColor := Adapter.ThemedBandHeaderItemTextColor; + end; + + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); // ReportLink.FixedTransparent; +end; + +procedure TdxGridBandedTableViewFormatter.AddHorizontalDelimiters; +var + Origin, I: Integer; + R: TRect; + Item: TdxCustomGridBandedTableViewItemPlace; +begin + if ReportLink.OptionsPagination.Band then + begin + Origin := ViewWidthExtraBefore; + for I := 0 to BandCount - 1 do + begin + Item := ItemPlaceController.ItemsByBand[Bands[I]]; + if Item <> nil then + begin + R := Item.Bounds; + ReportLink.AddHorizontalDelimiter(Origin + R.Left); + ReportLink.AddHorizontalDelimiter(Origin + R.Right); + end; + end; + end; + inherited; +end; + +function TdxGridBandedTableViewFormatter.GetItemPlaceControllerClass: TdxCustomGridTableViewItemPlaceControllerClass; +begin + Result := TdxGridBandedTableViewItemPlaceController; +end; + +procedure TdxGridBandedTableViewFormatter.BuildBandList; +var + I: Integer; + Band: TcxGridBand; +begin + FBands.Clear; + for I := 0 to Adapter.BandCount - 1 do + begin + Band := Adapter.Bands[I]; + if IsBandActuallyVisible(Band) then FBands.Add(Band); + end; +end; + +procedure TdxGridBandedTableViewFormatter.BuildItemLists; +begin + BuildBandList; + inherited; +end; + +function TdxGridBandedTableViewFormatter.IsBandActuallyVisible(ABand: TcxGridBand): Boolean; +begin + Result := True; +end; + +function TdxGridBandedTableViewFormatter.MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; +begin + case AGridBackgroundBitmapIndex of + bbBandHeader: + Result := vspsGridBandHeader; + else + Result := 0; + end; + + if Result = 0 then + Result := inherited MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex); +end; + +function TdxGridBandedTableViewFormatter.GetBand(Index: Integer): TcxGridBand; +begin + Result := FBands[Index]; +end; + +function TdxGridBandedTableViewFormatter.GetBandCount: Integer; +begin + Result := FBands.Count; +end; + +function TdxGridBandedTableViewFormatter.GetColumn(Index: Integer): TcxGridBandedColumn; +begin + Result := inherited Columns[Index] as TcxGridBandedColumn; +end; + +function TdxGridBandedTableViewFormatter.GetItemPlaceController: TdxGridBandedTableViewItemPlaceController; +begin + Result := inherited ItemPlaceController as TdxGridBandedTableViewItemPlaceController; +end; + +function TdxGridBandedTableViewFormatter.GetShowBandHeaders: Boolean; +begin + Result := ReportLink.OptionsView.BandHeaders; +end; + +{ TdxGridBandedTableViewBuilder } + +function TdxGridBandedTableViewBuilder.Adapter: TdxGridBandedTableViewAdapter; +begin + Result := inherited Adapter as TdxGridBandedTableViewAdapter; +end; + +class function TdxGridBandedTableViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxGridBandedTableViewAdapter; +end; + +function TdxGridBandedTableViewBuilder.Formatter: TdxGridBandedTableViewFormatter; +begin + Result := inherited Formatter as TdxGridBandedTableViewFormatter; +end; + +class function TdxGridBandedTableViewBuilder.FormatterClass: TdxGridViewFormatterClass; +begin + Result := TdxGridBandedTableViewFormatter; +end; + +procedure TdxGridBandedTableViewBuilder.DoBuildViewBody; +begin + if Formatter.ShowBandHeaders then CreateBands; + if Formatter.ShowHeaders then CreateHeader; + CreateRows; + if Formatter.ShowFooters then CreateFooter; +end; + +procedure TdxGridBandedTableViewBuilder.CreateBands; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetBandsProducer.Produce(HostInfoServices.BandHeadersHostInfo); + AddReportRow(ReportRow); +end; + +function TdxGridBandedTableViewBuilder.GetBandsProducer: TdxGridTableViewBandsProducer; +begin + Result := ProducerCache[GetBandsProducerClass] as TdxGridTableViewBandsProducer; +end; + +function TdxGridBandedTableViewBuilder.GetBandsProducerClass: TdxGridTableViewBandsProducerClass; +begin + Result := TdxGridTableViewBandsProducer; +end; + +function TdxGridBandedTableViewBuilder.GridView: TcxGridBandedTableView; +begin + Result := inherited GridView as TcxGridBandedTableView; +end; + +class function TdxGridBandedTableViewBuilder.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridBandedTableView; +end; + +{ TdxGridDBBandedTableViewAdapter } + +function TdxGridDBBandedTableViewAdapter.GridView: TcxGridDBBandedTableView; +begin + Result := inherited GridView as TcxGridDBBandedTableView; +end; + +class function TdxGridDBBandedTableViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridDBBandedTableView; +end; + +procedure TdxGridDBBandedTableViewAdapter.AfterBuilding; +begin + UnloadAllRecords; + inherited; +end; + +procedure TdxGridDBBandedTableViewAdapter.BeforeBuilding; +begin + inherited; + LoadAllRecords; +end; + +function TdxGridDBBandedTableViewAdapter.DataController: TcxGridDBDataController; +begin + Result := TcxGridDBDataController(inherited DataController); +end; + +function TdxGridDBBandedTableViewAdapter.DBDataModeController: TcxDBDataModeController; +begin + Result := DataController.DataModeController; +end; + +procedure TdxGridDBBandedTableViewAdapter.LoadAllRecords; +begin + _LoadAllRecords(DBDataModeController, FPrevAllRecordsAreLoaded); +end; + +procedure TdxGridDBBandedTableViewAdapter.UnloadAllRecords; +begin + _UnloadAllRecords(DBDataModeController, FPrevAllRecordsAreLoaded); +end; + +{ TdxGridDBBandedTableViewBuilder } + +function TdxGridDBBandedTableViewBuilder.Adapter: TdxGridDBBandedTableViewAdapter; +begin + Result := inherited Adapter as TdxGridDBBandedTableViewAdapter; +end; + +class function TdxGridDBBandedTableViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxGridDBBandedTableViewAdapter; +end; + +{ TdxGridCardViewAdapter } + +function TdxGridCardViewAdapter.GridView: TcxGridCardView; +begin + Result := inherited GridView as TcxGridCardView; +end; + +class function TdxGridCardViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridCardView; +end; + +function TdxGridCardViewAdapter.Styles: TcxGridCardViewStyles; +begin + Result := inherited Styles as TcxGridCardViewStyles; +end; + +procedure TdxGridCardViewAdapter.GetVisibleCardRows(ACard: TcxGridCard; AList: TList); +var + I: Integer; +begin + for I := 0 to CardRowCount - 1 do + AList.Add(CardRows[I]); +end; + +procedure TdxGridCardViewAdapter.ExpandAllRows(AnOptionsExpanding: TdxGridReportLinkOptionsExpanding; + ARecursive: Boolean); +begin +end; + +function TdxGridCardViewAdapter.IsFirstRow(ACardRow: TcxGridCardViewRow): Boolean; +begin + Result := ACardRow.VisibleIndex = 0; +end; + +function TdxGridCardViewAdapter.IsLastRow(ACardRow: TcxGridCardViewRow): Boolean; +begin + Result := ACardRow.VisibleIndex = CardRowCount - 1; +end; + +function TdxGridCardViewAdapter.GetAreAllMasterRowsCollapsed: Boolean; +begin + Result := True; +end; + +function TdxGridCardViewAdapter.GetCaptionRowViewParams(ARecord: TcxCustomGridRecord; + ACardRow: TcxGridCardViewRow): TcxViewParams; +begin + if (ACardRow <> nil) and (ACardRow.Styles.CaptionRow <> nil) then + ACardRow.Styles.GetCaptionRowParams(ARecord, Result) + else + Styles.GetCaptionRowParams(ARecord, ACardRow, Result); +end; + +function TdxGridCardViewAdapter.GetCardViewParams(ARecord: TcxCustomGridRecord): TcxViewParams; +begin + Styles.GetContentParams(ARecord, nil, Result); +end; + +function TdxGridCardViewAdapter.GetContentViewParams(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem): TcxViewParams; +begin + if TcxGridCardViewRow(ATableItem).Kind = rkData then + Result := inherited GetContentViewParams(ARecord, ATableItem) + else + Result := GetCaptionRowViewParams(ARecord, TcxGridCardViewRow(ATableItem)); +end; + +function TdxGridCardViewAdapter.GetRowCaptionViewParams(ARecord: TcxCustomGridRecord; + ACardRow: TcxGridCardViewRow): TcxViewParams; +begin + if (ACardRow <> nil) and (ACardRow.Kind = rkData) then + if ACardRow.Styles.Caption <> nil then + ACardRow.Styles.GetCaptionParams(ARecord, Result) + else + Styles.GetRowCaptionParams(ARecord, ACardRow, Result) + else + Result := GetCaptionRowViewParams(ARecord, ACardRow); +end; + +function TdxGridCardViewAdapter.GetCaptionSeparator: string; +begin + Result := GridView.OptionsView.CaptionSeparator; +end; + +function TdxGridCardViewAdapter.GetCard(Index: Integer): TcxGridCard; +begin + Result := Records[Index] as TcxGridCard; +end; + +function TdxGridCardViewAdapter.GetCardCount: Integer; +begin + Result := RecordCount; +end; + +function TdxGridCardViewAdapter.GetCardCaptionWidth: Integer; +begin + Result := GridView.OptionsView.CaptionWidth; +end; + +function TdxGridCardViewAdapter.GetCardRow(Index: Integer): TcxGridCardViewRow; +begin + Result := GridView.VisibleRows[Index]; +end; + +function TdxGridCardViewAdapter.GetCardRowCount: Integer; +begin + Result := GridView.VisibleRowCount; +end; + +function TdxGridCardViewAdapter.GetCardSeparatorColor: Integer; +begin + Result := GridView.OptionsView.SeparatorColor; +end; + +function TdxGridCardViewAdapter.GetCardSeparatorThickness: Integer; +begin + Result := GridView.OptionsView.SeparatorWidth; +end; + +function TdxGridCardViewAdapter.GetCardWidth: Integer; +begin + Result := GridView.OptionsView.CardWidth; +end; + +function TdxGridCardViewAdapter.GetHasCardsSeparator: Boolean; +begin + Result := CardSeparatorThickness <> 0; +end; + +function TdxGridCardViewAdapter.GetRowAutoHeight: Boolean; +begin + with GridView.OptionsView do + Result := CellAutoHeight or RowCaptionAutoHeight; +end; + +function TdxGridCardViewAdapter.GetRowCaptionAutoHeight: Boolean; +begin + Result := GridView.OptionsView.RowCaptionAutoHeight; +end; + +function TdxGridCardViewAdapter.GetRowCaptionEndEllipsis: Boolean; +begin + Result := GridView.OptionsView.RowCaptionEndEllipsis; +end; + +function TdxGridCardViewAdapter.GetShowRowCaption(Index: Integer): Boolean; +begin + Result := CardRows[Index].Options.ShowCaption; +end; + +{ TdxGridCardViewFormatter } + +function TdxGridCardViewFormatter.Adapter: TdxGridCardViewAdapter; +begin + Result := Builder.Adapter; +end; + +function TdxGridCardViewFormatter.Builder: TdxGridCardViewBuilder; +begin + Result := inherited Builder as TdxGridCardViewBuilder; +end; + +procedure TdxGridCardViewFormatter.DoInitializeCard(ACard: TdxReportCard; + AGridCard: TcxGridCard); +begin + with ReportLink.OptionsCards.Shadow do + begin + ACard.ShadowColor := ActualColor; + ACard.ShadowDepth := Depth; + ACard.ShadowPosition := Position; + end; + + SetViewParams(ACard, GetCardViewParams(AGridCard)); + + ACard.Data := Integer(AGridCard); + ACard.Width := Adapter.CardWidth; + ACard.CreateRows(Builder); +end; + +procedure TdxGridCardViewFormatter.DoInitializeCardsRow(ACard: TdxReportCell); +begin + if HasBackgroundBitmap(bbBackground) then + ACard.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbBackground); + ACard.CellSides := []; +end; + +function TdxGridCardViewFormatter.GetCardClass(AGridCard: TcxGridCard): TdxReportCardClass; +begin + Result := TdxReportCard; +end; + +function TdxGridCardViewFormatter.GetCardViewParams(ARecord: TcxCustomGridRecord): TdxReportItemViewParams; +begin + Result.NativeParams := Adapter.GetCardViewParams(ARecord); + Result.CellSides := csAll;//[]; // because of Card Shadow + Result.FontStyle := []; + Result.Transparent := True; +end; + +procedure TdxGridCardViewFormatter.DoInitializeCardRowCaption(AnItem: TdxReportCellText; + ACardRow: TcxGridCardViewRow; AGridCard: TcxGridCard); +const + BackgroundBitmapIndexes: array[TcxGridCardViewRowKind] of Integer = (bbRowCaption, bbCaptionRow); +begin + SetViewParams(AnItem, GetCardRowCaptionViewParams(AGridCard, ACardRow)); + if HasBackgroundBitmap(BackgroundBitmapIndexes[ACardRow.Kind]) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(BackgroundBitmapIndexes[ACardRow.Kind]); + + with AnItem as TdxReportCellString do + begin + EndEllipsis := Adapter.RowCaptionEndEllipsis; + Multiline := {True; //}not EndEllipsis and not CaptionAutoWidth and Adapter.RowCaptionAutoHeight; + TextAlignX := TextAlignXMap[ACardRow.CaptionAlignmentHorz]; + if Multiline then + TextAlignY := TextAlignYMap[ACardRow.CaptionAlignmentVert] + else + TextAlignY := taTop; + end; + AnItem.Text := ACardRow.Caption + Adapter.CaptionSeparator; +end; + +procedure TdxGridCardViewFormatter.DoReportLinkInitializeCardRowCaption(AnItem: TdxReportCellText; + ACardRow: TcxGridCardViewRow; AGridCard: TcxGridCard); +begin + ReportLink.DoInitializeCardRowCaptionCell(Adapter.GridView, AGridCard, ACardRow, TdxReportCellString(AnItem)); +end; + +function TdxGridCardViewFormatter.GetCardRowCaptionClass(ACardRow: TcxGridCardViewRow): TdxReportCellTextClass; +begin + Result := TdxReportCellString; +end; + +function TdxGridCardViewFormatter.GetCardRowCaptionViewParams(ARecord: TcxCustomGridRecord; + ACardRow: TcxGridCardViewRow): TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + if ACardRow.Kind = rkData then + ReportLink.Styles.GetCardRowCaptionParams(ARecord, ACardRow, Result.NativeParams) + else + if CanProcessSelectionStyle(ARecord) then + ReportLink.Styles.GetSelectionParams(Result.NativeParams) + else + ReportLink.Styles.GetCardCaptionRowParams(ARecord, ACardRow, Result.NativeParams) + else + if (ACardRow.Kind = rkCaption) and CanProcessSelectionStyle(ARecord) then + Result.NativeParams := Adapter.GetSelectionViewParams + else + Result.NativeParams := Adapter.GetRowCaptionViewParams(ARecord, ACardRow); + + // v.3.1 - because of fact that each Card in Grid v.5 might has different number of Rows, + // CellSides initialization was moved inside ReportCard + Result.CellSides := []; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); // ReportLink.FixedTransparent +end; + +procedure TdxGridCardViewFormatter.DoReportLinkInitializeCardRowData(AnItem: TAbstractdxReportCellData; + ACardRow: TcxGridCardViewRow; AGridCard: TcxGridCard); +begin + ReportLink.DoInitializeCardRowDataCell(Adapter.GridView, AGridCard, ACardRow, TdxReportCellString(AnItem)); +end; + +function TdxGridCardViewFormatter.GetItemViewParams(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False): TdxReportItemViewParams; +var + CardRow: TcxGridCardViewRow; +begin + CardRow := TcxGridCardViewRow(ATableItem); + if ReportLink.OptionsFormatting.UseNativeStyles then + if CardRow.Kind = rkData then + ReportLink.Styles.GetContentParams(ARecord, CardRow, Result.NativeParams) + else + if CanProcessSelectionStyle(ARecord) then + ReportLink.Styles.GetSelectionParams(Result.NativeParams) + else + ReportLink.Styles.GetCardCaptionRowParams(ARecord, CardRow, Result.NativeParams) + else + if CardRow.Kind = rkData then + Result := inherited GetItemViewParams(ATableItem, ARecord, AnIsPreview) + else + if CanProcessSelectionStyle(ARecord) then + Result.NativeParams := Adapter.GetSelectionViewParams + else + Result.NativeParams := Adapter.GetCaptionRowViewParams(ARecord, CardRow); + + // v.3.1 - because fact that each Card in Grid v.5 might has different number of Rows, + // CellSides initialization was moved inside ReportCard + Result.CellSides := []; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); // ReportLink.FixedTransparent +end; + +procedure TdxGridCardViewFormatter.AddHorizontalDelimiters; +var + I: Integer; +begin + for I := 0 to Builder.CardCount - 1 do + ReportLink.AddHorizontalDelimiter(Builder.Cards[I].AbsoluteRect.Right); +end; + +procedure TdxGridCardViewFormatter.AddVerticalDelimiters; +var + I: Integer; +begin + if NeedDelimitByRows then + begin + for I := 0 to Builder.CardCount - 1 do + Builder.Cards[I].AddVerticalDelimiters; + end + else + inherited; +end; + +function TdxGridCardViewFormatter.GetViewWidth: Integer; +var + MasterBuilder: TdxCustomGridViewBuilder; +begin + MasterBuilder := Builder.MasterBuilder; + if MasterBuilder <> nil then + begin + Result := MasterBuilder.Formatter.ViewWidth - MasterBuilder.Adapter.ViewWidthExtra; + if HasDetailsSeparator then + Dec(Result, 2 * DetailsSeparatorThickness); + end + else + begin + Result := SiteWidth; + if HasDetailsSeparator then + Dec(Result, 2 * DetailsSeparatorThickness); + if Result < Builder.MaxCardWidth + FirstCardOffset then + Result := Builder.MaxCardWidth + FirstCardOffset; + end; +end; + +function TdxGridCardViewFormatter.MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; +begin + case AGridBackgroundBitmapIndex of + bbCaptionRow: + Result := vspsGridCardCaptionRow; + bbRowCaption: + Result := vspsGridCardRowCaption; + else + Result := 0; + end; + + if Result = 0 then + Result := inherited MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex); +end; + +function TdxGridCardViewFormatter.GetContentBackgroundBitmapStyleIndex(ATableItem: TcxCustomGridTableItem): Integer; +const + BackgroundBitmapIndexes: array[TcxGridCardViewRowKind] of Integer = (bbContent, bbCaptionRow); +begin + Result := BackgroundBitmapIndexes[TcxGridCardViewRow(ATableItem).Kind]; +end; + +function TdxGridCardViewFormatter.NeedDelimitByRows: Boolean; +{var + I: Integer;} +begin + Result := False; + {if MasterBuilder = nil then + for I := 0 to Builder.CardCount - 1 do + if Builder.Cards[I].Height > SiteHeight then + begin + Result := True; + Exit; + end;} +end; + +function TdxGridCardViewFormatter.GetAutoWidth: Boolean; +begin + Result := ReportLink.OptionsCards.AutoWidth; +end; + +function TdxGridCardViewFormatter.GetCaptionAutoWidth: Boolean; +begin + Result := Adapter.CardCaptionWidth = 0; +end; + +function TdxGridCardViewFormatter.GetCard(Index: Integer): TcxGridCard; +begin + Result := TcxGridCard(Records[Index]); +end; + +function TdxGridCardViewFormatter.GetCardCount: Integer; +begin + Result := RecordCount; +end; + +function TdxGridCardViewFormatter.GetCardsAreaWidth: Integer; +begin + Result := ViewWidth - FirstCardOffset; +end; + +function TdxGridCardViewFormatter.GetInterCardsSpaceHorz: Integer; +begin + Result := ReportLink.OptionsCards.InterCardsSpaceHorz; +end; + +function TdxGridCardViewFormatter.GetInterCardsSpaceVert: Integer; +begin + Result := ReportLink.OptionsCards.InterCardsSpaceVert; +end; + +function TdxGridCardViewFormatter.GetKeepSameHeight: Boolean; +begin + Result := ReportLink.OptionsCards.KeepSameHeight; +end; + +function TdxGridCardViewFormatter.GetKeepSameWidth: Boolean; +begin + Result := ReportLink.OptionsCards.KeepSameWidth; +end; + +function TdxGridCardViewFormatter.GetRowAutoHeight: Boolean; +begin + Result := Adapter.RowAutoHeight; +end; + +{ TdxReportCardRow } + +constructor TdxReportCardRow.CreateEx(AParent: TdxReportCell; AGridCardRow: TcxGridCardViewRow); +begin + inherited Create(AParent); + CellSides := []; + Data := Integer(AGridCardRow); + Width := Card.RowsAvailableWidth; +end; + +function TdxReportCardRow.MeasureHeight(DC: HDC; ACalculateLineHeight: Boolean; + ABuilder: TdxGridCardViewBuilder): Integer; + + function MeasureCaptionHeight: Integer; + begin + Result := DefaultDataRowLineHeight; + if HasCaption then + if ACalculateLineHeight then + Result := RowCaption.MeasureFontHeight(DC) + else + Result := RowCaption.MeasureContentHeight(DC); + + if Result < DefaultDataRowLineHeight then + Result := DefaultDataRowLineHeight; + end; + + function MeasureDataHeight: Integer; + var + MinHeight: Integer; + begin + MinHeight := RowData.MeasureFontHeight(DC); + if not ACalculateLineHeight then + begin + Result := RowData.MeasureContentHeight(DC); + if Result = 0 then + Result := MinHeight; + end + else + Result := MinHeight; + + ABuilder.DoGetCellHeight(Card.GridCard, GridCardRow, Result); + if Result < MinHeight then + Result := MinHeight; + end; + +begin + Result := Max(MeasureCaptionHeight, MeasureDataHeight); +end; + +function TdxReportCardRow.MeasureCaptionWidth(DC: HDC): Integer; +begin + if HasCaption then + Result := RowCaption.MeasureContentWidth(DC) + 2 + else + Result := 0; +end; + +function TdxReportCardRow.MeasureDataWidth(DC: HDC): Integer; +begin + if dxPSDataMaps.DoesItemParticipateInAutoWidthCalculation(Properties) then + Result := RowData.MeasureContentWidth(DC) + 2 + else + Result := 0; +end; + +procedure TdxReportCardRow.AdjustCellSides; +var + ReportLink: TdxGridReportLink; + Sides: TdxCellSides; +begin + ReportLink := Card.ReportLink; + if ReportLink.OptionsCards.Borders then + begin + Sides := []; + if IsFirstItem then Include(Sides, csTop); + if IsLastItem then Include(Sides, csBottom); + if HasCaption then + begin + RowCaption.CellSides := RowCaption.CellSides + Sides; + RowCaption.CellSides := RowCaption.CellSides + [csLeft]; + end; + RowData.CellSides := RowData.CellSides + Sides; + RowData.CellSides := RowData.CellSides + [csRight]; + if not HasCaption then + RowData.CellSides := RowData.CellSides + [csLeft]; + end; + + if ReportLink.OptionsCards.RowBordersHorz then + begin + Sides := []; + if not IsFirstItem then Include(Sides, csTop); + if not IsLastItem then Include(Sides, csBottom); + if HasCaption then + RowCaption.CellSides := RowCaption.CellSides + Sides; + RowData.CellSides := RowData.CellSides + Sides; + end; + + if ReportLink.OptionsCards.RowBordersVert then + if HasCaption then + begin + RowCaption.CellSides := RowCaption.CellSides + [csRight]; + RowData.CellSides := RowData.CellSides + [csLeft]; + end; +end; + +procedure TdxReportCardRow.CreateItems(ABuilder: TdxGridCardViewBuilder); +const + InitialCaptionWidth = 100; + + function HasRowCaption: Boolean; + begin + Result := ABuilder.Adapter.ShowRowCaption[Index]; + end; + + procedure CreateRowCaption; + var + RowCaption: TdxReportCellText; + begin + RowCaption := ABuilder.Formatter.GetCardRowCaptionClass(GridCardRow).Create(Self); + RowCaption.Width := InitialCaptionWidth; + RowCaption.Height := Height; + RowCaption.Data := Integer(TdxGridCardRowCaption); + ABuilder.Formatter.DoInitializeCardRowCaption(RowCaption, GridCardRow, Card.GridCard); + ABuilder.Formatter.DoReportLinkInitializeCardRowCaption(RowCaption, GridCardRow, Card.GridCard); + end; + + procedure CreateRowData; + var + RowData: TAbstractdxReportCellData; + begin + RowData := ABuilder.Formatter.GetItemClass(GridCardRow, Card.GridCard, False).Create(Self); + if HasRowCaption then + RowData.Left := InitialCaptionWidth + else + RowData.Left := 0; + RowData.Width := Parent.Width - Left; + RowData.Height := Height; + ABuilder.Formatter.DoInitializeItem(RowData, GridCardRow, Card.GridCard, False); + ABuilder.Formatter.DoReportLinkInitializeCardRowData(RowData, GridCardRow, Card.GridCard); + end; + +begin + if HasRowCaption then CreateRowCaption; + CreateRowData; + + Width := Width; + Height := Height; +end; + +function TdxReportCardRow.GetCard: TdxReportCard; +begin + Result := TdxReportCard(Parent); +end; + +function TdxReportCardRow.GetGridCardRow: TcxGridCardViewRow; +begin + Result := TcxGridCardViewRow(Data); +end; + +function TdxReportCardRow.GetHasCaption: Boolean; +begin + Result := DataItemCount > 1; +end; + +function TdxReportCardRow.GetHeight: Integer; +begin + Result := inherited Height; +end; + +function TdxReportCardRow.GetProperties: TcxCustomEditProperties; +begin + Result := GridCardRow.GetProperties; +end; + +function TdxReportCardRow.GetRowCaption: TdxReportCellText; +begin + if HasCaption then + Result := DataItems[0] as TdxReportCellText + else + Result := nil; +end; + +function TdxReportCardRow.GetRowData: TAbstractdxReportCellData; +begin + if DataItemCount > 0 then + if HasCaption then + Result := DataItems[1] + else + Result := DataItems[0] + else + Result := nil; +end; + +function TdxReportCardRow.GetWidth: Integer; +begin + Result := inherited Width; +end; + +procedure TdxReportCardRow.SetHeight(Value: Integer); +begin + inherited Height := Value; + if HasCaption then RowCaption.Height := Height; + RowData.Height := Height; +end; + +procedure TdxReportCardRow.SetRowCaptionWidth(Value: Integer); +begin + if HasCaption then + begin + RowCaption.Width := Value; + RowData.Left := Value; + RowData.Width := Width - Value; + + if RowCaption.Width >= Width then + RowCaption.CellSides := RowCaption.CellSides + [csRight]; + end; +end; + +procedure TdxReportCardRow.SetWidth(Value: Integer); +begin + inherited Width := Value; + + if RowCaption <> nil then + if RowCaption.Width > Width then RowCaption.Width := Width; + + if RowData <> nil then + begin + if RowData.Left > Width then RowData.Left := Width; + RowData.Width := Width - RowData.Left; + end; +end; + +{ TdxCardBorderPainter } + +function TdxCardBorderPainter.Card: TdxReportCard; +begin + Result := inherited Item as TdxReportCard; +end; + +procedure TdxCardBorderPainter.Paint(DC: HDC); +begin + if Card.HasShadow then DrawShadow(DC); +end; + +procedure TdxCardBorderPainter.DrawShadow(DC: HDC); +begin + Renderer.FillRect(DC, Card.ShadowRectHorz, Card.ShadowColor); + Renderer.FillRect(DC, Card.ShadowRectVert, Card.ShadowColor); +end; + +{ TdxReportCard } + +constructor TdxReportCard.Create(AParent: TdxReportCell); +begin + inherited; + ShadowColor := clBlack; + ShadowDepth := dxDefaultCardsShadowDepth; + ShadowPosition := cspBottomRight; +end; + +constructor TdxReportCard.CreateEx(AParent: TdxReportCell; AGridCard: TcxGridCard); +begin + Create(AParent); + Data := Integer(AGridCard); +end; + +function TdxReportCard.GetBorderOuterBounds(DC: HDC): TRect; +begin + Result := inherited GetBorderBounds(DC); + with Result do + case ShadowPosition of + cspTopLeft: + begin + Inc(Left, ShadowDepth); + Inc(Top, ShadowDepth); + end; + cspTopRight: + begin + Dec(Right, ShadowDepth); + Inc(Top, ShadowDepth); + end; + cspBottomRight: + begin + Dec(Right, ShadowDepth); + Dec(Bottom, ShadowDepth); + end; + cspBottomLeft: + begin + Inc(Left, ShadowDepth); + Dec(Bottom, ShadowDepth); + end; + end; +end; + +function TdxReportCard.IndexOfCardRow(ACardRow: TcxGridCardViewRow): Integer; +begin + for Result := 0 to CellCount - 1 do + if Rows[Result].GridCardRow = ACardRow then Exit; + Result := -1; +end; + +procedure TdxReportCard.AdjustHeight; +var + TotalHeight, I: Integer; +begin + TotalHeight := 0; + for I := 0 to RowCount - 1 do + Inc(TotalHeight, RowHeights[I]); + Height := TotalHeight; +end; + +procedure TdxReportCard.AdjustRowsCellSides; +var + I: Integer; +begin + for I := 0 to RowCount - 1 do + Rows[I].AdjustCellSides; +end; + +procedure TdxReportCard.AdjustRowsPos; +var + I: Integer; +begin + for I := 0 to RowCount - 1 do + with Rows[I] do + begin + Left := RowsOriginLeft; + Top := Top + RowsOriginTop; + end; +end; + +procedure TdxReportCard.AdjustRowsHeight(DC: HDC; AAutoHeight: Boolean; + ABuilder: TdxGridCardViewBuilder); +var + I: Integer; +begin + for I := 0 to RowCount - 1 do + RowHeights[I] := Rows[I].MeasureHeight(DC, not AAutoHeight, ABuilder); +end; + +procedure TdxReportCard.AdjustRowsWidth(DC: HDC); +begin + Width := RowCaptionWidth + MeasureDataWidth(DC); +end; + +function TdxReportCard.MeasureCaptionWidth(DC: HDC): Integer; +var + I, V: Integer; +begin + Result := 0; + for I := 0 to RowCount - 1 do + begin + V := Rows[I].MeasureCaptionWidth(DC); + if V > Result then Result := V; + end; +end; + +function TdxReportCard.MeasureDataWidth(DC: HDC): Integer; +var + I, V: Integer; +begin + Result := 0; + for I := 0 to RowCount - 1 do + begin + V := Rows[I].MeasureDataWidth(DC); + if V > Result then Result := V; + end; +end; + +procedure TdxReportCard.AddVerticalDelimiters; +var + I: Integer; +begin + for I := 0 to RowCount - 1 do + ReportLink.AddVerticalDelimiter(Rows[I]); +end; + +procedure TdxReportCard.ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); +begin + inherited; + FShadowDepth := MulDiv(FShadowDepth, APixelsNumerator, APixelsDenominator); +end; + +procedure TdxReportCard.CreateRows(ABuilder: TdxGridCardViewBuilder); +var + I: Integer; + List: TList; + CardRow: TdxReportCardRow; +begin + List := TList.Create; + try + ABuilder.Adapter.GetVisibleCardRows(GridCard, List); + + AllocateSpaceForCells(List.Count); + for I := 0 to List.Count - 1 do + begin + CardRow := TdxReportCardRow.CreateEx(Self, TcxGridCardViewRow(List[I])); + CardRow.CreateItems(ABuilder); + end; + finally + List.Free; + end; +end; + +function TdxReportCard.GetBorderPainterClass: TdxPSCellBorderPainterClass; +begin + Result := TdxCardBorderPainter; +end; + +procedure TdxReportCard.ReadProperties(AReader: TdxPSDataReader); +begin + inherited; + with AReader do + begin + FRowCaptionWidth := ReadInteger; + FShadowColor := ReadInteger; + FShadowDepth := ReadInteger; + FShadowPosition := TdxGridCardShadowPosition(ReadInteger); + end; +end; + +procedure TdxReportCard.WriteProperties(AWriter: TdxPSDataWriter); +begin + inherited; + with AWriter do + begin + WriteInteger(RowCaptionWidth); + WriteInteger(ShadowColor); + WriteInteger(ShadowDepth); + WriteInteger(Integer(ShadowPosition)); + end; +end; + +function TdxReportCard.GetGridCard: TcxGridCard; +begin + Result := TcxGridCard(Data); +end; + +function TdxReportCard.GetHasShadow: Boolean; +begin + Result := ShadowDepth > 0; +end; + +function TdxReportCard.GetHeight: Integer; +begin + Result := inherited Height; +end; + +function TdxReportCard.GetRowCount: Integer; +begin + Result := CellCount; +end; + +function TdxReportCard.GetReportLink: TdxGridReportLink; +begin + Result := TdxGridReportLink(ReportCells.ReportLink); +end; + +function TdxReportCard.GetRow(Index: Integer): TdxReportCardRow; +begin + Result := Cells[Index] as TdxReportCardRow; +end; + +function TdxReportCard.GetRowByCardRow(CardRow: TcxGridCardViewRow): TdxReportCardRow; +begin + Result := Rows[IndexOfCardRow(CardRow)]; +end; + +function TdxReportCard.GetRowHeight(Index: Integer): Integer; +begin + Result := Rows[Index].Height; +end; + +function TdxReportCard.GetRowsAvailableHeight: Integer; +begin + Result := Height - ShadowDepth; +end; + +function TdxReportCard.GetRowsAvailableWidth: Integer; +begin + Result := Width - ShadowDepth; +end; + +function TdxReportCard.GetRowsOriginLeft: Integer; +begin + if ShadowPosition in [cspTopLeft, cspBottomLeft] then + Result := ShadowDepth + else + Result := 0; +end; + +function TdxReportCard.GetRowsOriginTop: Integer; +begin + if ShadowPosition in [cspTopLeft, cspTopRight] then + Result := ShadowDepth + else + Result := 0; +end; + +function TdxReportCard.GetShadowRectHorz: TRect; +begin + Result := BoundsRect; + OffsetRect(Result, -Result.Left, -Result.Top); + with Result do + case ShadowPosition of + cspTopLeft: + begin + Right := Right - ShadowDepth; + Bottom := Top + ShadowDepth; + end; + cspTopRight: + begin + Left := Left + ShadowDepth; + Bottom := Top + ShadowDepth; + end; + cspBottomRight: + begin + Left := Left + ShadowDepth; + Top := Bottom - ShadowDepth; + end; + cspBottomLeft: + begin + Right := Right - ShadowDepth; + Top := Bottom - ShadowDepth; + end; + end; +end; + +function TdxReportCard.GetShadowRectVert: TRect; +begin + Result := BoundsRect; + OffsetRect(Result, -Result.Left, -Result.Top); + with Result do + case ShadowPosition of + cspTopLeft: + begin + Right := Left + ShadowDepth; + Top := Top + ShadowDepth; + Bottom := Bottom - ShadowDepth; + end; + cspTopRight: + begin + Left := Right - ShadowDepth; + Top := Top + ShadowDepth; + Bottom := Bottom - ShadowDepth; + end; + cspBottomRight: + begin + Left := Right - ShadowDepth; + Top := Top + ShadowDepth; + Bottom := Bottom - ShadowDepth; + end; + cspBottomLeft: + begin + Right := Left + ShadowDepth; + Top := Top + ShadowDepth; + Bottom := Bottom - ShadowDepth; + end; + end; +end; + +function TdxReportCard.GetWidth: Integer; +begin + Result := inherited Width; +end; + +procedure TdxReportCard.SetHeight(Value: Integer); +begin + inherited Height := Value + ShadowDepth; +end; + +procedure TdxReportCard.SetRowCaptionWidth(Value: Integer); +var + I: Integer; +begin + if Value < 0 then Value := 0; + + FRowCaptionWidth := Value; + for I := 0 to RowCount - 1 do + Rows[I].RowCaptionWidth := Value; +end; + +procedure TdxReportCard.SetRowHeight(Index, Value: Integer); +var + Delta, I: Integer; +begin + if Value < 0 then Value := 0; + + Delta := Value - Rows[Index].Height; + Rows[Index].Height := Value; + + for I := Index + 1 to RowCount - 1 do + Rows[I].Top := Rows[I].Top + Delta; +end; + +procedure TdxReportCard.SetShadowDepth2(Value: Integer); +var + SaveWidth, SaveHeight: Integer; +begin + if FShadowDepth <> Value then + begin + SaveHeight := RowsAvailableHeight; + SaveWidth := RowsAvailableWidth; + FShadowDepth := Value; + Height := SaveHeight; + Width := SaveWidth; + end; +end; + +procedure TdxReportCard.SetWidth(Value: Integer); +var + I: Integer; +begin + inherited Width := Value + ShadowDepth; + for I := 0 to RowCount - 1 do + Rows[I].Width := RowsAvailableWidth; +end; + +{ TdxGridCardViewBuilder } + +constructor TdxGridCardViewBuilder.Create(AReportLink: TdxGridReportLink; + AMasterBuilder: TdxCustomGridViewBuilder; AGridView: TcxCustomGridView); +begin + inherited; + FCards := TList.Create; +end; + +destructor TdxGridCardViewBuilder.Destroy; +begin + FreeAndNil(FCards); + inherited; +end; + +function TdxGridCardViewBuilder.Adapter: TdxGridCardViewAdapter; +begin + Result := inherited Adapter as TdxGridCardViewAdapter; +end; + +class function TdxGridCardViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxGridCardViewAdapter; +end; + +function TdxGridCardViewBuilder.Formatter: TdxGridCardViewFormatter; +begin + Result := inherited Formatter as TdxGridCardViewFormatter; +end; + +class function TdxGridCardViewBuilder.FormatterClass: TdxGridViewFormatterClass; +begin + Result := TdxGridCardViewFormatter; +end; + +procedure TdxGridCardViewBuilder.DoBuildViewBody; +begin + CreateCards; + if not IsAborted then + begin + ResizeCards; + PlaceCards; + AdjustCardRowsCellSides; + end; +end; + +procedure TdxGridCardViewBuilder.AdjustCardRowsCellSides; +var + I: Integer; +begin + for I := 0 to CardCount - 1 do + Cards[I].AdjustRowsCellSides; +end; + +procedure TdxGridCardViewBuilder.CreateCards; +var + Producer: TdxGridCardViewCardsRowProducer; + I: Integer; +begin + Producer := GetCardsRowProducer; + + FCards.Count := Formatter.CardCount; + for I := 0 to CardCount - 1 do + begin + FCards[I] := Producer.CreateCard(Host, Formatter.Cards[I]); + if MasterBuilder = nil then + begin + Progress(100 * (I + 1) / Formatter.CardCount); + if IsAborted then Break; + end; + end; +end; + +procedure TdxGridCardViewBuilder.PlaceCards; + + procedure MakeRowIndexes(AnIndexes: TList); + var + I, PlaceWidth, EntryNumber: Integer; + begin + I := 0; + if CardCount > 0 then AnIndexes.Add(TObject(0)); + + while I < CardCount do + begin + PlaceWidth := Formatter.CardsAreaWidth; + EntryNumber := 0; + repeat + Inc(EntryNumber); + if EntryNumber > 1 then + Dec(PlaceWidth, Formatter.InterCardsSpaceHorz); + Dec(PlaceWidth, Cards[I].Width); + if (PlaceWidth >= 0) or (EntryNumber = 1) then + Inc(I); + until (PlaceWidth <= 0) or (I >= CardCount); + AnIndexes.Add(TObject(I)); + end; + end; + + procedure MakeRows(AIndexes: TList; AProducer: TdxGridCardViewCardsRowProducer); + + function GetMaxCardHeight(AStartIndex, AEndIndex: Integer): Integer; + var + I, V: Integer; + begin + Result := Cards[AStartIndex].Height; + if not Formatter.KeepSameHeight then + for I := AStartIndex + 1 to AEndIndex do + begin + V := Cards[I].Height; + if Result < V then Result := V; + end; + end; + + var + RowIndex, StartIndex, EndIndex, I, RowHeight: Integer; + ReportRow: TdxReportCell; + begin + for RowIndex := 0 to AIndexes.Count - 2 do + begin + StartIndex := Integer(AIndexes[RowIndex]); + EndIndex := Integer(AIndexes[RowIndex + 1]) - 1; + + RowHeight := GetMaxCardHeight(StartIndex, EndIndex) + Formatter.InterCardsSpaceHorz; + ReportRow := AProducer.Produce(HostInfoServices.PageDetailsHostInfo, RowHeight); + AddReportRow(ReportRow); + + for I := StartIndex to EndIndex do + AProducer.InjectCard(Cards[I], I - StartIndex); + end; + end; + +var + Indexes: TList; +begin + Indexes := TList.Create; + try + MakeRowIndexes(Indexes); + MakeRows(Indexes, GetCardsRowProducer); + finally + Indexes.Free; + end; +end; + +procedure TdxGridCardViewBuilder.ResizeCards; + + procedure SetCardsRowCaptionWidth(DC: HDC); + var + RowCaptionWidth, I, V: Integer; + begin + if Formatter.CaptionAutoWidth then + begin + RowCaptionWidth := 0; + for I := 0 to CardCount - 1 do + begin + V := Cards[I].MeasureCaptionWidth(DC); + if V > RowCaptionWidth then RowCaptionWidth := V; + end; + end + else + RowCaptionWidth := Adapter.CardCaptionWidth; + + if (RowCaptionWidth > Adapter.CardWidth) and not Formatter.AutoWidth then + RowCaptionWidth := Adapter.CardWidth; + + for I := 0 to CardCount - 1 do + Cards[I].RowCaptionWidth := RowCaptionWidth; + end; + + procedure CalcMaxCardWidth; + var + I, V: Integer; + begin + FMaxCardWidth := 0; + for I := 0 to CardCount - 1 do + begin + V := Cards[I].Width; + if V > FMaxCardWidth then FMaxCardWidth := V; + end; + end; + + procedure SetCardsAutoWidth(DC: HDC); + var + I: Integer; + begin + for I := 0 to CardCount - 1 do + Cards[I].AdjustRowsWidth(DC); + end; + + procedure SetSameCardsWidth(AWidth: Integer); + var + I: Integer; + begin + for I := 0 to CardCount - 1 do + Cards[I].Width := AWidth; + end; + + procedure SetCardsRowHeight(DC: HDC; AAutoHeight: Boolean); + var + I: Integer; + begin + for I := 0 to CardCount - 1 do + Cards[I].AdjustRowsHeight(DC, AAutoHeight, Self); + end; + + procedure SetCardsSameHeights; + var + CardRowHeights: array of Integer; + I, J, RowIndex: Integer; + Card: TdxReportCard; + Row: TdxReportCardRow; + begin + SetLength(CardRowHeights, Adapter.CardRowCount); + + for I := 0 to CardCount - 1 do + begin + Card := Cards[I]; + for J := 0 to Card.RowCount - 1 do + begin + Row := Card.Rows[J]; + RowIndex := Row.GridCardRow.VisibleIndex; + if CardRowHeights[RowIndex] < Row.Height then + CardRowHeights[RowIndex] := Row.Height; + end; + end; + + for I := 0 to CardCount - 1 do + begin + Card := Cards[I]; + for J := 0 to Card.RowCount - 1 do + begin + RowIndex := Card.Rows[J].GridCardRow.VisibleIndex; + Card.RowHeights[J] := CardRowHeights[RowIndex]; + end; + end; + end; + + procedure AdjustCards; + var + I: Integer; + begin + for I := 0 to CardCount - 1 do + with Cards[I] do + begin + AdjustHeight; + AdjustRowsPos; + end; + end; + +begin + FMaxCardWidth := 0; + SetCardsRowCaptionWidth(Formatter.DC); + if Formatter.AutoWidth then + begin + SetCardsAutoWidth(Formatter.DC); + CalcMaxCardWidth; + if Formatter.KeepSameWidth then SetSameCardsWidth(FMaxCardWidth - 4); + end; + CalcMaxCardWidth; + + SetCardsRowHeight(Formatter.DC, Formatter.RowAutoHeight); + if Formatter.KeepSameHeight then SetCardsSameHeights; + + AdjustCards; +end; + +function TdxGridCardViewBuilder.GetCardsRowProducer: TdxGridCardViewCardsRowProducer; +begin + Result := ProducerCache[GetCardsRowProducerClass] as TdxGridCardViewCardsRowProducer; +end; + +function TdxGridCardViewBuilder.GetCardsRowProducerClass: TdxGridCardViewCardsRowProducerClass; +begin + Result := TdxGridCardViewCardsRowProducer; +end; + +function TdxGridCardViewBuilder.GridView: TcxGridCardView; +begin + Result := inherited GridView as TcxGridCardView; +end; + +class function TdxGridCardViewBuilder.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridCardView; +end; + +function TdxGridCardViewBuilder.GetCard(Index: Integer): TdxReportCard; +begin + Result := FCards[Index]; +end; + +function TdxGridCardViewBuilder.GetCardCount: Integer; +begin + Result := FCards.Count; +end; + +{ TdxGridDBCardViewAdapter } + +function TdxGridDBCardViewAdapter.GridView: TcxGridDBCardView; +begin + Result := inherited GridView as TcxGridDBCardView; +end; + +class function TdxGridDBCardViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridCardView; +end; + +procedure TdxGridDBCardViewAdapter.AfterBuilding; +begin + UnloadAllRecords; + inherited; +end; + +procedure TdxGridDBCardViewAdapter.BeforeBuilding; +begin + inherited; + LoadAllRecords; +end; + +function TdxGridDBCardViewAdapter.DataController: TcxGridDBDataController; +begin + Result := TcxGridDBDataController(inherited DataController); +end; + +function TdxGridDBCardViewAdapter.DBDataModeController: TcxDBDataModeController; +begin + Result := DataController.DataModeController; +end; + +procedure TdxGridDBCardViewAdapter.LoadAllRecords; +begin + _LoadAllRecords(DBDataModeController, FPrevAllRecordsAreLoaded); +end; + +procedure TdxGridDBCardViewAdapter.UnloadAllRecords; +begin + _UnloadAllRecords(DBDataModeController, FPrevAllRecordsAreLoaded); +end; + +{ TdxGridDBCardViewBuilder } + +function TdxGridDBCardViewBuilder.Adapter: TdxGridDBCardViewAdapter; +begin + Result := inherited Adapter as TdxGridDBCardViewAdapter; +end; + +class function TdxGridDBCardViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxGridDBCardViewAdapter; +end; + +{ TdxGridViewRowProducer } + +constructor TdxGridViewRowProducer.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited Create; + FBuilder := ABuilder; + FMasterIndents := TList.Create; +end; + +destructor TdxGridViewRowProducer.Destroy; +begin + FMasterIndents.Free; + inherited; +end; + +function TdxGridViewRowProducer.Adapter: TdxCustomGridViewAdapter; +begin + Result := Builder.Adapter; +end; + +function TdxGridViewRowProducer.Builder: TdxCustomGridViewBuilder; +begin + Result := FBuilder; +end; + +function TdxGridViewRowProducer.Formatter: TdxCustomGridViewFormatter; +begin + Result := Builder.Formatter; +end; + +function TdxGridViewRowProducer.Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; +begin + FMasterIndents.Clear; + + CalculateRowHeight; + + CreateRowHost(AHostInfo); + CreateRow; + if AutoHeight then + begin + CalculateRowAutoHeight; + FixupRowHeight; + end; + + Inc(AHostInfo.Origin.Y, RowHeight); + Result := Host; +end; + +procedure TdxGridViewRowProducer.AddLeadingMasterIndentsAndSeparators; +var + LeftPos, I: Integer; +begin + LeftPos := 0; + for I := 0 to Formatter.AbsoluteLevel - 1 do + with MasterBuilders[I] do + begin + AddMasterSeparator(Formatter, Adapter, LeftPos, vdskLeading); + AddMasterIndents(Formatter, Adapter, I, LeftPos); + end; + AddMasterSeparator(Formatter, Adapter, LeftPos, vdskLeading); +end; + +procedure TdxGridViewRowProducer.AddMasterIndents(AMasterFormatter: TdxCustomGridViewFormatter; + AMasterAdapter: TdxCustomGridViewAdapter; ALevel: Integer; var ALeftPos: Integer); +var + I: Integer; + Indent: TdxReportCellExpandButton; +begin + for I := 0 to AMasterAdapter.IndentCount - 1 do + begin + Indent := CreateMasterIndent(Host); + Indent.BoundsRect := MakeBounds(ALeftPos, 0, AMasterAdapter.IndentWidth, RowHeight); + InitializeMasterIndent(AMasterFormatter, Indent, I, ALevel); + Inc(ALeftPos, Indent.Width); + end; +end; + +procedure TdxGridViewRowProducer.AddMasterSeparator(AMasterFormatter: TdxCustomGridViewFormatter; + AMasterAdapter: TdxCustomGridViewAdapter; var ALeftPos: Integer; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); +var + Separator: TdxReportCellBox; +begin + if AMasterAdapter.HasDetailsSeparator then + begin + Separator := CreateDetailsSeparator(Host); + Separator.BoundsRect := MakeBounds(ALeftPos, 0, AMasterFormatter.DetailsSeparatorThickness, RowHeight); + InitializeDetailsSeparator(AMasterFormatter, Separator, ASeparatorKind); + Inc(ALeftPos, Separator.Width); + end; +end; + +procedure TdxGridViewRowProducer.AddTrailingMasterSeparators; +var + LeftPos, I: Integer; +begin + LeftPos := Width - Formatter.ViewWidthExtraAfter; + AddMasterSeparator(Formatter, Adapter, LeftPos, vdskTrailing); + for I := Formatter.AbsoluteLevel - 1 downto 0 do + with Builder.AbsoluteBuilders[I] do + AddMasterSeparator(Formatter, Adapter, LeftPos, vdskTrailing); +end; + +function TdxGridViewRowProducer.CalculateItemHeight(DC: HDC; AnItem: TdxReportVisualItem): Integer; +begin + Result := AnItem.MeasureContentHeight(DC); +end; + +procedure TdxGridViewRowProducer.CalculateRowAutoHeight; +var + DC: HDC; + ItemsSite: TdxReportCell; + MaxRowHeight, I, V: Integer; + Item: TdxReportVisualItem; +begin + DC := Self.DC; + ItemsSite := Self.ItemsSite; + MaxRowHeight := 0; + for I := 0 to ItemsSite.DataItemCount - 1 do + begin + Item := ItemsSite.DataItems[I]; + if DoesItemParticipateInRowAutoHeightCalculation(Item) then + begin + V := CalculateItemHeight(DC, Item); + if MaxRowHeight < V then MaxRowHeight := V; + end; + end; + {3.1} + for I := 0 to ItemsSite.CellCount - 1 do + begin + Item := ItemsSite.Cells[I]; + if DoesItemParticipateInRowAutoHeightCalculation(Item) then + begin + V := CalculateItemHeight(DC, Item); + if MaxRowHeight < V then MaxRowHeight := V; + end; + end; + if RowHeight < MaxRowHeight then + RowHeight := MaxRowHeight; +end; + +procedure TdxGridViewRowProducer.CalculateRowHeight; +begin + FRowHeight := LineCount * LineHeight; +end; + +function TdxGridViewRowProducer.CreateDetailsSeparator(AParent: TdxReportCell): TdxReportCellBox; +begin + Result := GetDetailsSeparatorClass.Create(AParent); + FMasterIndents.Add(Result); +end; + +function TdxGridViewRowProducer.CreateMasterIndent(AParent: TdxReportCell): TdxReportCellExpandButton; +begin + Result := GetMasterIndentClass.Create(AParent); + FMasterIndents.Add(Result); +end; + +procedure TdxGridViewRowProducer.CreateRow; +begin + FRow := GetRowHostClass.Create(Host); + FRow.BoundsRect := MakeBounds(RowOriginX, 0, RowWidth, RowHeight); + InitializeRow; + AddTrailingMasterSeparators; +end; + +procedure TdxGridViewRowProducer.CreateRowHost(const AHostInfo: TdxGridAttributeHostInfo); +begin + FHost := HostClass.Create(AHostInfo.Parent); + FHost.BoundsRect := MakeBounds(AHostInfo.Origin.X, AHostInfo.Origin.Y, Width, RowHeight); + InitializeHost; + AddLeadingMasterIndentsAndSeparators; +end; + +function TdxGridViewRowProducer.DoesItemParticipateInRowAutoHeightCalculation(AnItem: TdxReportVisualItem): Boolean; +begin + Result := True; +end; + +function TdxGridViewRowProducer.GetDetailsSeparatorClass: TdxReportCellBoxClass; +begin + Result := Formatter.GetDetailsSeparatorClass; +end; + +function TdxGridViewRowProducer.GetMasterIndentClass: TdxReportCellExpandButtonClass; +begin + Result := Formatter.GetMasterIndentClass; +end; + +procedure TdxGridViewRowProducer.FixupMasterIndentsHeight; +var + I: Integer; +begin + for I := 0 to MasterIndentCount - 1 do + with MasterIndents[I] do + Height := Parent.Height; +end; + +procedure TdxGridViewRowProducer.FixupRowDataItemHeight(AnItem: TdxReportVisualItem); +begin + with AnItem do + Height := Parent.Height; +end; + +procedure TdxGridViewRowProducer.FixupRowDataHeight; +begin +end; + +procedure TdxGridViewRowProducer.FixupRowHeight; +begin + FixupRowOwnHeight; + FixupMasterIndentsHeight; + FixupRowDataHeight; +end; + +procedure TdxGridViewRowProducer.FixupRowOwnHeight; +begin + Host.Height := RowHeight; + Row.Height := RowHeight; + ItemsSite.Height := RowHeight; +end; + +procedure TdxGridViewRowProducer.InitializeDetailsSeparator(AFormatter: TdxCustomGridViewFormatter; + ASeparator: TdxReportCellBox; ASeparatorKind: TdxVerticalDetailsSeparatorKind); +begin + AFormatter.DoInitializeVertDetailsSeparator(ASeparator, ASeparatorKind); +end; + +procedure TdxGridViewRowProducer.InitializeMasterIndent(AFormatter: TdxCustomGridViewFormatter; + AIndent: TdxReportCellExpandButton; AIndex, ALevel: Integer); +begin + AFormatter.DoInitializeMasterIndent(AIndent, AIndex, MasterBuilders[ALevel].Adapter.IndentCount); +end; + +procedure TdxGridViewRowProducer.InitializeHost; +begin + Formatter.DoInitializeHost(Host); +end; + +procedure TdxGridViewRowProducer.InitializeRow; +begin +end; + +function TdxGridViewRowProducer.GetAutoHeight: Boolean; +begin + Result := LineCount = 1; +end; + +function TdxGridViewRowProducer.GetItemsSite: TdxReportCell; +begin + Result := Row; +end; + +function TdxGridViewRowProducer.GetLineCount: Integer; +begin + Result := 1; +end; + +function TdxGridViewRowProducer.GetLineHeight: Integer; +begin + Result := 20; +end; + +function TdxGridViewRowProducer.GetDC: HDC; +begin + Result := Formatter.DC; +end; + +function TdxGridViewRowProducer.GetHostClass: TdxReportCellClass; +begin + Result := Formatter.GetHostClass; +end; + +function TdxGridViewRowProducer.GetIndentWidth: Integer; +begin + Result := Adapter.IndentWidth; +end; + +function TdxGridViewRowProducer.GetMasterBuilder(Index: Integer): TdxCustomGridViewBuilder; +begin + Result := Builder.AbsoluteBuilders[Index]; +end; + +function TdxGridViewRowProducer.GetMasterIndent(Index: Integer): TdxReportCellBox; +begin + Result := FMasterIndents[Index]; +end; + +function TdxGridViewRowProducer.GetMasterIndentCount: Integer; +begin + Result := FMasterIndents.Count; +end; + +function TdxGridViewRowProducer.GetRowHostClass: TdxReportCellClass; +begin + Result := Formatter.GetRowHostClass; +end; + +function TdxGridViewRowProducer.GetWidth: Integer; +begin + with Formatter do + Result := ViewWidthExtraBefore + ViewWidth + ViewWidthExtraAfter; +end; + +function TdxGridViewRowProducer.GetRowOriginX: Integer; +begin + Result := Formatter.ViewWidthExtraBefore; +end; + +function TdxGridViewRowProducer.GetRowWidth: Integer; +begin + Result := Formatter.ViewWidth; +end; + +{ TdxGridViewCustomRowProducer } + +function TdxGridViewCustomRowProducer.Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; +begin + Result := inherited Produce(AHostInfo); + AddItem; +end; + +procedure TdxGridViewCustomRowProducer.AddItem; +begin + FItem := CreateItem(Row); + FItem.BoundsRect := MakeRect(0, 0, RowWidth, RowHeight); + InitializeItem; +end; + +function TdxGridViewCustomRowProducer.CreateItem(AParent: TdxReportCell): TAbstractdxReportCellData; +begin + Result := GetItemClass.Create(AParent); +end; + +procedure TdxGridViewCustomRowProducer.FixupRowDataHeight; +begin + inherited; + FixupRowDataItemHeight(Item); +end; + +procedure TdxGridViewCustomRowProducer.InitializeItem; +begin +end; + +function TdxGridViewCustomRowProducer.GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TdxGridViewCustomRowProducer.GetItemClass: TdxReportCellDataClass; +begin + Result := TAbstractdxReportCellData; +end; + +{ TdxGridViewCaptionProducer } + +procedure TdxGridViewCaptionProducer.InitializeItem; +begin + inherited; + Formatter.DoInitializeCaption(Item); + Formatter.DoReportLinkInitializeCaption(Item); +end; + +procedure TdxGridViewCaptionProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeCaptionRow(Row); +end; + +function TdxGridViewCaptionProducer.GetItemClass: TdxReportCellDataClass; +begin + Result := Formatter.GetCaptionClass; +end; + +function TdxGridViewCaptionProducer.GetLineHeight: Integer; +begin + Result := Formatter.CaptionLineHeight; +end; + +function TdxGridViewCaptionProducer.GetItem: TdxReportCellText; +begin + Result := TdxReportCellText(inherited Item); +end; + +{ TdxGridViewFilterBarProducer } + +procedure TdxGridViewFilterBarProducer.InitializeItem; +begin + inherited; + Formatter.DoInitializeFilterBar(Item); + Formatter.DoReportLinkInitializeFilterBar(Item); +end; + +procedure TdxGridViewFilterBarProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeFilterBarRow(Row); +end; + +function TdxGridViewFilterBarProducer.GetItemClass: TdxReportCellDataClass; +begin + Result := Formatter.GetFilterBarClass; +end; + +function TdxGridViewFilterBarProducer.GetLineHeight: Integer; +begin + Result := Formatter.FilterBarLineHeight; +end; + +function TdxGridViewFilterBarProducer.GetItem: TdxReportCellText; +begin + Result := TdxReportCellText(inherited Item); +end; + +{ TdxGridViewDetailsSeparatorProducer } + +procedure TdxGridViewDetailsSeparatorProducer.InitializeItem; +begin + inherited; + Formatter.DoInitializeHorzDetailsSeparator(Item); +end; + +procedure TdxGridViewDetailsSeparatorProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeDetailsSeparatorRow(Row); +end; + +function TdxGridViewDetailsSeparatorProducer.GetItemClass: TdxReportCellDataClass; +begin + Result := Formatter.GetDetailsSeparatorClass; +end; + +function TdxGridViewDetailsSeparatorProducer.GetLineHeight: Integer; +begin + Result := Formatter.DetailsSeparatorThickness; +end; + +function TdxGridViewDetailsSeparatorProducer.GetItem: TdxReportCellBox; +begin + Result := TdxReportCellBox(inherited Item); +end; + +{ TdxGridViewDetailsTopSeparatorProducer } + +procedure TdxGridViewDetailsTopSeparatorProducer.InitializeDetailsSeparator( + AFormatter: TdxCustomGridViewFormatter; ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); +begin + if AFormatter = Formatter then + AFormatter.DoInitializeVertTopDetailsSeparator(ASeparator, ASeparatorKind) + else + inherited; +end; + +{ TdxGridViewDetailsBottomSeparatorProducer } + +procedure TdxGridViewDetailsBottomSeparatorProducer.InitializeDetailsSeparator( + AFormatter: TdxCustomGridViewFormatter; ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); +begin + if AFormatter = Formatter then + AFormatter.DoInitializeVertBottomDetailsSeparator(ASeparator, ASeparatorKind) + else + inherited; +end; + +{ TdxGridViewTerminatorProducer } + +procedure TdxGridViewTerminatorProducer.InitializeItem; +begin + inherited; + Formatter.DoInitializeViewTerminator(Item); +end; + +function TdxGridViewTerminatorProducer.GetLineHeight: Integer; +begin + Result := 1; +end; + +{ TdxGridTableViewRowProducer } + +function TdxGridTableViewRowProducer.Adapter: TdxGridTableViewAdapter; +begin + Result := inherited Adapter as TdxGridTableViewAdapter; +end; + +function TdxGridTableViewRowProducer.Builder: TdxGridTableViewBuilder; +begin + Result := inherited Builder as TdxGridTableViewBuilder; +end; + +function TdxGridTableViewRowProducer.Formatter: TdxGridTableViewFormatter; +begin + Result := Builder.Formatter; +end; + +{ TdxGridTableViewRowSubItemsProducer } + +constructor TdxGridTableViewRowSubItemsProducer.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited; + FIndents := TList.Create; + FSubItems := TList.Create; +end; + +destructor TdxGridTableViewRowSubItemsProducer.Destroy; +begin + FreeAndNil(FSubItems); + FreeAndNil(FIndents); + inherited; +end; + +function TdxGridTableViewRowSubItemsProducer.Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; +begin + InitializeIndentList; + InitializeSubItemList; + Result := inherited Produce(AHostInfo); +end; + +procedure TdxGridTableViewRowSubItemsProducer.AddIndents(AParent: TdxReportCell); +begin +end; + +procedure TdxGridTableViewRowSubItemsProducer.AddSubItems(AParent: TdxReportCell); +var + I: Integer; + Item: TAbstractdxReportCellData; +begin + for I := 0 to GetSubItemCount - 1 do + if HasSubItem[I] then + begin + Item := CreateSubItem(I, AParent); + Item.BoundsRect := SubItemBounds[I]; // needed before item initialization + InitializeSubItem(Item, I); + end; +end; + +procedure TdxGridTableViewRowSubItemsProducer.CreateRow; +begin + inherited; + AddIndents(Row); + AddSubItems(Row); +end; + +function TdxGridTableViewRowSubItemsProducer.CreateSubItem(AnIndex: Integer; + AParent: TdxReportCell): TAbstractdxReportCellData; +begin + Result := SubItemClasses[AnIndex].Create(AParent); + FSubItems[AnIndex] := Result; +end; + +function TdxGridTableViewRowSubItemsProducer.IsItemIndent(AnItem: TdxReportVisualItem): Boolean; +begin + Result := FIndents.IndexOf(AnItem) <> -1; +end; + +procedure TdxGridTableViewRowSubItemsProducer.FixupIndentsHeight; +var + I: Integer; +begin + for I := 0 to IndentCount - 1 do + with Indents[I] do + Height := Parent.Height; +end; + +procedure TdxGridTableViewRowSubItemsProducer.FixupRowDataHeight; +var + I: Integer; + SubItem: TdxReportVisualItem; +begin + for I := 0 to SubItemCount - 1 do {.SubItemCount} + begin + SubItem := SubItems[I]; + if SubItem <> nil then + FixupRowDataItemHeight(SubItem); + end; +end; + +procedure TdxGridTableViewRowSubItemsProducer.FixupRowHeight; +begin + inherited; + FixupIndentsHeight; +end; + +procedure TdxGridTableViewRowSubItemsProducer.InitializeIndentList; +begin + FIndents.Clear; + FIndents.Count := GetIndentCount; +end; + +procedure TdxGridTableViewRowSubItemsProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin +end; + +procedure TdxGridTableViewRowSubItemsProducer.InitializeSubItemList; +begin + FSubItems.Clear; + FSubItems.Count := GetSubItemCount; +end; + +function TdxGridTableViewRowSubItemsProducer.GetHasSubItem(Index: Integer): Boolean; +begin + Result := True; +end; + +function TdxGridTableViewRowSubItemsProducer.GetIndentCount: Integer; +begin + Result := 0; +end; + +function TdxGridTableViewRowSubItemsProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := MakeRect(0, 0, -1, -1); +end; + +function TdxGridTableViewRowSubItemsProducer.GetSubItemCount: Integer; +begin + Result := Formatter.ColumnCount; +end; + +function TdxGridTableViewRowSubItemsProducer.GetColumn(Index: Integer): TcxGridColumn; +begin + Result := Formatter.Columns[Index]; +end; + +function TdxGridTableViewRowSubItemsProducer.GetIndent(Index: Integer): TdxReportCellExpandButton; +begin + Result := FIndents[Index]; +end; + +function TdxGridTableViewRowSubItemsProducer.GetSubItem(Index: Integer): TdxReportVisualItem; +begin + Result := FSubItems[Index]; +end; + +{ TdxGridTableViewHeadersProducer } + +procedure TdxGridTableViewHeadersProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeHeaderRow(Row); +end; + +procedure TdxGridTableViewHeadersProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeHeaderItem(ASubItem, AIndex); + Formatter.DoReportLinkInitializeHeaderItem(ASubItem, AIndex); +end; + +function TdxGridTableViewHeadersProducer.GetAutoHeight: Boolean; +begin + Result := inherited GetAutoHeight and Adapter.HeaderAutoHeight; +end; + +function TdxGridTableViewHeadersProducer.GetLineCount: Integer; +begin + Result := Adapter.DetailsLineCount; +end; + +function TdxGridTableViewHeadersProducer.GetLineHeight: Integer; +begin + Result := Formatter.HeaderLineHeight; +end; + +function TdxGridTableViewHeadersProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := Formatter.GetHeaderItemBounds(Index); +end; + +function TdxGridTableViewHeadersProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetHeaderItemClass(Index); +end; + +{ TdxGridTableViewFootersProducer } + +procedure TdxGridTableViewFootersProducer.CalculateRowAutoHeight; +begin + inherited; + Inc(FRowHeight, 2 * FooterItemInflateVert); +end; + +procedure TdxGridTableViewFootersProducer.CalculateRowHeight; +begin + if AutoHeight then + inherited + else + RowHeight := LineCount * LineHeight; +end; + +procedure TdxGridTableViewFootersProducer.FixupRowDataItemHeight(AnItem: TdxReportVisualItem); +begin + with AnItem do + Height := Parent.Height - 2 * FooterItemInflateVert; +end; + +procedure TdxGridTableViewFootersProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeFooterRow(Row); +end; + +procedure TdxGridTableViewFootersProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeFooterItem(ASubItem, AIndex); + Formatter.DoReportLinkInitializeFooterItem(ASubItem, AIndex); +end; + +function TdxGridTableViewFootersProducer.GetAutoHeight: Boolean; +var + I: Integer; +begin + Result := inherited GetAutoHeight and Adapter.FooterMultiline; + if Result then + begin + for I := 0 to SubItemCount - 1 do + if HasSubItem[I] then Exit; + Result := False; + end; +end; + +function TdxGridTableViewFootersProducer.GetHasSubItem(Index: Integer): Boolean; +begin + Result := Adapter.HasFooterItem[Index]; +end; + +function TdxGridTableViewFootersProducer.GetLineCount: Integer; +begin + Result := Adapter.DetailsLineCount; +end; + +function TdxGridTableViewFootersProducer.GetLineHeight: Integer; +begin + Result := Formatter.FooterLineHeight; +end; + +function TdxGridTableViewFootersProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := Formatter.GetFooterItemBounds(Index); +end; + +function TdxGridTableViewFootersProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetFooterItemClass(Index); +end; + +{ TdxGridTableViewCustomDataRowProducer } + +function TdxGridTableViewCustomDataRowProducer.Produce(AHostInfo: TdxGridAttributeHostInfo; + AGridRow: TcxCustomGridRow; AGridRowIndex: Integer): TdxReportCell; +begin + FGridRow := AGridRow; + FGridRowIndex := AGridRowIndex; + Result := inherited Produce(AHostInfo); + FGridRowIndex := -1; + FGridRow := nil; +end; + +function TdxGridTableViewCustomDataRowProducer.GridRow: TcxCustomGridRow; +begin + Result := FGridRow; +end; + +procedure TdxGridTableViewCustomDataRowProducer.AddIndents(AParent: TdxReportCell); +var + I: Integer; + Indent: TdxReportCellExpandButton; +begin + inherited; + for I := 0 to IndentCount - 1 do + begin + Indent := CreateIndent(I, AParent); + Indent.BoundsRect := IndentBounds[I]; + InitializeIndent(Indent, I); + end; +end; + +function TdxGridTableViewCustomDataRowProducer.CreateIndent(AnIndex: Integer; + AParent: TdxReportCell): TdxReportCellExpandButton; +begin + Result := Formatter.CreateIndent(AParent); + FIndents[AnIndex] := Result; +end; + +procedure TdxGridTableViewCustomDataRowProducer.InitializeIndent(AIndent: TdxReportCellExpandButton; + AIndex: Integer); +begin +end; + +function TdxGridTableViewCustomDataRowProducer.GetIndentCount: Integer; +begin + Result := GridRow.Level; +end; + +function TdxGridTableViewCustomDataRowProducer.GetLineCount: Integer; +begin + Result := 1; +end; + +function TdxGridTableViewCustomDataRowProducer.GetLineHeight: Integer; +begin + Result := DefaultDataRowLineHeight; +end; + +function TdxGridTableViewCustomDataRowProducer.GetIndentArea: Integer; +begin + Result := IndentCount * IndentWidth; +end; + +function TdxGridTableViewCustomDataRowProducer.GetIndentBounds(Index: Integer): TRect; +begin + Result := MakeBounds(IndentWidth * Index, 0, IndentWidth, RowHeight); +end; + +{ TdxCustomGridTableViewRowSeparatorProducer } + +function TdxCustomGridTableViewRowSeparatorProducer.Produce(AHostInfo: TdxGridAttributeHostInfo; + AGridRow: TcxCustomGridRow): TdxReportCell; +begin + Result := inherited Produce(AHostInfo, AGridRow, -1); +end; + +procedure TdxCustomGridTableViewRowSeparatorProducer.InitializeIndent(AIndent: TdxReportCellExpandButton; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeRowSeparatorIndent(AIndent, AIndex, IndentCount, GridRow); +end; + +function TdxCustomGridTableViewRowSeparatorProducer.GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TdxCustomGridTableViewRowSeparatorProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := MakeRect(IndentArea, 0, RowWidth, RowHeight); +end; + +function TdxCustomGridTableViewRowSeparatorProducer.GetSubItemCount: Integer; +begin + Result := 1; +end; + +{ TdxGridTableViewRowSeparatorProducer } + +function TdxGridTableViewRowSeparatorProducer.Produce(AHostInfo: TdxGridAttributeHostInfo; + AGridRow: TcxCustomGridRow; AnIsLast: Boolean): TdxReportCell; +begin + FIsLast := AnIsLast; + Result := inherited Produce(AHostInfo, AGridRow); +end; + +procedure TdxGridTableViewRowSeparatorProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeSeparatorRow(Row); +end; + +procedure TdxGridTableViewRowSeparatorProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + Formatter.DoInitializeRowSeparator(ASubItem); +end; + +function TdxGridTableViewRowSeparatorProducer.GetIndentCount: Integer; +begin + if not IsLast then + begin + Result := inherited GetIndentCount; + if (Result <> 0) and Adapter.IsOffice11StyleGrouping and not (GridRow is TcxGridGroupRow) then {.2} + Dec(Result); + end + else + Result := 0; +end; + +function TdxGridTableViewRowSeparatorProducer.GetLineHeight: Integer; +begin + Result := Formatter.RowSeparatorThickness; +end; + +function TdxGridTableViewRowSeparatorProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetRowSeparatorClass; +end; + +{ TdxGridTableViewGroupRowSeparatorProducer } + +procedure TdxGridTableViewGroupRowSeparatorProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeGroupSeparatorRow(Row); +end; + +procedure TdxGridTableViewGroupRowSeparatorProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeGroupRowSeparator(ASubItem); +end; + +function TdxGridTableViewGroupRowSeparatorProducer.GetLineHeight: Integer; +begin + Result := Formatter.GroupRowSeparatorThickness; +end; + +function TdxGridTableViewGroupRowSeparatorProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetGroupRowSeparatorClass; +end; + +{ TdxGridTableViewDataRowProducer } + +function TdxGridTableViewDataRowProducer.GridRow: TcxGridDataRow; +begin + Result := inherited GridRow as TcxGridDataRow; +end; + +procedure TdxGridTableViewDataRowProducer.AddPreview(AParent: TdxReportCell); +begin + FPreviewItem := CreatePreview(Row); + + PreviewItem.Left := IndentArea; + // We have to set Width before because we use that value for PreviewHeight calculation + PreviewItem.Width := Width - IndentArea; + Formatter.DoInitializePreview(TAbstractdxReportCellData(PreviewItem), PreviewColumn, GridRow); + PreviewItem.Height := PreviewHeight; + PreviewItem.AdjustContent(Formatter.DC); {3.1} +end; + +procedure TdxGridTableViewDataRowProducer.AddSubItems(AParent: TdxReportCell); +begin + inherited; + if HasPreview then AddPreview(AParent); +end; + +procedure TdxGridTableViewDataRowProducer.CalculateRowAutoHeight; +begin + if CellAutoHeight then inherited; + if PreviewItem <> nil then + RowHeight := RowHeight + PreviewItem.Height; +end; + +function TdxGridTableViewDataRowProducer.CreatePreview(AParent: TdxReportCell): TdxReportVisualItem; +begin + Result := GetPreviewClass.Create(AParent); + FPreviewItem := Result; +end; + +function TdxGridTableViewDataRowProducer.DoesItemParticipateInRowAutoHeightCalculation(AnItem: TdxReportVisualItem): Boolean; +var + TableItem: TcxCustomGridTableItem; + Properties: TcxCustomEditProperties; +begin + Result := AnItem <> FPreviewItem; + // 3.2 + if Result and not IsItemIndent(AnItem) then + begin + TableItem := TcxCustomGridTableItem(AnItem.Data); + Properties := Adapter.GetProperties(TableItem, GridRow); + Result := dxPScxCommon.dxPSDataMaps.DoesItemParticipateInAutoHeightCalculation(Properties); + end; +end; + +function TdxGridTableViewDataRowProducer.GetPreviewClass: TdxReportCellDataClass; +begin + Result := Formatter.GetPreviewClass(PreviewColumn, GridRow); +end; + +procedure TdxGridTableViewDataRowProducer.FixupRowDataHeight; +var + NewHeight, I: Integer; + Item: TdxReportVisualItem; +begin + NewHeight := RowHeight; + if PreviewItem <> nil then + Dec(NewHeight, PreviewItem.Height); + + for I := 0 to Row.DataItemCount - 1 do + begin + Item := Row.DataItems[I]; + if Item = PreviewItem then + if PreviewPlace = ppTop then + Item.Top := 0 + else + Item.Top := NewHeight + else + if IsItemIndent(Item) then + begin + Item.Top := 0; + Item.Height := RowHeight; + end + else + begin + if CellAutoHeight then + Item.Height := NewHeight; + if HasPreview and (PreviewPlace = ppTop) then + Item.Top := Item.Top + PreviewItem.Height; + end; + end; + {3.1} + for I := 0 to Row.CellCount - 1 do + begin + Item := Row.Cells[I]; + if Item = PreviewItem then + if PreviewPlace = ppTop then + Item.Top := 0 + else + Item.Top := NewHeight + else + begin + if CellAutoHeight then + Item.Height := NewHeight; + if HasPreview and (PreviewPlace = ppTop) then + Item.Top := Item.Top + PreviewItem.Height; + end; + end; +end; + +procedure TdxGridTableViewDataRowProducer.InitializeIndent(AIndent: TdxReportCellExpandButton; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeDataRowIndent(AIndent, AIndex, IndentCount, GridRow); +end; + +procedure TdxGridTableViewDataRowProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeDataRow(Row, GridRow); +end; + +procedure TdxGridTableViewDataRowProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeItem(ASubItem, Columns[AIndex], GridRow, False); + Formatter.DoReportLinkInitializeItem(ASubItem, Columns[AIndex], GridRow); +end; + +function TdxGridTableViewDataRowProducer.GetAutoHeight: Boolean; +begin + Result := CellAutoHeight or HasPreview; +end; + +function TdxGridTableViewDataRowProducer.GetCellAutoHeight: Boolean; +begin + Result := inherited GetAutoHeight and Adapter.CellAutoHeight; +end; + +function TdxGridTableViewDataRowProducer.GetHasPreview: Boolean; +begin + Result := Formatter.HasPreview; +end; + +function TdxGridTableViewDataRowProducer.GetIndentCount: Integer; +begin + Result := inherited GetIndentCount; + if (Result <> 0) and Adapter.IsOffice11StyleGrouping then {.2} + Dec(Result); +end; + +function TdxGridTableViewDataRowProducer.GetLineCount: Integer; +begin + Result := Adapter.DetailsLineCount; +end; + +function TdxGridTableViewDataRowProducer.GetLineHeight: Integer; +begin + if Formatter.HeaderLineCount = 1 then + Result := Formatter.RowHeights[GridRowIndex] + else + Result := Formatter.DetailsLineHeight; +end; + +function TdxGridTableViewDataRowProducer.GetPreviewHeight: Integer; +begin + Result := PreviewLineCount * PreviewLineHeight; + if not (Formatter.PreviewAutoHeight and (Formatter.PreviewMaxLineCount = 0)) then + Inc(Result, 2 * dxTextSpace); +end; + +function TdxGridTableViewDataRowProducer.GetPreviewLineCount: Integer; +begin + if FPreviewItem <> nil then + if not Formatter.PreviewAutoHeight then + begin + Result := PreviewItem.CalculateLineCount(Formatter.DC); + if Result <> Formatter.PreviewMaxLineCount then + Result := Formatter.PreviewMaxLineCount; + end + else + Result := 1 + else + Result := 0; +end; + +function TdxGridTableViewDataRowProducer.GetPreviewLineHeight: Integer; +var + LineHeight: Integer; +begin + if FPreviewItem <> nil then + if Formatter.PreviewAutoHeight then + begin + Result := PreviewItem.MeasureContentHeight(Formatter.DC); + if Formatter.PreviewMaxLineCount <> 0 then + begin + LineHeight := PreviewItem.MeasureFontHeight(Formatter.DC) - 2 * dxTextSpace; + if Result > LineHeight * Formatter.PreviewMaxLineCount then + Result := LineHeight * Formatter.PreviewMaxLineCount; + end; + end + else + Result := PreviewItem.MeasureFontHeight(Formatter.DC) - 2 * dxTextSpace + else + Result := 0; +end; + +function TdxGridTableViewDataRowProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := Formatter.GetItemBounds(GridRow, GridRowIndex, Index); +end; + +function TdxGridTableViewDataRowProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetItemClass(Columns[Index], GridRow, False); +end; + +function TdxGridTableViewDataRowProducer.GetPreviewColumn: TcxGridColumn; +begin + Result := Adapter.PreviewColumn; +end; + +function TdxGridTableViewDataRowProducer.GetPreviewPlace: TcxGridPreviewPlace; +begin + Result := Adapter.PreviewPlace; +end; + +{ TdxGridTableViewGroupRowProducer} + +procedure TdxGridTableViewGroupRowProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeGroupRow(Row, GridRow); +end; + +function TdxGridTableViewGroupRowProducer.GridRow: TcxGridGroupRow; +begin + Result := inherited GridRow as TcxGridGroupRow; +end; + +procedure TdxGridTableViewGroupRowProducer.InitializeIndent(AIndent: TdxReportCellExpandButton; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeGroupRowIndent(AIndent, AIndex, IndentCount, GridRow); +end; + +procedure TdxGridTableViewGroupRowProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeGroupRowItem(ASubItem, GridRow); +end; + +function TdxGridTableViewGroupRowProducer.GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TdxGridTableViewGroupRowProducer.GetIndentCount: Integer; +begin + Result := inherited GetIndentCount + 1; +end; + +function TdxGridTableViewGroupRowProducer.GetLineCount: Integer; +begin + Result := 1; +end; + +function TdxGridTableViewGroupRowProducer.GetLineHeight: Integer; +begin + Result := Formatter.RowHeights[GridRowIndex];//}Formatter.GroupRowLineHeight; {3.1} +end; + +function TdxGridTableViewGroupRowProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := MakeRect(IndentArea, 0, RowWidth, LineHeight); +end; + +function TdxGridTableViewGroupRowProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetGroupRowClass; +end; + +function TdxGridTableViewGroupRowProducer.GetSubItemCount: Integer; +begin + Result := 1; +end; + +{ TdxGridTableViewMasterRowProducer } + +function TdxGridTableViewMasterRowProducer.GridRow: TcxGridMasterDataRow; +begin + Result := inherited GridRow as TcxGridMasterDataRow; +end; + +procedure TdxGridTableViewMasterRowProducer.InitializeIndent(AIndent: TdxReportCellExpandButton; + AIndex: Integer); +begin + //inherited; + Formatter.DoInitializeMasterDataRowIndent(AIndent, AIndex, IndentCount, GridRow); +end; + +procedure TdxGridTableViewMasterRowProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + if AIndex = 0 then + ASubItem.CellSides := ASubItem.CellSides - [csLeft]; +end; + +function TdxGridTableViewMasterRowProducer.GetIndentCount: Integer; +begin + Result := inherited GetIndentCount + 1; +end; + +{ TdxGridTableViewGroupFooterProducer } + +function TdxGridTableViewGroupFooterProducer.Produce(AHostInfo: TdxGridAttributeHostInfo; + AGridRow: TcxCustomGridRow; AGroupLevel, AnIndex: Integer): TdxReportCell; +begin + FGroupLevel := AGroupLevel; + FIndex := AnIndex; + Result := inherited Produce(AHostInfo, AGridRow, -1); + FGroupLevel := -1; +end; + +procedure TdxGridTableViewGroupFooterProducer.AddSubItems(AParent: TdxReportCell); + + function SubstituteParent(AParent: TdxReportCell): TdxReportCell; + begin + Result := TdxReportCell.Create(AParent); + Result.BoundsRect := HostBounds; + Formatter.DoInitializeGroupFooterHost(Result, GridRow); + end; + +begin + FItemsSite := SubstituteParent(AParent); + inherited AddSubItems(ItemsSite); +end; + +procedure TdxGridTableViewGroupFooterProducer.CalculateRowAutoHeight; +begin + inherited; + Inc(FRowHeight, FooterItemInflateVert); +end; + +procedure TdxGridTableViewGroupFooterProducer.FixupRowDataItemHeight(AnItem: TdxReportVisualItem); +begin + with AnItem do + Height := Parent.Height - 2 * FooterItemInflateVert; +end; + +procedure TdxGridTableViewGroupFooterProducer.InitializeIndent(AIndent: TdxReportCellExpandButton; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeGroupFooterIndent(AIndent, AIndex, IndentCount, GridRow); +end; + +procedure TdxGridTableViewGroupFooterProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeGroupFooterRow(Row, GridRow, GroupLevel); +end; + +procedure TdxGridTableViewGroupFooterProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeGroupFooterItem(ASubItem, AIndex, GridRow, GroupLevel); + Formatter.DoReportLinkInitializeGroupFooterItem(ASubItem, AIndex, GridRow, GroupLevel); +end; + +function TdxGridTableViewGroupFooterProducer.GetAutoHeight: Boolean; +begin + Result := inherited GetAutoHeight and Adapter.GroupFootersMultiline and + ((ItemsSite.DataItemCount <> 0) or (ItemsSite.CellCount <> 0)); +end; + +function TdxGridTableViewGroupFooterProducer.GetHasSubItem(Index: Integer): Boolean; +begin + Result := Adapter.HasGroupFooterItem(GroupLevel, Index); +end; + +function TdxGridTableViewGroupFooterProducer.GetIndentCount: Integer; +begin + Result := GroupLevel; + if Adapter.GroupFootersMode = gfVisibleWhenExpanded then + begin + Inc(Result); + if Adapter.IsOffice11StyleGrouping and (Index = 0) and not (GridRow is TcxGridGroupRow) then + Dec(Result); + end +end; + +function TdxGridTableViewGroupFooterProducer.GetItemsSite: TdxReportCell; +begin + Result := FItemsSite; +end; + +function TdxGridTableViewGroupFooterProducer.GetLineCount: Integer; +begin + Result := Adapter.DetailsLineCount; +end; + +function TdxGridTableViewGroupFooterProducer.GetLineHeight: Integer; +begin + Result := Formatter.GroupFooterLineHeight; +end; + +function TdxGridTableViewGroupFooterProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := Formatter.GetGroupFooterItemBounds(Index, IndentCount); +end; + +function TdxGridTableViewGroupFooterProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetGroupFooterItemClass(Index); +end; + +function TdxGridTableViewGroupFooterProducer.GetGroupLevel: Integer; +begin + Result := FGroupLevel; + if Adapter.GroupFootersMode = gfVisibleWhenExpanded then + Dec(Result); +end; + +function TdxGridTableViewGroupFooterProducer.GetHostBounds: TRect; +begin + Result := MakeRect(IndentArea, 0, Row.Width, Row.Height); +end; + +{ TdxGridTableViewBandsProducer } + +function TdxGridTableViewBandsProducer.Adapter: TdxGridBandedTableViewAdapter; +begin + Result := inherited Adapter as TdxGridBandedTableViewAdapter; +end; + +function TdxGridTableViewBandsProducer.Builder: TdxGridBandedTableViewBuilder; +begin + Result := inherited Builder as TdxGridBandedTableViewBuilder; +end; + +function TdxGridTableViewBandsProducer.Formatter: TdxGridBandedTableViewFormatter; +begin + Result := inherited Formatter as TdxGridBandedTableViewFormatter; +end; + +function TdxGridTableViewBandsProducer.GetSubItemCount: Integer; +begin + Result := Formatter.BandCount; +end; + +procedure TdxGridTableViewBandsProducer.CalculateRowHeight; +begin + FRowHeight := Formatter.ItemPlaceController.Height; +end; + +procedure TdxGridTableViewBandsProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeBandRow(Row); +end; + +procedure TdxGridTableViewBandsProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeBandItem(ASubItem, AIndex); + Formatter.DoReportLinkInitializeBandItem(ASubItem, AIndex); +end; + +function TdxGridTableViewBandsProducer.GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TdxGridTableViewBandsProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := Formatter.GetBandItemBounds(Index); +end; + +function TdxGridTableViewBandsProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetBandItemClass(Index); +end; + +{ TdxGridCardViewCardsRowProducer } + +function TdxGridCardViewCardsRowProducer.Adapter: TdxGridCardViewAdapter; +begin + Result := inherited Adapter as TdxGridCardViewAdapter; +end; + +function TdxGridCardViewCardsRowProducer.Builder: TdxGridCardViewBuilder; +begin + Result := inherited Builder as TdxGridCardViewBuilder; +end; + +function TdxGridCardViewCardsRowProducer.Formatter: TdxGridCardViewFormatter; +begin + Result := inherited Formatter as TdxGridCardViewFormatter; +end; + +function TdxGridCardViewCardsRowProducer.CreateCard(AParent: TdxReportCell; + AGridCard: TcxGridCard): TdxReportCard; +begin + Result := Formatter.GetCardClass(AGridCard).CreateEx(AParent, AGridCard); + Formatter.DoInitializeCard(Result, AGridCard); +end; + +procedure TdxGridCardViewCardsRowProducer.InjectCard(ACard: TdxReportCard; + AIndex: Integer); +begin + ACard.Parent := Row; + ACard.Left := Formatter.InterCardsSpaceHorz div 2 + + AIndex * (Builder.MaxCardWidth + Formatter.InterCardsSpaceHorz); + ACard.Top := Formatter.InterCardsSpaceVert div 2; +end; + +function TdxGridCardViewCardsRowProducer.Produce(AHostInfo: TdxGridAttributeHostInfo; + ARowHeight: Integer): TdxReportCell; +begin + FRowHeight := ARowHeight; + Result := inherited Produce(AHostInfo); +end; + +procedure TdxGridCardViewCardsRowProducer.CalculateRowHeight; +begin +end; + +function TdxGridCardViewCardsRowProducer.GetAutoHeight: Boolean; +begin + Result := False; +end; + +procedure TdxGridCardViewCardsRowProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeCardsRow(Row); +end; + +{ TdxGridReportLinkOptions } + +function TdxGridReportLinkOptions.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +{ TdxGridReportLinkOptionsCardsShadow } + +constructor TdxGridReportLinkCardsShadow.Create(AnOptionsCards: TdxGridReportLinkOptionsCards); +begin + inherited Create; + RestoreDefaults; + FOptionsCards := AnOptionsCards; +end; + +procedure TdxGridReportLinkCardsShadow.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkCardsShadow then + with TdxGridReportLinkCardsShadow(Source) do + begin + Self.Color := Color; + Self.Depth := Depth; + Self.Position := Position; + end + else + inherited; +end; + +procedure TdxGridReportLinkCardsShadow.RestoreDefaults; +begin + inherited; + Color := clDefault; + Depth := dxDefaultCardsShadowDepth; + Position := cspBottomRight; +end; + +procedure TdxGridReportLinkCardsShadow.Changed; +begin + if OptionsCards <> nil then OptionsCards.Changed; +end; + +function TdxGridReportLinkCardsShadow.GetActualColor: TColor; +begin + Result := Color; + if Result = clDefault then + Result := dxDefaultCardsShadowColor; +end; + +function TdxGridReportLinkCardsShadow.GetVisible: Boolean; +begin + Result := Depth <> 0; +end; + +procedure TdxGridReportLinkCardsShadow.SetColor(Value: TColor); +begin + if FColor <> Value then + begin + FColor := Value; + if Visible then Changed; + end; +end; + +procedure TdxGridReportLinkCardsShadow.SetDepth(Value: TdxGridCardShadowDepth); +begin + if FDepth <> Value then + begin + FDepth := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkCardsShadow.SetPosition(Value: TdxGridCardShadowPosition); +begin + if FPosition <> Value then + begin + FPosition := Value; + if Visible then Changed; + end; +end; + +{ TdxGridReportLinkOptionsCards } + +destructor TdxGridReportLinkOptionsCards.Destroy; +begin + FreeAndNil(FShadow); + inherited; +end; + +procedure TdxGridReportLinkOptionsCards.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsCards then + with TdxGridReportLinkOptionsCards(Source) do + begin + Self.AutoWidth := AutoWidth; + Self.Borders := Borders; + Self.InterCardsSpaceHorz := InterCardsSpaceHorz; + Self.InterCardsSpaceVert := InterCardsSpaceVert; + Self.KeepSameHeight := KeepSameHeight; + Self.KeepSameWidth := KeepSameWidth; + Self.RowBordersHorz := RowBordersHorz; + Self.RowBordersVert := RowBordersVert; + Self.Shadow := Shadow; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsCards.RestoreDefaults; +begin + inherited; + AutoWidth := False; + Borders := True; + InterCardsSpaceHorz := dxDefaultInterCardsSpaceHorz; + InterCardsSpaceVert := dxDefaultInterCardsSpaceVert; + KeepSameHeight := True; + KeepSameWidth := True; + RowBordersHorz := False; + RowBordersVert := False; + Shadow.RestoreDefaults; +end; + +function TdxGridReportLinkOptionsCards.DesignerTabIndex: Integer; +begin + Result := 5; +end; + +function TdxGridReportLinkOptionsCards.GetShadowClass: TdxGridReportLinkCardsShadowClass; +begin + Result := TdxGridReportLinkCardsShadow; +end; + +function TdxGridReportLinkOptionsCards.GetShadow: TdxGridReportLinkCardsShadow; +begin + if FShadow = nil then + FShadow := GetShadowClass.Create(Self); + Result := FShadow; +end; + +procedure TdxGridReportLinkOptionsCards.SetAutoWidth(Value: Boolean); +begin + if FAutoWidth <> Value then + begin + FAutoWidth := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetBorders(Value: Boolean); +begin + if FBorders <> Value then + begin + FBorders := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetInterCardsSpaceHorz(Value: Integer); +begin + if Value < 0 then Value := 0; + if FInterCardsSpaceHorz <> Value then + begin + FInterCardsSpaceHorz := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetInterCardsSpaceVert(Value: Integer); +begin + if Value < 0 then Value := 0; + if FInterCardsSpaceVert <> Value then + begin + FInterCardsSpaceVert := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetKeepSameHeight(Value: Boolean); +begin + if FKeepSameHeight <> Value then + begin + FKeepSameHeight := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetKeepSameWidth(Value: Boolean); +begin + if FKeepSameWidth <> Value then + begin + FKeepSameWidth := Value; + if AutoWidth then Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetRowBordersHorz(Value: Boolean); +begin + if FRowBordersHorz <> Value then + begin + FRowBordersHorz := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetRowBordersVert(Value: Boolean); +begin + if FRowBordersVert <> Value then + begin + FRowBordersVert := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetShadow(Value: TdxGridReportLinkCardsShadow); +begin + Shadow.Assign(Value); +end; + +{ TdxGridReportLinkOptionsPagination } + +procedure TdxGridReportLinkOptionsPagination.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsPagination then + with TdxGridReportLinkOptionsPagination(Source) do + begin + Self.OneGroupPerPage := OneGroupPerPage; + Self.TopLevelGroup := TopLevelGroup; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsPagination.RestoreDefaults; +begin + inherited; + OneGroupPerPage := False; + TopLevelGroup := False; +end; + +function TdxGridReportLinkOptionsPagination.DesignerTabIndex: Integer; +begin + Result := 2; +end; + +function TdxGridReportLinkOptionsPagination.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +procedure TdxGridReportLinkOptionsPagination.SetOneGroupPerPage(Value: Boolean); +begin + if FOneGroupPerPage <> Value then + begin + FOneGroupPerPage := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsPagination.SetTopLevelGroup(Value: Boolean); +begin + if FTopLevelGroup <> Value then + begin + FTopLevelGroup := Value; + Changed; + end; +end; + +{ TdxGridReportLinkOptionsDetails } + +procedure TdxGridReportLinkOptionsDetails.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsDetails then + with TdxGridReportLinkOptionsDetails(Source) do + begin + Self.OnlyFocusedView := OnlyFocusedView; + Self.StartFromFocusedView := StartFromFocusedView; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsDetails.RestoreDefaults; +begin + inherited; + OnlyFocusedView := False; + StartFromFocusedView := False; +end; + +function TdxGridReportLinkOptionsDetails.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +procedure TdxGridReportLinkOptionsDetails.SetOnlyFocusedView(Value: Boolean); +begin + if FOnlyFocusedView <> Value then + begin + FOnlyFocusedView := Value; + if StartFromFocusedView then Changed; + end; +end; + +procedure TdxGridReportLinkOptionsDetails.SetStartFromFocusedView(Value: Boolean); +begin + if FStartFromFocusedView <> Value then + begin + FStartFromFocusedView := Value; + Changed; + end; +end; + +{ TdxGridReportLinkOptionsExpanding } + +procedure TdxGridReportLinkOptionsExpanding.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsExpanding then + with TdxGridReportLinkOptionsExpanding(Source) do + begin + Self.ExpandGroupRows := ExpandGroupRows; + Self.ExpandMasterRows := ExpandMasterRows; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsExpanding.RestoreDefaults; +begin + inherited; + ExpandGroupRows := False; + ExpandMasterRows := False; +end; + +function TdxGridReportLinkOptionsExpanding.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +function TdxGridReportLinkOptionsExpanding.GetHasAny: Boolean; +begin + Result := ExpandGroupRows or ExpandMasterRows ; +end; + +function TdxGridReportLinkOptionsExpanding.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +procedure TdxGridReportLinkOptionsExpanding.SetExpandGroupRows(Value: Boolean); +begin + if FExpandGroupRows <> Value then + begin + FExpandGroupRows := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsExpanding.SetExpandMasterRows(Value: Boolean); +begin + if FExpandMasterRows <> Value then + begin + FExpandMasterRows := Value; + Changed; + end; +end; + +{ TdxGridReportLinkOptionsFormatting } + +procedure TdxGridReportLinkOptionsFormatting.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsFormatting then + with TdxGridReportLinkOptionsFormatting(Source) do + begin + Self.ConsumeSelectionStyle := ConsumeSelectionStyle; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsFormatting.RestoreDefaults; +begin + inherited; + ConsumeSelectionStyle := False; +end; + +function TdxGridReportLinkOptionsFormatting.DesignerTabIndex: Integer; +begin + Result := 2; +end; + +function TdxGridReportLinkOptionsFormatting.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +procedure TdxGridReportLinkOptionsFormatting.SetConsumeSelectionStyle(Value: Boolean); +begin + if FConsumeSelectionStyle <> Value then + begin + FConsumeSelectionStyle := Value; + Changed; + end; +end; + +{ TdxGridReportLinkOptionsLevels } + +procedure TdxGridReportLinkOptionsLevels.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsLevels then + with TdxGridReportLinkOptionsLevels(Source) do + begin + Self.RiseActiveLevelOntoTop := RiseActiveLevelOntoTop; + Self.Unwrap := Unwrap; + Self.UnwrapTopLevel := UnwrapTopLevel; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsLevels.RestoreDefaults; +begin + inherited; + RiseActiveLevelOntoTop := True; + Unwrap := False; + UnwrapTopLevel := True; +end; + +function TdxGridReportLinkOptionsLevels.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +procedure TdxGridReportLinkOptionsLevels.SetRiseActiveLevelOntoTop(Value: Boolean); +begin + if FRiseActiveLevelOntoTop <> Value then + begin + FRiseActiveLevelOntoTop := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsLevels.SetUnwrap(Value: Boolean); +begin + if FUnwrap <> Value then + begin + FUnwrap := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsLevels.SetUnwrapTopLevel(Value: Boolean); +begin + if FUnwrapTopLevel <> Value then + begin + FUnwrapTopLevel := Value; + Changed; + end; +end; + +{ TdxGridReportLinkOptionsOnEveryPage } + +procedure TdxGridReportLinkOptionsOnEveryPage.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsOnEveryPage then + with TdxGridReportLinkOptionsOnEveryPage(Source) do + begin + Self.Caption := Caption; + Self.FilterBar := FilterBar; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsOnEveryPage.RestoreDefaults; +begin + inherited; + Caption := True; + FilterBar := True; +end; + +function TdxGridReportLinkOptionsOnEveryPage.HasInstalledAttribute(AnAttribute: TdxGridAttributeClass): Boolean; +begin + if AnAttribute.InheritsFrom(TdxGridLevelCaption) then + Result := Caption + else + if AnAttribute.InheritsFrom(TdxGridBandHeader) then + Result := BandHeaders + else + if AnAttribute.InheritsFrom(TdxGridHeader) then + Result := Headers + else + if AnAttribute.InheritsFrom(TdxGridFooter) then + Result := Footers + else + if AnAttribute.InheritsFrom(TdxGridFilterBar) then + Result := FilterBar + else + Result := False; +end; + +procedure TdxGridReportLinkOptionsOnEveryPage.SetAll; +begin + BandHeaders := True; + Caption := True; + FilterBar := True; + Footers := True; + Headers := True; +end; + +procedure TdxGridReportLinkOptionsOnEveryPage.UnsetAll; +begin + BandHeaders := False; + Caption := False; + FilterBar := False; + Footers := False; + Headers := False; +end; + +function TdxGridReportLinkOptionsOnEveryPage.DesignerTabIndex: Integer; +begin + Result := 0; +end; + +function TdxGridReportLinkOptionsOnEveryPage.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +procedure TdxGridReportLinkOptionsOnEveryPage.SetCaption(Value: Boolean); +begin + if FCaption <> Value then + begin + FCaption := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsOnEveryPage.SetFilterBar(Value: Boolean); +begin + if FFilterBar <> Value then + begin + FFilterBar := Value; + Changed; + end; +end; + +{ TdxGridReportLinkOptionsPreview } + +function TdxGridReportLinkOptionsPreview.DesignerTabIndex: Integer; +begin + Result := 4; +end; + +function TdxGridReportLinkOptionsPreview.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +{ TdxGridReportLinkOptionsRefinements } + +function TdxGridReportLinkOptionsRefinements.DesignerTabIndex: Integer; +begin + Result := 2; +end; + +function TdxGridReportLinkOptionsRefinements.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +{ TdxGridReportLinkOptionsSelection } + +function TdxGridReportLinkOptionsSelection.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +function TdxGridReportLinkOptionsSelection.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +{ TdxGridReportLinkOptionsSize } + +function TdxGridReportLinkOptionsSize.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +function TdxGridReportLinkOptionsSize.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +{ TdxGridReportLinkOptionsView } + +procedure TdxGridReportLinkOptionsView.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsView then + with TdxGridReportLinkOptionsView(Source) do + begin + Self.Caption := Caption; + Self.FilterBar := FilterBar; + Self.GroupFooters := GroupFooters; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsView.RestoreDefaults; +begin + inherited; + Caption := True; + FilterBar := True; + GroupFooters := True; +end; + +function TdxGridReportLinkOptionsView.HasInstalledAttribute(AnAttribute: TdxGridAttributeClass): Boolean; +begin + if AnAttribute.InheritsFrom(TdxGridLevelCaption) then + Result := Caption + else + if AnAttribute.InheritsFrom(TdxGridBandHeader) then + Result := BandHeaders + else + if AnAttribute.InheritsFrom(TdxGridHeader) then + Result := Headers + else + if AnAttribute.InheritsFrom(TdxGridFooter) then + Result := Footers + else + if AnAttribute.InheritsFrom(TdxGridFilterBar) then + Result := FilterBar + else + Result := False; +end; + +procedure TdxGridReportLinkOptionsView.SetAll; +begin + BandHeaders := True; + Caption := True; + FilterBar := True; + Footers := True; + GroupFooters := True; + Headers := True; + ExpandButtons := True; +end; + +procedure TdxGridReportLinkOptionsView.UnsetAll; +begin + BandHeaders := False; + Caption := False; + FilterBar := False; + Footers := False; + GroupFooters := False; + Headers := False; + ExpandButtons := False; +end; + +function TdxGridReportLinkOptionsView.DesignerTabIndex: Integer; +begin + Result := 0; +end; + +function TdxGridReportLinkOptionsView.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +procedure TdxGridReportLinkOptionsView.SetCaption(Value: Boolean); +begin + if FCaption <> Value then + begin + FCaption := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsView.SetFilterBar(Value: Boolean); +begin + if FFilterBar <> Value then + begin + FFilterBar := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsView.SetGroupFooters(Value: Boolean); +begin + if FGroupFooters <> Value then + begin + FGroupFooters := Value; + Changed; + end; +end; + +{ TdxGridAttributeHostInfo } + +procedure TdxGridAttributeHostInfo.Initialize(AParent: TdxReportCell); +begin + Origin := NullPoint; + FParent := AParent; +end; + +{ TdxGridAttributeHostInfoServices } + +constructor TdxGridAttributeHostInfoServices.Create(AReportLink: TdxGridReportLink); +begin + inherited Create; + FReportLink := AReportLink; + CreateHostInfos; +end; + +destructor TdxGridAttributeHostInfoServices.Destroy; +begin + DestroyHostInfos; + inherited; +end; + +procedure TdxGridAttributeHostInfoServices.Initialize; +begin + PageDetailsHostInfo.Initialize(PageDetails); + PageFootersHostInfo.Initialize(PageFooters); + PageHeadersHostInfo.Initialize(PageHeaders); +end; + +procedure TdxGridAttributeHostInfoServices.CreateHostInfos; +begin + FPageDetailsHostInfo := TdxGridAttributeHostInfo.Create; + FPageFootersHostInfo := TdxGridAttributeHostInfo.Create; + FPageHeadersHostInfo := TdxGridAttributeHostInfo.Create; +end; + +procedure TdxGridAttributeHostInfoServices.DestroyHostInfos; +begin + FreeAndNil(FPageHeadersHostInfo); + FreeAndNil(FPageFootersHostInfo); + FreeAndNil(FPageDetailsHostInfo); +end; + +function TdxGridAttributeHostInfoServices.GetBandHeadersHostInfo: TdxGridAttributeHostInfo; +begin + if CanUseBandHeadersOnEveyPage then + Result := PageHeadersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetCaptionHostInfo: TdxGridAttributeHostInfo; +begin + if CanUseCaptionOnEveryPage then + Result := PageHeadersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetFilterBarHostInfo: TdxGridAttributeHostInfo; +begin + if CanUseFilterBarOnEveryPage then + if ActiveViewHelper.IsFilterBarAtTop(ActiveView) then + Result := PageHeadersHostInfo + else + Result := PageFootersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetFootersHostInfo: TdxGridAttributeHostInfo; +begin + if CanUseFootersOnEveryPage then + Result := PageFootersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetHeadersHostInfo: TdxGridAttributeHostInfo; +begin + if CanUseHeadersOnEveryPage then + Result := PageHeadersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetInconsistentStateText: string; +begin + if ReportLink.IsAggregated then + Result := cxGetResourceString(@sdxCannotUseOnEveryPageModeInAggregatedState) + else + if ReportLink.ProcessParams.HasMasterDetails then + Result := cxGetResourceString(@sdxCannotUseOnEveryPageMode) + else + if IsInconsistentFilterBarState then + Result := cxGetResourceString(@sdxIncorrectFilterBarState) + else + if IsInconsistentBandHeadersState then + if ActiveViewHelper.IsFilterBarAtTop(ActiveView) then + Result := cxGetResourceString(@sdxIncorrectBandHeadersState2) + else + Result := cxGetResourceString(@sdxIncorrectBandHeadersState) + else + if IsInconsistentHeadersState then + if ActiveViewHelper.IsFilterBarAtTop(ActiveView) then + Result := cxGetResourceString(@sdxIncorrectHeadersState2) + else + Result := cxGetResourceString(@sdxIncorrectHeadersState) + else + if IsInconsistentFootersState then + Result := cxGetResourceString(@sdxIncorrectFootersState) + else + Result := ''; +end; + +function TdxGridAttributeHostInfoServices.GetIsInconsistentState: Boolean; +begin + Result := ReportLink.IsAggregated or ReportLink.ProcessParams.HasMasterDetails or + IsInconsistentFilterBarState or IsInconsistentBandHeadersState or + IsInconsistentHeadersState or IsInconsistentFootersState; +end; + +function TdxGridAttributeHostInfoServices.HasCells: Boolean; +begin + Result := ReportLink.ReportCells <> nil; +end; + +function TdxGridAttributeHostInfoServices.IsAttributeSupported(AnAttribute: TdxGridAttributeClass): Boolean; +begin + Result := ActiveViewHelper.IsAttributeSupported(AnAttribute) +end; + +function TdxGridAttributeHostInfoServices.GetActiveView: TcxCustomGridView; +begin + Result := ReportLink.ActiveView; +end; + +function TdxGridAttributeHostInfoServices.GetActiveViewHelper: TdxCustomGridViewHelperClass; +begin + Result := ReportLink.ActiveViewHelper; +// if ActiveView = nil then +// Result := TdxNullGridViewHelper +// else +// Result := dxViewHelpersFactory[ActiveView]; +end; + +function TdxGridAttributeHostInfoServices.GetArePageFootersAssigned: Boolean; +begin + with ReportLink.ReportCells do + Result := (FootersHostInfo.Parent = FooterCells) or (FilterBarHostInfo.Parent = FooterCells); +end; + +function TdxGridAttributeHostInfoServices.GetArePageHeadersAssigned: Boolean; +begin + with ReportLink.ReportCells do + Result := (CaptionHostInfo.Parent = HeaderCells) or (FilterBarHostInfo.Parent = HeaderCells) or + (BandHeadersHostInfo.Parent = HeaderCells) or (HeadersHostInfo.Parent = HeaderCells); +end; + +function TdxGridAttributeHostInfoServices.GetCanUseBandHeadersOnEveyPage: Boolean; +begin + Result := ReportLink.CanAttributeBeUsedOnEveryPage(TdxGridBandHeader) and + ReportLink.IsAttributeUsedOnEveryPage(TdxGridLevelCaption) and + (ActiveViewHelper.IsFilterBarAtBottom(ActiveView) or ReportLink.IsAttributeUsedOnEveryPage(TdxGridFilterBar)); +end; + +function TdxGridAttributeHostInfoServices.GetCanUseCaptionOnEveryPage: Boolean; +begin + Result := ReportLink.CanAttributeBeUsedOnEveryPage(TdxGridLevelCaption); +end; + +function TdxGridAttributeHostInfoServices.GetCanUseFilterBarOnEveryPage: Boolean; +begin + Result := ReportLink.CanAttributeBeUsedOnEveryPage(TdxGridFilterBar) and + ReportLink.IsAttributeUsedOnEveryPage(TdxGridLevelCaption); +end; + +function TdxGridAttributeHostInfoServices.GetCanUseFootersOnEveryPage: Boolean; +begin + Result := ReportLink.CanAttributeBeUsedOnEveryPage(TdxGridFooter) and + (ActiveViewHelper.IsFilterBarAtTop(ActiveView) or ReportLink.IsAttributeUsedOnEveryPage(TdxGridFilterBar)); +end; + +function TdxGridAttributeHostInfoServices.GetCanUseHeadersOnEveryPage: Boolean; +begin + Result := ReportLink.CanAttributeBeUsedOnEveryPage(TdxGridHeader) and + ReportLink.IsAttributeUsedOnEveryPage(TdxGridLevelCaption) and + (ActiveViewHelper.IsFilterBarAtBottom(ActiveView) or ReportLink.IsAttributeUsedOnEveryPage(TdxGridFilterBar)) and + ReportLink.IsAttributeUsedOnEveryPage(TdxGridBandHeader); +end; + +function TdxGridAttributeHostInfoServices.GetIsInconsistentBandHeadersState: Boolean; +begin + Result := IsAttributeSupported(TdxGridBandHeader) and OptionsOnEveryPage.BandHeaders and OptionsView.BandHeaders and + ((IsAttributeSupported(TdxGridLevelCaption) and OptionsView.Caption and not OptionsOnEveryPage.Caption) or + (IsAttributeSupported(TdxGridFilterBar) and ActiveViewHelper.IsFilterBarAtTop(ActiveView) and + OptionsView.FilterBar and not OptionsOnEveryPage.FilterBar)); +end; + +function TdxGridAttributeHostInfoServices.GetIsInconsistentFilterBarState: Boolean; +begin + Result := ActiveViewHelper.IsFilterBarAtTop(ActiveView) and + (IsAttributeSupported(TdxGridFilterBar) and OptionsView.FilterBar and OptionsOnEveryPage.FilterBar and + IsAttributeSupported(TdxGridLevelCaption) and OptionsView.Caption and not OptionsOnEveryPage.Caption); +end; + +function TdxGridAttributeHostInfoServices.GetIsInconsistentFootersState: Boolean; +begin + Result := IsAttributeSupported(TdxGridFooter) and OptionsView.Footers and OptionsOnEveryPage.Footers and + IsAttributeSupported(TdxGridFilterBar) and ActiveViewHelper.IsFilterBarAtBottom(ActiveView) and + OptionsView.FilterBar and not OptionsOnEveryPage.FilterBar; +end; + +function TdxGridAttributeHostInfoServices.GetIsInconsistentHeadersState: Boolean; +begin + Result := IsAttributeSupported(TdxGridHeader) and OptionsView.Headers and OptionsOnEveryPage.Headers and + ((IsAttributeSupported(TdxGridLevelCaption) and OptionsView.Caption and not OptionsOnEveryPage.Caption) or + (IsAttributeSupported(TdxGridFilterBar) and ActiveViewHelper.IsFilterBarAtTop(ActiveView) and + OptionsView.FilterBar and not OptionsOnEveryPage.FilterBar) or + (IsAttributeSupported(TdxGridBandHeader) and OptionsView.BandHeaders and not OptionsOnEveryPage.BandHeaders)); +end; + +function TdxGridAttributeHostInfoServices.GetLevelSeparatorBottomHostInfo: TdxGridAttributeHostInfo; +begin + if ArePageFootersAssigned then + Result := PageFootersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetLevelSeparatorTopHostInfo: TdxGridAttributeHostInfo; +begin + if ArePageHeadersAssigned then + Result := PageHeadersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetOptionsOnEveryPage: TdxGridReportLinkOptionsOnEveryPage; +begin + Result := ReportLink.OptionsOnEveryPage; +end; + +function TdxGridAttributeHostInfoServices.GetOptionsView: TdxGridReportLinkOptionsView; +begin + Result := ReportLink.OptionsView; +end; + +function TdxGridAttributeHostInfoServices.GetPageDetails: TdxReportCell; +begin + if HasCells then + Result := ReportLink.ReportCells.Cells + else + Result := nil; +end; + +function TdxGridAttributeHostInfoServices.GetPageFooters: TdxReportCell; +begin + if HasCells and not ReportLink.ProcessParams.HasMasterDetails then + Result := ReportLink.ReportCells.FooterCells + else + Result := PageDetails; +end; + +function TdxGridAttributeHostInfoServices.GetPageHeaders: TdxReportCell; +begin + if HasCells and not ReportLink.ProcessParams.HasMasterDetails then + Result := ReportLink.ReportCells.HeaderCells + else + Result := PageDetails; +end; + +{ TdxGridReportLinkStyles } + +procedure TdxGridReportLinkStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TdxGridReportLinkStyles then + with TdxGridReportLinkStyles(Source) do + begin + Self.BandHeader := BandHeader; + Self.Caption := Caption; + Self.CardCaptionRow := CardCaptionRow; + Self.CardRowCaption := CardRowCaption; + Self.Content := Content; + Self.ContentEven := ContentEven; + Self.ContentOdd := ContentOdd; + Self.FilterBar := FilterBar; + Self.Footer := Footer; + Self.Group := Group; + Self.Header := Header; + Self.Preview := Preview; + Self.Selection := Selection; + end; // TODO: assign to TcxGridXXXStyles +end; + +procedure TdxGridReportLinkStyles.GetBandHeaderParams(ABand: TcxGridBand; + out AParams: TcxViewParams); +begin + GetViewParams(vspsGridBandHeader, ABand, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetCaptionParams(ATabLevel: TcxGridLevel; out AParams: TcxViewParams); +begin + GetViewParams(vspsGridCaption, ATabLevel, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetCardCaptionRowParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +var + DataCellPos: TdxPSGridDataCellPos; +begin + DataCellPos := CreatePSDataCellPos; + try + with DataCellPos do + begin + GridRecord := ARecord; + Item := AItem; + end; + GetViewParams(vspsGridCardCaptionRow, DataCellPos, nil, AParams); + finally + FreePSDataCellPos(DataCellPos); + end; +end; + +procedure TdxGridReportLinkStyles.GetCardRowCaptionParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +var + DataCellPos: TdxPSGridDataCellPos; +begin + DataCellPos := CreatePSDataCellPos; + try + with DataCellPos do + begin + GridRecord := ARecord; + Item := AItem; + end; + GetViewParams(vspsGridCardRowCaption, DataCellPos, nil, AParams); + finally + FreePSDataCellPos(DataCellPos); + end; +end; + +procedure TdxGridReportLinkStyles.GetContentParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +const + StyleIndexes: array[Boolean] of Integer = (vspsGridContentEven, vspsGridContentOdd); +var + DataCellPos: TdxPSGridDataCellPos; +begin + if (ARecord <> nil) and (GetValue(StyleIndexes[Odd(ARecord.Index)]) <> nil) then + begin + DataCellPos := CreatePSDataCellPos; + try + with DataCellPos do + begin + GridRecord := ARecord; + Item := AItem; + end; + GetViewParams(StyleIndexes[Odd(ARecord.Index)], DataCellPos, nil, AParams); + finally + FreePSDataCellPos(DataCellPos); + end; + end + else + GetViewParams(vspsGridContent, ARecord, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetFilterBarParams(out AParams: TcxViewParams); +begin + GetViewParams(vspsGridFilterBar, nil, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetFooterParams(ARecord: TcxCustomGridRecord; + AGroupLevel: Integer; AItem: TcxGridColumn; out AParams: TcxViewParams); +begin + GetViewParams(vspsGridFooter, ARecord, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetGroupParams(ARecord: TcxCustomGridRecord; + AGroupLevel: Integer; out AParams: TcxViewParams); +begin + GetViewParams(vspsGridGroup, ARecord, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetHeaderParams(AItem: TcxGridColumn; + out AParams: TcxViewParams); +begin + GetViewParams(vspsGridHeader, nil, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetPreviewParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +begin + GetViewParams(vspsGridPreview, ARecord, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetSelectionParams(out AParams: TcxViewParams); +begin + GetViewParams(vspsGridSelection, nil, nil, AParams); +end; + +function TdxGridReportLinkStyles.DesignerTabIndex: Integer; +begin + Result := 3; +end; + +procedure TdxGridReportLinkStyles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +const + FixedParts = [vspsGridBandHeader, vspsGridCaption, vspsGridFooter, vspsGridHeader, + vspsGridSelection]; +begin + inherited; + if ReportLink <> nil then + with AParams do + begin + if Index in FixedParts then + Color := dxPSCore.dxDefaultFixedColor + else + if Index = vspsGridGroup then + if ReportLink.IsOffice11StyleGrouping and (AData = nil) then + Color := dxPSCore.dxDefaultFixedColor + else + Color := dxPSCore.dxDefaultContentColor + else + if Index = vspsGridFilterBar then + Color := DefaultFilterBarColor + else + Color := dxPSCore.dxDefaultContentColor; + + Font := ReportLink.Font; + + if Index = vspsGridFilterBar then + TextColor := DefaultFilterBarTextColor + else + TextColor := Font.Color; + end; +end; + +class function TdxGridReportLinkStyles.GetStyleCaption(AnIndex: Integer): string; +begin + case AnIndex of + vspsGridBandHeader: + Result := cxGetResourceString(@sdxBandHeaderStyle); + vspsGridCaption: + Result := cxGetResourceString(@sdxCaptionStyle); + vspsGridCardCaptionRow: + Result := cxGetResourceString(@sdxCardCaptionRowStyle); + vspsGridCardRowCaption: + Result := cxGetResourceString(@sdxCardRowCaptionStyle); + vspsGridContent: + Result := cxGetResourceString(@sdxContentStyle); + vspsGridContentEven: + Result := cxGetResourceString(@sdxContentEvenStyle); + vspsGridContentOdd: + Result := cxGetResourceString(@sdxContentOddStyle); + vspsGridFilterBar: + Result := cxGetResourceString(@sdxFilterBarStyle); + vspsGridFooter: + Result := cxGetResourceString(@sdxFooterStyle); + vspsGridGroup: + Result := cxGetResourceString(@sdxGroupStyle); + vspsGridHeader: + Result := cxGetResourceString(@sdxHeaderStyle); + vspsGridPreview: + Result := cxGetResourceString(@sdxPreviewStyle); + else + Result := cxGetResourceString(@sdxSelectionStyle); + end; +end; + +function TdxGridReportLinkStyles.GetStyleIndexByCaption(const Caption: string): Integer; +begin + for Result := vspsGridFirst to vspsGridLast do + if dxPSUtl.dxSameText(Caption, GetStyleCaption(Result)) then + Exit; + Result := -1; +end; + +function TdxGridReportLinkStyles.IsCardViewStyle(AStyle: TcxStyle): Boolean; +begin + Result := (AStyle <> nil) and ((AStyle = CardRowCaption) or (AStyle = CardCaptionRow)); +end; + +function TdxGridReportLinkStyles.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +{ TdxGridReportLinkStyleSheet } + +class function TdxGridReportLinkStyleSheet.GetStylesClass: TcxCustomStylesClass; +begin + Result := TdxGridReportLinkStyles; +end; + +function TdxGridReportLinkStyleSheet.GetStylesValue: TdxGridReportLinkStyles; +begin + if GetStyles is TdxGridReportLinkStyles then + Result := TdxGridReportLinkStyles(GetStyles) + else + Result := nil; +end; + +procedure TdxGridReportLinkStyleSheet.SetStylesValue(Value: TdxGridReportLinkStyles); +begin + SetStyles(Value); +end; + +{ TdxGridReportLink } + +constructor TdxGridReportLink.Create(AOwner: TComponent); +begin + inherited; + FDelimitersHardVert := TList.Create; + FHostInfoServices := TdxGridAttributeHostInfoServices.Create(Self); + FReportRows := TList.Create; + InternalRestoreDefaults; + LinkModified(False); +end; + +destructor TdxGridReportLink.Destroy; +begin + FreeAndNil(FReportRows); + FreeAndNil(FHostInfoServices); + FreeAndNil(FDelimitersHardVert); + inherited; +end; + +procedure TdxGridReportLink.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLink then + with TdxGridReportLink(Source) do + begin + Self.OptionsCards := OptionsCards; + Self.OptionsDetails := OptionsDetails; + Self.OptionsLevels := OptionsLevels; + end; + inherited; +end; + +procedure TdxGridReportLink.AddPageBreak(AGridRecord: TcxCustomGridRecord); +var + ReportRow: TdxReportCell; +begin + ReportRow := ReportRowsByGridRecord[AGridRecord]; + if ReportRow <> nil then + AddVerticalHardDelimiter(ReportRow); +end; + +procedure TdxGridReportLink.AddPageBreak(const AGridRecords: array of TcxCustomGridRecord); +var + I: Integer; +begin + for I := Low(AGridRecords) to High(AGridRecords) do + AddPageBreak(AGridRecords[I]); +end; + +procedure TdxGridReportLink.AddPageBreak(const AGridRecords: TdxGridRecordArray); +var + I: Integer; +begin + for I := 0 to Length(AGridRecords) - 1 do + AddPageBreak(AGridRecords[I]); +end; + +procedure TdxGridReportLink.AddPageBreak(AGridRecords: TList); +var + I: Integer; + P: Pointer; +begin + for I := 0 to AGridRecords.Count - 1 do + begin + P := AGridRecords[I]; + if TObject(P) is TcxCustomGridRecord then + AddPageBreak(TcxCustomGridRecord(P)); + end; +end; + +procedure TdxGridReportLink.BeforeDesignReport; +begin + CalculateProcessParams; + inherited; +end; + +procedure TdxGridReportLink.ConstructReport(AReportCells: TdxReportCells); + + procedure CalculateSizes; + + procedure CalculateReportPartSizes(ACell: TdxReportCell); + var + Width, I, V: Integer; + begin + if ACell.CellCount > 0 then + begin + Width := 0; + for I := 0 to ACell.CellCount - 1 do + begin + V := ACell.Cells[I].Width; + if Width < V then Width := V; + end; + ACell.BoundsRect := MakeRect(0, 0, Width, ACell.LastCell.BoundsRect.Bottom); + end; + end; + + begin + with AReportCells do + begin + CalculateReportPartSizes(Cells); + if AreFooterCellsAllocated then CalculateReportPartSizes(FooterCells); + if AreHeaderCellsAllocated then CalculateReportPartSizes(HeaderCells); + end; + end; + +begin + if Grid = nil then Exit; + inherited; + if ActiveView = nil then Exit; + + PrepareConstruct; + try + BuildTopLevelViews; + if not AbortBuilding then CalculateSizes; + finally + UnprepareConstruct; + end; +end; + +procedure TdxGridReportLink.ConvertCoords; +begin + inherited; + ConvertDelimiters(DelimitersHardVert); +end; + +procedure TdxGridReportLink.CustomDraw(AItem: TAbstractdxReportCellData; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); +var + DrawInfo: TdxGridCellCustomDrawInfo; +begin + GetItemCustomDrawInfo(AItem, DrawInfo); + with DrawInfo do + case GridAttributeID of + dxGridBandID: + DoCustomDrawBandCell(ACanvas, TcxGridBandedTableView(GridView), GridBand, + TdxReportCellString(AItem), ADone); + dxGridCardRowCaptionID: + DoCustomDrawCardRowCaptionCell(ACanvas, TcxGridCardView(GridView), GridCard, + GridCardRow, TdxReportCellString(AItem), ADone); + dxGridCardRowDataID: + DoCustomDrawCardRowDataCell(ACanvas, TcxGridCardView(GridView), GridCard, + GridCardRow, AItem, ADone); + dxGridFilterBarID: + DoCustomDrawFilterBar(ACanvas, TcxCustomGridTableView(GridView), + TdxReportCellString(AItem), ADone); + dxGridFooterID, + dxGridGroupFooterID: + DoCustomDrawFooterCell(ACanvas, TcxGridTableView(GridView), GridRecord, + GridColumn, GroupLevel, TdxReportCellString(AItem), ADone); + dxGridHeaderID: + DoCustomDrawHeaderCell(ACanvas, TcxGridTableView(GridView), GridColumn, + TdxReportCellString(AItem), ADone); + dxGridRecordID: + DoCustomDrawCell(ACanvas, TcxCustomGridTableView(GridView), GridRecord, + GridColumn, AItem, ADone); + dxGridLevelCaptionID: + DoCustomDrawLevelCaption(ACanvas, GridView, TdxReportCellString(AItem), ADone); + end; +end; + +function TdxGridReportLink.GetBreakPagesByHardDelimiters: Boolean; +begin + with OptionsPagination do + Result := OneGroupPerPage or Custom; +end; + +function TdxGridReportLink.GetEmptyPagesCanExist: Boolean; +begin + Result := ProcessParams.HasMasterDetails; +end; + +function TdxGridReportLink.GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; +begin + Result := (AUpdateCodes * uaMarginsVert <> []) and (ProcessParams.HasOnlyCards or OptionsSize.AutoWidth); +end; + +function TdxGridReportLink.GetUseHardVertDelimiters: Boolean; +begin + with OptionsPagination do + Result := TopLevelGroup or Custom; +end; + +procedure TdxGridReportLink.InternalRestoreDefaults; +begin + inherited; + OptionsCards.RestoreDefaults; + OptionsDetails.RestoreDefaults; + OptionsLevels.RestoreDefaults; +end; + +procedure TdxGridReportLink.InternalRestoreFromOriginal; +var + View: TcxCustomGridView; +begin + inherited; + Color := clWhite; + + if Grid <> nil then + begin + OptionsFormatting.LookAndFeelKind := Grid.LookAndFeel.Kind; + OptionsView.Caption := Grid.RootLevelOptions.DetailTabsPosition <> dtpNone; + + View := ActiveView; + if View <> nil then + begin + if View is TcxGridTableView then + begin + OptionsPreview.AutoHeight := TcxGridTableView(View).Preview.AutoHeight; + OptionsPreview.MaxLineCount := TcxGridTableView(View).Preview.MaxLineCount; + OptionsPreview.Visible := TcxGridTableView(View).Preview.Visible; + + if View is TcxGridBandedTableView then + OptionsView.BandHeaders := TcxGridBandedTableView(View).OptionsView.BandHeaders; + OptionsView.FilterBar := (TcxGridTableView(View).Filtering.Visible = fvAlways) or + ((TcxGridTableView(View).Filtering.Visible = fvNonEmpty) and + (TcxGridTableView(View).DataController.Filter.FilterText <> '')); + OptionsView.Footers := TcxGridTableView(View).OptionsView.Footer; + OptionsView.GroupFooters := TcxGridTableView(View).OptionsView.GroupFooters <> gfInvisible; + OptionsView.Headers := TcxGridTableView(View).OptionsView.Header; + + OptionsSize.AutoWidth := TcxGridTableView(View).OptionsView.ColumnAutoWidth; + end; + + if View is TcxGridCardView then + OptionsView.FilterBar := False; + end; + end; +end; + +function TdxGridReportLink.IsDrawFootersOnEveryPage: Boolean; +begin + Result := HostInfoServices.ArePageFootersAssigned; +end; + +function TdxGridReportLink.IsDrawHeadersOnEveryPage: Boolean; +begin + Result := HostInfoServices.ArePageHeadersAssigned; +end; + +function TdxGridReportLink.IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; +var + DrawInfo: TdxGridCellCustomDrawInfo; +begin + Result := inherited IsSupportedCustomDraw(Item) and + (Item <> nil) and IsCustomDrawn(GetItemCustomDrawInfo(Item, DrawInfo)); +end; + +procedure TdxGridReportLink.MakeHardDelimiters(AReportCells: TdxReportCells; + AVertDelimiters: TList); +begin + inherited; + if OptionsPagination.Custom then + try + DoGetCustomPageBreaks; + except + Application.HandleException(Self); + end; + dxPSUtl.dxCopyList(DelimitersHardVert, AVertDelimiters); +end; + +function TdxGridReportLink.GetAreNativeStylesAvailable: Boolean; +begin + Result := OptionsFormatting.UseNativeStyles; +end; + +function TdxGridReportLink.GetStylesClass: TdxCustomReportLinkStylesClass; +begin + Result := TdxGridReportLinkStyles; +end; + +function TdxGridReportLink.GetStyleSheetClass: TdxCustomReportLinkStyleSheetClass; +begin + Result := TdxGridReportLinkStyleSheet; +end; + +function TdxGridReportLink.GetStyleSheetPrototype: TdxCustomReportLinkStyleSheet; +begin + Result := GridLinkStyleSheetPrototype; +end; + +procedure TdxGridReportLink.PrepareConstruct; +begin + inherited; + DelimitersHardVert.Clear; + FReportRows.Clear; + + ReportCells.LookAndFeel := nil;//ReportCells.CreateGroupLookAndFeel(TdxPSReportGroupNullLookAndFeel); + + if OptionsExpanding.HasAny then + DoExpandRows; + + CalculateProcessParams; + HostInfoServices.Initialize; +end; + +procedure TdxGridReportLink.DoCustomDrawBandCell(ACanvas: TCanvas; + AView: TcxGridBandedTableView; ABand: TcxGridBand; AnItem: TdxReportCellString; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawBandCell) then + FOnCustomDrawBandCell(Self, ACanvas, AView, ABand, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawCardRowCaptionCell(ACanvas: TCanvas; + AView: TcxGridCardView; ACard: TcxGridCard; ARow: TcxGridCardViewRow; + AnItem: TdxReportCellString; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawCardRowCaptionCell) then + FOnCustomDrawCardRowCaptionCell(Self, ACanvas, AView, ACard, ARow, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawCardRowDataCell(ACanvas: TCanvas; + AView: TcxGridCardView; ACard: TcxGridCard; ARow: TcxGridCardViewRow; + AnItem: TAbstractdxReportCellData; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawCardRowDataCell) then + FOnCustomDrawCardRowDataCell(Self, ACanvas, AView, ACard, ARow, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawCell(ACanvas: TCanvas; + AView: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; AnItem: TAbstractdxReportCellData; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawCell) then + FOnCustomDrawCell(Self, ACanvas, AView, ARecord, AColumn, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawFilterBar(ACanvas: TCanvas; + AView: TcxCustomGridTableView; AnItem: TdxReportCellString; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawFilterBar) then + FOnCustomDrawFilterBar(Self, ACanvas, AView, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawFooterCell(ACanvas: TCanvas; + AView: TcxGridTableView; ARecord: TcxCustomGridRecord; AColumn: TcxGridColumn; + ALevel: Integer; AnItem: TdxReportCellString; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawFooterCell) then + FOnCustomDrawFooterCell(Self, ACanvas, AView, ARecord, AColumn, ALevel, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawHeaderCell(ACanvas: TCanvas; + AView: TcxGridTableView; AColumn: TcxGridColumn; AnItem: TdxReportCellString; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawHeaderCell) then + FOnCustomDrawHeaderCell(Self, ACanvas, AView, AColumn, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawLevelCaption(ACanvas: TCanvas; + AView: TcxCustomGridView; AnItem: TdxReportCellString; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawLevelCaption) then + FOnCustomDrawLevelCaption(Self, ACanvas, AView, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoGetCellHeight(AView: TcxCustomGridTableView; + ARecord: TcxCustomGridRecord; ATableItem: TcxCustomGridTableItem; + var AHeight: Integer); +begin + if Assigned(FOnGetCellHeight) then + FOnGetCellHeight(Self, AView, ARecord, ATableItem, AHeight); +end; + +procedure TdxGridReportLink.DoGetCustomPageBreaks; +begin + if Assigned(FOnGetCustomPageBreaks) then FOnGetCustomPageBreaks(Self); +end; + +procedure TdxGridReportLink.DoInitializeBandCell(AView: TcxGridBandedTableView; + ABand: TcxGridBand; AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeBandCell) then + FOnInitializeBandCell(Self, AView, ABand, AnItem); +end; + +procedure TdxGridReportLink.DoInitializeCardRowCaptionCell(AView: TcxGridCardView; + ACard: TcxGridCard; ARow: TcxGridCardViewRow; AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeCardRowCaptionCell) then + FOnInitializeCardRowCaptionCell(Self, AView, ACard, ARow, AnItem); +end; + +procedure TdxGridReportLink.DoInitializeCardRowDataCell(AView: TcxGridCardView; + ACard: TcxGridCard; ARow: TcxGridCardViewRow; AnItem: TAbstractdxReportCellData); +begin + if Assigned(FOnInitializeCardRowDataCell) then + FOnInitializeCardRowDataCell(Self, AView, ACard, ARow, AnItem); +end; + +procedure TdxGridReportLink.DoInitializeCell(AView: TcxCustomGridTableView; + ARecord: TcxCustomGridRecord; AColumn: TcxGridColumn; AnItem: TAbstractdxReportCellData); +begin + if Assigned(FOnInitializeCell) then + FOnInitializeCell(Self, AView, ARecord, AColumn, AnItem); +end; + +procedure TdxGridReportLink.DoInitializeFilterBar(AView: TcxCustomGridTableView; + AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeFilterBar) then + FOnInitializeFilterBar(Self, AView, AnItem); +end; + +procedure TdxGridReportLink.DoInitializeFooterCell(AView: TcxGridTableView; + ARecord: TcxCustomGridRecord; AColumn: TcxGridColumn; ALevel: Integer; + AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeFooterCell) then + FOnInitializeFooterCell(Self, AView, ARecord, AColumn, ALevel, AnItem); +end; + +procedure TdxGridReportLink.DoInitializeHeaderCell(AView: TcxGridTableView; + AColumn: TcxGridColumn; AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeHeaderCell) then + FOnInitializeHeaderCell(Self, AView, AColumn, AnItem); +end; + +procedure TdxGridReportLink.DoInitializeLevelCaption(AView: TcxCustomGridView; + AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeLevelCaption) then + FOnInitializeLevelCaption(Self, AView, AnItem); +end; + +procedure TdxGridReportLink.CreateOptions; +begin + inherited; + FOptionsCards := GetOptionsCardsClass.Create(Self); + FOptionsDetails := GetOptionsDetailsClass.Create(Self); + FOptionsLevels := GetOptionsLevelsClass.Create(Self); +end; + +procedure TdxGridReportLink.DestroyOptions; +begin + FreeAndNil(FOptionsLevels); + FreeAndNil(FOptionsDetails); + FreeAndNil(FOptionsCards); + inherited; +end; + +function TdxGridReportLink.GetOptionsCardsClass: TdxGridReportLinkOptionsCardsClass; +begin + Result := TdxGridReportLinkOptionsCards; +end; + +function TdxGridReportLink.GetOptionsDetailsClass: TdxGridReportLinkOptionsDetailsClass; +begin + Result := TdxGridReportLinkOptionsDetails; +end; + +function TdxGridReportLink.GetOptionsExpandingClass: TdxCustomReportLinkOptionsExpandingClass; +begin + Result := TdxGridReportLinkOptionsExpanding; +end; + +function TdxGridReportLink.GetOptionsFormattingClass: TdxCustomReportLinkOptionsFormattingClass; +begin + Result := TdxGridReportLinkOptionsFormatting; +end; + +function TdxGridReportLink.GetOptionsLevelsClass: TdxGridReportLinkOptionsLevelsClass; +begin + Result := TdxGridReportLinkOptionsLevels; +end; + +function TdxGridReportLink.GetOptionsOnEveryPageClass: TdxCustomTableControlReportLinkOptionsOnEveryPageClass; +begin + Result := TdxGridReportLinkOptionsOnEveryPage; +end; + +function TdxGridReportLink.GetOptionsPaginationClass: TdxCustomReportLinkOptionsPaginationClass; +begin + Result := TdxGridReportLinkOptionsPagination; +end; + +function TdxGridReportLink.GetOptionsPreviewClass: TdxCustomTableControlReportLinkOptionsPreviewClass; +begin + Result := TdxGridReportLinkOptionsPreview; +end; + +function TdxGridReportLink.GetOptionsRefinementsClass: TdxCustomReportLinkOptionsRefinementsClass; +begin + Result := TdxGridReportLinkOptionsRefinements; +end; + +function TdxGridReportLink.GetOptionsSelectionClass: TdxCustomTableControlReportLinkOptionsSelectionClass; +begin + Result := TdxGridReportLinkOptionsSelection; +end; + +function TdxGridReportLink.GetOptionsSizeClass: TdxCustomReportLinkOptionsSizeClass; +begin + Result := TdxGridReportLinkOptionsSize; +end; + +function TdxGridReportLink.GetOptionsViewClass: TdxCustomReportLinkOptionsViewClass; +begin + Result := TdxGridReportLinkOptionsView; +end; + +procedure TdxGridReportLink.AddReportRow(AReportRow: TdxReportCell); +begin + FReportRows.Add(AReportRow); +end; + +procedure TdxGridReportLink.AddVerticalHardDelimiter(ADelimiter: TdxReportCell); +var + R: TRect; +begin + R := ADelimiter.AbsoluteRect; + AddVerticalHardDelimiter(R.Top); +end; + +procedure TdxGridReportLink.AddVerticalHardDelimiter(ADelimiter: Integer); +begin + FDelimitersHardVert.Add(TObject(ADelimiter)); +end; + +procedure TdxGridReportLink.BuildTopLevelView(AGridView: TcxCustomGridView); +begin + if AGridView <> FProcessedView then BuildView(nil, AGridView); +end; + +procedure TdxGridReportLink.BuildTopLevelViews; +var + MasterRow: TcxGridMasterDataRow; + CurrentView: TcxCustomGridView; +begin + if OptionsLevels.Unwrap and OptionsLevels.UnwrapTopLevel then + begin + FProcessedView := nil; + try + MasterRow := ActiveViewMasterRow; + if OptionsLevels.RiseActiveLevelOntoTop then + begin + if MasterRow <> nil then + CurrentView := MasterRow.ActiveDetailGridView + else + CurrentView := ActiveView; + BuildTopLevelView(CurrentView); + FProcessedView := CurrentView; + end; + if not AbortBuilding then + ForEachView(MasterRow, BuildTopLevelView); + finally + FProcessedView := nil; + end; + end + else + BuildTopLevelView(ActiveView); +end; + +procedure TdxGridReportLink.BuildView(AMasterBuilder: TdxCustomGridViewBuilder; + AGridView: TcxCustomGridView); +begin + with CreateViewBuilder(AMasterBuilder, AGridView) do + try + Build; + finally + Free; + end; +end; + +function TdxGridReportLink.CreateViewAdapter(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView): TdxCustomGridViewAdapter; +begin + Result := dxGridViewBuildersFactory.CreateViewAdapter(AMasterAdapter, AGridView); +end; + +function TdxGridReportLink.CreateViewBuilder(AMasterBuilder: TdxCustomGridViewBuilder; + AGridView: TcxCustomGridView): TdxCustomGridViewBuilder; +begin + Result := dxGridViewBuildersFactory.CreateViewBuilder(Self, AMasterBuilder, AGridView); +end; + +procedure TdxGridReportLink.DoExpandRows; +begin + if OptionsLevels.Unwrap and OptionsLevels.UnwrapTopLevel then + ForEachView(ActiveViewMasterRow, DoExpandViewRows) + else + DoExpandViewRows(ActiveView); +end; + +procedure TdxGridReportLink.DoExpandViewRows(AGridView: TcxCustomGridView); +begin + if AGridView <> nil then + with CreateViewAdapter(nil, AGridView) do + try + ExpandAllRows(OptionsExpanding, not OptionsDetails.OnlyFocusedView); + finally + Free; + end; +end; + +procedure TdxGridReportLink.ForEachView(AMasterRow: TcxGridMasterDataRow; AProc: TdxGridViewProc); +var + I: Integer; + GridView: TcxCustomGridView; + Level: TcxGridLevel; +begin + if not Assigned(AProc) then Exit; + + if AMasterRow <> nil then + for I := 0 to AMasterRow.DetailGridViewCount -1 do + begin + GridView := AMasterRow.DetailGridViews[I]; + if GridView <> nil then + begin + Level := GridView.Level as TcxGridLevel; + if Level.Visible then AProc(GridView); + end; + if AbortBuilding then Break; + end + else + with Grid.Levels do + for I := 0 to VisibleCount - 1 do + begin + AProc(VisibleItems[I].GridView); + if AbortBuilding then Break; + end; +end; + +function TdxGridReportLink.GetItemCustomDrawInfo(AnItem: TdxReportVisualItem; + out ADrawInfo: TdxGridCellCustomDrawInfo): TdxGridAttributeID; +begin + dxViewHelpersFactory.HelperClassByItem(AnItem).ExtractCustomDrawInfo(AnItem, ADrawInfo); + Result := ADrawInfo.GridAttributeID; +end; + +function TdxGridReportLink.HasSiblings(AGridView: TcxCustomGridView): Boolean; +var + ValidViewCount, I: Integer; +begin + if AGridView <> nil then + begin + ValidViewCount := 0; + with TcxGridLevel(AGridView.Level).Parent do + for I := 0 to VisibleCount - 1 do + begin + if VisibleItems[I].GridView <> nil then Inc(ValidViewCount); + if ValidViewCount > 1 then Break; + end; + Result := ValidViewCount > 1; + end + else + Result := False; +end; + +function TdxGridReportLink.IsCardViewStyle(AStyle: TcxStyle): Boolean; +begin + Result := Styles.IsCardViewStyle(AStyle); +end; + +function TdxGridReportLink.IsCustomDrawn(AnAttributeID: TdxGridAttributeID): Boolean; +begin + Result := False; + case AnAttributeID of + dxGridBandID: + Result := Assigned(FOnCustomDrawBandCell); + dxGridCardRowCaptionID: + Result := Assigned(FOnCustomDrawCardRowCaptionCell); + dxGridCardRowDataID: + Result := Assigned(FOnCustomDrawCardRowDataCell); + dxGridFilterBarID: + Result := Assigned(FOnCustomDrawFilterBar); + dxGridFooterID, + dxGridGroupFooterID: + Result := Assigned(FOnCustomDrawFooterCell); + dxGridHeaderID: + Result := Assigned(FOnCustomDrawHeaderCell); + dxGridLevelCaptionID: + Result := Assigned(FOnCustomDrawLevelCaption); + dxGridRecordID: + Result := Assigned(FOnCustomDrawCell); + end; +end; + +function TdxGridReportLink.IsOffice11StyleGrouping: Boolean; +begin + Result := False; +end; + +procedure TdxGridReportLink.CalculateProcessParams; +var + Adapter: TdxCustomGridViewAdapter; + View: TcxCustomGridView; +begin + View := ActiveView; + + with FProcessParams do + if View = nil then + begin + HasMasterDetails := False; + HasMasterDetailsInTopView := False; + HasOnlyCards := False; + HasUnwrapableData := False; + CanUseOnEveryPageMode := not IsAggregated; + end + else + begin + Adapter := CreateViewAdapter(nil, View); + try + HasUnwrapableData := HasSiblings(Grid.ActiveLevel.GridView); + HasMasterDetailsInTopView := View.IsDetail or View.IsMaster; + HasMasterDetails := (HasUnwrapableData and OptionsLevels.Unwrap) or + (View.IsMaster and not Adapter.AreAllMasterRowsCollapsed and + not (OptionsDetails.StartFromFocusedView and OptionsDetails.OnlyFocusedView)); + HasOnlyCards := View is TcxGridCardView; + CanUseOnEveryPageMode := not IsAggregated and not HasMasterDetails and + Adapter.CanUseOnEveryPageMode; {Adapter.RecordCount <> 0} + finally + Adapter.Free; + end; + end; +end; + +function TdxGridReportLink.CanAttributeBeUsedOnEveryPage(AnAttribute: TdxGridAttributeClass): Boolean; +begin + Result := ProcessParams.CanUseOnEveryPageMode and OptionsOnEveryPage.HasInstalledAttribute(AnAttribute); +end; + +function TdxGridReportLink.IsAttributeUsedOnEveryPage(AnAttribute: TdxGridAttributeClass): Boolean; +begin + Result := CanAttributeBeUsedOnEveryPage(AnAttribute) or not OptionsView.HasInstalledAttribute(AnAttribute); +end; + +function TdxGridReportLink.GetActiveStyles: TdxGridReportLinkStyles; +begin + Result := inherited ActiveStyles as TdxGridReportLinkStyles; +end; + +function TdxGridReportLink.GetActiveView: TcxCustomGridView; +var + Level: TcxGridLevel; +begin + Result := nil; + if Grid <> nil then + Result := Grid.FocusedView; + if (Result <> nil) and not OptionsDetails.StartFromFocusedView then + begin + Level := Result.Level as TcxGridLevel; + while not Level.IsTop do + Level := Level.Parent; + Result := Level.GridView; + end; +end; + +function TdxGridReportLink.GetActiveViewHelper: TdxCustomGridViewHelperClass; +begin + if ActiveView = nil then + Result := TdxNullGridViewHelper + else + Result := dxViewHelpersFactory[ActiveView]; +end; + +function TdxGridReportLink.GetActiveViewMasterRow: TcxGridMasterDataRow; +begin + Result := nil; + with ActiveView do + if MasterGridRecordIndex <> -1 then + Result := (MasterGridView as TcxGridTableView).ViewData.Rows[MasterGridRecordIndex] as TcxGridMasterDataRow; +end; + +function TdxGridReportLink.GetActiveViewParentLevel: TcxGridLevel; +var + GridView: TcxCustomGridView; +begin + Result := nil; + GridView := ActiveView; + if GridView <> nil then + Result := TcxGridLevel(GridView.Level).Parent; +end; + +function TdxGridReportLink.GetDesignWindow: TdxfmGridReportLinkDesignWindow; +begin + Result := inherited DesignWindow as TdxfmGridReportLinkDesignWindow; +end; + +function TdxGridReportLink.GetGrid: TcxGrid; +begin + Result := TcxGrid(Component); +end; + +function TdxGridReportLink.GetOptionsExpanding: TdxGridReportLinkOptionsExpanding; +begin + Result := inherited OptionsExpanding as TdxGridReportLinkOptionsExpanding; +end; + +function TdxGridReportLink.GetOptionsFormatting: TdxGridReportLinkOptionsFormatting; +begin + Result := inherited OptionsFormatting as TdxGridReportLinkOptionsFormatting; +end; + +function TdxGridReportLink.GetOptionsOnEveryPage: TdxGridReportLinkOptionsOnEveryPage; +begin + Result := inherited OptionsOnEveryPage as TdxGridReportLinkOptionsOnEveryPage; +end; + +function TdxGridReportLink.GetOptionsPagination: TdxGridReportLinkOptionsPagination; +begin + Result := inherited OptionsPagination as TdxGridReportLinkOptionsPagination; +end; + +function TdxGridReportLink.GetOptionsPreview: TdxGridReportLinkOptionsPreview; +begin + Result := inherited OptionsPreview as TdxGridReportLinkOptionsPreview; +end; + +function TdxGridReportLink.GetOptionsRefinements: TdxGridReportLinkOptionsRefinements; +begin + Result := inherited OptionsRefinements as TdxGridReportLinkOptionsRefinements; +end; + +function TdxGridReportLink.GetOptionsSelection: TdxGridReportLinkOptionsSelection; +begin + Result := inherited OptionsSelection as TdxGridReportLinkOptionsSelection; +end; + +function TdxGridReportLink.GetOptionsSize: TdxGridReportLinkOptionsSize; +begin + Result := inherited OptionsSize as TdxGridReportLinkOptionsSize; +end; + +function TdxGridReportLink.GetOptionsView: TdxGridReportLinkOptionsView; +begin + Result := inherited OptionsView as TdxGridReportLinkOptionsView; +end; + +function TdxGridReportLink.GetReportRow(Index: Integer): TdxReportCell; +begin + Result := FReportRows[Index]; +end; + +function TdxGridReportLink.GetReportRowByGridRecord(GridRecord: TcxCustomGridRecord): TdxReportCell; +var + I: Integer; +begin + if GridRecord <> nil then + for I := 0 to ReportRowCount - 1 do + begin + Result := ReportRows[I]; + if Result.Data = Integer(GridRecord) then Exit; + end; + Result := nil; +end; + +function TdxGridReportLink.GetReportRowCount: Integer; +begin + Result := FReportRows.Count; +end; + +function TdxGridReportLink.GetStyles: TdxGridReportLinkStyles; +begin + Result := inherited Styles as TdxGridReportLinkStyles; +end; + +procedure TdxGridReportLink.SetOnCustomDrawBandCell(Value: TdxGridReportLinkCustomDrawBandCellEvent); +begin + if @FOnCustomDrawBandCell <> @Value then + begin + FOnCustomDrawBandCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawCell(Value: TdxGridReportLinkCustomDrawCellEvent); +begin + if @FOnCustomDrawCell <> @Value then + begin + FOnCustomDrawCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawCardRowCaptionCell(Value: TdxGridReportLinkCustomDrawCardRowCaptionCellEvent); +begin + if @FOnCustomDrawCardRowCaptionCell <> @Value then + begin + FOnCustomDrawCardRowCaptionCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawCardRowDataCell(Value: TdxGridReportLinkCustomDrawCardRowDataCellEvent); +begin + if @FOnCustomDrawCardRowDataCell <> @Value then + begin + FOnCustomDrawCardRowDataCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawFilterBar(Value: TdxGridReportLinkCustomDrawFilterBarEvent); +begin + if @FOnCustomDrawFilterBar <> @Value then + begin + FOnCustomDrawFilterBar := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawFooterCell(Value: TdxGridReportLinkCustomDrawFooterCellEvent); +begin + if @FOnCustomDrawFooterCell <> @Value then + begin + FOnCustomDrawFooterCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawHeaderCell(Value: TdxGridReportLinkCustomDrawHeaderCellEvent); +begin + if @FOnCustomDrawHeaderCell <> @Value then + begin + FOnCustomDrawHeaderCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawLevelCaption(Value: TdxGridReportLinkCustomDrawLevelCaptionEvent); +begin + if @FOnCustomDrawLevelCaption <> @Value then + begin + FOnCustomDrawLevelCaption := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOptionsCards(Value: TdxGridReportLinkOptionsCards); +begin + OptionsCards.Assign(Value); +end; + +procedure TdxGridReportLink.SetOptionsDetails(Value: TdxGridReportLinkOptionsDetails); +begin + OptionsDetails.Assign(Value); +end; + +procedure TdxGridReportLink.SetOptionsExpanding(Value: TdxGridReportLinkOptionsExpanding); +begin + OptionsExpanding.Assign(Value); +end; + +procedure TdxGridReportLink.SetOptionsFormatting(Value: TdxGridReportLinkOptionsFormatting); +begin + inherited OptionsFormatting := Value; +end; + +procedure TdxGridReportLink.SetOptionsLevels(Value: TdxGridReportLinkOptionsLevels); +begin + OptionsLevels.Assign(Value); +end; + +procedure TdxGridReportLink.SetOptionsOnEveryPage(Value: TdxGridReportLinkOptionsOnEveryPage); +begin + inherited OptionsOnEveryPage := Value; +end; + +procedure TdxGridReportLink.SetOptionsPagination(Value: TdxGridReportLinkOptionsPagination); +begin + inherited OptionsPagination := Value; +end; + +procedure TdxGridReportLink.SetOptionsPreview(Value: TdxGridReportLinkOptionsPreview); +begin + inherited OptionsPreview := Value; +end; + +procedure TdxGridReportLink.SetOptionsRefinements(Value: TdxGridReportLinkOptionsRefinements); +begin + inherited OptionsRefinements := Value; +end; + +procedure TdxGridReportLink.SetOptionsSelection(Value: TdxGridReportLinkOptionsSelection); +begin + inherited OptionsSelection := Value; +end; + +procedure TdxGridReportLink.SetOptionsSize(Value: TdxGridReportLinkOptionsSize); +begin + inherited OptionsSize := Value; +end; + +procedure TdxGridReportLink.SetOptionsView(Value: TdxGridReportLinkOptionsView); +begin + inherited OptionsView := Value; +end; + +procedure TdxGridReportLink.SetStyles(Value: TdxGridReportLinkStyles); +begin + inherited Styles := Value; +end; + +{ TcxGridCardView2OptionsView } + +constructor TcxGridCardView2OptionsView.Create(AGridView: TcxCustomGridView); +begin + inherited; + FCardBorders := False; + FGridLineColor := clDefault; + FGridLines := glNone; + FShadowDepth := 4; +end; + +procedure TcxGridCardView2OptionsView.Assign(Source: TPersistent); +begin + if Source is TcxGridCardView2OptionsView then + with TcxGridCardView2OptionsView(Source) do + begin + Self.CardBorders := CardBorders; + Self.GridLineColor := GridLineColor; + Self.GridLines := GridLines; + Self.ShadowDepth := ShadowDepth; + end; + inherited; +end; + +function TcxGridCardView2OptionsView.GetShadowVisible: Boolean; +begin + Result := ShadowDepth <> 0; +end; + +procedure TcxGridCardView2OptionsView.SetCardBorders(Value: Boolean); +begin + if FCardBorders <> Value then + begin + FCardBorders := Value; + SizeChanged; + end; +end; + +procedure TcxGridCardView2OptionsView.SetGridLineColor(Value: TColor); +begin + if FGridLineColor <> Value then + begin + FGridLineColor := Value; + LayoutChanged; + end; +end; + +procedure TcxGridCardView2OptionsView.SetGridLines(Value: TcxGridLines); +begin + if FGridLines <> Value then + begin + FGridLines := Value; + SizeChanged; + end; +end; + +procedure TcxGridCardView2OptionsView.SetShadowDepth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FShadowDepth <> Value then + begin + FShadowDepth := Value; + SizeChanged; + end; +end; + +{ TcxGridCardView2Styles } + +procedure TcxGridCardView2Styles.Assign(Source: TPersistent); +begin + if Source is TcxGridCardView2Styles then + with TcxGridCardView2Styles(Source) do + begin + Self.CardShadow := CardShadow; + end; + inherited; +end; + +procedure TcxGridCardView2Styles.GetCardShadowParams(ARecord: TcxCustomGridRecord; + out AParams: TcxViewParams); +var + AStyle: TcxStyle; +begin + AStyle := nil; + if Assigned(FOnGetCardShadowStyle) then + FOnGetCardShadowStyle(GridView, ARecord, AStyle); + GetViewParams(vsCardShadow, ARecord, AStyle, AParams); +end; + +procedure TcxGridCardView2Styles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +begin + inherited; + if Index = vsCardShadow then AParams.Color := clWindowText; +end; + +type + TcxGridCardViewInfo2 = class; + TcxGridCardViewViewInfo2 = class; + + TcxGridCardRowCaptionViewInfo2 = class(TcxGridCardRowCaptionViewInfo) + private + function GetCardViewInfo: TcxGridCardViewInfo2; + protected + function GetBorderColor(AIndex: TcxBorder): TColor; override; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + public + property CardViewInfo: TcxGridCardViewInfo2 read GetCardViewInfo; + end; + + TcxGridCardRowDataViewInfo2 = class(TcxGridCardRowDataViewInfo) + private + function GetCardViewInfo: TcxGridCardViewInfo2; + protected + function GetBorderColor(AIndex: TcxBorder): TColor; override; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + public + property CardViewInfo: TcxGridCardViewInfo2 read GetCardViewInfo; + end; + + TcxGridCardDataRowViewInfo2 = class(TcxGridCardDataRowViewInfo) + protected + function GetCaptionViewInfoClass: TcxGridCardRowCaptionViewInfoClass; override; + function GetDataViewInfoClass: TcxGridCardRowDataViewInfoClass; override; + end; + + TcxGridCardCaptionRowViewInfo2 = class(TcxGridCardRowViewInfo) + protected + function GetCaptionViewInfoClass: TcxGridCardRowCaptionViewInfoClass; override; + function GetDataViewInfoClass: TcxGridCardRowDataViewInfoClass; override; + end; + + TcxGridCardPainter2 = class(TcxGridCardPainter) + private + function GetViewInfo: TcxGridCardViewInfo2; + protected + procedure DrawBottomShadowAndRestSpace; virtual; + procedure DrawRightShadowAndRestSpace; virtual; + procedure DrawShadows; virtual; + procedure Paint; override; + property ViewInfo: TcxGridCardViewInfo2 read GetViewInfo; + end; + + TcxGridCardViewInfo2 = class(TcxGridCardViewInfo) + private + function GetGridView: TcxGridCardView2; + protected + function CalculateHeight: Integer; override; + function GetContentWidth: Integer; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetRowViewInfoClass(ARow: TcxGridCardViewRow): TcxGridCardRowViewInfoClass; override; + + function GetBottomShadowRect: TRect; virtual; + function GetBottomShadowRestRect: TRect; virtual; + function GetCardRowCaptionBorders(ARowCaption: TcxGridCardRowCaptionViewInfo2): TcxBorders; virtual; + function GetCardRowDataBorders(ARowData: TcxGridCardRowDataViewInfo2): TcxBorders; virtual; + function GetGridLineColor: TColor; virtual; + function GetRightShadowRect: TRect; virtual; + function GetRightShadowRestRect: TRect; virtual; + function GetShadowColor: TColor; virtual; + function GetShadowDepth: Integer; virtual; + function GetShadowRestColor: TColor; virtual; + + property GridView: TcxGridCardView2 read GetGridView; + public + property BottomShadowRect: TRect read GetBottomShadowRect; + property BottomShadowRestRect: TRect read GetBottomShadowRestRect; + property GridLineColor: TColor read GetGridLineColor; + property RightShadowRect: TRect read GetRightShadowRect; + property RightShadowRestRect: TRect read GetRightShadowRestRect; + property ShadowColor: TColor read GetShadowColor; + property ShadowDepth: Integer read GetShadowDepth; + property ShadowRestColor: TColor read GetShadowRestColor; + end; + + TcxGridCard2 = class(TcxGridCard) + protected + function GetViewInfoClass: TcxCustomGridRecordViewInfoClass; override; + end; + + TcxGridCardViewViewData2 = class(TcxGridCardViewViewData) + protected + function GetRecordClass(ARecordInfo: TcxRowInfo): TcxCustomGridRecordClass; override; + end; + + TcxGridCardsHorizontalViewInfo2 = class(TcxGridCardsHorizontalViewInfo) + private + function GetGridView: TcxGridCardView2; + protected + function CalculateCardHeight: Integer; override; + function GetShadowDepth: Integer; virtual; + + property GridView: TcxGridCardView2 read GetGridView; + public + property ShadowDepth: Integer read GetShadowDepth; + end; + + TcxGridCardsVerticalViewInfo2 = class(TcxGridCardsVerticalViewInfo) + private + function GetGridView: TcxGridCardView2; + protected + function CalculateCardHeight: Integer; override; + function GetShadowDepth: Integer; virtual; + + property GridView: TcxGridCardView2 read GetGridView; + public + property ShadowDepth: Integer read GetShadowDepth; + end; + + TcxGridCardViewViewInfo2 = class(TcxGridCardViewViewInfo) + protected + function GetRecordsViewInfoClass: TcxCustomGridRecordsViewInfoClass; override; + end; + +{ TcxGridCardRowCaptionViewInfo2 } + +function TcxGridCardRowCaptionViewInfo2.GetBorderColor(AIndex: TcxBorder): TColor; +begin + Result := CardViewInfo.GridLineColor; +end; + +function TcxGridCardRowCaptionViewInfo2.GetBorders: TcxBorders; +begin + Result := CardViewInfo.GetCardRowCaptionBorders(Self); +end; + +function TcxGridCardRowCaptionViewInfo2.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := 1; +end; + +function TcxGridCardRowCaptionViewInfo2.GetCardViewInfo: TcxGridCardViewInfo2; +begin + Result := inherited CardViewInfo as TcxGridCardViewInfo2 +end; + +{ TcxGridCardRowDataViewInfo2 } + +function TcxGridCardRowDataViewInfo2.GetBorderColor(AIndex: TcxBorder): TColor; +begin + Result := CardViewInfo.GridLineColor; +end; + +function TcxGridCardRowDataViewInfo2.GetBorders: TcxBorders; +begin + Result := CardViewInfo.GetCardRowDataBorders(Self); +end; + +function TcxGridCardRowDataViewInfo2.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := 1; +end; + +function TcxGridCardRowDataViewInfo2.GetCardViewInfo: TcxGridCardViewInfo2; +begin + Result := inherited CardViewInfo as TcxGridCardViewInfo2 +end; + +{ TcxGridCardDataRowViewInfo2 } + +function TcxGridCardDataRowViewInfo2.GetCaptionViewInfoClass: TcxGridCardRowCaptionViewInfoClass; +begin + Result := TcxGridCardRowCaptionViewInfo2; +end; + +function TcxGridCardDataRowViewInfo2.GetDataViewInfoClass: TcxGridCardRowDataViewInfoClass; +begin + Result := TcxGridCardRowDataViewInfo2; +end; + +{ TcxGridCardCaptionRowViewInfo2 } + +function TcxGridCardCaptionRowViewInfo2.GetCaptionViewInfoClass: TcxGridCardRowCaptionViewInfoClass; +begin + Result := TcxGridCardRowCaptionViewInfo2; +end; + +function TcxGridCardCaptionRowViewInfo2.GetDataViewInfoClass: TcxGridCardRowDataViewInfoClass; +begin + Result := TcxGridCardRowDataViewInfo2; +end; + +{ TcxGridCardPainter2 } + +procedure TcxGridCardPainter2.DrawBottomShadowAndRestSpace; +var + R: TRect; +begin + R := ViewInfo.BottomShadowRect; + if Canvas.RectVisible(R) then + begin + Canvas.Brush.Color := ViewInfo.ShadowColor; + Canvas.FillRect(R); + end; + + R := ViewInfo.BottomShadowRestRect; + if Canvas.RectVisible(R) then + begin + Canvas.Brush.Color := ViewInfo.ShadowRestColor; + Canvas.FillRect(R); + end; +end; + +procedure TcxGridCardPainter2.DrawRightShadowAndRestSpace; +var + R: TRect; +begin + R := ViewInfo.RightShadowRect; + if Canvas.RectVisible(R) then + begin + Canvas.Brush.Color := ViewInfo.ShadowColor; + Canvas.FillRect(R); + end; + + R := ViewInfo.RightShadowRestRect; + if Canvas.RectVisible(R) then + begin + Canvas.Brush.Color := ViewInfo.ShadowRestColor; + Canvas.FillRect(R); + end; +end; + +procedure TcxGridCardPainter2.DrawShadows; +var + Color: TColor; +begin + Color := Canvas.Brush.Color; + DrawBottomShadowAndRestSpace; + DrawRightShadowAndRestSpace; + Canvas.Brush.Color := Color; +end; + +procedure TcxGridCardPainter2.Paint; +begin + DrawShadows; + inherited; +end; + +function TcxGridCardPainter2.GetViewInfo: TcxGridCardViewInfo2; +begin + Result := TcxGridCardViewInfo2(inherited ViewInfo); +end; + +{ TcxGridCardViewInfo2 } + +function TcxGridCardViewInfo2.CalculateHeight: Integer; +begin + Result := inherited CalculateHeight; + if RecordsViewInfo.AutoCardHeight or (RecordsViewInfo.CardHeight = -1) then + Inc(Result, ShadowDepth); +end; + +function TcxGridCardViewInfo2.GetContentWidth: Integer; +begin + Result := inherited GetContentWidth - ShadowDepth; +end; + +function TcxGridCardViewInfo2.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridCardPainter2; +end; + +function TcxGridCardViewInfo2.GetRowViewInfoClass(ARow: TcxGridCardViewRow): TcxGridCardRowViewInfoClass; +const + RowViewInfoClasses: array[TcxGridCardViewRowKind] of TcxGridCardRowViewInfoClass = + (TcxGridCardDataRowViewInfo2, TcxGridCardCaptionRowViewInfo2); +begin + Result := RowViewInfoClasses[ARow.Kind]; +end; + +function TcxGridCardViewInfo2.GetBottomShadowRect: TRect; +begin + Result := ContentBounds; + Inc(Result.Left, ShadowDepth); + Result.Top := Result.Bottom - ShadowDepth; +end; + +function TcxGridCardViewInfo2.GetBottomShadowRestRect: TRect; +begin + Result := ContentBounds; + Result.Right := Result.Left + ShadowDepth; + Result.Top := Result.Bottom - ShadowDepth; +end; + +function TcxGridCardViewInfo2.GetCardRowCaptionBorders(ARowCaption: TcxGridCardRowCaptionViewInfo2): TcxBorders; +begin + Result := [bLeft, bTop]; + if ARowCaption.Row.VisibleIndex = GridView.RowCount - 1 then + Include(Result, bBottom); + + with TcxGridCardView2OptionsView(GridView.OptionsView) do + begin + if not CardBorders then + begin + Exclude(Result, bLeft); + if ARowCaption.Row.VisibleIndex = 0 then + Exclude(Result, bTop); + if ARowCaption.Row.VisibleIndex = Self.GridView.RowCount - 1 then + Exclude(Result, bBottom); + end; + if not (GridLines in [glBoth, glHorizontal]) and (ARowCaption.Row.VisibleIndex > 0) then + Exclude(Result, bTop); + end; +end; + +function TcxGridCardViewInfo2.GetCardRowDataBorders(ARowData: TcxGridCardRowDataViewInfo2): TcxBorders; +begin + Result := [bLeft, bTop, bRight]; + if ARowData.Row.VisibleIndex = GridView.RowCount - 1 then + Include(Result, bBottom); + with TcxGridCardView2OptionsView(GridView.OptionsView) do + begin + if not CardBorders then + begin + Exclude(Result, bRight); + if ARowData.Row.VisibleIndex = 0 then + Exclude(Result, bTop); + if ARowData.Row.VisibleIndex = Self.GridView.RowCount - 1 then + Exclude(Result, bBottom); + end; + if not (GridLines in [glBoth, glHorizontal]) and (ARowData.Row.VisibleIndex > 0) then + Exclude(Result, bTop); + if not (GridLines in [glBoth, glVertical]) then + Exclude(Result, bLeft); + end; +end; + +function TcxGridCardViewInfo2.GetGridLineColor: TColor; +begin + Result := TcxGridCardView2OptionsView(GridView.OptionsView).GridLineColor; + if Result = clDefault then + Result := GridView.LookAndFeelPainter.DefaultGridLineColor; +end; + +function TcxGridCardViewInfo2.GetRightShadowRect: TRect; +begin + Result := ContentBounds; + Result.Left := Result.Right - ShadowDepth; + Inc(Result.Top, ShadowDepth); +end; + +function TcxGridCardViewInfo2.GetRightShadowRestRect: TRect; +begin + Result := ContentBounds; + Result.Left := Result.Right - ShadowDepth; + Result.Bottom := Result.Top + ShadowDepth; +end; + +function TcxGridCardViewInfo2.GetShadowColor: TColor; +var + Params: TcxViewParams; +begin + TcxGridCardView2Styles(GridView.Styles).GetCardShadowParams(GridRecord, Params); + Result := Params.Color; + if Result = clDefault then + Result := clWindowText; +end; + +function TcxGridCardViewInfo2.GetShadowDepth: Integer; +begin + Result := TcxGridCardView2OptionsView(GridView.OptionsView).ShadowDepth; +end; + +function TcxGridCardViewInfo2.GetShadowRestColor: TColor; +var + Params: TcxViewParams; +begin + TcxGridCardView2Styles(GridView.Styles).GetViewParams(vsBackground, nil, nil, Params); + Result := Params.Color; +end; + +function TcxGridCardViewInfo2.GetGridView: TcxGridCardView2; +begin + Result := TcxGridCardView2(inherited GridView); +end; + +{ TcxGridCard2 } + +function TcxGridCard2.GetViewInfoClass: TcxCustomGridRecordViewInfoClass; +begin + Result := TcxGridCardViewInfo2; +end; + +{ TcxGridCardViewViewData2 } + +function TcxGridCardViewViewData2.GetRecordClass(ARecordInfo: TcxRowInfo): TcxCustomGridRecordClass; +begin + Result := TcxGridCard2; +end; + +{ TcxGridCardsHorizontalViewInfo2 } + +function TcxGridCardsHorizontalViewInfo2.GetGridView: TcxGridCardView2; +begin + Result := TcxGridCardView2(inherited GridView); +end; + +function TcxGridCardsHorizontalViewInfo2.CalculateCardHeight: Integer; +begin + Result := inherited CalculateCardHeight + ShadowDepth; +end; + +function TcxGridCardsHorizontalViewInfo2.GetShadowDepth: Integer; +begin + Result := TcxGridCardView2OptionsView(GridView.OptionsView).ShadowDepth; +end; + +{ TcxGridCardsVerticalViewInfo2 } + +function TcxGridCardsVerticalViewInfo2.GetGridView: TcxGridCardView2; +begin + Result := TcxGridCardView2(inherited GridView); +end; + +function TcxGridCardsVerticalViewInfo2.CalculateCardHeight: Integer; +begin + Result := inherited CalculateCardHeight + ShadowDepth; +end; + +function TcxGridCardsVerticalViewInfo2.GetShadowDepth: Integer; +begin + Result := TcxGridCardView2OptionsView(GridView.OptionsView).ShadowDepth; +end; + +{ TcxGridCardViewViewInfo2 } + +function TcxGridCardViewViewInfo2.GetRecordsViewInfoClass: TcxCustomGridRecordsViewInfoClass; +const + ViewInfoClasses: array[TcxGridCardViewLayoutDirection] of TcxCustomGridRecordsViewInfoClass = + (TcxGridCardsHorizontalViewInfo2, TcxGridCardsVerticalViewInfo2); +begin + Result := ViewInfoClasses[GridView.LayoutDirection]; +end; + +{ TcxGridCardView2 } + +function TcxGridCardView2.GetOptionsViewClass: TcxCustomGridOptionsViewClass; +begin + Result := TcxGridCardView2OptionsView; +end; + +function TcxGridCardView2.GetStylesClass: TcxCustomGridViewStylesClass; +begin + Result := TcxGridCardView2Styles; +end; + +function TcxGridCardView2.GetViewDataClass: TcxCustomGridViewDataClass; +begin + Result := TcxGridCardViewViewData2; +end; + +function TcxGridCardView2.GetViewInfoClass: TcxCustomGridViewInfoClass; +begin + Result := TcxGridCardViewViewInfo2; +end; + +{ TdxfmGridReportLinkDesignWindow } + +constructor TdxfmGridReportLinkDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxhccxGridReportLinkDesigner; + inherited; + CreateControls; + SetActivePage; +end; + +destructor TdxfmGridReportLinkDesignWindow.Destroy; +begin + dxPSPopupMan.dxPSPopupMenuController.UnregisterControl(lbxStyles); + inherited; +end; + +procedure TdxfmGridReportLinkDesignWindow.DoInitialize; +begin + lbxStyles.ReportLinkStyles := ReportLink.ActiveStyles; + inherited; + RefreshStylesList; + + CreateCardView; + //CreateChartView; + //tshCharts.TabVisible := False; + + chbxExpandCards.Visible := False; + //chbxTransparentRichEdits.Visible := False; {.3} + //bvlRefinementsSeparator.Top := bvlRefinementsSeparator.Top - 20; + //chbxSuppressBackgroundBitmaps.Top := chbxSuppressBackgroundBitmaps.Top - 20; + //chbxConsumeSelectionStyle.Top := chbxConsumeSelectionStyle.Top - 20; + + if ReportLink.ProcessParams.HasOnlyCards then + PageControl1.ActivePage := tshCards; + + InitializePreviewGrid; + InitializePreviewGridStyles; + LoadDataIntoPreviewGridView(PreviewGrid.Levels[0].GridView as TcxCustomGridTableView); + + with ReportLink.OptionsView do + begin + chbxShowCaptions.Checked := Caption; + chbxShowBands.Checked := BandHeaders; + chbxShowExpandButtons.Checked := ExpandButtons; + chbxShowGroupFooters.Checked := GroupFooters; + chbxShowFilterBar.Checked := FilterBar; + chbxShowFooters.Checked := Footers; + chbxShowHeaders.Checked := Headers; + end; + + with ReportLink.OptionsOnEveryPage do + begin + chbxCaptionsOnEveryPage.Checked := Caption; + chbxBandsOnEveryPage.Checked := BandHeaders; + chbxFilterBarOnEveryPage.Checked := FilterBar; + chbxFootersOnEveryPage.Checked := Footers; + chbxHeadersOnEveryPage.Checked := Headers; + end; + + with cbxLookAndFeel do + begin + Items.Clear; + Items.AddObject(cxGetResourceString(@sdxLookAndFeelFlat), TObject(lfFlat)); + Items.AddObject(cxGetResourceString(@sdxLookAndFeelStandard), TObject(lfStandard)); + Items.AddObject(cxGetResourceString(@sdxLookAndFeelUltraFlat), TObject(lfUltraFlat)); + + ItemIndex := Items.IndexOfObject(TObject(ReportLink.OptionsFormatting.LookAndFeelKind)); + end; + + with ReportLink.OptionsSelection do + begin + chbxProcessSelection.Checked := ProcessSelection; + chbxProcessExactSelection.Checked := ProcessExactSelection; + end; + + with ReportLink.OptionsExpanding do + begin + chbxExpandGroupRows.Checked := ExpandGroupRows; + chbxExpandMasterRows.Checked := ExpandMasterRows; + end; + + with ReportLink.OptionsRefinements do + begin + chbxTransparentGraphics.Checked := TransparentGraphics; + chbxDisplayGraphicsAsText.Checked := DisplayGraphicsAsText; + chbxFlatCheckMarks.Checked := FlatCheckMarks; + end; + + with ReportLink.OptionsSize do + begin + chbxGridAutoWidth.Checked := AutoWidth; + end; + + with ReportLink.OptionsDetails do + begin + chbxStartFromActiveView.Checked := StartFromFocusedView; + chbxOnlyActiveView.Checked := OnlyFocusedView; + end; + + with ReportLink.OptionsLevels do + begin + chbxLevelsUnwrap.Checked := Unwrap; + chbxLevelsUnwrapTopLevel.Checked := UnwrapTopLevel; + chbxLevelsRiseActiveLevelOntoTop.Checked := RiseActiveLevelOntoTop; + end; + + with ReportLink.OptionsFormatting do + begin + chbxSuppressBackgroundBitmaps.Checked := SuppressBackgroundBitmaps; + chbxConsumeSelectionStyle.Checked := ConsumeSelectionStyle; + chbxUseNativeStyles.Checked := UseNativeStyles; + end; + + with ReportLink.OptionsPagination do + begin + chbxPaginateByTopLevelGroups.Checked := TopLevelGroup; + chbxPaginateOneGroupPerPage.Checked := OneGroupPerPage; + end; + + with ReportLink.OptionsPreview do + begin + chbxPreviewVisible.Checked := Visible; + chbxPreviewAutoHeight.Checked := AutoHeight; + sePreviewMaxLineCount.AsInteger := MaxLineCount; + end; + + with ReportLink.OptionsCards do + begin + chbxCardsAutoWidth.Checked := AutoWidth; + chbxCardsKeepSameWidth.Checked := KeepSameWidth; + chbxCardsKeepSameHeight.Checked := KeepSameHeight; + chbxCardsBorder.Checked := Borders; + chbxCardsHorzLines.Checked := RowBordersHorz; + chbxCardsVertLines.Checked := RowBordersVert; + seCardsSpaceHorz.AsInteger := InterCardsSpaceHorz; + seCardsSpaceVert.AsInteger := InterCardsSpaceVert; + with Shadow do + begin + seCardsShadowDepth.AsInteger := Depth; + ccbxCardsShadowColor.ColorValue := Color; + end; + end; +end; + +{$IFDEF DELPHI7} +function TdxfmGridReportLinkDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +procedure TdxfmGridReportLinkDesignWindow.LoadStrings; + + procedure AdjustBevelSize(ABevel: TBevel; AControl: TControl); + var + Right: Integer; + begin + Right := ABevel.BoundsRect.Right; + ABevel.Left := AControl.Left + AControl.Width + 10; + ABevel.Width := Right - ABevel.Left; + end; + +begin + inherited; + + lblPreviewWindow.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + tshView.Caption := cxGetResourceString(@sdxViewTab); + + lblShow.Caption := cxGetResourceString(@sdxShow); + AdjustBevelSize(bvlShow, lblShow); + chbxShowCaptions.Caption := cxGetResourceString(@sdxLevelCaption); + chbxShowBands.Caption := cxGetResourceString(@sdxBands); + chbxShowHeaders.Caption := cxGetResourceString(@sdxHeaders); + chbxShowFooters.Caption := cxGetResourceString(@sdxFooters); + chbxShowGroupFooters.Caption := cxGetResourceString(@sdxGroupFooters); + chbxShowExpandButtons.Caption := cxGetResourceString(@sdxExpandButtons); + chbxShowFilterBar.Caption := cxGetResourceString(@sdxFilterBar); + + lblOnEveryPage.Caption := cxGetResourceString(@sdxOnEveryPage); + AdjustBevelSize(bvlOnEveryPage, lblOnEveryPage); + chbxCaptionsOnEveryPage.Caption := DropAmpersand(cxGetResourceString(@sdxLevelCaption)); + chbxBandsOnEveryPage.Caption := DropAmpersand(cxGetResourceString(@sdxBands)); + chbxHeadersOnEveryPage.Caption := DropAmpersand(cxGetResourceString(@sdxHeaders)); + chbxFootersOnEveryPage.Caption := DropAmpersand(cxGetResourceString(@sdxFooters)); + chbxFilterBarOnEveryPage.Caption := DropAmpersand(cxGetResourceString(@sdxFilterBar)); + + tshBehaviors.Caption := cxGetResourceString(@sdxBehaviorsTab); + + lblSelection.Caption := cxGetResourceString(@sdxSelection); + AdjustBevelSize(bvlSelection, lblSelection); + chbxProcessSelection.Caption := cxGetResourceString(@sdxProcessSelection); + chbxProcessExactSelection.Caption := cxGetResourceString(@sdxProcessExactSelection); + + lblExpanding.Caption := cxGetResourceString(@sdxExpanding); + AdjustBevelSize(bvlExpanding, lblExpanding); + chbxExpandGroupRows.Caption := cxGetResourceString(@sdxGroups); + chbxExpandMasterRows.Caption := cxGetResourceString(@sdxDetails); + chbxExpandCards.Caption := cxGetResourceString(@sdxCardsRows); + + lblGridSize.Caption := cxGetResourceString(@sdxSize); + AdjustBevelSize(bvlGridSize, lblGridSize); + chbxGridAutoWidth.Caption := cxGetResourceString(@sdxAutoWidth); + + lblDetails.Caption := DropAmpersand(cxGetResourceString(@sdxDetails)); + AdjustBevelSize(bvlDetails, lblDetails); + chbxStartFromActiveView.Caption := cxGetResourceString(@sdxStartFromActiveDetails); + chbxOnlyActiveView.Caption := cxGetResourceString(@sdxOnlyActiveDetails); + + lblLevels.Caption := cxGetResourceString(@sdxLevels); + AdjustBevelSize(bvlLevels, lblLevels); + chbxLevelsUnwrap.Caption := cxGetResourceString(@sdxUnwrap); + chbxLevelsUnwrapTopLevel.Caption := cxGetResourceString(@sdxUnwrapTopLevel); + chbxLevelsRiseActiveLevelOntoTop.Caption := cxGetResourceString(@sdxRiseActiveToTop); + + tshFormatting.Caption := cxGetResourceString(@sdxFormatting); + lblLookAndFeel.Caption := cxGetResourceString(@sdxLookAndFeel); + AdjustBevelSize(bvlLookAndFeel, lblLookAndFeel); + + lblRefinements.Caption := cxGetResourceString(@sdxRefinements); + AdjustBevelSize(bvlRefinements, lblRefinements); + chbxTransparentGraphics.Caption := cxGetResourceString(@sdxTransparentGraphics); + chbxDisplayGraphicsAsText.Caption := DropAmpersand(cxGetResourceString(@sdxDisplayGraphicsAsText)); + chbxFlatCheckMarks.Caption := cxGetResourceString(@sdxFlatCheckMarks); + //chbxTransparentRichEdits.Caption := cxGetResourceString(@sdxTransparentRichEdits); {.3} + + chbxSuppressBackgroundBitmaps.Caption := cxGetResourceString(@sdxSuppressBackgroundBitmaps); + chbxConsumeSelectionStyle.Caption := cxGetResourceString(@sdxConsumeSelectionStyle); + + lblPagination.Caption := cxGetResourceString(@sdxPagination); + AdjustBevelSize(bvlPagination, lblPagination); + chbxPaginateByTopLevelGroups.Caption := cxGetResourceString(@sdxByTopLevelGroups); + chbxPaginateOneGroupPerPage.Caption := cxGetResourceString(@sdxOneGroupPerPage); + + tshStyles.Caption := cxGetResourceString(@sdxStyles); + lblUseNativeStyles.Caption := cxGetResourceString(@sdxUseNativeStyles); + AdjustBevelSize(bvlStyles, lblUseNativeStyles); + btnStyleColor.Caption := cxGetResourceString(@sdxBtnColor); + btnStyleFont.Caption := cxGetResourceString(@sdxBtnFont); + btnStyleBackgroundBitmap.Caption := cxGetResourceString(@sdxBtnTexture); + btnStyleBackgroundBitmapClear.Caption := cxGetResourceString(@sdxBtnTextureClear); + btnStyleRestoreDefaults.Caption := cxGetResourceString(@sdxBtnRestoreDefaults); + btnStylesSaveAs.Caption := cxGetResourceString(@sdxBtnSaveAs); + + miStyleColor.Caption := cxGetResourceString(@sdxBtnColor); + miStyleFont.Caption := cxGetResourceString(@sdxBtnFont); + miStyleBackgroundBitmap.Caption := cxGetResourceString(@sdxBtnTexture); + miStyleBackgroundBitmapClear.Caption := cxGetResourceString(@sdxBtnTextureClear); + miStyleRestoreDefaults.Caption := cxGetResourceString(@sdxBtnRestoreDefaults); + miStylesSelectAll.Caption := cxGetResourceString(@sdxSelectAll); + miStylesSaveAs.Caption := cxGetResourceString(@sdxBtnSaveAs); + + lblStyleSheets.Caption := cxGetResourceString(@sdxStyleSheets); + AdjustBevelSize(bvlStyleSheets, lblStyleSheets); + btnStyleSheetNew.Caption := cxGetResourceString(@sdxBtnNew); + btnStyleSheetCopy.Caption := cxGetResourceString(@sdxBtnCopy); + btnStyleSheetDelete.Caption := cxGetResourceString(@sdxBtnDelete); + btnStyleSheetRename.Caption := cxGetResourceString(@sdxBtnRename); + + tshPreview.Caption := cxGetResourceString(@sdxPreviewTab); + lblPreviewOptions.Caption := cxGetResourceString(@sdxOptions); + AdjustBevelSize(bvlPreviewOptions, lblPreviewOptions); + chbxPreviewVisible.Caption := cxGetResourceString(@sdxVisible); + chbxPreviewAutoHeight.Caption := cxGetResourceString(@sdxPreviewAutoHeight); + lblPreviewMaxLineCount.Caption := cxGetResourceString(@sdxPreviewMaxLineCount); + + tshCards.Caption := cxGetResourceString(@sdxCardsTab); + lblCardSizes.Caption := cxGetResourceString(@sdxSizes); + AdjustBevelSize(bvlCardSizes, lblCardSizes); + chbxCardsAutoWidth.Caption := cxGetResourceString(@sdxAutoWidth); + chbxCardsKeepSameWidth.Caption := cxGetResourceString(@sdxKeepSameWidth); + chbxCardsKeepSameHeight.Caption := cxGetResourceString(@sdxKeepSameHeight); + + lblCardSpacing.Caption := cxGetResourceString(@sdxSpacing); + AdjustBevelSize(bvlCardSpacing, lblCardSpacing); + lblCardSpaceHorz.Caption := cxGetResourceString(@sdxHorizontal); + lblCardSpaceVert.Caption := cxGetResourceString(@sdxVertical); + + lblCardFraming.Caption := cxGetResourceString(@sdxFraming); + AdjustBevelSize(bvlCardFraming, lblCardFraming); + chbxCardsBorder.Caption := cxGetResourceString(@sdxBorderLines); + chbxCardsHorzLines.Caption := cxGetResourceString(@sdxHorzLines); + chbxCardsVertLines.Caption := cxGetResourceString(@sdxVertLines); + + lblCardShadow.Caption := cxGetResourceString(@sdxShadow); + AdjustBevelSize(bvlCardShadow, lblCardShadow); + lblCardShadowColor.Caption := cxGetResourceString(@sdxColor); + lblCardShadowDepth.Caption := cxGetResourceString(@sdxDepth); +end; + +procedure TdxfmGridReportLinkDesignWindow.UpdateControlsState; +var + View: TcxCustomGridView; +begin + inherited; + + View := ReportLink.ActiveView; + if View <> nil then + with ReportLink.ProcessParams, dxViewHelpersFactory[View] do + begin + chbxShowBands.Enabled := IsAttributeSupported(TdxGridBandHeader); + chbxShowExpandButtons.Enabled := IsAttributeSupported(TdxGridExpandButton); + chbxShowFooters.Enabled := IsAttributeSupported(TdxGridFooter); + chbxShowGroupFooters.Enabled := IsAttributeSupported(TdxGridGroupFooter); + chbxShowHeaders.Enabled := IsAttributeSupported(TdxGridHeader); + + chbxCaptionsOnEveryPage.Enabled := IsAttributeSupported(TdxGridLevelCaption) and not ReportLink.IsAggregated; + chbxBandsOnEveryPage.Enabled := IsAttributeSupported(TdxGridBandHeader) and not ReportLink.IsAggregated; + chbxHeadersOnEveryPage.Enabled := IsAttributeSupported(TdxGridHeader) and not ReportLink.IsAggregated; + chbxFilterBarOnEveryPage.Enabled := IsAttributeSupported(TdxGridFilterBar) and not ReportLink.IsAggregated; + chbxFootersOnEveryPage.Enabled := IsAttributeSupported(TdxGridFooter) and not ReportLink.IsAggregated; + + chbxExpandGroupRows.Enabled := IsAttributeSupported(TdxGridGroupRow); + chbxExpandMasterRows.Enabled := IsAttributeSupported(TdxGridDetails); + + lblDetails.Visible := IsDesigning or HasMasterDetailsInTopView or HasUnwrapableData; + bvlDetails.Visible := IsDesigning or HasMasterDetailsInTopView or HasUnwrapableData; + imgDetails.Visible := IsDesigning or HasMasterDetailsInTopView or HasUnwrapableData; + chbxStartFromActiveView.Visible := IsDesigning or HasMasterDetailsInTopView or HasUnwrapableData; + chbxOnlyActiveView.Visible := IsDesigning or HasMasterDetailsInTopView or HasUnwrapableData; + chbxOnlyActiveView.Enabled := chbxStartFromActiveView.Checked; + + lblLevels.Visible := IsDesigning or HasUnwrapableData; + bvlLevels.Visible := IsDesigning or HasUnwrapableData; + imgLevels.Visible := IsDesigning or HasUnwrapableData; + chbxLevelsUnwrap.Visible := IsDesigning or HasUnwrapableData; + chbxLevelsUnwrapTopLevel.Visible := IsDesigning or HasUnwrapableData; + chbxLevelsRiseActiveLevelOntoTop.Visible := IsDesigning or HasUnwrapableData; + + chbxLevelsUnwrapTopLevel.Enabled := chbxLevelsUnwrap.Checked; + chbxLevelsRiseActiveLevelOntoTop.Enabled := chbxLevelsUnwrap.Checked; + + chbxPreviewVisible.Enabled := IsAttributeSupported(TdxGridPreview); + chbxPreviewAutoHeight.Enabled := IsAttributeSupported(TdxGridPreview); + sePreviewMaxLineCount.Enabled := IsAttributeSupported(TdxGridPreview); + + lblPagination.Visible := IsDesigning or IsAttributeSupported(TdxGridGroupRow); + bvlPagination.Visible := IsDesigning or IsAttributeSupported(TdxGridGroupRow); + imgPagination.Visible := IsDesigning or IsAttributeSupported(TdxGridGroupRow); + chbxPaginateByTopLevelGroups.Visible := IsDesigning or IsAttributeSupported(TdxGridGroupRow); + chbxPaginateOneGroupPerPage.Visible := IsDesigning or IsAttributeSupported(TdxGridGroupRow); + end; + + chbxProcessExactSelection.Enabled := chbxProcessSelection.Checked; + + chbxPaginateOneGroupPerPage.Enabled := chbxPaginateByTopLevelGroups.Checked; + + chbxCardsKeepSameWidth.Enabled := chbxCardsAutoWidth.Checked; + + lbxStyles.Enabled := AreNativeStylesAvailable; + btnStyleColor.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + btnStyleFont.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + btnStyleBackgroundBitmap.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + btnStyleBackgroundBitmapClear.Enabled := AreNativeStylesAvailable and HasSelectedStylesWithAssignedBitmap; + btnStyleRestoreDefaults.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + btnStylesSaveAs.Enabled := CanSaveStyles; + + lblStyleSheets.Enabled := AreNativeStylesAvailable; + cbxStyleSheets.Enabled := AreNativeStylesAvailable; + btnStyleSheetNew.Enabled := CanCreateStyleSheet; + btnStyleSheetCopy.Enabled := CanCopyStyleSheet; + btnStyleSheetDelete.Enabled := CanDeleteStyleSheet; + btnStyleSheetRename.Enabled := CanRenameStyleSheet; + + UpdateWarningPane; +end; + +procedure TdxfmGridReportLinkDesignWindow.UpdatePreview; +const + DetailTabsPositionMap: array[Boolean] of TcxGridDetailTabsPosition = (dtpNone, dtpTop); + GroupFootersMap: array[Boolean] of TcxGridGroupFootersMode = (gfInvisible, gfAlwaysVisible); + FilteringMap: array[Boolean] of TcxGridTableFilterVisible = + (fvNonEmpty, fvAlways); + TransparentsMap: array[Boolean] of TcxImageTransparency = (gtOpaque, gtTransparent); + + + procedure UpdateBandedView; + begin + TcxImageProperties(colVendorLogo.Properties).GraphicTransparency := + TransparentsMap[ReportLink.OptionsRefinements.TransparentGraphics]; + with PreviewBandedView do + begin + Filtering.Visible := FilteringMap[ReportLink.OptionsView.FilterBar]; + OptionsView.BandHeaders := ReportLink.OptionsView.BandHeaders; + OptionsView.Footer := ReportLink.OptionsView.Footers; + OptionsView.GroupFooters := GroupFootersMap[ReportLink.OptionsView.GroupFooters]; + OptionsView.Header := ReportLink.OptionsView.Headers; + Preview.Visible := ReportLink.OptionsPreview.Visible; + ViewChanged; + end; + end; + + procedure UpdateCardView; + begin + TcxImageProperties(rowVendorLogo.Properties).GraphicTransparency := + TransparentsMap[ReportLink.OptionsRefinements.TransparentGraphics]; + PreviewCardView.ViewChanged; + end; + +begin + PreviewGrid.Enabled := False; + + PreviewGrid.LookAndFeel.Kind := ReportLink.OptionsFormatting.LookAndFeelKind; + PreviewGrid.LookAndFeel.NativeStyle := False; + PreviewGrid.Font := ReportLink.Font; + PreviewGrid.RootLevelOptions.DetailTabsPosition := DetailTabsPositionMap[ReportLink.OptionsView.Caption]; + + UpdateBandedView; + UpdateCardView; +end; + +function TdxfmGridReportLinkDesignWindow.GetDesignerTabIndex: Integer; +begin + Result := PageControl1.ActivePage.TabIndex; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetDesignerTabIndex(Value: Integer); +begin + if Value < 0 then Value := 0; + if Value > PageControl1.PageCount - 1 then + Value := PageControl1.PageCount - 1; + PageControl1.ActivePage := PageControl1.Pages[Value]; +end; + +procedure TdxfmGridReportLinkDesignWindow.DoActiveStyleSheetChanged; +begin + lbxStyles.ReportLinkStyles := ReportLink.ActiveStyles; + inherited; + with cbxStyleSheets do + ItemIndex := Items.IndexOfObject(ActiveStyleSheet); + + if not LockControlsUpdate then + begin + Modified := True; + UpdatePreview; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.DoFormActivated(AnActive: Boolean); +begin + inherited; + if not AnActive then lbxStyles.HideToolTips; +end; + +procedure TdxfmGridReportLinkDesignWindow.DoRefreshStylesList; +var + Styles: TdxGridReportLinkStyles; + List: TList; +begin + Styles := ReportLink.ActiveStyles; + + with lbxStyles.Items do + begin + BeginUpdate; + try + List := TList.Create; + try + SaveSelectedStyles(List); + try + Clear; + AddObject(cxGetResourceString(@sdxBandHeaderStyle), Styles.BandHeader); + AddObject(cxGetResourceString(@sdxCaptionStyle), Styles.Caption); + AddObject(cxGetResourceString(@sdxCardCaptionRowStyle), Styles.CardCaptionRow); + AddObject(cxGetResourceString(@sdxCardRowCaptionStyle), Styles.CardRowCaption); + AddObject(cxGetResourceString(@sdxContentStyle), Styles.Content); + AddObject(cxGetResourceString(@sdxContentEvenStyle), Styles.ContentEven); + AddObject(cxGetResourceString(@sdxContentOddStyle), Styles.ContentOdd); + AddObject(cxGetResourceString(@sdxFilterBarStyle), Styles.FilterBar); + AddObject(cxGetResourceString(@sdxFooterStyle), Styles.Footer); + AddObject(cxGetResourceString(@sdxGroupStyle), Styles.Group); + AddObject(cxGetResourceString(@sdxHeaderStyle), Styles.Header); + AddObject(cxGetResourceString(@sdxPreviewStyle), Styles.Preview); + AddObject(cxGetResourceString(@sdxSelectionStyle), Styles.Selection); + finally + RestoreSelectedStyles(List); + end; + finally + List.Free; + end; + finally + EndUpdate; + end; + end; + InitializePreviewGridStyles; +end; + +procedure TdxfmGridReportLinkDesignWindow.DoStyleChanged(const ACaption: string; + AStyle: TcxStyle); +begin + inherited; + Modified := True; + UpdatePreviewGridStyles(ACaption, AStyle); +end; + +procedure TdxfmGridReportLinkDesignWindow.DoStylesChanged(AStrings: TStrings; + ARecreate: Boolean); +begin + if ARecreate then + RecreateStylesListBox + else + lbxStyles.Invalidate; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.GetSelectedStyleNames(AStrings: TStrings); +var + I: Integer; +begin + AStrings.Clear; + with lbxStyles do + for I := 0 to Items.Count - 1 do + if Selected[I] then + AStrings.AddObject(Items[I], Items.Objects[I]); +end; + +procedure TdxfmGridReportLinkDesignWindow.GetStyleNames(out AStrings: TStrings); +begin + AStrings := lbxStyles.Items; +end; + +procedure TdxfmGridReportLinkDesignWindow.GetStyleSheetNames(out AStrings: TStrings); +begin + AStrings := cbxStyleSheets.Items; +end; + +function TdxfmGridReportLinkDesignWindow.GetActiveStyle: TcxStyle; +begin + with lbxStyles do + if ItemIndex <> -1 then + Result := TcxStyle(Items.Objects[ItemIndex]) + else + Result := nil; +end; + +function TdxfmGridReportLinkDesignWindow.GetHasSelectedStyles: Boolean; +begin + Result := lbxStyles.SelCount <> 0; +end; + +function TdxfmGridReportLinkDesignWindow.GetHasSelectedStylesWithAssignedBitmap: Boolean; +var + Strings: TStrings; + I: Integer; + cxStyle: TcxStyle; +begin + Result := True; + Strings := TStringList.Create; + try + GetSelectedStyleNames(Strings); + for I := 0 to Strings.Count - 1 do + begin + cxStyle := TcxStyle(Strings.Objects[I]); + if (cxStyle <> nil) and (cxStyle.Bitmap <> nil) and not cxStyle.Bitmap.Empty then + Exit; + end; + finally + Strings.Free; + end; + Result := False; +end; + +function TdxfmGridReportLinkDesignWindow.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +procedure TdxfmGridReportLinkDesignWindow.CardShadowColorChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + if TdxPSColorCombo(Sender).IsAutoColorSelected then + ReportLink.OptionsCards.Shadow.Color := clDefault + else + ReportLink.OptionsCards.Shadow.Color := TdxPSColorCombo(Sender).ColorValue; + TcxGridCardView2Styles(PreviewCardView.Styles).CardShadow.Color := ReportLink.OptionsCards.Shadow.ActualColor; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.CardShadowDepthChanged(Sender: TObject); +var + NewDepth: Integer; +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsCards.Shadow.Depth := TdxPSSpinEdit(Sender).AsInteger; + + NewDepth := TdxPSSpinEdit(Sender).AsInteger; + if NewDepth > 4 then NewDepth := 4; + TcxGridCardView2OptionsView(PreviewCardView.OptionsView).ShadowDepth := NewDepth; + + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.CardSpaceHorzChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsCards.InterCardsSpaceHorz := TdxPSSpinEdit(Sender).AsInteger; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.CardSpaceVertChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsCards.InterCardsSpaceVert := TdxPSSpinEdit(Sender).AsInteger; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.PreviewMaxLineCountChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsPreview.MaxLineCount := TdxPSSpinEdit(Sender).AsInteger; + Modified := True; +end; + +function TdxfmGridReportLinkDesignWindow.CanSelectAllStyles: Boolean; +var + I: Integer; +begin + Result := AreNativeStylesAvailable; + if Result then + begin + for I := 0 to lbxStyles.Items.Count - 1 do + if not lbxStyles.Selected[I] then Exit; + Result := False; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.ChangeActiveView(AView: TcxCustomGridView); +var + OldGridView: TcxCustomGridView; +begin + with PreviewGrid.Levels[0] do + begin + OldGridView := GridView; + GridView := AView; + if OldGridView <> GridView then + LoadDataIntoPreviewGridView(GridView as TcxCustomGridTableView); + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.CreateCardView; + + function CreateRow(APropertiesClass: TcxCustomEditPropertiesClass = nil; + AOnCustomDraw: TcxGridTableDataCellCustomDrawEvent = nil): TcxGridCardViewRow; + begin + Result := PreviewCardView.CreateRow; + Result.PropertiesClass := APropertiesClass; + Result.OnCustomDrawCell := AOnCustomDraw; + end; + +begin + PreviewCardView := PreviewGrid.CreateView(TcxGridCardView2) as TcxGridCardView2; + with PreviewCardView do + begin + LayoutDirection := ldVertical; + TcxGridCardView2Styles(Styles).CardShadow := styleCardShadow; + with TcxGridCardView2OptionsView(OptionsView) do + begin + CardWidth := 135; + CardBorderWidth := 1; + CellAutoHeight := True; + GridLineColor := ReportLink.OptionsFormatting.GridLineColor; + SeparatorWidth := 0; + ScrollBars := ssNone; + ShadowDepth := ReportLink.OptionsCards.Shadow.Depth; + end; + end; + + rowVendorName := CreateRow; + rowVendorLogo := CreateRow(TcxImageProperties, VendorLogoCustomDrawCell); + rowVendorCountry := CreateRow; + rowCarModel := CreateRow; + rowIsSuvModel := CreateRow(TcxCheckBoxProperties, IsSUVModelCustomDrawCell); +end; + +procedure TdxfmGridReportLinkDesignWindow.CreateControls; + + function CreateSpin(AHost: TControl; ALabel: TLabel; ATabOrder: TTabOrder; + AMinValue, AMaxValue, AValue: Integer): TdxPSSpinEdit; + begin + Result := TdxPSSpinEdit.Create(Self); + with Result do + begin + Parent := AHost.Parent; + BoundsRect := AHost.BoundsRect; + TabOrder := ATabOrder; + + MinValue := AMinValue; + MaxValue := AMaxValue; + Value := AValue; + DefaultValue := AValue; + end; + ALabel.FocusControl := Result; + end; + + function CreateColorCombo(AParent: TWinControl; AHost: TControl; ALabel: TLabel; + ATabOrder: TTabOrder; ATag: Integer; AAutoColor: TColor): TdxPSColorCombo; + begin + Result := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(Result) do + begin + BoundsRect := AHost.BoundsRect; + Tag := MakeTTag(ATag); + Parent := AParent; + TabOrder := ATabOrder; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := AAutoColor; + end; + ALabel.FocusControl := Result; + AHost.Visible := False; + end; + + procedure CreateWarningPane; + begin + wpIncorrectOnEveryPageState := TdxPSWarningPane.Create(Self); + wpIncorrectOnEveryPageState.Parent := tshView; + wpIncorrectOnEveryPageState.BoundsRect := bvlWarningHost.BoundsRect; + wpIncorrectOnEveryPageState.Font.Name := 'Tahoma'; + wpIncorrectOnEveryPageState.Font.Size := 8; + + bvlWarningHost.Visible := False; + end; + + procedure CreateStylesListBox; + begin + lbxStyles := TdxStylesListBox.Create(Self); + lbxStyles.Parent := tshStyles; + lbxStyles.BoundsRect := bvlStylesHost.BoundsRect; + lbxStyles.PopupMenu := pmStyles; + lbxStyles.TabOrder := chbxUseNativeStyles.TabOrder + 1; + lbxStyles.OnClick := lbxStylesClick; + bvlStylesHost.Visible := False; + + dxPSPopupMan.dxPSPopupMenuController.RegisterControl(lbxStyles); + end; + +begin + sePreviewMaxLineCount := CreateSpin(bvlPreviewMaxLineCountHost, lblPreviewMaxLineCount, + chbxPreviewAutoHeight.TabOrder + 1, 0, 1000, 0); + sePreviewMaxLineCount.OnChange := PreviewMaxLineCountChanged; + + seCardsSpaceHorz := CreateSpin(bvlCardSpaceHorzHost, lblCardSpaceHorz, + chbxCardsKeepSameHeight.TabOrder + 1, 0, 20, dxDefaultInterCardsSpaceHorz); + seCardsSpaceHorz.OnChange := CardSpaceHorzChanged; + + seCardsSpaceVert := CreateSpin(bvlCardSpaceVertHost, lblCardSpaceVert, + seCardsSpaceHorz.TabOrder + 1, 0, 20, dxDefaultInterCardsSpaceVert); + seCardsSpaceVert.OnChange := CardSpaceVertChanged; + + ccbxCardsShadowColor := CreateColorCombo(tshCards, bvlCardShadowColorHost, lblCardShadowColor, + chbxCardsVertLines.TabOrder + 1, 0, dxDefaultCardsShadowColor); + ccbxCardsShadowColor.OnChange := CardShadowColorChanged; + + seCardsShadowDepth := CreateSpin(bvlCardShadowDepthHost, lblCardShadowDepth, + ccbxCardsShadowColor.TabOrder + 1, Low(TdxGridCardShadowDepth), High(TdxGridCardShadowDepth), + dxDefaultCardsShadowDepth); + seCardsShadowDepth.OnChange := CardShadowDepthChanged; + + CreateStylesListBox; + CreateWarningPane; +end; + +procedure TdxfmGridReportLinkDesignWindow.CustomDrawBorders(ACanvas: TcxCanvas; + AViewInfo: TcxCustomGridCellViewInfo); +var + PainterClass: TcxCustomGridCellPainterClass; + Painter: TcxCustomGridCellPainter; +begin + PainterClass := CustomGridCellViewInfo_GetPainterClass(AViewInfo); + Painter := PainterClass.Create(ACanvas, AViewInfo); + try + CustomGridCellPainter_DrawBorders(Painter); + finally + Painter.Free; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.CustomDrawFooter(ACanvas: TcxCanvas; + R: TRect; AViewInfo: TcxCustomGridCellViewInfo); +begin + case ReportLink.OptionsFormatting.LookAndFeelKind of + lfStandard, + lfFlat: + ACanvas.DrawComplexFrame(R, AViewInfo.Params.TextColor, clBtnHighlight); + lfUltraFlat: + ACanvas.FrameRect(R, AViewInfo.Params.TextColor); + end; + + InflateRect(R, -1, -1); + CustomDrawTextRect(ACanvas, R, AViewInfo, AViewInfo.BackgroundBitmap); +end; + +procedure TdxfmGridReportLinkDesignWindow.CustomDrawHeader(ACanvas: TcxCanvas; + R: TRect; AViewInfo: TcxCustomGridCellViewInfo); +const + BottomRightColors: array[Boolean] of TColor = (clBtnFace, clBtnShadow); +begin + ACanvas.FrameRect(R, clWindowText); + + if ReportLink.OptionsFormatting.LookAndFeelKind <> lfUltraFlat then + begin + InflateRect(R, -1, -1); + ACanvas.DrawComplexFrame(R, clBtnHighlight, BottomRightColors[ReportLink.OptionsFormatting.LookAndFeelKind = lfStandard]); + end; + + InflateRect(R, -1, -1); + CustomDrawTextRect(ACanvas, R, AViewInfo, AViewInfo.BackgroundBitmap); +end; + +procedure TdxfmGridReportLinkDesignWindow.CustomDrawTextRect(ACanvas: TcxCanvas; + R: TRect; AViewInfo: TcxCustomGridCellViewInfo; ABackgroundBitmap: TBitmap); +const + AlignmentHorzMap: array[TAlignment] of Integer = (cxAlignLeft, cxAlignRight, cxAlignCenter); + AlignmentVertMap: array[TcxAlignmentVert] of Integer = (cxAlignTop, cxAlignBottom, cxAlignVCenter); +begin + with AViewInfo do + begin + if ABackgroundBitmap = nil then + begin + ACanvas.Brush.Color := Params.Color; + ACanvas.FillRect(R); + end + else + dxBkgnd.DrawPicture(ABackgroundBitmap, ACanvas.Canvas, R, ppmTile, 1, 1, - R.Left - 0, - R.Top - 0); + + InflateRect(R, -2, -1); + if ReportLink.OptionsFormatting.LookAndFeelKind = lfUltraFlat then + InflateRect(R, -1, -1); + if Params.Font <> nil then + ACanvas.Font := Params.Font; + ACanvas.Font.Color := Params.TextColor; + ACanvas.Brush.Style := bsClear; + ACanvas.DrawText(Text, R, AlignmentHorzMap[AlignmentHorz] or AlignmentVertMap[AlignmentVert] or cxSingleLine); + ACanvas.Brush.Style := bsSolid; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.InitializePreviewGrid; + + procedure SetupDataBindings(AView: TcxCustomGridTableView); + + function GetColumnCaption(Index: Integer): string; + begin + case Index of + 0: Result := cxGetResourceString(@sdxManufacturerNameColumnCaption); + 1: Result := cxGetResourceString(@sdxManufacturerLogoColumnCaption); + 2: Result := cxGetResourceString(@sdxManufacturerCountryColumnCaption); + 3: Result := cxGetResourceString(@sdxCarModelColumnCaption); + else + Result := cxGetResourceString(@sdxCarIsSUVColumnCaption); + end; + end; + + const + ColumnTypes: array[0..4] of TcxValueTypeClass = + (TcxStringValueType, TcxStringValueType, TcxStringValueType, + TcxStringValueType, TcxBooleanValueType); + var + I: Integer; + begin + for I := 0 to AView.ItemCount - 1 do + with AView.Items[I] do + begin + DataBinding.ValueTypeClass := ColumnTypes[I]; + Caption := GetColumnCaption(I); + end; + end; + +begin + if PageControl1.ActivePage = tshCards then + PreviewGrid.Levels[0].GridView := PreviewCardView + else + PreviewGrid.Levels[0].GridView := PreviewBandedView; + + SetupDataBindings(PreviewBandedView); + PreviewGridLevel.Caption := cxGetResourceString(@sdxCarLevelCaption); + + PreviewBandedView.Bands[0].Caption := cxGetResourceString(@sdxManufacturerBandCaption); + PreviewBandedView.Bands[1].Caption := cxGetResourceString(@sdxModelBandCaption); + PreviewBandedView.DataController.Summary.FooterSummaryItems[0].Format := cxGetResourceString(@sdxSummaryFormat); + + SetupDataBindings(PreviewCardView); +// PreviewCardView.Rows[3].Visible := False; +end; + +procedure TdxfmGridReportLinkDesignWindow.InitializePreviewGridStyles; + + procedure ResetEvents(AStyles: TcxGridBandedTableViewStyles); overload; + begin + with AStyles do + begin + OnGetBandHeaderStyle := nil; + OnGetContentStyle := nil; + OnGetFooterStyle := nil; + OnGetGroupStyle := nil; + OnGetHeaderStyle := nil; + OnGetPreviewStyle := nil; + end; + end; + + procedure ResetEvents(AStyles: TcxGridCardViewStyles); overload; + begin + with AStyles do + begin + OnGetCaptionRowStyle := nil; + OnGetCardBorderStyle := nil; + OnGetContentStyle := nil; + OnGetRowCaptionStyle := nil; + end; + end; + +var + Styles: TdxGridReportLinkStyles; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + begin + Styles := ReportLink.ActiveStyles; + + PreviewGrid.RootLevelStyles.Tab := Styles.Caption; + PreviewGrid.RootLevelStyles.TabsBackground := Styles.Caption; + + if PreviewBandedView <> nil then + begin + dxPScxCommon.dxPSResetStyles(PreviewBandedView.Styles); + with PreviewBandedView.Styles do + begin + BandHeader := Styles.BandHeader; + Content := Styles.Content; + ContentEven := Styles.ContentEven; + ContentOdd := Styles.ContentOdd; + FilterBox := Styles.FilterBar; + Footer := Styles.Footer; + Group := Styles.Group; + Header := Styles.Header; + Preview := Styles.Preview; + end; + end; + + if PreviewCardView <> nil then + begin + dxPScxCommon.dxPSResetStyles(PreviewCardView.Styles); + with PreviewCardView.Styles do + begin + CaptionRow := Styles.CardCaptionRow; + CardBorder := StyleCardBorder; + Content := Styles.Content; + ContentEven := Styles.ContentEven; + ContentOdd := Styles.ContentOdd; + RowCaption := Styles.CardRowCaption; + end; + end; + + end + else + begin + if ReportLink.Grid <> nil then + begin + PreviewGrid.RootLevelStyles.Tab := ReportLink.Grid.RootLevelStyles.Tab; + PreviewGrid.RootLevelStyles.TabsBackground := ReportLink.Grid.RootLevelStyles.TabsBackground; + end + else + dxPScxCommon.dxPSResetStyles(PreviewGrid.RootLevelStyles); + + if PreviewBandedView <> nil then + if ReportLink.ActiveView is TcxGridBandedTableView then + PreviewBandedView.Styles := TcxGridBandedTableView(ReportLink.ActiveView).Styles + else + dxPScxCommon.dxPSResetStyles(PreviewBandedView.Styles); + + if PreviewCardView <> nil then + if ReportLink.ActiveView is TcxGridCardView then + PreviewCardView.Styles := TcxGridCardView(ReportLink.ActiveView).Styles + else + dxPScxCommon.dxPSResetStyles(PreviewCardView.Styles); + end; + + PreviewGrid.RootLevelStyles.OnGetTabStyle := nil; + if PreviewBandedView <> nil then + begin + ResetEvents(PreviewBandedView.Styles); + PreviewBandedView.SizeChanged; + end; + if PreviewCardView <> nil then + begin + ResetEvents(PreviewCardView.Styles); + PreviewCardView.SizeChanged; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.LoadDataIntoPreviewGridView(AView: TcxCustomGridTableView); + + procedure AddRecord(ARecordIndex: Integer; const AValues: array of string); + var + I: Integer; + begin + with AView.DataController do + for I := 0 to ItemCount - 1 do + Values[ARecordIndex, I] := AValues[I]; + end; + + function CarVendorName(Index: Integer): string; + begin + case Index of + 0: Result := cxGetResourceString(@sdxCarManufacturerName1); + 1: Result := cxGetResourceString(@sdxCarManufacturerName2); + 2: Result := cxGetResourceString(@sdxCarManufacturerName3); + else + Result := cxGetResourceString(@sdxCarManufacturerName4); + end; + end; + + function CarVendorCountry(Index: Integer): string; + begin + case Index of + 0: Result := cxGetResourceString(@sdxCarManufacturerCountry1); + 1: Result := cxGetResourceString(@sdxCarManufacturerCountry2); + 2: Result := cxGetResourceString(@sdxCarManufacturerCountry3); + else + Result := cxGetResourceString(@sdxCarManufacturerCountry4); + end; + end; + + function CarModel(Index: Integer): string; + begin + case Index of + 0: Result := cxGetResourceString(@sdxCarModel1); + 1: Result := cxGetResourceString(@sdxCarModel2); + 2: Result := cxGetResourceString(@sdxCarModel3); + else + Result := cxGetResourceString(@sdxCarModel4); + end; + end; + +const + RecordCount = 4; + //CarSalesCount: array[0..RecordCount - 1] of Integer = (10, 6, 3, 5); + IsCarSUV: array[0..RecordCount - 1] of string = ('True', 'True', 'False', 'True'); +var + I: Integer; +begin + AView.DataController.RecordCount := RecordCount; + for I := 0 to RecordCount - 1 do + AddRecord(I, [CarVendorName(I), dxPScxCommon.dxPSPreviewCarLogosAsString(I), + CarVendorCountry(I), CarModel(I), IsCarSUV[I]]);//, CarSalesCount[I]]); +end; + +procedure TdxfmGridReportLinkDesignWindow.RecreateStylesListBox; +var + List: TList; +begin + List := TList.Create; + try + SaveSelectedStyles(List); + dxPSUtl.dxRecreateWnd(lbxStyles); + RestoreSelectedStyles(List); + finally + List.Free; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.RestoreSelectedStyles(AList: TList); +var + I: Integer; +begin + for I := 0 to AList.Count - 1 do + lbxStyles.Selected[Integer(AList[I])] := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SaveSelectedStyles(AList: TList); +var + I: Integer; +begin + AList.Clear; + for I := 0 to lbxStyles.Items.Count - 1 do + if lbxStyles.Selected[I] then AList.Add(TObject(I)); +end; + +procedure TdxfmGridReportLinkDesignWindow.SetActivePage; +begin + PageControl1.ActivePage := PageControl1.Pages[DesignerTabIndex]; +end; + +procedure TdxfmGridReportLinkDesignWindow.UpdatePreviewGridStyles(const ACaption: string; + AStyle: TcxStyle); +begin + with PreviewGrid.RootLevelStyles do + if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxCaptionStyle)) then + begin + Tab := AStyle; + TabsBackground := AStyle; + end; + + with PreviewBandedView.Styles do + begin + if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxBandHeaderStyle)) then + BandHeader := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentStyle)) then + Content := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentEvenStyle)) then + ContentEven := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentOddStyle)) then + ContentOdd := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxFooterStyle)) then + Footer := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxGroupStyle)) then + Group := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxHeaderStyle)) then + Header := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxPreviewStyle)) then + Preview := AStyle; + end; + + with PreviewCardView.Styles do + begin + if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxCardCaptionRowStyle)) then + CaptionRow := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxCardRowCaptionStyle)) then + RowCaption := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentStyle)) then + Content := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentEvenStyle)) then + ContentEven := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentOddStyle)) then + ContentOdd := AStyle + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.UpdateWarningPane; +begin + with ReportLink.HostInfoServices do + wpIncorrectOnEveryPageState.SetStateAndHint(IsInconsistentState, InconsistentStateText); +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsCardsByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsCards do + case Index of + 0: AutoWidth := Value; + 1: KeepSameWidth := Value; + 2: KeepSameHeight := Value; + 3: Borders := Value; + 4: RowBordersHorz := Value; + 5: RowBordersVert := Value; + end; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsDetailsByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsDetails do + case Index of + 0: StartFromFocusedView := Value; + 1: OnlyFocusedView := Value; + end; + ReportLink.CalculateProcessParams; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsExpandingByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsExpanding do + case Index of + 0: ExpandGroupRows := Value; + 1: ExpandMasterRows := Value; + end; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsFormattingByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsFormatting do + case Index of + 0: + begin + UseNativeStyles := Value; + InitializePreviewGridStyles; + RecreateStylesListBox; + end; + 1: SuppressBackgroundBitmaps := Value; + 2: ConsumeSelectionStyle := Value; + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsLevelsByIndex(Index: Integer; Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsLevels do + case Index of + 0: Unwrap := Value; + 1: UnwrapTopLevel := Value; + 2: RiseActiveLevelOntoTop := Value; + end; + ReportLink.CalculateProcessParams; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsOnEveryPageByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsOnEveryPage do + case Index of + 0: Caption := Value; + 1: BandHeaders := Value; + 2: Headers := Value; + 3: Footers := Value; + 4: FilterBar := Value; + end; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsPaginationByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsPagination do + case Index of + 0: TopLevelGroup := Value; + 1: OneGroupPerPage := Value; + end; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsRefinementsByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsRefinements do + case Index of + 0: TransparentGraphics := Value; + 1: DisplayGraphicsAsText := Value; + 2: FlatCheckMarks := Value; + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsSelectionByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsSelection do + case Index of + 0: ProcessSelection := Value; + 1: ProcessExactSelection := Value; + end; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsSizeByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsSize do + case Index of + 0: AutoWidth := Value; + end; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsViewByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsView do + case Index of + 0: Caption := Value; + 1: BandHeaders := Value; + 2: Headers := Value; + 3: Footers := Value; + 4: GroupFooters := Value; + 5: ExpandButtons := Value; + 6: FilterBar := Value; + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsViewClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsViewByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsOnEveryPageClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsOnEveryPageByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsSelectionClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsSelectionByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsExpandingClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsExpandingByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsRefinementClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsRefinementsByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsFormatingClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsFormattingByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.lblUseNativeStylesClick(Sender: TObject); +begin + if chbxUseNativeStyles.CanFocus then ActiveControl := chbxUseNativeStyles; + chbxUseNativeStyles.Checked := not chbxUseNativeStyles.Checked; +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsPaginationClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsPaginationByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsSizeClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsSizeByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsDetailsClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsDetailsByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsLevelsClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsLevelsByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.LookAndFeelClick(Sender: TObject); +begin + with TComboBox(Sender) do + ReportLink.OptionsFormatting.LookAndFeelKind := TcxLookAndFeelKind(Items.Objects[ItemIndex]); + Modified := True; + UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.PageControl1Change(Sender: TObject); +begin + lblPreviewWindow.Parent := TPageControl(Sender).ActivePage; + if not ReportLink.ProcessParams.HasOnlyCards then + if PageControl1.ActivePage = tshCards then + ChangeActiveView(PreviewCardView) + else + if PageControl1.ActivePage = tshStyles then + if ReportLink.IsCardViewStyle(ActiveStyle) then + ChangeActiveView(PreviewCardView) + else + ChangeActiveView(PreviewBandedView) + else + ChangeActiveView(PreviewBandedView); +end; + +procedure TdxfmGridReportLinkDesignWindow.PreviewVisibleClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsPreview.Visible := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.PreviewAutoHeightClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsPreview.AutoHeight := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsCardsClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsCardsByIndex(TTagToInt(Tag), Checked); + with TcxGridCardView2OptionsView(PreviewCardView.OptionsView), ReportLink.OptionsCards do + begin + CardBorders := Borders; + GridLines := dxPScxCommon.dxPSMakecxGridLines(RowBordersHorz, RowBordersVert); + end; + //UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.pmStylesPopup(Sender: TObject); +begin + lbxStyles.HideToolTips; + miStyleColor.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + miStyleFont.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + miStyleBackgroundBitmap.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + miStyleBackgroundBitmapClear.Enabled := AreNativeStylesAvailable and HasSelectedStylesWithAssignedBitmap; + miStyleRestoreDefaults.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + miStylesSelectAll.Enabled := CanSelectAllStyles; + miStylesSaveAs.Enabled := CanSaveStyles; +end; + +procedure TdxfmGridReportLinkDesignWindow.lbxStylesClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + if not ReportLink.ProcessParams.HasOnlyCards then + if ReportLink.IsCardViewStyle(ActiveStyle) then + ChangeActiveView(PreviewCardView) + else + ChangeActiveView(PreviewBandedView); + UpdateControlsState; +end; + +procedure TdxfmGridReportLinkDesignWindow.IsSUVModelCustomDrawCell( + Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); + + procedure DrawBackground(const R: TRect); + + function GetParams: TcxViewParams; + begin + if AViewInfo is TcxGridCardRowDataViewInfo then + PreviewCardView.Styles.GetContentParams(AViewInfo.GridRecord, AViewInfo.Item, Result) + else + PreviewBandedView.Styles.GetContentParams(AViewInfo.GridRecord, AViewInfo.Item, Result); + end; + + var + BackgroundBitmap: TBitmap; + PrevColor: TColor; + begin + BackgroundBitmap := CustomGridView_GetBackgroundBitmaps(AViewInfo.GridRecord.GridView).GetBitmap(bbContent); + if BackgroundBitmap = nil then + begin + PrevColor := ACanvas.Brush.Color; + ACanvas.Brush.Color := GetParams.Color; + ACanvas.FillRect(R); + ACanvas.Brush.Color := PrevColor; + end + else + dxBkgnd.DrawPicture(BackgroundBitmap, ACanvas.Canvas, R, ppmTile, 1, 1, -R.Left, -R.Top); + end; + + procedure DrawCheck(R: TRect); + const + Painters: array[Boolean] of TcxCustomLookAndFeelPainterClass = + (TcxStandardLookAndFeelPainter, TcxUltraFlatLookAndFeelPainter); + CheckStateMap: array[Boolean] of TcxCheckBoxState = (cbsChecked, cbsUnchecked); + var + X, Y: Integer; + CheckState: Variant; + begin + with R do + begin + X := Left + (Right - Left - dxPSGlbl.CheckWidth) div 2; + Y := Top + (Bottom - Top - dxPSGlbl.CheckHeight) div 2; + end; + R := MakeBounds(X, Y, dxPSGlbl.CheckWidth, dxPSGlbl.CheckHeight); + + CheckState := CheckStateMap[AViewInfo.RecordViewInfo.GridRecord.RecordIndex = 2]; + with Painters[ReportLink.OptionsRefinements.FlatCheckMarks] do + DrawCheckButton(ACanvas, R, cxbsDefault, CheckState = cbsChecked); + end; + +var + R: TRect; +begin + if (Sender is TcxGridTableView) or (AViewInfo is TcxGridCardRowDataViewInfo) then + begin + R := AViewInfo.Bounds; + DrawBackground(R); + DrawCheck(R); + + CustomDrawBorders(ACanvas, AViewInfo); + ADone := True; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.VendorLogoCustomDrawCell( + Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); +var + PrevText: string; +begin + if ReportLink.OptionsRefinements.DisplayGraphicsAsText and + ((Sender is TcxGridTableView) or (AViewInfo is TcxGridCardRowDataViewInfo)) then + begin + PrevText := AViewInfo.Text; + AViewInfo.Text := ReportLink.OptionsRefinements.GraphicsText; + AViewInfo.AlignmentVert := vaTop; + //AViewInfo.Transparent := True; + CustomDrawTextRect(ACanvas, AViewInfo.Bounds, AViewInfo, AViewInfo.RecordViewInfo.BackgroundBitmap); + AViewInfo.Text := PrevText; + CustomDrawBorders(ACanvas, AViewInfo); + ADone := True; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.PreviewBandedViewCustomDrawColumnHeader( + Sender: TcxGridTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean); +var + R: TRect; +begin + R := AViewInfo.Bounds; + Dec(R.Left); + if not ((PreviewGrid.LookAndFeel.Kind = lfUltraFlat) and + not TcxGridBandedTableOptionsView(Sender.OptionsView).BandHeaders) then + Dec(R.Top); + CustomDrawHeader(ACanvas, R, AViewInfo); + + ADone := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.PreviewBandedViewCustomDrawBandHeader( + Sender: TcxGridBandedTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridBandHeaderViewInfo; var ADone: Boolean); +var + R: TRect; +begin + R := AViewInfo.Bounds; + Dec(R.Left); + CustomDrawHeader(ACanvas, R, AViewInfo); + + ADone := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.PreviewBandedViewCustomDrawFooterCell( + Sender: TcxGridTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean); +begin + CustomDrawFooter(ACanvas, AViewInfo.Bounds, AViewInfo); + ADone := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleColorClick(Sender: TObject); +begin + PerformStylesChangeColor; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleFontClick(Sender: TObject); +begin + PerformStylesChangeFont; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleBackgroundBitmapClick(Sender: TObject); +begin + PerformStylesChangeBitmap; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleBackgroundBitmapClearClick(Sender: TObject); +begin + PerformStylesClearBitmap; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleRestoreDefaultsClick(Sender: TObject); +begin + PerformStylesRestoreDefaults; +end; + +procedure TdxfmGridReportLinkDesignWindow.miStylesSelectAllClick(Sender: TObject); +{$IFNDEF DELPHI6} +var + I: Integer; +{$ENDIF} +begin + with lbxStyles do + begin + {$IFDEF DELPHI6} + SelectAll; + {$ELSE} + Items.BeginUpdate; + try + for I := 0 to Items.Count - 1 do + Selected[I] := True; + finally + Items.EndUpdate; + end; + {$ENDIF} + end; + UpdateControlsState; +end; + +procedure TdxfmGridReportLinkDesignWindow.cbxStyleSheetsClick(Sender: TObject); +begin + with TComboBox(Sender) do + ActiveStyleSheet := TcxCustomStyleSheet(Items.Objects[ItemIndex]); +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleSheetNewClick(Sender: TObject); +begin + PerformStyleSheetNew; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleSheetCopyClick(Sender: TObject); +begin + PerformStyleSheetCopy; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleSheetDeleteClick(Sender: TObject); +begin + PerformStyleSheetDelete; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleSheetRenameClick(Sender: TObject); +begin + PerformStyleSheetRename; +end; + +procedure TdxfmGridReportLinkDesignWindow.StylesSaveAsClick(Sender: TObject); +begin + PerformStylesSaveAsStyleSheet; +end; + +procedure TdxfmGridReportLinkDesignWindow.cbxStyleSheetsKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + PerformStyleSheetKeyDown(Sender, Key, Shift); +end; + +procedure TdxfmGridReportLinkDesignWindow.cbxStyleSheetsDrawItem( + Control: TWinControl; Index: Integer; Rect: TRect; + State: TOwnerDrawState); +begin + PerformStyleSheetDrawItem(TComboBox(Control).Canvas, Index, Rect, State, Control.Enabled); +end; + +procedure RegisterAssistants; +begin + TdxCustomGridViewBuilder.Register; + TdxCustomGridTableViewBuilder.Register; + TdxGridTableViewBuilder.Register; + TdxGridDBTableViewBuilder.Register; + TdxGridBandedTableViewBuilder.Register; + TdxGridDBBandedTableViewBuilder.Register; + TdxGridCardViewBuilder.Register; + TdxGridDBCardViewBuilder.Register; + + TdxCustomGridViewHelper.Register; + TdxCustomGridTableViewHelper.Register; + TdxGridCardViewHelper.Register; + TdxGridTableViewHelper.Register; + TdxGridBandedTableViewHelper.Register; + + TdxCustomGridRecordHelper.Register; + TdxCustomGridRowHelper.Register; + TdxGridDataRowHelper.Register; + TdxGridGroupRowHelper.Register; + TdxGridMasterDataRowHelper.Register; + + TdxGridReportLinkStyleSheet.Register; +end; + +procedure RegisterItems; +begin + TdxReportCard.Register; + TdxReportCardRow.Register; +end; + +procedure UnregisterAssistants; +begin + TdxGridReportLinkStyleSheet.Unregister; + + TdxGridViewBuildersFactory.ReleaseInstance; + TdxViewHelpersFactory.ReleaseInstance; + TdxRecordHelpersFactory.ReleaseInstance; +end; + +procedure UnregisterItems; +begin + TdxReportCardRow.Unregister; + TdxReportCard.Unregister; +end; + +initialization + RegisterAssistants; + RegisterItems; + + dxPSRegisterReportLink(TdxGridReportLink, TcxGrid, TdxfmGridReportLinkDesignWindow); + +finalization + dxPSUnregisterReportLink(TdxGridReportLink, TcxGrid, TdxfmGridReportLinkDesignWindow); + + UnregisterItems; + UnregisterAssistants; + + FreeAndNil(FGridLinkStyleSheetPrototype); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxGrid4LnkPredefinedStyleSheets.dfm b/official/x.35/ExpressPrinting System/Sources/dxPScxGrid4LnkPredefinedStyleSheets.dfm new file mode 100644 index 00000000..83221cdb --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxGrid4LnkPredefinedStyleSheets.dfm @@ -0,0 +1,351 @@ +object dxdmPScxGridLnkPredefinedStyles: TdxdmPScxGridLnkPredefinedStyles + OldCreateOrder = False + Left = 352 + Top = 156 + Height = 150 + Width = 215 + object StyleRepository: TcxStyleRepository + Left = 37 + Top = 12 + object styleProfessionalFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3355443 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = 13033414 + end + object styleProfessionalGroup: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4214088 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 13033414 + end + object styleProfessionalRowCaption: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6582120 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object styleProfessionalCaptionRow: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = 13033414 + end + object styleProfessionalContentOdd: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleProfessionalContentEven: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4214088 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 13033414 + end + object styleProfessionalPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14541789 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleProfessionalSelection: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object styleGreenFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9358956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleGreenFooter: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9358956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenLightContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12778719 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenLightPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14154698 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenSelected: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4949549 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenGroup: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11328403 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleNoneContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleNoneFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentBandHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentFooter: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentGroup: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsItalic] + TextColor = clBlack + end + object styleTransparentLevelCaption: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentFilterBar: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentCaptionRow: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentRowCaption: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContentEven: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContentOdd: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentSelection: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13816275 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object ssProfessional: TdxGridReportLinkStyleSheet + Caption = 'Professional' + Styles.BandHeader = styleProfessionalFixed + Styles.Caption = styleProfessionalFixed + Styles.CardCaptionRow = styleProfessionalCaptionRow + Styles.CardRowCaption = styleProfessionalRowCaption + Styles.Content = styleNoneContent + Styles.ContentEven = styleProfessionalContentEven + Styles.ContentOdd = styleProfessionalContentOdd + Styles.FilterBar = styleProfessionalFixed + Styles.Footer = styleProfessionalFixed + Styles.Group = styleProfessionalGroup + Styles.Header = styleProfessionalFixed + Styles.Preview = styleProfessionalPreview + Styles.Selection = styleProfessionalSelection + BuiltIn = True + end + object ssGreen: TdxGridReportLinkStyleSheet + Caption = 'Green' + Styles.BandHeader = styleGreenFixed + Styles.Caption = styleGreenFixed + Styles.CardCaptionRow = styleGreenFixed + Styles.CardRowCaption = styleGreenFixed + Styles.Content = styleNoneContent + Styles.ContentEven = styleGreenLightContent + Styles.ContentOdd = styleNoneContent + Styles.FilterBar = styleGreenFixed + Styles.Footer = styleGreenFixed + Styles.Group = styleGreenGroup + Styles.Header = styleGreenFixed + Styles.Preview = styleGreenLightPreview + Styles.Selection = styleGreenSelected + BuiltIn = True + end + object ssTransparent: TdxGridReportLinkStyleSheet + Caption = 'Transparent' + Styles.BandHeader = styleTransparentBandHeader + Styles.Caption = styleTransparentLevelCaption + Styles.CardCaptionRow = styleTransparentCaptionRow + Styles.CardRowCaption = styleTransparentRowCaption + Styles.Content = styleTransparentContent + Styles.ContentEven = styleTransparentContentEven + Styles.ContentOdd = styleTransparentContentOdd + Styles.FilterBar = styleTransparentFilterBar + Styles.Footer = styleTransparentFooter + Styles.Group = styleTransparentGroup + Styles.Header = styleTransparentHeader + Styles.Preview = styleTransparentPreview + Styles.Selection = styleTransparentSelection + BuiltIn = True + end + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxGrid4LnkPredefinedStyleSheets.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxGrid4LnkPredefinedStyleSheets.pas new file mode 100644 index 00000000..9f573b2d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxGrid4LnkPredefinedStyleSheets.pas @@ -0,0 +1,143 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxGrid4LnkPredefinedStyleSheets; + +interface + +{$I cxVer.inc} + +uses + Classes, {$IFNDEF DELPHI6} Forms, {$ENDIF} cxClasses, cxStyles, dxPScxGrid4Lnk, + dxPScxCommon; + +type + TdxdmPScxGridLnkPredefinedStyles = class(TDataModule) + StyleRepository: TcxStyleRepository; + styleGreenFixed: TcxStyle; + styleGreenLightContent: TcxStyle; + styleProfessionalFixed: TcxStyle; + styleGreenLightPreview: TcxStyle; + ssGreen: TdxGridReportLinkStyleSheet; + ssProfessional: TdxGridReportLinkStyleSheet; + styleGreenFooter: TcxStyle; + styleNoneContent: TcxStyle; + styleNoneFixed: TcxStyle; + styleProfessionalGroup: TcxStyle; + styleProfessionalContentOdd: TcxStyle; + styleProfessionalContentEven: TcxStyle; + styleProfessionalSelection: TcxStyle; + styleProfessionalPreview: TcxStyle; + styleGreenSelected: TcxStyle; + styleGreenGroup: TcxStyle; + styleProfessionalRowCaption: TcxStyle; + styleProfessionalCaptionRow: TcxStyle; + ssTransparent: TdxGridReportLinkStyleSheet; + styleTransparentContent: TcxStyle; + styleTransparentBandHeader: TcxStyle; + styleTransparentHeader: TcxStyle; + styleTransparentFooter: TcxStyle; + styleTransparentGroup: TcxStyle; + styleTransparentPreview: TcxStyle; + styleTransparentLevelCaption: TcxStyle; + styleTransparentFilterBar: TcxStyle; + styleTransparentCaptionRow: TcxStyle; + styleTransparentRowCaption: TcxStyle; + styleTransparentContentEven: TcxStyle; + styleTransparentContentOdd: TcxStyle; + styleTransparentSelection: TcxStyle; + end; + +implementation + +{$R *.dfm} + +uses + cxStyleSheetsLoad; + +type + TdxPScxGridLnkPredefinedStyleSheets = class(TcxPredefinedStyleSheets) + private + FDataModule: TdxdmPScxGridLnkPredefinedStyles; + protected + procedure AddStyleSheets; override; + property DataModule: TdxdmPScxGridLnkPredefinedStyles read FDataModule; + public + constructor Create; override; + destructor Destroy; override; + + class procedure Register; + class procedure Unregister; + end; + +constructor TdxPScxGridLnkPredefinedStyleSheets.Create; +begin + inherited; + FDataModule := TdxdmPScxGridLnkPredefinedStyles.Create(nil); + AddStyleSheets; +end; + +destructor TdxPScxGridLnkPredefinedStyleSheets.Destroy; +begin + FDataModule.Free; + inherited; +end; + +class procedure TdxPScxGridLnkPredefinedStyleSheets.Register; +begin + cxStyleSheetsLoad.RegisterPredefinedStyleSheets(Self); +end; + +class procedure TdxPScxGridLnkPredefinedStyleSheets.Unregister; +begin + cxStyleSheetsLoad.UnregisterPredefinedStyleSheets(Self); +end; + +procedure TdxPScxGridLnkPredefinedStyleSheets.AddStyleSheets; +var + I: Integer; +begin + with DataModule.StyleRepository do + for I := 0 to StyleSheetCount - 1 do + AddStyleSheet(StyleSheets[I]); +end; + +initialization + TdxPScxGridLnkPredefinedStyleSheets.Register; + +finalization + TdxPScxGridLnkPredefinedStyleSheets.Unregister; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxGrid4LnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxGrid4LnkReg.pas new file mode 100644 index 00000000..654f1e39 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxGrid4LnkReg.pas @@ -0,0 +1,376 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxGrid4LnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignEditors, + {$ELSE} + DsgnIntf, + {$ENDIF} + SysUtils, Classes, Controls, cxCustomData, cxDataStorage, cxStyles, cxGrid, + cxGridLevel, cxGridCustomView, cxGridCustomTableView, cxGridCardView, + cxGridTableView, cxGridBandedTableView, cxStyleSheetEditor, dxPScxGrid4Lnk; + +type + TdxGridReportLinkStyleSheetEditorPreview = class(TcxStyleSheetEditorPreview) + private + FGrid: TcxGrid; + function GetBandedTableView: TcxGridBandedTableView; + function GetCardView: TcxGridCardView; + protected + function AddItem(AView: TcxCustomGridTableView; const ACaption: string; + AValueTypeClass: TcxValueTypeClass): TcxCustomGridTableItem; + procedure AddItems(AView: TcxCustomGridTableView); + procedure CreateBandedTableView; + procedure CreateCardView; + procedure Initialize; virtual; + + property BandedTableView: TcxGridBandedTableView read GetBandedTableView; + property CardView: TcxGridCardView read GetCardView; + property Grid: TcxGrid read FGrid; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + class function GetStyleSheetClass: TcxCustomStyleSheetClass; override; + procedure SetStyleSheet(AStyleSheet: TcxCustomStyleSheet); override; + + function Control: TWinControl; override; + + class procedure Register; + class procedure Unregister; + end; + +{ TdxGridReportLinkStyleSheetEditorPreview } + +constructor TdxGridReportLinkStyleSheetEditorPreview.Create(AOwner: TComponent); +begin +// inherited; cannot call ancestor method if it's an abstract method in Delphi4(5) !!!! + FGrid := TcxGrid.Create(AOwner); + Initialize; +end; + +destructor TdxGridReportLinkStyleSheetEditorPreview.Destroy; +begin + FGrid.Free; + inherited; +end; + +class function TdxGridReportLinkStyleSheetEditorPreview.GetStyleSheetClass: TcxCustomStyleSheetClass; +begin + Result := TdxGridReportLinkStyleSheet; +end; + +procedure TdxGridReportLinkStyleSheetEditorPreview.SetStyleSheet(AStyleSheet: TcxCustomStyleSheet); +begin + if AStyleSheet is TdxGridReportLinkStyleSheet then + with TdxGridReportLinkStyleSheet(AStyleSheet).Styles do + begin + BandedTableView.Styles.BandHeader := BandHeader; + BandedTableView.Styles.Content := Content; + BandedTableView.Styles.ContentEven := ContentEven; + BandedTableView.Styles.ContentOdd := ContentOdd; + BandedTableView.Styles.FilterBox := FilterBar; + BandedTableView.Styles.Footer := Footer; + BandedTableView.Styles.Group := Group; + BandedTableView.Styles.Header := Header; + BandedTableView.Styles.Indicator := Header; + BandedTableView.Styles.Preview := Preview; + + CardView.Styles.CaptionRow := CardCaptionRow; + CardView.Styles.Content := Content; + CardView.Styles.ContentEven := ContentEven; + CardView.Styles.ContentOdd := ContentOdd; + CardView.Styles.RowCaption := CardRowCaption; + + Grid.RootLevelStyles.Tab := Caption; + Grid.RootLevelStyles.TabsBackground := Caption; + end + else + begin + BandedTableView.Styles.ResetStyles; + CardView.Styles.ResetStyles; + Grid.RootLevelStyles.ResetStyles; + end; +end; + +function TdxGridReportLinkStyleSheetEditorPreview.Control: TWinControl; +begin + Result := Grid; +end; + +class procedure TdxGridReportLinkStyleSheetEditorPreview.Register; +begin + cxStyleSheetEditor.RegisterStyleSheetEditorPreview(Self); +end; + +class procedure TdxGridReportLinkStyleSheetEditorPreview.Unregister; +begin + cxStyleSheetEditor.UnregisterStyleSheetEditorPreview(Self); +end; + +function TdxGridReportLinkStyleSheetEditorPreview.AddItem(AView: TcxCustomGridTableView; + const ACaption: string; AValueTypeClass: TcxValueTypeClass): TcxCustomGridTableItem; +begin + Result := AView.CreateItem; + with Result do + begin + Caption := ACaption; + DataBinding.ValueTypeClass := AValueTypeClass; + end; +end; + +procedure TdxGridReportLinkStyleSheetEditorPreview.AddItems(AView: TcxCustomGridTableView); +begin + AddItem(AView, 'Text', TcxStringValueType); + AddItem(AView, 'Currency', TcxCurrencyValueType); + AddItem(AView, 'Date', TcxDateTimeValueType); +end; + +procedure TdxGridReportLinkStyleSheetEditorPreview.CreateBandedTableView; + + procedure AddBands; + begin + BandedTableView.Bands.Add.Caption := 'Band'; + end; + + procedure AddGroups; + begin + BandedTableView.Columns[2].GroupIndex := 0; + end; + + procedure AddPreview; + begin + with BandedTableView.Preview do + begin + Column := AddItem(BandedTableView, '', TcxStringValueType) as TcxGridColumn; + Column.Visible := False; + Visible := True; + end; + end; + + procedure AddRecords; + const + ARecordCount: Integer = 3; + var + I: Integer; + begin + with BandedTableView.DataController as TcxGridDataController do + begin + BeginUpdate; + try + RecordCount := ARecordCount; + for I := 0 to ARecordCount - 1 do + begin + Values[I, 0] := 'ABC'; + Values[I, 1] := (I + 1) * 100; + Values[I, 2] := Date - I; + Values[I, 3] := 'Check the preview style'; + end; + finally + EndUpdate; + end; + end; + end; + + procedure AddSummaries; + begin + with BandedTableView do + begin + DataController.Groups.FullExpand; + with DataController.Summary.FooterSummaryItems.Add do + begin + Kind := skSum; + ItemLink := Columns[1]; + end; + end; + end; + + procedure InitializeOptions; + begin + with BandedTableView do + begin + Filtering.CustomizeDialog := False; + + OptionsBehavior.IncSearch := True; + + OptionsData.Deleting := False; + OptionsData.Editing := False; + OptionsData.Appending := False; + OptionsData.Inserting := False; + + OptionsView.BandHeaders := True; + OptionsView.ColumnAutoWidth := True; + OptionsView.Footer := True; + OptionsView.Indicator := True; + end; + end; + + procedure PlaceColumns; + var + I: Integer; + begin + with BandedTableView do + for I := 0 to ItemCount - 1 do + Columns[I].Position.BandIndex := 0; + end; + +begin + Grid.Levels.Add.GridView := Grid.CreateView(TcxGridBandedTableView); + TcxGridLevel(BandedTableView.Level).Caption := 'Table'; + + AddBands; + AddItems(BandedTableView); + AddGroups; + AddPreview; + AddRecords; + AddSummaries; + InitializeOptions; + PlaceColumns; +end; + +procedure TdxGridReportLinkStyleSheetEditorPreview.CreateCardView; + + procedure AddRecords; + const + ARecordCount: Integer = 3; + var + I: Integer; + begin + with CardView.DataController as TcxGridDataController do + begin + BeginUpdate; + try + RecordCount := ARecordCount; + for I := 0 to ARecordCount - 1 do + begin + Values[I, 1] := 'ABC'; + Values[I, 2] := (I + 1) * 100; + Values[I, 3] := Date - I; + end; + finally + EndUpdate; + end; + end; + end; + + procedure AddCaptionRow; + begin + with CardView.CreateRow do + begin + Caption := 'Caption'; + Index := 0; + Kind := rkCaption; + end; + end; + + procedure InitializeOptions; + begin + with CardView do + begin + OptionsBehavior.IncSearch := True; + + OptionsData.Deleting := False; + OptionsData.Editing := False; + OptionsData.Appending := False; + OptionsData.Inserting := False; + end; + end; + +begin + Grid.Levels.Add.GridView := Grid.CreateView(TcxGridCardView); + TcxGridLevel(CardView.Level).Caption := 'Cards'; + + AddItems(CardView); + AddCaptionRow; + AddRecords; + InitializeOptions; +end; + +procedure TdxGridReportLinkStyleSheetEditorPreview.Initialize; +begin + CreateBandedTableView; + CreateCardView; + + Grid.RootLevelOptions.DetailTabsPosition := dtpTop; +end; + +function TdxGridReportLinkStyleSheetEditorPreview.GetBandedTableView: TcxGridBandedTableView; +begin + Result := Grid.Levels[0].GridView as TcxGridBandedTableView; +end; + +function TdxGridReportLinkStyleSheetEditorPreview.GetCardView: TcxGridCardView; +begin + Result := Grid.Levels[1].GridView as TcxGridCardView; +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterNoIcon([TdxGridReportLink, TdxGridReportLinkStyleSheet]); +end; + +procedure RegisterStyleSheetAssistants; +begin + cxStyles.RegisterStyleSheetClass(TdxGridReportLinkStyleSheet); + TdxGridReportLinkStyleSheetEditorPreview.Register; +end; + +procedure UnregisterStyleSheetAssistants; +begin + TdxGridReportLinkStyleSheetEditorPreview.Unregister; + cxStyles.UnregisterStyleSheetClass(TdxGridReportLinkStyleSheet); +end; + +initialization + RegisterStyleSheetAssistants; + +finalization + UnregisterStyleSheetAssistants; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxGrid6Lnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPScxGrid6Lnk.dfm new file mode 100644 index 00000000..dd4718c3 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxGrid6Lnk.dfm @@ -0,0 +1,1965 @@ +object dxfmGridReportLinkDesignWindow: TdxfmGridReportLinkDesignWindow + Left = 438 + Top = 133 + BorderStyle = bsDialog + Caption = 'fmdxGridDesignWindow' + ClientHeight = 450 + ClientWidth = 648 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 5 + Top = 5 + Width = 639 + Height = 405 + ActivePage = tshBehaviors + TabOrder = 0 + OnChange = PageControl1Change + object tshView: TTabSheet + Caption = 'View' + object lblShow: TLabel + Left = 5 + Top = 8 + Width = 26 + Height = 13 + Caption = 'Show' + end + object imgShow: TImage + Left = 9 + Top = 37 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlShow: TBevel + Left = 43 + Top = 12 + Width = 266 + Height = 4 + Shape = bsBottomLine + end + object lblOnEveryPage: TLabel + Left = 5 + Top = 164 + Width = 72 + Height = 13 + Caption = 'On Every Page' + end + object imgOnEveryPage: TImage + Left = 9 + Top = 189 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888777777777777777708888888888 + 888887FFFFFFFFFFFFFFF08888888888888887F7777777777777F07777708888 + 888887F7777777777777F0FFFFF08888888887F7777777777777F07777F07777 + 708887FFFFFFFFFFFFFFF07777F0FFFFF08887F777777777777FF07777F07777 + F08887FFFFFFFFFFFFFFF0FFFFF07777F08887F77777777777FFF077FFF07777 + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777777FFFFF0777FF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777FFFFFFFF07FFFF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF0777FF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF077FFF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777777F077FFF077FF + F08887F7777777777777F0FFFFF0FFFFF08887F7777777777777F0FFFFF07FFF + F08887FFFFFFFFFFFFFFF07777F0FFFFF0888000000000000000007777F077FF + F08888888887F7777777777777F0FFFFF08888888887FFFFFFFFFFFFFFF07777 + F0888888888000000000000000007777F08888888888888887F7777777777777 + F08888888888888887FFFFFFFFFFFFFFF0888888888888888000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlOnEveryPage: TBevel + Left = 90 + Top = 168 + Width = 221 + Height = 4 + Shape = bsBottomLine + end + object bvlWarningHost: TBevel + Left = 4 + Top = 289 + Width = 313 + Height = 76 + Visible = False + end + object chbxShowBands: TCheckBox + Tag = 1 + Left = 90 + Top = 42 + Width = 200 + Height = 17 + Caption = 'Ba&nds' + TabOrder = 1 + OnClick = OptionsViewClick + end + object chbxShowHeaders: TCheckBox + Tag = 2 + Left = 90 + Top = 63 + Width = 200 + Height = 17 + Caption = '&Headers' + TabOrder = 2 + OnClick = OptionsViewClick + end + object chbxShowFooters: TCheckBox + Tag = 3 + Left = 90 + Top = 84 + Width = 200 + Height = 17 + Caption = 'Foo&ters' + TabOrder = 3 + OnClick = OptionsViewClick + end + object chbxShowGroupFooters: TCheckBox + Tag = 4 + Left = 90 + Top = 104 + Width = 200 + Height = 17 + Caption = 'G&roup Footers' + TabOrder = 4 + OnClick = OptionsViewClick + end + object chbxShowExpandButtons: TCheckBox + Tag = 5 + Left = 90 + Top = 125 + Width = 200 + Height = 17 + Caption = 'Expand Buttons' + TabOrder = 5 + OnClick = OptionsViewClick + end + object chbxBandsOnEveryPage: TCheckBox + Tag = 1 + Left = 90 + Top = 202 + Width = 200 + Height = 17 + Caption = 'Ba&nds' + TabOrder = 8 + OnClick = OptionsOnEveryPageClick + end + object chbxHeadersOnEveryPage: TCheckBox + Tag = 2 + Left = 90 + Top = 223 + Width = 200 + Height = 17 + Caption = 'Headers' + TabOrder = 9 + OnClick = OptionsOnEveryPageClick + end + object chbxFootersOnEveryPage: TCheckBox + Tag = 3 + Left = 90 + Top = 245 + Width = 200 + Height = 17 + Caption = 'Footers' + TabOrder = 10 + OnClick = OptionsOnEveryPageClick + end + object chbxFilterBarOnEveryPage: TCheckBox + Tag = 4 + Left = 90 + Top = 266 + Width = 200 + Height = 17 + Caption = 'FilterBar' + TabOrder = 11 + OnClick = OptionsOnEveryPageClick + end + object chbxCaptionsOnEveryPage: TCheckBox + Left = 90 + Top = 181 + Width = 200 + Height = 17 + Caption = 'Captions' + TabOrder = 7 + OnClick = OptionsOnEveryPageClick + end + object chbxShowCaptions: TCheckBox + Left = 90 + Top = 22 + Width = 200 + Height = 17 + Caption = 'Captions' + TabOrder = 0 + OnClick = OptionsViewClick + end + object chbxShowFilterBar: TCheckBox + Tag = 6 + Left = 90 + Top = 146 + Width = 200 + Height = 17 + Caption = 'FilterBar' + TabOrder = 6 + OnClick = OptionsViewClick + end + object lblPreviewWindow: TStaticText + Left = 323 + Top = 1 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 12 + end + end + object tshBehaviors: TTabSheet + Caption = 'Behaviors' + ImageIndex = 1 + object lblSelection: TLabel + Left = 5 + Top = 8 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object imgSelection: TImage + Left = 9 + Top = 28 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlSelection: TBevel + Left = 56 + Top = 12 + Width = 255 + Height = 4 + Shape = bsBottomLine + end + object lblExpanding: TLabel + Left = 5 + Top = 67 + Width = 50 + Height = 13 + Caption = 'Expanding' + end + object imgExpanding: TImage + Left = 9 + Top = 88 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 7778800000000000000000000000078888888888880000000000000000000000 + 007880FFF7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7FF777777FFF77777FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F8F7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7F7F8888FF7F88888FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F8F7777777777777777777078888888888880F7F7F888FFF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F0788077777777777777777777770788C8888C88880F7FF888888FFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880F0F7777777FFFFFFFFFFFF0788CCCCCCCC880F77777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7F7F8888FF7F88888FF7 + F0788077777777777777777777770788C8888C88880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F7F7F8888FF7F888888F7 + F0788077777777777777777777770788CCCC8CC8880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCCCCCC880F7FF88888FFFFFFFFFFF7 + F07880F0F777777FFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F77777777777777777777 + F078800000000000000000000000078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F888888880F88888888888078888888888880F77777777777777777777 + F07880F800008880F80000000008078888888888880F77777777777777777777 + F07880FFFFFFFFF0FFFFFFFFFFFF078888888888880FFFFFFFFFFFFFFFFFFFFF + F078800000000000000000000000088888888888880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlExpanding: TBevel + Left = 62 + Top = 72 + Width = 248 + Height = 4 + Shape = bsBottomLine + end + object lblDetails: TLabel + Left = 5 + Top = 204 + Width = 32 + Height = 13 + Caption = 'Details' + end + object bvlDetails: TBevel + Left = 47 + Top = 209 + Width = 265 + Height = 4 + Shape = bsBottomLine + end + object imgDetails: TImage + Left = 9 + Top = 225 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0889999999999999999999907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897F78FF7FF77777788F907DDDDDDDDDDDD0FF777FFFF7FFF7777FFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDDDDDDDDDDD0FF777777F7FF77777777F + F07DD0889777777777777777777907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCDDDDCDDDD0777777777777777777777 + 707DD08897F777F7FF7777888FF907DDCCCCDCCDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCCCCCCCCDD0FF7777FFF7FF7777777FF + F07DD0889777777777777777777907DDCCCCDCCDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCDDDDCDDDD0777777777777777777777 + 707DD08897F788F7FF77778FFFF907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDDDDDDDDDDD0FF777777F7FF777777777 + F07DD0889777777777777777777907DDCDDDDCDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCCCCDCCDDD0777777777777777777777 + 707DD08897F888F7FF7777788FF907DDCCCCCCCCDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCCCCDCCDDD0FF77777FF7FF7777777FF + F07DD0889000000000000000000907DDCDDDDCDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897888880F8888888888907DDDDDDDDDDDD0777777777777777777777 + 707DD08897F77780F8777777778907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFF80FFFFFFFFFFF907DDDDDDDDDDDD0FF7777FFF7FF7777777FF + F07DD0889000000000000000000907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD0889999999999999999999907DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFFFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD0F0F777777FF77777777FFF07DDDDDDDDDDDD0FF77777FF7FF77777777F + F07DD0FFFFFFFFFFFFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F888888880F8888888888807DDDDDDDDDDDD0F888888880F8888888888 + 807DD0F877778880F8777777777807DDDDDDDDDDDD0F877777880F8777777778 + 807DD0FFFFFFFFF0FFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFF0FFFFFFFFFFF + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgLevels: TImage + Left = 9 + Top = 288 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDD77777777777777777777 + 7777D0000000000000000000000007DDDDDDDDDDDDD000000000000000000000 + 0007D0888888888888888888888807DDDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFF + FF07D0F000FF8F000FF8FCCCC44F07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7F77F8F77F7F8FCC99F + 7F07D0888888888888888888888807DDDDDDDDDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0FFFFFF8FFFFFF8F666CCCF07DDDDDDDDDDDDD0F7F77F8F777FF8FCC99F + 7F07D0F0000F8F00F0F8F999999F07DDCDDDDCDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDCCCCDCCDDDD0F7888888888888888888 + 7F07D0888888888888888888888807DDCCCCCCCCDDD0F7F77F8F777FF8FC99CF + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDCCCCDCCDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0F00FFF8F0000F8F9999CCF07DDCDDDDCDDDDD0F7888888888888888888 + 7F07D0FFFFFF8FFFFFF8F99AAACF07DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0F0000F8F000FF8F9999CCF07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0888888888888888888888807DDDDDDDDDDDDD0F0000000000000000000 + 0F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFF + FF07D0F0000F8F000FF8FB99944F07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7F77F8F7777F8F777FF + 7F07D0777777777777777777777707DDDDDDDDDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0F888887F888887F888888807DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0F000087F800087F800000807DDDDDDDDDDDDD0F7F77F8F7777F8F777FF + 7F07D0F888887F888887F888888807DDDDDDDDDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0FFFFFF7FFFFFF7FFFFFFFF07DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0000000000000000000000007DDCDDDDCDDDDD0F7888888888888888888 + 7F07D7F88880777777777777777778DDCCCCDCCDDDD0F7777777777777777777 + 7F07D7F00080F87777788088888888DDCCCCCCCCDDD0F7777777777777777777 + 7F07D7F77780FFFFFFFFF088888888DDCCCCDCCDDDD0F0000000000000000000 + 0F07D7FFFFF0777777777088888888DDCDDDDCDDDDD0FFFFFFFFFFFFFFFFFFFF + FF07D7777770888888888888888888DDDDDDDDDDDDD000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblLevels: TLabel + Left = 5 + Top = 267 + Width = 30 + Height = 13 + Caption = 'Levels' + end + object bvlLevels: TBevel + Left = 47 + Top = 272 + Width = 265 + Height = 4 + Shape = bsBottomLine + end + object lblGridSize: TLabel + Left = 5 + Top = 140 + Width = 19 + Height = 13 + Caption = 'Size' + end + object bvlGridSize: TBevel + Left = 33 + Top = 144 + Width = 277 + Height = 4 + Shape = bsBottomLine + end + object imgGridSize: TImage + Left = 9 + Top = 162 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000008088F07DDDDDDDDDDDD0800000000000000000000 + 807DD0F0FFFF8FFFF8FFFF0FFF0F07DDDDDDDDDDDD0F0F77FFF8F777F8F777F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCDDDDCDDDD0F0F00FFF8F00FF8F00FF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCCCCCDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCDDDDCDDDD0F0FFFFFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCCCCDCCDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCCCCCDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCDCCDDD0F0FFFFFF8F0FFF8F0FFF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0777777777777770FFF0F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F0F8887F8887F8880FFF8F07DDDDDDDDDDDD0F0F888887F88887F88880 + F07DD0F0F0087F0087F0080FFF0F07DDDDDDDDDDDD0F0F800087F80087F80080 + F07DD0F0FFFF7FFFF7FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF7FFFFF7FFFFF0 + F07DD0800000000000000008080807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxProcessSelection: TCheckBox + Left = 90 + Top = 25 + Width = 200 + Height = 17 + Caption = 'Process Selection' + TabOrder = 0 + OnClick = OptionsSelectionClick + end + object chbxProcessExactSelection: TCheckBox + Tag = 1 + Left = 90 + Top = 46 + Width = 200 + Height = 17 + Caption = 'Process Exact Selection' + TabOrder = 1 + OnClick = OptionsSelectionClick + end + object chbxExpandGroupRows: TCheckBox + Left = 90 + Top = 82 + Width = 200 + Height = 17 + Caption = 'Groups' + TabOrder = 2 + OnClick = OptionsExpandingClick + end + object chbxExpandMasterRows: TCheckBox + Tag = 1 + Left = 90 + Top = 104 + Width = 200 + Height = 17 + Caption = 'Details' + TabOrder = 3 + OnClick = OptionsExpandingClick + end + object chbxStartFromActiveView: TCheckBox + Left = 90 + Top = 222 + Width = 200 + Height = 17 + Caption = 'Start From Active Details' + TabOrder = 6 + OnClick = OptionsDetailsClick + end + object chbxOnlyActiveView: TCheckBox + Tag = 1 + Left = 90 + Top = 244 + Width = 200 + Height = 17 + Caption = 'Only Active Details' + TabOrder = 7 + OnClick = OptionsDetailsClick + end + object chbxLevelsUnwrap: TCheckBox + Left = 90 + Top = 285 + Width = 200 + Height = 17 + Caption = '&Unwrap' + TabOrder = 8 + OnClick = OptionsLevelsClick + end + object chbxLevelsUnwrapTopLevel: TCheckBox + Tag = 1 + Left = 90 + Top = 308 + Width = 200 + Height = 17 + Caption = 'Unwrap Top Level' + TabOrder = 9 + OnClick = OptionsLevelsClick + end + object chbxLevelsRiseActiveLevelOntoTop: TCheckBox + Tag = 2 + Left = 90 + Top = 331 + Width = 200 + Height = 17 + Caption = 'Rise Active Level onto Top' + TabOrder = 10 + OnClick = OptionsLevelsClick + end + object chbxGridAutoWidth: TCheckBox + Left = 90 + Top = 159 + Width = 200 + Height = 17 + Caption = '&Auto Width' + TabOrder = 5 + OnClick = OptionsSizeClick + end + object chbxExpandCards: TCheckBox + Tag = 2 + Left = 90 + Top = 125 + Width = 200 + Height = 17 + Caption = 'Cards' + TabOrder = 4 + OnClick = OptionsExpandingClick + end + object chbxLevelsSkipEmptyViews: TCheckBox + Tag = 3 + Left = 90 + Top = 353 + Width = 200 + Height = 17 + Caption = 'Skip Empty Views' + TabOrder = 11 + OnClick = OptionsLevelsClick + end + end + object tshFormatting: TTabSheet + Caption = 'Formatting' + ImageIndex = 4 + object lblLookAndFeel: TLabel + Left = 5 + Top = 8 + Width = 66 + Height = 13 + Caption = 'Look and Feel' + end + object bvlLookAndFeel: TBevel + Left = 85 + Top = 12 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object imgLookAndFeel: TImage + Left = 9 + Top = 28 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D08777777777780877777788807DCCCCDCCDDD0877777777778787777788 + 8F07D08888888888880888888888807DCCCCCCCCDD0888888888888788888888 + 8F07D00000000000000000000000007DCCCCDCCDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F7777777FF07DDDDDDDDDDD0F777777777FF7F7777777 + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F777777FFF07DDDDDDDDDDD0F777777FFFFF7F777777F + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F7777777777F7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F77777FFFF07DDDDDDDDDDD0F77777777FFF7F77777FF + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D00000000000000000000000007DCDDDDCDDDD0000000000000000000000 + 0007D08888888888880888888888807DCCCCDCCDDD0777777777777777777777 + 7707D08888888888880888888888807DCCCCCCCCDD0F88888888888788888888 + 8707D08000000008880880000000807DCCCCDCCDDD0F00000000888788000000 + 8707D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + F707D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgRefinements: TImage + Left = 9 + Top = 95 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FF7FFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF777777F + F07DD0F77777777FF7FF70888FFF07DDCCCCCCCCDD0F77777777FF7FF7FFFF7F + F07DD0FFFFFFFFFFF7FF70FF8FFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF7F00F7F + F07DD0F777777FFFF7FF70FF8FFF07DDCDDDDCDDDD0F777777FFFF7FF7F00F7F + F07DD0FFFFFFFFFFF7FF70000FFF07DDDDDDDDDDDD0FFFFFFFFFFF7FF7FFFF7F + F07DD0F77777777FF7FF777777FF07DDDDDDDDDDDD0F77777777FF7FF777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFCCCCCFFF07DDCCCCCCCCDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FCCCCCCCFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F7777777FFF7FFCCCCCFFF07DDCDDDDCDDDD0F7777777FFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7F9999999FF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F777777777F7FF99999FFF07DDDDDDDDDDDD0F777777777F7F7777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F80000888887F88888888707DDDDDDDDDDDD0F80000888887F88888888 + 707DD0F80000000087F80000008707DDDDDDDDDDDD0F80000000087F80000008 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0FFFFFFFFFFF7FFFFFFFFF707DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + 707DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblRefinements: TLabel + Left = 5 + Top = 74 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlRefinements: TBevel + Left = 70 + Top = 79 + Width = 241 + Height = 4 + Shape = bsBottomLine + end + object bvlRefinementsSeparator: TBevel + Left = 90 + Top = 168 + Width = 221 + Height = 4 + Shape = bsBottomLine + end + object lblPagination: TLabel + Left = 5 + Top = 229 + Width = 50 + Height = 13 + Caption = 'Pagination' + end + object bvlPagination: TBevel + Left = 64 + Top = 234 + Width = 247 + Height = 4 + Shape = bsBottomLine + end + object imgPagination: TImage + Left = 8 + Top = 251 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDD0000000000000000000000007DDDDDDDDDDDD77777777777777770DDDDD + DDDDD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD7FFFFFFFFFFFFFFF0DDDDD + DDDDD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD7F8888888888888F0DDDDD + DDDDD0888000000000000000088F07DDDDDDDDDDDD7F8777877778778F07770D + DDDDD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7F8888888888888F0FFF0D + DDDDD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F088F0D + DDDDD0F9F0F00F8F00F8F00F0F9F07DDDDDDDDDDDD7F8888888888888F078F07 + 770DD0F990FFFF8FFFF8FFFF099F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F088F0F + FF0DD0F99999999999999999999F07DDCDDDDCDDDD7F8FFF8FFFF8FF8F0F8F08 + 8F0DD0F990FFFF8FFFF8FFFF099F07DDCCCCDCCDDD7F8888888888888F088F07 + 8F0DD0F9F0FFFF8F00F8F00F0F9F07DDCCCCCCCCDD7F8FFF8FFFF8FF8F0F8F08 + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDCCCCDCCDDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F8F0FFFF8F00F8F00F0F8F07DDCDDDDCDDDD7F8888888888888F088F08 + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F9F0F00F8F00F8F00F0F9F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F990FFFF8FFFF8FFFF099F07DDCDDDDCDDDD7F8888888888888F088F0F + 8F0DD0F99999999999999999999F07DDCCCCDCCDDD7F8FFF8FFFF8FF8F0F8F08 + 8F0DD0F990FFFF8FFFF8FFFF099F07DDCCCCCCCCDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F9F0FFFF8F00F8F00F0F9F07DDCCCCDCCDDD7F8888888888888F088F0F + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDCDDDDCDDDD7F8777877778778F0F8F08 + 8F0DD0F8F0F00F8F00F8F00F0F8F07DDDDDDDDDDDD7F8888888888888F0F8F0F + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7FFFFFFFFFFFFFFF088F0F + 8F0DD0F8F0777777777777770F8F07DDDDDDDDDDDD0000000000000000078F08 + 8F0DD0F8F0F8887F8887F8880F8F07DDDDDDDDDDDDDDDD7F8888888888888F0F + 8F0DD0F8F0F0087F0087F0080F8F07DDDDDDDDDDDDDDDD7FFFFFFFFFFFFFFF08 + 8F0DD0F8F0FFFF7FFFF7FFFF0F8F07DDDDDDDDDDDDDDDD00000000000000000F + 8F0DD0888000000000000000088807DDDDDDDDDDDDDDDDDDDD7F888888888888 + 8F0DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDDDDDDDDDD7FFFFFFFFFFFFF + FF0DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDDDDDDDDDD00000000000000 + 000DD000000000000000000000000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object cbxLookAndFeel: TComboBox + Left = 90 + Top = 33 + Width = 212 + Height = 21 + Style = csDropDownList + ItemHeight = 0 + TabOrder = 0 + OnClick = LookAndFeelClick + end + object chbxFlatCheckMarks: TCheckBox + Tag = 2 + Left = 90 + Top = 142 + Width = 200 + Height = 17 + Caption = 'Flat Check &Marks' + TabOrder = 3 + OnClick = OptionsRefinementClick + end + object chbxDisplayGraphicsAsText: TCheckBox + Tag = 1 + Left = 90 + Top = 119 + Width = 200 + Height = 17 + Caption = 'Display Graphics As &Text' + TabOrder = 2 + OnClick = OptionsRefinementClick + end + object chbxTransparentGraphics: TCheckBox + Left = 90 + Top = 96 + Width = 200 + Height = 17 + Caption = 'Transparent &Graphics' + TabOrder = 1 + OnClick = OptionsRefinementClick + end + object chbxSuppressBackgroundBitmaps: TCheckBox + Tag = 1 + Left = 90 + Top = 181 + Width = 200 + Height = 17 + Caption = 'Suppress Background Images' + TabOrder = 4 + OnClick = OptionsFormatingClick + end + object chbxConsumeSelectionStyle: TCheckBox + Tag = 2 + Left = 90 + Top = 203 + Width = 200 + Height = 17 + Caption = 'Consume Selection Style' + TabOrder = 5 + OnClick = OptionsFormatingClick + end + object chbxPaginateOneGroupPerPage: TCheckBox + Tag = 1 + Left = 90 + Top = 274 + Width = 200 + Height = 17 + Caption = 'One Group Per Page' + TabOrder = 7 + OnClick = OptionsPaginationClick + end + object chbxPaginateByTopLevelGroups: TCheckBox + Left = 90 + Top = 251 + Width = 200 + Height = 17 + Caption = 'By TopLevel Groups' + TabOrder = 6 + OnClick = OptionsPaginationClick + end + end + object tshStyles: TTabSheet + Caption = 'Styles' + ImageIndex = 5 + object bvlStyles: TBevel + Left = 118 + Top = 12 + Width = 191 + Height = 4 + Shape = bsBottomLine + end + object bvlStyleSheets: TBevel + Left = 72 + Top = 295 + Width = 237 + Height = 5 + Shape = bsBottomLine + end + object lblStyleSheets: TLabel + Left = 6 + Top = 291 + Width = 60 + Height = 13 + Caption = 'Style Sheets' + end + object bvlStylesHost: TBevel + Left = 6 + Top = 33 + Width = 228 + Height = 219 + end + object Label1: TLabel + Left = 76 + Top = 135 + Width = 68 + Height = 13 + Caption = '[ Styles Host ]' + Visible = False + end + object lblUseNativeStyles: TLabel + Left = 24 + Top = 9 + Width = 84 + Height = 13 + Caption = '&Use Native Styles' + FocusControl = chbxUseNativeStyles + OnClick = lblUseNativeStylesClick + end + object btnStyleColor: TButton + Left = 243 + Top = 61 + Width = 68 + Height = 23 + Caption = 'Co&lor...' + TabOrder = 2 + OnClick = StyleColorClick + end + object btnStyleFont: TButton + Left = 243 + Top = 33 + Width = 68 + Height = 23 + Caption = '&Font...' + TabOrder = 1 + OnClick = StyleFontClick + end + object btnStyleBackgroundBitmap: TButton + Left = 243 + Top = 97 + Width = 68 + Height = 23 + Caption = '&Bitmap...' + TabOrder = 3 + OnClick = StyleBackgroundBitmapClick + end + object chbxUseNativeStyles: TCheckBox + Left = 5 + Top = 8 + Width = 14 + Height = 17 + TabOrder = 0 + OnClick = OptionsFormatingClick + end + object cbxStyleSheets: TComboBox + Left = 6 + Top = 311 + Width = 302 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 7 + OnClick = cbxStyleSheetsClick + OnDrawItem = cbxStyleSheetsDrawItem + OnKeyDown = cbxStyleSheetsKeyDown + end + object btnStyleSheetNew: TButton + Left = 6 + Top = 343 + Width = 71 + Height = 23 + Caption = '&New...' + TabOrder = 8 + OnClick = StyleSheetNewClick + end + object btnStyleSheetCopy: TButton + Left = 83 + Top = 343 + Width = 71 + Height = 23 + Caption = '&Copy...' + TabOrder = 9 + OnClick = StyleSheetCopyClick + end + object btnStyleSheetDelete: TButton + Left = 160 + Top = 343 + Width = 71 + Height = 23 + Caption = '&Delete...' + TabOrder = 10 + OnClick = StyleSheetDeleteClick + end + object btnStylesSaveAs: TButton + Left = 123 + Top = 259 + Width = 112 + Height = 23 + Caption = 'Save &As...' + TabOrder = 6 + OnClick = StylesSaveAsClick + end + object btnStyleSheetRename: TButton + Left = 237 + Top = 343 + Width = 71 + Height = 23 + Caption = '&Rename...' + TabOrder = 11 + OnClick = StyleSheetRenameClick + end + object btnStyleBackgroundBitmapClear: TButton + Left = 243 + Top = 125 + Width = 68 + Height = 23 + Caption = 'Cle&ar' + TabOrder = 4 + OnClick = StyleBackgroundBitmapClearClick + end + object btnStyleRestoreDefaults: TButton + Left = 6 + Top = 259 + Width = 112 + Height = 23 + Caption = 'Rest&ore Defaults' + TabOrder = 5 + OnClick = StyleRestoreDefaultsClick + end + end + object tshPreview: TTabSheet + Caption = 'Preview' + ImageIndex = 2 + object lblPreviewOptions: TLabel + Left = 5 + Top = 8 + Width = 37 + Height = 13 + Caption = 'Options' + end + object bvlPreviewOptions: TBevel + Left = 50 + Top = 12 + Width = 261 + Height = 4 + Shape = bsBottomLine + end + object lblPreviewMaxLineCount: TLabel + Left = 91 + Top = 73 + Width = 78 + Height = 13 + Caption = 'Max Line Count:' + end + object bvlPreviewMaxLineCountHost: TBevel + Left = 229 + Top = 69 + Width = 68 + Height = 21 + Visible = False + end + object imgPreview: TImage + Left = 9 + Top = 28 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDD7777777777777777777777777DDDDDD0000000000000000000000000 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F888F7FF888F7F8888F7F07DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F0 + 7DDDDDD0F777777777777777777777F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCFFCCCCFFCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCFCCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCFCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCFCCFCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCFFCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F777777777777777777777F07DDDDDD0F7F888F7FF888F7FF888F7F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F88887F888887F888887F07DDDDDD0F7F00087F000087F000087F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0000000000000000000000000 + DDDD} + Transparent = True + end + object chbxPreviewVisible: TCheckBox + Left = 90 + Top = 28 + Width = 150 + Height = 17 + Caption = 'Visible' + TabOrder = 0 + OnClick = PreviewVisibleClick + end + object chbxPreviewAutoHeight: TCheckBox + Left = 90 + Top = 49 + Width = 150 + Height = 17 + Caption = 'Auto Height' + TabOrder = 1 + OnClick = PreviewAutoHeightClick + end + end + object tshCards: TTabSheet + Caption = 'Cards' + ImageIndex = 3 + object bvlCardSpaceVertHost: TBevel + Left = 231 + Top = 140 + Width = 75 + Height = 21 + Visible = False + end + object bvlCardSpaceHorzHost: TBevel + Left = 231 + Top = 112 + Width = 75 + Height = 21 + Visible = False + end + object lblCardSpaceVert: TLabel + Left = 90 + Top = 145 + Width = 39 + Height = 13 + Caption = 'Vertical:' + end + object lblCardSpaceHorz: TLabel + Left = 90 + Top = 116 + Width = 52 + Height = 13 + Caption = 'Horizontal:' + end + object imgCardSpacing: TImage + Left = 9 + Top = 112 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDD0DD0DDDDDDDDDDDDDDDDDD0DD0DDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDD00D0DDDDDDDDDDDDDDDDDD0D00DDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDD000000000000000000000000000000DDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDD00D0DDDDDDDDDDDDDDDDDD0D00DDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDD7DD0DDDDDD707000DDDDDD0DD7DDDDDDDDDDDDDDD + DDDDDDDDD0000000000000000000DDDDDD0D0D0DDDDDD0000000000000000000 + 0DDDDDDD77777777777777777770DDDDD00D0D0DDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDD0D000DDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7FFFFFFF7FFF9999FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFF9999FF7 + 0DDDDDDD7FFFFFFF7FFF9999FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFF9999FF7 + 0DDDDDDD7FFFFFFF7FCCCC99FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FCCCC99FF7 + 0DDDDDDD7FFFFFFF7FCCCC99FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FCCCC99FF7 + 0DDDDDDD7F77777F7FCCCCFFFF70DDDDDDDDDDDDDDDDD7F77777F7FCCCCFFFF7 + 0DDDDDDD7F77777F7FCCCCFFFF70DDDDDDDDDDDDDDDDD7F77777F7FCCCCFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD77777777777777777770DDDDDDDDDDDDDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7F77777F7FF777777F70DDDDDDDDDDDDDDDDD7F77777F7FF777777F7 + 0DDDDDDD7F7FFFFF7FF7FFFFFF70DDDDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD77777777777777777770DDDDDDDDDDDDDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7F77777F7FF77777FF70DDDDDDDDDDDDDDDDD7F77777F7FF777777F7 + 0DDDDDDD7F7FFFFF7FF77FFFFF70DDDDDDDDDDDDDDDDD7F7FFFFF7FF77FFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD77777777777777777770DDDDDDDDDDDDDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7F77777F7FF777777F70DDDDDDDDDDDDDDDDD7F77777F7FF777777F7 + 0DDDDDDD7F7FFFFF7FF7FFFFFF70DDDDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7777777777777777777DDDDDDDDDDDDDDDDDD7777777777777777777 + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblCardSpacing: TLabel + Left = 5 + Top = 92 + Width = 37 + Height = 13 + Caption = 'Spacing' + end + object bvlCardSpacing: TBevel + Left = 51 + Top = 97 + Width = 260 + Height = 4 + Shape = bsBottomLine + end + object bvlCardSizes: TBevel + Left = 34 + Top = 12 + Width = 277 + Height = 4 + Shape = bsBottomLine + end + object lblCardSizes: TLabel + Left = 5 + Top = 8 + Width = 24 + Height = 13 + Caption = 'Sizes' + end + object imgCardSizes: TImage + Left = 9 + Top = 28 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDD000000000000DDDDDDDDDDDDDDDDDDDDDDDD000000000000DD00000000 + 0000D7777777777770DDDDDDDDDDDDDDDDDDDDDDD7777777777770D777777777 + 7770D7FFFFF8FFFF70DDDDDDDDDDDDDDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8FFFF70DDDDDDDDDDDDDDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70DDDDDDDDDDDDDDDDDDDDDDD7FFFFF8F77F70D7FFFFF8FF + FF70D7FFFFF8FFFF70DDDDDDDDDDDDDDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70DD0000000000DDCCCCDCCDD7FFFFF8F77F70D7FFFFF8FF + FF70D7FFFFF8FFFF70D77777777770DDCCCCCCCCD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70D7FFFF8FFF70DDCCCCDCCDD7FFFFF8F77F70D7FFFFF8FF + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70D7FFFF8F7F70DDDDDDDDDDD7FFFFF8F77F70D7FFFFF8F7 + FF70D7F777F8FFFF70D7FFFF8FFF70DDDDDDDDDDD7F777F8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDDDDDDDDDD7F777F8F77F70D7F77FF8F7 + 7F70D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7888888888870D78888888870DDDDDDDDDDD7888888888870D788888888 + 8870D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDDDDDDDDDD7F777F8F77F70D7F77FF8F7 + FF70D7F777F8FFFF70D7F77F8F7F70DDDDDDDDDDD7F777F8FFFF70D7F77FF8F7 + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7888888888870D78888888870DDDDDDDDDDD7888888888870D788888888 + 8870D7FFFFF8FFFF70D7FFFF8FFF70DDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDCCCCDCCDD7F777F8F77F70D7F77FF8F7 + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDCCCCCCCCD7FFFFF8FFFF70D7FFFFF8FF + FF70D7888888888870D78888888870DDCCCCDCCDD7888888888870D788888888 + 8870D7FFFFF8FFFF70D7FFFF8FFF70DDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDDDDDDDDDD7F777F8F77F70D7F77FF8F7 + FF70D7F7FFF8FFFF70D7F7FF8F7F70DDDDDDDDDDD7F7FFF8FFFF70D7F7FFF8F7 + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D777777777777DD7777777777DDDDDDDDDDDD777777777777DD777777777 + 777DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgCardFraming: TImage + Left = 9 + Top = 189 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDD7777777777777777777DDDDDDDDDDDDDDDDDD00000000000000000 + 00DDDDDDD88888888888888888887DDDDDDDDDDDDDDDDD000000000000000000 + 00DDDDDDD8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDDDDD0FFFFFFF0FFFFFFFFF + 00DDDDD778FFFFFFF8FFF9999FF87DDDDDDDDDDDDDDD000FFFFFFF0FFF9999FF + 00DDDD8888FFFFFFF8FFF9999FF87DDDDDDDDDDDDDD0000FFFFFFF0FFF9999FF + 00DDDD8FF8FFFFFFF8FCCCC99FF87DDDCDDDDCDDDDD0FF0FFFFFFF0FCCCC99FF + 00DDDD8FF8FFFFFFF8FCCCC99FF87DDDCCCCDCCDDDD0FF0FFFFFFF0FCCCC99FF + 00DDDD8FF8F77777F8FCCCCFFFF87DDDCCCCCCCCDDD0FF0F77777F0FCCCCFFFF + 00DDDD8FF8F77777F8FCCCCFFFF87DDDCCCCDCCDDDD0FF0F77777F0FCCCCFFFF + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDCDDDDCDDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDDDDDDDDDDDD0F7000000000000000000 + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF777777F87DDDDDDDDDDDDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF7FFFFFF87DDDDDDDDDDDDDD0000F7FFFFF0FF7FFFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDDDDDDDDDDDD0F7000000000000000000 + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF77777FF87DDDDDDDDDDDDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF77FFFFF87DDDDDDDDDDDDDD0000F7FFFFF0FF77FFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDCDDDDCDDDDD0F7000000000000000000 + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDCCCCDCCDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF777777F87DDDCCCCCCCCDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF7FFFFFF87DDDCCCCDCCDDDD0000F7FFFFF0FF7FFFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDCDDDDCDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F78888888888888888888DDDDDDDDDDDDDDD0F7000000000000000000 + 0DDDDD8F7FFFFF8FF7FFFFFF87DDDDDDDDDDDDDDDDD0F7FFFFF0FF7FFFFFF00D + DDDDDD8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDDDDD0FFFFFFF0FFFFFFFFF00D + DDDDDD8888888888888888888DDDDDDDDDDDDDDDDDD0000000000000000000DD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblCardFraming: TLabel + Left = 5 + Top = 171 + Width = 38 + Height = 13 + Caption = 'Framing' + end + object bvlCardFraming: TBevel + Left = 49 + Top = 176 + Width = 262 + Height = 4 + Shape = bsBottomLine + end + object bvlCardShadowColorHost: TBevel + Left = 177 + Top = 276 + Width = 129 + Height = 21 + Visible = False + end + object lblCardShadowDepth: TLabel + Left = 90 + Top = 308 + Width = 33 + Height = 13 + Caption = 'Depth:' + end + object bvlCardShadow: TBevel + Left = 48 + Top = 260 + Width = 263 + Height = 4 + Shape = bsBottomLine + end + object lblCardShadow: TLabel + Left = 5 + Top = 255 + Width = 38 + Height = 13 + Caption = 'Shadow' + end + object lblCardShadowColor: TLabel + Left = 90 + Top = 280 + Width = 29 + Height = 13 + Caption = 'Color:' + end + object bvlCardShadowDepthHost: TBevel + Left = 177 + Top = 304 + Width = 129 + Height = 21 + Visible = False + end + object imgCardShadow: TImage + Left = 9 + Top = 276 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD0000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD0000000000000000000 + 000DDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDCDDDDCDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7FFFFFFF7FFF9999FFFFF7DDDDCCCCDCCDDDD7FFFFFFF7FFF9999FFFFF + 700DDD7FFFFFFF7FFF9999FFFFF7DDDDCCCCCCCCDDD7FFFFFFF7FFF9999FFFFF + 700DDD7FFFFFFF7FCCCC99FFFFF7DDDDCCCCDCCDDDD7FFFFFFF7FCCCC99FFFFF + 700DDD7FFFFFFF7FCCCC99FFFFF7DDDDCDDDDCDDDDD7FFFFFFF7FCCCC99FFFFF + 700DDD7F77777F7FCCCCFFFFFFF7DDDDDDDDDDDDDDD7F77777F7FCCCCFFFFFFF + 700DDD7F77777F7FCCCCFFFFFFF7DDDDDDDDDDDDDDD7F77777F7FCCCCFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7F77777F7FF777777FFFF7DDDDDDDDDDDDDDD7F77777F7FF777777FFFF + 700DDD7F7FFFFF7FF7FFFFFFFFF7DDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7F77777F7FF77777FFFFF7DDDDCDDDDCDDDDD7F77777F7FF77777FFFFF + 700DDD7F7FFFFF7FF77FFFFFFFF7DDDDCCCCDCCDDDD7F7FFFFF7FF77FFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDCCCCCCCCDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7777777777777777777777DDDDCCCCDCCDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDCDDDDCDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7F77777F7FF777777FFFF7DDDDDDDDDDDDDDD7F77777F7FF777777FFFF + 700DDD7F7FFFFF7FF7FFFFFFFFF7DDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 7DDDDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 7DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxCardsKeepSameHeight: TCheckBox + Tag = 2 + Left = 90 + Top = 70 + Width = 200 + Height = 17 + Caption = 'Keep Same Height' + TabOrder = 2 + OnClick = OptionsCardsClick + end + object chbxCardsKeepSameWidth: TCheckBox + Tag = 1 + Left = 90 + Top = 49 + Width = 200 + Height = 17 + Caption = 'Keep Same Width' + TabOrder = 1 + OnClick = OptionsCardsClick + end + object chbxCardsAutoWidth: TCheckBox + Left = 90 + Top = 28 + Width = 200 + Height = 17 + Caption = 'Auto Width' + TabOrder = 0 + OnClick = OptionsCardsClick + end + object chbxCardsVertLines: TCheckBox + Tag = 5 + Left = 90 + Top = 231 + Width = 200 + Height = 17 + Caption = 'Vertical Lines' + TabOrder = 5 + OnClick = OptionsCardsClick + end + object chbxCardsHorzLines: TCheckBox + Tag = 4 + Left = 90 + Top = 210 + Width = 200 + Height = 17 + Caption = 'Horizontal Lines' + TabOrder = 4 + OnClick = OptionsCardsClick + end + object chbxCardsBorder: TCheckBox + Tag = 3 + Left = 90 + Top = 189 + Width = 200 + Height = 17 + Caption = 'Border' + TabOrder = 3 + OnClick = OptionsCardsClick + end + end + object tshCharts: TTabSheet + Caption = 'Charts' + ImageIndex = 6 + object lblChartsOptions: TLabel + Left = 5 + Top = 8 + Width = 37 + Height = 13 + Caption = 'Options' + end + object imgCharts: TImage + Left = 9 + Top = 28 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDD777777777777777777777777DDDDDDD000000000000000000000000 + 7DDDDDDD0887FFFFFFFFFFFFFFFFFFF07DDDDDDD0887F8888888888888888880 + 7DDDDDDD0887F8FC491A2FFC491A2FF07DDDDDDD0887F8FC491A2FFC491A2FF0 + 7DDDDDDD0887F8FC4FFA2FFC491A2FF07DDDDDDD0887F8FC4FFA2FFC4FFA2FF0 + 7DDDDDDD0887F8FFFFFFFFFFFFFFFFF07DDDDDDD088777777777777777777770 + 7DDDDDDD0888888888888888888888807DDDDDDD087807777777788888888880 + 7DDDDDDD0888888888888888888888807DDDDDDD077777777777777777777770 + 7DDDDDDD0887FFFFFFFFFFFFFFFFFFF07DDDDDDD0887F8888888888888888880 + 7DDDDDDD0887F8FC491A2FFC491A2FF07DDDDDDD0887F8FC491A2FFC491A2FF0 + 7DDDDDDD0887F8FC491FFFFC491A2FF07DDDDDDD0887F8FFF91FFFFC4FFA2FF0 + 7DDDDDDD0887F8FFFFFFFFFFFFFFFFF07DDDDDDD088777777777777777777770 + 7DDDDDDD0888888888888888888888807DDDDDDD087800777777788888888880 + 7DDDDDDD0888888888888888888888807DDDDDDD077777777777777777777770 + 7DDDDDDD0F8888887F888888888888807DDDDDDD0F8000087F80000000088880 + 7DDDDDDD0F8888887F888888888888807DDDDDDD0FFFFFFF7FFFFFFFFFFFFFF0 + 7DDDDDDD000000000000000000000000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object bvlChartsOptions: TBevel + Left = 57 + Top = 12 + Width = 254 + Height = 4 + Shape = bsBottomLine + end + object chbxChartsTransparent: TCheckBox + Left = 90 + Top = 28 + Width = 200 + Height = 17 + Caption = 'Transparent' + TabOrder = 0 + OnClick = chbxChartsTransparentClick + end + end + end + object pnlPreview: TPanel + Left = 331 + Top = 44 + Width = 306 + Height = 350 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + object PreviewGrid: TcxGrid + Left = 5 + Top = 7 + Width = 296 + Height = 337 + TabOrder = 0 + LookAndFeel.NativeStyle = False + RootLevelOptions.DetailTabsPosition = dtpTop + object PreviewBandedView: TcxGridBandedTableView + NavigatorButtons.ConfirmDelete = False + FilterBox.CustomizeDialog = False + FilterBox.Visible = fvAlways + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'Count = 0' + Kind = skCount + Position = spFooter + Column = colVendorName + end> + DataController.Summary.FooterSummaryItems = < + item + Format = 'Count = 0' + Kind = skCount + Column = colVendorName + end> + DataController.Summary.SummaryGroups = <> + OptionsView.ScrollBars = ssNone + OptionsView.CellAutoHeight = True + OptionsView.ColumnAutoWidth = True + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.GroupFooters = gfAlwaysVisible + Preview.Column = colVendorCountry + Preview.Visible = True + OnCustomDrawColumnHeader = PreviewBandedViewCustomDrawColumnHeader + OnCustomDrawFooterCell = PreviewBandedViewCustomDrawFooterCell + Bands = < + item + Caption = 'Vendor Data' + Width = 150 + end + item + Caption = 'Car Data' + end> + OnCustomDrawBandHeader = PreviewBandedViewCustomDrawBandHeader + object colVendorName: TcxGridBandedColumn + Caption = 'Name' + PropertiesClassName = 'TcxTextEditProperties' + Options.Filtering = False + Position.BandIndex = 0 + Position.ColIndex = 0 + Position.RowIndex = 0 + end + object colVendorLogo: TcxGridBandedColumn + Caption = 'Logo' + PropertiesClassName = 'TcxImageProperties' + Properties.GraphicTransparency = gtTransparent + OnCustomDrawCell = VendorLogoCustomDrawCell + Options.Filtering = False + Position.BandIndex = 0 + Position.ColIndex = 1 + Position.RowIndex = 0 + end + object colVendorCountry: TcxGridBandedColumn + PropertiesClassName = 'TcxTextEditProperties' + Position.BandIndex = 0 + Position.ColIndex = 2 + Position.RowIndex = 0 + end + object colCarModel: TcxGridBandedColumn + Caption = 'Model' + PropertiesClassName = 'TcxTextEditProperties' + Options.Filtering = False + Position.BandIndex = 1 + Position.ColIndex = 0 + Position.RowIndex = 0 + end + object colIsSUVModel: TcxGridBandedColumn + Caption = 'SUV' + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.ValueGrayed = #39#39 + OnCustomDrawCell = IsSUVModelCustomDrawCell + HeaderAlignmentHorz = taCenter + Options.Filtering = False + Width = 30 + Position.BandIndex = 1 + Position.ColIndex = 1 + Position.RowIndex = 0 + end + end + object PreviewGridLevel: TcxGridLevel + Caption = 'Cars' + end + end + end + object pmStyles: TPopupMenu + Images = ilStylesPopup + OnPopup = pmStylesPopup + Left = 4 + Top = 408 + object miStyleFont: TMenuItem + Caption = '&Font...' + ImageIndex = 0 + OnClick = StyleFontClick + end + object miStyleColor: TMenuItem + Caption = '&Color...' + OnClick = StyleColorClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miStyleBackgroundBitmap: TMenuItem + Caption = '&Bitmap...' + ImageIndex = 1 + ShortCut = 16463 + OnClick = StyleBackgroundBitmapClick + end + object miStyleBackgroundBitmapClear: TMenuItem + Caption = 'Clear' + ImageIndex = 3 + ShortCut = 16430 + OnClick = StyleBackgroundBitmapClearClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miStyleRestoreDefaults: TMenuItem + Caption = 'Restore Defaults' + OnClick = StyleRestoreDefaultsClick + end + object milLine: TMenuItem + Caption = '-' + end + object miStylesSelectAll: TMenuItem + Caption = 'Select A&ll' + ShortCut = 16449 + OnClick = miStylesSelectAllClick + end + object miLine4: TMenuItem + Caption = '-' + end + object miStylesSaveAs: TMenuItem + Caption = 'Save &As...' + ImageIndex = 2 + ShortCut = 16467 + OnClick = StylesSaveAsClick + end + end + object ilStylesPopup: TImageList + Left = 32 + Top = 408 + Bitmap = { + 494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001001000000000000018 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000420042000000000000 + 0000000000001863186300000042000000000000000000000000000000000000 + 0000000000000000000000000000FF7F00000000000000000000000000000000 + 0000000000000000000000000000000000000000000000420042004200420042 + 0042004200420042000000000000000000000000000000420042000000000000 + 0000000000001863186300000042000000000000000000000000FF7F00000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000E07F00000042004200420042 + 0042004200420042004200000000000000000000000000420042000000000000 + 00000000000018631863000000420000000000000000000000000000FF7F0000 + 000000000000000000000000FF7F000000000000000000001042104210421042 + 1042104200000000000000000000000000000000FF7FE07F0000004200420042 + 0042004200420042004200420000000000000000000000420042000000000000 + 00000000000000000000000000420000000000000000000000000000FF7F0000 + 00000000000000000000FF7F0000000000000000000000000000000010421042 + 0000000000000000000000000000000000000000E07FFF7F1042000000420042 + 0042004200420042004200420042000000000000000000420042004200420042 + 004200420042004200420042004200000000000000000000000000000000FF7F + 00000000000000000000FF7F0000000000000000000000000000000010420000 + 0000000000000000000000000000000000000000FF7FE07F1042FF7F00000000 + 0000000000000000000000000000000000000000000000420042000000000000 + 0000000000000000000000420042000000000000000000000000000000000000 + FF7F000000000000FF7F00000000000000000000000000000000000010420000 + 0000000000000000000000000000000000000000E07FFF7F1042FF7FFF03FF7F + FF03FF7FFF03FF7FFF03FF7FFF7F000000000000000000420000186318631863 + 1863186318631863186300000042000000000000000000000000000000000000 + 000000000000FF7F000000000000000000000000000000000000000010420000 + 0000000000000000000000000000000000000000FF7FE07F1042FF7FFF7FFF03 + FF7FFF03FF7FFF03FF7FFF03FF7F000000000000000000420000186318631863 + 1863186318631863186300000042000000000000000000000000000000000000 + 00000000FF7F0000000000000000000000000000000010420000000010420000 + 0000000000000000000000000000000000000000E07FFF7F1042FF7FFF031863 + FF03FF7FFF03FF7FFF03FF7FFF7F000000000000000000420000186318631863 + 1863186318631863186300000042000000000000000000000000000000000000 + 000000000000FF7F000000000000000000000000000010420000000010421042 + 0000000010420000000000000000000000000000000000001042FF7F1863E07F + 1863FF03FF7FFF03FF7FFF03FF7F000000000000000000420000186318631863 + 1863186318631863186300000042000000000000000000000000000000000000 + FF7F00000000FF7F000000000000000000000000000010421042000010421042 + 0000104210420000000000000000000000000000000000001042FF7FFF031863 + FF03FF7FFF03FF7FFF03FF7FFF7F000000000000000000420000186318631863 + 186318631863186318630000000000000000000000000000000000000000FF7F + 00000000000000000000FF7F0000000000000000000010421042104210421042 + 1042104210420000000000000000000000000000000000001042FF7FFF7FFF7F + FF7FFF7FFF7FFF7FFF7FFF7FFF7F000000000000000000420000186318631863 + 18631863186318631863000018630000000000000000000000000000FF7F0000 + 000000000000000000000000FF7F000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000001042104210421042 + 1042104210421042104210421042104200000000000000000000000000000000 + 000000000000000000000000000000000000000000000000FF7F000000000000 + 0000000000000000000000000000FF7F00000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFC001FFFF + FE07001F8001FFF9FF9F000F8001E7FFFF9F00078001C3F3E01F00038001C3E7 + F99F00018001E1C7F99B00008001F08FF99B00018001F81FF89300018001FC3F + D80300018001F81FD9BF80018001F09FC93FE0018001C1C7C03FE001800183E3 + FFFFE00180018FF1FFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end + object cxStyleRepository1: TcxStyleRepository + Left = 60 + Top = 408 + object styleCardShadow: TcxStyle + end + object styleCardBorder: TcxStyle + AssignedValues = [svColor] + Color = clWindow + end + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxGrid6Lnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxGrid6Lnk.pas new file mode 100644 index 00000000..7e5379ea --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxGrid6Lnk.pas @@ -0,0 +1,19594 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxGrid6Lnk; + +{$I cxVer.Inc} +{$DEFINE CHARTVIEW} + +interface + +uses + Windows, SysUtils, Messages, Classes, Graphics, Controls, StdCtrls, ComCtrls, + ExtCtrls, ImgList, Dialogs, ExtDlgs, Menus, cxGraphics, cxClasses, cxControls, + cxCustomData, cxDataStorage, cxData, cxDBData, cxGridDBDataDefinitions, cxGrid, + cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, + cxGridCardView, cxGridDBCardView, cxGridBandedTableView, cxGridDBBandedTableView, + {$IFDEF CHARTVIEW}cxGridChartView, cxGridDBChartView, {$ENDIF} + {$IFNDEF DXVER500}cxGridViewData, {$ENDIF} cxGridLevel, cxStyles, cxLookAndFeels, + cxLookAndFeelPainters, cxFilter, cxEdit, cxTextEdit, cxCheckBox, cxImage, dxBase, + dxPSSngltn, dxExtCtrls, dxPSCore, dxPrnPg, dxPScxCommon; + +const + vspsGridFirst = 0; + vspsGridBandHeader = vspsGridFirst + 0; + vspsGridCaption = vspsGridFirst + 1; + vspsGridCardCaptionRow = vspsGridFirst + 2; + vspsGridCardRowCaption = vspsGridFirst + 3; + vspsGridContent = vspsGridFirst + 4; + vspsGridContentEven = vspsGridFirst + 5; + vspsGridContentOdd = vspsGridFirst + 6; + vspsGridFilterBar = vspsGridFirst + 7; + vspsGridFooter = vspsGridFirst + 8; + vspsGridGroup = vspsGridFirst + 9; + vspsGridHeader = vspsGridFirst + 10; + vspsGridPreview = vspsGridFirst + 11; + vspsGridSelection = vspsGridFirst + 12; + vspsGridLast = vspsGridFirst + 12; + + vsCardShadow = vsCardViewLast + 1; + vsCardViewLast = vsCardShadow; + + bbTabs = -1; + + dxDefaultInterCardsSpaceHorz = 4; + dxDefaultInterCardsSpaceVert = 4; + dxDefaultCardsShadowDepth = 4; + dxDefaultCardsShadowColor = clBlack; + + dxGridAttributeIDBase = 0; + dxGridUndefinedID = dxGridAttributeIDBase + 0; + dxGridBandID = dxGridAttributeIDBase + 1; + dxGridCardRowCaptionID = dxGridAttributeIDBase + 2; + dxGridCardRowDataID = dxGridAttributeIDBase + 3; + dxGridFilterBarID = dxGridAttributeIDBase + 4; + dxGridFooterID = dxGridAttributeIDBase + 5; + dxGridGroupFooterID = dxGridAttributeIDBase + 6; + dxGridHeaderID = dxGridAttributeIDBase + 7; + dxGridLevelCaptionID = dxGridAttributeIDBase + 8; + dxGridRecordID = dxGridAttributeIDBase + 9; + +type + TdxGridAttributeHostInfo = class; + TdxGridAttributeHostInfoServices = class; + TdxGridReportLink = class; + TdxGridReportLinkOptionsExpanding = class; + TdxfmGridReportLinkDesignWindow = class; + + TdxCustomGridViewAdapter = class; + TdxCustomGridViewFormatter = class; + TdxCustomGridViewBuilder = class; + + TdxCustomGridTableViewAdapter = class; + TdxCustomGridTableViewBuilder = class; + + TdxGridTableViewAdapter = class; + TdxGridTableViewFormatter = class; + TdxGridTableViewBuilder = class; + + TdxGridBandedTableViewAdapter = class; + TdxGridBandedTableViewFormatter = class; + TdxGridBandedTableViewBuilder = class; + + TdxGridCardViewBuilder = class; + +{$IFDEF CHARTVIEW} + TdxGridChartViewBuilder = class; +{$ENDIF} + + TdxGridTableViewColumnPlace = class; + TdxGridTableViewColumnPlaceController = class; + TdxCustomGridBandedTableViewItemPlace = class; + TdxGridBandedTableViewItemPlace = class; + TdxGridBandedTableViewItemPlaceController = class; + + TdxGridViewRowProducerClass = class of TdxGridViewRowProducer; + TdxGridViewRowProducer = class; + TdxGridViewCaptionProducerClass = class of TdxGridViewCaptionProducer; + TdxGridViewCaptionProducer = class; + TdxGridViewFilterBarProducerClass = class of TdxGridViewFilterBarProducer; + TdxGridViewFilterBarProducer = class; + TdxGridViewDetailsSeparatorProducerClass = class of TdxGridViewDetailsSeparatorProducer; + TdxGridViewDetailsSeparatorProducer = class; + TdxGridViewTerminatorProducerClass = class of TdxGridViewTerminatorProducer; + TdxGridViewTerminatorProducer = class; + TdxGridTableViewHeadersProducerClass = class of TdxGridTableViewHeadersProducer; + TdxGridTableViewHeadersProducer = class; + TdxGridTableViewFootersProducerClass = class of TdxGridTableViewFootersProducer; + TdxGridTableViewFootersProducer = class; + TdxGridTableViewCustomDataRowProducerClass = class of TdxGridTableViewCustomDataRowProducer; + TdxGridTableViewCustomDataRowProducer = class; + TdxGridTableViewRowSeparatorProducerClass = class of TdxGridTableViewRowSeparatorProducer; + TdxGridTableViewRowSeparatorProducer = class; + TdxGridTableViewGroupFooterProducerClass = class of TdxGridTableViewGroupFooterProducer; + TdxGridTableViewGroupFooterProducer = class; + TdxGridTableViewGroupRowSeparatorProducerClass = class of TdxGridTableViewGroupRowSeparatorProducer; + TdxGridTableViewGroupRowSeparatorProducer = class; + TdxGridTableViewBandsProducerClass = class of TdxGridTableViewBandsProducer; + TdxGridTableViewBandsProducer = class; + TdxGridCardViewCardsRowProducerClass = class of TdxGridCardViewCardsRowProducer; + TdxGridCardViewCardsRowProducer = class; +{$IFDEF CHARTVIEW} + TdxGridChartViewChartProducerClass = class of TdxGridChartViewChartProducer; + TdxGridChartViewChartProducer = class; +{$ENDIF} + + { View Attributes } + + TdxGridAttributeClass = class of TdxGridAttribute; + TdxGridAttributeClasses = array of TdxGridAttributeClass; + TdxGridAttribute = class end; + + TdxGridBandHeader = class(TdxGridAttribute); + TdxGridCardRowCaption = class(TdxGridAttribute); + TdxGridCardRowData = class(TdxGridAttribute); + TdxGridDetails = class(TdxGridAttribute); + TdxGridExpandButton = class(TdxGridAttribute); + TdxGridFilterBar = class(TdxGridAttribute); + TdxGridFooter = class(TdxGridAttribute); + TdxGridGroupFooter = class(TdxGridAttribute); + TdxGridGroupRow = class(TdxGridAttribute); + TdxGridHeader = class(TdxGridAttribute); + TdxGridLevelCaption = class(TdxGridAttribute); + TdxGridPreview = class(TdxGridAttribute); + + TdxGridAttributeID = type Integer; + + + TdxGridCellCustomDrawInfo = record + GridAttributeID: TdxGridAttributeID; + GridView: TcxCustomGridView; + GridRecord: TcxCustomGridRecord; + GridColumn: TcxGridColumn; + GroupLevel: Integer; + GridBand: TcxGridBand; + GridCard: TcxGridCard; + GridCardRow: TcxGridCardViewRow; + (*case Byte of + 0: (GridRecord: TcxCustomGridRecord; + GridColumn: TcxGridColumn; + GroupLevel: Integer; + GridBand: TcxGridBand); + 1: (GridCard: TcxGridCard; + GridCardRow: TcxGridCardViewRow); *) + end; + + + TdxAttributeColorKind = (ackContentColor, ackTextColor); + + TdxVerticalDetailsSeparatorKind = (vdskLeading, vdskTrailing); + + { View Helpers } + + TdxCustomGridViewHelperClass = class of TdxCustomGridViewHelper; + + TdxCustomGridViewHelper = class(TdxCustomClassMapItem) + private + FView: TcxCustomGridView; + protected + class procedure AddAttribute(var AnAtributes: TdxGridAttributeClasses; AnAttribute: TdxGridAttributeClass); + class function FilterPosition(AView: TcxCustomGridView): TcxGridFilterPosition; virtual; + + class function IsFilterBarAtBottom(AView: TcxCustomGridView): Boolean; virtual; + class function IsFilterBarAtTop(AView: TcxCustomGridView): Boolean; virtual; + class function IsOffice11StyleGrouping(AView: TcxCustomGridView): Boolean; virtual; + class function ViewClass: TcxCustomGridViewClass; virtual; + public + constructor Create(AView: TcxCustomGridView); virtual; + + class function PairClass: TClass; override; + class procedure Register; + class procedure Unregister; + + class function ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; virtual; + class procedure ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); virtual; + class function ExtractGridView(AnItem: TdxReportVisualItem): TcxCustomGridView; virtual; + class function HasData(AView: TcxCustomGridView): Boolean; virtual; + class function IsAttributeSupported(AnAttribute: TdxGridAttributeClass): Boolean; virtual; + class function SupportedAttributes: TdxGridAttributeClasses; virtual; + + property View: TcxCustomGridView read FView write FView; + end; + + TdxNullGridViewHelper = class(TdxCustomGridViewHelper) + protected + class function ViewClass: TcxCustomGridViewClass; override; + public + class function IsAttributeSupported(AnAttribute: TdxGridAttributeClass): Boolean; override; + end; + + TdxCustomGridTableViewHelper = class(TdxCustomGridViewHelper) + protected + class function ExtractRecord(AnItem: TdxReportVisualItem): TcxCustomGridRecord; virtual; + {$IFDEF DXVER500} + class function FilterPosition(AView: TcxCustomGridView): TcxGridFilterPosition; override; + {$ENDIF} + class function ViewClass: TcxCustomGridViewClass; override; + public + class function ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; override; + class function HasData(AView: TcxCustomGridView): Boolean; override; + class function SupportedAttributes: TdxGridAttributeClasses; override; + end; + + TdxGridCardViewHelper = class(TdxCustomGridTableViewHelper) + protected + class function ExtractCard(AnItem: TdxReportVisualItem): TcxGridCard; virtual; + class function ExtractCardRow(AnItem: TdxReportVisualItem): TcxGridCardViewRow; virtual; + class function ExtractRecord(AnItem: TdxReportVisualItem): TcxCustomGridRecord; override; + class function ViewClass: TcxCustomGridViewClass; override; + public + class function ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; override; + class procedure ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); override; + end; + + TdxGridTableViewHelper = class(TdxCustomGridTableViewHelper) + protected + class function ExtractColumn(AnItem: TdxReportVisualItem): TcxGridColumn; virtual; + class function ExtractGroupLevel(AnItem: TdxReportVisualItem): Integer; virtual; + class function ExtractRecord(AnItem: TdxReportVisualItem): TcxCustomGridRecord; override; + class function IsOffice11StyleGrouping(AView: TcxCustomGridView): Boolean; override; + class function ViewClass: TcxCustomGridViewClass; override; + public + class function ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; override; + class procedure ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); override; + class function SupportedAttributes: TdxGridAttributeClasses; override; + end; + + TdxGridBandedTableViewHelper = class(TdxGridTableViewHelper) + protected + class function ExtractBand(AnItem: TdxReportVisualItem): TcxGridBand; virtual; + class function ViewClass: TcxCustomGridViewClass; override; + public + class function ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; override; + class procedure ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); override; + class function SupportedAttributes: TdxGridAttributeClasses; override; + end; + + {$IFDEF CHARTVIEW} + TdxGridChartViewHelper = class(TdxCustomGridViewHelper) + protected + class function ViewClass: TcxCustomGridViewClass; override; + public + class function HasData(AView: TcxCustomGridView): Boolean; override; + end; + {$ENDIF} + + { Record Helpers } + + TdxCustomGridRecordHelperClass = class of TdxCustomGridRecordHelper; + + TdxCustomGridRecordHelper = class(TdxCustomClassMapItem) + private + FAdapter: TdxCustomGridTableViewAdapter; + FGridRecord: TcxCustomGridRecord; + protected + function Adapter: TdxCustomGridTableViewAdapter; overload; virtual; + class function ProducerClass: TdxGridTableViewCustomDataRowProducerClass; virtual; + class function RecordClass: TcxCustomGridRecordClass; virtual; + + {$IFDEF DXVER500} + function GetCanCellMergingAsMaster: Boolean; virtual; + function GetCanCellMergingAsSlave: Boolean; virtual; + {$ENDIF} + function GetHasDetails: Boolean; virtual; + {$IFDEF DXVER500} + function GetHasExpandButton: Boolean; virtual; + {$ENDIF} + function GetHasSelectedChildren: Boolean; virtual; + {$IFDEF DXVER500} + function GetIsCellMergingSeparator: Boolean; virtual; + {$ENDIF} + function GetParent: TcxCustomGridRecord; virtual; + public + constructor Create(AAdapter: TdxCustomGridTableViewAdapter); virtual; + + class function PairClass: TClass; override; + class procedure Register; + class procedure Unregister; + + {$IFDEF DXVER500} + property CanCellMergingAsMaster: Boolean read GetCanCellMergingAsMaster; + property CanCellMergingAsSlave: Boolean read GetCanCellMergingAsSlave; + {$ENDIF} + property GridRecord: TcxCustomGridRecord read FGridRecord write FGridRecord; + property HasDetails: Boolean read GetHasDetails; + {$IFDEF DXVER500} + property HasExpandButton: Boolean read GetHasExpandButton; + {$ENDIF} + property HasSelectedChildren: Boolean read GetHasSelectedChildren; + {$IFDEF DXVER500} + property IsCellMergingSeparator: Boolean read GetIsCellMergingSeparator; + {$ENDIF} + property Parent: TcxCustomGridRecord read GetParent; + end; + + TdxCustomGridRowHelper = class(TdxCustomGridRecordHelper) + protected + function Adapter: TdxGridTableViewAdapter; reintroduce; overload; + class function RecordClass: TcxCustomGridRecordClass; override; + end; + + TdxGridDataRowHelper = class(TdxCustomGridRowHelper) + private + function GetRow: TcxGridDataRow; + protected + class function ProducerClass: TdxGridTableViewCustomDataRowProducerClass; override; + class function RecordClass: TcxCustomGridRecordClass; override; + public + property Row: TcxGridDataRow read GetRow; + end; + + TdxGridGroupRowHelper = class(TdxCustomGridRowHelper) + private + function GetGroupRow: TcxGridGroupRow; + protected + class function ProducerClass: TdxGridTableViewCustomDataRowProducerClass; override; + class function RecordClass: TcxCustomGridRecordClass; override; + + {$IFDEF DXVER500} + function GetCanCellMergingAsMaster: Boolean; override; + function GetCanCellMergingAsSlave: Boolean; override; + function GetHasExpandButton: Boolean; override; + {$ENDIF} + function GetHasSelectedChildren: Boolean; override; + public + property GroupRow: TcxGridGroupRow read GetGroupRow; + end; + + TdxGridMasterDataRowHelper = class(TdxCustomGridRowHelper) + private + function GetDetailView: TcxCustomGridView; + function GetMasterRow: TcxGridMasterDataRow; + protected + class function ProducerClass: TdxGridTableViewCustomDataRowProducerClass; override; + class function RecordClass: TcxCustomGridRecordClass; override; + + {$IFDEF DXVER500} + function GetCanCellMergingAsMaster: Boolean; override; + {$ENDIF} + function GetHasDetails: Boolean; override; + {$IFDEF DXVER500} + function GetHasExpandButton: Boolean; override; + {$ENDIF} + function GetHasSelectedChildren: Boolean; override; + {$IFDEF DXVER500} + function GetIsCellMergingSeparator: Boolean; override; + {$ENDIF} + public + property DetailView: TcxCustomGridView read GetDetailView; + property MasterRow: TcxGridMasterDataRow read GetMasterRow; + end; + + { caches } + + TdxRecordHelpersCache = class(TdxCustomCache) + private + FAdapter: TdxCustomGridTableViewAdapter; + function GetHelper(ARecord: TcxCustomGridRecord): TdxCustomGridRecordHelper; + function GetItem(Index: Integer): TdxCustomGridRecordHelper; + protected + function IndexOf(ARecord: TcxCustomGridRecord): Integer; + property Items[Index: Integer]: TdxCustomGridRecordHelper read GetItem; + public + constructor Create(AAdapter: TdxCustomGridTableViewAdapter); + property Adapter: TdxCustomGridTableViewAdapter read FAdapter; + property Helpers[ARecord: TcxCustomGridRecord]: TdxCustomGridRecordHelper read GetHelper; default; + end; + + TdxProducerCache = class(TdxCustomCache) + private + FBuilder: TdxCustomGridViewBuilder; + function GetItem(Index: Integer): TdxGridViewRowProducer; + function GetProducer(ProducerClass: TdxGridViewRowProducerClass): TdxGridViewRowProducer; + protected + function IndexOf(AProducerClass: TdxGridViewRowProducerClass): Integer; + property Items[Index: Integer]: TdxGridViewRowProducer read GetItem; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); + property Builder: TdxCustomGridViewBuilder read FBuilder; + property Producers[ProducerClass: TdxGridViewRowProducerClass]: TdxGridViewRowProducer read GetProducer; default; + end; + + { CustomView Adapter, Formatter and Builder } + + TdxGridViewAdapterClass = class of TdxCustomGridViewAdapter; + + TdxCustomGridViewAdapter = class + private + FGridView: TcxCustomGridView; + FMasterAdapter: TdxCustomGridViewAdapter; + function GetAbsoluteLevel: Integer; + function GetCanUseLookAndFeelColors: Boolean; + function GetCaptionText: string; + function GetDetailsSeparatorColor: TColor; + function GetDetailsSeparatorThickness: Integer; + function GetExpandButtonColor: TColor; + function GetExpandButtonSize: Integer; + function GetFilter: TcxDataFilterCriteria; + function GetFilterActive: Boolean; + function GetFilterEmpty: Boolean; + function GetFilterText: string; + function GetGrid: TcxCustomGrid; + function GetGridLevel: TcxGridLevel; + function GetGridWidth: Integer; + function GetHasDetailsSeparator: Boolean; + function GetLookAndFeelKind: TcxLookAndFeelKind; + function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; + function GetIsDetail: Boolean; + function GetIsMaster: Boolean; + function GetMasterGridLevel: TcxGridLevel; + function GetSummary: TcxDataSummary; + function GetThemedCaptionColor: TColor; + function GetThemedCaptionTextColor: TColor; + function GetThemedFilterBarColor: TColor; + function GetThemedFilterBarTextColor: TColor; + function GetViewWidth: Integer; + protected + procedure AfterBuilding; virtual; + procedure BeforeBuilding; virtual; + + function BackgroundBitmaps: TcxCustomGridBackgroundBitmaps; overload; virtual; + function GetBackgroundBitmap(Index: Integer): TBitmap; + function HasBackgroundBitmap(Index: Integer): Boolean; + function IsBackgroundBitmapSupported(Index: Integer): Boolean; virtual; + + function Controller: TcxCustomGridController; overload; virtual; + function DataController: TcxCustomDataController; overload; virtual; + + function CreateCloneAdapter(AClone: TcxCustomGridView): TdxCustomGridViewAdapter; + procedure ExpandAllRowsInClones(AMasterRows, AGroupRows: Boolean); virtual; + procedure ExpandAllRowsInGridView(AGridView: TcxCustomGridView; AMasterRows, AGroupRows: Boolean); + procedure ExpandAllRowsInLevel(ALevel: TcxGridLevel; AMasterRows, AGroupRows: Boolean; ARecursive: Boolean); + procedure ExpandAllRowsInItself(AMasterRows, AGroupRows: Boolean); virtual; + + function GetAreAllMasterRowsCollapsed: Boolean; virtual; + function GetAutoWidth: Boolean; virtual; + function GetCanUseOnEveryPageMode: Boolean; virtual; + {$IFDEF DXVER500} + function GetFilterPosition: TcxGridFilterPosition; virtual; + {$ENDIF} + function GetHasSelectedRecords: Boolean; virtual; + function GetIndentCount: Integer; virtual; + function GetIndentWidth: Integer; virtual; + function GetIsOffice11StyleGrouping: Boolean; virtual; + function GetMasterGridRecord: TcxCustomGridRecord; virtual; + function GetRecordCount: Integer; virtual; + function GetViewWidthExtra: Integer; virtual; + { Styles } + function GetCaptionViewParams: TcxViewParams; virtual; + function GetFilterBarViewParams: TcxViewParams; virtual; + function GetRootCaptionParams: TcxViewParams; virtual; + + property Filter: TcxDataFilterCriteria read GetFilter; + property Grid: TcxCustomGrid read GetGrid; + property LookAndFeelKind: TcxLookAndFeelKind read GetLookAndFeelKind; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter; + property Summary: TcxDataSummary read GetSummary; + public + constructor Create(AMasterAdapter: TdxCustomGridViewAdapter; AGridView: TcxCustomGridView); virtual; + + function GridView: TcxCustomGridView; overload; virtual; + class function GridViewClass: TcxCustomGridViewClass; virtual; + function Styles: TcxCustomGridStyles; overload; virtual; + + procedure ExpandAllRows(AnOptionsExpanding: TdxGridReportLinkOptionsExpanding; + ARecursive: Boolean); virtual; + + property AbsoluteLevel: Integer read GetAbsoluteLevel; + property AreAllMasterRowsCollapsed: Boolean read GetAreAllMasterRowsCollapsed; + property AutoWidth: Boolean read GetAutoWidth; + property CanUseOnEveryPageMode: Boolean read GetCanUseOnEveryPageMode; + property CanUseLookAndFeelColors: Boolean read GetCanUseLookAndFeelColors; + property CaptionText: string read GetCaptionText; + property DetailsSeparatorColor: TColor read GetDetailsSeparatorColor; + property DetailsSeparatorThickness: Integer read GetDetailsSeparatorThickness; + property ExpandButtonColor: TColor read GetExpandButtonColor; + property ExpandButtonSize: Integer read GetExpandButtonSize; + property GridLevel: TcxGridLevel read GetGridLevel; + property GridWidth: Integer read GetGridWidth; + property FilterActive: Boolean read GetFilterActive; + property FilterEmpty: Boolean read GetFilterEmpty; + {$IFDEF DXVER500} + property FilterPosition: TcxGridFilterPosition read GetFilterPosition; + {$ENDIF} + property FilterText: string read GetFilterText; + property HasDetailsSeparator: Boolean read GetHasDetailsSeparator; + property HasSelectedRecords: Boolean read GetHasSelectedRecords; + property IndentCount: Integer read GetIndentCount; + property IndentWidth: Integer read GetIndentWidth; + property IsDetail: Boolean read GetIsDetail; + property IsMaster: Boolean read GetIsMaster; + property IsOffice11StyleGrouping: Boolean read GetIsOffice11StyleGrouping; + property MasterAdapter: TdxCustomGridViewAdapter read FMasterAdapter; + property MasterGridLevel: TcxGridLevel read GetMasterGridLevel; + property MasterGridRecord: TcxCustomGridRecord read GetMasterGridRecord; + property RecordCount: Integer read GetRecordCount; + property ThemedCaptionColor: TColor read GetThemedCaptionColor; + property ThemedCaptionTextColor: TColor read GetThemedCaptionTextColor; + property ThemedFilterBarColor: TColor read GetThemedFilterBarColor; + property ThemedFilterBarTextColor: TColor read GetThemedFilterBarTextColor; + property ViewWidth: Integer read GetViewWidth; + property ViewWidthExtra: Integer read GetViewWidthExtra; + end; + + TdxGridViewFormatterClass = class of TdxCustomGridViewFormatter; + + TdxCustomGridViewFormatter = class(TObject, IUnknown) + private + FBuilder: TdxCustomGridViewBuilder; + FCaptionLineHeight: Integer; + FExpandButtons: TList; + FFilterBarLineHeight: Integer; + FFont: TFont; + FLookAndFeelItems: TList; + FTransparentColor: TColor; + function GetAbsoluteLevel: Integer; + function GetAutoWidth: Boolean; + function GetDC: HDC; + function GetEdgeMode: TdxCellEdgeMode; + {$IFDEF DXVER500} + function GetFilterBarPosition: TcxGridFilterPosition; + {$ENDIF} + function GetGridWidth: Integer; + function GetExpandButton(Index: Integer): TdxReportCellExpandButton; + function GetExpandButtonCount: Integer; + function GetIndentWidth: Integer; + function GetLookAndFeelItem(Index: Integer): TdxReportVisualItem; + function GetLookAndFeelItemCount: Integer; + function GetPaginateByTopLevelGroups: Boolean; + function GetRenderer: TdxPSReportRenderer; + function GetReportLink: TdxGridReportLink; + function GetShowCaption: Boolean; + function GetShowFilterBar: Boolean; + function GetUseLookAndFeelColors: Boolean; + function GetViewAvailableWidth: Integer; + function GetViewWidthExtra: Integer; + + procedure FormatLookAndFeelItems; + procedure FormatExpandButtons; + protected + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + procedure AddDelimiters; virtual; + procedure AddHorizontalDelimiters; virtual; + procedure AddVerticalDelimiters; virtual; + + procedure AfterBuilding; virtual; + procedure BeforeBuilding; virtual; + + procedure Calculate; virtual; + procedure CalculateLineHeights; virtual; + + function GetDetailsSeparatorColor: TColor; virtual; + function GetDetailsSeparatorThickness: Integer; virtual; + function GetHasDetailsSeparator: Boolean; virtual; + + function GetSiteHeight: Integer; virtual; + function GetSiteWidth: Integer; virtual; + function GetViewWidth: Integer; virtual; + function GetViewWidthExtraAfter: Integer; virtual; // MD relation considering + function GetViewWidthExtraBefore: Integer; virtual; // MD relation considering + + function BackgroundBitmaps: TcxCustomGridBackgroundBitmaps; overload; virtual; + function GetBackgroundBitmap(Index: Integer): TBitmap; virtual; + function GetBackgroundBitmapIndex(Index: Integer): Integer; + function HasBackgroundBitmap(Index: Integer): Boolean; virtual; + function MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; virtual; + + function CalculateFontHeight(const AParams: TdxReportItemViewParams): Integer; + procedure CalculateHeight(const AParams: TdxReportItemViewParams; var AHeight: Integer); + function GetStyleFontIndex(const AParams: TdxReportItemViewParams): Integer; + function IsColorTransparent(AColor: TColor): Boolean; + procedure RegisterExpandButton(AExpandButton: TdxReportCellExpandButton); + procedure RegisterLookAndFeelItem(AnItem: TdxReportVisualItem; AEdgeStyle: TdxCellEdgeStyle); + procedure SetViewParams(AnItem: TdxReportVisualItem; AGridLines: TcxGridLines; const AParams: TcxViewParams); overload; + procedure SetViewParams(AnItem: TdxReportVisualItem; const AParams: TdxReportItemViewParams); overload; + + property DC: HDC read GetDC; + property EdgeMode: TdxCellEdgeMode read GetEdgeMode; + property ExpandButtonCount: Integer read GetExpandButtonCount; + property ExpandButtons[Index: Integer]: TdxReportCellExpandButton read GetExpandButton; + property GridWidth: Integer read GetGridWidth; + property LookAndFeelItemCount: Integer read GetLookAndFeelItemCount; + property LookAndFeelItems[Index: Integer]: TdxReportVisualItem read GetLookAndFeelItem; + property PaginateByTopLevelGroups: Boolean read GetPaginateByTopLevelGroups; + property Renderer: TdxPSReportRenderer read GetRenderer; + property ReportLink: TdxGridReportLink read GetReportLink; + property SiteHeight: Integer read GetSiteHeight; + property SiteWidth: Integer read GetSiteWidth; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); virtual; + destructor Destroy; override; + + function Adapter: TdxCustomGridViewAdapter; overload; virtual; + function Builder: TdxCustomGridViewBuilder; overload; virtual; + + { Host } + procedure DoInitializeHost(AHost: TdxReportCell); virtual; + function GetHostClass: TdxReportCellClass; virtual; + function GetRowHostClass: TdxReportCellClass; virtual; + + { Caption } + procedure DoInitializeCaption(ACaption: TdxReportCellText); virtual; + procedure DoInitializeCaptionRow(ARow: TdxReportCell); virtual; + procedure DoReportLinkInitializeCaption(ACaption: TdxReportCellText); virtual; + function GetCaptionClass: TdxReportCellTextClass; virtual; + function GetCaptionViewParams: TdxReportItemViewParams; virtual; + + { Filter Box } + procedure DoInitializeFilterBar(AFilterBar: TdxReportCellText); virtual; + procedure DoInitializeFilterBarRow(ARow: TdxReportCell); virtual; + procedure DoReportLinkInitializeFilterBar(AFilterBar: TdxReportCellText); virtual; + function GetFilterBarClass: TdxReportCellTextClass; virtual; + function GetFilterBarViewParams: TdxReportItemViewParams; virtual; + + { Details Separator } + procedure DoInitializeDetailsSeparatorRow(ARow: TdxReportCell); virtual; + procedure DoInitializeHorzDetailsSeparator(ASeparator: TdxReportCellBox); virtual; + procedure DoInitializeVertBottomDetailsSeparator(ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); virtual; + procedure DoInitializeVertDetailsSeparator(ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); virtual; + procedure DoInitializeVertTopDetailsSeparator(ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); virtual; + function GetDetailsSeparatorClass: TdxReportCellBoxClass; virtual; + + { Master Indent } + procedure DoInitializeExpandButton(AnExpandButton: TdxReportCellExpandButton; + ARecord: TcxCustomGridRecord; AnIsMasterIndent: Boolean); + procedure DoInitializeMasterIndent(AnIndent: TdxReportCellExpandButton; AnIndex, AnIndentCount: Integer); virtual; + function GetMasterIndentClass: TdxReportCellExpandButtonClass; virtual; + + { View Terminator } + procedure DoInitializeViewTerminator(ATerminator: TdxReportCellBox); virtual; + + property AbsoluteLevel: Integer read GetAbsoluteLevel; + property AutoWidth: Boolean read GetAutoWidth; + property CaptionLineHeight: Integer read FCaptionLineHeight write FCaptionLineHeight; + property DetailsSeparatorColor: TColor read GetDetailsSeparatorColor; + property DetailsSeparatorThickness: Integer read GetDetailsSeparatorThickness; + property FilterBarLineHeight: Integer read FFilterBarLineHeight write FFilterBarLineHeight; + {$IFDEF DXVER500} + property FilterBarPosition: TcxGridFilterPosition read GetFilterBarPosition; + {$ENDIF} + property HasDetailsSeparator: Boolean read GetHasDetailsSeparator; + property IndentWidth: Integer read GetIndentWidth; + property ShowCaption: Boolean read GetShowCaption; + property ShowFilterBar: Boolean read GetShowFilterBar; + property TransparentColor: TColor read FTransparentColor write FTransparentColor; + property UseLookAndFeelColors: Boolean read GetUseLookAndFeelColors; + property ViewAvailableWidth: Integer read GetViewAvailableWidth; + property ViewWidth: Integer read GetViewWidth; + property ViewWidthExtra: Integer read GetViewWidthExtra; + property ViewWidthExtraAfter: Integer read GetViewWidthExtraAfter; // MD relation considering + property ViewWidthExtraBefore: Integer read GetViewWidthExtraBefore; // MD relation considering + end; + + TdxGridViewBuilderClass = class of TdxCustomGridViewBuilder; + + TdxCustomGridViewBuilder = class(TdxCustomClassMapItem) + private + FAdapter: TdxCustomGridViewAdapter; + FDetailsBuilder: TdxCustomGridViewBuilder; + FFormatter: TdxCustomGridViewFormatter; + FGridView: TcxCustomGridView; + FMasterBuilder: TdxCustomGridViewBuilder; + FProducerCache: TdxProducerCache; + FReportLink: TdxGridReportLink; + FReportRows: TList; + function GetAbsoluteBuilder(AIndex: Integer): TdxCustomGridViewBuilder; + function GetAutoWidth: Boolean; + function GetGridLevel: TcxGridLevel; + function GetGrid: TcxCustomGrid; + function GetHost: TdxReportCell; + function GetHostInfoServices: TdxGridAttributeHostInfoServices; + function GetReportRow(Index: Integer): TdxReportCell; + function GetReportRowCount: Integer; + function GetRootBuilder: TdxCustomGridViewBuilder; + protected + procedure AddReportRow(ARow: TdxReportCell); + + procedure AfterBuilding; virtual; + procedure BeforeBuilding; virtual; + procedure DoBuild; virtual; + procedure DoBuildViewBody; virtual; + procedure DoBuildViewFooter; virtual; + procedure DoBuildViewHeader; virtual; + + function GetViewAvailableWidth: Integer; virtual; + { Caption } + procedure CreateCaption; virtual; + function GetCaptionProducer: TdxGridViewCaptionProducer; virtual; + function GetCaptionProducerClass: TdxGridViewCaptionProducerClass; virtual; + { Details Separator } + procedure CreateBottomDetailsSeparator; virtual; + procedure CreateTopDetailsSeparator; virtual; + function GetDetailsBottomSeparatorProducer: TdxGridViewDetailsSeparatorProducer; virtual; + function GetDetailsBottomSeparatorProducerClass: TdxGridViewDetailsSeparatorProducerClass; virtual; + function GetDetailsTopSeparatorProducer: TdxGridViewDetailsSeparatorProducer; virtual; + function GetDetailsTopSeparatorProducerClass: TdxGridViewDetailsSeparatorProducerClass; virtual; + { Filter Box } + procedure CreateFilterBar; virtual; + function GetFilterBarProducer: TdxGridViewFilterBarProducer; virtual; + function GetFilterBarProducerClass: TdxGridViewFilterBarProducerClass; virtual; + { View Terminator } + procedure CreateViewTerminator; virtual; + function GetViewTerminatorProducer: TdxGridViewTerminatorProducer; virtual; + function GetViewTerminatorProducerClass: TdxGridViewTerminatorProducerClass; virtual; + + function GridView: TcxCustomGridView; overload; virtual; + class function GridViewClass: TcxCustomGridViewClass; virtual; + + property GridLevel: TcxGridLevel read GetGridLevel; + property HostInfoServices: TdxGridAttributeHostInfoServices read GetHostInfoServices; + property ProducerCache: TdxProducerCache read FProducerCache; + property ReportLink: TdxGridReportLink read FReportLink; + public + constructor Create(AReportLink: TdxGridReportLink; AMasterBuilder: TdxCustomGridViewBuilder; + AGridView: TcxCustomGridView); virtual; + destructor Destroy; override; + + function Adapter: TdxCustomGridViewAdapter; overload; virtual; + class function AdapterClass: TdxGridViewAdapterClass; virtual; + class function CreateAdapter(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView): TdxCustomGridViewAdapter; virtual; + + function Formatter: TdxCustomGridViewFormatter; overload; virtual; + class function FormatterClass: TdxGridViewFormatterClass; virtual; + + procedure Build; + function IsAborted: Boolean; + procedure Progress(const APercentDone: Double); + + class function PairClass: TClass; override; + class procedure Register; + class procedure Unregister; + + property AbsoluteBuilders[Index: Integer]: TdxCustomGridViewBuilder read GetAbsoluteBuilder; + property AutoWidth: Boolean read GetAutoWidth; + property DetailsBuilder: TdxCustomGridViewBuilder read FDetailsBuilder; + property Grid: TcxCustomGrid read GetGrid; + property Host: TdxReportCell read GetHost; + property MasterBuilder: TdxCustomGridViewBuilder read FMasterBuilder; + property ReportRowCount: Integer read GetReportRowCount; + property ReportRows[Index: Integer]: TdxReportCell read GetReportRow; + property RootBuilder: TdxCustomGridViewBuilder read GetRootBuilder; + property ViewAvailableWidth: Integer read GetViewAvailableWidth; + end; + + { CustomTableView Adapter and Formatter } + + TdxGridTableAdapterForEachRecordProc = procedure(ARecord: TcxCustomGridRecord; + AData: Integer; var AContinue: Boolean) of object; + + TdxCustomGridTableViewAdapter = class(TdxCustomGridViewAdapter) + private + FDetailsLineCount: Integer; + FRecordHelpersCache: TdxRecordHelpersCache; + function GetCellEndEllipsis: Boolean; + function GetDetailsLineCount: Integer; + function GetFiltering: TcxCustomGridTableFiltering; + function GetIsGridMode: Boolean; + function GetRecord(Index: Integer): TcxCustomGridRecord; + function GetRecordHelper(ARecord: TcxCustomGridRecord): TdxCustomGridRecordHelper; + function GetSelectedRecord(Index: Integer): TcxCustomGridRecord; + function GetSelectedRecordCount: Integer; + protected + function CalculateDetailsLineCount: Integer; virtual; + + function GetContentViewParams(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem; AIsDataCell: Boolean = False): TcxViewParams; virtual; + function GetPreviewViewParams(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem): TcxViewParams; virtual; + function GetSelectionViewParams: TcxViewParams; virtual; + function HasSelectionStyle: Boolean; + + function Controller: TcxCustomGridTableController; reintroduce; overload; + + procedure DoExpandMasterRow(ARecord: TcxCustomGridRecord; AData: Integer; + var AContinue: Boolean); + procedure ExpandAllGroupRows; virtual; + procedure ExpandAllMasterRows(AnExpandGroups: Boolean); virtual; + procedure ExpandAllRowsInItself(AMasterRows, AGroupRows: Boolean); override; + + function GetAreAllMasterRowsCollapsed: Boolean; override; + function GetCanUseOnEveryPageMode: Boolean; override; + function GetCellAutoHeight: Boolean; virtual; + function GetCellMultiline: Boolean; virtual; + {$IFDEF DXVER500} + function GetFilterPosition: TcxGridFilterPosition; override; + {$ENDIF} + function GetGridLineColor: TColor; virtual; + function GetHasSelectedRecords: Boolean; override; + function GetMasterGridRecord: TcxCustomGridRecord; override; + function GetRecordCount: Integer; override; + procedure IsMasterRowCollapsed(ARecord: TcxCustomGridRecord; AData: Integer; + var AContinue: Boolean); + + class function GetProperties(AnItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxCustomEditProperties; virtual; + class function GetPropertiesClass(AnItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxCustomEditPropertiesClass; virtual; + class function GetRepositoryItem(AnItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxEditRepositoryItem; virtual; + + property RecordHelpersCache: TdxRecordHelpersCache read FRecordHelpersCache; + public + constructor Create(AMasterAdapter: TdxCustomGridViewAdapter; AGridView: TcxCustomGridView); override; + destructor Destroy; override; + + function ForEachRecord(AProc: TdxGridTableAdapterForEachRecordProc; AData: Integer; + AProcessSelection: Boolean): Boolean; + + function GridView: TcxCustomGridTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + function Styles: TcxCustomGridTableViewStyles; reintroduce; overload; + + property CellAutoHeight: Boolean read GetCellAutoHeight; + property CellEndEllipsis: Boolean read GetCellEndEllipsis; + property CellMultiline: Boolean read GetCellMultiline; + property DetailsLineCount: Integer read GetDetailsLineCount write FDetailsLineCount; + property Filtering: TcxCustomGridTableFiltering read GetFiltering; + property GridLineColor: TColor read GetGridLineColor; + property IsGridMode: Boolean read GetIsGridMode; + property RecordHelpers[Row: TcxCustomGridRecord]: TdxCustomGridRecordHelper read GetRecordHelper; + property Records[Index: Integer]: TcxCustomGridRecord read GetRecord; + property SelectedRecordCount: Integer read GetSelectedRecordCount; + property SelectedRecords[Index: Integer]: TcxCustomGridRecord read GetSelectedRecord; + end; + + TdxCustomGridTableViewFormatter = class(TdxCustomGridViewFormatter, IdxPSCellParams, IdxPSCellParams2) + private + FRecordIndexes: TList; + FSelectedRecordList: TList; + function GetGridLineColor: TColor; + function GetRecord(Index: Integer): TcxCustomGridRecord; + function GetRecordCount: Integer; + function GetRecordIndex(ARecord: TcxCustomGridRecord): Integer; + function GetSelectedRecord(Index: Integer): TcxCustomGridRecord; + function GetSelectedRecordCount: Integer; + protected + { IdxPSCellParams } + function IdxPSCellParams.GetAutoHeight = IdxPSCellParams_GetAutoHeight; + function IdxPSCellParams.GetDC = IdxPSCellParams_GetDC; + function IdxPSCellParams.GetDisplayGraphicsAsText = IdxPSCellParams_GetDisplayGraphicsAsText; + function IdxPSCellParams.GetEndEllipsis = IdxPSCellParams_GetEndEllipsis; + function IdxPSCellParams.GetFlatCheckMarks = IdxPSCellParams_GetFlatCheckMarks; + function IdxPSCellParams.GetGraphicsText = IdxPSCellParams_GetGraphicsText; + function IdxPSCellParams.GetMultiline = IdxPSCellParams_GetMultiline; + function IdxPSCellParams.GetTransparentGraphics = IdxPSCellParams_GetTransparentGraphics; + function IdxPSCellParams_GetAutoHeight: Boolean; virtual; + function IdxPSCellParams_GetDC: HDC; virtual; + function IdxPSCellParams_GetDisplayGraphicsAsText: Boolean; virtual; + function IdxPSCellParams_GetEndEllipsis: Boolean; virtual; + function IdxPSCellParams_GetFlatCheckMarks: Boolean; virtual; + function IdxPSCellParams_GetGraphicsText: string; virtual; + function IdxPSCellParams_GetMultiline: Boolean; virtual; + function IdxPSCellParams_GetTransparentGraphics: Boolean; virtual; + { IdxPSCellParams2 } + function IdxPSCellParams2.GetPreviewMarginLeft = IdxPSCellParams2_GetPreviewMarginLeft; + function IdxPSCellParams2.GetPreviewMarginRight = IdxPSCellParams2_GetPreviewMarginRight; + function IdxPSCellParams2.GetPreviewMaxHeight = IdxPSCellParams2_GetPreviewMaxHeight; + function IdxPSCellParams2.GetPreviewMaxLineCount = IdxPSCellParams2_GetPreviewMaxLineCount; + function IdxPSCellParams2.GetRichEditGraphicClass = IdxPSCellParams2_GetRichEditGraphicClass; + function IdxPSCellParams2.GetRichEditTransparent = IdxPSCellParams2_GetRichEditTransparent; + function IdxPSCellParams2_GetPreviewMarginLeft: Integer; virtual; + function IdxPSCellParams2_GetPreviewMarginRight: Integer; virtual; + function IdxPSCellParams2_GetPreviewMaxHeight: Integer; virtual; + function IdxPSCellParams2_GetPreviewMaxLineCount: Integer; virtual; + function IdxPSCellParams2_GetRichEditGraphicClass: TGraphicClass; virtual; + function IdxPSCellParams2_GetRichEditTransparent: Boolean; virtual; + + procedure AfterBuilding; override; + procedure BeforeBuilding; override; + + procedure BuildSelectedRecordList; virtual; + function CanProcessSelectionStyle(ARecord: TcxCustomGridRecord): Boolean; + function IsSelectedRecord(ARecord: TcxCustomGridRecord): Boolean; virtual; + + function GetContentBackgroundBitmapStyleIndex(ATableItem: TcxCustomGridTableItem): Integer; virtual; + function MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; override; + + property SelectedRecordList: TList read FSelectedRecordList; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); override; + destructor Destroy; override; + + function Adapter: TdxCustomGridTableViewAdapter; reintroduce; overload; + function Builder: TdxCustomGridTableViewBuilder; reintroduce; overload; + + function IndexOfRecord(ARecord: TcxCustomGridRecord): Integer; + + { Items } + procedure CheckDisplayValuePost(AProperties: TcxCustomEditProperties; + ATableItem: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord; AnItem: TAbstractdxReportCellData); + procedure DoInitializeItem(AnItem: TAbstractdxReportCellData; ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False); virtual; + function GetItemClass(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False): TdxReportCellDataClass; virtual; + function GetItemProperties(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxCustomEditProperties; virtual; + function GetItemValue(AProperties: TcxCustomEditProperties; ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxEditValue; virtual; + function GetItemViewParams(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False; AIsDataCell: Boolean = False): TdxReportItemViewParams; virtual; + + property GridLineColor: TColor read GetGridLineColor; + property RecordCount: Integer read GetRecordCount; + property RecordIndexes[ARecord: TcxCustomGridRecord]: Integer read GetRecordIndex; + property Records[Index: Integer]: TcxCustomGridRecord read GetRecord; + property SelectedRecordCount: Integer read GetSelectedRecordCount; + property SelectedRecords[Index: Integer]: TcxCustomGridRecord read GetSelectedRecord; + end; + + TdxCustomGridTableViewBuilder = class(TdxCustomGridViewBuilder) + protected + procedure DoBuildViewFooter; override; + procedure DoBuildViewHeader; override; + + procedure DoGetCellHeight(ARecord: TcxCustomGridRecord; ATableItem: TcxCustomGridTableItem; + var AHeight: Integer); + + function GridView: TcxCustomGridTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + public + function Adapter: TdxCustomGridTableViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + function Formatter: TdxCustomGridTableViewFormatter; reintroduce; overload; + class function FormatterClass: TdxGridViewFormatterClass; override; + end; + + { GridTableView Adapter, Formatter and Builder } + + TdxGridTableViewAdapter = class(TdxCustomGridTableViewAdapter) + private + function GetColumn(Index: Integer): TcxGridColumn; + function GetColumnCount: Integer; + function GetFooterItemText(Index: Integer): string; + function GetFooterMultiline: Boolean; + function GetFooterMultiSummaries: Boolean; + function GetGridLines: TcxGridLines; + function GetGroupFooterMultiSummaries: Boolean; + function GetGroupedColumn(Index: Integer): TcxGridColumn; + function GetGroupedColumnCount: Integer; + function GetGroupFootersMode: TcxGridGroupFootersMode; + function GetGroupFootersMultiline: Boolean; + function GetGroupRowSeparatorColor: TColor; + function GetGroupRowSeparatorThickness: Integer; + function GetHasFooterItem(Index: Integer): Boolean; + function GetHasPreview: Boolean; + function GetHasRowSeparators: Boolean; + function GetHeaderEndEllipsis: Boolean; + function GetInternalColumnMinWidth(Column: TcxGridColumn): Integer; + function GetInternalColumnWidth(Column: TcxGridColumn): Integer; + function GetPreviewColumn: TcxGridColumn; + function GetPreviewLeftIndent: Integer; + function GetPreviewPlace: TcxGridPreviewPlace; + function GetPreviewRightIndent: Integer; + function GetRow(Index: Integer): TcxCustomGridRow; + function GetRowCount: Integer; + function GetRowSeparatorColor: TColor; + function GetRowSeparatorThickness: Integer; + function GetShowExpandButtonsForEmptyDetails: Boolean; + function GetShowHorzGridLines: Boolean; + function GetShowVertGridLines: Boolean; + function GetThemedFooterItemColor: TColor; + function GetThemedFooterItemTextColor: TColor; + function GetThemedHeaderItemColor: TColor; + function GetThemedHeaderItemTextColor: TColor; + protected + function Controller: TcxGridTableController; reintroduce; overload; + function DataController: TcxGridDataController; reintroduce; overload; + + function GetAutoWidth: Boolean; override; + function GetCellAutoHeight: Boolean; override; + function GetCellMultiline: Boolean; override; + function GetGridLineColor: TColor; override; + function GetHeaderAutoHeight: Boolean; virtual; + function GetHeaderMultiline(Column: TcxGridColumn): Boolean; virtual; + function GetIndentCount: Integer; override; + function GetIndentWidth: Integer; override; + function GetIndicatorWidth: Integer; virtual; + function GetIsOffice11StyleGrouping: Boolean; override; + function GetViewWidthExtra: Integer; override; + + function GetDataRowHeight: Integer; virtual; + function GetDataRowHeightAssigned: Boolean; virtual; + function GetFooterHeight: Integer; virtual; + function GetFooterHeightAssigned: Boolean; virtual; + function GetGroupFooterHeight: Integer; virtual; + function GetGroupFooterHeightAssigned: Boolean; virtual; + function GetGroupRowHeight: Integer; virtual; + function GetGroupRowHeightAssigned: Boolean; virtual; + function GetHeaderHeight: Integer; virtual; + function GetHeaderHeightAssigned: Boolean; virtual; + function GetRowLineCount: Integer; virtual; + + { Styles } + function GetFilterBarViewParams: TcxViewParams; override; + function GetFooterViewParams(ARecord: TcxCustomGridRecord; AGroupLevel: Integer; + AColumn: TcxGridColumn; AItem: TcxDataSummaryItem): TcxViewParams; virtual; + function GetGroupRowViewParams(ARecord: TcxCustomGridRecord; + AGroupLevel: Integer): TcxViewParams; virtual; + function GetHeaderViewParams(AColumn: TcxGridColumn): TcxViewParams; virtual; + function GetPreviewViewParams(ARecord: TcxCustomGridRecord; + AnItem: TcxCustomGridTableItem): TcxViewParams; override; + + property InternalColumnMinWidths[Column: TcxGridColumn]: Integer read GetInternalColumnMinWidth; + property InternalColumnWidths[Column: TcxGridColumn]: Integer read GetInternalColumnWidth; + public + constructor Create(AMasterAdapter: TdxCustomGridViewAdapter; AGridView: TcxCustomGridView); override; + + function GridView: TcxGridTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + function Styles: TcxGridTableViewStyles; reintroduce; overload; + + function HasDetails(AGridRow: TcxCustomGridRow): Boolean; + + function IsSummaryHasSameLink(AItem1, AItem2: TcxDataSummaryItem): Boolean; + function CheckSummaryItemIndex(AItems: TcxDataSummaryItems; AIndex: Integer): Integer; + function GetFooterItemCount(AItems: TcxDataSummaryItems; ACanMultiLine: Boolean): Integer; + function GetFooterItemInfo(AItems: TcxDataSummaryItems; AIndex: Integer; var ARowIndex: Integer): Integer; + function GetFooterLineCount(AItems: TcxDataSummaryItems; ACanMultiLine: Boolean): Integer; + + function GetGroupFooterCount(AGridRow: TcxCustomGridRow): Integer; + function GetGroupFooterItemText(ARowIndex, ALevel, AIndex: Integer): string; + function HasGroupFooter(AGridRow: TcxCustomGridRow; ALevel: Integer): Boolean; + function HasGroupFooterItem(ALevel, AIndex: Integer): Boolean; + function HasGroupFooters(AGridRow: TcxCustomGridRow): Boolean; + + property ColumnCount: Integer read GetColumnCount; + property Columns[Index: Integer]: TcxGridColumn read GetColumn; + property DataRowHeight: Integer read GetDataRowHeight; + property DataRowHeightAssigned: Boolean read GetDataRowHeightAssigned; + property FooterHeight: Integer read GetFooterHeight; + property FooterHeightAssigned: Boolean read GetFooterHeightAssigned; + property FooterItemTexts[Index: Integer]: string read GetFooterItemText; + property FooterMultiSummaries: Boolean read GetFooterMultiSummaries; + property FooterMultiline: Boolean read GetFooterMultiline; + property GridLines: TcxGridLines read GetGridLines; + property GroupedColumnCount: Integer read GetGroupedColumnCount; + property GroupedColumns[Index: Integer]: TcxGridColumn read GetGroupedColumn; + property GroupFooterHeight: Integer read GetGroupFooterHeight; + property GroupFooterHeightAssigned: Boolean read GetGroupFooterHeightAssigned; + property GroupFooterMultiSummaries: Boolean read GetGroupFooterMultiSummaries; + property GroupFootersMode: TcxGridGroupFootersMode read GetGroupFootersMode; + property GroupFootersMultiline: Boolean read GetGroupFootersMultiline; + property GroupRowHeight: Integer read GetGroupRowHeight; + property GroupRowHeightAssigned: Boolean read GetGroupRowHeightAssigned; + property GroupRowSeparatorColor: TColor read GetGroupRowSeparatorColor; + property GroupRowSeparatorThickness: Integer read GetGroupRowSeparatorThickness; + property HasFooterItem[Index: Integer]: Boolean read GetHasFooterItem; + property HasPreview: Boolean read GetHasPreview; + property HasRowSeparators: Boolean read GetHasRowSeparators; + property HeaderAutoHeight: Boolean read GetHeaderAutoHeight; + property HeaderEndEllipsis: Boolean read GetHeaderEndEllipsis; + property HeaderHeight: Integer read GetHeaderHeight; + property HeaderHeightAssigned: Boolean read GetHeaderHeightAssigned; + property HeaderMultilines[Column: TcxGridColumn]: Boolean read GetHeaderMultiline; + property IndicatorWidth: Integer read GetIndicatorWidth; + property PreviewColumn: TcxGridColumn read GetPreviewColumn; + property PreviewLeftIndent: Integer read GetPreviewLeftIndent; + property PreviewPlace: TcxGridPreviewPlace read GetPreviewPlace; + property PreviewRightIndent: Integer read GetPreviewRightIndent; + property RowCount: Integer read GetRowCount; + property RowLineCount: Integer read GetRowLineCount; + property Rows[Index: Integer]: TcxCustomGridRow read GetRow; + property RowSeparatorColor: TColor read GetRowSeparatorColor; + property RowSeparatorThickness: Integer read GetRowSeparatorThickness; + property ShowExpandButtonsForEmptyDetails: Boolean read GetShowExpandButtonsForEmptyDetails; + property ShowHorzGridLines: Boolean read GetShowHorzGridLines; + property ShowVertGridLines: Boolean read GetShowVertGridLines; + property ThemedFooterItemColor: TColor read GetThemedFooterItemColor; + property ThemedFooterItemTextColor: TColor read GetThemedFooterItemTextColor; + property ThemedHeaderItemColor: TColor read GetThemedHeaderItemColor; + property ThemedHeaderItemTextColor: TColor read GetThemedHeaderItemTextColor; + end; + + TdxCustomGridTableViewItemPlaceControllerClass = class of TdxCustomGridTableViewItemPlaceController; + + TdxCustomGridTableViewItemPlaceController = class + private + FFormatter: TdxGridTableViewFormatter; + FHeaderLineCount: Integer; + FWidth: Integer; + function GetHeaderLineCount: Integer; + function GetWidth: Integer; + procedure SetWidth(Value: Integer); + protected + function CalculateWidth: Integer; virtual; + function CalculateHeaderLineCount: Integer; virtual; + function GetItemByColumn(Column: TcxGridColumn): TdxGridTableViewColumnPlace; virtual; + procedure WidthChanged; virtual; + public + constructor Create(AFormatter: TdxGridTableViewFormatter); virtual; + + procedure Calculate; virtual; + procedure Refresh; virtual; + + property Formatter: TdxGridTableViewFormatter read FFormatter; + property HeaderLineCount: Integer read GetHeaderLineCount; + property ItemsByColumn[Column: TcxGridColumn]: TdxGridTableViewColumnPlace read GetItemByColumn; default; + property Width: Integer read GetWidth write SetWidth; + end; + + TdxGridTableViewColumnPlaceClass = class of TdxGridTableViewColumnPlace; + + TdxGridTableViewColumnPlace = class + private + FColumn: TcxGridColumn; + FController: TdxGridTableViewColumnPlaceController; + FLeftBound: Integer; + FWidth: Integer; + function GetAdapter: TdxGridTableViewAdapter; + function GetCellBounds(RowIndex: Integer): TRect; + function GetCellHeight(RowIndex: Integer): Integer; + function GetFooterCellBounds: TRect; + function GetFooterLineHeight: Integer; + function GetFormatter: TdxGridTableViewFormatter; + function GetGroupFooterCellBounds(IndentCount: Integer): TRect; + function GetGroupFooterLineHeight: Integer; + function GetHeaderCellBounds: TRect; + function GetHeaderLineHeight: Integer; + function GetIndex: Integer; + function GetIsFixed: Boolean; + function GetLeftBound: Integer; + function GetMinWidth: Integer; + function GetOriginalWidth: Integer; + function GetWidth: Integer; + protected + function CalculateLeftBound: Integer; virtual; + function GetLineCount: Integer; virtual; + function GetRowIndex: Integer; virtual; + procedure InitAutoWidthItem(AnItem: TcxAutoWidthItem); virtual; + + property Adapter: TdxGridTableViewAdapter read GetAdapter; + property Formatter: TdxGridTableViewFormatter read GetFormatter; + property IsFixed: Boolean read GetIsFixed; + property LineCount: Integer read GetLineCount; + property MinWidth: Integer read GetMinWidth; + property OriginalWidth: Integer read GetOriginalWidth; + property RowIndex: Integer read GetRowIndex; + public + constructor Create(AController: TdxGridTableViewColumnPlaceController; AColumn: TcxGridColumn); virtual; + procedure Calculate(ALeftBound: Integer); virtual; + + property CellBounds[RowIndex: Integer]: TRect read GetCellBounds; + property CellHeights[RowIndex: Integer]: Integer read GetCellHeight; + property Column: TcxGridColumn read FColumn; + property Controller: TdxGridTableViewColumnPlaceController read FController; + property FooterCellBounds: TRect read GetFooterCellBounds; + property FooterLineHeight: Integer read GetFooterLineHeight; + property GroupFooterCellBounds[IndentCount: Integer]: TRect read GetGroupFooterCellBounds; + property GroupFooterLineHeight: Integer read GetGroupFooterLineHeight; + property HeaderCellBounds: TRect read GetHeaderCellBounds; + property HeaderLineHeight: Integer read GetHeaderLineHeight; + property Index: Integer read GetIndex; + property LeftBound: Integer read GetLeftBound write FLeftBound; + property Width: Integer read GetWidth write FWidth; + end; + + TdxGridTableViewColumnPlaceController = class(TdxCustomGridTableViewItemPlaceController) + private + FColumnIndexes: TList; + FItems: TList; + function GetAdapter: TdxGridTableViewAdapter; + function GetColumnIndex(Column: TcxGridColumn): Integer; + function GetItem(Index: Integer): TdxGridTableViewColumnPlace; + function GetItemCount: Integer; + procedure FreeAndNilItems; + protected + function CalculateWidth: Integer; override; + function GetItemByColumn(Column: TcxGridColumn): TdxGridTableViewColumnPlace; override; + + procedure AddItems; virtual; + procedure ClearItems; + function CreateItem(AColumn: TcxGridColumn): TdxGridTableViewColumnPlace; virtual; + function GetItemClass(AColumn: TcxGridColumn): TdxGridTableViewColumnPlaceClass; virtual; + + function CalculateItemLeftBound(AnItem: TdxGridTableViewColumnPlace): Integer; virtual; + procedure CalculateItemsWidth; virtual; + + function GetItemsAutoWidth: Boolean; virtual; + function GetItemsAvailableWidth: Integer; virtual; + + property Adapter: TdxGridTableViewAdapter read GetAdapter; + property ItemsAutoWidth: Boolean read GetItemsAutoWidth; + property ItemsAvailableWidth: Integer read GetItemsAvailableWidth; + public + constructor Create(AFormatter: TdxGridTableViewFormatter); override; + destructor Destroy; override; + + procedure Calculate; override; + procedure Refresh; override; + + function IndexOf(AnItem: TdxGridTableViewColumnPlace): Integer; overload; + function IndexOf(AColumn: TcxGridColumn): Integer; overload; + + property ColumnIndexes[Column: TcxGridColumn]: Integer read GetColumnIndex; + property ItemCount: Integer read GetItemCount; + property Items[Index: Integer]: TdxGridTableViewColumnPlace read GetItem; default; + end; + + TdxGridTableViewReportDataAdapter = class + private + FBuilder: TdxCustomGridViewBuilder; + function GetReportItem(Row: TcxCustomGridRow; Column: TcxGridColumn): TdxReportVisualItem; + function GetReportRow(Index: Integer): TdxReportCell; + function GetReportRowByGridRow(Row: TcxCustomGridRow): TdxReportCell; + function GetReportRowCount: Integer; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); virtual; + + property Builder: TdxCustomGridViewBuilder read FBuilder; + property ReportItems[Row: TcxCustomGridRow; Column: TcxGridColumn]: TdxReportVisualItem read GetReportItem; + property ReportRowCount: Integer read GetReportRowCount; + property ReportRows[Index: Integer]: TdxReportCell read GetReportRow; default; + property ReportRowsByGridRow[Row: TcxCustomGridRow]: TdxReportCell read GetReportRowByGridRow; + end; + + TdxGridTableViewFormatter = class(TdxCustomGridTableViewFormatter) + private + FColumns: TList; + FDetailsLineHeight: Integer; + FFooterLineHeight: Integer; + FGroupFooterLineHeight: Integer; + FGroupRowLineHeight: Integer; + FHeaderLineHeight: Integer; + FItemPlaceController: TdxCustomGridTableViewItemPlaceController; + FPreviewLineHeight: Integer; + FReportDataAdapter: TdxGridTableViewReportDataAdapter; + FRowHeights: TList; + function GetColumn(Index: Integer): TcxGridColumn; + function GetColumnCount: Integer; + function GetGroupRowSeparatorColor: TColor; + function GetGroupRowSeparatorThickness: Integer; + function GetHasPreview: Boolean; + function GetHeaderLineCount: Integer; + function GetPreviewAutoHeight: Boolean; + function GetPreviewColumn: TcxGridColumn; + function GetPreviewMaxLineCount: Integer; + function GetRow(Index: Integer): TcxCustomGridRow; + function GetRowCount: Integer; + function GetRowHeight(Index: Integer): Integer; + function GetRowHeightByRow(Row: TcxCustomGridRow): Integer; + function GetRowSeparatorColor: TColor; + function GetRowSeparatorThickness: Integer; + function GetShowGroupFooters: Boolean; + function GetShowFooters: Boolean; + function GetShowHeaders: Boolean; + function GetShowPreview: Boolean; + procedure SetRowHeight(Index: Integer; Value: Integer); + procedure SetRowHeightByRow(Row: TcxCustomGridRow; Value: Integer); + protected + { IdxPSCellParams2 } + function IdxPSCellParams2_GetPreviewMarginLeft: Integer; override; + function IdxPSCellParams2_GetPreviewMarginRight: Integer; override; + function IdxPSCellParams2_GetPreviewMaxHeight: Integer; override; + function IdxPSCellParams2_GetPreviewMaxLineCount: Integer; override; + + procedure AddHorizontalDelimiters; override; + {$IFDEF DXVER500} + procedure AfterBuilding; override; + {$ENDIF} + procedure BeforeBuilding; override; + procedure Calculate; override; + procedure CalculateDataRowHeights; virtual; + procedure CalculateLineHeights; override; + + function GetAlignSummaryWithColumns: Boolean; virtual; + function GetItemPlaceControllerClass: TdxCustomGridTableViewItemPlaceControllerClass; virtual; + function MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; override; + + {$IFDEF DXVER500} + function CanCellMerging: Boolean; virtual; + function CanColumnCellMerging(AColumn: TcxGridColumn): Boolean; virtual; + procedure PerformCellMerging; virtual; + procedure PerformColumnCellMerging(AColumn: TcxGridColumn); virtual; + {$ENDIF} + + // actual columns used inside building (depends on ActualVisibility of columns and selection status) + procedure BuildColumnList; virtual; + procedure BuildItemLists; virtual; + function IsColumnActuallyVisible(AColumn: TcxGridColumn): Boolean; virtual; + + function GetViewWidth: Integer; override; + + property ItemPlaceController: TdxCustomGridTableViewItemPlaceController read FItemPlaceController; + property ReportDataAdapter: TdxGridTableViewReportDataAdapter read FReportDataAdapter; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); override; + destructor Destroy; override; + + function Adapter: TdxGridTableViewAdapter; reintroduce; overload; + function Builder: TdxGridTableViewBuilder; reintroduce; overload; + + { Footers } + procedure DoInitializeFooterItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer; AItem: TcxDataSummaryItem); virtual; + procedure DoInitializeFooterRow(ARow: TdxReportCell); virtual; + procedure DoReportLinkInitializeFooterItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + function GetFooterItemBounds(AnIndex: Integer): TRect; virtual; + function GetFooterItemClass(AnIndex: Integer): TdxReportCellTextClass; virtual; + function GetFooterItemViewParams(AColumn: TcxGridColumn; AItem: TcxDataSummaryItem): TdxReportItemViewParams; virtual; + + { Group Footers } + procedure DoInitializeGroupFooterHost(AnItem: TdxReportVisualItem; ARecord: TcxCustomGridRecord; AGroupLevel: Integer); virtual; + procedure DoInitializeGroupFooterItem(AnItem: TAbstractdxReportCellData; ARecord: TcxCustomGridRecord; + AGroupLevel: Integer; const AValue: Variant; AItem: TcxDataSummaryItem); virtual; + procedure DoInitializeGroupFooterRow(ARow: TdxReportCell; + ARecord: TcxCustomGridRecord; AGroupLevel: Integer); virtual; + procedure DoReportLinkInitializeGroupFooterItem(AnItem: TAbstractdxReportCellData; + AColumn: TcxGridColumn; ARecord: TcxCustomGridRecord; AGroupLevel: Integer); virtual; + function GetGroupFooterItemClass(AnIndex: Integer): TdxReportCellTextClass; virtual; + function GetGroupFooterItemBounds(AnIndex, AGroupLevel: Integer): TRect; virtual; + function GetGroupFooterItemViewParams(ARecord: TcxCustomGridRecord; AGroupLevel: Integer; + AColumn: TcxGridColumn; AItem: TcxDataSummaryItem): TdxReportItemViewParams; virtual; + + { Group Row } + procedure DoInitializeGroupRowItem(AnItem: TAbstractdxReportCellData; ARow: TcxGridGroupRow; + AIndex: Integer; const AText: string); virtual; + procedure DoInitializeGroupRow(ARow: TdxReportCell; ARecord: TcxCustomGridRecord); virtual; + function GetGroupRowClass: TdxReportCellTextClass; virtual; + function GetGroupRowViewParams(ARecord: TcxCustomGridRecord; ALevel: Integer): TdxReportItemViewParams; virtual; + + { Group Row Separator - Office11 Grouping Style } + procedure DoInitializeGroupRowSeparator(ASeparator: TAbstractdxReportCellData); virtual; + procedure DoInitializeGroupSeparatorRow(ARow: TdxReportCell); virtual; + function GetGroupRowSeparatorClass: TdxReportCellDataClass; virtual; + + { Headers } + procedure DoInitializeHeaderItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + procedure DoInitializeHeaderRow(ARow: TdxReportCell); virtual; + procedure DoReportLinkInitializeHeaderItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + function GetHeaderItemBounds(AnIndex: Integer): TRect; virtual; + function GetHeaderItemClass(AnIndex: Integer): TdxReportCellTextClass; virtual; + function GetHeaderItemViewParams(AColumn: TcxGridColumn): TdxReportItemViewParams; virtual; + + { Indents and Expand Buttons } + function CreateIndent(AParent: TdxReportCell): TdxReportCellExpandButton; virtual; + procedure DoInitializeDataRowIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); virtual; + procedure DoInitializeGroupFooterIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); virtual; + procedure DoInitializeGroupRowIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); virtual; + procedure DoInitializeMasterDataRowIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); virtual; + procedure DoInitializeRowSeparatorIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); virtual; + function GetIndentClass: TdxReportCellExpandButtonClass; virtual; + function GetIndentViewParams(ARecord: TcxCustomGridRecord; + AnIndex, AnIndentCount: Integer; ANonRecordIndent: Boolean): TdxReportItemViewParams; virtual; + function HasExpandButton(ARecord: TcxCustomGridRecord): Boolean; virtual; + + { Items } + procedure DoInitializeDataRow(ARow: TdxReportCell; ARecord: TcxCustomGridRecord); virtual; + procedure DoReportLinkInitializeItem(AnItem: TAbstractdxReportCellData; + AColumn: TcxGridColumn; ARecord: TcxCustomGridRecord); virtual; + function GetItemBounds(AGridRow: TcxCustomGridRow; + AGridRowIndex, AColumnIndex: Integer): TRect; virtual; + function GetItemViewParams(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False; AIsDataCell: Boolean = False): TdxReportItemViewParams; override; + + { Master Indent } + procedure DoInitializeMasterIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer); override; + + { Preview } + procedure DoInitializePreview(APreview: TAbstractdxReportCellData; AColumn: TcxGridColumn; + ARecord: TcxCustomGridRecord); virtual; + function GetPreviewClass(AColumn: TcxGridColumn; + ARecord: TcxCustomGridRecord): TdxReportCellDataClass; virtual; + function GetPreviewViewParams(AColumn: TcxGridColumn; + ARecord: TcxCustomGridRecord): TdxReportItemViewParams; virtual; + + { Row Separator } + procedure DoInitializeSeparatorRow(ARow: TdxReportCell); virtual; + procedure DoInitializeRowSeparator(ASeparator: TAbstractdxReportCellData); virtual; + function GetRowSeparatorClass: TdxReportCellDataClass; virtual; + + function GetReportItem(ARow: TcxCustomGridRow; AColumn: TcxGridColumn): TdxReportVisualItem; + + property AlignSummaryWithColumns: Boolean read GetAlignSummaryWithColumns; + property ColumnCount: Integer read GetColumnCount; + property Columns[Index: Integer]: TcxGridColumn read GetColumn; + property DetailsLineHeight: Integer read FDetailsLineHeight write FDetailsLineHeight; + property FooterLineHeight: Integer read FFooterLineHeight write FFooterLineHeight; + property GroupFooterLineHeight: Integer read FGroupFooterLineHeight write FGroupFooterLineHeight; + property GroupRowLineHeight: Integer read FGroupRowLineHeight write FGroupRowLineHeight; + property GroupRowSeparatorColor: TColor read GetGroupRowSeparatorColor; + property GroupRowSeparatorThickness: Integer read GetGroupRowSeparatorThickness; + property HasPreview: Boolean read GetHasPreview; + property HeaderLineCount: Integer read GetHeaderLineCount; + property HeaderLineHeight: Integer read FHeaderLineHeight write FHeaderLineHeight; + property PreviewAutoHeight: Boolean read GetPreviewAutoHeight; + property PreviewColumn: TcxGridColumn read GetPreviewColumn; + property PreviewLineHeight: Integer read FPreviewLineHeight write FPreviewLineHeight; + property PreviewMaxLineCount: Integer read GetPreviewMaxLineCount; + property RowCount: Integer read GetRowCount; + property RowHeights[Index: Integer]: Integer read GetRowHeight write SetRowHeight; + property RowHeightsByRow[Row: TcxCustomGridRow]: Integer read GetRowHeightByRow write SetRowHeightByRow; + property Rows[Index: Integer]: TcxCustomGridRow read GetRow; + property RowSeparatorColor: TColor read GetRowSeparatorColor; + property RowSeparatorThickness: Integer read GetRowSeparatorThickness; + property ShowGroupFooters: Boolean read GetShowGroupFooters; + property ShowFooters: Boolean read GetShowFooters; + property ShowHeaders: Boolean read GetShowHeaders; + property ShowPreview: Boolean read GetShowPreview; + end; + + TdxGridTableViewBuilder = class(TdxCustomGridTableViewBuilder) + private + function GetLastReportRow: TdxReportCell; + function GetProcessedView: TcxCustomGridView; + procedure SetProcessedView(Value: TcxCustomGridView); + protected + procedure AddDelimitersHardVert(AReportRow: TdxReportCell); + + procedure DoBuildViewBody; override; + procedure DoBuildViewFooter; override; + + { Details View } + procedure CreateDetails(AMasterRow: TcxGridMasterDataRow); virtual; + procedure CreateDetailView(AGridView: TcxCustomGridView); virtual; + function GetAreDetailsBuilt: Boolean; virtual; + + { Footer } + procedure CreateFooter; virtual; + function GetFootersProducer: TdxGridTableViewFootersProducer; virtual; + function GetFootersProducerClass: TdxGridTableViewFootersProducerClass; virtual; + + { Group Footer } + procedure CreateGroupFooters(AGridRow: TcxCustomGridRow); virtual; + function GetGroupFooterProducer: TdxGridTableViewGroupFooterProducer; virtual; + function GetGroupFooterProducerClass: TdxGridTableViewGroupFooterProducerClass; virtual; + + { Header } + procedure CreateHeader; virtual; + function GetHeadersProducer: TdxGridTableViewHeadersProducer; virtual; + function GetHeadersProducerClass: TdxGridTableViewHeadersProducerClass; virtual; + + { Rows } + procedure CreateRow(AGridRow: TcxCustomGridRow; ARowIndex: Integer); virtual; + procedure CreateRows; virtual; + function GetRowProducer(AGridRow: TcxCustomGridRow): TdxGridTableViewCustomDataRowProducer; virtual; + function GetRowProducerClass(AGridRow: TcxCustomGridRow): TdxGridTableViewCustomDataRowProducerClass; virtual; + + { Row Separators } + procedure CreateRowSeparator(AGridRow: TcxCustomGridRow; AnIsLast: Boolean = False); virtual; + function GetRowSeparatorProducer: TdxGridTableViewRowSeparatorProducer; virtual; + function GetRowSeparatorProducerClass: TdxGridTableViewRowSeparatorProducerClass; virtual; + function GetShowRowSeparators: Boolean; virtual; + + { GroupRow Separators } + procedure CreateGroupRowSeparator(AGridRow: TcxGridGroupRow); virtual; + function GetGroupRowSeparatorProducer: TdxGridTableViewGroupRowSeparatorProducer; virtual; + function GetGroupRowSeparatorProducerClass: TdxGridTableViewGroupRowSeparatorProducerClass; virtual; + function GetShowGroupRowSeparators: Boolean; virtual; + + function GridView: TcxGridTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + + property LastReportRow: TdxReportCell read GetLastReportRow; + property ProcessedView: TcxCustomGridView read GetProcessedView write SetProcessedView; + public + function Adapter: TdxGridTableViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + function Formatter: TdxGridTableViewFormatter; reintroduce; overload; + class function FormatterClass: TdxGridViewFormatterClass; override; + + property AreDetailsBuilt: Boolean read GetAreDetailsBuilt; + property ShowGroupRowSeparators: Boolean read GetShowGroupRowSeparators; + property ShowRowSeparators: Boolean read GetShowRowSeparators; + end; + + { DBTableView Adapter, Formatter and Builder } + + TdxGridDBTableViewAdapter = class(TdxGridTableViewAdapter) + private + FPrevAllRecordsAreLoaded: Boolean; + protected + procedure AfterBuilding; override; + procedure BeforeBuilding; override; + function DataController: TcxGridDBDataController; reintroduce; overload; + + function DBDataModeController: TcxDBDataModeController; virtual; + procedure LoadAllRecords; virtual; + procedure UnloadAllRecords; virtual; + public + function GridView: TcxGridDBTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + end; + + TdxGridDBTableViewBuilder = class(TdxGridTableViewBuilder) + public + function Adapter: TdxGridDBTableViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + end; + + { BandedTableView Adapter, Formatter and Builder } + + TdxGridBandedTableViewAdapter = class(TdxGridTableViewAdapter) + private + FFooterLineCount: Integer; + function GetBand(Index: Integer): TcxGridBand; + function GetBandCount: Integer; + function GetBandEndEllipsis: Boolean; + function GetBandHeaderLineCount: Integer; + function GetBandHeaderMultiline: Boolean; + function GetBottomBand(Index: Integer): TcxGridBand; + function GetBottomBandCount: Integer; + function GetColumn(Index: Integer): TcxGridBandedColumn; + function GetFooterLineCount: Integer; + function GetRootBand(Index: Integer): TcxGridBand; + function GetRootBandCount: Integer; + function GetThemedBandHeaderItemColor: TColor; + function GetThemedBandHeaderItemTextColor: TColor; + protected + function CalculateDetailsLineCount: Integer; override; + function CalculateFooterLineCount: Integer; virtual; + + function GetBandHeaderHeight: Integer; virtual; + function GetBandHeaderHeightAssigned: Boolean; virtual; + function GetBandHeaderViewParams(ABand: TcxGridBand): TcxViewParams; virtual; + function GetDataRowHeightAssigned: Boolean; override; + function GetFooterHeightAssigned: Boolean; override; + function GetHeaderHeightAssigned: Boolean; override; + function GetHeaderMultiline(Column: TcxGridColumn): Boolean; override; + function GetRowLineCount: Integer; override; + public + constructor Create(AMasterAdapter: TdxCustomGridViewAdapter; AGridView: TcxCustomGridView); override; + + function GridView: TcxGridBandedTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + function Styles: TcxGridBandedTableViewStyles; reintroduce; overload; + + property BandCount: Integer read GetBandCount; + property BandEndEllipsis: Boolean read GetBandEndEllipsis; + property BandHeaderHeight: Integer read GetBandHeaderHeight; + property BandHeaderHeightAssigned: Boolean read GetBandHeaderHeightAssigned; + property BandHeaderLineCount: Integer read GetBandHeaderLineCount; + property BandHeaderMultiline: Boolean read GetBandHeaderMultiline; + property Bands[Index: Integer]: TcxGridBand read GetBand; + property BottomBandCount: Integer read GetBottomBandCount; + property BottomBands[Index: Integer]: TcxGridBand read GetBottomBand; + property Columns[Index: Integer]: TcxGridBandedColumn read GetColumn; + property FooterLineCount: Integer read GetFooterLineCount write FFooterLineCount; + property RootBandCount: Integer read GetRootBandCount; + property RootBands[Index: Integer]: TcxGridBand read GetRootBand; + property ThemedBandHeaderItemColor: TColor read GetThemedBandHeaderItemColor; + property ThemedBandHeaderItemTextColor: TColor read GetThemedBandHeaderItemTextColor; + end; + + TdxGridBandedTableViewColumnPlace = class(TdxGridTableViewColumnPlace) + private + function GetColumn: TcxGridBandedColumn; + function GetController: TdxCustomGridBandedTableViewItemPlace; + function GetFormatter: TdxGridBandedTableViewFormatter; + protected + function GetLineCount: Integer; override; + function GetRowIndex: Integer; override; + public + property Column: TcxGridBandedColumn read GetColumn; + property Controller: TdxCustomGridBandedTableViewItemPlace read GetController; + property Formatter: TdxGridBandedTableViewFormatter read GetFormatter; + end; + + TdxCustomGridBandedTableViewItemPlaceClass = class of TdxCustomGridBandedTableViewItemPlace; + + TdxCustomGridBandedTableViewItemPlace = class(TdxGridTableViewColumnPlaceController) + private + FBand: TcxGridBand; + FController: TdxGridBandedTableViewItemPlaceController; + FHeight: Integer; + FLeftBound: Integer; + FMinWidth: Integer; + FParent: TdxGridBandedTableViewItemPlace; + FTopBound: Integer; + function GetAdapter: TdxGridBandedTableViewAdapter; + function GetBounds: TRect; + function GetFormatter: TdxGridBandedTableViewFormatter; + function GetHeight: Integer; + function GetIndex: Integer; + function GetIsFixed: Boolean; + function GetLeftBound: Integer; + function GetLevelIndex: Integer; + function GetMinWidth: Integer; + function GetTopBound: Integer; + function GetViewParams: TdxReportItemViewParams; + protected + function CalculateHeaderLineCount: Integer; override; + function CalculateWidth: Integer; override; + function GetItemClass(AColumn: TcxGridColumn): TdxGridTableViewColumnPlaceClass; override; + + procedure AssignWidth; + function CalculateHeight: Integer; virtual; + function CalculateLeftBound: Integer; virtual; + function CalculateLevelHeight: Integer; virtual; + function CalculateLineHeight: Integer; virtual; + function CalculateMinWidth: Integer; virtual; + function CalculateTopBound: Integer; virtual; + procedure InitAutoWidthItem(AnItem: TcxAutoWidthItem); virtual; + + function GetRowCount: Integer; virtual; + function InternalCalculateMinWidth: Integer; virtual; + function InternalCalculateWidth: Integer; virtual; + + property Adapter: TdxGridBandedTableViewAdapter read GetAdapter; + property Band: TcxGridBand read FBand; + property IsFixed: Boolean read GetIsFixed; + property LevelIndex: Integer read GetLevelIndex; + property MinWidth: Integer read GetMinWidth; + property RowCount: Integer read GetRowCount; + property ViewParams: TdxReportItemViewParams read GetViewParams; + public + constructor Create(AController: TdxGridBandedTableViewItemPlaceController; + AParent: TdxGridBandedTableViewItemPlace; ABand: TcxGridBand); reintroduce; virtual; + + property Bounds: TRect read GetBounds; + property Controller: TdxGridBandedTableViewItemPlaceController read FController; + property Formatter: TdxGridBandedTableViewFormatter read GetFormatter; + property Height: Integer read GetHeight write FHeight; + property Index: Integer read GetIndex; + property LeftBound: Integer read GetLeftBound write FLeftBound; + property Parent: TdxGridBandedTableViewItemPlace read FParent; + property TopBound: Integer read GetTopBound write FTopBound; + end; + + TdxGridBandedTableViewItemPlace = class(TdxCustomGridBandedTableViewItemPlace) + private + FChildItems: TList; + function GetChildItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; + function GetChildItemCount: Integer; + protected + function GetRowCount: Integer; override; + function InternalCalculateMinWidth: Integer; override; + function InternalCalculateWidth: Integer; override; + procedure WidthChanged; override; + + procedure CalculateChildItemWidths; + {$IFDEF DXVER500} + procedure RefreshChildItems; + {$ENDIF} + public + constructor Create(AnOwner: TdxGridBandedTableViewItemPlaceController; + AParent: TdxGridBandedTableViewItemPlace; ABand: TcxGridBand); override; + destructor Destroy; override; + + function IndexOf(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; + {$IFDEF DXVER500} + procedure Refresh; override; + {$ENDIF} + + property ChildItemCount: Integer read GetChildItemCount; + property ChildItems[Index: Integer]: TdxCustomGridBandedTableViewItemPlace read GetChildItem; + end; + + TdxGridBandedTableViewBottomItemPlace = class(TdxCustomGridBandedTableViewItemPlace) + protected + procedure AddItems; override; + function CalculateItemLeftBound(AnItem: TdxGridTableViewColumnPlace): Integer; override; + procedure CalculateItemsWidth; override; + function GetItemsAutoWidth: Boolean; override; + function GetItemsAvailableWidth: Integer; override; + + function GetRowCount: Integer; override; + function InternalCalculateMinWidth: Integer; override; + function InternalCalculateWidth: Integer; override; + procedure WidthChanged; override; + end; + + TdxGridBandedTableViewItemPlaceController = class(TdxCustomGridTableViewItemPlaceController) + private + FBottomItems: TList; + FHeight: Integer; + FItems: TList; + FLevelCount: Integer; + FLevelHeights: TList; + FRootItems: TList; + function GetAdapter: TdxGridBandedTableViewAdapter; + function GetAutoWidth: Boolean; + function GetAvailableWidth: Integer; + function GetBottomItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; + function GetBottomItemCount: Integer; + function GetFormatter: TdxGridBandedTableViewFormatter; + function GetHeight: Integer; + function GetItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; + function GetItemByBand(Band: TcxGridBand): TdxCustomGridBandedTableViewItemPlace; + function GetItemCount: Integer; + function GetLevelCount: Integer; + function GetLevelHeight(Index: Integer): Integer; + function GetRootItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; + function GetRootItemCount: Integer; + procedure SetLevelHeight(Index: Integer; Value: Integer); + procedure FreeAndNilItems; + protected + function CalculateHeaderLineCount: Integer; override; + function CalculateWidth: Integer; override; + function GetItemByColumn(Column: TcxGridColumn): TdxGridTableViewColumnPlace; override; + + procedure AddItems; virtual; + procedure ClearItems; + function CreateItem(ABand: TcxGridBand): TdxCustomGridBandedTableViewItemPlace; virtual; + function GetItemClass(ABand: TcxGridBand): TdxCustomGridBandedTableViewItemPlaceClass; virtual; + procedure RefreshBottomItems; + procedure RefreshItems; + procedure RefreshRootItems; + + function CalculateHeight: Integer; virtual; + function CalculateItemHeight(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; virtual; + function CalculateItemLeftBound(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; virtual; + function CalculateItemTopBound(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; virtual; + function CalculateLevelCount: Integer; virtual; + + procedure CalculateItemWidths; + procedure CalculateLevelHeights; + + property AutoWidth: Boolean read GetAutoWidth; + property Adapter: TdxGridBandedTableViewAdapter read GetAdapter; + property AvailableWidth: Integer read GetAvailableWidth; + public + constructor Create(AFormatter: TdxGridTableViewFormatter); override; + destructor Destroy; override; + + procedure Calculate; override; + procedure Refresh; override; + + function IndexOf(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; overload; + function IndexOf(ABand: TcxGridBand): Integer; overload; + function RootIndexOf(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; overload; + function RootIndexOf(ABand: TcxGridBand): Integer; overload; + + property BottomItemCount: Integer read GetBottomItemCount; + property BottomItems[Index: Integer]: TdxCustomGridBandedTableViewItemPlace read GetBottomItem; + property Formatter: TdxGridBandedTableViewFormatter read GetFormatter; + property Height: Integer read GetHeight; + property ItemCount: Integer read GetItemCount; + property Items[Index: Integer]: TdxCustomGridBandedTableViewItemPlace read GetItem; default; + property ItemsByBand[Band: TcxGridBand]: TdxCustomGridBandedTableViewItemPlace read GetItemByBand; + property LevelCount: Integer read GetLevelCount; + property LevelHeights[Index: Integer]: Integer read GetLevelHeight write SetLevelHeight; + property RootItemCount: Integer read GetRootItemCount; + property RootItems[Index: Integer]: TdxCustomGridBandedTableViewItemPlace read GetRootItem; + end; + + TdxGridBandedTableViewFormatter = class(TdxGridTableViewFormatter) + private + FBands: TList; + FHeadersSingleLine: Boolean; + function GetBand(Index: Integer): TcxGridBand; + function GetBandCount: Integer; + function GetColumn(Index: Integer): TcxGridBandedColumn; + function GetItemPlaceController: TdxGridBandedTableViewItemPlaceController; + function GetShowBandHeaders: Boolean; + protected + procedure AddHorizontalDelimiters; override; + + {$IFDEF DXVER500} + function CanColumnCellMerging(AColumn: TcxGridColumn): Boolean; override; + function IsColumnActuallyVisible(AColumn: TcxGridColumn): Boolean; override; + {$ENDIF} + function GetAlignSummaryWithColumns: Boolean; override; + function GetItemPlaceControllerClass: TdxCustomGridTableViewItemPlaceControllerClass; override; + + procedure BuildBandList; virtual; + procedure BuildItemLists; override; + function IsBandActuallyVisible(ABand: TcxGridBand): Boolean; virtual; + + function MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; override; + + property HeadersSingleLine: Boolean read FHeadersSingleLine; + property ItemPlaceController: TdxGridBandedTableViewItemPlaceController read GetItemPlaceController; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); override; + destructor Destroy; override; + + function Adapter: TdxGridBandedTableViewAdapter; reintroduce; overload; + function Builder: TdxGridBandedTableViewBuilder; reintroduce; overload; + + { Bands } + procedure DoInitializeBandItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + procedure DoInitializeBandRow(ARow: TdxReportCell); virtual; + procedure DoReportLinkInitializeBandItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + function GetBandItemBounds(AnIndex: Integer): TRect; virtual; + function GetBandItemClass(AnIndex: Integer): TdxReportCellTextClass; virtual; + function GetBandItemViewParams(ABand: TcxGridBand): TdxReportItemViewParams; virtual; + + property BandCount: Integer read GetBandCount; + property Bands[Index: Integer]: TcxGridBand read GetBand; + property Columns[Index: Integer]: TcxGridBandedColumn read GetColumn; + property ShowBandHeaders: Boolean read GetShowBandHeaders; + end; + + TdxGridBandedTableViewBuilder = class(TdxGridTableViewBuilder) + protected + procedure DoBuildViewBody; override; + + procedure CreateBands; virtual; + function GetBandsProducer: TdxGridTableViewBandsProducer; virtual; + function GetBandsProducerClass: TdxGridTableViewBandsProducerClass; virtual; + + function GridView: TcxGridBandedTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + public + function Adapter: TdxGridBandedTableViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + function Formatter: TdxGridBandedTableViewFormatter; reintroduce; overload; + class function FormatterClass: TdxGridViewFormatterClass; override; + end; + + { DBBandedTableView Adapter, Formatter and Builder } + + TdxGridDBBandedTableViewAdapter = class(TdxGridBandedTableViewAdapter) + private + FPrevAllRecordsAreLoaded: Boolean; + protected + procedure AfterBuilding; override; + procedure BeforeBuilding; override; + function DataController: TcxGridDBDataController; reintroduce; overload; + + function DBDataModeController: TcxDBDataModeController; virtual; + procedure LoadAllRecords; virtual; + procedure UnloadAllRecords; virtual; + public + function GridView: TcxGridDBBandedTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + end; + + TdxGridDBBandedTableViewBuilder = class(TdxGridBandedTableViewBuilder) + public + function Adapter: TdxGridDBBandedTableViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + end; + + { CardView Adapter, Formatter and Builder } + + TdxReportCard = class; + TdxReportCardHorz = class; + TdxReportCardVert = class; + TdxReportCardRow = class; + + TdxReportCardRowClass = class of TdxReportCardRow; + TdxReportCardLayerClass = class of TdxReportCardLayer; + + TdxReportCardLayer = class(TdxReportCell) + private + FCategorySeparator: TdxReportCellBox; + FLayerSeparator: TdxReportCellBox; + FNeedCategorySeparator: Boolean; + FNeedLayerSeparator: Boolean; + FRows: TList; + function GetBeginsLayerRow: TcxGridCardViewRow; + function GetCard: TdxReportCardHorz; + function GetHeight: Integer; + function GetInternalHeight: Integer; + function GetInternalWidth: Integer; + function GetRow(AIndex: Integer): TdxReportCardRow; + function GetRowCount: Integer; + function GetWidth: Integer; + procedure SetHeight(AValue: Integer); + procedure SetInternalHeight(AValue: Integer); + procedure SetInternalWidth(AValue: Integer); + procedure SetWidth(AValue: Integer); + protected + procedure AdjustRowsHeight; virtual; + procedure AdjustRowHeight(DC: HDC; AAutoHeight: Boolean; ABuilder: TdxGridCardViewBuilder); virtual; + function CanHaveIndent(ARow: TdxReportCardRow): Boolean; virtual; + procedure CheckNeedCategorySeparator(ANextLayer: TdxReportCardLayer); virtual; + procedure CreateItems(ABuilder: TdxGridCardViewBuilder); + procedure CreateCategorySeparator; + procedure CreateLayerSeparator; virtual; + procedure InitAutoWidthItem(AnItem: TcxAutoWidthItem; var AAllFixed: Boolean); + procedure PlaceSeparatorAndExcludeHeightFromHeight(var AValue: Integer); virtual; + procedure RecalculateHeight; virtual; + procedure ResizeRowsHorz; virtual; + function SetPosition(ALeft, AWidth: Integer): Integer; + procedure SetRowCaptionWidth(DC: HDC; ACaptionAutoWidths: Boolean; AValue: Integer); virtual; + procedure SetRowHeight(ARowIndex, AValue: Integer); virtual; + procedure SizeChanged; virtual; + + property InternalHeight: Integer read GetInternalHeight write SetInternalHeight; + property InternalWidth: Integer read GetInternalWidth write SetInternalWidth; + + property NeedCategorySeparator: Boolean read FNeedCategorySeparator write FNeedCategorySeparator; + property NeedLayerSeparator: Boolean read FNeedLayerSeparator write FNeedLayerSeparator; + public + constructor CreateEx(AParent: TdxReportCell; ABeginsLayerRow: TcxGridCardViewRow); virtual; + destructor Destroy; override; + procedure AdjustCellSides; virtual; + function AddRow(AGridCardRow: TcxGridCardViewRow): TdxReportCardRow; + function MeasureCaptionWidth(DC: HDC): Integer; virtual; + function MeasureDataWidth(DC: HDC): Integer; + function MeasureLayerHeight(DC: HDC; ACalculateLineHeight: Boolean; + ABuilder: TdxGridCardViewBuilder): Integer; virtual; + function MeasureWidth(DC: HDC): Integer; override; + + property BeginsLayerRow: TcxGridCardViewRow read GetBeginsLayerRow; + property Card: TdxReportCardHorz read GetCard; + property CategorySeparator: TdxReportCellBox read FCategorySeparator; + property Height: Integer read GetHeight write SetHeight; + property LayerSeparator: TdxReportCellBox read FLayerSeparator; + property RowCount: Integer read GetRowCount; + property Rows[Index: Integer]: TdxReportCardRow read GetRow; default; + property Width: Integer read GetWidth write SetWidth; + end; + + TdxReportCardVerticalLayer = class(TdxReportCardLayer) + protected + procedure AdjustRowsHeight; override; + function CanHaveIndent(ARow: TdxReportCardRow): Boolean; override; + procedure CreateLayerSeparator; override; + procedure CheckNeedCategorySeparator(ANextLayer: TdxReportCardLayer); override; + procedure PlaceSeparatorAndExcludeHeightFromHeight(var AValue: Integer); override; + procedure RecalculateHeight; override; + procedure SetRowCaptionWidth(DC: HDC; ACaptionAutoWidths: Boolean; AValue: Integer); override; + procedure SizeChanged; override; + public + procedure AdjustCellSides; override; + function MeasureCaptionWidth(DC: HDC): Integer; override; + function MeasureWidth(DC: HDC): Integer; override; + end; + + TdxReportCardRow = class(TdxReportCell) + private + FNeedSeparator: Boolean; + FRowCaption: TdxReportCellText; + FRowData: TAbstractdxReportCellData; + FRowIndent: TdxReportCellExpandButton; + FRowSeparator: TdxReportCellBox; + function GetCard: TdxReportCard; + function GetGridCardRow: TcxGridCardViewRow; + function GetHasCaption: Boolean; + function GetHasData: Boolean; + function GetHasIndent: Boolean; + function GetHasRowSeparator: Boolean; + function GetHeight: Integer; + function GetLayer: TdxReportCardLayer; + function GetProperties: TcxCustomEditProperties; + function GetWidth: Integer; + procedure SetHeight(AValue: Integer); + procedure SetRowCaptionWidth(Value: Integer); + procedure SetWidth(Value: Integer); + protected + procedure AdjustCellSides(AIsFirstItem, AIsLastItem, AIsLeftItem, AIsRightItem: Boolean); virtual; + procedure CreateItems(ABuilder: TdxGridCardViewBuilder); virtual; + function MeasureCaptionWidth(DC: HDC): Integer; + function MeasureDataWidth(DC: HDC): Integer; + + property Properties: TcxCustomEditProperties read GetProperties; + property NeedSeparator: Boolean read FNeedSeparator write FNeedSeparator; + public + constructor CreateEx(AParent: TdxReportCell; AGridCardRow: TcxGridCardViewRow); virtual; + + function MeasureHeight(DC: HDC; ACalculateLineHeight: Boolean; + ABuilder: TdxGridCardViewBuilder): Integer; reintroduce; overload; + function MeasureWidth(DC: HDC): Integer; override; + + property Card: TdxReportCard read GetCard; + property GridCardRow: TcxGridCardViewRow read GetGridCardRow; + property HasCaption: Boolean read GetHasCaption; + property HasData: Boolean read GetHasData; + property HasIndent: Boolean read GetHasIndent; + property HasRowSeparator: Boolean read GetHasRowSeparator; + property Height: Integer read GetHeight write SetHeight; + property Layer: TdxReportCardLayer read GetLayer; + property RowCaption: TdxReportCellText read FRowCaption; + property RowCaptionWidth: Integer write SetRowCaptionWidth; + property RowData: TAbstractdxReportCellData read FRowData; + property RowIndent: TdxReportCellExpandButton read FRowIndent; + property RowSeparator: TdxReportCellBox read FRowSeparator; + + property Width: Integer read GetWidth write SetWidth; + + end; + + TdxCardBorderPainter = class(TdxPSCellBorderPainter) + protected + procedure DrawShadow(DC: HDC); virtual; + public + procedure Paint(DC: HDC); override; + function Card: TdxReportCard; reintroduce; overload; + end; + + TdxGridCardShadowDepth = 0..15; + TdxGridCardShadowPosition = (cspTopLeft, cspTopRight, cspBottomRight, cspBottomLeft); + + TdxReportCard = class(TdxReportCell) + private + FCaptionWidth: Integer; + FLayerCaptionWidth: Integer; + FShadowColor: TColor; + FShadowDepth: Integer; + FShadowPosition: TdxGridCardShadowPosition; + function GetContentHeight: Integer; + function GetContentWidth: Integer; + function GetHasShadow: Boolean; + function GetHeight: Integer; + function GetLayerCount: Integer; + function GetLayer(Index: Integer): TdxReportCardLayer; + function GetLayerHeight(Index: Integer): Integer; + function GetLayersOriginLeft: Integer; + function GetLayersOriginTop: Integer; + function GetReportLink: TdxGridReportLink; + function GetShadowRectHorz: TRect; + function GetShadowRectVert: TRect; + function GetGridCard: TcxGridCard; + function GetWidth: Integer; + procedure SetContentHeight(AValue: Integer); + procedure SetContentWidth(AValue: Integer); + procedure SetHeight(Value: Integer); + procedure SetShadowDepth2(AValue: Integer); + procedure SetWidth(Value: Integer); + protected + procedure AddVerticalDelimiters; virtual; + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); override; + function GetBorderPainterClass: TdxPSCellBorderPainterClass; override; + procedure ReadProperties(AReader: TdxPSDataReader); override; + procedure WriteProperties(AWriter: TdxPSDataWriter); override; + + procedure AdjustHeight; virtual; abstract; + procedure AdjustWidth(DC: HDC); virtual; abstract; + function MeasureCaptionWidth(DC: HDC): Integer; virtual; abstract; + procedure SetCaptionWidth(DC: HDC; ALayer, AValue, AMaxValue: Integer; ACaptionAutoWidths: Boolean); virtual; + // layers + procedure AdjustLayers; virtual; + procedure AdjustLayersCellSides; virtual; abstract; + procedure AdjustLayersPos; virtual; abstract; + procedure CreateLayers(ABuilder: TdxGridCardViewBuilder); virtual; + function GetLayerClass: TdxReportCardLayerClass; virtual; + function GetLayerIndexByRow(ARow: TcxGridCardViewRow): Integer; virtual; + function GetLayerWidth(Index: Integer): Integer; virtual; + function HasLayerSeparator(ALayerIndex: Integer): Boolean; virtual; + procedure RecalculateLayersHeight; + procedure SetLayerHeight(Index, Value: Integer); virtual; + procedure SetLayerWidth(Index, Value: Integer); virtual; + // virtual card rows + procedure AdjustRowHeight(DC: HDC; AAutoHeight: Boolean; ABuilder: TdxGridCardViewBuilder); virtual; abstract; + function GetRowCount: Integer; virtual; + function GetRowHeight(AIndex: Integer): Integer; virtual; + procedure SetRowHeight(AIndex, AValue: Integer); virtual; + procedure SizeChanged; virtual; + + property ReportLink: TdxGridReportLink read GetReportLink; + public + constructor Create(AParent: TdxReportCell); override; + constructor CreateEx(AParent: TdxReportCell; AGridCard: TcxGridCard); virtual; + function GetBorderOuterBounds(DC: HDC): TRect; override; + + property CaptionWidth: Integer read FCaptionWidth write FCaptionWidth; + property ContentHeight: Integer read GetContentHeight write SetContentHeight; + property ContentWidth: Integer read GetContentWidth write SetContentWidth; + property GridCard: TcxGridCard read GetGridCard; + property HasShadow: Boolean read GetHasShadow; + property Height: Integer read GetHeight write SetHeight; + property LayerCaptionWidth: Integer read FLayerCaptionWidth write FLayerCaptionWidth; + property LayerCount: Integer read GetLayerCount; + property LayerHeights[Index: Integer]: Integer read GetLayerHeight write SetLayerHeight; + property Layers[Index: Integer]: TdxReportCardLayer read GetLayer; + property LayersOriginLeft: Integer read GetLayersOriginLeft; + property LayersOriginTop: Integer read GetLayersOriginTop; + property LayerWidths[Index: Integer]: Integer read GetLayerWidth write SetLayerWidth; + property RowCount: Integer read GetRowCount; + property RowHeight[AIndex: Integer]: Integer read GetRowHeight write SetRowHeight; + property ShadowColor: TColor read FShadowColor write FShadowColor default clBlack; + property ShadowDepth: Integer read FShadowDepth write SetShadowDepth2 default dxDefaultCardsShadowDepth; + property ShadowPosition: TdxGridCardShadowPosition read FShadowPosition write FShadowPosition default cspBottomRight; + property ShadowRectHorz: TRect read GetShadowRectHorz; + property ShadowRectVert: TRect read GetShadowRectVert; + property Width: Integer read GetWidth write SetWidth; + end; + + TdxReportCardHorz = class(TdxReportCard) + protected + procedure AdjustHeight; override; + procedure AdjustLayersCellSides; override; + procedure AdjustLayersPos; override; + procedure AdjustRowHeight(DC: HDC; AAutoHeight: Boolean; ABuilder: TdxGridCardViewBuilder); override; + procedure AdjustWidth(DC: HDC); override; + function MeasureCaptionWidth(DC: HDC): Integer; override; + function MeasureDataWidth(DC: HDC): Integer; virtual; + procedure SizeChanged; override; + end; + + TdxReportCardVert = class(TdxReportCard) + protected + procedure AdjustHeight; override; + procedure AdjustLayers; override; + procedure AdjustLayersCellSides; override; + procedure AdjustLayersPos; override; + procedure AdjustRowHeight(DC: HDC; AAutoHeight: Boolean; ABuilder: TdxGridCardViewBuilder); override; + procedure AdjustWidth(DC: HDC); override; + function GetLayerClass: TdxReportCardLayerClass; override; + function GetLayerByAbsoluteRowIndex(var AIndex: Integer): TdxReportCardLayer; + function GetLayerIndexByRow(ARow: TcxGridCardViewRow): Integer; override; + function GetRowCount: Integer; override; + function GetRowHeight(AIndex: Integer): Integer; override; + function HasLayerSeparator(ALayerIndex: Integer): Boolean; override; + function MeasureCaptionWidth(DC: HDC): Integer; override; + procedure SetCaptionWidth(DC: HDC; ALayer, AValue, AMaxValue: Integer; ACaptionAutoWidth: Boolean); override; + procedure SetLayerWidth(Index, Value: Integer); override; + procedure SetLayerHeight(AIndex, AValue: Integer); override; + procedure SetLayersSameHeight; + procedure SetRowHeight(AIndex, AValue: Integer); override; + procedure SizeChanged; override; + end; + + TdxReportCardClass = class of TdxReportCard; + + TdxGridCardViewAdapter = class(TdxCustomGridTableViewAdapter) + private + function GetCaptionSeparator: string; + function GetCard(Index: Integer): TcxGridCard; + function GetCardAutoWidth: Boolean; + function GetCardCaptionWidth: Integer; + function GetCardCount: Integer; + function GetCardRow(Index: Integer): TcxGridCardViewRow; + function GetCardRowCount: Integer; + function GetCardSeparatorColor: Integer; + function GetCardSeparatorThickness: Integer; + function GetCardWidth: Integer; + function GetHasCardsSeparator: Boolean; + function GetHasIndent(Index: Integer): Boolean; + function GetRowAutoHeight: Boolean; + function GetRowCaptionAutoHeight: Boolean; + function GetRowCaptionEndEllipsis: Boolean; + function GetShowRowCaption(Index: Integer): Boolean; + function GetShowRowData(Index: Integer): Boolean; + protected + function GetAreAllMasterRowsCollapsed: Boolean; override; + + function GetCaptionRowViewParams(ARecord: TcxCustomGridRecord; + ACardRow: TcxGridCardViewRow): TcxViewParams; virtual; + function GetCardViewParams(ARecord: TcxCustomGridRecord): TcxViewParams; virtual; + function GetContentViewParams(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem; AIsDataCell: Boolean = False): TcxViewParams; override; + function GetRowCaptionViewParams(ARecord: TcxCustomGridRecord; + ACardRow: TcxGridCardViewRow): TcxViewParams; virtual; + public + function GridView: TcxGridCardView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + function Styles: TcxGridCardViewStyles; reintroduce; overload; + + procedure GetVisibleCardRows(ACard: TcxGridCard; AList: TList); + procedure ExpandAllRows(AnOptionsExpanding: TdxGridReportLinkOptionsExpanding; ARecursive: Boolean); override; + function IsFirstRow(ACardRow: TcxGridCardViewRow): Boolean; + function IsLastRow(ACardRow: TcxGridCardViewRow): Boolean; + + property CaptionSeparator: string read GetCaptionSeparator; + property CardAutoWidth: Boolean read GetCardAutoWidth; + property CardCaptionWidth: Integer read GetCardCaptionWidth; + property CardCount: Integer read GetCardCount; + property CardRowCount: Integer read GetCardRowCount; + property CardRows[Index: Integer]: TcxGridCardViewRow read GetCardRow; + property Cards[Index: Integer]: TcxGridCard read GetCard; + property CardSeparatorColor: Integer read GetCardSeparatorColor; + property CardSeparatorThickness: Integer read GetCardSeparatorThickness; + property CardWidth: Integer read GetCardWidth; + property HasCardsSeparator: Boolean read GetHasCardsSeparator; + property HasIndent[Index: Integer]: Boolean read GetHasIndent; + property RowCaptionAutoHeight: Boolean read GetRowCaptionAutoHeight; + property RowCaptionEndEllipsis: Boolean read GetRowCaptionEndEllipsis; + property RowAutoHeight: Boolean read GetRowAutoHeight; + property ShowRowCaption[Index: Integer]: Boolean read GetShowRowCaption; + property ShowRowData[Index: Integer]: Boolean read GetShowRowData; + end; + + TdxGridCardViewFormatter = class(TdxCustomGridTableViewFormatter) + private + function GetAutoWidth: Boolean; + function GetCaptionAutoWidth: Boolean; + function GetCardAutoWidth: Boolean; + function GetCard(Index: Integer): TcxGridCard; + function GetCardCount: Integer; + function GetCardsAreaWidth: Integer; + function GetInterCardsSpaceHorz: Integer; + function GetInterCardsSpaceVert: Integer; + function GetKeepSameHeight: Boolean; + function GetKeepSameWidth: Boolean; + function GetRowAutoHeight: Boolean; + protected + procedure AddHorizontalDelimiters; override; + procedure AddVerticalDelimiters; override; + function GetViewWidth: Integer; override; + + function GetContentBackgroundBitmapStyleIndex(ATableItem: TcxCustomGridTableItem): Integer; override; + function IsHorizontalLayout(AGridCard: TcxGridCard): Boolean; + function MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; override; + + function NeedDelimitByRows: Boolean; virtual; + public + function Adapter: TdxGridCardViewAdapter; reintroduce; overload; + function Builder: TdxGridCardViewBuilder; reintroduce; overload; + + { Cards } + procedure DoInitializeCard(ACard: TdxReportCard; AGridCard: TcxGridCard); virtual; + procedure DoInitializeCardsRow(ACard: TdxReportCell); virtual; + function GetCardClass(AGridCard: TcxGridCard): TdxReportCardClass; virtual; + function GetCardViewParams(ARecord: TcxCustomGridRecord): TdxReportItemViewParams; virtual; + + { Cards Indent } + procedure DoInitializeCardRowIndent(AnItem: TdxReportCellExpandButton; + ACardRow: TcxGridCardViewRow; AGridCard: TcxGridCard); virtual; + + { Cards Caption } + procedure DoInitializeCardRowCaption(AnItem: TdxReportCellText; + ACardRow: TcxGridCardViewRow; AGridCard: TcxGridCard); virtual; + procedure DoReportLinkInitializeCardRowCaption(AnItem: TdxReportCellText; + ACardRow: TcxGridCardViewRow; AGridCard: TcxGridCard); virtual; + function GetCardRowCaptionClass(ACardRow: TcxGridCardViewRow): TdxReportCellTextClass; virtual; + function GetCardRowCaptionViewParams(ARecord: TcxCustomGridRecord; + ACardRow: TcxGridCardViewRow): TdxReportItemViewParams; virtual; + + { Cards Data } + procedure DoReportLinkInitializeCardRowData(AnItem: TAbstractdxReportCellData; + ACardRow: TcxGridCardViewRow; AGridCard: TcxGridCard); virtual; + function GetItemViewParams(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False; AIsDataCell: Boolean = False): TdxReportItemViewParams; override; + + property AutoWidth: Boolean read GetAutoWidth; + property CaptionAutoWidth: Boolean read GetCaptionAutoWidth; + property CardAutoWidth: Boolean read GetCardAutoWidth; + property CardCount: Integer read GetCardCount; + property Cards[Index: Integer]: TcxGridCard read GetCard; + property CardsAreaWidth: Integer read GetCardsAreaWidth; + property InterCardsSpaceHorz: Integer read GetInterCardsSpaceHorz; + property InterCardsSpaceVert: Integer read GetInterCardsSpaceVert; + property KeepSameHeight: Boolean read GetKeepSameHeight; + property KeepSameWidth: Boolean read GetKeepSameWidth; + property RowAutoHeight: Boolean read GetRowAutoHeight; + end; + + TdxGridCardViewBuilder = class(TdxCustomGridTableViewBuilder) + private + FCards: TList; + FMaxCardWidth: Integer; + function GetCard(Index: Integer): TdxReportCard; + function GetCardCount: Integer; + function GetMaxCardWidth: Integer; + + procedure AdjustCardRowsCellSides; + procedure CreateCards; + procedure ResizeCards; + protected + procedure DoBuildViewBody; override; + + function GetCardsRowProducer: TdxGridCardViewCardsRowProducer; virtual; + function GetCardsRowProducerClass: TdxGridCardViewCardsRowProducerClass; virtual; + procedure PlaceCards; virtual; + + function GridView: TcxGridCardView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + + property CardCount: Integer read GetCardCount; + property Cards[Index: Integer]: TdxReportCard read GetCard; + public + constructor Create(AReportLink: TdxGridReportLink; + AMasterBuilder: TdxCustomGridViewBuilder; AGridView: TcxCustomGridView); override; + destructor Destroy; override; + + function Adapter: TdxGridCardViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + function Formatter: TdxGridCardViewFormatter; reintroduce; overload; + class function FormatterClass: TdxGridViewFormatterClass; override; + + property MaxCardWidth: Integer read GetMaxCardWidth; + end; + + { DBCardView Adapter, Formatter and Builder } + + TdxGridDBCardViewAdapter = class(TdxGridCardViewAdapter) + private + FPrevAllRecordsAreLoaded: Boolean; + protected + procedure AfterBuilding; override; + procedure BeforeBuilding; override; + function DataController: TcxGridDBDataController; reintroduce; overload; + + function DBDataModeController: TcxDBDataModeController; virtual; + procedure LoadAllRecords; virtual; + procedure UnloadAllRecords; virtual; + public + function GridView: TcxGridDBCardView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + end; + + TdxGridDBCardViewBuilder = class(TdxGridCardViewBuilder) + public + function Adapter: TdxGridDBCardViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + end; + +{$IFDEF CHARTVIEW} + { ChartView Adapter, Formatter and Builder } + + TdxGridChartViewAdapter = class(TdxCustomGridViewAdapter) + protected + function CreateGraphic(AGraphicClass: TGraphicClass; AWidth: Integer): TGraphic; + function GetCanUseOnEveryPageMode: Boolean; override; + public + function GridView: TcxGridChartView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + end; + + TdxGridChartViewFormatter = class(TdxCustomGridViewFormatter) + private + function GetGraphicClass: TGraphicClass; + function GetGraphicTransparent: Boolean; + protected + function CreateChartImage: TGraphic; virtual; + procedure DoInitializeChartItem(AnItem: TdxReportCellGraphic); virtual; + procedure DoReportLinkInitializeChartItem(AnItem: TdxReportCellGraphic); virtual; + function GetChartItemClass: TdxReportCellGraphicClass; + function GetViewWidth: Integer; override; + public + function Adapter: TdxGridChartViewAdapter; reintroduce; overload; + function Builder: TdxGridChartViewBuilder; reintroduce; overload; + + property GraphicClass: TGraphicClass read GetGraphicClass; + property GraphicTransparent: Boolean read GetGraphicTransparent; + end; + + TdxGridChartViewBuilder = class(TdxCustomGridViewBuilder) + protected + function GetChartProducer: TdxGridChartViewChartProducer; virtual; + function GetChartProducerClass: TdxGridChartViewChartProducerClass; virtual; + procedure CreateChart; virtual; + procedure DoBuildViewBody; override; + + function GridView: TcxGridChartView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + public + function Adapter: TdxGridChartViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + function Formatter: TdxGridChartViewFormatter; reintroduce; overload; + class function FormatterClass: TdxGridViewFormatterClass; override; + end; +{$ENDIF} + + { Producers } + + TdxGridViewRowProducer = class + private + FBuilder: TdxCustomGridViewBuilder; + FHost: TdxReportCell; + FMasterIndents: TList; + FRow: TdxReportCell; + FRowHeight: Integer; + function GetDC: HDC; + function GetHostClass: TdxReportCellClass; + function GetIndentWidth: Integer; + function GetMasterBuilder(Index: Integer): TdxCustomGridViewBuilder; + function GetMasterIndent(Index: Integer): TdxReportCellBox; + function GetMasterIndentCount: Integer; + function GetRowHostClass: TdxReportCellClass; + function GetRowOriginX: Integer; + function GetRowWidth: Integer; + protected + procedure AddLeadingMasterIndentsAndSeparators; virtual; + procedure AddMasterIndents(AMasterFormatter: TdxCustomGridViewFormatter; + AMasterAdapter: TdxCustomGridViewAdapter; ALevel: Integer; var ALeftPos: Integer); + procedure AddMasterSeparator(AMasterFormatter: TdxCustomGridViewFormatter; + AMasterAdapter: TdxCustomGridViewAdapter; var ALeftPos: Integer; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); + procedure AddTrailingMasterSeparators; virtual; + function CalculateItemHeight(DC: HDC; AnItem: TdxReportVisualItem): Integer; virtual; + procedure CalculateRowAutoHeight; virtual; + procedure CalculateRowHeight; virtual; + function CreateDetailsSeparator(AParent: TdxReportCell): TdxReportCellBox; virtual; + function CreateMasterIndent(AParent: TdxReportCell): TdxReportCellExpandButton; virtual; + procedure CreateRow; virtual; + procedure CreateRowHost(const AHostInfo: TdxGridAttributeHostInfo); virtual; + function DoesItemParticipateInRowAutoHeightCalculation(AnItem: TdxReportVisualItem): Boolean; virtual; + function GetDetailsSeparatorClass: TdxReportCellBoxClass; virtual; + function GetMasterIndentClass: TdxReportCellExpandButtonClass; virtual; + procedure FixupMasterIndentsHeight; virtual; + procedure FixupRowDataItemHeight(AnItem: TdxReportVisualItem); virtual; + procedure FixupRowDataHeight; virtual; + procedure FixupRowHeight; virtual; + procedure FixupRowOwnHeight; virtual; + procedure InitializeDetailsSeparator(AFormatter: TdxCustomGridViewFormatter; + ASeparator: TdxReportCellBox; ASeparatorKind: TdxVerticalDetailsSeparatorKind); virtual; + procedure InitializeMasterIndent(AFormatter: TdxCustomGridViewFormatter; + AIndent: TdxReportCellExpandButton; AIndex, ALevel: Integer); virtual; + procedure InitializeHost; virtual; + procedure InitializeRow; virtual; + + function GetAutoHeight: Boolean; virtual; + function GetItemsSite: TdxReportCell; virtual; + function GetLineCount: Integer; virtual; + function GetLineHeight: Integer; virtual; + function GetWidth: Integer; virtual; + + property DC: HDC read GetDC; + property HostClass: TdxReportCellClass read GetHostClass; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); virtual; + destructor Destroy; override; + + function Adapter: TdxCustomGridViewAdapter; overload; virtual; + function Builder: TdxCustomGridViewBuilder; overload; virtual; + function Formatter: TdxCustomGridViewFormatter; overload; virtual; + + function Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; virtual; + + property AutoHeight: Boolean read GetAutoHeight; + property Host: TdxReportCell read FHost; + property IndentWidth: Integer read GetIndentWidth; + property ItemsSite: TdxReportCell read GetItemsSite; + property LineCount: Integer read GetLineCount; + property LineHeight: Integer read GetLineHeight; + property MasterBuilders[Index: Integer]: TdxCustomGridViewBuilder read GetMasterBuilder; + property MasterIndentCount: Integer read GetMasterIndentCount; + property MasterIndents[Index: Integer]: TdxReportCellBox read GetMasterIndent; + property Row: TdxReportCell read FRow; + property RowHeight: Integer read FRowHeight write FRowHeight; + property RowOriginX: Integer read GetRowOriginX; + property RowWidth: Integer read GetRowWidth; + property Width: Integer read GetWidth; + end; + + TdxGridViewCustomRowProducer = class(TdxGridViewRowProducer) + private + FItem: TAbstractdxReportCellData; + protected + procedure AddItem; virtual; + function CreateItem(AParent: TdxReportCell): TAbstractdxReportCellData; virtual; + procedure FixupRowDataHeight; override; + procedure InitializeItem; virtual; + + function GetAutoHeight: Boolean; override; + function GetItemClass: TdxReportCellDataClass; virtual; + + property Item: TAbstractdxReportCellData read FItem; + public + function Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; override; + end; + + TdxGridViewCaptionProducer = class(TdxGridViewCustomRowProducer) + private + function GetItem: TdxReportCellText; + protected + procedure InitializeItem; override; + procedure InitializeRow; override; + + function GetItemClass: TdxReportCellDataClass; override; + function GetLineHeight: Integer; override; + public + property Item: TdxReportCellText read GetItem; + end; + + TdxGridViewFilterBarProducer = class(TdxGridViewCustomRowProducer) + private + function GetItem: TdxReportCellText; + protected + procedure InitializeItem; override; + procedure InitializeRow; override; + + function GetItemClass: TdxReportCellDataClass; override; + function GetLineHeight: Integer; override; + public + property Item: TdxReportCellText read GetItem; + end; + + TdxGridViewDetailsSeparatorProducer = class(TdxGridViewCustomRowProducer) + private + function GetItem: TdxReportCellBox; + protected + procedure InitializeItem; override; + procedure InitializeRow; override; + + function GetItemClass: TdxReportCellDataClass; override; + function GetLineHeight: Integer; override; + public + property Item: TdxReportCellBox read GetItem; + end; + + TdxGridViewDetailsTopSeparatorProducer = class(TdxGridViewDetailsSeparatorProducer) + protected + procedure InitializeDetailsSeparator(AFormatter: TdxCustomGridViewFormatter; + ASeparator: TdxReportCellBox; ASeparatorKind: TdxVerticalDetailsSeparatorKind); override; + end; + + TdxGridViewDetailsBottomSeparatorProducer = class(TdxGridViewDetailsSeparatorProducer) + protected + procedure InitializeDetailsSeparator(AFormatter: TdxCustomGridViewFormatter; + ASeparator: TdxReportCellBox; ASeparatorKind: TdxVerticalDetailsSeparatorKind); override; + end; + + TdxGridViewTerminatorProducer = class(TdxGridViewDetailsSeparatorProducer) + protected + procedure InitializeItem; override; + function GetLineHeight: Integer; override; + end; + + TdxGridTableViewRowProducer = class(TdxGridViewRowProducer) + public + function Adapter: TdxGridTableViewAdapter; reintroduce; overload; + function Builder: TdxGridTableViewBuilder; reintroduce; overload; + function Formatter: TdxGridTableViewFormatter; reintroduce; overload; + end; + + TdxGridTableViewRowSubItemsProducer = class(TdxGridTableViewRowProducer) + private + FIndents: TList; + FSubItems: TList; + function GetColumn(Index: Integer): TcxGridColumn; + function GetIndent(Index: Integer): TdxReportCellExpandButton; + function GetSubItem(Index: Integer): TdxReportVisualItem; + protected + procedure AddIndents(AParent: TdxReportCell); virtual; + procedure AddSubItems(AParent: TdxReportCell); virtual; + procedure CreateRow; override; + function CreateSubItem(AnIndex: Integer; AParent: TdxReportCell): TAbstractdxReportCellData; + function IsItemIndent(AnItem: TdxReportVisualItem): Boolean; + + procedure FixupIndentsHeight; virtual; + procedure FixupRowDataHeight; override; + procedure FixupRowHeight; override; + + procedure InitializeIndentList; virtual; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); virtual; + procedure InitializeSubItemList; virtual; + + function GetHasSubItem(Index: Integer): Boolean; virtual; + function GetIndentCount: Integer; virtual; + function GetSubItemBound(Index: Integer): TRect; virtual; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; virtual; abstract; + function GetSubItemCount: Integer; virtual; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); override; + destructor Destroy; override; + + function Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; override; + + property Columns[Index: Integer]: TcxGridColumn read GetColumn; + property HasSubItem[Index: Integer]: Boolean read GetHasSubItem; + property IndentCount: Integer read GetIndentCount; + property Indents[Index: Integer]: TdxReportCellExpandButton read GetIndent; + property SubItemBounds[Index: Integer]: TRect read GetSubItemBound; + property SubItemClasses[Index: Integer]: TdxReportCellDataClass read GetSubItemClass; + property SubItemCount: Integer read GetSubItemCount; + property SubItems[Index: Integer]: TdxReportVisualItem read GetSubItem; default; + end; + + TdxGridTableViewHeadersProducer = class(TdxGridTableViewRowSubItemsProducer) + protected + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + end; + + TdxGridTableViewFootersProducer = class(TdxGridTableViewRowSubItemsProducer) + private + function GetSummaryItems: TcxDataSummaryItems; virtual; + protected + procedure CalculateRowAutoHeight; override; + procedure CalculateRowHeight; override; + procedure FixupRowDataItemHeight(AnItem: TdxReportVisualItem); override; + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetHasSubItem(Index: Integer): Boolean; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + function GetSubItemCount: Integer; override; + + property SummaryItems: TcxDataSummaryItems read GetSummaryItems; + end; + + TdxGridTableViewCustomDataRowProducer = class(TdxGridTableViewRowSubItemsProducer) + private + FGridRow: TcxCustomGridRow; + FGridRowIndex: Integer; + function GetIndentArea: Integer; + function GetIndentBounds(Index: Integer): TRect; + protected + procedure AddIndents(AParent: TdxReportCell); override; + function CreateIndent(AnIndex: Integer; AParent: TdxReportCell): TdxReportCellExpandButton; virtual; + procedure InitializeIndent(AIndent: TdxReportCellExpandButton; AIndex: Integer); virtual; + + function GetIndentCount: Integer; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + public + function GridRow: TcxCustomGridRow; overload; virtual; + function Produce(AHostInfo: TdxGridAttributeHostInfo; + AGridRow: TcxCustomGridRow; AGridRowIndex: Integer): TdxReportCell; reintroduce; virtual; + + property GridRowIndex: Integer read FGridRowIndex; + property IndentArea: Integer read GetIndentArea; + property IndentBounds[Index: Integer]: TRect read GetIndentBounds; + end; + + TdxCustomGridTableViewRowSeparatorProducer = class(TdxGridTableViewCustomDataRowProducer) + protected + procedure InitializeIndent(AIndent: TdxReportCellExpandButton; AIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetSubItemCount: Integer; override; + function GetSubItemBound(Index: Integer): TRect; override; + public + function Produce(AHostInfo: TdxGridAttributeHostInfo; + AGridRow: TcxCustomGridRow): TdxReportCell; reintroduce; virtual; + end; + + TdxGridTableViewRowSeparatorProducer = class(TdxCustomGridTableViewRowSeparatorProducer) + private + FIsLast: Boolean; + protected + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetIndentCount: Integer; override; + function GetLineHeight: Integer; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + public + function Produce(AHostInfo: TdxGridAttributeHostInfo; AGridRow: TcxCustomGridRow; + AnIsLast: Boolean): TdxReportCell; reintroduce; virtual; + property IsLast: Boolean read FIsLast; + end; + + TdxGridTableViewGroupRowSeparatorProducer = class(TdxCustomGridTableViewRowSeparatorProducer) + protected + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + function GetLineHeight: Integer; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + end; + + TdxGridTableViewDataRowProducer = class(TdxGridTableViewCustomDataRowProducer) + private + FPreviewItem: TdxReportVisualItem;//TAbstractdxReportCellData; + function GetPreviewColumn: TcxGridColumn; + function GetPreviewPlace: TcxGridPreviewPlace; + protected + procedure AddPreview(AParent: TdxReportCell); virtual; + procedure AddSubItems(AParent: TdxReportCell); override; + procedure CalculateRowAutoHeight; override; + function DoesItemParticipateInRowAutoHeightCalculation(AnItem: TdxReportVisualItem): Boolean; override; + function CreatePreview(AParent: TdxReportCell): TdxReportVisualItem; virtual; + function GetPreviewClass: TdxReportCellDataClass; virtual; + procedure FixupRowDataHeight; override; + procedure InitializeIndent(AIndent: TdxReportCellExpandButton; AIndex: Integer); override; + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetCellAutoHeight: Boolean; virtual; + function GetHasPreview: Boolean; virtual; + function GetIndentCount: Integer; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + function GetPreviewHeight: Integer; virtual; + function GetPreviewLineCount: Integer; virtual; + function GetPreviewLineHeight: Integer; virtual; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + public + function GridRow: TcxGridDataRow; reintroduce; overload; + + property CellAutoHeight: Boolean read GetCellAutoHeight; + property HasPreview: Boolean read GetHasPreview; + property PreviewColumn: TcxGridColumn read GetPreviewColumn; + property PreviewHeight: Integer read GetPreviewHeight; + property PreviewItem: TdxReportVisualItem read FPreviewItem;//TAbstractdxReportCellData read FPreviewItem; + property PreviewLineCount: Integer read GetPreviewLineCount; + property PreviewLineHeight: Integer read GetPreviewLineHeight; + property PreviewPlace: TcxGridPreviewPlace read GetPreviewPlace; + end; + + TcxGridSummaryItemInfo = class + public + Bounds: TRect; + Column: TcxGridColumn; + DisplayText: string; + SummaryIndex: Integer; + ViewParams: TcxViewParams; + end; + + TdxGridTableViewGroupRowProducer = class(TdxGridTableViewCustomDataRowProducer) + private + function GetSummaryItemInfo(Index: Integer): TcxGridSummaryItemInfo; + protected + SummaryItemInfoList: TcxObjectList; + RowViewParams: TcxViewParams; + procedure AddSummaryGroupInfo(AItem: TcxDataSummaryItem; const ADisplayText: string); + procedure AddSubItems(AParent: TdxReportCell); override; + procedure DeleteInfo(AIndex: Integer); + procedure InitializeRow; override; + procedure InitializeIndent(AIndent: TdxReportCellExpandButton; AIndex: Integer); override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + procedure InitializeSubItemList; override; + function GetAutoHeight: Boolean; override; + function GetIndentCount: Integer; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + function GetSubItemCount: Integer; override; + procedure PrepareSummaryItemsInfo; + procedure PrepareSummaryItemsBounds; + public + function GridRow: TcxGridGroupRow; reintroduce; overload; + function Produce(AHostInfo: TdxGridAttributeHostInfo; + AGridRow: TcxCustomGridRow; AGridRowIndex: Integer): TdxReportCell; override; + + property SummaryItemInfos[Index: Integer]: TcxGridSummaryItemInfo read GetSummaryItemInfo; + end; + + TdxGridTableViewMasterRowProducer = class(TdxGridTableViewDataRowProducer) + protected + procedure InitializeIndent(AIndent: TdxReportCellExpandButton; AIndex: Integer); override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetIndentCount: Integer; override; + public + function GridRow: TcxGridMasterDataRow; reintroduce; overload; + end; + + TdxGridTableViewGroupFooterProducer = class(TdxGridTableViewCustomDataRowProducer) + private + FGroupLevel: Integer; + FIndex: Integer; + FInternalLineCount: Integer; + FItemsSite: TdxReportCell; + function GetGroupLevel: Integer; + function GetHostBounds: TRect; + protected + SummaryItems: TcxDataSummaryItems; + SummaryValues: PVariant; + procedure AddSubItems(AParent: TdxReportCell); override; + procedure CalculateRowAutoHeight; override; + procedure FixupRowDataItemHeight(AnItem: TdxReportVisualItem); override; + procedure InitializeIndent(AIndent: TdxReportCellExpandButton; AIndex: Integer); override; + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + function GetAutoHeight: Boolean; override; + function GetCorrectRowIndex(AGridRow: TcxCustomGridRow; AGroupLevel: Integer): Integer; + function GetHasSubItem(Index: Integer): Boolean; override; + function GetIndentCount: Integer; override; + function GetItemsSite: TdxReportCell; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + function GetSubItemCount: Integer; override; + public + function Produce(AHostInfo: TdxGridAttributeHostInfo; AGridRow: TcxCustomGridRow; + AGroupLevel, AnIndex: Integer): TdxReportCell; reintroduce; virtual; + + property GroupLevel: Integer read GetGroupLevel; + property HostBounds: TRect read GetHostBounds; + property Index: Integer read FIndex; + property InternalLineCount: Integer read FInternalLineCount; + end; + + TdxGridTableViewBandsProducer = class(TdxGridTableViewRowSubItemsProducer) + protected + procedure CalculateRowHeight; override; + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + function GetSubItemCount: Integer; override; + public + function Adapter: TdxGridBandedTableViewAdapter; reintroduce; overload; + function Builder: TdxGridBandedTableViewBuilder; reintroduce; overload; + function Formatter: TdxGridBandedTableViewFormatter; reintroduce; overload; + end; + + TdxGridCardViewCardsRowProducer = class(TdxGridViewRowProducer) + protected + procedure CalculateRowHeight; override; + function GetAutoHeight: Boolean; override; + procedure InitializeRow; override; + public + function Adapter: TdxGridCardViewAdapter; reintroduce; overload; + function Builder: TdxGridCardViewBuilder; reintroduce; overload; + function Formatter: TdxGridCardViewFormatter; reintroduce; overload; + + function CreateCard(AParent: TdxReportCell; AGridCard: TcxGridCard): TdxReportCard; virtual; + procedure InjectCard(ACard: TdxReportCard; AIndex: Integer); virtual; + function Produce(AHostInfo: TdxGridAttributeHostInfo; + ARowHeight: Integer): TdxReportCell; reintroduce; virtual; + end; + +{$IFDEF CHARTVIEW} + TdxGridChartViewChartProducer = class(TdxGridViewCustomRowProducer) + private + FChartImage: TGraphic; + function GetChartImage: TGraphic; + function GetItem: TdxReportCellGraphic; + protected + procedure CalculateRowHeight; override; + function GetItemClass: TdxReportCellDataClass; override; + procedure InitializeItem; override; + + property ChartImage: TGraphic read GetChartImage; + property Item: TdxReportCellGraphic read GetItem; + public + function Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; override; + function Formatter: TdxGridChartViewFormatter; reintroduce; overload; + end; +{$ENDIF} + + { Options } + + TdxGridReportLinkOptionsClass = class of TdxGridReportLinkOptions; + + TdxGridReportLinkOptions = class(TdxCustomReportLinkOptions) + private + function GetReportLink: TdxGridReportLink; + public + property ReportLink: TdxGridReportLink read GetReportLink; + end; + + TdxGridReportLinkOptionsCards = class; + + TdxGridReportLinkCardsShadowClass = class of TdxGridReportLinkCardsShadow; + + TdxGridReportLinkCardsShadow = class(TPersistent) + private + FColor: TColor; + FDepth: TdxGridCardShadowDepth; + FOptionsCards: TdxGridReportLinkOptionsCards; + FPosition: TdxGridCardShadowPosition; + function GetActualColor: TColor; + function GetVisible: Boolean; + procedure SetColor(Value: TColor); + procedure SetDepth(Value: TdxGridCardShadowDepth); + procedure SetPosition(Value: TdxGridCardShadowPosition); + protected + procedure Changed; dynamic; + public + constructor Create(AnOptionsCards: TdxGridReportLinkOptionsCards); virtual; + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; virtual; + + property ActualColor: TColor read GetActualColor; + property OptionsCards: TdxGridReportLinkOptionsCards read FOptionsCards; + property Visible: Boolean read GetVisible; + published + property Color: TColor read FColor write SetColor default clDefault; + property Depth: TdxGridCardShadowDepth read FDepth write SetDepth default dxDefaultCardsShadowDepth; + property Position: TdxGridCardShadowPosition read FPosition write SetPosition default cspBottomRight; + end; + + TdxGridReportLinkOptionsCardsClass = class of TdxGridReportLinkOptionsCards; + + TdxGridReportLinkOptionsCards = class(TdxGridReportLinkOptions) + private + FAutoWidth: Boolean; + FBorders: Boolean; + FInterCardsSpaceHorz: Integer; + FInterCardsSpaceVert: Integer; + FKeepSameHeight: Boolean; + FKeepSameWidth: Boolean; + FRowBordersHorz: Boolean; + FRowBordersVert: Boolean; + FShadow: TdxGridReportLinkCardsShadow; + function GetShadow: TdxGridReportLinkCardsShadow; + procedure SetAutoWidth(Value: Boolean); + procedure SetBorders(Value: Boolean); + procedure SetInterCardsSpaceHorz(Value: Integer); + procedure SetInterCardsSpaceVert(Value: Integer); + procedure SetKeepSameHeight(Value: Boolean); + procedure SetKeepSameWidth(Value: Boolean); + procedure SetRowBordersHorz(Value: Boolean); + procedure SetRowBordersVert(Value: Boolean); + procedure SetShadow(Value: TdxGridReportLinkCardsShadow); + protected + function DesignerTabIndex: Integer; override; + function GetShadowClass: TdxGridReportLinkCardsShadowClass; virtual; + public + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property AutoWidth: Boolean read FAutoWidth write SetAutoWidth default False; + property Borders: Boolean read FBorders write SetBorders default True; + property InterCardsSpaceHorz: Integer read FInterCardsSpaceHorz write SetInterCardsSpaceHorz default 4; + property InterCardsSpaceVert: Integer read FInterCardsSpaceVert write SetInterCardsSpaceVert default 4; + property KeepSameHeight: Boolean read FKeepSameHeight write SetKeepSameHeight default True; + property KeepSameWidth: Boolean read FKeepSameWidth write SetKeepSameWidth default True; + property RowBordersHorz: Boolean read FRowBordersHorz write SetRowBordersHorz default False; + property RowBordersVert: Boolean read FRowBordersVert write SetRowBordersVert default False; + property Shadow: TdxGridReportLinkCardsShadow read GetShadow write SetShadow; + end; + +{$IFDEF CHARTVIEW} + TdxGridReportLinkOptionsChartsClass = class of TdxGridReportLinkOptionsCharts; + + TdxGridReportLinkOptionsCharts = class(TdxGridReportLinkOptions) + private + FGraphicClass: TGraphicClass; + FIsGraphicClassAssigned: Boolean; + FTransparent: Boolean; + function GetGraphicClass: TGraphicClass; + function GetGraphicClassName: string; + function IsGraphicClassNameStored: Boolean; + procedure SetGraphicClass(Value: TGraphicClass); + procedure SetGraphicClassName(const Value: string); + procedure SetTransparent(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + function DefaultGraphicClass: TGraphicClass; virtual; //TBitmap + function SupportsGraphicClass(AGraphicClass: TGraphicClass): Boolean; virtual; //excluding TIcon + + property GraphicClass: TGraphicClass read GetGraphicClass write SetGraphicClass; + published + property GraphicClassName: string read GetGraphicClassName write SetGraphicClassName stored IsGraphicClassNameStored; + property Transparent: Boolean read FTransparent write SetTransparent default False; + end; +{$ENDIF} + + TdxGridReportLinkOptionsDetailsClass = class of TdxGridReportLinkOptionsDetails; + + TdxGridReportLinkOptionsDetails = class(TdxGridReportLinkOptions) + private + FOnlyFocusedView: Boolean; + FStartFromFocusedView: Boolean; + procedure SetOnlyFocusedView(Value: Boolean); + procedure SetStartFromFocusedView(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property OnlyFocusedView: Boolean read FOnlyFocusedView write SetOnlyFocusedView default False; + property StartFromFocusedView: Boolean read FStartFromFocusedView write SetStartFromFocusedView default False; + end; + + TdxGridReportLinkOptionsExpanding = class(TdxCustomReportLinkOptionsExpanding) + private + {$IFDEF DXVER500} + FExpandCards: Boolean; + {$ENDIF} + FExpandGroupRows: Boolean; + FExpandMasterRows: Boolean; + function GetHasAny: Boolean; + function GetReportLink: TdxGridReportLink; + {$IFDEF DXVER500} + procedure SetExpandCards(Value: Boolean); + {$ENDIF} + procedure SetExpandGroupRows(Value: Boolean); + procedure SetExpandMasterRows(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + + property HasAny: Boolean read GetHasAny; + property ReportLink: TdxGridReportLink read GetReportLink; + published + {$IFDEF DXVER500} + property ExpandCards: Boolean read FExpandCards write SetExpandCards default False; + {$ENDIF} + property ExpandGroupRows: Boolean read FExpandGroupRows write SetExpandGroupRows default False; + property ExpandMasterRows: Boolean read FExpandMasterRows write SetExpandMasterRows default False; + end; + + TdxGridReportLinkOptionsFormatting = class(TdxCustomReportLinkOptionsFormatting) + private + FConsumeSelectionStyle: Boolean; + function GetReportLink: TdxGridReportLink; + procedure SetConsumeSelectionStyle(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + property ReportLink: TdxGridReportLink read GetReportLink; + published + property ConsumeSelectionStyle: Boolean read FConsumeSelectionStyle write SetConsumeSelectionStyle default False; + property UseLookAndFeelColors; + end; + + TdxGridReportLinkOptionsLevelsClass = class of TdxGridReportLinkOptionsLevels; + + TdxGridReportLinkOptionsLevels = class(TdxGridReportLinkOptions) + private + FRiseActiveLevelOntoTop: Boolean; + FSkipEmptyViews: Boolean; + FUnwrap: Boolean; + FUnwrapTopLevel: Boolean; + procedure SetRiseActiveLevelOntoTop(Value: Boolean); + procedure SetSkipEmptyViews(Value: Boolean); + procedure SetUnwrap(Value: Boolean); + procedure SetUnwrapTopLevel(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property RiseActiveLevelOntoTop: Boolean read FRiseActiveLevelOntoTop write SetRiseActiveLevelOntoTop default True; + property SkipEmptyViews: Boolean read FSkipEmptyViews write SetSkipEmptyViews default True; + property Unwrap: Boolean read FUnwrap write SetUnwrap default False; + property UnwrapTopLevel: Boolean read FUnwrapTopLevel write SetUnwrapTopLevel default True; + end; + + TdxGridReportLinkOptionsOnEveryPage = class(TdxCustomTableControlReportLinkOptionsOnEveryPage) + private + FCaption: Boolean; + FFilterBar: Boolean; + function GetReportLink: TdxGridReportLink; + procedure SetCaption(Value: Boolean); + procedure SetFilterBar(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + + function HasInstalledAttribute(AnAttribute: TdxGridAttributeClass): Boolean; virtual; + procedure SetAll; virtual; + procedure UnsetAll; virtual; + + property ReportLink: TdxGridReportLink read GetReportLink; + published + property BandHeaders; + property Caption: Boolean read FCaption write SetCaption default True; + property FilterBar: Boolean read FFilterBar write SetFilterBar default True; + property Footers; + property Headers; + end; + + TdxGridReportLinkOptionsPagination = class(TdxCustomTableControlReportLinkOptionsPagination) + private + FOneGroupPerPage: Boolean; + FTopLevelGroup: Boolean; + function GetReportLink: TdxGridReportLink; + procedure SetOneGroupPerPage(Value: Boolean); + procedure SetTopLevelGroup(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + property ReportLink: TdxGridReportLink read GetReportLink; + published + property Band; + property Column; + property Custom; + property OneGroupPerPage: Boolean read FOneGroupPerPage write SetOneGroupPerPage default False; + property Row; + property TopLevelGroup: Boolean read FTopLevelGroup write SetTopLevelGroup default False; + end; + + TdxGridReportLinkOptionsPreview = class(TdxCustomTableControlReportLinkOptionsPreview) + private + function GetReportLink: TdxGridReportLink; + protected + function DesignerTabIndex: Integer; override; + public + property ReportLink: TdxGridReportLink read GetReportLink; + end; + + TdxGridReportLinkOptionsRefinements = class(TdxCustomReportLinkOptionsRefinements) + private + function GetReportLink: TdxGridReportLink; + protected + function DesignerTabIndex: Integer; override; + public + property ReportLink: TdxGridReportLink read GetReportLink; + end; + + TdxGridReportLinkOptionsSelection = class(TdxCustomTableControlReportLinkOptionsSelection) + private + function GetReportLink: TdxGridReportLink; + protected + function DesignerTabIndex: Integer; override; + public + property ReportLink: TdxGridReportLink read GetReportLink; + end; + + TdxGridReportLinkOptionsSize = class(TdxCustomReportLinkOptionsSize) + private + function GetReportLink: TdxGridReportLink; + protected + function DesignerTabIndex: Integer; override; + public + property ReportLink: TdxGridReportLink read GetReportLink; + published + property AutoWidth; + end; + + TdxGridReportLinkOptionsView = class(TdxCustomTableControlReportLinkOptionsView) + private + FCaption: Boolean; + FFilterBar: Boolean; + FGroupFooters: Boolean; + function GetReportLink: TdxGridReportLink; + procedure SetCaption(Value: Boolean); + procedure SetFilterBar(Value: Boolean); + procedure SetGroupFooters(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + + function HasInstalledAttribute(AnAttribute: TdxGridAttributeClass): Boolean; virtual; + procedure SetAll; + procedure UnsetAll; + + property ReportLink: TdxGridReportLink read GetReportLink; + published + property BandHeaders; + property Caption: Boolean read FCaption write SetCaption default True; + property ExpandButtons; + property FilterBar: Boolean read FFilterBar write SetFilterBar default True; + property Footers; + property GroupFooters: Boolean read FGroupFooters write SetGroupFooters default True; + property Headers; + end; + + TdxGridAttributeHostInfo = class + private + FParent: TdxReportCell; + public + Origin: TPoint; + procedure Initialize(AParent: TdxReportCell); + property Parent: TdxReportCell read FParent; + end; + + TdxGridAttributeHostInfoServicesClass = class of TdxGridAttributeHostInfoServices; + + TdxGridAttributeHostInfoServices = class + private + FPageDetailsHostInfo: TdxGridAttributeHostInfo; + FPageFootersHostInfo: TdxGridAttributeHostInfo; + FPageHeadersHostInfo: TdxGridAttributeHostInfo; + FReportLink: TdxGridReportLink; + function GetActiveView: TcxCustomGridView; + function GetActiveViewHelper: TdxCustomGridViewHelperClass; + function GetArePageFootersAssigned: Boolean; + function GetArePageHeadersAssigned: Boolean; + function GetCanUseBandHeadersOnEveyPage: Boolean; + function GetCanUseCaptionOnEveryPage: Boolean; + function GetCanUseFilterBarOnEveryPage: Boolean; + function GetCanUseFootersOnEveryPage: Boolean; + function GetCanUseHeadersOnEveryPage: Boolean; + function GetIsInconsistentBandHeadersState: Boolean; + function GetIsInconsistentFilterBarState: Boolean; + function GetIsInconsistentFootersState: Boolean; + function GetIsInconsistentHeadersState: Boolean; + function GetLevelSeparatorBottomHostInfo: TdxGridAttributeHostInfo; + function GetLevelSeparatorTopHostInfo: TdxGridAttributeHostInfo; + function GetOptionsOnEveryPage: TdxGridReportLinkOptionsOnEveryPage; + function GetOptionsView: TdxGridReportLinkOptionsView; + function GetPageDetails: TdxReportCell; + function GetPageFooters: TdxReportCell; + function GetPageHeaders: TdxReportCell; + protected + procedure CreateHostInfos; + procedure DestroyHostInfos; + + function GetBandHeadersHostInfo: TdxGridAttributeHostInfo; virtual; + function GetCaptionHostInfo: TdxGridAttributeHostInfo; virtual; + function GetFilterBarHostInfo: TdxGridAttributeHostInfo; virtual; + function GetFootersHostInfo: TdxGridAttributeHostInfo; virtual; + function GetHeadersHostInfo: TdxGridAttributeHostInfo; virtual; + function GetInconsistentStateText: string; virtual; + function GetIsInconsistentState: Boolean; virtual; + function HasCells: Boolean; + function IsAttributeSupported(AnAttribute: TdxGridAttributeClass): Boolean; + + //function HasAttributeOnEveryPage: Boolean; + + property ActiveView: TcxCustomGridView read GetActiveView; + property ActiveViewHelper: TdxCustomGridViewHelperClass read GetActiveViewHelper; + property OptionsOnEveryPage: TdxGridReportLinkOptionsOnEveryPage read GetOptionsOnEveryPage; + property OptionsView: TdxGridReportLinkOptionsView read GetOptionsView; + property PageDetails: TdxReportCell read GetPageDetails; + property PageFooters: TdxReportCell read GetPageFooters; + property PageHeaders: TdxReportCell read GetPageHeaders; + public + constructor Create(AReportLink: TdxGridReportLink); virtual; + destructor Destroy; override; + procedure Initialize; + + property ArePageFootersAssigned: Boolean read GetArePageFootersAssigned; + property ArePageHeadersAssigned: Boolean read GetArePageHeadersAssigned; + property BandHeadersHostInfo: TdxGridAttributeHostInfo read GetBandHeadersHostInfo; + property CanUseBandHeadersOnEveyPage: Boolean read GetCanUseBandHeadersOnEveyPage; + property CanUseCaptionOnEveryPage: Boolean read GetCanUseCaptionOnEveryPage; + property CanUseFilterBarOnEveryPage: Boolean read GetCanUseFilterBarOnEveryPage; + property CanUseFootersOnEveryPage: Boolean read GetCanUseFootersOnEveryPage; + property CanUseHeadersOnEveryPage: Boolean read GetCanUseHeadersOnEveryPage; + property CaptionHostInfo: TdxGridAttributeHostInfo read GetCaptionHostInfo; + property FilterBarHostInfo: TdxGridAttributeHostInfo read GetFilterBarHostInfo; + property FootersHostInfo: TdxGridAttributeHostInfo read GetFootersHostInfo; + property HeadersHostInfo: TdxGridAttributeHostInfo read GetHeadersHostInfo; + property InconsistentStateText: string read GetInconsistentStateText; + property IsInconsistentBandHeadersState: Boolean read GetIsInconsistentBandHeadersState; + property IsInconsistentFilterBarState: Boolean read GetIsInconsistentFilterBarState; + property IsInconsistentFootersState: Boolean read GetIsInconsistentFootersState; + property IsInconsistentHeadersState: Boolean read GetIsInconsistentHeadersState; + property IsInconsistentState: Boolean read GetIsInconsistentState; + property LevelSeparatorBottomHostInfo: TdxGridAttributeHostInfo read GetLevelSeparatorBottomHostInfo; + property LevelSeparatorTopHostInfo: TdxGridAttributeHostInfo read GetLevelSeparatorTopHostInfo; + property PageDetailsHostInfo: TdxGridAttributeHostInfo read FPageDetailsHostInfo; + property PageFootersHostInfo: TdxGridAttributeHostInfo read FPageFootersHostInfo; + property PageHeadersHostInfo: TdxGridAttributeHostInfo read FPageHeadersHostInfo; + property ReportLink: TdxGridReportLink read FReportLink; + end; + + TdxGridReportLinkStylesClass = class of TdxGridReportLinkStyles; + + TdxGridReportLinkStyles = class(TdxCustomReportLinkStyles) + private + function GetReportLink: TdxGridReportLink; + protected + function DesignerTabIndex: Integer; override; + + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + class function GetStyleCaption(AnIndex: Integer): string; override; + function GetStyleIndexByCaption(const Caption: string): Integer; override; + + function IsCardViewStyle(AStyle: TcxStyle): Boolean; + public + procedure Assign(Source: TPersistent); override; + + procedure GetBandHeaderParams(ABand: TcxGridBand; out AParams: TcxViewParams); virtual; + procedure GetCaptionParams(ATabLevel: TcxGridLevel; out AParams: TcxViewParams); virtual; + procedure GetCardCaptionRowParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); virtual; + procedure GetCardRowCaptionParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); virtual; + procedure GetContentParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); virtual; + procedure GetFilterBarParams(out AParams: TcxViewParams); virtual; + procedure GetFooterParams(ARecord: TcxCustomGridRecord; AGroupLevel: Integer; + AItem: TcxGridColumn; out AParams: TcxViewParams); virtual; + procedure GetGroupParams(ARecord: TcxCustomGridRecord; AGroupLevel: Integer; + out AParams: TcxViewParams); virtual; + procedure GetHeaderParams(AItem: TcxGridColumn; out AParams: TcxViewParams); virtual; + procedure GetPreviewParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); virtual; + procedure GetSelectionParams(out AParams: TcxViewParams); virtual; + + property ReportLink: TdxGridReportLink read GetReportLink; + published + property BandHeader: TcxStyle Index vspsGridBandHeader read GetValue write SetValue; + property Caption: TcxStyle Index vspsGridCaption read GetValue write SetValue; + property CardCaptionRow: TcxStyle Index vspsGridCardCaptionRow read GetValue write SetValue; + property CardRowCaption: TcxStyle Index vspsGridCardRowCaption read GetValue write SetValue; + property Content: TcxStyle Index vspsGridContent read GetValue write SetValue; + property ContentEven: TcxStyle Index vspsGridContentEven read GetValue write SetValue; + property ContentOdd: TcxStyle Index vspsGridContentOdd read GetValue write SetValue; + property FilterBar: TcxStyle Index vspsGridFilterBar read GetValue write SetValue; + property Footer: TcxStyle Index vspsGridFooter read GetValue write SetValue; + property Group: TcxStyle Index vspsGridGroup read GetValue write SetValue; + property Header: TcxStyle Index vspsGridHeader read GetValue write SetValue; + property Preview: TcxStyle Index vspsGridPreview read GetValue write SetValue; + property Selection: TcxStyle Index vspsGridSelection read GetValue write SetValue; + property StyleSheet; + end; + + TdxGridReportLinkStyleSheet = class(TdxCustomReportLinkStyleSheet) + private + function GetStylesValue: TdxGridReportLinkStyles; + procedure SetStylesValue(Value: TdxGridReportLinkStyles); + public + class function GetStylesClass: TcxCustomStylesClass; override; + published + property Styles: TdxGridReportLinkStyles read GetStylesValue write SetStylesValue; + end; + + TdxGridReportLinkProcessParams = record + HasMasterDetails: Boolean; + HasMasterDetailsInTopView: Boolean; + HasOnlyCards: Boolean; + HasOnlyCharts: Boolean; + HasUnwrapableData: Boolean; + CanUseOnEveryPageMode: Boolean; + end; + + TdxGridRecordArray = array of TcxCustomGridRecord; + + TdxGridViewProc = procedure(AGridView: TcxCustomGridView) of object; + + TdxGridGetCustomPageBreaksEvent = procedure(Sender: TdxGridReportLink) of object; + + TdxGridReportLinkGetCellHeightEvent = procedure(Sender: TdxGridReportLink; + AView: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem; var AHeight: Integer) of object; + + { CustomDraw Events } + + TdxGridReportLinkCustomDrawBandCellEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxGridBandedTableView; ABand: TcxGridBand; + AnItem: TdxReportCellString; var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawCellEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; AnItem: TAbstractdxReportCellData; var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawCardRowCaptionCellEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxGridCardView; ACard: TcxGridCard; ARow: TcxGridCardViewRow; + AnItem: TdxReportCellString; var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawCardRowDataCellEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxGridCardView; ACard: TcxGridCard; ARow: TcxGridCardViewRow; + AnItem: TAbstractdxReportCellData; var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawFilterBarEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxCustomGridTableView; AnItem: TdxReportCellString; + var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawFooterCellEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; ALevel: Integer; AnItem: TdxReportCellString; + var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawHeaderCellEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxGridTableView; AColumn: TcxGridColumn; + AnItem: TdxReportCellString; var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawLevelCaptionEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxCustomGridView; AnItem: TdxReportCellString; + var ADone: Boolean) of object; + + { Initializtion Events } + + TdxGridReportLinkInitializeBandCellEvent = procedure(Sender: TdxGridReportLink; + AView: TcxGridBandedTableView; ABand: TcxGridBand; AnItem: TdxReportCellString) of object; + + TdxGridReportLinkInitializeCellEvent = procedure(Sender: TdxGridReportLink; + AView: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; AnItem: TAbstractdxReportCellData) of object; + + TdxGridReportLinkInitializeCardRowCaptionCellEvent = procedure(Sender: TdxGridReportLink; + AView: TcxGridCardView; ACard: TcxGridCard; ARow: TcxGridCardViewRow; + AnItem: TdxReportCellString) of object; + + TdxGridReportLinkInitializeCardRowDataCellEvent = procedure(Sender: TdxGridReportLink; + AView: TcxGridCardView; ACard: TcxGridCard; ARow: TcxGridCardViewRow; + AnItem: TAbstractdxReportCellData) of object; + +{$IFDEF CHARTVIEW} + TdxGridReportLinkInitializeChartCellEvent = procedure(Sender: TdxGridReportLink; + AView: TcxGridChartView; AnItem: TdxReportCellGraphic) of object; +{$ENDIF} + + TdxGridReportLinkInitializeFilterBarEvent = procedure(Sender: TdxGridReportLink; + AView: TcxCustomGridTableView; AnItem: TdxReportCellString) of object; + + TdxGridReportLinkInitializeFooterCellEvent = procedure(Sender: TdxGridReportLink; + AView: TcxGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; ALevel: Integer; AnItem: TdxReportCellString) of object; + + TdxGridReportLinkInitializeHeaderCellEvent = procedure(Sender: TdxGridReportLink; + AView: TcxGridTableView; AColumn: TcxGridColumn; AnItem: TdxReportCellString) of object; + + TdxGridReportLinkInitializeLevelCaptionEvent = procedure(Sender: TdxGridReportLink; + AView: TcxCustomGridView; AnItem: TdxReportCellString) of object; + + { ReportLink } + + TdxGridReportLink = class(TdxCustomTableControlReportLink) + private + FDelimitersHardVert: TList; + FHostInfoServices: TdxGridAttributeHostInfoServices; + FOptionsCards: TdxGridReportLinkOptionsCards; +{$IFDEF CHARTVIEW} + FOptionsCharts: TdxGridReportLinkOptionsCharts; +{$ENDIF} + FOptionsDetails: TdxGridReportLinkOptionsDetails; + FOptionsLevels: TdxGridReportLinkOptionsLevels; + FProcessedView: TcxCustomGridView; + FProcessParams: TdxGridReportLinkProcessParams; + FReportRows: TList; + FOnCustomDrawBandCell: TdxGridReportLinkCustomDrawBandCellEvent; + FOnCustomDrawCardRowCaptionCell: TdxGridReportLinkCustomDrawCardRowCaptionCellEvent; + FOnCustomDrawCardRowDataCell: TdxGridReportLinkCustomDrawCardRowDataCellEvent; + FOnCustomDrawCell: TdxGridReportLinkCustomDrawCellEvent; + FOnCustomDrawFilterBar: TdxGridReportLinkCustomDrawFilterBarEvent; + FOnCustomDrawFooterCell: TdxGridReportLinkCustomDrawFooterCellEvent; + FOnCustomDrawHeaderCell: TdxGridReportLinkCustomDrawHeaderCellEvent; + FOnCustomDrawLevelCaption: TdxGridReportLinkCustomDrawLevelCaptionEvent; + FOnGetCellHeight: TdxGridReportLinkGetCellHeightEvent; + FOnGetCustomPageBreaks: TdxGridGetCustomPageBreaksEvent; + FOnInitializeBandCell: TdxGridReportLinkInitializeBandCellEvent; + FOnInitializeCardRowCaptionCell: TdxGridReportLinkInitializeCardRowCaptionCellEvent; + FOnInitializeCardRowDataCell: TdxGridReportLinkInitializeCardRowDataCellEvent; + FOnInitializeCell: TdxGridReportLinkInitializeCellEvent; +{$IFDEF CHARTVIEW} + FOnInitializeChartCell: TdxGridReportLinkInitializeChartCellEvent; +{$ENDIF} + FOnInitializeFilterBar: TdxGridReportLinkInitializeFilterBarEvent; + FOnInitializeFooterCell: TdxGridReportLinkInitializeFooterCellEvent; + FOnInitializeHeaderCell: TdxGridReportLinkInitializeHeaderCellEvent; + FOnInitializeLevelCaption: TdxGridReportLinkInitializeLevelCaptionEvent; + function GetActiveStyles: TdxGridReportLinkStyles; + function GetActiveView: TcxCustomGridView; + function GetActiveViewHelper: TdxCustomGridViewHelperClass; + function GetActiveViewMasterRow: TcxGridMasterDataRow; + function GetActiveViewParentLevel: TcxGridLevel; + function GetDesignWindow: TdxfmGridReportLinkDesignWindow; + function GetGrid: TcxGrid; + function GetOptionsExpanding: TdxGridReportLinkOptionsExpanding; + function GetOptionsFormatting: TdxGridReportLinkOptionsFormatting; + function GetOptionsOnEveryPage: TdxGridReportLinkOptionsOnEveryPage; + function GetOptionsPagination: TdxGridReportLinkOptionsPagination; + function GetOptionsPreview: TdxGridReportLinkOptionsPreview; + function GetOptionsRefinements: TdxGridReportLinkOptionsRefinements; + function GetOptionsSelection: TdxGridReportLinkOptionsSelection; + function GetOptionsSize: TdxGridReportLinkOptionsSize; + function GetOptionsView: TdxGridReportLinkOptionsView; + function GetReportRow(Index: Integer): TdxReportCell; + function GetReportRowByGridRecord(GridRecord: TcxCustomGridRecord): TdxReportCell; + function GetReportRowCount: Integer; + function GetStyles: TdxGridReportLinkStyles; + procedure SetOnCustomDrawBandCell(Value: TdxGridReportLinkCustomDrawBandCellEvent); + procedure SetOnCustomDrawCell(Value: TdxGridReportLinkCustomDrawCellEvent); + procedure SetOnCustomDrawCardRowCaptionCell(Value: TdxGridReportLinkCustomDrawCardRowCaptionCellEvent); + procedure SetOnCustomDrawCardRowDataCell(Value: TdxGridReportLinkCustomDrawCardRowDataCellEvent); + procedure SetOnCustomDrawFilterBar(Value: TdxGridReportLinkCustomDrawFilterBarEvent); + procedure SetOnCustomDrawFooterCell(Value: TdxGridReportLinkCustomDrawFooterCellEvent); + procedure SetOnCustomDrawHeaderCell(Value: TdxGridReportLinkCustomDrawHeaderCellEvent); + procedure SetOnCustomDrawLevelCaption(Value: TdxGridReportLinkCustomDrawLevelCaptionEvent); + procedure SetOptionsCards(Value: TdxGridReportLinkOptionsCards); +{$IFDEF CHARTVIEW} + procedure SetOptionsCharts(Value: TdxGridReportLinkOptionsCharts); +{$ENDIF} + procedure SetOptionsDetails(Value: TdxGridReportLinkOptionsDetails); + procedure SetOptionsExpanding(Value: TdxGridReportLinkOptionsExpanding); + procedure SetOptionsFormatting(Value: TdxGridReportLinkOptionsFormatting); + procedure SetOptionsLevels(Value: TdxGridReportLinkOptionsLevels); + procedure SetOptionsOnEveryPage(Value: TdxGridReportLinkOptionsOnEveryPage); + procedure SetOptionsPagination(Value: TdxGridReportLinkOptionsPagination); + procedure SetOptionsPreview(Value: TdxGridReportLinkOptionsPreview); + procedure SetOptionsRefinements(Value: TdxGridReportLinkOptionsRefinements); + procedure SetOptionsSelection(Value: TdxGridReportLinkOptionsSelection); + procedure SetOptionsSize(Value: TdxGridReportLinkOptionsSize); + procedure SetOptionsView(Value: TdxGridReportLinkOptionsView); + procedure SetStyles(Value: TdxGridReportLinkStyles); + protected + procedure BeforeDesignReport; override; + function CalculateActualScaleFactor: Integer; override; + procedure ConstructReport(AReportCells: TdxReportCells); override; + procedure ConvertCoords; override; + procedure CustomDraw(AItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); override; + function GetBreakPagesByHardDelimiters: Boolean; override; + function GetEmptyPagesCanExist: Boolean; override; + function GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; override; + function GetUseHardVertDelimiters: Boolean; override; + procedure InternalRestoreDefaults; override; + procedure InternalRestoreFromOriginal; override; + function IsDrawFootersOnEveryPage: Boolean; override; + function IsDrawHeadersOnEveryPage: Boolean; override; + function IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; override; + procedure MakeHardDelimiters(AReportCells: TdxReportCells; AVertDelimiters: TList); override; + + function GetAreNativeStylesAvailable: Boolean; override; + function GetStylesClass: TdxCustomReportLinkStylesClass; override; + function GetStyleSheetClass: TdxCustomReportLinkStyleSheetClass; override; + function GetStyleSheetPrototype: TdxCustomReportLinkStyleSheet; override; + procedure PrepareConstruct; override; + + procedure DoCustomDrawBandCell(ACanvas: TCanvas; AView: TcxGridBandedTableView; + ABand: TcxGridBand; AnItem: TdxReportCellString; var ADone: Boolean); dynamic; + procedure DoCustomDrawCardRowCaptionCell(ACanvas: TCanvas; AView: TcxGridCardView; + ACard: TcxGridCard; ARow: TcxGridCardViewRow; AnItem: TdxReportCellString; + var ADone: Boolean); dynamic; + procedure DoCustomDrawCardRowDataCell(ACanvas: TCanvas; AView: TcxGridCardView; + ACard: TcxGridCard; ARow: TcxGridCardViewRow; AnItem: TAbstractdxReportCellData; + var ADone: Boolean); dynamic; + procedure DoCustomDrawCell(ACanvas: TCanvas; AView: TcxCustomGridTableView; + ARecord: TcxCustomGridRecord; AColumn: TcxGridColumn; + AnItem: TAbstractdxReportCellData; var ADone: Boolean); dynamic; + procedure DoCustomDrawFilterBar(ACanvas: TCanvas; AView: TcxCustomGridTableView; + AnItem: TdxReportCellString; var ADone: Boolean); dynamic; + procedure DoCustomDrawFooterCell(ACanvas: TCanvas; AView: TcxGridTableView; + ARecord: TcxCustomGridRecord; AColumn: TcxGridColumn; ALevel: Integer; + AnItem: TdxReportCellString; var ADone: Boolean); dynamic; + procedure DoCustomDrawHeaderCell(ACanvas: TCanvas; AView: TcxGridTableView; + AColumn: TcxGridColumn; AnItem: TdxReportCellString; var ADone: Boolean); dynamic; + procedure DoCustomDrawLevelCaption(ACanvas: TCanvas; AView: TcxCustomGridView; + AnItem: TdxReportCellString; var ADone: Boolean); dynamic; + procedure DoGetCellHeight(AView: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem; var AHeight: Integer); dynamic; + procedure DoGetCustomPageBreaks; dynamic; + procedure DoInitializeBandCell(AView: TcxGridBandedTableView; ABand: TcxGridBand; + AnItem: TdxReportCellString); dynamic; + procedure DoInitializeCardRowCaptionCell(AView: TcxGridCardView; ACard: TcxGridCard; + ARow: TcxGridCardViewRow; AnItem: TdxReportCellString); dynamic; + procedure DoInitializeCardRowDataCell(AView: TcxGridCardView; ACard: TcxGridCard; + ARow: TcxGridCardViewRow; AnItem: TAbstractdxReportCellData); dynamic; + procedure DoInitializeCell(AView: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; AnItem: TAbstractdxReportCellData); dynamic; +{$IFDEF CHARTVIEW} + procedure DoInitializeChartCell(AView: TcxGridChartView; AnItem: TdxReportCellGraphic); dynamic; +{$ENDIF} + procedure DoInitializeFilterBar(AView: TcxCustomGridTableView; AnItem: TdxReportCellString); dynamic; + procedure DoInitializeFooterCell(AView: TcxGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; ALevel: Integer; AnItem: TdxReportCellString); dynamic; + procedure DoInitializeHeaderCell(AView: TcxGridTableView; AColumn: TcxGridColumn; + AnItem: TdxReportCellString); dynamic; + procedure DoInitializeLevelCaption(AView: TcxCustomGridView; AnItem: TdxReportCellString); dynamic; + + procedure CreateOptions; override; + procedure DestroyOptions; override; + function GetOptionsCardsClass: TdxGridReportLinkOptionsCardsClass; virtual; +{$IFDEF CHARTVIEW} + function GetOptionsChartsClass: TdxGridReportLinkOptionsChartsClass; virtual; +{$ENDIF} + function GetOptionsDetailsClass: TdxGridReportLinkOptionsDetailsClass; virtual; + function GetOptionsExpandingClass: TdxCustomReportLinkOptionsExpandingClass; override; + function GetOptionsFormattingClass: TdxCustomReportLinkOptionsFormattingClass; override; + function GetOptionsLevelsClass: TdxGridReportLinkOptionsLevelsClass; virtual; + function GetOptionsOnEveryPageClass: TdxCustomTableControlReportLinkOptionsOnEveryPageClass; override; + function GetOptionsPaginationClass: TdxCustomReportLinkOptionsPaginationClass; override; + function GetOptionsPreviewClass: TdxCustomTableControlReportLinkOptionsPreviewClass; override; + function GetOptionsRefinementsClass: TdxCustomReportLinkOptionsRefinementsClass; override; + function GetOptionsSelectionClass: TdxCustomTableControlReportLinkOptionsSelectionClass; override; + function GetOptionsSizeClass: TdxCustomReportLinkOptionsSizeClass; override; + function GetOptionsViewClass: TdxCustomReportLinkOptionsViewClass; override; + + procedure AddReportRow(AReportRow: TdxReportCell); + procedure AddVerticalHardDelimiter(ADelimiter: TdxReportCell); overload; + procedure AddVerticalHardDelimiter(ADelimiter: Integer); overload; + procedure BuildTopLevelView(AGridView: TcxCustomGridView); + procedure BuildTopLevelViews; + procedure BuildView(AMasterBuilder: TdxCustomGridViewBuilder; AGridView: TcxCustomGridView); + function CreateViewAdapter(AMasterAdapter: TdxCustomGridViewAdapter; AGridView: TcxCustomGridView): TdxCustomGridViewAdapter; + function CreateViewBuilder(AMasterBuilder: TdxCustomGridViewBuilder; AGridView: TcxCustomGridView): TdxCustomGridViewBuilder; + + procedure DoExpandRows; + procedure DoExpandViewRows(AGridView: TcxCustomGridView); + procedure ForEachView(AMasterRow: TcxGridMasterDataRow; AProc: TdxGridViewProc); + + function GetItemCustomDrawInfo(AnItem: TdxReportVisualItem; out ADrawInfo: TdxGridCellCustomDrawInfo): TdxGridAttributeID; virtual; + function IsCardViewStyle(AStyle: TcxStyle): Boolean; virtual; + function IsCustomDrawn(AnAttributeID: TdxGridAttributeID): Boolean; virtual; + function IsOffice11StyleGrouping: Boolean; + + procedure CalculateProcessParams; + function CanAttributeBeUsedOnEveryPage(AnAttribute: TdxGridAttributeClass): Boolean; + function IsAttributeUsedOnEveryPage(AnAttribute: TdxGridAttributeClass): Boolean; + + property ActiveStyles: TdxGridReportLinkStyles read GetActiveStyles; + property ActiveView: TcxCustomGridView read GetActiveView; + property ActiveViewHelper: TdxCustomGridViewHelperClass read GetActiveViewHelper; + property ActiveViewMasterRow: TcxGridMasterDataRow read GetActiveViewMasterRow; + property ActiveViewParentLevel: TcxGridLevel read GetActiveViewParentLevel; + property DelimitersHardVert: TList read FDelimitersHardVert; + property HostInfoServices: TdxGridAttributeHostInfoServices read FHostInfoServices; + property ProcessParams: TdxGridReportLinkProcessParams read FProcessParams; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + procedure AddPageBreak(AGridRecord: TcxCustomGridRecord); overload; + procedure AddPageBreak(const AGridRecords: array of TcxCustomGridRecord); overload; + procedure AddPageBreak(const AGridRecords: TdxGridRecordArray); overload; + procedure AddPageBreak(AGridRecords: TList); overload; // list of TcxCustomGridRecord + + property Grid: TcxGrid read GetGrid; + property DesignWindow: TdxfmGridReportLinkDesignWindow read GetDesignWindow; + property ReportRows[Index: Integer]: TdxReportCell read GetReportRow; + property ReportRowsByGridRecord[GridRow: TcxCustomGridRecord]: TdxReportCell read GetReportRowByGridRecord; + property ReportRowCount: Integer read GetReportRowCount; + published + property Color; + property Font; + property OptionsCards: TdxGridReportLinkOptionsCards read FOptionsCards write SetOptionsCards; +{$IFDEF CHARTVIEW} + property OptionsCharts: TdxGridReportLinkOptionsCharts read FOptionsCharts write SetOptionsCharts; +{$ENDIF} + property OptionsDetails: TdxGridReportLinkOptionsDetails read FOptionsDetails write SetOptionsDetails; + property OptionsExpanding: TdxGridReportLinkOptionsExpanding read GetOptionsExpanding write SetOptionsExpanding; + property OptionsFormatting: TdxGridReportLinkOptionsFormatting read GetOptionsFormatting write SetOptionsFormatting; + property OptionsLevels: TdxGridReportLinkOptionsLevels read FOptionsLevels Write SetOptionsLevels; + property OptionsOnEveryPage: TdxGridReportLinkOptionsOnEveryPage read GetOptionsOnEveryPage write SetOptionsOnEveryPage; + property OptionsPagination: TdxGridReportLinkOptionsPagination read GetOptionsPagination write SetOptionsPagination; + property OptionsPreview: TdxGridReportLinkOptionsPreview read GetOptionsPreview write SetOptionsPreview; + property OptionsRefinements: TdxGridReportLinkOptionsRefinements read GetOptionsRefinements write SetOptionsRefinements; + property OptionsSelection: TdxGridReportLinkOptionsSelection read GetOptionsSelection write SetOptionsSelection; + property OptionsSize: TdxGridReportLinkOptionsSize read GetOptionsSize write SetOptionsSize; + property OptionsView: TdxGridReportLinkOptionsView read GetOptionsView write SetOptionsView; + property ScaleFonts; + property StyleRepository; + property Styles: TdxGridReportLinkStyles read GetStyles write SetStyles; + property SupportedCustomDraw; + + property OnCustomDrawBandCell: TdxGridReportLinkCustomDrawBandCellEvent read FOnCustomDrawBandCell + write SetOnCustomDrawBandCell; + property OnCustomDrawCell: TdxGridReportLinkCustomDrawCellEvent read FOnCustomDrawCell + write SetOnCustomDrawCell; + property OnCustomDrawCardRowCaptionCell: TdxGridReportLinkCustomDrawCardRowCaptionCellEvent read FOnCustomDrawCardRowCaptionCell + write SetOnCustomDrawCardRowCaptionCell; + property OnCustomDrawCardRowDataCell: TdxGridReportLinkCustomDrawCardRowDataCellEvent read FOnCustomDrawCardRowDataCell + write SetOnCustomDrawCardRowDataCell; + property OnCustomDrawFilterBar: TdxGridReportLinkCustomDrawFilterBarEvent read FOnCustomDrawFilterBar + write SetOnCustomDrawFilterBar; + property OnCustomDrawFooterCell: TdxGridReportLinkCustomDrawFooterCellEvent read FOnCustomDrawFooterCell + write SetOnCustomDrawFooterCell; + property OnCustomDrawHeaderCell: TdxGridReportLinkCustomDrawHeaderCellEvent read FOnCustomDrawHeaderCell + write SetOnCustomDrawHeaderCell; + property OnCustomDrawLevelCaption: TdxGridReportLinkCustomDrawLevelCaptionEvent read FOnCustomDrawLevelCaption + write SetOnCustomDrawLevelCaption; + property OnGetCellHeight: TdxGridReportLinkGetCellHeightEvent read FOnGetCellHeight write FOnGetCellHeight; + property OnGetCustomPageBreaks: TdxGridGetCustomPageBreaksEvent read FOnGetCustomPageBreaks write FOnGetCustomPageBreaks; + property OnInitializeBandCell: TdxGridReportLinkInitializeBandCellEvent read FOnInitializeBandCell + write FOnInitializeBandCell; + property OnInitializeCardRowCaptionCell: TdxGridReportLinkInitializeCardRowCaptionCellEvent read FOnInitializeCardRowCaptionCell + write FOnInitializeCardRowCaptionCell; + property OnInitializeCardRowDataCell: TdxGridReportLinkInitializeCardRowDataCellEvent read FOnInitializeCardRowDataCell + write FOnInitializeCardRowDataCell; + property OnInitializeCell: TdxGridReportLinkInitializeCellEvent read FOnInitializeCell + write FOnInitializeCell; +{$IFDEF CHARTVIEW} + property OnInitializeChartCell: TdxGridReportLinkInitializeChartCellEvent read FOnInitializeChartCell + write FOnInitializeChartCell; +{$ENDIF} + property OnInitializeFilterBar: TdxGridReportLinkInitializeFilterBarEvent read FOnInitializeFilterBar + write FOnInitializeFilterBar; + property OnInitializeFooterCell: TdxGridReportLinkInitializeFooterCellEvent read FOnInitializeFooterCell + write FOnInitializeFooterCell; + property OnInitializeHeaderCell: TdxGridReportLinkInitializeHeaderCellEvent read FOnInitializeHeaderCell + write FOnInitializeHeaderCell; + property OnInitializeLevelCaption: TdxGridReportLinkInitializeLevelCaptionEvent read FOnInitializeLevelCaption + write FOnInitializeLevelCaption; + end; + + TcxGridCardView2OptionsView = class(TcxGridCardViewOptionsView) + private + FCardBorders: Boolean; + FGridLineColor: TColor; + FGridLines: TcxGridLines; + FShadowDepth: Integer; + function GetShadowVisible: Boolean; + procedure SetCardBorders(Value: Boolean); + procedure SetGridLineColor(Value: TColor); + procedure SetGridLines(Value: TcxGridLines); + procedure SetShadowDepth(Value: Integer); + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + property ShadowVisible: Boolean read GetShadowVisible; + published + property CardBorders: Boolean read FCardBorders write SetCardBorders default False; + property GridLineColor: TColor read FGridLineColor write SetGridLineColor default clDefault; + property GridLines: TcxGridLines read FGridLines write SetGridLines default glNone; + property ShadowDepth: Integer read FShadowDepth write SetShadowDepth; + end; + + TcxGridCardView2Styles = class(TcxGridCardViewStyles) + private + FOnGetCardShadowStyle: TcxGridGetRecordStyleEvent; + protected + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + public + procedure Assign(Source: TPersistent); override; + procedure GetCardShadowParams(ARecord: TcxCustomGridRecord; out AParams: TcxViewParams); virtual; + published + property CardShadow: TcxStyle index vsCardShadow read GetValue write SetValue; + property OnGetCardShadowStyle: TcxGridGetRecordStyleEvent read FOnGetCardShadowStyle + write FOnGetCardShadowStyle; + end; + + TcxGridCardView2 = class(TcxGridCardView) + protected + function GetOptionsViewClass: TcxCustomGridOptionsViewClass; override; + function GetStylesClass: TcxCustomGridViewStylesClass; override; + function GetViewDataClass: TcxCustomGridViewDataClass; override; + function GetViewInfoClass: TcxCustomGridViewInfoClass; override; + end; + + TdxfmGridReportLinkDesignWindow = class(TdxfmCustomcxControlReportLinkDesignWindow) + PageControl1: TPageControl; + tshView: TTabSheet; + tshBehaviors: TTabSheet; + tshPreview: TTabSheet; + tshCards: TTabSheet; + lblShow: TLabel; + imgShow: TImage; + bvlShow: TBevel; + chbxShowBands: TCheckBox; + chbxShowHeaders: TCheckBox; + chbxShowFooters: TCheckBox; + chbxShowGroupFooters: TCheckBox; + chbxShowExpandButtons: TCheckBox; + lblOnEveryPage: TLabel; + imgOnEveryPage: TImage; + bvlOnEveryPage: TBevel; + chbxBandsOnEveryPage: TCheckBox; + chbxHeadersOnEveryPage: TCheckBox; + chbxFootersOnEveryPage: TCheckBox; + chbxFilterBarOnEveryPage: TCheckBox; + chbxCaptionsOnEveryPage: TCheckBox; + bvlWarningHost: TBevel; + lblSelection: TLabel; + imgSelection: TImage; + chbxProcessSelection: TCheckBox; + chbxProcessExactSelection: TCheckBox; + bvlSelection: TBevel; + lblExpanding: TLabel; + imgExpanding: TImage; + chbxExpandGroupRows: TCheckBox; + bvlExpanding: TBevel; + chbxExpandMasterRows: TCheckBox; + lblPreviewOptions: TLabel; + bvlPreviewOptions: TBevel; + chbxPreviewVisible: TCheckBox; + chbxPreviewAutoHeight: TCheckBox; + lblPreviewMaxLineCount: TLabel; + bvlPreviewMaxLineCountHost: TBevel; + chbxShowCaptions: TCheckBox; + chbxShowFilterBar: TCheckBox; + imgPreview: TImage; + chbxStartFromActiveView: TCheckBox; + chbxOnlyActiveView: TCheckBox; + lblDetails: TLabel; + bvlDetails: TBevel; + imgDetails: TImage; + tshFormatting: TTabSheet; + lblLookAndFeel: TLabel; + bvlLookAndFeel: TBevel; + imgLookAndFeel: TImage; + cbxLookAndFeel: TComboBox; + chbxFlatCheckMarks: TCheckBox; + chbxDisplayGraphicsAsText: TCheckBox; + chbxTransparentGraphics: TCheckBox; + imgRefinements: TImage; + lblRefinements: TLabel; + bvlRefinements: TBevel; + bvlCardSpaceVertHost: TBevel; + bvlCardSpaceHorzHost: TBevel; + lblCardSpaceVert: TLabel; + lblCardSpaceHorz: TLabel; + imgCardSpacing: TImage; + lblCardSpacing: TLabel; + bvlCardSpacing: TBevel; + bvlCardSizes: TBevel; + lblCardSizes: TLabel; + imgCardSizes: TImage; + chbxCardsKeepSameHeight: TCheckBox; + chbxCardsKeepSameWidth: TCheckBox; + chbxCardsAutoWidth: TCheckBox; + chbxCardsVertLines: TCheckBox; + chbxCardsHorzLines: TCheckBox; + chbxCardsBorder: TCheckBox; + imgCardFraming: TImage; + lblCardFraming: TLabel; + bvlCardFraming: TBevel; + bvlCardShadowColorHost: TBevel; + lblCardShadowDepth: TLabel; + bvlCardShadow: TBevel; + lblCardShadow: TLabel; + lblCardShadowColor: TLabel; + bvlCardShadowDepthHost: TBevel; + imgCardShadow: TImage; + pnlPreview: TPanel; + PreviewGrid: TcxGrid; + PreviewBandedView: TcxGridBandedTableView; + colVendorName: TcxGridBandedColumn; + colVendorLogo: TcxGridBandedColumn; + colVendorCountry: TcxGridBandedColumn; + colCarModel: TcxGridBandedColumn; + colIsSUVModel: TcxGridBandedColumn; + PreviewGridLevel: TcxGridLevel; + chbxLevelsUnwrap: TCheckBox; + imgLevels: TImage; + lblLevels: TLabel; + bvlLevels: TBevel; + chbxLevelsUnwrapTopLevel: TCheckBox; + chbxLevelsRiseActiveLevelOntoTop: TCheckBox; + chbxSuppressBackgroundBitmaps: TCheckBox; + tshStyles: TTabSheet; + btnStyleColor: TButton; + btnStyleFont: TButton; + btnStyleBackgroundBitmap: TButton; + chbxUseNativeStyles: TCheckBox; + bvlStyles: TBevel; + pmStyles: TPopupMenu; + miStyleFont: TMenuItem; + miStyleBackgroundBitmap: TMenuItem; + miStyleColor: TMenuItem; + bvlStyleSheets: TBevel; + lblStyleSheets: TLabel; + cbxStyleSheets: TComboBox; + btnStyleSheetNew: TButton; + btnStyleSheetCopy: TButton; + btnStyleSheetDelete: TButton; + milLine: TMenuItem; + miStylesSaveAs: TMenuItem; + btnStylesSaveAs: TButton; + btnStyleSheetRename: TButton; + miStyleBackgroundBitmapClear: TMenuItem; + btnStyleBackgroundBitmapClear: TButton; + btnStyleRestoreDefaults: TButton; + miStyleRestoreDefaults: TMenuItem; + miLine2: TMenuItem; + miLine3: TMenuItem; + bvlStylesHost: TBevel; + ilStylesPopup: TImageList; + miStylesSelectAll: TMenuItem; + miLine4: TMenuItem; + lblGridSize: TLabel; + bvlGridSize: TBevel; + imgGridSize: TImage; + chbxGridAutoWidth: TCheckBox; + chbxConsumeSelectionStyle: TCheckBox; + bvlRefinementsSeparator: TBevel; + lblPagination: TLabel; + bvlPagination: TBevel; + imgPagination: TImage; + chbxPaginateOneGroupPerPage: TCheckBox; + chbxPaginateByTopLevelGroups: TCheckBox; + lblPreviewWindow: TStaticText; + cxStyleRepository1: TcxStyleRepository; + styleCardShadow: TcxStyle; + styleCardBorder: TcxStyle; + Label1: TLabel; + chbxExpandCards: TCheckBox; + lblUseNativeStyles: TLabel; + tshCharts: TTabSheet; + lblChartsOptions: TLabel; + imgCharts: TImage; + chbxChartsTransparent: TCheckBox; + bvlChartsOptions: TBevel; + chbxLevelsSkipEmptyViews: TCheckBox; + procedure OptionsViewClick(Sender: TObject); + procedure OptionsOnEveryPageClick(Sender: TObject); + procedure OptionsSelectionClick(Sender: TObject); + procedure OptionsExpandingClick(Sender: TObject); + procedure OptionsRefinementClick(Sender: TObject); + procedure LookAndFeelClick(Sender: TObject); + procedure PreviewVisibleClick(Sender: TObject); + procedure PreviewAutoHeightClick(Sender: TObject); + procedure OptionsCardsClick(Sender: TObject); + procedure IsSUVModelCustomDrawCell(Sender: TcxCustomGridTableView; + ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; + var ADone: Boolean); + procedure VendorLogoCustomDrawCell(Sender: TcxCustomGridTableView; + ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; + var ADone: Boolean); + procedure PreviewBandedViewCustomDrawColumnHeader( + Sender: TcxGridTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean); + procedure PreviewBandedViewCustomDrawBandHeader( + Sender: TcxGridBandedTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridBandHeaderViewInfo; var ADone: Boolean); + procedure PreviewBandedViewCustomDrawFooterCell( + Sender: TcxGridTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean); + procedure OptionsDetailsClick(Sender: TObject); + procedure OptionsSizeClick(Sender: TObject); + procedure OptionsLevelsClick(Sender: TObject); + procedure OptionsFormatingClick(Sender: TObject); + procedure StyleColorClick(Sender: TObject); + procedure StyleFontClick(Sender: TObject); + procedure StyleBackgroundBitmapClick(Sender: TObject); + procedure lbxStylesClick(Sender: TObject); + procedure pmStylesPopup(Sender: TObject); + procedure cbxStyleSheetsClick(Sender: TObject); + procedure StyleSheetNewClick(Sender: TObject); + procedure StyleSheetCopyClick(Sender: TObject); + procedure StyleSheetDeleteClick(Sender: TObject); + procedure StylesSaveAsClick(Sender: TObject); + procedure cbxStyleSheetsKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure StyleSheetRenameClick(Sender: TObject); + procedure PageControl1Change(Sender: TObject); + procedure StyleBackgroundBitmapClearClick(Sender: TObject); + procedure StyleRestoreDefaultsClick(Sender: TObject); + procedure miStylesSelectAllClick(Sender: TObject); + procedure OptionsPaginationClick(Sender: TObject); + procedure cbxStyleSheetsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure lblUseNativeStylesClick(Sender: TObject); + procedure chbxChartsTransparentClick(Sender: TObject); + private + ccbxCardsShadowColor: TdxPSColorCombo; + lbxStyles: TdxStylesListBox; + PreviewCardView: TcxGridCardView2; + rowVendorName: TcxGridCardViewRow; + rowVendorLogo: TcxGridCardViewRow; + rowVendorCountry: TcxGridCardViewRow; + rowCarModel: TcxGridCardViewRow; + rowIsSuvModel: TcxGridCardViewRow; + seCardsShadowDepth: TdxPSSpinEdit; + seCardsSpaceHorz: TdxPSSpinEdit; + seCardsSpaceVert: TdxPSSpinEdit; + sePreviewMaxLineCount: TdxPSSpinEdit; + wpIncorrectOnEveryPageState: TdxPSWarningPane; + + function GetActiveStyle: TcxStyle; + function GetHasSelectedStyles: Boolean; + function GetHasSelectedStylesWithAssignedBitmap: Boolean; + function GetReportLink: TdxGridReportLink; + + procedure CardShadowDepthChanged(Sender: TObject); + procedure CardShadowColorChanged(Sender: TObject); + procedure CardSpaceHorzChanged(Sender: TObject); + procedure CardSpaceVertChanged(Sender: TObject); + procedure PreviewMaxLineCountChanged(Sender: TObject); + + function CanSelectAllStyles: Boolean; + procedure ChangeActiveView(AView: TcxCustomGridView); + procedure CreateCardView; + procedure CreateControls; + procedure CustomDrawBorders(ACanvas: TcxCanvas; AViewInfo: TcxCustomGridCellViewInfo); + procedure CustomDrawFooter(ACanvas: TcxCanvas; R: TRect; AViewInfo: TcxCustomGridCellViewInfo); + procedure CustomDrawHeader(ACanvas: TcxCanvas; R: TRect; AViewInfo: TcxCustomGridCellViewInfo); + procedure CustomDrawTextRect(ACanvas: TcxCanvas; R: TRect; AViewInfo: TcxCustomGridCellViewInfo; + ABackgroundBitmap: TBitmap); + procedure InitializePreviewGrid; + procedure InitializePreviewGridStyles; + procedure LoadDataIntoPreviewGridView(AView: TcxCustomGridTableView); + procedure RecreateStylesListBox; + procedure RestoreSelectedStyles(AList: TList); + procedure SaveSelectedStyles(AList: TList); + procedure SetActivePage; + procedure UpdatePreviewGridStyles(const ACaption: string; AStyle: TcxStyle); + procedure UpdateWarningPane; + + procedure SetOptionsCardsByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsChartsByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsDetailsByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsExpandingByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsFormattingByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsLevelsByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsOnEveryPageByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsPaginationByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsRefinementsByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsSelectionByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsSizeByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsViewByIndex(Index: Integer; Value: Boolean); + protected + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + procedure LoadStrings; override; + procedure UpdateControlsState; override; + procedure UpdatePreview; override; + + function GetDesignerTabIndex: Integer; override; + procedure SetDesignerTabIndex(Value: Integer); override; + + procedure DoActiveStyleSheetChanged; override; + procedure DoFormActivated(AnActive: Boolean); override; + procedure DoRefreshStylesList; override; + procedure DoStyleChanged(const ACaption: string; AStyle: TcxStyle); override; + procedure DoStylesChanged(AStrings: TStrings; ARecreate: Boolean); override; + + procedure GetSelectedStyleNames(AStrings: TStrings); override; + procedure GetStyleNames(out AStrings: TStrings); override; + procedure GetStyleSheetNames(out AStrings: TStrings); override; + + property ActiveStyle: TcxStyle read GetActiveStyle; + property HasSelectedStyles: Boolean read GetHasSelectedStyles; + property HasSelectedStylesWithAssignedBitmap: Boolean read GetHasSelectedStylesWithAssignedBitmap; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property ReportLink: TdxGridReportLink read GetReportLink; + end; + +implementation + +{$R *.DFM} + +{658 x 466 - DesignWindow} + +{.2 - IsOffice11StyleGrouping} +{.3 - chbxTransparentRichEdits} + +uses + Registry, Forms, {$IFDEF DELPHI6}Variants, {$ENDIF}cxVariants, cxGridStrs, + cxDataUtils, dxThemeManager, {$IFDEF DXVER500}dxOffice11, {$ENDIF}dxPSGlbl, + dxPSTextOut, dxPSUtl, dxBkgnd, dxPSPopupMan, dxPSRes, dxPSImgs, Math; + +const + SortOrderMap: array[TcxGridSortOrder] of TdxCellSortOrder = (csoNone, csoUp, csoDown); + + ExpandButtonInteriorColor = clBtnFace; + DefaultFilterBarColor = clBtnShadow; + DefaultFilterBarTextColor = clWindow; + DefaultIndentWidth = 20; + DefaultDataRowLineHeight = 19; + DefaultGroupFooterLineHeight = 20; + DefaultGroupRowLineHeight = 20; + DefaultFooterLineHeight = 20; + FilterBarTextOffset = 3; + FirstCardOffset = 2; + FooterItemInflateHorz = 2; + FooterItemInflateVert = 3; + TabsAreaOffset = 2; + +var + FGridLinkStyleSheetPrototype: TdxGridReportLinkStyleSheet; + +type + TdxPSGridDataCellPos = TcxGridDataCellPos; + + TdxGridViewBuildersFactory = class(TdxCustomClassMaps) + private + function GetBuilderClass(GridView: TcxCustomGridView): TdxGridViewBuilderClass; + public + class function Instance: TdxGridViewBuildersFactory; reintroduce; overload; + function CreateViewAdapter(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView): TdxCustomGridViewAdapter; + function CreateViewBuilder(AReportLink: TdxGridReportLink; AMasterBuilder: TdxCustomGridViewBuilder; + AGridView: TcxCustomGridView): TdxCustomGridViewBuilder; + property BuilderClasses[GridView: TcxCustomGridView]: TdxGridViewBuilderClass read GetBuilderClass; default; + end; + + TdxViewHelpersFactory = class(TdxCustomClassMaps) + private + function GetHelperClass(GridView: TcxCustomGridView): TdxCustomGridViewHelperClass; + public + class function Instance: TdxViewHelpersFactory; reintroduce; overload; + function HelperClassByItem(AnItem: TdxReportVisualItem): TdxCustomGridViewHelperClass; + property HelperClasses[GridView: TcxCustomGridView]: TdxCustomGridViewHelperClass read GetHelperClass; default; + end; + + TdxRecordHelpersFactory = class(TdxCustomClassMaps) + private + function GetHelperClass(GridRecord: TcxCustomGridRecord): TdxCustomGridRecordHelperClass; + public + class function Instance: TdxRecordHelpersFactory; reintroduce; overload; + property HelperClasses[GridRecord: TcxCustomGridRecord]: TdxCustomGridRecordHelperClass read GetHelperClass; default; + end; + + + TcxCustomGridCellPainterAccess = class(TcxCustomGridCellPainter); + TcxCustomGridCellViewInfoAccess = class(TcxCustomGridCellViewInfo); + TcxCustomGridRecordAccess = class(TcxCustomGridRecord); + TcxCustomGridTableControllerAccess = class(TcxCustomGridTableController); + TcxCustomGridTableItemAccess = class(TcxCustomGridTableItem); + {$IFDEF DXVER500} + TcxCustomGridTableFilteringAccess = class(TcxCustomGridTableFiltering); + {$ENDIF} + TcxCustomGridTableOptionsViewAccess = class(TcxCustomGridTableOptionsView); + TcxCustomGridViewAccess = class(TcxCustomGridView); + TcxGridColumnAccess = class(TcxGridColumn); + TcxGridMasterDataRowAccess = class(TcxGridMasterDataRow); + TcxGridTableViewInfoAccess = class(TcxGridTableViewInfo); + + +{ Helpers } + +{ CustomGridCellPainter Helpers } + +procedure CustomGridCellPainter_DrawBorders(AInstance: TcxCustomGridCellPainter); +begin + TcxCustomGridCellPainterAccess(AInstance).DrawBorders; +end; + +{ CustomGridCellViewInfo Helpers } + +function CustomGridCellViewInfo_GetPainterClass(AInstance: TcxCustomGridCellViewInfo): TcxCustomGridCellPainterClass; +begin + Result := TcxCustomGridCellViewInfoAccess(AInstance).GetPainterClass; +end; + +{ CustomGridRecord Helpers } + +function CustomGridRecord_GetIsParent(AInstance: TcxCustomGridRecord): Boolean; +begin + Result := TcxCustomGridRecordAccess(AInstance).IsParent; +end; + +{ CustomGridTableController Helpers } + +function CustomGridTableController_GetMultiSelect(AInstance: TcxCustomGridTableController): Boolean; +begin + Result := TcxCustomGridTableControllerAccess(AInstance).MultiSelect; +end; + +{ CustomGridTableFiltering Helpers } + +function CustomGridTableFiltering_GetPosition(AInstance: TcxCustomGridTableFiltering): TcxGridFilterPosition; +begin + Result := TcxCustomGridTableFilteringAccess(AInstance).Position; +end; + +{ CustomGridTableOptionsView Helpers } + +function CustomGridTableOptionsView_GetCellAutoHeight(AInstance: TcxCustomGridTableOptionsView): Boolean; +begin + Result := TcxCustomGridTableOptionsViewAccess(AInstance).CellAutoHeight; +end; + +{ CustomGridView Helpers } + +function CustomGridView_GetBackgroundBitmaps(AInstance: TcxCustomGridView): TcxCustomGridBackgroundBitmaps; +begin + Result := TcxCustomGridViewAccess(AInstance).BackgroundBitmaps; +end; + +function CustomGridView_GetDataController(AInstance: TcxCustomGridView): TcxCustomDataController; +begin + Result := TcxCustomGridViewAccess(AInstance).DataController; +end; + +function CustomGridView_GetStyles(AInstance: TcxCustomGridView): TcxCustomGridStyles; +begin + Result := TcxCustomGridViewAccess(AInstance).Styles; +end; + +{ GridColumn Helpers } + +function GridColumn_GetFixed(AInstance: TcxGridColumn): Boolean; +begin + Result := TcxGridColumnAccess(AInstance).Fixed; +end; + +function GridColumn_DoCompareValuesForCellMerging(AInstance: TcxGridColumn; + ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: TcxEditValue; + ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: TcxEditValue): Boolean; +begin + Result := TcxGridColumnAccess(AInstance).DoCompareValuesForCellMerging(ARow1, AProperties1, AValue1, ARow2, AProperties2, AValue2); +end; + +{ GridMasterDataRow Helpers } + +procedure GridMasterDataRow_DoExpand(AInstance: TcxGridMasterDataRow; ARecurse: Boolean); +begin + TcxGridMasterDataRowAccess(AInstance).DoExpand(ARecurse); +end; + +{ GridTableViewInfo Helpers } + +procedure GridTableViewInfo_CalculateExpandButtonParams(AInstance: TcxGridTableViewInfo); +begin + TcxGridTableViewInfoAccess(AInstance).CalculateExpandButtonParams; +end; + +{ Utilities } + +function GridLinkStyleSheetPrototype: TdxGridReportLinkStyleSheet; + + function CreateStyle(AColor, AFontColor: TColor): TcxStyle; + begin + Result := TcxStyle.Create(FGridLinkStyleSheetPrototype); + with Result do + begin + Color := AColor; + Font.Name := dxPSCore.dxPSDefaultFontName; + Font.Color := AFontColor; + end; + end; + +begin + if FGridLinkStyleSheetPrototype = nil then + begin + FGridLinkStyleSheetPrototype := TdxGridReportLinkStyleSheet.Create(nil); + with FGridLinkStyleSheetPrototype.Styles as TdxGridReportLinkStyles do + begin + BandHeader := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Caption := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + CardCaptionRow := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + CardRowCaption := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Content := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + ContentEven := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + ContentOdd := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + FilterBar := CreateStyle(clBtnShadow, dxPSCore.dxDefaultContentColor); + Footer := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Group := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Header := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Preview := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + Selection := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + end; + end; + Result := FGridLinkStyleSheetPrototype; +end; + +function CreatePSDataCellPos: TdxPSGridDataCellPos; +begin + Result := TdxPSGridDataCellPos.Create; +end; + +procedure FreePSDataCellPos(out ADataCellPos: TdxPSGridDataCellPos); +begin + FreeAndNil(ADataCellPos); +end; + +procedure _LoadAllRecords(ADBDataModeController: TcxDBDataModeController; + out APrevAllRecordsAreLoaded: Boolean); +begin + APrevAllRecordsAreLoaded := not ADBDataModeController.GridMode; + if not APrevAllRecordsAreLoaded then + ADBDataModeController.GridMode := False; +end; + +procedure _UnloadAllRecords(ADBDataModeController: TcxDBDataModeController; + const APrevAllRecordsAreLoaded: Boolean); +begin + if not APrevAllRecordsAreLoaded then + ADBDataModeController.GridMode := True; +end; + +{ TdxGridViewBuildersFactory } + +function dxGridViewBuildersFactory: TdxGridViewBuildersFactory; +begin + Result := TdxGridViewBuildersFactory.Instance; +end; + +class function TdxGridViewBuildersFactory.Instance: TdxGridViewBuildersFactory; +begin + Result := inherited Instance as TdxGridViewBuildersFactory; +end; + +function TdxGridViewBuildersFactory.CreateViewAdapter(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView): TdxCustomGridViewAdapter; +begin + Result := BuilderClasses[AGridView].CreateAdapter(AMasterAdapter, AGridView); +end; + +function TdxGridViewBuildersFactory.CreateViewBuilder(AReportLink: TdxGridReportLink; + AMasterBuilder: TdxCustomGridViewBuilder; AGridView: TcxCustomGridView): TdxCustomGridViewBuilder; +begin + Result := BuilderClasses[AGridView].Create(AReportLink, AMasterBuilder, AGridView); +end; + +function TdxGridViewBuildersFactory.GetBuilderClass(GridView: TcxCustomGridView): TdxGridViewBuilderClass; +begin + Result := TdxGridViewBuilderClass(PairClasses[GridView.ClassType]); +end; + +{ TdxViewHelpersFactory } + +function dxViewHelpersFactory: TdxViewHelpersFactory; +begin + Result := TdxViewHelpersFactory.Instance; +end; + +class function TdxViewHelpersFactory.Instance: TdxViewHelpersFactory; +begin + Result := inherited Instance as TdxViewHelpersFactory; +end; + +function TdxViewHelpersFactory.HelperClassByItem(AnItem: TdxReportVisualItem): TdxCustomGridViewHelperClass; +begin + Result := HelperClasses[TcxCustomGridView(AnItem.TopLevelParent.Data)]; +end; + +function TdxViewHelpersFactory.GetHelperClass(GridView: TcxCustomGridView): TdxCustomGridViewHelperClass; +begin + if GridView = nil then + Result := nil + else + Result := TdxCustomGridViewHelperClass(PairClasses[GridView.ClassType]); +end; + +{ TdxRecordHelpersFactory } + +function dxRecordHelpersFactory: TdxRecordHelpersFactory; +begin + Result := TdxRecordHelpersFactory.Instance; +end; + +class function TdxRecordHelpersFactory.Instance: TdxRecordHelpersFactory; +begin + Result := inherited Instance as TdxRecordHelpersFactory; +end; + +function TdxRecordHelpersFactory.GetHelperClass(GridRecord: TcxCustomGridRecord): TdxCustomGridRecordHelperClass; +begin + Result := TdxCustomGridRecordHelperClass(PairClasses[GridRecord.ClassType]); +end; + +{ CLR Accesssors } + + + +{ TdxCustomGridViewHelper } + +constructor TdxCustomGridViewHelper.Create(AView: TcxCustomGridView); +begin + inherited Create; + FView := AView; +end; + +class function TdxCustomGridViewHelper.PairClass: TClass; +begin + Result := ViewClass; +end; + +class procedure TdxCustomGridViewHelper.Register; +begin + dxViewHelpersFactory.Register(Self); +end; + +class procedure TdxCustomGridViewHelper.Unregister; +begin + dxViewHelpersFactory.Unregister(Self); +end; + +class function TdxCustomGridViewHelper.ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; +begin + Result := dxGridUndefinedID; + if TClass(AnItem.Data) = TdxGridLevelCaption then + Result := dxGridLevelCaptionID; +end; + +class procedure TdxCustomGridViewHelper.ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); +begin + FillChar(ACustomDrawInfo, SizeOf(ACustomDrawInfo), 0); + with ACustomDrawInfo do + begin + GridAttributeID := ExtractCustomDrawID(AnItem); + GridView := ExtractGridView(AnItem); + end; +end; + +class function TdxCustomGridViewHelper.ExtractGridView(AnItem: TdxReportVisualItem): TcxCustomGridView; +begin + Result := TcxCustomGridView(AnItem.TopLevelParent.Data); +end; + +class function TdxCustomGridViewHelper.HasData(AView: TcxCustomGridView): Boolean; +begin + Result := True; +end; + +class function TdxCustomGridViewHelper.IsAttributeSupported(AnAttribute: TdxGridAttributeClass): Boolean; +var + Attributes: TdxGridAttributeClasses; + I: Integer; +begin + Attributes := SupportedAttributes; + + Result := True; + for I := Low(Attributes) to High(Attributes) do + if Attributes[I] = AnAttribute then Exit; + Result := False; +end; + +class function TdxCustomGridViewHelper.SupportedAttributes: TdxGridAttributeClasses; +begin + SetLength(Result, 0); + AddAttribute(Result, TdxGridLevelCaption); +end; + +class procedure TdxCustomGridViewHelper.AddAttribute(var AnAtributes: TdxGridAttributeClasses; + AnAttribute: TdxGridAttributeClass); +begin + SetLength(AnAtributes, Length(AnAtributes) + 1); + AnAtributes[Length(AnAtributes) - 1] := AnAttribute; +end; + +{$IFDEF DXVER500} +class function TdxCustomGridViewHelper.FilterPosition(AView: TcxCustomGridView): TcxGridFilterPosition; +begin + Result := fpBottom; +end; +{$ENDIF} + +class function TdxCustomGridViewHelper.IsFilterBarAtBottom(AView: TcxCustomGridView): Boolean; +begin + {$IFDEF DXVER500} + Result := FilterPosition(AView) = fpBottom; + {$ELSE} + Result := True; + {$ENDIF} +end; + +class function TdxCustomGridViewHelper.IsFilterBarAtTop(AView: TcxCustomGridView): Boolean; +begin + {$IFDEF DXVER500} + Result := FilterPosition(AView) = fpTop; + {$ELSE} + Result := False; + {$ENDIF} +end; + +class function TdxCustomGridViewHelper.IsOffice11StyleGrouping(AView: TcxCustomGridView): Boolean; +begin + Result := False; +end; + +class function TdxCustomGridViewHelper.ViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridView; +end; + +{ TdxNullGridViewHelper } + +class function TdxNullGridViewHelper.IsAttributeSupported(AnAttribute: TdxGridAttributeClass): Boolean; +begin + Result := True; +end; + +class function TdxNullGridViewHelper.ViewClass: TcxCustomGridViewClass; +begin + Result := nil; +end; + +{ TdxCustomGridTableViewHelper } + +class function TdxCustomGridTableViewHelper.ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; +begin + Result := inherited ExtractCustomDrawID(AnItem); + if Result = dxGridUndefinedID then + if TClass(AnItem.Data) = TdxGridFilterBar then + Result := dxGridFilterBarID; +end; + +class function TdxCustomGridTableViewHelper.HasData(AView: TcxCustomGridView): Boolean; +begin + Result := (AView <> nil) and (TcxCustomGridTableView(AView).ViewData.RecordCount <> 0); +end; + +class function TdxCustomGridTableViewHelper.SupportedAttributes: TdxGridAttributeClasses; +begin + Result := inherited SupportedAttributes; + AddAttribute(Result, TdxGridFilterBar); +end; + +class function TdxCustomGridTableViewHelper.ExtractRecord(AnItem: TdxReportVisualItem): TcxCustomGridRecord; +begin + Result := nil; +end; + +{$IFDEF DXVER500} +class function TdxCustomGridTableViewHelper.FilterPosition(AView: TcxCustomGridView): TcxGridFilterPosition; +begin + Result := CustomGridTableFiltering_GetPosition(TcxCustomGridTableView(AView).Filtering); +end; +{$ENDIF} + +class function TdxCustomGridTableViewHelper.ViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridTableView; +end; + +{ TdxGridCardViewHelper } + +class function TdxGridCardViewHelper.ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; +begin + Result := inherited ExtractCustomDrawID(AnItem); + if Result = dxGridUndefinedID then + if (AnItem.Parent <> nil) and (AnItem.Parent is TdxReportCardRow) then + if TClass(AnItem.Data) = TdxGridCardRowCaption then + Result := dxGridCardRowCaptionID + else + Result := dxGridCardRowDataID; +end; + +class procedure TdxGridCardViewHelper.ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); +begin + with ACustomDrawInfo do + try + inherited; + if GridAttributeID in [dxGridCardRowCaptionID, dxGridCardRowDataID] then + begin + GridCard := ExtractCard(AnItem); + GridCardRow := ExtractCardRow(AnItem); + end; + except + FillChar(ACustomDrawInfo, SizeOf(ACustomDrawInfo), 0); + GridAttributeID := dxGridUndefinedID; + end; +end; + +class function TdxGridCardViewHelper.ExtractCard(AnItem: TdxReportVisualItem): TcxGridCard; +begin + Result := ExtractRecord(AnItem) as TcxGridCard; +end; + +class function TdxGridCardViewHelper.ExtractCardRow(AnItem: TdxReportVisualItem): TcxGridCardViewRow; +begin + Result := TdxReportCardRow(AnItem.Parent).GridCardRow; +end; + +class function TdxGridCardViewHelper.ExtractRecord(AnItem: TdxReportVisualItem): TcxCustomGridRecord; +begin + Result := TdxReportCardRow(AnItem.Parent).Card.GridCard; +end; + +class function TdxGridCardViewHelper.ViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridCardView; +end; + +{ TdxGridTableViewHelper } + +class function TdxGridTableViewHelper.ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; +begin + Result := inherited ExtractCustomDrawID(AnItem); + if Result = dxGridUndefinedID then + if AnItem.Parent <> nil then + if TClass(AnItem.Parent.Data) = TdxGridHeader then + Result := dxGridHeaderID + else + if TClass(AnItem.Parent.Data) = TdxGridFooter then + Result := dxGridFooterID + else + if IsDelphiObject(AnItem.Data) and (TObject(AnItem.Data) is TcxCustomGridTableItem) then + if (AnItem.Parent.Parent <> nil) and (AnItem.Parent.Parent.Data >= 0) and + (AnItem.Parent.Parent.Data < High(Byte)) then + Result := dxGridGroupFooterID + else + Result := dxGridRecordID; +end; + +class procedure TdxGridTableViewHelper.ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); +begin + with ACustomDrawInfo do + try + inherited; + + if GridAttributeID in [dxGridFooterID, dxGridGroupFooterID, dxGridHeaderID, dxGridRecordID] then + begin + GridColumn := ExtractColumn(AnItem); + if GridAttributeID in [dxGridRecordID, dxGridGroupFooterID] then + begin + GridRecord := ExtractRecord(AnItem); + if GridAttributeID = dxGridGroupFooterID then + GroupLevel := ExtractGroupLevel(AnItem); + end + else + GroupLevel := -1; + end; + except + FillChar(ACustomDrawInfo, SizeOf(ACustomDrawInfo), 0); + GridAttributeID := dxGridUndefinedID; + end; +end; + +class function TdxGridTableViewHelper.SupportedAttributes: TdxGridAttributeClasses; +begin + Result := inherited SupportedAttributes; + AddAttribute(Result, TdxGridDetails); + AddAttribute(Result, TdxGridExpandButton); + AddAttribute(Result, TdxGridFooter); + AddAttribute(Result, TdxGridGroupFooter); + AddAttribute(Result, TdxGridGroupRow); + AddAttribute(Result, TdxGridHeader); + AddAttribute(Result, TdxGridPreview); +end; + +class function TdxGridTableViewHelper.ExtractColumn(AnItem: TdxReportVisualItem): TcxGridColumn; +begin + Result := TcxGridColumn(AnItem.Data); +end; + +class function TdxGridTableViewHelper.ExtractGroupLevel(AnItem: TdxReportVisualItem): Integer; +begin + Result := Integer(AnItem.Parent.Parent.Data); +end; + +class function TdxGridTableViewHelper.ExtractRecord(AnItem: TdxReportVisualItem): TcxCustomGridRecord; +begin + Result := TcxCustomGridRecord(AnItem.Parent.Data); +end; + +class function TdxGridTableViewHelper.ViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridTableView; +end; + +class function TdxGridTableViewHelper.IsOffice11StyleGrouping(AView: TcxCustomGridView): Boolean; +begin + {$IFDEF DXVER500} + Result := TcxGridTableView(AView).OptionsView.GroupRowStyle = grsOffice11; + {$ELSE} + Result := False; + {$ENDIF} +end; + +{ TdxGridBandedTableViewHelper } + +class function TdxGridBandedTableViewHelper.ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; +begin + Result := inherited ExtractCustomDrawID(AnItem); + if Result = dxGridUndefinedID then + if IsDelphiObject(AnItem.Data) and (TObject(AnItem.Data) is TcxGridBand) then + Result := dxGridBandID; +end; + +class procedure TdxGridBandedTableViewHelper.ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); +begin + with ACustomDrawInfo do + try + inherited; + if GridAttributeID = dxGridBandID then + GridBand := ExtractBand(AnItem); + except + FillChar(ACustomDrawInfo, SizeOf(ACustomDrawInfo), 0); + GridAttributeID := dxGridUndefinedID; + end; +end; + +class function TdxGridBandedTableViewHelper.SupportedAttributes: TdxGridAttributeClasses; +begin + Result := inherited SupportedAttributes; + AddAttribute(Result, TdxGridBandHeader); +end; + +class function TdxGridBandedTableViewHelper.ExtractBand(AnItem: TdxReportVisualItem): TcxGridBand; +begin + Result := TcxGridBand(AnItem.Data); +end; + +class function TdxGridBandedTableViewHelper.ViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridBandedTableView; +end; + +{$IFDEF CHARTVIEW} +class function TdxGridChartViewHelper.ViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridChartView; +end; + +class function TdxGridChartViewHelper.HasData(AView: TcxCustomGridView): Boolean; +begin + Result := TcxGridChartView(AView).VisibleSeriesCount <> 0; +end; +{$ENDIF} + +{ TdxCustomGridRecordHelper } + +constructor TdxCustomGridRecordHelper.Create(AAdapter: TdxCustomGridTableViewAdapter); +begin + inherited Create; + FAdapter := AAdapter; +end; + +class function TdxCustomGridRecordHelper.PairClass: TClass; +begin + Result := RecordClass; +end; + +class procedure TdxCustomGridRecordHelper.Register; +begin + dxRecordHelpersFactory.Register(Self); +end; + +class procedure TdxCustomGridRecordHelper.Unregister; +begin + dxRecordHelpersFactory.Unregister(Self); +end; + +function TdxCustomGridRecordHelper.Adapter: TdxCustomGridTableViewAdapter; +begin + Result := FAdapter; +end; + +class function TdxCustomGridRecordHelper.ProducerClass: TdxGridTableViewCustomDataRowProducerClass; +begin + Result := TdxGridTableViewCustomDataRowProducer; +end; + +class function TdxCustomGridRecordHelper.RecordClass: TcxCustomGridRecordClass; +begin + Result := TcxCustomGridRecord; +end; + +{$IFDEF DXVER500} + +function TdxCustomGridRecordHelper.GetCanCellMergingAsMaster: Boolean; +begin + Result := True; +end; + +function TdxCustomGridRecordHelper.GetCanCellMergingAsSlave: Boolean; +begin + Result := True; +end; + +{$ENDIF} + +function TdxCustomGridRecordHelper.GetHasDetails: Boolean; +begin + Result := False; +end; + +{$IFDEF DXVER500} + +function TdxCustomGridRecordHelper.GetHasExpandButton: Boolean; +begin + Result := False; +end; + +{$ENDIF} + +function TdxCustomGridRecordHelper.GetHasSelectedChildren: Boolean; +begin + Result := False; +end; + +{$IFDEF DXVER500} + +function TdxCustomGridRecordHelper.GetIsCellMergingSeparator: Boolean; +begin + Result := False; +end; + +{$ENDIF} + +function TdxCustomGridRecordHelper.GetParent: TcxCustomGridRecord; +var + I: Integer; +begin + for I := GridRecord.Index - 1 downto 0 do + begin + Result := Adapter.Records[I]; + if CustomGridRecord_GetIsParent(Result) and (Result.Level < GridRecord.Level) then + Exit; + end; + Result := nil; +end; + +{ TdxCustomGridRowHelper } + +function TdxCustomGridRowHelper.Adapter: TdxGridTableViewAdapter; +begin + Result := inherited Adapter as TdxGridTableViewAdapter; +end; + +class function TdxCustomGridRowHelper.RecordClass: TcxCustomGridRecordClass; +begin + Result := TcxCustomGridRow; +end; + +{ TdxGridDataRowHelper } + +class function TdxGridDataRowHelper.ProducerClass: TdxGridTableViewCustomDataRowProducerClass; +begin + Result := TdxGridTableViewDataRowProducer; +end; + +class function TdxGridDataRowHelper.RecordClass: TcxCustomGridRecordClass; +begin + Result := TcxGridDataRow; +end; + +function TdxGridDataRowHelper.GetRow: TcxGridDataRow; +begin + Result := inherited GridRecord as TcxGridDataRow; +end; + +{ TdxGridGroupRowHelper } + +class function TdxGridGroupRowHelper.ProducerClass: TdxGridTableViewCustomDataRowProducerClass; +begin + Result := TdxGridTableViewGroupRowProducer; +end; + +class function TdxGridGroupRowHelper.RecordClass: TcxCustomGridRecordClass; +begin + Result := TcxGridGroupRow; +end; + +{$IFDEF DXVER500} + +function TdxGridGroupRowHelper.GetCanCellMergingAsMaster: Boolean; +begin + Result := False; +end; + +function TdxGridGroupRowHelper.GetCanCellMergingAsSlave: Boolean; +begin + Result := False; +end; + +function TdxGridGroupRowHelper.GetHasExpandButton: Boolean; +begin + Result := not (dcoGroupsAlwaysExpanded in Adapter.DataController.Options); +end; + +{$ENDIF} + +function TdxGridGroupRowHelper.GetHasSelectedChildren: Boolean; +var + GroupLevel, I: Integer; + Row: TcxCustomGridRow; +begin + GroupLevel := GroupRow.Level; + for I := GroupRow.Index + 1 to Adapter.RowCount - 1 do + begin + Row := Adapter.Rows[I]; + if Row.Level <= GroupLevel then Break; + Result := Row.Selected or Adapter.RecordHelpers[Row].HasSelectedChildren; //!!! + if Result then Exit; + end; + Result := False; +end; + +function TdxGridGroupRowHelper.GetGroupRow: TcxGridGroupRow; +begin + Result := inherited GridRecord as TcxGridGroupRow; +end; + +{ TdxGridMasterDataRowHelper } + +class function TdxGridMasterDataRowHelper.ProducerClass: TdxGridTableViewCustomDataRowProducerClass; +begin + Result := TdxGridTableViewMasterRowProducer; +end; + +class function TdxGridMasterDataRowHelper.RecordClass: TcxCustomGridRecordClass; +begin + Result := TcxGridMasterDataRow; +end; + +{$IFDEF DXVER500} + +function TdxGridMasterDataRowHelper.GetCanCellMergingAsMaster: Boolean; +begin + Result := not MasterRow.Expanded; +end; + +{$ENDIF} + +function TdxGridMasterDataRowHelper.GetHasDetails: Boolean; +begin + Result := MasterRow.Expanded;// and MasterRow.ActiveDetailGridViewExists //!!! +end; + +{$IFDEF DXVER500} + +function TdxGridMasterDataRowHelper.GetHasExpandButton: Boolean; +begin + Result := True; +end; + +{$ENDIF} + +function TdxGridMasterDataRowHelper.GetHasSelectedChildren: Boolean; +begin + Result := MasterRow.Expanded; + if Result then + with dxGridViewBuildersFactory.CreateViewAdapter(Adapter, DetailView) do + try + Result := HasSelectedRecords; + finally + Free; + end; +end; + +{$IFDEF DXVER500} + +function TdxGridMasterDataRowHelper.GetIsCellMergingSeparator: Boolean; +begin + Result := MasterRow.Expanded; +end; + +{$ENDIF} + +function TdxGridMasterDataRowHelper.GetDetailView: TcxCustomGridView; +begin + if HasDetails then + Result := MasterRow.ActiveDetailGridView + else + Result := nil; +end; + +function TdxGridMasterDataRowHelper.GetMasterRow: TcxGridMasterDataRow; +begin + Result := inherited GridRecord as TcxGridMasterDataRow; +end; + +{ TdxRecordHelpersCache } + +constructor TdxRecordHelpersCache.Create(AAdapter: TdxCustomGridTableViewAdapter); +begin + inherited Create; + FAdapter := AAdapter; +end; + +function TdxRecordHelpersCache.IndexOf(ARecord: TcxCustomGridRecord): Integer; +begin + for Result := 0 to Count - 1 do + if Items[Result].RecordClass = ARecord.ClassType then + Exit; + + Result := Add(dxRecordHelpersFactory.HelperClasses[ARecord].Create(Adapter)); +end; + +function TdxRecordHelpersCache.GetHelper(ARecord: TcxCustomGridRecord): TdxCustomGridRecordHelper; +begin + Result := Items[IndexOf(ARecord)]; + Result.GridRecord := ARecord; +end; + +function TdxRecordHelpersCache.GetItem(Index: Integer): TdxCustomGridRecordHelper; +begin + Result := TdxCustomGridRecordHelper(inherited Items[Index]); +end; + +{ TdxProducerCache } + +constructor TdxProducerCache.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited Create; + FBuilder := ABuilder; +end; + +function TdxProducerCache.IndexOf(AProducerClass: TdxGridViewRowProducerClass): Integer; +begin + for Result := 0 to Count - 1 do + if Items[Result].ClassType = AProducerClass then Exit; + + Result := Add(AProducerClass.Create(Builder)); +end; + +function TdxProducerCache.GetProducer(ProducerClass: TdxGridViewRowProducerClass): TdxGridViewRowProducer; +begin + Result := Items[IndexOf(ProducerClass)]; +end; + +function TdxProducerCache.GetItem(Index: Integer): TdxGridViewRowProducer; +begin + Result := inherited Items[Index] as TdxGridViewRowProducer; +end; + +{ TdxCustomGridViewAdapter } + +constructor TdxCustomGridViewAdapter.Create(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView); +begin + inherited Create; + FMasterAdapter := AMasterAdapter; + FGridView := AGridView; + FGridView.SizeChanged(True, True); //!? +end; + +function TdxCustomGridViewAdapter.GridView: TcxCustomGridView; +begin + Result := FGridView; +end; + +class function TdxCustomGridViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridView; +end; + +function TdxCustomGridViewAdapter.Styles: TcxCustomGridStyles; +begin + Result := CustomGridView_GetStyles(GridView); +end; + +procedure TdxCustomGridViewAdapter.ExpandAllRows(AnOptionsExpanding: TdxGridReportLinkOptionsExpanding; + ARecursive: Boolean); +begin + Grid.BeginUpdate; + try + ExpandAllRowsInLevel(GridLevel, AnOptionsExpanding.ExpandMasterRows, + AnOptionsExpanding.ExpandGroupRows, ARecursive); + finally + Grid.EndUpdate; + end; +end; + +procedure TdxCustomGridViewAdapter.AfterBuilding; +begin + //GridView.CancelUpdate; +end; + +procedure TdxCustomGridViewAdapter.BeforeBuilding; +begin + //GridView.BeginUpdate; +end; + +function TdxCustomGridViewAdapter.BackgroundBitmaps: TcxCustomGridBackgroundBitmaps; +begin + Result := CustomGridView_GetBackgroundBitmaps(GridView); +end; + +function TdxCustomGridViewAdapter.GetBackgroundBitmap(Index: Integer): TBitmap; +begin + if IsBackgroundBitmapSupported(Index) then + Result := BackgroundBitmaps.GetBitmap(Index) + else + Result := nil +end; + +function TdxCustomGridViewAdapter.HasBackgroundBitmap(Index: Integer): Boolean; +var + Bitmap: TBitmap; +begin + Bitmap := BackgroundBitmaps.GetBitmap(Index); + Result := (Bitmap <> nil) and not Bitmap.Empty; +end; + +function TdxCustomGridViewAdapter.IsBackgroundBitmapSupported(Index: Integer): Boolean; +begin + Result := Index <> bbTabs; +end; + +function TdxCustomGridViewAdapter.Controller: TcxCustomGridController; +begin + Result := GridView.Controller; +end; + +function TdxCustomGridViewAdapter.DataController: TcxCustomDataController; +begin + Result := CustomGridView_GetDataController(GridView); +end; + +function TdxCustomGridViewAdapter.CreateCloneAdapter(AClone: TcxCustomGridView): TdxCustomGridViewAdapter; +begin + Result := dxGridViewBuildersFactory.CreateViewAdapter(MasterAdapter, AClone); +end; + +procedure TdxCustomGridViewAdapter.ExpandAllRowsInGridView(AGridView: TcxCustomGridView; + AMasterRows, AGroupRows: Boolean); +begin + if AGridView = nil then Exit; + with dxGridViewBuildersFactory.CreateViewAdapter(nil, AGridView) do + try + ExpandAllRowsInItself(AMasterRows, AGroupRows); + ExpandAllRowsInClones(AMasterRows, AGroupRows); + finally + Free; + end; +end; + +procedure TdxCustomGridViewAdapter.ExpandAllRowsInClones(AMasterRows, AGroupRows: Boolean); +var + I: Integer; + Clone: TcxCustomGridView; +begin + for I := 0 to GridView.CloneCount - 1 do + begin + Clone := GridView.Clones[I]; + with CreateCloneAdapter(Clone) do + try + ExpandAllRowsInGridView(Clone, AMasterRows, AGroupRows); + finally + Free; + end; + end; +end; + +procedure TdxCustomGridViewAdapter.ExpandAllRowsInLevel(ALevel: TcxGridLevel; + AMasterRows, AGroupRows: Boolean; ARecursive: Boolean); +var + I: Integer; +begin + ExpandAllRowsInGridView(ALevel.GridView, AMasterRows, AGroupRows); + if ARecursive then + for I := 0 to ALevel.VisibleCount - 1 do + ExpandAllRowsInLevel(ALevel.VisibleItems[I], AMasterRows, AGroupRows, ARecursive); +end; + +procedure TdxCustomGridViewAdapter.ExpandAllRowsInItself(AMasterRows, AGroupRows: Boolean); +begin +end; + +function TdxCustomGridViewAdapter.GetAreAllMasterRowsCollapsed: Boolean; +begin + Result := True; +end; + +function TdxCustomGridViewAdapter.GetAutoWidth: Boolean; +begin + Result := False; +end; + +function TdxCustomGridViewAdapter.GetCanUseOnEveryPageMode: Boolean; +begin + Result := False; +end; + +{$IFDEF DXVER500} +function TdxCustomGridViewAdapter.GetFilterPosition: TcxGridFilterPosition; +begin + Result := fpBottom; +end; +{$ENDIF} + +function TdxCustomGridViewAdapter.GetHasSelectedRecords: Boolean; +begin + Result := False; +end; + +function TdxCustomGridViewAdapter.GetIndentCount: Integer; +begin + Result := Ord(IsMaster); +end; + +function TdxCustomGridViewAdapter.GetIndentWidth: Integer; +begin + Result := DefaultIndentWidth; +end; + +function TdxCustomGridViewAdapter.GetIsOffice11StyleGrouping: Boolean; +begin + Result := False; +end; + +function TdxCustomGridViewAdapter.GetMasterGridRecord: TcxCustomGridRecord; +begin + Result := nil; +end; + +function TdxCustomGridViewAdapter.GetRecordCount: Integer; +begin + Result := 0; +end; + +function TdxCustomGridViewAdapter.GetViewWidthExtra: Integer; +begin + Result := Ord(IsMaster) * IndentWidth; +end; + +function TdxCustomGridViewAdapter.GetCaptionViewParams: TcxViewParams; +var + Level: TcxGridLevel; +begin + if MasterAdapter = nil then + if GridView.MasterGridView <> nil then + begin + Level := GridView.MasterGridView.Level as TcxGridLevel; + Level.Styles.GetTabParams({$IFDEF DXVER500} MasterGridRecord, {$ENDIF} GridLevel, Result); + end + else + Result := GetRootCaptionParams + else + MasterAdapter.GridLevel.Styles.GetTabParams({$IFDEF DXVER500} MasterGridRecord, {$ENDIF} GridLevel, Result); +end; + +function TdxCustomGridViewAdapter.GetFilterBarViewParams: TcxViewParams; +begin + Result.Color := clBtnShadow; + Result.Font := nil; + Result.TextColor := clWindow; +end; + +function TdxCustomGridViewAdapter.GetRootCaptionParams: TcxViewParams; +begin + Grid.RootLevelStyles.GetTabParams({$IFDEF DXVER500} nil, {$ENDIF} GridLevel, Result); +end; + +function TdxCustomGridViewAdapter.GetAbsoluteLevel: Integer; +begin + Result := GridLevel.Level; +end; + +function TdxCustomGridViewAdapter.GetCanUseLookAndFeelColors: Boolean; +begin + Result := Grid.LookAndFeel.NativeStyle and dxThemeManager.AreVisualStylesAvailable; +end; + +function TdxCustomGridViewAdapter.GetCaptionText: string; +begin + Result := GridLevel.DisplayCaption; +end; + +function TdxCustomGridViewAdapter.GetDetailsSeparatorColor: TColor; +begin + Result := MasterGridLevel.Options.DetailFrameColor; +end; + +function TdxCustomGridViewAdapter.GetDetailsSeparatorThickness: Integer; +begin + Result := MasterGridLevel.Options.DetailFrameWidth; +end; + +function TdxCustomGridViewAdapter.GetExpandButtonColor: TColor; +begin + Result := ExpandButtonInteriorColor; +end; + +function TdxCustomGridViewAdapter.GetExpandButtonSize: Integer; +begin + Result := GridView.ViewInfo.LookAndFeelPainter.ExpandButtonSize; +end; + +function TdxCustomGridViewAdapter.GetFilter: TcxDataFilterCriteria; +begin + Result := DataController.Filter; +end; + +function TdxCustomGridViewAdapter.GetFilterActive: Boolean; +begin + Result := Filter.Active; +end; + +function TdxCustomGridViewAdapter.GetFilterEmpty: Boolean; +begin + Result := Filter.FilterText = ''; +end; + +function TdxCustomGridViewAdapter.GetFilterText: string; +begin + Result := Filter.FilterCaption; + if Result = '' then + Result := cxGetResourceString(@scxGridFilterIsEmpty); +end; + +function TdxCustomGridViewAdapter.GetGrid: TcxCustomGrid; +begin + Result := GridView.Control as TcxCustomGrid; +end; + +function TdxCustomGridViewAdapter.GetGridLevel: TcxGridLevel; +begin + Result := GridView.Level as TcxGridLevel; +end; + +function TdxCustomGridViewAdapter.GetGridWidth: Integer; +begin + with Grid.ClientRect do + Result := Right - Left; +end; + +function TdxCustomGridViewAdapter.GetHasDetailsSeparator: Boolean; +begin + Result := DetailsSeparatorThickness <> 0; +end; + +function TdxCustomGridViewAdapter.GetLookAndFeelKind: TcxLookAndFeelKind; +begin + Result := Grid.LookAndFeel.Kind; +end; + +function TdxCustomGridViewAdapter.GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := Grid.LookAndFeelPainter; +end; + +function TdxCustomGridViewAdapter.GetIsDetail: Boolean; +begin + Result := GridView.IsDetail; +end; + +function TdxCustomGridViewAdapter.GetIsMaster: Boolean; +begin + Result := GridView.IsMaster; +end; + +function TdxCustomGridViewAdapter.GetMasterGridLevel: TcxGridLevel; +begin + Result := GridLevel.Parent; +end; + +function TdxCustomGridViewAdapter.GetSummary: TcxDataSummary; +begin + Result := DataController.Summary; +end; + +function TdxCustomGridViewAdapter.GetThemedCaptionColor: TColor; +begin + Result := LookAndFeelPainter.DefaultTabColor; +end; + +function TdxCustomGridViewAdapter.GetThemedCaptionTextColor: TColor; +begin + Result := LookAndFeelPainter.DefaultTabTextColor; +end; + +function TdxCustomGridViewAdapter.GetThemedFilterBarColor: TColor; +begin + Result := LookAndFeelPainter.DefaultFilterBoxColor; +end; + +function TdxCustomGridViewAdapter.GetThemedFilterBarTextColor: TColor; +begin + Result := LookAndFeelPainter.DefaultFilterBoxTextColor; +end; + +function TdxCustomGridViewAdapter.GetViewWidth: Integer; +begin + Result := GridView.Control.Width; +end; + +{ TdxCustomGridViewFormatter } + +constructor TdxCustomGridViewFormatter.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited Create; + FBuilder := ABuilder; + + FLookAndFeelItems := TList.Create; + FExpandButtons := TList.Create; + FFont := TFont.Create; + + FTransparentColor := dxPSCore.dxDefaultContentColor; +end; + +destructor TdxCustomGridViewFormatter.Destroy; +begin + FreeAndNil(FFont); + FreeAndNil(FExpandButtons); + FreeAndNil(FLookAndFeelItems); + inherited; +end; + +function TdxCustomGridViewFormatter.Builder: TdxCustomGridViewBuilder; +begin + Result := FBuilder; +end; + +function TdxCustomGridViewFormatter.Adapter: TdxCustomGridViewAdapter; +begin + Result := Builder.Adapter; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeHost(AHost: TdxReportCell); +begin + AHost.CellSides := []; + AHost.Data := Integer(Adapter.GridView); + AHost.Transparent := True; +end; + +function TdxCustomGridViewFormatter.GetHostClass: TdxReportCellClass; +begin + Result := TdxReportCell; {Host} +end; + +function TdxCustomGridViewFormatter.GetRowHostClass: TdxReportCellClass; +begin + Result := TdxReportCell; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeCaption(ACaption: TdxReportCellText); +begin + SetViewParams(ACaption, GetCaptionViewParams); + if HasBackgroundBitmap(bbTabs) then + ACaption.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbTabs); + RegisterLookAndFeelItem(ACaption, cesRaised); + ACaption.Data := Integer(TdxGridLevelCaption); + ACaption.Text := Adapter.CaptionText; + ACaption.HidePrefix := True; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeCaptionRow(ARow: TdxReportCell); +begin +end; + +procedure TdxCustomGridViewFormatter.DoReportLinkInitializeCaption(ACaption: TdxReportCellText); +begin + ReportLink.DoInitializeLevelCaption(Adapter.GridView, TdxReportCellString(ACaption)); +end; + +function TdxCustomGridViewFormatter.GetCaptionClass: TdxReportCellTextClass; +begin + Result := TdxReportCellString; +end; + +function TdxCustomGridViewFormatter.GetCaptionViewParams: TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetCaptionParams(Adapter.GridLevel, Result.NativeParams) + else + Result.NativeParams := Adapter.GetCaptionViewParams; + + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + begin + Result.NativeParams.Color := Adapter.ThemedCaptionColor; + Result.NativeParams.TextColor := Adapter.ThemedCaptionTextColor; + end; + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.FixedTransparent; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeFilterBar(AFilterBar: TdxReportCellText); +begin + SetViewParams(AFilterBar, GetFilterBarViewParams); + if HasBackgroundBitmap(bbFilterBox) then + AFilterBar.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbFilterBox); + + with AFilterBar do + begin + Data := Integer(TdxGridFilterBar); + EndEllipsis := True; + Text := Adapter.FilterText; + end; + + if not Adapter.FilterEmpty then + with TdxReportCellCheck(AFilterBar) do + begin + Checked := Adapter.FilterActive; + CheckPos := ccpLeft; + end; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeFilterBarRow(ARow: TdxReportCell); +begin +end; + +procedure TdxCustomGridViewFormatter.DoReportLinkInitializeFilterBar(AFilterBar: TdxReportCellText); +begin + ReportLink.DoInitializeFilterBar(TcxCustomGridTableView(Adapter.GridView), TdxReportCellString(AFilterBar)); +end; + +function TdxCustomGridViewFormatter.GetFilterBarClass: TdxReportCellTextClass; +const + CheckClasses: array[Boolean] of TdxReportCellTextClass = (TdxReportCellCheck, TdxReportCellString); +begin + Result := CheckClasses[Adapter.FilterEmpty]; +end; + +function TdxCustomGridViewFormatter.GetFilterBarViewParams: TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetFilterBarParams(Result.NativeParams) + else + Result.NativeParams := Adapter.GetFilterBarViewParams; + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + begin + Result.NativeParams.Color := Adapter.ThemedCaptionColor; + Result.NativeParams.TextColor := Adapter.ThemedCaptionTextColor; + end; + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.FixedTransparent; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeDetailsSeparatorRow(ARow: TdxReportCell); +begin +end; + +procedure TdxCustomGridViewFormatter.DoInitializeHorzDetailsSeparator(ASeparator: TdxReportCellBox); +begin + with ASeparator do + begin + CellSides := csTopBottom; + Color := DetailsSeparatorColor; + Transparent := False; + end; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeVertBottomDetailsSeparator(ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); +begin + DoInitializeVertDetailsSeparator(ASeparator, ASeparatorKind); + case ASeparatorKind of + vdskLeading: + ASeparator.CellSides := [csLeft, csBottom]; + vdskTrailing: + ASeparator.CellSides := [csRight, csBottom]; + end; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeVertDetailsSeparator(ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); +begin + with ASeparator do + begin + CellSides := [csLeft, csRight]; + Color := DetailsSeparatorColor; + Transparent := False; + end; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeVertTopDetailsSeparator(ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); +begin + DoInitializeVertDetailsSeparator(ASeparator, ASeparatorKind); + case ASeparatorKind of + vdskLeading: + ASeparator.CellSides := [csLeft, csTop]; + vdskTrailing: + ASeparator.CellSides := [csRight, csTop]; + end; +end; + +function TdxCustomGridViewFormatter.GetDetailsSeparatorClass: TdxReportCellBoxClass; +begin + Result := TdxReportCellBox; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeExpandButton(AnExpandButton: TdxReportCellExpandButton; + ARecord: TcxCustomGridRecord; AnIsMasterIndent: Boolean); +begin + with AnExpandButton do + begin + {3.1 added} + ButtonAlignHorz := bahCenter; + if Adapter.IsOffice11StyleGrouping and not AnIsMasterIndent then {.2} + ButtonAlignVert := bavBottom + else + ButtonAlignVert := bavCenter; + + ButtonExpanded := ARecord.Expanded; + ButtonSize := Adapter.ExpandButtonSize; + if (ReportLink.OptionsFormatting.LookAndFeelKind <> lfStandard) and not Odd(ButtonSize) then + ButtonSize := ButtonSize - 1; + ButtonInteriorColor := Adapter.ExpandButtonColor; + ButtonTransparent := IsColorTransparent(ButtonInteriorColor); + end; + RegisterExpandButton(AnExpandButton); +end; + +procedure TdxCustomGridViewFormatter.DoInitializeMasterIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer); +begin +end; + +function TdxCustomGridViewFormatter.GetMasterIndentClass: TdxReportCellExpandButtonClass; +begin + Result := TdxReportCellExpandButton; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeViewTerminator(ATerminator: TdxReportCellBox); +begin + ATerminator.CellSides := [csBottom]; + ATerminator.Transparent := True; +end; + +function TdxCustomGridViewFormatter.QueryInterface(const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +function TdxCustomGridViewFormatter._AddRef: Integer; +begin + Result := 1; +end; + +function TdxCustomGridViewFormatter._Release: Integer; +begin + Result := 1; +end; + +procedure TdxCustomGridViewFormatter.AddDelimiters; +begin + AddHorizontalDelimiters; + AddVerticalDelimiters; +end; + +procedure TdxCustomGridViewFormatter.AddHorizontalDelimiters; +begin +end; + +procedure TdxCustomGridViewFormatter.AddVerticalDelimiters; +var + I: Integer; +begin + if ReportLink.OptionsPagination.Row then + for I := 0 to Builder.ReportRowCount - 1 do + ReportLink.AddVerticalDelimiter(Builder.ReportRows[I]); +end; + +procedure TdxCustomGridViewFormatter.AfterBuilding; +begin + Adapter.AfterBuilding; + FormatLookAndFeelItems; + FormatExpandButtons; + AddDelimiters; +end; + +procedure TdxCustomGridViewFormatter.BeforeBuilding; +begin + Adapter.BeforeBuilding; + Calculate; +end; + +procedure TdxCustomGridViewFormatter.Calculate; +begin + CalculateLineHeights; +end; + +procedure TdxCustomGridViewFormatter.CalculateLineHeights; +begin + CaptionLineHeight := 2 * TabsAreaOffset + CalculateFontHeight(GetCaptionViewParams); + FilterBarLineHeight := 2 * FilterBarTextOffset + CalculateFontHeight(GetFilterBarViewParams); +end; + +function TdxCustomGridViewFormatter.GetDetailsSeparatorColor: TColor; +begin + Result := Adapter.DetailsSeparatorColor; + {with ReportLink.OptionsFormatting do + if UseNativeStyles then + begin + Result := FixedColor; + end;} +end; + +function TdxCustomGridViewFormatter.GetDetailsSeparatorThickness: Integer; +begin + Result := Adapter.DetailsSeparatorThickness; +end; + +function TdxCustomGridViewFormatter.GetHasDetailsSeparator: Boolean; +begin + Result := Adapter.HasDetailsSeparator; +end; + +function TdxCustomGridViewFormatter.GetSiteHeight: Integer; +var + ControllerIntf: IdxReportLinkController; +begin + if ReportLink.IsAggregated and + Supports(TObject(ReportLink.Controller), IdxReportLinkController, ControllerIntf) then + with ControllerIntf.GetControlSiteBounds(ReportLink.Grid) do + Result := Bottom - Top - 1 + else + with ReportLink.RealPrinterPage.PaintRectPixels do + Result := Bottom - Top - 1; +end; + +function TdxCustomGridViewFormatter.GetSiteWidth: Integer; +var + ControllerIntf: IdxReportLinkController; +begin + if ReportLink.IsAggregated and + Supports(TObject(ReportLink.Controller), IdxReportLinkController, ControllerIntf) then + with ControllerIntf.GetControlSiteBounds(ReportLink.Grid) do + Result := Right - Left - 1 + else + with ReportLink.RealPrinterPage.PaintRectPixels do + Result := Right - Left - 1; + Result := MulDiv(Result, 100, ReportLink.GetRealScaleFactor); +end; + +function TdxCustomGridViewFormatter.GetViewWidth: Integer; +begin + Result := 0; +end; + +function TdxCustomGridViewFormatter.GetViewWidthExtraAfter: Integer; +var + I: Integer; +begin + Result := 0; + + for I := 0 to AbsoluteLevel - 1 do + with Builder.AbsoluteBuilders[I].Adapter do + if HasDetailsSeparator then Inc(Result, DetailsSeparatorThickness); + + if Adapter.HasDetailsSeparator then + Inc(Result, Adapter.DetailsSeparatorThickness); +end; + +function TdxCustomGridViewFormatter.GetViewWidthExtraBefore: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to AbsoluteLevel - 1 do + with Builder.AbsoluteBuilders[I].Adapter do + begin + Inc(Result, ViewWidthExtra); + if HasDetailsSeparator then Inc(Result, DetailsSeparatorThickness); + end; + + if Adapter.HasDetailsSeparator then + Inc(Result, Adapter.DetailsSeparatorThickness); +end; + +function TdxCustomGridViewFormatter.BackgroundBitmaps: TcxCustomGridBackgroundBitmaps; +begin + Result := Adapter.BackgroundBitmaps; +end; + +function TdxCustomGridViewFormatter.GetBackgroundBitmap(Index: Integer): TBitmap; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + Result := ReportLink.Styles.GetBitmap(MapStyleBackgroundBitmapIndex(Index)) + else + Result := Adapter.GetBackgroundBitmap(Index); +end; + +function TdxCustomGridViewFormatter.GetBackgroundBitmapIndex(Index: Integer): Integer; +begin + Result := ReportLink.AddBackgroundBitmapToPool(GetBackgroundBitmap(Index)); +end; + +function TdxCustomGridViewFormatter.HasBackgroundBitmap(Index: Integer): Boolean; +var + Bitmap: TBitmap; +begin + if not ReportLink.OptionsFormatting.SuppressBackgroundBitmaps then + begin + Bitmap := GetBackgroundBitmap(Index); + Result := (Bitmap <> nil) and not Bitmap.Empty; + end + else + Result := False; +end; + +function TdxCustomGridViewFormatter.MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; +begin + case AGridBackgroundBitmapIndex of + bbTabs: + Result := vspsGridCaption; + bbContent: + Result := vspsGridContent; + bbFilterBox: + Result := vspsGridFilterBar; + else + Result := 0; + end; +end; + +function TdxCustomGridViewFormatter.CalculateFontHeight(const AParams: TdxReportItemViewParams): Integer; +begin + Result := Renderer.CalcTextPatternHeight(DC, AParams.NativeParams.Font); +end; + +procedure TdxCustomGridViewFormatter.CalculateHeight(const AParams: TdxReportItemViewParams; + var AHeight: Integer); +var + Value: Integer; +begin + Value := CalculateFontHeight(AParams); + if Value > AHeight then AHeight := Value; +end; + +function TdxCustomGridViewFormatter.GetStyleFontIndex(const AParams: TdxReportItemViewParams): Integer; +begin + if AParams.NativeParams.Font <> nil then + begin + FFont.Assign(AParams.NativeParams.Font); + if not dxPSUtl.dxIsTrueTypeFont(FFont) then + FFont.Name := ReportLink.Font.Name; + FFont.Color := ColorToRGB(AParams.NativeParams.TextColor); + FFont.Style := FFont.Style + AParams.FontStyle; + Result := ReportLink.AddFontToPool(FFont); + end + else + Result := 0; +end; + +function TdxCustomGridViewFormatter.IsColorTransparent(AColor: TColor): Boolean; +begin + Result := ColorToRGB(AColor) = ColorToRGB(TransparentColor); +end; + +procedure TdxCustomGridViewFormatter.RegisterExpandButton(AExpandButton: TdxReportCellExpandButton); +begin + FExpandButtons.Add(AExpandButton); +end; + +procedure TdxCustomGridViewFormatter.RegisterLookAndFeelItem(AnItem: TdxReportVisualItem; + AEdgeStyle: TdxCellEdgeStyle); +begin + AnItem.EdgeMode := Self.EdgeMode; + AnItem.Edge3DStyle := AEdgeStyle; + FLookAndFeelItems.Add(AnItem); +end; + +procedure TdxCustomGridViewFormatter.SetViewParams(AnItem: TdxReportVisualItem; + AGridLines: TcxGridLines; const AParams: TcxViewParams); +var + AReportItemParams: TdxReportItemViewParams; +begin + AReportItemParams.NativeParams := AParams; + AReportItemParams.CellSides := CellSidesMap[AGridLines] - [csLeft] + [csRight]; + AReportItemParams.FontStyle := []; + AReportItemParams.Transparent := IsColorTransparent(AReportItemParams.NativeParams.Color); + + SetViewParams(AnItem, AReportItemParams); +end; + +procedure TdxCustomGridViewFormatter.SetViewParams(AnItem: TdxReportVisualItem; + const AParams: TdxReportItemViewParams); +begin + AnItem.CellSides := AParams.CellSides; + AnItem.Color := ColorToRGB(AParams.NativeParams.Color); + AnItem.FontIndex := GetStyleFontIndex(AParams); + AnItem.Transparent := AParams.Transparent; +end; + +function TdxCustomGridViewFormatter.GetAbsoluteLevel: Integer; +begin + Result := Adapter.AbsoluteLevel; + if ReportLink.OptionsDetails.StartFromFocusedView then + Dec(Result, (ReportLink.ActiveView.Level as TcxGridLevel).Level); +end; + +function TdxCustomGridViewFormatter.GetAutoWidth: Boolean; +begin + Result := ReportLink.OptionsSize.AutoWidth or Adapter.AutoWidth; +end; + +function TdxCustomGridViewFormatter.GetDC: HDC; +begin + Result := ReportLink.ScreenDC; +end; + +function TdxCustomGridViewFormatter.GetEdgeMode: TdxCellEdgeMode; +const + EdgeModeMap: array[Boolean] of TdxCellEdgeMode = (cemPattern, cem3DEffects); +begin + Result := EdgeModeMap[ReportLink.OptionsFormatting.LookAndFeelKind <> lfUltraFlat]; +end; + +{$IFDEF DXVER500} +function TdxCustomGridViewFormatter.GetFilterBarPosition: TcxGridFilterPosition; +begin + Result := Adapter.FilterPosition; +end; +{$ENDIF} + +function TdxCustomGridViewFormatter.GetGridWidth: Integer; +begin + Result := Adapter.GridWidth; +end; + +function TdxCustomGridViewFormatter.GetExpandButton(Index: Integer): TdxReportCellExpandButton; +begin + Result := TdxReportCellExpandButton(FExpandButtons[Index]); +end; + +function TdxCustomGridViewFormatter.GetExpandButtonCount: Integer; +begin + Result := FExpandButtons.Count; +end; + +function TdxCustomGridViewFormatter.GetIndentWidth: Integer; +begin + Result := Adapter.IndentWidth; +end; + +function TdxCustomGridViewFormatter.GetLookAndFeelItem(Index: Integer): TdxReportVisualItem; +begin + Result := TdxReportVisualItem(FLookAndFeelItems[Index]); +end; + +function TdxCustomGridViewFormatter.GetLookAndFeelItemCount: Integer; +begin + Result := FLookAndFeelItems.Count; +end; + +function TdxCustomGridViewFormatter.GetPaginateByTopLevelGroups: Boolean; +begin + Result := ReportLink.OptionsPagination.TopLevelGroup; +end; + +function TdxCustomGridViewFormatter.GetRenderer: TdxPSReportRenderer; +begin + Result := ReportLink.Renderer; +end; + +function TdxCustomGridViewFormatter.GetReportLink: TdxGridReportLink; +begin + Result := Builder.ReportLink; +end; + +function TdxCustomGridViewFormatter.GetShowCaption: Boolean; +begin + Result := ReportLink.OptionsView.Caption; +end; + +function TdxCustomGridViewFormatter.GetShowFilterBar: Boolean; +begin + Result := ReportLink.OptionsView.FilterBar; +end; + +function TdxCustomGridViewFormatter.GetUseLookAndFeelColors: Boolean; +begin + Result := ReportLink.OptionsFormatting.UseLookAndFeelColors; +end; + +function TdxCustomGridViewFormatter.GetViewAvailableWidth: Integer; +begin + if ReportLink.OptionsSize.AutoWidth then + Result := SiteWidth + else + Result := Adapter.ViewWidth; + Dec(Result, ViewWidthExtraBefore + ViewWidthExtraAfter); +end; + +function TdxCustomGridViewFormatter.GetViewWidthExtra: Integer; +begin + Result := Adapter.ViewWidthExtra; +end; + +procedure TdxCustomGridViewFormatter.FormatLookAndFeelItems; +const + Borders3D: array[TdxCellEdgeStyle, Boolean] of TdxPSCellBorderClass = + ((TdxPSCellRaisedBorder, TdxPSCellRaisedSoftBorder), + (TdxPSCellSunkenBorder, TdxPSCellSunkenSoftBorder)); +var + I: Integer; +begin + for I := 0 to LookAndFeelItemCount - 1 do + with LookAndFeelItems[I] do + if ReportLink.Effects3D then + BorderClass := Borders3D[Edge3DStyle, ReportLink.Soft3D] + else + BorderClass := TdxPSCellUltraFlatBorder; +end; + +procedure TdxCustomGridViewFormatter.FormatExpandButtons; +var + I: Integer; +begin + for I := 0 to ExpandButtonCount - 1 do + with ExpandButtons[I] do + begin + ButtonBorder3D := ReportLink.Effects3D; + ButtonBorder3DSoft := ReportLink.Soft3D; + end; +end; + +{ TdxCustomGridViewBuilder } + +constructor TdxCustomGridViewBuilder.Create(AReportLink: TdxGridReportLink; + AMasterBuilder: TdxCustomGridViewBuilder; AGridView: TcxCustomGridView); + + function GetMasterAdapter: TdxCustomGridViewAdapter; + begin + if AMasterBuilder = nil then + Result := nil + else + Result := AMasterBuilder.Adapter; + end; + +begin + inherited Create; + FReportLink := AReportLink; + FMasterBuilder := AMasterBuilder; + FGridView := AGridView; + + FAdapter := CreateAdapter(GetMasterAdapter, GridView); + FFormatter := FormatterClass.Create(Self); + FProducerCache := TdxProducerCache.Create(Self); + FReportRows := TList.Create; + + if MasterBuilder <> nil then + MasterBuilder.FDetailsBuilder := Self; +end; + +destructor TdxCustomGridViewBuilder.Destroy; +begin + if MasterBuilder <> nil then + MasterBuilder.FDetailsBuilder := nil; + FreeAndNil(FReportRows); + FreeAndNil(FProducerCache); + FreeAndNil(FFormatter); + FreeAndNil(FAdapter); + inherited; +end; + +function TdxCustomGridViewBuilder.Adapter: TdxCustomGridViewAdapter; +begin + Result := FAdapter; +end; + +class function TdxCustomGridViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxCustomGridViewAdapter; +end; + +class function TdxCustomGridViewBuilder.CreateAdapter(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView): TdxCustomGridViewAdapter; +begin + Result := AdapterClass.Create(AMasterAdapter, AGridView); +end; + +function TdxCustomGridViewBuilder.Formatter: TdxCustomGridViewFormatter; +begin + Result := FFormatter; +end; + +class function TdxCustomGridViewBuilder.FormatterClass: TdxGridViewFormatterClass; +begin + Result := TdxCustomGridViewFormatter; +end; + +procedure TdxCustomGridViewBuilder.Build; +begin + BeforeBuilding; + try + DoBuild; + finally + AfterBuilding; + end; +end; + +function TdxCustomGridViewBuilder.IsAborted: Boolean; +begin + Result := ReportLink.AbortBuilding; +end; + +procedure TdxCustomGridViewBuilder.Progress(const APercentDone: Double); +begin + ReportLink.DoProgress(APercentDone); +end; + +class function TdxCustomGridViewBuilder.PairClass: TClass; +begin + Result := GridViewClass; +end; + +class procedure TdxCustomGridViewBuilder.Register; +begin + dxGridViewBuildersFactory.Register(Self); +end; + +class procedure TdxCustomGridViewBuilder.Unregister; +begin + dxGridViewBuildersFactory.Unregister(Self); +end; + +procedure TdxCustomGridViewBuilder.AddReportRow(ARow: TdxReportCell); +begin + if ARow.Parent = ReportLink.ReportCells.Cells then + FReportRows.Add(ARow); +end; + +procedure TdxCustomGridViewBuilder.AfterBuilding; +begin + if not IsAborted then Formatter.AfterBuilding; +end; + +procedure TdxCustomGridViewBuilder.BeforeBuilding; +begin + Formatter.BeforeBuilding; +end; + +procedure TdxCustomGridViewBuilder.DoBuild; +begin + DoBuildViewHeader; + DoBuildViewBody; + if not IsAborted then DoBuildViewFooter; +end; + +procedure TdxCustomGridViewBuilder.DoBuildViewBody; +begin +end; + +procedure TdxCustomGridViewBuilder.DoBuildViewFooter; +begin +end; + +procedure TdxCustomGridViewBuilder.DoBuildViewHeader; +begin +end; + +function TdxCustomGridViewBuilder.GetViewAvailableWidth: Integer; +begin + Result := Formatter.ViewAvailableWidth; +end; + +procedure TdxCustomGridViewBuilder.CreateCaption; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetCaptionProducer.Produce(HostInfoServices.CaptionHostInfo); + AddReportRow(ReportRow); +end; + +function TdxCustomGridViewBuilder.GetCaptionProducer: TdxGridViewCaptionProducer; +begin + Result := ProducerCache[GetCaptionProducerClass] as TdxGridViewCaptionProducer; +end; + +function TdxCustomGridViewBuilder.GetCaptionProducerClass: TdxGridViewCaptionProducerClass; +begin + Result := TdxGridViewCaptionProducer; +end; + +procedure TdxCustomGridViewBuilder.CreateBottomDetailsSeparator; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetDetailsBottomSeparatorProducer.Produce(HostInfoServices.LevelSeparatorBottomHostInfo); + AddReportRow(ReportRow); +end; + +procedure TdxCustomGridViewBuilder.CreateTopDetailsSeparator; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetDetailsTopSeparatorProducer.Produce(HostInfoServices.LevelSeparatorTopHostInfo); + AddReportRow(ReportRow); +end; + +function TdxCustomGridViewBuilder.GetDetailsBottomSeparatorProducer: TdxGridViewDetailsSeparatorProducer; +begin + Result := ProducerCache[GetDetailsBottomSeparatorProducerClass] as TdxGridViewDetailsSeparatorProducer; +end; + +function TdxCustomGridViewBuilder.GetDetailsBottomSeparatorProducerClass: TdxGridViewDetailsSeparatorProducerClass; +begin + Result := TdxGridViewDetailsBottomSeparatorProducer; +end; + +function TdxCustomGridViewBuilder.GetDetailsTopSeparatorProducer: TdxGridViewDetailsSeparatorProducer; +begin + Result := ProducerCache[GetDetailsTopSeparatorProducerClass] as TdxGridViewDetailsSeparatorProducer; +end; + +function TdxCustomGridViewBuilder.GetDetailsTopSeparatorProducerClass: TdxGridViewDetailsSeparatorProducerClass; +begin + Result := TdxGridViewDetailsTopSeparatorProducer; +end; + +procedure TdxCustomGridViewBuilder.CreateFilterBar; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetFilterBarProducer.Produce(HostInfoServices.FilterBarHostInfo); + AddReportRow(ReportRow); +end; + +function TdxCustomGridViewBuilder.GetFilterBarProducer: TdxGridViewFilterBarProducer; +begin + Result := ProducerCache[GetFilterBarProducerClass] as TdxGridViewFilterBarProducer; +end; + +function TdxCustomGridViewBuilder.GetFilterBarProducerClass: TdxGridViewFilterBarProducerClass; +begin + Result := TdxGridViewFilterBarProducer; +end; + +procedure TdxCustomGridViewBuilder.CreateViewTerminator; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetViewTerminatorProducer.Produce(HostInfoServices.PageDetailsHostInfo); + AddReportRow(ReportRow); +end; + +function TdxCustomGridViewBuilder.GetViewTerminatorProducer: TdxGridViewTerminatorProducer; +begin + Result := ProducerCache[GetViewTerminatorProducerClass] as TdxGridViewTerminatorProducer; +end; + +function TdxCustomGridViewBuilder.GetViewTerminatorProducerClass: TdxGridViewTerminatorProducerClass; +begin + Result := TdxGridViewTerminatorProducer; +end; + +function TdxCustomGridViewBuilder.GridView: TcxCustomGridView; +begin + Result := FGridView; +end; + +class function TdxCustomGridViewBuilder.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridView; +end; + +function TdxCustomGridViewBuilder.GetAbsoluteBuilder(AIndex: Integer): TdxCustomGridViewBuilder; +begin + Result := RootBuilder; + while AIndex > 0 do + begin + Result := Result.DetailsBuilder; + Dec(AIndex); + end; +end; + +function TdxCustomGridViewBuilder.GetAutoWidth: Boolean; +begin + Result := Formatter.AutoWidth; +end; + +function TdxCustomGridViewBuilder.GetGridLevel: TcxGridLevel; +begin + Result := GridView.Level as TcxGridLevel; +end; + +function TdxCustomGridViewBuilder.GetGrid: TcxCustomGrid; +begin + Result := ReportLink.Grid; +end; + +function TdxCustomGridViewBuilder.GetHost: TdxReportCell; +begin + Result := ReportLink.ReportCells.Cells; +end; + +function TdxCustomGridViewBuilder.GetHostInfoServices: TdxGridAttributeHostInfoServices; +begin + Result := ReportLink.HostInfoServices; +end; + +function TdxCustomGridViewBuilder.GetReportRow(Index: Integer): TdxReportCell; +begin + Result := TdxReportCell(FReportRows[Index]); +end; + +function TdxCustomGridViewBuilder.GetReportRowCount: Integer; +begin + Result := FReportRows.Count; +end; + +function TdxCustomGridViewBuilder.GetRootBuilder: TdxCustomGridViewBuilder; +begin + Result := Self; + while Result.MasterBuilder <> nil do + Result := Result.MasterBuilder; +end; + +{ TdxCustomGridTableViewAdapter } + +constructor TdxCustomGridTableViewAdapter.Create(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView); +begin + inherited; + FRecordHelpersCache := TdxRecordHelpersCache.Create(Self); + FDetailsLineCount := -1; +end; + +destructor TdxCustomGridTableViewAdapter.Destroy; +begin + FreeAndNil(FRecordHelpersCache); + inherited; +end; + +function TdxCustomGridTableViewAdapter.ForEachRecord(AProc: TdxGridTableAdapterForEachRecordProc; + AData: Integer; AProcessSelection: Boolean): Boolean; +var + I: Integer; + Continue: Boolean; + Record_: TcxCustomGridRecord; +begin + Result := True; + if @AProc = nil then Exit; + + Continue := True; + for I := 0 to RecordCount - 1 do + begin + Record_ := Records[I]; + if not AProcessSelection or Record_.Selected then + AProc(Record_, AData, Continue); + if not Continue then + begin + Result := False; + Break; + end; + end; +end; + +function TdxCustomGridTableViewAdapter.GridView: TcxCustomGridTableView; +begin + Result := inherited GridView as TcxCustomGridTableView; +end; + +class function TdxCustomGridTableViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridTableView; +end; + +function TdxCustomGridTableViewAdapter.Styles: TcxCustomGridTableViewStyles; +begin + Result := inherited Styles as TcxCustomGridTableViewStyles; +end; + +function TdxCustomGridTableViewAdapter.CalculateDetailsLineCount: Integer; +begin + Result := 1; +end; + +function TdxCustomGridTableViewAdapter.GetContentViewParams(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem; AIsDataCell: Boolean = False): TcxViewParams; +begin + if (ATableItem <> nil) and (ATableItem.Styles <> nil) then + ATableItem.Styles.GetContentParams(ARecord, Result) + else + Styles.GetContentParams(ARecord, ATableItem, Result); + if Result.Color = clWindow then // 3.2 + Result.Color := dxPSCore.dxDefaultContentColor; +end; + +function TdxCustomGridTableViewAdapter.GetPreviewViewParams(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem): TcxViewParams; +begin + Result := GetContentViewParams(ARecord, ATableItem); +end; + +function TdxCustomGridTableViewAdapter.GetSelectionViewParams: TcxViewParams; +begin + FillChar(Result, SizeOf(Result), 0); + with Styles.Selection do + begin + Result.Bitmap := Bitmap; + Result.Color := Color; + Result.Font := Font; + Result.TextColor := TextColor; + end; +end; + +function TdxCustomGridTableViewAdapter.HasSelectionStyle: Boolean; +begin + Result := Styles.Selection <> nil; +end; + +function TdxCustomGridTableViewAdapter.Controller: TcxCustomGridTableController; +begin + Result := inherited Controller as TcxCustomGridTableController; +end; + +procedure TdxCustomGridTableViewAdapter.DoExpandMasterRow(ARecord: TcxCustomGridRecord; + AData: Integer; var AContinue: Boolean); +begin + if (ARecord is TcxGridMasterDataRow) and ARecord.Expandable then + GridMasterDataRow_DoExpand(TcxGridMasterDataRow(ARecord), True); + {begin + ARecord.Expanded := True; + with TcxGridMasterDataRow(ARecord) do + if ActiveDetailGridViewExists then + ExpandAllRowsInGridView(ActiveDetailGridView, True, Boolean(AData)); + end;} +end; + +procedure TdxCustomGridTableViewAdapter.ExpandAllGroupRows; +begin + DataController.Groups.FullExpand; +end; + +procedure TdxCustomGridTableViewAdapter.ExpandAllMasterRows(AnExpandGroups: Boolean); +begin + ForEachRecord(DoExpandMasterRow, Integer(AnExpandGroups), False); +end; + +procedure TdxCustomGridTableViewAdapter.ExpandAllRowsInItself(AMasterRows, AGroupRows: Boolean); +begin + if AGroupRows then ExpandAllGroupRows; + if AMasterRows then ExpandAllMasterRows(AGroupRows); +end; + +function TdxCustomGridTableViewAdapter.GetAreAllMasterRowsCollapsed: Boolean; +begin + Result := ForEachRecord(IsMasterRowCollapsed, 0, False); +end; + +function TdxCustomGridTableViewAdapter.GetCanUseOnEveryPageMode: Boolean; +begin + Result := RecordCount <> 0; +end; + +function TdxCustomGridTableViewAdapter.GetHasSelectedRecords: Boolean; +var + I: Integer; +begin + Result := SelectedRecordCount <> 0; + if not Result then + for I := 0 to RecordCount - 1 do + begin + Result := RecordHelpers[Records[I]].HasSelectedChildren; + if Result then Break; + end; +end; + +function TdxCustomGridTableViewAdapter.GetMasterGridRecord: TcxCustomGridRecord; +begin + Result := GridView.MasterGridRecord; +end; + +function TdxCustomGridTableViewAdapter.GetRecordCount: Integer; +begin + Result := GridView.ViewData.RecordCount; +end; + +class function TdxCustomGridTableViewAdapter.GetProperties(AnItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxCustomEditProperties; +begin + Result := AnItem.GetProperties(ARecord); + if Result = nil then + Result := GetRepositoryItem(AnItem, ARecord).Properties; +end; + +class function TdxCustomGridTableViewAdapter.GetPropertiesClass(AnItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxCustomEditPropertiesClass; +begin + Result := TcxCustomEditPropertiesClass(GetProperties(AnItem, ARecord).ClassType); +end; + +class function TdxCustomGridTableViewAdapter.GetRepositoryItem(AnItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxEditRepositoryItem; +begin + Result := AnItem.GetRepositoryItem; +end; + +procedure TdxCustomGridTableViewAdapter.IsMasterRowCollapsed(ARecord: TcxCustomGridRecord; + AData: Integer; var AContinue: Boolean); +begin + if ARecord is TcxGridMasterDataRow then + AContinue := not ARecord.Expanded; +end; + +function TdxCustomGridTableViewAdapter.GetCellAutoHeight: Boolean; +begin + Result := CustomGridTableOptionsView_GetCellAutoHeight(GridView.OptionsView); +end; + +function TdxCustomGridTableViewAdapter.GetCellMultiline: Boolean; +begin + Result := CustomGridTableOptionsView_GetCellAutoHeight(GridView.OptionsView); +end; + +{$IFDEF DXVER500} +function TdxCustomGridTableViewAdapter.GetFilterPosition: TcxGridFilterPosition; +begin + Result := CustomGridTableFiltering_GetPosition(Filtering); +end; +{$ENDIF} + +function TdxCustomGridTableViewAdapter.GetGridLineColor: TColor; +begin + Result := GridView.LookAndFeelPainter.DefaultGridLineColor; +end; + +function TdxCustomGridTableViewAdapter.GetCellEndEllipsis: Boolean; +begin + Result := GridView.OptionsView.CellEndEllipsis; +end; +function TdxCustomGridTableViewAdapter.GetDetailsLineCount: Integer; +begin + if FDetailsLineCount = -1 then + FDetailsLineCount := CalculateDetailsLineCount; + Result := FDetailsLineCount; +end; + +function TdxCustomGridTableViewAdapter.GetFiltering: TcxCustomGridTableFiltering; +begin + Result := GridView.Filtering; +end; + +function TdxCustomGridTableViewAdapter.GetIsGridMode: Boolean; +begin + Result := DataController.IsGridMode; +end; + +function TdxCustomGridTableViewAdapter.GetRecord(Index: Integer): TcxCustomGridRecord; +begin + Result := GridView.ViewData.Records[Index]; +end; + +function TdxCustomGridTableViewAdapter.GetRecordHelper(ARecord: TcxCustomGridRecord): TdxCustomGridRecordHelper; +begin + Result := RecordHelpersCache.Helpers[ARecord]; +end; + +function TdxCustomGridTableViewAdapter.GetSelectedRecord(Index: Integer): TcxCustomGridRecord; +begin + Result := Controller.SelectedRecords[Index] +end; + +function TdxCustomGridTableViewAdapter.GetSelectedRecordCount: Integer; +begin + if CustomGridTableController_GetMultiSelect(Controller) then + Result := Controller.SelectedRecordCount + else + Result := 0; +end; + +{ TdxCustomGridTableViewFormatter } + +constructor TdxCustomGridTableViewFormatter.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited; + FRecordIndexes := TList.Create; + FSelectedRecordList := TList.Create; + //if ReportLink.OptionsSelection.ProcessSelection then BuildSelectedRecordList; {moved to BeforeBuilding in 3.03} +end; + +destructor TdxCustomGridTableViewFormatter.Destroy; +begin + FreeAndNil(FRecordIndexes); + FreeAndNil(FSelectedRecordList); + inherited; +end; + +function TdxCustomGridTableViewFormatter.Adapter: TdxCustomGridTableViewAdapter; +begin + Result := inherited Adapter as TdxCustomGridTableViewAdapter; +end; + +function TdxCustomGridTableViewFormatter.Builder: TdxCustomGridTableViewBuilder; +begin + Result := inherited Builder as TdxCustomGridTableViewBuilder; +end; + +function TdxCustomGridTableViewFormatter.IndexOfRecord(ARecord: TcxCustomGridRecord): Integer; +begin + for Result := 0 to RecordCount - 1 do + if Records[Result] = ARecord then Exit; + Result := -1; +end; + +procedure TdxCustomGridTableViewFormatter.CheckDisplayValuePost( + AProperties: TcxCustomEditProperties; ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnItem: TAbstractdxReportCellData); +var + S: string; +begin + if (ATableItem <> nil) and (ARecord <> nil) and (AnItem is TdxReportCellText) and + (AProperties.GetEditValueSource(False) = evsValue) then + begin + S := TdxReportCellText(AnItem).Text; + TcxCustomGridTableItemAccess(ATableItem).DoGetDisplayText(ARecord, S); + TdxReportCellText(AnItem).Text := S; + end; +end; + +procedure TdxCustomGridTableViewFormatter.DoInitializeItem(AnItem: TAbstractdxReportCellData; + ATableItem: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False); + + function GetContentBackgroundBitmapStyleIndex: Integer; + begin + if AnIsPreview then + Result := bbPreview + else + Result := Self.GetContentBackgroundBitmapStyleIndex(ATableItem); + end; + +var + Properties: TcxCustomEditProperties; + ViewParams: TdxReportItemViewParams; + CellValue: TcxEditValue; + ContentBackgroundBitmapStyleIndex: Integer; +begin + Properties := GetItemProperties(ATableItem, ARecord); + ViewParams := GetItemViewParams(ATableItem, ARecord, AnIsPreview, True); + CellValue := GetItemValue(Properties, ATableItem, ARecord); + + dxPScxCommon.dxPSDataMaps.InitializeItem(AnItem, Properties, CellValue, Self, + ViewParams, AnIsPreview, ARecord.RecordIndex, ATableItem); + CheckDisplayValuePost(Properties, ATableItem, ARecord, AnItem); + dxPScxCommon.dxPSDataMaps.GetImageLists(Properties, ReportLink.AppendImageList); + SetViewParams(AnItem, ViewParams); + + ContentBackgroundBitmapStyleIndex := GetContentBackgroundBitmapStyleIndex; + if HasBackgroundBitmap(ContentBackgroundBitmapStyleIndex) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(ContentBackgroundBitmapStyleIndex); + + AnItem.Data := Integer(ATableItem); +end; + +function TdxCustomGridTableViewFormatter.GetItemClass(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False): TdxReportCellDataClass; +begin + Result := dxPSDataMaps.ItemClass(GetItemProperties(ATableItem, ARecord), AnIsPreview); +end; + +function TdxCustomGridTableViewFormatter.GetItemProperties(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxCustomEditProperties; +begin + Result := Adapter.GetProperties(ATableItem, ARecord); +end; + +function TdxCustomGridTableViewFormatter.GetItemValue(AProperties: TcxCustomEditProperties; + ATableItem: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord): TcxEditValue; +var + S: string; +begin + if AProperties.GetEditValueSource(False) = evsValue then + Result := ARecord.Values[ATableItem.Index] + else + begin + S := ARecord.DisplayTexts[ATableItem.Index]; + TcxCustomGridTableItemAccess(ATableItem).DoGetDisplayText(ARecord, S); + Result := S; + end; +end; + +function TdxCustomGridTableViewFormatter.GetItemViewParams(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False; AIsDataCell: Boolean = False): TdxReportItemViewParams; +begin + FillChar(Result, 0, SizeOf(Result)); + if ReportLink.OptionsFormatting.UseNativeStyles then + if CanProcessSelectionStyle(ARecord) then + ReportLink.Styles.GetSelectionParams(Result.NativeParams) + else + if AnIsPreview then + ReportLink.Styles.GetPreviewParams(ARecord, ATableItem, Result.NativeParams) + else + ReportLink.Styles.GetContentParams(ARecord, ATableItem, Result.NativeParams) + else + if CanProcessSelectionStyle(ARecord) then + Result.NativeParams := Adapter.GetSelectionViewParams + else + if AnIsPreview then + Result.NativeParams := Adapter.GetPreviewViewParams(ARecord, ATableItem) + else + Result.NativeParams := Adapter.GetContentViewParams(ARecord, ATableItem, AIsDataCell); +end; + +{ IdxPSCellParams } + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetAutoHeight: Boolean; +begin + Result := Adapter.CellAutoHeight; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetDC: HDC; +begin + Result := Self.DC; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetDisplayGraphicsAsText: Boolean; +begin + Result := ReportLink.OptionsRefinements.DisplayGraphicsAsText; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetEndEllipsis: Boolean; +begin + Result := Adapter.CellEndEllipsis; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetFlatCheckMarks: Boolean; +begin + Result := ReportLink.OptionsRefinements.FlatCheckMarks; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetGraphicsText: string; +begin + Result := ReportLink.OptionsRefinements.GraphicsText; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetMultiline: Boolean; +begin + Result := Adapter.CellMultiline; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetTransparentGraphics: Boolean; +begin + Result := ReportLink.OptionsRefinements.TransparentGraphics; +end; + +{ IdxPSCellParams2 } +function TdxCustomGridTableViewFormatter.IdxPSCellParams2_GetPreviewMarginLeft: Integer; +begin + Result := dxTextSpace; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams2_GetPreviewMarginRight: Integer; +begin + Result := dxTextSpace; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams2_GetPreviewMaxHeight: Integer; +begin + Result := -1; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams2_GetPreviewMaxLineCount: Integer; +begin + Result := -1; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams2_GetRichEditGraphicClass: TGraphicClass; +const + GraphicClasses: array[Boolean] of TGraphicClass = (TMetafile, TBitmap); +begin + Result := GraphicClasses[IdxPSCellParams2_GetRichEditTransparent]; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams2_GetRichEditTransparent: Boolean; +begin + {$IFDEF DXVER500} + Result := ReportLink.OptionsRefinements.TransparentRichEdits; + {$ELSE} + Result := False; + {$ENDIF} +end; + +procedure TdxCustomGridTableViewFormatter.AfterBuilding; +begin + inherited; + ReportLink.ReportCells.BorderColor := GridLineColor; +end; + +procedure TdxCustomGridTableViewFormatter.BeforeBuilding; +begin + inherited; + if ReportLink.OptionsSelection.ProcessSelection then BuildSelectedRecordList; +end; + +procedure TdxCustomGridTableViewFormatter.BuildSelectedRecordList; +var + I: Integer; + ARecord: TcxCustomGridRecord; + IsRecordIncluded: Boolean; + Helper: TdxCustomGridRecordHelper; +begin + SelectedRecordList.Clear; + + for I := 0 to Adapter.RecordCount - 1 do + begin + ARecord := Adapter.Records[I]; + IsRecordIncluded := ARecord.Selected; + if not IsRecordIncluded then + begin + Helper := Adapter.RecordHelpers[ARecord]; + IsRecordIncluded := Helper.HasSelectedChildren or + (not ReportLink.OptionsSelection.ProcessExactSelection and (SelectedRecordList.IndexOf(Helper.Parent) <> -1)); + end; + + if IsRecordIncluded then + SelectedRecordList.Add(ARecord); + end; +end; + +function TdxCustomGridTableViewFormatter.CanProcessSelectionStyle(ARecord: TcxCustomGridRecord): Boolean; +begin + Result := (ARecord <> nil) and ReportLink.OptionsFormatting.ConsumeSelectionStyle and IsSelectedRecord(ARecord); + if Result and not ReportLink.OptionsFormatting.UseNativeStyles then + Result := Adapter.HasSelectionStyle; +end; + +function TdxCustomGridTableViewFormatter.IsSelectedRecord(ARecord: TcxCustomGridRecord): Boolean; +begin + Result := (SelectedRecordCount <> 0) or ARecord.Selected; +end; + +function TdxCustomGridTableViewFormatter.GetContentBackgroundBitmapStyleIndex(ATableItem: TcxCustomGridTableItem): Integer; +begin + Result := bbContent; +end; + +function TdxCustomGridTableViewFormatter.MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; +begin + case AGridBackgroundBitmapIndex of + bbContent: + Result := vspsGridContent; + else + Result := 0; + end; + + if Result = 0 then + Result := inherited MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex); +end; + +function TdxCustomGridTableViewFormatter.GetGridLineColor: TColor; +begin + Result := ReportLink.OptionsFormatting.GridLineColor; + if Result = clDefault then + Result := Adapter.GridLineColor; +end; + +function TdxCustomGridTableViewFormatter.GetRecord(Index: Integer): TcxCustomGridRecord; +begin + if SelectedRecordCount <> 0 then + Result := SelectedRecords[Index] + else + Result := Adapter.Records[Index]; +end; + +function TdxCustomGridTableViewFormatter.GetRecordCount: Integer; +begin + Result := SelectedRecordCount; + if Result = 0 then + Result := Adapter.RecordCount; +end; + +function TdxCustomGridTableViewFormatter.GetRecordIndex(ARecord: TcxCustomGridRecord): Integer; +var + RecordIndex, IndexCount, I: Integer; +begin + RecordIndex := ARecord.Index; + IndexCount := FRecordIndexes.Count; + if RecordIndex > IndexCount - 1 then + begin + FRecordIndexes.Count := RecordIndex + 1; + for I := IndexCount to FRecordIndexes.Count - 1 do + FRecordIndexes[I] := TObject(-1); + end; + Result := Integer(FRecordIndexes[RecordIndex]); + if Result = -1 then + begin + FRecordIndexes[RecordIndex] := TObject(IndexOfRecord(ARecord)); + Result := Integer(FRecordIndexes[RecordIndex]); + end; +end; + +function TdxCustomGridTableViewFormatter.GetSelectedRecord(Index: Integer): TcxCustomGridRecord; +begin + Result := TcxCustomGridRecord(FSelectedRecordList[Index]); +end; + +function TdxCustomGridTableViewFormatter.GetSelectedRecordCount: Integer; +begin + Result := FSelectedRecordList.Count; +end; + +{ TdxCustomGridTableViewBuilder } + +function TdxCustomGridTableViewBuilder.Adapter: TdxCustomGridTableViewAdapter; +begin + Result := inherited Adapter as TdxCustomGridTableViewAdapter; +end; + +class function TdxCustomGridTableViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxCustomGridTableViewAdapter; +end; + +function TdxCustomGridTableViewBuilder.Formatter: TdxCustomGridTableViewFormatter; +begin + Result := inherited Formatter as TdxCustomGridTableViewFormatter; +end; + +class function TdxCustomGridTableViewBuilder.FormatterClass: TdxGridViewFormatterClass; +begin + Result := TdxCustomGridTableViewFormatter; +end; + +procedure TdxCustomGridTableViewBuilder.DoBuildViewFooter; +begin + if Formatter.ShowFilterBar {$IFDEF DXVER500} and (Formatter.FilterBarPosition = fpBottom) {$ENDIF} then + CreateFilterBar; + if Formatter.HasDetailsSeparator then + CreateBottomDetailsSeparator; + inherited; +end; + +procedure TdxCustomGridTableViewBuilder.DoBuildViewHeader; +begin + inherited; + if Formatter.HasDetailsSeparator then + CreateTopDetailsSeparator; + if Formatter.ShowCaption then + CreateCaption; + {$IFDEF DXVER500} + if Formatter.ShowFilterBar and (Formatter.FilterBarPosition = fpTop) then + CreateFilterBar; + {$ENDIF} +end; + +procedure TdxCustomGridTableViewBuilder.DoGetCellHeight(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem; var AHeight: Integer); +begin + ReportLink.DoGetCellHeight(GridView, ARecord, ATableItem, AHeight); +end; + +function TdxCustomGridTableViewBuilder.GridView: TcxCustomGridTableView; +begin + Result := inherited GridView as TcxCustomGridTableView; +end; + +class function TdxCustomGridTableViewBuilder.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridTableView; +end; + +{ TdxGridTableViewAdapter } + +constructor TdxGridTableViewAdapter.Create(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView); +begin + inherited; + GridTableViewInfo_CalculateExpandButtonParams(GridView.ViewInfo); // because LevelIndent +end; + +function TdxGridTableViewAdapter.GridView: TcxGridTableView; +begin + Result := inherited GridView as TcxGridTableView; +end; + +class function TdxGridTableViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridView; +end; + +function TdxGridTableViewAdapter.Styles: TcxGridTableViewStyles; +begin + Result := inherited Styles as TcxGridTableViewStyles; +end; + +function TdxGridTableViewAdapter.HasDetails(AGridRow: TcxCustomGridRow): Boolean; +begin + Result := RecordHelpers[AGridRow].HasDetails; +end; + +function TdxGridTableViewAdapter.IsSummaryHasSameLink( + AItem1, AItem2: TcxDataSummaryItem): Boolean; +begin + Result := (AItem1.ItemLink = AItem2.ItemLink) and + (AItem1.Position = spFooter) and (AItem2.Position = spFooter); +end; + +function TdxGridTableViewAdapter.GetFooterItemCount( + AItems: TcxDataSummaryItems; ACanMultiLine: Boolean): Integer; +var + I, J, ACount: Integer; +begin + Result := 0; + if AItems = nil then Exit; + for I := 0 to ColumnCount - 1 do + begin + ACount := 0; + for J := 0 to AItems.Count - 1 do + if (AItems[J].Position = spFooter) and (AItems[J].ItemLink = Columns[I]) then + begin + Inc(ACount); + if not ACanMultiline then Break; + end; + Inc(Result, ACount); + if (Result = AItems.Count) then Break; + end; +end; + +function TdxGridTableViewAdapter.CheckSummaryItemIndex( + AItems: TcxDataSummaryItems; AIndex: Integer): Integer; +var + I: Integer; + AColumn: TcxGridColumn; +begin + Result := AIndex; + I := 0; + while I <= Result do + begin + AColumn := AItems[I].ItemLink as TcxGridColumn; + if (AColumn = nil) or (AColumn.VisibleIndex < 0) then + Inc(Result); + Inc(I); + end; +end; + +function TdxGridTableViewAdapter.GetFooterItemInfo( + AItems: TcxDataSummaryItems; AIndex: Integer; var ARowIndex: Integer): Integer; +var + I: Integer; + AColumn: TcxGridColumn; +begin + ARowIndex := 0; + AIndex := CheckSummaryItemIndex(AItems, AIndex); + AColumn := AItems[AIndex].ItemLink as TcxGridColumn; + for I := 0 to AIndex - 1 do + if AItems[I].ItemLink = AColumn then + Inc(ARowIndex); + Result := AColumn.VisibleIndex; +end; + +function TdxGridTableViewAdapter.GetFooterLineCount( + AItems: TcxDataSummaryItems; ACanMultiLine: Boolean): Integer; +var + I, J, ACount: Integer; +begin + Result := RowLineCount; + if (AItems = nil) or not ACanMultiLine then Exit; + for I := 0 to AItems.Count - 1 do + begin + ACount := 0; + for J := 0 to AItems.Count - 1 do + if IsSummaryHasSameLink(AItems[I], AItems[J]) then + Inc(ACount); + Result := Max(Result, ACount); + end; +end; + +function TdxGridTableViewAdapter.GetGroupFooterCount(AGridRow: TcxCustomGridRow): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to AGridRow.Level do + if HasGroupFooter(AGridRow, I) then + Inc(Result); +{ if Result > 0 then + Result := 1;} +end; + +function TdxGridTableViewAdapter.GetGroupFooterItemText(ARowIndex, ALevel, AIndex: Integer): string; +var + SummaryIndex: Integer; +begin + SummaryIndex := Summary.GroupFooterIndexOfItemLink[ALevel, Columns[AIndex]]; + if SummaryIndex <> -1 then + Result := Summary.GroupFooterSummaryTexts[ARowIndex, ALevel, SummaryIndex] + else + Result := ''; +end; + +function TdxGridTableViewAdapter.HasGroupFooter(AGridRow: TcxCustomGridRow; ALevel: Integer): Boolean; +begin + if GroupFootersMode = gfInvisible then + Result := False + else + begin + if GroupFootersMode = gfAlwaysVisible then + Dec(ALevel); + Result := (0 <= ALevel) and (ALevel < AGridRow.Level) and + TcxCustomGridRecordAccess(AGridRow).IsParentRecordLast[ALevel] and + TcxGridColumnAccess(GridView.GroupedColumns[AGridRow.Level - 1 - ALevel]).Options.GroupFooters; + end; + if not Result and (AGridRow is TcxGridGroupRow) then + begin + Result := Result or + (GroupFootersMode = gfAlwaysVisible) and (ALevel = -1) and not AGridRow.Expanded and + TcxGridColumnAccess(TcxGridGroupRow(AGridRow).GroupedColumn).Options.GroupFooters; + end; +end; + +function TdxGridTableViewAdapter.HasGroupFooterItem(ALevel, AIndex: Integer): Boolean; +begin + Result := Summary.GroupFooterIndexOfItemLink[ALevel, Columns[AIndex]] <> -1; +end; + +function TdxGridTableViewAdapter.HasGroupFooters(AGridRow: TcxCustomGridRow): Boolean; +begin + Result := GetGroupFooterCount(AGridRow) <> 0; +end; + +function TdxGridTableViewAdapter.Controller: TcxGridTableController; +begin + Result := inherited Controller as TcxGridTableController; +end; + +function TdxGridTableViewAdapter.DataController: TcxGridDataController; +begin + Result := GridView.DataController; +end; + +function TdxGridTableViewAdapter.GetAutoWidth: Boolean; +begin + Result := GridView.OptionsView.ColumnAutoWidth; +end; + +function TdxGridTableViewAdapter.GetCellAutoHeight: Boolean; +begin + Result := inherited GetCellAutoHeight and (DetailsLineCount = 1) and not DataRowHeightAssigned; +end; + +function TdxGridTableViewAdapter.GetCellMultiline: Boolean; +begin + Result := inherited GetCellAutoHeight;// {3.1} and not DataRowHeightAssigned;// and (DetailsLineCount <> 1); +end; + +function TdxGridTableViewAdapter.GetHeaderAutoHeight: Boolean; +begin + Result := GridView.OptionsView.HeaderAutoHeight and not HeaderHeightAssigned; +end; + +function TdxGridTableViewAdapter.GetHeaderMultiline(Column: TcxGridColumn): Boolean; +begin + Result := HeaderAutoHeight or HeaderHeightAssigned; +end; + +function TdxGridTableViewAdapter.GetIndentCount: Integer; +begin + Result := inherited GetIndentCount + GroupedColumnCount; + if (Result <> 0) and (GroupedColumnCount <> 0) and IsOffice11StyleGrouping then + Dec(Result); +end; + +function TdxGridTableViewAdapter.GetIndentWidth: Integer; +begin + Result := GridView.ViewInfo.LevelIndent; +end; + +function TdxGridTableViewAdapter.GetIndicatorWidth: Integer; +begin + if GridView.OptionsView.Indicator then + Result := GridView.OptionsView.IndicatorWidth + else + Result := 0; +end; + +function TdxGridTableViewAdapter.GetIsOffice11StyleGrouping: Boolean; +begin + {$IFDEF DXVER500} + Result := GridView.OptionsView.GroupRowStyle = grsOffice11; + {$ELSE} + Result := False; + {$ENDIF} +end; + +function TdxGridTableViewAdapter.GetViewWidthExtra: Integer; +var + IndentCount: Integer; +begin + Result := inherited GetViewWidthExtra; + IndentCount := GroupedColumnCount; + if (IndentCount <> 0) and IsOffice11StyleGrouping then + Dec(IndentCount); + Inc(Result, IndentCount * IndentWidth); +end; + +function TdxGridTableViewAdapter.GetDataRowHeight: Integer; +begin + Result := GridView.OptionsView.DataRowHeight; +end; + +function TdxGridTableViewAdapter.GetDataRowHeightAssigned: Boolean; +begin + Result := DataRowHeight <> 0; +end; + +function TdxGridTableViewAdapter.GetFooterHeight: Integer; +begin + Result := DefaultFooterLineHeight;//GridView.OptionsView.HeaderHeight; {PS 3.03} +end; + +function TdxGridTableViewAdapter.GetFooterHeightAssigned: Boolean; +begin + Result := False; +end; + +function TdxGridTableViewAdapter.GetGroupFooterHeight: Integer; +begin + Result := DefaultGroupFooterLineHeight; +end; + +function TdxGridTableViewAdapter.GetGroupFooterHeightAssigned: Boolean; +begin + Result := False; +end; + +function TdxGridTableViewAdapter.GetGroupRowHeight: Integer; +begin + Result := GridView.OptionsView.GroupRowHeight; +end; + +function TdxGridTableViewAdapter.GetGroupRowHeightAssigned: Boolean; +begin + Result := GroupRowHeight <> 0; +end; + +function TdxGridTableViewAdapter.GetHeaderHeight: Integer; +begin + Result := GridView.OptionsView.HeaderHeight; +end; + +function TdxGridTableViewAdapter.GetHeaderHeightAssigned: Boolean; +begin + Result := HeaderHeight <> 0; +end; + +function TdxGridTableViewAdapter.GetRowLineCount: Integer; +begin + Result := 1; +end; + +function TdxGridTableViewAdapter.GetFilterBarViewParams: TcxViewParams; +begin + Styles.GetViewParams(vsFilterBox, nil, nil, Result); +end; + +function TdxGridTableViewAdapter.GetFooterViewParams(ARecord: TcxCustomGridRecord; + AGroupLevel: Integer; AColumn: TcxGridColumn; AItem: TcxDataSummaryItem): TcxViewParams; +begin + if (AColumn <> nil) and (AColumn.Styles <> nil) then + Styles.GetFooterCellParams(TcxCustomGridRow(ARecord), AColumn, AGroupLevel, AItem, Result) + else + Styles.GetFooterParams(TcxCustomGridRow(ARecord), AColumn, AGroupLevel, AItem, Result); +end; + +function TdxGridTableViewAdapter.GetGroupRowViewParams(ARecord: TcxCustomGridRecord; + AGroupLevel: Integer): TcxViewParams; +begin + if (AGroupLevel >= 0) and (AGroupLevel < Styles.GridView.GroupedItemCount) then + Styles.GetGroupParams(ARecord, AGroupLevel, Result) + else + Styles.GetViewParams(vsGroup, ARecord, nil, Result); +end; + +function TdxGridTableViewAdapter.GetHeaderViewParams(AColumn: TcxGridColumn): TcxViewParams; +begin + if (AColumn <> nil) and (AColumn.Styles <> nil) then + AColumn.Styles.GetHeaderParams(Result) + else + Styles.GetHeaderParams(AColumn, Result); + if AColumn = nil then + Result.Color := LookAndFeelPainter.DefaultHeaderBackgroundColor; +end; + +function TdxGridTableViewAdapter.GetPreviewViewParams(ARecord: TcxCustomGridRecord; + AnItem: TcxCustomGridTableItem): TcxViewParams; +begin + Styles.GetPreviewParams(ARecord, TcxGridColumn(AnItem), Result); + // 3.2 + if Result.Color = clWindow then + Result.Color := dxPSCore.dxDefaultContentColor; +end; + +function TdxGridTableViewAdapter.GetColumn(Index: Integer): TcxGridColumn; +begin + Result := GridView.VisibleColumns[Index]; +end; + +function TdxGridTableViewAdapter.GetColumnCount: Integer; +begin + Result := GridView.VisibleColumnCount; +end; + +function TdxGridTableViewAdapter.GetFooterItemText(Index: Integer): string; +var + SummaryIndex: Integer; +begin + SummaryIndex := Summary.FooterSummaryItems.IndexOfItemLink(Columns[Index]); + if SummaryIndex <> -1 then + Result := Summary.FooterSummaryTexts[SummaryIndex] + else + Result := ''; +end; + +function TdxGridTableViewAdapter.GetFooterMultiline: Boolean; +begin + {$IFDEF DXVER500} + Result := GridView.OptionsView.FooterAutoHeight; + {$ELSE} + Result := False; + {$ENDIF} +end; + +function TdxGridTableViewAdapter.GetFooterMultiSummaries: Boolean; +begin + Result := GridView.OptionsView.CanShowFooterMultiSummaries; +end; + +function TdxGridTableViewAdapter.GetGridLineColor: TColor; +begin + Result := GridView.OptionsView.GridLineColor; + if Result = clDefault then + Result := GridView.LookAndFeelPainter.DefaultGridLineColor; +end; + +function TdxGridTableViewAdapter.GetGridLines: TcxGridLines; +begin + Result := GridView.OptionsView.GridLines; +end; + +function TdxGridTableViewAdapter.GetGroupedColumn(Index: Integer): TcxGridColumn; +begin + Result := GridView.GroupedColumns[Index]; +end; + +function TdxGridTableViewAdapter.GetGroupedColumnCount: Integer; +begin + Result := GridView.GroupedColumnCount; +end; + +function TdxGridTableViewAdapter.GetGroupFootersMode: TcxGridGroupFootersMode; +begin + Result := GridView.OptionsView.GroupFooters; +end; + +function TdxGridTableViewAdapter.GetGroupFooterMultiSummaries: Boolean; +begin + Result := GridView.OptionsView.CanShowGroupFooterMultiSummaries; +end; + +function TdxGridTableViewAdapter.GetGroupFootersMultiline: Boolean; +begin + {$IFDEF DXVER500} + Result := GridView.OptionsView.FooterAutoHeight; + {$ELSE} + Result := False; + {$ENDIF} +end; + +function TdxGridTableViewAdapter.GetGroupRowSeparatorColor: TColor; +begin + {$IFDEF DXVER500} + Result := dxOffice11.dxOffice11GroupRowSeparatorColor; + {$ELSE} + Result := clBtnFace; + {$ENDIF} +end; + +function TdxGridTableViewAdapter.GetGroupRowSeparatorThickness: Integer; +begin + {$IFDEF DXVER500} + Result := cxGridTableView.cxGridOffice11GroupRowSeparatorWidth; + {$ELSE} + Result := 2; + {$ENDIF} +end; + +function TdxGridTableViewAdapter.GetHasFooterItem(Index: Integer): Boolean; +begin + Result := Summary.FooterSummaryItems.IndexOfItemLink(Columns[Index]) <> -1; +end; + +function TdxGridTableViewAdapter.GetHasPreview: Boolean; +begin + Result := PreviewColumn <> nil; +end; + +function TdxGridTableViewAdapter.GetHasRowSeparators: Boolean; +begin + Result := RowSeparatorThickness > 0; +end; + +function TdxGridTableViewAdapter.GetHeaderEndEllipsis: Boolean; +begin + Result := GridView.OptionsView.HeaderEndEllipsis; +end; + +function TdxGridTableViewAdapter.GetInternalColumnMinWidth(Column: TcxGridColumn): Integer; +begin + Result := Column.MinWidth; + if Column.IsMostLeft then + Inc(Result, IndentCount * IndentWidth); +end; + +function TdxGridTableViewAdapter.GetInternalColumnWidth(Column: TcxGridColumn): Integer; +begin + Result := Column.Width; + if Column.IsMostLeft then + Inc(Result, IndentCount * IndentWidth); +end; + +function TdxGridTableViewAdapter.GetPreviewColumn: TcxGridColumn; +begin + Result := GridView.Preview.Column; +end; + +function TdxGridTableViewAdapter.GetPreviewLeftIndent: Integer; +begin + Result := GridView.Preview.LeftIndent; +end; + +function TdxGridTableViewAdapter.GetPreviewPlace: TcxGridPreviewPlace; +begin + Result := GridView.Preview.Place; +end; + +function TdxGridTableViewAdapter.GetPreviewRightIndent: Integer; +begin + Result := GridView.Preview.RightIndent; +end; + +function TdxGridTableViewAdapter.GetRow(Index: Integer): TcxCustomGridRow; +begin + Result := TcxCustomGridRow(Records[Index]); +end; + +function TdxGridTableViewAdapter.GetRowCount: Integer; +begin + Result := RecordCount; +end; + +function TdxGridTableViewAdapter.GetRowSeparatorColor: TColor; +begin + Result := GridView.OptionsView.RowSeparatorColor; +end; + +function TdxGridTableViewAdapter.GetRowSeparatorThickness: Integer; +begin + Result := GridView.OptionsView.RowSeparatorWidth; +end; + +function TdxGridTableViewAdapter.GetShowExpandButtonsForEmptyDetails: Boolean; +begin + {$IFDEF DXVER500} + Result := GridView.OptionsView.ExpandButtonsForEmptyDetails; + {$ELSE} + Result := True; + {$ENDIF} +end; + +function TdxGridTableViewAdapter.GetShowHorzGridLines: Boolean; +begin + Result := GridLines in [glBoth, glHorizontal]; +end; + +function TdxGridTableViewAdapter.GetShowVertGridLines: Boolean; +begin + Result := GridLines in [glBoth, glVertical]; +end; + +function TdxGridTableViewAdapter.GetThemedFooterItemColor: TColor; +begin + Result := LookAndFeelPainter.DefaultFooterColor; +end; + +function TdxGridTableViewAdapter.GetThemedFooterItemTextColor: TColor; +begin + Result := LookAndFeelPainter.DefaultFooterTextColor; +end; + +function TdxGridTableViewAdapter.GetThemedHeaderItemColor: TColor; +begin + Result := LookAndFeelPainter.DefaultHeaderColor; +end; + +function TdxGridTableViewAdapter.GetThemedHeaderItemTextColor: TColor; +begin + Result := LookAndFeelPainter.DefaultHeaderTextColor; +end; + +{ TdxCustomGridTableViewItemPlaceController } + +constructor TdxCustomGridTableViewItemPlaceController.Create(AFormatter: TdxGridTableViewFormatter); +begin + inherited Create; + FFormatter := AFormatter; + FHeaderLineCount := -1; + FWidth := -1; +end; + +procedure TdxCustomGridTableViewItemPlaceController.Calculate; +begin +end; + +procedure TdxCustomGridTableViewItemPlaceController.Refresh; +begin +end; + +function TdxCustomGridTableViewItemPlaceController.CalculateHeaderLineCount: Integer; +begin + Result := 1; +end; + +function TdxCustomGridTableViewItemPlaceController.CalculateWidth: Integer; +begin + Result := 0; +end; + +function TdxCustomGridTableViewItemPlaceController.GetItemByColumn(Column: TcxGridColumn): TdxGridTableViewColumnPlace; +begin + Result := nil; +end; + +procedure TdxCustomGridTableViewItemPlaceController.WidthChanged; +begin +end; + +function TdxCustomGridTableViewItemPlaceController.GetHeaderLineCount: Integer; +begin + if FHeaderLineCount = -1 then + FHeaderLineCount := CalculateHeaderLineCount; + Result := FHeaderLineCount; +end; + +function TdxCustomGridTableViewItemPlaceController.GetWidth: Integer; +begin + if FWidth = -1 then + FWidth := CalculateWidth; + Result := FWidth; +end; + +procedure TdxCustomGridTableViewItemPlaceController.SetWidth(Value: Integer); +begin + FWidth := Value; + WidthChanged; +end; + +{ TdxGridTableViewColumnPlace } + +constructor TdxGridTableViewColumnPlace.Create(AController: TdxGridTableViewColumnPlaceController; + AColumn: TcxGridColumn); +begin + inherited Create; + FController := AController; + FColumn := AColumn; + + FLeftBound := -1; + FWidth := -1; +end; + +procedure TdxGridTableViewColumnPlace.Calculate(ALeftBound: Integer); +begin + FLeftBound := ALeftBound; +end; + +function TdxGridTableViewColumnPlace.CalculateLeftBound: Integer; +begin + Result := Controller.CalculateItemLeftBound(Self); +end; + +function TdxGridTableViewColumnPlace.GetLineCount: Integer; +begin + Result := 1; +end; + +function TdxGridTableViewColumnPlace.GetRowIndex: Integer; +begin + Result := 0; +end; + +procedure TdxGridTableViewColumnPlace.InitAutoWidthItem(AnItem: TcxAutoWidthItem); +begin + AnItem.Fixed := IsFixed; + AnItem.MinWidth := MinWidth; + AnItem.Width := Width; +end; + +function TdxGridTableViewColumnPlace.GetAdapter: TdxGridTableViewAdapter; +begin + Result := Formatter.Adapter; +end; + +function TdxGridTableViewColumnPlace.GetCellBounds(RowIndex: Integer): TRect; +var + CellHeight: Integer; +begin + CellHeight := CellHeights[RowIndex]; + with Result do + begin + Left := LeftBound; + Top := Self.RowIndex * CellHeight; + Right := Left + Width; + Bottom := Top + LineCount * CellHeight; + end; + + if Column.IsMostLeft then + Inc(Result.Left, Formatter.ViewWidthExtra); +end; + +function TdxGridTableViewColumnPlace.GetCellHeight(RowIndex: Integer): Integer; +begin + Result := Formatter.RowHeights[RowIndex]; +end; + +function TdxGridTableViewColumnPlace.GetFooterCellBounds: TRect; +begin + with Result do + begin + Left := LeftBound; + Top := RowIndex * FooterLineHeight; + Right := Left + Width; + Bottom := Top + LineCount * FooterLineHeight; + end; + + InflateRect(Result, -FooterItemInflateHorz, -FooterItemInflateVert); + if Column.IsMostLeft then + Inc(Result.Left, 2); +end; + +function TdxGridTableViewColumnPlace.GetFooterLineHeight: Integer; +begin + Result := Formatter.FooterLineHeight; +end; + +function TdxGridTableViewColumnPlace.GetFormatter: TdxGridTableViewFormatter; +begin + Result := Controller.Formatter; +end; + +function TdxGridTableViewColumnPlace.GetGroupFooterCellBounds(IndentCount: Integer): TRect; +var + V: Integer; +begin + with Result do + begin + Left := LeftBound; + Top := RowIndex * GroupFooterLineHeight; + Right := Left + Width; + Bottom := Top + LineCount * GroupFooterLineHeight; + end; + + V := IndentCount * Formatter.IndentWidth; + OffsetRect(Result, -V, 0); + if Column.IsMostLeft then + Inc(Result.Left, V); + + InflateRect(Result, -FooterItemInflateHorz, -FooterItemInflateVert); + if Column.IsMostLeft then + Inc(Result.Left, 2); +end; + +function TdxGridTableViewColumnPlace.GetGroupFooterLineHeight: Integer; +begin + Result := Formatter.GroupFooterLineHeight; +end; + +function TdxGridTableViewColumnPlace.GetHeaderCellBounds: TRect; +begin + with Result do + begin + Left := LeftBound; + Top := RowIndex * HeaderLineHeight; + Right := Left + Width; + Bottom := Top + LineCount * HeaderLineHeight; + end; +end; + +function TdxGridTableViewColumnPlace.GetHeaderLineHeight: Integer; +begin + Result := Formatter.HeaderLineHeight; +end; + +function TdxGridTableViewColumnPlace.GetIndex: Integer; +begin + Result := Controller.IndexOf(Self); +end; + +function TdxGridTableViewColumnPlace.GetIsFixed: Boolean; +begin + Result := GridColumn_GetFixed(Column); +end; + +function TdxGridTableViewColumnPlace.GetLeftBound: Integer; +begin + if FLeftBound = -1 then + FLeftBound := CalculateLeftBound; + Result := FLeftBound; +end; + +function TdxGridTableViewColumnPlace.GetMinWidth: Integer; +begin + Result := Adapter.InternalColumnMinWidths[Column]; +end; + +function TdxGridTableViewColumnPlace.GetOriginalWidth: Integer; +begin + Result := Adapter.InternalColumnWidths[Column]; +end; + +function TdxGridTableViewColumnPlace.GetWidth: Integer; +begin + Result := FWidth; + if Result = -1 then + Result := OriginalWidth; +end; + +{ TdxGridTableViewColumnPlaceController } + +constructor TdxGridTableViewColumnPlaceController.Create(AFormatter: TdxGridTableViewFormatter); +begin + inherited; + FColumnIndexes := TList.Create; + FItems := TList.Create; + FWidth := -1; +end; + +destructor TdxGridTableViewColumnPlaceController.Destroy; +begin + FreeAndNilItems; + FreeAndNil(FColumnIndexes); + inherited; +end; + +procedure TdxGridTableViewColumnPlaceController.Calculate; +begin + if ItemsAutoWidth then CalculateItemsWidth; +end; + +procedure TdxGridTableViewColumnPlaceController.Refresh; +begin + FColumnIndexes.Clear; + ClearItems; + AddItems; +end; + +function TdxGridTableViewColumnPlaceController.IndexOf(AnItem: TdxGridTableViewColumnPlace): Integer; +begin + Result := FItems.IndexOf(AnItem); +end; + +function TdxGridTableViewColumnPlaceController.IndexOf(AColumn: TcxGridColumn): Integer; +begin + for Result := 0 to ItemCount - 1 do + if Items[Result].Column = AColumn then + Exit; + Result := -1; +end; + +function TdxGridTableViewColumnPlaceController.CalculateWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to ItemCount - 1 do + Inc(Result, Items[I].Width); +end; + +function TdxGridTableViewColumnPlaceController.GetItemByColumn(Column: TcxGridColumn): TdxGridTableViewColumnPlace; +var + Index: Integer; +begin + Index := ColumnIndexes[Column]; + //Index := IndexOf(Column); + if Index <> -1 then // might be -1 when we are in loading stage (Building report while loading form) + Result := Items[Index] + else + Result := nil; +end; + +procedure TdxGridTableViewColumnPlaceController.AddItems; +var + I: Integer; +begin + for I := 0 to Formatter.ColumnCount - 1 do + CreateItem(Formatter.Columns[I]); +end; + +procedure TdxGridTableViewColumnPlaceController.ClearItems; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + Items[I].Free; + FItems.Clear; +end; + +function TdxGridTableViewColumnPlaceController.CreateItem(AColumn: TcxGridColumn): TdxGridTableViewColumnPlace; +begin + Result := GetItemClass(AColumn).Create(Self, AColumn); + FItems.Add(Result); +end; + +function TdxGridTableViewColumnPlaceController.GetItemClass(AColumn: TcxGridColumn): TdxGridTableViewColumnPlaceClass; +begin + Result := TdxGridTableViewColumnPlace; +end; + +function TdxGridTableViewColumnPlaceController.CalculateItemLeftBound(AnItem: TdxGridTableViewColumnPlace): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to AnItem.Index - 1 do + Inc(Result, Items[I].Width); +end; + +procedure TdxGridTableViewColumnPlaceController.CalculateItemsWidth; +var + AutoWidthObject: TcxAutoWidthObject; + I: Integer; +begin + AutoWidthObject := TcxAutoWidthObject.Create(ItemCount); + try + for I := 0 to ItemCount - 1 do + Items[I].InitAutoWidthItem(AutoWidthObject.AddItem); + AutoWidthObject.AvailableWidth := ItemsAvailableWidth; + AutoWidthObject.Calculate; + + for I := 0 to ItemCount - 1 do + Items[I].Width := AutoWidthObject[I].AutoWidth; + finally + AutoWidthObject.Free; + end; +end; + +function TdxGridTableViewColumnPlaceController.GetItemsAutoWidth: Boolean; +begin + Result := Formatter.AutoWidth; +end; + +function TdxGridTableViewColumnPlaceController.GetItemsAvailableWidth: Integer; +begin + Result := Formatter.ViewAvailableWidth; +end; + +function TdxGridTableViewColumnPlaceController.GetAdapter: TdxGridTableViewAdapter; +begin + Result := Formatter.Adapter; +end; + +function TdxGridTableViewColumnPlaceController.GetColumnIndex(Column: TcxGridColumn): Integer; +var + ColumnIndex, IndexCount, I: Integer; +begin + ColumnIndex := Column.Index; + IndexCount := FColumnIndexes.Count; + if ColumnIndex > IndexCount - 1 then + begin + FColumnIndexes.Count := ColumnIndex + 1; + for I := IndexCount to FColumnIndexes.Count - 1 do + FColumnIndexes[I] := TObject(-1); + end; + Result := Integer(FColumnIndexes[ColumnIndex]); + if Result = -1 then + begin + FColumnIndexes[ColumnIndex] := TObject(IndexOf(Column)); + Result := Integer(FColumnIndexes[ColumnIndex]); + end; +end; + +function TdxGridTableViewColumnPlaceController.GetItem(Index: Integer): TdxGridTableViewColumnPlace; +begin + Result := TdxGridTableViewColumnPlace(FItems[Index]); +end; + +function TdxGridTableViewColumnPlaceController.GetItemCount: Integer; +begin + Result := FItems.Count; +end; + +procedure TdxGridTableViewColumnPlaceController.FreeAndNilItems; +begin + ClearItems; + FreeAndNil(FItems); +end; + +{ TdxGridTableViewReportDataAdapter } + +constructor TdxGridTableViewReportDataAdapter.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited Create; + FBuilder := ABuilder; +end; + +function TdxGridTableViewReportDataAdapter.GetReportItem(Row: TcxCustomGridRow; + Column: TcxGridColumn): TdxReportVisualItem; +var + ReportRow: TdxReportCell; + I: Integer; +begin + ReportRow := ReportRowsByGridRow[Row]; + if ReportRow <> nil then + for I := 0 to ReportRow.DataItemCount - 1 do + begin + Result := ReportRow.DataItems[I]; + if Result.Data = Integer(Column) then Exit; + end; + Result := nil; +end; + +function TdxGridTableViewReportDataAdapter.GetReportRow(Index: Integer): TdxReportCell; +begin + Result := Builder.ReportRows[Index]; +end; + +function TdxGridTableViewReportDataAdapter.GetReportRowByGridRow(Row: TcxCustomGridRow): TdxReportCell; +var + I: Integer; +begin + for I := 0 to ReportRowCount - 1 do + if ReportRows[I].CellCount <> 0 then + begin + Result := ReportRows[I].Cells[0]; + if Result.Data = Integer(Row) then Exit; + end; + Result := nil; +end; + +function TdxGridTableViewReportDataAdapter.GetReportRowCount: Integer; +begin + Result := Builder.ReportRowCount; +end; + +{ TdxGridTableViewFormatter } + +constructor TdxGridTableViewFormatter.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited; + FColumns := TList.Create; + FItemPlaceController := GetItemPlaceControllerClass.Create(Self); + FReportDataAdapter := TdxGridTableViewReportDataAdapter.Create(ABuilder); + FRowHeights := TList.Create; +end; + +destructor TdxGridTableViewFormatter.Destroy; +begin + FreeAndNil(FRowHeights); + FreeAndNil(FItemPlaceController); + FreeAndNil(FReportDataAdapter); + FreeAndNil(FColumns); + inherited; +end; + +function TdxGridTableViewFormatter.Adapter: TdxGridTableViewAdapter; +begin + Result := Builder.Adapter; +end; + +function TdxGridTableViewFormatter.Builder: TdxGridTableViewBuilder; +begin + Result := inherited Builder as TdxGridTableViewBuilder; +end; + +procedure TdxGridTableViewFormatter.DoInitializeFooterItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer; AItem: TcxDataSummaryItem); +var + Column: TcxGridColumn; +begin + Column := TcxGridColumn(AItem.ItemLink); + SetViewParams(AnItem, GetFooterItemViewParams(Column, AItem)); + if HasBackgroundBitmap(bbFooter) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbFooter); + + RegisterLookAndFeelItem(AnItem, cesSunken); + + with AnItem as TdxReportCellString do + begin + Data := Integer(Column); + Text := AItem.FormatValue(Adapter.Summary.FooterSummaryValues[AnIndex], True); + Multiline := Adapter.FooterMultiline; + TextAlignX := TextAlignXMap[Column.FooterAlignmentHorz]; + if Multiline then + TextAlignY := taTop + else + TextAlignY := taCenterY; + end; +end; + +procedure TdxGridTableViewFormatter.DoInitializeFooterRow(ARow: TdxReportCell); +begin + SetViewParams(ARow, GetFooterItemViewParams(nil, nil)); + RegisterLookAndFeelItem(ARow, cesRaised); + ARow.Data := Integer(TdxGridFooter); +end; + +procedure TdxGridTableViewFormatter.DoReportLinkInitializeFooterItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +begin + ReportLink.DoInitializeFooterCell(Adapter.GridView, nil, Columns[AnIndex], 0, TdxReportCellString(AnItem)); +end; + +function TdxGridTableViewFormatter.GetFooterItemBounds(AnIndex: Integer): TRect; +var + Item: TdxGridTableViewColumnPlace; +begin + Item := ItemPlaceController[Columns[AnIndex]]; + if Item <> nil then + Result := Item.FooterCellBounds + else + Result := dxPSGlbl.NullRect; +end; + +function TdxGridTableViewFormatter.GetFooterItemClass(AnIndex: Integer): TdxReportCellTextClass; +begin + Result := TdxReportCellString; +end; + +function TdxGridTableViewFormatter.GetFooterItemViewParams( + AColumn: TcxGridColumn; AItem: TcxDataSummaryItem): TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetFooterParams(nil, -1, AColumn, Result.NativeParams) + else + Result.NativeParams := Adapter.GetFooterViewParams(nil, -1, AColumn, AItem); + + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + if AColumn <> nil then + begin + Result.NativeParams.Color := Adapter.ThemedFooterItemColor; + Result.NativeParams.TextColor := Adapter.ThemedFooterItemTextColor; + end; + + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.FixedTransparent; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupFooterHost(AnItem: TdxReportVisualItem; + ARecord: TcxCustomGridRecord; AGroupLevel: Integer); +begin + SetViewParams(AnItem, GetGroupFooterItemViewParams(nil, AGroupLevel, nil, nil)); + RegisterLookAndFeelItem(AnItem, cesRaised); + AnItem.Data := Integer(ARecord); +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupFooterItem(AnItem: TAbstractdxReportCellData; + ARecord: TcxCustomGridRecord; AGroupLevel: Integer; const AValue: Variant; AItem: TcxDataSummaryItem); +var + AColumn: TcxGridColumn; +begin + AColumn := TcxGridColumn(AItem.ItemLink); + SetViewParams(AnItem, GetGroupFooterItemViewParams( + ARecord, AGroupLevel, AColumn, AItem)); + if HasBackgroundBitmap(bbFooter) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbFooter); + RegisterLookAndFeelItem(AnItem, cesSunken); + + with TdxReportCellString(AnItem) do + begin + Data := Integer(AColumn); + + Multiline := Adapter.GetGroupFootersMultiline; + Text := AItem.FormatValue(AValue, True); + TextAlignX := TextAlignXMap[AColumn.FooterAlignmentHorz]; + if Multiline then + TextAlignY := taTop + else + TextAlignY := taCenterY; + end; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupFooterRow(ARow: TdxReportCell; + ARecord: TcxCustomGridRecord; AGroupLevel: Integer); +begin + ARow.CellSides := csLeftRight; + ARow.Data := AGroupLevel; //v3.0 ARecord.Level + ARow.Transparent := True; +end; + +procedure TdxGridTableViewFormatter.DoReportLinkInitializeGroupFooterItem(AnItem: TAbstractdxReportCellData; + AColumn: TcxGridColumn; ARecord: TcxCustomGridRecord; AGroupLevel: Integer); +begin + ReportLink.DoInitializeFooterCell(Adapter.GridView, ARecord, AColumn, + AGroupLevel, TdxReportCellString(AnItem)); +end; + +function TdxGridTableViewFormatter.GetGroupFooterItemBounds(AnIndex, AGroupLevel: Integer): TRect; +var + Item: TdxGridTableViewColumnPlace; +begin + Item := ItemPlaceController[Columns[AnIndex]]; + if Item <> nil then + Result := Item.GroupFooterCellBounds[AGroupLevel] + else + Result := dxPSGlbl.NullRect; +end; + +function TdxGridTableViewFormatter.GetGroupFooterItemClass(AnIndex: Integer): TdxReportCellTextClass; +begin + Result := TdxReportCellString; +end; + +function TdxGridTableViewFormatter.GetGroupFooterItemViewParams(ARecord: TcxCustomGridRecord; + AGroupLevel: Integer; AColumn: TcxGridColumn; AItem: TcxDataSummaryItem): TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetFooterParams(ARecord, AGroupLevel, AColumn, Result.NativeParams) + else + Result.NativeParams := Adapter.GetFooterViewParams(ARecord, AGroupLevel, AColumn, AItem); + + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + if AColumn <> nil then + begin + Result.NativeParams.Color := Adapter.ThemedFooterItemColor; + Result.NativeParams.TextColor := Adapter.ThemedFooterItemTextColor; + end; + + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.FixedTransparent; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupRowItem(AnItem: TAbstractdxReportCellData; + ARow: TcxGridGroupRow; AIndex: Integer; const AText: string); +begin + if not ReportLink.OptionsFormatting.UseNativeStyles and IsDelphiObject(AnItem.Data) + and (TObject(AnItem.Data) is TcxGridSummaryItemInfo) then + SetViewParams(AnItem, Adapter.GridLines, TcxGridSummaryItemInfo(AnItem.Data).ViewParams) + else + SetViewParams(AnItem, GetGroupRowViewParams(ARow, ARow.Level)); + if HasBackgroundBitmap(bbGroup) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbGroup); + with AnItem as TdxReportCellString do + begin + Data := Integer(Adapter.GroupedColumns[ARow.Level]); + Text := AText; + if AIndex = 0 then + TextAlignX := taLeft; + if Adapter.IsOffice11StyleGrouping then TextAlignY := taBottom; {.2} + end; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupRow(ARow: TdxReportCell; + ARecord: TcxCustomGridRecord); +begin + ReportLink.AddReportRow(ARow); + + ARow.CellSides := []; + ARow.Data := Integer(ARecord); + ARow.Transparent := True; +end; + +function TdxGridTableViewFormatter.GetGroupRowClass: TdxReportCellTextClass; +begin + Result := TdxReportCellString; +end; + +function TdxGridTableViewFormatter.GetGroupRowViewParams(ARecord: TcxCustomGridRecord; + ALevel: Integer): TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + if CanProcessSelectionStyle(ARecord) then + ReportLink.Styles.GetSelectionParams(Result.NativeParams) + else + ReportLink.Styles.GetGroupParams(ARecord, ALevel, Result.NativeParams) + else + if CanProcessSelectionStyle(ARecord) then + Result.NativeParams := Adapter.GetSelectionViewParams + else + Result.NativeParams := Adapter.GetGroupRowViewParams(ARecord, ALevel); + + Result.CellSides := CellSidesMap[Adapter.GridLines] - [csLeft] + [csRight]; + if ARecord.Index = 0 then + Result.CellSides := Result.CellSides + [csTop]; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.FixedTransparent; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupRowSeparator(ASeparator: TAbstractdxReportCellData); +begin + ASeparator.CellSides := csAll; + ASeparator.Color := GroupRowSeparatorColor; + ASeparator.Transparent := IsColorTransparent(ASeparator.Color); //ReportLink.Transparent; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupSeparatorRow(ARow: TdxReportCell); +begin + ARow.CellSides := csLeftRight; + ARow.Transparent := True; +end; + +function TdxGridTableViewFormatter.GetGroupRowSeparatorClass: TdxReportCellDataClass; +begin + Result := TdxReportCellBox; +end; + +procedure TdxGridTableViewFormatter.DoInitializeHeaderItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +var + Column: TcxGridColumn; +begin + Column := Columns[AnIndex]; + SetViewParams(AnItem, GetHeaderItemViewParams(Column)); + if HasBackgroundBitmap(bbHeader) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbHeader); + RegisterLookAndFeelItem(AnItem, cesRaised); + + with AnItem as TdxReportCellImage do + begin + Data := Integer(Column); + EndEllipsis := Adapter.HeaderEndEllipsis; + if (Column.HeaderGlyph <> nil) and not Column.HeaderGlyph.Empty then + begin + Image := Column.HeaderGlyph; + ImageLayout := HeaderImageLayoutMap[Column.HeaderGlyphAlignmentHorz, Column.HeaderGlyphAlignmentVert]; + IsTextDrawnForCenteredImage := True; + IsTextShiftedForHorizontallyCenteredImage := + not (ImageLayout in [ilImageTopCenter, ilImageCenterCenter, ilImageBottomCenter]) and (Text <> ''); + end; + Multiline := Adapter.HeaderMultilines[Column]; + SortOrder := SortOrderMap[Column.SortOrder]; + if Column.Options.ShowCaption then + Text := Column.Caption + else + Text := ''; + TextAlignX := TextAlignXMap[Column.HeaderAlignmentHorz]; + if Multiline then + TextAlignY := TextAlignYMap[Column.HeaderAlignmentVert] + else + TextAlignY := taCenterY; + end; +end; + +procedure TdxGridTableViewFormatter.DoInitializeHeaderRow(ARow: TdxReportCell); +begin + SetViewParams(ARow, GetHeaderItemViewParams(nil)); + ARow.Data := Integer(TdxGridHeader); +end; + +procedure TdxGridTableViewFormatter.DoReportLinkInitializeHeaderItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +begin + ReportLink.DoInitializeHeaderCell(Adapter.GridView, Columns[AnIndex], TdxReportCellString(AnItem)); +end; + +function TdxGridTableViewFormatter.GetHeaderItemBounds(AnIndex: Integer): TRect; +var + Item: TdxGridTableViewColumnPlace; +begin + Item := ItemPlaceController[Columns[AnIndex]]; + if Item <> nil then + Result := Item.HeaderCellBounds + else + Result := dxPSGlbl.NullRect; +end; + +function TdxGridTableViewFormatter.GetHeaderItemClass(AnIndex: Integer): TdxReportCellTextClass; +begin + Result := TdxReportCellImage; +end; + +function TdxGridTableViewFormatter.GetHeaderItemViewParams(AColumn: TcxGridColumn): TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetHeaderParams(AColumn, Result.NativeParams) + else + Result.NativeParams := Adapter.GetHeaderViewParams(AColumn); + + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + if AColumn <> nil then + begin + Result.NativeParams.Color := Adapter.ThemedHeaderItemColor; + Result.NativeParams.TextColor := Adapter.ThemedHeaderItemTextColor; + end; + + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := False; +end; + +function TdxGridTableViewFormatter.CreateIndent(AParent: TdxReportCell): TdxReportCellExpandButton; +begin + Result := GetIndentClass.Create(AParent); +end; + +procedure TdxGridTableViewFormatter.DoInitializeDataRowIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); +begin + SetViewParams(AnIndent, GetIndentViewParams(ARecord, AnIndex, AnIndentCount, False)); + if HasBackgroundBitmap(bbGroup) then + AnIndent.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbGroup); +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupFooterIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); +begin + SetViewParams(AnIndent, GetIndentViewParams(ARecord, AnIndex, AnIndentCount, True)); + if HasBackgroundBitmap(bbGroup) then + AnIndent.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbGroup); +// if (AIndex = AIndentCount - 1) and Adapter.ShowHorzGridLines then +// AIndent.CellSides := AIndent.CellSides + [csBottom]; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupRowIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); +begin + SetViewParams(AnIndent, GetIndentViewParams(ARecord, AnIndex, AnIndentCount, False)); + if HasBackgroundBitmap(bbGroup) then + AnIndent.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbGroup); + + if AnIndex = AnIndentCount - 1 then + begin + AnIndent.CellSides := AnIndent.CellSides - [csRight]; + if Adapter.ShowHorzGridLines then + AnIndent.CellSides := AnIndent.CellSides + [csTop]; + //if Adapter.IsOffice11StyleGrouping then + // AnIndent.CellSides := AnIndent.CellSides + [csBottom]; + + AnIndent.ShowButton := HasExpandButton(ARecord); + if AnIndent.ShowButton then + DoInitializeExpandButton(AnIndent, ARecord, False); + end; +end; + +procedure TdxGridTableViewFormatter.DoInitializeMasterDataRowIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); +begin + { DoInitializeMasterIndent -> ARecord = nil } + SetViewParams(AnIndent, GetIndentViewParams(ARecord, AnIndex, AnIndentCount, False)); + if AnIndex = AnIndentCount - 1 then + if HasBackgroundBitmap(bbContent) then + AnIndent.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbContent) + else + else + if HasBackgroundBitmap(bbGroup) then + AnIndent.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbGroup); + + if (ARecord <> nil) and (AnIndex = AnIndentCount - 1) then + begin + AnIndent.CellSides := AnIndent.CellSides - [csRight]; + if Adapter.ShowHorzGridLines then + AnIndent.CellSides := AnIndent.CellSides + [csTop]; + if not ARecord.Expanded then + AnIndent.CellSides := AnIndent.CellSides + [csBottom]; + + AnIndent.ShowButton := ReportLink.OptionsView.ExpandButtons and ARecord.Expandable; + if AnIndent.ShowButton then + DoInitializeExpandButton(AnIndent, ARecord, True); + end; +end; + +procedure TdxGridTableViewFormatter.DoInitializeRowSeparatorIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); +begin + SetViewParams(AnIndent, GetIndentViewParams(ARecord, AnIndex, AnIndentCount, True)); + if HasBackgroundBitmap(bbGroup) then + AnIndent.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbGroup); +end; + +function TdxGridTableViewFormatter.GetIndentClass: TdxReportCellExpandButtonClass; +begin + if Adapter.IsOffice11StyleGrouping then + Result := TdxReportCellExpandButtonEx + else + Result := TdxReportCellExpandButton; +end; + +function TdxGridTableViewFormatter.GetIndentViewParams(ARecord: TcxCustomGridRecord; + AnIndex, AnIndentCount: Integer; ANonRecordIndent: Boolean): TdxReportItemViewParams; + + function IsMasterDataRowIndent: Boolean; + begin + with Adapter do + Result := AnIndex >= GroupedColumnCount - Ord(IsOffice11StyleGrouping and not (ARecord is TcxGridGroupRow)); + end; + + function GetRecord: TcxCustomGridRecord; + begin + if not ANonRecordIndent and (ARecord is TcxGridGroupRow) and (AnIndex = AnIndentCount - 1) then + Result := ARecord + else + Result := nil; + end; + +const + VertGridLinesMap: array[Boolean] of TdxCellSides = ([], csLeftRight); +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + if IsMasterDataRowIndent then + ReportLink.Styles.GetContentParams(Adapter.MasterGridRecord, nil, Result.NativeParams) + else + ReportLink.Styles.GetGroupParams(GetRecord, AnIndex, Result.NativeParams) + else + if IsMasterDataRowIndent then + Result.NativeParams := Adapter.GetContentViewParams(Adapter.MasterGridRecord, nil) + else + Result.NativeParams := Adapter.GetGroupRowViewParams(GetRecord, AnIndex); + + Result.CellSides := VertGridLinesMap[Adapter.ShowHorzGridLines]; //PS3.1 (it was Adapter.ShowVertGridLines) + if AnIndex = 0 then + Result.CellSides := Result.CellSides + [csLeft]; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); +end; + +function TdxGridTableViewFormatter.HasExpandButton(ARecord: TcxCustomGridRecord): Boolean; +begin + Result := ReportLink.OptionsView.ExpandButtons{$IFDEF VER500} and Adapter.RecordHelpers[ARecord].HasExpandButton{$ENDIF}; +end; + +procedure TdxGridTableViewFormatter.DoInitializeDataRow(ARow: TdxReportCell; + ARecord: TcxCustomGridRecord); +begin + ReportLink.AddReportRow(ARow); + + ARow.CellSides := csLeftRight; + ARow.Data := Integer(ARecord); + ARow.Transparent := True; +end; + +procedure TdxGridTableViewFormatter.DoReportLinkInitializeItem(AnItem: TAbstractdxReportCellData; + AColumn: TcxGridColumn; ARecord: TcxCustomGridRecord); +begin + ReportLink.DoInitializeCell(Adapter.GridView, ARecord, AColumn, TdxReportCellString(AnItem)); +end; + +function TdxGridTableViewFormatter.GetItemBounds(AGridRow: TcxCustomGridRow; + AGridRowIndex, AColumnIndex: Integer): TRect; +var + Item: TdxGridTableViewColumnPlace; +begin + Item := ItemPlaceController[Columns[AColumnIndex]]; + if Item <> nil then + Result := Item.CellBounds[AGridRowIndex] + else + Result := dxPSGlbl.NullRect; +end; + +function TdxGridTableViewFormatter.GetItemViewParams(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False; AIsDataCell: Boolean = False): TdxReportItemViewParams; +begin + Result := inherited GetItemViewParams(ATableItem, ARecord, AnIsPreview, AIsDataCell); + if AnIsPreview then + begin + Result.CellSides := csLeftRight; + if Adapter.GridLines in [glBoth, glHorizontal] then + Result.CellSides := Result.CellSides + csTopBottom; + end + else + begin + Result.CellSides := CellSidesMap[Adapter.GridLines]; + if TcxGridColumn(ATableItem).IsMostLeft and (ARecord <> nil) and ARecord.Expandable then + Result.CellSides := Result.CellSides - [csLeft]; {3.1} + end; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.Transparent; +end; + +procedure TdxGridTableViewFormatter.DoInitializeMasterIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer); +begin + DoInitializeMasterDataRowIndent(AnIndent, AnIndex, AnIndentCount, nil); //Adapter.GroupedColumnCount + 1, nil); //PS3.1 changed +end; + +procedure TdxGridTableViewFormatter.DoInitializePreview(APreview: TAbstractdxReportCellData; + AColumn: TcxGridColumn; ARecord: TcxCustomGridRecord); +begin + DoInitializeItem(APreview, AColumn, ARecord, True); +end; + +function TdxGridTableViewFormatter.GetPreviewClass(AColumn: TcxGridColumn; + ARecord: TcxCustomGridRecord): TdxReportCellDataClass; +begin + Result := GetItemClass(AColumn, ARecord, True); +end; + +function TdxGridTableViewFormatter.GetPreviewViewParams(AColumn: TcxGridColumn; + ARecord: TcxCustomGridRecord): TdxReportItemViewParams; +begin + Result := GetItemViewParams(AColumn, ARecord, True) +end; + +procedure TdxGridTableViewFormatter.DoInitializeSeparatorRow(ARow: TdxReportCell); +begin + ARow.CellSides := csLeftRight; + ARow.Transparent := True; +end; + +procedure TdxGridTableViewFormatter.DoInitializeRowSeparator(ASeparator: TAbstractdxReportCellData); +begin + ASeparator.CellSides := csAll; + ASeparator.Color := RowSeparatorColor; + ASeparator.Transparent := IsColorTransparent(ASeparator.Color); //ReportLink.Transparent; +end; + +function TdxGridTableViewFormatter.GetRowSeparatorClass: TdxReportCellDataClass; +begin + Result := TdxReportCellBox; +end; + +function TdxGridTableViewFormatter.GetReportItem(ARow: TcxCustomGridRow; + AColumn: TcxGridColumn): TdxReportVisualItem; +begin + Result := ReportDataAdapter.ReportItems[ARow, AColumn]; +end; + +{ IdxPSCellParams2 } +function TdxGridTableViewFormatter.IdxPSCellParams2_GetPreviewMarginLeft: Integer; +begin + Result := Adapter.PreviewLeftIndent; +end; + +function TdxGridTableViewFormatter.IdxPSCellParams2_GetPreviewMarginRight: Integer; +begin + Result := Adapter.PreviewRightIndent; +end; + +function TdxGridTableViewFormatter.IdxPSCellParams2_GetPreviewMaxHeight: Integer; +begin + if PreviewAutoHeight then + Result := -1 + else + Result := PreviewLineHeight * PreviewMaxLineCount; +end; + +function TdxGridTableViewFormatter.IdxPSCellParams2_GetPreviewMaxLineCount: Integer; +begin + Result := PreviewMaxLineCount; +end; + +procedure TdxGridTableViewFormatter.AddHorizontalDelimiters; +var + Origin, I: Integer; + Item: TdxGridTableViewColumnPlace; + R: TRect; +begin + inherited; + if ReportLink.OptionsPagination.Column then + begin + Origin := ViewWidthExtraBefore; + for I := 0 to ColumnCount - 1 do + begin + Item := ItemPlaceController[Columns[I]]; + if Item <> nil then + begin + R := Item.HeaderCellBounds; + ReportLink.AddHorizontalDelimiter(Origin + R.Left); + ReportLink.AddHorizontalDelimiter(Origin + R.Right); + end; + end; + end; +end; + +{$IFDEF DXVER500} +procedure TdxGridTableViewFormatter.AfterBuilding; +begin + if CanCellMerging then PerformCellMerging; + inherited; +end; +{$ENDIF} + +procedure TdxGridTableViewFormatter.BeforeBuilding; +begin + BuildItemLists; + ItemPlaceController.Refresh; + inherited; +end; + +procedure TdxGridTableViewFormatter.Calculate; +begin + inherited; + ItemPlaceController.Calculate; +end; + +procedure TdxGridTableViewFormatter.CalculateDataRowHeights; +var + I, RowHeight, J, V: Integer; + Row: TcxCustomGridRow; + Column: TcxGridColumn; +begin + FRowHeights.Count := RowCount; + for I := 0 to RowCount - 1 do + begin + Row := Rows[I]; + if not (Row is TcxGridGroupRow) then + begin + RowHeight := DetailsLineHeight; + if HeaderLineCount = 1 then + for J := 0 to ColumnCount - 1 do + begin + // assign to 0, if you want to give an user ability to shrink RowHeight to smaller value + V := DetailsLineHeight; + Column := Columns[J]; + if not Column.IsPreview then + begin + Builder.DoGetCellHeight(Row, Columns[J], V); + if RowHeight <> V then RowHeight := V; + end; + end + end + else + RowHeight := GroupRowLineHeight; + RowHeights[I] := RowHeight; + end; +end; + +procedure TdxGridTableViewFormatter.CalculateLineHeights; +var + I: Integer; + Column: TcxGridColumn; +begin + inherited; + FGroupFooterLineHeight := DefaultGroupFooterLineHeight; + if Adapter.GroupRowHeightAssigned then + FGroupRowLineHeight := Adapter.GroupRowHeight + else + begin + FGroupRowLineHeight := DefaultGroupRowLineHeight; + if Adapter.IsOffice11StyleGrouping then {.2} + FGroupRowLineHeight := 2 * FGroupRowLineHeight; + end; + + FFooterLineHeight := Adapter.FooterHeight; + FGroupFooterLineHeight := Adapter.GroupFooterHeight; + FHeaderLineHeight := Adapter.HeaderHeight; + + if Adapter.DataRowHeightAssigned then + FDetailsLineHeight := Adapter.DataRowHeight + else + FDetailsLineHeight := DefaultDataRowLineHeight; + + FPreviewLineHeight := DefaultDataRowLineHeight; + + for I := 0 to ColumnCount - 1 do + begin + Column := Columns[I]; + if not Adapter.HeaderHeightAssigned then + CalculateHeight(GetHeaderItemViewParams(Column), FHeaderLineHeight); + {if not Adapter.FooterHeightAssigned then + begin + CalculateHeight(GetGroupFooterItemViewParams(nil, -1, Column), FGroupFooterLineHeight); + CalculateHeight(GetFooterItemViewParams(Column), FFooterLineHeight); + end;} + if not Adapter.FooterHeightAssigned then + CalculateHeight(GetFooterItemViewParams(Column, nil), FFooterLineHeight); + if not Adapter.GroupFooterHeightAssigned then + CalculateHeight(GetGroupFooterItemViewParams(nil, -1, Column, nil), FGroupFooterLineHeight); + if not Adapter.DataRowHeightAssigned and not Column.IsPreview then + CalculateHeight(GetItemViewParams(Column, nil, False), FDetailsLineHeight); + end; + + if not Adapter.GroupRowHeightAssigned then + for I := 0 to RowCount - 1 do + CalculateHeight(GetGroupRowViewParams(Rows[I], -1), FGroupRowLineHeight); + + if HasPreview then + CalculateHeight(GetItemViewParams({PreviewColumn}nil, nil, True), FPreviewLineHeight); + + Inc(FFooterLineHeight, 2 * FooterItemInflateVert - 1); + Inc(FGroupFooterLineHeight, 2 * FooterItemInflateVert - 1); + + CalculateDataRowHeights; +end; + +function TdxGridTableViewFormatter.GetAlignSummaryWithColumns: Boolean; +begin + Result := Adapter.GridView.OptionsView.GetGroupSummaryLayout <> gslStandard; +end; + +function TdxGridTableViewFormatter.GetItemPlaceControllerClass: TdxCustomGridTableViewItemPlaceControllerClass; +begin + Result := TdxGridTableViewColumnPlaceController; +end; + +function TdxGridTableViewFormatter.MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; +begin + case AGridBackgroundBitmapIndex of + bbFooter: + Result := vspsGridFooter; + bbGroup: + Result := vspsGridGroup; + bbHeader: + Result := vspsGridHeader; + bbPreview: + Result := vspsGridPreview; + else + Result := 0; + end; + + if Result = 0 then + Result := inherited MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex); +end; + +{$IFDEF DXVER500} + +function TdxGridTableViewFormatter.CanCellMerging: Boolean; +begin + Result := not HasPreview and (RowSeparatorThickness = 0); +end; + +function TdxGridTableViewFormatter.CanColumnCellMerging(AColumn: TcxGridColumn): Boolean; +begin + Result := AColumn.Options.CellMerging; +end; + +procedure TdxGridTableViewFormatter.PerformCellMerging; +var + I: Integer; + Column: TcxGridColumn; +begin + for I := 0 to ColumnCount - 1 do + begin + Column := Columns[I]; + if CanColumnCellMerging(Column) then // because Column.CanCellMerging also performs GridView.CellMerging validation + PerformColumnCellMerging(Column); + end; +end; + +procedure TdxGridTableViewFormatter.PerformColumnCellMerging(AColumn: TcxGridColumn); + + function CanRowBeMergedAsMaster(ARow: TcxCustomGridRow): Boolean; + begin + Result := Adapter.RecordHelpers[ARow].CanCellMergingAsMaster; + end; + + function CanRowBeMergedAsSlave(ARow: TcxCustomGridRow): Boolean; + begin + Result := Adapter.RecordHelpers[ARow].CanCellMergingAsSlave; + end; + + function IsRowMergingSeparator(ARow: TcxCustomGridRow): Boolean; + begin + Result := Adapter.RecordHelpers[ARow].IsCellMergingSeparator; + end; + + procedure RetrieveCellPropertiesAndValue(ARow: TcxCustomGridRow; + out AProperties: TcxCustomEditProperties; out AValue: TcxEditValue); + begin + AProperties := GetItemProperties(AColumn, ARow); + AValue := GetItemValue(AProperties, AColumn, ARow); + end; + + function CompareCellsForMerging(ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; + const AValue1: TcxEditValue; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; + const AValue2: TcxEditValue): Boolean; + begin + Result := GridColumn_DoCompareValuesForCellMerging(AColumn, + ARow1, AProperties1, AValue1, ARow2, AProperties2, AValue2); + end; + + procedure DoMergeCells(AStartRowIndex, AStopRowIndex: Integer); + var + I: Integer; + MasterReportItem, SlaveReportItem: TdxReportVisualItem; + begin + MasterReportItem := GetReportItem(Rows[AStartRowIndex], AColumn); + for I := AStartRowIndex + 1 to AStopRowIndex do + begin + SlaveReportItem := GetReportItem(Rows[I], AColumn); + with MasterReportItem do + Height := Height + SlaveReportItem.Height; + end; + for I := AStartRowIndex + 1 to AStopRowIndex do + begin + SlaveReportItem := GetReportItem(Rows[I], AColumn); + if SlaveReportItem is TdxReportCellString then + TdxReportCellString(SlaveReportItem).Text := ''; + SlaveReportItem.BackgroundBitmapIndex := MasterReportItem.BackgroundBitmapIndex; + if I <> AStopRowIndex then + SlaveReportItem.CellSides := SlaveReportItem.CellSides - [csBottom]; + SlaveReportItem.CellSides := SlaveReportItem.CellSides - [csTop]; + SlaveReportItem.Color := MasterReportItem.Color; + SlaveReportItem.ContentBkColor := MasterReportItem.ContentBkColor; + SlaveReportItem.ContentPattern := MasterReportItem.ContentPattern; + SlaveReportItem.Transparent := True; + if SlaveReportItem is TCustomdxReportCellImageContainer then + begin + TCustomdxReportCellImageContainer(SlaveReportItem).Image := nil; + TCustomdxReportCellImageContainer(SlaveReportItem).ImageIndex := -1; + end; + end; + end; + +var + I, J: Integer; + Row1, Row2: TcxCustomGridRow; + HasCellsMerging, AreCellsMerged, IsMergingSeparator: Boolean; + Properties1, Properties2: TcxCustomEditProperties; + Value1, Value2: TcxEditValue; +begin + I := 0; + while I < RowCount - 1 do + begin + HasCellsMerging := False; + Row1 := Rows[I]; + if CanRowBeMergedAsMaster(Row1) then + begin + RetrieveCellPropertiesAndValue(Row1, Properties1, Value1); + //AreCellsMerged := False; + IsMergingSeparator := False; + J := I; + repeat + Inc(J); + Row2 := Rows[J]; + if CanRowBeMergedAsSlave(Row2) then + begin + RetrieveCellPropertiesAndValue(Row2, Properties2, Value2); + AreCellsMerged := CompareCellsForMerging(TcxGridDataRow(Row1), + Properties1, Value1, TcxGridDataRow(Row2), Properties2, Value2); + if not HasCellsMerging then + HasCellsMerging := AreCellsMerged; + IsMergingSeparator := IsRowMergingSeparator(Row2); + end + else + AreCellsMerged := False; + until (J = RowCount - 1) or not AreCellsMerged or IsMergingSeparator; + + if HasCellsMerging then + begin + if not AreCellsMerged then Dec(J); + DoMergeCells(I, J); + Inc(J); + end; + I := J; + end + else + Inc(I); + end; +end; + +{$ENDIF} + +procedure TdxGridTableViewFormatter.BuildColumnList; +var + I: Integer; + Column: TcxGridColumn; +begin + FColumns.Clear; + for I := 0 to Adapter.ColumnCount - 1 do + begin + Column := Adapter.Columns[I]; + if IsColumnActuallyVisible(Column) then FColumns.Add(Column); + end; +end; + +procedure TdxGridTableViewFormatter.BuildItemLists; +begin + BuildColumnList; +end; + +function TdxGridTableViewFormatter.IsColumnActuallyVisible(AColumn: TcxGridColumn): Boolean; +begin + Result := AColumn.ActuallyVisible; +end; + +function TdxGridTableViewFormatter.GetViewWidth: Integer; +begin + Result := ItemPlaceController.Width; +end; + +function TdxGridTableViewFormatter.GetColumn(Index: Integer): TcxGridColumn; +begin + Result := TcxGridColumn(FColumns[Index]); +end; + +function TdxGridTableViewFormatter.GetColumnCount: Integer; +begin + Result := FColumns.Count; +end; + +function TdxGridTableViewFormatter.GetGroupRowSeparatorColor: TColor; +begin + Result := Adapter.GroupRowSeparatorColor; +end; + +function TdxGridTableViewFormatter.GetGroupRowSeparatorThickness: Integer; +begin + Result := Adapter.GroupRowSeparatorThickness; +end; + +function TdxGridTableViewFormatter.GetHasPreview: Boolean; +begin + Result := Adapter.HasPreview and ShowPreview and + (PreviewAutoHeight or (PreviewMaxLineCount > 0)); +end; + +function TdxGridTableViewFormatter.GetHeaderLineCount: Integer; +begin + Result := ItemPlaceController.HeaderLineCount; +end; + +function TdxGridTableViewFormatter.GetPreviewAutoHeight: Boolean; +begin + Result := ReportLink.OptionsPreview.AutoHeight; +end; + +function TdxGridTableViewFormatter.GetPreviewColumn: TcxGridColumn; +begin + Result := Adapter.PreviewColumn; +end; + +function TdxGridTableViewFormatter.GetPreviewMaxLineCount: Integer; +begin + Result := ReportLink.OptionsPreview.MaxLineCount; +end; + +function TdxGridTableViewFormatter.GetRow(Index: Integer): TcxCustomGridRow; +begin + Result := inherited Records[Index] as TcxCustomGridRow; +end; + +function TdxGridTableViewFormatter.GetRowCount: Integer; +begin + Result := RecordCount; +end; + +function TdxGridTableViewFormatter.GetRowHeight(Index: Integer): Integer; +begin + Result := Integer(FRowHeights[Index]) +end; + +function TdxGridTableViewFormatter.GetRowHeightByRow(Row: TcxCustomGridRow): Integer; +begin + Result := {20;//}RowHeights[RecordIndexes[Row]]; +end; + +function TdxGridTableViewFormatter.GetRowSeparatorColor: TColor; +begin + Result := Adapter.RowSeparatorColor; + {with ReportLink.OptionsFormatting do + if UseNativeStyles then + begin + Result := FixedColor; + end;} +end; + +function TdxGridTableViewFormatter.GetRowSeparatorThickness: Integer; +begin + Result := Adapter.RowSeparatorThickness; +end; + +function TdxGridTableViewFormatter.GetShowGroupFooters: Boolean; +begin + Result := ReportLink.OptionsView.GroupFooters; +end; + +function TdxGridTableViewFormatter.GetShowFooters: Boolean; +begin + Result := ReportLink.OptionsView.Footers; +end; + +function TdxGridTableViewFormatter.GetShowHeaders: Boolean; +begin + Result := ReportLink.OptionsView.Headers; +end; + +function TdxGridTableViewFormatter.GetShowPreview: Boolean; +begin + Result := ReportLink.OptionsPreview.Visible; +end; + +procedure TdxGridTableViewFormatter.SetRowHeight(Index: Integer; Value: Integer); +begin + FRowHeights[Index] := TObject(Value); +end; + +procedure TdxGridTableViewFormatter.SetRowHeightByRow(Row: TcxCustomGridRow; Value: Integer); +begin + RowHeights[IndexOfRecord(Row)] := Value; +end; + +{ TdxGridTableViewBuilder } + +function TdxGridTableViewBuilder.Adapter: TdxGridTableViewAdapter; +begin + Result := inherited Adapter as TdxGridTableViewAdapter; +end; + +class function TdxGridTableViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxGridTableViewAdapter; +end; + +function TdxGridTableViewBuilder.Formatter: TdxGridTableViewFormatter; +begin + Result := inherited Formatter as TdxGridTableViewFormatter; +end; + +class function TdxGridTableViewBuilder.FormatterClass: TdxGridViewFormatterClass; +begin + Result := TdxGridTableViewFormatter; +end; + +procedure TdxGridTableViewBuilder.AddDelimitersHardVert(AReportRow: TdxReportCell); +begin + ReportLink.FDelimitersHardVert.Add(TObject(AReportRow.AbsoluteRect.Top)); +end; + +procedure TdxGridTableViewBuilder.DoBuildViewBody; +begin + if Formatter.ShowHeaders then CreateHeader; + CreateRows; + if not IsAborted and Formatter.ShowFooters then + CreateFooter; +end; + +procedure TdxGridTableViewBuilder.DoBuildViewFooter; +begin + inherited; + if not Formatter.HasDetailsSeparator then CreateViewTerminator; +end; + +procedure TdxGridTableViewBuilder.CreateDetails(AMasterRow: TcxGridMasterDataRow); +var + CurrentView: TcxCustomGridView; +begin + if AMasterRow.ActiveDetailGridView <> nil then + if ReportLink.OptionsLevels.Unwrap then + begin + ProcessedView := nil; + try + if ReportLink.OptionsLevels.RiseActiveLevelOntoTop then + begin + CurrentView := AMasterRow.ActiveDetailGridView; + CreateDetailView(CurrentView); + ProcessedView := CurrentView; + end; + ReportLink.ForEachView(AMasterRow, CreateDetailView); + finally + ProcessedView := nil; + end; + end + else + CreateDetailView(AMasterRow.ActiveDetailGridView); +end; + +procedure TdxGridTableViewBuilder.CreateDetailView(AGridView: TcxCustomGridView); +begin + if AGridView <> ProcessedView then ReportLink.BuildView(Self, AGridView); +end; + +function TdxGridTableViewBuilder.GetAreDetailsBuilt: Boolean; +begin + with ReportLink.OptionsDetails do + Result := not StartFromFocusedView or not OnlyFocusedView; +end; + +procedure TdxGridTableViewBuilder.CreateFooter; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetFootersProducer.Produce(HostInfoServices.FootersHostInfo); + AddReportRow(ReportRow); +end; + +function TdxGridTableViewBuilder.GetFootersProducer: TdxGridTableViewFootersProducer; +begin + Result := ProducerCache[GetFootersProducerClass] as TdxGridTableViewFootersProducer; +end; + +function TdxGridTableViewBuilder.GetFootersProducerClass: TdxGridTableViewFootersProducerClass; +begin + Result := TdxGridTableViewFootersProducer; +end; + +procedure TdxGridTableViewBuilder.CreateGroupFooters(AGridRow: TcxCustomGridRow); +var + Producer: TdxGridTableViewGroupFooterProducer; + HostInfo: TdxGridAttributeHostInfo; + Index, I: Integer; + ReportRow: TdxReportCell; +begin + Producer := GetGroupFooterProducer; + HostInfo := HostInfoServices.PageDetailsHostInfo; + Index := 0; + for I := 0 to AGridRow.Level do + if Adapter.HasGroupFooter(AGridRow, I) then + begin + ReportRow := Producer.Produce(HostInfo, AGridRow, AGridRow.Level - I, Index); + AddReportRow(ReportRow); + Inc(Index); + end; +end; + +function TdxGridTableViewBuilder.GetGroupFooterProducer: TdxGridTableViewGroupFooterProducer; +begin + Result := ProducerCache[GetGroupFooterProducerClass] as TdxGridTableViewGroupFooterProducer; +end; + +function TdxGridTableViewBuilder.GetGroupFooterProducerClass: TdxGridTableViewGroupFooterProducerClass; +begin + Result := TdxGridTableViewGroupFooterProducer; +end; + +procedure TdxGridTableViewBuilder.CreateHeader; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetHeadersProducer.Produce(HostInfoServices.HeadersHostInfo); + AddReportRow(ReportRow); +end; + +function TdxGridTableViewBuilder.GetHeadersProducer: TdxGridTableViewHeadersProducer; +begin + Result := ProducerCache[GetHeadersProducerClass] as TdxGridTableViewHeadersProducer; +end; + +function TdxGridTableViewBuilder.GetHeadersProducerClass: TdxGridTableViewHeadersProducerClass; +begin + Result := TdxGridTableViewHeadersProducer; +end; + +procedure TdxGridTableViewBuilder.CreateRow(AGridRow: TcxCustomGridRow; ARowIndex: Integer); +var + ReportRow: TdxReportCell; +begin + ReportRow := GetRowProducer(AGridRow).Produce(HostInfoServices.PageDetailsHostInfo, AGridRow, ARowIndex); + AddReportRow(ReportRow); +end; + +function TdxGridTableViewBuilder.GetRowProducer(AGridRow: TcxCustomGridRow): TdxGridTableViewCustomDataRowProducer; +begin + Result := ProducerCache[GetRowProducerClass(AGridRow)] as TdxGridTableViewCustomDataRowProducer; +end; + +procedure TdxGridTableViewBuilder.CreateRows; +var + PrevGridRow, GridRow: TcxCustomGridRow; + I: Integer; + HasGroupDelimiter: Boolean; +begin + PrevGridRow := nil; + for I := 0 to Formatter.RowCount - 1 do + begin + GridRow := Formatter.Rows[I]; + + if (ShowRowSeparators and (I > 0)) and (not (PrevGridRow is TcxGridGroupRow) or not ShowGroupRowSeparators) then + CreateRowSeparator(GridRow, False); + + HasGroupDelimiter := Formatter.PaginateByTopLevelGroups and (I > 0) and + (GridRow.Level = 0) and (GridRow is TcxGridGroupRow); + + CreateRow(GridRow, I); + + // Hard Delimiters + if HasGroupDelimiter then + AddDelimitersHardVert(LastReportRow); + + if AreDetailsBuilt and Adapter.HasDetails(GridRow) then + CreateDetails(GridRow as TcxGridMasterDataRow); + + if ShowGroupRowSeparators and (GridRow is TcxGridGroupRow) then + CreateGroupRowSeparator(TcxGridGroupRow(GridRow)); + + if Formatter.ShowGroupFooters and Adapter.HasGroupFooters(GridRow) then + CreateGroupFooters(GridRow); + + // Last Row Separator + if (ShowRowSeparators and (I = Formatter.RowCount - 1)) and (not (GridRow is TcxGridGroupRow) or not ShowGroupRowSeparators) then + CreateRowSeparator(GridRow, True); + + // Progress + if MasterBuilder = nil then + begin + Progress(100 * (I + 1) / Formatter.RowCount); + if IsAborted then Break; + end; + + PrevGridRow := GridRow; + end; +end; + +function TdxGridTableViewBuilder.GetRowProducerClass(AGridRow: TcxCustomGridRow): TdxGridTableViewCustomDataRowProducerClass; +begin + Result := Adapter.RecordHelpers[AGridRow].ProducerClass; +end; + +procedure TdxGridTableViewBuilder.CreateRowSeparator(AGridRow: TcxCustomGridRow; + AnIsLast: Boolean = False); +var + ReportRow: TdxReportCell; +begin + ReportRow := GetRowSeparatorProducer.Produce(HostInfoServices.PageDetailsHostInfo, AGridRow, AnIsLast); + AddReportRow(ReportRow); +end; + +function TdxGridTableViewBuilder.GetRowSeparatorProducer: TdxGridTableViewRowSeparatorProducer; +begin + Result := ProducerCache[GetRowSeparatorProducerClass] as TdxGridTableViewRowSeparatorProducer; +end; + +function TdxGridTableViewBuilder.GetRowSeparatorProducerClass: TdxGridTableViewRowSeparatorProducerClass; +begin + Result := TdxGridTableViewRowSeparatorProducer; +end; + +function TdxGridTableViewBuilder.GetShowRowSeparators: Boolean; +begin + Result := Adapter.HasRowSeparators; +end; + +procedure TdxGridTableViewBuilder.CreateGroupRowSeparator(AGridRow: TcxGridGroupRow); +var + ReportRow: TdxReportCell; +begin + ReportRow := GetGroupRowSeparatorProducer.Produce(HostInfoServices.PageDetailsHostInfo, AGridRow); + AddReportRow(ReportRow); +end; + +function TdxGridTableViewBuilder.GetGroupRowSeparatorProducer: TdxGridTableViewGroupRowSeparatorProducer; +begin + Result := ProducerCache[GetGroupRowSeparatorProducerClass] as TdxGridTableViewGroupRowSeparatorProducer; +end; + +function TdxGridTableViewBuilder.GetGroupRowSeparatorProducerClass: TdxGridTableViewGroupRowSeparatorProducerClass; +begin + Result := TdxGridTableViewGroupRowSeparatorProducer; +end; + +function TdxGridTableViewBuilder.GetShowGroupRowSeparators: Boolean; +begin + Result := Adapter.IsOffice11StyleGrouping; +end; + +function TdxGridTableViewBuilder.GridView: TcxGridTableView; +begin + Result := inherited GridView as TcxGridTableView; +end; + +class function TdxGridTableViewBuilder.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridTableView; +end; + +function TdxGridTableViewBuilder.GetLastReportRow: TdxReportCell; +begin + Result := ReportRows[ReportRowCount - 1]; +end; + +function TdxGridTableViewBuilder.GetProcessedView: TcxCustomGridView; +begin + Result := ReportLink.FProcessedView; +end; + +procedure TdxGridTableViewBuilder.SetProcessedView(Value: TcxCustomGridView); +begin + ReportLink.FProcessedView := Value; +end; + +{ TdxGridDBTableViewAdapter } + +function TdxGridDBTableViewAdapter.GridView: TcxGridDBTableView; +begin + Result := inherited GridView as TcxGridDBTableView; +end; + +class function TdxGridDBTableViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridDBTableView; +end; + +procedure TdxGridDBTableViewAdapter.AfterBuilding; +begin + UnloadAllRecords; + inherited; +end; + +procedure TdxGridDBTableViewAdapter.BeforeBuilding; +begin + inherited; + LoadAllRecords; +end; + +function TdxGridDBTableViewAdapter.DataController: TcxGridDBDataController; +begin + Result := TcxGridDBDataController(inherited DataController); +end; + +function TdxGridDBTableViewAdapter.DBDataModeController: TcxDBDataModeController; +begin + Result := DataController.DataModeController; +end; + +procedure TdxGridDBTableViewAdapter.LoadAllRecords; +begin + _LoadAllRecords(DBDataModeController, FPrevAllRecordsAreLoaded); +end; + +procedure TdxGridDBTableViewAdapter.UnloadAllRecords; +begin + _UnloadAllRecords(DBDataModeController, FPrevAllRecordsAreLoaded); +end; + +{ TdxGridDBTableViewBuilder } + +function TdxGridDBTableViewBuilder.Adapter: TdxGridDBTableViewAdapter; +begin + Result := inherited Adapter as TdxGridDBTableViewAdapter; +end; + +class function TdxGridDBTableViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxGridDBTableViewAdapter; +end; + +{ TdxGridBandedTableViewAdapter } + +constructor TdxGridBandedTableViewAdapter.Create(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView); +begin + inherited; + FFooterLineCount := -1; +end; + +function TdxGridBandedTableViewAdapter.GridView: TcxGridBandedTableView; +begin + Result := inherited GridView as TcxGridBandedTableView; +end; + +class function TdxGridBandedTableViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridBandedTableView; +end; + +function TdxGridBandedTableViewAdapter.Styles: TcxGridBandedTableViewStyles; +begin + Result := inherited Styles as TcxGridBandedTableViewStyles; +end; + +function TdxGridBandedTableViewAdapter.CalculateDetailsLineCount: Integer; +var + I, J, V: Integer; + BandRows: TcxGridBandRows; +begin + Result := 0; + for I := 0 to BottomBandCount - 1 do + begin + BandRows := BottomBands[I].Rows; + V := 0; + for J := 0 to BandRows.VisibleCount - 1 do + Inc(V, BandRows[J].LineCount); + if Result < V then Result := V; + end; +end; + +function TdxGridBandedTableViewAdapter.CalculateFooterLineCount: Integer; +var + I, V: Integer; +begin + Result := 0; + for I := 0 to BottomBandCount - 1 do + begin + V := BottomBands[I].Rows.VisibleCount; + if Result < V then Result := V; + end; +end; + +function TdxGridBandedTableViewAdapter.GetBandHeaderHeight: Integer; +begin + Result := GridView.OptionsView.BandHeaderHeight; +end; + +function TdxGridBandedTableViewAdapter.GetBandHeaderHeightAssigned: Boolean; +begin + Result := BandHeaderHeight <> 0; +end; + +function TdxGridBandedTableViewAdapter.GetBandHeaderViewParams(ABand: TcxGridBand): TcxViewParams; +begin + if (ABand <> nil) and (ABand.Styles <> nil) then + ABand.Styles.GetHeaderParams(Result) + else + Styles.GetBandHeaderParams(ABand, Result); + if ABand = nil then + Result.Color := LookAndFeelPainter.DefaultHeaderBackgroundColor +end; + +function TdxGridBandedTableViewAdapter.GetDataRowHeightAssigned: Boolean; +begin + Result := (DetailsLineCount = 1) and inherited GetDataRowHeightAssigned; +end; + +function TdxGridBandedTableViewAdapter.GetFooterHeightAssigned: Boolean; +begin + Result := (FooterLineCount = 1) and inherited GetFooterHeightAssigned; +end; + +function TdxGridBandedTableViewAdapter.GetHeaderHeightAssigned: Boolean; +begin + Result := (DetailsLineCount = 1) and inherited GetHeaderHeightAssigned; +end; + +function TdxGridBandedTableViewAdapter.GetHeaderMultiline(Column: TcxGridColumn): Boolean; +begin + Result := ((DetailsLineCount = 1) and inherited GetHeaderMultiline(Column)) or + (TcxGridBandedColumn(Column).Position.LineCount > 1); {PS 3.01} +end; + +function TdxGridBandedTableViewAdapter.GetRowLineCount: Integer; +begin + Result := CalculateFooterLineCount; +end; + +function TdxGridBandedTableViewAdapter.GetBand(Index: Integer): TcxGridBand; +begin + Result := GridView.Bands.VisibleItems[Index]; +end; + +function TdxGridBandedTableViewAdapter.GetBandCount: Integer; +begin + Result := GridView.Bands.VisibleCount; +end; + +function TdxGridBandedTableViewAdapter.GetBandEndEllipsis: Boolean; +begin + Result := GridView.OptionsView.BandHeaderEndEllipsis; +end; + +function TdxGridBandedTableViewAdapter.GetBandHeaderLineCount: Integer; +begin + Result := GridView.OptionsView.BandHeaderLineCount; +end; + +function TdxGridBandedTableViewAdapter.GetBandHeaderMultiline: Boolean; +begin + Result := BandHeaderHeightAssigned;// or (BandHeaderLineCount > 1); {!!! v3.03} +end; + +function TdxGridBandedTableViewAdapter.GetBottomBand(Index: Integer): TcxGridBand; +begin + {$IFDEF DXVER500} + Result := GridView.Bands.VisibleBottomItems[Index]; + {$ELSE} + Result := GridView.Bands.VisibleItems[Index]; + {$ENDIF} +end; + +function TdxGridBandedTableViewAdapter.GetBottomBandCount: Integer; +begin + {$IFDEF DXVER500} + Result := GridView.Bands.VisibleBottomItemCount; + {$ELSE} + Result := GridView.Bands.VisibleCount; + {$ENDIF} +end; + +function TdxGridBandedTableViewAdapter.GetColumn(Index: Integer): TcxGridBandedColumn; +begin + Result := GridView.VisibleColumns[Index]; +end; + +function TdxGridBandedTableViewAdapter.GetFooterLineCount: Integer; +begin + if FFooterLineCount = -1 then + FFooterLineCount := CalculateFooterLineCount; + Result := FFooterLineCount; +end; + +function TdxGridBandedTableViewAdapter.GetRootBand(Index: Integer): TcxGridBand; +begin + {$IFDEF DXVER500} + Result := GridView.Bands.VisibleRootItems[Index]; + {$ELSE} + Result := GridView.Bands.VisibleItems[Index]; + {$ENDIF} +end; + +function TdxGridBandedTableViewAdapter.GetRootBandCount: Integer; +begin + {$IFDEF DXVER500} + Result := GridView.Bands.VisibleRootItemCount; + {$ELSE} + Result := GridView.Bands.VisibleCount; + {$ENDIF} +end; + +function TdxGridBandedTableViewAdapter.GetThemedBandHeaderItemColor: TColor; +begin + Result := LookAndFeelPainter.DefaultHeaderColor; +end; + +function TdxGridBandedTableViewAdapter.GetThemedBandHeaderItemTextColor: TColor; +begin + Result := LookAndFeelPainter.DefaultHeaderTextColor; +end; + +{ TdxGridBandedTableViewColumnPlace } + +function TdxGridBandedTableViewColumnPlace.GetLineCount: Integer; +begin + Result := Column.Position.LineCount; +end; + +function TdxGridBandedTableViewColumnPlace.GetRowIndex: Integer; +begin + Result := Column.Position.Row.LineOffset; +end; + +function TdxGridBandedTableViewColumnPlace.GetColumn: TcxGridBandedColumn; +begin + Result := inherited Column as TcxGridBandedColumn; +end; + +function TdxGridBandedTableViewColumnPlace.GetController: TdxCustomGridBandedTableViewItemPlace; +begin + Result := inherited Controller as TdxCustomGridBandedTableViewItemPlace; +end; + +function TdxGridBandedTableViewColumnPlace.GetFormatter: TdxGridBandedTableViewFormatter; +begin + Result := inherited Formatter as TdxGridBandedTableViewFormatter; +end; + +{ TdxCustomGridBandedTableViewItemPlace } + +constructor TdxCustomGridBandedTableViewItemPlace.Create(AController: TdxGridBandedTableViewItemPlaceController; + AParent: TdxGridBandedTableViewItemPlace; ABand: TcxGridBand); +begin + inherited Create(AController.Formatter); + FController := AController; + FParent := AParent; + FBand := ABand; + + FHeight := -1; + FLeftBound := -1; + FMinWidth := -1; + FTopBound := -1; +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateHeaderLineCount: Integer; +var + I: Integer; +begin + Result := 0; + with Band.Rows do + for I := 0 to VisibleCount - 1 do + Inc(Result, VisibleItems[I].LineCount); +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateWidth: Integer; + + function FixedSize: Boolean; + var + I: Integer; + begin + Result := False; + for I := 0 to Band.ColumnCount - 1 do + Result := Result or not Band.Columns[I].Options.HorzSizing; + end; + +begin + if FixedSize then + Result := Max(Band.Width, InternalCalculateWidth) + else + begin + Result := Band.Width; + if Result = 0 then + Result := InternalCalculateWidth + end; + if Result = 0 then + Result := cxGridBandedTableView.cxGridDefaultEmptyBandWidth; + if Result < InternalCalculateMinWidth then + Result := InternalCalculateMinWidth; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetItemClass(AColumn: TcxGridColumn): TdxGridTableViewColumnPlaceClass; +begin + Result := TdxGridBandedTableViewColumnPlace; +end; + +procedure TdxCustomGridBandedTableViewItemPlace.AssignWidth; +begin + Width := Width; +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateHeight: Integer; +begin + Result := Controller.CalculateItemHeight(Self); +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateLevelHeight: Integer; +begin + if Adapter.BandHeaderHeightAssigned then + Result := Adapter.BandHeaderHeight + else + Result := CalculateLineHeight * Adapter.BandHeaderLineCount; +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateLineHeight: Integer; +begin + Result := 0; + Formatter.CalculateHeight(ViewParams, Result); +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateMinWidth: Integer; +begin + Result := InternalCalculateMinWidth; + {$IFDEF DXVER500} + if Result < Band.MinWidth then Result := Band.MinWidth; + {$ENDIF} +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateLeftBound: Integer; +begin + Result := Controller.CalculateItemLeftBound(Self); +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateTopBound: Integer; +begin + Result := Controller.CalculateItemTopBound(Self); +end; + +function TdxCustomGridBandedTableViewItemPlace.GetRowCount: Integer; +begin + Result := 0; +end; + +function TdxCustomGridBandedTableViewItemPlace.InternalCalculateMinWidth: Integer; +begin + Result := 0; +end; + +function TdxCustomGridBandedTableViewItemPlace.InternalCalculateWidth: Integer; +begin + Result := 0; +end; + +procedure TdxCustomGridBandedTableViewItemPlace.InitAutoWidthItem(AnItem: TcxAutoWidthItem); +begin + AnItem.Fixed := IsFixed; + AnItem.MinWidth := MinWidth; + AnItem.Width := Width; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetAdapter: TdxGridBandedTableViewAdapter; +begin + Result := inherited Adapter as TdxGridBandedTableViewAdapter; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetBounds: TRect; +begin + Result := MakeBounds(LeftBound, TopBound, Width, Height); +end; + +function TdxCustomGridBandedTableViewItemPlace.GetFormatter: TdxGridBandedTableViewFormatter; +begin + Result := inherited Formatter as TdxGridBandedTableViewFormatter; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetHeight: Integer; +begin + if FHeight = -1 then + FHeight := CalculateHeight; + Result := FHeight; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetIndex: Integer; +begin + if Parent <> nil then + Result := Parent.IndexOf(Self) + else + Result := Controller.RootIndexOf(Self); +end; + +function TdxCustomGridBandedTableViewItemPlace.GetIsFixed: Boolean; +begin + Result := not Band.Options.Sizing; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetLeftBound: Integer; +begin + if FLeftBound = -1 then + FLeftBound := CalculateLeftBound; + Result := FLeftBound; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetLevelIndex: Integer; +begin + {$IFDEF DXVER500} + Result := Band.BandLevelIndex; + {$ELSE} + Result := 0; + {$ENDIF} +end; + +function TdxCustomGridBandedTableViewItemPlace.GetMinWidth: Integer; +begin + if FMinWidth = -1 then + FMinWidth := CalculateMinWidth; + Result := FMinWidth; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetTopBound: Integer; +begin + if FTopBound = -1 then + FTopBound := CalculateTopBound; + Result := FTopBound; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetViewParams: TdxReportItemViewParams; +begin + Result := Formatter.GetBandItemViewParams(Band); +end; + +{ TdxGridBandedTableViewItemPlace } + +constructor TdxGridBandedTableViewItemPlace.Create(AnOwner: TdxGridBandedTableViewItemPlaceController; + AParent: TdxGridBandedTableViewItemPlace; ABand: TcxGridBand); +begin + inherited; + FChildItems := TList.Create; +end; + +destructor TdxGridBandedTableViewItemPlace.Destroy; +begin + FreeAndNil(FChildItems); + inherited; +end; + +function TdxGridBandedTableViewItemPlace.IndexOf(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; +begin + Result := FChildItems.IndexOf(AnItem); +end; + +{$IFDEF DXVER500} +procedure TdxGridBandedTableViewItemPlace.Refresh; +begin + inherited; + RefreshChildItems; +end; +{$ENDIF} + +function TdxGridBandedTableViewItemPlace.GetRowCount: Integer; +begin + Result := 1; +end; + +function TdxGridBandedTableViewItemPlace.InternalCalculateMinWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to ChildItemCount - 1 do + Inc(Result, ChildItems[I].MinWidth); +end; + +function TdxGridBandedTableViewItemPlace.InternalCalculateWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to ChildItemCount - 1 do + Inc(Result, ChildItems[I].Width); +end; + +procedure TdxGridBandedTableViewItemPlace.WidthChanged; +begin + inherited; + CalculateChildItemWidths; +end; + +procedure TdxGridBandedTableViewItemPlace.CalculateChildItemWidths; +var + AutoWidthObject: TcxAutoWidthObject; + I: Integer; +begin + AutoWidthObject := TcxAutoWidthObject.Create(ChildItemCount); + try + for I := 0 to ChildItemCount - 1 do + ChildItems[I].InitAutoWidthItem(AutoWidthObject.AddItem); + AutoWidthObject.AvailableWidth := Width; + AutoWidthObject.Calculate; + + for I := 0 to ChildItemCount - 1 do + ChildItems[I].Width := AutoWidthObject[I].AutoWidth; + finally + AutoWidthObject.Free; + end; +end; + +{$IFDEF DXVER500} +procedure TdxGridBandedTableViewItemPlace.RefreshChildItems; +var + I: Integer; +begin + FChildItems.Count := Band.VisibleChildBandCount; + for I := 0 to FChildItems.Count - 1 do + begin + FChildItems[I] := Controller.ItemsByBand[Band.VisibleChildBands[I]]; + ChildItems[I].FParent := Self; + end; +end; +{$ENDIF} + +function TdxGridBandedTableViewItemPlace.GetChildItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; +begin + Result := TdxCustomGridBandedTableViewItemPlace(FChildItems[Index]); +end; + +function TdxGridBandedTableViewItemPlace.GetChildItemCount: Integer; +begin + Result := FChildItems.Count; +end; + +{ TdxGridBandedTableViewBottomItemPlace } + +procedure TdxGridBandedTableViewBottomItemPlace.AddItems; +var + I, J: Integer; + Row: TcxGridBandRow; +begin + for I := 0 to Band.Rows.VisibleCount - 1 do + begin + Row := Band.Rows.VisibleItems[I]; + for J := 0 to Row.VisibleCount - 1 do + CreateItem(Row.VisibleItems[J]); + end; +end; + +function TdxGridBandedTableViewBottomItemPlace.CalculateItemLeftBound(AnItem: TdxGridTableViewColumnPlace): Integer; +var + Row: TcxGridBandRow; + I: Integer; + Item: TdxGridTableViewColumnPlace; +begin + Result := LeftBound; + Row := TdxGridBandedTableViewColumnPlace(AnItem).Column.Position.Row; + for I := 0 to TdxGridBandedTableViewColumnPlace(AnItem).Column.Position.VisibleColIndex - 1 do + begin + Item := ItemsByColumn[Row.VisibleItems[I]]; + Inc(Result, Item.Width); + end; +end; + +procedure TdxGridBandedTableViewBottomItemPlace.CalculateItemsWidth; +var + I, J: Integer; + Row: TcxGridBandRow; + AutoWidthObject: TcxAutoWidthObject; + Column: TcxGridColumn; +begin + for I := 0 to Band.Rows.VisibleCount - 1 do + begin + Row := Band.Rows.VisibleItems[I]; + AutoWidthObject := TcxAutoWidthObject.Create(Row.VisibleCount); + try + for J := 0 to Row.VisibleCount - 1 do + ItemsByColumn[Row.VisibleItems[J]].InitAutoWidthItem(AutoWidthObject.AddItem); + AutoWidthObject.AvailableWidth := ItemsAvailableWidth; + AutoWidthObject.Calculate; + + for J := 0 to Row.VisibleCount - 1 do + begin + Column := Row.VisibleItems[J]; + ItemsByColumn[Column].Width := AutoWidthObject[J].AutoWidth; + end; + finally + AutoWidthObject.Free; + end; + end; +end; + +function TdxGridBandedTableViewBottomItemPlace.GetItemsAutoWidth: Boolean; +begin + Result := True; +end; + +function TdxGridBandedTableViewBottomItemPlace.GetItemsAvailableWidth: Integer; +begin + Result := Width; +end; + +function TdxGridBandedTableViewBottomItemPlace.GetRowCount: Integer; +begin + Result := Controller.LevelCount - LevelIndex; +end; + +function TdxGridBandedTableViewBottomItemPlace.InternalCalculateMinWidth: Integer; +var + I, V, J: Integer; + Row: TcxGridBandRow; + Column: TcxGridColumn; +begin + Result := 0; + for I := 0 to Band.Rows.VisibleCount - 1 do + begin + V := 0; + Row := Band.Rows.VisibleItems[I]; + for J := 0 to Row.VisibleCount - 1 do + begin + Column := Row.VisibleItems[J]; + Inc(V, Adapter.InternalColumnMinWidths[Column]); + end; + //if Row.IsFirst then + // Inc(V, Formatter.IndentWidth * Formatter.IndentCount); + if Result < V then Result := V; + end +end; + +function TdxGridBandedTableViewBottomItemPlace.InternalCalculateWidth: Integer; +var + I, V, J: Integer; + Row: TcxGridBandRow; + Column: TcxGridColumn; +begin + Result := 0; + for I := 0 to Band.Rows.VisibleCount - 1 do + begin + V := 0; + Row := Band.Rows.VisibleItems[I]; + for J := 0 to Row.VisibleCount - 1 do + begin + Column := Row.VisibleItems[J]; + Inc(V, Adapter.InternalColumnWidths[Column]); + end; + if Result < V then Result := V; + end; +end; + +procedure TdxGridBandedTableViewBottomItemPlace.WidthChanged; +begin + inherited; + CalculateItemsWidth; +end; + +{ TdxGridBandedTableViewItemPlaceController } + +constructor TdxGridBandedTableViewItemPlaceController.Create(AFormatter: TdxGridTableViewFormatter); +begin + inherited; + FBottomItems := TList.Create; + FItems := TList.Create; + FRootItems := TList.Create; + FLevelHeights := TList.Create; + + FHeight := -1; + FLevelCount := -1; +end; + +destructor TdxGridBandedTableViewItemPlaceController.Destroy; +begin + FreeAndNil(FLevelHeights); + FreeAndNil(FRootItems); + FreeAndNilItems; + FreeAndNil(FBottomItems); + inherited; +end; + +procedure TdxGridBandedTableViewItemPlaceController.Calculate; +begin + CalculateLevelHeights; + CalculateItemWidths; +end; + +procedure TdxGridBandedTableViewItemPlaceController.Refresh; +begin + ClearItems; + AddItems; + RefreshRootItems; + RefreshBottomItems; + RefreshItems; +end; + +function TdxGridBandedTableViewItemPlaceController.IndexOf(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; +begin + Result := FItems.IndexOf(AnItem); +end; + +function TdxGridBandedTableViewItemPlaceController.IndexOf(ABand: TcxGridBand): Integer; +begin + for Result := 0 to ItemCount - 1 do + if Items[Result].Band = ABand then + Exit; + Result := -1; +end; + +function TdxGridBandedTableViewItemPlaceController.RootIndexOf(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; +begin + Result := FRootItems.IndexOf(AnItem); +end; + +function TdxGridBandedTableViewItemPlaceController.RootIndexOf(ABand: TcxGridBand): Integer; +begin + for Result := 0 to RootItemCount - 1 do + if RootItems[Result].Band = ABand then + Exit; + Result := -1; +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateHeaderLineCount: Integer; +var + I, V: Integer; +begin + Result := -1; + for I := 0 to BottomItemCount - 1 do + begin + V := BottomItems[I].HeaderLineCount; + if Result < V then Result := V; + end; +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to RootItemCount - 1 do + Inc(Result, RootItems[I].Width); +end; + +function TdxGridBandedTableViewItemPlaceController.GetItemByColumn(Column: TcxGridColumn): TdxGridTableViewColumnPlace; +var + BandPlace: TdxCustomGridBandedTableViewItemPlace; +begin + BandPlace := ItemsByBand[TcxGridBandedColumn(Column).Position.Band]; + if BandPlace <> nil then + Result := BandPlace.ItemsByColumn[Column] + else + Result := nil; +end; + +procedure TdxGridBandedTableViewItemPlaceController.AddItems; +var + I: Integer; +begin + FItems.Count := Formatter.BandCount; + for I := 0 to ItemCount - 1 do + FItems[I] := CreateItem(Formatter.Bands[I]); +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateHeight: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to LevelCount - 1 do + Inc(Result, LevelHeights[I]); +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateItemHeight(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; +var + I: Integer; +begin + Result := 0; + for I := AnItem.LevelIndex to AnItem.LevelIndex + AnItem.RowCount - 1 do + Inc(Result, LevelHeights[I]); +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateItemLeftBound(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; +var + I: Integer; +begin + if AnItem.Parent <> nil then + begin + Result := AnItem.Parent.LeftBound; + for I := 0 to AnItem.Index - 1 do + Inc(Result, AnItem.Parent.ChildItems[I].Width); + end + else + begin + Result := 0; + for I := 0 to AnItem.Index - 1 do + Inc(Result, RootItems[I].Width); + end; +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateItemTopBound(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to AnItem.LevelIndex - 1 do + Inc(Result, LevelHeights[I]); +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateLevelCount: Integer; +var + I, V: Integer; +begin + Result := 0; + if ItemCount <> 0 then + begin + for I := 0 to ItemCount - 1 do + begin + V := Items[I].LevelIndex; + if Result < V then Result := V; + end; + Inc(Result); + end; +end; + +procedure TdxGridBandedTableViewItemPlaceController.CalculateItemWidths; +var + I: Integer; + AutoWidthObject: TcxAutoWidthObject; +begin + for I := 0 to RootItemCount - 1 do + RootItems[I].AssignWidth; + + if AutoWidth then + begin + AutoWidthObject := TcxAutoWidthObject.Create(RootItemCount); + try + for I := 0 to RootItemCount - 1 do + RootItems[I].InitAutoWidthItem(AutoWidthObject.AddItem); + AutoWidthObject.AvailableWidth := AvailableWidth; + AutoWidthObject.Calculate; + + for I := 0 to RootItemCount - 1 do + RootItems[I].Width := AutoWidthObject[I].AutoWidth; + finally + AutoWidthObject.Free; + end; + end; +end; + +procedure TdxGridBandedTableViewItemPlaceController.CalculateLevelHeights; +var + I, V: Integer; + Item: TdxCustomGridBandedTableViewItemPlace; +begin + FLevelHeights.Count := LevelCount; + for I := 0 to ItemCount - 1 do + begin + Item := Items[I]; + V := Item.CalculateLevelHeight; + if LevelHeights[Item.LevelIndex] < V then + LevelHeights[Item.LevelIndex] := V; + end; +end; + +procedure TdxGridBandedTableViewItemPlaceController.ClearItems; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + Items[I].Free; + FItems.Clear; +end; + +function TdxGridBandedTableViewItemPlaceController.CreateItem(ABand: TcxGridBand): TdxCustomGridBandedTableViewItemPlace; +begin + Result := GetItemClass(ABand).Create(Self, nil, ABand); +end; + +function TdxGridBandedTableViewItemPlaceController.GetItemClass(ABand: TcxGridBand): TdxCustomGridBandedTableViewItemPlaceClass; +begin + {$IFDEF DXVER500} + if ABand.IsBottom then + Result := TdxGridBandedTableViewBottomItemPlace + else + Result := TdxGridBandedTableViewItemPlace; + {$ELSE} + Result := TdxGridBandedTableViewBottomItemPlace; + {$ENDIF} +end; + +procedure TdxGridBandedTableViewItemPlaceController.RefreshBottomItems; +var + I: Integer; +begin + FBottomItems.Count := Adapter.BottomBandCount; + for I := 0 to BottomItemCount - 1 do + FBottomItems[I] := ItemsByBand[Adapter.BottomBands[I]]; +end; + +procedure TdxGridBandedTableViewItemPlaceController.RefreshItems; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + Items[I].Refresh; +end; + +procedure TdxGridBandedTableViewItemPlaceController.RefreshRootItems; +var + I: Integer; +begin + FRootItems.Count := Adapter.RootBandCount; + for I := 0 to RootItemCount - 1 do + FRootItems[I] := ItemsByBand[Adapter.RootBands[I]]; +end; + +function TdxGridBandedTableViewItemPlaceController.GetAdapter: TdxGridBandedTableViewAdapter; +begin + Result := Formatter.Adapter; +end; + +function TdxGridBandedTableViewItemPlaceController.GetAutoWidth: Boolean; +begin + Result := Formatter.AutoWidth; +end; + +function TdxGridBandedTableViewItemPlaceController.GetAvailableWidth: Integer; +begin + Result := Formatter.ViewAvailableWidth; +end; + +function TdxGridBandedTableViewItemPlaceController.GetBottomItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; +begin + Result := TdxCustomGridBandedTableViewItemPlace(FBottomItems[Index]); +end; + +function TdxGridBandedTableViewItemPlaceController.GetBottomItemCount: Integer; +begin + Result := FBottomItems.Count; +end; + +function TdxGridBandedTableViewItemPlaceController.GetFormatter: TdxGridBandedTableViewFormatter; +begin + Result := inherited Formatter as TdxGridBandedTableViewFormatter; +end; + +function TdxGridBandedTableViewItemPlaceController.GetHeight: Integer; +begin + if FHeight = -1 then + FHeight := CalculateHeight; + Result := FHeight; +end; + +function TdxGridBandedTableViewItemPlaceController.GetItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; +begin + Result := TdxCustomGridBandedTableViewItemPlace(FItems[Index]); +end; + +function TdxGridBandedTableViewItemPlaceController.GetItemByBand(Band: TcxGridBand): TdxCustomGridBandedTableViewItemPlace; +var + Index: Integer; +begin + Index := IndexOf(Band); + if Index <> -1 then + Result := Items[IndexOf(Band)] + else + Result := nil; +end; + +function TdxGridBandedTableViewItemPlaceController.GetItemCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxGridBandedTableViewItemPlaceController.GetLevelCount: Integer; +begin + if FLevelCount = -1 then + FLevelCount := CalculateLevelCount; + Result := FLevelCount; +end; + +function TdxGridBandedTableViewItemPlaceController.GetLevelHeight(Index: Integer): Integer; +begin + Result := Integer(FLevelHeights[Index]); +end; + +function TdxGridBandedTableViewItemPlaceController.GetRootItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; +begin + Result := TdxCustomGridBandedTableViewItemPlace(FRootItems[Index]); +end; + +function TdxGridBandedTableViewItemPlaceController.GetRootItemCount: Integer; +begin + Result := FRootItems.Count; +end; + +procedure TdxGridBandedTableViewItemPlaceController.SetLevelHeight(Index: Integer; Value: Integer); +begin + FLevelHeights[Index] := TObject(Value); +end; + +procedure TdxGridBandedTableViewItemPlaceController.FreeAndNilItems; +begin + ClearItems; + FreeAndNil(FItems); +end; + +{ TdxGridBandedTableViewFormatter } + +constructor TdxGridBandedTableViewFormatter.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited; + FBands := TList.Create; +end; + +destructor TdxGridBandedTableViewFormatter.Destroy; +begin + FreeAndNil(FBands); + inherited; +end; + +function TdxGridBandedTableViewFormatter.Adapter: TdxGridBandedTableViewAdapter; +begin + Result := Builder.Adapter; +end; + +function TdxGridBandedTableViewFormatter.Builder: TdxGridBandedTableViewBuilder; +begin + Result := inherited Builder as TdxGridBandedTableViewBuilder; +end; + +procedure TdxGridBandedTableViewFormatter.DoInitializeBandItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +var + Band: TcxGridBand; +begin + Band := Bands[AnIndex]; + SetViewParams(AnItem, GetBandItemViewParams(Band)); + if HasBackgroundBitmap(bbBandHeader) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbBandHeader); + + RegisterLookAndFeelItem(AnItem, cesRaised); + + with AnItem as TdxReportCellString do + begin + Data := Integer(Band); + EndEllipsis := Adapter.BandEndEllipsis; + Multiline := Adapter.BandHeaderMultiline; + Text := Band.Caption; + TextAlignX := TextAlignXMap[Band.HeaderAlignmentHorz]; + TextAlignY := TextAlignYMap[Band.HeaderAlignmentVert]; + //Transparent := False; {!!! v3.03} + end; +end; + +procedure TdxGridBandedTableViewFormatter.DoInitializeBandRow(ARow: TdxReportCell); +begin + SetViewParams(ARow, GetBandItemViewParams(nil)); + ARow.Transparent := True; //??? +end; + +procedure TdxGridBandedTableViewFormatter.DoReportLinkInitializeBandItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +begin + ReportLink.DoInitializeBandCell(Adapter.GridView, Bands[AnIndex], TdxReportCellString(AnItem)); +end; + +function TdxGridBandedTableViewFormatter.GetBandItemBounds(AnIndex: Integer): TRect; +var + Item: TdxCustomGridBandedTableViewItemPlace; +begin + Item := ItemPlaceController.ItemsByBand[Bands[AnIndex]]; + if Item <> nil then + Result := Item.Bounds + else + Result := dxPSGlbl.NullRect; +end; + +function TdxGridBandedTableViewFormatter.GetBandItemClass(AnIndex: Integer): TdxReportCellTextClass; +begin + Result := TdxReportCellString; +end; + +function TdxGridBandedTableViewFormatter.GetBandItemViewParams(ABand: TcxGridBand): TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetBandHeaderParams(ABand, Result.NativeParams) + else + Result.NativeParams := Adapter.GetBandHeaderViewParams(ABand); + + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + if ABand <> nil then + begin + Result.NativeParams.Color := Adapter.ThemedBandHeaderItemColor; + Result.NativeParams.TextColor := Adapter.ThemedBandHeaderItemTextColor; + end; + + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := False; +end; + +procedure TdxGridBandedTableViewFormatter.AddHorizontalDelimiters; +var + Origin, I: Integer; + R: TRect; + Item: TdxCustomGridBandedTableViewItemPlace; +begin + if ReportLink.OptionsPagination.Band then + begin + Origin := ViewWidthExtraBefore; + for I := 0 to BandCount - 1 do + begin + Item := ItemPlaceController.ItemsByBand[Bands[I]]; + if Item <> nil then + begin + R := Item.Bounds; + ReportLink.AddHorizontalDelimiter(Origin + R.Left); + ReportLink.AddHorizontalDelimiter(Origin + R.Right); + end; + end; + end; + inherited; +end; + +{$IFDEF DXVER500} +function TdxGridBandedTableViewFormatter.CanColumnCellMerging(AColumn: TcxGridColumn): Boolean; +begin + Result := inherited CanColumnCellMerging(AColumn) and + (TcxGridBandedColumn(AColumn).Position.LineCount = ItemPlaceController.HeaderLineCount); +end; + +function TdxGridBandedTableViewFormatter.IsColumnActuallyVisible(AColumn: TcxGridColumn): Boolean; +begin + Result := inherited IsColumnActuallyVisible(AColumn) and + TcxGridBandedColumn(AColumn).Position.Band.ActuallyVisible; +end; +{$ENDIF} + +function TdxGridBandedTableViewFormatter.GetAlignSummaryWithColumns: Boolean; +begin + Result := inherited GetAlignSummaryWithColumns and HeadersSingleLine; +end; + +function TdxGridBandedTableViewFormatter.GetItemPlaceControllerClass: TdxCustomGridTableViewItemPlaceControllerClass; +begin + Result := TdxGridBandedTableViewItemPlaceController; +end; + +procedure TdxGridBandedTableViewFormatter.BuildBandList; +var + I: Integer; + Band: TcxGridBand; +begin + FBands.Clear; + for I := 0 to Adapter.BandCount - 1 do + begin + Band := Adapter.Bands[I]; + if IsBandActuallyVisible(Band) then FBands.Add(Band); + end; +end; + +procedure TdxGridBandedTableViewFormatter.BuildItemLists; +var + I: Integer; +begin + BuildBandList; + inherited; + FHeadersSingleLine := True; + for I := 0 to ColumnCount - 1 do + begin + FHeadersSingleLine := FHeadersSingleLine and + (Columns[I].Position.RowIndex = 0); + end; +end; + +function TdxGridBandedTableViewFormatter.IsBandActuallyVisible(ABand: TcxGridBand): Boolean; +begin + {$IFDEF DXVER500} + Result := ABand.ActuallyVisible; + {$ELSE} + Result := True; + {$ENDIF} +end; + +function TdxGridBandedTableViewFormatter.MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; +begin + case AGridBackgroundBitmapIndex of + bbBandHeader: + Result := vspsGridBandHeader; + else + Result := 0; + end; + + if Result = 0 then + Result := inherited MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex); +end; + +function TdxGridBandedTableViewFormatter.GetBand(Index: Integer): TcxGridBand; +begin + Result := TcxGridBand(FBands[Index]); +end; + +function TdxGridBandedTableViewFormatter.GetBandCount: Integer; +begin + Result := FBands.Count; +end; + +function TdxGridBandedTableViewFormatter.GetColumn(Index: Integer): TcxGridBandedColumn; +begin + Result := inherited Columns[Index] as TcxGridBandedColumn; +end; + +function TdxGridBandedTableViewFormatter.GetItemPlaceController: TdxGridBandedTableViewItemPlaceController; +begin + Result := inherited ItemPlaceController as TdxGridBandedTableViewItemPlaceController; +end; + +function TdxGridBandedTableViewFormatter.GetShowBandHeaders: Boolean; +begin + Result := ReportLink.OptionsView.BandHeaders; +end; + +{ TdxGridBandedTableViewBuilder } + +function TdxGridBandedTableViewBuilder.Adapter: TdxGridBandedTableViewAdapter; +begin + Result := inherited Adapter as TdxGridBandedTableViewAdapter; +end; + +class function TdxGridBandedTableViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxGridBandedTableViewAdapter; +end; + +function TdxGridBandedTableViewBuilder.Formatter: TdxGridBandedTableViewFormatter; +begin + Result := inherited Formatter as TdxGridBandedTableViewFormatter; +end; + +class function TdxGridBandedTableViewBuilder.FormatterClass: TdxGridViewFormatterClass; +begin + Result := TdxGridBandedTableViewFormatter; +end; + +procedure TdxGridBandedTableViewBuilder.DoBuildViewBody; +begin + if Formatter.ShowBandHeaders then CreateBands; + if Formatter.ShowHeaders then CreateHeader; + CreateRows; + if Formatter.ShowFooters then CreateFooter; +end; + +procedure TdxGridBandedTableViewBuilder.CreateBands; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetBandsProducer.Produce(HostInfoServices.BandHeadersHostInfo); + AddReportRow(ReportRow); +end; + +function TdxGridBandedTableViewBuilder.GetBandsProducer: TdxGridTableViewBandsProducer; +begin + Result := ProducerCache[GetBandsProducerClass] as TdxGridTableViewBandsProducer; +end; + +function TdxGridBandedTableViewBuilder.GetBandsProducerClass: TdxGridTableViewBandsProducerClass; +begin + Result := TdxGridTableViewBandsProducer; +end; + +function TdxGridBandedTableViewBuilder.GridView: TcxGridBandedTableView; +begin + Result := inherited GridView as TcxGridBandedTableView; +end; + +class function TdxGridBandedTableViewBuilder.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridBandedTableView; +end; + +{ TdxGridDBBandedTableViewAdapter } + +function TdxGridDBBandedTableViewAdapter.GridView: TcxGridDBBandedTableView; +begin + Result := inherited GridView as TcxGridDBBandedTableView; +end; + +class function TdxGridDBBandedTableViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridDBBandedTableView; +end; + +procedure TdxGridDBBandedTableViewAdapter.AfterBuilding; +begin + UnloadAllRecords; + inherited; +end; + +procedure TdxGridDBBandedTableViewAdapter.BeforeBuilding; +begin + inherited; + LoadAllRecords; +end; + +function TdxGridDBBandedTableViewAdapter.DataController: TcxGridDBDataController; +begin + Result := TcxGridDBDataController(inherited DataController); +end; + +function TdxGridDBBandedTableViewAdapter.DBDataModeController: TcxDBDataModeController; +begin + Result := DataController.DataModeController; +end; + +procedure TdxGridDBBandedTableViewAdapter.LoadAllRecords; +begin + _LoadAllRecords(DBDataModeController, FPrevAllRecordsAreLoaded); +end; + +procedure TdxGridDBBandedTableViewAdapter.UnloadAllRecords; +begin + _UnloadAllRecords(DBDataModeController, FPrevAllRecordsAreLoaded); +end; + +{ TdxGridDBBandedTableViewBuilder } + +function TdxGridDBBandedTableViewBuilder.Adapter: TdxGridDBBandedTableViewAdapter; +begin + Result := inherited Adapter as TdxGridDBBandedTableViewAdapter; +end; + +class function TdxGridDBBandedTableViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxGridDBBandedTableViewAdapter; +end; + +{ TdxGridCardViewAdapter } + +function TdxGridCardViewAdapter.GridView: TcxGridCardView; +begin + Result := inherited GridView as TcxGridCardView; +end; + +class function TdxGridCardViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridCardView; +end; + +function TdxGridCardViewAdapter.Styles: TcxGridCardViewStyles; +begin + Result := inherited Styles as TcxGridCardViewStyles; +end; + +procedure TdxGridCardViewAdapter.GetVisibleCardRows(ACard: TcxGridCard; AList: TList); +{$IFNDEF DXVER500} +var + I: Integer; +{$ENDIF} +begin + {$IFDEF DXVER500} + ACard.GetVisibleRows(AList); + {$ELSE} + for I := 0 to CardRowCount - 1 do + AList.Add(CardRows[I]); + {$ENDIF} +end; + +procedure TdxGridCardViewAdapter.ExpandAllRows(AnOptionsExpanding: TdxGridReportLinkOptionsExpanding; + ARecursive: Boolean); +begin + {$IFDEF DXVER500} + if AnOptionsExpanding.ExpandCards then GridView.ViewData.Expand(True); + {$ENDIF} +end; + +function TdxGridCardViewAdapter.IsFirstRow(ACardRow: TcxGridCardViewRow): Boolean; +begin + Result := ACardRow.VisibleIndex = 0; +end; + +function TdxGridCardViewAdapter.IsLastRow(ACardRow: TcxGridCardViewRow): Boolean; +begin + Result := ACardRow.VisibleIndex = CardRowCount - 1; +end; + +function TdxGridCardViewAdapter.GetAreAllMasterRowsCollapsed: Boolean; +begin + Result := True; +end; + +function TdxGridCardViewAdapter.GetCaptionRowViewParams(ARecord: TcxCustomGridRecord; + ACardRow: TcxGridCardViewRow): TcxViewParams; +begin + if (ACardRow <> nil) and (ACardRow.Styles.CaptionRow <> nil) then + ACardRow.Styles.GetCaptionRowParams(ARecord, Result) + else + Styles.GetCaptionRowParams(ARecord, ACardRow, Result); +end; + +function TdxGridCardViewAdapter.GetCardViewParams(ARecord: TcxCustomGridRecord): TcxViewParams; +begin + Styles.GetContentParams(ARecord, nil, Result); +end; + +function TdxGridCardViewAdapter.GetContentViewParams(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem; AIsDataCell: Boolean = False): TcxViewParams; +begin + if (TcxGridCardViewRow(ATableItem).Kind = rkData) or AIsDataCell then + Result := inherited GetContentViewParams(ARecord, ATableItem) + else + Result := GetCaptionRowViewParams(ARecord, TcxGridCardViewRow(ATableItem)); +end; + +function TdxGridCardViewAdapter.GetRowCaptionViewParams(ARecord: TcxCustomGridRecord; + ACardRow: TcxGridCardViewRow): TcxViewParams; +begin + if (ACardRow <> nil) and (ACardRow.Kind = rkData) then + if ACardRow.Styles.Caption <> nil then + ACardRow.Styles.GetCaptionParams(ARecord, Result) + else + Styles.GetRowCaptionParams(ARecord, ACardRow, Result) + else + Result := GetCaptionRowViewParams(ARecord, ACardRow); +end; + +function TdxGridCardViewAdapter.GetCaptionSeparator: string; +begin + Result := GridView.OptionsView.CaptionSeparator; +end; + +function TdxGridCardViewAdapter.GetCard(Index: Integer): TcxGridCard; +begin + Result := Records[Index] as TcxGridCard; +end; + +function TdxGridCardViewAdapter.GetCardAutoWidth: Boolean; +begin + Result := GridView.OptionsView.CardAutoWidth; +end; + +function TdxGridCardViewAdapter.GetCardCount: Integer; +begin + Result := RecordCount; +end; + +function TdxGridCardViewAdapter.GetCardCaptionWidth: Integer; +begin + Result := GridView.OptionsView.CaptionWidth; +end; + +function TdxGridCardViewAdapter.GetCardRow(Index: Integer): TcxGridCardViewRow; +begin + Result := GridView.VisibleRows[Index]; +end; + +function TdxGridCardViewAdapter.GetCardRowCount: Integer; +begin + Result := GridView.VisibleRowCount; +end; + +function TdxGridCardViewAdapter.GetCardSeparatorColor: Integer; +begin + Result := GridView.OptionsView.SeparatorColor; +end; + +function TdxGridCardViewAdapter.GetCardSeparatorThickness: Integer; +begin + Result := GridView.OptionsView.SeparatorWidth; +end; + +function TdxGridCardViewAdapter.GetCardWidth: Integer; +begin + Result := GridView.OptionsView.CardWidth; +end; + +function TdxGridCardViewAdapter.GetHasCardsSeparator: Boolean; +begin + Result := CardSeparatorThickness <> 0; +end; + +function TdxGridCardViewAdapter.GetHasIndent(Index: Integer): Boolean; +begin + with CardRows[Index] do + Result := HasExpandButton or (CategoryRow <> nil); +end; + +function TdxGridCardViewAdapter.GetRowAutoHeight: Boolean; +begin + with GridView.OptionsView do + Result := CellAutoHeight or RowCaptionAutoHeight; +end; + +function TdxGridCardViewAdapter.GetRowCaptionAutoHeight: Boolean; +begin + Result := GridView.OptionsView.RowCaptionAutoHeight; +end; + +function TdxGridCardViewAdapter.GetRowCaptionEndEllipsis: Boolean; +begin + Result := GridView.OptionsView.RowCaptionEndEllipsis; +end; + +function TdxGridCardViewAdapter.GetShowRowCaption(Index: Integer): Boolean; +begin + Result := CardRows[Index].Options.ShowCaption; +end; + +function TdxGridCardViewAdapter.GetShowRowData(Index: Integer): Boolean; +begin + Result := CardRows[Index].Options.ShowData; +end; + +{ TdxGridCardViewFormatter } + +function TdxGridCardViewFormatter.Adapter: TdxGridCardViewAdapter; +begin + Result := Builder.Adapter; +end; + +function TdxGridCardViewFormatter.Builder: TdxGridCardViewBuilder; +begin + Result := inherited Builder as TdxGridCardViewBuilder; +end; + +procedure TdxGridCardViewFormatter.DoInitializeCard(ACard: TdxReportCard; + AGridCard: TcxGridCard); +begin + with ReportLink.OptionsCards.Shadow do + begin + ACard.ShadowColor := ActualColor; + ACard.ShadowDepth := Depth; + ACard.ShadowPosition := Position; + end; + + SetViewParams(ACard, GetCardViewParams(AGridCard)); + + ACard.Data := Integer(AGridCard); + ACard.Width := Adapter.CardWidth; + ACard.CreateLayers(Builder); +end; + +procedure TdxGridCardViewFormatter.DoInitializeCardsRow(ACard: TdxReportCell); +begin + if HasBackgroundBitmap(bbBackground) then + ACard.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbBackground); + ACard.CellSides := []; +end; + +function TdxGridCardViewFormatter.GetCardClass(AGridCard: TcxGridCard): TdxReportCardClass; +begin + if IsHorizontalLayout(AGridCard) then + Result := TdxReportCardHorz + else + Result := TdxReportCardVert; +// Result := TdxReportCardHorz; +end; + +function TdxGridCardViewFormatter.GetCardViewParams(ARecord: TcxCustomGridRecord): TdxReportItemViewParams; +begin + Result.NativeParams := Adapter.GetCardViewParams(ARecord); + Result.CellSides := csAll;//[]; // because of Card Shadow + Result.FontStyle := []; + Result.Transparent := True; +end; + +procedure TdxGridCardViewFormatter.DoInitializeCardRowIndent( + AnItem: TdxReportCellExpandButton; ACardRow: TcxGridCardViewRow; AGridCard: TcxGridCard); +const + BackgroundBitmapIndexes: array[TcxGridCardViewRowKind] of Integer = + (bbRowCaption, bbCaptionRow, bbCaptionRow); +begin + if ACardRow.CategoryRow <> nil then + ACardRow := ACardRow.CategoryRow; + SetViewParams(AnItem, GetCardRowCaptionViewParams(AGridCard, ACardRow)); + if HasBackgroundBitmap(BackgroundBitmapIndexes[ACardRow.Kind]) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(BackgroundBitmapIndexes[ACardRow.Kind]); +end; + +procedure TdxGridCardViewFormatter.DoInitializeCardRowCaption(AnItem: TdxReportCellText; + ACardRow: TcxGridCardViewRow; AGridCard: TcxGridCard); +const + BackgroundBitmapIndexes: array[TcxGridCardViewRowKind] of Integer = + (bbRowCaption, bbCaptionRow, bbCaptionRow); +begin + SetViewParams(AnItem, GetCardRowCaptionViewParams(AGridCard, ACardRow)); + if HasBackgroundBitmap(BackgroundBitmapIndexes[ACardRow.Kind]) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(BackgroundBitmapIndexes[ACardRow.Kind]); + + with AnItem as TdxReportCellString do + begin + EndEllipsis := Adapter.RowCaptionEndEllipsis; + Multiline := {True; //}not EndEllipsis and not CaptionAutoWidth and Adapter.RowCaptionAutoHeight; + TextAlignX := TextAlignXMap[ACardRow.CaptionAlignmentHorz]; + if Multiline then + TextAlignY := TextAlignYMap[ACardRow.CaptionAlignmentVert] + else + TextAlignY := taTop; + end; + AnItem.Text := ACardRow.Caption + Adapter.CaptionSeparator; +end; + +procedure TdxGridCardViewFormatter.DoReportLinkInitializeCardRowCaption(AnItem: TdxReportCellText; + ACardRow: TcxGridCardViewRow; AGridCard: TcxGridCard); +begin + ReportLink.DoInitializeCardRowCaptionCell(Adapter.GridView, AGridCard, ACardRow, TdxReportCellString(AnItem)); +end; + +function TdxGridCardViewFormatter.GetCardRowCaptionClass(ACardRow: TcxGridCardViewRow): TdxReportCellTextClass; +begin + Result := TdxReportCellString; +end; + +function TdxGridCardViewFormatter.GetCardRowCaptionViewParams(ARecord: TcxCustomGridRecord; + ACardRow: TcxGridCardViewRow): TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + if ACardRow.Kind = rkData then + ReportLink.Styles.GetCardRowCaptionParams(ARecord, ACardRow, Result.NativeParams) + else + if CanProcessSelectionStyle(ARecord) then + ReportLink.Styles.GetSelectionParams(Result.NativeParams) + else + ReportLink.Styles.GetCardCaptionRowParams(ARecord, ACardRow, Result.NativeParams) + else + if (ACardRow.Kind = rkCaption) and CanProcessSelectionStyle(ARecord) then + Result.NativeParams := Adapter.GetSelectionViewParams + else + Result.NativeParams := Adapter.GetRowCaptionViewParams(ARecord, ACardRow); + + // v.3.1 - because of fact that each Card in Grid v.5 might has different number of Rows, + // CellSides initialization was moved inside ReportCard + Result.CellSides := []; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); // ReportLink.FixedTransparent +end; + +procedure TdxGridCardViewFormatter.DoReportLinkInitializeCardRowData(AnItem: TAbstractdxReportCellData; + ACardRow: TcxGridCardViewRow; AGridCard: TcxGridCard); +begin + ReportLink.DoInitializeCardRowDataCell(Adapter.GridView, AGridCard, ACardRow, TdxReportCellString(AnItem)); +end; + +function TdxGridCardViewFormatter.GetItemViewParams(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False; AIsDataCell: Boolean = False): TdxReportItemViewParams; +var + CardRow: TcxGridCardViewRow; +begin + CardRow := TcxGridCardViewRow(ATableItem); + AIsDataCell := AIsDataCell and (CardRow.Kind <> rkCaption); + if ReportLink.OptionsFormatting.UseNativeStyles then + if (CardRow.Kind = rkData) or AIsDataCell then + ReportLink.Styles.GetContentParams(ARecord, CardRow, Result.NativeParams) + else + if CanProcessSelectionStyle(ARecord) then + ReportLink.Styles.GetSelectionParams(Result.NativeParams) + else + ReportLink.Styles.GetCardCaptionRowParams(ARecord, CardRow, Result.NativeParams) + else + if (CardRow.Kind = rkData) or AIsDataCell then + Result := inherited GetItemViewParams(ATableItem, ARecord, AnIsPreview, AIsDataCell) + else + if CanProcessSelectionStyle(ARecord) then + Result.NativeParams := Adapter.GetSelectionViewParams + else + Result.NativeParams := Adapter.GetCaptionRowViewParams(ARecord, CardRow); + + // v.3.1 - because fact that each Card in Grid v.5 might has different number of Rows, + // CellSides initialization was moved inside ReportCard + Result.CellSides := []; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); // ReportLink.FixedTransparent +end; + +procedure TdxGridCardViewFormatter.AddHorizontalDelimiters; +var + I: Integer; +begin + for I := 0 to Builder.CardCount - 1 do + ReportLink.AddHorizontalDelimiter(Builder.Cards[I].AbsoluteRect.Right); +end; + +procedure TdxGridCardViewFormatter.AddVerticalDelimiters; +var + I: Integer; +begin + if NeedDelimitByRows then + begin + for I := 0 to Builder.CardCount - 1 do + Builder.Cards[I].AddVerticalDelimiters; + end + else + inherited; +end; + +function TdxGridCardViewFormatter.GetViewWidth: Integer; +var + MasterBuilder: TdxCustomGridViewBuilder; +begin + MasterBuilder := Builder.MasterBuilder; + if MasterBuilder <> nil then + begin + Result := MasterBuilder.Formatter.ViewWidth - MasterBuilder.Adapter.ViewWidthExtra; + if HasDetailsSeparator then + Dec(Result, 2 * DetailsSeparatorThickness); + end + else + begin + Result := SiteWidth; + if HasDetailsSeparator then + Dec(Result, 2 * DetailsSeparatorThickness); + if Result < Builder.MaxCardWidth + FirstCardOffset then + Result := Builder.MaxCardWidth + FirstCardOffset; + end; +end; + +function TdxGridCardViewFormatter.IsHorizontalLayout(AGridCard: TcxGridCard): Boolean; +begin + Result := AGridCard.GridView.RowLayout = rlHorizontal; +end; + +function TdxGridCardViewFormatter.MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; +begin + case AGridBackgroundBitmapIndex of + bbCaptionRow: + Result := vspsGridCardCaptionRow; + bbRowCaption: + Result := vspsGridCardRowCaption; + else + Result := 0; + end; + if Result = 0 then + Result := inherited MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex); +end; + +function TdxGridCardViewFormatter.GetContentBackgroundBitmapStyleIndex(ATableItem: TcxCustomGridTableItem): Integer; +const + BackgroundBitmapIndexes: array[TcxGridCardViewRowKind] of Integer = + (bbContent, bbCaptionRow, bbCaptionRow); +begin + Result := BackgroundBitmapIndexes[TcxGridCardViewRow(ATableItem).Kind]; +end; + +function TdxGridCardViewFormatter.NeedDelimitByRows: Boolean; +{var + I: Integer;} +begin + Result := False; + {if MasterBuilder = nil then + for I := 0 to Builder.CardCount - 1 do + if Builder.Cards[I].Height > SiteHeight then + begin + Result := True; + Exit; + end;} +end; + +function TdxGridCardViewFormatter.GetAutoWidth: Boolean; +begin + Result := ReportLink.OptionsCards.AutoWidth; +end; + +function TdxGridCardViewFormatter.GetCaptionAutoWidth: Boolean; +begin + Result := Adapter.CardCaptionWidth = 0; +end; + +function TdxGridCardViewFormatter.GetCardAutoWidth: Boolean; +begin + Result := Adapter.CardAutoWidth or ReportLink.OptionsSize.AutoWidth; +end; + +function TdxGridCardViewFormatter.GetCard(Index: Integer): TcxGridCard; +begin + Result := TcxGridCard(Records[Index]); +end; + +function TdxGridCardViewFormatter.GetCardCount: Integer; +begin + Result := RecordCount; +end; + +function TdxGridCardViewFormatter.GetCardsAreaWidth: Integer; +begin + Result := ViewWidth - FirstCardOffset; +end; + +function TdxGridCardViewFormatter.GetInterCardsSpaceHorz: Integer; +begin + Result := ReportLink.OptionsCards.InterCardsSpaceHorz; +end; + +function TdxGridCardViewFormatter.GetInterCardsSpaceVert: Integer; +begin + Result := ReportLink.OptionsCards.InterCardsSpaceVert; +end; + +function TdxGridCardViewFormatter.GetKeepSameHeight: Boolean; +begin + Result := ReportLink.OptionsCards.KeepSameHeight; +end; + +function TdxGridCardViewFormatter.GetKeepSameWidth: Boolean; +begin + Result := ReportLink.OptionsCards.KeepSameWidth; +end; + +function TdxGridCardViewFormatter.GetRowAutoHeight: Boolean; +begin + Result := Adapter.RowAutoHeight; +end; + +{ TdxReportCardLayer } + +constructor TdxReportCardLayer.CreateEx( + AParent: TdxReportCell; ABeginsLayerRow: TcxGridCardViewRow); +begin + inherited Create(AParent); + FRows := TList.Create; + CellSides := []; + Data := Integer(ABeginsLayerRow); + Width := Card.LayerWidths[Index]; +// Height := Card.ContentHeight; + AddRow(ABeginsLayerRow); +end; + +destructor TdxReportCardLayer.Destroy; +begin + FreeAndNil(FRows); + inherited Destroy; +end; + +procedure TdxReportCardLayer.AdjustCellSides; +var + I: Integer; + ReportLink: TdxGridReportLink; +begin + ReportLink := Card.ReportLink; + for I := 0 to RowCount - 1 do + begin + Rows[I].AdjustCellSides(IsFirstItem, IsLastItem and + not (NeedCategorySeparator or NeedLayerSeparator), I = 0, I = RowCount - 1); + if Rows[I].Left + Rows[I].Width > Width then + Rows[I].Width := Width - Rows[I].Left; + end; + if ReportLink.OptionsCards.Borders then + begin + if LayerSeparator <> nil then + begin + LayerSeparator.CellSides := [csLeft, csRight]; + if IsLastItem and not NeedCategorySeparator then + LayerSeparator.CellSides := LayerSeparator.CellSides + [csBottom]; + end; + if CategorySeparator <> nil then + begin + CategorySeparator.CellSides := [csLeft, csRight]; + if IsLastItem then + CategorySeparator.CellSides := CategorySeparator.CellSides + [csBottom]; + end; + end; +end; + +function TdxReportCardLayer.AddRow( + AGridCardRow: TcxGridCardViewRow): TdxReportCardRow; +begin + Result := TdxReportCardRow.CreateEx(Self, AGridCardRow); + FRows.Add(Result); +end; + +function TdxReportCardLayer.MeasureCaptionWidth(DC: HDC): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Min(0, RowCount - 1) do + Result := Max(Result, Rows[I].MeasureCaptionWidth(DC)); +end; + +function TdxReportCardLayer.MeasureDataWidth(DC: HDC): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to RowCount - 1 do + Result := Max(Result, Rows[I].MeasureDataWidth(DC)); +end; + +function TdxReportCardLayer.MeasureLayerHeight(DC: HDC; ACalculateLineHeight: Boolean; + ABuilder: TdxGridCardViewBuilder): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to RowCount - 1 do + Result := Max(Result, Rows[I].MeasureHeight(DC, ACalculateLineHeight, ABuilder)); + if LayerSeparator <> nil then + Inc(Result, LayerSeparator.Height); + if CategorySeparator <> nil then + Inc(Result, CategorySeparator.Height); +end; + +function TdxReportCardLayer.MeasureWidth(DC: HDC): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to RowCount - 1 do + Inc(Result, Rows[I].MeasureWidth(DC)); +end; + +procedure TdxReportCardLayer.AdjustRowsHeight; +var + I, H: Integer; +begin + H := Height; + if LayerSeparator <> nil then + Dec(H, LayerSeparator.Height); + if CategorySeparator <> nil then + Dec(H, CategorySeparator.Height); + for I := 0 to RowCount - 1 do + Rows[I].Height := H; +end; + +procedure TdxReportCardLayer.AdjustRowHeight( + DC: HDC; AAutoHeight: Boolean; ABuilder: TdxGridCardViewBuilder); +var + I, ARowHeight, ATotalHeight: Integer; +begin + ATotalHeight := 0; + for I := 0 to RowCount - 1 do + begin + ARowHeight := Rows[I].MeasureHeight(DC, not AAutoHeight, ABuilder); + SetRowHeight(I, ARowHeight); + Inc(ATotalHeight, ARowHeight); + end; + InternalHeight := ATotalHeight; +end; + +function TdxReportCardLayer.CanHaveIndent(ARow: TdxReportCardRow): Boolean; +begin + Result := ARow.GridCardRow.Position.VisibleColIndex = 0; +end; + +procedure TdxReportCardLayer.CheckNeedCategorySeparator(ANextLayer: TdxReportCardLayer); +var + I: Integer; +begin + FNeedCategorySeparator := ANextLayer.BeginsLayerRow.HasExpandButton; + if FNeedCategorySeparator then + begin + FNeedCategorySeparator := False; + for I := 0 to RowCount - 1 do + with Rows[I].GridCardRow do + FNeedCategorySeparator := FNeedCategorySeparator or (HasExpandButton or (CategoryRow <> nil)); + end; +end; + +procedure TdxReportCardLayer.CreateItems(ABuilder: TdxGridCardViewBuilder); +var + I: Integer; +begin + for I := 0 to RowCount - 1 do + Rows[I].CreateItems(ABuilder); + if NeedCategorySeparator then + CreateCategorySeparator; + if NeedLayerSeparator then + CreateLayerSeparator; +end; + +procedure TdxReportCardLayer.CreateCategorySeparator; +var + AParams: TcxViewParams; + ACardView: TcxGridCardView; +begin + FCategorySeparator := TdxReportCellBox.Create(Self); + ACardView := TcxGridCardView(BeginsLayerRow.GridView); + ACardView.Styles.GetViewParams(vsCategorySeparator, nil, nil, AParams); + FCategorySeparator.BoundsRect := MakeRect(0, 0, Width, + ACardView.OptionsView.CategorySeparatorWidth); + FCategorySeparator.Color := AParams.Color; + FCategorySeparator.CellSides := []; + FCategorySeparator.Transparent := False; +end; + +procedure TdxReportCardLayer.CreateLayerSeparator; +var + AParams: TcxViewParams; + ACardView: TcxGridCardView; +begin + FLayerSeparator := TdxReportCellBox(AddDataItem(TdxReportCellBox)); + ACardView := TcxGridCardView(BeginsLayerRow.GridView); + FLayerSeparator.BoundsRect := MakeRect(0, 0, Width, + ACardView.OptionsView.LayerSeparatorWidth); + ACardView.Styles.GetViewParams(vsLayerSeparator, nil, nil, AParams); + FLayerSeparator.Transparent := False; + FLayerSeparator.CellSides := []; + FLayerSeparator.Color := AParams.Color; +end; + +procedure TdxReportCardLayer.InitAutoWidthItem( + AnItem: TcxAutoWidthItem; var AAllFixed: Boolean); +var + I, AWidth: Integer; +const + LayerDefaultWidth = 20; +begin + AWidth := 0; + for I := 0 to RowCount - 1 do + AWidth := Max(AWidth, Rows[I].GridCardRow.Position.Width); + AnItem.Width := AWidth; + AnItem.Fixed := AnItem.Width <> 0; + AAllFixed := AAllFixed and AnItem.Fixed; + if AnItem.Width = 0 then + AnItem.Width := LayerDefaultWidth; +end; + +procedure TdxReportCardLayer.PlaceSeparatorAndExcludeHeightFromHeight( + var AValue: Integer); +begin + if LayerSeparator <> nil then + begin + Dec(AValue, LayerSeparator.Height); + LayerSeparator.Top := AValue; + end; +end; + +procedure TdxReportCardLayer.RecalculateHeight; +var + AHeight, I: Integer; +begin + AHeight := 0; + for I := 0 to RowCount - 1 do + AHeight := Max(AHeight, Rows[I].Height); + if LayerSeparator <> nil then + Inc(AHeight, LayerSeparator.Height); + if CategorySeparator <> nil then + Inc(AHeight, CategorySeparator.Height); + Height := AHeight; +end; + +procedure TdxReportCardLayer.ResizeRowsHorz; +var + ALeft, I: Integer; + AAllFixed: Boolean; + AAutoWidths: TcxAutoWidthObject; + AItem: TcxAutoWidthItem; +const + CardRowDefaultWidth = 20; +begin + if RowCount = 0 then Exit; + if RowCount = 1 then + Rows[0].Width := Width + else + begin + AAutoWidths := TcxAutoWidthObject.Create(RowCount); + try + AAllFixed := True; + for I := 0 to RowCount - 1 do + begin + AItem := AAutoWidths.AddItem; + AItem.Width := Rows[I].GridCardRow.Position.Width; + AItem.Fixed := AItem.Width <> 0; + AAllFixed := AAllFixed and AItem.Fixed; + if AItem.Width = 0 then + AItem.Width := CardRowDefaultWidth; + end; + if AAllFixed or (AAutoWidths.Width > Width) then + for I := 0 to AAutoWidths.Count - 1 do + AAutoWidths[I].Fixed := False; + AAutoWidths.AvailableWidth := Width; + AAutoWidths.Calculate; + ALeft := 0; + for I := 0 to RowCount - 1 do + begin + Rows[I].Left := ALeft; + Rows[I].Width := AAutoWidths[I].AutoWidth; + Inc(ALeft, Rows[I].Width); + end; + finally + AAutoWidths.Free; + end; + end; +end; + +function TdxReportCardLayer.SetPosition(ALeft, AWidth: Integer): Integer; +begin + Left := ALeft; + Width := AWidth; + Result := Left + Width; +end; + +procedure TdxReportCardLayer.SetRowCaptionWidth( + DC: HDC; ACaptionAutoWidths: Boolean; AValue: Integer); +var + I: Integer; +begin + if ACaptionAutoWidths then + begin + for I := 0 to Min(0, RowCount - 1) do + Rows[I].RowCaptionWidth := AValue; + for I := 1 to RowCount - 1 do + Rows[I].RowCaptionWidth := Rows[I].MeasureCaptionWidth(DC); + end + else + for I := 0 to RowCount - 1 do + Rows[I].RowCaptionWidth := AValue; +end; + +procedure TdxReportCardLayer.SetRowHeight(ARowIndex, AValue: Integer); +var + Delta, I: Integer; +begin + if AValue < 0 then AValue := 0; + + Delta := AValue - Rows[ARowIndex].Height; + Rows[ARowIndex].Height := AValue; + + for I := ARowIndex + 1 to RowCount - 1 do + Rows[I].Top := Rows[I].Top + Delta; +end; + +procedure TdxReportCardLayer.SizeChanged; +begin + if LayerSeparator <> nil then + LayerSeparator.Width := Width; + if CategorySeparator <> nil then + CategorySeparator.Width := Width; + ResizeRowsHorz; +end; + +function TdxReportCardLayer.GetBeginsLayerRow: TcxGridCardViewRow; +begin + Result := TcxGridCardViewRow(Data); +end; + +function TdxReportCardLayer.GetCard: TdxReportCardHorz; +begin + Result := TdxReportCardHorz(Parent); +end; + +function TdxReportCardLayer.GetHeight: Integer; +begin + Result := inherited Height; +end; + +function TdxReportCardLayer.GetInternalHeight: Integer; +begin + Result := inherited Height; +end; + +function TdxReportCardLayer.GetInternalWidth: Integer; +begin + Result := inherited Width; +end; + +function TdxReportCardLayer.GetRow(AIndex: Integer): TdxReportCardRow; +begin + Result := TdxReportCardRow(FRows[AIndex]); +end; + +function TdxReportCardLayer.GetRowCount: Integer; +begin + Result := FRows.Count; +end; + +function TdxReportCardLayer.GetWidth: Integer; +begin + Result := inherited Width; +end; + +procedure TdxReportCardLayer.SetHeight(AValue: Integer); +begin + inherited Height := AValue; + if AValue = 0 then Exit; + if CategorySeparator <> nil then + begin + FCategorySeparator.Top := AValue - FCategorySeparator.Height; + Dec(AValue, FCategorySeparator.Height); + end; + PlaceSeparatorAndExcludeHeightFromHeight(AValue); + AdjustRowsHeight; +end; + +procedure TdxReportCardLayer.SetInternalHeight(AValue: Integer); +begin + inherited Height := AValue; +end; + +procedure TdxReportCardLayer.SetInternalWidth(AValue: Integer); +begin + inherited Width := AValue; +end; + +procedure TdxReportCardLayer.SetWidth(AValue: Integer); +begin + inherited Width := AValue; + SizeChanged; +end; + +{ TdxReportCardVerticalLayer } + +procedure TdxReportCardVerticalLayer.AdjustCellSides; +var + I: Integer; +begin + for I := 0 to RowCount - 1 do + Rows[I].AdjustCellSides(I = 0, False, Index = 0, Index = Card.LayerCount - 1); + if (LayerSeparator <> nil) and Card.ReportLink.OptionsCards.RowBordersVert then + LayerSeparator.CellSides := LayerSeparator.CellSides + [csLeft, csRight]; +end; + +function TdxReportCardVerticalLayer.MeasureCaptionWidth(DC: HDC): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to RowCount - 1 do + Result := Max(Result, Rows[I].MeasureCaptionWidth(DC)); +end; + +function TdxReportCardVerticalLayer.MeasureWidth(DC: HDC): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to RowCount - 1 do + Result := Max(Result, Rows[I].MeasureWidth(DC)); + if LayerSeparator <> nil then + Inc(Result, LayerSeparator.Width); +end; + +procedure TdxReportCardVerticalLayer.AdjustRowsHeight; +begin +end; + +function TdxReportCardVerticalLayer.CanHaveIndent(ARow: TdxReportCardRow): Boolean; +begin + Result := True; +end; + +procedure TdxReportCardVerticalLayer.CreateLayerSeparator; +begin + inherited CreateLayerSeparator; + LayerSeparator.Width := LayerSeparator.Height; +end; + +procedure TdxReportCardVerticalLayer.CheckNeedCategorySeparator( + ANextLayer: TdxReportCardLayer); +var + I: Integer; +begin + for I := 0 to RowCount - 1 do + begin + if Rows[I].GridCardRow.HasExpandButton and (I > 0) then + Rows[I - 1].NeedSeparator := True; + end; +end; + +procedure TdxReportCardVerticalLayer.PlaceSeparatorAndExcludeHeightFromHeight( + var AValue: Integer); +begin +end; + +procedure TdxReportCardVerticalLayer.RecalculateHeight; +var + I, AHeight: Integer; +begin + AHeight := 0; + for I := 0 to RowCount - 1 do + Inc(AHeight, Rows[I].Height); + Height := AHeight; +end; + +procedure TdxReportCardVerticalLayer.SetRowCaptionWidth( + DC: HDC; ACaptionAutoWidths: Boolean; AValue: Integer); +var + I: Integer; +begin + if ACaptionAutoWidths then + for I := 0 to RowCount - 1 do + Rows[I].RowCaptionWidth := AValue + else + for I := 0 to RowCount - 1 do + Rows[I].RowCaptionWidth := AValue; +end; + +procedure TdxReportCardVerticalLayer.SizeChanged; +var + I, AWidth: Integer; +begin + AWidth := Width; + if LayerSeparator <> nil then + begin + Dec(AWidth, LayerSeparator.Width); + LayerSeparator.Height := Card.ContentHeight; + end; + for I := 0 to RowCount - 1 do + begin + Rows[I].Width := AWidth; + if LayerSeparator <> nil then + Rows[I].Left := LayerSeparator.Width; + end; +end; + +{ TdxReportCardRow } + +constructor TdxReportCardRow.CreateEx(AParent: TdxReportCell; AGridCardRow: TcxGridCardViewRow); +begin + inherited Create(AParent); + CellSides := []; + Data := Integer(AGridCardRow); + Width := Card.ContentWidth; +end; + +function TdxReportCardRow.MeasureHeight(DC: HDC; ACalculateLineHeight: Boolean; + ABuilder: TdxGridCardViewBuilder): Integer; + + function MeasureCaptionHeight: Integer; + begin + Result := DefaultDataRowLineHeight; + if HasCaption then + if ACalculateLineHeight then + Result := RowCaption.MeasureFontHeight(DC) + else + Result := RowCaption.MeasureContentHeight(DC); + + if Result < DefaultDataRowLineHeight then + Result := DefaultDataRowLineHeight; + end; + + function MeasureDataHeight: Integer; + var + MinHeight: Integer; + begin + Result := DefaultDataRowLineHeight; + if HasData then + begin + MinHeight := RowData.MeasureFontHeight(DC); + if not ACalculateLineHeight then + begin + Result := RowData.MeasureContentHeight(DC); + if Result = 0 then + Result := MinHeight; + end + else + Result := MinHeight; + + ABuilder.DoGetCellHeight(Card.GridCard, GridCardRow, Result); + if Result < MinHeight then + Result := MinHeight; + end; + end; + +begin + Result := Max(MeasureCaptionHeight, MeasureDataHeight); + if RowSeparator <> nil then + Inc(Result, RowSeparator.Height); +end; + +function TdxReportCardRow.MeasureWidth(DC: HDC): Integer; +begin + Result := GridCardRow.Position.Width; + if Result = 0 then + begin + Result := MeasureCaptionWidth(DC) + MeasureDataWidth(DC); + if HasIndent then + Inc(Result, RowIndent.Width); + end; +end; + +function TdxReportCardRow.MeasureCaptionWidth(DC: HDC): Integer; +begin + if HasCaption then + begin + Result := RowCaption.MeasureContentWidth(DC){ + 2}; + if HasIndent then + Inc(Result, RowIndent.Width); + end + else + Result := 0; +end; + +function TdxReportCardRow.MeasureDataWidth(DC: HDC): Integer; +begin + if HasData and dxPSDataMaps.DoesItemParticipateInAutoWidthCalculation(Properties) then + Result := RowData.MeasureContentWidth(DC) + 2 + else + Result := 0; +end; + +procedure TdxReportCardRow.AdjustCellSides( + AIsFirstItem, AIsLastItem, AIsLeftItem, AIsRightItem: Boolean); +var + ReportLink: TdxGridReportLink; + Sides: TdxCellSides; +begin + ReportLink := Card.ReportLink; + if ReportLink.OptionsCards.Borders then + begin + Sides := []; + if AIsFirstItem then Include(Sides, csTop); + if AIsLastItem then Include(Sides, csBottom); + if HasIndent then + RowIndent.CellSides := Sides; + if HasIndent and AIsLeftItem then + RowIndent.CellSides := Sides + [csLeft]; + if HasCaption then + begin + RowCaption.CellSides := RowCaption.CellSides + Sides; + if not HasIndent and AIsLeftItem then + RowCaption.CellSides := RowCaption.CellSides + [csLeft]; + end; + if HasData then + begin + RowData.CellSides := RowData.CellSides + Sides; + if AIsRightItem then + RowData.CellSides := RowData.CellSides + [csRight]; + end; + if not HasCaption and AIsLeftItem then + RowData.CellSides := RowData.CellSides + [csLeft] + else + if not HasData and AIsRightItem then + RowCaption.CellSides := RowCaption.CellSides + [csRight]; + end; + + if ReportLink.OptionsCards.RowBordersHorz then + begin + Sides := []; + if not AIsFirstItem then Include(Sides, csTop); + if not AIsLastItem then Include(Sides, csBottom); + if HasCaption then + RowCaption.CellSides := RowCaption.CellSides + Sides; + if HasData then + RowData.CellSides := RowData.CellSides + Sides; + if HasIndent then + RowIndent.CellSides := RowIndent.CellSides + Sides; + end; + + if ReportLink.OptionsCards.RowBordersVert then + begin + if HasCaption then + begin + RowCaption.CellSides := RowCaption.CellSides + [csRight]; + if not HasIndent then + RowCaption.CellSides := RowCaption.CellSides + [csLeft]; + end; + if HasData and (HasCaption or not HasIndent) then + RowData.CellSides := RowData.CellSides + [csLeft]; + if HasIndent then + RowIndent.CellSides := RowIndent.CellSides + [csLeft]; + end; +end; + +procedure TdxReportCardRow.CreateItems(ABuilder: TdxGridCardViewBuilder); +const + InitialCaptionWidth = 100; + + function HasRowCaption: Boolean; + begin + Result := GridCardRow.Options.ShowCaption; + end; + + function HasRowData: Boolean; + begin + Result := GridCardRow.Options.ShowData; + end; + + function HasIndent: Boolean; + begin + Result := GridCardRow.HasExpandButton or + ((GridCardRow.CategoryRow <> nil) and Layer.CanHaveIndent(Self)); + end; + + function ExpandButtonSize: Integer; + begin + Result := ABuilder.Adapter.ExpandButtonSize + cxTextOffset * 3; + end; + + procedure CreateRowCaption; + begin + FRowCaption := ABuilder.Formatter.GetCardRowCaptionClass(GridCardRow).Create(Self); + if HasIndent then + begin + FRowIndent := TdxReportCellExpandButton.Create(Self); + FRowIndent.Width := ExpandButtonSize; + FRowIndent.ShowButton := GridCardRow.HasExpandButton; + FRowIndent.CellSides := []; + if FRowIndent.ShowButton then + begin + ABuilder.Formatter.DoInitializeExpandButton(FRowIndent, Card.GridCard, True); + FRowIndent.ButtonExpanded := GridCardRow.Expanded; + end; + ABuilder.Formatter.DoInitializeCardRowIndent(FRowIndent, GridCardRow, Card.GridCard); + end; + if FRowIndent <> nil then + RowCaption.Left := FRowIndent.Width; + if HasRowData then + RowCaption.Width := InitialCaptionWidth + else + RowCaption.Width := Parent.Width - RowCaption.Left; + RowCaption.Height := Height; + RowCaption.Data := Integer(TdxGridCardRowCaption); + ABuilder.Formatter.DoInitializeCardRowCaption(RowCaption, GridCardRow, Card.GridCard); + ABuilder.Formatter.DoReportLinkInitializeCardRowCaption(RowCaption, GridCardRow, Card.GridCard); + end; + + procedure CreateRowData; + begin + FRowData := ABuilder.Formatter.GetItemClass(GridCardRow, Card.GridCard, False).Create(Self); + if HasRowCaption then + RowData.Left := InitialCaptionWidth + else + RowData.Left := 0; + RowData.Width := Parent.Width - Left; + RowData.Height := DefaultDataRowLineHeight; + ABuilder.Formatter.DoInitializeItem(RowData, GridCardRow, Card.GridCard, False); + ABuilder.Formatter.DoReportLinkInitializeCardRowData(RowData, GridCardRow, Card.GridCard); + end; + + procedure CreateRowSeparator; + var + AParams: TcxViewParams; + AGridView: TcxGridCardView; + begin + AGridView := TcxGridCardView(GridCardRow.GridView); + FRowSeparator := TdxReportCellBox(AddDataItem(TdxReportCellBox)); + FRowSeparator.BoundsRect := MakeRect(0, 0, Width, AGridView.OptionsView.CategorySeparatorWidth); + AGridView.Styles.GetViewParams(vsCategorySeparator, nil, nil, AParams); + FRowSeparator.Color := AParams.Color; + FRowSeparator.Transparent := False; + FRowSeparator.CellSides := []; + end; + +begin + if HasRowCaption then + CreateRowCaption; + if HasRowData then + CreateRowData; + if NeedSeparator then + CreateRowSeparator; + Width := Width; + Height := Height; +end; + +function TdxReportCardRow.GetCard: TdxReportCard; +begin + Result := TdxReportCard(Parent.Parent); +end; + +function TdxReportCardRow.GetGridCardRow: TcxGridCardViewRow; +begin + Result := TcxGridCardViewRow(Data); +end; + +function TdxReportCardRow.GetHasCaption: Boolean; +begin + Result := FRowCaption <> nil; +end; + +function TdxReportCardRow.GetHasData: Boolean; +begin + Result := FRowData <> nil; +end; + +function TdxReportCardRow.GetHasIndent: Boolean; +begin + Result := FRowIndent <> nil; +end; + +function TdxReportCardRow.GetHasRowSeparator: Boolean; +begin + Result := FRowSeparator <> nil; +end; + +function TdxReportCardRow.GetHeight: Integer; +begin + Result := inherited Height; +end; + +function TdxReportCardRow.GetLayer: TdxReportCardLayer; +begin + Result := Parent as TdxReportCardLayer; +end; + +function TdxReportCardRow.GetProperties: TcxCustomEditProperties; +begin + Result := GridCardRow.GetProperties; +end; + +function TdxReportCardRow.GetWidth: Integer; +begin + Result := inherited Width; +end; + +procedure TdxReportCardRow.SetHeight(AValue: Integer); +begin + inherited Height := AValue; + if HasRowSeparator then + begin + Dec(AValue, RowSeparator.Height); + RowSeparator.Top := AValue; + end; + if HasCaption then + RowCaption.Height := AValue; + if HasData then + RowData.Height := AValue; + if HasIndent then + RowIndent.Height := AValue; +end; + +procedure TdxReportCardRow.SetRowCaptionWidth(Value: Integer); +begin + if Value > Width then + Value := Width - 1; + if not HasData then + Value := Width; + if HasIndent then + Dec(Value, RowIndent.Width); + if HasCaption then + begin + RowCaption.Width := Value; + if HasData then + RowData.Left := RowCaption.Left + RowCaption.Width; + end; + Width := Width; +end; + +procedure TdxReportCardRow.SetWidth(Value: Integer); +begin + inherited Width := Value; + if HasRowSeparator then + RowSeparator.Width := Value; + if HasCaption and (RowCaption.Width > Width) then + RowCaption.Width := Width - RowCaption.Left; + if HasData then + RowData.Width := Width - RowData.Left; +end; + +{ TdxCardBorderPainter } + +function TdxCardBorderPainter.Card: TdxReportCard; +begin + Result := inherited Item as TdxReportCard; +end; + +procedure TdxCardBorderPainter.Paint(DC: HDC); +begin + if Card.HasShadow then DrawShadow(DC); +end; + +procedure TdxCardBorderPainter.DrawShadow(DC: HDC); +begin + Renderer.FillRect(DC, Card.ShadowRectHorz, Card.ShadowColor); + Renderer.FillRect(DC, Card.ShadowRectVert, Card.ShadowColor); +end; + +{ TdxReportCard } + +constructor TdxReportCard.Create(AParent: TdxReportCell); +begin + inherited; + ShadowColor := clBlack; + ShadowDepth := dxDefaultCardsShadowDepth; + ShadowPosition := cspBottomRight; +end; + +constructor TdxReportCard.CreateEx(AParent: TdxReportCell; AGridCard: TcxGridCard); +begin + Create(AParent); + Data := Integer(AGridCard); +end; + +function TdxReportCard.GetBorderOuterBounds(DC: HDC): TRect; +begin + Result := inherited GetBorderBounds(DC); + with Result do + begin + case ShadowPosition of + cspTopLeft: + begin + Inc(Left, ShadowDepth); + Inc(Top, ShadowDepth); + end; + cspTopRight: + begin + Dec(Right, ShadowDepth); + Inc(Top, ShadowDepth); + end; + cspBottomRight: + begin + Dec(Right, ShadowDepth); + Dec(Bottom, ShadowDepth); + end; + cspBottomLeft: + begin + Inc(Left, ShadowDepth); + Dec(Bottom, ShadowDepth); + end; + end; + end; +end; + +procedure TdxReportCard.AddVerticalDelimiters; +var + I: Integer; +begin + for I := 0 to CellCount - 1 do + ReportLink.AddVerticalDelimiter(Cells[I]); +end; + +procedure TdxReportCard.ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); +begin + inherited; + FShadowDepth := MulDiv(FShadowDepth, APixelsNumerator, APixelsDenominator); +end; + +function TdxReportCard.GetBorderPainterClass: TdxPSCellBorderPainterClass; +begin + Result := TdxCardBorderPainter; +end; + +procedure TdxReportCard.ReadProperties(AReader: TdxPSDataReader); +begin + inherited ReadProperties(AReader); + with AReader do + begin + FCaptionWidth := ReadInteger; + FShadowColor := ReadInteger; + FShadowDepth := ReadInteger; + FShadowPosition := TdxGridCardShadowPosition(ReadInteger); + end; +end; + +procedure TdxReportCard.WriteProperties(AWriter: TdxPSDataWriter); +begin + inherited WriteProperties(AWriter); + with AWriter do + begin + WriteInteger(FCaptionWidth); + WriteInteger(ShadowColor); + WriteInteger(ShadowDepth); + WriteInteger(Integer(ShadowPosition)); + end; +end; + +procedure TdxReportCard.SetCaptionWidth( + DC: HDC; ALayer, AValue, AMaxValue: Integer; ACaptionAutoWidths: Boolean); +var + I: Integer; +begin + AValue := Max(AValue, 0); + FLayerCaptionWidth := AValue; + for I := 0 to LayerCount - 1 do + Layers[I].SetRowCaptionWidth(DC, ACaptionAutoWidths, AMaxValue); +end; + +procedure TdxReportCard.AdjustLayers; +begin +end; + +procedure TdxReportCard.CreateLayers(ABuilder: TdxGridCardViewBuilder); +var + List: TList; + ACurIndex, APrevIndex, I: Integer; + ARow: TcxGridCardViewRow; + ALayer: TdxReportCardLayer; + ANeedLayerSeparator: Boolean; +begin + List := TList.Create; + try + ABuilder.Adapter.GetVisibleCardRows(GridCard, List); + ALayer := nil; + AllocateSpaceForCells(List.Count); + APrevIndex := -1; + ANeedLayerSeparator := False; + for I := 0 to List.Count - 1 do + begin + ARow := TcxGridCardViewRow(List[I]); + ACurIndex := GetLayerIndexByRow(ARow); + if ACurIndex <> APrevIndex then + begin + ALayer := GetLayerClass.CreateEx(Self, ARow); + APrevIndex := ACurIndex; + end + else + begin + ALayer.AddRow(ARow); + ANeedLayerSeparator := True; + end; + end; + ANeedLayerSeparator := ANeedLayerSeparator and + (GridCard.GridView.OptionsView.LayerSeparatorWidth > 0); + for I := 0 to LayerCount - 1 do + begin + if I < (LayerCount - 1) then + Layers[I].CheckNeedCategorySeparator(Layers[I + 1]); + Layers[I].NeedLayerSeparator := ANeedLayerSeparator and HasLayerSeparator(I); + Layers[I].CreateItems(ABuilder); + Layers[I].Width := Layers[I].Width; + end; + AdjustLayers; + finally + List.Free; + end; +end; + +function TdxReportCard.GetLayerClass: TdxReportCardLayerClass; +begin + Result := TdxReportCardLayer; +end; + +function TdxReportCard.GetLayerIndexByRow(ARow: TcxGridCardViewRow): Integer; +begin + Result := ARow.Position.RowIndex; +end; + +function TdxReportCard.GetLayerWidth(Index: Integer): Integer; +begin + Result := ContentWidth; +end; + +function TdxReportCard.HasLayerSeparator(ALayerIndex: Integer): Boolean; +begin + Result := ALayerIndex < (LayerCount - 1); +end; + +procedure TdxReportCard.RecalculateLayersHeight; +var + I: Integer; +begin + for I := 0 to LayerCount - 1 do + Layers[I].RecalculateHeight; +end; + +procedure TdxReportCard.SetLayerHeight(Index, Value: Integer); +var + Delta, I: Integer; +begin + if Value < 0 then Value := 0; + + Delta := Value - Layers[Index].Height; + Layers[Index].Height := Value; + + for I := Index + 1 to LayerCount - 1 do + Layers[I].Top := Layers[I].Top + Delta; +end; + +procedure TdxReportCard.SetLayerWidth(Index, Value: Integer); +begin + Layers[Index].Width := Value; +end; + +function TdxReportCard.GetRowCount: Integer; +begin + Result := LayerCount; +end; + +function TdxReportCard.GetRowHeight(AIndex: Integer): Integer; +begin + Result := LayerHeights[AIndex]; +end; + +procedure TdxReportCard.SetRowHeight(AIndex, AValue: Integer); +begin + LayerHeights[AIndex] := AValue; +end; + +procedure TdxReportCard.SizeChanged; +begin +end; + +function TdxReportCard.GetGridCard: TcxGridCard; +begin + Result := TcxGridCard(Data); +end; + +function TdxReportCard.GetWidth: Integer; +begin + Result := inherited Width; +end; + +function TdxReportCard.GetContentHeight: Integer; +begin + Result := Height - ShadowDepth; +end; + +function TdxReportCard.GetContentWidth: Integer; +begin + Result := Width - ShadowDepth; +end; + +function TdxReportCard.GetHasShadow: Boolean; +begin + Result := FShadowDepth > 0; +end; + +function TdxReportCard.GetHeight: Integer; +begin + Result := inherited Height; +end; + +function TdxReportCard.GetLayerCount: Integer; +begin + Result := CellCount; +end; + +function TdxReportCard.GetLayer(Index: Integer): TdxReportCardLayer; +begin + Result := Cells[Index] as TdxReportCardLayer; +end; + +function TdxReportCard.GetLayerHeight(Index: Integer): Integer; +begin + Result := Layers[Index].Height; +end; + +function TdxReportCard.GetLayersOriginLeft: Integer; +begin + if ShadowPosition in [cspTopLeft, cspBottomLeft] then + Result := ShadowDepth + else + Result := 0; +end; + +function TdxReportCard.GetLayersOriginTop: Integer; +begin + if ShadowPosition in [cspTopLeft, cspTopRight] then + Result := ShadowDepth + else + Result := 0; +end; + +function TdxReportCard.GetReportLink: TdxGridReportLink; +begin + Result := TdxGridReportLink(ReportCells.ReportLink); +end; + +function TdxReportCard.GetShadowRectHorz: TRect; +begin + Result := BoundsRect; + OffsetRect(Result, -Result.Left, -Result.Top); + with Result do + case ShadowPosition of + cspTopLeft: + begin + Right := Right - ShadowDepth; + Bottom := Top + ShadowDepth; + end; + cspTopRight: + begin + Left := Left + ShadowDepth; + Bottom := Top + ShadowDepth; + end; + cspBottomRight: + begin + Left := Left + ShadowDepth; + Top := Bottom - ShadowDepth; + end; + cspBottomLeft: + begin + Right := Right - ShadowDepth; + Top := Bottom - ShadowDepth; + end; + end; +end; + +function TdxReportCard.GetShadowRectVert: TRect; +begin + Result := BoundsRect; + OffsetRect(Result, -Result.Left, -Result.Top); + with Result do + case ShadowPosition of + cspTopLeft: + begin + Right := Left + ShadowDepth; + Top := Top + ShadowDepth; + Bottom := Bottom - ShadowDepth; + end; + cspTopRight: + begin + Left := Right - ShadowDepth; + Top := Top + ShadowDepth; + Bottom := Bottom - ShadowDepth; + end; + cspBottomRight: + begin + Left := Right - ShadowDepth; + Top := Top + ShadowDepth; + Bottom := Bottom - ShadowDepth; + end; + cspBottomLeft: + begin + Right := Left + ShadowDepth; + Top := Top + ShadowDepth; + Bottom := Bottom - ShadowDepth; + end; + end; +end; + +procedure TdxReportCard.SetContentHeight(AValue: Integer); +begin + Height := AValue + ShadowDepth; +end; + +procedure TdxReportCard.SetContentWidth(AValue: Integer); +begin + Width := AValue + ShadowDepth; +end; + +procedure TdxReportCard.SetHeight(Value: Integer); +begin + inherited Height := Value + ShadowDepth; + SizeChanged; +end; + +procedure TdxReportCard.SetShadowDepth2(AValue: Integer); +var + SaveWidth, SaveHeight: Integer; +begin + if FShadowDepth <> AValue then + begin + SaveHeight := ContentHeight; + SaveWidth := ContentWidth; + FShadowDepth := AValue; + Height := SaveHeight; + Width := SaveWidth; + end; +end; + +procedure TdxReportCard.SetWidth(Value: Integer); +begin + inherited Width := Value + ShadowDepth; + SizeChanged; +end; + +{ TdxReportCardHorz } + +procedure TdxReportCardHorz.AdjustHeight; +var + TotalHeight, I: Integer; +begin + TotalHeight := 0; + for I := 0 to LayerCount - 1 do + Inc(TotalHeight, LayerHeights[I]); + Height := TotalHeight; +end; + +procedure TdxReportCardHorz.AdjustLayersCellSides; +var + I: Integer; +begin + for I := 0 to LayerCount - 1 do + Layers[I].AdjustCellSides; +end; + +procedure TdxReportCardHorz.AdjustLayersPos; +var + I: Integer; +begin + for I := 0 to LayerCount - 1 do + with Layers[I] do + begin + Left := LayersOriginLeft; + Top := Top + LayersOriginTop; + end; +end; + +procedure TdxReportCardHorz.AdjustRowHeight(DC: HDC; AAutoHeight: Boolean; + ABuilder: TdxGridCardViewBuilder); +var + I: Integer; +begin + for I := 0 to LayerCount - 1 do + LayerHeights[I] := Layers[I].MeasureLayerHeight(DC, not AAutoHeight, ABuilder); +end; + +procedure TdxReportCardHorz.AdjustWidth(DC: HDC); +var + AMaxLayerWidth, I: Integer; +begin + AMaxLayerWidth := 0; + for I := 0 to LayerCount - 1 do + AMaxLayerWidth := Max(AMaxLayerWidth, Layers[I].MeasureWidth(DC)); + Width := AMaxLayerWidth; +end; + +function TdxReportCardHorz.MeasureCaptionWidth(DC: HDC): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to LayerCount - 1 do + Result := Max(Result, Layers[I].MeasureCaptionWidth(DC)); +end; + +function TdxReportCardHorz.MeasureDataWidth(DC: HDC): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to LayerCount - 1 do + Result := Max(Result, Layers[I].MeasureDataWidth(DC)); +end; + +procedure TdxReportCardHorz.SizeChanged; +var + I: Integer; +begin + for I := 0 to LayerCount - 1 do + Layers[I].Width := ContentWidth; +end; + +{ TdxReportCardVert } + +procedure TdxReportCardVert.AdjustHeight; +var + TotalHeight, I: Integer; +begin + TotalHeight := 0; + for I := 0 to LayerCount - 1 do + TotalHeight := Max(TotalHeight, LayerHeights[I]); + Height := TotalHeight; +end; + +procedure TdxReportCardVert.AdjustLayers; +var + I, ALeft: Integer; + AAllFixed: Boolean; + AAutoWidths: TcxAutoWidthObject; +begin + if LayerCount = 0 then Exit; + AAutoWidths := TcxAutoWidthObject.Create(LayerCount); + try + AAllFixed := True; + for I := 0 to LayerCount - 1 do + Layers[I].InitAutoWidthItem(AAutoWidths.AddItem, AAllFixed); + if AAllFixed or (AAutoWidths.Width > Width) then + for I := 0 to AAutoWidths.Count - 1 do + AAutoWidths[I].Fixed := False; + AAutoWidths.AvailableWidth := ContentWidth; + AAutoWidths.Calculate; + ALeft := 0; + for I := 0 to LayerCount - 1 do + begin + Layers[I].NeedLayerSeparator := I > 0; + ALeft := Layers[I].SetPosition(ALeft, AAutoWidths[I].AutoWidth); + end; + finally + AAutoWidths.Free; + end; +end; + +procedure TdxReportCardVert.AdjustLayersCellSides; +var + I: Integer; + ASides: TdxCellSides; +begin + for I := 0 to LayerCount - 1 do + begin + ASides := [csTop, csBottom]; + if I = 0 then + ASides := ASides + [csLeft]; + if I = LayerCount - 1 then + ASides := ASides + [csRight]; + Layers[I].CellSides := ASides; + Layers[I].AdjustCellSides; + end; +end; + +procedure TdxReportCardVert.AdjustLayersPos; +var + I: Integer; +begin + for I := 0 to LayerCount - 1 do + with Layers[I] do Top := Top + LayersOriginTop; +end; + +procedure TdxReportCardVert.AdjustRowHeight( + DC: HDC; AAutoHeight: Boolean; ABuilder: TdxGridCardViewBuilder); +var + I: Integer; +begin + for I := 0 to LayerCount - 1 do + Layers[I].AdjustRowHeight(DC, AAutoHeight, ABuilder); +end; + +procedure TdxReportCardVert.AdjustWidth(DC: HDC); +var + AMaxWidth, I: Integer; +begin + AMaxWidth := 0; + for I := 0 to LayerCount - 1 do + Inc(AMaxWidth, Layers[I].MeasureWidth(DC)); + Width := AMaxWidth; +end; + +function TdxReportCardVert.GetLayerClass: TdxReportCardLayerClass; +begin + Result := TdxReportCardVerticalLayer; +end; + +function TdxReportCardVert.GetLayerByAbsoluteRowIndex(var AIndex: Integer): TdxReportCardLayer; +var + I: Integer; +begin + Result := nil; + for I := 0 to LayerCount - 1 do + begin + Result := Layers[I]; + if AIndex < Result.RowCount then + Break + else + Dec(AIndex, Result.RowCount); + end; +end; + +function TdxReportCardVert.GetLayerIndexByRow( + ARow: TcxGridCardViewRow): Integer; +begin + Result := ARow.Position.ColIndex; +end; + +function TdxReportCardVert.GetRowCount: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to LayerCount - 1 do + Inc(Result, Layers[I].RowCount); +end; + +function TdxReportCardVert.GetRowHeight(AIndex: Integer): Integer; +var + ALayer: TdxReportCardLayer; +begin + ALayer := GetLayerByAbsoluteRowIndex(AIndex); + Result := ALayer.Rows[AIndex].Height; +end; + +function TdxReportCardVert.HasLayerSeparator(ALayerIndex: Integer): Boolean; +begin + Result := ALayerIndex > 0; +end; + +function TdxReportCardVert.MeasureCaptionWidth(DC: HDC): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to LayerCount - 1 do + Result := Max(Result, Layers[I].MeasureCaptionWidth(DC)); +end; + +procedure TdxReportCardVert.SetCaptionWidth( + DC: HDC; ALayer, AValue, AMaxValue: Integer; ACaptionAutoWidth: Boolean); +var + I: Integer; +begin + for I := 0 to LayerCount - 1 do + Layers[ALayer].SetRowCaptionWidth(DC, ACaptionAutoWidth, AValue); +end; + +procedure TdxReportCardVert.SetLayerWidth(Index, Value: Integer); +var + Delta, I: Integer; +begin + if Value < 0 then Value := 0; + + Delta := Value - Layers[Index].Height; + Layers[Index].Width := Value; + + for I := Index + 1 to LayerCount - 1 do + Layers[I].Left := Layers[I].Left + Delta; +end; + +procedure TdxReportCardVert.SetLayerHeight(AIndex, AValue: Integer); +var + I: Integer; +begin + for I := 0 to LayerCount - 1 do + Layers[I].Height := AValue; +end; + +procedure TdxReportCardVert.SetLayersSameHeight; +var + I: Integer; +begin + for I := 0 to LayerCount - 1 do + begin + Layers[I].Height := ContentHeight; + Layers[I].ClipChildren := True; + end; +end; + +procedure TdxReportCardVert.SetRowHeight(AIndex, AValue: Integer); +var + ALayer: TdxReportCardLayer; +begin + ALayer := GetLayerByAbsoluteRowIndex(AIndex); + ALayer.SetRowHeight(AIndex, AValue); +end; + +procedure TdxReportCardVert.SizeChanged; +begin + AdjustLayers; + SetLayersSameHeight; +end; + +{ TdxGridCardViewBuilder } + +constructor TdxGridCardViewBuilder.Create(AReportLink: TdxGridReportLink; + AMasterBuilder: TdxCustomGridViewBuilder; AGridView: TcxCustomGridView); +begin + inherited; + FCards := TList.Create; +end; + +destructor TdxGridCardViewBuilder.Destroy; +begin + FreeAndNil(FCards); + inherited; +end; + +function TdxGridCardViewBuilder.Adapter: TdxGridCardViewAdapter; +begin + Result := inherited Adapter as TdxGridCardViewAdapter; +end; + +class function TdxGridCardViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxGridCardViewAdapter; +end; + +function TdxGridCardViewBuilder.Formatter: TdxGridCardViewFormatter; +begin + Result := inherited Formatter as TdxGridCardViewFormatter; +end; + +class function TdxGridCardViewBuilder.FormatterClass: TdxGridViewFormatterClass; +begin + Result := TdxGridCardViewFormatter; +end; + +procedure TdxGridCardViewBuilder.DoBuildViewBody; +begin + CreateCards; + if not IsAborted then + begin + ResizeCards; + PlaceCards; + AdjustCardRowsCellSides; + end; +end; + +procedure TdxGridCardViewBuilder.AdjustCardRowsCellSides; +var + I: Integer; +begin + for I := 0 to CardCount - 1 do + Cards[I].AdjustLayersCellSides; +end; + +procedure TdxGridCardViewBuilder.CreateCards; +var + Producer: TdxGridCardViewCardsRowProducer; + I: Integer; +begin + Producer := GetCardsRowProducer; + + FCards.Count := Formatter.CardCount; + for I := 0 to CardCount - 1 do + begin + FCards[I] := Producer.CreateCard(Host, Formatter.Cards[I]); + if MasterBuilder = nil then + begin + Progress(100 * (I + 1) / Formatter.CardCount); + if IsAborted then Break; + end; + end; +end; + +procedure TdxGridCardViewBuilder.PlaceCards; + + procedure MakeRowIndexes(AnIndexes: TList); + var + I, PlaceWidth, EntryNumber: Integer; + begin + I := 0; + if CardCount > 0 then AnIndexes.Add(TObject(0)); + + while I < CardCount do + begin + PlaceWidth := Formatter.CardsAreaWidth; + EntryNumber := 0; + repeat + Inc(EntryNumber); + if EntryNumber > 1 then + Dec(PlaceWidth, Formatter.InterCardsSpaceHorz); + Dec(PlaceWidth, Cards[I].Width); + if (PlaceWidth >= 0) or (EntryNumber = 1) then + Inc(I); + until (PlaceWidth <= 0) or (I >= CardCount); + AnIndexes.Add(TObject(I)); + end; + end; + + procedure MakeRows(AIndexes: TList; AProducer: TdxGridCardViewCardsRowProducer); + + function GetMaxCardHeight(AStartIndex, AEndIndex: Integer): Integer; + var + I, V: Integer; + begin + Result := Cards[AStartIndex].Height; + {$IFNDEF DXVER500} + if not Formatter.KeepSameHeight then + {$ENDIF} + for I := AStartIndex + 1 to AEndIndex do + begin + V := Cards[I].Height; + if Result < V then Result := V; + end; + end; + + var + RowIndex, StartIndex, EndIndex, I, RowHeight: Integer; + ReportRow: TdxReportCell; + begin + for RowIndex := 0 to AIndexes.Count - 2 do + begin + StartIndex := Integer(AIndexes[RowIndex]); + EndIndex := Integer(AIndexes[RowIndex + 1]) - 1; + + RowHeight := GetMaxCardHeight(StartIndex, EndIndex) + Formatter.InterCardsSpaceHorz; + ReportRow := AProducer.Produce(HostInfoServices.PageDetailsHostInfo, RowHeight); + AddReportRow(ReportRow); + + for I := StartIndex to EndIndex do + AProducer.InjectCard(Cards[I], I - StartIndex); + end; + end; + +var + Indexes: TList; +begin + Indexes := TList.Create; + try + MakeRowIndexes(Indexes); + MakeRows(Indexes, GetCardsRowProducer); + finally + Indexes.Free; + end; +end; + +procedure TdxGridCardViewBuilder.ResizeCards; + + procedure SetCardsRowCaptionWidth(DC: HDC); + var + RowCaptionWidth, I, J: Integer; + ALayerCaptionWidths: array of Integer; + begin + if (CardCount = 0) or (Cards[0].LayerCount = 0) then Exit; + SetLength(ALayerCaptionWidths, Cards[0].LayerCount); + RowCaptionWidth := 0; + for J := 0 to Length(ALayerCaptionWidths) - 1 do + begin + if Formatter.CaptionAutoWidth then + begin + for I := 0 to CardCount - 1 do + if J < Cards[I].LayerCount then + ALayerCaptionWidths[J] := Max(ALayerCaptionWidths[J], Cards[I].Layers[J].MeasureCaptionWidth(DC)); + end + else + ALayerCaptionWidths[J] := Adapter.CardCaptionWidth; + RowCaptionWidth := Max(RowCaptionWidth, ALayerCaptionWidths[J]); + end; + + if (RowCaptionWidth > Adapter.CardWidth) and not Formatter.AutoWidth then + RowCaptionWidth := Adapter.CardWidth; + + for I := 0 to CardCount - 1 do + for J := 0 to Length(ALayerCaptionWidths) - 1 do + begin + Cards[I].SetCaptionWidth(DC, J, Min(ALayerCaptionWidths[J], + RowCaptionWidth), RowCaptionWidth, Formatter.CaptionAutoWidth); + end; + end; + + procedure CalcMaxCardWidth; + var + I: Integer; + begin + FMaxCardWidth := 0; + for I := 0 to CardCount - 1 do + FMaxCardWidth := Max(FMaxCardWidth, Cards[I].Width); + end; + + procedure SetCardsAutoWidth(DC: HDC); + var + I: Integer; + begin + for I := 0 to CardCount - 1 do + Cards[I].AdjustWidth(DC); + end; + + procedure SetSameCardsWidth(AWidth: Integer); + var + I: Integer; + begin + for I := 0 to CardCount - 1 do + with Cards[I] do + begin + Width := AWidth; + AdjustLayers; + end; + end; + + procedure SetCardsRowHeight(DC: HDC; AAutoHeight: Boolean); + var + I: Integer; + begin + for I := 0 to CardCount - 1 do + Cards[I].AdjustRowHeight(DC, AAutoHeight, Self); + end; + + procedure SetCardsSameHeights; + var + CardRowHeights: array of Integer; + I, J: Integer; + begin + SetLength(CardRowHeights, Adapter.CardRowCount); + + for I := 0 to CardCount - 1 do + with Cards[I] do + begin + for J := 0 to RowCount - 1 do + CardRowHeights[J] := Max(CardRowHeights[J], RowHeight[J]); + end; + + for I := 0 to CardCount - 1 do + with Cards[I] do + begin + for J := 0 to RowCount - 1 do + RowHeight[J] := CardRowHeights[J]; + RecalculateLayersHeight; + end; + end; + + procedure AdjustCards; + var + I: Integer; + begin + for I := 0 to CardCount - 1 do + with Cards[I] do + begin + AdjustHeight; + AdjustLayersPos; + end; + end; + +var + ACardColCount: Integer; +begin + FMaxCardWidth := 0; + SetCardsRowCaptionWidth(Formatter.DC); + if Formatter.AutoWidth then + begin + SetCardsAutoWidth(Formatter.DC); + CalcMaxCardWidth; + if Formatter.KeepSameWidth then + SetSameCardsWidth(FMaxCardWidth - 4); + SetCardsRowCaptionWidth(Formatter.DC); + end; + CalcMaxCardWidth; + if Formatter.CardAutoWidth then + begin + ACardColCount := Max((Formatter.ViewAvailableWidth - 4) div FMaxCardWidth, 1); + FMaxCardWidth := (Formatter.ViewAvailableWidth - (4 * ACardColCount)) div ACardColCount; + SetSameCardsWidth(FMaxCardWidth - 4); + end; + SetCardsRowHeight(Formatter.DC, Formatter.RowAutoHeight); + if Formatter.KeepSameHeight then SetCardsSameHeights; + + AdjustCards; +end; + +function TdxGridCardViewBuilder.GetCardsRowProducer: TdxGridCardViewCardsRowProducer; +begin + Result := ProducerCache[GetCardsRowProducerClass] as TdxGridCardViewCardsRowProducer; +end; + +function TdxGridCardViewBuilder.GetCardsRowProducerClass: TdxGridCardViewCardsRowProducerClass; +begin + Result := TdxGridCardViewCardsRowProducer; +end; + +function TdxGridCardViewBuilder.GridView: TcxGridCardView; +begin + Result := inherited GridView as TcxGridCardView; +end; + +class function TdxGridCardViewBuilder.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridCardView; +end; + +function TdxGridCardViewBuilder.GetCard(Index: Integer): TdxReportCard; +begin + Result := TdxReportCard(FCards[Index]); +end; + +function TdxGridCardViewBuilder.GetCardCount: Integer; +begin + Result := FCards.Count; +end; + +function TdxGridCardViewBuilder.GetMaxCardWidth: Integer; +begin + Result := FMaxCardWidth; +end; + +{ TdxGridDBCardViewAdapter } + +function TdxGridDBCardViewAdapter.GridView: TcxGridDBCardView; +begin + Result := inherited GridView as TcxGridDBCardView; +end; + +class function TdxGridDBCardViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridCardView; +end; + +procedure TdxGridDBCardViewAdapter.AfterBuilding; +begin + UnloadAllRecords; + inherited; +end; + +procedure TdxGridDBCardViewAdapter.BeforeBuilding; +begin + inherited; + LoadAllRecords; +end; + +function TdxGridDBCardViewAdapter.DataController: TcxGridDBDataController; +begin + Result := TcxGridDBDataController(inherited DataController); +end; + +function TdxGridDBCardViewAdapter.DBDataModeController: TcxDBDataModeController; +begin + Result := DataController.DataModeController; +end; + +procedure TdxGridDBCardViewAdapter.LoadAllRecords; +begin + _LoadAllRecords(DBDataModeController, FPrevAllRecordsAreLoaded); +end; + +procedure TdxGridDBCardViewAdapter.UnloadAllRecords; +begin + _UnloadAllRecords(DBDataModeController, FPrevAllRecordsAreLoaded); +end; + +{ TdxGridDBCardViewBuilder } + +function TdxGridDBCardViewBuilder.Adapter: TdxGridDBCardViewAdapter; +begin + Result := inherited Adapter as TdxGridDBCardViewAdapter; +end; + +class function TdxGridDBCardViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxGridDBCardViewAdapter; +end; +{$IFDEF CHARTVIEW} +{ TdxGridChartViewAdapter } + +function TdxGridChartViewAdapter.GridView: TcxGridChartView; +begin + Result := inherited GridView as TcxGridChartView; +end; + +class function TdxGridChartViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridChartView; +end; + +function TdxGridChartViewAdapter.CreateGraphic(AGraphicClass: TGraphicClass; + AWidth: Integer): TGraphic; +var + AGraphic: TGraphic; +begin + if not (AGraphicClass.InheritsFrom(TBitmap) or AGraphicClass.InheritsFrom(TMetaFile)) then + begin + Result := GridView.CreateImage(TBitmap, Max(AWidth, 0), 0); + AGraphic := AGraphicClass.Create; + try + AGraphic.Assign(Result); + finally + Result.Free; + Result := AGraphic; + end; + end + else + Result := GridView.CreateImage(AGraphicClass, Max(AWidth, 0), 0); +end; + +function TdxGridChartViewAdapter.GetCanUseOnEveryPageMode: Boolean; +begin + Result := True; +end; + +{ TdxGridChartViewFormatter } + +function TdxGridChartViewFormatter.Adapter: TdxGridChartViewAdapter; +begin + Result := inherited Adapter as TdxGridChartViewAdapter; +end; + +function TdxGridChartViewFormatter.Builder: TdxGridChartViewBuilder; +begin + Result := inherited Builder as TdxGridChartViewBuilder; +end; + +function TdxGridChartViewFormatter.CreateChartImage: TGraphic; + + function GetWidth: Integer; + begin + if ReportLink.OptionsSize.AutoWidth then + Result := ViewAvailableWidth + else + Result := -1; + end; + +begin + Result := Adapter.CreateGraphic(GraphicClass, GetWidth); +end; + +procedure TdxGridChartViewFormatter.DoInitializeChartItem(AnItem: TdxReportCellGraphic); +begin + AnItem.ImageBuffering := cibNone; + AnItem.Image.Transparent := GraphicTransparent; + AnItem.ImageTransparent := GraphicTransparent; + AnItem.Center := True; +end; + +procedure TdxGridChartViewFormatter.DoReportLinkInitializeChartItem(AnItem: TdxReportCellGraphic); +begin + ReportLink.DoInitializeChartCell(Adapter.GridView, AnItem); +end; + +function TdxGridChartViewFormatter.GetChartItemClass: TdxReportCellGraphicClass; +begin + Result := TdxReportCellGraphic; +end; + +function TdxGridChartViewFormatter.GetViewWidth: Integer; +begin + Result := ViewAvailableWidth; +end; + +function TdxGridChartViewFormatter.GetGraphicClass: TGraphicClass; +begin + Result := ReportLink.OptionsCharts.GraphicClass; +end; + +function TdxGridChartViewFormatter.GetGraphicTransparent: Boolean; +begin + Result := ReportLink.OptionsCharts.Transparent; +end; + +{ TdxGridChartViewBuilder } + +function TdxGridChartViewBuilder.Adapter: TdxGridChartViewAdapter; +begin + Result := inherited Adapter as TdxGridChartViewAdapter; +end; + +class function TdxGridChartViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxGridChartViewAdapter; +end; + +function TdxGridChartViewBuilder.Formatter: TdxGridChartViewFormatter; +begin + Result := inherited Formatter as TdxGridChartViewFormatter; +end; + +class function TdxGridChartViewBuilder.FormatterClass: TdxGridViewFormatterClass; +begin + Result := TdxGridChartViewFormatter; +end; + +procedure TdxGridChartViewBuilder.DoBuildViewBody; +begin + inherited; + CreateChart; +end; + +procedure TdxGridChartViewBuilder.CreateChart; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetChartProducer.Produce(HostInfoServices.PageDetailsHostInfo); + AddReportRow(ReportRow); +end; + +function TdxGridChartViewBuilder.GetChartProducer: TdxGridChartViewChartProducer; +begin + Result := ProducerCache[GetChartProducerClass] as TdxGridChartViewChartProducer; +end; + +function TdxGridChartViewBuilder.GetChartProducerClass: TdxGridChartViewChartProducerClass; +begin + Result := TdxGridChartViewChartProducer; +end; + +function TdxGridChartViewBuilder.GridView: TcxGridChartView; +begin + Result := inherited GridView as TcxGridChartView; +end; + +class function TdxGridChartViewBuilder.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridChartView; +end; + +{$ENDIF} + +{ TdxGridViewRowProducer } + +constructor TdxGridViewRowProducer.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited Create; + FBuilder := ABuilder; + FMasterIndents := TList.Create; +end; + +destructor TdxGridViewRowProducer.Destroy; +begin + FMasterIndents.Free; + inherited; +end; + +function TdxGridViewRowProducer.Adapter: TdxCustomGridViewAdapter; +begin + Result := Builder.Adapter; +end; + +function TdxGridViewRowProducer.Builder: TdxCustomGridViewBuilder; +begin + Result := FBuilder; +end; + +function TdxGridViewRowProducer.Formatter: TdxCustomGridViewFormatter; +begin + Result := Builder.Formatter; +end; + +function TdxGridViewRowProducer.Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; +begin + FMasterIndents.Clear; + + CalculateRowHeight; + + CreateRowHost(AHostInfo); + CreateRow; + if AutoHeight then + begin + CalculateRowAutoHeight; + FixupRowHeight; + end; + + Inc(AHostInfo.Origin.Y, RowHeight); + Result := Host; +end; + +procedure TdxGridViewRowProducer.AddLeadingMasterIndentsAndSeparators; +var + LeftPos, I: Integer; +begin + LeftPos := 0; + for I := 0 to Formatter.AbsoluteLevel - 1 do + with MasterBuilders[I] do + begin + AddMasterSeparator(Formatter, Adapter, LeftPos, vdskLeading); + AddMasterIndents(Formatter, Adapter, I, LeftPos); + end; + AddMasterSeparator(Formatter, Adapter, LeftPos, vdskLeading); +end; + +procedure TdxGridViewRowProducer.AddMasterIndents(AMasterFormatter: TdxCustomGridViewFormatter; + AMasterAdapter: TdxCustomGridViewAdapter; ALevel: Integer; var ALeftPos: Integer); +var + I: Integer; + Indent: TdxReportCellExpandButton; +begin + for I := 0 to AMasterAdapter.IndentCount - 1 do + begin + Indent := CreateMasterIndent(Host); + Indent.BoundsRect := MakeBounds(ALeftPos, 0, AMasterAdapter.IndentWidth, RowHeight); + InitializeMasterIndent(AMasterFormatter, Indent, I, ALevel); + Inc(ALeftPos, Indent.Width); + end; +end; + +procedure TdxGridViewRowProducer.AddMasterSeparator(AMasterFormatter: TdxCustomGridViewFormatter; + AMasterAdapter: TdxCustomGridViewAdapter; var ALeftPos: Integer; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); +var + Separator: TdxReportCellBox; +begin + if AMasterAdapter.HasDetailsSeparator then + begin + Separator := CreateDetailsSeparator(Host); + Separator.BoundsRect := MakeBounds(ALeftPos, 0, AMasterFormatter.DetailsSeparatorThickness, RowHeight); + InitializeDetailsSeparator(AMasterFormatter, Separator, ASeparatorKind); + Inc(ALeftPos, Separator.Width); + end; +end; + +procedure TdxGridViewRowProducer.AddTrailingMasterSeparators; +var + LeftPos, I: Integer; +begin + LeftPos := Width - Formatter.ViewWidthExtraAfter; + AddMasterSeparator(Formatter, Adapter, LeftPos, vdskTrailing); + for I := Formatter.AbsoluteLevel - 1 downto 0 do + with Builder.AbsoluteBuilders[I] do + AddMasterSeparator(Formatter, Adapter, LeftPos, vdskTrailing); +end; + +function TdxGridViewRowProducer.CalculateItemHeight(DC: HDC; AnItem: TdxReportVisualItem): Integer; +begin + Result := AnItem.MeasureContentHeight(DC); +end; + +procedure TdxGridViewRowProducer.CalculateRowAutoHeight; +var + DC: HDC; + ItemsSite: TdxReportCell; + MaxRowHeight, I, V: Integer; + Item: TdxReportVisualItem; +begin + DC := Self.DC; + ItemsSite := Self.ItemsSite; + MaxRowHeight := 0; + for I := 0 to ItemsSite.DataItemCount - 1 do + begin + Item := ItemsSite.DataItems[I]; + if DoesItemParticipateInRowAutoHeightCalculation(Item) then + begin + V := CalculateItemHeight(DC, Item); + if MaxRowHeight < V then MaxRowHeight := V; + end; + end; + {3.1} + for I := 0 to ItemsSite.CellCount - 1 do + begin + Item := ItemsSite.Cells[I]; + if DoesItemParticipateInRowAutoHeightCalculation(Item) then + begin + V := CalculateItemHeight(DC, Item); + if MaxRowHeight < V then MaxRowHeight := V; + end; + end; + if RowHeight < MaxRowHeight then + RowHeight := MaxRowHeight; +end; + +procedure TdxGridViewRowProducer.CalculateRowHeight; +begin + FRowHeight := LineCount * LineHeight; +end; + +function TdxGridViewRowProducer.CreateDetailsSeparator(AParent: TdxReportCell): TdxReportCellBox; +begin + Result := GetDetailsSeparatorClass.Create(AParent); + FMasterIndents.Add(Result); +end; + +function TdxGridViewRowProducer.CreateMasterIndent(AParent: TdxReportCell): TdxReportCellExpandButton; +begin + Result := GetMasterIndentClass.Create(AParent); + FMasterIndents.Add(Result); +end; + +procedure TdxGridViewRowProducer.CreateRow; +begin + FRow := GetRowHostClass.Create(Host); + FRow.BoundsRect := MakeBounds(RowOriginX, 0, RowWidth, RowHeight); + InitializeRow; + AddTrailingMasterSeparators; +end; + +procedure TdxGridViewRowProducer.CreateRowHost(const AHostInfo: TdxGridAttributeHostInfo); +begin + FHost := HostClass.Create(AHostInfo.Parent); + FHost.BoundsRect := MakeBounds(AHostInfo.Origin.X, AHostInfo.Origin.Y, Width, RowHeight); + InitializeHost; + AddLeadingMasterIndentsAndSeparators; +end; + +function TdxGridViewRowProducer.DoesItemParticipateInRowAutoHeightCalculation(AnItem: TdxReportVisualItem): Boolean; +begin + Result := True; +end; + +function TdxGridViewRowProducer.GetDetailsSeparatorClass: TdxReportCellBoxClass; +begin + Result := Formatter.GetDetailsSeparatorClass; +end; + +function TdxGridViewRowProducer.GetMasterIndentClass: TdxReportCellExpandButtonClass; +begin + Result := Formatter.GetMasterIndentClass; +end; + +procedure TdxGridViewRowProducer.FixupMasterIndentsHeight; +var + I: Integer; +begin + for I := 0 to MasterIndentCount - 1 do + with MasterIndents[I] do + Height := Parent.Height; +end; + +procedure TdxGridViewRowProducer.FixupRowDataItemHeight(AnItem: TdxReportVisualItem); +begin + with AnItem do + Height := Parent.Height; +end; + +procedure TdxGridViewRowProducer.FixupRowDataHeight; +begin +end; + +procedure TdxGridViewRowProducer.FixupRowHeight; +begin + FixupRowOwnHeight; + FixupMasterIndentsHeight; + FixupRowDataHeight; +end; + +procedure TdxGridViewRowProducer.FixupRowOwnHeight; +begin + Host.Height := RowHeight; + Row.Height := RowHeight; + ItemsSite.Height := RowHeight; +end; + +procedure TdxGridViewRowProducer.InitializeDetailsSeparator(AFormatter: TdxCustomGridViewFormatter; + ASeparator: TdxReportCellBox; ASeparatorKind: TdxVerticalDetailsSeparatorKind); +begin + AFormatter.DoInitializeVertDetailsSeparator(ASeparator, ASeparatorKind); +end; + +procedure TdxGridViewRowProducer.InitializeMasterIndent(AFormatter: TdxCustomGridViewFormatter; + AIndent: TdxReportCellExpandButton; AIndex, ALevel: Integer); +begin + AFormatter.DoInitializeMasterIndent(AIndent, AIndex, MasterBuilders[ALevel].Adapter.IndentCount); +end; + +procedure TdxGridViewRowProducer.InitializeHost; +begin + Formatter.DoInitializeHost(Host); +end; + +procedure TdxGridViewRowProducer.InitializeRow; +begin +end; + +function TdxGridViewRowProducer.GetAutoHeight: Boolean; +begin + Result := LineCount = 1; +end; + +function TdxGridViewRowProducer.GetItemsSite: TdxReportCell; +begin + Result := Row; +end; + +function TdxGridViewRowProducer.GetLineCount: Integer; +begin + Result := 1; +end; + +function TdxGridViewRowProducer.GetLineHeight: Integer; +begin + Result := 20; +end; + +function TdxGridViewRowProducer.GetDC: HDC; +begin + Result := Formatter.DC; +end; + +function TdxGridViewRowProducer.GetHostClass: TdxReportCellClass; +begin + Result := Formatter.GetHostClass; +end; + +function TdxGridViewRowProducer.GetIndentWidth: Integer; +begin + Result := Adapter.IndentWidth; +end; + +function TdxGridViewRowProducer.GetMasterBuilder(Index: Integer): TdxCustomGridViewBuilder; +begin + Result := Builder.AbsoluteBuilders[Index]; +end; + +function TdxGridViewRowProducer.GetMasterIndent(Index: Integer): TdxReportCellBox; +begin + Result := TdxReportCellBox(FMasterIndents[Index]); +end; + +function TdxGridViewRowProducer.GetMasterIndentCount: Integer; +begin + Result := FMasterIndents.Count; +end; + +function TdxGridViewRowProducer.GetRowHostClass: TdxReportCellClass; +begin + Result := Formatter.GetRowHostClass; +end; + +function TdxGridViewRowProducer.GetWidth: Integer; +begin + with Formatter do + Result := ViewWidthExtraBefore + ViewWidth + ViewWidthExtraAfter; +end; + +function TdxGridViewRowProducer.GetRowOriginX: Integer; +begin + Result := Formatter.ViewWidthExtraBefore; +end; + +function TdxGridViewRowProducer.GetRowWidth: Integer; +begin + Result := Formatter.ViewWidth; +end; + +{ TdxGridViewCustomRowProducer } + +function TdxGridViewCustomRowProducer.Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; +begin + Result := inherited Produce(AHostInfo); + AddItem; +end; + +procedure TdxGridViewCustomRowProducer.AddItem; +begin + FItem := CreateItem(Row); + FItem.BoundsRect := MakeRect(0, 0, RowWidth, RowHeight); + InitializeItem; +end; + +function TdxGridViewCustomRowProducer.CreateItem(AParent: TdxReportCell): TAbstractdxReportCellData; +begin + Result := GetItemClass.Create(AParent); +end; + +procedure TdxGridViewCustomRowProducer.FixupRowDataHeight; +begin + inherited; + FixupRowDataItemHeight(Item); +end; + +procedure TdxGridViewCustomRowProducer.InitializeItem; +begin +end; + +function TdxGridViewCustomRowProducer.GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TdxGridViewCustomRowProducer.GetItemClass: TdxReportCellDataClass; +begin + Result := TAbstractdxReportCellData; +end; + +{ TdxGridViewCaptionProducer } + +procedure TdxGridViewCaptionProducer.InitializeItem; +begin + inherited; + Formatter.DoInitializeCaption(Item); + Formatter.DoReportLinkInitializeCaption(Item); +end; + +procedure TdxGridViewCaptionProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeCaptionRow(Row); +end; + +function TdxGridViewCaptionProducer.GetItemClass: TdxReportCellDataClass; +begin + Result := Formatter.GetCaptionClass; +end; + +function TdxGridViewCaptionProducer.GetLineHeight: Integer; +begin + Result := Formatter.CaptionLineHeight; +end; + +function TdxGridViewCaptionProducer.GetItem: TdxReportCellText; +begin + Result := TdxReportCellText(inherited Item); +end; + +{ TdxGridViewFilterBarProducer } + +procedure TdxGridViewFilterBarProducer.InitializeItem; +begin + inherited; + Formatter.DoInitializeFilterBar(Item); + Formatter.DoReportLinkInitializeFilterBar(Item); +end; + +procedure TdxGridViewFilterBarProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeFilterBarRow(Row); +end; + +function TdxGridViewFilterBarProducer.GetItemClass: TdxReportCellDataClass; +begin + Result := Formatter.GetFilterBarClass; +end; + +function TdxGridViewFilterBarProducer.GetLineHeight: Integer; +begin + Result := Formatter.FilterBarLineHeight; +end; + +function TdxGridViewFilterBarProducer.GetItem: TdxReportCellText; +begin + Result := TdxReportCellText(inherited Item); +end; + +{ TdxGridViewDetailsSeparatorProducer } + +procedure TdxGridViewDetailsSeparatorProducer.InitializeItem; +begin + inherited; + Formatter.DoInitializeHorzDetailsSeparator(Item); +end; + +procedure TdxGridViewDetailsSeparatorProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeDetailsSeparatorRow(Row); +end; + +function TdxGridViewDetailsSeparatorProducer.GetItemClass: TdxReportCellDataClass; +begin + Result := Formatter.GetDetailsSeparatorClass; +end; + +function TdxGridViewDetailsSeparatorProducer.GetLineHeight: Integer; +begin + Result := Formatter.DetailsSeparatorThickness; +end; + +function TdxGridViewDetailsSeparatorProducer.GetItem: TdxReportCellBox; +begin + Result := TdxReportCellBox(inherited Item); +end; + +{ TdxGridViewDetailsTopSeparatorProducer } + +procedure TdxGridViewDetailsTopSeparatorProducer.InitializeDetailsSeparator( + AFormatter: TdxCustomGridViewFormatter; ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); +begin + if AFormatter = Formatter then + AFormatter.DoInitializeVertTopDetailsSeparator(ASeparator, ASeparatorKind) + else + inherited; +end; + +{ TdxGridViewDetailsBottomSeparatorProducer } + +procedure TdxGridViewDetailsBottomSeparatorProducer.InitializeDetailsSeparator( + AFormatter: TdxCustomGridViewFormatter; ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); +begin + if AFormatter = Formatter then + AFormatter.DoInitializeVertBottomDetailsSeparator(ASeparator, ASeparatorKind) + else + inherited; +end; + +{ TdxGridViewTerminatorProducer } + +procedure TdxGridViewTerminatorProducer.InitializeItem; +begin + inherited; + Formatter.DoInitializeViewTerminator(Item); +end; + +function TdxGridViewTerminatorProducer.GetLineHeight: Integer; +begin + Result := 1; +end; + +{ TdxGridTableViewRowProducer } + +function TdxGridTableViewRowProducer.Adapter: TdxGridTableViewAdapter; +begin + Result := inherited Adapter as TdxGridTableViewAdapter; +end; + +function TdxGridTableViewRowProducer.Builder: TdxGridTableViewBuilder; +begin + Result := inherited Builder as TdxGridTableViewBuilder; +end; + +function TdxGridTableViewRowProducer.Formatter: TdxGridTableViewFormatter; +begin + Result := Builder.Formatter; +end; + +{ TdxGridTableViewRowSubItemsProducer } + +constructor TdxGridTableViewRowSubItemsProducer.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited; + FIndents := TList.Create; + FSubItems := TList.Create; +end; + +destructor TdxGridTableViewRowSubItemsProducer.Destroy; +begin + FreeAndNil(FSubItems); + FreeAndNil(FIndents); + inherited; +end; + +function TdxGridTableViewRowSubItemsProducer.Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; +begin + InitializeIndentList; + InitializeSubItemList; + Result := inherited Produce(AHostInfo); +end; + +procedure TdxGridTableViewRowSubItemsProducer.AddIndents(AParent: TdxReportCell); +begin +end; + +procedure TdxGridTableViewRowSubItemsProducer.AddSubItems(AParent: TdxReportCell); +var + I: Integer; + Item: TAbstractdxReportCellData; +begin + for I := 0 to GetSubItemCount - 1 do + if HasSubItem[I] then + begin + Item := CreateSubItem(I, AParent); + Item.BoundsRect := SubItemBounds[I]; // needed before item initialization + InitializeSubItem(Item, I); + end; +end; + +procedure TdxGridTableViewRowSubItemsProducer.CreateRow; +begin + inherited; + AddIndents(Row); + AddSubItems(Row); +end; + +function TdxGridTableViewRowSubItemsProducer.CreateSubItem(AnIndex: Integer; + AParent: TdxReportCell): TAbstractdxReportCellData; +begin + Result := SubItemClasses[AnIndex].Create(AParent); + FSubItems[AnIndex] := Result; +end; + +function TdxGridTableViewRowSubItemsProducer.IsItemIndent(AnItem: TdxReportVisualItem): Boolean; +begin + Result := FIndents.IndexOf(AnItem) <> -1; +end; + +procedure TdxGridTableViewRowSubItemsProducer.FixupIndentsHeight; +var + I: Integer; +begin + for I := 0 to IndentCount - 1 do + with Indents[I] do + Height := Parent.Height; +end; + +procedure TdxGridTableViewRowSubItemsProducer.FixupRowDataHeight; +var + I: Integer; + SubItem: TdxReportVisualItem; +begin + for I := 0 to SubItemCount - 1 do {.SubItemCount} + begin + SubItem := SubItems[I]; + if SubItem <> nil then + FixupRowDataItemHeight(SubItem); + end; +end; + +procedure TdxGridTableViewRowSubItemsProducer.FixupRowHeight; +begin + inherited; + FixupIndentsHeight; +end; + +procedure TdxGridTableViewRowSubItemsProducer.InitializeIndentList; +begin + FIndents.Clear; + FIndents.Count := GetIndentCount; +end; + +procedure TdxGridTableViewRowSubItemsProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin +end; + +procedure TdxGridTableViewRowSubItemsProducer.InitializeSubItemList; +begin + FSubItems.Clear; + FSubItems.Count := GetSubItemCount; +end; + +function TdxGridTableViewRowSubItemsProducer.GetHasSubItem(Index: Integer): Boolean; +begin + Result := True; +end; + +function TdxGridTableViewRowSubItemsProducer.GetIndentCount: Integer; +begin + Result := 0; +end; + +function TdxGridTableViewRowSubItemsProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := MakeRect(0, 0, -1, -1); +end; + +function TdxGridTableViewRowSubItemsProducer.GetSubItemCount: Integer; +begin + Result := Formatter.ColumnCount; +end; + +function TdxGridTableViewRowSubItemsProducer.GetColumn(Index: Integer): TcxGridColumn; +begin + Result := Formatter.Columns[Index]; +end; + +function TdxGridTableViewRowSubItemsProducer.GetIndent(Index: Integer): TdxReportCellExpandButton; +begin + Result := TdxReportCellExpandButton(FIndents[Index]); +end; + +function TdxGridTableViewRowSubItemsProducer.GetSubItem(Index: Integer): TdxReportVisualItem; +begin + Result := TdxReportVisualItem(FSubItems[Index]); +end; + +{ TdxGridTableViewHeadersProducer } + +procedure TdxGridTableViewHeadersProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeHeaderRow(Row); +end; + +procedure TdxGridTableViewHeadersProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeHeaderItem(ASubItem, AIndex); + Formatter.DoReportLinkInitializeHeaderItem(ASubItem, AIndex); +end; + +function TdxGridTableViewHeadersProducer.GetAutoHeight: Boolean; +begin + Result := inherited GetAutoHeight and Adapter.HeaderAutoHeight; +end; + +function TdxGridTableViewHeadersProducer.GetLineCount: Integer; +begin + Result := Adapter.DetailsLineCount; +end; + +function TdxGridTableViewHeadersProducer.GetLineHeight: Integer; +begin + Result := Formatter.HeaderLineHeight; +end; + +function TdxGridTableViewHeadersProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := Formatter.GetHeaderItemBounds(Index); +end; + +function TdxGridTableViewHeadersProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetHeaderItemClass(Index); +end; + +{ TdxGridTableViewFootersProducer } + +procedure TdxGridTableViewFootersProducer.CalculateRowAutoHeight; +begin + inherited; + Inc(FRowHeight, 2 * FooterItemInflateVert); +end; + +procedure TdxGridTableViewFootersProducer.CalculateRowHeight; +begin + if AutoHeight then + inherited + else + RowHeight := LineCount * LineHeight; +end; + +procedure TdxGridTableViewFootersProducer.FixupRowDataItemHeight(AnItem: TdxReportVisualItem); +begin + with AnItem do + Height := Parent.Height - 2 * FooterItemInflateVert; +end; + +procedure TdxGridTableViewFootersProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeFooterRow(Row); +end; + +procedure TdxGridTableViewFootersProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +var + ARowIndex, ARealIndex, AColIndex: Integer; +begin + inherited; + AColIndex := Adapter.GetFooterItemInfo(SummaryItems, AIndex, ARowIndex); + ARealIndex := Adapter.CheckSummaryItemIndex(SummaryItems, AIndex); + Formatter.DoInitializeFooterItem(ASubItem, ARealIndex, SummaryItems[ARealIndex]); + Formatter.DoReportLinkInitializeFooterItem(ASubItem, AColIndex); +end; + +function TdxGridTableViewFootersProducer.GetAutoHeight: Boolean; +var + I: Integer; +begin + Result := inherited GetAutoHeight and + Adapter.FooterMultiline and Adapter.FooterMultiSummaries; + if Result then + begin + for I := 0 to SubItemCount - 1 do + if HasSubItem[I] then Exit; + Result := False; + end; +end; + +function TdxGridTableViewFootersProducer.GetHasSubItem(Index: Integer): Boolean; +var + ARowIndex: Integer; +begin + Adapter.GetFooterItemInfo(SummaryItems, Index, ARowIndex); + Result := Adapter.FooterMultiSummaries or (ARowIndex = 0); +end; + +function TdxGridTableViewFootersProducer.GetLineCount: Integer; +begin + Result := Adapter.GetFooterLineCount(SummaryItems, Adapter.FooterMultiSummaries); +end; + +function TdxGridTableViewFootersProducer.GetLineHeight: Integer; +begin + Result := Formatter.FooterLineHeight; +end; + +function TdxGridTableViewFootersProducer.GetSubItemBound(Index: Integer): TRect; +var + AColIndex, ARowIndex: Integer; +begin + AColIndex := Adapter.GetFooterItemInfo(SummaryItems, Index, ARowIndex); + Result := Formatter.GetFooterItemBounds(AColIndex); + if Adapter.FooterMultiSummaries then + begin + Result.Top := LineHeight * ARowIndex; + Result.Bottom := Result.Top + LineHeight; + InflateRect(Result, 0, -FooterItemInflateVert); + end; +end; + +function TdxGridTableViewFootersProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetFooterItemClass(Index); +end; + +function TdxGridTableViewFootersProducer.GetSubItemCount: Integer; +begin + Result := Adapter.GetFooterItemCount(SummaryItems, True); +end; + +function TdxGridTableViewFootersProducer.GetSummaryItems: TcxDataSummaryItems; +begin + Result := Adapter.Summary.FooterSummaryItems; +end; + +{ TdxGridTableViewCustomDataRowProducer } + +function TdxGridTableViewCustomDataRowProducer.Produce(AHostInfo: TdxGridAttributeHostInfo; + AGridRow: TcxCustomGridRow; AGridRowIndex: Integer): TdxReportCell; +begin + FGridRow := AGridRow; + FGridRowIndex := AGridRowIndex; + Result := inherited Produce(AHostInfo); + FGridRowIndex := -1; + FGridRow := nil; +end; + +function TdxGridTableViewCustomDataRowProducer.GridRow: TcxCustomGridRow; +begin + Result := FGridRow; +end; + +procedure TdxGridTableViewCustomDataRowProducer.AddIndents(AParent: TdxReportCell); +var + I: Integer; + Indent: TdxReportCellExpandButton; +begin + inherited; + for I := 0 to IndentCount - 1 do + begin + Indent := CreateIndent(I, AParent); + Indent.BoundsRect := IndentBounds[I]; + InitializeIndent(Indent, I); + end; +end; + +function TdxGridTableViewCustomDataRowProducer.CreateIndent(AnIndex: Integer; + AParent: TdxReportCell): TdxReportCellExpandButton; +begin + Result := Formatter.CreateIndent(AParent); + FIndents[AnIndex] := Result; +end; + +procedure TdxGridTableViewCustomDataRowProducer.InitializeIndent(AIndent: TdxReportCellExpandButton; + AIndex: Integer); +begin +end; + +function TdxGridTableViewCustomDataRowProducer.GetIndentCount: Integer; +begin + Result := GridRow.Level; +end; + +function TdxGridTableViewCustomDataRowProducer.GetLineCount: Integer; +begin + Result := 1; +end; + +function TdxGridTableViewCustomDataRowProducer.GetLineHeight: Integer; +begin + Result := DefaultDataRowLineHeight; +end; + +function TdxGridTableViewCustomDataRowProducer.GetIndentArea: Integer; +begin + Result := IndentCount * IndentWidth; +end; + +function TdxGridTableViewCustomDataRowProducer.GetIndentBounds(Index: Integer): TRect; +begin + Result := MakeBounds(IndentWidth * Index, 0, IndentWidth, RowHeight); +end; + +{ TdxCustomGridTableViewRowSeparatorProducer } + +function TdxCustomGridTableViewRowSeparatorProducer.Produce(AHostInfo: TdxGridAttributeHostInfo; + AGridRow: TcxCustomGridRow): TdxReportCell; +begin + Result := inherited Produce(AHostInfo, AGridRow, -1); +end; + +procedure TdxCustomGridTableViewRowSeparatorProducer.InitializeIndent(AIndent: TdxReportCellExpandButton; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeRowSeparatorIndent(AIndent, AIndex, IndentCount, GridRow); +end; + +function TdxCustomGridTableViewRowSeparatorProducer.GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TdxCustomGridTableViewRowSeparatorProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := MakeRect(IndentArea, 0, RowWidth, RowHeight); +end; + +function TdxCustomGridTableViewRowSeparatorProducer.GetSubItemCount: Integer; +begin + Result := 1; +end; + +{ TdxGridTableViewRowSeparatorProducer } + +function TdxGridTableViewRowSeparatorProducer.Produce(AHostInfo: TdxGridAttributeHostInfo; + AGridRow: TcxCustomGridRow; AnIsLast: Boolean): TdxReportCell; +begin + FIsLast := AnIsLast; + Result := inherited Produce(AHostInfo, AGridRow); +end; + +procedure TdxGridTableViewRowSeparatorProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeSeparatorRow(Row); +end; + +procedure TdxGridTableViewRowSeparatorProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + Formatter.DoInitializeRowSeparator(ASubItem); +end; + +function TdxGridTableViewRowSeparatorProducer.GetIndentCount: Integer; +begin + if not IsLast then + begin + Result := inherited GetIndentCount; + if (Result <> 0) and Adapter.IsOffice11StyleGrouping and not (GridRow is TcxGridGroupRow) then {.2} + Dec(Result); + end + else + Result := 0; +end; + +function TdxGridTableViewRowSeparatorProducer.GetLineHeight: Integer; +begin + Result := Formatter.RowSeparatorThickness; +end; + +function TdxGridTableViewRowSeparatorProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetRowSeparatorClass; +end; + +{ TdxGridTableViewGroupRowSeparatorProducer } + +procedure TdxGridTableViewGroupRowSeparatorProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeGroupSeparatorRow(Row); +end; + +procedure TdxGridTableViewGroupRowSeparatorProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeGroupRowSeparator(ASubItem); +end; + +function TdxGridTableViewGroupRowSeparatorProducer.GetLineHeight: Integer; +begin + Result := Formatter.GroupRowSeparatorThickness; +end; + +function TdxGridTableViewGroupRowSeparatorProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetGroupRowSeparatorClass; +end; + +{ TdxGridTableViewDataRowProducer } + +function TdxGridTableViewDataRowProducer.GridRow: TcxGridDataRow; +begin + Result := inherited GridRow as TcxGridDataRow; +end; + +procedure TdxGridTableViewDataRowProducer.AddPreview(AParent: TdxReportCell); +begin + FPreviewItem := CreatePreview(Row); + + PreviewItem.Left := IndentArea; + // We have to set Width before because we use that value for PreviewHeight calculation + PreviewItem.Width := Width - IndentArea; + Formatter.DoInitializePreview(TAbstractdxReportCellData(PreviewItem), PreviewColumn, GridRow); + PreviewItem.Height := PreviewHeight; + PreviewItem.AdjustContent(Formatter.DC); {3.1} +end; + +procedure TdxGridTableViewDataRowProducer.AddSubItems(AParent: TdxReportCell); +begin + inherited; + if HasPreview then AddPreview(AParent); +end; + +procedure TdxGridTableViewDataRowProducer.CalculateRowAutoHeight; +begin + if CellAutoHeight then inherited; + if PreviewItem <> nil then + RowHeight := RowHeight + PreviewItem.Height; +end; + +function TdxGridTableViewDataRowProducer.CreatePreview(AParent: TdxReportCell): TdxReportVisualItem; +begin + Result := GetPreviewClass.Create(AParent); + FPreviewItem := Result; +end; + +function TdxGridTableViewDataRowProducer.DoesItemParticipateInRowAutoHeightCalculation(AnItem: TdxReportVisualItem): Boolean; +var + TableItem: TcxCustomGridTableItem; + Properties: TcxCustomEditProperties; +begin + Result := AnItem <> FPreviewItem; + // 3.2 + if Result and not IsItemIndent(AnItem) then + begin + TableItem := TcxCustomGridTableItem(AnItem.Data); + Properties := Adapter.GetProperties(TableItem, GridRow); + Result := dxPScxCommon.dxPSDataMaps.DoesItemParticipateInAutoHeightCalculation(Properties); + end; +end; + +function TdxGridTableViewDataRowProducer.GetPreviewClass: TdxReportCellDataClass; +begin + Result := Formatter.GetPreviewClass(PreviewColumn, GridRow); +end; + +procedure TdxGridTableViewDataRowProducer.FixupRowDataHeight; +var + NewHeight, I: Integer; + Item: TdxReportVisualItem; +begin + NewHeight := RowHeight; + if PreviewItem <> nil then + Dec(NewHeight, PreviewItem.Height); + + for I := 0 to Row.DataItemCount - 1 do + begin + Item := Row.DataItems[I]; + if Item = PreviewItem then + if PreviewPlace = cxGridTableView.ppTop then + Item.Top := 0 + else + Item.Top := NewHeight + else + if IsItemIndent(Item) then + begin + Item.Top := 0; + Item.Height := RowHeight; + end + else + begin + if CellAutoHeight then + Item.Height := NewHeight; + if HasPreview and (PreviewPlace = cxGridTableView.ppTop) then + Item.Top := Item.Top + PreviewItem.Height; + end; + end; + {3.1} + for I := 0 to Row.CellCount - 1 do + begin + Item := Row.Cells[I]; + if Item = PreviewItem then + if PreviewPlace = cxGridTableView.ppTop then + Item.Top := 0 + else + Item.Top := NewHeight + else + begin + if CellAutoHeight then + Item.Height := NewHeight; + if HasPreview and (PreviewPlace = cxGridTableView.ppTop) then + Item.Top := Item.Top + PreviewItem.Height; + end; + end; +end; + +procedure TdxGridTableViewDataRowProducer.InitializeIndent(AIndent: TdxReportCellExpandButton; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeDataRowIndent(AIndent, AIndex, IndentCount, GridRow); +end; + +procedure TdxGridTableViewDataRowProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeDataRow(Row, GridRow); +end; + +procedure TdxGridTableViewDataRowProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeItem(ASubItem, Columns[AIndex], GridRow, False); + Formatter.DoReportLinkInitializeItem(ASubItem, Columns[AIndex], GridRow); +end; + +function TdxGridTableViewDataRowProducer.GetAutoHeight: Boolean; +begin + Result := CellAutoHeight or HasPreview; +end; + +function TdxGridTableViewDataRowProducer.GetCellAutoHeight: Boolean; +begin + Result := inherited GetAutoHeight and Adapter.CellAutoHeight; +end; + +function TdxGridTableViewDataRowProducer.GetHasPreview: Boolean; +begin + Result := Formatter.HasPreview; +end; + +function TdxGridTableViewDataRowProducer.GetIndentCount: Integer; +begin + Result := inherited GetIndentCount; + if (Result <> 0) and Adapter.IsOffice11StyleGrouping then {.2} + Dec(Result); +end; + +function TdxGridTableViewDataRowProducer.GetLineCount: Integer; +begin + Result := Adapter.DetailsLineCount; +end; + +function TdxGridTableViewDataRowProducer.GetLineHeight: Integer; +begin + if Formatter.HeaderLineCount = 1 then + Result := Formatter.RowHeights[GridRowIndex] + else + Result := Formatter.DetailsLineHeight; +end; + +function TdxGridTableViewDataRowProducer.GetPreviewHeight: Integer; +begin + Result := PreviewLineCount * PreviewLineHeight; +end; + +function TdxGridTableViewDataRowProducer.GetPreviewLineCount: Integer; +begin + if FPreviewItem <> nil then + if not Formatter.PreviewAutoHeight then + begin + Result := PreviewItem.CalculateLineCount(Formatter.DC); + if Result <> Formatter.PreviewMaxLineCount then + Result := Formatter.PreviewMaxLineCount; + end + else + Result := 1 + else + Result := 0; +end; + +function TdxGridTableViewDataRowProducer.GetPreviewLineHeight: Integer; +var + LineHeight: Integer; +begin + if FPreviewItem <> nil then + if Formatter.PreviewAutoHeight then + begin + Result := PreviewItem.MeasureContentHeight(Formatter.DC); + if Formatter.PreviewMaxLineCount <> 0 then + begin + LineHeight := PreviewItem.MeasureFontHeight(Formatter.DC); + if Result > LineHeight * Formatter.PreviewMaxLineCount then + Result := LineHeight * Formatter.PreviewMaxLineCount; + end; + end + else + Result := PreviewItem.MeasureFontHeight(Formatter.DC) + else + Result := 0; +end; + +function TdxGridTableViewDataRowProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := Formatter.GetItemBounds(GridRow, GridRowIndex, Index); +end; + +function TdxGridTableViewDataRowProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetItemClass(Columns[Index], GridRow, False); +end; + +function TdxGridTableViewDataRowProducer.GetPreviewColumn: TcxGridColumn; +begin + Result := Adapter.PreviewColumn; +end; + +function TdxGridTableViewDataRowProducer.GetPreviewPlace: TcxGridPreviewPlace; +begin + Result := Adapter.PreviewPlace; +end; + +{ TdxGridTableViewGroupRowProducer} + +function TdxGridTableViewGroupRowProducer.GridRow: TcxGridGroupRow; +begin + Result := inherited GridRow as TcxGridGroupRow; +end; + +function TdxGridTableViewGroupRowProducer.Produce(AHostInfo: TdxGridAttributeHostInfo; + AGridRow: TcxCustomGridRow; AGridRowIndex: Integer): TdxReportCell; +begin + SummaryItemInfoList := TcxObjectList.Create; + try + Result := inherited Produce(AHostInfo, AGridRow, AGridRowIndex); + finally + FreeAndNil(SummaryItemInfoList); + end; +end; + +procedure TdxGridTableViewGroupRowProducer.AddSubItems(AParent: TdxReportCell); +var + I: Integer; + Item: TAbstractdxReportCellData; +begin + for I := GetSubItemCount - 1 downto 0 do + if HasSubItem[I] then + begin + Item := CreateSubItem(I, AParent); + Item.BoundsRect := SubItemBounds[I]; // needed before item initialization + Item.Data := Integer(SummaryItemInfos[I]); + InitializeSubItem(Item, I); + end; +end; + +procedure TdxGridTableViewGroupRowProducer.AddSummaryGroupInfo( + AItem: TcxDataSummaryItem; const ADisplayText: string); +var + AInfo: TcxGridSummaryItemInfo; +begin + if ADisplayText = '' then Exit; + AInfo := TcxGridSummaryItemInfo.Create; + if AItem <> nil then + AInfo.Column := TcxGridColumn(AItem.ItemLink); + if (AInfo.Column <> nil) and (AInfo.Column.VisibleIndex < 0) then Exit; + if not Formatter.AlignSummaryWithColumns or ((AInfo.Column <> nil) and (AInfo.Column.VisibleIndex < 0)) then + AInfo.Column := nil; + if AInfo.Column <> nil then + begin + Formatter.Adapter.Styles.GetGroupSummaryCellContentParams( + GridRow, AItem, AInfo.ViewParams); + AInfo.ViewParams.Color := RowViewParams.Color; + AInfo.ViewParams.Bitmap := RowViewParams.Bitmap; + end + else + AInfo.ViewParams := RowViewParams; + AInfo.DisplayText := ADisplayText; + if AItem <> nil then + AInfo.SummaryIndex := AItem.Index; + AInfo.Bounds := MakeRect(IndentArea, 0, RowWidth, LineHeight); + SummaryItemInfoList.Add(AInfo); +end; + +procedure TdxGridTableViewGroupRowProducer.DeleteInfo(AIndex: Integer); +begin + SummaryItemInfoList.Items[AIndex].Free; + SummaryItemInfoList.Delete(AIndex); +end; + +procedure TdxGridTableViewGroupRowProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeGroupRow(Row, GridRow); +end; + +procedure TdxGridTableViewGroupRowProducer.InitializeIndent( + AIndent: TdxReportCellExpandButton; AIndex: Integer); +begin + inherited; + Formatter.DoInitializeGroupRowIndent(AIndent, AIndex, IndentCount, GridRow); +end; + +procedure TdxGridTableViewGroupRowProducer.InitializeSubItem( + ASubItem: TAbstractdxReportCellData; AIndex: Integer); +const + Alignment2TextAlign: array[TAlignment] of TdxTextAlignX = + (taLeft, taRight, taCenterX); +begin + inherited; + Formatter.DoInitializeGroupRowItem(ASubItem, GridRow, + AIndex, SummaryItemInfos[AIndex].DisplayText); + if AIndex <> 0 then + begin + ASubItem.CellSides := []; + TdxReportCellString(ASubItem).TextAlignX := + Alignment2TextAlign[SummaryItemInfos[AIndex].Column.GroupSummaryAlignment]; + TdxReportCellString(ASubItem).EndEllipsis := True; + end; +end; + +procedure TdxGridTableViewGroupRowProducer.InitializeSubItemList; +begin + SummaryItemInfoList.Clear; + PrepareSummaryItemsInfo; + PrepareSummaryItemsBounds; + inherited InitializeSubItemList; +end; + +function TdxGridTableViewGroupRowProducer.GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TdxGridTableViewGroupRowProducer.GetIndentCount: Integer; +begin + Result := inherited GetIndentCount + 1; +end; + +function TdxGridTableViewGroupRowProducer.GetLineCount: Integer; +begin + Result := 1; +end; + +function TdxGridTableViewGroupRowProducer.GetLineHeight: Integer; +begin + Result := Formatter.RowHeights[GridRowIndex];//}Formatter.GroupRowLineHeight; {3.1} +end; + +function TdxGridTableViewGroupRowProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := SummaryItemInfos[Index].Bounds; +end; + +function TdxGridTableViewGroupRowProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetGroupRowClass; +end; + +function CompareSummaryItemsInfo(AInfo1, AInfo2: TcxGridSummaryItemInfo): Integer; +begin + if AInfo1.Column = AInfo2.Column then + Result := AInfo1.SummaryIndex - AInfo2.SummaryIndex + else + if AInfo1.Column = nil then + Result := -1 + else + if AInfo2.Column = nil then + Result := 1 + else + Result := AInfo1.Column.VisibleIndex - AInfo2.Column.VisibleIndex; +end; + +function TdxGridTableViewGroupRowProducer.GetSubItemCount: Integer; +begin + Result := SummaryItemInfoList.Count; +end; + +procedure TdxGridTableViewGroupRowProducer.PrepareSummaryItemsInfo; +var + I: Integer; + S: string; + AValues: PVariant; + AItems: TcxDataSummaryItems; +begin + if not GridRow.GetGroupSummaryInfo(AItems, AValues) then Exit; + Formatter.Adapter.Styles.GetGroupParams(GridRow, GridRow.Level, RowViewParams); + for I := 0 to AItems.Count - 1 do + if AItems[I].Position = spGroup then + AddSummaryGroupInfo(AItems[I], AItems[I].FormatValue(AValues^[I], False)); + SummaryItemInfoList.Sort(@CompareSummaryItemsInfo); + I := 0; + with GridRow.GroupSummaryItems do + begin + while I < SubItemCount do + begin + with SummaryItemInfos[I] do + begin + if (I < (SubItemCount - 1)) and (Column = SummaryItemInfos[I + 1].Column) then + begin + DisplayText := DisplayText + Separator + ' ' + SummaryItemInfos[I + 1].DisplayText; + DeleteInfo(I + 1); + Continue; + end + else + Inc(I); + end; + end; + if (SubItemCount > 0) and (SummaryItemInfos[0].Column = nil) then + begin + with GridRow.GroupSummaryItems do + SummaryItemInfos[0].DisplayText := GridRow.DisplayCaption + BeginText + + SummaryItemInfos[0].DisplayText + EndText; + cxGridCustomTableView.TcxCustomGridTableItemAccess.DoGetDisplayText( + GridRow.GroupedColumn, GridRow, SummaryItemInfos[0].DisplayText); + end + else + begin + S := GridRow.DisplayCaption; + if SubItemCount = 0 then + begin + S := GridRow.DisplayText;; + cxGridCustomTableView.TcxCustomGridTableItemAccess.DoGetDisplayText( + GridRow.GroupedColumn, GridRow, S); + end; + AddSummaryGroupInfo(nil, S); + SummaryItemInfoList.Exchange(0, SubItemCount - 1); + end; + end; +end; + +procedure TdxGridTableViewGroupRowProducer.PrepareSummaryItemsBounds; +var + I, AMinLeft: Integer; + AItem: TcxGridSummaryItemInfo; +begin + if SubItemCount = 0 then Exit; + AItem := SummaryItemInfos[0]; + AMinLeft := AItem.Bounds.Left + + cxTextWidth(AItem.ViewParams.Font, AItem.DisplayText) + cxTextOffset * 2; + I := 1; + while I < SubItemCount do + begin + AItem := SummaryItemInfos[I]; + with Formatter.GetHeaderItemBounds(SummaryItemInfos[I].Column.VisibleIndex) do + begin + AItem.Bounds.Left := Left; + AItem.Bounds.Right := Right; + end; + if AItem.Bounds.Left < AMinLeft then + AItem.Bounds.Left := AMinLeft; + if AItem.Bounds.Left >= AItem.Bounds.Right then + DeleteInfo(I) + else + Inc(I); + end; +end; + +function TdxGridTableViewGroupRowProducer.GetSummaryItemInfo( + Index: Integer): TcxGridSummaryItemInfo; +begin + Result := SummaryItemInfoList[Index] as TcxGridSummaryItemInfo; +end; + +{ TdxGridTableViewMasterRowProducer } + +function TdxGridTableViewMasterRowProducer.GridRow: TcxGridMasterDataRow; +begin + Result := inherited GridRow as TcxGridMasterDataRow; +end; + +procedure TdxGridTableViewMasterRowProducer.InitializeIndent(AIndent: TdxReportCellExpandButton; + AIndex: Integer); +begin + //inherited; + Formatter.DoInitializeMasterDataRowIndent(AIndent, AIndex, IndentCount, GridRow); +end; + +procedure TdxGridTableViewMasterRowProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + if AIndex = 0 then + ASubItem.CellSides := ASubItem.CellSides - [csLeft]; +end; + +function TdxGridTableViewMasterRowProducer.GetIndentCount: Integer; +begin + Result := inherited GetIndentCount + 1; +end; + +{ TdxGridTableViewGroupFooterProducer } + +function TdxGridTableViewGroupFooterProducer.Produce(AHostInfo: TdxGridAttributeHostInfo; + AGridRow: TcxCustomGridRow; AGroupLevel, AnIndex: Integer): TdxReportCell; +begin + FGroupLevel := AGroupLevel; + FIndex := AnIndex; + Adapter.Summary.GetGroupSummaryInfo(GetCorrectRowIndex(AGridRow, + AGroupLevel), SummaryItems, SummaryValues); + FInternalLineCount := Adapter.GetFooterLineCount( + SummaryItems, Adapter.GroupFooterMultiSummaries); + Result := inherited Produce(AHostInfo, AGridRow, -1); + FGroupLevel := -1; +end; + +procedure TdxGridTableViewGroupFooterProducer.AddSubItems(AParent: TdxReportCell); + + function SubstituteParent(AParent: TdxReportCell): TdxReportCell; + begin + Result := TdxReportCell.Create(AParent); + Result.BoundsRect := HostBounds; + Formatter.DoInitializeGroupFooterHost(Result, GridRow, GroupLevel); + end; + +begin + FItemsSite := SubstituteParent(AParent); + inherited AddSubItems(ItemsSite); +end; + +procedure TdxGridTableViewGroupFooterProducer.CalculateRowAutoHeight; +begin + inherited; + Inc(FRowHeight, FooterItemInflateVert); +end; + +procedure TdxGridTableViewGroupFooterProducer.FixupRowDataItemHeight(AnItem: TdxReportVisualItem); +begin + with AnItem do + Height := Parent.Height - 2 * FooterItemInflateVert; +end; + +procedure TdxGridTableViewGroupFooterProducer.InitializeIndent(AIndent: TdxReportCellExpandButton; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeGroupFooterIndent(AIndent, AIndex, IndentCount, GridRow); +end; + +procedure TdxGridTableViewGroupFooterProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeGroupFooterRow(Row, GridRow, GroupLevel); +end; + +procedure TdxGridTableViewGroupFooterProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + AIndex := Adapter.CheckSummaryItemIndex(SummaryItems, AIndex); + Formatter.DoInitializeGroupFooterItem(ASubItem, + GridRow, GroupLevel, SummaryValues^[AIndex], SummaryItems[AIndex]); + Formatter.DoReportLinkInitializeGroupFooterItem(ASubItem, + TcxGridColumn(SummaryItems[AIndex].ItemLink), GridRow, GroupLevel); +end; + +function TdxGridTableViewGroupFooterProducer.GetAutoHeight: Boolean; +begin + Result := inherited GetAutoHeight and Adapter.GroupFootersMultiline and + ((ItemsSite.DataItemCount <> 0) or (ItemsSite.CellCount <> 0)); +end; + +function TdxGridTableViewGroupFooterProducer.GetCorrectRowIndex( + AGridRow: TcxCustomGridRow; AGroupLevel: Integer): Integer; +begin + if Adapter.GroupFootersMode = gfVisibleWhenExpanded then + Dec(AGroupLevel); + while (AGridRow.Level > AGroupLevel) and (AGridRow.Level > 0) do + AGridRow := TcxCustomGridRow(AGridRow.ParentRecord); + Result := AGridRow.Index; +end; + +function TdxGridTableViewGroupFooterProducer.GetHasSubItem(Index: Integer): Boolean; +begin + Result := True; +end; + +function TdxGridTableViewGroupFooterProducer.GetIndentCount: Integer; +begin + Result := GroupLevel; + if Adapter.GroupFootersMode = gfVisibleWhenExpanded then + begin + Inc(Result); + if Adapter.IsOffice11StyleGrouping and (Index = 0) and not (GridRow is TcxGridGroupRow) then + Dec(Result); + end +end; + +function TdxGridTableViewGroupFooterProducer.GetItemsSite: TdxReportCell; +begin + Result := FItemsSite; +end; + +function TdxGridTableViewGroupFooterProducer.GetLineCount: Integer; +begin + Result := InternalLineCount; +end; + +function TdxGridTableViewGroupFooterProducer.GetLineHeight: Integer; +begin + Result := Formatter.GroupFooterLineHeight; +end; + +function TdxGridTableViewGroupFooterProducer.GetSubItemBound(Index: Integer): TRect; +var + AColIndex, ARowIndex: Integer; +begin + AColIndex := Adapter.GetFooterItemInfo(SummaryItems, Index, ARowIndex); + Result := Formatter.GetGroupFooterItemBounds(AColIndex, IndentCount); + if Adapter.GroupFooterMultiSummaries then + begin + Result.Top := LineHeight * ARowIndex; + Result.Bottom := Result.Top + LineHeight; + InflateRect(Result, 0, -FooterItemInflateVert); + end; +end; + +function TdxGridTableViewGroupFooterProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetGroupFooterItemClass(Index); +end; + +function TdxGridTableViewGroupFooterProducer.GetSubItemCount: Integer; +begin + Result := Adapter.GetFooterItemCount( + SummaryItems, Adapter.GetGroupFooterMultiSummaries) +end; + +function TdxGridTableViewGroupFooterProducer.GetGroupLevel: Integer; +begin + Result := FGroupLevel; + if Adapter.GroupFootersMode = gfVisibleWhenExpanded then + Dec(Result); +end; + +function TdxGridTableViewGroupFooterProducer.GetHostBounds: TRect; +begin + Result := MakeRect(IndentArea, 0, Row.Width, Row.Height); +end; + +{ TdxGridTableViewBandsProducer } + +function TdxGridTableViewBandsProducer.Adapter: TdxGridBandedTableViewAdapter; +begin + Result := inherited Adapter as TdxGridBandedTableViewAdapter; +end; + +function TdxGridTableViewBandsProducer.Builder: TdxGridBandedTableViewBuilder; +begin + Result := inherited Builder as TdxGridBandedTableViewBuilder; +end; + +function TdxGridTableViewBandsProducer.Formatter: TdxGridBandedTableViewFormatter; +begin + Result := inherited Formatter as TdxGridBandedTableViewFormatter; +end; + +function TdxGridTableViewBandsProducer.GetSubItemCount: Integer; +begin + Result := Formatter.BandCount; +end; + +procedure TdxGridTableViewBandsProducer.CalculateRowHeight; +begin + FRowHeight := Formatter.ItemPlaceController.Height; +end; + +procedure TdxGridTableViewBandsProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeBandRow(Row); +end; + +procedure TdxGridTableViewBandsProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeBandItem(ASubItem, AIndex); + Formatter.DoReportLinkInitializeBandItem(ASubItem, AIndex); +end; + +function TdxGridTableViewBandsProducer.GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TdxGridTableViewBandsProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := Formatter.GetBandItemBounds(Index); +end; + +function TdxGridTableViewBandsProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetBandItemClass(Index); +end; + +{ TdxGridCardViewCardsRowProducer } + +function TdxGridCardViewCardsRowProducer.Adapter: TdxGridCardViewAdapter; +begin + Result := inherited Adapter as TdxGridCardViewAdapter; +end; + +function TdxGridCardViewCardsRowProducer.Builder: TdxGridCardViewBuilder; +begin + Result := inherited Builder as TdxGridCardViewBuilder; +end; + +function TdxGridCardViewCardsRowProducer.Formatter: TdxGridCardViewFormatter; +begin + Result := inherited Formatter as TdxGridCardViewFormatter; +end; + +function TdxGridCardViewCardsRowProducer.CreateCard(AParent: TdxReportCell; + AGridCard: TcxGridCard): TdxReportCard; +begin + Result := Formatter.GetCardClass(AGridCard).CreateEx(AParent, AGridCard); + Formatter.DoInitializeCard(Result, AGridCard); +end; + +procedure TdxGridCardViewCardsRowProducer.InjectCard(ACard: TdxReportCard; + AIndex: Integer); +begin + ACard.Parent := Row; + ACard.Left := Formatter.InterCardsSpaceHorz div 2 + + AIndex * (Builder.MaxCardWidth + Formatter.InterCardsSpaceHorz); + ACard.Top := Formatter.InterCardsSpaceVert div 2; +end; + +function TdxGridCardViewCardsRowProducer.Produce(AHostInfo: TdxGridAttributeHostInfo; + ARowHeight: Integer): TdxReportCell; +begin + FRowHeight := ARowHeight; + Result := inherited Produce(AHostInfo); +end; + +procedure TdxGridCardViewCardsRowProducer.CalculateRowHeight; +begin +end; + +function TdxGridCardViewCardsRowProducer.GetAutoHeight: Boolean; +begin + Result := False; +end; + +procedure TdxGridCardViewCardsRowProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeCardsRow(Row); +end; + +{$IFDEF CHARTVIEW} +{ TdxGridViewChartRowProducer } + +function TdxGridChartViewChartProducer.Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; +begin + try + Result := inherited Produce(AHostInfo); + finally + FreeAndNil(FChartImage); + end; +end; + +function TdxGridChartViewChartProducer.Formatter: TdxGridChartViewFormatter; +begin + Result := inherited Formatter as TdxGridChartViewFormatter; +end; + +procedure TdxGridChartViewChartProducer.CalculateRowHeight; +begin + if ChartImage <> nil then + RowHeight := ChartImage.Height + else + inherited; +end; + +procedure TdxGridChartViewChartProducer.InitializeItem; +begin + inherited; + Item.Image := ChartImage; + + Formatter.DoInitializeChartItem(Item); + Formatter.DoReportLinkInitializeChartItem(Item); +end; + +function TdxGridChartViewChartProducer.GetItemClass: TdxReportCellDataClass; +begin + Result := Formatter.GetChartItemClass; +end; + +function TdxGridChartViewChartProducer.GetChartImage: TGraphic; +begin + if FChartImage = nil then + FChartImage := Formatter.CreateChartImage; + Result := FChartImage; +end; + +function TdxGridChartViewChartProducer.GetItem: TdxReportCellGraphic; +begin + Result := inherited Item as TdxReportCellGraphic; +end; + +{$ENDIF} + +{ TdxGridReportLinkOptions } + +function TdxGridReportLinkOptions.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +{ TdxGridReportLinkOptionsCardsShadow } + +constructor TdxGridReportLinkCardsShadow.Create(AnOptionsCards: TdxGridReportLinkOptionsCards); +begin + inherited Create; + RestoreDefaults; + FOptionsCards := AnOptionsCards; +end; + +procedure TdxGridReportLinkCardsShadow.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkCardsShadow then + with TdxGridReportLinkCardsShadow(Source) do + begin + Self.Color := Color; + Self.Depth := Depth; + Self.Position := Position; + end + else + inherited; +end; + +procedure TdxGridReportLinkCardsShadow.RestoreDefaults; +begin + inherited; + Color := clDefault; + Depth := dxDefaultCardsShadowDepth; + Position := cspBottomRight; +end; + +procedure TdxGridReportLinkCardsShadow.Changed; +begin + if OptionsCards <> nil then OptionsCards.Changed; +end; + +function TdxGridReportLinkCardsShadow.GetActualColor: TColor; +begin + Result := Color; + if Result = clDefault then + Result := dxDefaultCardsShadowColor; +end; + +function TdxGridReportLinkCardsShadow.GetVisible: Boolean; +begin + Result := Depth <> 0; +end; + +procedure TdxGridReportLinkCardsShadow.SetColor(Value: TColor); +begin + if FColor <> Value then + begin + FColor := Value; + if Visible then Changed; + end; +end; + +procedure TdxGridReportLinkCardsShadow.SetDepth(Value: TdxGridCardShadowDepth); +begin + if FDepth <> Value then + begin + FDepth := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkCardsShadow.SetPosition(Value: TdxGridCardShadowPosition); +begin + if FPosition <> Value then + begin + FPosition := Value; + if Visible then Changed; + end; +end; + +{ TdxGridReportLinkOptionsCards } + +destructor TdxGridReportLinkOptionsCards.Destroy; +begin + FreeAndNil(FShadow); + inherited; +end; + +procedure TdxGridReportLinkOptionsCards.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsCards then + with TdxGridReportLinkOptionsCards(Source) do + begin + Self.AutoWidth := AutoWidth; + Self.Borders := Borders; + Self.InterCardsSpaceHorz := InterCardsSpaceHorz; + Self.InterCardsSpaceVert := InterCardsSpaceVert; + Self.KeepSameHeight := KeepSameHeight; + Self.KeepSameWidth := KeepSameWidth; + Self.RowBordersHorz := RowBordersHorz; + Self.RowBordersVert := RowBordersVert; + Self.Shadow := Shadow; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsCards.RestoreDefaults; +begin + inherited; + AutoWidth := False; + Borders := True; + InterCardsSpaceHorz := dxDefaultInterCardsSpaceHorz; + InterCardsSpaceVert := dxDefaultInterCardsSpaceVert; + KeepSameHeight := True; + KeepSameWidth := True; + RowBordersHorz := False; + RowBordersVert := False; + Shadow.RestoreDefaults; +end; + +function TdxGridReportLinkOptionsCards.DesignerTabIndex: Integer; +begin + Result := 5; +end; + +function TdxGridReportLinkOptionsCards.GetShadowClass: TdxGridReportLinkCardsShadowClass; +begin + Result := TdxGridReportLinkCardsShadow; +end; + +function TdxGridReportLinkOptionsCards.GetShadow: TdxGridReportLinkCardsShadow; +begin + if FShadow = nil then + FShadow := GetShadowClass.Create(Self); + Result := FShadow; +end; + +procedure TdxGridReportLinkOptionsCards.SetAutoWidth(Value: Boolean); +begin + if FAutoWidth <> Value then + begin + FAutoWidth := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetBorders(Value: Boolean); +begin + if FBorders <> Value then + begin + FBorders := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetInterCardsSpaceHorz(Value: Integer); +begin + if Value < 0 then Value := 0; + if FInterCardsSpaceHorz <> Value then + begin + FInterCardsSpaceHorz := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetInterCardsSpaceVert(Value: Integer); +begin + if Value < 0 then Value := 0; + if FInterCardsSpaceVert <> Value then + begin + FInterCardsSpaceVert := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetKeepSameHeight(Value: Boolean); +begin + if FKeepSameHeight <> Value then + begin + FKeepSameHeight := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetKeepSameWidth(Value: Boolean); +begin + if FKeepSameWidth <> Value then + begin + FKeepSameWidth := Value; + if AutoWidth then Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetRowBordersHorz(Value: Boolean); +begin + if FRowBordersHorz <> Value then + begin + FRowBordersHorz := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetRowBordersVert(Value: Boolean); +begin + if FRowBordersVert <> Value then + begin + FRowBordersVert := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetShadow(Value: TdxGridReportLinkCardsShadow); +begin + Shadow.Assign(Value); +end; + +{ TdxGridReportLinkOptionsPagination } + +procedure TdxGridReportLinkOptionsPagination.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsPagination then + with TdxGridReportLinkOptionsPagination(Source) do + begin + Self.OneGroupPerPage := OneGroupPerPage; + Self.TopLevelGroup := TopLevelGroup; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsPagination.RestoreDefaults; +begin + inherited; + OneGroupPerPage := False; + TopLevelGroup := False; +end; + +function TdxGridReportLinkOptionsPagination.DesignerTabIndex: Integer; +begin + Result := 2; +end; + +function TdxGridReportLinkOptionsPagination.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +procedure TdxGridReportLinkOptionsPagination.SetOneGroupPerPage(Value: Boolean); +begin + if FOneGroupPerPage <> Value then + begin + FOneGroupPerPage := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsPagination.SetTopLevelGroup(Value: Boolean); +begin + if FTopLevelGroup <> Value then + begin + FTopLevelGroup := Value; + Changed; + end; +end; + +{$IFDEF CHARTVIEW} +{ TdxGridReportLinkOptionsCharts } + +procedure TdxGridReportLinkOptionsCharts.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsCharts then + with TdxGridReportLinkOptionsCharts(Source) do + begin + Self.GraphicClass := GraphicClass; + Self.Transparent := Transparent; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsCharts.RestoreDefaults; +begin + inherited; + FIsGraphicClassAssigned := False; + Transparent := False; +end; + +function TdxGridReportLinkOptionsCharts.DefaultGraphicClass: TGraphicClass; +begin + Result := TBitmap; +end; + +function TdxGridReportLinkOptionsCharts.SupportsGraphicClass(AGraphicClass: TGraphicClass): Boolean; +begin + Result := (AGraphicClass <> nil) and not AGraphicClass.InheritsFrom(TIcon); +end; + +function TdxGridReportLinkOptionsCharts.DesignerTabIndex: Integer; +begin + Result := 6; +end; + +function TdxGridReportLinkOptionsCharts.GetGraphicClass: TGraphicClass; +begin + if FIsGraphicClassAssigned then + Result := FGraphicClass + else + Result := DefaultGraphicClass; +end; + +function TdxGridReportLinkOptionsCharts.GetGraphicClassName: string; +begin + Result := GraphicClass.ClassName; +end; + +function TdxGridReportLinkOptionsCharts.IsGraphicClassNameStored: Boolean; +begin + Result := FIsGraphicClassAssigned; +end; + +procedure TdxGridReportLinkOptionsCharts.SetGraphicClass(Value: TGraphicClass); +begin + if Value = nil then + Value := DefaultGraphicClass; + if (GraphicClass <> Value) and SupportsGraphicClass(Value) then + begin + FGraphicClass := Value; + FIsGraphicClassAssigned := Value <> DefaultGraphicClass; + end; +end; + +procedure TdxGridReportLinkOptionsCharts.SetGraphicClassName(const Value: string); +var + AClass: TClass; +begin + AClass := Classes.GetClass(Value); + if (AClass <> nil) and AClass.InheritsFrom(TGraphic) then + GraphicClass := TGraphicClass(AClass) + else + GraphicClass := nil; +end; + +procedure TdxGridReportLinkOptionsCharts.SetTransparent(Value: Boolean); +begin + if FTransparent <> Value then + begin + FTransparent := Value; + Changed; + end; +end; + +{$ENDIF} + +{ TdxGridReportLinkOptionsDetails } + +procedure TdxGridReportLinkOptionsDetails.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsDetails then + with TdxGridReportLinkOptionsDetails(Source) do + begin + Self.OnlyFocusedView := OnlyFocusedView; + Self.StartFromFocusedView := StartFromFocusedView; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsDetails.RestoreDefaults; +begin + inherited; + OnlyFocusedView := False; + StartFromFocusedView := False; +end; + +function TdxGridReportLinkOptionsDetails.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +procedure TdxGridReportLinkOptionsDetails.SetOnlyFocusedView(Value: Boolean); +begin + if FOnlyFocusedView <> Value then + begin + FOnlyFocusedView := Value; + if StartFromFocusedView then Changed; + end; +end; + +procedure TdxGridReportLinkOptionsDetails.SetStartFromFocusedView(Value: Boolean); +begin + if FStartFromFocusedView <> Value then + begin + FStartFromFocusedView := Value; + Changed; + end; +end; + +{ TdxGridReportLinkOptionsExpanding } + +procedure TdxGridReportLinkOptionsExpanding.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsExpanding then + with TdxGridReportLinkOptionsExpanding(Source) do + begin + {$IFDEF DXVER500} + Self.ExpandCards := ExpandCards; + {$ENDIF} + Self.ExpandGroupRows := ExpandGroupRows; + Self.ExpandMasterRows := ExpandMasterRows; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsExpanding.RestoreDefaults; +begin + inherited; + {$IFDEF DXVER500} + ExpandCards := False; + {$ENDIF} + ExpandGroupRows := False; + ExpandMasterRows := False; +end; + +function TdxGridReportLinkOptionsExpanding.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +function TdxGridReportLinkOptionsExpanding.GetHasAny: Boolean; +begin + Result := ExpandGroupRows or ExpandMasterRows {$IFDEF DXVER500} or ExpandCards {$ENDIF}; +end; + +function TdxGridReportLinkOptionsExpanding.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +{$IFDEF DXVER500} +procedure TdxGridReportLinkOptionsExpanding.SetExpandCards(Value: Boolean); +begin + if FExpandCards <> Value then + begin + FExpandCards := Value; + Changed; + end; +end; +{$ENDIF} + +procedure TdxGridReportLinkOptionsExpanding.SetExpandGroupRows(Value: Boolean); +begin + if FExpandGroupRows <> Value then + begin + FExpandGroupRows := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsExpanding.SetExpandMasterRows(Value: Boolean); +begin + if FExpandMasterRows <> Value then + begin + FExpandMasterRows := Value; + Changed; + end; +end; + +{ TdxGridReportLinkOptionsFormatting } + +procedure TdxGridReportLinkOptionsFormatting.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsFormatting then + with TdxGridReportLinkOptionsFormatting(Source) do + begin + Self.ConsumeSelectionStyle := ConsumeSelectionStyle; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsFormatting.RestoreDefaults; +begin + inherited; + ConsumeSelectionStyle := False; +end; + +function TdxGridReportLinkOptionsFormatting.DesignerTabIndex: Integer; +begin + Result := 2; +end; + +function TdxGridReportLinkOptionsFormatting.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +procedure TdxGridReportLinkOptionsFormatting.SetConsumeSelectionStyle(Value: Boolean); +begin + if FConsumeSelectionStyle <> Value then + begin + FConsumeSelectionStyle := Value; + Changed; + end; +end; + +{ TdxGridReportLinkOptionsLevels } + +{ TdxGridReportLinkOptionsLevels } + +procedure TdxGridReportLinkOptionsLevels.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsLevels then + with TdxGridReportLinkOptionsLevels(Source) do + begin + Self.RiseActiveLevelOntoTop := RiseActiveLevelOntoTop; + Self.SkipEmptyViews := SkipEmptyViews; + Self.Unwrap := Unwrap; + Self.UnwrapTopLevel := UnwrapTopLevel; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsLevels.RestoreDefaults; +begin + inherited; + RiseActiveLevelOntoTop := True; + SkipEmptyViews := True; + Unwrap := False; + UnwrapTopLevel := True; +end; + +function TdxGridReportLinkOptionsLevels.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +procedure TdxGridReportLinkOptionsLevels.SetRiseActiveLevelOntoTop(Value: Boolean); +begin + if FRiseActiveLevelOntoTop <> Value then + begin + FRiseActiveLevelOntoTop := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsLevels.SetSkipEmptyViews(Value: Boolean); +begin + if FSkipEmptyViews <> Value then + begin + FSkipEmptyViews := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsLevels.SetUnwrap(Value: Boolean); +begin + if FUnwrap <> Value then + begin + FUnwrap := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsLevels.SetUnwrapTopLevel(Value: Boolean); +begin + if FUnwrapTopLevel <> Value then + begin + FUnwrapTopLevel := Value; + Changed; + end; +end; + +{ TdxGridReportLinkOptionsOnEveryPage } + +procedure TdxGridReportLinkOptionsOnEveryPage.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsOnEveryPage then + with TdxGridReportLinkOptionsOnEveryPage(Source) do + begin + Self.Caption := Caption; + Self.FilterBar := FilterBar; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsOnEveryPage.RestoreDefaults; +begin + inherited; + Caption := True; + FilterBar := True; +end; + +function TdxGridReportLinkOptionsOnEveryPage.HasInstalledAttribute(AnAttribute: TdxGridAttributeClass): Boolean; +begin + if AnAttribute.InheritsFrom(TdxGridLevelCaption) then + Result := Caption + else + if AnAttribute.InheritsFrom(TdxGridBandHeader) then + Result := BandHeaders + else + if AnAttribute.InheritsFrom(TdxGridHeader) then + Result := Headers + else + if AnAttribute.InheritsFrom(TdxGridFooter) then + Result := Footers + else + if AnAttribute.InheritsFrom(TdxGridFilterBar) then + Result := FilterBar + else + Result := False; +end; + +procedure TdxGridReportLinkOptionsOnEveryPage.SetAll; +begin + BandHeaders := True; + Caption := True; + FilterBar := True; + Footers := True; + Headers := True; +end; + +procedure TdxGridReportLinkOptionsOnEveryPage.UnsetAll; +begin + BandHeaders := False; + Caption := False; + FilterBar := False; + Footers := False; + Headers := False; +end; + +function TdxGridReportLinkOptionsOnEveryPage.DesignerTabIndex: Integer; +begin + Result := 0; +end; + +function TdxGridReportLinkOptionsOnEveryPage.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +procedure TdxGridReportLinkOptionsOnEveryPage.SetCaption(Value: Boolean); +begin + if FCaption <> Value then + begin + FCaption := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsOnEveryPage.SetFilterBar(Value: Boolean); +begin + if FFilterBar <> Value then + begin + FFilterBar := Value; + Changed; + end; +end; + +{ TdxGridReportLinkOptionsPreview } + +function TdxGridReportLinkOptionsPreview.DesignerTabIndex: Integer; +begin + Result := 4; +end; + +function TdxGridReportLinkOptionsPreview.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +{ TdxGridReportLinkOptionsRefinements } + +function TdxGridReportLinkOptionsRefinements.DesignerTabIndex: Integer; +begin + Result := 2; +end; + +function TdxGridReportLinkOptionsRefinements.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +{ TdxGridReportLinkOptionsSelection } + +function TdxGridReportLinkOptionsSelection.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +function TdxGridReportLinkOptionsSelection.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +{ TdxGridReportLinkOptionsSize } + +function TdxGridReportLinkOptionsSize.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +function TdxGridReportLinkOptionsSize.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +{ TdxGridReportLinkOptionsView } + +procedure TdxGridReportLinkOptionsView.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsView then + with TdxGridReportLinkOptionsView(Source) do + begin + Self.Caption := Caption; + Self.FilterBar := FilterBar; + Self.GroupFooters := GroupFooters; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsView.RestoreDefaults; +begin + inherited; + Caption := True; + FilterBar := True; + GroupFooters := True; +end; + +function TdxGridReportLinkOptionsView.HasInstalledAttribute(AnAttribute: TdxGridAttributeClass): Boolean; +begin + if AnAttribute.InheritsFrom(TdxGridLevelCaption) then + Result := Caption + else + if AnAttribute.InheritsFrom(TdxGridBandHeader) then + Result := BandHeaders + else + if AnAttribute.InheritsFrom(TdxGridHeader) then + Result := Headers + else + if AnAttribute.InheritsFrom(TdxGridFooter) then + Result := Footers + else + if AnAttribute.InheritsFrom(TdxGridFilterBar) then + Result := FilterBar + else + Result := False; +end; + +procedure TdxGridReportLinkOptionsView.SetAll; +begin + BandHeaders := True; + Caption := True; + FilterBar := True; + Footers := True; + GroupFooters := True; + Headers := True; + ExpandButtons := True; +end; + +procedure TdxGridReportLinkOptionsView.UnsetAll; +begin + BandHeaders := False; + Caption := False; + FilterBar := False; + Footers := False; + GroupFooters := False; + Headers := False; + ExpandButtons := False; +end; + +function TdxGridReportLinkOptionsView.DesignerTabIndex: Integer; +begin + Result := 0; +end; + +function TdxGridReportLinkOptionsView.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +procedure TdxGridReportLinkOptionsView.SetCaption(Value: Boolean); +begin + if FCaption <> Value then + begin + FCaption := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsView.SetFilterBar(Value: Boolean); +begin + if FFilterBar <> Value then + begin + FFilterBar := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsView.SetGroupFooters(Value: Boolean); +begin + if FGroupFooters <> Value then + begin + FGroupFooters := Value; + Changed; + end; +end; + +{ TdxGridAttributeHostInfo } + +procedure TdxGridAttributeHostInfo.Initialize(AParent: TdxReportCell); +begin + Origin := NullPoint; + FParent := AParent; +end; + +{ TdxGridAttributeHostInfoServices } + +constructor TdxGridAttributeHostInfoServices.Create(AReportLink: TdxGridReportLink); +begin + inherited Create; + FReportLink := AReportLink; + CreateHostInfos; +end; + +destructor TdxGridAttributeHostInfoServices.Destroy; +begin + DestroyHostInfos; + inherited; +end; + +procedure TdxGridAttributeHostInfoServices.Initialize; +begin + PageDetailsHostInfo.Initialize(PageDetails); + PageFootersHostInfo.Initialize(PageFooters); + PageHeadersHostInfo.Initialize(PageHeaders); +end; + +procedure TdxGridAttributeHostInfoServices.CreateHostInfos; +begin + FPageDetailsHostInfo := TdxGridAttributeHostInfo.Create; + FPageFootersHostInfo := TdxGridAttributeHostInfo.Create; + FPageHeadersHostInfo := TdxGridAttributeHostInfo.Create; +end; + +procedure TdxGridAttributeHostInfoServices.DestroyHostInfos; +begin + FreeAndNil(FPageHeadersHostInfo); + FreeAndNil(FPageFootersHostInfo); + FreeAndNil(FPageDetailsHostInfo); +end; + +function TdxGridAttributeHostInfoServices.GetBandHeadersHostInfo: TdxGridAttributeHostInfo; +begin + if CanUseBandHeadersOnEveyPage then + Result := PageHeadersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetCaptionHostInfo: TdxGridAttributeHostInfo; +begin + if CanUseCaptionOnEveryPage then + Result := PageHeadersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetFilterBarHostInfo: TdxGridAttributeHostInfo; +begin + if CanUseFilterBarOnEveryPage then + if ActiveViewHelper.IsFilterBarAtTop(ActiveView) then + Result := PageHeadersHostInfo + else + Result := PageFootersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetFootersHostInfo: TdxGridAttributeHostInfo; +begin + if CanUseFootersOnEveryPage then + Result := PageFootersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetHeadersHostInfo: TdxGridAttributeHostInfo; +begin + if CanUseHeadersOnEveryPage then + Result := PageHeadersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetInconsistentStateText: string; +begin + if ReportLink.IsAggregated then + Result := cxGetResourceString(@sdxCannotUseOnEveryPageModeInAggregatedState) + else + if ReportLink.ProcessParams.HasMasterDetails then + Result := cxGetResourceString(@sdxCannotUseOnEveryPageMode) + else + if IsInconsistentFilterBarState then + Result := cxGetResourceString(@sdxIncorrectFilterBarState) + else + if IsInconsistentBandHeadersState then + if ActiveViewHelper.IsFilterBarAtTop(ActiveView) then + Result := cxGetResourceString(@sdxIncorrectBandHeadersState2) + else + Result := cxGetResourceString(@sdxIncorrectBandHeadersState) + else + if IsInconsistentHeadersState then + if ActiveViewHelper.IsFilterBarAtTop(ActiveView) then + Result := cxGetResourceString(@sdxIncorrectHeadersState2) + else + Result := cxGetResourceString(@sdxIncorrectHeadersState) + else + if IsInconsistentFootersState then + Result := cxGetResourceString(@sdxIncorrectFootersState) + else + Result := ''; +end; + +function TdxGridAttributeHostInfoServices.GetIsInconsistentState: Boolean; +begin + Result := ReportLink.IsAggregated or ReportLink.ProcessParams.HasMasterDetails or + IsInconsistentFilterBarState or IsInconsistentBandHeadersState or + IsInconsistentHeadersState or IsInconsistentFootersState; +end; + +function TdxGridAttributeHostInfoServices.HasCells: Boolean; +begin + Result := ReportLink.ReportCells <> nil; +end; + +function TdxGridAttributeHostInfoServices.IsAttributeSupported(AnAttribute: TdxGridAttributeClass): Boolean; +begin + Result := ActiveViewHelper.IsAttributeSupported(AnAttribute) +end; + +function TdxGridAttributeHostInfoServices.GetActiveView: TcxCustomGridView; +begin + Result := ReportLink.ActiveView; +end; + +function TdxGridAttributeHostInfoServices.GetActiveViewHelper: TdxCustomGridViewHelperClass; +begin + Result := ReportLink.ActiveViewHelper; +// if ActiveView = nil then +// Result := TdxNullGridViewHelper +// else +// Result := dxViewHelpersFactory[ActiveView]; +end; + +function TdxGridAttributeHostInfoServices.GetArePageFootersAssigned: Boolean; +begin + with ReportLink.ReportCells do + Result := (FootersHostInfo.Parent = FooterCells) or (FilterBarHostInfo.Parent = FooterCells); +end; + +function TdxGridAttributeHostInfoServices.GetArePageHeadersAssigned: Boolean; +begin + with ReportLink.ReportCells do + Result := (CaptionHostInfo.Parent = HeaderCells) or (FilterBarHostInfo.Parent = HeaderCells) or + (BandHeadersHostInfo.Parent = HeaderCells) or (HeadersHostInfo.Parent = HeaderCells); +end; + +function TdxGridAttributeHostInfoServices.GetCanUseBandHeadersOnEveyPage: Boolean; +begin + Result := ReportLink.CanAttributeBeUsedOnEveryPage(TdxGridBandHeader) and + ReportLink.IsAttributeUsedOnEveryPage(TdxGridLevelCaption) and + (ActiveViewHelper.IsFilterBarAtBottom(ActiveView) or ReportLink.IsAttributeUsedOnEveryPage(TdxGridFilterBar)); +end; + +function TdxGridAttributeHostInfoServices.GetCanUseCaptionOnEveryPage: Boolean; +begin + Result := ReportLink.CanAttributeBeUsedOnEveryPage(TdxGridLevelCaption); +end; + +function TdxGridAttributeHostInfoServices.GetCanUseFilterBarOnEveryPage: Boolean; +begin + Result := ReportLink.CanAttributeBeUsedOnEveryPage(TdxGridFilterBar) and + ReportLink.IsAttributeUsedOnEveryPage(TdxGridLevelCaption); +end; + +function TdxGridAttributeHostInfoServices.GetCanUseFootersOnEveryPage: Boolean; +begin + Result := ReportLink.CanAttributeBeUsedOnEveryPage(TdxGridFooter) and + (ActiveViewHelper.IsFilterBarAtTop(ActiveView) or ReportLink.IsAttributeUsedOnEveryPage(TdxGridFilterBar)); +end; + +function TdxGridAttributeHostInfoServices.GetCanUseHeadersOnEveryPage: Boolean; +begin + Result := ReportLink.CanAttributeBeUsedOnEveryPage(TdxGridHeader) and + ReportLink.IsAttributeUsedOnEveryPage(TdxGridLevelCaption) and + (ActiveViewHelper.IsFilterBarAtBottom(ActiveView) or ReportLink.IsAttributeUsedOnEveryPage(TdxGridFilterBar)) and + ReportLink.IsAttributeUsedOnEveryPage(TdxGridBandHeader); +end; + +function TdxGridAttributeHostInfoServices.GetIsInconsistentBandHeadersState: Boolean; +begin + Result := IsAttributeSupported(TdxGridBandHeader) and OptionsOnEveryPage.BandHeaders and OptionsView.BandHeaders and + ((IsAttributeSupported(TdxGridLevelCaption) and OptionsView.Caption and not OptionsOnEveryPage.Caption) or + (IsAttributeSupported(TdxGridFilterBar) and ActiveViewHelper.IsFilterBarAtTop(ActiveView) and + OptionsView.FilterBar and not OptionsOnEveryPage.FilterBar)); +end; + +function TdxGridAttributeHostInfoServices.GetIsInconsistentFilterBarState: Boolean; +begin + Result := ActiveViewHelper.IsFilterBarAtTop(ActiveView) and + (IsAttributeSupported(TdxGridFilterBar) and OptionsView.FilterBar and OptionsOnEveryPage.FilterBar and + IsAttributeSupported(TdxGridLevelCaption) and OptionsView.Caption and not OptionsOnEveryPage.Caption); +end; + +function TdxGridAttributeHostInfoServices.GetIsInconsistentFootersState: Boolean; +begin + Result := IsAttributeSupported(TdxGridFooter) and OptionsView.Footers and OptionsOnEveryPage.Footers and + IsAttributeSupported(TdxGridFilterBar) and ActiveViewHelper.IsFilterBarAtBottom(ActiveView) and + OptionsView.FilterBar and not OptionsOnEveryPage.FilterBar; +end; + +function TdxGridAttributeHostInfoServices.GetIsInconsistentHeadersState: Boolean; +begin + Result := IsAttributeSupported(TdxGridHeader) and OptionsView.Headers and OptionsOnEveryPage.Headers and + ((IsAttributeSupported(TdxGridLevelCaption) and OptionsView.Caption and not OptionsOnEveryPage.Caption) or + (IsAttributeSupported(TdxGridFilterBar) and ActiveViewHelper.IsFilterBarAtTop(ActiveView) and + OptionsView.FilterBar and not OptionsOnEveryPage.FilterBar) or + (IsAttributeSupported(TdxGridBandHeader) and OptionsView.BandHeaders and not OptionsOnEveryPage.BandHeaders)); +end; + +function TdxGridAttributeHostInfoServices.GetLevelSeparatorBottomHostInfo: TdxGridAttributeHostInfo; +begin + if ArePageFootersAssigned then + Result := PageFootersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetLevelSeparatorTopHostInfo: TdxGridAttributeHostInfo; +begin + if ArePageHeadersAssigned then + Result := PageHeadersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetOptionsOnEveryPage: TdxGridReportLinkOptionsOnEveryPage; +begin + Result := ReportLink.OptionsOnEveryPage; +end; + +function TdxGridAttributeHostInfoServices.GetOptionsView: TdxGridReportLinkOptionsView; +begin + Result := ReportLink.OptionsView; +end; + +function TdxGridAttributeHostInfoServices.GetPageDetails: TdxReportCell; +begin + if HasCells then + Result := ReportLink.ReportCells.Cells + else + Result := nil; +end; + +function TdxGridAttributeHostInfoServices.GetPageFooters: TdxReportCell; +begin + if HasCells and not ReportLink.ProcessParams.HasMasterDetails then + Result := ReportLink.ReportCells.FooterCells + else + Result := PageDetails; +end; + +function TdxGridAttributeHostInfoServices.GetPageHeaders: TdxReportCell; +begin + if HasCells and not ReportLink.ProcessParams.HasMasterDetails then + Result := ReportLink.ReportCells.HeaderCells + else + Result := PageDetails; +end; + +{ TdxGridReportLinkStyles } + +procedure TdxGridReportLinkStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TdxGridReportLinkStyles then + with TdxGridReportLinkStyles(Source) do + begin + Self.BandHeader := BandHeader; + Self.Caption := Caption; + Self.CardCaptionRow := CardCaptionRow; + Self.CardRowCaption := CardRowCaption; + Self.Content := Content; + Self.ContentEven := ContentEven; + Self.ContentOdd := ContentOdd; + Self.FilterBar := FilterBar; + Self.Footer := Footer; + Self.Group := Group; + Self.Header := Header; + Self.Preview := Preview; + Self.Selection := Selection; + end; // TODO: assign to TcxGridXXXStyles +end; + +procedure TdxGridReportLinkStyles.GetBandHeaderParams(ABand: TcxGridBand; + out AParams: TcxViewParams); +begin + GetViewParams(vspsGridBandHeader, ABand, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetCaptionParams(ATabLevel: TcxGridLevel; out AParams: TcxViewParams); +begin + GetViewParams(vspsGridCaption, ATabLevel, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetCardCaptionRowParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +var + DataCellPos: TdxPSGridDataCellPos; +begin + DataCellPos := CreatePSDataCellPos; + try + with DataCellPos do + begin + GridRecord := ARecord; + Item := AItem; + end; + GetViewParams(vspsGridCardCaptionRow, DataCellPos, nil, AParams); + finally + FreePSDataCellPos(DataCellPos); + end; +end; + +procedure TdxGridReportLinkStyles.GetCardRowCaptionParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +var + DataCellPos: TdxPSGridDataCellPos; +begin + DataCellPos := CreatePSDataCellPos; + try + with DataCellPos do + begin + GridRecord := ARecord; + Item := AItem; + end; + GetViewParams(vspsGridCardRowCaption, DataCellPos, nil, AParams); + finally + FreePSDataCellPos(DataCellPos); + end; +end; + +procedure TdxGridReportLinkStyles.GetContentParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +const + StyleIndexes: array[Boolean] of Integer = (vspsGridContentEven, vspsGridContentOdd); +var + DataCellPos: TdxPSGridDataCellPos; +begin + if (ARecord <> nil) and (GetValue(StyleIndexes[Odd(ARecord.Index)]) <> nil) then + begin + DataCellPos := CreatePSDataCellPos; + try + with DataCellPos do + begin + GridRecord := ARecord; + Item := AItem; + end; + GetViewParams(StyleIndexes[Odd(ARecord.Index)], DataCellPos, nil, AParams); + finally + FreePSDataCellPos(DataCellPos); + end; + end + else + GetViewParams(vspsGridContent, ARecord, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetFilterBarParams(out AParams: TcxViewParams); +begin + GetViewParams(vspsGridFilterBar, nil, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetFooterParams(ARecord: TcxCustomGridRecord; + AGroupLevel: Integer; AItem: TcxGridColumn; out AParams: TcxViewParams); +begin + GetViewParams(vspsGridFooter, ARecord, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetGroupParams(ARecord: TcxCustomGridRecord; + AGroupLevel: Integer; out AParams: TcxViewParams); +begin + GetViewParams(vspsGridGroup, ARecord, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetHeaderParams(AItem: TcxGridColumn; + out AParams: TcxViewParams); +begin + GetViewParams(vspsGridHeader, nil, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetPreviewParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +begin + GetViewParams(vspsGridPreview, ARecord, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetSelectionParams(out AParams: TcxViewParams); +begin + GetViewParams(vspsGridSelection, nil, nil, AParams); +end; + +function TdxGridReportLinkStyles.DesignerTabIndex: Integer; +begin + Result := 3; +end; + +procedure TdxGridReportLinkStyles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +const + FixedParts = [vspsGridBandHeader, vspsGridCaption, vspsGridFooter, vspsGridHeader, + vspsGridSelection]; +begin + inherited; + if ReportLink <> nil then + with AParams do + begin + if Index in FixedParts then + Color := dxPSCore.dxDefaultFixedColor + else + if Index = vspsGridGroup then + if ReportLink.IsOffice11StyleGrouping and (AData = nil) then + Color := dxPSCore.dxDefaultFixedColor + else + Color := dxPSCore.dxDefaultContentColor + else + if Index = vspsGridFilterBar then + Color := DefaultFilterBarColor + else + Color := dxPSCore.dxDefaultContentColor; + + Font := ReportLink.Font; + + if Index = vspsGridFilterBar then + TextColor := DefaultFilterBarTextColor + else + TextColor := Font.Color; + end; +end; + +class function TdxGridReportLinkStyles.GetStyleCaption(AnIndex: Integer): string; +begin + case AnIndex of + vspsGridBandHeader: + Result := cxGetResourceString(@sdxBandHeaderStyle); + vspsGridCaption: + Result := cxGetResourceString(@sdxCaptionStyle); + vspsGridCardCaptionRow: + Result := cxGetResourceString(@sdxCardCaptionRowStyle); + vspsGridCardRowCaption: + Result := cxGetResourceString(@sdxCardRowCaptionStyle); + vspsGridContent: + Result := cxGetResourceString(@sdxContentStyle); + vspsGridContentEven: + Result := cxGetResourceString(@sdxContentEvenStyle); + vspsGridContentOdd: + Result := cxGetResourceString(@sdxContentOddStyle); + vspsGridFilterBar: + Result := cxGetResourceString(@sdxFilterBarStyle); + vspsGridFooter: + Result := cxGetResourceString(@sdxFooterStyle); + vspsGridGroup: + Result := cxGetResourceString(@sdxGroupStyle); + vspsGridHeader: + Result := cxGetResourceString(@sdxHeaderStyle); + vspsGridPreview: + Result := cxGetResourceString(@sdxPreviewStyle); + else + Result := cxGetResourceString(@sdxSelectionStyle); + end; +end; + +function TdxGridReportLinkStyles.GetStyleIndexByCaption(const Caption: string): Integer; +begin + for Result := vspsGridFirst to vspsGridLast do + if dxPSUtl.dxSameText(Caption, GetStyleCaption(Result)) then + Exit; + Result := -1; +end; + +function TdxGridReportLinkStyles.IsCardViewStyle(AStyle: TcxStyle): Boolean; +begin + Result := (AStyle <> nil) and ((AStyle = CardRowCaption) or (AStyle = CardCaptionRow)); +end; + +function TdxGridReportLinkStyles.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +{ TdxGridReportLinkStyleSheet } + +class function TdxGridReportLinkStyleSheet.GetStylesClass: TcxCustomStylesClass; +begin + Result := TdxGridReportLinkStyles; +end; + +function TdxGridReportLinkStyleSheet.GetStylesValue: TdxGridReportLinkStyles; +begin + if GetStyles is TdxGridReportLinkStyles then + Result := TdxGridReportLinkStyles(GetStyles) + else + Result := nil; +end; + +procedure TdxGridReportLinkStyleSheet.SetStylesValue(Value: TdxGridReportLinkStyles); +begin + SetStyles(Value); +end; + +{ TdxGridReportLink } + +constructor TdxGridReportLink.Create(AOwner: TComponent); +begin + inherited; + FDelimitersHardVert := TList.Create; + FHostInfoServices := TdxGridAttributeHostInfoServices.Create(Self); + FReportRows := TList.Create; + InternalRestoreDefaults; + LinkModified(False); +end; + +destructor TdxGridReportLink.Destroy; +begin + FreeAndNil(FReportRows); + FreeAndNil(FHostInfoServices); + FreeAndNil(FDelimitersHardVert); + inherited; +end; + +procedure TdxGridReportLink.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLink then + with TdxGridReportLink(Source) do + begin + Self.OptionsCards := OptionsCards; +{$IFDEF CHARTVIEW} + Self.OptionsCharts := OptionsCharts; +{$ENDIF} + Self.OptionsDetails := OptionsDetails; + Self.OptionsLevels := OptionsLevels; + end; + inherited; +end; + +procedure TdxGridReportLink.AddPageBreak(AGridRecord: TcxCustomGridRecord); +var + ReportRow: TdxReportCell; +begin + ReportRow := ReportRowsByGridRecord[AGridRecord]; + if ReportRow <> nil then + AddVerticalHardDelimiter(ReportRow); +end; + +procedure TdxGridReportLink.AddPageBreak(const AGridRecords: array of TcxCustomGridRecord); +var + I: Integer; +begin + for I := Low(AGridRecords) to High(AGridRecords) do + AddPageBreak(AGridRecords[I]); +end; + +procedure TdxGridReportLink.AddPageBreak(const AGridRecords: TdxGridRecordArray); +var + I: Integer; +begin + for I := 0 to Length(AGridRecords) - 1 do + AddPageBreak(AGridRecords[I]); +end; + +procedure TdxGridReportLink.AddPageBreak(AGridRecords: TList); +var + I: Integer; + P: Pointer; +begin + for I := 0 to AGridRecords.Count - 1 do + begin + P := AGridRecords[I]; + if TObject(P) is TcxCustomGridRecord then + AddPageBreak(TcxCustomGridRecord(P)); + end; +end; + +procedure TdxGridReportLink.BeforeDesignReport; +begin + CalculateProcessParams; + inherited; +end; + +function TdxGridReportLink.CalculateActualScaleFactor: Integer; +begin + if OptionsSize.AutoWidth then + Result := 100 + else + Result := inherited CalculateActualScaleFactor; +end; + +procedure TdxGridReportLink.ConstructReport(AReportCells: TdxReportCells); + + procedure CalculateSizes; + + procedure CalculateReportPartSizes(ACell: TdxReportCell); + var + Width, I, V: Integer; + begin + if ACell.CellCount > 0 then + begin + Width := 0; + for I := 0 to ACell.CellCount - 1 do + begin + V := ACell.Cells[I].Width; + if Width < V then Width := V; + end; + ACell.BoundsRect := MakeRect(0, 0, Width, ACell.LastCell.BoundsRect.Bottom); + end; + end; + + begin + with AReportCells do + begin + CalculateReportPartSizes(Cells); + if AreFooterCellsAllocated then CalculateReportPartSizes(FooterCells); + if AreHeaderCellsAllocated then CalculateReportPartSizes(HeaderCells); + end; + end; + +begin + if Grid = nil then Exit; + inherited; + if ActiveView = nil then Exit; + + PrepareConstruct; + try + BuildTopLevelViews; + if not AbortBuilding then + CalculateSizes; + finally + UnprepareConstruct; + end; +end; + +procedure TdxGridReportLink.ConvertCoords; +begin + inherited; + ConvertDelimiters(DelimitersHardVert); +end; + +procedure TdxGridReportLink.CustomDraw(AItem: TAbstractdxReportCellData; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); +var + DrawInfo: TdxGridCellCustomDrawInfo; +begin + GetItemCustomDrawInfo(AItem, DrawInfo); + with DrawInfo do + case GridAttributeID of + dxGridBandID: + DoCustomDrawBandCell(ACanvas, TcxGridBandedTableView(GridView), GridBand, + TdxReportCellString(AItem), ADone); + dxGridCardRowCaptionID: + DoCustomDrawCardRowCaptionCell(ACanvas, TcxGridCardView(GridView), GridCard, + GridCardRow, TdxReportCellString(AItem), ADone); + dxGridCardRowDataID: + DoCustomDrawCardRowDataCell(ACanvas, TcxGridCardView(GridView), GridCard, + GridCardRow, AItem, ADone); + dxGridFilterBarID: + DoCustomDrawFilterBar(ACanvas, TcxCustomGridTableView(GridView), + TdxReportCellString(AItem), ADone); + dxGridFooterID, + dxGridGroupFooterID: + DoCustomDrawFooterCell(ACanvas, TcxGridTableView(GridView), GridRecord, + GridColumn, GroupLevel, TdxReportCellString(AItem), ADone); + dxGridHeaderID: + DoCustomDrawHeaderCell(ACanvas, TcxGridTableView(GridView), GridColumn, + TdxReportCellString(AItem), ADone); + dxGridRecordID: + DoCustomDrawCell(ACanvas, TcxCustomGridTableView(GridView), GridRecord, + GridColumn, AItem, ADone); + dxGridLevelCaptionID: + DoCustomDrawLevelCaption(ACanvas, GridView, TdxReportCellString(AItem), ADone); + end; +end; + +function TdxGridReportLink.GetBreakPagesByHardDelimiters: Boolean; +begin + with OptionsPagination do + Result := OneGroupPerPage or Custom; +end; + +function TdxGridReportLink.GetEmptyPagesCanExist: Boolean; +begin + Result := True;//}ProcessParams.HasMasterDetails; +end; + +function TdxGridReportLink.GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; +begin + Result := (AUpdateCodes * uaMarginsVert <> []) and (ProcessParams.HasOnlyCards or OptionsSize.AutoWidth); +end; + +function TdxGridReportLink.GetUseHardVertDelimiters: Boolean; +begin + with OptionsPagination do + Result := TopLevelGroup or Custom; +end; + +procedure TdxGridReportLink.InternalRestoreDefaults; +begin + inherited; + OptionsCards.RestoreDefaults; +{$IFDEF CHARTVIEW} + OptionsCharts.RestoreDefaults; +{$ENDIF} + OptionsDetails.RestoreDefaults; + OptionsLevels.RestoreDefaults; +end; + +procedure TdxGridReportLink.InternalRestoreFromOriginal; +var + View: TcxCustomGridView; +begin + inherited; + Color := clWhite; + + if Grid <> nil then + begin + OptionsFormatting.LookAndFeelKind := Grid.LookAndFeel.Kind; + OptionsView.Caption := Grid.RootLevelOptions.DetailTabsPosition <> dtpNone; + + View := ActiveView; + if View <> nil then + begin + if View is TcxGridTableView then + begin + OptionsPreview.AutoHeight := TcxGridTableView(View).Preview.AutoHeight; + OptionsPreview.MaxLineCount := TcxGridTableView(View).Preview.MaxLineCount; + OptionsPreview.Visible := TcxGridTableView(View).Preview.Visible; + + if View is TcxGridBandedTableView then + OptionsView.BandHeaders := TcxGridBandedTableView(View).OptionsView.BandHeaders; + OptionsView.FilterBar := (TcxGridTableView(View).Filtering.Visible = fvAlways) or + ((TcxGridTableView(View).Filtering.Visible = fvNonEmpty) and + (TcxGridTableView(View).DataController.Filter.FilterText <> '')); + OptionsView.Footers := TcxGridTableView(View).OptionsView.Footer; + OptionsView.GroupFooters := TcxGridTableView(View).OptionsView.GroupFooters <> gfInvisible; + OptionsView.Headers := TcxGridTableView(View).OptionsView.Header; + + OptionsSize.AutoWidth := TcxGridTableView(View).OptionsView.ColumnAutoWidth; + end; + + if View is TcxGridCardView then + OptionsView.FilterBar := False; + end; + end; +end; + +function TdxGridReportLink.IsDrawFootersOnEveryPage: Boolean; +begin + Result := HostInfoServices.ArePageFootersAssigned; +end; + +function TdxGridReportLink.IsDrawHeadersOnEveryPage: Boolean; +begin + Result := HostInfoServices.ArePageHeadersAssigned; +end; + +function TdxGridReportLink.IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; +var + DrawInfo: TdxGridCellCustomDrawInfo; +begin + Result := inherited IsSupportedCustomDraw(Item) and + (Item <> nil) and IsCustomDrawn(GetItemCustomDrawInfo(Item, DrawInfo)); +end; + +procedure TdxGridReportLink.MakeHardDelimiters(AReportCells: TdxReportCells; + AVertDelimiters: TList); +begin + inherited; + if OptionsPagination.Custom then + try + DoGetCustomPageBreaks; + except + Application.HandleException(Self); + end; + dxPSUtl.dxCopyList(DelimitersHardVert, AVertDelimiters); +end; + +function TdxGridReportLink.GetAreNativeStylesAvailable: Boolean; +begin + Result := OptionsFormatting.UseNativeStyles; +end; + +function TdxGridReportLink.GetStylesClass: TdxCustomReportLinkStylesClass; +begin + Result := TdxGridReportLinkStyles; +end; + +function TdxGridReportLink.GetStyleSheetClass: TdxCustomReportLinkStyleSheetClass; +begin + Result := TdxGridReportLinkStyleSheet; +end; + +function TdxGridReportLink.GetStyleSheetPrototype: TdxCustomReportLinkStyleSheet; +begin + Result := GridLinkStyleSheetPrototype; +end; + +procedure TdxGridReportLink.PrepareConstruct; +begin + inherited; + DelimitersHardVert.Clear; + FReportRows.Clear; + + ReportCells.LookAndFeel := nil;//ReportCells.CreateGroupLookAndFeel(TdxPSReportGroupNullLookAndFeel); + + if OptionsExpanding.HasAny then + DoExpandRows; + + CalculateProcessParams; + HostInfoServices.Initialize; +end; + +procedure TdxGridReportLink.DoCustomDrawBandCell(ACanvas: TCanvas; + AView: TcxGridBandedTableView; ABand: TcxGridBand; AnItem: TdxReportCellString; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawBandCell) then + FOnCustomDrawBandCell(Self, ACanvas, AView, ABand, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawCardRowCaptionCell(ACanvas: TCanvas; + AView: TcxGridCardView; ACard: TcxGridCard; ARow: TcxGridCardViewRow; + AnItem: TdxReportCellString; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawCardRowCaptionCell) then + FOnCustomDrawCardRowCaptionCell(Self, ACanvas, AView, ACard, ARow, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawCardRowDataCell(ACanvas: TCanvas; + AView: TcxGridCardView; ACard: TcxGridCard; ARow: TcxGridCardViewRow; + AnItem: TAbstractdxReportCellData; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawCardRowDataCell) then + FOnCustomDrawCardRowDataCell(Self, ACanvas, AView, ACard, ARow, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawCell(ACanvas: TCanvas; + AView: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; AnItem: TAbstractdxReportCellData; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawCell) then + FOnCustomDrawCell(Self, ACanvas, AView, ARecord, AColumn, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawFilterBar(ACanvas: TCanvas; + AView: TcxCustomGridTableView; AnItem: TdxReportCellString; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawFilterBar) then + FOnCustomDrawFilterBar(Self, ACanvas, AView, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawFooterCell(ACanvas: TCanvas; + AView: TcxGridTableView; ARecord: TcxCustomGridRecord; AColumn: TcxGridColumn; + ALevel: Integer; AnItem: TdxReportCellString; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawFooterCell) then + FOnCustomDrawFooterCell(Self, ACanvas, AView, ARecord, AColumn, ALevel, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawHeaderCell(ACanvas: TCanvas; + AView: TcxGridTableView; AColumn: TcxGridColumn; AnItem: TdxReportCellString; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawHeaderCell) then + FOnCustomDrawHeaderCell(Self, ACanvas, AView, AColumn, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawLevelCaption(ACanvas: TCanvas; + AView: TcxCustomGridView; AnItem: TdxReportCellString; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawLevelCaption) then + FOnCustomDrawLevelCaption(Self, ACanvas, AView, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoGetCellHeight(AView: TcxCustomGridTableView; + ARecord: TcxCustomGridRecord; ATableItem: TcxCustomGridTableItem; + var AHeight: Integer); +begin + if Assigned(FOnGetCellHeight) then + FOnGetCellHeight(Self, AView, ARecord, ATableItem, AHeight); +end; + +procedure TdxGridReportLink.DoGetCustomPageBreaks; +begin + if Assigned(FOnGetCustomPageBreaks) then FOnGetCustomPageBreaks(Self); +end; + +procedure TdxGridReportLink.DoInitializeBandCell(AView: TcxGridBandedTableView; + ABand: TcxGridBand; AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeBandCell) then + FOnInitializeBandCell(Self, AView, ABand, AnItem); +end; + +procedure TdxGridReportLink.DoInitializeCardRowCaptionCell(AView: TcxGridCardView; + ACard: TcxGridCard; ARow: TcxGridCardViewRow; AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeCardRowCaptionCell) then + FOnInitializeCardRowCaptionCell(Self, AView, ACard, ARow, AnItem); +end; + +procedure TdxGridReportLink.DoInitializeCardRowDataCell(AView: TcxGridCardView; + ACard: TcxGridCard; ARow: TcxGridCardViewRow; AnItem: TAbstractdxReportCellData); +begin + if Assigned(FOnInitializeCardRowDataCell) then + FOnInitializeCardRowDataCell(Self, AView, ACard, ARow, AnItem); +end; + +procedure TdxGridReportLink.DoInitializeCell(AView: TcxCustomGridTableView; + ARecord: TcxCustomGridRecord; AColumn: TcxGridColumn; AnItem: TAbstractdxReportCellData); +begin + if Assigned(FOnInitializeCell) then + FOnInitializeCell(Self, AView, ARecord, AColumn, AnItem); +end; + +{$IFDEF CHARTVIEW} +procedure TdxGridReportLink.DoInitializeChartCell(AView: TcxGridChartView; + AnItem: TdxReportCellGraphic); +begin + if Assigned(FOnInitializeChartCell) then + FOnInitializeChartCell(Self, AView, AnItem); +end; +{$ENDIF} + +procedure TdxGridReportLink.DoInitializeFilterBar(AView: TcxCustomGridTableView; + AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeFilterBar) then + FOnInitializeFilterBar(Self, AView, AnItem); +end; + +procedure TdxGridReportLink.DoInitializeFooterCell(AView: TcxGridTableView; + ARecord: TcxCustomGridRecord; AColumn: TcxGridColumn; ALevel: Integer; + AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeFooterCell) then + FOnInitializeFooterCell(Self, AView, ARecord, AColumn, ALevel, AnItem); +end; + +procedure TdxGridReportLink.DoInitializeHeaderCell(AView: TcxGridTableView; + AColumn: TcxGridColumn; AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeHeaderCell) then + FOnInitializeHeaderCell(Self, AView, AColumn, AnItem); +end; + +procedure TdxGridReportLink.DoInitializeLevelCaption(AView: TcxCustomGridView; + AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeLevelCaption) then + FOnInitializeLevelCaption(Self, AView, AnItem); +end; + +procedure TdxGridReportLink.CreateOptions; +begin + inherited; + FOptionsCards := GetOptionsCardsClass.Create(Self); +{$IFDEF CHARTVIEW} + FOptionsCharts := GetOptionsChartsClass.Create(Self); +{$ENDIF} + FOptionsDetails := GetOptionsDetailsClass.Create(Self); + FOptionsLevels := GetOptionsLevelsClass.Create(Self); +end; + +procedure TdxGridReportLink.DestroyOptions; +begin + FreeAndNil(FOptionsLevels); + FreeAndNil(FOptionsDetails); +{$IFDEF CHARTVIEW} + FreeAndNil(FOptionsCharts); +{$ENDIF} + FreeAndNil(FOptionsCards); + inherited; +end; + +function TdxGridReportLink.GetOptionsCardsClass: TdxGridReportLinkOptionsCardsClass; +begin + Result := TdxGridReportLinkOptionsCards; +end; + +{$IFDEF CHARTVIEW} +function TdxGridReportLink.GetOptionsChartsClass: TdxGridReportLinkOptionsChartsClass; +begin + Result := TdxGridReportLinkOptionsCharts; +end; +{$ENDIF} + +function TdxGridReportLink.GetOptionsDetailsClass: TdxGridReportLinkOptionsDetailsClass; +begin + Result := TdxGridReportLinkOptionsDetails; +end; + +function TdxGridReportLink.GetOptionsExpandingClass: TdxCustomReportLinkOptionsExpandingClass; +begin + Result := TdxGridReportLinkOptionsExpanding; +end; + +function TdxGridReportLink.GetOptionsFormattingClass: TdxCustomReportLinkOptionsFormattingClass; +begin + Result := TdxGridReportLinkOptionsFormatting; +end; + +function TdxGridReportLink.GetOptionsLevelsClass: TdxGridReportLinkOptionsLevelsClass; +begin + Result := TdxGridReportLinkOptionsLevels; +end; + +function TdxGridReportLink.GetOptionsOnEveryPageClass: TdxCustomTableControlReportLinkOptionsOnEveryPageClass; +begin + Result := TdxGridReportLinkOptionsOnEveryPage; +end; + +function TdxGridReportLink.GetOptionsPaginationClass: TdxCustomReportLinkOptionsPaginationClass; +begin + Result := TdxGridReportLinkOptionsPagination; +end; + +function TdxGridReportLink.GetOptionsPreviewClass: TdxCustomTableControlReportLinkOptionsPreviewClass; +begin + Result := TdxGridReportLinkOptionsPreview; +end; + +function TdxGridReportLink.GetOptionsRefinementsClass: TdxCustomReportLinkOptionsRefinementsClass; +begin + Result := TdxGridReportLinkOptionsRefinements; +end; + +function TdxGridReportLink.GetOptionsSelectionClass: TdxCustomTableControlReportLinkOptionsSelectionClass; +begin + Result := TdxGridReportLinkOptionsSelection; +end; + +function TdxGridReportLink.GetOptionsSizeClass: TdxCustomReportLinkOptionsSizeClass; +begin + Result := TdxGridReportLinkOptionsSize; +end; + +function TdxGridReportLink.GetOptionsViewClass: TdxCustomReportLinkOptionsViewClass; +begin + Result := TdxGridReportLinkOptionsView; +end; + +procedure TdxGridReportLink.AddReportRow(AReportRow: TdxReportCell); +begin + FReportRows.Add(AReportRow); +end; + +procedure TdxGridReportLink.AddVerticalHardDelimiter(ADelimiter: TdxReportCell); +var + R: TRect; +begin + R := ADelimiter.AbsoluteRect; + AddVerticalHardDelimiter(R.Top); +end; + +procedure TdxGridReportLink.AddVerticalHardDelimiter(ADelimiter: Integer); +begin + FDelimitersHardVert.Add(TObject(ADelimiter)); +end; + +procedure TdxGridReportLink.BuildTopLevelView(AGridView: TcxCustomGridView); +begin + if (AGridView <> FProcessedView) and (AGridView <> nil) then BuildView(nil, AGridView); +end; + +procedure TdxGridReportLink.BuildTopLevelViews; +var + MasterRow: TcxGridMasterDataRow; + CurrentView: TcxCustomGridView; +begin + if OptionsLevels.Unwrap and OptionsLevels.UnwrapTopLevel then + begin + FProcessedView := nil; + try + MasterRow := ActiveViewMasterRow; + if OptionsLevels.RiseActiveLevelOntoTop then + begin + if MasterRow <> nil then + CurrentView := MasterRow.ActiveDetailGridView + else + CurrentView := ActiveView; + BuildTopLevelView(CurrentView); + FProcessedView := CurrentView; + end; + if not AbortBuilding then + ForEachView(MasterRow, BuildTopLevelView); + finally + FProcessedView := nil; + end; + end + else + BuildTopLevelView(ActiveView); +end; + +procedure TdxGridReportLink.BuildView(AMasterBuilder: TdxCustomGridViewBuilder; + AGridView: TcxCustomGridView); +begin + if OptionsLevels.Unwrap and OptionsLevels.SkipEmptyViews and not dxViewHelpersFactory[AGridView].HasData(AGridView) then + Exit; + with CreateViewBuilder(AMasterBuilder, AGridView) do + try + Build; + finally + Free; + end; +end; + +function TdxGridReportLink.CreateViewAdapter(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView): TdxCustomGridViewAdapter; +begin + Result := dxGridViewBuildersFactory.CreateViewAdapter(AMasterAdapter, AGridView); +end; + +function TdxGridReportLink.CreateViewBuilder(AMasterBuilder: TdxCustomGridViewBuilder; + AGridView: TcxCustomGridView): TdxCustomGridViewBuilder; +begin + Result := dxGridViewBuildersFactory.CreateViewBuilder(Self, AMasterBuilder, AGridView); +end; + +procedure TdxGridReportLink.DoExpandRows; +begin + if OptionsLevels.Unwrap and OptionsLevels.UnwrapTopLevel then + ForEachView(ActiveViewMasterRow, DoExpandViewRows) + else + DoExpandViewRows(ActiveView); +end; + +procedure TdxGridReportLink.DoExpandViewRows(AGridView: TcxCustomGridView); +begin + if AGridView <> nil then + with CreateViewAdapter(nil, AGridView) do + try + ExpandAllRows(OptionsExpanding, not OptionsDetails.OnlyFocusedView); + finally + Free; + end; +end; + +procedure TdxGridReportLink.ForEachView(AMasterRow: TcxGridMasterDataRow; AProc: TdxGridViewProc); +var + I: Integer; + GridView: TcxCustomGridView; + Level: TcxGridLevel; +begin + if not Assigned(AProc) then Exit; + + if AMasterRow <> nil then + for I := 0 to AMasterRow.DetailGridViewCount -1 do + begin + GridView := AMasterRow.DetailGridViews[I]; + if GridView <> nil then + begin + Level := GridView.Level as TcxGridLevel; + if Level.Visible then AProc(GridView); + end; + if AbortBuilding then Break; + end + else + with Grid.Levels do + for I := 0 to VisibleCount - 1 do + begin + AProc(VisibleItems[I].GridView); + if AbortBuilding then Break; + end; +end; + +function TdxGridReportLink.GetItemCustomDrawInfo(AnItem: TdxReportVisualItem; + out ADrawInfo: TdxGridCellCustomDrawInfo): TdxGridAttributeID; +begin + dxViewHelpersFactory.HelperClassByItem(AnItem).ExtractCustomDrawInfo(AnItem, ADrawInfo); + Result := ADrawInfo.GridAttributeID; +end; + +function TdxGridReportLink.IsCardViewStyle(AStyle: TcxStyle): Boolean; +begin + Result := Styles.IsCardViewStyle(AStyle); +end; + +function TdxGridReportLink.IsCustomDrawn(AnAttributeID: TdxGridAttributeID): Boolean; +begin + Result := False; + case AnAttributeID of + dxGridBandID: + Result := Assigned(FOnCustomDrawBandCell); + dxGridCardRowCaptionID: + Result := Assigned(FOnCustomDrawCardRowCaptionCell); + dxGridCardRowDataID: + Result := Assigned(FOnCustomDrawCardRowDataCell); + dxGridFilterBarID: + Result := Assigned(FOnCustomDrawFilterBar); + dxGridFooterID, + dxGridGroupFooterID: + Result := Assigned(FOnCustomDrawFooterCell); + dxGridHeaderID: + Result := Assigned(FOnCustomDrawHeaderCell); + dxGridLevelCaptionID: + Result := Assigned(FOnCustomDrawLevelCaption); + dxGridRecordID: + Result := Assigned(FOnCustomDrawCell); + end; +end; + +function TdxGridReportLink.IsOffice11StyleGrouping: Boolean; +begin + {$IFDEF DXVER500} + Result := ActiveViewHelper.IsOffice11StyleGrouping(ActiveView); + {$ELSE} + Result := False; + {$ENDIF} +end; + +procedure TdxGridReportLink.CalculateProcessParams; + + function CalculateHasUnwrapableData(ALevel: TComponent; ARecursive: Boolean): Boolean; overload; + var + ViewCount, I: Integer; + GridView: TcxCustomGridView; + begin + ViewCount := 0; + for I := 0 to TcxGridLevel(ALevel).VisibleCount - 1 do + begin + GridView := TcxGridLevel(ALevel).VisibleItems[I].GridView; + if GridView <> nil then + Inc(ViewCount); + if ViewCount > 1 then + begin + Result := True; + Exit; + end; + + if ARecursive and (GridView <> nil) then + begin + Result := CalculateHasUnwrapableData(GridView.Level, ARecursive); + if Result then + Exit; + end; + end; + Result := False; + end; + + function CalculateHasUnwrapableData: Boolean; overload; + begin + if OptionsDetails.StartFromFocusedView and (Grid.FocusedView <> nil) then + Result := CalculateHasUnwrapableData(TcxGridLevel(Grid.FocusedView.Level).Parent, not OptionsDetails.OnlyFocusedView) + else + Result := CalculateHasUnwrapableData(Grid.Levels, True); + end; + +var + Adapter: TdxCustomGridViewAdapter; + View: TcxCustomGridView; +begin + View := ActiveView; + + with FProcessParams do + if View = nil then + begin + HasMasterDetails := False; + HasMasterDetailsInTopView := False; + HasOnlyCards := False; + HasOnlyCharts := False; + HasUnwrapableData := False; + CanUseOnEveryPageMode := not IsAggregated; + end + else + begin + Adapter := CreateViewAdapter(nil, View); + try + HasUnwrapableData := CalculateHasUnwrapableData;//Grid.ActiveLevel.GridView); + HasMasterDetailsInTopView := View.IsDetail or View.IsMaster; + HasMasterDetails := (HasUnwrapableData and OptionsLevels.Unwrap) or + (View.IsMaster and not Adapter.AreAllMasterRowsCollapsed and + not (OptionsDetails.StartFromFocusedView and OptionsDetails.OnlyFocusedView)); + HasOnlyCards := View is TcxGridCardView; + {$IFDEF CHARTVIEW} + HasOnlyCharts := View is TcxGridChartView; + {$ENDIF} + CanUseOnEveryPageMode := not IsAggregated and not HasMasterDetails and + Adapter.CanUseOnEveryPageMode; {Adapter.RecordCount <> 0} + finally + Adapter.Free; + end; + end; +end; + +function TdxGridReportLink.CanAttributeBeUsedOnEveryPage(AnAttribute: TdxGridAttributeClass): Boolean; +begin + Result := ProcessParams.CanUseOnEveryPageMode and OptionsOnEveryPage.HasInstalledAttribute(AnAttribute); +end; + +function TdxGridReportLink.IsAttributeUsedOnEveryPage(AnAttribute: TdxGridAttributeClass): Boolean; +begin + Result := CanAttributeBeUsedOnEveryPage(AnAttribute) or not OptionsView.HasInstalledAttribute(AnAttribute); +end; + +function TdxGridReportLink.GetActiveStyles: TdxGridReportLinkStyles; +begin + Result := inherited ActiveStyles as TdxGridReportLinkStyles; +end; + +function TdxGridReportLink.GetActiveView: TcxCustomGridView; +var + Level: TcxGridLevel; +begin + Result := nil; + if Grid <> nil then + Result := Grid.FocusedView; + if (Result <> nil) and not OptionsDetails.StartFromFocusedView then + begin + Level := Result.Level as TcxGridLevel; + while not Level.IsTop do + Level := Level.Parent; + Result := Level.GridView; + end; +end; + +function TdxGridReportLink.GetActiveViewHelper: TdxCustomGridViewHelperClass; +begin + if ActiveView = nil then + Result := TdxNullGridViewHelper + else + Result := dxViewHelpersFactory[ActiveView]; +end; + +function TdxGridReportLink.GetActiveViewMasterRow: TcxGridMasterDataRow; +begin + Result := nil; + with ActiveView do + if MasterGridRecordIndex <> -1 then + Result := (MasterGridView as TcxGridTableView).ViewData.Rows[MasterGridRecordIndex] as TcxGridMasterDataRow; +end; + +function TdxGridReportLink.GetActiveViewParentLevel: TcxGridLevel; +var + GridView: TcxCustomGridView; +begin + Result := nil; + GridView := ActiveView; + if GridView <> nil then + Result := TcxGridLevel(GridView.Level).Parent; +end; + +function TdxGridReportLink.GetDesignWindow: TdxfmGridReportLinkDesignWindow; +begin + Result := inherited DesignWindow as TdxfmGridReportLinkDesignWindow; +end; + +function TdxGridReportLink.GetGrid: TcxGrid; +begin + Result := TcxGrid(Component); +end; + +function TdxGridReportLink.GetOptionsExpanding: TdxGridReportLinkOptionsExpanding; +begin + Result := inherited OptionsExpanding as TdxGridReportLinkOptionsExpanding; +end; + +function TdxGridReportLink.GetOptionsFormatting: TdxGridReportLinkOptionsFormatting; +begin + Result := inherited OptionsFormatting as TdxGridReportLinkOptionsFormatting; +end; + +function TdxGridReportLink.GetOptionsOnEveryPage: TdxGridReportLinkOptionsOnEveryPage; +begin + Result := inherited OptionsOnEveryPage as TdxGridReportLinkOptionsOnEveryPage; +end; + +function TdxGridReportLink.GetOptionsPagination: TdxGridReportLinkOptionsPagination; +begin + Result := inherited OptionsPagination as TdxGridReportLinkOptionsPagination; +end; + +function TdxGridReportLink.GetOptionsPreview: TdxGridReportLinkOptionsPreview; +begin + Result := inherited OptionsPreview as TdxGridReportLinkOptionsPreview; +end; + +function TdxGridReportLink.GetOptionsRefinements: TdxGridReportLinkOptionsRefinements; +begin + Result := inherited OptionsRefinements as TdxGridReportLinkOptionsRefinements; +end; + +function TdxGridReportLink.GetOptionsSelection: TdxGridReportLinkOptionsSelection; +begin + Result := inherited OptionsSelection as TdxGridReportLinkOptionsSelection; +end; + +function TdxGridReportLink.GetOptionsSize: TdxGridReportLinkOptionsSize; +begin + Result := inherited OptionsSize as TdxGridReportLinkOptionsSize; +end; + +function TdxGridReportLink.GetOptionsView: TdxGridReportLinkOptionsView; +begin + Result := inherited OptionsView as TdxGridReportLinkOptionsView; +end; + +function TdxGridReportLink.GetReportRow(Index: Integer): TdxReportCell; +begin + Result := TdxReportCell(FReportRows[Index]); +end; + +function TdxGridReportLink.GetReportRowByGridRecord(GridRecord: TcxCustomGridRecord): TdxReportCell; +var + I: Integer; +begin + if GridRecord <> nil then + for I := 0 to ReportRowCount - 1 do + begin + Result := ReportRows[I]; + if Result.Data = Integer(GridRecord) then Exit; + end; + Result := nil; +end; + +function TdxGridReportLink.GetReportRowCount: Integer; +begin + Result := FReportRows.Count; +end; + +function TdxGridReportLink.GetStyles: TdxGridReportLinkStyles; +begin + Result := inherited Styles as TdxGridReportLinkStyles; +end; + +procedure TdxGridReportLink.SetOnCustomDrawBandCell(Value: TdxGridReportLinkCustomDrawBandCellEvent); +begin + if @FOnCustomDrawBandCell <> @Value then + begin + FOnCustomDrawBandCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawCell(Value: TdxGridReportLinkCustomDrawCellEvent); +begin + if @FOnCustomDrawCell <> @Value then + begin + FOnCustomDrawCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawCardRowCaptionCell(Value: TdxGridReportLinkCustomDrawCardRowCaptionCellEvent); +begin + if @FOnCustomDrawCardRowCaptionCell <> @Value then + begin + FOnCustomDrawCardRowCaptionCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawCardRowDataCell(Value: TdxGridReportLinkCustomDrawCardRowDataCellEvent); +begin + if @FOnCustomDrawCardRowDataCell <> @Value then + begin + FOnCustomDrawCardRowDataCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawFilterBar(Value: TdxGridReportLinkCustomDrawFilterBarEvent); +begin + if @FOnCustomDrawFilterBar <> @Value then + begin + FOnCustomDrawFilterBar := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawFooterCell(Value: TdxGridReportLinkCustomDrawFooterCellEvent); +begin + if @FOnCustomDrawFooterCell <> @Value then + begin + FOnCustomDrawFooterCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawHeaderCell(Value: TdxGridReportLinkCustomDrawHeaderCellEvent); +begin + if @FOnCustomDrawHeaderCell <> @Value then + begin + FOnCustomDrawHeaderCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawLevelCaption(Value: TdxGridReportLinkCustomDrawLevelCaptionEvent); +begin + if @FOnCustomDrawLevelCaption <> @Value then + begin + FOnCustomDrawLevelCaption := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOptionsCards(Value: TdxGridReportLinkOptionsCards); +begin + OptionsCards.Assign(Value); +end; + +{$IFDEF CHARTVIEW} +procedure TdxGridReportLink.SetOptionsCharts(Value: TdxGridReportLinkOptionsCharts); +begin + OptionsCharts.Assign(Value); +end; +{$ENDIF} + +procedure TdxGridReportLink.SetOptionsDetails(Value: TdxGridReportLinkOptionsDetails); +begin + OptionsDetails.Assign(Value); +end; + +procedure TdxGridReportLink.SetOptionsExpanding(Value: TdxGridReportLinkOptionsExpanding); +begin + OptionsExpanding.Assign(Value); +end; + +procedure TdxGridReportLink.SetOptionsFormatting(Value: TdxGridReportLinkOptionsFormatting); +begin + inherited OptionsFormatting := Value; +end; + +procedure TdxGridReportLink.SetOptionsLevels(Value: TdxGridReportLinkOptionsLevels); +begin + OptionsLevels.Assign(Value); +end; + +procedure TdxGridReportLink.SetOptionsOnEveryPage(Value: TdxGridReportLinkOptionsOnEveryPage); +begin + inherited OptionsOnEveryPage := Value; +end; + +procedure TdxGridReportLink.SetOptionsPagination(Value: TdxGridReportLinkOptionsPagination); +begin + inherited OptionsPagination := Value; +end; + +procedure TdxGridReportLink.SetOptionsPreview(Value: TdxGridReportLinkOptionsPreview); +begin + inherited OptionsPreview := Value; +end; + +procedure TdxGridReportLink.SetOptionsRefinements(Value: TdxGridReportLinkOptionsRefinements); +begin + inherited OptionsRefinements := Value; +end; + +procedure TdxGridReportLink.SetOptionsSelection(Value: TdxGridReportLinkOptionsSelection); +begin + inherited OptionsSelection := Value; +end; + +procedure TdxGridReportLink.SetOptionsSize(Value: TdxGridReportLinkOptionsSize); +begin + inherited OptionsSize := Value; +end; + +procedure TdxGridReportLink.SetOptionsView(Value: TdxGridReportLinkOptionsView); +begin + inherited OptionsView := Value; +end; + +procedure TdxGridReportLink.SetStyles(Value: TdxGridReportLinkStyles); +begin + inherited Styles := Value; +end; + +{ TcxGridCardView2OptionsView } + +constructor TcxGridCardView2OptionsView.Create(AGridView: TcxCustomGridView); +begin + inherited; + FCardBorders := False; + FGridLineColor := clDefault; + FGridLines := glNone; + FShadowDepth := 4; +end; + +procedure TcxGridCardView2OptionsView.Assign(Source: TPersistent); +begin + if Source is TcxGridCardView2OptionsView then + with TcxGridCardView2OptionsView(Source) do + begin + Self.CardBorders := CardBorders; + Self.GridLineColor := GridLineColor; + Self.GridLines := GridLines; + Self.ShadowDepth := ShadowDepth; + end; + inherited; +end; + +function TcxGridCardView2OptionsView.GetShadowVisible: Boolean; +begin + Result := ShadowDepth <> 0; +end; + +procedure TcxGridCardView2OptionsView.SetCardBorders(Value: Boolean); +begin + if FCardBorders <> Value then + begin + FCardBorders := Value; + {$IFDEF DXVER500} + Changed(vcSize); + {$ELSE} + SizeChanged; + {$ENDIF} + end; +end; + +procedure TcxGridCardView2OptionsView.SetGridLineColor(Value: TColor); +begin + if FGridLineColor <> Value then + begin + FGridLineColor := Value; + {$IFDEF DXVER500} + Changed(vcLayout); + {$ELSE} + LayoutChanged; + {$ENDIF} + end; +end; + +procedure TcxGridCardView2OptionsView.SetGridLines(Value: TcxGridLines); +begin + if FGridLines <> Value then + begin + FGridLines := Value; + {$IFDEF DXVER500} + Changed(vcSize); + {$ELSE} + SizeChanged; + {$ENDIF} + end; +end; + +procedure TcxGridCardView2OptionsView.SetShadowDepth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FShadowDepth <> Value then + begin + FShadowDepth := Value; + {$IFDEF DXVER500} + Changed(vcSize); + {$ELSE} + SizeChanged; + {$ENDIF} + end; +end; + +{ TcxGridCardView2Styles } + +procedure TcxGridCardView2Styles.Assign(Source: TPersistent); +begin + if Source is TcxGridCardView2Styles then + with TcxGridCardView2Styles(Source) do + begin + Self.CardShadow := CardShadow; + end; + inherited; +end; + +procedure TcxGridCardView2Styles.GetCardShadowParams(ARecord: TcxCustomGridRecord; + out AParams: TcxViewParams); +var + AStyle: TcxStyle; +begin + AStyle := nil; + if Assigned(FOnGetCardShadowStyle) then + FOnGetCardShadowStyle(GridView, ARecord, AStyle); + GetViewParams(vsCardShadow, ARecord, AStyle, AParams); +end; + +procedure TcxGridCardView2Styles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +begin + inherited; + if Index = vsCardShadow then AParams.Color := clWindowText; +end; + +type + TcxGridCardViewInfo2 = class; + TcxGridCardViewViewInfo2 = class; + + TcxGridCardRowCaptionViewInfo2 = class(TcxGridCardRowCaptionViewInfo) + private + function GetCardViewInfo: TcxGridCardViewInfo2; + protected + function GetBorderColor(AIndex: TcxBorder): TColor; override; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + public + property CardViewInfo: TcxGridCardViewInfo2 read GetCardViewInfo; + end; + + TcxGridCardRowDataViewInfo2 = class(TcxGridCardRowDataViewInfo) + private + function GetCardViewInfo: TcxGridCardViewInfo2; + protected + function GetBorderColor(AIndex: TcxBorder): TColor; override; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + public + property CardViewInfo: TcxGridCardViewInfo2 read GetCardViewInfo; + end; + + TcxGridCardDataRowViewInfo2 = class(TcxGridCardDataRowViewInfo) + protected + class function GetCaptionViewInfoClass: TcxGridCardRowCaptionViewInfoClass; override; + class function GetDataViewInfoClass: TcxGridCardRowDataViewInfoClass; override; + end; + + TcxGridCardCaptionRowViewInfo2 = class(TcxGridCardRowViewInfo) + protected + class function GetCaptionViewInfoClass: TcxGridCardRowCaptionViewInfoClass; override; + class function GetDataViewInfoClass: TcxGridCardRowDataViewInfoClass; override; + end; + + TcxGridCardPainter2 = class(TcxGridCardPainter) + private + function GetViewInfo: TcxGridCardViewInfo2; + protected + procedure DrawBottomShadowAndRestSpace; virtual; + {$IFDEF DXVER500} + procedure DrawCardBorder; override; + {$ENDIF} + procedure DrawRightShadowAndRestSpace; virtual; + procedure DrawShadows; virtual; + procedure Paint; override; + property ViewInfo: TcxGridCardViewInfo2 read GetViewInfo; + end; + + TcxGridCardViewInfo2 = class(TcxGridCardViewInfo) + private + function GetGridView: TcxGridCardView2; + protected + function CalculateHeight: Integer; override; + function GetContentWidth: Integer; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + class function GetRowViewInfoClass(ARow: TcxGridCardViewRow): TcxGridCardRowViewInfoClass; override; + + function GetBottomShadowRect: TRect; virtual; + function GetBottomShadowRestRect: TRect; virtual; + function GetCardRowCaptionBorders(ARowCaption: TcxGridCardRowCaptionViewInfo2): TcxBorders; virtual; + function GetCardRowDataBorders(ARowData: TcxGridCardRowDataViewInfo2): TcxBorders; virtual; + function GetGridLineColor: TColor; virtual; + function GetRightShadowRect: TRect; virtual; + function GetRightShadowRestRect: TRect; virtual; + function GetShadowColor: TColor; virtual; + function GetShadowDepth: Integer; virtual; + function GetShadowRestColor: TColor; virtual; + + property GridView: TcxGridCardView2 read GetGridView; + public + property BottomShadowRect: TRect read GetBottomShadowRect; + property BottomShadowRestRect: TRect read GetBottomShadowRestRect; + property GridLineColor: TColor read GetGridLineColor; + property RightShadowRect: TRect read GetRightShadowRect; + property RightShadowRestRect: TRect read GetRightShadowRestRect; + property ShadowColor: TColor read GetShadowColor; + property ShadowDepth: Integer read GetShadowDepth; + property ShadowRestColor: TColor read GetShadowRestColor; + end; + + TcxGridCard2 = class(TcxGridCard) + protected + function GetViewInfoClass: TcxCustomGridRecordViewInfoClass; override; + end; + + TcxGridCardViewViewData2 = class(TcxGridCardViewViewData) + protected + function GetRecordClass(ARecordInfo: TcxRowInfo): TcxCustomGridRecordClass; override; + end; + + TcxGridCardsHorizontalViewInfo2 = class(TcxGridCardsHorizontalViewInfo) + private + function GetGridView: TcxGridCardView2; + protected + function CalculateCardHeight: Integer; override; + function GetShadowDepth: Integer; virtual; + + property GridView: TcxGridCardView2 read GetGridView; + public + property ShadowDepth: Integer read GetShadowDepth; + end; + + TcxGridCardsVerticalViewInfo2 = class(TcxGridCardsVerticalViewInfo) + private + function GetGridView: TcxGridCardView2; + protected + function CalculateCardHeight: Integer; override; + function GetShadowDepth: Integer; virtual; + + property GridView: TcxGridCardView2 read GetGridView; + public + property ShadowDepth: Integer read GetShadowDepth; + end; + + TcxGridCardViewViewInfo2 = class(TcxGridCardViewViewInfo) + protected + function GetRecordsViewInfoClass: TcxCustomGridRecordsViewInfoClass; override; + end; + +{ TcxGridCardRowCaptionViewInfo2 } + +function TcxGridCardRowCaptionViewInfo2.GetBorderColor(AIndex: TcxBorder): TColor; +begin + Result := CardViewInfo.GridLineColor; +end; + +function TcxGridCardRowCaptionViewInfo2.GetBorders: TcxBorders; +begin + Result := CardViewInfo.GetCardRowCaptionBorders(Self); +end; + +function TcxGridCardRowCaptionViewInfo2.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := 1; +end; + +function TcxGridCardRowCaptionViewInfo2.GetCardViewInfo: TcxGridCardViewInfo2; +begin + Result := inherited CardViewInfo as TcxGridCardViewInfo2 +end; + +{ TcxGridCardRowDataViewInfo2 } + +function TcxGridCardRowDataViewInfo2.GetBorderColor(AIndex: TcxBorder): TColor; +begin + Result := CardViewInfo.GridLineColor; +end; + +function TcxGridCardRowDataViewInfo2.GetBorders: TcxBorders; +begin + Result := CardViewInfo.GetCardRowDataBorders(Self); +end; + +function TcxGridCardRowDataViewInfo2.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := 1; +end; + +function TcxGridCardRowDataViewInfo2.GetCardViewInfo: TcxGridCardViewInfo2; +begin + Result := inherited CardViewInfo as TcxGridCardViewInfo2 +end; + +{ TcxGridCardDataRowViewInfo2 } + +class function TcxGridCardDataRowViewInfo2.GetCaptionViewInfoClass: TcxGridCardRowCaptionViewInfoClass; +begin + Result := TcxGridCardRowCaptionViewInfo2; +end; + +class function TcxGridCardDataRowViewInfo2.GetDataViewInfoClass: TcxGridCardRowDataViewInfoClass; +begin + Result := TcxGridCardRowDataViewInfo2; +end; + +{ TcxGridCardCaptionRowViewInfo2 } + +class function TcxGridCardCaptionRowViewInfo2.GetCaptionViewInfoClass: TcxGridCardRowCaptionViewInfoClass; +begin + Result := TcxGridCardRowCaptionViewInfo2; +end; + +class function TcxGridCardCaptionRowViewInfo2.GetDataViewInfoClass: TcxGridCardRowDataViewInfoClass; +begin + Result := TcxGridCardRowDataViewInfo2; +end; + +{ TcxGridCardPainter2 } + +procedure TcxGridCardPainter2.DrawBottomShadowAndRestSpace; +var + R: TRect; +begin + R := ViewInfo.BottomShadowRect; + if Canvas.RectVisible(R) then + begin + Canvas.Brush.Color := ViewInfo.ShadowColor; + Canvas.FillRect(R); + end; + + R := ViewInfo.BottomShadowRestRect; + if Canvas.RectVisible(R) then + begin + Canvas.Brush.Color := ViewInfo.ShadowRestColor; + Canvas.FillRect(R); + end; +end; + +{$IFDEF DXVER500} +procedure TcxGridCardPainter2.DrawCardBorder; +begin + with ViewInfo, Self.Canvas do + FrameRect(Bounds, clWindow, CardBorderWidth); +end; +{$ENDIF} + +procedure TcxGridCardPainter2.DrawRightShadowAndRestSpace; +var + R: TRect; +begin + R := ViewInfo.RightShadowRect; + if Canvas.RectVisible(R) then + begin + Canvas.Brush.Color := ViewInfo.ShadowColor; + Canvas.FillRect(R); + end; + + R := ViewInfo.RightShadowRestRect; + if Canvas.RectVisible(R) then + begin + Canvas.Brush.Color := ViewInfo.ShadowRestColor; + Canvas.FillRect(R); + end; +end; + +procedure TcxGridCardPainter2.DrawShadows; +var + Color: TColor; +begin + Color := Canvas.Brush.Color; + DrawBottomShadowAndRestSpace; + DrawRightShadowAndRestSpace; + Canvas.Brush.Color := Color; +end; + +procedure TcxGridCardPainter2.Paint; +begin + inherited; + DrawShadows; +end; + +function TcxGridCardPainter2.GetViewInfo: TcxGridCardViewInfo2; +begin + Result := TcxGridCardViewInfo2(inherited ViewInfo); +end; + +{ TcxGridCardViewInfo2 } + +function TcxGridCardViewInfo2.CalculateHeight: Integer; +begin + Result := inherited CalculateHeight; + if RecordsViewInfo.AutoDataRecordHeight or (RecordsViewInfo.CardHeight = -1) then + Inc(Result, ShadowDepth); +end; + +function TcxGridCardViewInfo2.GetContentWidth: Integer; +begin + Result := inherited GetContentWidth - ShadowDepth; +end; + +function TcxGridCardViewInfo2.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridCardPainter2; +end; + +class function TcxGridCardViewInfo2.GetRowViewInfoClass(ARow: TcxGridCardViewRow): TcxGridCardRowViewInfoClass; +const + RowViewInfoClasses: array[TcxGridCardViewRowKind] of TcxGridCardRowViewInfoClass = + (TcxGridCardDataRowViewInfo2, TcxGridCardCaptionRowViewInfo2, TcxGridCardCaptionRowViewInfo2); +begin + Result := RowViewInfoClasses[ARow.Kind]; +end; + +function TcxGridCardViewInfo2.GetBottomShadowRect: TRect; +begin + Result := ContentBounds; + Inc(Result.Left, ShadowDepth); + Result.Top := Result.Bottom - ShadowDepth; +end; + +function TcxGridCardViewInfo2.GetBottomShadowRestRect: TRect; +begin + Result := ContentBounds; + Result.Right := Result.Left + ShadowDepth; + Result.Top := Result.Bottom - ShadowDepth; +end; + +function TcxGridCardViewInfo2.GetCardRowCaptionBorders(ARowCaption: TcxGridCardRowCaptionViewInfo2): TcxBorders; +begin + Result := [bLeft, bTop]; + if ARowCaption.Row.VisibleIndex = GridView.RowCount - 1 then + Include(Result, bBottom); + + with TcxGridCardView2OptionsView(GridView.OptionsView) do + begin + if not CardBorders then + begin + Exclude(Result, bLeft); + if ARowCaption.Row.VisibleIndex = 0 then + Exclude(Result, bTop); + if ARowCaption.Row.VisibleIndex = Self.GridView.RowCount - 1 then + Exclude(Result, bBottom); + end; + if not (GridLines in [glBoth, glHorizontal]) and (ARowCaption.Row.VisibleIndex > 0) then + Exclude(Result, bTop); + end; +end; + +function TcxGridCardViewInfo2.GetCardRowDataBorders(ARowData: TcxGridCardRowDataViewInfo2): TcxBorders; +begin + Result := [bLeft, bTop, bRight]; + if ARowData.Row.VisibleIndex = GridView.RowCount - 1 then + Include(Result, bBottom); + with TcxGridCardView2OptionsView(GridView.OptionsView) do + begin + if not CardBorders then + begin + Exclude(Result, bRight); + if ARowData.Row.VisibleIndex = 0 then + Exclude(Result, bTop); + if ARowData.Row.VisibleIndex = Self.GridView.RowCount - 1 then + Exclude(Result, bBottom); + end; + if not (GridLines in [glBoth, glHorizontal]) and (ARowData.Row.VisibleIndex > 0) then + Exclude(Result, bTop); + if not (GridLines in [glBoth, glVertical]) then + Exclude(Result, bLeft); + end; +end; + +function TcxGridCardViewInfo2.GetGridLineColor: TColor; +begin + Result := TcxGridCardView2OptionsView(GridView.OptionsView).GridLineColor; + if Result = clDefault then + Result := GridView.LookAndFeelPainter.DefaultGridLineColor; +end; + +function TcxGridCardViewInfo2.GetRightShadowRect: TRect; +begin + Result := ContentBounds; + Result.Left := Result.Right - ShadowDepth; + Inc(Result.Top, ShadowDepth); +end; + +function TcxGridCardViewInfo2.GetRightShadowRestRect: TRect; +begin + Result := ContentBounds; + Result.Left := Result.Right - ShadowDepth; + Result.Bottom := Result.Top + ShadowDepth; +end; + +function TcxGridCardViewInfo2.GetShadowColor: TColor; +var + Params: TcxViewParams; +begin + TcxGridCardView2Styles(GridView.Styles).GetCardShadowParams(GridRecord, Params); + Result := Params.Color; + if Result = clDefault then + Result := clWindowText; +end; + +function TcxGridCardViewInfo2.GetShadowDepth: Integer; +begin + Result := TcxGridCardView2OptionsView(GridView.OptionsView).ShadowDepth; +end; + +function TcxGridCardViewInfo2.GetShadowRestColor: TColor; +var + Params: TcxViewParams; +begin + TcxGridCardView2Styles(GridView.Styles).GetViewParams(vsBackground, nil, nil, Params); + Result := Params.Color; +end; + +function TcxGridCardViewInfo2.GetGridView: TcxGridCardView2; +begin + Result := TcxGridCardView2(inherited GridView); +end; + +{ TcxGridCard2 } + +function TcxGridCard2.GetViewInfoClass: TcxCustomGridRecordViewInfoClass; +begin + Result := TcxGridCardViewInfo2; +end; + +{ TcxGridCardViewViewData2 } + +function TcxGridCardViewViewData2.GetRecordClass(ARecordInfo: TcxRowInfo): TcxCustomGridRecordClass; +begin + Result := TcxGridCard2; +end; + +{ TcxGridCardsHorizontalViewInfo2 } + +function TcxGridCardsHorizontalViewInfo2.GetGridView: TcxGridCardView2; +begin + Result := TcxGridCardView2(inherited GridView); +end; + +function TcxGridCardsHorizontalViewInfo2.CalculateCardHeight: Integer; +begin + Result := inherited CalculateCardHeight + ShadowDepth; +end; + +function TcxGridCardsHorizontalViewInfo2.GetShadowDepth: Integer; +begin + Result := TcxGridCardView2OptionsView(GridView.OptionsView).ShadowDepth; +end; + +{ TcxGridCardsVerticalViewInfo2 } + +function TcxGridCardsVerticalViewInfo2.GetGridView: TcxGridCardView2; +begin + Result := TcxGridCardView2(inherited GridView); +end; + +function TcxGridCardsVerticalViewInfo2.CalculateCardHeight: Integer; +begin + Result := inherited CalculateCardHeight + ShadowDepth; +end; + +function TcxGridCardsVerticalViewInfo2.GetShadowDepth: Integer; +begin + Result := TcxGridCardView2OptionsView(GridView.OptionsView).ShadowDepth; +end; + +{ TcxGridCardViewViewInfo2 } + +function TcxGridCardViewViewInfo2.GetRecordsViewInfoClass: TcxCustomGridRecordsViewInfoClass; +const + ViewInfoClasses: array[TcxGridCardViewLayoutDirection] of TcxCustomGridRecordsViewInfoClass = + (TcxGridCardsHorizontalViewInfo2, TcxGridCardsVerticalViewInfo2); +begin + Result := ViewInfoClasses[GridView.LayoutDirection]; +end; + +{ TcxGridCardView2 } + +function TcxGridCardView2.GetOptionsViewClass: TcxCustomGridOptionsViewClass; +begin + Result := TcxGridCardView2OptionsView; +end; + +function TcxGridCardView2.GetStylesClass: TcxCustomGridViewStylesClass; +begin + Result := TcxGridCardView2Styles; +end; + +function TcxGridCardView2.GetViewDataClass: TcxCustomGridViewDataClass; +begin + Result := TcxGridCardViewViewData2; +end; + +function TcxGridCardView2.GetViewInfoClass: TcxCustomGridViewInfoClass; +begin + Result := TcxGridCardViewViewInfo2; +end; + +{ TdxfmGridReportLinkDesignWindow } + +constructor TdxfmGridReportLinkDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxhccxGridReportLinkDesigner; + inherited; + CreateControls; + SetActivePage; +end; + +destructor TdxfmGridReportLinkDesignWindow.Destroy; +begin + dxPSPopupMan.dxPSPopupMenuController.UnregisterControl(lbxStyles); + inherited; +end; + +procedure TdxfmGridReportLinkDesignWindow.DoInitialize; +begin + lbxStyles.ReportLinkStyles := ReportLink.ActiveStyles; + inherited; + RefreshStylesList; + + CreateCardView; + //CreateChartView; + {.$IFNDEF DXVER500} + {.$ENDIF} + + {$IFNDEF DXVER500} + chbxExpandCards.Visible := False; + + //chbxTransparentRichEdits.Visible := False; {.3} + //bvlRefinementsSeparator.Top := bvlRefinementsSeparator.Top - 20; + //chbxSuppressBackgroundBitmaps.Top := chbxSuppressBackgroundBitmaps.Top - 20; + //chbxConsumeSelectionStyle.Top := chbxConsumeSelectionStyle.Top - 20; + {$ENDIF} + + if ReportLink.ProcessParams.HasOnlyCards then + PageControl1.ActivePage := tshCards; + if ReportLink.ProcessParams.HasOnlyCharts then + PageControl1.ActivePage := tshCharts; + + InitializePreviewGrid; + InitializePreviewGridStyles; + LoadDataIntoPreviewGridView(PreviewGrid.Levels[0].GridView as TcxCustomGridTableView); + + with ReportLink.OptionsView do + begin + chbxShowCaptions.Checked := Caption; + chbxShowBands.Checked := BandHeaders; + chbxShowExpandButtons.Checked := ExpandButtons; + chbxShowGroupFooters.Checked := GroupFooters; + chbxShowFilterBar.Checked := FilterBar; + chbxShowFooters.Checked := Footers; + chbxShowHeaders.Checked := Headers; + end; + + with ReportLink.OptionsOnEveryPage do + begin + chbxCaptionsOnEveryPage.Checked := Caption; + chbxBandsOnEveryPage.Checked := BandHeaders; + chbxFilterBarOnEveryPage.Checked := FilterBar; + chbxFootersOnEveryPage.Checked := Footers; + chbxHeadersOnEveryPage.Checked := Headers; + end; + + with cbxLookAndFeel do + begin + Items.Clear; + Items.AddObject(cxGetResourceString(@sdxLookAndFeelFlat), TObject(lfFlat)); + Items.AddObject(cxGetResourceString(@sdxLookAndFeelStandard), TObject(lfStandard)); + Items.AddObject(cxGetResourceString(@sdxLookAndFeelUltraFlat), TObject(lfUltraFlat)); + + ItemIndex := Items.IndexOfObject(TObject(ReportLink.OptionsFormatting.LookAndFeelKind)); + end; + + with ReportLink.OptionsSelection do + begin + chbxProcessSelection.Checked := ProcessSelection; + chbxProcessExactSelection.Checked := ProcessExactSelection; + end; + + with ReportLink.OptionsExpanding do + begin + chbxExpandGroupRows.Checked := ExpandGroupRows; + chbxExpandMasterRows.Checked := ExpandMasterRows; + {$IFDEF DXVER500} + chbxExpandCards.Checked := ExpandCards; + {$ENDIF} + end; + + with ReportLink.OptionsRefinements do + begin + chbxTransparentGraphics.Checked := TransparentGraphics; + chbxDisplayGraphicsAsText.Checked := DisplayGraphicsAsText; + chbxFlatCheckMarks.Checked := FlatCheckMarks; + {$IFDEF DXVER500} {.3} + //chbxTransparentRichEdits.Checked := TransparentRichEdits; + {$ENDIF} + end; + + with ReportLink.OptionsSize do + begin + chbxGridAutoWidth.Checked := AutoWidth; + end; + + with ReportLink.OptionsDetails do + begin + chbxStartFromActiveView.Checked := StartFromFocusedView; + chbxOnlyActiveView.Checked := OnlyFocusedView; + end; + + with ReportLink.OptionsLevels do + begin + chbxLevelsUnwrap.Checked := Unwrap; + chbxLevelsUnwrapTopLevel.Checked := UnwrapTopLevel; + chbxLevelsRiseActiveLevelOntoTop.Checked := RiseActiveLevelOntoTop; + chbxLevelsSkipEmptyViews.Checked := SkipEmptyViews; + end; + + with ReportLink.OptionsFormatting do + begin + chbxSuppressBackgroundBitmaps.Checked := SuppressBackgroundBitmaps; + chbxConsumeSelectionStyle.Checked := ConsumeSelectionStyle; + chbxUseNativeStyles.Checked := UseNativeStyles; + end; + + with ReportLink.OptionsPagination do + begin + chbxPaginateByTopLevelGroups.Checked := TopLevelGroup; + chbxPaginateOneGroupPerPage.Checked := OneGroupPerPage; + end; + + with ReportLink.OptionsPreview do + begin + chbxPreviewVisible.Checked := Visible; + chbxPreviewAutoHeight.Checked := AutoHeight; + sePreviewMaxLineCount.AsInteger := MaxLineCount; + end; + + with ReportLink.OptionsCards do + begin + chbxCardsAutoWidth.Checked := AutoWidth; + chbxCardsKeepSameWidth.Checked := KeepSameWidth; + chbxCardsKeepSameHeight.Checked := KeepSameHeight; + chbxCardsBorder.Checked := Borders; + chbxCardsHorzLines.Checked := RowBordersHorz; + chbxCardsVertLines.Checked := RowBordersVert; + seCardsSpaceHorz.AsInteger := InterCardsSpaceHorz; + seCardsSpaceVert.AsInteger := InterCardsSpaceVert; + with Shadow do + begin + seCardsShadowDepth.AsInteger := Depth; + ccbxCardsShadowColor.ColorValue := Color; + end; + end; + +{$IFDEF CHARTVIEW} + with ReportLink.OptionsCharts do + begin + chbxChartsTransparent.Checked := Transparent; + end; +{$ENDIF} +end; + +{$IFDEF DELPHI7} +function TdxfmGridReportLinkDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +procedure TdxfmGridReportLinkDesignWindow.LoadStrings; + + procedure AdjustBevelSize(ABevel: TBevel; AControl: TControl); + var + Right: Integer; + begin + Right := ABevel.BoundsRect.Right; + ABevel.Left := AControl.Left + AControl.Width + 10; + ABevel.Width := Right - ABevel.Left; + end; + +begin + inherited; + + lblPreviewWindow.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + tshView.Caption := cxGetResourceString(@sdxViewTab); + + lblShow.Caption := cxGetResourceString(@sdxShow); + AdjustBevelSize(bvlShow, lblShow); + chbxShowCaptions.Caption := cxGetResourceString(@sdxLevelCaption); + chbxShowBands.Caption := cxGetResourceString(@sdxBands); + chbxShowHeaders.Caption := cxGetResourceString(@sdxHeaders); + chbxShowFooters.Caption := cxGetResourceString(@sdxFooters); + chbxShowGroupFooters.Caption := cxGetResourceString(@sdxGroupFooters); + chbxShowExpandButtons.Caption := cxGetResourceString(@sdxExpandButtons); + chbxShowFilterBar.Caption := cxGetResourceString(@sdxFilterBar); + + lblOnEveryPage.Caption := cxGetResourceString(@sdxOnEveryPage); + AdjustBevelSize(bvlOnEveryPage, lblOnEveryPage); + chbxCaptionsOnEveryPage.Caption := DropAmpersand(cxGetResourceString(@sdxLevelCaption)); + chbxBandsOnEveryPage.Caption := DropAmpersand(cxGetResourceString(@sdxBands)); + chbxHeadersOnEveryPage.Caption := DropAmpersand(cxGetResourceString(@sdxHeaders)); + chbxFootersOnEveryPage.Caption := DropAmpersand(cxGetResourceString(@sdxFooters)); + chbxFilterBarOnEveryPage.Caption := DropAmpersand(cxGetResourceString(@sdxFilterBar)); + + tshBehaviors.Caption := cxGetResourceString(@sdxBehaviorsTab); + + lblSelection.Caption := cxGetResourceString(@sdxSelection); + AdjustBevelSize(bvlSelection, lblSelection); + chbxProcessSelection.Caption := cxGetResourceString(@sdxProcessSelection); + chbxProcessExactSelection.Caption := cxGetResourceString(@sdxProcessExactSelection); + + lblExpanding.Caption := cxGetResourceString(@sdxExpanding); + AdjustBevelSize(bvlExpanding, lblExpanding); + chbxExpandGroupRows.Caption := cxGetResourceString(@sdxGroups); + chbxExpandMasterRows.Caption := cxGetResourceString(@sdxDetails); + chbxExpandCards.Caption := cxGetResourceString(@sdxCardsRows); + + lblGridSize.Caption := cxGetResourceString(@sdxSize); + AdjustBevelSize(bvlGridSize, lblGridSize); + chbxGridAutoWidth.Caption := cxGetResourceString(@sdxAutoWidth); + + lblDetails.Caption := DropAmpersand(cxGetResourceString(@sdxDetails)); + AdjustBevelSize(bvlDetails, lblDetails); + chbxStartFromActiveView.Caption := cxGetResourceString(@sdxStartFromActiveDetails); + chbxOnlyActiveView.Caption := cxGetResourceString(@sdxOnlyActiveDetails); + + lblLevels.Caption := cxGetResourceString(@sdxLevels); + AdjustBevelSize(bvlLevels, lblLevels); + chbxLevelsUnwrap.Caption := cxGetResourceString(@sdxUnwrap); + chbxLevelsUnwrapTopLevel.Caption := cxGetResourceString(@sdxUnwrapTopLevel); + chbxLevelsRiseActiveLevelOntoTop.Caption := cxGetResourceString(@sdxRiseActiveToTop); + chbxLevelsSkipEmptyViews.Caption := cxGetResourceString(@sdxSkipEmptyViews); + + tshFormatting.Caption := cxGetResourceString(@sdxFormatting); + lblLookAndFeel.Caption := cxGetResourceString(@sdxLookAndFeel); + AdjustBevelSize(bvlLookAndFeel, lblLookAndFeel); + + lblRefinements.Caption := cxGetResourceString(@sdxRefinements); + AdjustBevelSize(bvlRefinements, lblRefinements); + chbxTransparentGraphics.Caption := cxGetResourceString(@sdxTransparentGraphics); + chbxDisplayGraphicsAsText.Caption := DropAmpersand(cxGetResourceString(@sdxDisplayGraphicsAsText)); + chbxFlatCheckMarks.Caption := cxGetResourceString(@sdxFlatCheckMarks); + //chbxTransparentRichEdits.Caption := cxGetResourceString(@sdxTransparentRichEdits); {.3} + + chbxSuppressBackgroundBitmaps.Caption := cxGetResourceString(@sdxSuppressBackgroundBitmaps); + chbxConsumeSelectionStyle.Caption := cxGetResourceString(@sdxConsumeSelectionStyle); + + lblPagination.Caption := cxGetResourceString(@sdxPagination); + AdjustBevelSize(bvlPagination, lblPagination); + chbxPaginateByTopLevelGroups.Caption := cxGetResourceString(@sdxByTopLevelGroups); + chbxPaginateOneGroupPerPage.Caption := cxGetResourceString(@sdxOneGroupPerPage); + + tshStyles.Caption := cxGetResourceString(@sdxStyles); + lblUseNativeStyles.Caption := cxGetResourceString(@sdxUseNativeStyles); + AdjustBevelSize(bvlStyles, lblUseNativeStyles); + btnStyleColor.Caption := cxGetResourceString(@sdxBtnColor); + btnStyleFont.Caption := cxGetResourceString(@sdxBtnFont); + btnStyleBackgroundBitmap.Caption := cxGetResourceString(@sdxBtnTexture); + btnStyleBackgroundBitmapClear.Caption := cxGetResourceString(@sdxBtnTextureClear); + btnStyleRestoreDefaults.Caption := cxGetResourceString(@sdxBtnRestoreDefaults); + btnStylesSaveAs.Caption := cxGetResourceString(@sdxBtnSaveAs); + + miStyleColor.Caption := cxGetResourceString(@sdxBtnColor); + miStyleFont.Caption := cxGetResourceString(@sdxBtnFont); + miStyleBackgroundBitmap.Caption := cxGetResourceString(@sdxBtnTexture); + miStyleBackgroundBitmapClear.Caption := cxGetResourceString(@sdxBtnTextureClear); + miStyleRestoreDefaults.Caption := cxGetResourceString(@sdxBtnRestoreDefaults); + miStylesSelectAll.Caption := cxGetResourceString(@sdxSelectAll); + miStylesSaveAs.Caption := cxGetResourceString(@sdxBtnSaveAs); + + lblStyleSheets.Caption := cxGetResourceString(@sdxStyleSheets); + AdjustBevelSize(bvlStyleSheets, lblStyleSheets); + btnStyleSheetNew.Caption := cxGetResourceString(@sdxBtnNew); + btnStyleSheetCopy.Caption := cxGetResourceString(@sdxBtnCopy); + btnStyleSheetDelete.Caption := cxGetResourceString(@sdxBtnDelete); + btnStyleSheetRename.Caption := cxGetResourceString(@sdxBtnRename); + + tshPreview.Caption := cxGetResourceString(@sdxPreviewTab); + lblPreviewOptions.Caption := cxGetResourceString(@sdxOptions); + AdjustBevelSize(bvlPreviewOptions, lblPreviewOptions); + chbxPreviewVisible.Caption := cxGetResourceString(@sdxVisible); + chbxPreviewAutoHeight.Caption := cxGetResourceString(@sdxPreviewAutoHeight); + lblPreviewMaxLineCount.Caption := cxGetResourceString(@sdxPreviewMaxLineCount); + + tshCards.Caption := cxGetResourceString(@sdxCardsTab); + lblCardSizes.Caption := cxGetResourceString(@sdxSizes); + AdjustBevelSize(bvlCardSizes, lblCardSizes); + chbxCardsAutoWidth.Caption := cxGetResourceString(@sdxAutoWidth); + chbxCardsKeepSameWidth.Caption := cxGetResourceString(@sdxKeepSameWidth); + chbxCardsKeepSameHeight.Caption := cxGetResourceString(@sdxKeepSameHeight); + + lblCardSpacing.Caption := cxGetResourceString(@sdxSpacing); + AdjustBevelSize(bvlCardSpacing, lblCardSpacing); + lblCardSpaceHorz.Caption := cxGetResourceString(@sdxHorizontal); + lblCardSpaceVert.Caption := cxGetResourceString(@sdxVertical); + + lblCardFraming.Caption := cxGetResourceString(@sdxFraming); + AdjustBevelSize(bvlCardFraming, lblCardFraming); + chbxCardsBorder.Caption := cxGetResourceString(@sdxBorderLines); + chbxCardsHorzLines.Caption := cxGetResourceString(@sdxHorzLines); + chbxCardsVertLines.Caption := cxGetResourceString(@sdxVertLines); + + lblCardShadow.Caption := cxGetResourceString(@sdxShadow); + AdjustBevelSize(bvlCardShadow, lblCardShadow); + lblCardShadowColor.Caption := cxGetResourceString(@sdxColor); + lblCardShadowDepth.Caption := cxGetResourceString(@sdxDepth); + + tshCharts.Caption := cxGetResourceString(@sdxCharts); + lblChartsOptions.Caption := cxGetResourceString(@sdxOptions); + AdjustBevelSize(bvlChartsOptions, lblChartsOptions); + + chbxChartsTransparent.Caption := cxGetResourceString(@sdxTransparent); +end; + +procedure TdxfmGridReportLinkDesignWindow.UpdateControlsState; +var + View: TcxCustomGridView; +begin + inherited; + + View := ReportLink.ActiveView; + if View <> nil then + with ReportLink.ProcessParams, dxViewHelpersFactory[View] do + begin + chbxShowBands.Enabled := IsAttributeSupported(TdxGridBandHeader); + chbxShowExpandButtons.Enabled := IsAttributeSupported(TdxGridExpandButton); + chbxShowFooters.Enabled := IsAttributeSupported(TdxGridFooter); + chbxShowGroupFooters.Enabled := IsAttributeSupported(TdxGridGroupFooter); + chbxShowHeaders.Enabled := IsAttributeSupported(TdxGridHeader); + + chbxCaptionsOnEveryPage.Enabled := IsAttributeSupported(TdxGridLevelCaption) and not ReportLink.IsAggregated; + chbxBandsOnEveryPage.Enabled := IsAttributeSupported(TdxGridBandHeader) and not ReportLink.IsAggregated; + chbxHeadersOnEveryPage.Enabled := IsAttributeSupported(TdxGridHeader) and not ReportLink.IsAggregated; + chbxFilterBarOnEveryPage.Enabled := IsAttributeSupported(TdxGridFilterBar) and not ReportLink.IsAggregated; + chbxFootersOnEveryPage.Enabled := IsAttributeSupported(TdxGridFooter) and not ReportLink.IsAggregated; + + chbxExpandGroupRows.Enabled := IsAttributeSupported(TdxGridGroupRow); + chbxExpandMasterRows.Enabled := IsAttributeSupported(TdxGridDetails); + + lblDetails.Visible := IsDesigning or HasMasterDetailsInTopView or HasUnwrapableData; + bvlDetails.Visible := IsDesigning or HasMasterDetailsInTopView or HasUnwrapableData; + imgDetails.Visible := IsDesigning or HasMasterDetailsInTopView or HasUnwrapableData; + chbxStartFromActiveView.Visible := IsDesigning or HasMasterDetailsInTopView or HasUnwrapableData; + chbxOnlyActiveView.Visible := IsDesigning or HasMasterDetailsInTopView or HasUnwrapableData; + chbxOnlyActiveView.Enabled := chbxStartFromActiveView.Checked; + + lblLevels.Visible := IsDesigning or HasUnwrapableData; + bvlLevels.Visible := IsDesigning or HasUnwrapableData; + imgLevels.Visible := IsDesigning or HasUnwrapableData; + chbxLevelsUnwrap.Visible := IsDesigning or HasUnwrapableData; + chbxLevelsUnwrapTopLevel.Visible := IsDesigning or HasUnwrapableData; + chbxLevelsRiseActiveLevelOntoTop.Visible := IsDesigning or HasUnwrapableData; + chbxLevelsSkipEmptyViews.Visible := IsDesigning or HasUnwrapableData; + + chbxLevelsUnwrapTopLevel.Enabled := chbxLevelsUnwrap.Checked; + chbxLevelsRiseActiveLevelOntoTop.Enabled := chbxLevelsUnwrap.Checked; + chbxLevelsSkipEmptyViews.Enabled := chbxLevelsUnwrap.Checked; + + chbxPreviewVisible.Enabled := IsAttributeSupported(TdxGridPreview); + chbxPreviewAutoHeight.Enabled := IsAttributeSupported(TdxGridPreview); + sePreviewMaxLineCount.Enabled := IsAttributeSupported(TdxGridPreview); + + lblPagination.Visible := IsDesigning or IsAttributeSupported(TdxGridGroupRow); + bvlPagination.Visible := IsDesigning or IsAttributeSupported(TdxGridGroupRow); + imgPagination.Visible := IsDesigning or IsAttributeSupported(TdxGridGroupRow); + chbxPaginateByTopLevelGroups.Visible := IsDesigning or IsAttributeSupported(TdxGridGroupRow); + chbxPaginateOneGroupPerPage.Visible := IsDesigning or IsAttributeSupported(TdxGridGroupRow); + end; + + chbxProcessExactSelection.Enabled := chbxProcessSelection.Checked; + + chbxPaginateOneGroupPerPage.Enabled := chbxPaginateByTopLevelGroups.Checked; + + chbxCardsKeepSameWidth.Enabled := chbxCardsAutoWidth.Checked; + +{$IFDEF CHARTVIEW} + chbxChartsTransparent.Checked := ReportLink.OptionsCharts.Transparent; +{$ELSE} + tshCharts.TabVisible := False; // if chart not available +{$ENDIF} + + lbxStyles.Enabled := AreNativeStylesAvailable; + btnStyleColor.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + btnStyleFont.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + btnStyleBackgroundBitmap.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + btnStyleBackgroundBitmapClear.Enabled := AreNativeStylesAvailable and HasSelectedStylesWithAssignedBitmap; + btnStyleRestoreDefaults.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + btnStylesSaveAs.Enabled := CanSaveStyles; + + lblStyleSheets.Enabled := AreNativeStylesAvailable; + cbxStyleSheets.Enabled := AreNativeStylesAvailable; + btnStyleSheetNew.Enabled := CanCreateStyleSheet; + btnStyleSheetCopy.Enabled := CanCopyStyleSheet; + btnStyleSheetDelete.Enabled := CanDeleteStyleSheet; + btnStyleSheetRename.Enabled := CanRenameStyleSheet; + + UpdateWarningPane; +end; + +procedure TdxfmGridReportLinkDesignWindow.UpdatePreview; +const + DetailTabsPositionMap: array[Boolean] of TcxGridDetailTabsPosition = (dtpNone, dtpTop); + GroupFootersMap: array[Boolean] of TcxGridGroupFootersMode = (gfInvisible, gfAlwaysVisible); + FilteringMap: array[Boolean] of {$IFDEF DXVER500}TcxGridFilterVisible{$ELSE}TcxGridTableFilterVisible{$ENDIF} = + (fvNonEmpty, fvAlways); + TransparentsMap: array[Boolean] of TcxImageTransparency = (gtOpaque, gtTransparent); + + {$IFDEF DXVER500} + function GetFilterBarPosition: TcxGridFilterPosition; + var + View: TcxCustomGridView; + begin + View := ReportLink.ActiveView; + if View is TcxCustomGridTableView then + Result := CustomGridTableFiltering_GetPosition(TcxCustomGridTableView(View).Filtering) + else + Result := fpBottom; + end; + {$ENDIF} + + procedure UpdateBandedView; + begin + TcxImageProperties(colVendorLogo.Properties).GraphicTransparency := + TransparentsMap[ReportLink.OptionsRefinements.TransparentGraphics]; + with PreviewBandedView do + begin + {$IFDEF DXVER500} + Filtering.Position := GetFilterBarPosition; + {$ENDIF} + Filtering.Visible := FilteringMap[ReportLink.OptionsView.FilterBar]; + OptionsView.BandHeaders := ReportLink.OptionsView.BandHeaders; + OptionsView.Footer := ReportLink.OptionsView.Footers; + OptionsView.GroupFooters := GroupFootersMap[ReportLink.OptionsView.GroupFooters]; + OptionsView.Header := ReportLink.OptionsView.Headers; + Preview.Visible := ReportLink.OptionsPreview.Visible; + ViewChanged; + end; + end; + + procedure UpdateCardView; + begin + TcxImageProperties(rowVendorLogo.Properties).GraphicTransparency := + TransparentsMap[ReportLink.OptionsRefinements.TransparentGraphics]; + {$IFDEF DXVER500} + PreviewCardView.Filtering.Position := GetFilterBarPosition; + PreviewCardView.Filtering.Visible := FilteringMap[ReportLink.OptionsView.FilterBar]; + {$ENDIF} + PreviewCardView.ViewChanged; + end; + +begin + PreviewGrid.Enabled := False; + + PreviewGrid.LookAndFeel.Kind := ReportLink.OptionsFormatting.LookAndFeelKind; + PreviewGrid.LookAndFeel.NativeStyle := False; + PreviewGrid.Font := ReportLink.Font; + PreviewGrid.RootLevelOptions.DetailTabsPosition := DetailTabsPositionMap[ReportLink.OptionsView.Caption]; + + UpdateBandedView; + UpdateCardView; +end; + +function TdxfmGridReportLinkDesignWindow.GetDesignerTabIndex: Integer; +begin + Result := PageControl1.ActivePage.TabIndex; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetDesignerTabIndex(Value: Integer); +begin + if Value < 0 then Value := 0; + if Value > PageControl1.PageCount - 1 then + Value := PageControl1.PageCount - 1; + PageControl1.ActivePage := PageControl1.Pages[Value]; +end; + +procedure TdxfmGridReportLinkDesignWindow.DoActiveStyleSheetChanged; +begin + lbxStyles.ReportLinkStyles := ReportLink.ActiveStyles; + inherited; + with cbxStyleSheets do + ItemIndex := Items.IndexOfObject(ActiveStyleSheet); + + if not LockControlsUpdate then + begin + Modified := True; + UpdatePreview; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.DoFormActivated(AnActive: Boolean); +begin + inherited; + if not AnActive then lbxStyles.HideToolTips; +end; + +procedure TdxfmGridReportLinkDesignWindow.DoRefreshStylesList; +var + Styles: TdxGridReportLinkStyles; + List: TList; +begin + Styles := ReportLink.ActiveStyles; + + with lbxStyles.Items do + begin + BeginUpdate; + try + List := TList.Create; + try + SaveSelectedStyles(List); + try + Clear; + AddObject(cxGetResourceString(@sdxBandHeaderStyle), Styles.BandHeader); + AddObject(cxGetResourceString(@sdxCaptionStyle), Styles.Caption); + AddObject(cxGetResourceString(@sdxCardCaptionRowStyle), Styles.CardCaptionRow); + AddObject(cxGetResourceString(@sdxCardRowCaptionStyle), Styles.CardRowCaption); + AddObject(cxGetResourceString(@sdxContentStyle), Styles.Content); + AddObject(cxGetResourceString(@sdxContentEvenStyle), Styles.ContentEven); + AddObject(cxGetResourceString(@sdxContentOddStyle), Styles.ContentOdd); + AddObject(cxGetResourceString(@sdxFilterBarStyle), Styles.FilterBar); + AddObject(cxGetResourceString(@sdxFooterStyle), Styles.Footer); + AddObject(cxGetResourceString(@sdxGroupStyle), Styles.Group); + AddObject(cxGetResourceString(@sdxHeaderStyle), Styles.Header); + AddObject(cxGetResourceString(@sdxPreviewStyle), Styles.Preview); + AddObject(cxGetResourceString(@sdxSelectionStyle), Styles.Selection); + finally + RestoreSelectedStyles(List); + end; + finally + List.Free; + end; + finally + EndUpdate; + end; + end; + InitializePreviewGridStyles; +end; + +procedure TdxfmGridReportLinkDesignWindow.DoStyleChanged(const ACaption: string; + AStyle: TcxStyle); +begin + inherited; + Modified := True; + UpdatePreviewGridStyles(ACaption, AStyle); +end; + +procedure TdxfmGridReportLinkDesignWindow.DoStylesChanged(AStrings: TStrings; + ARecreate: Boolean); +begin + if ARecreate then + RecreateStylesListBox + else + lbxStyles.Invalidate; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.GetSelectedStyleNames(AStrings: TStrings); +var + I: Integer; +begin + AStrings.Clear; + with lbxStyles do + for I := 0 to Items.Count - 1 do + if Selected[I] then + AStrings.AddObject(Items[I], Items.Objects[I]); +end; + +procedure TdxfmGridReportLinkDesignWindow.GetStyleNames(out AStrings: TStrings); +begin + AStrings := lbxStyles.Items; +end; + +procedure TdxfmGridReportLinkDesignWindow.GetStyleSheetNames(out AStrings: TStrings); +begin + AStrings := cbxStyleSheets.Items; +end; + +function TdxfmGridReportLinkDesignWindow.GetActiveStyle: TcxStyle; +begin + with lbxStyles do + if ItemIndex <> -1 then + Result := TcxStyle(Items.Objects[ItemIndex]) + else + Result := nil; +end; + +function TdxfmGridReportLinkDesignWindow.GetHasSelectedStyles: Boolean; +begin + Result := lbxStyles.SelCount <> 0; +end; + +function TdxfmGridReportLinkDesignWindow.GetHasSelectedStylesWithAssignedBitmap: Boolean; +var + Strings: TStrings; + I: Integer; + cxStyle: TcxStyle; +begin + Result := True; + Strings := TStringList.Create; + try + GetSelectedStyleNames(Strings); + for I := 0 to Strings.Count - 1 do + begin + cxStyle := TcxStyle(Strings.Objects[I]); + if (cxStyle <> nil) and (cxStyle.Bitmap <> nil) and not cxStyle.Bitmap.Empty then + Exit; + end; + finally + Strings.Free; + end; + Result := False; +end; + +function TdxfmGridReportLinkDesignWindow.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +procedure TdxfmGridReportLinkDesignWindow.CardShadowColorChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + if TdxPSColorCombo(Sender).IsAutoColorSelected then + ReportLink.OptionsCards.Shadow.Color := clDefault + else + ReportLink.OptionsCards.Shadow.Color := TdxPSColorCombo(Sender).ColorValue; + TcxGridCardView2Styles(PreviewCardView.Styles).CardShadow.Color := ReportLink.OptionsCards.Shadow.ActualColor; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.CardShadowDepthChanged(Sender: TObject); +var + NewDepth: Integer; +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsCards.Shadow.Depth := TdxPSSpinEdit(Sender).AsInteger; + + NewDepth := TdxPSSpinEdit(Sender).AsInteger; + if NewDepth > 4 then NewDepth := 4; + TcxGridCardView2OptionsView(PreviewCardView.OptionsView).ShadowDepth := NewDepth; + + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.CardSpaceHorzChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsCards.InterCardsSpaceHorz := TdxPSSpinEdit(Sender).AsInteger; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.CardSpaceVertChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsCards.InterCardsSpaceVert := TdxPSSpinEdit(Sender).AsInteger; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.PreviewMaxLineCountChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsPreview.MaxLineCount := TdxPSSpinEdit(Sender).AsInteger; + Modified := True; +end; + +function TdxfmGridReportLinkDesignWindow.CanSelectAllStyles: Boolean; +var + I: Integer; +begin + Result := AreNativeStylesAvailable; + if Result then + begin + for I := 0 to lbxStyles.Items.Count - 1 do + if not lbxStyles.Selected[I] then Exit; + Result := False; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.ChangeActiveView(AView: TcxCustomGridView); +var + OldGridView: TcxCustomGridView; +begin + with PreviewGrid.Levels[0] do + begin + OldGridView := GridView; + GridView := AView; + if OldGridView <> GridView then + LoadDataIntoPreviewGridView(GridView as TcxCustomGridTableView); + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.CreateCardView; + + function CreateRow(APropertiesClass: TcxCustomEditPropertiesClass = nil; + AOnCustomDraw: TcxGridTableDataCellCustomDrawEvent = nil): TcxGridCardViewRow; + begin + Result := PreviewCardView.CreateRow; + Result.PropertiesClass := APropertiesClass; + Result.OnCustomDrawCell := AOnCustomDraw; + end; + +begin + PreviewCardView := PreviewGrid.CreateView(TcxGridCardView2) as TcxGridCardView2; + with PreviewCardView do + begin + LayoutDirection := ldVertical; + {$IFDEF DXVER500} + Filtering.CustomizeDialog := False; + {$ENDIF} + TcxGridCardView2Styles(Styles).CardShadow := styleCardShadow; + with TcxGridCardView2OptionsView(OptionsView) do + begin + CardWidth := 135; + CardBorderWidth := 1; + CellAutoHeight := True; + GridLineColor := ReportLink.OptionsFormatting.GridLineColor; + SeparatorWidth := 0; + ScrollBars := ssNone; + ShadowDepth := ReportLink.OptionsCards.Shadow.Depth; + end; + {$IFDEF DXVER500} + with OptionsCustomize do + begin + CardExpanding := False; + RowFiltering := False; + end; + {$ENDIF} + end; + + rowVendorName := CreateRow; + rowVendorLogo := CreateRow(TcxImageProperties, VendorLogoCustomDrawCell); + rowVendorCountry := CreateRow; + rowCarModel := CreateRow; + rowIsSuvModel := CreateRow(TcxCheckBoxProperties, IsSUVModelCustomDrawCell); +end; + +procedure TdxfmGridReportLinkDesignWindow.CreateControls; + + function CreateSpin(AHost: TControl; ALabel: TLabel; ATabOrder: TTabOrder; + AMinValue, AMaxValue, AValue: Integer): TdxPSSpinEdit; + begin + Result := TdxPSSpinEdit.Create(Self); + with Result do + begin + Parent := AHost.Parent; + BoundsRect := AHost.BoundsRect; + TabOrder := ATabOrder; + + MinValue := AMinValue; + MaxValue := AMaxValue; + Value := AValue; + DefaultValue := AValue; + end; + ALabel.FocusControl := Result; + end; + + function CreateColorCombo(AParent: TWinControl; AHost: TControl; ALabel: TLabel; + ATabOrder: TTabOrder; ATag: Integer; AAutoColor: TColor): TdxPSColorCombo; + begin + Result := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(Result) do + begin + BoundsRect := AHost.BoundsRect; + Tag := MakeTTag(ATag); + Parent := AParent; + TabOrder := ATabOrder; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := AAutoColor; + end; + ALabel.FocusControl := Result; + AHost.Visible := False; + end; + + procedure CreateWarningPane; + begin + wpIncorrectOnEveryPageState := TdxPSWarningPane.Create(Self); + wpIncorrectOnEveryPageState.Parent := tshView; + wpIncorrectOnEveryPageState.BoundsRect := bvlWarningHost.BoundsRect; + wpIncorrectOnEveryPageState.Font.Name := 'Tahoma'; + wpIncorrectOnEveryPageState.Font.Size := 8; + + bvlWarningHost.Visible := False; + end; + + procedure CreateStylesListBox; + begin + lbxStyles := TdxStylesListBox.Create(Self); + lbxStyles.Parent := tshStyles; + lbxStyles.BoundsRect := bvlStylesHost.BoundsRect; + lbxStyles.PopupMenu := pmStyles; + lbxStyles.TabOrder := chbxUseNativeStyles.TabOrder + 1; + lbxStyles.OnClick := lbxStylesClick; + bvlStylesHost.Visible := False; + + dxPSPopupMan.dxPSPopupMenuController.RegisterControl(lbxStyles); + end; + +begin + sePreviewMaxLineCount := CreateSpin(bvlPreviewMaxLineCountHost, lblPreviewMaxLineCount, + chbxPreviewAutoHeight.TabOrder + 1, 0, 1000, 0); + sePreviewMaxLineCount.OnChange := PreviewMaxLineCountChanged; + + seCardsSpaceHorz := CreateSpin(bvlCardSpaceHorzHost, lblCardSpaceHorz, + chbxCardsKeepSameHeight.TabOrder + 1, 0, 20, dxDefaultInterCardsSpaceHorz); + seCardsSpaceHorz.OnChange := CardSpaceHorzChanged; + + seCardsSpaceVert := CreateSpin(bvlCardSpaceVertHost, lblCardSpaceVert, + seCardsSpaceHorz.TabOrder + 1, 0, 20, dxDefaultInterCardsSpaceVert); + seCardsSpaceVert.OnChange := CardSpaceVertChanged; + + ccbxCardsShadowColor := CreateColorCombo(tshCards, bvlCardShadowColorHost, lblCardShadowColor, + chbxCardsVertLines.TabOrder + 1, 0, dxDefaultCardsShadowColor); + ccbxCardsShadowColor.OnChange := CardShadowColorChanged; + + seCardsShadowDepth := CreateSpin(bvlCardShadowDepthHost, lblCardShadowDepth, + ccbxCardsShadowColor.TabOrder + 1, Low(TdxGridCardShadowDepth), High(TdxGridCardShadowDepth), + dxDefaultCardsShadowDepth); + seCardsShadowDepth.OnChange := CardShadowDepthChanged; + + CreateStylesListBox; + CreateWarningPane; +end; + +procedure TdxfmGridReportLinkDesignWindow.CustomDrawBorders(ACanvas: TcxCanvas; + AViewInfo: TcxCustomGridCellViewInfo); +var + PainterClass: TcxCustomGridCellPainterClass; + Painter: TcxCustomGridCellPainter; +begin + PainterClass := CustomGridCellViewInfo_GetPainterClass(AViewInfo); + Painter := PainterClass.Create(ACanvas, AViewInfo); + try + CustomGridCellPainter_DrawBorders(Painter); + finally + Painter.Free; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.CustomDrawFooter(ACanvas: TcxCanvas; + R: TRect; AViewInfo: TcxCustomGridCellViewInfo); +begin + case ReportLink.OptionsFormatting.LookAndFeelKind of + lfStandard, + lfFlat: + ACanvas.DrawComplexFrame(R, AViewInfo.Params.TextColor, clBtnHighlight); + lfUltraFlat: + ACanvas.FrameRect(R, AViewInfo.Params.TextColor); + end; + + InflateRect(R, -1, -1); + CustomDrawTextRect(ACanvas, R, AViewInfo, AViewInfo.BackgroundBitmap); +end; + +procedure TdxfmGridReportLinkDesignWindow.CustomDrawHeader(ACanvas: TcxCanvas; + R: TRect; AViewInfo: TcxCustomGridCellViewInfo); +const + BottomRightColors: array[Boolean] of TColor = (clBtnFace, clBtnShadow); +begin + ACanvas.FrameRect(R, clWindowText); + + if ReportLink.OptionsFormatting.LookAndFeelKind <> lfUltraFlat then + begin + InflateRect(R, -1, -1); + ACanvas.DrawComplexFrame(R, clBtnHighlight, BottomRightColors[ReportLink.OptionsFormatting.LookAndFeelKind = lfStandard]); + end; + + InflateRect(R, -1, -1); + CustomDrawTextRect(ACanvas, R, AViewInfo, AViewInfo.BackgroundBitmap); +end; + +procedure TdxfmGridReportLinkDesignWindow.CustomDrawTextRect(ACanvas: TcxCanvas; + R: TRect; AViewInfo: TcxCustomGridCellViewInfo; ABackgroundBitmap: TBitmap); +const + AlignmentHorzMap: array[TAlignment] of Integer = (cxAlignLeft, cxAlignRight, cxAlignCenter); + AlignmentVertMap: array[TcxAlignmentVert] of Integer = (cxAlignTop, cxAlignBottom, cxAlignVCenter); +begin + with AViewInfo do + begin + if ABackgroundBitmap = nil then + begin + ACanvas.Brush.Color := Params.Color; + ACanvas.FillRect(R); + end + else + dxBkgnd.DrawPicture(ABackgroundBitmap, ACanvas.Canvas, R, ppmTile, 1, 1, - R.Left - 0, - R.Top - 0); + + InflateRect(R, -2, -1); + if ReportLink.OptionsFormatting.LookAndFeelKind = lfUltraFlat then + InflateRect(R, -1, -1); + if Params.Font <> nil then + ACanvas.Font := Params.Font; + ACanvas.Font.Color := Params.TextColor; + ACanvas.Brush.Style := bsClear; + ACanvas.DrawText(Text, R, AlignmentHorzMap[AlignmentHorz] or AlignmentVertMap[AlignmentVert] or cxSingleLine); + ACanvas.Brush.Style := bsSolid; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.InitializePreviewGrid; + + procedure SetupDataBindings(AView: TcxCustomGridTableView); + + function GetColumnCaption(Index: Integer): string; + begin + case Index of + 0: Result := cxGetResourceString(@sdxManufacturerNameColumnCaption); + 1: Result := cxGetResourceString(@sdxManufacturerLogoColumnCaption); + 2: Result := cxGetResourceString(@sdxManufacturerCountryColumnCaption); + 3: Result := cxGetResourceString(@sdxCarModelColumnCaption); + else + Result := cxGetResourceString(@sdxCarIsSUVColumnCaption); + end; + end; + + const + ColumnTypes: array[0..4] of TcxValueTypeClass = + (TcxStringValueType, TcxStringValueType, TcxStringValueType, + TcxStringValueType, TcxBooleanValueType); + var + I: Integer; + begin + for I := 0 to AView.ItemCount - 1 do + with AView.Items[I] do + begin + DataBinding.ValueTypeClass := ColumnTypes[I]; + Caption := GetColumnCaption(I); + end; + end; + +begin + if PageControl1.ActivePage = tshCards then + PreviewGrid.Levels[0].GridView := PreviewCardView + else + PreviewGrid.Levels[0].GridView := PreviewBandedView; + + SetupDataBindings(PreviewBandedView); + PreviewGridLevel.Caption := cxGetResourceString(@sdxCarLevelCaption); + + PreviewBandedView.Bands[0].Caption := cxGetResourceString(@sdxManufacturerBandCaption); + PreviewBandedView.Bands[1].Caption := cxGetResourceString(@sdxModelBandCaption); + PreviewBandedView.DataController.Summary.FooterSummaryItems[0].Format := cxGetResourceString(@sdxSummaryFormat); + + SetupDataBindings(PreviewCardView); +// PreviewCardView.Rows[3].Visible := False; +end; + +procedure TdxfmGridReportLinkDesignWindow.InitializePreviewGridStyles; + + procedure ResetEvents(AStyles: TcxGridBandedTableViewStyles); overload; + begin + with AStyles do + begin + OnGetBandHeaderStyle := nil; + OnGetContentStyle := nil; + OnGetFooterStyle := nil; + OnGetGroupStyle := nil; + OnGetHeaderStyle := nil; + OnGetPreviewStyle := nil; + end; + end; + + procedure ResetEvents(AStyles: TcxGridCardViewStyles); overload; + begin + with AStyles do + begin + OnGetCaptionRowStyle := nil; + OnGetCardBorderStyle := nil; + OnGetContentStyle := nil; + OnGetRowCaptionStyle := nil; + end; + end; + +var + Styles: TdxGridReportLinkStyles; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + begin + Styles := ReportLink.ActiveStyles; + + PreviewGrid.RootLevelStyles.Tab := Styles.Caption; + PreviewGrid.RootLevelStyles.TabsBackground := Styles.Caption; + + if PreviewBandedView <> nil then + begin + dxPScxCommon.dxPSResetStyles(PreviewBandedView.Styles); + with PreviewBandedView.Styles do + begin + BandHeader := Styles.BandHeader; + Content := Styles.Content; + ContentEven := Styles.ContentEven; + ContentOdd := Styles.ContentOdd; + FilterBox := Styles.FilterBar; + Footer := Styles.Footer; + Group := Styles.Group; + Header := Styles.Header; + Preview := Styles.Preview; + end; + end; + + if PreviewCardView <> nil then + begin + dxPScxCommon.dxPSResetStyles(PreviewCardView.Styles); + with PreviewCardView.Styles do + begin + CaptionRow := Styles.CardCaptionRow; + CardBorder := StyleCardBorder; + Content := Styles.Content; + ContentEven := Styles.ContentEven; + ContentOdd := Styles.ContentOdd; + RowCaption := Styles.CardRowCaption; + end; + end; + + end + else + begin + if ReportLink.Grid <> nil then + begin + PreviewGrid.RootLevelStyles.Tab := ReportLink.Grid.RootLevelStyles.Tab; + PreviewGrid.RootLevelStyles.TabsBackground := ReportLink.Grid.RootLevelStyles.TabsBackground; + end + else + dxPScxCommon.dxPSResetStyles(PreviewGrid.RootLevelStyles); + + if PreviewBandedView <> nil then + if ReportLink.ActiveView is TcxGridBandedTableView then + PreviewBandedView.Styles := TcxGridBandedTableView(ReportLink.ActiveView).Styles + else + dxPScxCommon.dxPSResetStyles(PreviewBandedView.Styles); + + if PreviewCardView <> nil then + if ReportLink.ActiveView is TcxGridCardView then + PreviewCardView.Styles := TcxGridCardView(ReportLink.ActiveView).Styles + else + dxPScxCommon.dxPSResetStyles(PreviewCardView.Styles); + end; + + PreviewGrid.RootLevelStyles.OnGetTabStyle := nil; + if PreviewBandedView <> nil then + begin + ResetEvents(PreviewBandedView.Styles); + PreviewBandedView.SizeChanged; + end; + if PreviewCardView <> nil then + begin + ResetEvents(PreviewCardView.Styles); + PreviewCardView.SizeChanged; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.LoadDataIntoPreviewGridView(AView: TcxCustomGridTableView); + + procedure AddRecord(ARecordIndex: Integer; const AValues: array of string); + var + I: Integer; + begin + with AView.DataController do + for I := 0 to ItemCount - 1 do + Values[ARecordIndex, I] := AValues[I]; + end; + + function CarVendorName(Index: Integer): string; + begin + case Index of + 0: Result := cxGetResourceString(@sdxCarManufacturerName1); + 1: Result := cxGetResourceString(@sdxCarManufacturerName2); + 2: Result := cxGetResourceString(@sdxCarManufacturerName3); + else + Result := cxGetResourceString(@sdxCarManufacturerName4); + end; + end; + + function CarVendorCountry(Index: Integer): string; + begin + case Index of + 0: Result := cxGetResourceString(@sdxCarManufacturerCountry1); + 1: Result := cxGetResourceString(@sdxCarManufacturerCountry2); + 2: Result := cxGetResourceString(@sdxCarManufacturerCountry3); + else + Result := cxGetResourceString(@sdxCarManufacturerCountry4); + end; + end; + + function CarModel(Index: Integer): string; + begin + case Index of + 0: Result := cxGetResourceString(@sdxCarModel1); + 1: Result := cxGetResourceString(@sdxCarModel2); + 2: Result := cxGetResourceString(@sdxCarModel3); + else + Result := cxGetResourceString(@sdxCarModel4); + end; + end; + +const + RecordCount = 4; + //CarSalesCount: array[0..RecordCount - 1] of Integer = (10, 6, 3, 5); + IsCarSUV: array[0..RecordCount - 1] of string = ('True', 'True', 'False', 'True'); +var + I: Integer; +begin + AView.DataController.RecordCount := RecordCount; + for I := 0 to RecordCount - 1 do + AddRecord(I, [CarVendorName(I), dxPScxCommon.dxPSPreviewCarLogosAsString(I), + CarVendorCountry(I), CarModel(I), IsCarSUV[I]]);//, CarSalesCount[I]]); +end; + +procedure TdxfmGridReportLinkDesignWindow.RecreateStylesListBox; +var + List: TList; +begin + List := TList.Create; + try + SaveSelectedStyles(List); + dxPSUtl.dxRecreateWnd(lbxStyles); + RestoreSelectedStyles(List); + finally + List.Free; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.RestoreSelectedStyles(AList: TList); +var + I: Integer; +begin + for I := 0 to AList.Count - 1 do + lbxStyles.Selected[Integer(AList[I])] := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SaveSelectedStyles(AList: TList); +var + I: Integer; +begin + AList.Clear; + for I := 0 to lbxStyles.Items.Count - 1 do + if lbxStyles.Selected[I] then AList.Add(TObject(I)); +end; + +procedure TdxfmGridReportLinkDesignWindow.SetActivePage; +begin + PageControl1.ActivePage := PageControl1.Pages[DesignerTabIndex]; +end; + +procedure TdxfmGridReportLinkDesignWindow.UpdatePreviewGridStyles(const ACaption: string; + AStyle: TcxStyle); +begin + with PreviewGrid.RootLevelStyles do + if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxCaptionStyle)) then + begin + Tab := AStyle; + TabsBackground := AStyle; + end; + + with PreviewBandedView.Styles do + begin + if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxBandHeaderStyle)) then + BandHeader := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentStyle)) then + Content := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentEvenStyle)) then + ContentEven := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentOddStyle)) then + ContentOdd := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxFooterStyle)) then + Footer := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxGroupStyle)) then + Group := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxHeaderStyle)) then + Header := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxPreviewStyle)) then + Preview := AStyle; + end; + + with PreviewCardView.Styles do + begin + if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxCardCaptionRowStyle)) then + CaptionRow := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxCardRowCaptionStyle)) then + RowCaption := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentStyle)) then + Content := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentEvenStyle)) then + ContentEven := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentOddStyle)) then + ContentOdd := AStyle + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.UpdateWarningPane; +begin + with ReportLink.HostInfoServices do + wpIncorrectOnEveryPageState.SetStateAndHint(IsInconsistentState, InconsistentStateText); +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsCardsByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsCards do + case Index of + 0: AutoWidth := Value; + 1: KeepSameWidth := Value; + 2: KeepSameHeight := Value; + 3: Borders := Value; + 4: RowBordersHorz := Value; + 5: RowBordersVert := Value; + end; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsChartsByIndex(Index: Integer; + Value: Boolean); +begin +{$IFDEF CHARTVIEW} + if LockControlsUpdate then Exit; + + with ReportLink.OptionsCharts do + case Index of + 0: Transparent := Value; + end; + Modified := True; +{$ENDIF} +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsDetailsByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsDetails do + case Index of + 0: StartFromFocusedView := Value; + 1: OnlyFocusedView := Value; + end; + ReportLink.CalculateProcessParams; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsExpandingByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsExpanding do + case Index of + 0: ExpandGroupRows := Value; + 1: ExpandMasterRows := Value; + {$IFDEF DXVER500} + 2: ExpandCards := Value; + {$ENDIF} + end; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsFormattingByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsFormatting do + case Index of + 0: + begin + UseNativeStyles := Value; + InitializePreviewGridStyles; + RecreateStylesListBox; + end; + 1: SuppressBackgroundBitmaps := Value; + 2: ConsumeSelectionStyle := Value; + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsLevelsByIndex(Index: Integer; Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsLevels do + case Index of + 0: Unwrap := Value; + 1: UnwrapTopLevel := Value; + 2: RiseActiveLevelOntoTop := Value; + 3: SkipEmptyViews := Value; + end; + ReportLink.CalculateProcessParams; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsOnEveryPageByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsOnEveryPage do + case Index of + 0: Caption := Value; + 1: BandHeaders := Value; + 2: Headers := Value; + 3: Footers := Value; + 4: FilterBar := Value; + end; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsPaginationByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsPagination do + case Index of + 0: TopLevelGroup := Value; + 1: OneGroupPerPage := Value; + end; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsRefinementsByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsRefinements do + case Index of + 0: TransparentGraphics := Value; + 1: DisplayGraphicsAsText := Value; + 2: FlatCheckMarks := Value; + {$IFDEF DXVER500} + 3: TransparentRichEdits := Value; + {$ENDIF} + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsSelectionByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsSelection do + case Index of + 0: ProcessSelection := Value; + 1: ProcessExactSelection := Value; + end; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsSizeByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsSize do + case Index of + 0: AutoWidth := Value; + end; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsViewByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsView do + case Index of + 0: Caption := Value; + 1: BandHeaders := Value; + 2: Headers := Value; + 3: Footers := Value; + 4: GroupFooters := Value; + 5: ExpandButtons := Value; + 6: FilterBar := Value; + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsViewClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsViewByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsOnEveryPageClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsOnEveryPageByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsSelectionClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsSelectionByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsExpandingClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsExpandingByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsRefinementClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsRefinementsByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsFormatingClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsFormattingByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.lblUseNativeStylesClick(Sender: TObject); +begin + if chbxUseNativeStyles.CanFocus then ActiveControl := chbxUseNativeStyles; + chbxUseNativeStyles.Checked := not chbxUseNativeStyles.Checked; +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsPaginationClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsPaginationByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsSizeClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsSizeByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsDetailsClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsDetailsByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsLevelsClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsLevelsByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.LookAndFeelClick(Sender: TObject); +begin + with TComboBox(Sender) do + ReportLink.OptionsFormatting.LookAndFeelKind := TcxLookAndFeelKind(Items.Objects[ItemIndex]); + Modified := True; + UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.PageControl1Change(Sender: TObject); +begin + lblPreviewWindow.Parent := TPageControl(Sender).ActivePage; + if not ReportLink.ProcessParams.HasOnlyCards then + if PageControl1.ActivePage = tshCards then + ChangeActiveView(PreviewCardView) + else + if PageControl1.ActivePage = tshStyles then + if ReportLink.IsCardViewStyle(ActiveStyle) then + ChangeActiveView(PreviewCardView) + else + ChangeActiveView(PreviewBandedView) + else + ChangeActiveView(PreviewBandedView); +end; + +procedure TdxfmGridReportLinkDesignWindow.PreviewVisibleClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsPreview.Visible := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.PreviewAutoHeightClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsPreview.AutoHeight := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsCardsClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsCardsByIndex(TTagToInt(Tag), Checked); + with TcxGridCardView2OptionsView(PreviewCardView.OptionsView), ReportLink.OptionsCards do + begin + CardBorders := Borders; + GridLines := dxPScxCommon.dxPSMakecxGridLines(RowBordersHorz, RowBordersVert); + end; + //UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.chbxChartsTransparentClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsChartsByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.pmStylesPopup(Sender: TObject); +begin + lbxStyles.HideToolTips; + miStyleColor.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + miStyleFont.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + miStyleBackgroundBitmap.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + miStyleBackgroundBitmapClear.Enabled := AreNativeStylesAvailable and HasSelectedStylesWithAssignedBitmap; + miStyleRestoreDefaults.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + miStylesSelectAll.Enabled := CanSelectAllStyles; + miStylesSaveAs.Enabled := CanSaveStyles; +end; + +procedure TdxfmGridReportLinkDesignWindow.lbxStylesClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + if not ReportLink.ProcessParams.HasOnlyCards then + if ReportLink.IsCardViewStyle(ActiveStyle) then + ChangeActiveView(PreviewCardView) + else + ChangeActiveView(PreviewBandedView); + UpdateControlsState; +end; + +procedure TdxfmGridReportLinkDesignWindow.IsSUVModelCustomDrawCell( + Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); + + procedure DrawBackground(const R: TRect); + + function GetParams: TcxViewParams; + begin + if AViewInfo is TcxGridCardRowDataViewInfo then + PreviewCardView.Styles.GetContentParams(AViewInfo.GridRecord, AViewInfo.Item, Result) + else + PreviewBandedView.Styles.GetContentParams(AViewInfo.GridRecord, AViewInfo.Item, Result); + end; + + var + BackgroundBitmap: TBitmap; + PrevColor: TColor; + begin + BackgroundBitmap := CustomGridView_GetBackgroundBitmaps(AViewInfo.GridRecord.GridView).GetBitmap(bbContent); + if BackgroundBitmap = nil then + begin + PrevColor := ACanvas.Brush.Color; + ACanvas.Brush.Color := GetParams.Color; + ACanvas.FillRect(R); + ACanvas.Brush.Color := PrevColor; + end + else + dxBkgnd.DrawPicture(BackgroundBitmap, ACanvas.Canvas, R, ppmTile, 1, 1, -R.Left, -R.Top); + end; + + procedure DrawCheck(R: TRect); + const + Painters: array[Boolean] of TcxCustomLookAndFeelPainterClass = + (TcxStandardLookAndFeelPainter, TcxUltraFlatLookAndFeelPainter); + CheckStateMap: array[Boolean] of TcxCheckBoxState = (cbsChecked, cbsUnchecked); + var + X, Y: Integer; + CheckState: Variant; + begin + with R do + begin + X := Left + (Right - Left - dxPSGlbl.CheckWidth) div 2; + Y := Top + (Bottom - Top - dxPSGlbl.CheckHeight) div 2; + end; + R := MakeBounds(X, Y, dxPSGlbl.CheckWidth, dxPSGlbl.CheckHeight); + + CheckState := Variant(CheckStateMap[AViewInfo.RecordViewInfo.GridRecord.RecordIndex = 2]); + with Painters[ReportLink.OptionsRefinements.FlatCheckMarks] do + DrawCheckButton(ACanvas, R, cxbsDefault, CheckState = Variant(cbsChecked)); + end; + +var + R: TRect; +begin + if (Sender is TcxGridTableView) or (AViewInfo is TcxGridCardRowDataViewInfo) then + begin + R := AViewInfo.Bounds; + DrawBackground(R); + DrawCheck(R); + + CustomDrawBorders(ACanvas, AViewInfo); + ADone := True; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.VendorLogoCustomDrawCell( + Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); +var + PrevText: string; +begin + if ReportLink.OptionsRefinements.DisplayGraphicsAsText and + ((Sender is TcxGridTableView) or (AViewInfo is TcxGridCardRowDataViewInfo)) then + begin + PrevText := AViewInfo.Text; + AViewInfo.Text := ReportLink.OptionsRefinements.GraphicsText; + AViewInfo.AlignmentVert := vaTop; + //AViewInfo.Transparent := True; + CustomDrawTextRect(ACanvas, AViewInfo.Bounds, AViewInfo, AViewInfo.RecordViewInfo.BackgroundBitmap); + AViewInfo.Text := PrevText; + CustomDrawBorders(ACanvas, AViewInfo); + ADone := True; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.PreviewBandedViewCustomDrawColumnHeader( + Sender: TcxGridTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean); +var + R: TRect; +begin + R := AViewInfo.Bounds; + Dec(R.Left); + if not ((PreviewGrid.LookAndFeel.Kind = lfUltraFlat) and + not TcxGridBandedTableOptionsView(Sender.OptionsView).BandHeaders) then + Dec(R.Top); + CustomDrawHeader(ACanvas, R, AViewInfo); + + ADone := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.PreviewBandedViewCustomDrawBandHeader( + Sender: TcxGridBandedTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridBandHeaderViewInfo; var ADone: Boolean); +var + R: TRect; +begin + R := AViewInfo.Bounds; + Dec(R.Left); + CustomDrawHeader(ACanvas, R, AViewInfo); + + ADone := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.PreviewBandedViewCustomDrawFooterCell( + Sender: TcxGridTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean); +begin + CustomDrawFooter(ACanvas, AViewInfo.Bounds, AViewInfo); + ADone := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleColorClick(Sender: TObject); +begin + PerformStylesChangeColor; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleFontClick(Sender: TObject); +begin + PerformStylesChangeFont; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleBackgroundBitmapClick(Sender: TObject); +begin + PerformStylesChangeBitmap; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleBackgroundBitmapClearClick(Sender: TObject); +begin + PerformStylesClearBitmap; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleRestoreDefaultsClick(Sender: TObject); +begin + PerformStylesRestoreDefaults; +end; + +procedure TdxfmGridReportLinkDesignWindow.miStylesSelectAllClick(Sender: TObject); +{$IFNDEF DELPHI6} +var + I: Integer; +{$ENDIF} +begin + with lbxStyles do + begin + {$IFDEF DELPHI6} + SelectAll; + {$ELSE} + Items.BeginUpdate; + try + for I := 0 to Items.Count - 1 do + Selected[I] := True; + finally + Items.EndUpdate; + end; + {$ENDIF} + end; + UpdateControlsState; +end; + +procedure TdxfmGridReportLinkDesignWindow.cbxStyleSheetsClick(Sender: TObject); +begin + with TComboBox(Sender) do + ActiveStyleSheet := TcxCustomStyleSheet(Items.Objects[ItemIndex]); +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleSheetNewClick(Sender: TObject); +begin + PerformStyleSheetNew; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleSheetCopyClick(Sender: TObject); +begin + PerformStyleSheetCopy; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleSheetDeleteClick(Sender: TObject); +begin + PerformStyleSheetDelete; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleSheetRenameClick(Sender: TObject); +begin + PerformStyleSheetRename; +end; + +procedure TdxfmGridReportLinkDesignWindow.StylesSaveAsClick(Sender: TObject); +begin + PerformStylesSaveAsStyleSheet; +end; + +procedure TdxfmGridReportLinkDesignWindow.cbxStyleSheetsKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + PerformStyleSheetKeyDown(Sender, Key, Shift); +end; + +procedure TdxfmGridReportLinkDesignWindow.cbxStyleSheetsDrawItem( + Control: TWinControl; Index: Integer; Rect: TRect; + State: TOwnerDrawState); +begin + PerformStyleSheetDrawItem(TComboBox(Control).Canvas, Index, Rect, State, Control.Enabled); +end; + +procedure RegisterAssistants; +begin + TdxCustomGridViewBuilder.Register; + TdxCustomGridTableViewBuilder.Register; + TdxGridTableViewBuilder.Register; + TdxGridDBTableViewBuilder.Register; + TdxGridBandedTableViewBuilder.Register; + TdxGridDBBandedTableViewBuilder.Register; + TdxGridCardViewBuilder.Register; + TdxGridDBCardViewBuilder.Register; +{$IFDEF CHARTVIEW} + TdxGridChartViewBuilder.Register; +{$ENDIF} + + TdxCustomGridViewHelper.Register; + TdxCustomGridTableViewHelper.Register; + TdxGridCardViewHelper.Register; + TdxGridTableViewHelper.Register; + TdxGridBandedTableViewHelper.Register; + + TdxCustomGridRecordHelper.Register; + TdxCustomGridRowHelper.Register; + TdxGridDataRowHelper.Register; + TdxGridGroupRowHelper.Register; + TdxGridMasterDataRowHelper.Register; + + TdxGridReportLinkStyleSheet.Register; +end; + +procedure RegisterItems; +begin + TdxReportCardHorz.Register; + TdxReportCardVert.Register; + + TdxReportCardLayer.Register; + TdxReportCardVerticalLayer.Register; + + TdxReportCardRow.Register; +end; + +procedure UnregisterAssistants; +begin + TdxGridReportLinkStyleSheet.Unregister; + + TdxGridViewBuildersFactory.ReleaseInstance; + TdxViewHelpersFactory.ReleaseInstance; + TdxRecordHelpersFactory.ReleaseInstance; +end; + +procedure UnregisterItems; +begin + TdxReportCardHorz.UnRegister; + TdxReportCardVert.UnRegister; + + TdxReportCardLayer.UnRegister; + TdxReportCardVerticalLayer.UnRegister; + + TdxReportCardRow.UnRegister; +end; + +initialization + RegisterAssistants; + RegisterItems; + + dxPSRegisterReportLink(TdxGridReportLink, TcxGrid, TdxfmGridReportLinkDesignWindow); + +finalization + dxPSUnregisterReportLink(TdxGridReportLink, TcxGrid, TdxfmGridReportLinkDesignWindow); + + UnregisterItems; + UnregisterAssistants; + + FreeAndNil(FGridLinkStyleSheetPrototype); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxGrid6LnkPredefinedStyleSheets.dfm b/official/x.35/ExpressPrinting System/Sources/dxPScxGrid6LnkPredefinedStyleSheets.dfm new file mode 100644 index 00000000..83221cdb --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxGrid6LnkPredefinedStyleSheets.dfm @@ -0,0 +1,351 @@ +object dxdmPScxGridLnkPredefinedStyles: TdxdmPScxGridLnkPredefinedStyles + OldCreateOrder = False + Left = 352 + Top = 156 + Height = 150 + Width = 215 + object StyleRepository: TcxStyleRepository + Left = 37 + Top = 12 + object styleProfessionalFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3355443 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = 13033414 + end + object styleProfessionalGroup: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4214088 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 13033414 + end + object styleProfessionalRowCaption: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6582120 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object styleProfessionalCaptionRow: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = 13033414 + end + object styleProfessionalContentOdd: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleProfessionalContentEven: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4214088 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 13033414 + end + object styleProfessionalPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14541789 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleProfessionalSelection: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object styleGreenFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9358956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleGreenFooter: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9358956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenLightContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12778719 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenLightPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14154698 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenSelected: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4949549 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenGroup: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11328403 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleNoneContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleNoneFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentBandHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentFooter: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentGroup: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsItalic] + TextColor = clBlack + end + object styleTransparentLevelCaption: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentFilterBar: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentCaptionRow: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentRowCaption: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContentEven: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContentOdd: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentSelection: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13816275 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object ssProfessional: TdxGridReportLinkStyleSheet + Caption = 'Professional' + Styles.BandHeader = styleProfessionalFixed + Styles.Caption = styleProfessionalFixed + Styles.CardCaptionRow = styleProfessionalCaptionRow + Styles.CardRowCaption = styleProfessionalRowCaption + Styles.Content = styleNoneContent + Styles.ContentEven = styleProfessionalContentEven + Styles.ContentOdd = styleProfessionalContentOdd + Styles.FilterBar = styleProfessionalFixed + Styles.Footer = styleProfessionalFixed + Styles.Group = styleProfessionalGroup + Styles.Header = styleProfessionalFixed + Styles.Preview = styleProfessionalPreview + Styles.Selection = styleProfessionalSelection + BuiltIn = True + end + object ssGreen: TdxGridReportLinkStyleSheet + Caption = 'Green' + Styles.BandHeader = styleGreenFixed + Styles.Caption = styleGreenFixed + Styles.CardCaptionRow = styleGreenFixed + Styles.CardRowCaption = styleGreenFixed + Styles.Content = styleNoneContent + Styles.ContentEven = styleGreenLightContent + Styles.ContentOdd = styleNoneContent + Styles.FilterBar = styleGreenFixed + Styles.Footer = styleGreenFixed + Styles.Group = styleGreenGroup + Styles.Header = styleGreenFixed + Styles.Preview = styleGreenLightPreview + Styles.Selection = styleGreenSelected + BuiltIn = True + end + object ssTransparent: TdxGridReportLinkStyleSheet + Caption = 'Transparent' + Styles.BandHeader = styleTransparentBandHeader + Styles.Caption = styleTransparentLevelCaption + Styles.CardCaptionRow = styleTransparentCaptionRow + Styles.CardRowCaption = styleTransparentRowCaption + Styles.Content = styleTransparentContent + Styles.ContentEven = styleTransparentContentEven + Styles.ContentOdd = styleTransparentContentOdd + Styles.FilterBar = styleTransparentFilterBar + Styles.Footer = styleTransparentFooter + Styles.Group = styleTransparentGroup + Styles.Header = styleTransparentHeader + Styles.Preview = styleTransparentPreview + Styles.Selection = styleTransparentSelection + BuiltIn = True + end + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxGrid6LnkPredefinedStyleSheets.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxGrid6LnkPredefinedStyleSheets.pas new file mode 100644 index 00000000..0444cef8 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxGrid6LnkPredefinedStyleSheets.pas @@ -0,0 +1,143 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxGrid6LnkPredefinedStyleSheets; + +interface + +{$I cxVer.inc} + +uses + Classes, {$IFNDEF DELPHI6} Forms, {$ENDIF} cxClasses, cxStyles, dxPScxGrid6Lnk, + dxPScxCommon; + +type + TdxdmPScxGridLnkPredefinedStyles = class(TDataModule) + StyleRepository: TcxStyleRepository; + styleGreenFixed: TcxStyle; + styleGreenLightContent: TcxStyle; + styleProfessionalFixed: TcxStyle; + styleGreenLightPreview: TcxStyle; + ssGreen: TdxGridReportLinkStyleSheet; + ssProfessional: TdxGridReportLinkStyleSheet; + styleGreenFooter: TcxStyle; + styleNoneContent: TcxStyle; + styleNoneFixed: TcxStyle; + styleProfessionalGroup: TcxStyle; + styleProfessionalContentOdd: TcxStyle; + styleProfessionalContentEven: TcxStyle; + styleProfessionalSelection: TcxStyle; + styleProfessionalPreview: TcxStyle; + styleGreenSelected: TcxStyle; + styleGreenGroup: TcxStyle; + styleProfessionalRowCaption: TcxStyle; + styleProfessionalCaptionRow: TcxStyle; + ssTransparent: TdxGridReportLinkStyleSheet; + styleTransparentContent: TcxStyle; + styleTransparentBandHeader: TcxStyle; + styleTransparentHeader: TcxStyle; + styleTransparentFooter: TcxStyle; + styleTransparentGroup: TcxStyle; + styleTransparentPreview: TcxStyle; + styleTransparentLevelCaption: TcxStyle; + styleTransparentFilterBar: TcxStyle; + styleTransparentCaptionRow: TcxStyle; + styleTransparentRowCaption: TcxStyle; + styleTransparentContentEven: TcxStyle; + styleTransparentContentOdd: TcxStyle; + styleTransparentSelection: TcxStyle; + end; + +implementation + +{$R *.dfm} + +uses + cxStyleSheetsLoad; + +type + TdxPScxGridLnkPredefinedStyleSheets = class(TcxPredefinedStyleSheets) + private + FDataModule: TdxdmPScxGridLnkPredefinedStyles; + protected + procedure AddStyleSheets; override; + property DataModule: TdxdmPScxGridLnkPredefinedStyles read FDataModule; + public + constructor Create; override; + destructor Destroy; override; + + class procedure Register; + class procedure Unregister; + end; + +constructor TdxPScxGridLnkPredefinedStyleSheets.Create; +begin + inherited; + FDataModule := TdxdmPScxGridLnkPredefinedStyles.Create(nil); + AddStyleSheets; +end; + +destructor TdxPScxGridLnkPredefinedStyleSheets.Destroy; +begin + FDataModule.Free; + inherited; +end; + +class procedure TdxPScxGridLnkPredefinedStyleSheets.Register; +begin + cxStyleSheetsLoad.RegisterPredefinedStyleSheets(Self); +end; + +class procedure TdxPScxGridLnkPredefinedStyleSheets.Unregister; +begin + cxStyleSheetsLoad.UnregisterPredefinedStyleSheets(Self); +end; + +procedure TdxPScxGridLnkPredefinedStyleSheets.AddStyleSheets; +var + I: Integer; +begin + with DataModule.StyleRepository do + for I := 0 to StyleSheetCount - 1 do + AddStyleSheet(StyleSheets[I]); +end; + +initialization + TdxPScxGridLnkPredefinedStyleSheets.Register; + +finalization + TdxPScxGridLnkPredefinedStyleSheets.Unregister; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxGrid6LnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxGrid6LnkReg.pas new file mode 100644 index 00000000..6f90f8aa --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxGrid6LnkReg.pas @@ -0,0 +1,376 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxGrid6LnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignEditors, + {$ELSE} + DsgnIntf, + {$ENDIF} + SysUtils, Classes, Controls, cxCustomData, cxDataStorage, cxStyles, cxGrid, + cxGridLevel, cxGridCustomView, cxGridCustomTableView, cxGridCardView, + cxGridTableView, cxGridBandedTableView, cxStyleSheetEditor, dxPScxGrid6Lnk; + +type + TdxGridReportLinkStyleSheetEditorPreview = class(TcxStyleSheetEditorPreview) + private + FGrid: TcxGrid; + function GetBandedTableView: TcxGridBandedTableView; + function GetCardView: TcxGridCardView; + protected + function AddItem(AView: TcxCustomGridTableView; const ACaption: string; + AValueTypeClass: TcxValueTypeClass): TcxCustomGridTableItem; + procedure AddItems(AView: TcxCustomGridTableView); + procedure CreateBandedTableView; + procedure CreateCardView; + procedure Initialize; virtual; + + property BandedTableView: TcxGridBandedTableView read GetBandedTableView; + property CardView: TcxGridCardView read GetCardView; + property Grid: TcxGrid read FGrid; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + class function GetStyleSheetClass: TcxCustomStyleSheetClass; override; + procedure SetStyleSheet(AStyleSheet: TcxCustomStyleSheet); override; + + function Control: TWinControl; override; + + class procedure Register; + class procedure Unregister; + end; + +{ TdxGridReportLinkStyleSheetEditorPreview } + +constructor TdxGridReportLinkStyleSheetEditorPreview.Create(AOwner: TComponent); +begin +// inherited; cannot call ancestor method if it's an abstract method in Delphi4(5) !!!! + FGrid := TcxGrid.Create(AOwner); + Initialize; +end; + +destructor TdxGridReportLinkStyleSheetEditorPreview.Destroy; +begin + FGrid.Free; + inherited; +end; + +class function TdxGridReportLinkStyleSheetEditorPreview.GetStyleSheetClass: TcxCustomStyleSheetClass; +begin + Result := TdxGridReportLinkStyleSheet; +end; + +procedure TdxGridReportLinkStyleSheetEditorPreview.SetStyleSheet(AStyleSheet: TcxCustomStyleSheet); +begin + if AStyleSheet is TdxGridReportLinkStyleSheet then + with TdxGridReportLinkStyleSheet(AStyleSheet).Styles do + begin + BandedTableView.Styles.BandHeader := BandHeader; + BandedTableView.Styles.Content := Content; + BandedTableView.Styles.ContentEven := ContentEven; + BandedTableView.Styles.ContentOdd := ContentOdd; + BandedTableView.Styles.FilterBox := FilterBar; + BandedTableView.Styles.Footer := Footer; + BandedTableView.Styles.Group := Group; + BandedTableView.Styles.Header := Header; + BandedTableView.Styles.Indicator := Header; + BandedTableView.Styles.Preview := Preview; + + CardView.Styles.CaptionRow := CardCaptionRow; + CardView.Styles.Content := Content; + CardView.Styles.ContentEven := ContentEven; + CardView.Styles.ContentOdd := ContentOdd; + CardView.Styles.RowCaption := CardRowCaption; + + Grid.RootLevelStyles.Tab := Caption; + Grid.RootLevelStyles.TabsBackground := Caption; + end + else + begin + BandedTableView.Styles.ResetStyles; + CardView.Styles.ResetStyles; + Grid.RootLevelStyles.ResetStyles; + end; +end; + +function TdxGridReportLinkStyleSheetEditorPreview.Control: TWinControl; +begin + Result := Grid; +end; + +class procedure TdxGridReportLinkStyleSheetEditorPreview.Register; +begin + cxStyleSheetEditor.RegisterStyleSheetEditorPreview(Self); +end; + +class procedure TdxGridReportLinkStyleSheetEditorPreview.Unregister; +begin + cxStyleSheetEditor.UnregisterStyleSheetEditorPreview(Self); +end; + +function TdxGridReportLinkStyleSheetEditorPreview.AddItem(AView: TcxCustomGridTableView; + const ACaption: string; AValueTypeClass: TcxValueTypeClass): TcxCustomGridTableItem; +begin + Result := AView.CreateItem; + with Result do + begin + Caption := ACaption; + DataBinding.ValueTypeClass := AValueTypeClass; + end; +end; + +procedure TdxGridReportLinkStyleSheetEditorPreview.AddItems(AView: TcxCustomGridTableView); +begin + AddItem(AView, 'Text', TcxStringValueType); + AddItem(AView, 'Currency', TcxCurrencyValueType); + AddItem(AView, 'Date', TcxDateTimeValueType); +end; + +procedure TdxGridReportLinkStyleSheetEditorPreview.CreateBandedTableView; + + procedure AddBands; + begin + BandedTableView.Bands.Add.Caption := 'Band'; + end; + + procedure AddGroups; + begin + BandedTableView.Columns[2].GroupIndex := 0; + end; + + procedure AddPreview; + begin + with BandedTableView.Preview do + begin + Column := AddItem(BandedTableView, '', TcxStringValueType) as TcxGridColumn; + Column.Visible := False; + Visible := True; + end; + end; + + procedure AddRecords; + const + ARecordCount: Integer = 3; + var + I: Integer; + begin + with BandedTableView.DataController as TcxGridDataController do + begin + BeginUpdate; + try + RecordCount := ARecordCount; + for I := 0 to ARecordCount - 1 do + begin + Values[I, 0] := 'ABC'; + Values[I, 1] := (I + 1) * 100; + Values[I, 2] := Date - I; + Values[I, 3] := 'Check the preview style'; + end; + finally + EndUpdate; + end; + end; + end; + + procedure AddSummaries; + begin + with BandedTableView do + begin + DataController.Groups.FullExpand; + with DataController.Summary.FooterSummaryItems.Add do + begin + Kind := skSum; + ItemLink := Columns[1]; + end; + end; + end; + + procedure InitializeOptions; + begin + with BandedTableView do + begin + Filtering.CustomizeDialog := False; + + OptionsBehavior.IncSearch := True; + + OptionsData.Deleting := False; + OptionsData.Editing := False; + OptionsData.Appending := False; + OptionsData.Inserting := False; + + OptionsView.BandHeaders := True; + OptionsView.ColumnAutoWidth := True; + OptionsView.Footer := True; + OptionsView.Indicator := True; + end; + end; + + procedure PlaceColumns; + var + I: Integer; + begin + with BandedTableView do + for I := 0 to ItemCount - 1 do + Columns[I].Position.BandIndex := 0; + end; + +begin + Grid.Levels.Add.GridView := Grid.CreateView(TcxGridBandedTableView); + TcxGridLevel(BandedTableView.Level).Caption := 'Table'; + + AddBands; + AddItems(BandedTableView); + AddGroups; + AddPreview; + AddRecords; + AddSummaries; + InitializeOptions; + PlaceColumns; +end; + +procedure TdxGridReportLinkStyleSheetEditorPreview.CreateCardView; + + procedure AddRecords; + const + ARecordCount: Integer = 3; + var + I: Integer; + begin + with CardView.DataController as TcxGridDataController do + begin + BeginUpdate; + try + RecordCount := ARecordCount; + for I := 0 to ARecordCount - 1 do + begin + Values[I, 1] := 'ABC'; + Values[I, 2] := (I + 1) * 100; + Values[I, 3] := Date - I; + end; + finally + EndUpdate; + end; + end; + end; + + procedure AddCaptionRow; + begin + with CardView.CreateRow do + begin + Caption := 'Caption'; + Index := 0; + Kind := rkCaption; + end; + end; + + procedure InitializeOptions; + begin + with CardView do + begin + OptionsBehavior.IncSearch := True; + + OptionsData.Deleting := False; + OptionsData.Editing := False; + OptionsData.Appending := False; + OptionsData.Inserting := False; + end; + end; + +begin + Grid.Levels.Add.GridView := Grid.CreateView(TcxGridCardView); + TcxGridLevel(CardView.Level).Caption := 'Cards'; + + AddItems(CardView); + AddCaptionRow; + AddRecords; + InitializeOptions; +end; + +procedure TdxGridReportLinkStyleSheetEditorPreview.Initialize; +begin + CreateBandedTableView; + CreateCardView; + + Grid.RootLevelOptions.DetailTabsPosition := dtpTop; +end; + +function TdxGridReportLinkStyleSheetEditorPreview.GetBandedTableView: TcxGridBandedTableView; +begin + Result := Grid.Levels[0].GridView as TcxGridBandedTableView; +end; + +function TdxGridReportLinkStyleSheetEditorPreview.GetCardView: TcxGridCardView; +begin + Result := Grid.Levels[1].GridView as TcxGridCardView; +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterNoIcon([TdxGridReportLink, TdxGridReportLinkStyleSheet]); +end; + +procedure RegisterStyleSheetAssistants; +begin + cxStyles.RegisterStyleSheetClass(TdxGridReportLinkStyleSheet); + TdxGridReportLinkStyleSheetEditorPreview.Register; +end; + +procedure UnregisterStyleSheetAssistants; +begin + TdxGridReportLinkStyleSheetEditorPreview.Unregister; + cxStyles.UnregisterStyleSheetClass(TdxGridReportLinkStyleSheet); +end; + +initialization + RegisterStyleSheetAssistants; + +finalization + UnregisterStyleSheetAssistants; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxGridLnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPScxGridLnk.dfm new file mode 100644 index 00000000..f8e5880d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxGridLnk.dfm @@ -0,0 +1,2147 @@ +object dxfmGridReportLinkDesignWindow: TdxfmGridReportLinkDesignWindow + Left = 463 + Top = 133 + BorderStyle = bsDialog + Caption = 'fmdxGridDesignWindow' + ClientHeight = 437 + ClientWidth = 648 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 5 + Top = 5 + Width = 642 + Height = 396 + ActivePage = tshCharts + TabOrder = 0 + OnChange = PageControl1Change + object tshView: TTabSheet + Caption = 'View' + object lblShow: TLabel + Left = 5 + Top = 8 + Width = 26 + Height = 13 + Caption = 'Show' + end + object imgShow: TImage + Left = 9 + Top = 37 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlShow: TBevel + Left = 43 + Top = 12 + Width = 266 + Height = 4 + Shape = bsBottomLine + end + object lblOnEveryPage: TLabel + Left = 5 + Top = 164 + Width = 72 + Height = 13 + Caption = 'On Every Page' + end + object imgOnEveryPage: TImage + Left = 9 + Top = 189 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888777777777777777708888888888 + 888887FFFFFFFFFFFFFFF08888888888888887F7777777777777F07777708888 + 888887F7777777777777F0FFFFF08888888887F7777777777777F07777F07777 + 708887FFFFFFFFFFFFFFF07777F0FFFFF08887F777777777777FF07777F07777 + F08887FFFFFFFFFFFFFFF0FFFFF07777F08887F77777777777FFF077FFF07777 + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777777FFFFF0777FF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777FFFFFFFF07FFFF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF0777FF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF077FFF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777777F077FFF077FF + F08887F7777777777777F0FFFFF0FFFFF08887F7777777777777F0FFFFF07FFF + F08887FFFFFFFFFFFFFFF07777F0FFFFF0888000000000000000007777F077FF + F08888888887F7777777777777F0FFFFF08888888887FFFFFFFFFFFFFFF07777 + F0888888888000000000000000007777F08888888888888887F7777777777777 + F08888888888888887FFFFFFFFFFFFFFF0888888888888888000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlOnEveryPage: TBevel + Left = 90 + Top = 168 + Width = 221 + Height = 4 + Shape = bsBottomLine + end + object bvlWarningHost: TBevel + Left = 4 + Top = 289 + Width = 313 + Height = 77 + Visible = False + end + object chbxShowBands: TCheckBox + Tag = 1 + Left = 90 + Top = 42 + Width = 200 + Height = 17 + Caption = 'Ba&nds' + TabOrder = 1 + OnClick = OptionsViewClick + end + object chbxShowHeaders: TCheckBox + Tag = 2 + Left = 90 + Top = 63 + Width = 200 + Height = 17 + Caption = '&Headers' + TabOrder = 2 + OnClick = OptionsViewClick + end + object chbxShowFooters: TCheckBox + Tag = 3 + Left = 90 + Top = 84 + Width = 200 + Height = 17 + Caption = 'Foo&ters' + TabOrder = 3 + OnClick = OptionsViewClick + end + object chbxShowGroupFooters: TCheckBox + Tag = 4 + Left = 90 + Top = 104 + Width = 200 + Height = 17 + Caption = 'G&roup Footers' + TabOrder = 4 + OnClick = OptionsViewClick + end + object chbxShowExpandButtons: TCheckBox + Tag = 5 + Left = 90 + Top = 125 + Width = 200 + Height = 17 + Caption = 'Expand Buttons' + TabOrder = 5 + OnClick = OptionsViewClick + end + object chbxBandsOnEveryPage: TCheckBox + Tag = 1 + Left = 90 + Top = 202 + Width = 200 + Height = 17 + Caption = 'Ba&nds' + TabOrder = 8 + OnClick = OptionsOnEveryPageClick + end + object chbxHeadersOnEveryPage: TCheckBox + Tag = 2 + Left = 90 + Top = 223 + Width = 200 + Height = 17 + Caption = 'Headers' + TabOrder = 9 + OnClick = OptionsOnEveryPageClick + end + object chbxFootersOnEveryPage: TCheckBox + Tag = 3 + Left = 90 + Top = 245 + Width = 200 + Height = 17 + Caption = 'Footers' + TabOrder = 10 + OnClick = OptionsOnEveryPageClick + end + object chbxFilterBarOnEveryPage: TCheckBox + Tag = 4 + Left = 90 + Top = 266 + Width = 200 + Height = 17 + Caption = 'FilterBar' + TabOrder = 11 + OnClick = OptionsOnEveryPageClick + end + object chbxCaptionsOnEveryPage: TCheckBox + Left = 90 + Top = 181 + Width = 200 + Height = 17 + Caption = 'Captions' + TabOrder = 7 + OnClick = OptionsOnEveryPageClick + end + object chbxShowCaptions: TCheckBox + Left = 90 + Top = 22 + Width = 200 + Height = 17 + Caption = 'Captions' + TabOrder = 0 + OnClick = OptionsViewClick + end + object chbxShowFilterBar: TCheckBox + Tag = 6 + Left = 90 + Top = 146 + Width = 200 + Height = 17 + Caption = 'FilterBar' + TabOrder = 6 + OnClick = OptionsViewClick + end + object lblPreviewWindow: TStaticText + Left = 323 + Top = 1 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 12 + end + end + object tshBehaviors: TTabSheet + Caption = 'Behaviors' + ImageIndex = 1 + object lblSelection: TLabel + Left = 5 + Top = 8 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object imgSelection: TImage + Left = 9 + Top = 28 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlSelection: TBevel + Left = 56 + Top = 12 + Width = 255 + Height = 4 + Shape = bsBottomLine + end + object lblExpanding: TLabel + Left = 5 + Top = 74 + Width = 50 + Height = 13 + Caption = 'Expanding' + end + object imgExpanding: TImage + Left = 9 + Top = 95 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 7778800000000000000000000000078888888888880000000000000000000000 + 007880FFF7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7FF777777FFF77777FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F8F7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7F7F8888FF7F88888FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F8F7777777777777777777078888888888880F7F7F888FFF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F0788077777777777777777777770788C8888C88880F7FF888888FFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880F0F7777777FFFFFFFFFFFF0788CCCCCCCC880F77777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7F7F8888FF7F88888FF7 + F0788077777777777777777777770788C8888C88880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F7F7F8888FF7F888888F7 + F0788077777777777777777777770788CCCC8CC8880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCCCCCC880F7FF88888FFFFFFFFFFF7 + F07880F0F777777FFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F77777777777777777777 + F078800000000000000000000000078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F888888880F88888888888078888888888880F77777777777777777777 + F07880F800008880F80000000008078888888888880F77777777777777777777 + F07880FFFFFFFFF0FFFFFFFFFFFF078888888888880FFFFFFFFFFFFFFFFFFFFF + F078800000000000000000000000088888888888880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlExpanding: TBevel + Left = 62 + Top = 79 + Width = 248 + Height = 4 + Shape = bsBottomLine + end + object lblDetails: TLabel + Left = 5 + Top = 218 + Width = 32 + Height = 13 + Caption = 'Details' + end + object bvlDetails: TBevel + Left = 47 + Top = 223 + Width = 265 + Height = 4 + Shape = bsBottomLine + end + object imgDetails: TImage + Left = 9 + Top = 239 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0889999999999999999999907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897F78FF7FF77777788F907DDDDDDDDDDDD0FF777FFFF7FFF7777FFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDDDDDDDDDDD0FF777777F7FF77777777F + F07DD0889777777777777777777907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCDDDDCDDDD0777777777777777777777 + 707DD08897F777F7FF7777888FF907DDCCCCDCCDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCCCCCCCCDD0FF7777FFF7FF7777777FF + F07DD0889777777777777777777907DDCCCCDCCDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCDDDDCDDDD0777777777777777777777 + 707DD08897F788F7FF77778FFFF907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDDDDDDDDDDD0FF777777F7FF777777777 + F07DD0889777777777777777777907DDCDDDDCDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCCCCDCCDDD0777777777777777777777 + 707DD08897F888F7FF7777788FF907DDCCCCCCCCDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCCCCDCCDDD0FF77777FF7FF7777777FF + F07DD0889000000000000000000907DDCDDDDCDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897888880F8888888888907DDDDDDDDDDDD0777777777777777777777 + 707DD08897F77780F8777777778907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFF80FFFFFFFFFFF907DDDDDDDDDDDD0FF7777FFF7FF7777777FF + F07DD0889000000000000000000907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD0889999999999999999999907DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFFFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD0F0F777777FF77777777FFF07DDDDDDDDDDDD0FF77777FF7FF77777777F + F07DD0FFFFFFFFFFFFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F888888880F8888888888807DDDDDDDDDDDD0F888888880F8888888888 + 807DD0F877778880F8777777777807DDDDDDDDDDDD0F877777880F8777777778 + 807DD0FFFFFFFFF0FFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFF0FFFFFFFFFFF + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgLevels: TImage + Left = 9 + Top = 306 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDD77777777777777777777 + 7777D0000000000000000000000007DDDDDDDDDDDDD000000000000000000000 + 0007D0888888888888888888888807DDDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFF + FF07D0F000FF8F000FF8FCCCC44F07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7F77F8F77F7F8FCC99F + 7F07D0888888888888888888888807DDDDDDDDDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0FFFFFF8FFFFFF8F666CCCF07DDDDDDDDDDDDD0F7F77F8F777FF8FCC99F + 7F07D0F0000F8F00F0F8F999999F07DDCDDDDCDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDCCCCDCCDDDD0F7888888888888888888 + 7F07D0888888888888888888888807DDCCCCCCCCDDD0F7F77F8F777FF8FC99CF + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDCCCCDCCDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0F00FFF8F0000F8F9999CCF07DDCDDDDCDDDDD0F7888888888888888888 + 7F07D0FFFFFF8FFFFFF8F99AAACF07DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0F0000F8F000FF8F9999CCF07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0888888888888888888888807DDDDDDDDDDDDD0F0000000000000000000 + 0F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFF + FF07D0F0000F8F000FF8FB99944F07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7F77F8F7777F8F777FF + 7F07D0777777777777777777777707DDDDDDDDDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0F888887F888887F888888807DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0F000087F800087F800000807DDDDDDDDDDDDD0F7F77F8F7777F8F777FF + 7F07D0F888887F888887F888888807DDDDDDDDDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0FFFFFF7FFFFFF7FFFFFFFF07DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0000000000000000000000007DDCDDDDCDDDDD0F7888888888888888888 + 7F07D7F88880777777777777777778DDCCCCDCCDDDD0F7777777777777777777 + 7F07D7F00080F87777788088888888DDCCCCCCCCDDD0F7777777777777777777 + 7F07D7F77780FFFFFFFFF088888888DDCCCCDCCDDDD0F0000000000000000000 + 0F07D7FFFFF0777777777088888888DDCDDDDCDDDDD0FFFFFFFFFFFFFFFFFFFF + FF07D7777770888888888888888888DDDDDDDDDDDDD000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblLevels: TLabel + Left = 5 + Top = 285 + Width = 30 + Height = 13 + Caption = 'Levels' + end + object bvlLevels: TBevel + Left = 47 + Top = 290 + Width = 265 + Height = 4 + Shape = bsBottomLine + end + object lblGridSize: TLabel + Left = 5 + Top = 150 + Width = 19 + Height = 13 + Caption = 'Size' + end + object bvlGridSize: TBevel + Left = 33 + Top = 154 + Width = 277 + Height = 4 + Shape = bsBottomLine + end + object imgGridSize: TImage + Left = 9 + Top = 172 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000008088F07DDDDDDDDDDDD0800000000000000000000 + 807DD0F0FFFF8FFFF8FFFF0FFF0F07DDDDDDDDDDDD0F0F77FFF8F777F8F777F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCDDDDCDDDD0F0F00FFF8F00FF8F00FF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCCCCCDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCDDDDCDDDD0F0FFFFFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCCCCDCCDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCCCCCDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCDCCDDD0F0FFFFFF8F0FFF8F0FFF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0777777777777770FFF0F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F0F8887F8887F8880FFF8F07DDDDDDDDDDDD0F0F888887F88887F88880 + F07DD0F0F0087F0087F0080FFF0F07DDDDDDDDDDDD0F0F800087F80087F80080 + F07DD0F0FFFF7FFFF7FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF7FFFFF7FFFFF0 + F07DD0800000000000000008080807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxProcessSelection: TCheckBox + Left = 90 + Top = 25 + Width = 200 + Height = 17 + Caption = 'Process Selection' + TabOrder = 0 + OnClick = OptionsSelectionClick + end + object chbxProcessExactSelection: TCheckBox + Tag = 1 + Left = 90 + Top = 46 + Width = 200 + Height = 17 + Caption = 'Process Exact Selection' + TabOrder = 1 + OnClick = OptionsSelectionClick + end + object chbxExpandGroupRows: TCheckBox + Left = 90 + Top = 89 + Width = 200 + Height = 17 + Caption = 'Groups' + TabOrder = 2 + OnClick = OptionsExpandingClick + end + object chbxExpandMasterRows: TCheckBox + Tag = 1 + Left = 90 + Top = 111 + Width = 200 + Height = 17 + Caption = 'Details' + TabOrder = 3 + OnClick = OptionsExpandingClick + end + object chbxStartFromActiveView: TCheckBox + Left = 90 + Top = 236 + Width = 200 + Height = 17 + Caption = 'Start From Active Details' + TabOrder = 6 + OnClick = OptionsDetailsClick + end + object chbxOnlyActiveView: TCheckBox + Tag = 1 + Left = 90 + Top = 258 + Width = 200 + Height = 17 + Caption = 'Only Active Details' + TabOrder = 7 + OnClick = OptionsDetailsClick + end + object chbxLevelsUnwrap: TCheckBox + Left = 90 + Top = 303 + Width = 200 + Height = 17 + Caption = '&Unwrap' + TabOrder = 8 + OnClick = OptionsLevelsClick + end + object chbxLevelsUnwrapTopLevel: TCheckBox + Tag = 1 + Left = 90 + Top = 326 + Width = 200 + Height = 17 + Caption = 'Unwrap Top Level' + TabOrder = 9 + OnClick = OptionsLevelsClick + end + object chbxLevelsRiseActiveLevelOntoTop: TCheckBox + Tag = 2 + Left = 90 + Top = 349 + Width = 200 + Height = 17 + Caption = 'Rise Active Level onto Top' + TabOrder = 10 + OnClick = OptionsLevelsClick + end + object chbxGridAutoWidth: TCheckBox + Left = 90 + Top = 169 + Width = 200 + Height = 17 + Caption = '&Auto Width' + TabOrder = 5 + OnClick = OptionsSizeClick + end + object chbxExpandCards: TCheckBox + Tag = 2 + Left = 90 + Top = 132 + Width = 200 + Height = 17 + Caption = 'Cards' + TabOrder = 4 + OnClick = OptionsExpandingClick + end + end + object tshFormatting: TTabSheet + Caption = 'Formatting' + ImageIndex = 4 + object lblLookAndFeel: TLabel + Left = 5 + Top = 8 + Width = 66 + Height = 13 + Caption = 'Look and Feel' + end + object bvlLookAndFeel: TBevel + Left = 85 + Top = 12 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object imgLookAndFeel: TImage + Left = 9 + Top = 28 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D08777777777780877777788807DCCCCDCCDDD0877777777778787777788 + 8F07D08888888888880888888888807DCCCCCCCCDD0888888888888788888888 + 8F07D00000000000000000000000007DCCCCDCCDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F7777777FF07DDDDDDDDDDD0F777777777FF7F7777777 + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F777777FFF07DDDDDDDDDDD0F777777FFFFF7F777777F + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F7777777777F7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F77777FFFF07DDDDDDDDDDD0F77777777FFF7F77777FF + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D00000000000000000000000007DCDDDDCDDDD0000000000000000000000 + 0007D08888888888880888888888807DCCCCDCCDDD0777777777777777777777 + 7707D08888888888880888888888807DCCCCCCCCDD0F88888888888788888888 + 8707D08000000008880880000000807DCCCCDCCDDD0F00000000888788000000 + 8707D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + F707D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgRefinements: TImage + Left = 9 + Top = 95 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FF7FFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF777777F + F07DD0F77777777FF7FF70888FFF07DDCCCCCCCCDD0F77777777FF7FF7FFFF7F + F07DD0FFFFFFFFFFF7FF70FF8FFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF7F00F7F + F07DD0F777777FFFF7FF70FF8FFF07DDCDDDDCDDDD0F777777FFFF7FF7F00F7F + F07DD0FFFFFFFFFFF7FF70000FFF07DDDDDDDDDDDD0FFFFFFFFFFF7FF7FFFF7F + F07DD0F77777777FF7FF777777FF07DDDDDDDDDDDD0F77777777FF7FF777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFCCCCCFFF07DDCCCCCCCCDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FCCCCCCCFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F7777777FFF7FFCCCCCFFF07DDCDDDDCDDDD0F7777777FFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7F9999999FF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F777777777F7FF99999FFF07DDDDDDDDDDDD0F777777777F7F7777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F80000888887F88888888707DDDDDDDDDDDD0F80000888887F88888888 + 707DD0F80000000087F80000008707DDDDDDDDDDDD0F80000000087F80000008 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0FFFFFFFFFFF7FFFFFFFFF707DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + 707DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblRefinements: TLabel + Left = 5 + Top = 74 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlRefinements: TBevel + Left = 70 + Top = 79 + Width = 241 + Height = 4 + Shape = bsBottomLine + end + object bvlRefinementsSeparator: TBevel + Left = 90 + Top = 168 + Width = 221 + Height = 4 + Shape = bsBottomLine + end + object lblPagination: TLabel + Left = 5 + Top = 229 + Width = 50 + Height = 13 + Caption = 'Pagination' + end + object bvlPagination: TBevel + Left = 64 + Top = 234 + Width = 247 + Height = 4 + Shape = bsBottomLine + end + object imgPagination: TImage + Left = 8 + Top = 251 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDD0000000000000000000000007DDDDDDDDDDDD77777777777777770DDDDD + DDDDD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD7FFFFFFFFFFFFFFF0DDDDD + DDDDD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD7F8888888888888F0DDDDD + DDDDD0888000000000000000088F07DDDDDDDDDDDD7F8777877778778F07770D + DDDDD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7F8888888888888F0FFF0D + DDDDD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F088F0D + DDDDD0F9F0F00F8F00F8F00F0F9F07DDDDDDDDDDDD7F8888888888888F078F07 + 770DD0F990FFFF8FFFF8FFFF099F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F088F0F + FF0DD0F99999999999999999999F07DDCDDDDCDDDD7F8FFF8FFFF8FF8F0F8F08 + 8F0DD0F990FFFF8FFFF8FFFF099F07DDCCCCDCCDDD7F8888888888888F088F07 + 8F0DD0F9F0FFFF8F00F8F00F0F9F07DDCCCCCCCCDD7F8FFF8FFFF8FF8F0F8F08 + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDCCCCDCCDDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F8F0FFFF8F00F8F00F0F8F07DDCDDDDCDDDD7F8888888888888F088F08 + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F9F0F00F8F00F8F00F0F9F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F990FFFF8FFFF8FFFF099F07DDCDDDDCDDDD7F8888888888888F088F0F + 8F0DD0F99999999999999999999F07DDCCCCDCCDDD7F8FFF8FFFF8FF8F0F8F08 + 8F0DD0F990FFFF8FFFF8FFFF099F07DDCCCCCCCCDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F9F0FFFF8F00F8F00F0F9F07DDCCCCDCCDDD7F8888888888888F088F0F + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDCDDDDCDDDD7F8777877778778F0F8F08 + 8F0DD0F8F0F00F8F00F8F00F0F8F07DDDDDDDDDDDD7F8888888888888F0F8F0F + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7FFFFFFFFFFFFFFF088F0F + 8F0DD0F8F0777777777777770F8F07DDDDDDDDDDDD0000000000000000078F08 + 8F0DD0F8F0F8887F8887F8880F8F07DDDDDDDDDDDDDDDD7F8888888888888F0F + 8F0DD0F8F0F0087F0087F0080F8F07DDDDDDDDDDDDDDDD7FFFFFFFFFFFFFFF08 + 8F0DD0F8F0FFFF7FFFF7FFFF0F8F07DDDDDDDDDDDDDDDD00000000000000000F + 8F0DD0888000000000000000088807DDDDDDDDDDDDDDDDDDDD7F888888888888 + 8F0DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDDDDDDDDDD7FFFFFFFFFFFFF + FF0DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDDDDDDDDDD00000000000000 + 000DD000000000000000000000000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object cbxLookAndFeel: TComboBox + Left = 90 + Top = 33 + Width = 212 + Height = 21 + Style = csDropDownList + ItemHeight = 0 + TabOrder = 0 + OnClick = LookAndFeelClick + end + object chbxFlatCheckMarks: TCheckBox + Tag = 2 + Left = 90 + Top = 142 + Width = 200 + Height = 17 + Caption = 'Flat Check &Marks' + TabOrder = 3 + OnClick = OptionsRefinementClick + end + object chbxDisplayGraphicsAsText: TCheckBox + Tag = 1 + Left = 90 + Top = 119 + Width = 200 + Height = 17 + Caption = 'Display Graphics As &Text' + TabOrder = 2 + OnClick = OptionsRefinementClick + end + object chbxTransparentGraphics: TCheckBox + Left = 90 + Top = 96 + Width = 200 + Height = 17 + Caption = 'Transparent &Graphics' + TabOrder = 1 + OnClick = OptionsRefinementClick + end + object chbxSuppressBackgroundBitmaps: TCheckBox + Tag = 1 + Left = 90 + Top = 181 + Width = 200 + Height = 17 + Caption = 'Suppress Background Images' + TabOrder = 4 + OnClick = OptionsFormatingClick + end + object chbxConsumeSelectionStyle: TCheckBox + Tag = 2 + Left = 90 + Top = 203 + Width = 200 + Height = 17 + Caption = 'Consume Selection Style' + TabOrder = 5 + OnClick = OptionsFormatingClick + end + object chbxPaginateOneGroupPerPage: TCheckBox + Tag = 1 + Left = 90 + Top = 274 + Width = 200 + Height = 17 + Caption = 'One Group Per Page' + TabOrder = 7 + OnClick = OptionsPaginationClick + end + object chbxPaginateByTopLevelGroups: TCheckBox + Left = 90 + Top = 251 + Width = 200 + Height = 17 + Caption = 'By TopLevel Groups' + TabOrder = 6 + OnClick = OptionsPaginationClick + end + end + object tshStyles: TTabSheet + Caption = 'Styles' + ImageIndex = 5 + object bvlStyles: TBevel + Left = 118 + Top = 12 + Width = 191 + Height = 4 + Shape = bsBottomLine + end + object bvlStyleSheets: TBevel + Left = 72 + Top = 295 + Width = 237 + Height = 5 + Shape = bsBottomLine + end + object lblStyleSheets: TLabel + Left = 6 + Top = 291 + Width = 60 + Height = 13 + Caption = 'Style Sheets' + end + object bvlStylesHost: TBevel + Left = 6 + Top = 33 + Width = 228 + Height = 219 + end + object Label1: TLabel + Left = 76 + Top = 135 + Width = 68 + Height = 13 + Caption = '[ Styles Host ]' + Visible = False + end + object lblUseNativeStyles: TLabel + Left = 24 + Top = 9 + Width = 84 + Height = 13 + Caption = '&Use Native Styles' + FocusControl = chbxUseNativeStyles + OnClick = lblUseNativeStylesClick + end + object btnStyleColor: TButton + Left = 243 + Top = 61 + Width = 68 + Height = 23 + Caption = 'Co&lor...' + TabOrder = 2 + OnClick = StyleColorClick + end + object btnStyleFont: TButton + Left = 243 + Top = 33 + Width = 68 + Height = 23 + Caption = '&Font...' + TabOrder = 1 + OnClick = StyleFontClick + end + object btnStyleBackgroundBitmap: TButton + Left = 243 + Top = 97 + Width = 68 + Height = 23 + Caption = '&Bitmap...' + TabOrder = 3 + OnClick = StyleBackgroundBitmapClick + end + object chbxUseNativeStyles: TCheckBox + Left = 5 + Top = 8 + Width = 14 + Height = 17 + TabOrder = 0 + OnClick = OptionsFormatingClick + end + object cbxStyleSheets: TComboBox + Left = 6 + Top = 311 + Width = 302 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 7 + OnClick = cbxStyleSheetsClick + OnDrawItem = cbxStyleSheetsDrawItem + OnKeyDown = cbxStyleSheetsKeyDown + end + object btnStyleSheetNew: TButton + Left = 6 + Top = 343 + Width = 71 + Height = 23 + Caption = '&New...' + TabOrder = 8 + OnClick = StyleSheetNewClick + end + object btnStyleSheetCopy: TButton + Left = 83 + Top = 343 + Width = 71 + Height = 23 + Caption = '&Copy...' + TabOrder = 9 + OnClick = StyleSheetCopyClick + end + object btnStyleSheetDelete: TButton + Left = 160 + Top = 343 + Width = 71 + Height = 23 + Caption = '&Delete...' + TabOrder = 10 + OnClick = StyleSheetDeleteClick + end + object btnStylesSaveAs: TButton + Left = 123 + Top = 259 + Width = 112 + Height = 23 + Caption = 'Save &As...' + TabOrder = 6 + OnClick = StylesSaveAsClick + end + object btnStyleSheetRename: TButton + Left = 237 + Top = 343 + Width = 71 + Height = 23 + Caption = '&Rename...' + TabOrder = 11 + OnClick = StyleSheetRenameClick + end + object btnStyleBackgroundBitmapClear: TButton + Left = 243 + Top = 125 + Width = 68 + Height = 23 + Caption = 'Cle&ar' + TabOrder = 4 + OnClick = StyleBackgroundBitmapClearClick + end + object btnStyleRestoreDefaults: TButton + Left = 6 + Top = 259 + Width = 112 + Height = 23 + Caption = 'Rest&ore Defaults' + TabOrder = 5 + OnClick = StyleRestoreDefaultsClick + end + end + object tshPreview: TTabSheet + Caption = 'Preview' + ImageIndex = 2 + object lblPreviewOptions: TLabel + Left = 5 + Top = 8 + Width = 37 + Height = 13 + Caption = 'Options' + end + object bvlPreviewOptions: TBevel + Left = 50 + Top = 12 + Width = 261 + Height = 4 + Shape = bsBottomLine + end + object lblPreviewMaxLineCount: TLabel + Left = 91 + Top = 73 + Width = 78 + Height = 13 + Caption = 'Max Line Count:' + end + object bvlPreviewMaxLineCountHost: TBevel + Left = 229 + Top = 69 + Width = 68 + Height = 21 + Visible = False + end + object imgPreview: TImage + Left = 9 + Top = 28 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDD7777777777777777777777777DDDDDD0000000000000000000000000 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F888F7FF888F7F8888F7F07DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F0 + 7DDDDDD0F777777777777777777777F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCFFCCCCFFCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCFCCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCFCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCFCCFCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCFFCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F777777777777777777777F07DDDDDD0F7F888F7FF888F7FF888F7F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F88887F888887F888887F07DDDDDD0F7F00087F000087F000087F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0000000000000000000000000 + DDDD} + Transparent = True + end + object chbxPreviewVisible: TCheckBox + Left = 90 + Top = 28 + Width = 150 + Height = 17 + Caption = 'Visible' + TabOrder = 0 + OnClick = PreviewVisibleClick + end + object chbxPreviewAutoHeight: TCheckBox + Left = 90 + Top = 49 + Width = 150 + Height = 17 + Caption = 'Auto Height' + TabOrder = 1 + OnClick = PreviewAutoHeightClick + end + end + object tshCards: TTabSheet + Caption = 'Cards' + ImageIndex = 3 + object bvlCardSpaceVertHost: TBevel + Left = 231 + Top = 140 + Width = 75 + Height = 21 + Visible = False + end + object bvlCardSpaceHorzHost: TBevel + Left = 231 + Top = 112 + Width = 75 + Height = 21 + Visible = False + end + object lblCardSpaceVert: TLabel + Left = 90 + Top = 145 + Width = 39 + Height = 13 + Caption = 'Vertical:' + end + object lblCardSpaceHorz: TLabel + Left = 90 + Top = 116 + Width = 52 + Height = 13 + Caption = 'Horizontal:' + end + object imgCardSpacing: TImage + Left = 9 + Top = 112 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDD0DD0DDDDDDDDDDDDDDDDDD0DD0DDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDD00D0DDDDDDDDDDDDDDDDDD0D00DDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDD000000000000000000000000000000DDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDD00D0DDDDDDDDDDDDDDDDDD0D00DDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDD7DD0DDDDDD707000DDDDDD0DD7DDDDDDDDDDDDDDD + DDDDDDDDD0000000000000000000DDDDDD0D0D0DDDDDD0000000000000000000 + 0DDDDDDD77777777777777777770DDDDD00D0D0DDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDD0D000DDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7FFFFFFF7FFF9999FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFF9999FF7 + 0DDDDDDD7FFFFFFF7FFF9999FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFF9999FF7 + 0DDDDDDD7FFFFFFF7FCCCC99FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FCCCC99FF7 + 0DDDDDDD7FFFFFFF7FCCCC99FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FCCCC99FF7 + 0DDDDDDD7F77777F7FCCCCFFFF70DDDDDDDDDDDDDDDDD7F77777F7FCCCCFFFF7 + 0DDDDDDD7F77777F7FCCCCFFFF70DDDDDDDDDDDDDDDDD7F77777F7FCCCCFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD77777777777777777770DDDDDDDDDDDDDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7F77777F7FF777777F70DDDDDDDDDDDDDDDDD7F77777F7FF777777F7 + 0DDDDDDD7F7FFFFF7FF7FFFFFF70DDDDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD77777777777777777770DDDDDDDDDDDDDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7F77777F7FF77777FF70DDDDDDDDDDDDDDDDD7F77777F7FF777777F7 + 0DDDDDDD7F7FFFFF7FF77FFFFF70DDDDDDDDDDDDDDDDD7F7FFFFF7FF77FFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD77777777777777777770DDDDDDDDDDDDDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7F77777F7FF777777F70DDDDDDDDDDDDDDDDD7F77777F7FF777777F7 + 0DDDDDDD7F7FFFFF7FF7FFFFFF70DDDDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7777777777777777777DDDDDDDDDDDDDDDDDD7777777777777777777 + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblCardSpacing: TLabel + Left = 5 + Top = 92 + Width = 37 + Height = 13 + Caption = 'Spacing' + end + object bvlCardSpacing: TBevel + Left = 51 + Top = 97 + Width = 260 + Height = 4 + Shape = bsBottomLine + end + object bvlCardSizes: TBevel + Left = 34 + Top = 12 + Width = 277 + Height = 4 + Shape = bsBottomLine + end + object lblCardSizes: TLabel + Left = 5 + Top = 8 + Width = 24 + Height = 13 + Caption = 'Sizes' + end + object imgCardSizes: TImage + Left = 9 + Top = 28 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDD000000000000DDDDDDDDDDDDDDDDDDDDDDDD000000000000DD00000000 + 0000D7777777777770DDDDDDDDDDDDDDDDDDDDDDD7777777777770D777777777 + 7770D7FFFFF8FFFF70DDDDDDDDDDDDDDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8FFFF70DDDDDDDDDDDDDDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70DDDDDDDDDDDDDDDDDDDDDDD7FFFFF8F77F70D7FFFFF8FF + FF70D7FFFFF8FFFF70DDDDDDDDDDDDDDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70DD0000000000DDCCCCDCCDD7FFFFF8F77F70D7FFFFF8FF + FF70D7FFFFF8FFFF70D77777777770DDCCCCCCCCD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70D7FFFF8FFF70DDCCCCDCCDD7FFFFF8F77F70D7FFFFF8FF + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70D7FFFF8F7F70DDDDDDDDDDD7FFFFF8F77F70D7FFFFF8F7 + FF70D7F777F8FFFF70D7FFFF8FFF70DDDDDDDDDDD7F777F8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDDDDDDDDDD7F777F8F77F70D7F77FF8F7 + 7F70D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7888888888870D78888888870DDDDDDDDDDD7888888888870D788888888 + 8870D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDDDDDDDDDD7F777F8F77F70D7F77FF8F7 + FF70D7F777F8FFFF70D7F77F8F7F70DDDDDDDDDDD7F777F8FFFF70D7F77FF8F7 + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7888888888870D78888888870DDDDDDDDDDD7888888888870D788888888 + 8870D7FFFFF8FFFF70D7FFFF8FFF70DDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDCCCCDCCDD7F777F8F77F70D7F77FF8F7 + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDCCCCCCCCD7FFFFF8FFFF70D7FFFFF8FF + FF70D7888888888870D78888888870DDCCCCDCCDD7888888888870D788888888 + 8870D7FFFFF8FFFF70D7FFFF8FFF70DDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDDDDDDDDDD7F777F8F77F70D7F77FF8F7 + FF70D7F7FFF8FFFF70D7F7FF8F7F70DDDDDDDDDDD7F7FFF8FFFF70D7F7FFF8F7 + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D777777777777DD7777777777DDDDDDDDDDDD777777777777DD777777777 + 777DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgCardFraming: TImage + Left = 9 + Top = 189 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDD7777777777777777777DDDDDDDDDDDDDDDDDD00000000000000000 + 00DDDDDDD88888888888888888887DDDDDDDDDDDDDDDDD000000000000000000 + 00DDDDDDD8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDDDDD0FFFFFFF0FFFFFFFFF + 00DDDDD778FFFFFFF8FFF9999FF87DDDDDDDDDDDDDDD000FFFFFFF0FFF9999FF + 00DDDD8888FFFFFFF8FFF9999FF87DDDDDDDDDDDDDD0000FFFFFFF0FFF9999FF + 00DDDD8FF8FFFFFFF8FCCCC99FF87DDDCDDDDCDDDDD0FF0FFFFFFF0FCCCC99FF + 00DDDD8FF8FFFFFFF8FCCCC99FF87DDDCCCCDCCDDDD0FF0FFFFFFF0FCCCC99FF + 00DDDD8FF8F77777F8FCCCCFFFF87DDDCCCCCCCCDDD0FF0F77777F0FCCCCFFFF + 00DDDD8FF8F77777F8FCCCCFFFF87DDDCCCCDCCDDDD0FF0F77777F0FCCCCFFFF + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDCDDDDCDDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDDDDDDDDDDDD0F7000000000000000000 + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF777777F87DDDDDDDDDDDDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF7FFFFFF87DDDDDDDDDDDDDD0000F7FFFFF0FF7FFFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDDDDDDDDDDDD0F7000000000000000000 + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF77777FF87DDDDDDDDDDDDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF77FFFFF87DDDDDDDDDDDDDD0000F7FFFFF0FF77FFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDCDDDDCDDDDD0F7000000000000000000 + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDCCCCDCCDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF777777F87DDDCCCCCCCCDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF7FFFFFF87DDDCCCCDCCDDDD0000F7FFFFF0FF7FFFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDCDDDDCDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F78888888888888888888DDDDDDDDDDDDDDD0F7000000000000000000 + 0DDDDD8F7FFFFF8FF7FFFFFF87DDDDDDDDDDDDDDDDD0F7FFFFF0FF7FFFFFF00D + DDDDDD8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDDDDD0FFFFFFF0FFFFFFFFF00D + DDDDDD8888888888888888888DDDDDDDDDDDDDDDDDD0000000000000000000DD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblCardFraming: TLabel + Left = 5 + Top = 171 + Width = 38 + Height = 13 + Caption = 'Framing' + end + object bvlCardFraming: TBevel + Left = 49 + Top = 176 + Width = 262 + Height = 4 + Shape = bsBottomLine + end + object bvlCardShadowColorHost: TBevel + Left = 177 + Top = 276 + Width = 129 + Height = 21 + Visible = False + end + object lblCardShadowDepth: TLabel + Left = 90 + Top = 308 + Width = 33 + Height = 13 + Caption = 'Depth:' + end + object bvlCardShadow: TBevel + Left = 48 + Top = 260 + Width = 263 + Height = 4 + Shape = bsBottomLine + end + object lblCardShadow: TLabel + Left = 5 + Top = 255 + Width = 38 + Height = 13 + Caption = 'Shadow' + end + object lblCardShadowColor: TLabel + Left = 90 + Top = 280 + Width = 29 + Height = 13 + Caption = 'Color:' + end + object bvlCardShadowDepthHost: TBevel + Left = 177 + Top = 304 + Width = 129 + Height = 21 + Visible = False + end + object imgCardShadow: TImage + Left = 9 + Top = 276 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD0000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD0000000000000000000 + 000DDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDCDDDDCDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7FFFFFFF7FFF9999FFFFF7DDDDCCCCDCCDDDD7FFFFFFF7FFF9999FFFFF + 700DDD7FFFFFFF7FFF9999FFFFF7DDDDCCCCCCCCDDD7FFFFFFF7FFF9999FFFFF + 700DDD7FFFFFFF7FCCCC99FFFFF7DDDDCCCCDCCDDDD7FFFFFFF7FCCCC99FFFFF + 700DDD7FFFFFFF7FCCCC99FFFFF7DDDDCDDDDCDDDDD7FFFFFFF7FCCCC99FFFFF + 700DDD7F77777F7FCCCCFFFFFFF7DDDDDDDDDDDDDDD7F77777F7FCCCCFFFFFFF + 700DDD7F77777F7FCCCCFFFFFFF7DDDDDDDDDDDDDDD7F77777F7FCCCCFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7F77777F7FF777777FFFF7DDDDDDDDDDDDDDD7F77777F7FF777777FFFF + 700DDD7F7FFFFF7FF7FFFFFFFFF7DDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7F77777F7FF77777FFFFF7DDDDCDDDDCDDDDD7F77777F7FF77777FFFFF + 700DDD7F7FFFFF7FF77FFFFFFFF7DDDDCCCCDCCDDDD7F7FFFFF7FF77FFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDCCCCCCCCDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7777777777777777777777DDDDCCCCDCCDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDCDDDDCDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7F77777F7FF777777FFFF7DDDDDDDDDDDDDDD7F77777F7FF777777FFFF + 700DDD7F7FFFFF7FF7FFFFFFFFF7DDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 7DDDDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 7DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxCardsKeepSameHeight: TCheckBox + Tag = 2 + Left = 90 + Top = 70 + Width = 200 + Height = 17 + Caption = 'Keep Same Height' + TabOrder = 2 + OnClick = OptionsCardsClick + end + object chbxCardsKeepSameWidth: TCheckBox + Tag = 1 + Left = 90 + Top = 49 + Width = 200 + Height = 17 + Caption = 'Keep Same Width' + TabOrder = 1 + OnClick = OptionsCardsClick + end + object chbxCardsAutoWidth: TCheckBox + Left = 90 + Top = 28 + Width = 200 + Height = 17 + Caption = 'Auto Width' + TabOrder = 0 + OnClick = OptionsCardsClick + end + object chbxCardsVertLines: TCheckBox + Tag = 5 + Left = 90 + Top = 231 + Width = 200 + Height = 17 + Caption = 'Vertical Lines' + TabOrder = 5 + OnClick = OptionsCardsClick + end + object chbxCardsHorzLines: TCheckBox + Tag = 4 + Left = 90 + Top = 210 + Width = 200 + Height = 17 + Caption = 'Horizontal Lines' + TabOrder = 4 + OnClick = OptionsCardsClick + end + object chbxCardsBorder: TCheckBox + Tag = 3 + Left = 90 + Top = 189 + Width = 200 + Height = 17 + Caption = 'Border' + TabOrder = 3 + OnClick = OptionsCardsClick + end + end + object tshCharts: TTabSheet + Caption = 'Charts' + ImageIndex = 6 + object lblChartsOptions: TLabel + Left = 5 + Top = 8 + Width = 37 + Height = 13 + Caption = 'Options' + end + object imgCharts: TImage + Left = 9 + Top = 28 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDD777777777777777777777777DDDDDDD000000000000000000000000 + 7DDDDDDD0887FFFFFFFFFFFFFFFFFFF07DDDDDDD0887F8888888888888888880 + 7DDDDDDD0887F8FC491A2FFC491A2FF07DDDDDDD0887F8FC491A2FFC491A2FF0 + 7DDDDDDD0887F8FC4FFA2FFC491A2FF07DDDDDDD0887F8FC4FFA2FFC4FFA2FF0 + 7DDDDDDD0887F8FFFFFFFFFFFFFFFFF07DDDDDDD088777777777777777777770 + 7DDDDDDD0888888888888888888888807DDDDDDD087807777777788888888880 + 7DDDDDDD0888888888888888888888807DDDDDDD077777777777777777777770 + 7DDDDDDD0887FFFFFFFFFFFFFFFFFFF07DDDDDDD0887F8888888888888888880 + 7DDDDDDD0887F8FC491A2FFC491A2FF07DDDDDDD0887F8FC491A2FFC491A2FF0 + 7DDDDDDD0887F8FC491FFFFC491A2FF07DDDDDDD0887F8FFF91FFFFC4FFA2FF0 + 7DDDDDDD0887F8FFFFFFFFFFFFFFFFF07DDDDDDD088777777777777777777770 + 7DDDDDDD0888888888888888888888807DDDDDDD087800777777788888888880 + 7DDDDDDD0888888888888888888888807DDDDDDD077777777777777777777770 + 7DDDDDDD0F8888887F888888888888807DDDDDDD0F8000087F80000000088880 + 7DDDDDDD0F8888887F888888888888807DDDDDDD0FFFFFFF7FFFFFFFFFFFFFF0 + 7DDDDDDD000000000000000000000000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object bvlChartsOptions: TBevel + Left = 57 + Top = 12 + Width = 254 + Height = 4 + Shape = bsBottomLine + end + object chbxChartsTransparent: TCheckBox + Left = 90 + Top = 28 + Width = 200 + Height = 17 + Caption = 'Transparent' + TabOrder = 0 + OnClick = chbxChartsTransparentClick + end + end + end + object pnlPreview: TPanel + Left = 331 + Top = 44 + Width = 306 + Height = 350 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + object PreviewGrid: TcxGrid + Left = 5 + Top = 7 + Width = 296 + Height = 337 + TabOrder = 0 + LookAndFeel.NativeStyle = False + RootLevelOptions.DetailTabsPosition = dtpTop + object PreviewBandedView: TcxGridBandedTableView + NavigatorButtons.ConfirmDelete = False + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'Count = 0' + Kind = skCount + Position = spFooter + Column = colVendorName + end> + DataController.Summary.FooterSummaryItems = < + item + Format = 'Count = 0' + Kind = skCount + Column = colVendorName + end> + DataController.Summary.SummaryGroups = <> + Filtering.CustomizeDialog = False + Filtering.Visible = fvAlways + OptionsView.ScrollBars = ssNone + OptionsView.CellAutoHeight = True + OptionsView.ColumnAutoWidth = True + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.GroupFooters = gfAlwaysVisible + Preview.Column = colVendorCountry + Preview.Visible = True + OnCustomDrawColumnHeader = PreviewBandedViewCustomDrawColumnHeader + OnCustomDrawFooterCell = PreviewBandedViewCustomDrawFooterCell + Bands = < + item + Caption = 'Vendor Data' + Width = 150 + end + item + Caption = 'Car Data' + end> + OnCustomDrawBandHeader = PreviewBandedViewCustomDrawBandHeader + object colVendorName: TcxGridBandedColumn + Caption = 'Name' + PropertiesClassName = 'TcxTextEditProperties' + Options.Filtering = False + Position.BandIndex = 0 + Position.ColIndex = 0 + Position.RowIndex = 0 + end + object colVendorLogo: TcxGridBandedColumn + Caption = 'Logo' + PropertiesClassName = 'TcxImageProperties' + Properties.GraphicTransparency = gtTransparent + OnCustomDrawCell = VendorLogoCustomDrawCell + Options.Filtering = False + Position.BandIndex = 0 + Position.ColIndex = 1 + Position.RowIndex = 0 + end + object colVendorCountry: TcxGridBandedColumn + PropertiesClassName = 'TcxTextEditProperties' + Position.BandIndex = 0 + Position.ColIndex = 2 + Position.RowIndex = 0 + end + object colCarModel: TcxGridBandedColumn + Caption = 'Model' + PropertiesClassName = 'TcxTextEditProperties' + Options.Filtering = False + Position.BandIndex = 1 + Position.ColIndex = 0 + Position.RowIndex = 0 + end + object colIsSUVModel: TcxGridBandedColumn + Caption = 'SUV' + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.ValueGrayed = #39#39 + OnCustomDrawCell = IsSUVModelCustomDrawCell + HeaderAlignmentHorz = taCenter + Options.Filtering = False + Width = 30 + Position.BandIndex = 1 + Position.ColIndex = 1 + Position.RowIndex = 0 + end + end + object PreviewGridLevel: TcxGridLevel + Caption = 'Cars' + end + end + end + object pmStyles: TPopupMenu + Images = ilStylesPopup + OnPopup = pmStylesPopup + Left = 4 + Top = 408 + object miStyleFont: TMenuItem + Caption = '&Font...' + ImageIndex = 0 + OnClick = StyleFontClick + end + object miStyleColor: TMenuItem + Caption = '&Color...' + OnClick = StyleColorClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miStyleBackgroundBitmap: TMenuItem + Caption = '&Bitmap...' + ImageIndex = 1 + ShortCut = 16463 + OnClick = StyleBackgroundBitmapClick + end + object miStyleBackgroundBitmapClear: TMenuItem + Caption = 'Clear' + ImageIndex = 3 + ShortCut = 16430 + OnClick = StyleBackgroundBitmapClearClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miStyleRestoreDefaults: TMenuItem + Caption = 'Restore Defaults' + OnClick = StyleRestoreDefaultsClick + end + object milLine: TMenuItem + Caption = '-' + end + object miStylesSelectAll: TMenuItem + Caption = 'Select A&ll' + ShortCut = 16449 + OnClick = miStylesSelectAllClick + end + object miLine4: TMenuItem + Caption = '-' + end + object miStylesSaveAs: TMenuItem + Caption = 'Save &As...' + ImageIndex = 2 + ShortCut = 16467 + OnClick = StylesSaveAsClick + end + end + object ilStylesPopup: TImageList + Left = 32 + Top = 408 + Bitmap = { + 494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00000000000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF000000 + 0000008080000080800000808000008080000080800000808000008080000080 + 8000008080000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000000000000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000008080000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF00FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800080808000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00C0C0C00000FFFF00C0C0C000FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000000000008080800080808000000000008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C00000000000C0C0C00000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFC001FFFF + FE07001F8001FFF9FF9F000F8001E7FFFF9F00078001C3F3E01F00038001C3E7 + F99F00018001E1C7F99B00008001F08FF99B00018001F81FF89300018001FC3F + D80300018001F81FD9BF80018001F09FC93FE0018001C1C7C03FE001800183E3 + FFFFE00180018FF1FFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end + object cxStyleRepository1: TcxStyleRepository + Left = 60 + Top = 408 + object styleCardShadow: TcxStyle + end + object styleCardBorder: TcxStyle + AssignedValues = [svColor] + Color = clWindow + end + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxGridLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxGridLnk.pas new file mode 100644 index 00000000..02b57217 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxGridLnk.pas @@ -0,0 +1,17965 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxGridLnk; + +{$I cxVer.Inc} +{$DEFINE CHARTVIEW} + +interface + +uses + Windows, SysUtils, Messages, Classes, Graphics, Controls, StdCtrls, ComCtrls, + ExtCtrls, ImgList, Dialogs, ExtDlgs, Menus, cxGraphics, cxClasses, cxControls, + cxCustomData, cxDataStorage, cxData, cxDBData, cxGridDBDataDefinitions, cxGrid, + cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, + cxGridCardView, cxGridDBCardView, cxGridBandedTableView, cxGridDBBandedTableView, + {$IFDEF CHARTVIEW}cxGridChartView, cxGridDBChartView, {$ENDIF} + {$IFNDEF DXVER500}cxGridViewData, {$ENDIF} cxGridLevel, cxStyles, cxLookAndFeels, + cxLookAndFeelPainters, cxFilter, cxEdit, cxTextEdit, cxCheckBox, cxImage, dxBase, + dxPSSngltn, dxExtCtrls, dxPSCore, dxPrnPg, dxPScxCommon; + +const + vspsGridFirst = 0; + vspsGridBandHeader = vspsGridFirst + 0; + vspsGridCaption = vspsGridFirst + 1; + vspsGridCardCaptionRow = vspsGridFirst + 2; + vspsGridCardRowCaption = vspsGridFirst + 3; + vspsGridContent = vspsGridFirst + 4; + vspsGridContentEven = vspsGridFirst + 5; + vspsGridContentOdd = vspsGridFirst + 6; + vspsGridFilterBar = vspsGridFirst + 7; + vspsGridFooter = vspsGridFirst + 8; + vspsGridGroup = vspsGridFirst + 9; + vspsGridHeader = vspsGridFirst + 10; + vspsGridPreview = vspsGridFirst + 11; + vspsGridSelection = vspsGridFirst + 12; + vspsGridLast = vspsGridFirst + 12; + + vsCardShadow = vsCardViewLast + 1; + vsCardViewLast = vsCardShadow; + + bbTabs = -1; + + dxDefaultInterCardsSpaceHorz = 4; + dxDefaultInterCardsSpaceVert = 4; + dxDefaultCardsShadowDepth = 4; + dxDefaultCardsShadowColor = clBlack; + + dxGridAttributeIDBase = 0; + dxGridUndefinedID = dxGridAttributeIDBase + 0; + dxGridBandID = dxGridAttributeIDBase + 1; + dxGridCardRowCaptionID = dxGridAttributeIDBase + 2; + dxGridCardRowDataID = dxGridAttributeIDBase + 3; + dxGridFilterBarID = dxGridAttributeIDBase + 4; + dxGridFooterID = dxGridAttributeIDBase + 5; + dxGridGroupFooterID = dxGridAttributeIDBase + 6; + dxGridHeaderID = dxGridAttributeIDBase + 7; + dxGridLevelCaptionID = dxGridAttributeIDBase + 8; + dxGridRecordID = dxGridAttributeIDBase + 9; + +type + TdxGridAttributeHostInfo = class; + TdxGridAttributeHostInfoServices = class; + TdxGridReportLink = class; + TdxGridReportLinkOptionsExpanding = class; + TdxfmGridReportLinkDesignWindow = class; + + TdxCustomGridViewAdapter = class; + TdxCustomGridViewFormatter = class; + TdxCustomGridViewBuilder = class; + + TdxCustomGridTableViewAdapter = class; + TdxCustomGridTableViewBuilder = class; + + TdxGridTableViewAdapter = class; + TdxGridTableViewFormatter = class; + TdxGridTableViewBuilder = class; + + TdxGridBandedTableViewAdapter = class; + TdxGridBandedTableViewFormatter = class; + TdxGridBandedTableViewBuilder = class; + + TdxGridCardViewBuilder = class; + +{$IFDEF CHARTVIEW} + TdxGridChartViewBuilder = class; +{$ENDIF} + + TdxGridTableViewColumnPlace = class; + TdxGridTableViewColumnPlaceController = class; + TdxCustomGridBandedTableViewItemPlace = class; + TdxGridBandedTableViewItemPlace = class; + TdxGridBandedTableViewItemPlaceController = class; + + TdxGridViewRowProducerClass = class of TdxGridViewRowProducer; + TdxGridViewRowProducer = class; + TdxGridViewCaptionProducerClass = class of TdxGridViewCaptionProducer; + TdxGridViewCaptionProducer = class; + TdxGridViewFilterBarProducerClass = class of TdxGridViewFilterBarProducer; + TdxGridViewFilterBarProducer = class; + TdxGridViewDetailsSeparatorProducerClass = class of TdxGridViewDetailsSeparatorProducer; + TdxGridViewDetailsSeparatorProducer = class; + TdxGridViewTerminatorProducerClass = class of TdxGridViewTerminatorProducer; + TdxGridViewTerminatorProducer = class; + TdxGridTableViewHeadersProducerClass = class of TdxGridTableViewHeadersProducer; + TdxGridTableViewHeadersProducer = class; + TdxGridTableViewFootersProducerClass = class of TdxGridTableViewFootersProducer; + TdxGridTableViewFootersProducer = class; + TdxGridTableViewCustomDataRowProducerClass = class of TdxGridTableViewCustomDataRowProducer; + TdxGridTableViewCustomDataRowProducer = class; + TdxGridTableViewRowSeparatorProducerClass = class of TdxGridTableViewRowSeparatorProducer; + TdxGridTableViewRowSeparatorProducer = class; + TdxGridTableViewGroupFooterProducerClass = class of TdxGridTableViewGroupFooterProducer; + TdxGridTableViewGroupFooterProducer = class; + TdxGridTableViewGroupRowSeparatorProducerClass = class of TdxGridTableViewGroupRowSeparatorProducer; + TdxGridTableViewGroupRowSeparatorProducer = class; + TdxGridTableViewBandsProducerClass = class of TdxGridTableViewBandsProducer; + TdxGridTableViewBandsProducer = class; + TdxGridCardViewCardsRowProducerClass = class of TdxGridCardViewCardsRowProducer; + TdxGridCardViewCardsRowProducer = class; +{$IFDEF CHARTVIEW} + TdxGridChartViewChartProducerClass = class of TdxGridChartViewChartProducer; + TdxGridChartViewChartProducer = class; +{$ENDIF} + + { View Attributes } + + TdxGridAttributeClass = class of TdxGridAttribute; + TdxGridAttributeClasses = array of TdxGridAttributeClass; + TdxGridAttribute = class end; + + TdxGridBandHeader = class(TdxGridAttribute); + TdxGridCardRowCaption = class(TdxGridAttribute); + TdxGridCardRowData = class(TdxGridAttribute); + TdxGridDetails = class(TdxGridAttribute); + TdxGridExpandButton = class(TdxGridAttribute); + TdxGridFilterBar = class(TdxGridAttribute); + TdxGridFooter = class(TdxGridAttribute); + TdxGridGroupFooter = class(TdxGridAttribute); + TdxGridGroupRow = class(TdxGridAttribute); + TdxGridHeader = class(TdxGridAttribute); + TdxGridLevelCaption = class(TdxGridAttribute); + TdxGridPreview = class(TdxGridAttribute); + + TdxGridAttributeID = type Integer; + + + TdxGridCellCustomDrawInfo = record + GridAttributeID: TdxGridAttributeID; + GridView: TcxCustomGridView; + GridRecord: TcxCustomGridRecord; + GridColumn: TcxGridColumn; + GroupLevel: Integer; + GridBand: TcxGridBand; + GridCard: TcxGridCard; + GridCardRow: TcxGridCardViewRow; + (*case Byte of + 0: (GridRecord: TcxCustomGridRecord; + GridColumn: TcxGridColumn; + GroupLevel: Integer; + GridBand: TcxGridBand); + 1: (GridCard: TcxGridCard; + GridCardRow: TcxGridCardViewRow); *) + end; + + + TdxAttributeColorKind = (ackContentColor, ackTextColor); + + TdxVerticalDetailsSeparatorKind = (vdskLeading, vdskTrailing); + + { View Helpers } + + TdxCustomGridViewHelperClass = class of TdxCustomGridViewHelper; + + TdxCustomGridViewHelper = class(TdxCustomClassMapItem) + private + FView: TcxCustomGridView; + protected + class procedure AddAttribute(var AnAtributes: TdxGridAttributeClasses; AnAttribute: TdxGridAttributeClass); + class function FilterPosition(AView: TcxCustomGridView): TcxGridFilterPosition; virtual; + + class function IsFilterBarAtBottom(AView: TcxCustomGridView): Boolean; virtual; + class function IsFilterBarAtTop(AView: TcxCustomGridView): Boolean; virtual; + class function IsOffice11StyleGrouping(AView: TcxCustomGridView): Boolean; virtual; + class function ViewClass: TcxCustomGridViewClass; virtual; + public + constructor Create(AView: TcxCustomGridView); virtual; + + class function PairClass: TClass; override; + class procedure Register; + class procedure Unregister; + + class function ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; virtual; + class procedure ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); virtual; + class function ExtractGridView(AnItem: TdxReportVisualItem): TcxCustomGridView; virtual; + class function IsAttributeSupported(AnAttribute: TdxGridAttributeClass): Boolean; virtual; + class function SupportedAttributes: TdxGridAttributeClasses; virtual; + + property View: TcxCustomGridView read FView write FView; + end; + + TdxNullGridViewHelper = class(TdxCustomGridViewHelper) + protected + class function ViewClass: TcxCustomGridViewClass; override; + public + class function IsAttributeSupported(AnAttribute: TdxGridAttributeClass): Boolean; override; + end; + + TdxCustomGridTableViewHelper = class(TdxCustomGridViewHelper) + protected + class function ExtractRecord(AnItem: TdxReportVisualItem): TcxCustomGridRecord; virtual; + {$IFDEF DXVER500} + class function FilterPosition(AView: TcxCustomGridView): TcxGridFilterPosition; override; + {$ENDIF} + class function ViewClass: TcxCustomGridViewClass; override; + public + class function ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; override; + class function SupportedAttributes: TdxGridAttributeClasses; override; + end; + + TdxGridCardViewHelper = class(TdxCustomGridTableViewHelper) + protected + class function ExtractCard(AnItem: TdxReportVisualItem): TcxGridCard; virtual; + class function ExtractCardRow(AnItem: TdxReportVisualItem): TcxGridCardViewRow; virtual; + class function ExtractRecord(AnItem: TdxReportVisualItem): TcxCustomGridRecord; override; + class function ViewClass: TcxCustomGridViewClass; override; + public + class function ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; override; + class procedure ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); override; + end; + + TdxGridTableViewHelper = class(TdxCustomGridTableViewHelper) + protected + class function ExtractColumn(AnItem: TdxReportVisualItem): TcxGridColumn; virtual; + class function ExtractGroupLevel(AnItem: TdxReportVisualItem): Integer; virtual; + class function ExtractRecord(AnItem: TdxReportVisualItem): TcxCustomGridRecord; override; + class function IsOffice11StyleGrouping(AView: TcxCustomGridView): Boolean; override; + class function ViewClass: TcxCustomGridViewClass; override; + public + class function ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; override; + class procedure ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); override; + class function SupportedAttributes: TdxGridAttributeClasses; override; + end; + + TdxGridBandedTableViewHelper = class(TdxGridTableViewHelper) + protected + class function ExtractBand(AnItem: TdxReportVisualItem): TcxGridBand; virtual; + class function ViewClass: TcxCustomGridViewClass; override; + public + class function ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; override; + class procedure ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); override; + class function SupportedAttributes: TdxGridAttributeClasses; override; + end; + + { Record Helpers } + + TdxCustomGridRecordHelperClass = class of TdxCustomGridRecordHelper; + + TdxCustomGridRecordHelper = class(TdxCustomClassMapItem) + private + FAdapter: TdxCustomGridTableViewAdapter; + FGridRecord: TcxCustomGridRecord; + protected + function Adapter: TdxCustomGridTableViewAdapter; overload; virtual; + class function ProducerClass: TdxGridTableViewCustomDataRowProducerClass; virtual; + class function RecordClass: TcxCustomGridRecordClass; virtual; + + {$IFDEF DXVER500} + function GetCanCellMergingAsMaster: Boolean; virtual; + function GetCanCellMergingAsSlave: Boolean; virtual; + {$ENDIF} + function GetHasDetails: Boolean; virtual; + {$IFDEF DXVER500} + function GetHasExpandButton: Boolean; virtual; + {$ENDIF} + function GetHasSelectedChildren: Boolean; virtual; + {$IFDEF DXVER500} + function GetIsCellMergingSeparator: Boolean; virtual; + {$ENDIF} + function GetParent: TcxCustomGridRecord; virtual; + public + constructor Create(AAdapter: TdxCustomGridTableViewAdapter); virtual; + + class function PairClass: TClass; override; + class procedure Register; + class procedure Unregister; + + {$IFDEF DXVER500} + property CanCellMergingAsMaster: Boolean read GetCanCellMergingAsMaster; + property CanCellMergingAsSlave: Boolean read GetCanCellMergingAsSlave; + {$ENDIF} + property GridRecord: TcxCustomGridRecord read FGridRecord write FGridRecord; + property HasDetails: Boolean read GetHasDetails; + {$IFDEF DXVER500} + property HasExpandButton: Boolean read GetHasExpandButton; + {$ENDIF} + property HasSelectedChildren: Boolean read GetHasSelectedChildren; + {$IFDEF DXVER500} + property IsCellMergingSeparator: Boolean read GetIsCellMergingSeparator; + {$ENDIF} + property Parent: TcxCustomGridRecord read GetParent; + end; + + TdxCustomGridRowHelper = class(TdxCustomGridRecordHelper) + protected + function Adapter: TdxGridTableViewAdapter; reintroduce; overload; + class function RecordClass: TcxCustomGridRecordClass; override; + end; + + TdxGridDataRowHelper = class(TdxCustomGridRowHelper) + private + function GetRow: TcxGridDataRow; + protected + class function ProducerClass: TdxGridTableViewCustomDataRowProducerClass; override; + class function RecordClass: TcxCustomGridRecordClass; override; + public + property Row: TcxGridDataRow read GetRow; + end; + + TdxGridGroupRowHelper = class(TdxCustomGridRowHelper) + private + function GetGroupRow: TcxGridGroupRow; + protected + class function ProducerClass: TdxGridTableViewCustomDataRowProducerClass; override; + class function RecordClass: TcxCustomGridRecordClass; override; + + {$IFDEF DXVER500} + function GetCanCellMergingAsMaster: Boolean; override; + function GetCanCellMergingAsSlave: Boolean; override; + function GetHasExpandButton: Boolean; override; + {$ENDIF} + function GetHasSelectedChildren: Boolean; override; + public + property GroupRow: TcxGridGroupRow read GetGroupRow; + end; + + TdxGridMasterDataRowHelper = class(TdxCustomGridRowHelper) + private + function GetDetailView: TcxCustomGridView; + function GetMasterRow: TcxGridMasterDataRow; + protected + class function ProducerClass: TdxGridTableViewCustomDataRowProducerClass; override; + class function RecordClass: TcxCustomGridRecordClass; override; + + {$IFDEF DXVER500} + function GetCanCellMergingAsMaster: Boolean; override; + {$ENDIF} + function GetHasDetails: Boolean; override; + {$IFDEF DXVER500} + function GetHasExpandButton: Boolean; override; + {$ENDIF} + function GetHasSelectedChildren: Boolean; override; + {$IFDEF DXVER500} + function GetIsCellMergingSeparator: Boolean; override; + {$ENDIF} + public + property DetailView: TcxCustomGridView read GetDetailView; + property MasterRow: TcxGridMasterDataRow read GetMasterRow; + end; + + { caches } + + TdxRecordHelpersCache = class(TdxCustomCache) + private + FAdapter: TdxCustomGridTableViewAdapter; + function GetHelper(ARecord: TcxCustomGridRecord): TdxCustomGridRecordHelper; + function GetItem(Index: Integer): TdxCustomGridRecordHelper; + protected + function IndexOf(ARecord: TcxCustomGridRecord): Integer; + property Items[Index: Integer]: TdxCustomGridRecordHelper read GetItem; + public + constructor Create(AAdapter: TdxCustomGridTableViewAdapter); + property Adapter: TdxCustomGridTableViewAdapter read FAdapter; + property Helpers[ARecord: TcxCustomGridRecord]: TdxCustomGridRecordHelper read GetHelper; default; + end; + + TdxProducerCache = class(TdxCustomCache) + private + FBuilder: TdxCustomGridViewBuilder; + function GetItem(Index: Integer): TdxGridViewRowProducer; + function GetProducer(ProducerClass: TdxGridViewRowProducerClass): TdxGridViewRowProducer; + protected + function IndexOf(AProducerClass: TdxGridViewRowProducerClass): Integer; + property Items[Index: Integer]: TdxGridViewRowProducer read GetItem; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); + property Builder: TdxCustomGridViewBuilder read FBuilder; + property Producers[ProducerClass: TdxGridViewRowProducerClass]: TdxGridViewRowProducer read GetProducer; default; + end; + + { CustomView Adapter, Formatter and Builder } + + TdxGridViewAdapterClass = class of TdxCustomGridViewAdapter; + + TdxCustomGridViewAdapter = class + private + FGridView: TcxCustomGridView; + FMasterAdapter: TdxCustomGridViewAdapter; + function GetAbsoluteLevel: Integer; + function GetCanUseLookAndFeelColors: Boolean; + function GetCaptionText: string; + function GetDetailsSeparatorColor: TColor; + function GetDetailsSeparatorThickness: Integer; + function GetFilter: TcxDataFilterCriteria; + function GetFilterActive: Boolean; + function GetFilterEmpty: Boolean; + function GetFilterText: string; + function GetGrid: TcxCustomGrid; + function GetGridLevel: TcxGridLevel; + function GetGridWidth: Integer; + function GetHasDetailsSeparator: Boolean; + function GetLookAndFeelKind: TcxLookAndFeelKind; + function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; + function GetIsDetail: Boolean; + function GetIsMaster: Boolean; + function GetMasterGridLevel: TcxGridLevel; + function GetSummary: TcxDataSummary; + function GetThemedCaptionColor: TColor; + function GetThemedCaptionTextColor: TColor; + function GetThemedFilterBarColor: TColor; + function GetThemedFilterBarTextColor: TColor; + function GetViewWidth: Integer; + protected + procedure AfterBuilding; virtual; + procedure BeforeBuilding; virtual; + + function BackgroundBitmaps: TcxCustomGridBackgroundBitmaps; overload; virtual; + function GetBackgroundBitmap(Index: Integer): TBitmap; + function HasBackgroundBitmap(Index: Integer): Boolean; + function IsBackgroundBitmapSupported(Index: Integer): Boolean; virtual; + + function Controller: TcxCustomGridController; overload; virtual; + function DataController: TcxCustomDataController; overload; virtual; + + function CreateCloneAdapter(AClone: TcxCustomGridView): TdxCustomGridViewAdapter; + procedure ExpandAllRowsInClones(AMasterRows, AGroupRows: Boolean); virtual; + procedure ExpandAllRowsInGridView(AGridView: TcxCustomGridView; AMasterRows, AGroupRows: Boolean); + procedure ExpandAllRowsInLevel(ALevel: TcxGridLevel; AMasterRows, AGroupRows: Boolean; ARecursive: Boolean); + procedure ExpandAllRowsInItself(AMasterRows, AGroupRows: Boolean); virtual; + + function GetAreAllMasterRowsCollapsed: Boolean; virtual; + function GetAutoWidth: Boolean; virtual; + function GetCanUseOnEveryPageMode: Boolean; virtual; + {$IFDEF DXVER500} + function GetFilterPosition: TcxGridFilterPosition; virtual; + {$ENDIF} + function GetHasSelectedRecords: Boolean; virtual; + function GetIndentCount: Integer; virtual; + function GetIndentWidth: Integer; virtual; + function GetIsOffice11StyleGrouping: Boolean; virtual; + function GetMasterGridRecord: TcxCustomGridRecord; virtual; + function GetRecordCount: Integer; virtual; + function GetViewWidthExtra: Integer; virtual; + { Styles } + function GetCaptionViewParams: TcxViewParams; virtual; + function GetFilterBarViewParams: TcxViewParams; virtual; + function GetRootCaptionParams: TcxViewParams; virtual; + + property Filter: TcxDataFilterCriteria read GetFilter; + property Grid: TcxCustomGrid read GetGrid; + property LookAndFeelKind: TcxLookAndFeelKind read GetLookAndFeelKind; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter; + property Summary: TcxDataSummary read GetSummary; + public + constructor Create(AMasterAdapter: TdxCustomGridViewAdapter; AGridView: TcxCustomGridView); virtual; + + function GridView: TcxCustomGridView; overload; virtual; + class function GridViewClass: TcxCustomGridViewClass; virtual; + function Styles: TcxCustomGridStyles; overload; virtual; + + procedure ExpandAllRows(AnOptionsExpanding: TdxGridReportLinkOptionsExpanding; + ARecursive: Boolean); virtual; + + property AbsoluteLevel: Integer read GetAbsoluteLevel; + property AreAllMasterRowsCollapsed: Boolean read GetAreAllMasterRowsCollapsed; + property AutoWidth: Boolean read GetAutoWidth; + property CanUseOnEveryPageMode: Boolean read GetCanUseOnEveryPageMode; + property CanUseLookAndFeelColors: Boolean read GetCanUseLookAndFeelColors; + property CaptionText: string read GetCaptionText; + property DetailsSeparatorColor: TColor read GetDetailsSeparatorColor; + property DetailsSeparatorThickness: Integer read GetDetailsSeparatorThickness; + property GridLevel: TcxGridLevel read GetGridLevel; + property GridWidth: Integer read GetGridWidth; + property FilterActive: Boolean read GetFilterActive; + property FilterEmpty: Boolean read GetFilterEmpty; + {$IFDEF DXVER500} + property FilterPosition: TcxGridFilterPosition read GetFilterPosition; + {$ENDIF} + property FilterText: string read GetFilterText; + property HasDetailsSeparator: Boolean read GetHasDetailsSeparator; + property HasSelectedRecords: Boolean read GetHasSelectedRecords; + property IndentCount: Integer read GetIndentCount; + property IndentWidth: Integer read GetIndentWidth; + property IsDetail: Boolean read GetIsDetail; + property IsMaster: Boolean read GetIsMaster; + property IsOffice11StyleGrouping: Boolean read GetIsOffice11StyleGrouping; + property MasterAdapter: TdxCustomGridViewAdapter read FMasterAdapter; + property MasterGridLevel: TcxGridLevel read GetMasterGridLevel; + property MasterGridRecord: TcxCustomGridRecord read GetMasterGridRecord; + property RecordCount: Integer read GetRecordCount; + property ThemedCaptionColor: TColor read GetThemedCaptionColor; + property ThemedCaptionTextColor: TColor read GetThemedCaptionTextColor; + property ThemedFilterBarColor: TColor read GetThemedFilterBarColor; + property ThemedFilterBarTextColor: TColor read GetThemedFilterBarTextColor; + property ViewWidth: Integer read GetViewWidth; + property ViewWidthExtra: Integer read GetViewWidthExtra; + end; + + TdxGridViewFormatterClass = class of TdxCustomGridViewFormatter; + + TdxCustomGridViewFormatter = class(TObject, IUnknown) + private + FBuilder: TdxCustomGridViewBuilder; + FCaptionLineHeight: Integer; + FExpandButtons: TList; + FFilterBarLineHeight: Integer; + FFont: TFont; + FLookAndFeelItems: TList; + FTransparentColor: TColor; + function GetAbsoluteLevel: Integer; + function GetAutoWidth: Boolean; + function GetDC: HDC; + function GetEdgeMode: TdxCellEdgeMode; + {$IFDEF DXVER500} + function GetFilterBarPosition: TcxGridFilterPosition; + {$ENDIF} + function GetGridWidth: Integer; + function GetExpandButton(Index: Integer): TdxReportCellExpandButton; + function GetExpandButtonCount: Integer; + function GetIndentWidth: Integer; + function GetLookAndFeelItem(Index: Integer): TdxReportVisualItem; + function GetLookAndFeelItemCount: Integer; + function GetPaginateByTopLevelGroups: Boolean; + function GetRenderer: TdxPSReportRenderer; + function GetReportLink: TdxGridReportLink; + function GetShowCaption: Boolean; + function GetShowFilterBar: Boolean; + function GetUseLookAndFeelColors: Boolean; + function GetViewAvailableWidth: Integer; + function GetViewWidthExtra: Integer; + + procedure FormatLookAndFeelItems; + procedure FormatExpandButtons; + protected + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + procedure AddDelimiters; virtual; + procedure AddHorizontalDelimiters; virtual; + procedure AddVerticalDelimiters; virtual; + + procedure AfterBuilding; virtual; + procedure BeforeBuilding; virtual; + + procedure Calculate; virtual; + procedure CalculateLineHeights; virtual; + + function GetDetailsSeparatorColor: TColor; virtual; + function GetDetailsSeparatorThickness: Integer; virtual; + function GetHasDetailsSeparator: Boolean; virtual; + + function GetSiteHeight: Integer; virtual; + function GetSiteWidth: Integer; virtual; + function GetViewWidth: Integer; virtual; + function GetViewWidthExtraAfter: Integer; virtual; // MD relation considering + function GetViewWidthExtraBefore: Integer; virtual; // MD relation considering + + function BackgroundBitmaps: TcxCustomGridBackgroundBitmaps; overload; virtual; + function GetBackgroundBitmap(Index: Integer): TBitmap; virtual; + function GetBackgroundBitmapIndex(Index: Integer): Integer; + function HasBackgroundBitmap(Index: Integer): Boolean; virtual; + function MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; virtual; + + function CalculateFontHeight(const AParams: TdxReportItemViewParams): Integer; + procedure CalculateHeight(const AParams: TdxReportItemViewParams; var AHeight: Integer); + function GetStyleFontIndex(const AParams: TdxReportItemViewParams): Integer; + function IsColorTransparent(AColor: TColor): Boolean; + procedure RegisterExpandButton(AExpandButton: TdxReportCellExpandButton); + procedure RegisterLookAndFeelItem(AnItem: TdxReportVisualItem; AEdgeStyle: TdxCellEdgeStyle); + procedure SetViewParams(AnItem: TdxReportVisualItem; const AParams: TdxReportItemViewParams); + + property DC: HDC read GetDC; + property EdgeMode: TdxCellEdgeMode read GetEdgeMode; + property ExpandButtonCount: Integer read GetExpandButtonCount; + property ExpandButtons[Index: Integer]: TdxReportCellExpandButton read GetExpandButton; + property GridWidth: Integer read GetGridWidth; + property LookAndFeelItemCount: Integer read GetLookAndFeelItemCount; + property LookAndFeelItems[Index: Integer]: TdxReportVisualItem read GetLookAndFeelItem; + property PaginateByTopLevelGroups: Boolean read GetPaginateByTopLevelGroups; + property Renderer: TdxPSReportRenderer read GetRenderer; + property ReportLink: TdxGridReportLink read GetReportLink; + property SiteHeight: Integer read GetSiteHeight; + property SiteWidth: Integer read GetSiteWidth; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); virtual; + destructor Destroy; override; + + function Adapter: TdxCustomGridViewAdapter; overload; virtual; + function Builder: TdxCustomGridViewBuilder; overload; virtual; + + { Host } + procedure DoInitializeHost(AHost: TdxReportCell); virtual; + function GetHostClass: TdxReportCellClass; virtual; + function GetRowHostClass: TdxReportCellClass; virtual; + + { Caption } + procedure DoInitializeCaption(ACaption: TdxReportCellText); virtual; + procedure DoInitializeCaptionRow(ARow: TdxReportCell); virtual; + procedure DoReportLinkInitializeCaption(ACaption: TdxReportCellText); virtual; + function GetCaptionClass: TdxReportCellTextClass; virtual; + function GetCaptionViewParams: TdxReportItemViewParams; virtual; + + { Filter Box } + procedure DoInitializeFilterBar(AFilterBar: TdxReportCellText); virtual; + procedure DoInitializeFilterBarRow(ARow: TdxReportCell); virtual; + procedure DoReportLinkInitializeFilterBar(AFilterBar: TdxReportCellText); virtual; + function GetFilterBarClass: TdxReportCellTextClass; virtual; + function GetFilterBarViewParams: TdxReportItemViewParams; virtual; + + { Details Separator } + procedure DoInitializeDetailsSeparatorRow(ARow: TdxReportCell); virtual; + procedure DoInitializeHorzDetailsSeparator(ASeparator: TdxReportCellBox); virtual; + procedure DoInitializeVertBottomDetailsSeparator(ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); virtual; + procedure DoInitializeVertDetailsSeparator(ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); virtual; + procedure DoInitializeVertTopDetailsSeparator(ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); virtual; + function GetDetailsSeparatorClass: TdxReportCellBoxClass; virtual; + + { Master Indent } + procedure DoInitializeMasterIndent(AnIndent: TdxReportCellExpandButton; AnIndex, AnIndentCount: Integer); virtual; + function GetMasterIndentClass: TdxReportCellExpandButtonClass; virtual; + + { View Terminator } + procedure DoInitializeViewTerminator(ATerminator: TdxReportCellBox); virtual; + + property AbsoluteLevel: Integer read GetAbsoluteLevel; + property AutoWidth: Boolean read GetAutoWidth; + property CaptionLineHeight: Integer read FCaptionLineHeight write FCaptionLineHeight; + property DetailsSeparatorColor: TColor read GetDetailsSeparatorColor; + property DetailsSeparatorThickness: Integer read GetDetailsSeparatorThickness; + property FilterBarLineHeight: Integer read FFilterBarLineHeight write FFilterBarLineHeight; + {$IFDEF DXVER500} + property FilterBarPosition: TcxGridFilterPosition read GetFilterBarPosition; + {$ENDIF} + property HasDetailsSeparator: Boolean read GetHasDetailsSeparator; + property IndentWidth: Integer read GetIndentWidth; + property ShowCaption: Boolean read GetShowCaption; + property ShowFilterBar: Boolean read GetShowFilterBar; + property TransparentColor: TColor read FTransparentColor write FTransparentColor; + property UseLookAndFeelColors: Boolean read GetUseLookAndFeelColors; + property ViewAvailableWidth: Integer read GetViewAvailableWidth; + property ViewWidth: Integer read GetViewWidth; + property ViewWidthExtra: Integer read GetViewWidthExtra; + property ViewWidthExtraAfter: Integer read GetViewWidthExtraAfter; // MD relation considering + property ViewWidthExtraBefore: Integer read GetViewWidthExtraBefore; // MD relation considering + end; + + TdxGridViewBuilderClass = class of TdxCustomGridViewBuilder; + + TdxCustomGridViewBuilder = class(TdxCustomClassMapItem) + private + FAdapter: TdxCustomGridViewAdapter; + FDetailsBuilder: TdxCustomGridViewBuilder; + FFormatter: TdxCustomGridViewFormatter; + FGridView: TcxCustomGridView; + FMasterBuilder: TdxCustomGridViewBuilder; + FProducerCache: TdxProducerCache; + FReportLink: TdxGridReportLink; + FReportRows: TList; + function GetAbsoluteBuilder(AIndex: Integer): TdxCustomGridViewBuilder; + function GetAutoWidth: Boolean; + function GetGridLevel: TcxGridLevel; + function GetGrid: TcxCustomGrid; + function GetHost: TdxReportCell; + function GetHostInfoServices: TdxGridAttributeHostInfoServices; + function GetReportRow(Index: Integer): TdxReportCell; + function GetReportRowCount: Integer; + function GetRootBuilder: TdxCustomGridViewBuilder; + protected + procedure AddReportRow(ARow: TdxReportCell); + + procedure AfterBuilding; virtual; + procedure BeforeBuilding; virtual; + procedure DoBuild; virtual; + procedure DoBuildViewBody; virtual; + procedure DoBuildViewFooter; virtual; + procedure DoBuildViewHeader; virtual; + + function GetViewAvailableWidth: Integer; virtual; + { Caption } + procedure CreateCaption; virtual; + function GetCaptionProducer: TdxGridViewCaptionProducer; virtual; + function GetCaptionProducerClass: TdxGridViewCaptionProducerClass; virtual; + { Details Separator } + procedure CreateBottomDetailsSeparator; virtual; + procedure CreateTopDetailsSeparator; virtual; + function GetDetailsBottomSeparatorProducer: TdxGridViewDetailsSeparatorProducer; virtual; + function GetDetailsBottomSeparatorProducerClass: TdxGridViewDetailsSeparatorProducerClass; virtual; + function GetDetailsTopSeparatorProducer: TdxGridViewDetailsSeparatorProducer; virtual; + function GetDetailsTopSeparatorProducerClass: TdxGridViewDetailsSeparatorProducerClass; virtual; + { Filter Box } + procedure CreateFilterBar; virtual; + function GetFilterBarProducer: TdxGridViewFilterBarProducer; virtual; + function GetFilterBarProducerClass: TdxGridViewFilterBarProducerClass; virtual; + { View Terminator } + procedure CreateViewTerminator; virtual; + function GetViewTerminatorProducer: TdxGridViewTerminatorProducer; virtual; + function GetViewTerminatorProducerClass: TdxGridViewTerminatorProducerClass; virtual; + + function GridView: TcxCustomGridView; overload; virtual; + class function GridViewClass: TcxCustomGridViewClass; virtual; + + property GridLevel: TcxGridLevel read GetGridLevel; + property HostInfoServices: TdxGridAttributeHostInfoServices read GetHostInfoServices; + property ProducerCache: TdxProducerCache read FProducerCache; + property ReportLink: TdxGridReportLink read FReportLink; + public + constructor Create(AReportLink: TdxGridReportLink; AMasterBuilder: TdxCustomGridViewBuilder; + AGridView: TcxCustomGridView); virtual; + destructor Destroy; override; + + function Adapter: TdxCustomGridViewAdapter; overload; virtual; + class function AdapterClass: TdxGridViewAdapterClass; virtual; + class function CreateAdapter(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView): TdxCustomGridViewAdapter; virtual; + + function Formatter: TdxCustomGridViewFormatter; overload; virtual; + class function FormatterClass: TdxGridViewFormatterClass; virtual; + + procedure Build; + function IsAborted: Boolean; + procedure Progress(const APercentDone: Double); + + class function PairClass: TClass; override; + class procedure Register; + class procedure Unregister; + + property AbsoluteBuilders[Index: Integer]: TdxCustomGridViewBuilder read GetAbsoluteBuilder; + property AutoWidth: Boolean read GetAutoWidth; + property DetailsBuilder: TdxCustomGridViewBuilder read FDetailsBuilder; + property Grid: TcxCustomGrid read GetGrid; + property Host: TdxReportCell read GetHost; + property MasterBuilder: TdxCustomGridViewBuilder read FMasterBuilder; + property ReportRowCount: Integer read GetReportRowCount; + property ReportRows[Index: Integer]: TdxReportCell read GetReportRow; + property RootBuilder: TdxCustomGridViewBuilder read GetRootBuilder; + property ViewAvailableWidth: Integer read GetViewAvailableWidth; + end; + + { CustomTableView Adapter and Formatter } + + TdxGridTableAdapterForEachRecordProc = procedure(ARecord: TcxCustomGridRecord; + AData: Integer; var AContinue: Boolean) of object; + + TdxCustomGridTableViewAdapter = class(TdxCustomGridViewAdapter) + private + FDetailsLineCount: Integer; + FRecordHelpersCache: TdxRecordHelpersCache; + function GetCellEndEllipsis: Boolean; + function GetDetailsLineCount: Integer; + function GetFiltering: TcxCustomGridTableFiltering; + function GetIsGridMode: Boolean; + function GetRecord(Index: Integer): TcxCustomGridRecord; + function GetRecordHelper(ARecord: TcxCustomGridRecord): TdxCustomGridRecordHelper; + function GetSelectedRecord(Index: Integer): TcxCustomGridRecord; + function GetSelectedRecordCount: Integer; + protected + function CalculateDetailsLineCount: Integer; virtual; + + function GetContentViewParams(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem): TcxViewParams; virtual; + function GetPreviewViewParams(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem): TcxViewParams; virtual; + function GetSelectionViewParams: TcxViewParams; virtual; + function HasSelectionStyle: Boolean; + + function Controller: TcxCustomGridTableController; reintroduce; overload; + + procedure DoExpandMasterRow(ARecord: TcxCustomGridRecord; AData: Integer; + var AContinue: Boolean); + procedure ExpandAllGroupRows; virtual; + procedure ExpandAllMasterRows(AnExpandGroups: Boolean); virtual; + procedure ExpandAllRowsInItself(AMasterRows, AGroupRows: Boolean); override; + + function GetAreAllMasterRowsCollapsed: Boolean; override; + function GetCanUseOnEveryPageMode: Boolean; override; + function GetCellAutoHeight: Boolean; virtual; + function GetCellMultiline: Boolean; virtual; + {$IFDEF DXVER500} + function GetFilterPosition: TcxGridFilterPosition; override; + {$ENDIF} + function GetGridLineColor: TColor; virtual; + function GetHasSelectedRecords: Boolean; override; + function GetMasterGridRecord: TcxCustomGridRecord; override; + function GetRecordCount: Integer; override; + procedure IsMasterRowCollapsed(ARecord: TcxCustomGridRecord; AData: Integer; + var AContinue: Boolean); + + class function GetProperties(AnItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxCustomEditProperties; virtual; + class function GetPropertiesClass(AnItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxCustomEditPropertiesClass; virtual; + class function GetRepositoryItem(AnItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxEditRepositoryItem; virtual; + + property RecordHelpersCache: TdxRecordHelpersCache read FRecordHelpersCache; + public + constructor Create(AMasterAdapter: TdxCustomGridViewAdapter; AGridView: TcxCustomGridView); override; + destructor Destroy; override; + + function ForEachRecord(AProc: TdxGridTableAdapterForEachRecordProc; AData: Integer; + AProcessSelection: Boolean): Boolean; + + function GridView: TcxCustomGridTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + function Styles: TcxCustomGridTableViewStyles; reintroduce; overload; + + property CellAutoHeight: Boolean read GetCellAutoHeight; + property CellEndEllipsis: Boolean read GetCellEndEllipsis; + property CellMultiline: Boolean read GetCellMultiline; + property DetailsLineCount: Integer read GetDetailsLineCount write FDetailsLineCount; + property Filtering: TcxCustomGridTableFiltering read GetFiltering; + property GridLineColor: TColor read GetGridLineColor; + property IsGridMode: Boolean read GetIsGridMode; + property RecordHelpers[Row: TcxCustomGridRecord]: TdxCustomGridRecordHelper read GetRecordHelper; + property Records[Index: Integer]: TcxCustomGridRecord read GetRecord; + property SelectedRecordCount: Integer read GetSelectedRecordCount; + property SelectedRecords[Index: Integer]: TcxCustomGridRecord read GetSelectedRecord; + end; + + TdxCustomGridTableViewFormatter = class(TdxCustomGridViewFormatter, IdxPSCellParams, IdxPSCellParams2) + private + FRecordIndexes: TList; + FSelectedRecordList: TList; + function GetGridLineColor: TColor; + function GetRecord(Index: Integer): TcxCustomGridRecord; + function GetRecordCount: Integer; + function GetRecordIndex(ARecord: TcxCustomGridRecord): Integer; + function GetSelectedRecord(Index: Integer): TcxCustomGridRecord; + function GetSelectedRecordCount: Integer; + protected + { IdxPSCellParams } + function IdxPSCellParams.GetAutoHeight = IdxPSCellParams_GetAutoHeight; + function IdxPSCellParams.GetDC = IdxPSCellParams_GetDC; + function IdxPSCellParams.GetDisplayGraphicsAsText = IdxPSCellParams_GetDisplayGraphicsAsText; + function IdxPSCellParams.GetEndEllipsis = IdxPSCellParams_GetEndEllipsis; + function IdxPSCellParams.GetFlatCheckMarks = IdxPSCellParams_GetFlatCheckMarks; + function IdxPSCellParams.GetGraphicsText = IdxPSCellParams_GetGraphicsText; + function IdxPSCellParams.GetMultiline = IdxPSCellParams_GetMultiline; + function IdxPSCellParams.GetTransparentGraphics = IdxPSCellParams_GetTransparentGraphics; + function IdxPSCellParams_GetAutoHeight: Boolean; virtual; + function IdxPSCellParams_GetDC: HDC; virtual; + function IdxPSCellParams_GetDisplayGraphicsAsText: Boolean; virtual; + function IdxPSCellParams_GetEndEllipsis: Boolean; virtual; + function IdxPSCellParams_GetFlatCheckMarks: Boolean; virtual; + function IdxPSCellParams_GetGraphicsText: string; virtual; + function IdxPSCellParams_GetMultiline: Boolean; virtual; + function IdxPSCellParams_GetTransparentGraphics: Boolean; virtual; + { IdxPSCellParams2 } + function IdxPSCellParams2.GetPreviewMarginLeft = IdxPSCellParams2_GetPreviewMarginLeft; + function IdxPSCellParams2.GetPreviewMarginRight = IdxPSCellParams2_GetPreviewMarginRight; + function IdxPSCellParams2.GetPreviewMaxHeight = IdxPSCellParams2_GetPreviewMaxHeight; + function IdxPSCellParams2.GetPreviewMaxLineCount = IdxPSCellParams2_GetPreviewMaxLineCount; + function IdxPSCellParams2.GetRichEditGraphicClass = IdxPSCellParams2_GetRichEditGraphicClass; + function IdxPSCellParams2.GetRichEditTransparent = IdxPSCellParams2_GetRichEditTransparent; + function IdxPSCellParams2_GetPreviewMarginLeft: Integer; virtual; + function IdxPSCellParams2_GetPreviewMarginRight: Integer; virtual; + function IdxPSCellParams2_GetPreviewMaxHeight: Integer; virtual; + function IdxPSCellParams2_GetPreviewMaxLineCount: Integer; virtual; + function IdxPSCellParams2_GetRichEditGraphicClass: TGraphicClass; virtual; + function IdxPSCellParams2_GetRichEditTransparent: Boolean; virtual; + + procedure AfterBuilding; override; + procedure BeforeBuilding; override; + + procedure BuildSelectedRecordList; virtual; + function CanProcessSelectionStyle(ARecord: TcxCustomGridRecord): Boolean; + function IsSelectedRecord(ARecord: TcxCustomGridRecord): Boolean; virtual; + + function GetContentBackgroundBitmapStyleIndex(ATableItem: TcxCustomGridTableItem): Integer; virtual; + function MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; override; + + property SelectedRecordList: TList read FSelectedRecordList; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); override; + destructor Destroy; override; + + function Adapter: TdxCustomGridTableViewAdapter; reintroduce; overload; + function Builder: TdxCustomGridTableViewBuilder; reintroduce; overload; + + function IndexOfRecord(ARecord: TcxCustomGridRecord): Integer; + + { Items } + procedure CheckDisplayValuePost(AProperties: TcxCustomEditProperties; + ATableItem: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord; AnItem: TAbstractdxReportCellData); + procedure DoInitializeItem(AnItem: TAbstractdxReportCellData; ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False); virtual; + function GetItemClass(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False): TdxReportCellDataClass; virtual; + function GetItemProperties(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxCustomEditProperties; virtual; + function GetItemValue(AProperties: TcxCustomEditProperties; ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxEditValue; virtual; + function GetItemViewParams(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False): TdxReportItemViewParams; virtual; + + property GridLineColor: TColor read GetGridLineColor; + property RecordCount: Integer read GetRecordCount; + property RecordIndexes[ARecord: TcxCustomGridRecord]: Integer read GetRecordIndex; + property Records[Index: Integer]: TcxCustomGridRecord read GetRecord; + property SelectedRecordCount: Integer read GetSelectedRecordCount; + property SelectedRecords[Index: Integer]: TcxCustomGridRecord read GetSelectedRecord; + end; + + TdxCustomGridTableViewBuilder = class(TdxCustomGridViewBuilder) + protected + procedure DoBuildViewFooter; override; + procedure DoBuildViewHeader; override; + + procedure DoGetCellHeight(ARecord: TcxCustomGridRecord; ATableItem: TcxCustomGridTableItem; + var AHeight: Integer); + + function GridView: TcxCustomGridTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + public + function Adapter: TdxCustomGridTableViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + function Formatter: TdxCustomGridTableViewFormatter; reintroduce; overload; + class function FormatterClass: TdxGridViewFormatterClass; override; + end; + + { GridTableView Adapter, Formatter and Builder } + + TdxGridTableViewAdapter = class(TdxCustomGridTableViewAdapter) + private + function GetColumn(Index: Integer): TcxGridColumn; + function GetColumnCount: Integer; + function GetExpandButtonColor: TColor; + function GetExpandButtonSize: Integer; + function GetFooterItemText(Index: Integer): string; + function GetFooterMultiline: Boolean; + function GetGridLines: TcxGridLines; + function GetGroupedColumn(Index: Integer): TcxGridColumn; + function GetGroupedColumnCount: Integer; + function GetGroupFootersMode: TcxGridGroupFootersMode; + function GetGroupFootersMultiline: Boolean; + function GetGroupRowSeparatorColor: TColor; + function GetGroupRowSeparatorThickness: Integer; + function GetHasFooterItem(Index: Integer): Boolean; + function GetHasPreview: Boolean; + function GetHasRowSeparators: Boolean; + function GetHeaderEndEllipsis: Boolean; + function GetInternalColumnMinWidth(Column: TcxGridColumn): Integer; + function GetInternalColumnWidth(Column: TcxGridColumn): Integer; + function GetPreviewColumn: TcxGridColumn; + function GetPreviewLeftIndent: Integer; + function GetPreviewPlace: TcxGridPreviewPlace; + function GetPreviewRightIndent: Integer; + function GetRow(Index: Integer): TcxCustomGridRow; + function GetRowCount: Integer; + function GetRowSeparatorColor: TColor; + function GetRowSeparatorThickness: Integer; + function GetShowExpandButtonsForEmptyDetails: Boolean; + function GetShowHorzGridLines: Boolean; + function GetShowVertGridLines: Boolean; + function GetThemedFooterItemColor: TColor; + function GetThemedFooterItemTextColor: TColor; + function GetThemedHeaderItemColor: TColor; + function GetThemedHeaderItemTextColor: TColor; + protected + function Controller: TcxGridTableController; reintroduce; overload; + function DataController: TcxGridDataController; reintroduce; overload; + + function GetAutoWidth: Boolean; override; + function GetCellAutoHeight: Boolean; override; + function GetCellMultiline: Boolean; override; + function GetGridLineColor: TColor; override; + function GetHeaderAutoHeight: Boolean; virtual; + function GetHeaderMultiline(Column: TcxGridColumn): Boolean; virtual; + function GetIndentCount: Integer; override; + function GetIndentWidth: Integer; override; + function GetIndicatorWidth: Integer; virtual; + function GetIsOffice11StyleGrouping: Boolean; override; + function GetViewWidthExtra: Integer; override; + + function GetDataRowHeight: Integer; virtual; + function GetDataRowHeightAssigned: Boolean; virtual; + function GetFooterHeight: Integer; virtual; + function GetFooterHeightAssigned: Boolean; virtual; + function GetGroupFooterHeight: Integer; virtual; + function GetGroupFooterHeightAssigned: Boolean; virtual; + function GetGroupRowHeight: Integer; virtual; + function GetGroupRowHeightAssigned: Boolean; virtual; + function GetHeaderHeight: Integer; virtual; + function GetHeaderHeightAssigned: Boolean; virtual; + + { Styles } + function GetFilterBarViewParams: TcxViewParams; override; + function GetFooterViewParams(ARecord: TcxCustomGridRecord; + AGroupLevel: Integer; AColumn: TcxGridColumn): TcxViewParams; virtual; + function GetGroupRowViewParams(ARecord: TcxCustomGridRecord; + AGroupLevel: Integer): TcxViewParams; virtual; + function GetHeaderViewParams(AColumn: TcxGridColumn): TcxViewParams; virtual; + function GetPreviewViewParams(ARecord: TcxCustomGridRecord; + AnItem: TcxCustomGridTableItem): TcxViewParams; override; + + property InternalColumnMinWidths[Column: TcxGridColumn]: Integer read GetInternalColumnMinWidth; + property InternalColumnWidths[Column: TcxGridColumn]: Integer read GetInternalColumnWidth; + public + constructor Create(AMasterAdapter: TdxCustomGridViewAdapter; AGridView: TcxCustomGridView); override; + + function GridView: TcxGridTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + function Styles: TcxGridTableViewStyles; reintroduce; overload; + + function HasDetails(AGridRow: TcxCustomGridRow): Boolean; + + function GetGroupFooterCount(AGridRow: TcxCustomGridRow): Integer; + function GetGroupFooterItemText(ARowIndex, ALevel, AIndex: Integer): string; + function HasGroupFooter(AGridRow: TcxCustomGridRow; ALevel: Integer): Boolean; + function HasGroupFooterItem(ALevel, AIndex: Integer): Boolean; + function HasGroupFooters(AGridRow: TcxCustomGridRow): Boolean; + + property ColumnCount: Integer read GetColumnCount; + property Columns[Index: Integer]: TcxGridColumn read GetColumn; + property DataRowHeight: Integer read GetDataRowHeight; + property DataRowHeightAssigned: Boolean read GetDataRowHeightAssigned; + property ExpandButtonColor: TColor read GetExpandButtonColor; + property ExpandButtonSize: Integer read GetExpandButtonSize; + property FooterHeight: Integer read GetFooterHeight; + property FooterHeightAssigned: Boolean read GetFooterHeightAssigned; + property FooterItemTexts[Index: Integer]: string read GetFooterItemText; + property FooterMultiline: Boolean read GetFooterMultiline; + property GridLines: TcxGridLines read GetGridLines; + property GroupedColumnCount: Integer read GetGroupedColumnCount; + property GroupedColumns[Index: Integer]: TcxGridColumn read GetGroupedColumn; + property GroupFooterHeight: Integer read GetGroupFooterHeight; + property GroupFooterHeightAssigned: Boolean read GetGroupFooterHeightAssigned; + property GroupFootersMode: TcxGridGroupFootersMode read GetGroupFootersMode; + property GroupFootersMultiline: Boolean read GetGroupFootersMultiline; + property GroupRowHeight: Integer read GetGroupRowHeight; + property GroupRowHeightAssigned: Boolean read GetGroupRowHeightAssigned; + property GroupRowSeparatorColor: TColor read GetGroupRowSeparatorColor; + property GroupRowSeparatorThickness: Integer read GetGroupRowSeparatorThickness; + property HasFooterItem[Index: Integer]: Boolean read GetHasFooterItem; + property HasPreview: Boolean read GetHasPreview; + property HasRowSeparators: Boolean read GetHasRowSeparators; + property HeaderAutoHeight: Boolean read GetHeaderAutoHeight; + property HeaderEndEllipsis: Boolean read GetHeaderEndEllipsis; + property HeaderHeight: Integer read GetHeaderHeight; + property HeaderHeightAssigned: Boolean read GetHeaderHeightAssigned; + property HeaderMultilines[Column: TcxGridColumn]: Boolean read GetHeaderMultiline; + property IndicatorWidth: Integer read GetIndicatorWidth; + property PreviewColumn: TcxGridColumn read GetPreviewColumn; + property PreviewLeftIndent: Integer read GetPreviewLeftIndent; + property PreviewPlace: TcxGridPreviewPlace read GetPreviewPlace; + property PreviewRightIndent: Integer read GetPreviewRightIndent; + property RowCount: Integer read GetRowCount; + property Rows[Index: Integer]: TcxCustomGridRow read GetRow; + property RowSeparatorColor: TColor read GetRowSeparatorColor; + property RowSeparatorThickness: Integer read GetRowSeparatorThickness; + property ShowExpandButtonsForEmptyDetails: Boolean read GetShowExpandButtonsForEmptyDetails; + property ShowHorzGridLines: Boolean read GetShowHorzGridLines; + property ShowVertGridLines: Boolean read GetShowVertGridLines; + property ThemedFooterItemColor: TColor read GetThemedFooterItemColor; + property ThemedFooterItemTextColor: TColor read GetThemedFooterItemTextColor; + property ThemedHeaderItemColor: TColor read GetThemedHeaderItemColor; + property ThemedHeaderItemTextColor: TColor read GetThemedHeaderItemTextColor; + end; + + TdxCustomGridTableViewItemPlaceControllerClass = class of TdxCustomGridTableViewItemPlaceController; + + TdxCustomGridTableViewItemPlaceController = class + private + FFormatter: TdxGridTableViewFormatter; + FHeaderLineCount: Integer; + FWidth: Integer; + function GetHeaderLineCount: Integer; + function GetWidth: Integer; + procedure SetWidth(Value: Integer); + protected + function CalculateWidth: Integer; virtual; + function CalculateHeaderLineCount: Integer; virtual; + function GetItemByColumn(Column: TcxGridColumn): TdxGridTableViewColumnPlace; virtual; + procedure WidthChanged; virtual; + public + constructor Create(AFormatter: TdxGridTableViewFormatter); virtual; + + procedure Calculate; virtual; + procedure Refresh; virtual; + + property Formatter: TdxGridTableViewFormatter read FFormatter; + property HeaderLineCount: Integer read GetHeaderLineCount; + property ItemsByColumn[Column: TcxGridColumn]: TdxGridTableViewColumnPlace read GetItemByColumn; default; + property Width: Integer read GetWidth write SetWidth; + end; + + TdxGridTableViewColumnPlaceClass = class of TdxGridTableViewColumnPlace; + + TdxGridTableViewColumnPlace = class + private + FColumn: TcxGridColumn; + FController: TdxGridTableViewColumnPlaceController; + FLeftBound: Integer; + FWidth: Integer; + function GetAdapter: TdxGridTableViewAdapter; + function GetCellBounds(RowIndex: Integer): TRect; + function GetCellHeight(RowIndex: Integer): Integer; + function GetFooterCellBounds: TRect; + function GetFooterLineHeight: Integer; + function GetFormatter: TdxGridTableViewFormatter; + function GetGroupFooterCellBounds(IndentCount: Integer): TRect; + function GetGroupFooterLineHeight: Integer; + function GetHeaderCellBounds: TRect; + function GetHeaderLineHeight: Integer; + function GetIndex: Integer; + function GetIsFixed: Boolean; + function GetLeftBound: Integer; + function GetMinWidth: Integer; + function GetOriginalWidth: Integer; + function GetWidth: Integer; + protected + function CalculateLeftBound: Integer; virtual; + function GetLineCount: Integer; virtual; + function GetRowIndex: Integer; virtual; + procedure InitAutoWidthItem(AnItem: TcxAutoWidthItem); virtual; + + property Adapter: TdxGridTableViewAdapter read GetAdapter; + property Formatter: TdxGridTableViewFormatter read GetFormatter; + property IsFixed: Boolean read GetIsFixed; + property LineCount: Integer read GetLineCount; + property MinWidth: Integer read GetMinWidth; + property OriginalWidth: Integer read GetOriginalWidth; + property RowIndex: Integer read GetRowIndex; + public + constructor Create(AController: TdxGridTableViewColumnPlaceController; AColumn: TcxGridColumn); virtual; + procedure Calculate(ALeftBound: Integer); virtual; + + property CellBounds[RowIndex: Integer]: TRect read GetCellBounds; + property CellHeights[RowIndex: Integer]: Integer read GetCellHeight; + property Column: TcxGridColumn read FColumn; + property Controller: TdxGridTableViewColumnPlaceController read FController; + property FooterCellBounds: TRect read GetFooterCellBounds; + property FooterLineHeight: Integer read GetFooterLineHeight; + property GroupFooterCellBounds[IndentCount: Integer]: TRect read GetGroupFooterCellBounds; + property GroupFooterLineHeight: Integer read GetGroupFooterLineHeight; + property HeaderCellBounds: TRect read GetHeaderCellBounds; + property HeaderLineHeight: Integer read GetHeaderLineHeight; + property Index: Integer read GetIndex; + property LeftBound: Integer read GetLeftBound write FLeftBound; + property Width: Integer read GetWidth write FWidth; + end; + + TdxGridTableViewColumnPlaceController = class(TdxCustomGridTableViewItemPlaceController) + private + FColumnIndexes: TList; + FItems: TList; + function GetAdapter: TdxGridTableViewAdapter; + function GetColumnIndex(Column: TcxGridColumn): Integer; + function GetItem(Index: Integer): TdxGridTableViewColumnPlace; + function GetItemCount: Integer; + procedure FreeAndNilItems; + protected + function CalculateWidth: Integer; override; + function GetItemByColumn(Column: TcxGridColumn): TdxGridTableViewColumnPlace; override; + + procedure AddItems; virtual; + procedure ClearItems; + function CreateItem(AColumn: TcxGridColumn): TdxGridTableViewColumnPlace; virtual; + function GetItemClass(AColumn: TcxGridColumn): TdxGridTableViewColumnPlaceClass; virtual; + + function CalculateItemLeftBound(AnItem: TdxGridTableViewColumnPlace): Integer; virtual; + procedure CalculateItemsWidth; virtual; + + function GetItemsAutoWidth: Boolean; virtual; + function GetItemsAvailableWidth: Integer; virtual; + + property Adapter: TdxGridTableViewAdapter read GetAdapter; + property ItemsAutoWidth: Boolean read GetItemsAutoWidth; + property ItemsAvailableWidth: Integer read GetItemsAvailableWidth; + public + constructor Create(AFormatter: TdxGridTableViewFormatter); override; + destructor Destroy; override; + + procedure Calculate; override; + procedure Refresh; override; + + function IndexOf(AnItem: TdxGridTableViewColumnPlace): Integer; overload; + function IndexOf(AColumn: TcxGridColumn): Integer; overload; + + property ColumnIndexes[Column: TcxGridColumn]: Integer read GetColumnIndex; + property ItemCount: Integer read GetItemCount; + property Items[Index: Integer]: TdxGridTableViewColumnPlace read GetItem; default; + end; + + TdxGridTableViewReportDataAdapter = class + private + FBuilder: TdxCustomGridViewBuilder; + function GetReportItem(Row: TcxCustomGridRow; Column: TcxGridColumn): TdxReportVisualItem; + function GetReportRow(Index: Integer): TdxReportCell; + function GetReportRowByGridRow(Row: TcxCustomGridRow): TdxReportCell; + function GetReportRowCount: Integer; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); virtual; + + property Builder: TdxCustomGridViewBuilder read FBuilder; + property ReportItems[Row: TcxCustomGridRow; Column: TcxGridColumn]: TdxReportVisualItem read GetReportItem; + property ReportRowCount: Integer read GetReportRowCount; + property ReportRows[Index: Integer]: TdxReportCell read GetReportRow; default; + property ReportRowsByGridRow[Row: TcxCustomGridRow]: TdxReportCell read GetReportRowByGridRow; + end; + + TdxGridTableViewFormatter = class(TdxCustomGridTableViewFormatter) + private + FColumns: TList; + FDetailsLineHeight: Integer; + FFooterLineHeight: Integer; + FGroupFooterLineHeight: Integer; + FGroupRowLineHeight: Integer; + FHeaderLineHeight: Integer; + FItemPlaceController: TdxCustomGridTableViewItemPlaceController; + FPreviewLineHeight: Integer; + FReportDataAdapter: TdxGridTableViewReportDataAdapter; + FRowHeights: TList; + function GetColumn(Index: Integer): TcxGridColumn; + function GetColumnCount: Integer; + function GetGroupRowSeparatorColor: TColor; + function GetGroupRowSeparatorThickness: Integer; + function GetHasPreview: Boolean; + function GetHeaderLineCount: Integer; + function GetPreviewAutoHeight: Boolean; + function GetPreviewColumn: TcxGridColumn; + function GetPreviewMaxLineCount: Integer; + function GetRow(Index: Integer): TcxCustomGridRow; + function GetRowCount: Integer; + function GetRowHeight(Index: Integer): Integer; + function GetRowHeightByRow(Row: TcxCustomGridRow): Integer; + function GetRowSeparatorColor: TColor; + function GetRowSeparatorThickness: Integer; + function GetShowGroupFooters: Boolean; + function GetShowFooters: Boolean; + function GetShowHeaders: Boolean; + function GetShowPreview: Boolean; + procedure SetRowHeight(Index: Integer; Value: Integer); + procedure SetRowHeightByRow(Row: TcxCustomGridRow; Value: Integer); + protected + { IdxPSCellParams2 } + function IdxPSCellParams2_GetPreviewMarginLeft: Integer; override; + function IdxPSCellParams2_GetPreviewMarginRight: Integer; override; + function IdxPSCellParams2_GetPreviewMaxHeight: Integer; override; + function IdxPSCellParams2_GetPreviewMaxLineCount: Integer; override; + + procedure AddHorizontalDelimiters; override; + {$IFDEF DXVER500} + procedure AfterBuilding; override; + {$ENDIF} + procedure BeforeBuilding; override; + procedure Calculate; override; + procedure CalculateDataRowHeights; virtual; + procedure CalculateLineHeights; override; + + function GetItemPlaceControllerClass: TdxCustomGridTableViewItemPlaceControllerClass; virtual; + function MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; override; + + {$IFDEF DXVER500} + function CanCellMerging: Boolean; virtual; + function CanColumnCellMerging(AColumn: TcxGridColumn): Boolean; virtual; + procedure PerformCellMerging; virtual; + procedure PerformColumnCellMerging(AColumn: TcxGridColumn); virtual; + {$ENDIF} + + // actual columns used inside building (depends on ActualVisibility of columns and selection status) + procedure BuildColumnList; virtual; + procedure BuildItemLists; virtual; + function IsColumnActuallyVisible(AColumn: TcxGridColumn): Boolean; virtual; + + function GetViewWidth: Integer; override; + + property ItemPlaceController: TdxCustomGridTableViewItemPlaceController read FItemPlaceController; + property ReportDataAdapter: TdxGridTableViewReportDataAdapter read FReportDataAdapter; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); override; + destructor Destroy; override; + + function Adapter: TdxGridTableViewAdapter; reintroduce; overload; + function Builder: TdxGridTableViewBuilder; reintroduce; overload; + + { Footers } + procedure DoInitializeFooterItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + procedure DoInitializeFooterRow(ARow: TdxReportCell); virtual; + procedure DoReportLinkInitializeFooterItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + function GetFooterItemBounds(AnIndex: Integer): TRect; virtual; + function GetFooterItemClass(AnIndex: Integer): TdxReportCellTextClass; virtual; + function GetFooterItemViewParams(AColumn: TcxGridColumn): TdxReportItemViewParams; virtual; + + { Group Footers } + procedure DoInitializeGroupFooterHost(AnItem: TdxReportVisualItem; ARecord: TcxCustomGridRecord; AGroupLevel: Integer); virtual; + procedure DoInitializeGroupFooterItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer; ARecord: TcxCustomGridRecord; AGroupLevel: Integer); virtual; + procedure DoInitializeGroupFooterRow(ARow: TdxReportCell; + ARecord: TcxCustomGridRecord; AGroupLevel: Integer); virtual; + procedure DoReportLinkInitializeGroupFooterItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer; ARecord: TcxCustomGridRecord; AGroupLevel: Integer); virtual; + function GetGroupFooterItemClass(AnIndex: Integer): TdxReportCellTextClass; virtual; + function GetGroupFooterItemBounds(AnIndex, AGroupLevel: Integer): TRect; virtual; + function GetGroupFooterItemViewParams(ARecord: TcxCustomGridRecord; AGroupLevel: Integer; + AColumn: TcxGridColumn): TdxReportItemViewParams; virtual; + + { Group Row } + procedure DoInitializeGroupRowItem(AnItem: TAbstractdxReportCellData; ARow: TcxGridGroupRow); virtual; + procedure DoInitializeGroupRow(ARow: TdxReportCell; ARecord: TcxCustomGridRecord); virtual; + function GetGroupRowClass: TdxReportCellTextClass; virtual; + function GetGroupRowViewParams(ARecord: TcxCustomGridRecord; ALevel: Integer): TdxReportItemViewParams; virtual; + + { Group Row Separator - Office11 Grouping Style } + procedure DoInitializeGroupRowSeparator(ASeparator: TAbstractdxReportCellData); virtual; + procedure DoInitializeGroupSeparatorRow(ARow: TdxReportCell); virtual; + function GetGroupRowSeparatorClass: TdxReportCellDataClass; virtual; + + { Headers } + procedure DoInitializeHeaderItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + procedure DoInitializeHeaderRow(ARow: TdxReportCell); virtual; + procedure DoReportLinkInitializeHeaderItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + function GetHeaderItemBounds(AnIndex: Integer): TRect; virtual; + function GetHeaderItemClass(AnIndex: Integer): TdxReportCellTextClass; virtual; + function GetHeaderItemViewParams(AColumn: TcxGridColumn): TdxReportItemViewParams; virtual; + + { Indents and Expand Buttons } + function CreateIndent(AParent: TdxReportCell): TdxReportCellExpandButton; virtual; + procedure DoInitializeDataRowIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); virtual; + procedure DoInitializeExpandButton(AnExpandButton: TdxReportCellExpandButton; + ARecord: TcxCustomGridRecord; AnIsMasterIndent: Boolean); virtual; + procedure DoInitializeGroupFooterIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); virtual; + procedure DoInitializeGroupRowIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); virtual; + procedure DoInitializeMasterDataRowIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); virtual; + procedure DoInitializeRowSeparatorIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); virtual; + function GetIndentClass: TdxReportCellExpandButtonClass; virtual; + function GetIndentViewParams(ARecord: TcxCustomGridRecord; + AnIndex, AnIndentCount: Integer; ANonRecordIndent: Boolean): TdxReportItemViewParams; virtual; + function HasExpandButton(ARecord: TcxCustomGridRecord): Boolean; virtual; + + { Items } + procedure DoInitializeDataRow(ARow: TdxReportCell; ARecord: TcxCustomGridRecord); virtual; + procedure DoReportLinkInitializeItem(AnItem: TAbstractdxReportCellData; + AColumn: TcxGridColumn; ARecord: TcxCustomGridRecord); virtual; + function GetItemBounds(AGridRow: TcxCustomGridRow; + AGridRowIndex, AColumnIndex: Integer): TRect; virtual; + function GetItemViewParams(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False): TdxReportItemViewParams; override; + + { Master Indent } + procedure DoInitializeMasterIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer); override; + + { Preview } + procedure DoInitializePreview(APreview: TAbstractdxReportCellData; AColumn: TcxGridColumn; + ARecord: TcxCustomGridRecord); virtual; + function GetPreviewClass(AColumn: TcxGridColumn; + ARecord: TcxCustomGridRecord): TdxReportCellDataClass; virtual; + function GetPreviewViewParams(AColumn: TcxGridColumn; + ARecord: TcxCustomGridRecord): TdxReportItemViewParams; virtual; + + { Row Separator } + procedure DoInitializeSeparatorRow(ARow: TdxReportCell); virtual; + procedure DoInitializeRowSeparator(ASeparator: TAbstractdxReportCellData); virtual; + function GetRowSeparatorClass: TdxReportCellDataClass; virtual; + + function GetReportItem(ARow: TcxCustomGridRow; AColumn: TcxGridColumn): TdxReportVisualItem; + + property ColumnCount: Integer read GetColumnCount; + property Columns[Index: Integer]: TcxGridColumn read GetColumn; + property DetailsLineHeight: Integer read FDetailsLineHeight write FDetailsLineHeight; + property FooterLineHeight: Integer read FFooterLineHeight write FFooterLineHeight; + property GroupFooterLineHeight: Integer read FGroupFooterLineHeight write FGroupFooterLineHeight; + property GroupRowLineHeight: Integer read FGroupRowLineHeight write FGroupRowLineHeight; + property GroupRowSeparatorColor: TColor read GetGroupRowSeparatorColor; + property GroupRowSeparatorThickness: Integer read GetGroupRowSeparatorThickness; + property HasPreview: Boolean read GetHasPreview; + property HeaderLineCount: Integer read GetHeaderLineCount; + property HeaderLineHeight: Integer read FHeaderLineHeight write FHeaderLineHeight; + property PreviewAutoHeight: Boolean read GetPreviewAutoHeight; + property PreviewColumn: TcxGridColumn read GetPreviewColumn; + property PreviewLineHeight: Integer read FPreviewLineHeight write FPreviewLineHeight; + property PreviewMaxLineCount: Integer read GetPreviewMaxLineCount; + property RowCount: Integer read GetRowCount; + property RowHeights[Index: Integer]: Integer read GetRowHeight write SetRowHeight; + property RowHeightsByRow[Row: TcxCustomGridRow]: Integer read GetRowHeightByRow write SetRowHeightByRow; + property Rows[Index: Integer]: TcxCustomGridRow read GetRow; + property RowSeparatorColor: TColor read GetRowSeparatorColor; + property RowSeparatorThickness: Integer read GetRowSeparatorThickness; + property ShowGroupFooters: Boolean read GetShowGroupFooters; + property ShowFooters: Boolean read GetShowFooters; + property ShowHeaders: Boolean read GetShowHeaders; + property ShowPreview: Boolean read GetShowPreview; + end; + + TdxGridTableViewBuilder = class(TdxCustomGridTableViewBuilder) + private + function GetLastReportRow: TdxReportCell; + function GetProcessedView: TcxCustomGridView; + procedure SetProcessedView(Value: TcxCustomGridView); + protected + procedure AddDelimitersHardVert(AReportRow: TdxReportCell); + + procedure DoBuildViewBody; override; + procedure DoBuildViewFooter; override; + + { Details View } + procedure CreateDetails(AMasterRow: TcxGridMasterDataRow); virtual; + procedure CreateDetailView(AGridView: TcxCustomGridView); virtual; + function GetAreDetailsBuilt: Boolean; virtual; + + { Footer } + procedure CreateFooter; virtual; + function GetFootersProducer: TdxGridTableViewFootersProducer; virtual; + function GetFootersProducerClass: TdxGridTableViewFootersProducerClass; virtual; + + { Group Footer } + procedure CreateGroupFooters(AGridRow: TcxCustomGridRow); virtual; + function GetGroupFooterProducer: TdxGridTableViewGroupFooterProducer; virtual; + function GetGroupFooterProducerClass: TdxGridTableViewGroupFooterProducerClass; virtual; + + { Header } + procedure CreateHeader; virtual; + function GetHeadersProducer: TdxGridTableViewHeadersProducer; virtual; + function GetHeadersProducerClass: TdxGridTableViewHeadersProducerClass; virtual; + + { Rows } + procedure CreateRow(AGridRow: TcxCustomGridRow; ARowIndex: Integer); virtual; + procedure CreateRows; virtual; + function GetRowProducer(AGridRow: TcxCustomGridRow): TdxGridTableViewCustomDataRowProducer; virtual; + function GetRowProducerClass(AGridRow: TcxCustomGridRow): TdxGridTableViewCustomDataRowProducerClass; virtual; + + { Row Separators } + procedure CreateRowSeparator(AGridRow: TcxCustomGridRow; AnIsLast: Boolean = False); virtual; + function GetRowSeparatorProducer: TdxGridTableViewRowSeparatorProducer; virtual; + function GetRowSeparatorProducerClass: TdxGridTableViewRowSeparatorProducerClass; virtual; + function GetShowRowSeparators: Boolean; virtual; + + { GroupRow Separators } + procedure CreateGroupRowSeparator(AGridRow: TcxGridGroupRow); virtual; + function GetGroupRowSeparatorProducer: TdxGridTableViewGroupRowSeparatorProducer; virtual; + function GetGroupRowSeparatorProducerClass: TdxGridTableViewGroupRowSeparatorProducerClass; virtual; + function GetShowGroupRowSeparators: Boolean; virtual; + + function GridView: TcxGridTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + + property LastReportRow: TdxReportCell read GetLastReportRow; + property ProcessedView: TcxCustomGridView read GetProcessedView write SetProcessedView; + public + function Adapter: TdxGridTableViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + function Formatter: TdxGridTableViewFormatter; reintroduce; overload; + class function FormatterClass: TdxGridViewFormatterClass; override; + + property AreDetailsBuilt: Boolean read GetAreDetailsBuilt; + property ShowGroupRowSeparators: Boolean read GetShowGroupRowSeparators; + property ShowRowSeparators: Boolean read GetShowRowSeparators; + end; + + { DBTableView Adapter, Formatter and Builder } + + TdxGridDBTableViewAdapter = class(TdxGridTableViewAdapter) + private + FPrevAllRecordsAreLoaded: Boolean; + protected + procedure AfterBuilding; override; + procedure BeforeBuilding; override; + function DataController: TcxGridDBDataController; reintroduce; overload; + + function DBDataModeController: TcxDBDataModeController; virtual; + procedure LoadAllRecords; virtual; + procedure UnloadAllRecords; virtual; + public + function GridView: TcxGridDBTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + end; + + TdxGridDBTableViewBuilder = class(TdxGridTableViewBuilder) + public + function Adapter: TdxGridDBTableViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + end; + + { BandedTableView Adapter, Formatter and Builder } + + TdxGridBandedTableViewAdapter = class(TdxGridTableViewAdapter) + private + FFooterLineCount: Integer; + function GetBand(Index: Integer): TcxGridBand; + function GetBandCount: Integer; + function GetBandEndEllipsis: Boolean; + function GetBandHeaderLineCount: Integer; + function GetBandHeaderMultiline: Boolean; + function GetBottomBand(Index: Integer): TcxGridBand; + function GetBottomBandCount: Integer; + function GetColumn(Index: Integer): TcxGridBandedColumn; + function GetFooterLineCount: Integer; + function GetRootBand(Index: Integer): TcxGridBand; + function GetRootBandCount: Integer; + function GetThemedBandHeaderItemColor: TColor; + function GetThemedBandHeaderItemTextColor: TColor; + protected + function CalculateDetailsLineCount: Integer; override; + function CalculateFooterLineCount: Integer; virtual; + + function GetBandHeaderHeight: Integer; virtual; + function GetBandHeaderHeightAssigned: Boolean; virtual; + function GetBandHeaderViewParams(ABand: TcxGridBand): TcxViewParams; virtual; + function GetDataRowHeightAssigned: Boolean; override; + function GetFooterHeightAssigned: Boolean; override; + function GetHeaderHeightAssigned: Boolean; override; + function GetHeaderMultiline(Column: TcxGridColumn): Boolean; override; + public + constructor Create(AMasterAdapter: TdxCustomGridViewAdapter; AGridView: TcxCustomGridView); override; + + function GridView: TcxGridBandedTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + function Styles: TcxGridBandedTableViewStyles; reintroduce; overload; + + property BandCount: Integer read GetBandCount; + property BandEndEllipsis: Boolean read GetBandEndEllipsis; + property BandHeaderHeight: Integer read GetBandHeaderHeight; + property BandHeaderHeightAssigned: Boolean read GetBandHeaderHeightAssigned; + property BandHeaderLineCount: Integer read GetBandHeaderLineCount; + property BandHeaderMultiline: Boolean read GetBandHeaderMultiline; + property Bands[Index: Integer]: TcxGridBand read GetBand; + property BottomBandCount: Integer read GetBottomBandCount; + property BottomBands[Index: Integer]: TcxGridBand read GetBottomBand; + property Columns[Index: Integer]: TcxGridBandedColumn read GetColumn; + property FooterLineCount: Integer read GetFooterLineCount write FFooterLineCount; + property RootBandCount: Integer read GetRootBandCount; + property RootBands[Index: Integer]: TcxGridBand read GetRootBand; + property ThemedBandHeaderItemColor: TColor read GetThemedBandHeaderItemColor; + property ThemedBandHeaderItemTextColor: TColor read GetThemedBandHeaderItemTextColor; + end; + + TdxGridBandedTableViewColumnPlace = class(TdxGridTableViewColumnPlace) + private + function GetColumn: TcxGridBandedColumn; + function GetController: TdxCustomGridBandedTableViewItemPlace; + function GetFormatter: TdxGridBandedTableViewFormatter; + protected + function GetLineCount: Integer; override; + function GetRowIndex: Integer; override; + public + property Column: TcxGridBandedColumn read GetColumn; + property Controller: TdxCustomGridBandedTableViewItemPlace read GetController; + property Formatter: TdxGridBandedTableViewFormatter read GetFormatter; + end; + + TdxCustomGridBandedTableViewItemPlaceClass = class of TdxCustomGridBandedTableViewItemPlace; + + TdxCustomGridBandedTableViewItemPlace = class(TdxGridTableViewColumnPlaceController) + private + FBand: TcxGridBand; + FController: TdxGridBandedTableViewItemPlaceController; + FHeight: Integer; + FLeftBound: Integer; + FMinWidth: Integer; + FParent: TdxGridBandedTableViewItemPlace; + FTopBound: Integer; + function GetAdapter: TdxGridBandedTableViewAdapter; + function GetBounds: TRect; + function GetFormatter: TdxGridBandedTableViewFormatter; + function GetHeight: Integer; + function GetIndex: Integer; + function GetIsFixed: Boolean; + function GetLeftBound: Integer; + function GetLevelIndex: Integer; + function GetMinWidth: Integer; + function GetTopBound: Integer; + function GetViewParams: TdxReportItemViewParams; + protected + function CalculateHeaderLineCount: Integer; override; + function CalculateWidth: Integer; override; + function GetItemClass(AColumn: TcxGridColumn): TdxGridTableViewColumnPlaceClass; override; + + procedure AssignWidth; + function CalculateHeight: Integer; virtual; + function CalculateLeftBound: Integer; virtual; + function CalculateLevelHeight: Integer; virtual; + function CalculateLineHeight: Integer; virtual; + function CalculateMinWidth: Integer; virtual; + function CalculateTopBound: Integer; virtual; + procedure InitAutoWidthItem(AnItem: TcxAutoWidthItem); virtual; + + function GetRowCount: Integer; virtual; + function InternalCalculateMinWidth: Integer; virtual; + function InternalCalculateWidth: Integer; virtual; + + property Adapter: TdxGridBandedTableViewAdapter read GetAdapter; + property Band: TcxGridBand read FBand; + property IsFixed: Boolean read GetIsFixed; + property LevelIndex: Integer read GetLevelIndex; + property MinWidth: Integer read GetMinWidth; + property RowCount: Integer read GetRowCount; + property ViewParams: TdxReportItemViewParams read GetViewParams; + public + constructor Create(AController: TdxGridBandedTableViewItemPlaceController; + AParent: TdxGridBandedTableViewItemPlace; ABand: TcxGridBand); reintroduce; virtual; + + property Bounds: TRect read GetBounds; + property Controller: TdxGridBandedTableViewItemPlaceController read FController; + property Formatter: TdxGridBandedTableViewFormatter read GetFormatter; + property Height: Integer read GetHeight write FHeight; + property Index: Integer read GetIndex; + property LeftBound: Integer read GetLeftBound write FLeftBound; + property Parent: TdxGridBandedTableViewItemPlace read FParent; + property TopBound: Integer read GetTopBound write FTopBound; + end; + + TdxGridBandedTableViewItemPlace = class(TdxCustomGridBandedTableViewItemPlace) + private + FChildItems: TList; + function GetChildItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; + function GetChildItemCount: Integer; + protected + function GetRowCount: Integer; override; + function InternalCalculateMinWidth: Integer; override; + function InternalCalculateWidth: Integer; override; + procedure WidthChanged; override; + + procedure CalculateChildItemWidths; + {$IFDEF DXVER500} + procedure RefreshChildItems; + {$ENDIF} + public + constructor Create(AnOwner: TdxGridBandedTableViewItemPlaceController; + AParent: TdxGridBandedTableViewItemPlace; ABand: TcxGridBand); override; + destructor Destroy; override; + + function IndexOf(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; + {$IFDEF DXVER500} + procedure Refresh; override; + {$ENDIF} + + property ChildItemCount: Integer read GetChildItemCount; + property ChildItems[Index: Integer]: TdxCustomGridBandedTableViewItemPlace read GetChildItem; + end; + + TdxGridBandedTableViewBottomItemPlace = class(TdxCustomGridBandedTableViewItemPlace) + protected + procedure AddItems; override; + function CalculateItemLeftBound(AnItem: TdxGridTableViewColumnPlace): Integer; override; + procedure CalculateItemsWidth; override; + function GetItemsAutoWidth: Boolean; override; + function GetItemsAvailableWidth: Integer; override; + + function GetRowCount: Integer; override; + function InternalCalculateMinWidth: Integer; override; + function InternalCalculateWidth: Integer; override; + procedure WidthChanged; override; + end; + + TdxGridBandedTableViewItemPlaceController = class(TdxCustomGridTableViewItemPlaceController) + private + FBottomItems: TList; + FHeight: Integer; + FItems: TList; + FLevelCount: Integer; + FLevelHeights: TList; + FRootItems: TList; + function GetAdapter: TdxGridBandedTableViewAdapter; + function GetAutoWidth: Boolean; + function GetAvailableWidth: Integer; + function GetBottomItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; + function GetBottomItemCount: Integer; + function GetFormatter: TdxGridBandedTableViewFormatter; + function GetHeight: Integer; + function GetItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; + function GetItemByBand(Band: TcxGridBand): TdxCustomGridBandedTableViewItemPlace; + function GetItemCount: Integer; + function GetLevelCount: Integer; + function GetLevelHeight(Index: Integer): Integer; + function GetRootItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; + function GetRootItemCount: Integer; + procedure SetLevelHeight(Index: Integer; Value: Integer); + procedure FreeAndNilItems; + protected + function CalculateHeaderLineCount: Integer; override; + function CalculateWidth: Integer; override; + function GetItemByColumn(Column: TcxGridColumn): TdxGridTableViewColumnPlace; override; + + procedure AddItems; virtual; + procedure ClearItems; + function CreateItem(ABand: TcxGridBand): TdxCustomGridBandedTableViewItemPlace; virtual; + function GetItemClass(ABand: TcxGridBand): TdxCustomGridBandedTableViewItemPlaceClass; virtual; + procedure RefreshBottomItems; + procedure RefreshItems; + procedure RefreshRootItems; + + function CalculateHeight: Integer; virtual; + function CalculateItemHeight(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; virtual; + function CalculateItemLeftBound(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; virtual; + function CalculateItemTopBound(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; virtual; + function CalculateLevelCount: Integer; virtual; + + procedure CalculateItemWidths; + procedure CalculateLevelHeights; + + property AutoWidth: Boolean read GetAutoWidth; + property Adapter: TdxGridBandedTableViewAdapter read GetAdapter; + property AvailableWidth: Integer read GetAvailableWidth; + public + constructor Create(AFormatter: TdxGridTableViewFormatter); override; + destructor Destroy; override; + + procedure Calculate; override; + procedure Refresh; override; + + function IndexOf(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; overload; + function IndexOf(ABand: TcxGridBand): Integer; overload; + function RootIndexOf(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; overload; + function RootIndexOf(ABand: TcxGridBand): Integer; overload; + + property BottomItemCount: Integer read GetBottomItemCount; + property BottomItems[Index: Integer]: TdxCustomGridBandedTableViewItemPlace read GetBottomItem; + property Formatter: TdxGridBandedTableViewFormatter read GetFormatter; + property Height: Integer read GetHeight; + property ItemCount: Integer read GetItemCount; + property Items[Index: Integer]: TdxCustomGridBandedTableViewItemPlace read GetItem; default; + property ItemsByBand[Band: TcxGridBand]: TdxCustomGridBandedTableViewItemPlace read GetItemByBand; + property LevelCount: Integer read GetLevelCount; + property LevelHeights[Index: Integer]: Integer read GetLevelHeight write SetLevelHeight; + property RootItemCount: Integer read GetRootItemCount; + property RootItems[Index: Integer]: TdxCustomGridBandedTableViewItemPlace read GetRootItem; + end; + + TdxGridBandedTableViewFormatter = class(TdxGridTableViewFormatter) + private + FBands: TList; + function GetBand(Index: Integer): TcxGridBand; + function GetBandCount: Integer; + function GetColumn(Index: Integer): TcxGridBandedColumn; + function GetItemPlaceController: TdxGridBandedTableViewItemPlaceController; + function GetShowBandHeaders: Boolean; + protected + procedure AddHorizontalDelimiters; override; + + {$IFDEF DXVER500} + function CanColumnCellMerging(AColumn: TcxGridColumn): Boolean; override; + function IsColumnActuallyVisible(AColumn: TcxGridColumn): Boolean; override; + {$ENDIF} + function GetItemPlaceControllerClass: TdxCustomGridTableViewItemPlaceControllerClass; override; + + procedure BuildBandList; virtual; + procedure BuildItemLists; override; + function IsBandActuallyVisible(ABand: TcxGridBand): Boolean; virtual; + + function MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; override; + + property ItemPlaceController: TdxGridBandedTableViewItemPlaceController read GetItemPlaceController; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); override; + destructor Destroy; override; + + function Adapter: TdxGridBandedTableViewAdapter; reintroduce; overload; + function Builder: TdxGridBandedTableViewBuilder; reintroduce; overload; + + { Bands } + procedure DoInitializeBandItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + procedure DoInitializeBandRow(ARow: TdxReportCell); virtual; + procedure DoReportLinkInitializeBandItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + function GetBandItemBounds(AnIndex: Integer): TRect; virtual; + function GetBandItemClass(AnIndex: Integer): TdxReportCellTextClass; virtual; + function GetBandItemViewParams(ABand: TcxGridBand): TdxReportItemViewParams; virtual; + + property BandCount: Integer read GetBandCount; + property Bands[Index: Integer]: TcxGridBand read GetBand; + property Columns[Index: Integer]: TcxGridBandedColumn read GetColumn; + property ShowBandHeaders: Boolean read GetShowBandHeaders; + end; + + TdxGridBandedTableViewBuilder = class(TdxGridTableViewBuilder) + protected + procedure DoBuildViewBody; override; + + procedure CreateBands; virtual; + function GetBandsProducer: TdxGridTableViewBandsProducer; virtual; + function GetBandsProducerClass: TdxGridTableViewBandsProducerClass; virtual; + + function GridView: TcxGridBandedTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + public + function Adapter: TdxGridBandedTableViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + function Formatter: TdxGridBandedTableViewFormatter; reintroduce; overload; + class function FormatterClass: TdxGridViewFormatterClass; override; + end; + + { DBBandedTableView Adapter, Formatter and Builder } + + TdxGridDBBandedTableViewAdapter = class(TdxGridBandedTableViewAdapter) + private + FPrevAllRecordsAreLoaded: Boolean; + protected + procedure AfterBuilding; override; + procedure BeforeBuilding; override; + function DataController: TcxGridDBDataController; reintroduce; overload; + + function DBDataModeController: TcxDBDataModeController; virtual; + procedure LoadAllRecords; virtual; + procedure UnloadAllRecords; virtual; + public + function GridView: TcxGridDBBandedTableView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + end; + + TdxGridDBBandedTableViewBuilder = class(TdxGridBandedTableViewBuilder) + public + function Adapter: TdxGridDBBandedTableViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + end; + + { CardView Adapter, Formatter and Builder } + + TdxReportCard = class; + + TdxReportCardRowClass = class of TdxReportCardRow; + + TdxReportCardRow = class(TdxReportCell) + private + function GetCard: TdxReportCard; + function GetGridCardRow: TcxGridCardViewRow; + function GetHasCaption: Boolean; + function GetHeight: Integer; + function GetProperties: TcxCustomEditProperties; + function GetRowCaption: TdxReportCellText; + function GetRowData: TAbstractdxReportCellData; + function GetWidth: Integer; + procedure SetHeight(Value: Integer); + procedure SetRowCaptionWidth(Value: Integer); + procedure SetWidth(Value: Integer); + protected + procedure AdjustCellSides; virtual; + procedure CreateItems(ABuilder: TdxGridCardViewBuilder); virtual; + function MeasureCaptionWidth(DC: HDC): Integer; + function MeasureDataWidth(DC: HDC): Integer; + property Properties: TcxCustomEditProperties read GetProperties; + public + constructor CreateEx(AParent: TdxReportCell; AGridCardRow: TcxGridCardViewRow); virtual; + + function MeasureHeight(DC: HDC; ACalculateLineHeight: Boolean; + ABuilder: TdxGridCardViewBuilder): Integer; reintroduce; overload; + + property Card: TdxReportCard read GetCard; + property GridCardRow: TcxGridCardViewRow read GetGridCardRow; + property HasCaption: Boolean read GetHasCaption; + property Height: Integer read GetHeight write SetHeight; + property RowCaption: TdxReportCellText read GetRowCaption; + property RowCaptionWidth: Integer write SetRowCaptionWidth; + property RowData: TAbstractdxReportCellData read GetRowData; + property Width: Integer read GetWidth write SetWidth; + end; + + TdxCardBorderPainter = class(TdxPSCellBorderPainter) + protected + procedure DrawShadow(DC: HDC); virtual; + public + procedure Paint(DC: HDC); override; + function Card: TdxReportCard; reintroduce; overload; + end; + + TdxGridCardShadowDepth = 0..15; + TdxGridCardShadowPosition = (cspTopLeft, cspTopRight, cspBottomRight, cspBottomLeft); + + TdxReportCard = class(TdxReportCell) + private + FRowCaptionWidth: Integer; + FShadowColor: TColor; + FShadowDepth: Integer; + FShadowPosition: TdxGridCardShadowPosition; + function GetGridCard: TcxGridCard; + function GetHasShadow: Boolean; + function GetHeight: Integer; + function GetReportLink: TdxGridReportLink; + function GetRow(Index: Integer): TdxReportCardRow; + function GetRowByCardRow(CardRow: TcxGridCardViewRow): TdxReportCardRow; + function GetRowCount: Integer; + function GetRowHeight(Index: Integer): Integer; + function GetRowsAvailableHeight: Integer; + function GetRowsAvailableWidth: Integer; + function GetRowsOriginLeft: Integer; + function GetRowsOriginTop: Integer; + function GetShadowRectHorz: TRect; + function GetShadowRectVert: TRect; + function GetWidth: Integer; + procedure SetHeight(Value: Integer); + procedure SetRowCaptionWidth(Value: Integer); + procedure SetRowHeight(Index, Value: Integer); + procedure SetShadowDepth2(Value: Integer); + procedure SetWidth(Value: Integer); + protected + procedure AddVerticalDelimiters; virtual; + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); override; + procedure CreateRows(ABuilder: TdxGridCardViewBuilder); virtual; + function GetBorderPainterClass: TdxPSCellBorderPainterClass; override; + procedure ReadProperties(AReader: TdxPSDataReader); override; + procedure WriteProperties(AWriter: TdxPSDataWriter); override; + + procedure AdjustHeight; + procedure AdjustRowsCellSides; + procedure AdjustRowsPos; + procedure AdjustRowsHeight(DC: HDC; AAutoHeight: Boolean; ABuilder: TdxGridCardViewBuilder); + procedure AdjustRowsWidth(DC: HDC); + function MeasureCaptionWidth(DC: HDC): Integer; virtual; + function MeasureDataWidth(DC: HDC): Integer; virtual; + + property ReportLink: TdxGridReportLink read GetReportLink; + public + constructor Create(AParent: TdxReportCell); override; + constructor CreateEx(AParent: TdxReportCell; AGridCard: TcxGridCard); virtual; + + function GetBorderOuterBounds(DC: HDC): TRect; override; + function IndexOfCardRow(ACardRow: TcxGridCardViewRow): Integer; + + property GridCard: TcxGridCard read GetGridCard; + property HasShadow: Boolean read GetHasShadow; + property Height: Integer read GetHeight write SetHeight; + property RowCaptionWidth: Integer read FRowCaptionWidth write SetRowCaptionWidth; + property RowCount: Integer read GetRowCount; + property RowHeights[Index: Integer]: Integer read GetRowHeight write SetRowHeight; + property Rows[Index: Integer]: TdxReportCardRow read GetRow; + property RowsAvailableHeight: Integer read GetRowsAvailableHeight; + property RowsAvailableWidth: Integer read GetRowsAvailableWidth; + property RowsByCardRow[CardRow: TcxGridCardViewRow]: TdxReportCardRow read GetRowByCardRow; + property RowsOriginLeft: Integer read GetRowsOriginLeft; + property RowsOriginTop: Integer read GetRowsOriginTop; + property ShadowColor: TColor read FShadowColor write FShadowColor default clBlack; + property ShadowDepth: Integer read FShadowDepth write SetShadowDepth2 default dxDefaultCardsShadowDepth; + property ShadowRectHorz: TRect read GetShadowRectHorz; + property ShadowRectVert: TRect read GetShadowRectVert; + property ShadowPosition: TdxGridCardShadowPosition read FShadowPosition write FShadowPosition default cspBottomRight; + property Width: Integer read GetWidth write SetWidth; + end; + + TdxReportCardClass = class of TdxReportCard; + + TdxGridCardViewAdapter = class(TdxCustomGridTableViewAdapter) + private + function GetCaptionSeparator: string; + function GetCard(Index: Integer): TcxGridCard; + function GetCardCaptionWidth: Integer; + function GetCardCount: Integer; + function GetCardRow(Index: Integer): TcxGridCardViewRow; + function GetCardRowCount: Integer; + function GetCardSeparatorColor: Integer; + function GetCardSeparatorThickness: Integer; + function GetCardWidth: Integer; + function GetHasCardsSeparator: Boolean; + function GetRowAutoHeight: Boolean; + function GetRowCaptionAutoHeight: Boolean; + function GetRowCaptionEndEllipsis: Boolean; + function GetShowRowCaption(Index: Integer): Boolean; + protected + function GetAreAllMasterRowsCollapsed: Boolean; override; + + function GetCaptionRowViewParams(ARecord: TcxCustomGridRecord; + ACardRow: TcxGridCardViewRow): TcxViewParams; virtual; + function GetCardViewParams(ARecord: TcxCustomGridRecord): TcxViewParams; virtual; + function GetContentViewParams(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem): TcxViewParams; override; + function GetRowCaptionViewParams(ARecord: TcxCustomGridRecord; + ACardRow: TcxGridCardViewRow): TcxViewParams; virtual; + public + function GridView: TcxGridCardView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + function Styles: TcxGridCardViewStyles; reintroduce; overload; + + procedure GetVisibleCardRows(ACard: TcxGridCard; AList: TList); + procedure ExpandAllRows(AnOptionsExpanding: TdxGridReportLinkOptionsExpanding; ARecursive: Boolean); override; + function IsFirstRow(ACardRow: TcxGridCardViewRow): Boolean; + function IsLastRow(ACardRow: TcxGridCardViewRow): Boolean; + + property CaptionSeparator: string read GetCaptionSeparator; + property CardCaptionWidth: Integer read GetCardCaptionWidth; + property CardCount: Integer read GetCardCount; + property CardRowCount: Integer read GetCardRowCount; + property CardRows[Index: Integer]: TcxGridCardViewRow read GetCardRow; + property Cards[Index: Integer]: TcxGridCard read GetCard; + property CardSeparatorColor: Integer read GetCardSeparatorColor; + property CardSeparatorThickness: Integer read GetCardSeparatorThickness; + property CardWidth: Integer read GetCardWidth; + property HasCardsSeparator: Boolean read GetHasCardsSeparator; + property RowCaptionAutoHeight: Boolean read GetRowCaptionAutoHeight; + property RowCaptionEndEllipsis: Boolean read GetRowCaptionEndEllipsis; + property RowAutoHeight: Boolean read GetRowAutoHeight; + property ShowRowCaption[Index: Integer]: Boolean read GetShowRowCaption; + end; + + TdxGridCardViewFormatter = class(TdxCustomGridTableViewFormatter) + private + function GetAutoWidth: Boolean; + function GetCaptionAutoWidth: Boolean; + function GetCard(Index: Integer): TcxGridCard; + function GetCardCount: Integer; + function GetCardsAreaWidth: Integer; + function GetInterCardsSpaceHorz: Integer; + function GetInterCardsSpaceVert: Integer; + function GetKeepSameHeight: Boolean; + function GetKeepSameWidth: Boolean; + function GetRowAutoHeight: Boolean; + protected + procedure AddHorizontalDelimiters; override; + procedure AddVerticalDelimiters; override; + function GetViewWidth: Integer; override; + + function GetContentBackgroundBitmapStyleIndex(ATableItem: TcxCustomGridTableItem): Integer; override; + function MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; override; + + function NeedDelimitByRows: Boolean; virtual; + public + function Adapter: TdxGridCardViewAdapter; reintroduce; overload; + function Builder: TdxGridCardViewBuilder; reintroduce; overload; + + { Cards } + procedure DoInitializeCard(ACard: TdxReportCard; AGridCard: TcxGridCard); virtual; + procedure DoInitializeCardsRow(ACard: TdxReportCell); virtual; + function GetCardClass(AGridCard: TcxGridCard): TdxReportCardClass; virtual; + function GetCardViewParams(ARecord: TcxCustomGridRecord): TdxReportItemViewParams; virtual; + + { Cards Caption } + procedure DoInitializeCardRowCaption(AnItem: TdxReportCellText; + ACardRow: TcxGridCardViewRow; AGridCard: TcxGridCard); virtual; + procedure DoReportLinkInitializeCardRowCaption(AnItem: TdxReportCellText; + ACardRow: TcxGridCardViewRow; AGridCard: TcxGridCard); virtual; + function GetCardRowCaptionClass(ACardRow: TcxGridCardViewRow): TdxReportCellTextClass; virtual; + function GetCardRowCaptionViewParams(ARecord: TcxCustomGridRecord; + ACardRow: TcxGridCardViewRow): TdxReportItemViewParams; virtual; + + { Cards Data } + procedure DoReportLinkInitializeCardRowData(AnItem: TAbstractdxReportCellData; + ACardRow: TcxGridCardViewRow; AGridCard: TcxGridCard); virtual; + function GetItemViewParams(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False): TdxReportItemViewParams; override; + + property AutoWidth: Boolean read GetAutoWidth; + property CaptionAutoWidth: Boolean read GetCaptionAutoWidth; + property CardCount: Integer read GetCardCount; + property Cards[Index: Integer]: TcxGridCard read GetCard; + property CardsAreaWidth: Integer read GetCardsAreaWidth; + property InterCardsSpaceHorz: Integer read GetInterCardsSpaceHorz; + property InterCardsSpaceVert: Integer read GetInterCardsSpaceVert; + property KeepSameHeight: Boolean read GetKeepSameHeight; + property KeepSameWidth: Boolean read GetKeepSameWidth; + property RowAutoHeight: Boolean read GetRowAutoHeight; + end; + + TdxGridCardViewBuilder = class(TdxCustomGridTableViewBuilder) + private + FCards: TList; + FMaxCardWidth: Integer; + function GetCard(Index: Integer): TdxReportCard; + function GetCardCount: Integer; + + procedure AdjustCardRowsCellSides; + procedure CreateCards; + procedure ResizeCards; + protected + procedure DoBuildViewBody; override; + + function GetCardsRowProducer: TdxGridCardViewCardsRowProducer; virtual; + function GetCardsRowProducerClass: TdxGridCardViewCardsRowProducerClass; virtual; + procedure PlaceCards; virtual; + + function GridView: TcxGridCardView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + + property CardCount: Integer read GetCardCount; + property Cards[Index: Integer]: TdxReportCard read GetCard; + public + constructor Create(AReportLink: TdxGridReportLink; + AMasterBuilder: TdxCustomGridViewBuilder; AGridView: TcxCustomGridView); override; + destructor Destroy; override; + + function Adapter: TdxGridCardViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + function Formatter: TdxGridCardViewFormatter; reintroduce; overload; + class function FormatterClass: TdxGridViewFormatterClass; override; + + property MaxCardWidth: Integer read FMaxCardWidth; + end; + + { DBCardView Adapter, Formatter and Builder } + + TdxGridDBCardViewAdapter = class(TdxGridCardViewAdapter) + private + FPrevAllRecordsAreLoaded: Boolean; + protected + procedure AfterBuilding; override; + procedure BeforeBuilding; override; + function DataController: TcxGridDBDataController; reintroduce; overload; + + function DBDataModeController: TcxDBDataModeController; virtual; + procedure LoadAllRecords; virtual; + procedure UnloadAllRecords; virtual; + public + function GridView: TcxGridDBCardView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + end; + + TdxGridDBCardViewBuilder = class(TdxGridCardViewBuilder) + public + function Adapter: TdxGridDBCardViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + end; + +{$IFDEF CHARTVIEW} + { ChartView Adapter, Formatter and Builder } + + TdxGridChartViewAdapter = class(TdxCustomGridViewAdapter) + protected + function CreateGraphic(AGraphicClass: TGraphicClass; AWidth: Integer): TGraphic; + function GetCanUseOnEveryPageMode: Boolean; override; + public + function GridView: TcxGridChartView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + end; + + TdxGridChartViewFormatter = class(TdxCustomGridViewFormatter) + private + function GetGraphicClass: TGraphicClass; + function GetGraphicTransparent: Boolean; + protected + function CreateChartImage: TGraphic; virtual; + procedure DoInitializeChartItem(AnItem: TdxReportCellGraphic); virtual; + procedure DoReportLinkInitializeChartItem(AnItem: TdxReportCellGraphic); virtual; + function GetChartItemClass: TdxReportCellGraphicClass; + function GetViewWidth: Integer; override; + public + function Adapter: TdxGridChartViewAdapter; reintroduce; overload; + function Builder: TdxGridChartViewBuilder; reintroduce; overload; + + property GraphicClass: TGraphicClass read GetGraphicClass; + property GraphicTransparent: Boolean read GetGraphicTransparent; + end; + + TdxGridChartViewBuilder = class(TdxCustomGridViewBuilder) + protected + function GetChartProducer: TdxGridChartViewChartProducer; virtual; + function GetChartProducerClass: TdxGridChartViewChartProducerClass; virtual; + procedure CreateChart; virtual; + procedure DoBuildViewBody; override; + + function GridView: TcxGridChartView; reintroduce; overload; + class function GridViewClass: TcxCustomGridViewClass; override; + public + function Adapter: TdxGridChartViewAdapter; reintroduce; overload; + class function AdapterClass: TdxGridViewAdapterClass; override; + function Formatter: TdxGridChartViewFormatter; reintroduce; overload; + class function FormatterClass: TdxGridViewFormatterClass; override; + end; +{$ENDIF} + + { Producers } + + TdxGridViewRowProducer = class + private + FBuilder: TdxCustomGridViewBuilder; + FHost: TdxReportCell; + FMasterIndents: TList; + FRow: TdxReportCell; + FRowHeight: Integer; + function GetDC: HDC; + function GetHostClass: TdxReportCellClass; + function GetIndentWidth: Integer; + function GetMasterBuilder(Index: Integer): TdxCustomGridViewBuilder; + function GetMasterIndent(Index: Integer): TdxReportCellBox; + function GetMasterIndentCount: Integer; + function GetRowHostClass: TdxReportCellClass; + function GetRowOriginX: Integer; + function GetRowWidth: Integer; + protected + procedure AddLeadingMasterIndentsAndSeparators; virtual; + procedure AddMasterIndents(AMasterFormatter: TdxCustomGridViewFormatter; + AMasterAdapter: TdxCustomGridViewAdapter; ALevel: Integer; var ALeftPos: Integer); + procedure AddMasterSeparator(AMasterFormatter: TdxCustomGridViewFormatter; + AMasterAdapter: TdxCustomGridViewAdapter; var ALeftPos: Integer; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); + procedure AddTrailingMasterSeparators; virtual; + function CalculateItemHeight(DC: HDC; AnItem: TdxReportVisualItem): Integer; virtual; + procedure CalculateRowAutoHeight; virtual; + procedure CalculateRowHeight; virtual; + function CreateDetailsSeparator(AParent: TdxReportCell): TdxReportCellBox; virtual; + function CreateMasterIndent(AParent: TdxReportCell): TdxReportCellExpandButton; virtual; + procedure CreateRow; virtual; + procedure CreateRowHost(const AHostInfo: TdxGridAttributeHostInfo); virtual; + function DoesItemParticipateInRowAutoHeightCalculation(AnItem: TdxReportVisualItem): Boolean; virtual; + function GetDetailsSeparatorClass: TdxReportCellBoxClass; virtual; + function GetMasterIndentClass: TdxReportCellExpandButtonClass; virtual; + procedure FixupMasterIndentsHeight; virtual; + procedure FixupRowDataItemHeight(AnItem: TdxReportVisualItem); virtual; + procedure FixupRowDataHeight; virtual; + procedure FixupRowHeight; virtual; + procedure FixupRowOwnHeight; virtual; + procedure InitializeDetailsSeparator(AFormatter: TdxCustomGridViewFormatter; + ASeparator: TdxReportCellBox; ASeparatorKind: TdxVerticalDetailsSeparatorKind); virtual; + procedure InitializeMasterIndent(AFormatter: TdxCustomGridViewFormatter; + AIndent: TdxReportCellExpandButton; AIndex, ALevel: Integer); virtual; + procedure InitializeHost; virtual; + procedure InitializeRow; virtual; + + function GetAutoHeight: Boolean; virtual; + function GetItemsSite: TdxReportCell; virtual; + function GetLineCount: Integer; virtual; + function GetLineHeight: Integer; virtual; + function GetWidth: Integer; virtual; + + property DC: HDC read GetDC; + property HostClass: TdxReportCellClass read GetHostClass; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); virtual; + destructor Destroy; override; + + function Adapter: TdxCustomGridViewAdapter; overload; virtual; + function Builder: TdxCustomGridViewBuilder; overload; virtual; + function Formatter: TdxCustomGridViewFormatter; overload; virtual; + + function Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; virtual; + + property AutoHeight: Boolean read GetAutoHeight; + property Host: TdxReportCell read FHost; + property IndentWidth: Integer read GetIndentWidth; + property ItemsSite: TdxReportCell read GetItemsSite; + property LineCount: Integer read GetLineCount; + property LineHeight: Integer read GetLineHeight; + property MasterBuilders[Index: Integer]: TdxCustomGridViewBuilder read GetMasterBuilder; + property MasterIndentCount: Integer read GetMasterIndentCount; + property MasterIndents[Index: Integer]: TdxReportCellBox read GetMasterIndent; + property Row: TdxReportCell read FRow; + property RowHeight: Integer read FRowHeight write FRowHeight; + property RowOriginX: Integer read GetRowOriginX; + property RowWidth: Integer read GetRowWidth; + property Width: Integer read GetWidth; + end; + + TdxGridViewCustomRowProducer = class(TdxGridViewRowProducer) + private + FItem: TAbstractdxReportCellData; + protected + procedure AddItem; virtual; + function CreateItem(AParent: TdxReportCell): TAbstractdxReportCellData; virtual; + procedure FixupRowDataHeight; override; + procedure InitializeItem; virtual; + + function GetAutoHeight: Boolean; override; + function GetItemClass: TdxReportCellDataClass; virtual; + + property Item: TAbstractdxReportCellData read FItem; + public + function Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; override; + end; + + TdxGridViewCaptionProducer = class(TdxGridViewCustomRowProducer) + private + function GetItem: TdxReportCellText; + protected + procedure InitializeItem; override; + procedure InitializeRow; override; + + function GetItemClass: TdxReportCellDataClass; override; + function GetLineHeight: Integer; override; + public + property Item: TdxReportCellText read GetItem; + end; + + TdxGridViewFilterBarProducer = class(TdxGridViewCustomRowProducer) + private + function GetItem: TdxReportCellText; + protected + procedure InitializeItem; override; + procedure InitializeRow; override; + + function GetItemClass: TdxReportCellDataClass; override; + function GetLineHeight: Integer; override; + public + property Item: TdxReportCellText read GetItem; + end; + + TdxGridViewDetailsSeparatorProducer = class(TdxGridViewCustomRowProducer) + private + function GetItem: TdxReportCellBox; + protected + procedure InitializeItem; override; + procedure InitializeRow; override; + + function GetItemClass: TdxReportCellDataClass; override; + function GetLineHeight: Integer; override; + public + property Item: TdxReportCellBox read GetItem; + end; + + TdxGridViewDetailsTopSeparatorProducer = class(TdxGridViewDetailsSeparatorProducer) + protected + procedure InitializeDetailsSeparator(AFormatter: TdxCustomGridViewFormatter; + ASeparator: TdxReportCellBox; ASeparatorKind: TdxVerticalDetailsSeparatorKind); override; + end; + + TdxGridViewDetailsBottomSeparatorProducer = class(TdxGridViewDetailsSeparatorProducer) + protected + procedure InitializeDetailsSeparator(AFormatter: TdxCustomGridViewFormatter; + ASeparator: TdxReportCellBox; ASeparatorKind: TdxVerticalDetailsSeparatorKind); override; + end; + + TdxGridViewTerminatorProducer = class(TdxGridViewDetailsSeparatorProducer) + protected + procedure InitializeItem; override; + function GetLineHeight: Integer; override; + end; + + TdxGridTableViewRowProducer = class(TdxGridViewRowProducer) + public + function Adapter: TdxGridTableViewAdapter; reintroduce; overload; + function Builder: TdxGridTableViewBuilder; reintroduce; overload; + function Formatter: TdxGridTableViewFormatter; reintroduce; overload; + end; + + TdxGridTableViewRowSubItemsProducer = class(TdxGridTableViewRowProducer) + private + FIndents: TList; + FSubItems: TList; + function GetColumn(Index: Integer): TcxGridColumn; + function GetIndent(Index: Integer): TdxReportCellExpandButton; + function GetSubItem(Index: Integer): TdxReportVisualItem; + protected + procedure AddIndents(AParent: TdxReportCell); virtual; + procedure AddSubItems(AParent: TdxReportCell); virtual; + procedure CreateRow; override; + function CreateSubItem(AnIndex: Integer; AParent: TdxReportCell): TAbstractdxReportCellData; + function IsItemIndent(AnItem: TdxReportVisualItem): Boolean; + + procedure FixupIndentsHeight; virtual; + procedure FixupRowDataHeight; override; + procedure FixupRowHeight; override; + + procedure InitializeIndentList; virtual; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); virtual; + procedure InitializeSubItemList; virtual; + + function GetHasSubItem(Index: Integer): Boolean; virtual; + function GetIndentCount: Integer; virtual; + function GetSubItemBound(Index: Integer): TRect; virtual; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; virtual; abstract; + function GetSubItemCount: Integer; virtual; + public + constructor Create(ABuilder: TdxCustomGridViewBuilder); override; + destructor Destroy; override; + + function Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; override; + + property Columns[Index: Integer]: TcxGridColumn read GetColumn; + property HasSubItem[Index: Integer]: Boolean read GetHasSubItem; + property IndentCount: Integer read GetIndentCount; + property Indents[Index: Integer]: TdxReportCellExpandButton read GetIndent; + property SubItemBounds[Index: Integer]: TRect read GetSubItemBound; + property SubItemClasses[Index: Integer]: TdxReportCellDataClass read GetSubItemClass; + property SubItemCount: Integer read GetSubItemCount; + property SubItems[Index: Integer]: TdxReportVisualItem read GetSubItem; default; + end; + + TdxGridTableViewHeadersProducer = class(TdxGridTableViewRowSubItemsProducer) + protected + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + end; + + TdxGridTableViewFootersProducer = class(TdxGridTableViewRowSubItemsProducer) + protected + procedure CalculateRowAutoHeight; override; + procedure CalculateRowHeight; override; + procedure FixupRowDataItemHeight(AnItem: TdxReportVisualItem); override; + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetHasSubItem(Index: Integer): Boolean; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + end; + + TdxGridTableViewCustomDataRowProducer = class(TdxGridTableViewRowSubItemsProducer) + private + FGridRow: TcxCustomGridRow; + FGridRowIndex: Integer; + function GetIndentArea: Integer; + function GetIndentBounds(Index: Integer): TRect; + protected + procedure AddIndents(AParent: TdxReportCell); override; + function CreateIndent(AnIndex: Integer; AParent: TdxReportCell): TdxReportCellExpandButton; virtual; + procedure InitializeIndent(AIndent: TdxReportCellExpandButton; AIndex: Integer); virtual; + + function GetIndentCount: Integer; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + public + function GridRow: TcxCustomGridRow; overload; virtual; + function Produce(AHostInfo: TdxGridAttributeHostInfo; + AGridRow: TcxCustomGridRow; AGridRowIndex: Integer): TdxReportCell; reintroduce; virtual; + + property GridRowIndex: Integer read FGridRowIndex; + property IndentArea: Integer read GetIndentArea; + property IndentBounds[Index: Integer]: TRect read GetIndentBounds; + end; + + TdxCustomGridTableViewRowSeparatorProducer = class(TdxGridTableViewCustomDataRowProducer) + protected + procedure InitializeIndent(AIndent: TdxReportCellExpandButton; AIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetSubItemCount: Integer; override; + function GetSubItemBound(Index: Integer): TRect; override; + public + function Produce(AHostInfo: TdxGridAttributeHostInfo; + AGridRow: TcxCustomGridRow): TdxReportCell; reintroduce; virtual; + end; + + TdxGridTableViewRowSeparatorProducer = class(TdxCustomGridTableViewRowSeparatorProducer) + private + FIsLast: Boolean; + protected + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetIndentCount: Integer; override; + function GetLineHeight: Integer; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + public + function Produce(AHostInfo: TdxGridAttributeHostInfo; AGridRow: TcxCustomGridRow; + AnIsLast: Boolean): TdxReportCell; reintroduce; virtual; + property IsLast: Boolean read FIsLast; + end; + + TdxGridTableViewGroupRowSeparatorProducer = class(TdxCustomGridTableViewRowSeparatorProducer) + protected + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + function GetLineHeight: Integer; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + end; + + TdxGridTableViewDataRowProducer = class(TdxGridTableViewCustomDataRowProducer) + private + FPreviewItem: TdxReportVisualItem;//TAbstractdxReportCellData; + function GetPreviewColumn: TcxGridColumn; + function GetPreviewPlace: TcxGridPreviewPlace; + protected + procedure AddPreview(AParent: TdxReportCell); virtual; + procedure AddSubItems(AParent: TdxReportCell); override; + procedure CalculateRowAutoHeight; override; + function DoesItemParticipateInRowAutoHeightCalculation(AnItem: TdxReportVisualItem): Boolean; override; + function CreatePreview(AParent: TdxReportCell): TdxReportVisualItem; virtual; + function GetPreviewClass: TdxReportCellDataClass; virtual; + procedure FixupRowDataHeight; override; + procedure InitializeIndent(AIndent: TdxReportCellExpandButton; AIndex: Integer); override; + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetCellAutoHeight: Boolean; virtual; + function GetHasPreview: Boolean; virtual; + function GetIndentCount: Integer; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + function GetPreviewHeight: Integer; virtual; + function GetPreviewLineCount: Integer; virtual; + function GetPreviewLineHeight: Integer; virtual; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + public + function GridRow: TcxGridDataRow; reintroduce; overload; + + property CellAutoHeight: Boolean read GetCellAutoHeight; + property HasPreview: Boolean read GetHasPreview; + property PreviewColumn: TcxGridColumn read GetPreviewColumn; + property PreviewHeight: Integer read GetPreviewHeight; + property PreviewItem: TdxReportVisualItem read FPreviewItem;//TAbstractdxReportCellData read FPreviewItem; + property PreviewLineCount: Integer read GetPreviewLineCount; + property PreviewLineHeight: Integer read GetPreviewLineHeight; + property PreviewPlace: TcxGridPreviewPlace read GetPreviewPlace; + end; + + TdxGridTableViewGroupRowProducer = class(TdxGridTableViewCustomDataRowProducer) + protected + procedure InitializeRow; override; + procedure InitializeIndent(AIndent: TdxReportCellExpandButton; AIndex: Integer); override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetIndentCount: Integer; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + function GetSubItemCount: Integer; override; + public + function GridRow: TcxGridGroupRow; reintroduce; overload; + end; + + TdxGridTableViewMasterRowProducer = class(TdxGridTableViewDataRowProducer) + protected + procedure InitializeIndent(AIndent: TdxReportCellExpandButton; AIndex: Integer); override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetIndentCount: Integer; override; + public + function GridRow: TcxGridMasterDataRow; reintroduce; overload; + end; + + TdxGridTableViewGroupFooterProducer = class(TdxGridTableViewCustomDataRowProducer) + private + FGroupLevel: Integer; + FIndex: Integer; + FItemsSite: TdxReportCell; + function GetGroupLevel: Integer; + function GetHostBounds: TRect; + protected + procedure AddSubItems(AParent: TdxReportCell); override; + procedure CalculateRowAutoHeight; override; + procedure FixupRowDataItemHeight(AnItem: TdxReportVisualItem); override; + procedure InitializeIndent(AIndent: TdxReportCellExpandButton; AIndex: Integer); override; + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetHasSubItem(Index: Integer): Boolean; override; + function GetIndentCount: Integer; override; + function GetItemsSite: TdxReportCell; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + public + function Produce(AHostInfo: TdxGridAttributeHostInfo; AGridRow: TcxCustomGridRow; + AGroupLevel, AnIndex: Integer): TdxReportCell; reintroduce; virtual; + + property GroupLevel: Integer read GetGroupLevel; + property HostBounds: TRect read GetHostBounds; + property Index: Integer read FIndex; + end; + + TdxGridTableViewBandsProducer = class(TdxGridTableViewRowSubItemsProducer) + protected + procedure CalculateRowHeight; override; + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + function GetSubItemCount: Integer; override; + public + function Adapter: TdxGridBandedTableViewAdapter; reintroduce; overload; + function Builder: TdxGridBandedTableViewBuilder; reintroduce; overload; + function Formatter: TdxGridBandedTableViewFormatter; reintroduce; overload; + end; + + TdxGridCardViewCardsRowProducer = class(TdxGridViewRowProducer) + protected + procedure CalculateRowHeight; override; + function GetAutoHeight: Boolean; override; + procedure InitializeRow; override; + public + function Adapter: TdxGridCardViewAdapter; reintroduce; overload; + function Builder: TdxGridCardViewBuilder; reintroduce; overload; + function Formatter: TdxGridCardViewFormatter; reintroduce; overload; + + function CreateCard(AParent: TdxReportCell; AGridCard: TcxGridCard): TdxReportCard; virtual; + procedure InjectCard(ACard: TdxReportCard; AIndex: Integer); virtual; + function Produce(AHostInfo: TdxGridAttributeHostInfo; + ARowHeight: Integer): TdxReportCell; reintroduce; virtual; + end; + +{$IFDEF CHARTVIEW} + TdxGridChartViewChartProducer = class(TdxGridViewCustomRowProducer) + private + FChartImage: TGraphic; + function GetChartImage: TGraphic; + function GetItem: TdxReportCellGraphic; + protected + procedure CalculateRowHeight; override; + function GetItemClass: TdxReportCellDataClass; override; + procedure InitializeItem; override; + + property ChartImage: TGraphic read GetChartImage; + property Item: TdxReportCellGraphic read GetItem; + public + function Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; override; + function Formatter: TdxGridChartViewFormatter; reintroduce; overload; + end; +{$ENDIF} + + { Options } + + TdxGridReportLinkOptionsClass = class of TdxGridReportLinkOptions; + + TdxGridReportLinkOptions = class(TdxCustomReportLinkOptions) + private + function GetReportLink: TdxGridReportLink; + public + property ReportLink: TdxGridReportLink read GetReportLink; + end; + + TdxGridReportLinkOptionsCards = class; + + TdxGridReportLinkCardsShadowClass = class of TdxGridReportLinkCardsShadow; + + TdxGridReportLinkCardsShadow = class(TPersistent) + private + FColor: TColor; + FDepth: TdxGridCardShadowDepth; + FOptionsCards: TdxGridReportLinkOptionsCards; + FPosition: TdxGridCardShadowPosition; + function GetActualColor: TColor; + function GetVisible: Boolean; + procedure SetColor(Value: TColor); + procedure SetDepth(Value: TdxGridCardShadowDepth); + procedure SetPosition(Value: TdxGridCardShadowPosition); + protected + procedure Changed; dynamic; + public + constructor Create(AnOptionsCards: TdxGridReportLinkOptionsCards); virtual; + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; virtual; + + property ActualColor: TColor read GetActualColor; + property OptionsCards: TdxGridReportLinkOptionsCards read FOptionsCards; + property Visible: Boolean read GetVisible; + published + property Color: TColor read FColor write SetColor default clDefault; + property Depth: TdxGridCardShadowDepth read FDepth write SetDepth default dxDefaultCardsShadowDepth; + property Position: TdxGridCardShadowPosition read FPosition write SetPosition default cspBottomRight; + end; + + TdxGridReportLinkOptionsCardsClass = class of TdxGridReportLinkOptionsCards; + + TdxGridReportLinkOptionsCards = class(TdxGridReportLinkOptions) + private + FAutoWidth: Boolean; + FBorders: Boolean; + FInterCardsSpaceHorz: Integer; + FInterCardsSpaceVert: Integer; + FKeepSameHeight: Boolean; + FKeepSameWidth: Boolean; + FRowBordersHorz: Boolean; + FRowBordersVert: Boolean; + FShadow: TdxGridReportLinkCardsShadow; + function GetShadow: TdxGridReportLinkCardsShadow; + procedure SetAutoWidth(Value: Boolean); + procedure SetBorders(Value: Boolean); + procedure SetInterCardsSpaceHorz(Value: Integer); + procedure SetInterCardsSpaceVert(Value: Integer); + procedure SetKeepSameHeight(Value: Boolean); + procedure SetKeepSameWidth(Value: Boolean); + procedure SetRowBordersHorz(Value: Boolean); + procedure SetRowBordersVert(Value: Boolean); + procedure SetShadow(Value: TdxGridReportLinkCardsShadow); + protected + function DesignerTabIndex: Integer; override; + function GetShadowClass: TdxGridReportLinkCardsShadowClass; virtual; + public + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property AutoWidth: Boolean read FAutoWidth write SetAutoWidth default False; + property Borders: Boolean read FBorders write SetBorders default True; + property InterCardsSpaceHorz: Integer read FInterCardsSpaceHorz write SetInterCardsSpaceHorz default 4; + property InterCardsSpaceVert: Integer read FInterCardsSpaceVert write SetInterCardsSpaceVert default 4; + property KeepSameHeight: Boolean read FKeepSameHeight write SetKeepSameHeight default True; + property KeepSameWidth: Boolean read FKeepSameWidth write SetKeepSameWidth default True; + property RowBordersHorz: Boolean read FRowBordersHorz write SetRowBordersHorz default False; + property RowBordersVert: Boolean read FRowBordersVert write SetRowBordersVert default False; + property Shadow: TdxGridReportLinkCardsShadow read GetShadow write SetShadow; + end; + +{$IFDEF CHARTVIEW} + TdxGridReportLinkOptionsChartsClass = class of TdxGridReportLinkOptionsCharts; + + TdxGridReportLinkOptionsCharts = class(TdxGridReportLinkOptions) + private + FGraphicClass: TGraphicClass; + FIsGraphicClassAssigned: Boolean; + FTransparent: Boolean; + function GetGraphicClass: TGraphicClass; + function GetGraphicClassName: string; + function IsGraphicClassNameStored: Boolean; + procedure SetGraphicClass(Value: TGraphicClass); + procedure SetGraphicClassName(const Value: string); + procedure SetTransparent(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + function DefaultGraphicClass: TGraphicClass; virtual; //TBitmap + function SupportsGraphicClass(AGraphicClass: TGraphicClass): Boolean; virtual; //excluding TIcon + + property GraphicClass: TGraphicClass read GetGraphicClass write SetGraphicClass; + published + property GraphicClassName: string read GetGraphicClassName write SetGraphicClassName stored IsGraphicClassNameStored; + property Transparent: Boolean read FTransparent write SetTransparent default False; + end; +{$ENDIF} + + TdxGridReportLinkOptionsDetailsClass = class of TdxGridReportLinkOptionsDetails; + + TdxGridReportLinkOptionsDetails = class(TdxGridReportLinkOptions) + private + FOnlyFocusedView: Boolean; + FStartFromFocusedView: Boolean; + procedure SetOnlyFocusedView(Value: Boolean); + procedure SetStartFromFocusedView(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property OnlyFocusedView: Boolean read FOnlyFocusedView write SetOnlyFocusedView default False; + property StartFromFocusedView: Boolean read FStartFromFocusedView write SetStartFromFocusedView default False; + end; + + TdxGridReportLinkOptionsExpanding = class(TdxCustomReportLinkOptionsExpanding) + private + {$IFDEF DXVER500} + FExpandCards: Boolean; + {$ENDIF} + FExpandGroupRows: Boolean; + FExpandMasterRows: Boolean; + function GetHasAny: Boolean; + function GetReportLink: TdxGridReportLink; + {$IFDEF DXVER500} + procedure SetExpandCards(Value: Boolean); + {$ENDIF} + procedure SetExpandGroupRows(Value: Boolean); + procedure SetExpandMasterRows(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + + property HasAny: Boolean read GetHasAny; + property ReportLink: TdxGridReportLink read GetReportLink; + published + {$IFDEF DXVER500} + property ExpandCards: Boolean read FExpandCards write SetExpandCards default False; + {$ENDIF} + property ExpandGroupRows: Boolean read FExpandGroupRows write SetExpandGroupRows default False; + property ExpandMasterRows: Boolean read FExpandMasterRows write SetExpandMasterRows default False; + end; + + TdxGridReportLinkOptionsFormatting = class(TdxCustomReportLinkOptionsFormatting) + private + FConsumeSelectionStyle: Boolean; + function GetReportLink: TdxGridReportLink; + procedure SetConsumeSelectionStyle(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + property ReportLink: TdxGridReportLink read GetReportLink; + published + property ConsumeSelectionStyle: Boolean read FConsumeSelectionStyle write SetConsumeSelectionStyle default False; + property UseLookAndFeelColors; + end; + + TdxGridReportLinkOptionsLevelsClass = class of TdxGridReportLinkOptionsLevels; + + TdxGridReportLinkOptionsLevels = class(TdxGridReportLinkOptions) + private + FRiseActiveLevelOntoTop: Boolean; + FUnwrap: Boolean; + FUnwrapTopLevel: Boolean; + procedure SetRiseActiveLevelOntoTop(Value: Boolean); + procedure SetUnwrap(Value: Boolean); + procedure SetUnwrapTopLevel(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property RiseActiveLevelOntoTop: Boolean read FRiseActiveLevelOntoTop write SetRiseActiveLevelOntoTop default True; + property Unwrap: Boolean read FUnwrap write SetUnwrap default False; + property UnwrapTopLevel: Boolean read FUnwrapTopLevel write SetUnwrapTopLevel default True; + end; + + TdxGridReportLinkOptionsOnEveryPage = class(TdxCustomTableControlReportLinkOptionsOnEveryPage) + private + FCaption: Boolean; + FFilterBar: Boolean; + function GetReportLink: TdxGridReportLink; + procedure SetCaption(Value: Boolean); + procedure SetFilterBar(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + + function HasInstalledAttribute(AnAttribute: TdxGridAttributeClass): Boolean; virtual; + procedure SetAll; virtual; + procedure UnsetAll; virtual; + + property ReportLink: TdxGridReportLink read GetReportLink; + published + property BandHeaders; + property Caption: Boolean read FCaption write SetCaption default True; + property FilterBar: Boolean read FFilterBar write SetFilterBar default True; + property Footers; + property Headers; + end; + + TdxGridReportLinkOptionsPagination = class(TdxCustomTableControlReportLinkOptionsPagination) + private + FOneGroupPerPage: Boolean; + FTopLevelGroup: Boolean; + function GetReportLink: TdxGridReportLink; + procedure SetOneGroupPerPage(Value: Boolean); + procedure SetTopLevelGroup(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + property ReportLink: TdxGridReportLink read GetReportLink; + published + property Band; + property Column; + property Custom; + property OneGroupPerPage: Boolean read FOneGroupPerPage write SetOneGroupPerPage default False; + property Row; + property TopLevelGroup: Boolean read FTopLevelGroup write SetTopLevelGroup default False; + end; + + TdxGridReportLinkOptionsPreview = class(TdxCustomTableControlReportLinkOptionsPreview) + private + function GetReportLink: TdxGridReportLink; + protected + function DesignerTabIndex: Integer; override; + public + property ReportLink: TdxGridReportLink read GetReportLink; + end; + + TdxGridReportLinkOptionsRefinements = class(TdxCustomReportLinkOptionsRefinements) + private + function GetReportLink: TdxGridReportLink; + protected + function DesignerTabIndex: Integer; override; + public + property ReportLink: TdxGridReportLink read GetReportLink; + end; + + TdxGridReportLinkOptionsSelection = class(TdxCustomTableControlReportLinkOptionsSelection) + private + function GetReportLink: TdxGridReportLink; + protected + function DesignerTabIndex: Integer; override; + public + property ReportLink: TdxGridReportLink read GetReportLink; + end; + + TdxGridReportLinkOptionsSize = class(TdxCustomReportLinkOptionsSize) + private + function GetReportLink: TdxGridReportLink; + protected + function DesignerTabIndex: Integer; override; + public + property ReportLink: TdxGridReportLink read GetReportLink; + published + property AutoWidth; + end; + + TdxGridReportLinkOptionsView = class(TdxCustomTableControlReportLinkOptionsView) + private + FCaption: Boolean; + FFilterBar: Boolean; + FGroupFooters: Boolean; + function GetReportLink: TdxGridReportLink; + procedure SetCaption(Value: Boolean); + procedure SetFilterBar(Value: Boolean); + procedure SetGroupFooters(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + + function HasInstalledAttribute(AnAttribute: TdxGridAttributeClass): Boolean; virtual; + procedure SetAll; + procedure UnsetAll; + + property ReportLink: TdxGridReportLink read GetReportLink; + published + property BandHeaders; + property Caption: Boolean read FCaption write SetCaption default True; + property ExpandButtons; + property FilterBar: Boolean read FFilterBar write SetFilterBar default True; + property Footers; + property GroupFooters: Boolean read FGroupFooters write SetGroupFooters default True; + property Headers; + end; + + TdxGridAttributeHostInfo = class + private + FParent: TdxReportCell; + public + Origin: TPoint; + procedure Initialize(AParent: TdxReportCell); + property Parent: TdxReportCell read FParent; + end; + + TdxGridAttributeHostInfoServicesClass = class of TdxGridAttributeHostInfoServices; + + TdxGridAttributeHostInfoServices = class + private + FPageDetailsHostInfo: TdxGridAttributeHostInfo; + FPageFootersHostInfo: TdxGridAttributeHostInfo; + FPageHeadersHostInfo: TdxGridAttributeHostInfo; + FReportLink: TdxGridReportLink; + function GetActiveView: TcxCustomGridView; + function GetActiveViewHelper: TdxCustomGridViewHelperClass; + function GetArePageFootersAssigned: Boolean; + function GetArePageHeadersAssigned: Boolean; + function GetCanUseBandHeadersOnEveyPage: Boolean; + function GetCanUseCaptionOnEveryPage: Boolean; + function GetCanUseFilterBarOnEveryPage: Boolean; + function GetCanUseFootersOnEveryPage: Boolean; + function GetCanUseHeadersOnEveryPage: Boolean; + function GetIsInconsistentBandHeadersState: Boolean; + function GetIsInconsistentFilterBarState: Boolean; + function GetIsInconsistentFootersState: Boolean; + function GetIsInconsistentHeadersState: Boolean; + function GetLevelSeparatorBottomHostInfo: TdxGridAttributeHostInfo; + function GetLevelSeparatorTopHostInfo: TdxGridAttributeHostInfo; + function GetOptionsOnEveryPage: TdxGridReportLinkOptionsOnEveryPage; + function GetOptionsView: TdxGridReportLinkOptionsView; + function GetPageDetails: TdxReportCell; + function GetPageFooters: TdxReportCell; + function GetPageHeaders: TdxReportCell; + protected + procedure CreateHostInfos; + procedure DestroyHostInfos; + + function GetBandHeadersHostInfo: TdxGridAttributeHostInfo; virtual; + function GetCaptionHostInfo: TdxGridAttributeHostInfo; virtual; + function GetFilterBarHostInfo: TdxGridAttributeHostInfo; virtual; + function GetFootersHostInfo: TdxGridAttributeHostInfo; virtual; + function GetHeadersHostInfo: TdxGridAttributeHostInfo; virtual; + function GetInconsistentStateText: string; virtual; + function GetIsInconsistentState: Boolean; virtual; + function HasCells: Boolean; + function IsAttributeSupported(AnAttribute: TdxGridAttributeClass): Boolean; + + //function HasAttributeOnEveryPage: Boolean; + + property ActiveView: TcxCustomGridView read GetActiveView; + property ActiveViewHelper: TdxCustomGridViewHelperClass read GetActiveViewHelper; + property OptionsOnEveryPage: TdxGridReportLinkOptionsOnEveryPage read GetOptionsOnEveryPage; + property OptionsView: TdxGridReportLinkOptionsView read GetOptionsView; + property PageDetails: TdxReportCell read GetPageDetails; + property PageFooters: TdxReportCell read GetPageFooters; + property PageHeaders: TdxReportCell read GetPageHeaders; + public + constructor Create(AReportLink: TdxGridReportLink); virtual; + destructor Destroy; override; + procedure Initialize; + + property ArePageFootersAssigned: Boolean read GetArePageFootersAssigned; + property ArePageHeadersAssigned: Boolean read GetArePageHeadersAssigned; + property BandHeadersHostInfo: TdxGridAttributeHostInfo read GetBandHeadersHostInfo; + property CanUseBandHeadersOnEveyPage: Boolean read GetCanUseBandHeadersOnEveyPage; + property CanUseCaptionOnEveryPage: Boolean read GetCanUseCaptionOnEveryPage; + property CanUseFilterBarOnEveryPage: Boolean read GetCanUseFilterBarOnEveryPage; + property CanUseFootersOnEveryPage: Boolean read GetCanUseFootersOnEveryPage; + property CanUseHeadersOnEveryPage: Boolean read GetCanUseHeadersOnEveryPage; + property CaptionHostInfo: TdxGridAttributeHostInfo read GetCaptionHostInfo; + property FilterBarHostInfo: TdxGridAttributeHostInfo read GetFilterBarHostInfo; + property FootersHostInfo: TdxGridAttributeHostInfo read GetFootersHostInfo; + property HeadersHostInfo: TdxGridAttributeHostInfo read GetHeadersHostInfo; + property InconsistentStateText: string read GetInconsistentStateText; + property IsInconsistentBandHeadersState: Boolean read GetIsInconsistentBandHeadersState; + property IsInconsistentFilterBarState: Boolean read GetIsInconsistentFilterBarState; + property IsInconsistentFootersState: Boolean read GetIsInconsistentFootersState; + property IsInconsistentHeadersState: Boolean read GetIsInconsistentHeadersState; + property IsInconsistentState: Boolean read GetIsInconsistentState; + property LevelSeparatorBottomHostInfo: TdxGridAttributeHostInfo read GetLevelSeparatorBottomHostInfo; + property LevelSeparatorTopHostInfo: TdxGridAttributeHostInfo read GetLevelSeparatorTopHostInfo; + property PageDetailsHostInfo: TdxGridAttributeHostInfo read FPageDetailsHostInfo; + property PageFootersHostInfo: TdxGridAttributeHostInfo read FPageFootersHostInfo; + property PageHeadersHostInfo: TdxGridAttributeHostInfo read FPageHeadersHostInfo; + property ReportLink: TdxGridReportLink read FReportLink; + end; + + TdxGridReportLinkStylesClass = class of TdxGridReportLinkStyles; + + TdxGridReportLinkStyles = class(TdxCustomReportLinkStyles) + private + function GetReportLink: TdxGridReportLink; + protected + function DesignerTabIndex: Integer; override; + + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + class function GetStyleCaption(AnIndex: Integer): string; override; + function GetStyleIndexByCaption(const Caption: string): Integer; override; + + function IsCardViewStyle(AStyle: TcxStyle): Boolean; + public + procedure Assign(Source: TPersistent); override; + + procedure GetBandHeaderParams(ABand: TcxGridBand; out AParams: TcxViewParams); virtual; + procedure GetCaptionParams(ATabLevel: TcxGridLevel; out AParams: TcxViewParams); virtual; + procedure GetCardCaptionRowParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); virtual; + procedure GetCardRowCaptionParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); virtual; + procedure GetContentParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); virtual; + procedure GetFilterBarParams(out AParams: TcxViewParams); virtual; + procedure GetFooterParams(ARecord: TcxCustomGridRecord; AGroupLevel: Integer; + AItem: TcxGridColumn; out AParams: TcxViewParams); virtual; + procedure GetGroupParams(ARecord: TcxCustomGridRecord; AGroupLevel: Integer; + out AParams: TcxViewParams); virtual; + procedure GetHeaderParams(AItem: TcxGridColumn; out AParams: TcxViewParams); virtual; + procedure GetPreviewParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); virtual; + procedure GetSelectionParams(out AParams: TcxViewParams); virtual; + + property ReportLink: TdxGridReportLink read GetReportLink; + published + property BandHeader: TcxStyle Index vspsGridBandHeader read GetValue write SetValue; + property Caption: TcxStyle Index vspsGridCaption read GetValue write SetValue; + property CardCaptionRow: TcxStyle Index vspsGridCardCaptionRow read GetValue write SetValue; + property CardRowCaption: TcxStyle Index vspsGridCardRowCaption read GetValue write SetValue; + property Content: TcxStyle Index vspsGridContent read GetValue write SetValue; + property ContentEven: TcxStyle Index vspsGridContentEven read GetValue write SetValue; + property ContentOdd: TcxStyle Index vspsGridContentOdd read GetValue write SetValue; + property FilterBar: TcxStyle Index vspsGridFilterBar read GetValue write SetValue; + property Footer: TcxStyle Index vspsGridFooter read GetValue write SetValue; + property Group: TcxStyle Index vspsGridGroup read GetValue write SetValue; + property Header: TcxStyle Index vspsGridHeader read GetValue write SetValue; + property Preview: TcxStyle Index vspsGridPreview read GetValue write SetValue; + property Selection: TcxStyle Index vspsGridSelection read GetValue write SetValue; + property StyleSheet; + end; + + TdxGridReportLinkStyleSheet = class(TdxCustomReportLinkStyleSheet) + private + function GetStylesValue: TdxGridReportLinkStyles; + procedure SetStylesValue(Value: TdxGridReportLinkStyles); + public + class function GetStylesClass: TcxCustomStylesClass; override; + published + property Styles: TdxGridReportLinkStyles read GetStylesValue write SetStylesValue; + end; + + TdxGridReportLinkProcessParams = record + HasMasterDetails: Boolean; + HasMasterDetailsInTopView: Boolean; + HasOnlyCards: Boolean; + HasOnlyCharts: Boolean; + HasUnwrapableData: Boolean; + CanUseOnEveryPageMode: Boolean; + end; + + TdxGridRecordArray = array of TcxCustomGridRecord; + + TdxGridViewProc = procedure(AGridView: TcxCustomGridView) of object; + + TdxGridGetCustomPageBreaksEvent = procedure(Sender: TdxGridReportLink) of object; + + TdxGridReportLinkGetCellHeightEvent = procedure(Sender: TdxGridReportLink; + AView: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem; var AHeight: Integer) of object; + + { CustomDraw Events } + + TdxGridReportLinkCustomDrawBandCellEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxGridBandedTableView; ABand: TcxGridBand; + AnItem: TdxReportCellString; var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawCellEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; AnItem: TAbstractdxReportCellData; var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawCardRowCaptionCellEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxGridCardView; ACard: TcxGridCard; ARow: TcxGridCardViewRow; + AnItem: TdxReportCellString; var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawCardRowDataCellEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxGridCardView; ACard: TcxGridCard; ARow: TcxGridCardViewRow; + AnItem: TAbstractdxReportCellData; var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawFilterBarEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxCustomGridTableView; AnItem: TdxReportCellString; + var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawFooterCellEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; ALevel: Integer; AnItem: TdxReportCellString; + var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawHeaderCellEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxGridTableView; AColumn: TcxGridColumn; + AnItem: TdxReportCellString; var ADone: Boolean) of object; + + TdxGridReportLinkCustomDrawLevelCaptionEvent = procedure(Sender: TdxGridReportLink; + ACanvas: TCanvas; AView: TcxCustomGridView; AnItem: TdxReportCellString; + var ADone: Boolean) of object; + + { Initializtion Events } + + TdxGridReportLinkInitializeBandCellEvent = procedure(Sender: TdxGridReportLink; + AView: TcxGridBandedTableView; ABand: TcxGridBand; AnItem: TdxReportCellString) of object; + + TdxGridReportLinkInitializeCellEvent = procedure(Sender: TdxGridReportLink; + AView: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; AnItem: TAbstractdxReportCellData) of object; + + TdxGridReportLinkInitializeCardRowCaptionCellEvent = procedure(Sender: TdxGridReportLink; + AView: TcxGridCardView; ACard: TcxGridCard; ARow: TcxGridCardViewRow; + AnItem: TdxReportCellString) of object; + + TdxGridReportLinkInitializeCardRowDataCellEvent = procedure(Sender: TdxGridReportLink; + AView: TcxGridCardView; ACard: TcxGridCard; ARow: TcxGridCardViewRow; + AnItem: TAbstractdxReportCellData) of object; + +{$IFDEF CHARTVIEW} + TdxGridReportLinkInitializeChartCellEvent = procedure(Sender: TdxGridReportLink; + AView: TcxGridChartView; AnItem: TdxReportCellGraphic) of object; +{$ENDIF} + + TdxGridReportLinkInitializeFilterBarEvent = procedure(Sender: TdxGridReportLink; + AView: TcxCustomGridTableView; AnItem: TdxReportCellString) of object; + + TdxGridReportLinkInitializeFooterCellEvent = procedure(Sender: TdxGridReportLink; + AView: TcxGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; ALevel: Integer; AnItem: TdxReportCellString) of object; + + TdxGridReportLinkInitializeHeaderCellEvent = procedure(Sender: TdxGridReportLink; + AView: TcxGridTableView; AColumn: TcxGridColumn; AnItem: TdxReportCellString) of object; + + TdxGridReportLinkInitializeLevelCaptionEvent = procedure(Sender: TdxGridReportLink; + AView: TcxCustomGridView; AnItem: TdxReportCellString) of object; + + { ReportLink } + + TdxGridReportLink = class(TdxCustomTableControlReportLink) + private + FDelimitersHardVert: TList; + FHostInfoServices: TdxGridAttributeHostInfoServices; + FOptionsCards: TdxGridReportLinkOptionsCards; +{$IFDEF CHARTVIEW} + FOptionsCharts: TdxGridReportLinkOptionsCharts; +{$ENDIF} + FOptionsDetails: TdxGridReportLinkOptionsDetails; + FOptionsLevels: TdxGridReportLinkOptionsLevels; + FProcessedView: TcxCustomGridView; + FProcessParams: TdxGridReportLinkProcessParams; + FReportRows: TList; + FOnCustomDrawBandCell: TdxGridReportLinkCustomDrawBandCellEvent; + FOnCustomDrawCardRowCaptionCell: TdxGridReportLinkCustomDrawCardRowCaptionCellEvent; + FOnCustomDrawCardRowDataCell: TdxGridReportLinkCustomDrawCardRowDataCellEvent; + FOnCustomDrawCell: TdxGridReportLinkCustomDrawCellEvent; + FOnCustomDrawFilterBar: TdxGridReportLinkCustomDrawFilterBarEvent; + FOnCustomDrawFooterCell: TdxGridReportLinkCustomDrawFooterCellEvent; + FOnCustomDrawHeaderCell: TdxGridReportLinkCustomDrawHeaderCellEvent; + FOnCustomDrawLevelCaption: TdxGridReportLinkCustomDrawLevelCaptionEvent; + FOnGetCellHeight: TdxGridReportLinkGetCellHeightEvent; + FOnGetCustomPageBreaks: TdxGridGetCustomPageBreaksEvent; + FOnInitializeBandCell: TdxGridReportLinkInitializeBandCellEvent; + FOnInitializeCardRowCaptionCell: TdxGridReportLinkInitializeCardRowCaptionCellEvent; + FOnInitializeCardRowDataCell: TdxGridReportLinkInitializeCardRowDataCellEvent; + FOnInitializeCell: TdxGridReportLinkInitializeCellEvent; +{$IFDEF CHARTVIEW} + FOnInitializeChartCell: TdxGridReportLinkInitializeChartCellEvent; +{$ENDIF} + FOnInitializeFilterBar: TdxGridReportLinkInitializeFilterBarEvent; + FOnInitializeFooterCell: TdxGridReportLinkInitializeFooterCellEvent; + FOnInitializeHeaderCell: TdxGridReportLinkInitializeHeaderCellEvent; + FOnInitializeLevelCaption: TdxGridReportLinkInitializeLevelCaptionEvent; + function GetActiveStyles: TdxGridReportLinkStyles; + function GetActiveView: TcxCustomGridView; + function GetActiveViewHelper: TdxCustomGridViewHelperClass; + function GetActiveViewMasterRow: TcxGridMasterDataRow; + function GetActiveViewParentLevel: TcxGridLevel; + function GetDesignWindow: TdxfmGridReportLinkDesignWindow; + function GetGrid: TcxGrid; + function GetOptionsExpanding: TdxGridReportLinkOptionsExpanding; + function GetOptionsFormatting: TdxGridReportLinkOptionsFormatting; + function GetOptionsOnEveryPage: TdxGridReportLinkOptionsOnEveryPage; + function GetOptionsPagination: TdxGridReportLinkOptionsPagination; + function GetOptionsPreview: TdxGridReportLinkOptionsPreview; + function GetOptionsRefinements: TdxGridReportLinkOptionsRefinements; + function GetOptionsSelection: TdxGridReportLinkOptionsSelection; + function GetOptionsSize: TdxGridReportLinkOptionsSize; + function GetOptionsView: TdxGridReportLinkOptionsView; + function GetReportRow(Index: Integer): TdxReportCell; + function GetReportRowByGridRecord(GridRecord: TcxCustomGridRecord): TdxReportCell; + function GetReportRowCount: Integer; + function GetStyles: TdxGridReportLinkStyles; + procedure SetOnCustomDrawBandCell(Value: TdxGridReportLinkCustomDrawBandCellEvent); + procedure SetOnCustomDrawCell(Value: TdxGridReportLinkCustomDrawCellEvent); + procedure SetOnCustomDrawCardRowCaptionCell(Value: TdxGridReportLinkCustomDrawCardRowCaptionCellEvent); + procedure SetOnCustomDrawCardRowDataCell(Value: TdxGridReportLinkCustomDrawCardRowDataCellEvent); + procedure SetOnCustomDrawFilterBar(Value: TdxGridReportLinkCustomDrawFilterBarEvent); + procedure SetOnCustomDrawFooterCell(Value: TdxGridReportLinkCustomDrawFooterCellEvent); + procedure SetOnCustomDrawHeaderCell(Value: TdxGridReportLinkCustomDrawHeaderCellEvent); + procedure SetOnCustomDrawLevelCaption(Value: TdxGridReportLinkCustomDrawLevelCaptionEvent); + procedure SetOptionsCards(Value: TdxGridReportLinkOptionsCards); +{$IFDEF CHARTVIEW} + procedure SetOptionsCharts(Value: TdxGridReportLinkOptionsCharts); +{$ENDIF} + procedure SetOptionsDetails(Value: TdxGridReportLinkOptionsDetails); + procedure SetOptionsExpanding(Value: TdxGridReportLinkOptionsExpanding); + procedure SetOptionsFormatting(Value: TdxGridReportLinkOptionsFormatting); + procedure SetOptionsLevels(Value: TdxGridReportLinkOptionsLevels); + procedure SetOptionsOnEveryPage(Value: TdxGridReportLinkOptionsOnEveryPage); + procedure SetOptionsPagination(Value: TdxGridReportLinkOptionsPagination); + procedure SetOptionsPreview(Value: TdxGridReportLinkOptionsPreview); + procedure SetOptionsRefinements(Value: TdxGridReportLinkOptionsRefinements); + procedure SetOptionsSelection(Value: TdxGridReportLinkOptionsSelection); + procedure SetOptionsSize(Value: TdxGridReportLinkOptionsSize); + procedure SetOptionsView(Value: TdxGridReportLinkOptionsView); + procedure SetStyles(Value: TdxGridReportLinkStyles); + protected + procedure BeforeDesignReport; override; + procedure ConstructReport(AReportCells: TdxReportCells); override; + procedure ConvertCoords; override; + procedure CustomDraw(AItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); override; + function GetBreakPagesByHardDelimiters: Boolean; override; + function GetEmptyPagesCanExist: Boolean; override; + function GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; override; + function GetUseHardVertDelimiters: Boolean; override; + procedure InternalRestoreDefaults; override; + procedure InternalRestoreFromOriginal; override; + function IsDrawFootersOnEveryPage: Boolean; override; + function IsDrawHeadersOnEveryPage: Boolean; override; + function IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; override; + procedure MakeHardDelimiters(AReportCells: TdxReportCells; AVertDelimiters: TList); override; + + function GetAreNativeStylesAvailable: Boolean; override; + function GetStylesClass: TdxCustomReportLinkStylesClass; override; + function GetStyleSheetClass: TdxCustomReportLinkStyleSheetClass; override; + function GetStyleSheetPrototype: TdxCustomReportLinkStyleSheet; override; + procedure PrepareConstruct; override; + + procedure DoCustomDrawBandCell(ACanvas: TCanvas; AView: TcxGridBandedTableView; + ABand: TcxGridBand; AnItem: TdxReportCellString; var ADone: Boolean); dynamic; + procedure DoCustomDrawCardRowCaptionCell(ACanvas: TCanvas; AView: TcxGridCardView; + ACard: TcxGridCard; ARow: TcxGridCardViewRow; AnItem: TdxReportCellString; + var ADone: Boolean); dynamic; + procedure DoCustomDrawCardRowDataCell(ACanvas: TCanvas; AView: TcxGridCardView; + ACard: TcxGridCard; ARow: TcxGridCardViewRow; AnItem: TAbstractdxReportCellData; + var ADone: Boolean); dynamic; + procedure DoCustomDrawCell(ACanvas: TCanvas; AView: TcxCustomGridTableView; + ARecord: TcxCustomGridRecord; AColumn: TcxGridColumn; + AnItem: TAbstractdxReportCellData; var ADone: Boolean); dynamic; + procedure DoCustomDrawFilterBar(ACanvas: TCanvas; AView: TcxCustomGridTableView; + AnItem: TdxReportCellString; var ADone: Boolean); dynamic; + procedure DoCustomDrawFooterCell(ACanvas: TCanvas; AView: TcxGridTableView; + ARecord: TcxCustomGridRecord; AColumn: TcxGridColumn; ALevel: Integer; + AnItem: TdxReportCellString; var ADone: Boolean); dynamic; + procedure DoCustomDrawHeaderCell(ACanvas: TCanvas; AView: TcxGridTableView; + AColumn: TcxGridColumn; AnItem: TdxReportCellString; var ADone: Boolean); dynamic; + procedure DoCustomDrawLevelCaption(ACanvas: TCanvas; AView: TcxCustomGridView; + AnItem: TdxReportCellString; var ADone: Boolean); dynamic; + procedure DoGetCellHeight(AView: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem; var AHeight: Integer); dynamic; + procedure DoGetCustomPageBreaks; dynamic; + procedure DoInitializeBandCell(AView: TcxGridBandedTableView; ABand: TcxGridBand; + AnItem: TdxReportCellString); dynamic; + procedure DoInitializeCardRowCaptionCell(AView: TcxGridCardView; ACard: TcxGridCard; + ARow: TcxGridCardViewRow; AnItem: TdxReportCellString); dynamic; + procedure DoInitializeCardRowDataCell(AView: TcxGridCardView; ACard: TcxGridCard; + ARow: TcxGridCardViewRow; AnItem: TAbstractdxReportCellData); dynamic; + procedure DoInitializeCell(AView: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; AnItem: TAbstractdxReportCellData); dynamic; +{$IFDEF CHARTVIEW} + procedure DoInitializeChartCell(AView: TcxGridChartView; AnItem: TdxReportCellGraphic); dynamic; +{$ENDIF} + procedure DoInitializeFilterBar(AView: TcxCustomGridTableView; AnItem: TdxReportCellString); dynamic; + procedure DoInitializeFooterCell(AView: TcxGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; ALevel: Integer; AnItem: TdxReportCellString); dynamic; + procedure DoInitializeHeaderCell(AView: TcxGridTableView; AColumn: TcxGridColumn; + AnItem: TdxReportCellString); dynamic; + procedure DoInitializeLevelCaption(AView: TcxCustomGridView; AnItem: TdxReportCellString); dynamic; + + procedure CreateOptions; override; + procedure DestroyOptions; override; + function GetOptionsCardsClass: TdxGridReportLinkOptionsCardsClass; virtual; +{$IFDEF CHARTVIEW} + function GetOptionsChartsClass: TdxGridReportLinkOptionsChartsClass; virtual; +{$ENDIF} + function GetOptionsDetailsClass: TdxGridReportLinkOptionsDetailsClass; virtual; + function GetOptionsExpandingClass: TdxCustomReportLinkOptionsExpandingClass; override; + function GetOptionsFormattingClass: TdxCustomReportLinkOptionsFormattingClass; override; + function GetOptionsLevelsClass: TdxGridReportLinkOptionsLevelsClass; virtual; + function GetOptionsOnEveryPageClass: TdxCustomTableControlReportLinkOptionsOnEveryPageClass; override; + function GetOptionsPaginationClass: TdxCustomReportLinkOptionsPaginationClass; override; + function GetOptionsPreviewClass: TdxCustomTableControlReportLinkOptionsPreviewClass; override; + function GetOptionsRefinementsClass: TdxCustomReportLinkOptionsRefinementsClass; override; + function GetOptionsSelectionClass: TdxCustomTableControlReportLinkOptionsSelectionClass; override; + function GetOptionsSizeClass: TdxCustomReportLinkOptionsSizeClass; override; + function GetOptionsViewClass: TdxCustomReportLinkOptionsViewClass; override; + + procedure AddReportRow(AReportRow: TdxReportCell); + procedure AddVerticalHardDelimiter(ADelimiter: TdxReportCell); overload; + procedure AddVerticalHardDelimiter(ADelimiter: Integer); overload; + procedure BuildTopLevelView(AGridView: TcxCustomGridView); + procedure BuildTopLevelViews; + procedure BuildView(AMasterBuilder: TdxCustomGridViewBuilder; AGridView: TcxCustomGridView); + function CreateViewAdapter(AMasterAdapter: TdxCustomGridViewAdapter; AGridView: TcxCustomGridView): TdxCustomGridViewAdapter; + function CreateViewBuilder(AMasterBuilder: TdxCustomGridViewBuilder; AGridView: TcxCustomGridView): TdxCustomGridViewBuilder; + + procedure DoExpandRows; + procedure DoExpandViewRows(AGridView: TcxCustomGridView); + procedure ForEachView(AMasterRow: TcxGridMasterDataRow; AProc: TdxGridViewProc); + + function GetItemCustomDrawInfo(AnItem: TdxReportVisualItem; out ADrawInfo: TdxGridCellCustomDrawInfo): TdxGridAttributeID; virtual; + function HasSiblings(AGridView: TcxCustomGridView): Boolean; + function IsCardViewStyle(AStyle: TcxStyle): Boolean; virtual; + function IsCustomDrawn(AnAttributeID: TdxGridAttributeID): Boolean; virtual; + function IsOffice11StyleGrouping: Boolean; + + procedure CalculateProcessParams; + function CanAttributeBeUsedOnEveryPage(AnAttribute: TdxGridAttributeClass): Boolean; + function IsAttributeUsedOnEveryPage(AnAttribute: TdxGridAttributeClass): Boolean; + + property ActiveStyles: TdxGridReportLinkStyles read GetActiveStyles; + property ActiveView: TcxCustomGridView read GetActiveView; + property ActiveViewHelper: TdxCustomGridViewHelperClass read GetActiveViewHelper; + property ActiveViewMasterRow: TcxGridMasterDataRow read GetActiveViewMasterRow; + property ActiveViewParentLevel: TcxGridLevel read GetActiveViewParentLevel; + property DelimitersHardVert: TList read FDelimitersHardVert; + property HostInfoServices: TdxGridAttributeHostInfoServices read FHostInfoServices; + property ProcessParams: TdxGridReportLinkProcessParams read FProcessParams; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + procedure AddPageBreak(AGridRecord: TcxCustomGridRecord); overload; + procedure AddPageBreak(const AGridRecords: array of TcxCustomGridRecord); overload; + procedure AddPageBreak(const AGridRecords: TdxGridRecordArray); overload; + procedure AddPageBreak(AGridRecords: TList); overload; // list of TcxCustomGridRecord + + property Grid: TcxGrid read GetGrid; + property DesignWindow: TdxfmGridReportLinkDesignWindow read GetDesignWindow; + property ReportRows[Index: Integer]: TdxReportCell read GetReportRow; + property ReportRowsByGridRecord[GridRow: TcxCustomGridRecord]: TdxReportCell read GetReportRowByGridRecord; + property ReportRowCount: Integer read GetReportRowCount; + published + property Color; + property Font; + property OptionsCards: TdxGridReportLinkOptionsCards read FOptionsCards write SetOptionsCards; +{$IFDEF CHARTVIEW} + property OptionsCharts: TdxGridReportLinkOptionsCharts read FOptionsCharts write SetOptionsCharts; +{$ENDIF} + property OptionsDetails: TdxGridReportLinkOptionsDetails read FOptionsDetails write SetOptionsDetails; + property OptionsExpanding: TdxGridReportLinkOptionsExpanding read GetOptionsExpanding write SetOptionsExpanding; + property OptionsFormatting: TdxGridReportLinkOptionsFormatting read GetOptionsFormatting write SetOptionsFormatting; + property OptionsLevels: TdxGridReportLinkOptionsLevels read FOptionsLevels Write SetOptionsLevels; + property OptionsOnEveryPage: TdxGridReportLinkOptionsOnEveryPage read GetOptionsOnEveryPage write SetOptionsOnEveryPage; + property OptionsPagination: TdxGridReportLinkOptionsPagination read GetOptionsPagination write SetOptionsPagination; + property OptionsPreview: TdxGridReportLinkOptionsPreview read GetOptionsPreview write SetOptionsPreview; + property OptionsRefinements: TdxGridReportLinkOptionsRefinements read GetOptionsRefinements write SetOptionsRefinements; + property OptionsSelection: TdxGridReportLinkOptionsSelection read GetOptionsSelection write SetOptionsSelection; + property OptionsSize: TdxGridReportLinkOptionsSize read GetOptionsSize write SetOptionsSize; + property OptionsView: TdxGridReportLinkOptionsView read GetOptionsView write SetOptionsView; + property ScaleFonts; + property StyleRepository; + property Styles: TdxGridReportLinkStyles read GetStyles write SetStyles; + property SupportedCustomDraw; + + property OnCustomDrawBandCell: TdxGridReportLinkCustomDrawBandCellEvent read FOnCustomDrawBandCell + write SetOnCustomDrawBandCell; + property OnCustomDrawCell: TdxGridReportLinkCustomDrawCellEvent read FOnCustomDrawCell + write SetOnCustomDrawCell; + property OnCustomDrawCardRowCaptionCell: TdxGridReportLinkCustomDrawCardRowCaptionCellEvent read FOnCustomDrawCardRowCaptionCell + write SetOnCustomDrawCardRowCaptionCell; + property OnCustomDrawCardRowDataCell: TdxGridReportLinkCustomDrawCardRowDataCellEvent read FOnCustomDrawCardRowDataCell + write SetOnCustomDrawCardRowDataCell; + property OnCustomDrawFilterBar: TdxGridReportLinkCustomDrawFilterBarEvent read FOnCustomDrawFilterBar + write SetOnCustomDrawFilterBar; + property OnCustomDrawFooterCell: TdxGridReportLinkCustomDrawFooterCellEvent read FOnCustomDrawFooterCell + write SetOnCustomDrawFooterCell; + property OnCustomDrawHeaderCell: TdxGridReportLinkCustomDrawHeaderCellEvent read FOnCustomDrawHeaderCell + write SetOnCustomDrawHeaderCell; + property OnCustomDrawLevelCaption: TdxGridReportLinkCustomDrawLevelCaptionEvent read FOnCustomDrawLevelCaption + write SetOnCustomDrawLevelCaption; + property OnGetCellHeight: TdxGridReportLinkGetCellHeightEvent read FOnGetCellHeight write FOnGetCellHeight; + property OnGetCustomPageBreaks: TdxGridGetCustomPageBreaksEvent read FOnGetCustomPageBreaks write FOnGetCustomPageBreaks; + property OnInitializeBandCell: TdxGridReportLinkInitializeBandCellEvent read FOnInitializeBandCell + write FOnInitializeBandCell; + property OnInitializeCardRowCaptionCell: TdxGridReportLinkInitializeCardRowCaptionCellEvent read FOnInitializeCardRowCaptionCell + write FOnInitializeCardRowCaptionCell; + property OnInitializeCardRowDataCell: TdxGridReportLinkInitializeCardRowDataCellEvent read FOnInitializeCardRowDataCell + write FOnInitializeCardRowDataCell; + property OnInitializeCell: TdxGridReportLinkInitializeCellEvent read FOnInitializeCell + write FOnInitializeCell; +{$IFDEF CHARTVIEW} + property OnInitializeChartCell: TdxGridReportLinkInitializeChartCellEvent read FOnInitializeChartCell + write FOnInitializeChartCell; +{$ENDIF} + property OnInitializeFilterBar: TdxGridReportLinkInitializeFilterBarEvent read FOnInitializeFilterBar + write FOnInitializeFilterBar; + property OnInitializeFooterCell: TdxGridReportLinkInitializeFooterCellEvent read FOnInitializeFooterCell + write FOnInitializeFooterCell; + property OnInitializeHeaderCell: TdxGridReportLinkInitializeHeaderCellEvent read FOnInitializeHeaderCell + write FOnInitializeHeaderCell; + property OnInitializeLevelCaption: TdxGridReportLinkInitializeLevelCaptionEvent read FOnInitializeLevelCaption + write FOnInitializeLevelCaption; + end; + + TcxGridCardView2OptionsView = class(TcxGridCardViewOptionsView) + private + FCardBorders: Boolean; + FGridLineColor: TColor; + FGridLines: TcxGridLines; + FShadowDepth: Integer; + function GetShadowVisible: Boolean; + procedure SetCardBorders(Value: Boolean); + procedure SetGridLineColor(Value: TColor); + procedure SetGridLines(Value: TcxGridLines); + procedure SetShadowDepth(Value: Integer); + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + property ShadowVisible: Boolean read GetShadowVisible; + published + property CardBorders: Boolean read FCardBorders write SetCardBorders default False; + property GridLineColor: TColor read FGridLineColor write SetGridLineColor default clDefault; + property GridLines: TcxGridLines read FGridLines write SetGridLines default glNone; + property ShadowDepth: Integer read FShadowDepth write SetShadowDepth; + end; + + TcxGridCardView2Styles = class(TcxGridCardViewStyles) + private + FOnGetCardShadowStyle: TcxGridGetRecordStyleEvent; + protected + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + public + procedure Assign(Source: TPersistent); override; + procedure GetCardShadowParams(ARecord: TcxCustomGridRecord; out AParams: TcxViewParams); virtual; + published + property CardShadow: TcxStyle index vsCardShadow read GetValue write SetValue; + property OnGetCardShadowStyle: TcxGridGetRecordStyleEvent read FOnGetCardShadowStyle + write FOnGetCardShadowStyle; + end; + + TcxGridCardView2 = class(TcxGridCardView) + protected + function GetOptionsViewClass: TcxCustomGridOptionsViewClass; override; + function GetStylesClass: TcxCustomGridViewStylesClass; override; + function GetViewDataClass: TcxCustomGridViewDataClass; override; + function GetViewInfoClass: TcxCustomGridViewInfoClass; override; + end; + + TdxfmGridReportLinkDesignWindow = class(TdxfmCustomcxControlReportLinkDesignWindow) + PageControl1: TPageControl; + tshView: TTabSheet; + tshBehaviors: TTabSheet; + tshPreview: TTabSheet; + tshCards: TTabSheet; + lblShow: TLabel; + imgShow: TImage; + bvlShow: TBevel; + chbxShowBands: TCheckBox; + chbxShowHeaders: TCheckBox; + chbxShowFooters: TCheckBox; + chbxShowGroupFooters: TCheckBox; + chbxShowExpandButtons: TCheckBox; + lblOnEveryPage: TLabel; + imgOnEveryPage: TImage; + bvlOnEveryPage: TBevel; + chbxBandsOnEveryPage: TCheckBox; + chbxHeadersOnEveryPage: TCheckBox; + chbxFootersOnEveryPage: TCheckBox; + chbxFilterBarOnEveryPage: TCheckBox; + chbxCaptionsOnEveryPage: TCheckBox; + bvlWarningHost: TBevel; + lblSelection: TLabel; + imgSelection: TImage; + chbxProcessSelection: TCheckBox; + chbxProcessExactSelection: TCheckBox; + bvlSelection: TBevel; + lblExpanding: TLabel; + imgExpanding: TImage; + chbxExpandGroupRows: TCheckBox; + bvlExpanding: TBevel; + chbxExpandMasterRows: TCheckBox; + lblPreviewOptions: TLabel; + bvlPreviewOptions: TBevel; + chbxPreviewVisible: TCheckBox; + chbxPreviewAutoHeight: TCheckBox; + lblPreviewMaxLineCount: TLabel; + bvlPreviewMaxLineCountHost: TBevel; + chbxShowCaptions: TCheckBox; + chbxShowFilterBar: TCheckBox; + imgPreview: TImage; + chbxStartFromActiveView: TCheckBox; + chbxOnlyActiveView: TCheckBox; + lblDetails: TLabel; + bvlDetails: TBevel; + imgDetails: TImage; + tshFormatting: TTabSheet; + lblLookAndFeel: TLabel; + bvlLookAndFeel: TBevel; + imgLookAndFeel: TImage; + cbxLookAndFeel: TComboBox; + chbxFlatCheckMarks: TCheckBox; + chbxDisplayGraphicsAsText: TCheckBox; + chbxTransparentGraphics: TCheckBox; + imgRefinements: TImage; + lblRefinements: TLabel; + bvlRefinements: TBevel; + bvlCardSpaceVertHost: TBevel; + bvlCardSpaceHorzHost: TBevel; + lblCardSpaceVert: TLabel; + lblCardSpaceHorz: TLabel; + imgCardSpacing: TImage; + lblCardSpacing: TLabel; + bvlCardSpacing: TBevel; + bvlCardSizes: TBevel; + lblCardSizes: TLabel; + imgCardSizes: TImage; + chbxCardsKeepSameHeight: TCheckBox; + chbxCardsKeepSameWidth: TCheckBox; + chbxCardsAutoWidth: TCheckBox; + chbxCardsVertLines: TCheckBox; + chbxCardsHorzLines: TCheckBox; + chbxCardsBorder: TCheckBox; + imgCardFraming: TImage; + lblCardFraming: TLabel; + bvlCardFraming: TBevel; + bvlCardShadowColorHost: TBevel; + lblCardShadowDepth: TLabel; + bvlCardShadow: TBevel; + lblCardShadow: TLabel; + lblCardShadowColor: TLabel; + bvlCardShadowDepthHost: TBevel; + imgCardShadow: TImage; + pnlPreview: TPanel; + PreviewGrid: TcxGrid; + PreviewBandedView: TcxGridBandedTableView; + colVendorName: TcxGridBandedColumn; + colVendorLogo: TcxGridBandedColumn; + colVendorCountry: TcxGridBandedColumn; + colCarModel: TcxGridBandedColumn; + colIsSUVModel: TcxGridBandedColumn; + PreviewGridLevel: TcxGridLevel; + chbxLevelsUnwrap: TCheckBox; + imgLevels: TImage; + lblLevels: TLabel; + bvlLevels: TBevel; + chbxLevelsUnwrapTopLevel: TCheckBox; + chbxLevelsRiseActiveLevelOntoTop: TCheckBox; + chbxSuppressBackgroundBitmaps: TCheckBox; + tshStyles: TTabSheet; + btnStyleColor: TButton; + btnStyleFont: TButton; + btnStyleBackgroundBitmap: TButton; + chbxUseNativeStyles: TCheckBox; + bvlStyles: TBevel; + pmStyles: TPopupMenu; + miStyleFont: TMenuItem; + miStyleBackgroundBitmap: TMenuItem; + miStyleColor: TMenuItem; + bvlStyleSheets: TBevel; + lblStyleSheets: TLabel; + cbxStyleSheets: TComboBox; + btnStyleSheetNew: TButton; + btnStyleSheetCopy: TButton; + btnStyleSheetDelete: TButton; + milLine: TMenuItem; + miStylesSaveAs: TMenuItem; + btnStylesSaveAs: TButton; + btnStyleSheetRename: TButton; + miStyleBackgroundBitmapClear: TMenuItem; + btnStyleBackgroundBitmapClear: TButton; + btnStyleRestoreDefaults: TButton; + miStyleRestoreDefaults: TMenuItem; + miLine2: TMenuItem; + miLine3: TMenuItem; + bvlStylesHost: TBevel; + ilStylesPopup: TImageList; + miStylesSelectAll: TMenuItem; + miLine4: TMenuItem; + lblGridSize: TLabel; + bvlGridSize: TBevel; + imgGridSize: TImage; + chbxGridAutoWidth: TCheckBox; + chbxConsumeSelectionStyle: TCheckBox; + bvlRefinementsSeparator: TBevel; + lblPagination: TLabel; + bvlPagination: TBevel; + imgPagination: TImage; + chbxPaginateOneGroupPerPage: TCheckBox; + chbxPaginateByTopLevelGroups: TCheckBox; + lblPreviewWindow: TStaticText; + cxStyleRepository1: TcxStyleRepository; + styleCardShadow: TcxStyle; + styleCardBorder: TcxStyle; + Label1: TLabel; + chbxExpandCards: TCheckBox; + lblUseNativeStyles: TLabel; + tshCharts: TTabSheet; + lblChartsOptions: TLabel; + imgCharts: TImage; + chbxChartsTransparent: TCheckBox; + bvlChartsOptions: TBevel; + procedure OptionsViewClick(Sender: TObject); + procedure OptionsOnEveryPageClick(Sender: TObject); + procedure OptionsSelectionClick(Sender: TObject); + procedure OptionsExpandingClick(Sender: TObject); + procedure OptionsRefinementClick(Sender: TObject); + procedure LookAndFeelClick(Sender: TObject); + procedure PreviewVisibleClick(Sender: TObject); + procedure PreviewAutoHeightClick(Sender: TObject); + procedure OptionsCardsClick(Sender: TObject); + procedure IsSUVModelCustomDrawCell(Sender: TcxCustomGridTableView; + ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; + var ADone: Boolean); + procedure VendorLogoCustomDrawCell(Sender: TcxCustomGridTableView; + ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; + var ADone: Boolean); + procedure PreviewBandedViewCustomDrawColumnHeader( + Sender: TcxGridTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean); + procedure PreviewBandedViewCustomDrawBandHeader( + Sender: TcxGridBandedTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridBandHeaderViewInfo; var ADone: Boolean); + procedure PreviewBandedViewCustomDrawFooterCell( + Sender: TcxGridTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean); + procedure OptionsDetailsClick(Sender: TObject); + procedure OptionsSizeClick(Sender: TObject); + procedure OptionsLevelsClick(Sender: TObject); + procedure OptionsFormatingClick(Sender: TObject); + procedure StyleColorClick(Sender: TObject); + procedure StyleFontClick(Sender: TObject); + procedure StyleBackgroundBitmapClick(Sender: TObject); + procedure lbxStylesClick(Sender: TObject); + procedure pmStylesPopup(Sender: TObject); + procedure cbxStyleSheetsClick(Sender: TObject); + procedure StyleSheetNewClick(Sender: TObject); + procedure StyleSheetCopyClick(Sender: TObject); + procedure StyleSheetDeleteClick(Sender: TObject); + procedure StylesSaveAsClick(Sender: TObject); + procedure cbxStyleSheetsKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure StyleSheetRenameClick(Sender: TObject); + procedure PageControl1Change(Sender: TObject); + procedure StyleBackgroundBitmapClearClick(Sender: TObject); + procedure StyleRestoreDefaultsClick(Sender: TObject); + procedure miStylesSelectAllClick(Sender: TObject); + procedure OptionsPaginationClick(Sender: TObject); + procedure cbxStyleSheetsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure lblUseNativeStylesClick(Sender: TObject); + procedure chbxChartsTransparentClick(Sender: TObject); + private + ccbxCardsShadowColor: TdxPSColorCombo; + lbxStyles: TdxStylesListBox; + PreviewCardView: TcxGridCardView2; + rowVendorName: TcxGridCardViewRow; + rowVendorLogo: TcxGridCardViewRow; + rowVendorCountry: TcxGridCardViewRow; + rowCarModel: TcxGridCardViewRow; + rowIsSuvModel: TcxGridCardViewRow; + seCardsShadowDepth: TdxPSSpinEdit; + seCardsSpaceHorz: TdxPSSpinEdit; + seCardsSpaceVert: TdxPSSpinEdit; + sePreviewMaxLineCount: TdxPSSpinEdit; + wpIncorrectOnEveryPageState: TdxPSWarningPane; + + function GetActiveStyle: TcxStyle; + function GetHasSelectedStyles: Boolean; + function GetHasSelectedStylesWithAssignedBitmap: Boolean; + function GetReportLink: TdxGridReportLink; + + procedure CardShadowDepthChanged(Sender: TObject); + procedure CardShadowColorChanged(Sender: TObject); + procedure CardSpaceHorzChanged(Sender: TObject); + procedure CardSpaceVertChanged(Sender: TObject); + procedure PreviewMaxLineCountChanged(Sender: TObject); + + function CanSelectAllStyles: Boolean; + procedure ChangeActiveView(AView: TcxCustomGridView); + procedure CreateCardView; + procedure CreateControls; + procedure CustomDrawBorders(ACanvas: TcxCanvas; AViewInfo: TcxCustomGridCellViewInfo); + procedure CustomDrawFooter(ACanvas: TcxCanvas; R: TRect; AViewInfo: TcxCustomGridCellViewInfo); + procedure CustomDrawHeader(ACanvas: TcxCanvas; R: TRect; AViewInfo: TcxCustomGridCellViewInfo); + procedure CustomDrawTextRect(ACanvas: TcxCanvas; R: TRect; AViewInfo: TcxCustomGridCellViewInfo; + ABackgroundBitmap: TBitmap); + procedure InitializePreviewGrid; + procedure InitializePreviewGridStyles; + procedure LoadDataIntoPreviewGridView(AView: TcxCustomGridTableView); + procedure RecreateStylesListBox; + procedure RestoreSelectedStyles(AList: TList); + procedure SaveSelectedStyles(AList: TList); + procedure SetActivePage; + procedure UpdatePreviewGridStyles(const ACaption: string; AStyle: TcxStyle); + procedure UpdateWarningPane; + + procedure SetOptionsCardsByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsChartsByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsDetailsByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsExpandingByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsFormattingByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsLevelsByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsOnEveryPageByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsPaginationByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsRefinementsByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsSelectionByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsSizeByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsViewByIndex(Index: Integer; Value: Boolean); + protected + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + procedure LoadStrings; override; + procedure UpdateControlsState; override; + procedure UpdatePreview; override; + + function GetDesignerTabIndex: Integer; override; + procedure SetDesignerTabIndex(Value: Integer); override; + + procedure DoActiveStyleSheetChanged; override; + procedure DoFormActivated(AnActive: Boolean); override; + procedure DoRefreshStylesList; override; + procedure DoStyleChanged(const ACaption: string; AStyle: TcxStyle); override; + procedure DoStylesChanged(AStrings: TStrings; ARecreate: Boolean); override; + + procedure GetSelectedStyleNames(AStrings: TStrings); override; + procedure GetStyleNames(out AStrings: TStrings); override; + procedure GetStyleSheetNames(out AStrings: TStrings); override; + + property ActiveStyle: TcxStyle read GetActiveStyle; + property HasSelectedStyles: Boolean read GetHasSelectedStyles; + property HasSelectedStylesWithAssignedBitmap: Boolean read GetHasSelectedStylesWithAssignedBitmap; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property ReportLink: TdxGridReportLink read GetReportLink; + end; + +implementation + +{$R *.DFM} + +{658 x 466 - DesignWindow} + +{.2 - IsOffice11StyleGrouping} +{.3 - chbxTransparentRichEdits} + +uses + Registry, Forms, {$IFDEF DELPHI6}Variants, {$ENDIF}cxVariants, cxGridStrs, + cxDataUtils, dxThemeManager, {$IFDEF DXVER500}dxOffice11, {$ENDIF}dxPSGlbl, + dxPSTextOut, dxPSUtl, dxBkgnd, dxPSPopupMan, dxPSRes, dxPSImgs; + +const + SortOrderMap: array[TcxGridSortOrder] of TdxCellSortOrder = (csoNone, csoUp, csoDown); + + ExpandButtonInteriorColor = clBtnFace; + DefaultFilterBarColor = clBtnShadow; + DefaultFilterBarTextColor = clWindow; + DefaultIndentWidth = 20; + DefaultDataRowLineHeight = 19; + DefaultGroupFooterLineHeight = 20; + DefaultGroupRowLineHeight = 20; + DefaultFooterLineHeight = 20; + FilterBarTextOffset = 3; + FirstCardOffset = 2; + FooterItemInflateHorz = 2; + FooterItemInflateVert = 3; + TabsAreaOffset = 2; + +var + FGridLinkStyleSheetPrototype: TdxGridReportLinkStyleSheet; + +type + TdxPSGridDataCellPos = TcxGridDataCellPos; + + TdxGridViewBuildersFactory = class(TdxCustomClassMaps) + private + function GetBuilderClass(GridView: TcxCustomGridView): TdxGridViewBuilderClass; + public + class function Instance: TdxGridViewBuildersFactory; reintroduce; overload; + function CreateViewAdapter(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView): TdxCustomGridViewAdapter; + function CreateViewBuilder(AReportLink: TdxGridReportLink; AMasterBuilder: TdxCustomGridViewBuilder; + AGridView: TcxCustomGridView): TdxCustomGridViewBuilder; + property BuilderClasses[GridView: TcxCustomGridView]: TdxGridViewBuilderClass read GetBuilderClass; default; + end; + + TdxViewHelpersFactory = class(TdxCustomClassMaps) + private + function GetHelperClass(GridView: TcxCustomGridView): TdxCustomGridViewHelperClass; + public + class function Instance: TdxViewHelpersFactory; reintroduce; overload; + function HelperClassByItem(AnItem: TdxReportVisualItem): TdxCustomGridViewHelperClass; + property HelperClasses[GridView: TcxCustomGridView]: TdxCustomGridViewHelperClass read GetHelperClass; default; + end; + + TdxRecordHelpersFactory = class(TdxCustomClassMaps) + private + function GetHelperClass(GridRecord: TcxCustomGridRecord): TdxCustomGridRecordHelperClass; + public + class function Instance: TdxRecordHelpersFactory; reintroduce; overload; + property HelperClasses[GridRecord: TcxCustomGridRecord]: TdxCustomGridRecordHelperClass read GetHelperClass; default; + end; + + + TcxCustomGridCellPainterAccess = class(TcxCustomGridCellPainter); + TcxCustomGridCellViewInfoAccess = class(TcxCustomGridCellViewInfo); + TcxCustomGridRecordAccess = class(TcxCustomGridRecord); + TcxCustomGridTableControllerAccess = class(TcxCustomGridTableController); + TcxCustomGridTableItemAccess = class(TcxCustomGridTableItem); + {$IFDEF DXVER500} + TcxCustomGridTableFilteringAccess = class(TcxCustomGridTableFiltering); + {$ENDIF} + TcxCustomGridTableOptionsViewAccess = class(TcxCustomGridTableOptionsView); + TcxCustomGridViewAccess = class(TcxCustomGridView); + TcxGridColumnAccess = class(TcxGridColumn); + TcxGridMasterDataRowAccess = class(TcxGridMasterDataRow); + TcxGridTableViewInfoAccess = class(TcxGridTableViewInfo); + + +{ Helpers } + +{ CustomGridCellPainter Helpers } + +procedure CustomGridCellPainter_DrawBorders(AInstance: TcxCustomGridCellPainter); +begin + TcxCustomGridCellPainterAccess(AInstance).DrawBorders; +end; + +{ CustomGridCellViewInfo Helpers } + +function CustomGridCellViewInfo_GetPainterClass(AInstance: TcxCustomGridCellViewInfo): TcxCustomGridCellPainterClass; +begin + Result := TcxCustomGridCellViewInfoAccess(AInstance).GetPainterClass; +end; + +{ CustomGridRecord Helpers } + +function CustomGridRecord_GetIsParent(AInstance: TcxCustomGridRecord): Boolean; +begin + Result := TcxCustomGridRecordAccess(AInstance).IsParent; +end; + +{ CustomGridTableController Helpers } + +function CustomGridTableController_GetMultiSelect(AInstance: TcxCustomGridTableController): Boolean; +begin + Result := TcxCustomGridTableControllerAccess(AInstance).MultiSelect; +end; + +{ CustomGridTableFiltering Helpers } + +function CustomGridTableFiltering_GetPosition(AInstance: TcxCustomGridTableFiltering): TcxGridFilterPosition; +begin + Result := TcxCustomGridTableFilteringAccess(AInstance).Position; +end; + +{ CustomGridTableOptionsView Helpers } + +function CustomGridTableOptionsView_GetCellAutoHeight(AInstance: TcxCustomGridTableOptionsView): Boolean; +begin + Result := TcxCustomGridTableOptionsViewAccess(AInstance).CellAutoHeight; +end; + +{ CustomGridView Helpers } + +function CustomGridView_GetBackgroundBitmaps(AInstance: TcxCustomGridView): TcxCustomGridBackgroundBitmaps; +begin + Result := TcxCustomGridViewAccess(AInstance).BackgroundBitmaps; +end; + +function CustomGridView_GetDataController(AInstance: TcxCustomGridView): TcxCustomDataController; +begin + Result := TcxCustomGridViewAccess(AInstance).DataController; +end; + +function CustomGridView_GetStyles(AInstance: TcxCustomGridView): TcxCustomGridStyles; +begin + Result := TcxCustomGridViewAccess(AInstance).Styles; +end; + +{ GridColumn Helpers } + +function GridColumn_GetFixed(AInstance: TcxGridColumn): Boolean; +begin + Result := TcxGridColumnAccess(AInstance).Fixed; +end; + +function GridColumn_DoCompareValuesForCellMerging(AInstance: TcxGridColumn; + ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: TcxEditValue; + ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: TcxEditValue): Boolean; +begin + Result := TcxGridColumnAccess(AInstance).DoCompareValuesForCellMerging(ARow1, AProperties1, AValue1, ARow2, AProperties2, AValue2); +end; + +{ GridMasterDataRow Helpers } + +procedure GridMasterDataRow_DoExpand(AInstance: TcxGridMasterDataRow; ARecurse: Boolean); +begin + TcxGridMasterDataRowAccess(AInstance).DoExpand(ARecurse); +end; + +{ GridTableViewInfo Helpers } + +procedure GridTableViewInfo_CalculateExpandButtonParams(AInstance: TcxGridTableViewInfo); +begin + TcxGridTableViewInfoAccess(AInstance).CalculateExpandButtonParams; +end; + +{ Utilities } + +function GridLinkStyleSheetPrototype: TdxGridReportLinkStyleSheet; + + function CreateStyle(AColor, AFontColor: TColor): TcxStyle; + begin + Result := TcxStyle.Create(FGridLinkStyleSheetPrototype); + with Result do + begin + Color := AColor; + Font.Name := dxPSCore.dxPSDefaultFontName; + Font.Color := AFontColor; + end; + end; + +begin + if FGridLinkStyleSheetPrototype = nil then + begin + FGridLinkStyleSheetPrototype := TdxGridReportLinkStyleSheet.Create(nil); + with FGridLinkStyleSheetPrototype.Styles as TdxGridReportLinkStyles do + begin + BandHeader := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Caption := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + CardCaptionRow := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + CardRowCaption := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Content := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + ContentEven := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + ContentOdd := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + FilterBar := CreateStyle(clBtnShadow, dxPSCore.dxDefaultContentColor); + Footer := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Group := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Header := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Preview := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + Selection := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + end; + end; + Result := FGridLinkStyleSheetPrototype; +end; + +function CreatePSDataCellPos: TdxPSGridDataCellPos; +begin + Result := TdxPSGridDataCellPos.Create; +end; + +procedure FreePSDataCellPos(out ADataCellPos: TdxPSGridDataCellPos); +begin + FreeAndNil(ADataCellPos); +end; + +procedure _LoadAllRecords(ADBDataModeController: TcxDBDataModeController; + out APrevAllRecordsAreLoaded: Boolean); +begin + APrevAllRecordsAreLoaded := not ADBDataModeController.GridMode; + if not APrevAllRecordsAreLoaded then + ADBDataModeController.GridMode := False; +end; + +procedure _UnloadAllRecords(ADBDataModeController: TcxDBDataModeController; + const APrevAllRecordsAreLoaded: Boolean); +begin + if not APrevAllRecordsAreLoaded then + ADBDataModeController.GridMode := True; +end; + +{ TdxGridViewBuildersFactory } + +function dxGridViewBuildersFactory: TdxGridViewBuildersFactory; +begin + Result := TdxGridViewBuildersFactory.Instance; +end; + +class function TdxGridViewBuildersFactory.Instance: TdxGridViewBuildersFactory; +begin + Result := inherited Instance as TdxGridViewBuildersFactory; +end; + +function TdxGridViewBuildersFactory.CreateViewAdapter(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView): TdxCustomGridViewAdapter; +begin + Result := BuilderClasses[AGridView].CreateAdapter(AMasterAdapter, AGridView); +end; + +function TdxGridViewBuildersFactory.CreateViewBuilder(AReportLink: TdxGridReportLink; + AMasterBuilder: TdxCustomGridViewBuilder; AGridView: TcxCustomGridView): TdxCustomGridViewBuilder; +begin + Result := BuilderClasses[AGridView].Create(AReportLink, AMasterBuilder, AGridView); +end; + +function TdxGridViewBuildersFactory.GetBuilderClass(GridView: TcxCustomGridView): TdxGridViewBuilderClass; +begin + Result := TdxGridViewBuilderClass(PairClasses[GridView.ClassType]); +end; + +{ TdxViewHelpersFactory } + +function dxViewHelpersFactory: TdxViewHelpersFactory; +begin + Result := TdxViewHelpersFactory.Instance; +end; + +class function TdxViewHelpersFactory.Instance: TdxViewHelpersFactory; +begin + Result := inherited Instance as TdxViewHelpersFactory; +end; + +function TdxViewHelpersFactory.HelperClassByItem(AnItem: TdxReportVisualItem): TdxCustomGridViewHelperClass; +begin + Result := HelperClasses[TcxCustomGridView(AnItem.TopLevelParent.Data)]; +end; + +function TdxViewHelpersFactory.GetHelperClass(GridView: TcxCustomGridView): TdxCustomGridViewHelperClass; +begin + if GridView = nil then + Result := nil + else + Result := TdxCustomGridViewHelperClass(PairClasses[GridView.ClassType]); +end; + +{ TdxRecordHelpersFactory } + +function dxRecordHelpersFactory: TdxRecordHelpersFactory; +begin + Result := TdxRecordHelpersFactory.Instance; +end; + +class function TdxRecordHelpersFactory.Instance: TdxRecordHelpersFactory; +begin + Result := inherited Instance as TdxRecordHelpersFactory; +end; + +function TdxRecordHelpersFactory.GetHelperClass(GridRecord: TcxCustomGridRecord): TdxCustomGridRecordHelperClass; +begin + Result := TdxCustomGridRecordHelperClass(PairClasses[GridRecord.ClassType]); +end; + +{ CLR Accesssors } + + + +{ TdxCustomGridViewHelper } + +constructor TdxCustomGridViewHelper.Create(AView: TcxCustomGridView); +begin + inherited Create; + FView := AView; +end; + +class function TdxCustomGridViewHelper.PairClass: TClass; +begin + Result := ViewClass; +end; + +class procedure TdxCustomGridViewHelper.Register; +begin + dxViewHelpersFactory.Register(Self); +end; + +class procedure TdxCustomGridViewHelper.Unregister; +begin + dxViewHelpersFactory.Unregister(Self); +end; + +class function TdxCustomGridViewHelper.ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; +begin + Result := dxGridUndefinedID; + if TClass(AnItem.Data) = TdxGridLevelCaption then + Result := dxGridLevelCaptionID; +end; + +class procedure TdxCustomGridViewHelper.ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); +begin + FillChar(ACustomDrawInfo, SizeOf(ACustomDrawInfo), 0); + with ACustomDrawInfo do + begin + GridAttributeID := ExtractCustomDrawID(AnItem); + GridView := ExtractGridView(AnItem); + end; +end; + +class function TdxCustomGridViewHelper.ExtractGridView(AnItem: TdxReportVisualItem): TcxCustomGridView; +begin + Result := TcxCustomGridView(AnItem.TopLevelParent.Data); +end; + +class function TdxCustomGridViewHelper.IsAttributeSupported(AnAttribute: TdxGridAttributeClass): Boolean; +var + Attributes: TdxGridAttributeClasses; + I: Integer; +begin + Attributes := SupportedAttributes; + + Result := True; + for I := Low(Attributes) to High(Attributes) do + if Attributes[I] = AnAttribute then Exit; + Result := False; +end; + +class function TdxCustomGridViewHelper.SupportedAttributes: TdxGridAttributeClasses; +begin + SetLength(Result, 0); + AddAttribute(Result, TdxGridLevelCaption); +end; + +class procedure TdxCustomGridViewHelper.AddAttribute(var AnAtributes: TdxGridAttributeClasses; + AnAttribute: TdxGridAttributeClass); +begin + SetLength(AnAtributes, Length(AnAtributes) + 1); + AnAtributes[Length(AnAtributes) - 1] := AnAttribute; +end; + +{$IFDEF DXVER500} +class function TdxCustomGridViewHelper.FilterPosition(AView: TcxCustomGridView): TcxGridFilterPosition; +begin + Result := fpBottom; +end; +{$ENDIF} + +class function TdxCustomGridViewHelper.IsFilterBarAtBottom(AView: TcxCustomGridView): Boolean; +begin + {$IFDEF DXVER500} + Result := FilterPosition(AView) = fpBottom; + {$ELSE} + Result := True; + {$ENDIF} +end; + +class function TdxCustomGridViewHelper.IsFilterBarAtTop(AView: TcxCustomGridView): Boolean; +begin + {$IFDEF DXVER500} + Result := FilterPosition(AView) = fpTop; + {$ELSE} + Result := False; + {$ENDIF} +end; + +class function TdxCustomGridViewHelper.IsOffice11StyleGrouping(AView: TcxCustomGridView): Boolean; +begin + Result := False; +end; + +class function TdxCustomGridViewHelper.ViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridView; +end; + +{ TdxNullGridViewHelper } + +class function TdxNullGridViewHelper.IsAttributeSupported(AnAttribute: TdxGridAttributeClass): Boolean; +begin + Result := True; +end; + +class function TdxNullGridViewHelper.ViewClass: TcxCustomGridViewClass; +begin + Result := nil; +end; + +{ TdxCustomGridTableViewHelper } + +class function TdxCustomGridTableViewHelper.ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; +begin + Result := inherited ExtractCustomDrawID(AnItem); + if Result = dxGridUndefinedID then + if TClass(AnItem.Data) = TdxGridFilterBar then + Result := dxGridFilterBarID; +end; + +class function TdxCustomGridTableViewHelper.SupportedAttributes: TdxGridAttributeClasses; +begin + Result := inherited SupportedAttributes; + AddAttribute(Result, TdxGridFilterBar); +end; + +class function TdxCustomGridTableViewHelper.ExtractRecord(AnItem: TdxReportVisualItem): TcxCustomGridRecord; +begin + Result := nil; +end; + +{$IFDEF DXVER500} +class function TdxCustomGridTableViewHelper.FilterPosition(AView: TcxCustomGridView): TcxGridFilterPosition; +begin + Result := CustomGridTableFiltering_GetPosition(TcxCustomGridTableView(AView).Filtering); +end; +{$ENDIF} + +class function TdxCustomGridTableViewHelper.ViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridTableView; +end; + +{ TdxGridCardViewHelper } + +class function TdxGridCardViewHelper.ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; +begin + Result := inherited ExtractCustomDrawID(AnItem); + if Result = dxGridUndefinedID then + if (AnItem.Parent <> nil) and (AnItem.Parent is TdxReportCardRow) then + if TClass(AnItem.Data) = TdxGridCardRowCaption then + Result := dxGridCardRowCaptionID + else + Result := dxGridCardRowDataID; +end; + +class procedure TdxGridCardViewHelper.ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); +begin + with ACustomDrawInfo do + try + inherited; + if GridAttributeID in [dxGridCardRowCaptionID, dxGridCardRowDataID] then + begin + GridCard := ExtractCard(AnItem); + GridCardRow := ExtractCardRow(AnItem); + end; + except + FillChar(ACustomDrawInfo, SizeOf(ACustomDrawInfo), 0); + GridAttributeID := dxGridUndefinedID; + end; +end; + +class function TdxGridCardViewHelper.ExtractCard(AnItem: TdxReportVisualItem): TcxGridCard; +begin + Result := ExtractRecord(AnItem) as TcxGridCard; +end; + +class function TdxGridCardViewHelper.ExtractCardRow(AnItem: TdxReportVisualItem): TcxGridCardViewRow; +begin + Result := TdxReportCardRow(AnItem.Parent).GridCardRow; +end; + +class function TdxGridCardViewHelper.ExtractRecord(AnItem: TdxReportVisualItem): TcxCustomGridRecord; +begin + Result := TdxReportCard(AnItem.Parent.Parent).GridCard; +end; + +class function TdxGridCardViewHelper.ViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridCardView; +end; + +{ TdxGridTableViewHelper } + +class function TdxGridTableViewHelper.ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; +begin + Result := inherited ExtractCustomDrawID(AnItem); + if Result = dxGridUndefinedID then + if AnItem.Parent <> nil then + if TClass(AnItem.Parent.Data) = TdxGridHeader then + Result := dxGridHeaderID + else + if TClass(AnItem.Parent.Data) = TdxGridFooter then + Result := dxGridFooterID + else + if IsDelphiObject(AnItem.Data) and (TObject(AnItem.Data) is TcxCustomGridTableItem) then + if (AnItem.Parent.Parent <> nil) and (AnItem.Parent.Parent.Data >= 0) and + (AnItem.Parent.Parent.Data < High(Byte)) then + Result := dxGridGroupFooterID + else + Result := dxGridRecordID; +end; + +class procedure TdxGridTableViewHelper.ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); +begin + with ACustomDrawInfo do + try + inherited; + + if GridAttributeID in [dxGridFooterID, dxGridGroupFooterID, dxGridHeaderID, dxGridRecordID] then + begin + GridColumn := ExtractColumn(AnItem); + if GridAttributeID in [dxGridRecordID, dxGridGroupFooterID] then + begin + GridRecord := ExtractRecord(AnItem); + if GridAttributeID = dxGridGroupFooterID then + GroupLevel := ExtractGroupLevel(AnItem); + end + else + GroupLevel := -1; + end; + except + FillChar(ACustomDrawInfo, SizeOf(ACustomDrawInfo), 0); + GridAttributeID := dxGridUndefinedID; + end; +end; + +class function TdxGridTableViewHelper.SupportedAttributes: TdxGridAttributeClasses; +begin + Result := inherited SupportedAttributes; + AddAttribute(Result, TdxGridDetails); + AddAttribute(Result, TdxGridExpandButton); + AddAttribute(Result, TdxGridFooter); + AddAttribute(Result, TdxGridGroupFooter); + AddAttribute(Result, TdxGridGroupRow); + AddAttribute(Result, TdxGridHeader); + AddAttribute(Result, TdxGridPreview); +end; + +class function TdxGridTableViewHelper.ExtractColumn(AnItem: TdxReportVisualItem): TcxGridColumn; +begin + Result := TcxGridColumn(AnItem.Data); +end; + +class function TdxGridTableViewHelper.ExtractGroupLevel(AnItem: TdxReportVisualItem): Integer; +begin + Result := Integer(AnItem.Parent.Parent.Data); +end; + +class function TdxGridTableViewHelper.ExtractRecord(AnItem: TdxReportVisualItem): TcxCustomGridRecord; +begin + Result := TcxCustomGridRecord(AnItem.Parent.Data); +end; + +class function TdxGridTableViewHelper.ViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridTableView; +end; + +class function TdxGridTableViewHelper.IsOffice11StyleGrouping(AView: TcxCustomGridView): Boolean; +begin + {$IFDEF DXVER500} + Result := TcxGridTableView(AView).OptionsView.GroupRowStyle = grsOffice11; + {$ELSE} + Result := False; + {$ENDIF} +end; + +{ TdxGridBandedTableViewHelper } + +class function TdxGridBandedTableViewHelper.ExtractCustomDrawID(AnItem: TdxReportVisualItem): TdxGridAttributeID; +begin + Result := inherited ExtractCustomDrawID(AnItem); + if Result = dxGridUndefinedID then + if IsDelphiObject(AnItem.Data) and (TObject(AnItem.Data) is TcxGridBand) then + Result := dxGridBandID; +end; + +class procedure TdxGridBandedTableViewHelper.ExtractCustomDrawInfo(AnItem: TdxReportVisualItem; + out ACustomDrawInfo: TdxGridCellCustomDrawInfo); +begin + with ACustomDrawInfo do + try + inherited; + if GridAttributeID = dxGridBandID then + GridBand := ExtractBand(AnItem); + except + FillChar(ACustomDrawInfo, SizeOf(ACustomDrawInfo), 0); + GridAttributeID := dxGridUndefinedID; + end; +end; + +class function TdxGridBandedTableViewHelper.SupportedAttributes: TdxGridAttributeClasses; +begin + Result := inherited SupportedAttributes; + AddAttribute(Result, TdxGridBandHeader); +end; + +class function TdxGridBandedTableViewHelper.ExtractBand(AnItem: TdxReportVisualItem): TcxGridBand; +begin + Result := TcxGridBand(AnItem.Data); +end; + +class function TdxGridBandedTableViewHelper.ViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridBandedTableView; +end; + +{ TdxCustomGridRecordHelper } + +constructor TdxCustomGridRecordHelper.Create(AAdapter: TdxCustomGridTableViewAdapter); +begin + inherited Create; + FAdapter := AAdapter; +end; + +class function TdxCustomGridRecordHelper.PairClass: TClass; +begin + Result := RecordClass; +end; + +class procedure TdxCustomGridRecordHelper.Register; +begin + dxRecordHelpersFactory.Register(Self); +end; + +class procedure TdxCustomGridRecordHelper.Unregister; +begin + dxRecordHelpersFactory.Unregister(Self); +end; + +function TdxCustomGridRecordHelper.Adapter: TdxCustomGridTableViewAdapter; +begin + Result := FAdapter; +end; + +class function TdxCustomGridRecordHelper.ProducerClass: TdxGridTableViewCustomDataRowProducerClass; +begin + Result := TdxGridTableViewCustomDataRowProducer; +end; + +class function TdxCustomGridRecordHelper.RecordClass: TcxCustomGridRecordClass; +begin + Result := TcxCustomGridRecord; +end; + +{$IFDEF DXVER500} + +function TdxCustomGridRecordHelper.GetCanCellMergingAsMaster: Boolean; +begin + Result := True; +end; + +function TdxCustomGridRecordHelper.GetCanCellMergingAsSlave: Boolean; +begin + Result := True; +end; + +{$ENDIF} + +function TdxCustomGridRecordHelper.GetHasDetails: Boolean; +begin + Result := False; +end; + +{$IFDEF DXVER500} + +function TdxCustomGridRecordHelper.GetHasExpandButton: Boolean; +begin + Result := False; +end; + +{$ENDIF} + +function TdxCustomGridRecordHelper.GetHasSelectedChildren: Boolean; +begin + Result := False; +end; + +{$IFDEF DXVER500} + +function TdxCustomGridRecordHelper.GetIsCellMergingSeparator: Boolean; +begin + Result := False; +end; + +{$ENDIF} + +function TdxCustomGridRecordHelper.GetParent: TcxCustomGridRecord; +var + I: Integer; +begin + for I := GridRecord.Index - 1 downto 0 do + begin + Result := Adapter.Records[I]; + if CustomGridRecord_GetIsParent(Result) and (Result.Level < GridRecord.Level) then + Exit; + end; + Result := nil; +end; + +{ TdxCustomGridRowHelper } + +function TdxCustomGridRowHelper.Adapter: TdxGridTableViewAdapter; +begin + Result := inherited Adapter as TdxGridTableViewAdapter; +end; + +class function TdxCustomGridRowHelper.RecordClass: TcxCustomGridRecordClass; +begin + Result := TcxCustomGridRow; +end; + +{ TdxGridDataRowHelper } + +class function TdxGridDataRowHelper.ProducerClass: TdxGridTableViewCustomDataRowProducerClass; +begin + Result := TdxGridTableViewDataRowProducer; +end; + +class function TdxGridDataRowHelper.RecordClass: TcxCustomGridRecordClass; +begin + Result := TcxGridDataRow; +end; + +function TdxGridDataRowHelper.GetRow: TcxGridDataRow; +begin + Result := inherited GridRecord as TcxGridDataRow; +end; + +{ TdxGridGroupRowHelper } + +class function TdxGridGroupRowHelper.ProducerClass: TdxGridTableViewCustomDataRowProducerClass; +begin + Result := TdxGridTableViewGroupRowProducer; +end; + +class function TdxGridGroupRowHelper.RecordClass: TcxCustomGridRecordClass; +begin + Result := TcxGridGroupRow; +end; + +{$IFDEF DXVER500} + +function TdxGridGroupRowHelper.GetCanCellMergingAsMaster: Boolean; +begin + Result := False; +end; + +function TdxGridGroupRowHelper.GetCanCellMergingAsSlave: Boolean; +begin + Result := False; +end; + +function TdxGridGroupRowHelper.GetHasExpandButton: Boolean; +begin + Result := not (dcoGroupsAlwaysExpanded in Adapter.DataController.Options); +end; + +{$ENDIF} + +function TdxGridGroupRowHelper.GetHasSelectedChildren: Boolean; +var + GroupLevel, I: Integer; + Row: TcxCustomGridRow; +begin + GroupLevel := GroupRow.Level; + for I := GroupRow.Index + 1 to Adapter.RowCount - 1 do + begin + Row := Adapter.Rows[I]; + if Row.Level <= GroupLevel then Break; + Result := Row.Selected or Adapter.RecordHelpers[Row].HasSelectedChildren; //!!! + if Result then Exit; + end; + Result := False; +end; + +function TdxGridGroupRowHelper.GetGroupRow: TcxGridGroupRow; +begin + Result := inherited GridRecord as TcxGridGroupRow; +end; + +{ TdxGridMasterDataRowHelper } + +class function TdxGridMasterDataRowHelper.ProducerClass: TdxGridTableViewCustomDataRowProducerClass; +begin + Result := TdxGridTableViewMasterRowProducer; +end; + +class function TdxGridMasterDataRowHelper.RecordClass: TcxCustomGridRecordClass; +begin + Result := TcxGridMasterDataRow; +end; + +{$IFDEF DXVER500} + +function TdxGridMasterDataRowHelper.GetCanCellMergingAsMaster: Boolean; +begin + Result := not MasterRow.Expanded; +end; + +{$ENDIF} + +function TdxGridMasterDataRowHelper.GetHasDetails: Boolean; +begin + Result := MasterRow.Expanded;// and MasterRow.ActiveDetailGridViewExists //!!! +end; + +{$IFDEF DXVER500} + +function TdxGridMasterDataRowHelper.GetHasExpandButton: Boolean; +begin + Result := True; +end; + +{$ENDIF} + +function TdxGridMasterDataRowHelper.GetHasSelectedChildren: Boolean; +begin + Result := MasterRow.Expanded; + if Result then + with dxGridViewBuildersFactory.CreateViewAdapter(Adapter, DetailView) do + try + Result := HasSelectedRecords; + finally + Free; + end; +end; + +{$IFDEF DXVER500} + +function TdxGridMasterDataRowHelper.GetIsCellMergingSeparator: Boolean; +begin + Result := MasterRow.Expanded; +end; + +{$ENDIF} + +function TdxGridMasterDataRowHelper.GetDetailView: TcxCustomGridView; +begin + if HasDetails then + Result := MasterRow.ActiveDetailGridView + else + Result := nil; +end; + +function TdxGridMasterDataRowHelper.GetMasterRow: TcxGridMasterDataRow; +begin + Result := inherited GridRecord as TcxGridMasterDataRow; +end; + +{ TdxRecordHelpersCache } + +constructor TdxRecordHelpersCache.Create(AAdapter: TdxCustomGridTableViewAdapter); +begin + inherited Create; + FAdapter := AAdapter; +end; + +function TdxRecordHelpersCache.IndexOf(ARecord: TcxCustomGridRecord): Integer; +begin + for Result := 0 to Count - 1 do + if Items[Result].RecordClass = ARecord.ClassType then + Exit; + + Result := Add(dxRecordHelpersFactory.HelperClasses[ARecord].Create(Adapter)); +end; + +function TdxRecordHelpersCache.GetHelper(ARecord: TcxCustomGridRecord): TdxCustomGridRecordHelper; +begin + Result := Items[IndexOf(ARecord)]; + Result.GridRecord := ARecord; +end; + +function TdxRecordHelpersCache.GetItem(Index: Integer): TdxCustomGridRecordHelper; +begin + Result := TdxCustomGridRecordHelper(inherited Items[Index]); +end; + +{ TdxProducerCache } + +constructor TdxProducerCache.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited Create; + FBuilder := ABuilder; +end; + +function TdxProducerCache.IndexOf(AProducerClass: TdxGridViewRowProducerClass): Integer; +begin + for Result := 0 to Count - 1 do + if Items[Result].ClassType = AProducerClass then Exit; + + Result := Add(AProducerClass.Create(Builder)); +end; + +function TdxProducerCache.GetProducer(ProducerClass: TdxGridViewRowProducerClass): TdxGridViewRowProducer; +begin + Result := Items[IndexOf(ProducerClass)]; +end; + +function TdxProducerCache.GetItem(Index: Integer): TdxGridViewRowProducer; +begin + Result := inherited Items[Index] as TdxGridViewRowProducer; +end; + +{ TdxCustomGridViewAdapter } + +constructor TdxCustomGridViewAdapter.Create(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView); +begin + inherited Create; + FMasterAdapter := AMasterAdapter; + FGridView := AGridView; + FGridView.SizeChanged(True, True); //!? +end; + +function TdxCustomGridViewAdapter.GridView: TcxCustomGridView; +begin + Result := FGridView; +end; + +class function TdxCustomGridViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridView; +end; + +function TdxCustomGridViewAdapter.Styles: TcxCustomGridStyles; +begin + Result := CustomGridView_GetStyles(GridView); +end; + +procedure TdxCustomGridViewAdapter.ExpandAllRows(AnOptionsExpanding: TdxGridReportLinkOptionsExpanding; + ARecursive: Boolean); +begin + Grid.BeginUpdate; + try + ExpandAllRowsInLevel(GridLevel, AnOptionsExpanding.ExpandMasterRows, + AnOptionsExpanding.ExpandGroupRows, ARecursive); + finally + Grid.EndUpdate; + end; +end; + +procedure TdxCustomGridViewAdapter.AfterBuilding; +begin + //GridView.CancelUpdate; +end; + +procedure TdxCustomGridViewAdapter.BeforeBuilding; +begin + //GridView.BeginUpdate; +end; + +function TdxCustomGridViewAdapter.BackgroundBitmaps: TcxCustomGridBackgroundBitmaps; +begin + Result := CustomGridView_GetBackgroundBitmaps(GridView); +end; + +function TdxCustomGridViewAdapter.GetBackgroundBitmap(Index: Integer): TBitmap; +begin + if IsBackgroundBitmapSupported(Index) then + Result := BackgroundBitmaps.GetBitmap(Index) + else + Result := nil +end; + +function TdxCustomGridViewAdapter.HasBackgroundBitmap(Index: Integer): Boolean; +var + Bitmap: TBitmap; +begin + Bitmap := BackgroundBitmaps.GetBitmap(Index); + Result := (Bitmap <> nil) and not Bitmap.Empty; +end; + +function TdxCustomGridViewAdapter.IsBackgroundBitmapSupported(Index: Integer): Boolean; +begin + Result := Index <> bbTabs; +end; + +function TdxCustomGridViewAdapter.Controller: TcxCustomGridController; +begin + Result := GridView.Controller; +end; + +function TdxCustomGridViewAdapter.DataController: TcxCustomDataController; +begin + Result := CustomGridView_GetDataController(GridView); +end; + +function TdxCustomGridViewAdapter.CreateCloneAdapter(AClone: TcxCustomGridView): TdxCustomGridViewAdapter; +begin + Result := dxGridViewBuildersFactory.CreateViewAdapter(MasterAdapter, AClone); +end; + +procedure TdxCustomGridViewAdapter.ExpandAllRowsInGridView(AGridView: TcxCustomGridView; + AMasterRows, AGroupRows: Boolean); +begin + if AGridView = nil then Exit; + with dxGridViewBuildersFactory.CreateViewAdapter(nil, AGridView) do + try + ExpandAllRowsInItself(AMasterRows, AGroupRows); + ExpandAllRowsInClones(AMasterRows, AGroupRows); + finally + Free; + end; +end; + +procedure TdxCustomGridViewAdapter.ExpandAllRowsInClones(AMasterRows, AGroupRows: Boolean); +var + I: Integer; + Clone: TcxCustomGridView; +begin + for I := 0 to GridView.CloneCount - 1 do + begin + Clone := GridView.Clones[I]; + with CreateCloneAdapter(Clone) do + try + ExpandAllRowsInGridView(Clone, AMasterRows, AGroupRows); + finally + Free; + end; + end; +end; + +procedure TdxCustomGridViewAdapter.ExpandAllRowsInLevel(ALevel: TcxGridLevel; + AMasterRows, AGroupRows: Boolean; ARecursive: Boolean); +var + I: Integer; +begin + ExpandAllRowsInGridView(ALevel.GridView, AMasterRows, AGroupRows); + if ARecursive then + for I := 0 to ALevel.VisibleCount - 1 do + ExpandAllRowsInLevel(ALevel.VisibleItems[I], AMasterRows, AGroupRows, ARecursive); +end; + +procedure TdxCustomGridViewAdapter.ExpandAllRowsInItself(AMasterRows, AGroupRows: Boolean); +begin +end; + +function TdxCustomGridViewAdapter.GetAreAllMasterRowsCollapsed: Boolean; +begin + Result := True; +end; + +function TdxCustomGridViewAdapter.GetAutoWidth: Boolean; +begin + Result := False; +end; + +function TdxCustomGridViewAdapter.GetCanUseOnEveryPageMode: Boolean; +begin + Result := False; +end; + +{$IFDEF DXVER500} +function TdxCustomGridViewAdapter.GetFilterPosition: TcxGridFilterPosition; +begin + Result := fpBottom; +end; +{$ENDIF} + +function TdxCustomGridViewAdapter.GetHasSelectedRecords: Boolean; +begin + Result := False; +end; + +function TdxCustomGridViewAdapter.GetIndentCount: Integer; +begin + Result := Ord(IsMaster); +end; + +function TdxCustomGridViewAdapter.GetIndentWidth: Integer; +begin + Result := DefaultIndentWidth; +end; + +function TdxCustomGridViewAdapter.GetIsOffice11StyleGrouping: Boolean; +begin + Result := False; +end; + +function TdxCustomGridViewAdapter.GetMasterGridRecord: TcxCustomGridRecord; +begin + Result := nil; +end; + +function TdxCustomGridViewAdapter.GetRecordCount: Integer; +begin + Result := 0; +end; + +function TdxCustomGridViewAdapter.GetViewWidthExtra: Integer; +begin + Result := Ord(IsMaster) * IndentWidth; +end; + +function TdxCustomGridViewAdapter.GetCaptionViewParams: TcxViewParams; +var + Level: TcxGridLevel; +begin + if MasterAdapter = nil then + if GridView.MasterGridView <> nil then + begin + Level := GridView.MasterGridView.Level as TcxGridLevel; + Level.Styles.GetTabParams({$IFDEF DXVER500} MasterGridRecord, {$ENDIF} GridLevel, Result); + end + else + Result := GetRootCaptionParams + else + MasterAdapter.GridLevel.Styles.GetTabParams({$IFDEF DXVER500} MasterGridRecord, {$ENDIF} GridLevel, Result); +end; + +function TdxCustomGridViewAdapter.GetFilterBarViewParams: TcxViewParams; +begin + Result.Color := clBtnShadow; + Result.Font := nil; + Result.TextColor := clWindow; +end; + +function TdxCustomGridViewAdapter.GetRootCaptionParams: TcxViewParams; +begin + Grid.RootLevelStyles.GetTabParams({$IFDEF DXVER500} nil, {$ENDIF} GridLevel, Result); +end; + +function TdxCustomGridViewAdapter.GetAbsoluteLevel: Integer; +begin + Result := GridLevel.Level; +end; + +function TdxCustomGridViewAdapter.GetCanUseLookAndFeelColors: Boolean; +begin + Result := Grid.LookAndFeel.NativeStyle and dxThemeManager.AreVisualStylesAvailable; +end; + +function TdxCustomGridViewAdapter.GetCaptionText: string; +begin + Result := GridLevel.DisplayCaption; +end; + +function TdxCustomGridViewAdapter.GetDetailsSeparatorColor: TColor; +begin + Result := MasterGridLevel.Options.DetailFrameColor; +end; + +function TdxCustomGridViewAdapter.GetDetailsSeparatorThickness: Integer; +begin + Result := MasterGridLevel.Options.DetailFrameWidth; +end; + +function TdxCustomGridViewAdapter.GetFilter: TcxDataFilterCriteria; +begin + Result := DataController.Filter; +end; + +function TdxCustomGridViewAdapter.GetFilterActive: Boolean; +begin + Result := Filter.Active; +end; + +function TdxCustomGridViewAdapter.GetFilterEmpty: Boolean; +begin + Result := Filter.FilterText = ''; +end; + +function TdxCustomGridViewAdapter.GetFilterText: string; +begin + Result := Filter.FilterCaption; + if Result = '' then + Result := cxGetResourceString(@scxGridFilterIsEmpty); +end; + +function TdxCustomGridViewAdapter.GetGrid: TcxCustomGrid; +begin + Result := GridView.Control as TcxCustomGrid; +end; + +function TdxCustomGridViewAdapter.GetGridLevel: TcxGridLevel; +begin + Result := GridView.Level as TcxGridLevel; +end; + +function TdxCustomGridViewAdapter.GetGridWidth: Integer; +begin + with Grid.ClientRect do + Result := Right - Left; +end; + +function TdxCustomGridViewAdapter.GetHasDetailsSeparator: Boolean; +begin + Result := DetailsSeparatorThickness <> 0; +end; + +function TdxCustomGridViewAdapter.GetLookAndFeelKind: TcxLookAndFeelKind; +begin + Result := Grid.LookAndFeel.Kind; +end; + +function TdxCustomGridViewAdapter.GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := Grid.LookAndFeelPainter; +end; + +function TdxCustomGridViewAdapter.GetIsDetail: Boolean; +begin + Result := GridView.IsDetail; +end; + +function TdxCustomGridViewAdapter.GetIsMaster: Boolean; +begin + Result := GridView.IsMaster; +end; + +function TdxCustomGridViewAdapter.GetMasterGridLevel: TcxGridLevel; +begin + Result := GridLevel.Parent; +end; + +function TdxCustomGridViewAdapter.GetSummary: TcxDataSummary; +begin + Result := DataController.Summary; +end; + +function TdxCustomGridViewAdapter.GetThemedCaptionColor: TColor; +begin + Result := LookAndFeelPainter.DefaultTabColor; +end; + +function TdxCustomGridViewAdapter.GetThemedCaptionTextColor: TColor; +begin + Result := LookAndFeelPainter.DefaultTabTextColor; +end; + +function TdxCustomGridViewAdapter.GetThemedFilterBarColor: TColor; +begin + Result := LookAndFeelPainter.DefaultFilterBoxColor; +end; + +function TdxCustomGridViewAdapter.GetThemedFilterBarTextColor: TColor; +begin + Result := LookAndFeelPainter.DefaultFilterBoxTextColor; +end; + +function TdxCustomGridViewAdapter.GetViewWidth: Integer; +begin + Result := GridView.Control.Width; +end; + +{ TdxCustomGridViewFormatter } + +constructor TdxCustomGridViewFormatter.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited Create; + FBuilder := ABuilder; + + FLookAndFeelItems := TList.Create; + FExpandButtons := TList.Create; + FFont := TFont.Create; + + FTransparentColor := dxPSCore.dxDefaultContentColor; +end; + +destructor TdxCustomGridViewFormatter.Destroy; +begin + FreeAndNil(FFont); + FreeAndNil(FExpandButtons); + FreeAndNil(FLookAndFeelItems); + inherited; +end; + +function TdxCustomGridViewFormatter.Builder: TdxCustomGridViewBuilder; +begin + Result := FBuilder; +end; + +function TdxCustomGridViewFormatter.Adapter: TdxCustomGridViewAdapter; +begin + Result := Builder.Adapter; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeHost(AHost: TdxReportCell); +begin + AHost.CellSides := []; + AHost.Data := Integer(Adapter.GridView); + AHost.Transparent := True; +end; + +function TdxCustomGridViewFormatter.GetHostClass: TdxReportCellClass; +begin + Result := TdxReportCell; {Host} +end; + +function TdxCustomGridViewFormatter.GetRowHostClass: TdxReportCellClass; +begin + Result := TdxReportCell; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeCaption(ACaption: TdxReportCellText); +begin + SetViewParams(ACaption, GetCaptionViewParams); + if HasBackgroundBitmap(bbTabs) then + ACaption.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbTabs); + RegisterLookAndFeelItem(ACaption, cesRaised); + ACaption.Data := Integer(TdxGridLevelCaption); + ACaption.Text := Adapter.CaptionText; + ACaption.HidePrefix := True; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeCaptionRow(ARow: TdxReportCell); +begin +end; + +procedure TdxCustomGridViewFormatter.DoReportLinkInitializeCaption(ACaption: TdxReportCellText); +begin + ReportLink.DoInitializeLevelCaption(Adapter.GridView, TdxReportCellString(ACaption)); +end; + +function TdxCustomGridViewFormatter.GetCaptionClass: TdxReportCellTextClass; +begin + Result := TdxReportCellString; +end; + +function TdxCustomGridViewFormatter.GetCaptionViewParams: TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetCaptionParams(Adapter.GridLevel, Result.NativeParams) + else + Result.NativeParams := Adapter.GetCaptionViewParams; + + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + begin + Result.NativeParams.Color := Adapter.ThemedCaptionColor; + Result.NativeParams.TextColor := Adapter.ThemedCaptionTextColor; + end; + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.FixedTransparent; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeFilterBar(AFilterBar: TdxReportCellText); +begin + SetViewParams(AFilterBar, GetFilterBarViewParams); + if HasBackgroundBitmap(bbFilterBox) then + AFilterBar.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbFilterBox); + + with AFilterBar do + begin + Data := Integer(TdxGridFilterBar); + EndEllipsis := True; + Text := Adapter.FilterText; + end; + + if not Adapter.FilterEmpty then + with TdxReportCellCheck(AFilterBar) do + begin + Checked := Adapter.FilterActive; + CheckPos := ccpLeft; + end; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeFilterBarRow(ARow: TdxReportCell); +begin +end; + +procedure TdxCustomGridViewFormatter.DoReportLinkInitializeFilterBar(AFilterBar: TdxReportCellText); +begin + ReportLink.DoInitializeFilterBar(TcxCustomGridTableView(Adapter.GridView), TdxReportCellString(AFilterBar)); +end; + +function TdxCustomGridViewFormatter.GetFilterBarClass: TdxReportCellTextClass; +const + CheckClasses: array[Boolean] of TdxReportCellTextClass = (TdxReportCellCheck, TdxReportCellString); +begin + Result := CheckClasses[Adapter.FilterEmpty]; +end; + +function TdxCustomGridViewFormatter.GetFilterBarViewParams: TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetFilterBarParams(Result.NativeParams) + else + Result.NativeParams := Adapter.GetFilterBarViewParams; + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + begin + Result.NativeParams.Color := Adapter.ThemedCaptionColor; + Result.NativeParams.TextColor := Adapter.ThemedCaptionTextColor; + end; + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.FixedTransparent; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeDetailsSeparatorRow(ARow: TdxReportCell); +begin +end; + +procedure TdxCustomGridViewFormatter.DoInitializeHorzDetailsSeparator(ASeparator: TdxReportCellBox); +begin + with ASeparator do + begin + CellSides := csTopBottom; + Color := DetailsSeparatorColor; + Transparent := False; + end; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeVertBottomDetailsSeparator(ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); +begin + DoInitializeVertDetailsSeparator(ASeparator, ASeparatorKind); + case ASeparatorKind of + vdskLeading: + ASeparator.CellSides := [csLeft, csBottom]; + vdskTrailing: + ASeparator.CellSides := [csRight, csBottom]; + end; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeVertDetailsSeparator(ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); +begin + with ASeparator do + begin + CellSides := [csLeft, csRight]; + Color := DetailsSeparatorColor; + Transparent := False; + end; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeVertTopDetailsSeparator(ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); +begin + DoInitializeVertDetailsSeparator(ASeparator, ASeparatorKind); + case ASeparatorKind of + vdskLeading: + ASeparator.CellSides := [csLeft, csTop]; + vdskTrailing: + ASeparator.CellSides := [csRight, csTop]; + end; +end; + +function TdxCustomGridViewFormatter.GetDetailsSeparatorClass: TdxReportCellBoxClass; +begin + Result := TdxReportCellBox; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeMasterIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer); +begin +end; + +function TdxCustomGridViewFormatter.GetMasterIndentClass: TdxReportCellExpandButtonClass; +begin + Result := TdxReportCellExpandButton; +end; + +procedure TdxCustomGridViewFormatter.DoInitializeViewTerminator(ATerminator: TdxReportCellBox); +begin + ATerminator.CellSides := [csBottom]; + ATerminator.Transparent := True; +end; + +function TdxCustomGridViewFormatter.QueryInterface(const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +function TdxCustomGridViewFormatter._AddRef: Integer; +begin + Result := 1; +end; + +function TdxCustomGridViewFormatter._Release: Integer; +begin + Result := 1; +end; + +procedure TdxCustomGridViewFormatter.AddDelimiters; +begin + AddHorizontalDelimiters; + AddVerticalDelimiters; +end; + +procedure TdxCustomGridViewFormatter.AddHorizontalDelimiters; +begin +end; + +procedure TdxCustomGridViewFormatter.AddVerticalDelimiters; +var + I: Integer; +begin + if ReportLink.OptionsPagination.Row then + for I := 0 to Builder.ReportRowCount - 1 do + ReportLink.AddVerticalDelimiter(Builder.ReportRows[I]); +end; + +procedure TdxCustomGridViewFormatter.AfterBuilding; +begin + Adapter.AfterBuilding; + FormatLookAndFeelItems; + FormatExpandButtons; + AddDelimiters; +end; + +procedure TdxCustomGridViewFormatter.BeforeBuilding; +begin + Adapter.BeforeBuilding; + Calculate; +end; + +procedure TdxCustomGridViewFormatter.Calculate; +begin + CalculateLineHeights; +end; + +procedure TdxCustomGridViewFormatter.CalculateLineHeights; +begin + CaptionLineHeight := 2 * TabsAreaOffset + CalculateFontHeight(GetCaptionViewParams); + FilterBarLineHeight := 2 * FilterBarTextOffset + CalculateFontHeight(GetFilterBarViewParams); +end; + +function TdxCustomGridViewFormatter.GetDetailsSeparatorColor: TColor; +begin + Result := Adapter.DetailsSeparatorColor; + {with ReportLink.OptionsFormatting do + if UseNativeStyles then + begin + Result := FixedColor; + end;} +end; + +function TdxCustomGridViewFormatter.GetDetailsSeparatorThickness: Integer; +begin + Result := Adapter.DetailsSeparatorThickness; +end; + +function TdxCustomGridViewFormatter.GetHasDetailsSeparator: Boolean; +begin + Result := Adapter.HasDetailsSeparator; +end; + +function TdxCustomGridViewFormatter.GetSiteHeight: Integer; +var + ControllerIntf: IdxReportLinkController; +begin + if ReportLink.IsAggregated and + Supports(TObject(ReportLink.Controller), IdxReportLinkController, ControllerIntf) then + with ControllerIntf.GetControlSiteBounds(ReportLink.Grid) do + Result := Bottom - Top - 1 + else + with ReportLink.RealPrinterPage.PaintRectPixels do + Result := Bottom - Top - 1; +end; + +function TdxCustomGridViewFormatter.GetSiteWidth: Integer; +var + ControllerIntf: IdxReportLinkController; +begin + if ReportLink.IsAggregated and + Supports(TObject(ReportLink.Controller), IdxReportLinkController, ControllerIntf) then + with ControllerIntf.GetControlSiteBounds(ReportLink.Grid) do + Result := Right - Left - 1 + else + with ReportLink.RealPrinterPage.PaintRectPixels do + Result := Right - Left - 1; +end; + +function TdxCustomGridViewFormatter.GetViewWidth: Integer; +begin + Result := 0; +end; + +function TdxCustomGridViewFormatter.GetViewWidthExtraAfter: Integer; +var + I: Integer; +begin + Result := 0; + + for I := 0 to AbsoluteLevel - 1 do + with Builder.AbsoluteBuilders[I].Adapter do + if HasDetailsSeparator then Inc(Result, DetailsSeparatorThickness); + + if Adapter.HasDetailsSeparator then + Inc(Result, Adapter.DetailsSeparatorThickness); +end; + +function TdxCustomGridViewFormatter.GetViewWidthExtraBefore: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to AbsoluteLevel - 1 do + with Builder.AbsoluteBuilders[I].Adapter do + begin + Inc(Result, ViewWidthExtra); + if HasDetailsSeparator then Inc(Result, DetailsSeparatorThickness); + end; + + if Adapter.HasDetailsSeparator then + Inc(Result, Adapter.DetailsSeparatorThickness); +end; + +function TdxCustomGridViewFormatter.BackgroundBitmaps: TcxCustomGridBackgroundBitmaps; +begin + Result := Adapter.BackgroundBitmaps; +end; + +function TdxCustomGridViewFormatter.GetBackgroundBitmap(Index: Integer): TBitmap; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + Result := ReportLink.Styles.GetBitmap(MapStyleBackgroundBitmapIndex(Index)) + else + Result := Adapter.GetBackgroundBitmap(Index); +end; + +function TdxCustomGridViewFormatter.GetBackgroundBitmapIndex(Index: Integer): Integer; +begin + Result := ReportLink.AddBackgroundBitmapToPool(GetBackgroundBitmap(Index)); +end; + +function TdxCustomGridViewFormatter.HasBackgroundBitmap(Index: Integer): Boolean; +var + Bitmap: TBitmap; +begin + if not ReportLink.OptionsFormatting.SuppressBackgroundBitmaps then + begin + Bitmap := GetBackgroundBitmap(Index); + Result := (Bitmap <> nil) and not Bitmap.Empty; + end + else + Result := False; +end; + +function TdxCustomGridViewFormatter.MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; +begin + case AGridBackgroundBitmapIndex of + bbTabs: + Result := vspsGridCaption; + bbContent: + Result := vspsGridContent; + bbFilterBox: + Result := vspsGridFilterBar; + else + Result := 0; + end; +end; + +function TdxCustomGridViewFormatter.CalculateFontHeight(const AParams: TdxReportItemViewParams): Integer; +begin + Result := Renderer.CalcTextPatternHeight(DC, AParams.NativeParams.Font); +end; + +procedure TdxCustomGridViewFormatter.CalculateHeight(const AParams: TdxReportItemViewParams; + var AHeight: Integer); +var + Value: Integer; +begin + Value := CalculateFontHeight(AParams); + if Value > AHeight then AHeight := Value; +end; + +function TdxCustomGridViewFormatter.GetStyleFontIndex(const AParams: TdxReportItemViewParams): Integer; +begin + if AParams.NativeParams.Font <> nil then + begin + FFont.Assign(AParams.NativeParams.Font); + if not dxPSUtl.dxIsTrueTypeFont(FFont) then + FFont.Name := ReportLink.Font.Name; + FFont.Color := ColorToRGB(AParams.NativeParams.TextColor); + FFont.Style := FFont.Style + AParams.FontStyle; + Result := ReportLink.AddFontToPool(FFont); + end + else + Result := 0; +end; + +function TdxCustomGridViewFormatter.IsColorTransparent(AColor: TColor): Boolean; +begin + Result := ColorToRGB(AColor) = ColorToRGB(TransparentColor); +end; + +procedure TdxCustomGridViewFormatter.RegisterExpandButton(AExpandButton: TdxReportCellExpandButton); +begin + FExpandButtons.Add(AExpandButton); +end; + +procedure TdxCustomGridViewFormatter.RegisterLookAndFeelItem(AnItem: TdxReportVisualItem; + AEdgeStyle: TdxCellEdgeStyle); +begin + AnItem.EdgeMode := Self.EdgeMode; + AnItem.Edge3DStyle := AEdgeStyle; + FLookAndFeelItems.Add(AnItem); +end; + +procedure TdxCustomGridViewFormatter.SetViewParams(AnItem: TdxReportVisualItem; + const AParams: TdxReportItemViewParams); +begin + AnItem.CellSides := AParams.CellSides; + AnItem.Color := ColorToRGB(AParams.NativeParams.Color); + AnItem.FontIndex := GetStyleFontIndex(AParams); + AnItem.Transparent := AParams.Transparent; +end; + +function TdxCustomGridViewFormatter.GetAbsoluteLevel: Integer; +begin + Result := Adapter.AbsoluteLevel; + if ReportLink.OptionsDetails.StartFromFocusedView then + Dec(Result, (ReportLink.ActiveView.Level as TcxGridLevel).Level); +end; + +function TdxCustomGridViewFormatter.GetAutoWidth: Boolean; +begin + Result := ReportLink.OptionsSize.AutoWidth or Adapter.AutoWidth; +end; + +function TdxCustomGridViewFormatter.GetDC: HDC; +begin + Result := ReportLink.ScreenDC; +end; + +function TdxCustomGridViewFormatter.GetEdgeMode: TdxCellEdgeMode; +const + EdgeModeMap: array[Boolean] of TdxCellEdgeMode = (cemPattern, cem3DEffects); +begin + Result := EdgeModeMap[ReportLink.OptionsFormatting.LookAndFeelKind <> lfUltraFlat]; +end; + +{$IFDEF DXVER500} +function TdxCustomGridViewFormatter.GetFilterBarPosition: TcxGridFilterPosition; +begin + Result := Adapter.FilterPosition; +end; +{$ENDIF} + +function TdxCustomGridViewFormatter.GetGridWidth: Integer; +begin + Result := Adapter.GridWidth; +end; + +function TdxCustomGridViewFormatter.GetExpandButton(Index: Integer): TdxReportCellExpandButton; +begin + Result := TdxReportCellExpandButton(FExpandButtons[Index]); +end; + +function TdxCustomGridViewFormatter.GetExpandButtonCount: Integer; +begin + Result := FExpandButtons.Count; +end; + +function TdxCustomGridViewFormatter.GetIndentWidth: Integer; +begin + Result := Adapter.IndentWidth; +end; + +function TdxCustomGridViewFormatter.GetLookAndFeelItem(Index: Integer): TdxReportVisualItem; +begin + Result := TdxReportVisualItem(FLookAndFeelItems[Index]); +end; + +function TdxCustomGridViewFormatter.GetLookAndFeelItemCount: Integer; +begin + Result := FLookAndFeelItems.Count; +end; + +function TdxCustomGridViewFormatter.GetPaginateByTopLevelGroups: Boolean; +begin + Result := ReportLink.OptionsPagination.TopLevelGroup; +end; + +function TdxCustomGridViewFormatter.GetRenderer: TdxPSReportRenderer; +begin + Result := ReportLink.Renderer; +end; + +function TdxCustomGridViewFormatter.GetReportLink: TdxGridReportLink; +begin + Result := Builder.ReportLink; +end; + +function TdxCustomGridViewFormatter.GetShowCaption: Boolean; +begin + Result := ReportLink.OptionsView.Caption; +end; + +function TdxCustomGridViewFormatter.GetShowFilterBar: Boolean; +begin + Result := ReportLink.OptionsView.FilterBar; +end; + +function TdxCustomGridViewFormatter.GetUseLookAndFeelColors: Boolean; +begin + Result := ReportLink.OptionsFormatting.UseLookAndFeelColors; +end; + +function TdxCustomGridViewFormatter.GetViewAvailableWidth: Integer; +begin + if ReportLink.OptionsSize.AutoWidth then + Result := SiteWidth + else + Result := Adapter.ViewWidth; + Dec(Result, ViewWidthExtraBefore + ViewWidthExtraAfter); +end; + +function TdxCustomGridViewFormatter.GetViewWidthExtra: Integer; +begin + Result := Adapter.ViewWidthExtra; +end; + +procedure TdxCustomGridViewFormatter.FormatLookAndFeelItems; +const + Borders3D: array[TdxCellEdgeStyle, Boolean] of TdxPSCellBorderClass = + ((TdxPSCellRaisedBorder, TdxPSCellRaisedSoftBorder), + (TdxPSCellSunkenBorder, TdxPSCellSunkenSoftBorder)); +var + I: Integer; +begin + for I := 0 to LookAndFeelItemCount - 1 do + with LookAndFeelItems[I] do + if ReportLink.Effects3D then + BorderClass := Borders3D[Edge3DStyle, ReportLink.Soft3D] + else + BorderClass := TdxPSCellUltraFlatBorder; +end; + +procedure TdxCustomGridViewFormatter.FormatExpandButtons; +var + I: Integer; +begin + for I := 0 to ExpandButtonCount - 1 do + with ExpandButtons[I] do + begin + ButtonBorder3D := ReportLink.Effects3D; + ButtonBorder3DSoft := ReportLink.Soft3D; + end; +end; + +{ TdxCustomGridViewBuilder } + +constructor TdxCustomGridViewBuilder.Create(AReportLink: TdxGridReportLink; + AMasterBuilder: TdxCustomGridViewBuilder; AGridView: TcxCustomGridView); + + function GetMasterAdapter: TdxCustomGridViewAdapter; + begin + if AMasterBuilder = nil then + Result := nil + else + Result := AMasterBuilder.Adapter; + end; + +begin + inherited Create; + FReportLink := AReportLink; + FMasterBuilder := AMasterBuilder; + FGridView := AGridView; + + FAdapter := CreateAdapter(GetMasterAdapter, GridView); + FFormatter := FormatterClass.Create(Self); + FProducerCache := TdxProducerCache.Create(Self); + FReportRows := TList.Create; + + if MasterBuilder <> nil then + MasterBuilder.FDetailsBuilder := Self; +end; + +destructor TdxCustomGridViewBuilder.Destroy; +begin + if MasterBuilder <> nil then + MasterBuilder.FDetailsBuilder := nil; + FreeAndNil(FReportRows); + FreeAndNil(FProducerCache); + FreeAndNil(FFormatter); + FreeAndNil(FAdapter); + inherited; +end; + +function TdxCustomGridViewBuilder.Adapter: TdxCustomGridViewAdapter; +begin + Result := FAdapter; +end; + +class function TdxCustomGridViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxCustomGridViewAdapter; +end; + +class function TdxCustomGridViewBuilder.CreateAdapter(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView): TdxCustomGridViewAdapter; +begin + Result := AdapterClass.Create(AMasterAdapter, AGridView); +end; + +function TdxCustomGridViewBuilder.Formatter: TdxCustomGridViewFormatter; +begin + Result := FFormatter; +end; + +class function TdxCustomGridViewBuilder.FormatterClass: TdxGridViewFormatterClass; +begin + Result := TdxCustomGridViewFormatter; +end; + +procedure TdxCustomGridViewBuilder.Build; +begin + BeforeBuilding; + try + DoBuild; + finally + AfterBuilding; + end; +end; + +function TdxCustomGridViewBuilder.IsAborted: Boolean; +begin + Result := ReportLink.AbortBuilding; +end; + +procedure TdxCustomGridViewBuilder.Progress(const APercentDone: Double); +begin + ReportLink.DoProgress(APercentDone); +end; + +class function TdxCustomGridViewBuilder.PairClass: TClass; +begin + Result := GridViewClass; +end; + +class procedure TdxCustomGridViewBuilder.Register; +begin + dxGridViewBuildersFactory.Register(Self); +end; + +class procedure TdxCustomGridViewBuilder.Unregister; +begin + dxGridViewBuildersFactory.Unregister(Self); +end; + +procedure TdxCustomGridViewBuilder.AddReportRow(ARow: TdxReportCell); +begin + if ARow.Parent = ReportLink.ReportCells.Cells then + FReportRows.Add(ARow); +end; + +procedure TdxCustomGridViewBuilder.AfterBuilding; +begin + if not IsAborted then Formatter.AfterBuilding; +end; + +procedure TdxCustomGridViewBuilder.BeforeBuilding; +begin + Formatter.BeforeBuilding; +end; + +procedure TdxCustomGridViewBuilder.DoBuild; +begin + DoBuildViewHeader; + DoBuildViewBody; + if not IsAborted then DoBuildViewFooter; +end; + +procedure TdxCustomGridViewBuilder.DoBuildViewBody; +begin +end; + +procedure TdxCustomGridViewBuilder.DoBuildViewFooter; +begin +end; + +procedure TdxCustomGridViewBuilder.DoBuildViewHeader; +begin +end; + +function TdxCustomGridViewBuilder.GetViewAvailableWidth: Integer; +begin + Result := Formatter.ViewAvailableWidth; +end; + +procedure TdxCustomGridViewBuilder.CreateCaption; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetCaptionProducer.Produce(HostInfoServices.CaptionHostInfo); + AddReportRow(ReportRow); +end; + +function TdxCustomGridViewBuilder.GetCaptionProducer: TdxGridViewCaptionProducer; +begin + Result := ProducerCache[GetCaptionProducerClass] as TdxGridViewCaptionProducer; +end; + +function TdxCustomGridViewBuilder.GetCaptionProducerClass: TdxGridViewCaptionProducerClass; +begin + Result := TdxGridViewCaptionProducer; +end; + +procedure TdxCustomGridViewBuilder.CreateBottomDetailsSeparator; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetDetailsBottomSeparatorProducer.Produce(HostInfoServices.LevelSeparatorBottomHostInfo); + AddReportRow(ReportRow); +end; + +procedure TdxCustomGridViewBuilder.CreateTopDetailsSeparator; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetDetailsTopSeparatorProducer.Produce(HostInfoServices.LevelSeparatorTopHostInfo); + AddReportRow(ReportRow); +end; + +function TdxCustomGridViewBuilder.GetDetailsBottomSeparatorProducer: TdxGridViewDetailsSeparatorProducer; +begin + Result := ProducerCache[GetDetailsBottomSeparatorProducerClass] as TdxGridViewDetailsSeparatorProducer; +end; + +function TdxCustomGridViewBuilder.GetDetailsBottomSeparatorProducerClass: TdxGridViewDetailsSeparatorProducerClass; +begin + Result := TdxGridViewDetailsBottomSeparatorProducer; +end; + +function TdxCustomGridViewBuilder.GetDetailsTopSeparatorProducer: TdxGridViewDetailsSeparatorProducer; +begin + Result := ProducerCache[GetDetailsTopSeparatorProducerClass] as TdxGridViewDetailsSeparatorProducer; +end; + +function TdxCustomGridViewBuilder.GetDetailsTopSeparatorProducerClass: TdxGridViewDetailsSeparatorProducerClass; +begin + Result := TdxGridViewDetailsTopSeparatorProducer; +end; + +procedure TdxCustomGridViewBuilder.CreateFilterBar; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetFilterBarProducer.Produce(HostInfoServices.FilterBarHostInfo); + AddReportRow(ReportRow); +end; + +function TdxCustomGridViewBuilder.GetFilterBarProducer: TdxGridViewFilterBarProducer; +begin + Result := ProducerCache[GetFilterBarProducerClass] as TdxGridViewFilterBarProducer; +end; + +function TdxCustomGridViewBuilder.GetFilterBarProducerClass: TdxGridViewFilterBarProducerClass; +begin + Result := TdxGridViewFilterBarProducer; +end; + +procedure TdxCustomGridViewBuilder.CreateViewTerminator; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetViewTerminatorProducer.Produce(HostInfoServices.PageDetailsHostInfo); + AddReportRow(ReportRow); +end; + +function TdxCustomGridViewBuilder.GetViewTerminatorProducer: TdxGridViewTerminatorProducer; +begin + Result := ProducerCache[GetViewTerminatorProducerClass] as TdxGridViewTerminatorProducer; +end; + +function TdxCustomGridViewBuilder.GetViewTerminatorProducerClass: TdxGridViewTerminatorProducerClass; +begin + Result := TdxGridViewTerminatorProducer; +end; + +function TdxCustomGridViewBuilder.GridView: TcxCustomGridView; +begin + Result := FGridView; +end; + +class function TdxCustomGridViewBuilder.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridView; +end; + +function TdxCustomGridViewBuilder.GetAbsoluteBuilder(AIndex: Integer): TdxCustomGridViewBuilder; +begin + Result := RootBuilder; + while AIndex > 0 do + begin + Result := Result.DetailsBuilder; + Dec(AIndex); + end; +end; + +function TdxCustomGridViewBuilder.GetAutoWidth: Boolean; +begin + Result := Formatter.AutoWidth; +end; + +function TdxCustomGridViewBuilder.GetGridLevel: TcxGridLevel; +begin + Result := GridView.Level as TcxGridLevel; +end; + +function TdxCustomGridViewBuilder.GetGrid: TcxCustomGrid; +begin + Result := ReportLink.Grid; +end; + +function TdxCustomGridViewBuilder.GetHost: TdxReportCell; +begin + Result := ReportLink.ReportCells.Cells; +end; + +function TdxCustomGridViewBuilder.GetHostInfoServices: TdxGridAttributeHostInfoServices; +begin + Result := ReportLink.HostInfoServices; +end; + +function TdxCustomGridViewBuilder.GetReportRow(Index: Integer): TdxReportCell; +begin + Result := TdxReportCell(FReportRows[Index]); +end; + +function TdxCustomGridViewBuilder.GetReportRowCount: Integer; +begin + Result := FReportRows.Count; +end; + +function TdxCustomGridViewBuilder.GetRootBuilder: TdxCustomGridViewBuilder; +begin + Result := Self; + while Result.MasterBuilder <> nil do + Result := Result.MasterBuilder; +end; + +{ TdxCustomGridTableViewAdapter } + +constructor TdxCustomGridTableViewAdapter.Create(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView); +begin + inherited; + FRecordHelpersCache := TdxRecordHelpersCache.Create(Self); + FDetailsLineCount := -1; +end; + +destructor TdxCustomGridTableViewAdapter.Destroy; +begin + FreeAndNil(FRecordHelpersCache); + inherited; +end; + +function TdxCustomGridTableViewAdapter.ForEachRecord(AProc: TdxGridTableAdapterForEachRecordProc; + AData: Integer; AProcessSelection: Boolean): Boolean; +var + I: Integer; + Continue: Boolean; + Record_: TcxCustomGridRecord; +begin + Result := True; + if @AProc = nil then Exit; + + Continue := True; + for I := 0 to RecordCount - 1 do + begin + Record_ := Records[I]; + if not AProcessSelection or Record_.Selected then + AProc(Record_, AData, Continue); + if not Continue then + begin + Result := False; + Break; + end; + end; +end; + +function TdxCustomGridTableViewAdapter.GridView: TcxCustomGridTableView; +begin + Result := inherited GridView as TcxCustomGridTableView; +end; + +class function TdxCustomGridTableViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridTableView; +end; + +function TdxCustomGridTableViewAdapter.Styles: TcxCustomGridTableViewStyles; +begin + Result := inherited Styles as TcxCustomGridTableViewStyles; +end; + +function TdxCustomGridTableViewAdapter.CalculateDetailsLineCount: Integer; +begin + Result := 1; +end; + +function TdxCustomGridTableViewAdapter.GetContentViewParams(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem): TcxViewParams; +begin + if (ATableItem <> nil) and (ATableItem.Styles <> nil) then + ATableItem.Styles.GetContentParams(ARecord, Result) + else + Styles.GetContentParams(ARecord, ATableItem, Result); + if Result.Color = clWindow then // 3.2 + Result.Color := dxPSCore.dxDefaultContentColor; +end; + +function TdxCustomGridTableViewAdapter.GetPreviewViewParams(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem): TcxViewParams; +begin + Result := GetContentViewParams(ARecord, ATableItem); +end; + +function TdxCustomGridTableViewAdapter.GetSelectionViewParams: TcxViewParams; +begin + FillChar(Result, SizeOf(Result), 0); + with Styles.Selection do + begin + Result.Bitmap := Bitmap; + Result.Color := Color; + Result.Font := Font; + Result.TextColor := TextColor; + end; +end; + +function TdxCustomGridTableViewAdapter.HasSelectionStyle: Boolean; +begin + Result := Styles.Selection <> nil; +end; + +function TdxCustomGridTableViewAdapter.Controller: TcxCustomGridTableController; +begin + Result := inherited Controller as TcxCustomGridTableController; +end; + +procedure TdxCustomGridTableViewAdapter.DoExpandMasterRow(ARecord: TcxCustomGridRecord; + AData: Integer; var AContinue: Boolean); +begin + if (ARecord is TcxGridMasterDataRow) and ARecord.Expandable then + GridMasterDataRow_DoExpand(TcxGridMasterDataRow(ARecord), True); + {begin + ARecord.Expanded := True; + with TcxGridMasterDataRow(ARecord) do + if ActiveDetailGridViewExists then + ExpandAllRowsInGridView(ActiveDetailGridView, True, Boolean(AData)); + end;} +end; + +procedure TdxCustomGridTableViewAdapter.ExpandAllGroupRows; +begin + DataController.Groups.FullExpand; +end; + +procedure TdxCustomGridTableViewAdapter.ExpandAllMasterRows(AnExpandGroups: Boolean); +begin + ForEachRecord(DoExpandMasterRow, Integer(AnExpandGroups), False); +end; + +procedure TdxCustomGridTableViewAdapter.ExpandAllRowsInItself(AMasterRows, AGroupRows: Boolean); +begin + if AGroupRows then ExpandAllGroupRows; + if AMasterRows then ExpandAllMasterRows(AGroupRows); +end; + +function TdxCustomGridTableViewAdapter.GetAreAllMasterRowsCollapsed: Boolean; +begin + Result := ForEachRecord(IsMasterRowCollapsed, 0, False); +end; + +function TdxCustomGridTableViewAdapter.GetCanUseOnEveryPageMode: Boolean; +begin + Result := RecordCount <> 0; +end; + +function TdxCustomGridTableViewAdapter.GetHasSelectedRecords: Boolean; +var + I: Integer; +begin + Result := SelectedRecordCount <> 0; + if not Result then + for I := 0 to RecordCount - 1 do + begin + Result := RecordHelpers[Records[I]].HasSelectedChildren; + if Result then Break; + end; +end; + +function TdxCustomGridTableViewAdapter.GetMasterGridRecord: TcxCustomGridRecord; +begin + Result := GridView.MasterGridRecord; +end; + +function TdxCustomGridTableViewAdapter.GetRecordCount: Integer; +begin + Result := GridView.ViewData.RecordCount; +end; + +class function TdxCustomGridTableViewAdapter.GetProperties(AnItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxCustomEditProperties; +begin + Result := AnItem.GetProperties(ARecord); + if Result = nil then + Result := GetRepositoryItem(AnItem, ARecord).Properties; +end; + +class function TdxCustomGridTableViewAdapter.GetPropertiesClass(AnItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxCustomEditPropertiesClass; +begin + Result := TcxCustomEditPropertiesClass(GetProperties(AnItem, ARecord).ClassType); +end; + +class function TdxCustomGridTableViewAdapter.GetRepositoryItem(AnItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxEditRepositoryItem; +begin + Result := AnItem.GetRepositoryItem; +end; + +procedure TdxCustomGridTableViewAdapter.IsMasterRowCollapsed(ARecord: TcxCustomGridRecord; + AData: Integer; var AContinue: Boolean); +begin + if ARecord is TcxGridMasterDataRow then + AContinue := not ARecord.Expanded; +end; + +function TdxCustomGridTableViewAdapter.GetCellAutoHeight: Boolean; +begin + Result := CustomGridTableOptionsView_GetCellAutoHeight(GridView.OptionsView); +end; + +function TdxCustomGridTableViewAdapter.GetCellMultiline: Boolean; +begin + Result := CustomGridTableOptionsView_GetCellAutoHeight(GridView.OptionsView); +end; + +{$IFDEF DXVER500} +function TdxCustomGridTableViewAdapter.GetFilterPosition: TcxGridFilterPosition; +begin + Result := CustomGridTableFiltering_GetPosition(Filtering); +end; +{$ENDIF} + +function TdxCustomGridTableViewAdapter.GetGridLineColor: TColor; +begin + Result := GridView.LookAndFeelPainter.DefaultGridLineColor; +end; + +function TdxCustomGridTableViewAdapter.GetCellEndEllipsis: Boolean; +begin + Result := GridView.OptionsView.CellEndEllipsis; +end; + +function TdxCustomGridTableViewAdapter.GetDetailsLineCount: Integer; +begin + if FDetailsLineCount = -1 then + FDetailsLineCount := CalculateDetailsLineCount; + Result := FDetailsLineCount; +end; + +function TdxCustomGridTableViewAdapter.GetFiltering: TcxCustomGridTableFiltering; +begin + Result := GridView.Filtering; +end; + +function TdxCustomGridTableViewAdapter.GetIsGridMode: Boolean; +begin + Result := DataController.IsGridMode; +end; + +function TdxCustomGridTableViewAdapter.GetRecord(Index: Integer): TcxCustomGridRecord; +begin + Result := GridView.ViewData.Records[Index]; +end; + +function TdxCustomGridTableViewAdapter.GetRecordHelper(ARecord: TcxCustomGridRecord): TdxCustomGridRecordHelper; +begin + Result := RecordHelpersCache.Helpers[ARecord]; +end; + +function TdxCustomGridTableViewAdapter.GetSelectedRecord(Index: Integer): TcxCustomGridRecord; +begin + Result := Controller.SelectedRecords[Index] +end; + +function TdxCustomGridTableViewAdapter.GetSelectedRecordCount: Integer; +begin + if CustomGridTableController_GetMultiSelect(Controller) then + Result := Controller.SelectedRecordCount + else + Result := 0; +end; + +{ TdxCustomGridTableViewFormatter } + +constructor TdxCustomGridTableViewFormatter.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited; + FRecordIndexes := TList.Create; + FSelectedRecordList := TList.Create; + //if ReportLink.OptionsSelection.ProcessSelection then BuildSelectedRecordList; {moved to BeforeBuilding in 3.03} +end; + +destructor TdxCustomGridTableViewFormatter.Destroy; +begin + FreeAndNil(FRecordIndexes); + FreeAndNil(FSelectedRecordList); + inherited; +end; + +function TdxCustomGridTableViewFormatter.Adapter: TdxCustomGridTableViewAdapter; +begin + Result := inherited Adapter as TdxCustomGridTableViewAdapter; +end; + +function TdxCustomGridTableViewFormatter.Builder: TdxCustomGridTableViewBuilder; +begin + Result := inherited Builder as TdxCustomGridTableViewBuilder; +end; + +function TdxCustomGridTableViewFormatter.IndexOfRecord(ARecord: TcxCustomGridRecord): Integer; +begin + for Result := 0 to RecordCount - 1 do + if Records[Result] = ARecord then Exit; + Result := -1; +end; + +procedure TdxCustomGridTableViewFormatter.CheckDisplayValuePost( + AProperties: TcxCustomEditProperties; ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnItem: TAbstractdxReportCellData); +var + S: string; +begin + if (ATableItem <> nil) and (ARecord <> nil) and (AnItem is TdxReportCellText) and + (AProperties.GetEditValueSource(False) = evsValue) then + begin + S := TdxReportCellText(AnItem).Text; + TcxCustomGridTableItemAccess(ATableItem).DoGetDisplayText(ARecord, S); + TdxReportCellText(AnItem).Text := S; + end; +end; + +procedure TdxCustomGridTableViewFormatter.DoInitializeItem(AnItem: TAbstractdxReportCellData; + ATableItem: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False); + + function GetContentBackgroundBitmapStyleIndex: Integer; + begin + if AnIsPreview then + Result := bbPreview + else + Result := Self.GetContentBackgroundBitmapStyleIndex(ATableItem); + end; + +var + Properties: TcxCustomEditProperties; + ViewParams: TdxReportItemViewParams; + CellValue: TcxEditValue; + ContentBackgroundBitmapStyleIndex: Integer; +begin + Properties := GetItemProperties(ATableItem, ARecord); + ViewParams := GetItemViewParams(ATableItem, ARecord, AnIsPreview); + CellValue := GetItemValue(Properties, ATableItem, ARecord); + + dxPScxCommon.dxPSDataMaps.InitializeItem(AnItem, Properties, CellValue, Self, + ViewParams, AnIsPreview, ARecord.RecordIndex, ATableItem); + CheckDisplayValuePost(Properties, ATableItem, ARecord, AnItem); + dxPScxCommon.dxPSDataMaps.GetImageLists(Properties, ReportLink.AppendImageList); + SetViewParams(AnItem, ViewParams); + + ContentBackgroundBitmapStyleIndex := GetContentBackgroundBitmapStyleIndex; + if HasBackgroundBitmap(ContentBackgroundBitmapStyleIndex) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(ContentBackgroundBitmapStyleIndex); + + AnItem.Data := Integer(ATableItem); +end; + +function TdxCustomGridTableViewFormatter.GetItemClass(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False): TdxReportCellDataClass; +begin + Result := dxPSDataMaps.ItemClass(GetItemProperties(ATableItem, ARecord), AnIsPreview); +end; + +function TdxCustomGridTableViewFormatter.GetItemProperties(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord): TcxCustomEditProperties; +begin + Result := Adapter.GetProperties(ATableItem, ARecord); +end; + +function TdxCustomGridTableViewFormatter.GetItemValue(AProperties: TcxCustomEditProperties; + ATableItem: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord): TcxEditValue; +var + S: string; +begin + if AProperties.GetEditValueSource(False) = evsValue then + Result := ARecord.Values[ATableItem.Index] + else + begin + S := ARecord.DisplayTexts[ATableItem.Index]; + TcxCustomGridTableItemAccess(ATableItem).DoGetDisplayText(ARecord, S); + Result := S; + end; +end; + +function TdxCustomGridTableViewFormatter.GetItemViewParams(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False): TdxReportItemViewParams; +begin + FillChar(Result, 0, SizeOf(Result)); + if ReportLink.OptionsFormatting.UseNativeStyles then + if CanProcessSelectionStyle(ARecord) then + ReportLink.Styles.GetSelectionParams(Result.NativeParams) + else + if AnIsPreview then + ReportLink.Styles.GetPreviewParams(ARecord, ATableItem, Result.NativeParams) + else + ReportLink.Styles.GetContentParams(ARecord, ATableItem, Result.NativeParams) + else + if CanProcessSelectionStyle(ARecord) then + Result.NativeParams := Adapter.GetSelectionViewParams + else + if AnIsPreview then + Result.NativeParams := Adapter.GetPreviewViewParams(ARecord, ATableItem) + else + Result.NativeParams := Adapter.GetContentViewParams(ARecord, ATableItem); +end; + +{ IdxPSCellParams } + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetAutoHeight: Boolean; +begin + Result := Adapter.CellAutoHeight; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetDC: HDC; +begin + Result := Self.DC; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetDisplayGraphicsAsText: Boolean; +begin + Result := ReportLink.OptionsRefinements.DisplayGraphicsAsText; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetEndEllipsis: Boolean; +begin + Result := Adapter.CellEndEllipsis; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetFlatCheckMarks: Boolean; +begin + Result := ReportLink.OptionsRefinements.FlatCheckMarks; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetGraphicsText: string; +begin + Result := ReportLink.OptionsRefinements.GraphicsText; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetMultiline: Boolean; +begin + Result := Adapter.CellMultiline; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams_GetTransparentGraphics: Boolean; +begin + Result := ReportLink.OptionsRefinements.TransparentGraphics; +end; + +{ IdxPSCellParams2 } +function TdxCustomGridTableViewFormatter.IdxPSCellParams2_GetPreviewMarginLeft: Integer; +begin + Result := dxTextSpace; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams2_GetPreviewMarginRight: Integer; +begin + Result := dxTextSpace; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams2_GetPreviewMaxHeight: Integer; +begin + Result := -1; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams2_GetPreviewMaxLineCount: Integer; +begin + Result := -1; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams2_GetRichEditGraphicClass: TGraphicClass; +const + GraphicClasses: array[Boolean] of TGraphicClass = (TMetafile, TBitmap); +begin + Result := GraphicClasses[IdxPSCellParams2_GetRichEditTransparent]; +end; + +function TdxCustomGridTableViewFormatter.IdxPSCellParams2_GetRichEditTransparent: Boolean; +begin + {$IFDEF DXVER500} + Result := ReportLink.OptionsRefinements.TransparentRichEdits; + {$ELSE} + Result := False; + {$ENDIF} +end; + +procedure TdxCustomGridTableViewFormatter.AfterBuilding; +begin + inherited; + ReportLink.ReportCells.BorderColor := GridLineColor; +end; + +procedure TdxCustomGridTableViewFormatter.BeforeBuilding; +begin + inherited; + if ReportLink.OptionsSelection.ProcessSelection then BuildSelectedRecordList; +end; + +procedure TdxCustomGridTableViewFormatter.BuildSelectedRecordList; +var + I: Integer; + ARecord: TcxCustomGridRecord; + IsRecordIncluded: Boolean; + Helper: TdxCustomGridRecordHelper; +begin + SelectedRecordList.Clear; + + for I := 0 to Adapter.RecordCount - 1 do + begin + ARecord := Adapter.Records[I]; + IsRecordIncluded := ARecord.Selected; + if not IsRecordIncluded then + begin + Helper := Adapter.RecordHelpers[ARecord]; + IsRecordIncluded := Helper.HasSelectedChildren or + (not ReportLink.OptionsSelection.ProcessExactSelection and (SelectedRecordList.IndexOf(Helper.Parent) <> -1)); + end; + + if IsRecordIncluded then + SelectedRecordList.Add(ARecord); + end; +end; + +function TdxCustomGridTableViewFormatter.CanProcessSelectionStyle(ARecord: TcxCustomGridRecord): Boolean; +begin + Result := (ARecord <> nil) and ReportLink.OptionsFormatting.ConsumeSelectionStyle and IsSelectedRecord(ARecord); + if Result and not ReportLink.OptionsFormatting.UseNativeStyles then + Result := Adapter.HasSelectionStyle; +end; + +function TdxCustomGridTableViewFormatter.IsSelectedRecord(ARecord: TcxCustomGridRecord): Boolean; +begin + Result := (SelectedRecordCount <> 0) or ARecord.Selected; +end; + +function TdxCustomGridTableViewFormatter.GetContentBackgroundBitmapStyleIndex(ATableItem: TcxCustomGridTableItem): Integer; +begin + Result := bbContent; +end; + +function TdxCustomGridTableViewFormatter.MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; +begin + case AGridBackgroundBitmapIndex of + bbContent: + Result := vspsGridContent; + else + Result := 0; + end; + + if Result = 0 then + Result := inherited MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex); +end; + +function TdxCustomGridTableViewFormatter.GetGridLineColor: TColor; +begin + Result := ReportLink.OptionsFormatting.GridLineColor; + if Result = clDefault then + Result := Adapter.GridLineColor; +end; + +function TdxCustomGridTableViewFormatter.GetRecord(Index: Integer): TcxCustomGridRecord; +begin + if SelectedRecordCount <> 0 then + Result := SelectedRecords[Index] + else + Result := Adapter.Records[Index]; +end; + +function TdxCustomGridTableViewFormatter.GetRecordCount: Integer; +begin + Result := SelectedRecordCount; + if Result = 0 then + Result := Adapter.RecordCount; +end; + +function TdxCustomGridTableViewFormatter.GetRecordIndex(ARecord: TcxCustomGridRecord): Integer; +var + RecordIndex, IndexCount, I: Integer; +begin + RecordIndex := ARecord.Index; + IndexCount := FRecordIndexes.Count; + if RecordIndex > IndexCount - 1 then + begin + FRecordIndexes.Count := RecordIndex + 1; + for I := IndexCount to FRecordIndexes.Count - 1 do + FRecordIndexes[I] := TObject(-1); + end; + Result := Integer(FRecordIndexes[RecordIndex]); + if Result = -1 then + begin + FRecordIndexes[RecordIndex] := TObject(IndexOfRecord(ARecord)); + Result := Integer(FRecordIndexes[RecordIndex]); + end; +end; + +function TdxCustomGridTableViewFormatter.GetSelectedRecord(Index: Integer): TcxCustomGridRecord; +begin + Result := TcxCustomGridRecord(FSelectedRecordList[Index]); +end; + +function TdxCustomGridTableViewFormatter.GetSelectedRecordCount: Integer; +begin + Result := FSelectedRecordList.Count; +end; + +{ TdxCustomGridTableViewBuilder } + +function TdxCustomGridTableViewBuilder.Adapter: TdxCustomGridTableViewAdapter; +begin + Result := inherited Adapter as TdxCustomGridTableViewAdapter; +end; + +class function TdxCustomGridTableViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxCustomGridTableViewAdapter; +end; + +function TdxCustomGridTableViewBuilder.Formatter: TdxCustomGridTableViewFormatter; +begin + Result := inherited Formatter as TdxCustomGridTableViewFormatter; +end; + +class function TdxCustomGridTableViewBuilder.FormatterClass: TdxGridViewFormatterClass; +begin + Result := TdxCustomGridTableViewFormatter; +end; + +procedure TdxCustomGridTableViewBuilder.DoBuildViewFooter; +begin + if Formatter.ShowFilterBar {$IFDEF DXVER500} and (Formatter.FilterBarPosition = fpBottom) {$ENDIF} then + CreateFilterBar; + if Formatter.HasDetailsSeparator then + CreateBottomDetailsSeparator; + inherited; +end; + +procedure TdxCustomGridTableViewBuilder.DoBuildViewHeader; +begin + inherited; + if Formatter.HasDetailsSeparator then + CreateTopDetailsSeparator; + if Formatter.ShowCaption then + CreateCaption; + {$IFDEF DXVER500} + if Formatter.ShowFilterBar and (Formatter.FilterBarPosition = fpTop) then + CreateFilterBar; + {$ENDIF} +end; + +procedure TdxCustomGridTableViewBuilder.DoGetCellHeight(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem; var AHeight: Integer); +begin + ReportLink.DoGetCellHeight(GridView, ARecord, ATableItem, AHeight); +end; + +function TdxCustomGridTableViewBuilder.GridView: TcxCustomGridTableView; +begin + Result := inherited GridView as TcxCustomGridTableView; +end; + +class function TdxCustomGridTableViewBuilder.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridTableView; +end; + +{ TdxGridTableViewAdapter } + +constructor TdxGridTableViewAdapter.Create(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView); +begin + inherited; + GridTableViewInfo_CalculateExpandButtonParams(GridView.ViewInfo); // because LevelIndent +end; + +function TdxGridTableViewAdapter.GridView: TcxGridTableView; +begin + Result := inherited GridView as TcxGridTableView; +end; + +class function TdxGridTableViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridView; +end; + +function TdxGridTableViewAdapter.Styles: TcxGridTableViewStyles; +begin + Result := inherited Styles as TcxGridTableViewStyles; +end; + +function TdxGridTableViewAdapter.HasDetails(AGridRow: TcxCustomGridRow): Boolean; +begin + Result := RecordHelpers[AGridRow].HasDetails; +end; + +function TdxGridTableViewAdapter.GetGroupFooterCount(AGridRow: TcxCustomGridRow): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to AGridRow.Level do + if HasGroupFooter(AGridRow, I) then + Inc(Result); +end; + +function TdxGridTableViewAdapter.GetGroupFooterItemText(ARowIndex, ALevel, AIndex: Integer): string; +var + SummaryIndex: Integer; +begin + SummaryIndex := Summary.GroupFooterIndexOfItemLink[ALevel, Columns[AIndex]]; + if SummaryIndex <> -1 then + Result := Summary.GroupFooterSummaryTexts[ARowIndex, ALevel, SummaryIndex] + else + Result := ''; +end; + +function TdxGridTableViewAdapter.HasGroupFooter(AGridRow: TcxCustomGridRow; ALevel: Integer): Boolean; +begin + if GroupFootersMode <> gfInvisible then + begin + if GroupFootersMode = gfAlwaysVisible then + Dec(ALevel); + Result := (0 <= ALevel) and (ALevel < AGridRow.Level) and AGridRow.IsParentRecordLast[ALevel]; + if (AGridRow is TcxGridGroupRow) and (GroupFootersMode = gfAlwaysVisible) then + Result := Result or (ALevel = -1) and not AGridRow.Expanded; + end + else + Result := False; +end; + +function TdxGridTableViewAdapter.HasGroupFooterItem(ALevel, AIndex: Integer): Boolean; +begin + Result := Summary.GroupFooterIndexOfItemLink[ALevel, Columns[AIndex]] <> -1; +end; + +function TdxGridTableViewAdapter.HasGroupFooters(AGridRow: TcxCustomGridRow): Boolean; +begin + Result := GetGroupFooterCount(AGridRow) <> 0; +end; + +function TdxGridTableViewAdapter.Controller: TcxGridTableController; +begin + Result := inherited Controller as TcxGridTableController; +end; + +function TdxGridTableViewAdapter.DataController: TcxGridDataController; +begin + Result := GridView.DataController; +end; + +function TdxGridTableViewAdapter.GetAutoWidth: Boolean; +begin + Result := GridView.OptionsView.ColumnAutoWidth; +end; + +function TdxGridTableViewAdapter.GetCellAutoHeight: Boolean; +begin + Result := inherited GetCellAutoHeight and (DetailsLineCount = 1) and not DataRowHeightAssigned; +end; + +function TdxGridTableViewAdapter.GetCellMultiline: Boolean; +begin + Result := inherited GetCellAutoHeight;// {3.1} and not DataRowHeightAssigned;// and (DetailsLineCount <> 1); +end; + +function TdxGridTableViewAdapter.GetHeaderAutoHeight: Boolean; +begin + Result := GridView.OptionsView.HeaderAutoHeight and not HeaderHeightAssigned; +end; + +function TdxGridTableViewAdapter.GetHeaderMultiline(Column: TcxGridColumn): Boolean; +begin + Result := HeaderAutoHeight or HeaderHeightAssigned; +end; + +function TdxGridTableViewAdapter.GetIndentCount: Integer; +begin + Result := inherited GetIndentCount + GroupedColumnCount; + if (Result <> 0) and (GroupedColumnCount <> 0) and IsOffice11StyleGrouping then + Dec(Result); +end; + +function TdxGridTableViewAdapter.GetIndentWidth: Integer; +begin + Result := GridView.ViewInfo.LevelIndent; +end; + +function TdxGridTableViewAdapter.GetIndicatorWidth: Integer; +begin + if GridView.OptionsView.Indicator then + Result := GridView.OptionsView.IndicatorWidth + else + Result := 0; +end; + +function TdxGridTableViewAdapter.GetIsOffice11StyleGrouping: Boolean; +begin + {$IFDEF DXVER500} + Result := GridView.OptionsView.GroupRowStyle = grsOffice11; + {$ELSE} + Result := False; + {$ENDIF} +end; + +function TdxGridTableViewAdapter.GetViewWidthExtra: Integer; +var + IndentCount: Integer; +begin + Result := inherited GetViewWidthExtra; + IndentCount := GroupedColumnCount; + if (IndentCount <> 0) and IsOffice11StyleGrouping then + Dec(IndentCount); + Inc(Result, IndentCount * IndentWidth); +end; + +function TdxGridTableViewAdapter.GetDataRowHeight: Integer; +begin + Result := GridView.OptionsView.DataRowHeight; +end; + +function TdxGridTableViewAdapter.GetDataRowHeightAssigned: Boolean; +begin + Result := DataRowHeight <> 0; +end; + +function TdxGridTableViewAdapter.GetFooterHeight: Integer; +begin + Result := DefaultFooterLineHeight;//GridView.OptionsView.HeaderHeight; {PS 3.03} +end; + +function TdxGridTableViewAdapter.GetFooterHeightAssigned: Boolean; +begin + Result := False; +end; + +function TdxGridTableViewAdapter.GetGroupFooterHeight: Integer; +begin + Result := DefaultGroupFooterLineHeight; +end; + +function TdxGridTableViewAdapter.GetGroupFooterHeightAssigned: Boolean; +begin + Result := False; +end; + +function TdxGridTableViewAdapter.GetGroupRowHeight: Integer; +begin + Result := GridView.OptionsView.GroupRowHeight; +end; + +function TdxGridTableViewAdapter.GetGroupRowHeightAssigned: Boolean; +begin + Result := GroupRowHeight <> 0; +end; + +function TdxGridTableViewAdapter.GetHeaderHeight: Integer; +begin + Result := GridView.OptionsView.HeaderHeight; +end; + +function TdxGridTableViewAdapter.GetHeaderHeightAssigned: Boolean; +begin + Result := HeaderHeight <> 0; +end; + +function TdxGridTableViewAdapter.GetFilterBarViewParams: TcxViewParams; +begin + Styles.GetViewParams(vsFilterBox, nil, nil, Result); +end; + +function TdxGridTableViewAdapter.GetFooterViewParams(ARecord: TcxCustomGridRecord; + AGroupLevel: Integer; AColumn: TcxGridColumn): TcxViewParams; +begin + if (AColumn <> nil) and (AColumn.Styles <> nil) then + AColumn.Styles.GetFooterParams(TcxCustomGridRow(ARecord), {$IFDEF DXVER500} AGroupLevel, {$ENDIF} Result) + else + Styles.GetFooterParams(TcxCustomGridRow(ARecord), AColumn, {$IFDEF DXVER500} AGroupLevel, {$ENDIF} Result); +end; + +function TdxGridTableViewAdapter.GetGroupRowViewParams(ARecord: TcxCustomGridRecord; + AGroupLevel: Integer): TcxViewParams; +begin + if (AGroupLevel >= 0) and (AGroupLevel < Styles.GridView.GroupedItemCount) then + Styles.GetGroupParams(ARecord, AGroupLevel, Result) + else + Styles.GetViewParams(vsGroup, ARecord, nil, Result); +end; + +function TdxGridTableViewAdapter.GetHeaderViewParams(AColumn: TcxGridColumn): TcxViewParams; +begin + if (AColumn <> nil) and (AColumn.Styles <> nil) then + AColumn.Styles.GetHeaderParams(Result) + else + Styles.GetHeaderParams(AColumn, Result); + if AColumn = nil then + Result.Color := LookAndFeelPainter.DefaultHeaderBackgroundColor; +end; + +function TdxGridTableViewAdapter.GetPreviewViewParams(ARecord: TcxCustomGridRecord; + AnItem: TcxCustomGridTableItem): TcxViewParams; +begin + Styles.GetPreviewParams(ARecord, TcxGridColumn(AnItem), Result); + // 3.2 + if Result.Color = clWindow then + Result.Color := dxPSCore.dxDefaultContentColor; +end; + +function TdxGridTableViewAdapter.GetColumn(Index: Integer): TcxGridColumn; +begin + Result := GridView.VisibleColumns[Index]; +end; + +function TdxGridTableViewAdapter.GetColumnCount: Integer; +begin + Result := GridView.VisibleColumnCount; +end; + +function TdxGridTableViewAdapter.GetExpandButtonColor: TColor; +begin + Result := ExpandButtonInteriorColor; +end; + +function TdxGridTableViewAdapter.GetExpandButtonSize: Integer; +begin + Result := GridView.ViewInfo.ExpandButtonSize; +end; + +function TdxGridTableViewAdapter.GetFooterItemText(Index: Integer): string; +var + SummaryIndex: Integer; +begin + SummaryIndex := Summary.FooterSummaryItems.IndexOfItemLink(Columns[Index]); + if SummaryIndex <> -1 then + Result := Summary.FooterSummaryTexts[SummaryIndex] + else + Result := ''; +end; + +function TdxGridTableViewAdapter.GetFooterMultiline: Boolean; +begin + {$IFDEF DXVER500} + Result := GridView.OptionsView.FooterAutoHeight; + {$ELSE} + Result := False; + {$ENDIF} +end; + +function TdxGridTableViewAdapter.GetGridLineColor: TColor; +begin + Result := GridView.OptionsView.GridLineColor; + if Result = clDefault then + Result := GridView.LookAndFeelPainter.DefaultGridLineColor; +end; + +function TdxGridTableViewAdapter.GetGridLines: TcxGridLines; +begin + Result := GridView.OptionsView.GridLines; +end; + +function TdxGridTableViewAdapter.GetGroupedColumn(Index: Integer): TcxGridColumn; +begin + Result := GridView.GroupedColumns[Index]; +end; + +function TdxGridTableViewAdapter.GetGroupedColumnCount: Integer; +begin + Result := GridView.GroupedColumnCount; +end; + +function TdxGridTableViewAdapter.GetGroupFootersMode: TcxGridGroupFootersMode; +begin + Result := GridView.OptionsView.GroupFooters; +end; + +function TdxGridTableViewAdapter.GetGroupFootersMultiline: Boolean; +begin + {$IFDEF DXVER500} + Result := GridView.OptionsView.FooterAutoHeight; + {$ELSE} + Result := False; + {$ENDIF} +end; + +function TdxGridTableViewAdapter.GetGroupRowSeparatorColor: TColor; +begin + {$IFDEF DXVER500} + Result := dxOffice11.dxOffice11GroupRowSeparatorColor; + {$ELSE} + Result := clBtnFace; + {$ENDIF} +end; + +function TdxGridTableViewAdapter.GetGroupRowSeparatorThickness: Integer; +begin + {$IFDEF DXVER500} + Result := cxGridTableView.cxGridOffice11GroupRowSeparatorWidth; + {$ELSE} + Result := 2; + {$ENDIF} +end; + +function TdxGridTableViewAdapter.GetHasFooterItem(Index: Integer): Boolean; +begin + Result := Summary.FooterSummaryItems.IndexOfItemLink(Columns[Index]) <> -1; +end; + +function TdxGridTableViewAdapter.GetHasPreview: Boolean; +begin + Result := PreviewColumn <> nil; +end; + +function TdxGridTableViewAdapter.GetHasRowSeparators: Boolean; +begin + Result := RowSeparatorThickness > 0; +end; + +function TdxGridTableViewAdapter.GetHeaderEndEllipsis: Boolean; +begin + Result := GridView.OptionsView.HeaderEndEllipsis; +end; + +function TdxGridTableViewAdapter.GetInternalColumnMinWidth(Column: TcxGridColumn): Integer; +begin + Result := Column.MinWidth; + if Column.IsMostLeft then + Inc(Result, IndentCount * IndentWidth); +end; + +function TdxGridTableViewAdapter.GetInternalColumnWidth(Column: TcxGridColumn): Integer; +begin + Result := Column.Width; + if Column.IsMostLeft then + Inc(Result, IndentCount * IndentWidth); +end; + +function TdxGridTableViewAdapter.GetPreviewColumn: TcxGridColumn; +begin + Result := GridView.Preview.Column; +end; + +function TdxGridTableViewAdapter.GetPreviewLeftIndent: Integer; +begin + Result := GridView.Preview.LeftIndent; +end; + +function TdxGridTableViewAdapter.GetPreviewPlace: TcxGridPreviewPlace; +begin + Result := GridView.Preview.Place; +end; + +function TdxGridTableViewAdapter.GetPreviewRightIndent: Integer; +begin + Result := GridView.Preview.RightIndent; +end; + +function TdxGridTableViewAdapter.GetRow(Index: Integer): TcxCustomGridRow; +begin + Result := TcxCustomGridRow(Records[Index]); +end; + +function TdxGridTableViewAdapter.GetRowCount: Integer; +begin + Result := RecordCount; +end; + +function TdxGridTableViewAdapter.GetRowSeparatorColor: TColor; +begin + Result := GridView.OptionsView.RowSeparatorColor; +end; + +function TdxGridTableViewAdapter.GetRowSeparatorThickness: Integer; +begin + Result := GridView.OptionsView.RowSeparatorWidth; +end; + +function TdxGridTableViewAdapter.GetShowExpandButtonsForEmptyDetails: Boolean; +begin + {$IFDEF DXVER500} + Result := GridView.OptionsView.ExpandButtonsForEmptyDetails; + {$ELSE} + Result := True; + {$ENDIF} +end; + +function TdxGridTableViewAdapter.GetShowHorzGridLines: Boolean; +begin + Result := GridLines in [glBoth, glHorizontal]; +end; + +function TdxGridTableViewAdapter.GetShowVertGridLines: Boolean; +begin + Result := GridLines in [glBoth, glVertical]; +end; + +function TdxGridTableViewAdapter.GetThemedFooterItemColor: TColor; +begin + Result := LookAndFeelPainter.DefaultFooterColor; +end; + +function TdxGridTableViewAdapter.GetThemedFooterItemTextColor: TColor; +begin + Result := LookAndFeelPainter.DefaultFooterTextColor; +end; + +function TdxGridTableViewAdapter.GetThemedHeaderItemColor: TColor; +begin + Result := LookAndFeelPainter.DefaultHeaderColor; +end; + +function TdxGridTableViewAdapter.GetThemedHeaderItemTextColor: TColor; +begin + Result := LookAndFeelPainter.DefaultHeaderTextColor; +end; + +{ TdxCustomGridTableViewItemPlaceController } + +constructor TdxCustomGridTableViewItemPlaceController.Create(AFormatter: TdxGridTableViewFormatter); +begin + inherited Create; + FFormatter := AFormatter; + FHeaderLineCount := -1; + FWidth := -1; +end; + +procedure TdxCustomGridTableViewItemPlaceController.Calculate; +begin +end; + +procedure TdxCustomGridTableViewItemPlaceController.Refresh; +begin +end; + +function TdxCustomGridTableViewItemPlaceController.CalculateHeaderLineCount: Integer; +begin + Result := 1; +end; + +function TdxCustomGridTableViewItemPlaceController.CalculateWidth: Integer; +begin + Result := 0; +end; + +function TdxCustomGridTableViewItemPlaceController.GetItemByColumn(Column: TcxGridColumn): TdxGridTableViewColumnPlace; +begin + Result := nil; +end; + +procedure TdxCustomGridTableViewItemPlaceController.WidthChanged; +begin +end; + +function TdxCustomGridTableViewItemPlaceController.GetHeaderLineCount: Integer; +begin + if FHeaderLineCount = -1 then + FHeaderLineCount := CalculateHeaderLineCount; + Result := FHeaderLineCount; +end; + +function TdxCustomGridTableViewItemPlaceController.GetWidth: Integer; +begin + if FWidth = -1 then + FWidth := CalculateWidth; + Result := FWidth; +end; + +procedure TdxCustomGridTableViewItemPlaceController.SetWidth(Value: Integer); +begin + FWidth := Value; + WidthChanged; +end; + +{ TdxGridTableViewColumnPlace } + +constructor TdxGridTableViewColumnPlace.Create(AController: TdxGridTableViewColumnPlaceController; + AColumn: TcxGridColumn); +begin + inherited Create; + FController := AController; + FColumn := AColumn; + + FLeftBound := -1; + FWidth := -1; +end; + +procedure TdxGridTableViewColumnPlace.Calculate(ALeftBound: Integer); +begin + FLeftBound := ALeftBound; +end; + +function TdxGridTableViewColumnPlace.CalculateLeftBound: Integer; +begin + Result := Controller.CalculateItemLeftBound(Self); +end; + +function TdxGridTableViewColumnPlace.GetLineCount: Integer; +begin + Result := 1; +end; + +function TdxGridTableViewColumnPlace.GetRowIndex: Integer; +begin + Result := 0; +end; + +procedure TdxGridTableViewColumnPlace.InitAutoWidthItem(AnItem: TcxAutoWidthItem); +begin + AnItem.Fixed := IsFixed; + AnItem.MinWidth := MinWidth; + AnItem.Width := Width; +end; + +function TdxGridTableViewColumnPlace.GetAdapter: TdxGridTableViewAdapter; +begin + Result := Formatter.Adapter; +end; + +function TdxGridTableViewColumnPlace.GetCellBounds(RowIndex: Integer): TRect; +var + CellHeight: Integer; +begin + CellHeight := CellHeights[RowIndex]; + with Result do + begin + Left := LeftBound; + Top := Self.RowIndex * CellHeight; + Right := Left + Width; + Bottom := Top + LineCount * CellHeight; + end; + + if Column.IsMostLeft then + Inc(Result.Left, Formatter.ViewWidthExtra); +end; + +function TdxGridTableViewColumnPlace.GetCellHeight(RowIndex: Integer): Integer; +begin + Result := Formatter.RowHeights[RowIndex]; +end; + +function TdxGridTableViewColumnPlace.GetFooterCellBounds: TRect; +begin + with Result do + begin + Left := LeftBound; + Top := RowIndex * FooterLineHeight; + Right := Left + Width; + Bottom := Top + LineCount * FooterLineHeight; + end; + + InflateRect(Result, -FooterItemInflateHorz, -FooterItemInflateVert); + if Column.IsMostLeft then + Inc(Result.Left, 2); +end; + +function TdxGridTableViewColumnPlace.GetFooterLineHeight: Integer; +begin + Result := Formatter.FooterLineHeight; +end; + +function TdxGridTableViewColumnPlace.GetFormatter: TdxGridTableViewFormatter; +begin + Result := Controller.Formatter; +end; + +function TdxGridTableViewColumnPlace.GetGroupFooterCellBounds(IndentCount: Integer): TRect; +var + V: Integer; +begin + with Result do + begin + Left := LeftBound; + Top := RowIndex * GroupFooterLineHeight; + Right := Left + Width; + Bottom := Top + LineCount * GroupFooterLineHeight; + end; + + V := IndentCount * Formatter.IndentWidth; + OffsetRect(Result, -V, 0); + if Column.IsMostLeft then + Inc(Result.Left, V); + + InflateRect(Result, -FooterItemInflateHorz, -FooterItemInflateVert); + if Column.IsMostLeft then + Inc(Result.Left, 2); +end; + +function TdxGridTableViewColumnPlace.GetGroupFooterLineHeight: Integer; +begin + Result := Formatter.GroupFooterLineHeight; +end; + +function TdxGridTableViewColumnPlace.GetHeaderCellBounds: TRect; +begin + with Result do + begin + Left := LeftBound; + Top := RowIndex * HeaderLineHeight; + Right := Left + Width; + Bottom := Top + LineCount * HeaderLineHeight; + end; +end; + +function TdxGridTableViewColumnPlace.GetHeaderLineHeight: Integer; +begin + Result := Formatter.HeaderLineHeight; +end; + +function TdxGridTableViewColumnPlace.GetIndex: Integer; +begin + Result := Controller.IndexOf(Self); +end; + +function TdxGridTableViewColumnPlace.GetIsFixed: Boolean; +begin + Result := GridColumn_GetFixed(Column); +end; + +function TdxGridTableViewColumnPlace.GetLeftBound: Integer; +begin + if FLeftBound = -1 then + FLeftBound := CalculateLeftBound; + Result := FLeftBound; +end; + +function TdxGridTableViewColumnPlace.GetMinWidth: Integer; +begin + Result := Adapter.InternalColumnMinWidths[Column]; +end; + +function TdxGridTableViewColumnPlace.GetOriginalWidth: Integer; +begin + Result := Adapter.InternalColumnWidths[Column]; +end; + +function TdxGridTableViewColumnPlace.GetWidth: Integer; +begin + Result := FWidth; + if Result = -1 then + Result := OriginalWidth; +end; + +{ TdxGridTableViewColumnPlaceController } + +constructor TdxGridTableViewColumnPlaceController.Create(AFormatter: TdxGridTableViewFormatter); +begin + inherited; + FColumnIndexes := TList.Create; + FItems := TList.Create; + FWidth := -1; +end; + +destructor TdxGridTableViewColumnPlaceController.Destroy; +begin + FreeAndNilItems; + FreeAndNil(FColumnIndexes); + inherited; +end; + +procedure TdxGridTableViewColumnPlaceController.Calculate; +begin + if ItemsAutoWidth then CalculateItemsWidth; +end; + +procedure TdxGridTableViewColumnPlaceController.Refresh; +begin + FColumnIndexes.Clear; + ClearItems; + AddItems; +end; + +function TdxGridTableViewColumnPlaceController.IndexOf(AnItem: TdxGridTableViewColumnPlace): Integer; +begin + Result := FItems.IndexOf(AnItem); +end; + +function TdxGridTableViewColumnPlaceController.IndexOf(AColumn: TcxGridColumn): Integer; +begin + for Result := 0 to ItemCount - 1 do + if Items[Result].Column = AColumn then + Exit; + Result := -1; +end; + +function TdxGridTableViewColumnPlaceController.CalculateWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to ItemCount - 1 do + Inc(Result, Items[I].Width); +end; + +function TdxGridTableViewColumnPlaceController.GetItemByColumn(Column: TcxGridColumn): TdxGridTableViewColumnPlace; +var + Index: Integer; +begin + Index := ColumnIndexes[Column]; + //Index := IndexOf(Column); + if Index <> -1 then // might be -1 when we are in loading stage (Building report while loading form) + Result := Items[Index] + else + Result := nil; +end; + +procedure TdxGridTableViewColumnPlaceController.AddItems; +var + I: Integer; +begin + for I := 0 to Formatter.ColumnCount - 1 do + CreateItem(Formatter.Columns[I]); +end; + +procedure TdxGridTableViewColumnPlaceController.ClearItems; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + Items[I].Free; + FItems.Clear; +end; + +function TdxGridTableViewColumnPlaceController.CreateItem(AColumn: TcxGridColumn): TdxGridTableViewColumnPlace; +begin + Result := GetItemClass(AColumn).Create(Self, AColumn); + FItems.Add(Result); +end; + +function TdxGridTableViewColumnPlaceController.GetItemClass(AColumn: TcxGridColumn): TdxGridTableViewColumnPlaceClass; +begin + Result := TdxGridTableViewColumnPlace; +end; + +function TdxGridTableViewColumnPlaceController.CalculateItemLeftBound(AnItem: TdxGridTableViewColumnPlace): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to AnItem.Index - 1 do + Inc(Result, Items[I].Width); +end; + +procedure TdxGridTableViewColumnPlaceController.CalculateItemsWidth; +var + AutoWidthObject: TcxAutoWidthObject; + I: Integer; +begin + AutoWidthObject := TcxAutoWidthObject.Create(ItemCount); + try + for I := 0 to ItemCount - 1 do + Items[I].InitAutoWidthItem(AutoWidthObject.AddItem); + AutoWidthObject.AvailableWidth := ItemsAvailableWidth; + AutoWidthObject.Calculate; + + for I := 0 to ItemCount - 1 do + Items[I].Width := AutoWidthObject[I].AutoWidth; + finally + AutoWidthObject.Free; + end; +end; + +function TdxGridTableViewColumnPlaceController.GetItemsAutoWidth: Boolean; +begin + Result := Formatter.AutoWidth; +end; + +function TdxGridTableViewColumnPlaceController.GetItemsAvailableWidth: Integer; +begin + Result := Formatter.ViewAvailableWidth; +end; + +function TdxGridTableViewColumnPlaceController.GetAdapter: TdxGridTableViewAdapter; +begin + Result := Formatter.Adapter; +end; + +function TdxGridTableViewColumnPlaceController.GetColumnIndex(Column: TcxGridColumn): Integer; +var + ColumnIndex, IndexCount, I: Integer; +begin + ColumnIndex := Column.Index; + IndexCount := FColumnIndexes.Count; + if ColumnIndex > IndexCount - 1 then + begin + FColumnIndexes.Count := ColumnIndex + 1; + for I := IndexCount to FColumnIndexes.Count - 1 do + FColumnIndexes[I] := TObject(-1); + end; + Result := Integer(FColumnIndexes[ColumnIndex]); + if Result = -1 then + begin + FColumnIndexes[ColumnIndex] := TObject(IndexOf(Column)); + Result := Integer(FColumnIndexes[ColumnIndex]); + end; +end; + +function TdxGridTableViewColumnPlaceController.GetItem(Index: Integer): TdxGridTableViewColumnPlace; +begin + Result := TdxGridTableViewColumnPlace(FItems[Index]); +end; + +function TdxGridTableViewColumnPlaceController.GetItemCount: Integer; +begin + Result := FItems.Count; +end; + +procedure TdxGridTableViewColumnPlaceController.FreeAndNilItems; +begin + ClearItems; + FreeAndNil(FItems); +end; + +{ TdxGridTableViewReportDataAdapter } + +constructor TdxGridTableViewReportDataAdapter.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited Create; + FBuilder := ABuilder; +end; + +function TdxGridTableViewReportDataAdapter.GetReportItem(Row: TcxCustomGridRow; + Column: TcxGridColumn): TdxReportVisualItem; +var + ReportRow: TdxReportCell; + I: Integer; +begin + ReportRow := ReportRowsByGridRow[Row]; + if ReportRow <> nil then + for I := 0 to ReportRow.DataItemCount - 1 do + begin + Result := ReportRow.DataItems[I]; + if Result.Data = Integer(Column) then Exit; + end; + Result := nil; +end; + +function TdxGridTableViewReportDataAdapter.GetReportRow(Index: Integer): TdxReportCell; +begin + Result := Builder.ReportRows[Index]; +end; + +function TdxGridTableViewReportDataAdapter.GetReportRowByGridRow(Row: TcxCustomGridRow): TdxReportCell; +var + I: Integer; +begin + for I := 0 to ReportRowCount - 1 do + if ReportRows[I].CellCount <> 0 then + begin + Result := ReportRows[I].Cells[0]; + if Result.Data = Integer(Row) then Exit; + end; + Result := nil; +end; + +function TdxGridTableViewReportDataAdapter.GetReportRowCount: Integer; +begin + Result := Builder.ReportRowCount; +end; + +{ TdxGridTableViewFormatter } + +constructor TdxGridTableViewFormatter.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited; + FColumns := TList.Create; + FItemPlaceController := GetItemPlaceControllerClass.Create(Self); + FReportDataAdapter := TdxGridTableViewReportDataAdapter.Create(ABuilder); + FRowHeights := TList.Create; +end; + +destructor TdxGridTableViewFormatter.Destroy; +begin + FreeAndNil(FRowHeights); + FreeAndNil(FItemPlaceController); + FreeAndNil(FReportDataAdapter); + FreeAndNil(FColumns); + inherited; +end; + +function TdxGridTableViewFormatter.Adapter: TdxGridTableViewAdapter; +begin + Result := Builder.Adapter; +end; + +function TdxGridTableViewFormatter.Builder: TdxGridTableViewBuilder; +begin + Result := inherited Builder as TdxGridTableViewBuilder; +end; + +procedure TdxGridTableViewFormatter.DoInitializeFooterItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +var + Column: TcxGridColumn; +begin + Column := Columns[AnIndex]; + SetViewParams(AnItem, GetFooterItemViewParams(Column)); + if HasBackgroundBitmap(bbFooter) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbFooter); + + RegisterLookAndFeelItem(AnItem, cesSunken); + + with AnItem as TdxReportCellString do + begin + Data := Integer(Column); + Text := Adapter.FooterItemTexts[AnIndex]; + Multiline := Adapter.FooterMultiline; + TextAlignX := TextAlignXMap[Column.FooterAlignmentHorz]; + if Multiline then + TextAlignY := taTop + else + TextAlignY := taCenterY; + end; +end; + +procedure TdxGridTableViewFormatter.DoInitializeFooterRow(ARow: TdxReportCell); +begin + SetViewParams(ARow, GetFooterItemViewParams(nil)); + RegisterLookAndFeelItem(ARow, cesRaised); + ARow.Data := Integer(TdxGridFooter); +end; + +procedure TdxGridTableViewFormatter.DoReportLinkInitializeFooterItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +begin + ReportLink.DoInitializeFooterCell(Adapter.GridView, nil, Columns[AnIndex], 0, TdxReportCellString(AnItem)); +end; + +function TdxGridTableViewFormatter.GetFooterItemBounds(AnIndex: Integer): TRect; +var + Item: TdxGridTableViewColumnPlace; +begin + Item := ItemPlaceController[Columns[AnIndex]]; + if Item <> nil then + Result := Item.FooterCellBounds + else + Result := dxPSGlbl.NullRect; +end; + +function TdxGridTableViewFormatter.GetFooterItemClass(AnIndex: Integer): TdxReportCellTextClass; +begin + Result := TdxReportCellString; +end; + +function TdxGridTableViewFormatter.GetFooterItemViewParams(AColumn: TcxGridColumn): TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetFooterParams(nil, -1, AColumn, Result.NativeParams) + else + Result.NativeParams := Adapter.GetFooterViewParams(nil, -1, AColumn); + + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + if AColumn <> nil then + begin + Result.NativeParams.Color := Adapter.ThemedFooterItemColor; + Result.NativeParams.TextColor := Adapter.ThemedFooterItemTextColor; + end; + + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.FixedTransparent; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupFooterHost(AnItem: TdxReportVisualItem; + ARecord: TcxCustomGridRecord; AGroupLevel: Integer); +begin + SetViewParams(AnItem, GetGroupFooterItemViewParams(nil, AGroupLevel, nil)); + RegisterLookAndFeelItem(AnItem, cesRaised); + AnItem.Data := Integer(ARecord); +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupFooterItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer; ARecord: TcxCustomGridRecord; AGroupLevel: Integer); +var + Column: TcxGridColumn; +begin + Column := Columns[AnIndex]; + SetViewParams(AnItem, GetGroupFooterItemViewParams(ARecord, AGroupLevel, Column)); + if HasBackgroundBitmap(bbFooter) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbFooter); + RegisterLookAndFeelItem(AnItem, cesSunken); + + with TdxReportCellString(AnItem) do + begin + Data := Integer(Column); + Multiline := Adapter.GetGroupFootersMultiline; + Text := Adapter.GetGroupFooterItemText(ARecord.Index, AGroupLevel, AnIndex); + TextAlignX := TextAlignXMap[Column.FooterAlignmentHorz]; + if Multiline then + TextAlignY := taTop + else + TextAlignY := taCenterY; + end; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupFooterRow(ARow: TdxReportCell; + ARecord: TcxCustomGridRecord; AGroupLevel: Integer); +begin + ARow.CellSides := csLeftRight; + ARow.Data := AGroupLevel; //v3.0 ARecord.Level + ARow.Transparent := True; +end; + +procedure TdxGridTableViewFormatter.DoReportLinkInitializeGroupFooterItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer; ARecord: TcxCustomGridRecord; AGroupLevel: Integer); +begin + ReportLink.DoInitializeFooterCell(Adapter.GridView, ARecord, Columns[AnIndex], + AGroupLevel, TdxReportCellString(AnItem)); +end; + +function TdxGridTableViewFormatter.GetGroupFooterItemBounds(AnIndex, AGroupLevel: Integer): TRect; +var + Item: TdxGridTableViewColumnPlace; +begin + Item := ItemPlaceController[Columns[AnIndex]]; + if Item <> nil then + Result := Item.GroupFooterCellBounds[AGroupLevel] + else + Result := dxPSGlbl.NullRect; +end; + +function TdxGridTableViewFormatter.GetGroupFooterItemClass(AnIndex: Integer): TdxReportCellTextClass; +begin + Result := TdxReportCellString; +end; + +function TdxGridTableViewFormatter.GetGroupFooterItemViewParams(ARecord: TcxCustomGridRecord; + AGroupLevel: Integer; AColumn: TcxGridColumn): TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetFooterParams(ARecord, AGroupLevel, AColumn, Result.NativeParams) + else + Result.NativeParams := Adapter.GetFooterViewParams(ARecord, AGroupLevel, AColumn); + + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + if AColumn <> nil then + begin + Result.NativeParams.Color := Adapter.ThemedFooterItemColor; + Result.NativeParams.TextColor := Adapter.ThemedFooterItemTextColor; + end; + + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.FixedTransparent; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupRowItem(AnItem: TAbstractdxReportCellData; + ARow: TcxGridGroupRow); +var + AText: string; +begin + SetViewParams(AnItem, GetGroupRowViewParams(ARow, ARow.Level)); + if HasBackgroundBitmap(bbGroup) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbGroup); + + with AnItem as TdxReportCellString do + begin + Data := Integer(Adapter.GroupedColumns[ARow.Level]); + AText := ARow.DisplayText; + TcxCustomGridTableItemAccess(ARow.GroupedColumn).DoGetDisplayText(ARow, AText); + Text := AText; + TextAlignX := taLeft; + if Adapter.IsOffice11StyleGrouping then TextAlignY := taBottom; {.2} + end; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupRow(ARow: TdxReportCell; + ARecord: TcxCustomGridRecord); +begin + ReportLink.AddReportRow(ARow); + + ARow.CellSides := []; + ARow.Data := Integer(ARecord); + ARow.Transparent := True; +end; + +function TdxGridTableViewFormatter.GetGroupRowClass: TdxReportCellTextClass; +begin + Result := TdxReportCellString; +end; + +function TdxGridTableViewFormatter.GetGroupRowViewParams(ARecord: TcxCustomGridRecord; + ALevel: Integer): TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + if CanProcessSelectionStyle(ARecord) then + ReportLink.Styles.GetSelectionParams(Result.NativeParams) + else + ReportLink.Styles.GetGroupParams(ARecord, ALevel, Result.NativeParams) + else + if CanProcessSelectionStyle(ARecord) then + Result.NativeParams := Adapter.GetSelectionViewParams + else + Result.NativeParams := Adapter.GetGroupRowViewParams(ARecord, ALevel); + + Result.CellSides := CellSidesMap[Adapter.GridLines] - [csLeft] + [csRight]; + if ARecord.Index = 0 then + Result.CellSides := Result.CellSides + [csTop]; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.FixedTransparent; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupRowSeparator(ASeparator: TAbstractdxReportCellData); +begin + ASeparator.CellSides := csAll; + ASeparator.Color := GroupRowSeparatorColor; + ASeparator.Transparent := IsColorTransparent(ASeparator.Color); //ReportLink.Transparent; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupSeparatorRow(ARow: TdxReportCell); +begin + ARow.CellSides := csLeftRight; + ARow.Transparent := True; +end; + +function TdxGridTableViewFormatter.GetGroupRowSeparatorClass: TdxReportCellDataClass; +begin + Result := TdxReportCellBox; +end; + +procedure TdxGridTableViewFormatter.DoInitializeHeaderItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +var + Column: TcxGridColumn; +begin + Column := Columns[AnIndex]; + SetViewParams(AnItem, GetHeaderItemViewParams(Column)); + if HasBackgroundBitmap(bbHeader) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbHeader); + RegisterLookAndFeelItem(AnItem, cesRaised); + + with AnItem as TdxReportCellImage do + begin + Data := Integer(Column); + EndEllipsis := Adapter.HeaderEndEllipsis; + if (Column.HeaderGlyph <> nil) and not Column.HeaderGlyph.Empty then + begin + Image := Column.HeaderGlyph; + ImageLayout := HeaderImageLayoutMap[Column.HeaderGlyphAlignmentHorz, Column.HeaderGlyphAlignmentVert]; + IsTextDrawnForCenteredImage := True; + IsTextShiftedForHorizontallyCenteredImage := + not (ImageLayout in [ilImageTopCenter, ilImageCenterCenter, ilImageBottomCenter]) and (Text <> ''); + end; + Multiline := Adapter.HeaderMultilines[Column]; + SortOrder := SortOrderMap[Column.SortOrder]; + Text := Column.Caption; + TextAlignX := TextAlignXMap[Column.HeaderAlignmentHorz]; + if Multiline then + TextAlignY := TextAlignYMap[Column.HeaderAlignmentVert] + else + TextAlignY := taCenterY; + end; +end; + +procedure TdxGridTableViewFormatter.DoInitializeHeaderRow(ARow: TdxReportCell); +begin + SetViewParams(ARow, GetHeaderItemViewParams(nil)); + ARow.Data := Integer(TdxGridHeader); +end; + +procedure TdxGridTableViewFormatter.DoReportLinkInitializeHeaderItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +begin + ReportLink.DoInitializeHeaderCell(Adapter.GridView, Columns[AnIndex], TdxReportCellString(AnItem)); +end; + +function TdxGridTableViewFormatter.GetHeaderItemBounds(AnIndex: Integer): TRect; +var + Item: TdxGridTableViewColumnPlace; +begin + Item := ItemPlaceController[Columns[AnIndex]]; + if Item <> nil then + Result := Item.HeaderCellBounds + else + Result := dxPSGlbl.NullRect; +end; + +function TdxGridTableViewFormatter.GetHeaderItemClass(AnIndex: Integer): TdxReportCellTextClass; +begin + Result := TdxReportCellImage; +end; + +function TdxGridTableViewFormatter.GetHeaderItemViewParams(AColumn: TcxGridColumn): TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetHeaderParams(AColumn, Result.NativeParams) + else + Result.NativeParams := Adapter.GetHeaderViewParams(AColumn); + + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + if AColumn <> nil then + begin + Result.NativeParams.Color := Adapter.ThemedHeaderItemColor; + Result.NativeParams.TextColor := Adapter.ThemedHeaderItemTextColor; + end; + + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := False; +end; + +function TdxGridTableViewFormatter.CreateIndent(AParent: TdxReportCell): TdxReportCellExpandButton; +begin + Result := GetIndentClass.Create(AParent); +end; + +procedure TdxGridTableViewFormatter.DoInitializeDataRowIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); +begin + SetViewParams(AnIndent, GetIndentViewParams(ARecord, AnIndex, AnIndentCount, False)); + if HasBackgroundBitmap(bbGroup) then + AnIndent.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbGroup); +end; + +procedure TdxGridTableViewFormatter.DoInitializeExpandButton(AnExpandButton: TdxReportCellExpandButton; + ARecord: TcxCustomGridRecord; AnIsMasterIndent: Boolean); +begin + with AnExpandButton do + begin + {3.1 added} + ButtonAlignHorz := bahCenter; + if Adapter.IsOffice11StyleGrouping and not AnIsMasterIndent then {.2} + ButtonAlignVert := bavBottom + else + ButtonAlignVert := bavCenter; + + ButtonExpanded := ARecord.Expanded; + ButtonSize := Adapter.ExpandButtonSize; + if (ReportLink.OptionsFormatting.LookAndFeelKind <> lfStandard) and not Odd(ButtonSize) then + ButtonSize := ButtonSize - 1; + ButtonInteriorColor := Adapter.ExpandButtonColor; + ButtonTransparent := IsColorTransparent(ButtonInteriorColor); + end; + RegisterExpandButton(AnExpandButton); +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupFooterIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); +begin + SetViewParams(AnIndent, GetIndentViewParams(ARecord, AnIndex, AnIndentCount, True)); + if HasBackgroundBitmap(bbGroup) then + AnIndent.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbGroup); +// if (AIndex = AIndentCount - 1) and Adapter.ShowHorzGridLines then +// AIndent.CellSides := AIndent.CellSides + [csBottom]; +end; + +procedure TdxGridTableViewFormatter.DoInitializeGroupRowIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); +begin + SetViewParams(AnIndent, GetIndentViewParams(ARecord, AnIndex, AnIndentCount, False)); + if HasBackgroundBitmap(bbGroup) then + AnIndent.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbGroup); + + if AnIndex = AnIndentCount - 1 then + begin + AnIndent.CellSides := AnIndent.CellSides - [csRight]; + if Adapter.ShowHorzGridLines then + AnIndent.CellSides := AnIndent.CellSides + [csTop]; + //if Adapter.IsOffice11StyleGrouping then + // AnIndent.CellSides := AnIndent.CellSides + [csBottom]; + + AnIndent.ShowButton := HasExpandButton(ARecord); + if AnIndent.ShowButton then + DoInitializeExpandButton(AnIndent, ARecord, False); + end; +end; + +procedure TdxGridTableViewFormatter.DoInitializeMasterDataRowIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); +begin + { DoInitializeMasterIndent -> ARecord = nil } + SetViewParams(AnIndent, GetIndentViewParams(ARecord, AnIndex, AnIndentCount, False)); + if AnIndex = AnIndentCount - 1 then + if HasBackgroundBitmap(bbContent) then + AnIndent.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbContent) + else + else + if HasBackgroundBitmap(bbGroup) then + AnIndent.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbGroup); + + if (ARecord <> nil) and (AnIndex = AnIndentCount - 1) then + begin + AnIndent.CellSides := AnIndent.CellSides - [csRight]; + if Adapter.ShowHorzGridLines then + AnIndent.CellSides := AnIndent.CellSides + [csTop]; + if not ARecord.Expanded then + AnIndent.CellSides := AnIndent.CellSides + [csBottom]; + + AnIndent.ShowButton := ReportLink.OptionsView.ExpandButtons and ARecord.Expandable; + if AnIndent.ShowButton then + DoInitializeExpandButton(AnIndent, ARecord, True); + end; +end; + +procedure TdxGridTableViewFormatter.DoInitializeRowSeparatorIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ARecord: TcxCustomGridRecord); +begin + SetViewParams(AnIndent, GetIndentViewParams(ARecord, AnIndex, AnIndentCount, True)); + if HasBackgroundBitmap(bbGroup) then + AnIndent.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbGroup); +end; + +function TdxGridTableViewFormatter.GetIndentClass: TdxReportCellExpandButtonClass; +begin + if Adapter.IsOffice11StyleGrouping then + Result := TdxReportCellExpandButtonEx + else + Result := TdxReportCellExpandButton; +end; + +function TdxGridTableViewFormatter.GetIndentViewParams(ARecord: TcxCustomGridRecord; + AnIndex, AnIndentCount: Integer; ANonRecordIndent: Boolean): TdxReportItemViewParams; + + function IsMasterDataRowIndent: Boolean; + begin + with Adapter do + Result := AnIndex >= GroupedColumnCount - Ord(IsOffice11StyleGrouping and not (ARecord is TcxGridGroupRow)); + end; + + function GetRecord: TcxCustomGridRecord; + begin + if not ANonRecordIndent and (ARecord is TcxGridGroupRow) and (AnIndex = AnIndentCount - 1) then + Result := ARecord + else + Result := nil; + end; + +const + VertGridLinesMap: array[Boolean] of TdxCellSides = ([], csLeftRight); +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + if IsMasterDataRowIndent then + ReportLink.Styles.GetContentParams(Adapter.MasterGridRecord, nil, Result.NativeParams) + else + ReportLink.Styles.GetGroupParams(GetRecord, AnIndex, Result.NativeParams) + else + if IsMasterDataRowIndent then + Result.NativeParams := Adapter.GetContentViewParams(Adapter.MasterGridRecord, nil) + else + Result.NativeParams := Adapter.GetGroupRowViewParams(GetRecord, AnIndex); + + Result.CellSides := VertGridLinesMap[Adapter.ShowHorzGridLines]; //PS3.1 (it was Adapter.ShowVertGridLines) + if AnIndex = 0 then + Result.CellSides := Result.CellSides + [csLeft]; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); +end; + +function TdxGridTableViewFormatter.HasExpandButton(ARecord: TcxCustomGridRecord): Boolean; +begin + Result := ReportLink.OptionsView.ExpandButtons{$IFDEF VER500} and Adapter.RecordHelpers[ARecord].HasExpandButton{$ENDIF}; +end; + +procedure TdxGridTableViewFormatter.DoInitializeDataRow(ARow: TdxReportCell; + ARecord: TcxCustomGridRecord); +begin + ReportLink.AddReportRow(ARow); + + ARow.CellSides := csLeftRight; + ARow.Data := Integer(ARecord); + ARow.Transparent := True; +end; + +procedure TdxGridTableViewFormatter.DoReportLinkInitializeItem(AnItem: TAbstractdxReportCellData; + AColumn: TcxGridColumn; ARecord: TcxCustomGridRecord); +begin + ReportLink.DoInitializeCell(Adapter.GridView, ARecord, AColumn, TdxReportCellString(AnItem)); +end; + +function TdxGridTableViewFormatter.GetItemBounds(AGridRow: TcxCustomGridRow; + AGridRowIndex, AColumnIndex: Integer): TRect; +var + Item: TdxGridTableViewColumnPlace; +begin + Item := ItemPlaceController[Columns[AColumnIndex]]; + if Item <> nil then + Result := Item.CellBounds[AGridRowIndex] + else + Result := dxPSGlbl.NullRect; +end; + +function TdxGridTableViewFormatter.GetItemViewParams(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False): TdxReportItemViewParams; +begin + Result := inherited GetItemViewParams(ATableItem, ARecord, AnIsPreview); + if AnIsPreview then + begin + Result.CellSides := csLeftRight; + if Adapter.GridLines in [glBoth, glHorizontal] then + Result.CellSides := Result.CellSides + csTopBottom; + end + else + begin + Result.CellSides := CellSidesMap[Adapter.GridLines]; + if TcxGridColumn(ATableItem).IsMostLeft and (ARecord <> nil) and ARecord.Expandable then + Result.CellSides := Result.CellSides - [csLeft]; {3.1} + end; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.Transparent; +end; + +procedure TdxGridTableViewFormatter.DoInitializeMasterIndent(AnIndent: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer); +begin + DoInitializeMasterDataRowIndent(AnIndent, AnIndex, AnIndentCount, nil); //Adapter.GroupedColumnCount + 1, nil); //PS3.1 changed +end; + +procedure TdxGridTableViewFormatter.DoInitializePreview(APreview: TAbstractdxReportCellData; + AColumn: TcxGridColumn; ARecord: TcxCustomGridRecord); +begin + DoInitializeItem(APreview, AColumn, ARecord, True); +end; + +function TdxGridTableViewFormatter.GetPreviewClass(AColumn: TcxGridColumn; + ARecord: TcxCustomGridRecord): TdxReportCellDataClass; +begin + Result := GetItemClass(AColumn, ARecord, True); +end; + +function TdxGridTableViewFormatter.GetPreviewViewParams(AColumn: TcxGridColumn; + ARecord: TcxCustomGridRecord): TdxReportItemViewParams; +begin + Result := GetItemViewParams(AColumn, ARecord, True) +end; + +procedure TdxGridTableViewFormatter.DoInitializeSeparatorRow(ARow: TdxReportCell); +begin + ARow.CellSides := csLeftRight; + ARow.Transparent := True; +end; + +procedure TdxGridTableViewFormatter.DoInitializeRowSeparator(ASeparator: TAbstractdxReportCellData); +begin + ASeparator.CellSides := csAll; + ASeparator.Color := RowSeparatorColor; + ASeparator.Transparent := IsColorTransparent(ASeparator.Color); //ReportLink.Transparent; +end; + +function TdxGridTableViewFormatter.GetRowSeparatorClass: TdxReportCellDataClass; +begin + Result := TdxReportCellBox; +end; + +function TdxGridTableViewFormatter.GetReportItem(ARow: TcxCustomGridRow; + AColumn: TcxGridColumn): TdxReportVisualItem; +begin + Result := ReportDataAdapter.ReportItems[ARow, AColumn]; +end; + +{ IdxPSCellParams2 } +function TdxGridTableViewFormatter.IdxPSCellParams2_GetPreviewMarginLeft: Integer; +begin + Result := Adapter.PreviewLeftIndent; +end; + +function TdxGridTableViewFormatter.IdxPSCellParams2_GetPreviewMarginRight: Integer; +begin + Result := Adapter.PreviewRightIndent; +end; + +function TdxGridTableViewFormatter.IdxPSCellParams2_GetPreviewMaxHeight: Integer; +begin + if PreviewAutoHeight then + Result := -1 + else + Result := PreviewLineHeight * PreviewMaxLineCount; +end; + +function TdxGridTableViewFormatter.IdxPSCellParams2_GetPreviewMaxLineCount: Integer; +begin + Result := PreviewMaxLineCount; +end; + +procedure TdxGridTableViewFormatter.AddHorizontalDelimiters; +var + Origin, I: Integer; + Item: TdxGridTableViewColumnPlace; + R: TRect; +begin + inherited; + if ReportLink.OptionsPagination.Column then + begin + Origin := ViewWidthExtraBefore; + for I := 0 to ColumnCount - 1 do + begin + Item := ItemPlaceController[Columns[I]]; + if Item <> nil then + begin + R := Item.HeaderCellBounds; + ReportLink.AddHorizontalDelimiter(Origin + R.Left); + ReportLink.AddHorizontalDelimiter(Origin + R.Right); + end; + end; + end; +end; + +{$IFDEF DXVER500} +procedure TdxGridTableViewFormatter.AfterBuilding; +begin + if CanCellMerging then PerformCellMerging; + inherited; +end; +{$ENDIF} + +procedure TdxGridTableViewFormatter.BeforeBuilding; +begin + BuildItemLists; + ItemPlaceController.Refresh; + inherited; +end; + +procedure TdxGridTableViewFormatter.Calculate; +begin + inherited; + ItemPlaceController.Calculate; +end; + +procedure TdxGridTableViewFormatter.CalculateDataRowHeights; +var + I, RowHeight, J, V: Integer; + Row: TcxCustomGridRow; + Column: TcxGridColumn; +begin + FRowHeights.Count := RowCount; + for I := 0 to RowCount - 1 do + begin + Row := Rows[I]; + if not (Row is TcxGridGroupRow) then + begin + RowHeight := DetailsLineHeight; + if HeaderLineCount = 1 then + for J := 0 to ColumnCount - 1 do + begin + // assign to 0, if you want to give an user ability to shrink RowHeight to smaller value + V := DetailsLineHeight; + Column := Columns[J]; + if not Column.IsPreview then + begin + Builder.DoGetCellHeight(Row, Columns[J], V); + if RowHeight <> V then RowHeight := V; + end; + end + end + else + RowHeight := GroupRowLineHeight; + RowHeights[I] := RowHeight; + end; +end; + +procedure TdxGridTableViewFormatter.CalculateLineHeights; +var + I: Integer; + Column: TcxGridColumn; +begin + inherited; + FGroupFooterLineHeight := DefaultGroupFooterLineHeight; + if Adapter.GroupRowHeightAssigned then + FGroupRowLineHeight := Adapter.GroupRowHeight + else + begin + FGroupRowLineHeight := DefaultGroupRowLineHeight; + if Adapter.IsOffice11StyleGrouping then {.2} + FGroupRowLineHeight := 2 * FGroupRowLineHeight; + end; + + FFooterLineHeight := Adapter.FooterHeight; + FGroupFooterLineHeight := Adapter.GroupFooterHeight; + FHeaderLineHeight := Adapter.HeaderHeight; + + if Adapter.DataRowHeightAssigned then + FDetailsLineHeight := Adapter.DataRowHeight + else + FDetailsLineHeight := DefaultDataRowLineHeight; + + FPreviewLineHeight := DefaultDataRowLineHeight; + + for I := 0 to ColumnCount - 1 do + begin + Column := Columns[I]; + if not Adapter.HeaderHeightAssigned then + CalculateHeight(GetHeaderItemViewParams(Column), FHeaderLineHeight); + {if not Adapter.FooterHeightAssigned then + begin + CalculateHeight(GetGroupFooterItemViewParams(nil, -1, Column), FGroupFooterLineHeight); + CalculateHeight(GetFooterItemViewParams(Column), FFooterLineHeight); + end;} + if not Adapter.FooterHeightAssigned then + CalculateHeight(GetFooterItemViewParams(Column), FFooterLineHeight); + if not Adapter.GroupFooterHeightAssigned then + CalculateHeight(GetGroupFooterItemViewParams(nil, -1, Column), FGroupFooterLineHeight); + if not Adapter.DataRowHeightAssigned and not Column.IsPreview then + CalculateHeight(GetItemViewParams(Column, nil, False), FDetailsLineHeight); + end; + + if not Adapter.GroupRowHeightAssigned then + for I := 0 to RowCount - 1 do + CalculateHeight(GetGroupRowViewParams(Rows[I], -1), FGroupRowLineHeight); + + if HasPreview then + CalculateHeight(GetItemViewParams({PreviewColumn}nil, nil, True), FPreviewLineHeight); + + Inc(FFooterLineHeight, 2 * FooterItemInflateVert - 1); + Inc(FGroupFooterLineHeight, 2 * FooterItemInflateVert - 1); + + CalculateDataRowHeights; +end; + +function TdxGridTableViewFormatter.GetItemPlaceControllerClass: TdxCustomGridTableViewItemPlaceControllerClass; +begin + Result := TdxGridTableViewColumnPlaceController; +end; + +function TdxGridTableViewFormatter.MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; +begin + case AGridBackgroundBitmapIndex of + bbFooter: + Result := vspsGridFooter; + bbGroup: + Result := vspsGridGroup; + bbHeader: + Result := vspsGridHeader; + bbPreview: + Result := vspsGridPreview; + else + Result := 0; + end; + + if Result = 0 then + Result := inherited MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex); +end; + +{$IFDEF DXVER500} + +function TdxGridTableViewFormatter.CanCellMerging: Boolean; +begin + Result := not HasPreview and (RowSeparatorThickness = 0); +end; + +function TdxGridTableViewFormatter.CanColumnCellMerging(AColumn: TcxGridColumn): Boolean; +begin + Result := AColumn.Options.CellMerging; +end; + +procedure TdxGridTableViewFormatter.PerformCellMerging; +var + I: Integer; + Column: TcxGridColumn; +begin + for I := 0 to ColumnCount - 1 do + begin + Column := Columns[I]; + if CanColumnCellMerging(Column) then // because Column.CanCellMerging also performs GridView.CellMerging validation + PerformColumnCellMerging(Column); + end; +end; + +procedure TdxGridTableViewFormatter.PerformColumnCellMerging(AColumn: TcxGridColumn); + + function CanRowBeMergedAsMaster(ARow: TcxCustomGridRow): Boolean; + begin + Result := Adapter.RecordHelpers[ARow].CanCellMergingAsMaster; + end; + + function CanRowBeMergedAsSlave(ARow: TcxCustomGridRow): Boolean; + begin + Result := Adapter.RecordHelpers[ARow].CanCellMergingAsSlave; + end; + + function IsRowMergingSeparator(ARow: TcxCustomGridRow): Boolean; + begin + Result := Adapter.RecordHelpers[ARow].IsCellMergingSeparator; + end; + + procedure RetrieveCellPropertiesAndValue(ARow: TcxCustomGridRow; + out AProperties: TcxCustomEditProperties; out AValue: TcxEditValue); + begin + AProperties := GetItemProperties(AColumn, ARow); + AValue := GetItemValue(AProperties, AColumn, ARow); + end; + + function CompareCellsForMerging(ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; + const AValue1: TcxEditValue; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; + const AValue2: TcxEditValue): Boolean; + begin + Result := GridColumn_DoCompareValuesForCellMerging(AColumn, + ARow1, AProperties1, AValue1, ARow2, AProperties2, AValue2); + end; + + procedure DoMergeCells(AStartRowIndex, AStopRowIndex: Integer); + var + I: Integer; + MasterReportItem, SlaveReportItem: TdxReportVisualItem; + begin + MasterReportItem := GetReportItem(Rows[AStartRowIndex], AColumn); + for I := AStartRowIndex + 1 to AStopRowIndex do + begin + SlaveReportItem := GetReportItem(Rows[I], AColumn); + with MasterReportItem do + Height := Height + SlaveReportItem.Height; + end; + for I := AStartRowIndex + 1 to AStopRowIndex do + begin + SlaveReportItem := GetReportItem(Rows[I], AColumn); + if SlaveReportItem is TdxReportCellString then + TdxReportCellString(SlaveReportItem).Text := ''; + SlaveReportItem.BackgroundBitmapIndex := MasterReportItem.BackgroundBitmapIndex; + if I <> AStopRowIndex then + SlaveReportItem.CellSides := SlaveReportItem.CellSides - [csBottom]; + SlaveReportItem.CellSides := SlaveReportItem.CellSides - [csTop]; + SlaveReportItem.Color := MasterReportItem.Color; + SlaveReportItem.ContentBkColor := MasterReportItem.ContentBkColor; + SlaveReportItem.ContentPattern := MasterReportItem.ContentPattern; + SlaveReportItem.Transparent := True; + end; + end; + +var + I, J: Integer; + Row1, Row2: TcxCustomGridRow; + HasCellsMerging, AreCellsMerged, IsMergingSeparator: Boolean; + Properties1, Properties2: TcxCustomEditProperties; + Value1, Value2: TcxEditValue; +begin + I := 0; + while I < RowCount - 1 do + begin + HasCellsMerging := False; + Row1 := Rows[I]; + if CanRowBeMergedAsMaster(Row1) then + begin + RetrieveCellPropertiesAndValue(Row1, Properties1, Value1); + //AreCellsMerged := False; + IsMergingSeparator := False; + J := I; + repeat + Inc(J); + Row2 := Rows[J]; + if CanRowBeMergedAsSlave(Row2) then + begin + RetrieveCellPropertiesAndValue(Row2, Properties2, Value2); + AreCellsMerged := CompareCellsForMerging(TcxGridDataRow(Row1), + Properties1, Value1, TcxGridDataRow(Row2), Properties2, Value2); + if not HasCellsMerging then + HasCellsMerging := AreCellsMerged; + IsMergingSeparator := IsRowMergingSeparator(Row2); + end + else + AreCellsMerged := False; + until (J = RowCount - 1) or not AreCellsMerged or IsMergingSeparator; + + if HasCellsMerging then + begin + if not AreCellsMerged then Dec(J); + DoMergeCells(I, J); + Inc(J); + end; + I := J; + end + else + Inc(I); + end; +end; + +{$ENDIF} + +procedure TdxGridTableViewFormatter.BuildColumnList; +var + I: Integer; + Column: TcxGridColumn; +begin + FColumns.Clear; + for I := 0 to Adapter.ColumnCount - 1 do + begin + Column := Adapter.Columns[I]; + if IsColumnActuallyVisible(Column) then FColumns.Add(Column); + end; +end; + +procedure TdxGridTableViewFormatter.BuildItemLists; +begin + BuildColumnList; +end; + +function TdxGridTableViewFormatter.IsColumnActuallyVisible(AColumn: TcxGridColumn): Boolean; +begin + Result := AColumn.ActuallyVisible; +end; + +function TdxGridTableViewFormatter.GetViewWidth: Integer; +begin + Result := ItemPlaceController.Width; +end; + +function TdxGridTableViewFormatter.GetColumn(Index: Integer): TcxGridColumn; +begin + Result := TcxGridColumn(FColumns[Index]); +end; + +function TdxGridTableViewFormatter.GetColumnCount: Integer; +begin + Result := FColumns.Count; +end; + +function TdxGridTableViewFormatter.GetGroupRowSeparatorColor: TColor; +begin + Result := Adapter.GroupRowSeparatorColor; +end; + +function TdxGridTableViewFormatter.GetGroupRowSeparatorThickness: Integer; +begin + Result := Adapter.GroupRowSeparatorThickness; +end; + +function TdxGridTableViewFormatter.GetHasPreview: Boolean; +begin + Result := Adapter.HasPreview and ShowPreview and + (PreviewAutoHeight or (PreviewMaxLineCount > 0)); +end; + +function TdxGridTableViewFormatter.GetHeaderLineCount: Integer; +begin + Result := ItemPlaceController.HeaderLineCount; +end; + +function TdxGridTableViewFormatter.GetPreviewAutoHeight: Boolean; +begin + Result := ReportLink.OptionsPreview.AutoHeight; +end; + +function TdxGridTableViewFormatter.GetPreviewColumn: TcxGridColumn; +begin + Result := Adapter.PreviewColumn; +end; + +function TdxGridTableViewFormatter.GetPreviewMaxLineCount: Integer; +begin + Result := ReportLink.OptionsPreview.MaxLineCount; +end; + +function TdxGridTableViewFormatter.GetRow(Index: Integer): TcxCustomGridRow; +begin + Result := inherited Records[Index] as TcxCustomGridRow; +end; + +function TdxGridTableViewFormatter.GetRowCount: Integer; +begin + Result := RecordCount; +end; + +function TdxGridTableViewFormatter.GetRowHeight(Index: Integer): Integer; +begin + Result := Integer(FRowHeights[Index]) +end; + +function TdxGridTableViewFormatter.GetRowHeightByRow(Row: TcxCustomGridRow): Integer; +begin + Result := {20;//}RowHeights[RecordIndexes[Row]]; +end; + +function TdxGridTableViewFormatter.GetRowSeparatorColor: TColor; +begin + Result := Adapter.RowSeparatorColor; + {with ReportLink.OptionsFormatting do + if UseNativeStyles then + begin + Result := FixedColor; + end;} +end; + +function TdxGridTableViewFormatter.GetRowSeparatorThickness: Integer; +begin + Result := Adapter.RowSeparatorThickness; +end; + +function TdxGridTableViewFormatter.GetShowGroupFooters: Boolean; +begin + Result := ReportLink.OptionsView.GroupFooters; +end; + +function TdxGridTableViewFormatter.GetShowFooters: Boolean; +begin + Result := ReportLink.OptionsView.Footers; +end; + +function TdxGridTableViewFormatter.GetShowHeaders: Boolean; +begin + Result := ReportLink.OptionsView.Headers; +end; + +function TdxGridTableViewFormatter.GetShowPreview: Boolean; +begin + Result := ReportLink.OptionsPreview.Visible; +end; + +procedure TdxGridTableViewFormatter.SetRowHeight(Index: Integer; Value: Integer); +begin + FRowHeights[Index] := TObject(Value); +end; + +procedure TdxGridTableViewFormatter.SetRowHeightByRow(Row: TcxCustomGridRow; Value: Integer); +begin + RowHeights[IndexOfRecord(Row)] := Value; +end; + +{ TdxGridTableViewBuilder } + +function TdxGridTableViewBuilder.Adapter: TdxGridTableViewAdapter; +begin + Result := inherited Adapter as TdxGridTableViewAdapter; +end; + +class function TdxGridTableViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxGridTableViewAdapter; +end; + +function TdxGridTableViewBuilder.Formatter: TdxGridTableViewFormatter; +begin + Result := inherited Formatter as TdxGridTableViewFormatter; +end; + +class function TdxGridTableViewBuilder.FormatterClass: TdxGridViewFormatterClass; +begin + Result := TdxGridTableViewFormatter; +end; + +procedure TdxGridTableViewBuilder.AddDelimitersHardVert(AReportRow: TdxReportCell); +begin + ReportLink.FDelimitersHardVert.Add(TObject(AReportRow.AbsoluteRect.Top)); +end; + +procedure TdxGridTableViewBuilder.DoBuildViewBody; +begin + if Formatter.ShowHeaders then CreateHeader; + CreateRows; + if not IsAborted and Formatter.ShowFooters then + CreateFooter; +end; + +procedure TdxGridTableViewBuilder.DoBuildViewFooter; +begin + inherited; + if not Formatter.HasDetailsSeparator then CreateViewTerminator; +end; + +procedure TdxGridTableViewBuilder.CreateDetails(AMasterRow: TcxGridMasterDataRow); +var + CurrentView: TcxCustomGridView; +begin + if AMasterRow.ActiveDetailGridView <> nil then + if ReportLink.OptionsLevels.Unwrap then + begin + ProcessedView := nil; + try + if ReportLink.OptionsLevels.RiseActiveLevelOntoTop then + begin + CurrentView := AMasterRow.ActiveDetailGridView; + CreateDetailView(CurrentView); + ProcessedView := CurrentView; + end; + ReportLink.ForEachView(AMasterRow, CreateDetailView); + finally + ProcessedView := nil; + end; + end + else + CreateDetailView(AMasterRow.ActiveDetailGridView); +end; + +procedure TdxGridTableViewBuilder.CreateDetailView(AGridView: TcxCustomGridView); +begin + if AGridView <> ProcessedView then ReportLink.BuildView(Self, AGridView); +end; + +function TdxGridTableViewBuilder.GetAreDetailsBuilt: Boolean; +begin + with ReportLink.OptionsDetails do + Result := not StartFromFocusedView or not OnlyFocusedView; +end; + +procedure TdxGridTableViewBuilder.CreateFooter; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetFootersProducer.Produce(HostInfoServices.FootersHostInfo); + AddReportRow(ReportRow); +end; + +function TdxGridTableViewBuilder.GetFootersProducer: TdxGridTableViewFootersProducer; +begin + Result := ProducerCache[GetFootersProducerClass] as TdxGridTableViewFootersProducer; +end; + +function TdxGridTableViewBuilder.GetFootersProducerClass: TdxGridTableViewFootersProducerClass; +begin + Result := TdxGridTableViewFootersProducer; +end; + +procedure TdxGridTableViewBuilder.CreateGroupFooters(AGridRow: TcxCustomGridRow); +var + Producer: TdxGridTableViewGroupFooterProducer; + HostInfo: TdxGridAttributeHostInfo; + Index, I: Integer; + ReportRow: TdxReportCell; +begin + Producer := GetGroupFooterProducer; + HostInfo := HostInfoServices.PageDetailsHostInfo; + Index := 0; + for I := 0 to AGridRow.Level do + if Adapter.HasGroupFooter(AGridRow, I) then + begin + ReportRow := Producer.Produce(HostInfo, AGridRow, AGridRow.Level - I, Index); + AddReportRow(ReportRow); + Inc(Index); + end; +end; + +function TdxGridTableViewBuilder.GetGroupFooterProducer: TdxGridTableViewGroupFooterProducer; +begin + Result := ProducerCache[GetGroupFooterProducerClass] as TdxGridTableViewGroupFooterProducer; +end; + +function TdxGridTableViewBuilder.GetGroupFooterProducerClass: TdxGridTableViewGroupFooterProducerClass; +begin + Result := TdxGridTableViewGroupFooterProducer; +end; + +procedure TdxGridTableViewBuilder.CreateHeader; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetHeadersProducer.Produce(HostInfoServices.HeadersHostInfo); + AddReportRow(ReportRow); +end; + +function TdxGridTableViewBuilder.GetHeadersProducer: TdxGridTableViewHeadersProducer; +begin + Result := ProducerCache[GetHeadersProducerClass] as TdxGridTableViewHeadersProducer; +end; + +function TdxGridTableViewBuilder.GetHeadersProducerClass: TdxGridTableViewHeadersProducerClass; +begin + Result := TdxGridTableViewHeadersProducer; +end; + +procedure TdxGridTableViewBuilder.CreateRow(AGridRow: TcxCustomGridRow; ARowIndex: Integer); +var + ReportRow: TdxReportCell; +begin + ReportRow := GetRowProducer(AGridRow).Produce(HostInfoServices.PageDetailsHostInfo, AGridRow, ARowIndex); + AddReportRow(ReportRow); +end; + +function TdxGridTableViewBuilder.GetRowProducer(AGridRow: TcxCustomGridRow): TdxGridTableViewCustomDataRowProducer; +begin + Result := ProducerCache[GetRowProducerClass(AGridRow)] as TdxGridTableViewCustomDataRowProducer; +end; + +procedure TdxGridTableViewBuilder.CreateRows; +var + PrevGridRow, GridRow: TcxCustomGridRow; + I: Integer; + HasGroupDelimiter: Boolean; +begin + PrevGridRow := nil; + for I := 0 to Formatter.RowCount - 1 do + begin + GridRow := Formatter.Rows[I]; + + if (ShowRowSeparators and (I > 0)) and (not (PrevGridRow is TcxGridGroupRow) or not ShowGroupRowSeparators) then + CreateRowSeparator(GridRow, False); + + HasGroupDelimiter := Formatter.PaginateByTopLevelGroups and (I > 0) and + (GridRow.Level = 0) and (GridRow is TcxGridGroupRow); + + CreateRow(GridRow, I); + + // Hard Delimiters + if HasGroupDelimiter then + AddDelimitersHardVert(LastReportRow); + + if AreDetailsBuilt and Adapter.HasDetails(GridRow) then + CreateDetails(GridRow as TcxGridMasterDataRow); + + if ShowGroupRowSeparators and (GridRow is TcxGridGroupRow) then + CreateGroupRowSeparator(TcxGridGroupRow(GridRow)); + + if Formatter.ShowGroupFooters and Adapter.HasGroupFooters(GridRow) then + CreateGroupFooters(GridRow); + + // Last Row Separator + if (ShowRowSeparators and (I = Formatter.RowCount - 1)) and (not (GridRow is TcxGridGroupRow) or not ShowGroupRowSeparators) then + CreateRowSeparator(GridRow, True); + + // Progress + if MasterBuilder = nil then + begin + Progress(100 * (I + 1) / Formatter.RowCount); + if IsAborted then Break; + end; + + PrevGridRow := GridRow; + end; +end; + +function TdxGridTableViewBuilder.GetRowProducerClass(AGridRow: TcxCustomGridRow): TdxGridTableViewCustomDataRowProducerClass; +begin + Result := Adapter.RecordHelpers[AGridRow].ProducerClass; +end; + +procedure TdxGridTableViewBuilder.CreateRowSeparator(AGridRow: TcxCustomGridRow; + AnIsLast: Boolean = False); +var + ReportRow: TdxReportCell; +begin + ReportRow := GetRowSeparatorProducer.Produce(HostInfoServices.PageDetailsHostInfo, AGridRow, AnIsLast); + AddReportRow(ReportRow); +end; + +function TdxGridTableViewBuilder.GetRowSeparatorProducer: TdxGridTableViewRowSeparatorProducer; +begin + Result := ProducerCache[GetRowSeparatorProducerClass] as TdxGridTableViewRowSeparatorProducer; +end; + +function TdxGridTableViewBuilder.GetRowSeparatorProducerClass: TdxGridTableViewRowSeparatorProducerClass; +begin + Result := TdxGridTableViewRowSeparatorProducer; +end; + +function TdxGridTableViewBuilder.GetShowRowSeparators: Boolean; +begin + Result := Adapter.HasRowSeparators; +end; + +procedure TdxGridTableViewBuilder.CreateGroupRowSeparator(AGridRow: TcxGridGroupRow); +var + ReportRow: TdxReportCell; +begin + ReportRow := GetGroupRowSeparatorProducer.Produce(HostInfoServices.PageDetailsHostInfo, AGridRow); + AddReportRow(ReportRow); +end; + +function TdxGridTableViewBuilder.GetGroupRowSeparatorProducer: TdxGridTableViewGroupRowSeparatorProducer; +begin + Result := ProducerCache[GetGroupRowSeparatorProducerClass] as TdxGridTableViewGroupRowSeparatorProducer; +end; + +function TdxGridTableViewBuilder.GetGroupRowSeparatorProducerClass: TdxGridTableViewGroupRowSeparatorProducerClass; +begin + Result := TdxGridTableViewGroupRowSeparatorProducer; +end; + +function TdxGridTableViewBuilder.GetShowGroupRowSeparators: Boolean; +begin + Result := Adapter.IsOffice11StyleGrouping; +end; + +function TdxGridTableViewBuilder.GridView: TcxGridTableView; +begin + Result := inherited GridView as TcxGridTableView; +end; + +class function TdxGridTableViewBuilder.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridTableView; +end; + +function TdxGridTableViewBuilder.GetLastReportRow: TdxReportCell; +begin + Result := ReportRows[ReportRowCount - 1]; +end; + +function TdxGridTableViewBuilder.GetProcessedView: TcxCustomGridView; +begin + Result := ReportLink.FProcessedView; +end; + +procedure TdxGridTableViewBuilder.SetProcessedView(Value: TcxCustomGridView); +begin + ReportLink.FProcessedView := Value; +end; + +{ TdxGridDBTableViewAdapter } + +function TdxGridDBTableViewAdapter.GridView: TcxGridDBTableView; +begin + Result := inherited GridView as TcxGridDBTableView; +end; + +class function TdxGridDBTableViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridDBTableView; +end; + +procedure TdxGridDBTableViewAdapter.AfterBuilding; +begin + UnloadAllRecords; + inherited; +end; + +procedure TdxGridDBTableViewAdapter.BeforeBuilding; +begin + inherited; + LoadAllRecords; +end; + +function TdxGridDBTableViewAdapter.DataController: TcxGridDBDataController; +begin + Result := TcxGridDBDataController(inherited DataController); +end; + +function TdxGridDBTableViewAdapter.DBDataModeController: TcxDBDataModeController; +begin + Result := DataController.DataModeController; +end; + +procedure TdxGridDBTableViewAdapter.LoadAllRecords; +begin + _LoadAllRecords(DBDataModeController, FPrevAllRecordsAreLoaded); +end; + +procedure TdxGridDBTableViewAdapter.UnloadAllRecords; +begin + _UnloadAllRecords(DBDataModeController, FPrevAllRecordsAreLoaded); +end; + +{ TdxGridDBTableViewBuilder } + +function TdxGridDBTableViewBuilder.Adapter: TdxGridDBTableViewAdapter; +begin + Result := inherited Adapter as TdxGridDBTableViewAdapter; +end; + +class function TdxGridDBTableViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxGridDBTableViewAdapter; +end; + +{ TdxGridBandedTableViewAdapter } + +constructor TdxGridBandedTableViewAdapter.Create(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView); +begin + inherited; + FFooterLineCount := -1; +end; + +function TdxGridBandedTableViewAdapter.GridView: TcxGridBandedTableView; +begin + Result := inherited GridView as TcxGridBandedTableView; +end; + +class function TdxGridBandedTableViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridBandedTableView; +end; + +function TdxGridBandedTableViewAdapter.Styles: TcxGridBandedTableViewStyles; +begin + Result := inherited Styles as TcxGridBandedTableViewStyles; +end; + +function TdxGridBandedTableViewAdapter.CalculateDetailsLineCount: Integer; +var + I, J, V: Integer; + BandRows: TcxGridBandRows; +begin + Result := 0; + for I := 0 to BottomBandCount - 1 do + begin + BandRows := BottomBands[I].Rows; + V := 0; + for J := 0 to BandRows.VisibleCount - 1 do + Inc(V, BandRows[J].LineCount); + if Result < V then Result := V; + end; +end; + +function TdxGridBandedTableViewAdapter.CalculateFooterLineCount: Integer; +var + I, V: Integer; +begin + Result := 0; + for I := 0 to BottomBandCount - 1 do + begin + V := BottomBands[I].Rows.Count; + if Result < V then Result := V; + end; +end; + +function TdxGridBandedTableViewAdapter.GetBandHeaderHeight: Integer; +begin + Result := GridView.OptionsView.BandHeaderHeight; +end; + +function TdxGridBandedTableViewAdapter.GetBandHeaderHeightAssigned: Boolean; +begin + Result := BandHeaderHeight <> 0; +end; + +function TdxGridBandedTableViewAdapter.GetBandHeaderViewParams(ABand: TcxGridBand): TcxViewParams; +begin + if (ABand <> nil) and (ABand.Styles <> nil) then + ABand.Styles.GetHeaderParams(Result) + else + Styles.GetBandHeaderParams(ABand, Result); + if ABand = nil then + Result.Color := LookAndFeelPainter.DefaultHeaderBackgroundColor +end; + +function TdxGridBandedTableViewAdapter.GetDataRowHeightAssigned: Boolean; +begin + Result := (DetailsLineCount = 1) and inherited GetDataRowHeightAssigned; +end; + +function TdxGridBandedTableViewAdapter.GetFooterHeightAssigned: Boolean; +begin + Result := (FooterLineCount = 1) and inherited GetFooterHeightAssigned; +end; + +function TdxGridBandedTableViewAdapter.GetHeaderHeightAssigned: Boolean; +begin + Result := (DetailsLineCount = 1) and inherited GetHeaderHeightAssigned; +end; + +function TdxGridBandedTableViewAdapter.GetHeaderMultiline(Column: TcxGridColumn): Boolean; +begin + Result := ((DetailsLineCount = 1) and inherited GetHeaderMultiline(Column)) or + (TcxGridBandedColumn(Column).Position.LineCount > 1); {PS 3.01} +end; + +function TdxGridBandedTableViewAdapter.GetBand(Index: Integer): TcxGridBand; +begin + Result := GridView.Bands.VisibleItems[Index]; +end; + +function TdxGridBandedTableViewAdapter.GetBandCount: Integer; +begin + Result := GridView.Bands.VisibleCount; +end; + +function TdxGridBandedTableViewAdapter.GetBandEndEllipsis: Boolean; +begin + Result := GridView.OptionsView.BandHeaderEndEllipsis; +end; + +function TdxGridBandedTableViewAdapter.GetBandHeaderLineCount: Integer; +begin + Result := GridView.OptionsView.BandHeaderLineCount; +end; + +function TdxGridBandedTableViewAdapter.GetBandHeaderMultiline: Boolean; +begin + Result := BandHeaderHeightAssigned;// or (BandHeaderLineCount > 1); {!!! v3.03} +end; + +function TdxGridBandedTableViewAdapter.GetBottomBand(Index: Integer): TcxGridBand; +begin + {$IFDEF DXVER500} + Result := GridView.Bands.VisibleBottomItems[Index]; + {$ELSE} + Result := GridView.Bands.VisibleItems[Index]; + {$ENDIF} +end; + +function TdxGridBandedTableViewAdapter.GetBottomBandCount: Integer; +begin + {$IFDEF DXVER500} + Result := GridView.Bands.VisibleBottomItemCount; + {$ELSE} + Result := GridView.Bands.VisibleCount; + {$ENDIF} +end; + +function TdxGridBandedTableViewAdapter.GetColumn(Index: Integer): TcxGridBandedColumn; +begin + Result := GridView.VisibleColumns[Index]; +end; + +function TdxGridBandedTableViewAdapter.GetFooterLineCount: Integer; +begin + if FFooterLineCount = -1 then + FFooterLineCount := CalculateFooterLineCount; + Result := FFooterLineCount; +end; + +function TdxGridBandedTableViewAdapter.GetRootBand(Index: Integer): TcxGridBand; +begin + {$IFDEF DXVER500} + Result := GridView.Bands.VisibleRootItems[Index]; + {$ELSE} + Result := GridView.Bands.VisibleItems[Index]; + {$ENDIF} +end; + +function TdxGridBandedTableViewAdapter.GetRootBandCount: Integer; +begin + {$IFDEF DXVER500} + Result := GridView.Bands.VisibleRootItemCount; + {$ELSE} + Result := GridView.Bands.VisibleCount; + {$ENDIF} +end; + +function TdxGridBandedTableViewAdapter.GetThemedBandHeaderItemColor: TColor; +begin + Result := LookAndFeelPainter.DefaultHeaderColor; +end; + +function TdxGridBandedTableViewAdapter.GetThemedBandHeaderItemTextColor: TColor; +begin + Result := LookAndFeelPainter.DefaultHeaderTextColor; +end; + +{ TdxGridBandedTableViewColumnPlace } + +function TdxGridBandedTableViewColumnPlace.GetLineCount: Integer; +begin + Result := Column.Position.LineCount; +end; + +function TdxGridBandedTableViewColumnPlace.GetRowIndex: Integer; +begin + Result := Column.Position.Row.LineOffset; +end; + +function TdxGridBandedTableViewColumnPlace.GetColumn: TcxGridBandedColumn; +begin + Result := inherited Column as TcxGridBandedColumn; +end; + +function TdxGridBandedTableViewColumnPlace.GetController: TdxCustomGridBandedTableViewItemPlace; +begin + Result := inherited Controller as TdxCustomGridBandedTableViewItemPlace; +end; + +function TdxGridBandedTableViewColumnPlace.GetFormatter: TdxGridBandedTableViewFormatter; +begin + Result := inherited Formatter as TdxGridBandedTableViewFormatter; +end; + +{ TdxCustomGridBandedTableViewItemPlace } + +constructor TdxCustomGridBandedTableViewItemPlace.Create(AController: TdxGridBandedTableViewItemPlaceController; + AParent: TdxGridBandedTableViewItemPlace; ABand: TcxGridBand); +begin + inherited Create(AController.Formatter); + FController := AController; + FParent := AParent; + FBand := ABand; + + FHeight := -1; + FLeftBound := -1; + FMinWidth := -1; + FTopBound := -1; +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateHeaderLineCount: Integer; +var + I: Integer; +begin + Result := 0; + with Band.Rows do + for I := 0 to VisibleCount - 1 do + Inc(Result, VisibleItems[I].LineCount); +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateWidth: Integer; + + function FixedSize: Boolean; + var + I: Integer; + begin + Result := False; + for I := 0 to Band.ColumnCount - 1 do + Result := Result or not Band.Columns[I].Options.HorzSizing; + end; + +begin + if FixedSize then + Result := Max(Band.Width, InternalCalculateWidth) + else + begin + Result := Band.Width; + if Result = 0 then + Result := InternalCalculateWidth + end; + if Result = 0 then + Result := cxGridBandedTableView.cxGridDefaultEmptyBandWidth; + if Result < InternalCalculateMinWidth then + Result := InternalCalculateMinWidth; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetItemClass(AColumn: TcxGridColumn): TdxGridTableViewColumnPlaceClass; +begin + Result := TdxGridBandedTableViewColumnPlace; +end; + +procedure TdxCustomGridBandedTableViewItemPlace.AssignWidth; +begin + Width := Width; +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateHeight: Integer; +begin + Result := Controller.CalculateItemHeight(Self); +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateLevelHeight: Integer; +begin + if Adapter.BandHeaderHeightAssigned then + Result := Adapter.BandHeaderHeight + else + Result := CalculateLineHeight * Adapter.BandHeaderLineCount; +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateLineHeight: Integer; +begin + Result := 0; + Formatter.CalculateHeight(ViewParams, Result); +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateMinWidth: Integer; +begin + Result := InternalCalculateMinWidth; + {$IFDEF DXVER500} + if Result < Band.MinWidth then Result := Band.MinWidth; + {$ENDIF} +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateLeftBound: Integer; +begin + Result := Controller.CalculateItemLeftBound(Self); +end; + +function TdxCustomGridBandedTableViewItemPlace.CalculateTopBound: Integer; +begin + Result := Controller.CalculateItemTopBound(Self); +end; + +function TdxCustomGridBandedTableViewItemPlace.GetRowCount: Integer; +begin + Result := 0; +end; + +function TdxCustomGridBandedTableViewItemPlace.InternalCalculateMinWidth: Integer; +begin + Result := 0; +end; + +function TdxCustomGridBandedTableViewItemPlace.InternalCalculateWidth: Integer; +begin + Result := 0; +end; + +procedure TdxCustomGridBandedTableViewItemPlace.InitAutoWidthItem(AnItem: TcxAutoWidthItem); +begin + AnItem.Fixed := IsFixed; + AnItem.MinWidth := MinWidth; + AnItem.Width := Width; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetAdapter: TdxGridBandedTableViewAdapter; +begin + Result := inherited Adapter as TdxGridBandedTableViewAdapter; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetBounds: TRect; +begin + Result := MakeBounds(LeftBound, TopBound, Width, Height); +end; + +function TdxCustomGridBandedTableViewItemPlace.GetFormatter: TdxGridBandedTableViewFormatter; +begin + Result := inherited Formatter as TdxGridBandedTableViewFormatter; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetHeight: Integer; +begin + if FHeight = -1 then + FHeight := CalculateHeight; + Result := FHeight; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetIndex: Integer; +begin + if Parent <> nil then + Result := Parent.IndexOf(Self) + else + Result := Controller.RootIndexOf(Self); +end; + +function TdxCustomGridBandedTableViewItemPlace.GetIsFixed: Boolean; +begin + Result := not Band.Options.Sizing; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetLeftBound: Integer; +begin + if FLeftBound = -1 then + FLeftBound := CalculateLeftBound; + Result := FLeftBound; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetLevelIndex: Integer; +begin + {$IFDEF DXVER500} + Result := Band.BandLevelIndex; + {$ELSE} + Result := 0; + {$ENDIF} +end; + +function TdxCustomGridBandedTableViewItemPlace.GetMinWidth: Integer; +begin + if FMinWidth = -1 then + FMinWidth := CalculateMinWidth; + Result := FMinWidth; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetTopBound: Integer; +begin + if FTopBound = -1 then + FTopBound := CalculateTopBound; + Result := FTopBound; +end; + +function TdxCustomGridBandedTableViewItemPlace.GetViewParams: TdxReportItemViewParams; +begin + Result := Formatter.GetBandItemViewParams(Band); +end; + +{ TdxGridBandedTableViewItemPlace } + +constructor TdxGridBandedTableViewItemPlace.Create(AnOwner: TdxGridBandedTableViewItemPlaceController; + AParent: TdxGridBandedTableViewItemPlace; ABand: TcxGridBand); +begin + inherited; + FChildItems := TList.Create; +end; + +destructor TdxGridBandedTableViewItemPlace.Destroy; +begin + FreeAndNil(FChildItems); + inherited; +end; + +function TdxGridBandedTableViewItemPlace.IndexOf(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; +begin + Result := FChildItems.IndexOf(AnItem); +end; + +{$IFDEF DXVER500} +procedure TdxGridBandedTableViewItemPlace.Refresh; +begin + inherited; + RefreshChildItems; +end; +{$ENDIF} + +function TdxGridBandedTableViewItemPlace.GetRowCount: Integer; +begin + Result := 1; +end; + +function TdxGridBandedTableViewItemPlace.InternalCalculateMinWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to ChildItemCount - 1 do + Inc(Result, ChildItems[I].MinWidth); +end; + +function TdxGridBandedTableViewItemPlace.InternalCalculateWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to ChildItemCount - 1 do + Inc(Result, ChildItems[I].Width); +end; + +procedure TdxGridBandedTableViewItemPlace.WidthChanged; +begin + inherited; + CalculateChildItemWidths; +end; + +procedure TdxGridBandedTableViewItemPlace.CalculateChildItemWidths; +var + AutoWidthObject: TcxAutoWidthObject; + I: Integer; +begin + AutoWidthObject := TcxAutoWidthObject.Create(ChildItemCount); + try + for I := 0 to ChildItemCount - 1 do + ChildItems[I].InitAutoWidthItem(AutoWidthObject.AddItem); + AutoWidthObject.AvailableWidth := Width; + AutoWidthObject.Calculate; + + for I := 0 to ChildItemCount - 1 do + ChildItems[I].Width := AutoWidthObject[I].AutoWidth; + finally + AutoWidthObject.Free; + end; +end; + +{$IFDEF DXVER500} +procedure TdxGridBandedTableViewItemPlace.RefreshChildItems; +var + I: Integer; +begin + FChildItems.Count := Band.VisibleChildBandCount; + for I := 0 to FChildItems.Count - 1 do + begin + FChildItems[I] := Controller.ItemsByBand[Band.VisibleChildBands[I]]; + ChildItems[I].FParent := Self; + end; +end; +{$ENDIF} + +function TdxGridBandedTableViewItemPlace.GetChildItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; +begin + Result := TdxCustomGridBandedTableViewItemPlace(FChildItems[Index]); +end; + +function TdxGridBandedTableViewItemPlace.GetChildItemCount: Integer; +begin + Result := FChildItems.Count; +end; + +{ TdxGridBandedTableViewBottomItemPlace } + +procedure TdxGridBandedTableViewBottomItemPlace.AddItems; +var + I, J: Integer; + Row: TcxGridBandRow; +begin + for I := 0 to Band.Rows.VisibleCount - 1 do + begin + Row := Band.Rows.VisibleItems[I]; + for J := 0 to Row.VisibleCount - 1 do + CreateItem(Row.VisibleItems[J]); + end; +end; + +function TdxGridBandedTableViewBottomItemPlace.CalculateItemLeftBound(AnItem: TdxGridTableViewColumnPlace): Integer; +var + Row: TcxGridBandRow; + I: Integer; + Item: TdxGridTableViewColumnPlace; +begin + Result := LeftBound; + Row := TdxGridBandedTableViewColumnPlace(AnItem).Column.Position.Row; + for I := 0 to TdxGridBandedTableViewColumnPlace(AnItem).Column.Position.VisibleColIndex - 1 do + begin + Item := ItemsByColumn[Row.VisibleItems[I]]; + Inc(Result, Item.Width); + end; +end; + +procedure TdxGridBandedTableViewBottomItemPlace.CalculateItemsWidth; +var + I, J: Integer; + Row: TcxGridBandRow; + AutoWidthObject: TcxAutoWidthObject; + Column: TcxGridColumn; +begin + for I := 0 to Band.Rows.VisibleCount - 1 do + begin + Row := Band.Rows.VisibleItems[I]; + AutoWidthObject := TcxAutoWidthObject.Create(Row.VisibleCount); + try + for J := 0 to Row.VisibleCount - 1 do + ItemsByColumn[Row.VisibleItems[J]].InitAutoWidthItem(AutoWidthObject.AddItem); + AutoWidthObject.AvailableWidth := ItemsAvailableWidth; + AutoWidthObject.Calculate; + + for J := 0 to Row.VisibleCount - 1 do + begin + Column := Row.VisibleItems[J]; + ItemsByColumn[Column].Width := AutoWidthObject[J].AutoWidth; + end; + finally + AutoWidthObject.Free; + end; + end; +end; + +function TdxGridBandedTableViewBottomItemPlace.GetItemsAutoWidth: Boolean; +begin + Result := True; +end; + +function TdxGridBandedTableViewBottomItemPlace.GetItemsAvailableWidth: Integer; +begin + Result := Width; +end; + +function TdxGridBandedTableViewBottomItemPlace.GetRowCount: Integer; +begin + Result := Controller.LevelCount - LevelIndex; +end; + +function TdxGridBandedTableViewBottomItemPlace.InternalCalculateMinWidth: Integer; +var + I, V, J: Integer; + Row: TcxGridBandRow; + Column: TcxGridColumn; +begin + Result := 0; + for I := 0 to Band.Rows.VisibleCount - 1 do + begin + V := 0; + Row := Band.Rows.VisibleItems[I]; + for J := 0 to Row.VisibleCount - 1 do + begin + Column := Row.VisibleItems[J]; + Inc(V, Adapter.InternalColumnMinWidths[Column]); + end; + //if Row.IsFirst then + // Inc(V, Formatter.IndentWidth * Formatter.IndentCount); + if Result < V then Result := V; + end +end; + +function TdxGridBandedTableViewBottomItemPlace.InternalCalculateWidth: Integer; +var + I, V, J: Integer; + Row: TcxGridBandRow; + Column: TcxGridColumn; +begin + Result := 0; + for I := 0 to Band.Rows.VisibleCount - 1 do + begin + V := 0; + Row := Band.Rows.VisibleItems[I]; + for J := 0 to Row.VisibleCount - 1 do + begin + Column := Row.VisibleItems[J]; + Inc(V, Adapter.InternalColumnWidths[Column]); + end; + if Result < V then Result := V; + end; +end; + +procedure TdxGridBandedTableViewBottomItemPlace.WidthChanged; +begin + inherited; + CalculateItemsWidth; +end; + +{ TdxGridBandedTableViewItemPlaceController } + +constructor TdxGridBandedTableViewItemPlaceController.Create(AFormatter: TdxGridTableViewFormatter); +begin + inherited; + FBottomItems := TList.Create; + FItems := TList.Create; + FRootItems := TList.Create; + FLevelHeights := TList.Create; + + FHeight := -1; + FLevelCount := -1; +end; + +destructor TdxGridBandedTableViewItemPlaceController.Destroy; +begin + FreeAndNil(FLevelHeights); + FreeAndNil(FRootItems); + FreeAndNilItems; + FreeAndNil(FBottomItems); + inherited; +end; + +procedure TdxGridBandedTableViewItemPlaceController.Calculate; +begin + CalculateLevelHeights; + CalculateItemWidths; +end; + +procedure TdxGridBandedTableViewItemPlaceController.Refresh; +begin + ClearItems; + AddItems; + RefreshRootItems; + RefreshBottomItems; + RefreshItems; +end; + +function TdxGridBandedTableViewItemPlaceController.IndexOf(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; +begin + Result := FItems.IndexOf(AnItem); +end; + +function TdxGridBandedTableViewItemPlaceController.IndexOf(ABand: TcxGridBand): Integer; +begin + for Result := 0 to ItemCount - 1 do + if Items[Result].Band = ABand then + Exit; + Result := -1; +end; + +function TdxGridBandedTableViewItemPlaceController.RootIndexOf(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; +begin + Result := FRootItems.IndexOf(AnItem); +end; + +function TdxGridBandedTableViewItemPlaceController.RootIndexOf(ABand: TcxGridBand): Integer; +begin + for Result := 0 to RootItemCount - 1 do + if RootItems[Result].Band = ABand then + Exit; + Result := -1; +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateHeaderLineCount: Integer; +var + I, V: Integer; +begin + Result := -1; + for I := 0 to BottomItemCount - 1 do + begin + V := BottomItems[I].HeaderLineCount; + if Result < V then Result := V; + end; +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to RootItemCount - 1 do + Inc(Result, RootItems[I].Width); +end; + +function TdxGridBandedTableViewItemPlaceController.GetItemByColumn(Column: TcxGridColumn): TdxGridTableViewColumnPlace; +var + BandPlace: TdxCustomGridBandedTableViewItemPlace; +begin + BandPlace := ItemsByBand[TcxGridBandedColumn(Column).Position.Band]; + if BandPlace <> nil then + Result := BandPlace.ItemsByColumn[Column] + else + Result := nil; +end; + +procedure TdxGridBandedTableViewItemPlaceController.AddItems; +var + I: Integer; +begin + FItems.Count := Formatter.BandCount; + for I := 0 to ItemCount - 1 do + FItems[I] := CreateItem(Formatter.Bands[I]); +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateHeight: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to LevelCount - 1 do + Inc(Result, LevelHeights[I]); +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateItemHeight(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; +var + I: Integer; +begin + Result := 0; + for I := AnItem.LevelIndex to AnItem.LevelIndex + AnItem.RowCount - 1 do + Inc(Result, LevelHeights[I]); +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateItemLeftBound(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; +var + I: Integer; +begin + if AnItem.Parent <> nil then + begin + Result := AnItem.Parent.LeftBound; + for I := 0 to AnItem.Index - 1 do + Inc(Result, AnItem.Parent.ChildItems[I].Width); + end + else + begin + Result := 0; + for I := 0 to AnItem.Index - 1 do + Inc(Result, RootItems[I].Width); + end; +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateItemTopBound(AnItem: TdxCustomGridBandedTableViewItemPlace): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to AnItem.LevelIndex - 1 do + Inc(Result, LevelHeights[I]); +end; + +function TdxGridBandedTableViewItemPlaceController.CalculateLevelCount: Integer; +var + I, V: Integer; +begin + Result := 0; + if ItemCount <> 0 then + begin + for I := 0 to ItemCount - 1 do + begin + V := Items[I].LevelIndex; + if Result < V then Result := V; + end; + Inc(Result); + end; +end; + +procedure TdxGridBandedTableViewItemPlaceController.CalculateItemWidths; +var + I: Integer; + AutoWidthObject: TcxAutoWidthObject; +begin + for I := 0 to RootItemCount - 1 do + RootItems[I].AssignWidth; + + if AutoWidth then + begin + AutoWidthObject := TcxAutoWidthObject.Create(RootItemCount); + try + for I := 0 to RootItemCount - 1 do + RootItems[I].InitAutoWidthItem(AutoWidthObject.AddItem); + AutoWidthObject.AvailableWidth := AvailableWidth; + AutoWidthObject.Calculate; + + for I := 0 to RootItemCount - 1 do + RootItems[I].Width := AutoWidthObject[I].AutoWidth; + finally + AutoWidthObject.Free; + end; + end; +end; + +procedure TdxGridBandedTableViewItemPlaceController.CalculateLevelHeights; +var + I, V: Integer; + Item: TdxCustomGridBandedTableViewItemPlace; +begin + FLevelHeights.Count := LevelCount; + for I := 0 to ItemCount - 1 do + begin + Item := Items[I]; + V := Item.CalculateLevelHeight; + if LevelHeights[Item.LevelIndex] < V then + LevelHeights[Item.LevelIndex] := V; + end; +end; + +procedure TdxGridBandedTableViewItemPlaceController.ClearItems; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + Items[I].Free; + FItems.Clear; +end; + +function TdxGridBandedTableViewItemPlaceController.CreateItem(ABand: TcxGridBand): TdxCustomGridBandedTableViewItemPlace; +begin + Result := GetItemClass(ABand).Create(Self, nil, ABand); +end; + +function TdxGridBandedTableViewItemPlaceController.GetItemClass(ABand: TcxGridBand): TdxCustomGridBandedTableViewItemPlaceClass; +begin + {$IFDEF DXVER500} + if ABand.IsBottom then + Result := TdxGridBandedTableViewBottomItemPlace + else + Result := TdxGridBandedTableViewItemPlace; + {$ELSE} + Result := TdxGridBandedTableViewBottomItemPlace; + {$ENDIF} +end; + +procedure TdxGridBandedTableViewItemPlaceController.RefreshBottomItems; +var + I: Integer; +begin + FBottomItems.Count := Adapter.BottomBandCount; + for I := 0 to BottomItemCount - 1 do + FBottomItems[I] := ItemsByBand[Adapter.BottomBands[I]]; +end; + +procedure TdxGridBandedTableViewItemPlaceController.RefreshItems; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + Items[I].Refresh; +end; + +procedure TdxGridBandedTableViewItemPlaceController.RefreshRootItems; +var + I: Integer; +begin + FRootItems.Count := Adapter.RootBandCount; + for I := 0 to RootItemCount - 1 do + FRootItems[I] := ItemsByBand[Adapter.RootBands[I]]; +end; + +function TdxGridBandedTableViewItemPlaceController.GetAdapter: TdxGridBandedTableViewAdapter; +begin + Result := Formatter.Adapter; +end; + +function TdxGridBandedTableViewItemPlaceController.GetAutoWidth: Boolean; +begin + Result := Formatter.AutoWidth; +end; + +function TdxGridBandedTableViewItemPlaceController.GetAvailableWidth: Integer; +begin + Result := Formatter.ViewAvailableWidth; +end; + +function TdxGridBandedTableViewItemPlaceController.GetBottomItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; +begin + Result := TdxCustomGridBandedTableViewItemPlace(FBottomItems[Index]); +end; + +function TdxGridBandedTableViewItemPlaceController.GetBottomItemCount: Integer; +begin + Result := FBottomItems.Count; +end; + +function TdxGridBandedTableViewItemPlaceController.GetFormatter: TdxGridBandedTableViewFormatter; +begin + Result := inherited Formatter as TdxGridBandedTableViewFormatter; +end; + +function TdxGridBandedTableViewItemPlaceController.GetHeight: Integer; +begin + if FHeight = -1 then + FHeight := CalculateHeight; + Result := FHeight; +end; + +function TdxGridBandedTableViewItemPlaceController.GetItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; +begin + Result := TdxCustomGridBandedTableViewItemPlace(FItems[Index]); +end; + +function TdxGridBandedTableViewItemPlaceController.GetItemByBand(Band: TcxGridBand): TdxCustomGridBandedTableViewItemPlace; +var + Index: Integer; +begin + Index := IndexOf(Band); + if Index <> -1 then + Result := Items[IndexOf(Band)] + else + Result := nil; +end; + +function TdxGridBandedTableViewItemPlaceController.GetItemCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxGridBandedTableViewItemPlaceController.GetLevelCount: Integer; +begin + if FLevelCount = -1 then + FLevelCount := CalculateLevelCount; + Result := FLevelCount; +end; + +function TdxGridBandedTableViewItemPlaceController.GetLevelHeight(Index: Integer): Integer; +begin + Result := Integer(FLevelHeights[Index]); +end; + +function TdxGridBandedTableViewItemPlaceController.GetRootItem(Index: Integer): TdxCustomGridBandedTableViewItemPlace; +begin + Result := TdxCustomGridBandedTableViewItemPlace(FRootItems[Index]); +end; + +function TdxGridBandedTableViewItemPlaceController.GetRootItemCount: Integer; +begin + Result := FRootItems.Count; +end; + +procedure TdxGridBandedTableViewItemPlaceController.SetLevelHeight(Index: Integer; Value: Integer); +begin + FLevelHeights[Index] := TObject(Value); +end; + +procedure TdxGridBandedTableViewItemPlaceController.FreeAndNilItems; +begin + ClearItems; + FreeAndNil(FItems); +end; + +{ TdxGridBandedTableViewFormatter } + +constructor TdxGridBandedTableViewFormatter.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited; + FBands := TList.Create; +end; + +destructor TdxGridBandedTableViewFormatter.Destroy; +begin + FreeAndNil(FBands); + inherited; +end; + +function TdxGridBandedTableViewFormatter.Adapter: TdxGridBandedTableViewAdapter; +begin + Result := Builder.Adapter; +end; + +function TdxGridBandedTableViewFormatter.Builder: TdxGridBandedTableViewBuilder; +begin + Result := inherited Builder as TdxGridBandedTableViewBuilder; +end; + +procedure TdxGridBandedTableViewFormatter.DoInitializeBandItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +var + Band: TcxGridBand; +begin + Band := Bands[AnIndex]; + SetViewParams(AnItem, GetBandItemViewParams(Band)); + if HasBackgroundBitmap(bbBandHeader) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbBandHeader); + + RegisterLookAndFeelItem(AnItem, cesRaised); + + with AnItem as TdxReportCellString do + begin + Data := Integer(Band); + EndEllipsis := Adapter.BandEndEllipsis; + Multiline := Adapter.BandHeaderMultiline; + Text := Band.Caption; + TextAlignX := TextAlignXMap[Band.HeaderAlignmentHorz]; + TextAlignY := TextAlignYMap[Band.HeaderAlignmentVert]; + //Transparent := False; {!!! v3.03} + end; +end; + +procedure TdxGridBandedTableViewFormatter.DoInitializeBandRow(ARow: TdxReportCell); +begin + SetViewParams(ARow, GetBandItemViewParams(nil)); + ARow.Transparent := True; //??? +end; + +procedure TdxGridBandedTableViewFormatter.DoReportLinkInitializeBandItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +begin + ReportLink.DoInitializeBandCell(Adapter.GridView, Bands[AnIndex], TdxReportCellString(AnItem)); +end; + +function TdxGridBandedTableViewFormatter.GetBandItemBounds(AnIndex: Integer): TRect; +var + Item: TdxCustomGridBandedTableViewItemPlace; +begin + Item := ItemPlaceController.ItemsByBand[Bands[AnIndex]]; + if Item <> nil then + Result := Item.Bounds + else + Result := dxPSGlbl.NullRect; +end; + +function TdxGridBandedTableViewFormatter.GetBandItemClass(AnIndex: Integer): TdxReportCellTextClass; +begin + Result := TdxReportCellString; +end; + +function TdxGridBandedTableViewFormatter.GetBandItemViewParams(ABand: TcxGridBand): TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetBandHeaderParams(ABand, Result.NativeParams) + else + Result.NativeParams := Adapter.GetBandHeaderViewParams(ABand); + + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + if ABand <> nil then + begin + Result.NativeParams.Color := Adapter.ThemedBandHeaderItemColor; + Result.NativeParams.TextColor := Adapter.ThemedBandHeaderItemTextColor; + end; + + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := False; +end; + +procedure TdxGridBandedTableViewFormatter.AddHorizontalDelimiters; +var + Origin, I: Integer; + R: TRect; + Item: TdxCustomGridBandedTableViewItemPlace; +begin + if ReportLink.OptionsPagination.Band then + begin + Origin := ViewWidthExtraBefore; + for I := 0 to BandCount - 1 do + begin + Item := ItemPlaceController.ItemsByBand[Bands[I]]; + if Item <> nil then + begin + R := Item.Bounds; + ReportLink.AddHorizontalDelimiter(Origin + R.Left); + ReportLink.AddHorizontalDelimiter(Origin + R.Right); + end; + end; + end; + inherited; +end; + +{$IFDEF DXVER500} +function TdxGridBandedTableViewFormatter.CanColumnCellMerging(AColumn: TcxGridColumn): Boolean; +begin + Result := inherited CanColumnCellMerging(AColumn) and + (TcxGridBandedColumn(AColumn).Position.LineCount = ItemPlaceController.HeaderLineCount); +end; + +function TdxGridBandedTableViewFormatter.IsColumnActuallyVisible(AColumn: TcxGridColumn): Boolean; +begin + Result := inherited IsColumnActuallyVisible(AColumn) and + TcxGridBandedColumn(AColumn).Position.Band.ActuallyVisible; +end; +{$ENDIF} + +function TdxGridBandedTableViewFormatter.GetItemPlaceControllerClass: TdxCustomGridTableViewItemPlaceControllerClass; +begin + Result := TdxGridBandedTableViewItemPlaceController; +end; + +procedure TdxGridBandedTableViewFormatter.BuildBandList; +var + I: Integer; + Band: TcxGridBand; +begin + FBands.Clear; + for I := 0 to Adapter.BandCount - 1 do + begin + Band := Adapter.Bands[I]; + if IsBandActuallyVisible(Band) then FBands.Add(Band); + end; +end; + +procedure TdxGridBandedTableViewFormatter.BuildItemLists; +begin + BuildBandList; + inherited; +end; + +function TdxGridBandedTableViewFormatter.IsBandActuallyVisible(ABand: TcxGridBand): Boolean; +begin + {$IFDEF DXVER500} + Result := ABand.ActuallyVisible; + {$ELSE} + Result := True; + {$ENDIF} +end; + +function TdxGridBandedTableViewFormatter.MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; +begin + case AGridBackgroundBitmapIndex of + bbBandHeader: + Result := vspsGridBandHeader; + else + Result := 0; + end; + + if Result = 0 then + Result := inherited MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex); +end; + +function TdxGridBandedTableViewFormatter.GetBand(Index: Integer): TcxGridBand; +begin + Result := TcxGridBand(FBands[Index]); +end; + +function TdxGridBandedTableViewFormatter.GetBandCount: Integer; +begin + Result := FBands.Count; +end; + +function TdxGridBandedTableViewFormatter.GetColumn(Index: Integer): TcxGridBandedColumn; +begin + Result := inherited Columns[Index] as TcxGridBandedColumn; +end; + +function TdxGridBandedTableViewFormatter.GetItemPlaceController: TdxGridBandedTableViewItemPlaceController; +begin + Result := inherited ItemPlaceController as TdxGridBandedTableViewItemPlaceController; +end; + +function TdxGridBandedTableViewFormatter.GetShowBandHeaders: Boolean; +begin + Result := ReportLink.OptionsView.BandHeaders; +end; + +{ TdxGridBandedTableViewBuilder } + +function TdxGridBandedTableViewBuilder.Adapter: TdxGridBandedTableViewAdapter; +begin + Result := inherited Adapter as TdxGridBandedTableViewAdapter; +end; + +class function TdxGridBandedTableViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxGridBandedTableViewAdapter; +end; + +function TdxGridBandedTableViewBuilder.Formatter: TdxGridBandedTableViewFormatter; +begin + Result := inherited Formatter as TdxGridBandedTableViewFormatter; +end; + +class function TdxGridBandedTableViewBuilder.FormatterClass: TdxGridViewFormatterClass; +begin + Result := TdxGridBandedTableViewFormatter; +end; + +procedure TdxGridBandedTableViewBuilder.DoBuildViewBody; +begin + if Formatter.ShowBandHeaders then CreateBands; + if Formatter.ShowHeaders then CreateHeader; + CreateRows; + if Formatter.ShowFooters then CreateFooter; +end; + +procedure TdxGridBandedTableViewBuilder.CreateBands; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetBandsProducer.Produce(HostInfoServices.BandHeadersHostInfo); + AddReportRow(ReportRow); +end; + +function TdxGridBandedTableViewBuilder.GetBandsProducer: TdxGridTableViewBandsProducer; +begin + Result := ProducerCache[GetBandsProducerClass] as TdxGridTableViewBandsProducer; +end; + +function TdxGridBandedTableViewBuilder.GetBandsProducerClass: TdxGridTableViewBandsProducerClass; +begin + Result := TdxGridTableViewBandsProducer; +end; + +function TdxGridBandedTableViewBuilder.GridView: TcxGridBandedTableView; +begin + Result := inherited GridView as TcxGridBandedTableView; +end; + +class function TdxGridBandedTableViewBuilder.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridBandedTableView; +end; + +{ TdxGridDBBandedTableViewAdapter } + +function TdxGridDBBandedTableViewAdapter.GridView: TcxGridDBBandedTableView; +begin + Result := inherited GridView as TcxGridDBBandedTableView; +end; + +class function TdxGridDBBandedTableViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridDBBandedTableView; +end; + +procedure TdxGridDBBandedTableViewAdapter.AfterBuilding; +begin + UnloadAllRecords; + inherited; +end; + +procedure TdxGridDBBandedTableViewAdapter.BeforeBuilding; +begin + inherited; + LoadAllRecords; +end; + +function TdxGridDBBandedTableViewAdapter.DataController: TcxGridDBDataController; +begin + Result := TcxGridDBDataController(inherited DataController); +end; + +function TdxGridDBBandedTableViewAdapter.DBDataModeController: TcxDBDataModeController; +begin + Result := DataController.DataModeController; +end; + +procedure TdxGridDBBandedTableViewAdapter.LoadAllRecords; +begin + _LoadAllRecords(DBDataModeController, FPrevAllRecordsAreLoaded); +end; + +procedure TdxGridDBBandedTableViewAdapter.UnloadAllRecords; +begin + _UnloadAllRecords(DBDataModeController, FPrevAllRecordsAreLoaded); +end; + +{ TdxGridDBBandedTableViewBuilder } + +function TdxGridDBBandedTableViewBuilder.Adapter: TdxGridDBBandedTableViewAdapter; +begin + Result := inherited Adapter as TdxGridDBBandedTableViewAdapter; +end; + +class function TdxGridDBBandedTableViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxGridDBBandedTableViewAdapter; +end; + +{ TdxGridCardViewAdapter } + +function TdxGridCardViewAdapter.GridView: TcxGridCardView; +begin + Result := inherited GridView as TcxGridCardView; +end; + +class function TdxGridCardViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridCardView; +end; + +function TdxGridCardViewAdapter.Styles: TcxGridCardViewStyles; +begin + Result := inherited Styles as TcxGridCardViewStyles; +end; + +procedure TdxGridCardViewAdapter.GetVisibleCardRows(ACard: TcxGridCard; AList: TList); +{$IFNDEF DXVER500} +var + I: Integer; +{$ENDIF} +begin + {$IFDEF DXVER500} + ACard.GetVisibleRows(AList); + {$ELSE} + for I := 0 to CardRowCount - 1 do + AList.Add(CardRows[I]); + {$ENDIF} +end; + +procedure TdxGridCardViewAdapter.ExpandAllRows(AnOptionsExpanding: TdxGridReportLinkOptionsExpanding; + ARecursive: Boolean); +begin + {$IFDEF DXVER500} + if AnOptionsExpanding.ExpandCards then GridView.ViewData.Expand(True); + {$ENDIF} +end; + +function TdxGridCardViewAdapter.IsFirstRow(ACardRow: TcxGridCardViewRow): Boolean; +begin + Result := ACardRow.VisibleIndex = 0; +end; + +function TdxGridCardViewAdapter.IsLastRow(ACardRow: TcxGridCardViewRow): Boolean; +begin + Result := ACardRow.VisibleIndex = CardRowCount - 1; +end; + +function TdxGridCardViewAdapter.GetAreAllMasterRowsCollapsed: Boolean; +begin + Result := True; +end; + +function TdxGridCardViewAdapter.GetCaptionRowViewParams(ARecord: TcxCustomGridRecord; + ACardRow: TcxGridCardViewRow): TcxViewParams; +begin + if (ACardRow <> nil) and (ACardRow.Styles.CaptionRow <> nil) then + ACardRow.Styles.GetCaptionRowParams(ARecord, Result) + else + Styles.GetCaptionRowParams(ARecord, ACardRow, Result); +end; + +function TdxGridCardViewAdapter.GetCardViewParams(ARecord: TcxCustomGridRecord): TcxViewParams; +begin + Styles.GetContentParams(ARecord, nil, Result); +end; + +function TdxGridCardViewAdapter.GetContentViewParams(ARecord: TcxCustomGridRecord; + ATableItem: TcxCustomGridTableItem): TcxViewParams; +begin + if TcxGridCardViewRow(ATableItem).Kind = rkData then + Result := inherited GetContentViewParams(ARecord, ATableItem) + else + Result := GetCaptionRowViewParams(ARecord, TcxGridCardViewRow(ATableItem)); +end; + +function TdxGridCardViewAdapter.GetRowCaptionViewParams(ARecord: TcxCustomGridRecord; + ACardRow: TcxGridCardViewRow): TcxViewParams; +begin + if (ACardRow <> nil) and (ACardRow.Kind = rkData) then + if ACardRow.Styles.Caption <> nil then + ACardRow.Styles.GetCaptionParams(ARecord, Result) + else + Styles.GetRowCaptionParams(ARecord, ACardRow, Result) + else + Result := GetCaptionRowViewParams(ARecord, ACardRow); +end; + +function TdxGridCardViewAdapter.GetCaptionSeparator: string; +begin + Result := GridView.OptionsView.CaptionSeparator; +end; + +function TdxGridCardViewAdapter.GetCard(Index: Integer): TcxGridCard; +begin + Result := Records[Index] as TcxGridCard; +end; + +function TdxGridCardViewAdapter.GetCardCount: Integer; +begin + Result := RecordCount; +end; + +function TdxGridCardViewAdapter.GetCardCaptionWidth: Integer; +begin + Result := GridView.OptionsView.CaptionWidth; +end; + +function TdxGridCardViewAdapter.GetCardRow(Index: Integer): TcxGridCardViewRow; +begin + Result := GridView.VisibleRows[Index]; +end; + +function TdxGridCardViewAdapter.GetCardRowCount: Integer; +begin + Result := GridView.VisibleRowCount; +end; + +function TdxGridCardViewAdapter.GetCardSeparatorColor: Integer; +begin + Result := GridView.OptionsView.SeparatorColor; +end; + +function TdxGridCardViewAdapter.GetCardSeparatorThickness: Integer; +begin + Result := GridView.OptionsView.SeparatorWidth; +end; + +function TdxGridCardViewAdapter.GetCardWidth: Integer; +begin + Result := GridView.OptionsView.CardWidth; +end; + +function TdxGridCardViewAdapter.GetHasCardsSeparator: Boolean; +begin + Result := CardSeparatorThickness <> 0; +end; + +function TdxGridCardViewAdapter.GetRowAutoHeight: Boolean; +begin + with GridView.OptionsView do + Result := CellAutoHeight or RowCaptionAutoHeight; +end; + +function TdxGridCardViewAdapter.GetRowCaptionAutoHeight: Boolean; +begin + Result := GridView.OptionsView.RowCaptionAutoHeight; +end; + +function TdxGridCardViewAdapter.GetRowCaptionEndEllipsis: Boolean; +begin + Result := GridView.OptionsView.RowCaptionEndEllipsis; +end; + +function TdxGridCardViewAdapter.GetShowRowCaption(Index: Integer): Boolean; +begin + Result := CardRows[Index].Options.ShowCaption; +end; + +{ TdxGridCardViewFormatter } + +function TdxGridCardViewFormatter.Adapter: TdxGridCardViewAdapter; +begin + Result := Builder.Adapter; +end; + +function TdxGridCardViewFormatter.Builder: TdxGridCardViewBuilder; +begin + Result := inherited Builder as TdxGridCardViewBuilder; +end; + +procedure TdxGridCardViewFormatter.DoInitializeCard(ACard: TdxReportCard; + AGridCard: TcxGridCard); +begin + with ReportLink.OptionsCards.Shadow do + begin + ACard.ShadowColor := ActualColor; + ACard.ShadowDepth := Depth; + ACard.ShadowPosition := Position; + end; + + SetViewParams(ACard, GetCardViewParams(AGridCard)); + + ACard.Data := Integer(AGridCard); + ACard.Width := Adapter.CardWidth; + ACard.CreateRows(Builder); +end; + +procedure TdxGridCardViewFormatter.DoInitializeCardsRow(ACard: TdxReportCell); +begin + if HasBackgroundBitmap(bbBackground) then + ACard.BackgroundBitmapIndex := GetBackgroundBitmapIndex(bbBackground); + ACard.CellSides := []; +end; + +function TdxGridCardViewFormatter.GetCardClass(AGridCard: TcxGridCard): TdxReportCardClass; +begin + Result := TdxReportCard; +end; + +function TdxGridCardViewFormatter.GetCardViewParams(ARecord: TcxCustomGridRecord): TdxReportItemViewParams; +begin + Result.NativeParams := Adapter.GetCardViewParams(ARecord); + Result.CellSides := csAll;//[]; // because of Card Shadow + Result.FontStyle := []; + Result.Transparent := True; +end; + +procedure TdxGridCardViewFormatter.DoInitializeCardRowCaption(AnItem: TdxReportCellText; + ACardRow: TcxGridCardViewRow; AGridCard: TcxGridCard); +const + BackgroundBitmapIndexes: array[TcxGridCardViewRowKind] of Integer = + (bbRowCaption, bbCaptionRow{$IFDEF GRID6}, bbCaptionRow{$ENDIF}); +begin + SetViewParams(AnItem, GetCardRowCaptionViewParams(AGridCard, ACardRow)); + if HasBackgroundBitmap(BackgroundBitmapIndexes[ACardRow.Kind]) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(BackgroundBitmapIndexes[ACardRow.Kind]); + + with AnItem as TdxReportCellString do + begin + EndEllipsis := Adapter.RowCaptionEndEllipsis; + Multiline := {True; //}not EndEllipsis and not CaptionAutoWidth and Adapter.RowCaptionAutoHeight; + TextAlignX := TextAlignXMap[ACardRow.CaptionAlignmentHorz]; + if Multiline then + TextAlignY := TextAlignYMap[ACardRow.CaptionAlignmentVert] + else + TextAlignY := taTop; + end; + AnItem.Text := ACardRow.Caption + Adapter.CaptionSeparator; +end; + +procedure TdxGridCardViewFormatter.DoReportLinkInitializeCardRowCaption(AnItem: TdxReportCellText; + ACardRow: TcxGridCardViewRow; AGridCard: TcxGridCard); +begin + ReportLink.DoInitializeCardRowCaptionCell(Adapter.GridView, AGridCard, ACardRow, TdxReportCellString(AnItem)); +end; + +function TdxGridCardViewFormatter.GetCardRowCaptionClass(ACardRow: TcxGridCardViewRow): TdxReportCellTextClass; +begin + Result := TdxReportCellString; +end; + +function TdxGridCardViewFormatter.GetCardRowCaptionViewParams(ARecord: TcxCustomGridRecord; + ACardRow: TcxGridCardViewRow): TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + if ACardRow.Kind = rkData then + ReportLink.Styles.GetCardRowCaptionParams(ARecord, ACardRow, Result.NativeParams) + else + if CanProcessSelectionStyle(ARecord) then + ReportLink.Styles.GetSelectionParams(Result.NativeParams) + else + ReportLink.Styles.GetCardCaptionRowParams(ARecord, ACardRow, Result.NativeParams) + else + if (ACardRow.Kind = rkCaption) and CanProcessSelectionStyle(ARecord) then + Result.NativeParams := Adapter.GetSelectionViewParams + else + Result.NativeParams := Adapter.GetRowCaptionViewParams(ARecord, ACardRow); + + // v.3.1 - because of fact that each Card in Grid v.5 might has different number of Rows, + // CellSides initialization was moved inside ReportCard + Result.CellSides := []; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); // ReportLink.FixedTransparent +end; + +procedure TdxGridCardViewFormatter.DoReportLinkInitializeCardRowData(AnItem: TAbstractdxReportCellData; + ACardRow: TcxGridCardViewRow; AGridCard: TcxGridCard); +begin + ReportLink.DoInitializeCardRowDataCell(Adapter.GridView, AGridCard, ACardRow, TdxReportCellString(AnItem)); +end; + +function TdxGridCardViewFormatter.GetItemViewParams(ATableItem: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; AnIsPreview: Boolean = False): TdxReportItemViewParams; +var + CardRow: TcxGridCardViewRow; +begin + CardRow := TcxGridCardViewRow(ATableItem); + if ReportLink.OptionsFormatting.UseNativeStyles then + if CardRow.Kind = rkData then + ReportLink.Styles.GetContentParams(ARecord, CardRow, Result.NativeParams) + else + if CanProcessSelectionStyle(ARecord) then + ReportLink.Styles.GetSelectionParams(Result.NativeParams) + else + ReportLink.Styles.GetCardCaptionRowParams(ARecord, CardRow, Result.NativeParams) + else + if CardRow.Kind = rkData then + Result := inherited GetItemViewParams(ATableItem, ARecord, AnIsPreview) + else + if CanProcessSelectionStyle(ARecord) then + Result.NativeParams := Adapter.GetSelectionViewParams + else + Result.NativeParams := Adapter.GetCaptionRowViewParams(ARecord, CardRow); + + // v.3.1 - because fact that each Card in Grid v.5 might has different number of Rows, + // CellSides initialization was moved inside ReportCard + Result.CellSides := []; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); // ReportLink.FixedTransparent +end; + +procedure TdxGridCardViewFormatter.AddHorizontalDelimiters; +var + I: Integer; +begin + for I := 0 to Builder.CardCount - 1 do + ReportLink.AddHorizontalDelimiter(Builder.Cards[I].AbsoluteRect.Right); +end; + +procedure TdxGridCardViewFormatter.AddVerticalDelimiters; +var + I: Integer; +begin + if NeedDelimitByRows then + begin + for I := 0 to Builder.CardCount - 1 do + Builder.Cards[I].AddVerticalDelimiters; + end + else + inherited; +end; + +function TdxGridCardViewFormatter.GetViewWidth: Integer; +var + MasterBuilder: TdxCustomGridViewBuilder; +begin + MasterBuilder := Builder.MasterBuilder; + if MasterBuilder <> nil then + begin + Result := MasterBuilder.Formatter.ViewWidth - MasterBuilder.Adapter.ViewWidthExtra; + if HasDetailsSeparator then + Dec(Result, 2 * DetailsSeparatorThickness); + end + else + begin + Result := SiteWidth; + if HasDetailsSeparator then + Dec(Result, 2 * DetailsSeparatorThickness); + if Result < Builder.MaxCardWidth + FirstCardOffset then + Result := Builder.MaxCardWidth + FirstCardOffset; + end; +end; + +function TdxGridCardViewFormatter.MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex: Integer): Integer; +begin + case AGridBackgroundBitmapIndex of + bbCaptionRow: + Result := vspsGridCardCaptionRow; + bbRowCaption: + Result := vspsGridCardRowCaption; + else + Result := 0; + end; + + if Result = 0 then + Result := inherited MapStyleBackgroundBitmapIndex(AGridBackgroundBitmapIndex); +end; + +function TdxGridCardViewFormatter.GetContentBackgroundBitmapStyleIndex(ATableItem: TcxCustomGridTableItem): Integer; +const + BackgroundBitmapIndexes: array[TcxGridCardViewRowKind] of Integer = + (bbContent, bbCaptionRow{$IFDEF GRID6}, bbCaptionRow{$ENDIF}); +begin + Result := BackgroundBitmapIndexes[TcxGridCardViewRow(ATableItem).Kind]; +end; + +function TdxGridCardViewFormatter.NeedDelimitByRows: Boolean; +{var + I: Integer;} +begin + Result := False; + {if MasterBuilder = nil then + for I := 0 to Builder.CardCount - 1 do + if Builder.Cards[I].Height > SiteHeight then + begin + Result := True; + Exit; + end;} +end; + +function TdxGridCardViewFormatter.GetAutoWidth: Boolean; +begin + Result := ReportLink.OptionsCards.AutoWidth; +end; + +function TdxGridCardViewFormatter.GetCaptionAutoWidth: Boolean; +begin + Result := Adapter.CardCaptionWidth = 0; +end; + +function TdxGridCardViewFormatter.GetCard(Index: Integer): TcxGridCard; +begin + Result := TcxGridCard(Records[Index]); +end; + +function TdxGridCardViewFormatter.GetCardCount: Integer; +begin + Result := RecordCount; +end; + +function TdxGridCardViewFormatter.GetCardsAreaWidth: Integer; +begin + Result := ViewWidth - FirstCardOffset; +end; + +function TdxGridCardViewFormatter.GetInterCardsSpaceHorz: Integer; +begin + Result := ReportLink.OptionsCards.InterCardsSpaceHorz; +end; + +function TdxGridCardViewFormatter.GetInterCardsSpaceVert: Integer; +begin + Result := ReportLink.OptionsCards.InterCardsSpaceVert; +end; + +function TdxGridCardViewFormatter.GetKeepSameHeight: Boolean; +begin + Result := ReportLink.OptionsCards.KeepSameHeight; +end; + +function TdxGridCardViewFormatter.GetKeepSameWidth: Boolean; +begin + Result := ReportLink.OptionsCards.KeepSameWidth; +end; + +function TdxGridCardViewFormatter.GetRowAutoHeight: Boolean; +begin + Result := Adapter.RowAutoHeight; +end; + +{ TdxReportCardRow } + +constructor TdxReportCardRow.CreateEx(AParent: TdxReportCell; AGridCardRow: TcxGridCardViewRow); +begin + inherited Create(AParent); + CellSides := []; + Data := Integer(AGridCardRow); + Width := Card.RowsAvailableWidth; +end; + +function TdxReportCardRow.MeasureHeight(DC: HDC; ACalculateLineHeight: Boolean; + ABuilder: TdxGridCardViewBuilder): Integer; + + function MeasureCaptionHeight: Integer; + begin + Result := DefaultDataRowLineHeight; + if HasCaption then + if ACalculateLineHeight then + Result := RowCaption.MeasureFontHeight(DC) + else + Result := RowCaption.MeasureContentHeight(DC); + + if Result < DefaultDataRowLineHeight then + Result := DefaultDataRowLineHeight; + end; + + function MeasureDataHeight: Integer; + var + MinHeight: Integer; + begin + MinHeight := RowData.MeasureFontHeight(DC); + if not ACalculateLineHeight then + begin + Result := RowData.MeasureContentHeight(DC); + if Result = 0 then + Result := MinHeight; + end + else + Result := MinHeight; + + ABuilder.DoGetCellHeight(Card.GridCard, GridCardRow, Result); + if Result < MinHeight then + Result := MinHeight; + end; + +begin + Result := Max(MeasureCaptionHeight, MeasureDataHeight); +end; + +function TdxReportCardRow.MeasureCaptionWidth(DC: HDC): Integer; +begin + if HasCaption then + Result := RowCaption.MeasureContentWidth(DC) + 2 + else + Result := 0; +end; + +function TdxReportCardRow.MeasureDataWidth(DC: HDC): Integer; +begin + if dxPSDataMaps.DoesItemParticipateInAutoWidthCalculation(Properties) then + Result := RowData.MeasureContentWidth(DC) + 2 + else + Result := 0; +end; + +procedure TdxReportCardRow.AdjustCellSides; +var + ReportLink: TdxGridReportLink; + Sides: TdxCellSides; +begin + ReportLink := Card.ReportLink; + if ReportLink.OptionsCards.Borders then + begin + Sides := []; + if IsFirstItem then Include(Sides, csTop); + if IsLastItem then Include(Sides, csBottom); + if HasCaption then + begin + RowCaption.CellSides := RowCaption.CellSides + Sides; + RowCaption.CellSides := RowCaption.CellSides + [csLeft]; + end; + RowData.CellSides := RowData.CellSides + Sides; + RowData.CellSides := RowData.CellSides + [csRight]; + if not HasCaption then + RowData.CellSides := RowData.CellSides + [csLeft]; + end; + + if ReportLink.OptionsCards.RowBordersHorz then + begin + Sides := []; + if not IsFirstItem then Include(Sides, csTop); + if not IsLastItem then Include(Sides, csBottom); + if HasCaption then + RowCaption.CellSides := RowCaption.CellSides + Sides; + RowData.CellSides := RowData.CellSides + Sides; + end; + + if ReportLink.OptionsCards.RowBordersVert then + if HasCaption then + begin + RowCaption.CellSides := RowCaption.CellSides + [csRight]; + RowData.CellSides := RowData.CellSides + [csLeft]; + end; +end; + +procedure TdxReportCardRow.CreateItems(ABuilder: TdxGridCardViewBuilder); +const + InitialCaptionWidth = 100; + + function HasRowCaption: Boolean; + begin + Result := ABuilder.Adapter.ShowRowCaption[Index]; + end; + + procedure CreateRowCaption; + var + RowCaption: TdxReportCellText; + begin + RowCaption := ABuilder.Formatter.GetCardRowCaptionClass(GridCardRow).Create(Self); + RowCaption.Width := InitialCaptionWidth; + RowCaption.Height := Height; + RowCaption.Data := Integer(TdxGridCardRowCaption); + ABuilder.Formatter.DoInitializeCardRowCaption(RowCaption, GridCardRow, Card.GridCard); + ABuilder.Formatter.DoReportLinkInitializeCardRowCaption(RowCaption, GridCardRow, Card.GridCard); + end; + + procedure CreateRowData; + var + RowData: TAbstractdxReportCellData; + begin + RowData := ABuilder.Formatter.GetItemClass(GridCardRow, Card.GridCard, False).Create(Self); + if HasRowCaption then + RowData.Left := InitialCaptionWidth + else + RowData.Left := 0; + RowData.Width := Parent.Width - Left; + RowData.Height := DefaultDataRowLineHeight; + ABuilder.Formatter.DoInitializeItem(RowData, GridCardRow, Card.GridCard, False); + ABuilder.Formatter.DoReportLinkInitializeCardRowData(RowData, GridCardRow, Card.GridCard); + end; + +begin + if HasRowCaption then CreateRowCaption; + CreateRowData; + + Width := Width; + Height := Height; +end; + +function TdxReportCardRow.GetCard: TdxReportCard; +begin + Result := TdxReportCard(Parent); +end; + +function TdxReportCardRow.GetGridCardRow: TcxGridCardViewRow; +begin + Result := TcxGridCardViewRow(Data); +end; + +function TdxReportCardRow.GetHasCaption: Boolean; +begin + Result := (DataItemCount > 1) or ((DataItemCount = 1) and (CellCount > 0)); +end; + +function TdxReportCardRow.GetHeight: Integer; +begin + Result := inherited Height; +end; + +function TdxReportCardRow.GetProperties: TcxCustomEditProperties; +begin + Result := GridCardRow.GetProperties; +end; + +function TdxReportCardRow.GetRowCaption: TdxReportCellText; +begin + if HasCaption then + Result := DataItems[0] as TdxReportCellText + else + Result := nil; +end; + +function TdxReportCardRow.GetRowData: TAbstractdxReportCellData; +begin + if CellCount > 0 then + Result := TAbstractdxReportCellData(Cells[0]) + else + begin + if DataItemCount > 0 then + Result := DataItems[DataItemCount - 1] + else + Result := nil; + end; +end; + +function TdxReportCardRow.GetWidth: Integer; +begin + Result := inherited Width; +end; + +procedure TdxReportCardRow.SetHeight(Value: Integer); +begin + inherited Height := Value; + if HasCaption then RowCaption.Height := Height; + RowData.Height := Height; +end; + +procedure TdxReportCardRow.SetRowCaptionWidth(Value: Integer); +begin + if HasCaption then + begin + RowCaption.Width := Value; + RowData.Left := Value; + RowData.Width := Width - Value; + + if RowCaption.Width >= Width then + RowCaption.CellSides := RowCaption.CellSides + [csRight]; + end; +end; + +procedure TdxReportCardRow.SetWidth(Value: Integer); +begin + inherited Width := Value; + + if RowCaption <> nil then + if RowCaption.Width > Width then RowCaption.Width := Width; + + if RowData <> nil then + begin + if RowData.Left > Width then RowData.Left := Width; + RowData.Width := Width - RowData.Left; + end; +end; + +{ TdxCardBorderPainter } + +function TdxCardBorderPainter.Card: TdxReportCard; +begin + Result := inherited Item as TdxReportCard; +end; + +procedure TdxCardBorderPainter.Paint(DC: HDC); +begin + if Card.HasShadow then DrawShadow(DC); +end; + +procedure TdxCardBorderPainter.DrawShadow(DC: HDC); +begin + Renderer.FillRect(DC, Card.ShadowRectHorz, Card.ShadowColor); + Renderer.FillRect(DC, Card.ShadowRectVert, Card.ShadowColor); +end; + +{ TdxReportCard } + +constructor TdxReportCard.Create(AParent: TdxReportCell); +begin + inherited; + ShadowColor := clBlack; + ShadowDepth := dxDefaultCardsShadowDepth; + ShadowPosition := cspBottomRight; +end; + +constructor TdxReportCard.CreateEx(AParent: TdxReportCell; AGridCard: TcxGridCard); +begin + Create(AParent); + Data := Integer(AGridCard); +end; + +function TdxReportCard.GetBorderOuterBounds(DC: HDC): TRect; +begin + Result := inherited GetBorderBounds(DC); + with Result do + case ShadowPosition of + cspTopLeft: + begin + Inc(Left, ShadowDepth); + Inc(Top, ShadowDepth); + end; + cspTopRight: + begin + Dec(Right, ShadowDepth); + Inc(Top, ShadowDepth); + end; + cspBottomRight: + begin + Dec(Right, ShadowDepth); + Dec(Bottom, ShadowDepth); + end; + cspBottomLeft: + begin + Inc(Left, ShadowDepth); + Dec(Bottom, ShadowDepth); + end; + end; +end; + +function TdxReportCard.IndexOfCardRow(ACardRow: TcxGridCardViewRow): Integer; +begin + for Result := 0 to CellCount - 1 do + if Rows[Result].GridCardRow = ACardRow then Exit; + Result := -1; +end; + +procedure TdxReportCard.AdjustHeight; +var + TotalHeight, I: Integer; +begin + TotalHeight := 0; + for I := 0 to RowCount - 1 do + Inc(TotalHeight, RowHeights[I]); + Height := TotalHeight; +end; + +procedure TdxReportCard.AdjustRowsCellSides; +var + I: Integer; +begin + for I := 0 to RowCount - 1 do + Rows[I].AdjustCellSides; +end; + +procedure TdxReportCard.AdjustRowsPos; +var + I: Integer; +begin + for I := 0 to RowCount - 1 do + with Rows[I] do + begin + Left := RowsOriginLeft; + Top := Top + RowsOriginTop; + end; +end; + +procedure TdxReportCard.AdjustRowsHeight(DC: HDC; AAutoHeight: Boolean; + ABuilder: TdxGridCardViewBuilder); +var + I: Integer; +begin + for I := 0 to RowCount - 1 do + RowHeights[I] := Rows[I].MeasureHeight(DC, not AAutoHeight, ABuilder); +end; + +procedure TdxReportCard.AdjustRowsWidth(DC: HDC); +begin + Width := RowCaptionWidth + MeasureDataWidth(DC); +end; + +function TdxReportCard.MeasureCaptionWidth(DC: HDC): Integer; +var + I, V: Integer; +begin + Result := 0; + for I := 0 to RowCount - 1 do + begin + V := Rows[I].MeasureCaptionWidth(DC); + if V > Result then Result := V; + end; +end; + +function TdxReportCard.MeasureDataWidth(DC: HDC): Integer; +var + I, V: Integer; +begin + Result := 0; + for I := 0 to RowCount - 1 do + begin + V := Rows[I].MeasureDataWidth(DC); + if V > Result then Result := V; + end; +end; + +procedure TdxReportCard.AddVerticalDelimiters; +var + I: Integer; +begin + for I := 0 to RowCount - 1 do + ReportLink.AddVerticalDelimiter(Rows[I]); +end; + +procedure TdxReportCard.ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); +begin + inherited; + FShadowDepth := MulDiv(FShadowDepth, APixelsNumerator, APixelsDenominator); +end; + +procedure TdxReportCard.CreateRows(ABuilder: TdxGridCardViewBuilder); +var + I: Integer; + List: TList; + CardRow: TdxReportCardRow; +begin + List := TList.Create; + try + ABuilder.Adapter.GetVisibleCardRows(GridCard, List); + + AllocateSpaceForCells(List.Count); + for I := 0 to List.Count - 1 do + begin + CardRow := TdxReportCardRow.CreateEx(Self, TcxGridCardViewRow(List[I])); + CardRow.CreateItems(ABuilder); + end; + finally + List.Free; + end; +end; + +function TdxReportCard.GetBorderPainterClass: TdxPSCellBorderPainterClass; +begin + Result := TdxCardBorderPainter; +end; + +procedure TdxReportCard.ReadProperties(AReader: TdxPSDataReader); +begin + inherited; + with AReader do + begin + FRowCaptionWidth := ReadInteger; + FShadowColor := ReadInteger; + FShadowDepth := ReadInteger; + FShadowPosition := TdxGridCardShadowPosition(ReadInteger); + end; +end; + +procedure TdxReportCard.WriteProperties(AWriter: TdxPSDataWriter); +begin + inherited; + with AWriter do + begin + WriteInteger(RowCaptionWidth); + WriteInteger(ShadowColor); + WriteInteger(ShadowDepth); + WriteInteger(Integer(ShadowPosition)); + end; +end; + +function TdxReportCard.GetGridCard: TcxGridCard; +begin + Result := TcxGridCard(Data); +end; + +function TdxReportCard.GetHasShadow: Boolean; +begin + Result := ShadowDepth > 0; +end; + +function TdxReportCard.GetHeight: Integer; +begin + Result := inherited Height; +end; + +function TdxReportCard.GetRowCount: Integer; +begin + Result := CellCount; +end; + +function TdxReportCard.GetReportLink: TdxGridReportLink; +begin + Result := TdxGridReportLink(ReportCells.ReportLink); +end; + +function TdxReportCard.GetRow(Index: Integer): TdxReportCardRow; +begin + Result := Cells[Index] as TdxReportCardRow; +end; + +function TdxReportCard.GetRowByCardRow(CardRow: TcxGridCardViewRow): TdxReportCardRow; +begin + Result := Rows[IndexOfCardRow(CardRow)]; +end; + +function TdxReportCard.GetRowHeight(Index: Integer): Integer; +begin + Result := Rows[Index].Height; +end; + +function TdxReportCard.GetRowsAvailableHeight: Integer; +begin + Result := Height - ShadowDepth; +end; + +function TdxReportCard.GetRowsAvailableWidth: Integer; +begin + Result := Width - ShadowDepth; +end; + +function TdxReportCard.GetRowsOriginLeft: Integer; +begin + if ShadowPosition in [cspTopLeft, cspBottomLeft] then + Result := ShadowDepth + else + Result := 0; +end; + +function TdxReportCard.GetRowsOriginTop: Integer; +begin + if ShadowPosition in [cspTopLeft, cspTopRight] then + Result := ShadowDepth + else + Result := 0; +end; + +function TdxReportCard.GetShadowRectHorz: TRect; +begin + Result := BoundsRect; + OffsetRect(Result, -Result.Left, -Result.Top); + with Result do + case ShadowPosition of + cspTopLeft: + begin + Right := Right - ShadowDepth; + Bottom := Top + ShadowDepth; + end; + cspTopRight: + begin + Left := Left + ShadowDepth; + Bottom := Top + ShadowDepth; + end; + cspBottomRight: + begin + Left := Left + ShadowDepth; + Top := Bottom - ShadowDepth; + end; + cspBottomLeft: + begin + Right := Right - ShadowDepth; + Top := Bottom - ShadowDepth; + end; + end; +end; + +function TdxReportCard.GetShadowRectVert: TRect; +begin + Result := BoundsRect; + OffsetRect(Result, -Result.Left, -Result.Top); + with Result do + case ShadowPosition of + cspTopLeft: + begin + Right := Left + ShadowDepth; + Top := Top + ShadowDepth; + Bottom := Bottom - ShadowDepth; + end; + cspTopRight: + begin + Left := Right - ShadowDepth; + Top := Top + ShadowDepth; + Bottom := Bottom - ShadowDepth; + end; + cspBottomRight: + begin + Left := Right - ShadowDepth; + Top := Top + ShadowDepth; + Bottom := Bottom - ShadowDepth; + end; + cspBottomLeft: + begin + Right := Left + ShadowDepth; + Top := Top + ShadowDepth; + Bottom := Bottom - ShadowDepth; + end; + end; +end; + +function TdxReportCard.GetWidth: Integer; +begin + Result := inherited Width; +end; + +procedure TdxReportCard.SetHeight(Value: Integer); +begin + inherited Height := Value + ShadowDepth; +end; + +procedure TdxReportCard.SetRowCaptionWidth(Value: Integer); +var + I: Integer; +begin + if Value < 0 then Value := 0; + + FRowCaptionWidth := Value; + for I := 0 to RowCount - 1 do + Rows[I].RowCaptionWidth := Value; +end; + +procedure TdxReportCard.SetRowHeight(Index, Value: Integer); +var + Delta, I: Integer; +begin + if Value < 0 then Value := 0; + + Delta := Value - Rows[Index].Height; + Rows[Index].Height := Value; + + for I := Index + 1 to RowCount - 1 do + Rows[I].Top := Rows[I].Top + Delta; +end; + +procedure TdxReportCard.SetShadowDepth2(Value: Integer); +var + SaveWidth, SaveHeight: Integer; +begin + if FShadowDepth <> Value then + begin + SaveHeight := RowsAvailableHeight; + SaveWidth := RowsAvailableWidth; + FShadowDepth := Value; + Height := SaveHeight; + Width := SaveWidth; + end; +end; + +procedure TdxReportCard.SetWidth(Value: Integer); +var + I: Integer; +begin + inherited Width := Value + ShadowDepth; + for I := 0 to RowCount - 1 do + Rows[I].Width := RowsAvailableWidth; +end; + +{ TdxGridCardViewBuilder } + +constructor TdxGridCardViewBuilder.Create(AReportLink: TdxGridReportLink; + AMasterBuilder: TdxCustomGridViewBuilder; AGridView: TcxCustomGridView); +begin + inherited; + FCards := TList.Create; +end; + +destructor TdxGridCardViewBuilder.Destroy; +begin + FreeAndNil(FCards); + inherited; +end; + +function TdxGridCardViewBuilder.Adapter: TdxGridCardViewAdapter; +begin + Result := inherited Adapter as TdxGridCardViewAdapter; +end; + +class function TdxGridCardViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxGridCardViewAdapter; +end; + +function TdxGridCardViewBuilder.Formatter: TdxGridCardViewFormatter; +begin + Result := inherited Formatter as TdxGridCardViewFormatter; +end; + +class function TdxGridCardViewBuilder.FormatterClass: TdxGridViewFormatterClass; +begin + Result := TdxGridCardViewFormatter; +end; + +procedure TdxGridCardViewBuilder.DoBuildViewBody; +begin + CreateCards; + if not IsAborted then + begin + ResizeCards; + PlaceCards; + AdjustCardRowsCellSides; + end; +end; + +procedure TdxGridCardViewBuilder.AdjustCardRowsCellSides; +var + I: Integer; +begin + for I := 0 to CardCount - 1 do + Cards[I].AdjustRowsCellSides; +end; + +procedure TdxGridCardViewBuilder.CreateCards; +var + Producer: TdxGridCardViewCardsRowProducer; + I: Integer; +begin + Producer := GetCardsRowProducer; + + FCards.Count := Formatter.CardCount; + for I := 0 to CardCount - 1 do + begin + FCards[I] := Producer.CreateCard(Host, Formatter.Cards[I]); + if MasterBuilder = nil then + begin + Progress(100 * (I + 1) / Formatter.CardCount); + if IsAborted then Break; + end; + end; +end; + +procedure TdxGridCardViewBuilder.PlaceCards; + + procedure MakeRowIndexes(AnIndexes: TList); + var + I, PlaceWidth, EntryNumber: Integer; + begin + I := 0; + if CardCount > 0 then AnIndexes.Add(TObject(0)); + + while I < CardCount do + begin + PlaceWidth := Formatter.CardsAreaWidth; + EntryNumber := 0; + repeat + Inc(EntryNumber); + if EntryNumber > 1 then + Dec(PlaceWidth, Formatter.InterCardsSpaceHorz); + Dec(PlaceWidth, Cards[I].Width); + if (PlaceWidth >= 0) or (EntryNumber = 1) then + Inc(I); + until (PlaceWidth <= 0) or (I >= CardCount); + AnIndexes.Add(TObject(I)); + end; + end; + + procedure MakeRows(AIndexes: TList; AProducer: TdxGridCardViewCardsRowProducer); + + function GetMaxCardHeight(AStartIndex, AEndIndex: Integer): Integer; + var + I, V: Integer; + begin + Result := Cards[AStartIndex].Height; + {$IFNDEF DXVER500} + if not Formatter.KeepSameHeight then + {$ENDIF} + for I := AStartIndex + 1 to AEndIndex do + begin + V := Cards[I].Height; + if Result < V then Result := V; + end; + end; + + var + RowIndex, StartIndex, EndIndex, I, RowHeight: Integer; + ReportRow: TdxReportCell; + begin + for RowIndex := 0 to AIndexes.Count - 2 do + begin + StartIndex := Integer(AIndexes[RowIndex]); + EndIndex := Integer(AIndexes[RowIndex + 1]) - 1; + + RowHeight := GetMaxCardHeight(StartIndex, EndIndex) + Formatter.InterCardsSpaceHorz; + ReportRow := AProducer.Produce(HostInfoServices.PageDetailsHostInfo, RowHeight); + AddReportRow(ReportRow); + + for I := StartIndex to EndIndex do + AProducer.InjectCard(Cards[I], I - StartIndex); + end; + end; + +var + Indexes: TList; +begin + Indexes := TList.Create; + try + MakeRowIndexes(Indexes); + MakeRows(Indexes, GetCardsRowProducer); + finally + Indexes.Free; + end; +end; + +procedure TdxGridCardViewBuilder.ResizeCards; + + procedure SetCardsRowCaptionWidth(DC: HDC); + var + RowCaptionWidth, I, V: Integer; + begin + if Formatter.CaptionAutoWidth then + begin + RowCaptionWidth := 0; + for I := 0 to CardCount - 1 do + begin + V := Cards[I].MeasureCaptionWidth(DC); + if V > RowCaptionWidth then RowCaptionWidth := V; + end; + end + else + RowCaptionWidth := Adapter.CardCaptionWidth; + + if (RowCaptionWidth > Adapter.CardWidth) and not Formatter.AutoWidth then + RowCaptionWidth := Adapter.CardWidth; + + for I := 0 to CardCount - 1 do + Cards[I].RowCaptionWidth := RowCaptionWidth; + end; + + procedure CalcMaxCardWidth; + var + I, V: Integer; + begin + FMaxCardWidth := 0; + for I := 0 to CardCount - 1 do + begin + V := Cards[I].Width; + if V > FMaxCardWidth then FMaxCardWidth := V; + end; + end; + + procedure SetCardsAutoWidth(DC: HDC); + var + I: Integer; + begin + for I := 0 to CardCount - 1 do + Cards[I].AdjustRowsWidth(DC); + end; + + procedure SetSameCardsWidth(AWidth: Integer); + var + I: Integer; + begin + for I := 0 to CardCount - 1 do + Cards[I].Width := AWidth; + end; + + procedure SetCardsRowHeight(DC: HDC; AAutoHeight: Boolean); + var + I: Integer; + begin + for I := 0 to CardCount - 1 do + Cards[I].AdjustRowsHeight(DC, AAutoHeight, Self); + end; + + procedure SetCardsSameHeights; + var + CardRowHeights: array of Integer; + I, J, RowIndex: Integer; + Card: TdxReportCard; + Row: TdxReportCardRow; + begin + SetLength(CardRowHeights, Adapter.CardRowCount); + + for I := 0 to CardCount - 1 do + begin + Card := Cards[I]; + for J := 0 to Card.RowCount - 1 do + begin + Row := Card.Rows[J]; + RowIndex := Row.GridCardRow.VisibleIndex; + if CardRowHeights[RowIndex] < Row.Height then + CardRowHeights[RowIndex] := Row.Height; + end; + end; + + for I := 0 to CardCount - 1 do + begin + Card := Cards[I]; + for J := 0 to Card.RowCount - 1 do + begin + RowIndex := Card.Rows[J].GridCardRow.VisibleIndex; + Card.RowHeights[J] := CardRowHeights[RowIndex]; + end; + end; + end; + + procedure AdjustCards; + var + I: Integer; + begin + for I := 0 to CardCount - 1 do + with Cards[I] do + begin + AdjustHeight; + AdjustRowsPos; + end; + end; + +begin + FMaxCardWidth := 0; + SetCardsRowCaptionWidth(Formatter.DC); + if Formatter.AutoWidth then + begin + SetCardsAutoWidth(Formatter.DC); + CalcMaxCardWidth; + if Formatter.KeepSameWidth then SetSameCardsWidth(FMaxCardWidth - 4); + end; + CalcMaxCardWidth; + + SetCardsRowHeight(Formatter.DC, Formatter.RowAutoHeight); + if Formatter.KeepSameHeight then SetCardsSameHeights; + + AdjustCards; +end; + +function TdxGridCardViewBuilder.GetCardsRowProducer: TdxGridCardViewCardsRowProducer; +begin + Result := ProducerCache[GetCardsRowProducerClass] as TdxGridCardViewCardsRowProducer; +end; + +function TdxGridCardViewBuilder.GetCardsRowProducerClass: TdxGridCardViewCardsRowProducerClass; +begin + Result := TdxGridCardViewCardsRowProducer; +end; + +function TdxGridCardViewBuilder.GridView: TcxGridCardView; +begin + Result := inherited GridView as TcxGridCardView; +end; + +class function TdxGridCardViewBuilder.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridCardView; +end; + +function TdxGridCardViewBuilder.GetCard(Index: Integer): TdxReportCard; +begin + Result := TdxReportCard(FCards[Index]); +end; + +function TdxGridCardViewBuilder.GetCardCount: Integer; +begin + Result := FCards.Count; +end; + +{ TdxGridDBCardViewAdapter } + +function TdxGridDBCardViewAdapter.GridView: TcxGridDBCardView; +begin + Result := inherited GridView as TcxGridDBCardView; +end; + +class function TdxGridDBCardViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridCardView; +end; + +procedure TdxGridDBCardViewAdapter.AfterBuilding; +begin + UnloadAllRecords; + inherited; +end; + +procedure TdxGridDBCardViewAdapter.BeforeBuilding; +begin + inherited; + LoadAllRecords; +end; + +function TdxGridDBCardViewAdapter.DataController: TcxGridDBDataController; +begin + Result := TcxGridDBDataController(inherited DataController); +end; + +function TdxGridDBCardViewAdapter.DBDataModeController: TcxDBDataModeController; +begin + Result := DataController.DataModeController; +end; + +procedure TdxGridDBCardViewAdapter.LoadAllRecords; +begin + _LoadAllRecords(DBDataModeController, FPrevAllRecordsAreLoaded); +end; + +procedure TdxGridDBCardViewAdapter.UnloadAllRecords; +begin + _UnloadAllRecords(DBDataModeController, FPrevAllRecordsAreLoaded); +end; + +{ TdxGridDBCardViewBuilder } + +function TdxGridDBCardViewBuilder.Adapter: TdxGridDBCardViewAdapter; +begin + Result := inherited Adapter as TdxGridDBCardViewAdapter; +end; + +class function TdxGridDBCardViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxGridDBCardViewAdapter; +end; +{$IFDEF CHARTVIEW} +{ TdxGridChartViewAdapter } + +function TdxGridChartViewAdapter.GridView: TcxGridChartView; +begin + Result := inherited GridView as TcxGridChartView; +end; + +class function TdxGridChartViewAdapter.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridChartView; +end; + +function TdxGridChartViewAdapter.CreateGraphic(AGraphicClass: TGraphicClass; + AWidth: Integer): TGraphic; +var + AGraphic: TGraphic; +begin + if not (AGraphicClass.InheritsFrom(TBitmap) or AGraphicClass.InheritsFrom(TMetaFile)) then + begin + Result := GridView.CreateImage(TBitmap, Max(AWidth, 0), 0); + AGraphic := AGraphicClass.Create; + try + AGraphic.Assign(Result); + finally + Result.Free; + Result := AGraphic; + end; + end + else + Result := GridView.CreateImage(AGraphicClass, Max(AWidth, 0), 0); +end; + +function TdxGridChartViewAdapter.GetCanUseOnEveryPageMode: Boolean; +begin + Result := True; +end; + +{ TdxGridChartViewFormatter } + +function TdxGridChartViewFormatter.Adapter: TdxGridChartViewAdapter; +begin + Result := inherited Adapter as TdxGridChartViewAdapter; +end; + +function TdxGridChartViewFormatter.Builder: TdxGridChartViewBuilder; +begin + Result := inherited Builder as TdxGridChartViewBuilder; +end; + +function TdxGridChartViewFormatter.CreateChartImage: TGraphic; + + function GetWidth: Integer; + begin + if ReportLink.OptionsSize.AutoWidth then + Result := ViewAvailableWidth + else + Result := -1; + end; + +begin + Result := Adapter.CreateGraphic(GraphicClass, GetWidth); +end; + +procedure TdxGridChartViewFormatter.DoInitializeChartItem(AnItem: TdxReportCellGraphic); +begin + AnItem.ImageBuffering := cibNone; + AnItem.Image.Transparent := GraphicTransparent; + AnItem.ImageTransparent := GraphicTransparent; + AnItem.Center := True; +end; + +procedure TdxGridChartViewFormatter.DoReportLinkInitializeChartItem(AnItem: TdxReportCellGraphic); +begin + ReportLink.DoInitializeChartCell(Adapter.GridView, AnItem); +end; + +function TdxGridChartViewFormatter.GetChartItemClass: TdxReportCellGraphicClass; +begin + Result := TdxReportCellGraphic; +end; + +function TdxGridChartViewFormatter.GetViewWidth: Integer; +begin + Result := ViewAvailableWidth; +end; + +function TdxGridChartViewFormatter.GetGraphicClass: TGraphicClass; +begin + Result := ReportLink.OptionsCharts.GraphicClass; +end; + +function TdxGridChartViewFormatter.GetGraphicTransparent: Boolean; +begin + Result := ReportLink.OptionsCharts.Transparent; +end; + +{ TdxGridChartViewBuilder } + +function TdxGridChartViewBuilder.Adapter: TdxGridChartViewAdapter; +begin + Result := inherited Adapter as TdxGridChartViewAdapter; +end; + +class function TdxGridChartViewBuilder.AdapterClass: TdxGridViewAdapterClass; +begin + Result := TdxGridChartViewAdapter; +end; + +function TdxGridChartViewBuilder.Formatter: TdxGridChartViewFormatter; +begin + Result := inherited Formatter as TdxGridChartViewFormatter; +end; + +class function TdxGridChartViewBuilder.FormatterClass: TdxGridViewFormatterClass; +begin + Result := TdxGridChartViewFormatter; +end; + +procedure TdxGridChartViewBuilder.DoBuildViewBody; +begin + inherited; + CreateChart; +end; + +procedure TdxGridChartViewBuilder.CreateChart; +var + ReportRow: TdxReportCell; +begin + ReportRow := GetChartProducer.Produce(HostInfoServices.PageDetailsHostInfo); + AddReportRow(ReportRow); +end; + +function TdxGridChartViewBuilder.GetChartProducer: TdxGridChartViewChartProducer; +begin + Result := ProducerCache[GetChartProducerClass] as TdxGridChartViewChartProducer; +end; + +function TdxGridChartViewBuilder.GetChartProducerClass: TdxGridChartViewChartProducerClass; +begin + Result := TdxGridChartViewChartProducer; +end; + +function TdxGridChartViewBuilder.GridView: TcxGridChartView; +begin + Result := inherited GridView as TcxGridChartView; +end; + +class function TdxGridChartViewBuilder.GridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridChartView; +end; + +{$ENDIF} + +{ TdxGridViewRowProducer } + +constructor TdxGridViewRowProducer.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited Create; + FBuilder := ABuilder; + FMasterIndents := TList.Create; +end; + +destructor TdxGridViewRowProducer.Destroy; +begin + FMasterIndents.Free; + inherited; +end; + +function TdxGridViewRowProducer.Adapter: TdxCustomGridViewAdapter; +begin + Result := Builder.Adapter; +end; + +function TdxGridViewRowProducer.Builder: TdxCustomGridViewBuilder; +begin + Result := FBuilder; +end; + +function TdxGridViewRowProducer.Formatter: TdxCustomGridViewFormatter; +begin + Result := Builder.Formatter; +end; + +function TdxGridViewRowProducer.Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; +begin + FMasterIndents.Clear; + + CalculateRowHeight; + + CreateRowHost(AHostInfo); + CreateRow; + if AutoHeight then + begin + CalculateRowAutoHeight; + FixupRowHeight; + end; + + Inc(AHostInfo.Origin.Y, RowHeight); + Result := Host; +end; + +procedure TdxGridViewRowProducer.AddLeadingMasterIndentsAndSeparators; +var + LeftPos, I: Integer; +begin + LeftPos := 0; + for I := 0 to Formatter.AbsoluteLevel - 1 do + with MasterBuilders[I] do + begin + AddMasterSeparator(Formatter, Adapter, LeftPos, vdskLeading); + AddMasterIndents(Formatter, Adapter, I, LeftPos); + end; + AddMasterSeparator(Formatter, Adapter, LeftPos, vdskLeading); +end; + +procedure TdxGridViewRowProducer.AddMasterIndents(AMasterFormatter: TdxCustomGridViewFormatter; + AMasterAdapter: TdxCustomGridViewAdapter; ALevel: Integer; var ALeftPos: Integer); +var + I: Integer; + Indent: TdxReportCellExpandButton; +begin + for I := 0 to AMasterAdapter.IndentCount - 1 do + begin + Indent := CreateMasterIndent(Host); + Indent.BoundsRect := MakeBounds(ALeftPos, 0, AMasterAdapter.IndentWidth, RowHeight); + InitializeMasterIndent(AMasterFormatter, Indent, I, ALevel); + Inc(ALeftPos, Indent.Width); + end; +end; + +procedure TdxGridViewRowProducer.AddMasterSeparator(AMasterFormatter: TdxCustomGridViewFormatter; + AMasterAdapter: TdxCustomGridViewAdapter; var ALeftPos: Integer; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); +var + Separator: TdxReportCellBox; +begin + if AMasterAdapter.HasDetailsSeparator then + begin + Separator := CreateDetailsSeparator(Host); + Separator.BoundsRect := MakeBounds(ALeftPos, 0, AMasterFormatter.DetailsSeparatorThickness, RowHeight); + InitializeDetailsSeparator(AMasterFormatter, Separator, ASeparatorKind); + Inc(ALeftPos, Separator.Width); + end; +end; + +procedure TdxGridViewRowProducer.AddTrailingMasterSeparators; +var + LeftPos, I: Integer; +begin + LeftPos := Width - Formatter.ViewWidthExtraAfter; + AddMasterSeparator(Formatter, Adapter, LeftPos, vdskTrailing); + for I := Formatter.AbsoluteLevel - 1 downto 0 do + with Builder.AbsoluteBuilders[I] do + AddMasterSeparator(Formatter, Adapter, LeftPos, vdskTrailing); +end; + +function TdxGridViewRowProducer.CalculateItemHeight(DC: HDC; AnItem: TdxReportVisualItem): Integer; +begin + Result := AnItem.MeasureContentHeight(DC); +end; + +procedure TdxGridViewRowProducer.CalculateRowAutoHeight; +var + DC: HDC; + ItemsSite: TdxReportCell; + MaxRowHeight, I, V: Integer; + Item: TdxReportVisualItem; +begin + DC := Self.DC; + ItemsSite := Self.ItemsSite; + MaxRowHeight := 0; + for I := 0 to ItemsSite.DataItemCount - 1 do + begin + Item := ItemsSite.DataItems[I]; + if DoesItemParticipateInRowAutoHeightCalculation(Item) then + begin + V := CalculateItemHeight(DC, Item); + if MaxRowHeight < V then MaxRowHeight := V; + end; + end; + {3.1} + for I := 0 to ItemsSite.CellCount - 1 do + begin + Item := ItemsSite.Cells[I]; + if DoesItemParticipateInRowAutoHeightCalculation(Item) then + begin + V := CalculateItemHeight(DC, Item); + if MaxRowHeight < V then MaxRowHeight := V; + end; + end; + if RowHeight < MaxRowHeight then + RowHeight := MaxRowHeight; +end; + +procedure TdxGridViewRowProducer.CalculateRowHeight; +begin + FRowHeight := LineCount * LineHeight; +end; + +function TdxGridViewRowProducer.CreateDetailsSeparator(AParent: TdxReportCell): TdxReportCellBox; +begin + Result := GetDetailsSeparatorClass.Create(AParent); + FMasterIndents.Add(Result); +end; + +function TdxGridViewRowProducer.CreateMasterIndent(AParent: TdxReportCell): TdxReportCellExpandButton; +begin + Result := GetMasterIndentClass.Create(AParent); + FMasterIndents.Add(Result); +end; + +procedure TdxGridViewRowProducer.CreateRow; +begin + FRow := GetRowHostClass.Create(Host); + FRow.BoundsRect := MakeBounds(RowOriginX, 0, RowWidth, RowHeight); + InitializeRow; + AddTrailingMasterSeparators; +end; + +procedure TdxGridViewRowProducer.CreateRowHost(const AHostInfo: TdxGridAttributeHostInfo); +begin + FHost := HostClass.Create(AHostInfo.Parent); + FHost.BoundsRect := MakeBounds(AHostInfo.Origin.X, AHostInfo.Origin.Y, Width, RowHeight); + InitializeHost; + AddLeadingMasterIndentsAndSeparators; +end; + +function TdxGridViewRowProducer.DoesItemParticipateInRowAutoHeightCalculation(AnItem: TdxReportVisualItem): Boolean; +begin + Result := True; +end; + +function TdxGridViewRowProducer.GetDetailsSeparatorClass: TdxReportCellBoxClass; +begin + Result := Formatter.GetDetailsSeparatorClass; +end; + +function TdxGridViewRowProducer.GetMasterIndentClass: TdxReportCellExpandButtonClass; +begin + Result := Formatter.GetMasterIndentClass; +end; + +procedure TdxGridViewRowProducer.FixupMasterIndentsHeight; +var + I: Integer; +begin + for I := 0 to MasterIndentCount - 1 do + with MasterIndents[I] do + Height := Parent.Height; +end; + +procedure TdxGridViewRowProducer.FixupRowDataItemHeight(AnItem: TdxReportVisualItem); +begin + with AnItem do + Height := Parent.Height; +end; + +procedure TdxGridViewRowProducer.FixupRowDataHeight; +begin +end; + +procedure TdxGridViewRowProducer.FixupRowHeight; +begin + FixupRowOwnHeight; + FixupMasterIndentsHeight; + FixupRowDataHeight; +end; + +procedure TdxGridViewRowProducer.FixupRowOwnHeight; +begin + Host.Height := RowHeight; + Row.Height := RowHeight; + ItemsSite.Height := RowHeight; +end; + +procedure TdxGridViewRowProducer.InitializeDetailsSeparator(AFormatter: TdxCustomGridViewFormatter; + ASeparator: TdxReportCellBox; ASeparatorKind: TdxVerticalDetailsSeparatorKind); +begin + AFormatter.DoInitializeVertDetailsSeparator(ASeparator, ASeparatorKind); +end; + +procedure TdxGridViewRowProducer.InitializeMasterIndent(AFormatter: TdxCustomGridViewFormatter; + AIndent: TdxReportCellExpandButton; AIndex, ALevel: Integer); +begin + AFormatter.DoInitializeMasterIndent(AIndent, AIndex, MasterBuilders[ALevel].Adapter.IndentCount); +end; + +procedure TdxGridViewRowProducer.InitializeHost; +begin + Formatter.DoInitializeHost(Host); +end; + +procedure TdxGridViewRowProducer.InitializeRow; +begin +end; + +function TdxGridViewRowProducer.GetAutoHeight: Boolean; +begin + Result := LineCount = 1; +end; + +function TdxGridViewRowProducer.GetItemsSite: TdxReportCell; +begin + Result := Row; +end; + +function TdxGridViewRowProducer.GetLineCount: Integer; +begin + Result := 1; +end; + +function TdxGridViewRowProducer.GetLineHeight: Integer; +begin + Result := 20; +end; + +function TdxGridViewRowProducer.GetDC: HDC; +begin + Result := Formatter.DC; +end; + +function TdxGridViewRowProducer.GetHostClass: TdxReportCellClass; +begin + Result := Formatter.GetHostClass; +end; + +function TdxGridViewRowProducer.GetIndentWidth: Integer; +begin + Result := Adapter.IndentWidth; +end; + +function TdxGridViewRowProducer.GetMasterBuilder(Index: Integer): TdxCustomGridViewBuilder; +begin + Result := Builder.AbsoluteBuilders[Index]; +end; + +function TdxGridViewRowProducer.GetMasterIndent(Index: Integer): TdxReportCellBox; +begin + Result := TdxReportCellBox(FMasterIndents[Index]); +end; + +function TdxGridViewRowProducer.GetMasterIndentCount: Integer; +begin + Result := FMasterIndents.Count; +end; + +function TdxGridViewRowProducer.GetRowHostClass: TdxReportCellClass; +begin + Result := Formatter.GetRowHostClass; +end; + +function TdxGridViewRowProducer.GetWidth: Integer; +begin + with Formatter do + Result := ViewWidthExtraBefore + ViewWidth + ViewWidthExtraAfter; +end; + +function TdxGridViewRowProducer.GetRowOriginX: Integer; +begin + Result := Formatter.ViewWidthExtraBefore; +end; + +function TdxGridViewRowProducer.GetRowWidth: Integer; +begin + Result := Formatter.ViewWidth; +end; + +{ TdxGridViewCustomRowProducer } + +function TdxGridViewCustomRowProducer.Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; +begin + Result := inherited Produce(AHostInfo); + AddItem; +end; + +procedure TdxGridViewCustomRowProducer.AddItem; +begin + FItem := CreateItem(Row); + FItem.BoundsRect := MakeRect(0, 0, RowWidth, RowHeight); + InitializeItem; +end; + +function TdxGridViewCustomRowProducer.CreateItem(AParent: TdxReportCell): TAbstractdxReportCellData; +begin + Result := GetItemClass.Create(AParent); +end; + +procedure TdxGridViewCustomRowProducer.FixupRowDataHeight; +begin + inherited; + FixupRowDataItemHeight(Item); +end; + +procedure TdxGridViewCustomRowProducer.InitializeItem; +begin +end; + +function TdxGridViewCustomRowProducer.GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TdxGridViewCustomRowProducer.GetItemClass: TdxReportCellDataClass; +begin + Result := TAbstractdxReportCellData; +end; + +{ TdxGridViewCaptionProducer } + +procedure TdxGridViewCaptionProducer.InitializeItem; +begin + inherited; + Formatter.DoInitializeCaption(Item); + Formatter.DoReportLinkInitializeCaption(Item); +end; + +procedure TdxGridViewCaptionProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeCaptionRow(Row); +end; + +function TdxGridViewCaptionProducer.GetItemClass: TdxReportCellDataClass; +begin + Result := Formatter.GetCaptionClass; +end; + +function TdxGridViewCaptionProducer.GetLineHeight: Integer; +begin + Result := Formatter.CaptionLineHeight; +end; + +function TdxGridViewCaptionProducer.GetItem: TdxReportCellText; +begin + Result := TdxReportCellText(inherited Item); +end; + +{ TdxGridViewFilterBarProducer } + +procedure TdxGridViewFilterBarProducer.InitializeItem; +begin + inherited; + Formatter.DoInitializeFilterBar(Item); + Formatter.DoReportLinkInitializeFilterBar(Item); +end; + +procedure TdxGridViewFilterBarProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeFilterBarRow(Row); +end; + +function TdxGridViewFilterBarProducer.GetItemClass: TdxReportCellDataClass; +begin + Result := Formatter.GetFilterBarClass; +end; + +function TdxGridViewFilterBarProducer.GetLineHeight: Integer; +begin + Result := Formatter.FilterBarLineHeight; +end; + +function TdxGridViewFilterBarProducer.GetItem: TdxReportCellText; +begin + Result := TdxReportCellText(inherited Item); +end; + +{ TdxGridViewDetailsSeparatorProducer } + +procedure TdxGridViewDetailsSeparatorProducer.InitializeItem; +begin + inherited; + Formatter.DoInitializeHorzDetailsSeparator(Item); +end; + +procedure TdxGridViewDetailsSeparatorProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeDetailsSeparatorRow(Row); +end; + +function TdxGridViewDetailsSeparatorProducer.GetItemClass: TdxReportCellDataClass; +begin + Result := Formatter.GetDetailsSeparatorClass; +end; + +function TdxGridViewDetailsSeparatorProducer.GetLineHeight: Integer; +begin + Result := Formatter.DetailsSeparatorThickness; +end; + +function TdxGridViewDetailsSeparatorProducer.GetItem: TdxReportCellBox; +begin + Result := TdxReportCellBox(inherited Item); +end; + +{ TdxGridViewDetailsTopSeparatorProducer } + +procedure TdxGridViewDetailsTopSeparatorProducer.InitializeDetailsSeparator( + AFormatter: TdxCustomGridViewFormatter; ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); +begin + if AFormatter = Formatter then + AFormatter.DoInitializeVertTopDetailsSeparator(ASeparator, ASeparatorKind) + else + inherited; +end; + +{ TdxGridViewDetailsBottomSeparatorProducer } + +procedure TdxGridViewDetailsBottomSeparatorProducer.InitializeDetailsSeparator( + AFormatter: TdxCustomGridViewFormatter; ASeparator: TdxReportCellBox; + ASeparatorKind: TdxVerticalDetailsSeparatorKind); +begin + if AFormatter = Formatter then + AFormatter.DoInitializeVertBottomDetailsSeparator(ASeparator, ASeparatorKind) + else + inherited; +end; + +{ TdxGridViewTerminatorProducer } + +procedure TdxGridViewTerminatorProducer.InitializeItem; +begin + inherited; + Formatter.DoInitializeViewTerminator(Item); +end; + +function TdxGridViewTerminatorProducer.GetLineHeight: Integer; +begin + Result := 1; +end; + +{ TdxGridTableViewRowProducer } + +function TdxGridTableViewRowProducer.Adapter: TdxGridTableViewAdapter; +begin + Result := inherited Adapter as TdxGridTableViewAdapter; +end; + +function TdxGridTableViewRowProducer.Builder: TdxGridTableViewBuilder; +begin + Result := inherited Builder as TdxGridTableViewBuilder; +end; + +function TdxGridTableViewRowProducer.Formatter: TdxGridTableViewFormatter; +begin + Result := Builder.Formatter; +end; + +{ TdxGridTableViewRowSubItemsProducer } + +constructor TdxGridTableViewRowSubItemsProducer.Create(ABuilder: TdxCustomGridViewBuilder); +begin + inherited; + FIndents := TList.Create; + FSubItems := TList.Create; +end; + +destructor TdxGridTableViewRowSubItemsProducer.Destroy; +begin + FreeAndNil(FSubItems); + FreeAndNil(FIndents); + inherited; +end; + +function TdxGridTableViewRowSubItemsProducer.Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; +begin + InitializeIndentList; + InitializeSubItemList; + Result := inherited Produce(AHostInfo); +end; + +procedure TdxGridTableViewRowSubItemsProducer.AddIndents(AParent: TdxReportCell); +begin +end; + +procedure TdxGridTableViewRowSubItemsProducer.AddSubItems(AParent: TdxReportCell); +var + I: Integer; + Item: TAbstractdxReportCellData; +begin + for I := 0 to GetSubItemCount - 1 do + if HasSubItem[I] then + begin + Item := CreateSubItem(I, AParent); + Item.BoundsRect := SubItemBounds[I]; // needed before item initialization + InitializeSubItem(Item, I); + end; +end; + +procedure TdxGridTableViewRowSubItemsProducer.CreateRow; +begin + inherited; + AddIndents(Row); + AddSubItems(Row); +end; + +function TdxGridTableViewRowSubItemsProducer.CreateSubItem(AnIndex: Integer; + AParent: TdxReportCell): TAbstractdxReportCellData; +begin + Result := SubItemClasses[AnIndex].Create(AParent); + FSubItems[AnIndex] := Result; +end; + +function TdxGridTableViewRowSubItemsProducer.IsItemIndent(AnItem: TdxReportVisualItem): Boolean; +begin + Result := FIndents.IndexOf(AnItem) <> -1; +end; + +procedure TdxGridTableViewRowSubItemsProducer.FixupIndentsHeight; +var + I: Integer; +begin + for I := 0 to IndentCount - 1 do + with Indents[I] do + Height := Parent.Height; +end; + +procedure TdxGridTableViewRowSubItemsProducer.FixupRowDataHeight; +var + I: Integer; + SubItem: TdxReportVisualItem; +begin + for I := 0 to SubItemCount - 1 do {.SubItemCount} + begin + SubItem := SubItems[I]; + if SubItem <> nil then + FixupRowDataItemHeight(SubItem); + end; +end; + +procedure TdxGridTableViewRowSubItemsProducer.FixupRowHeight; +begin + inherited; + FixupIndentsHeight; +end; + +procedure TdxGridTableViewRowSubItemsProducer.InitializeIndentList; +begin + FIndents.Clear; + FIndents.Count := GetIndentCount; +end; + +procedure TdxGridTableViewRowSubItemsProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin +end; + +procedure TdxGridTableViewRowSubItemsProducer.InitializeSubItemList; +begin + FSubItems.Clear; + FSubItems.Count := GetSubItemCount; +end; + +function TdxGridTableViewRowSubItemsProducer.GetHasSubItem(Index: Integer): Boolean; +begin + Result := True; +end; + +function TdxGridTableViewRowSubItemsProducer.GetIndentCount: Integer; +begin + Result := 0; +end; + +function TdxGridTableViewRowSubItemsProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := MakeRect(0, 0, -1, -1); +end; + +function TdxGridTableViewRowSubItemsProducer.GetSubItemCount: Integer; +begin + Result := Formatter.ColumnCount; +end; + +function TdxGridTableViewRowSubItemsProducer.GetColumn(Index: Integer): TcxGridColumn; +begin + Result := Formatter.Columns[Index]; +end; + +function TdxGridTableViewRowSubItemsProducer.GetIndent(Index: Integer): TdxReportCellExpandButton; +begin + Result := TdxReportCellExpandButton(FIndents[Index]); +end; + +function TdxGridTableViewRowSubItemsProducer.GetSubItem(Index: Integer): TdxReportVisualItem; +begin + Result := TdxReportVisualItem(FSubItems[Index]); +end; + +{ TdxGridTableViewHeadersProducer } + +procedure TdxGridTableViewHeadersProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeHeaderRow(Row); +end; + +procedure TdxGridTableViewHeadersProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeHeaderItem(ASubItem, AIndex); + Formatter.DoReportLinkInitializeHeaderItem(ASubItem, AIndex); +end; + +function TdxGridTableViewHeadersProducer.GetAutoHeight: Boolean; +begin + Result := inherited GetAutoHeight and Adapter.HeaderAutoHeight; +end; + +function TdxGridTableViewHeadersProducer.GetLineCount: Integer; +begin + Result := Adapter.DetailsLineCount; +end; + +function TdxGridTableViewHeadersProducer.GetLineHeight: Integer; +begin + Result := Formatter.HeaderLineHeight; +end; + +function TdxGridTableViewHeadersProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := Formatter.GetHeaderItemBounds(Index); +end; + +function TdxGridTableViewHeadersProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetHeaderItemClass(Index); +end; + +{ TdxGridTableViewFootersProducer } + +procedure TdxGridTableViewFootersProducer.CalculateRowAutoHeight; +begin + inherited; + Inc(FRowHeight, 2 * FooterItemInflateVert); +end; + +procedure TdxGridTableViewFootersProducer.CalculateRowHeight; +begin + if AutoHeight then + inherited + else + RowHeight := LineCount * LineHeight; +end; + +procedure TdxGridTableViewFootersProducer.FixupRowDataItemHeight(AnItem: TdxReportVisualItem); +begin + with AnItem do + Height := Parent.Height - 2 * FooterItemInflateVert; +end; + +procedure TdxGridTableViewFootersProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeFooterRow(Row); +end; + +procedure TdxGridTableViewFootersProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeFooterItem(ASubItem, AIndex); + Formatter.DoReportLinkInitializeFooterItem(ASubItem, AIndex); +end; + +function TdxGridTableViewFootersProducer.GetAutoHeight: Boolean; +var + I: Integer; +begin + Result := inherited GetAutoHeight and Adapter.FooterMultiline; + if Result then + begin + for I := 0 to SubItemCount - 1 do + if HasSubItem[I] then Exit; + Result := False; + end; +end; + +function TdxGridTableViewFootersProducer.GetHasSubItem(Index: Integer): Boolean; +begin + Result := Adapter.HasFooterItem[Index]; +end; + +function TdxGridTableViewFootersProducer.GetLineCount: Integer; +begin + Result := Adapter.DetailsLineCount; +end; + +function TdxGridTableViewFootersProducer.GetLineHeight: Integer; +begin + Result := Formatter.FooterLineHeight; +end; + +function TdxGridTableViewFootersProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := Formatter.GetFooterItemBounds(Index); +end; + +function TdxGridTableViewFootersProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetFooterItemClass(Index); +end; + +{ TdxGridTableViewCustomDataRowProducer } + +function TdxGridTableViewCustomDataRowProducer.Produce(AHostInfo: TdxGridAttributeHostInfo; + AGridRow: TcxCustomGridRow; AGridRowIndex: Integer): TdxReportCell; +begin + FGridRow := AGridRow; + FGridRowIndex := AGridRowIndex; + Result := inherited Produce(AHostInfo); + FGridRowIndex := -1; + FGridRow := nil; +end; + +function TdxGridTableViewCustomDataRowProducer.GridRow: TcxCustomGridRow; +begin + Result := FGridRow; +end; + +procedure TdxGridTableViewCustomDataRowProducer.AddIndents(AParent: TdxReportCell); +var + I: Integer; + Indent: TdxReportCellExpandButton; +begin + inherited; + for I := 0 to IndentCount - 1 do + begin + Indent := CreateIndent(I, AParent); + Indent.BoundsRect := IndentBounds[I]; + InitializeIndent(Indent, I); + end; +end; + +function TdxGridTableViewCustomDataRowProducer.CreateIndent(AnIndex: Integer; + AParent: TdxReportCell): TdxReportCellExpandButton; +begin + Result := Formatter.CreateIndent(AParent); + FIndents[AnIndex] := Result; +end; + +procedure TdxGridTableViewCustomDataRowProducer.InitializeIndent(AIndent: TdxReportCellExpandButton; + AIndex: Integer); +begin +end; + +function TdxGridTableViewCustomDataRowProducer.GetIndentCount: Integer; +begin + Result := GridRow.Level; +end; + +function TdxGridTableViewCustomDataRowProducer.GetLineCount: Integer; +begin + Result := 1; +end; + +function TdxGridTableViewCustomDataRowProducer.GetLineHeight: Integer; +begin + Result := DefaultDataRowLineHeight; +end; + +function TdxGridTableViewCustomDataRowProducer.GetIndentArea: Integer; +begin + Result := IndentCount * IndentWidth; +end; + +function TdxGridTableViewCustomDataRowProducer.GetIndentBounds(Index: Integer): TRect; +begin + Result := MakeBounds(IndentWidth * Index, 0, IndentWidth, RowHeight); +end; + +{ TdxCustomGridTableViewRowSeparatorProducer } + +function TdxCustomGridTableViewRowSeparatorProducer.Produce(AHostInfo: TdxGridAttributeHostInfo; + AGridRow: TcxCustomGridRow): TdxReportCell; +begin + Result := inherited Produce(AHostInfo, AGridRow, -1); +end; + +procedure TdxCustomGridTableViewRowSeparatorProducer.InitializeIndent(AIndent: TdxReportCellExpandButton; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeRowSeparatorIndent(AIndent, AIndex, IndentCount, GridRow); +end; + +function TdxCustomGridTableViewRowSeparatorProducer.GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TdxCustomGridTableViewRowSeparatorProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := MakeRect(IndentArea, 0, RowWidth, RowHeight); +end; + +function TdxCustomGridTableViewRowSeparatorProducer.GetSubItemCount: Integer; +begin + Result := 1; +end; + +{ TdxGridTableViewRowSeparatorProducer } + +function TdxGridTableViewRowSeparatorProducer.Produce(AHostInfo: TdxGridAttributeHostInfo; + AGridRow: TcxCustomGridRow; AnIsLast: Boolean): TdxReportCell; +begin + FIsLast := AnIsLast; + Result := inherited Produce(AHostInfo, AGridRow); +end; + +procedure TdxGridTableViewRowSeparatorProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeSeparatorRow(Row); +end; + +procedure TdxGridTableViewRowSeparatorProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + Formatter.DoInitializeRowSeparator(ASubItem); +end; + +function TdxGridTableViewRowSeparatorProducer.GetIndentCount: Integer; +begin + if not IsLast then + begin + Result := inherited GetIndentCount; + if (Result <> 0) and Adapter.IsOffice11StyleGrouping and not (GridRow is TcxGridGroupRow) then {.2} + Dec(Result); + end + else + Result := 0; +end; + +function TdxGridTableViewRowSeparatorProducer.GetLineHeight: Integer; +begin + Result := Formatter.RowSeparatorThickness; +end; + +function TdxGridTableViewRowSeparatorProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetRowSeparatorClass; +end; + +{ TdxGridTableViewGroupRowSeparatorProducer } + +procedure TdxGridTableViewGroupRowSeparatorProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeGroupSeparatorRow(Row); +end; + +procedure TdxGridTableViewGroupRowSeparatorProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeGroupRowSeparator(ASubItem); +end; + +function TdxGridTableViewGroupRowSeparatorProducer.GetLineHeight: Integer; +begin + Result := Formatter.GroupRowSeparatorThickness; +end; + +function TdxGridTableViewGroupRowSeparatorProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetGroupRowSeparatorClass; +end; + +{ TdxGridTableViewDataRowProducer } + +function TdxGridTableViewDataRowProducer.GridRow: TcxGridDataRow; +begin + Result := inherited GridRow as TcxGridDataRow; +end; + +procedure TdxGridTableViewDataRowProducer.AddPreview(AParent: TdxReportCell); +begin + FPreviewItem := CreatePreview(Row); + + PreviewItem.Left := IndentArea; + // We have to set Width before because we use that value for PreviewHeight calculation + PreviewItem.Width := Width - IndentArea; + Formatter.DoInitializePreview(TAbstractdxReportCellData(PreviewItem), PreviewColumn, GridRow); + PreviewItem.Height := PreviewHeight; + PreviewItem.AdjustContent(Formatter.DC); {3.1} +end; + +procedure TdxGridTableViewDataRowProducer.AddSubItems(AParent: TdxReportCell); +begin + inherited; + if HasPreview then AddPreview(AParent); +end; + +procedure TdxGridTableViewDataRowProducer.CalculateRowAutoHeight; +begin + if CellAutoHeight then inherited; + if PreviewItem <> nil then + RowHeight := RowHeight + PreviewItem.Height; +end; + +function TdxGridTableViewDataRowProducer.CreatePreview(AParent: TdxReportCell): TdxReportVisualItem; +begin + Result := GetPreviewClass.Create(AParent); + FPreviewItem := Result; +end; + +function TdxGridTableViewDataRowProducer.DoesItemParticipateInRowAutoHeightCalculation(AnItem: TdxReportVisualItem): Boolean; +var + TableItem: TcxCustomGridTableItem; + Properties: TcxCustomEditProperties; +begin + Result := AnItem <> FPreviewItem; + // 3.2 + if Result and not IsItemIndent(AnItem) then + begin + TableItem := TcxCustomGridTableItem(AnItem.Data); + Properties := Adapter.GetProperties(TableItem, GridRow); + Result := dxPScxCommon.dxPSDataMaps.DoesItemParticipateInAutoHeightCalculation(Properties); + end; +end; + +function TdxGridTableViewDataRowProducer.GetPreviewClass: TdxReportCellDataClass; +begin + Result := Formatter.GetPreviewClass(PreviewColumn, GridRow); +end; + +procedure TdxGridTableViewDataRowProducer.FixupRowDataHeight; +var + NewHeight, I: Integer; + Item: TdxReportVisualItem; +begin + NewHeight := RowHeight; + if PreviewItem <> nil then + Dec(NewHeight, PreviewItem.Height); + + for I := 0 to Row.DataItemCount - 1 do + begin + Item := Row.DataItems[I]; + if Item = PreviewItem then + if PreviewPlace = cxGridTableView.ppTop then + Item.Top := 0 + else + Item.Top := NewHeight + else + if IsItemIndent(Item) then + begin + Item.Top := 0; + Item.Height := RowHeight; + end + else + begin + if CellAutoHeight then + Item.Height := NewHeight; + if HasPreview and (PreviewPlace = cxGridTableView.ppTop) then + Item.Top := Item.Top + PreviewItem.Height; + end; + end; + {3.1} + for I := 0 to Row.CellCount - 1 do + begin + Item := Row.Cells[I]; + if Item = PreviewItem then + if PreviewPlace = cxGridTableView.ppTop then + Item.Top := 0 + else + Item.Top := NewHeight + else + begin + if CellAutoHeight then + Item.Height := NewHeight; + if HasPreview and (PreviewPlace = cxGridTableView.ppTop) then + Item.Top := Item.Top + PreviewItem.Height; + end; + end; +end; + +procedure TdxGridTableViewDataRowProducer.InitializeIndent(AIndent: TdxReportCellExpandButton; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeDataRowIndent(AIndent, AIndex, IndentCount, GridRow); +end; + +procedure TdxGridTableViewDataRowProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeDataRow(Row, GridRow); +end; + +procedure TdxGridTableViewDataRowProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeItem(ASubItem, Columns[AIndex], GridRow, False); + Formatter.DoReportLinkInitializeItem(ASubItem, Columns[AIndex], GridRow); +end; + +function TdxGridTableViewDataRowProducer.GetAutoHeight: Boolean; +begin + Result := CellAutoHeight or HasPreview; +end; + +function TdxGridTableViewDataRowProducer.GetCellAutoHeight: Boolean; +begin + Result := inherited GetAutoHeight and Adapter.CellAutoHeight; +end; + +function TdxGridTableViewDataRowProducer.GetHasPreview: Boolean; +begin + Result := Formatter.HasPreview; +end; + +function TdxGridTableViewDataRowProducer.GetIndentCount: Integer; +begin + Result := inherited GetIndentCount; + if (Result <> 0) and Adapter.IsOffice11StyleGrouping then {.2} + Dec(Result); +end; + +function TdxGridTableViewDataRowProducer.GetLineCount: Integer; +begin + Result := Adapter.DetailsLineCount; +end; + +function TdxGridTableViewDataRowProducer.GetLineHeight: Integer; +begin + if Formatter.HeaderLineCount = 1 then + Result := Formatter.RowHeights[GridRowIndex] + else + Result := Formatter.DetailsLineHeight; +end; + +function TdxGridTableViewDataRowProducer.GetPreviewHeight: Integer; +begin + Result := PreviewLineCount * PreviewLineHeight; +end; + +function TdxGridTableViewDataRowProducer.GetPreviewLineCount: Integer; +begin + if FPreviewItem <> nil then + if not Formatter.PreviewAutoHeight then + begin + Result := PreviewItem.CalculateLineCount(Formatter.DC); + if Result <> Formatter.PreviewMaxLineCount then + Result := Formatter.PreviewMaxLineCount; + end + else + Result := 1 + else + Result := 0; +end; + +function TdxGridTableViewDataRowProducer.GetPreviewLineHeight: Integer; +var + LineHeight: Integer; +begin + if FPreviewItem <> nil then + if Formatter.PreviewAutoHeight then + begin + Result := PreviewItem.MeasureContentHeight(Formatter.DC); + if Formatter.PreviewMaxLineCount <> 0 then + begin + LineHeight := PreviewItem.MeasureFontHeight(Formatter.DC); + if Result > LineHeight * Formatter.PreviewMaxLineCount then + Result := LineHeight * Formatter.PreviewMaxLineCount; + end; + end + else + Result := PreviewItem.MeasureFontHeight(Formatter.DC) + else + Result := 0; +end; + +function TdxGridTableViewDataRowProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := Formatter.GetItemBounds(GridRow, GridRowIndex, Index); +end; + +function TdxGridTableViewDataRowProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetItemClass(Columns[Index], GridRow, False); +end; + +function TdxGridTableViewDataRowProducer.GetPreviewColumn: TcxGridColumn; +begin + Result := Adapter.PreviewColumn; +end; + +function TdxGridTableViewDataRowProducer.GetPreviewPlace: TcxGridPreviewPlace; +begin + Result := Adapter.PreviewPlace; +end; + +{ TdxGridTableViewGroupRowProducer} + +procedure TdxGridTableViewGroupRowProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeGroupRow(Row, GridRow); +end; + +function TdxGridTableViewGroupRowProducer.GridRow: TcxGridGroupRow; +begin + Result := inherited GridRow as TcxGridGroupRow; +end; + +procedure TdxGridTableViewGroupRowProducer.InitializeIndent(AIndent: TdxReportCellExpandButton; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeGroupRowIndent(AIndent, AIndex, IndentCount, GridRow); +end; + +procedure TdxGridTableViewGroupRowProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeGroupRowItem(ASubItem, GridRow); +end; + +function TdxGridTableViewGroupRowProducer.GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TdxGridTableViewGroupRowProducer.GetIndentCount: Integer; +begin + Result := inherited GetIndentCount + 1; +end; + +function TdxGridTableViewGroupRowProducer.GetLineCount: Integer; +begin + Result := 1; +end; + +function TdxGridTableViewGroupRowProducer.GetLineHeight: Integer; +begin + Result := Formatter.RowHeights[GridRowIndex];//}Formatter.GroupRowLineHeight; {3.1} +end; + +function TdxGridTableViewGroupRowProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := MakeRect(IndentArea, 0, RowWidth, LineHeight); +end; + +function TdxGridTableViewGroupRowProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetGroupRowClass; +end; + +function TdxGridTableViewGroupRowProducer.GetSubItemCount: Integer; +begin + Result := 1; +end; + +{ TdxGridTableViewMasterRowProducer } + +function TdxGridTableViewMasterRowProducer.GridRow: TcxGridMasterDataRow; +begin + Result := inherited GridRow as TcxGridMasterDataRow; +end; + +procedure TdxGridTableViewMasterRowProducer.InitializeIndent(AIndent: TdxReportCellExpandButton; + AIndex: Integer); +begin + //inherited; + Formatter.DoInitializeMasterDataRowIndent(AIndent, AIndex, IndentCount, GridRow); +end; + +procedure TdxGridTableViewMasterRowProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + if AIndex = 0 then + ASubItem.CellSides := ASubItem.CellSides - [csLeft]; +end; + +function TdxGridTableViewMasterRowProducer.GetIndentCount: Integer; +begin + Result := inherited GetIndentCount + 1; +end; + +{ TdxGridTableViewGroupFooterProducer } + +function TdxGridTableViewGroupFooterProducer.Produce(AHostInfo: TdxGridAttributeHostInfo; + AGridRow: TcxCustomGridRow; AGroupLevel, AnIndex: Integer): TdxReportCell; +begin + FGroupLevel := AGroupLevel; + FIndex := AnIndex; + Result := inherited Produce(AHostInfo, AGridRow, -1); + FGroupLevel := -1; +end; + +procedure TdxGridTableViewGroupFooterProducer.AddSubItems(AParent: TdxReportCell); + + function SubstituteParent(AParent: TdxReportCell): TdxReportCell; + begin + Result := TdxReportCell.Create(AParent); + Result.BoundsRect := HostBounds; + Formatter.DoInitializeGroupFooterHost(Result, GridRow, GroupLevel); + end; + +begin + FItemsSite := SubstituteParent(AParent); + inherited AddSubItems(ItemsSite); +end; + +procedure TdxGridTableViewGroupFooterProducer.CalculateRowAutoHeight; +begin + inherited; + Inc(FRowHeight, FooterItemInflateVert); +end; + +procedure TdxGridTableViewGroupFooterProducer.FixupRowDataItemHeight(AnItem: TdxReportVisualItem); +begin + with AnItem do + Height := Parent.Height - 2 * FooterItemInflateVert; +end; + +procedure TdxGridTableViewGroupFooterProducer.InitializeIndent(AIndent: TdxReportCellExpandButton; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeGroupFooterIndent(AIndent, AIndex, IndentCount, GridRow); +end; + +procedure TdxGridTableViewGroupFooterProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeGroupFooterRow(Row, GridRow, GroupLevel); +end; + +procedure TdxGridTableViewGroupFooterProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeGroupFooterItem(ASubItem, AIndex, GridRow, GroupLevel); + Formatter.DoReportLinkInitializeGroupFooterItem(ASubItem, AIndex, GridRow, GroupLevel); +end; + +function TdxGridTableViewGroupFooterProducer.GetAutoHeight: Boolean; +begin + Result := inherited GetAutoHeight and Adapter.GroupFootersMultiline and + ((ItemsSite.DataItemCount <> 0) or (ItemsSite.CellCount <> 0)); +end; + +function TdxGridTableViewGroupFooterProducer.GetHasSubItem(Index: Integer): Boolean; +begin + Result := Adapter.HasGroupFooterItem(GroupLevel, Index); +end; + +function TdxGridTableViewGroupFooterProducer.GetIndentCount: Integer; +begin + Result := GroupLevel; + if Adapter.GroupFootersMode = gfVisibleWhenExpanded then + begin + Inc(Result); + if Adapter.IsOffice11StyleGrouping and (Index = 0) and not (GridRow is TcxGridGroupRow) then + Dec(Result); + end +end; + +function TdxGridTableViewGroupFooterProducer.GetItemsSite: TdxReportCell; +begin + Result := FItemsSite; +end; + +function TdxGridTableViewGroupFooterProducer.GetLineCount: Integer; +begin + Result := Adapter.DetailsLineCount; +end; + +function TdxGridTableViewGroupFooterProducer.GetLineHeight: Integer; +begin + Result := Formatter.GroupFooterLineHeight; +end; + +function TdxGridTableViewGroupFooterProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := Formatter.GetGroupFooterItemBounds(Index, IndentCount); +end; + +function TdxGridTableViewGroupFooterProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetGroupFooterItemClass(Index); +end; + +function TdxGridTableViewGroupFooterProducer.GetGroupLevel: Integer; +begin + Result := FGroupLevel; + if Adapter.GroupFootersMode = gfVisibleWhenExpanded then + Dec(Result); +end; + +function TdxGridTableViewGroupFooterProducer.GetHostBounds: TRect; +begin + Result := MakeRect(IndentArea, 0, Row.Width, Row.Height); +end; + +{ TdxGridTableViewBandsProducer } + +function TdxGridTableViewBandsProducer.Adapter: TdxGridBandedTableViewAdapter; +begin + Result := inherited Adapter as TdxGridBandedTableViewAdapter; +end; + +function TdxGridTableViewBandsProducer.Builder: TdxGridBandedTableViewBuilder; +begin + Result := inherited Builder as TdxGridBandedTableViewBuilder; +end; + +function TdxGridTableViewBandsProducer.Formatter: TdxGridBandedTableViewFormatter; +begin + Result := inherited Formatter as TdxGridBandedTableViewFormatter; +end; + +function TdxGridTableViewBandsProducer.GetSubItemCount: Integer; +begin + Result := Formatter.BandCount; +end; + +procedure TdxGridTableViewBandsProducer.CalculateRowHeight; +begin + FRowHeight := Formatter.ItemPlaceController.Height; +end; + +procedure TdxGridTableViewBandsProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeBandRow(Row); +end; + +procedure TdxGridTableViewBandsProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + inherited; + Formatter.DoInitializeBandItem(ASubItem, AIndex); + Formatter.DoReportLinkInitializeBandItem(ASubItem, AIndex); +end; + +function TdxGridTableViewBandsProducer.GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TdxGridTableViewBandsProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := Formatter.GetBandItemBounds(Index); +end; + +function TdxGridTableViewBandsProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetBandItemClass(Index); +end; + +{ TdxGridCardViewCardsRowProducer } + +function TdxGridCardViewCardsRowProducer.Adapter: TdxGridCardViewAdapter; +begin + Result := inherited Adapter as TdxGridCardViewAdapter; +end; + +function TdxGridCardViewCardsRowProducer.Builder: TdxGridCardViewBuilder; +begin + Result := inherited Builder as TdxGridCardViewBuilder; +end; + +function TdxGridCardViewCardsRowProducer.Formatter: TdxGridCardViewFormatter; +begin + Result := inherited Formatter as TdxGridCardViewFormatter; +end; + +function TdxGridCardViewCardsRowProducer.CreateCard(AParent: TdxReportCell; + AGridCard: TcxGridCard): TdxReportCard; +begin + Result := Formatter.GetCardClass(AGridCard).CreateEx(AParent, AGridCard); + Formatter.DoInitializeCard(Result, AGridCard); +end; + +procedure TdxGridCardViewCardsRowProducer.InjectCard(ACard: TdxReportCard; + AIndex: Integer); +begin + ACard.Parent := Row; + ACard.Left := Formatter.InterCardsSpaceHorz div 2 + + AIndex * (Builder.MaxCardWidth + Formatter.InterCardsSpaceHorz); + ACard.Top := Formatter.InterCardsSpaceVert div 2; +end; + +function TdxGridCardViewCardsRowProducer.Produce(AHostInfo: TdxGridAttributeHostInfo; + ARowHeight: Integer): TdxReportCell; +begin + FRowHeight := ARowHeight; + Result := inherited Produce(AHostInfo); +end; + +procedure TdxGridCardViewCardsRowProducer.CalculateRowHeight; +begin +end; + +function TdxGridCardViewCardsRowProducer.GetAutoHeight: Boolean; +begin + Result := False; +end; + +procedure TdxGridCardViewCardsRowProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeCardsRow(Row); +end; + +{$IFDEF CHARTVIEW} +{ TdxGridViewChartRowProducer } + +function TdxGridChartViewChartProducer.Produce(AHostInfo: TdxGridAttributeHostInfo): TdxReportCell; +begin + try + Result := inherited Produce(AHostInfo); + finally + FreeAndNil(FChartImage); + end; +end; + +function TdxGridChartViewChartProducer.Formatter: TdxGridChartViewFormatter; +begin + Result := inherited Formatter as TdxGridChartViewFormatter; +end; + +procedure TdxGridChartViewChartProducer.CalculateRowHeight; +begin + if ChartImage <> nil then + RowHeight := ChartImage.Height + else + inherited; +end; + +procedure TdxGridChartViewChartProducer.InitializeItem; +begin + inherited; + Item.Image := ChartImage; + + Formatter.DoInitializeChartItem(Item); + Formatter.DoReportLinkInitializeChartItem(Item); +end; + +function TdxGridChartViewChartProducer.GetItemClass: TdxReportCellDataClass; +begin + Result := Formatter.GetChartItemClass; +end; + +function TdxGridChartViewChartProducer.GetChartImage: TGraphic; +begin + if FChartImage = nil then + FChartImage := Formatter.CreateChartImage; + Result := FChartImage; +end; + +function TdxGridChartViewChartProducer.GetItem: TdxReportCellGraphic; +begin + Result := inherited Item as TdxReportCellGraphic; +end; + +{$ENDIF} + +{ TdxGridReportLinkOptions } + +function TdxGridReportLinkOptions.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +{ TdxGridReportLinkOptionsCardsShadow } + +constructor TdxGridReportLinkCardsShadow.Create(AnOptionsCards: TdxGridReportLinkOptionsCards); +begin + inherited Create; + RestoreDefaults; + FOptionsCards := AnOptionsCards; +end; + +procedure TdxGridReportLinkCardsShadow.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkCardsShadow then + with TdxGridReportLinkCardsShadow(Source) do + begin + Self.Color := Color; + Self.Depth := Depth; + Self.Position := Position; + end + else + inherited; +end; + +procedure TdxGridReportLinkCardsShadow.RestoreDefaults; +begin + inherited; + Color := clDefault; + Depth := dxDefaultCardsShadowDepth; + Position := cspBottomRight; +end; + +procedure TdxGridReportLinkCardsShadow.Changed; +begin + if OptionsCards <> nil then OptionsCards.Changed; +end; + +function TdxGridReportLinkCardsShadow.GetActualColor: TColor; +begin + Result := Color; + if Result = clDefault then + Result := dxDefaultCardsShadowColor; +end; + +function TdxGridReportLinkCardsShadow.GetVisible: Boolean; +begin + Result := Depth <> 0; +end; + +procedure TdxGridReportLinkCardsShadow.SetColor(Value: TColor); +begin + if FColor <> Value then + begin + FColor := Value; + if Visible then Changed; + end; +end; + +procedure TdxGridReportLinkCardsShadow.SetDepth(Value: TdxGridCardShadowDepth); +begin + if FDepth <> Value then + begin + FDepth := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkCardsShadow.SetPosition(Value: TdxGridCardShadowPosition); +begin + if FPosition <> Value then + begin + FPosition := Value; + if Visible then Changed; + end; +end; + +{ TdxGridReportLinkOptionsCards } + +destructor TdxGridReportLinkOptionsCards.Destroy; +begin + FreeAndNil(FShadow); + inherited; +end; + +procedure TdxGridReportLinkOptionsCards.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsCards then + with TdxGridReportLinkOptionsCards(Source) do + begin + Self.AutoWidth := AutoWidth; + Self.Borders := Borders; + Self.InterCardsSpaceHorz := InterCardsSpaceHorz; + Self.InterCardsSpaceVert := InterCardsSpaceVert; + Self.KeepSameHeight := KeepSameHeight; + Self.KeepSameWidth := KeepSameWidth; + Self.RowBordersHorz := RowBordersHorz; + Self.RowBordersVert := RowBordersVert; + Self.Shadow := Shadow; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsCards.RestoreDefaults; +begin + inherited; + AutoWidth := False; + Borders := True; + InterCardsSpaceHorz := dxDefaultInterCardsSpaceHorz; + InterCardsSpaceVert := dxDefaultInterCardsSpaceVert; + KeepSameHeight := True; + KeepSameWidth := True; + RowBordersHorz := False; + RowBordersVert := False; + Shadow.RestoreDefaults; +end; + +function TdxGridReportLinkOptionsCards.DesignerTabIndex: Integer; +begin + Result := 5; +end; + +function TdxGridReportLinkOptionsCards.GetShadowClass: TdxGridReportLinkCardsShadowClass; +begin + Result := TdxGridReportLinkCardsShadow; +end; + +function TdxGridReportLinkOptionsCards.GetShadow: TdxGridReportLinkCardsShadow; +begin + if FShadow = nil then + FShadow := GetShadowClass.Create(Self); + Result := FShadow; +end; + +procedure TdxGridReportLinkOptionsCards.SetAutoWidth(Value: Boolean); +begin + if FAutoWidth <> Value then + begin + FAutoWidth := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetBorders(Value: Boolean); +begin + if FBorders <> Value then + begin + FBorders := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetInterCardsSpaceHorz(Value: Integer); +begin + if Value < 0 then Value := 0; + if FInterCardsSpaceHorz <> Value then + begin + FInterCardsSpaceHorz := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetInterCardsSpaceVert(Value: Integer); +begin + if Value < 0 then Value := 0; + if FInterCardsSpaceVert <> Value then + begin + FInterCardsSpaceVert := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetKeepSameHeight(Value: Boolean); +begin + if FKeepSameHeight <> Value then + begin + FKeepSameHeight := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetKeepSameWidth(Value: Boolean); +begin + if FKeepSameWidth <> Value then + begin + FKeepSameWidth := Value; + if AutoWidth then Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetRowBordersHorz(Value: Boolean); +begin + if FRowBordersHorz <> Value then + begin + FRowBordersHorz := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetRowBordersVert(Value: Boolean); +begin + if FRowBordersVert <> Value then + begin + FRowBordersVert := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsCards.SetShadow(Value: TdxGridReportLinkCardsShadow); +begin + Shadow.Assign(Value); +end; + +{ TdxGridReportLinkOptionsPagination } + +procedure TdxGridReportLinkOptionsPagination.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsPagination then + with TdxGridReportLinkOptionsPagination(Source) do + begin + Self.OneGroupPerPage := OneGroupPerPage; + Self.TopLevelGroup := TopLevelGroup; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsPagination.RestoreDefaults; +begin + inherited; + OneGroupPerPage := False; + TopLevelGroup := False; +end; + +function TdxGridReportLinkOptionsPagination.DesignerTabIndex: Integer; +begin + Result := 2; +end; + +function TdxGridReportLinkOptionsPagination.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +procedure TdxGridReportLinkOptionsPagination.SetOneGroupPerPage(Value: Boolean); +begin + if FOneGroupPerPage <> Value then + begin + FOneGroupPerPage := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsPagination.SetTopLevelGroup(Value: Boolean); +begin + if FTopLevelGroup <> Value then + begin + FTopLevelGroup := Value; + Changed; + end; +end; + +{$IFDEF CHARTVIEW} +{ TdxGridReportLinkOptionsCharts } + +procedure TdxGridReportLinkOptionsCharts.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsCharts then + with TdxGridReportLinkOptionsCharts(Source) do + begin + Self.GraphicClass := GraphicClass; + Self.Transparent := Transparent; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsCharts.RestoreDefaults; +begin + inherited; + FIsGraphicClassAssigned := False; + Transparent := False; +end; + +function TdxGridReportLinkOptionsCharts.DefaultGraphicClass: TGraphicClass; +begin + Result := TBitmap; +end; + +function TdxGridReportLinkOptionsCharts.SupportsGraphicClass(AGraphicClass: TGraphicClass): Boolean; +begin + Result := (AGraphicClass <> nil) and not AGraphicClass.InheritsFrom(TIcon); +end; + +function TdxGridReportLinkOptionsCharts.DesignerTabIndex: Integer; +begin + Result := 6; +end; + +function TdxGridReportLinkOptionsCharts.GetGraphicClass: TGraphicClass; +begin + if FIsGraphicClassAssigned then + Result := FGraphicClass + else + Result := DefaultGraphicClass; +end; + +function TdxGridReportLinkOptionsCharts.GetGraphicClassName: string; +begin + Result := GraphicClass.ClassName; +end; + +function TdxGridReportLinkOptionsCharts.IsGraphicClassNameStored: Boolean; +begin + Result := FIsGraphicClassAssigned; +end; + +procedure TdxGridReportLinkOptionsCharts.SetGraphicClass(Value: TGraphicClass); +begin + if Value = nil then + Value := DefaultGraphicClass; + if (GraphicClass <> Value) and SupportsGraphicClass(Value) then + begin + FGraphicClass := Value; + FIsGraphicClassAssigned := Value <> DefaultGraphicClass; + end; +end; + +procedure TdxGridReportLinkOptionsCharts.SetGraphicClassName(const Value: string); +var + AClass: TClass; +begin + AClass := Classes.GetClass(Value); + if (AClass <> nil) and AClass.InheritsFrom(TGraphic) then + GraphicClass := TGraphicClass(AClass) + else + GraphicClass := nil; +end; + +procedure TdxGridReportLinkOptionsCharts.SetTransparent(Value: Boolean); +begin + if FTransparent <> Value then + begin + FTransparent := Value; + Changed; + end; +end; + +{$ENDIF} + +{ TdxGridReportLinkOptionsDetails } + +procedure TdxGridReportLinkOptionsDetails.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsDetails then + with TdxGridReportLinkOptionsDetails(Source) do + begin + Self.OnlyFocusedView := OnlyFocusedView; + Self.StartFromFocusedView := StartFromFocusedView; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsDetails.RestoreDefaults; +begin + inherited; + OnlyFocusedView := False; + StartFromFocusedView := False; +end; + +function TdxGridReportLinkOptionsDetails.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +procedure TdxGridReportLinkOptionsDetails.SetOnlyFocusedView(Value: Boolean); +begin + if FOnlyFocusedView <> Value then + begin + FOnlyFocusedView := Value; + if StartFromFocusedView then Changed; + end; +end; + +procedure TdxGridReportLinkOptionsDetails.SetStartFromFocusedView(Value: Boolean); +begin + if FStartFromFocusedView <> Value then + begin + FStartFromFocusedView := Value; + Changed; + end; +end; + +{ TdxGridReportLinkOptionsExpanding } + +procedure TdxGridReportLinkOptionsExpanding.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsExpanding then + with TdxGridReportLinkOptionsExpanding(Source) do + begin + {$IFDEF DXVER500} + Self.ExpandCards := ExpandCards; + {$ENDIF} + Self.ExpandGroupRows := ExpandGroupRows; + Self.ExpandMasterRows := ExpandMasterRows; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsExpanding.RestoreDefaults; +begin + inherited; + {$IFDEF DXVER500} + ExpandCards := False; + {$ENDIF} + ExpandGroupRows := False; + ExpandMasterRows := False; +end; + +function TdxGridReportLinkOptionsExpanding.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +function TdxGridReportLinkOptionsExpanding.GetHasAny: Boolean; +begin + Result := ExpandGroupRows or ExpandMasterRows {$IFDEF DXVER500} or ExpandCards {$ENDIF}; +end; + +function TdxGridReportLinkOptionsExpanding.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +{$IFDEF DXVER500} +procedure TdxGridReportLinkOptionsExpanding.SetExpandCards(Value: Boolean); +begin + if FExpandCards <> Value then + begin + FExpandCards := Value; + Changed; + end; +end; +{$ENDIF} + +procedure TdxGridReportLinkOptionsExpanding.SetExpandGroupRows(Value: Boolean); +begin + if FExpandGroupRows <> Value then + begin + FExpandGroupRows := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsExpanding.SetExpandMasterRows(Value: Boolean); +begin + if FExpandMasterRows <> Value then + begin + FExpandMasterRows := Value; + Changed; + end; +end; + +{ TdxGridReportLinkOptionsFormatting } + +procedure TdxGridReportLinkOptionsFormatting.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsFormatting then + with TdxGridReportLinkOptionsFormatting(Source) do + begin + Self.ConsumeSelectionStyle := ConsumeSelectionStyle; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsFormatting.RestoreDefaults; +begin + inherited; + ConsumeSelectionStyle := False; +end; + +function TdxGridReportLinkOptionsFormatting.DesignerTabIndex: Integer; +begin + Result := 2; +end; + +function TdxGridReportLinkOptionsFormatting.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +procedure TdxGridReportLinkOptionsFormatting.SetConsumeSelectionStyle(Value: Boolean); +begin + if FConsumeSelectionStyle <> Value then + begin + FConsumeSelectionStyle := Value; + Changed; + end; +end; + +{ TdxGridReportLinkOptionsLevels } + +procedure TdxGridReportLinkOptionsLevels.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsLevels then + with TdxGridReportLinkOptionsLevels(Source) do + begin + Self.RiseActiveLevelOntoTop := RiseActiveLevelOntoTop; + Self.Unwrap := Unwrap; + Self.UnwrapTopLevel := UnwrapTopLevel; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsLevels.RestoreDefaults; +begin + inherited; + RiseActiveLevelOntoTop := True; + Unwrap := False; + UnwrapTopLevel := True; +end; + +function TdxGridReportLinkOptionsLevels.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +procedure TdxGridReportLinkOptionsLevels.SetRiseActiveLevelOntoTop(Value: Boolean); +begin + if FRiseActiveLevelOntoTop <> Value then + begin + FRiseActiveLevelOntoTop := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsLevels.SetUnwrap(Value: Boolean); +begin + if FUnwrap <> Value then + begin + FUnwrap := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsLevels.SetUnwrapTopLevel(Value: Boolean); +begin + if FUnwrapTopLevel <> Value then + begin + FUnwrapTopLevel := Value; + Changed; + end; +end; + +{ TdxGridReportLinkOptionsOnEveryPage } + +procedure TdxGridReportLinkOptionsOnEveryPage.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsOnEveryPage then + with TdxGridReportLinkOptionsOnEveryPage(Source) do + begin + Self.Caption := Caption; + Self.FilterBar := FilterBar; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsOnEveryPage.RestoreDefaults; +begin + inherited; + Caption := True; + FilterBar := True; +end; + +function TdxGridReportLinkOptionsOnEveryPage.HasInstalledAttribute(AnAttribute: TdxGridAttributeClass): Boolean; +begin + if AnAttribute.InheritsFrom(TdxGridLevelCaption) then + Result := Caption + else + if AnAttribute.InheritsFrom(TdxGridBandHeader) then + Result := BandHeaders + else + if AnAttribute.InheritsFrom(TdxGridHeader) then + Result := Headers + else + if AnAttribute.InheritsFrom(TdxGridFooter) then + Result := Footers + else + if AnAttribute.InheritsFrom(TdxGridFilterBar) then + Result := FilterBar + else + Result := False; +end; + +procedure TdxGridReportLinkOptionsOnEveryPage.SetAll; +begin + BandHeaders := True; + Caption := True; + FilterBar := True; + Footers := True; + Headers := True; +end; + +procedure TdxGridReportLinkOptionsOnEveryPage.UnsetAll; +begin + BandHeaders := False; + Caption := False; + FilterBar := False; + Footers := False; + Headers := False; +end; + +function TdxGridReportLinkOptionsOnEveryPage.DesignerTabIndex: Integer; +begin + Result := 0; +end; + +function TdxGridReportLinkOptionsOnEveryPage.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +procedure TdxGridReportLinkOptionsOnEveryPage.SetCaption(Value: Boolean); +begin + if FCaption <> Value then + begin + FCaption := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsOnEveryPage.SetFilterBar(Value: Boolean); +begin + if FFilterBar <> Value then + begin + FFilterBar := Value; + Changed; + end; +end; + +{ TdxGridReportLinkOptionsPreview } + +function TdxGridReportLinkOptionsPreview.DesignerTabIndex: Integer; +begin + Result := 4; +end; + +function TdxGridReportLinkOptionsPreview.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +{ TdxGridReportLinkOptionsRefinements } + +function TdxGridReportLinkOptionsRefinements.DesignerTabIndex: Integer; +begin + Result := 2; +end; + +function TdxGridReportLinkOptionsRefinements.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +{ TdxGridReportLinkOptionsSelection } + +function TdxGridReportLinkOptionsSelection.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +function TdxGridReportLinkOptionsSelection.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +{ TdxGridReportLinkOptionsSize } + +function TdxGridReportLinkOptionsSize.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +function TdxGridReportLinkOptionsSize.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +{ TdxGridReportLinkOptionsView } + +procedure TdxGridReportLinkOptionsView.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLinkOptionsView then + with TdxGridReportLinkOptionsView(Source) do + begin + Self.Caption := Caption; + Self.FilterBar := FilterBar; + Self.GroupFooters := GroupFooters; + end; + inherited; +end; + +procedure TdxGridReportLinkOptionsView.RestoreDefaults; +begin + inherited; + Caption := True; + FilterBar := True; + GroupFooters := True; +end; + +function TdxGridReportLinkOptionsView.HasInstalledAttribute(AnAttribute: TdxGridAttributeClass): Boolean; +begin + if AnAttribute.InheritsFrom(TdxGridLevelCaption) then + Result := Caption + else + if AnAttribute.InheritsFrom(TdxGridBandHeader) then + Result := BandHeaders + else + if AnAttribute.InheritsFrom(TdxGridHeader) then + Result := Headers + else + if AnAttribute.InheritsFrom(TdxGridFooter) then + Result := Footers + else + if AnAttribute.InheritsFrom(TdxGridFilterBar) then + Result := FilterBar + else + Result := False; +end; + +procedure TdxGridReportLinkOptionsView.SetAll; +begin + BandHeaders := True; + Caption := True; + FilterBar := True; + Footers := True; + GroupFooters := True; + Headers := True; + ExpandButtons := True; +end; + +procedure TdxGridReportLinkOptionsView.UnsetAll; +begin + BandHeaders := False; + Caption := False; + FilterBar := False; + Footers := False; + GroupFooters := False; + Headers := False; + ExpandButtons := False; +end; + +function TdxGridReportLinkOptionsView.DesignerTabIndex: Integer; +begin + Result := 0; +end; + +function TdxGridReportLinkOptionsView.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +procedure TdxGridReportLinkOptionsView.SetCaption(Value: Boolean); +begin + if FCaption <> Value then + begin + FCaption := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsView.SetFilterBar(Value: Boolean); +begin + if FFilterBar <> Value then + begin + FFilterBar := Value; + Changed; + end; +end; + +procedure TdxGridReportLinkOptionsView.SetGroupFooters(Value: Boolean); +begin + if FGroupFooters <> Value then + begin + FGroupFooters := Value; + Changed; + end; +end; + +{ TdxGridAttributeHostInfo } + +procedure TdxGridAttributeHostInfo.Initialize(AParent: TdxReportCell); +begin + Origin := NullPoint; + FParent := AParent; +end; + +{ TdxGridAttributeHostInfoServices } + +constructor TdxGridAttributeHostInfoServices.Create(AReportLink: TdxGridReportLink); +begin + inherited Create; + FReportLink := AReportLink; + CreateHostInfos; +end; + +destructor TdxGridAttributeHostInfoServices.Destroy; +begin + DestroyHostInfos; + inherited; +end; + +procedure TdxGridAttributeHostInfoServices.Initialize; +begin + PageDetailsHostInfo.Initialize(PageDetails); + PageFootersHostInfo.Initialize(PageFooters); + PageHeadersHostInfo.Initialize(PageHeaders); +end; + +procedure TdxGridAttributeHostInfoServices.CreateHostInfos; +begin + FPageDetailsHostInfo := TdxGridAttributeHostInfo.Create; + FPageFootersHostInfo := TdxGridAttributeHostInfo.Create; + FPageHeadersHostInfo := TdxGridAttributeHostInfo.Create; +end; + +procedure TdxGridAttributeHostInfoServices.DestroyHostInfos; +begin + FreeAndNil(FPageHeadersHostInfo); + FreeAndNil(FPageFootersHostInfo); + FreeAndNil(FPageDetailsHostInfo); +end; + +function TdxGridAttributeHostInfoServices.GetBandHeadersHostInfo: TdxGridAttributeHostInfo; +begin + if CanUseBandHeadersOnEveyPage then + Result := PageHeadersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetCaptionHostInfo: TdxGridAttributeHostInfo; +begin + if CanUseCaptionOnEveryPage then + Result := PageHeadersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetFilterBarHostInfo: TdxGridAttributeHostInfo; +begin + if CanUseFilterBarOnEveryPage then + if ActiveViewHelper.IsFilterBarAtTop(ActiveView) then + Result := PageHeadersHostInfo + else + Result := PageFootersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetFootersHostInfo: TdxGridAttributeHostInfo; +begin + if CanUseFootersOnEveryPage then + Result := PageFootersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetHeadersHostInfo: TdxGridAttributeHostInfo; +begin + if CanUseHeadersOnEveryPage then + Result := PageHeadersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetInconsistentStateText: string; +begin + if ReportLink.IsAggregated then + Result := cxGetResourceString(@sdxCannotUseOnEveryPageModeInAggregatedState) + else + if ReportLink.ProcessParams.HasMasterDetails then + Result := cxGetResourceString(@sdxCannotUseOnEveryPageMode) + else + if IsInconsistentFilterBarState then + Result := cxGetResourceString(@sdxIncorrectFilterBarState) + else + if IsInconsistentBandHeadersState then + if ActiveViewHelper.IsFilterBarAtTop(ActiveView) then + Result := cxGetResourceString(@sdxIncorrectBandHeadersState2) + else + Result := cxGetResourceString(@sdxIncorrectBandHeadersState) + else + if IsInconsistentHeadersState then + if ActiveViewHelper.IsFilterBarAtTop(ActiveView) then + Result := cxGetResourceString(@sdxIncorrectHeadersState2) + else + Result := cxGetResourceString(@sdxIncorrectHeadersState) + else + if IsInconsistentFootersState then + Result := cxGetResourceString(@sdxIncorrectFootersState) + else + Result := ''; +end; + +function TdxGridAttributeHostInfoServices.GetIsInconsistentState: Boolean; +begin + Result := ReportLink.IsAggregated or ReportLink.ProcessParams.HasMasterDetails or + IsInconsistentFilterBarState or IsInconsistentBandHeadersState or + IsInconsistentHeadersState or IsInconsistentFootersState; +end; + +function TdxGridAttributeHostInfoServices.HasCells: Boolean; +begin + Result := ReportLink.ReportCells <> nil; +end; + +function TdxGridAttributeHostInfoServices.IsAttributeSupported(AnAttribute: TdxGridAttributeClass): Boolean; +begin + Result := ActiveViewHelper.IsAttributeSupported(AnAttribute) +end; + +function TdxGridAttributeHostInfoServices.GetActiveView: TcxCustomGridView; +begin + Result := ReportLink.ActiveView; +end; + +function TdxGridAttributeHostInfoServices.GetActiveViewHelper: TdxCustomGridViewHelperClass; +begin + Result := ReportLink.ActiveViewHelper; +// if ActiveView = nil then +// Result := TdxNullGridViewHelper +// else +// Result := dxViewHelpersFactory[ActiveView]; +end; + +function TdxGridAttributeHostInfoServices.GetArePageFootersAssigned: Boolean; +begin + with ReportLink.ReportCells do + Result := (FootersHostInfo.Parent = FooterCells) or (FilterBarHostInfo.Parent = FooterCells); +end; + +function TdxGridAttributeHostInfoServices.GetArePageHeadersAssigned: Boolean; +begin + with ReportLink.ReportCells do + Result := (CaptionHostInfo.Parent = HeaderCells) or (FilterBarHostInfo.Parent = HeaderCells) or + (BandHeadersHostInfo.Parent = HeaderCells) or (HeadersHostInfo.Parent = HeaderCells); +end; + +function TdxGridAttributeHostInfoServices.GetCanUseBandHeadersOnEveyPage: Boolean; +begin + Result := ReportLink.CanAttributeBeUsedOnEveryPage(TdxGridBandHeader) and + ReportLink.IsAttributeUsedOnEveryPage(TdxGridLevelCaption) and + (ActiveViewHelper.IsFilterBarAtBottom(ActiveView) or ReportLink.IsAttributeUsedOnEveryPage(TdxGridFilterBar)); +end; + +function TdxGridAttributeHostInfoServices.GetCanUseCaptionOnEveryPage: Boolean; +begin + Result := ReportLink.CanAttributeBeUsedOnEveryPage(TdxGridLevelCaption); +end; + +function TdxGridAttributeHostInfoServices.GetCanUseFilterBarOnEveryPage: Boolean; +begin + Result := ReportLink.CanAttributeBeUsedOnEveryPage(TdxGridFilterBar) and + ReportLink.IsAttributeUsedOnEveryPage(TdxGridLevelCaption); +end; + +function TdxGridAttributeHostInfoServices.GetCanUseFootersOnEveryPage: Boolean; +begin + Result := ReportLink.CanAttributeBeUsedOnEveryPage(TdxGridFooter) and + (ActiveViewHelper.IsFilterBarAtTop(ActiveView) or ReportLink.IsAttributeUsedOnEveryPage(TdxGridFilterBar)); +end; + +function TdxGridAttributeHostInfoServices.GetCanUseHeadersOnEveryPage: Boolean; +begin + Result := ReportLink.CanAttributeBeUsedOnEveryPage(TdxGridHeader) and + ReportLink.IsAttributeUsedOnEveryPage(TdxGridLevelCaption) and + (ActiveViewHelper.IsFilterBarAtBottom(ActiveView) or ReportLink.IsAttributeUsedOnEveryPage(TdxGridFilterBar)) and + ReportLink.IsAttributeUsedOnEveryPage(TdxGridBandHeader); +end; + +function TdxGridAttributeHostInfoServices.GetIsInconsistentBandHeadersState: Boolean; +begin + Result := IsAttributeSupported(TdxGridBandHeader) and OptionsOnEveryPage.BandHeaders and OptionsView.BandHeaders and + ((IsAttributeSupported(TdxGridLevelCaption) and OptionsView.Caption and not OptionsOnEveryPage.Caption) or + (IsAttributeSupported(TdxGridFilterBar) and ActiveViewHelper.IsFilterBarAtTop(ActiveView) and + OptionsView.FilterBar and not OptionsOnEveryPage.FilterBar)); +end; + +function TdxGridAttributeHostInfoServices.GetIsInconsistentFilterBarState: Boolean; +begin + Result := ActiveViewHelper.IsFilterBarAtTop(ActiveView) and + (IsAttributeSupported(TdxGridFilterBar) and OptionsView.FilterBar and OptionsOnEveryPage.FilterBar and + IsAttributeSupported(TdxGridLevelCaption) and OptionsView.Caption and not OptionsOnEveryPage.Caption); +end; + +function TdxGridAttributeHostInfoServices.GetIsInconsistentFootersState: Boolean; +begin + Result := IsAttributeSupported(TdxGridFooter) and OptionsView.Footers and OptionsOnEveryPage.Footers and + IsAttributeSupported(TdxGridFilterBar) and ActiveViewHelper.IsFilterBarAtBottom(ActiveView) and + OptionsView.FilterBar and not OptionsOnEveryPage.FilterBar; +end; + +function TdxGridAttributeHostInfoServices.GetIsInconsistentHeadersState: Boolean; +begin + Result := IsAttributeSupported(TdxGridHeader) and OptionsView.Headers and OptionsOnEveryPage.Headers and + ((IsAttributeSupported(TdxGridLevelCaption) and OptionsView.Caption and not OptionsOnEveryPage.Caption) or + (IsAttributeSupported(TdxGridFilterBar) and ActiveViewHelper.IsFilterBarAtTop(ActiveView) and + OptionsView.FilterBar and not OptionsOnEveryPage.FilterBar) or + (IsAttributeSupported(TdxGridBandHeader) and OptionsView.BandHeaders and not OptionsOnEveryPage.BandHeaders)); +end; + +function TdxGridAttributeHostInfoServices.GetLevelSeparatorBottomHostInfo: TdxGridAttributeHostInfo; +begin + if ArePageFootersAssigned then + Result := PageFootersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetLevelSeparatorTopHostInfo: TdxGridAttributeHostInfo; +begin + if ArePageHeadersAssigned then + Result := PageHeadersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TdxGridAttributeHostInfoServices.GetOptionsOnEveryPage: TdxGridReportLinkOptionsOnEveryPage; +begin + Result := ReportLink.OptionsOnEveryPage; +end; + +function TdxGridAttributeHostInfoServices.GetOptionsView: TdxGridReportLinkOptionsView; +begin + Result := ReportLink.OptionsView; +end; + +function TdxGridAttributeHostInfoServices.GetPageDetails: TdxReportCell; +begin + if HasCells then + Result := ReportLink.ReportCells.Cells + else + Result := nil; +end; + +function TdxGridAttributeHostInfoServices.GetPageFooters: TdxReportCell; +begin + if HasCells and not ReportLink.ProcessParams.HasMasterDetails then + Result := ReportLink.ReportCells.FooterCells + else + Result := PageDetails; +end; + +function TdxGridAttributeHostInfoServices.GetPageHeaders: TdxReportCell; +begin + if HasCells and not ReportLink.ProcessParams.HasMasterDetails then + Result := ReportLink.ReportCells.HeaderCells + else + Result := PageDetails; +end; + +{ TdxGridReportLinkStyles } + +procedure TdxGridReportLinkStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TdxGridReportLinkStyles then + with TdxGridReportLinkStyles(Source) do + begin + Self.BandHeader := BandHeader; + Self.Caption := Caption; + Self.CardCaptionRow := CardCaptionRow; + Self.CardRowCaption := CardRowCaption; + Self.Content := Content; + Self.ContentEven := ContentEven; + Self.ContentOdd := ContentOdd; + Self.FilterBar := FilterBar; + Self.Footer := Footer; + Self.Group := Group; + Self.Header := Header; + Self.Preview := Preview; + Self.Selection := Selection; + end; // TODO: assign to TcxGridXXXStyles +end; + +procedure TdxGridReportLinkStyles.GetBandHeaderParams(ABand: TcxGridBand; + out AParams: TcxViewParams); +begin + GetViewParams(vspsGridBandHeader, ABand, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetCaptionParams(ATabLevel: TcxGridLevel; out AParams: TcxViewParams); +begin + GetViewParams(vspsGridCaption, ATabLevel, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetCardCaptionRowParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +var + DataCellPos: TdxPSGridDataCellPos; +begin + DataCellPos := CreatePSDataCellPos; + try + with DataCellPos do + begin + GridRecord := ARecord; + Item := AItem; + end; + GetViewParams(vspsGridCardCaptionRow, DataCellPos, nil, AParams); + finally + FreePSDataCellPos(DataCellPos); + end; +end; + +procedure TdxGridReportLinkStyles.GetCardRowCaptionParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +var + DataCellPos: TdxPSGridDataCellPos; +begin + DataCellPos := CreatePSDataCellPos; + try + with DataCellPos do + begin + GridRecord := ARecord; + Item := AItem; + end; + GetViewParams(vspsGridCardRowCaption, DataCellPos, nil, AParams); + finally + FreePSDataCellPos(DataCellPos); + end; +end; + +procedure TdxGridReportLinkStyles.GetContentParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +const + StyleIndexes: array[Boolean] of Integer = (vspsGridContentEven, vspsGridContentOdd); +var + DataCellPos: TdxPSGridDataCellPos; +begin + if (ARecord <> nil) and (GetValue(StyleIndexes[Odd(ARecord.Index)]) <> nil) then + begin + DataCellPos := CreatePSDataCellPos; + try + with DataCellPos do + begin + GridRecord := ARecord; + Item := AItem; + end; + GetViewParams(StyleIndexes[Odd(ARecord.Index)], DataCellPos, nil, AParams); + finally + FreePSDataCellPos(DataCellPos); + end; + end + else + GetViewParams(vspsGridContent, ARecord, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetFilterBarParams(out AParams: TcxViewParams); +begin + GetViewParams(vspsGridFilterBar, nil, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetFooterParams(ARecord: TcxCustomGridRecord; + AGroupLevel: Integer; AItem: TcxGridColumn; out AParams: TcxViewParams); +begin + GetViewParams(vspsGridFooter, ARecord, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetGroupParams(ARecord: TcxCustomGridRecord; + AGroupLevel: Integer; out AParams: TcxViewParams); +begin + GetViewParams(vspsGridGroup, ARecord, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetHeaderParams(AItem: TcxGridColumn; + out AParams: TcxViewParams); +begin + GetViewParams(vspsGridHeader, nil, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetPreviewParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +begin + GetViewParams(vspsGridPreview, ARecord, nil, AParams); +end; + +procedure TdxGridReportLinkStyles.GetSelectionParams(out AParams: TcxViewParams); +begin + GetViewParams(vspsGridSelection, nil, nil, AParams); +end; + +function TdxGridReportLinkStyles.DesignerTabIndex: Integer; +begin + Result := 3; +end; + +procedure TdxGridReportLinkStyles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +const + FixedParts = [vspsGridBandHeader, vspsGridCaption, vspsGridFooter, vspsGridHeader, + vspsGridSelection]; +begin + inherited; + if ReportLink <> nil then + with AParams do + begin + if Index in FixedParts then + Color := dxPSCore.dxDefaultFixedColor + else + if Index = vspsGridGroup then + if ReportLink.IsOffice11StyleGrouping and (AData = nil) then + Color := dxPSCore.dxDefaultFixedColor + else + Color := dxPSCore.dxDefaultContentColor + else + if Index = vspsGridFilterBar then + Color := DefaultFilterBarColor + else + Color := dxPSCore.dxDefaultContentColor; + + Font := ReportLink.Font; + + if Index = vspsGridFilterBar then + TextColor := DefaultFilterBarTextColor + else + TextColor := Font.Color; + end; +end; + +class function TdxGridReportLinkStyles.GetStyleCaption(AnIndex: Integer): string; +begin + case AnIndex of + vspsGridBandHeader: + Result := cxGetResourceString(@sdxBandHeaderStyle); + vspsGridCaption: + Result := cxGetResourceString(@sdxCaptionStyle); + vspsGridCardCaptionRow: + Result := cxGetResourceString(@sdxCardCaptionRowStyle); + vspsGridCardRowCaption: + Result := cxGetResourceString(@sdxCardRowCaptionStyle); + vspsGridContent: + Result := cxGetResourceString(@sdxContentStyle); + vspsGridContentEven: + Result := cxGetResourceString(@sdxContentEvenStyle); + vspsGridContentOdd: + Result := cxGetResourceString(@sdxContentOddStyle); + vspsGridFilterBar: + Result := cxGetResourceString(@sdxFilterBarStyle); + vspsGridFooter: + Result := cxGetResourceString(@sdxFooterStyle); + vspsGridGroup: + Result := cxGetResourceString(@sdxGroupStyle); + vspsGridHeader: + Result := cxGetResourceString(@sdxHeaderStyle); + vspsGridPreview: + Result := cxGetResourceString(@sdxPreviewStyle); + else + Result := cxGetResourceString(@sdxSelectionStyle); + end; +end; + +function TdxGridReportLinkStyles.GetStyleIndexByCaption(const Caption: string): Integer; +begin + for Result := vspsGridFirst to vspsGridLast do + if dxPSUtl.dxSameText(Caption, GetStyleCaption(Result)) then + Exit; + Result := -1; +end; + +function TdxGridReportLinkStyles.IsCardViewStyle(AStyle: TcxStyle): Boolean; +begin + Result := (AStyle <> nil) and ((AStyle = CardRowCaption) or (AStyle = CardCaptionRow)); +end; + +function TdxGridReportLinkStyles.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +{ TdxGridReportLinkStyleSheet } + +class function TdxGridReportLinkStyleSheet.GetStylesClass: TcxCustomStylesClass; +begin + Result := TdxGridReportLinkStyles; +end; + +function TdxGridReportLinkStyleSheet.GetStylesValue: TdxGridReportLinkStyles; +begin + if GetStyles is TdxGridReportLinkStyles then + Result := TdxGridReportLinkStyles(GetStyles) + else + Result := nil; +end; + +procedure TdxGridReportLinkStyleSheet.SetStylesValue(Value: TdxGridReportLinkStyles); +begin + SetStyles(Value); +end; + +{ TdxGridReportLink } + +constructor TdxGridReportLink.Create(AOwner: TComponent); +begin + inherited; + FDelimitersHardVert := TList.Create; + FHostInfoServices := TdxGridAttributeHostInfoServices.Create(Self); + FReportRows := TList.Create; + InternalRestoreDefaults; + LinkModified(False); +end; + +destructor TdxGridReportLink.Destroy; +begin + FreeAndNil(FReportRows); + FreeAndNil(FHostInfoServices); + FreeAndNil(FDelimitersHardVert); + inherited; +end; + +procedure TdxGridReportLink.Assign(Source: TPersistent); +begin + if Source is TdxGridReportLink then + with TdxGridReportLink(Source) do + begin + Self.OptionsCards := OptionsCards; +{$IFDEF CHARTVIEW} + Self.OptionsCharts := OptionsCharts; +{$ENDIF} + Self.OptionsDetails := OptionsDetails; + Self.OptionsLevels := OptionsLevels; + end; + inherited; +end; + +procedure TdxGridReportLink.AddPageBreak(AGridRecord: TcxCustomGridRecord); +var + ReportRow: TdxReportCell; +begin + ReportRow := ReportRowsByGridRecord[AGridRecord]; + if ReportRow <> nil then + AddVerticalHardDelimiter(ReportRow); +end; + +procedure TdxGridReportLink.AddPageBreak(const AGridRecords: array of TcxCustomGridRecord); +var + I: Integer; +begin + for I := Low(AGridRecords) to High(AGridRecords) do + AddPageBreak(AGridRecords[I]); +end; + +procedure TdxGridReportLink.AddPageBreak(const AGridRecords: TdxGridRecordArray); +var + I: Integer; +begin + for I := 0 to Length(AGridRecords) - 1 do + AddPageBreak(AGridRecords[I]); +end; + +procedure TdxGridReportLink.AddPageBreak(AGridRecords: TList); +var + I: Integer; + P: Pointer; +begin + for I := 0 to AGridRecords.Count - 1 do + begin + P := AGridRecords[I]; + if TObject(P) is TcxCustomGridRecord then + AddPageBreak(TcxCustomGridRecord(P)); + end; +end; + +procedure TdxGridReportLink.BeforeDesignReport; +begin + CalculateProcessParams; + inherited; +end; + +procedure TdxGridReportLink.ConstructReport(AReportCells: TdxReportCells); + + procedure CalculateSizes; + + procedure CalculateReportPartSizes(ACell: TdxReportCell); + var + Width, I, V: Integer; + begin + if ACell.CellCount > 0 then + begin + Width := 0; + for I := 0 to ACell.CellCount - 1 do + begin + V := ACell.Cells[I].Width; + if Width < V then Width := V; + end; + ACell.BoundsRect := MakeRect(0, 0, Width, ACell.LastCell.BoundsRect.Bottom); + end; + end; + + begin + with AReportCells do + begin + CalculateReportPartSizes(Cells); + if AreFooterCellsAllocated then CalculateReportPartSizes(FooterCells); + if AreHeaderCellsAllocated then CalculateReportPartSizes(HeaderCells); + end; + end; + +begin + if Grid = nil then Exit; + inherited; + if ActiveView = nil then Exit; + + PrepareConstruct; + try + BuildTopLevelViews; + if not AbortBuilding then CalculateSizes; + finally + UnprepareConstruct; + end; +end; + +procedure TdxGridReportLink.ConvertCoords; +begin + inherited; + ConvertDelimiters(DelimitersHardVert); +end; + +procedure TdxGridReportLink.CustomDraw(AItem: TAbstractdxReportCellData; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); +var + DrawInfo: TdxGridCellCustomDrawInfo; +begin + GetItemCustomDrawInfo(AItem, DrawInfo); + with DrawInfo do + case GridAttributeID of + dxGridBandID: + DoCustomDrawBandCell(ACanvas, TcxGridBandedTableView(GridView), GridBand, + TdxReportCellString(AItem), ADone); + dxGridCardRowCaptionID: + DoCustomDrawCardRowCaptionCell(ACanvas, TcxGridCardView(GridView), GridCard, + GridCardRow, TdxReportCellString(AItem), ADone); + dxGridCardRowDataID: + DoCustomDrawCardRowDataCell(ACanvas, TcxGridCardView(GridView), GridCard, + GridCardRow, AItem, ADone); + dxGridFilterBarID: + DoCustomDrawFilterBar(ACanvas, TcxCustomGridTableView(GridView), + TdxReportCellString(AItem), ADone); + dxGridFooterID, + dxGridGroupFooterID: + DoCustomDrawFooterCell(ACanvas, TcxGridTableView(GridView), GridRecord, + GridColumn, GroupLevel, TdxReportCellString(AItem), ADone); + dxGridHeaderID: + DoCustomDrawHeaderCell(ACanvas, TcxGridTableView(GridView), GridColumn, + TdxReportCellString(AItem), ADone); + dxGridRecordID: + DoCustomDrawCell(ACanvas, TcxCustomGridTableView(GridView), GridRecord, + GridColumn, AItem, ADone); + dxGridLevelCaptionID: + DoCustomDrawLevelCaption(ACanvas, GridView, TdxReportCellString(AItem), ADone); + end; +end; + +function TdxGridReportLink.GetBreakPagesByHardDelimiters: Boolean; +begin + with OptionsPagination do + Result := OneGroupPerPage or Custom; +end; + +function TdxGridReportLink.GetEmptyPagesCanExist: Boolean; +begin + Result := True;//}ProcessParams.HasMasterDetails; +end; + +function TdxGridReportLink.GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; +begin + Result := (AUpdateCodes * uaMarginsVert <> []) and (ProcessParams.HasOnlyCards or OptionsSize.AutoWidth); +end; + +function TdxGridReportLink.GetUseHardVertDelimiters: Boolean; +begin + with OptionsPagination do + Result := TopLevelGroup or Custom; +end; + +procedure TdxGridReportLink.InternalRestoreDefaults; +begin + inherited; + OptionsCards.RestoreDefaults; +{$IFDEF CHARTVIEW} + OptionsCharts.RestoreDefaults; +{$ENDIF} + OptionsDetails.RestoreDefaults; + OptionsLevels.RestoreDefaults; +end; + +procedure TdxGridReportLink.InternalRestoreFromOriginal; +var + View: TcxCustomGridView; +begin + inherited; + Color := clWhite; + + if Grid <> nil then + begin + OptionsFormatting.LookAndFeelKind := Grid.LookAndFeel.Kind; + OptionsView.Caption := Grid.RootLevelOptions.DetailTabsPosition <> dtpNone; + + View := ActiveView; + if View <> nil then + begin + if View is TcxGridTableView then + begin + OptionsPreview.AutoHeight := TcxGridTableView(View).Preview.AutoHeight; + OptionsPreview.MaxLineCount := TcxGridTableView(View).Preview.MaxLineCount; + OptionsPreview.Visible := TcxGridTableView(View).Preview.Visible; + + if View is TcxGridBandedTableView then + OptionsView.BandHeaders := TcxGridBandedTableView(View).OptionsView.BandHeaders; + OptionsView.FilterBar := (TcxGridTableView(View).Filtering.Visible = fvAlways) or + ((TcxGridTableView(View).Filtering.Visible = fvNonEmpty) and + (TcxGridTableView(View).DataController.Filter.FilterText <> '')); + OptionsView.Footers := TcxGridTableView(View).OptionsView.Footer; + OptionsView.GroupFooters := TcxGridTableView(View).OptionsView.GroupFooters <> gfInvisible; + OptionsView.Headers := TcxGridTableView(View).OptionsView.Header; + + OptionsSize.AutoWidth := TcxGridTableView(View).OptionsView.ColumnAutoWidth; + end; + + if View is TcxGridCardView then + OptionsView.FilterBar := False; + end; + end; +end; + +function TdxGridReportLink.IsDrawFootersOnEveryPage: Boolean; +begin + Result := HostInfoServices.ArePageFootersAssigned; +end; + +function TdxGridReportLink.IsDrawHeadersOnEveryPage: Boolean; +begin + Result := HostInfoServices.ArePageHeadersAssigned; +end; + +function TdxGridReportLink.IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; +var + DrawInfo: TdxGridCellCustomDrawInfo; +begin + Result := inherited IsSupportedCustomDraw(Item) and + (Item <> nil) and IsCustomDrawn(GetItemCustomDrawInfo(Item, DrawInfo)); +end; + +procedure TdxGridReportLink.MakeHardDelimiters(AReportCells: TdxReportCells; + AVertDelimiters: TList); +begin + inherited; + if OptionsPagination.Custom then + try + DoGetCustomPageBreaks; + except + Application.HandleException(Self); + end; + dxPSUtl.dxCopyList(DelimitersHardVert, AVertDelimiters); +end; + +function TdxGridReportLink.GetAreNativeStylesAvailable: Boolean; +begin + Result := OptionsFormatting.UseNativeStyles; +end; + +function TdxGridReportLink.GetStylesClass: TdxCustomReportLinkStylesClass; +begin + Result := TdxGridReportLinkStyles; +end; + +function TdxGridReportLink.GetStyleSheetClass: TdxCustomReportLinkStyleSheetClass; +begin + Result := TdxGridReportLinkStyleSheet; +end; + +function TdxGridReportLink.GetStyleSheetPrototype: TdxCustomReportLinkStyleSheet; +begin + Result := GridLinkStyleSheetPrototype; +end; + +procedure TdxGridReportLink.PrepareConstruct; +begin + inherited; + DelimitersHardVert.Clear; + FReportRows.Clear; + + ReportCells.LookAndFeel := nil;//ReportCells.CreateGroupLookAndFeel(TdxPSReportGroupNullLookAndFeel); + + if OptionsExpanding.HasAny then + DoExpandRows; + + CalculateProcessParams; + HostInfoServices.Initialize; +end; + +procedure TdxGridReportLink.DoCustomDrawBandCell(ACanvas: TCanvas; + AView: TcxGridBandedTableView; ABand: TcxGridBand; AnItem: TdxReportCellString; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawBandCell) then + FOnCustomDrawBandCell(Self, ACanvas, AView, ABand, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawCardRowCaptionCell(ACanvas: TCanvas; + AView: TcxGridCardView; ACard: TcxGridCard; ARow: TcxGridCardViewRow; + AnItem: TdxReportCellString; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawCardRowCaptionCell) then + FOnCustomDrawCardRowCaptionCell(Self, ACanvas, AView, ACard, ARow, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawCardRowDataCell(ACanvas: TCanvas; + AView: TcxGridCardView; ACard: TcxGridCard; ARow: TcxGridCardViewRow; + AnItem: TAbstractdxReportCellData; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawCardRowDataCell) then + FOnCustomDrawCardRowDataCell(Self, ACanvas, AView, ACard, ARow, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawCell(ACanvas: TCanvas; + AView: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; + AColumn: TcxGridColumn; AnItem: TAbstractdxReportCellData; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawCell) then + FOnCustomDrawCell(Self, ACanvas, AView, ARecord, AColumn, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawFilterBar(ACanvas: TCanvas; + AView: TcxCustomGridTableView; AnItem: TdxReportCellString; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawFilterBar) then + FOnCustomDrawFilterBar(Self, ACanvas, AView, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawFooterCell(ACanvas: TCanvas; + AView: TcxGridTableView; ARecord: TcxCustomGridRecord; AColumn: TcxGridColumn; + ALevel: Integer; AnItem: TdxReportCellString; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawFooterCell) then + FOnCustomDrawFooterCell(Self, ACanvas, AView, ARecord, AColumn, ALevel, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawHeaderCell(ACanvas: TCanvas; + AView: TcxGridTableView; AColumn: TcxGridColumn; AnItem: TdxReportCellString; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawHeaderCell) then + FOnCustomDrawHeaderCell(Self, ACanvas, AView, AColumn, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoCustomDrawLevelCaption(ACanvas: TCanvas; + AView: TcxCustomGridView; AnItem: TdxReportCellString; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawLevelCaption) then + FOnCustomDrawLevelCaption(Self, ACanvas, AView, AnItem, ADone); +end; + +procedure TdxGridReportLink.DoGetCellHeight(AView: TcxCustomGridTableView; + ARecord: TcxCustomGridRecord; ATableItem: TcxCustomGridTableItem; + var AHeight: Integer); +begin + if Assigned(FOnGetCellHeight) then + FOnGetCellHeight(Self, AView, ARecord, ATableItem, AHeight); +end; + +procedure TdxGridReportLink.DoGetCustomPageBreaks; +begin + if Assigned(FOnGetCustomPageBreaks) then FOnGetCustomPageBreaks(Self); +end; + +procedure TdxGridReportLink.DoInitializeBandCell(AView: TcxGridBandedTableView; + ABand: TcxGridBand; AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeBandCell) then + FOnInitializeBandCell(Self, AView, ABand, AnItem); +end; + +procedure TdxGridReportLink.DoInitializeCardRowCaptionCell(AView: TcxGridCardView; + ACard: TcxGridCard; ARow: TcxGridCardViewRow; AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeCardRowCaptionCell) then + FOnInitializeCardRowCaptionCell(Self, AView, ACard, ARow, AnItem); +end; + +procedure TdxGridReportLink.DoInitializeCardRowDataCell(AView: TcxGridCardView; + ACard: TcxGridCard; ARow: TcxGridCardViewRow; AnItem: TAbstractdxReportCellData); +begin + if Assigned(FOnInitializeCardRowDataCell) then + FOnInitializeCardRowDataCell(Self, AView, ACard, ARow, AnItem); +end; + +procedure TdxGridReportLink.DoInitializeCell(AView: TcxCustomGridTableView; + ARecord: TcxCustomGridRecord; AColumn: TcxGridColumn; AnItem: TAbstractdxReportCellData); +begin + if Assigned(FOnInitializeCell) then + FOnInitializeCell(Self, AView, ARecord, AColumn, AnItem); +end; + +{$IFDEF CHARTVIEW} +procedure TdxGridReportLink.DoInitializeChartCell(AView: TcxGridChartView; + AnItem: TdxReportCellGraphic); +begin + if Assigned(FOnInitializeChartCell) then + FOnInitializeChartCell(Self, AView, AnItem); +end; +{$ENDIF} + +procedure TdxGridReportLink.DoInitializeFilterBar(AView: TcxCustomGridTableView; + AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeFilterBar) then + FOnInitializeFilterBar(Self, AView, AnItem); +end; + +procedure TdxGridReportLink.DoInitializeFooterCell(AView: TcxGridTableView; + ARecord: TcxCustomGridRecord; AColumn: TcxGridColumn; ALevel: Integer; + AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeFooterCell) then + FOnInitializeFooterCell(Self, AView, ARecord, AColumn, ALevel, AnItem); +end; + +procedure TdxGridReportLink.DoInitializeHeaderCell(AView: TcxGridTableView; + AColumn: TcxGridColumn; AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeHeaderCell) then + FOnInitializeHeaderCell(Self, AView, AColumn, AnItem); +end; + +procedure TdxGridReportLink.DoInitializeLevelCaption(AView: TcxCustomGridView; + AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeLevelCaption) then + FOnInitializeLevelCaption(Self, AView, AnItem); +end; + +procedure TdxGridReportLink.CreateOptions; +begin + inherited; + FOptionsCards := GetOptionsCardsClass.Create(Self); +{$IFDEF CHARTVIEW} + FOptionsCharts := GetOptionsChartsClass.Create(Self); +{$ENDIF} + FOptionsDetails := GetOptionsDetailsClass.Create(Self); + FOptionsLevels := GetOptionsLevelsClass.Create(Self); +end; + +procedure TdxGridReportLink.DestroyOptions; +begin + FreeAndNil(FOptionsLevels); + FreeAndNil(FOptionsDetails); +{$IFDEF CHARTVIEW} + FreeAndNil(FOptionsCharts); +{$ENDIF} + FreeAndNil(FOptionsCards); + inherited; +end; + +function TdxGridReportLink.GetOptionsCardsClass: TdxGridReportLinkOptionsCardsClass; +begin + Result := TdxGridReportLinkOptionsCards; +end; + +{$IFDEF CHARTVIEW} +function TdxGridReportLink.GetOptionsChartsClass: TdxGridReportLinkOptionsChartsClass; +begin + Result := TdxGridReportLinkOptionsCharts; +end; +{$ENDIF} + +function TdxGridReportLink.GetOptionsDetailsClass: TdxGridReportLinkOptionsDetailsClass; +begin + Result := TdxGridReportLinkOptionsDetails; +end; + +function TdxGridReportLink.GetOptionsExpandingClass: TdxCustomReportLinkOptionsExpandingClass; +begin + Result := TdxGridReportLinkOptionsExpanding; +end; + +function TdxGridReportLink.GetOptionsFormattingClass: TdxCustomReportLinkOptionsFormattingClass; +begin + Result := TdxGridReportLinkOptionsFormatting; +end; + +function TdxGridReportLink.GetOptionsLevelsClass: TdxGridReportLinkOptionsLevelsClass; +begin + Result := TdxGridReportLinkOptionsLevels; +end; + +function TdxGridReportLink.GetOptionsOnEveryPageClass: TdxCustomTableControlReportLinkOptionsOnEveryPageClass; +begin + Result := TdxGridReportLinkOptionsOnEveryPage; +end; + +function TdxGridReportLink.GetOptionsPaginationClass: TdxCustomReportLinkOptionsPaginationClass; +begin + Result := TdxGridReportLinkOptionsPagination; +end; + +function TdxGridReportLink.GetOptionsPreviewClass: TdxCustomTableControlReportLinkOptionsPreviewClass; +begin + Result := TdxGridReportLinkOptionsPreview; +end; + +function TdxGridReportLink.GetOptionsRefinementsClass: TdxCustomReportLinkOptionsRefinementsClass; +begin + Result := TdxGridReportLinkOptionsRefinements; +end; + +function TdxGridReportLink.GetOptionsSelectionClass: TdxCustomTableControlReportLinkOptionsSelectionClass; +begin + Result := TdxGridReportLinkOptionsSelection; +end; + +function TdxGridReportLink.GetOptionsSizeClass: TdxCustomReportLinkOptionsSizeClass; +begin + Result := TdxGridReportLinkOptionsSize; +end; + +function TdxGridReportLink.GetOptionsViewClass: TdxCustomReportLinkOptionsViewClass; +begin + Result := TdxGridReportLinkOptionsView; +end; + +procedure TdxGridReportLink.AddReportRow(AReportRow: TdxReportCell); +begin + FReportRows.Add(AReportRow); +end; + +procedure TdxGridReportLink.AddVerticalHardDelimiter(ADelimiter: TdxReportCell); +var + R: TRect; +begin + R := ADelimiter.AbsoluteRect; + AddVerticalHardDelimiter(R.Top); +end; + +procedure TdxGridReportLink.AddVerticalHardDelimiter(ADelimiter: Integer); +begin + FDelimitersHardVert.Add(TObject(ADelimiter)); +end; + +procedure TdxGridReportLink.BuildTopLevelView(AGridView: TcxCustomGridView); +begin + if (AGridView <> FProcessedView) and (AGridView <> nil) then BuildView(nil, AGridView); +end; + +procedure TdxGridReportLink.BuildTopLevelViews; +var + MasterRow: TcxGridMasterDataRow; + CurrentView: TcxCustomGridView; +begin + if OptionsLevels.Unwrap and OptionsLevels.UnwrapTopLevel then + begin + FProcessedView := nil; + try + MasterRow := ActiveViewMasterRow; + if OptionsLevels.RiseActiveLevelOntoTop then + begin + if MasterRow <> nil then + CurrentView := MasterRow.ActiveDetailGridView + else + CurrentView := ActiveView; + BuildTopLevelView(CurrentView); + FProcessedView := CurrentView; + end; + if not AbortBuilding then + ForEachView(MasterRow, BuildTopLevelView); + finally + FProcessedView := nil; + end; + end + else + BuildTopLevelView(ActiveView); +end; + +procedure TdxGridReportLink.BuildView(AMasterBuilder: TdxCustomGridViewBuilder; + AGridView: TcxCustomGridView); +begin + with CreateViewBuilder(AMasterBuilder, AGridView) do + try + Build; + finally + Free; + end; +end; + +function TdxGridReportLink.CreateViewAdapter(AMasterAdapter: TdxCustomGridViewAdapter; + AGridView: TcxCustomGridView): TdxCustomGridViewAdapter; +begin + Result := dxGridViewBuildersFactory.CreateViewAdapter(AMasterAdapter, AGridView); +end; + +function TdxGridReportLink.CreateViewBuilder(AMasterBuilder: TdxCustomGridViewBuilder; + AGridView: TcxCustomGridView): TdxCustomGridViewBuilder; +begin + Result := dxGridViewBuildersFactory.CreateViewBuilder(Self, AMasterBuilder, AGridView); +end; + +procedure TdxGridReportLink.DoExpandRows; +begin + if OptionsLevels.Unwrap and OptionsLevels.UnwrapTopLevel then + ForEachView(ActiveViewMasterRow, DoExpandViewRows) + else + DoExpandViewRows(ActiveView); +end; + +procedure TdxGridReportLink.DoExpandViewRows(AGridView: TcxCustomGridView); +begin + if AGridView <> nil then + with CreateViewAdapter(nil, AGridView) do + try + ExpandAllRows(OptionsExpanding, not OptionsDetails.OnlyFocusedView); + finally + Free; + end; +end; + +procedure TdxGridReportLink.ForEachView(AMasterRow: TcxGridMasterDataRow; AProc: TdxGridViewProc); +var + I: Integer; + GridView: TcxCustomGridView; + Level: TcxGridLevel; +begin + if not Assigned(AProc) then Exit; + + if AMasterRow <> nil then + for I := 0 to AMasterRow.DetailGridViewCount -1 do + begin + GridView := AMasterRow.DetailGridViews[I]; + if GridView <> nil then + begin + Level := GridView.Level as TcxGridLevel; + if Level.Visible then AProc(GridView); + end; + if AbortBuilding then Break; + end + else + with Grid.Levels do + for I := 0 to VisibleCount - 1 do + begin + AProc(VisibleItems[I].GridView); + if AbortBuilding then Break; + end; +end; + +function TdxGridReportLink.GetItemCustomDrawInfo(AnItem: TdxReportVisualItem; + out ADrawInfo: TdxGridCellCustomDrawInfo): TdxGridAttributeID; +begin + dxViewHelpersFactory.HelperClassByItem(AnItem).ExtractCustomDrawInfo(AnItem, ADrawInfo); + Result := ADrawInfo.GridAttributeID; +end; + +function TdxGridReportLink.HasSiblings(AGridView: TcxCustomGridView): Boolean; +var + ValidViewCount, I: Integer; +begin + if AGridView <> nil then + begin + ValidViewCount := 0; + with TcxGridLevel(AGridView.PatternGridView.Level).Parent do + for I := 0 to VisibleCount - 1 do + begin + if VisibleItems[I].GridView <> nil then Inc(ValidViewCount); + if ValidViewCount > 1 then Break; + end; + Result := ValidViewCount > 1; + end + else + Result := False; +end; + +function TdxGridReportLink.IsCardViewStyle(AStyle: TcxStyle): Boolean; +begin + Result := Styles.IsCardViewStyle(AStyle); +end; + +function TdxGridReportLink.IsCustomDrawn(AnAttributeID: TdxGridAttributeID): Boolean; +begin + Result := False; + case AnAttributeID of + dxGridBandID: + Result := Assigned(FOnCustomDrawBandCell); + dxGridCardRowCaptionID: + Result := Assigned(FOnCustomDrawCardRowCaptionCell); + dxGridCardRowDataID: + Result := Assigned(FOnCustomDrawCardRowDataCell); + dxGridFilterBarID: + Result := Assigned(FOnCustomDrawFilterBar); + dxGridFooterID, + dxGridGroupFooterID: + Result := Assigned(FOnCustomDrawFooterCell); + dxGridHeaderID: + Result := Assigned(FOnCustomDrawHeaderCell); + dxGridLevelCaptionID: + Result := Assigned(FOnCustomDrawLevelCaption); + dxGridRecordID: + Result := Assigned(FOnCustomDrawCell); + end; +end; + +function TdxGridReportLink.IsOffice11StyleGrouping: Boolean; +begin + {$IFDEF DXVER500} + Result := ActiveViewHelper.IsOffice11StyleGrouping(ActiveView); + {$ELSE} + Result := False; + {$ENDIF} +end; + +procedure TdxGridReportLink.CalculateProcessParams; +var + Adapter: TdxCustomGridViewAdapter; + View: TcxCustomGridView; +begin + View := ActiveView; + + with FProcessParams do + if View = nil then + begin + HasMasterDetails := False; + HasMasterDetailsInTopView := False; + HasOnlyCards := False; + HasOnlyCharts := False; + HasUnwrapableData := False; + CanUseOnEveryPageMode := not IsAggregated; + end + else + begin + Adapter := CreateViewAdapter(nil, View); + try + HasUnwrapableData := HasSiblings(Grid.ActiveLevel.GridView); + HasMasterDetailsInTopView := View.IsDetail or View.IsMaster; + HasMasterDetails := (HasUnwrapableData and OptionsLevels.Unwrap) or + (View.IsMaster and not Adapter.AreAllMasterRowsCollapsed and + not (OptionsDetails.StartFromFocusedView and OptionsDetails.OnlyFocusedView)); + HasOnlyCards := View is TcxGridCardView; +{$IFDEF CHARTVIEW} + HasOnlyCharts := View is TcxGridChartView; +{$ENDIF} + CanUseOnEveryPageMode := not IsAggregated and not HasMasterDetails and + Adapter.CanUseOnEveryPageMode; {Adapter.RecordCount <> 0} + finally + Adapter.Free; + end; + end; +end; + +function TdxGridReportLink.CanAttributeBeUsedOnEveryPage(AnAttribute: TdxGridAttributeClass): Boolean; +begin + Result := ProcessParams.CanUseOnEveryPageMode and OptionsOnEveryPage.HasInstalledAttribute(AnAttribute); +end; + +function TdxGridReportLink.IsAttributeUsedOnEveryPage(AnAttribute: TdxGridAttributeClass): Boolean; +begin + Result := CanAttributeBeUsedOnEveryPage(AnAttribute) or not OptionsView.HasInstalledAttribute(AnAttribute); +end; + +function TdxGridReportLink.GetActiveStyles: TdxGridReportLinkStyles; +begin + Result := inherited ActiveStyles as TdxGridReportLinkStyles; +end; + +function TdxGridReportLink.GetActiveView: TcxCustomGridView; +var + Level: TcxGridLevel; +begin + Result := nil; + if Grid <> nil then + Result := Grid.FocusedView; + if (Result <> nil) and not OptionsDetails.StartFromFocusedView then + begin + Level := Result.Level as TcxGridLevel; + while not Level.IsTop do + Level := Level.Parent; + Result := Level.GridView; + end; +end; + +function TdxGridReportLink.GetActiveViewHelper: TdxCustomGridViewHelperClass; +begin + if ActiveView = nil then + Result := TdxNullGridViewHelper + else + Result := dxViewHelpersFactory[ActiveView]; +end; + +function TdxGridReportLink.GetActiveViewMasterRow: TcxGridMasterDataRow; +begin + Result := nil; + with ActiveView do + if MasterGridRecordIndex <> -1 then + Result := (MasterGridView as TcxGridTableView).ViewData.Rows[MasterGridRecordIndex] as TcxGridMasterDataRow; +end; + +function TdxGridReportLink.GetActiveViewParentLevel: TcxGridLevel; +var + GridView: TcxCustomGridView; +begin + Result := nil; + GridView := ActiveView; + if GridView <> nil then + Result := TcxGridLevel(GridView.Level).Parent; +end; + +function TdxGridReportLink.GetDesignWindow: TdxfmGridReportLinkDesignWindow; +begin + Result := inherited DesignWindow as TdxfmGridReportLinkDesignWindow; +end; + +function TdxGridReportLink.GetGrid: TcxGrid; +begin + Result := TcxGrid(Component); +end; + +function TdxGridReportLink.GetOptionsExpanding: TdxGridReportLinkOptionsExpanding; +begin + Result := inherited OptionsExpanding as TdxGridReportLinkOptionsExpanding; +end; + +function TdxGridReportLink.GetOptionsFormatting: TdxGridReportLinkOptionsFormatting; +begin + Result := inherited OptionsFormatting as TdxGridReportLinkOptionsFormatting; +end; + +function TdxGridReportLink.GetOptionsOnEveryPage: TdxGridReportLinkOptionsOnEveryPage; +begin + Result := inherited OptionsOnEveryPage as TdxGridReportLinkOptionsOnEveryPage; +end; + +function TdxGridReportLink.GetOptionsPagination: TdxGridReportLinkOptionsPagination; +begin + Result := inherited OptionsPagination as TdxGridReportLinkOptionsPagination; +end; + +function TdxGridReportLink.GetOptionsPreview: TdxGridReportLinkOptionsPreview; +begin + Result := inherited OptionsPreview as TdxGridReportLinkOptionsPreview; +end; + +function TdxGridReportLink.GetOptionsRefinements: TdxGridReportLinkOptionsRefinements; +begin + Result := inherited OptionsRefinements as TdxGridReportLinkOptionsRefinements; +end; + +function TdxGridReportLink.GetOptionsSelection: TdxGridReportLinkOptionsSelection; +begin + Result := inherited OptionsSelection as TdxGridReportLinkOptionsSelection; +end; + +function TdxGridReportLink.GetOptionsSize: TdxGridReportLinkOptionsSize; +begin + Result := inherited OptionsSize as TdxGridReportLinkOptionsSize; +end; + +function TdxGridReportLink.GetOptionsView: TdxGridReportLinkOptionsView; +begin + Result := inherited OptionsView as TdxGridReportLinkOptionsView; +end; + +function TdxGridReportLink.GetReportRow(Index: Integer): TdxReportCell; +begin + Result := TdxReportCell(FReportRows[Index]); +end; + +function TdxGridReportLink.GetReportRowByGridRecord(GridRecord: TcxCustomGridRecord): TdxReportCell; +var + I: Integer; +begin + if GridRecord <> nil then + for I := 0 to ReportRowCount - 1 do + begin + Result := ReportRows[I]; + if Result.Data = Integer(GridRecord) then Exit; + end; + Result := nil; +end; + +function TdxGridReportLink.GetReportRowCount: Integer; +begin + Result := FReportRows.Count; +end; + +function TdxGridReportLink.GetStyles: TdxGridReportLinkStyles; +begin + Result := inherited Styles as TdxGridReportLinkStyles; +end; + +procedure TdxGridReportLink.SetOnCustomDrawBandCell(Value: TdxGridReportLinkCustomDrawBandCellEvent); +begin + if @FOnCustomDrawBandCell <> @Value then + begin + FOnCustomDrawBandCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawCell(Value: TdxGridReportLinkCustomDrawCellEvent); +begin + if @FOnCustomDrawCell <> @Value then + begin + FOnCustomDrawCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawCardRowCaptionCell(Value: TdxGridReportLinkCustomDrawCardRowCaptionCellEvent); +begin + if @FOnCustomDrawCardRowCaptionCell <> @Value then + begin + FOnCustomDrawCardRowCaptionCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawCardRowDataCell(Value: TdxGridReportLinkCustomDrawCardRowDataCellEvent); +begin + if @FOnCustomDrawCardRowDataCell <> @Value then + begin + FOnCustomDrawCardRowDataCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawFilterBar(Value: TdxGridReportLinkCustomDrawFilterBarEvent); +begin + if @FOnCustomDrawFilterBar <> @Value then + begin + FOnCustomDrawFilterBar := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawFooterCell(Value: TdxGridReportLinkCustomDrawFooterCellEvent); +begin + if @FOnCustomDrawFooterCell <> @Value then + begin + FOnCustomDrawFooterCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawHeaderCell(Value: TdxGridReportLinkCustomDrawHeaderCellEvent); +begin + if @FOnCustomDrawHeaderCell <> @Value then + begin + FOnCustomDrawHeaderCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOnCustomDrawLevelCaption(Value: TdxGridReportLinkCustomDrawLevelCaptionEvent); +begin + if @FOnCustomDrawLevelCaption <> @Value then + begin + FOnCustomDrawLevelCaption := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TdxGridReportLink.SetOptionsCards(Value: TdxGridReportLinkOptionsCards); +begin + OptionsCards.Assign(Value); +end; + +{$IFDEF CHARTVIEW} +procedure TdxGridReportLink.SetOptionsCharts(Value: TdxGridReportLinkOptionsCharts); +begin + OptionsCharts.Assign(Value); +end; +{$ENDIF} + +procedure TdxGridReportLink.SetOptionsDetails(Value: TdxGridReportLinkOptionsDetails); +begin + OptionsDetails.Assign(Value); +end; + +procedure TdxGridReportLink.SetOptionsExpanding(Value: TdxGridReportLinkOptionsExpanding); +begin + OptionsExpanding.Assign(Value); +end; + +procedure TdxGridReportLink.SetOptionsFormatting(Value: TdxGridReportLinkOptionsFormatting); +begin + inherited OptionsFormatting := Value; +end; + +procedure TdxGridReportLink.SetOptionsLevels(Value: TdxGridReportLinkOptionsLevels); +begin + OptionsLevels.Assign(Value); +end; + +procedure TdxGridReportLink.SetOptionsOnEveryPage(Value: TdxGridReportLinkOptionsOnEveryPage); +begin + inherited OptionsOnEveryPage := Value; +end; + +procedure TdxGridReportLink.SetOptionsPagination(Value: TdxGridReportLinkOptionsPagination); +begin + inherited OptionsPagination := Value; +end; + +procedure TdxGridReportLink.SetOptionsPreview(Value: TdxGridReportLinkOptionsPreview); +begin + inherited OptionsPreview := Value; +end; + +procedure TdxGridReportLink.SetOptionsRefinements(Value: TdxGridReportLinkOptionsRefinements); +begin + inherited OptionsRefinements := Value; +end; + +procedure TdxGridReportLink.SetOptionsSelection(Value: TdxGridReportLinkOptionsSelection); +begin + inherited OptionsSelection := Value; +end; + +procedure TdxGridReportLink.SetOptionsSize(Value: TdxGridReportLinkOptionsSize); +begin + inherited OptionsSize := Value; +end; + +procedure TdxGridReportLink.SetOptionsView(Value: TdxGridReportLinkOptionsView); +begin + inherited OptionsView := Value; +end; + +procedure TdxGridReportLink.SetStyles(Value: TdxGridReportLinkStyles); +begin + inherited Styles := Value; +end; + +{ TcxGridCardView2OptionsView } + +constructor TcxGridCardView2OptionsView.Create(AGridView: TcxCustomGridView); +begin + inherited; + FCardBorders := False; + FGridLineColor := clDefault; + FGridLines := glNone; + FShadowDepth := 4; +end; + +procedure TcxGridCardView2OptionsView.Assign(Source: TPersistent); +begin + if Source is TcxGridCardView2OptionsView then + with TcxGridCardView2OptionsView(Source) do + begin + Self.CardBorders := CardBorders; + Self.GridLineColor := GridLineColor; + Self.GridLines := GridLines; + Self.ShadowDepth := ShadowDepth; + end; + inherited; +end; + +function TcxGridCardView2OptionsView.GetShadowVisible: Boolean; +begin + Result := ShadowDepth <> 0; +end; + +procedure TcxGridCardView2OptionsView.SetCardBorders(Value: Boolean); +begin + if FCardBorders <> Value then + begin + FCardBorders := Value; + {$IFDEF DXVER500} + Changed(vcSize); + {$ELSE} + SizeChanged; + {$ENDIF} + end; +end; + +procedure TcxGridCardView2OptionsView.SetGridLineColor(Value: TColor); +begin + if FGridLineColor <> Value then + begin + FGridLineColor := Value; + {$IFDEF DXVER500} + Changed(vcLayout); + {$ELSE} + LayoutChanged; + {$ENDIF} + end; +end; + +procedure TcxGridCardView2OptionsView.SetGridLines(Value: TcxGridLines); +begin + if FGridLines <> Value then + begin + FGridLines := Value; + {$IFDEF DXVER500} + Changed(vcSize); + {$ELSE} + SizeChanged; + {$ENDIF} + end; +end; + +procedure TcxGridCardView2OptionsView.SetShadowDepth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FShadowDepth <> Value then + begin + FShadowDepth := Value; + {$IFDEF DXVER500} + Changed(vcSize); + {$ELSE} + SizeChanged; + {$ENDIF} + end; +end; + +{ TcxGridCardView2Styles } + +procedure TcxGridCardView2Styles.Assign(Source: TPersistent); +begin + if Source is TcxGridCardView2Styles then + with TcxGridCardView2Styles(Source) do + begin + Self.CardShadow := CardShadow; + end; + inherited; +end; + +procedure TcxGridCardView2Styles.GetCardShadowParams(ARecord: TcxCustomGridRecord; + out AParams: TcxViewParams); +var + AStyle: TcxStyle; +begin + AStyle := nil; + if Assigned(FOnGetCardShadowStyle) then + FOnGetCardShadowStyle(GridView, ARecord, AStyle); + GetViewParams(vsCardShadow, ARecord, AStyle, AParams); +end; + +procedure TcxGridCardView2Styles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +begin + inherited; + if Index = vsCardShadow then AParams.Color := clWindowText; +end; + +type + TcxGridCardViewInfo2 = class; + TcxGridCardViewViewInfo2 = class; + + TcxGridCardRowCaptionViewInfo2 = class(TcxGridCardRowCaptionViewInfo) + private + function GetCardViewInfo: TcxGridCardViewInfo2; + protected + function GetBorderColor(AIndex: TcxBorder): TColor; override; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + public + property CardViewInfo: TcxGridCardViewInfo2 read GetCardViewInfo; + end; + + TcxGridCardRowDataViewInfo2 = class(TcxGridCardRowDataViewInfo) + private + function GetCardViewInfo: TcxGridCardViewInfo2; + protected + function GetBorderColor(AIndex: TcxBorder): TColor; override; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + public + property CardViewInfo: TcxGridCardViewInfo2 read GetCardViewInfo; + end; + + TcxGridCardDataRowViewInfo2 = class(TcxGridCardDataRowViewInfo) + protected + {$IFDEF GRID6}class {$ENDIF}function GetCaptionViewInfoClass: TcxGridCardRowCaptionViewInfoClass; override; + {$IFDEF GRID6}class {$ENDIF}function GetDataViewInfoClass: TcxGridCardRowDataViewInfoClass; override; + end; + + TcxGridCardCaptionRowViewInfo2 = class(TcxGridCardRowViewInfo) + protected + {$IFDEF GRID6}class {$ENDIF}function GetCaptionViewInfoClass: TcxGridCardRowCaptionViewInfoClass; override; + {$IFDEF GRID6}class {$ENDIF}function GetDataViewInfoClass: TcxGridCardRowDataViewInfoClass; override; + end; + + TcxGridCardPainter2 = class(TcxGridCardPainter) + private + function GetViewInfo: TcxGridCardViewInfo2; + protected + procedure DrawBottomShadowAndRestSpace; virtual; + {$IFDEF DXVER500} + procedure DrawCardBorder; override; + {$ENDIF} + procedure DrawRightShadowAndRestSpace; virtual; + procedure DrawShadows; virtual; + procedure Paint; override; + property ViewInfo: TcxGridCardViewInfo2 read GetViewInfo; + end; + + TcxGridCardViewInfo2 = class(TcxGridCardViewInfo) + private + function GetGridView: TcxGridCardView2; + protected + function CalculateHeight: Integer; override; + function GetContentWidth: Integer; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + {$IFDEF GRID6}class {$ENDIF}function GetRowViewInfoClass(ARow: TcxGridCardViewRow): TcxGridCardRowViewInfoClass; override; + + function GetBottomShadowRect: TRect; virtual; + function GetBottomShadowRestRect: TRect; virtual; + function GetCardRowCaptionBorders(ARowCaption: TcxGridCardRowCaptionViewInfo2): TcxBorders; virtual; + function GetCardRowDataBorders(ARowData: TcxGridCardRowDataViewInfo2): TcxBorders; virtual; + function GetGridLineColor: TColor; virtual; + function GetRightShadowRect: TRect; virtual; + function GetRightShadowRestRect: TRect; virtual; + function GetShadowColor: TColor; virtual; + function GetShadowDepth: Integer; virtual; + function GetShadowRestColor: TColor; virtual; + + property GridView: TcxGridCardView2 read GetGridView; + public + property BottomShadowRect: TRect read GetBottomShadowRect; + property BottomShadowRestRect: TRect read GetBottomShadowRestRect; + property GridLineColor: TColor read GetGridLineColor; + property RightShadowRect: TRect read GetRightShadowRect; + property RightShadowRestRect: TRect read GetRightShadowRestRect; + property ShadowColor: TColor read GetShadowColor; + property ShadowDepth: Integer read GetShadowDepth; + property ShadowRestColor: TColor read GetShadowRestColor; + end; + + TcxGridCard2 = class(TcxGridCard) + protected + function GetViewInfoClass: TcxCustomGridRecordViewInfoClass; override; + end; + + TcxGridCardViewViewData2 = class(TcxGridCardViewViewData) + protected + function GetRecordClass(ARecordInfo: TcxRowInfo): TcxCustomGridRecordClass; override; + end; + + TcxGridCardsHorizontalViewInfo2 = class(TcxGridCardsHorizontalViewInfo) + private + function GetGridView: TcxGridCardView2; + protected + function CalculateCardHeight: Integer; override; + function GetShadowDepth: Integer; virtual; + + property GridView: TcxGridCardView2 read GetGridView; + public + property ShadowDepth: Integer read GetShadowDepth; + end; + + TcxGridCardsVerticalViewInfo2 = class(TcxGridCardsVerticalViewInfo) + private + function GetGridView: TcxGridCardView2; + protected + function CalculateCardHeight: Integer; override; + function GetShadowDepth: Integer; virtual; + + property GridView: TcxGridCardView2 read GetGridView; + public + property ShadowDepth: Integer read GetShadowDepth; + end; + + TcxGridCardViewViewInfo2 = class(TcxGridCardViewViewInfo) + protected + function GetRecordsViewInfoClass: TcxCustomGridRecordsViewInfoClass; override; + end; + +{ TcxGridCardRowCaptionViewInfo2 } + +function TcxGridCardRowCaptionViewInfo2.GetBorderColor(AIndex: TcxBorder): TColor; +begin + Result := CardViewInfo.GridLineColor; +end; + +function TcxGridCardRowCaptionViewInfo2.GetBorders: TcxBorders; +begin + Result := CardViewInfo.GetCardRowCaptionBorders(Self); +end; + +function TcxGridCardRowCaptionViewInfo2.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := 1; +end; + +function TcxGridCardRowCaptionViewInfo2.GetCardViewInfo: TcxGridCardViewInfo2; +begin + Result := inherited CardViewInfo as TcxGridCardViewInfo2 +end; + +{ TcxGridCardRowDataViewInfo2 } + +function TcxGridCardRowDataViewInfo2.GetBorderColor(AIndex: TcxBorder): TColor; +begin + Result := CardViewInfo.GridLineColor; +end; + +function TcxGridCardRowDataViewInfo2.GetBorders: TcxBorders; +begin + Result := CardViewInfo.GetCardRowDataBorders(Self); +end; + +function TcxGridCardRowDataViewInfo2.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := 1; +end; + +function TcxGridCardRowDataViewInfo2.GetCardViewInfo: TcxGridCardViewInfo2; +begin + Result := inherited CardViewInfo as TcxGridCardViewInfo2 +end; + +{ TcxGridCardDataRowViewInfo2 } + +{$IFDEF GRID6}class {$ENDIF}function TcxGridCardDataRowViewInfo2.GetCaptionViewInfoClass: TcxGridCardRowCaptionViewInfoClass; +begin + Result := TcxGridCardRowCaptionViewInfo2; +end; + +{$IFDEF GRID6}class {$ENDIF}function TcxGridCardDataRowViewInfo2.GetDataViewInfoClass: TcxGridCardRowDataViewInfoClass; +begin + Result := TcxGridCardRowDataViewInfo2; +end; + +{ TcxGridCardCaptionRowViewInfo2 } + +{$IFDEF GRID6}class {$ENDIF}function TcxGridCardCaptionRowViewInfo2.GetCaptionViewInfoClass: TcxGridCardRowCaptionViewInfoClass; +begin + Result := TcxGridCardRowCaptionViewInfo2; +end; + +{$IFDEF GRID6}class {$ENDIF}function TcxGridCardCaptionRowViewInfo2.GetDataViewInfoClass: TcxGridCardRowDataViewInfoClass; +begin + Result := TcxGridCardRowDataViewInfo2; +end; + +{ TcxGridCardPainter2 } + +procedure TcxGridCardPainter2.DrawBottomShadowAndRestSpace; +var + R: TRect; +begin + R := ViewInfo.BottomShadowRect; + if Canvas.RectVisible(R) then + begin + Canvas.Brush.Color := ViewInfo.ShadowColor; + Canvas.FillRect(R); + end; + + R := ViewInfo.BottomShadowRestRect; + if Canvas.RectVisible(R) then + begin + Canvas.Brush.Color := ViewInfo.ShadowRestColor; + Canvas.FillRect(R); + end; +end; + +{$IFDEF DXVER500} +procedure TcxGridCardPainter2.DrawCardBorder; +begin + with ViewInfo, Self.Canvas do + FrameRect(Bounds, clWindow, CardBorderWidth); +end; +{$ENDIF} + +procedure TcxGridCardPainter2.DrawRightShadowAndRestSpace; +var + R: TRect; +begin + R := ViewInfo.RightShadowRect; + if Canvas.RectVisible(R) then + begin + Canvas.Brush.Color := ViewInfo.ShadowColor; + Canvas.FillRect(R); + end; + + R := ViewInfo.RightShadowRestRect; + if Canvas.RectVisible(R) then + begin + Canvas.Brush.Color := ViewInfo.ShadowRestColor; + Canvas.FillRect(R); + end; +end; + +procedure TcxGridCardPainter2.DrawShadows; +var + Color: TColor; +begin + Color := Canvas.Brush.Color; + DrawBottomShadowAndRestSpace; + DrawRightShadowAndRestSpace; + Canvas.Brush.Color := Color; +end; + +procedure TcxGridCardPainter2.Paint; +begin + DrawShadows; + inherited; +end; + +function TcxGridCardPainter2.GetViewInfo: TcxGridCardViewInfo2; +begin + Result := TcxGridCardViewInfo2(inherited ViewInfo); +end; + +{ TcxGridCardViewInfo2 } + +function TcxGridCardViewInfo2.CalculateHeight: Integer; +begin + Result := inherited CalculateHeight; + if RecordsViewInfo.AutoDataRecordHeight or (RecordsViewInfo.CardHeight = -1) then + Inc(Result, ShadowDepth); +end; + +function TcxGridCardViewInfo2.GetContentWidth: Integer; +begin + Result := inherited GetContentWidth - ShadowDepth; +end; + +function TcxGridCardViewInfo2.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridCardPainter2; +end; + +{$IFDEF GRID6}class {$ENDIF}function TcxGridCardViewInfo2.GetRowViewInfoClass(ARow: TcxGridCardViewRow): TcxGridCardRowViewInfoClass; +const + RowViewInfoClasses: array[TcxGridCardViewRowKind] of TcxGridCardRowViewInfoClass = + (TcxGridCardDataRowViewInfo2, TcxGridCardCaptionRowViewInfo2{$IFDEF GRID6}, TcxGridCardCaptionRowViewInfo2{$ENDIF}); +begin + Result := RowViewInfoClasses[ARow.Kind]; +end; + +function TcxGridCardViewInfo2.GetBottomShadowRect: TRect; +begin + Result := ContentBounds; + Inc(Result.Left, ShadowDepth); + Result.Top := Result.Bottom - ShadowDepth; +end; + +function TcxGridCardViewInfo2.GetBottomShadowRestRect: TRect; +begin + Result := ContentBounds; + Result.Right := Result.Left + ShadowDepth; + Result.Top := Result.Bottom - ShadowDepth; +end; + +function TcxGridCardViewInfo2.GetCardRowCaptionBorders(ARowCaption: TcxGridCardRowCaptionViewInfo2): TcxBorders; +begin + Result := [bLeft, bTop]; + if ARowCaption.Row.VisibleIndex = GridView.RowCount - 1 then + Include(Result, bBottom); + + with TcxGridCardView2OptionsView(GridView.OptionsView) do + begin + if not CardBorders then + begin + Exclude(Result, bLeft); + if ARowCaption.Row.VisibleIndex = 0 then + Exclude(Result, bTop); + if ARowCaption.Row.VisibleIndex = Self.GridView.RowCount - 1 then + Exclude(Result, bBottom); + end; + if not (GridLines in [glBoth, glHorizontal]) and (ARowCaption.Row.VisibleIndex > 0) then + Exclude(Result, bTop); + end; +end; + +function TcxGridCardViewInfo2.GetCardRowDataBorders(ARowData: TcxGridCardRowDataViewInfo2): TcxBorders; +begin + Result := [bLeft, bTop, bRight]; + if ARowData.Row.VisibleIndex = GridView.RowCount - 1 then + Include(Result, bBottom); + with TcxGridCardView2OptionsView(GridView.OptionsView) do + begin + if not CardBorders then + begin + Exclude(Result, bRight); + if ARowData.Row.VisibleIndex = 0 then + Exclude(Result, bTop); + if ARowData.Row.VisibleIndex = Self.GridView.RowCount - 1 then + Exclude(Result, bBottom); + end; + if not (GridLines in [glBoth, glHorizontal]) and (ARowData.Row.VisibleIndex > 0) then + Exclude(Result, bTop); + if not (GridLines in [glBoth, glVertical]) then + Exclude(Result, bLeft); + end; +end; + +function TcxGridCardViewInfo2.GetGridLineColor: TColor; +begin + Result := TcxGridCardView2OptionsView(GridView.OptionsView).GridLineColor; + if Result = clDefault then + Result := GridView.LookAndFeelPainter.DefaultGridLineColor; +end; + +function TcxGridCardViewInfo2.GetRightShadowRect: TRect; +begin + Result := ContentBounds; + Result.Left := Result.Right - ShadowDepth; + Inc(Result.Top, ShadowDepth); +end; + +function TcxGridCardViewInfo2.GetRightShadowRestRect: TRect; +begin + Result := ContentBounds; + Result.Left := Result.Right - ShadowDepth; + Result.Bottom := Result.Top + ShadowDepth; +end; + +function TcxGridCardViewInfo2.GetShadowColor: TColor; +var + Params: TcxViewParams; +begin + TcxGridCardView2Styles(GridView.Styles).GetCardShadowParams(GridRecord, Params); + Result := Params.Color; + if Result = clDefault then + Result := clWindowText; +end; + +function TcxGridCardViewInfo2.GetShadowDepth: Integer; +begin + Result := TcxGridCardView2OptionsView(GridView.OptionsView).ShadowDepth; +end; + +function TcxGridCardViewInfo2.GetShadowRestColor: TColor; +var + Params: TcxViewParams; +begin + TcxGridCardView2Styles(GridView.Styles).GetViewParams(vsBackground, nil, nil, Params); + Result := Params.Color; +end; + +function TcxGridCardViewInfo2.GetGridView: TcxGridCardView2; +begin + Result := TcxGridCardView2(inherited GridView); +end; + +{ TcxGridCard2 } + +function TcxGridCard2.GetViewInfoClass: TcxCustomGridRecordViewInfoClass; +begin + Result := TcxGridCardViewInfo2; +end; + +{ TcxGridCardViewViewData2 } + +function TcxGridCardViewViewData2.GetRecordClass(ARecordInfo: TcxRowInfo): TcxCustomGridRecordClass; +begin + Result := TcxGridCard2; +end; + +{ TcxGridCardsHorizontalViewInfo2 } + +function TcxGridCardsHorizontalViewInfo2.GetGridView: TcxGridCardView2; +begin + Result := TcxGridCardView2(inherited GridView); +end; + +function TcxGridCardsHorizontalViewInfo2.CalculateCardHeight: Integer; +begin + Result := inherited CalculateCardHeight + ShadowDepth; +end; + +function TcxGridCardsHorizontalViewInfo2.GetShadowDepth: Integer; +begin + Result := TcxGridCardView2OptionsView(GridView.OptionsView).ShadowDepth; +end; + +{ TcxGridCardsVerticalViewInfo2 } + +function TcxGridCardsVerticalViewInfo2.GetGridView: TcxGridCardView2; +begin + Result := TcxGridCardView2(inherited GridView); +end; + +function TcxGridCardsVerticalViewInfo2.CalculateCardHeight: Integer; +begin + Result := inherited CalculateCardHeight + ShadowDepth; +end; + +function TcxGridCardsVerticalViewInfo2.GetShadowDepth: Integer; +begin + Result := TcxGridCardView2OptionsView(GridView.OptionsView).ShadowDepth; +end; + +{ TcxGridCardViewViewInfo2 } + +function TcxGridCardViewViewInfo2.GetRecordsViewInfoClass: TcxCustomGridRecordsViewInfoClass; +const + ViewInfoClasses: array[TcxGridCardViewLayoutDirection] of TcxCustomGridRecordsViewInfoClass = + (TcxGridCardsHorizontalViewInfo2, TcxGridCardsVerticalViewInfo2); +begin + Result := ViewInfoClasses[GridView.LayoutDirection]; +end; + +{ TcxGridCardView2 } + +function TcxGridCardView2.GetOptionsViewClass: TcxCustomGridOptionsViewClass; +begin + Result := TcxGridCardView2OptionsView; +end; + +function TcxGridCardView2.GetStylesClass: TcxCustomGridViewStylesClass; +begin + Result := TcxGridCardView2Styles; +end; + +function TcxGridCardView2.GetViewDataClass: TcxCustomGridViewDataClass; +begin + Result := TcxGridCardViewViewData2; +end; + +function TcxGridCardView2.GetViewInfoClass: TcxCustomGridViewInfoClass; +begin + Result := TcxGridCardViewViewInfo2; +end; + +{ TdxfmGridReportLinkDesignWindow } + +constructor TdxfmGridReportLinkDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxhccxGridReportLinkDesigner; + inherited; + CreateControls; + SetActivePage; +end; + +destructor TdxfmGridReportLinkDesignWindow.Destroy; +begin + dxPSPopupMan.dxPSPopupMenuController.UnregisterControl(lbxStyles); + inherited; +end; + +procedure TdxfmGridReportLinkDesignWindow.DoInitialize; +begin + lbxStyles.ReportLinkStyles := ReportLink.ActiveStyles; + inherited; + RefreshStylesList; + + CreateCardView; + //CreateChartView; + {.$IFNDEF DXVER500} + {.$ENDIF} + + {$IFNDEF DXVER500} + chbxExpandCards.Visible := False; + + //chbxTransparentRichEdits.Visible := False; {.3} + //bvlRefinementsSeparator.Top := bvlRefinementsSeparator.Top - 20; + //chbxSuppressBackgroundBitmaps.Top := chbxSuppressBackgroundBitmaps.Top - 20; + //chbxConsumeSelectionStyle.Top := chbxConsumeSelectionStyle.Top - 20; + {$ENDIF} + + if ReportLink.ProcessParams.HasOnlyCards then + PageControl1.ActivePage := tshCards; + if ReportLink.ProcessParams.HasOnlyCharts then + PageControl1.ActivePage := tshCharts; + + InitializePreviewGrid; + InitializePreviewGridStyles; + LoadDataIntoPreviewGridView(PreviewGrid.Levels[0].GridView as TcxCustomGridTableView); + + with ReportLink.OptionsView do + begin + chbxShowCaptions.Checked := Caption; + chbxShowBands.Checked := BandHeaders; + chbxShowExpandButtons.Checked := ExpandButtons; + chbxShowGroupFooters.Checked := GroupFooters; + chbxShowFilterBar.Checked := FilterBar; + chbxShowFooters.Checked := Footers; + chbxShowHeaders.Checked := Headers; + end; + + with ReportLink.OptionsOnEveryPage do + begin + chbxCaptionsOnEveryPage.Checked := Caption; + chbxBandsOnEveryPage.Checked := BandHeaders; + chbxFilterBarOnEveryPage.Checked := FilterBar; + chbxFootersOnEveryPage.Checked := Footers; + chbxHeadersOnEveryPage.Checked := Headers; + end; + + with cbxLookAndFeel do + begin + Items.Clear; + Items.AddObject(cxGetResourceString(@sdxLookAndFeelFlat), TObject(lfFlat)); + Items.AddObject(cxGetResourceString(@sdxLookAndFeelStandard), TObject(lfStandard)); + Items.AddObject(cxGetResourceString(@sdxLookAndFeelUltraFlat), TObject(lfUltraFlat)); + + ItemIndex := Items.IndexOfObject(TObject(ReportLink.OptionsFormatting.LookAndFeelKind)); + end; + + with ReportLink.OptionsSelection do + begin + chbxProcessSelection.Checked := ProcessSelection; + chbxProcessExactSelection.Checked := ProcessExactSelection; + end; + + with ReportLink.OptionsExpanding do + begin + chbxExpandGroupRows.Checked := ExpandGroupRows; + chbxExpandMasterRows.Checked := ExpandMasterRows; + {$IFDEF DXVER500} + chbxExpandCards.Checked := ExpandCards; + {$ENDIF} + end; + + with ReportLink.OptionsRefinements do + begin + chbxTransparentGraphics.Checked := TransparentGraphics; + chbxDisplayGraphicsAsText.Checked := DisplayGraphicsAsText; + chbxFlatCheckMarks.Checked := FlatCheckMarks; + {$IFDEF DXVER500} {.3} + //chbxTransparentRichEdits.Checked := TransparentRichEdits; + {$ENDIF} + end; + + with ReportLink.OptionsSize do + begin + chbxGridAutoWidth.Checked := AutoWidth; + end; + + with ReportLink.OptionsDetails do + begin + chbxStartFromActiveView.Checked := StartFromFocusedView; + chbxOnlyActiveView.Checked := OnlyFocusedView; + end; + + with ReportLink.OptionsLevels do + begin + chbxLevelsUnwrap.Checked := Unwrap; + chbxLevelsUnwrapTopLevel.Checked := UnwrapTopLevel; + chbxLevelsRiseActiveLevelOntoTop.Checked := RiseActiveLevelOntoTop; + end; + + with ReportLink.OptionsFormatting do + begin + chbxSuppressBackgroundBitmaps.Checked := SuppressBackgroundBitmaps; + chbxConsumeSelectionStyle.Checked := ConsumeSelectionStyle; + chbxUseNativeStyles.Checked := UseNativeStyles; + end; + + with ReportLink.OptionsPagination do + begin + chbxPaginateByTopLevelGroups.Checked := TopLevelGroup; + chbxPaginateOneGroupPerPage.Checked := OneGroupPerPage; + end; + + with ReportLink.OptionsPreview do + begin + chbxPreviewVisible.Checked := Visible; + chbxPreviewAutoHeight.Checked := AutoHeight; + sePreviewMaxLineCount.AsInteger := MaxLineCount; + end; + + with ReportLink.OptionsCards do + begin + chbxCardsAutoWidth.Checked := AutoWidth; + chbxCardsKeepSameWidth.Checked := KeepSameWidth; + chbxCardsKeepSameHeight.Checked := KeepSameHeight; + chbxCardsBorder.Checked := Borders; + chbxCardsHorzLines.Checked := RowBordersHorz; + chbxCardsVertLines.Checked := RowBordersVert; + seCardsSpaceHorz.AsInteger := InterCardsSpaceHorz; + seCardsSpaceVert.AsInteger := InterCardsSpaceVert; + with Shadow do + begin + seCardsShadowDepth.AsInteger := Depth; + ccbxCardsShadowColor.ColorValue := Color; + end; + end; + +{$IFDEF CHARTVIEW} + with ReportLink.OptionsCharts do + begin + chbxChartsTransparent.Checked := Transparent; + end; +{$ENDIF} +end; + +{$IFDEF DELPHI7} +function TdxfmGridReportLinkDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +procedure TdxfmGridReportLinkDesignWindow.LoadStrings; + + procedure AdjustBevelSize(ABevel: TBevel; AControl: TControl); + var + Right: Integer; + begin + Right := ABevel.BoundsRect.Right; + ABevel.Left := AControl.Left + AControl.Width + 10; + ABevel.Width := Right - ABevel.Left; + end; + +begin + inherited; + + lblPreviewWindow.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + tshView.Caption := cxGetResourceString(@sdxViewTab); + + lblShow.Caption := cxGetResourceString(@sdxShow); + AdjustBevelSize(bvlShow, lblShow); + chbxShowCaptions.Caption := cxGetResourceString(@sdxLevelCaption); + chbxShowBands.Caption := cxGetResourceString(@sdxBands); + chbxShowHeaders.Caption := cxGetResourceString(@sdxHeaders); + chbxShowFooters.Caption := cxGetResourceString(@sdxFooters); + chbxShowGroupFooters.Caption := cxGetResourceString(@sdxGroupFooters); + chbxShowExpandButtons.Caption := cxGetResourceString(@sdxExpandButtons); + chbxShowFilterBar.Caption := cxGetResourceString(@sdxFilterBar); + + lblOnEveryPage.Caption := cxGetResourceString(@sdxOnEveryPage); + AdjustBevelSize(bvlOnEveryPage, lblOnEveryPage); + chbxCaptionsOnEveryPage.Caption := DropAmpersand(cxGetResourceString(@sdxLevelCaption)); + chbxBandsOnEveryPage.Caption := DropAmpersand(cxGetResourceString(@sdxBands)); + chbxHeadersOnEveryPage.Caption := DropAmpersand(cxGetResourceString(@sdxHeaders)); + chbxFootersOnEveryPage.Caption := DropAmpersand(cxGetResourceString(@sdxFooters)); + chbxFilterBarOnEveryPage.Caption := DropAmpersand(cxGetResourceString(@sdxFilterBar)); + + tshBehaviors.Caption := cxGetResourceString(@sdxBehaviorsTab); + + lblSelection.Caption := cxGetResourceString(@sdxSelection); + AdjustBevelSize(bvlSelection, lblSelection); + chbxProcessSelection.Caption := cxGetResourceString(@sdxProcessSelection); + chbxProcessExactSelection.Caption := cxGetResourceString(@sdxProcessExactSelection); + + lblExpanding.Caption := cxGetResourceString(@sdxExpanding); + AdjustBevelSize(bvlExpanding, lblExpanding); + chbxExpandGroupRows.Caption := cxGetResourceString(@sdxGroups); + chbxExpandMasterRows.Caption := cxGetResourceString(@sdxDetails); + chbxExpandCards.Caption := cxGetResourceString(@sdxCardsRows); + + lblGridSize.Caption := cxGetResourceString(@sdxSize); + AdjustBevelSize(bvlGridSize, lblGridSize); + chbxGridAutoWidth.Caption := cxGetResourceString(@sdxAutoWidth); + + lblDetails.Caption := DropAmpersand(cxGetResourceString(@sdxDetails)); + AdjustBevelSize(bvlDetails, lblDetails); + chbxStartFromActiveView.Caption := cxGetResourceString(@sdxStartFromActiveDetails); + chbxOnlyActiveView.Caption := cxGetResourceString(@sdxOnlyActiveDetails); + + lblLevels.Caption := cxGetResourceString(@sdxLevels); + AdjustBevelSize(bvlLevels, lblLevels); + chbxLevelsUnwrap.Caption := cxGetResourceString(@sdxUnwrap); + chbxLevelsUnwrapTopLevel.Caption := cxGetResourceString(@sdxUnwrapTopLevel); + chbxLevelsRiseActiveLevelOntoTop.Caption := cxGetResourceString(@sdxRiseActiveToTop); + + tshFormatting.Caption := cxGetResourceString(@sdxFormatting); + lblLookAndFeel.Caption := cxGetResourceString(@sdxLookAndFeel); + AdjustBevelSize(bvlLookAndFeel, lblLookAndFeel); + + lblRefinements.Caption := cxGetResourceString(@sdxRefinements); + AdjustBevelSize(bvlRefinements, lblRefinements); + chbxTransparentGraphics.Caption := cxGetResourceString(@sdxTransparentGraphics); + chbxDisplayGraphicsAsText.Caption := DropAmpersand(cxGetResourceString(@sdxDisplayGraphicsAsText)); + chbxFlatCheckMarks.Caption := cxGetResourceString(@sdxFlatCheckMarks); + //chbxTransparentRichEdits.Caption := cxGetResourceString(@sdxTransparentRichEdits); {.3} + + chbxSuppressBackgroundBitmaps.Caption := cxGetResourceString(@sdxSuppressBackgroundBitmaps); + chbxConsumeSelectionStyle.Caption := cxGetResourceString(@sdxConsumeSelectionStyle); + + lblPagination.Caption := cxGetResourceString(@sdxPagination); + AdjustBevelSize(bvlPagination, lblPagination); + chbxPaginateByTopLevelGroups.Caption := cxGetResourceString(@sdxByTopLevelGroups); + chbxPaginateOneGroupPerPage.Caption := cxGetResourceString(@sdxOneGroupPerPage); + + tshStyles.Caption := cxGetResourceString(@sdxStyles); + lblUseNativeStyles.Caption := cxGetResourceString(@sdxUseNativeStyles); + AdjustBevelSize(bvlStyles, lblUseNativeStyles); + btnStyleColor.Caption := cxGetResourceString(@sdxBtnColor); + btnStyleFont.Caption := cxGetResourceString(@sdxBtnFont); + btnStyleBackgroundBitmap.Caption := cxGetResourceString(@sdxBtnTexture); + btnStyleBackgroundBitmapClear.Caption := cxGetResourceString(@sdxBtnTextureClear); + btnStyleRestoreDefaults.Caption := cxGetResourceString(@sdxBtnRestoreDefaults); + btnStylesSaveAs.Caption := cxGetResourceString(@sdxBtnSaveAs); + + miStyleColor.Caption := cxGetResourceString(@sdxBtnColor); + miStyleFont.Caption := cxGetResourceString(@sdxBtnFont); + miStyleBackgroundBitmap.Caption := cxGetResourceString(@sdxBtnTexture); + miStyleBackgroundBitmapClear.Caption := cxGetResourceString(@sdxBtnTextureClear); + miStyleRestoreDefaults.Caption := cxGetResourceString(@sdxBtnRestoreDefaults); + miStylesSelectAll.Caption := cxGetResourceString(@sdxSelectAll); + miStylesSaveAs.Caption := cxGetResourceString(@sdxBtnSaveAs); + + lblStyleSheets.Caption := cxGetResourceString(@sdxStyleSheets); + AdjustBevelSize(bvlStyleSheets, lblStyleSheets); + btnStyleSheetNew.Caption := cxGetResourceString(@sdxBtnNew); + btnStyleSheetCopy.Caption := cxGetResourceString(@sdxBtnCopy); + btnStyleSheetDelete.Caption := cxGetResourceString(@sdxBtnDelete); + btnStyleSheetRename.Caption := cxGetResourceString(@sdxBtnRename); + + tshPreview.Caption := cxGetResourceString(@sdxPreviewTab); + lblPreviewOptions.Caption := cxGetResourceString(@sdxOptions); + AdjustBevelSize(bvlPreviewOptions, lblPreviewOptions); + chbxPreviewVisible.Caption := cxGetResourceString(@sdxVisible); + chbxPreviewAutoHeight.Caption := cxGetResourceString(@sdxPreviewAutoHeight); + lblPreviewMaxLineCount.Caption := cxGetResourceString(@sdxPreviewMaxLineCount); + + tshCards.Caption := cxGetResourceString(@sdxCardsTab); + lblCardSizes.Caption := cxGetResourceString(@sdxSizes); + AdjustBevelSize(bvlCardSizes, lblCardSizes); + chbxCardsAutoWidth.Caption := cxGetResourceString(@sdxAutoWidth); + chbxCardsKeepSameWidth.Caption := cxGetResourceString(@sdxKeepSameWidth); + chbxCardsKeepSameHeight.Caption := cxGetResourceString(@sdxKeepSameHeight); + + lblCardSpacing.Caption := cxGetResourceString(@sdxSpacing); + AdjustBevelSize(bvlCardSpacing, lblCardSpacing); + lblCardSpaceHorz.Caption := cxGetResourceString(@sdxHorizontal); + lblCardSpaceVert.Caption := cxGetResourceString(@sdxVertical); + + lblCardFraming.Caption := cxGetResourceString(@sdxFraming); + AdjustBevelSize(bvlCardFraming, lblCardFraming); + chbxCardsBorder.Caption := cxGetResourceString(@sdxBorderLines); + chbxCardsHorzLines.Caption := cxGetResourceString(@sdxHorzLines); + chbxCardsVertLines.Caption := cxGetResourceString(@sdxVertLines); + + lblCardShadow.Caption := cxGetResourceString(@sdxShadow); + AdjustBevelSize(bvlCardShadow, lblCardShadow); + lblCardShadowColor.Caption := cxGetResourceString(@sdxColor); + lblCardShadowDepth.Caption := cxGetResourceString(@sdxDepth); + + tshCharts.Caption := cxGetResourceString(@sdxCharts); + lblChartsOptions.Caption := cxGetResourceString(@sdxOptions); + AdjustBevelSize(bvlChartsOptions, lblChartsOptions); + + chbxChartsTransparent.Caption := cxGetResourceString(@sdxTransparent); +end; + +procedure TdxfmGridReportLinkDesignWindow.UpdateControlsState; +var + View: TcxCustomGridView; +begin + inherited; + + View := ReportLink.ActiveView; + if View <> nil then + with ReportLink.ProcessParams, dxViewHelpersFactory[View] do + begin + chbxShowBands.Enabled := IsAttributeSupported(TdxGridBandHeader); + chbxShowExpandButtons.Enabled := IsAttributeSupported(TdxGridExpandButton); + chbxShowFooters.Enabled := IsAttributeSupported(TdxGridFooter); + chbxShowGroupFooters.Enabled := IsAttributeSupported(TdxGridGroupFooter); + chbxShowHeaders.Enabled := IsAttributeSupported(TdxGridHeader); + + chbxCaptionsOnEveryPage.Enabled := IsAttributeSupported(TdxGridLevelCaption) and not ReportLink.IsAggregated; + chbxBandsOnEveryPage.Enabled := IsAttributeSupported(TdxGridBandHeader) and not ReportLink.IsAggregated; + chbxHeadersOnEveryPage.Enabled := IsAttributeSupported(TdxGridHeader) and not ReportLink.IsAggregated; + chbxFilterBarOnEveryPage.Enabled := IsAttributeSupported(TdxGridFilterBar) and not ReportLink.IsAggregated; + chbxFootersOnEveryPage.Enabled := IsAttributeSupported(TdxGridFooter) and not ReportLink.IsAggregated; + + chbxExpandGroupRows.Enabled := IsAttributeSupported(TdxGridGroupRow); + chbxExpandMasterRows.Enabled := IsAttributeSupported(TdxGridDetails); + + lblDetails.Visible := IsDesigning or HasMasterDetailsInTopView or HasUnwrapableData; + bvlDetails.Visible := IsDesigning or HasMasterDetailsInTopView or HasUnwrapableData; + imgDetails.Visible := IsDesigning or HasMasterDetailsInTopView or HasUnwrapableData; + chbxStartFromActiveView.Visible := IsDesigning or HasMasterDetailsInTopView or HasUnwrapableData; + chbxOnlyActiveView.Visible := IsDesigning or HasMasterDetailsInTopView or HasUnwrapableData; + chbxOnlyActiveView.Enabled := chbxStartFromActiveView.Checked; + + lblLevels.Visible := IsDesigning or HasUnwrapableData; + bvlLevels.Visible := IsDesigning or HasUnwrapableData; + imgLevels.Visible := IsDesigning or HasUnwrapableData; + chbxLevelsUnwrap.Visible := IsDesigning or HasUnwrapableData; + chbxLevelsUnwrapTopLevel.Visible := IsDesigning or HasUnwrapableData; + chbxLevelsRiseActiveLevelOntoTop.Visible := IsDesigning or HasUnwrapableData; + + chbxLevelsUnwrapTopLevel.Enabled := chbxLevelsUnwrap.Checked; + chbxLevelsRiseActiveLevelOntoTop.Enabled := chbxLevelsUnwrap.Checked; + + chbxPreviewVisible.Enabled := IsAttributeSupported(TdxGridPreview); + chbxPreviewAutoHeight.Enabled := IsAttributeSupported(TdxGridPreview); + sePreviewMaxLineCount.Enabled := IsAttributeSupported(TdxGridPreview); + + lblPagination.Visible := IsDesigning or IsAttributeSupported(TdxGridGroupRow); + bvlPagination.Visible := IsDesigning or IsAttributeSupported(TdxGridGroupRow); + imgPagination.Visible := IsDesigning or IsAttributeSupported(TdxGridGroupRow); + chbxPaginateByTopLevelGroups.Visible := IsDesigning or IsAttributeSupported(TdxGridGroupRow); + chbxPaginateOneGroupPerPage.Visible := IsDesigning or IsAttributeSupported(TdxGridGroupRow); + end; + + chbxProcessExactSelection.Enabled := chbxProcessSelection.Checked; + + chbxPaginateOneGroupPerPage.Enabled := chbxPaginateByTopLevelGroups.Checked; + + chbxCardsKeepSameWidth.Enabled := chbxCardsAutoWidth.Checked; + +{$IFDEF CHARTVIEW} + chbxChartsTransparent.Checked := ReportLink.OptionsCharts.Transparent; +{$ELSE} + tshCharts.TabVisible := False; // if chart not available +{$ENDIF} + + lbxStyles.Enabled := AreNativeStylesAvailable; + btnStyleColor.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + btnStyleFont.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + btnStyleBackgroundBitmap.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + btnStyleBackgroundBitmapClear.Enabled := AreNativeStylesAvailable and HasSelectedStylesWithAssignedBitmap; + btnStyleRestoreDefaults.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + btnStylesSaveAs.Enabled := CanSaveStyles; + + lblStyleSheets.Enabled := AreNativeStylesAvailable; + cbxStyleSheets.Enabled := AreNativeStylesAvailable; + btnStyleSheetNew.Enabled := CanCreateStyleSheet; + btnStyleSheetCopy.Enabled := CanCopyStyleSheet; + btnStyleSheetDelete.Enabled := CanDeleteStyleSheet; + btnStyleSheetRename.Enabled := CanRenameStyleSheet; + + UpdateWarningPane; +end; + +procedure TdxfmGridReportLinkDesignWindow.UpdatePreview; +const + DetailTabsPositionMap: array[Boolean] of TcxGridDetailTabsPosition = (dtpNone, dtpTop); + GroupFootersMap: array[Boolean] of TcxGridGroupFootersMode = (gfInvisible, gfAlwaysVisible); + FilteringMap: array[Boolean] of {$IFDEF DXVER500}TcxGridFilterVisible{$ELSE}TcxGridTableFilterVisible{$ENDIF} = + (fvNonEmpty, fvAlways); + TransparentsMap: array[Boolean] of TcxImageTransparency = (gtOpaque, gtTransparent); + + {$IFDEF DXVER500} + function GetFilterBarPosition: TcxGridFilterPosition; + var + View: TcxCustomGridView; + begin + View := ReportLink.ActiveView; + if View is TcxCustomGridTableView then + Result := CustomGridTableFiltering_GetPosition(TcxCustomGridTableView(View).Filtering) + else + Result := fpBottom; + end; + {$ENDIF} + + procedure UpdateBandedView; + begin + TcxImageProperties(colVendorLogo.Properties).GraphicTransparency := + TransparentsMap[ReportLink.OptionsRefinements.TransparentGraphics]; + with PreviewBandedView do + begin + {$IFDEF DXVER500} + Filtering.Position := GetFilterBarPosition; + {$ENDIF} + Filtering.Visible := FilteringMap[ReportLink.OptionsView.FilterBar]; + OptionsView.BandHeaders := ReportLink.OptionsView.BandHeaders; + OptionsView.Footer := ReportLink.OptionsView.Footers; + OptionsView.GroupFooters := GroupFootersMap[ReportLink.OptionsView.GroupFooters]; + OptionsView.Header := ReportLink.OptionsView.Headers; + Preview.Visible := ReportLink.OptionsPreview.Visible; + ViewChanged; + end; + end; + + procedure UpdateCardView; + begin + TcxImageProperties(rowVendorLogo.Properties).GraphicTransparency := + TransparentsMap[ReportLink.OptionsRefinements.TransparentGraphics]; + {$IFDEF DXVER500} + PreviewCardView.Filtering.Position := GetFilterBarPosition; + PreviewCardView.Filtering.Visible := FilteringMap[ReportLink.OptionsView.FilterBar]; + {$ENDIF} + PreviewCardView.ViewChanged; + end; + +begin + PreviewGrid.Enabled := False; + + PreviewGrid.LookAndFeel.Kind := ReportLink.OptionsFormatting.LookAndFeelKind; + PreviewGrid.LookAndFeel.NativeStyle := False; + PreviewGrid.Font := ReportLink.Font; + PreviewGrid.RootLevelOptions.DetailTabsPosition := DetailTabsPositionMap[ReportLink.OptionsView.Caption]; + + UpdateBandedView; + UpdateCardView; +end; + +function TdxfmGridReportLinkDesignWindow.GetDesignerTabIndex: Integer; +begin + Result := PageControl1.ActivePage.TabIndex; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetDesignerTabIndex(Value: Integer); +begin + if Value < 0 then Value := 0; + if Value > PageControl1.PageCount - 1 then + Value := PageControl1.PageCount - 1; + PageControl1.ActivePage := PageControl1.Pages[Value]; +end; + +procedure TdxfmGridReportLinkDesignWindow.DoActiveStyleSheetChanged; +begin + lbxStyles.ReportLinkStyles := ReportLink.ActiveStyles; + inherited; + with cbxStyleSheets do + ItemIndex := Items.IndexOfObject(ActiveStyleSheet); + + if not LockControlsUpdate then + begin + Modified := True; + UpdatePreview; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.DoFormActivated(AnActive: Boolean); +begin + inherited; + if not AnActive then lbxStyles.HideToolTips; +end; + +procedure TdxfmGridReportLinkDesignWindow.DoRefreshStylesList; +var + Styles: TdxGridReportLinkStyles; + List: TList; +begin + Styles := ReportLink.ActiveStyles; + + with lbxStyles.Items do + begin + BeginUpdate; + try + List := TList.Create; + try + SaveSelectedStyles(List); + try + Clear; + AddObject(cxGetResourceString(@sdxBandHeaderStyle), Styles.BandHeader); + AddObject(cxGetResourceString(@sdxCaptionStyle), Styles.Caption); + AddObject(cxGetResourceString(@sdxCardCaptionRowStyle), Styles.CardCaptionRow); + AddObject(cxGetResourceString(@sdxCardRowCaptionStyle), Styles.CardRowCaption); + AddObject(cxGetResourceString(@sdxContentStyle), Styles.Content); + AddObject(cxGetResourceString(@sdxContentEvenStyle), Styles.ContentEven); + AddObject(cxGetResourceString(@sdxContentOddStyle), Styles.ContentOdd); + AddObject(cxGetResourceString(@sdxFilterBarStyle), Styles.FilterBar); + AddObject(cxGetResourceString(@sdxFooterStyle), Styles.Footer); + AddObject(cxGetResourceString(@sdxGroupStyle), Styles.Group); + AddObject(cxGetResourceString(@sdxHeaderStyle), Styles.Header); + AddObject(cxGetResourceString(@sdxPreviewStyle), Styles.Preview); + AddObject(cxGetResourceString(@sdxSelectionStyle), Styles.Selection); + finally + RestoreSelectedStyles(List); + end; + finally + List.Free; + end; + finally + EndUpdate; + end; + end; + InitializePreviewGridStyles; +end; + +procedure TdxfmGridReportLinkDesignWindow.DoStyleChanged(const ACaption: string; + AStyle: TcxStyle); +begin + inherited; + Modified := True; + UpdatePreviewGridStyles(ACaption, AStyle); +end; + +procedure TdxfmGridReportLinkDesignWindow.DoStylesChanged(AStrings: TStrings; + ARecreate: Boolean); +begin + if ARecreate then + RecreateStylesListBox + else + lbxStyles.Invalidate; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.GetSelectedStyleNames(AStrings: TStrings); +var + I: Integer; +begin + AStrings.Clear; + with lbxStyles do + for I := 0 to Items.Count - 1 do + if Selected[I] then + AStrings.AddObject(Items[I], Items.Objects[I]); +end; + +procedure TdxfmGridReportLinkDesignWindow.GetStyleNames(out AStrings: TStrings); +begin + AStrings := lbxStyles.Items; +end; + +procedure TdxfmGridReportLinkDesignWindow.GetStyleSheetNames(out AStrings: TStrings); +begin + AStrings := cbxStyleSheets.Items; +end; + +function TdxfmGridReportLinkDesignWindow.GetActiveStyle: TcxStyle; +begin + with lbxStyles do + if ItemIndex <> -1 then + Result := TcxStyle(Items.Objects[ItemIndex]) + else + Result := nil; +end; + +function TdxfmGridReportLinkDesignWindow.GetHasSelectedStyles: Boolean; +begin + Result := lbxStyles.SelCount <> 0; +end; + +function TdxfmGridReportLinkDesignWindow.GetHasSelectedStylesWithAssignedBitmap: Boolean; +var + Strings: TStrings; + I: Integer; + cxStyle: TcxStyle; +begin + Result := True; + Strings := TStringList.Create; + try + GetSelectedStyleNames(Strings); + for I := 0 to Strings.Count - 1 do + begin + cxStyle := TcxStyle(Strings.Objects[I]); + if (cxStyle <> nil) and (cxStyle.Bitmap <> nil) and not cxStyle.Bitmap.Empty then + Exit; + end; + finally + Strings.Free; + end; + Result := False; +end; + +function TdxfmGridReportLinkDesignWindow.GetReportLink: TdxGridReportLink; +begin + Result := inherited ReportLink as TdxGridReportLink; +end; + +procedure TdxfmGridReportLinkDesignWindow.CardShadowColorChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + if TdxPSColorCombo(Sender).IsAutoColorSelected then + ReportLink.OptionsCards.Shadow.Color := clDefault + else + ReportLink.OptionsCards.Shadow.Color := TdxPSColorCombo(Sender).ColorValue; + TcxGridCardView2Styles(PreviewCardView.Styles).CardShadow.Color := ReportLink.OptionsCards.Shadow.ActualColor; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.CardShadowDepthChanged(Sender: TObject); +var + NewDepth: Integer; +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsCards.Shadow.Depth := TdxPSSpinEdit(Sender).AsInteger; + + NewDepth := TdxPSSpinEdit(Sender).AsInteger; + if NewDepth > 4 then NewDepth := 4; + TcxGridCardView2OptionsView(PreviewCardView.OptionsView).ShadowDepth := NewDepth; + + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.CardSpaceHorzChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsCards.InterCardsSpaceHorz := TdxPSSpinEdit(Sender).AsInteger; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.CardSpaceVertChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsCards.InterCardsSpaceVert := TdxPSSpinEdit(Sender).AsInteger; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.PreviewMaxLineCountChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsPreview.MaxLineCount := TdxPSSpinEdit(Sender).AsInteger; + Modified := True; +end; + +function TdxfmGridReportLinkDesignWindow.CanSelectAllStyles: Boolean; +var + I: Integer; +begin + Result := AreNativeStylesAvailable; + if Result then + begin + for I := 0 to lbxStyles.Items.Count - 1 do + if not lbxStyles.Selected[I] then Exit; + Result := False; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.ChangeActiveView(AView: TcxCustomGridView); +var + OldGridView: TcxCustomGridView; +begin + with PreviewGrid.Levels[0] do + begin + OldGridView := GridView; + GridView := AView; + if OldGridView <> GridView then + LoadDataIntoPreviewGridView(GridView as TcxCustomGridTableView); + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.CreateCardView; + + function CreateRow(APropertiesClass: TcxCustomEditPropertiesClass = nil; + AOnCustomDraw: TcxGridTableDataCellCustomDrawEvent = nil): TcxGridCardViewRow; + begin + Result := PreviewCardView.CreateRow; + Result.PropertiesClass := APropertiesClass; + Result.OnCustomDrawCell := AOnCustomDraw; + end; + +begin + PreviewCardView := PreviewGrid.CreateView(TcxGridCardView2) as TcxGridCardView2; + with PreviewCardView do + begin + LayoutDirection := ldVertical; + {$IFDEF DXVER500} + Filtering.CustomizeDialog := False; + {$ENDIF} + TcxGridCardView2Styles(Styles).CardShadow := styleCardShadow; + with TcxGridCardView2OptionsView(OptionsView) do + begin + CardWidth := 135; + CardBorderWidth := 1; + CellAutoHeight := True; + GridLineColor := ReportLink.OptionsFormatting.GridLineColor; + SeparatorWidth := 0; + ScrollBars := ssNone; + ShadowDepth := ReportLink.OptionsCards.Shadow.Depth; + end; + {$IFDEF DXVER500} + with OptionsCustomize do + begin + CardExpanding := False; + RowFiltering := False; + end; + {$ENDIF} + end; + + rowVendorName := CreateRow; + rowVendorLogo := CreateRow(TcxImageProperties, VendorLogoCustomDrawCell); + rowVendorCountry := CreateRow; + rowCarModel := CreateRow; + rowIsSuvModel := CreateRow(TcxCheckBoxProperties, IsSUVModelCustomDrawCell); +end; + +procedure TdxfmGridReportLinkDesignWindow.CreateControls; + + function CreateSpin(AHost: TControl; ALabel: TLabel; ATabOrder: TTabOrder; + AMinValue, AMaxValue, AValue: Integer): TdxPSSpinEdit; + begin + Result := TdxPSSpinEdit.Create(Self); + with Result do + begin + Parent := AHost.Parent; + BoundsRect := AHost.BoundsRect; + TabOrder := ATabOrder; + + MinValue := AMinValue; + MaxValue := AMaxValue; + Value := AValue; + DefaultValue := AValue; + end; + ALabel.FocusControl := Result; + end; + + function CreateColorCombo(AParent: TWinControl; AHost: TControl; ALabel: TLabel; + ATabOrder: TTabOrder; ATag: Integer; AAutoColor: TColor): TdxPSColorCombo; + begin + Result := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(Result) do + begin + BoundsRect := AHost.BoundsRect; + Tag := MakeTTag(ATag); + Parent := AParent; + TabOrder := ATabOrder; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := AAutoColor; + end; + ALabel.FocusControl := Result; + AHost.Visible := False; + end; + + procedure CreateWarningPane; + begin + wpIncorrectOnEveryPageState := TdxPSWarningPane.Create(Self); + wpIncorrectOnEveryPageState.Parent := tshView; + wpIncorrectOnEveryPageState.BoundsRect := bvlWarningHost.BoundsRect; + wpIncorrectOnEveryPageState.Font.Name := 'Tahoma'; + wpIncorrectOnEveryPageState.Font.Size := 8; + + bvlWarningHost.Visible := False; + end; + + procedure CreateStylesListBox; + begin + lbxStyles := TdxStylesListBox.Create(Self); + lbxStyles.Parent := tshStyles; + lbxStyles.BoundsRect := bvlStylesHost.BoundsRect; + lbxStyles.PopupMenu := pmStyles; + lbxStyles.TabOrder := chbxUseNativeStyles.TabOrder + 1; + lbxStyles.OnClick := lbxStylesClick; + bvlStylesHost.Visible := False; + + dxPSPopupMan.dxPSPopupMenuController.RegisterControl(lbxStyles); + end; + +begin + sePreviewMaxLineCount := CreateSpin(bvlPreviewMaxLineCountHost, lblPreviewMaxLineCount, + chbxPreviewAutoHeight.TabOrder + 1, 0, 1000, 0); + sePreviewMaxLineCount.OnChange := PreviewMaxLineCountChanged; + + seCardsSpaceHorz := CreateSpin(bvlCardSpaceHorzHost, lblCardSpaceHorz, + chbxCardsKeepSameHeight.TabOrder + 1, 0, 20, dxDefaultInterCardsSpaceHorz); + seCardsSpaceHorz.OnChange := CardSpaceHorzChanged; + + seCardsSpaceVert := CreateSpin(bvlCardSpaceVertHost, lblCardSpaceVert, + seCardsSpaceHorz.TabOrder + 1, 0, 20, dxDefaultInterCardsSpaceVert); + seCardsSpaceVert.OnChange := CardSpaceVertChanged; + + ccbxCardsShadowColor := CreateColorCombo(tshCards, bvlCardShadowColorHost, lblCardShadowColor, + chbxCardsVertLines.TabOrder + 1, 0, dxDefaultCardsShadowColor); + ccbxCardsShadowColor.OnChange := CardShadowColorChanged; + + seCardsShadowDepth := CreateSpin(bvlCardShadowDepthHost, lblCardShadowDepth, + ccbxCardsShadowColor.TabOrder + 1, Low(TdxGridCardShadowDepth), High(TdxGridCardShadowDepth), + dxDefaultCardsShadowDepth); + seCardsShadowDepth.OnChange := CardShadowDepthChanged; + + CreateStylesListBox; + CreateWarningPane; +end; + +procedure TdxfmGridReportLinkDesignWindow.CustomDrawBorders(ACanvas: TcxCanvas; + AViewInfo: TcxCustomGridCellViewInfo); +var + PainterClass: TcxCustomGridCellPainterClass; + Painter: TcxCustomGridCellPainter; +begin + PainterClass := CustomGridCellViewInfo_GetPainterClass(AViewInfo); + Painter := PainterClass.Create(ACanvas, AViewInfo); + try + CustomGridCellPainter_DrawBorders(Painter); + finally + Painter.Free; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.CustomDrawFooter(ACanvas: TcxCanvas; + R: TRect; AViewInfo: TcxCustomGridCellViewInfo); +begin + case ReportLink.OptionsFormatting.LookAndFeelKind of + lfStandard, + lfFlat: + ACanvas.DrawComplexFrame(R, AViewInfo.Params.TextColor, clBtnHighlight); + lfUltraFlat: + ACanvas.FrameRect(R, AViewInfo.Params.TextColor); + end; + + InflateRect(R, -1, -1); + CustomDrawTextRect(ACanvas, R, AViewInfo, AViewInfo.BackgroundBitmap); +end; + +procedure TdxfmGridReportLinkDesignWindow.CustomDrawHeader(ACanvas: TcxCanvas; + R: TRect; AViewInfo: TcxCustomGridCellViewInfo); +const + BottomRightColors: array[Boolean] of TColor = (clBtnFace, clBtnShadow); +begin + ACanvas.FrameRect(R, clWindowText); + + if ReportLink.OptionsFormatting.LookAndFeelKind <> lfUltraFlat then + begin + InflateRect(R, -1, -1); + ACanvas.DrawComplexFrame(R, clBtnHighlight, BottomRightColors[ReportLink.OptionsFormatting.LookAndFeelKind = lfStandard]); + end; + + InflateRect(R, -1, -1); + CustomDrawTextRect(ACanvas, R, AViewInfo, AViewInfo.BackgroundBitmap); +end; + +procedure TdxfmGridReportLinkDesignWindow.CustomDrawTextRect(ACanvas: TcxCanvas; + R: TRect; AViewInfo: TcxCustomGridCellViewInfo; ABackgroundBitmap: TBitmap); +const + AlignmentHorzMap: array[TAlignment] of Integer = (cxAlignLeft, cxAlignRight, cxAlignCenter); + AlignmentVertMap: array[TcxAlignmentVert] of Integer = (cxAlignTop, cxAlignBottom, cxAlignVCenter); +begin + with AViewInfo do + begin + if ABackgroundBitmap = nil then + begin + ACanvas.Brush.Color := Params.Color; + ACanvas.FillRect(R); + end + else + dxBkgnd.DrawPicture(ABackgroundBitmap, ACanvas.Canvas, R, ppmTile, 1, 1, - R.Left - 0, - R.Top - 0); + + InflateRect(R, -2, -1); + if ReportLink.OptionsFormatting.LookAndFeelKind = lfUltraFlat then + InflateRect(R, -1, -1); + if Params.Font <> nil then + ACanvas.Font := Params.Font; + ACanvas.Font.Color := Params.TextColor; + ACanvas.Brush.Style := bsClear; + ACanvas.DrawText(Text, R, AlignmentHorzMap[AlignmentHorz] or AlignmentVertMap[AlignmentVert] or cxSingleLine); + ACanvas.Brush.Style := bsSolid; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.InitializePreviewGrid; + + procedure SetupDataBindings(AView: TcxCustomGridTableView); + + function GetColumnCaption(Index: Integer): string; + begin + case Index of + 0: Result := cxGetResourceString(@sdxManufacturerNameColumnCaption); + 1: Result := cxGetResourceString(@sdxManufacturerLogoColumnCaption); + 2: Result := cxGetResourceString(@sdxManufacturerCountryColumnCaption); + 3: Result := cxGetResourceString(@sdxCarModelColumnCaption); + else + Result := cxGetResourceString(@sdxCarIsSUVColumnCaption); + end; + end; + + const + ColumnTypes: array[0..4] of TcxValueTypeClass = + (TcxStringValueType, TcxStringValueType, TcxStringValueType, + TcxStringValueType, TcxBooleanValueType); + var + I: Integer; + begin + for I := 0 to AView.ItemCount - 1 do + with AView.Items[I] do + begin + DataBinding.ValueTypeClass := ColumnTypes[I]; + Caption := GetColumnCaption(I); + end; + end; + +begin + if PageControl1.ActivePage = tshCards then + PreviewGrid.Levels[0].GridView := PreviewCardView + else + PreviewGrid.Levels[0].GridView := PreviewBandedView; + + SetupDataBindings(PreviewBandedView); + PreviewGridLevel.Caption := cxGetResourceString(@sdxCarLevelCaption); + + PreviewBandedView.Bands[0].Caption := cxGetResourceString(@sdxManufacturerBandCaption); + PreviewBandedView.Bands[1].Caption := cxGetResourceString(@sdxModelBandCaption); + PreviewBandedView.DataController.Summary.FooterSummaryItems[0].Format := cxGetResourceString(@sdxSummaryFormat); + + SetupDataBindings(PreviewCardView); +// PreviewCardView.Rows[3].Visible := False; +end; + +procedure TdxfmGridReportLinkDesignWindow.InitializePreviewGridStyles; + + procedure ResetEvents(AStyles: TcxGridBandedTableViewStyles); overload; + begin + with AStyles do + begin + OnGetBandHeaderStyle := nil; + OnGetContentStyle := nil; + OnGetFooterStyle := nil; + OnGetGroupStyle := nil; + OnGetHeaderStyle := nil; + OnGetPreviewStyle := nil; + end; + end; + + procedure ResetEvents(AStyles: TcxGridCardViewStyles); overload; + begin + with AStyles do + begin + OnGetCaptionRowStyle := nil; + OnGetCardBorderStyle := nil; + OnGetContentStyle := nil; + OnGetRowCaptionStyle := nil; + end; + end; + +var + Styles: TdxGridReportLinkStyles; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + begin + Styles := ReportLink.ActiveStyles; + + PreviewGrid.RootLevelStyles.Tab := Styles.Caption; + PreviewGrid.RootLevelStyles.TabsBackground := Styles.Caption; + + if PreviewBandedView <> nil then + begin + dxPScxCommon.dxPSResetStyles(PreviewBandedView.Styles); + with PreviewBandedView.Styles do + begin + BandHeader := Styles.BandHeader; + Content := Styles.Content; + ContentEven := Styles.ContentEven; + ContentOdd := Styles.ContentOdd; + FilterBox := Styles.FilterBar; + Footer := Styles.Footer; + Group := Styles.Group; + Header := Styles.Header; + Preview := Styles.Preview; + end; + end; + + if PreviewCardView <> nil then + begin + dxPScxCommon.dxPSResetStyles(PreviewCardView.Styles); + with PreviewCardView.Styles do + begin + CaptionRow := Styles.CardCaptionRow; + CardBorder := StyleCardBorder; + Content := Styles.Content; + ContentEven := Styles.ContentEven; + ContentOdd := Styles.ContentOdd; + RowCaption := Styles.CardRowCaption; + end; + end; + + end + else + begin + if ReportLink.Grid <> nil then + begin + PreviewGrid.RootLevelStyles.Tab := ReportLink.Grid.RootLevelStyles.Tab; + PreviewGrid.RootLevelStyles.TabsBackground := ReportLink.Grid.RootLevelStyles.TabsBackground; + end + else + dxPScxCommon.dxPSResetStyles(PreviewGrid.RootLevelStyles); + + if PreviewBandedView <> nil then + if ReportLink.ActiveView is TcxGridBandedTableView then + PreviewBandedView.Styles := TcxGridBandedTableView(ReportLink.ActiveView).Styles + else + dxPScxCommon.dxPSResetStyles(PreviewBandedView.Styles); + + if PreviewCardView <> nil then + if ReportLink.ActiveView is TcxGridCardView then + PreviewCardView.Styles := TcxGridCardView(ReportLink.ActiveView).Styles + else + dxPScxCommon.dxPSResetStyles(PreviewCardView.Styles); + end; + + PreviewGrid.RootLevelStyles.OnGetTabStyle := nil; + if PreviewBandedView <> nil then + begin + ResetEvents(PreviewBandedView.Styles); + PreviewBandedView.SizeChanged; + end; + if PreviewCardView <> nil then + begin + ResetEvents(PreviewCardView.Styles); + PreviewCardView.SizeChanged; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.LoadDataIntoPreviewGridView(AView: TcxCustomGridTableView); + + procedure AddRecord(ARecordIndex: Integer; const AValues: array of string); + var + I: Integer; + begin + with AView.DataController do + for I := 0 to ItemCount - 1 do + Values[ARecordIndex, I] := AValues[I]; + end; + + function CarVendorName(Index: Integer): string; + begin + case Index of + 0: Result := cxGetResourceString(@sdxCarManufacturerName1); + 1: Result := cxGetResourceString(@sdxCarManufacturerName2); + 2: Result := cxGetResourceString(@sdxCarManufacturerName3); + else + Result := cxGetResourceString(@sdxCarManufacturerName4); + end; + end; + + function CarVendorCountry(Index: Integer): string; + begin + case Index of + 0: Result := cxGetResourceString(@sdxCarManufacturerCountry1); + 1: Result := cxGetResourceString(@sdxCarManufacturerCountry2); + 2: Result := cxGetResourceString(@sdxCarManufacturerCountry3); + else + Result := cxGetResourceString(@sdxCarManufacturerCountry4); + end; + end; + + function CarModel(Index: Integer): string; + begin + case Index of + 0: Result := cxGetResourceString(@sdxCarModel1); + 1: Result := cxGetResourceString(@sdxCarModel2); + 2: Result := cxGetResourceString(@sdxCarModel3); + else + Result := cxGetResourceString(@sdxCarModel4); + end; + end; + +const + RecordCount = 4; + //CarSalesCount: array[0..RecordCount - 1] of Integer = (10, 6, 3, 5); + IsCarSUV: array[0..RecordCount - 1] of string = ('True', 'True', 'False', 'True'); +var + I: Integer; +begin + AView.DataController.RecordCount := RecordCount; + for I := 0 to RecordCount - 1 do + AddRecord(I, [CarVendorName(I), dxPScxCommon.dxPSPreviewCarLogosAsString(I), + CarVendorCountry(I), CarModel(I), IsCarSUV[I]]);//, CarSalesCount[I]]); +end; + +procedure TdxfmGridReportLinkDesignWindow.RecreateStylesListBox; +var + List: TList; +begin + List := TList.Create; + try + SaveSelectedStyles(List); + dxPSUtl.dxRecreateWnd(lbxStyles); + RestoreSelectedStyles(List); + finally + List.Free; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.RestoreSelectedStyles(AList: TList); +var + I: Integer; +begin + for I := 0 to AList.Count - 1 do + lbxStyles.Selected[Integer(AList[I])] := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SaveSelectedStyles(AList: TList); +var + I: Integer; +begin + AList.Clear; + for I := 0 to lbxStyles.Items.Count - 1 do + if lbxStyles.Selected[I] then AList.Add(TObject(I)); +end; + +procedure TdxfmGridReportLinkDesignWindow.SetActivePage; +begin + PageControl1.ActivePage := PageControl1.Pages[DesignerTabIndex]; +end; + +procedure TdxfmGridReportLinkDesignWindow.UpdatePreviewGridStyles(const ACaption: string; + AStyle: TcxStyle); +begin + with PreviewGrid.RootLevelStyles do + if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxCaptionStyle)) then + begin + Tab := AStyle; + TabsBackground := AStyle; + end; + + with PreviewBandedView.Styles do + begin + if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxBandHeaderStyle)) then + BandHeader := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentStyle)) then + Content := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentEvenStyle)) then + ContentEven := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentOddStyle)) then + ContentOdd := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxFooterStyle)) then + Footer := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxGroupStyle)) then + Group := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxHeaderStyle)) then + Header := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxPreviewStyle)) then + Preview := AStyle; + end; + + with PreviewCardView.Styles do + begin + if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxCardCaptionRowStyle)) then + CaptionRow := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxCardRowCaptionStyle)) then + RowCaption := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentStyle)) then + Content := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentEvenStyle)) then + ContentEven := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentOddStyle)) then + ContentOdd := AStyle + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.UpdateWarningPane; +begin + with ReportLink.HostInfoServices do + wpIncorrectOnEveryPageState.SetStateAndHint(IsInconsistentState, InconsistentStateText); +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsCardsByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsCards do + case Index of + 0: AutoWidth := Value; + 1: KeepSameWidth := Value; + 2: KeepSameHeight := Value; + 3: Borders := Value; + 4: RowBordersHorz := Value; + 5: RowBordersVert := Value; + end; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsChartsByIndex(Index: Integer; + Value: Boolean); +begin +{$IFDEF CHARTVIEW} + if LockControlsUpdate then Exit; + + with ReportLink.OptionsCharts do + case Index of + 0: Transparent := Value; + end; + Modified := True; +{$ENDIF} +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsDetailsByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsDetails do + case Index of + 0: StartFromFocusedView := Value; + 1: OnlyFocusedView := Value; + end; + ReportLink.CalculateProcessParams; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsExpandingByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsExpanding do + case Index of + 0: ExpandGroupRows := Value; + 1: ExpandMasterRows := Value; + {$IFDEF DXVER500} + 2: ExpandCards := Value; + {$ENDIF} + end; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsFormattingByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsFormatting do + case Index of + 0: + begin + UseNativeStyles := Value; + InitializePreviewGridStyles; + RecreateStylesListBox; + end; + 1: SuppressBackgroundBitmaps := Value; + 2: ConsumeSelectionStyle := Value; + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsLevelsByIndex(Index: Integer; Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsLevels do + case Index of + 0: Unwrap := Value; + 1: UnwrapTopLevel := Value; + 2: RiseActiveLevelOntoTop := Value; + end; + ReportLink.CalculateProcessParams; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsOnEveryPageByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsOnEveryPage do + case Index of + 0: Caption := Value; + 1: BandHeaders := Value; + 2: Headers := Value; + 3: Footers := Value; + 4: FilterBar := Value; + end; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsPaginationByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsPagination do + case Index of + 0: TopLevelGroup := Value; + 1: OneGroupPerPage := Value; + end; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsRefinementsByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsRefinements do + case Index of + 0: TransparentGraphics := Value; + 1: DisplayGraphicsAsText := Value; + 2: FlatCheckMarks := Value; + {$IFDEF DXVER500} + 3: TransparentRichEdits := Value; + {$ENDIF} + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsSelectionByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsSelection do + case Index of + 0: ProcessSelection := Value; + 1: ProcessExactSelection := Value; + end; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsSizeByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsSize do + case Index of + 0: AutoWidth := Value; + end; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.SetOptionsViewByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsView do + case Index of + 0: Caption := Value; + 1: BandHeaders := Value; + 2: Headers := Value; + 3: Footers := Value; + 4: GroupFooters := Value; + 5: ExpandButtons := Value; + 6: FilterBar := Value; + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsViewClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsViewByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsOnEveryPageClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsOnEveryPageByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsSelectionClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsSelectionByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsExpandingClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsExpandingByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsRefinementClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsRefinementsByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsFormatingClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsFormattingByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.lblUseNativeStylesClick(Sender: TObject); +begin + if chbxUseNativeStyles.CanFocus then ActiveControl := chbxUseNativeStyles; + chbxUseNativeStyles.Checked := not chbxUseNativeStyles.Checked; +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsPaginationClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsPaginationByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsSizeClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsSizeByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsDetailsClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsDetailsByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsLevelsClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsLevelsByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.LookAndFeelClick(Sender: TObject); +begin + with TComboBox(Sender) do + ReportLink.OptionsFormatting.LookAndFeelKind := TcxLookAndFeelKind(Items.Objects[ItemIndex]); + Modified := True; + UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.PageControl1Change(Sender: TObject); +begin + lblPreviewWindow.Parent := TPageControl(Sender).ActivePage; + if not ReportLink.ProcessParams.HasOnlyCards then + if PageControl1.ActivePage = tshCards then + ChangeActiveView(PreviewCardView) + else + if PageControl1.ActivePage = tshStyles then + if ReportLink.IsCardViewStyle(ActiveStyle) then + ChangeActiveView(PreviewCardView) + else + ChangeActiveView(PreviewBandedView) + else + ChangeActiveView(PreviewBandedView); +end; + +procedure TdxfmGridReportLinkDesignWindow.PreviewVisibleClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsPreview.Visible := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.PreviewAutoHeightClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsPreview.AutoHeight := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.OptionsCardsClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsCardsByIndex(TTagToInt(Tag), Checked); + with TcxGridCardView2OptionsView(PreviewCardView.OptionsView), ReportLink.OptionsCards do + begin + CardBorders := Borders; + GridLines := dxPScxCommon.dxPSMakecxGridLines(RowBordersHorz, RowBordersVert); + end; + //UpdatePreview; +end; + +procedure TdxfmGridReportLinkDesignWindow.chbxChartsTransparentClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsChartsByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmGridReportLinkDesignWindow.pmStylesPopup(Sender: TObject); +begin + lbxStyles.HideToolTips; + miStyleColor.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + miStyleFont.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + miStyleBackgroundBitmap.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + miStyleBackgroundBitmapClear.Enabled := AreNativeStylesAvailable and HasSelectedStylesWithAssignedBitmap; + miStyleRestoreDefaults.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + miStylesSelectAll.Enabled := CanSelectAllStyles; + miStylesSaveAs.Enabled := CanSaveStyles; +end; + +procedure TdxfmGridReportLinkDesignWindow.lbxStylesClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + if not ReportLink.ProcessParams.HasOnlyCards then + if ReportLink.IsCardViewStyle(ActiveStyle) then + ChangeActiveView(PreviewCardView) + else + ChangeActiveView(PreviewBandedView); + UpdateControlsState; +end; + +procedure TdxfmGridReportLinkDesignWindow.IsSUVModelCustomDrawCell( + Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); + + procedure DrawBackground(const R: TRect); + + function GetParams: TcxViewParams; + begin + if AViewInfo is TcxGridCardRowDataViewInfo then + PreviewCardView.Styles.GetContentParams(AViewInfo.GridRecord, AViewInfo.Item, Result) + else + PreviewBandedView.Styles.GetContentParams(AViewInfo.GridRecord, AViewInfo.Item, Result); + end; + + var + BackgroundBitmap: TBitmap; + PrevColor: TColor; + begin + BackgroundBitmap := CustomGridView_GetBackgroundBitmaps(AViewInfo.GridRecord.GridView).GetBitmap(bbContent); + if BackgroundBitmap = nil then + begin + PrevColor := ACanvas.Brush.Color; + ACanvas.Brush.Color := GetParams.Color; + ACanvas.FillRect(R); + ACanvas.Brush.Color := PrevColor; + end + else + dxBkgnd.DrawPicture(BackgroundBitmap, ACanvas.Canvas, R, ppmTile, 1, 1, -R.Left, -R.Top); + end; + + procedure DrawCheck(R: TRect); + const + Painters: array[Boolean] of TcxCustomLookAndFeelPainterClass = + (TcxStandardLookAndFeelPainter, TcxUltraFlatLookAndFeelPainter); + CheckStateMap: array[Boolean] of TcxCheckBoxState = (cbsChecked, cbsUnchecked); + var + X, Y: Integer; + CheckState: Variant; + begin + with R do + begin + X := Left + (Right - Left - dxPSGlbl.CheckWidth) div 2; + Y := Top + (Bottom - Top - dxPSGlbl.CheckHeight) div 2; + end; + R := MakeBounds(X, Y, dxPSGlbl.CheckWidth, dxPSGlbl.CheckHeight); + + CheckState := Variant(CheckStateMap[AViewInfo.RecordViewInfo.GridRecord.RecordIndex = 2]); + with Painters[ReportLink.OptionsRefinements.FlatCheckMarks] do + DrawCheckButton(ACanvas, R, cxbsDefault, CheckState = Variant(cbsChecked)); + end; + +var + R: TRect; +begin + if (Sender is TcxGridTableView) or (AViewInfo is TcxGridCardRowDataViewInfo) then + begin + R := AViewInfo.Bounds; + DrawBackground(R); + DrawCheck(R); + + CustomDrawBorders(ACanvas, AViewInfo); + ADone := True; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.VendorLogoCustomDrawCell( + Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); +var + PrevText: string; +begin + if ReportLink.OptionsRefinements.DisplayGraphicsAsText and + ((Sender is TcxGridTableView) or (AViewInfo is TcxGridCardRowDataViewInfo)) then + begin + PrevText := AViewInfo.Text; + AViewInfo.Text := ReportLink.OptionsRefinements.GraphicsText; + AViewInfo.AlignmentVert := vaTop; + //AViewInfo.Transparent := True; + CustomDrawTextRect(ACanvas, AViewInfo.Bounds, AViewInfo, AViewInfo.RecordViewInfo.BackgroundBitmap); + AViewInfo.Text := PrevText; + CustomDrawBorders(ACanvas, AViewInfo); + ADone := True; + end; +end; + +procedure TdxfmGridReportLinkDesignWindow.PreviewBandedViewCustomDrawColumnHeader( + Sender: TcxGridTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean); +var + R: TRect; +begin + R := AViewInfo.Bounds; + Dec(R.Left); + if not ((PreviewGrid.LookAndFeel.Kind = lfUltraFlat) and + not TcxGridBandedTableOptionsView(Sender.OptionsView).BandHeaders) then + Dec(R.Top); + CustomDrawHeader(ACanvas, R, AViewInfo); + + ADone := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.PreviewBandedViewCustomDrawBandHeader( + Sender: TcxGridBandedTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridBandHeaderViewInfo; var ADone: Boolean); +var + R: TRect; +begin + R := AViewInfo.Bounds; + Dec(R.Left); + CustomDrawHeader(ACanvas, R, AViewInfo); + + ADone := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.PreviewBandedViewCustomDrawFooterCell( + Sender: TcxGridTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean); +begin + CustomDrawFooter(ACanvas, AViewInfo.Bounds, AViewInfo); + ADone := True; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleColorClick(Sender: TObject); +begin + PerformStylesChangeColor; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleFontClick(Sender: TObject); +begin + PerformStylesChangeFont; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleBackgroundBitmapClick(Sender: TObject); +begin + PerformStylesChangeBitmap; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleBackgroundBitmapClearClick(Sender: TObject); +begin + PerformStylesClearBitmap; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleRestoreDefaultsClick(Sender: TObject); +begin + PerformStylesRestoreDefaults; +end; + +procedure TdxfmGridReportLinkDesignWindow.miStylesSelectAllClick(Sender: TObject); +{$IFNDEF DELPHI6} +var + I: Integer; +{$ENDIF} +begin + with lbxStyles do + begin + {$IFDEF DELPHI6} + SelectAll; + {$ELSE} + Items.BeginUpdate; + try + for I := 0 to Items.Count - 1 do + Selected[I] := True; + finally + Items.EndUpdate; + end; + {$ENDIF} + end; + UpdateControlsState; +end; + +procedure TdxfmGridReportLinkDesignWindow.cbxStyleSheetsClick(Sender: TObject); +begin + with TComboBox(Sender) do + ActiveStyleSheet := TcxCustomStyleSheet(Items.Objects[ItemIndex]); +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleSheetNewClick(Sender: TObject); +begin + PerformStyleSheetNew; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleSheetCopyClick(Sender: TObject); +begin + PerformStyleSheetCopy; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleSheetDeleteClick(Sender: TObject); +begin + PerformStyleSheetDelete; +end; + +procedure TdxfmGridReportLinkDesignWindow.StyleSheetRenameClick(Sender: TObject); +begin + PerformStyleSheetRename; +end; + +procedure TdxfmGridReportLinkDesignWindow.StylesSaveAsClick(Sender: TObject); +begin + PerformStylesSaveAsStyleSheet; +end; + +procedure TdxfmGridReportLinkDesignWindow.cbxStyleSheetsKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + PerformStyleSheetKeyDown(Sender, Key, Shift); +end; + +procedure TdxfmGridReportLinkDesignWindow.cbxStyleSheetsDrawItem( + Control: TWinControl; Index: Integer; Rect: TRect; + State: TOwnerDrawState); +begin + PerformStyleSheetDrawItem(TComboBox(Control).Canvas, Index, Rect, State, Control.Enabled); +end; + +procedure RegisterAssistants; +begin + TdxCustomGridViewBuilder.Register; + TdxCustomGridTableViewBuilder.Register; + TdxGridTableViewBuilder.Register; + TdxGridDBTableViewBuilder.Register; + TdxGridBandedTableViewBuilder.Register; + TdxGridDBBandedTableViewBuilder.Register; + TdxGridCardViewBuilder.Register; + TdxGridDBCardViewBuilder.Register; +{$IFDEF CHARTVIEW} + TdxGridChartViewBuilder.Register; +{$ENDIF} + + TdxCustomGridViewHelper.Register; + TdxCustomGridTableViewHelper.Register; + TdxGridCardViewHelper.Register; + TdxGridTableViewHelper.Register; + TdxGridBandedTableViewHelper.Register; + + TdxCustomGridRecordHelper.Register; + TdxCustomGridRowHelper.Register; + TdxGridDataRowHelper.Register; + TdxGridGroupRowHelper.Register; + TdxGridMasterDataRowHelper.Register; + + TdxGridReportLinkStyleSheet.Register; +end; + +procedure RegisterItems; +begin + TdxReportCard.Register; + TdxReportCardRow.Register; +end; + +procedure UnregisterAssistants; +begin + TdxGridReportLinkStyleSheet.Unregister; + + TdxGridViewBuildersFactory.ReleaseInstance; + TdxViewHelpersFactory.ReleaseInstance; + TdxRecordHelpersFactory.ReleaseInstance; +end; + +procedure UnregisterItems; +begin + TdxReportCardRow.Unregister; + TdxReportCard.Unregister; +end; + +initialization + RegisterAssistants; + RegisterItems; + + dxPSRegisterReportLink(TdxGridReportLink, TcxGrid, TdxfmGridReportLinkDesignWindow); + +finalization + dxPSUnregisterReportLink(TdxGridReportLink, TcxGrid, TdxfmGridReportLinkDesignWindow); + + UnregisterItems; + UnregisterAssistants; + + FreeAndNil(FGridLinkStyleSheetPrototype); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxGridLnkPredefinedStyleSheets.dfm b/official/x.35/ExpressPrinting System/Sources/dxPScxGridLnkPredefinedStyleSheets.dfm new file mode 100644 index 00000000..83221cdb --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxGridLnkPredefinedStyleSheets.dfm @@ -0,0 +1,351 @@ +object dxdmPScxGridLnkPredefinedStyles: TdxdmPScxGridLnkPredefinedStyles + OldCreateOrder = False + Left = 352 + Top = 156 + Height = 150 + Width = 215 + object StyleRepository: TcxStyleRepository + Left = 37 + Top = 12 + object styleProfessionalFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3355443 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = 13033414 + end + object styleProfessionalGroup: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4214088 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 13033414 + end + object styleProfessionalRowCaption: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6582120 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object styleProfessionalCaptionRow: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = 13033414 + end + object styleProfessionalContentOdd: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleProfessionalContentEven: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4214088 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 13033414 + end + object styleProfessionalPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14541789 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleProfessionalSelection: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object styleGreenFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9358956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleGreenFooter: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9358956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenLightContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12778719 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenLightPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14154698 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenSelected: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4949549 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenGroup: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11328403 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleNoneContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleNoneFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentBandHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentFooter: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentGroup: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsItalic] + TextColor = clBlack + end + object styleTransparentLevelCaption: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentFilterBar: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentCaptionRow: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentRowCaption: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContentEven: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContentOdd: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentSelection: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13816275 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object ssProfessional: TdxGridReportLinkStyleSheet + Caption = 'Professional' + Styles.BandHeader = styleProfessionalFixed + Styles.Caption = styleProfessionalFixed + Styles.CardCaptionRow = styleProfessionalCaptionRow + Styles.CardRowCaption = styleProfessionalRowCaption + Styles.Content = styleNoneContent + Styles.ContentEven = styleProfessionalContentEven + Styles.ContentOdd = styleProfessionalContentOdd + Styles.FilterBar = styleProfessionalFixed + Styles.Footer = styleProfessionalFixed + Styles.Group = styleProfessionalGroup + Styles.Header = styleProfessionalFixed + Styles.Preview = styleProfessionalPreview + Styles.Selection = styleProfessionalSelection + BuiltIn = True + end + object ssGreen: TdxGridReportLinkStyleSheet + Caption = 'Green' + Styles.BandHeader = styleGreenFixed + Styles.Caption = styleGreenFixed + Styles.CardCaptionRow = styleGreenFixed + Styles.CardRowCaption = styleGreenFixed + Styles.Content = styleNoneContent + Styles.ContentEven = styleGreenLightContent + Styles.ContentOdd = styleNoneContent + Styles.FilterBar = styleGreenFixed + Styles.Footer = styleGreenFixed + Styles.Group = styleGreenGroup + Styles.Header = styleGreenFixed + Styles.Preview = styleGreenLightPreview + Styles.Selection = styleGreenSelected + BuiltIn = True + end + object ssTransparent: TdxGridReportLinkStyleSheet + Caption = 'Transparent' + Styles.BandHeader = styleTransparentBandHeader + Styles.Caption = styleTransparentLevelCaption + Styles.CardCaptionRow = styleTransparentCaptionRow + Styles.CardRowCaption = styleTransparentRowCaption + Styles.Content = styleTransparentContent + Styles.ContentEven = styleTransparentContentEven + Styles.ContentOdd = styleTransparentContentOdd + Styles.FilterBar = styleTransparentFilterBar + Styles.Footer = styleTransparentFooter + Styles.Group = styleTransparentGroup + Styles.Header = styleTransparentHeader + Styles.Preview = styleTransparentPreview + Styles.Selection = styleTransparentSelection + BuiltIn = True + end + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxGridLnkPredefinedStyleSheets.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxGridLnkPredefinedStyleSheets.pas new file mode 100644 index 00000000..7b7536f7 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxGridLnkPredefinedStyleSheets.pas @@ -0,0 +1,143 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxGridLnkPredefinedStyleSheets; + +interface + +{$I cxVer.inc} + +uses + Classes, {$IFNDEF DELPHI6} Forms, {$ENDIF} cxClasses, cxStyles, dxPScxGridLnk, + dxPScxCommon; + +type + TdxdmPScxGridLnkPredefinedStyles = class(TDataModule) + StyleRepository: TcxStyleRepository; + styleGreenFixed: TcxStyle; + styleGreenLightContent: TcxStyle; + styleProfessionalFixed: TcxStyle; + styleGreenLightPreview: TcxStyle; + ssGreen: TdxGridReportLinkStyleSheet; + ssProfessional: TdxGridReportLinkStyleSheet; + styleGreenFooter: TcxStyle; + styleNoneContent: TcxStyle; + styleNoneFixed: TcxStyle; + styleProfessionalGroup: TcxStyle; + styleProfessionalContentOdd: TcxStyle; + styleProfessionalContentEven: TcxStyle; + styleProfessionalSelection: TcxStyle; + styleProfessionalPreview: TcxStyle; + styleGreenSelected: TcxStyle; + styleGreenGroup: TcxStyle; + styleProfessionalRowCaption: TcxStyle; + styleProfessionalCaptionRow: TcxStyle; + ssTransparent: TdxGridReportLinkStyleSheet; + styleTransparentContent: TcxStyle; + styleTransparentBandHeader: TcxStyle; + styleTransparentHeader: TcxStyle; + styleTransparentFooter: TcxStyle; + styleTransparentGroup: TcxStyle; + styleTransparentPreview: TcxStyle; + styleTransparentLevelCaption: TcxStyle; + styleTransparentFilterBar: TcxStyle; + styleTransparentCaptionRow: TcxStyle; + styleTransparentRowCaption: TcxStyle; + styleTransparentContentEven: TcxStyle; + styleTransparentContentOdd: TcxStyle; + styleTransparentSelection: TcxStyle; + end; + +implementation + +{$R *.dfm} + +uses + cxStyleSheetsLoad; + +type + TdxPScxGridLnkPredefinedStyleSheets = class(TcxPredefinedStyleSheets) + private + FDataModule: TdxdmPScxGridLnkPredefinedStyles; + protected + procedure AddStyleSheets; override; + property DataModule: TdxdmPScxGridLnkPredefinedStyles read FDataModule; + public + constructor Create; override; + destructor Destroy; override; + + class procedure Register; + class procedure Unregister; + end; + +constructor TdxPScxGridLnkPredefinedStyleSheets.Create; +begin + inherited; + FDataModule := TdxdmPScxGridLnkPredefinedStyles.Create(nil); + AddStyleSheets; +end; + +destructor TdxPScxGridLnkPredefinedStyleSheets.Destroy; +begin + FDataModule.Free; + inherited; +end; + +class procedure TdxPScxGridLnkPredefinedStyleSheets.Register; +begin + cxStyleSheetsLoad.RegisterPredefinedStyleSheets(Self); +end; + +class procedure TdxPScxGridLnkPredefinedStyleSheets.Unregister; +begin + cxStyleSheetsLoad.UnregisterPredefinedStyleSheets(Self); +end; + +procedure TdxPScxGridLnkPredefinedStyleSheets.AddStyleSheets; +var + I: Integer; +begin + with DataModule.StyleRepository do + for I := 0 to StyleSheetCount - 1 do + AddStyleSheet(StyleSheets[I]); +end; + +initialization + TdxPScxGridLnkPredefinedStyleSheets.Register; + +finalization + TdxPScxGridLnkPredefinedStyleSheets.Unregister; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxGridLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxGridLnkReg.pas new file mode 100644 index 00000000..fa3634a6 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxGridLnkReg.pas @@ -0,0 +1,376 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxGridLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignEditors, + {$ELSE} + DsgnIntf, + {$ENDIF} + SysUtils, Classes, Controls, cxCustomData, cxDataStorage, cxStyles, cxGrid, + cxGridLevel, cxGridCustomView, cxGridCustomTableView, cxGridCardView, + cxGridTableView, cxGridBandedTableView, cxStyleSheetEditor, dxPScxGridLnk; + +type + TdxGridReportLinkStyleSheetEditorPreview = class(TcxStyleSheetEditorPreview) + private + FGrid: TcxGrid; + function GetBandedTableView: TcxGridBandedTableView; + function GetCardView: TcxGridCardView; + protected + function AddItem(AView: TcxCustomGridTableView; const ACaption: string; + AValueTypeClass: TcxValueTypeClass): TcxCustomGridTableItem; + procedure AddItems(AView: TcxCustomGridTableView); + procedure CreateBandedTableView; + procedure CreateCardView; + procedure Initialize; virtual; + + property BandedTableView: TcxGridBandedTableView read GetBandedTableView; + property CardView: TcxGridCardView read GetCardView; + property Grid: TcxGrid read FGrid; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + class function GetStyleSheetClass: TcxCustomStyleSheetClass; override; + procedure SetStyleSheet(AStyleSheet: TcxCustomStyleSheet); override; + + function Control: TWinControl; override; + + class procedure Register; + class procedure Unregister; + end; + +{ TdxGridReportLinkStyleSheetEditorPreview } + +constructor TdxGridReportLinkStyleSheetEditorPreview.Create(AOwner: TComponent); +begin +// inherited; cannot call ancestor method if it's an abstract method in Delphi4(5) !!!! + FGrid := TcxGrid.Create(AOwner); + Initialize; +end; + +destructor TdxGridReportLinkStyleSheetEditorPreview.Destroy; +begin + FGrid.Free; + inherited; +end; + +class function TdxGridReportLinkStyleSheetEditorPreview.GetStyleSheetClass: TcxCustomStyleSheetClass; +begin + Result := TdxGridReportLinkStyleSheet; +end; + +procedure TdxGridReportLinkStyleSheetEditorPreview.SetStyleSheet(AStyleSheet: TcxCustomStyleSheet); +begin + if AStyleSheet is TdxGridReportLinkStyleSheet then + with TdxGridReportLinkStyleSheet(AStyleSheet).Styles do + begin + BandedTableView.Styles.BandHeader := BandHeader; + BandedTableView.Styles.Content := Content; + BandedTableView.Styles.ContentEven := ContentEven; + BandedTableView.Styles.ContentOdd := ContentOdd; + BandedTableView.Styles.FilterBox := FilterBar; + BandedTableView.Styles.Footer := Footer; + BandedTableView.Styles.Group := Group; + BandedTableView.Styles.Header := Header; + BandedTableView.Styles.Indicator := Header; + BandedTableView.Styles.Preview := Preview; + + CardView.Styles.CaptionRow := CardCaptionRow; + CardView.Styles.Content := Content; + CardView.Styles.ContentEven := ContentEven; + CardView.Styles.ContentOdd := ContentOdd; + CardView.Styles.RowCaption := CardRowCaption; + + Grid.RootLevelStyles.Tab := Caption; + Grid.RootLevelStyles.TabsBackground := Caption; + end + else + begin + BandedTableView.Styles.ResetStyles; + CardView.Styles.ResetStyles; + Grid.RootLevelStyles.ResetStyles; + end; +end; + +function TdxGridReportLinkStyleSheetEditorPreview.Control: TWinControl; +begin + Result := Grid; +end; + +class procedure TdxGridReportLinkStyleSheetEditorPreview.Register; +begin + cxStyleSheetEditor.RegisterStyleSheetEditorPreview(Self); +end; + +class procedure TdxGridReportLinkStyleSheetEditorPreview.Unregister; +begin + cxStyleSheetEditor.UnregisterStyleSheetEditorPreview(Self); +end; + +function TdxGridReportLinkStyleSheetEditorPreview.AddItem(AView: TcxCustomGridTableView; + const ACaption: string; AValueTypeClass: TcxValueTypeClass): TcxCustomGridTableItem; +begin + Result := AView.CreateItem; + with Result do + begin + Caption := ACaption; + DataBinding.ValueTypeClass := AValueTypeClass; + end; +end; + +procedure TdxGridReportLinkStyleSheetEditorPreview.AddItems(AView: TcxCustomGridTableView); +begin + AddItem(AView, 'Text', TcxStringValueType); + AddItem(AView, 'Currency', TcxCurrencyValueType); + AddItem(AView, 'Date', TcxDateTimeValueType); +end; + +procedure TdxGridReportLinkStyleSheetEditorPreview.CreateBandedTableView; + + procedure AddBands; + begin + BandedTableView.Bands.Add.Caption := 'Band'; + end; + + procedure AddGroups; + begin + BandedTableView.Columns[2].GroupIndex := 0; + end; + + procedure AddPreview; + begin + with BandedTableView.Preview do + begin + Column := AddItem(BandedTableView, '', TcxStringValueType) as TcxGridColumn; + Column.Visible := False; + Visible := True; + end; + end; + + procedure AddRecords; + const + ARecordCount: Integer = 3; + var + I: Integer; + begin + with BandedTableView.DataController as TcxGridDataController do + begin + BeginUpdate; + try + RecordCount := ARecordCount; + for I := 0 to ARecordCount - 1 do + begin + Values[I, 0] := 'ABC'; + Values[I, 1] := (I + 1) * 100; + Values[I, 2] := Date - I; + Values[I, 3] := 'Check the preview style'; + end; + finally + EndUpdate; + end; + end; + end; + + procedure AddSummaries; + begin + with BandedTableView do + begin + DataController.Groups.FullExpand; + with DataController.Summary.FooterSummaryItems.Add do + begin + Kind := skSum; + ItemLink := Columns[1]; + end; + end; + end; + + procedure InitializeOptions; + begin + with BandedTableView do + begin + Filtering.CustomizeDialog := False; + + OptionsBehavior.IncSearch := True; + + OptionsData.Deleting := False; + OptionsData.Editing := False; + OptionsData.Appending := False; + OptionsData.Inserting := False; + + OptionsView.BandHeaders := True; + OptionsView.ColumnAutoWidth := True; + OptionsView.Footer := True; + OptionsView.Indicator := True; + end; + end; + + procedure PlaceColumns; + var + I: Integer; + begin + with BandedTableView do + for I := 0 to ItemCount - 1 do + Columns[I].Position.BandIndex := 0; + end; + +begin + Grid.Levels.Add.GridView := Grid.CreateView(TcxGridBandedTableView); + TcxGridLevel(BandedTableView.Level).Caption := 'Table'; + + AddBands; + AddItems(BandedTableView); + AddGroups; + AddPreview; + AddRecords; + AddSummaries; + InitializeOptions; + PlaceColumns; +end; + +procedure TdxGridReportLinkStyleSheetEditorPreview.CreateCardView; + + procedure AddRecords; + const + ARecordCount: Integer = 3; + var + I: Integer; + begin + with CardView.DataController as TcxGridDataController do + begin + BeginUpdate; + try + RecordCount := ARecordCount; + for I := 0 to ARecordCount - 1 do + begin + Values[I, 1] := 'ABC'; + Values[I, 2] := (I + 1) * 100; + Values[I, 3] := Date - I; + end; + finally + EndUpdate; + end; + end; + end; + + procedure AddCaptionRow; + begin + with CardView.CreateRow do + begin + Caption := 'Caption'; + Index := 0; + Kind := rkCaption; + end; + end; + + procedure InitializeOptions; + begin + with CardView do + begin + OptionsBehavior.IncSearch := True; + + OptionsData.Deleting := False; + OptionsData.Editing := False; + OptionsData.Appending := False; + OptionsData.Inserting := False; + end; + end; + +begin + Grid.Levels.Add.GridView := Grid.CreateView(TcxGridCardView); + TcxGridLevel(CardView.Level).Caption := 'Cards'; + + AddItems(CardView); + AddCaptionRow; + AddRecords; + InitializeOptions; +end; + +procedure TdxGridReportLinkStyleSheetEditorPreview.Initialize; +begin + CreateBandedTableView; + CreateCardView; + + Grid.RootLevelOptions.DetailTabsPosition := dtpTop; +end; + +function TdxGridReportLinkStyleSheetEditorPreview.GetBandedTableView: TcxGridBandedTableView; +begin + Result := Grid.Levels[0].GridView as TcxGridBandedTableView; +end; + +function TdxGridReportLinkStyleSheetEditorPreview.GetCardView: TcxGridCardView; +begin + Result := Grid.Levels[1].GridView as TcxGridCardView; +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterNoIcon([TdxGridReportLink, TdxGridReportLinkStyleSheet]); +end; + +procedure RegisterStyleSheetAssistants; +begin + cxStyles.RegisterStyleSheetClass(TdxGridReportLinkStyleSheet); + TdxGridReportLinkStyleSheetEditorPreview.Register; +end; + +procedure UnregisterStyleSheetAssistants; +begin + TdxGridReportLinkStyleSheetEditorPreview.Unregister; + cxStyles.UnregisterStyleSheetClass(TdxGridReportLinkStyleSheet); +end; + +initialization + RegisterStyleSheetAssistants; + +finalization + UnregisterStyleSheetAssistants; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxImgLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxImgLnk.pas new file mode 100644 index 00000000..803b4830 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxImgLnk.pas @@ -0,0 +1,45 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxImgLnk; + +interface + +// All code was moved to dxPScxEditorLnks.pas + +implementation + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxListBoxLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxListBoxLnk.pas new file mode 100644 index 00000000..3eb8db5b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxListBoxLnk.pas @@ -0,0 +1,44 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxListBoxLnk; + +// all code was moved to dxPScxEditorLnks.pas + +interface + +implementation + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxMCListBoxLnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPScxMCListBoxLnk.dfm new file mode 100644 index 00000000..3dc70f36 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxMCListBoxLnk.dfm @@ -0,0 +1,660 @@ +object cxfmMCListBoxDesignWindow: TcxfmMCListBoxDesignWindow + Left = 391 + Top = 313 + BorderIcons = [biSystemMenu, biMinimize, biMaximize, biHelp] + BorderStyle = bsDialog + Caption = 'cxfmMCListBoxDesignWindow' + ClientHeight = 293 + ClientWidth = 558 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 6 + Width = 549 + Height = 251 + ActivePage = tshColor + MultiLine = True + TabOrder = 0 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = '&Options' + object pnlOptions: TPanel + Left = 0 + Top = 0 + Width = 541 + Height = 223 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblShow: TLabel + Left = 5 + Top = 12 + Width = 26 + Height = 13 + Caption = 'Show' + end + object Bevel11: TBevel + Left = 40 + Top = 17 + Width = 194 + Height = 4 + Shape = bsBottomLine + end + object imgGrid: TImage + Left = 7 + Top = 34 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblOnEveryPage: TLabel + Left = 5 + Top = 125 + Width = 72 + Height = 13 + Caption = 'On Every Page' + end + object Image1: TImage + Left = 7 + Top = 149 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888777777777777777708888888888 + 888887FFFFFFFFFFFFFFF08888888888888887F7777777777777F07777708888 + 888887F7777777777777F0FFFFF08888888887F7777777777777F07777F07777 + 708887FFFFFFFFFFFFFFF07777F0FFFFF08887F777777777777FF07777F07777 + F08887FFFFFFFFFFFFFFF0FFFFF07777F08887F77777777777FFF077FFF07777 + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777777FFFFF0777FF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777FFFFFFFF07FFFF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF0777FF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF077FFF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777777F077FFF077FF + F08887F7777777777777F0FFFFF0FFFFF08887F7777777777777F0FFFFF07FFF + F08887FFFFFFFFFFFFFFF07777F0FFFFF0888000000000000000007777F077FF + F08888888887F7777777777777F0FFFFF08888888887FFFFFFFFFFFFFFF07777 + F0888888888000000000000000007777F08888888888888887F7777777777777 + F08888888888888887FFFFFFFFFFFFFFF0888888888888888000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object Bevel10: TBevel + Left = 84 + Top = 129 + Width = 150 + Height = 4 + Shape = bsBottomLine + end + object chbxShowVertLines: TCheckBox + Tag = 2 + Left = 95 + Top = 75 + Width = 137 + Height = 17 + Caption = 'Vertical Lines' + TabOrder = 2 + OnClick = ShowClick + end + object chbxShowBorders: TCheckBox + Left = 95 + Top = 29 + Width = 137 + Height = 17 + Caption = 'Border' + TabOrder = 0 + OnClick = ShowClick + end + object chbxShowHorzLines: TCheckBox + Tag = 1 + Left = 95 + Top = 51 + Width = 137 + Height = 17 + Caption = 'Horizontal Lines' + TabOrder = 1 + OnClick = ShowClick + end + object chbxShowColumnHeaders: TCheckBox + Tag = 3 + Left = 95 + Top = 99 + Width = 137 + Height = 17 + Caption = '&Column Headers' + TabOrder = 3 + OnClick = ShowClick + end + object chbxHeadersOnEveryPage: TCheckBox + Left = 95 + Top = 148 + Width = 137 + Height = 17 + Caption = 'Headers' + TabOrder = 4 + OnClick = HeadersOnEveryPageClick + end + object lblPreview: TStaticText + Left = 244 + Top = 2 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 5 + end + end + end + object tshColor: TTabSheet + Caption = '&Color' + object pnlColor: TPanel + Left = 0 + Top = 0 + Width = 541 + Height = 223 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblGridLinesColor: TLabel + Left = 6 + Top = 200 + Width = 79 + Height = 13 + Caption = '&Grid lines color : ' + end + object bvlGridLineColorHost: TBevel + Left = 91 + Top = 196 + Width = 127 + Height = 21 + Visible = False + end + object lblDrawMode: TLabel + Left = 5 + Top = 17 + Width = 58 + Height = 13 + Caption = 'Draw &Mode:' + FocusControl = cbxDrawMode + end + object gbxTransparentHeaders: TGroupBox + Left = 5 + Top = 131 + Width = 223 + Height = 55 + Caption = ' ' + TabOrder = 4 + object lblHeadersColor: TLabel + Left = 6 + Top = 24 + Width = 78 + Height = 13 + Caption = 'Headers Color : ' + end + object bvlHeadersColorHost: TBevel + Left = 86 + Top = 22 + Width = 127 + Height = 21 + Visible = False + end + end + object gbxTransparent: TGroupBox + Left = 5 + Top = 45 + Width = 223 + Height = 80 + Caption = ' ' + TabOrder = 2 + object lblColor: TLabel + Left = 6 + Top = 24 + Width = 35 + Height = 13 + Caption = 'Co&lor : ' + end + object bvlColorHost: TBevel + Left = 86 + Top = 20 + Width = 127 + Height = 21 + Visible = False + end + object lblEvenColor: TLabel + Left = 6 + Top = 51 + Width = 59 + Height = 13 + Caption = 'E&ven Color: ' + end + object bvlEvenColorHost: TBevel + Left = 86 + Top = 47 + Width = 127 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 18 + Top = 43 + Width = 15 + Height = 17 + Caption = 'T&ransparent' + TabOrder = 1 + OnClick = TransparentClick + end + object chbxTransparentHeaders: TCheckBox + Tag = 1 + Left = 18 + Top = 129 + Width = 15 + Height = 17 + Caption = 'T&ransparent Headers' + TabOrder = 3 + OnClick = TransparentClick + end + object cbxDrawMode: TComboBox + Left = 69 + Top = 12 + Width = 159 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 0 + OnClick = DrawModeClick + OnDrawItem = cbxDrawModeDrawItem + Items.Strings = ( + 'Simpe' + 'Odd\Even Rows Mode' + 'Chess' + 'Borrow From Source') + end + object stTransparent: TStaticText + Left = 33 + Top = 44 + Width = 69 + Height = 17 + Caption = ' Transparent ' + FocusControl = chbxTransparent + TabOrder = 5 + OnClick = stTransparentClick + end + object stTransparentHeaders: TStaticText + Left = 33 + Top = 130 + Width = 112 + Height = 17 + Caption = ' Transparent Headers ' + FocusControl = chbxTransparentHeaders + TabOrder = 6 + OnClick = stTransparentHeadersClick + end + end + end + object tshFont: TTabSheet + Caption = '&Font' + object pnlFont: TPanel + Left = 0 + Top = 0 + Width = 541 + Height = 223 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object btnFont: TButton + Left = 8 + Top = 9 + Width = 110 + Height = 21 + Caption = 'Fo&nt...' + TabOrder = 0 + OnClick = FontClick + end + object edFont: TEdit + Left = 8 + Top = 34 + Width = 221 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + end + object btnHeadersFont: TButton + Tag = 2 + Left = 8 + Top = 122 + Width = 110 + Height = 21 + Caption = 'Headers Font...' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 4 + OnClick = FontClick + end + object edFixedFont: TEdit + Left = 8 + Top = 147 + Width = 221 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 5 + end + object btnEvenFont: TButton + Tag = 1 + Left = 8 + Top = 65 + Width = 110 + Height = 21 + Caption = 'E&ven Font...' + TabOrder = 2 + OnClick = FontClick + end + object edEvenFont: TEdit + Left = 8 + Top = 90 + Width = 221 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 3 + end + end + end + object tshBehaviors: TTabSheet + Caption = '&Behaviors' + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 541 + Height = 223 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Image3: TImage + Left = 7 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblSelection: TLabel + Left = 5 + Top = 12 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object Bevel3: TBevel + Left = 53 + Top = 17 + Width = 179 + Height = 4 + Shape = bsBottomLine + end + object lblLookAndFeel: TLabel + Left = 5 + Top = 81 + Width = 67 + Height = 13 + Caption = 'Look And Feel' + end + object Bevel15: TBevel + Left = 81 + Top = 85 + Width = 151 + Height = 4 + Shape = bsBottomLine + end + object Image8: TImage + Left = 7 + Top = 101 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D08777777777780877777788807DCCCCDCCDDD0877777777778787777788 + 8F07D08888888888880888888888807DCCCCCCCCDD0888888888888788888888 + 8F07D00000000000000000000000007DCCCCDCCDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F7777777FF07DDDDDDDDDDD0F777777777FF7F7777777 + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F777777FFF07DDDDDDDDDDD0F777777FFFFF7F777777F + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F7777777777F7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F77777FFFF07DDDDDDDDDDD0F77777777FFF7F77777FF + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D00000000000000000000000007DCDDDDCDDDD0000000000000000000000 + 0007D08888888888880888888888807DCCCCDCCDDD0777777777777777777777 + 7707D08888888888880888888888807DCCCCCCCCDD0F88888888888788888888 + 8707D08000000008880880000000807DCCCCDCCDDD0F00000000888788000000 + 8707D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + F707D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblMiscellaneous: TLabel + Left = 6 + Top = 147 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + end + object Bevel4: TBevel + Left = 80 + Top = 152 + Width = 152 + Height = 4 + Shape = bsBottomLine + end + object Image5: TImage + Left = 7 + Top = 167 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000008088F07DDDDDDDDDDDD0800000000000000000000 + 807DD0F0FFFF8FFFF8FFFF0FFF0F07DDDDDDDDDDDD0F0F77FFF8F777F8F777F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCDDDDCDDDD0F0F00FFF8F00FF8F00FF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCCCCCDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCDDDDCDDDD0F0FFFFFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCCCCDCCDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCCCCCDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCDCCDDD0F0FFFFFF8F0FFF8F0FFF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0777777777777770FFF0F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F0F8887F8887F8880FFF8F07DDDDDDDDDDDD0F0F888887F88887F88880 + F07DD0F0F0087F0087F0080FFF0F07DDDDDDDDDDDD0F0F800087F80087F80080 + F07DD0F0FFFF7FFFF7FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF7FFFFF7FFFFF0 + F07DD0800000000000000008080807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxIncludeFixed: TCheckBox + Left = 95 + Top = 51 + Width = 139 + Height = 17 + Caption = '&Including fixed cells' + TabOrder = 1 + OnClick = IncludeFixedClick + end + object chbxOnlySelected: TCheckBox + Left = 95 + Top = 29 + Width = 139 + Height = 17 + Caption = 'Only &selected cells' + TabOrder = 0 + OnClick = OnlySelectedClick + end + object chbxUse3DEffects: TCheckBox + Tag = 12 + Left = 95 + Top = 96 + Width = 139 + Height = 17 + Caption = '3D Effects' + TabOrder = 2 + OnClick = Use3DEffectsClick + end + object chbxUseSoft3D: TCheckBox + Tag = 13 + Left = 95 + Top = 118 + Width = 139 + Height = 17 + Caption = 'Soft &3D' + TabOrder = 3 + OnClick = UseSoft3DClick + end + object chbxRowAutoHeight: TCheckBox + Left = 95 + Top = 185 + Width = 139 + Height = 17 + Caption = '&Row Auto Height' + TabOrder = 5 + OnClick = RowAutoHeightClick + end + object chbxAutoWidth: TCheckBox + Left = 95 + Top = 163 + Width = 139 + Height = 17 + Caption = 'AutoWidth' + TabOrder = 4 + OnClick = chbxAutoWidthClick + end + end + end + end + object pnlPreview: TPanel + Left = 252 + Top = 49 + Width = 293 + Height = 200 + BevelOuter = bvLowered + TabOrder = 1 + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxMCListBoxLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxMCListBoxLnk.pas new file mode 100644 index 00000000..87653ea3 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxMCListBoxLnk.pas @@ -0,0 +1,979 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxMCListBoxLnk; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, Classes, Graphics, Controls, ImgList, Dialogs, StdCtrls, + ExtCtrls, ComCtrls, cxMCListBox, cxHeader, dxPSGlbl, dxPSCore, dxPSForm, + dxPSBaseGridLnk, dxExtCtrls; + +type + TcxMCListBoxPaintOption = (mclbpoBorder, mclbpoHorzLines, mclbpoVertLines, mclbpoColumnHeaders); + TcxMCListBoxPaintOptions = set of TcxMCListBoxPaintOption; + + TcxMCListBoxReportLink = class; + + TcxMCListBoxCustomDrawItemEvent = procedure(Sender: TcxMCListBoxReportLink; + ACanvas: TCanvas; ACol, ARow: Integer; AnItem: TdxReportCellString; + var ADone: Boolean) of object; + + TcxMCListBoxReportLink = class(TAbstractdxGridReportLink) + private + FOptions: TcxMCListBoxPaintOptions; + FOnCustomDrawItem: TcxMCListBoxCustomDrawItemEvent; + + function GetColumn(Index: Integer): TcxHeaderSection; + function GetcxMCListBox: TcxMCListBox; + function GetHeaderColor: TColor; + function GetHeaderFont: TFont; + function GetHeaderTransparent: Boolean; + function GetIncludeHeaders: Boolean; + function GetOptions: TcxMCListBoxPaintOptions; + function GetText(Column, Row: Integer): string; + procedure SetOnCustomDrawItem(Value: TcxMCListBoxCustomDrawItemEvent); + procedure SetHeaderColor(Value: TColor); + procedure SetHeaderFont(Value: TFont); + procedure SetHeaderTransparent(Value: Boolean); + procedure SetIncludeHeaders(Value: Boolean); + procedure SetOptions(Value: TcxMCListBoxPaintOptions); + + function AreColumnHeadersShown: Boolean; + function HasHeaderSections: Boolean; + protected + procedure CustomDraw(AItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); override; + procedure DoCustomDrawItem(ACanvas: TCanvas; AnItem: TdxReportCellString; + var ADone: Boolean); dynamic; + procedure GetImageLists(AProc: TdxPSGetImageListProc); override; + procedure InternalRestoreDefaults; override; + procedure InternalRestoreFromOriginal; override; + + function GetDataItemClass(ACol: Integer; ARow: Integer = 0): TdxReportCellDataClass; override; + + function GetColCount: Integer; override; + function GetFixedRowCount: Integer; override; + function GetRowCount: Integer; override; + + function GetCellImageIndex(ACol, ARow: Integer): Integer; override; + function GetCellImageList(ACol, ARow: Integer): TCustomImageList; override; + function GetCellMultiline(ACol, ARow: Integer): Boolean; override; + function GetCellText(ACol, ARow: Integer): string; override; + function GetCellTextAlignX(ACol, ARow: Integer): TdxTextAlignX; override; + function GetColSortOrder(ACol: Integer): TdxCellSortOrder; override; + function GetSelectedColCount: Integer; override; + function GetSelectedRowCount: Integer; override; + function GetSourceColWidth(ACol: Integer): Integer; override; + function GetSourceRowHeight(ARow: Integer): Integer; override; + function HasColumnHeaderImage(ACol: Integer): Boolean; override; + function HasSelection: Boolean; override; + function HasSelectionInCol(ACol: Integer): Boolean; override; + function HasSelectionInRow(ARow: Integer): Boolean; override; + function IsDrawBorder: Boolean; override; + function IsDrawFixedHorzLines: Boolean; override; + function IsDrawHorzLines: Boolean; override; + function IsDrawVertLines: Boolean; override; + function IsSelectedCell(ACol, ARow: Integer): Boolean; override; + function IsSelectedRow(ARow: Integer): Boolean; override; + procedure SetDrawMode(Value: TdxGridDrawMode); override; + + property Columns[Index: Integer]: TcxHeaderSection read GetColumn; + property Texts[Column, Row: Integer]: string read GetText; + public + procedure Assign(Source: TPersistent); override; + + property cxMCListBox: TcxMCListBox read GetcxMCListBox; + published + property AutoWidth; + property DrawMode write SetDrawMode; + property Effects3D; + property EndEllipsis; + property EvenColor; + property EvenFont; + property HeaderColor: TColor read GetHeaderColor write SetHeaderColor default clBtnFace; + property HeaderFont: TFont read GetHeaderFont write SetHeaderFont stored IsFixedFontStored; + property HeaderTransparent: Boolean read GetHeaderTransparent write SetHeaderTransparent default False; + property IncludeHeaders: Boolean read GetIncludeHeaders write SetIncludeHeaders default True; + property GridLineColor; + property OnlySelected; + property Options: TcxMCListBoxPaintOptions read GetOptions write SetOptions + default [Low(TcxMCListBoxPaintOption)..High(TcxMCListBoxPaintOption)]; + property RowAutoHeight; + property Soft3D; + property SupportedCustomDraw; + property Transparent; + property UseCustomPageBreaks; + property UseHorzDelimiters; + property UseVertDelimiters; + + property OnCustomDrawItem: TcxMCListBoxCustomDrawItemEvent read FOnCustomDrawItem write SetOnCustomDrawItem; + property OnGetCustomPageBreaks; + property OnInitializeItem; + end; + + TcxfmMCListBoxDesignWindow = class(TStandarddxReportLinkDesignWindow) + PageControl1: TPageControl; + tshOptions: TTabSheet; + pnlOptions: TPanel; + lblShow: TLabel; + Bevel11: TBevel; + imgGrid: TImage; + chbxShowVertLines: TCheckBox; + chbxShowBorders: TCheckBox; + chbxShowHorzLines: TCheckBox; + tshColor: TTabSheet; + pnlColor: TPanel; + lblGridLinesColor: TLabel; + bvlGridLineColorHost: TBevel; + gbxTransparentHeaders: TGroupBox; + lblHeadersColor: TLabel; + bvlHeadersColorHost: TBevel; + gbxTransparent: TGroupBox; + lblColor: TLabel; + bvlColorHost: TBevel; + lblEvenColor: TLabel; + bvlEvenColorHost: TBevel; + chbxTransparent: TCheckBox; + chbxTransparentHeaders: TCheckBox; + tshFont: TTabSheet; + pnlFont: TPanel; + btnFont: TButton; + edFont: TEdit; + btnHeadersFont: TButton; + edFixedFont: TEdit; + btnEvenFont: TButton; + edEvenFont: TEdit; + tshBehaviors: TTabSheet; + Panel1: TPanel; + Image3: TImage; + lblSelection: TLabel; + Bevel3: TBevel; + lblLookAndFeel: TLabel; + Bevel15: TBevel; + Image8: TImage; + chbxIncludeFixed: TCheckBox; + chbxOnlySelected: TCheckBox; + chbxUse3DEffects: TCheckBox; + chbxUseSoft3D: TCheckBox; + pnlPreview: TPanel; + chbxShowColumnHeaders: TCheckBox; + lblDrawMode: TLabel; + cbxDrawMode: TComboBox; + lblMiscellaneous: TLabel; + Bevel4: TBevel; + Image5: TImage; + chbxRowAutoHeight: TCheckBox; + lblOnEveryPage: TLabel; + Image1: TImage; + Bevel10: TBevel; + chbxHeadersOnEveryPage: TCheckBox; + lblPreview: TStaticText; + chbxAutoWidth: TCheckBox; + stTransparent: TStaticText; + stTransparentHeaders: TStaticText; + procedure DrawModeClick(Sender: TObject); + procedure ShowClick(Sender: TObject); + procedure RowAutoHeightClick(Sender: TObject); + procedure TransparentClick(Sender: TObject); + procedure FontClick(Sender: TObject); + procedure HeadersOnEveryPageClick(Sender: TObject); + procedure OnlySelectedClick(Sender: TObject); + procedure IncludeFixedClick(Sender: TObject); + procedure Use3DEffectsClick(Sender: TObject); + procedure UseSoft3DClick(Sender: TObject); + procedure ColorChange(Sender: TObject); + procedure PreviewPaint(Sender: TObject); + procedure PageControl1Change(Sender: TObject); + procedure cbxDrawModeDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure chbxAutoWidthClick(Sender: TObject); + procedure stTransparentClick(Sender: TObject); + procedure stTransparentHeadersClick(Sender: TObject); + private + FccbxColor: TdxPSColorCombo; + FccbxEvenColor: TdxPSColorCombo; + FccbxFixedColor: TdxPSColorCombo; + FccbxGridLineColor: TdxPSColorCombo; + FPreviewBox: TdxPSPaintPanel; + function GetReportLink: TcxMCListBoxReportLink; + + procedure CreateControls; + procedure CMDialogChar(var message: TCMDialogChar); message CM_DIALOGCHAR; + protected + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + procedure LoadStrings; override; + procedure PaintPreview(ACanvas: TCanvas; R: TRect); override; + procedure UpdateControlsState; override; + procedure UpdatePreview; override; + public + constructor Create(AOwner: TComponent); override; + property ReportLink: TcxMCListBoxReportLink read GetReportLink; + end; + +const + dxDefaultMCListBoxOptions = [Low(TcxMCListBoxPaintOption)..High(TcxMCListBoxPaintOption)]; + +implementation + +{$R *.dfm} + +uses + SysUtils, Forms, cxClasses, cxLookAndFeels, dxPSRes, dxPSUtl, dxPrnDev; + +const + SortOrderMap: array[TcxHeaderSortOrder] of TdxCellSortOrder = (csoNone, csoUp, csoDown); + +{ TcxMCListBoxReportLink } + +procedure TcxMCListBoxReportLink.Assign(Source: TPersistent); +begin + if Source is TcxMCListBoxReportLink then + with TcxMCListBoxReportLink(Source) do + begin + Self.Options := Options; + end; + inherited; +end; + +procedure TcxMCListBoxReportLink.CustomDraw(AItem: TAbstractdxReportCellData; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); +begin +// if AItem.Data <> 0 then + DoCustomDrawItem(ACanvas, TdxReportCellString(AItem), ADone); +end; + +procedure TcxMCListBoxReportLink.DoCustomDrawItem(ACanvas: TCanvas; + AnItem: TdxReportCellString; var ADone: Boolean); +var + Col, Row: Integer; +begin + if Assigned(FOnCustomDrawItem) then + begin + GetCellColRow(AnItem, Col, Row); + FOnCustomDrawItem(Self, ACanvas, Col, Row, AnItem, ADone); + end; +end; + +procedure TcxMCListBoxReportLink.GetImageLists(AProc: TdxPSGetImageListProc); +begin + inherited; + AProc(cxMCListBox.Images); +end; + +procedure TcxMCListBoxReportLink.InternalRestoreDefaults; +begin + inherited; + Options := dxDefaultMCListBoxOptions; +end; + +procedure TcxMCListBoxReportLink.InternalRestoreFromOriginal; +begin + inherited; + EndEllipsis := cxMCListBox.ShowEndEllipsis; + Multiline := cxMCListBox.MultiLines; + Options := [mclbpoBorder]; + if cxMCListBox.ShowColumnLines then + Options := Options + [mclbpoVertLines]; + with cxMCListBox.Style.LookAndFeel do + begin + Effects3D := (lfvKind in AssignedValues) and (Kind <> lfUltraFlat); + Soft3D := (lfvKind in AssignedValues) and (Kind = lfFlat); + end; +end; + +function TcxMCListBoxReportLink.GetDataItemClass(ACol: Integer; ARow: Integer = 0): TdxReportCellDataClass; +const + ItemClasses: array[Boolean] of TdxReportCellDataClass = (TdxReportCellString, TdxReportCellImage); +begin + Result := ItemClasses[IsFixedRow(ARow)]; +end; + +function TcxMCListBoxReportLink.GetColCount: Integer; +begin + Result := cxMCListBox.HeaderSections.Count; + if Result = 0 then Result := 1; +end; + +function TcxMCListBoxReportLink.GetFixedRowCount: Integer; +begin + Result := Ord(AreColumnHeadersShown); +end; + +function TcxMCListBoxReportLink.GetRowCount: Integer; +begin + Result := cxMCListBox.Items.Count + Ord(AreColumnHeadersShown); +end; + +function TcxMCListBoxReportLink.GetCellImageIndex(ACol, ARow: Integer): Integer; +begin + if HasHeaderSections and IsFixedRow(ARow) then + Result := Columns[ACol].ImageIndex + else + Result := inherited GetCellImageIndex(ACol, ARow); +end; + +function TcxMCListBoxReportLink.GetCellImageList(ACol, ARow: Integer): TCustomImageList; +begin + if HasHeaderSections and IsFixedRow(ARow) then + Result := cxMCListBox.Images + else + Result := inherited GetCellImageList(ACol, ARow); +end; + +function TcxMCListBoxReportLink.GetCellMultiline(ACol, ARow: Integer): Boolean; +begin + Result := cxMCListBox.MultiLines; +end; + +function TcxMCListBoxReportLink.GetCellText(ACol, ARow: Integer): string; +begin + if IsFixedRow(ARow) then + if HasHeaderSections then + Result := Columns[ACol].Text + else + Result := '' + else + Result := Texts[ACol, ARow - Ord(AreColumnHeadersShown)]; +end; + +function TcxMCListBoxReportLink.GetCellTextAlignX(ACol, ARow: Integer): TdxTextAlignX; +begin + if HasHeaderSections then + Result := dxTextAlignX[Columns[ACol].Alignment] + else + Result := dxTextAlignX[cxMCListBox.Alignment]; +end; + +function TcxMCListBoxReportLink.GetColSortOrder(ACol: Integer): TdxCellSortOrder; +begin + if HasHeaderSections then + Result := SortOrderMap[Columns[ACol].SortOrder] + else + Result := inherited GetColSortOrder(ACol); +end; + +function TcxMCListBoxReportLink.GetSelectedColCount: Integer; +begin + if HasHeaderSections then + Result := cxMCListBox.HeaderSections.Count + else + Result := 1; +end; + +function TcxMCListBoxReportLink.GetSelectedRowCount: Integer; +begin + Result := cxMCListBox.SelCount; +end; + +function TcxMCListBoxReportLink.GetSourceColWidth(ACol: Integer): Integer; +begin + if HasHeaderSections then + Result := Columns[ACol].Width + else + Result := cxMCListBox.Width; +end; + +function TcxMCListBoxReportLink.GetSourceRowHeight(ARow: Integer): Integer; +begin + Result := inherited GetSourceRowHeight(ARow); + if Result = 0 then + Result := GetMinRowHeight(ScreenDC, Font); +end; + +function TcxMCListBoxReportLink.HasColumnHeaderImage(ACol: Integer): Boolean; +begin + Result := HasHeaderSections and (cxMCListBox.Images <> nil) and (Columns[ACol].ImageIndex > -1) and + (Columns[ACol].ImageIndex < cxMCListBox.Images.Count); +end; + +function TcxMCListBoxReportLink.HasSelection: Boolean; +begin + Result := inherited HasSelection and (cxMCListBox.SelCount > 0); +end; + +function TcxMCListBoxReportLink.HasSelectionInCol(ACol: Integer): Boolean; +begin + Result := True; +end; + +function TcxMCListBoxReportLink.HasSelectionInRow(ARow: Integer): Boolean; +begin + Result := IsSelectedRow(ARow); +end; + +function TcxMCListBoxReportLink.IsDrawBorder: Boolean; +begin + Result := mclbpoBorder in Options; +end; + +function TcxMCListBoxReportLink.IsDrawHorzLines: Boolean; +begin + Result := mclbpoHorzLines in Options; +end; + +function TcxMCListBoxReportLink.IsDrawVertLines: Boolean; +begin + Result := mclbpoVertLines in Options; +end; + +function TcxMCListBoxReportLink.IsDrawFixedHorzLines: Boolean; +begin + Result := mclbpoBorder in Options; +end; + +function TcxMCListBoxReportLink.IsSelectedCell(ACol, ARow: Integer): Boolean; +begin + Result := IsSelectedRow(ARow); +end; + +function TcxMCListBoxReportLink.IsSelectedRow(ARow: Integer): Boolean; +begin + if IsFixedRow(ARow) then + Result := IncludeHeaders + else + Result := cxMCListBox.Selected[ARow - Ord(AreColumnHeadersShown)]; +end; + +procedure TcxMCListBoxReportLink.SetDrawMode(Value: TdxGridDrawMode); +begin + if Value = gdmBorrowSource then Value := gdmStrict; + inherited; +end; + +function TcxMCListBoxReportLink.GetColumn(Index: Integer): TcxHeaderSection; +begin + Result := cxMCListBox.HeaderSections[Index]; +end; + +function TcxMCListBoxReportLink.GetcxMCListBox: TcxMCListBox; +begin + Result := TcxMCListBox(Component); +end; + +function TcxMCListBoxReportLink.GetHeaderColor: TColor; +begin + Result := FixedColor; +end; + +function TcxMCListBoxReportLink.GetHeaderFont: TFont; +begin + Result := FixedFont; +end; + +function TcxMCListBoxReportLink.GetHeaderTransparent: Boolean; +begin + Result := FixedTransparent; +end; + +function TcxMCListBoxReportLink.GetIncludeHeaders: Boolean; +begin + Result := IncludeFixed; +end; + +function TcxMCListBoxReportLink.GetOptions: TcxMCListBoxPaintOptions; +begin + Result := FOptions; +end; + +function TcxMCListBoxReportLink.GetText(Column, Row: Integer): string; +var + TextLine: string; + P, I: Integer; +begin + TextLine := cxMCListBox.Items[Row]; + if cxMCListBox.Delimiter <> #0 then + begin + I := -1; + repeat + P := Pos(cxMCListBox.Delimiter, TextLine); + if P <> 0 then + begin + Result := Copy(TextLine, 1, P - 1); + Delete(TextLine, 1, P); + end + else + Result := TextLine; + Inc(I); + until (I = Column) or (P = 0); + end + else + Result := TextLine; +end; + +procedure TcxMCListBoxReportLink.SetOnCustomDrawItem(Value: TcxMCListBoxCustomDrawItemEvent); +begin + if @FOnCustomDrawItem <> @Value then + begin + FOnCustomDrawItem := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TcxMCListBoxReportLink.SetHeaderColor(Value: TColor); +begin + FixedColor := Value; +end; + +procedure TcxMCListBoxReportLink.SetHeaderFont(Value: TFont); +begin + FixedFont := Value; +end; + +procedure TcxMCListBoxReportLink.SetHeaderTransparent(Value: Boolean); +begin + FixedTransparent := Value; +end; + +procedure TcxMCListBoxReportLink.SetIncludeHeaders(Value: Boolean); +begin + IncludeFixed := Value; +end; + +procedure TcxMCListBoxReportLink.SetOptions(Value: TcxMCListBoxPaintOptions); +begin + if FOptions <> Value then + begin + FOptions := Value; + LinkModified(True); + end; +end; + +function TcxMCListBoxReportLink.AreColumnHeadersShown: Boolean; +begin + Result := mclbpoColumnHeaders in Options; +end; + +function TcxMCListBoxReportLink.HasHeaderSections: Boolean; +begin + Result := cxMCListBox.HeaderSections.Count <> 0; +end; + +{ TcxfmMCListBoxDesignWindow } + +constructor TcxfmMCListBoxDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxPSGlbl.dxhccxMCListBoxReportLinkDesigner; + inherited; + CreateControls; + PageControl1.ActivePage := PageControl1.Pages[0]; +end; + +procedure TcxfmMCListBoxDesignWindow.DoInitialize; +begin + inherited; + + chbxShowBorders.Checked := mclbpoBorder in ReportLink.Options; + chbxShowHorzLines.Checked := mclbpoHorzLines in ReportLink.Options; + chbxShowVertLines.Checked := mclbpoVertLines in ReportLink.Options; + chbxShowColumnHeaders.Checked := mclbpoColumnHeaders in ReportLink.Options; + + chbxAutoWidth.Checked := ReportLink.AutoWidth; + chbxRowAutoHeight.Checked := ReportLink.RowAutoHeight; + + with cbxDrawMode do + ItemIndex := Items.IndexOfObject(TObject(ReportLink.DrawMode)); + + chbxTransparent.Checked := ReportLink.Transparent; + TdxPSColorCombo(FccbxColor).ColorValue := ColorToRGB(ReportLink.Color); + TdxPSColorCombo(FccbxEvenColor).ColorValue := ColorToRGB(ReportLink.EvenColor); + chbxTransparentHeaders.Checked := ReportLink.HeaderTransparent; + TdxPSColorCombo(FccbxFixedColor).ColorValue := ColorToRGB(ReportLink.HeaderColor); + TdxPSColorCombo(FccbxGridLineColor).ColorValue := ColorToRGB(ReportLink.GridLineColor); + + FontInfoToText(ReportLink.Font, edFont); + FontInfoToText(ReportLink.EvenFont, edEvenFont); + FontInfoToText(ReportLink.HeaderFont, edFixedFont); + + chbxHeadersOnEveryPage.Checked := ReportLink.HeadersOnEveryPage; + chbxOnlySelected.Checked := ReportLink.OnlySelected; + chbxIncludeFixed.Checked := ReportLink.IncludeFixed; + + chbxUse3DEffects.Checked := ReportLink.Effects3D; + chbxUseSoft3D.Checked := ReportLink.Soft3D; +end; + +{$IFDEF DELPHI7} +function TcxfmMCListBoxDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +procedure TcxfmMCListBoxDesignWindow.LoadStrings; +begin + inherited; + + tshOptions.Caption := cxGetResourceString(@sdxOptions); + tshFont.Caption := cxGetResourceString(@sdxFonts); + tshColor.Caption := cxGetResourceString(@sdxColors); + tshBehaviors.Caption := cxGetResourceString(@sdxBehaviors); + lblPreview.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + lblShow.Caption := cxGetResourceString(@sdxShow); + chbxShowBorders.Caption := cxGetResourceString(@sdxBorderLines); + chbxShowHorzLines.Caption := cxGetResourceString(@sdxHorzLines); + chbxShowVertLines.Caption := cxGetResourceString(@sdxVertLines); + chbxShowColumnHeaders.Caption := cxGetResourceString(@sdxColumnHeaders); + + lblMiscellaneous.Caption := cxGetResourceString(@sdxMiscellaneous); + chbxRowAutoHeight.Caption := cxGetResourceString(@sdxRowAutoHeight); + lblDrawMode.Caption := cxGetResourceString(@sdxDrawMode); + + with cbxDrawMode.Items do + begin + BeginUpdate; + try + Clear; + AddObject(cxGetResourceString(@sdxDrawModeStrict), TObject(gdmStrict)); + AddObject(cxGetResourceString(@sdxDrawModeOddEven), TObject(gdmOddEven)); + AddObject(cxGetResourceString(@sdxDrawModeChess), TObject(gdmChess)); + finally + EndUpdate; + end; + end; + + stTransparent.Caption := ' ' + cxGetResourceString(@sdxTransparent) + ' '; + lblColor.Caption := cxGetResourceString(@sdxColor); + lblEvenColor.Caption := cxGetResourceString(@sdxEvenColor); + stTransparentHeaders.Caption := ' ' + cxGetResourceString(@sdxHeadersTransparent) + ' '; + lblHeadersColor.Caption := cxGetResourceString(@sdxHeaderColor); + lblGridLinesColor.Caption := cxGetResourceString(@sdxGridLinesColor); + + btnFont.Caption := cxGetResourceString(@sdxBtnFont); + btnEvenFont.Caption := cxGetResourceString(@sdxBtnEvenFont); + btnHeadersFont.Caption := cxGetResourceString(@sdxBtnHeadersFont); + + lblOnEveryPage.Caption := cxGetResourceString(@sdxOnEveryPage); + chbxHeadersOnEveryPage.Caption := cxGetResourceString(@sdxColumnHeadersOnEveryPage); + + lblSelection.Caption := cxGetResourceString(@sdxSelection); + chbxOnlySelected.Caption := cxGetResourceString(@sdxOnlySelected); + chbxIncludeFixed.Caption := cxGetResourceString(@sdxIncludeFixed); + + lblLookAndFeel.Caption := cxGetResourceString(@sdxLookAndFeel); + chbxUse3DEffects.Caption := cxGetResourceString(@sdxUse3DEffects); + chbxUseSoft3D.Caption := cxGetResourceString(@sdxSoft3D); +end; + +procedure TcxfmMCListBoxDesignWindow.PaintPreview(ACanvas: TCanvas; R: TRect); +begin + inherited; + dxPSDrawGridPreview(ACanvas, R, ReportLink, False, ReportLink.AreColumnHeadersShown); +end; + +procedure TcxfmMCListBoxDesignWindow.UpdateControlsState; +begin + inherited; + + FccbxColor.Enabled := not chbxTransparent.Checked; + lblColor.Enabled := FccbxColor.Enabled; + FccbxEvenColor.Enabled := not chbxTransparent.Checked and + (ReportLink.DrawMode in [gdmOddEven, gdmChess]); + lblEvenColor.Enabled := FccbxEvenColor.Enabled; + FccbxFixedColor.Enabled := not chbxTransparentHeaders.Checked; + lblHeadersColor.Enabled := FccbxFixedColor.Enabled; + + btnEvenFont.Enabled := ReportLink.DrawMode in [gdmOddEven, gdmChess]; + if ReportLink.DrawMode in [gdmOddEven, gdmChess] then + begin + lblColor.Caption := cxGetResourceString(@sdxOddColor); + btnFont.Caption := cxGetResourceString(@sdxBtnOddFont); + end + else + begin + lblColor.Caption := cxGetResourceString(@sdxColor); + btnFont.Caption := cxGetResourceString(@sdxBtnFont); + end; + chbxHeadersOnEveryPage.Enabled := not ReportLink.IsAggregated; + chbxIncludeFixed.Enabled := chbxOnlySelected.Enabled and chbxOnlySelected.Checked; + chbxUseSoft3D.Enabled := chbxUse3DEffects.Checked; +end; + +procedure TcxfmMCListBoxDesignWindow.UpdatePreview; +begin + FPreviewBox.Invalidate; +end; + +function TcxfmMCListBoxDesignWindow.GetReportLink: TcxMCListBoxReportLink; +begin + Result := inherited ReportLink as TcxMCListBoxReportLink; +end; + +procedure TcxfmMCListBoxDesignWindow.CreateControls; + + function CreateColorCombo(AParent: TWinControl; AHost: TControl; + ATag: Integer; AAutoColor: TColor; ALabel: TLabel): TdxPSColorCombo; + begin + Result := TdxPSColorCombo.Create(Self); + with Result do + begin + BoundsRect := AHost.BoundsRect; + Tag := MakeTTag(ATag); + Parent := AParent; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := AAutoColor; + OnChange := ColorChange; + end; + ALabel.FocusControl := Result; + AHost.Visible := False; + end; + + procedure CreatePreviewBox; + var + R: TRect; + begin + FPreviewBox := TdxPSPaintPanel.Create(Self); + with FPreviewBox do + begin + Parent := pnlPreview; + R := pnlPreview.BoundsRect; + OffsetRect(R, -R.Left, -R.Top); + InflateRect(R, -1, -1); + BoundsRect := R; + EdgeInner := esNone; + EdgeOuter := esNone; + OnPaint := PreviewPaint; + end; + end; + +begin + CreatePreviewBox; + + FccbxColor := + CreateColorCombo(gbxTransparent, bvlColorHost, 0, dxDefaultColor, lblColor); + FccbxEvenColor := + CreateColorCombo(gbxTransparent, bvlEvenColorHost, 1, dxDefaultColor, lblEvenColor); + FccbxFixedColor := + CreateColorCombo(gbxTransparentHeaders, bvlHeadersColorHost, 2, dxDefaultFixedColor, lblHeadersColor); + FccbxGridLineColor := + CreateColorCombo(pnlColor, bvlGridLineColorHost, 3, dxDefaultGridLineColor, lblGridLinesColor); +end; + +procedure TcxfmMCListBoxDesignWindow.CMDialogChar(var message: TCMDialogChar); +var + I: Integer; +begin + inherited; + with PageControl1 do + for I := 0 to PageCount - 1 do + if IsAccel(message.CharCode, Pages[I].Caption) then + begin + message.Result := 1; + ActivePage := Pages[I]; + Exit; + end; +end; + +procedure TcxfmMCListBoxDesignWindow.DrawModeClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TComboBox(Sender) do + ReportLink.DrawMode := TdxGridDrawMode(Items.Objects[ItemIndex]); + Modified := True; + UpdatePreview; +end; + +procedure TcxfmMCListBoxDesignWindow.cbxDrawModeDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +begin + dxPSBaseGridLnk.dxPSDrawComboDrawModeItem(Control, Index, Rect, State); +end; + +procedure TcxfmMCListBoxDesignWindow.ShowClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TCheckBox(Sender) do + if Checked then + ReportLink.Options := ReportLink.Options + [TcxMCListBoxPaintOption(Tag)] + else + ReportLink.Options := ReportLink.Options - [TcxMCListBoxPaintOption(Tag)]; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmMCListBoxDesignWindow.chbxAutoWidthClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.AutoWidth := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TcxfmMCListBoxDesignWindow.RowAutoHeightClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.RowAutoHeight := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TcxfmMCListBoxDesignWindow.TransparentClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + case TTagToInt(TCheckBox(Sender).Tag) of + 0: ReportLink.Transparent := TCheckBox(Sender).Checked; + 1: ReportLink.HeaderTransparent := TCheckBox(Sender).Checked; + end; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmMCListBoxDesignWindow.stTransparentClick(Sender: TObject); +begin + if chbxTransparent.CanFocus then ActiveControl := chbxTransparent; + chbxTransparent.Checked := not chbxTransparent.Checked; +end; + +procedure TcxfmMCListBoxDesignWindow.stTransparentHeadersClick(Sender: TObject); +begin + if chbxTransparentHeaders.CanFocus then ActiveControl := chbxTransparentHeaders; + chbxTransparentHeaders.Checked := not chbxTransparentHeaders.Checked; +end; + +procedure TcxfmMCListBoxDesignWindow.FontClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + + with dxPSGlbl.FontDialog do + begin + case TTagToInt(TButton(Sender).Tag) of + 0: Font := ReportLink.Font; + 1: Font := ReportLink.EvenFont; + 2: Font := ReportLink.HeaderFont; + end; + if Execute then + begin + case TTagToInt(TButton(Sender).Tag) of + 0: + begin + ReportLink.Font := Font; + FontInfoToText(ReportLink.Font, edFont); + end; + 1: + begin + ReportLink.EvenFont := Font; + FontInfoToText(ReportLink.EvenFont, edEvenFont); + end; + 2: + begin + ReportLink.FixedFont := Font; + FontInfoToText(ReportLink.HeaderFont, edFixedFont); + end; + end; + Modified := True; + UpdatePreview; + end; + end; +end; + +procedure TcxfmMCListBoxDesignWindow.HeadersOnEveryPageClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.HeadersOnEveryPage := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TcxfmMCListBoxDesignWindow.OnlySelectedClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OnlySelected := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TcxfmMCListBoxDesignWindow.IncludeFixedClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.IncludeFixed := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TcxfmMCListBoxDesignWindow.Use3DEffectsClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.Effects3D := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmMCListBoxDesignWindow.UseSoft3DClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.Soft3D := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmMCListBoxDesignWindow.ColorChange(Sender: TObject); +var + AColor: TColor; +begin + if LockControlsUpdate then Exit; + AColor := TdxPSColorCombo(Sender).ColorValue; + case TTagToInt(TdxPSColorCombo(Sender).Tag) of + 0: ReportLink.Color := AColor; + 1: ReportLink.EvenColor := AColor; + 2: ReportLink.FixedColor := AColor; + 3: ReportLink.GridLineColor := AColor; + end; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmMCListBoxDesignWindow.PreviewPaint(Sender: TObject); +begin + with FPreviewBox do + PaintPreview(Canvas, ClientRect); +end; + +procedure TcxfmMCListBoxDesignWindow.PageControl1Change(Sender: TObject); +begin + lblPreview.Parent := TPageControl(Sender).ActivePage; +end; + +initialization + dxPSRegisterReportLink(TcxMCListBoxReportLink, TcxMCListBox, TcxfmMCListBoxDesignWindow); + +finalization + dxPSUnregisterReportLink(TcxMCListBoxReportLink, TcxMCListBox, TcxfmMCListBoxDesignWindow); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxPageControlProducer.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxPageControlProducer.pas new file mode 100644 index 00000000..6936b496 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxPageControlProducer.pas @@ -0,0 +1,164 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxPageControlProducer; + +interface + +{$I cxVer.inc} + +uses + Classes, Controls, dxPSContainerLnk, cxPC; + +type + TdxPScxTabControlProducer = class(TdxPSRootContainerProducer) + public + function Control: TcxTabControl; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPScxPageControlIterator = class(TdxPSWinControlIterator) + private + function GetPageControl: TcxPageControl; + protected + function GetControl(Index: Integer): TControl; override; + function GetControlCount: Integer; override; + public + property PageControl: TcxPageControl read GetPageControl; + end; + + TdxPScxTabSheetProducer = class(TdxPSRootContainerProducer) + public + function Control: TcxTabSheet; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPScxPageControlProducer = class(TdxPSRootContainerProducer) + protected + function CanProcessChild(AChildControl: TControl): Boolean; override; + class function IteratorClass: TdxPSWinControlIteratorClass; override; + public + function Control: TcxPageControl; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + +implementation + +{ TdxPScxTabControlProducer } + +function TdxPScxTabControlProducer.Control: TcxTabControl; +begin + Result := inherited Control as TcxTabControl; +end; + +class function TdxPScxTabControlProducer.ControlClass: TControlClass; +begin + Result := TcxTabControl; +end; + +{ TdxPScxPageControlIterator } + +function TdxPScxPageControlIterator.GetControl(Index: Integer): TControl; +begin + Result := PageControl.ActivePage; +end; + +function TdxPScxPageControlIterator.GetControlCount: Integer; +begin + Result := Ord(PageControl.PageCount > 0); +end; + +function TdxPScxPageControlIterator.GetPageControl: TcxPageControl; +begin + Result := TcxPageControl(Control); +end; + +{ TdxPScxTabSheetProducer } + +function TdxPScxTabSheetProducer.Control: TcxTabSheet; +begin + Result := inherited Control as TcxTabSheet; +end; + +class function TdxPScxTabSheetProducer.ControlClass: TControlClass; +begin + Result := TcxTabSheet; +end; + +{ TdxPScxPageControlProducer } + +function TdxPScxPageControlProducer.Control: TcxPageControl; +begin + Result := inherited Control as TcxPageControl; +end; + +class function TdxPScxPageControlProducer.ControlClass: TControlClass; +begin + Result := TcxPageControl; +end; + +function TdxPScxPageControlProducer.CanProcessChild(AChildControl: TControl): Boolean; +begin + Result := AChildControl = Control.ActivePage; +end; + +class function TdxPScxPageControlProducer.IteratorClass: TdxPSWinControlIteratorClass; +begin + Result := TdxPScxPageControlIterator; +end; + +procedure RegisterAssistants; +begin + TdxPScxTabControlProducer.Register; + TdxPScxTabSheetProducer.Register; + TdxPScxPageControlProducer.Register; +end; + +procedure UnregisterAssistants; +begin + TdxPScxPageControlProducer.Unregister; + TdxPScxTabSheetProducer.Unregister; + TdxPScxTabControlProducer.Unregister; +end; + +initialization + RegisterAssistants; + dxPSContainerLnk.dxPSRegisterContainers([TcxTabSheet, TcxTabControl, TcxPageControl]); + +finalization + dxPSContainerLnk.dxPSUnregisterContainers([TcxTabSheet, TcxTabControl, TcxPageControl]); + UnregisterAssistants; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxPivotGridLnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPScxPivotGridLnk.dfm new file mode 100644 index 00000000..7c159195 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxPivotGridLnk.dfm @@ -0,0 +1,1204 @@ +object cxfmPivotGridReportLinkDesignWindow: TcxfmPivotGridReportLinkDesignWindow + Left = 349 + Top = 253 + BorderStyle = bsDialog + Caption = 'cxfmPivotGridReportLinkDesignWindow' + ClientHeight = 398 + ClientWidth = 702 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 0 + Top = 0 + Width = 702 + Height = 363 + ActivePage = tshView + TabOrder = 0 + object tshView: TTabSheet + Caption = 'View' + object lblShow: TLabel + Left = 5 + Top = 8 + Width = 26 + Height = 13 + Caption = 'Show' + end + object bvlShow: TBevel + Left = 43 + Top = 13 + Width = 253 + Height = 4 + Shape = bsBottomLine + end + object Bevel1: TBevel + Left = 56 + Top = 147 + Width = 240 + Height = 4 + Shape = bsBottomLine + end + object Image1: TImage + Left = 9 + Top = 37 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object imgCardFraming: TImage + Left = 9 + Top = 173 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDD7777777777777777777DDDDDDDDDDDDDDDDDD00000000000000000 + 00DDDDDDD88888888888888888887DDDDDDDDDDDDDDDDD000000000000000000 + 00DDDDDDD8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDDDDD0FFFFFFF0FFFFFFFFF + 00DDDDD778FFFFFFF8FFF9999FF87DDDDDDDDDDDDDDD000FFFFFFF0FFF9999FF + 00DDDD8888FFFFFFF8FFF9999FF87DDDDDDDDDDDDDD0000FFFFFFF0FFF9999FF + 00DDDD8FF8FFFFFFF8FCCCC99FF87DDDCDDDDCDDDDD0FF0FFFFFFF0FCCCC99FF + 00DDDD8FF8FFFFFFF8FCCCC99FF87DDDCCCCDCCDDDD0FF0FFFFFFF0FCCCC99FF + 00DDDD8FF8F77777F8FCCCCFFFF87DDDCCCCCCCCDDD0FF0F77777F0FCCCCFFFF + 00DDDD8FF8F77777F8FCCCCFFFF87DDDCCCCDCCDDDD0FF0F77777F0FCCCCFFFF + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDCDDDDCDDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDDDDDDDDDDDD0F7000000000000000000 + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF777777F87DDDDDDDDDDDDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF7FFFFFF87DDDDDDDDDDDDDD0000F7FFFFF0FF7FFFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDDDDDDDDDDDD0F7000000000000000000 + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF77777FF87DDDDDDDDDDDDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF77FFFFF87DDDDDDDDDDDDDD0000F7FFFFF0FF77FFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDCDDDDCDDDDD0F7000000000000000000 + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDCCCCDCCDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF777777F87DDDCCCCCCCCDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF7FFFFFF87DDDCCCCDCCDDDD0000F7FFFFF0FF7FFFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDCDDDDCDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F78888888888888888888DDDDDDDDDDDDDDD0F7000000000000000000 + 0DDDDD8F7FFFFF8FF7FFFFFF87DDDDDDDDDDDDDDDDD0F7FFFFF0FF7FFFFFF00D + DDDDDD8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDDDDD0FFFFFFF0FFFFFFFFF00D + DDDDDD8888888888888888888DDDDDDDDDDDDDDDDDD0000000000000000000DD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblCardFraming: TLabel + Left = 5 + Top = 141 + Width = 38 + Height = 13 + Caption = 'Framing' + end + object chbxColumnFields: TCheckBox + Left = 90 + Top = 29 + Width = 200 + Height = 17 + Caption = '&Column Fields' + TabOrder = 0 + OnClick = chbxOptionsViewClick + end + object chbxShowExpandButtons: TCheckBox + Tag = 4 + Left = 90 + Top = 125 + Width = 200 + Height = 17 + Caption = '&Expand Buttons' + TabOrder = 4 + OnClick = chbxOptionsViewClick + end + object chbxHorizontalLines: TCheckBox + Tag = 1 + Left = 90 + Top = 157 + Width = 200 + Height = 17 + Caption = '&Horizontal Lines' + TabOrder = 5 + OnClick = chbxOptionsViewClick + end + object chbxVerticalLines: TCheckBox + Tag = 2 + Left = 90 + Top = 181 + Width = 200 + Height = 17 + Caption = '&Vertical Lines' + TabOrder = 6 + OnClick = chbxOptionsViewClick + end + object chbxBorders: TCheckBox + Tag = 3 + Left = 90 + Top = 205 + Width = 200 + Height = 17 + Caption = '&Borders' + TabOrder = 7 + OnClick = chbxOptionsViewClick + end + object chbxDataFields: TCheckBox + Left = 90 + Top = 53 + Width = 200 + Height = 17 + Caption = '&Data Fields' + TabOrder = 1 + OnClick = chbxOptionsViewClick + end + object chbxFilterFields: TCheckBox + Left = 90 + Top = 77 + Width = 200 + Height = 17 + Caption = '&Filter Fields' + TabOrder = 2 + OnClick = chbxOptionsViewClick + end + object chbxRowFields: TCheckBox + Left = 90 + Top = 101 + Width = 200 + Height = 17 + Caption = '&Row Fields' + TabOrder = 3 + OnClick = chbxOptionsViewClick + end + end + object tshBehaviors: TTabSheet + Caption = 'Behaviors' + ImageIndex = 1 + object lblExpanding: TLabel + Left = 5 + Top = 8 + Width = 50 + Height = 13 + Caption = 'Expanding' + end + object bvlExpanding: TBevel + Left = 62 + Top = 13 + Width = 234 + Height = 4 + Shape = bsBottomLine + end + object imgExpanding: TImage + Left = 9 + Top = 31 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 7778800000000000000000000000078888888888880000000000000000000000 + 007880FFF7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7FF777777FFF77777FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F8F7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7F7F8888FF7F88888FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F8F7777777777777777777078888888888880F7F7F888FFF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F0788077777777777777777777770788C8888C88880F7FF888888FFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880F0F7777777FFFFFFFFFFFF0788CCCCCCCC880F77777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7F7F8888FF7F88888FF7 + F0788077777777777777777777770788C8888C88880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F7F7F8888FF7F888888F7 + F0788077777777777777777777770788CCCC8CC8880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCCCCCC880F7FF88888FFFFFFFFFFF7 + F07880F0F777777FFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F77777777777777777777 + F078800000000000000000000000078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F888888880F88888888888078888888888880F77777777777777777777 + F07880F800008880F80000000008078888888888880F77777777777777777777 + F07880FFFFFFFFF0FFFFFFFFFFFF078888888888880FFFFFFFFFFFFFFFFFFFFF + F078800000000000000000000000088888888888880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object chbxExpandRows: TCheckBox + Tag = 1 + Left = 90 + Top = 53 + Width = 200 + Height = 17 + Caption = 'Rows' + TabOrder = 1 + OnClick = chbxExpandOptionsClick + end + object chbxExpandColumns: TCheckBox + Left = 90 + Top = 29 + Width = 200 + Height = 17 + Caption = 'Columns' + TabOrder = 0 + OnClick = chbxExpandOptionsClick + end + end + object tshFormatting: TTabSheet + Caption = 'Formatting' + ImageIndex = 4 + object lblLookAndFeel: TLabel + Left = 5 + Top = 8 + Width = 66 + Height = 13 + Caption = 'Look and Feel' + end + object bvlLookAndFeel: TBevel + Left = 85 + Top = 13 + Width = 211 + Height = 4 + Shape = bsBottomLine + end + object imgLookAndFeel: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D0887777787787FFFFFFFFFFF07DDDDDDDDDDD0F87777787787FFFFFFFFF + FF07D0888888888887F000FF0000F07DDDDDDDDDDD0F88888888887F000FF000 + 0F07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0880000080087F00000000FF07DDDDDDDDDDD0F80000080087F00000000 + FF07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0888888888887FFFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D07777777777777777777777707DCCCCDCCDDD0777777777777777777777 + 7707D0888888888887FFFFFFFFFFF07DCCCCCCCCDD0F88888888887FFFFFFFFF + FF07D0880000000887F000000000F07DCCCCDCCDDD0F80000000887F00000000 + 0F07D0888888888887FFFFFFFFFFF07DCDDDDCDDDD0F88888888887FFFFFFFFF + FF07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0880000000887F000000F00F07DDDDDDDDDDD0F80000000887F000000F0 + 0F07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0888888888887FFFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D07777777777777777777777707DCCCCDCCDDD0777777777777777777777 + 7707D0888888888887FFFFFFFFFFF07DCCCCCCCCDD0F88888888887FFFFFFFFF + FF07D0880000008887F00000FF00F07DCCCCDCCDDD0F80000008887F00000FF0 + 0F07D0888888888887FFFFFFFFFFF07DCDDDDCDDDD0F88888888887FFFFFFFFF + FF07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0880000000887F00000000FF07DDDDDDDDDDD0F80000000887F00000000 + FF07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgRefinements: TImage + Left = 8 + Top = 100 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777888888888 + 807DD0888888888887FFFFFFFFFF07DDCDDDDCDDDD0888888888887FFFFFFFFF + F07DD0888888888887FF7FFFFFFF07DDCCCCDCCDDD0888888888887FF777777F + F07DD0888888888887FF70888FFF07DDCCCCCCCCDD0888888888887FF7FFFF7F + F07DD0880000000887FF70FF8FFF07DDCCCCDCCDDD0880000000887FF7F00F7F + F07DD0888888888887FF70FF8FFF07DDCDDDDCDDDD0888888888887FF7F00F7F + F07DD0880008888887FF70000FFF07DDDDDDDDDDDD0880008888887FF7FFFF7F + F07DD0888888888887FF777777FF07DDDDDDDDDDDD0888888888887FF777777F + F07DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777888888888 + 807DD0888888888887FFFFFFFFFF07DDCDDDDCDDDD0888888888887FFFFFFFFF + F07DD0888888888887FFFFFFFFFF07DDCCCCDCCDDD0888888888887FFFFFFFFF + F07DD0888888888887FFCCCCCFFF07DDCCCCCCCCDD0888888888887FFFFFFFFF + F07DD0880000000887FCCCCCCCFF07DDCCCCDCCDDD0888888888887FFFFFFFFF + F07DD0888888888887FFCCCCCFFF07DDCDDDDCDDDD0888888888887FFFFFFFFF + F07DD0880000000887F9999999FF07DDDDDDDDDDDD0880000000887F88888FFF + F07DD0888888888887FF99999FFF07DDDDDDDDDDDD0888888888887F888888FF + F07DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777888888888 + 807DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0888888888887FF888FFFFF07DDDDDDDDDDDD0888888888887FF888FFFF + F07DD0880000888887FFFFFFFFFF07DDDDDDDDDDDD0880000888887FFFFFFFFF + F07DD0880000000087FF888888FF07DDDDDDDDDDDD0880000000087FF888888F + F07DD0888888888887FF888888FF07DDDDDDDDDDDD0888888888887FF888888F + F07DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblRefinements: TLabel + Left = 5 + Top = 78 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlRefinements: TBevel + Left = 70 + Top = 82 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object cbxLookAndFeel: TComboBox + Left = 90 + Top = 37 + Width = 202 + Height = 21 + Style = csDropDownList + ItemHeight = 0 + TabOrder = 0 + OnChange = cbxLookAndFeelChange + end + object chbxSuppressBackgroundBitmaps: TCheckBox + Tag = 1 + Left = 90 + Top = 97 + Width = 200 + Height = 17 + Caption = 'Suppress Background Textures' + TabOrder = 1 + OnClick = OptionsFormattingChanged + end + object chbxSuppressContentColoration: TCheckBox + Tag = 2 + Left = 90 + Top = 121 + Width = 200 + Height = 17 + Caption = 'Suppress Content Coloration' + TabOrder = 2 + OnClick = OptionsFormattingChanged + end + end + object tshStyles: TTabSheet + Caption = 'Styles' + ImageIndex = 4 + object bvlStyles: TBevel + Left = 115 + Top = 13 + Width = 181 + Height = 4 + Shape = bsBottomLine + end + object bvlStyleSheets: TBevel + Left = 72 + Top = 259 + Width = 224 + Height = 5 + Shape = bsBottomLine + end + object lblStyleSheets: TLabel + Left = 6 + Top = 255 + Width = 60 + Height = 13 + Caption = 'Style Sheets' + end + object bvlStylesHost: TBevel + Left = 6 + Top = 33 + Width = 214 + Height = 183 + end + object Label1: TLabel + Left = 77 + Top = 118 + Width = 68 + Height = 13 + Caption = '[ Styles Host ]' + Visible = False + end + object lblUseNativeStyles: TLabel + Left = 24 + Top = 9 + Width = 84 + Height = 13 + Caption = '&Use Native Styles' + FocusControl = chbxUseNativeStyles + OnClick = lblUseNativeStylesClick + end + object btnStyleColor: TButton + Left = 228 + Top = 61 + Width = 68 + Height = 23 + Caption = 'Co&lor...' + TabOrder = 2 + OnClick = btnStyleColorClick + end + object btnStyleFont: TButton + Left = 228 + Top = 33 + Width = 68 + Height = 23 + Caption = '&Font...' + TabOrder = 1 + OnClick = btnStyleFontClick + end + object btnStyleBackgroundBitmap: TButton + Left = 228 + Top = 97 + Width = 68 + Height = 23 + Caption = '&Bitmap...' + TabOrder = 3 + OnClick = btnStyleBackgroundBitmapClick + end + object chbxUseNativeStyles: TCheckBox + Left = 5 + Top = 8 + Width = 15 + Height = 17 + TabStop = False + Caption = '&Use Native Styles' + TabOrder = 0 + OnClick = OptionsFormattingChanged + end + object btnStyleSheetNew: TButton + Left = 6 + Top = 307 + Width = 68 + Height = 23 + Caption = '&New...' + TabOrder = 7 + OnClick = btnStyleSheetNewClick + end + object btnStyleSheetCopy: TButton + Left = 79 + Top = 307 + Width = 68 + Height = 23 + Caption = '&Copy...' + TabOrder = 8 + OnClick = btnStyleSheetCopyClick + end + object btnStyleSheetDelete: TButton + Left = 153 + Top = 307 + Width = 68 + Height = 23 + Caption = '&Delete...' + TabOrder = 9 + OnClick = btnStyleSheetDeleteClick + end + object btnStylesSaveAs: TButton + Left = 116 + Top = 223 + Width = 105 + Height = 23 + Caption = 'Save &As...' + TabOrder = 6 + OnClick = btnStylesSaveAsClick + end + object btnStyleSheetRename: TButton + Left = 226 + Top = 307 + Width = 68 + Height = 23 + Caption = '&Rename...' + TabOrder = 10 + OnClick = btnStyleSheetRenameClick + end + object btnStyleBackgroundBitmapClear: TButton + Left = 228 + Top = 125 + Width = 68 + Height = 23 + Caption = 'Clear' + TabOrder = 4 + OnClick = btnStyleClearClick + end + object btnStyleRestoreDefaults: TButton + Left = 6 + Top = 223 + Width = 105 + Height = 23 + Caption = 'Restore Defaults' + TabOrder = 5 + OnClick = btnStyleRestoreDefaultsClick + end + object cbxStyleSheets: TComboBox + Left = 9 + Top = 274 + Width = 288 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 11 + OnClick = cbxStyleSheetsClick + OnDrawItem = cbxStyleSheetsDrawItem + OnKeyDown = cbxStyleSheetsKeyDown + end + end + end + object pnlPreview: TPanel + Left = 309 + Top = 39 + Width = 382 + Height = 315 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + object PreviewPivotGrid: TcxPivotGrid + Left = 5 + Top = 5 + Width = 371 + Height = 302 + Enabled = False + Groups = < + item + IsCaptionAssigned = True + Caption = 'FieldsGroup 1' + end> + TabOrder = 0 + TabStop = True + object pgfPurchaseQuarter: TcxPivotGridField + Area = faColumn + AreaIndex = 0 + IsCaptionAssigned = True + Caption = 'Purchase Quarter' + DataBinding.ValueType = 'DateTime' + GroupIndex = 0 + GroupInterval = giDateQuarter + Visible = True + end + object pgfPurchaseMonth: TcxPivotGridField + Area = faColumn + AreaIndex = 1 + IsCaptionAssigned = True + Caption = 'Purchase Month' + DataBinding.ValueType = 'DateTime' + GroupIndex = 0 + GroupExpanded = False + GroupInterval = giDateMonth + Visible = True + end + object pgfPaymentType: TcxPivotGridField + Tag = 1 + Area = faRow + AreaIndex = 0 + IsCaptionAssigned = True + Caption = 'Payment Type' + DataBinding.ValueType = 'String' + Visible = True + Width = 90 + end + object pgfQuantity: TcxPivotGridField + Tag = 2 + Area = faData + AreaIndex = 0 + IsCaptionAssigned = True + Caption = 'Quantity' + DataBinding.ValueType = 'Integer' + Visible = True + Width = 62 + end + object pgfCarName: TcxPivotGridField + Tag = 3 + AreaIndex = 1 + IsCaptionAssigned = True + Caption = 'Car Name' + DataBinding.ValueType = 'String' + Visible = True + end + object pgfUnitPrice: TcxPivotGridField + Tag = 4 + AreaIndex = 0 + IsCaptionAssigned = True + Caption = 'Unit Price' + DataBinding.ValueType = 'Currency' + Visible = True + end + object pgfCompanyName: TcxPivotGridField + Tag = 5 + Area = faRow + AreaIndex = 1 + IsCaptionAssigned = True + Caption = 'Company Name' + DataBinding.ValueType = 'String' + Visible = True + Width = 90 + end + object pgfPaymentAmount: TcxPivotGridField + Tag = 6 + Area = faData + AreaIndex = 1 + IsCaptionAssigned = True + Caption = 'Payment Amount' + DataBinding.ValueType = 'Currency' + Visible = True + end + end + end + object lblPreviewWindow: TStaticText + Left = 314 + Top = 24 + Width = 82 + Height = 14 + AutoSize = False + Caption = 'Preview' + TabOrder = 2 + end + object cxStyleRepository1: TcxStyleRepository + Left = 4 + Top = 368 + object styleCategory: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWindowText + end + object styleHeader: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWindowText + end + object styleContent: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWindowText + end + end + object pmStyles: TPopupMenu + Images = ilStylesPopup + OnPopup = pmStylesPopup + Left = 32 + Top = 368 + object miStyleFont: TMenuItem + Caption = '&Font...' + ImageIndex = 0 + ShortCut = 16454 + OnClick = btnStyleFontClick + end + object miStyleColor: TMenuItem + Caption = '&Color...' + ShortCut = 16451 + OnClick = btnStyleColorClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miStyleBackgroundBitmap: TMenuItem + Caption = '&Bitmap...' + ImageIndex = 1 + OnClick = btnStyleBackgroundBitmapClick + end + object miStyleBackgroundBitmapClear: TMenuItem + Caption = 'Clear' + ImageIndex = 3 + ShortCut = 16430 + OnClick = btnStyleClearClick + end + object milLine: TMenuItem + Caption = '-' + end + object miStylesSelectAll: TMenuItem + Caption = 'Select A&ll' + ShortCut = 16449 + OnClick = miStylesSelectAllClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miStyleRestoreDefaults: TMenuItem + Caption = 'Restore Defaults' + OnClick = btnStyleRestoreDefaultsClick + end + object miLine4: TMenuItem + Caption = '-' + end + object miStylesSaveAs: TMenuItem + Caption = 'Save &As...' + ImageIndex = 2 + ShortCut = 16467 + OnClick = btnStylesSaveAsClick + end + end + object ilStylesPopup: TImageList + Left = 60 + Top = 368 + Bitmap = { + 494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00000000000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF000000 + 0000008080000080800000808000008080000080800000808000008080000080 + 8000008080000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000000000000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000008080000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF00FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800080808000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00C0C0C00000FFFF00C0C0C000FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000000000008080800080808000000000008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C00000000000C0C0C00000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFC001FFFF + FE07001F8001FFF9FF9F000F8001E7FFFF9F00078001C3F3E01F00038001C3E7 + F99F00018001E1C7F99B00008001F08FF99B00018001F81FF89300018001FC3F + D80300018001F81FD9BF80018001F09FC93FE0018001C1C7C03FE001800183E3 + FFFFE00180018FF1FFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxPivotGridLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxPivotGridLnk.pas new file mode 100644 index 00000000..50e9e46a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxPivotGridLnk.pas @@ -0,0 +1,2005 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxPivotGridLnk; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, {$IFDEF DELPHI6} Variants, {$ENDIF} Classes, Graphics, + Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls, ImgList, Menus, cxStyles, + cxControls, dxPSUtl, cxLookAndFeels, cxLookAndFeelPainters, cxCustomPivotGrid, + cxDBPivotGrid, dxPSCore, dxPSGlbl, dxPScxCommon, cxGraphics, cxContainer, cxEdit, + cxTextEdit, cxMaskEdit, cxDropDownEdit, cxClasses, cxPivotGrid, cxCustomData; + +const + + // visual print style indexes + vspsPGridFirst = 0; + vspsPGridColumnHeader = vspsPGridFirst + 0; + vspsPGridContent = vspsPGridFirst + 1; + vspsPGridFieldHeader = vspsPGridFirst + 2; + vspsPGridHeaderBackground = vspsPGridFirst + 3; + vspsPGridRowHeader = vspsPGridFirst + 4; + vspsPGridLast = vspsPGridRowHeader; + + // + cxPivotGridAttributeIDBase = 0; + cxPivotGridDataCellID = cxPivotGridAttributeIDBase + 1; + cxPivotGridFieldHeaderCellID = cxPivotGridAttributeIDBase + 2; + cxPivotGridGroupHeaderCellID = cxPivotGridAttributeIDBase + 3; + +type + TcxPivotGridReportLink = class; + TcxfmPivotGridReportLinkDesignWindow = class; + + { TcxPivotGridReportLinkOptionsExpanding } + + TcxPivotGridReportLinkOptionsExpanding = class(TdxCustomReportLinkOptionsExpanding) + private + FAutoExpandColumns: Boolean; + FAutoExpandRows: Boolean; + procedure SetAutoExpandColumns(AValue: Boolean); + procedure SetAutoExpandRows(AValue: Boolean); + protected + procedure AssignToPivot(APivotGrid: TcxCustomPivotGrid); virtual; + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property AutoExpandColumns: Boolean read FAutoExpandColumns write SetAutoExpandColumns default False; + property AutoExpandRows: Boolean read FAutoExpandRows write SetAutoExpandRows default False; + end; + + { TcxPivotGridReportLinkOptionsView } + + TcxPivotGridReportLinkOptionsView = class(TdxCustomReportLinkOptionsView) + private + FBorders: Boolean; + FColumnFields: Boolean; + FDataFields: Boolean; + FExpandButtons: Boolean; + FFilterFields: Boolean; + FGridLines: TcxPivotGridLines; + FRowFields: Boolean; + procedure SetBorders(AValue: Boolean); + procedure SetColumnFields(AValue: Boolean); + procedure SetDataFields(AValue: Boolean); + procedure SetExpandButtons(AValue: Boolean); + procedure SetFilterFields(AValue: Boolean); + procedure SetGridLines(AValue: TcxPivotGridLines); + procedure SetRowFields(AValue: Boolean); + protected + procedure AssignToPivot(APivotGrid: TcxCustomPivotGrid); virtual; + procedure SetBoolValue(var AField: Boolean; ANewValue: Boolean); + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property Borders: Boolean read FBorders write SetBorders default True; + property ColumnFields: Boolean read FColumnFields write SetColumnFields default True; + property DataFields: Boolean read FDataFields write SetDataFields default True; + property ExpandButtons: Boolean read FExpandButtons write SetExpandButtons default True; + property FilterFields: Boolean read FFilterFields write SetFilterFields default False; + property GridLines: TcxPivotGridLines read FGridLines write SetGridLines default pglBoth; + property RowFields: Boolean read FRowFields write SetRowFields default True; + end; + + { TcxPivotGridReportLinkOptionsFormatting } + + TcxPivotGridReportLinkOptionsFormatting = class(TdxCustomReportLinkOptionsFormatting) + private + FSuppressContentColoration: Boolean; + procedure SetSuppressContentColoration(AValue: Boolean); + protected + procedure AssignToPivot(APivotGrid: TcxCustomPivotGrid); virtual; + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property SuppressContentColoration: Boolean read FSuppressContentColoration write SetSuppressContentColoration default False; + property UseLookAndFeelColors; + end; + + { TcxPivotGridReportLinkStyles } + + TcxPivotGridReportLinkStyles = class(TdxCustomReportLinkStyles, IcxPivotGridBaseStyles) + private + function GetReportLink: TcxPivotGridReportLink; + protected + procedure AssignToPivot(AFromGrid, ADestGrid: TcxCustomPivotGrid; AUsePivotStyles: Boolean); virtual; + function DesignerTabIndex: Integer; override; + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + class function GetStyleCaption(AnIndex: Integer): string; override; + function GetStyleIndexByCaption(const Caption: string): Integer; override; + function UsePivotStyles: Boolean; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + function GetColumnHeaderParams(AColumn: TcxPivotGridViewDataItem): TcxViewParams; + function GetContentParams(ACell: TcxPivotGridDataCellViewInfo): TcxViewParams; + function GetFieldHeaderParams(AField: TcxPivotGridField): TcxViewParams; + function GetHeaderBackgroundParams(AArea: TcxPivotGridFieldArea): TcxViewParams; + function GetRowHeaderParams(ARow: TcxPivotGridViewDataItem): TcxViewParams; + + property ReportLink: TcxPivotGridReportLink read GetReportLink; + published + property ColumnHeader: TcxStyle index vspsPGridColumnHeader read GetValue write SetValue; + property Content: TcxStyle index vspsPGridContent read GetValue write SetValue; + property FieldHeader: TcxStyle index vspsPGridFieldHeader read GetValue write SetValue; + property HeaderBackground: TcxStyle index vspsPGridHeaderBackground read GetValue write SetValue; + property RowHeader: TcxStyle index vspsPGridRowHeader read GetValue write SetValue; + property StyleSheet; + end; + + TcxPivotGridReportLinkStylesClass = class of TcxPivotGridReportLinkStyles; + + { TcxPivotGridReportLinkStyleSheet } + + TcxPivotGridReportLinkStyleSheet = class(TdxCustomReportLinkStyleSheet) + private + function GetStylesValue: TcxPivotGridReportLinkStyles; + procedure SetStylesValue(AValue: TcxPivotGridReportLinkStyles); + public + class function GetStylesClass: TcxCustomStylesClass; override; + published + property Styles: TcxPivotGridReportLinkStyles read GetStylesValue write SetStylesValue; + end; + + { TcxPivotGridReportLink } + + TcxPivotGridReportLinkCustomDrawDataCellEventEvent = procedure(Sender: TcxPivotGridReportLink; + ACanvas: TCanvas; AnItem: TdxReportCellText; var ADone: Boolean) of object; + + TcxPivotGridReportLinkCustomDrawFieldHeaderCellEvent = procedure(Sender: TcxPivotGridReportLink; + ACanvas: TCanvas; AnItem: TdxReportCell; var ADone: Boolean) of object; + + TcxPivotGridReportLinkCustomDrawGroupHeaderCellEvent = procedure(Sender: TcxPivotGridReportLink; + ACanvas: TCanvas; AnItem: TdxReportCell; var ADone: Boolean) of object; + + TcxPivotGridReportLinkInitializeDataCellEvent = procedure(Sender: TcxPivotGridReportLink; + ACell: TcxPivotGridDataCellViewInfo; AnItem: TdxReportCellText) of object; + + TcxPivotGridReportLinkInitializeFieldHeaderCellEvent = procedure(Sender: TcxPivotGridReportLink; + ACell: TcxPivotGridFieldHeaderCellViewInfo; AnItem: TdxReportCell) of object; + + TcxPivotGridReportLinkInitializeGroupHeaderCellEvent = procedure(Sender: TcxPivotGridReportLink; + ACell: TcxPivotGridHeaderCellViewInfo; AnItem: TdxReportCell) of object; + + TcxPivotGridReportLink = class(TdxCustomcxControlReportLink) + private + FHostCell: TdxReportCell; + FLookAndFeelItems: TList; + FOnCustomDrawDataCell: TcxPivotGridReportLinkCustomDrawDataCellEventEvent; + FOnCustomDrawFieldHeaderCell: TcxPivotGridReportLinkCustomDrawFieldHeaderCellEvent; + FOnCustomDrawGroupHeaderCell: TcxPivotGridReportLinkCustomDrawGroupHeaderCellEvent; + FOnInitializeDataCell: TcxPivotGridReportLinkInitializeDataCellEvent; + FOnInitializeFieldHeaderCell: TcxPivotGridReportLinkInitializeFieldHeaderCellEvent; + FOnInitializeGroupHeaderCell: TcxPivotGridReportLinkInitializeGroupHeaderCellEvent; + function GetActiveStyles: TcxPivotGridReportLinkStyles; + function GetDesignWindow: TcxfmPivotGridReportLinkDesignWindow; + function GetGridLineColor: TColor; + function GetOptionsExpanding: TcxPivotGridReportLinkOptionsExpanding; + function GetOptionsFormatting: TcxPivotGridReportLinkOptionsFormatting; + function GetOptionsView: TcxPivotGridReportLinkOptionsView; + + function GetStyles: TcxPivotGridReportLinkStyles; + function GetPivotGrid: TcxCustomPivotGrid; + procedure SetOptionsExpanding(AValue: TcxPivotGridReportLinkOptionsExpanding); + procedure SetOptionsFormatting(AValue: TcxPivotGridReportLinkOptionsFormatting); + procedure SetOptionsView(AValue: TcxPivotGridReportLinkOptionsView); + procedure SetStyles(AValue: TcxPivotGridReportLinkStyles); + protected + procedure BuildReport; virtual; + procedure ConstructReport(AReportCells: TdxReportCells); override; + procedure ConvertCoords; override; + procedure CustomDraw(AItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); override; + + procedure DoCustomDrawDataCell(ACanvas: TCanvas; AItem: TdxReportCellString; var ADone: Boolean); virtual; + procedure DoCustomDrawFieldHeaderCell(ACanvas: TCanvas; AItem: TdxReportCell; var ADone: Boolean); virtual; + procedure DoCustomDrawGroupHeaderCell(ACanvas: TCanvas; AItem: TdxReportCell; var ADone: Boolean); virtual; + procedure DoInitializeDataCell(AItem: TdxReportCellString; ACell: TcxPivotGridDataCellViewInfo); virtual; + procedure DoInitializeFieldHeaderCell(AItem: TdxReportCell; ACell: TcxPivotGridFieldHeaderCellViewInfo); virtual; + procedure DoInitializeGroupHeaderCell(AItem: TdxReportCell; ACell: TcxPivotGridHeaderCellViewInfo); virtual; + + procedure GetImageLists(AProc: TdxPSGetImageListProc); override; + procedure InternalRestoreFromOriginal; override; + function IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; override; + procedure FormatLookAndFeelItems; + function GetEdgeMode: TdxCellEdgeMode; + function GetOptionsExpandingClass: TdxCustomReportLinkOptionsExpandingClass; override; + function GetOptionsFormattingClass: TdxCustomReportLinkOptionsFormattingClass; override; + function GetOptionsViewClass: TdxCustomReportLinkOptionsViewClass; override; + + function GetAreNativeStylesAvailable: Boolean; override; + function GetStylesClass: TdxCustomReportLinkStylesClass; override; + function GetStyleSheetClass: TdxCustomReportLinkStyleSheetClass; override; + function GetStyleSheetPrototype: TdxCustomReportLinkStyleSheet; override; + procedure PrepareConstruct; override; + procedure UnprepareConstruct; override; + // + procedure AddDataCell(ACell: TcxPivotGridDataCellViewInfo); + procedure AddFieldHeaderCell(ACell: TcxPivotGridFieldHeaderCellViewInfo); + procedure AddHeaderCell(ACell: TcxPivotGridHeaderCellViewInfo); + function CreateHeaderCell(ACell: TcxPivotGridHeaderCellViewInfo; AttributeID: Integer): TdxReportCell; + + procedure InitializeOptionsBeforeBuildReport(AController: TcxPivotGridExportController); virtual; + procedure ProcessCreateReportItems(AViewInfo: TcxPivotGridViewInfo); virtual; + procedure RegisterLookAndFeelItem(AItem: TdxReportVisualItem; AEdgeStyle: TdxCellEdgeStyle); + procedure SetCellViewParams(ACell: TdxReportVisualItem; const AParams: TcxViewParams); + procedure SetCellViewParamsEx(ACell: TdxReportVisualItem; + const AParams: TdxReportItemViewParams); + + property ActiveStyles: TcxPivotGridReportLinkStyles read GetActiveStyles; + property GridLineColor: TColor read GetGridLineColor; + property HostCell: TdxReportCell read FHostCell; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + property DesignWindow: TcxfmPivotGridReportLinkDesignWindow read GetDesignWindow; + property LookAndFeelItems: TList read FLookAndFeelItems; + property PivotGrid: TcxCustomPivotGrid read GetPivotGrid; + published + property Color; + property Font; + property OptionsExpanding: TcxPivotGridReportLinkOptionsExpanding read GetOptionsExpanding write SetOptionsExpanding; + property OptionsFormatting: TcxPivotGridReportLinkOptionsFormatting read GetOptionsFormatting write SetOptionsFormatting; + property OptionsView: TcxPivotGridReportLinkOptionsView read GetOptionsView write SetOptionsView; + property ScaleFonts; + property StyleRepository; + property Styles: TcxPivotGridReportLinkStyles read GetStyles write SetStyles; + property SupportedCustomDraw; + property OnCustomDrawDataCell: TcxPivotGridReportLinkCustomDrawDataCellEventEvent read FOnCustomDrawDataCell write FOnCustomDrawDataCell; + property OnCustomDrawFieldHeaderCell: TcxPivotGridReportLinkCustomDrawFieldHeaderCellEvent read FOnCustomDrawFieldHeaderCell write FOnCustomDrawFieldHeaderCell; + property OnCustomDrawGroupHeaderCell: TcxPivotGridReportLinkCustomDrawGroupHeaderCellEvent read FOnCustomDrawGroupHeaderCell write FOnCustomDrawGroupHeaderCell; + property OnInitializeDataCell: TcxPivotGridReportLinkInitializeDataCellEvent read FOnInitializeDataCell write FOnInitializeDataCell; + property OnInitializeFieldHeaderCell: TcxPivotGridReportLinkInitializeFieldHeaderCellEvent read FOnInitializeFieldHeaderCell write FOnInitializeFieldHeaderCell; + property OnInitializeGroupHeaderCell: TcxPivotGridReportLinkInitializeGroupHeaderCellEvent read FOnInitializeGroupHeaderCell write FOnInitializeGroupHeaderCell; + end; + + TcxfmPivotGridReportLinkDesignWindow = class(TdxfmCustomcxControlReportLinkDesignWindow) + PageControl1: TPageControl; + tshView: TTabSheet; + lblShow: TLabel; + bvlShow: TBevel; + chbxColumnFields: TCheckBox; + chbxShowExpandButtons: TCheckBox; + chbxHorizontalLines: TCheckBox; + chbxVerticalLines: TCheckBox; + tshBehaviors: TTabSheet; + lblExpanding: TLabel; + bvlExpanding: TBevel; + chbxExpandRows: TCheckBox; + tshFormatting: TTabSheet; + lblLookAndFeel: TLabel; + bvlLookAndFeel: TBevel; + imgLookAndFeel: TImage; + imgRefinements: TImage; + lblRefinements: TLabel; + bvlRefinements: TBevel; + cbxLookAndFeel: TComboBox; + chbxSuppressBackgroundBitmaps: TCheckBox; + tshStyles: TTabSheet; + bvlStyles: TBevel; + bvlStyleSheets: TBevel; + lblStyleSheets: TLabel; + bvlStylesHost: TBevel; + Label1: TLabel; + btnStyleColor: TButton; + btnStyleFont: TButton; + btnStyleBackgroundBitmap: TButton; + chbxUseNativeStyles: TCheckBox; + btnStyleSheetNew: TButton; + btnStyleSheetCopy: TButton; + btnStyleSheetDelete: TButton; + btnStylesSaveAs: TButton; + btnStyleSheetRename: TButton; + btnStyleBackgroundBitmapClear: TButton; + btnStyleRestoreDefaults: TButton; + pnlPreview: TPanel; + cxStyleRepository1: TcxStyleRepository; + styleCategory: TcxStyle; + styleHeader: TcxStyle; + styleContent: TcxStyle; + pmStyles: TPopupMenu; + miStyleFont: TMenuItem; + miStyleColor: TMenuItem; + miLine3: TMenuItem; + miStyleBackgroundBitmap: TMenuItem; + miStyleBackgroundBitmapClear: TMenuItem; + milLine: TMenuItem; + miStylesSelectAll: TMenuItem; + miLine2: TMenuItem; + miStyleRestoreDefaults: TMenuItem; + miLine4: TMenuItem; + miStylesSaveAs: TMenuItem; + ilStylesPopup: TImageList; + chbxExpandColumns: TCheckBox; + chbxSuppressContentColoration: TCheckBox; + lblUseNativeStyles: TLabel; + cbxStyleSheets: TComboBox; + chbxBorders: TCheckBox; + chbxDataFields: TCheckBox; + chbxFilterFields: TCheckBox; + chbxRowFields: TCheckBox; + Bevel1: TBevel; + imgExpanding: TImage; + Image1: TImage; + imgCardFraming: TImage; + lblCardFraming: TLabel; + PreviewPivotGrid: TcxPivotGrid; + pgfPurchaseQuarter: TcxPivotGridField; + pgfPurchaseMonth: TcxPivotGridField; + pgfPaymentType: TcxPivotGridField; + pgfQuantity: TcxPivotGridField; + pgfCarName: TcxPivotGridField; + pgfUnitPrice: TcxPivotGridField; + pgfCompanyName: TcxPivotGridField; + pgfPaymentAmount: TcxPivotGridField; + lblPreviewWindow: TStaticText; + procedure OptionsFormattingChanged(Sender: TObject); + procedure btnStyleFontClick(Sender: TObject); + procedure btnStyleColorClick(Sender: TObject); + procedure btnStyleBackgroundBitmapClick(Sender: TObject); + procedure btnStyleClearClick(Sender: TObject); + procedure lblUseNativeStylesClick(Sender: TObject); + procedure pmStylesPopup(Sender: TObject); + procedure miStylesSelectAllClick(Sender: TObject); + procedure btnStyleRestoreDefaultsClick(Sender: TObject); + procedure btnStylesSaveAsClick(Sender: TObject); + procedure btnStyleSheetNewClick(Sender: TObject); + procedure btnStyleSheetCopyClick(Sender: TObject); + procedure btnStyleSheetDeleteClick(Sender: TObject); + procedure btnStyleSheetRenameClick(Sender: TObject); + procedure cbxStyleSheetsClick(Sender: TObject); + procedure cbxStyleSheetsKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure cbxStyleSheetsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure cbxLookAndFeelChange(Sender: TObject); + procedure chbxExpandOptionsClick(Sender: TObject); + procedure chbxOptionsViewClick(Sender: TObject); + private + function GetActiveStyle: TcxStyle; + function GetHasSelectedStyles: Boolean; + function GetHasSelectedStylesWithAssignedBitmap: Boolean; + function GetReportLink: TcxPivotGridReportLink; + procedure lbxStylesClick(Sender: TObject); + protected + lbxStyles: TdxStylesListBox; + procedure CreateControls; virtual; + function CanSelectAllStyles: Boolean; + procedure DoInitialize; override; + // + procedure DoActiveStyleSheetChanged; override; + procedure DoFormActivated(AnActive: Boolean); override; + procedure DoRefreshStylesList; override; + procedure DoStyleChanged(const ACaption: string; AStyle: TcxStyle); override; + procedure DoStylesChanged(AStrings: TStrings; ARecreate: Boolean); override; + + procedure GetSelectedStyleNames(AStrings: TStrings); override; + procedure GetStyleNames(out AStrings: TStrings); override; + procedure GetStyleSheetNames(out AStrings: TStrings); override; + procedure LoadCaption(AControl: TControl; StrPtr: Pointer); overload; + procedure LoadCaption(AItem: TMenuItem; StrPtr: Pointer); overload; + procedure LoadPreviewData; + procedure LoadStrings; override; + procedure LoadStringsCombo(ACombo: TComboBox; ACaptions: array of Pointer); + + procedure RecreateStylesListBox; + procedure RestoreSelectedStyles(AList: TList); + procedure SaveSelectedStyles(AList: TList); + // + procedure UpdateControlsState; override; + procedure UpdateEnabled(AControl: TControl; AEnabled: Boolean); overload; + procedure UpdateEnabled(AItem: TMenuItem; AEnabled: Boolean); overload; + procedure UpdateEnabledControls(AControls: array of TControl; AEnabled: Boolean); + procedure UpdatePreview; override; + + property ActiveStyle: TcxStyle read GetActiveStyle; + property HasSelectedStyles: Boolean read GetHasSelectedStyles; + property HasSelectedStylesWithAssignedBitmap: Boolean read GetHasSelectedStylesWithAssignedBitmap; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + property ReportLink: TcxPivotGridReportLink read GetReportLink; + end; + +implementation + +uses Math, dxPSRes, dxPSPopupMan; + +{$R *.dfm} +{$R dxPScxPivotGridLnk.res} + +type + TControlAccess = class(TControl); + TcxPivotGridAccess = class(TcxCustomPivotGrid); + TcxPivotGridViewDataAccess = class(TcxPivotGridViewData); + TcxPivotGridStylesAccess = class(TcxPivotGridStyles); + +var + FDefaultdxPScxPivotGridLinkStyleSheet: TcxPivotGridReportLinkStyleSheet; + +// +function DefaultdxPScxPivotGridLinkStyleSheet: TcxPivotGridReportLinkStyleSheet; + + function CreateStyle(AColor: TColor; AFontColor: TColor): TcxStyle; + begin + Result := TcxStyle.Create(DefaultdxPScxPivotGridLinkStyleSheet); + with Result do + begin + Color := AColor; + Font.Name := dxPSCore.dxPSDefaultFontName; + Font.Color := AFontColor; + end; + end; + +begin + if FDefaultdxPScxPivotGridLinkStyleSheet = nil then + begin + FDefaultdxPScxPivotGridLinkStyleSheet := TcxPivotGridReportLinkStyleSheet.Create(nil); + with FDefaultdxPScxPivotGridLinkStyleSheet.Styles as TcxPivotGridReportLinkStyles do + begin + ColumnHeader := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + FieldHeader := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + RowHeader := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Content := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + HeaderBackground := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + end; + end; + Result := FDefaultdxPScxPivotGridLinkStyleSheet; +end; + +{ TcxPivotGridReportLinkOptionsExpanding } + +procedure TcxPivotGridReportLinkOptionsExpanding.AssignToPivot( + APivotGrid: TcxCustomPivotGrid); +begin + TcxPivotGridViewDataAccess(APivotGrid.ViewData). + ExpandColumns := AutoExpandColumns; + TcxPivotGridViewDataAccess(APivotGrid.ViewData). + ExpandRows := AutoExpandRows; +end; + +function TcxPivotGridReportLinkOptionsExpanding.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +procedure TcxPivotGridReportLinkOptionsExpanding.Assign(Source: TPersistent); +begin + if Source is TcxPivotGridReportLinkOptionsExpanding then + with TcxPivotGridReportLinkOptionsExpanding(Source) do + begin + Self.FAutoExpandColumns := FAutoExpandColumns; + Self.FAutoExpandRows := FAutoExpandRows; + end; + inherited Assign(Source); +end; + +procedure TcxPivotGridReportLinkOptionsExpanding.RestoreDefaults; +begin + inherited RestoreDefaults; + FAutoExpandColumns := False; + FAutoExpandRows := False; +end; + +procedure TcxPivotGridReportLinkOptionsExpanding.SetAutoExpandColumns( + AValue: Boolean); +begin + if FAutoExpandColumns <> AValue then + begin + FAutoExpandColumns := AValue; + Changed; + end; +end; + +procedure TcxPivotGridReportLinkOptionsExpanding.SetAutoExpandRows( + AValue: Boolean); +begin + if FAutoExpandRows <> AValue then + begin + FAutoExpandRows := AValue; + Changed; + end; +end; + +{ TcxPivotGridReportLinkOptionsView } + +procedure TcxPivotGridReportLinkOptionsView.Assign(Source: TPersistent); +begin + if Source is TcxPivotGridReportLinkOptionsView then + with TcxPivotGridReportLinkOptionsView(Source) do + begin + Self.FColumnFields := FColumnFields; + Self.FDataFields := FDataFields; + self.FBorders := FBorders; + Self.FExpandButtons := FExpandButtons; + Self.FFilterFields := FFilterFields; + Self.FGridLines := FGridLines; + Self.FRowFields := FRowFields; + end; + inherited Assign(Source); +end; + +procedure TcxPivotGridReportLinkOptionsView.RestoreDefaults; +begin + FColumnFields := True; + FDataFields := True; + FBorders := True; + FExpandButtons := True; + FFilterFields := False; + FGridLines := pglBoth; + FRowFields := True; +end; + +procedure TcxPivotGridReportLinkOptionsView.AssignToPivot( + APivotGrid: TcxCustomPivotGrid); +begin + APivotGrid.OptionsView.ColumnFields := ColumnFields; + APivotGrid.OptionsView.DataFields := DataFields; + APivotGrid.OptionsView.FilterFields := FilterFields; + APivotGrid.OptionsView.RowFields := RowFields; + APivotGrid.OptionsView.GridLines := GridLines; + TcxPivotGridAccess(APivotGrid).ViewInfo.DrawBorders := Borders; + TcxPivotGridAccess(APivotGrid).ViewInfo.DrawExpandButtons := ExpandButtons; +end; + +procedure TcxPivotGridReportLinkOptionsView.SetBoolValue( + var AField: Boolean; ANewValue: Boolean); +begin + if AField <> ANewValue then + begin + AField := ANewValue; + Changed; + end; +end; + +function TcxPivotGridReportLinkOptionsView.DesignerTabIndex: Integer; +begin + Result := 0; +end; + +procedure TcxPivotGridReportLinkOptionsView.SetBorders(AValue: Boolean); +begin + if FBorders <> AValue then + begin + FBorders := AValue; + Changed; + end; +end; + +procedure TcxPivotGridReportLinkOptionsView.SetColumnFields(AValue: Boolean); +begin + SetBoolValue(FColumnFields, AValue); +end; + +procedure TcxPivotGridReportLinkOptionsView.SetDataFields(AValue: Boolean); +begin + SetBoolValue(FDataFields, AValue); +end; + +procedure TcxPivotGridReportLinkOptionsView.SetExpandButtons(AValue: Boolean); +begin + SetBoolValue(FExpandButtons, AValue); +end; + +procedure TcxPivotGridReportLinkOptionsView.SetFilterFields(AValue: Boolean); +begin + SetBoolValue(FFilterFields, AValue); +end; + +procedure TcxPivotGridReportLinkOptionsView.SetGridLines( + AValue: TcxPivotGridLines); +begin + if FGridLines <> AValue then + begin + FGridLines := AValue; + Changed; + end; +end; + +procedure TcxPivotGridReportLinkOptionsView.SetRowFields(AValue: Boolean); +begin + SetBoolValue(FRowFields, AValue); +end; + +{ TcxPivotGridReportLinkStyles } + +constructor TcxPivotGridReportLinkStyles.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + BitmapInViewParams := True; +end; + +procedure TcxPivotGridReportLinkStyles.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxPivotGridReportLinkStyles then + with TcxPivotGridReportLinkStyles(Source) do + begin + Self.ColumnHeader := ColumnHeader; + Self.Content := Content; + Self.FieldHeader := FieldHeader; + Self.HeaderBackground := HeaderBackground; + Self.RowHeader := RowHeader; + end; +end; + +function TcxPivotGridReportLinkStyles.GetColumnHeaderParams( + AColumn: TcxPivotGridViewDataItem): TcxViewParams; +begin + if UsePivotStyles then + else + GetViewParams(vspsPGridColumnHeader, AColumn, nil, Result); +end; + +function TcxPivotGridReportLinkStyles.GetContentParams( + ACell: TcxPivotGridDataCellViewInfo): TcxViewParams; +begin + GetViewParams(vspsPGridContent, ACell, nil, Result); +end; + +function TcxPivotGridReportLinkStyles.GetFieldHeaderParams( + AField: TcxPivotGridField): TcxViewParams; +begin + GetViewParams(vspsPGridFieldHeader, AField, nil, Result); +end; + +function TcxPivotGridReportLinkStyles.GetHeaderBackgroundParams( + AArea: TcxPivotGridFieldArea): TcxViewParams; +begin + GetViewParams(vspsPGridHeaderBackground, nil, nil, Result); +end; + +function TcxPivotGridReportLinkStyles.GetRowHeaderParams( + ARow: TcxPivotGridViewDataItem): TcxViewParams; +begin + GetViewParams(vspsPGridRowHeader, ARow, nil, Result); +end; + +procedure TcxPivotGridReportLinkStyles.AssignToPivot( + AFromGrid, ADestGrid: TcxCustomPivotGrid; AUsePivotStyles: Boolean); +begin + if AUsePivotStyles then + ADestGrid.Styles.Assign(AFromGrid.Styles) + else + begin + ADestGrid.Styles.ColumnHeader := ColumnHeader; + ADestGrid.Styles.Content := Content; + ADestGrid.Styles.FieldHeader := FieldHeader; + ADestGrid.Styles.HeaderBackground := HeaderBackground; + ADestGrid.Styles.RowHeader := RowHeader; + end; +end; + +function TcxPivotGridReportLinkStyles.DesignerTabIndex: Integer; +begin + Result := 3; +end; + +procedure TcxPivotGridReportLinkStyles.GetDefaultViewParams( + Index: Integer; AData: TObject; out AParams: TcxViewParams); +begin + inherited GetDefaultViewParams(Index, AData, AParams); + if ReportLink <> nil then + begin + if Index in [vspsPGridColumnHeader, vspsPGridFieldHeader, vspsPGridRowHeader] then + AParams.Color := dxPSCore.dxDefaultFixedColor + else + AParams.Color := dxDefaultContentColor; + AParams.Font := ReportLink.Font; + AParams.TextColor := AParams.Font.Color; + end; +end; + +class function TcxPivotGridReportLinkStyles.GetStyleCaption( + AnIndex: Integer): string; +begin + case AnIndex of + vspsPGridColumnHeader: + Result := cxGetResourceString(@sdxPivotGridColumnHeader); + vspsPGridContent: + Result := cxGetResourceString(@sdxPivotGridContent); + vspsPGridFieldHeader: + Result := cxGetResourceString(@sdxPivotGridFieldHeader); + vspsPGridHeaderBackground: + Result := cxGetResourceString(@sdxPivotGridHeaderBackground); + else + Result := cxGetResourceString(@sdxPivotGridRowHeader); + end; +end; + +function TcxPivotGridReportLinkStyles.GetStyleIndexByCaption( + const Caption: string): Integer; +begin + for Result := vspsPGridFirst to vspsPGridLast do + if dxPSUtl.dxSameText(Caption, GetStyleCaption(Result)) then + Exit; + Result := -1; +end; + +function TcxPivotGridReportLinkStyles.UsePivotStyles: Boolean; +begin + if ReportLink = nil then + begin + Result := False; + Exit; + end; + Result := not ReportLink.OptionsFormatting.UseNativeStyles; + if not Result then + Result := (ReportLink = nil) or (ReportLink.PivotGrid = nil); +end; + +function TcxPivotGridReportLinkStyles.GetReportLink: TcxPivotGridReportLink; +begin + if Owner is TcxPivotGridReportLink then + Result := Owner as TcxPivotGridReportLink + else + Result := nil; +end; + +{ TcxPivotGridReportLinkOptionsFormatting } + +procedure TcxPivotGridReportLinkOptionsFormatting.Assign(Source: TPersistent); +begin + if Source is TcxPivotGridReportLinkOptionsFormatting then + SuppressContentColoration := TcxPivotGridReportLinkOptionsFormatting(Source).SuppressContentColoration; + inherited Assign(Source); +end; + +procedure TcxPivotGridReportLinkOptionsFormatting.RestoreDefaults; +begin + inherited RestoreDefaults; + SuppressContentColoration := False; +end; + +procedure TcxPivotGridReportLinkOptionsFormatting.AssignToPivot( + APivotGrid: TcxCustomPivotGrid); +begin + APivotGrid.LookAndFeel.Kind := LookAndFeelKind; + APivotGrid.LookAndFeel.NativeStyle := False; + with TcxPivotGridStylesAccess(APivotGrid.Styles) do + begin + SuppressContentColoration := Self.SuppressContentColoration; + SuppressBackgroundBitmaps := Self.SuppressBackgroundBitmaps; + end; +end; + +function TcxPivotGridReportLinkOptionsFormatting.DesignerTabIndex: Integer; +begin + Result := 2; +end; + +procedure TcxPivotGridReportLinkOptionsFormatting.SetSuppressContentColoration( + AValue: Boolean); +begin + if FSuppressContentColoration <> AValue then + begin + FSuppressContentColoration := AValue; + Changed; + end; +end; + +{ TcxPivotGridReportLinkStyleSheet } + +class function TcxPivotGridReportLinkStyleSheet.GetStylesClass: TcxCustomStylesClass; +begin + Result := TcxPivotGridReportLinkStyles; +end; + +function TcxPivotGridReportLinkStyleSheet.GetStylesValue: TcxPivotGridReportLinkStyles; +begin + Result := TcxPivotGridReportLinkStyles(GetStyles); +end; + +procedure TcxPivotGridReportLinkStyleSheet.SetStylesValue( + AValue: TcxPivotGridReportLinkStyles); +begin + Styles.Assign(AValue); +end; + +{ TcxPivotGridReportLink } + +constructor TcxPivotGridReportLink.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FLookAndFeelItems := TList.Create; +end; + +destructor TcxPivotGridReportLink.Destroy; +begin + FreeAndNil(FLookAndFeelItems); + inherited Destroy; +end; + +procedure TcxPivotGridReportLink.BuildReport; +var + AController: TcxPivotGridExportController; +begin + LookAndFeelItems.Clear; + FHostCell := TdxReportCell.Create(ReportCells.Cells); + FHostCell.BoundsRect := MakeBounds(0, 0, PageWidth, PageHeight); + FHostCell.CellSides := []; + FHostCell.Transparent := True; + FHostCell.Visible := True; + AController := TcxPivotGridExportController.Create(PivotGrid); + try + AController.ViewInfo.DrawBorders := OptionsView.Borders; + AController.ViewInfo.DrawExpandButtons := OptionsView.ExpandButtons; + InitializeOptionsBeforeBuildReport(AController); + ProcessCreateReportItems(AController.CalculateViewInfo); + finally + AController.Free; + end; +end; + +procedure TcxPivotGridReportLink.ConstructReport(AReportCells: TdxReportCells); + + procedure CalculateSizes; + + procedure CalculateReportPartSizes(ACell: TdxReportCell); + var + ARight, ABottom, I: Integer; + begin + if ACell.CellCount > 0 then + begin + ARight := 0; + ABottom := 0; + for I := 0 to ACell.CellCount - 1 do + with ACell.Cells[I] do + begin + ARight := Max(ARight, Left + Width); + ABottom := Max(ABottom, Top + Height); + end; + ACell.BoundsRect := Rect(0, 0, ARight, ABottom); + end; + end; + + begin + with AReportCells do + begin + CalculateReportPartSizes(HostCell); + if AreFooterCellsAllocated then + CalculateReportPartSizes(FooterCells); + if AreHeaderCellsAllocated then + CalculateReportPartSizes(HeaderCells); + CalculateReportPartSizes(Cells); + end; + end; + +begin + if PivotGrid = nil then Exit; + inherited ConstructReport(AReportCells) ; + PrepareConstruct; + try + BuildReport; + if not AbortBuilding then CalculateSizes; + finally + UnprepareConstruct; + end; +end; + +procedure TcxPivotGridReportLink.ConvertCoords; +begin + inherited ConvertCoords; +end; + +procedure TcxPivotGridReportLink.CustomDraw(AItem: TAbstractdxReportCellData; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); +begin + case AItem.Data of + cxPivotGridDataCellID: + if AItem.ClassType = TdxReportCellString then + DoCustomDrawDataCell(ACanvas, TdxReportCellString(AItem), ADone); + cxPivotGridFieldHeaderCellID: + DoCustomDrawFieldHeaderCell(ACanvas, AItem.Parent, ADone); + cxPivotGridGroupHeaderCellID: + DoCustomDrawGroupHeaderCell(ACanvas, AItem.Parent, ADone); + end; +end; + +procedure TcxPivotGridReportLink.DoCustomDrawDataCell(ACanvas: TCanvas; + AItem: TdxReportCellString; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawDataCell) then + FOnCustomDrawDataCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxPivotGridReportLink.DoCustomDrawFieldHeaderCell(ACanvas: TCanvas; + AItem: TdxReportCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawFieldHeaderCell) then + FOnCustomDrawFieldHeaderCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxPivotGridReportLink.DoCustomDrawGroupHeaderCell(ACanvas: TCanvas; + AItem: TdxReportCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawGroupHeaderCell) then + FOnCustomDrawGroupHeaderCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxPivotGridReportLink.DoInitializeDataCell( + AItem: TdxReportCellString; ACell: TcxPivotGridDataCellViewInfo); +begin + if Assigned(FOnInitializeDataCell) then + FOnInitializeDataCell(Self, ACell, AItem); +end; + +procedure TcxPivotGridReportLink.DoInitializeFieldHeaderCell( + AItem: TdxReportCell; ACell: TcxPivotGridFieldHeaderCellViewInfo); +begin + if Assigned(FOnInitializeFieldHeaderCell) then + FOnInitializeFieldHeaderCell(Self, ACell, AItem); +end; + +procedure TcxPivotGridReportLink.DoInitializeGroupHeaderCell( + AItem: TdxReportCell; ACell: TcxPivotGridHeaderCellViewInfo); +begin + if Assigned(FOnInitializeGroupHeaderCell) then + FOnInitializeGroupHeaderCell(Self, ACell, AItem); +end; + +procedure TcxPivotGridReportLink.GetImageLists(AProc: TdxPSGetImageListProc); +begin + inherited GetImageLists(AProc); + AProc(PivotGrid.FieldHeaderImages); + AProc(PivotGrid.GroupHeaderImages); +end; + +procedure TcxPivotGridReportLink.AddDataCell( + ACell: TcxPivotGridDataCellViewInfo); +var + APSCell: TdxReportCellString; +begin + APSCell := HostCell.AddDataItem(TdxReportCellString) as TdxReportCellString; + APSCell.BoundsRect := ACell.Bounds; + APSCell.TextAlignX := TextAlignXMap[ACell.Align]; + APSCell.Text := ACell.DisplayText; + APSCell.Color := ACell.Color; + SetCellViewParams(APSCell, ACell.ViewParams); + APSCell.Data := cxPivotGridDataCellID; + APSCell.CellSides := TdxCellSides(ACell.Borders); + DoInitializeDataCell(APSCell, ACell); +end; + +procedure TcxPivotGridReportLink.AddFieldHeaderCell( + ACell: TcxPivotGridFieldHeaderCellViewInfo); +begin + DoInitializeFieldHeaderCell(CreateHeaderCell( + ACell, cxPivotGridFieldHeaderCellID), ACell); +end; + +procedure TcxPivotGridReportLink.AddHeaderCell( + ACell: TcxPivotGridHeaderCellViewInfo); +var + AItem: TdxReportCell; +begin + AItem := CreateHeaderCell(ACell, cxPivotGridGroupHeaderCellID); + AddHorizontalDelimiter(AItem); + AddVerticalDelimiter(AItem); + DoInitializeGroupHeaderCell(AItem, ACell); +end; + +function TcxPivotGridReportLink.CreateHeaderCell( + ACell: TcxPivotGridHeaderCellViewInfo; AttributeID: Integer): TdxReportCell; +var + R: TRect; + APSCell: TdxReportCellImage; + AIndent: TdxReportCellString; + AButton: TdxReportCellExpandButton; +const + ImageLayout: array[TcxAlignmentVert, TAlignment] of TdxImageLayout = + ((ilImageTopLeft, ilImageTopRight, ilImageTopCenter), + (ilImageBottomLeft, ilImageBottomRight, ilImageBottomCenter), + (ilImageCenterLeft, ilImageCenterRight, ilImageCenterCenter)); + +begin + Result := HostCell.AddCell; + Result.BoundsRect := ACell.Bounds; + Result.CellSides := []; + APSCell := Result.AddDataItem(TdxReportCellImage) as TdxReportCellImage; + APSCell.TextAlignX := TextAlignXMap[ACell.AlignHorz]; + APSCell.TextAlignY := TextAlignYMap[ACell.AlignVert]; + APSCell.Text := ACell.DisplayText; + APSCell.Color := ACell.Color; + APSCell.BoundsRect := MakeRect(0, 0, Result.Width, Result.Height); + APSCell.ImageIndex := ACell.ImageIndex; + if APSCell.ImageIndex <> -1 then + APSCell.ImageList := ACell.Images; + APSCell.ImageLayout := ImageLayout[ACell.ImageAlignVert, ACell.ImageAlignHorz]; + APSCell.IsTextDrawnForCenteredImage := True; + APSCell.EndEllipsis := ACell.ShowEndEllipsis; + APSCell.Multiline := ACell.MultiLine; + APSCell.CellSides := csAll; + if ACell.HasButton and OptionsView.ExpandButtons and (ACell.Bounds.Right > ACell.ButtonRect.Right) then + begin + AButton := Result.AddDataItem(TdxReportCellExpandButton) as TdxReportCellExpandButton; + R := ACell.ButtonRect; + OffsetRect(R, -ACell.Bounds.Left, -ACell.Bounds.Top); + AButton.BoundsRect := R; + AButton.CellSides := []; + AIndent := Result.AddDataItem(TdxReportCellString) as TdxReportCellString; + AIndent.BoundsRect := MakeRect(0, 0, AButton.Left + AButton.Width + cxTextOffset, + Result.Height); + AIndent.CellSides := [csLeft, csTop, csBottom]; + APSCell.CellSides := APSCell.CellSides - [csLeft]; + AButton.ButtonExpanded := ACell.Expanded; + AButton.ShowButtonBorder := True; + AButton.ShowButton := True; + AButton.ButtonBorder3D := Effects3D; + AButton.ButtonBorder3DSoft := Soft3D; + APSCell.Left := AIndent.Left + AIndent.Width; + APSCell.Width := APSCell.Width - APSCell.Left; + SetCellViewParams(AButton, ACell.ViewParams); + SetCellViewParams(AIndent, ACell.ViewParams); + RegisterLookAndFeelItem(AIndent, cesRaised); + end; + APSCell.SortOrder := TdxCellSortOrder(ACell.SortOrder); + APSCell.Data := AttributeID; + SetCellViewParams(APSCell, ACell.ViewParams); + RegisterLookAndFeelItem(APSCell, cesRaised); +end; + +procedure TcxPivotGridReportLink.InitializeOptionsBeforeBuildReport( + AController: TcxPivotGridExportController); +begin + AController.ExpandColumns := OptionsExpanding.AutoExpandColumns; + AController.ExpandRows := OptionsExpanding.AutoExpandRows; + if OptionsFormatting.UseNativeStyles then + AController.ReplaceStyles(ActiveStyles); + with AController.OptionsView do + begin + ColumnFields := Self.OptionsView.ColumnFields; + DataFields := Self.OptionsView.DataFields; + FilterFields := Self.OptionsView.FilterFields; + GridLines := Self.OptionsView.GridLines; + RowFields := Self.OptionsView.RowFields; + end; +end; + +procedure TcxPivotGridReportLink.ProcessCreateReportItems( + AViewInfo: TcxPivotGridViewInfo); +var + I, AStart, ACount: Integer; +begin + with AViewInfo do + begin + AStart := 0; + ACount := RowHeaders.Count + ColumnHeaders.Count + + FieldHeaders.Count + DataCells.Count; + for I := 0 to RowHeaders.Count - 1 do + begin + AddHeaderCell(TcxPivotGridHeaderCellViewInfo(RowHeaders[I])); + DoProgress(100 * (AStart + I + 1) / ACount); + end; + Inc(AStart, RowHeaders.Count); + for I := 0 to ColumnHeaders.Count - 1 do + begin + AddHeaderCell(TcxPivotGridHeaderCellViewInfo(ColumnHeaders[I])); + DoProgress(100 * (AStart + I + 1) / ACount); + end; + Inc(AStart, ColumnHeaders.Count); + for I := 0 to FieldHeaders.Count - 1 do + begin + AddFieldHeaderCell(TcxPivotGridFieldHeaderCellViewInfo(FieldHeaders[I])); + DoProgress(100 * (AStart + I + 1) / ACount); + end; + Inc(AStart, FieldHeaders.Count); + for I := 0 to DataCells.Count - 1 do + begin + AddDataCell(TcxPivotGridDataCellViewInfo(DataCells[I])); + DoProgress(100 * (AStart + I + 1) / ACount); + end; + end; +end; + +procedure TcxPivotGridReportLink.RegisterLookAndFeelItem( + AItem: TdxReportVisualItem; AEdgeStyle: TdxCellEdgeStyle); +begin + AItem.EdgeMode := GetEdgeMode; + AItem.Edge3DStyle := AEdgeStyle; + FLookAndFeelItems.Add(AItem); +end; + +procedure TcxPivotGridReportLink.SetCellViewParams( + ACell: TdxReportVisualItem; const AParams: TcxViewParams); +var + AdxPSViewParams: TdxReportItemViewParams; +begin + if not Assigned(ACell) then Exit; + FillChar(AdxPSViewParams, SizeOf(AdxPSViewParams), 0); + AdxPSViewParams.NativeParams := AParams; + SetCellViewParamsEx(ACell, AdxPSViewParams); +end; + +procedure TcxPivotGridReportLink.SetCellViewParamsEx( + ACell: TdxReportVisualItem; const AParams: TdxReportItemViewParams); +var + AFont: TFont; + AHasBitmap: Boolean; +begin + if not Assigned(ACell) then Exit; + AFont := TFont.Create; + try + AFont.Assign(AParams.NativeParams.Font); + if not dxPSUtl.dxIsTrueTypeFont(AFont) then + AFont.Name := Font.Name; + AFont.Color := ColorToRGB(AParams.NativeParams.TextColor); + if AParams.FontSize <> 0 then + AFont.Size := AParams.FontSize; + AFont.Style := AFont.Style + AParams.FontStyle; + ACell.FontIndex := AddFontToPool(AFont); + ACell.Transparent := OptionsFormatting.SuppressContentColoration or AParams.Transparent; + with AParams.NativeParams do + begin + AHasBitmap := not OptionsFormatting.SuppressBackgroundBitmaps and + (Bitmap <> nil) and not Bitmap.Empty; + if AHasBitmap then + ACell.BackgroundBitmapIndex := AddBackgroundBitmapToPool(Bitmap); + end; + ACell.Color := ColorToRGB(AParams.NativeParams.Color); + finally + AFont.Free; + end; +end; + +procedure TcxPivotGridReportLink.InternalRestoreFromOriginal; +begin + inherited InternalRestoreFromOriginal; + if PivotGrid <> nil then + begin + OptionsFormatting.LookAndFeelKind := PivotGrid.LookAndFeel.Kind; + // optionsview todo: + end; +end; + +function TcxPivotGridReportLink.IsSupportedCustomDraw( + Item: TAbstractdxReportCellData): Boolean; +begin + Result := (Item <> nil) and inherited IsSupportedCustomDraw(Item); +end; + +function TcxPivotGridReportLink.GetEdgeMode: TdxCellEdgeMode; +const + EdgeModeMap: array[Boolean] of TdxCellEdgeMode = (cemPattern, cem3DEffects); +begin + Result := EdgeModeMap[OptionsFormatting.LookAndFeelKind <> lfUltraFlat]; +end; + +function TcxPivotGridReportLink.GetOptionsExpandingClass: TdxCustomReportLinkOptionsExpandingClass; +begin + Result := TcxPivotGridReportLinkOptionsExpanding; +end; + +function TcxPivotGridReportLink.GetOptionsFormattingClass: TdxCustomReportLinkOptionsFormattingClass; +begin + Result := TcxPivotGridReportLinkOptionsFormatting; +end; + +function TcxPivotGridReportLink.GetOptionsViewClass: TdxCustomReportLinkOptionsViewClass; +begin + Result := TcxPivotGridReportLinkOptionsView; +end; + +function TcxPivotGridReportLink.GetAreNativeStylesAvailable: Boolean; +begin + Result := OptionsFormatting.UseNativeStyles; +end; + +function TcxPivotGridReportLink.GetStylesClass: TdxCustomReportLinkStylesClass; +begin + Result := TcxPivotGridReportLinkStyles; +end; + +function TcxPivotGridReportLink.GetStyleSheetClass: TdxCustomReportLinkStyleSheetClass; +begin + Result := TcxPivotGridReportLinkStyleSheet; +end; + +function TcxPivotGridReportLink.GetStyleSheetPrototype: TdxCustomReportLinkStyleSheet; +begin + Result := DefaultdxPScxPivotGridLinkStyleSheet; +end; + +procedure TcxPivotGridReportLink.PrepareConstruct; +begin + inherited; + ReportCells.LookAndFeel := nil; +end; + +procedure TcxPivotGridReportLink.UnprepareConstruct; +begin + ReportCells.BorderColor := GridLineColor; + FormatLookAndFeelItems; + inherited UnprepareConstruct; +end; + +procedure TcxPivotGridReportLink.FormatLookAndFeelItems; +const + Borders3D: array[TdxCellEdgeStyle, Boolean] of TdxPSCellBorderClass = + ((TdxPSCellRaisedBorder, TdxPSCellRaisedSoftBorder), + (TdxPSCellSunkenBorder, TdxPSCellSunkenSoftBorder)); +var + I: Integer; +begin + for I := 0 to LookAndFeelItems.Count - 1 do + with TdxReportVisualItem(LookAndFeelItems[I]) do + if Effects3D then + BorderClass := Borders3D[Edge3DStyle, Soft3D] + else + BorderClass := TdxPSCellUltraFlatBorder; +end; + +function TcxPivotGridReportLink.GetActiveStyles: TcxPivotGridReportLinkStyles; +begin + Result := inherited ActiveStyles as TcxPivotGridReportLinkStyles; +end; + +function TcxPivotGridReportLink.GetDesignWindow: TcxfmPivotGridReportLinkDesignWindow; +begin + Result := inherited DesignWindow as TcxfmPivotGridReportLinkDesignWindow; +end; + +function TcxPivotGridReportLink.GetGridLineColor: TColor; +begin + Result := OptionsFormatting.GridLineColor; + if (Result = clDefault) and (PivotGrid <> nil) then + Result := PivotGrid.LookAndFeelPainter.DefaultGridLineColor; +end; + +function TcxPivotGridReportLink.GetOptionsExpanding: TcxPivotGridReportLinkOptionsExpanding; +begin + Result := inherited OptionsExpanding as TcxPivotGridReportLinkOptionsExpanding; +end; + +function TcxPivotGridReportLink.GetOptionsFormatting: TcxPivotGridReportLinkOptionsFormatting; +begin + Result := inherited OptionsFormatting as TcxPivotGridReportLinkOptionsFormatting; +end; + +function TcxPivotGridReportLink.GetOptionsView: TcxPivotGridReportLinkOptionsView; +begin + Result := inherited OptionsView as TcxPivotGridReportLinkOptionsView; +end; + +function TcxPivotGridReportLink.GetStyles: TcxPivotGridReportLinkStyles; +begin + Result := inherited Styles as TcxPivotGridReportLinkStyles; +end; + +function TcxPivotGridReportLink.GetPivotGrid: TcxCustomPivotGrid; +begin + Result := TcxCustomPivotGrid(Component); +end; + +procedure TcxPivotGridReportLink.SetOptionsExpanding( + AValue: TcxPivotGridReportLinkOptionsExpanding); +begin + OptionsExpanding.Assign(AValue); +end; + +procedure TcxPivotGridReportLink.SetOptionsFormatting( + AValue: TcxPivotGridReportLinkOptionsFormatting); +begin + OptionsFormatting.Assign(AValue); +end; + +procedure TcxPivotGridReportLink.SetOptionsView( + AValue: TcxPivotGridReportLinkOptionsView); +begin + OptionsView.Assign(AValue) +end; + +procedure TcxPivotGridReportLink.SetStyles( + AValue: TcxPivotGridReportLinkStyles); +begin + Styles.Assign(AValue) +end; + +{ TcxfmPivotGridReportLinkDesignWindow } + +constructor TcxfmPivotGridReportLinkDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxhccxPivotGridReportLinkDesigner; + inherited Create(AOwner); + CreateControls; + LoadPreviewData; +end; + +destructor TcxfmPivotGridReportLinkDesignWindow.Destroy; +begin + dxPSPopupMan.dxPSPopupMenuController.UnregisterControl(lbxStyles); + inherited Destroy; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.CreateControls; + + procedure CreateStylesListBox; + begin + lbxStyles := TdxStylesListBox.Create(Self); + lbxStyles.Parent := tshStyles; + lbxStyles.BoundsRect := bvlStylesHost.BoundsRect; + lbxStyles.PopupMenu := pmStyles; + lbxStyles.TabOrder := chbxUseNativeStyles.TabOrder + 1; + lbxStyles.OnClick := lbxStylesClick; + bvlStylesHost.Visible := False; + + dxPSPopupMan.dxPSPopupMenuController.RegisterControl(lbxStyles); + end; + +begin + CreateStylesListBox; +end; + +function TcxfmPivotGridReportLinkDesignWindow.CanSelectAllStyles: Boolean; +var + I: Integer; +begin + Result := AreNativeStylesAvailable; + if Result then + begin + for I := 0 to lbxStyles.Items.Count - 1 do + if not lbxStyles.Selected[I] then Exit; + Result := False; + end; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.DoInitialize; +begin + lbxStyles.ReportLinkStyles := ReportLink.ActiveStyles; + inherited DoInitialize; + BeginUpdateControls; + // view + with ReportLink.OptionsView do + begin + chbxColumnFields.Checked := ColumnFields; + chbxDataFields.Checked := DataFields; + chbxFilterFields.Checked := FilterFields; + chbxRowFields.Checked := RowFields; + chbxBorders.Checked := Borders; + chbxShowExpandButtons.Checked := ExpandButtons; + chbxHorizontalLines.Checked := GridLines in [pglBoth, pglHorz]; + chbxVerticalLines.Checked := GridLines in [pglBoth, pglVert];; + end; + // behavior + chbxExpandColumns.Checked := ReportLink.OptionsExpanding.AutoExpandColumns; + chbxExpandRows.Checked := ReportLink.OptionsExpanding.AutoExpandRows; + // formatting + with ReportLink.OptionsFormatting do + begin + chbxSuppressBackgroundBitmaps.Checked := SuppressBackgroundBitmaps; + chbxSuppressContentColoration.Checked := SuppressContentColoration; + chbxUseNativeStyles.Checked := UseNativeStyles; + end; + EndUpdateControls; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.RecreateStylesListBox; +var + List: TList; +begin + List := TList.Create; + try + SaveSelectedStyles(List); + dxPSUtl.dxRecreateWnd(lbxStyles); + RestoreSelectedStyles(List); + finally + List.Free; + end; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.RestoreSelectedStyles( + AList: TList); +var + I: Integer; +begin + for I := 0 to AList.Count - 1 do + lbxStyles.Selected[Integer(AList[I])] := True; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.SaveSelectedStyles( + AList: TList); +var + I: Integer; +begin + AList.Clear; + for I := 0 to lbxStyles.Items.Count - 1 do + if lbxStyles.Selected[I] then AList.Add(TObject(I)); +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.UpdateControlsState; +begin + inherited UpdateControlsState; + + UpdateEnabled(lbxStyles, AreNativeStylesAvailable); + UpdateEnabled(btnStyleColor, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(btnStyleFont, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(btnStyleBackgroundBitmap, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(btnStyleBackgroundBitmapClear, AreNativeStylesAvailable and HasSelectedStylesWithAssignedBitmap); + UpdateEnabled(btnStyleRestoreDefaults, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(btnStylesSaveAs, CanSaveStyles); + + UpdateEnabled(lblStyleSheets, AreNativeStylesAvailable); + UpdateEnabled(cbxStyleSheets, AreNativeStylesAvailable); + UpdateEnabled(btnStyleSheetNew, CanCreateStyleSheet); + UpdateEnabled(btnStyleSheetCopy, CanCopyStyleSheet); + UpdateEnabled(btnStyleSheetDelete, CanDeleteStyleSheet); + UpdateEnabled(btnStyleSheetRename, CanRenameStyleSheet); +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.UpdateEnabled( + AControl: TControl; AEnabled: Boolean); +begin + TControlAccess(AControl).Enabled := AEnabled; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.UpdateEnabled( + AItem: TMenuItem; AEnabled: Boolean); +begin + AItem.Enabled := AEnabled; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.UpdateEnabledControls( + AControls: array of TControl; AEnabled: Boolean); +var + I: Integer; +begin + for I := 0 to High(AControls) do + UpdateEnabled(AControls[I], AEnabled); +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.UpdatePreview; +begin + inherited UpdatePreview; + PreviewPivotGrid.BeginUpdate; + try + ReportLink.OptionsView.AssignToPivot(PreviewPivotGrid); + ReportLink.OptionsExpanding.AssignToPivot(PreviewPivotGrid); + ReportLink.ActiveStyles.AssignToPivot(ReportLink.PivotGrid, + PreviewPivotGrid, not ReportLink.OptionsFormatting.UseNativeStyles); + ReportLink.OptionsFormatting.AssignToPivot(PreviewPivotGrid); + PreviewPivotGrid.FullRefresh; + finally + PreviewPivotGrid.EndUpdate; + end; +end; + +// + +procedure TcxfmPivotGridReportLinkDesignWindow.DoActiveStyleSheetChanged; +begin + lbxStyles.ReportLinkStyles := ReportLink.ActiveStyles; + inherited DoActiveStyleSheetChanged; + with cbxStyleSheets do + ItemIndex := Items.IndexOfObject(ActiveStyleSheet); + if not LockControlsUpdate then + begin + Modified := True; + UpdatePreview; + end; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.DoFormActivated(AnActive: Boolean); +begin + inherited; + if not AnActive then lbxStyles.HideToolTips; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.DoRefreshStylesList; +var + Styles: TcxPivotGridReportLinkStyles; + List: TList; +begin + Styles := ReportLink.ActiveStyles; + with lbxStyles.Items do + begin + BeginUpdate; + try + List := TList.Create; + try + SaveSelectedStyles(List); + try + Clear; + AddObject(cxGetResourceString(@sdxPivotGridColumnHeader), Styles.ColumnHeader); + AddObject(cxGetResourceString(@sdxPivotGridContent), Styles.Content); + AddObject(cxGetResourceString(@sdxPivotGridFieldHeader), Styles.FieldHeader); + AddObject(cxGetResourceString(@sdxPivotGridHeaderBackground), Styles.HeaderBackground); + AddObject(cxGetResourceString(@sdxPivotGridRowHeader), Styles.RowHeader); + finally + RestoreSelectedStyles(List); + end; + finally + List.Free; + end; + finally + EndUpdate; + end; + end; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.DoStyleChanged(const ACaption: string; + AStyle: TcxStyle); +begin + inherited; + Modified := True; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.DoStylesChanged(AStrings: TStrings; + ARecreate: Boolean); +begin + if ARecreate then + RecreateStylesListBox + else + lbxStyles.Invalidate; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.GetSelectedStyleNames(AStrings: TStrings); +var + I: Integer; +begin + AStrings.Clear; + with lbxStyles do + for I := 0 to Items.Count - 1 do + if Selected[I] then + AStrings.AddObject(Items[I], Items.Objects[I]); +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.GetStyleNames(out AStrings: TStrings); +begin + AStrings := lbxStyles.Items; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.GetStyleSheetNames(out AStrings: TStrings); +begin + AStrings := cbxStyleSheets.Items; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.LoadCaption( + AControl: TControl; StrPtr: Pointer); +begin + TControlAccess(AControl).Caption := cxGetResourceString(StrPtr); +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.LoadCaption( + AItem: TMenuItem; StrPtr: Pointer); +begin + AItem.Caption := cxGetResourceString(StrPtr); +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.LoadPreviewData; +var + AStream: TStream; +begin + AStream := TResourceStream.Create(hInstance, 'PIVOTPREVIEWDATA', 'PIVOTDATA'); + try + AStream.Position := 0; + PreviewPivotGrid.DataController.LoadFromStream(AStream); + with PreviewPivotGrid.ViewData do + begin + Rows[0].Parent.GroupItem.Expanded := False; + Columns[0].Parent.Parent.GroupItem.Expanded := False; + end; + PreviewPivotGrid.FullRefresh; + finally + AStream.Free; + end; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.LoadStrings; + + procedure AdjustBevelSize(ABevel: TBevel; AControl: TControl); + var + Right: Integer; + begin + Right := ABevel.BoundsRect.Right; + ABevel.Left := AControl.Left + AControl.Width + 10; + ABevel.Width := Right - ABevel.Left; + end; + +begin + inherited LoadStrings; + + LoadCaption(tshView, @sdxViewTab); + LoadCaption(tshBehaviors, @sdxBehaviorsTab); + LoadCaption(tshFormatting, @sdxFormatting); + LoadCaption(tshStyles, @sdxStyles); + LoadCaption(lblPreviewWindow, @sdxPreview); + LoadCaption(lblShow, @sdxShow); + LoadCaption(lblCardFraming, @sdxFraming); + + // pivot preview + pgfPurchaseQuarter.Caption := cxGetResourceString(@sdxPurchaseQuarter); + pgfPurchaseMonth.Caption := cxGetResourceString(@sdxPurchaseMonth); + pgfPaymentType.Caption := cxGetResourceString(@sdxPaymentType); + pgfQuantity.Caption := cxGetResourceString(@sdxQuantity); + pgfCarName.Caption := cxGetResourceString(@sdxCarName); + pgfUnitPrice.Caption := cxGetResourceString(@sdxUnitPrice); + pgfCompanyName.Caption := cxGetResourceString(@sdxCompanyName); + pgfPaymentAmount.Caption := cxGetResourceString(@sdxPaymentAmount); + // view + LoadCaption(chbxColumnFields, @sdxColumnFields); + LoadCaption(chbxDataFields, @sdxDataFields); + LoadCaption(chbxFilterFields, @sdxFiterFields); + LoadCaption(chbxRowFields, @sdxRowFields); + LoadCaption(chbxShowExpandButtons, @sdxExpandButtons); + LoadCaption(chbxHorizontalLines, @sdxHorzLines); + LoadCaption(chbxVerticalLines, @sdxVertLines); + LoadCaption(chbxBorders, @sdxBorderLines); + //Behaviors + LoadCaption(chbxExpandColumns, @sdxAutoColumnsExpand); + LoadCaption(chbxExpandRows, @sdxAutoRowsExpand); + // Formatting + LoadCaption(lblLookAndFeel, @sdxLookAndFeel); + AdjustBevelSize(bvlLookAndFeel, lblLookAndFeel); + LoadStringsCombo(cbxLookAndFeel, [@sdxLookAndFeelFlat, + @sdxLookAndFeelStandard, @sdxLookAndFeelUltraFlat]); + cbxLookAndFeel.ItemIndex := Integer(ReportLink.OptionsFormatting.LookAndFeelKind); + LoadCaption(chbxSuppressBackgroundBitmaps, @ sdxSuppressBackgroundBitmaps); + LoadCaption(chbxSuppressContentColoration, @ sdxSuppressContentColoration); + //styles + LoadCaption(lblUseNativeStyles, @sdxUseNativeStyles); + AdjustBevelSize(bvlStyles, lblUseNativeStyles); + LoadCaption(btnStyleColor, @sdxBtnColor); + LoadCaption(btnStyleFont, @sdxBtnFont); + LoadCaption(btnStyleBackgroundBitmap, @sdxBtnTexture); + LoadCaption(btnStyleBackgroundBitmapClear, @sdxBtnTextureClear); + LoadCaption(btnStyleRestoreDefaults, @sdxBtnRestoreDefaults); + LoadCaption(btnStylesSaveAs, @sdxBtnSaveAs); + LoadCaption(miStyleColor, @sdxBtnColor); + LoadCaption(miStyleFont, @sdxBtnFont); + LoadCaption(miStyleBackgroundBitmap, @sdxBtnTexture); + LoadCaption(miStyleBackgroundBitmapClear, @sdxBtnTextureClear); + LoadCaption(miStyleRestoreDefaults, @sdxBtnRestoreDefaults); + LoadCaption(miStylesSelectAll, @sdxSelectAll); + LoadCaption(miStylesSaveAs, @sdxBtnSaveAs); + LoadCaption(lblStyleSheets, @sdxStyleSheets); + AdjustBevelSize(bvlStyleSheets, lblStyleSheets); + LoadCaption(btnStyleSheetNew, @sdxBtnNew); + LoadCaption(btnStyleSheetCopy, @sdxBtnCopy); + LoadCaption(btnStyleSheetDelete, @sdxBtnDelete); + LoadCaption(btnStyleSheetRename, @sdxBtnRename); +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.LoadStringsCombo( + ACombo: TComboBox; ACaptions: array of Pointer); +var + I: Integer; +begin + with ACombo.Items do + begin + BeginUpdate; + try + Clear; + for I := 0 to High(ACaptions) do + if ACaptions[I] <> nil then Add(cxGetResourceString(ACaptions[I])); + finally + EndUpdate; + end; + end; +end; + +function TcxfmPivotGridReportLinkDesignWindow.GetActiveStyle: TcxStyle; +begin + with lbxStyles do + begin + if ItemIndex <> -1 then + Result := TcxStyle(Items.Objects[ItemIndex]) + else + Result := nil; + end; +end; + +function TcxfmPivotGridReportLinkDesignWindow.GetHasSelectedStyles: Boolean; +begin + Result := lbxStyles.SelCount <> 0; +end; + +function TcxfmPivotGridReportLinkDesignWindow.GetHasSelectedStylesWithAssignedBitmap: Boolean; +var + Strings: TStrings; + I: Integer; + cxStyle: TcxStyle; +begin + Result := True; + Strings := TStringList.Create; + try + GetSelectedStyleNames(Strings); + for I := 0 to Strings.Count - 1 do + begin + cxStyle := TcxStyle(Strings.Objects[I]); + if (cxStyle <> nil) and (cxStyle.Bitmap <> nil) and not cxStyle.Bitmap.Empty then + Exit; + end; + finally + Strings.Free; + end; + Result := False; +end; + +function TcxfmPivotGridReportLinkDesignWindow.GetReportLink: TcxPivotGridReportLink; +begin + Result := TcxPivotGridReportLink(inherited ReportLink); +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.lbxStylesClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + UpdateControlsState; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.OptionsFormattingChanged( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + with ReportLink.OptionsFormatting do + begin + case TControl(Sender).Tag of + 0: + begin + UseNativeStyles := chbxUseNativeStyles.Checked; + RecreateStylesListBox; + end; + 1: + SuppressBackgroundBitmaps := chbxSuppressBackgroundBitmaps.Checked; + 2: + SuppressContentColoration := chbxSuppressContentColoration.Checked; + end; + end; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.btnStyleFontClick(Sender: TObject); +begin + PerformStylesChangeFont; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.btnStyleColorClick(Sender: TObject); +begin + PerformStylesChangeColor; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.btnStyleBackgroundBitmapClick(Sender: TObject); +begin + PerformStylesChangeBitmap; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.btnStyleClearClick(Sender: TObject); +begin + PerformStylesClearBitmap; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.btnStyleRestoreDefaultsClick( + Sender: TObject); +begin + PerformStylesRestoreDefaults; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.btnStylesSaveAsClick( + Sender: TObject); +begin + PerformStylesSaveAsStyleSheet; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.btnStyleSheetNewClick(Sender: TObject); +begin + PerformStyleSheetNew; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.btnStyleSheetCopyClick(Sender: TObject); +begin + PerformStyleSheetCopy; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.btnStyleSheetDeleteClick(Sender: TObject); +begin + PerformStyleSheetDelete; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.btnStyleSheetRenameClick(Sender: TObject); +begin + PerformStyleSheetRename; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.lblUseNativeStylesClick( + Sender: TObject); +begin + if chbxUseNativeStyles.CanFocus then + ActiveControl := chbxUseNativeStyles; + chbxUseNativeStyles.Checked := not chbxUseNativeStyles.Checked; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.pmStylesPopup( + Sender: TObject); +begin + lbxStyles.HideToolTips; + UpdateEnabled(miStyleColor, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(miStyleFont, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(miStyleBackgroundBitmap, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(miStyleBackgroundBitmapClear, AreNativeStylesAvailable and HasSelectedStylesWithAssignedBitmap); + UpdateEnabled(miStyleRestoreDefaults, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(miStylesSelectAll, CanSelectAllStyles); + UpdateEnabled(miStylesSaveAs, CanSaveStyles); +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.miStylesSelectAllClick( + Sender: TObject); +{$IFNDEF DELPHI6} +var + I: Integer; +{$ENDIF} +begin + with lbxStyles do + begin + {$IFDEF DELPHI6} + SelectAll; + {$ELSE} + Items.BeginUpdate; + try + for I := 0 to Items.Count - 1 do + Selected[I] := True; + finally + Items.EndUpdate; + end; + {$ENDIF} + end; + UpdateControlsState; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.cbxStyleSheetsClick( + Sender: TObject); +begin + with TComboBox(Sender) do + ActiveStyleSheet := TcxCustomStyleSheet(Items.Objects[ItemIndex]) +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.cbxStyleSheetsKeyDown( + Sender: TObject; var Key: Word; Shift: TShiftState); +begin + PerformStyleSheetKeyDown(Sender, Key, Shift); +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.cbxStyleSheetsDrawItem( + Control: TWinControl; Index: Integer; Rect: TRect; + State: TOwnerDrawState); +begin + PerformStyleSheetDrawItem(TComboBox(Control).Canvas, Index, Rect, State, Control.Enabled); +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.cbxLookAndFeelChange( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsFormatting.LookAndFeelKind := + TcxLookAndFeelKind(cbxLookAndFeel.ItemIndex); + Modified := True; + UpdatePreview; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.chbxExpandOptionsClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TCheckBox(Sender) do + begin + case Tag of + 0: + ReportLink.OptionsExpanding.AutoExpandColumns := Checked; + 1: + ReportLink.OptionsExpanding.AutoExpandRows := Checked; + end; + end; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmPivotGridReportLinkDesignWindow.chbxOptionsViewClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + with ReportLink.OptionsView do + begin + case TCheckBox(Sender).Tag of + 0: + begin + ColumnFields := chbxColumnFields.Checked; + DataFields := chbxDataFields.Checked; + FilterFields := chbxFilterFields.Checked; + RowFields := chbxRowFields.Checked; + end; + 1, 2: + begin + if chbxHorizontalLines.Checked and chbxVerticalLines.Checked then + GridLines := pglBoth + else + if chbxHorizontalLines.Checked then + GridLines := pglHorz + else + if chbxVerticalLines.Checked then + GridLines := pglVert + else + GridLines := pglNone; + end; + 3: + Borders := TCheckBox(Sender).Checked; + 4: + ExpandButtons := TCheckBox(Sender).Checked; + end; + end; + Modified := True; + UpdatePreview; +end; + +// common + +procedure RegisterAssistants; +begin + dxPSRegisterReportLink(TcxPivotGridReportLink, + TcxCustomPivotGrid, TcxfmPivotGridReportLinkDesignWindow); +end; + +procedure UnregisterAssistants; +begin + dxPSUnregisterReportLink(TcxPivotGridReportLink, + TcxCustomPivotGrid, TcxfmPivotGridReportLinkDesignWindow); +end; + +initialization + RegisterAssistants; + +finalization + UnregisterAssistants; + +end. +//1. --borders-- +//2. --gridlines-- +//3. --expandbuttons-- +//4. --sorting mark-- +//5. --Images-- +//6. styles in pivot (font height, etc) + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxPivotGridLnk.res b/official/x.35/ExpressPrinting System/Sources/dxPScxPivotGridLnk.res new file mode 100644 index 00000000..aab165c7 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Sources/dxPScxPivotGridLnk.res differ diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxPivotGridLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxPivotGridLnkReg.pas new file mode 100644 index 00000000..5e300817 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxPivotGridLnkReg.pas @@ -0,0 +1,118 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxPivotGridLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignEditors, + {$ELSE} + DsgnIntf, + {$ENDIF} + Windows, Classes, Controls, dxPSRes, dxPSUtl, cxStyles, cxCustomPivotGrid, cxPivotGrid, + dxPScxPivotGridLnk, cxStyleSheetEditor, SysUtils, cxPivotGridStyleSheetsPreview; + +type + TcxPivotGridReportLinkStyleSheetEditorPreview = class(TcxPivotGridStyleSheetEditorPreview) + public + class function GetStyleSheetClass: TcxCustomStyleSheetClass; override; + procedure SetStyleSheet(AStyleSheet: TcxCustomStyleSheet); override; + + class procedure Register; + class procedure Unregister; + end; + +class function TcxPivotGridReportLinkStyleSheetEditorPreview.GetStyleSheetClass: TcxCustomStyleSheetClass; +begin + Result := TcxPivotGridReportLinkStyleSheet; +end; + +procedure TcxPivotGridReportLinkStyleSheetEditorPreview.SetStyleSheet( + AStyleSheet: TcxCustomStyleSheet); +var + AStyles: TcxPivotGridReportLinkStyles; +begin + if AStyleSheet is TcxPivotGridReportLinkStyleSheet then + begin + AStyles := TcxPivotGridReportLinkStyleSheet(AStyleSheet).Styles; + with PivotGrid.Styles do + begin + ColumnHeader := AStyles.ColumnHeader; + Content := AStyles.Content; + FieldHeader := AStyles.FieldHeader; + FilterHeaderArea := AStyles.HeaderBackground; + RowHeader := AStyles.RowHeader; + end; + end + else + PivotGrid.Styles.ResetStyles; +end; + +class procedure TcxPivotGridReportLinkStyleSheetEditorPreview.Register; +begin + RegisterStyleSheetEditorPreview(Self); +end; + +class procedure TcxPivotGridReportLinkStyleSheetEditorPreview.Unregister; +begin + UnregisterStyleSheetEditorPreview(Self); +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterNoIcon([TcxPivotGridReportLink, TcxPivotGridReportLinkStyleSheet]); + RegisterClasses([TcxPivotGridReportLink, + TcxPivotGridReportLinkStyles, TcxPivotGridReportLinkStyleSheet]); + RegisterStyleSheetClass(TcxPivotGridReportLinkStyleSheet); +end; + +initialization + TcxPivotGridReportLinkStyleSheetEditorPreview.Register; + +finalization + TcxPivotGridReportLinkStyleSheetEditorPreview.Unregister; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxSSLnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPScxSSLnk.dfm new file mode 100644 index 00000000..f88a53f7 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxSSLnk.dfm @@ -0,0 +1,510 @@ +object fmdxSpreadSheetDesignWindow: TfmdxSpreadSheetDesignWindow + Left = 551 + Top = 286 + BorderStyle = bsDialog + Caption = 'SpreadSheet DesignWindow' + ClientHeight = 263 + ClientWidth = 557 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object pgctrlMain: TPageControl + Left = 4 + Top = 6 + Width = 549 + Height = 221 + ActivePage = tshOptions + MultiLine = True + TabOrder = 1 + OnChange = pgctrlMainChange + object tshOptions: TTabSheet + Caption = '&Options' + object pnlOptions: TPanel + Left = 0 + Top = 0 + Width = 541 + Height = 193 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Bevel11: TBevel + Left = 40 + Top = 10 + Width = 194 + Height = 4 + Shape = bsBottomLine + end + object Bevel4: TBevel + Left = 79 + Top = 83 + Width = 156 + Height = 5 + Shape = bsBottomLine + end + object Image5: TImage + Left = 7 + Top = 102 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D7AAAAAA9AAAAA7AAAAA9AAAA07DCDDDDCDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7AAAAAA9AAAAA7AAAAA9AAAA07DCCCCDCCDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7A77AAA9A777A7A777A9A77A07DCCCCCCCCDD7F77FFF8F777F8F777F8F7 + 7F07D7AAAAAA9AAAAA7AAAAA9AAAA07DCCCCDCCDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D79999999777777777779999907DCDDDDCDDDD7888888888888888888888 + 8807D7CCCCCC9BBBBB7BBBBB9CCCC07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7C77CCC9B77BB7B777B9C77C07DDDDDDDDDDD7F77FFF8F77FF8F777F8F7 + 7F07D7CCCCCC9BBBBB7BBBBB9CCCC07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D77777779777777777779777707DDDDDDDDDDD7888888888888888888888 + 8807D7CCCCCC9BBBBB7BBBBB9CCCC07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7C7777C9B77BB7B77BB9C7CC07DDDDDDDDDDD7F7777F8F77FF8F77FF8F7 + FF07D7CCCCCC9BBBBB7BBBBB9CCCC07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D77777779777777777779777707DDDDDDDDDDD7888888888888888888888 + 8807D7CCCCCC9BBBBB7BBBBB9CCCC07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7C777CC9B777B7B777B9C7CC07DDDDDDDDDDD7F777FF8F777F8F777F8F7 + FF07D7CCCCCC9BBBBB7BBBBB9CCCC07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D79999999777777777779999907DDDDDDDDDDD7888888888888888888888 + 8807D7CCCCCC9BBBBB7BBBBB9CCCC07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7C777CC9B777B7B77BB9C77C07DDDDDDDDDDD7F777FF8F777F8F77FF8F7 + 7F07D7CCCCCC9BBBBB7BBBBB9CCCC07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D77777779777777777779777707DDDDDDDDDDD7888888888888888888888 + 8807D7CCCCCC9BBBBB7BBBBB9CCCC07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7C777CC9B7B7B7B777B9C77C07DDDDDDDDDDD7F777FF8F7F7F8F777F8F7 + 7F07D7CCCCCC9BBBBB7BBBBB9CCCC07DCDDDDCDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D77777777777777777777777707DCCCCDCCDDD7777777777777777777777 + 7707D7F888887F88887F88887F88807DCCCCCCCCDD7888888788888788888788 + 8807D7F777787F77787F77787F77807DCCCCDCCDDD7877778787778787778787 + 7807D7FFFFFF7FFFFF7FFFFF7FFFF07DCDDDDCDDDD7888888788888788888788 + 8807D7777777777777777777777770DDDDDDDDDDDD7777777777777777777777 + 770DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgGrid: TImage + Left = 6 + Top = 31 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D7FFFFFF7FFFFF7FFFFF7FFFF07DCDDDDCDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7FFFFFF7FFFFF7FFFFF7FFFF07DCCCCDCCDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7F7777F7F777F7F777F7F7FF07DCCCCCCCCDD7F7777F8F777F8F777F8F7 + FF07D7FFFFFF7FFFFF7FFFFF7FFFF07DCCCCDCCDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D77777777777777777777777707DCDDDDCDDDD7888888888888888888888 + 8807D7FFFFFF7FFFFF7FFFFF7FFFF07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7F77F7F7F77FF7F7F7F7F77F07DDDDDDDDDDD7F77F7F8F77FF8F7F7F8F7 + 7F07D7FFFFFF7FFFFF7FFFFF7FFFF07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D77777777777777777777777707DDDDDDDDDDD7888888888888888888888 + 8807D7FFFFFF7FFFFF7FFFFF7FFFF07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7F7F7FF7F77FF7F777F7F77F07DDDDDDDDDDD7F7F7FF8F77FF8F777F8F7 + 7F07D7FFFFFF7FFFFF7FFFFF7FFFF07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D77777777777777777777777707DDDDDDDDDDD7888888888888888888888 + 8807D7FFFFFF7FFFFF7FFFFF7FFFF07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7F77FFF7F7F7F7F777F7F77F07DDDDDDDDDDD7F77FFF8F7F7F8F777F8F7 + 7F07D7FFFFFF7FFFFF7FFFFF7FFFF07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D77777777777777777777777707DDDDDDDDDDD7888888888888888888888 + 8807D7FFFFFF7FFFFF7FFFFF7FFFF07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7F7777F7F77FF7F77FF7F77F07DDDDDDDDDDD7F7777F8F77FF8F77FF8F7 + 7F07D7FFFFFF7FFFFF7FFFFF7FFFF07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D77777777777777777777777707DDDDDDDDDDD7888888888888888888888 + 8807D7FFFFFF7FFFFF7FFFFF7FFFF07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7F7777F7F77FF7F77FF7F77F07DDDDDDDDDDD7F7778F8F77FF8F77FF8F7 + 7F07D7FFFFFF7FFFFF7FFFFF7FFFF07DCDDDDCDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D77777777777777777777777707DCCCCDCCDDD7888888888888888888888 + 8807D78888887888887888887888807DCCCCCCCCDD7FFFFFF8FFFFF8FFFFF8FF + FF07D78777787877787877787877807DCCCCDCCDDD7F7777F8F777F8F777F8F7 + 7F07D78888887888887888887888807DCDDDDCDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7777777777777777777777770DDDDDDDDDDDD7777777777777777777777 + 770DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblShow: TLabel + Left = 5 + Top = 6 + Width = 26 + Height = 13 + Caption = 'Show' + end + object lblMiscellaneous: TLabel + Left = 5 + Top = 78 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + end + object chbxRowAutoHeight: TCheckBox + Left = 88 + Top = 105 + Width = 150 + Height = 17 + Caption = '&Row AutoHeight' + TabOrder = 2 + OnClick = chbxRowAutoHeightClick + end + object chbxShowRowAndColumnHeadings: TCheckBox + Left = 88 + Top = 27 + Width = 150 + Height = 17 + Caption = 'Row and column headings' + TabOrder = 0 + OnClick = chbxShowRowAndColumnHeadingsClick + end + object chbxShowGridlines: TCheckBox + Left = 88 + Top = 50 + Width = 150 + Height = 17 + Caption = 'Gridlines' + TabOrder = 1 + OnClick = chbxShowGridlinesClick + end + object chbxSuppressSourceFormats: TCheckBox + Left = 88 + Top = 128 + Width = 150 + Height = 17 + Caption = '&Suppress source formats' + TabOrder = 3 + OnClick = chbxSuppressSourceFormatsClick + end + object lblPreview: TStaticText + Left = 243 + Top = 3 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 4 + end + end + end + object tshColor: TTabSheet + Caption = '&Color' + object pnlColor: TPanel + Left = 0 + Top = 0 + Width = 541 + Height = 193 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblGridLinesColor: TLabel + Left = 6 + Top = 144 + Width = 79 + Height = 13 + Caption = '&Grid lines color : ' + OnClick = lblColorClick + end + object bvlLineColorHolder: TBevel + Left = 91 + Top = 140 + Width = 134 + Height = 21 + Visible = False + end + object gbxFixedTransparent: TGroupBox + Left = 5 + Top = 74 + Width = 231 + Height = 54 + Caption = ' ' + TabOrder = 3 + object lblFixedColor: TLabel + Left = 6 + Top = 24 + Width = 62 + Height = 13 + Caption = 'F&ixed color : ' + OnClick = lblColorClick + end + object bvlFixedColorHolder: TBevel + Left = 86 + Top = 20 + Width = 134 + Height = 21 + Visible = False + end + end + object gbxTransparent: TGroupBox + Left = 5 + Top = 8 + Width = 231 + Height = 54 + Caption = ' ' + TabOrder = 1 + object lblColor: TLabel + Left = 6 + Top = 24 + Width = 35 + Height = 13 + Caption = 'Co&lor : ' + OnClick = lblColorClick + end + object bvlColorHolder: TBevel + Left = 86 + Top = 20 + Width = 134 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 18 + Top = 6 + Width = 15 + Height = 17 + TabOrder = 0 + OnClick = chbxFixedTransparentClick + end + object chbxFixedTransparent: TCheckBox + Tag = 1 + Left = 18 + Top = 72 + Width = 15 + Height = 17 + TabOrder = 2 + OnClick = chbxFixedTransparentClick + end + object stTransparent: TStaticText + Left = 33 + Top = 7 + Width = 76 + Height = 17 + Caption = ' &Transparent ' + FocusControl = chbxTransparent + TabOrder = 4 + OnClick = stTransparentClick + end + object stFixedTransparent: TStaticText + Left = 33 + Top = 73 + Width = 98 + Height = 17 + Caption = ' Fixed Transparent ' + FocusControl = chbxFixedTransparent + TabOrder = 5 + OnClick = stFixedTransparentClick + end + end + end + object tshFont: TTabSheet + Caption = '&Font' + object pnlFont: TPanel + Left = 0 + Top = 0 + Width = 541 + Height = 193 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object btnFont: TButton + Left = 8 + Top = 9 + Width = 110 + Height = 23 + Caption = 'Fo&nt...' + TabOrder = 0 + OnClick = btnFixedFontClick + end + object edFont: TEdit + Left = 8 + Top = 38 + Width = 224 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + end + object btnFixedFont: TButton + Tag = 1 + Left = 8 + Top = 70 + Width = 110 + Height = 23 + Caption = 'Fi&xed Font...' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 2 + OnClick = btnFixedFontClick + end + object edFixedFont: TEdit + Left = 8 + Top = 99 + Width = 224 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 3 + end + end + end + object tshBehaviors: TTabSheet + Caption = '&Behaviors' + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 541 + Height = 193 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Image3: TImage + Left = 7 + Top = 102 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object Bevel3: TBevel + Left = 56 + Top = 83 + Width = 178 + Height = 4 + Shape = bsBottomLine + end + object Image1: TImage + Left = 22 + Top = 31 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888777777777777777708888888888 + 888887FFFFFFFFFFFFFFF08888888888888887F7777777777777F07777708888 + 888887F7777777777777F0FFFFF08888888887F7777777777777F07777F07777 + 708887FFFFFFFFFFFFFFF07777F0FFFFF08887F777777777777FF07777F07777 + F08887FFFFFFFFFFFFFFF0FFFFF07777F08887F77777777777FFF077FFF07777 + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777777FFFFF0777FF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777FFFFFFFF07FFFF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF0777FF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF077FFF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777777F077FFF077FF + F08887F7777777777777F0FFFFF0FFFFF08887F7777777777777F0FFFFF07FFF + F08887FFFFFFFFFFFFFFF07777F0FFFFF0888000000000000000007777F077FF + F08888888887F7777777777777F0FFFFF08888888887FFFFFFFFFFFFFFF07777 + F0888888888000000000000000007777F08888888888888887F7777777777777 + F08888888888888887FFFFFFFFFFFFFFF0888888888888888000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object Bevel10: TBevel + Left = 83 + Top = 10 + Width = 150 + Height = 4 + Shape = bsBottomLine + end + object lblOnEveryPage: TLabel + Left = 5 + Top = 6 + Width = 72 + Height = 13 + Caption = 'On Every Page' + end + object lblSelection: TLabel + Left = 5 + Top = 78 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object chbxOnlySelected: TCheckBox + Left = 88 + Top = 102 + Width = 150 + Height = 17 + Caption = 'Only &selected cells' + TabOrder = 1 + OnClick = chbxOnlySelectedClick + end + object chbxFixedRowsOnEveryPage: TCheckBox + Left = 88 + Top = 29 + Width = 150 + Height = 17 + Caption = 'Fi&xed Rows On Every Page' + TabOrder = 0 + OnClick = chbxFixedRowsOnEveryPageClick + end + end + end + end + object pnlPreview: TPanel + Left = 253 + Top = 50 + Width = 289 + Height = 165 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 0 + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxSSLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxSSLnk.pas new file mode 100644 index 00000000..24798705 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxSSLnk.pas @@ -0,0 +1,3064 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxSSLnk; + +interface + +{$I cxVer.inc} + +{$IFDEF CBUILDER5} + (*$HPPEMIT '#define HRGN unsigned'*) +{$ELSE} + (*$HPPEMIT '#define HRGN int'*) +{$ENDIF} + +uses + Windows, Classes, Graphics, Controls, StdCtrls, ExtCtrls, ComCtrls, Dialogs, + cxSSTypes, cxSSData, cxSSStyles, cxSSheet, cxExcelConst, dxPSCore, dxPSForm, + dxPSGlbl, dxPSBaseGridLnk, dxPSExcelEdgePatterns, dxPSExcelFillPatterns, + dxPSEdgePatterns, dxPSFillPatterns; + +type + PdxPSCellBorder = ^TdxPSCellBorder; + TdxPSCellBorder = record + Color: TColor; + Pattern: TdxPSEdgePatternClass; + end; + + PdxPSCellBorders = ^TdxPSCellBorders; + TdxPSCellBorders = array[TdxCellSide] of TdxPSCellBorder; + + TdxPSCellBorderCorner = (cbcTopLeft, cbcTopRight, cbcBottomRight, cbcBottomLeft); + TdxPSCellBorderCorners = set of TdxPSCellBorderCorner; + + TdxPSCellBorderEnd = (cbsTopLeft, cbsBottomRight); + TdxPSCellBorderEnds = set of TdxPSCellBorderEnd; + + TdxPSCellBorderSub = 0..3; + + TdxPSCellCorner = (ccTopLeft, ccTopRight, ccBottomRight, ccBottomLeft); + + TdxPSCellPatternsBorderPainter = class; + TdxPSGridCellsAdapter = class; + + TdxReportCellSSString = class(TdxReportCellString) + private + FBorders: TdxPSCellBorders; + FBorderSlants: DWORD; + FBorderSubs: DWORD; + FContentBkColor: TColor; + FContentPattern: TdxPSFillPatternClass; + FRealCol: Integer; + FRealRow: Integer; + FTextExtentLeft: Integer; + FTextExtentRight: Integer; + function GetBorder(ASide: TdxCellSide): TdxPSCellBorder; + function GetBordersBkColor: TColor; + function GetBorderSlant(ASide: TdxCellSide; ACorner: TdxPSCellBorderCorner): Integer; + function GetBorderSlantOffset(ASide: TdxCellSide; ACorner: TdxPSCellBorderCorner): TDWORDBits; + function GetBorderSub(ASide: TdxCellSide; AEnd: TdxPSCellBorderEnd): TdxPSCellBorderSub; + function GetBorderSubMask(ASide: TdxCellSide; AEnd: TdxPSCellBorderEnd): DWORD; + function GetBorderSubOffset(ASide: TdxCellSide; AEnd: TdxPSCellBorderEnd): TDWORDBits; + function GetClipContent: Boolean; + function GetCol: Integer; + function GetFill: Boolean; + function GetIsFixed: Boolean; + function GetIsMerged: Boolean; + function GetIsNearMostLeft: Boolean; + function GetIsNearMostTop: Boolean; + function GetIsNearMostTopOrLeft: Boolean; + function GetIsVirtual: Boolean; + function GetRow: Integer; + procedure SetBorder(ASide: TdxCellSide; Value: TdxPSCellBorder); + procedure SetBorderSlant(ASide: TdxCellSide; ACorner: TdxPSCellBorderCorner; Value: Integer); + procedure SetBorderSub(ASide: TdxCellSide; AEnd: TdxPSCellBorderEnd; Value: TdxPSCellBorderSub); + procedure SetClipConent(Value: Boolean); + procedure SetFill(Value: Boolean); + procedure SetIsFixed(Value: Boolean); + procedure SetIsMerged(Value: Boolean); + procedure SetIsNearMostLeft(Value: Boolean); + procedure SetIsNearMostTop(Value: Boolean); + procedure SetIsVirtual(Value: Boolean); + protected + procedure CalcBorderSubs(AnAdapter: TdxPSGridCellsAdapter); + procedure CalcDoubleBorderSlants(AnAdapter: TdxPSGridCellsAdapter); + + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); override; + function GetBackgroundBounds(DC: HDC): TRect; override; + function GetBorderEdgeBounds(ASide: TdxCellSide; const AOuterRect: TRect): TRect; override; + function GetBorderBrush(ASide: TdxCellSide): HBRUSH; + function GetBorderEdgeClass(ASide: TdxCellSide): TdxPSCellBorderClass; override; + function GetEffectiveBounds(DC: HDC; AStage: TdxPSRenderStages): TRect; override; + function GetTextBounds(DC: HDC): TRect; override; + function IsDrawn(DC: HDC; AStage: TdxPSRenderStages; const ARect: TRect): Boolean; override; + + function GetBorderPainterClass: TdxPSCellBorderPainterClass; override; + procedure InitBorderPainter(ABordersPainter: TdxPSCellBorderPainter); override; + + function GetContentBkColor: TColor; override; + function GetContentPattern: TdxPSFillPatternClass; override; + procedure SetContentBkColor(Value: TColor); override; + procedure SetContentPattern(Value: TdxPSFillPatternClass); override; + + procedure ReadBorders(AReader: TdxPSDataReader); + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteBorders(AWriter: TdxPSDataWriter); + procedure WriteData(AWriter: TdxPSDataWriter); override; + + function GetAbsoluteInnerBounds(DC: HDC): TRect; + function GetDoubleBorderRgn(ASide: TdxCellSide; const R: TRect): HRGN; + function IsDoubleLineBorderPattern(ABorder: TdxPSCellBorder): Boolean; overload; + function IsDoubleLineBorderPattern(ASide: TdxCellSide): Boolean; overload; + function NullBorder: TdxPSCellBorder; + public + constructor Create(AParent: TdxReportCell); override; + procedure Assign(Source: TPersistent); override; + + procedure SetBorders(AColor: TColor; APattern: TdxPSEdgePatternClass); + + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + + property Borders[ASide: TdxCellSide]: TdxPSCellBorder read GetBorder write SetBorder; + property BordersBkColor: TColor read GetBordersBkColor; + property BorderSlants[ASide: TdxCellSide; ACorner: TdxPSCellBorderCorner]: Integer read GetBorderSlant write SetBorderSlant; + property BorderSubs[ASide: TdxCellSide; AEnd: TdxPSCellBorderEnd]: TdxPSCellBorderSub read GetBorderSub write SetBorderSub; + property ClipContent: Boolean read GetClipContent write SetClipConent; + property Col: Integer read GetCol; + property Fill: Boolean read GetFill write SetFill; + property IsFixed: Boolean read GetIsFixed write SetIsFixed; + property IsMerged: Boolean read GetIsMerged write SetIsMerged; + property IsNearMostLeft: Boolean read GetIsNearMostLeft write SetIsNearMostLeft; + property IsNearMostTop: Boolean read GetIsNearMostTop write SetIsNearMostTop; + property IsNearMostTopOrLeft: Boolean read GetIsNearMostTopOrLeft; + property IsVirtual: Boolean read GetIsVirtual write SetIsVirtual; + property RealCol: Integer read FRealCol write FRealCol; + property RealRow: Integer read FRealRow write FRealRow; + property Row: Integer read GetRow; + property TextExtentLeft: Integer read FTextExtentLeft write FTextExtentLeft; + property TextExtentRight: Integer read FTextExtentRight write FTextExtentRight; + end; + + TdxPSCellPatternsBorderPainter = class(TdxPSCellBorderPainter) + private + FGridAdapter: TdxPSGridCellsAdapter; + protected + function ClipItemBounds(DC: HDC; AOuterRect: TRect): HRGN; + procedure DrawBorder(DC: HDC; const R: TRect; AForeColor, ABkColor: TColor; ABrush: HBRUSH); overload; + procedure DrawBorder(DC: HDC; ABorderRgn: HRGN; AForeColor, ABkColor: TColor; ABrush: HBRUSH); overload; + public + function Item: TdxReportCellSSString; reintroduce; overload; + procedure Paint(DC: HDC); override; + + property GridAdapter: TdxPSGridCellsAdapter read FGridAdapter; + end; + + TdxPSGridCellsAdapter = class + private + FReportCells: TdxReportCells; + function GetCell(Col, Row: Integer): TdxReportCellSSString; + function GetColCount: Integer; + function GetColOffset(Index: Integer): Integer; + function GetColWidth(Index: Integer): Integer; + function GetRow(Index: Integer): TdxReportCell; + function GetRowCount: Integer; + function GetRowHeight(Index: Integer): Integer; + function GetRowIndex(Index: Integer): Integer; + function GetRowOffset(Index: Integer): Integer; + public + constructor Create(AReportCells: TdxReportCells); + function GetNeighborCell(AItem: TdxReportCellSSString; ASide: TdxCellSide): TdxReportCellSSString; + + property Cells[Col, Row: Integer]: TdxReportCellSSString read GetCell; default; + property ColCount: Integer read GetColCount; + property ColOffsets[Index: Integer]: Integer read GetColOffset; + property ColWidths[Index: Integer]: Integer read GetColWidth; + property RowCount: Integer read GetRowCount; + property RowHeights[Index: Integer]: Integer read GetRowHeight; + property RowIndexes[Index: Integer]: Integer read GetRowIndex; + property RowOffsets[Index: Integer]: Integer read GetRowOffset; + property Rows[Index: Integer]: TdxReportCell read GetRow; + end; + + TdxPSSSStringGridCellDataMap = class(TdxPSTextGridCellDataMap) + protected + class procedure InitializeCellData(ACol, ARow: Integer; ADataItem: TAbstractdxReportCellData; + AReportLink: TAbstractdxGridReportLink); override; + class function DataClass: TdxReportCellDataClass; override; + end; + + TdxPSSpreadSheetReportLinkOptionView = (ssovRowAndColumnHeadings, ssovGridLines, ssovSuppressSourceFormats); + TdxPSSpreadSheetReportLinkOptionsView = set of TdxPSSpreadSheetReportLinkOptionView; + + TCustomdxSpreadSheetReportLink = class(TAbstractdxGridReportLink) + private + FAppendingExtraColumns: Boolean; + FColCount: Integer; + FCellObjects: TList; + FExtraColumnCount: Integer; + FGridAdapter: TdxPSGridCellsAdapter; + FOptionsView: TdxPSSpreadSheetReportLinkOptionsView; + FPrintArea: TRect; + FProcessingMerges: Boolean; + FRowCount: Integer; + FTempFont: TFont; + function GetBookSheet: TcxSSBookSheet; + function GetCustomSpreadSheetBook: TcxCustomSpreadSheetBook; + function GetMeaningColCount: Integer; + function GetMeaningRowCount: Integer; + function GetMergedCells: TcxSSMergedCellsStorage; + procedure SetOptionsView(Value: TdxPSSpreadSheetReportLinkOptionsView); + procedure SetPrintArea(Value: TRect); + function GetSSCellObject(ACol, ARow: Integer): TcxSSCellObject; + function GetSSCellStyle(ACol, ARow: Integer): TcxSSCellStyle; + function GetSSColorPalette: PcxExcelPalette; + function GetSSDataStorage: TcxSSDataStorage; + function GetSSDefaultCellSideColor(ASide: TdxCellSide): TColor; + function GetSSDefaultStyle: TcxSSCellStyle; + function GetFlatIndex(ACol, ARow: Integer): Integer; + function GetRealColor(AColorIndex: Integer; ADefaultColor: TColor): TColor; + function IsSSDefaultStyle(AStyle: TcxSSCellStyle): Boolean; + protected + FSourceHeaderFontIndex: Integer; + + function CannotActivateReportErrorString: string; override; + procedure DoChangeComponent; override; + procedure InternalRestoreDefaults; override; + procedure InternalRestoreFromOriginal; override; + function IsScaleGridLines: Boolean; override; + function NeedTwoPassRendering: Boolean; override; + + function GetDataItemClass(ACol: Integer; ARow: Integer = 0): TdxReportCellDataClass; override; + + function GetColCount: Integer; override; + function GetFixedColCount: Integer; override; + function GetFixedRowCount: Integer; override; + function GetRowCount: Integer; override; + + function GetCellSides(ACol, ARow: Integer): TdxCellSides; override; + function GetCellText(ACol, ARow: Integer): string; override; + function GetCellTextAlignY(ACol, ARow: Integer): TdxTextAlignY; override; + function GetMinRowHeight(DC: HDC; AFont: TFont): Integer; override; + function GetSelectionRect: TRect; override; + function GetSourceCellColor(ACol, ARow: Integer): TColor; override; + function GetSourceCellContentBkColor(ACol, ARow: Integer): TColor; override; + function GetSourceCellContentPattern(ACol, ARow: Integer): TdxPSFillPatternClass; override; + function GetSourceCellEdge3DSoft(ACol, ARow: Integer): Boolean; override; + function GetSourceCellEdgeMode(ACol, ARow: Integer): TdxCellEdgeMode; override; + function GetSourceCellFontIndex(ACol, ARow: Integer): Integer; override; + function GetSourceCellMultiline(ACol, ARow: Integer): Boolean; override; + function GetSourceCellTextAlignX(ACol, ARow: Integer): TdxTextAlignX; override; + function GetSourceCellTextAlignY(ACol, ARow: Integer): TdxTextAlignY; override; + function GetSourceCellTransparent(ACol, ARow: Integer): Boolean; override; + function GetSourceColWidth(ACol: Integer): Integer; override; + function GetSourceRowHeight(ARow: Integer): Integer; override; + function HasSelection: Boolean; override; + function IsDrawBorder: Boolean; override; + function IsDrawHorzLines: Boolean; override; + function IsDrawVertLines: Boolean; override; + function IsProcessedCol(ACol: Integer): Boolean; override; + function IsProcessedRow(ARow: Integer): Boolean; override; + + procedure AfterConstruct(AReportCells: TdxReportCells); override; + procedure PrepareConstruct(AReportCells: TdxReportCells); override; + procedure UnprepareConstruct(AReportCells: TdxReportCells); override; + + procedure AddMerges(AReportCells: TdxReportCells); + procedure AppendAdditionalColumns(AnAdapter: TdxPSGridCellsAdapter); + procedure CalcTextExtents(AnAdapter: TdxPSGridCellsAdapter); + procedure DeleteCellObjects; + procedure DeleteUnneededCellSides(AnAdapter: TdxPSGridCellsAdapter); + procedure FixupRowWidths(AnAdapter: TdxPSGridCellsAdapter); + function HasMerges: Boolean; + function IsEmptyCell(const ACell: TcxSSCellRec): Boolean; + function OnlyEdgeIsAssigned(const ACell: TcxSSCellRec; AEdge: TcxSSEdgeBorder): Boolean; + function OnlyLeftEdgeIsAssigned(ACell: TcxSSCellRec): Boolean; + function OnlyTopEdgeIsAssigned(ACell: TcxSSCellRec): Boolean; + procedure PostProcessItems(AnAdapter: TdxPSGridCellsAdapter); + procedure SetupCellBorders(ACol, ARow: Integer; ADataItem: TAbstractdxReportCellData); virtual; + + procedure CheckPrintAreaBounds(var R: TRect); + function GetColumnOffset(ACol: Integer): Integer; + function GetRowOffset(ARow: Integer): Integer; + function IsMergedBorder(ACol, ARow: Integer; ASide: TdxCellSide): Boolean; + function IsMergedCell(ACol, ARow: Integer): Boolean; virtual; + function IsNearMostLeftCell(ACol, ARow: Integer): Boolean; virtual; + function IsNearMostTopCell(ACol, ARow: Integer): Boolean; virtual; + function IsShowGridLines: Boolean; + function IsShowRowAndColumnHeadings: Boolean; + function IsSuppressSourceFormats: Boolean; + + property ColCount: Integer read GetColCount; + property ExtraColumnCount: Integer read FExtraColumnCount; + property MeaningColCount: Integer read GetMeaningColCount; + property MeaningRowCount: Integer read GetMeaningRowCount; + property MergedCells: TcxSSMergedCellsStorage read GetMergedCells; + property RowCount: Integer read GetRowCount; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + procedure ClearPrintArea; + function DataProviderPresent: Boolean; override; + function DataToPrintExist: Boolean; virtual; + function PrintAreaExists: Boolean; virtual; + + property BookSheet: TcxSSBookSheet read GetBookSheet; + property CustomSpreadSheetBook: TcxCustomSpreadSheetBook read GetCustomSpreadSheetBook; + property PrintArea: TRect read FPrintArea write SetPrintArea; + published + property Color; + property Effects3D; + property FixedColor; + property FixedFont; + property FixedTransparent; + property Font; + property GridLineColor; + property HeadersOnEveryPage; + property OnlySelected; + property OptionsView: TdxPSSpreadSheetReportLinkOptionsView read FOptionsView write SetOptionsView + default [ssovRowAndColumnHeadings]; + property RowAutoHeight; + property ScaleFonts; + property Soft3D; + property Transparent; + property UseCustomPageBreaks; + property UseHorzDelimiters; + property UseVertDelimiters; + + property OnGetCustomPageBreaks; + property OnInitializeItem; + end; + + TdxSpreadSheetBookReportLink = class(TCustomdxSpreadSheetReportLink) + private + function GetSpreadSheetBook: TcxSpreadSheetBook; + public + property SpreadSheetBook: TcxSpreadSheetBook read GetSpreadSheetBook; + end; + + TdxSpreadSheetReportLink = class(TCustomdxSpreadSheetReportLink) + private + function GetSpreadSheet: TcxSpreadSheet; + public + property SpreadSheet: TcxSpreadSheet read GetSpreadSheet; + end; + + TfmdxSpreadSheetDesignWindow = class(TStandarddxReportLinkDesignWindow) + pnlPreview: TPanel; + pgctrlMain: TPageControl; + tshOptions: TTabSheet; + pnlOptions: TPanel; + lblShow: TLabel; + Bevel11: TBevel; + lblMiscellaneous: TLabel; + Bevel4: TBevel; + Image5: TImage; + imgGrid: TImage; + chbxRowAutoHeight: TCheckBox; + tshColor: TTabSheet; + pnlColor: TPanel; + lblGridLinesColor: TLabel; + bvlLineColorHolder: TBevel; + gbxFixedTransparent: TGroupBox; + lblFixedColor: TLabel; + bvlFixedColorHolder: TBevel; + gbxTransparent: TGroupBox; + lblColor: TLabel; + bvlColorHolder: TBevel; + chbxTransparent: TCheckBox; + chbxFixedTransparent: TCheckBox; + tshFont: TTabSheet; + pnlFont: TPanel; + btnFont: TButton; + edFont: TEdit; + btnFixedFont: TButton; + edFixedFont: TEdit; + tshBehaviors: TTabSheet; + Panel1: TPanel; + Image3: TImage; + lblSelection: TLabel; + Bevel3: TBevel; + lblOnEveryPage: TLabel; + Image1: TImage; + Bevel10: TBevel; + chbxOnlySelected: TCheckBox; + chbxFixedRowsOnEveryPage: TCheckBox; + chbxShowRowAndColumnHeadings: TCheckBox; + chbxShowGridLines: TCheckBox; + chbxSuppressSourceFormats: TCheckBox; + lblPreview: TStaticText; + stTransparent: TStaticText; + stFixedTransparent: TStaticText; + procedure chbxFixedRowsOnEveryPageClick(Sender: TObject); + procedure chbxOnlySelectedClick(Sender: TObject); + procedure btnFixedFontClick(Sender: TObject); + procedure chbxRowAutoHeightClick(Sender: TObject); + procedure chbxSuppressSourceFormatsClick(Sender: TObject); + procedure chbxShowRowAndColumnHeadingsClick(Sender: TObject); + procedure chbxShowGridLinesClick(Sender: TObject); + procedure chbxFixedTransparentClick(Sender: TObject); + procedure ccbxColorChange(Sender: TObject); + procedure pbxPreviewPaint(Sender: TObject); + procedure lblColorClick(Sender: TObject); + procedure pgctrlMainChange(Sender: TObject); + procedure stTransparentClick(Sender: TObject); + procedure stFixedTransparentClick(Sender: TObject); + private + FccbxColor: TCustomComboBox; + FccbxFixedColor: TCustomComboBox; + FccbxGridLineColor: TCustomComboBox; + FPreviewBox: TCustomControl; + function GetReportLink: TCustomdxSpreadSheetReportLink; + procedure SetReportLink(Value: TCustomdxSpreadSheetReportLink); + procedure CreateControls; + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + protected + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + procedure LoadStrings; override; + procedure PaintPreview(ACanvas: TCanvas; R: TRect); override; + procedure UpdateControlsState; override; + procedure UpdatePreview; override; + public + constructor Create(AOwner: TComponent); override; + property ReportLink: TCustomdxSpreadSheetReportLink read GetReportLink write SetReportLink; + end; + +const + dxPSEmptySSPrintArea: TRect = (Left: -1; Top: -1; Right: -1; Bottom: -1); + + dxPSCellSideMap: array[TcxSSEdgeBorder] of TdxCellSide = (csLeft, csTop, csRight, csBottom); + cxSSEdgeBorderMap: array[TdxCellSide] of TcxSSEdgeBorder = (eLeft, eTop, eRight, eBottom); + + dxCellEdgeSideOrientation: array[TdxCellSide] of TdxPSCellEdgePatternOrientation = + (cepoVertical, cepoHorizontal, cepoVertical, cepoHorizontal); + + dxPSEdgePatternClassMap: array[TcxSSEdgeLineStyle] of TdxPSEdgePatternClass = + (TdxPSSolidEdgePattern, TdxPSSolidEdgePattern, TdxPSMediumSolidEdgePattern, + TdxPSDashedEdgePattern, TdxPSDottedEdgePattern, TdxPSThickSolidEdgePattern, + TdxPSDoubleLineSolidEdgePattern, TdxPSHairEdgePattern, TdxPSMediumDashedEdgePattern, + TdxPSDashDotEdgePattern, TdxPSMediumDashDotEdgePattern, TdxPSDashDotDotEdgePattern, + TdxPSMediumDashDotDotEdgePattern, TdxPSSlantedDashDotEdgePattern, TdxPSSolidEdgePattern); + + dxPSFillPatternClassMap: array[TcxSSFillStyle] of TdxPSFillPatternClass = + (TdxPSSolidFillPattern, TdxPSGray75FillPattern, TdxPSGray50FillPattern, + TdxPSGray25FillPattern, TdxPSGray125FillPattern, TdxPSGray625FillPattern, + TdxPSHorizontalStripeFillPattern, TdxPSVerticalStripeFillPattern, + TdxPSDiagonalStripeFillPattern, TdxPSReverseDiagonalStripeFillPattern, + TdxPSDiagonalCrossHatchFillPattern, TdxPSThickCrossHatchFillPattern, + TdxPSThinHorizontalStripeFillPattern, TdxPSThinVerticalStripeFillPattern, + TdxPSThinDiagonalStripeFillPattern, TdxPSThinReverseDiagonalStripeFillPattern, + TdxPSThinHorizontalCrossHatchFillPattern, TdxPSThinDiagonalCrossHatchFillPattern); + + dxPSTextAlignXMap: array[TcxDisplayTextAlignment] of TdxTextAlignX = + (taLeft, taCenterX, taRight, taLeft, taDistributeX); + dxPSTextAlignYMap: array[TcxVertTextAlign] of TdxTextAlignY = + (taTop, taCenterY, taBottom, taDistributeY); + +implementation + +{$R *.DFM} + +uses + SysUtils, Forms, cxSSUtils, cxClasses, dxPSRes, dxPSUtl, dxExtCtrls, dxPrnDev; + +const + { Since we don't use following Format Bits in TdxReportCellSSString we are allowed to safely override them } + dxFormatClipContent = dxPSGlbl.dxFormatMakeSpaceForEmptyImage; + dxFormatFill = dxPSGlbl.dxFormatCheckEnabled; + dxFormatFixed = dxPSGlbl.dxFormatCheckBold; + dxFormatMerged = dxPSGlbl.dxFormatImageTransparent; + dxFormatNearMostLeft = dxPSGlbl.dxFormatCheckFlat; + dxFormatNearMostTop = dxPSGlbl.dxFormatCheckChecked; + dxFormatVirtual = dxPSGlbl.dxFormatImageTransparent; + + SubEndMask = $00000003; + SubBitsPerEnd = 2; + SubBitsPerSide = SubBitsPerEnd * (Integer(High(TdxPSCellBorderEnd)) + 1); + SlantBitsPerSide = 4; + SlantMask = $00000001; + + { from SS } + SystemColorStart = 55; + +type + TcxCustomSpreadSheetBookAccess = class(TcxCustomSpreadSheetBook); + TcxSSBookSheetAccess = class(TcxSSBookSheet); + TcxSSDataStorageAccess = class(TcxSSDataStorage); + TcxSSCellStyleAccess = class(TcxSSCellStyle); + +function AreBackgroundsEqual(AStyle1, AStyle2: TcxSSCellStyleRec): Boolean; +begin + Result := + (AStyle1.BrushStyle = AStyle2.BrushStyle) and + (AStyle1.BrushBkColor = AStyle2.BrushBkColor) and + (AStyle1.BrushFgColor = AStyle2.BrushFgColor); +end; + +function AreEdgesEqual(AEdge1, AEdge2: TcxSSEdgeStyleRec): Boolean; +begin + Result := (AEdge1.Color = AEdge2.Color) and (AEdge1.Style = AEdge2.Style); +end; + +function AreBordersEqual(ABorders1, ABorders2: TcxSSBordersStyle; + AExclusion: TcxSSEdgeBorders = []): Boolean; +var + Edge: TcxSSEdgeBorder; +begin + for Edge := eLeft to eBottom do + begin + if Edge in AExclusion then + Result := not AreEdgesEqual(ABorders1[Edge], ABorders2[Edge]) + else + Result := AreEdgesEqual(ABorders1[Edge], ABorders2[Edge]); + if not Result then Break; + end; +end; + +function AreStylesEqual(AStyle1, AStyle2: TcxSSCellStyleRec; + AExclusion: TcxSSEdgeBorders = []): Boolean; +begin + Result := AreBackgroundsEqual(AStyle1, AStyle2) and + AreBordersEqual(AStyle1.Borders, AStyle2.Borders, AExclusion); +end; + +function IsCellDataEmpty(const ACell: TcxSSCellRec): Boolean; +begin + Result := (ACell.Text = '') and (ACell.DateTime = 0); +end; + +function ExposeBookSheet(ASpreadSheet: TcxSSBookSheet): TcxSSBookSheetAccess; +begin + Result := TcxSSBookSheetAccess(ASpreadSheet); +end; + +function ExposeDataStorage(ADataStorage: TcxSSDataStorage): TcxSSDataStorageAccess; +begin + Result := TcxSSDataStorageAccess(ADataStorage); +end; + +function ExposeSpreadSheetBook(ASpreadSheetBook: TcxCustomSpreadSheetBook): TcxCustomSpreadSheetBookAccess; +begin + Result := TcxCustomSpreadSheetBookAccess(ASpreadSheetBook); +end; + +function ExposeActiveSpreadSheet(ASpreadSheetBook: TcxCustomSpreadSheetBook): TcxSSBookSheetAccess; +begin + Result := ExposeBookSheet(ExposeSpreadSheetBook(ASpreadSheetBook).ActiveSheet); +end; + +function ExposeStyle(AStyle: TcxSSCellStyle): TcxSSCellStyleAccess; +begin + Result := TcxSSCellStyleAccess(AStyle); +end; + +function GetTextWidth(DC: HDC; AFont: HFONT; const S: string): Integer; +var + Size: TSize; +begin + AFont := SelectObject(DC, AFont); + GetTextExtentPoint32(DC, PChar(S), Length(S), Size); + SelectObject(DC, AFont); + Result := Size.cx; +end; + +{ TdxReportCellSSString } + +constructor TdxReportCellSSString.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + PreventLeftTextExceed := False; + TextAlignY := taBottom; +end; + +procedure TdxReportCellSSString.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TdxReportCellSSString then + begin + FBorders := TdxReportCellSSString(Source).FBorders; + FBorderSlants := TdxReportCellSSString(Source).FBorderSlants; + FBorderSubs := TdxReportCellSSString(Source).FBorderSubs; + FContentBkColor := TdxReportCellSSString(Source).FContentBkColor; + FContentPattern := TdxReportCellSSString(Source).FContentPattern; + FRealCol := TdxReportCellSSString(Source).FRealCol; + FRealRow := TdxReportCellSSString(Source).FRealRow; + FTextExtentLeft := TdxReportCellSSString(Source).FTextExtentLeft; + FTextExtentRight := TdxReportCellSSString(Source).FTextExtentRight; + end; +end; + +procedure TdxReportCellSSString.SetBorders(AColor: TColor; APattern: TdxPSEdgePatternClass); +var + Side: TdxCellSide; +begin + for Side := csLeft to csBottom do + with Borders[Side] do + begin + Color := AColor; + Pattern := APattern; + end; +end; + +procedure TdxReportCellSSString.DrawContent(DC: HDC; AStage: TdxPSRenderStages); +begin + if rsFirstPass in AStage then + if IsBackgroundDrawn then DrawBackground(DC); + if rsSecondPass in AStage then + begin + if IsTextDrawn then DrawText(DC); + if IsBordersDrawn then DrawBorders(DC); + end; +end; + +procedure TdxReportCellSSString.CalcBorderSubs(AnAdapter: TdxPSGridCellsAdapter); + + function GetNeighborCell(ASide: TdxCellSide): TdxReportCellSSString; + begin + Result := AnAdapter.GetNeighborCell(Self, ASide); + end; + + function GetNeighborCellBorder(ASide, ABorderSide: TdxCellSide): TdxPSCellBorder; + var + Neighbor: TdxReportCellSSString; + begin + Neighbor := GetNeighborCell(ASide); + if Neighbor <> nil then + Result := Neighbor.Borders[ABorderSide] + else + Result := NullBorder; + end; + + function GetNeighborCellBorderSalient(ASide, ABorderSide: TdxCellSide; + ASalient: TdxPSCellBorderSalientType): Integer; + var + Neighbor: TdxReportCellSSString; + begin + Neighbor := GetNeighborCell(ASide); + if Neighbor <> nil then + Result := Neighbor.BorderEdgeSalients[ABorderSide, ASalient] + else + Result := 0; + end; + + procedure GetBordersAtCorner(ACorner: TdxPSCellCorner; out ABorders: TdxPSCellBorders); + begin + case ACorner of + ccTopLeft: + begin + ABorders[csLeft] := GetNeighborCellBorder(csLeft, csTop); + ABorders[csTop] := GetNeighborCellBorder(csTop, csLeft); + ABorders[csRight] := Borders[csTop]; + ABorders[csBottom] := Borders[csLeft]; + end; + ccTopRight: + begin + ABorders[csLeft] := Borders[csTop]; + ABorders[csTop] := GetNeighborCellBorder(csTop, csRight); + ABorders[csRight] := GetNeighborCellBorder(csRight, csTop); + ABorders[csBottom] := Borders[csRight]; + end; + ccBottomRight: + begin + ABorders[csLeft] := Borders[csBottom]; + ABorders[csTop] := Borders[csRight]; + ABorders[csRight] := GetNeighborCellBorder(csRight, csBottom); + ABorders[csBottom] := GetNeighborCellBorder(csBottom, csRight); + end; + ccBottomLeft: + begin + ABorders[csLeft] := GetNeighborCellBorder(csLeft, csBottom); + ABorders[csTop] := Borders[csLeft]; + ABorders[csRight] := Borders[csBottom]; + ABorders[csBottom] := GetNeighborCellBorder(csBottom, csLeft); + end; + end; + end; + + function DontNeedCornerSubsCalculation(ACorner: TdxPSCellCorner; ABorders: TdxPSCellBorders): Boolean; + var + BorderCount, DblCount: Integer; + Color: TColor; + Side: TdxCellSide; + Border: TdxPSCellBorder; + begin + BorderCount := 0; + DblCount := 0; + Color := clBlack; + + Result := False; + for Side := csLeft to csBottom do + begin + Border := ABorders[Side]; + if Border.Pattern = nil then Continue; + + Inc(BorderCount); + if IsDoubleLineBorderPattern(Border) then + Inc(DblCount); + + if (DblCount <> 0) and (DblCount <> BorderCount) then + Exit; + + if BorderCount = 1 then + Color := Border.Color + else + if Color <> Border.Color then + Exit; + end; + Result := True; + end; + + function GetFavoriteSides(ACorner: TdxPSCellCorner; const ABorders: TdxPSCellBorders): TdxCellSides; + const + CornerSideMaps: array[TdxPSCellCorner, TdxCellSide] of TdxCellSides = + (([], [], [csTop], [csLeft]), + ([csTop], [], [], [csRight]), + ([csBottom], [csRight], [], []), + ([], [csLeft], [csBottom], [])); + var + StartSide, FavoriteSide, Side: TdxCellSide; + DblCount: Integer; + DblCandidates: TdxCellSides; + Border, FavoriteBorder: TdxPSCellBorder; + begin + StartSide := csLeft; + while (StartSide < csBottom) and (ABorders[StartSide].Pattern = nil) do + Inc(StartSide); + FavoriteSide := StartSide; + FavoriteBorder := ABorders[FavoriteSide]; + + DblCount := 0; + DblCandidates := []; + for Side := StartSide to csBottom do + begin + Border := ABorders[Side]; + if Border.Pattern = nil then Continue; + + if IsDoubleLineBorderPattern(Border) then + begin + Inc(DblCount); + DblCandidates := DblCandidates + CornerSideMaps[ACorner, Side]; + end; + + if Side > StartSide then + if not IsDoubleLineBorderPattern(Border) and + (IsDoubleLineBorderPattern(FavoriteBorder) or + (Border.Pattern.Thickness > FavoriteBorder.Pattern.Thickness) or + ((Border.Pattern.Thickness = FavoriteBorder.Pattern.Thickness) and + (Border.Color < FavoriteBorder.Color))) then + begin + FavoriteBorder := Border; + FavoriteSide := Side; + end; + end; + + if DblCount > 1 then + Result := DblCandidates + else + Result := CornerSideMaps[ACorner, FavoriteSide]; + end; + + function CalcBorderSub(ASide: TdxCellSide; AEnd: TdxPSCellBorderEnd): Integer; + const + ConcurSides: array[TdxCellSide, TdxPSCellBorderEnd] of TdxCellSide = + ((csTop, csBottom), + (csLeft, csRight), + (csTop, csBottom), + (csLeft, csRight)); + var + ConcurSide: TdxCellSide; + begin + ConcurSide := ConcurSides[ASide, AEnd]; + Result := BorderEdgeSalients[ConcurSide, bstOuter] + + Max(BorderEdgeSalients[ConcurSide, bstInner], GetNeighborCellBorderSalient(ASide, ConcurSide, bstInner)); + end; + +const + BorderEnds: array[TdxPSCellCorner, TdxCellSide] of TdxPSCellBorderEnd = + ((cbsTopLeft, cbsTopLeft, cbsTopLeft, cbsTopLeft), + (cbsTopLeft, cbsBottomRight, cbsTopLeft, cbsTopLeft), + (cbsBottomRight, cbsBottomRight, cbsBottomRight, cbsBottomRight), + (cbsBottomRight, cbsTopLeft, cbsTopLeft, cbsTopLeft)); + CornerSides: array[TdxPSCellCorner] of TdxCellSides = + ([csLeft, csTop], + [csTop, csRight], + [csRight, csBottom], + [csBottom, csLeft]); +var + Corner: TdxPSCellCorner; + Borders: TdxPSCellBorders; + UnfavorableSides: TdxCellSides; + Side: TdxCellSide; + BorderEnd: TdxPSCellBorderEnd; +begin + for Corner := ccTopLeft to ccBottomLeft do + begin + GetBordersAtCorner(Corner, Borders); + if DontNeedCornerSubsCalculation(Corner, Borders) then + Continue; + + UnfavorableSides := CornerSides[Corner] - GetFavoriteSides(Corner, Borders); + for Side := csLeft to csBottom do + if Side in UnfavorableSides then + begin + BorderEnd := BorderEnds[Corner, Side]; + BorderSubs[Side, BorderEnd] := CalcBorderSub(Side, BorderEnd); + end; + end; +end; + +procedure TdxReportCellSSString.CalcDoubleBorderSlants(AnAdapter: TdxPSGridCellsAdapter); +var + Neighbor: TdxReportCellSSString; +begin + if IsDoubleLineBorderPattern(csLeft) then + begin + Neighbor := AnAdapter.GetNeighborCell(Self, csLeft); + BorderSlants[csLeft, cbcTopLeft] := Ord((Neighbor <> nil) and Neighbor.IsDoubleLineBorderPattern(csTop)); + BorderSlants[csLeft, cbcTopRight] := Ord(IsDoubleLineBorderPattern(csTop)); + BorderSlants[csLeft, cbcBottomRight] := Ord(IsDoubleLineBorderPattern(csBottom)); + BorderSlants[csLeft, cbcBottomLeft] := Ord((Neighbor <> nil) and Neighbor.IsDoubleLineBorderPattern(csBottom)); + end; + + if IsDoubleLineBorderPattern(csTop) then + begin + Neighbor := AnAdapter.GetNeighborCell(Self, csTop); + BorderSlants[csTop, cbcTopLeft] := Ord((Neighbor <> nil) and Neighbor.IsDoubleLineBorderPattern(csLeft)); + BorderSlants[csTop, cbcTopRight] := Ord((Neighbor <> nil) and Neighbor.IsDoubleLineBorderPattern(csRight)); + BorderSlants[csTop, cbcBottomRight] := Ord(IsDoubleLineBorderPattern(csRight)); + BorderSlants[csTop, cbcBottomLeft] := Ord(IsDoubleLineBorderPattern(csLeft)); + end; + + if IsDoubleLineBorderPattern(csRight) then + begin + Neighbor := AnAdapter.GetNeighborCell(Self, csRight); + BorderSlants[csRight, cbcTopLeft] := Ord(IsDoubleLineBorderPattern(csTop)); + BorderSlants[csRight, cbcTopRight] := Ord((Neighbor <> nil) and Neighbor.IsDoubleLineBorderPattern(csTop)); + BorderSlants[csRight, cbcBottomRight] := Ord((Neighbor <> nil) and Neighbor.IsDoubleLineBorderPattern(csBottom)); + BorderSlants[csRight, cbcBottomLeft] := Ord(IsDoubleLineBorderPattern(csBottom)); + end; + + if IsDoubleLineBorderPattern(csBottom) then + begin + Neighbor := AnAdapter.GetNeighborCell(Self, csBottom); + BorderSlants[csBottom, cbcTopLeft] := Ord(IsDoubleLineBorderPattern(csLeft)); + BorderSlants[csBottom, cbcTopRight] := Ord(IsDoubleLineBorderPattern(csRight)); + BorderSlants[csBottom, cbcBottomRight] := Ord((Neighbor <> nil) and Neighbor.IsDoubleLineBorderPattern(csRight)); + BorderSlants[csBottom, cbcBottomLeft] := Ord((Neighbor <> nil) and Neighbor.IsDoubleLineBorderPattern(csLeft)); + end; +end; + +procedure TdxReportCellSSString.ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); +begin + inherited ConvertCoords(APixelsNumerator, APixelsDenominator); + TextExtentLeft := MulDiv(TextExtentLeft, APixelsNumerator, APixelsDenominator); + TextExtentRight := MulDiv(TextExtentRight, APixelsNumerator, APixelsDenominator); +end; + +function TdxReportCellSSString.GetBackgroundBounds(DC: HDC): TRect; +var + LineThickness: Integer; +begin + Result := inherited GetBackgroundBounds(DC); + if not IsFixed then + begin + LineThickness := Self.LineThickness; + if BorderEdgeSalients[csLeft, bstOuter] > 0 then Dec(Result.Left, LineThickness); + if BorderEdgeSalients[csTop, bstOuter] > 0 then Dec(Result.Top, LineThickness); + if BorderEdgeSalients[csRight, bstOuter] > 0 then Inc(Result.Right, LineThickness); + if BorderEdgeSalients[csBottom, bstOuter] > 0 then Inc(Result.Bottom, LineThickness); + FixupRect(DC, Result); + end; +end; + +function TdxReportCellSSString.GetBorderEdgeBounds(ASide: TdxCellSide; const AOuterRect: TRect): TRect; +begin + Result := inherited GetBorderEdgeBounds(ASide, AOuterRect); + with Result do + if ASide in csLeftRight then + begin + Inc(Top, LineThickness * BorderSubs[ASide, cbsTopLeft]); + Dec(Bottom, LineThickness * BorderSubs[ASide, cbsBottomRight]); + end + else + begin + Inc(Left, LineThickness * BorderSubs[ASide, cbsTopLeft]); + Dec(Right, LineThickness * BorderSubs[ASide, cbsBottomRight]); + end; +end; + +function TdxReportCellSSString.GetBorderBrush(ASide: TdxCellSide): HBRUSH; +begin + Result := dxPSEdgePatternFactory.Items[TdxPSEdgePatternClass(BorderEdgeClasses[ASide]), IsPrinting].Brushes[dxCellEdgeSideOrientation[ASide]].Handle; +end; + +function TdxReportCellSSString.GetBorderEdgeClass(ASide: TdxCellSide): TdxPSCellBorderClass; +begin + Result := Borders[ASide].Pattern; + if Result = nil then + Result := TdxPSSolidEdgePattern; +end; + +function TdxReportCellSSString.GetEffectiveBounds(DC: HDC; AStage: TdxPSRenderStages): TRect; +begin + if rsFirstPass in AStage then + Result := inherited GetEffectiveBounds(DC, AStage) + else + UnionRect(Result, GetOuterBounds(DC), GetTextBounds(DC)); +end; + +function TdxReportCellSSString.GetTextBounds(DC: HDC): TRect; +begin + Result := inherited GetTextBounds(DC); + if TextExtentLeft <> 0 then + Result.Left := TextExtentLeft; + if TextExtentRight <> 0 then + Result.Right := TextExtentRight; +end; + +function TdxReportCellSSString.IsDrawn(DC: HDC; AStage: TdxPSRenderStages; const ARect: TRect): Boolean; +var + R: TRect; +begin + Result := IntersectRect(R, GetAbsoluteInnerBounds(DC), ARect); +end; + +function TdxReportCellSSString.GetBorderPainterClass: TdxPSCellBorderPainterClass; +begin + if IsFixed then + Result := inherited GetBorderPainterClass + else + Result := TdxPSCellPatternsBorderPainter; +end; + +procedure TdxReportCellSSString.InitBorderPainter(ABordersPainter: TdxPSCellBorderPainter); +begin + inherited InitBorderPainter(ABordersPainter); + if not IsFixed then + TdxPSCellPatternsBorderPainter(ABordersPainter).FGridAdapter := + TCustomdxSpreadSheetReportLink(ReportCells.ReportLink).FGridAdapter; +end; + +function TdxReportCellSSString.GetContentBkColor: TColor; +begin + Result := FContentBkColor; +end; + +function TdxReportCellSSString.GetContentPattern: TdxPSFillPatternClass; +begin + Result := FContentPattern; +end; + +procedure TdxReportCellSSString.SetContentBkColor(Value: TColor); +begin + FContentBkColor := Value; +end; + +procedure TdxReportCellSSString.SetContentPattern(Value: TdxPSFillPatternClass); +begin + FContentPattern := Value; +end; + +procedure TdxReportCellSSString.ReadBorders(AReader: TdxPSDataReader); +var + Side: TdxCellSide; + Border: TdxPSCellBorder; +begin + for Side := csLeft to csBottom do + begin + Border.Color := AReader.ReadInteger; + Border.Pattern := TdxPSEdgePatternClass(AReader.ReadCellBorderClass); + + Borders[Side] := Border; + end; +end; + +procedure TdxReportCellSSString.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + with AReader do + begin + ReadBorders(AReader); + FBorderSlants := ReadInteger; + FBorderSubs := ReadInteger; + RealCol := ReadInteger; + RealRow := ReadInteger; + TextExtentLeft := ReadInteger; + TextExtentRight := ReadInteger; + end; +end; + +procedure TdxReportCellSSString.WriteBorders(AWriter: TdxPSDataWriter); +var + Side: TdxCellSide; +begin + for Side := csLeft to csBottom do + begin + AWriter.WriteInteger(Borders[Side].Color); + AWriter.WriteClassName(Borders[Side].Pattern); + end; +end; + +procedure TdxReportCellSSString.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + with AWriter do + begin + WriteBorders(AWriter); + WriteInteger(FBorderSlants); + WriteInteger(FBorderSubs); + WriteInteger(RealCol); + WriteInteger(RealRow); + WriteInteger(TextExtentLeft); + WriteInteger(TextExtentRight); + end; +end; + +function TdxReportCellSSString.GetAbsoluteInnerBounds(DC: HDC): TRect; +begin + Result := GetInnerBounds(DC); + if Parent <> nil then + with Parent.AbsoluteOrigin do + OffsetRect(Result, X, Y); +end; + +function TdxReportCellSSString.GetDoubleBorderRgn(ASide: TdxCellSide; const R: TRect): HRGN; +const + VertexCount = 4; +type + PdxPSCellEdgeCoords = ^TdxPSCellEdgeCoords; + TdxPSCellEdgeCoords = record + case Byte of + 0: (TopLeft, TopRight, BottomRight, BottomLeft: TPoint); + 1: (Points: array[0..VertexCount - 1] of TPoint); + end; +var + EdgeCoords: TdxPSCellEdgeCoords; + Thickness: Integer; +begin + with EdgeCoords do + begin + TopLeft := R.TopLeft; + TopRight := Point(R.Right, R.Top); + BottomRight := R.BottomRight; + BottomLeft := Point(R.Left, R.Bottom); + end; + + Thickness := LineThickness * (TdxPSDoubleLineSolidEdgePattern.Thickness - 1); + + with EdgeCoords do + case ASide of + csLeft: + begin + Inc(TopLeft.Y, Thickness * BorderSlants[ASide, cbcTopLeft]); + Inc(TopRight.Y, Thickness * BorderSlants[ASide, cbcTopRight]); + Dec(BottomRight.Y, Thickness * BorderSlants[ASide, cbcBottomRight]); + Dec(BottomLeft.Y, Thickness * BorderSlants[ASide, cbcBottomLeft]); + end; + csTop: + begin + Inc(TopLeft.X, Thickness * BorderSlants[ASide, cbcTopLeft]); + Dec(TopRight.X, Thickness * BorderSlants[ASide, cbcTopRight]); + Dec(BottomRight.X, Thickness * BorderSlants[ASide, cbcBottomRight]); + Inc(BottomLeft.X, Thickness * BorderSlants[ASide, cbcBottomLeft]); + end; + csRight: + begin + Inc(TopLeft.Y, Thickness * BorderSlants[ASide, cbcTopLeft]); + Inc(TopRight.Y, Thickness * BorderSlants[ASide, cbcTopRight]); + Dec(BottomRight.Y, Thickness * BorderSlants[ASide, cbcBottomRight]); + Dec(BottomLeft.Y, Thickness * BorderSlants[ASide, cbcBottomLeft]); + end; + csBottom: + begin + Inc(TopLeft.X, Thickness * BorderSlants[ASide, cbcTopLeft]); + Dec(TopRight.X, Thickness * BorderSlants[ASide, cbcTopRight]); + Dec(BottomRight.X, Thickness * BorderSlants[ASide, cbcBottomRight]); + Inc(BottomLeft.X, Thickness * BorderSlants[ASide, cbcBottomLeft]); + end; + end; + + Result := CreatePolygonRgn(EdgeCoords.Points, SizeOf(TdxPSCellEdgeCoords) div SizeOf(TPoint), Windows.WINDING); +end; + +function TdxReportCellSSString.IsDoubleLineBorderPattern(ABorder: TdxPSCellBorder): Boolean; +begin + with ABorder do + Result := (Pattern <> nil) and Pattern.InheritsFrom(TdxPSDoubleLineSolidEdgePattern); +end; + +function TdxReportCellSSString.IsDoubleLineBorderPattern(ASide: TdxCellSide): Boolean; +begin + Result := (ASide in CellSides) and IsDoubleLineBorderPattern(Self.Borders[ASide]); +end; + +function TdxReportCellSSString.NullBorder: TdxPSCellBorder; +begin + FillChar(Result, SizeOf(TdxPSCellBorder), 0); +end; + +function TdxReportCellSSString.GetBorder(ASide: TdxCellSide): TdxPSCellBorder; +begin + Result := FBorders[ASide]; +end; + +function TdxReportCellSSString.GetBordersBkColor: TColor; +begin + if Transparent then + Result := ColorToRGB(clWindow) + else + Result := Color; +end; + +function TdxReportCellSSString.GetBorderSlant(ASide: TdxCellSide; ACorner: TdxPSCellBorderCorner): Integer; +begin + Result := (FBorderSlants shr GetBorderSlantOffset(ASide, ACorner)) and SlantMask; +end; + +function TdxReportCellSSString.GetBorderSlantOffset(ASide: TdxCellSide; ACorner: TdxPSCellBorderCorner): TDWORDBits; +begin + Result := Integer(ASide) * SlantBitsPerSide + Integer(ACorner); +end; + +function TdxReportCellSSString.GetBorderSub(ASide: TdxCellSide; AEnd: TdxPSCellBorderEnd): TdxPSCellBorderSub; +begin + Result := (FBorderSubs shr GetBorderSubOffset(ASide, AEnd)) and SubEndMask; +end; + +function TdxReportCellSSString.GetBorderSubMask(ASide: TdxCellSide; AEnd: TdxPSCellBorderEnd): DWORD; +begin + Result := 0 or (SubEndMask shl GetBorderSubOffset(ASide, AEnd)); +end; + +function TdxReportCellSSString.GetBorderSubOffset(ASide: TdxCellSide; AEnd: TdxPSCellBorderEnd): TDWORDBits; +begin + Result := Integer(ASide) * SubBitsPerSide + SubBitsPerEnd * Integer(AEnd); +end; + +function TdxReportCellSSString.GetClipContent: Boolean; +begin + Result := (Format and dxFormatClipContent) = dxFormatClipContent; +end; + +function TdxReportCellSSString.GetCol: Integer; +begin + Result := Index; +end; + +function TdxReportCellSSString.GetFill: Boolean; +begin + Result := (Format and dxFormatFill) = dxFormatFill; +end; + +function TdxReportCellSSString.GetIsFixed: Boolean; +begin + Result := (Format and dxFormatFixed) = dxFormatFixed; +end; + +function TdxReportCellSSString.GetIsMerged: Boolean; +begin + Result := (Format and dxFormatMerged) = dxFormatMerged; +end; + +function TdxReportCellSSString.GetIsNearMostLeft: Boolean; +begin + Result := (Format and dxFormatNearMostLeft) = dxFormatNearMostLeft; +end; + +function TdxReportCellSSString.GetIsNearMostTop: Boolean; +begin + Result := (Format and dxFormatNearMostTop) = dxFormatNearMostTop; +end; + +function TdxReportCellSSString.GetIsNearMostTopOrLeft: Boolean; +begin + Result := GetIsNearMostLeft or GetIsNearMostTop; +end; + +function TdxReportCellSSString.GetIsVirtual: Boolean; +begin + Result := GetFormatBit(dxFormatVirtual); +end; + +function TdxReportCellSSString.GetRow: Integer; +begin + Result := Parent.Index; +end; + +procedure TdxReportCellSSString.SetBorder(ASide: TdxCellSide; Value: TdxPSCellBorder); +begin + FBorders[ASide] := Value; +end; + +procedure TdxReportCellSSString.SetBorderSlant(ASide: TdxCellSide; + ACorner: TdxPSCellBorderCorner; Value: Integer); +var + Mask: DWORD; +begin + Mask := 1 shl GetBorderSlantOffset(ASide, ACorner); + FBorderSlants := FBorderSlants and not Mask; + if Value <> 0 then + FBorderSlants := FBorderSlants or Mask; +end; + +procedure TdxReportCellSSString.SetBorderSub(ASide: TdxCellSide; AEnd: TdxPSCellBorderEnd; + Value: TdxPSCellBorderSub); +begin + FBorderSubs := FBorderSubs and not GetBorderSubMask(ASide, AEnd) or + (Value shl GetBorderSubOffset(ASide, AEnd)); +end; + +procedure TdxReportCellSSString.SetClipConent(Value: Boolean); +const + dxClipContent: array[Boolean] of DWORD = (0, dxFormatClipContent); +begin + Format := Format and not dxFormatClipContent or dxClipContent[Value]; +end; + +procedure TdxReportCellSSString.SetFill(Value: Boolean); +const + dxFill: array[Boolean] of DWORD = (0, dxFormatFill); +begin + Format := Format and not dxFormatFill or dxFill[Value]; +end; + +procedure TdxReportCellSSString.SetIsFixed(Value: Boolean); +const + dxFixed: array[Boolean] of DWORD = (0, dxFormatFixed); +begin + Format := Format and not dxFormatFixed or dxFixed[Value]; +end; + +procedure TdxReportCellSSString.SetIsMerged(Value: Boolean); +const + dxMerged: array[Boolean] of DWORD = (0, dxFormatMerged); +begin + Format := Format and not dxFormatMerged or dxMerged[Value]; +end; + +procedure TdxReportCellSSString.SetIsNearMostLeft(Value: Boolean); +const + dxIsNearMostLeft: array[Boolean] of DWORD = (0, dxFormatNearMostLeft); +begin + Format := Format and not dxFormatNearMostLeft or dxIsNearMostLeft[Value]; +end; + +procedure TdxReportCellSSString.SetIsNearMostTop(Value: Boolean); +const + dxIsNearMostTop: array[Boolean] of DWORD = (0, dxFormatNearMostTop); +begin + Format := Format and not dxFormatNearMostTop or dxIsNearMostTop[Value]; +end; + +procedure TdxReportCellSSString.SetIsVirtual(Value: Boolean); +begin + SetFormatBit(dxFormatVirtual, Value); +end; + +{ TdxPSCellPatternsBorderPainter } + +function TdxPSCellPatternsBorderPainter.Item: TdxReportCellSSString; +begin + Result := inherited Item as TdxReportCellSSString; +end; + +function TdxPSCellPatternsBorderPainter.ClipItemBounds(DC: HDC; AOuterRect: TRect): HRGN; +begin + with Item do + begin + if IsNearMostTop then + Inc(AOuterRect.Top, LineThickness * BorderEdgeSalients[csTop, bstOuter]); + if IsNearMostLeft then + Inc(AOuterRect.Left, LineThickness * BorderEdgeSalients[csLeft, bstOuter]); + end; + Result := Renderer.IntersectClipRect(AOuterRect); +end; + +procedure TdxPSCellPatternsBorderPainter.DrawBorder(DC: HDC; const R: TRect; + AForeColor, ABkColor: TColor; ABrush: HBRUSH); +begin + ABkColor := SetBkColor(DC, ABkColor); + AForeColor := SetTextColor(DC, AForeColor); + FillRect(DC, R, ABrush); + SetTextColor(DC, AForeColor); + SetBkColor(DC, ABkColor); +end; + +procedure TdxPSCellPatternsBorderPainter.DrawBorder(DC: HDC; ABorderRgn: HRGN; + AForeColor, ABkColor: TColor; ABrush: HBRUSH); +begin + ABkColor := SetBkColor(DC, ABkColor); + AForeColor := SetTextColor(DC, AForeColor); + FillRgn(DC, ABorderRgn, ABrush); + SetTextColor(DC, AForeColor); + SetBkColor(DC, ABkColor); +end; + +procedure TdxPSCellPatternsBorderPainter.Paint(DC: HDC); +var + R: TRect; + Rgn: HRGN; + Side: TdxCellSide; + BorderRect: TRect; + BorderBr: HBRUSH; + BrushOrg: TPoint; + BorderRgn: HRGN; + Border: TdxPSCellBorder; +begin + with Item do + begin + R := GetOuterBounds(DC); + Rgn := 0; + if IsNearMostTopOrLeft then Rgn := ClipItemBounds(DC, R); + + for Side := csLeft to csBottom do + if Side in CellSides then + begin + BorderRect := GetBorderEdgeBounds(Side, R); + if RectVisible(DC, BorderRect) then + begin + BorderBr := GetBorderBrush(Side); + Border := Borders[Side]; + GetBrushOrgEx(DC, BrushOrg); + if (Border.Pattern <> nil) and Border.Pattern.RequiredBrushOrigin then + begin + UnrealizeObject(BorderBrush); + BrushOrg := BorderRect.TopLeft; + LPToDP(DC, BrushOrg, 1); + SetBrushOrgEx(DC, BrushOrg.X mod 2{Border.Pattern.Thickness}, BrushOrg.Y mod 2{Border.Pattern.Thickness}, nil); + end; + + FixupRect(DC, BorderRect); + if IsDoubleLineBorderPattern(Side) then + begin + BorderRgn := GetDoubleBorderRgn(Side, BorderRect); + DrawBorder(DC, BorderRgn, Border.Color, BordersBkColor, BorderBr); + DeleteObject(BorderRgn); + end + else + DrawBorder(DC, BorderRect, Border.Color, BordersBkColor, BorderBr); + + if (Border.Pattern <> nil) and Border.Pattern.RequiredBrushOrigin then + SetBrushOrgEx(DC, BrushOrg.X, BrushOrg.Y, nil); + end; + end; + + if IsNearMostTopOrLeft then Renderer.RestoreClipRgn(Rgn); + end; +end; + +{ TdxPSGridCellsAdapter } + +constructor TdxPSGridCellsAdapter.Create(AReportCells: TdxReportCells); +begin + inherited Create; + FReportCells := AReportCells; +end; + +function TdxPSGridCellsAdapter.GetNeighborCell(AItem: TdxReportCellSSString; + ASide: TdxCellSide): TdxReportCellSSString; +begin + Result := nil; + case ASide of + csLeft: + if AItem.Col > 0 then + Result := Cells[AItem.Col - 1, AItem.Row]; + csTop: + if AItem.Row > 0 then + Result := Cells[AItem.Col, AItem.Row - 1]; + csRight: + if AItem.Col + 1 < ColCount then + Result := Cells[AItem.Col + 1, AItem.Row]; + csBottom: + if AItem.Row + 1 < RowCount then + Result := Cells[AItem.Col, AItem.Row + 1]; + end; +end; + +function TdxPSGridCellsAdapter.GetCell(Col, Row: Integer): TdxReportCellSSString; +begin + Result := FReportCells.Cells[Row].DataItems[Col] as TdxReportCellSSString; +end; + +function TdxPSGridCellsAdapter.GetColCount: Integer; +begin + with FReportCells do + if Cells.CellCount > 0 then + Result := Cells[0].DataItemCount + else + Result := 0; +end; + +function TdxPSGridCellsAdapter.GetColOffset(Index: Integer): Integer; +begin + if Index < ColCount then + Result := Cells[Index, 0].Left + else + Result := Cells[ColCount - 1, 0].Left + Cells[ColCount - 1, 0].Width; +end; + +function TdxPSGridCellsAdapter.GetColWidth(Index: Integer): Integer; +begin + Result := Cells[Index, 0].Width; +end; + +function TdxPSGridCellsAdapter.GetRow(Index: Integer): TdxReportCell; +begin + Result := FReportCells.Cells[Index]; +end; + +function TdxPSGridCellsAdapter.GetRowCount: Integer; +begin + Result := FReportCells.Cells.CellCount; +end; + +function TdxPSGridCellsAdapter.GetRowHeight(Index: Integer): Integer; +begin + Result := Cells[0, Index].Height; +end; + +function TdxPSGridCellsAdapter.GetRowIndex(Index: Integer): Integer; +begin + Result := Rows[Index].Data; +end; + +function TdxPSGridCellsAdapter.GetRowOffset(Index: Integer): Integer; +begin + if Index < RowCount then + Result := Cells[0, Index].Top + else + Result := Cells[0, RowCount - 1].Top + Cells[0, RowCount - 1].Height; +end; + +{ TdxPSSSStringGridCellDataMap } + +class procedure TdxPSSSStringGridCellDataMap.InitializeCellData(ACol, ARow: Integer; + ADataItem: TAbstractdxReportCellData; AReportLink: TAbstractdxGridReportLink); +begin + inherited; + with TCustomdxSpreadSheetReportLink(AReportLink) do + begin + TdxReportCellSSString(ADataItem).Fill := not IsFixedCell(ACol, ARow) and + (GetSSCellObject(ACol, ARow).DisplayTextAlignment = dtaFILL); + TdxReportCellSSString(ADataItem).IsFixed := IsFixedCell(ACol, ARow); + TdxReportCellSSString(ADataItem).IsMerged := IsMergedCell(ACol, ARow); + TdxReportCellSSString(ADataItem).IsNearMostLeft := IsNearMostLeftCell(ACol, ARow); + TdxReportCellSSString(ADataItem).IsNearMostTop := IsNearMostTopCell(ACol, ARow); + TdxReportCellSSString(ADataItem).RealCol := ACol; + TdxReportCellSSString(ADataItem).RealRow := ARow; + + SetupCellBorders(ACol, ARow, ADataItem); + end; +end; + +class function TdxPSSSStringGridCellDataMap.DataClass: TdxReportCellDataClass; +begin + Result := TdxReportCellSSString; +end; + +{ TCustomdxSpreadSheetReportLink } + +constructor TCustomdxSpreadSheetReportLink.Create(AOwner: TComponent); +begin + inherited; + FColCount := -1; + FRowCount := -1; + FCellObjects := TList.Create; + FGridAdapter := TdxPSGridCellsAdapter.Create(nil); + FTempFont := TFont.Create; +end; + +destructor TCustomdxSpreadSheetReportLink.Destroy; +begin + FTempFont.Free; + FGridAdapter.Free; + DeleteCellObjects; + FCellObjects.Free; + inherited; +end; + +procedure TCustomdxSpreadSheetReportLink.Assign(Source: TPersistent); +begin + inherited; + if Source is TCustomdxSpreadSheetReportLink then + with TCustomdxSpreadSheetReportLink(Source) do + begin + Self.OptionsView := OptionsView; + Self.PrintArea := PrintArea; + end; +end; + +procedure TCustomdxSpreadSheetReportLink.ClearPrintArea; +begin + PrintArea := dxPSEmptySSPrintArea; +end; + +function TCustomdxSpreadSheetReportLink.DataProviderPresent: Boolean; +begin + Result := inherited DataProviderPresent and DataToPrintExist; +end; + +function TCustomdxSpreadSheetReportLink.DataToPrintExist: Boolean; +begin + Result := (MeaningColCount > 0) and (MeaningRowCount > 0); +end; + +function TCustomdxSpreadSheetReportLink.PrintAreaExists: Boolean; +begin + Result := not EqualRect(PrintArea, dxPSEmptySSPrintArea); +end; + +function TCustomdxSpreadSheetReportLink.CannotActivateReportErrorString: string; +begin + if not inherited DataProviderPresent then + Result := inherited CannotActivateReportErrorString + else + Result := cxGetResourceString(@sdxDataToPrintDoesNotExist); +end; + +procedure TCustomdxSpreadSheetReportLink.DoChangeComponent; +begin + ClearPrintArea; + inherited; +end; + +procedure TCustomdxSpreadSheetReportLink.InternalRestoreDefaults; +begin + inherited; + EndEllipsis := False; + Soft3D := True; + FPrintArea := dxPSEmptySSPrintArea; + OptionsView := [ssovRowAndColumnHeadings]; +end; + +procedure TCustomdxSpreadSheetReportLink.InternalRestoreFromOriginal; +begin + inherited; + FixedFont := ExposeSpreadSheetBook(CustomSpreadSheetBook).HeaderFont; +end; + +function TCustomdxSpreadSheetReportLink.IsScaleGridLines: Boolean; +begin + Result := False; +end; + +function TCustomdxSpreadSheetReportLink.NeedTwoPassRendering: Boolean; +begin + Result := True; +end; + +function TCustomdxSpreadSheetReportLink.GetDataItemClass(ACol: Integer; ARow: Integer = 0): TdxReportCellDataClass; +begin + Result := TdxReportCellSSString; +end; + +function TCustomdxSpreadSheetReportLink.GetColCount: Integer; +var + BeginCol, BeginRow, EndRow: Integer; +begin + if FColCount <= 0 then + if HasSelection then + begin + GetSelectedRange(BeginCol, FColCount, BeginRow, EndRow); + Inc(FColCount); + end + else + FColCount := MeaningColCount + 1; + Result := FColCount; +end; + +function TCustomdxSpreadSheetReportLink.GetFixedColCount: Integer; +begin + Result := 1; +end; + +function TCustomdxSpreadSheetReportLink.GetFixedRowCount: Integer; +begin + Result := 1; +end; + +function TCustomdxSpreadSheetReportLink.GetRowCount: Integer; +var + BeginCol, EndCol, BeginRow: Integer; +begin + if FRowCount <= 0 then + if HasSelection then + begin + GetSelectedRange(BeginCol, EndCol, BeginRow, FRowCount); + Inc(FRowCount); + end + else + FRowCount := MeaningRowCount + 1; + Result := FRowCount; +end; + +function TCustomdxSpreadSheetReportLink.GetCellSides(ACol, ARow: Integer): TdxCellSides; + + function AreNeigborhoodsTransparent(ASide: TdxCellSide): Boolean; + begin + case ASide of + csLeft: + Result := IsNearMostLeftCell(ACol, ARow) or + (GetCellTransparent(ACol - 1, ARow) and GetCellTransparent(ACol, ARow)); + csTop: + Result := IsNearMostTopCell(ACol, ARow) or + (GetCellTransparent(ACol, ARow - 1) and GetCellTransparent(ACol, ARow)); + csRight: + Result := ((ACol = GetColCount - 1) {and not FAppendingExtraColumns}) or + (GetCellTransparent(ACol + 1, ARow) and GetCellTransparent(ACol, ARow)); + else // csBottom + Result := ((ARow = GetRowCount - 1) {and not FAppendingExtraColumns}) or + (GetCellTransparent(ACol, ARow + 1) and GetCellTransparent(ACol, ARow)); + end; + end; + +var + Style: TcxSSCellStyle; + Side: TdxCellSide; + BorderStyle: TcxSSEdgeLineStyle; +begin + if IsFixedCell(ACol, ARow) or IsSuppressSourceFormats then + Result := inherited GetCellSides(ACol, ARow) + else + begin + Result := csAll; + Style := GetSSCellStyle(ACol, ARow); + + for Side := Low(TdxCellSide) to High(TdxCellSide) do + begin + if Style <> nil then + BorderStyle := Style.Borders.Edges[cxSSEdgeBorderMap[Side]].Style + else + BorderStyle := lsDefault; + + if (BorderStyle in [lsNone, lsDefault]) and + (not IsShowGridLines or not AreNeigborhoodsTransparent(Side) or + (IsMergedCell(ACol, ARow) and not IsMergedBorder(ACol, ARow, Side))) then + Exclude(Result, Side); + end; + end; +end; + +function TCustomdxSpreadSheetReportLink.GetCellText(ACol, ARow: Integer): string; +begin + if IsFixedCell(ACol, ARow) then + begin + if (ACol = 0) and (ARow <> 0) then + Result := TcxSSUtils.RowNameByIndex(ARow - 1, CustomSpreadSheetBook.R1C1ReferenceStyle); + if (ARow = 0) and (ACol <> 0) then + Result := TcxSSUtils.ColumnNameByIndex(ACol - 1, CustomSpreadSheetBook.R1C1ReferenceStyle); + end + else + if (FProcessingMerges or not IsMergedCell(ACol, ARow)) and not FAppendingExtraColumns then + Result := GetSSCellObject(ACol, ARow).DisplayText + else + Result := ''; +end; + +function TCustomdxSpreadSheetReportLink.GetCellTextAlignY(ACol, ARow: Integer): TdxTextAlignY; +begin + if (DrawMode <> gdmBorrowSource) and not IsFixedCell(ACol, ARow) then + Result := taBottom + else + Result := inherited GetCellTextAlignY(ACol, ARow); +end; + +function TCustomdxSpreadSheetReportLink.GetMinRowHeight(DC: HDC; AFont: TFont): Integer; +begin + Result := 1; +end; + +function TCustomdxSpreadSheetReportLink.GetSelectionRect: TRect; +begin + if OnlySelected then + Result := ExposeBookSheet(BookSheet).SelectionRect + else + Result := PrintArea; + OffsetRect(Result, 1, 1); +end; + +function TCustomdxSpreadSheetReportLink.GetSourceCellColor(ACol, ARow: Integer): TColor; +begin + if IsFixedCell(ACol, ARow) then + Result := ColorToRGB(ExposeSpreadSheetBook(CustomSpreadSheetBook).HeaderColor) + else + if GetSourceCellContentPattern(ACol, ARow).InheritsFrom(TdxPSSolidFillPattern) then + Result := GetRealColor(GetSSCellStyle(ACol, ARow).Brush.BackgroundColor, clWindow) + else + Result := GetRealColor(GetSSCellStyle(ACol, ARow).Brush.ForegroundColor, clWindow); +end; + +function TCustomdxSpreadSheetReportLink.GetSourceCellContentBkColor(ACol, ARow: Integer): TColor; +begin + if IsFixedCell(ACol, ARow) then + Result := ColorToRGB(ExposeSpreadSheetBook(CustomSpreadSheetBook).HeaderColor) + else + Result := GetRealColor(GetSSCellStyle(ACol, ARow).Brush.BackgroundColor, clWindow); +end; + +function TCustomdxSpreadSheetReportLink.GetSourceCellContentPattern(ACol, ARow: Integer): TdxPSFillPatternClass; +begin + if IsFixedCell(ACol, ARow) then + Result := TdxPSSolidFillPattern + else + Result := dxPSFillPatternClassMap[GetSSCellStyle(ACol, ARow).Brush.Style]; +end; + +function TCustomdxSpreadSheetReportLink.GetSourceCellEdge3DSoft(ACol, ARow: Integer): Boolean; +begin + Result := True; +end; + +function TCustomdxSpreadSheetReportLink.GetSourceCellEdgeMode(ACol, ARow: Integer): TdxCellEdgeMode; +const + FixedEdgeModes: array[Boolean] of TdxCellEdgeMode = (cem3DEffects, cemPattern); +begin + if IsFixedCell(ACol, ARow) then + Result := FixedEdgeModes[ExposeSpreadSheetBook(CustomSpreadSheetBook).PainterType = ptOfficeXPStyle] + else + Result := cemPattern; +end; + +function TCustomdxSpreadSheetReportLink.GetSourceCellFontIndex(ACol, ARow: Integer): Integer; + + procedure SetupFont(AFontRec: PcxSSFontRec; AFont: TFont); + begin + with AFont do + begin + Name := AFontRec.Name; + Color := GetRealColor(AFontRec.FontColor, Self.Font.Color); + Style := AFontRec.Style; + Charset := AFontRec.Charset; + Size := AFontRec.Size; + end; + + if not dxIsTrueTypeFont(AFont) then AFont.Name := Self.Font.Name; + end; + +begin + if not IsFixedCell(ACol, ARow) then + begin + SetupFont(ExposeStyle(GetSSCellStyle(ACol, ARow)).StylePtr^.FontPtr, FTempFont); + Result := AddFontToPool(FTempFont); + end + else + Result := FSourceHeaderFontIndex; +end; + +function TCustomdxSpreadSheetReportLink.GetSourceCellMultiline(ACol, ARow: Integer): Boolean; +begin + Result := not IsFixedCell(ACol, ARow) and GetSSCellStyle(ACol, ARow).WordBreak; +end; + +function TCustomdxSpreadSheetReportLink.GetSourceCellTextAlignX(ACol, ARow: Integer): TdxTextAlignX; +begin + if IsFixedCell(ACol, ARow) then + Result := taCenterX + else + Result := dxPSTextAlignXMap[GetSSCellObject(ACol, ARow).DisplayTextAlignment]; +end; + +function TCustomdxSpreadSheetReportLink.GetSourceCellTextAlignY(ACol, ARow: Integer): TdxTextAlignY; +begin + if IsFixedCell(ACol, ARow) then + Result := taBottom + else + Result := dxPSTextAlignYMap[GetSSCellStyle(ACol, ARow).VertTextAlign]; +end; + +function TCustomdxSpreadSheetReportLink.GetSourceCellTransparent(ACol, ARow: Integer): Boolean; +begin + if not IsFixedCell(ACol, ARow) then + begin + Result := inherited GetSourceCellTransparent(ACol, ARow); + if Result then + Result := (GetSSCellStyle(ACol, ARow).Brush.Style = fsSolid) and (GetSourceCellColor(ACol, ARow) = ColorToRGB(clWindow)); + end + else + Result := FixedTransparent; +end; + +function TCustomdxSpreadSheetReportLink.GetSourceColWidth(ACol: Integer): Integer; +begin + with ExposeSpreadSheetBook(CustomSpreadSheetBook) do + if IsFixedCol(ACol) then + Result := RowHeaderWidth + else + Result := ActiveSheet.Cols.Size[ACol - 1]; + Result := MulDiv(Result, Screen.PixelsPerInch, 96); +end; + +function TCustomdxSpreadSheetReportLink.GetSourceRowHeight(ARow: Integer): Integer; +begin + with ExposeSpreadSheetBook(CustomSpreadSheetBook) do + if IsFixedRow(ARow) then + Result := ColHeaderHeight + else + begin + Result := ActiveSheet.Rows.Size[ARow - 1]; + Result := MulDiv(Result, 96, Screen.PixelsPerInch); + end; + if Result > 3 then Inc(Result, 3); + Result := MulDiv(Result, Screen.PixelsPerInch, 96); +end; + +function TCustomdxSpreadSheetReportLink.HasSelection: Boolean; +begin + Result := inherited HasSelection or PrintAreaExists; +end; + +function TCustomdxSpreadSheetReportLink.IsDrawBorder: Boolean; +begin + Result := True;//ssovGridLines in OptionsView; +end; + +function TCustomdxSpreadSheetReportLink.IsDrawHorzLines: Boolean; +begin + Result := ssovGridLines in OptionsView; +end; + +function TCustomdxSpreadSheetReportLink.IsDrawVertLines: Boolean; +begin + Result := ssovGridLines in OptionsView; +end; + +function TCustomdxSpreadSheetReportLink.IsProcessedCol(ACol: Integer): Boolean; +begin + Result := inherited IsProcessedCol(ACol); + if Result then + if IsFixedCol(ACol) then + Result := IsShowRowAndColumnHeadings + else + Result := ExposeSpreadSheetBook(CustomSpreadSheetBook).ActiveSheet.Cols.Visible[ACol - 1]; +end; + +function TCustomdxSpreadSheetReportLink.IsProcessedRow(ARow: Integer): Boolean; +begin + Result := inherited IsProcessedRow(ARow); + if Result then + if IsFixedRow(ARow) then + Result := IsShowRowAndColumnHeadings + else + with ExposeSpreadSheetBook(CustomSpreadSheetBook) do + Result := ActiveSheet.Rows.Visible[ARow - 1]; +end; + +procedure TCustomdxSpreadSheetReportLink.AfterConstruct(AReportCells: TdxReportCells); +begin + FColCount := -1; + FRowCount := -1; + FGridAdapter.FReportCells := nil; + DeleteCellObjects; + inherited; +end; + +procedure TCustomdxSpreadSheetReportLink.PrepareConstruct(AReportCells: TdxReportCells); +begin + FExtraColumnCount := 0; + FCellObjects.Count := ColCount * RowCount - 1; + FGridAdapter.FReportCells := AReportCells; + FSourceHeaderFontIndex := AddFontToPool(ExposeSpreadSheetBook(CustomSpreadSheetBook).HeaderFont); + inherited; +end; + +procedure TCustomdxSpreadSheetReportLink.UnprepareConstruct(AReportCells: TdxReportCells); +begin + if not AbortBuilding then + begin + if HasMerges then AddMerges(AReportCells); + CalcTextExtents(FGridAdapter); + if not HasSelection then + AppendAdditionalColumns(FGridAdapter); + DeleteUnneededCellSides(FGridAdapter); + PostProcessItems(FGridAdapter); + FixupRowWidths(FGridAdapter); + end; + inherited; +end; + +procedure TCustomdxSpreadSheetReportLink.AddMerges(AReportCells: TdxReportCells); + + function IntersectRect(R1, R2: TRect): Boolean; + begin + Inc(R1.Right); + Inc(R1.Bottom); + Inc(R2.Right); + Inc(R2.Bottom); + Result := Windows.IntersectRect(R1, R1, R2); + end; + +var + SelRect, R: TRect; + LeftOffset, TopOffset, I, ACol, ARow: Integer; + Overlay, Cell: TdxReportCell; + DataClass: TdxReportCellDataClass; + DataItem: TAbstractdxReportCellData; +begin + FProcessingMerges := True; + try + SelRect := Rect(0, 0, 0, 0); + LeftOffset := 0; + TopOffset := 0; + + if HasSelection then + begin + SelRect := GetSelectionRect; + LeftOffset := GetColumnOffset(SelRect.Left); + TopOffset := GetRowOffset(SelRect.Top); + if IsShowRowAndColumnHeadings then + begin + Dec(LeftOffset, ColumnWidths[0]); + if not HeadersOnEveryPage then Dec(TopOffset, RowHeights[0]); + end; + end + else + if not IsShowRowAndColumnHeadings then + begin + Inc(LeftOffset, ColumnWidths[0]); + Inc(TopOffset, RowHeights[0]); + end + else + if HeadersOnEveryPage then Inc(TopOffset, RowHeights[0]); + + Overlay := AReportCells.AddOverlay; + + for I := 0 to MergedCells.Count - 1 do + begin + R := MergedCells.MergedAsRect[I]; + OffsetRect(R, 1, 1); + + if HasSelection and not IntersectRect(R, SelRect) then + Continue; + + ACol := R.Left; + ARow := R.Top; + + R.Left := GetColumnOffset(R.Left); + R.Top := GetRowOffset(R.Top); + R.Right := GetColumnOffset(R.Right + 1); + R.Bottom := GetRowOffset(R.Bottom + 1); + + OffsetRect(R, -LeftOffset, -TopOffset); + + Cell := TdxReportCell.Create(Overlay); + Cell.BoundsRect := R; + Cell.Transparent := True; + Cell.CellSides := []; + + DataClass := GetDataItemClass(ACol); + if DataClass <> nil then + begin + DataItem := DataClass.Create(Cell); + OffsetRect(R, -R.Left, -R.Top); + DataItem.BoundsRect := R; + AssignData(ACol, ARow, DataItem); + DataItem.CellSides := []; + //DataItem.Transparent := False;//True; + end; + end; + finally + FProcessingMerges := False; + end; +end; + +procedure TCustomdxSpreadSheetReportLink.CheckPrintAreaBounds(var R: TRect); +begin + if not EqualRect(R, dxPSEmptySSPrintArea) then + with R do + begin + if Left < 0 then Left :=0; + if Top < 0 then Top := 0; + if Right < Left then Right := Left; + if Bottom < Top then Bottom := Top; + end; +end; + +function TCustomdxSpreadSheetReportLink.GetColumnOffset(ACol: Integer): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to ACol - 1 do + Inc(Result, ColumnWidths[I]); +end; + +function TCustomdxSpreadSheetReportLink.GetRowOffset(ARow: Integer): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to ARow - 1 do + Inc(Result, RowHeights[I]); +end; + +function TCustomdxSpreadSheetReportLink.IsMergedBorder(ACol, ARow: Integer; + ASide: TdxCellSide): Boolean; + + function CellInRect(const R: TRect; X, Y: Integer): Boolean; + begin + Result := (X >= R.Left) and (X <= R.Right) and (Y >= R.Top) and (Y <= R.Bottom); + end; + +var + I: Integer; + R: TRect; +begin + Result := IsMergedCell(ACol, ARow); + if Result then + for I := 0 to MergedCells.Count - 1 do + begin + R := MergedCells.MergedAsRect[I]; + OffsetRect(R, 1, 1); + if CellInRect(R, ACol, ARow) then + begin + case ASide of + csLeft: + Result := ACol = R.Left; + csTop: + Result := ARow = R.Top; + csRight: + Result := ACol = R.Right; + csBottom: + Result := ARow = R.Bottom; + end; + if Result then Exit; + end; + //Result := (ACol = R.Left) or (ACol = R.Right) or (ARow = R.Top) or (ARow = R.Bottom); + end; +end; + +function TCustomdxSpreadSheetReportLink.IsMergedCell(ACol, ARow: Integer): Boolean; +begin + Result := not IsFixedCell(ACol, ARow) and ExposeStyle(GetSSCellStyle(ACol, ARow)).Merge; +end; + +function TCustomdxSpreadSheetReportLink.IsNearMostLeftCell(ACol, ARow: Integer): Boolean; +var + R: TRect; +begin + if IsShowRowAndColumnHeadings then + begin + if HasSelection then + begin + R := GetSelectionRect; + Dec(R.Left); + Dec(ACol, R.Left); + end; + Result := ACol = 1 + end + else + Result := False;//ACol = 0; +end; + +function TCustomdxSpreadSheetReportLink.IsNearMostTopCell(ACol, ARow: Integer): Boolean; +var + R: TRect; +begin + if IsShowRowAndColumnHeadings then + begin + if HasSelection then + begin + R := GetSelectionRect; + Dec(R.Top); + Dec(ARow, R.Top); + end; + Result := ARow = 1 + end + else + Result := False;//ARow = 0; +end; + +function TCustomdxSpreadSheetReportLink.IsShowGridLines: Boolean; +begin + Result := ssovGridLines in OptionsView; +end; + +function TCustomdxSpreadSheetReportLink.IsShowRowAndColumnHeadings: Boolean; +begin + Result := ssovRowAndColumnHeadings in OptionsView; +end; + +function TCustomdxSpreadSheetReportLink.IsSuppressSourceFormats: Boolean; +begin + Result := ssovSuppressSourceFormats in OptionsView; +end; + +procedure TCustomdxSpreadSheetReportLink.AppendAdditionalColumns(AnAdapter: TdxPSGridCellsAdapter); + + function DoCalcExtraColumnCount(AnAdapter: TdxPSGridCellsAdapter; + ADefaultColumnWidth: Integer): Integer; + var + Col, Row, Index, CurrentColumnOffset: Integer; + Item: TdxReportCellSSString; + begin + Result := AnAdapter.ColCount; + + for Row := 0 to AnAdapter.RowCount - 1 do + for Col := 0 to AnAdapter.ColCount - 1 do + begin + Item := AnAdapter[Col, Row]; + if Item.TextExtentRight <> 0 then + begin + Index := Col; + CurrentColumnOffset := AnAdapter.ColOffsets[Index]; + while Item.TextExtentRight > CurrentColumnOffset do + begin + Inc(Index); + if Index <= AnAdapter.ColCount then + CurrentColumnOffset := AnAdapter.ColOffsets[Index] + else + Inc(CurrentColumnOffset, ADefaultColumnWidth); + end; + if Index > Result then Result := Index; + end; + end; + Dec(Result, AnAdapter.ColCount); + end; + + function FindNearestVisibleColIndex(AStartIndex: Integer): Integer; + begin + Result := AStartIndex; + with ExposeSpreadSheetBook(CustomSpreadSheetBook).ActiveSheet.Cols do + while not Visible[Result - 1] do + Inc(Result); + end; + + procedure DoAppendExtraColumns(AnAdapter: TdxPSGridCellsAdapter; + AExtraColumnCount, ADefaultColumnWidth: Integer); + var + L, Row, Col, StartRealCol, RealCol: Integer; + Item: TdxReportCellSSString; + Cell: TdxReportCell; + R: TRect; + begin + L := AnAdapter.ColOffsets[AnAdapter.ColCount]; + StartRealCol := AnAdapter.Cells[AnAdapter.ColCount - 1, 0].RealCol; + + for Row := 0 to AnAdapter.RowCount - 1 do + begin + Item := nil; + Cell := AnAdapter.Rows[Row]; + R := Bounds(L, 0, 0, Cell.Height); + RealCol := StartRealCol; + for Col := 0 to AExtraColumnCount - 1 do + begin + R.Left := R.Right; + R.Right := R.Left + ADefaultColumnWidth; + + Item := TdxReportCellSSString.Create(Cell); + Item.BoundsRect := R; + Item.IsVirtual := True; + + RealCol := FindNearestVisibleColIndex(RealCol + 1); + AssignData(RealCol, AnAdapter.RowIndexes[Row], Item); + if Item.IsFixed then + Item.Text := TcxSSUtils.ColumnNameByIndex(RealCol - 1, CustomSpreadSheetBook.R1C1ReferenceStyle); + end; + Cell.Width := Item.BoundsRect.Right; + end; + end; + +var + DefaultColumnWidth: Integer; +begin + FAppendingExtraColumns := True; + try + DefaultColumnWidth := ExposeSpreadSheetBook(CustomSpreadSheetBook).DefaultColWidth; + FExtraColumnCount := DoCalcExtraColumnCount(FGridAdapter, DefaultColumnWidth); + if ExtraColumnCount <> 0 then + DoAppendExtraColumns(FGridAdapter, ExtraColumnCount, DefaultColumnWidth); + finally + FAppendingExtraColumns := False; + end; +end; + +procedure TCustomdxSpreadSheetReportLink.PostProcessItems(AnAdapter: TdxPSGridCellsAdapter); +var + Col, Row: Integer; +begin + for Col := 0 to AnAdapter.ColCount - 1 do + for Row := 0 to AnAdapter.RowCount - 1 do + with AnAdapter.Cells[Col, Row] do + if not IsFixed and not IsVirtual then + begin + CalcBorderSubs(AnAdapter); + CalcDoubleBorderSlants(AnAdapter); + end; +end; + +procedure TCustomdxSpreadSheetReportLink.CalcTextExtents(AnAdapter: TdxPSGridCellsAdapter); + + function NeedCalcItemTextExtents(AItem: TdxReportCellSSString): Boolean; + begin + with AItem do + Result := not IsMerged and not IsFixed and not Multiline and not Fill and + (Text <> '') and (TextAlignX in [taLeft, taCenterX, taRight]); + end; + + procedure DoCalcItemTextExtents(AItem: TdxReportCellSSString; Col, Row: Integer); + + function CalcTextRightExtent(ATextWidth, ACol, ARow: Integer): Integer; + var + OriginalColumnOffset, CurrentColumnOffset, EndOfTextOffset, I: Integer; + Item: TdxReportCellSSString; + begin + OriginalColumnOffset := AnAdapter.ColOffsets[ACol]; + EndOfTextOffset := OriginalColumnOffset + ATextWidth; + Result := 0; + + CurrentColumnOffset := AnAdapter.ColOffsets[ACol + 1]; + + for I := ACol + 1 to AnAdapter.ColCount do + begin + CurrentColumnOffset := AnAdapter.ColOffsets[I]; + if CurrentColumnOffset > EndOfTextOffset then + Break; + + if I < AnAdapter.ColCount then + Item := AnAdapter[I, ARow] + else + Item := nil; + + if (Item <> nil) and (Item.IsMerged or (Item.Text <> '')) then + begin + Result := CurrentColumnOffset; + Break; + end + end; + + if Result = 0 then + begin + Result := EndOfTextOffset; + if (Result > CurrentColumnOffset) and HasSelection then + Result := CurrentColumnOffset + dxTextSpace; + if Result < AnAdapter.ColOffsets[ACol + 1] then Result := 0; + end; + end; + + function CalcTextLeftExtent(ATextWidth, ACol, ARow: Integer): Integer; + var + TextLeftEdge, I, CurrentColumnOffset: Integer; + Item: TdxReportCellSSString; + begin + TextLeftEdge := AnAdapter.ColOffsets[ACol + 1] - ATextWidth; + if TextLeftEdge < 0 then TextLeftEdge := 0; + + Result := 0; + + for I := ACol downto 0 do + begin + if I > 0 then + Item := AnAdapter[I - 1, ARow] + else + Item := nil; + CurrentColumnOffset := AnAdapter.ColOffsets[I]; + if CurrentColumnOffset < TextLeftEdge then + Break; + if (Item = nil) or Item.IsFixed or Item.IsMerged or (Item.Text <> '') then + begin + Result := CurrentColumnOffset; + Break; + end + end; + + if Result = 0 then + begin + Result := TextLeftEdge; + if Result > AnAdapter.ColOffsets[ACol] then Result := 0; + end; + end; + + var + TextWidth: Integer; + begin + TextWidth := GetTextWidth(ScreenDC, AItem.Font.Handle, AItem.Text); + + case AItem.TextAlignX of + taLeft: + AItem.TextExtentRight := CalcTextRightExtent(TextWidth + 3 * dxTextSpace, Col, Row); + taCenterX: + begin + Dec(TextWidth, (TextWidth - AItem.Width) div 2); + AItem.TextExtentRight := CalcTextRightExtent(TextWidth + 1 * dxTextSpace, Col, Row); + AItem.TextExtentLeft := CalcTextLeftExtent(TextWidth + 1 * dxTextSpace, Col, Row); + end; + taRight: + AItem.TextExtentLeft := CalcTextLeftExtent(TextWidth + 3 * dxTextSpace, Col, Row); + end; + end; + +var + Font: HFONT; + Col, Row: Integer; + Item: TdxReportCellSSString; +begin + Font := GetCurrentObject(ScreenDC, OBJ_FONT); + for Col := 0 to AnAdapter.ColCount - 1 do + for Row := 0 to AnAdapter.RowCount - 1 do + begin + Item := AnAdapter[Col, Row]; + if NeedCalcItemTextExtents(Item) then DoCalcItemTextExtents(Item, Col, Row); + end; + SelectObject(ScreenDC, Font); +end; + +procedure TCustomdxSpreadSheetReportLink.DeleteCellObjects; +var + I: Integer; +begin + for I := 0 to FCellObjects.Count - 1 do + TObject(FCellObjects[I]).Free; + FCellObjects.Clear; +end; + +procedure TCustomdxSpreadSheetReportLink.DeleteUnneededCellSides(AnAdapter: TdxPSGridCellsAdapter); + + procedure DoDeleteUnneededCellSidesFromRightSide(AItem: TdxReportCellSSString; ACol: Integer); + var + TextRightExtent, Col, CurrentColumnOffset: Integer; + begin + TextRightExtent := AItem.TextExtentRight; + for Col := ACol + 1 to AnAdapter.ColCount - 1 do + begin + CurrentColumnOffset := AnAdapter.ColOffsets[Col]; + if CurrentColumnOffset < TextRightExtent then + begin + AItem.CellSides := AItem.CellSides - [csRight]; + AItem := TdxReportCellSSString(AItem.GetNextSibling); + if AItem = nil then + Break; + AItem.CellSides := AItem.CellSides - [csLeft]; + end; + end; + end; + + procedure DoDeleteUnneededCellSidesFromLeftSide(AItem: TdxReportCellSSString; ACol: Integer); + var + TextLeftExtent, Col, CurrentColumnOffset: Integer; + begin + TextLeftExtent := AItem.TextExtentLeft; + for Col := ACol downto 0 do + begin + CurrentColumnOffset := AnAdapter.ColOffsets[Col]; + if CurrentColumnOffset > TextLeftExtent then + begin + AItem.CellSides := AItem.CellSides - [csLeft]; + AItem := TdxReportCellSSString(AItem.GetPrevSibling); + if (AItem = nil) or AItem.IsFixed then + Break; + AItem.CellSides := AItem.CellSides - [csRight]; + end; + end; + end; + +var + Col, Row: Integer; + Item: TdxReportCellSSString; +begin + for Row := 0 to AnAdapter.RowCount - 1 do + for Col := 0 to AnAdapter.ColCount - 1 do + begin + Item := AnAdapter[Col, Row]; + if Item.TextExtentRight <> 0 then + DoDeleteUnneededCellSidesFromRightSide(Item, Col); + if Item.TextExtentLeft <> 0 then + DoDeleteUnneededCellSidesFromLeftSide(Item, Col); + end; +end; + +procedure TCustomdxSpreadSheetReportLink.FixupRowWidths(AnAdapter: TdxPSGridCellsAdapter); +var + MaxWidth, I: Integer; +begin + with AnAdapter do + begin + MaxWidth := 0; + for I := 0 to ColCount - 1 do + Inc(MaxWidth, ColWidths[I]); + + for I := 0 to RowCount - 1 do + Rows[I].Width := MaxWidth; + end; +end; + +function TCustomdxSpreadSheetReportLink.HasMerges: Boolean; +begin + Result := MergedCells.Count <> 0; +end; + +function TCustomdxSpreadSheetReportLink.IsEmptyCell(const ACell: TcxSSCellRec): Boolean; +var + DefaultStyle: TcxSSCellStyleRec; +begin + DefaultStyle := ExposeDataStorage(GetSSDataStorage).DefaultCellRec.StylePtr^; + Result := IsCellDataEmpty(ACell) and AreStylesEqual(DefaultStyle, ACell.StylePtr^); +end; + +function TCustomdxSpreadSheetReportLink.OnlyEdgeIsAssigned(const ACell: TcxSSCellRec; + AEdge: TcxSSEdgeBorder): Boolean; +var + DefaultStyle: TcxSSCellStyleRec; +begin + DefaultStyle := ExposeDataStorage(GetSSDataStorage).DefaultCellRec.StylePtr^; + Result := IsCellDataEmpty(ACell) and AreStylesEqual(DefaultStyle, ACell.StylePtr^, [AEdge]); +end; + +function TCustomdxSpreadSheetReportLink.OnlyLeftEdgeIsAssigned(ACell: TcxSSCellRec): Boolean; +begin + Result := OnlyEdgeIsAssigned(ACell, eLeft); +end; + +function TCustomdxSpreadSheetReportLink.OnlyTopEdgeIsAssigned(ACell: TcxSSCellRec): Boolean; +begin + Result := OnlyEdgeIsAssigned(ACell, eTop); +end; + +procedure TCustomdxSpreadSheetReportLink.SetupCellBorders(ACol, ARow: Integer; + ADataItem: TAbstractdxReportCellData); +var + DefaultAutoColor, DefaultColor: TColor; + Style: TcxSSCellStyle; + Side: TdxCellSide; + Border: TdxPSCellBorder; +begin + if not IsFixedCell(ACol, ARow) then + begin + DefaultAutoColor := ColorToRGB(clWindowText); + DefaultColor := ColorToRGB(ExposeSpreadSheetBook(CustomSpreadSheetBook).GridColor); + + if IsSuppressSourceFormats then + Style := nil + else + Style := GetSSCellStyle(ACol, ARow); + + for Side := csLeft to csBottom do + if Side in ADataItem.CellSides then + begin + if Style <> nil then + begin + with Style.Borders.Edges[cxSSEdgeBorderMap[Side]] do + begin + Border.Pattern := dxPSEdgePatternClassMap[Style]; + if Style = lsDefault then + Border.Color := GetRealColor(Color, DefaultColor) + else + Border.Color := GetRealColor(Color, DefaultAutoColor); + end; + if IsSSDefaultStyle(Style) then + Border.Color := GetRealColor(GetSSDefaultCellSideColor(Side), DefaultColor); + end + else + if not IsMergedCell(ACol, ARow) then + begin + Border.Color := GetRealColor(GetSSDefaultCellSideColor(Side), ColorToRGB(GridLineColor)); + Border.Pattern := TdxPSSolidEdgePattern; + end + else + Border.Pattern := nil; + + TdxReportCellSSString(ADataItem).Borders[Side] := Border; + end; + end +end; + +function TCustomdxSpreadSheetReportLink.GetBookSheet: TcxSSBookSheet; +begin + if CustomSpreadSheetBook = nil then + Result := nil + else + Result := ExposeSpreadSheetBook(CustomSpreadSheetBook).ActiveSheet; +end; + +function TCustomdxSpreadSheetReportLink.GetCustomSpreadSheetBook: TcxCustomSpreadSheetBook; +begin + Result := TcxCustomSpreadSheetBook(Component); +end; + +function TCustomdxSpreadSheetReportLink.GetMeaningColCount: Integer; +var + Storage: TcxSSDataStorageAccess; + Col, Row, CandidateCol: Integer; + Cell: TcxSSCellRec; + R: TRect; +begin + Result := -1; + CandidateCol := 0; + Storage := ExposeDataStorage(GetSSDataStorage); + for Row := 0 to Storage.Capacity.cY - 1 do + begin + for Col := Storage.Capacity.cX - 1 downto 0 do + begin + Cell := Storage.Cells[Col, Row]; + if not IsEmptyCell(Cell) then + begin + CandidateCol := Col; + if (CandidateCol > 0) and OnlyLeftEdgeIsAssigned(Cell) then Dec(CandidateCol); + Break; + end; + end; + if CandidateCol > Result then Result := CandidateCol; + end; + + for Col := 0 to MergedCells.Count - 1 do + begin + R := Storage.MergedCells.MergedAsRect[Col]; + if R.Right > Result then Result := R.Right; + end; + + if Result > -1 then Inc(Result); +end; + +function TCustomdxSpreadSheetReportLink.GetMeaningRowCount: Integer; +var + Storage: TcxSSDataStorageAccess; + CandidateRow, Col, Row: Integer; + Cell: TcxSSCellRec; + IsBreaked: Boolean; + R: TRect; +begin + Storage := ExposeDataStorage(GetSSDataStorage); + CandidateRow := -1; + + for Row := Storage.Capacity.cY - 1 downto 0 do + begin + IsBreaked := False; + for Col := 0 to Storage.Capacity.cX - 1 do + begin + Cell := Storage.Cells[Col, Row]; + if not IsEmptyCell(Cell) then + begin + CandidateRow := Row; + if (CandidateRow = 0) or not OnlyTopEdgeIsAssigned(Cell) then + begin + IsBreaked := True; + Break; + end; + end; + end; + if CandidateRow <> -1 then + begin + if not IsBreaked then Dec(CandidateRow); + Break; + end; + end; + Result := CandidateRow; + + for Col := 0 to Storage.MergedCells.Count - 1 do + begin + R := Storage.MergedCells.MergedAsRect[Col]; + if R.Bottom > Result then Result := R.Bottom; + end; + Result := Min(Result, Storage.MaxRow + 1); + if Result > -1 then Inc(Result); +end; + +function TCustomdxSpreadSheetReportLink.GetMergedCells: TcxSSMergedCellsStorage; +begin + Result := ExposeDataStorage(ExposeBookSheet(BookSheet).DataStorage).MergedCells; +end; + +procedure TCustomdxSpreadSheetReportLink.SetOptionsView(Value: TdxPSSpreadSheetReportLinkOptionsView); +begin + if FOptionsView <> Value then + begin + FOptionsView := Value; + if ssovSuppressSourceFormats in FOptionsView then + DrawMode := gdmStrict + else + DrawMode := gdmBorrowSource; + LinkModified(True); + end; +end; + +procedure TCustomdxSpreadSheetReportLink.SetPrintArea(Value: TRect); +begin + CheckPrintAreaBounds(Value); + if not EqualRect(Value, FPrintArea) then + begin + FPrintArea := Value; + LinkModified(True); + end; +end; + +function TCustomdxSpreadSheetReportLink.GetSSCellObject(ACol, ARow: Integer): TcxSSCellObject; +var + Index: Integer; +begin + Index := GetFlatIndex(ACol - 1, ARow - 1); + if Index > FCellObjects.Count - 1 then // ExtraColumns + Result := nil + else + Result := FCellObjects.List^[Index]; + + if Result = nil then + begin + Result := ExposeActiveSpreadSheet(CustomSpreadSheetBook).GetCellObject(ACol - 1, ARow - 1); + if Index > FCellObjects.Count - 1 then + FCellObjects.Count := Index + 1; + FCellObjects.List^[Index] := Result; + end; +end; + +function TCustomdxSpreadSheetReportLink.GetSSCellStyle(ACol, ARow: Integer): TcxSSCellStyle; +var + CellObject: TcxSSCellObject; +begin + if not FAppendingExtraColumns then + begin + CellObject := GetSSCellObject(ACol, ARow); + if (CellObject <> nil) and CellObject.StyleExist then + Result := CellObject.Style + else + Result := GetSSDefaultStyle; + end + else + Result := GetSSDefaultStyle; +end; + +function TCustomdxSpreadSheetReportLink.GetSSColorPalette: PcxExcelPalette; +begin + Result := ExposeSpreadSheetBook(CustomSpreadSheetBook).Palette; +end; + +function TCustomdxSpreadSheetReportLink.GetSSDataStorage: TcxSSDataStorage; +begin + Result := ExposeBookSheet(BookSheet).DataStorage; +end; + +function TCustomdxSpreadSheetReportLink.GetSSDefaultCellSideColor(ASide: TdxCellSide): TColor; +begin + with ExposeSpreadSheetBook(CustomSpreadSheetBook), DefaultStyle.Borders do + if ASide in csLeftRight then + if VerticalBorders.Style <> lsDefault then + Result := VerticalBorders.Color + else + Result := ColorToRGB(GridColor) + else + if HorizontalBorders.Style <> lsDefault then + Result := HorizontalBorders.Color + else + Result := ColorToRGB(GridColor); +end; + +function TCustomdxSpreadSheetReportLink.GetSSDefaultStyle: TcxSSCellStyle; +begin + Result := ExposeSpreadSheetBook(CustomSpreadSheetBook).StyleCache.DefaultStyle; +end; + +function TCustomdxSpreadSheetReportLink.GetFlatIndex(ACol, ARow: Integer): Integer; +begin + Result := ARow * (ColCount - 1) + ACol; +end; + +function TCustomdxSpreadSheetReportLink.GetRealColor(AColorIndex: Integer; ADefaultColor: TColor): TColor; +begin + if AColorIndex > SystemColorStart then + Result := ADefaultColor + else + Result := GetSSColorPalette^[AColorIndex]; + Result := ColorToRGB(Result); +end; + +function TCustomdxSpreadSheetReportLink.IsSSDefaultStyle(AStyle: TcxSSCellStyle): Boolean; +begin + Result := AStyle = GetSSDefaultStyle; +end; + +{ TdxSpreadSheetBookReportLink } + +function TdxSpreadSheetBookReportLink.GetSpreadSheetBook: TcxSpreadSheetBook; +begin + Result := TcxSpreadSheetBook(Component); +end; + +{ TdxSpreadSheetReportLink } + +function TdxSpreadSheetReportLink.GetSpreadSheet: TcxSpreadSheet; +begin + Result := TcxSpreadSheet(Component); +end; + +{ TfmdxSpreadSheetDesignWindow } + +constructor TfmdxSpreadSheetDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxhccxSpreadSheetReportLinkDesigner; + inherited; + CreateControls; + pgctrlMain.ActivePage := pgctrlMain.Pages[0]; +end; + +procedure TfmdxSpreadSheetDesignWindow.DoInitialize; +begin + inherited; + chbxShowRowAndColumnHeadings.Checked := ssovRowAndColumnHeadings in ReportLink.OptionsView; + chbxShowGridLines.Checked := ssovGridLines in ReportLink.OptionsView; + +// chbxAutoWidth.Checked := ReportLink.AutoWidth; + chbxRowAutoHeight.Checked := ReportLink.RowAutoHeight; + chbxSuppressSourceFormats.Checked := ssovSuppressSourceFormats in ReportLink.OptionsView; + + chbxTransparent.Checked := ReportLink.Transparent; + TdxPSColorCombo(FccbxColor).ColorValue := ReportLink.Color; + chbxFixedTransparent.Checked := ReportLink.FixedTransparent; + TdxPSColorCombo(FccbxFixedColor).ColorValue := ReportLink.FixedColor; + TdxPSColorCombo(FccbxGridLineColor).ColorValue := ReportLink.GridLineColor; + + FontInfoToText(ReportLink.Font, edFont); + FontInfoToText(ReportLink.FixedFont, edFixedFont); + + chbxFixedRowsOnEveryPage.Checked := ReportLink.HeadersOnEveryPage; + chbxOnlySelected.Checked := ReportLink.OnlySelected; +end; + +{$IFDEF DELPHI7} +function TfmdxSpreadSheetDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +procedure TfmdxSpreadSheetDesignWindow.LoadStrings; +begin + inherited; + + tshOptions.Caption := cxGetResourceString(@sdxOptions); + tshFont.Caption := cxGetResourceString(@sdxFonts); + tshColor.Caption := cxGetResourceString(@sdxColors); + tshBehaviors.Caption := cxGetResourceString(@sdxBehaviors); + lblPreview.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + lblShow.Caption := cxGetResourceString(@sdxShow); + chbxShowRowAndColumnHeadings.Caption := cxGetResourceString(@sdxShowRowAndColumnHeadings); + chbxShowGridLines.Caption := cxGetResourceString(@sdxShowGridLines); + + lblMiscellaneous.Caption := cxGetResourceString(@sdxMiscellaneous); + //chbxAutoWidth.Caption := cxGetResourceString(@sdxAutoWidth); + chbxRowAutoHeight.Caption := cxGetResourceString(@sdxRowAutoHeight); + chbxSuppressSourceFormats.Caption := cxGetResourceString(@sdxSuppressSourceFormats); + + stTransparent.Caption := ' ' + cxGetResourceString(@sdxTransparent) + ' '; + lblColor.Caption := cxGetResourceString(@sdxColor); + stFixedTransparent.Caption := ' ' + cxGetResourceString(@sdxFixedTransparent) + ' '; + lblFixedColor.Caption := cxGetResourceString(@sdxFixedColor); + lblGridLinesColor.Caption := cxGetResourceString(@sdxGridLinesColor); + + btnFont.Caption := cxGetResourceString(@sdxBtnFont); + btnFixedFont.Caption := cxGetResourceString(@sdxBtnFixedFont); + + lblOnEveryPage.Caption := cxGetResourceString(@sdxOnEveryPage); + chbxFixedRowsOnEveryPage.Caption := cxGetResourceString(@sdxRepeatHeaderRowAtTop); + + lblSelection.Caption := cxGetResourceString(@sdxSelection); + chbxOnlySelected.Caption := cxGetResourceString(@sdxOnlySelected); +end; + +procedure TfmdxSpreadSheetDesignWindow.PaintPreview(ACanvas: TCanvas; R: TRect); +begin + inherited; + dxPSBaseGridLnk.dxPSDrawGridPreview(ACanvas, R, ReportLink, + ReportLink.IsShowRowAndColumnHeadings, ReportLink.IsShowRowAndColumnHeadings); +end; + +procedure TfmdxSpreadSheetDesignWindow.UpdateControlsState; +begin + inherited; + FccbxColor.Enabled := not chbxTransparent.Checked; + lblColor.Enabled := FccbxColor.Enabled; + FccbxFixedColor.Enabled := not chbxFixedTransparent.Checked; + lblFixedColor.Enabled := FccbxFixedColor.Enabled; + chbxFixedRowsOnEveryPage.Enabled := not ReportLink.IsAggregated; +end; + +procedure TfmdxSpreadSheetDesignWindow.UpdatePreview; +begin + FPreviewBox.Invalidate; +end; + +function TfmdxSpreadSheetDesignWindow.GetReportLink: TCustomdxSpreadSheetReportLink; +begin + Result := inherited ReportLink as TCustomdxSpreadSheetReportLink; +end; + +procedure TfmdxSpreadSheetDesignWindow.SetReportLink(Value: TCustomdxSpreadSheetReportLink); +begin + inherited ReportLink := Value; +end; + +procedure TfmdxSpreadSheetDesignWindow.CreateControls; + + function CreateColorCombo(AHost: TBevel; ALabel: TLabel; ATag: Integer; AnAutoColor: TColor): TdxPSColorCombo; + begin + Result := TdxPSColorCombo.Create(Self); + with Result do + begin + BoundsRect := AHost.BoundsRect; + Tag := ATag; + Parent := AHost.Parent; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := AnAutoColor; + OnChange := ccbxColorChange; + end; + ALabel.FocusControl := Result; + end; + + function CreatePreviewBox(AParent: TWinControl) : TdxPSPaintPanel; + begin + Result := TdxPSPaintPanel.Create(Self); + with Result do + begin + Parent := AParent; + Align := alClient; + EdgeInner := esNone; + EdgeOuter := esNone; + OnPaint := pbxPreviewPaint; + end; + end; + +begin + FccbxColor := CreateColorCombo(bvlColorHolder, lblColor, 0, dxDefaultColor); + FccbxFixedColor := CreateColorCombo(bvlFixedColorHolder, lblFixedColor, 1, dxDefaultFixedColor); + FccbxGridLineColor := CreateColorCombo(bvlLineColorHolder, lblGridLinesColor, 2, dxDefaultGridLineColor); + + FPreviewBox := CreatePreviewBox(pnlPreview); +end; + +procedure TfmdxSpreadSheetDesignWindow.CMDialogChar(var Message: TCMDialogChar); +var + I: Integer; +begin + inherited; + with pgctrlMain do + for I := 0 to PageCount - 1 do + if IsAccel(Message.CharCode, Pages[I].Caption) then + begin + Message.Result := 1; + ActivePage := Pages[I]; + Exit; + end; +end; + +procedure TfmdxSpreadSheetDesignWindow.pbxPreviewPaint(Sender: TObject); +begin + with TdxPSPaintPanel(Sender) do + PaintPreview(Canvas, ClientRect); +end; + +procedure TfmdxSpreadSheetDesignWindow.chbxFixedRowsOnEveryPageClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.HeadersOnEveryPage := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TfmdxSpreadSheetDesignWindow.chbxOnlySelectedClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OnlySelected := TCheckBox(Sender).checked; + Modified := True; +end; + +procedure TfmdxSpreadSheetDesignWindow.ccbxColorChange(Sender: TObject); +var + Color: TColor; +begin + if LockControlsUpdate then Exit; + Color := TdxPSColorCombo(Sender).ColorValue; + case TdxPSColorCombo(Sender).Tag of + 0: ReportLink.Color := Color; + 1: ReportLink.FixedColor := Color; + 2: ReportLink.GridLineColor := Color; + end; + Modified := True; + UpdatePreview; +end; + +procedure TfmdxSpreadSheetDesignWindow.btnFixedFontClick(Sender: TObject); + + function GetEdit: TEdit; + begin + if TButton(Sender).Tag = 0 then + Result := edFont + else + Result := edFixedFont; + end; + +begin + if LockControlsUpdate then Exit; + + with dxPSGlbl.FontDialog do + begin + case TButton(Sender).Tag of + 0: Font := ReportLink.Font; + 1: Font := ReportLink.FixedFont; + end; + + if Execute then + begin + case TButton(Sender).Tag of + 0: ReportLink.Font := Font; + 1: ReportLink.FixedFont := Font; + end; + FontInfoToText(Font, GetEdit); + Modified := True; + UpdatePreview; + end; + end; +end; + +procedure TfmdxSpreadSheetDesignWindow.chbxRowAutoHeightClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.RowAutoHeight := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TfmdxSpreadSheetDesignWindow.chbxSuppressSourceFormatsClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + with ReportLink do + if TCheckBox(Sender).Checked then + OptionsView := OptionsView + [ssovSuppressSourceFormats] + else + OptionsView := OptionsView - [ssovSuppressSourceFormats]; + Modified := True; + UpdatePreview; +end; + +procedure TfmdxSpreadSheetDesignWindow.chbxShowRowAndColumnHeadingsClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + with ReportLink do + if TCheckBox(Sender).Checked then + OptionsView := OptionsView + [ssovRowAndColumnHeadings] + else + OptionsView := OptionsView - [ssovRowAndColumnHeadings]; + Modified := True; + UpdatePreview; +end; + +procedure TfmdxSpreadSheetDesignWindow.chbxShowGridLinesClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + with ReportLink do + if TCheckBox(Sender).Checked then + OptionsView := OptionsView + [ssovGridLines] + else + OptionsView := OptionsView - [ssovGridLines]; + Modified := True; + UpdatePreview; +end; + +procedure TfmdxSpreadSheetDesignWindow.chbxFixedTransparentClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + case TCheckBox(Sender).Tag of + 0: ReportLink.Transparent := TCheckBox(Sender).checked; + 1: ReportLink.FixedTransparent := TCheckBox(Sender).checked; + end; + Modified := True; + UpdatePreview; +end; + +procedure TfmdxSpreadSheetDesignWindow.stTransparentClick(Sender: TObject); +begin + if chbxTransparent.CanFocus then ActiveControl := chbxTransparent; + chbxTransparent.Checked := not chbxTransparent.Checked; +end; + +procedure TfmdxSpreadSheetDesignWindow.stFixedTransparentClick(Sender: TObject); +begin + if chbxFixedTransparent.CanFocus then ActiveControl := chbxFixedTransparent; + chbxFixedTransparent.Checked := not chbxFixedTransparent.Checked; +end; + +procedure TfmdxSpreadSheetDesignWindow.lblColorClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; + TCustomComboBox(ActiveControl).DroppedDown := True; +end; + +procedure TfmdxSpreadSheetDesignWindow.pgctrlMainChange(Sender: TObject); +begin + lblPreview.Parent := TPageControl(Sender).ActivePage; +end; + +procedure RegisterItems; +begin + TdxReportCellSSString.Register; +end; + +procedure UnregisterItems; +begin + TdxReportCellSSString.Unregister; +end; + +procedure RegisterAssistants; +begin + TdxPSSSStringGridCellDataMap.Register; +end; + +procedure UnregisterAssistants; +begin + TdxPSSSStringGridCellDataMap.Unregister; +end; + +initialization + RegisterAssistants; + RegisterItems; + + dxPSRegisterReportLink(TdxSpreadSheetBookReportLink, TcxSpreadSheetBook, TfmdxSpreadSheetDesignWindow); + dxPSRegisterReportLink(TdxSpreadSheetReportLink, TcxSpreadSheet, TfmdxSpreadSheetDesignWindow); + +finalization + dxPSUnregisterReportLink(TdxSpreadSheetReportLink, TcxSpreadSheet, TfmdxSpreadSheetDesignWindow); + dxPSUnregisterReportLink(TdxSpreadSheetBookReportLink, TcxSpreadSheetBook, TfmdxSpreadSheetDesignWindow); + + UnregisterItems; + UnregisterAssistants; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxSSLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxSSLnkReg.pas new file mode 100644 index 00000000..46be9081 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxSSLnkReg.pas @@ -0,0 +1,60 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxSSLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI9} + DesignIntf, +{$ENDIF} + Classes, dxPScxSSLnk; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterNoIcon([TdxSpreadSheetBookReportLink, TdxSpreadSheetReportLink]); +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler2Lnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler2Lnk.dfm new file mode 100644 index 00000000..6d2f0768 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler2Lnk.dfm @@ -0,0 +1,1634 @@ +object cxfmSchedulerReportLinkDesignWindow: TcxfmSchedulerReportLinkDesignWindow + Left = 296 + Top = 90 + BorderStyle = bsDialog + Caption = 'cxfmSchedulerReportLinkDesignWindow' + ClientHeight = 446 + ClientWidth = 618 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 5 + Width = 610 + Height = 404 + ActivePage = tshPrintStyles + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + OnChange = PageControl1Change + object tshPrintRange: TTabSheet + Caption = 'Print Range' + ImageIndex = 3 + object lblPrintRangeStart: TLabel + Left = 17 + Top = 22 + Width = 28 + Height = 13 + Caption = '&Start:' + end + object lblPrintRangeEnd: TLabel + Left = 18 + Top = 54 + Width = 22 + Height = 13 + Caption = '&End:' + end + object lblPrintRangesMiscellaneous: TLabel + Left = 5 + Top = 91 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + Visible = False + end + object Bevel1: TBevel + Left = 80 + Top = 95 + Width = 231 + Height = 4 + Shape = bsBottomLine + Visible = False + end + object dePrintRangeStart: TcxDateEdit + Left = 70 + Top = 18 + EditValue = 38187d + Properties.OnEditValueChanged = dePrintRangeStartEditValueChanged + TabOrder = 0 + Width = 235 + end + object dePrintRangeEnd: TcxDateEdit + Left = 70 + Top = 50 + EditValue = 38187d + Properties.OnEditValueChanged = dePrintRangeEndEditValueChanged + TabOrder = 1 + Width = 235 + end + object chbxHideDetailsOfPrivateAppointments: TcxCheckBox + Left = 66 + Top = 113 + Caption = 'Hide Details of Private Appointments' + TabOrder = 2 + Visible = False + Width = 236 + end + end + object tshPrintStyles: TTabSheet + Caption = 'Print Styles' + object lblPrintStylesOptions: TLabel + Left = 5 + Top = 48 + Width = 37 + Height = 13 + Caption = 'Options' + end + object bvlPrintStyleOptions: TBevel + Left = 50 + Top = 52 + Width = 258 + Height = 4 + Shape = bsBottomLine + end + object lblPreviewWindow: TStaticText + Left = 324 + Top = 0 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 0 + end + object cbxPrintStyles: TcxImageComboBox + Left = 6 + Top = 7 + Properties.Alignment.Vert = taVCenter + Properties.Items = <> + TabOrder = 1 + OnClick = cbxPrintStylesClick + Width = 303 + end + object pcPrintStyleOptions: TPageControl + Left = 4 + Top = 62 + Width = 314 + Height = 313 + ActivePage = tshYearly + Style = tsButtons + TabOrder = 2 + TabStop = False + object tshDaily: TTabSheet + Caption = 'Daily' + TabVisible = False + object lblPrintStyleDailyLayout: TLabel + Left = 14 + Top = 4 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleDailyLayout + end + object lblPrintStyleDailyInclude: TLabel + Left = 14 + Top = 64 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleDailyPrintFrom: TLabel + Left = 14 + Top = 136 + Width = 53 + Height = 13 + Caption = 'Print &From:' + FocusControl = tePrintStyleDailyPrintFrom + end + object lblPrintStyleDailyPrintTo: TLabel + Left = 14 + Top = 165 + Width = 41 + Height = 13 + Caption = 'Print &To:' + FocusControl = tePrintStyleDailyPrintTo + end + object lblPrintStyleDailyResourceCountPerPage: TLabel + Left = 14 + Top = 34 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleDailyResourceCountPerPage + end + object Bevel2: TBevel + Left = 0 + Top = 192 + Width = 306 + Height = 4 + Shape = bsBottomLine + end + object cbxPrintStyleDailyLayout: TcxComboBox + Left = 115 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/day' + '2 pages/day') + TabOrder = 0 + OnClick = cbxPrintStyleDailyLayoutClick + Height = 23 + Width = 186 + end + object chbxPrintStyleDailyTaskPad: TcxCheckBox + Left = 111 + Top = 61 + Caption = 'Task&Pad' + TabOrder = 2 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleDailyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 82 + Caption = 'Notes Area (&Blank)' + TabOrder = 3 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleDailyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 103 + Caption = 'Notes Area (&Lined)' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object tePrintStyleDailyPrintFrom: TcxTimeEdit + Left = 114 + Top = 132 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 5 + Width = 100 + end + object tePrintStyleDailyPrintTo: TcxTimeEdit + Tag = 1 + Left = 114 + Top = 161 + EditValue = 0.000000000000000000 + Properties.ImmediatePost = True + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 6 + Width = 100 + end + object sePrintStyleDailyResourceCountPerPage: TcxSpinEdit + Left = 115 + Top = 30 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 1 + Width = 100 + end + object chbxPrintStyleDailyShowResourceImages: TcxCheckBox + Left = -1 + Top = 201 + Caption = 'Show resource images' + TabOrder = 7 + OnClick = chbxPrintStyleShowResourceImagesClick + Width = 306 + end + object chbxPrintStyleDailyShowEventImages: TcxCheckBox + Left = -1 + Top = 222 + Caption = 'Show event images' + TabOrder = 8 + OnClick = chbxPrintStyleShowEventImagesClick + Width = 306 + end + end + object tshWeekly: TTabSheet + Caption = 'Weekly' + ImageIndex = 1 + TabVisible = False + object lblPrintStyleWeeklyPrintTo: TLabel + Left = 14 + Top = 212 + Width = 41 + Height = 13 + Caption = 'Print &To:' + FocusControl = tePrintStyleWeeklyPrintTo + end + object lblPrintStyleWeeklyPrintFrom: TLabel + Left = 14 + Top = 183 + Width = 53 + Height = 13 + Caption = 'Print &From:' + FocusControl = tePrintStyleWeeklyPrintFrom + end + object lblPrintStyleWeeklyInclude: TLabel + Left = 14 + Top = 119 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleWeeklyLayout: TLabel + Left = 14 + Top = 33 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleWeeklyLayout + end + object lblPrintStyleWeeklyArrange: TLabel + Left = 14 + Top = 4 + Width = 43 + Height = 13 + Caption = '&Arrange:' + FocusControl = cbxPrintStyleWeeklyArrange + end + object lblPrintStyleWeeklyResourceCountPerPage: TLabel + Left = 14 + Top = 94 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleWeeklyResourceCountPerPage + end + object lblPrintStyleWeeklyDaysLayout: TLabel + Left = 14 + Top = 63 + Width = 61 + Height = 13 + Caption = '&Days layout:' + FocusControl = cbxPrintStyleWeeklyDaysLayout + end + object Bevel3: TBevel + Left = 0 + Top = 237 + Width = 306 + Height = 4 + Shape = bsBottomLine + end + object tePrintStyleWeeklyPrintTo: TcxTimeEdit + Tag = 1 + Left = 114 + Top = 207 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 8 + Width = 100 + end + object tePrintStyleWeeklyPrintFrom: TcxTimeEdit + Left = 114 + Top = 178 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 7 + Width = 100 + end + object chbxPrintStyleWeeklyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 152 + Caption = 'Notes Area (&Lined)' + TabOrder = 6 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleWeeklyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 134 + Caption = 'Notes Area (&Blank)' + TabOrder = 5 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object cbxPrintStyleWeeklyArrange: TcxComboBox + Left = 115 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + 'Top to Bottom' + 'Left to Right') + TabOrder = 0 + OnClick = cbxPrintStyleWeeklyArrangeClick + Height = 23 + Width = 186 + end + object cbxPrintStyleWeeklyLayout: TcxComboBox + Left = 115 + Top = 29 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/day' + '2 pages/day') + TabOrder = 1 + OnClick = cbxPrintStyleWeeklyLayoutClick + Height = 23 + Width = 186 + end + object chbxPrintStyleWeeklyTaskPad: TcxCheckBox + Left = 111 + Top = 116 + Caption = 'TaskPad' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleWeeklyDontPrintWeekends: TcxCheckBox + Left = -1 + Top = 243 + Caption = 'Don'#39't Print &Weekends' + TabOrder = 9 + OnClick = chbxPrintStyleWeeklyDontPrintWeekendsClick + Width = 285 + end + object sePrintStyleWeeklyResourceCountPerPage: TcxSpinEdit + Tag = 1 + Left = 115 + Top = 90 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 3 + Width = 100 + end + object cbxPrintStyleWeeklyDaysLayout: TcxComboBox + Left = 115 + Top = 59 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + 'Two columns' + 'One column') + TabOrder = 2 + OnClick = cbxPrintStyleWeeklyDaysLayoutClick + Height = 23 + Width = 186 + end + object chbxPrintStyleWeeklyShowEventImages: TcxCheckBox + Left = -1 + Top = 283 + Caption = 'Show event images' + TabOrder = 11 + OnClick = chbxPrintStyleShowEventImagesClick + Width = 306 + end + object chbxPrintStyleWeeklyShowResourceImages: TcxCheckBox + Left = -1 + Top = 263 + Caption = 'Show resource images' + TabOrder = 10 + OnClick = chbxPrintStyleShowResourceImagesClick + Width = 306 + end + end + object tshMonthly: TTabSheet + Caption = 'Monthly' + ImageIndex = 2 + TabVisible = False + object lblPrintStyleMonthlyLayout: TLabel + Left = 14 + Top = 4 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleMonthlyLayout + end + object lblPrintStyleMonthlyInclude: TLabel + Left = 14 + Top = 62 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleMonthlyResourceCountPerPage: TLabel + Left = 14 + Top = 34 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleMonthlyResourceCountPerPage + end + object Bevel4: TBevel + Left = 0 + Top = 127 + Width = 314 + Height = 4 + Shape = bsBottomLine + end + object cbxPrintStyleMonthlyLayout: TcxComboBox + Left = 115 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/month' + '2 pages/month') + TabOrder = 0 + OnClick = cbxPrintStyleMonthlyLayoutClick + Height = 23 + Width = 186 + end + object chbxPrintStyleMonthlyTaskPad: TcxCheckBox + Left = 111 + Top = 59 + Caption = 'Task&Pad' + TabOrder = 2 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleMonthlyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 80 + Caption = 'Notes Area (&Blank)' + TabOrder = 3 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleMonthlyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 101 + Caption = 'Notes Area (&Lined)' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleMonthlyDontPrintWeekends: TcxCheckBox + Left = -1 + Top = 136 + Caption = 'Don'#39't Print &Weekends' + TabOrder = 5 + OnClick = chbxPrintStyleMonthlyDontPrintWeekendsClick + Width = 285 + end + object chbxPrintStyleMonthlyPrintExactlyOneMonthPerPage: TcxCheckBox + Left = -1 + Top = 156 + Caption = 'Print Exactly One Month Per Page' + TabOrder = 6 + OnClick = chbxPrintStyleMonthlyPrintExactlyOneMonthPerPageClick + Width = 285 + end + object sePrintStyleMonthlyResourceCountPerPage: TcxSpinEdit + Tag = 2 + Left = 115 + Top = 29 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 1 + Width = 100 + end + object chbxPrintStyleMonthlyShowEventImages: TcxCheckBox + Left = -1 + Top = 198 + Caption = 'Show event images' + TabOrder = 7 + OnClick = chbxPrintStyleShowEventImagesClick + Width = 306 + end + object chbxPrintStyleMonthlyShowResourceImages: TcxCheckBox + Left = -1 + Top = 177 + Caption = 'Show resource images' + TabOrder = 8 + OnClick = chbxPrintStyleShowResourceImagesClick + Width = 306 + end + end + object tshTrifold: TTabSheet + Caption = 'Tri-fold' + ImageIndex = 3 + TabVisible = False + object lblPrintStyleTrifoldSectionLeft: TLabel + Left = 14 + Top = 4 + Width = 61 + Height = 13 + Caption = '&Left Section:' + FocusControl = cbxPrintStyleTrifoldSectionLeft + end + object lblPrintStyleTrifoldSectionMiddle: TLabel + Left = 14 + Top = 38 + Width = 72 + Height = 13 + Caption = '&Middle Section:' + FocusControl = cbxPrintStyleTrifoldSectionMiddle + end + object lblPrintStyleTrifoldSectionRight: TLabel + Left = 14 + Top = 71 + Width = 67 + Height = 13 + Caption = '&Right Section:' + FocusControl = cbxPrintStyleTrifoldSectionRight + end + object cbxPrintStyleTrifoldSectionLeft: TcxComboBox + Left = 100 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + TabOrder = 0 + OnClick = cbxPrintStyleTrifoldSectionModeClick + Height = 23 + Width = 201 + end + object cbxPrintStyleTrifoldSectionMiddle: TcxComboBox + Tag = 1 + Left = 100 + Top = 33 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + TabOrder = 1 + OnClick = cbxPrintStyleTrifoldSectionModeClick + Height = 23 + Width = 201 + end + object cbxPrintStyleTrifoldSectionRight: TcxComboBox + Tag = 2 + Left = 100 + Top = 66 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + TabOrder = 2 + OnClick = cbxPrintStyleTrifoldSectionModeClick + Height = 23 + Width = 201 + end + end + object tshDetails: TTabSheet + Caption = 'Details' + ImageIndex = 4 + TabVisible = False + object chbxPrintStyleDetailsUsePagination: TcxCheckBox + Left = 14 + Top = 0 + Caption = 'Start a New Page Each:' + TabOrder = 0 + OnClick = chbxPrintStyleDetailsUsePaginationClick + Width = 187 + end + object cbxPrintStyleDetailsPagination: TcxComboBox + Left = 203 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + 'Day' + 'Week' + 'Month') + TabOrder = 1 + OnClick = cbxPrintStyleDetailsPaginationClick + Height = 23 + Width = 98 + end + end + object tshMemo: TTabSheet + Caption = 'Memo' + ImageIndex = 5 + TabVisible = False + object chbxPrintStyleMemoStartEachItemOnNewPage: TcxCheckBox + Left = 14 + Top = 1 + Caption = 'Start Each Item On New Page' + TabOrder = 0 + OnClick = chbxPrintStyleMemoStartEachItemOnNewPageClick + Width = 187 + end + object chbxPrintStyleMemoPrintOnlySelectedEvents: TcxCheckBox + Left = 14 + Top = 25 + Caption = 'Print Only Selected Events' + State = cbsChecked + TabOrder = 1 + OnClick = chbxPrintStyleMemoPrintOnlySelectedEventsClick + Width = 187 + end + end + object tshYearly: TTabSheet + ImageIndex = 6 + TabVisible = False + object lblPrintStyleYearlyMonthPerPage: TLabel + Left = 14 + Top = 38 + Width = 67 + Height = 13 + Caption = '&Months/Page:' + FocusControl = cbxPrintStyleYearlyMonthPerPage + end + object lblPrintStyleYearlyResourceCountPerPage: TLabel + Left = 14 + Top = 72 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleYearlyResourceCountPerPage + Visible = False + end + object lblPrintStyleYearlyInclude: TLabel + Left = 14 + Top = 102 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleYearlyLayout: TLabel + Left = 14 + Top = 4 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleYearlyLayout + end + object Bevel5: TBevel + Left = 0 + Top = 168 + Width = 306 + Height = 4 + Shape = bsBottomLine + end + object cbxPrintStyleYearlyMonthPerPage: TcxComboBox + Left = 115 + Top = 33 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/year' + '2 pages/year' + '3 pages/year' + '4 pages/year' + '6 pages/year' + '12 pages/year') + TabOrder = 1 + Text = '12 pages/year' + OnClick = cbxPrintStyleYearlyMonthPagesPerYearClick + Height = 23 + Width = 186 + end + object sePrintStyleYearlyResourceCountPerPage: TcxSpinEdit + Tag = 3 + Left = 115 + Top = 68 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 2 + Visible = False + Width = 100 + end + object chbxPrintStyleYearlyTaskPad: TcxCheckBox + Left = 111 + Top = 99 + Caption = 'Task&Pad' + TabOrder = 3 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleYearlyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 120 + Caption = 'Notes Area (&Blank)' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleYearlyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 141 + Caption = 'Notes Area (&Lined)' + TabOrder = 5 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object cbxPrintStyleYearlyLayout: TcxComboBox + Left = 115 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/month' + '2 pages/month') + TabOrder = 0 + Text = '1 page/month' + OnClick = cbxPrintStyleYearlyLayoutClick + Height = 23 + Width = 186 + end + object chbxPrimaryPageHeadersOnly: TcxCheckBox + Left = -1 + Top = 178 + Caption = 'Primary page headers only' + TabOrder = 6 + OnClick = chbxPrimaryPageHeadersOnlyClick + Width = 153 + end + object chbxPrintStyleYearlyShowEventImages: TcxCheckBox + Left = -1 + Top = 199 + Caption = 'Show event images' + TabOrder = 7 + OnClick = chbxPrintStyleShowEventImagesClick + Width = 306 + end + end + end + object pnlPrintStylesPreview: TPanel + Left = 323 + Top = 17 + Width = 275 + Height = 356 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 3 + object pbxPrintStylesPreview: TPaintBox + Left = 1 + Top = 1 + Width = 273 + Height = 354 + Align = alClient + OnPaint = pbxPrintStylesPreviewPaint + end + end + end + object tshFormatting: TTabSheet + Caption = 'Formatting' + ImageIndex = 2 + object bvlLookAndFeel: TBevel + Left = 85 + Top = 13 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object lblLookAndFeel: TLabel + Left = 5 + Top = 8 + Width = 66 + Height = 13 + Caption = 'Look and Feel' + end + object imgLookAndFeel: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDD77777777777777777777 + 7777D0000000000000000000000007DDDDDDDDDDDDD000000000000000000000 + 0007D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0FFFFFFFFFF78888877787807DDDDDDDDDDDDD0FFFFFFFFFF7888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7888888888 + 8807D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCDDDDCDDDD077777777777777777777 + 7707D0888877787878888877787807DDDCCCCDCCDDD088887778787888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF07DDDCCCCCCCCDD088888888887888888888 + 8807D0777777777777777777777707DDDCCCCDCCDDD077777777777777777777 + 7707D0FFFFFFFFFF7FFFFFFFFFFF07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0FFFFFFFFFF7FFFFFFFFFFF07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDCCCCDCCDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCCCCCCCCDD077777777777777777777 + 7707D0888877787878888877787807DDDCCCCDCCDDD088887778787888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF07DDDCDDDDCDDDD088888888887888888888 + 8807D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D0888877787878888877787807DDDDDDDDDDDDD088887778787888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF0DDDDDDDDDDDDDD088888888887888888888 + 8807D000000000000000000000000DDDDDDDDDDDDDD000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblRefinements: TLabel + Left = 5 + Top = 78 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlRefinements: TBevel + Left = 75 + Top = 82 + Width = 236 + Height = 4 + Shape = bsBottomLine + end + object imgRefinements: TImage + Left = 8 + Top = 100 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDD77777777777777777777 + 7777D0000000000000000000000007DDDDDDDDDDDDD000000000000000000000 + 0007D0FAFAFAFAFA7AFAFAFAFAFA07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0FAFAFAFAFA788888777CC807DDDDDDDDDDDDD0FFFFFFFFFF7888887778 + 7807D0AFAFAFAFAF78888888888807DDDDDDDDDDDDD0FFFFFFFFFF7888888888 + 8807D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0AFAFAFAFAF7FAFAFAFAFAF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FAFAFAFAFA7AFAFAFAFAFA07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCDDDDCDDDD077777777777777777777 + 7707D08888777CC8788888777CC807DDDCCCCDCCDDD088887778787888887778 + 7807D0888888888878888888888807DDDCCCCCCCCDD088888888887888888888 + 8807D0777777777777777777777707DDDCCCCDCCDDD077777777777777777777 + 7707D0FEFEFEFEFE7EFEFEFEFEFE07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0EFEFEFEFEF7FEFEFEFEFEF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0EFEFEFEFEF7FEFEFEFEFEF07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FEFEFEFEFE7EFEFEFEFEFE07DDDCCCCDCCDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCCCCCCCCDD077777777777777777777 + 7707D08888777CC8788888777CC807DDDCCCCDCCDDD088887778787888887778 + 7807D0888888888878888888888807DDDCDDDDCDDDD088888888887888888888 + 8807D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D0FBFBFBFBFB7BFBFBFBFBFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0BFBFBFBFBF7FBFBFBFBFBF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0BFBFBFBFBF7FBFBFBFBFBF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FBFBFBFBFB7BFBFBFBFBFB07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D08888777CC8788888777CC807DDDDDDDDDDDDD088887778787888887778 + 7807D088888888887888888888880DDDDDDDDDDDDDD088888888887888888888 + 8807D000000000000000000000000DDDDDDDDDDDDDD000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object cbxLookAndFeel: TcxComboBox + Left = 90 + Top = 37 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.OnChange = cbxLookAndFeelPropertiesChange + TabOrder = 0 + OnClick = LookAndFeelChange + Height = 23 + Width = 215 + end + object chbxSuppressBackgroundBitmaps: TcxCheckBox + Tag = 1 + Left = 90 + Top = 104 + Caption = 'Suppress Background Textures' + TabOrder = 1 + OnClick = OptionsFormattingClick + Width = 200 + end + object chbxSuppressContentColoration: TcxCheckBox + Tag = 2 + Left = 90 + Top = 130 + Caption = 'Suppress Content Coloration' + TabOrder = 2 + OnClick = OptionsFormattingClick + Width = 200 + end + end + object tshStyles: TTabSheet + Caption = 'Styles' + ImageIndex = 1 + object bvlStyles: TBevel + Left = 118 + Top = 13 + Width = 193 + Height = 4 + Shape = bsBottomLine + end + object bvlStyleSheets: TBevel + Left = 72 + Top = 302 + Width = 239 + Height = 5 + Shape = bsBottomLine + end + object lblStyleSheets: TLabel + Left = 6 + Top = 298 + Width = 60 + Height = 13 + Caption = 'Style Sheets' + end + object bvlStylesHost: TBevel + Left = 6 + Top = 33 + Width = 228 + Height = 222 + end + object Label1: TLabel + Left = 85 + Top = 140 + Width = 64 + Height = 13 + Caption = '[ Styles Site ]' + Visible = False + end + object lblUseNativeStyles: TLabel + Left = 24 + Top = 9 + Width = 84 + Height = 13 + Caption = '&Use Native Styles' + FocusControl = chbxUseNativeStyles + OnClick = lblUseNativeStylesClick + end + object btnStyleColor: TButton + Left = 243 + Top = 61 + Width = 68 + Height = 23 + Caption = 'Co&lor...' + TabOrder = 0 + OnClick = btnStyleColorClick + end + object btnStyleFont: TButton + Left = 243 + Top = 33 + Width = 68 + Height = 23 + Caption = '&Font...' + TabOrder = 1 + OnClick = btnStyleFontClick + end + object btnStyleBackgroundBitmap: TButton + Left = 243 + Top = 97 + Width = 68 + Height = 23 + Caption = '&Bitmap...' + TabOrder = 2 + OnClick = btnStyleBackgroundBitmapClick + end + object cbxStyleSheets: TcxComboBox + Left = 6 + Top = 318 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 20 + Properties.OnDrawItem = cbxStyleSheetsPropertiesDrawItem + TabOrder = 3 + OnClick = cbxStyleSheetsClick + OnKeyDown = cbxStyleSheetsKeyDown + Height = 24 + Width = 305 + end + object btnStyleSheetNew: TButton + Left = 6 + Top = 350 + Width = 71 + Height = 23 + Caption = '&New...' + TabOrder = 4 + OnClick = btnStyleSheetNewClick + end + object btnStyleSheetCopy: TButton + Left = 84 + Top = 350 + Width = 71 + Height = 23 + Caption = '&Copy...' + TabOrder = 5 + OnClick = btnStyleSheetCopyClick + end + object btnStyleSheetDelete: TButton + Left = 162 + Top = 350 + Width = 71 + Height = 23 + Caption = '&Delete...' + TabOrder = 6 + OnClick = btnStyleSheetDeleteClick + end + object btnStylesSaveAs: TButton + Left = 123 + Top = 263 + Width = 112 + Height = 23 + Caption = 'Save &As...' + TabOrder = 7 + OnClick = btnStylesSaveAsClick + end + object btnStyleSheetRename: TButton + Left = 240 + Top = 350 + Width = 71 + Height = 23 + Caption = '&Rename...' + TabOrder = 8 + OnClick = btnStyleSheetRenameClick + end + object btnStyleBackgroundBitmapClear: TButton + Left = 243 + Top = 125 + Width = 68 + Height = 23 + Caption = 'Cle&ar' + TabOrder = 9 + OnClick = btnStyleBackgroundBitmapClearClick + end + object btnStyleRestoreDefaults: TButton + Left = 6 + Top = 263 + Width = 112 + Height = 23 + Caption = 'Rest&ore Defaults' + TabOrder = 10 + OnClick = btnStyleRestoreDefaultsClick + end + object chbxUseNativeStyles: TcxCheckBox + Left = 3 + Top = 6 + TabOrder = 11 + OnClick = OptionsFormattingClick + Width = 22 + end + end + end + object pnlPreview: TPanel + Left = 331 + Top = 46 + Width = 275 + Height = 356 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 273 + Height = 354 + Align = alClient + Color = clWindow + TabOrder = 0 + object pbPreview: TPaintBox + Left = 1 + Top = 1 + Width = 271 + Height = 352 + Align = alClient + OnPaint = pbPreviewPaint + end + end + end + object pmStyles: TPopupMenu + Images = ilStylesPopup + OnPopup = pmStylesPopup + Left = 6 + Top = 417 + object miStyleFont: TMenuItem + Caption = '&Font...' + ImageIndex = 0 + OnClick = btnStyleFontClick + end + object miStyleColor: TMenuItem + Caption = '&Color...' + OnClick = btnStyleColorClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miStyleBackgroundBitmap: TMenuItem + Caption = '&Bitmap...' + ImageIndex = 1 + ShortCut = 16463 + OnClick = btnStyleBackgroundBitmapClick + end + object miStyleBackgroundBitmapClear: TMenuItem + Caption = 'Clear' + ImageIndex = 3 + ShortCut = 16430 + OnClick = btnStyleBackgroundBitmapClearClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miStyleRestoreDefaults: TMenuItem + Caption = 'Restore Defaults' + OnClick = btnStyleRestoreDefaultsClick + end + object milLine: TMenuItem + Caption = '-' + end + object miStylesSelectAll: TMenuItem + Caption = 'Select A&ll' + ShortCut = 16449 + OnClick = miStylesSelectAllClick + end + object miLine4: TMenuItem + Caption = '-' + end + object miStylesSaveAs: TMenuItem + Caption = 'Save &As...' + ImageIndex = 2 + ShortCut = 16467 + OnClick = btnStylesSaveAsClick + end + end + object ilStylesPopup: TImageList + Left = 34 + Top = 417 + Bitmap = { + 494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00000000000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF000000 + 0000008080000080800000808000008080000080800000808000008080000080 + 8000008080000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000000000000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000008080000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF00FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800080808000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00C0C0C00000FFFF00C0C0C000FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000000000008080800080808000000000008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C00000000000C0C0C00000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFC001FFFF + FE07001F8001FFF9FF9F000F8001E7FFFF9F00078001C3F3E01F00038001C3E7 + F99F00018001E1C7F99B00008001F08FF99B00018001F81FF89300018001FC3F + D80300018001F81FD9BF80018001F09FC93FE0018001C1C7C03FE001800183E3 + FFFFE00180018FF1FFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end + object cxEditStyleController1: TcxEditStyleController + OnStyleChanged = StyleController1StyleChanged + Left = 64 + Top = 416 + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler2Lnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler2Lnk.pas new file mode 100644 index 00000000..0f392274 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler2Lnk.pas @@ -0,0 +1,10726 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxScheduler2Lnk; + +{$I cxVer.Inc} + +interface + +uses + Windows, Classes, SysUtils, Forms, Graphics, Controls, StdCtrls, ExtCtrls, ComCtrls, + ImgList, Menus, cxGraphics, cxClasses, cxControls, cxStyles, cxLookAndFeels, cxLookAndFeelPainters, + cxScheduler, cxEdit, cxContainer, cxTextEdit, cxMaskEdit, cxDropDownEdit, + cxCalendar, cxCheckBox, cxImageComboBox, cxTimeEdit, cxSpinEdit, cxDateUtils, + dxPSCore, dxPSGlbl, dxExtCtrls, dxPScxCommon, dxPrevw, dxPgsdlg, dxPrnPg, cxSchedulerUtils, + cxSchedulerStorage, cxSchedulerCustomControls, cxSchedulerCustomResourceView, + cxSchedulerDayView, cxSchedulerDateNavigator, cxSchedulerWeekView, cxSchedulerTimeGridView, + cxSchedulerYearView, cxGeometry; + +const + // visual print style indexes + + vspsSchedulerFirst = 0; + + vspsSchedulerControlFirst = vspsSchedulerFirst + 0; + vspsSchedulerContent = vspsSchedulerControlFirst + 0; + vspsSchedulerDayHeader = vspsSchedulerControlFirst + 1; + vspsSchedulerEvent = vspsSchedulerControlFirst + 2; + vspsSchedulerResourceHeader = vspsSchedulerControlFirst + 3; + vspsSchedulerControlLast = vspsSchedulerControlFirst + 3; + + vspsSchedulerViewDayFirst = vspsSchedulerControlLast + 1; + vspsSchedulerTimeRuler = vspsSchedulerViewDayFirst + 0; + vspsSchedulerViewDayLast = vspsSchedulerViewDayFirst + 0; + + vspsSchedulerDateNavigatorFirst = vspsSchedulerViewDayLast + 1; + vspsSchedulerDateNavigatorContent = vspsSchedulerDateNavigatorFirst + 0; + vspsSchedulerDateNavigatorHeader = vspsSchedulerDateNavigatorFirst + 1; + vspsSchedulerDateNavigatorLast = vspsSchedulerDateNavigatorFirst + 1; + + vspsSchedulerNativeFirst = vspsSchedulerDateNavigatorLast + 1; + vspsSchedulerSchedulerHeader = vspsSchedulerNativeFirst + 0; + vspsSchedulerNotesAreaBlank = vspsSchedulerNativeFirst + 1; + vspsSchedulerNotesAreaLined = vspsSchedulerNativeFirst + 2; + vspsSchedulerTaskPad = vspsSchedulerNativeFirst + 3; + vspsSchedulerNativeLast = vspsSchedulerNativeFirst + 3; + + vspsSchedulerLast = vspsSchedulerNativeLast; + + // custom draw ID's + cdidSchedulerFirst = 1; + cdidSchedulerSchedulerHeader = cdidSchedulerFirst + 0; + cdidSchedulerDateNavigatorHeader = cdidSchedulerFirst + 1; + cdidSchedulerDateNavigatorDay = cdidSchedulerFirst + 2; + cdidSchedulerDateNavigatorDayCaption = cdidSchedulerFirst + 3; + cdidSchedulerDateNavigatorWeekNumber = cdidSchedulerFirst + 4; + cdidSchedulerTimeRuler = cdidSchedulerFirst + 5; + cdidSchedulerNotesArea = cdidSchedulerFirst + 6; + cdidSchedulerTaskPad = cdidSchedulerFirst + 7; + cdidSchedulerContent = cdidSchedulerFirst + 8; + cdidSchedulerHeader = cdidSchedulerFirst + 9; + // keep order + cdidSchedulerEventCaption = cdidSchedulerFirst + 10; + cdidSchedulerEventStart = cdidSchedulerFirst + 11; + cdidSchedulerEventFinish = cdidSchedulerFirst + 12; + cdidSchedulerEventIcons = cdidSchedulerFirst + 13; + cdidSchedulerEventMessage = cdidSchedulerFirst + 14; + cdidSchedulerEventTimeLine = cdidSchedulerFirst + 15; + + InterAreaSpace = 5; + NotesAreaWidth = 1 / 3; + SchedulerHeaderMinHeight = 1 / 10; + SchedulerHeaderMaxHeight = 1 / 4; + SchedulerHeaderSmallHeight = 1 / 18; + +type + TcxSchedulerReportItemsType = (srSchedulingArea, srHeader, srDateNavigator, + srNotesBlank, srNotesLined, srTaskPad, srUnknownItem); + TcxSchedulerReportEventPartType = (epCaption, epStart, epFinish, epIcons, + epMessage, epTimeLine); + + TcxfmSchedulerReportLinkDesignWindow = class; + + TcxSchedulerReportLink = class; + TcxCustomSchedulerReportLinkPrintStyle = class; + TcxCustomSchedulerReportLinkPrintStyleClass = class of TcxCustomSchedulerReportLinkPrintStyle; + + TcxSchedulerReportLinkPrintStyles = class; + TcxSchedulerReportPageItemCell = class; + TcxSchedulerReportPageSite = class; + TcxSchedulerReportSchedulingAreaCell = class; + TcxSchedulerReportSchedulerHeaderCell = class; + TcxSchedulerReportDateNavigatorCell = class; + TcxSchedulerReportNotesAreaCell = class; + TcxSchedulerReportTaskPadCell = class; + + TcxSchedulerReportCustomCell = class; + TcxSchedulerReportCustomCellClass = class of TcxSchedulerReportCustomCell; + TcxSchedulerReportCommonCellsProducer = class; + + // for options + TcxCustomSchedulerReportLinkOptions = class; + TcxSchedulerReportDateNavigatorHeader = class; + TcxSchedulerReportDateNavigatorDay = class; + TcxSchedulerReportDateNavigatorDayCaption = class; + TcxSchedulerReportDateNavigatorWeekNumber = class; + TcxSchedulerReportDailyTimeRulerCell = class; + TcxSchedulerReportContentCell = class; + TcxSchedulerReportCustomEventCell = class; + TcxSchedulerReportSchedulerHeaderDataCell = class; + TcxSchedulerReportNotesDataCell = class; + TcxSchedulerReportHeaderItemCell = class; + TcxSchedulerReportDetailsEventCell = class; + TcxSchedulerReportDetailsEventCellClass = class of TcxSchedulerReportDetailsEventCell; + + { TcxCustomSchedulerReportLinkOptions } + + TcxCustomSchedulerReportLinkOptions = class(TdxCustomReportLinkOptions) + private + function GetReportLink: TcxSchedulerReportLink; + function GetScheduler: TcxScheduler; + public + property ReportLink: TcxSchedulerReportLink read GetReportLink; + property Scheduler: TcxScheduler read GetScheduler; + end; + + { TcxSchedulerReportLinkPrintRange } + + TcxSchedulerReportLinkPrintRange = class(TcxCustomSchedulerReportLinkOptions) + private + FDatePrint: array[0..1] of TDate; + FTimePrint: array[0..1] of TTime; + function GetActiveStyle: TcxCustomSchedulerReportLinkPrintStyle; + function GetDayCount: Integer; + function GetMonthCount: Integer; + function GetPrintDate(AIndex: Integer): TDate; + function GetPrintTime(AIndex: Integer): TTime; + function GetWeekCount: Integer; + function GetYearCount: Integer; + procedure SetPrintDate(AIndex: Integer; const Value: TDate); + procedure SetPrintTime(AIndex: Integer; const Value: TTime); + + function IsDateStored(AIndex: Integer): Boolean; + function IsTimeStored(AIndex: Integer): Boolean; + protected + procedure CheckTimeRange; virtual; + function GetDateTimeIF(const AValue, ADefaultValue: TDateTime): TDateTime; + + function DesignerTabIndex: Integer; override; + property ActiveStyle: TcxCustomSchedulerReportLinkPrintStyle read GetActiveStyle; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + + function DefaultDatePrintFrom: TDate; virtual; + function DefaultDatePrintTo: TDate; virtual; + function DefaultTimePrintFrom: TTime; virtual; + function DefaultTimePrintTo: TTime; virtual; + + property DayCount: Integer read GetDayCount; + property MonthCount: Integer read GetMonthCount; + property WeekCount: Integer read GetWeekCount; + property YearCount: Integer read GetYearCount; + published + property PrintFrom: TDate index 0 read GetPrintDate write SetPrintDate stored IsDateStored; + property PrintTo: TDate index 1 read GetPrintDate write SetPrintDate stored IsDateStored; + property TimePrintFrom: TTime index 0 read GetPrintTime write SetPrintTime stored IsTimeStored; + property TimePrintTo: TTime index 1 read GetPrintTime write SetPrintTime stored IsTimeStored; + end; + + { TcxSchedulerReportLinkOptionsFormatting } + + TcxSchedulerReportLinkOptionsFormatting = class(TdxCustomReportLinkOptionsFormatting) + private + FSuppressContentColoration: Boolean; + function GetReportLink: TcxSchedulerReportLink; + procedure SetSuppressContentColoration(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + + property ReportLink: TcxSchedulerReportLink read GetReportLink; + published + property SuppressContentColoration: Boolean read FSuppressContentColoration write SetSuppressContentColoration default False; + property UseLookAndFeelColors; + end; + + { TcxSchedulerReportLinkStyles } + + TcxSchedulerReportLinkStyles = class(TdxCustomReportLinkStyles, IcxSchedulerStylesAdapter, IcxSchedulerTimeRulerParams) + private + function GetExtStyles: TcxSchedulerStyles; + function GetReportLink: TcxSchedulerReportLink; + function GetUseSchedulerStyles: Boolean; + protected + FReportLink: TcxSchedulerReportLink; + function DesignerTabIndex: Integer; override; + + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + class function GetStyleCaption(AnIndex: Integer): string; override; + function GetStyleIndexByCaption(const Caption: string): Integer; override; + + // IcxSchedulerStylesAdapter + function GetDayHeaderStyle: TcxStyle; + function GetResourceHeaderStyle: TcxStyle; + + property ExtStyles: TcxSchedulerStyles read GetExtStyles; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + + function GetSchedulerHeaderParams: TcxViewParams; virtual; + function GetContentParams(const ADateTime: TDateTime; + AResource: TcxSchedulerStorageResourceItem): TcxViewParams; overload; virtual; + function GetContentParams(const ADateTime: TDateTime; ALightColor: Boolean; + AResource: TcxSchedulerStorageResourceItem): TcxViewParams; overload; virtual; + function GetDateNavigatorContentParams: TcxViewParams; virtual; + function GetDateNavigatorHeaderParams: TcxViewParams; virtual; + function GetDayHeaderParams(const ADateTime: TDateTime): TcxViewParams; virtual; + function GetEventParams(AEvent: TcxSchedulerEvent): TcxViewParams; virtual; + function GetNotesAreaBlankParams: TcxViewParams; virtual; + function GetNotesAreaLinedParams: TcxViewParams; virtual; + function GetResourceHeaderParams(AResource: TcxSchedulerStorageResourceItem): TcxViewParams; virtual; + function GetTaskPadParams: TcxViewParams; virtual; + function GetTimeRulerParams: TcxViewParams; virtual; + + property UseSchedulerStyles: Boolean read GetUseSchedulerStyles; + property ReportLink: TcxSchedulerReportLink read GetReportLink; + published + property SchedulerHeader: TcxStyle Index vspsSchedulerSchedulerHeader read GetValue write SetValue; + property Content: TcxStyle Index vspsSchedulerContent read GetValue write SetValue; + property DateNavigatorContent: TcxStyle Index vspsSchedulerDateNavigatorContent read GetValue write SetValue; + property DateNavigatorHeader: TcxStyle Index vspsSchedulerDateNavigatorHeader read GetValue write SetValue; + property DayHeader: TcxStyle Index vspsSchedulerDayHeader read GetValue write SetValue; + property Event: TcxStyle Index vspsSchedulerEvent read GetValue write SetValue; + property ResourceHeader: TcxStyle Index vspsSchedulerResourceHeader read GetValue write SetValue; + property NotesAreaBlank: TcxStyle Index vspsSchedulerNotesAreaBlank read GetValue write SetValue; + property NotesAreaLined: TcxStyle Index vspsSchedulerNotesAreaLined read GetValue write SetValue; + property TaskPad: TcxStyle Index vspsSchedulerTaskPad read GetValue write SetValue; + property TimeRuler: TcxStyle Index vspsSchedulerTimeRuler read GetValue write SetValue; + + property StyleSheet; + end; + + TcxSchedulerReportLinkStyleSheet = class(TdxCustomReportLinkStyleSheet) + private + function GetStylesValue: TcxSchedulerReportLinkStyles; + procedure SetStylesValue(Value: TcxSchedulerReportLinkStyles); + public + class function GetStylesClass: TcxCustomStylesClass; override; + published + property Styles: TcxSchedulerReportLinkStyles read GetStylesValue write SetStylesValue; + end; + + { TcxSchedulerReportLinkRenderInfo } + + TcxSchedulerReportLinkRenderInfo = class(TdxPSReportRenderInfo) + private + function GetReportLink: TcxSchedulerReportLink; + protected + Rendering: Boolean; + FPageColCount: Integer; + FPageRowCount: Integer; + procedure DoCalculate; override; + function GetPageColCount: Integer; override; + function GetPageRowCount: Integer; override; + function IsLoading: Boolean; + public + function IsDrawPageTitleOnPage(APageIndex: Integer): Boolean; override; + function IsDrawReportTitleOnPage(APageIndex: Integer): Boolean; + property ReportLink: TcxSchedulerReportLink read GetReportLink; + end; + + { TcxSchedulerReportRenderer } + + TcxSchedulerReportRenderer = class(TdxPSReportRenderer) + public + procedure PrepareRenderPage; override; + procedure UnprepareRenderPage; override; + end; + + { TcxSchedulerReportLink } + TcxSchedulerReportLinkCanPrintEventEvent = procedure(Sender: TcxSchedulerReportLink; + AEvent: TcxSchedulerEvent; var AllowPrint: Boolean) of object; + + { Initilization Events } + + TcxSchedulerReportLinkInitializeSchedulerHeaderEvent = procedure( + Sender: TcxSchedulerReportLink; AItem: TcxSchedulerReportSchedulerHeaderCell) of object; + TcxSchedulerReportLinkInitializeSchedulingAreaEvent = procedure( + Sender: TcxSchedulerReportLink; AItem: TcxSchedulerReportSchedulingAreaCell) of object; + TcxSchedulerReportLinkInitializeNotesEvent = procedure( + Sender: TcxSchedulerReportLink; AItem: TcxSchedulerReportNotesAreaCell) of object; + TcxSchedulerReportLinkInitializeTaskPadEvent = procedure( + Sender: TcxSchedulerReportLink; AItem: TcxSchedulerReportTaskPadCell) of object; + TcxSchedulerReportLinkInitializeEventCellEvent = procedure( + Sender: TcxSchedulerReportLink; AItem: TcxSchedulerReportCustomEventCell) of object; + + { CustomDraw Events } + + TcxSchedulerReportLinkCustomDrawSchedulerHeaderCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportSchedulerHeaderDataCell; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawDateNavigatorHeaderCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorHeader; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawDateNavigatorDayCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorDay; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawDateNavigatorDayCaptionCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorDayCaption; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawDateNavigatorWeekNumberCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorWeekNumber; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawTimeRulerCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportDailyTimeRulerCell; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawNotesCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportNotesDataCell; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawContentCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportContentCell; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawHeaderCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportHeaderItemCell; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawEventPartCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TAbstractdxReportCellData; + APart: TcxSchedulerReportEventPartType; var ADone: Boolean) of object; + + TcxSchedulerReportLink = class(TdxCustomcxControlReportLink, IdxReportLinkController) + private + FLinkInPreviewMode: Boolean; + FLookAndFeelItems: TList; + FPageSites: TList; + FPrintRange: TcxSchedulerReportLinkPrintRange; + FPrintStyles: TcxSchedulerReportLinkPrintStyles; + FTaskPadReportLink: TBasedxReportLink; + FSupportImages: Boolean; + FOnActivePrintStyleChanged: TNotifyEvent; + FOnCanPrintEvent: TcxSchedulerReportLinkCanPrintEventEvent; + + FOnCustomDrawSchedulerHeaderCell: TcxSchedulerReportLinkCustomDrawSchedulerHeaderCellEvent; + FOnCustomDrawDateNavigatorHeaderCell: TcxSchedulerReportLinkCustomDrawDateNavigatorHeaderCellEvent; + FOnCustomDrawDateNavigatorDayCell: TcxSchedulerReportLinkCustomDrawDateNavigatorDayCellEvent; + FOnCustomDrawDateNavigatorDayCaptionCell: TcxSchedulerReportLinkCustomDrawDateNavigatorDayCaptionCellEvent; + FOnCustomDrawDateNavigatorWeekNumberCell: TcxSchedulerReportLinkCustomDrawDateNavigatorWeekNumberCellEvent; + FOnCustomDrawTimeRulerCell: TcxSchedulerReportLinkCustomDrawTimeRulerCellEvent; + FOnCustomDrawContentCell: TcxSchedulerReportLinkCustomDrawContentCellEvent; + FOnCustomDrawHeaderCell: TcxSchedulerReportLinkCustomDrawHeaderCellEvent; + FOnCustomDrawEventPartCell: TcxSchedulerReportLinkCustomDrawEventPartCellEvent; + FOnCustomDrawNotesCell: TcxSchedulerReportLinkCustomDrawNotesCellEvent; + FOnCustomDrawTaskPadCell: TcxSchedulerReportLinkCustomDrawNotesCellEvent; + + FOnInitializeSchedulingAreaCell: TcxSchedulerReportLinkInitializeSchedulingAreaEvent; + FOnInitializeEventCell: TcxSchedulerReportLinkInitializeEventCellEvent; + FOnInitializeHeaderPrimaryCell: TcxSchedulerReportLinkInitializeSchedulerHeaderEvent; + FOnInitializeHeaderSecondaryCell: TcxSchedulerReportLinkInitializeSchedulerHeaderEvent; + FOnInitializeNotesAreaCell: TcxSchedulerReportLinkInitializeNotesEvent; + FOnInitializeTaskPadCell: TcxSchedulerReportLinkInitializeTaskPadEvent; + function GetActiveStyles: TcxSchedulerReportLinkStyles; + function GetDesignWindow: TcxfmSchedulerReportLinkDesignWindow; + function GetEdgeMode: TdxCellEdgeMode; + function GetLookAndFeelItem(Index: Integer): TdxReportVisualItem; + function GetLookAndFeelItemCount: Integer; + function GetOptionsFormatting: TcxSchedulerReportLinkOptionsFormatting; + function GetPrintStyles: TcxSchedulerReportLinkPrintStyles; + function GetRenderInfo: TcxSchedulerReportLinkRenderInfo; + function GetScheduler: TcxScheduler; + function GetStyles: TcxSchedulerReportLinkStyles; + procedure SetOptionsFormatting(Value: TcxSchedulerReportLinkOptionsFormatting); + procedure SetPrintRange(Value: TcxSchedulerReportLinkPrintRange); + procedure SetPrintStyles(Value: TcxSchedulerReportLinkPrintStyles); + procedure SetStyles(Value: TcxSchedulerReportLinkStyles); + procedure SetTaskPadReportLink(Value: TBasedxReportLink); + + protected + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + { IdxReportLinkController } + function GetControlSiteBounds(AControl: TControl): TRect; virtual; + + procedure ConstructReport(AReportCells: TdxReportCells); override; + procedure DoCreateReport; override; + + procedure CustomDraw(AItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); override; + + procedure DoCanPrintEvent(AEvent: TcxSchedulerEvent; var AllowPrint: Boolean); virtual; + + procedure DoCustomDrawSchedulerHeaderCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportSchedulerHeaderDataCell; var ADone: Boolean); virtual; + procedure DoCustomDrawDateNavigatorHeaderCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportDateNavigatorHeader; var ADone: Boolean); virtual; + procedure DoCustomDrawDateNavigatorDayCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportDateNavigatorDay; var ADone: Boolean); virtual; + procedure DoCustomDrawDateNavigatorDayCaptionCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportDateNavigatorDayCaption; var ADone: Boolean); virtual; + procedure DoCustomDrawDateNavigatorWeekNumberCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportDateNavigatorWeekNumber; var ADone: Boolean); virtual; + procedure DoCustomDrawTimeRulerCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportDailyTimeRulerCell; var ADone: Boolean); virtual; + procedure DoCustomDrawContentCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportContentCell; var ADone: Boolean); virtual; + procedure DoCustomDrawHeaderCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportHeaderItemCell; var ADone: Boolean); virtual; + procedure DoCustomDrawEventPartCell(ACanvas: TCanvas; + AItem: TAbstractdxReportCellData; var ADone: Boolean); virtual; + procedure DoCustomDrawNotesCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportNotesDataCell; var ADone: Boolean); virtual; + procedure DoCustomDrawTaskPadCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportNotesDataCell; var ADone: Boolean); virtual; + + procedure GetImageLists(AProc: TdxPSGetImageListProc); override; + function GetRealScaleFactor: Integer; override; + function GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; override; + function GetRendererClass: TdxPSReportRendererClass; override; + function GetRenderInfoClass: TdxPSReportRenderInfoClass; override; + procedure InternalRestoreDefaults; override; + procedure PrepareConstruct; override; + procedure UnprepareConstruct; override; + + procedure CreateOptions; override; + procedure DestroyOptions; override; + function GetOptionsFormattingClass: TdxCustomReportLinkOptionsFormattingClass; override; + + function CreatePrintRange: TcxSchedulerReportLinkPrintRange; virtual; + function CreatePrintStyles: TcxSchedulerReportLinkPrintStyles; virtual; + function HasEventImages: Boolean; + function HasResourceImages: Boolean; + + function GetAreNativeStylesAvailable: Boolean; override; + function GetStylesClass: TdxCustomReportLinkStylesClass; override; + function GetStyleSheetClass: TdxCustomReportLinkStyleSheetClass; override; + function GetStyleSheetPrototype: TdxCustomReportLinkStyleSheet; override; + + procedure ActivePrintStyleChanged; virtual; + procedure DoActivePrintStyleChanged; virtual; + + procedure FormatLookAndFeelItems; + procedure RegisterLookAndFeelItem(AItem: TdxReportVisualItem; AEdgeStyle: TdxCellEdgeStyle); + + procedure DoInitializeSchedulingAreaCell(AItem: TcxSchedulerReportSchedulingAreaCell); virtual; + procedure DoInitializeEventCell(AItem: TcxSchedulerReportCustomEventCell); virtual; + procedure DoInitializeHeaderPrimaryCell(AItem: TcxSchedulerReportSchedulerHeaderCell); virtual; + procedure DoInitializeHeaderSecondaryCell(AItem: TcxSchedulerReportSchedulerHeaderCell); virtual; + procedure DoInitializeNotesAreaCell(AItem: TcxSchedulerReportNotesAreaCell); virtual; + procedure DoInitializeTaskPadCell(AItem: TcxSchedulerReportTaskPadCell); virtual; + + procedure AssignTaskPadData(ATaskPad: TcxSchedulerReportTaskPadCell); + procedure InitializeTaskPadCell(ATaskPad: TcxSchedulerReportTaskPadCell); virtual; + + procedure SetCellViewParams(ACell: TdxReportVisualItem; const AParams: TcxViewParams); overload; + procedure SetCellViewParams(ACell: TdxReportVisualItem; const AParams: TdxReportItemViewParams); overload; + + function AddPageSite(const ABounds: TRect): TcxSchedulerReportPageSite; + procedure BuildStyle; virtual; + + property ActiveStyles: TcxSchedulerReportLinkStyles read GetActiveStyles; + + property EdgeMode: TdxCellEdgeMode read GetEdgeMode; + property LinkInPreviewMode: Boolean read FLinkInPreviewMode write FLinkInPreviewMode; + property LookAndFeelItemCount: Integer read GetLookAndFeelItemCount; + property LookAndFeelItems[Index: Integer]: TdxReportVisualItem read GetLookAndFeelItem; + property PageSites: TList read FPageSites; + property RenderInfo: TcxSchedulerReportLinkRenderInfo read GetRenderInfo; + property SupportImages: Boolean read FSupportImages; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + class function Aggregable: Boolean; override; + procedure LoadDataFromStream(AStream: TStream); override; + procedure RebuildReport; override; + + property DesignWindow: TcxfmSchedulerReportLinkDesignWindow read GetDesignWindow; + property Scheduler: TcxScheduler read GetScheduler; + + published + property Color; + property Font; + + property OptionsFormatting: TcxSchedulerReportLinkOptionsFormatting read GetOptionsFormatting write SetOptionsFormatting; + property PrintRange: TcxSchedulerReportLinkPrintRange read FPrintRange write SetPrintRange; + property PrintStyles: TcxSchedulerReportLinkPrintStyles read GetPrintStyles write SetPrintStyles; + property ScaleFonts; + property StyleRepository; + property Styles: TcxSchedulerReportLinkStyles read GetStyles write SetStyles; + property SupportedCustomDraw; + property TaskPadReportLink: TBasedxReportLink read FTaskPadReportLink write SetTaskPadReportLink; + + property OnActivePrintStyleChanged: TNotifyEvent read FOnActivePrintStyleChanged write FOnActivePrintStyleChanged; + property OnCanPrintEvent: TcxSchedulerReportLinkCanPrintEventEvent read FOnCanPrintEvent write FOnCanPrintEvent; + + property OnCustomDrawSchedulerHeaderCell: TcxSchedulerReportLinkCustomDrawSchedulerHeaderCellEvent + read FOnCustomDrawSchedulerHeaderCell write FOnCustomDrawSchedulerHeaderCell; + property OnCustomDrawDateNavigatorHeaderCell: TcxSchedulerReportLinkCustomDrawDateNavigatorHeaderCellEvent + read FOnCustomDrawDateNavigatorHeaderCell write FOnCustomDrawDateNavigatorHeaderCell; + property OnCustomDrawDateNavigatorDayCell: TcxSchedulerReportLinkCustomDrawDateNavigatorDayCellEvent + read FOnCustomDrawDateNavigatorDayCell write FOnCustomDrawDateNavigatorDayCell; + property OnCustomDrawDateNavigatorDayCaptionCell: TcxSchedulerReportLinkCustomDrawDateNavigatorDayCaptionCellEvent + read FOnCustomDrawDateNavigatorDayCaptionCell write FOnCustomDrawDateNavigatorDayCaptionCell; + property OnCustomDrawDateNavigatorWeekNumberCell: TcxSchedulerReportLinkCustomDrawDateNavigatorWeekNumberCellEvent + read FOnCustomDrawDateNavigatorWeekNumberCell write FOnCustomDrawDateNavigatorWeekNumberCell; + property OnCustomDrawTimeRulerCell: TcxSchedulerReportLinkCustomDrawTimeRulerCellEvent + read FOnCustomDrawTimeRulerCell write FOnCustomDrawTimeRulerCell; + property OnCustomDrawContentCell: TcxSchedulerReportLinkCustomDrawContentCellEvent + read FOnCustomDrawContentCell write FOnCustomDrawContentCell; + property OnCustomDrawHeaderCell: TcxSchedulerReportLinkCustomDrawHeaderCellEvent + read FOnCustomDrawHeaderCell write FOnCustomDrawHeaderCell; + property OnCustomDrawEventPartCell: TcxSchedulerReportLinkCustomDrawEventPartCellEvent + read FOnCustomDrawEventPartCell write FOnCustomDrawEventPartCell; + property OnCustomDrawNotesCell: TcxSchedulerReportLinkCustomDrawNotesCellEvent + read FOnCustomDrawNotesCell write FOnCustomDrawNotesCell; + property OnCustomDrawTaskPadCell: TcxSchedulerReportLinkCustomDrawNotesCellEvent + read FOnCustomDrawTaskPadCell write FOnCustomDrawTaskPadCell; + + property OnInitializeSchedulingAreaCell: TcxSchedulerReportLinkInitializeSchedulingAreaEvent + read FOnInitializeSchedulingAreaCell write FOnInitializeSchedulingAreaCell; + property OnInitializeEventCell: TcxSchedulerReportLinkInitializeEventCellEvent + read FOnInitializeEventCell write FOnInitializeEventCell; + property OnInitializeHeaderPrimaryCell: TcxSchedulerReportLinkInitializeSchedulerHeaderEvent + read FOnInitializeHeaderPrimaryCell write FOnInitializeHeaderPrimaryCell; + property OnInitializeHeaderSecondaryCell: TcxSchedulerReportLinkInitializeSchedulerHeaderEvent + read FOnInitializeHeaderSecondaryCell write FOnInitializeHeaderSecondaryCell; + property OnInitializeNotesAreaCell: TcxSchedulerReportLinkInitializeNotesEvent + read FOnInitializeNotesAreaCell write FOnInitializeNotesAreaCell; + property OnInitializeTaskPadCell: TcxSchedulerReportLinkInitializeTaskPadEvent + read FOnInitializeTaskPadCell write FOnInitializeTaskPadCell; + end; + + { TcxCustomSchedulerReportLinkPrintStyle } + + TcxSchedulerReportLinkPeriodicPrintStyleLayout = (pslOnePage, pslTwoPages); + + TcxCustomSchedulerReportLinkPrintStyle = class(TPersistent, + IUnknown, IdxPSCellParams, IdxPSCellParams2) + private + FBoldedDays: TcxSchedulerDateList; + FCaption: string; + FCompressWeekends: Boolean; + FDontPrintWeekends: Boolean; + FEvents: TcxSchedulerCachedEventList; + FLayout: TcxSchedulerReportLinkPeriodicPrintStyleLayout; + FPagesPerPeriod: Integer; + FResourceCountPerPage: Integer; + FShowNotesAreaBlank: Boolean; + FShowNotesAreaLined: Boolean; + FShowTaskPad: Boolean; + FStyles: TcxSchedulerReportLinkPrintStyles; + FUsedDays: TcxSchedulerDateList; + FShowEventImages: Boolean; + FShowResourceImages: Boolean; + function GetActive: Boolean; + function GetHasAdditionalArea: Boolean; + function GetIndex: Integer; + function GetPageSite(AIndex: Integer): TcxSchedulerReportPageSite; + function GetPeriodCount: Integer; + function GetPrintRange: TcxSchedulerReportLinkPrintRange; + function GetReportLink: TcxSchedulerReportLink; + function GetResourceCount: Integer; + function GetScheduler: TcxScheduler; + function GetStorage: TcxCustomSchedulerStorage; + function GetTimePrintFrom: TTime; + function GetTimePrintTo: TTime; + function GetVisualStyles: TcxSchedulerReportLinkStyles; + function IsCaptionStored: Boolean; + function IsLayoutStored: Boolean; + function IsShowNotesAreaBlankStored: Boolean; + function IsActiveStored: Boolean; + procedure SetActive(Value: Boolean); + procedure SetCaption(const Value: string); + procedure SetCompressWeekends(Value: Boolean); + procedure SetDontPrintWeekends(Value: Boolean); + procedure SetLayout(Value: TcxSchedulerReportLinkPeriodicPrintStyleLayout); + procedure SetResourceCountPerPage(Value: Integer); + procedure SetShowEventImages(Value: Boolean); + procedure SetShowNotesAreaBlank(Value: Boolean); + procedure SetShowNotesAreaLined(Value: Boolean); + procedure SetShowResourceImages(Value: Boolean); + procedure SetShowTaskPad(Value: Boolean); + procedure SetTimePrintFrom(Value: TTime); + procedure SetTimePrintTo(Value: TTime); + protected + CurrentDate: TDateTime; + { IUnknown } + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + { IdxReportLinkController } + function GetControlSiteBounds(AControl: TControl): TRect; virtual; + { IdxPSCellParams } + function IdxPSCellParams.GetAutoHeight = IdxPSCellParams_GetAutoHeight; + function IdxPSCellParams.GetDC = IdxPSCellParams_GetDC; + function IdxPSCellParams.GetDisplayGraphicsAsText = IdxPSCellParams_GetDisplayGraphicsAsText; + function IdxPSCellParams.GetEndEllipsis = IdxPSCellParams_GetEndEllipsis; + function IdxPSCellParams.GetFlatCheckMarks = IdxPSCellParams_GetFlatCheckMarks; + function IdxPSCellParams.GetGraphicsText = IdxPSCellParams_GetGraphicsText; + function IdxPSCellParams.GetMultiline = IdxPSCellParams_GetMultiline; + function IdxPSCellParams.GetTransparentGraphics = IdxPSCellParams_GetTransparentGraphics; + function IdxPSCellParams_GetAutoHeight: Boolean; virtual; + function IdxPSCellParams_GetDC: HDC; virtual; + function IdxPSCellParams_GetDisplayGraphicsAsText: Boolean; virtual; + function IdxPSCellParams_GetEndEllipsis: Boolean; virtual; + function IdxPSCellParams_GetFlatCheckMarks: Boolean; virtual; + function IdxPSCellParams_GetGraphicsText: string; virtual; + function IdxPSCellParams_GetMultiline: Boolean; virtual; + function IdxPSCellParams_GetTransparentGraphics: Boolean; virtual; + { IdxPSCellParams2 } + function IdxPSCellParams2.GetPreviewMarginLeft = IdxPSCellParams2_GetPreviewMarginLeft; + function IdxPSCellParams2.GetPreviewMarginRight = IdxPSCellParams2_GetPreviewMarginRight; + function IdxPSCellParams2.GetPreviewMaxHeight = IdxPSCellParams2_GetPreviewMaxHeight; + function IdxPSCellParams2.GetPreviewMaxLineCount = IdxPSCellParams2_GetPreviewMaxLineCount; + function IdxPSCellParams2.GetRichEditGraphicClass = IdxPSCellParams2_GetRichEditGraphicClass; + function IdxPSCellParams2.GetRichEditTransparent = IdxPSCellParams2_GetRichEditTransparent; + function IdxPSCellParams2_GetPreviewMarginLeft: Integer; virtual; + function IdxPSCellParams2_GetPreviewMarginRight: Integer; virtual; + function IdxPSCellParams2_GetPreviewMaxHeight: Integer; virtual; + function IdxPSCellParams2_GetPreviewMaxLineCount: Integer; virtual; + function IdxPSCellParams2_GetRichEditGraphicClass: TGraphicClass; virtual; + function IdxPSCellParams2_GetRichEditTransparent: Boolean; virtual; + + // + function AddPageSite(const ABounds: TRect): TcxSchedulerReportPageSite; virtual; + + procedure AfterBuild; virtual; + procedure BeforeBuild; virtual; + procedure Build; virtual; + procedure BuildPages; virtual; + procedure BuildSchedulerCells(ASite: TcxSchedulerReportSchedulingAreaCell); virtual; + procedure Progress(APercentDone: Double); virtual; + + procedure PrepareEvents; virtual; + procedure DoCanPrintEvent(AEvent: TcxSchedulerEvent; var AllowPrint: Boolean); virtual; + + procedure Changed; virtual; + procedure CreateObjects; virtual; + procedure DestroyObjects; virtual; + function GetPageCount: Integer; virtual; + + function GetRebuildOnPageParamsChange(AnUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; virtual; + + function GetActualDatePrintFrom: TDate; virtual; + function GetActualDatePrintTo: TDate; virtual; + function GetCorrespondedView: TcxSchedulerCustomResourceView; virtual; + function GetPagesPerPeriod: Integer; virtual; + + function GetGlyphIndex: Integer; virtual; + function GetPreviewGlyphIndex: Integer; virtual; + function GetSchedulerHeaderParams: TdxReportItemViewParams; virtual; + + procedure DrawDesignWindowPreview(ACanvas: TCanvas; const ABounds: TRect); + // actually option state + function GetResourcePageCount: Integer; virtual; + function GetShowDateNavigator(APageIndex: Integer): Boolean; virtual; + function GetShowNotesAreaBlank: Boolean; virtual; + + procedure SetBoolOption(var AOption: Boolean; Value: Boolean); + function SupportTimeRange: Boolean; virtual; + function SupportMessage: Boolean; virtual; + + // report cells creation + function CreateDateNavigatorCell(ASite: TdxReportCell; AYear, AMonth: Word): TcxSchedulerReportDateNavigatorCell; virtual; + function CreateHeaderCell(ASite: TdxReportCell): TcxSchedulerReportSchedulerHeaderCell; virtual; + function CreateNotesCell(ASite: TdxReportCell): TcxSchedulerReportNotesAreaCell; virtual; + function CreateNotesLinedCell(ASite: TdxReportCell): TcxSchedulerReportNotesAreaCell; virtual; + function CreateSchedulingAreaCell(ASite: TdxReportCell): TcxSchedulerReportSchedulingAreaCell; virtual; + function CreateSchedulingCellsProducer(ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; virtual; + function CreateTaskPadCell(ASite: TdxReportCell): TcxSchedulerReportTaskPadCell; virtual; + + procedure InitHeaderCell(ACell: TcxSchedulerReportSchedulerHeaderCell); virtual; + function InitReportCell(ACell: TdxReportCell; const ABounds: TRect): TdxReportCell; + + procedure CorrectBoundsWithHeader(AHeader: TcxSchedulerReportSchedulerHeaderCell; var ABounds: TRect); + procedure CreateAdditionalControls(ASite: TdxReportCell; AHasCalendar, + AHasTaskPad, AHasNotes, AHasNotesLined, ARightSide: Boolean; var ABounds: TRect); virtual; + + procedure CreateControlsOnFirstPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); virtual; + procedure CreateControlsOnSecondPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); virtual; + procedure CreateHeaderDateNavigator(AHeader: TcxSchedulerReportSchedulerHeaderCell; APageIndex: Integer; out ABounds: TRect); virtual; + procedure CreateLayoutForPeriod(APeriodIndex: Integer); virtual; + procedure CreatePageSiteWithHeader(APageIndex: Integer; + out ASite: TcxSchedulerReportPageSite; out AHeader: TcxSchedulerReportSchedulerHeaderCell; + out ABounds: TRect; AIsPrimary: Boolean = True); + // items visibility + function CanSplitSchedulingOnTwoPages: Boolean; virtual; + function GetHasPageHeader(APageIndex: Integer): Boolean; virtual; + function GetHasPageReportTitle(APageIndex: Integer): Boolean; virtual; + function GetPageHeaderHeight(const ASiteBounds: TRect; APageIndex: Integer): Integer; + function GetPageIndex(APeriodIndex, AIndex: Integer): Integer; + procedure GetPagePeriodAndIndex(APageIndex: Integer; var APeriodIndex, ASubIndex: Integer); + function GetPageSiteBounds(APageIndex: Integer): TRect; virtual; + function GetStartOfWeekOffset: Integer; virtual; + // extracting events and dates for period + procedure GetPageDateNavigatorInfo( + APageIndex: Integer; out AYear, AMonth: Word); virtual; + function GetDaysPerPeriod: Integer; virtual; + procedure FillDatesForPage(ADateList: TcxSchedulerDateList; + APageIndex, APeriodIndex, ASubIndex: Integer); virtual; + + property CompressWeekends: Boolean read FCompressWeekends write SetCompressWeekends default True; + property DontPrintWeekends: Boolean read FDontPrintWeekends write SetDontPrintWeekends default False; + property Events: TcxSchedulerCachedEventList read FEvents; + property GlyphIndex: Integer read GetGlyphIndex; + property Layout: TcxSchedulerReportLinkPeriodicPrintStyleLayout read FLayout write SetLayout stored IsLayoutStored; + property PagesPerPeriod: Integer read FPagesPerPeriod; + property PageSites[Index: Integer]: TcxSchedulerReportPageSite read GetPageSite; + property PreviewGlyphIndex: Integer read GetPreviewGlyphIndex; + property PrintRange: TcxSchedulerReportLinkPrintRange read GetPrintRange; + property ResourceCount: Integer read GetResourceCount; + property ResourceCountPerPage: Integer read FResourceCountPerPage write SetResourceCountPerPage default 0; + property ShowEventImages: Boolean read FShowEventImages write SetShowEventImages; + property ShowNotesAreaBlank: Boolean read GetShowNotesAreaBlank write SetShowNotesAreaBlank stored IsShowNotesAreaBlankStored; + property ShowNotesAreaLined: Boolean read FShowNotesAreaLined write SetShowNotesAreaLined default False; + property ShowResourceImages: Boolean read FShowResourceImages write SetShowResourceImages; + property ShowTaskPad: Boolean read FShowTaskPad write SetShowTaskPad default False; + property StartOfWeekOffset: Integer read GetStartOfWeekOffset; + property Storage: TcxCustomSchedulerStorage read GetStorage; + property TimePrintFrom: TTime read GetTimePrintFrom write SetTimePrintFrom stored False; + property TimePrintTo: TTime read GetTimePrintTo write SetTimePrintTo stored False; + property UsedDays: TcxSchedulerDateList read FUsedDays; + public + constructor Create(AStyles: TcxSchedulerReportLinkPrintStyles); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + function DefaultCaption: string; virtual; + function IsCompatibleWith(AView: TcxSchedulerCustomView): Boolean; virtual; + procedure RestoreDefaults; virtual; + + property ActualDatePrintFrom: TDate read GetActualDatePrintFrom; + property ActualDatePrintTo: TDate read GetActualDatePrintTo; + property CorrespondedView: TcxSchedulerCustomResourceView read GetCorrespondedView; + property HasAdditionalArea: Boolean read GetHasAdditionalArea; + property Index: Integer read GetIndex; + property PageCount: Integer read GetPageCount; + property PeriodCount: Integer read GetPeriodCount; + property ReportLink: TcxSchedulerReportLink read GetReportLink; + property Scheduler: TcxScheduler read GetScheduler; + property Styles: TcxSchedulerReportLinkPrintStyles read FStyles; + property VisualStyles: TcxSchedulerReportLinkStyles read GetVisualStyles; + published + property Active: Boolean read GetActive write SetActive stored IsActiveStored; + property Caption: string read FCaption write SetCaption stored IsCaptionStored; + end; + + { TcxSchedulerReportLinkDailyPrintStyle } + + TcxSchedulerReportLinkDailyPrintStyle = class(TcxCustomSchedulerReportLinkPrintStyle) + private + FCurrentPagePerDate: Integer; + protected + procedure BeforeBuild; override; + function CanSplitSchedulingOnTwoPages: Boolean; override; + procedure CreateControlsOnFirstPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + procedure CreateControlsOnSecondPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + function CreateSchedulingCellsProducer(ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; override; + procedure FillDatesForPage(ADateList: TcxSchedulerDateList; + APageIndex, APeriodIndex, ASubIndex: Integer); override; + function GetCorrespondedView: TcxSchedulerCustomResourceView; override; + function GetGlyphIndex: Integer; override; + function GetPageCount: Integer; override; + function GetPagesPerPeriod: Integer; override; + function GetShowNotesAreaBlank: Boolean; override; + procedure InitHeaderCell(ACell: TcxSchedulerReportSchedulerHeaderCell); override; + function SupportMessage: Boolean; override; + function SupportTimeRange: Boolean; override; + public + constructor Create(AStyles: TcxSchedulerReportLinkPrintStyles); override; + function DefaultCaption: string; override; + function IsCompatibleWith(AView: TcxSchedulerCustomView): Boolean; override; + published + property Active; + property Caption; + property Layout; + property ResourceCountPerPage; + property ShowEventImages default True; + property ShowNotesAreaBlank; + property ShowNotesAreaLined; + property ShowResourceImages default True; + property ShowTaskPad; + end; + + { TcxSchedulerReportLinkCustomDetailsPrintStyle } + + TcxSchedulerReportLinkCustomDetailsPrintStyle = class(TcxCustomSchedulerReportLinkPrintStyle) + private + FTimeWidth: Integer; + function GetPageWidth: Integer; + protected + BuildedPageCount: Integer; + CellsOnPage: Integer; + CurrentPage: TcxSchedulerReportPageSite; + function AddPageSite(const ABounds: TRect): TcxSchedulerReportPageSite; override; + procedure BeforeBuild; override; + function GetNextPage(APrevPage: TcxSchedulerReportPageSite; out ABounds: TRect): TcxSchedulerReportPageSite; + function GetPageCount: Integer; override; + function MeasureTimeWidth: Integer; virtual; + + property PageWidth: Integer read GetPageWidth; + property TimeWidth: Integer read FTimeWidth; + end; + + { TcxSchedulerReportLinkDetailsPrintStyle } + + TcxSchedulerReportLinkDetailsPrintStylePaginationMode = (dpmByDay, dpmByWeek, dpmByMonth); + + TcxSchedulerReportLinkDetailsPrintStyle = class(TcxSchedulerReportLinkCustomDetailsPrintStyle) + private + FPaginationMode: TcxSchedulerReportLinkDetailsPrintStylePaginationMode; + FUsePagination: Boolean; + procedure SetPaginationMode(Value: TcxSchedulerReportLinkDetailsPrintStylePaginationMode); + procedure SetUsePagination(Value: Boolean); + protected + EventIndex, DayIndex: Integer; + CurrentCell: TcxSchedulerReportDetailsEventCell; + CurrentPageBounds: TRect; + PreviousHeader: TcxSchedulerReportSchedulerHeaderCell; + Site: TcxSchedulerReportPageSite; + function AddDayHeader(ADate: TDateTime; AContinue: Boolean; + var ABounds: TRect): TcxSchedulerReportSchedulerHeaderCell; + procedure BeforeBuild; override; + procedure BuildPages; override; + function GetDayHeaderHeight: Integer; virtual; + function GetDayHeaderText(AContinue: Boolean): string; virtual; + function GetGlyphIndex: Integer; override; + function GetPreviewGlyphIndex: Integer; override; + function GetSchedulerHeaderParams: TdxReportItemViewParams; override; + + // layout calculation + function AddEventCell(AEvent: TcxSchedulerEvent): TcxSchedulerReportDetailsEventCell; virtual; + procedure CheckPagination; + procedure HeaderNeeded; virtual; + function NeedAddDayHeader: Boolean; + function MeasureCellBounds: TRect; virtual; + procedure PrepareNextPage; + procedure SetCellPlace; + + property DayHeaderHeight: Integer read GetDayHeaderHeight; + public + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; override; + procedure RestoreDefaults; override; + published + property Active; + property Caption; + property PaginationMode: TcxSchedulerReportLinkDetailsPrintStylePaginationMode read FPaginationMode write SetPaginationMode default dpmByDay; + property UsePagination: Boolean read FUsePagination write SetUsePagination default False; + end; + + { TcxSchedulerReportLinkMemoPrintStyle } + + TcxSchedulerReportLinkMemoPrintStyle = class(TcxSchedulerReportLinkCustomDetailsPrintStyle) + private + FSelectedEventsOnly: Boolean; + FStartEachItemOnNewPage: Boolean; + protected + Site: TdxReportCell; + function AddEventCell(AEvent: TcxSchedulerEvent): TcxSchedulerReportDetailsEventCell; virtual; + procedure BuildPages; override; + procedure DoCanPrintEvent(AEvent: TcxSchedulerEvent; var AllowPrint: Boolean); override; + function GetGlyphIndex: Integer; override; + function GetPreviewGlyphIndex: Integer; override; + function MeasureTimeWidth: Integer; override; + public + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; override; + procedure RestoreDefaults; override; + published + property Active; + property Caption; + property SelectedEventsOnly: Boolean read FSelectedEventsOnly write FSelectedEventsOnly default True; + property StartEachItemOnNewPage: Boolean read FStartEachItemOnNewPage write FStartEachItemOnNewPage default True; + end; + + { TcxSchedulerReportLinkMonthlyPrintStyle } + + TcxSchedulerReportLinkMonthlyPrintStyle = class(TcxCustomSchedulerReportLinkPrintStyle) + private + FPrintExactlyOneMonthPerPage: Boolean; + procedure SetPrintExactlyOneMonthPerPage(Value: Boolean); + protected + procedure CreateControlsOnFirstPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + procedure CreateControlsOnSecondPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + procedure FillDatesForPage(ADateList: TcxSchedulerDateList; + APageIndex, APeriodIndex, ASubIndex: Integer); override; + function GetCorrespondedView: TcxSchedulerCustomResourceView; override; + function GetDateForPage(APageIndex: Integer): TDateTime; + function GetDaysPerPeriod: Integer; override; + function GetGlyphIndex: Integer; override; + function GetPageCount: Integer; override; + procedure InitHeaderCell(ACell: TcxSchedulerReportSchedulerHeaderCell); override; + public + constructor Create(AStyles: TcxSchedulerReportLinkPrintStyles); override; + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; override; + function IsCompatibleWith(AView: TcxSchedulerCustomView): Boolean; override; + procedure RestoreDefaults; override; + published + property Active; + property Caption; + property DontPrintWeekends; + property Layout; + property PrintExactlyOneMonthPerPage: Boolean read FPrintExactlyOneMonthPerPage write SetPrintExactlyOneMonthPerPage default False; + property ResourceCountPerPage; + property ShowEventImages default False; + property ShowNotesAreaBlank; + property ShowNotesAreaLined; + property ShowResourceImages default True; + property ShowTaskPad; + end; + + { TcxSchedulerReportLinkTrifoldPrintStyle } + + TcxSchedulerReportLinkTrifoldPrintStyleSectionMode = (smDailyCalendar, smWeeklyCalendar, + smMonthlyCalendar, smTaskPad, smNotesAreaBlank, smNotesAreaLined); + + TcxSchedulerReportLinkTrifoldPrintStyle = class(TcxCustomSchedulerReportLinkPrintStyle) + private + FSections: array[0..2] of TcxSchedulerReportLinkTrifoldPrintStyleSectionMode; + function GetHasDailySection: Boolean; + function GetSection(Index: Integer): TcxSchedulerReportLinkTrifoldPrintStyleSectionMode; + procedure SetSection(Index: Integer; AValue: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode); + function IsSectionStored(Index: Integer): Boolean; + protected + FCurrentSection: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode; + FCurrentSchedulingArea: TcxSchedulerReportSchedulingAreaCell; + FPageRange: Byte; + procedure CreateLayoutForPeriod(APeriodIndex: Integer); override; + procedure CreateLayoutForSection(ASite: TdxReportCell; APeriodIndex: Integer; const ABounds: TRect; + ASection: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode); virtual; + procedure CreateSchedulingAreaWithHeader(ASite: TdxReportCell; ABounds: TRect); virtual; + function CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; override; + procedure FillDatesForPage(ADateList: TcxSchedulerDateList; + APageIndex, APeriodIndex, ASubIndex: Integer); override; + function GetCorrespondedView: TcxSchedulerCustomResourceView; override; + function GetGlyphIndex: Integer; override; + function GetPageCount: Integer; override; + procedure InitHeaderCell(ACell: TcxSchedulerReportSchedulerHeaderCell); override; + + property HasDailySection: Boolean read GetHasDailySection; + public + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; override; + procedure RestoreDefaults; override; + published + property Active; + property Caption; + property LeftSection: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode index 0 read GetSection write SetSection stored IsSectionStored; + property MiddleSection: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode index 1 read GetSection write SetSection stored IsSectionStored; + property RightSection: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode index 2 read GetSection write SetSection stored IsSectionStored; + end; + + { TcxSchedulerReportLinkWeeklyPrintStyle } + + TcxSchedulerReportLinkWeeklyPrintStyleArrange = (wsaTopToBottom, wsaLeftToRight); + + TcxSchedulerReportLinkWeeklyPrintStyle = class(TcxCustomSchedulerReportLinkPrintStyle) + private + FArrange: TcxSchedulerReportLinkWeeklyPrintStyleArrange; + FDaysLayout: TcxSchedulerWeekViewDaysLayout; + FDaysLayoutAssigned: Boolean; + + function GetDaysLayout: TcxSchedulerWeekViewDaysLayout; + + function IsArrangeStored: Boolean; + function IsDaysLayoutStored: Boolean; + + procedure SetArrange(Value: TcxSchedulerReportLinkWeeklyPrintStyleArrange); + procedure SetDaysLayout(Value: TcxSchedulerWeekViewDaysLayout); + protected + procedure Build; override; + procedure CreateControlsOnFirstPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + procedure CreateControlsOnSecondPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + function CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; override; + procedure FillDatesForPage(ADateList: TcxSchedulerDateList; + APageIndex, APeriodIndex, ASubIndex: Integer); override; + function GetCorrespondedView: TcxSchedulerCustomResourceView; override; + function GetGlyphIndex: Integer; override; + function GetDateForPage(APageIndex: Integer): TDateTime; + function GetDaysPerPeriod: Integer; override; + function GetPageCount: Integer; override; + function GetPreviewGlyphIndex: Integer; override; + function GetStartOfWeekOffset: Integer; override; + procedure InitHeaderCell(ACell: TcxSchedulerReportSchedulerHeaderCell); override; + function CanDontPrintWeekends: Boolean; virtual; + function SupportMessage: Boolean; override; + function SupportTimeRange: Boolean; override; + public + constructor Create(AStyles: TcxSchedulerReportLinkPrintStyles); override; + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; override; + function IsCompatibleWith(AView: TcxSchedulerCustomView): Boolean; override; + procedure RestoreDefaults; override; + + property DaysLayoutAssigned: Boolean read FDaysLayoutAssigned write FDaysLayoutAssigned; + published + property Active; + property Arrange: TcxSchedulerReportLinkWeeklyPrintStyleArrange read FArrange write SetArrange stored IsArrangeStored; + property Caption; + property DaysLayout: TcxSchedulerWeekViewDaysLayout read GetDaysLayout write SetDaysLayout stored IsDaysLayoutStored; + property DontPrintWeekends; + property Layout; + property ResourceCountPerPage; + property ShowEventImages default False; + property ShowNotesAreaBlank; + property ShowNotesAreaLined; + property ShowResourceImages default True; + property ShowTaskPad; + end; + + { TcxSchedulerReportLinkYearlyPrintStyle } + + TcxSchedulerReportLinkYearlyPrintStyle = class(TcxCustomSchedulerReportLinkPrintStyle) + private + FMonthCountPerPage: Integer; + FPrimaryPageHeadersOnly: Boolean; + function GetPeriodPageCount: Integer; + procedure SetMonthCountPerPage(AValue: Integer); + procedure SetPrimaryPageHeadersOnly(AValue: Boolean); + protected + procedure BuildSchedulerCells(ASite: TcxSchedulerReportSchedulingAreaCell); override; + procedure CreateControlsOnFirstPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + procedure CreateControlsOnSecondPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + function CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; override; + procedure FillDatesForPage(ADateList: TcxSchedulerDateList; + APageIndex, APeriodIndex, ASubIndex: Integer); override; + function GetCorrespondedView: TcxSchedulerCustomResourceView; override; + function GetHasPageHeader(APageIndex: Integer): Boolean; override; + function GetGlyphIndex: Integer; override; + function GetPreviewGlyphIndex: Integer; override; + function GetPageCount: Integer; override; + function GetShowDateNavigator(APageIndex: Integer): Boolean; override; + procedure InitHeaderCell(ACell: TcxSchedulerReportSchedulerHeaderCell); override; + + property PeriodPageCount: Integer read GetPeriodPageCount; + public + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; override; + function IsCompatibleWith(AView: TcxSchedulerCustomView): Boolean; override; + procedure RestoreDefaults; override; + published + property Active; + property Caption; + property Layout; + property MonthCountPerPage: Integer read FMonthCountPerPage write SetMonthCountPerPage default 12; + property PrimaryPageHeadersOnly: Boolean read FPrimaryPageHeadersOnly write SetPrimaryPageHeadersOnly default False; + property ShowEventImages default False; + property ShowNotesAreaBlank; + property ShowNotesAreaLined; + property ShowTaskPad; + end; + + { TcxSchedulerReportLinkPrintStyles } + + TcxSchedulerReportLinkPrintStyles = class(TcxCustomSchedulerReportLinkOptions) + private + FActiveStyle: TcxCustomSchedulerReportLinkPrintStyle; + FActiveStyleAssigned: Boolean; + FItems: TList; + function GetCount: Integer; + function GetItem(Index: Integer): TcxCustomSchedulerReportLinkPrintStyle; + function GetStyleDaily: TcxSchedulerReportLinkDailyPrintStyle; + function GetStyleDetails: TcxSchedulerReportLinkDetailsPrintStyle; + function GetStyleMemo: TcxSchedulerReportLinkMemoPrintStyle; + function GetStyleMonthly: TcxSchedulerReportLinkMonthlyPrintStyle; + function GetStyleTrifold: TcxSchedulerReportLinkTrifoldPrintStyle; + function GetStyleWeekly: TcxSchedulerReportLinkWeeklyPrintStyle; + function GetStyleYearly: TcxSchedulerReportLinkYearlyPrintStyle; + procedure SetActiveStyle(Value: TcxCustomSchedulerReportLinkPrintStyle); + procedure SetActiveStyleAssigned(Value: Boolean); + procedure SetItem(Index: Integer; Value: TcxCustomSchedulerReportLinkPrintStyle); + procedure SetStyleDaily(Value: TcxSchedulerReportLinkDailyPrintStyle); + procedure SetStyleDetails(Value: TcxSchedulerReportLinkDetailsPrintStyle); + procedure SetStyleMemo(Value: TcxSchedulerReportLinkMemoPrintStyle); + procedure SetStyleMonthly(Value: TcxSchedulerReportLinkMonthlyPrintStyle); + procedure SetStyleTrifold(Value: TcxSchedulerReportLinkTrifoldPrintStyle); + procedure SetStyleWeekly(Value: TcxSchedulerReportLinkWeeklyPrintStyle); + procedure SetStyleYearly(Value: TcxSchedulerReportLinkYearlyPrintStyle); + protected + procedure CreateObjects; override; + procedure DestroyObjects; override; + + { IdxReportLinkOptionsDesignerSupport } + + function DesignerTabIndex: Integer; override; + + function CreateStyle(AStyleClass: TcxCustomSchedulerReportLinkPrintStyleClass): TcxCustomSchedulerReportLinkPrintStyle; virtual; + procedure CreateStyles; virtual; + procedure DestroyStyles; virtual; + procedure GetStyleByClassEx(AClass: TcxCustomSchedulerReportLinkPrintStyleClass; var AInstance); + procedure SetActiveStyleEx(Value: TcxCustomSchedulerReportLinkPrintStyle); + + procedure ActiveStyleChanged; virtual; + procedure StyleChanged(AStyle: TcxCustomSchedulerReportLinkPrintStyle); virtual; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + + function GetCorrespondingStyle: TcxCustomSchedulerReportLinkPrintStyle; virtual; + function GetStyleByClass(AClass: TcxCustomSchedulerReportLinkPrintStyleClass): TcxCustomSchedulerReportLinkPrintStyle; + function GetStyleByName(const Name: string): TcxCustomSchedulerReportLinkPrintStyle; + function GetStyleByView(View: TcxSchedulerCustomView): TcxCustomSchedulerReportLinkPrintStyle; + + function IndexOf(AItem: TcxCustomSchedulerReportLinkPrintStyle): Integer; + + property ActiveStyle: TcxCustomSchedulerReportLinkPrintStyle read FActiveStyle write SetActiveStyle stored False; + property ActiveStyleAssigned: Boolean read FActiveStyleAssigned write SetActiveStyleAssigned; + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxCustomSchedulerReportLinkPrintStyle read GetItem write SetItem; default; + published + property Daily: TcxSchedulerReportLinkDailyPrintStyle read GetStyleDaily write SetStyleDaily; + property Details: TcxSchedulerReportLinkDetailsPrintStyle read GetStyleDetails write SetStyleDetails; + property Memo: TcxSchedulerReportLinkMemoPrintStyle read GetStyleMemo write SetStyleMemo; + property Monthly: TcxSchedulerReportLinkMonthlyPrintStyle read GetStyleMonthly write SetStyleMonthly; + property Trifold: TcxSchedulerReportLinkTrifoldPrintStyle read GetStyleTrifold write SetStyleTrifold; + property Weekly: TcxSchedulerReportLinkWeeklyPrintStyle read GetStyleWeekly write SetStyleWeekly; + property Yearly: TcxSchedulerReportLinkYearlyPrintStyle read GetStyleYearly write SetStyleYearly; + end; + + { DesignWindow } + + TcxfmSchedulerReportLinkDesignWindow = class(TdxfmCustomcxControlReportLinkDesignWindow) + PageControl1: TPageControl; + tshPrintStyles: TTabSheet; + tshStyles: TTabSheet; + bvlStyles: TBevel; + bvlStyleSheets: TBevel; + lblStyleSheets: TLabel; + bvlStylesHost: TBevel; + Label1: TLabel; + lblUseNativeStyles: TLabel; + btnStyleColor: TButton; + btnStyleFont: TButton; + btnStyleBackgroundBitmap: TButton; + cbxStyleSheets: TcxComboBox; + btnStyleSheetNew: TButton; + btnStyleSheetCopy: TButton; + btnStyleSheetDelete: TButton; + btnStylesSaveAs: TButton; + btnStyleSheetRename: TButton; + btnStyleBackgroundBitmapClear: TButton; + btnStyleRestoreDefaults: TButton; + chbxUseNativeStyles: TcxCheckBox; + pmStyles: TPopupMenu; + miStyleFont: TMenuItem; + miStyleColor: TMenuItem; + miLine3: TMenuItem; + miStyleBackgroundBitmap: TMenuItem; + miStyleBackgroundBitmapClear: TMenuItem; + miLine2: TMenuItem; + miStyleRestoreDefaults: TMenuItem; + milLine: TMenuItem; + miStylesSelectAll: TMenuItem; + miLine4: TMenuItem; + miStylesSaveAs: TMenuItem; + ilStylesPopup: TImageList; + lblPreviewWindow: TStaticText; + Panel1: TPanel; + pnlPreview: TPanel; + cbxPrintStyles: TcxImageComboBox; + lblPrintStylesOptions: TLabel; + bvlPrintStyleOptions: TBevel; + pcPrintStyleOptions: TPageControl; + tshWeekly: TTabSheet; + tshMonthly: TTabSheet; + tshTrifold: TTabSheet; + tshDetails: TTabSheet; + tshMemo: TTabSheet; + lblPrintStyleTrifoldSectionLeft: TLabel; + lblPrintStyleTrifoldSectionMiddle: TLabel; + lblPrintStyleTrifoldSectionRight: TLabel; + lblPrintStyleWeeklyPrintTo: TLabel; + lblPrintStyleWeeklyPrintFrom: TLabel; + chbxPrintStyleWeeklyNotesAreaLined: TcxCheckBox; + chbxPrintStyleWeeklyNotesAreaBlank: TcxCheckBox; + lblPrintStyleWeeklyInclude: TLabel; + lblPrintStyleWeeklyLayout: TLabel; + lblPrintStyleWeeklyArrange: TLabel; + cbxPrintStyleWeeklyArrange: TcxComboBox; + cbxPrintStyleWeeklyLayout: TcxComboBox; + chbxPrintStyleWeeklyTaskPad: TcxCheckBox; + tePrintStyleWeeklyPrintFrom: TcxTimeEdit; + tePrintStyleWeeklyPrintTo: TcxTimeEdit; + cbxPrintStyleMonthlyLayout: TcxComboBox; + lblPrintStyleMonthlyLayout: TLabel; + lblPrintStyleMonthlyInclude: TLabel; + chbxPrintStyleMonthlyTaskPad: TcxCheckBox; + chbxPrintStyleMonthlyNotesAreaBlank: TcxCheckBox; + chbxPrintStyleMonthlyNotesAreaLined: TcxCheckBox; + chbxPrintStyleMonthlyDontPrintWeekends: TcxCheckBox; + chbxPrintStyleMonthlyPrintExactlyOneMonthPerPage: TcxCheckBox; + chbxPrintStyleWeeklyDontPrintWeekends: TcxCheckBox; + pnlPrintStylesPreview: TPanel; + pbxPrintStylesPreview: TPaintBox; + chbxPrintStyleDetailsUsePagination: TcxCheckBox; + cbxPrintStyleDetailsPagination: TcxComboBox; + tshFormatting: TTabSheet; + bvlLookAndFeel: TBevel; + lblLookAndFeel: TLabel; + imgLookAndFeel: TImage; + cbxLookAndFeel: TcxComboBox; + lblRefinements: TLabel; + bvlRefinements: TBevel; + imgRefinements: TImage; + chbxSuppressBackgroundBitmaps: TcxCheckBox; + tshPrintRange: TTabSheet; + lblPrintRangeStart: TLabel; + lblPrintRangeEnd: TLabel; + lblPrintRangesMiscellaneous: TLabel; + Bevel1: TBevel; + dePrintRangeStart: TcxDateEdit; + dePrintRangeEnd: TcxDateEdit; + chbxHideDetailsOfPrivateAppointments: TcxCheckBox; + cbxPrintStyleTrifoldSectionLeft: TcxComboBox; + cbxPrintStyleTrifoldSectionMiddle: TcxComboBox; + cbxPrintStyleTrifoldSectionRight: TcxComboBox; + chbxSuppressContentColoration: TcxCheckBox; + sePrintStyleMonthlyResourceCountPerPage: TcxSpinEdit; + lblPrintStyleMonthlyResourceCountPerPage: TLabel; + lblPrintStyleWeeklyResourceCountPerPage: TLabel; + sePrintStyleWeeklyResourceCountPerPage: TcxSpinEdit; + tshDaily: TTabSheet; + lblPrintStyleDailyLayout: TLabel; + lblPrintStyleDailyInclude: TLabel; + lblPrintStyleDailyPrintFrom: TLabel; + lblPrintStyleDailyPrintTo: TLabel; + lblPrintStyleDailyResourceCountPerPage: TLabel; + cbxPrintStyleDailyLayout: TcxComboBox; + chbxPrintStyleDailyTaskPad: TcxCheckBox; + chbxPrintStyleDailyNotesAreaBlank: TcxCheckBox; + chbxPrintStyleDailyNotesAreaLined: TcxCheckBox; + tePrintStyleDailyPrintFrom: TcxTimeEdit; + tePrintStyleDailyPrintTo: TcxTimeEdit; + sePrintStyleDailyResourceCountPerPage: TcxSpinEdit; + cxEditStyleController1: TcxEditStyleController; + pbPreview: TPaintBox; + chbxPrintStyleMemoStartEachItemOnNewPage: TcxCheckBox; + chbxPrintStyleMemoPrintOnlySelectedEvents: TcxCheckBox; + cbxPrintStyleWeeklyDaysLayout: TcxComboBox; + lblPrintStyleWeeklyDaysLayout: TLabel; + tshYearly: TTabSheet; + cbxPrintStyleYearlyMonthPerPage: TcxComboBox; + lblPrintStyleYearlyMonthPerPage: TLabel; + lblPrintStyleYearlyResourceCountPerPage: TLabel; + sePrintStyleYearlyResourceCountPerPage: TcxSpinEdit; + chbxPrintStyleYearlyTaskPad: TcxCheckBox; + chbxPrintStyleYearlyNotesAreaBlank: TcxCheckBox; + chbxPrintStyleYearlyNotesAreaLined: TcxCheckBox; + lblPrintStyleYearlyInclude: TLabel; + cbxPrintStyleYearlyLayout: TcxComboBox; + lblPrintStyleYearlyLayout: TLabel; + chbxPrimaryPageHeadersOnly: TcxCheckBox; + chbxPrintStyleDailyShowResourceImages: TcxCheckBox; + chbxPrintStyleDailyShowEventImages: TcxCheckBox; + Bevel2: TBevel; + Bevel3: TBevel; + chbxPrintStyleWeeklyShowEventImages: TcxCheckBox; + chbxPrintStyleWeeklyShowResourceImages: TcxCheckBox; + Bevel4: TBevel; + chbxPrintStyleMonthlyShowEventImages: TcxCheckBox; + chbxPrintStyleMonthlyShowResourceImages: TcxCheckBox; + chbxPrintStyleYearlyShowEventImages: TcxCheckBox; + Bevel5: TBevel; + procedure PageControl1Change(Sender: TObject); + procedure lbxStylesClick(Sender: TObject); + procedure btnStyleFontClick(Sender: TObject); + procedure btnStyleColorClick(Sender: TObject); + procedure btnStyleBackgroundBitmapClick(Sender: TObject); + procedure btnStyleBackgroundBitmapClearClick(Sender: TObject); + procedure btnStyleRestoreDefaultsClick(Sender: TObject); + procedure btnStylesSaveAsClick(Sender: TObject); + procedure cbxStyleSheetsClick(Sender: TObject); + procedure miStylesSelectAllClick(Sender: TObject); + procedure cbxStyleSheetsKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure btnStyleSheetNewClick(Sender: TObject); + procedure btnStyleSheetCopyClick(Sender: TObject); + procedure btnStyleSheetDeleteClick(Sender: TObject); + procedure btnStyleSheetRenameClick(Sender: TObject); + procedure lblUseNativeStylesClick(Sender: TObject); + procedure OptionsFormattingClick(Sender: TObject); + procedure pmStylesPopup(Sender: TObject); + procedure cbxPrintStylesClick(Sender: TObject); + procedure pbxPrintStylesPreviewPaint(Sender: TObject); + procedure cbxPrintStyleDailyLayoutClick(Sender: TObject); + procedure chbxPrintStyleOptionsViewClick(Sender: TObject); + procedure cbxPrintStyleWeeklyArrangeClick(Sender: TObject); + procedure chbxPrintStyleWeeklyDontPrintWeekendsClick(Sender: TObject); + procedure chbxPrintStyleMonthlyDontPrintWeekendsClick(Sender: TObject); + procedure chbxPrintStyleMonthlyPrintExactlyOneMonthPerPageClick( + Sender: TObject); + procedure cbxPrintStyleTrifoldSectionModeClick(Sender: TObject); + procedure chbxPrintStyleDetailsUsePaginationClick(Sender: TObject); + procedure cbxPrintStyleDetailsPaginationClick(Sender: TObject); + procedure cbxPrintStyleWeeklyLayoutClick(Sender: TObject); + procedure cbxPrintStyleMonthlyLayoutClick(Sender: TObject); + procedure dePrintRangeStartEditValueChanged(Sender: TObject); + procedure dePrintRangeEndEditValueChanged(Sender: TObject); + procedure cbxStyleSheetsPropertiesDrawItem(AControl: TcxCustomComboBox; + ACanvas: TcxCanvas; AIndex: Integer; const ARect: TRect; + AState: TOwnerDrawState); + procedure tePrintStylePrintRangePropertiesEditValueChanged( + Sender: TObject); + procedure LookAndFeelChange(Sender: TObject); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + procedure sePrintStyleResourceCountPerPagePropertiesEditValueChanged( + Sender: TObject); + procedure tePrintStylePrintRangePropertiesChange(Sender: TObject); + procedure sePrintStyleResourceCountPerPagePropertiesChanged( + Sender: TObject); + procedure StyleController1StyleChanged(Sender: TObject); + procedure pbPreviewPaint(Sender: TObject); + procedure cbxLookAndFeelPropertiesChange(Sender: TObject); + procedure chbxPrintStyleMemoStartEachItemOnNewPageClick( + Sender: TObject); + procedure chbxPrintStyleMemoPrintOnlySelectedEventsClick( + Sender: TObject); + procedure cbxPrintStyleWeeklyDaysLayoutClick(Sender: TObject); + procedure cbxPrintStyleYearlyLayoutClick(Sender: TObject); + procedure cbxPrintStyleYearlyMonthPagesPerYearClick(Sender: TObject); + procedure chbxPrimaryPageHeadersOnlyClick(Sender: TObject); + procedure chbxPrintStyleShowResourceImagesClick(Sender: TObject); + procedure chbxPrintStyleShowEventImagesClick(Sender: TObject); + private + FActiveStyle: TcxCustomSchedulerReportLinkPrintStyle; + FActiveStyleAssigned: Boolean; + FIsFormClosing: Boolean; + lbxStyles: TdxStylesListBox; + wpPrintStyles: TList; + + function GetActivePrintStyle: TcxCustomSchedulerReportLinkPrintStyle; + function GetActiveStyle: TcxStyle; + function GetComponent: TcxScheduler; + function GetHasSelectedStyles: Boolean; + function GetHasSelectedStylesWithAssignedBitmap: Boolean; + function GetReportLink: TcxSchedulerReportLink; + + function CanSelectAllStyles: Boolean; + procedure CreateControls; + + procedure RecreateStylesListBox; + procedure RestoreSelectedStyles(AList: TList); + procedure SaveSelectedStyles(AList: TList); + procedure SetActivePage; + + procedure SetOptionsFormattingByIndex(AnIndex: Integer; AValue: Boolean); + procedure SetPrintStyleOptionsViewByIndex(AnIndex: Integer; AValue: Boolean); + procedure SetPrintStyleRangeByIndex(AnIndex: Integer; const ATime: TDateTime); + procedure SetPrintStyleResourceCountPerPageByIndex(AnIndex: Integer; AValue: TcxEditValue); + procedure SetShowImagesCheckBoxes(AEventImages, AResourceImages: TcxCheckBox; + APrintStyle: TcxCustomSchedulerReportLinkPrintStyle); + protected + procedure AssignDailyTabObjects; virtual; + procedure AssignDetailsTabObjects; virtual; + procedure AssignMemoTabObjects; virtual; + procedure AssignMonthlyTabObjects; virtual; + procedure AssignTrifoldTabObjects; virtual; + procedure AssignWeeklyTabObjects; virtual; + procedure AssignYearlyTabObjects; virtual; + + function CanApply: Boolean; override; + procedure DoApply; override; + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + + function CheckPrintRange: Boolean; virtual; + function CheckPrintStyleSettings: Boolean; virtual; + function IsValidConditions: Boolean; virtual; + procedure LoadCaption(AControl: TControl; StrPtr: Pointer); overload; + procedure LoadCaption(AItem: TMenuItem; StrPtr: Pointer); overload; + procedure LoadStrings; override; + procedure LoadStringsCombo(ACombo: TcxComboBox; ACaptions: array of Pointer); + procedure LoadStringsDaily; virtual; + procedure LoadStringsDetails; virtual; + procedure LoadStringsMemo; virtual; + procedure LoadStringsMonthly; virtual; + procedure LoadStringsOther; virtual; + procedure LoadStringsTrifold; virtual; + procedure LoadStringsWeekly; virtual; + procedure LoadStringsYearly; virtual; + + procedure PreviewDrawPageContent(ACanvas: TCanvas; ABounds: TRect); virtual; + + procedure UpdateControlsState; override; + procedure UpdateEnabled(AControl: TControl; AEnabled: Boolean); overload; + procedure UpdateEnabled(AItem: TMenuItem; AEnabled: Boolean); overload; + procedure UpdateEnabledControls(AControls: array of TControl; AEnabled: Boolean); + procedure UpdatePreview; override; + + function GetDesignerTabIndex: Integer; override; + procedure SetDesignerTabIndex(Value: Integer); override; + + procedure DoActiveStyleSheetChanged; override; + procedure DoFormActivated(AnActive: Boolean); override; + procedure DoRefreshStylesList; override; + procedure DoStyleChanged(const ACaption: string; AStyle: TcxStyle); override; + procedure DoStylesChanged(AStrings: TStrings; ARecreate: Boolean); override; + + procedure GetSelectedStyleNames(AStrings: TStrings); override; + procedure GetStyleNames(out AStrings: TStrings); override; + procedure GetStyleSheetNames(out AStrings: TStrings); override; + + procedure ActivatePrintStyleTab; virtual; + procedure AssignTabSheetObjects; virtual; + function FindTabIndexByPrintStyle(APrintStyle: TcxCustomSchedulerReportLinkPrintStyle): Integer; virtual; + procedure RefreshPrintStyles; virtual; + + property ActivePrintStyle: TcxCustomSchedulerReportLinkPrintStyle read GetActivePrintStyle; + property ActiveStyle: TcxStyle read GetActiveStyle; + property HasSelectedStyles: Boolean read GetHasSelectedStyles; + property HasSelectedStylesWithAssignedBitmap: Boolean read GetHasSelectedStylesWithAssignedBitmap; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function Execute: Boolean; override; + + property Component: TcxScheduler read GetComponent; + property ReportLink: TcxSchedulerReportLink read GetReportLink; + end; + + // cells + + { TcxSchedulerReportPageSite } + + TcxSchedulerReportPageSite = class(TdxReportCell) + protected + FPageIndex: Integer; + FPrimaryPage: Boolean; + + procedure ReadProperties(AReader: TdxPSDataReader); override; + procedure WriteProperties(AWriter: TdxPSDataWriter); override; + public + property PageIndex: Integer read FPageIndex; + property PrimaryPage: Boolean read FPrimaryPage; + end; + + { TcxSchedulerReportPageItemCell } + + TcxSchedulerReportPageItemCell = class(TdxReportCell) + private + function GetPageIndex: Integer; + function GetPageSite: TcxSchedulerReportPageSite; + function GetPrimaryPage: Boolean; + function GetReportLink: TcxSchedulerReportLink; + protected + function GetType: TcxSchedulerReportItemsType; virtual; + + procedure SetCellViewParams(AItem: TdxReportVisualItem; const AParams: TcxViewParams); overload; + procedure SetCellViewParams(AItem: TdxReportVisualItem; const AParams: TdxReportItemViewParams); overload; + + property ReportLink: TcxSchedulerReportLink read GetReportLink; + public + constructor Create(AParent: TdxReportCell); override; + property PageSite: TcxSchedulerReportPageSite read GetPageSite; + property PrimaryPage: Boolean read GetPrimaryPage; + property PageIndex: Integer read GetPageIndex; + end; + + { TcxSchedulerReportNotesDataCell } + + TcxSchedulerReportNotesDataCell = class(TAbstractdxReportCellData) + private + FCaption: string; + FCaptionHeight: Integer; + FLined: Boolean; + function GetMultiLine: Boolean; + function GetTextAlignX: TdxTextAlignX; + function GetTextAlignY: TdxTextAlignY; + procedure SetMultiLine(Value: Boolean); + procedure SetTextAlignX(Value: TdxTextAlignX); + procedure SetTextAlignY(Value: TdxTextAlignY); + protected + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor Create(AParent: TdxReportCell); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + + property Caption: string read FCaption write FCaption; + property CaptionHeight: Integer read FCaptionHeight write FCaptionHeight; + property Lined: Boolean read FLined write FLined; + property MultiLine: Boolean read GetMultiLine write SetMultiLine; + property TextAlignX: TdxTextAlignX read GetTextAlignX write SetTextAlignX; + property TextAlignY: TdxTextAlignY read GetTextAlignY write SetTextAlignY; + end; + + TcxSchedulerReportNotesDataCellClass = class of TcxSchedulerReportNotesDataCell; + + { TcxSchedulerReportNotesAreaCell } + + TcxSchedulerReportNotesAreaCell = class(TcxSchedulerReportPageItemCell) + private + FLined: Boolean; + function GetDataCell: TcxSchedulerReportNotesDataCell; + protected + procedure BoundsChanged; override; + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); override; + function GetType: TcxSchedulerReportItemsType; override; + function GetDataCellClass: TcxSchedulerReportNotesDataCellClass; virtual; + procedure SetFontIndex(Value: Integer); override; + public + constructor Create(AParent: TdxReportCell); override; + constructor CreateEx(AParent: TdxReportCell; ALined: Boolean); virtual; + property DataCell: TcxSchedulerReportNotesDataCell read GetDataCell; + property Lined: Boolean read FLined; + end; + + { TcxSchedulerReportTaskPadCell } + + TcxSchedulerReportTaskPadCell = class(TcxSchedulerReportNotesAreaCell) + private + function GetTaskPadDataSite: TdxReportCell; + protected + procedure BoundsChanged; override; + function CalculateTaskPadDataSiteBounds: TRect; virtual; + function GetType: TcxSchedulerReportItemsType; override; + public + constructor CreateEx(AParent: TdxReportCell; ALined: Boolean); override; + + property TaskPadDataSite: TdxReportCell read GetTaskPadDataSite; + end; + + { TcxSchedulerReportSchedulerHeaderDataCell } + + TcxSchedulerReportSchedulerHeaderDataCell = class(TAbstractdxReportCellData) + public + constructor Create(AParent: TdxReportCell); override; + end; + + { TcxSchedulerReportSchedulerHeaderCell } + + TcxSchedulerReportSchedulerHeaderCell = class(TcxSchedulerReportPageItemCell) + private + FContent: TcxSchedulerReportSchedulerHeaderDataCell; + FDate: TDateTime; + FPrimaryText: string; //todo: remove + FSecondaryText: string; //todo: remove + FPrimaryTextCell: TdxReportCellString; + FSecondaryTextCell: TdxReportCellString; + protected + function AddContentCell: TcxSchedulerReportSchedulerHeaderDataCell; virtual; + function AddTextCell(AText: string; const ABounds: TRect; AMultiLine: Boolean): TdxReportCellString; + function GetType: TcxSchedulerReportItemsType; override; + + property Date: TDateTime read FDate write FDate; + property PrimaryText: string read FPrimaryText write FPrimaryText; //todo: remove + property SecondaryText: string read FSecondaryText write FSecondaryText; //todo: remove + public + constructor Create(AParent: TdxReportCell); override; + procedure AdjustTextSize; + + property Content: TcxSchedulerReportSchedulerHeaderDataCell read FContent; + property PrimaryTextCell: TdxReportCellString read FPrimaryTextCell; + property SecondaryTextCell: TdxReportCellString read FSecondaryTextCell; + end; + + { TcxSchedulerReportDateNavigatorItem } + + TcxSchedulerReportDateNavigatorItem = class(TdxReportCellPreviewText) + private + function GetDateNavigator: TcxSchedulerReportDateNavigatorCell; + protected + function GetDefaultDTFormat: DWORD; override; + procedure SetText(const Value: string); override; + public + constructor Create(AParent: TdxReportCell); override; + + property DateNavigator: TcxSchedulerReportDateNavigatorCell read GetDateNavigator; + end; + + { TcxSchedulerReportDateNavigatorHeader } + + TcxSchedulerReportDateNavigatorHeader = class(TcxSchedulerReportDateNavigatorItem) + private + FMonth: Word; + FYear: Word; + protected + function GetText: string; override; + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateEx(AParent: TdxReportCell; AYear, AMonth: Word); + procedure Assign(Source: TPersistent); override; + + property Month: Word read FMonth; + property Year: Word read FYear; + end; + + { TcxSchedulerReportDateNavigatorDay } + + TcxSchedulerReportDateNavigatorDay = class(TcxSchedulerReportDateNavigatorItem) + private + FDay: Integer; + FCol: Integer; + FRow: Integer; + function GetBold: Boolean; + function GetDate: TDate; + function GetMonth: Word; + function GetYear: Word; + procedure SetBold(Value: Boolean); + protected + function GetText: string; override; + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateEx(AParent: TdxReportCell; + ADay, ACol, ARow: Integer; ABold: Boolean); virtual; + procedure Assign(Source: TPersistent); override; + + property Col: Integer read FCol; + property Date: TDate read GetDate; + property Day: Integer read FDay write FDay; + property Bold: Boolean read GetBold write SetBold; + property Month: Word read GetMonth; + property Row: Integer read FRow; + property Year: Word read GetYear; + end; + + { TcxSchedulerReportDateNavigatorDayCaption } + + TcxSchedulerReportDateNavigatorDayCaption = class(TcxSchedulerReportDateNavigatorItem) + private + FCol: Integer; + FDayOfWeek: TDay; + FDayText: string; + protected + function GetText: string; override; + function GetDayText: string; virtual; + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateEx(AParent: TdxReportCell; ADayOfWeek: TDay; ACol: Integer); virtual; + procedure Assign(Source: TPersistent); override; + + property Col: Integer read FCol; + property DayOfWeek: TDay read FDayOfWeek; + end; + + { TcxSchedulerReportDateNavigatorWeekNumber } + + TcxSchedulerReportDateNavigatorWeekNumber = class(TcxSchedulerReportDateNavigatorItem) + private + FWeekNumber: Integer; + FRow: Integer; + protected + function GetText: string; override; + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateEx(AParent: TdxReportCell; AWeekNumber, ARow: Integer); virtual; + procedure Assign(Source: TPersistent); override; + + property Row: Integer read FRow; + property WeekNumber: Integer read FWeekNumber write FWeekNumber; + end; + + { TcxSchedulerReportDateNavigatorCell } + + TcxSchedulerReportDateNavigatorCell = class(TcxSchedulerReportPageItemCell) + private + FBoldedDays: TcxSchedulerDateList; + FFirstWeekOfYear: TcxFirstWeekOfYear; + FMonth: Word; + FShowDatesContainingEventsInBold: Boolean; + FShowWeekNumbers: Boolean; + FStartOfWeek: TDay; + FYear: Word; + + FColWidth: Integer; + FDayCaptionsHeight: Integer; + FHeaderHeight: Integer; + FMonthSize: TSize; + FRowHeight: Integer; + FVertOffset: Integer; + FContentParams: TdxReportItemViewParams; + FHeaderParams: TdxReportItemViewParams; + + FDayCaptionCount: Integer; + FDayCount: Integer; + FWeekNumberCount: Integer; + + class function GetMonthHeight(AHeaderHeight, ADayCaptionsHeight, ARowHeight: Integer): Integer; + function GetDay(Index: Integer): TcxSchedulerReportDateNavigatorDay; + function GetDayCaption(Index: Integer): TcxSchedulerReportDateNavigatorDayCaption; + function GetHeader: TcxSchedulerReportDateNavigatorHeader; + function GetWeekNumber(Index: Integer): TcxSchedulerReportDateNavigatorWeekNumber; + protected + procedure AdjustItemsVertical; + function ColOfDate(ADate: TDateTime): Integer; + procedure CreateDayCaptions; virtual; + procedure CreateDay(const ABounds: TRect; ADate: TDateTime; ACol, ARow: Integer); virtual; + procedure CreateItems; + procedure CreateLines; virtual; + procedure CreateMonth; virtual; + procedure CreateMonthHeader; virtual; + procedure CreateWeekNumber(const ABounds: TRect; ADate: TDateTime; ARow: Integer); virtual; + class procedure GetContentPartSizes(AFont: TFont; var AColWidth, ARowHeight, + ADayCaptionsHeight: Integer; AFontSize: Integer = 0); virtual; + function GetDayBoundsFromColAndRow(ACol, ARow: Integer): TRect; virtual; + function GetDayIsBold(ADate: TDateTime): Boolean; virtual; + function GetHeaderBounds: TRect; virtual; + class procedure GetHeaderPartSizes(AFont: TFont; var AHeaderHeight: Integer; + AFontSize: Integer = 0); virtual; + function GetMonthSize(const AContentParams, AHeaderParams: TdxReportItemViewParams): TSize; + function GetType: TcxSchedulerReportItemsType; override; + procedure SetViewParams(const AContentParams, AHeaderParams: TdxReportItemViewParams); virtual; + + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + + property ColWidth: Integer read FColWidth; + property DayCaptionsHeight: Integer read FDayCaptionsHeight; + property HeaderHeight: Integer read FHeaderHeight; + property MonthSize: TSize read FMonthSize; + property RowHeight: Integer read FRowHeight; + property ContentParams: TdxReportItemViewParams read FContentParams; + property HeaderParams: TdxReportItemViewParams read FHeaderParams; + public + constructor Create(AParent: TdxReportCell); override; + constructor CreateEx(AParent: TdxReportCell; AFirstWeekOfYear: TcxFirstWeekOfYear; + AYear, AMonth: Word; AShowDatesContainingEventsInBold, AShowWeekNumbers: Boolean); virtual; + + procedure AdjustSize(var AContentParams, AHeaderParams: TdxReportItemViewParams; AHeight, AMaxHeight: Integer); virtual; + function CalculateSize(const AContentParams, AHeaderParams: TdxReportItemViewParams): TSize; + class function MeasureDateNavigatorHeight(const AContentParams, AHeaderParams: TcxViewParams): Integer; virtual; + + property FirstWeekOfYear: TcxFirstWeekOfYear read FFirstWeekOfYear write FFirstWeekOfYear; + property Month: Word read FMonth write FMonth; + property ShowDatesContainingEventsInBold: Boolean read FShowDatesContainingEventsInBold write FShowDatesContainingEventsInBold; + property ShowWeekNumbers: Boolean read FShowWeekNumbers write FShowWeekNumbers; + property StartOfWeek: TDay read FStartOfWeek; + property Year: Word read FYear write FYear; + + // Helpers + property DayCaptionCount: Integer read FDayCaptionCount; + property DayCaptions[Index: Integer]: TcxSchedulerReportDateNavigatorDayCaption read GetDayCaption; + property DayCount: Integer read FDayCount; + property Days[Index: Integer]: TcxSchedulerReportDateNavigatorDay read GetDay; + property Header: TcxSchedulerReportDateNavigatorHeader read GetHeader; + property WeekNumberCount: Integer read FWeekNumberCount; + property WeekNumbers[Index: Integer]: TcxSchedulerReportDateNavigatorWeekNumber read GetWeekNumber; + end; + + { TcxSchedulerReportSchedulingAreaCell } + + TcxSchedulerReportSchedulingAreaCell = class(TcxSchedulerReportPageItemCell) + private + FVisibleDays: TcxSchedulerDateList; + FDaysList: TStringList; + protected + function GetType: TcxSchedulerReportItemsType; override; + property VisibleDays: TcxSchedulerDateList read FVisibleDays; + public + constructor Create(AParent: TdxReportCell); override; + destructor Destroy; override; + procedure DrawContent(DC: HDC; DrawRect: TRect; const OriginRect: TRect; AStage: TdxPSRenderStages); override; + procedure DrawItself(DC: HDC; AStage: TdxPSRenderStages); override; + end; + + TcxSchedulerReportCustomCell = class(TAbstractdxReportCellData) + private + function GetReportLink: TcxSchedulerReportLink; + protected + FDateTime: TDateTime; + FDayBorderColor: TColor; + FNoClip: Boolean; + procedure DrawCellFrame(DC: HDC; const ARect: TRect; ABorders: TcxBorders = []; + ABorderColor: TColor = clDefault; ALineWidth: Integer = 1); + procedure DrawCellRect(DC: HDC; const ARect: TRect; ABorders: TcxBorders = []; + ABorderColor: TColor = clDefault; ALineWidth: Integer = 1; AColor: TColor = clDefault); + procedure DrawCellText(DC: HDC; const ARect: TRect; const AText: string; AlignHorz: TdxTextAlignX; + AlignVert: TdxTextAlignY; AFont: TFont = nil; AColor: TColor = clDefault; AMultiLine: Boolean = False); + procedure DrawCellTextVert(DC: HDC; const ARect: TRect; const AText: string; + AlignHorz: TdxTextAlignX; AlignVert: TdxTextAlignY; AFont: TFont = nil; AMultiLine: Boolean = True); + procedure DrawCellState(DC: HDC; R: TRect; + AState: Integer; ABorders: TcxBorders = []; ABorderColor: TColor = clBlack); + + function AdjustTextRect(const ARect: TRect): TRect; + function ExcludeBorders(const ARect: TRect; ABorders: TcxBorders; ABorderWidth: Integer = 1): TRect; + function FixupWidth(AWidth: Integer): Integer; + function GetFixupRect(DC: HDC; const ARect: TRect): TRect; + function InflateRect(const ARect: TRect; dX, dY: Integer): TRect; + + property ReportLink: TcxSchedulerReportLink read GetReportLink; + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); virtual; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + class procedure RegisterMirrorClass; virtual; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; virtual; + procedure SuppressColoration; virtual; + end; + + { TcxSchedulerReportContentCell } + + TcxSchedulerReportContentCell = class(TcxSchedulerReportCustomCell) + protected + FBorderColor: TColor; + FShowTimeLine: Boolean; +// FSmallFont: Boolean; + FState: Integer; + FTimeLineBorders: TcxBorders; + function HasBorderColoration: Boolean; override; + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + procedure Assign(Source: TPersistent); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + procedure SuppressColoration; override; + end; + + { TcxSchedulerReportHeaderItemCell } + + TcxSchedulerReportHeaderItemCell = class(TcxSchedulerReportCustomCell) + private + FCaption: string; + FDate: TDateTime; + FIsResourceHeader: Boolean; + FResourceID: Variant; + FRotateText: Boolean; + //support images + FImageIndex: Integer; + FImages: TCustomImageList; + FImageRect: TRect; + FTextRect: TRect; + function GetTextAlignX: TdxTextAlignX; + function GetTextAlignY: TdxTextAlignY; + procedure SetTextAlignX(Value: TdxTextAlignX); + procedure SetTextAlignY(Value: TdxTextAlignY); + protected + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); override; + function HasImage: Boolean; virtual; + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + procedure Assign(Source: TPersistent); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + procedure DrawImage(DC: HDC); + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + property TextAlignX: TdxTextAlignX read GetTextAlignX write SetTextAlignX; + property TextAlignY: TdxTextAlignY read GetTextAlignY write SetTextAlignY; + + property TextRect: TRect read FTextRect; + property Caption: string read FCaption write FCaption; + property Date: TDateTime read FDate; + property ImageIndex: Integer read FImageIndex; + property ImageRect: TRect read FImageRect; + property Images: TCustomImageList read FImages; + property IsResourceHeader: Boolean read FIsResourceHeader; + property ResourceID: Variant read FResourceID; + property RotateText: Boolean read FRotateText; + end; + + { TcxSchedulerReportGroupSeparatorCell } + + TcxSchedulerReportGroupSeparatorCell = class(TcxSchedulerReportCustomCell) + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + end; + + { TcxSchedulerReportContainerCell } + + TcxSchedulerReportContainerCell = class(TcxSchedulerReportCustomCell) + public + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + end; + + { TcxSchedulerReportBackgroundSlotCell } + + TcxSchedulerReportBackgroundSlotCell = class(TcxSchedulerReportCustomCell) + protected + FDisplayText: string; + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + property DisplayText: string read FDisplayText write FDisplayText; + end; + + { TcxSchedulerReportDailyTimeRulerCellsSite } + + TcxSchedulerReportDailyTimeRulerCellsSite = class(TdxReportCell) + private + FLargeFont: TFont; + FLargeFontIndex: Integer; + function GetLargeFont: TFont; + protected + procedure SetFontIndex(Index: Integer); override; + procedure ReadProperties(AReader: TdxPSDataReader); override; + procedure WriteProperties(AWriter: TdxPSDataWriter); override; + public + constructor Create(AParent: TdxReportCell); override; + destructor Destroy; override; + property LargeFont: TFont read GetLargeFont; + end; + + { TcxSchedulerReportDailyTimeRulerCell } + + TcxSchedulerReportDailyTimeRulerCell = class(TcxSchedulerReportCustomCell) + private + function GetBoundsRect(AType: Boolean): TRect; + function GetDisplayText(AType: Boolean): string; + function GetLargeFont: TFont; + function GetTimeRulerSite: TcxSchedulerReportDailyTimeRulerCellsSite; + protected + FBounds: array[Boolean] of TRect; + FDisplayTexts: array[Boolean] of string; + FHasAdditionalTimeZone: Boolean; + FHour: Integer; + FLineColor: TColor; + FLineCount: Integer; + FShowMinutes: Boolean; + procedure CalculateDisplayInfo; + procedure DrawTimeZone(DC: HDC; const ABounds: TRect; const AText: string; AIsCurrent: Boolean); virtual; + procedure DrawTimeZoneLabel(DC: HDC; const ABounds: TRect; const AText: string; ABorders: TcxBorders); virtual; + + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + + property LargeFont: TFont read GetLargeFont; + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + procedure Assign(Source: TPersistent); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + procedure SuppressColoration; override; + + property Bounds[ACurrentTimeZone: Boolean]: TRect read GetBoundsRect; + property DisplayTexts[ACurrentTimeZone: Boolean]: string read GetDisplayText; + property HasAdditionalTimeZone: Boolean read FHasAdditionalTimeZone; + property Hour: Integer read FHour; + property LineCount: Integer read FLineCount; + property ShowMinutes: Boolean read FShowMinutes; + property TimeRulerSite: TcxSchedulerReportDailyTimeRulerCellsSite read GetTimeRulerSite; + end; + + { TcxSchedulerReportMonthDayCell } + + TcxSchedulerReportMonthDayCell = class(TcxSchedulerReportContentCell) + private + FSmallFont: Boolean; + FDisplayText: string; + FDontPrint: Boolean; + protected + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + procedure Assign(Source: TPersistent); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + property DisplayText: string read FDisplayText write FDisplayText; + property SmallFont: Boolean read FSmallFont write FSmallFont; + end; + + { TcxSchedulerReportTimeLinePart} + + TcxSchedulerReportTimeLinePart = class(TdxReportCellBox) + private + FState: Integer; + FTriangle: Boolean; + protected + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + property State: Integer read FState write FState; + public + constructor CreateEx(AParent: TdxReportCell; ATriangle: Boolean; AState: Integer); + procedure Assign(Source: TPersistent); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + end; + + { TcxSchedulerReportTimeLineCell } + + TcxSchedulerReportTimeLineCell = class(TdxReportCell) + private + FCurrentValue: TAbstractdxReportCellData; + public + constructor Create(AParent: TdxReportCell); override; + procedure SetTimeRect(const ABounds: TRect; AState: Integer); + end; + + TcxSchedulerReportCellString = class(TdxReportCellString) + protected + function GetDefaultDTFormat: DWORD; override; + end; + + { TcxSchedulerReportCustomEventCell } + + TcxSchedulerReportCustomEventCell = class(TdxReportCell) + private + function GetPrintStyle: TcxCustomSchedulerReportLinkPrintStyle; + function GetReportLink: TcxSchedulerReportLink; + function GetSuppressColoration: Boolean; + protected + FCaptionCell: TdxReportCellString; + FMessageCell: TAbstractdxReportCellData; + FStartCell: TdxReportCellString; + FFinishCell: TdxReportCellString; + FTimeLineCell: TcxSchedulerReportTimeLineCell; + procedure SetViewParams(const AViewParams: TcxViewParams); virtual; + public + function CreateStringCell(const AText: string; AMultiline: Boolean = True; AData: Integer = 0): TdxReportCellString; virtual; + + property CaptionCell: TdxReportCellString read FCaptionCell; + property StartCell: TdxReportCellString read FStartCell; + property FinishCell: TdxReportCellString read FFinishCell; + property MessageCell: TAbstractdxReportCellData read FMessageCell; + property PrintStyle: TcxCustomSchedulerReportLinkPrintStyle read GetPrintStyle; + property ReportLink: TcxSchedulerReportLink read GetReportLink; + property TimeLineCell: TcxSchedulerReportTimeLineCell read FTimeLineCell; + property SuppressColoration: Boolean read GetSuppressColoration; + end; + + { TcxSchedulerReportEventCell } + + TcxSchedulerReportEventCell = class(TcxSchedulerReportCustomEventCell) + private + FCaptionLeft: Integer; + FContentBounds: TRect; + FEditViewInfo: TcxCustomEditViewInfo; + FEventViewInfo: TcxSchedulerEventCellViewInfo; + FHasDetailInfo: Boolean; + FHasImages: Boolean; + FHasMessage: Boolean; + FIsHeaderEvent: Boolean; + FIsNeedCreateTimeCells: Boolean; + FMessage: Variant; + procedure CheckBounds(var ABounds: TRect); + function GetEvent: TcxSchedulerControlEvent; + protected + procedure AdjustItemsHeight(DC: HDC); virtual; + procedure CalculateLayout; virtual; + procedure CalculateTimeLine(DC: HDC); virtual; + function CreateCaptionCell: TdxReportCellString; virtual; + procedure CreateDataItems; virtual; + procedure CreateEventImageCells; virtual; + procedure CreateMessageCell(AMessage: Variant; + AProperties: TcxCustomEditProperties; AViewParams: TcxViewParams); + function CreateTimeLineCell: TcxSchedulerReportTimeLineCell; virtual; + function CreateTimeTextCell(const ATimeText: string; AData: Integer = 0): TdxReportCellString; virtual; + function GetCaptionRect(DC: HDC): TRect; virtual; + function GetContentBounds(DC: HDC): TRect; virtual; + function GetHasImages: Boolean; virtual; + function GetHasMessage: Boolean; virtual; + function GetMessageClass(AProperties: TcxCustomEditProperties): TdxReportCellDataClass; virtual; + function GetMessageRect(DC: HDC): TRect; virtual; + function GetRelativeRect(const R: TRect): TRect; + function GetTimeLineRect(DC: HDC): TRect; virtual; + procedure InitializeFromViewInfo(AEventViewInfo: TcxSchedulerEventCellViewInfo); + procedure SetViewParams(const AViewParams: TcxViewParams); override; + + property ContentBounds: TRect read FContentBounds; + property Event: TcxSchedulerControlEvent read GetEvent; + property EventViewInfo: TcxSchedulerEventCellViewInfo read FEventViewInfo; + property HasDetailInfo: Boolean read FHasDetailInfo; + property HasImages: Boolean read FHasImages; + property IsHeaderEvent: Boolean read FIsHeaderEvent; + property IsNeedCreateTimeCells: Boolean read FIsNeedCreateTimeCells; + public + constructor CreateFrom(AParent: TdxReportCell; AEventViewInfo: TcxSchedulerEventCellViewInfo); virtual; + + property CaptionCell: TdxReportCellString read FCaptionCell; + property HasMessage: Boolean read FHasMessage; + property Message: Variant read FMessage; + property MessageCell; + property TimeLineCell; + property StartCell; + property FinishCell; + end; + + { TcxSchedulerReportDetailsEventCell } + + TcxSchedulerReportDetailsEventCell = class(TcxSchedulerReportCustomEventCell) + protected + FContinued: Boolean; + FDate: TDateTime; + + FEvent: TcxSchedulerEvent; + FLineHeight: Integer; + procedure CreateCaptionCell; virtual; + procedure CreateDataItems; virtual; + procedure CreateMessageCell; virtual; + procedure CreateTimeCell; virtual; + function GetCaptionCellText: string; virtual; + function GetMessageCellText: string; virtual; + function GetTimeCellText: string; virtual; + procedure SetViewParams(const AViewParams: TcxViewParams); override; + public + constructor CreateEx(AParent: TdxReportCell; AEvent: TcxSchedulerEvent; + ADate: TDateTime; const AParams: TcxViewParams; AContinued: Boolean = False); + function CalculateHeight: Integer; virtual; + procedure CalculateLayout(AWidth, ATimeWidth: Integer); virtual; + + property Date: TDateTime read FDate; + property Event: TcxSchedulerEvent read FEvent; + property Continued: Boolean read FContinued; + end; + + { TcxSchedulerReportMemoEventCell } + + TcxSchedulerReportMemoEventCell = class(TcxSchedulerReportDetailsEventCell) + protected + FCaptionLabelCell: TdxReportCellString; + FHeaderCell: TdxReportCellString; + FLocationCell: TdxReportCellString; + FLocationLabelCell: TdxReportCellString; + FShowTimeAsCell: TdxReportCellString; + FShowTimeAsLabelCell: TdxReportCellString; + FStartLabelCell: TdxReportCellString; + FFinishLabelCell: TdxReportCellString; + FRecurrenceCell: TdxReportCellString; + FRecurrenceLabelCell: TdxReportCellString; + FRecurrencePatternCell: TdxReportCellString; + FRecurrencePatternLabelCell: TdxReportCellString; + procedure CreateDataItems; override; + function GetCaptionCellText: string; override; + function GetMessageCellText: string; override; + function GetTimeCellText: string; override; + procedure SetViewParams(const AViewParams: TcxViewParams); override; + + procedure CalculateLabelAndData(ALabelCell, ADataCell: TAbstractdxReportCellData; + DC: HDC; ATimeWidth, AWidth: Integer; var ATop: Integer); virtual; + procedure CreateHeader; virtual; + procedure CreateFinish; virtual; + procedure CreateFinishCell; virtual; + procedure CreateFinishLabelCell; virtual; + procedure CreateLocation; virtual; + procedure CreateLocationCell; virtual; + procedure CreateLocationLabelCell; virtual; + procedure CreateMessage; virtual; + procedure CreateRecurrence; virtual; + procedure CreateRecurrenceCell; virtual; + procedure CreateRecurrenceLabelCell; virtual; + procedure CreateRecurrencePattern; virtual; + procedure CreateRecurrencePatternCell; virtual; + procedure CreateRecurrencePatternLabelCell; virtual; + procedure CreateShowTimeAs; virtual; + procedure CreateShowTimeAsCell; virtual; + procedure CreateShowTimeAsLabelCell; virtual; + procedure CreateStart; virtual; + procedure CreateStartLabelCell; virtual; + procedure CreateSubject; virtual; + procedure CreateSubjectLabelCell; virtual; + function GetHeaderCellText: string; virtual; + function GetRecurrenceCellText: string; virtual; + function GetRecurrencePatternCellText: string; virtual; + function GetShowTimeAsCellText: string; virtual; + public + procedure CalculateLayout(AWidth, ATimeWidth: Integer); override; + + property CaptionLabelCell: TdxReportCellString read FCaptionLabelCell; + property HeaderCell: TdxReportCellString read FHeaderCell; + property LocationCell: TdxReportCellString read FLocationCell; + property LocationLabelCell: TdxReportCellString read FLocationLabelCell; + property ShowTimeAsCell: TdxReportCellString read FShowTimeAsCell; + property ShowTimeAsLabelCell: TdxReportCellString read FShowTimeAsLabelCell; + property StartLabelCell: TdxReportCellString read FStartLabelCell; + property FinishLabelCell: TdxReportCellString read FFinishLabelCell; + property RecurrenceCell: TdxReportCellString read FRecurrenceCell; + property RecurrenceLabelCell: TdxReportCellString read FRecurrenceLabelCell; + property RecurrencePatternCell: TdxReportCellString read FRecurrencePatternCell; + property RecurrencePatternLabelCell: TdxReportCellString read FRecurrencePatternLabelCell; + end; + + { TcxSchedulerReportCommonCellsProducer } + + TcxSchedulerReportCommonCellsProducer = class(TcxCustomResourceViewAdapter) + private + FSite: TcxSchedulerReportSchedulingAreaCell; + FStyle: TcxCustomSchedulerReportLinkPrintStyle; + function GetStyles: TcxSchedulerReportLinkStyles; + protected + FBounds: TRect; + + procedure AfterCalculatePage; override; + + function CanCalculate: Boolean; override; + + procedure ConvertSchedulerCellToPSCells(AItem: TcxSchedulerCustomViewInfoItem; + AReportItemClass: TcxSchedulerReportCustomCellClass); virtual; + function CreateEventCell(AEventViewInfo: TcxSchedulerEventCellViewInfo): TcxSchedulerReportEventCell; virtual; + + procedure DoInitialize( + var ASelectedDays: TcxSchedulerDateList; var AEvents: TcxSchedulerCachedEventList); override; + // layout settings + function GetCompressWeekends: Boolean; override; + function GetDontPrintWeekEnds: Boolean; override; + function GetHideSelection: Boolean; override; + function GetPageBounds: TRect; override; + function GetPagesPerWeek: Byte; override; + function GetPrintExactlyOneMonth: Boolean; override; + function GetPrintRange(Index: Integer): TDateTime; override; + function GetPrimaryPage: Boolean; override; + function GetStylesAdapter: IcxSchedulerStylesAdapter; override; + // styles + procedure SetCellViewParams(ACell: TdxReportVisualItem; const AParams: TcxViewParams); virtual; + public + constructor CreateEx(AStyle: TcxCustomSchedulerReportLinkPrintStyle; + ASite: TcxSchedulerReportSchedulingAreaCell); virtual; + procedure GetPageResources(AResources: TcxObjectList); override; + procedure Produce; virtual; + property Site: TcxSchedulerReportSchedulingAreaCell read FSite; + property Style: TcxCustomSchedulerReportLinkPrintStyle read FStyle; + property Styles: TcxSchedulerReportLinkStyles read GetStyles; + end; + + TcxSchedulerReportCommonCellsProducerClass = class of TcxSchedulerReportCommonCellsProducer; + + { TcxSchedulerReportWeeksCellsProducer } + + TcxSchedulerReportWeeksCellsProducer = class(TcxSchedulerReportCommonCellsProducer) + end; + + { TcxSchedulerReportDailyCellsProducer } + + TcxSchedulerReportDailyCellsProducer = class(TcxSchedulerReportCommonCellsProducer) + private + FRulerSite: TcxSchedulerReportDailyTimeRulerCellsSite; + protected + procedure AfterCalculatePage; override; + procedure BeforeCalculatePage; override; + + function CreateTimeRulerSite: TcxSchedulerReportDailyTimeRulerCellsSite; virtual; + procedure ConvertSchedulerCellToPSCells(AItem: TcxSchedulerCustomViewInfoItem; + AReportItemClass: TcxSchedulerReportCustomCellClass); override; + end; + + { TcxSchedulerReportYearlyCellsProducer } + + TcxSchedulerReportYearlyCellsProducer = class(TcxSchedulerReportCommonCellsProducer, + IUnknown, IcxSchedulerYearViewAdapter) + private + function GetIsPrimaryPage: Boolean; + function GetStyle: TcxSchedulerReportLinkYearlyPrintStyle; + protected + FFirstMonth: Integer; + { IUnknown } + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + { IcxSchedulerYearViewAdapter } + function GetDayCountPerPage: Integer; virtual; + function GetMonthCount: Integer; virtual; + function GetFirstMonth: Integer; virtual; + function GetShowMonthHeaders: Boolean; virtual; + function GetShowWeekDayHeaders: Boolean; virtual; + function GetStartDayIndex: Integer; virtual; + + property IsPrimaryPage: Boolean read GetIsPrimaryPage; + property Style: TcxSchedulerReportLinkYearlyPrintStyle read GetStyle; + public + procedure Produce; override; + end; + +var + SpecialSymbolFont: TFont; + +implementation + +{$R *.dfm} +{$R dxPScxSchedulerLnk.res} + +uses + Messages, ShlObj, dxPSUtl, dxPSRes, dxPSPopupMan, Math, +{$IFDEF DELPHI6} + DateUtils, Types, +{$ENDIF} + ActiveX, CommCtrl, dxPSTextOut; + +const + IDB_DXPSSCHEDULER_STYLEDESIGNPREVIEW = 'IDB_DXPSSCHEDULER_STYLEDESIGNPREVIEW'; + IDB_DXPSSCHEDULER_SMALLDESIGNPREVIEW = 'IDB_DXPSSCHEDULER_SMALLDESIGNPREVIEW'; + dxFormatShowDaysWithEventsInBold = dxPSGlbl.dxFormatCheckEnabled; + dxFormatDayIsBold = dxPSGlbl.dxFormatCheckChecked; + + cxYearStyleDaysOnPrimaryPage = 18; + +type + TLongRec = packed record + Bytes: array [0..3] of Byte; + end; + + TControlAccess = class(TControl); + TcxSchedulerCachedEventListAccess = class(TcxSchedulerCachedEventList); + +var + MirrorClasses: TList; + StyleImages: TImageList; + SchedulerFontHandle: THandle; + SchedulerFontFileName: string; + StylePreviewImages: TImageList; + StyleSheetPrototype: TcxSchedulerReportLinkStyleSheet; + +function cxCompareEventsOrder( + AEvent1, AEvent2: TcxSchedulerControlEvent): Integer; +var + AAllDay1, AAllDay2: Boolean; +begin + Result := 0; + AAllDay1 := AEvent1.AllDayEvent or (AEvent1.Duration >= 1); + AAllDay2 := AEvent2.AllDayEvent or (AEvent2.Duration >= 1); + if DateOf(AEvent1.Start) = DateOf(AEvent2.Start) then + Result := Byte(AAllDay2) - Byte(AAllDay1); + if Result <> 0 then Exit; + if AEvent1.Start < AEvent2.Start then + Result := -1 + else + if AEvent1.Start > AEvent2.Start then + Result := 1 + else + if AEvent1.Finish > AEvent2.Finish then + Result := -1 + else + if AEvent1.Finish < AEvent2.Finish then + Result := 1 + else + if AEvent1.RecordIndex < AEvent2.RecordIndex then + Result := -1 + else + if AEvent1.RecordIndex > AEvent2.RecordIndex then + Result := 1 + else + Result := 0; +end; + +{$IFNDEF DELPHI6} +function StartOfTheDay(const AValue: TDateTime): TDateTime; +begin + Result := Trunc(AValue); +end; + +function EndOfTheDay(const AValue: TDateTime): TDateTime; +begin + Result := Trunc(AValue) + EncodeTime(23, 59, 59, 999); +end; + +function StartOfTheWeek(const AValue: TDateTime): TDateTime; +begin + Result := Trunc(AValue) - (DayOfTheWeek(AValue) - 1); +end; + +function EndOfTheWeek(const AValue: TDateTime): TDateTime; +begin + Result := EndOfTheDay(StartOfTheWeek(AValue) + 6); +end; + +{$ENDIF} + +procedure Rect2RectsVert(const ASource: TRect; var R1, R2: TRect); overload; +begin + R1 := ASource; + R2 := ASource; + R1.Bottom := (ASource.Bottom + ASource.Top - InterAreaSpace) div 2; + R2.Top := R1.Bottom + InterAreaSpace; +end; + +procedure Rect2RectsVert(const ASource: TRect; var R1, R2, R3: TRect); overload; +var + H: Integer; +begin + R1 := ASource; + R2 := ASource; + R3 := ASource; + H := ASource.Bottom - ASource.Top; + R1.Bottom := ASource.Top + MulDiv(H, 1, 3); + R2.Top := R1.Bottom + InterAreaSpace; + R2.Bottom := ASource.Top + MulDiv(H, 2, 3); + R3.Top := R2.Bottom + InterAreaSpace; +end; + +procedure Rect2RectsHorz(const ASource: TRect; var R1, R2: TRect); overload; +begin + R1 := ASource; + R2 := ASource; + R1.Right := (ASource.Left + ASource.Right - InterAreaSpace) div 2; + R2.Left := R1.Right + InterAreaSpace; +end; + +procedure Rect2RectsHorz(const ASource: TRect; var R1, R2, R3: TRect); overload; +var + W: Integer; +begin + R1 := ASource; + R2 := ASource; + R3 := ASource; + W := ASource.Right - ASource.Left; + R1.Right := ASource.Left + MulDiv(W, 1, 3); + R2.Left := R1.Right + InterAreaSpace; + R2.Right := ASource.Left + MulDiv(W, 2, 3); + R3.Left := R2.Right + InterAreaSpace; +end; + +function AdditionalWidth(const ABounds: TRect): Integer; +begin + with ABounds do + Result := Round((Right - Left) * NotesAreaWidth) - InterAreaSpace div 2; +end; + +procedure SplitToRects(const ASource: TRect; AShowCalendar, + AIsRightArea: Boolean; out R1, R2: TRect); +begin + R1 := ASource; + R2 := ASource; + if AShowCalendar then + begin + if AIsRightArea then + begin + R2.Left := R2.Right - AdditionalWidth(R1); + R1.Right := R2.Left - InterAreaSpace; + end + else + begin + R2.Right := R2.Left + AdditionalWidth(R1); + R1.Left := R2.Right + InterAreaSpace; + end; + end; +end; + +function SchedulerLinkStyleSheetPrototype: TcxSchedulerReportLinkStyleSheet; + + function CreateStyle(AColor, AFontColor: TColor): TcxStyle; + begin + Result := TcxStyle.Create(StyleSheetPrototype); + with Result do + begin + Color := AColor; + Font.Name := dxPSCore.dxPSDefaultFontName; + Font.Color := AFontColor; + end; + end; + +begin + if StyleSheetPrototype = nil then + begin + StyleSheetPrototype := TcxSchedulerReportLinkStyleSheet.Create(nil); + with StyleSheetPrototype.Styles as TcxSchedulerReportLinkStyles do + begin + SchedulerHeader := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + Content := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + DateNavigatorContent := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + DateNavigatorHeader := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + DayHeader := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Event := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + ResourceHeader := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + NotesAreaBlank := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + NotesAreaLined := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + TaskPad := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + TimeRuler := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + end; + end; + Result := StyleSheetPrototype; +end; + +function FindMirorClassForItem(AItem: TObject; + var APSItemClass: TcxSchedulerReportCustomCellClass): Boolean; +var + I: Integer; +begin + APSItemClass := nil; + Result := False; + for I := MirrorClasses.Count - 1 downto 0 do + begin + APSItemClass := MirrorClasses[I]; + if AItem.InheritsFrom(APSItemClass.SchedulerCellClass) then + begin + Result := True; + Break; + end; + end; +end; + +{ TcxSchedulerReportLinkRenderInfo } + +procedure TcxSchedulerReportLinkRenderInfo.DoCalculate; +var + I: Integer; +begin + if not IsLoading then + begin + if (ReportLink <> nil) and (ReportLink.PrintStyles.ActiveStyle <> nil) then + begin + FPageColCount := Byte(ReportLink.PrintStyles.ActiveStyle.Layout) + 1; + FPageRowCount := ReportLink.PageSites.Count; + end + else + begin + FPageColCount := 1; + FPageRowCount := 1; + end; + end; + if (ReportLink = nil) or (ReportLink.ReportCells <> nil) and (ReportLink.ReportCells.Count > 0) then + begin + inherited DoCalculate; + for I := 0 to PageRenderInfoCount - 1 do + with PageRenderInfos[I] do + TitleOffset := DataOffset; + end; +end; + +function TcxSchedulerReportLinkRenderInfo.GetPageColCount: Integer; +begin + if not IsLoading then + Result := 1//FPageColCount + else + Result := inherited GetPageColCount; +end; + +function TcxSchedulerReportLinkRenderInfo.GetPageRowCount: Integer; +begin + if not IsLoading then + Result := FPageRowCount + else + Result := inherited GetPageRowCount; +end; + +function TcxSchedulerReportLinkRenderInfo.IsLoading: Boolean; +begin + Result := ReportLink.DataSource = rldsExternalStorage; +end; + +function TcxSchedulerReportLinkRenderInfo.IsDrawPageTitleOnPage( + APageIndex: Integer): Boolean; +begin + Result := Rendering and IsDrawReportTitleOnPage(APageIndex); +end; + +function TcxSchedulerReportLinkRenderInfo.IsDrawReportTitleOnPage( + APageIndex: Integer): Boolean; +begin + case ReportLink.ReportTitleMode of + tmNone: + Result := False; + tmOnFirstPage: + Result := APageIndex = 0; + else + Result := APageIndex mod FPageColCount = 0; + end; +end; + +function TcxSchedulerReportLinkRenderInfo.GetReportLink: TcxSchedulerReportLink; +begin + Result := TcxSchedulerReportLink(inherited ReportLink); +end; + +{ TcxSchedulerReportRenderer } + +procedure TcxSchedulerReportRenderer.PrepareRenderPage; +begin + inherited PrepareRenderPage; + TcxSchedulerReportLinkRenderInfo(RenderInfo).Rendering := True; +end; + +procedure TcxSchedulerReportRenderer.UnprepareRenderPage; +begin + TcxSchedulerReportLinkRenderInfo(RenderInfo).Rendering := False; + inherited UnprepareRenderPage; +end; + +{ TcxSchedulerReportLink } + +constructor TcxSchedulerReportLink.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FPageSites := TList.Create; + FLookAndFeelItems := TList.Create; + FSupportImages := True; +end; + +destructor TcxSchedulerReportLink.Destroy; +begin + FreeAndNil(FPageSites); + FreeAndNil(FLookAndFeelItems); + inherited Destroy; +end; + +procedure TcxSchedulerReportLink.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLink then + with TcxSchedulerReportLink(Source) do + begin + Self.PrintRange := PrintRange; + Self.PrintStyles := PrintStyles; + end; + inherited; +end; + +class function TcxSchedulerReportLink.Aggregable: Boolean; +begin + Result := False; +end; + +procedure TcxSchedulerReportLink.LoadDataFromStream(AStream: TStream); +const + SupportImagesVersion: TdxPSVersion = (Major: 3; Minor: 5; SubMinor: 5); +var + AStorageInfo: TdxPSDataStorageInfo; +begin + if PossibleDataStorage(AStream, True) then + begin + CopyDataStreamFrom(AStream); + AStorageInfo := ExtractStorageInfo(DataStream); + if AStorageInfo <> nil then + begin + FSupportImages := ComparePSVersions(AStorageInfo.PrintingSystemVersion, SupportImagesVersion) >= 0; + AStorageInfo.Free; + end; + DataStream.Position := 0; + if DataSource <> rldsExternalStorage then + DataSource := rldsExternalStorage + else + if IsRebuildNeededAndAllowed(True) then + RebuildReport; + end; +end; + +procedure TcxSchedulerReportLink.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited; + if (TaskPadReportLink = AComponent) and (Operation = opRemove) then + TaskPadReportLink := nil; +end; + +// IdxReportLinkController +function TcxSchedulerReportLink.GetControlSiteBounds(AControl: TControl): TRect; +begin + if PrintStyles.ActiveStyle <> nil then + Result := PrintStyles.ActiveStyle.GetControlSiteBounds(AControl) + else + Result := NullRect; +end; + +procedure TcxSchedulerReportLink.ConstructReport(AReportCells: TdxReportCells); + + procedure CalculateSizes; + + procedure CalculateReportPartSizes(ACell: TdxReportCell); + var + Width, I, V: Integer; + begin + if ACell.CellCount > 0 then + begin + Width := 0; + for I := 0 to ACell.CellCount - 1 do + begin + V := ACell.Cells[I].Width; + if Width < V then Width := V; + end; + ACell.BoundsRect := MakeRect(0, 0, Width, ACell.LastCell.BoundsRect.Bottom); + end; + end; + + begin + with AReportCells do + begin + CalculateReportPartSizes(Cells); + if AreFooterCellsAllocated then CalculateReportPartSizes(FooterCells); + if AreHeaderCellsAllocated then CalculateReportPartSizes(HeaderCells); + end; + end; + +begin + if Scheduler = nil then Exit; + inherited; + + if PrintStyles.ActiveStyle = nil then + Exit; + + PrepareConstruct; + try + BuildStyle; + if not AbortBuilding then CalculateSizes; + finally + UnprepareConstruct; + end; +end; + +procedure TcxSchedulerReportLink.DoCreateReport; +begin + if (PrintStyles.ActiveStyle = nil) or not PrintStyles.ActiveStyleAssigned then + PrintStyles.SetActiveStyleEx(PrintStyles.GetCorrespondingStyle); + inherited DoCreateReport; +end; + +procedure TcxSchedulerReportLink.GetImageLists(AProc: TdxPSGetImageListProc); +begin + inherited; + if HasEventImages then + AProc(Scheduler.EventImages); + if HasResourceImages then + AProc(Scheduler.Storage.Resources.Images); +end; + +function TcxSchedulerReportLink.GetRealScaleFactor: Integer; +begin + Result := 100; +end; + +procedure TcxSchedulerReportLink.CustomDraw(AItem: TAbstractdxReportCellData; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); +begin + case AItem.GetCustomDrawID of + cdidSchedulerContent: + DoCustomDrawContentCell(ACanvas, TcxSchedulerReportContentCell(AItem), ADone); + cdidSchedulerSchedulerHeader: + DoCustomDrawSchedulerHeaderCell(ACanvas, TcxSchedulerReportSchedulerHeaderDataCell(AItem), ADone); + cdidSchedulerDateNavigatorHeader: + DoCustomDrawDateNavigatorHeaderCell(ACanvas, TcxSchedulerReportDateNavigatorHeader(AItem), ADone); + cdidSchedulerDateNavigatorDay: + DoCustomDrawDateNavigatorDayCell(ACanvas, TcxSchedulerReportDateNavigatorDay(AItem), ADone); + cdidSchedulerDateNavigatorDayCaption: + DoCustomDrawDateNavigatorDayCaptionCell(ACanvas, TcxSchedulerReportDateNavigatorDayCaption(AItem), ADone); + cdidSchedulerDateNavigatorWeekNumber: + DoCustomDrawDateNavigatorWeekNumberCell(ACanvas, TcxSchedulerReportDateNavigatorWeekNumber(AItem), ADone); + cdidSchedulerTimeRuler: + DoCustomDrawTimeRulerCell(ACanvas, TcxSchedulerReportDailyTimeRulerCell(AItem), ADone); + cdidSchedulerEventCaption..cdidSchedulerEventTimeLine: + DoCustomDrawEventPartCell(ACanvas, AItem, ADone); + cdidSchedulerNotesArea: + DoCustomDrawNotesCell(ACanvas, TcxSchedulerReportNotesDataCell(AItem), ADone); + cdidSchedulerTaskPad: + DoCustomDrawTaskPadCell(ACanvas, TcxSchedulerReportNotesDataCell(AItem), ADone); + cdidSchedulerHeader: + DoCustomDrawHeaderCell(ACanvas, TcxSchedulerReportHeaderItemCell(AItem), ADone); + end; +end; + +procedure TcxSchedulerReportLink.DoCanPrintEvent(AEvent: TcxSchedulerEvent; + var AllowPrint: Boolean); +begin + if Assigned(FOnCanPrintEvent) then + FOnCanPrintEvent(Self, AEvent, AllowPrint); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawSchedulerHeaderCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportSchedulerHeaderDataCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawSchedulerHeaderCell) then + FOnCustomDrawSchedulerHeaderCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawDateNavigatorHeaderCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorHeader; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawDateNavigatorHeaderCell) then + FOnCustomDrawDateNavigatorHeaderCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawDateNavigatorDayCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorDay; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawDateNavigatorDayCell) then + FOnCustomDrawDateNavigatorDayCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawDateNavigatorDayCaptionCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorDayCaption; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawDateNavigatorDayCaptionCell) then + FOnCustomDrawDateNavigatorDayCaptionCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawDateNavigatorWeekNumberCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorWeekNumber; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawDateNavigatorWeekNumberCell) then + FOnCustomDrawDateNavigatorWeekNumberCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawTimeRulerCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportDailyTimeRulerCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawTimeRulerCell) then + FOnCustomDrawTimeRulerCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawContentCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportContentCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawContentCell) then + FOnCustomDrawContentCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawHeaderCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportHeaderItemCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawHeaderCell) then + FOnCustomDrawHeaderCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawEventPartCell( + ACanvas: TCanvas; AItem: TAbstractdxReportCellData; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawEventPartCell) then + FOnCustomDrawEventPartCell(Self, ACanvas, AItem, + TcxSchedulerReportEventPartType(AItem.GetCustomDrawID - cdidSchedulerEventCaption), + ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawNotesCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportNotesDataCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawNotesCell) then + FOnCustomDrawNotesCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawTaskPadCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportNotesDataCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawTaskPadCell) then + FOnCustomDrawTaskPadCell(Self, ACanvas, AItem, ADone); +end; + +function TcxSchedulerReportLink.GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; +begin + if PrintStyles.ActiveStyle <> nil then + Result := PrintStyles.ActiveStyle.GetRebuildOnPageParamsChange(AUpdateCodes) + else + Result := inherited GetRebuildOnPageParamsChange(AUpdateCodes); +end; + +function TcxSchedulerReportLink.GetRendererClass: TdxPSReportRendererClass; +begin + Result := TcxSchedulerReportRenderer; +end; + +function TcxSchedulerReportLink.GetRenderInfoClass: TdxPSReportRenderInfoClass; +begin + Result := TcxSchedulerReportLinkRenderInfo; +end; + +procedure TcxSchedulerReportLink.InternalRestoreDefaults; +begin + inherited; + PrintRange.RestoreDefaults; + PrintStyles.RestoreDefaults; +end; + +procedure TcxSchedulerReportLink.RebuildReport; +begin + inherited RebuildReport; + if DesignWindow <> nil then + DesignWindow.UpdatePreview; +end; + +procedure TcxSchedulerReportLink.PrepareConstruct; +begin + FLookAndFeelItems.Clear; + inherited PrepareConstruct; +end; + +procedure TcxSchedulerReportLink.UnprepareConstruct; +begin + FormatLookAndFeelItems; + inherited UnprepareConstruct; +end; + +procedure TcxSchedulerReportLink.CreateOptions; +begin + inherited CreateOptions; + FPrintRange := CreatePrintRange; + FPrintStyles := CreatePrintStyles; +end; + +procedure TcxSchedulerReportLink.DestroyOptions; +begin + FreeAndNil(FPrintStyles); + FreeAndNil(FPrintRange); + inherited DestroyOptions; +end; + +function TcxSchedulerReportLink.GetOptionsFormattingClass: TdxCustomReportLinkOptionsFormattingClass; +begin + Result := TcxSchedulerReportLinkOptionsFormatting; +end; + +function TcxSchedulerReportLink.CreatePrintRange: TcxSchedulerReportLinkPrintRange; +begin + Result := TcxSchedulerReportLinkPrintRange.Create(Self); +end; + +function TcxSchedulerReportLink.CreatePrintStyles: TcxSchedulerReportLinkPrintStyles; +begin + Result := TcxSchedulerReportLinkPrintStyles.Create(Self); +end; + +function TcxSchedulerReportLink.HasEventImages: Boolean; +begin + Result := Assigned(Scheduler) and Assigned(Scheduler.EventImages); +end; + +function TcxSchedulerReportLink.HasResourceImages: Boolean; +begin + Result := Assigned(Scheduler) and Assigned(Scheduler.Storage) and Assigned(Scheduler.Storage.Resources.Images) ; +end; + +function TcxSchedulerReportLink.GetAreNativeStylesAvailable: Boolean; +begin + Result := OptionsFormatting.UseNativeStyles; +end; + +function TcxSchedulerReportLink.GetStylesClass: TdxCustomReportLinkStylesClass; +begin + Result := TcxSchedulerReportLinkStyles; +end; + +function TcxSchedulerReportLink.GetStyleSheetClass: TdxCustomReportLinkStyleSheetClass; +begin + Result := TcxSchedulerReportLinkStyleSheet; +end; + +function TcxSchedulerReportLink.GetStyleSheetPrototype: TdxCustomReportLinkStyleSheet; +begin + Result := SchedulerLinkStyleSheetPrototype; +end; + +procedure TcxSchedulerReportLink.ActivePrintStyleChanged; +begin + if not IsDestroying and not IsLoading then + begin + if Active then + begin + FreeRenderInfos; + FreeRenderer; + RebuildReport; + end; + DoActivePrintStyleChanged; + end; +end; + +procedure TcxSchedulerReportLink.DoActivePrintStyleChanged; +begin + if Assigned(FOnActivePrintStyleChanged) then FOnActivePrintStyleChanged(Self); +end; + +procedure TcxSchedulerReportLink.FormatLookAndFeelItems; +const + Borders3D: array[Boolean] of TdxPSCellBorderClass = + (TdxPSCellRaisedBorder, TdxPSCellRaisedSoftBorder); +var + I: Integer; +begin + for I := 0 to LookAndFeelItemCount - 1 do + with LookAndFeelItems[I] do + if Effects3D then + BorderClass := Borders3D[Soft3D] + else + BorderClass := TdxPSCellUltraFlatBorder; +end; + +procedure TcxSchedulerReportLink.RegisterLookAndFeelItem(AItem: TdxReportVisualItem; + AEdgeStyle: TdxCellEdgeStyle); +begin + AItem.EdgeMode := Self.EdgeMode; + AItem.Edge3DStyle := AEdgeStyle; + FLookAndFeelItems.Add(AItem); +end; + +procedure TcxSchedulerReportLink.DoInitializeSchedulingAreaCell( + AItem: TcxSchedulerReportSchedulingAreaCell); +begin + if Assigned(FOnInitializeSchedulingAreaCell) then + FOnInitializeSchedulingAreaCell(Self, AItem); +end; + +procedure TcxSchedulerReportLink.DoInitializeEventCell(AItem: TcxSchedulerReportCustomEventCell); +begin + if Assigned(FOnInitializeEventCell) then + FOnInitializeEventCell(Self, AItem); +end; + +procedure TcxSchedulerReportLink.DoInitializeHeaderPrimaryCell( + AItem: TcxSchedulerReportSchedulerHeaderCell); +begin + if Assigned(FOnInitializeHeaderPrimaryCell) then + FOnInitializeHeaderPrimaryCell(Self, AItem); +end; + +procedure TcxSchedulerReportLink.DoInitializeHeaderSecondaryCell( + AItem: TcxSchedulerReportSchedulerHeaderCell); +begin + if Assigned(FOnInitializeHeaderSecondaryCell) then + FOnInitializeHeaderSecondaryCell(Self, AItem); +end; + +procedure TcxSchedulerReportLink.DoInitializeNotesAreaCell( + AItem: TcxSchedulerReportNotesAreaCell); +begin + if Assigned(FOnInitializeNotesAreaCell) then + FOnInitializeNotesAreaCell(Self, AItem); +end; + +procedure TcxSchedulerReportLink.DoInitializeTaskPadCell( + AItem: TcxSchedulerReportTaskPadCell); +begin + if Assigned(FOnInitializeTaskPadCell) then + FOnInitializeTaskPadCell(Self, AItem); +end; + +procedure TcxSchedulerReportLink.AssignTaskPadData(ATaskPad: TcxSchedulerReportTaskPadCell); + + procedure CropData(ASite: TdxReportCell); + var + CropBounds, R: TRect; + I: Integer; + Cell: TdxReportCell; + begin + CropBounds := ASite.AbsoluteRect; + for I := ASite.CellCount - 1 downto 0 do + begin + Cell := ASite.Cells[I]; + if not IntersectRect(R, Cell.AbsoluteRect, CropBounds) then + Cell.Free; + end; + end; + +begin + if (TaskPadReportLink <> nil) and TaskPadReportLink.DataProviderPresent then + begin + TaskPadReportLink.Controller := Renderer.ReportLink; + try + TaskPadReportLink.RebuildReport; + ATaskPad.TaskPadDataSite.Assign(TaskPadReportLink.ReportCells.Cells); + CropData(ATaskPad.TaskPadDataSite); + ATaskPad.TaskPadDataSite.ClipChildren := True; + finally + TaskPadReportLink.Controller := nil; + end; + end; +end; + +procedure TcxSchedulerReportLink.InitializeTaskPadCell(ATaskPad: TcxSchedulerReportTaskPadCell); +begin + AssignTaskPadData(ATaskPad); + DoInitializeTaskPadCell(ATaskPad); +end; + +procedure TcxSchedulerReportLink.SetCellViewParams( + ACell: TdxReportVisualItem; const AParams: TcxViewParams); +var + AdxPSViewParams: TdxReportItemViewParams; +begin + if not Assigned(ACell) then Exit; + FillChar(AdxPSViewParams, SizeOf(AdxPSViewParams), 0); + AdxPSViewParams.NativeParams := AParams; + SetCellViewParams(ACell, AdxPSViewParams); +end; + +procedure TcxSchedulerReportLink.SetCellViewParams( + ACell: TdxReportVisualItem; const AParams: TdxReportItemViewParams); +var + AFont: TFont; + AHasBitmap: Boolean; +begin + if not Assigned(ACell) then Exit; + AFont := TFont.Create; + try + AFont.Assign(AParams.NativeParams.Font); + if not dxPSUtl.dxIsTrueTypeFont(AFont) then + AFont.Name := Font.Name; + AFont.Color := ColorToRGB(AParams.NativeParams.TextColor); + if AParams.FontSize <> 0 then + AFont.Size := AParams.FontSize; + AFont.Style := AFont.Style + AParams.FontStyle; + ACell.FontIndex := AddFontToPool(AFont); + ACell.Transparent := ACell.Transparent or AParams.Transparent; + with AParams.NativeParams do + begin + AHasBitmap := not OptionsFormatting.SuppressBackgroundBitmaps and + (Bitmap <> nil) and not Bitmap.Empty; + if AHasBitmap then + ACell.BackgroundBitmapIndex := AddBackgroundBitmapToPool(Bitmap); + end; + if OptionsFormatting.SuppressContentColoration and not AHasBitmap then + ACell.Color := clWhite + else + ACell.Color := ColorToRGB(AParams.NativeParams.Color); + finally + AFont.Free; + end; +end; + +function TcxSchedulerReportLink.AddPageSite( + const ABounds: TRect): TcxSchedulerReportPageSite; +begin + Result := TcxSchedulerReportPageSite.Create(ReportCells.Cells); + Result.BoundsRect := ABounds; + Result.CellSides := []; + Result.Transparent := True; + FPageSites.Add(Result); + AddVerticalDelimiter(Result); + AddHorizontalDelimiter(Result); +end; + +procedure TcxSchedulerReportLink.BuildStyle; +var + AImages: TCustomImageList; +begin + FPageSites.Clear; + if PrintStyles.ActiveStyle <> nil then + begin + AImages := nil; + with PrintStyles.ActiveStyle do + begin + try + if not ShowResourceImages and HasResourceImages then + begin + AImages := Scheduler.Storage.Resources.Images; + Scheduler.Storage.Resources.Images := nil; + end; + BeforeBuild; + RenderInfo.FPageColCount := Byte(PrintStyles.ActiveStyle.Layout) + 1; + try + Build; + finally + AfterBuild; + end; + finally + if AImages <> nil then + Scheduler.Storage.Resources.Images := AImages; + end; + end; + end; +end; + +function TcxSchedulerReportLink.GetActiveStyles: TcxSchedulerReportLinkStyles; +begin + Result := inherited ActiveStyles as TcxSchedulerReportLinkStyles; +end; + +function TcxSchedulerReportLink.GetDesignWindow: TcxfmSchedulerReportLinkDesignWindow; +begin + Result := inherited DesignWindow as TcxfmSchedulerReportLinkDesignWindow; +end; + +function TcxSchedulerReportLink.GetEdgeMode: TdxCellEdgeMode; +const + EdgeModeMap: array[Boolean] of TdxCellEdgeMode = (cemPattern, cem3DEffects); +begin + Result := EdgeModeMap[OptionsFormatting.LookAndFeelKind <> lfUltraFlat]; +end; + +function TcxSchedulerReportLink.GetLookAndFeelItem(Index: Integer): TdxReportVisualItem; +begin + Result := TdxReportVisualItem(FLookAndFeelItems[Index]); +end; + +function TcxSchedulerReportLink.GetLookAndFeelItemCount: Integer; +begin + Result := FLookAndFeelItems.Count; +end; + +function TcxSchedulerReportLink.GetOptionsFormatting: TcxSchedulerReportLinkOptionsFormatting; +begin + Result := inherited OptionsFormatting as TcxSchedulerReportLinkOptionsFormatting; +end; + +function TcxSchedulerReportLink.GetPrintStyles: TcxSchedulerReportLinkPrintStyles; +begin + Result := FPrintStyles; +end; + +function TcxSchedulerReportLink.GetRenderInfo: TcxSchedulerReportLinkRenderInfo; +begin + Result := TcxSchedulerReportLinkRenderInfo(inherited RenderInfo); +end; + +function TcxSchedulerReportLink.GetScheduler: TcxScheduler; +begin + Result := Component as TcxScheduler; +end; + +function TcxSchedulerReportLink.GetStyles: TcxSchedulerReportLinkStyles; +begin + Result := inherited Styles as TcxSchedulerReportLinkStyles; +end; + +procedure TcxSchedulerReportLink.SetOptionsFormatting(Value: TcxSchedulerReportLinkOptionsFormatting); +begin + inherited OptionsFormatting := Value; +end; + +procedure TcxSchedulerReportLink.SetPrintRange(Value: TcxSchedulerReportLinkPrintRange); +begin + PrintRange.Assign(Value); +end; + +procedure TcxSchedulerReportLink.SetPrintStyles(Value: TcxSchedulerReportLinkPrintStyles); +begin + FPrintStyles.Assign(Value); +end; + +procedure TcxSchedulerReportLink.SetStyles(Value: TcxSchedulerReportLinkStyles); +begin + inherited Styles := Value; +end; + +procedure TcxSchedulerReportLink.SetTaskPadReportLink(Value: TBasedxReportLink); +begin + if (Value <> Self) and (FTaskPadReportLink <> Value) then + begin + FTaskPadReportLink := Value; + if FTaskPadReportLink <> nil then + FTaskPadReportLink.FreeNotification(Self); + LinkModified(True); + end; +end; + +{ TcxSchedulerReportLinkPrintRange } + +procedure TcxSchedulerReportLinkPrintRange.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLinkPrintRange then + with TcxSchedulerReportLinkPrintRange(Source) do + begin + Move(FDatePrint, Self.FDatePrint[0], SizeOf(FDatePrint)); + Move(FTimePrint, Self.FTimePrint[0], SizeOf(FTimePrint)); + end; + inherited Assign(Source); +end; + +procedure TcxSchedulerReportLinkPrintRange.RestoreDefaults; +begin + inherited RestoreDefaults; + FDatePrint[0] := NullDate; + FDatePrint[1] := NullDate; + FTimePrint[0] := NullDate; + FTimePrint[1] := NullDate; +end; + +function TcxSchedulerReportLinkPrintRange.DefaultDatePrintFrom: TDate; +begin + if Scheduler <> nil then + Result := Scheduler.CurrentView.FirstVisibleDate + else + Result := Date; +end; + +function TcxSchedulerReportLinkPrintRange.DefaultDatePrintTo: TDate; +begin + if Scheduler <> nil then + Result := Scheduler.CurrentView.LastVisibleDate + else + Result := Date; +end; + +function TcxSchedulerReportLinkPrintRange.DefaultTimePrintFrom: TTime; +begin + if Scheduler <> nil then + Result := Scheduler.OptionsView.WorkStart + else + Result := 0; +end; + +function TcxSchedulerReportLinkPrintRange.DefaultTimePrintTo: TTime; +begin + if Scheduler <> nil then + Result := Scheduler.OptionsView.WorkFinish + else + Result := 0; +end; + +procedure TcxSchedulerReportLinkPrintRange.CheckTimeRange; +begin +{ if (PrintTo - PrintFrom) < 0 then + FPrintTo := DateOf(PrintFrom) + TimeOf(FPrintTo);} +end; + +function TcxSchedulerReportLinkPrintRange.GetDateTimeIF( + const AValue, ADefaultValue: TDateTime): TDateTime; +begin + Result := AValue; + if Trunc(Result) = NullDate then + Result := ADefaultValue; +end; + +function TcxSchedulerReportLinkPrintRange.DesignerTabIndex: Integer; +begin + Result := 0; +end; + +function TcxSchedulerReportLinkPrintRange.GetActiveStyle: TcxCustomSchedulerReportLinkPrintStyle; +begin + Result := ReportLink.PrintStyles.ActiveStyle; +end; + +function TcxSchedulerReportLinkPrintRange.GetDayCount: Integer; +begin + Result := Trunc(PrintTo) - Trunc(PrintFrom) + 1; + if Result < 1 then + Result := 1; +end; + +function TcxSchedulerReportLinkPrintRange.GetMonthCount: Integer; + + function MonthOfDate(const ADate: TDateTime): Integer; + var + Y, M, D: Word; + begin + DecodeDate(ADate, Y, M, D); + Result := Y * 12 + M; + end; + +begin + Result := MonthOfDate(PrintTo) - MonthOfDate(PrintFrom) + 1; +end; + +function TcxSchedulerReportLinkPrintRange.GetPrintDate(AIndex: Integer): TDate; +var + DefaultDate: TTime; +begin + if AIndex = 0 then + DefaultDate := DefaultDatePrintFrom + else + DefaultDate := DefaultDatePrintTo; + Result := GetDateTimeIF(DateOf(FDatePrint[AIndex]), DefaultDate); +end; + +function TcxSchedulerReportLinkPrintRange.GetPrintTime(AIndex: Integer): TTime; +var + DefaultTime: TTime; +begin + if AIndex = 0 then + DefaultTime := DefaultTimePrintFrom + else + DefaultTime := DefaultTimePrintTo; + Result := TimeOf(GetDateTimeIF(FTimePrint[AIndex], DefaultTime)); +end; + +function TcxSchedulerReportLinkPrintRange.GetWeekCount: Integer; +begin + Result := WeeksBetween(StartOfTheWeek(PrintFrom), IncDay(EndOfTheWeek(PrintTo))); + if Result < 1 then + Result := 1; +end; + +function TcxSchedulerReportLinkPrintRange.GetYearCount: Integer; +begin + Result := YearOf(PrintTo) - YearOf(PrintFrom) + 1; + if Result < 1 then + Result := 1; +end; + +procedure TcxSchedulerReportLinkPrintRange.SetPrintDate( + AIndex: Integer; const Value: TDate); +begin + if FDatePrint[AIndex] <> Value then + begin + FDatePrint[AIndex] := Value; + Changed; + end; +end; + +procedure TcxSchedulerReportLinkPrintRange.SetPrintTime( + AIndex: Integer; const Value: TTime); +begin + if FTimePrint[AIndex] <> Value then + begin + FTimePrint[AIndex] := Value; + Changed; + end; +end; + +function TcxSchedulerReportLinkPrintRange.IsDateStored( + AIndex: Integer): Boolean; +begin + Result := FDatePrint[AIndex] <> NullDate; +end; + +function TcxSchedulerReportLinkPrintRange.IsTimeStored( + AIndex: Integer): Boolean; +begin + Result := FTimePrint[AIndex] <> NullDate; +end; + +{ TcxSchedulerReportLinkOptionsFormatting } + +procedure TcxSchedulerReportLinkOptionsFormatting.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxSchedulerReportLinkOptionsFormatting then + with TcxSchedulerReportLinkOptionsFormatting(Source) do + begin + Self.SuppressContentColoration := SuppressContentColoration; + end; +end; + +procedure TcxSchedulerReportLinkOptionsFormatting.RestoreDefaults; +begin + inherited; + SuppressContentColoration := False; +end; + +function TcxSchedulerReportLinkOptionsFormatting.DesignerTabIndex: Integer; +begin + Result := 2; +end; + +function TcxSchedulerReportLinkOptionsFormatting.GetReportLink: TcxSchedulerReportLink; +begin + Result := inherited ReportLink as TcxSchedulerReportLink; +end; + +procedure TcxSchedulerReportLinkOptionsFormatting.SetSuppressContentColoration(Value: Boolean); +begin + if FSuppressContentColoration <> Value then + begin + FSuppressContentColoration := Value; + Changed; + end; +end; + +{ TcxCustomSchedulerReportLinkOptions } + +function TcxCustomSchedulerReportLinkOptions.GetReportLink: TcxSchedulerReportLink; +begin + Result := inherited ReportLink as TcxSchedulerReportLink; +end; + +function TcxCustomSchedulerReportLinkOptions.GetScheduler: TcxScheduler; +begin + if ReportLink <> nil then + Result := ReportLink.Scheduler + else + Result := nil; +end; + +{ TcxSchedulerReportLinkStyles } + +constructor TcxSchedulerReportLinkStyles.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + BitmapInViewParams := True; +end; + +procedure TcxSchedulerReportLinkStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxSchedulerReportLinkStyles then + with TcxSchedulerReportLinkStyles(Source) do + begin + Self.SchedulerHeader := SchedulerHeader; + Self.Content := Content; + Self.DateNavigatorContent := DateNavigatorContent; + Self.DateNavigatorHeader := DateNavigatorHeader; + Self.DayHeader := DayHeader; + Self.Event := Event; + Self.ResourceHeader := ResourceHeader; + Self.NotesAreaBlank := NotesAreaBlank; + Self.NotesAreaLined := NotesAreaLined; + Self.TaskPad := TaskPad; + Self.TimeRuler := TimeRuler; + end; +end; + +function TcxSchedulerReportLinkStyles.GetSchedulerHeaderParams: TcxViewParams; +begin + GetViewParams(vspsSchedulerSchedulerHeader, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetContentParams(const ADateTime: TDateTime; + AResource: TcxSchedulerStorageResourceItem): TcxViewParams; +begin + if UseSchedulerStyles then + Result := ExtStyles.GetContentParams(ADateTime, AResource) + else + GetViewParams(vspsSchedulerContent, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetContentParams(const ADateTime: TDateTime; + ALightColor: Boolean; AResource: TcxSchedulerStorageResourceItem): TcxViewParams; +begin + if UseSchedulerStyles then + Result := ExtStyles.GetContentParams(ADateTime, ALightColor, AResource) + else + GetViewParams(vspsSchedulerContent, nil, nil, Result) +end; + +function TcxSchedulerReportLinkStyles.GetDateNavigatorContentParams: TcxViewParams; +begin + if UseSchedulerStyles then + begin + Result := TcxSchedulerDateNavigator( + ExtStyles.Scheduler.DateNavigator).Styles.GetContentParams + end + else + GetViewParams(vspsSchedulerDateNavigatorContent, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetDateNavigatorHeaderParams: TcxViewParams; +begin + if UseSchedulerStyles then + begin + Result := TcxSchedulerDateNavigator( + ExtStyles.Scheduler.DateNavigator).Styles.GetHeaderParams + end + else + GetViewParams(vspsSchedulerDateNavigatorHeader, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetDayHeaderParams( + const ADateTime: TDateTime): TcxViewParams; +begin + if UseSchedulerStyles then + Result := ExtStyles.GetDayHeaderParams(ADateTime) + else + GetViewParams(vspsSchedulerDayHeader, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetEventParams( + AEvent: TcxSchedulerEvent): TcxViewParams; +begin + if UseSchedulerStyles then + Result := ExtStyles.GetEventContentParams(AEvent) + else + GetViewParams(vspsSchedulerEvent, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetNotesAreaBlankParams: TcxViewParams; +begin + GetViewParams(vspsSchedulerNotesAreaBlank, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetNotesAreaLinedParams: TcxViewParams; +begin + GetViewParams(vspsSchedulerNotesAreaLined, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetResourceHeaderParams( + AResource: TcxSchedulerStorageResourceItem): TcxViewParams; +begin + if UseSchedulerStyles then + Result := ExtStyles.GetResourceHeaderParams(AResource) + else + GetViewParams(vspsSchedulerResourceHeader, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetTaskPadParams: TcxViewParams; +begin + GetViewParams(vspsSchedulerTaskPad, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetTimeRulerParams: TcxViewParams; +begin + if UseSchedulerStyles then + Result := ReportLink.Scheduler.ViewDay.Styles.GetTimeRulerParams + else + GetViewParams(vspsSchedulerTimeRuler, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.DesignerTabIndex: Integer; +begin + Result := 3; +end; + +procedure TcxSchedulerReportLinkStyles.GetDefaultViewParams(Index: Integer; + AData: TObject; out AParams: TcxViewParams); +const + FixedParts = [vspsSchedulerDayHeader, vspsSchedulerResourceHeader, vspsSchedulerTimeRuler]; +begin + inherited; + if ReportLink <> nil then + with AParams do + begin + if Index in FixedParts then + Color := dxPSCore.dxDefaultFixedColor + else + Color := dxDefaultContentColor; + Font := ReportLink.Font; + TextColor := Font.Color; + end; +end; + +class function TcxSchedulerReportLinkStyles.GetStyleCaption(AnIndex: Integer): string; +begin + case AnIndex of + vspsSchedulerSchedulerHeader: + Result := cxGetResourceString(@sdxSchedulerSchedulerHeader); + vspsSchedulerContent: + Result := cxGetResourceString(@sdxSchedulerContent); + vspsSchedulerDateNavigatorContent: + Result := cxGetResourceString(@sdxSchedulerDateNavigatorContent); + vspsSchedulerDateNavigatorHeader: + Result := cxGetResourceString(@sdxSchedulerDateNavigatorHeader); + vspsSchedulerDayHeader: + Result := cxGetResourceString(@sdxSchedulerDayHeader); + vspsSchedulerEvent: + Result := cxGetResourceString(@sdxSchedulerEvent); + vspsSchedulerResourceHeader: + Result := cxGetResourceString(@sdxSchedulerResourceHeader); + vspsSchedulerNotesAreaBlank: + Result := cxGetResourceString(@sdxSchedulerNotesAreaBlank); + vspsSchedulerNotesAreaLined: + Result := cxGetResourceString(@sdxSchedulerNotesAreaLined); + vspsSchedulerTaskPad: + Result := cxGetResourceString(@sdxSchedulerTaskPad); + else {vspsSchedulerTimeRuler} + Result := cxGetResourceString(@sdxSchedulerTimeRuler); + end; +end; + +function TcxSchedulerReportLinkStyles.GetStyleIndexByCaption(const Caption: string): Integer; +begin + for Result := vspsSchedulerFirst to vspsSchedulerLast do + if dxPSUtl.dxSameText(Caption, GetStyleCaption(Result)) then + Exit; + Result := -1; +end; + +// IcxSchedulerStylesAdapter +function TcxSchedulerReportLinkStyles.GetDayHeaderStyle: TcxStyle; +begin + if UseSchedulerStyles then + Result := ExtStyles.DayHeader + else + Result := DayHeader; +end; + +function TcxSchedulerReportLinkStyles.GetResourceHeaderStyle: TcxStyle; +begin + if UseSchedulerStyles then + Result := ExtStyles.ResourceHeader + else + Result := ResourceHeader; +end; + +function TcxSchedulerReportLinkStyles.GetExtStyles: TcxSchedulerStyles; +begin + Result := ReportLink.Scheduler.Styles; +end; + +function TcxSchedulerReportLinkStyles.GetReportLink: TcxSchedulerReportLink; +begin + Result := inherited ReportLink as TcxSchedulerReportLink; + if Result = nil then + Result := FReportLink; +end; + +function TcxSchedulerReportLinkStyles.GetUseSchedulerStyles: Boolean; +begin + if ReportLink = nil then + begin + Result := False; + Exit; + end; + Result := not ReportLink.OptionsFormatting.UseNativeStyles; + if not Result then + Result := (ReportLink = nil) or (ReportLink.Scheduler = nil); +end; + +{ TcxSchedulerReportLinkStyleSheet } + +class function TcxSchedulerReportLinkStyleSheet.GetStylesClass: TcxCustomStylesClass; +begin + Result := TcxSchedulerReportLinkStyles; +end; + +function TcxSchedulerReportLinkStyleSheet.GetStylesValue: TcxSchedulerReportLinkStyles; +begin + if GetStyles is TcxSchedulerReportLinkStyles then + Result := TcxSchedulerReportLinkStyles(GetStyles) + else + Result := nil; +end; + +procedure TcxSchedulerReportLinkStyleSheet.SetStylesValue(Value: TcxSchedulerReportLinkStyles); +begin + SetStyles(Value); +end; + +{ TcxSchedulerReportLinkPrintStyles } + +procedure TcxSchedulerReportLinkPrintStyles.Assign(Source: TPersistent); +var + I: Integer; +begin + if Source is TcxSchedulerReportLinkPrintStyles then + for I := 0 to Count - 1 do + Items[I] := TcxSchedulerReportLinkPrintStyles(Source).Items[I]; + inherited; +end; + +procedure TcxSchedulerReportLinkPrintStyles.RestoreDefaults; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].RestoreDefaults; + inherited; +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleByClass( + AClass: TcxCustomSchedulerReportLinkPrintStyleClass): TcxCustomSchedulerReportLinkPrintStyle; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I]; + if Result.ClassType = AClass then Exit; + end; + Result := nil; +end; + +function TcxSchedulerReportLinkPrintStyles.GetCorrespondingStyle: TcxCustomSchedulerReportLinkPrintStyle; +begin + Result := nil; + if Scheduler = nil then Exit; + Result := GetStyleByView(Scheduler.CurrentView) +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleByName( + const Name: string): TcxCustomSchedulerReportLinkPrintStyle; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I]; + if CompareText(Result.Caption, Name) = 0 then Exit; + end; + Result := nil; +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleByView( + View: TcxSchedulerCustomView): TcxCustomSchedulerReportLinkPrintStyle; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I]; + if Result.IsCompatibleWith(View) then Exit; + end; + Result := nil; +end; + +function TcxSchedulerReportLinkPrintStyles.IndexOf(AItem: TcxCustomSchedulerReportLinkPrintStyle): Integer; +begin + Result := FItems.IndexOf(AItem); +end; + +procedure TcxSchedulerReportLinkPrintStyles.CreateObjects; +begin + inherited CreateObjects; + FItems := TList.Create; + CreateStyles; +end; + +procedure TcxSchedulerReportLinkPrintStyles.DestroyObjects; +begin + DestroyStyles; + FreeAndNil(FItems); + inherited DestroyObjects; +end; + +function TcxSchedulerReportLinkPrintStyles.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +function TcxSchedulerReportLinkPrintStyles.CreateStyle( + AStyleClass: TcxCustomSchedulerReportLinkPrintStyleClass): TcxCustomSchedulerReportLinkPrintStyle; +begin + Result := AStyleClass.Create(Self); + FItems.Add(Result); +end; + +procedure TcxSchedulerReportLinkPrintStyles.CreateStyles; +begin + CreateStyle(TcxSchedulerReportLinkDailyPrintStyle); + CreateStyle(TcxSchedulerReportLinkWeeklyPrintStyle); + CreateStyle(TcxSchedulerReportLinkMonthlyPrintStyle); + CreateStyle(TcxSchedulerReportLinkTrifoldPrintStyle); + CreateStyle(TcxSchedulerReportLinkDetailsPrintStyle); + CreateStyle(TcxSchedulerReportLinkMemoPrintStyle); + CreateStyle(TcxSchedulerReportLinkYearlyPrintStyle); +end; + +procedure TcxSchedulerReportLinkPrintStyles.DestroyStyles; +var + I: Integer; +begin + for I := Count - 1 downto 0 do + Items[I].Free; + FItems.Clear; +end; + +procedure TcxSchedulerReportLinkPrintStyles.GetStyleByClassEx( + AClass: TcxCustomSchedulerReportLinkPrintStyleClass; var AInstance); +begin + TPersistent(AInstance) := GetStyleByClass(AClass); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetActiveStyleEx( + Value: TcxCustomSchedulerReportLinkPrintStyle); +begin + if (ActiveStyle <> Value) or ActiveStyleAssigned then + begin + FActiveStyle := Value; + ActiveStyleAssigned := False; + end; +end; + +procedure TcxSchedulerReportLinkPrintStyles.ActiveStyleChanged; +begin + if ReportLink <> nil then + ReportLink.ActivePrintStyleChanged; +end; + +procedure TcxSchedulerReportLinkPrintStyles.StyleChanged(AStyle: TcxCustomSchedulerReportLinkPrintStyle); +begin + Changed; +end; + +function TcxSchedulerReportLinkPrintStyles.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxSchedulerReportLinkPrintStyles.GetItem( + Index: Integer): TcxCustomSchedulerReportLinkPrintStyle; +begin + Result := TcxCustomSchedulerReportLinkPrintStyle(FItems[Index]); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleDaily: TcxSchedulerReportLinkDailyPrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkDailyPrintStyle, Result); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleDetails: TcxSchedulerReportLinkDetailsPrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkDetailsPrintStyle, Result); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleMemo: TcxSchedulerReportLinkMemoPrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkMemoPrintStyle, Result); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleMonthly: TcxSchedulerReportLinkMonthlyPrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkMonthlyPrintStyle, Result); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleTrifold: TcxSchedulerReportLinkTrifoldPrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkTrifoldPrintStyle, Result); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleWeekly: TcxSchedulerReportLinkWeeklyPrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkWeeklyPrintStyle, Result); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleYearly: TcxSchedulerReportLinkYearlyPrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkYearlyPrintStyle, Result); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetActiveStyle( + Value: TcxCustomSchedulerReportLinkPrintStyle); +begin + if (FActiveStyle <> Value) or not FActiveStyleAssigned then + begin + FActiveStyle := Value; + FActiveStyleAssigned := Value <> nil; + ActiveStyleChanged; + DesignerModified; + end; +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetActiveStyleAssigned( + Value: Boolean); +begin + if FActiveStyleAssigned <> Value then + begin + FActiveStyleAssigned := Value; + DesignerModified; + end; +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetItem(Index: Integer; + Value: TcxCustomSchedulerReportLinkPrintStyle); +begin + Items[Index].Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleDaily( + Value: TcxSchedulerReportLinkDailyPrintStyle); +begin + Daily.Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleDetails( + Value: TcxSchedulerReportLinkDetailsPrintStyle); +begin + GetStyleDetails.Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleMemo( + Value: TcxSchedulerReportLinkMemoPrintStyle); +begin + GetStyleMemo.Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleMonthly( + Value: TcxSchedulerReportLinkMonthlyPrintStyle); +begin + Monthly.Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleTrifold( + Value: TcxSchedulerReportLinkTrifoldPrintStyle); +begin + GetStyleTrifold.Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleWeekly( + Value: TcxSchedulerReportLinkWeeklyPrintStyle); +begin + Weekly.Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleYearly( + Value: TcxSchedulerReportLinkYearlyPrintStyle); +begin + Yearly.Assign(Value); +end; + +{ TcxCustomSchedulerReportLinkPrintStyle } + +constructor TcxCustomSchedulerReportLinkPrintStyle.Create(AStyles: TcxSchedulerReportLinkPrintStyles); +begin + inherited Create; + FStyles := AStyles; + FCaption := DefaultCaption; + CreateObjects; + RestoreDefaults; +end; + +destructor TcxCustomSchedulerReportLinkPrintStyle.Destroy; +begin + Active := False; + DestroyObjects; + inherited Destroy; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.Assign(Source: TPersistent); +var + ASource: TcxCustomSchedulerReportLinkPrintStyle; +begin + if Source is TcxCustomSchedulerReportLinkPrintStyle then + begin + ASource := TcxCustomSchedulerReportLinkPrintStyle(Source); + Caption := ASource.Caption; + CompressWeekends := ASource.CompressWeekends; + DontPrintWeekends := ASource.DontPrintWeekends; + Layout := ASource.Layout; + ResourceCountPerPage := ASource.ResourceCountPerPage; + ShowNotesAreaBlank := ASource.ShowNotesAreaBlank; + ShowNotesAreaLined := ASource.ShowNotesAreaLined; + ShowTaskPad := ASource.ShowTaskPad; + if SupportTimeRange then + begin + TimePrintFrom := ASource.TimePrintFrom; + TimePrintTo := ASource.TimePrintTo; + end; + ShowEventImages := ASource.ShowEventImages; + end + else + inherited; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.DefaultCaption: string; +begin + Result := ''; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IsCompatibleWith(AView: TcxSchedulerCustomView): Boolean; +begin + Result := False; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.RestoreDefaults; +begin + FCaption := DefaultCaption; + FCompressWeekends := True; + FDontPrintWeekends := False; + FLayout := pslOnePage; + ResourceCountPerPage := 0; + ShowNotesAreaBlank := False; + ShowNotesAreaLined := False; + ShowTaskPad := False; + if SupportTimeRange and (Scheduler <> nil) then + begin + TimePrintFrom := TimeOf(Scheduler.OptionsView.WorkStart); + TimePrintTo := TimeOf(Scheduler.OptionsView.WorkFinish); + end; +end; + +// IdxReportLinkController +function TcxCustomSchedulerReportLinkPrintStyle.GetControlSiteBounds(AControl: TControl): TRect; +begin + Result := NullRect; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.Build; +begin + FBoldedDays := TcxSchedulerDateList.Create; + try + if Storage <> nil then + begin + Events.SelStart := PrintRange.PrintFrom - 30; + Events.SelFinish := PrintRange.PrintTo + 30; + Storage.GetEvents(Events, Events.SelStart, Events.SelFinish); + end; + Events.ExtractUsedDays(FBoldedDays); + PrepareEvents; + BuildPages; + Events.Clear; + UsedDays.Clear; + finally + FreeAndNil(FBoldedDays); + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.BuildPages; +var + I: Integer; +begin + for I := 0 to PeriodCount - 1 do + begin + CreateLayoutForPeriod(I); + Progress(100 * (I + 1) / PeriodCount); + if ReportLink.AbortBuilding or ReportLink.LinkInPreviewMode then Break; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.BuildSchedulerCells( + ASite: TcxSchedulerReportSchedulingAreaCell); +var + APageIndex, APeriodIndex, ASubIndex: Integer; +begin + APageIndex := ASite.PageIndex; + GetPagePeriodAndIndex(APageIndex, APeriodIndex, ASubIndex); + FillDatesForPage(ASite.VisibleDays, APageIndex, APeriodIndex, ASubIndex); + with CreateSchedulingCellsProducer(ASite) do + try + Produce; + finally + Free; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.PrepareEvents; +var + I: Integer; + AEvent: TcxSchedulerEvent; + AllowPrint: Boolean; +begin + for I := 0 to FEvents.AbsoluteCount - 1 do + begin + AEvent := FEvents.AbsoluteItems[I]; + AllowPrint := True; + DoCanPrintEvent(AEvent, AllowPrint); + if not AllowPrint then + FEvents.Remove(AEvent); + end; + FEvents.Sort(TcxCompareEventsProc(@cxCompareEventsOrder)); + TcxSchedulerCachedEventListAccess(FEvents).Changed; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.DoCanPrintEvent( + AEvent: TcxSchedulerEvent; var AllowPrint: Boolean); +begin + ReportLink.DoCanPrintEvent(AEvent, AllowPrint); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.Progress(APercentDone: Double); +begin + if ReportLink <> nil then + ReportLink.DoProgress(APercentDone); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.AfterBuild; +begin + VisualStyles.FReportLink := nil; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.BeforeBuild; +begin + VisualStyles.FReportLink := ReportLink; + CurrentDate := PrintRange.PrintFrom; + FPagesPerPeriod := GetPagesPerPeriod; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.QueryInterface(const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +function TcxCustomSchedulerReportLinkPrintStyle._AddRef: Integer; +begin + Result := 1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle._Release: Integer; +begin + Result := 1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetDC: HDC; +begin + Result := ReportLink.Renderer.DC; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetDisplayGraphicsAsText: Boolean; +begin + Result := ReportLink.OptionsRefinements.DisplayGraphicsAsText; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetEndEllipsis: Boolean; +begin + Result := False; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetFlatCheckMarks: Boolean; +begin + Result := ReportLink.OptionsRefinements.FlatCheckMarks; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetGraphicsText: string; +begin + Result := ReportLink.OptionsRefinements.GraphicsText; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetMultiline: Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetTransparentGraphics: Boolean; +begin + Result := ReportLink.OptionsRefinements.TransparentGraphics; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams2_GetPreviewMarginLeft: Integer; +begin + Result := 2; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams2_GetPreviewMarginRight: Integer; +begin + Result := 2; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams2_GetPreviewMaxHeight: Integer; +begin + Result := -1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams2_GetPreviewMaxLineCount: Integer; +begin + Result := -1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams2_GetRichEditGraphicClass: TGraphicClass; +const + GraphicClasses: array[Boolean] of TGraphicClass = (TMetafile, TBitmap); +begin + Result := GraphicClasses[IdxPSCellParams2_GetRichEditTransparent]; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams2_GetRichEditTransparent: Boolean; +begin + {$IFDEF DXVER500} + Result := ReportLink.OptionsRefinements.TransparentRichEdits; + {$ELSE} + Result := False; + {$ENDIF} +end; + +function TcxCustomSchedulerReportLinkPrintStyle.AddPageSite( + const ABounds: TRect): TcxSchedulerReportPageSite; +begin + Result := ReportLink.AddPageSite(ABounds); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.Changed; +begin + if Styles <> nil then Styles.StyleChanged(Self); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreateObjects; +begin + FUsedDays := TcxSchedulerDateList.Create; + FEvents := TcxSchedulerCachedEventList.Create; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.DestroyObjects; +begin + FEvents.Free; + FUsedDays.Free; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPageCount: Integer; +begin + Result := 0; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetRebuildOnPageParamsChange( + AnUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetActualDatePrintFrom: TDate; +begin + if PrintRange <> nil then + Result := PrintRange.PrintFrom + else + Result := 0; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetActualDatePrintTo: TDate; +begin + if PrintRange <> nil then + Result := PrintRange.PrintTo + else + Result := 0; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetCorrespondedView: TcxSchedulerCustomResourceView; +begin + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPagesPerPeriod: Integer; +begin + Result := 1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetGlyphIndex: Integer; +begin + Result := -1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPreviewGlyphIndex: Integer; +begin + Result := GetGlyphIndex; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetSchedulerHeaderParams: TdxReportItemViewParams; +begin + FillChar(Result, SizeOf(Result), 0); + Result.NativeParams := VisualStyles.GetSchedulerHeaderParams; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.DrawDesignWindowPreview(ACanvas: TCanvas; const ABounds: TRect); +var + ALeft, ATop: Integer; +begin + with ABounds do + begin + ALeft := (Left + Right - StylePreviewImages.Width) div 2; + ATop := (Top + Bottom - StylePreviewImages.Height) div 2; + end; + StylePreviewImages.Draw(ACanvas, ALeft, ATop, PreviewGlyphIndex); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetResourcePageCount: Integer; +begin + Result := ResourceCountPerPage; + if Result = 0 then + Result := 1 + else + if ResourceCount > 0 then + begin + Result := ResourceCount div ResourceCountPerPage + + Byte(ResourceCount mod ResourceCountPerPage > 0); + end; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetShowDateNavigator( + APageIndex: Integer): Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetShowNotesAreaBlank: Boolean; +begin + Result := FShowNotesAreaBlank; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetBoolOption( + var AOption: Boolean; Value: Boolean); +begin + if AOption <> Value then + begin + AOption := Value; + Changed; + end; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.SupportTimeRange: Boolean; +begin + Result := False; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.SupportMessage: Boolean; +begin + Result := False; +end; + +// report cells creation + +function TcxCustomSchedulerReportLinkPrintStyle.CreateSchedulingAreaCell( + ASite: TdxReportCell): TcxSchedulerReportSchedulingAreaCell; +begin + Result := TcxSchedulerReportSchedulingAreaCell.Create(ASite); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; +begin + Result := TcxSchedulerReportCommonCellsProducer.CreateEx(Self, ASite); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CreateDateNavigatorCell( + ASite: TdxReportCell; AYear, AMonth: Word): TcxSchedulerReportDateNavigatorCell; +begin + with Scheduler.DateNavigator do + begin + Result := TcxSchedulerReportDateNavigatorCell.CreateEx(ASite, + ActualFirstWeekOfYear, AYear, AMonth, ShowDatesContainingEventsInBold, ShowWeekNumbers); + Result.FBoldedDays := Self.FBoldedDays; + end; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CreateHeaderCell( + ASite: TdxReportCell): TcxSchedulerReportSchedulerHeaderCell; +begin + Result := TcxSchedulerReportSchedulerHeaderCell.Create(ASite); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CreateNotesCell( + ASite: TdxReportCell): TcxSchedulerReportNotesAreaCell; +begin + Result := TcxSchedulerReportNotesAreaCell.CreateEx(ASite, False); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CreateNotesLinedCell( + ASite: TdxReportCell): TcxSchedulerReportNotesAreaCell; +begin + Result := TcxSchedulerReportNotesAreaCell.CreateEx(ASite, True); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CreateTaskPadCell( + ASite: TdxReportCell): TcxSchedulerReportTaskPadCell; +begin + Result := TcxSchedulerReportTaskPadCell.CreateEx(ASite, False); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.InitHeaderCell( + ACell: TcxSchedulerReportSchedulerHeaderCell); +begin + ReportLink.SetCellViewParams(ACell, GetSchedulerHeaderParams); + ReportLink.SetCellViewParams(ACell.Content, GetSchedulerHeaderParams); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.InitReportCell( + ACell: TdxReportCell; const ABounds: TRect): TdxReportCell; + + procedure InitAdditionalAreaCell(const AViewParams: TcxViewParams); + begin + ReportLink.SetCellViewParams(ACell, AViewParams); + ReportLink.SetCellViewParams(TcxSchedulerReportNotesAreaCell( + ACell).DataCell, AViewParams); + end; + +begin + ACell.BoundsRect := ABounds; + Result := ACell; + if ReportLink = nil then Exit; + ACell.Transparent := not ReportLink.OptionsFormatting.UseNativeStyles; + if ACell is TcxSchedulerReportPageItemCell then + begin + case TcxSchedulerReportPageItemCell(ACell).GetType of + srSchedulingArea: + begin + BuildSchedulerCells(TcxSchedulerReportSchedulingAreaCell(ACell)); + ReportLink.DoInitializeSchedulingAreaCell( + TcxSchedulerReportSchedulingAreaCell(ACell)); + end; + srHeader: + InitHeaderCell(TcxSchedulerReportSchedulerHeaderCell(ACell)); + srNotesBlank: + begin + InitAdditionalAreaCell(VisualStyles.GetNotesAreaBlankParams); + ReportLink.DoInitializeNotesAreaCell( + TcxSchedulerReportNotesAreaCell(ACell)); + end; + srNotesLined: + begin + InitAdditionalAreaCell(VisualStyles.GetNotesAreaLinedParams); + ReportLink.DoInitializeNotesAreaCell( + TcxSchedulerReportNotesAreaCell(ACell)); + end; + srTaskPad: + begin + InitAdditionalAreaCell(VisualStyles.GetTaskPadParams); + ReportLink.InitializeTaskPadCell( + TcxSchedulerReportTaskPadCell(ACell)); + end; + end; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CorrectBoundsWithHeader( + AHeader: TcxSchedulerReportSchedulerHeaderCell; var ABounds: TRect); +begin + if not AHeader.Visible then + ABounds.Top := 0 + else + ABounds.Top := AHeader.BoundsRect.Bottom + InterAreaSpace; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreateAdditionalControls( + ASite: TdxReportCell; AHasCalendar, AHasTaskPad, AHasNotes, + AHasNotesLined, ARightSide: Boolean; var ABounds: TRect); +var + R: array[0..2] of TRect; + C: Integer; + + function GetAreaBounds(AllowShow: Boolean; + var ABounds: TRect; var AIndex: Integer): Boolean; + begin + Result := AllowShow; + if not Result then Exit; + ABounds := R[AIndex]; + Inc(AIndex); + end; + + procedure CreateCells; + var + AIndex: Integer; + ABounds: TRect; + begin + AIndex := 0; + if GetAreaBounds(AHasTaskPad, ABounds, AIndex) then + InitReportCell(CreateTaskPadCell(ASite), ABounds); + if GetAreaBounds(AHasNotes, ABounds, AIndex) then + InitReportCell(CreateNotesCell(ASite), ABounds); + if GetAreaBounds(AHasNotesLined, ABounds, AIndex) then + InitReportCell(CreateNotesLinedCell(ASite), ABounds); + end; + +begin + C := Byte(AHasTaskPad) + Byte(AHasNotes) + Byte(AHasNotesLined); + if C = 0 then Exit; + SplitToRects(ABounds, AHasCalendar, ARightSide, ABounds, R[0]); + if C = 2 then + Rect2RectsVert(R[0], R[0], R[1]) + else + if C = 3 then + begin + if AHasCalendar then + Rect2RectsVert(R[0], R[0], R[1], R[2]) + else + begin + Rect2RectsVert(R[0], R[1], R[0]); + Rect2RectsHorz(R[1], R[1], R[2]); + end; + end; + CreateCells; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreateControlsOnFirstPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +begin +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreateControlsOnSecondPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +begin +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreateHeaderDateNavigator( + AHeader: TcxSchedulerReportSchedulerHeaderCell; APageIndex: Integer; out ABounds: TRect); +var + R: TRect; + Y, M, D: Word; + AHeight, H, ALeft: Integer; + CP, HP: TdxReportItemViewParams; + ACell: TcxSchedulerReportDateNavigatorCell; +begin + FillChar(CP, SizeOf(CP), 0); + FillChar(HP, SizeOf(HP), 0); + AHeight := ABounds.Bottom - ABounds.Top; + CP.NativeParams := VisualStyles.GetDateNavigatorContentParams; + HP.NativeParams := VisualStyles.GetDateNavigatorHeaderParams; + HP.Transparent := not ReportLink.OptionsFormatting.UseNativeStyles; + GetPageDateNavigatorInfo(APageIndex, Y, M); + ACell := CreateDateNavigatorCell(AHeader, Y, M); + H := ACell.MeasureDateNavigatorHeight(CP.NativeParams, HP.NativeParams); + if H > AHeight then + ACell.AdjustSize(CP, HP, H, AHeight); + R.TopLeft := Point(0, 0); + R.BottomRight := TPoint(ACell.CalculateSize(CP, HP)); + OffsetRect(R, ABounds.Right - ABounds.Left - R.Right, 0); + InflateRect(R, 0, -3); + ACell.BoundsRect := R; + ALeft := R.Left; + if PrintRange.MonthCount > 1 then + begin + IncAMonth(Y, M, D); + ACell.BoundsRect := cxRectSetRight(R, R.Left); + ALeft := R.Left - (R.Right - R.Left); + ACell := CreateDateNavigatorCell(AHeader, Y, M); + if H > AHeight then + ACell.AdjustSize(CP, HP, H, AHeight); + ACell.CalculateSize(CP, HP); + ACell.BoundsRect := R; + end; + AHeader.Content.BoundsRect := MakeRect(ABounds.Left + cxTextOffset, + ABounds.Top + cxTextOffset, ALeft, ABounds.Bottom - cxTextOffset); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreateLayoutForPeriod( + APeriodIndex: Integer); +var + APageIndex: Integer; + R: TRect; + APage: TcxSchedulerReportPageSite; + AHeader: TcxSchedulerReportSchedulerHeaderCell; +begin + APageIndex := GetPageIndex(APeriodIndex, 0); + CreatePageSiteWithHeader(APageIndex, APage, AHeader, R); + CorrectBoundsWithHeader(AHeader, R); + CreateControlsOnFirstPage(APageIndex, APage, AHeader, R); + if Layout = pslTwoPages then + begin + CreatePageSiteWithHeader(APageIndex + 1, APage, AHeader, R, False); + CorrectBoundsWithHeader(AHeader, R); + CreateControlsOnSecondPage(APageIndex + 1, APage, AHeader, R); + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreatePageSiteWithHeader( + APageIndex: Integer; out ASite: TcxSchedulerReportPageSite; + out AHeader: TcxSchedulerReportSchedulerHeaderCell; + out ABounds: TRect; AIsPrimary: Boolean = True); +var + R: TRect; +begin + ABounds := GetPageSiteBounds(APageIndex); + ASite := AddPageSite(ABounds); + ASite.FPageIndex := APageIndex; + ASite.FPrimaryPage := AIsPrimary; + ABounds := ASite.GetInnerBounds(0); + if GetHasPageReportTitle(APageIndex) then + Inc(ABounds.Top, ReportLink.RenderInfo.CalculateTitleHeight); + if GetHasPageHeader(APageIndex) then + begin + R := ABounds; + R.Bottom := R.Top + GetPageHeaderHeight(R, APageIndex); + ABounds.Top := R.Bottom + InterAreaSpace; + AHeader := CreateHeaderCell(ASite); + Inc(R.Bottom, AHeader.BorderEdgeThicknesses[csBottom]); + InitReportCell(AHeader, R); + if GetShowDateNavigator(APageIndex) then + begin + R := AHeader.GetInnerBounds(0); + CreateHeaderDateNavigator(TcxSchedulerReportSchedulerHeaderCell(AHeader), APageIndex, R); + end; + AHeader.AdjustTextSize; + if AIsPrimary then + ReportLink.DoInitializeHeaderPrimaryCell(AHeader) + else + ReportLink.DoInitializeHeaderSecondaryCell(AHeader); + end; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CanSplitSchedulingOnTwoPages: Boolean; +begin + Result := Layout = pslTwoPages; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetHasPageHeader( + APageIndex: Integer): Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetHasPageReportTitle( + APageIndex: Integer): Boolean; +begin + case ReportLink.ReportTitleMode of + tmNone: + Result := False; + tmOnFirstPage: + Result := APageIndex div (Byte(Layout) + 1) = 0; + else + Result := True; + end; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPageHeaderHeight( + const ASiteBounds: TRect; APageIndex: Integer): Integer; +var + AMin, AMax: Integer; +begin + Result := 0; + AMin := Round((ASiteBounds.Bottom - ASiteBounds.Top) * SchedulerHeaderMinHeight); + AMax := Round((ASiteBounds.Bottom - ASiteBounds.Top) * SchedulerHeaderMaxHeight); + if GetShowDateNavigator(APageIndex) and (ReportLink <> nil) then + begin + with VisualStyles do + Result := TcxSchedulerReportDateNavigatorCell.MeasureDateNavigatorHeight( + GetDateNavigatorContentParams, GetDateNavigatorHeaderParams); + end; + Result := Max(Min(AMax, Result), AMin); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPageIndex( + APeriodIndex, AIndex: Integer): Integer; +begin + Result := (APeriodIndex * (Byte(Layout) + 1) + AIndex); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.GetPagePeriodAndIndex( + APageIndex: Integer; var APeriodIndex, ASubIndex: Integer); +begin + ASubIndex := 0; + if Layout = pslTwoPages then + begin + APeriodIndex := APageIndex div 2; + ASubIndex := APageIndex mod 2; + end + else + APeriodIndex := APageIndex; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPageSiteBounds( + APageIndex: Integer): TRect; +begin + Result := MakeBounds(0, 0, ReportLink.PageWidth, ReportLink.PageHeight); + OffsetRect(Result, 0, APageIndex * ReportLink.PageHeight); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetStartOfWeekOffset: Integer; +begin + Result := 0; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.GetPageDateNavigatorInfo( + APageIndex: Integer; out AYear, AMonth: Word); +var + ADate: TDateTime; + ADayCount: Integer; +begin + ADayCount := APageIndex * GetDaysPerPeriod div + ((Byte(Layout) + 1) * GetResourcePageCount); + ADate := PrintRange.PrintFrom + ADayCount; + AYear := YearOf(ADate); + AMonth := MonthOf(ADate); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetDaysPerPeriod: Integer; +begin + Result := 1; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.FillDatesForPage( + ADateList: TcxSchedulerDateList; APageIndex, APeriodIndex, ASubIndex: Integer); +begin +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetActive: Boolean; +begin + if Styles <> nil then + Result := (Styles.ActiveStyle = Self) and Styles.ActiveStyleAssigned + else + Result := False; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetHasAdditionalArea: Boolean; +begin + Result := ShowNotesAreaBlank or ShowNotesAreaLined or ShowTaskPad; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetIndex: Integer; +begin + if Styles <> nil then + Result := Styles.IndexOf(Self) + else + Result := -1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPageSite( + AIndex: Integer): TcxSchedulerReportPageSite; +begin + if ReportLink <> nil then + Result := TcxSchedulerReportPageSite(ReportLink.PageSites[AIndex]) + else + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPeriodCount: Integer; +begin + Result := PageCount; + if Layout = pslTwoPages then + Result := Result div 2; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPrintRange: TcxSchedulerReportLinkPrintRange; +begin + if ReportLink <> nil then + Result := ReportLink.PrintRange + else + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetReportLink: TcxSchedulerReportLink; +begin + if Styles <> nil then + Result := Styles.ReportLink + else + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetResourceCount: Integer; +begin + if (Scheduler <> nil) and (Scheduler.Storage <> nil) and + (Scheduler.Storage.Resources.ResourceItems.VisibleResourceCount > 0) then + Result := Scheduler.Storage.Resources.ResourceItems.VisibleResourceCount + else + Result := 1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetScheduler: TcxScheduler; +begin + if ReportLink <> nil then + Result := ReportLink.Scheduler + else + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetStorage: TcxCustomSchedulerStorage; +begin + if Scheduler <> nil then + Result := Scheduler.Storage + else + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetTimePrintFrom: TTime; +begin + Result := TimeOf(PrintRange.TimePrintFrom); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetTimePrintTo: TTime; +begin + Result := TimeOf(PrintRange.TimePrintTo); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetVisualStyles: TcxSchedulerReportLinkStyles; +begin + if ReportLink <> nil then + Result := ReportLink.ActiveStyles + else + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IsCaptionStored: Boolean; +begin + Result := (FCaption <> DefaultCaption); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IsLayoutStored: Boolean; +begin + Result := Layout <> pslOnePage; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IsShowNotesAreaBlankStored: Boolean; +begin + Result := FShowNotesAreaBlank <> False; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IsActiveStored: Boolean; +begin + Result := Active and Styles.ActiveStyleAssigned; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetActive(Value: Boolean); +begin + if Styles <> nil then + begin + if Value then + Styles.ActiveStyle := Self + else + Styles.ActiveStyle := nil; + Styles.ActiveStyleAssigned := Value; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetCaption(const Value: string); +begin + if Caption <> Value then + begin + FCaption := Value; + Changed; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetCompressWeekends( + Value: Boolean); +begin + SetBoolOption(FCompressWeekends, Value); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetDontPrintWeekends( + Value: Boolean); +begin + SetBoolOption(FDontPrintWeekEnds, Value); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetLayout( + Value: TcxSchedulerReportLinkPeriodicPrintStyleLayout); +begin + if FLayout <> Value then + begin + FLayout := Value; + Changed; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetResourceCountPerPage( + Value: Integer); +begin + if FResourceCountPerPage <> Value then + begin + FResourceCountPerPage := Value; + Changed; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetShowEventImages(Value: Boolean); +begin + if FShowEventImages <> Value then + begin + FShowEventImages := Value; + Changed; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetShowNotesAreaBlank( + Value: Boolean); +begin + SetBoolOption(FShowNotesAreaBlank, Value); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetShowNotesAreaLined( + Value: Boolean); +begin + SetBoolOption(FShowNotesAreaLined, Value); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetShowResourceImages(Value: Boolean); +begin + if FShowResourceImages <> Value then + begin + FShowResourceImages := Value; + Changed; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetShowTaskPad(Value: Boolean); +begin + SetBoolOption(FShowTaskPad, Value); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetTimePrintFrom(Value: TTime); +begin + PrintRange.TimePrintFrom := Value; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetTimePrintTo(Value: TTime); +begin + PrintRange.TimePrintTo := Value; +end; + +{ TcxSchedulerReportLinkDailyPrintStyle } + +constructor TcxSchedulerReportLinkDailyPrintStyle.Create( + AStyles: TcxSchedulerReportLinkPrintStyles); +begin + inherited Create(AStyles); + FShowEventImages := True; + FShowResourceImages := True; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionDaily); +end; + +function TcxSchedulerReportLinkDailyPrintStyle.IsCompatibleWith( + AView: TcxSchedulerCustomView): Boolean; +begin + Result := (AView is TcxSchedulerDayView) or (AView is TcxSchedulerTimeGridView); +end; + +procedure TcxSchedulerReportLinkDailyPrintStyle.BeforeBuild; +begin + inherited BeforeBuild; + FCurrentPagePerDate := PagesPerPeriod; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.CanSplitSchedulingOnTwoPages: Boolean; +begin + Result := False; +end; + +procedure TcxSchedulerReportLinkDailyPrintStyle.CreateControlsOnFirstPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +begin + if Layout = pslOnePage then + CreateAdditionalControls(ASite, True, ShowTaskPad, + ShowNotesAreaBlank, ShowNotesAreaLined, True, ABounds); + InitReportCell(CreateSchedulingAreaCell(ASite), ABounds); +end; + +procedure TcxSchedulerReportLinkDailyPrintStyle.CreateControlsOnSecondPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +begin + CreateAdditionalControls(ASite, False, ShowTaskPad, + ShowNotesAreaBlank, ShowNotesAreaLined, True, ABounds); +end; + +function TcxSchedulerReportLinkDailyPrintStyle.CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; +begin + Result := TcxSchedulerReportDailyCellsProducer.CreateEx(Self, ASite); +end; + +procedure TcxSchedulerReportLinkDailyPrintStyle.FillDatesForPage( + ADateList: TcxSchedulerDateList; APageIndex, APeriodIndex, ASubIndex: Integer); +begin + APageIndex := APageIndex div (Byte(Layout) + 1) div GetResourcePageCount; + ADateList.Add(PrintRange.PrintFrom + APageIndex); +end; + +function TcxSchedulerReportLinkDailyPrintStyle.GetCorrespondedView: TcxSchedulerCustomResourceView; +begin + if Scheduler <> nil then + Result := Scheduler.ViewDay + else + Result := inherited GetCorrespondedView; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.GetGlyphIndex: Integer; +begin + Result := Byte(HasAdditionalArea); + if Layout = pslTwoPages then + Result := 2; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.GetPageCount: Integer; +begin + Result := GetResourcePageCount * PrintRange.DayCount * (Byte(Layout) + 1); +end; + +function TcxSchedulerReportLinkDailyPrintStyle.GetPagesPerPeriod: Integer; +var + I, J: Integer; +begin + if (ResourceCountPerPage = 0) or (ResourceCount < 2) then + Result := Byte(Layout) + 1 + else + begin + I := Min(ResourceCount, ResourceCountPerPage); + J := ResourceCount div I; + if J * I < ResourceCount then Inc(J); + Result := J * (Byte(Layout) + 1); + end; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.GetShowNotesAreaBlank: Boolean; +begin + Result := inherited GetShowNotesAreaBlank; + if not Result and (Layout <> pslOnePage) then + Result := not (ShowTaskPad or ShowNotesAreaLined); +end; + +procedure TcxSchedulerReportLinkDailyPrintStyle.InitHeaderCell( + ACell: TcxSchedulerReportSchedulerHeaderCell); +begin + ReportLink.SetCellViewParams(ACell, VisualStyles.GetSchedulerHeaderParams); + ACell.PrimaryText := DateTimeHelper.DateToLongDateStr(CurrentDate); + ACell.SecondaryText := LongDayNames[DayOfWeek(CurrentDate)]; + inherited InitHeaderCell(ACell); + Dec(FCurrentPagePerDate); + if FCurrentPagePerDate = 0 then + begin + CurrentDate := CurrentDate + 1; + FCurrentPagePerDate := PagesPerPeriod; + end; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.SupportMessage: Boolean; +begin + Result := True; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.SupportTimeRange: Boolean; +begin + Result := True; +end; + +{ TcxSchedulerReportLinkCustomDetailsPrintStyle } + +function TcxSchedulerReportLinkCustomDetailsPrintStyle.AddPageSite( + const ABounds: TRect): TcxSchedulerReportPageSite; +begin + Inc(BuildedPageCount); + Result := inherited AddPageSite(ABounds); +end; + +procedure TcxSchedulerReportLinkCustomDetailsPrintStyle.BeforeBuild; +begin + CurrentPage := nil; + CellsOnPage := 0; + BuildedPageCount := 0; + FTimeWidth := MeasureTimeWidth; + inherited BeforeBuild; +end; + +function TcxSchedulerReportLinkCustomDetailsPrintStyle.GetNextPage( + APrevPage: TcxSchedulerReportPageSite; out ABounds: TRect): TcxSchedulerReportPageSite; +begin + CellsOnPage := 0; + if APrevPage = nil then + Result := PageSites[0] + else + Result := AddPageSite(GetPageSiteBounds(BuildedPageCount)); + ABounds := Result.GetInnerBounds(0); + if GetHasPageReportTitle(BuildedPageCount - 1) then + Inc(ABounds.Top, ReportLink.RenderInfo.CalculateTitleHeight); +end; + +function TcxSchedulerReportLinkCustomDetailsPrintStyle.GetPageCount: Integer; +begin + Result := Max(1, BuildedPageCount); +end; + +function TcxSchedulerReportLinkCustomDetailsPrintStyle.MeasureTimeWidth: Integer; +var + AFont: TFont; +begin + AFont := ReportLink.Font; + if (VisualStyles.Event <> nil) and (cxStyles.svFont in VisualStyles.Event.AssignedValues) then + AFont := VisualStyles.Event.Font; + Result := cxTextWidth(AFont, '00:00 - 00:00') * 2; +end; + +function TcxSchedulerReportLinkCustomDetailsPrintStyle.GetPageWidth: Integer; +begin + Result := ReportLink.PageWidth; +end; + +{ TcxSchedulerReportLinkDetailsPrintStyle } + +procedure TcxSchedulerReportLinkDetailsPrintStyle.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLinkDetailsPrintStyle then + begin + PaginationMode := TcxSchedulerReportLinkDetailsPrintStyle(Source).PaginationMode; + UsePagination := TcxSchedulerReportLinkDetailsPrintStyle(Source).UsePagination; + end; + inherited Assign(Source); +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionDetails); +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.RestoreDefaults; +begin + PaginationMode := dpmByDay; + UsePagination := False; + inherited RestoreDefaults; +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.AddDayHeader(ADate: TDateTime; + AContinue: Boolean; var ABounds: TRect): TcxSchedulerReportSchedulerHeaderCell; +var + R: TRect; +begin + Result := TcxSchedulerReportSchedulerHeaderCell.Create(CurrentPage); + Result.Date := ADate; + R := cxRectSetHeight(ABounds, DayHeaderHeight); + ABounds.Top := R.Bottom + InterAreaSpace; + Result.Transparent := False; + Result.PrimaryText := GetDayHeaderText(AContinue); + InitReportCell(Result, R); + Result.Content.BoundsRect := Result.GetInnerBounds(0); + Result.AdjustTextSize; +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.BeforeBuild; +begin + PreviousHeader := nil; + CellsOnPage := 0; + inherited BeforeBuild; +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.BuildPages; +var + ADayEvents: TcxSchedulerEventList; +begin + ADayEvents := TcxSchedulerEventList.Create; + try + CellsOnPage := 0; + Site := nil; + DayIndex := 0; + while DayIndex < PrintRange.DayCount do + begin + ADayEvents.Clear; + Events.ExtractEvents(CurrentDate, ADayEvents); + Events.Sort(@cxCompareEventsOrder); + if (ADayEvents.Count > 0) and (Site = nil) then + begin + Site := AddPageSite(GetPageSiteBounds(0)); + PrepareNextPage; + end; + if (CellsOnPage > 0) and (ADayEvents.Count > 0) then + CheckPagination; + EventIndex := 0; + while EventIndex < ADayEvents.Count do + begin + CurrentCell := AddEventCell(ADayEvents[EventIndex]); + ReportLink.DoInitializeEventCell(CurrentCell); + if (CellsOnPage > 0) and (MeasureCellBounds.Bottom > CurrentPageBounds.Bottom) then + PrepareNextPage; + HeaderNeeded; + SetCellPlace; + Inc(EventIndex); + end; + CurrentDate := CurrentDate + 1; + Inc(DayIndex); + end; + finally + ADayEvents.Free; + end; +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.GetDayHeaderHeight: Integer; +var + DC: HDC; +begin + DC := GetDC(0); + try + Result := ReportLink.Renderer.CalcTextHeight(DC, 'Wg', False, GetSchedulerHeaderParams.NativeParams.Font) * 2; + finally + ReleaseDC(0, DC); + end +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.GetDayHeaderText(AContinue: Boolean): string; +begin + Result := DateTimeHelper.DateToLongDateStr(CurrentDate); + if AContinue then + Result := Result + ' ' + cxGetResourceString(@sdxContinuedMessage); +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.GetGlyphIndex: Integer; +begin + Result := 22; +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.GetPreviewGlyphIndex: Integer; +begin + Result := 16; +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.GetSchedulerHeaderParams: TdxReportItemViewParams; +begin + FillChar(Result, SizeOf(Result), 0); + Result.NativeParams := VisualStyles.GetDayHeaderParams(CurrentDate); + Include(Result.FontStyle, fsBold); +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.AddEventCell( + AEvent: TcxSchedulerEvent): TcxSchedulerReportDetailsEventCell; +begin + Result := TcxSchedulerReportDetailsEventCell.CreateEx(Site, AEvent, + CurrentDate, VisualStyles.GetEventParams(AEvent), + (AEvent.Start < CurrentDate) and (CurrentDate > PrintRange.PrintFrom)); + Result.CalculateLayout(PageWidth, TimeWidth); +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.CheckPagination; +begin + if not UsePagination then Exit; + case PaginationMode of + dpmByDay: + PrepareNextPage; + dpmByWeek: + if GetWeekNumber(CurrentDate, dSunday, fwySystem) <> + GetWeekNumber(PreviousHeader.Date, dSunday, fwySystem) then + PrepareNextPage; + dpmByMonth: + if MonthOf(CurrentDate) <> MonthOf(PreviousHeader.Date) then + PrepareNextPage; + end; +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.HeaderNeeded; +begin + if NeedAddDayHeader then + PreviousHeader := AddDayHeader(CurrentDate, EventIndex > 0, CurrentPageBounds); +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.NeedAddDayHeader: Boolean; +begin + Result := (CellsOnPage = 0) or (PreviousHeader = nil) or (PreviousHeader.Date <> CurrentDate); +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.MeasureCellBounds: TRect; +begin + Result := CurrentPageBounds; + Result.Bottom := Result.Top + CurrentCell.CalculateHeight; + if NeedAddDayHeader then + Inc(Result.Bottom, DayHeaderHeight); +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.PrepareNextPage; +begin + CurrentPage := GetNextPage(CurrentPage, CurrentPageBounds); +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.SetCellPlace; +begin + Inc(CellsOnPage); + CurrentCell.BoundsRect := MeasureCellBounds; + CurrentCell.Parent := CurrentPage; + CurrentPageBounds.Top := CurrentCell.BoundsRect.Bottom + InterAreaSpace; +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.SetPaginationMode( + Value: TcxSchedulerReportLinkDetailsPrintStylePaginationMode); +begin + if FPaginationMode <> Value then + begin + FPaginationMode := Value; + Changed; + end; +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.SetUsePagination( + Value: Boolean); +begin + SetBoolOption(FUsePagination, Value); +end; + +{ TcxSchedulerReportLinkMemoPrintStyle } + +procedure TcxSchedulerReportLinkMemoPrintStyle.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLinkMemoPrintStyle then + with TcxSchedulerReportLinkMemoPrintStyle(Source) do + begin + Self.FSelectedEventsOnly := FSelectedEventsOnly; + Self.FStartEachItemOnNewPage := FStartEachItemOnNewPage; + end; + inherited Assign(Source); +end; + +function TcxSchedulerReportLinkMemoPrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionMemo); +end; + +procedure TcxSchedulerReportLinkMemoPrintStyle.RestoreDefaults; +begin + FSelectedEventsOnly := True; + FStartEachItemOnNewPage := True; + inherited RestoreDefaults; +end; + +function TcxSchedulerReportLinkMemoPrintStyle.AddEventCell( + AEvent: TcxSchedulerEvent): TcxSchedulerReportDetailsEventCell; +begin + Result := TcxSchedulerReportMemoEventCell.CreateEx(CurrentPage, AEvent, + NullDate, VisualStyles.GetEventParams(AEvent)); + Result.CalculateLayout(PageWidth, TimeWidth); +end; + +procedure TcxSchedulerReportLinkMemoPrintStyle.BuildPages; +var + I: Integer; + APageBounds: TRect; + ACell: TcxSchedulerReportDetailsEventCell; + + function GetCellBounds: TRect; + begin + Result := APageBounds; + Result.Bottom := Result.Top + ACell.CalculateHeight; + end; + +begin + Site := nil; + if Events.Count = 0 then Exit; + Site := AddPageSite(GetPageSiteBounds(0)); + CurrentPage := GetNextPage(CurrentPage, APageBounds); + Events.Sort(@cxCompareEventsOrder); + for I := 0 to Events.AbsoluteCount - 1 do + begin + ACell := AddEventCell(Events[I]); + ReportLink.DoInitializeEventCell(ACell); + if (CellsOnPage > 0) and (StartEachItemOnNewPage or + (GetCellBounds.Bottom > APageBounds.Bottom)) then + CurrentPage := GetNextPage(CurrentPage, APageBounds); + ACell.Parent := CurrentPage; + ACell.BoundsRect := GetCellBounds; + APageBounds.Top := ACell.BoundsRect.Bottom + InterAreaSpace; + Inc(CellsOnPage); + end; +end; + +procedure TcxSchedulerReportLinkMemoPrintStyle.DoCanPrintEvent( + AEvent: TcxSchedulerEvent; var AllowPrint: Boolean); +var + I: Integer; + AUseEvent: Boolean; +begin + if SelectedEventsOnly and (Scheduler <> nil) then + begin + AllowPrint := False; + for I := 0 to Scheduler.SelectedEventCount - 1 do + begin + AllowPrint := Scheduler.SelectedEvents[I].Source = TcxSchedulerControlEvent(AEvent).Source; + if AllowPrint then Break; + end; + end; + AUseEvent := False; + for I := 0 to PrintRange.DayCount - 1 do + if AEvent.IsDayEvent(PrintRange.PrintFrom + I) then + begin + AUseEvent := True; + Break; + end; + if AUseEvent then + inherited DoCanPrintEvent(AEvent, AllowPrint) + else + AllowPrint := False; +end; + +function TcxSchedulerReportLinkMemoPrintStyle.GetGlyphIndex: Integer; +begin + Result := 20; +end; + +function TcxSchedulerReportLinkMemoPrintStyle.GetPreviewGlyphIndex: Integer; +begin + Result := 17; +end; + +function TcxSchedulerReportLinkMemoPrintStyle.MeasureTimeWidth: Integer; +var + AFont: TFont; +begin + AFont := ReportLink.Font; + if (VisualStyles.Event <> nil) and (cxStyles.svFont in VisualStyles.Event.AssignedValues) then + AFont := VisualStyles.Event.Font; + Result := 0; + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxSubjectLabelCaption))); + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxLocationLabelCaption))); + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxStartLabelCaption))); + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxFinishLabelCaption))); + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxShowTimeAsLabelCaption))); + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxRecurrenceLabelCaption))); + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxRecurrencePatternLabelCaption))); + if Result = 0 then + Result := inherited MeasureTimeWidth + else + Inc(Result, cxTextWidth(AFont, '0000 - 0000')); + Result := Min(PageWidth div 3, Result); +end; + +{ TcxSchedulerReportLinkMonthlyPrintStyle } + +constructor TcxSchedulerReportLinkMonthlyPrintStyle.Create( + AStyles: TcxSchedulerReportLinkPrintStyles); +begin + inherited Create(AStyles); + FShowResourceImages := True; +end; + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLinkMonthlyPrintStyle then + PrintExactlyOneMonthPerPage := + TcxSchedulerReportLinkMonthlyPrintStyle(Source).PrintExactlyOneMonthPerPage; + inherited Assign(Source); +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionMonthly); +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.IsCompatibleWith( + AView: TcxSchedulerCustomView): Boolean; +begin + Result := AView is TcxSchedulerWeeksView; +end; + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.RestoreDefaults; +begin + PrintExactlyOneMonthPerPage := False; + inherited RestoreDefaults; +end; + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.CreateControlsOnFirstPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +begin + if Layout = pslTwoPages then + CreateAdditionalControls(ASite, True, ShowTaskPad and + (ShowNotesAreaLined or ShowNotesAreaBlank), False, False, False, ABounds) + else + CreateAdditionalControls(ASite, True, ShowTaskPad, + ShowNotesAreaBlank, ShowNotesAreaLined, True, ABounds); + InitReportCell(CreateSchedulingAreaCell(ASite), ABounds); +end; + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.CreateControlsOnSecondPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +var + HasTaskPad: Boolean; +begin + HasTaskPad := ShowTaskPad and not (ShowNotesAreaBlank or ShowNotesAreaLined); + CreateAdditionalControls(ASite, True, HasTaskPad, ShowNotesAreaBlank, + ShowNotesAreaLined, True, ABounds); + InitReportCell(CreateSchedulingAreaCell(ASite), ABounds); +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.GetCorrespondedView: TcxSchedulerCustomResourceView; +begin + if Scheduler <> nil then + Result := Scheduler.ViewWeeks + else + Result := inherited GetCorrespondedView; +end; + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.FillDatesForPage( + ADateList: TcxSchedulerDateList; APageIndex, APeriodIndex, ASubIndex: Integer); +var + I: Integer; + Y, M, D: Word; + AStart: TDateTime; +begin + AStart := GetDateForPage(APageIndex); + DecodeDate(AStart, Y, M, D); + for I := 0 to DaysInAMonth(Y, M) - 1 do + ADateList.Add(AStart + I); +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.GetDaysPerPeriod: Integer; +begin + Result := 30; +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.GetDateForPage( + APageIndex: Integer): TDateTime; +var + Y, M, D: Word; + APeriodIndex: Integer; +begin + APeriodIndex := APageIndex div (Byte(Layout) + 1) div GetResourcePageCount; + DecodeDate(PrintRange.PrintFrom, Y, M, D); + D := 1; + IncAMonth(Y, M, D, APeriodIndex); + Result := EncodeDate(Y, M, D); +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.GetGlyphIndex: Integer; +begin + Result := 11 + Byte(HasAdditionalArea); + if Layout = pslTwoPages then + Inc(Result, 2); +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.GetPageCount: Integer; +begin + Result := PrintRange.MonthCount * (Byte(Layout) + 1) * GetResourcePageCount; +end; + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.InitHeaderCell( + ACell: TcxSchedulerReportSchedulerHeaderCell); + + function GetMonthText(ADate: TDateTime): string; + begin + Result := FormatDateTime('mmmm', ADate) + ' ' + IntToStr(YearOf(ADate)); + end; + +var + ADate: TDateTime; +begin + ADate := GetDateForPage(ACell.PageIndex); + if PrintExactlyOneMonthPerPage then + ACell.PrimaryText := GetMonthText(ADate) + else + ACell.PrimaryText := GetMonthText(ADate) + ' - ' + GetMonthText(ADate + 32); + inherited InitHeaderCell(ACell); +end; + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.SetPrintExactlyOneMonthPerPage( + Value: Boolean); +begin + SetBoolOption(FPrintExactlyOneMonthPerPage, Value); +end; + +{ TcxSchedulerReportLinkTrifoldPrintStyle } + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerReportLinkTrifoldPrintStyle then + with TcxSchedulerReportLinkTrifoldPrintStyle(Source) do + begin + Self.LeftSection := LeftSection; + Self.MiddleSection := MiddleSection; + Self.RightSection := RightSection; + end; +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionTrifold); +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.RestoreDefaults; +begin + inherited RestoreDefaults; + FSections[0] := smDailyCalendar; + FSections[1] := smTaskPad; + FSections[2] := smWeeklyCalendar; +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.CreateLayoutForPeriod( + APeriodIndex: Integer); +var + I: Integer; + R: array[0..2] of TRect; + ABounds: TRect; + ASite: TcxSchedulerReportPageSite; +begin + ABounds := GetPageSiteBounds(APeriodIndex); + ASite := AddPageSite(ABounds); + ASite.FPageIndex := APeriodIndex; + ASite.FPrimaryPage := True; + ABounds := ASite.GetInnerBounds(0); + if GetHasPageReportTitle(APeriodIndex) then + Inc(ABounds.Top, ReportLink.RenderInfo.CalculateTitleHeight); + Rect2RectsHorz(ABounds, R[0], R[1], R[2]); + for I := 0 to 2 do + CreateLayoutForSection(ASite, APeriodIndex, R[I], FSections[I]); +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.CreateLayoutForSection( + ASite: TdxReportCell; APeriodIndex: Integer; const ABounds: TRect; + ASection: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode); +begin + FCurrentSection := ASection; + case ASection of + smDailyCalendar: + CreateSchedulingAreaWithHeader(ASite, ABounds); + smWeeklyCalendar: + CreateSchedulingAreaWithHeader(ASite, ABounds); + smMonthlyCalendar: + CreateSchedulingAreaWithHeader(ASite, ABounds); + smTaskPad: + InitReportCell(CreateTaskPadCell(ASite), ABounds); + smNotesAreaBlank: + InitReportCell(CreateNotesCell(ASite), ABounds); + smNotesAreaLined: + InitReportCell(CreateNotesLinedCell(ASite), ABounds); + end; +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.CreateSchedulingAreaWithHeader( + ASite: TdxReportCell; ABounds: TRect); +var + R: TRect; + AHeader: TcxSchedulerReportSchedulerHeaderCell; +begin + R := ABounds; + R.Bottom := R.Top + Round((R.Bottom - R.Top) * SchedulerHeaderSmallHeight); + ABounds.Top := R.Bottom + InterAreaSpace; + FCurrentSchedulingArea := CreateSchedulingAreaCell(ASite); + InitReportCell(FCurrentSchedulingArea, ABounds); + AHeader := CreateHeaderCell(ASite); + InitReportCell(AHeader, R); + AHeader.Content.BoundsRect := AHeader.GetInnerBounds(0); + AHeader.AdjustTextSize; +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; +begin + case FCurrentSection of + smDailyCalendar: + Result := TcxSchedulerReportDailyCellsProducer.CreateEx(Self, ASite); + smWeeklyCalendar, smMonthlyCalendar: + Result := TcxSchedulerReportWeeksCellsProducer.CreateEx(Self, ASite); + else + Result := nil; + end; +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.FillDatesForPage( + ADateList: TcxSchedulerDateList; APageIndex, APeriodIndex, ASubIndex: Integer); +var + I: Integer; + ADate: TDateTime; +begin + ADateList.Clear; + case FCurrentSection of + smDailyCalendar: + ADateList.Add(APageIndex + PrintRange.PrintFrom); + smWeeklyCalendar: + begin + if HasDailySection then + ADate := StartOfTheWeek(APageIndex + PrintRange.PrintFrom) + else + ADate := StartOfTheWeek(PrintRange.PrintFrom + + MulDiv(APageIndex * 7, PrintRange.WeekCount, PageCount)); + for I := 0 to 7 do + ADateList.Add(ADate + I); + end; + smMonthlyCalendar: + begin + ADate := StartOfTheMonth(PrintRange.PrintFrom + APageIndex * FPageRange); + for I := 0 to DaysInMonth(ADate) do + ADateList.Add(ADate + I); + end; + end; +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.GetCorrespondedView: TcxSchedulerCustomResourceView; +begin + case FCurrentSection of + smDailyCalendar: + Result := Scheduler.ViewDay; + smWeeklyCalendar: + Result := Scheduler.ViewWeek; + smMonthlyCalendar: + Result := Scheduler.ViewWeeks; + else + Result := inherited GetCorrespondedView; + end; +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.GetGlyphIndex: Integer; +begin + Result := 15; +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.GetPageCount: Integer; +var + I: Integer; +begin + Result := 1; + FPageRange := 30; + for I := 0 to 2 do + begin + case FSections[I] of + smDailyCalendar: + begin + Result := Max(Result, PrintRange.DayCount); + FPageRange := 1; + end; + smWeeklyCalendar: + begin + Result := Max(Result, PrintRange.WeekCount); + FPageRange := Min(FPageRange, 7); + end; + smMonthlyCalendar: + begin + Result := Max(Result, PrintRange.MonthCount); + FPageRange := Min(FPageRange, 30); + end; + end; + end; +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.InitHeaderCell( + ACell: TcxSchedulerReportSchedulerHeaderCell); +var + AText: string; + ADate1, ADate2: TDateTime; +begin + with FCurrentSchedulingArea.VisibleDays do + begin + ADate1 := Items[0]; + ADate2 := Items[Count - 1]; + end; + case FCurrentSection of + smDailyCalendar: + AText := DateTimeHelper.DateToLongDateStr(ADate1); + smWeeklyCalendar: + AText := DateTimeHelper.DayToStr(ADate1, 0, False) + ' - ' + + DateTimeHelper.DayToStr(ADate2 - 1, 0, False); + smMonthlyCalendar: + if not cxGetDateFormat(ADate1, AText, DATE_YEARMONTH) then + AText := FormatDateTime('mmmm', ADate1) + ' ' + IntToStr(YearOf(ADate1)) + end; + ACell.PrimaryText := AText; + inherited InitHeaderCell(ACell); +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.GetSection( + Index: Integer): TcxSchedulerReportLinkTrifoldPrintStyleSectionMode; +begin + Result := FSections[Index]; +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.GetHasDailySection: Boolean; +begin + Result := smDailyCalendar in [FSections[0], FSections[1], FSections[2]] +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.SetSection( + Index: Integer; AValue: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode); +begin + if AValue <> FSections[Index] then + begin + FSections[Index] := AValue; + Changed; + end; +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.IsSectionStored( + Index: Integer): Boolean; +const + Sections: array[0..2] of TcxSchedulerReportLinkTrifoldPrintStyleSectionMode = + (smDailyCalendar, smTaskPad, smWeeklyCalendar); +begin + Result := FSections[Index] <> Sections[Index]; +end; + +{ TcxSchedulerReportLinkWeeklyPrintStyle } + +constructor TcxSchedulerReportLinkWeeklyPrintStyle.Create( + AStyles: TcxSchedulerReportLinkPrintStyles); +begin + inherited Create(AStyles); + FShowResourceImages := True; +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLinkWeeklyPrintStyle then + begin + Arrange := TcxSchedulerReportLinkWeeklyPrintStyle(Source).Arrange; + DaysLayout := TcxSchedulerReportLinkWeeklyPrintStyle(Source).DaysLayout; + end; + inherited Assign(Source); +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionWeekly); +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.IsCompatibleWith( + AView: TcxSchedulerCustomView): Boolean; +begin + Result := AView is TcxSchedulerWeekView; +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.RestoreDefaults; +begin + Arrange := wsaTopToBottom; + inherited RestoreDefaults; +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.Build; +var + APrevLayout: TcxSchedulerWeekViewDaysLayout; +begin + APrevLayout := Scheduler.ViewWeek.DaysLayout; + Scheduler.ViewWeek.DaysLayout := DaysLayout; + try + inherited Build; + finally + Scheduler.ViewWeek.DaysLayout := APrevLayout; + end; +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.CreateControlsOnFirstPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +begin + if Layout = pslTwoPages then + CreateAdditionalControls(ASite, True, ShowTaskPad and + (ShowNotesAreaLined or ShowNotesAreaBlank), False, False, False, ABounds) + else + CreateAdditionalControls(ASite, True, ShowTaskPad, + ShowNotesAreaBlank, ShowNotesAreaLined, True, ABounds); + InitReportCell(CreateSchedulingAreaCell(ASite), ABounds); +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.CreateControlsOnSecondPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +var + HasTaskPad: Boolean; +begin + HasTaskPad := ShowTaskPad and not (ShowNotesAreaBlank or ShowNotesAreaLined); + CreateAdditionalControls(ASite, True, HasTaskPad, ShowNotesAreaBlank, + ShowNotesAreaLined, True, ABounds); + InitReportCell(CreateSchedulingAreaCell(ASite), ABounds); +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; +const + CellsProducers: array[Boolean] of TcxSchedulerReportCommonCellsProducerClass = + (TcxSchedulerReportDailyCellsProducer, TcxSchedulerReportWeeksCellsProducer); +begin + Result := CellsProducers[Arrange = wsaTopToBottom].CreateEx(Self, ASite); +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetCorrespondedView: TcxSchedulerCustomResourceView; +begin + if Scheduler <> nil then + begin + if Arrange = wsaTopToBottom then + Result := Scheduler.ViewWeek + else + Result := Scheduler.ViewDay; + end + else + Result := inherited GetCorrespondedView; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetGlyphIndex: Integer; +begin + if (DaysLayout = wdlOneColumn) and (Layout = pslOnePage) then + Result := 27 + else + Result := 3 + Byte(Arrange) + Byte(HasAdditionalArea) * 4 + + Byte(Layout = pslTwoPages) * 2 +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetDateForPage( + APageIndex: Integer): TDateTime; +begin + Result := StartOfTheWeek(PrintRange.PrintFrom + (APageIndex div GetResourcePageCount div (Byte(Layout) + 1)) * 7); +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetDaysPerPeriod: Integer; +begin + Result := 7; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetPageCount: Integer; +begin + Result := PrintRange.WeekCount * (Byte(Layout) + 1) * GetResourcePageCount; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetPreviewGlyphIndex: Integer; +begin + if (DaysLayout = wdlOneColumn) and (Layout = pslOnePage) then + Result := 22 + else + Result := inherited GetPreviewGlyphIndex; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetStartOfWeekOffset: Integer; +begin + Result := -DayOfWeek(PrintRange.PrintFrom) + 2; // +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.FillDatesForPage( + ADateList: TcxSchedulerDateList; APageIndex, APeriodIndex, ASubIndex: Integer); +const + DayCount: array[TcxSchedulerReportLinkPeriodicPrintStyleLayout, Boolean] of Integer = + ((7, 7), (3, 4)); +var + I: Integer; + AStart, ADate: TDateTime; +begin + AStart := GetDateForPage(APageIndex); + if Arrange = wsaLeftToRight then + for I := 0 to DayCount[Layout, ASubIndex <> 0] - 1 do + begin + ADate := AStart + ASubIndex * 3 + I; + if not DontPrintWeekEnds or not (DayOfWeek(ADate) in [1, 7]) then + ADateList.Add(ADate); + end + else + begin + AStart := AStart + Byte(Scheduler.OptionsView.ActualStartOfWeek); + for I := 0 to 6 do + ADateList.Add(AStart + I); + end; +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.InitHeaderCell( + ACell: TcxSchedulerReportSchedulerHeaderCell); + + function GetWeekDayText(ADate: TDateTime): string; + begin + Result := DateTimeHelper.DayToStr(ADate, 0, False); + end; + +var + AWeekDate: TDateTime; +begin + AWeekDate := GetDateForPage(ACell.PageIndex); + ACell.PrimaryText := GetWeekDayText(AWeekDate) + ' - ' + + GetWeekDayText(AWeekDate + 6); + inherited InitHeaderCell(ACell); +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.CanDontPrintWeekends: Boolean; +begin + Result := SupportTimeRange; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.SupportMessage: Boolean; +begin + Result := Arrange = wsaLeftToRight; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.SupportTimeRange: Boolean; +begin + Result := Arrange = wsaLeftToRight; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.IsDaysLayoutStored: Boolean; +begin + Result := FDaysLayoutAssigned and (DaysLayout <> wdlTwoColumns); +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetDaysLayout: TcxSchedulerWeekViewDaysLayout; +begin + if DaysLayoutAssigned or (Scheduler = nil) then + Result := FDaysLayout + else + Result := Scheduler.ViewWeek.DaysLayout; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.IsArrangeStored: Boolean; +begin + Result := Arrange <> wsaTopToBottom; +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.SetArrange( + Value: TcxSchedulerReportLinkWeeklyPrintStyleArrange); +begin + if Arrange <> Value then + begin + FArrange := Value; + Changed; + end; +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.SetDaysLayout( + Value: TcxSchedulerWeekViewDaysLayout); +begin + FDaysLayout := Value; + FDaysLayoutAssigned := True; + Changed; +end; + +{ TcxSchedulerReportLinkYearlyPrintStyle } + +procedure TcxSchedulerReportLinkYearlyPrintStyle.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLinkYearlyPrintStyle then + with TcxSchedulerReportLinkYearlyPrintStyle(Source) do + begin + Self.FMonthCountPerPage := FMonthCountPerPage; + Self.FPrimaryPageHeadersOnly := FPrimaryPageHeadersOnly; + end; + inherited Assign(Source); +end; + +function TcxSchedulerReportLinkYearlyPrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionYearly); +end; + +function TcxSchedulerReportLinkYearlyPrintStyle.IsCompatibleWith( + AView: TcxSchedulerCustomView): Boolean; +begin + Result := AView is TcxSchedulerYearView; +end; + +procedure TcxSchedulerReportLinkYearlyPrintStyle.RestoreDefaults; +begin + FMonthCountPerPage := 12; + FPrimaryPageHeadersOnly := False; + inherited RestoreDefaults; +end; + +procedure TcxSchedulerReportLinkYearlyPrintStyle.BuildSchedulerCells( + ASite: TcxSchedulerReportSchedulingAreaCell); +begin + ASite.CellSides := ASite.CellSides + [csRight]; + inherited BuildSchedulerCells(ASite); +end; + +procedure TcxSchedulerReportLinkYearlyPrintStyle.CreateControlsOnFirstPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); +begin + if (Layout = pslTwoPages) and (APageIndex mod 2 = 0) then + CreateAdditionalControls(ASite, True, ShowTaskPad and + (ShowNotesAreaLined or ShowNotesAreaBlank), False, False, False, ABounds) + else + CreateAdditionalControls(ASite, True, ShowTaskPad, + ShowNotesAreaBlank, ShowNotesAreaLined, True, ABounds); + InitReportCell(CreateSchedulingAreaCell(ASite), ABounds); +end; + +procedure TcxSchedulerReportLinkYearlyPrintStyle.CreateControlsOnSecondPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); +var + HasTaskPad: Boolean; +begin + HasTaskPad := ShowTaskPad and not (ShowNotesAreaBlank or ShowNotesAreaLined); + CreateAdditionalControls(ASite, True, HasTaskPad, ShowNotesAreaBlank, + ShowNotesAreaLined, True, ABounds); + InitReportCell(CreateSchedulingAreaCell(ASite), ABounds); +end; + +function TcxSchedulerReportLinkYearlyPrintStyle.CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; +begin + Result := TcxSchedulerReportYearlyCellsProducer.CreateEx(Self, ASite); +end; + +procedure TcxSchedulerReportLinkYearlyPrintStyle.FillDatesForPage( + ADateList: TcxSchedulerDateList; APageIndex, APeriodIndex, ASubIndex: Integer); +begin + ADateList.Clear; + APageIndex := APageIndex div PeriodPageCount; + ADateList.Add(EncodeDate(YearOf(PrintRange.PrintFrom) + APageIndex, 1, 1)) +end; + +function TcxSchedulerReportLinkYearlyPrintStyle.GetCorrespondedView: TcxSchedulerCustomResourceView; +begin + if Scheduler <> nil then + Result := Scheduler.ViewYear + else + Result := inherited GetCorrespondedView; +end; + +function TcxSchedulerReportLinkYearlyPrintStyle.GetHasPageHeader( + APageIndex: Integer): Boolean; +const + Indexes: array[TcxSchedulerReportLinkPeriodicPrintStyleLayout] of Integer = (0, 1); +begin + APageIndex := APageIndex mod PeriodPageCount; + Result := not PrimaryPageHeadersOnly or (APageIndex <= Indexes[Layout]); +end; + +function TcxSchedulerReportLinkYearlyPrintStyle.GetGlyphIndex: Integer; +begin + Result := 23 + Byte(HasAdditionalArea); + if Layout = pslTwoPages then + Inc(Result, 2); +end; + +function TcxSchedulerReportLinkYearlyPrintStyle.GetPreviewGlyphIndex: Integer; +begin + Result := 18 + Byte(HasAdditionalArea); + if Layout = pslTwoPages then + Inc(Result, 2); +end; + +function TcxSchedulerReportLinkYearlyPrintStyle.GetPageCount: Integer; +begin + Result := PrintRange.YearCount * GetResourcePageCount * + (12 div FMonthCountPerPage) * (Byte(Layout) + 1); +end; + +function TcxSchedulerReportLinkYearlyPrintStyle.GetShowDateNavigator( + APageIndex: Integer): Boolean; +begin + Result := False; +end; + +procedure TcxSchedulerReportLinkYearlyPrintStyle.InitHeaderCell( + ACell: TcxSchedulerReportSchedulerHeaderCell); + + function GetYearText(AYear: Word): string; + var + ADate: TDateTime; + S, S1: string; + begin + ADate := EncodeDate(AYear, 1, 1); + if not cxGetDateFormat(ADate, S, DATE_YEARMONTH) then + S := FormatDateTime('dddddd', ADate); + ADate := EncodeDate(AYear, 12, 31); + if not cxGetDateFormat(ADate, S1, DATE_YEARMONTH) then + S1 := FormatDateTime('dddddd', ADate); + Result := S + ' - ' + S1; + end; + +var + AIndex: Integer; +begin + if ACell.PageSite.PageIndex mod PeriodPageCount <> 0 then Exit; + AIndex := ACell.PageSite.PageIndex div PeriodPageCount; + ACell.Content.BoundsRect := ACell.GetInnerBounds(0); + ACell.PrimaryText := GetYearText(YearOf(PrintRange.PrintFrom) + AIndex); + inherited InitHeaderCell(ACell); +end; + +function TcxSchedulerReportLinkYearlyPrintStyle.GetPeriodPageCount: Integer; +begin + Result := (Byte(Layout) + 1) * 12 div MonthCountPerPage; +end; + +procedure TcxSchedulerReportLinkYearlyPrintStyle.SetMonthCountPerPage( + AValue: Integer); +begin + AValue := Max(1, Min(12, AValue)); + while 12 mod AValue <> 0 do + Inc(AValue); + if AValue <> FMonthCountPerPage then + begin + FMonthCountPerPage := AValue; + Changed; + end; +end; + +procedure TcxSchedulerReportLinkYearlyPrintStyle.SetPrimaryPageHeadersOnly( + AValue: Boolean); +begin + if AValue <> FPrimaryPageHeadersOnly then + begin + FPrimaryPageHeadersOnly := AValue; + Changed; + end; +end; + +{ TdxfmSchedulerReportLinkDesignWindow } + +constructor TcxfmSchedulerReportLinkDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxhccxSchedulerReportLinkDesigner; + inherited; + wpPrintStyles := TList.Create; + CreateControls; + SetActivePage; +end; + +destructor TcxfmSchedulerReportLinkDesignWindow.Destroy; +begin + FreeAndNil(wpPrintStyles); + dxPSPopupMan.dxPSPopupMenuController.UnregisterControl(lbxStyles); + inherited; +end; + +function TcxfmSchedulerReportLinkDesignWindow.Execute: Boolean; +begin + Self.FActiveStyle := ReportLink.PrintStyles.FActiveStyle; + Self.FActiveStyleAssigned := ReportLink.PrintStyles.FActiveStyleAssigned; + if (ReportLink.PrintStyles.ActiveStyle = nil) or not FActiveStyleAssigned then + with ReportLink.PrintStyles do SetActiveStyleEx(GetCorrespondingStyle); + Result := inherited Execute; + if Result then + ReportLink.PrintStyles.ActiveStyle := ActivePrintStyle + else + begin + ReportLink.PrintStyles.FActiveStyleAssigned := FActiveStyleAssigned; + ReportLink.PrintStyles.FActiveStyle := FActiveStyle; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignDailyTabObjects; +var + ADailyStyle: TcxSchedulerReportLinkDailyPrintStyle; +begin + ADailyStyle := ReportLink.PrintStyles.Daily; + cbxPrintStyleDailyLayout.ItemIndex := Integer(ADailyStyle.Layout); + sePrintStyleDailyResourceCountPerPage.Properties.MaxValue := ADailyStyle.ResourceCount; + sePrintStyleDailyResourceCountPerPage.Value := ADailyStyle.ResourceCountPerPage; + chbxPrintStyleDailyTaskPad.Checked := ADailyStyle.ShowTaskPad; + chbxPrintStyleDailyNotesAreaBlank.Checked := ADailyStyle.ShowNotesAreaBlank; + chbxPrintStyleDailyNotesAreaLined.Checked := ADailyStyle.ShowNotesAreaLined; + tePrintStyleDailyPrintFrom.Time := ADailyStyle.TimePrintFrom; + tePrintStyleDailyPrintTo.Time := ADailyStyle.TimePrintTo; + SetShowImagesCheckBoxes(chbxPrintStyleDailyShowEventImages, + chbxPrintStyleDailyShowResourceImages, ADailyStyle); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignDetailsTabObjects; +var + ADetailsStyle: TcxSchedulerReportLinkDetailsPrintStyle; +begin + ADetailsStyle := ReportLink.PrintStyles.Details; + chbxPrintStyleDetailsUsePagination.Checked := ADetailsStyle.UsePagination; + cbxPrintStyleDetailsPagination.ItemIndex := Integer(ADetailsStyle.PaginationMode); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignMemoTabObjects; +var + AMemoStyle: TcxSchedulerReportLinkMemoPrintStyle; +begin + AMemoStyle := ReportLink.PrintStyles.Memo; + chbxPrintStyleMemoStartEachItemOnNewPage.Checked := AMemoStyle.StartEachItemOnNewPage; + chbxPrintStyleMemoPrintOnlySelectedEvents.Checked := AMemoStyle.SelectedEventsOnly; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignMonthlyTabObjects; +var + AMonthlyStyle: TcxSchedulerReportLinkMonthlyPrintStyle; +begin + AMonthlyStyle := ReportLink.PrintStyles.Monthly; + cbxPrintStyleMonthlyLayout.ItemIndex := Integer(AMonthlyStyle.Layout); + sePrintStyleMonthlyResourceCountPerPage.Properties.MaxValue := AMonthlyStyle.ResourceCount; + sePrintStyleMonthlyResourceCountPerPage.Value := AMonthlyStyle.ResourceCountPerPage; + chbxPrintStyleMonthlyTaskPad.Checked := AMonthlyStyle.ShowTaskPad; + chbxPrintStyleMonthlyNotesAreaBlank.Checked := AMonthlyStyle.ShowNotesAreaBlank; + chbxPrintStyleMonthlyNotesAreaLined.Checked := AMonthlyStyle.ShowNotesAreaLined; + chbxPrintStyleMonthlyDontPrintWeekends.Checked := AMonthlyStyle.DontPrintWeekends; + chbxPrintStyleMonthlyPrintExactlyOneMonthPerPage.Checked := AMonthlyStyle.PrintExactlyOneMonthPerPage; + SetShowImagesCheckBoxes(chbxPrintStyleMonthlyShowEventImages, + chbxPrintStyleMonthlyShowResourceImages, AMonthlyStyle); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignTrifoldTabObjects; +var + ATrifoldStyle: TcxSchedulerReportLinkTrifoldPrintStyle; +begin + ATrifoldStyle := ReportLink.PrintStyles.Trifold; + cbxPrintStyleTrifoldSectionLeft.ItemIndex := Byte(ATrifoldStyle.LeftSection); + cbxPrintStyleTrifoldSectionMiddle.ItemIndex := Byte(ATrifoldStyle.MiddleSection); + cbxPrintStyleTrifoldSectionRight.ItemIndex := Byte(ATrifoldStyle.RightSection); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignWeeklyTabObjects; +var + AWeeklyStyle: TcxSchedulerReportLinkWeeklyPrintStyle; +begin + AWeeklyStyle := ReportLink.PrintStyles.Weekly; + cbxPrintStyleWeeklyArrange.ItemIndex := Integer(AWeeklyStyle.Arrange); + cbxPrintStyleWeeklyDaysLayout.ItemIndex := Integer(AWeeklyStyle.DaysLayout); + cbxPrintStyleWeeklyLayout.ItemIndex := Integer(AWeeklyStyle.Layout); + sePrintStyleWeeklyResourceCountPerPage.Properties.MaxValue := AWeeklyStyle.ResourceCount; + sePrintStyleWeeklyResourceCountPerPage.Value := AWeeklyStyle.ResourceCountPerPage; + chbxPrintStyleWeeklyTaskPad.Checked := AWeeklyStyle.ShowTaskPad; + chbxPrintStyleWeeklyNotesAreaBlank.Checked := AWeeklyStyle.ShowNotesAreaBlank; + chbxPrintStyleWeeklyNotesAreaLined.Checked := AWeeklyStyle.ShowNotesAreaLined; + chbxPrintStyleWeeklyDontPrintWeekends.Checked := AWeeklyStyle.DontPrintWeekends; + tePrintStyleWeeklyPrintFrom.Time := AWeeklyStyle.TimePrintFrom; + tePrintStyleWeeklyPrintTo.Time := AWeeklyStyle.TimePrintTo; + SetShowImagesCheckBoxes(chbxPrintStyleWeeklyShowEventImages, + chbxPrintStyleWeeklyShowResourceImages, AWeeklyStyle); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignYearlyTabObjects; +const + MontPerPageIndexes: array[0..11] of Integer = + (0, 1, 2, 3, 3, 4, 4, 4, 4, 4, 4, 5); +var + AYearlyStyle: TcxSchedulerReportLinkYearlyPrintStyle; +begin + AYearlyStyle := ReportLink.PrintStyles.Yearly; + cbxPrintStyleYearlyLayout.ItemIndex := Integer(AYearlyStyle.Layout); + cbxPrintStyleYearlyMonthPerPage.ItemIndex := MontPerPageIndexes[AYearlyStyle.MonthCountPerPage - 1]; + sePrintStyleYearlyResourceCountPerPage.Properties.MaxValue := AYearlyStyle.ResourceCount; + sePrintStyleYearlyResourceCountPerPage.Value := AYearlyStyle.ResourceCountPerPage; + chbxPrintStyleYearlyTaskPad.Checked := AYearlyStyle.ShowTaskPad; + chbxPrintStyleYearlyNotesAreaBlank.Checked := AYearlyStyle.ShowNotesAreaBlank; + chbxPrintStyleYearlyNotesAreaLined.Checked := AYearlyStyle.ShowNotesAreaLined; + chbxPrimaryPageHeadersOnly.Checked := AYearlyStyle.PrimaryPageHeadersOnly; + SetShowImagesCheckBoxes(chbxPrintStyleYearlyShowEventImages, nil, AYearlyStyle); +end; + +function TcxfmSchedulerReportLinkDesignWindow.CanApply: Boolean; +begin + Result := inherited CanApply;// and not ReportLink.IsInconsistentState; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoApply; +begin + if not IsValidConditions then Exit; + ReportLink.PrintStyles.ActiveStyle := ActivePrintStyle; + FActiveStyle := ReportLink.PrintStyles.FActiveStyle; + FActiveStyleAssigned := ReportLink.PrintStyles.FActiveStyleAssigned; + inherited DoApply; + ReportLink.RebuildReport; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoInitialize; +begin + + lbxStyles.ReportLinkStyles := ReportLink.ActiveStyles; + inherited DoInitialize; + + with ReportLink.PrintRange do + begin + dePrintRangeStart.Date := PrintFrom; + dePrintRangeEnd.Date := PrintTo; + end; + + AssignTabSheetObjects; + RefreshPrintStyles; + ActivatePrintStyleTab; + + AssignDailyTabObjects; + AssignDetailsTabObjects; + AssignMemoTabObjects; + AssignMonthlyTabObjects; + AssignTrifoldTabObjects; + AssignWeeklyTabObjects; + AssignYearlyTabObjects; + + // Formatting + with ReportLink.OptionsFormatting do + begin + cbxLookAndFeel.ItemIndex := Min(2, Integer(LookAndFeelKind)); + chbxSuppressBackgroundBitmaps.Checked := SuppressBackgroundBitmaps; + chbxSuppressContentColoration.Checked := SuppressContentColoration; + chbxUseNativeStyles.Checked := UseNativeStyles; + end; + + PageControl1Change(nil); +end; + +{$IFDEF DELPHI7} +function TcxfmSchedulerReportLinkDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +function TcxfmSchedulerReportLinkDesignWindow.CheckPrintRange: Boolean; +begin + Result := dePrintRangeEnd.Date >= dePrintRangeStart.Date; + if not Result then + begin + MessageBox(0, + PChar(cxGetResourceString(@sdxBadDatePrintRange)), + PChar(cxGetResourceString(@sdxReportDesignerCaption)), + MB_ICONINFORMATION or MB_OK); + PageControl1.ActivePage := tshPrintRange; + ActiveControl := dePrintRangeEnd; + end; +end; + +function TcxfmSchedulerReportLinkDesignWindow.CheckPrintStyleSettings: Boolean; + + procedure ShowWarning; + begin + MessageBox(0, + PChar(cxGetResourceString(@sdxBadTimePrintRange)), + PChar(cxGetResourceString(@sdxReportDesignerCaption)), + MB_ICONINFORMATION or MB_OK); + end; + +begin + if pcPrintStyleOptions.ActivePage = tshDaily then + begin + Result := TimeOf(tePrintStyleDailyPrintFrom.Time) <= TimeOf(tePrintStyleDailyPrintTo.Time); + if not Result then + begin + ShowWarning; + PageControl1.ActivePage := tshPrintStyles; + pcPrintStyleOptions.ActivePage := tshDaily; + ActiveControl := tePrintStyleDailyPrintTo; + end; + end + else + if pcPrintStyleOptions.ActivePage = tshWeekly then + begin + Result := TimeOf(tePrintStyleWeeklyPrintFrom.Time) <= TimeOf(tePrintStyleWeeklyPrintTo.Time); + if not Result then + begin + ShowWarning; + PageControl1.ActivePage := tshPrintStyles; + pcPrintStyleOptions.ActivePage := tshWeekly; + ActiveControl := tePrintStyleWeeklyPrintTo; + end; + end + else + Result := True; +end; + +function TcxfmSchedulerReportLinkDesignWindow.IsValidConditions: Boolean; +begin + Result := CheckPrintRange and CheckPrintStyleSettings; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadCaption( + AControl: TControl; StrPtr: Pointer); +begin + TControlAccess(AControl).Caption := cxGetResourceString(StrPtr); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadCaption( + AItem: TMenuItem; StrPtr: Pointer); +begin + AItem.Caption := cxGetResourceString(StrPtr); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStrings; +begin + inherited LoadStrings; + LoadStringsDaily; + LoadStringsMonthly; + LoadStringsWeekly; + LoadStringsTrifold; + LoadStringsDetails; + LoadStringsMemo; + LoadStringsOther; + LoadStringsYearly; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsCombo( + ACombo: TcxComboBox; ACaptions: array of Pointer); +var + I: Integer; +begin + with ACombo.Properties.Items do + begin + BeginUpdate; + try + Clear; + for I := 0 to High(ACaptions) do + if ACaptions[I] <> nil then Add(cxGetResourceString(ACaptions[I])); + finally + EndUpdate; + end; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsDaily; +begin + LoadCaption(lblPrintStyleDailyLayout, @sdxPrintStyleLayout); + LoadStringsCombo(cbxPrintStyleDailyLayout, + [@sdxPrintStyleDailyLayout1PPD, + @sdxPrintStyleDailyLayout2PPD]); + LoadCaption(lblPrintStyleDailyResourceCountPerPage, + @sdxResourceCountPerPage); + LoadCaption(lblPrintStyleDailyInclude, + @sdxPrintStyleInclude); + LoadCaption(chbxPrintStyleDailyTaskPad, + @sdxPrintStyleIncludeTaskPad); + LoadCaption(chbxPrintStyleDailyNotesAreaBlank, + @sdxPrintStyleIncludeNotesAreaBlank); + LoadCaption(chbxPrintStyleDailyNotesAreaLined, + @sdxPrintStyleIncludeNotesAreaLined); + LoadCaption(lblPrintStyleDailyPrintFrom, @sdxPrintStylePrintFrom); + LoadCaption(lblPrintStyleDailyPrintTo, @sdxPrintStylePrintTo); + LoadCaption(chbxPrintStyleDailyShowEventImages, @sdxPrintStyleShowEventImages); + LoadCaption(chbxPrintStyleDailyShowResourceImages, @sdxPrintStyleShowResourceImages); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsDetails; +begin + LoadCaption(chbxPrintStyleDetailsUsePagination, + @sdxPrintStyleDetailsStartNewPageEach); + LoadStringsCombo(cbxPrintStyleDetailsPagination, + [@sdxDay, @sdxWeek, @sdxMonth]); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsMemo; +begin + LoadCaption(chbxPrintStyleMemoStartEachItemOnNewPage, + @sdxPrintStyleMemoStartEachItemOnNewPage); + LoadCaption(chbxPrintStyleMemoPrintOnlySelectedEvents, + @sdxPrintStyleMemoPrintOnlySelectedEvents); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsMonthly; +begin + LoadCaption(lblPrintStyleMonthlyLayout, @sdxPrintStyleLayout); + LoadStringsCombo(cbxPrintStyleMonthlyLayout, + [@sdxPrintStyleMonthlyLayout1PPM, @sdxPrintStyleMonthlyLayout2PPM]); + LoadCaption(lblPrintStyleMonthlyResourceCountPerPage, @sdxResourceCountPerPage); + LoadCaption(lblPrintStyleMonthlyInclude, @sdxPrintStyleInclude); + LoadCaption(chbxPrintStyleMonthlyTaskPad, @sdxPrintStyleIncludeTaskPad); + LoadCaption(chbxPrintStyleMonthlyNotesAreaBlank, @sdxPrintStyleIncludeNotesAreaBlank); + LoadCaption(chbxPrintStyleMonthlyNotesAreaLined, @sdxPrintStyleIncludeNotesAreaLined); + + LoadCaption(chbxPrintStyleMonthlyDontPrintWeekends, @sdxPrintStyleDontPrintWeekEnds); + LoadCaption(chbxPrintStyleMonthlyPrintExactlyOneMonthPerPage, @sdxPrintStyleMonthlyPrintExactly1MPP); + LoadCaption(chbxPrintStyleMonthlyShowEventImages, @sdxPrintStyleShowEventImages); + LoadCaption(chbxPrintStyleMonthlyShowResourceImages, @sdxPrintStyleShowResourceImages); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsOther; + + procedure AdjustBevelSize(ABevel: TBevel; AControl: TControl); + var + Right: Integer; + begin + Right := ABevel.BoundsRect.Right; + ABevel.Left := AControl.Left + AControl.Width + 10; + ABevel.Width := Right - ABevel.Left; + end; + +begin + lblPreviewWindow.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + // Misc + LoadCaption(tshPrintRange, @sdxPrintRanges); + LoadCaption(lblPrintRangeStart, @sdxPrintRangeStart); + LoadCaption(lblPrintRangeEnd, @sdxPrintRangeEnd); + LoadCaption(lblPrintRangesMiscellaneous, @sdxMiscellaneous); + LoadCaption(chbxHideDetailsOfPrivateAppointments, + @sdxHideDetailsOfPrivateAppointments); + LoadCaption(tshPrintStyles, @sdxTabPrintStyles); + LoadCaption(lblPrintStylesOptions, @sdxOptions); + AdjustBevelSize(bvlPrintStyleOptions, lblPrintStylesOptions); + // Formatting + LoadCaption(tshFormatting, @sdxFormatting); + LoadCaption(lblLookAndFeel, @sdxLookAndFeel); + AdjustBevelSize(bvlLookAndFeel, lblLookAndFeel); + LoadStringsCombo(cbxLookAndFeel, [@sdxLookAndFeelFlat, + @sdxLookAndFeelStandard, @sdxLookAndFeelUltraFlat]); + LoadCaption(lblRefinements, @sdxRefinements); + AdjustBevelSize(bvlRefinements, lblRefinements); + LoadCaption(chbxSuppressBackgroundBitmaps, @sdxSuppressBackgroundBitmaps); + LoadCaption(chbxSuppressContentColoration, @sdxSuppressContentColoration); + // Styles + LoadCaption(tshStyles, @sdxStyles); + LoadCaption(lblUseNativeStyles, @sdxUseNativeStyles); + AdjustBevelSize(bvlStyles, lblUseNativeStyles); + LoadCaption(btnStyleColor, @sdxBtnColor); + LoadCaption(btnStyleFont, @sdxBtnFont); + LoadCaption(btnStyleBackgroundBitmap, @sdxBtnTexture); + LoadCaption(btnStyleBackgroundBitmapClear, @sdxBtnTextureClear); + LoadCaption(btnStyleRestoreDefaults, @sdxBtnRestoreDefaults); + LoadCaption(btnStylesSaveAs, @sdxBtnSaveAs); + LoadCaption(miStyleColor, @sdxBtnColor); + LoadCaption(miStyleFont, @sdxBtnFont); + LoadCaption(miStyleBackgroundBitmap, @sdxBtnTexture); + LoadCaption(miStyleBackgroundBitmapClear, @sdxBtnTextureClear); + LoadCaption(miStyleRestoreDefaults, @sdxBtnRestoreDefaults); + LoadCaption(miStylesSelectAll, @sdxSelectAll); + LoadCaption(miStylesSaveAs, @sdxBtnSaveAs); + LoadCaption(lblStyleSheets, @sdxStyleSheets); + AdjustBevelSize(bvlStyleSheets, lblStyleSheets); + LoadCaption(btnStyleSheetNew, @sdxBtnNew); + LoadCaption(btnStyleSheetCopy, @sdxBtnCopy); + LoadCaption(btnStyleSheetDelete, @sdxBtnDelete); + LoadCaption(btnStyleSheetRename, @sdxBtnRename); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsTrifold; + + procedure FillTrifoldSectionStrings(ACombobox: TcxCombobox); + begin + LoadStringsCombo(ACombobox, + [@sdxPrintStyleTrifoldSectionModeDailyCalendar, + @sdxPrintStyleTrifoldSectionModeWeeklyCalendar, + @sdxPrintStyleTrifoldSectionModeMonthlyCalendar, + @sdxPrintStyleTrifoldSectionModeTaskPad, + @sdxPrintStyleTrifoldSectionModeNotesBlank, + @sdxPrintStyleTrifoldSectionModeNotesLined]); + end; + +begin + LoadCaption(lblPrintStyleTrifoldSectionLeft, @sdxPrintStyleTrifoldSectionLeft); + FillTrifoldSectionStrings(cbxPrintStyleTrifoldSectionLeft); + LoadCaption(lblPrintStyleTrifoldSectionMiddle, @sdxPrintStyleTrifoldSectionMiddle); + FillTrifoldSectionStrings(cbxPrintStyleTrifoldSectionMiddle); + LoadCaption(lblPrintStyleTrifoldSectionRight, @sdxPrintStyleTrifoldSectionRight); + FillTrifoldSectionStrings(cbxPrintStyleTrifoldSectionRight); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsWeekly; +begin + LoadCaption(lblPrintStyleWeeklyArrange, @sdxPrintStyleWeeklyArrange); + LoadCaption(lblPrintStyleWeeklyDaysLayout, @sdxPrintStyleWeeklyDaysLayout); + LoadStringsCombo(cbxPrintStyleWeeklyArrange, + [@sdxPrintStyleWeeklyArrangeT2B, @sdxPrintStyleWeeklyArrangeL2R]); + LoadStringsCombo(cbxPrintStyleWeeklyDaysLayout, + [@sdxPrintStyleWeeklyDaysLayoutTC, @sdxPrintStyleWeeklyDaysLayoutOC]); + + LoadCaption(lblPrintStyleWeeklyLayout, @sdxPrintStyleLayout); + LoadStringsCombo(cbxPrintStyleWeeklyLayout, + [@sdxPrintStyleWeeklyLayout1PPW, @sdxPrintStyleWeeklyLayout2PPW]); + LoadCaption(lblPrintStyleWeeklyResourceCountPerPage, @sdxResourceCountPerPage); + LoadCaption(lblPrintStyleWeeklyInclude, @sdxPrintStyleInclude); + LoadCaption(chbxPrintStyleWeeklyTaskPad, @sdxPrintStyleIncludeTaskPad); + LoadCaption(chbxPrintStyleWeeklyNotesAreaBlank, @sdxPrintStyleIncludeNotesAreaBlank); + LoadCaption(chbxPrintStyleWeeklyNotesAreaLined, @sdxPrintStyleIncludeNotesAreaLined); + + LoadCaption(lblPrintStyleWeeklyPrintFrom, @sdxPrintStylePrintFrom); + LoadCaption(lblPrintStyleWeeklyPrintTo, @sdxPrintStylePrintTo); + + LoadCaption(chbxPrintStyleWeeklyDontPrintWeekends, @sdxPrintStyleDontPrintWeekEnds); + LoadCaption(chbxPrintStyleWeeklyShowEventImages, @sdxPrintStyleShowEventImages); + LoadCaption(chbxPrintStyleWeeklyShowResourceImages, @sdxPrintStyleShowResourceImages); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsYearly; +begin + LoadCaption(lblPrintStyleYearlyLayout, @sdxPrintStyleLayout); + LoadCaption(lblPrintStyleYearlyMonthPerPage, @ sdxPrintStyleMonthPerPage); + LoadStringsCombo(cbxPrintStyleYearlyLayout, + [@sdxPrintStyleMonthlyLayout1PPM, @sdxPrintStyleMonthlyLayout2PPM]); + + LoadStringsCombo(cbxPrintStyleYearlyMonthPerPage, + [@sdxPrintStyleYearly1MPP, @sdxPrintStyleYearly2MPP, + @sdxPrintStyleYearly3MPP, @sdxPrintStyleYearly4MPP, + @sdxPrintStyleYearly6MPP, @sdxPrintStyleYearly12MPP]); + + LoadCaption(lblPrintStyleYearlyResourceCountPerPage, @sdxResourceCountPerPage); + + LoadCaption(lblPrintStyleYearlyInclude, @sdxPrintStyleInclude); + LoadCaption(chbxPrintStyleYearlyTaskPad, @sdxPrintStyleIncludeTaskPad); + LoadCaption(chbxPrintStyleYearlyNotesAreaBlank, @sdxPrintStyleIncludeNotesAreaBlank); + LoadCaption(chbxPrintStyleYearlyNotesAreaLined, @sdxPrintStyleIncludeNotesAreaLined); + LoadCaption(chbxPrimaryPageHeadersOnly, @sdxPrintStylePrimaryPageHeadersOnly); + LoadCaption(chbxPrintStyleYearlyShowEventImages, @sdxPrintStyleShowEventImages); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.PreviewDrawPageContent( + ACanvas: TCanvas; ABounds: TRect); +const + AMessageFlags = DXTO_CENTER_HORIZONTALLY or DXTO_CENTER_VERTICALLY or DXTO_WORDBREAK; +var + AMsg: PChar; + R, R1: TRect; + APrinter: TdxComponentPrinter; + ALink: TcxSchedulerReportLink; + ASource, ADest: TBitmap; +begin + if ReportLink.Component = nil then + begin + ACanvas.Brush.Color := clWindow; + ACanvas.FillRect(ABounds); + Exit; + end; + APrinter := TdxComponentPrinter.Create(nil); + try + ALink := TcxSchedulerReportLink.Create(APrinter); + ALink.LinkInPreviewMode := True; + try + ALink.Assign(ReportLink); + ALink.PrinterPage.RestoreDefaults; + ALink.Component := ReportLink.Component; + ALink.ComponentPrinter := APrinter; + AMsg := nil; + with ALink do + R1 := MakeBounds(0, 0, PageWidth, PageHeight); + ASource := cxCreateBitmap(cxSize(R1.Right, R1.Bottom)); + ASource.Canvas.Lock; + try + R := cxRectOffset(ABounds, -ABounds.Left, -ABounds.Top); + ALink.PrintStyles.ActiveStyle := ALink.PrintStyles[ + ReportLink.PrintStyles.IndexOf(ReportLink.PrintStyles.ActiveStyle)]; + ALink.RebuildReport; + FillRect(ASource.Canvas.Handle, R1, GetSysColorBrush(COLOR_WINDOW)); + if ALink.PageCount > 0 then + APrinter.PaintPage(ASource.Canvas, 0, R1, R1, ALink) + else + with ReportLink.PrintStyles do + begin + if (FActiveStyle = Memo) and Memo.SelectedEventsOnly then + AMsg := PChar(cxGetResourceString(@sdxCannotPrintNoSelectedItems)) + else + AMsg := PChar(cxGetResourceString(@sdxCannotPrintNoItemsAvailable)); + end; + ADest := cxCreateBitmap(cxSize(R.Right, R.Bottom)); + ADest.Canvas.Lock; + try + cxSmoothResizeBitmap(ASource, ADest); + if AMsg <> nil then + dxTextOut(ADest.Canvas.Handle, AMsg, R, AMessageFlags); + ACanvas.Draw(0, 0, ADest); + finally + ADest.Canvas.UnLock; + ADest.Free; + end; + finally + ASource.Canvas.Unlock; + ASource.Free; + end; + finally + ALink.Free; + end; + finally + APrinter.Free; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.UpdateControlsState; +begin + inherited UpdateControlsState; + + UpdateEnabledControls([lblPrintStyleDailyPrintFrom, tePrintStyleDailyPrintFrom, + lblPrintStyleDailyPrintTo, tePrintStyleDailyPrintTo], + ReportLink.PrintStyles.Daily.SupportTimeRange); + UpdateEnabledControls([lblPrintStyleWeeklyPrintFrom, tePrintStyleWeeklyPrintFrom, + lblPrintStyleWeeklyPrintTo, tePrintStyleWeeklyPrintTo], + ReportLink.PrintStyles.Weekly.SupportTimeRange); + + chbxPrintStyleWeeklyDontPrintWeekends.Enabled := + ReportLink.PrintStyles.Weekly.CanDontPrintWeekends; + + UpdateEnabled(lbxStyles, AreNativeStylesAvailable); + UpdateEnabled(btnStyleColor, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(btnStyleFont, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(btnStyleBackgroundBitmap, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(btnStyleBackgroundBitmapClear, AreNativeStylesAvailable and HasSelectedStylesWithAssignedBitmap); + UpdateEnabled(btnStyleRestoreDefaults, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(btnStylesSaveAs, CanSaveStyles); + + UpdateEnabled(lblStyleSheets, AreNativeStylesAvailable); + UpdateEnabled(cbxStyleSheets, AreNativeStylesAvailable); + UpdateEnabled(btnStyleSheetNew, CanCreateStyleSheet); + UpdateEnabled(btnStyleSheetCopy, CanCopyStyleSheet); + UpdateEnabled(btnStyleSheetDelete, CanDeleteStyleSheet); + UpdateEnabled(btnStyleSheetRename, CanRenameStyleSheet); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.UpdateEnabled( + AControl: TControl; AEnabled: Boolean); +begin + TControlAccess(AControl).Enabled := AEnabled; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.UpdateEnabled( + AItem: TMenuItem; AEnabled: Boolean); +begin + AItem.Enabled := AEnabled; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.UpdateEnabledControls( + AControls: array of TControl; AEnabled: Boolean); +var + I: Integer; +begin + for I := 0 to High(AControls) do + UpdateEnabled(AControls[I], AEnabled); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.UpdatePreview; +begin + if Visible then + begin + RefreshPrintStyles; + pbxPrintStylesPreview.Refresh; + pbPreview.Refresh; + end; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetDesignerTabIndex: Integer; +begin + Result := PageControl1.ActivePage.TabIndex; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SetDesignerTabIndex(Value: Integer); +begin + if Value < 0 then Value := 0; + if Value > PageControl1.PageCount - 1 then + Value := PageControl1.PageCount - 1; + PageControl1.ActivePage := PageControl1.Pages[Value]; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoActiveStyleSheetChanged; +begin + inherited; + lbxStyles.ReportLinkStyles := ReportLink.ActiveStyles; + with cbxStyleSheets do + ItemIndex := Properties.Items.IndexOfObject(ActiveStyleSheet); + + if not LockControlsUpdate then + begin + Modified := True; + UpdatePreview; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoFormActivated(AnActive: Boolean); +begin + inherited; + if not AnActive then lbxStyles.HideToolTips; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoRefreshStylesList; +var + Styles: TcxSchedulerReportLinkStyles; + List: TList; +begin + Styles := ReportLink.ActiveStyles; + with lbxStyles.Items do + begin + BeginUpdate; + try + List := TList.Create; + try + SaveSelectedStyles(List); + try + Clear; + AddObject(cxGetResourceString(@sdxSchedulerSchedulerHeader), Styles.SchedulerHeader); + AddObject(cxGetResourceString(@sdxSchedulerContent), Styles.Content); + AddObject(cxGetResourceString(@sdxSchedulerDateNavigatorContent), Styles.DateNavigatorContent); + AddObject(cxGetResourceString(@sdxSchedulerDateNavigatorHeader), Styles.DateNavigatorHeader); + AddObject(cxGetResourceString(@sdxSchedulerDayHeader), Styles.DayHeader); + AddObject(cxGetResourceString(@sdxSchedulerEvent), Styles.Event); + AddObject(cxGetResourceString(@sdxSchedulerResourceHeader), Styles.ResourceHeader); + AddObject(cxGetResourceString(@sdxSchedulerNotesAreaBlank), Styles.NotesAreaBlank); + AddObject(cxGetResourceString(@sdxSchedulerNotesAreaLined), Styles.NotesAreaLined); + AddObject(cxGetResourceString(@sdxSchedulerTaskPad), Styles.TaskPad); + AddObject(cxGetResourceString(@sdxSchedulerTimeRuler), Styles.TimeRuler); + finally + RestoreSelectedStyles(List); + end; + finally + List.Free; + end; + finally + EndUpdate; + end; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoStyleChanged(const ACaption: string; + AStyle: TcxStyle); +begin + inherited; + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoStylesChanged(AStrings: TStrings; + ARecreate: Boolean); +begin + if ARecreate then + RecreateStylesListBox + else + lbxStyles.Invalidate; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.GetSelectedStyleNames(AStrings: TStrings); +var + I: Integer; +begin + AStrings.Clear; + with lbxStyles do + for I := 0 to Items.Count - 1 do + if Selected[I] then + AStrings.AddObject(Items[I], Items.Objects[I]); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.GetStyleNames(out AStrings: TStrings); +begin + AStrings := lbxStyles.Items; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.GetStyleSheetNames(out AStrings: TStrings); +begin + AStrings := cbxStyleSheets.Properties.Items; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.ActivatePrintStyleTab; +begin + pcPrintStyleOptions.ActivePageIndex := FindTabIndexByPrintStyle(ActivePrintStyle); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignTabSheetObjects; +begin + with ReportLink.PrintStyles do + begin + tshDaily.Tag := MakeTTag(Daily); + tshWeekly.Tag := MakeTTag(Weekly); + tshMonthly.Tag := MakeTTag(Monthly); + tshTrifold.Tag := MakeTTag(Trifold); + tshDetails.Tag := MakeTTag(Details); + tshMemo.Tag := MakeTTag(Memo); + tshYearly.Tag := MakeTTag(Yearly); + end; +end; + +function TcxfmSchedulerReportLinkDesignWindow.FindTabIndexByPrintStyle(APrintStyle: TcxCustomSchedulerReportLinkPrintStyle): Integer; +begin + for Result := 0 to pcPrintStyleOptions.PageCount - 1 do + if pcPrintStyleOptions.Pages[Result].Tag = MakeTTag(APrintStyle) then Exit; + Result := -1; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.RefreshPrintStyles; +var + AItems: TcxImageComboBoxItems; + ActiveStyleIndex, I: Integer; + + procedure CheckAndAddPrintStyle(APrintStyle: TcxCustomSchedulerReportLinkPrintStyle); + begin + with TcxImageComboBoxItem(AItems.Add) do + begin + ImageIndex := APrintStyle.GlyphIndex; + Description := APrintStyle.Caption; + Value := Index; + Tag := Integer(APrintStyle); + end; + if (ActiveStyleIndex = -1) and (APrintStyle = ReportLink.PrintStyles.ActiveStyle) then + ActiveStyleIndex := AItems.Count - 1; + end; + +begin + ActiveStyleIndex := cbxPrintStyles.ItemIndex; + cbxPrintStyles.Properties.Images := StyleImages; + AItems := cbxPrintStyles.Properties.Items; + AItems.BeginUpdate; + try + AItems.Clear; + for I := 0 to ReportLink.PrintStyles.Count - 1 do + CheckAndAddPrintStyle(ReportLink.PrintStyles.Items[I]); + cbxPrintStyles.ItemIndex := ActiveStyleIndex; + finally + AItems.EndUpdate; + end; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetActivePrintStyle: TcxCustomSchedulerReportLinkPrintStyle; +begin + if cbxPrintStyles.ItemIndex <> -1 then + begin + with cbxPrintStyles.Properties.Items[cbxPrintStyles.ItemIndex] do + Result := TcxCustomSchedulerReportLinkPrintStyle(Tag) + end + else + Result := nil; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetActiveStyle: TcxStyle; +begin + with lbxStyles do + if ItemIndex <> -1 then + Result := TcxStyle(Items.Objects[ItemIndex]) + else + Result := nil; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetComponent: TcxScheduler; +begin + Result := inherited Component as TcxScheduler; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetHasSelectedStyles: Boolean; +begin + Result := lbxStyles.SelCount <> 0; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetHasSelectedStylesWithAssignedBitmap: Boolean; +var + Strings: TStrings; + I: Integer; + cxStyle: TcxStyle; +begin + Result := True; + Strings := TStringList.Create; + try + GetSelectedStyleNames(Strings); + for I := 0 to Strings.Count - 1 do + begin + cxStyle := TcxStyle(Strings.Objects[I]); + if (cxStyle <> nil) and (cxStyle.Bitmap <> nil) and not cxStyle.Bitmap.Empty then + Exit; + end; + finally + Strings.Free; + end; + Result := False; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetReportLink: TcxSchedulerReportLink; +begin + Result := inherited ReportLink as TcxSchedulerReportLink; +end; + +function TcxfmSchedulerReportLinkDesignWindow.CanSelectAllStyles: Boolean; +var + I: Integer; +begin + Result := AreNativeStylesAvailable; + if Result then + begin + for I := 0 to lbxStyles.Items.Count - 1 do + if not lbxStyles.Selected[I] then Exit; + Result := False; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.CreateControls; + + procedure CreateStylesListBox; + begin + lbxStyles := TdxStylesListBox.Create(Self); + lbxStyles.Parent := tshStyles; + lbxStyles.BoundsRect := bvlStylesHost.BoundsRect; + lbxStyles.PopupMenu := pmStyles; + lbxStyles.TabOrder := chbxUseNativeStyles.TabOrder + 1; + lbxStyles.OnClick := lbxStylesClick; + bvlStylesHost.Visible := False; + + dxPSPopupMan.dxPSPopupMenuController.RegisterControl(lbxStyles); + end; + +begin + CreateStylesListBox; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.RecreateStylesListBox; +var + List: TList; +begin + List := TList.Create; + try + SaveSelectedStyles(List); + dxPSUtl.dxRecreateWnd(lbxStyles); + RestoreSelectedStyles(List); + finally + List.Free; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.RestoreSelectedStyles(AList: TList); +var + I: Integer; +begin + for I := 0 to AList.Count - 1 do + lbxStyles.Selected[Integer(AList[I])] := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SaveSelectedStyles(AList: TList); +var + I: Integer; +begin + AList.Clear; + for I := 0 to lbxStyles.Items.Count - 1 do + if lbxStyles.Selected[I] then AList.Add(TObject(I)); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SetActivePage; +begin + PageControl1.ActivePage := PageControl1.Pages[DesignerTabIndex]; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SetOptionsFormattingByIndex(AnIndex: Integer; + AValue: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsFormatting do + case AnIndex of + 0: + begin + UseNativeStyles := AValue; + RecreateStylesListBox; + end; + 1: SuppressBackgroundBitmaps := AValue; + 2: SuppressContentColoration := AValue; + end; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SetPrintStyleOptionsViewByIndex(AnIndex: Integer; + AValue: Boolean); +begin + if not LockControlsUpdate then + begin + case AnIndex of + 0: + ActivePrintStyle.ShowTaskPad := AValue; + 1: + ActivePrintStyle.ShowNotesAreaBlank := AValue; + 2: + ActivePrintStyle.ShowNotesAreaLined := AValue; + end; + Modified := True; + UpdatePreview; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SetPrintStyleRangeByIndex(AnIndex: Integer; + const ATime: TDateTime); +begin + if not LockControlsUpdate then + begin + case AnIndex of + 0: + ActivePrintStyle.TimePrintFrom := ATime; + 1: + ActivePrintStyle.TimePrintTo := ATime; + end; + Modified := True; + UpdatePreview; + UpdateControlsState; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SetPrintStyleResourceCountPerPageByIndex(AnIndex: Integer; + AValue: TcxEditValue); +begin + if LockControlsUpdate then Exit; + with ReportLink.PrintStyles do + case AnIndex of + 0: + Daily.ResourceCountPerPage := AValue; + 1: + Weekly.ResourceCountPerPage := AValue; + 2: + Monthly.ResourceCountPerPage := AValue; + 3: + Yearly.ResourceCountPerPage := AValue; + end; + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SetShowImagesCheckBoxes( + AEventImages, AResourceImages: TcxCheckBox; + APrintStyle: TcxCustomSchedulerReportLinkPrintStyle); +begin + if AEventImages <> nil then + begin + AEventImages.Enabled := ReportLink.HasEventImages; + AEventImages.Checked := AEventImages.Enabled and APrintStyle.ShowEventImages; + end; + if AResourceImages <> nil then + begin + AResourceImages.Enabled := ReportLink.HasResourceImages; + AResourceImages.Checked := AResourceImages.Enabled and APrintStyle.ShowResourceImages; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.FormCloseQuery(Sender: TObject; + var CanClose: Boolean); + + procedure ValidateEditors; + begin + FIsFormClosing := True; + try + dePrintRangeStart.ValidateEdit(False); + dePrintRangeEnd.ValidateEdit(False); + + tePrintStyleDailyPrintFrom.ValidateEdit(False); + tePrintStyleDailyPrintTo.ValidateEdit(False); + tePrintStyleWeeklyPrintFrom.ValidateEdit(False); + tePrintStyleWeeklyPrintTo.ValidateEdit(False); + finally + FisFormClosing := False; + end; + end; + +begin + if ModalResult = mrOK then + begin + ValidateEditors; + CanClose := IsValidConditions; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.PageControl1Change(Sender: TObject); +begin + pnlPrintStylesPreview.Visible := PageControl1.ActivePage = tshPrintStyles; + pnlPreview.Visible := PageControl1.ActivePage <> tshPrintStyles; + lblPreviewWindow.Parent := PageControl1.ActivePage; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.lbxStylesClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + UpdateControlsState; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleFontClick(Sender: TObject); +begin + PerformStylesChangeFont; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleColorClick(Sender: TObject); +begin + PerformStylesChangeColor; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleBackgroundBitmapClick(Sender: TObject); +begin + PerformStylesChangeBitmap; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleBackgroundBitmapClearClick(Sender: TObject); +begin + PerformStylesClearBitmap; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.miStylesSelectAllClick(Sender: TObject); +{$IFNDEF DELPHI6} +var + I: Integer; +{$ENDIF} +begin + with lbxStyles do + begin + {$IFDEF DELPHI6} + SelectAll; + {$ELSE} + Items.BeginUpdate; + try + for I := 0 to Items.Count - 1 do + Selected[I] := True; + finally + Items.EndUpdate; + end; + {$ENDIF} + end; + UpdateControlsState; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleRestoreDefaultsClick(Sender: TObject); +begin + PerformStylesRestoreDefaults; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStylesSaveAsClick(Sender: TObject); +begin + PerformStylesSaveAsStyleSheet; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxStyleSheetsClick(Sender: TObject); +begin + with TcxComboBox(Sender) do + ActiveStyleSheet := TcxCustomStyleSheet(Properties.Items.Objects[ItemIndex]); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxStyleSheetsPropertiesDrawItem( + AControl: TcxCustomComboBox; ACanvas: TcxCanvas; AIndex: Integer; + const ARect: TRect; AState: TOwnerDrawState); +begin + PerformStyleSheetDrawItem(ACanvas.Canvas, AIndex, ARect, AState, AControl.Enabled); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxStyleSheetsKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + PerformStyleSheetKeyDown(Sender, Key, Shift); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleSheetNewClick(Sender: TObject); +begin + PerformStyleSheetNew; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleSheetCopyClick(Sender: TObject); +begin + PerformStyleSheetCopy; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleSheetDeleteClick(Sender: TObject); +begin + PerformStyleSheetDelete; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleSheetRenameClick(Sender: TObject); +begin + PerformStyleSheetRename; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.lblUseNativeStylesClick(Sender: TObject); +begin + if chbxUseNativeStyles.CanFocus then ActiveControl := chbxUseNativeStyles; + chbxUseNativeStyles.Checked := not chbxUseNativeStyles.Checked; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.OptionsFormattingClick(Sender: TObject); +begin + with TcxCheckBox(Sender) do + SetOptionsFormattingByIndex(TTagToInt(Tag), Checked); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LookAndFeelChange(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TcxComboBox(Sender) do + ReportLink.OptionsFormatting.LookAndFeelKind := TcxLookAndFeelKind(Properties.Items.Objects[ItemIndex]); + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.pmStylesPopup(Sender: TObject); +begin + lbxStyles.HideToolTips; + UpdateEnabled(miStyleColor, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(miStyleFont, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(miStyleBackgroundBitmap, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(miStyleBackgroundBitmapClear, AreNativeStylesAvailable and HasSelectedStylesWithAssignedBitmap); + UpdateEnabled(miStyleRestoreDefaults, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(miStylesSelectAll, CanSelectAllStyles); + UpdateEnabled(miStylesSaveAs, CanSaveStyles); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleYearlyLayoutClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Yearly.Layout := + TcxSchedulerReportLinkPeriodicPrintStyleLayout(TcxComboBox(Sender).ItemIndex); + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleYearlyMonthPagesPerYearClick( + Sender: TObject); +const + MonthsPerPage: array[0..5] of Integer = (1, 2, 3, 4, 6, 12); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Yearly.MonthCountPerPage := + MonthsPerPage[TcxComboBox(Sender).ItemIndex]; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.dePrintRangeStartEditValueChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintRange.PrintFrom := TcxDateEdit(Sender).Date; + Modified := True; + UpdatePreview; + UpdateControlsState; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.dePrintRangeEndEditValueChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintRange.PrintTo := TcxDateEdit(Sender).Date; + Modified := True; + UpdatePreview; + UpdateControlsState; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStylesClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with ReportLink.PrintStyles do + FActiveStyle := Items[TcxComboBox(Sender).ItemIndex]; + ActivatePrintStyleTab; + Modified := True; + UpdatePreview; + UpdateControlsState; +end; + +// Daily +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleDailyLayoutClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Daily.Layout := + TcxSchedulerReportLinkPeriodicPrintStyleLayout(TcxComboBox(Sender).ItemIndex); + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.sePrintStyleResourceCountPerPagePropertiesChanged( + Sender: TObject); +begin + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.sePrintStyleResourceCountPerPagePropertiesEditValueChanged( + Sender: TObject); +begin + with TcxSpinEdit(Sender) do + SetPrintStyleResourceCountPerPageByIndex(TTagToInt(Tag), Value); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleOptionsViewClick( + Sender: TObject); +begin + with TcxCheckBox(Sender) do + SetPrintStyleOptionsViewByIndex(TTagToInt(Tag), Checked); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.tePrintStylePrintRangePropertiesEditValueChanged( + Sender: TObject); +begin + with TcxTimeEdit(Sender) do + SetPrintStyleRangeByIndex(TTagToInt(Tag), Time); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.tePrintStylePrintRangePropertiesChange( + Sender: TObject); +begin + Modified := True; +end; + +// Weekly +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleWeeklyArrangeClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Weekly.Arrange := + TcxSchedulerReportLinkWeeklyPrintStyleArrange(TcxComboBox(Sender).ItemIndex); + cbxPrintStyles.Invalidate; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleWeeklyLayoutClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Weekly.Layout := + TcxSchedulerReportLinkPeriodicPrintStyleLayout(TcxComboBox(Sender).ItemIndex); + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleWeeklyDaysLayoutClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Weekly.DaysLayout := + TcxSchedulerWeekViewDaysLayout(TcxComboBox(Sender).ItemIndex); + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleWeeklyDontPrintWeekendsClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Weekly.DontPrintWeekends := TcxCheckBox(Sender).Checked; + Modified := True; +end; + +// Monthly +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleMonthlyLayoutClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Monthly.Layout := + TcxSchedulerReportLinkPeriodicPrintStyleLayout(TcxComboBox(Sender).ItemIndex); + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleMonthlyDontPrintWeekendsClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Monthly.DontPrintWeekends := + TcxCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleMonthlyPrintExactlyOneMonthPerPageClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Monthly.PrintExactlyOneMonthPerPage := + TcxCheckBox(Sender).Checked; + Modified := True; +end; + +// Tri-fold +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleTrifoldSectionModeClick( + Sender: TObject); +begin + if LockControlsUpdate or not (ActivePrintStyle is TcxSchedulerReportLinkTrifoldPrintStyle) then Exit; + with TcxSchedulerReportLinkTrifoldPrintStyle(ActivePrintStyle) do + FSections[TTagToInt(TcxComboBox(Sender).Tag)] := TcxSchedulerReportLinkTrifoldPrintStyleSectionMode(TcxComboBox(Sender).ItemIndex); + Modified := True; + UpdateControlsState; +end; + +// Details +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleDetailsUsePaginationClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Details.UsePagination := TcxCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleDetailsPaginationClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Details.PaginationMode := + TcxSchedulerReportLinkDetailsPrintStylePaginationMode(TcxComboBox(Sender).ItemIndex); + Modified := True; +end; + +// Memo +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleMemoStartEachItemOnNewPageClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Memo.StartEachItemOnNewPage := TcxCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleMemoPrintOnlySelectedEventsClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Memo.SelectedEventsOnly := TcxCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.pbxPrintStylesPreviewPaint(Sender: TObject); +begin + with TPaintBox(Sender) do + if ActivePrintStyle <> nil then + ActivePrintStyle.DrawDesignWindowPreview(Canvas, ClientRect); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.StyleController1StyleChanged( + Sender: TObject); +begin +// +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.pbPreviewPaint( + Sender: TObject); +begin + PreviewDrawPageContent(pbPreview.Canvas, pbPreview.ClientRect); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxLookAndFeelPropertiesChange( + Sender: TObject); +begin + ReportLink.OptionsFormatting.LookAndFeelKind := TcxLookAndFeelKind(cbxLookAndFeel.ItemIndex); +end; + +{ TcxSchedulerReportPageSite } + +procedure TcxSchedulerReportPageSite.ReadProperties(AReader: TdxPSDataReader); +begin + inherited ReadProperties(AReader); + FPageIndex := AReader.ReadInteger; + FPrimaryPage := AReader.ReadBoolean; +end; + +procedure TcxSchedulerReportPageSite.WriteProperties(AWriter: TdxPSDataWriter); +begin + inherited WriteProperties(AWriter); + AWriter.WriteInteger(FPageIndex); + AWriter.WriteBoolean(FPrimaryPage); +end; + +{ TcxSchedulerReportPageItemCell } + +constructor TcxSchedulerReportPageItemCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + BorderClass := TdxPSCellUltraFlatBorder; + ClipChildren := True; +end; + +function TcxSchedulerReportPageItemCell.GetType: TcxSchedulerReportItemsType; +begin + Result := srUnknownItem; +end; + +procedure TcxSchedulerReportPageItemCell.SetCellViewParams( + AItem: TdxReportVisualItem; const AParams: TcxViewParams); +begin + ReportLink.SetCellViewParams(AItem, AParams); +end; + +procedure TcxSchedulerReportPageItemCell.SetCellViewParams( + AItem: TdxReportVisualItem; const AParams: TdxReportItemViewParams); +begin + ReportLink.SetCellViewParams(AItem, AParams); +end; + +function TcxSchedulerReportPageItemCell.GetPageIndex: Integer; +begin + Result := PageSite.PageIndex; +end; + +function TcxSchedulerReportPageItemCell.GetPageSite: TcxSchedulerReportPageSite; +var + AParent: TdxReportCell; +begin + AParent := inherited Parent; + while (AParent <> nil) and not (AParent is TcxSchedulerReportPageSite) do + AParent := AParent.Parent; + Result := AParent as TcxSchedulerReportPageSite; +end; + +function TcxSchedulerReportPageItemCell.GetPrimaryPage: Boolean; +begin + Result := PageSite.PrimaryPage; +end; + +function TcxSchedulerReportPageItemCell.GetReportLink: TcxSchedulerReportLink; +begin + Result := TcxSchedulerReportLink(Renderer.ReportLink); +end; + +{ TcxSchedulerReportNotesDataCell } + +constructor TcxSchedulerReportNotesDataCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + TextAlignX := taCenterX; + TextAlignY := taCenterY; + CaptionHeight := 16; + Data := cdidSchedulerNotesArea; +end; + +procedure TcxSchedulerReportNotesDataCell.DrawContent( + DC: HDC; AStage: TdxPSRenderStages); +var + R: TRect; + C, I: Integer; +begin + inherited DrawContent(DC, AStage); + if CaptionHeight <= 0 then Exit; + R := GetInnerBounds(DC); + FixupRect(DC, R); + C := R.Bottom - R. Top; + R.Bottom := R.Top + CaptionHeight; + // + if Caption <> '' then + begin + Renderer.DrawText(DC, R, -1, cxTextOffset, cxTextOffset, Caption, Font, + Color, TextAlignX, TextAlignY, False, MultiLine, False); + end; + // + Inc(R.Bottom, Max(1, Renderer.LineThickness div 2)); + if Lined then + C := (C - Renderer.LineThickness) div CaptionHeight + else + C := 1; + R.Top := R.Bottom - Renderer.LineThickness; + for I := 0 to C - 1 do + begin + FixupRect(DC, R); + Renderer.FillRect(DC, R, clBlack); + OffsetRect(R, 0, CaptionHeight); + end; +end; + +procedure TcxSchedulerReportNotesDataCell.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FCaption := AReader.ReadString; + FCaptionHeight := AReader.ReadInteger; + FLined := AReader.ReadBoolean; +end; + +procedure TcxSchedulerReportNotesDataCell.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteString(FCaption); + AWriter.WriteInteger(FCaptionHeight); + AWriter.WriteBoolean(FLined); +end; + +function TcxSchedulerReportNotesDataCell.GetMultiLine: Boolean; +begin + Result := inherited MultiLine; +end; + +function TcxSchedulerReportNotesDataCell.GetTextAlignX: TdxTextAlignX; +begin + Result := inherited TextAlignX; +end; + +function TcxSchedulerReportNotesDataCell.GetTextAlignY: TdxTextAlignY; +begin + Result := inherited TextAlignY; +end; + +procedure TcxSchedulerReportNotesDataCell.SetMultiLine(Value: Boolean); +begin + inherited MultiLine := Value; +end; + +procedure TcxSchedulerReportNotesDataCell.SetTextAlignX( + Value: TdxTextAlignX); +begin + inherited TextAlignX := Value; +end; + +procedure TcxSchedulerReportNotesDataCell.SetTextAlignY( + Value: TdxTextAlignY); +begin + inherited TextAlignY := Value; +end; + +{ TcxSchedulerReportNotesAreaCell } + +constructor TcxSchedulerReportNotesAreaCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + AddDataItem(GetDataCellClass) +end; + +constructor TcxSchedulerReportNotesAreaCell.CreateEx(AParent: TdxReportCell; ALined: Boolean); +begin + Create(AParent); + FLined := ALined; + DataCell.CellSides := []; + DataCell.Caption := cxGetResourceString(@sdxNotes); + DataCell.Lined := ALined; + ClipChildren := True; +end; + +procedure TcxSchedulerReportNotesAreaCell.BoundsChanged; +begin + inherited BoundsChanged; + DataCell.BoundsRect := GetInnerBounds(0); +end; + +procedure TcxSchedulerReportNotesAreaCell.ConvertCoords( + APixelsNumerator, APixelsDenominator: Integer); +begin + inherited ConvertCoords(APixelsNumerator, APixelsDenominator); + DataCell.CaptionHeight := MulDiv(DataCell.CaptionHeight, APixelsNumerator, APixelsDenominator); +end; + +function TcxSchedulerReportNotesAreaCell.GetType: TcxSchedulerReportItemsType; +begin + Result := srNotesBlank; + if DataCell.Lined then + Result := srNotesLined; +end; + +function TcxSchedulerReportNotesAreaCell.GetDataCellClass: TcxSchedulerReportNotesDataCellClass; +begin + Result := TcxSchedulerReportNotesDataCell; +end; + +procedure TcxSchedulerReportNotesAreaCell.SetFontIndex(Value: Integer); +begin + inherited SetFontIndex(Value); + if Font <> nil then + DataCell.CaptionHeight := cxTextHeight(Font) + cxTextOffset * 2; +end; + +function TcxSchedulerReportNotesAreaCell.GetDataCell: TcxSchedulerReportNotesDataCell; +begin + if (DataItemCount > 0) and (DataItems[0] is TcxSchedulerReportNotesDataCell) then + Result := TcxSchedulerReportNotesDataCell(DataItems[0]) + else + Result := nil; +end; + +{ TcxSchedulerReportTaskPadCell } + +constructor TcxSchedulerReportTaskPadCell.CreateEx( + AParent: TdxReportCell; ALined: Boolean); +begin + inherited CreateEx(AParent, ALined); + DataCell.Caption := cxGetResourceString(@sdxTaskPad); + DataCell.Data := cdidSchedulerTaskPad; +end; + +procedure TcxSchedulerReportTaskPadCell.BoundsChanged; +begin + inherited; + TaskPadDataSite.BoundsRect := CalculateTaskPadDataSiteBounds; +end; + +function TcxSchedulerReportTaskPadCell.CalculateTaskPadDataSiteBounds: TRect; +begin + Result := GetInnerBounds(NullDC); + Inc(Result.Top, DataCell.CaptionHeight); +end; + +function TcxSchedulerReportTaskPadCell.GetType: TcxSchedulerReportItemsType; +begin + Result := srTaskPad; +end; + +function TcxSchedulerReportTaskPadCell.GetTaskPadDataSite: TdxReportCell; +begin + if CellCount = 0 then AddCell; + Result := Cells[0]; + Result.CellSides := []; + Result.BoundsRect := CalculateTaskPadDataSiteBounds; +end; + +{ TcxSchedulerReportSchedulerHeaderDataCell } + +constructor TcxSchedulerReportSchedulerHeaderDataCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + CellSides := []; + Transparent := True; + Data := cdidSchedulerSchedulerHeader; +end; + +{ TcxSchedulerReportSchedulerHeaderCell } + +constructor TcxSchedulerReportSchedulerHeaderCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + FContent := AddContentCell; +end; + +procedure TcxSchedulerReportSchedulerHeaderCell.AdjustTextSize; +var + R1, R2: TRect; +begin + R1 := Content.BoundsRect; + R2 := R1; + if (SecondaryText <> '') and (PrimaryText <> '') then + begin + with R1 do + Bottom := Bottom - (Bottom - Top) div 4; + R2.Top := R1.Bottom; + end; + FPrimaryTextCell := AddTextCell(PrimaryText, R1, True); + FSecondaryTextCell := AddTextCell(SecondaryText, R2, False); + FContent.Index := MaxInt; //send to back +end; + +function TcxSchedulerReportSchedulerHeaderCell.AddContentCell: TcxSchedulerReportSchedulerHeaderDataCell; +begin + Result := TcxSchedulerReportSchedulerHeaderDataCell(AddDataItem(TcxSchedulerReportSchedulerHeaderDataCell)); +end; + +function TcxSchedulerReportSchedulerHeaderCell.AddTextCell(AText: string; + const ABounds: TRect; AMultiLine: Boolean): TdxReportCellString; +var + AFontH, ABoundsH: Integer; + AParams: TdxReportItemViewParams; +begin + if PrimaryText = '' then + begin + Result := nil; + Exit; + end; + Result := AddDataItem(TdxReportCellString) as TdxReportCellString; + Result.BoundsRect := ABounds; + Result.Text := AText; + Result.CellSides := []; + Result.Transparent := True; + Result.TextAlignY := taTop; + Result.TextAlignX := taLeft; + Result.Multiline := AMultiLine; + if AMultiLine and (Pos('#13', AText) <> 0) then + AText := Copy(AText, 1, Pos('#13', AText)); + AFontH := cxTextHeight(Font); + ABoundsH := (ABounds.Bottom - ABounds.Top) - cxTextOffset * 2; + if AMultiLine then + ABoundsH := ABoundsH div 2; + FillChar(AParams, SizeOf(AParams), 0); + AParams.FontStyle := []; + AParams.FontSize := MulDiv(Font.Size, ABoundsH, AFontH); + while (AParams.FontSize > 3) and (cxTextWidth(Font, AText, AParams.FontSize) > + ((ABounds.Right - ABounds.Left) - cxTextOffset * 2)) do Dec(AParams.FontSize, 2); + AParams.Transparent := True; + AParams.NativeParams.Font := Font; + AParams.NativeParams.TextColor := Font.Color; + ReportLink.SetCellViewParams(Result, AParams); +end; + +function TcxSchedulerReportSchedulerHeaderCell.GetType: TcxSchedulerReportItemsType; +begin + Result := srHeader; +end; + +{ TcxSchedulerReportDateNavigatorItem } + +constructor TcxSchedulerReportDateNavigatorItem.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + CellSides := []; +end; + +function TcxSchedulerReportDateNavigatorItem.GetDefaultDTFormat: DWORD; +begin + Result := DXTO_PATTERNEDTEXT or DXTO_SINGLELINE; +end; + +procedure TcxSchedulerReportDateNavigatorItem.SetText(const Value: string); +begin +end; + +function TcxSchedulerReportDateNavigatorItem.GetDateNavigator: TcxSchedulerReportDateNavigatorCell; +begin + Result := Parent as TcxSchedulerReportDateNavigatorCell; +end; + +{ TcxSchedulerReportDateNavigatorHeader } + +constructor TcxSchedulerReportDateNavigatorHeader.CreateEx(AParent: TdxReportCell; AYear, AMonth: Word); +begin + Create(AParent); + Transparent := False; + TextAlignX := taCenterX; + Data := cdidSchedulerDateNavigatorHeader; + FMonth := AMonth; + FYear := AYear; +end; + +procedure TcxSchedulerReportDateNavigatorHeader.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportDateNavigatorHeader then + with TcxSchedulerReportDateNavigatorHeader(Source) do + begin + Self.FMonth := Month; + Self.FYear := Year; + end; + inherited Assign(Source); +end; + +function TcxSchedulerReportDateNavigatorHeader.GetText: string; +begin + Result := LongMonthNames[Month] + ' ' + IntToStr(Year); +end; + +procedure TcxSchedulerReportDateNavigatorHeader.ReadData( + AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FMonth := AReader.ReadInteger; + FYear := AReader.ReadInteger; +end; + +procedure TcxSchedulerReportDateNavigatorHeader.WriteData( + AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteInteger(FMonth); + AWriter.WriteInteger(FYear); +end; + +{ TcxSchedulerReportDateNavigatorDay } + +constructor TcxSchedulerReportDateNavigatorDay.CreateEx(AParent: TdxReportCell; + ADay, ACol, ARow: Integer; ABold: Boolean); +begin + Create(AParent); + RightIndent := 2; + TextAlignX := taRight; + TextAlignY := taCenterY; + Data := cdidSchedulerDateNavigatorDay; + FDay := ADay; + FCol := ACol; + FRow := ARow; + Bold := ABold; +end; + +procedure TcxSchedulerReportDateNavigatorDay.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerReportDateNavigatorDay then + with TcxSchedulerReportDateNavigatorDay(Source) do + begin + Self.FDay := Day; + Self.FCol := Col; + Self.FRow := Row; + end; +end; + +function TcxSchedulerReportDateNavigatorDay.GetText: string; +begin + Result := IntToStr(Day); +end; + +procedure TcxSchedulerReportDateNavigatorDay.ReadData(AReader: TdxPSDataReader); +var + Value: Integer; +begin + inherited ReadData(AReader); + Value := AReader.ReadInteger; + FDay := TLongRec(Value).Bytes[0]; + FCol := TLongRec(Value).Bytes[1]; + FRow := TLongRec(Value).Bytes[2]; +end; + +procedure TcxSchedulerReportDateNavigatorDay.WriteData(AWriter: TdxPSDataWriter); +var + Value: Integer; +begin + inherited WriteData(AWriter); + TLongRec(Value).Bytes[0] := Day; + TLongRec(Value).Bytes[1] := Col; + TLongRec(Value).Bytes[2] := Row; + AWriter.WriteInteger(Value); +end; + +function TcxSchedulerReportDateNavigatorDay.GetDate: TDate; +begin + Result := EncodeDate(Year, Month, Day); +end; + +function TcxSchedulerReportDateNavigatorDay.GetBold: Boolean; +begin + Result := GetFormatBit(dxFormatDayIsBold); +end; + +function TcxSchedulerReportDateNavigatorDay.GetMonth: Word; +begin + if DateNavigator <> nil then + Result := DateNavigator.Month + else + Result := 1; +end; + +function TcxSchedulerReportDateNavigatorDay.GetYear: Word; +begin + if DateNavigator <> nil then + Result := DateNavigator.Year + else + Result := 1; +end; + +procedure TcxSchedulerReportDateNavigatorDay.SetBold(Value: Boolean); +begin + SetFormatBit(dxFormatDayIsBold, Value); +end; + +{ TcxSchedulerReportDateNavigatorDayCaption } + +constructor TcxSchedulerReportDateNavigatorDayCaption.CreateEx(AParent: TdxReportCell; + ADayOfWeek: TDay; ACol: Integer); +begin + inherited Create(AParent); + RightIndent := 2; + TextAlignX := taRight; + TextAlignY := taCenterY; + Data := cdidSchedulerDateNavigatorDayCaption; + FCol := ACol; + FDayOfWeek := ADayOfWeek; + FDayText := GetDayText; +end; + +procedure TcxSchedulerReportDateNavigatorDayCaption.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerReportDateNavigatorDayCaption then + with TcxSchedulerReportDateNavigatorDayCaption(Source) do + begin + Self.FDayOfWeek := DayOfWeek; + Self.FCol := Col; + Self.FDayText := FDayText; + end; +end; + +function TcxSchedulerReportDateNavigatorDayCaption.GetText: string; +begin + Result := FDayText; +end; + +function TcxSchedulerReportDateNavigatorDayCaption.GetDayText: string; +var + FDayIndex: Integer; +begin + FDayIndex := Byte(DateNavigator.StartOfWeek) + 1 + Col; + if FDayIndex > 7 then Dec(FDayIndex, 7); + + if Font.Charset in [ARABIC_CHARSET, CHINESEBIG5_CHARSET, GB2312_CHARSET] then + Result := AnsiLastChar(ShortDayNames[FDayIndex]) + else + Result := WideString(ShortDayNames[FDayIndex])[1]; +end; + +procedure TcxSchedulerReportDateNavigatorDayCaption.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FDayText := AReader.ReadString; +end; + +procedure TcxSchedulerReportDateNavigatorDayCaption.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteString(FDayText); +end; + +{ TcxSchedulerReportDateNavigatorWeekNumber } + +constructor TcxSchedulerReportDateNavigatorWeekNumber.CreateEx(AParent: TdxReportCell; + AWeekNumber, ARow: Integer); +begin + Create(AParent); + RightIndent := 4; + TextAlignX := taRight; + TextAlignY := taCenterY; + Data := cdidSchedulerDateNavigatorWeekNumber; + FRow := ARow; + FWeekNumber := AWeekNumber; +end; + +procedure TcxSchedulerReportDateNavigatorWeekNumber.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxSchedulerReportDateNavigatorWeekNumber then + with TcxSchedulerReportDateNavigatorWeekNumber(Source) do + begin + Self.FWeekNumber := WeekNumber; + Self.FRow := Row; + end; +end; + +function TcxSchedulerReportDateNavigatorWeekNumber.GetText: string; +begin + Result := IntToStr(WeekNumber); +end; + +procedure TcxSchedulerReportDateNavigatorWeekNumber.ReadData(AReader: TdxPSDataReader); +var + Value: Integer; +begin + inherited ReadData(AReader); + Value := AReader.ReadInteger; + FWeekNumber := TLongRec(Value).Bytes[0]; + FRow := TLongRec(Value).Bytes[1]; +end; + +procedure TcxSchedulerReportDateNavigatorWeekNumber.WriteData(AWriter: TdxPSDataWriter); +var + Value: Integer; +begin + inherited WriteData(AWriter); + TLongRec(Value).Bytes[0] := WeekNumber; + TLongRec(Value).Bytes[1] := Row; + AWriter.WriteInteger(Value); +end; + +{ TcxSchedulerReportDateNavigatorCell } + +constructor TcxSchedulerReportDateNavigatorCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + CellSides := []; + Transparent := False; + FStartOfWeek := TDay(DateTimeHelper.StartOfWeek); +end; + +constructor TcxSchedulerReportDateNavigatorCell.CreateEx(AParent: TdxReportCell; + AFirstWeekOfYear: TcxFirstWeekOfYear; AYear, AMonth: Word; + AShowDatesContainingEventsInBold, AShowWeekNumbers: Boolean); +begin + Create(AParent); + FYear := AYear; + FMonth := AMonth; + FVertOffset := -1; + FFirstWeekOfYear := AFirstWeekOfYear; + FShowWeekNumbers := AShowWeekNumbers; + FShowDatesContainingEventsInBold := AShowDatesContainingEventsInBold; +end; + +procedure TcxSchedulerReportDateNavigatorCell.AdjustSize(var AContentParams, + AHeaderParams: TdxReportItemViewParams; AHeight, AMaxHeight: Integer); + + function TestSize: Boolean; + var + ATestHeight: Integer; + begin + ATestHeight := GetMonthSize(AContentParams, AHeaderParams).cy; + if AMaxHeight > (ATestHeight + RowHeight) then + begin + FVertOffset := (AMaxHeight - ATestHeight) div 2; + Result := True; + end + else + Result := False; + end; + +begin + if TestSize then Exit; + AContentParams.FontSize := Abs(AContentParams.NativeParams.Font.Size); + AHeaderParams.FontSize := Abs(AHeaderParams.NativeParams.Font.Size); + repeat + if AContentParams.FontSize > AHeaderParams.FontSize then + Dec(AContentParams.FontSize) + else + if AContentParams.FontSize < AHeaderParams.FontSize then + Dec(AHeaderParams.FontSize) + else + begin + Dec(AContentParams.FontSize); + Dec(AHeaderParams.FontSize); + end; + until TestSize; +end; + +function TcxSchedulerReportDateNavigatorCell.CalculateSize( + const AContentParams, AHeaderParams: TdxReportItemViewParams): TSize; +begin + FMonthSize := GetMonthSize(AContentParams, AHeaderParams); + Result := FMonthSize; + Inc(Result.cy, 2 * RowHeight); + CreateItems; + AdjustItemsVertical; + SetViewParams(AContentParams, AHeaderParams); +end; + +class function TcxSchedulerReportDateNavigatorCell.MeasureDateNavigatorHeight( + const AContentParams, AHeaderParams: TcxViewParams): Integer; +var + AColWidth, ARowHeight, ADayCaptionsHeight, AHeaderHeight: Integer; +begin + GetContentPartSizes(AContentParams.Font, AColWidth, ARowHeight, ADayCaptionsHeight); + GetHeaderPartSizes(AHeaderParams.Font, AHeaderHeight); + Result := GetMonthHeight(AHeaderHeight, ADayCaptionsHeight, ARowHeight) + 2 * ARowHeight; +end; + +procedure TcxSchedulerReportDateNavigatorCell.AdjustItemsVertical; +var + I: Integer; +begin + if FVertOffset < 0 then FVertOffset := RowHeight; + for I := 0 to DataItemCount - 1 do + with DataItems[I] do Top := Top + FVertOffset; +end; + +function TcxSchedulerReportDateNavigatorCell.ColOfDate(ADate: TDateTime): Integer; +begin + Result := DayOfWeek(ADate) - Byte(StartOfWeek) - 1; + if Result < 0 then Inc(Result, 7); +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateDayCaptions; +var + R: TRect; + I, ADayOfWeek: Integer; + ACaption: TcxSchedulerReportDateNavigatorDayCaption; +begin + R.Top := HeaderHeight; + R.Bottom := R.Top + DayCaptionsHeight - 2; + R.Right := ColWidth; + FDayCaptionCount := 7; + for I := 0 to FDayCaptionCount - 1 do + begin + ADayOfWeek := I + Byte(StartOfWeek); + if ADayOfWeek > 6 then Dec(ADayOfWeek, 7); + ACaption := TcxSchedulerReportDateNavigatorDayCaption.CreateEx(Self, TDay(ADayOfWeek), I); + with ACaption do + begin + R.Left := R.Right; + R.Right := R.Left + ColWidth; + BoundsRect := R; + end; + end; +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateDay(const ABounds: TRect; + ADate: TDateTime; ACol, ARow: Integer); +var + ADay: TcxSchedulerReportDateNavigatorDay; +begin + ADay := TcxSchedulerReportDateNavigatorDay.CreateEx(Self, DayOf(ADate), + ACol, ARow, GetDayIsBold(ADate)); + ADay.BoundsRect := ABounds; +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateItems; +begin + CreateMonthHeader; + CreateDayCaptions; + CreateMonth; + CreateLines; +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateLines; +var + R: TRect; +begin + R := GetHeaderBounds; + R.Top := R.Bottom + DayCaptionsHeight; + R.Bottom := R.Top + WeekNumberCount * RowHeight; + with TdxReportCellBox.Create(Self) do + begin + if ShowWeekNumbers then CellSides := [csTop, csLeft] else CellSides := [csTop]; + BoundsRect := R; + end; +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateMonth; +var + R: TRect; + I, J, ADayBase, ADaysPerMonth: Integer; + ADate, ADateBase: TDateTime; + AHasDate: Boolean; + + function GetDate(out ADate: TDateTime): Boolean; + begin + ADate := ADateBase + ADayBase + J * 7 + I; + Result := (ADate > ADateBase) and (ADate <= ADateBase + ADaysPerMonth); + end; + +begin + FDayCount := 0; + FWeekNumberCount := 0; + ADateBase := EncodeDate(FYear, FMonth, 1) - 1; + ADayBase := 1 - ColOfDate(ADateBase + 1); + ADaysPerMonth := DaysPerMonth(FYear, FMonth); + //loop has been split into two loops for the correct order of the DataItems + for I := 0 to 6 do + for J := 0 to 5 do + if GetDate(ADate) then + begin + CreateDay(GetDayBoundsFromColAndRow(I, J), ADate, I, J); + Inc(FDayCount); + end; + for I := 0 to 6 do + for J := 0 to 5 do + begin + AHasDate := GetDate(ADate); + if ShowWeekNumbers and (I = 0) and not ((J = 5) and not AHasDate) then + begin + R := cxRectOffset(GetDayBoundsFromColAndRow(I, J), -ColWidth, 0); + Dec(R.Right, ColWidth div 8); + CreateWeekNumber(R, ADate, J); + Inc(FWeekNumberCount); + end; + end; +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateMonthHeader; +begin + TcxSchedulerReportDateNavigatorHeader.CreateEx(Self, Year, Month).BoundsRect := GetHeaderBounds; +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateWeekNumber( + const ABounds: TRect; ADate: TDateTime; ARow: Integer); +var + AWeekNumber: TcxSchedulerReportDateNavigatorWeekNumber; +begin + AWeekNumber := TcxSchedulerReportDateNavigatorWeekNumber.CreateEx(Self, + cxDateUtils.GetWeekNumber(ADate, StartOfWeek, FirstWeekOfYear), ARow); + AWeekNumber.BoundsRect := ABounds; +end; + +class procedure TcxSchedulerReportDateNavigatorCell.GetContentPartSizes( + AFont: TFont; var AColWidth, ARowHeight, ADayCaptionsHeight: Integer; + AFontSize: Integer = 0); +var + ASymbolSize: TSize; +begin + ASymbolSize := cxTextExtent(AFont, '0', AFontSize); + AColWidth := 3 * ASymbolSize.cx; + ADayCaptionsHeight := ASymbolSize.cy + 1; + ARowHeight := ASymbolSize.cy; +end; + +function TcxSchedulerReportDateNavigatorCell.GetDayBoundsFromColAndRow( + ACol, ARow: Integer): TRect; +begin + with Result do + begin + Left := Succ(ACol) * ColWidth; + Top := HeaderHeight + DayCaptionsHeight + ARow * RowHeight; + Right := Left + ColWidth; + Bottom := Top + RowHeight; + end; +end; + +function TcxSchedulerReportDateNavigatorCell.GetDayIsBold( + ADate: TDateTime): Boolean; +begin + Result := FBoldedDays.IndexOf(ADate) <> -1; +end; + +function TcxSchedulerReportDateNavigatorCell.GetHeaderBounds: TRect; +begin + Result := cxRect(ColWidth, 0, MonthSize.cx - MulDiv(ColWidth, 2, 3), HeaderHeight); +end; + +class procedure TcxSchedulerReportDateNavigatorCell.GetHeaderPartSizes( + AFont: TFont; var AHeaderHeight: Integer; AFontSize: Integer = 0); +begin + AHeaderHeight := MulDiv(cxTextHeight(AFont, 'Wg', AFontSize), 3 , 2); +end; + +function TcxSchedulerReportDateNavigatorCell.GetMonthSize( + const AContentParams, AHeaderParams: TdxReportItemViewParams): TSize; +begin + GetContentPartSizes(AContentParams.NativeParams.Font, FColWidth, FRowHeight, + FDayCaptionsHeight, AContentParams.FontSize); + GetHeaderPartSizes(AHeaderParams.NativeParams.Font, FHeaderHeight, + AHeaderParams.FontSize); + Result.cx := 9 * FColWidth; + Result.cy := FHeaderHeight + FDayCaptionsHeight + 6 * FRowHeight + 1; +end; + +function TcxSchedulerReportDateNavigatorCell.GetType: TcxSchedulerReportItemsType; +begin + Result := srDateNavigator; +end; + +procedure TcxSchedulerReportDateNavigatorCell.SetViewParams( + const AContentParams, AHeaderParams: TdxReportItemViewParams); +var + I: Integer; + AParams: TdxReportItemViewParams; +begin + FContentParams := AContentParams; + FHeaderParams := AHeaderParams; + SetCellViewParams(Self, AContentParams); + SetCellViewParams(Header, AHeaderParams); + for I := 0 to DayCount - 1 do + begin + AParams := AContentParams; + if Days[I].Bold then + Include(AParams.FontStyle, fsBold); + SetCellViewParams(Days[I], AParams); + end; + for I := 0 to DayCaptionCount - 1 do + SetCellViewParams(DayCaptions[I], AContentParams); + AParams := AContentParams; + if AParams.FontSize <> 0 then + AParams.FontSize := MulDiv(AParams.FontSize, 2, 3) + else + AParams.FontSize := MulDiv(AParams.NativeParams.Font.Size, 2, 3); + for I := 0 to WeekNumberCount - 1 do + SetCellViewParams(WeekNumbers[I], AParams); +end; + +procedure TcxSchedulerReportDateNavigatorCell.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + AReader.Read(FFirstWeekOfYear, SizeOf(FFirstWeekOfYear)); + FMonth := AReader.ReadInteger; + FYear := AReader.ReadInteger; + FShowDatesContainingEventsInBold := AReader.ReadBoolean; + FShowWeekNumbers := AReader.ReadBoolean; +end; + +procedure TcxSchedulerReportDateNavigatorCell.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.Write(FFirstWeekOfYear, SizeOf(FFirstWeekOfYear)); + AWriter.WriteInteger(FMonth); + AWriter.WriteInteger(FYear); + AWriter.WriteBoolean(FShowDatesContainingEventsInBold); + AWriter.WriteBoolean(FShowWeekNumbers); +end; + +class function TcxSchedulerReportDateNavigatorCell.GetMonthHeight( + AHeaderHeight, ADayCaptionsHeight, ARowHeight: Integer): Integer; +begin + Result := (AHeaderHeight + ADayCaptionsHeight + 6 * ARowHeight); +end; + +function TcxSchedulerReportDateNavigatorCell.GetDay( + Index: Integer): TcxSchedulerReportDateNavigatorDay; +begin + Result := DataItems[Index + 1 + 7] as TcxSchedulerReportDateNavigatorDay; +end; + +function TcxSchedulerReportDateNavigatorCell.GetDayCaption( + Index: Integer): TcxSchedulerReportDateNavigatorDayCaption; +begin + Result := DataItems[Index + 1] as TcxSchedulerReportDateNavigatorDayCaption; +end; + +function TcxSchedulerReportDateNavigatorCell.GetHeader: TcxSchedulerReportDateNavigatorHeader; +begin + Result := DataItems[0] as TcxSchedulerReportDateNavigatorHeader; +end; + +function TcxSchedulerReportDateNavigatorCell.GetWeekNumber( + Index: Integer): TcxSchedulerReportDateNavigatorWeekNumber; +begin + Result := DataItems[Index + 1 + 7 + FDayCount] as TcxSchedulerReportDateNavigatorWeekNumber; +end; + +{ TcxSchedulerReportSchedulingAreaCell } + +constructor TcxSchedulerReportSchedulingAreaCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + FVisibleDays := TcxSchedulerDateList.Create; + FDaysList := TStringList.Create; + CellSides := [csLeft, csTop]; +end; + +destructor TcxSchedulerReportSchedulingAreaCell.Destroy; +begin + FDaysList.Free; + FVisibleDays.Free; + inherited Destroy; +end; + +procedure TcxSchedulerReportSchedulingAreaCell.DrawContent( + DC: HDC; DrawRect: TRect; const OriginRect: TRect; AStage: TdxPSRenderStages); +begin + inherited DrawContent(DC, DrawRect, OriginRect, AStage); + if rsFirstPass in AStage then + DrawBorders(DC); +end; + +procedure TcxSchedulerReportSchedulingAreaCell.DrawItself( + DC: HDC; AStage: TdxPSRenderStages); +begin + if rsFirstPass in AStage then + begin + if IsBackgroundBitmapDrawn then + DrawBackgroundBitmap(DC) + else + if IsBackgroundDrawn then + DrawBackground(DC); + end; +end; + +function TcxSchedulerReportSchedulingAreaCell.GetType: TcxSchedulerReportItemsType; +begin + Result := srSchedulingArea; +end; + +{ TcxSchedulerReportCustomCell } + +constructor TcxSchedulerReportCustomCell.CreateFrom(AParent: TdxReportCell; + AViewInfo: TcxSchedulerCustomViewInfoItem); +begin + inherited Create(AParent); + Transparent := False; + BoundsRect := AViewInfo.Bounds; + CellSides := TdxCellSides(AViewInfo.Borders); +end; + +procedure TcxSchedulerReportCustomCell.DrawContent(DC: HDC; AStage: TdxPSRenderStages); +begin + inherited; + //Renderer.ExcludeClipRect(GetFixupRect(DC, BoundsRect)); +end; + +class procedure TcxSchedulerReportCustomCell.RegisterMirrorClass; +begin + MirrorClasses.Add(Self); +end; + +class function TcxSchedulerReportCustomCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := nil; +end; + +procedure TcxSchedulerReportCustomCell.SuppressColoration; +begin + FDayBorderColor := clBlack; + Color := dxPSCore.dxDefaultContentColor; +end; + +procedure TcxSchedulerReportCustomCell.DrawCellFrame(DC: HDC; const ARect: TRect; + ABorders: TcxBorders = []; ABorderColor: TColor = clDefault; ALineWidth: Integer = 1); +begin + Renderer.FrameRect(DC, GetFixupRect(DC, ARect), + ABorderColor, TdxCellSides(ABorders), ALineWidth); +end; + +procedure TcxSchedulerReportCustomCell.DrawCellRect(DC: HDC; const ARect: TRect; + ABorders: TcxBorders = []; ABorderColor: TColor = clDefault; ALineWidth: Integer = 1; + AColor: TColor = clDefault); +var + R: TRect; +begin + if Transparent then + DrawCellFrame(DC, ARect, ABorders, ABorderColor, ALineWidth) + else + begin + R := GetFixupRect(DC, ARect); + if AColor = clDefault then + AColor := Color; + Renderer.FillRect(DC, R, AColor); + Renderer.FrameRect(DC, R, ABorderColor, TdxCellSides(ABorders), ALineWidth); + end; +end; + +procedure TcxSchedulerReportCustomCell.DrawCellText(DC: HDC; const ARect: TRect; + const AText: string; AlignHorz: TdxTextAlignX; AlignVert: TdxTextAlignY; + AFont: TFont = nil; AColor: TColor = clDefault; AMultiLine: Boolean = False); +const + Horz: array[TdxTextAlignX] of Integer = + (DXTO_LEFT, DXTO_CENTER_HORIZONTALLY, DXTO_RIGHT, DXTO_LEFT, DXTO_LEFT); + Vert: array[TdxTextAlignY] of Integer = + (DXTO_TOP, DXTO_CENTER_VERTICALLY, DXTO_BOTTOM, DXTO_TOP); +var + R: TRect; + AMode: Integer; + Flags: Integer; +begin + if Length(AText) = 0 then Exit; + R := GetFixupRect(DC, ARect); + Flags := Renderer.MakeTextFormat(AlignHorz, AlignVert, AMultiLine, False, True, True, False); + if FNoClip then + Flags := Flags or DXTO_NOCLIP; +{ Flags := DXTO_PREVENT_LEFT_EXCEED or DXTO_PREVENT_TOP_EXCEED or DXTO_NOCLIP or + Horz[AlignHorz] or Vert[AlignVert] or DXTO_SINGLELINE;} + if AFont = nil then + AFont := Font; + AMode := SetBkMode(DC, Windows.TRANSPARENT); + Renderer.DrawTextEx(DC, R, -1, cxTextOffset, + cxTextOffset, AText, AFont, Flags); + SetBkMode(DC, AMode); +end; + +procedure TcxSchedulerReportCustomCell.DrawCellTextVert(DC: HDC; const ARect: TRect; + const AText: string; AlignHorz: TdxTextAlignX; AlignVert: TdxTextAlignY; + AFont: TFont = nil; AMultiLine: Boolean = True); +begin + dxRotatedTextOut(DC, ARect, AText, AFont, AlignHorz, AlignVert, AMultiLine); +end; + +procedure TcxSchedulerReportCustomCell.DrawCellState(DC: HDC; R: TRect; + AState: Integer; ABorders: TcxBorders = []; ABorderColor: TColor = clBlack); +var + ABrushHandle: HBrush; + APenHandle: HPen; + Points: array[0..2] of TPoint; +begin + FixupRect(DC, R); + if R.Top = R.Bottom then + begin + R := ExcludeBorders(R, ABorders); + ABrushHandle := SelectObject(DC, StateBrushes[AState].Handle); + APenHandle := SelectObject(DC, GetStockObject(BLACK_PEN)); + Points[0] := Point(R.Left, R.Top); + Points[1] := Point(R.Right, R.Top); + Points[2] := Point(R.Right, R.Top + R.Right - R.Left); + Windows.Polygon(DC, Points, 3); + SelectObject(DC, APenHandle); + SelectObject(DC, ABrushHandle); + end + else + begin + DrawCellFrame(DC, R, ABorders, ABorderColor, 1); + FillRect(DC, ExcludeBorders(R, ABorders), StateBrushes[AState].Handle); + end; +end; + +function TcxSchedulerReportCustomCell.AdjustTextRect(const ARect: TRect): TRect; +var + L: Integer; +begin + L := FixupWidth(cxTextOffset); + Result := ARect; + InflateRect(Result, -L, -L); +end; + +function TcxSchedulerReportCustomCell.ExcludeBorders(const ARect: TRect; + ABorders: TcxBorders; ABorderWidth: Integer = 1): TRect; +begin + Result := ARect; + with Result do + begin + if bLeft in ABorders then + Inc(Left, ABorderWidth * LineThickness); + if bRight in ABorders then + Dec(Right, ABorderWidth * LineThickness); + if bTop in ABorders then + Inc(Top, ABorderWidth * LineThickness); + if bBottom in ABorders then + Dec(Bottom, ABorderWidth * LineThickness); + end; +end; + +function TcxSchedulerReportCustomCell.FixupWidth(AWidth: Integer): Integer; +begin + if not Renderer.IsPrinting then + Result := MulDiv(AWidth * Renderer.UnitsPerPixel, Renderer.ZoomFactor, 100) + else + Result := MulDiv(AWidth * Renderer.UnitsPerPixel, Renderer.PPI * 5, 72 * 7); +end; + +function TcxSchedulerReportCustomCell.GetFixupRect(DC: HDC; const ARect: TRect): TRect; +begin + Result := ARect; + FixupRect(DC, Result); +end; + +function TcxSchedulerReportCustomCell.InflateRect(const ARect: TRect; dX, dY: Integer): TRect; +begin + Result := ARect; +end; + +function TcxSchedulerReportCustomCell.GetReportLink: TcxSchedulerReportLink; +begin + Result := TcxSchedulerReportLink(Renderer.ReportLink); +end; + +{ TcxSchedulerReportContentCell } + +constructor TcxSchedulerReportContentCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); +begin + inherited CreateFrom(AParent, AViewInfo); + Data := cdidSchedulerContent; + if AViewInfo is TcxSchedulerContentCellViewInfo then + with TcxSchedulerContentCellViewInfo(AViewInfo) do + begin + Self.BoundsRect := Bounds; + Self.FBorderColor := BorderColor; + Self.FShowTimeLine := ShowTimeLine; + Self.FTimeLineBorders := TimeLineBorders; + if TimeEvent <> nil then + Self.FState := TimeEvent.Event.State + else + Self.FState := -1; + if ShowTimeLine then + begin + CellSideColors[csRight] := clBlack; + CellSideColors[csbottom] := FBorderColor; + end; + CellSides := csAll; + end; +end; + +procedure TcxSchedulerReportContentCell.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportContentCell then + with TcxSchedulerReportContentCell(Source) do + begin + Self.FBorderColor := FBorderColor; + Self.FShowTimeLine := FShowTimeLine; + Self.FState := FState; + Self.FTimeLineBorders := FTimeLineBorders; + end; + inherited Assign(Source); +end; + +procedure TcxSchedulerReportContentCell.DrawContent(DC: HDC; + AStage: TdxPSRenderStages); +var + R: TRect; +begin + inherited DrawContent(DC, AStage); + R := BoundsRect; + if FShowTimeLine then + begin + R.Right := R.Left + FixupWidth(cxTimeLineWidth); + if FState = -1 then + DrawCellRect(DC, R, FTimeLineBorders - [bLeft], clBlack, 1, clWhite) + else + DrawCellState(DC, R, FState, FTimeLineBorders, clBlack); + end +end; + +class function TcxSchedulerReportContentCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerContentCellViewInfo; +end; + +procedure TcxSchedulerReportContentCell.SuppressColoration; +var + I: TdxCellSide; +begin + for I := csLeft to csBottom do + CellSideColors[I] := clBlack; + FBorderColor := clBlack; + if FState <> -1 then + Inc(FState, 4); + inherited SuppressColoration; +end; + +function TcxSchedulerReportContentCell.HasBorderColoration: Boolean; +begin + Result := True; +end; + +{ TcxSchedulerReportHeaderItemCell } + +constructor TcxSchedulerReportHeaderItemCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); + + function GetConvertedRect(ARotateHeader, ARotateText: Boolean; const R: TRect): TRect; + begin + if ARotateHeader then + begin + with R do + if ARotateText then + Result := cxRectBounds(BoundsRect.Left + Top, BoundsRect.Bottom - Right, + Bottom - Top, Right - Left) + else + Result := cxRectBounds(BoundsRect.Left + Left, BoundsRect.Top + Top, + Right - Left, Bottom - Top); + end + else + Result := R; + end; + +begin + inherited CreateFrom(AParent, AViewInfo); + Data := cdidSchedulerHeader; + if AViewInfo is TcxSchedulerHeaderCellViewInfo then + with TcxSchedulerHeaderCellViewInfo(AViewInfo) do + begin + CalculateImageLayout; + Self.TextAlignX := TextAlignXMap[AlignHorz]; + Self.Multiline := AutoHeight; + Self.TextAlignY := TextAlignYMap[AlignVert]; + Self.FRotateText := RotateText; + Self.FCaption := DisplayText; + Self.FIsResourceHeader := IsResourceHeader; + Self.FResourceID := ResourceID; + //image support + Self.FImages := Images; + Self.FImageIndex := ImageIndex; + Self.FTextRect := GetConvertedRect(RotateHeader, RotateText, TextRect); + Self.FImageRect := GetConvertedRect(RotateHeader, RotateText, ImageRect); + end; + CellSides := csAll; + ReportLink.RegisterLookAndFeelItem(Self, cesRaised); + FNoClip := True; +end; + +procedure TcxSchedulerReportHeaderItemCell.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportHeaderItemCell then + with TcxSchedulerReportHeaderItemCell(Source) do + begin + Self.FCaption := FCaption; + Self.FDate := FDate; + Self.FResourceID := FResourceID; + Self.FRotateText := FRotateText; + //image support + Self.FTextRect := FTextRect; + Self.FImages := FImages; + Self.FImageIndex := FImageIndex; + Self.FImageRect := FImageRect; + end; + inherited Assign(Source); +end; + +procedure TcxSchedulerReportHeaderItemCell.DrawContent( + DC: HDC; AStage: TdxPSRenderStages); +var + R: TRect; +begin + inherited DrawContent(DC, AStage); + if ReportLink.SupportImages then + R := GetFixupRect(DC, FTextRect) + else + R := BoundsRect; + if FRotateText then + DrawCellTextVert(DC, R, FCaption, TextAlignX, TextAlignY, Font, Multiline) + else + DrawCellText(DC, R, FCaption, TextAlignX, TextAlignY, Font, clDefault, Multiline); + if HasImage then + DrawImage(DC); +end; + +procedure TcxSchedulerReportHeaderItemCell.DrawImage(DC: HDC); +var + R: TRect; +begin + R := GetFixupRect(DC, FImageRect); + Renderer.DrawGraphicEx(DC, R, R, Images, ImageIndex, nil, True, True, Color, + ContentBkColor, ContentPattern, cibAlways); +end; + +class function TcxSchedulerReportHeaderItemCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerHeaderCellViewInfo; +end; + +procedure TcxSchedulerReportHeaderItemCell.ConvertCoords( + APixelsNumerator, APixelsDenominator: Integer); + + procedure ConvertRect(var R: TRect); + begin + with R do + begin + Left := MulDiv(Left, APixelsNumerator, APixelsDenominator); + Right := MulDiv(Right, APixelsNumerator, APixelsDenominator); + Top := MulDiv(Top, APixelsNumerator, APixelsDenominator); + Bottom := MulDiv(Bottom, APixelsNumerator, APixelsDenominator); + end; + end; + +begin + inherited ConvertCoords(APixelsNumerator, APixelsDenominator); + ConvertRect(FTextRect); + ConvertRect(FImageRect); +end; + +function TcxSchedulerReportHeaderItemCell.HasImage: Boolean; +begin + Result := (Images <> nil) and (ImageIndex > -1) and (ImageIndex < Images.Count); +end; + +procedure TcxSchedulerReportHeaderItemCell.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FRotateText := AReader.ReadBoolean; + FCaption := AReader.ReadString; + if ReportLink.SupportImages then + begin + FTextRect := AReader.ReadRect; + if AReader.ReadBoolean then // HasImage + begin + FImageRect := AReader.ReadRect; + FImages := ReportCells.ImageLists[AReader.ReadInteger]; + FImageIndex := AReader.ReadInteger; + end + else + FImages := nil; + end; +end; + +procedure TcxSchedulerReportHeaderItemCell.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteBoolean(FRotateText); + AWriter.WriteString(FCaption); + if ReportLink.SupportImages then + begin + AWriter.WriteRect(FTextRect); + AWriter.WriteBoolean(HasImage); + if HasImage then + begin + AWriter.WriteRect(FImageRect); + AWriter.WriteInteger(ReportCells.IndexOfImageList(Images)); + AWriter.WriteInteger(ImageIndex); + end; + end; +end; + +function TcxSchedulerReportHeaderItemCell.GetTextAlignX: TdxTextAlignX; +begin + Result := inherited TextAlignX; +end; + +function TcxSchedulerReportHeaderItemCell.GetTextAlignY: TdxTextAlignY; +begin + Result := inherited TextAlignY; +end; + +procedure TcxSchedulerReportHeaderItemCell.SetTextAlignX( + Value: TdxTextAlignX); +begin + inherited TextAlignX := Value; +end; + +procedure TcxSchedulerReportHeaderItemCell.SetTextAlignY( + Value: TdxTextAlignY); +begin + inherited TextAlignY := Value; +end; + +{ TcxSchedulerReportGroupSeparatorCell } + +constructor TcxSchedulerReportGroupSeparatorCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); +begin + inherited CreateFrom(AParent, AViewInfo); + CellSides := csAll; + ReportLink.RegisterLookAndFeelItem(Self, cesRaised); +end; + +class function TcxSchedulerReportGroupSeparatorCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerGroupSeparatorCellViewInfo; +end; + +{ TcxSchedulerReportContainerCell } + +class function TcxSchedulerReportContainerCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerContainerCellViewInfo; +end; + +{ TcxSchedulerReportBackgroundSlotCell } + +constructor TcxSchedulerReportBackgroundSlotCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); +begin + inherited CreateFrom(AParent, AViewInfo); + if AViewInfo is TcxSchedulerBackgroundSlotCellViewInfo then + with TcxSchedulerBackgroundSlotCellViewInfo(AViewInfo) do + Self.FDisplayText := DisplayText; +end; + +procedure TcxSchedulerReportBackgroundSlotCell.DrawContent( + DC: HDC; AStage: TdxPSRenderStages); +begin + DrawCellRect(DC, BoundsRect, TcxBorders(CellSides), clWindowText); + DrawCellText(DC, BoundsRect, DisplayText, taLeft, taTop); +end; + +class function TcxSchedulerReportBackgroundSlotCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerBackgroundSlotCellViewInfo; +end; + +procedure TcxSchedulerReportBackgroundSlotCell.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FDisplayText := AReader.ReadString; +end; + +procedure TcxSchedulerReportBackgroundSlotCell.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteString(FDisplayText); +end; + +{ TcxSchedulerReportDailyTimeRulerCellsSite } + +constructor TcxSchedulerReportDailyTimeRulerCellsSite.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + FLargeFont := TFont.Create; + FontIndex := ReportCells.ReportLink.AddFontToPool(Font); + CellSides := []; +end; + +destructor TcxSchedulerReportDailyTimeRulerCellsSite.Destroy; +begin + FLargeFont.Free; + inherited Destroy; +end; + +procedure TcxSchedulerReportDailyTimeRulerCellsSite.SetFontIndex(Index: Integer); +begin + inherited SetFontIndex(Index); + if Font <> nil then + begin + FLargeFont.Assign(Font); + FLargeFont.Size := Font.Size * 2; + FLargeFontIndex := ReportCells.ReportLink.AddFontToPool(FLargeFont); + end; +end; + +procedure TcxSchedulerReportDailyTimeRulerCellsSite.ReadProperties( + AReader: TdxPSDataReader); +begin + inherited ReadProperties(AReader); + FLargeFontIndex := AReader.ReadInteger; +end; + +procedure TcxSchedulerReportDailyTimeRulerCellsSite.WriteProperties( + AWriter: TdxPSDataWriter); +begin + inherited WriteProperties(AWriter); + AWriter.WriteInteger(FLargeFontIndex); +end; + +function TcxSchedulerReportDailyTimeRulerCellsSite.GetLargeFont: TFont; +begin + if (FLargeFontIndex <> -1) and (ReportCells <> nil) then + Result := ReportCells.GetFontByIndex(FLargeFontIndex) + else + Result := nil; +end; + +{ TcxSchedulerReportDailyTimeRulerCell } + +constructor TcxSchedulerReportDailyTimeRulerCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); +var + I: Boolean; +begin + inherited CreateFrom(AParent, AViewInfo); + CellSides := [csRight]; + Data := cdidSchedulerTimeRuler; + FLineColor := clBtnShadow; + TimeRulerSite.Width := Max(TimeRulerSite.Width, Width); + if AViewInfo is TcxSchedulerTimeRulerCellViewInfo then + with TcxSchedulerTimeRulerCellViewInfo(AViewInfo) do + begin + TimeRulerSite.Height := Max(TimeRulerSite.Height, ClipRect.Bottom); + Self.FHour := Hour; + Self.FShowMinutes := ShowMinutes; + Self.FHasAdditionalTimeZone := HasAdditionalTimeZone; + Self.FLineCount:= LineCount; + for I := False to True do + begin + Self.FBounds[I] := Bounds[I]; + Self.FDisplayTexts[I] := DisplayTexts[I]; + end; + end; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerReportDailyTimeRulerCell then + with TcxSchedulerReportDailyTimeRulerCell(Source) do + begin + Self.FHasAdditionalTimeZone := FHasAdditionalTimeZone; + Self.FLineCount := FLineCount; + Self.FBounds[False] := FBounds[False]; + Self.FBounds[True] := FBounds[True]; + Self.FDisplayTexts[False] := FDisplayTexts[False]; + Self.FDisplayTexts[True] := FDisplayTexts[True]; + Self.FHour := FHour; + end; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.DrawContent( + DC: HDC; AStage: TdxPSRenderStages); +var + I: Boolean; +const + ABorders: array[Boolean] of TcxBorders = ([bBottom], [bBottom, bRight]); +begin + if Index = 0 then + CellSides := CellSides + [csBottom]; + inherited; + CalculateDisplayInfo; + for I := not HasAdditionalTimeZone to True do + begin + if Hour >= 0 then + DrawTimeZone(DC, Bounds[I], DisplayTexts[I], I) + else + DrawTimeZoneLabel(DC, Bounds[I], DisplayTexts[I], ABorders[I]); + end; +end; + +class function TcxSchedulerReportDailyTimeRulerCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerTimeRulerCellViewInfo; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.SuppressColoration; +begin + inherited SuppressColoration; + FLineColor := clBlack; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.CalculateDisplayInfo; +begin + FBounds[True] := BoundsRect; + FBounds[False] := BoundsRect; + if HasAdditionalTimeZone then + begin + FBounds[True].Left := cxRectCenter(BoundsRect).X; + FBounds[False].Right := FBounds[True].Left; + end; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.DrawTimeZone(DC: HDC; + const ABounds: TRect; const AText: string; AIsCurrent: Boolean); +var + S: string; + J, LH: Integer; + R1, R, TextR: TRect; +begin + LH := cxRectHeight(BoundsRect) div LineCount; + R := BoundsRect; + Dec(R.Right, FixupWidth(6)); + if not IsLastItem then + DrawCellFrame(DC, R, [bBottom], FLineColor); + + R := cxRectSetHeight(ABounds, LH); + R.Left := (R.Left + R.Right) div 2 + FixupWidth(cxTextOffset * 2); + Dec(R.Right, FixupWidth(6)); + for J := 0 to LineCount - 2 do + begin + DrawCellFrame(DC, R, [bBottom], FLineColor, 1); + OffsetRect(R, 0, LH); + end; + TextR := cxRectInflate(ExcludeBorders(ABounds, + [bRight, bBottom]), -FixupWidth(5), -FixupWidth(cxTextOffset)); + FNoClip := True; + if LineCount > 1 then + begin + J := Length(AText); + + DrawCellText(DC, Rect(TextR.Left, TextR.Top, R.Left - FixupWidth(cxTextOffset), TextR.Bottom), + Copy(AText, 1, J - 3), taRight, taTop, LargeFont, LargeFont.Color); + R1 := Rect(R.Left, TextR.Top, TextR.Right, TextR.Top + LH - FixupWidth(3)); + DrawCellText(DC, R1, Copy(AText, J - 1, 2), taCenterX, taTop, Font); + if ShowMinutes and AIsCurrent then + for J := 1 to LineCount - 1 do + begin + OffsetRect(R1, 0, LH); + S := IntToStr(MulDiv(60, J, LineCount)); + if Length(S) < 2 then + S := '0' + S; + DrawCellText(DC, R1, S, taCenterX, taTop, Font); + end; + end + else + DrawCellText(DC, TextR, AText, taRight, taCenterY, Font); + R.Left := ABounds.Left + FixupWidth(5); + if not IsLastItem then + begin + if Hour <> 23 then + DrawCellFrame(DC, R, [bBottom], FLineColor) + else + DrawCellFrame(DC, ABounds, [bBottom], FLineColor); + end; + if HasAdditionalTimeZone then + begin + R := GetInnerBounds(DC); + R.Left := (R.Left + R.Right) div 2; + R.Right := R.Left + LineThickness; + Renderer.FillRect(DC, R, clBlack); + end; + FNoClip := False; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FHasAdditionalTimeZone := AReader.ReadBoolean; + FLineCount := AReader.ReadInteger; + FBounds[False] := AReader.ReadRect; + FBounds[True] := AReader.ReadRect; + FDisplayTexts[False] := AReader.ReadString; + FDisplayTexts[True] := AReader.ReadString; + FHour := AReader.ReadInteger; + FLineColor := AReader.ReadInteger; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteBoolean(FHasAdditionalTimeZone); + AWriter.WriteInteger(FLineCount); + AWriter.WriteRect(FBounds[False]); + AWriter.WriteRect(FBounds[True]); + AWriter.WriteString(FDisplayTexts[False]); + AWriter.WriteString(FDisplayTexts[True]); + AWriter.WriteInteger(FHour); + AWriter.WriteInteger(FLineColor); +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.DrawTimeZoneLabel(DC: HDC; + const ABounds: TRect; const AText: string; ABorders: TcxBorders); +begin + DrawCellText(DC, AdjustTextRect(ABounds), AText, taLeft, taBottom, Font, Font.Color); +end; + +function TcxSchedulerReportDailyTimeRulerCell.GetBoundsRect(AType: Boolean): TRect; +begin + Result := FBounds[AType]; +end; + +function TcxSchedulerReportDailyTimeRulerCell.GetDisplayText(AType: Boolean): string; +begin + Result := FDisplayTexts[AType]; +end; + +function TcxSchedulerReportDailyTimeRulerCell.GetLargeFont: TFont; +begin + Result := TimeRulerSite.LargeFont; +end; + +function TcxSchedulerReportDailyTimeRulerCell.GetTimeRulerSite: TcxSchedulerReportDailyTimeRulerCellsSite; +begin + Result := TcxSchedulerReportDailyTimeRulerCellsSite(Parent); +end; + +{ TcxSchedulerReportMonthDayCell } + +constructor TcxSchedulerReportMonthDayCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); +begin + inherited CreateFrom(AParent, AViewInfo); + if AViewInfo is TcxSchedulerMonthDayContentCellViewInfo then + begin + FSmallFont := TcxSchedulerMonthDayContentCellViewInfo(AViewInfo).SmallFont; + FDontPrint := TcxSchedulerMonthDayContentCellViewInfo(AViewInfo).DontPrint; + if FDontPrint then + begin + Transparent := True; + FDisplayText := ''; + end + else + FDisplayText := TcxSchedulerMonthDayContentCellViewInfo(AViewInfo).DisplayText; + end; +end; + +procedure TcxSchedulerReportMonthDayCell.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerReportMonthDayCell then + begin + FDontPrint := TcxSchedulerReportMonthDayCell(Source).FDontPrint; + FDisplayText := TcxSchedulerReportMonthDayCell(Source).FDisplayText; + end; +end; + +procedure TcxSchedulerReportMonthDayCell.DrawContent( + DC: HDC; AStage: TdxPSRenderStages); +var + R: TRect; + F: TFont; +begin + inherited DrawContent(DC, AStage); + if FDontPrint then Exit; + if FDisplayText <> '' then + begin + R := ExcludeBorders(BoundsRect, TcxBorders(CellSides)); + F := TFont.Create; + try + F.Assign(Font); + if SmallFont then + F.Size := MulDiv(F.Size, 2, 3); + DrawCellText(DC, R, FDisplayText, taRight, taTop, F); + finally + F.Free; + end; + end; +end; + +class function TcxSchedulerReportMonthDayCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerMonthDayContentCellViewInfo; +end; + +procedure TcxSchedulerReportMonthDayCell.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FDisplayText := AReader.ReadString; + FDontPrint := AReader.ReadBoolean; +end; + +procedure TcxSchedulerReportMonthDayCell.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteString(FDisplayText); + AWriter.WriteBoolean(FDontPrint); +end; + +{ TcxSchedulerReportTimeLinePart } + +constructor TcxSchedulerReportTimeLinePart.CreateEx(AParent: TdxReportCell; + ATriangle: Boolean; AState: Integer); +begin + inherited Create(AParent); + Transparent := False; + FTriangle := ATriangle; + FState := AState; + Data := cdidSchedulerEventTimeLine; +end; + +procedure TcxSchedulerReportTimeLinePart.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerReportTimeLinePart then + begin + FState := TcxSchedulerReportTimeLinePart(Source).FState; + FTriangle := TcxSchedulerReportTimeLinePart(Source).FTriangle; + end; +end; + +procedure TcxSchedulerReportTimeLinePart.DrawContent(DC: HDC; + AStage: TdxPSRenderStages); +var + R: TRect; + ABrushHandle: HBrush; + APenHandle: HPen; + Points: array[0..2] of TPoint; +begin + R := GetOuterBounds(DC); + if FTriangle then + begin + Renderer.FillRect(DC, R, clWhite); + ABrushHandle := SelectObject(DC, StateBrushes[FState].Handle); + APenHandle := SelectObject(DC, GetStockObject(NULL_PEN)); + Points[0] := R.TopLeft; + Points[1] := Point(R.Right, R.Top); + Points[2] := Point(R.Right, R.Top + R.Right - R.Left); + Windows.Polygon(DC, Points, 3); + SelectObject(DC, GetStockObject(BLACK_PEN)); + Windows.MoveToEx(DC, R.Left, R.Top, nil); + Windows.LineTo(DC, R.Right, R.Top + R.Right - R.Left); + SelectObject(DC, APenHandle); + SelectObject(DC, ABrushHandle); + end + else + Windows.FillRect(DC, R, StateBrushes[FState].Handle); + DrawBorders(DC); +end; + +procedure TcxSchedulerReportTimeLinePart.ReadData( + AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FTriangle := AReader.ReadBoolean; + FState := AReader.ReadInteger; +end; + +procedure TcxSchedulerReportTimeLinePart.WriteData( + AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteBoolean(FTriangle); + AWriter.WriteInteger(FState); +end; + +{ TcxSchedulerReportTimeLineCell } + +constructor TcxSchedulerReportTimeLineCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + Transparent := False; + Color := clWhite; +end; + +procedure TcxSchedulerReportTimeLineCell.SetTimeRect(const ABounds: TRect; AState: Integer); +var + ATriangle: Boolean; +begin + ATriangle := cxRectIsEmpty(ABounds); + FCurrentValue := TcxSchedulerReportTimeLinePart.CreateEx(Self, ATriangle, AState); + if ATriangle then + FCurrentValue.BoundsRect := BoundsRect + else + FCurrentValue.BoundsRect := ABounds; +end; + +{ TcxSchedulerReportCellString } + +function TcxSchedulerReportCellString.GetDefaultDTFormat: DWORD; +begin + Result := inherited GetDefaultDTFormat and not DXTO_EDITCONTROL; +end; + +{ TcxSchedulerReportCustomEventCell } + +function TcxSchedulerReportCustomEventCell.CreateStringCell( + const AText: string; AMultiline: Boolean = True; AData: Integer = 0): TdxReportCellString; +begin + Result := TcxSchedulerReportCellString.Create(Self); + Result.CellSides := []; + Result.Multiline := AMultiline; + Result.Text := AText; + Result.Data := AData; +end; + +procedure TcxSchedulerReportCustomEventCell.SetViewParams(const AViewParams: TcxViewParams); +var + I: Integer; +begin + ReportLink.SetCellViewParams(Self, AViewParams); + for I := 0 to DataItemCount - 1 do + ReportLink.SetCellViewParams(DataItems[I], AViewParams); +end; + +function TcxSchedulerReportCustomEventCell.GetPrintStyle: TcxCustomSchedulerReportLinkPrintStyle; +begin + Result := ReportLink.PrintStyles.ActiveStyle; +end; + +function TcxSchedulerReportCustomEventCell.GetReportLink: TcxSchedulerReportLink; +begin + Result := ReportCells.ReportLink as TcxSchedulerReportLink; +end; + +function TcxSchedulerReportCustomEventCell.GetSuppressColoration: Boolean; +begin + Result := ReportLink.OptionsFormatting.SuppressContentColoration; +end; + +{ TcxSchedulerReportEventCell } + +constructor TcxSchedulerReportEventCell.CreateFrom(AParent: TdxReportCell; + AEventViewInfo: TcxSchedulerEventCellViewInfo); +begin + inherited Create(AParent); + ClipChildren := True; + Transparent := False; + InitializeFromViewInfo(AEventViewInfo); + CreateDataItems; + SetViewParams(AEventViewInfo.ViewParams); + CalculateLayout; +end; + +procedure TcxSchedulerReportEventCell.AdjustItemsHeight(DC: HDC); + + procedure CheckItem(AItem: TAbstractdxReportCellData); + var + R: TRect; + begin + if Assigned(AItem) then + begin + R := AItem.BoundsRect; + if HasMessage then + R.Bottom := MessageCell.Top + else + R.Bottom := ContentBounds.Bottom; + AItem.BoundsRect := R; + end; + end; + +begin + CheckItem(CaptionCell); + CheckItem(StartCell); + CheckItem(FinishCell); +end; + +procedure TcxSchedulerReportEventCell.CalculateLayout; +var + DC: HDC; + I, W, H, AHalfWidth: Integer; +begin + DC := GetDC(0); + try + FContentBounds := GetContentBounds(DC); + if Assigned(FTimeLineCell) then + CalculateTimeLine(DC); + FCaptionLeft := FContentBounds.Left; + if IsNeedCreateTimeCells then + begin + H := Renderer.CalcTextHeight(DC, '0', False, CaptionCell.Font); + W := Renderer.CalcTextWidth(DC, '00:00', CaptionCell.Font); + AHalfWidth := cxRectWidth(ContentBounds) div 2; + if W < AHalfWidth then + begin + StartCell.BoundsRect := cxRectBounds(FCaptionLeft, 0, W, H); + if W * 2 < AHalfWidth then + begin + FinishCell.BoundsRect := cxRectBounds(StartCell.BoundsRect.Right, 0, W, H); + FCaptionLeft := FinishCell.BoundsRect.Right + 2; + end + else + begin + FCaptionLeft := StartCell.BoundsRect.Right + 2; + FreeAndNil(FFinishCell); + end; + end + else + FreeAndNil(FStartCell); + for I := 0 to DataItemCount - 1 do + if DataItems[I].Data = cdidSchedulerEventIcons then + begin + DataItems[I].Left := FCaptionLeft; + Inc(FCaptionLeft, DataItems[I].Width + 2); + end; + end; + CaptionCell.BoundsRect := GetCaptionRect(DC); + if Assigned(MessageCell) then + begin + MessageCell.BoundsRect := GetMessageRect(DC); + MessageCell.AdjustContent(DC); + end; + AdjustItemsHeight(DC); + finally + ReleaseDC(0, DC); + end; +end; + +procedure TcxSchedulerReportEventCell.CalculateTimeLine(DC: HDC); + + function GetTimeRectBrushIndex: Integer; + begin + Result := Event.State; + if SuppressColoration then + Inc(Result, 4); + end; + + function GetActualTimeRect: TRect; + begin + Result := GetRelativeRect(EventViewInfo.EventTimeRect); + if not cxRectIsEmpty(Result) then + Result := cxRectInflate(Result, 0, 1); + end; + +begin + if FTimeLineCell = nil then Exit; + FTimeLineCell.BoundsRect := GetTimeLineRect(DC); + FTimeLineCell.SetTimeRect(GetActualTimeRect, GetTimeRectBrushIndex); +end; + +function TcxSchedulerReportEventCell.CreateCaptionCell: TdxReportCellString; +begin + Result := CreateStringCell(EventViewInfo.Caption, + FHasDetailInfo and not IsHeaderEvent, cdidSchedulerEventCaption); + with Result do + begin + if HasDetailInfo then TextAlignY := taTop; + if IsHeaderEvent and not HasImages then TextAlignX := taCenterX; + end; +end; + +procedure TcxSchedulerReportEventCell.CreateDataItems; +begin + if HasDetailInfo and not IsHeaderEvent then + FTimeLineCell := CreateTimeLineCell; + if IsNeedCreateTimeCells then + begin + FStartCell := CreateTimeTextCell(EventViewInfo.StartText, cdidSchedulerEventStart); + FFinishCell := CreateTimeTextCell(EventViewInfo.FinishText, cdidSchedulerEventFinish); + end; + CreateEventImageCells; + FCaptionCell := CreateCaptionCell; + if HasMessage then + CreateMessageCell(Event.Message, EventViewInfo.EventViewData.EditProperties, + EventViewInfo.ViewParams); +end; + +procedure TcxSchedulerReportEventCell.CreateEventImageCells; +var + I: Integer; + AImageCell: TdxReportCellImage; + AImage: TcxSchedulerEventImageItem; +begin + if not HasImages then Exit; + for I := 0 to EventViewInfo.Images.Count - 1 do + begin + AImage := EventViewInfo.Images[I]; + AImageCell := AddDataItem(TdxReportCellImage) as TdxReportCellImage; + AImageCell.CellSides := []; + AImageCell.Data := cdidSchedulerEventIcons; + if AImage.ImageType = eitCustom then + begin + AImageCell.ImageList := AImage.Images; + AImageCell.ImageIndex := AImage.ImageIndex; + AImageCell.BoundsRect := GetRelativeRect(AImage.Bounds); + end + else + begin + AImageCell.TextAlignX := taCenterX; + AImageCell.TextAlignY := taBottom; + case AImage.ImageType of + eitReminder: + AImageCell.Text := 'A'; + eitRecurrence: + AImageCell.Text := 'B'; + eitCustomOccurrence: + AImageCell.Text := 'C'; + end; + AImageCell.BoundsRect := GetRelativeRect(AImage.Bounds); + end; + end; +end; + +procedure TcxSchedulerReportEventCell.CreateMessageCell(AMessage: Variant; + AProperties: TcxCustomEditProperties; AViewParams: TcxViewParams); +var + AParams: TdxReportItemViewParams; +begin + if AProperties = nil then + FMessageCell := nil + else + begin + FMessageCell := AddDataItem(GetMessageClass(AProperties)); + FillChar(AViewParams, SizeOf(AViewParams), 0); + AParams.NativeParams := AViewParams; + dxPScxCommon.dxPSDataMaps.InitializeItem(FMessageCell, AProperties, AMessage, + PrintStyle, AParams); + if not SuppressColoration then + MessageCell.BorderColor := EventViewInfo.SeparatorColor; + FMessageCell.CellSides := [csTop]; + FMessageCell.Data := cdidSchedulerEventMessage + end; +end; + +function TcxSchedulerReportEventCell.CreateTimeTextCell( + const ATimeText: string; AData: Integer = 0): TdxReportCellString; +begin + Result := CreateStringCell(ATimeText, False, AData); + Result.TextAlignX := taRight; +end; + +function TcxSchedulerReportEventCell.CreateTimeLineCell: TcxSchedulerReportTimeLineCell; +begin + Result := TcxSchedulerReportTimeLineCell.Create(Self); +end; + +function TcxSchedulerReportEventCell.GetCaptionRect(DC: HDC): TRect; +begin + if HasImages then + Result := GetRelativeRect(EventViewInfo.CaptionRect) + else + Result := FContentBounds; + if IsNeedCreateTimeCells then + Result.Left:= FCaptionLeft; + if HasMessage then + begin + Result.Bottom := Result.Top + CaptionCell.MeasureFontHeight(DC); + Renderer.CalcTextRect(DC, CaptionCell.Text, Result, True, Font); + Result.Right := ContentBounds.Right; + CheckBounds(Result); + end; +end; + +function TcxSchedulerReportEventCell.GetContentBounds(DC: HDC): TRect; +begin + Result := GetRelativeRect(EventViewInfo.Bounds); + Dec(Result.Right); + Dec(Result.Bottom); +end; + +function TcxSchedulerReportEventCell.GetHasImages: Boolean; +begin + Result := PrintStyle.ShowEventImages and (FEventViewInfo.Images.Count > 0); +end; + +function TcxSchedulerReportEventCell.GetHasMessage: Boolean; +begin + Result := PrintStyle.SupportMessage and HasDetailInfo; +end; + +function TcxSchedulerReportEventCell.GetMessageClass(AProperties: TcxCustomEditProperties): TdxReportCellDataClass; +begin + Result := dxPScxCommon.dxPSDataMaps.ItemClass(AProperties); +end; + +function TcxSchedulerReportEventCell.GetMessageRect(DC: HDC): TRect; +begin + if HasImages then + Result := GetRelativeRect(EventViewInfo.MessageRect) + else + Result := ContentBounds; + if CaptionCell.BoundsRect.Bottom > Result.Top then + Result.Top := CaptionCell.BoundsRect.Bottom; +end; + +function TcxSchedulerReportEventCell.GetRelativeRect(const R: TRect): TRect; +begin + Result := cxRectOffset(R, cxPointInvert(BoundsRect.TopLeft)); +end; + +function TcxSchedulerReportEventCell.GetTimeLineRect(DC: HDC): TRect; +begin + Result := cxRect(0, 0, ContentBounds.Left, Height); +end; + +procedure TcxSchedulerReportEventCell.InitializeFromViewInfo( + AEventViewInfo: TcxSchedulerEventCellViewInfo); +begin + FEventViewInfo := AEventViewInfo; + FEditViewInfo := AEventViewInfo.EditViewInfo; + BoundsRect := AEventViewInfo.EventViewData.Bounds; //include timeline + CellSides := TdxCellSides(AEventViewInfo.Borders); + FIsHeaderEvent := Event.AllDayEvent or (Event.Duration > 1); + FHasDetailInfo := AEventViewInfo.IsDetailInfo; + FIsNeedCreateTimeCells := not (FIsHeaderEvent or FHasDetailInfo) and + AEventViewInfo.ShowStartTime; + FHasImages := GetHasImages; + FHasMessage := GetHasMessage and AEventViewInfo.ShowMessage; + FMessage := AEventViewInfo.Message; +end; + +procedure TcxSchedulerReportEventCell.SetViewParams(const AViewParams: TcxViewParams); +var + I, AFontIndex: Integer; +begin + inherited SetViewParams(AViewParams); + if HasImages then + begin + SpecialSymbolFont.Size := AViewParams.Font.Size; + AFontIndex := Renderer.ReportLink.AddFontToPool(SpecialSymbolFont); + for I := 0 to DataItemCount - 1 do + if DataItems[I].Data = cdidSchedulerEventIcons then + DataItems[I].FontIndex := AFontIndex; + end; +end; + +procedure TcxSchedulerReportEventCell.CheckBounds(var ABounds: TRect); +begin + cxRectIntersect(ABounds, ABounds, ContentBounds); +end; + +function TcxSchedulerReportEventCell.GetEvent: TcxSchedulerControlEvent; +begin + Result := EventViewInfo.Event; +end; + +{ TcxSchedulerReportDetailsEventCell } + +constructor TcxSchedulerReportDetailsEventCell.CreateEx(AParent: TdxReportCell; + AEvent: TcxSchedulerEvent; ADate: TDateTime; const AParams: TcxViewParams; + AContinued: Boolean = False); +begin + inherited Create(AParent); + CellSides := []; + FContinued := AContinued; + FDate := ADate; + FEvent := AEvent; + CreateDataItems; + SetViewParams(AParams); +end; + +procedure TcxSchedulerReportDetailsEventCell.CalculateLayout(AWidth, ATimeWidth: Integer); +var + DC: HDC; + ATop: Integer; +begin + FCaptionCell.BoundsRect := MakeRect(ATimeWidth, 0, AWidth, 0); + DC := GetDC(0); + try + FLineHeight := FCaptionCell.MeasureFontHeight(DC); + FStartCell.BoundsRect := MakeRect(0, 0, ATimeWidth, FLineHeight); + ATop := FCaptionCell.MeasureContentHeight(DC); + FCaptionCell.Height := ATop; + FMessageCell.BoundsRect := MakeRect(ATimeWidth, ATop, AWidth, ATop); + ATop := FMessageCell.MeasureContentHeight(DC); + FMessageCell.Height := Max(ATop, FLineHeight); + finally + ReleaseDC(0, DC); + end; +end; + +function TcxSchedulerReportDetailsEventCell.CalculateHeight: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to DataItemCount - 1 do + with DataItems[I] do + if Visible then Result := Max(Result, BoundsRect.Bottom); +end; + +procedure TcxSchedulerReportDetailsEventCell.CreateCaptionCell; +begin + FCaptionCell := CreateStringCell(GetCaptionCellText, True, + cdidSchedulerEventCaption); +end; + +procedure TcxSchedulerReportDetailsEventCell.CreateDataItems; +begin + CreateCaptionCell; + CreateTimeCell; + CreateMessageCell; +end; + +procedure TcxSchedulerReportDetailsEventCell.CreateMessageCell; +begin + FMessageCell := CreateStringCell(GetMessageCellText, True, + cdidSchedulerEventMessage); +end; + +procedure TcxSchedulerReportDetailsEventCell.CreateTimeCell; +begin + FStartCell := CreateStringCell(GetTimeCellText, False, cdidSchedulerEventStart); +end; + +function TcxSchedulerReportDetailsEventCell.GetCaptionCellText: string; +begin + Result := Event.Caption; + if Trim(Event.Location) <> '' then + Result := Result + ' -- ' + Event.Location; +end; + +function TcxSchedulerReportDetailsEventCell.GetMessageCellText: string; +begin + if Continued then + Result := cxGetResourceString(@sdxSeeAboveMessage) + else + Result := Event.Message; +end; + +function TcxSchedulerReportDetailsEventCell.GetTimeCellText: string; +begin + if Event.AllDayEvent or ((DateOf(Event.Start) < Date) and (DateOf(Event.Finish) > Date)) then + Result := cxGetResourceString(@sdxAllDayMessage) + else + Result := DateTimeHelper.TimeToStr(Max(Event.Start, Date)) + ' - ' + + DateTimeHelper.TimeToStr(Min(Event.Finish, Date + 1)); +end; + +procedure TcxSchedulerReportDetailsEventCell.SetViewParams( + const AViewParams: TcxViewParams); +var + AParams: TdxReportItemViewParams; +begin + inherited SetViewParams(AViewParams); + FillChar(AParams, SizeOf(AParams), 0); + AParams.NativeParams := AViewParams; + Include(AParams.FontStyle, fsBold); + ReportLink.SetCellViewParams(CaptionCell, AParams); + ReportLink.SetCellViewParams(StartCell, AParams); +end; + +{ TcxSchedulerReportMemoEventCell } + +procedure TcxSchedulerReportMemoEventCell.CalculateLayout(AWidth, + ATimeWidth: Integer); +var + ATop, ASpace: Integer; + DC: HDC; +begin + DC := GetDC(0); + try + FLineHeight := Renderer.CalcTextHeight(DC, 'Wg', False, Font); + ASpace := FLineHeight div 2; + ATop := FLineHeight * 2; + HeaderCell.BoundsRect := MakeRect(0, 0, AWidth, ATop); + Inc(ATop, ASpace); + CalculateLabelAndData(CaptionLabelCell, CaptionCell, DC, ATimeWidth, AWidth, ATop); + CalculateLabelAndData(LocationLabelCell, LocationCell, DC, ATimeWidth, AWidth, ATop); + if Assigned(CaptionLabelCell) or Assigned(LocationLabelCell) then Inc(ATop, ASpace); + CalculateLabelAndData(StartLabelCell, StartCell, DC, ATimeWidth, AWidth, ATop); + CalculateLabelAndData(FinishLabelCell, FinishCell, DC, ATimeWidth, AWidth, ATop); + CalculateLabelAndData(ShowTimeAsLabelCell, ShowTimeAsCell, DC, ATimeWidth, AWidth, ATop); + Inc(ATop, ASpace); + CalculateLabelAndData(RecurrenceLabelCell, RecurrenceCell, DC, ATimeWidth, AWidth, ATop); + CalculateLabelAndData(RecurrencePatternLabelCell, RecurrencePatternCell, DC, ATimeWidth, AWidth, ATop); + if Assigned(MessageCell) then + begin + Inc(ATop, ASpace); + MessageCell.BoundsRect := MakeRect(0, ATop, AWidth, ATop); + MessageCell.Height := MessageCell.MeasureContentHeight(DC); + end; + finally + ReleaseDC(0, DC); + end; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateDataItems; +begin + CreateHeader; + CreateSubject; + CreateLocation; + CreateStart; + CreateFinish; + CreateShowTimeAs; + CreateRecurrence; + CreateRecurrencePattern; + CreateMessage; +end; + +function TcxSchedulerReportMemoEventCell.GetCaptionCellText: string; +begin + Result := Event.Caption; +end; + +function TcxSchedulerReportMemoEventCell.GetMessageCellText: string; +begin + Result := Event.Message; +end; + +function TcxSchedulerReportMemoEventCell.GetTimeCellText: string; +begin + Result := FormatDateTime('ddd ddddd t', Event.Start); +end; + +procedure TcxSchedulerReportMemoEventCell.SetViewParams( + const AViewParams: TcxViewParams); +var + AParams: TdxReportItemViewParams; +begin + ReportLink.SetCellViewParams(Self, AViewParams); + ReportLink.SetCellViewParams(CaptionCell, AViewParams); + ReportLink.SetCellViewParams(LocationCell, AViewParams); + ReportLink.SetCellViewParams(StartCell, AViewParams); + ReportLink.SetCellViewParams(FinishCell, AViewParams); + ReportLink.SetCellViewParams(ShowTimeAsCell, AViewParams); + ReportLink.SetCellViewParams(RecurrenceCell, AViewParams); + ReportLink.SetCellViewParams(RecurrencePatternCell, AViewParams); + ReportLink.SetCellViewParams(MessageCell, AViewParams); + + FillChar(AParams, SizeOf(AParams), 0); + AParams.NativeParams := AViewParams; + Include(AParams.FontStyle, fsBold); + ReportLink.SetCellViewParams(CaptionLabelCell, AParams); + ReportLink.SetCellViewParams(LocationLabelCell, AParams); + ReportLink.SetCellViewParams(StartLabelCell, AParams); + ReportLink.SetCellViewParams(FinishLabelCell, AParams); + ReportLink.SetCellViewParams(ShowTimeAsLabelCell, AParams); + ReportLink.SetCellViewParams(RecurrenceLabelCell, AParams); + ReportLink.SetCellViewParams(RecurrencePatternLabelCell, AParams); + + AParams.FontSize := MulDiv(AViewParams.Font.Size, 3, 2); + ReportLink.SetCellViewParams(HeaderCell, AParams); +end; + +procedure TcxSchedulerReportMemoEventCell.CalculateLabelAndData( + ALabelCell, ADataCell: TAbstractdxReportCellData; DC: HDC; + ATimeWidth, AWidth: Integer; var ATop: Integer); +begin + if Assigned(ALabelCell) then + begin + ALabelCell.BoundsRect := MakeBounds(0, ATop, ATimeWidth, FLineHeight); + ADataCell.BoundsRect := MakeRect(ATimeWidth, ATop, AWidth, ATop); + ADataCell.Height := ADataCell.MeasureContentHeight(DC); + Inc(ATop, Max(ADataCell.Height, FLineHeight)); + end; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateHeader; +begin + FHeaderCell := CreateStringCell(GetHeaderCellText); + FHeaderCell.BorderClass := TdxPSCellBoldFlatBorder; + FHeaderCell.CellSides := [csBottom]; + FHeaderCell.TextAlignY := taBottom; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateFinish; +begin + CreateFinishLabelCell; + CreateFinishCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateFinishCell; +begin + FFinishCell := CreateStringCell(FormatDateTime('ddd ddddd t', Event.Finish)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateFinishLabelCell; +begin + FFinishLabelCell := CreateStringCell( + cxGetResourceString(@sdxFinishLabelCaption)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateLocation; +begin + if Event.Location = '' then Exit; + CreateLocationLabelCell; + CreateLocationCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateLocationCell; +begin + FLocationCell := CreateStringCell(Event.Location); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateLocationLabelCell; +begin + FLocationLabelCell := CreateStringCell( + cxGetResourceString(@sdxLocationLabelCaption)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateMessage; +begin + if GetMessageCellText = '' then Exit; + CreateMessageCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateRecurrence; +begin + CreateRecurrenceLabelCell; + CreateRecurrenceCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateRecurrenceCell; +begin + FRecurrenceCell := CreateStringCell(GetRecurrenceCellText); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateRecurrenceLabelCell; +begin + FRecurrenceLabelCell := CreateStringCell( + cxGetResourceString(@sdxRecurrenceLabelCaption)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateRecurrencePattern; +begin + if not Event.IsRecurring then Exit; + CreateRecurrencePatternLabelCell; + CreateRecurrencePatternCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateRecurrencePatternCell; +begin + FRecurrencePatternCell := CreateStringCell(GetRecurrencePatternCellText); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateRecurrencePatternLabelCell; +begin + FRecurrencePatternLabelCell := CreateStringCell( + cxGetResourceString(@sdxRecurrencePatternLabelCaption)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateShowTimeAs; +begin + if GetShowTimeAsCellText = '' then Exit; + CreateShowTimeAsLabelCell; + CreateShowTimeAsCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateShowTimeAsCell; +begin + FShowTimeAsCell := CreateStringCell(GetShowTimeAsCellText); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateShowTimeAsLabelCell; +begin + FShowTimeAsLabelCell := CreateStringCell( + cxGetResourceString(@sdxShowTimeAsLabelCaption)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateStart; +begin + CreateStartLabelCell; + CreateTimeCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateStartLabelCell; +begin + FStartLabelCell := CreateStringCell( + cxGetResourceString(@sdxStartLabelCaption)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateSubject; +begin + if GetCaptionCellText = '' then Exit; + CreateSubjectLabelCell; + CreateCaptionCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateSubjectLabelCell; +begin + FCaptionLabelCell := CreateStringCell( + cxGetResourceString(@sdxSubjectLabelCaption)); +end; + +function TcxSchedulerReportMemoEventCell.GetHeaderCellText: string; +var + AResource: TcxSchedulerStorageResourceItem; +begin + AResource := Event.GetResourceItem; + if AResource <> nil then + Result := AResource.Name + else + Result := dxPSUtl.GetUserName; +end; + +function TcxSchedulerReportMemoEventCell.GetRecurrenceCellText: string; +begin + if Event.IsRecurring then + case Event.RecurrenceInfo.Recurrence of + cxreDaily: + Result := cxGetResourceString(@scxRecurrenceDailyMessage); + cxreWeekly: + Result := cxGetResourceString(@scxRecurrenceWeeklyMessage); + cxreMonthly: + Result := cxGetResourceString(@scxRecurrenceMonthlyMessage); + cxreYearly: + Result := cxGetResourceString(@scxRecurrenceYearlyMessage); + else + Result := ''; + end + else + Result := cxGetResourceString(@sdxRecurrenceNoneMessage); +end; + +function TcxSchedulerReportMemoEventCell.GetRecurrencePatternCellText: string; +begin + if Event.IsRecurring and Assigned(cxGetRecurrenceDescriptionStringProc) then + Result := cxGetRecurrenceDescriptionStringProc(Event.RecurrenceInfo) + else + Result := ''; +end; + +function TcxSchedulerReportMemoEventCell.GetShowTimeAsCellText: string; +begin + case Event.State of + tlsFree: + Result := cxGetResourceString(@sdxShowTimeAsFreeMessage); + tlsTentative: + Result := cxGetResourceString(@sdxShowTimeAsTentativeMessage); + tlsOutOfOffice: + Result := cxGetResourceString(@sdxShowTimeAsOutOfOfficeMessage); + else + Result := ''; + end; +end; + +{ TcxSchedulerReportCommonCellsProducer } + +constructor TcxSchedulerReportCommonCellsProducer.CreateEx( + AStyle: TcxCustomSchedulerReportLinkPrintStyle; + ASite: TcxSchedulerReportSchedulingAreaCell); +begin + inherited Create(AStyle.GetCorrespondedView); + FStyle := AStyle; + FSite := ASite; +end; + +procedure TcxSchedulerReportCommonCellsProducer.GetPageResources( + AResources: TcxObjectList); +var + ResPerPage, APageIndex, I, J: Integer; +begin + ResPerPage := Style.ResourceCountPerPage; + if Resources = nil then Exit; + if (ResPerPage <= 0) or (ResPerPage >= Resources.VisibleResourceCount) then + begin + for I := 0 to Resources.VisibleResourceCount - 1 do + begin + AResources.Add(TcxSchedulerResourceViewInfo.Create( + Resources.VisibleResources[I])); + end; + Exit; + end; + APageIndex := (Site.PageIndex div PagesPerWeek) mod Style.GetResourcePageCount; + I := ResPerPage * APageIndex; + J := Min(ResPerPage * (APageIndex + 1), Resources.VisibleResourceCount); + while I < J do + begin + AResources.Add(TcxSchedulerResourceViewInfo.Create( + Resources.VisibleResources[I])); + I := I + 1; + end; +end; + +procedure TcxSchedulerReportCommonCellsProducer.Produce; +begin + Calculate; +end; + +procedure TcxSchedulerReportCommonCellsProducer.AfterCalculatePage; +var + I, J: Integer; + ASubList: TcxSchedulerViewInfoCellList; + AItem: TcxSchedulerCustomViewInfoItem; + AReportItemClass: TcxSchedulerReportCustomCellClass; + AEventCell: TcxSchedulerReportEventCell; +begin + for I := 0 to Cells.Count - 1 do + begin + ASubList := TcxSchedulerViewInfoCellList(Cells[I]); + for J := 0 to ASubList.Count - 1 do + begin + AItem := ASubList[J]; + if AItem.Visible then + begin + if AItem is TcxSchedulerEventCellViewInfo then + begin + AEventCell := CreateEventCell(TcxSchedulerEventCellViewInfo(AItem)); + Style.ReportLink.DoInitializeEventCell(AEventCell); + end + else + if FindMirorClassForItem(AItem, AReportItemClass) then + ConvertSchedulerCellToPSCells(AItem, AReportItemClass); + end; + end; + end; +end; + +function TcxSchedulerReportCommonCellsProducer.CanCalculate: Boolean; +begin + Result := True; +end; + +function TcxSchedulerReportCommonCellsProducer.CreateEventCell( + AEventViewInfo: TcxSchedulerEventCellViewInfo): TcxSchedulerReportEventCell; +begin + Result := TcxSchedulerReportEventCell.CreateFrom(Site, AEventViewInfo); +end; + +procedure TcxSchedulerReportCommonCellsProducer.ConvertSchedulerCellToPSCells( + AItem: TcxSchedulerCustomViewInfoItem; + AReportItemClass: TcxSchedulerReportCustomCellClass); +var + APSItem: TcxSchedulerReportCustomCell; +begin + APSItem := AReportItemClass.CreateFrom(FSite, AItem); + SetCellViewParams(APSItem, AItem.ViewParams); +end; + +procedure TcxSchedulerReportCommonCellsProducer.DoInitialize( + var ASelectedDays: TcxSchedulerDateList; var AEvents: TcxSchedulerCachedEventList); +begin + ASelectedDays := Site.VisibleDays; + AEvents := Style.Events; +end; + +function TcxSchedulerReportCommonCellsProducer.GetCompressWeekends: Boolean; +begin + Result := Style.CompressWeekends; +end; + +function TcxSchedulerReportCommonCellsProducer.GetDontPrintWeekEnds: Boolean; +begin + Result := Style.DontPrintWeekends; +end; + +function TcxSchedulerReportCommonCellsProducer.GetHideSelection: Boolean; +begin + Result := True; +end; + +function TcxSchedulerReportCommonCellsProducer.GetPageBounds: TRect; +begin + Result := Site.GetInnerBounds(0); +end; + +function TcxSchedulerReportCommonCellsProducer.GetPagesPerWeek: Byte; +begin + Result := Integer(Style.Layout) + 1; +end; + +function TcxSchedulerReportCommonCellsProducer.GetPrintExactlyOneMonth: Boolean; +begin + Result := (Style is TcxSchedulerReportLinkMonthlyPrintStyle) and + TcxSchedulerReportLinkMonthlyPrintStyle(Style).PrintExactlyOneMonthPerPage; +end; + +function TcxSchedulerReportCommonCellsProducer.GetPrintRange( + Index: Integer): TDateTime; +begin + if Index = 0 then + Result := Style.TimePrintFrom + else + Result := Style.TimePrintTo; +end; + +function TcxSchedulerReportCommonCellsProducer.GetPrimaryPage: Boolean; +begin + Result := Site.PrimaryPage; +end; + +function TcxSchedulerReportCommonCellsProducer.GetStylesAdapter: IcxSchedulerStylesAdapter; +begin + Result := Styles; +end; + +procedure TcxSchedulerReportCommonCellsProducer.SetCellViewParams( + ACell: TdxReportVisualItem; const AParams: TcxViewParams); +begin + Site.SetCellViewParams(ACell, AParams); + if Style.ReportLink.OptionsFormatting.SuppressContentColoration then + if ACell is TcxSchedulerReportCustomCell then + TcxSchedulerReportCustomCell(ACell).SuppressColoration; +end; + +function TcxSchedulerReportCommonCellsProducer.GetStyles: TcxSchedulerReportLinkStyles; +begin + Result := Style.VisualStyles; +end; + +{ TcxSchedulerReportDailyCellsProducer } + +procedure TcxSchedulerReportDailyCellsProducer.AfterCalculatePage; +begin + FRulerSite := CreateTimeRulerSite; + SetCellViewParams(FRulerSite, Styles.GetTimeRulerParams); +{ FRulerSite.Transparent := + Style.ReportLink.OptionsFormatting.SuppressContentColoration;} + inherited AfterCalculatePage; +end; + +procedure TcxSchedulerReportDailyCellsProducer.BeforeCalculatePage; +begin + Site.CellSides := csAll; + inherited BeforeCalculatePage; +end; + +procedure TcxSchedulerReportDailyCellsProducer.ConvertSchedulerCellToPSCells( + AItem: TcxSchedulerCustomViewInfoItem; + AReportItemClass: TcxSchedulerReportCustomCellClass); +begin + if AReportItemClass = TcxSchedulerReportDailyTimeRulerCell then + SetCellViewParams(AReportItemClass.CreateFrom(FRulerSite, AItem), AItem.ViewParams) + else + inherited ConvertSchedulerCellToPSCells(AItem, AReportItemClass); +end; + +function TcxSchedulerReportDailyCellsProducer.CreateTimeRulerSite: TcxSchedulerReportDailyTimeRulerCellsSite; +begin + Result := TcxSchedulerReportDailyTimeRulerCellsSite.Create(FSite); + Result.Transparent := True; + Result.ClipChildren := True; +end; + +{ TcxSchedulerReportYearlyCellsProducer } + +procedure TcxSchedulerReportYearlyCellsProducer.Produce; +var + AIndex: Integer; +begin + AIndex := Site.PageIndex; + if Style.MonthCountPerPage <> 12 then + begin + AIndex := AIndex div (Byte(Style.Layout) + 1); + FFirstMonth := (AIndex * Style.MonthCountPerPage) mod 12 + 1 + end + else + FFirstMonth := 1; + inherited Produce; +end; + +function TcxSchedulerReportYearlyCellsProducer.GetDayCountPerPage: Integer; +begin + Result := MaxYearViewWeekDays; + if Style.Layout = pslTwoPages then + begin + if IsPrimaryPage then + Result := cxYearStyleDaysOnPrimaryPage + else + Result := Result - cxYearStyleDaysOnPrimaryPage; + end; +end; + +function TcxSchedulerReportYearlyCellsProducer.GetMonthCount: Integer; +begin + Result := Style.MonthCountPerPage; +end; + +function TcxSchedulerReportYearlyCellsProducer.GetFirstMonth: Integer; +begin + Result := FFirstMonth; +end; + +function TcxSchedulerReportYearlyCellsProducer.GetShowMonthHeaders: Boolean; +const + Dividers: array[TcxSchedulerReportLinkPeriodicPrintStyleLayout] of Integer = (1, 2); +begin + Result := not Style.PrimaryPageHeadersOnly or + (Site.PageIndex mod Style.PeriodPageCount mod Dividers[Style.Layout] = 0); +end; + +function TcxSchedulerReportYearlyCellsProducer.GetShowWeekDayHeaders: Boolean; +const + Indexes: array[TcxSchedulerReportLinkPeriodicPrintStyleLayout] of Integer = (0, 1); +begin + Result := not Style.PrimaryPageHeadersOnly or + (Site.PageIndex mod Style.PeriodPageCount <= Indexes[Style.Layout]) +end; + +function TcxSchedulerReportYearlyCellsProducer.GetStartDayIndex: Integer; +begin + Result := 0; + if (Style.Layout = pslTwoPages) and not IsPrimaryPage then + Result := cxYearStyleDaysOnPrimaryPage +end; + +function TcxSchedulerReportYearlyCellsProducer.QueryInterface( + const IID: TGUID; out Obj): HResult; stdcall; +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +function TcxSchedulerReportYearlyCellsProducer._AddRef: Integer; +begin + Result := -1; +end; + +function TcxSchedulerReportYearlyCellsProducer._Release: Integer; +begin + Result := -1; +end; + +function TcxSchedulerReportYearlyCellsProducer.GetIsPrimaryPage: Boolean; +begin + Result := Site.PageIndex mod 2 = 0; +end; + +function TcxSchedulerReportYearlyCellsProducer.GetStyle: TcxSchedulerReportLinkYearlyPrintStyle; +begin + Result := TcxSchedulerReportLinkYearlyPrintStyle(inherited Style); +end; + +// registration unit part + +procedure RegisterMirrorClasses; +begin + MirrorClasses := TList.Create; + TcxSchedulerReportContentCell.RegisterMirrorClass; + TcxSchedulerReportHeaderItemCell.RegisterMirrorClass; + TcxSchedulerReportGroupSeparatorCell.RegisterMirrorClass; + TcxSchedulerReportContainerCell.RegisterMirrorClass; + TcxSchedulerReportDailyTimeRulerCell.RegisterMirrorClass; +// TcxSchedulerReportEventCell.RegisterMirrorClass; + TcxSchedulerReportMonthDayCell.RegisterMirrorClass; + TcxSchedulerReportBackgroundSlotCell.RegisterMirrorClass; +end; + +procedure UnRegisterMirrorClasses; +begin + MirrorClasses.Free; +end; + +function GetFontFolder : string; +var + APIDL: PItemIDList; + APath: array[0..MAX_PATH] of Char; + AMalloc: IMalloc; +begin + Result := ''; + if ShGetSpecialFolderLocation(Application.Handle, CSIDL_FONTS, APIDL) = S_OK then + begin + if ShGetPathFromIDList(APIDL, APath) then + Result := APath; + if Succeeded(SHGetMalloc(AMalloc)) then + AMalloc.Free(APIDL); + end; +end; + +procedure RegisterReportLinkClasses; +begin + RegisterClasses([TcxSchedulerReportLinkStyles]); + + TcxSchedulerReportSchedulingAreaCell.Register; + TcxSchedulerReportNotesAreaCell.Register; + TcxSchedulerReportTaskPadCell.Register; + TcxSchedulerReportSchedulerHeaderCell.Register; + TcxSchedulerReportSchedulerHeaderDataCell.Register; + + //datenavigator + TcxSchedulerReportDateNavigatorCell.Register; + TcxSchedulerReportDateNavigatorHeader.Register; + TcxSchedulerReportDateNavigatorDay.Register; + TcxSchedulerReportDateNavigatorDayCaption.Register; + TcxSchedulerReportDateNavigatorWeekNumber.Register; + + //scheduling area items + TcxSchedulerReportContentCell.Register; + TcxSchedulerReportHeaderItemCell.Register; + TcxSchedulerReportGroupSeparatorCell.Register; + TcxSchedulerReportContainerCell.Register; + TcxSchedulerReportBackgroundSlotCell.Register; + TcxSchedulerReportDailyTimeRulerCellsSite.Register; + TcxSchedulerReportDailyTimeRulerCell.Register; + TcxSchedulerReportMonthDayCell.Register; + + TcxSchedulerReportCellString.Register; + TcxSchedulerReportEventCell.Register; + TcxSchedulerReportDetailsEventCell.Register; + TcxSchedulerReportMemoEventCell.Register; + + TcxSchedulerReportTimeLineCell.Register; + TcxSchedulerReportTimeLinePart.Register; + + TcxSchedulerReportPageSite.Register; + + dxPSRegisterReportLink(TcxSchedulerReportLink, + TcxScheduler, TcxfmSchedulerReportLinkDesignWindow); +end; + +type + TAddFontMemResource = function (p1: Pointer; p2: DWORD; p3: PDesignVector; p4: LPDWORD): THandle; stdcall; + TRemoveFontMemResource = function (p1: THandle): BOOL; stdcall; + +var + GDI32Lib: HMODULE; + AddFontMemResource: TAddFontMemResource; + RemoveFontMemResource: TRemoveFontMemResource; + +procedure InitializeSchedulerLink; + + function LoadImagesFromResource(AWidth, AHeight: Integer; + const AResourceName: string): TImageList; + begin + Result := TImageList.Create(nil); + Result.Width := AWidth; + Result.Height := AHeight; + Result.Handle := ImageList_LoadImage(HInstance, PAnsiChar(AResourceName), AWidth, + AHeight, CLR_DEFAULT, IMAGE_BITMAP, LR_DEFAULTCOLOR); + end; + +var + Res : TResourceStream; + Count: DWORD; +begin + RegisterMirrorClasses; + // images loading + StyleImages := LoadImagesFromResource(58, 31, IDB_DXPSSCHEDULER_SMALLDESIGNPREVIEW); + StylePreviewImages := LoadImagesFromResource(128, 76, IDB_DXPSSCHEDULER_STYLEDESIGNPREVIEW); + + // font loading + GDI32Lib := LoadLibrary(gdi32); + AddFontMemResource := GetProcAddress(GDI32Lib, 'AddFontMemResourceEx'); + RemoveFontMemResource := GetProcAddress(GDI32Lib, 'RemoveFontMemResourceEx'); + Res := TResourceStream.Create(hInstance, 'SCHEDULERFONT', 'PSSCHEDULERFONT'); + try + if IsWin2KOrXP then + SchedulerFontHandle := AddFontMemResource(Res.Memory, Res.Size, nil, @Count) + else + begin + SchedulerFontFileName := GetFontFolder + '\' + 'dxPScxSchedulerLnk.ttf'; + if not FileExists(SchedulerFontFileName) then + Res.SavetoFile(SchedulerFontFileName); + AddFontResource(PChar(SchedulerFontFileName)); + end; + finally + Res.Free; + end; + SpecialSymbolFont := TFont.Create; + SpecialSymbolFont.Name := 'dxPScxScheduler'; + RegisterReportLinkClasses; +end; + +procedure UnregisterReportLinkClasses; +begin + TcxSchedulerReportSchedulingAreaCell.Unregister; + TcxSchedulerReportNotesAreaCell.Unregister; + TcxSchedulerReportTaskPadCell.Unregister; + TcxSchedulerReportSchedulerHeaderCell.Unregister; + TcxSchedulerReportSchedulerHeaderDataCell.Unregister; + //datenavigator + TcxSchedulerReportDateNavigatorCell.Unregister; + TcxSchedulerReportDateNavigatorHeader.Unregister; + TcxSchedulerReportDateNavigatorDay.Unregister; + TcxSchedulerReportDateNavigatorDayCaption.Unregister; + TcxSchedulerReportDateNavigatorWeekNumber.Unregister; + + //scheduling area items + TcxSchedulerReportContentCell.Unregister; + TcxSchedulerReportHeaderItemCell.Unregister; + TcxSchedulerReportGroupSeparatorCell.Unregister; + TcxSchedulerReportContainerCell.Unregister; + TcxSchedulerReportBackgroundSlotCell.Unregister; + TcxSchedulerReportDailyTimeRulerCellsSite.Unregister; + TcxSchedulerReportDailyTimeRulerCell.Unregister; + TcxSchedulerReportMonthDayCell.Unregister; + + TcxSchedulerReportCellString.Unregister; + TcxSchedulerReportEventCell.Unregister; + TcxSchedulerReportDetailsEventCell.Unregister; + TcxSchedulerReportMemoEventCell.Unregister; + + TcxSchedulerReportTimeLineCell.Unregister; + TcxSchedulerReportTimeLinePart.Unregister; + + TcxSchedulerReportPageSite.Unregister; + + dxPSUnregisterReportLink(TcxSchedulerReportLink, + TcxScheduler, TcxfmSchedulerReportLinkDesignWindow); + UnRegisterClasses([TcxSchedulerReportLinkStyles]); + UnRegisterMirrorClasses; +end; + +procedure FinalizeSchedulerLink; +begin + // images removing + FreeAndNil(StyleImages); + FreeAndNil(StylePreviewImages); + + // font removing + if IsWin2KOrXP then + begin + if SchedulerFontHandle <> 0 then + RemoveFontMemResource(SchedulerFontHandle); + end + else + begin + if RemoveFontResource(PChar(SchedulerFontFileName)) then + DeleteFile(PChar(SchedulerFontFileName)); + end; + + SpecialSymbolFont.Free; + FreeLibrary(GDI32Lib); + + UnregisterReportLinkClasses; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrimaryPageHeadersOnlyClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + TcxSchedulerReportLinkYearlyPrintStyle(ActivePrintStyle). + PrimaryPageHeadersOnly := TcxCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleShowResourceImagesClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ActivePrintStyle.ShowResourceImages := TcxCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleShowEventImagesClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ActivePrintStyle.ShowEventImages := TcxCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +initialization + InitializeSchedulerLink; + +finalization + FinalizeSchedulerLink; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler2LnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler2LnkReg.pas new file mode 100644 index 00000000..34a6acf7 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler2LnkReg.pas @@ -0,0 +1,165 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxScheduler2LnkReg; + +interface + +{$I cxVer.Inc} + +procedure Register; + +implementation + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignEditors, + {$ELSE} + DsgnIntf, + {$ENDIF} + Classes, TypInfo, cxStyles, cxStyleSheetEditor, dxPSCore, dxPScxScheduler2Lnk; + +const + sdxAllResources = '(All resources)'; + sdxAuto = 'Auto'; + sdxDefault = 'Default'; + sdxTypeDefault = '(Type "Default" to restore original Caption)'; + +{ TcxSchedulerReportLinkActiveStylePropertyEditor } + +type + + TcxSchedulerReportLinkResourceCountPerPagePropertyEditor = class(TIntegerProperty) + public + function GetValue: string; override; + end; + + { TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor } + + TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor = class(TComponentProperty) + private + FComponents: TStringList; + function GetReportLink: TBasedxReportLink; + protected + procedure AddComponent(const AName: string); + procedure GetComponents; virtual; + function IsComponentValid(AComponent: TComponent): Boolean; virtual; + public + destructor Destroy; override; + procedure Initialize; override; + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + property ReportLink: TBasedxReportLink read GetReportLink; + end; + +{ TcxSchedulerReportLinkResourceCountPerPagePropertyEditor } + +function TcxSchedulerReportLinkResourceCountPerPagePropertyEditor.GetValue: string; +begin + Result := inherited GetValue; + if GetOrdValue = 0 then + Result := Result + ' ' + sdxAllResources; +end; + +{ TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor } + +destructor TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.Destroy; +begin + FComponents.Free; + inherited Destroy; +end; + +procedure TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.Initialize; +begin + inherited; + FComponents := TStringList.Create; +end; + +function TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes - [paMultiSelect]; +end; + +procedure TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + GetComponents; + for I := 0 to FComponents.Count - 1 do + Proc(FComponents[I]); +end; + +function TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.GetReportLink: TBasedxReportLink; +begin + Result := TBasedxReportLink(GetComponent(0)); +end; + +procedure TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.AddComponent(const AName: string); +begin + if IsComponentValid(Designer.GetComponent(AName)) then FComponents.Add(AName); +end; + +procedure TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.GetComponents; +begin + FComponents.Clear; + Designer.GetComponentNames(GetTypeData(PTypeInfo(TBasedxReportLink.ClassInfo)), AddComponent); +end; + +function TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.IsComponentValid(AComponent: TComponent): Boolean; +begin + Result := (AComponent <> GetComponent(0)) and TBasedxReportLink(AComponent).Aggregable; +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterNoIcon([TcxSchedulerReportLink, TcxSchedulerReportLinkStyleSheet]); + + RegisterPropertyEditor(TypeInfo(Integer), TcxCustomSchedulerReportLinkPrintStyle, + 'ResourceCountPerPage', TcxSchedulerReportLinkResourceCountPerPagePropertyEditor); + RegisterPropertyEditor(TypeInfo(TBasedxReportLink), TcxSchedulerReportLink, + 'TaskPadReportLink', TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor); +end; + +initialization + cxStyles.RegisterStyleSheetClass(TcxSchedulerReportLinkStyleSheet); + +finalization + cxStyles.UnregisterStyleSheetClass(TcxSchedulerReportLinkStyleSheet); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler3Lnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler3Lnk.dfm new file mode 100644 index 00000000..328593f1 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler3Lnk.dfm @@ -0,0 +1,1888 @@ +object cxfmSchedulerReportLinkDesignWindow: TcxfmSchedulerReportLinkDesignWindow + Left = 349 + Top = 267 + BorderStyle = bsDialog + Caption = 'cxfmSchedulerReportLinkDesignWindow' + ClientHeight = 487 + ClientWidth = 618 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 5 + Width = 610 + Height = 445 + ActivePage = tshPrintStyles + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + OnChange = PageControl1Change + object tshPrintRange: TTabSheet + Caption = 'Print Range' + ImageIndex = 3 + object lblPrintRangeStart: TLabel + Left = 17 + Top = 22 + Width = 28 + Height = 13 + Caption = '&Start:' + end + object lblPrintRangeEnd: TLabel + Left = 18 + Top = 54 + Width = 22 + Height = 13 + Caption = '&End:' + end + object lblPrintRangesMiscellaneous: TLabel + Left = 5 + Top = 91 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + Visible = False + end + object Bevel1: TBevel + Left = 80 + Top = 95 + Width = 231 + Height = 4 + Shape = bsBottomLine + Visible = False + end + object dePrintRangeStart: TcxDateEdit + Left = 70 + Top = 18 + EditValue = 38187d + Properties.OnEditValueChanged = dePrintRangeStartEditValueChanged + TabOrder = 0 + Width = 235 + end + object dePrintRangeEnd: TcxDateEdit + Left = 70 + Top = 50 + EditValue = 38187d + Properties.OnEditValueChanged = dePrintRangeEndEditValueChanged + TabOrder = 1 + Width = 235 + end + object chbxHideDetailsOfPrivateAppointments: TcxCheckBox + Left = 66 + Top = 113 + Caption = 'Hide Details of Private Appointments' + TabOrder = 2 + Visible = False + Width = 236 + end + end + object tshPrintStyles: TTabSheet + Caption = 'Print Styles' + object lblPrintStylesOptions: TLabel + Left = 5 + Top = 48 + Width = 37 + Height = 13 + Caption = 'Options' + end + object bvlPrintStyleOptions: TBevel + Left = 50 + Top = 52 + Width = 258 + Height = 4 + Shape = bsBottomLine + end + object lblPreviewWindow: TStaticText + Left = 324 + Top = 0 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 0 + end + object cbxPrintStyles: TcxImageComboBox + Left = 6 + Top = 7 + Properties.Alignment.Vert = taVCenter + Properties.Items = <> + TabOrder = 1 + OnClick = cbxPrintStylesClick + Width = 303 + end + object pcPrintStyleOptions: TPageControl + Left = 4 + Top = 64 + Width = 314 + Height = 348 + ActivePage = tshTimeLine + Style = tsButtons + TabOrder = 2 + TabStop = False + object tshDaily: TTabSheet + Caption = 'Daily' + TabVisible = False + object lblPrintStyleDailyLayout: TLabel + Left = 14 + Top = 4 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleDailyLayout + end + object lblPrintStyleDailyInclude: TLabel + Left = 14 + Top = 64 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleDailyPrintFrom: TLabel + Left = 14 + Top = 136 + Width = 53 + Height = 13 + Caption = 'Print &From:' + FocusControl = tePrintStyleDailyPrintFrom + end + object lblPrintStyleDailyPrintTo: TLabel + Left = 14 + Top = 165 + Width = 41 + Height = 13 + Caption = 'Print &To:' + FocusControl = tePrintStyleDailyPrintTo + end + object lblPrintStyleDailyResourceCountPerPage: TLabel + Left = 14 + Top = 34 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleDailyResourceCountPerPage + end + object Bevel2: TBevel + Left = 32 + Top = 194 + Width = 274 + Height = 4 + Shape = bsBottomLine + end + object lbViewDaily: TLabel + Left = 1 + Top = 190 + Width = 22 + Height = 13 + Caption = 'View' + end + object Bevel7: TBevel + Left = 48 + Top = 237 + Width = 258 + Height = 4 + Shape = bsBottomLine + end + object lbImagesDaily: TLabel + Left = 3 + Top = 232 + Width = 38 + Height = 13 + Caption = 'Images ' + end + object cbxPrintStyleDailyLayout: TcxComboBox + Left = 115 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/day' + '2 pages/day') + TabOrder = 0 + OnClick = cbxPrintStyleDailyLayoutClick + Height = 23 + Width = 186 + end + object chbxPrintStyleDailyTaskPad: TcxCheckBox + Left = 111 + Top = 61 + Caption = 'Task&Pad' + TabOrder = 2 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleDailyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 82 + Caption = 'Notes Area (&Blank)' + TabOrder = 3 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleDailyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 103 + Caption = 'Notes Area (&Lined)' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object tePrintStyleDailyPrintFrom: TcxTimeEdit + Left = 114 + Top = 132 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 5 + Width = 100 + end + object tePrintStyleDailyPrintTo: TcxTimeEdit + Tag = 1 + Left = 114 + Top = 161 + EditValue = 0.000000000000000000 + Properties.ImmediatePost = True + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 6 + Width = 100 + end + object sePrintStyleDailyResourceCountPerPage: TcxSpinEdit + Left = 115 + Top = 30 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 1 + Width = 100 + end + object chbxPrintStyleDailyShowResourceImages: TcxCheckBox + Left = 15 + Top = 206 + Caption = 'Show resource images' + TabOrder = 7 + OnClick = chbxPrintStyleShowResourceImagesClick + Width = 306 + end + object chbxPrintStyleDailyShowEventImages: TcxCheckBox + Left = 15 + Top = 251 + Caption = 'Show event images' + TabOrder = 8 + OnClick = chbxPrintStyleShowEventImagesClick + Width = 306 + end + end + object tshWeekly: TTabSheet + Caption = 'Weekly' + ImageIndex = 1 + TabVisible = False + object lblPrintStyleWeeklyPrintTo: TLabel + Left = 14 + Top = 218 + Width = 41 + Height = 13 + Caption = 'Print &To:' + FocusControl = tePrintStyleWeeklyPrintTo + end + object lblPrintStyleWeeklyPrintFrom: TLabel + Left = 14 + Top = 189 + Width = 53 + Height = 13 + Caption = 'Print &From:' + FocusControl = tePrintStyleWeeklyPrintFrom + end + object lblPrintStyleWeeklyInclude: TLabel + Left = 14 + Top = 119 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleWeeklyLayout: TLabel + Left = 14 + Top = 33 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleWeeklyLayout + end + object lblPrintStyleWeeklyArrange: TLabel + Left = 14 + Top = 4 + Width = 43 + Height = 13 + Caption = '&Arrange:' + FocusControl = cbxPrintStyleWeeklyArrange + end + object lblPrintStyleWeeklyResourceCountPerPage: TLabel + Left = 14 + Top = 94 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleWeeklyResourceCountPerPage + end + object lblPrintStyleWeeklyDaysLayout: TLabel + Left = 14 + Top = 63 + Width = 61 + Height = 13 + Caption = '&Days layout:' + FocusControl = cbxPrintStyleWeeklyDaysLayout + end + object Bevel3: TBevel + Left = 32 + Top = 245 + Width = 274 + Height = 4 + Shape = bsBottomLine + end + object Label5: TLabel + Left = 1 + Top = 241 + Width = 22 + Height = 13 + Caption = 'View' + end + object Bevel8: TBevel + Left = 48 + Top = 287 + Width = 258 + Height = 4 + Shape = bsBottomLine + end + object Label6: TLabel + Left = 3 + Top = 282 + Width = 38 + Height = 13 + Caption = 'Images ' + end + object tePrintStyleWeeklyPrintTo: TcxTimeEdit + Tag = 1 + Left = 114 + Top = 213 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 8 + Width = 100 + end + object tePrintStyleWeeklyPrintFrom: TcxTimeEdit + Left = 114 + Top = 184 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 7 + Width = 100 + end + object chbxPrintStyleWeeklyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 158 + Caption = 'Notes Area (&Lined)' + TabOrder = 6 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleWeeklyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 137 + Caption = 'Notes Area (&Blank)' + TabOrder = 5 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object cbxPrintStyleWeeklyArrange: TcxComboBox + Left = 115 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + 'Top to Bottom' + 'Left to Right') + TabOrder = 0 + OnClick = cbxPrintStyleWeeklyArrangeClick + Height = 23 + Width = 186 + end + object cbxPrintStyleWeeklyLayout: TcxComboBox + Left = 115 + Top = 29 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/day' + '2 pages/day') + TabOrder = 1 + OnClick = cbxPrintStyleWeeklyLayoutClick + Height = 23 + Width = 186 + end + object chbxPrintStyleWeeklyTaskPad: TcxCheckBox + Left = 111 + Top = 116 + Caption = 'TaskPad' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleWeeklyDontPrintWeekends: TcxCheckBox + Left = 15 + Top = 257 + Caption = 'Don'#39't Print &Weekends' + TabOrder = 9 + OnClick = chbxPrintStyleWeeklyDontPrintWeekendsClick + Width = 285 + end + object sePrintStyleWeeklyResourceCountPerPage: TcxSpinEdit + Tag = 1 + Left = 115 + Top = 90 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 3 + Width = 100 + end + object cbxPrintStyleWeeklyDaysLayout: TcxComboBox + Left = 115 + Top = 59 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + 'Two columns' + 'One column') + TabOrder = 2 + OnClick = cbxPrintStyleWeeklyDaysLayoutClick + Height = 23 + Width = 186 + end + object chbxPrintStyleWeeklyShowEventImages: TcxCheckBox + Left = 15 + Top = 320 + Caption = 'Show Event Images' + TabOrder = 11 + OnClick = chbxPrintStyleShowEventImagesClick + Width = 306 + end + object chbxPrintStyleWeeklyShowResourceImages: TcxCheckBox + Left = 15 + Top = 299 + Caption = 'Show Resource Images' + TabOrder = 10 + OnClick = chbxPrintStyleShowResourceImagesClick + Width = 306 + end + end + object tshMonthly: TTabSheet + Caption = 'Monthly' + ImageIndex = 2 + TabVisible = False + object lblPrintStyleMonthlyLayout: TLabel + Left = 14 + Top = 4 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleMonthlyLayout + end + object lblPrintStyleMonthlyInclude: TLabel + Left = 14 + Top = 62 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleMonthlyResourceCountPerPage: TLabel + Left = 14 + Top = 34 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleMonthlyResourceCountPerPage + end + object Bevel9: TBevel + Left = 32 + Top = 129 + Width = 274 + Height = 4 + Shape = bsBottomLine + end + object Label7: TLabel + Left = 1 + Top = 125 + Width = 22 + Height = 13 + Caption = 'View' + end + object Bevel10: TBevel + Left = 48 + Top = 191 + Width = 258 + Height = 4 + Shape = bsBottomLine + end + object Label8: TLabel + Left = 3 + Top = 186 + Width = 38 + Height = 13 + Caption = 'Images ' + end + object cbxPrintStyleMonthlyLayout: TcxComboBox + Left = 115 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/month' + '2 pages/month') + TabOrder = 0 + OnClick = cbxPrintStyleMonthlyLayoutClick + Height = 23 + Width = 186 + end + object chbxPrintStyleMonthlyTaskPad: TcxCheckBox + Left = 111 + Top = 59 + Caption = 'Task&Pad' + TabOrder = 2 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleMonthlyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 80 + Caption = 'Notes Area (&Blank)' + TabOrder = 3 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleMonthlyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 101 + Caption = 'Notes Area (&Lined)' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleMonthlyDontPrintWeekends: TcxCheckBox + Left = 15 + Top = 141 + Caption = 'Don'#39't Print &Weekends' + TabOrder = 5 + OnClick = chbxPrintStyleDontPrintWeekEndsClick + Width = 285 + end + object chbxPrintStyleMonthlyPrintExactlyOneMonthPerPage: TcxCheckBox + Left = 15 + Top = 162 + Caption = 'Print Exactly One Month Per Page' + TabOrder = 6 + OnClick = chbxPrintStyleMonthlyPrintExactlyOneMonthPerPageClick + Width = 285 + end + object sePrintStyleMonthlyResourceCountPerPage: TcxSpinEdit + Tag = 2 + Left = 115 + Top = 29 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 1 + Width = 100 + end + object chbxPrintStyleMonthlyShowEventImages: TcxCheckBox + Left = 15 + Top = 224 + Caption = 'Show Event Images' + TabOrder = 7 + OnClick = chbxPrintStyleShowEventImagesClick + Width = 306 + end + object chbxPrintStyleMonthlyShowResourceImages: TcxCheckBox + Left = 15 + Top = 203 + Caption = 'Show Resource Images' + TabOrder = 8 + OnClick = chbxPrintStyleShowResourceImagesClick + Width = 306 + end + end + object tshTrifold: TTabSheet + Caption = 'Tri-fold' + ImageIndex = 3 + TabVisible = False + object lblPrintStyleTrifoldSectionLeft: TLabel + Left = 14 + Top = 4 + Width = 61 + Height = 13 + Caption = '&Left Section:' + FocusControl = cbxPrintStyleTrifoldSectionLeft + end + object lblPrintStyleTrifoldSectionMiddle: TLabel + Left = 14 + Top = 38 + Width = 72 + Height = 13 + Caption = '&Middle Section:' + FocusControl = cbxPrintStyleTrifoldSectionMiddle + end + object lblPrintStyleTrifoldSectionRight: TLabel + Left = 14 + Top = 71 + Width = 67 + Height = 13 + Caption = '&Right Section:' + FocusControl = cbxPrintStyleTrifoldSectionRight + end + object cbxPrintStyleTrifoldSectionLeft: TcxComboBox + Left = 100 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + TabOrder = 0 + OnClick = cbxPrintStyleTrifoldSectionModeClick + Height = 23 + Width = 201 + end + object cbxPrintStyleTrifoldSectionMiddle: TcxComboBox + Tag = 1 + Left = 100 + Top = 33 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + TabOrder = 1 + OnClick = cbxPrintStyleTrifoldSectionModeClick + Height = 23 + Width = 201 + end + object cbxPrintStyleTrifoldSectionRight: TcxComboBox + Tag = 2 + Left = 100 + Top = 66 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + TabOrder = 2 + OnClick = cbxPrintStyleTrifoldSectionModeClick + Height = 23 + Width = 201 + end + end + object tshDetails: TTabSheet + Caption = 'Details' + ImageIndex = 4 + TabVisible = False + object chbxPrintStyleDetailsUsePagination: TcxCheckBox + Left = 14 + Top = 0 + Caption = 'Start a New Page Each:' + TabOrder = 0 + OnClick = chbxPrintStyleDetailsUsePaginationClick + Width = 187 + end + object cbxPrintStyleDetailsPagination: TcxComboBox + Left = 203 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + 'Day' + 'Week' + 'Month') + TabOrder = 1 + OnClick = cbxPrintStyleDetailsPaginationClick + Height = 23 + Width = 98 + end + end + object tshMemo: TTabSheet + Caption = 'Memo' + ImageIndex = 5 + TabVisible = False + object chbxPrintStyleMemoStartEachItemOnNewPage: TcxCheckBox + Left = 14 + Top = 0 + Caption = 'Start Each Item On New Page' + TabOrder = 0 + OnClick = chbxPrintStyleMemoStartEachItemOnNewPageClick + Width = 187 + end + object chbxPrintStyleMemoPrintOnlySelectedEvents: TcxCheckBox + Left = 14 + Top = 22 + Caption = 'Print Only Selected Events' + State = cbsChecked + TabOrder = 1 + OnClick = chbxPrintStyleMemoPrintOnlySelectedEventsClick + Width = 187 + end + end + object tshYearly: TTabSheet + Caption = 'Yearly' + ImageIndex = 6 + TabVisible = False + object lblPrintStyleYearlyMonthPerPage: TLabel + Left = 14 + Top = 38 + Width = 67 + Height = 13 + Caption = '&Months/Page:' + FocusControl = cbxPrintStyleYearlyMonthPerPage + end + object lblPrintStyleYearlyResourceCountPerPage: TLabel + Left = 14 + Top = 72 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleYearlyResourceCountPerPage + Visible = False + end + object lblPrintStyleYearlyInclude: TLabel + Left = 14 + Top = 102 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleYearlyLayout: TLabel + Left = 14 + Top = 4 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleYearlyLayout + end + object Bevel4: TBevel + Left = 32 + Top = 171 + Width = 274 + Height = 4 + Shape = bsBottomLine + end + object Label9: TLabel + Left = 1 + Top = 167 + Width = 22 + Height = 13 + Caption = 'View' + end + object Bevel5: TBevel + Left = 48 + Top = 216 + Width = 258 + Height = 4 + Shape = bsBottomLine + end + object Label10: TLabel + Left = 3 + Top = 211 + Width = 38 + Height = 13 + Caption = 'Images ' + end + object cbxPrintStyleYearlyMonthPerPage: TcxComboBox + Left = 115 + Top = 33 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/year' + '2 pages/year' + '3 pages/year' + '4 pages/year' + '6 pages/year' + '12 pages/year') + TabOrder = 1 + Text = '12 pages/year' + OnClick = cbxPrintStyleYearlyMonthPagesPerYearClick + Height = 23 + Width = 186 + end + object sePrintStyleYearlyResourceCountPerPage: TcxSpinEdit + Tag = 3 + Left = 115 + Top = 68 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 2 + Visible = False + Width = 100 + end + object chbxPrintStyleYearlyTaskPad: TcxCheckBox + Left = 111 + Top = 99 + Caption = 'Task&Pad' + TabOrder = 3 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleYearlyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 120 + Caption = 'Notes Area (&Blank)' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleYearlyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 141 + Caption = 'Notes Area (&Lined)' + TabOrder = 5 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object cbxPrintStyleYearlyLayout: TcxComboBox + Left = 115 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/month' + '2 pages/month') + TabOrder = 0 + Text = '1 page/month' + OnClick = cbxPrintStyleYearlyLayoutClick + Height = 23 + Width = 186 + end + object chbxPrimaryPageHeadersOnly: TcxCheckBox + Left = 15 + Top = 184 + Caption = 'Primary Page Headers Only' + TabOrder = 6 + OnClick = chbxPrimaryPageHeadersOnlyClick + Width = 153 + end + object chbxPrintStyleYearlyShowEventImages: TcxCheckBox + Left = 15 + Top = 230 + Caption = 'Show Event Images' + TabOrder = 7 + OnClick = chbxPrintStyleShowEventImagesClick + Width = 306 + end + end + object tshTimeLine: TTabSheet + Caption = 'TimeLine' + ImageIndex = 7 + TabVisible = False + object lblPrintStyleTimeLineResourceCountPerPage: TLabel + Left = 14 + Top = 3 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleTimeLineResourceCountPerPage + end + object lblPrintStyleTimeLineInclude: TLabel + Left = 14 + Top = 33 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleTimeLinePrintFrom: TLabel + Left = 14 + Top = 106 + Width = 53 + Height = 13 + Caption = 'Print &From:' + FocusControl = tePrintStyleTimeLinePrintFrom + end + object lblPrintStyleTimeLinePrintTo: TLabel + Left = 14 + Top = 135 + Width = 41 + Height = 13 + Caption = 'Print &To:' + FocusControl = tePrintStyleTimeLinePrintTo + end + object Bevel6: TBevel + Left = 32 + Top = 165 + Width = 274 + Height = 4 + Shape = bsBottomLine + end + object bvlTimeLineImages: TBevel + Left = 48 + Top = 274 + Width = 258 + Height = 4 + Shape = bsBottomLine + end + object Label2: TLabel + Left = 1 + Top = 161 + Width = 22 + Height = 13 + Caption = 'View' + end + object lbTimeLineImages: TLabel + Left = 3 + Top = 269 + Width = 38 + Height = 13 + Caption = 'Images ' + end + object sePrintStyleTimeLineResourceCountPerPage: TcxSpinEdit + Tag = 4 + Left = 115 + Top = -1 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 0 + Width = 100 + end + object chbxPrintStyleTimeLineTaskPad: TcxCheckBox + Left = 111 + Top = 30 + Caption = 'Task&Pad' + TabOrder = 1 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleTimeLineNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 51 + Caption = 'Notes Area (&Blank)' + TabOrder = 2 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleTimeLineNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 72 + Caption = 'Notes Area (&Lined)' + TabOrder = 3 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object tePrintStyleTimeLinePrintFrom: TcxTimeEdit + Left = 114 + Top = 101 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 4 + Width = 100 + end + object tePrintStyleTimeLinePrintTo: TcxTimeEdit + Tag = 1 + Left = 114 + Top = 130 + EditValue = 0.000000000000000000 + Properties.ImmediatePost = True + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 5 + Width = 100 + end + object chbxPrintStyleTimeLineShowResourceImages: TcxCheckBox + Left = 15 + Top = 288 + Caption = 'Show Resource Images' + TabOrder = 10 + OnClick = chbxPrintStyleShowResourceImagesClick + Width = 306 + end + object chbxPrintStyleTimeLineShowEventImages: TcxCheckBox + Left = 15 + Top = 309 + Caption = 'Show Event Images' + TabOrder = 11 + OnClick = chbxPrintStyleShowEventImagesClick + Width = 306 + end + object chbxPrintStyleTimeLinePrimaryPageHeadersOnly: TcxCheckBox + Left = 15 + Top = 201 + Caption = 'Primary Page Headers Only' + TabOrder = 7 + OnClick = chbxPrimaryPageHeadersOnlyClick + Width = 170 + end + object chbxPrintStyleTimeLinePrimaryPageScalesOnly: TcxCheckBox + Left = 15 + Top = 180 + Caption = 'Primary Page Scales Only' + TabOrder = 6 + OnClick = chbxPrimaryPageScalesOnlyClick + Width = 162 + end + object chbxPrintStyleTimeLineDontPrintWeekends: TcxCheckBox + Left = 15 + Top = 222 + Caption = 'Don'#39't Print &Weekends' + TabOrder = 8 + OnClick = chbxPrintStyleDontPrintWeekEndsClick + Width = 194 + end + object chbxPrintStyleTimeLineWorkTimeOnly: TcxCheckBox + Left = 15 + Top = 243 + Caption = 'W&ork Time Only' + TabOrder = 9 + OnClick = chbxPrintStyleWorkTimeOnlyClick + Width = 194 + end + end + end + object pnlPrintStylesPreview: TPanel + Left = 323 + Top = 17 + Width = 275 + Height = 356 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 3 + object pbxPrintStylesPreview: TPaintBox + Left = 1 + Top = 1 + Width = 273 + Height = 354 + Align = alClient + OnPaint = pbxPrintStylesPreviewPaint + end + end + end + object tshFormatting: TTabSheet + Caption = 'Formatting' + ImageIndex = 2 + object bvlLookAndFeel: TBevel + Left = 85 + Top = 13 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object lblLookAndFeel: TLabel + Left = 5 + Top = 8 + Width = 66 + Height = 13 + Caption = 'Look and Feel' + end + object imgLookAndFeel: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDD77777777777777777777 + 7777D0000000000000000000000007DDDDDDDDDDDDD000000000000000000000 + 0007D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0FFFFFFFFFF78888877787807DDDDDDDDDDDDD0FFFFFFFFFF7888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7888888888 + 8807D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCDDDDCDDDD077777777777777777777 + 7707D0888877787878888877787807DDDCCCCDCCDDD088887778787888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF07DDDCCCCCCCCDD088888888887888888888 + 8807D0777777777777777777777707DDDCCCCDCCDDD077777777777777777777 + 7707D0FFFFFFFFFF7FFFFFFFFFFF07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0FFFFFFFFFF7FFFFFFFFFFF07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDCCCCDCCDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCCCCCCCCDD077777777777777777777 + 7707D0888877787878888877787807DDDCCCCDCCDDD088887778787888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF07DDDCDDDDCDDDD088888888887888888888 + 8807D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D0888877787878888877787807DDDDDDDDDDDDD088887778787888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF0DDDDDDDDDDDDDD088888888887888888888 + 8807D000000000000000000000000DDDDDDDDDDDDDD000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblRefinements: TLabel + Left = 5 + Top = 78 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlRefinements: TBevel + Left = 75 + Top = 82 + Width = 236 + Height = 4 + Shape = bsBottomLine + end + object imgRefinements: TImage + Left = 8 + Top = 100 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDD77777777777777777777 + 7777D0000000000000000000000007DDDDDDDDDDDDD000000000000000000000 + 0007D0FAFAFAFAFA7AFAFAFAFAFA07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0FAFAFAFAFA788888777CC807DDDDDDDDDDDDD0FFFFFFFFFF7888887778 + 7807D0AFAFAFAFAF78888888888807DDDDDDDDDDDDD0FFFFFFFFFF7888888888 + 8807D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0AFAFAFAFAF7FAFAFAFAFAF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FAFAFAFAFA7AFAFAFAFAFA07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCDDDDCDDDD077777777777777777777 + 7707D08888777CC8788888777CC807DDDCCCCDCCDDD088887778787888887778 + 7807D0888888888878888888888807DDDCCCCCCCCDD088888888887888888888 + 8807D0777777777777777777777707DDDCCCCDCCDDD077777777777777777777 + 7707D0FEFEFEFEFE7EFEFEFEFEFE07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0EFEFEFEFEF7FEFEFEFEFEF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0EFEFEFEFEF7FEFEFEFEFEF07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FEFEFEFEFE7EFEFEFEFEFE07DDDCCCCDCCDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCCCCCCCCDD077777777777777777777 + 7707D08888777CC8788888777CC807DDDCCCCDCCDDD088887778787888887778 + 7807D0888888888878888888888807DDDCDDDDCDDDD088888888887888888888 + 8807D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D0FBFBFBFBFB7BFBFBFBFBFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0BFBFBFBFBF7FBFBFBFBFBF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0BFBFBFBFBF7FBFBFBFBFBF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FBFBFBFBFB7BFBFBFBFBFB07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D08888777CC8788888777CC807DDDDDDDDDDDDD088887778787888887778 + 7807D088888888887888888888880DDDDDDDDDDDDDD088888888887888888888 + 8807D000000000000000000000000DDDDDDDDDDDDDD000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object cbxLookAndFeel: TcxComboBox + Left = 90 + Top = 37 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.OnChange = cbxLookAndFeelPropertiesChange + TabOrder = 0 + OnClick = LookAndFeelChange + Height = 23 + Width = 215 + end + object chbxSuppressBackgroundBitmaps: TcxCheckBox + Tag = 1 + Left = 90 + Top = 104 + Caption = 'Suppress Background Textures' + TabOrder = 1 + OnClick = OptionsFormattingClick + Width = 200 + end + object chbxSuppressContentColoration: TcxCheckBox + Tag = 2 + Left = 90 + Top = 130 + Caption = 'Suppress Content Coloration' + TabOrder = 2 + OnClick = OptionsFormattingClick + Width = 200 + end + end + object tshStyles: TTabSheet + Caption = 'Styles' + ImageIndex = 1 + object bvlStyles: TBevel + Left = 118 + Top = 13 + Width = 193 + Height = 4 + Shape = bsBottomLine + end + object bvlStyleSheets: TBevel + Left = 72 + Top = 302 + Width = 239 + Height = 5 + Shape = bsBottomLine + end + object lblStyleSheets: TLabel + Left = 6 + Top = 298 + Width = 60 + Height = 13 + Caption = 'Style Sheets' + end + object bvlStylesHost: TBevel + Left = 6 + Top = 33 + Width = 228 + Height = 222 + end + object Label1: TLabel + Left = 85 + Top = 140 + Width = 64 + Height = 13 + Caption = '[ Styles Site ]' + Visible = False + end + object lblUseNativeStyles: TLabel + Left = 24 + Top = 9 + Width = 84 + Height = 13 + Caption = '&Use Native Styles' + FocusControl = chbxUseNativeStyles + OnClick = lblUseNativeStylesClick + end + object btnStyleColor: TButton + Left = 243 + Top = 61 + Width = 68 + Height = 23 + Caption = 'Co&lor...' + TabOrder = 0 + OnClick = btnStyleColorClick + end + object btnStyleFont: TButton + Left = 243 + Top = 33 + Width = 68 + Height = 23 + Caption = '&Font...' + TabOrder = 1 + OnClick = btnStyleFontClick + end + object btnStyleBackgroundBitmap: TButton + Left = 243 + Top = 97 + Width = 68 + Height = 23 + Caption = '&Bitmap...' + TabOrder = 2 + OnClick = btnStyleBackgroundBitmapClick + end + object cbxStyleSheets: TcxComboBox + Left = 6 + Top = 318 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 20 + Properties.OnDrawItem = cbxStyleSheetsPropertiesDrawItem + TabOrder = 3 + OnClick = cbxStyleSheetsClick + OnKeyDown = cbxStyleSheetsKeyDown + Height = 24 + Width = 305 + end + object btnStyleSheetNew: TButton + Left = 6 + Top = 350 + Width = 71 + Height = 23 + Caption = '&New...' + TabOrder = 4 + OnClick = btnStyleSheetNewClick + end + object btnStyleSheetCopy: TButton + Left = 84 + Top = 350 + Width = 71 + Height = 23 + Caption = '&Copy...' + TabOrder = 5 + OnClick = btnStyleSheetCopyClick + end + object btnStyleSheetDelete: TButton + Left = 162 + Top = 350 + Width = 71 + Height = 23 + Caption = '&Delete...' + TabOrder = 6 + OnClick = btnStyleSheetDeleteClick + end + object btnStylesSaveAs: TButton + Left = 123 + Top = 263 + Width = 112 + Height = 23 + Caption = 'Save &As...' + TabOrder = 7 + OnClick = btnStylesSaveAsClick + end + object btnStyleSheetRename: TButton + Left = 240 + Top = 350 + Width = 71 + Height = 23 + Caption = '&Rename...' + TabOrder = 8 + OnClick = btnStyleSheetRenameClick + end + object btnStyleBackgroundBitmapClear: TButton + Left = 243 + Top = 125 + Width = 68 + Height = 23 + Caption = 'Cle&ar' + TabOrder = 9 + OnClick = btnStyleBackgroundBitmapClearClick + end + object btnStyleRestoreDefaults: TButton + Left = 6 + Top = 263 + Width = 112 + Height = 23 + Caption = 'Rest&ore Defaults' + TabOrder = 10 + OnClick = btnStyleRestoreDefaultsClick + end + object chbxUseNativeStyles: TcxCheckBox + Left = 3 + Top = 6 + TabOrder = 11 + OnClick = OptionsFormattingClick + Width = 22 + end + end + end + object pnlPreview: TPanel + Left = 331 + Top = 46 + Width = 275 + Height = 395 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 273 + Height = 393 + Align = alClient + Color = clWindow + TabOrder = 0 + object pbPreview: TPaintBox + Left = 1 + Top = 1 + Width = 271 + Height = 391 + Align = alClient + OnPaint = pbPreviewPaint + end + end + end + object pmStyles: TPopupMenu + Images = ilStylesPopup + OnPopup = pmStylesPopup + Left = 6 + Top = 441 + object miStyleFont: TMenuItem + Caption = '&Font...' + ImageIndex = 0 + OnClick = btnStyleFontClick + end + object miStyleColor: TMenuItem + Caption = '&Color...' + OnClick = btnStyleColorClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miStyleBackgroundBitmap: TMenuItem + Caption = '&Bitmap...' + ImageIndex = 1 + ShortCut = 16463 + OnClick = btnStyleBackgroundBitmapClick + end + object miStyleBackgroundBitmapClear: TMenuItem + Caption = 'Clear' + ImageIndex = 3 + ShortCut = 16430 + OnClick = btnStyleBackgroundBitmapClearClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miStyleRestoreDefaults: TMenuItem + Caption = 'Restore Defaults' + OnClick = btnStyleRestoreDefaultsClick + end + object milLine: TMenuItem + Caption = '-' + end + object miStylesSelectAll: TMenuItem + Caption = 'Select A&ll' + ShortCut = 16449 + OnClick = miStylesSelectAllClick + end + object miLine4: TMenuItem + Caption = '-' + end + object miStylesSaveAs: TMenuItem + Caption = 'Save &As...' + ImageIndex = 2 + ShortCut = 16467 + OnClick = btnStylesSaveAsClick + end + end + object ilStylesPopup: TImageList + Left = 34 + Top = 441 + Bitmap = { + 494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00000000000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF000000 + 0000008080000080800000808000008080000080800000808000008080000080 + 8000008080000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000000000000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000008080000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF00FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800080808000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00C0C0C00000FFFF00C0C0C000FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000000000008080800080808000000000008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C00000000000C0C0C00000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFC001FFFF + FE07001F8001FFF9FF9F000F8001E7FFFF9F00078001C3F3E01F00038001C3E7 + F99F00018001E1C7F99B00008001F08FF99B00018001F81FF89300018001FC3F + D80300018001F81FD9BF80018001F09FC93FE0018001C1C7C03FE001800183E3 + FFFFE00180018FF1FFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end + object cxEditStyleController1: TcxEditStyleController + OnStyleChanged = StyleController1StyleChanged + Left = 64 + Top = 440 + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler3Lnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler3Lnk.pas new file mode 100644 index 00000000..4340a867 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler3Lnk.pas @@ -0,0 +1,11852 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxScheduler3Lnk; + +{$I cxVer.Inc} + +interface + +uses + Windows, Classes, SysUtils, Forms, Graphics, Controls, StdCtrls, ExtCtrls, ComCtrls, + ImgList, Menus, cxGraphics, cxClasses, cxControls, cxStyles, cxLookAndFeels, cxLookAndFeelPainters, + cxScheduler, cxEdit, cxContainer, cxTextEdit, cxMaskEdit, cxDropDownEdit, + cxCalendar, cxCheckBox, cxImageComboBox, cxTimeEdit, cxSpinEdit, cxDateUtils, + dxPSCore, dxPSGlbl, dxExtCtrls, dxPScxCommon, dxPrevw, dxPgsdlg, dxPrnPg, cxSchedulerUtils, + cxSchedulerStorage, cxSchedulerCustomControls, cxSchedulerCustomResourceView, + cxSchedulerDayView, cxSchedulerDateNavigator, cxSchedulerWeekView, cxSchedulerTimeGridView, + cxSchedulerYearView, cxSchedulerGanttView, cxGeometry; + +const + // visual print style indexes + + vspsSchedulerFirst = 0; + + vspsSchedulerControlFirst = vspsSchedulerFirst + 0; + vspsSchedulerContent = vspsSchedulerControlFirst + 0; + vspsSchedulerDayHeader = vspsSchedulerControlFirst + 1; + vspsSchedulerEvent = vspsSchedulerControlFirst + 2; + vspsSchedulerResourceHeader = vspsSchedulerControlFirst + 3; + vspsSchedulerControlLast = vspsSchedulerControlFirst + 3; + + vspsSchedulerViewDayFirst = vspsSchedulerControlLast + 1; + vspsSchedulerTimeRuler = vspsSchedulerViewDayFirst + 0; + vspsSchedulerViewDayLast = vspsSchedulerViewDayFirst + 0; + + vspsSchedulerDateNavigatorFirst = vspsSchedulerViewDayLast + 1; + vspsSchedulerDateNavigatorContent = vspsSchedulerDateNavigatorFirst + 0; + vspsSchedulerDateNavigatorHeader = vspsSchedulerDateNavigatorFirst + 1; + vspsSchedulerDateNavigatorLast = vspsSchedulerDateNavigatorFirst + 1; + + vspsSchedulerNativeFirst = vspsSchedulerDateNavigatorLast + 1; + vspsSchedulerSchedulerHeader = vspsSchedulerNativeFirst + 0; + vspsSchedulerNotesAreaBlank = vspsSchedulerNativeFirst + 1; + vspsSchedulerNotesAreaLined = vspsSchedulerNativeFirst + 2; + vspsSchedulerTaskPad = vspsSchedulerNativeFirst + 3; + vspsSchedulerNativeLast = vspsSchedulerNativeFirst + 3; + + vspsSchedulerLast = vspsSchedulerNativeLast; + + // custom draw ID's + cdidSchedulerFirst = 1; + cdidSchedulerSchedulerHeader = cdidSchedulerFirst + 0; + cdidSchedulerDateNavigatorHeader = cdidSchedulerFirst + 1; + cdidSchedulerDateNavigatorDay = cdidSchedulerFirst + 2; + cdidSchedulerDateNavigatorDayCaption = cdidSchedulerFirst + 3; + cdidSchedulerDateNavigatorWeekNumber = cdidSchedulerFirst + 4; + cdidSchedulerTimeRuler = cdidSchedulerFirst + 5; + cdidSchedulerNotesArea = cdidSchedulerFirst + 6; + cdidSchedulerTaskPad = cdidSchedulerFirst + 7; + cdidSchedulerContent = cdidSchedulerFirst + 8; + cdidSchedulerHeader = cdidSchedulerFirst + 9; + // keep order + cdidSchedulerEventCaption = cdidSchedulerFirst + 10; + cdidSchedulerEventStart = cdidSchedulerFirst + 11; + cdidSchedulerEventFinish = cdidSchedulerFirst + 12; + cdidSchedulerEventIcons = cdidSchedulerFirst + 13; + cdidSchedulerEventMessage = cdidSchedulerFirst + 14; + cdidSchedulerEventTimeLine = cdidSchedulerFirst + 15; + + InterAreaSpace = 5; + NotesAreaWidth = 1 / 3; + SchedulerHeaderMinHeight = 1 / 10; + SchedulerHeaderMaxHeight = 1 / 4; + SchedulerHeaderSmallHeight = 1 / 18; + +type + TcxSchedulerReportItemsType = (srSchedulingArea, srHeader, srDateNavigator, + srNotesBlank, srNotesLined, srTaskPad, srUnknownItem); + TcxSchedulerReportEventPartType = (epCaption, epStart, epFinish, epIcons, + epMessage, epTimeLine); + + TcxfmSchedulerReportLinkDesignWindow = class; + + TcxSchedulerReportLink = class; + TcxCustomSchedulerReportLinkPrintStyle = class; + TcxCustomSchedulerReportLinkPrintStyleClass = class of TcxCustomSchedulerReportLinkPrintStyle; + + TcxSchedulerReportLinkPrintStyles = class; + TcxSchedulerReportPageItemCell = class; + TcxSchedulerReportPageSite = class; + TcxSchedulerReportSchedulingAreaCell = class; + TcxSchedulerReportSchedulerHeaderCell = class; + TcxSchedulerReportDateNavigatorCell = class; + TcxSchedulerReportNotesAreaCell = class; + TcxSchedulerReportTaskPadCell = class; + + TcxSchedulerReportCustomCell = class; + TcxSchedulerReportCustomCellClass = class of TcxSchedulerReportCustomCell; + TcxSchedulerReportCommonCellsProducer = class; + + // for options + TcxCustomSchedulerReportLinkOptions = class; + TcxSchedulerReportDateNavigatorHeader = class; + TcxSchedulerReportDateNavigatorDay = class; + TcxSchedulerReportDateNavigatorDayCaption = class; + TcxSchedulerReportDateNavigatorWeekNumber = class; + TcxSchedulerReportDailyTimeRulerCell = class; + TcxSchedulerReportContentCell = class; + TcxSchedulerReportCustomEventCell = class; + TcxSchedulerReportSchedulerHeaderDataCell = class; + TcxSchedulerReportNotesDataCell = class; + TcxSchedulerReportHeaderItemCell = class; + TcxSchedulerReportDetailsEventCell = class; + TcxSchedulerReportDetailsEventCellClass = class of TcxSchedulerReportDetailsEventCell; + + TcxSchedulerReportTimeLineLayoutBuilder = class; + + + { TcxCustomSchedulerReportLinkOptions } + + TcxCustomSchedulerReportLinkOptions = class(TdxCustomReportLinkOptions) + private + function GetReportLink: TcxSchedulerReportLink; + function GetScheduler: TcxScheduler; + public + property ReportLink: TcxSchedulerReportLink read GetReportLink; + property Scheduler: TcxScheduler read GetScheduler; + end; + + { TcxSchedulerReportLinkPrintRange } + + TcxSchedulerReportLinkPrintRange = class(TcxCustomSchedulerReportLinkOptions) + private + FDatePrint: array[0..1] of TDate; + FTimePrint: array[0..1] of TTime; + function GetActiveStyle: TcxCustomSchedulerReportLinkPrintStyle; + function GetDayCount: Integer; + function GetMonthCount: Integer; + function GetPrintDate(AIndex: Integer): TDate; + function GetPrintTime(AIndex: Integer): TTime; + function GetWeekCount: Integer; + function GetYearCount: Integer; + procedure SetPrintDate(AIndex: Integer; const Value: TDate); + procedure SetPrintTime(AIndex: Integer; const Value: TTime); + + function IsDateStored(AIndex: Integer): Boolean; + function IsTimeStored(AIndex: Integer): Boolean; + protected + procedure CheckTimeRange; virtual; + function GetDateTimeIF(const AValue, ADefaultValue: TDateTime): TDateTime; + + function DesignerTabIndex: Integer; override; + property ActiveStyle: TcxCustomSchedulerReportLinkPrintStyle read GetActiveStyle; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + + function DefaultDatePrintFrom: TDate; virtual; + function DefaultDatePrintTo: TDate; virtual; + function DefaultTimePrintFrom: TTime; virtual; + function DefaultTimePrintTo: TTime; virtual; + + property DayCount: Integer read GetDayCount; + property MonthCount: Integer read GetMonthCount; + property WeekCount: Integer read GetWeekCount; + property YearCount: Integer read GetYearCount; + published + property PrintFrom: TDate index 0 read GetPrintDate write SetPrintDate stored IsDateStored; + property PrintTo: TDate index 1 read GetPrintDate write SetPrintDate stored IsDateStored; + property TimePrintFrom: TTime index 0 read GetPrintTime write SetPrintTime stored IsTimeStored; + property TimePrintTo: TTime index 1 read GetPrintTime write SetPrintTime stored IsTimeStored; + end; + + { TcxSchedulerReportLinkOptionsFormatting } + + TcxSchedulerReportLinkOptionsFormatting = class(TdxCustomReportLinkOptionsFormatting) + private + FSuppressContentColoration: Boolean; + function GetReportLink: TcxSchedulerReportLink; + procedure SetSuppressContentColoration(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + + property ReportLink: TcxSchedulerReportLink read GetReportLink; + published + property SuppressContentColoration: Boolean read FSuppressContentColoration write SetSuppressContentColoration default False; + property UseLookAndFeelColors; + end; + + { TcxSchedulerReportLinkStyles } + + TcxSchedulerReportLinkStyles = class(TdxCustomReportLinkStyles, IcxSchedulerStylesAdapter, IcxSchedulerTimeRulerParams) + private + function GetExtStyles: TcxSchedulerStyles; + function GetReportLink: TcxSchedulerReportLink; + function GetUseSchedulerStyles: Boolean; + protected + FReportLink: TcxSchedulerReportLink; + function DesignerTabIndex: Integer; override; + + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + class function GetStyleCaption(AnIndex: Integer): string; override; + function GetStyleIndexByCaption(const Caption: string): Integer; override; + + // IcxSchedulerStylesAdapter + function GetDayHeaderStyle: TcxStyle; + function GetResourceHeaderStyle: TcxStyle; + + property ExtStyles: TcxSchedulerStyles read GetExtStyles; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + + function GetSchedulerHeaderParams: TcxViewParams; virtual; + function GetContentParams(const ADateTime: TDateTime; + AResource: TcxSchedulerStorageResourceItem): TcxViewParams; overload; virtual; + function GetContentParams(const ADateTime: TDateTime; ALightColor: Boolean; + AResource: TcxSchedulerStorageResourceItem): TcxViewParams; overload; virtual; + function GetDateNavigatorContentParams: TcxViewParams; virtual; + function GetDateNavigatorHeaderParams: TcxViewParams; virtual; + function GetDayHeaderParams(const ADateTime: TDateTime): TcxViewParams; virtual; + function GetEventParams(AEvent: TcxSchedulerEvent): TcxViewParams; virtual; + function GetNotesAreaBlankParams: TcxViewParams; virtual; + function GetNotesAreaLinedParams: TcxViewParams; virtual; + function GetResourceHeaderParams(AResource: TcxSchedulerStorageResourceItem): TcxViewParams; virtual; + function GetTaskPadParams: TcxViewParams; virtual; + function GetTimeRulerParams: TcxViewParams; virtual; + + property UseSchedulerStyles: Boolean read GetUseSchedulerStyles; + property ReportLink: TcxSchedulerReportLink read GetReportLink; + published + property SchedulerHeader: TcxStyle Index vspsSchedulerSchedulerHeader read GetValue write SetValue; + property Content: TcxStyle Index vspsSchedulerContent read GetValue write SetValue; + property DateNavigatorContent: TcxStyle Index vspsSchedulerDateNavigatorContent read GetValue write SetValue; + property DateNavigatorHeader: TcxStyle Index vspsSchedulerDateNavigatorHeader read GetValue write SetValue; + property DayHeader: TcxStyle Index vspsSchedulerDayHeader read GetValue write SetValue; + property Event: TcxStyle Index vspsSchedulerEvent read GetValue write SetValue; + property ResourceHeader: TcxStyle Index vspsSchedulerResourceHeader read GetValue write SetValue; + property NotesAreaBlank: TcxStyle Index vspsSchedulerNotesAreaBlank read GetValue write SetValue; + property NotesAreaLined: TcxStyle Index vspsSchedulerNotesAreaLined read GetValue write SetValue; + property TaskPad: TcxStyle Index vspsSchedulerTaskPad read GetValue write SetValue; + property TimeRuler: TcxStyle Index vspsSchedulerTimeRuler read GetValue write SetValue; + property StyleSheet; + end; + + TcxSchedulerReportLinkStyleSheet = class(TdxCustomReportLinkStyleSheet) + private + function GetStylesValue: TcxSchedulerReportLinkStyles; + procedure SetStylesValue(Value: TcxSchedulerReportLinkStyles); + public + class function GetStylesClass: TcxCustomStylesClass; override; + published + property Styles: TcxSchedulerReportLinkStyles read GetStylesValue write SetStylesValue; + end; + + { TcxSchedulerReportLinkRenderInfo } + + TcxSchedulerReportLinkRenderInfo = class(TdxPSReportRenderInfo) + private + function GetReportLink: TcxSchedulerReportLink; + protected + Rendering: Boolean; + FPageColCount: Integer; + FPageRowCount: Integer; + procedure DoCalculate; override; + function GetPageColCount: Integer; override; + function GetPageRowCount: Integer; override; + function IsLoading: Boolean; + public + function IsDrawPageTitleOnPage(APageIndex: Integer): Boolean; override; + function IsDrawReportTitleOnPage(APageIndex: Integer): Boolean; + property ReportLink: TcxSchedulerReportLink read GetReportLink; + end; + + { TcxSchedulerReportRenderer } + + TcxSchedulerReportRenderer = class(TdxPSReportRenderer) + public + procedure PrepareRenderPage; override; + procedure UnprepareRenderPage; override; + end; + + { TcxSchedulerReportLink } + TcxSchedulerReportLinkCanPrintEventEvent = procedure(Sender: TcxSchedulerReportLink; + AEvent: TcxSchedulerEvent; var AllowPrint: Boolean) of object; + + { Initilization Events } + + TcxSchedulerReportLinkInitializeSchedulerHeaderEvent = procedure( + Sender: TcxSchedulerReportLink; AItem: TcxSchedulerReportSchedulerHeaderCell) of object; + TcxSchedulerReportLinkInitializeSchedulingAreaEvent = procedure( + Sender: TcxSchedulerReportLink; AItem: TcxSchedulerReportSchedulingAreaCell) of object; + TcxSchedulerReportLinkInitializeNotesEvent = procedure( + Sender: TcxSchedulerReportLink; AItem: TcxSchedulerReportNotesAreaCell) of object; + TcxSchedulerReportLinkInitializeTaskPadEvent = procedure( + Sender: TcxSchedulerReportLink; AItem: TcxSchedulerReportTaskPadCell) of object; + TcxSchedulerReportLinkInitializeEventCellEvent = procedure( + Sender: TcxSchedulerReportLink; AItem: TcxSchedulerReportCustomEventCell) of object; + + { CustomDraw Events } + + TcxSchedulerReportLinkCustomDrawSchedulerHeaderCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportSchedulerHeaderDataCell; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawDateNavigatorHeaderCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorHeader; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawDateNavigatorDayCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorDay; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawDateNavigatorDayCaptionCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorDayCaption; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawDateNavigatorWeekNumberCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorWeekNumber; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawTimeRulerCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportDailyTimeRulerCell; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawNotesCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportNotesDataCell; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawContentCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportContentCell; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawHeaderCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportHeaderItemCell; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawEventPartCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TAbstractdxReportCellData; + APart: TcxSchedulerReportEventPartType; var ADone: Boolean) of object; + + TcxSchedulerReportLink = class(TdxCustomcxControlReportLink, IdxReportLinkController) + private + FLinkInPreviewMode: Boolean; + FLookAndFeelItems: TList; + FPageSites: TList; + FPrintRange: TcxSchedulerReportLinkPrintRange; + FPrintStyles: TcxSchedulerReportLinkPrintStyles; + FTaskPadReportLink: TBasedxReportLink; + FSupportImages: Boolean; + FOnActivePrintStyleChanged: TNotifyEvent; + FOnCanPrintEvent: TcxSchedulerReportLinkCanPrintEventEvent; + + FOnCustomDrawSchedulerHeaderCell: TcxSchedulerReportLinkCustomDrawSchedulerHeaderCellEvent; + FOnCustomDrawDateNavigatorHeaderCell: TcxSchedulerReportLinkCustomDrawDateNavigatorHeaderCellEvent; + FOnCustomDrawDateNavigatorDayCell: TcxSchedulerReportLinkCustomDrawDateNavigatorDayCellEvent; + FOnCustomDrawDateNavigatorDayCaptionCell: TcxSchedulerReportLinkCustomDrawDateNavigatorDayCaptionCellEvent; + FOnCustomDrawDateNavigatorWeekNumberCell: TcxSchedulerReportLinkCustomDrawDateNavigatorWeekNumberCellEvent; + FOnCustomDrawTimeRulerCell: TcxSchedulerReportLinkCustomDrawTimeRulerCellEvent; + FOnCustomDrawContentCell: TcxSchedulerReportLinkCustomDrawContentCellEvent; + FOnCustomDrawHeaderCell: TcxSchedulerReportLinkCustomDrawHeaderCellEvent; + FOnCustomDrawEventPartCell: TcxSchedulerReportLinkCustomDrawEventPartCellEvent; + FOnCustomDrawNotesCell: TcxSchedulerReportLinkCustomDrawNotesCellEvent; + FOnCustomDrawTaskPadCell: TcxSchedulerReportLinkCustomDrawNotesCellEvent; + + FOnInitializeSchedulingAreaCell: TcxSchedulerReportLinkInitializeSchedulingAreaEvent; + FOnInitializeEventCell: TcxSchedulerReportLinkInitializeEventCellEvent; + FOnInitializeHeaderPrimaryCell: TcxSchedulerReportLinkInitializeSchedulerHeaderEvent; + FOnInitializeHeaderSecondaryCell: TcxSchedulerReportLinkInitializeSchedulerHeaderEvent; + FOnInitializeNotesAreaCell: TcxSchedulerReportLinkInitializeNotesEvent; + FOnInitializeTaskPadCell: TcxSchedulerReportLinkInitializeTaskPadEvent; + function GetActiveStyles: TcxSchedulerReportLinkStyles; + function GetDesignWindow: TcxfmSchedulerReportLinkDesignWindow; + function GetEdgeMode: TdxCellEdgeMode; + function GetLookAndFeelItem(Index: Integer): TdxReportVisualItem; + function GetLookAndFeelItemCount: Integer; + function GetOptionsFormatting: TcxSchedulerReportLinkOptionsFormatting; + function GetPrintStyles: TcxSchedulerReportLinkPrintStyles; + function GetRenderInfo: TcxSchedulerReportLinkRenderInfo; + function GetScheduler: TcxScheduler; + function GetStyles: TcxSchedulerReportLinkStyles; + procedure SetOptionsFormatting(Value: TcxSchedulerReportLinkOptionsFormatting); + procedure SetPrintRange(Value: TcxSchedulerReportLinkPrintRange); + procedure SetPrintStyles(Value: TcxSchedulerReportLinkPrintStyles); + procedure SetStyles(Value: TcxSchedulerReportLinkStyles); + procedure SetTaskPadReportLink(Value: TBasedxReportLink); + + protected + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + { IdxReportLinkController } + function GetControlSiteBounds(AControl: TControl): TRect; virtual; + + procedure ConstructReport(AReportCells: TdxReportCells); override; + procedure DoCreateReport; override; + + procedure CustomDraw(AItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); override; + + procedure DoCanPrintEvent(AEvent: TcxSchedulerEvent; var AllowPrint: Boolean); virtual; + + procedure DoCustomDrawSchedulerHeaderCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportSchedulerHeaderDataCell; var ADone: Boolean); virtual; + procedure DoCustomDrawDateNavigatorHeaderCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportDateNavigatorHeader; var ADone: Boolean); virtual; + procedure DoCustomDrawDateNavigatorDayCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportDateNavigatorDay; var ADone: Boolean); virtual; + procedure DoCustomDrawDateNavigatorDayCaptionCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportDateNavigatorDayCaption; var ADone: Boolean); virtual; + procedure DoCustomDrawDateNavigatorWeekNumberCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportDateNavigatorWeekNumber; var ADone: Boolean); virtual; + procedure DoCustomDrawTimeRulerCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportDailyTimeRulerCell; var ADone: Boolean); virtual; + procedure DoCustomDrawContentCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportContentCell; var ADone: Boolean); virtual; + procedure DoCustomDrawHeaderCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportHeaderItemCell; var ADone: Boolean); virtual; + procedure DoCustomDrawEventPartCell(ACanvas: TCanvas; + AItem: TAbstractdxReportCellData; var ADone: Boolean); virtual; + procedure DoCustomDrawNotesCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportNotesDataCell; var ADone: Boolean); virtual; + procedure DoCustomDrawTaskPadCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportNotesDataCell; var ADone: Boolean); virtual; + + procedure GetImageLists(AProc: TdxPSGetImageListProc); override; + function GetRealScaleFactor: Integer; override; + function GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; override; + function GetRendererClass: TdxPSReportRendererClass; override; + function GetRenderInfoClass: TdxPSReportRenderInfoClass; override; + procedure InternalRestoreDefaults; override; + procedure PrepareConstruct; override; + procedure UnprepareConstruct; override; + + procedure CreateOptions; override; + procedure DestroyOptions; override; + function GetOptionsFormattingClass: TdxCustomReportLinkOptionsFormattingClass; override; + + function CreatePrintRange: TcxSchedulerReportLinkPrintRange; virtual; + function CreatePrintStyles: TcxSchedulerReportLinkPrintStyles; virtual; + function HasEventImages: Boolean; + function HasResourceImages: Boolean; + + function GetAreNativeStylesAvailable: Boolean; override; + function GetStylesClass: TdxCustomReportLinkStylesClass; override; + function GetStyleSheetClass: TdxCustomReportLinkStyleSheetClass; override; + function GetStyleSheetPrototype: TdxCustomReportLinkStyleSheet; override; + + procedure ActivePrintStyleChanged; virtual; + procedure DoActivePrintStyleChanged; virtual; + + procedure FormatLookAndFeelItems; + procedure RegisterLookAndFeelItem(AItem: TdxReportVisualItem; AEdgeStyle: TdxCellEdgeStyle); + + procedure DoInitializeSchedulingAreaCell(AItem: TcxSchedulerReportSchedulingAreaCell); virtual; + procedure DoInitializeEventCell(AItem: TcxSchedulerReportCustomEventCell); virtual; + procedure DoInitializeHeaderPrimaryCell(AItem: TcxSchedulerReportSchedulerHeaderCell); virtual; + procedure DoInitializeHeaderSecondaryCell(AItem: TcxSchedulerReportSchedulerHeaderCell); virtual; + procedure DoInitializeNotesAreaCell(AItem: TcxSchedulerReportNotesAreaCell); virtual; + procedure DoInitializeTaskPadCell(AItem: TcxSchedulerReportTaskPadCell); virtual; + + procedure AssignTaskPadData(ATaskPad: TcxSchedulerReportTaskPadCell); + procedure InitializeTaskPadCell(ATaskPad: TcxSchedulerReportTaskPadCell); virtual; + + procedure SetCellViewParams(ACell: TdxReportVisualItem; const AParams: TcxViewParams); overload; + procedure SetCellViewParams(ACell: TdxReportVisualItem; const AParams: TdxReportItemViewParams); overload; + + function AddPageSite(const ABounds: TRect): TcxSchedulerReportPageSite; + procedure BuildStyle; virtual; + + property ActiveStyles: TcxSchedulerReportLinkStyles read GetActiveStyles; + + property EdgeMode: TdxCellEdgeMode read GetEdgeMode; + property LinkInPreviewMode: Boolean read FLinkInPreviewMode write FLinkInPreviewMode; + property LookAndFeelItemCount: Integer read GetLookAndFeelItemCount; + property LookAndFeelItems[Index: Integer]: TdxReportVisualItem read GetLookAndFeelItem; + property PageSites: TList read FPageSites; + property RenderInfo: TcxSchedulerReportLinkRenderInfo read GetRenderInfo; + property SupportImages: Boolean read FSupportImages; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + class function Aggregable: Boolean; override; + procedure LoadDataFromStream(AStream: TStream); override; + procedure RebuildReport; override; + + property DesignWindow: TcxfmSchedulerReportLinkDesignWindow read GetDesignWindow; + property Scheduler: TcxScheduler read GetScheduler; + + published + property Color; + property Font; + + property OptionsFormatting: TcxSchedulerReportLinkOptionsFormatting read GetOptionsFormatting write SetOptionsFormatting; + property PrintRange: TcxSchedulerReportLinkPrintRange read FPrintRange write SetPrintRange; + property PrintStyles: TcxSchedulerReportLinkPrintStyles read GetPrintStyles write SetPrintStyles; + property ScaleFonts; + property StyleRepository; + property Styles: TcxSchedulerReportLinkStyles read GetStyles write SetStyles; + property SupportedCustomDraw; + property TaskPadReportLink: TBasedxReportLink read FTaskPadReportLink write SetTaskPadReportLink; + + property OnActivePrintStyleChanged: TNotifyEvent read FOnActivePrintStyleChanged write FOnActivePrintStyleChanged; + property OnCanPrintEvent: TcxSchedulerReportLinkCanPrintEventEvent read FOnCanPrintEvent write FOnCanPrintEvent; + + property OnCustomDrawSchedulerHeaderCell: TcxSchedulerReportLinkCustomDrawSchedulerHeaderCellEvent + read FOnCustomDrawSchedulerHeaderCell write FOnCustomDrawSchedulerHeaderCell; + property OnCustomDrawDateNavigatorHeaderCell: TcxSchedulerReportLinkCustomDrawDateNavigatorHeaderCellEvent + read FOnCustomDrawDateNavigatorHeaderCell write FOnCustomDrawDateNavigatorHeaderCell; + property OnCustomDrawDateNavigatorDayCell: TcxSchedulerReportLinkCustomDrawDateNavigatorDayCellEvent + read FOnCustomDrawDateNavigatorDayCell write FOnCustomDrawDateNavigatorDayCell; + property OnCustomDrawDateNavigatorDayCaptionCell: TcxSchedulerReportLinkCustomDrawDateNavigatorDayCaptionCellEvent + read FOnCustomDrawDateNavigatorDayCaptionCell write FOnCustomDrawDateNavigatorDayCaptionCell; + property OnCustomDrawDateNavigatorWeekNumberCell: TcxSchedulerReportLinkCustomDrawDateNavigatorWeekNumberCellEvent + read FOnCustomDrawDateNavigatorWeekNumberCell write FOnCustomDrawDateNavigatorWeekNumberCell; + property OnCustomDrawTimeRulerCell: TcxSchedulerReportLinkCustomDrawTimeRulerCellEvent + read FOnCustomDrawTimeRulerCell write FOnCustomDrawTimeRulerCell; + property OnCustomDrawContentCell: TcxSchedulerReportLinkCustomDrawContentCellEvent + read FOnCustomDrawContentCell write FOnCustomDrawContentCell; + property OnCustomDrawHeaderCell: TcxSchedulerReportLinkCustomDrawHeaderCellEvent + read FOnCustomDrawHeaderCell write FOnCustomDrawHeaderCell; + property OnCustomDrawEventPartCell: TcxSchedulerReportLinkCustomDrawEventPartCellEvent + read FOnCustomDrawEventPartCell write FOnCustomDrawEventPartCell; + property OnCustomDrawNotesCell: TcxSchedulerReportLinkCustomDrawNotesCellEvent + read FOnCustomDrawNotesCell write FOnCustomDrawNotesCell; + property OnCustomDrawTaskPadCell: TcxSchedulerReportLinkCustomDrawNotesCellEvent + read FOnCustomDrawTaskPadCell write FOnCustomDrawTaskPadCell; + + property OnInitializeSchedulingAreaCell: TcxSchedulerReportLinkInitializeSchedulingAreaEvent + read FOnInitializeSchedulingAreaCell write FOnInitializeSchedulingAreaCell; + property OnInitializeEventCell: TcxSchedulerReportLinkInitializeEventCellEvent + read FOnInitializeEventCell write FOnInitializeEventCell; + property OnInitializeHeaderPrimaryCell: TcxSchedulerReportLinkInitializeSchedulerHeaderEvent + read FOnInitializeHeaderPrimaryCell write FOnInitializeHeaderPrimaryCell; + property OnInitializeHeaderSecondaryCell: TcxSchedulerReportLinkInitializeSchedulerHeaderEvent + read FOnInitializeHeaderSecondaryCell write FOnInitializeHeaderSecondaryCell; + property OnInitializeNotesAreaCell: TcxSchedulerReportLinkInitializeNotesEvent + read FOnInitializeNotesAreaCell write FOnInitializeNotesAreaCell; + property OnInitializeTaskPadCell: TcxSchedulerReportLinkInitializeTaskPadEvent + read FOnInitializeTaskPadCell write FOnInitializeTaskPadCell; + end; + + { TcxCustomSchedulerReportLinkPrintStyle } + + TcxSchedulerReportLinkPeriodicPrintStyleLayout = (pslOnePage, pslTwoPages); + + TcxCustomSchedulerReportLinkPrintStyle = class(TPersistent, + IUnknown, IdxPSCellParams, IdxPSCellParams2) + private + FBoldedDays: TcxSchedulerDateList; + FCaption: string; + FCompressWeekends: Boolean; + FDontPrintWeekends: Boolean; + FEvents: TcxSchedulerCachedEventList; + FLayout: TcxSchedulerReportLinkPeriodicPrintStyleLayout; + FPagesPerPeriod: Integer; + FResourceCountPerPage: Integer; + FShowNotesAreaBlank: Boolean; + FShowNotesAreaLined: Boolean; + FShowTaskPad: Boolean; + FStyles: TcxSchedulerReportLinkPrintStyles; + FUsedDays: TcxSchedulerDateList; + FShowEventImages: Boolean; + FShowResourceImages: Boolean; + function GetActive: Boolean; + function GetHasAdditionalArea: Boolean; + function GetIndex: Integer; + function GetPageSite(AIndex: Integer): TcxSchedulerReportPageSite; + function GetPeriodCount: Integer; + function GetPrintRange: TcxSchedulerReportLinkPrintRange; + function GetReportLink: TcxSchedulerReportLink; + function GetResourceCount: Integer; + function GetScheduler: TcxScheduler; + function GetStorage: TcxCustomSchedulerStorage; + function GetTimePrintFrom: TTime; + function GetTimePrintTo: TTime; + function GetVisualStyles: TcxSchedulerReportLinkStyles; + function IsCaptionStored: Boolean; + function IsLayoutStored: Boolean; + function IsShowNotesAreaBlankStored: Boolean; + function IsActiveStored: Boolean; + procedure SetActive(Value: Boolean); + procedure SetCaption(const Value: string); + procedure SetCompressWeekends(Value: Boolean); + procedure SetDontPrintWeekends(Value: Boolean); + procedure SetLayout(Value: TcxSchedulerReportLinkPeriodicPrintStyleLayout); + procedure SetResourceCountPerPage(Value: Integer); + procedure SetShowEventImages(Value: Boolean); + procedure SetShowNotesAreaBlank(Value: Boolean); + procedure SetShowNotesAreaLined(Value: Boolean); + procedure SetShowResourceImages(Value: Boolean); + procedure SetShowTaskPad(Value: Boolean); + procedure SetTimePrintFrom(Value: TTime); + procedure SetTimePrintTo(Value: TTime); + protected + CurrentDate: TDateTime; + { IUnknown } + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + { IdxReportLinkController } + function GetControlSiteBounds(AControl: TControl): TRect; virtual; + { IdxPSCellParams } + function IdxPSCellParams.GetAutoHeight = IdxPSCellParams_GetAutoHeight; + function IdxPSCellParams.GetDC = IdxPSCellParams_GetDC; + function IdxPSCellParams.GetDisplayGraphicsAsText = IdxPSCellParams_GetDisplayGraphicsAsText; + function IdxPSCellParams.GetEndEllipsis = IdxPSCellParams_GetEndEllipsis; + function IdxPSCellParams.GetFlatCheckMarks = IdxPSCellParams_GetFlatCheckMarks; + function IdxPSCellParams.GetGraphicsText = IdxPSCellParams_GetGraphicsText; + function IdxPSCellParams.GetMultiline = IdxPSCellParams_GetMultiline; + function IdxPSCellParams.GetTransparentGraphics = IdxPSCellParams_GetTransparentGraphics; + function IdxPSCellParams_GetAutoHeight: Boolean; virtual; + function IdxPSCellParams_GetDC: HDC; virtual; + function IdxPSCellParams_GetDisplayGraphicsAsText: Boolean; virtual; + function IdxPSCellParams_GetEndEllipsis: Boolean; virtual; + function IdxPSCellParams_GetFlatCheckMarks: Boolean; virtual; + function IdxPSCellParams_GetGraphicsText: string; virtual; + function IdxPSCellParams_GetMultiline: Boolean; virtual; + function IdxPSCellParams_GetTransparentGraphics: Boolean; virtual; + { IdxPSCellParams2 } + function IdxPSCellParams2.GetPreviewMarginLeft = IdxPSCellParams2_GetPreviewMarginLeft; + function IdxPSCellParams2.GetPreviewMarginRight = IdxPSCellParams2_GetPreviewMarginRight; + function IdxPSCellParams2.GetPreviewMaxHeight = IdxPSCellParams2_GetPreviewMaxHeight; + function IdxPSCellParams2.GetPreviewMaxLineCount = IdxPSCellParams2_GetPreviewMaxLineCount; + function IdxPSCellParams2.GetRichEditGraphicClass = IdxPSCellParams2_GetRichEditGraphicClass; + function IdxPSCellParams2.GetRichEditTransparent = IdxPSCellParams2_GetRichEditTransparent; + function IdxPSCellParams2_GetPreviewMarginLeft: Integer; virtual; + function IdxPSCellParams2_GetPreviewMarginRight: Integer; virtual; + function IdxPSCellParams2_GetPreviewMaxHeight: Integer; virtual; + function IdxPSCellParams2_GetPreviewMaxLineCount: Integer; virtual; + function IdxPSCellParams2_GetRichEditGraphicClass: TGraphicClass; virtual; + function IdxPSCellParams2_GetRichEditTransparent: Boolean; virtual; + // + procedure ActiveStyleChanged; virtual; + function AddPageSite(const ABounds: TRect): TcxSchedulerReportPageSite; virtual; + + procedure AfterBuild; virtual; + procedure BeforeBuild; virtual; + procedure Build; virtual; + procedure BuildPages; virtual; + procedure BuildSchedulerCells(ASite: TcxSchedulerReportSchedulingAreaCell); virtual; + procedure Progress(APercentDone: Double); virtual; + + procedure PrepareEvents; virtual; + procedure DoCanPrintEvent(AEvent: TcxSchedulerEvent; var AllowPrint: Boolean); virtual; + + procedure Changed; virtual; + procedure CreateObjects; virtual; + procedure DestroyObjects; virtual; + function GetPageCount: Integer; virtual; + + function GetRebuildOnPageParamsChange(AnUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; virtual; + + function CheckPrintRangeDate(const ADate: TDateTime; AIndex: Integer): TDateTime; virtual; + function CheckPrintRangeTime(const ATime: TDateTime; AIndex: Integer): TDateTime; virtual; + function GetActualDatePrintFrom: TDate; virtual; + function GetActualDatePrintTo: TDate; virtual; + function GetCorrespondedView: TcxSchedulerCustomResourceView; virtual; + function GetPagesPerPeriod: Integer; virtual; + + function GetGlyphIndex: Integer; virtual; + function GetPreviewGlyphIndex: Integer; virtual; + function GetSchedulerHeaderParams: TdxReportItemViewParams; virtual; + + procedure DrawDesignWindowPreview(ACanvas: TCanvas; const ABounds: TRect); + // actually option state + function GetResourcePageCount: Integer; virtual; + function GetShowDateNavigator(APageIndex: Integer): Boolean; virtual; + function GetShowNotesAreaBlank: Boolean; virtual; + + procedure SetBoolOption(var AOption: Boolean; Value: Boolean); + function SupportTimeRange: Boolean; virtual; + function SupportMessage: Boolean; virtual; + + // report cells creation + function CreateDateNavigatorCell(ASite: TdxReportCell; AYear, AMonth: Word): TcxSchedulerReportDateNavigatorCell; virtual; + function CreateHeaderCell(ASite: TdxReportCell): TcxSchedulerReportSchedulerHeaderCell; virtual; + function CreateNotesCell(ASite: TdxReportCell): TcxSchedulerReportNotesAreaCell; virtual; + function CreateNotesLinedCell(ASite: TdxReportCell): TcxSchedulerReportNotesAreaCell; virtual; + function CreateSchedulingAreaCell(ASite: TdxReportCell): TcxSchedulerReportSchedulingAreaCell; virtual; + function CreateSchedulingCellsProducer(ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; virtual; + function CreateTaskPadCell(ASite: TdxReportCell): TcxSchedulerReportTaskPadCell; virtual; + + procedure InitHeaderCell(ACell: TcxSchedulerReportSchedulerHeaderCell); virtual; + function InitReportCell(ACell: TdxReportCell; const ABounds: TRect): TdxReportCell; + + procedure CorrectBoundsWithHeader(AHeader: TcxSchedulerReportSchedulerHeaderCell; var ABounds: TRect); + procedure CreateAdditionalControls(ASite: TdxReportCell; AHasCalendar, + AHasTaskPad, AHasNotes, AHasNotesLined, ARightSide: Boolean; var ABounds: TRect); virtual; + + procedure CreateControlsOnFirstPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); virtual; + procedure CreateControlsOnSecondPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); virtual; + procedure CreateHeaderDateNavigator(AHeader: TcxSchedulerReportSchedulerHeaderCell; APageIndex: Integer; out ABounds: TRect); virtual; + procedure CreateLayoutForPeriod(APeriodIndex: Integer); virtual; + procedure CreatePageSiteWithHeader(APageIndex: Integer; + out ASite: TcxSchedulerReportPageSite; out AHeader: TcxSchedulerReportSchedulerHeaderCell; + out ABounds: TRect; AIsPrimary: Boolean = True); + // items visibility + function CanSplitSchedulingOnTwoPages: Boolean; virtual; + function GetHasPageHeader(APageIndex: Integer): Boolean; virtual; + function GetHasPageReportTitle(APageIndex: Integer): Boolean; virtual; + function GetPageHeaderHeight(const ASiteBounds: TRect; APageIndex: Integer): Integer; + function GetPageIndex(APeriodIndex, AIndex: Integer): Integer; + procedure GetPagePeriodAndIndex(APageIndex: Integer; var APeriodIndex, ASubIndex: Integer); + function GetPageSiteBounds(APageIndex: Integer): TRect; virtual; + function GetStartOfWeekOffset: Integer; virtual; + // extracting events and dates for period + procedure GetPageDateNavigatorInfo( + APageIndex: Integer; out AYear, AMonth: Word); virtual; + function GetDaysPerPeriod: Integer; virtual; + procedure FillDatesForPage(ADateList: TcxSchedulerDateList; + APageIndex, APeriodIndex, ASubIndex: Integer); virtual; + + property CompressWeekends: Boolean read FCompressWeekends write SetCompressWeekends default True; + property DontPrintWeekends: Boolean read FDontPrintWeekends write SetDontPrintWeekends default False; + property Events: TcxSchedulerCachedEventList read FEvents; + property GlyphIndex: Integer read GetGlyphIndex; + property Layout: TcxSchedulerReportLinkPeriodicPrintStyleLayout read FLayout write SetLayout stored IsLayoutStored; + property PagesPerPeriod: Integer read FPagesPerPeriod; + property PageSites[Index: Integer]: TcxSchedulerReportPageSite read GetPageSite; + property PreviewGlyphIndex: Integer read GetPreviewGlyphIndex; + property PrintRange: TcxSchedulerReportLinkPrintRange read GetPrintRange; + property ResourceCount: Integer read GetResourceCount; + property ResourceCountPerPage: Integer read FResourceCountPerPage write SetResourceCountPerPage default 0; + property ShowEventImages: Boolean read FShowEventImages write SetShowEventImages; + property ShowNotesAreaBlank: Boolean read GetShowNotesAreaBlank write SetShowNotesAreaBlank stored IsShowNotesAreaBlankStored; + property ShowNotesAreaLined: Boolean read FShowNotesAreaLined write SetShowNotesAreaLined default False; + property ShowResourceImages: Boolean read FShowResourceImages write SetShowResourceImages; + property ShowTaskPad: Boolean read FShowTaskPad write SetShowTaskPad default False; + property StartOfWeekOffset: Integer read GetStartOfWeekOffset; + property Storage: TcxCustomSchedulerStorage read GetStorage; + property TimePrintFrom: TTime read GetTimePrintFrom write SetTimePrintFrom stored False; + property TimePrintTo: TTime read GetTimePrintTo write SetTimePrintTo stored False; + property UsedDays: TcxSchedulerDateList read FUsedDays; + public + constructor Create(AStyles: TcxSchedulerReportLinkPrintStyles); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + function DefaultCaption: string; virtual; + function IsCompatibleWith(AView: TcxSchedulerCustomView): Boolean; virtual; + procedure RestoreDefaults; virtual; + + property ActualDatePrintFrom: TDate read GetActualDatePrintFrom; + property ActualDatePrintTo: TDate read GetActualDatePrintTo; + property CorrespondedView: TcxSchedulerCustomResourceView read GetCorrespondedView; + property HasAdditionalArea: Boolean read GetHasAdditionalArea; + property Index: Integer read GetIndex; + property PageCount: Integer read GetPageCount; + property PeriodCount: Integer read GetPeriodCount; + property ReportLink: TcxSchedulerReportLink read GetReportLink; + property Scheduler: TcxScheduler read GetScheduler; + property Styles: TcxSchedulerReportLinkPrintStyles read FStyles; + property VisualStyles: TcxSchedulerReportLinkStyles read GetVisualStyles; + published + property Active: Boolean read GetActive write SetActive stored IsActiveStored; + property Caption: string read FCaption write SetCaption stored IsCaptionStored; + end; + + { TcxSchedulerReportLinkDailyPrintStyle } + + TcxSchedulerReportLinkDailyPrintStyle = class(TcxCustomSchedulerReportLinkPrintStyle) + private + FCurrentPagePerDate: Integer; + protected + procedure BeforeBuild; override; + function CanSplitSchedulingOnTwoPages: Boolean; override; + procedure CreateControlsOnFirstPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + procedure CreateControlsOnSecondPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + function CreateSchedulingCellsProducer(ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; override; + procedure FillDatesForPage(ADateList: TcxSchedulerDateList; + APageIndex, APeriodIndex, ASubIndex: Integer); override; + function GetCorrespondedView: TcxSchedulerCustomResourceView; override; + function GetGlyphIndex: Integer; override; + function GetPageCount: Integer; override; + function GetPagesPerPeriod: Integer; override; + function GetShowNotesAreaBlank: Boolean; override; + procedure InitHeaderCell(ACell: TcxSchedulerReportSchedulerHeaderCell); override; + function SupportMessage: Boolean; override; + function SupportTimeRange: Boolean; override; + public + constructor Create(AStyles: TcxSchedulerReportLinkPrintStyles); override; + function DefaultCaption: string; override; + function IsCompatibleWith(AView: TcxSchedulerCustomView): Boolean; override; + published + property Active; + property Caption; + property Layout; + property ResourceCountPerPage; + property ShowEventImages default True; + property ShowNotesAreaBlank; + property ShowNotesAreaLined; + property ShowResourceImages default True; + property ShowTaskPad; + end; + + { TcxSchedulerReportLinkCustomDetailsPrintStyle } + + TcxSchedulerReportLinkCustomDetailsPrintStyle = class(TcxCustomSchedulerReportLinkPrintStyle) + private + FTimeWidth: Integer; + function GetPageWidth: Integer; + protected + BuildedPageCount: Integer; + CellsOnPage: Integer; + CurrentPage: TcxSchedulerReportPageSite; + function AddPageSite(const ABounds: TRect): TcxSchedulerReportPageSite; override; + procedure BeforeBuild; override; + function GetNextPage(APrevPage: TcxSchedulerReportPageSite; out ABounds: TRect): TcxSchedulerReportPageSite; + function GetPageCount: Integer; override; + function MeasureTimeWidth: Integer; virtual; + + property PageWidth: Integer read GetPageWidth; + property TimeWidth: Integer read FTimeWidth; + end; + + { TcxSchedulerReportLinkDetailsPrintStyle } + + TcxSchedulerReportLinkDetailsPrintStylePaginationMode = (dpmByDay, dpmByWeek, dpmByMonth); + + TcxSchedulerReportLinkDetailsPrintStyle = class(TcxSchedulerReportLinkCustomDetailsPrintStyle) + private + FPaginationMode: TcxSchedulerReportLinkDetailsPrintStylePaginationMode; + FUsePagination: Boolean; + procedure SetPaginationMode(Value: TcxSchedulerReportLinkDetailsPrintStylePaginationMode); + procedure SetUsePagination(Value: Boolean); + protected + EventIndex, DayIndex: Integer; + CurrentCell: TcxSchedulerReportDetailsEventCell; + CurrentPageBounds: TRect; + PreviousHeader: TcxSchedulerReportSchedulerHeaderCell; + Site: TcxSchedulerReportPageSite; + function AddDayHeader(ADate: TDateTime; AContinue: Boolean; + var ABounds: TRect): TcxSchedulerReportSchedulerHeaderCell; + procedure BeforeBuild; override; + procedure BuildPages; override; + function GetDayHeaderHeight: Integer; virtual; + function GetDayHeaderText(AContinue: Boolean): string; virtual; + function GetGlyphIndex: Integer; override; + function GetPreviewGlyphIndex: Integer; override; + function GetSchedulerHeaderParams: TdxReportItemViewParams; override; + + // layout calculation + function AddEventCell(AEvent: TcxSchedulerEvent): TcxSchedulerReportDetailsEventCell; virtual; + procedure CheckPagination; + procedure HeaderNeeded; virtual; + function NeedAddDayHeader: Boolean; + function MeasureCellBounds: TRect; virtual; + procedure PrepareNextPage; + procedure SetCellPlace; + + property DayHeaderHeight: Integer read GetDayHeaderHeight; + public + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; override; + procedure RestoreDefaults; override; + published + property Active; + property Caption; + property PaginationMode: TcxSchedulerReportLinkDetailsPrintStylePaginationMode read FPaginationMode write SetPaginationMode default dpmByDay; + property UsePagination: Boolean read FUsePagination write SetUsePagination default False; + end; + + { TcxSchedulerReportLinkMemoPrintStyle } + + TcxSchedulerReportLinkMemoPrintStyle = class(TcxSchedulerReportLinkCustomDetailsPrintStyle) + private + FSelectedEventsOnly: Boolean; + FStartEachItemOnNewPage: Boolean; + protected + Site: TdxReportCell; + function AddEventCell(AEvent: TcxSchedulerEvent): TcxSchedulerReportDetailsEventCell; virtual; + procedure BuildPages; override; + procedure DoCanPrintEvent(AEvent: TcxSchedulerEvent; var AllowPrint: Boolean); override; + function GetGlyphIndex: Integer; override; + function GetPreviewGlyphIndex: Integer; override; + function MeasureTimeWidth: Integer; override; + public + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; override; + procedure RestoreDefaults; override; + published + property Active; + property Caption; + property SelectedEventsOnly: Boolean read FSelectedEventsOnly write FSelectedEventsOnly default True; + property StartEachItemOnNewPage: Boolean read FStartEachItemOnNewPage write FStartEachItemOnNewPage default True; + end; + + { TcxSchedulerReportLinkMonthlyPrintStyle } + + TcxSchedulerReportLinkMonthlyPrintStyle = class(TcxCustomSchedulerReportLinkPrintStyle) + private + FPrintExactlyOneMonthPerPage: Boolean; + procedure SetPrintExactlyOneMonthPerPage(Value: Boolean); + protected + procedure CreateControlsOnFirstPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + procedure CreateControlsOnSecondPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + procedure FillDatesForPage(ADateList: TcxSchedulerDateList; + APageIndex, APeriodIndex, ASubIndex: Integer); override; + function GetCorrespondedView: TcxSchedulerCustomResourceView; override; + function GetDateForPage(APageIndex: Integer): TDateTime; + function GetDaysPerPeriod: Integer; override; + function GetGlyphIndex: Integer; override; + function GetPageCount: Integer; override; + procedure InitHeaderCell(ACell: TcxSchedulerReportSchedulerHeaderCell); override; + public + constructor Create(AStyles: TcxSchedulerReportLinkPrintStyles); override; + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; override; + function IsCompatibleWith(AView: TcxSchedulerCustomView): Boolean; override; + procedure RestoreDefaults; override; + published + property Active; + property Caption; + property DontPrintWeekends; + property Layout; + property PrintExactlyOneMonthPerPage: Boolean read FPrintExactlyOneMonthPerPage write SetPrintExactlyOneMonthPerPage default False; + property ResourceCountPerPage; + property ShowEventImages default False; + property ShowNotesAreaBlank; + property ShowNotesAreaLined; + property ShowResourceImages default True; + property ShowTaskPad; + end; + + { TcxSchedulerReportLinkTimeLinePrintStyle } + + TcxSchedulerReportLinkTimeLinePrintStyle = class(TcxCustomSchedulerReportLinkPrintStyle) + private + FLayoutBuilder: TcxSchedulerReportTimeLineLayoutBuilder; + FPrimaryPageScalesOnly: Boolean; + FPrimaryPageHeadersOnly: Boolean; + FShowLinks: Boolean; + FWorkTimeOnly: Boolean; + function GetPageHeight: Integer; + function GetPageWidth(AColumn: Integer): Integer; + function GetPanelWidth: Integer; + function GetPrintFrom: TDateTime; + function GetPrintTo: TDateTime; + function GetTimeGridView: TcxSchedulerTimeGridView; + procedure SetPrimaryPageHeadersOnly(AValue: Boolean); + procedure SetPrimaryPageScalesOnly(AValue: Boolean); + procedure SetShowLinks(AValue: Boolean); + procedure SetWorkTimeOnly(AValue: Boolean); + protected + procedure BeforeBuild; override; + procedure BuildSchedulerCells(ASite: TcxSchedulerReportSchedulingAreaCell); override; + function CanDontPrintWeekends: Boolean; virtual; + function CheckPrintRangeDate(const ADate: TDateTime; AIndex: Integer): TDateTime; override; + function CheckPrintRangeTime(const ATime: TDateTime; AIndex: Integer): TDateTime; override; + function CreateSchedulingCellsProducer(ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; override; + procedure CreateControlsOnFirstPage(APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); override; + function GetCorrespondedView: TcxSchedulerCustomResourceView; override; + function GetGlyphIndex: Integer; override; + function GetHasPageHeader(APageIndex: Integer): Boolean; override; + function GetPageCount: Integer; override; + function GetPreviewGlyphIndex: Integer; override; + function SupportMessage: Boolean; override; + + property LayoutBuilder: TcxSchedulerReportTimeLineLayoutBuilder read FLayoutBuilder; + property PageHeight: Integer read GetPageHeight; + property PageWidth[Column: Integer]: Integer read GetPageWidth; + property PanelWidth: Integer read GetPanelWidth; + property PrintFrom: TDateTime read GetPrintFrom; + property PrintTo: TDateTime read GetPrintTo; + public + constructor Create(AStyles: TcxSchedulerReportLinkPrintStyles); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; override; + function IsCompatibleWith(AView: TcxSchedulerCustomView): Boolean; override; + procedure RestoreDefaults; override; + + property CorrespondedView: TcxSchedulerTimeGridView read GetTimeGridView; + published + property Active; + property DontPrintWeekends; + property PrimaryPageScalesOnly: Boolean read FPrimaryPageScalesOnly write SetPrimaryPageScalesOnly default False; + property PrimaryPageHeadersOnly: Boolean read FPrimaryPageHeadersOnly write SetPrimaryPageHeadersOnly default False; + property ResourceCountPerPage; + property ShowEventImages default True; + property ShowLinks: Boolean read FShowLinks write SetShowLinks default True; + property ShowNotesAreaBlank; + property ShowNotesAreaLined; + property ShowResourceImages default True; + property ShowTaskPad; + property WorkTimeOnly: Boolean read FWorkTimeOnly write SetWorkTimeOnly default False; + end; + + { TcxSchedulerReportLinkTrifoldPrintStyle } + + TcxSchedulerReportLinkTrifoldPrintStyleSectionMode = (smDailyCalendar, smWeeklyCalendar, + smMonthlyCalendar, smTaskPad, smNotesAreaBlank, smNotesAreaLined); + + TcxSchedulerReportLinkTrifoldPrintStyle = class(TcxCustomSchedulerReportLinkPrintStyle) + private + FSections: array[0..2] of TcxSchedulerReportLinkTrifoldPrintStyleSectionMode; + function GetHasDailySection: Boolean; + function GetSection(Index: Integer): TcxSchedulerReportLinkTrifoldPrintStyleSectionMode; + procedure SetSection(Index: Integer; AValue: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode); + function IsSectionStored(Index: Integer): Boolean; + protected + FCurrentSection: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode; + FCurrentSchedulingArea: TcxSchedulerReportSchedulingAreaCell; + FPageRange: Byte; + procedure CreateLayoutForPeriod(APeriodIndex: Integer); override; + procedure CreateLayoutForSection(ASite: TdxReportCell; APeriodIndex: Integer; const ABounds: TRect; + ASection: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode); virtual; + procedure CreateSchedulingAreaWithHeader(ASite: TdxReportCell; ABounds: TRect); virtual; + function CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; override; + procedure FillDatesForPage(ADateList: TcxSchedulerDateList; + APageIndex, APeriodIndex, ASubIndex: Integer); override; + function GetCorrespondedView: TcxSchedulerCustomResourceView; override; + function GetGlyphIndex: Integer; override; + function GetPageCount: Integer; override; + procedure InitHeaderCell(ACell: TcxSchedulerReportSchedulerHeaderCell); override; + + property HasDailySection: Boolean read GetHasDailySection; + public + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; override; + procedure RestoreDefaults; override; + published + property Active; + property Caption; + property LeftSection: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode index 0 read GetSection write SetSection stored IsSectionStored; + property MiddleSection: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode index 1 read GetSection write SetSection stored IsSectionStored; + property RightSection: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode index 2 read GetSection write SetSection stored IsSectionStored; + end; + + { TcxSchedulerReportLinkWeeklyPrintStyle } + + TcxSchedulerReportLinkWeeklyPrintStyleArrange = (wsaTopToBottom, wsaLeftToRight); + + TcxSchedulerReportLinkWeeklyPrintStyle = class(TcxCustomSchedulerReportLinkPrintStyle) + private + FArrange: TcxSchedulerReportLinkWeeklyPrintStyleArrange; + FDaysLayout: TcxSchedulerWeekViewDaysLayout; + FDaysLayoutAssigned: Boolean; + + function GetDaysLayout: TcxSchedulerWeekViewDaysLayout; + + function IsArrangeStored: Boolean; + function IsDaysLayoutStored: Boolean; + + procedure SetArrange(Value: TcxSchedulerReportLinkWeeklyPrintStyleArrange); + procedure SetDaysLayout(Value: TcxSchedulerWeekViewDaysLayout); + protected + procedure Build; override; + procedure CreateControlsOnFirstPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + procedure CreateControlsOnSecondPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + function CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; override; + procedure FillDatesForPage(ADateList: TcxSchedulerDateList; + APageIndex, APeriodIndex, ASubIndex: Integer); override; + function GetCorrespondedView: TcxSchedulerCustomResourceView; override; + function GetGlyphIndex: Integer; override; + function GetDateForPage(APageIndex: Integer): TDateTime; + function GetDaysPerPeriod: Integer; override; + function GetPageCount: Integer; override; + function GetPreviewGlyphIndex: Integer; override; + function GetStartOfWeekOffset: Integer; override; + procedure InitHeaderCell(ACell: TcxSchedulerReportSchedulerHeaderCell); override; + function CanDontPrintWeekends: Boolean; virtual; + function SupportMessage: Boolean; override; + function SupportTimeRange: Boolean; override; + public + constructor Create(AStyles: TcxSchedulerReportLinkPrintStyles); override; + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; override; + function IsCompatibleWith(AView: TcxSchedulerCustomView): Boolean; override; + procedure RestoreDefaults; override; + + property DaysLayoutAssigned: Boolean read FDaysLayoutAssigned write FDaysLayoutAssigned; + published + property Active; + property Arrange: TcxSchedulerReportLinkWeeklyPrintStyleArrange read FArrange write SetArrange stored IsArrangeStored; + property Caption; + property DaysLayout: TcxSchedulerWeekViewDaysLayout read GetDaysLayout write SetDaysLayout stored IsDaysLayoutStored; + property DontPrintWeekends; + property Layout; + property ResourceCountPerPage; + property ShowEventImages default False; + property ShowNotesAreaBlank; + property ShowNotesAreaLined; + property ShowResourceImages default True; + property ShowTaskPad; + end; + + { TcxSchedulerReportLinkYearlyPrintStyle } + + TcxSchedulerReportLinkYearlyPrintStyle = class(TcxCustomSchedulerReportLinkPrintStyle) + private + FMonthCountPerPage: Integer; + FPrimaryPageHeadersOnly: Boolean; + function GetPeriodPageCount: Integer; + procedure SetMonthCountPerPage(AValue: Integer); + procedure SetPrimaryPageHeadersOnly(AValue: Boolean); + protected + procedure BuildSchedulerCells(ASite: TcxSchedulerReportSchedulingAreaCell); override; + procedure CreateControlsOnFirstPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + procedure CreateControlsOnSecondPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + function CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; override; + procedure FillDatesForPage(ADateList: TcxSchedulerDateList; + APageIndex, APeriodIndex, ASubIndex: Integer); override; + function GetCorrespondedView: TcxSchedulerCustomResourceView; override; + function GetHasPageHeader(APageIndex: Integer): Boolean; override; + function GetGlyphIndex: Integer; override; + function GetPreviewGlyphIndex: Integer; override; + function GetPageCount: Integer; override; + function GetShowDateNavigator(APageIndex: Integer): Boolean; override; + procedure InitHeaderCell(ACell: TcxSchedulerReportSchedulerHeaderCell); override; + + property PeriodPageCount: Integer read GetPeriodPageCount; + public + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; override; + function IsCompatibleWith(AView: TcxSchedulerCustomView): Boolean; override; + procedure RestoreDefaults; override; + published + property Active; + property Caption; + property Layout; + property MonthCountPerPage: Integer read FMonthCountPerPage write SetMonthCountPerPage default 12; + property PrimaryPageHeadersOnly: Boolean read FPrimaryPageHeadersOnly write SetPrimaryPageHeadersOnly default False; + property ShowEventImages default False; + property ShowNotesAreaBlank; + property ShowNotesAreaLined; + property ShowTaskPad; + end; + + { TcxSchedulerReportLinkPrintStyles } + + TcxSchedulerReportLinkPrintStyles = class(TcxCustomSchedulerReportLinkOptions) + private + FActiveStyle: TcxCustomSchedulerReportLinkPrintStyle; + FActiveStyleAssigned: Boolean; + FItems: TList; + function GetCount: Integer; + function GetItem(Index: Integer): TcxCustomSchedulerReportLinkPrintStyle; + function GetStyleDaily: TcxSchedulerReportLinkDailyPrintStyle; + function GetStyleDetails: TcxSchedulerReportLinkDetailsPrintStyle; + function GetStyleMemo: TcxSchedulerReportLinkMemoPrintStyle; + function GetStyleMonthly: TcxSchedulerReportLinkMonthlyPrintStyle; + function GetStyleTimeLine: TcxSchedulerReportLinkTimeLinePrintStyle; + function GetStyleTrifold: TcxSchedulerReportLinkTrifoldPrintStyle; + function GetStyleWeekly: TcxSchedulerReportLinkWeeklyPrintStyle; + function GetStyleYearly: TcxSchedulerReportLinkYearlyPrintStyle; + procedure SetActiveStyle(Value: TcxCustomSchedulerReportLinkPrintStyle); + procedure SetActiveStyleAssigned(Value: Boolean); + procedure SetItem(Index: Integer; Value: TcxCustomSchedulerReportLinkPrintStyle); + procedure SetStyleDaily(Value: TcxSchedulerReportLinkDailyPrintStyle); + procedure SetStyleDetails(Value: TcxSchedulerReportLinkDetailsPrintStyle); + procedure SetStyleMemo(Value: TcxSchedulerReportLinkMemoPrintStyle); + procedure SetStyleMonthly(Value: TcxSchedulerReportLinkMonthlyPrintStyle); + procedure SetStyleTimeLine(Value: TcxSchedulerReportLinkTimeLinePrintStyle); + procedure SetStyleTrifold(Value: TcxSchedulerReportLinkTrifoldPrintStyle); + procedure SetStyleWeekly(Value: TcxSchedulerReportLinkWeeklyPrintStyle); + procedure SetStyleYearly(Value: TcxSchedulerReportLinkYearlyPrintStyle); + protected + procedure CreateObjects; override; + procedure DestroyObjects; override; + + { IdxReportLinkOptionsDesignerSupport } + + function DesignerTabIndex: Integer; override; + + procedure ActiveStyleChanged; virtual; + function CreateStyle(AStyleClass: TcxCustomSchedulerReportLinkPrintStyleClass): TcxCustomSchedulerReportLinkPrintStyle; virtual; + procedure CreateStyles; virtual; + procedure DestroyStyles; virtual; + procedure GetStyleByClassEx(AClass: TcxCustomSchedulerReportLinkPrintStyleClass; var AInstance); + procedure SetActiveStyleEx(Value: TcxCustomSchedulerReportLinkPrintStyle); + procedure StyleChanged(AStyle: TcxCustomSchedulerReportLinkPrintStyle); virtual; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + + function GetCorrespondingStyle: TcxCustomSchedulerReportLinkPrintStyle; virtual; + function GetStyleByClass(AClass: TcxCustomSchedulerReportLinkPrintStyleClass): TcxCustomSchedulerReportLinkPrintStyle; + function GetStyleByName(const Name: string): TcxCustomSchedulerReportLinkPrintStyle; + function GetStyleByView(View: TcxSchedulerCustomView): TcxCustomSchedulerReportLinkPrintStyle; + + function IndexOf(AItem: TcxCustomSchedulerReportLinkPrintStyle): Integer; + + property ActiveStyle: TcxCustomSchedulerReportLinkPrintStyle read FActiveStyle write SetActiveStyle stored False; + property ActiveStyleAssigned: Boolean read FActiveStyleAssigned write SetActiveStyleAssigned; + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxCustomSchedulerReportLinkPrintStyle read GetItem write SetItem; default; + published + property Daily: TcxSchedulerReportLinkDailyPrintStyle read GetStyleDaily write SetStyleDaily; + property Details: TcxSchedulerReportLinkDetailsPrintStyle read GetStyleDetails write SetStyleDetails; + property Memo: TcxSchedulerReportLinkMemoPrintStyle read GetStyleMemo write SetStyleMemo; + property Monthly: TcxSchedulerReportLinkMonthlyPrintStyle read GetStyleMonthly write SetStyleMonthly; + property Trifold: TcxSchedulerReportLinkTrifoldPrintStyle read GetStyleTrifold write SetStyleTrifold; + property TimeLine: TcxSchedulerReportLinkTimeLinePrintStyle read GetStyleTimeLine write SetStyleTimeLine; + property Weekly: TcxSchedulerReportLinkWeeklyPrintStyle read GetStyleWeekly write SetStyleWeekly; + property Yearly: TcxSchedulerReportLinkYearlyPrintStyle read GetStyleYearly write SetStyleYearly; + end; + + { DesignWindow } + + TcxfmSchedulerReportLinkDesignWindow = class(TdxfmCustomcxControlReportLinkDesignWindow) + PageControl1: TPageControl; + tshPrintStyles: TTabSheet; + tshStyles: TTabSheet; + bvlStyles: TBevel; + bvlStyleSheets: TBevel; + lblStyleSheets: TLabel; + bvlStylesHost: TBevel; + Label1: TLabel; + lblUseNativeStyles: TLabel; + btnStyleColor: TButton; + btnStyleFont: TButton; + btnStyleBackgroundBitmap: TButton; + cbxStyleSheets: TcxComboBox; + btnStyleSheetNew: TButton; + btnStyleSheetCopy: TButton; + btnStyleSheetDelete: TButton; + btnStylesSaveAs: TButton; + btnStyleSheetRename: TButton; + btnStyleBackgroundBitmapClear: TButton; + btnStyleRestoreDefaults: TButton; + chbxUseNativeStyles: TcxCheckBox; + pmStyles: TPopupMenu; + miStyleFont: TMenuItem; + miStyleColor: TMenuItem; + miLine3: TMenuItem; + miStyleBackgroundBitmap: TMenuItem; + miStyleBackgroundBitmapClear: TMenuItem; + miLine2: TMenuItem; + miStyleRestoreDefaults: TMenuItem; + milLine: TMenuItem; + miStylesSelectAll: TMenuItem; + miLine4: TMenuItem; + miStylesSaveAs: TMenuItem; + ilStylesPopup: TImageList; + lblPreviewWindow: TStaticText; + Panel1: TPanel; + pnlPreview: TPanel; + cbxPrintStyles: TcxImageComboBox; + lblPrintStylesOptions: TLabel; + bvlPrintStyleOptions: TBevel; + pcPrintStyleOptions: TPageControl; + tshWeekly: TTabSheet; + tshMonthly: TTabSheet; + tshTrifold: TTabSheet; + tshDetails: TTabSheet; + tshMemo: TTabSheet; + lblPrintStyleTrifoldSectionLeft: TLabel; + lblPrintStyleTrifoldSectionMiddle: TLabel; + lblPrintStyleTrifoldSectionRight: TLabel; + lblPrintStyleWeeklyPrintTo: TLabel; + lblPrintStyleWeeklyPrintFrom: TLabel; + chbxPrintStyleWeeklyNotesAreaLined: TcxCheckBox; + chbxPrintStyleWeeklyNotesAreaBlank: TcxCheckBox; + lblPrintStyleWeeklyInclude: TLabel; + lblPrintStyleWeeklyLayout: TLabel; + lblPrintStyleWeeklyArrange: TLabel; + cbxPrintStyleWeeklyArrange: TcxComboBox; + cbxPrintStyleWeeklyLayout: TcxComboBox; + chbxPrintStyleWeeklyTaskPad: TcxCheckBox; + tePrintStyleWeeklyPrintFrom: TcxTimeEdit; + tePrintStyleWeeklyPrintTo: TcxTimeEdit; + cbxPrintStyleMonthlyLayout: TcxComboBox; + lblPrintStyleMonthlyLayout: TLabel; + lblPrintStyleMonthlyInclude: TLabel; + chbxPrintStyleMonthlyTaskPad: TcxCheckBox; + chbxPrintStyleMonthlyNotesAreaBlank: TcxCheckBox; + chbxPrintStyleMonthlyNotesAreaLined: TcxCheckBox; + chbxPrintStyleMonthlyDontPrintWeekends: TcxCheckBox; + chbxPrintStyleMonthlyPrintExactlyOneMonthPerPage: TcxCheckBox; + chbxPrintStyleWeeklyDontPrintWeekends: TcxCheckBox; + pnlPrintStylesPreview: TPanel; + pbxPrintStylesPreview: TPaintBox; + chbxPrintStyleDetailsUsePagination: TcxCheckBox; + cbxPrintStyleDetailsPagination: TcxComboBox; + tshFormatting: TTabSheet; + bvlLookAndFeel: TBevel; + lblLookAndFeel: TLabel; + imgLookAndFeel: TImage; + cbxLookAndFeel: TcxComboBox; + lblRefinements: TLabel; + bvlRefinements: TBevel; + imgRefinements: TImage; + chbxSuppressBackgroundBitmaps: TcxCheckBox; + tshPrintRange: TTabSheet; + lblPrintRangeStart: TLabel; + lblPrintRangeEnd: TLabel; + lblPrintRangesMiscellaneous: TLabel; + Bevel1: TBevel; + dePrintRangeStart: TcxDateEdit; + dePrintRangeEnd: TcxDateEdit; + chbxHideDetailsOfPrivateAppointments: TcxCheckBox; + cbxPrintStyleTrifoldSectionLeft: TcxComboBox; + cbxPrintStyleTrifoldSectionMiddle: TcxComboBox; + cbxPrintStyleTrifoldSectionRight: TcxComboBox; + sePrintStyleMonthlyResourceCountPerPage: TcxSpinEdit; + lblPrintStyleMonthlyResourceCountPerPage: TLabel; + lblPrintStyleWeeklyResourceCountPerPage: TLabel; + sePrintStyleWeeklyResourceCountPerPage: TcxSpinEdit; + tshDaily: TTabSheet; + lblPrintStyleDailyLayout: TLabel; + lblPrintStyleDailyInclude: TLabel; + lblPrintStyleDailyPrintFrom: TLabel; + lblPrintStyleDailyPrintTo: TLabel; + lblPrintStyleDailyResourceCountPerPage: TLabel; + cbxPrintStyleDailyLayout: TcxComboBox; + chbxPrintStyleDailyTaskPad: TcxCheckBox; + chbxPrintStyleDailyNotesAreaBlank: TcxCheckBox; + chbxPrintStyleDailyNotesAreaLined: TcxCheckBox; + tePrintStyleDailyPrintFrom: TcxTimeEdit; + tePrintStyleDailyPrintTo: TcxTimeEdit; + sePrintStyleDailyResourceCountPerPage: TcxSpinEdit; + cxEditStyleController1: TcxEditStyleController; + pbPreview: TPaintBox; + chbxPrintStyleMemoStartEachItemOnNewPage: TcxCheckBox; + chbxPrintStyleMemoPrintOnlySelectedEvents: TcxCheckBox; + cbxPrintStyleWeeklyDaysLayout: TcxComboBox; + lblPrintStyleWeeklyDaysLayout: TLabel; + tshYearly: TTabSheet; + cbxPrintStyleYearlyMonthPerPage: TcxComboBox; + lblPrintStyleYearlyMonthPerPage: TLabel; + lblPrintStyleYearlyResourceCountPerPage: TLabel; + sePrintStyleYearlyResourceCountPerPage: TcxSpinEdit; + chbxPrintStyleYearlyTaskPad: TcxCheckBox; + chbxPrintStyleYearlyNotesAreaBlank: TcxCheckBox; + chbxPrintStyleYearlyNotesAreaLined: TcxCheckBox; + lblPrintStyleYearlyInclude: TLabel; + cbxPrintStyleYearlyLayout: TcxComboBox; + lblPrintStyleYearlyLayout: TLabel; + chbxPrimaryPageHeadersOnly: TcxCheckBox; + chbxPrintStyleDailyShowResourceImages: TcxCheckBox; + chbxPrintStyleDailyShowEventImages: TcxCheckBox; + chbxPrintStyleWeeklyShowEventImages: TcxCheckBox; + chbxPrintStyleWeeklyShowResourceImages: TcxCheckBox; + chbxPrintStyleMonthlyShowEventImages: TcxCheckBox; + chbxPrintStyleMonthlyShowResourceImages: TcxCheckBox; + chbxPrintStyleYearlyShowEventImages: TcxCheckBox; + tshTimeLine: TTabSheet; + lblPrintStyleTimeLineResourceCountPerPage: TLabel; + sePrintStyleTimeLineResourceCountPerPage: TcxSpinEdit; + chbxPrintStyleTimeLineTaskPad: TcxCheckBox; + lblPrintStyleTimeLineInclude: TLabel; + chbxPrintStyleTimeLineNotesAreaBlank: TcxCheckBox; + chbxPrintStyleTimeLineNotesAreaLined: TcxCheckBox; + tePrintStyleTimeLinePrintFrom: TcxTimeEdit; + lblPrintStyleTimeLinePrintFrom: TLabel; + lblPrintStyleTimeLinePrintTo: TLabel; + tePrintStyleTimeLinePrintTo: TcxTimeEdit; + chbxPrintStyleTimeLineShowEventImages: TcxCheckBox; + Bevel6: TBevel; + chbxPrintStyleTimeLinePrimaryPageScalesOnly: TcxCheckBox; + chbxPrintStyleTimeLineDontPrintWeekends: TcxCheckBox; + bvlTimeLineImages: TBevel; + Label2: TLabel; + lbTimeLineImages: TLabel; + Bevel2: TBevel; + lbViewDaily: TLabel; + Bevel7: TBevel; + lbImagesDaily: TLabel; + Bevel3: TBevel; + Label5: TLabel; + Bevel8: TBevel; + Label6: TLabel; + Bevel9: TBevel; + Label7: TLabel; + Bevel10: TBevel; + Label8: TLabel; + Bevel4: TBevel; + Label9: TLabel; + Bevel5: TBevel; + Label10: TLabel; + chbxPrintStyleTimeLineWorkTimeOnly: TcxCheckBox; + chbxPrintStyleTimeLineShowResourceImages: TcxCheckBox; + chbxPrintStyleTimeLinePrimaryPageHeadersOnly: TcxCheckBox; + chbxSuppressContentColoration: TcxCheckBox; + procedure PageControl1Change(Sender: TObject); + procedure lbxStylesClick(Sender: TObject); + procedure btnStyleFontClick(Sender: TObject); + procedure btnStyleColorClick(Sender: TObject); + procedure btnStyleBackgroundBitmapClick(Sender: TObject); + procedure btnStyleBackgroundBitmapClearClick(Sender: TObject); + procedure btnStyleRestoreDefaultsClick(Sender: TObject); + procedure btnStylesSaveAsClick(Sender: TObject); + procedure cbxStyleSheetsClick(Sender: TObject); + procedure miStylesSelectAllClick(Sender: TObject); + procedure cbxStyleSheetsKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure btnStyleSheetNewClick(Sender: TObject); + procedure btnStyleSheetCopyClick(Sender: TObject); + procedure btnStyleSheetDeleteClick(Sender: TObject); + procedure btnStyleSheetRenameClick(Sender: TObject); + procedure lblUseNativeStylesClick(Sender: TObject); + procedure OptionsFormattingClick(Sender: TObject); + procedure pmStylesPopup(Sender: TObject); + procedure cbxPrintStylesClick(Sender: TObject); + procedure pbxPrintStylesPreviewPaint(Sender: TObject); + procedure cbxPrintStyleDailyLayoutClick(Sender: TObject); + procedure chbxPrintStyleOptionsViewClick(Sender: TObject); + procedure cbxPrintStyleWeeklyArrangeClick(Sender: TObject); + procedure chbxPrintStyleWeeklyDontPrintWeekendsClick(Sender: TObject); + procedure chbxPrintStyleDontPrintWeekEndsClick(Sender: TObject); + procedure chbxPrintStyleMonthlyPrintExactlyOneMonthPerPageClick( + Sender: TObject); + procedure cbxPrintStyleTrifoldSectionModeClick(Sender: TObject); + procedure chbxPrintStyleDetailsUsePaginationClick(Sender: TObject); + procedure cbxPrintStyleDetailsPaginationClick(Sender: TObject); + procedure cbxPrintStyleWeeklyLayoutClick(Sender: TObject); + procedure cbxPrintStyleMonthlyLayoutClick(Sender: TObject); + procedure dePrintRangeStartEditValueChanged(Sender: TObject); + procedure dePrintRangeEndEditValueChanged(Sender: TObject); + procedure cbxStyleSheetsPropertiesDrawItem(AControl: TcxCustomComboBox; + ACanvas: TcxCanvas; AIndex: Integer; const ARect: TRect; + AState: TOwnerDrawState); + procedure tePrintStylePrintRangePropertiesEditValueChanged( + Sender: TObject); + procedure LookAndFeelChange(Sender: TObject); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + procedure sePrintStyleResourceCountPerPagePropertiesEditValueChanged( + Sender: TObject); + procedure tePrintStylePrintRangePropertiesChange(Sender: TObject); + procedure sePrintStyleResourceCountPerPagePropertiesChanged( + Sender: TObject); + procedure StyleController1StyleChanged(Sender: TObject); + procedure pbPreviewPaint(Sender: TObject); + procedure cbxLookAndFeelPropertiesChange(Sender: TObject); + procedure chbxPrintStyleMemoStartEachItemOnNewPageClick( + Sender: TObject); + procedure chbxPrintStyleMemoPrintOnlySelectedEventsClick( + Sender: TObject); + procedure cbxPrintStyleWeeklyDaysLayoutClick(Sender: TObject); + procedure cbxPrintStyleYearlyLayoutClick(Sender: TObject); + procedure cbxPrintStyleYearlyMonthPagesPerYearClick(Sender: TObject); + procedure chbxPrimaryPageHeadersOnlyClick(Sender: TObject); + procedure chbxPrintStyleShowResourceImagesClick(Sender: TObject); + procedure chbxPrintStyleShowEventImagesClick(Sender: TObject); + procedure chbxPrimaryPageScalesOnlyClick(Sender: TObject); + procedure chbxPrintStyleWorkTimeOnlyClick(Sender: TObject); + private + FActiveStyle: TcxCustomSchedulerReportLinkPrintStyle; + FActiveStyleAssigned: Boolean; + FIsFormClosing: Boolean; + lbxStyles: TdxStylesListBox; + wpPrintStyles: TList; + + function GetActivePrintStyle: TcxCustomSchedulerReportLinkPrintStyle; + function GetActiveStyle: TcxStyle; + function GetComponent: TcxScheduler; + function GetHasSelectedStyles: Boolean; + function GetHasSelectedStylesWithAssignedBitmap: Boolean; + function GetReportLink: TcxSchedulerReportLink; + + function CanSelectAllStyles: Boolean; + procedure CreateControls; + + procedure RecreateStylesListBox; + procedure RestoreSelectedStyles(AList: TList); + procedure SaveSelectedStyles(AList: TList); + procedure SetActivePage; + + procedure SetOptionsFormattingByIndex(AnIndex: Integer; AValue: Boolean); + procedure SetPrintStyleOptionsViewByIndex(AnIndex: Integer; AValue: Boolean); + procedure SetPrintStyleRangeByIndex(AnIndex: Integer; const ATime: TDateTime); + procedure SetPrintStyleResourceCountPerPageByIndex(AnIndex: Integer; AValue: TcxEditValue); + procedure SetShowImagesCheckBoxes(AEventImages, AResourceImages: TcxCheckBox; + APrintStyle: TcxCustomSchedulerReportLinkPrintStyle); + protected + procedure AssignDailyTabObjects; virtual; + procedure AssignDetailsTabObjects; virtual; + procedure AssignMemoTabObjects; virtual; + procedure AssignMonthlyTabObjects; virtual; + procedure AssignTimeLineTabObjects; virtual; + procedure AssignTrifoldTabObjects; virtual; + procedure AssignWeeklyTabObjects; virtual; + procedure AssignYearlyTabObjects; virtual; + + function CanApply: Boolean; override; + procedure DoApply; override; + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + + function CheckPrintRange: Boolean; virtual; + function CheckPrintStyleSettings: Boolean; virtual; + function IsValidConditions: Boolean; virtual; + procedure HideOptionsButtons; + procedure LoadCaption(AControl: TControl; StrPtr: Pointer); overload; + procedure LoadCaption(AItem: TMenuItem; StrPtr: Pointer); overload; + procedure LoadStrings; override; + procedure LoadStringsCombo(ACombo: TcxComboBox; ACaptions: array of Pointer); + procedure LoadStringsDaily; virtual; + procedure LoadStringsDetails; virtual; + procedure LoadStringsMemo; virtual; + procedure LoadStringsMonthly; virtual; + procedure LoadStringsOther; virtual; + procedure LoadStringsTimeLineStyle; virtual; + procedure LoadStringsTrifold; virtual; + procedure LoadStringsWeekly; virtual; + procedure LoadStringsYearly; virtual; + + procedure PreviewDrawPageContent(ACanvas: TCanvas; ABounds: TRect); virtual; + + procedure UpdateControlsState; override; + procedure UpdateEnabled(AControl: TControl; AEnabled: Boolean); overload; + procedure UpdateEnabled(AItem: TMenuItem; AEnabled: Boolean); overload; + procedure UpdateEnabledControls(AControls: array of TControl; AEnabled: Boolean); + procedure UpdatePreview; override; + + function GetDesignerTabIndex: Integer; override; + procedure SetDesignerTabIndex(Value: Integer); override; + + procedure DoActiveStyleSheetChanged; override; + procedure DoFormActivated(AnActive: Boolean); override; + procedure DoRefreshStylesList; override; + procedure DoStyleChanged(const ACaption: string; AStyle: TcxStyle); override; + procedure DoStylesChanged(AStrings: TStrings; ARecreate: Boolean); override; + + procedure GetSelectedStyleNames(AStrings: TStrings); override; + procedure GetStyleNames(out AStrings: TStrings); override; + procedure GetStyleSheetNames(out AStrings: TStrings); override; + + procedure ActivatePrintStyleTab; virtual; + procedure AssignTabSheetObjects; virtual; + function FindTabIndexByPrintStyle(APrintStyle: TcxCustomSchedulerReportLinkPrintStyle): Integer; virtual; + procedure RefreshPrintStyles; virtual; + + property ActivePrintStyle: TcxCustomSchedulerReportLinkPrintStyle read GetActivePrintStyle; + property ActiveStyle: TcxStyle read GetActiveStyle; + property HasSelectedStyles: Boolean read GetHasSelectedStyles; + property HasSelectedStylesWithAssignedBitmap: Boolean read GetHasSelectedStylesWithAssignedBitmap; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function Execute: Boolean; override; + + property Component: TcxScheduler read GetComponent; + property ReportLink: TcxSchedulerReportLink read GetReportLink; + end; + + // cells + + { TcxSchedulerReportPageSite } + + TcxSchedulerReportPageSite = class(TdxReportCell) + protected + FPageIndex: Integer; + FPrimaryPage: Boolean; + + procedure ReadProperties(AReader: TdxPSDataReader); override; + procedure WriteProperties(AWriter: TdxPSDataWriter); override; + public + property PageIndex: Integer read FPageIndex; + property PrimaryPage: Boolean read FPrimaryPage; + end; + + { TcxSchedulerReportPageItemCell } + + TcxSchedulerReportPageItemCell = class(TdxReportCell) + private + function GetPageIndex: Integer; + function GetPageSite: TcxSchedulerReportPageSite; + function GetPrimaryPage: Boolean; + function GetReportLink: TcxSchedulerReportLink; + protected + function GetType: TcxSchedulerReportItemsType; virtual; + + procedure SetCellViewParams(AItem: TdxReportVisualItem; const AParams: TcxViewParams); overload; + procedure SetCellViewParams(AItem: TdxReportVisualItem; const AParams: TdxReportItemViewParams); overload; + + property ReportLink: TcxSchedulerReportLink read GetReportLink; + public + constructor Create(AParent: TdxReportCell); override; + property PageSite: TcxSchedulerReportPageSite read GetPageSite; + property PrimaryPage: Boolean read GetPrimaryPage; + property PageIndex: Integer read GetPageIndex; + end; + + { TcxSchedulerReportNotesDataCell } + + TcxSchedulerReportNotesDataCell = class(TAbstractdxReportCellData) + private + FCaption: string; + FCaptionHeight: Integer; + FLined: Boolean; + function GetMultiLine: Boolean; + function GetTextAlignX: TdxTextAlignX; + function GetTextAlignY: TdxTextAlignY; + procedure SetMultiLine(Value: Boolean); + procedure SetTextAlignX(Value: TdxTextAlignX); + procedure SetTextAlignY(Value: TdxTextAlignY); + protected + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor Create(AParent: TdxReportCell); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + + property Caption: string read FCaption write FCaption; + property CaptionHeight: Integer read FCaptionHeight write FCaptionHeight; + property Lined: Boolean read FLined write FLined; + property MultiLine: Boolean read GetMultiLine write SetMultiLine; + property TextAlignX: TdxTextAlignX read GetTextAlignX write SetTextAlignX; + property TextAlignY: TdxTextAlignY read GetTextAlignY write SetTextAlignY; + end; + + TcxSchedulerReportNotesDataCellClass = class of TcxSchedulerReportNotesDataCell; + + { TcxSchedulerReportNotesAreaCell } + + TcxSchedulerReportNotesAreaCell = class(TcxSchedulerReportPageItemCell) + private + FLined: Boolean; + function GetDataCell: TcxSchedulerReportNotesDataCell; + protected + procedure BoundsChanged; override; + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); override; + function GetType: TcxSchedulerReportItemsType; override; + function GetDataCellClass: TcxSchedulerReportNotesDataCellClass; virtual; + procedure SetFontIndex(Value: Integer); override; + public + constructor Create(AParent: TdxReportCell); override; + constructor CreateEx(AParent: TdxReportCell; ALined: Boolean); virtual; + property DataCell: TcxSchedulerReportNotesDataCell read GetDataCell; + property Lined: Boolean read FLined; + end; + + { TcxSchedulerReportTaskPadCell } + + TcxSchedulerReportTaskPadCell = class(TcxSchedulerReportNotesAreaCell) + private + function GetTaskPadDataSite: TdxReportCell; + protected + procedure BoundsChanged; override; + function CalculateTaskPadDataSiteBounds: TRect; virtual; + function GetType: TcxSchedulerReportItemsType; override; + public + constructor CreateEx(AParent: TdxReportCell; ALined: Boolean); override; + + property TaskPadDataSite: TdxReportCell read GetTaskPadDataSite; + end; + + { TcxSchedulerReportSchedulerHeaderDataCell } + + TcxSchedulerReportSchedulerHeaderDataCell = class(TAbstractdxReportCellData) + public + constructor Create(AParent: TdxReportCell); override; + end; + + { TcxSchedulerReportSchedulerHeaderCell } + + TcxSchedulerReportSchedulerHeaderCell = class(TcxSchedulerReportPageItemCell) + private + FContent: TcxSchedulerReportSchedulerHeaderDataCell; + FDate: TDateTime; + FPrimaryText: string; //todo: remove + FSecondaryText: string; //todo: remove + FPrimaryTextCell: TdxReportCellString; + FSecondaryTextCell: TdxReportCellString; + protected + function AddContentCell: TcxSchedulerReportSchedulerHeaderDataCell; virtual; + function AddTextCell(AText: string; const ABounds: TRect; AMultiLine: Boolean): TdxReportCellString; + function GetType: TcxSchedulerReportItemsType; override; + + property Date: TDateTime read FDate write FDate; + property PrimaryText: string read FPrimaryText write FPrimaryText; //todo: remove + property SecondaryText: string read FSecondaryText write FSecondaryText; //todo: remove + public + constructor Create(AParent: TdxReportCell); override; + procedure AdjustTextSize; + + property Content: TcxSchedulerReportSchedulerHeaderDataCell read FContent; + property PrimaryTextCell: TdxReportCellString read FPrimaryTextCell; + property SecondaryTextCell: TdxReportCellString read FSecondaryTextCell; + end; + + { TcxSchedulerReportDateNavigatorItem } + + TcxSchedulerReportDateNavigatorItem = class(TdxReportCellPreviewText) + private + function GetDateNavigator: TcxSchedulerReportDateNavigatorCell; + protected + function GetDefaultDTFormat: DWORD; override; + procedure SetText(const Value: string); override; + public + constructor Create(AParent: TdxReportCell); override; + + property DateNavigator: TcxSchedulerReportDateNavigatorCell read GetDateNavigator; + end; + + { TcxSchedulerReportDateNavigatorHeader } + + TcxSchedulerReportDateNavigatorHeader = class(TcxSchedulerReportDateNavigatorItem) + private + FMonth: Word; + FYear: Word; + protected + function GetText: string; override; + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateEx(AParent: TdxReportCell; AYear, AMonth: Word); + procedure Assign(Source: TPersistent); override; + + property Month: Word read FMonth; + property Year: Word read FYear; + end; + + { TcxSchedulerReportDateNavigatorDay } + + TcxSchedulerReportDateNavigatorDay = class(TcxSchedulerReportDateNavigatorItem) + private + FDay: Integer; + FCol: Integer; + FRow: Integer; + function GetBold: Boolean; + function GetDate: TDate; + function GetMonth: Word; + function GetYear: Word; + procedure SetBold(Value: Boolean); + protected + function GetText: string; override; + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateEx(AParent: TdxReportCell; + ADay, ACol, ARow: Integer; ABold: Boolean); virtual; + procedure Assign(Source: TPersistent); override; + + property Col: Integer read FCol; + property Date: TDate read GetDate; + property Day: Integer read FDay write FDay; + property Bold: Boolean read GetBold write SetBold; + property Month: Word read GetMonth; + property Row: Integer read FRow; + property Year: Word read GetYear; + end; + + { TcxSchedulerReportDateNavigatorDayCaption } + + TcxSchedulerReportDateNavigatorDayCaption = class(TcxSchedulerReportDateNavigatorItem) + private + FCol: Integer; + FDayOfWeek: TDay; + FDayText: string; + protected + function GetText: string; override; + function GetDayText: string; virtual; + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateEx(AParent: TdxReportCell; ADayOfWeek: TDay; ACol: Integer); virtual; + procedure Assign(Source: TPersistent); override; + + property Col: Integer read FCol; + property DayOfWeek: TDay read FDayOfWeek; + end; + + { TcxSchedulerReportDateNavigatorWeekNumber } + + TcxSchedulerReportDateNavigatorWeekNumber = class(TcxSchedulerReportDateNavigatorItem) + private + FWeekNumber: Integer; + FRow: Integer; + protected + function GetText: string; override; + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateEx(AParent: TdxReportCell; AWeekNumber, ARow: Integer); virtual; + procedure Assign(Source: TPersistent); override; + + property Row: Integer read FRow; + property WeekNumber: Integer read FWeekNumber write FWeekNumber; + end; + + { TcxSchedulerReportDateNavigatorCell } + + TcxSchedulerReportDateNavigatorCell = class(TcxSchedulerReportPageItemCell) + private + FBoldedDays: TcxSchedulerDateList; + FFirstWeekOfYear: TcxFirstWeekOfYear; + FMonth: Word; + FShowDatesContainingEventsInBold: Boolean; + FShowWeekNumbers: Boolean; + FStartOfWeek: TDay; + FYear: Word; + + FColWidth: Integer; + FDayCaptionsHeight: Integer; + FHeaderHeight: Integer; + FMonthSize: TSize; + FRowHeight: Integer; + FVertOffset: Integer; + FContentParams: TdxReportItemViewParams; + FHeaderParams: TdxReportItemViewParams; + + FDayCaptionCount: Integer; + FDayCount: Integer; + FWeekNumberCount: Integer; + + class function GetMonthHeight(AHeaderHeight, ADayCaptionsHeight, ARowHeight: Integer): Integer; + function GetDay(Index: Integer): TcxSchedulerReportDateNavigatorDay; + function GetDayCaption(Index: Integer): TcxSchedulerReportDateNavigatorDayCaption; + function GetHeader: TcxSchedulerReportDateNavigatorHeader; + function GetWeekNumber(Index: Integer): TcxSchedulerReportDateNavigatorWeekNumber; + protected + procedure AdjustItemsVertical; + function ColOfDate(ADate: TDateTime): Integer; + procedure CreateDayCaptions; virtual; + procedure CreateDay(const ABounds: TRect; ADate: TDateTime; ACol, ARow: Integer); virtual; + procedure CreateItems; + procedure CreateLines; virtual; + procedure CreateMonth; virtual; + procedure CreateMonthHeader; virtual; + procedure CreateWeekNumber(const ABounds: TRect; ADate: TDateTime; ARow: Integer); virtual; + class procedure GetContentPartSizes(AFont: TFont; var AColWidth, ARowHeight, + ADayCaptionsHeight: Integer; AFontSize: Integer = 0); virtual; + function GetDayBoundsFromColAndRow(ACol, ARow: Integer): TRect; virtual; + function GetDayIsBold(ADate: TDateTime): Boolean; virtual; + function GetHeaderBounds: TRect; virtual; + class procedure GetHeaderPartSizes(AFont: TFont; var AHeaderHeight: Integer; + AFontSize: Integer = 0); virtual; + function GetMonthSize(const AContentParams, AHeaderParams: TdxReportItemViewParams): TSize; + function GetType: TcxSchedulerReportItemsType; override; + procedure SetViewParams(const AContentParams, AHeaderParams: TdxReportItemViewParams); virtual; + + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + + property ColWidth: Integer read FColWidth; + property DayCaptionsHeight: Integer read FDayCaptionsHeight; + property HeaderHeight: Integer read FHeaderHeight; + property MonthSize: TSize read FMonthSize; + property RowHeight: Integer read FRowHeight; + property ContentParams: TdxReportItemViewParams read FContentParams; + property HeaderParams: TdxReportItemViewParams read FHeaderParams; + public + constructor Create(AParent: TdxReportCell); override; + constructor CreateEx(AParent: TdxReportCell; AFirstWeekOfYear: TcxFirstWeekOfYear; + AYear, AMonth: Word; AShowDatesContainingEventsInBold, AShowWeekNumbers: Boolean); virtual; + + procedure AdjustSize(var AContentParams, AHeaderParams: TdxReportItemViewParams; AHeight, AMaxHeight: Integer); virtual; + function CalculateSize(const AContentParams, AHeaderParams: TdxReportItemViewParams): TSize; + class function MeasureDateNavigatorHeight(const AContentParams, AHeaderParams: TcxViewParams): Integer; virtual; + + property FirstWeekOfYear: TcxFirstWeekOfYear read FFirstWeekOfYear write FFirstWeekOfYear; + property Month: Word read FMonth write FMonth; + property ShowDatesContainingEventsInBold: Boolean read FShowDatesContainingEventsInBold write FShowDatesContainingEventsInBold; + property ShowWeekNumbers: Boolean read FShowWeekNumbers write FShowWeekNumbers; + property StartOfWeek: TDay read FStartOfWeek; + property Year: Word read FYear write FYear; + + // Helpers + property DayCaptionCount: Integer read FDayCaptionCount; + property DayCaptions[Index: Integer]: TcxSchedulerReportDateNavigatorDayCaption read GetDayCaption; + property DayCount: Integer read FDayCount; + property Days[Index: Integer]: TcxSchedulerReportDateNavigatorDay read GetDay; + property Header: TcxSchedulerReportDateNavigatorHeader read GetHeader; + property WeekNumberCount: Integer read FWeekNumberCount; + property WeekNumbers[Index: Integer]: TcxSchedulerReportDateNavigatorWeekNumber read GetWeekNumber; + end; + + { TcxSchedulerReportSchedulingAreaCell } + + TcxSchedulerReportSchedulingAreaCell = class(TcxSchedulerReportPageItemCell) + private + FVisibleDays: TcxSchedulerDateList; + FDaysList: TStringList; + protected + function GetType: TcxSchedulerReportItemsType; override; + property VisibleDays: TcxSchedulerDateList read FVisibleDays; + public + constructor Create(AParent: TdxReportCell); override; + destructor Destroy; override; + procedure DrawContent(DC: HDC; DrawRect: TRect; const OriginRect: TRect; AStage: TdxPSRenderStages); override; + procedure DrawItself(DC: HDC; AStage: TdxPSRenderStages); override; + end; + + TcxSchedulerReportCustomCell = class(TAbstractdxReportCellData) + private + function GetReportLink: TcxSchedulerReportLink; + protected + FDateTime: TDateTime; + FDayBorderColor: TColor; + FNoClip: Boolean; + procedure DrawCellFrame(DC: HDC; const ARect: TRect; ABorders: TcxBorders = []; + ABorderColor: TColor = clDefault; ALineWidth: Integer = 1); + procedure DrawCellRect(DC: HDC; const ARect: TRect; ABorders: TcxBorders = []; + ABorderColor: TColor = clDefault; ALineWidth: Integer = 1; AColor: TColor = clDefault); + procedure DrawCellText(DC: HDC; const ARect: TRect; const AText: string; AlignHorz: TdxTextAlignX; + AlignVert: TdxTextAlignY; AFont: TFont = nil; AColor: TColor = clDefault; AMultiLine: Boolean = False); + procedure DrawCellTextVert(DC: HDC; const ARect: TRect; const AText: string; + AlignHorz: TdxTextAlignX; AlignVert: TdxTextAlignY; AFont: TFont = nil; AMultiLine: Boolean = True); + procedure DrawCellState(DC: HDC; R: TRect; + AState: Integer; ABorders: TcxBorders = []; ABorderColor: TColor = clBlack); + + function AdjustTextRect(const ARect: TRect): TRect; + function ExcludeBorders(const ARect: TRect; ABorders: TcxBorders; ABorderWidth: Integer = 1): TRect; + function FixupWidth(AWidth: Integer): Integer; + function GetFixupRect(DC: HDC; const ARect: TRect): TRect; + function InflateRect(const ARect: TRect; dX, dY: Integer): TRect; + + property ReportLink: TcxSchedulerReportLink read GetReportLink; + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); virtual; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + class procedure RegisterMirrorClass; virtual; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; virtual; + procedure SuppressColoration; virtual; + end; + + { TcxSchedulerReportContentCell } + + TcxSchedulerReportContentCell = class(TcxSchedulerReportCustomCell) + protected + FBorderColor: TColor; + FShowTimeLine: Boolean; +// FSmallFont: Boolean; + FState: Integer; + FTimeLineBorders: TcxBorders; + function HasBorderColoration: Boolean; override; + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + procedure Assign(Source: TPersistent); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + procedure SuppressColoration; override; + end; + + { TcxSchedulerReportHeaderItemCell } + + TcxSchedulerReportHeaderItemCell = class(TcxSchedulerReportCustomCell) + private + FCaption: string; + FDate: TDateTime; + FIsResourceHeader: Boolean; + FResourceID: Variant; + FRotateText: Boolean; + //support images + FImageIndex: Integer; + FImages: TCustomImageList; + FImageRect: TRect; + FTextRect: TRect; + function GetTextAlignX: TdxTextAlignX; + function GetTextAlignY: TdxTextAlignY; + procedure SetTextAlignX(Value: TdxTextAlignX); + procedure SetTextAlignY(Value: TdxTextAlignY); + protected + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); override; + function HasImage: Boolean; virtual; + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + procedure Assign(Source: TPersistent); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + procedure DrawImage(DC: HDC); + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + property TextAlignX: TdxTextAlignX read GetTextAlignX write SetTextAlignX; + property TextAlignY: TdxTextAlignY read GetTextAlignY write SetTextAlignY; + + property TextRect: TRect read FTextRect; + property Caption: string read FCaption write FCaption; + property Date: TDateTime read FDate; + property ImageIndex: Integer read FImageIndex; + property ImageRect: TRect read FImageRect; + property Images: TCustomImageList read FImages; + property IsResourceHeader: Boolean read FIsResourceHeader; + property ResourceID: Variant read FResourceID; + property RotateText: Boolean read FRotateText; + end; + + { TcxSchedulerReportGroupSeparatorCell } + + TcxSchedulerReportGroupSeparatorCell = class(TcxSchedulerReportCustomCell) + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + end; + + { TcxSchedulerReportContainerCell } + + TcxSchedulerReportContainerCell = class(TcxSchedulerReportCustomCell) + public + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + end; + + { TcxSchedulerReportTextCell } + + TcxSchedulerReportTextCell = class(TcxSchedulerReportCustomCell) + protected + FDisplayText: string; + FTextRect: TRect; + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); override; + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + + property DisplayText: string read FDisplayText write FDisplayText; + property TextRect: TRect read FTextRect write FTextRect; + end; + + { TcxSchedulerReportBackgroundSlotCell } + + TcxSchedulerReportBackgroundSlotCell = class(TcxSchedulerReportTextCell) + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + end; + + { TcxSchedulerReportTimeLineMinorScaleCell } + + TcxSchedulerReportTimeLineMinorScaleCell = class(TcxSchedulerReportBackgroundSlotCell) + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + end; + + { TcxSchedulerReportTimeLineMajorScaleCell } + + TcxSchedulerReportTimeLineMajorScaleCell = class(TcxSchedulerReportBackgroundSlotCell) + public + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + end; + + { TcxSchedulerReportDailyTimeRulerCellsSite } + + TcxSchedulerReportDailyTimeRulerCellsSite = class(TdxReportCell) + private + FLargeFont: TFont; + FLargeFontIndex: Integer; + function GetLargeFont: TFont; + protected + procedure SetFontIndex(Index: Integer); override; + procedure ReadProperties(AReader: TdxPSDataReader); override; + procedure WriteProperties(AWriter: TdxPSDataWriter); override; + public + constructor Create(AParent: TdxReportCell); override; + destructor Destroy; override; + property LargeFont: TFont read GetLargeFont; + end; + + { TcxSchedulerReportDailyTimeRulerCell } + + TcxSchedulerReportDailyTimeRulerCell = class(TcxSchedulerReportCustomCell) + private + function GetBoundsRect(AType: Boolean): TRect; + function GetDisplayText(AType: Boolean): string; + function GetLargeFont: TFont; + function GetTimeRulerSite: TcxSchedulerReportDailyTimeRulerCellsSite; + protected + FBounds: array[Boolean] of TRect; + FDisplayTexts: array[Boolean] of string; + FHasAdditionalTimeZone: Boolean; + FHour: Integer; + FLineColor: TColor; + FLineCount: Integer; + FShowMinutes: Boolean; + procedure CalculateDisplayInfo; + procedure DrawTimeZone(DC: HDC; const ABounds: TRect; const AText: string; AIsCurrent: Boolean); virtual; + procedure DrawTimeZoneLabel(DC: HDC; const ABounds: TRect; const AText: string; ABorders: TcxBorders); virtual; + + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + + property LargeFont: TFont read GetLargeFont; + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + procedure Assign(Source: TPersistent); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + procedure SuppressColoration; override; + + property Bounds[ACurrentTimeZone: Boolean]: TRect read GetBoundsRect; + property DisplayTexts[ACurrentTimeZone: Boolean]: string read GetDisplayText; + property HasAdditionalTimeZone: Boolean read FHasAdditionalTimeZone; + property Hour: Integer read FHour; + property LineCount: Integer read FLineCount; + property ShowMinutes: Boolean read FShowMinutes; + property TimeRulerSite: TcxSchedulerReportDailyTimeRulerCellsSite read GetTimeRulerSite; + end; + + { TcxSchedulerReportMonthDayCell } + + TcxSchedulerReportMonthDayCell = class(TcxSchedulerReportContentCell) + private + FSmallFont: Boolean; + FDisplayText: string; + FDontPrint: Boolean; + protected + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + procedure Assign(Source: TPersistent); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + property DisplayText: string read FDisplayText write FDisplayText; + property SmallFont: Boolean read FSmallFont write FSmallFont; + end; + + { TcxSchedulerReportTimeLinePart} + + TcxSchedulerReportTimeLinePart = class(TdxReportCellBox) + private + FState: Integer; + FTriangle: Boolean; + protected + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + property State: Integer read FState write FState; + public + constructor CreateEx(AParent: TdxReportCell; ATriangle: Boolean; AState: Integer); + procedure Assign(Source: TPersistent); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + end; + + { TcxSchedulerReportTimeLineCell } + + TcxSchedulerReportTimeLineCell = class(TdxReportCell) + private + FCurrentValue: TAbstractdxReportCellData; + public + constructor Create(AParent: TdxReportCell); override; + procedure SetTimeRect(const ABounds: TRect; AState: Integer); + end; + + TcxSchedulerReportCellString = class(TdxReportCellString) + protected + function GetDefaultDTFormat: DWORD; override; + end; + + { TcxSchedulerReportCustomEventCell } + + TcxSchedulerReportCustomEventCell = class(TdxReportCell) + private + function GetPrintStyle: TcxCustomSchedulerReportLinkPrintStyle; + function GetReportLink: TcxSchedulerReportLink; + function GetSuppressColoration: Boolean; + protected + FCaptionCell: TdxReportCellString; + FMessageCell: TAbstractdxReportCellData; + FStartCell: TdxReportCellString; + FFinishCell: TdxReportCellString; + FTimeLineCell: TcxSchedulerReportTimeLineCell; + procedure SetViewParams(const AViewParams: TcxViewParams); virtual; + public + function CreateStringCell(const AText: string; AMultiline: Boolean = True; AData: Integer = 0): TdxReportCellString; virtual; + + property CaptionCell: TdxReportCellString read FCaptionCell; + property StartCell: TdxReportCellString read FStartCell; + property FinishCell: TdxReportCellString read FFinishCell; + property MessageCell: TAbstractdxReportCellData read FMessageCell; + property PrintStyle: TcxCustomSchedulerReportLinkPrintStyle read GetPrintStyle; + property ReportLink: TcxSchedulerReportLink read GetReportLink; + property TimeLineCell: TcxSchedulerReportTimeLineCell read FTimeLineCell; + property SuppressColoration: Boolean read GetSuppressColoration; + end; + + { TcxSchedulerReportEventCell } + + TcxSchedulerReportEventCell = class(TcxSchedulerReportCustomEventCell) + private + FCaptionLeft: Integer; + FContentBounds: TRect; + FEditViewInfo: TcxCustomEditViewInfo; + FEventViewInfo: TcxSchedulerEventCellViewInfo; + FHasDetailInfo: Boolean; + FHasImages: Boolean; + FHasMessage: Boolean; + FIsHeaderEvent: Boolean; + FIsNeedCreateTimeCells: Boolean; + FMessage: Variant; + FOrigin: TPoint; + procedure CheckBounds(var ABounds: TRect); + function GetEvent: TcxSchedulerControlEvent; + protected + procedure AdjustItemsHeight(DC: HDC); virtual; + procedure CalculateLayout; virtual; + procedure CalculateTimeLine(DC: HDC); virtual; + function CreateCaptionCell: TdxReportCellString; virtual; + procedure CreateDataItems; virtual; + procedure CreateEventImageCells; virtual; + procedure CreateMessageCell(AMessage: Variant; + AProperties: TcxCustomEditProperties; AViewParams: TcxViewParams); + function CreateTimeLineCell: TcxSchedulerReportTimeLineCell; virtual; + function CreateTimeTextCell(const ATimeText: string; AData: Integer = 0): TdxReportCellString; virtual; + function GetCaptionRect(DC: HDC): TRect; virtual; + function GetContentBounds(DC: HDC): TRect; virtual; + function GetHasImages: Boolean; virtual; + function GetHasMessage: Boolean; virtual; + function GetMessageClass(AProperties: TcxCustomEditProperties): TdxReportCellDataClass; virtual; + function GetMessageRect(DC: HDC): TRect; virtual; + function GetRelativeRect(const R: TRect): TRect; + function GetTimeLineRect(DC: HDC): TRect; virtual; + procedure InitializeFromViewInfo(AEventViewInfo: TcxSchedulerEventCellViewInfo); + procedure SetViewParams(const AViewParams: TcxViewParams); override; + + property ContentBounds: TRect read FContentBounds; + property Event: TcxSchedulerControlEvent read GetEvent; + property EventViewInfo: TcxSchedulerEventCellViewInfo read FEventViewInfo; + property HasDetailInfo: Boolean read FHasDetailInfo; + property HasImages: Boolean read FHasImages; + property IsHeaderEvent: Boolean read FIsHeaderEvent; + property IsNeedCreateTimeCells: Boolean read FIsNeedCreateTimeCells; + public + constructor CreateFrom(AParent: TdxReportCell; AEventViewInfo: TcxSchedulerEventCellViewInfo); virtual; + + property CaptionCell: TdxReportCellString read FCaptionCell; + property HasMessage: Boolean read FHasMessage; + property Message: Variant read FMessage; + property MessageCell; + property TimeLineCell; + property StartCell; + property FinishCell; + end; + + { TcxSchedulerReportDetailsEventCell } + + TcxSchedulerReportDetailsEventCell = class(TcxSchedulerReportCustomEventCell) + protected + FContinued: Boolean; + FDate: TDateTime; + + FEvent: TcxSchedulerEvent; + FLineHeight: Integer; + procedure CreateCaptionCell; virtual; + procedure CreateDataItems; virtual; + procedure CreateMessageCell; virtual; + procedure CreateTimeCell; virtual; + function GetCaptionCellText: string; virtual; + function GetMessageCellText: string; virtual; + function GetTimeCellText: string; virtual; + procedure SetViewParams(const AViewParams: TcxViewParams); override; + public + constructor CreateEx(AParent: TdxReportCell; AEvent: TcxSchedulerEvent; + ADate: TDateTime; const AParams: TcxViewParams; AContinued: Boolean = False); + function CalculateHeight: Integer; virtual; + procedure CalculateLayout(AWidth, ATimeWidth: Integer); virtual; + + property Date: TDateTime read FDate; + property Event: TcxSchedulerEvent read FEvent; + property Continued: Boolean read FContinued; + end; + + { TcxSchedulerReportMemoEventCell } + + TcxSchedulerReportMemoEventCell = class(TcxSchedulerReportDetailsEventCell) + protected + FCaptionLabelCell: TdxReportCellString; + FHeaderCell: TdxReportCellString; + FLocationCell: TdxReportCellString; + FLocationLabelCell: TdxReportCellString; + FShowTimeAsCell: TdxReportCellString; + FShowTimeAsLabelCell: TdxReportCellString; + FStartLabelCell: TdxReportCellString; + FFinishLabelCell: TdxReportCellString; + FRecurrenceCell: TdxReportCellString; + FRecurrenceLabelCell: TdxReportCellString; + FRecurrencePatternCell: TdxReportCellString; + FRecurrencePatternLabelCell: TdxReportCellString; + procedure CreateDataItems; override; + function GetCaptionCellText: string; override; + function GetMessageCellText: string; override; + function GetTimeCellText: string; override; + procedure SetViewParams(const AViewParams: TcxViewParams); override; + + procedure CalculateLabelAndData(ALabelCell, ADataCell: TAbstractdxReportCellData; + DC: HDC; ATimeWidth, AWidth: Integer; var ATop: Integer); virtual; + procedure CreateHeader; virtual; + procedure CreateFinish; virtual; + procedure CreateFinishCell; virtual; + procedure CreateFinishLabelCell; virtual; + procedure CreateLocation; virtual; + procedure CreateLocationCell; virtual; + procedure CreateLocationLabelCell; virtual; + procedure CreateMessage; virtual; + procedure CreateRecurrence; virtual; + procedure CreateRecurrenceCell; virtual; + procedure CreateRecurrenceLabelCell; virtual; + procedure CreateRecurrencePattern; virtual; + procedure CreateRecurrencePatternCell; virtual; + procedure CreateRecurrencePatternLabelCell; virtual; + procedure CreateShowTimeAs; virtual; + procedure CreateShowTimeAsCell; virtual; + procedure CreateShowTimeAsLabelCell; virtual; + procedure CreateStart; virtual; + procedure CreateStartLabelCell; virtual; + procedure CreateSubject; virtual; + procedure CreateSubjectLabelCell; virtual; + function GetHeaderCellText: string; virtual; + function GetRecurrenceCellText: string; virtual; + function GetRecurrencePatternCellText: string; virtual; + function GetShowTimeAsCellText: string; virtual; + public + procedure CalculateLayout(AWidth, ATimeWidth: Integer); override; + + property CaptionLabelCell: TdxReportCellString read FCaptionLabelCell; + property HeaderCell: TdxReportCellString read FHeaderCell; + property LocationCell: TdxReportCellString read FLocationCell; + property LocationLabelCell: TdxReportCellString read FLocationLabelCell; + property ShowTimeAsCell: TdxReportCellString read FShowTimeAsCell; + property ShowTimeAsLabelCell: TdxReportCellString read FShowTimeAsLabelCell; + property StartLabelCell: TdxReportCellString read FStartLabelCell; + property FinishLabelCell: TdxReportCellString read FFinishLabelCell; + property RecurrenceCell: TdxReportCellString read FRecurrenceCell; + property RecurrenceLabelCell: TdxReportCellString read FRecurrenceLabelCell; + property RecurrencePatternCell: TdxReportCellString read FRecurrencePatternCell; + property RecurrencePatternLabelCell: TdxReportCellString read FRecurrencePatternLabelCell; + end; + + { TcxSchedulerReportGanttLinkCell } + + TcxSchedulerReportGanttLinkCell = class(TcxSchedulerReportCustomCell) + protected + FArrowDirection: TcxArrowDirection; + FArrowRect: TRect; + FLines: TcxSchedulerGanttViewLinkLines; + procedure AssignInfo(const ALines: TcxSchedulerGanttViewLinkLines; + AArrowDirection: TcxArrowDirection; const AArrowRect: TRect); + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); override; + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + procedure Assign(Source: TPersistent); override; + procedure DrawArrow(DC: HDC; const ABounds: TRect); + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + + property ArrowDirection: TcxArrowDirection read FArrowDirection; + property ArrowRect: TRect read FArrowRect; + property Lines: TcxSchedulerGanttViewLinkLines read FLines; + end; + + { TcxSchedulerReportCommonCellsProducer } + + TcxSchedulerReportCommonCellsProducer = class(TcxCustomResourceViewAdapter) + private + FSite: TcxSchedulerReportSchedulingAreaCell; + FStyle: TcxCustomSchedulerReportLinkPrintStyle; + function GetStyles: TcxSchedulerReportLinkStyles; + protected + FBounds: TRect; + + procedure AfterCalculatePage; override; + function CanCalculate: Boolean; override; + procedure ConvertSchedulerCellToPSCells(AItem: TcxSchedulerCustomViewInfoItem; + AReportItemClass: TcxSchedulerReportCustomCellClass); virtual; + function CreateEventCell(AEventViewInfo: TcxSchedulerEventCellViewInfo): TcxSchedulerReportEventCell; virtual; + procedure DoInitialize( + var ASelectedDays: TcxSchedulerDateList; var AEvents: TcxSchedulerCachedEventList); override; + // layout settings + function GetCompressWeekends: Boolean; override; + function GetDontPrintWeekEnds: Boolean; override; + function GetHideSelection: Boolean; override; + function GetIsPrinting: Boolean; override; + function GetPageBounds: TRect; override; + function GetPagesPerWeek: Byte; override; + function GetPrintExactlyOneMonth: Boolean; override; + function GetPrintRange(Index: Integer): TDateTime; override; + function GetPrimaryPage: Boolean; override; + function GetStylesAdapter: IcxSchedulerStylesAdapter; override; + // styles + procedure SetCellViewParams(ACell: TdxReportVisualItem; const AParams: TcxViewParams); virtual; + public + constructor CreateEx(AStyle: TcxCustomSchedulerReportLinkPrintStyle; + ASite: TcxSchedulerReportSchedulingAreaCell); virtual; + procedure GetPageResources(AResources: TcxObjectList); override; + procedure Produce; virtual; + property Site: TcxSchedulerReportSchedulingAreaCell read FSite; + property Style: TcxCustomSchedulerReportLinkPrintStyle read FStyle; + property Styles: TcxSchedulerReportLinkStyles read GetStyles; + end; + + TcxSchedulerReportCommonCellsProducerClass = class of TcxSchedulerReportCommonCellsProducer; + + { TcxSchedulerReportWeeksCellsProducer } + + TcxSchedulerReportWeeksCellsProducer = class(TcxSchedulerReportCommonCellsProducer) + + end; + + { TcxSchedulerReportDailyCellsProducer } + + TcxSchedulerReportDailyCellsProducer = class(TcxSchedulerReportCommonCellsProducer) + private + FRulerSite: TcxSchedulerReportDailyTimeRulerCellsSite; + protected + procedure AfterCalculatePage; override; + procedure BeforeCalculatePage; override; + + function CreateTimeRulerSite: TcxSchedulerReportDailyTimeRulerCellsSite; virtual; + procedure ConvertSchedulerCellToPSCells(AItem: TcxSchedulerCustomViewInfoItem; + AReportItemClass: TcxSchedulerReportCustomCellClass); override; + end; + + { TcxSchedulerReportYearlyCellsProducer } + + TcxSchedulerReportYearlyCellsProducer = class(TcxSchedulerReportCommonCellsProducer, IcxSchedulerYearViewAdapter) + private + function GetIsPrimaryPage: Boolean; + function GetStyle: TcxSchedulerReportLinkYearlyPrintStyle; + protected + FFirstMonth: Integer; + { IcxSchedulerYearViewAdapter } + function GetDayCountPerPage: Integer; virtual; + function GetMonthCount: Integer; virtual; + function GetFirstMonth: Integer; virtual; + function GetShowMonthHeaders: Boolean; virtual; + function GetShowWeekDayHeaders: Boolean; virtual; + function GetStartDayIndex: Integer; virtual; + + property IsPrimaryPage: Boolean read GetIsPrimaryPage; + property Style: TcxSchedulerReportLinkYearlyPrintStyle read GetStyle; + public + procedure Produce; override; + end; + + { TcxSchedulerReportTimeLineLayoutBuilder } + + TcxTimeLinePageInfo = class + public + PageResources: TList; + ContentBounds: TRect; + Finish: TDateTime; + Headers: Boolean; + LineStart: Integer; + PageBounds: TRect; + Scales: Boolean; + Start: TDateTime; + + constructor Create; virtual; + destructor Destroy; override; + end; + + TcxSchedulerReportTimeLineLayoutBuilder = class(TcxSchedulerTimeGridViewAdapter) + private + FColCount: Integer; + FCurrentPageIndex: Integer; + FPagesInfo: TcxObjectList; + FRowCount: Integer; + FStyle: TcxSchedulerReportLinkTimeLinePrintStyle; + function GetPageCount: Integer; + function GetPageInfo(Index: Integer): TcxTimeLinePageInfo; + function GetViewInfo: TcxSchedulerTimeGridViewViewInfo; + public + function AddPageInfo(ARow, AColumn: Integer; const AStart, AFinish: TDateTime): TcxTimeLinePageInfo; + procedure AddRow(AStartIndex, AFinishIndex, AStartLine: Integer); + procedure AfterCalculatePage; override; + procedure CalculateTimeRanges; + procedure CalculatePagination; + function CanCalculate: Boolean; override; + // layout settings + function GetActualStart: TDateTime; override; + function GetActualFinish: TDateTime; override; + function GetDontPrintWeekEnds: Boolean; override; + function GetHideSelection: Boolean; override; + function GetIsPrinting: Boolean; override; + function GetPageBounds: TRect; override; + function GetPageContentBounds(ARow, AColumn: Integer): TRect; + function GetPageLineCount(ARow: Integer): Integer; + function GetPrintRange(Index: Integer): TDateTime; override; + function GetStylesAdapter: IcxSchedulerStylesAdapter; override; + public + constructor CreateEx(AStyle: TcxSchedulerReportLinkTimeLinePrintStyle); virtual; + destructor Destroy; override; + procedure CalculateLayout; + procedure GetPageResources(AResources: TcxObjectList); override; + + property ColCount: Integer read FColCount; + property PageCount: Integer read GetPageCount; + property PageInfo[Index: Integer]: TcxTimeLinePageInfo read GetPageInfo; + property RowCount: Integer read FRowCount; + property Style: TcxSchedulerReportLinkTimeLinePrintStyle read FStyle; + property ViewInfo: TcxSchedulerTimeGridViewViewInfo read GetViewInfo; + end; + + { TcxSchedulerReportTimeLineCellsProducer } + + TcxSchedulerReportTimeLineCellsProducer = class(TcxSchedulerReportCommonCellsProducer, IcxSchedulerTimeGridViewAdapter) + private + function GetPageIndex: Integer; + function GetPageInfo: TcxTimeLinePageInfo; + function GetStyle: TcxSchedulerReportLinkTimeLinePrintStyle; + protected + function CreateEventCell(AEventViewInfo: TcxSchedulerEventCellViewInfo): TcxSchedulerReportEventCell; override; + function GetActualStart: TDateTime; override; + function GetActualFinish: TDateTime; override; + function GetLineOffset: Integer; virtual; + function GetPrintRange(Index: Integer): TDateTime; override; + function GetShowLinks: Boolean; + function GetShowResourceHeaders: Boolean; + function GetShowScales: Boolean; + function GetWorkDaysOnly: Boolean; + function GetWorkTimeOnly: Boolean; + public + procedure GetPageResources(AResources: TcxObjectList); override; + + property PageIndex: Integer read GetPageIndex; + property PageInfo: TcxTimeLinePageInfo read GetPageInfo; + property Style: TcxSchedulerReportLinkTimeLinePrintStyle read GetStyle; + end; + +var + SpecialSymbolFont: TFont; + +implementation + +{$R *.dfm} +{$R dxPScxScheduler3Lnk.res} + +uses + Messages, ShlObj, dxPSUtl, dxPSRes, dxPSPopupMan, Math, +{$IFDEF DELPHI6} + DateUtils, Types, +{$ENDIF} + ActiveX, CommCtrl, dxPSTextOut; + +const + IDB_DXPSSCHEDULER_STYLEDESIGNPREVIEW = 'IDB_DXPSSCHEDULER_STYLEDESIGNPREVIEW'; + IDB_DXPSSCHEDULER_SMALLDESIGNPREVIEW = 'IDB_DXPSSCHEDULER_SMALLDESIGNPREVIEW'; + dxFormatShowDaysWithEventsInBold = dxPSGlbl.dxFormatCheckEnabled; + dxFormatDayIsBold = dxPSGlbl.dxFormatCheckChecked; + + cxYearStyleDaysOnPrimaryPage = 18; + +type + TLongRec = packed record + Bytes: array [0..3] of Byte; + end; + + TControlAccess = class(TControl); + TcxSchedulerCachedEventListAccess = class(TcxSchedulerCachedEventList); + TcxSchedulerTimeGridViewAccess = class(TcxSchedulerTimeGridView); + +var + MirrorClasses: TList; + StyleImages: TImageList; + SchedulerFontHandle: THandle; + SchedulerFontFileName: string; + StylePreviewImages: TImageList; + StyleSheetPrototype: TcxSchedulerReportLinkStyleSheet; + +procedure ConvertRect(var R: TRect; APixelsNumerator, APixelsDenominator: Integer); +begin + with R do + begin + Left := MulDiv(Left, APixelsNumerator, APixelsDenominator); + Right := MulDiv(Right, APixelsNumerator, APixelsDenominator); + Top := MulDiv(Top, APixelsNumerator, APixelsDenominator); + Bottom := MulDiv(Bottom, APixelsNumerator, APixelsDenominator); + end; +end; + +function cxCompareEventsOrder( + AEvent1, AEvent2: TcxSchedulerControlEvent): Integer; +var + AAllDay1, AAllDay2: Boolean; +begin + Result := 0; + AAllDay1 := AEvent1.AllDayEvent or (AEvent1.Duration >= 1); + AAllDay2 := AEvent2.AllDayEvent or (AEvent2.Duration >= 1); + if DateOf(AEvent1.Start) = DateOf(AEvent2.Start) then + Result := Byte(AAllDay2) - Byte(AAllDay1); + if Result <> 0 then Exit; + if AEvent1.Start < AEvent2.Start then + Result := -1 + else + if AEvent1.Start > AEvent2.Start then + Result := 1 + else + if AEvent1.Finish > AEvent2.Finish then + Result := -1 + else + if AEvent1.Finish < AEvent2.Finish then + Result := 1 + else + if AEvent1.RecordIndex < AEvent2.RecordIndex then + Result := -1 + else + if AEvent1.RecordIndex > AEvent2.RecordIndex then + Result := 1 + else + Result := 0; +end; + +{$IFNDEF DELPHI6} +function StartOfTheDay(const AValue: TDateTime): TDateTime; +begin + Result := Trunc(AValue); +end; + +function EndOfTheDay(const AValue: TDateTime): TDateTime; +begin + Result := Trunc(AValue) + EncodeTime(23, 59, 59, 999); +end; + +function StartOfTheWeek(const AValue: TDateTime): TDateTime; +begin + Result := Trunc(AValue) - (DayOfTheWeek(AValue) - 1); +end; + +function EndOfTheWeek(const AValue: TDateTime): TDateTime; +begin + Result := EndOfTheDay(StartOfTheWeek(AValue) + 6); +end; + +{$ENDIF} + +procedure Rect2RectsVert(const ASource: TRect; var R1, R2: TRect); overload; +begin + R1 := ASource; + R2 := ASource; + R1.Bottom := (ASource.Bottom + ASource.Top - InterAreaSpace) div 2; + R2.Top := R1.Bottom + InterAreaSpace; +end; + +procedure Rect2RectsVert(const ASource: TRect; var R1, R2, R3: TRect); overload; +var + H: Integer; +begin + R1 := ASource; + R2 := ASource; + R3 := ASource; + H := ASource.Bottom - ASource.Top; + R1.Bottom := ASource.Top + MulDiv(H, 1, 3); + R2.Top := R1.Bottom + InterAreaSpace; + R2.Bottom := ASource.Top + MulDiv(H, 2, 3); + R3.Top := R2.Bottom + InterAreaSpace; +end; + +procedure Rect2RectsHorz(const ASource: TRect; var R1, R2: TRect); overload; +begin + R1 := ASource; + R2 := ASource; + R1.Right := (ASource.Left + ASource.Right - InterAreaSpace) div 2; + R2.Left := R1.Right + InterAreaSpace; +end; + +procedure Rect2RectsHorz(const ASource: TRect; var R1, R2, R3: TRect); overload; +var + W: Integer; +begin + R1 := ASource; + R2 := ASource; + R3 := ASource; + W := ASource.Right - ASource.Left; + R1.Right := ASource.Left + MulDiv(W, 1, 3); + R2.Left := R1.Right + InterAreaSpace; + R2.Right := ASource.Left + MulDiv(W, 2, 3); + R3.Left := R2.Right + InterAreaSpace; +end; + +function AdditionalWidth(const ABounds: TRect): Integer; +begin + with ABounds do + Result := Round((Right - Left) * NotesAreaWidth) - InterAreaSpace div 2; +end; + +procedure SplitToRects(const ASource: TRect; AShowCalendar, + AIsRightArea: Boolean; out R1, R2: TRect); +begin + R1 := ASource; + R2 := ASource; + if AShowCalendar then + begin + if AIsRightArea then + begin + R2.Left := R2.Right - AdditionalWidth(R1); + R1.Right := R2.Left - InterAreaSpace; + end + else + begin + R2.Right := R2.Left + AdditionalWidth(R1); + R1.Left := R2.Right + InterAreaSpace; + end; + end; +end; + +function SchedulerLinkStyleSheetPrototype: TcxSchedulerReportLinkStyleSheet; + + function CreateStyle(AColor, AFontColor: TColor): TcxStyle; + begin + Result := TcxStyle.Create(StyleSheetPrototype); + with Result do + begin + Color := AColor; + Font.Name := dxPSCore.dxPSDefaultFontName; + Font.Color := AFontColor; + end; + end; + +begin + if StyleSheetPrototype = nil then + begin + StyleSheetPrototype := TcxSchedulerReportLinkStyleSheet.Create(nil); + with StyleSheetPrototype.Styles as TcxSchedulerReportLinkStyles do + begin + SchedulerHeader := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + Content := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + DateNavigatorContent := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + DateNavigatorHeader := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + DayHeader := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Event := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + ResourceHeader := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + NotesAreaBlank := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + NotesAreaLined := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + TaskPad := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + TimeRuler := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + end; + end; + Result := StyleSheetPrototype; +end; + +function FindMirorClassForItem(AItem: TObject; + var APSItemClass: TcxSchedulerReportCustomCellClass): Boolean; +var + I: Integer; +begin + APSItemClass := nil; + Result := False; + for I := MirrorClasses.Count - 1 downto 0 do + begin + APSItemClass := MirrorClasses[I]; +// 'TcxSchedulerTimeGridMinorScaleCell' + if AItem.InheritsFrom(APSItemClass.SchedulerCellClass) then + begin + Result := True; + Break; + end; + end; +end; + +{ TcxSchedulerReportLinkRenderInfo } + +procedure TcxSchedulerReportLinkRenderInfo.DoCalculate; +var + I: Integer; +begin + if not IsLoading then + begin + if (ReportLink <> nil) and (ReportLink.PrintStyles.ActiveStyle <> nil) then + begin + FPageColCount := Byte(ReportLink.PrintStyles.ActiveStyle.Layout) + 1; + FPageRowCount := ReportLink.PageSites.Count; + end + else + begin + FPageColCount := 1; + FPageRowCount := 1; + end; + end; + if (ReportLink = nil) or (ReportLink.ReportCells <> nil) and (ReportLink.ReportCells.Count > 0) then + begin + inherited DoCalculate; + for I := 0 to PageRenderInfoCount - 1 do + with PageRenderInfos[I] do + TitleOffset := DataOffset; + end; +end; + +function TcxSchedulerReportLinkRenderInfo.GetPageColCount: Integer; +begin + if not IsLoading then + Result := 1//FPageColCount + else + Result := inherited GetPageColCount; +end; + +function TcxSchedulerReportLinkRenderInfo.GetPageRowCount: Integer; +begin + if not IsLoading then + Result := FPageRowCount + else + Result := inherited GetPageRowCount; +end; + +function TcxSchedulerReportLinkRenderInfo.IsLoading: Boolean; +begin + Result := ReportLink.DataSource = rldsExternalStorage; +end; + +function TcxSchedulerReportLinkRenderInfo.IsDrawPageTitleOnPage( + APageIndex: Integer): Boolean; +begin + Result := Rendering and IsDrawReportTitleOnPage(APageIndex); +end; + +function TcxSchedulerReportLinkRenderInfo.IsDrawReportTitleOnPage( + APageIndex: Integer): Boolean; +begin + case ReportLink.ReportTitleMode of + tmNone: + Result := False; + tmOnFirstPage: + Result := APageIndex = 0; + else + Result := APageIndex mod FPageColCount = 0; + end; +end; + +function TcxSchedulerReportLinkRenderInfo.GetReportLink: TcxSchedulerReportLink; +begin + Result := TcxSchedulerReportLink(inherited ReportLink); +end; + +{ TcxSchedulerReportRenderer } + +procedure TcxSchedulerReportRenderer.PrepareRenderPage; +begin + inherited PrepareRenderPage; + TcxSchedulerReportLinkRenderInfo(RenderInfo).Rendering := True; +end; + +procedure TcxSchedulerReportRenderer.UnprepareRenderPage; +begin + TcxSchedulerReportLinkRenderInfo(RenderInfo).Rendering := False; + inherited UnprepareRenderPage; +end; + +{ TcxSchedulerReportLink } + +constructor TcxSchedulerReportLink.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FPageSites := TList.Create; + FLookAndFeelItems := TList.Create; + FSupportImages := True; +end; + +destructor TcxSchedulerReportLink.Destroy; +begin + FreeAndNil(FPageSites); + FreeAndNil(FLookAndFeelItems); + inherited Destroy; +end; + +procedure TcxSchedulerReportLink.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLink then + with TcxSchedulerReportLink(Source) do + begin + Self.PrintRange := PrintRange; + Self.PrintStyles := PrintStyles; + end; + inherited; +end; + +class function TcxSchedulerReportLink.Aggregable: Boolean; +begin + Result := False; +end; + +procedure TcxSchedulerReportLink.LoadDataFromStream(AStream: TStream); +const + SupportImagesVersion: TdxPSVersion = (Major: 3; Minor: 5; SubMinor: 5); +var + AStorageInfo: TdxPSDataStorageInfo; +begin + if PossibleDataStorage(AStream, True) then + begin + CopyDataStreamFrom(AStream); + AStorageInfo := ExtractStorageInfo(DataStream); + if AStorageInfo <> nil then + begin + FSupportImages := ComparePSVersions(AStorageInfo.PrintingSystemVersion, SupportImagesVersion) >= 0; + AStorageInfo.Free; + end; + DataStream.Position := 0; + if DataSource <> rldsExternalStorage then + DataSource := rldsExternalStorage + else + if IsRebuildNeededAndAllowed(True) then + RebuildReport; + end; +end; + +procedure TcxSchedulerReportLink.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited; + if (TaskPadReportLink = AComponent) and (Operation = opRemove) then + TaskPadReportLink := nil; +end; + +// IdxReportLinkController +function TcxSchedulerReportLink.GetControlSiteBounds(AControl: TControl): TRect; +begin + if PrintStyles.ActiveStyle <> nil then + Result := PrintStyles.ActiveStyle.GetControlSiteBounds(AControl) + else + Result := NullRect; +end; + +procedure TcxSchedulerReportLink.ConstructReport(AReportCells: TdxReportCells); + + procedure CalculateSizes; + + procedure CalculateReportPartSizes(ACell: TdxReportCell); + var + Width, I, V: Integer; + begin + if ACell.CellCount > 0 then + begin + Width := 0; + for I := 0 to ACell.CellCount - 1 do + begin + V := ACell.Cells[I].Width; + if Width < V then Width := V; + end; + ACell.BoundsRect := MakeRect(0, 0, Width, ACell.LastCell.BoundsRect.Bottom); + end; + end; + + begin + with AReportCells do + begin + CalculateReportPartSizes(Cells); + if AreFooterCellsAllocated then CalculateReportPartSizes(FooterCells); + if AreHeaderCellsAllocated then CalculateReportPartSizes(HeaderCells); + end; + end; + +begin + if Scheduler = nil then Exit; + inherited; + + if PrintStyles.ActiveStyle = nil then + Exit; + + PrepareConstruct; + try + BuildStyle; + if not AbortBuilding then CalculateSizes; + finally + UnprepareConstruct; + end; +end; + +procedure TcxSchedulerReportLink.DoCreateReport; +begin + if (PrintStyles.ActiveStyle = nil) or not PrintStyles.ActiveStyleAssigned then + PrintStyles.SetActiveStyleEx(PrintStyles.GetCorrespondingStyle); + inherited DoCreateReport; +end; + +procedure TcxSchedulerReportLink.GetImageLists(AProc: TdxPSGetImageListProc); +begin + inherited; + if HasEventImages then + AProc(Scheduler.EventImages); + if HasResourceImages then + AProc(Scheduler.Storage.Resources.Images); +end; + +function TcxSchedulerReportLink.GetRealScaleFactor: Integer; +begin + Result := 100; +end; + +procedure TcxSchedulerReportLink.CustomDraw(AItem: TAbstractdxReportCellData; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); +begin + case AItem.GetCustomDrawID of + cdidSchedulerContent: + DoCustomDrawContentCell(ACanvas, TcxSchedulerReportContentCell(AItem), ADone); + cdidSchedulerSchedulerHeader: + DoCustomDrawSchedulerHeaderCell(ACanvas, TcxSchedulerReportSchedulerHeaderDataCell(AItem), ADone); + cdidSchedulerDateNavigatorHeader: + DoCustomDrawDateNavigatorHeaderCell(ACanvas, TcxSchedulerReportDateNavigatorHeader(AItem), ADone); + cdidSchedulerDateNavigatorDay: + DoCustomDrawDateNavigatorDayCell(ACanvas, TcxSchedulerReportDateNavigatorDay(AItem), ADone); + cdidSchedulerDateNavigatorDayCaption: + DoCustomDrawDateNavigatorDayCaptionCell(ACanvas, TcxSchedulerReportDateNavigatorDayCaption(AItem), ADone); + cdidSchedulerDateNavigatorWeekNumber: + DoCustomDrawDateNavigatorWeekNumberCell(ACanvas, TcxSchedulerReportDateNavigatorWeekNumber(AItem), ADone); + cdidSchedulerTimeRuler: + DoCustomDrawTimeRulerCell(ACanvas, TcxSchedulerReportDailyTimeRulerCell(AItem), ADone); + cdidSchedulerEventCaption..cdidSchedulerEventTimeLine: + DoCustomDrawEventPartCell(ACanvas, AItem, ADone); + cdidSchedulerNotesArea: + DoCustomDrawNotesCell(ACanvas, TcxSchedulerReportNotesDataCell(AItem), ADone); + cdidSchedulerTaskPad: + DoCustomDrawTaskPadCell(ACanvas, TcxSchedulerReportNotesDataCell(AItem), ADone); + cdidSchedulerHeader: + DoCustomDrawHeaderCell(ACanvas, TcxSchedulerReportHeaderItemCell(AItem), ADone); + end; +end; + +procedure TcxSchedulerReportLink.DoCanPrintEvent(AEvent: TcxSchedulerEvent; + var AllowPrint: Boolean); +begin + if Assigned(FOnCanPrintEvent) then + FOnCanPrintEvent(Self, AEvent, AllowPrint); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawSchedulerHeaderCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportSchedulerHeaderDataCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawSchedulerHeaderCell) then + FOnCustomDrawSchedulerHeaderCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawDateNavigatorHeaderCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorHeader; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawDateNavigatorHeaderCell) then + FOnCustomDrawDateNavigatorHeaderCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawDateNavigatorDayCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorDay; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawDateNavigatorDayCell) then + FOnCustomDrawDateNavigatorDayCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawDateNavigatorDayCaptionCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorDayCaption; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawDateNavigatorDayCaptionCell) then + FOnCustomDrawDateNavigatorDayCaptionCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawDateNavigatorWeekNumberCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorWeekNumber; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawDateNavigatorWeekNumberCell) then + FOnCustomDrawDateNavigatorWeekNumberCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawTimeRulerCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportDailyTimeRulerCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawTimeRulerCell) then + FOnCustomDrawTimeRulerCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawContentCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportContentCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawContentCell) then + FOnCustomDrawContentCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawHeaderCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportHeaderItemCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawHeaderCell) then + FOnCustomDrawHeaderCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawEventPartCell( + ACanvas: TCanvas; AItem: TAbstractdxReportCellData; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawEventPartCell) then + FOnCustomDrawEventPartCell(Self, ACanvas, AItem, + TcxSchedulerReportEventPartType(AItem.GetCustomDrawID - cdidSchedulerEventCaption), + ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawNotesCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportNotesDataCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawNotesCell) then + FOnCustomDrawNotesCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawTaskPadCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportNotesDataCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawTaskPadCell) then + FOnCustomDrawTaskPadCell(Self, ACanvas, AItem, ADone); +end; + +function TcxSchedulerReportLink.GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; +begin + if PrintStyles.ActiveStyle <> nil then + Result := PrintStyles.ActiveStyle.GetRebuildOnPageParamsChange(AUpdateCodes) + else + Result := inherited GetRebuildOnPageParamsChange(AUpdateCodes); +end; + +function TcxSchedulerReportLink.GetRendererClass: TdxPSReportRendererClass; +begin + Result := TcxSchedulerReportRenderer; +end; + +function TcxSchedulerReportLink.GetRenderInfoClass: TdxPSReportRenderInfoClass; +begin + Result := TcxSchedulerReportLinkRenderInfo; +end; + +procedure TcxSchedulerReportLink.InternalRestoreDefaults; +begin + inherited; + PrintRange.RestoreDefaults; + PrintStyles.RestoreDefaults; +end; + +procedure TcxSchedulerReportLink.RebuildReport; +begin + inherited RebuildReport; + if DesignWindow <> nil then + DesignWindow.UpdatePreview; +end; + +procedure TcxSchedulerReportLink.PrepareConstruct; +begin + FLookAndFeelItems.Clear; + inherited PrepareConstruct; +end; + +procedure TcxSchedulerReportLink.UnprepareConstruct; +begin + FormatLookAndFeelItems; + inherited UnprepareConstruct; +end; + +procedure TcxSchedulerReportLink.CreateOptions; +begin + inherited CreateOptions; + FPrintRange := CreatePrintRange; + FPrintStyles := CreatePrintStyles; +end; + +procedure TcxSchedulerReportLink.DestroyOptions; +begin + FreeAndNil(FPrintStyles); + FreeAndNil(FPrintRange); + inherited DestroyOptions; +end; + +function TcxSchedulerReportLink.GetOptionsFormattingClass: TdxCustomReportLinkOptionsFormattingClass; +begin + Result := TcxSchedulerReportLinkOptionsFormatting; +end; + +function TcxSchedulerReportLink.CreatePrintRange: TcxSchedulerReportLinkPrintRange; +begin + Result := TcxSchedulerReportLinkPrintRange.Create(Self); +end; + +function TcxSchedulerReportLink.CreatePrintStyles: TcxSchedulerReportLinkPrintStyles; +begin + Result := TcxSchedulerReportLinkPrintStyles.Create(Self); +end; + +function TcxSchedulerReportLink.HasEventImages: Boolean; +begin + Result := Assigned(Scheduler) and Assigned(Scheduler.EventImages); +end; + +function TcxSchedulerReportLink.HasResourceImages: Boolean; +begin + Result := Assigned(Scheduler) and Assigned(Scheduler.Storage) and Assigned(Scheduler.Storage.Resources.Images) ; +end; + +function TcxSchedulerReportLink.GetAreNativeStylesAvailable: Boolean; +begin + Result := OptionsFormatting.UseNativeStyles; +end; + +function TcxSchedulerReportLink.GetStylesClass: TdxCustomReportLinkStylesClass; +begin + Result := TcxSchedulerReportLinkStyles; +end; + +function TcxSchedulerReportLink.GetStyleSheetClass: TdxCustomReportLinkStyleSheetClass; +begin + Result := TcxSchedulerReportLinkStyleSheet; +end; + +function TcxSchedulerReportLink.GetStyleSheetPrototype: TdxCustomReportLinkStyleSheet; +begin + Result := SchedulerLinkStyleSheetPrototype; +end; + +procedure TcxSchedulerReportLink.ActivePrintStyleChanged; +begin + if not IsDestroying and not IsLoading then + begin + if Active then + begin + FreeRenderInfos; + FreeRenderer; + RebuildReport; + end; + DoActivePrintStyleChanged; + end; +end; + +procedure TcxSchedulerReportLink.DoActivePrintStyleChanged; +begin + if Assigned(FOnActivePrintStyleChanged) then FOnActivePrintStyleChanged(Self); +end; + +procedure TcxSchedulerReportLink.FormatLookAndFeelItems; +const + Borders3D: array[Boolean] of TdxPSCellBorderClass = + (TdxPSCellRaisedBorder, TdxPSCellRaisedSoftBorder); +var + I: Integer; +begin + for I := 0 to LookAndFeelItemCount - 1 do + with LookAndFeelItems[I] do + if Effects3D then + BorderClass := Borders3D[Soft3D] + else + BorderClass := TdxPSCellUltraFlatBorder; +end; + +procedure TcxSchedulerReportLink.RegisterLookAndFeelItem(AItem: TdxReportVisualItem; + AEdgeStyle: TdxCellEdgeStyle); +begin + AItem.EdgeMode := Self.EdgeMode; + AItem.Edge3DStyle := AEdgeStyle; + FLookAndFeelItems.Add(AItem); +end; + +procedure TcxSchedulerReportLink.DoInitializeSchedulingAreaCell( + AItem: TcxSchedulerReportSchedulingAreaCell); +begin + if Assigned(FOnInitializeSchedulingAreaCell) then + FOnInitializeSchedulingAreaCell(Self, AItem); +end; + +procedure TcxSchedulerReportLink.DoInitializeEventCell(AItem: TcxSchedulerReportCustomEventCell); +begin + if Assigned(FOnInitializeEventCell) then + FOnInitializeEventCell(Self, AItem); +end; + +procedure TcxSchedulerReportLink.DoInitializeHeaderPrimaryCell( + AItem: TcxSchedulerReportSchedulerHeaderCell); +begin + if Assigned(FOnInitializeHeaderPrimaryCell) then + FOnInitializeHeaderPrimaryCell(Self, AItem); +end; + +procedure TcxSchedulerReportLink.DoInitializeHeaderSecondaryCell( + AItem: TcxSchedulerReportSchedulerHeaderCell); +begin + if Assigned(FOnInitializeHeaderSecondaryCell) then + FOnInitializeHeaderSecondaryCell(Self, AItem); +end; + +procedure TcxSchedulerReportLink.DoInitializeNotesAreaCell( + AItem: TcxSchedulerReportNotesAreaCell); +begin + if Assigned(FOnInitializeNotesAreaCell) then + FOnInitializeNotesAreaCell(Self, AItem); +end; + +procedure TcxSchedulerReportLink.DoInitializeTaskPadCell( + AItem: TcxSchedulerReportTaskPadCell); +begin + if Assigned(FOnInitializeTaskPadCell) then + FOnInitializeTaskPadCell(Self, AItem); +end; + +procedure TcxSchedulerReportLink.AssignTaskPadData(ATaskPad: TcxSchedulerReportTaskPadCell); + + procedure CropData(ASite: TdxReportCell); + var + CropBounds, R: TRect; + I: Integer; + Cell: TdxReportCell; + begin + CropBounds := ASite.AbsoluteRect; + for I := ASite.CellCount - 1 downto 0 do + begin + Cell := ASite.Cells[I]; + if not IntersectRect(R, Cell.AbsoluteRect, CropBounds) then + Cell.Free; + end; + end; + +begin + if (TaskPadReportLink <> nil) and TaskPadReportLink.DataProviderPresent then + begin + TaskPadReportLink.Controller := Renderer.ReportLink; + try + TaskPadReportLink.RebuildReport; + ATaskPad.TaskPadDataSite.Assign(TaskPadReportLink.ReportCells.Cells); + CropData(ATaskPad.TaskPadDataSite); + ATaskPad.TaskPadDataSite.ClipChildren := True; + finally + TaskPadReportLink.Controller := nil; + end; + end; +end; + +procedure TcxSchedulerReportLink.InitializeTaskPadCell(ATaskPad: TcxSchedulerReportTaskPadCell); +begin + AssignTaskPadData(ATaskPad); + DoInitializeTaskPadCell(ATaskPad); +end; + +procedure TcxSchedulerReportLink.SetCellViewParams( + ACell: TdxReportVisualItem; const AParams: TcxViewParams); +var + AdxPSViewParams: TdxReportItemViewParams; +begin + if not Assigned(ACell) then Exit; + FillChar(AdxPSViewParams, SizeOf(AdxPSViewParams), 0); + AdxPSViewParams.NativeParams := AParams; + SetCellViewParams(ACell, AdxPSViewParams); +end; + +procedure TcxSchedulerReportLink.SetCellViewParams( + ACell: TdxReportVisualItem; const AParams: TdxReportItemViewParams); +var + AFont: TFont; + AHasBitmap: Boolean; +begin + if not Assigned(ACell) then Exit; + AFont := TFont.Create; + try + AFont.Assign(AParams.NativeParams.Font); + if not dxPSUtl.dxIsTrueTypeFont(AFont) then + AFont.Name := Font.Name; + AFont.Color := ColorToRGB(AParams.NativeParams.TextColor); + if AParams.FontSize <> 0 then + AFont.Size := AParams.FontSize; + AFont.Style := AFont.Style + AParams.FontStyle; + ACell.FontIndex := AddFontToPool(AFont); + ACell.Transparent := ACell.Transparent or AParams.Transparent; + with AParams.NativeParams do + begin + AHasBitmap := not OptionsFormatting.SuppressBackgroundBitmaps and + (Bitmap <> nil) and not Bitmap.Empty; + if AHasBitmap then + ACell.BackgroundBitmapIndex := AddBackgroundBitmapToPool(Bitmap); + end; + if OptionsFormatting.SuppressContentColoration and (ACell.BorderColor <> clDefault) then + ACell.BorderColor := clBlack; + if OptionsFormatting.SuppressContentColoration and not AHasBitmap then + ACell.Color := clWhite + else + ACell.Color := ColorToRGB(AParams.NativeParams.Color); + finally + AFont.Free; + end; +end; + +function TcxSchedulerReportLink.AddPageSite( + const ABounds: TRect): TcxSchedulerReportPageSite; +begin + Result := TcxSchedulerReportPageSite.Create(ReportCells.Cells); + Result.BoundsRect := ABounds; + Result.CellSides := []; + Result.Transparent := True; + FPageSites.Add(Result); + AddVerticalDelimiter(Result); + AddHorizontalDelimiter(Result); +end; + +procedure TcxSchedulerReportLink.BuildStyle; +var + AImages: TCustomImageList; +begin + FPageSites.Clear; + if PrintStyles.ActiveStyle <> nil then + begin + AImages := nil; + with PrintStyles.ActiveStyle do + begin + try + if not ShowResourceImages and HasResourceImages then + begin + AImages := Scheduler.Storage.Resources.Images; + Scheduler.Storage.Resources.Images := nil; + end; + BeforeBuild; + RenderInfo.FPageColCount := Byte(PrintStyles.ActiveStyle.Layout) + 1; + try + Build; + finally + AfterBuild; + end; + finally + if AImages <> nil then + Scheduler.Storage.Resources.Images := AImages; + end; + end; + end; +end; + +function TcxSchedulerReportLink.GetActiveStyles: TcxSchedulerReportLinkStyles; +begin + Result := inherited ActiveStyles as TcxSchedulerReportLinkStyles; +end; + +function TcxSchedulerReportLink.GetDesignWindow: TcxfmSchedulerReportLinkDesignWindow; +begin + Result := inherited DesignWindow as TcxfmSchedulerReportLinkDesignWindow; +end; + +function TcxSchedulerReportLink.GetEdgeMode: TdxCellEdgeMode; +const + EdgeModeMap: array[Boolean] of TdxCellEdgeMode = (cemPattern, cem3DEffects); +begin + Result := EdgeModeMap[OptionsFormatting.LookAndFeelKind <> lfUltraFlat]; +end; + +function TcxSchedulerReportLink.GetLookAndFeelItem(Index: Integer): TdxReportVisualItem; +begin + Result := TdxReportVisualItem(FLookAndFeelItems[Index]); +end; + +function TcxSchedulerReportLink.GetLookAndFeelItemCount: Integer; +begin + Result := FLookAndFeelItems.Count; +end; + +function TcxSchedulerReportLink.GetOptionsFormatting: TcxSchedulerReportLinkOptionsFormatting; +begin + Result := inherited OptionsFormatting as TcxSchedulerReportLinkOptionsFormatting; +end; + +function TcxSchedulerReportLink.GetPrintStyles: TcxSchedulerReportLinkPrintStyles; +begin + Result := FPrintStyles; +end; + +function TcxSchedulerReportLink.GetRenderInfo: TcxSchedulerReportLinkRenderInfo; +begin + Result := TcxSchedulerReportLinkRenderInfo(inherited RenderInfo); +end; + +function TcxSchedulerReportLink.GetScheduler: TcxScheduler; +begin + Result := Component as TcxScheduler; +end; + +function TcxSchedulerReportLink.GetStyles: TcxSchedulerReportLinkStyles; +begin + Result := inherited Styles as TcxSchedulerReportLinkStyles; +end; + +procedure TcxSchedulerReportLink.SetOptionsFormatting(Value: TcxSchedulerReportLinkOptionsFormatting); +begin + inherited OptionsFormatting := Value; +end; + +procedure TcxSchedulerReportLink.SetPrintRange(Value: TcxSchedulerReportLinkPrintRange); +begin + PrintRange.Assign(Value); +end; + +procedure TcxSchedulerReportLink.SetPrintStyles(Value: TcxSchedulerReportLinkPrintStyles); +begin + FPrintStyles.Assign(Value); +end; + +procedure TcxSchedulerReportLink.SetStyles(Value: TcxSchedulerReportLinkStyles); +begin + inherited Styles := Value; +end; + +procedure TcxSchedulerReportLink.SetTaskPadReportLink(Value: TBasedxReportLink); +begin + if (Value <> Self) and (FTaskPadReportLink <> Value) then + begin + FTaskPadReportLink := Value; + if FTaskPadReportLink <> nil then + FTaskPadReportLink.FreeNotification(Self); + LinkModified(True); + end; +end; + +{ TcxSchedulerReportLinkPrintRange } + +procedure TcxSchedulerReportLinkPrintRange.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLinkPrintRange then + with TcxSchedulerReportLinkPrintRange(Source) do + begin + Move(FDatePrint, Self.FDatePrint[0], SizeOf(FDatePrint)); + Move(FTimePrint, Self.FTimePrint[0], SizeOf(FTimePrint)); + end; + inherited Assign(Source); +end; + +procedure TcxSchedulerReportLinkPrintRange.RestoreDefaults; +begin + inherited RestoreDefaults; + FDatePrint[0] := NullDate; + FDatePrint[1] := NullDate; + FTimePrint[0] := NullDate; + FTimePrint[1] := NullDate; +end; + +function TcxSchedulerReportLinkPrintRange.DefaultDatePrintFrom: TDate; +begin + if Scheduler <> nil then + Result := Scheduler.CurrentView.FirstVisibleDate + else + Result := Date; +end; + +function TcxSchedulerReportLinkPrintRange.DefaultDatePrintTo: TDate; +begin + if Scheduler <> nil then + Result := Scheduler.CurrentView.LastVisibleDate + else + Result := Date; +end; + +function TcxSchedulerReportLinkPrintRange.DefaultTimePrintFrom: TTime; +begin + if Scheduler <> nil then + Result := Scheduler.OptionsView.WorkStart + else + Result := 0; +end; + +function TcxSchedulerReportLinkPrintRange.DefaultTimePrintTo: TTime; +begin + if Scheduler <> nil then + Result := Scheduler.OptionsView.WorkFinish + else + Result := 0; +end; + +procedure TcxSchedulerReportLinkPrintRange.CheckTimeRange; +begin +{ if (PrintTo - PrintFrom) < 0 then + FPrintTo := DateOf(PrintFrom) + TimeOf(FPrintTo);} +end; + +function TcxSchedulerReportLinkPrintRange.GetDateTimeIF( + const AValue, ADefaultValue: TDateTime): TDateTime; +begin + Result := AValue; + if Trunc(Result) = NullDate then + Result := ADefaultValue; +end; + +function TcxSchedulerReportLinkPrintRange.DesignerTabIndex: Integer; +begin + Result := 0; +end; + +function TcxSchedulerReportLinkPrintRange.GetActiveStyle: TcxCustomSchedulerReportLinkPrintStyle; +begin + Result := ReportLink.PrintStyles.ActiveStyle; +end; + +function TcxSchedulerReportLinkPrintRange.GetDayCount: Integer; +begin + Result := Trunc(PrintTo) - Trunc(PrintFrom) + 1; + if Result < 1 then + Result := 1; +end; + +function TcxSchedulerReportLinkPrintRange.GetMonthCount: Integer; + + function MonthOfDate(const ADate: TDateTime): Integer; + var + Y, M, D: Word; + begin + DecodeDate(ADate, Y, M, D); + Result := Y * 12 + M; + end; + +begin + Result := MonthOfDate(PrintTo) - MonthOfDate(PrintFrom) + 1; +end; + +function TcxSchedulerReportLinkPrintRange.GetPrintDate(AIndex: Integer): TDate; +var + DefaultDate: TTime; +begin + if AIndex = 0 then + DefaultDate := DefaultDatePrintFrom + else + DefaultDate := DefaultDatePrintTo; + if ActiveStyle <> nil then + Result := GetDateTimeIF(ActiveStyle.CheckPrintRangeDate( + DateOf(FDatePrint[AIndex]), AIndex), DefaultDate) + else + Result := GetDateTimeIF(DateOf(FDatePrint[AIndex]), DefaultDate); +end; + +function TcxSchedulerReportLinkPrintRange.GetPrintTime(AIndex: Integer): TTime; +var + DefaultTime: TTime; +begin + if AIndex = 0 then + DefaultTime := DefaultTimePrintFrom + else + DefaultTime := DefaultTimePrintTo; + if ActiveStyle <> nil then + Result := TimeOf(GetDateTimeIF(ActiveStyle.CheckPrintRangeTime( + FTimePrint[AIndex], AIndex), DefaultTime)) + else + Result := TimeOf(GetDateTimeIF(FTimePrint[AIndex], DefaultTime)); +end; + +function TcxSchedulerReportLinkPrintRange.GetWeekCount: Integer; +begin + Result := WeeksBetween(StartOfTheWeek(PrintFrom), IncDay(EndOfTheWeek(PrintTo))); + if Result < 1 then + Result := 1; +end; + +function TcxSchedulerReportLinkPrintRange.GetYearCount: Integer; +begin + Result := YearOf(PrintTo) - YearOf(PrintFrom) + 1; + if Result < 1 then + Result := 1; +end; + +procedure TcxSchedulerReportLinkPrintRange.SetPrintDate( + AIndex: Integer; const Value: TDate); +begin + if FDatePrint[AIndex] <> Value then + begin + FDatePrint[AIndex] := Value; + Changed; + end; +end; + +procedure TcxSchedulerReportLinkPrintRange.SetPrintTime( + AIndex: Integer; const Value: TTime); +begin + if FTimePrint[AIndex] <> Value then + begin + FTimePrint[AIndex] := Value; + Changed; + end; +end; + +function TcxSchedulerReportLinkPrintRange.IsDateStored( + AIndex: Integer): Boolean; +begin + Result := FDatePrint[AIndex] <> NullDate; +end; + +function TcxSchedulerReportLinkPrintRange.IsTimeStored( + AIndex: Integer): Boolean; +begin + Result := FTimePrint[AIndex] <> NullDate; +end; + +{ TcxSchedulerReportLinkOptionsFormatting } + +procedure TcxSchedulerReportLinkOptionsFormatting.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxSchedulerReportLinkOptionsFormatting then + with TcxSchedulerReportLinkOptionsFormatting(Source) do + begin + Self.SuppressContentColoration := SuppressContentColoration; + end; +end; + +procedure TcxSchedulerReportLinkOptionsFormatting.RestoreDefaults; +begin + inherited; + SuppressContentColoration := False; +end; + +function TcxSchedulerReportLinkOptionsFormatting.DesignerTabIndex: Integer; +begin + Result := 2; +end; + +function TcxSchedulerReportLinkOptionsFormatting.GetReportLink: TcxSchedulerReportLink; +begin + Result := inherited ReportLink as TcxSchedulerReportLink; +end; + +procedure TcxSchedulerReportLinkOptionsFormatting.SetSuppressContentColoration(Value: Boolean); +begin + if FSuppressContentColoration <> Value then + begin + FSuppressContentColoration := Value; + Changed; + end; +end; + +{ TcxCustomSchedulerReportLinkOptions } + +function TcxCustomSchedulerReportLinkOptions.GetReportLink: TcxSchedulerReportLink; +begin + Result := inherited ReportLink as TcxSchedulerReportLink; +end; + +function TcxCustomSchedulerReportLinkOptions.GetScheduler: TcxScheduler; +begin + if ReportLink <> nil then + Result := ReportLink.Scheduler + else + Result := nil; +end; + +{ TcxSchedulerReportLinkStyles } + +constructor TcxSchedulerReportLinkStyles.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + BitmapInViewParams := True; +end; + +procedure TcxSchedulerReportLinkStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxSchedulerReportLinkStyles then + with TcxSchedulerReportLinkStyles(Source) do + begin + Self.SchedulerHeader := SchedulerHeader; + Self.Content := Content; + Self.DateNavigatorContent := DateNavigatorContent; + Self.DateNavigatorHeader := DateNavigatorHeader; + Self.DayHeader := DayHeader; + Self.Event := Event; + Self.ResourceHeader := ResourceHeader; + Self.NotesAreaBlank := NotesAreaBlank; + Self.NotesAreaLined := NotesAreaLined; + Self.TaskPad := TaskPad; + Self.TimeRuler := TimeRuler; + end; +end; + +function TcxSchedulerReportLinkStyles.GetSchedulerHeaderParams: TcxViewParams; +begin + GetViewParams(vspsSchedulerSchedulerHeader, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetContentParams(const ADateTime: TDateTime; + AResource: TcxSchedulerStorageResourceItem): TcxViewParams; +begin + if UseSchedulerStyles then + Result := ExtStyles.GetContentParams(ADateTime, AResource) + else + GetViewParams(vspsSchedulerContent, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetContentParams(const ADateTime: TDateTime; + ALightColor: Boolean; AResource: TcxSchedulerStorageResourceItem): TcxViewParams; +begin + if UseSchedulerStyles then + Result := ExtStyles.GetContentParams(ADateTime, ALightColor, AResource) + else + GetViewParams(vspsSchedulerContent, nil, nil, Result) +end; + +function TcxSchedulerReportLinkStyles.GetDateNavigatorContentParams: TcxViewParams; +begin + if UseSchedulerStyles then + begin + Result := TcxSchedulerDateNavigator( + ExtStyles.Scheduler.DateNavigator).Styles.GetContentParams + end + else + GetViewParams(vspsSchedulerDateNavigatorContent, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetDateNavigatorHeaderParams: TcxViewParams; +begin + if UseSchedulerStyles then + begin + Result := TcxSchedulerDateNavigator( + ExtStyles.Scheduler.DateNavigator).Styles.GetHeaderParams + end + else + GetViewParams(vspsSchedulerDateNavigatorHeader, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetDayHeaderParams( + const ADateTime: TDateTime): TcxViewParams; +begin + if UseSchedulerStyles then + Result := ExtStyles.GetDayHeaderParams(ADateTime) + else + GetViewParams(vspsSchedulerDayHeader, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetEventParams( + AEvent: TcxSchedulerEvent): TcxViewParams; +begin + if UseSchedulerStyles then + Result := ExtStyles.GetEventContentParams(AEvent) + else + GetViewParams(vspsSchedulerEvent, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetNotesAreaBlankParams: TcxViewParams; +begin + GetViewParams(vspsSchedulerNotesAreaBlank, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetNotesAreaLinedParams: TcxViewParams; +begin + GetViewParams(vspsSchedulerNotesAreaLined, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetResourceHeaderParams( + AResource: TcxSchedulerStorageResourceItem): TcxViewParams; +begin + if UseSchedulerStyles then + Result := ExtStyles.GetResourceHeaderParams(AResource) + else + GetViewParams(vspsSchedulerResourceHeader, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetTaskPadParams: TcxViewParams; +begin + GetViewParams(vspsSchedulerTaskPad, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetTimeRulerParams: TcxViewParams; +begin + if UseSchedulerStyles then + Result := ReportLink.Scheduler.ViewDay.Styles.GetTimeRulerParams + else + GetViewParams(vspsSchedulerTimeRuler, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.DesignerTabIndex: Integer; +begin + Result := 3; +end; + +procedure TcxSchedulerReportLinkStyles.GetDefaultViewParams(Index: Integer; + AData: TObject; out AParams: TcxViewParams); +const + FixedParts = [vspsSchedulerDayHeader, vspsSchedulerResourceHeader, vspsSchedulerTimeRuler]; +begin + inherited; + if ReportLink <> nil then + with AParams do + begin + if Index in FixedParts then + Color := dxPSCore.dxDefaultFixedColor + else + Color := dxDefaultContentColor; + Font := ReportLink.Font; + TextColor := Font.Color; + end; +end; + +class function TcxSchedulerReportLinkStyles.GetStyleCaption(AnIndex: Integer): string; +begin + case AnIndex of + vspsSchedulerSchedulerHeader: + Result := cxGetResourceString(@sdxSchedulerSchedulerHeader); + vspsSchedulerContent: + Result := cxGetResourceString(@sdxSchedulerContent); + vspsSchedulerDateNavigatorContent: + Result := cxGetResourceString(@sdxSchedulerDateNavigatorContent); + vspsSchedulerDateNavigatorHeader: + Result := cxGetResourceString(@sdxSchedulerDateNavigatorHeader); + vspsSchedulerDayHeader: + Result := cxGetResourceString(@sdxSchedulerDayHeader); + vspsSchedulerEvent: + Result := cxGetResourceString(@sdxSchedulerEvent); + vspsSchedulerResourceHeader: + Result := cxGetResourceString(@sdxSchedulerResourceHeader); + vspsSchedulerNotesAreaBlank: + Result := cxGetResourceString(@sdxSchedulerNotesAreaBlank); + vspsSchedulerNotesAreaLined: + Result := cxGetResourceString(@sdxSchedulerNotesAreaLined); + vspsSchedulerTaskPad: + Result := cxGetResourceString(@sdxSchedulerTaskPad); + else {vspsSchedulerTimeRuler} + Result := cxGetResourceString(@sdxSchedulerTimeRuler); + end; +end; + +function TcxSchedulerReportLinkStyles.GetStyleIndexByCaption(const Caption: string): Integer; +begin + for Result := vspsSchedulerFirst to vspsSchedulerLast do + if dxPSUtl.dxSameText(Caption, GetStyleCaption(Result)) then + Exit; + Result := -1; +end; + +// IcxSchedulerStylesAdapter +function TcxSchedulerReportLinkStyles.GetDayHeaderStyle: TcxStyle; +begin + if UseSchedulerStyles then + Result := ExtStyles.DayHeader + else + Result := DayHeader; +end; + +function TcxSchedulerReportLinkStyles.GetResourceHeaderStyle: TcxStyle; +begin + if UseSchedulerStyles then + Result := ExtStyles.ResourceHeader + else + Result := ResourceHeader; +end; + +function TcxSchedulerReportLinkStyles.GetExtStyles: TcxSchedulerStyles; +begin + Result := ReportLink.Scheduler.Styles; +end; + +function TcxSchedulerReportLinkStyles.GetReportLink: TcxSchedulerReportLink; +begin + Result := inherited ReportLink as TcxSchedulerReportLink; + if Result = nil then + Result := FReportLink; +end; + +function TcxSchedulerReportLinkStyles.GetUseSchedulerStyles: Boolean; +begin + if ReportLink = nil then + begin + Result := False; + Exit; + end; + Result := not ReportLink.OptionsFormatting.UseNativeStyles; + if not Result then + Result := (ReportLink = nil) or (ReportLink.Scheduler = nil); +end; + +{ TcxSchedulerReportLinkStyleSheet } + +class function TcxSchedulerReportLinkStyleSheet.GetStylesClass: TcxCustomStylesClass; +begin + Result := TcxSchedulerReportLinkStyles; +end; + +function TcxSchedulerReportLinkStyleSheet.GetStylesValue: TcxSchedulerReportLinkStyles; +begin + if GetStyles is TcxSchedulerReportLinkStyles then + Result := TcxSchedulerReportLinkStyles(GetStyles) + else + Result := nil; +end; + +procedure TcxSchedulerReportLinkStyleSheet.SetStylesValue(Value: TcxSchedulerReportLinkStyles); +begin + SetStyles(Value); +end; + +{ TcxSchedulerReportLinkPrintStyles } + +procedure TcxSchedulerReportLinkPrintStyles.Assign(Source: TPersistent); +var + I: Integer; +begin + if Source is TcxSchedulerReportLinkPrintStyles then + for I := 0 to Count - 1 do + Items[I] := TcxSchedulerReportLinkPrintStyles(Source).Items[I]; + inherited; +end; + +procedure TcxSchedulerReportLinkPrintStyles.RestoreDefaults; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].RestoreDefaults; + inherited; +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleByClass( + AClass: TcxCustomSchedulerReportLinkPrintStyleClass): TcxCustomSchedulerReportLinkPrintStyle; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I]; + if Result.ClassType = AClass then Exit; + end; + Result := nil; +end; + +function TcxSchedulerReportLinkPrintStyles.GetCorrespondingStyle: TcxCustomSchedulerReportLinkPrintStyle; +begin + Result := nil; + if Scheduler = nil then Exit; + Result := GetStyleByView(Scheduler.CurrentView) +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleByName( + const Name: string): TcxCustomSchedulerReportLinkPrintStyle; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I]; + if CompareText(Result.Caption, Name) = 0 then Exit; + end; + Result := nil; +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleByView( + View: TcxSchedulerCustomView): TcxCustomSchedulerReportLinkPrintStyle; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I]; + if Result.IsCompatibleWith(View) then Exit; + end; + Result := nil; +end; + +function TcxSchedulerReportLinkPrintStyles.IndexOf(AItem: TcxCustomSchedulerReportLinkPrintStyle): Integer; +begin + Result := FItems.IndexOf(AItem); +end; + +procedure TcxSchedulerReportLinkPrintStyles.CreateObjects; +begin + inherited CreateObjects; + FItems := TList.Create; + CreateStyles; +end; + +procedure TcxSchedulerReportLinkPrintStyles.DestroyObjects; +begin + DestroyStyles; + FreeAndNil(FItems); + inherited DestroyObjects; +end; + +function TcxSchedulerReportLinkPrintStyles.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +procedure TcxSchedulerReportLinkPrintStyles.ActiveStyleChanged; +begin + if ReportLink <> nil then + ReportLink.ActivePrintStyleChanged; +end; + +function TcxSchedulerReportLinkPrintStyles.CreateStyle( + AStyleClass: TcxCustomSchedulerReportLinkPrintStyleClass): TcxCustomSchedulerReportLinkPrintStyle; +begin + Result := AStyleClass.Create(Self); + FItems.Add(Result); +end; + +procedure TcxSchedulerReportLinkPrintStyles.CreateStyles; +begin + CreateStyle(TcxSchedulerReportLinkDailyPrintStyle); + CreateStyle(TcxSchedulerReportLinkWeeklyPrintStyle); + CreateStyle(TcxSchedulerReportLinkMonthlyPrintStyle); + CreateStyle(TcxSchedulerReportLinkTimeLinePrintStyle); + CreateStyle(TcxSchedulerReportLinkTrifoldPrintStyle); + CreateStyle(TcxSchedulerReportLinkDetailsPrintStyle); + CreateStyle(TcxSchedulerReportLinkMemoPrintStyle); + CreateStyle(TcxSchedulerReportLinkYearlyPrintStyle); +end; + +procedure TcxSchedulerReportLinkPrintStyles.DestroyStyles; +var + I: Integer; +begin + for I := Count - 1 downto 0 do + Items[I].Free; + FItems.Clear; +end; + +procedure TcxSchedulerReportLinkPrintStyles.GetStyleByClassEx( + AClass: TcxCustomSchedulerReportLinkPrintStyleClass; var AInstance); +begin + TPersistent(AInstance) := GetStyleByClass(AClass); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetActiveStyleEx( + Value: TcxCustomSchedulerReportLinkPrintStyle); +begin + if (ActiveStyle <> Value) or ActiveStyleAssigned then + begin + FActiveStyle := Value; + ActiveStyleAssigned := False; + end; +end; + +procedure TcxSchedulerReportLinkPrintStyles.StyleChanged(AStyle: TcxCustomSchedulerReportLinkPrintStyle); +begin + Changed; +end; + +function TcxSchedulerReportLinkPrintStyles.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxSchedulerReportLinkPrintStyles.GetItem( + Index: Integer): TcxCustomSchedulerReportLinkPrintStyle; +begin + Result := TcxCustomSchedulerReportLinkPrintStyle(FItems[Index]); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleDaily: TcxSchedulerReportLinkDailyPrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkDailyPrintStyle, Result); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleDetails: TcxSchedulerReportLinkDetailsPrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkDetailsPrintStyle, Result); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleMemo: TcxSchedulerReportLinkMemoPrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkMemoPrintStyle, Result); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleMonthly: TcxSchedulerReportLinkMonthlyPrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkMonthlyPrintStyle, Result); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleTimeLine: TcxSchedulerReportLinkTimeLinePrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkTimeLinePrintStyle, Result); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleTrifold: TcxSchedulerReportLinkTrifoldPrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkTrifoldPrintStyle, Result); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleWeekly: TcxSchedulerReportLinkWeeklyPrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkWeeklyPrintStyle, Result); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleYearly: TcxSchedulerReportLinkYearlyPrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkYearlyPrintStyle, Result); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetActiveStyle( + Value: TcxCustomSchedulerReportLinkPrintStyle); +var + APrevActiveStyle: TcxCustomSchedulerReportLinkPrintStyle; +begin + if (FActiveStyle <> Value) or not FActiveStyleAssigned then + begin + APrevActiveStyle := FActiveStyle; + FActiveStyle := Value; + FActiveStyleAssigned := Value <> nil; + if APrevActiveStyle <> nil then + APrevActiveStyle.ActiveStyleChanged; + if Value <> nil then + Value.ActiveStyleChanged; + ActiveStyleChanged; + DesignerModified; + end; +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetActiveStyleAssigned( + Value: Boolean); +begin + if FActiveStyleAssigned <> Value then + begin + FActiveStyleAssigned := Value; + DesignerModified; + end; +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetItem(Index: Integer; + Value: TcxCustomSchedulerReportLinkPrintStyle); +begin + Items[Index].Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleDaily( + Value: TcxSchedulerReportLinkDailyPrintStyle); +begin + Daily.Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleDetails( + Value: TcxSchedulerReportLinkDetailsPrintStyle); +begin + GetStyleDetails.Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleMemo( + Value: TcxSchedulerReportLinkMemoPrintStyle); +begin + GetStyleMemo.Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleMonthly( + Value: TcxSchedulerReportLinkMonthlyPrintStyle); +begin + Monthly.Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleTimeLine( + Value: TcxSchedulerReportLinkTimeLinePrintStyle); +begin + GetStyleTimeLine.Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleTrifold( + Value: TcxSchedulerReportLinkTrifoldPrintStyle); +begin + GetStyleTrifold.Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleWeekly( + Value: TcxSchedulerReportLinkWeeklyPrintStyle); +begin + Weekly.Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleYearly( + Value: TcxSchedulerReportLinkYearlyPrintStyle); +begin + Yearly.Assign(Value); +end; + +{ TcxCustomSchedulerReportLinkPrintStyle } + +constructor TcxCustomSchedulerReportLinkPrintStyle.Create(AStyles: TcxSchedulerReportLinkPrintStyles); +begin + inherited Create; + FStyles := AStyles; + FCaption := DefaultCaption; + CreateObjects; + RestoreDefaults; +end; + +destructor TcxCustomSchedulerReportLinkPrintStyle.Destroy; +begin + Active := False; + DestroyObjects; + inherited Destroy; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.Assign(Source: TPersistent); +var + ASource: TcxCustomSchedulerReportLinkPrintStyle; +begin + if Source is TcxCustomSchedulerReportLinkPrintStyle then + begin + ASource := TcxCustomSchedulerReportLinkPrintStyle(Source); + Caption := ASource.Caption; + CompressWeekends := ASource.CompressWeekends; + DontPrintWeekends := ASource.DontPrintWeekends; + Layout := ASource.Layout; + ResourceCountPerPage := ASource.ResourceCountPerPage; + ShowNotesAreaBlank := ASource.ShowNotesAreaBlank; + ShowNotesAreaLined := ASource.ShowNotesAreaLined; + ShowTaskPad := ASource.ShowTaskPad; + if SupportTimeRange then + begin + TimePrintFrom := ASource.TimePrintFrom; + TimePrintTo := ASource.TimePrintTo; + end; + ShowEventImages := ASource.ShowEventImages; + end + else + inherited; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.DefaultCaption: string; +begin + Result := ''; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IsCompatibleWith(AView: TcxSchedulerCustomView): Boolean; +begin + Result := False; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.RestoreDefaults; +begin + FCaption := DefaultCaption; + FCompressWeekends := True; + FDontPrintWeekends := False; + FLayout := pslOnePage; + ResourceCountPerPage := 0; + ShowNotesAreaBlank := False; + ShowNotesAreaLined := False; + ShowTaskPad := False; + if SupportTimeRange and (Scheduler <> nil) then + begin + TimePrintFrom := TimeOf(Scheduler.OptionsView.WorkStart); + TimePrintTo := TimeOf(Scheduler.OptionsView.WorkFinish); + end; +end; + +// IdxReportLinkController +function TcxCustomSchedulerReportLinkPrintStyle.GetControlSiteBounds(AControl: TControl): TRect; +begin + Result := NullRect; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.Build; +begin + FBoldedDays := TcxSchedulerDateList.Create; + try + if Storage <> nil then + begin + Events.SelStart := PrintRange.PrintFrom - 30; + Events.SelFinish := PrintRange.PrintTo + 30; + Storage.GetEvents(Events, Events.SelStart, Events.SelFinish); + end; + Events.ExtractUsedDays(FBoldedDays); + PrepareEvents; + BuildPages; + Events.Clear; + UsedDays.Clear; + finally + FreeAndNil(FBoldedDays); + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.BuildPages; +var + I: Integer; +begin + for I := 0 to PeriodCount - 1 do + begin + CreateLayoutForPeriod(I); + Progress(100 * (I + 1) / PeriodCount); + if ReportLink.AbortBuilding or ReportLink.LinkInPreviewMode then Break; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.BuildSchedulerCells( + ASite: TcxSchedulerReportSchedulingAreaCell); +var + APageIndex, APeriodIndex, ASubIndex: Integer; +begin + APageIndex := ASite.PageIndex; + GetPagePeriodAndIndex(APageIndex, APeriodIndex, ASubIndex); + FillDatesForPage(ASite.VisibleDays, APageIndex, APeriodIndex, ASubIndex); + with CreateSchedulingCellsProducer(ASite) do + try + Produce; + finally + Free; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.PrepareEvents; +var + I: Integer; + AEvent: TcxSchedulerEvent; + AllowPrint: Boolean; +begin + for I := 0 to FEvents.AbsoluteCount - 1 do + begin + AEvent := FEvents.AbsoluteItems[I]; + AllowPrint := True; + DoCanPrintEvent(AEvent, AllowPrint); + if not AllowPrint then + FEvents.Remove(AEvent); + end; + FEvents.Sort(TcxCompareEventsProc(@cxCompareEventsOrder)); + TcxSchedulerCachedEventListAccess(FEvents).Changed; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.DoCanPrintEvent( + AEvent: TcxSchedulerEvent; var AllowPrint: Boolean); +begin + ReportLink.DoCanPrintEvent(AEvent, AllowPrint); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.Progress(APercentDone: Double); +begin + if ReportLink <> nil then + ReportLink.DoProgress(APercentDone); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.AfterBuild; +begin + VisualStyles.FReportLink := nil; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.BeforeBuild; +begin + VisualStyles.FReportLink := ReportLink; + CurrentDate := PrintRange.PrintFrom; + FPagesPerPeriod := GetPagesPerPeriod; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.QueryInterface(const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +function TcxCustomSchedulerReportLinkPrintStyle._AddRef: Integer; +begin + Result := 1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle._Release: Integer; +begin + Result := 1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetDC: HDC; +begin + Result := ReportLink.Renderer.DC; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetDisplayGraphicsAsText: Boolean; +begin + Result := ReportLink.OptionsRefinements.DisplayGraphicsAsText; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetEndEllipsis: Boolean; +begin + Result := False; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetFlatCheckMarks: Boolean; +begin + Result := ReportLink.OptionsRefinements.FlatCheckMarks; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetGraphicsText: string; +begin + Result := ReportLink.OptionsRefinements.GraphicsText; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetMultiline: Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetTransparentGraphics: Boolean; +begin + Result := ReportLink.OptionsRefinements.TransparentGraphics; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams2_GetPreviewMarginLeft: Integer; +begin + Result := 2; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams2_GetPreviewMarginRight: Integer; +begin + Result := 2; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams2_GetPreviewMaxHeight: Integer; +begin + Result := -1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams2_GetPreviewMaxLineCount: Integer; +begin + Result := -1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams2_GetRichEditGraphicClass: TGraphicClass; +const + GraphicClasses: array[Boolean] of TGraphicClass = (TMetafile, TBitmap); +begin + Result := GraphicClasses[IdxPSCellParams2_GetRichEditTransparent]; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams2_GetRichEditTransparent: Boolean; +begin + {$IFDEF DXVER500} + Result := ReportLink.OptionsRefinements.TransparentRichEdits; + {$ELSE} + Result := False; + {$ENDIF} +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.ActiveStyleChanged; +begin +end; + +function TcxCustomSchedulerReportLinkPrintStyle.AddPageSite( + const ABounds: TRect): TcxSchedulerReportPageSite; +begin + Result := ReportLink.AddPageSite(ABounds); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.Changed; +begin + if Styles <> nil then Styles.StyleChanged(Self); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreateObjects; +begin + FUsedDays := TcxSchedulerDateList.Create; + FEvents := TcxSchedulerCachedEventList.Create; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.DestroyObjects; +begin + FEvents.Free; + FUsedDays.Free; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPageCount: Integer; +begin + Result := 0; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetRebuildOnPageParamsChange( + AnUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CheckPrintRangeDate( + const ADate: TDateTime; AIndex: Integer): TDateTime; +begin + Result := ADate; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CheckPrintRangeTime( + const ATime: TDateTime; AIndex: Integer): TDateTime; +begin + Result := ATime; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetActualDatePrintFrom: TDate; +begin + if PrintRange <> nil then + Result := PrintRange.PrintFrom + else + Result := 0; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetActualDatePrintTo: TDate; +begin + if PrintRange <> nil then + Result := PrintRange.PrintTo + else + Result := 0; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetCorrespondedView: TcxSchedulerCustomResourceView; +begin + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPagesPerPeriod: Integer; +begin + Result := 1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetGlyphIndex: Integer; +begin + Result := -1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPreviewGlyphIndex: Integer; +begin + Result := GetGlyphIndex; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetSchedulerHeaderParams: TdxReportItemViewParams; +begin + FillChar(Result, SizeOf(Result), 0); + Result.NativeParams := VisualStyles.GetSchedulerHeaderParams; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.DrawDesignWindowPreview(ACanvas: TCanvas; const ABounds: TRect); +var + ALeft, ATop: Integer; +begin + with ABounds do + begin + ALeft := (Left + Right - StylePreviewImages.Width) div 2; + ATop := (Top + Bottom - StylePreviewImages.Height) div 2; + end; + StylePreviewImages.Draw(ACanvas, ALeft, ATop, PreviewGlyphIndex); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetResourcePageCount: Integer; +begin + Result := ResourceCountPerPage; + if Result = 0 then + Result := 1 + else + if ResourceCount > 0 then + begin + Result := ResourceCount div ResourceCountPerPage + + Byte(ResourceCount mod ResourceCountPerPage > 0); + end; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetShowDateNavigator( + APageIndex: Integer): Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetShowNotesAreaBlank: Boolean; +begin + Result := FShowNotesAreaBlank; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetBoolOption( + var AOption: Boolean; Value: Boolean); +begin + if AOption <> Value then + begin + AOption := Value; + Changed; + end; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.SupportTimeRange: Boolean; +begin + Result := False; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.SupportMessage: Boolean; +begin + Result := False; +end; + +// report cells creation + +function TcxCustomSchedulerReportLinkPrintStyle.CreateSchedulingAreaCell( + ASite: TdxReportCell): TcxSchedulerReportSchedulingAreaCell; +begin + Result := TcxSchedulerReportSchedulingAreaCell.Create(ASite); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; +begin + Result := TcxSchedulerReportCommonCellsProducer.CreateEx(Self, ASite); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CreateDateNavigatorCell( + ASite: TdxReportCell; AYear, AMonth: Word): TcxSchedulerReportDateNavigatorCell; +begin + with Scheduler.DateNavigator do + begin + Result := TcxSchedulerReportDateNavigatorCell.CreateEx(ASite, + ActualFirstWeekOfYear, AYear, AMonth, ShowDatesContainingEventsInBold, ShowWeekNumbers); + Result.FBoldedDays := Self.FBoldedDays; + end; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CreateHeaderCell( + ASite: TdxReportCell): TcxSchedulerReportSchedulerHeaderCell; +begin + Result := TcxSchedulerReportSchedulerHeaderCell.Create(ASite); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CreateNotesCell( + ASite: TdxReportCell): TcxSchedulerReportNotesAreaCell; +begin + Result := TcxSchedulerReportNotesAreaCell.CreateEx(ASite, False); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CreateNotesLinedCell( + ASite: TdxReportCell): TcxSchedulerReportNotesAreaCell; +begin + Result := TcxSchedulerReportNotesAreaCell.CreateEx(ASite, True); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CreateTaskPadCell( + ASite: TdxReportCell): TcxSchedulerReportTaskPadCell; +begin + Result := TcxSchedulerReportTaskPadCell.CreateEx(ASite, False); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.InitHeaderCell( + ACell: TcxSchedulerReportSchedulerHeaderCell); +begin + ReportLink.SetCellViewParams(ACell, GetSchedulerHeaderParams); + ReportLink.SetCellViewParams(ACell.Content, GetSchedulerHeaderParams); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.InitReportCell( + ACell: TdxReportCell; const ABounds: TRect): TdxReportCell; + + procedure InitAdditionalAreaCell(const AViewParams: TcxViewParams); + begin + ReportLink.SetCellViewParams(ACell, AViewParams); + ReportLink.SetCellViewParams(TcxSchedulerReportNotesAreaCell( + ACell).DataCell, AViewParams); + end; + +begin + ACell.BoundsRect := ABounds; + Result := ACell; + if ReportLink = nil then Exit; + ACell.Transparent := not ReportLink.OptionsFormatting.UseNativeStyles; + if ACell is TcxSchedulerReportPageItemCell then + begin + case TcxSchedulerReportPageItemCell(ACell).GetType of + srSchedulingArea: + begin + BuildSchedulerCells(TcxSchedulerReportSchedulingAreaCell(ACell)); + ReportLink.DoInitializeSchedulingAreaCell( + TcxSchedulerReportSchedulingAreaCell(ACell)); + end; + srHeader: + InitHeaderCell(TcxSchedulerReportSchedulerHeaderCell(ACell)); + srNotesBlank: + begin + InitAdditionalAreaCell(VisualStyles.GetNotesAreaBlankParams); + ReportLink.DoInitializeNotesAreaCell( + TcxSchedulerReportNotesAreaCell(ACell)); + end; + srNotesLined: + begin + InitAdditionalAreaCell(VisualStyles.GetNotesAreaLinedParams); + ReportLink.DoInitializeNotesAreaCell( + TcxSchedulerReportNotesAreaCell(ACell)); + end; + srTaskPad: + begin + InitAdditionalAreaCell(VisualStyles.GetTaskPadParams); + ReportLink.InitializeTaskPadCell( + TcxSchedulerReportTaskPadCell(ACell)); + end; + end; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CorrectBoundsWithHeader( + AHeader: TcxSchedulerReportSchedulerHeaderCell; var ABounds: TRect); +begin + if (AHeader = nil) or not AHeader.Visible then + ABounds.Top := 0 + else + ABounds.Top := AHeader.BoundsRect.Bottom + InterAreaSpace; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreateAdditionalControls( + ASite: TdxReportCell; AHasCalendar, AHasTaskPad, AHasNotes, + AHasNotesLined, ARightSide: Boolean; var ABounds: TRect); +var + R: array[0..2] of TRect; + C: Integer; + + function GetAreaBounds(AllowShow: Boolean; + var ABounds: TRect; var AIndex: Integer): Boolean; + begin + Result := AllowShow; + if not Result then Exit; + ABounds := R[AIndex]; + Inc(AIndex); + end; + + procedure CreateCells; + var + AIndex: Integer; + ABounds: TRect; + begin + AIndex := 0; + if GetAreaBounds(AHasTaskPad, ABounds, AIndex) then + InitReportCell(CreateTaskPadCell(ASite), ABounds); + if GetAreaBounds(AHasNotes, ABounds, AIndex) then + InitReportCell(CreateNotesCell(ASite), ABounds); + if GetAreaBounds(AHasNotesLined, ABounds, AIndex) then + InitReportCell(CreateNotesLinedCell(ASite), ABounds); + end; + +begin + C := Byte(AHasTaskPad) + Byte(AHasNotes) + Byte(AHasNotesLined); + if C = 0 then Exit; + SplitToRects(ABounds, AHasCalendar, ARightSide, ABounds, R[0]); + if C = 2 then + Rect2RectsVert(R[0], R[0], R[1]) + else + if C = 3 then + begin + if AHasCalendar then + Rect2RectsVert(R[0], R[0], R[1], R[2]) + else + begin + Rect2RectsVert(R[0], R[1], R[0]); + Rect2RectsHorz(R[1], R[1], R[2]); + end; + end; + CreateCells; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreateControlsOnFirstPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +begin +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreateControlsOnSecondPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +begin +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreateHeaderDateNavigator( + AHeader: TcxSchedulerReportSchedulerHeaderCell; APageIndex: Integer; out ABounds: TRect); +var + R: TRect; + Y, M, D: Word; + AHeight, H, ALeft: Integer; + CP, HP: TdxReportItemViewParams; + ACell: TcxSchedulerReportDateNavigatorCell; +begin + FillChar(CP, SizeOf(CP), 0); + FillChar(HP, SizeOf(HP), 0); + AHeight := ABounds.Bottom - ABounds.Top; + CP.NativeParams := VisualStyles.GetDateNavigatorContentParams; + HP.NativeParams := VisualStyles.GetDateNavigatorHeaderParams; + HP.Transparent := not ReportLink.OptionsFormatting.UseNativeStyles; + GetPageDateNavigatorInfo(APageIndex, Y, M); + ACell := CreateDateNavigatorCell(AHeader, Y, M); + H := ACell.MeasureDateNavigatorHeight(CP.NativeParams, HP.NativeParams); + if H > AHeight then + ACell.AdjustSize(CP, HP, H, AHeight); + R.TopLeft := Point(0, 0); + R.BottomRight := TPoint(ACell.CalculateSize(CP, HP)); + OffsetRect(R, ABounds.Right - ABounds.Left - R.Right, 0); + InflateRect(R, 0, -3); + ACell.BoundsRect := R; + ALeft := R.Left; + if PrintRange.MonthCount > 1 then + begin + IncAMonth(Y, M, D); + ACell.BoundsRect := cxRectSetRight(R, R.Left); + ALeft := R.Left - (R.Right - R.Left); + ACell := CreateDateNavigatorCell(AHeader, Y, M); + if H > AHeight then + ACell.AdjustSize(CP, HP, H, AHeight); + ACell.CalculateSize(CP, HP); + ACell.BoundsRect := R; + end; + AHeader.Content.BoundsRect := MakeRect(ABounds.Left + cxTextOffset, + ABounds.Top + cxTextOffset, ALeft, ABounds.Bottom - cxTextOffset); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreateLayoutForPeriod( + APeriodIndex: Integer); +var + APageIndex: Integer; + R: TRect; + APage: TcxSchedulerReportPageSite; + AHeader: TcxSchedulerReportSchedulerHeaderCell; +begin + APageIndex := GetPageIndex(APeriodIndex, 0); + CreatePageSiteWithHeader(APageIndex, APage, AHeader, R); + CorrectBoundsWithHeader(AHeader, R); + CreateControlsOnFirstPage(APageIndex, APage, AHeader, R); + if Layout = pslTwoPages then + begin + CreatePageSiteWithHeader(APageIndex + 1, APage, AHeader, R, False); + CorrectBoundsWithHeader(AHeader, R); + CreateControlsOnSecondPage(APageIndex + 1, APage, AHeader, R); + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreatePageSiteWithHeader( + APageIndex: Integer; out ASite: TcxSchedulerReportPageSite; + out AHeader: TcxSchedulerReportSchedulerHeaderCell; + out ABounds: TRect; AIsPrimary: Boolean = True); +var + R: TRect; +begin + ABounds := GetPageSiteBounds(APageIndex); + ASite := AddPageSite(ABounds); + ASite.FPageIndex := APageIndex; + ASite.FPrimaryPage := AIsPrimary; + ABounds := ASite.GetInnerBounds(0); + if GetHasPageReportTitle(APageIndex) then + Inc(ABounds.Top, ReportLink.RenderInfo.CalculateTitleHeight); + if GetHasPageHeader(APageIndex) then + begin + R := ABounds; + R.Bottom := R.Top + GetPageHeaderHeight(R, APageIndex); + ABounds.Top := R.Bottom + InterAreaSpace; + AHeader := CreateHeaderCell(ASite); + Inc(R.Bottom, AHeader.BorderEdgeThicknesses[csBottom]); + InitReportCell(AHeader, R); + if GetShowDateNavigator(APageIndex) then + begin + R := AHeader.GetInnerBounds(0); + CreateHeaderDateNavigator(TcxSchedulerReportSchedulerHeaderCell(AHeader), APageIndex, R); + end; + AHeader.AdjustTextSize; + if AIsPrimary then + ReportLink.DoInitializeHeaderPrimaryCell(AHeader) + else + ReportLink.DoInitializeHeaderSecondaryCell(AHeader); + end + else + AHeader := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CanSplitSchedulingOnTwoPages: Boolean; +begin + Result := Layout = pslTwoPages; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetHasPageHeader( + APageIndex: Integer): Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetHasPageReportTitle( + APageIndex: Integer): Boolean; +begin + case ReportLink.ReportTitleMode of + tmNone: + Result := False; + tmOnFirstPage: + Result := APageIndex div (Byte(Layout) + 1) = 0; + else + Result := True; + end; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPageHeaderHeight( + const ASiteBounds: TRect; APageIndex: Integer): Integer; +var + AMin, AMax: Integer; +begin + Result := 0; + AMin := Round((ASiteBounds.Bottom - ASiteBounds.Top) * SchedulerHeaderMinHeight); + AMax := Round((ASiteBounds.Bottom - ASiteBounds.Top) * SchedulerHeaderMaxHeight); + if GetShowDateNavigator(APageIndex) and (ReportLink <> nil) then + begin + with VisualStyles do + Result := TcxSchedulerReportDateNavigatorCell.MeasureDateNavigatorHeight( + GetDateNavigatorContentParams, GetDateNavigatorHeaderParams); + end; + Result := Max(Min(AMax, Result), AMin); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPageIndex( + APeriodIndex, AIndex: Integer): Integer; +begin + Result := (APeriodIndex * (Byte(Layout) + 1) + AIndex); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.GetPagePeriodAndIndex( + APageIndex: Integer; var APeriodIndex, ASubIndex: Integer); +begin + ASubIndex := 0; + if Layout = pslTwoPages then + begin + APeriodIndex := APageIndex div 2; + ASubIndex := APageIndex mod 2; + end + else + APeriodIndex := APageIndex; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPageSiteBounds( + APageIndex: Integer): TRect; +begin + Result := MakeBounds(0, 0, ReportLink.PageWidth, ReportLink.PageHeight); + OffsetRect(Result, 0, APageIndex * ReportLink.PageHeight); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetStartOfWeekOffset: Integer; +begin + Result := 0; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.GetPageDateNavigatorInfo( + APageIndex: Integer; out AYear, AMonth: Word); +var + ADate: TDateTime; + ADayCount: Integer; +begin + ADayCount := APageIndex * GetDaysPerPeriod div + ((Byte(Layout) + 1) * GetResourcePageCount); + ADate := PrintRange.PrintFrom + ADayCount; + AYear := YearOf(ADate); + AMonth := MonthOf(ADate); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetDaysPerPeriod: Integer; +begin + Result := 1; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.FillDatesForPage( + ADateList: TcxSchedulerDateList; APageIndex, APeriodIndex, ASubIndex: Integer); +begin +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetActive: Boolean; +begin + if Styles <> nil then + Result := (Styles.ActiveStyle = Self) and Styles.ActiveStyleAssigned + else + Result := False; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetHasAdditionalArea: Boolean; +begin + Result := ShowNotesAreaBlank or ShowNotesAreaLined or ShowTaskPad; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetIndex: Integer; +begin + if Styles <> nil then + Result := Styles.IndexOf(Self) + else + Result := -1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPageSite( + AIndex: Integer): TcxSchedulerReportPageSite; +begin + if ReportLink <> nil then + Result := TcxSchedulerReportPageSite(ReportLink.PageSites[AIndex]) + else + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPeriodCount: Integer; +begin + Result := PageCount; + if Layout = pslTwoPages then + Result := Result div 2; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPrintRange: TcxSchedulerReportLinkPrintRange; +begin + if ReportLink <> nil then + Result := ReportLink.PrintRange + else + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetReportLink: TcxSchedulerReportLink; +begin + if Styles <> nil then + Result := Styles.ReportLink + else + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetResourceCount: Integer; +begin + if (Scheduler <> nil) and (Scheduler.Storage <> nil) and + (Scheduler.Storage.Resources.ResourceItems.VisibleResourceCount > 0) then + Result := Scheduler.Storage.Resources.ResourceItems.VisibleResourceCount + else + Result := 1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetScheduler: TcxScheduler; +begin + if ReportLink <> nil then + Result := ReportLink.Scheduler + else + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetStorage: TcxCustomSchedulerStorage; +begin + if Scheduler <> nil then + Result := Scheduler.Storage + else + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetTimePrintFrom: TTime; +begin + Result := TimeOf(PrintRange.TimePrintFrom); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetTimePrintTo: TTime; +begin + Result := TimeOf(PrintRange.TimePrintTo); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetVisualStyles: TcxSchedulerReportLinkStyles; +begin + if ReportLink <> nil then + Result := ReportLink.ActiveStyles + else + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IsCaptionStored: Boolean; +begin + Result := (FCaption <> DefaultCaption); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IsLayoutStored: Boolean; +begin + Result := Layout <> pslOnePage; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IsShowNotesAreaBlankStored: Boolean; +begin + Result := FShowNotesAreaBlank <> False; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IsActiveStored: Boolean; +begin + Result := Active and Styles.ActiveStyleAssigned; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetActive(Value: Boolean); +begin + if Styles <> nil then + begin + if Value then + Styles.ActiveStyle := Self + else + Styles.ActiveStyle := nil; + Styles.ActiveStyleAssigned := Value; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetCaption(const Value: string); +begin + if Caption <> Value then + begin + FCaption := Value; + Changed; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetCompressWeekends( + Value: Boolean); +begin + SetBoolOption(FCompressWeekends, Value); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetDontPrintWeekends( + Value: Boolean); +begin + SetBoolOption(FDontPrintWeekEnds, Value); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetLayout( + Value: TcxSchedulerReportLinkPeriodicPrintStyleLayout); +begin + if FLayout <> Value then + begin + FLayout := Value; + Changed; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetResourceCountPerPage( + Value: Integer); +begin + if FResourceCountPerPage <> Value then + begin + FResourceCountPerPage := Value; + Changed; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetShowEventImages(Value: Boolean); +begin + if FShowEventImages <> Value then + begin + FShowEventImages := Value; + Changed; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetShowNotesAreaBlank( + Value: Boolean); +begin + SetBoolOption(FShowNotesAreaBlank, Value); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetShowNotesAreaLined( + Value: Boolean); +begin + SetBoolOption(FShowNotesAreaLined, Value); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetShowResourceImages(Value: Boolean); +begin + if FShowResourceImages <> Value then + begin + FShowResourceImages := Value; + Changed; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetShowTaskPad(Value: Boolean); +begin + SetBoolOption(FShowTaskPad, Value); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetTimePrintFrom(Value: TTime); +begin + PrintRange.TimePrintFrom := Value; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetTimePrintTo(Value: TTime); +begin + PrintRange.TimePrintTo := Value; +end; + +{ TcxSchedulerReportLinkDailyPrintStyle } + +constructor TcxSchedulerReportLinkDailyPrintStyle.Create( + AStyles: TcxSchedulerReportLinkPrintStyles); +begin + inherited Create(AStyles); + FShowEventImages := True; + FShowResourceImages := True; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionDaily); +end; + +function TcxSchedulerReportLinkDailyPrintStyle.IsCompatibleWith( + AView: TcxSchedulerCustomView): Boolean; +begin + Result := AView is TcxSchedulerDayView; +end; + +procedure TcxSchedulerReportLinkDailyPrintStyle.BeforeBuild; +begin + inherited BeforeBuild; + FCurrentPagePerDate := PagesPerPeriod; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.CanSplitSchedulingOnTwoPages: Boolean; +begin + Result := False; +end; + +procedure TcxSchedulerReportLinkDailyPrintStyle.CreateControlsOnFirstPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +begin + if Layout = pslOnePage then + CreateAdditionalControls(ASite, True, ShowTaskPad, + ShowNotesAreaBlank, ShowNotesAreaLined, True, ABounds); + InitReportCell(CreateSchedulingAreaCell(ASite), ABounds); +end; + +procedure TcxSchedulerReportLinkDailyPrintStyle.CreateControlsOnSecondPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +begin + CreateAdditionalControls(ASite, False, ShowTaskPad, + ShowNotesAreaBlank, ShowNotesAreaLined, True, ABounds); +end; + +function TcxSchedulerReportLinkDailyPrintStyle.CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; +begin + Result := TcxSchedulerReportDailyCellsProducer.CreateEx(Self, ASite); +end; + +procedure TcxSchedulerReportLinkDailyPrintStyle.FillDatesForPage( + ADateList: TcxSchedulerDateList; APageIndex, APeriodIndex, ASubIndex: Integer); +begin + APageIndex := APageIndex div (Byte(Layout) + 1) div GetResourcePageCount; + ADateList.Add(PrintRange.PrintFrom + APageIndex); +end; + +function TcxSchedulerReportLinkDailyPrintStyle.GetCorrespondedView: TcxSchedulerCustomResourceView; +begin + if Scheduler <> nil then + Result := Scheduler.ViewDay + else + Result := inherited GetCorrespondedView; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.GetGlyphIndex: Integer; +begin + Result := Byte(HasAdditionalArea); + if Layout = pslTwoPages then + Result := 2; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.GetPageCount: Integer; +begin + Result := GetResourcePageCount * PrintRange.DayCount * (Byte(Layout) + 1); +end; + +function TcxSchedulerReportLinkDailyPrintStyle.GetPagesPerPeriod: Integer; +var + I, J: Integer; +begin + if (ResourceCountPerPage = 0) or (ResourceCount < 2) then + Result := Byte(Layout) + 1 + else + begin + I := Min(ResourceCount, ResourceCountPerPage); + J := ResourceCount div I; + if J * I < ResourceCount then Inc(J); + Result := J * (Byte(Layout) + 1); + end; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.GetShowNotesAreaBlank: Boolean; +begin + Result := inherited GetShowNotesAreaBlank; + if not Result and (Layout <> pslOnePage) then + Result := not (ShowTaskPad or ShowNotesAreaLined); +end; + +procedure TcxSchedulerReportLinkDailyPrintStyle.InitHeaderCell( + ACell: TcxSchedulerReportSchedulerHeaderCell); +begin + ReportLink.SetCellViewParams(ACell, VisualStyles.GetSchedulerHeaderParams); + ACell.PrimaryText := DateTimeHelper.DateToLongDateStr(CurrentDate); + ACell.SecondaryText := LongDayNames[DayOfWeek(CurrentDate)]; + inherited InitHeaderCell(ACell); + Dec(FCurrentPagePerDate); + if FCurrentPagePerDate = 0 then + begin + CurrentDate := CurrentDate + 1; + FCurrentPagePerDate := PagesPerPeriod; + end; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.SupportMessage: Boolean; +begin + Result := True; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.SupportTimeRange: Boolean; +begin + Result := True; +end; + +{ TcxSchedulerReportLinkCustomDetailsPrintStyle } + +function TcxSchedulerReportLinkCustomDetailsPrintStyle.AddPageSite( + const ABounds: TRect): TcxSchedulerReportPageSite; +begin + Inc(BuildedPageCount); + Result := inherited AddPageSite(ABounds); +end; + +procedure TcxSchedulerReportLinkCustomDetailsPrintStyle.BeforeBuild; +begin + CurrentPage := nil; + CellsOnPage := 0; + BuildedPageCount := 0; + FTimeWidth := MeasureTimeWidth; + inherited BeforeBuild; +end; + +function TcxSchedulerReportLinkCustomDetailsPrintStyle.GetNextPage( + APrevPage: TcxSchedulerReportPageSite; out ABounds: TRect): TcxSchedulerReportPageSite; +begin + CellsOnPage := 0; + if APrevPage = nil then + Result := PageSites[0] + else + Result := AddPageSite(GetPageSiteBounds(BuildedPageCount)); + ABounds := Result.GetInnerBounds(0); + if GetHasPageReportTitle(BuildedPageCount - 1) then + Inc(ABounds.Top, ReportLink.RenderInfo.CalculateTitleHeight); +end; + +function TcxSchedulerReportLinkCustomDetailsPrintStyle.GetPageCount: Integer; +begin + Result := Max(1, BuildedPageCount); +end; + +function TcxSchedulerReportLinkCustomDetailsPrintStyle.MeasureTimeWidth: Integer; +var + AFont: TFont; +begin + AFont := ReportLink.Font; + if (VisualStyles.Event <> nil) and (cxStyles.svFont in VisualStyles.Event.AssignedValues) then + AFont := VisualStyles.Event.Font; + Result := cxTextWidth(AFont, '00:00 - 00:00') * 2; +end; + +function TcxSchedulerReportLinkCustomDetailsPrintStyle.GetPageWidth: Integer; +begin + Result := ReportLink.PageWidth; +end; + +{ TcxSchedulerReportLinkDetailsPrintStyle } + +procedure TcxSchedulerReportLinkDetailsPrintStyle.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLinkDetailsPrintStyle then + begin + PaginationMode := TcxSchedulerReportLinkDetailsPrintStyle(Source).PaginationMode; + UsePagination := TcxSchedulerReportLinkDetailsPrintStyle(Source).UsePagination; + end; + inherited Assign(Source); +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionDetails); +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.RestoreDefaults; +begin + PaginationMode := dpmByDay; + UsePagination := False; + inherited RestoreDefaults; +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.AddDayHeader(ADate: TDateTime; + AContinue: Boolean; var ABounds: TRect): TcxSchedulerReportSchedulerHeaderCell; +var + R: TRect; +begin + Result := TcxSchedulerReportSchedulerHeaderCell.Create(CurrentPage); + Result.Date := ADate; + R := cxRectSetHeight(ABounds, DayHeaderHeight); + ABounds.Top := R.Bottom + InterAreaSpace; + Result.Transparent := False; + Result.PrimaryText := GetDayHeaderText(AContinue); + InitReportCell(Result, R); + Result.Content.BoundsRect := Result.GetInnerBounds(0); + Result.AdjustTextSize; +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.BeforeBuild; +begin + PreviousHeader := nil; + CellsOnPage := 0; + inherited BeforeBuild; +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.BuildPages; +var + ADayEvents: TcxSchedulerEventList; +begin + ADayEvents := TcxSchedulerEventList.Create; + try + CellsOnPage := 0; + Site := nil; + DayIndex := 0; + while DayIndex < PrintRange.DayCount do + begin + ADayEvents.Clear; + Events.ExtractEvents(CurrentDate, ADayEvents); + Events.Sort(@cxCompareEventsOrder); + if (ADayEvents.Count > 0) and (Site = nil) then + begin + Site := AddPageSite(GetPageSiteBounds(0)); + PrepareNextPage; + end; + if (CellsOnPage > 0) and (ADayEvents.Count > 0) then + CheckPagination; + EventIndex := 0; + while EventIndex < ADayEvents.Count do + begin + CurrentCell := AddEventCell(ADayEvents[EventIndex]); + ReportLink.DoInitializeEventCell(CurrentCell); + if (CellsOnPage > 0) and (MeasureCellBounds.Bottom > CurrentPageBounds.Bottom) then + PrepareNextPage; + HeaderNeeded; + SetCellPlace; + Inc(EventIndex); + end; + CurrentDate := CurrentDate + 1; + Inc(DayIndex); + end; + finally + ADayEvents.Free; + end; +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.GetDayHeaderHeight: Integer; +var + DC: HDC; +begin + DC := GetDC(0); + try + Result := ReportLink.Renderer.CalcTextHeight(DC, 'Wg', False, GetSchedulerHeaderParams.NativeParams.Font) * 2; + finally + ReleaseDC(0, DC); + end +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.GetDayHeaderText(AContinue: Boolean): string; +begin + Result := DateTimeHelper.DateToLongDateStr(CurrentDate); + if AContinue then + Result := Result + ' ' + cxGetResourceString(@sdxContinuedMessage); +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.GetGlyphIndex: Integer; +begin + Result := 22; +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.GetPreviewGlyphIndex: Integer; +begin + Result := 16; +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.GetSchedulerHeaderParams: TdxReportItemViewParams; +begin + FillChar(Result, SizeOf(Result), 0); + Result.NativeParams := VisualStyles.GetDayHeaderParams(CurrentDate); + Include(Result.FontStyle, fsBold); +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.AddEventCell( + AEvent: TcxSchedulerEvent): TcxSchedulerReportDetailsEventCell; +begin + Result := TcxSchedulerReportDetailsEventCell.CreateEx(Site, AEvent, + CurrentDate, VisualStyles.GetEventParams(AEvent), + (AEvent.Start < CurrentDate) and (CurrentDate > PrintRange.PrintFrom)); + Result.CalculateLayout(PageWidth, TimeWidth); +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.CheckPagination; +begin + if not UsePagination then Exit; + case PaginationMode of + dpmByDay: + PrepareNextPage; + dpmByWeek: + if GetWeekNumber(CurrentDate, dSunday, fwySystem) <> + GetWeekNumber(PreviousHeader.Date, dSunday, fwySystem) then + PrepareNextPage; + dpmByMonth: + if MonthOf(CurrentDate) <> MonthOf(PreviousHeader.Date) then + PrepareNextPage; + end; +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.HeaderNeeded; +begin + if NeedAddDayHeader then + PreviousHeader := AddDayHeader(CurrentDate, EventIndex > 0, CurrentPageBounds); +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.NeedAddDayHeader: Boolean; +begin + Result := (CellsOnPage = 0) or (PreviousHeader = nil) or (PreviousHeader.Date <> CurrentDate); +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.MeasureCellBounds: TRect; +begin + Result := CurrentPageBounds; + Result.Bottom := Result.Top + CurrentCell.CalculateHeight; + if NeedAddDayHeader then + Inc(Result.Bottom, DayHeaderHeight); +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.PrepareNextPage; +begin + CurrentPage := GetNextPage(CurrentPage, CurrentPageBounds); +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.SetCellPlace; +begin + Inc(CellsOnPage); + CurrentCell.BoundsRect := MeasureCellBounds; + CurrentCell.Parent := CurrentPage; + CurrentPageBounds.Top := CurrentCell.BoundsRect.Bottom + InterAreaSpace; +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.SetPaginationMode( + Value: TcxSchedulerReportLinkDetailsPrintStylePaginationMode); +begin + if FPaginationMode <> Value then + begin + FPaginationMode := Value; + Changed; + end; +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.SetUsePagination( + Value: Boolean); +begin + SetBoolOption(FUsePagination, Value); +end; + +{ TcxSchedulerReportLinkMemoPrintStyle } + +procedure TcxSchedulerReportLinkMemoPrintStyle.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLinkMemoPrintStyle then + with TcxSchedulerReportLinkMemoPrintStyle(Source) do + begin + Self.FSelectedEventsOnly := FSelectedEventsOnly; + Self.FStartEachItemOnNewPage := FStartEachItemOnNewPage; + end; + inherited Assign(Source); +end; + +function TcxSchedulerReportLinkMemoPrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionMemo); +end; + +procedure TcxSchedulerReportLinkMemoPrintStyle.RestoreDefaults; +begin + FSelectedEventsOnly := True; + FStartEachItemOnNewPage := True; + inherited RestoreDefaults; +end; + +function TcxSchedulerReportLinkMemoPrintStyle.AddEventCell( + AEvent: TcxSchedulerEvent): TcxSchedulerReportDetailsEventCell; +begin + Result := TcxSchedulerReportMemoEventCell.CreateEx(CurrentPage, AEvent, + NullDate, VisualStyles.GetEventParams(AEvent)); + Result.CalculateLayout(PageWidth, TimeWidth); +end; + +procedure TcxSchedulerReportLinkMemoPrintStyle.BuildPages; +var + I: Integer; + APageBounds: TRect; + ACell: TcxSchedulerReportDetailsEventCell; + + function GetCellBounds: TRect; + begin + Result := APageBounds; + Result.Bottom := Result.Top + ACell.CalculateHeight; + end; + +begin + Site := nil; + if Events.Count = 0 then Exit; + Site := AddPageSite(GetPageSiteBounds(0)); + CurrentPage := GetNextPage(CurrentPage, APageBounds); + Events.Sort(@cxCompareEventsOrder); + for I := 0 to Events.AbsoluteCount - 1 do + begin + ACell := AddEventCell(Events[I]); + ReportLink.DoInitializeEventCell(ACell); + if (CellsOnPage > 0) and (StartEachItemOnNewPage or + (GetCellBounds.Bottom > APageBounds.Bottom)) then + CurrentPage := GetNextPage(CurrentPage, APageBounds); + ACell.Parent := CurrentPage; + ACell.BoundsRect := GetCellBounds; + APageBounds.Top := ACell.BoundsRect.Bottom + InterAreaSpace; + Inc(CellsOnPage); + end; +end; + +procedure TcxSchedulerReportLinkMemoPrintStyle.DoCanPrintEvent( + AEvent: TcxSchedulerEvent; var AllowPrint: Boolean); +var + I: Integer; + AUseEvent: Boolean; +begin + if SelectedEventsOnly and (Scheduler <> nil) then + begin + AllowPrint := False; + for I := 0 to Scheduler.SelectedEventCount - 1 do + begin + AllowPrint := Scheduler.SelectedEvents[I].Source = TcxSchedulerControlEvent(AEvent).Source; + if AllowPrint then Break; + end; + end; + AUseEvent := False; + for I := 0 to PrintRange.DayCount - 1 do + if AEvent.IsDayEvent(PrintRange.PrintFrom + I) then + begin + AUseEvent := True; + Break; + end; + if AUseEvent then + inherited DoCanPrintEvent(AEvent, AllowPrint) + else + AllowPrint := False; +end; + +function TcxSchedulerReportLinkMemoPrintStyle.GetGlyphIndex: Integer; +begin + Result := 20; +end; + +function TcxSchedulerReportLinkMemoPrintStyle.GetPreviewGlyphIndex: Integer; +begin + Result := 17; +end; + +function TcxSchedulerReportLinkMemoPrintStyle.MeasureTimeWidth: Integer; +var + AFont: TFont; +begin + AFont := ReportLink.Font; + if (VisualStyles.Event <> nil) and (cxStyles.svFont in VisualStyles.Event.AssignedValues) then + AFont := VisualStyles.Event.Font; + Result := 0; + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxSubjectLabelCaption))); + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxLocationLabelCaption))); + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxStartLabelCaption))); + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxFinishLabelCaption))); + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxShowTimeAsLabelCaption))); + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxRecurrenceLabelCaption))); + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxRecurrencePatternLabelCaption))); + if Result = 0 then + Result := inherited MeasureTimeWidth + else + Inc(Result, cxTextWidth(AFont, '0000 - 0000')); + Result := Min(PageWidth div 3, Result); +end; + +{ TcxSchedulerReportLinkMonthlyPrintStyle } + +constructor TcxSchedulerReportLinkMonthlyPrintStyle.Create( + AStyles: TcxSchedulerReportLinkPrintStyles); +begin + inherited Create(AStyles); + FShowResourceImages := True; +end; + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLinkMonthlyPrintStyle then + PrintExactlyOneMonthPerPage := + TcxSchedulerReportLinkMonthlyPrintStyle(Source).PrintExactlyOneMonthPerPage; + inherited Assign(Source); +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionMonthly); +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.IsCompatibleWith( + AView: TcxSchedulerCustomView): Boolean; +begin + Result := AView is TcxSchedulerWeeksView; +end; + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.RestoreDefaults; +begin + PrintExactlyOneMonthPerPage := False; + inherited RestoreDefaults; +end; + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.CreateControlsOnFirstPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +begin + if Layout = pslTwoPages then + CreateAdditionalControls(ASite, True, ShowTaskPad and + (ShowNotesAreaLined or ShowNotesAreaBlank), False, False, False, ABounds) + else + CreateAdditionalControls(ASite, True, ShowTaskPad, + ShowNotesAreaBlank, ShowNotesAreaLined, True, ABounds); + InitReportCell(CreateSchedulingAreaCell(ASite), ABounds); +end; + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.CreateControlsOnSecondPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +var + HasTaskPad: Boolean; +begin + HasTaskPad := ShowTaskPad and not (ShowNotesAreaBlank or ShowNotesAreaLined); + CreateAdditionalControls(ASite, True, HasTaskPad, ShowNotesAreaBlank, + ShowNotesAreaLined, True, ABounds); + InitReportCell(CreateSchedulingAreaCell(ASite), ABounds); +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.GetCorrespondedView: TcxSchedulerCustomResourceView; +begin + if Scheduler <> nil then + Result := Scheduler.ViewWeeks + else + Result := inherited GetCorrespondedView; +end; + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.FillDatesForPage( + ADateList: TcxSchedulerDateList; APageIndex, APeriodIndex, ASubIndex: Integer); +var + I: Integer; + Y, M, D: Word; + AStart: TDateTime; +begin + AStart := GetDateForPage(APageIndex); + DecodeDate(AStart, Y, M, D); + for I := 0 to DaysInAMonth(Y, M) - 1 do + ADateList.Add(AStart + I); +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.GetDaysPerPeriod: Integer; +begin + Result := 30; +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.GetDateForPage( + APageIndex: Integer): TDateTime; +var + Y, M, D: Word; + APeriodIndex: Integer; +begin + APeriodIndex := APageIndex div (Byte(Layout) + 1) div GetResourcePageCount; + DecodeDate(PrintRange.PrintFrom, Y, M, D); + D := 1; + IncAMonth(Y, M, D, APeriodIndex); + Result := EncodeDate(Y, M, D); +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.GetGlyphIndex: Integer; +begin + Result := 11 + Byte(HasAdditionalArea); + if Layout = pslTwoPages then + Inc(Result, 2); +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.GetPageCount: Integer; +begin + Result := PrintRange.MonthCount * (Byte(Layout) + 1) * GetResourcePageCount; +end; + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.InitHeaderCell( + ACell: TcxSchedulerReportSchedulerHeaderCell); + + function GetMonthText(ADate: TDateTime): string; + begin + Result := FormatDateTime('mmmm', ADate) + ' ' + IntToStr(YearOf(ADate)); + end; + +var + ADate: TDateTime; +begin + ADate := GetDateForPage(ACell.PageIndex); + if PrintExactlyOneMonthPerPage then + ACell.PrimaryText := GetMonthText(ADate) + else + ACell.PrimaryText := GetMonthText(ADate) + ' - ' + GetMonthText(ADate + 32); + inherited InitHeaderCell(ACell); +end; + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.SetPrintExactlyOneMonthPerPage( + Value: Boolean); +begin + SetBoolOption(FPrintExactlyOneMonthPerPage, Value); +end; + +{ TcxSchedulerReportLinkTimeLinePrintStyle } + +constructor TcxSchedulerReportLinkTimeLinePrintStyle.Create( + AStyles: TcxSchedulerReportLinkPrintStyles); +begin + inherited Create(AStyles); + FShowLinks := True; + FShowEventImages := True; + FShowLinks := True; + FShowResourceImages := True; + FLayoutBuilder := TcxSchedulerReportTimeLineLayoutBuilder.CreateEx(Self); +end; + +destructor TcxSchedulerReportLinkTimeLinePrintStyle.Destroy; +begin + FLayoutBuilder.Free; + inherited Destroy; +end; + +procedure TcxSchedulerReportLinkTimeLinePrintStyle.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLinkTimeLinePrintStyle then + FShowLinks := True; + inherited Assign(Source); +end; + +function TcxSchedulerReportLinkTimeLinePrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionTimeLine); +end; + +function TcxSchedulerReportLinkTimeLinePrintStyle.IsCompatibleWith( + AView: TcxSchedulerCustomView): Boolean; +begin + Result := AView is TcxSchedulerTimeGridView; +end; + +procedure TcxSchedulerReportLinkTimeLinePrintStyle.RestoreDefaults; +begin + FShowLinks := True; + inherited RestoreDefaults; +end; + +procedure TcxSchedulerReportLinkTimeLinePrintStyle.BeforeBuild; +begin + FLayoutBuilder.CalculateLayout; + inherited BeforeBuild; +end; + +procedure TcxSchedulerReportLinkTimeLinePrintStyle.BuildSchedulerCells( + ASite: TcxSchedulerReportSchedulingAreaCell); +begin + ASite.CellSides := ASite.CellSides + csAll; + inherited BuildSchedulerCells(ASite); +end; + +function TcxSchedulerReportLinkTimeLinePrintStyle.CanDontPrintWeekends: Boolean; +begin + Result := GetCorrespondedView is TcxSchedulerTimeGridView; + if Result then + Result := CorrespondedView.Scales.MinorUnit <= suDay; +end; + +function TcxSchedulerReportLinkTimeLinePrintStyle.CheckPrintRangeDate( + const ADate: TDateTime; AIndex: Integer): TDateTime; +begin + Result := inherited CheckPrintRangeDate(ADate, AIndex); + if Result = NullDate then + begin + if AIndex = 0 then + Result := CorrespondedView.VisibleStart + else + Result := CorrespondedView.VisibleFinish; + Result := DateOf(Result); + end; +end; + +function TcxSchedulerReportLinkTimeLinePrintStyle.CheckPrintRangeTime( + const ATime: TDateTime; AIndex: Integer): TDateTime; +begin + Result := inherited CheckPrintRangeDate(ATime, AIndex); + if Result = NullDate then + begin + if AIndex = 0 then + Result := CorrespondedView.VisibleStart + else + Result := CorrespondedView.VisibleFinish; + Result := TimeOf(Result); + end; +end; + +function TcxSchedulerReportLinkTimeLinePrintStyle.CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; +begin + Result := TcxSchedulerReportTimeLineCellsProducer.CreateEx(Self, ASite); +end; + +procedure TcxSchedulerReportLinkTimeLinePrintStyle.CreateControlsOnFirstPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +begin + CreateAdditionalControls(ASite, True, ShowTaskPad, + ShowNotesAreaBlank, ShowNotesAreaLined, False, ABounds); + InitReportCell(CreateSchedulingAreaCell(ASite), ABounds); +end; + +function TcxSchedulerReportLinkTimeLinePrintStyle.GetCorrespondedView: TcxSchedulerCustomResourceView; +begin + if Scheduler <> nil then + begin + if Scheduler.CurrentView is TcxSchedulerTimeGridView then + Result := Scheduler.CurrentView as TcxSchedulerTimeGridView + else + Result := Scheduler.ViewTimeGrid + end + else + Result := inherited GetCorrespondedView; +end; + +function TcxSchedulerReportLinkTimeLinePrintStyle.GetGlyphIndex: Integer; +begin + Result := 28; +end; + +function TcxSchedulerReportLinkTimeLinePrintStyle.GetHasPageHeader( + APageIndex: Integer): Boolean; +begin + Result := False; +end; + +function TcxSchedulerReportLinkTimeLinePrintStyle.GetPageCount: Integer; +begin + Result := LayoutBuilder.PageCount; +end; + +function TcxSchedulerReportLinkTimeLinePrintStyle.GetPreviewGlyphIndex: Integer; +begin + Result := 23; +end; + +function TcxSchedulerReportLinkTimeLinePrintStyle.SupportMessage: Boolean; +begin + Result := True; +end; + +function TcxSchedulerReportLinkTimeLinePrintStyle.GetPageHeight: Integer; +begin + Result := ReportLink.PageHeight; +end; + +function TcxSchedulerReportLinkTimeLinePrintStyle.GetPageWidth(AColumn: Integer): Integer; +begin + Result := ReportLink.PageWidth; + if AColumn = 0 then + Dec(Result, GetPanelWidth); +end; + +function TcxSchedulerReportLinkTimeLinePrintStyle.GetPanelWidth: Integer; +begin + Result := 0; + if ShowTaskPad or ShowNotesAreaBlank or ShowNotesAreaLined then + Result := AdditionalWidth(Rect(0, 0, ReportLink.PageWidth, 0)) + InterAreaSpace; +end; + +function TcxSchedulerReportLinkTimeLinePrintStyle.GetPrintFrom: TDateTime; +begin + Result := PrintRange.PrintFrom + PrintRange.TimePrintFrom; +end; + +function TcxSchedulerReportLinkTimeLinePrintStyle.GetPrintTo: TDateTime; +begin + Result := PrintRange.PrintTo + PrintRange.TimePrintTo; +end; + +function TcxSchedulerReportLinkTimeLinePrintStyle.GetTimeGridView: TcxSchedulerTimeGridView; +begin + Result := inherited CorrespondedView as TcxSchedulerTimeGridView; +end; + +procedure TcxSchedulerReportLinkTimeLinePrintStyle.SetPrimaryPageHeadersOnly( + AValue: Boolean); +begin + if AValue <> FPrimaryPageHeadersOnly then + begin + FPrimaryPageHeadersOnly := AValue; + Changed; + end; +end; + +procedure TcxSchedulerReportLinkTimeLinePrintStyle.SetPrimaryPageScalesOnly( + AValue: Boolean); +begin + if AValue <> FPrimaryPageScalesOnly then + begin + FPrimaryPageScalesOnly := AValue; + Changed; + end; +end; + +procedure TcxSchedulerReportLinkTimeLinePrintStyle.SetShowLinks(AValue: Boolean); +begin + if AValue <> FShowLinks then + begin + FShowLinks := AValue; + Changed; + end; +end; + +procedure TcxSchedulerReportLinkTimeLinePrintStyle.SetWorkTimeOnly(AValue: Boolean); +begin + if AValue <> FWorkTimeOnly then + begin + FWorkTimeOnly := AValue; + Changed; + end; +end; + +{ TcxSchedulerReportLinkTrifoldPrintStyle } + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerReportLinkTrifoldPrintStyle then + with TcxSchedulerReportLinkTrifoldPrintStyle(Source) do + begin + Self.LeftSection := LeftSection; + Self.MiddleSection := MiddleSection; + Self.RightSection := RightSection; + end; +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionTrifold); +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.RestoreDefaults; +begin + inherited RestoreDefaults; + FSections[0] := smDailyCalendar; + FSections[1] := smTaskPad; + FSections[2] := smWeeklyCalendar; +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.CreateLayoutForPeriod( + APeriodIndex: Integer); +var + I: Integer; + R: array[0..2] of TRect; + ABounds: TRect; + ASite: TcxSchedulerReportPageSite; +begin + ABounds := GetPageSiteBounds(APeriodIndex); + ASite := AddPageSite(ABounds); + ASite.FPageIndex := APeriodIndex; + ASite.FPrimaryPage := True; + ABounds := ASite.GetInnerBounds(0); + if GetHasPageReportTitle(APeriodIndex) then + Inc(ABounds.Top, ReportLink.RenderInfo.CalculateTitleHeight); + Rect2RectsHorz(ABounds, R[0], R[1], R[2]); + for I := 0 to 2 do + CreateLayoutForSection(ASite, APeriodIndex, R[I], FSections[I]); +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.CreateLayoutForSection( + ASite: TdxReportCell; APeriodIndex: Integer; const ABounds: TRect; + ASection: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode); +begin + FCurrentSection := ASection; + case ASection of + smDailyCalendar: + CreateSchedulingAreaWithHeader(ASite, ABounds); + smWeeklyCalendar: + CreateSchedulingAreaWithHeader(ASite, ABounds); + smMonthlyCalendar: + CreateSchedulingAreaWithHeader(ASite, ABounds); + smTaskPad: + InitReportCell(CreateTaskPadCell(ASite), ABounds); + smNotesAreaBlank: + InitReportCell(CreateNotesCell(ASite), ABounds); + smNotesAreaLined: + InitReportCell(CreateNotesLinedCell(ASite), ABounds); + end; +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.CreateSchedulingAreaWithHeader( + ASite: TdxReportCell; ABounds: TRect); +var + R: TRect; + AHeader: TcxSchedulerReportSchedulerHeaderCell; +begin + R := ABounds; + R.Bottom := R.Top + Round((R.Bottom - R.Top) * SchedulerHeaderSmallHeight); + ABounds.Top := R.Bottom + InterAreaSpace; + FCurrentSchedulingArea := CreateSchedulingAreaCell(ASite); + InitReportCell(FCurrentSchedulingArea, ABounds); + AHeader := CreateHeaderCell(ASite); + InitReportCell(AHeader, R); + AHeader.Content.BoundsRect := AHeader.GetInnerBounds(0); + AHeader.AdjustTextSize; +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; +begin + case FCurrentSection of + smDailyCalendar: + Result := TcxSchedulerReportDailyCellsProducer.CreateEx(Self, ASite); + smWeeklyCalendar, smMonthlyCalendar: + Result := TcxSchedulerReportWeeksCellsProducer.CreateEx(Self, ASite); + else + Result := nil; + end; +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.FillDatesForPage( + ADateList: TcxSchedulerDateList; APageIndex, APeriodIndex, ASubIndex: Integer); +var + I: Integer; + ADate: TDateTime; +begin + ADateList.Clear; + case FCurrentSection of + smDailyCalendar: + ADateList.Add(APageIndex + PrintRange.PrintFrom); + smWeeklyCalendar: + begin + if HasDailySection then + ADate := StartOfTheWeek(APageIndex + PrintRange.PrintFrom) + else + ADate := StartOfTheWeek(PrintRange.PrintFrom + + MulDiv(APageIndex * 7, PrintRange.WeekCount, PageCount)); + for I := 0 to 7 do + ADateList.Add(ADate + I); + end; + smMonthlyCalendar: + begin + ADate := StartOfTheMonth(PrintRange.PrintFrom + APageIndex * FPageRange); + for I := 0 to DaysInMonth(ADate) do + ADateList.Add(ADate + I); + end; + end; +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.GetCorrespondedView: TcxSchedulerCustomResourceView; +begin + case FCurrentSection of + smDailyCalendar: + Result := Scheduler.ViewDay; + smWeeklyCalendar: + Result := Scheduler.ViewWeek; + smMonthlyCalendar: + Result := Scheduler.ViewWeeks; + else + Result := inherited GetCorrespondedView; + end; +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.GetGlyphIndex: Integer; +begin + Result := 15; +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.GetPageCount: Integer; +var + I: Integer; +begin + Result := 1; + FPageRange := 30; + for I := 0 to 2 do + begin + case FSections[I] of + smDailyCalendar: + begin + Result := Max(Result, PrintRange.DayCount); + FPageRange := 1; + end; + smWeeklyCalendar: + begin + Result := Max(Result, PrintRange.WeekCount); + FPageRange := Min(FPageRange, 7); + end; + smMonthlyCalendar: + begin + Result := Max(Result, PrintRange.MonthCount); + FPageRange := Min(FPageRange, 30); + end; + end; + end; +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.InitHeaderCell( + ACell: TcxSchedulerReportSchedulerHeaderCell); +var + AText: string; + ADate1, ADate2: TDateTime; +begin + with FCurrentSchedulingArea.VisibleDays do + begin + ADate1 := Items[0]; + ADate2 := Items[Count - 1]; + end; + case FCurrentSection of + smDailyCalendar: + AText := DateTimeHelper.DateToLongDateStr(ADate1); + smWeeklyCalendar: + AText := DateTimeHelper.DayToStr(ADate1, 0, False) + ' - ' + + DateTimeHelper.DayToStr(ADate2 - 1, 0, False); + smMonthlyCalendar: + if not cxGetDateFormat(ADate1, AText, DATE_YEARMONTH) then + AText := FormatDateTime('mmmm', ADate1) + ' ' + IntToStr(YearOf(ADate1)) + end; + ACell.PrimaryText := AText; + inherited InitHeaderCell(ACell); +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.GetSection( + Index: Integer): TcxSchedulerReportLinkTrifoldPrintStyleSectionMode; +begin + Result := FSections[Index]; +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.GetHasDailySection: Boolean; +begin + Result := smDailyCalendar in [FSections[0], FSections[1], FSections[2]] +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.SetSection( + Index: Integer; AValue: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode); +begin + if AValue <> FSections[Index] then + begin + FSections[Index] := AValue; + Changed; + end; +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.IsSectionStored( + Index: Integer): Boolean; +const + Sections: array[0..2] of TcxSchedulerReportLinkTrifoldPrintStyleSectionMode = + (smDailyCalendar, smTaskPad, smWeeklyCalendar); +begin + Result := FSections[Index] <> Sections[Index]; +end; + +{ TcxSchedulerReportLinkWeeklyPrintStyle } + +constructor TcxSchedulerReportLinkWeeklyPrintStyle.Create( + AStyles: TcxSchedulerReportLinkPrintStyles); +begin + inherited Create(AStyles); + FShowResourceImages := True; +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLinkWeeklyPrintStyle then + begin + Arrange := TcxSchedulerReportLinkWeeklyPrintStyle(Source).Arrange; + DaysLayout := TcxSchedulerReportLinkWeeklyPrintStyle(Source).DaysLayout; + end; + inherited Assign(Source); +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionWeekly); +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.IsCompatibleWith( + AView: TcxSchedulerCustomView): Boolean; +begin + Result := AView is TcxSchedulerWeekView; +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.RestoreDefaults; +begin + Arrange := wsaTopToBottom; + inherited RestoreDefaults; +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.Build; +var + APrevLayout: TcxSchedulerWeekViewDaysLayout; +begin + APrevLayout := Scheduler.ViewWeek.DaysLayout; + Scheduler.ViewWeek.DaysLayout := DaysLayout; + try + inherited Build; + finally + Scheduler.ViewWeek.DaysLayout := APrevLayout; + end; +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.CreateControlsOnFirstPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +begin + if Layout = pslTwoPages then + CreateAdditionalControls(ASite, True, ShowTaskPad and + (ShowNotesAreaLined or ShowNotesAreaBlank), False, False, False, ABounds) + else + CreateAdditionalControls(ASite, True, ShowTaskPad, + ShowNotesAreaBlank, ShowNotesAreaLined, True, ABounds); + InitReportCell(CreateSchedulingAreaCell(ASite), ABounds); +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.CreateControlsOnSecondPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +var + HasTaskPad: Boolean; +begin + HasTaskPad := ShowTaskPad and not (ShowNotesAreaBlank or ShowNotesAreaLined); + CreateAdditionalControls(ASite, True, HasTaskPad, ShowNotesAreaBlank, + ShowNotesAreaLined, True, ABounds); + InitReportCell(CreateSchedulingAreaCell(ASite), ABounds); +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; +const + CellsProducers: array[Boolean] of TcxSchedulerReportCommonCellsProducerClass = + (TcxSchedulerReportDailyCellsProducer, TcxSchedulerReportWeeksCellsProducer); +begin + Result := CellsProducers[Arrange = wsaTopToBottom].CreateEx(Self, ASite); +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetCorrespondedView: TcxSchedulerCustomResourceView; +begin + if Scheduler <> nil then + begin + if Arrange = wsaTopToBottom then + Result := Scheduler.ViewWeek + else + Result := Scheduler.ViewDay; + end + else + Result := inherited GetCorrespondedView; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetGlyphIndex: Integer; +begin + if (DaysLayout = wdlOneColumn) and (Layout = pslOnePage) then + Result := 27 + else + Result := 3 + Byte(Arrange) + Byte(HasAdditionalArea) * 4 + + Byte(Layout = pslTwoPages) * 2 +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetDateForPage( + APageIndex: Integer): TDateTime; +begin + Result := StartOfTheWeek(PrintRange.PrintFrom + (APageIndex div GetResourcePageCount div (Byte(Layout) + 1)) * 7); +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetDaysPerPeriod: Integer; +begin + Result := 7; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetPageCount: Integer; +begin + Result := PrintRange.WeekCount * (Byte(Layout) + 1) * GetResourcePageCount; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetPreviewGlyphIndex: Integer; +begin + if (DaysLayout = wdlOneColumn) and (Layout = pslOnePage) then + Result := 22 + else + Result := inherited GetPreviewGlyphIndex; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetStartOfWeekOffset: Integer; +begin + Result := -DayOfWeek(PrintRange.PrintFrom) + 2; // +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.FillDatesForPage( + ADateList: TcxSchedulerDateList; APageIndex, APeriodIndex, ASubIndex: Integer); +const + DayCount: array[TcxSchedulerReportLinkPeriodicPrintStyleLayout, Boolean] of Integer = + ((7, 7), (3, 4)); +var + I: Integer; + AStart, ADate: TDateTime; +begin + AStart := GetDateForPage(APageIndex); + if Arrange = wsaLeftToRight then + for I := 0 to DayCount[Layout, ASubIndex <> 0] - 1 do + begin + ADate := AStart + ASubIndex * 3 + I; + if not DontPrintWeekEnds or not (DayOfWeek(ADate) in [1, 7]) then + ADateList.Add(ADate); + end + else + begin + AStart := AStart + Byte(Scheduler.OptionsView.ActualStartOfWeek); + for I := 0 to 6 do + ADateList.Add(AStart + I); + end; +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.InitHeaderCell( + ACell: TcxSchedulerReportSchedulerHeaderCell); + + function GetWeekDayText(ADate: TDateTime): string; + begin + Result := DateTimeHelper.DayToStr(ADate, 0, False); + end; + +var + AWeekDate: TDateTime; +begin + AWeekDate := GetDateForPage(ACell.PageIndex); + ACell.PrimaryText := GetWeekDayText(AWeekDate) + ' - ' + + GetWeekDayText(AWeekDate + 6); + inherited InitHeaderCell(ACell); +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.CanDontPrintWeekends: Boolean; +begin + Result := SupportTimeRange; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.SupportMessage: Boolean; +begin + Result := Arrange = wsaLeftToRight; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.SupportTimeRange: Boolean; +begin + Result := Arrange = wsaLeftToRight; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.IsDaysLayoutStored: Boolean; +begin + Result := FDaysLayoutAssigned and (DaysLayout <> wdlTwoColumns); +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetDaysLayout: TcxSchedulerWeekViewDaysLayout; +begin + if DaysLayoutAssigned or (Scheduler = nil) then + Result := FDaysLayout + else + Result := Scheduler.ViewWeek.DaysLayout; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.IsArrangeStored: Boolean; +begin + Result := Arrange <> wsaTopToBottom; +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.SetArrange( + Value: TcxSchedulerReportLinkWeeklyPrintStyleArrange); +begin + if Arrange <> Value then + begin + FArrange := Value; + Changed; + end; +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.SetDaysLayout( + Value: TcxSchedulerWeekViewDaysLayout); +begin + FDaysLayout := Value; + FDaysLayoutAssigned := True; + Changed; +end; + +{ TcxSchedulerReportLinkYearlyPrintStyle } + +procedure TcxSchedulerReportLinkYearlyPrintStyle.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLinkYearlyPrintStyle then + with TcxSchedulerReportLinkYearlyPrintStyle(Source) do + begin + Self.FMonthCountPerPage := FMonthCountPerPage; + Self.FPrimaryPageHeadersOnly := FPrimaryPageHeadersOnly; + end; + inherited Assign(Source); +end; + +function TcxSchedulerReportLinkYearlyPrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionYearly); +end; + +function TcxSchedulerReportLinkYearlyPrintStyle.IsCompatibleWith( + AView: TcxSchedulerCustomView): Boolean; +begin + Result := AView is TcxSchedulerYearView; +end; + +procedure TcxSchedulerReportLinkYearlyPrintStyle.RestoreDefaults; +begin + FMonthCountPerPage := 12; + FPrimaryPageHeadersOnly := False; + inherited RestoreDefaults; +end; + +procedure TcxSchedulerReportLinkYearlyPrintStyle.BuildSchedulerCells( + ASite: TcxSchedulerReportSchedulingAreaCell); +begin + ASite.CellSides := ASite.CellSides + [csRight]; + inherited BuildSchedulerCells(ASite); +end; + +procedure TcxSchedulerReportLinkYearlyPrintStyle.CreateControlsOnFirstPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); +begin + if (Layout = pslTwoPages) and (APageIndex mod 2 = 0) then + CreateAdditionalControls(ASite, True, ShowTaskPad and + (ShowNotesAreaLined or ShowNotesAreaBlank), False, False, False, ABounds) + else + CreateAdditionalControls(ASite, True, ShowTaskPad, + ShowNotesAreaBlank, ShowNotesAreaLined, True, ABounds); + InitReportCell(CreateSchedulingAreaCell(ASite), ABounds); +end; + +procedure TcxSchedulerReportLinkYearlyPrintStyle.CreateControlsOnSecondPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); +var + HasTaskPad: Boolean; +begin + HasTaskPad := ShowTaskPad and not (ShowNotesAreaBlank or ShowNotesAreaLined); + CreateAdditionalControls(ASite, True, HasTaskPad, ShowNotesAreaBlank, + ShowNotesAreaLined, True, ABounds); + InitReportCell(CreateSchedulingAreaCell(ASite), ABounds); +end; + +function TcxSchedulerReportLinkYearlyPrintStyle.CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; +begin + Result := TcxSchedulerReportYearlyCellsProducer.CreateEx(Self, ASite); +end; + +procedure TcxSchedulerReportLinkYearlyPrintStyle.FillDatesForPage( + ADateList: TcxSchedulerDateList; APageIndex, APeriodIndex, ASubIndex: Integer); +begin + ADateList.Clear; + APageIndex := APageIndex div PeriodPageCount; + ADateList.Add(EncodeDate(YearOf(PrintRange.PrintFrom) + APageIndex, 1, 1)) +end; + +function TcxSchedulerReportLinkYearlyPrintStyle.GetCorrespondedView: TcxSchedulerCustomResourceView; +begin + if Scheduler <> nil then + Result := Scheduler.ViewYear + else + Result := inherited GetCorrespondedView; +end; + +function TcxSchedulerReportLinkYearlyPrintStyle.GetHasPageHeader( + APageIndex: Integer): Boolean; +const + Indexes: array[TcxSchedulerReportLinkPeriodicPrintStyleLayout] of Integer = (0, 1); +begin + APageIndex := APageIndex mod PeriodPageCount; + Result := not PrimaryPageHeadersOnly or (APageIndex <= Indexes[Layout]); +end; + +function TcxSchedulerReportLinkYearlyPrintStyle.GetGlyphIndex: Integer; +begin + Result := 23 + Byte(HasAdditionalArea); + if Layout = pslTwoPages then + Inc(Result, 2); +end; + +function TcxSchedulerReportLinkYearlyPrintStyle.GetPreviewGlyphIndex: Integer; +begin + Result := 18 + Byte(HasAdditionalArea); + if Layout = pslTwoPages then + Inc(Result, 2); +end; + +function TcxSchedulerReportLinkYearlyPrintStyle.GetPageCount: Integer; +begin + Result := PrintRange.YearCount * GetResourcePageCount * + (12 div FMonthCountPerPage) * (Byte(Layout) + 1); +end; + +function TcxSchedulerReportLinkYearlyPrintStyle.GetShowDateNavigator( + APageIndex: Integer): Boolean; +begin + Result := False; +end; + +procedure TcxSchedulerReportLinkYearlyPrintStyle.InitHeaderCell( + ACell: TcxSchedulerReportSchedulerHeaderCell); + + function GetYearText(AYear: Word): string; + var + ADate: TDateTime; + S, S1: string; + begin + ADate := EncodeDate(AYear, 1, 1); + if not cxGetDateFormat(ADate, S, DATE_YEARMONTH) then + S := FormatDateTime('dddddd', ADate); + ADate := EncodeDate(AYear, 12, 31); + if not cxGetDateFormat(ADate, S1, DATE_YEARMONTH) then + S1 := FormatDateTime('dddddd', ADate); + Result := S + ' - ' + S1; + end; + +var + AIndex: Integer; +begin + if ACell.PageSite.PageIndex mod PeriodPageCount <> 0 then Exit; + AIndex := ACell.PageSite.PageIndex div PeriodPageCount; + ACell.Content.BoundsRect := ACell.GetInnerBounds(0); + ACell.PrimaryText := GetYearText(YearOf(PrintRange.PrintFrom) + AIndex); + inherited InitHeaderCell(ACell); +end; + +function TcxSchedulerReportLinkYearlyPrintStyle.GetPeriodPageCount: Integer; +begin + Result := (Byte(Layout) + 1) * 12 div MonthCountPerPage; +end; + +procedure TcxSchedulerReportLinkYearlyPrintStyle.SetMonthCountPerPage( + AValue: Integer); +begin + AValue := Max(1, Min(12, AValue)); + while 12 mod AValue <> 0 do + Inc(AValue); + if AValue <> FMonthCountPerPage then + begin + FMonthCountPerPage := AValue; + Changed; + end; +end; + +procedure TcxSchedulerReportLinkYearlyPrintStyle.SetPrimaryPageHeadersOnly( + AValue: Boolean); +begin + if AValue <> FPrimaryPageHeadersOnly then + begin + FPrimaryPageHeadersOnly := AValue; + Changed; + end; +end; + +{ TdxfmSchedulerReportLinkDesignWindow } + +constructor TcxfmSchedulerReportLinkDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxhccxSchedulerReportLinkDesigner; + inherited; + wpPrintStyles := TList.Create; + CreateControls; + SetActivePage; +end; + +destructor TcxfmSchedulerReportLinkDesignWindow.Destroy; +begin + FreeAndNil(wpPrintStyles); + dxPSPopupMan.dxPSPopupMenuController.UnregisterControl(lbxStyles); + inherited; +end; + +function TcxfmSchedulerReportLinkDesignWindow.Execute: Boolean; +begin + Self.FActiveStyle := ReportLink.PrintStyles.FActiveStyle; + Self.FActiveStyleAssigned := ReportLink.PrintStyles.FActiveStyleAssigned; + if (ReportLink.PrintStyles.ActiveStyle = nil) or not FActiveStyleAssigned then + with ReportLink.PrintStyles do SetActiveStyleEx(GetCorrespondingStyle); + Result := inherited Execute; + if Result then + ReportLink.PrintStyles.ActiveStyle := ActivePrintStyle + else + begin + ReportLink.PrintStyles.FActiveStyleAssigned := FActiveStyleAssigned; + ReportLink.PrintStyles.FActiveStyle := FActiveStyle; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignDailyTabObjects; +var + ADailyStyle: TcxSchedulerReportLinkDailyPrintStyle; +begin + ADailyStyle := ReportLink.PrintStyles.Daily; + cbxPrintStyleDailyLayout.ItemIndex := Integer(ADailyStyle.Layout); + sePrintStyleDailyResourceCountPerPage.Properties.MaxValue := ADailyStyle.ResourceCount; + sePrintStyleDailyResourceCountPerPage.Value := ADailyStyle.ResourceCountPerPage; + chbxPrintStyleDailyTaskPad.Checked := ADailyStyle.ShowTaskPad; + chbxPrintStyleDailyNotesAreaBlank.Checked := ADailyStyle.ShowNotesAreaBlank; + chbxPrintStyleDailyNotesAreaLined.Checked := ADailyStyle.ShowNotesAreaLined; + tePrintStyleDailyPrintFrom.Time := ADailyStyle.TimePrintFrom; + tePrintStyleDailyPrintTo.Time := ADailyStyle.TimePrintTo; + SetShowImagesCheckBoxes(chbxPrintStyleDailyShowEventImages, + chbxPrintStyleDailyShowResourceImages, ADailyStyle); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignDetailsTabObjects; +var + ADetailsStyle: TcxSchedulerReportLinkDetailsPrintStyle; +begin + ADetailsStyle := ReportLink.PrintStyles.Details; + chbxPrintStyleDetailsUsePagination.Checked := ADetailsStyle.UsePagination; + cbxPrintStyleDetailsPagination.ItemIndex := Integer(ADetailsStyle.PaginationMode); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignMemoTabObjects; +var + AMemoStyle: TcxSchedulerReportLinkMemoPrintStyle; +begin + AMemoStyle := ReportLink.PrintStyles.Memo; + chbxPrintStyleMemoStartEachItemOnNewPage.Checked := AMemoStyle.StartEachItemOnNewPage; + chbxPrintStyleMemoPrintOnlySelectedEvents.Checked := AMemoStyle.SelectedEventsOnly; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignTimeLineTabObjects; +var + ATimeLineStyle: TcxSchedulerReportLinkTimeLinePrintStyle; +begin + ATimeLineStyle := ReportLink.PrintStyles.TimeLine; + + sePrintStyleTimeLineResourceCountPerPage.Properties.MaxValue := ATimeLineStyle.ResourceCount; + sePrintStyleTimeLineResourceCountPerPage.Value := ATimeLineStyle.ResourceCountPerPage; + + chbxPrintStyleTimeLineTaskPad.Checked := ATimeLineStyle.ShowTaskPad; + chbxPrintStyleTimeLineNotesAreaBlank.Checked := ATimeLineStyle.ShowNotesAreaBlank; + chbxPrintStyleTimeLineNotesAreaLined.Checked := ATimeLineStyle.ShowNotesAreaLined; + + tePrintStyleTimeLinePrintFrom.Time := ATimeLineStyle.TimePrintFrom; + tePrintStyleTimeLinePrintTo.Time := ATimeLineStyle.TimePrintTo; + + chbxPrintStyleTimeLinePrimaryPageScalesOnly.Checked := ATimeLineStyle.PrimaryPageScalesOnly; + chbxPrintStyleTimeLinePrimaryPageHeadersOnly.Checked := ATimeLineStyle.PrimaryPageHeadersOnly; + chbxPrintStyleTimeLineDontPrintWeekends.Checked := ATimeLineStyle.DontPrintWeekends; + chbxPrintStyleTimeLineWorkTimeOnly.Checked := ATimeLineStyle.WorkTimeOnly; + + SetShowImagesCheckBoxes(chbxPrintStyleTimeLineShowEventImages, + chbxPrintStyleTimeLineShowResourceImages, ATimeLineStyle); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignMonthlyTabObjects; +var + AMonthlyStyle: TcxSchedulerReportLinkMonthlyPrintStyle; +begin + AMonthlyStyle := ReportLink.PrintStyles.Monthly; + cbxPrintStyleMonthlyLayout.ItemIndex := Integer(AMonthlyStyle.Layout); + sePrintStyleMonthlyResourceCountPerPage.Properties.MaxValue := AMonthlyStyle.ResourceCount; + sePrintStyleMonthlyResourceCountPerPage.Value := AMonthlyStyle.ResourceCountPerPage; + chbxPrintStyleMonthlyTaskPad.Checked := AMonthlyStyle.ShowTaskPad; + chbxPrintStyleMonthlyNotesAreaBlank.Checked := AMonthlyStyle.ShowNotesAreaBlank; + chbxPrintStyleMonthlyNotesAreaLined.Checked := AMonthlyStyle.ShowNotesAreaLined; + chbxPrintStyleMonthlyDontPrintWeekends.Checked := AMonthlyStyle.DontPrintWeekends; + chbxPrintStyleMonthlyPrintExactlyOneMonthPerPage.Checked := AMonthlyStyle.PrintExactlyOneMonthPerPage; + SetShowImagesCheckBoxes(chbxPrintStyleMonthlyShowEventImages, + chbxPrintStyleMonthlyShowResourceImages, AMonthlyStyle); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignTrifoldTabObjects; +var + ATrifoldStyle: TcxSchedulerReportLinkTrifoldPrintStyle; +begin + ATrifoldStyle := ReportLink.PrintStyles.Trifold; + cbxPrintStyleTrifoldSectionLeft.ItemIndex := Byte(ATrifoldStyle.LeftSection); + cbxPrintStyleTrifoldSectionMiddle.ItemIndex := Byte(ATrifoldStyle.MiddleSection); + cbxPrintStyleTrifoldSectionRight.ItemIndex := Byte(ATrifoldStyle.RightSection); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignWeeklyTabObjects; +var + AWeeklyStyle: TcxSchedulerReportLinkWeeklyPrintStyle; +begin + AWeeklyStyle := ReportLink.PrintStyles.Weekly; + cbxPrintStyleWeeklyArrange.ItemIndex := Integer(AWeeklyStyle.Arrange); + cbxPrintStyleWeeklyDaysLayout.ItemIndex := Integer(AWeeklyStyle.DaysLayout); + cbxPrintStyleWeeklyLayout.ItemIndex := Integer(AWeeklyStyle.Layout); + sePrintStyleWeeklyResourceCountPerPage.Properties.MaxValue := AWeeklyStyle.ResourceCount; + sePrintStyleWeeklyResourceCountPerPage.Value := AWeeklyStyle.ResourceCountPerPage; + chbxPrintStyleWeeklyTaskPad.Checked := AWeeklyStyle.ShowTaskPad; + chbxPrintStyleWeeklyNotesAreaBlank.Checked := AWeeklyStyle.ShowNotesAreaBlank; + chbxPrintStyleWeeklyNotesAreaLined.Checked := AWeeklyStyle.ShowNotesAreaLined; + chbxPrintStyleWeeklyDontPrintWeekends.Checked := AWeeklyStyle.DontPrintWeekends; + tePrintStyleWeeklyPrintFrom.Time := AWeeklyStyle.TimePrintFrom; + tePrintStyleWeeklyPrintTo.Time := AWeeklyStyle.TimePrintTo; + SetShowImagesCheckBoxes(chbxPrintStyleWeeklyShowEventImages, + chbxPrintStyleWeeklyShowResourceImages, AWeeklyStyle); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignYearlyTabObjects; +const + MontPerPageIndexes: array[0..11] of Integer = + (0, 1, 2, 3, 3, 4, 4, 4, 4, 4, 4, 5); +var + AYearlyStyle: TcxSchedulerReportLinkYearlyPrintStyle; +begin + AYearlyStyle := ReportLink.PrintStyles.Yearly; + cbxPrintStyleYearlyLayout.ItemIndex := Integer(AYearlyStyle.Layout); + cbxPrintStyleYearlyMonthPerPage.ItemIndex := MontPerPageIndexes[AYearlyStyle.MonthCountPerPage - 1]; + sePrintStyleYearlyResourceCountPerPage.Properties.MaxValue := AYearlyStyle.ResourceCount; + sePrintStyleYearlyResourceCountPerPage.Value := AYearlyStyle.ResourceCountPerPage; + chbxPrintStyleYearlyTaskPad.Checked := AYearlyStyle.ShowTaskPad; + chbxPrintStyleYearlyNotesAreaBlank.Checked := AYearlyStyle.ShowNotesAreaBlank; + chbxPrintStyleYearlyNotesAreaLined.Checked := AYearlyStyle.ShowNotesAreaLined; + chbxPrimaryPageHeadersOnly.Checked := AYearlyStyle.PrimaryPageHeadersOnly; + SetShowImagesCheckBoxes(chbxPrintStyleYearlyShowEventImages, nil, AYearlyStyle); +end; + +function TcxfmSchedulerReportLinkDesignWindow.CanApply: Boolean; +begin + Result := inherited CanApply;// and not ReportLink.IsInconsistentState; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoApply; +begin + if not IsValidConditions then Exit; + ReportLink.PrintStyles.ActiveStyle := ActivePrintStyle; + FActiveStyle := ReportLink.PrintStyles.FActiveStyle; + FActiveStyleAssigned := ReportLink.PrintStyles.FActiveStyleAssigned; + inherited DoApply; + ReportLink.RebuildReport; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoInitialize; +begin + lbxStyles.ReportLinkStyles := ReportLink.ActiveStyles; + HideOptionsButtons; + + inherited DoInitialize; + + with ReportLink.PrintRange do + begin + dePrintRangeStart.Date := PrintFrom; + dePrintRangeEnd.Date := PrintTo; + end; + + AssignTabSheetObjects; + RefreshPrintStyles; + ActivatePrintStyleTab; + + AssignDailyTabObjects; + AssignDetailsTabObjects; + AssignMemoTabObjects; + AssignMonthlyTabObjects; + AssignTimeLineTabObjects; + AssignTrifoldTabObjects; + AssignWeeklyTabObjects; + AssignYearlyTabObjects; + + // Formatting + with ReportLink.OptionsFormatting do + begin + cbxLookAndFeel.ItemIndex := Min(2, Integer(LookAndFeelKind)); + chbxSuppressBackgroundBitmaps.Checked := SuppressBackgroundBitmaps; + chbxSuppressContentColoration.Checked := SuppressContentColoration; + chbxUseNativeStyles.Checked := UseNativeStyles; + end; + + PageControl1Change(nil); +end; + +{$IFDEF DELPHI7} +function TcxfmSchedulerReportLinkDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +function TcxfmSchedulerReportLinkDesignWindow.CheckPrintRange: Boolean; +begin + Result := dePrintRangeEnd.Date >= dePrintRangeStart.Date; + if not Result then + begin + MessageBox(0, + PChar(cxGetResourceString(@sdxBadDatePrintRange)), + PChar(cxGetResourceString(@sdxReportDesignerCaption)), + MB_ICONINFORMATION or MB_OK); + PageControl1.ActivePage := tshPrintRange; + ActiveControl := dePrintRangeEnd; + end; +end; + +function TcxfmSchedulerReportLinkDesignWindow.CheckPrintStyleSettings: Boolean; + + procedure ShowWarning; + begin + MessageBox(0, + PChar(cxGetResourceString(@sdxBadTimePrintRange)), + PChar(cxGetResourceString(@sdxReportDesignerCaption)), + MB_ICONINFORMATION or MB_OK); + end; + +begin + if pcPrintStyleOptions.ActivePage = tshDaily then + begin + Result := TimeOf(tePrintStyleDailyPrintFrom.Time) <= TimeOf(tePrintStyleDailyPrintTo.Time); + if not Result then + begin + ShowWarning; + PageControl1.ActivePage := tshPrintStyles; + pcPrintStyleOptions.ActivePage := tshDaily; + ActiveControl := tePrintStyleDailyPrintTo; + end; + end + else + if pcPrintStyleOptions.ActivePage = tshWeekly then + begin + Result := TimeOf(tePrintStyleWeeklyPrintFrom.Time) <= TimeOf(tePrintStyleWeeklyPrintTo.Time); + if not Result then + begin + ShowWarning; + PageControl1.ActivePage := tshPrintStyles; + pcPrintStyleOptions.ActivePage := tshWeekly; + ActiveControl := tePrintStyleWeeklyPrintTo; + end; + end + else + Result := True; +end; + +function TcxfmSchedulerReportLinkDesignWindow.IsValidConditions: Boolean; +begin + Result := CheckPrintRange and CheckPrintStyleSettings; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.HideOptionsButtons; +var + I: Integer; +begin + for I := 0 to pcPrintStyleOptions.PageCount - 1 do + pcPrintStyleOptions.Pages[I].TabVisible := False; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadCaption( + AControl: TControl; StrPtr: Pointer); +begin + TControlAccess(AControl).Caption := cxGetResourceString(StrPtr); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadCaption( + AItem: TMenuItem; StrPtr: Pointer); +begin + AItem.Caption := cxGetResourceString(StrPtr); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStrings; +begin + inherited LoadStrings; + LoadStringsDaily; + LoadStringsMonthly; + LoadStringsWeekly; + LoadStringsTrifold; + LoadStringsDetails; + LoadStringsMemo; + LoadStringsOther; + LoadStringsYearly; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsCombo( + ACombo: TcxComboBox; ACaptions: array of Pointer); +var + I: Integer; +begin + with ACombo.Properties.Items do + begin + BeginUpdate; + try + Clear; + for I := 0 to High(ACaptions) do + if ACaptions[I] <> nil then Add(cxGetResourceString(ACaptions[I])); + finally + EndUpdate; + end; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsDaily; +begin + LoadCaption(lblPrintStyleDailyLayout, @sdxPrintStyleLayout); + LoadStringsCombo(cbxPrintStyleDailyLayout, + [@sdxPrintStyleDailyLayout1PPD, + @sdxPrintStyleDailyLayout2PPD]); + LoadCaption(lblPrintStyleDailyResourceCountPerPage, + @sdxResourceCountPerPage); + LoadCaption(lblPrintStyleDailyInclude, + @sdxPrintStyleInclude); + LoadCaption(chbxPrintStyleDailyTaskPad, + @sdxPrintStyleIncludeTaskPad); + LoadCaption(chbxPrintStyleDailyNotesAreaBlank, + @sdxPrintStyleIncludeNotesAreaBlank); + LoadCaption(chbxPrintStyleDailyNotesAreaLined, + @sdxPrintStyleIncludeNotesAreaLined); + LoadCaption(lblPrintStyleDailyPrintFrom, @sdxPrintStylePrintFrom); + LoadCaption(lblPrintStyleDailyPrintTo, @sdxPrintStylePrintTo); + LoadCaption(chbxPrintStyleDailyShowEventImages, @sdxPrintStyleShowEventImages); + LoadCaption(chbxPrintStyleDailyShowResourceImages, @sdxPrintStyleShowResourceImages); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsDetails; +begin + LoadCaption(chbxPrintStyleDetailsUsePagination, + @sdxPrintStyleDetailsStartNewPageEach); + LoadStringsCombo(cbxPrintStyleDetailsPagination, + [@sdxDay, @sdxWeek, @sdxMonth]); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsMemo; +begin + LoadCaption(chbxPrintStyleMemoStartEachItemOnNewPage, + @sdxPrintStyleMemoStartEachItemOnNewPage); + LoadCaption(chbxPrintStyleMemoPrintOnlySelectedEvents, + @sdxPrintStyleMemoPrintOnlySelectedEvents); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsMonthly; +begin + LoadCaption(lblPrintStyleMonthlyLayout, @sdxPrintStyleLayout); + LoadStringsCombo(cbxPrintStyleMonthlyLayout, + [@sdxPrintStyleMonthlyLayout1PPM, @sdxPrintStyleMonthlyLayout2PPM]); + LoadCaption(lblPrintStyleMonthlyResourceCountPerPage, @sdxResourceCountPerPage); + LoadCaption(lblPrintStyleMonthlyInclude, @sdxPrintStyleInclude); + LoadCaption(chbxPrintStyleMonthlyTaskPad, @sdxPrintStyleIncludeTaskPad); + LoadCaption(chbxPrintStyleMonthlyNotesAreaBlank, @sdxPrintStyleIncludeNotesAreaBlank); + LoadCaption(chbxPrintStyleMonthlyNotesAreaLined, @sdxPrintStyleIncludeNotesAreaLined); + + LoadCaption(chbxPrintStyleMonthlyDontPrintWeekends, @sdxPrintStyleDontPrintWeekEnds); + LoadCaption(chbxPrintStyleMonthlyPrintExactlyOneMonthPerPage, @sdxPrintStyleMonthlyPrintExactly1MPP); + LoadCaption(chbxPrintStyleMonthlyShowEventImages, @sdxPrintStyleShowEventImages); + LoadCaption(chbxPrintStyleMonthlyShowResourceImages, @sdxPrintStyleShowResourceImages); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsOther; + + procedure AdjustBevelSize(ABevel: TBevel; AControl: TControl); + var + Right: Integer; + begin + Right := ABevel.BoundsRect.Right; + ABevel.Left := AControl.Left + AControl.Width + 10; + ABevel.Width := Right - ABevel.Left; + end; + +begin + lblPreviewWindow.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + // Misc + LoadCaption(tshPrintRange, @sdxPrintRanges); + LoadCaption(lblPrintRangeStart, @sdxPrintRangeStart); + LoadCaption(lblPrintRangeEnd, @sdxPrintRangeEnd); + LoadCaption(lblPrintRangesMiscellaneous, @sdxMiscellaneous); + LoadCaption(chbxHideDetailsOfPrivateAppointments, + @sdxHideDetailsOfPrivateAppointments); + LoadCaption(tshPrintStyles, @sdxTabPrintStyles); + LoadCaption(lblPrintStylesOptions, @sdxOptions); + AdjustBevelSize(bvlPrintStyleOptions, lblPrintStylesOptions); + // Formatting + LoadCaption(tshFormatting, @sdxFormatting); + LoadCaption(lblLookAndFeel, @sdxLookAndFeel); + AdjustBevelSize(bvlLookAndFeel, lblLookAndFeel); + LoadStringsCombo(cbxLookAndFeel, [@sdxLookAndFeelFlat, + @sdxLookAndFeelStandard, @sdxLookAndFeelUltraFlat]); + LoadCaption(lblRefinements, @sdxRefinements); + AdjustBevelSize(bvlRefinements, lblRefinements); + LoadCaption(chbxSuppressBackgroundBitmaps, @sdxSuppressBackgroundBitmaps); + LoadCaption(chbxSuppressContentColoration, @sdxSuppressContentColoration); + // Styles + LoadCaption(tshStyles, @sdxStyles); + LoadCaption(lblUseNativeStyles, @sdxUseNativeStyles); + AdjustBevelSize(bvlStyles, lblUseNativeStyles); + LoadCaption(btnStyleColor, @sdxBtnColor); + LoadCaption(btnStyleFont, @sdxBtnFont); + LoadCaption(btnStyleBackgroundBitmap, @sdxBtnTexture); + LoadCaption(btnStyleBackgroundBitmapClear, @sdxBtnTextureClear); + LoadCaption(btnStyleRestoreDefaults, @sdxBtnRestoreDefaults); + LoadCaption(btnStylesSaveAs, @sdxBtnSaveAs); + LoadCaption(miStyleColor, @sdxBtnColor); + LoadCaption(miStyleFont, @sdxBtnFont); + LoadCaption(miStyleBackgroundBitmap, @sdxBtnTexture); + LoadCaption(miStyleBackgroundBitmapClear, @sdxBtnTextureClear); + LoadCaption(miStyleRestoreDefaults, @sdxBtnRestoreDefaults); + LoadCaption(miStylesSelectAll, @sdxSelectAll); + LoadCaption(miStylesSaveAs, @sdxBtnSaveAs); + LoadCaption(lblStyleSheets, @sdxStyleSheets); + AdjustBevelSize(bvlStyleSheets, lblStyleSheets); + LoadCaption(btnStyleSheetNew, @sdxBtnNew); + LoadCaption(btnStyleSheetCopy, @sdxBtnCopy); + LoadCaption(btnStyleSheetDelete, @sdxBtnDelete); + LoadCaption(btnStyleSheetRename, @sdxBtnRename); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsTimeLineStyle; +begin + LoadCaption(lblPrintStyleTimeLineResourceCountPerPage, @sdxResourceCountPerPage); + + LoadCaption(lblPrintStyleTimeLineInclude, @sdxPrintStyleInclude); + LoadCaption(chbxPrintStyleTimeLineTaskPad, @sdxPrintStyleIncludeTaskPad); + LoadCaption(chbxPrintStyleTimeLineNotesAreaBlank, @sdxPrintStyleIncludeNotesAreaBlank); + LoadCaption(chbxPrintStyleTimeLineNotesAreaLined, @sdxPrintStyleIncludeNotesAreaLined); + + LoadCaption(lblPrintStyleTimeLinePrintFrom, @sdxPrintStylePrintFrom); + LoadCaption(lblPrintStyleTimeLinePrintTo, @sdxPrintStylePrintTo); + + LoadCaption(chbxPrintStyleTimeLineDontPrintWeekends, @sdxPrintStyleDontPrintWeekEnds); + LoadCaption(chbxPrintStyleTimeLineWorkTimeOnly, @sdxPrintStyleWorkTimeOnly); + + LoadCaption(chbxPrintStyleTimeLineShowEventImages, @sdxPrintStyleShowEventImages); + LoadCaption(chbxPrintStyleTimeLineShowResourceImages, @sdxPrintStyleShowResourceImages); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsTrifold; + + procedure FillTrifoldSectionStrings(ACombobox: TcxCombobox); + begin + LoadStringsCombo(ACombobox, + [@sdxPrintStyleTrifoldSectionModeDailyCalendar, + @sdxPrintStyleTrifoldSectionModeWeeklyCalendar, + @sdxPrintStyleTrifoldSectionModeMonthlyCalendar, + @sdxPrintStyleTrifoldSectionModeTaskPad, + @sdxPrintStyleTrifoldSectionModeNotesBlank, + @sdxPrintStyleTrifoldSectionModeNotesLined]); + end; + +begin + LoadCaption(lblPrintStyleTrifoldSectionLeft, @sdxPrintStyleTrifoldSectionLeft); + FillTrifoldSectionStrings(cbxPrintStyleTrifoldSectionLeft); + LoadCaption(lblPrintStyleTrifoldSectionMiddle, @sdxPrintStyleTrifoldSectionMiddle); + FillTrifoldSectionStrings(cbxPrintStyleTrifoldSectionMiddle); + LoadCaption(lblPrintStyleTrifoldSectionRight, @sdxPrintStyleTrifoldSectionRight); + FillTrifoldSectionStrings(cbxPrintStyleTrifoldSectionRight); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsWeekly; +begin + LoadCaption(lblPrintStyleWeeklyArrange, @sdxPrintStyleWeeklyArrange); + LoadCaption(lblPrintStyleWeeklyDaysLayout, @sdxPrintStyleWeeklyDaysLayout); + LoadStringsCombo(cbxPrintStyleWeeklyArrange, + [@sdxPrintStyleWeeklyArrangeT2B, @sdxPrintStyleWeeklyArrangeL2R]); + LoadStringsCombo(cbxPrintStyleWeeklyDaysLayout, + [@sdxPrintStyleWeeklyDaysLayoutTC, @sdxPrintStyleWeeklyDaysLayoutOC]); + + LoadCaption(lblPrintStyleWeeklyLayout, @sdxPrintStyleLayout); + LoadStringsCombo(cbxPrintStyleWeeklyLayout, + [@sdxPrintStyleWeeklyLayout1PPW, @sdxPrintStyleWeeklyLayout2PPW]); + LoadCaption(lblPrintStyleWeeklyResourceCountPerPage, @sdxResourceCountPerPage); + LoadCaption(lblPrintStyleWeeklyInclude, @sdxPrintStyleInclude); + LoadCaption(chbxPrintStyleWeeklyTaskPad, @sdxPrintStyleIncludeTaskPad); + LoadCaption(chbxPrintStyleWeeklyNotesAreaBlank, @sdxPrintStyleIncludeNotesAreaBlank); + LoadCaption(chbxPrintStyleWeeklyNotesAreaLined, @sdxPrintStyleIncludeNotesAreaLined); + + LoadCaption(lblPrintStyleWeeklyPrintFrom, @sdxPrintStylePrintFrom); + LoadCaption(lblPrintStyleWeeklyPrintTo, @sdxPrintStylePrintTo); + + LoadCaption(chbxPrintStyleWeeklyDontPrintWeekends, @sdxPrintStyleDontPrintWeekEnds); + LoadCaption(chbxPrintStyleWeeklyShowEventImages, @sdxPrintStyleShowEventImages); + LoadCaption(chbxPrintStyleWeeklyShowResourceImages, @sdxPrintStyleShowResourceImages); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsYearly; +begin + LoadCaption(lblPrintStyleYearlyLayout, @sdxPrintStyleLayout); + LoadCaption(lblPrintStyleYearlyMonthPerPage, @ sdxPrintStyleMonthPerPage); + LoadStringsCombo(cbxPrintStyleYearlyLayout, + [@sdxPrintStyleMonthlyLayout1PPM, @sdxPrintStyleMonthlyLayout2PPM]); + + LoadStringsCombo(cbxPrintStyleYearlyMonthPerPage, + [@sdxPrintStyleYearly1MPP, @sdxPrintStyleYearly2MPP, + @sdxPrintStyleYearly3MPP, @sdxPrintStyleYearly4MPP, + @sdxPrintStyleYearly6MPP, @sdxPrintStyleYearly12MPP]); + + LoadCaption(lblPrintStyleYearlyResourceCountPerPage, @sdxResourceCountPerPage); + + LoadCaption(lblPrintStyleYearlyInclude, @sdxPrintStyleInclude); + LoadCaption(chbxPrintStyleYearlyTaskPad, @sdxPrintStyleIncludeTaskPad); + LoadCaption(chbxPrintStyleYearlyNotesAreaBlank, @sdxPrintStyleIncludeNotesAreaBlank); + LoadCaption(chbxPrintStyleYearlyNotesAreaLined, @sdxPrintStyleIncludeNotesAreaLined); + LoadCaption(chbxPrimaryPageHeadersOnly, @sdxPrintStylePrimaryPageHeadersOnly); + LoadCaption(chbxPrintStyleYearlyShowEventImages, @sdxPrintStyleShowEventImages); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.PreviewDrawPageContent( + ACanvas: TCanvas; ABounds: TRect); +const + AMessageFlags = DXTO_CENTER_HORIZONTALLY or DXTO_CENTER_VERTICALLY or DXTO_WORDBREAK; +var + AMsg: PChar; + R, R1: TRect; + APrinter: TdxComponentPrinter; + ALink: TcxSchedulerReportLink; + ASource, ADest: TBitmap; +begin + if ReportLink.Component = nil then + begin + ACanvas.Brush.Color := clWindow; + ACanvas.FillRect(ABounds); + Exit; + end; + APrinter := TdxComponentPrinter.Create(nil); + try + ALink := TcxSchedulerReportLink.Create(APrinter); + ALink.LinkInPreviewMode := True; + try + ALink.Assign(ReportLink); + ALink.PrinterPage.RestoreDefaults; + ALink.Component := ReportLink.Component; + ALink.ComponentPrinter := APrinter; + AMsg := nil; + with ALink do + R1 := MakeBounds(0, 0, PageWidth, PageHeight); + ASource := cxCreateBitmap(cxSize(R1.Right, R1.Bottom)); + ASource.Canvas.Lock; + try + R := cxRectOffset(ABounds, -ABounds.Left, -ABounds.Top); + ALink.PrintStyles.ActiveStyle := ALink.PrintStyles[ + ReportLink.PrintStyles.IndexOf(ReportLink.PrintStyles.ActiveStyle)]; + ALink.RebuildReport; + FillRect(ASource.Canvas.Handle, R1, GetSysColorBrush(COLOR_WINDOW)); + if ALink.PageCount > 0 then + APrinter.PaintPage(ASource.Canvas, 0, R1, R1, ALink) + else + with ReportLink.PrintStyles do + begin + if (FActiveStyle = Memo) and Memo.SelectedEventsOnly then + AMsg := PChar(cxGetResourceString(@sdxCannotPrintNoSelectedItems)) + else + AMsg := PChar(cxGetResourceString(@sdxCannotPrintNoItemsAvailable)); + end; + ADest := cxCreateBitmap(cxSize(R.Right, R.Bottom)); + ADest.Canvas.Lock; + try + cxSmoothResizeBitmap(ASource, ADest); + if AMsg <> nil then + dxTextOut(ADest.Canvas.Handle, AMsg, R, AMessageFlags); + ACanvas.Draw(0, 0, ADest); + finally + ADest.Canvas.UnLock; + ADest.Free; + end; + finally + ASource.Canvas.Unlock; + ASource.Free; + end; + finally + ALink.Free; + end; + finally + APrinter.Free; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.UpdateControlsState; +begin + inherited UpdateControlsState; + + UpdateEnabledControls([lblPrintStyleDailyPrintFrom, tePrintStyleDailyPrintFrom, + lblPrintStyleDailyPrintTo, tePrintStyleDailyPrintTo], + ReportLink.PrintStyles.Daily.SupportTimeRange); + UpdateEnabledControls([lblPrintStyleWeeklyPrintFrom, tePrintStyleWeeklyPrintFrom, + lblPrintStyleWeeklyPrintTo, tePrintStyleWeeklyPrintTo], + ReportLink.PrintStyles.Weekly.SupportTimeRange); + + chbxPrintStyleWeeklyDontPrintWeekends.Enabled := + ReportLink.PrintStyles.Weekly.CanDontPrintWeekends; + + UpdateEnabled(lbxStyles, AreNativeStylesAvailable); + UpdateEnabled(btnStyleColor, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(btnStyleFont, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(btnStyleBackgroundBitmap, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(btnStyleBackgroundBitmapClear, AreNativeStylesAvailable and HasSelectedStylesWithAssignedBitmap); + UpdateEnabled(btnStyleRestoreDefaults, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(btnStylesSaveAs, CanSaveStyles); + + UpdateEnabled(lblStyleSheets, AreNativeStylesAvailable); + UpdateEnabled(cbxStyleSheets, AreNativeStylesAvailable); + UpdateEnabled(btnStyleSheetNew, CanCreateStyleSheet); + UpdateEnabled(btnStyleSheetCopy, CanCopyStyleSheet); + UpdateEnabled(btnStyleSheetDelete, CanDeleteStyleSheet); + UpdateEnabled(btnStyleSheetRename, CanRenameStyleSheet); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.UpdateEnabled( + AControl: TControl; AEnabled: Boolean); +begin + TControlAccess(AControl).Enabled := AEnabled; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.UpdateEnabled( + AItem: TMenuItem; AEnabled: Boolean); +begin + AItem.Enabled := AEnabled; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.UpdateEnabledControls( + AControls: array of TControl; AEnabled: Boolean); +var + I: Integer; +begin + for I := 0 to High(AControls) do + UpdateEnabled(AControls[I], AEnabled); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.UpdatePreview; +begin + if Visible then + begin + RefreshPrintStyles; + pbxPrintStylesPreview.Refresh; + pbPreview.Refresh; + end; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetDesignerTabIndex: Integer; +begin + Result := PageControl1.ActivePage.TabIndex; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SetDesignerTabIndex(Value: Integer); +begin + if Value < 0 then Value := 0; + if Value > PageControl1.PageCount - 1 then + Value := PageControl1.PageCount - 1; + PageControl1.ActivePage := PageControl1.Pages[Value]; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoActiveStyleSheetChanged; +begin + inherited; + lbxStyles.ReportLinkStyles := ReportLink.ActiveStyles; + with cbxStyleSheets do + ItemIndex := Properties.Items.IndexOfObject(ActiveStyleSheet); + + if not LockControlsUpdate then + begin + Modified := True; + UpdatePreview; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoFormActivated(AnActive: Boolean); +begin + inherited; + if not AnActive then lbxStyles.HideToolTips; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoRefreshStylesList; +var + Styles: TcxSchedulerReportLinkStyles; + List: TList; +begin + Styles := ReportLink.ActiveStyles; + with lbxStyles.Items do + begin + BeginUpdate; + try + List := TList.Create; + try + SaveSelectedStyles(List); + try + Clear; + AddObject(cxGetResourceString(@sdxSchedulerSchedulerHeader), Styles.SchedulerHeader); + AddObject(cxGetResourceString(@sdxSchedulerContent), Styles.Content); + AddObject(cxGetResourceString(@sdxSchedulerDateNavigatorContent), Styles.DateNavigatorContent); + AddObject(cxGetResourceString(@sdxSchedulerDateNavigatorHeader), Styles.DateNavigatorHeader); + AddObject(cxGetResourceString(@sdxSchedulerDayHeader), Styles.DayHeader); + AddObject(cxGetResourceString(@sdxSchedulerEvent), Styles.Event); + AddObject(cxGetResourceString(@sdxSchedulerResourceHeader), Styles.ResourceHeader); + AddObject(cxGetResourceString(@sdxSchedulerNotesAreaBlank), Styles.NotesAreaBlank); + AddObject(cxGetResourceString(@sdxSchedulerNotesAreaLined), Styles.NotesAreaLined); + AddObject(cxGetResourceString(@sdxSchedulerTaskPad), Styles.TaskPad); + AddObject(cxGetResourceString(@sdxSchedulerTimeRuler), Styles.TimeRuler); + finally + RestoreSelectedStyles(List); + end; + finally + List.Free; + end; + finally + EndUpdate; + end; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoStyleChanged(const ACaption: string; + AStyle: TcxStyle); +begin + inherited; + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoStylesChanged(AStrings: TStrings; + ARecreate: Boolean); +begin + if ARecreate then + RecreateStylesListBox + else + lbxStyles.Invalidate; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.GetSelectedStyleNames(AStrings: TStrings); +var + I: Integer; +begin + AStrings.Clear; + with lbxStyles do + for I := 0 to Items.Count - 1 do + if Selected[I] then + AStrings.AddObject(Items[I], Items.Objects[I]); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.GetStyleNames(out AStrings: TStrings); +begin + AStrings := lbxStyles.Items; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.GetStyleSheetNames(out AStrings: TStrings); +begin + AStrings := cbxStyleSheets.Properties.Items; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.ActivatePrintStyleTab; +begin + pcPrintStyleOptions.ActivePageIndex := FindTabIndexByPrintStyle(ActivePrintStyle); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignTabSheetObjects; +begin + with ReportLink.PrintStyles do + begin + tshDaily.Tag := MakeTTag(Daily); + tshWeekly.Tag := MakeTTag(Weekly); + tshMonthly.Tag := MakeTTag(Monthly); + tshTrifold.Tag := MakeTTag(Trifold); + tshDetails.Tag := MakeTTag(Details); + tshMemo.Tag := MakeTTag(Memo); + tshYearly.Tag := MakeTTag(Yearly); + tshTimeLine.Tag := MakeTTag(TimeLine); + end; +end; + +function TcxfmSchedulerReportLinkDesignWindow.FindTabIndexByPrintStyle(APrintStyle: TcxCustomSchedulerReportLinkPrintStyle): Integer; +begin + for Result := 0 to pcPrintStyleOptions.PageCount - 1 do + if pcPrintStyleOptions.Pages[Result].Tag = MakeTTag(APrintStyle) then Exit; + Result := -1; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.RefreshPrintStyles; +var + AItems: TcxImageComboBoxItems; + ActiveStyleIndex, I: Integer; + + procedure CheckAndAddPrintStyle(APrintStyle: TcxCustomSchedulerReportLinkPrintStyle); + begin + with TcxImageComboBoxItem(AItems.Add) do + begin + ImageIndex := APrintStyle.GlyphIndex; + Description := APrintStyle.Caption; + Value := Index; + Tag := Integer(APrintStyle); + end; + if (ActiveStyleIndex = -1) and (APrintStyle = ReportLink.PrintStyles.ActiveStyle) then + ActiveStyleIndex := AItems.Count - 1; + end; + +begin + ActiveStyleIndex := cbxPrintStyles.ItemIndex; + cbxPrintStyles.Properties.Images := StyleImages; + AItems := cbxPrintStyles.Properties.Items; + AItems.BeginUpdate; + try + AItems.Clear; + for I := 0 to ReportLink.PrintStyles.Count - 1 do + CheckAndAddPrintStyle(ReportLink.PrintStyles.Items[I]); + cbxPrintStyles.ItemIndex := ActiveStyleIndex; + finally + AItems.EndUpdate; + end; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetActivePrintStyle: TcxCustomSchedulerReportLinkPrintStyle; +begin + if cbxPrintStyles.ItemIndex <> -1 then + begin + with cbxPrintStyles.Properties.Items[cbxPrintStyles.ItemIndex] do + Result := TcxCustomSchedulerReportLinkPrintStyle(Tag) + end + else + Result := nil; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetActiveStyle: TcxStyle; +begin + with lbxStyles do + if ItemIndex <> -1 then + Result := TcxStyle(Items.Objects[ItemIndex]) + else + Result := nil; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetComponent: TcxScheduler; +begin + Result := inherited Component as TcxScheduler; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetHasSelectedStyles: Boolean; +begin + Result := lbxStyles.SelCount <> 0; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetHasSelectedStylesWithAssignedBitmap: Boolean; +var + Strings: TStrings; + I: Integer; + cxStyle: TcxStyle; +begin + Result := True; + Strings := TStringList.Create; + try + GetSelectedStyleNames(Strings); + for I := 0 to Strings.Count - 1 do + begin + cxStyle := TcxStyle(Strings.Objects[I]); + if (cxStyle <> nil) and (cxStyle.Bitmap <> nil) and not cxStyle.Bitmap.Empty then + Exit; + end; + finally + Strings.Free; + end; + Result := False; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetReportLink: TcxSchedulerReportLink; +begin + Result := inherited ReportLink as TcxSchedulerReportLink; +end; + +function TcxfmSchedulerReportLinkDesignWindow.CanSelectAllStyles: Boolean; +var + I: Integer; +begin + Result := AreNativeStylesAvailable; + if Result then + begin + for I := 0 to lbxStyles.Items.Count - 1 do + if not lbxStyles.Selected[I] then Exit; + Result := False; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.CreateControls; + + procedure CreateStylesListBox; + begin + lbxStyles := TdxStylesListBox.Create(Self); + lbxStyles.Parent := tshStyles; + lbxStyles.BoundsRect := bvlStylesHost.BoundsRect; + lbxStyles.PopupMenu := pmStyles; + lbxStyles.TabOrder := chbxUseNativeStyles.TabOrder + 1; + lbxStyles.OnClick := lbxStylesClick; + bvlStylesHost.Visible := False; + + dxPSPopupMan.dxPSPopupMenuController.RegisterControl(lbxStyles); + end; + +begin + CreateStylesListBox; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.RecreateStylesListBox; +var + List: TList; +begin + List := TList.Create; + try + SaveSelectedStyles(List); + dxPSUtl.dxRecreateWnd(lbxStyles); + RestoreSelectedStyles(List); + finally + List.Free; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.RestoreSelectedStyles(AList: TList); +var + I: Integer; +begin + for I := 0 to AList.Count - 1 do + lbxStyles.Selected[Integer(AList[I])] := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SaveSelectedStyles(AList: TList); +var + I: Integer; +begin + AList.Clear; + for I := 0 to lbxStyles.Items.Count - 1 do + if lbxStyles.Selected[I] then AList.Add(TObject(I)); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SetActivePage; +begin + PageControl1.ActivePage := PageControl1.Pages[DesignerTabIndex]; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SetOptionsFormattingByIndex(AnIndex: Integer; + AValue: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsFormatting do + case AnIndex of + 0: + begin + UseNativeStyles := AValue; + RecreateStylesListBox; + end; + 1: SuppressBackgroundBitmaps := AValue; + 2: SuppressContentColoration := AValue; + end; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SetPrintStyleOptionsViewByIndex(AnIndex: Integer; + AValue: Boolean); +begin + if not LockControlsUpdate then + begin + case AnIndex of + 0: + ActivePrintStyle.ShowTaskPad := AValue; + 1: + ActivePrintStyle.ShowNotesAreaBlank := AValue; + 2: + ActivePrintStyle.ShowNotesAreaLined := AValue; + end; + Modified := True; + UpdatePreview; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SetPrintStyleRangeByIndex(AnIndex: Integer; + const ATime: TDateTime); +begin + if not LockControlsUpdate then + begin + case AnIndex of + 0: + ActivePrintStyle.TimePrintFrom := ATime; + 1: + ActivePrintStyle.TimePrintTo := ATime; + end; + Modified := True; + UpdatePreview; + UpdateControlsState; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SetPrintStyleResourceCountPerPageByIndex(AnIndex: Integer; + AValue: TcxEditValue); +begin + if LockControlsUpdate then Exit; + with ReportLink.PrintStyles do + case AnIndex of + 0: + Daily.ResourceCountPerPage := AValue; + 1: + Weekly.ResourceCountPerPage := AValue; + 2: + Monthly.ResourceCountPerPage := AValue; + 3: + Yearly.ResourceCountPerPage := AValue; + 4: + TimeLine.ResourceCountPerPage := AValue; + end; + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SetShowImagesCheckBoxes( + AEventImages, AResourceImages: TcxCheckBox; + APrintStyle: TcxCustomSchedulerReportLinkPrintStyle); +begin + if AEventImages <> nil then + begin + AEventImages.Enabled := ReportLink.HasEventImages; + AEventImages.Checked := AEventImages.Enabled and APrintStyle.ShowEventImages; + end; + if AResourceImages <> nil then + begin + AResourceImages.Enabled := ReportLink.HasResourceImages; + AResourceImages.Checked := AResourceImages.Enabled and APrintStyle.ShowResourceImages; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.FormCloseQuery(Sender: TObject; + var CanClose: Boolean); + + procedure ValidateEditors; + begin + FIsFormClosing := True; + try + dePrintRangeStart.ValidateEdit(False); + dePrintRangeEnd.ValidateEdit(False); + + tePrintStyleDailyPrintFrom.ValidateEdit(False); + tePrintStyleDailyPrintTo.ValidateEdit(False); + tePrintStyleWeeklyPrintFrom.ValidateEdit(False); + tePrintStyleWeeklyPrintTo.ValidateEdit(False); + finally + FisFormClosing := False; + end; + end; + +begin + if ModalResult = mrOK then + begin + ValidateEditors; + CanClose := IsValidConditions; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.PageControl1Change(Sender: TObject); +begin + pnlPrintStylesPreview.Visible := PageControl1.ActivePage = tshPrintStyles; + pnlPreview.Visible := PageControl1.ActivePage <> tshPrintStyles; + lblPreviewWindow.Parent := PageControl1.ActivePage; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.lbxStylesClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + UpdateControlsState; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleFontClick(Sender: TObject); +begin + PerformStylesChangeFont; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleColorClick(Sender: TObject); +begin + PerformStylesChangeColor; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleBackgroundBitmapClick(Sender: TObject); +begin + PerformStylesChangeBitmap; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleBackgroundBitmapClearClick(Sender: TObject); +begin + PerformStylesClearBitmap; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.miStylesSelectAllClick(Sender: TObject); +{$IFNDEF DELPHI6} +var + I: Integer; +{$ENDIF} +begin + with lbxStyles do + begin + {$IFDEF DELPHI6} + SelectAll; + {$ELSE} + Items.BeginUpdate; + try + for I := 0 to Items.Count - 1 do + Selected[I] := True; + finally + Items.EndUpdate; + end; + {$ENDIF} + end; + UpdateControlsState; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleRestoreDefaultsClick(Sender: TObject); +begin + PerformStylesRestoreDefaults; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStylesSaveAsClick(Sender: TObject); +begin + PerformStylesSaveAsStyleSheet; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxStyleSheetsClick(Sender: TObject); +begin + with TcxComboBox(Sender) do + ActiveStyleSheet := TcxCustomStyleSheet(Properties.Items.Objects[ItemIndex]); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxStyleSheetsPropertiesDrawItem( + AControl: TcxCustomComboBox; ACanvas: TcxCanvas; AIndex: Integer; + const ARect: TRect; AState: TOwnerDrawState); +begin + PerformStyleSheetDrawItem(ACanvas.Canvas, AIndex, ARect, AState, AControl.Enabled); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxStyleSheetsKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + PerformStyleSheetKeyDown(Sender, Key, Shift); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleSheetNewClick(Sender: TObject); +begin + PerformStyleSheetNew; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleSheetCopyClick(Sender: TObject); +begin + PerformStyleSheetCopy; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleSheetDeleteClick(Sender: TObject); +begin + PerformStyleSheetDelete; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleSheetRenameClick(Sender: TObject); +begin + PerformStyleSheetRename; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.lblUseNativeStylesClick(Sender: TObject); +begin + if chbxUseNativeStyles.CanFocus then ActiveControl := chbxUseNativeStyles; + chbxUseNativeStyles.Checked := not chbxUseNativeStyles.Checked; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.OptionsFormattingClick(Sender: TObject); +begin + with TcxCheckBox(Sender) do + SetOptionsFormattingByIndex(TTagToInt(Tag), Checked); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LookAndFeelChange(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TcxComboBox(Sender) do + ReportLink.OptionsFormatting.LookAndFeelKind := TcxLookAndFeelKind(Properties.Items.Objects[ItemIndex]); + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.pmStylesPopup(Sender: TObject); +begin + lbxStyles.HideToolTips; + UpdateEnabled(miStyleColor, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(miStyleFont, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(miStyleBackgroundBitmap, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(miStyleBackgroundBitmapClear, AreNativeStylesAvailable and HasSelectedStylesWithAssignedBitmap); + UpdateEnabled(miStyleRestoreDefaults, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(miStylesSelectAll, CanSelectAllStyles); + UpdateEnabled(miStylesSaveAs, CanSaveStyles); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleYearlyLayoutClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Yearly.Layout := + TcxSchedulerReportLinkPeriodicPrintStyleLayout(TcxComboBox(Sender).ItemIndex); + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleYearlyMonthPagesPerYearClick( + Sender: TObject); +const + MonthsPerPage: array[0..5] of Integer = (1, 2, 3, 4, 6, 12); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Yearly.MonthCountPerPage := + MonthsPerPage[TcxComboBox(Sender).ItemIndex]; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.dePrintRangeStartEditValueChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintRange.PrintFrom := TcxDateEdit(Sender).Date; + Modified := True; + UpdatePreview; + UpdateControlsState; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.dePrintRangeEndEditValueChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintRange.PrintTo := TcxDateEdit(Sender).Date; + Modified := True; + UpdatePreview; + UpdateControlsState; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStylesClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with ReportLink.PrintStyles do + FActiveStyle := Items[TcxComboBox(Sender).ItemIndex]; + ActivatePrintStyleTab; + Modified := True; + UpdatePreview; + UpdateControlsState; +end; + +// Daily +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleDailyLayoutClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Daily.Layout := + TcxSchedulerReportLinkPeriodicPrintStyleLayout(TcxComboBox(Sender).ItemIndex); + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.sePrintStyleResourceCountPerPagePropertiesChanged( + Sender: TObject); +begin + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.sePrintStyleResourceCountPerPagePropertiesEditValueChanged( + Sender: TObject); +begin + with TcxSpinEdit(Sender) do + SetPrintStyleResourceCountPerPageByIndex(TTagToInt(Tag), Value); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleOptionsViewClick( + Sender: TObject); +begin + with TcxCheckBox(Sender) do + SetPrintStyleOptionsViewByIndex(TTagToInt(Tag), Checked); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.tePrintStylePrintRangePropertiesEditValueChanged( + Sender: TObject); +begin + with TcxTimeEdit(Sender) do + SetPrintStyleRangeByIndex(TTagToInt(Tag), Time); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.tePrintStylePrintRangePropertiesChange( + Sender: TObject); +begin + Modified := True; +end; + +// Weekly +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleWeeklyArrangeClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Weekly.Arrange := + TcxSchedulerReportLinkWeeklyPrintStyleArrange(TcxComboBox(Sender).ItemIndex); + cbxPrintStyles.Invalidate; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleWeeklyLayoutClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Weekly.Layout := + TcxSchedulerReportLinkPeriodicPrintStyleLayout(TcxComboBox(Sender).ItemIndex); + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleWeeklyDaysLayoutClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Weekly.DaysLayout := + TcxSchedulerWeekViewDaysLayout(TcxComboBox(Sender).ItemIndex); + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleWeeklyDontPrintWeekendsClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Weekly.DontPrintWeekends := TcxCheckBox(Sender).Checked; + Modified := True; +end; + +// Monthly +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleMonthlyLayoutClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Monthly.Layout := + TcxSchedulerReportLinkPeriodicPrintStyleLayout(TcxComboBox(Sender).ItemIndex); + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleDontPrintWeekEndsClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + if ActivePrintStyle is TcxSchedulerReportLinkMonthlyPrintStyle then + ReportLink.PrintStyles.Monthly.DontPrintWeekends := TcxCheckBox(Sender).Checked + else + if ActivePrintStyle is TcxSchedulerReportLinkTimeLinePrintStyle then + ReportLink.PrintStyles.TimeLine.DontPrintWeekends := TcxCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleMonthlyPrintExactlyOneMonthPerPageClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Monthly.PrintExactlyOneMonthPerPage := + TcxCheckBox(Sender).Checked; + Modified := True; +end; + +// Tri-fold +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleTrifoldSectionModeClick( + Sender: TObject); +begin + if LockControlsUpdate or not (ActivePrintStyle is TcxSchedulerReportLinkTrifoldPrintStyle) then Exit; + with TcxSchedulerReportLinkTrifoldPrintStyle(ActivePrintStyle) do + FSections[TTagToInt(TcxComboBox(Sender).Tag)] := TcxSchedulerReportLinkTrifoldPrintStyleSectionMode(TcxComboBox(Sender).ItemIndex); + Modified := True; + UpdateControlsState; +end; + +// Details +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleDetailsUsePaginationClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Details.UsePagination := TcxCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleDetailsPaginationClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Details.PaginationMode := + TcxSchedulerReportLinkDetailsPrintStylePaginationMode(TcxComboBox(Sender).ItemIndex); + Modified := True; +end; + +// Memo +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleMemoStartEachItemOnNewPageClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Memo.StartEachItemOnNewPage := TcxCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleMemoPrintOnlySelectedEventsClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Memo.SelectedEventsOnly := TcxCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.pbxPrintStylesPreviewPaint(Sender: TObject); +begin + with TPaintBox(Sender) do + if ActivePrintStyle <> nil then + ActivePrintStyle.DrawDesignWindowPreview(Canvas, ClientRect); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.StyleController1StyleChanged( + Sender: TObject); +begin +// +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.pbPreviewPaint( + Sender: TObject); +begin + PreviewDrawPageContent(pbPreview.Canvas, pbPreview.ClientRect); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxLookAndFeelPropertiesChange( + Sender: TObject); +begin + ReportLink.OptionsFormatting.LookAndFeelKind := TcxLookAndFeelKind(cbxLookAndFeel.ItemIndex); +end; + +{ TcxSchedulerReportPageSite } + +procedure TcxSchedulerReportPageSite.ReadProperties(AReader: TdxPSDataReader); +begin + inherited ReadProperties(AReader); + FPageIndex := AReader.ReadInteger; + FPrimaryPage := AReader.ReadBoolean; +end; + +procedure TcxSchedulerReportPageSite.WriteProperties(AWriter: TdxPSDataWriter); +begin + inherited WriteProperties(AWriter); + AWriter.WriteInteger(FPageIndex); + AWriter.WriteBoolean(FPrimaryPage); +end; + +{ TcxSchedulerReportPageItemCell } + +constructor TcxSchedulerReportPageItemCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + BorderClass := TdxPSCellUltraFlatBorder; + ClipChildren := True; +end; + +function TcxSchedulerReportPageItemCell.GetType: TcxSchedulerReportItemsType; +begin + Result := srUnknownItem; +end; + +procedure TcxSchedulerReportPageItemCell.SetCellViewParams( + AItem: TdxReportVisualItem; const AParams: TcxViewParams); +begin + ReportLink.SetCellViewParams(AItem, AParams); +end; + +procedure TcxSchedulerReportPageItemCell.SetCellViewParams( + AItem: TdxReportVisualItem; const AParams: TdxReportItemViewParams); +begin + ReportLink.SetCellViewParams(AItem, AParams); +end; + +function TcxSchedulerReportPageItemCell.GetPageIndex: Integer; +begin + Result := PageSite.PageIndex; +end; + +function TcxSchedulerReportPageItemCell.GetPageSite: TcxSchedulerReportPageSite; +var + AParent: TdxReportCell; +begin + AParent := inherited Parent; + while (AParent <> nil) and not (AParent is TcxSchedulerReportPageSite) do + AParent := AParent.Parent; + Result := AParent as TcxSchedulerReportPageSite; +end; + +function TcxSchedulerReportPageItemCell.GetPrimaryPage: Boolean; +begin + Result := PageSite.PrimaryPage; +end; + +function TcxSchedulerReportPageItemCell.GetReportLink: TcxSchedulerReportLink; +begin + Result := TcxSchedulerReportLink(Renderer.ReportLink); +end; + +{ TcxSchedulerReportNotesDataCell } + +constructor TcxSchedulerReportNotesDataCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + TextAlignX := taCenterX; + TextAlignY := taCenterY; + CaptionHeight := 16; + Data := cdidSchedulerNotesArea; +end; + +procedure TcxSchedulerReportNotesDataCell.DrawContent( + DC: HDC; AStage: TdxPSRenderStages); +var + R: TRect; + C, I: Integer; +begin + inherited DrawContent(DC, AStage); + if CaptionHeight <= 0 then Exit; + R := GetInnerBounds(DC); + FixupRect(DC, R); + C := R.Bottom - R. Top; + R.Bottom := R.Top + CaptionHeight; + // + if Caption <> '' then + begin + Renderer.DrawText(DC, R, -1, cxTextOffset, cxTextOffset, Caption, Font, + Color, TextAlignX, TextAlignY, False, MultiLine, False); + end; + // + Inc(R.Bottom, Max(1, Renderer.LineThickness div 2)); + if Lined then + C := (C - Renderer.LineThickness) div CaptionHeight + else + C := 1; + R.Top := R.Bottom - Renderer.LineThickness; + for I := 0 to C - 1 do + begin + FixupRect(DC, R); + Renderer.FillRect(DC, R, clBlack); + OffsetRect(R, 0, CaptionHeight); + end; +end; + +procedure TcxSchedulerReportNotesDataCell.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FCaption := AReader.ReadString; + FCaptionHeight := AReader.ReadInteger; + FLined := AReader.ReadBoolean; +end; + +procedure TcxSchedulerReportNotesDataCell.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteString(FCaption); + AWriter.WriteInteger(FCaptionHeight); + AWriter.WriteBoolean(FLined); +end; + +function TcxSchedulerReportNotesDataCell.GetMultiLine: Boolean; +begin + Result := inherited MultiLine; +end; + +function TcxSchedulerReportNotesDataCell.GetTextAlignX: TdxTextAlignX; +begin + Result := inherited TextAlignX; +end; + +function TcxSchedulerReportNotesDataCell.GetTextAlignY: TdxTextAlignY; +begin + Result := inherited TextAlignY; +end; + +procedure TcxSchedulerReportNotesDataCell.SetMultiLine(Value: Boolean); +begin + inherited MultiLine := Value; +end; + +procedure TcxSchedulerReportNotesDataCell.SetTextAlignX( + Value: TdxTextAlignX); +begin + inherited TextAlignX := Value; +end; + +procedure TcxSchedulerReportNotesDataCell.SetTextAlignY( + Value: TdxTextAlignY); +begin + inherited TextAlignY := Value; +end; + +{ TcxSchedulerReportNotesAreaCell } + +constructor TcxSchedulerReportNotesAreaCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + AddDataItem(GetDataCellClass) +end; + +constructor TcxSchedulerReportNotesAreaCell.CreateEx(AParent: TdxReportCell; ALined: Boolean); +begin + Create(AParent); + FLined := ALined; + DataCell.CellSides := []; + DataCell.Caption := cxGetResourceString(@sdxNotes); + DataCell.Lined := ALined; + ClipChildren := True; +end; + +procedure TcxSchedulerReportNotesAreaCell.BoundsChanged; +begin + inherited BoundsChanged; + DataCell.BoundsRect := GetInnerBounds(0); +end; + +procedure TcxSchedulerReportNotesAreaCell.ConvertCoords( + APixelsNumerator, APixelsDenominator: Integer); +begin + inherited ConvertCoords(APixelsNumerator, APixelsDenominator); + DataCell.CaptionHeight := MulDiv(DataCell.CaptionHeight, APixelsNumerator, APixelsDenominator); +end; + +function TcxSchedulerReportNotesAreaCell.GetType: TcxSchedulerReportItemsType; +begin + Result := srNotesBlank; + if DataCell.Lined then + Result := srNotesLined; +end; + +function TcxSchedulerReportNotesAreaCell.GetDataCellClass: TcxSchedulerReportNotesDataCellClass; +begin + Result := TcxSchedulerReportNotesDataCell; +end; + +procedure TcxSchedulerReportNotesAreaCell.SetFontIndex(Value: Integer); +begin + inherited SetFontIndex(Value); + if Font <> nil then + DataCell.CaptionHeight := cxTextHeight(Font) + cxTextOffset * 2; +end; + +function TcxSchedulerReportNotesAreaCell.GetDataCell: TcxSchedulerReportNotesDataCell; +begin + if (DataItemCount > 0) and (DataItems[0] is TcxSchedulerReportNotesDataCell) then + Result := TcxSchedulerReportNotesDataCell(DataItems[0]) + else + Result := nil; +end; + +{ TcxSchedulerReportTaskPadCell } + +constructor TcxSchedulerReportTaskPadCell.CreateEx( + AParent: TdxReportCell; ALined: Boolean); +begin + inherited CreateEx(AParent, ALined); + DataCell.Caption := cxGetResourceString(@sdxTaskPad); + DataCell.Data := cdidSchedulerTaskPad; +end; + +procedure TcxSchedulerReportTaskPadCell.BoundsChanged; +begin + inherited; + TaskPadDataSite.BoundsRect := CalculateTaskPadDataSiteBounds; +end; + +function TcxSchedulerReportTaskPadCell.CalculateTaskPadDataSiteBounds: TRect; +begin + Result := GetInnerBounds(NullDC); + Inc(Result.Top, DataCell.CaptionHeight); +end; + +function TcxSchedulerReportTaskPadCell.GetType: TcxSchedulerReportItemsType; +begin + Result := srTaskPad; +end; + +function TcxSchedulerReportTaskPadCell.GetTaskPadDataSite: TdxReportCell; +begin + if CellCount = 0 then AddCell; + Result := Cells[0]; + Result.CellSides := []; + Result.BoundsRect := CalculateTaskPadDataSiteBounds; +end; + +{ TcxSchedulerReportSchedulerHeaderDataCell } + +constructor TcxSchedulerReportSchedulerHeaderDataCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + CellSides := []; + Transparent := True; + Data := cdidSchedulerSchedulerHeader; +end; + +{ TcxSchedulerReportSchedulerHeaderCell } + +constructor TcxSchedulerReportSchedulerHeaderCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + FContent := AddContentCell; +end; + +procedure TcxSchedulerReportSchedulerHeaderCell.AdjustTextSize; +var + R1, R2: TRect; +begin + R1 := Content.BoundsRect; + R2 := R1; + if (SecondaryText <> '') and (PrimaryText <> '') then + begin + with R1 do + Bottom := Bottom - (Bottom - Top) div 4; + R2.Top := R1.Bottom; + end; + FPrimaryTextCell := AddTextCell(PrimaryText, R1, True); + FSecondaryTextCell := AddTextCell(SecondaryText, R2, False); + FContent.Index := MaxInt; //send to back +end; + +function TcxSchedulerReportSchedulerHeaderCell.AddContentCell: TcxSchedulerReportSchedulerHeaderDataCell; +begin + Result := TcxSchedulerReportSchedulerHeaderDataCell(AddDataItem(TcxSchedulerReportSchedulerHeaderDataCell)); +end; + +function TcxSchedulerReportSchedulerHeaderCell.AddTextCell(AText: string; + const ABounds: TRect; AMultiLine: Boolean): TdxReportCellString; +var + AFontH, ABoundsH: Integer; + AParams: TdxReportItemViewParams; +begin + if PrimaryText = '' then + begin + Result := nil; + Exit; + end; + Result := AddDataItem(TdxReportCellString) as TdxReportCellString; + Result.BoundsRect := ABounds; + Result.Text := AText; + Result.CellSides := []; + Result.Transparent := True; + Result.TextAlignY := taTop; + Result.TextAlignX := taLeft; + Result.Multiline := AMultiLine; + if AMultiLine and (Pos('#13', AText) <> 0) then + AText := Copy(AText, 1, Pos('#13', AText)); + AFontH := cxTextHeight(Font); + ABoundsH := (ABounds.Bottom - ABounds.Top) - cxTextOffset * 2; + if AMultiLine then + ABoundsH := ABoundsH div 2; + FillChar(AParams, SizeOf(AParams), 0); + AParams.FontStyle := []; + AParams.FontSize := MulDiv(Font.Size, ABoundsH, AFontH); + while (AParams.FontSize > 3) and (cxTextWidth(Font, AText, AParams.FontSize) > + ((ABounds.Right - ABounds.Left) - cxTextOffset * 2)) do Dec(AParams.FontSize, 2); + AParams.Transparent := True; + AParams.NativeParams.Font := Font; + AParams.NativeParams.TextColor := Font.Color; + ReportLink.SetCellViewParams(Result, AParams); +end; + +function TcxSchedulerReportSchedulerHeaderCell.GetType: TcxSchedulerReportItemsType; +begin + Result := srHeader; +end; + +{ TcxSchedulerReportDateNavigatorItem } + +constructor TcxSchedulerReportDateNavigatorItem.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + CellSides := []; +end; + +function TcxSchedulerReportDateNavigatorItem.GetDefaultDTFormat: DWORD; +begin + Result := DXTO_PATTERNEDTEXT or DXTO_SINGLELINE; +end; + +procedure TcxSchedulerReportDateNavigatorItem.SetText(const Value: string); +begin +end; + +function TcxSchedulerReportDateNavigatorItem.GetDateNavigator: TcxSchedulerReportDateNavigatorCell; +begin + Result := Parent as TcxSchedulerReportDateNavigatorCell; +end; + +{ TcxSchedulerReportDateNavigatorHeader } + +constructor TcxSchedulerReportDateNavigatorHeader.CreateEx(AParent: TdxReportCell; AYear, AMonth: Word); +begin + Create(AParent); + Transparent := False; + TextAlignX := taCenterX; + Data := cdidSchedulerDateNavigatorHeader; + FMonth := AMonth; + FYear := AYear; +end; + +procedure TcxSchedulerReportDateNavigatorHeader.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportDateNavigatorHeader then + with TcxSchedulerReportDateNavigatorHeader(Source) do + begin + Self.FMonth := Month; + Self.FYear := Year; + end; + inherited Assign(Source); +end; + +function TcxSchedulerReportDateNavigatorHeader.GetText: string; +begin + Result := LongMonthNames[Month] + ' ' + IntToStr(Year); +end; + +procedure TcxSchedulerReportDateNavigatorHeader.ReadData( + AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FMonth := AReader.ReadInteger; + FYear := AReader.ReadInteger; +end; + +procedure TcxSchedulerReportDateNavigatorHeader.WriteData( + AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteInteger(FMonth); + AWriter.WriteInteger(FYear); +end; + +{ TcxSchedulerReportDateNavigatorDay } + +constructor TcxSchedulerReportDateNavigatorDay.CreateEx(AParent: TdxReportCell; + ADay, ACol, ARow: Integer; ABold: Boolean); +begin + Create(AParent); + RightIndent := 2; + TextAlignX := taRight; + TextAlignY := taCenterY; + Data := cdidSchedulerDateNavigatorDay; + FDay := ADay; + FCol := ACol; + FRow := ARow; + Bold := ABold; +end; + +procedure TcxSchedulerReportDateNavigatorDay.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerReportDateNavigatorDay then + with TcxSchedulerReportDateNavigatorDay(Source) do + begin + Self.FDay := Day; + Self.FCol := Col; + Self.FRow := Row; + end; +end; + +function TcxSchedulerReportDateNavigatorDay.GetText: string; +begin + Result := IntToStr(Day); +end; + +procedure TcxSchedulerReportDateNavigatorDay.ReadData(AReader: TdxPSDataReader); +var + Value: Integer; +begin + inherited ReadData(AReader); + Value := AReader.ReadInteger; + FDay := TLongRec(Value).Bytes[0]; + FCol := TLongRec(Value).Bytes[1]; + FRow := TLongRec(Value).Bytes[2]; +end; + +procedure TcxSchedulerReportDateNavigatorDay.WriteData(AWriter: TdxPSDataWriter); +var + Value: Integer; +begin + inherited WriteData(AWriter); + TLongRec(Value).Bytes[0] := Day; + TLongRec(Value).Bytes[1] := Col; + TLongRec(Value).Bytes[2] := Row; + AWriter.WriteInteger(Value); +end; + +function TcxSchedulerReportDateNavigatorDay.GetDate: TDate; +begin + Result := EncodeDate(Year, Month, Day); +end; + +function TcxSchedulerReportDateNavigatorDay.GetBold: Boolean; +begin + Result := GetFormatBit(dxFormatDayIsBold); +end; + +function TcxSchedulerReportDateNavigatorDay.GetMonth: Word; +begin + if DateNavigator <> nil then + Result := DateNavigator.Month + else + Result := 1; +end; + +function TcxSchedulerReportDateNavigatorDay.GetYear: Word; +begin + if DateNavigator <> nil then + Result := DateNavigator.Year + else + Result := 1; +end; + +procedure TcxSchedulerReportDateNavigatorDay.SetBold(Value: Boolean); +begin + SetFormatBit(dxFormatDayIsBold, Value); +end; + +{ TcxSchedulerReportDateNavigatorDayCaption } + +constructor TcxSchedulerReportDateNavigatorDayCaption.CreateEx(AParent: TdxReportCell; + ADayOfWeek: TDay; ACol: Integer); +begin + inherited Create(AParent); + RightIndent := 2; + TextAlignX := taRight; + TextAlignY := taCenterY; + Data := cdidSchedulerDateNavigatorDayCaption; + FCol := ACol; + FDayOfWeek := ADayOfWeek; + FDayText := GetDayText; +end; + +procedure TcxSchedulerReportDateNavigatorDayCaption.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerReportDateNavigatorDayCaption then + with TcxSchedulerReportDateNavigatorDayCaption(Source) do + begin + Self.FDayOfWeek := DayOfWeek; + Self.FCol := Col; + Self.FDayText := FDayText; + end; +end; + +function TcxSchedulerReportDateNavigatorDayCaption.GetText: string; +begin + Result := FDayText; +end; + +function TcxSchedulerReportDateNavigatorDayCaption.GetDayText: string; +var + FDayIndex: Integer; +begin + FDayIndex := Byte(DateNavigator.StartOfWeek) + 1 + Col; + if FDayIndex > 7 then Dec(FDayIndex, 7); + + if Font.Charset in [ARABIC_CHARSET, CHINESEBIG5_CHARSET, GB2312_CHARSET] then + Result := AnsiLastChar(ShortDayNames[FDayIndex]) + else + Result := WideString(ShortDayNames[FDayIndex])[1]; +end; + +procedure TcxSchedulerReportDateNavigatorDayCaption.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FDayText := AReader.ReadString; +end; + +procedure TcxSchedulerReportDateNavigatorDayCaption.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteString(FDayText); +end; + +{ TcxSchedulerReportDateNavigatorWeekNumber } + +constructor TcxSchedulerReportDateNavigatorWeekNumber.CreateEx(AParent: TdxReportCell; + AWeekNumber, ARow: Integer); +begin + Create(AParent); + RightIndent := 4; + TextAlignX := taRight; + TextAlignY := taCenterY; + Data := cdidSchedulerDateNavigatorWeekNumber; + FRow := ARow; + FWeekNumber := AWeekNumber; +end; + +procedure TcxSchedulerReportDateNavigatorWeekNumber.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxSchedulerReportDateNavigatorWeekNumber then + with TcxSchedulerReportDateNavigatorWeekNumber(Source) do + begin + Self.FWeekNumber := WeekNumber; + Self.FRow := Row; + end; +end; + +function TcxSchedulerReportDateNavigatorWeekNumber.GetText: string; +begin + Result := IntToStr(WeekNumber); +end; + +procedure TcxSchedulerReportDateNavigatorWeekNumber.ReadData(AReader: TdxPSDataReader); +var + Value: Integer; +begin + inherited ReadData(AReader); + Value := AReader.ReadInteger; + FWeekNumber := TLongRec(Value).Bytes[0]; + FRow := TLongRec(Value).Bytes[1]; +end; + +procedure TcxSchedulerReportDateNavigatorWeekNumber.WriteData(AWriter: TdxPSDataWriter); +var + Value: Integer; +begin + inherited WriteData(AWriter); + TLongRec(Value).Bytes[0] := WeekNumber; + TLongRec(Value).Bytes[1] := Row; + AWriter.WriteInteger(Value); +end; + +{ TcxSchedulerReportDateNavigatorCell } + +constructor TcxSchedulerReportDateNavigatorCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + CellSides := []; + Transparent := False; + FStartOfWeek := TDay(DateTimeHelper.StartOfWeek); +end; + +constructor TcxSchedulerReportDateNavigatorCell.CreateEx(AParent: TdxReportCell; + AFirstWeekOfYear: TcxFirstWeekOfYear; AYear, AMonth: Word; + AShowDatesContainingEventsInBold, AShowWeekNumbers: Boolean); +begin + Create(AParent); + FYear := AYear; + FMonth := AMonth; + FVertOffset := -1; + FFirstWeekOfYear := AFirstWeekOfYear; + FShowWeekNumbers := AShowWeekNumbers; + FShowDatesContainingEventsInBold := AShowDatesContainingEventsInBold; +end; + +procedure TcxSchedulerReportDateNavigatorCell.AdjustSize(var AContentParams, + AHeaderParams: TdxReportItemViewParams; AHeight, AMaxHeight: Integer); + + function TestSize: Boolean; + var + ATestHeight: Integer; + begin + ATestHeight := GetMonthSize(AContentParams, AHeaderParams).cy; + if AMaxHeight > (ATestHeight + RowHeight) then + begin + FVertOffset := (AMaxHeight - ATestHeight) div 2; + Result := True; + end + else + Result := False; + end; + +begin + if TestSize then Exit; + AContentParams.FontSize := Abs(AContentParams.NativeParams.Font.Size); + AHeaderParams.FontSize := Abs(AHeaderParams.NativeParams.Font.Size); + repeat + if AContentParams.FontSize > AHeaderParams.FontSize then + Dec(AContentParams.FontSize) + else + if AContentParams.FontSize < AHeaderParams.FontSize then + Dec(AHeaderParams.FontSize) + else + begin + Dec(AContentParams.FontSize); + Dec(AHeaderParams.FontSize); + end; + until TestSize; +end; + +function TcxSchedulerReportDateNavigatorCell.CalculateSize( + const AContentParams, AHeaderParams: TdxReportItemViewParams): TSize; +begin + FMonthSize := GetMonthSize(AContentParams, AHeaderParams); + Result := FMonthSize; + Inc(Result.cy, 2 * RowHeight); + CreateItems; + AdjustItemsVertical; + SetViewParams(AContentParams, AHeaderParams); +end; + +class function TcxSchedulerReportDateNavigatorCell.MeasureDateNavigatorHeight( + const AContentParams, AHeaderParams: TcxViewParams): Integer; +var + AColWidth, ARowHeight, ADayCaptionsHeight, AHeaderHeight: Integer; +begin + GetContentPartSizes(AContentParams.Font, AColWidth, ARowHeight, ADayCaptionsHeight); + GetHeaderPartSizes(AHeaderParams.Font, AHeaderHeight); + Result := GetMonthHeight(AHeaderHeight, ADayCaptionsHeight, ARowHeight) + 2 * ARowHeight; +end; + +procedure TcxSchedulerReportDateNavigatorCell.AdjustItemsVertical; +var + I: Integer; +begin + if FVertOffset < 0 then FVertOffset := RowHeight; + for I := 0 to DataItemCount - 1 do + with DataItems[I] do Top := Top + FVertOffset; +end; + +function TcxSchedulerReportDateNavigatorCell.ColOfDate(ADate: TDateTime): Integer; +begin + Result := DayOfWeek(ADate) - Byte(StartOfWeek) - 1; + if Result < 0 then Inc(Result, 7); +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateDayCaptions; +var + R: TRect; + I, ADayOfWeek: Integer; + ACaption: TcxSchedulerReportDateNavigatorDayCaption; +begin + R.Top := HeaderHeight; + R.Bottom := R.Top + DayCaptionsHeight - 2; + R.Right := ColWidth; + FDayCaptionCount := 7; + for I := 0 to FDayCaptionCount - 1 do + begin + ADayOfWeek := I + Byte(StartOfWeek); + if ADayOfWeek > 6 then Dec(ADayOfWeek, 7); + ACaption := TcxSchedulerReportDateNavigatorDayCaption.CreateEx(Self, TDay(ADayOfWeek), I); + with ACaption do + begin + R.Left := R.Right; + R.Right := R.Left + ColWidth; + BoundsRect := R; + end; + end; +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateDay(const ABounds: TRect; + ADate: TDateTime; ACol, ARow: Integer); +var + ADay: TcxSchedulerReportDateNavigatorDay; +begin + ADay := TcxSchedulerReportDateNavigatorDay.CreateEx(Self, DayOf(ADate), + ACol, ARow, GetDayIsBold(ADate)); + ADay.BoundsRect := ABounds; +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateItems; +begin + CreateMonthHeader; + CreateDayCaptions; + CreateMonth; + CreateLines; +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateLines; +var + R: TRect; +begin + R := GetHeaderBounds; + R.Top := R.Bottom + DayCaptionsHeight; + R.Bottom := R.Top + WeekNumberCount * RowHeight; + with TdxReportCellBox.Create(Self) do + begin + if ShowWeekNumbers then CellSides := [csTop, csLeft] else CellSides := [csTop]; + BoundsRect := R; + end; +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateMonth; +var + R: TRect; + I, J, ADayBase, ADaysPerMonth: Integer; + ADate, ADateBase: TDateTime; + AHasDate: Boolean; + + function GetDate(out ADate: TDateTime): Boolean; + begin + ADate := ADateBase + ADayBase + J * 7 + I; + Result := (ADate > ADateBase) and (ADate <= ADateBase + ADaysPerMonth); + end; + +begin + FDayCount := 0; + FWeekNumberCount := 0; + ADateBase := EncodeDate(FYear, FMonth, 1) - 1; + ADayBase := 1 - ColOfDate(ADateBase + 1); + ADaysPerMonth := DaysPerMonth(FYear, FMonth); + //loop has been split into two loops for the correct order of the DataItems + for I := 0 to 6 do + for J := 0 to 5 do + if GetDate(ADate) then + begin + CreateDay(GetDayBoundsFromColAndRow(I, J), ADate, I, J); + Inc(FDayCount); + end; + for I := 0 to 6 do + for J := 0 to 5 do + begin + AHasDate := GetDate(ADate); + if ShowWeekNumbers and (I = 0) and not ((J = 5) and not AHasDate) then + begin + R := cxRectOffset(GetDayBoundsFromColAndRow(I, J), -ColWidth, 0); + Dec(R.Right, ColWidth div 8); + CreateWeekNumber(R, ADate, J); + Inc(FWeekNumberCount); + end; + end; +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateMonthHeader; +begin + TcxSchedulerReportDateNavigatorHeader.CreateEx(Self, Year, Month).BoundsRect := GetHeaderBounds; +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateWeekNumber( + const ABounds: TRect; ADate: TDateTime; ARow: Integer); +var + AWeekNumber: TcxSchedulerReportDateNavigatorWeekNumber; +begin + AWeekNumber := TcxSchedulerReportDateNavigatorWeekNumber.CreateEx(Self, + cxDateUtils.GetWeekNumber(ADate, StartOfWeek, FirstWeekOfYear), ARow); + AWeekNumber.BoundsRect := ABounds; +end; + +class procedure TcxSchedulerReportDateNavigatorCell.GetContentPartSizes( + AFont: TFont; var AColWidth, ARowHeight, ADayCaptionsHeight: Integer; + AFontSize: Integer = 0); +var + ASymbolSize: TSize; +begin + ASymbolSize := cxTextExtent(AFont, '0', AFontSize); + AColWidth := 3 * ASymbolSize.cx; + ADayCaptionsHeight := ASymbolSize.cy + 1; + ARowHeight := ASymbolSize.cy; +end; + +function TcxSchedulerReportDateNavigatorCell.GetDayBoundsFromColAndRow( + ACol, ARow: Integer): TRect; +begin + with Result do + begin + Left := Succ(ACol) * ColWidth; + Top := HeaderHeight + DayCaptionsHeight + ARow * RowHeight; + Right := Left + ColWidth; + Bottom := Top + RowHeight; + end; +end; + +function TcxSchedulerReportDateNavigatorCell.GetDayIsBold( + ADate: TDateTime): Boolean; +begin + Result := FBoldedDays.IndexOf(ADate) <> -1; +end; + +function TcxSchedulerReportDateNavigatorCell.GetHeaderBounds: TRect; +begin + Result := cxRect(ColWidth, 0, MonthSize.cx - MulDiv(ColWidth, 2, 3), HeaderHeight); +end; + +class procedure TcxSchedulerReportDateNavigatorCell.GetHeaderPartSizes( + AFont: TFont; var AHeaderHeight: Integer; AFontSize: Integer = 0); +begin + AHeaderHeight := MulDiv(cxTextHeight(AFont, 'Wg', AFontSize), 3 , 2); +end; + +function TcxSchedulerReportDateNavigatorCell.GetMonthSize( + const AContentParams, AHeaderParams: TdxReportItemViewParams): TSize; +begin + GetContentPartSizes(AContentParams.NativeParams.Font, FColWidth, FRowHeight, + FDayCaptionsHeight, AContentParams.FontSize); + GetHeaderPartSizes(AHeaderParams.NativeParams.Font, FHeaderHeight, + AHeaderParams.FontSize); + Result.cx := 9 * FColWidth; + Result.cy := FHeaderHeight + FDayCaptionsHeight + 6 * FRowHeight + 1; +end; + +function TcxSchedulerReportDateNavigatorCell.GetType: TcxSchedulerReportItemsType; +begin + Result := srDateNavigator; +end; + +procedure TcxSchedulerReportDateNavigatorCell.SetViewParams( + const AContentParams, AHeaderParams: TdxReportItemViewParams); +var + I: Integer; + AParams: TdxReportItemViewParams; +begin + FContentParams := AContentParams; + FHeaderParams := AHeaderParams; + SetCellViewParams(Self, AContentParams); + SetCellViewParams(Header, AHeaderParams); + for I := 0 to DayCount - 1 do + begin + AParams := AContentParams; + if Days[I].Bold then + Include(AParams.FontStyle, fsBold); + SetCellViewParams(Days[I], AParams); + end; + for I := 0 to DayCaptionCount - 1 do + SetCellViewParams(DayCaptions[I], AContentParams); + AParams := AContentParams; + if AParams.FontSize <> 0 then + AParams.FontSize := MulDiv(AParams.FontSize, 2, 3) + else + AParams.FontSize := MulDiv(AParams.NativeParams.Font.Size, 2, 3); + for I := 0 to WeekNumberCount - 1 do + SetCellViewParams(WeekNumbers[I], AParams); +end; + +procedure TcxSchedulerReportDateNavigatorCell.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + AReader.Read(FFirstWeekOfYear, SizeOf(FFirstWeekOfYear)); + FMonth := AReader.ReadInteger; + FYear := AReader.ReadInteger; + FShowDatesContainingEventsInBold := AReader.ReadBoolean; + FShowWeekNumbers := AReader.ReadBoolean; +end; + +procedure TcxSchedulerReportDateNavigatorCell.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.Write(FFirstWeekOfYear, SizeOf(FFirstWeekOfYear)); + AWriter.WriteInteger(FMonth); + AWriter.WriteInteger(FYear); + AWriter.WriteBoolean(FShowDatesContainingEventsInBold); + AWriter.WriteBoolean(FShowWeekNumbers); +end; + +class function TcxSchedulerReportDateNavigatorCell.GetMonthHeight( + AHeaderHeight, ADayCaptionsHeight, ARowHeight: Integer): Integer; +begin + Result := (AHeaderHeight + ADayCaptionsHeight + 6 * ARowHeight); +end; + +function TcxSchedulerReportDateNavigatorCell.GetDay( + Index: Integer): TcxSchedulerReportDateNavigatorDay; +begin + Result := DataItems[Index + 1 + 7] as TcxSchedulerReportDateNavigatorDay; +end; + +function TcxSchedulerReportDateNavigatorCell.GetDayCaption( + Index: Integer): TcxSchedulerReportDateNavigatorDayCaption; +begin + Result := DataItems[Index + 1] as TcxSchedulerReportDateNavigatorDayCaption; +end; + +function TcxSchedulerReportDateNavigatorCell.GetHeader: TcxSchedulerReportDateNavigatorHeader; +begin + Result := DataItems[0] as TcxSchedulerReportDateNavigatorHeader; +end; + +function TcxSchedulerReportDateNavigatorCell.GetWeekNumber( + Index: Integer): TcxSchedulerReportDateNavigatorWeekNumber; +begin + Result := DataItems[Index + 1 + 7 + FDayCount] as TcxSchedulerReportDateNavigatorWeekNumber; +end; + +{ TcxSchedulerReportSchedulingAreaCell } + +constructor TcxSchedulerReportSchedulingAreaCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + FVisibleDays := TcxSchedulerDateList.Create; + FDaysList := TStringList.Create; + CellSides := [csLeft, csTop]; +end; + +destructor TcxSchedulerReportSchedulingAreaCell.Destroy; +begin + FDaysList.Free; + FVisibleDays.Free; + inherited Destroy; +end; + +procedure TcxSchedulerReportSchedulingAreaCell.DrawContent( + DC: HDC; DrawRect: TRect; const OriginRect: TRect; AStage: TdxPSRenderStages); +begin + inherited DrawContent(DC, DrawRect, OriginRect, AStage); + if rsFirstPass in AStage then + DrawBorders(DC); +end; + +procedure TcxSchedulerReportSchedulingAreaCell.DrawItself( + DC: HDC; AStage: TdxPSRenderStages); +begin + if rsFirstPass in AStage then + begin + if IsBackgroundBitmapDrawn then + DrawBackgroundBitmap(DC) + else + if IsBackgroundDrawn then + DrawBackground(DC); + end; +end; + +function TcxSchedulerReportSchedulingAreaCell.GetType: TcxSchedulerReportItemsType; +begin + Result := srSchedulingArea; +end; + +{ TcxSchedulerReportCustomCell } + +constructor TcxSchedulerReportCustomCell.CreateFrom(AParent: TdxReportCell; + AViewInfo: TcxSchedulerCustomViewInfoItem); +begin + inherited Create(AParent); + Transparent := False; + BoundsRect := AViewInfo.Bounds; + CellSides := TdxCellSides(AViewInfo.Borders); +end; + +procedure TcxSchedulerReportCustomCell.DrawContent(DC: HDC; AStage: TdxPSRenderStages); +begin + inherited; + //Renderer.ExcludeClipRect(GetFixupRect(DC, BoundsRect)); +end; + +class procedure TcxSchedulerReportCustomCell.RegisterMirrorClass; +begin + MirrorClasses.Add(Self); +end; + +class function TcxSchedulerReportCustomCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := nil; +end; + +procedure TcxSchedulerReportCustomCell.SuppressColoration; +begin + FDayBorderColor := clBlack; + Color := dxPSCore.dxDefaultContentColor; +end; + +procedure TcxSchedulerReportCustomCell.DrawCellFrame(DC: HDC; const ARect: TRect; + ABorders: TcxBorders = []; ABorderColor: TColor = clDefault; ALineWidth: Integer = 1); +begin + Renderer.FrameRect(DC, GetFixupRect(DC, ARect), + ABorderColor, TdxCellSides(ABorders), ALineWidth); +end; + +procedure TcxSchedulerReportCustomCell.DrawCellRect(DC: HDC; const ARect: TRect; + ABorders: TcxBorders = []; ABorderColor: TColor = clDefault; ALineWidth: Integer = 1; + AColor: TColor = clDefault); +var + R: TRect; +begin + if Transparent then + DrawCellFrame(DC, ARect, ABorders, ABorderColor, ALineWidth) + else + begin + R := GetFixupRect(DC, ARect); + if AColor = clDefault then + AColor := Color; + Renderer.FillRect(DC, R, AColor); + Renderer.FrameRect(DC, R, ABorderColor, TdxCellSides(ABorders), ALineWidth); + end; +end; + +procedure TcxSchedulerReportCustomCell.DrawCellText(DC: HDC; const ARect: TRect; + const AText: string; AlignHorz: TdxTextAlignX; AlignVert: TdxTextAlignY; + AFont: TFont = nil; AColor: TColor = clDefault; AMultiLine: Boolean = False); +const + Horz: array[TdxTextAlignX] of Integer = + (DXTO_LEFT, DXTO_CENTER_HORIZONTALLY, DXTO_RIGHT, DXTO_LEFT, DXTO_LEFT); + Vert: array[TdxTextAlignY] of Integer = + (DXTO_TOP, DXTO_CENTER_VERTICALLY, DXTO_BOTTOM, DXTO_TOP); +var + R: TRect; + AMode: Integer; + Flags: Integer; +begin + if Length(AText) = 0 then Exit; + R := GetFixupRect(DC, ARect); + Flags := Renderer.MakeTextFormat(AlignHorz, AlignVert, AMultiLine, False, True, True, False); + if FNoClip then + Flags := Flags or DXTO_NOCLIP; +{ Flags := DXTO_PREVENT_LEFT_EXCEED or DXTO_PREVENT_TOP_EXCEED or DXTO_NOCLIP or + Horz[AlignHorz] or Vert[AlignVert] or DXTO_SINGLELINE;} + if AFont = nil then + AFont := Font; + AMode := SetBkMode(DC, Windows.TRANSPARENT); + Renderer.DrawTextEx(DC, R, -1, cxTextOffset, + cxTextOffset, AText, AFont, Flags); + SetBkMode(DC, AMode); +end; + +procedure TcxSchedulerReportCustomCell.DrawCellTextVert(DC: HDC; const ARect: TRect; + const AText: string; AlignHorz: TdxTextAlignX; AlignVert: TdxTextAlignY; + AFont: TFont = nil; AMultiLine: Boolean = True); +begin + dxRotatedTextOut(DC, ARect, AText, AFont, AlignHorz, AlignVert, AMultiLine); +end; + +procedure TcxSchedulerReportCustomCell.DrawCellState(DC: HDC; R: TRect; + AState: Integer; ABorders: TcxBorders = []; ABorderColor: TColor = clBlack); +var + ABrushHandle: HBrush; + APenHandle: HPen; + Points: array[0..2] of TPoint; +begin + FixupRect(DC, R); + if R.Top = R.Bottom then + begin + R := ExcludeBorders(R, ABorders); + ABrushHandle := SelectObject(DC, StateBrushes[AState].Handle); + APenHandle := SelectObject(DC, GetStockObject(BLACK_PEN)); + Points[0] := Point(R.Left, R.Top); + Points[1] := Point(R.Right, R.Top); + Points[2] := Point(R.Right, R.Top + R.Right - R.Left); + Windows.Polygon(DC, Points, 3); + SelectObject(DC, APenHandle); + SelectObject(DC, ABrushHandle); + end + else + begin + DrawCellFrame(DC, R, ABorders, ABorderColor, 1); + FillRect(DC, ExcludeBorders(R, ABorders), StateBrushes[AState].Handle); + end; +end; + +function TcxSchedulerReportCustomCell.AdjustTextRect(const ARect: TRect): TRect; +var + L: Integer; +begin + L := FixupWidth(cxTextOffset); + Result := ARect; + InflateRect(Result, -L, -L); +end; + +function TcxSchedulerReportCustomCell.ExcludeBorders(const ARect: TRect; + ABorders: TcxBorders; ABorderWidth: Integer = 1): TRect; +begin + Result := ARect; + with Result do + begin + if bLeft in ABorders then + Inc(Left, ABorderWidth * LineThickness); + if bRight in ABorders then + Dec(Right, ABorderWidth * LineThickness); + if bTop in ABorders then + Inc(Top, ABorderWidth * LineThickness); + if bBottom in ABorders then + Dec(Bottom, ABorderWidth * LineThickness); + end; +end; + +function TcxSchedulerReportCustomCell.FixupWidth(AWidth: Integer): Integer; +begin + if not Renderer.IsPrinting then + Result := MulDiv(AWidth * Renderer.UnitsPerPixel, Renderer.ZoomFactor, 100) + else + Result := MulDiv(AWidth * Renderer.UnitsPerPixel, Renderer.PPI * 5, 72 * 7); +end; + +function TcxSchedulerReportCustomCell.GetFixupRect(DC: HDC; const ARect: TRect): TRect; +begin + Result := ARect; + FixupRect(DC, Result); +end; + +function TcxSchedulerReportCustomCell.InflateRect(const ARect: TRect; dX, dY: Integer): TRect; +begin + Result := ARect; +end; + +function TcxSchedulerReportCustomCell.GetReportLink: TcxSchedulerReportLink; +begin + Result := TcxSchedulerReportLink(Renderer.ReportLink); +end; + +{ TcxSchedulerReportContentCell } + +constructor TcxSchedulerReportContentCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); +begin + inherited CreateFrom(AParent, AViewInfo); + Data := cdidSchedulerContent; + if AViewInfo is TcxSchedulerContentCellViewInfo then + with TcxSchedulerContentCellViewInfo(AViewInfo) do + begin + Self.BoundsRect := Bounds; + Self.FBorderColor := BorderColor; + Self.FShowTimeLine := ShowTimeLine; + Self.FTimeLineBorders := TimeLineBorders; + if TimeEvent <> nil then + Self.FState := TimeEvent.Event.State + else + Self.FState := -1; + if ShowTimeLine then + begin + CellSideColors[csRight] := clBlack; + CellSideColors[csbottom] := FBorderColor; + end; + CellSides := csAll; + end; +end; + +procedure TcxSchedulerReportContentCell.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportContentCell then + with TcxSchedulerReportContentCell(Source) do + begin + Self.FBorderColor := FBorderColor; + Self.FShowTimeLine := FShowTimeLine; + Self.FState := FState; + Self.FTimeLineBorders := FTimeLineBorders; + end; + inherited Assign(Source); +end; + +procedure TcxSchedulerReportContentCell.DrawContent(DC: HDC; + AStage: TdxPSRenderStages); +var + R: TRect; +begin + inherited DrawContent(DC, AStage); + R := BoundsRect; + if FShowTimeLine then + begin + R.Right := R.Left + FixupWidth(cxTimeLineWidth); + if FState = -1 then + DrawCellRect(DC, R, FTimeLineBorders - [bLeft], clBlack, 1, clWhite) + else + DrawCellState(DC, R, FState, FTimeLineBorders, clBlack); + end +end; + +class function TcxSchedulerReportContentCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerContentCellViewInfo; +end; + +procedure TcxSchedulerReportContentCell.SuppressColoration; +var + I: TdxCellSide; +begin + for I := csLeft to csBottom do + CellSideColors[I] := clBlack; + FBorderColor := clBlack; + if FState <> -1 then + Inc(FState, 4); + inherited SuppressColoration; +end; + +function TcxSchedulerReportContentCell.HasBorderColoration: Boolean; +begin + Result := True; +end; + +{ TcxSchedulerReportHeaderItemCell } + +constructor TcxSchedulerReportHeaderItemCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); + + function GetConvertedRect(ARotateHeader, ARotateText: Boolean; const R: TRect): TRect; + begin + if ARotateHeader then + begin + with R do + if ARotateText then + Result := cxRectBounds(BoundsRect.Left + Top, BoundsRect.Bottom - Right, + Bottom - Top, Right - Left) + else + Result := cxRectBounds(BoundsRect.Left + Left, BoundsRect.Top + Top, + Right - Left, Bottom - Top); + end + else + Result := R; + end; + +begin + inherited CreateFrom(AParent, AViewInfo); + Data := cdidSchedulerHeader; + if AViewInfo is TcxSchedulerHeaderCellViewInfo then + with TcxSchedulerHeaderCellViewInfo(AViewInfo) do + begin + CalculateImageLayout; + Self.TextAlignX := TextAlignXMap[AlignHorz]; + Self.Multiline := AutoHeight; + Self.TextAlignY := TextAlignYMap[AlignVert]; + Self.FRotateText := RotateText; + Self.FCaption := DisplayText; + Self.FIsResourceHeader := IsResourceHeader; + Self.FResourceID := ResourceID; + //image support + Self.FImages := Images; + Self.FImageIndex := ImageIndex; + Self.FTextRect := GetConvertedRect(RotateHeader, RotateText, TextRect); + Self.FImageRect := GetConvertedRect(RotateHeader, RotateText, ImageRect); + end; + CellSides := csAll; + ReportLink.RegisterLookAndFeelItem(Self, cesRaised); + FNoClip := True; +end; + +procedure TcxSchedulerReportHeaderItemCell.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportHeaderItemCell then + with TcxSchedulerReportHeaderItemCell(Source) do + begin + Self.FCaption := FCaption; + Self.FDate := FDate; + Self.FResourceID := FResourceID; + Self.FRotateText := FRotateText; + //image support + Self.FTextRect := FTextRect; + Self.FImages := FImages; + Self.FImageIndex := FImageIndex; + Self.FImageRect := FImageRect; + end; + inherited Assign(Source); +end; + +procedure TcxSchedulerReportHeaderItemCell.DrawContent( + DC: HDC; AStage: TdxPSRenderStages); +var + R: TRect; +begin + inherited DrawContent(DC, AStage); + if ReportLink.SupportImages then + R := GetFixupRect(DC, FTextRect) + else + R := BoundsRect; + if FRotateText then + DrawCellTextVert(DC, R, FCaption, TextAlignX, TextAlignY, Font, Multiline) + else + DrawCellText(DC, R, FCaption, TextAlignX, TextAlignY, Font, clDefault, Multiline); + if HasImage then + DrawImage(DC); +end; + +procedure TcxSchedulerReportHeaderItemCell.DrawImage(DC: HDC); +var + R: TRect; +begin + R := GetFixupRect(DC, FImageRect); + Renderer.DrawGraphicEx(DC, R, R, Images, ImageIndex, nil, True, True, Color, + ContentBkColor, ContentPattern, cibAlways); +end; + +class function TcxSchedulerReportHeaderItemCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerHeaderCellViewInfo; +end; + +procedure TcxSchedulerReportHeaderItemCell.ConvertCoords( + APixelsNumerator, APixelsDenominator: Integer); +begin + inherited ConvertCoords(APixelsNumerator, APixelsDenominator); + ConvertRect(FTextRect, APixelsNumerator, APixelsDenominator); + ConvertRect(FImageRect, APixelsNumerator, APixelsDenominator); +end; + +function TcxSchedulerReportHeaderItemCell.HasImage: Boolean; +begin + Result := (Images <> nil) and (ImageIndex > -1) and (ImageIndex < Images.Count); +end; + +procedure TcxSchedulerReportHeaderItemCell.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FRotateText := AReader.ReadBoolean; + FCaption := AReader.ReadString; + if ReportLink.SupportImages then + begin + FTextRect := AReader.ReadRect; + if AReader.ReadBoolean then // HasImage + begin + FImageRect := AReader.ReadRect; + FImages := ReportCells.ImageLists[AReader.ReadInteger]; + FImageIndex := AReader.ReadInteger; + end + else + FImages := nil; + end; +end; + +procedure TcxSchedulerReportHeaderItemCell.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteBoolean(FRotateText); + AWriter.WriteString(FCaption); + if ReportLink.SupportImages then + begin + AWriter.WriteRect(FTextRect); + AWriter.WriteBoolean(HasImage); + if HasImage then + begin + AWriter.WriteRect(FImageRect); + AWriter.WriteInteger(ReportCells.IndexOfImageList(Images)); + AWriter.WriteInteger(ImageIndex); + end; + end; +end; + +function TcxSchedulerReportHeaderItemCell.GetTextAlignX: TdxTextAlignX; +begin + Result := inherited TextAlignX; +end; + +function TcxSchedulerReportHeaderItemCell.GetTextAlignY: TdxTextAlignY; +begin + Result := inherited TextAlignY; +end; + +procedure TcxSchedulerReportHeaderItemCell.SetTextAlignX( + Value: TdxTextAlignX); +begin + inherited TextAlignX := Value; +end; + +procedure TcxSchedulerReportHeaderItemCell.SetTextAlignY( + Value: TdxTextAlignY); +begin + inherited TextAlignY := Value; +end; + +{ TcxSchedulerReportGroupSeparatorCell } + +constructor TcxSchedulerReportGroupSeparatorCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); +begin + inherited CreateFrom(AParent, AViewInfo); + CellSides := csAll; + ReportLink.RegisterLookAndFeelItem(Self, cesRaised); +end; + +class function TcxSchedulerReportGroupSeparatorCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerGroupSeparatorCellViewInfo; +end; + +{ TcxSchedulerReportContainerCell } + +class function TcxSchedulerReportContainerCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerContainerCellViewInfo; +end; + +{ TcxSchedulerReportTextCell } + +constructor TcxSchedulerReportTextCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); +begin + inherited CreateFrom(AParent, AViewInfo); + FTextRect := BoundsRect; +end; + +procedure TcxSchedulerReportTextCell.DrawContent( + DC: HDC; AStage: TdxPSRenderStages); +begin + DrawCellRect(DC, BoundsRect, TcxBorders(CellSides), clWindowText); + DrawCellText(DC, TextRect, DisplayText, taLeft, taTop); +end; + +procedure TcxSchedulerReportTextCell.ConvertCoords( + APixelsNumerator, APixelsDenominator: Integer); +begin + inherited ConvertCoords(APixelsNumerator, APixelsDenominator); + ConvertRect(FTextRect, APixelsNumerator, APixelsDenominator); +end; + +procedure TcxSchedulerReportTextCell.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FDisplayText := AReader.ReadString; + FTextRect := AReader.ReadRect; +end; + +procedure TcxSchedulerReportTextCell.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteString(FDisplayText); + AWriter.WriteRect(FTextRect); +end; + + +{ TcxSchedulerReportBackgroundSlotCell } + +constructor TcxSchedulerReportBackgroundSlotCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); +begin + inherited CreateFrom(AParent, AViewInfo); + if AViewInfo is TcxSchedulerBackgroundSlotCellViewInfo then + with TcxSchedulerBackgroundSlotCellViewInfo(AViewInfo) do + Self.FDisplayText := DisplayText; +end; + +class function TcxSchedulerReportBackgroundSlotCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerBackgroundSlotCellViewInfo; +end; + + { TcxSchedulerReportTimeLineMinorScaleCell } + +constructor TcxSchedulerReportTimeLineMinorScaleCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); +begin + inherited CreateFrom(AParent, AViewInfo); + if AViewInfo is TcxSchedulerTimeGridMinorScaleCell then + begin + Self.DisplayText := TcxSchedulerTimeGridMinorScaleCell(AViewInfo).DisplayText; + Self.FTextRect := TcxSchedulerTimeGridMinorScaleCell(AViewInfo).TextBounds; + end; +end; + +class function TcxSchedulerReportTimeLineMinorScaleCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerTimeGridMinorScaleCell; +end; + +{ TcxSchedulerReportTimeLineMajorScaleCell } + +class function TcxSchedulerReportTimeLineMajorScaleCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerTimeGridMajorScaleCell; +end; + +{ TcxSchedulerReportDailyTimeRulerCellsSite } + +constructor TcxSchedulerReportDailyTimeRulerCellsSite.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + FLargeFont := TFont.Create; + FontIndex := ReportCells.ReportLink.AddFontToPool(Font); + CellSides := []; +end; + +destructor TcxSchedulerReportDailyTimeRulerCellsSite.Destroy; +begin + FLargeFont.Free; + inherited Destroy; +end; + +procedure TcxSchedulerReportDailyTimeRulerCellsSite.SetFontIndex(Index: Integer); +begin + inherited SetFontIndex(Index); + if Font <> nil then + begin + FLargeFont.Assign(Font); + FLargeFont.Size := Font.Size * 2; + FLargeFontIndex := ReportCells.ReportLink.AddFontToPool(FLargeFont); + end; +end; + +procedure TcxSchedulerReportDailyTimeRulerCellsSite.ReadProperties( + AReader: TdxPSDataReader); +begin + inherited ReadProperties(AReader); + FLargeFontIndex := AReader.ReadInteger; +end; + +procedure TcxSchedulerReportDailyTimeRulerCellsSite.WriteProperties( + AWriter: TdxPSDataWriter); +begin + inherited WriteProperties(AWriter); + AWriter.WriteInteger(FLargeFontIndex); +end; + +function TcxSchedulerReportDailyTimeRulerCellsSite.GetLargeFont: TFont; +begin + if (FLargeFontIndex <> -1) and (ReportCells <> nil) then + Result := ReportCells.GetFontByIndex(FLargeFontIndex) + else + Result := nil; +end; + +{ TcxSchedulerReportDailyTimeRulerCell } + +constructor TcxSchedulerReportDailyTimeRulerCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); +var + I: Boolean; +begin + inherited CreateFrom(AParent, AViewInfo); + CellSides := [csRight]; + Data := cdidSchedulerTimeRuler; + FLineColor := clBtnShadow; + TimeRulerSite.Width := Max(TimeRulerSite.Width, Width); + if AViewInfo is TcxSchedulerTimeRulerCellViewInfo then + with TcxSchedulerTimeRulerCellViewInfo(AViewInfo) do + begin + TimeRulerSite.Height := Max(TimeRulerSite.Height, ClipRect.Bottom); + Self.FHour := Hour; + Self.FShowMinutes := ShowMinutes; + Self.FHasAdditionalTimeZone := HasAdditionalTimeZone; + Self.FLineCount:= LineCount; + for I := False to True do + begin + Self.FBounds[I] := Bounds[I]; + Self.FDisplayTexts[I] := DisplayTexts[I]; + end; + end; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerReportDailyTimeRulerCell then + with TcxSchedulerReportDailyTimeRulerCell(Source) do + begin + Self.FHasAdditionalTimeZone := FHasAdditionalTimeZone; + Self.FLineCount := FLineCount; + Self.FBounds[False] := FBounds[False]; + Self.FBounds[True] := FBounds[True]; + Self.FDisplayTexts[False] := FDisplayTexts[False]; + Self.FDisplayTexts[True] := FDisplayTexts[True]; + Self.FHour := FHour; + end; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.DrawContent( + DC: HDC; AStage: TdxPSRenderStages); +var + I: Boolean; +const + ABorders: array[Boolean] of TcxBorders = ([bBottom], [bBottom, bRight]); +begin + if Index = 0 then + CellSides := CellSides + [csBottom]; + inherited; + CalculateDisplayInfo; + for I := not HasAdditionalTimeZone to True do + begin + if Hour >= 0 then + DrawTimeZone(DC, Bounds[I], DisplayTexts[I], I) + else + DrawTimeZoneLabel(DC, Bounds[I], DisplayTexts[I], ABorders[I]); + end; +end; + +class function TcxSchedulerReportDailyTimeRulerCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerTimeRulerCellViewInfo; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.SuppressColoration; +begin + inherited SuppressColoration; + FLineColor := clBlack; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.CalculateDisplayInfo; +begin + FBounds[True] := BoundsRect; + FBounds[False] := BoundsRect; + if HasAdditionalTimeZone then + begin + FBounds[True].Left := cxRectCenter(BoundsRect).X; + FBounds[False].Right := FBounds[True].Left; + end; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.DrawTimeZone(DC: HDC; + const ABounds: TRect; const AText: string; AIsCurrent: Boolean); +var + S: string; + J, LH: Integer; + R1, R, TextR: TRect; +begin + LH := cxRectHeight(BoundsRect) div LineCount; + R := BoundsRect; + Dec(R.Right, FixupWidth(6)); + if not IsLastItem then + DrawCellFrame(DC, R, [bBottom], FLineColor); + + R := cxRectSetHeight(ABounds, LH); + R.Left := (R.Left + R.Right) div 2 + FixupWidth(cxTextOffset * 2); + Dec(R.Right, FixupWidth(6)); + for J := 0 to LineCount - 2 do + begin + DrawCellFrame(DC, R, [bBottom], FLineColor, 1); + OffsetRect(R, 0, LH); + end; + TextR := cxRectInflate(ExcludeBorders(ABounds, + [bRight, bBottom]), -FixupWidth(5), -FixupWidth(cxTextOffset)); + FNoClip := True; + if LineCount > 1 then + begin + J := Length(AText); + + DrawCellText(DC, Rect(TextR.Left, TextR.Top, R.Left - FixupWidth(cxTextOffset), TextR.Bottom), + Copy(AText, 1, J - 3), taRight, taTop, LargeFont, LargeFont.Color); + R1 := Rect(R.Left, TextR.Top, TextR.Right, TextR.Top + LH - FixupWidth(3)); + DrawCellText(DC, R1, Copy(AText, J - 1, 2), taCenterX, taTop, Font); + if ShowMinutes and AIsCurrent then + for J := 1 to LineCount - 1 do + begin + OffsetRect(R1, 0, LH); + S := IntToStr(MulDiv(60, J, LineCount)); + if Length(S) < 2 then + S := '0' + S; + DrawCellText(DC, R1, S, taCenterX, taTop, Font); + end; + end + else + DrawCellText(DC, TextR, AText, taRight, taCenterY, Font); + R.Left := ABounds.Left + FixupWidth(5); + if not IsLastItem then + begin + if Hour <> 23 then + DrawCellFrame(DC, R, [bBottom], FLineColor) + else + DrawCellFrame(DC, ABounds, [bBottom], FLineColor); + end; + if HasAdditionalTimeZone then + begin + R := GetInnerBounds(DC); + R.Left := (R.Left + R.Right) div 2; + R.Right := R.Left + LineThickness; + Renderer.FillRect(DC, R, clBlack); + end; + FNoClip := False; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FHasAdditionalTimeZone := AReader.ReadBoolean; + FLineCount := AReader.ReadInteger; + FBounds[False] := AReader.ReadRect; + FBounds[True] := AReader.ReadRect; + FDisplayTexts[False] := AReader.ReadString; + FDisplayTexts[True] := AReader.ReadString; + FHour := AReader.ReadInteger; + FLineColor := AReader.ReadInteger; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteBoolean(FHasAdditionalTimeZone); + AWriter.WriteInteger(FLineCount); + AWriter.WriteRect(FBounds[False]); + AWriter.WriteRect(FBounds[True]); + AWriter.WriteString(FDisplayTexts[False]); + AWriter.WriteString(FDisplayTexts[True]); + AWriter.WriteInteger(FHour); + AWriter.WriteInteger(FLineColor); +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.DrawTimeZoneLabel(DC: HDC; + const ABounds: TRect; const AText: string; ABorders: TcxBorders); +begin + DrawCellText(DC, AdjustTextRect(ABounds), AText, taLeft, taBottom, Font, Font.Color); +end; + +function TcxSchedulerReportDailyTimeRulerCell.GetBoundsRect(AType: Boolean): TRect; +begin + Result := FBounds[AType]; +end; + +function TcxSchedulerReportDailyTimeRulerCell.GetDisplayText(AType: Boolean): string; +begin + Result := FDisplayTexts[AType]; +end; + +function TcxSchedulerReportDailyTimeRulerCell.GetLargeFont: TFont; +begin + Result := TimeRulerSite.LargeFont; +end; + +function TcxSchedulerReportDailyTimeRulerCell.GetTimeRulerSite: TcxSchedulerReportDailyTimeRulerCellsSite; +begin + Result := TcxSchedulerReportDailyTimeRulerCellsSite(Parent); +end; + +{ TcxSchedulerReportMonthDayCell } + +constructor TcxSchedulerReportMonthDayCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); +begin + inherited CreateFrom(AParent, AViewInfo); + if AViewInfo is TcxSchedulerMonthDayContentCellViewInfo then + begin + FSmallFont := TcxSchedulerMonthDayContentCellViewInfo(AViewInfo).SmallFont; + FDontPrint := TcxSchedulerMonthDayContentCellViewInfo(AViewInfo).DontPrint; + if FDontPrint then + begin + Transparent := True; + FDisplayText := ''; + end + else + FDisplayText := TcxSchedulerMonthDayContentCellViewInfo(AViewInfo).DisplayText; + end; +end; + +procedure TcxSchedulerReportMonthDayCell.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerReportMonthDayCell then + begin + FDontPrint := TcxSchedulerReportMonthDayCell(Source).FDontPrint; + FDisplayText := TcxSchedulerReportMonthDayCell(Source).FDisplayText; + end; +end; + +procedure TcxSchedulerReportMonthDayCell.DrawContent( + DC: HDC; AStage: TdxPSRenderStages); +var + R: TRect; + F: TFont; +begin + inherited DrawContent(DC, AStage); + if FDontPrint then Exit; + if FDisplayText <> '' then + begin + R := ExcludeBorders(BoundsRect, TcxBorders(CellSides)); + F := TFont.Create; + try + F.Assign(Font); + if SmallFont then + F.Size := MulDiv(F.Size, 2, 3); + DrawCellText(DC, R, FDisplayText, taRight, taTop, F); + finally + F.Free; + end; + end; +end; + +class function TcxSchedulerReportMonthDayCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerMonthDayContentCellViewInfo; +end; + +procedure TcxSchedulerReportMonthDayCell.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FDisplayText := AReader.ReadString; + FDontPrint := AReader.ReadBoolean; +end; + +procedure TcxSchedulerReportMonthDayCell.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteString(FDisplayText); + AWriter.WriteBoolean(FDontPrint); +end; + +{ TcxSchedulerReportTimeLinePart } + +constructor TcxSchedulerReportTimeLinePart.CreateEx(AParent: TdxReportCell; + ATriangle: Boolean; AState: Integer); +begin + inherited Create(AParent); + Transparent := False; + FTriangle := ATriangle; + FState := AState; + Data := cdidSchedulerEventTimeLine; +end; + +procedure TcxSchedulerReportTimeLinePart.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerReportTimeLinePart then + begin + FState := TcxSchedulerReportTimeLinePart(Source).FState; + FTriangle := TcxSchedulerReportTimeLinePart(Source).FTriangle; + end; +end; + +procedure TcxSchedulerReportTimeLinePart.DrawContent(DC: HDC; + AStage: TdxPSRenderStages); +var + R: TRect; + ABrushHandle: HBrush; + APenHandle: HPen; + Points: array[0..2] of TPoint; +begin + R := GetOuterBounds(DC); + if FTriangle then + begin + Renderer.FillRect(DC, R, clWhite); + ABrushHandle := SelectObject(DC, StateBrushes[FState].Handle); + APenHandle := SelectObject(DC, GetStockObject(NULL_PEN)); + Points[0] := R.TopLeft; + Points[1] := Point(R.Right, R.Top); + Points[2] := Point(R.Right, R.Top + R.Right - R.Left); + Windows.Polygon(DC, Points, 3); + SelectObject(DC, GetStockObject(BLACK_PEN)); + Windows.MoveToEx(DC, R.Left, R.Top, nil); + Windows.LineTo(DC, R.Right, R.Top + R.Right - R.Left); + SelectObject(DC, APenHandle); + SelectObject(DC, ABrushHandle); + end + else + Windows.FillRect(DC, R, StateBrushes[FState].Handle); + DrawBorders(DC); +end; + +procedure TcxSchedulerReportTimeLinePart.ReadData( + AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FTriangle := AReader.ReadBoolean; + FState := AReader.ReadInteger; +end; + +procedure TcxSchedulerReportTimeLinePart.WriteData( + AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteBoolean(FTriangle); + AWriter.WriteInteger(FState); +end; + +{ TcxSchedulerReportTimeLineCell } + +constructor TcxSchedulerReportTimeLineCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + Transparent := False; + Color := clWhite; +end; + +procedure TcxSchedulerReportTimeLineCell.SetTimeRect(const ABounds: TRect; AState: Integer); +var + ATriangle: Boolean; +begin + ATriangle := cxRectIsEmpty(ABounds); + FCurrentValue := TcxSchedulerReportTimeLinePart.CreateEx(Self, ATriangle, AState); + if ATriangle then + FCurrentValue.BoundsRect := BoundsRect + else + FCurrentValue.BoundsRect := ABounds; +end; + +{ TcxSchedulerReportCellString } + +function TcxSchedulerReportCellString.GetDefaultDTFormat: DWORD; +begin + Result := inherited GetDefaultDTFormat and not DXTO_EDITCONTROL; +end; + +{ TcxSchedulerReportCustomEventCell } + +function TcxSchedulerReportCustomEventCell.CreateStringCell( + const AText: string; AMultiline: Boolean = True; AData: Integer = 0): TdxReportCellString; +begin + Result := TcxSchedulerReportCellString.Create(Self); + Result.CellSides := []; + Result.Multiline := AMultiline; + Result.Text := AText; + Result.Data := AData; +end; + +procedure TcxSchedulerReportCustomEventCell.SetViewParams(const AViewParams: TcxViewParams); +var + I: Integer; +begin + ReportLink.SetCellViewParams(Self, AViewParams); + for I := 0 to DataItemCount - 1 do + ReportLink.SetCellViewParams(DataItems[I], AViewParams); +end; + +function TcxSchedulerReportCustomEventCell.GetPrintStyle: TcxCustomSchedulerReportLinkPrintStyle; +begin + Result := ReportLink.PrintStyles.ActiveStyle; +end; + +function TcxSchedulerReportCustomEventCell.GetReportLink: TcxSchedulerReportLink; +begin + Result := ReportCells.ReportLink as TcxSchedulerReportLink; +end; + +function TcxSchedulerReportCustomEventCell.GetSuppressColoration: Boolean; +begin + Result := ReportLink.OptionsFormatting.SuppressContentColoration; +end; + +{ TcxSchedulerReportEventCell } + +constructor TcxSchedulerReportEventCell.CreateFrom(AParent: TdxReportCell; + AEventViewInfo: TcxSchedulerEventCellViewInfo); +begin + inherited Create(AParent); + ClipChildren := True; + Transparent := False; + InitializeFromViewInfo(AEventViewInfo); + CreateDataItems; + SetViewParams(AEventViewInfo.ViewParams); + CalculateLayout; +end; + +procedure TcxSchedulerReportEventCell.AdjustItemsHeight(DC: HDC); + + procedure CheckItem(AItem: TAbstractdxReportCellData); + var + R: TRect; + begin + if Assigned(AItem) then + begin + R := AItem.BoundsRect; + if HasMessage then + R.Bottom := MessageCell.Top + else + R.Bottom := ContentBounds.Bottom; + AItem.BoundsRect := R; + end; + end; + +begin + CheckItem(CaptionCell); + CheckItem(StartCell); + CheckItem(FinishCell); +end; + +procedure TcxSchedulerReportEventCell.CalculateLayout; +var + DC: HDC; + I, W, H, AHalfWidth: Integer; +begin + DC := GetDC(0); + try + FContentBounds := GetContentBounds(DC); + if Assigned(FTimeLineCell) then + CalculateTimeLine(DC); + FCaptionLeft := FContentBounds.Left; + if IsNeedCreateTimeCells then + begin + H := Renderer.CalcTextHeight(DC, '0', False, CaptionCell.Font); + W := Renderer.CalcTextWidth(DC, '00:00', CaptionCell.Font); + AHalfWidth := cxRectWidth(ContentBounds) div 2; + if W < AHalfWidth then + begin + StartCell.BoundsRect := cxRectBounds(FCaptionLeft, 0, W, H); + if W * 2 < AHalfWidth then + begin + FinishCell.BoundsRect := cxRectBounds(StartCell.BoundsRect.Right, 0, W, H); + FCaptionLeft := FinishCell.BoundsRect.Right + 2; + end + else + begin + FCaptionLeft := StartCell.BoundsRect.Right + 2; + FreeAndNil(FFinishCell); + end; + end + else + FreeAndNil(FStartCell); + for I := 0 to DataItemCount - 1 do + if DataItems[I].Data = cdidSchedulerEventIcons then + begin + DataItems[I].Left := FCaptionLeft; + Inc(FCaptionLeft, DataItems[I].Width + 2); + end; + end; + CaptionCell.BoundsRect := GetCaptionRect(DC); + if Assigned(MessageCell) then + begin + MessageCell.BoundsRect := GetMessageRect(DC); + MessageCell.AdjustContent(DC); + end; + AdjustItemsHeight(DC); + finally + ReleaseDC(0, DC); + end; +end; + +procedure TcxSchedulerReportEventCell.CalculateTimeLine(DC: HDC); + + function GetTimeRectBrushIndex: Integer; + begin + Result := Event.State; + if SuppressColoration then + Inc(Result, 4); + end; + + function GetActualTimeRect: TRect; + begin + Result := GetRelativeRect(EventViewInfo.EventTimeRect); + if not cxRectIsEmpty(Result) then + Result := cxRectInflate(Result, 0, 1); + end; + +begin + if FTimeLineCell = nil then Exit; + FTimeLineCell.BoundsRect := GetTimeLineRect(DC); + FTimeLineCell.SetTimeRect(GetActualTimeRect, GetTimeRectBrushIndex); +end; + +function TcxSchedulerReportEventCell.CreateCaptionCell: TdxReportCellString; +begin + Result := CreateStringCell(EventViewInfo.Caption, + FHasDetailInfo and not IsHeaderEvent, cdidSchedulerEventCaption); + with Result do + begin + if HasDetailInfo then TextAlignY := taTop; + if IsHeaderEvent and not HasImages then TextAlignX := taCenterX; + end; +end; + +procedure TcxSchedulerReportEventCell.CreateDataItems; +begin + {and (EventViewInfo is TcxSchedulerDayViewEventCellViewInfo)} + if HasDetailInfo and not IsHeaderEvent then + FTimeLineCell := CreateTimeLineCell; + if IsNeedCreateTimeCells then + begin + FStartCell := CreateTimeTextCell(EventViewInfo.StartText, cdidSchedulerEventStart); + FFinishCell := CreateTimeTextCell(EventViewInfo.FinishText, cdidSchedulerEventFinish); + end; + CreateEventImageCells; + FCaptionCell := CreateCaptionCell; + if HasMessage then + CreateMessageCell(Event.Message, EventViewInfo.EventViewData.EditProperties, + EventViewInfo.ViewParams); +end; + +procedure TcxSchedulerReportEventCell.CreateEventImageCells; +var + I: Integer; + AImageCell: TdxReportCellImage; + AImage: TcxSchedulerEventImageItem; +begin + if not HasImages then Exit; + for I := 0 to EventViewInfo.Images.Count - 1 do + begin + AImage := EventViewInfo.Images[I]; + AImageCell := AddDataItem(TdxReportCellImage) as TdxReportCellImage; + AImageCell.CellSides := []; + AImageCell.Data := cdidSchedulerEventIcons; + if AImage.ImageType = eitCustom then + begin + AImageCell.ImageList := AImage.Images; + AImageCell.ImageIndex := AImage.ImageIndex; + AImageCell.BoundsRect := GetRelativeRect(AImage.Bounds); + end + else + begin + AImageCell.TextAlignX := taCenterX; + AImageCell.TextAlignY := taBottom; + case AImage.ImageType of + eitReminder: + AImageCell.Text := 'A'; + eitRecurrence: + AImageCell.Text := 'B'; + eitCustomOccurrence: + AImageCell.Text := 'C'; + end; + AImageCell.BoundsRect := GetRelativeRect(AImage.Bounds); + end; + end; +end; + +procedure TcxSchedulerReportEventCell.CreateMessageCell(AMessage: Variant; + AProperties: TcxCustomEditProperties; AViewParams: TcxViewParams); +var + AParams: TdxReportItemViewParams; +begin + if AProperties = nil then + FMessageCell := nil + else + begin + FMessageCell := AddDataItem(GetMessageClass(AProperties)); + FillChar(AViewParams, SizeOf(AViewParams), 0); + AParams.NativeParams := AViewParams; + dxPScxCommon.dxPSDataMaps.InitializeItem(FMessageCell, AProperties, AMessage, + PrintStyle, AParams); + if not SuppressColoration then + MessageCell.BorderColor := EventViewInfo.SeparatorColor; + FMessageCell.CellSides := [csTop]; + FMessageCell.Data := cdidSchedulerEventMessage + end; +end; + +function TcxSchedulerReportEventCell.CreateTimeTextCell( + const ATimeText: string; AData: Integer = 0): TdxReportCellString; +begin + Result := CreateStringCell(ATimeText, False, AData); + Result.TextAlignX := taRight; +end; + +function TcxSchedulerReportEventCell.CreateTimeLineCell: TcxSchedulerReportTimeLineCell; +begin + Result := TcxSchedulerReportTimeLineCell.Create(Self); +end; + +function TcxSchedulerReportEventCell.GetCaptionRect(DC: HDC): TRect; +begin + if HasImages then + Result := GetRelativeRect(EventViewInfo.CaptionRect) + else + Result := FContentBounds; + if IsNeedCreateTimeCells then + Result.Left:= FCaptionLeft; + if HasMessage then + begin + Result.Bottom := Result.Top + CaptionCell.MeasureFontHeight(DC); + Renderer.CalcTextRect(DC, CaptionCell.Text, Result, True, Font); + Result.Right := ContentBounds.Right; + CheckBounds(Result); + end; +end; + +function TcxSchedulerReportEventCell.GetContentBounds(DC: HDC): TRect; +begin + Result := GetRelativeRect(EventViewInfo.Bounds); + Dec(Result.Right); + Dec(Result.Bottom); +end; + +function TcxSchedulerReportEventCell.GetHasImages: Boolean; +begin + Result := PrintStyle.ShowEventImages and (FEventViewInfo.Images.Count > 0); +end; + +function TcxSchedulerReportEventCell.GetHasMessage: Boolean; +begin + Result := PrintStyle.SupportMessage and HasDetailInfo; +end; + +function TcxSchedulerReportEventCell.GetMessageClass(AProperties: TcxCustomEditProperties): TdxReportCellDataClass; +begin + Result := dxPScxCommon.dxPSDataMaps.ItemClass(AProperties); +end; + +function TcxSchedulerReportEventCell.GetMessageRect(DC: HDC): TRect; +begin + if HasImages then + Result := GetRelativeRect(EventViewInfo.MessageRect) + else + Result := ContentBounds; + if CaptionCell.BoundsRect.Bottom > Result.Top then + Result.Top := CaptionCell.BoundsRect.Bottom; +end; + +function TcxSchedulerReportEventCell.GetRelativeRect(const R: TRect): TRect; +begin + Result := cxRectOffset(R, FOrigin); +end; + +function TcxSchedulerReportEventCell.GetTimeLineRect(DC: HDC): TRect; +begin + Result := cxRect(0, 0, ContentBounds.Left, Height); +end; + +procedure TcxSchedulerReportEventCell.InitializeFromViewInfo( + AEventViewInfo: TcxSchedulerEventCellViewInfo); +var + R: TRect; +begin + FEventViewInfo := AEventViewInfo; + FEditViewInfo := AEventViewInfo.EditViewInfo; + R := AEventViewInfo.EventViewData.Bounds; + FOrigin := cxPointInvert(R.TopLeft); + if not (Parent is TcxSchedulerReportSchedulingAreaCell) then + OffsetRect(R, -Parent.Left, -Parent.Top); + BoundsRect := R; + CellSides := TdxCellSides(AEventViewInfo.Borders); + FIsHeaderEvent := Event.AllDayEvent or (Event.Duration > 1); + FHasDetailInfo := AEventViewInfo.IsDetailInfo; + FIsNeedCreateTimeCells := not (FIsHeaderEvent or FHasDetailInfo) and + AEventViewInfo.ShowStartTime; + FHasImages := GetHasImages; + FHasMessage := GetHasMessage and AEventViewInfo.ShowMessage; + FMessage := AEventViewInfo.Message; +end; + +procedure TcxSchedulerReportEventCell.SetViewParams(const AViewParams: TcxViewParams); +var + I, AFontIndex: Integer; +begin + inherited SetViewParams(AViewParams); + if HasImages then + begin + SpecialSymbolFont.Size := AViewParams.Font.Size; + AFontIndex := Renderer.ReportLink.AddFontToPool(SpecialSymbolFont); + for I := 0 to DataItemCount - 1 do + if DataItems[I].Data = cdidSchedulerEventIcons then + DataItems[I].FontIndex := AFontIndex; + end; +end; + +procedure TcxSchedulerReportEventCell.CheckBounds(var ABounds: TRect); +begin + cxRectIntersect(ABounds, ABounds, ContentBounds); +end; + +function TcxSchedulerReportEventCell.GetEvent: TcxSchedulerControlEvent; +begin + Result := EventViewInfo.Event; +end; + +{ TcxSchedulerReportDetailsEventCell } + +constructor TcxSchedulerReportDetailsEventCell.CreateEx(AParent: TdxReportCell; + AEvent: TcxSchedulerEvent; ADate: TDateTime; const AParams: TcxViewParams; + AContinued: Boolean = False); +begin + inherited Create(AParent); + CellSides := []; + FContinued := AContinued; + FDate := ADate; + FEvent := AEvent; + CreateDataItems; + SetViewParams(AParams); +end; + +procedure TcxSchedulerReportDetailsEventCell.CalculateLayout(AWidth, ATimeWidth: Integer); +var + DC: HDC; + ATop: Integer; +begin + FCaptionCell.BoundsRect := MakeRect(ATimeWidth, 0, AWidth, 0); + DC := GetDC(0); + try + FLineHeight := FCaptionCell.MeasureFontHeight(DC); + FStartCell.BoundsRect := MakeRect(0, 0, ATimeWidth, FLineHeight); + ATop := FCaptionCell.MeasureContentHeight(DC); + FCaptionCell.Height := ATop; + FMessageCell.BoundsRect := MakeRect(ATimeWidth, ATop, AWidth, ATop); + ATop := FMessageCell.MeasureContentHeight(DC); + FMessageCell.Height := Max(ATop, FLineHeight); + finally + ReleaseDC(0, DC); + end; +end; + +function TcxSchedulerReportDetailsEventCell.CalculateHeight: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to DataItemCount - 1 do + with DataItems[I] do + if Visible then Result := Max(Result, BoundsRect.Bottom); +end; + +procedure TcxSchedulerReportDetailsEventCell.CreateCaptionCell; +begin + FCaptionCell := CreateStringCell(GetCaptionCellText, True, + cdidSchedulerEventCaption); +end; + +procedure TcxSchedulerReportDetailsEventCell.CreateDataItems; +begin + CreateCaptionCell; + CreateTimeCell; + CreateMessageCell; +end; + +procedure TcxSchedulerReportDetailsEventCell.CreateMessageCell; +begin + FMessageCell := CreateStringCell(GetMessageCellText, True, + cdidSchedulerEventMessage); +end; + +procedure TcxSchedulerReportDetailsEventCell.CreateTimeCell; +begin + FStartCell := CreateStringCell(GetTimeCellText, False, cdidSchedulerEventStart); +end; + +function TcxSchedulerReportDetailsEventCell.GetCaptionCellText: string; +begin + Result := Event.Caption; + if Trim(Event.Location) <> '' then + Result := Result + ' -- ' + Event.Location; +end; + +function TcxSchedulerReportDetailsEventCell.GetMessageCellText: string; +begin + if Continued then + Result := cxGetResourceString(@sdxSeeAboveMessage) + else + Result := Event.Message; +end; + +function TcxSchedulerReportDetailsEventCell.GetTimeCellText: string; +begin + if Event.AllDayEvent or ((DateOf(Event.Start) < Date) and (DateOf(Event.Finish) > Date)) then + Result := cxGetResourceString(@sdxAllDayMessage) + else + Result := DateTimeHelper.TimeToStr(Max(Event.Start, Date)) + ' - ' + + DateTimeHelper.TimeToStr(Min(Event.Finish, Date + 1)); +end; + +procedure TcxSchedulerReportDetailsEventCell.SetViewParams( + const AViewParams: TcxViewParams); +var + AParams: TdxReportItemViewParams; +begin + inherited SetViewParams(AViewParams); + FillChar(AParams, SizeOf(AParams), 0); + AParams.NativeParams := AViewParams; + Include(AParams.FontStyle, fsBold); + ReportLink.SetCellViewParams(CaptionCell, AParams); + ReportLink.SetCellViewParams(StartCell, AParams); +end; + +{ TcxSchedulerReportMemoEventCell } + +procedure TcxSchedulerReportMemoEventCell.CalculateLayout(AWidth, + ATimeWidth: Integer); +var + ATop, ASpace: Integer; + DC: HDC; +begin + DC := GetDC(0); + try + FLineHeight := Renderer.CalcTextHeight(DC, 'Wg', False, Font); + ASpace := FLineHeight div 2; + ATop := FLineHeight * 2; + HeaderCell.BoundsRect := MakeRect(0, 0, AWidth, ATop); + Inc(ATop, ASpace); + CalculateLabelAndData(CaptionLabelCell, CaptionCell, DC, ATimeWidth, AWidth, ATop); + CalculateLabelAndData(LocationLabelCell, LocationCell, DC, ATimeWidth, AWidth, ATop); + if Assigned(CaptionLabelCell) or Assigned(LocationLabelCell) then Inc(ATop, ASpace); + CalculateLabelAndData(StartLabelCell, StartCell, DC, ATimeWidth, AWidth, ATop); + CalculateLabelAndData(FinishLabelCell, FinishCell, DC, ATimeWidth, AWidth, ATop); + CalculateLabelAndData(ShowTimeAsLabelCell, ShowTimeAsCell, DC, ATimeWidth, AWidth, ATop); + Inc(ATop, ASpace); + CalculateLabelAndData(RecurrenceLabelCell, RecurrenceCell, DC, ATimeWidth, AWidth, ATop); + CalculateLabelAndData(RecurrencePatternLabelCell, RecurrencePatternCell, DC, ATimeWidth, AWidth, ATop); + if Assigned(MessageCell) then + begin + Inc(ATop, ASpace); + MessageCell.BoundsRect := MakeRect(0, ATop, AWidth, ATop); + MessageCell.Height := MessageCell.MeasureContentHeight(DC); + end; + finally + ReleaseDC(0, DC); + end; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateDataItems; +begin + CreateHeader; + CreateSubject; + CreateLocation; + CreateStart; + CreateFinish; + CreateShowTimeAs; + CreateRecurrence; + CreateRecurrencePattern; + CreateMessage; +end; + +function TcxSchedulerReportMemoEventCell.GetCaptionCellText: string; +begin + Result := Event.Caption; +end; + +function TcxSchedulerReportMemoEventCell.GetMessageCellText: string; +begin + Result := Event.Message; +end; + +function TcxSchedulerReportMemoEventCell.GetTimeCellText: string; +begin + Result := FormatDateTime('ddd ddddd t', Event.Start); +end; + +procedure TcxSchedulerReportMemoEventCell.SetViewParams( + const AViewParams: TcxViewParams); +var + AParams: TdxReportItemViewParams; +begin + ReportLink.SetCellViewParams(Self, AViewParams); + ReportLink.SetCellViewParams(CaptionCell, AViewParams); + ReportLink.SetCellViewParams(LocationCell, AViewParams); + ReportLink.SetCellViewParams(StartCell, AViewParams); + ReportLink.SetCellViewParams(FinishCell, AViewParams); + ReportLink.SetCellViewParams(ShowTimeAsCell, AViewParams); + ReportLink.SetCellViewParams(RecurrenceCell, AViewParams); + ReportLink.SetCellViewParams(RecurrencePatternCell, AViewParams); + ReportLink.SetCellViewParams(MessageCell, AViewParams); + + FillChar(AParams, SizeOf(AParams), 0); + AParams.NativeParams := AViewParams; + Include(AParams.FontStyle, fsBold); + ReportLink.SetCellViewParams(CaptionLabelCell, AParams); + ReportLink.SetCellViewParams(LocationLabelCell, AParams); + ReportLink.SetCellViewParams(StartLabelCell, AParams); + ReportLink.SetCellViewParams(FinishLabelCell, AParams); + ReportLink.SetCellViewParams(ShowTimeAsLabelCell, AParams); + ReportLink.SetCellViewParams(RecurrenceLabelCell, AParams); + ReportLink.SetCellViewParams(RecurrencePatternLabelCell, AParams); + + AParams.FontSize := MulDiv(AViewParams.Font.Size, 3, 2); + ReportLink.SetCellViewParams(HeaderCell, AParams); +end; + +procedure TcxSchedulerReportMemoEventCell.CalculateLabelAndData( + ALabelCell, ADataCell: TAbstractdxReportCellData; DC: HDC; + ATimeWidth, AWidth: Integer; var ATop: Integer); +begin + if Assigned(ALabelCell) then + begin + ALabelCell.BoundsRect := MakeBounds(0, ATop, ATimeWidth, FLineHeight); + ADataCell.BoundsRect := MakeRect(ATimeWidth, ATop, AWidth, ATop); + ADataCell.Height := ADataCell.MeasureContentHeight(DC); + Inc(ATop, Max(ADataCell.Height, FLineHeight)); + end; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateHeader; +begin + FHeaderCell := CreateStringCell(GetHeaderCellText); + FHeaderCell.BorderClass := TdxPSCellBoldFlatBorder; + FHeaderCell.CellSides := [csBottom]; + FHeaderCell.TextAlignY := taBottom; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateFinish; +begin + CreateFinishLabelCell; + CreateFinishCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateFinishCell; +begin + FFinishCell := CreateStringCell(FormatDateTime('ddd ddddd t', Event.Finish)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateFinishLabelCell; +begin + FFinishLabelCell := CreateStringCell( + cxGetResourceString(@sdxFinishLabelCaption)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateLocation; +begin + if Event.Location = '' then Exit; + CreateLocationLabelCell; + CreateLocationCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateLocationCell; +begin + FLocationCell := CreateStringCell(Event.Location); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateLocationLabelCell; +begin + FLocationLabelCell := CreateStringCell( + cxGetResourceString(@sdxLocationLabelCaption)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateMessage; +begin + if GetMessageCellText = '' then Exit; + CreateMessageCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateRecurrence; +begin + CreateRecurrenceLabelCell; + CreateRecurrenceCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateRecurrenceCell; +begin + FRecurrenceCell := CreateStringCell(GetRecurrenceCellText); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateRecurrenceLabelCell; +begin + FRecurrenceLabelCell := CreateStringCell( + cxGetResourceString(@sdxRecurrenceLabelCaption)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateRecurrencePattern; +begin + if not Event.IsRecurring then Exit; + CreateRecurrencePatternLabelCell; + CreateRecurrencePatternCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateRecurrencePatternCell; +begin + FRecurrencePatternCell := CreateStringCell(GetRecurrencePatternCellText); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateRecurrencePatternLabelCell; +begin + FRecurrencePatternLabelCell := CreateStringCell( + cxGetResourceString(@sdxRecurrencePatternLabelCaption)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateShowTimeAs; +begin + if GetShowTimeAsCellText = '' then Exit; + CreateShowTimeAsLabelCell; + CreateShowTimeAsCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateShowTimeAsCell; +begin + FShowTimeAsCell := CreateStringCell(GetShowTimeAsCellText); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateShowTimeAsLabelCell; +begin + FShowTimeAsLabelCell := CreateStringCell( + cxGetResourceString(@sdxShowTimeAsLabelCaption)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateStart; +begin + CreateStartLabelCell; + CreateTimeCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateStartLabelCell; +begin + FStartLabelCell := CreateStringCell( + cxGetResourceString(@sdxStartLabelCaption)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateSubject; +begin + if GetCaptionCellText = '' then Exit; + CreateSubjectLabelCell; + CreateCaptionCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateSubjectLabelCell; +begin + FCaptionLabelCell := CreateStringCell( + cxGetResourceString(@sdxSubjectLabelCaption)); +end; + +function TcxSchedulerReportMemoEventCell.GetHeaderCellText: string; +var + AResource: TcxSchedulerStorageResourceItem; +begin + AResource := Event.GetResourceItem; + if AResource <> nil then + Result := AResource.Name + else + Result := dxPSUtl.GetUserName; +end; + +function TcxSchedulerReportMemoEventCell.GetRecurrenceCellText: string; +begin + if Event.IsRecurring then + case Event.RecurrenceInfo.Recurrence of + cxreDaily: + Result := cxGetResourceString(@scxRecurrenceDailyMessage); + cxreWeekly: + Result := cxGetResourceString(@scxRecurrenceWeeklyMessage); + cxreMonthly: + Result := cxGetResourceString(@scxRecurrenceMonthlyMessage); + cxreYearly: + Result := cxGetResourceString(@scxRecurrenceYearlyMessage); + else + Result := ''; + end + else + Result := cxGetResourceString(@sdxRecurrenceNoneMessage); +end; + +function TcxSchedulerReportMemoEventCell.GetRecurrencePatternCellText: string; +begin + if Event.IsRecurring and Assigned(cxGetRecurrenceDescriptionStringProc) then + Result := cxGetRecurrenceDescriptionStringProc(Event.RecurrenceInfo) + else + Result := ''; +end; + +function TcxSchedulerReportMemoEventCell.GetShowTimeAsCellText: string; +begin + case Event.State of + tlsFree: + Result := cxGetResourceString(@sdxShowTimeAsFreeMessage); + tlsTentative: + Result := cxGetResourceString(@sdxShowTimeAsTentativeMessage); + tlsOutOfOffice: + Result := cxGetResourceString(@sdxShowTimeAsOutOfOfficeMessage); + else + Result := ''; + end; +end; + +{ TcxSchedulerReportGanttLinkCell } + +constructor TcxSchedulerReportGanttLinkCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); +var + R: TRect; + I: Integer; + ALinkInfo: TcxSchedulerGanttViewLinkViewInfo; +begin + inherited CreateFrom(AParent, AViewInfo); + if AViewInfo is TcxSchedulerGanttViewLinkViewInfo then + begin + ALinkInfo := TcxSchedulerGanttViewLinkViewInfo(AViewInfo); + BorderColor := ColorToRgb(ALinkInfo.Color); + AssignInfo(ALinkInfo.Lines, ALinkInfo.ArrowDirection, ALinkInfo.ArrowRect); + R := ArrowRect; + for I := 0 to Length(Lines) - 1 do + R := cxRectUnion(R, Lines[I]); + BoundsRect := R; + end; + Index := 0; +end; + +procedure TcxSchedulerReportGanttLinkCell.Assign(Source: TPersistent); +var + ACell: TcxSchedulerReportGanttLinkCell; +begin + if Source is TcxSchedulerReportGanttLinkCell then + begin + ACell := TcxSchedulerReportGanttLinkCell(Source); + AssignInfo(ACell.Lines, ACell.ArrowDirection, ACell.ArrowRect); + end; + inherited Assign(Source); +end; + +procedure TcxSchedulerReportGanttLinkCell.DrawArrow( + DC: HDC; const ABounds: TRect); +var + ARgn: HRGN; + APoints: TcxArrowPoints; +begin + case ArrowDirection of + adUp: + begin + APoints[0] := Point((ABounds.Right + ABounds.Left) div 2, ABounds.Top); + APoints[1] := Point(ABounds.Left, ABounds.Bottom); + APoints[2] := Point(ABounds.Right, ABounds.Bottom); + end; + adDown: + begin + APoints[0] := Point(ABounds.Right, ABounds.Top); + APoints[1] := Point((ABounds.Right + ABounds.Left) div 2, ABounds.Bottom); + APoints[2] := Point(ABounds.Left, ABounds.Top); + end; + adLeft: + begin + APoints[0] := Point(ABounds.Left, (ABounds.Top + ABounds.Bottom) div 2); + APoints[1] := Point(ABounds.Right, ABounds.Top); + APoints[2] := Point(ABounds.Right, ABounds.Bottom); + end; + adRight: + begin + APoints[0] := Point(ABounds.Right, (ABounds.Top + ABounds.Bottom) div 2); + APoints[1] := Point(ABounds.Left, ABounds.Top); + APoints[2] := Point(ABounds.Left, ABounds.Bottom); + end; + end; + ARgn := CreatePolygonRgn(APoints, 3, ALTERNATE); + Renderer.FillRgn(DC, ARgn, BorderColor); + DeleteObject(ARgn); +end; + +procedure TcxSchedulerReportGanttLinkCell.DrawContent( + DC: HDC; AStage: TdxPSRenderStages); +var + R: TRect; + I: Integer; +begin + for I := 0 to Length(FLines) - 1 do + begin + R := GetFixupRect(DC, FLines[I]); + if cxRectWidth(R) > cxRectHeight(R) then + R := cxRectSetHeight(R, Renderer.LineThickness) + else + R := cxRectSetWidth(R, Renderer.LineThickness); + Renderer.FillRect(DC, R, BorderColor); + end; + DrawArrow(DC, ArrowRect); +end; + +class function TcxSchedulerReportGanttLinkCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerGanttViewLinkViewInfo; +end; + +procedure TcxSchedulerReportGanttLinkCell.AssignInfo( + const ALines: TcxSchedulerGanttViewLinkLines; + AArrowDirection: TcxArrowDirection; const AArrowRect: TRect); +begin + FArrowDirection := AArrowDirection; + FArrowRect := AArrowRect; + SetLength(Self.FLines, Length(ALines)); + Move(ALines[0], FLines[0], SizeOf(TRect) * Length(ALines)); +end; + +procedure TcxSchedulerReportGanttLinkCell.ConvertCoords( + APixelsNumerator, APixelsDenominator: Integer); +var + I: Integer; +begin + inherited ConvertCoords(APixelsNumerator, APixelsDenominator); + for I := 0 to Length(FLines) - 1 do + ConvertRect(FLines[I], APixelsNumerator, APixelsDenominator); + ConvertRect(FArrowRect, APixelsNumerator, APixelsDenominator); +end; + +procedure TcxSchedulerReportGanttLinkCell.ReadData(AReader: TdxPSDataReader); +var + I: Integer; +begin + inherited ReadData(AReader); + FArrowDirection := TcxArrowDirection(AReader.ReadInteger); + FArrowRect := AReader.ReadRect; + SetLength(FLines, AReader.ReadInteger); + for I := 0 to Length(FLines) - 1 do + FLines[I] := AReader.ReadRect; +end; + +procedure TcxSchedulerReportGanttLinkCell.WriteData(AWriter: TdxPSDataWriter); +var + I: Integer; +begin + inherited WriteData(AWriter); + AWriter.WriteInteger(Integer(ArrowDirection)); + AWriter.WriteRect(FArrowRect); + AWriter.WriteInteger(Length(FLines)); + for I := 0 to Length(FLines) - 1 do + AWriter.WriteRect(FLines[I]); +end; + +{ TcxSchedulerReportCommonCellsProducer } + +constructor TcxSchedulerReportCommonCellsProducer.CreateEx( + AStyle: TcxCustomSchedulerReportLinkPrintStyle; + ASite: TcxSchedulerReportSchedulingAreaCell); +begin + inherited Create(AStyle.GetCorrespondedView); + FStyle := AStyle; + FSite := ASite; +end; + +procedure TcxSchedulerReportCommonCellsProducer.GetPageResources( + AResources: TcxObjectList); +var + ResPerPage, APageIndex, I, J: Integer; +begin + ResPerPage := Style.ResourceCountPerPage; + if Resources = nil then Exit; + if (ResPerPage <= 0) or (ResPerPage >= Resources.VisibleResourceCount) then + begin + for I := 0 to Resources.VisibleResourceCount - 1 do + begin + AResources.Add(TcxSchedulerResourceViewInfo.Create( + Resources.VisibleResources[I])); + end; + Exit; + end; + APageIndex := (Site.PageIndex div PagesPerWeek) mod Style.GetResourcePageCount; + I := ResPerPage * APageIndex; + J := Min(ResPerPage * (APageIndex + 1), Resources.VisibleResourceCount); + while I < J do + begin + AResources.Add(TcxSchedulerResourceViewInfo.Create( + Resources.VisibleResources[I])); + I := I + 1; + end; +end; + +procedure TcxSchedulerReportCommonCellsProducer.Produce; +begin + Calculate; +end; + +procedure TcxSchedulerReportCommonCellsProducer.AfterCalculatePage; +var + I, J: Integer; + ASubList: TcxSchedulerViewInfoCellList; + AItem: TcxSchedulerCustomViewInfoItem; + AReportItemClass: TcxSchedulerReportCustomCellClass; + AEventCell: TcxSchedulerReportEventCell; +begin + for I := 0 to Cells.Count - 1 do + begin + ASubList := TcxSchedulerViewInfoCellList(Cells[I]); + for J := 0 to ASubList.Count - 1 do + begin + AItem := ASubList[J]; + if AItem.Visible then + begin + if AItem is TcxSchedulerEventCellViewInfo then + begin + AEventCell := CreateEventCell(TcxSchedulerEventCellViewInfo(AItem)); + Style.ReportLink.DoInitializeEventCell(AEventCell); + end + else + if FindMirorClassForItem(AItem, AReportItemClass) then + ConvertSchedulerCellToPSCells(AItem, AReportItemClass); + end; + end; + end; +end; + +function TcxSchedulerReportCommonCellsProducer.CanCalculate: Boolean; +begin + Result := True; +end; + +function TcxSchedulerReportCommonCellsProducer.CreateEventCell( + AEventViewInfo: TcxSchedulerEventCellViewInfo): TcxSchedulerReportEventCell; +begin + Result := TcxSchedulerReportEventCell.CreateFrom(Site, AEventViewInfo); +end; + +procedure TcxSchedulerReportCommonCellsProducer.ConvertSchedulerCellToPSCells( + AItem: TcxSchedulerCustomViewInfoItem; + AReportItemClass: TcxSchedulerReportCustomCellClass); +var + APSItem: TcxSchedulerReportCustomCell; +begin + APSItem := AReportItemClass.CreateFrom(FSite, AItem); + SetCellViewParams(APSItem, AItem.ViewParams); +end; + +procedure TcxSchedulerReportCommonCellsProducer.DoInitialize( + var ASelectedDays: TcxSchedulerDateList; var AEvents: TcxSchedulerCachedEventList); +begin + ASelectedDays := Site.VisibleDays; + AEvents := Style.Events; +end; + +function TcxSchedulerReportCommonCellsProducer.GetCompressWeekends: Boolean; +begin + Result := Style.CompressWeekends; +end; + +function TcxSchedulerReportCommonCellsProducer.GetDontPrintWeekEnds: Boolean; +begin + Result := Style.DontPrintWeekends; +end; + +function TcxSchedulerReportCommonCellsProducer.GetHideSelection: Boolean; +begin + Result := True; +end; + +function TcxSchedulerReportCommonCellsProducer.GetIsPrinting: Boolean; +begin + Result := True; +end; + +function TcxSchedulerReportCommonCellsProducer.GetPageBounds: TRect; +begin + Result := Site.GetInnerBounds(0); +end; + +function TcxSchedulerReportCommonCellsProducer.GetPagesPerWeek: Byte; +begin + Result := Integer(Style.Layout) + 1; +end; + +function TcxSchedulerReportCommonCellsProducer.GetPrintExactlyOneMonth: Boolean; +begin + Result := (Style is TcxSchedulerReportLinkMonthlyPrintStyle) and + TcxSchedulerReportLinkMonthlyPrintStyle(Style).PrintExactlyOneMonthPerPage; +end; + +function TcxSchedulerReportCommonCellsProducer.GetPrintRange( + Index: Integer): TDateTime; +begin + if Index = 0 then + Result := Style.TimePrintFrom + else + Result := Style.TimePrintTo; +end; + +function TcxSchedulerReportCommonCellsProducer.GetPrimaryPage: Boolean; +begin + Result := Site.PrimaryPage; +end; + +function TcxSchedulerReportCommonCellsProducer.GetStylesAdapter: IcxSchedulerStylesAdapter; +begin + Result := Styles; +end; + +procedure TcxSchedulerReportCommonCellsProducer.SetCellViewParams( + ACell: TdxReportVisualItem; const AParams: TcxViewParams); +begin + Site.SetCellViewParams(ACell, AParams); + if Style.ReportLink.OptionsFormatting.SuppressContentColoration then + if ACell is TcxSchedulerReportCustomCell then + TcxSchedulerReportCustomCell(ACell).SuppressColoration; +end; + +function TcxSchedulerReportCommonCellsProducer.GetStyles: TcxSchedulerReportLinkStyles; +begin + Result := Style.VisualStyles; +end; + +{ TcxSchedulerReportDailyCellsProducer } + +procedure TcxSchedulerReportDailyCellsProducer.AfterCalculatePage; +begin + FRulerSite := CreateTimeRulerSite; + SetCellViewParams(FRulerSite, Styles.GetTimeRulerParams); +{ FRulerSite.Transparent := + Style.ReportLink.OptionsFormatting.SuppressContentColoration;} + inherited AfterCalculatePage; +end; + +procedure TcxSchedulerReportDailyCellsProducer.BeforeCalculatePage; +begin + Site.CellSides := csAll; + inherited BeforeCalculatePage; +end; + +procedure TcxSchedulerReportDailyCellsProducer.ConvertSchedulerCellToPSCells( + AItem: TcxSchedulerCustomViewInfoItem; + AReportItemClass: TcxSchedulerReportCustomCellClass); +begin + if AReportItemClass = TcxSchedulerReportDailyTimeRulerCell then + SetCellViewParams(AReportItemClass.CreateFrom(FRulerSite, AItem), AItem.ViewParams) + else + inherited ConvertSchedulerCellToPSCells(AItem, AReportItemClass); +end; + +function TcxSchedulerReportDailyCellsProducer.CreateTimeRulerSite: TcxSchedulerReportDailyTimeRulerCellsSite; +begin + Result := TcxSchedulerReportDailyTimeRulerCellsSite.Create(FSite); + Result.Transparent := True; + Result.ClipChildren := True; +end; + +{ TcxSchedulerReportYearlyCellsProducer } + +procedure TcxSchedulerReportYearlyCellsProducer.Produce; +var + AIndex: Integer; +begin + AIndex := Site.PageIndex; + if Style.MonthCountPerPage <> 12 then + begin + AIndex := AIndex div (Byte(Style.Layout) + 1); + FFirstMonth := (AIndex * Style.MonthCountPerPage) mod 12 + 1 + end + else + FFirstMonth := 1; + inherited Produce; +end; + +function TcxSchedulerReportYearlyCellsProducer.GetDayCountPerPage: Integer; +begin + Result := MaxYearViewWeekDays; + if Style.Layout = pslTwoPages then + begin + if IsPrimaryPage then + Result := cxYearStyleDaysOnPrimaryPage + else + Result := Result - cxYearStyleDaysOnPrimaryPage; + end; +end; + +function TcxSchedulerReportYearlyCellsProducer.GetMonthCount: Integer; +begin + Result := Style.MonthCountPerPage; +end; + +function TcxSchedulerReportYearlyCellsProducer.GetFirstMonth: Integer; +begin + Result := FFirstMonth; +end; + +function TcxSchedulerReportYearlyCellsProducer.GetShowMonthHeaders: Boolean; +const + Dividers: array[TcxSchedulerReportLinkPeriodicPrintStyleLayout] of Integer = (1, 2); +begin + Result := not Style.PrimaryPageHeadersOnly or + (Site.PageIndex mod Style.PeriodPageCount mod Dividers[Style.Layout] = 0); +end; + +function TcxSchedulerReportYearlyCellsProducer.GetShowWeekDayHeaders: Boolean; +const + Indexes: array[TcxSchedulerReportLinkPeriodicPrintStyleLayout] of Integer = (0, 1); +begin + Result := not Style.PrimaryPageHeadersOnly or + (Site.PageIndex mod Style.PeriodPageCount <= Indexes[Style.Layout]) +end; + +function TcxSchedulerReportYearlyCellsProducer.GetStartDayIndex: Integer; +begin + Result := 0; + if (Style.Layout = pslTwoPages) and not IsPrimaryPage then + Result := cxYearStyleDaysOnPrimaryPage +end; + +function TcxSchedulerReportYearlyCellsProducer.GetIsPrimaryPage: Boolean; +begin + Result := Site.PageIndex mod 2 = 0; +end; + +function TcxSchedulerReportYearlyCellsProducer.GetStyle: TcxSchedulerReportLinkYearlyPrintStyle; +begin + Result := TcxSchedulerReportLinkYearlyPrintStyle(inherited Style); +end; + +{ TcxTimeLinePageInfo } + +constructor TcxTimeLinePageInfo.Create; +begin + PageResources := TList.Create; +end; + +destructor TcxTimeLinePageInfo.Destroy; +begin + PageResources.Free; + inherited Destroy; +end; + +{ TcxSchedulerReportTimeLineLayoutBuilder } + +constructor TcxSchedulerReportTimeLineLayoutBuilder.CreateEx( + AStyle: TcxSchedulerReportLinkTimeLinePrintStyle); +begin + inherited Create(AStyle.GetCorrespondedView); + FPagesInfo := TcxObjectList.Create; + FStyle := AStyle; +end; + +destructor TcxSchedulerReportTimeLineLayoutBuilder.Destroy; +begin + FreeAndNil(FPagesInfo); + inherited Destroy; +end; + +procedure TcxSchedulerReportTimeLineLayoutBuilder.CalculateLayout; +begin + FColCount := 0; + FRowCount := 0; + FPagesInfo.Clear; + View := Style.CorrespondedView; + CalculateTimeRanges; + Calculate; + CalculatePagination; +end; + +procedure TcxSchedulerReportTimeLineLayoutBuilder.GetPageResources( + AResources: TcxObjectList); +var + I: Integer; +begin + AResources.Clear; + if Style.ResourceCountPerPage = 0 then Exit; + for I := 0 to Resources.VisibleResourceCount - 1 do + AResources.Add(TcxSchedulerResourceViewInfo.Create(Resources.VisibleResources[I])); +end; + +function TcxSchedulerReportTimeLineLayoutBuilder.AddPageInfo( + ARow, AColumn: Integer; const AStart, AFinish: TDateTime): TcxTimeLinePageInfo; +begin + Result := TcxTimeLinePageInfo.Create; + FCurrentPageIndex := FPagesInfo.Add(Result); + Result.PageBounds := cxRectOffset(GetPageBounds, 0, FCurrentPageIndex * Style.PageHeight); + Result.Headers := not Style.PrimaryPageHeadersOnly or (AColumn = 0); + Result.Scales := not Style.PrimaryPageScalesOnly or (ARow = 0); + Result.ContentBounds := GetPageContentBounds(ARow, AColumn); + Result.Start := AStart; + Result.Finish := AFinish; +end; + +procedure TcxSchedulerReportTimeLineLayoutBuilder.AddRow( + AStartIndex, AFinishIndex, AStartLine: Integer); +var + ACol, I: Integer; + AInfo: TcxTimeLinePageInfo; +begin + for ACol := 0 to ColCount - 1 do + begin + AInfo := PageInfo[ACol]; + if RowCount <> 0 then + AInfo := AddPageInfo(FRowCount, ACol, AInfo.Start, AInfo.Finish); + for I := AStartIndex to AFinishIndex do + begin + if I < Resources.VisibleResourceCount then + AInfo.PageResources.Add(Resources.VisibleResources[I]); + AInfo.LineStart := AStartLine; + end; + end; + Inc(FRowCount); +end; + +procedure TcxSchedulerReportTimeLineLayoutBuilder.AfterCalculatePage; +begin + inherited AfterCalculatePage; +end; + +procedure TcxSchedulerReportTimeLineLayoutBuilder.CalculatePagination; + + procedure PrepareIndexes(var AStart, AFinish: Integer; APageLineCount: Integer); + var + I, AMaxCount: Integer; + begin + while AStart <> AFinish do + begin + AMaxCount := 0; + for I := AStart to AFinish do + AMaxCount := Max(AMaxCount, ViewInfo.GroupLineCount[I]); + if AMaxCount * (AFinish - AStart + 1) > APageLineCount then + Dec(AFinish) + else + Break; + end; + end; + +var + AStartGroup, AFinishGroup, ATotalCount, AResPerPage: Integer; +begin + AStartGroup := 0; + AResPerPage := Style.ResourceCountPerPage; + if AResPerPage = 0 then + AResPerPage := ViewInfo.GroupCount; + while AStartGroup < ViewInfo.GroupCount do + begin + AFinishGroup := Min(ViewInfo.GroupCount - 1, AStartGroup + AResPerPage - 1); + ATotalCount := GetPageLineCount(RowCount); + PrepareIndexes(AStartGroup, AFinishGroup, GetPageLineCount(RowCount)); + if (AStartGroup = AFinishGroup) and (ViewInfo.GroupLineCount[AStartGroup] > ATotalCount) then + begin + ATotalCount := 0; + while ATotalCount < ViewInfo.GroupLineCount[AStartGroup] do + begin + AddRow(AStartGroup, AStartGroup, ATotalCount); + Inc(ATotalCount, GetPageLineCount(RowCount - 1)); + end; + end + else + AddRow(AStartGroup, AFinishGroup, 0); + AStartGroup := AFinishGroup + 1; + end; +end; + +procedure TcxSchedulerReportTimeLineLayoutBuilder.CalculateTimeRanges; +var + AStart, ARangeStart, AFinish: TDateTime; + ATimeBuilder: TcxSchedulerTimeBuilder; + AFullWidth, APageWidth, AColWidth: Integer; +begin + AStart := Style.PrintFrom; + ATimeBuilder := TcxSchedulerTimeBuilder.Create; + try + ATimeBuilder.Initialize(Style.GetCorrespondedView as TcxSchedulertimeGridView, + Style.WorkTimeOnly, Style.DontPrintWeekends); + ATimeBuilder.ValidateVisibleStart(AStart); + AColWidth := ViewInfo.ColumnWidth; + ARangeStart := AStart; + AFullWidth := 0; + APageWidth := cxRectWidth(GetPageContentBounds(0, PageCount)); + repeat + AFinish := ATimeBuilder.Inc(AStart); + Inc(AFullWidth, AColWidth); + if AFullWidth > APageWidth then + begin + AddPageInfo(0, PageCount, ARangeStart, AStart); + ARangeStart := AStart; + AFullWidth := AColWidth; + APageWidth := cxRectWidth(GetPageContentBounds(0, PageCount)); + end; + AStart := AFinish; + until AFinish >= Style.PrintTo; + if (AFullWidth > 0) or (PageCount = 0) then + AddPageInfo(0, PageCount, ARangeStart, AFinish); + finally + ATimeBuilder.Free; + FColCount := FPagesInfo.Count; + end; +end; + +function TcxSchedulerReportTimeLineLayoutBuilder.CanCalculate: Boolean; +begin + Result := True; +end; + +function TcxSchedulerReportTimeLineLayoutBuilder.GetActualStart: TDateTime; +begin + Result := PageInfo[0].Start; +end; + +function TcxSchedulerReportTimeLineLayoutBuilder.GetActualFinish: TDateTime; +begin + Result := PageInfo[PageCount - 1].Finish; +end; + +function TcxSchedulerReportTimeLineLayoutBuilder.GetDontPrintWeekEnds: Boolean; +begin + Result := Style.DontPrintWeekends and Style.CanDontPrintWeekends; +end; + +function TcxSchedulerReportTimeLineLayoutBuilder.GetHideSelection: Boolean; +begin + Result := True; +end; + +function TcxSchedulerReportTimeLineLayoutBuilder.GetIsPrinting: Boolean; +begin + Result := True; +end; + +function TcxSchedulerReportTimeLineLayoutBuilder.GetPageBounds: TRect; +begin + Result := Rect(0, 0, Style.PageWidth[FCurrentPageIndex], Style.PageHeight); +end; + +function TcxSchedulerReportTimeLineLayoutBuilder.GetPageContentBounds( + ARow, AColumn: Integer): TRect; +begin + Result := Rect(0, 0, Style.PageWidth[AColumn], Style.PageHeight); + if not Style.PrimaryPageScalesOnly or (ARow = 0) then + begin + Result.Top := Min(Result.Bottom - 1, Result.Top + ViewInfo.ScalesHeight); + end; + if not Style.PrimaryPageHeadersOnly or (AColumn = 0) then + begin + Result.Left := Min(Result.Bottom - 1, Result.Left + ViewInfo.ResourceHeaderWidth); + end; +end; + +function TcxSchedulerReportTimeLineLayoutBuilder.GetPageLineCount( + ARow: Integer): Integer; +begin + Result := Max(1, cxRectHeight(GetPageContentBounds(ARow, 0)) div + (ViewInfo.ContentLineHeight + ViewInfo.IndentBetweenLines)); +end; + +function TcxSchedulerReportTimeLineLayoutBuilder.GetPrintRange(Index: Integer): TDateTime; +begin + Result := 0; //todo: +end; + +function TcxSchedulerReportTimeLineLayoutBuilder.GetStylesAdapter: IcxSchedulerStylesAdapter; +begin + Result := Style.VisualStyles; +end; + +function TcxSchedulerReportTimeLineLayoutBuilder.GetPageCount: Integer; +begin + Result := FPagesInfo.Count; +end; + +function TcxSchedulerReportTimeLineLayoutBuilder.GetPageInfo( + Index: Integer): TcxTimeLinePageInfo; +begin + Result := TcxTimeLinePageInfo(FPagesInfo[Index]); +end; + +function TcxSchedulerReportTimeLineLayoutBuilder.GetViewInfo: TcxSchedulerTimeGridViewViewInfo; +begin + Result := TcxSchedulerTimeGridViewAccess(View).ViewInfo; +end; + +{ TcxSchedulerReportTimeLineCellsProducer } + +procedure TcxSchedulerReportTimeLineCellsProducer.GetPageResources( + AResources: TcxObjectList); +var + I: Integer; +begin + AResources.Clear; + if Resources = nil then Exit; + for I := 0 to PageInfo.PageResources.Count - 1 do + AResources.Add(TcxSchedulerResourceViewInfo.Create(PageInfo.PageResources[I])); +end; + +function TcxSchedulerReportTimeLineCellsProducer.CreateEventCell( + AEventViewInfo: TcxSchedulerEventCellViewInfo): TcxSchedulerReportEventCell; +var + R: TRect; + AHost: TdxReportCell; +begin + AHost := TdxReportCell.Create(Site); + R := AEventViewInfo.ClipRect; + if R.Left <> AEventViewInfo.Bounds.Left then + OffsetRect(R, 1, 0); + AHost.BoundsRect := R; + AHost.Transparent := True; + AHost.CellSides := []; + AHost.ClipChildren := True; + Result := TcxSchedulerReportEventCell.CreateFrom(AHost, AEventViewInfo); +end; + +function TcxSchedulerReportTimeLineCellsProducer.GetActualStart: TDateTime; +begin + Result := Style.LayoutBuilder.ActualStart; +end; + +function TcxSchedulerReportTimeLineCellsProducer.GetActualFinish: TDateTime; +begin + Result := Style.LayoutBuilder.ActualFinish; +end; + +function TcxSchedulerReportTimeLineCellsProducer.GetLineOffset: Integer; +begin + Result := PageInfo.LineStart; +end; + +function TcxSchedulerReportTimeLineCellsProducer.GetPrintRange( + Index: Integer): TDateTime; +begin + if Index = 0 then + Result := PageInfo.Start + else + Result := PageInfo.Finish; +end; + +function TcxSchedulerReportTimeLineCellsProducer.GetShowLinks: Boolean; +begin + Result := Style.ShowLinks; +end; + +function TcxSchedulerReportTimeLineCellsProducer.GetShowResourceHeaders: Boolean; +begin + Result := PageInfo.Headers; +end; + +function TcxSchedulerReportTimeLineCellsProducer.GetShowScales: Boolean; +begin + Result := PageInfo.Scales; +end; + +function TcxSchedulerReportTimeLineCellsProducer.GetWorkDaysOnly: Boolean; +begin + Result := Style.DontPrintWeekends; +end; + +function TcxSchedulerReportTimeLineCellsProducer.GetWorkTimeOnly: Boolean; +begin + Result := Style.WorkTimeOnly; +end; + +function TcxSchedulerReportTimeLineCellsProducer.GetPageIndex: Integer; +begin + Result := Site.PageSite.PageIndex; +end; + +function TcxSchedulerReportTimeLineCellsProducer.GetPageInfo: TcxTimeLinePageInfo; +begin + Result := Style.LayoutBuilder.PageInfo[PageIndex]; +end; + +function TcxSchedulerReportTimeLineCellsProducer.GetStyle: TcxSchedulerReportLinkTimeLinePrintStyle; +begin + Result := TcxSchedulerReportLinkTimeLinePrintStyle(inherited Style); +end; + +// registration unit part + +procedure RegisterMirrorClasses; +begin + MirrorClasses := TList.Create; + TcxSchedulerReportContentCell.RegisterMirrorClass; + TcxSchedulerReportHeaderItemCell.RegisterMirrorClass; + TcxSchedulerReportGroupSeparatorCell.RegisterMirrorClass; + TcxSchedulerReportContainerCell.RegisterMirrorClass; + TcxSchedulerReportDailyTimeRulerCell.RegisterMirrorClass; +// TcxSchedulerReportEventCell.RegisterMirrorClass; + TcxSchedulerReportMonthDayCell.RegisterMirrorClass; + TcxSchedulerReportBackgroundSlotCell.RegisterMirrorClass; + TcxSchedulerReportGanttLinkCell.RegisterMirrorClass; + // + TcxSchedulerReportTimeLineMajorScaleCell.RegisterMirrorClass; + TcxSchedulerReportTimeLineMinorScaleCell.RegisterMirrorClass; +end; + +procedure UnRegisterMirrorClasses; +begin + MirrorClasses.Free; +end; + +function GetFontFolder : string; +var + APIDL: PItemIDList; + APath: array[0..MAX_PATH] of Char; + AMalloc: IMalloc; +begin + Result := ''; + if ShGetSpecialFolderLocation(Application.Handle, CSIDL_FONTS, APIDL) = S_OK then + begin + if ShGetPathFromIDList(APIDL, APath) then + Result := APath; + if Succeeded(SHGetMalloc(AMalloc)) then + AMalloc.Free(APIDL); + end; +end; + +procedure RegisterReportLinkClasses; +begin + RegisterClasses([TcxSchedulerReportLinkStyles]); + + TcxSchedulerReportSchedulingAreaCell.Register; + TcxSchedulerReportNotesAreaCell.Register; + TcxSchedulerReportTaskPadCell.Register; + TcxSchedulerReportSchedulerHeaderCell.Register; + TcxSchedulerReportSchedulerHeaderDataCell.Register; + + //datenavigator + TcxSchedulerReportDateNavigatorCell.Register; + TcxSchedulerReportDateNavigatorHeader.Register; + TcxSchedulerReportDateNavigatorDay.Register; + TcxSchedulerReportDateNavigatorDayCaption.Register; + TcxSchedulerReportDateNavigatorWeekNumber.Register; + + //scheduling area items + TcxSchedulerReportContentCell.Register; + TcxSchedulerReportHeaderItemCell.Register; + TcxSchedulerReportGroupSeparatorCell.Register; + TcxSchedulerReportContainerCell.Register; + TcxSchedulerReportBackgroundSlotCell.Register; + TcxSchedulerReportDailyTimeRulerCellsSite.Register; + TcxSchedulerReportDailyTimeRulerCell.Register; + TcxSchedulerReportMonthDayCell.Register; + + TcxSchedulerReportCellString.Register; + TcxSchedulerReportEventCell.Register; + TcxSchedulerReportDetailsEventCell.Register; + TcxSchedulerReportMemoEventCell.Register; + + TcxSchedulerReportTimeLineCell.Register; + TcxSchedulerReportTimeLinePart.Register; + + TcxSchedulerReportTimeLineMajorScaleCell.Register; + TcxSchedulerReportTimeLineMinorScaleCell.Register; + + TcxSchedulerReportGanttLinkCell.Register; + + TcxSchedulerReportPageSite.Register; + + dxPSRegisterReportLink(TcxSchedulerReportLink, + TcxScheduler, TcxfmSchedulerReportLinkDesignWindow); +end; + +type + TAddFontMemResource = function (p1: Pointer; p2: DWORD; p3: PDesignVector; p4: LPDWORD): THandle; stdcall; + TRemoveFontMemResource = function (p1: THandle): BOOL; stdcall; + +var + GDI32Lib: HMODULE; + AddFontMemResource: TAddFontMemResource; + RemoveFontMemResource: TRemoveFontMemResource; + +procedure InitializeSchedulerLink; + + function LoadImagesFromResource(AWidth, AHeight: Integer; + const AResourceName: string): TImageList; + begin + Result := TImageList.Create(nil); + Result.Width := AWidth; + Result.Height := AHeight; + Result.Handle := ImageList_LoadImage(HInstance, PAnsiChar(AResourceName), AWidth, + AHeight, CLR_DEFAULT, IMAGE_BITMAP, LR_DEFAULTCOLOR); + end; + +var + Res : TResourceStream; + Count: DWORD; +begin + RegisterMirrorClasses; + // images loading + StyleImages := LoadImagesFromResource(58, 31, IDB_DXPSSCHEDULER_SMALLDESIGNPREVIEW); + StylePreviewImages := LoadImagesFromResource(128, 76, IDB_DXPSSCHEDULER_STYLEDESIGNPREVIEW); + + // font loading + GDI32Lib := LoadLibrary(gdi32); + AddFontMemResource := GetProcAddress(GDI32Lib, 'AddFontMemResourceEx'); + RemoveFontMemResource := GetProcAddress(GDI32Lib, 'RemoveFontMemResourceEx'); + Res := TResourceStream.Create(hInstance, 'SCHEDULERFONT', 'PSSCHEDULERFONT'); + try + if IsWin2KOrXP then + SchedulerFontHandle := AddFontMemResource(Res.Memory, Res.Size, nil, @Count) + else + begin + SchedulerFontFileName := GetFontFolder + '\' + 'dxPScxSchedulerLnk.ttf'; + if not FileExists(SchedulerFontFileName) then + Res.SavetoFile(SchedulerFontFileName); + AddFontResource(PChar(SchedulerFontFileName)); + end; + finally + Res.Free; + end; + SpecialSymbolFont := TFont.Create; + SpecialSymbolFont.Name := 'dxPScxScheduler'; + RegisterReportLinkClasses; +end; + +procedure UnregisterReportLinkClasses; +begin + TcxSchedulerReportSchedulingAreaCell.Unregister; + TcxSchedulerReportNotesAreaCell.Unregister; + TcxSchedulerReportTaskPadCell.Unregister; + TcxSchedulerReportSchedulerHeaderCell.Unregister; + TcxSchedulerReportSchedulerHeaderDataCell.Unregister; + //datenavigator + TcxSchedulerReportDateNavigatorCell.Unregister; + TcxSchedulerReportDateNavigatorHeader.Unregister; + TcxSchedulerReportDateNavigatorDay.Unregister; + TcxSchedulerReportDateNavigatorDayCaption.Unregister; + TcxSchedulerReportDateNavigatorWeekNumber.Unregister; + + //scheduling area items + TcxSchedulerReportContentCell.Unregister; + TcxSchedulerReportHeaderItemCell.Unregister; + TcxSchedulerReportGroupSeparatorCell.Unregister; + TcxSchedulerReportContainerCell.Unregister; + TcxSchedulerReportBackgroundSlotCell.Unregister; + TcxSchedulerReportDailyTimeRulerCellsSite.Unregister; + TcxSchedulerReportDailyTimeRulerCell.Unregister; + TcxSchedulerReportMonthDayCell.Unregister; + + TcxSchedulerReportCellString.Unregister; + TcxSchedulerReportEventCell.Unregister; + TcxSchedulerReportDetailsEventCell.Unregister; + TcxSchedulerReportMemoEventCell.Unregister; + + TcxSchedulerReportTimeLineCell.Unregister; + TcxSchedulerReportTimeLinePart.Unregister; + + TcxSchedulerReportTimeLineMajorScaleCell.Unregister; + TcxSchedulerReportTimeLineMinorScaleCell.Unregister; + + TcxSchedulerReportGanttLinkCell.Unregister; + + TcxSchedulerReportPageSite.Unregister; + + dxPSUnregisterReportLink(TcxSchedulerReportLink, + TcxScheduler, TcxfmSchedulerReportLinkDesignWindow); + UnRegisterClasses([TcxSchedulerReportLinkStyles]); + UnRegisterMirrorClasses; +end; + +procedure FinalizeSchedulerLink; +begin + // images removing + FreeAndNil(StyleImages); + FreeAndNil(StylePreviewImages); + + // font removing + if IsWin2KOrXP then + begin + if SchedulerFontHandle <> 0 then + RemoveFontMemResource(SchedulerFontHandle); + end + else + begin + if RemoveFontResource(PChar(SchedulerFontFileName)) then + DeleteFile(PChar(SchedulerFontFileName)); + end; + + SpecialSymbolFont.Free; + FreeLibrary(GDI32Lib); + + UnregisterReportLinkClasses; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrimaryPageHeadersOnlyClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TcxCheckBox(Sender) do + if ActivePrintStyle is TcxSchedulerReportLinkYearlyPrintStyle then + TcxSchedulerReportLinkYearlyPrintStyle(ActivePrintStyle).PrimaryPageHeadersOnly := Checked + else + if ActivePrintStyle is TcxSchedulerReportLinkTimeLinePrintStyle then + TcxSchedulerReportLinkTimeLinePrintStyle(ActivePrintStyle).PrimaryPageHeadersOnly := Checked; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrimaryPageScalesOnlyClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + TcxSchedulerReportLinkTimeLinePrintStyle(ActivePrintStyle). + PrimaryPageScalesOnly := TcxCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleWorkTimeOnlyClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + TcxSchedulerReportLinkTimeLinePrintStyle(ActivePrintStyle). + WorkTimeOnly := TcxCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleShowResourceImagesClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ActivePrintStyle.ShowResourceImages := TcxCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleShowEventImagesClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ActivePrintStyle.ShowEventImages := TcxCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +initialization + InitializeSchedulerLink; + +finalization + FinalizeSchedulerLink; + +end. + + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler3Lnk.res b/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler3Lnk.res new file mode 100644 index 00000000..3008a815 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler3Lnk.res differ diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler3LnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler3LnkReg.pas new file mode 100644 index 00000000..9ac31422 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxScheduler3LnkReg.pas @@ -0,0 +1,165 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxScheduler3LnkReg; + +interface + +{$I cxVer.Inc} + +procedure Register; + +implementation + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignEditors, + {$ELSE} + DsgnIntf, + {$ENDIF} + Classes, TypInfo, cxStyles, cxStyleSheetEditor, dxPSCore, dxPScxScheduler3Lnk; + +const + sdxAllResources = '(All resources)'; + sdxAuto = 'Auto'; + sdxDefault = 'Default'; + sdxTypeDefault = '(Type "Default" to restore original Caption)'; + +{ TcxSchedulerReportLinkActiveStylePropertyEditor } + +type + + TcxSchedulerReportLinkResourceCountPerPagePropertyEditor = class(TIntegerProperty) + public + function GetValue: string; override; + end; + + { TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor } + + TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor = class(TComponentProperty) + private + FComponents: TStringList; + function GetReportLink: TBasedxReportLink; + protected + procedure AddComponent(const AName: string); + procedure GetComponents; virtual; + function IsComponentValid(AComponent: TComponent): Boolean; virtual; + public + destructor Destroy; override; + procedure Initialize; override; + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + property ReportLink: TBasedxReportLink read GetReportLink; + end; + +{ TcxSchedulerReportLinkResourceCountPerPagePropertyEditor } + +function TcxSchedulerReportLinkResourceCountPerPagePropertyEditor.GetValue: string; +begin + Result := inherited GetValue; + if GetOrdValue = 0 then + Result := Result + ' ' + sdxAllResources; +end; + +{ TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor } + +destructor TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.Destroy; +begin + FComponents.Free; + inherited Destroy; +end; + +procedure TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.Initialize; +begin + inherited; + FComponents := TStringList.Create; +end; + +function TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes - [paMultiSelect]; +end; + +procedure TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + GetComponents; + for I := 0 to FComponents.Count - 1 do + Proc(FComponents[I]); +end; + +function TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.GetReportLink: TBasedxReportLink; +begin + Result := TBasedxReportLink(GetComponent(0)); +end; + +procedure TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.AddComponent(const AName: string); +begin + if IsComponentValid(Designer.GetComponent(AName)) then FComponents.Add(AName); +end; + +procedure TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.GetComponents; +begin + FComponents.Clear; + Designer.GetComponentNames(GetTypeData(PTypeInfo(TBasedxReportLink.ClassInfo)), AddComponent); +end; + +function TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.IsComponentValid(AComponent: TComponent): Boolean; +begin + Result := (AComponent <> GetComponent(0)) and TBasedxReportLink(AComponent).Aggregable; +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterNoIcon([TcxSchedulerReportLink, TcxSchedulerReportLinkStyleSheet]); + + RegisterPropertyEditor(TypeInfo(Integer), TcxCustomSchedulerReportLinkPrintStyle, + 'ResourceCountPerPage', TcxSchedulerReportLinkResourceCountPerPagePropertyEditor); + RegisterPropertyEditor(TypeInfo(TBasedxReportLink), TcxSchedulerReportLink, + 'TaskPadReportLink', TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor); +end; + +initialization + cxStyles.RegisterStyleSheetClass(TcxSchedulerReportLinkStyleSheet); + +finalization + cxStyles.UnregisterStyleSheetClass(TcxSchedulerReportLinkStyleSheet); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxSchedulerLnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPScxSchedulerLnk.dfm new file mode 100644 index 00000000..d12acfca --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxSchedulerLnk.dfm @@ -0,0 +1,1433 @@ +object cxfmSchedulerReportLinkDesignWindow: TcxfmSchedulerReportLinkDesignWindow + Left = 138 + Top = 193 + BorderStyle = bsDialog + Caption = 'cxfmSchedulerReportLinkDesignWindow' + ClientHeight = 446 + ClientWidth = 618 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 5 + Width = 610 + Height = 404 + ActivePage = tshPrintStyles + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + OnChange = PageControl1Change + object tshPrintRange: TTabSheet + Caption = 'Print Range' + ImageIndex = 3 + object lblPrintRangeStart: TLabel + Left = 17 + Top = 22 + Width = 28 + Height = 13 + Caption = '&Start:' + end + object lblPrintRangeEnd: TLabel + Left = 18 + Top = 54 + Width = 22 + Height = 13 + Caption = '&End:' + end + object lblPrintRangesMiscellaneous: TLabel + Left = 5 + Top = 91 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + Visible = False + end + object Bevel1: TBevel + Left = 80 + Top = 95 + Width = 231 + Height = 4 + Shape = bsBottomLine + Visible = False + end + object dePrintRangeStart: TcxDateEdit + Left = 70 + Top = 18 + Width = 235 + Height = 21 + EditValue = 38187d + Properties.OnEditValueChanged = dePrintRangeStartEditValueChanged + TabOrder = 0 + end + object dePrintRangeEnd: TcxDateEdit + Left = 70 + Top = 50 + Width = 235 + Height = 21 + EditValue = 38187d + Properties.OnEditValueChanged = dePrintRangeEndEditValueChanged + TabOrder = 1 + end + object chbxHideDetailsOfPrivateAppointments: TcxCheckBox + Left = 66 + Top = 113 + Width = 236 + Height = 21 + Caption = 'Hide Details of Private Appointments' + TabOrder = 2 + Visible = False + end + end + object tshPrintStyles: TTabSheet + Caption = 'Print Styles' + object lblPrintStylesOptions: TLabel + Left = 5 + Top = 72 + Width = 37 + Height = 13 + Caption = 'Options' + end + object bvlPrintStyleOptions: TBevel + Left = 50 + Top = 76 + Width = 258 + Height = 4 + Shape = bsBottomLine + end + object lblPreviewWindow: TStaticText + Left = 324 + Top = 0 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 0 + end + object cbxPrintStyles: TcxImageComboBox + Left = 6 + Top = 18 + Width = 299 + Height = 21 + Properties.Alignment.Vert = taVCenter + Properties.Items = <> + TabOrder = 1 + OnClick = cbxPrintStylesClick + end + object pcPrintStyleOptions: TPageControl + Left = 4 + Top = 90 + Width = 314 + Height = 284 + ActivePage = tshWeekly + Style = tsButtons + TabOrder = 2 + object tshDaily: TTabSheet + Caption = 'Daily' + TabVisible = False + object lblPrintStyleDailyLayout: TLabel + Left = 14 + Top = 7 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleDailyLayout + end + object lblPrintStyleDailyInclude: TLabel + Left = 14 + Top = 67 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleDailyPrintFrom: TLabel + Left = 14 + Top = 139 + Width = 53 + Height = 13 + Caption = 'Print &From:' + FocusControl = tePrintStyleDailyPrintFrom + end + object lblPrintStyleDailyPrintTo: TLabel + Left = 14 + Top = 168 + Width = 41 + Height = 13 + Caption = 'Print &To:' + FocusControl = tePrintStyleDailyPrintTo + end + object lblPrintStyleDailyResourceCountPerPage: TLabel + Left = 14 + Top = 37 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleDailyResourceCountPerPage + end + object cbxPrintStyleDailyLayout: TcxComboBox + Left = 115 + Top = 2 + Width = 186 + Height = 23 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/day' + '2 pages/day') + TabOrder = 0 + OnClick = cbxPrintStyleDailyLayoutClick + end + object chbxPrintStyleDailyTaskPad: TcxCheckBox + Left = 111 + Top = 64 + Width = 190 + Height = 21 + Caption = 'Task&Pad' + TabOrder = 2 + OnClick = chbxPrintStyleOptionsViewClick + end + object chbxPrintStyleDailyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 85 + Width = 190 + Height = 21 + Caption = 'Notes Area (&Blank)' + TabOrder = 3 + OnClick = chbxPrintStyleOptionsViewClick + end + object chbxPrintStyleDailyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 106 + Width = 190 + Height = 21 + Caption = 'Notes Area (&Lined)' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + end + object tePrintStyleDailyPrintFrom: TcxTimeEdit + Left = 114 + Top = 135 + Width = 100 + Height = 21 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 5 + end + object tePrintStyleDailyPrintTo: TcxTimeEdit + Tag = 1 + Left = 114 + Top = 164 + Width = 100 + Height = 21 + EditValue = 0.000000000000000000 + Properties.ImmediatePost = True + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 6 + end + object sePrintStyleDailyResourceCountPerPage: TcxSpinEdit + Left = 115 + Top = 33 + Width = 100 + Height = 21 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 1 + end + end + object tshWeekly: TTabSheet + Caption = 'Weekly' + ImageIndex = 1 + TabVisible = False + object lblPrintStyleWeeklyPrintTo: TLabel + Left = 14 + Top = 199 + Width = 41 + Height = 13 + Caption = 'Print &To:' + FocusControl = tePrintStyleWeeklyPrintTo + end + object lblPrintStyleWeeklyPrintFrom: TLabel + Left = 14 + Top = 170 + Width = 53 + Height = 13 + Caption = 'Print &From:' + FocusControl = tePrintStyleWeeklyPrintFrom + end + object lblPrintStyleWeeklyInclude: TLabel + Left = 14 + Top = 97 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleWeeklyLayout: TLabel + Left = 14 + Top = 36 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleWeeklyLayout + end + object lblPrintStyleWeeklyArrange: TLabel + Left = 14 + Top = 7 + Width = 43 + Height = 13 + Caption = '&Arrange:' + FocusControl = cbxPrintStyleWeeklyArrange + end + object lblPrintStyleWeeklyResourceCountPerPage: TLabel + Left = 14 + Top = 67 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleWeeklyResourceCountPerPage + end + object tePrintStyleWeeklyPrintTo: TcxTimeEdit + Tag = 1 + Left = 114 + Top = 194 + Width = 100 + Height = 21 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 7 + end + object tePrintStyleWeeklyPrintFrom: TcxTimeEdit + Left = 114 + Top = 165 + Width = 100 + Height = 21 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 6 + end + object chbxPrintStyleWeeklyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 136 + Width = 190 + Height = 21 + Caption = 'Notes Area (&Lined)' + TabOrder = 5 + OnClick = chbxPrintStyleOptionsViewClick + end + object chbxPrintStyleWeeklyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 115 + Width = 190 + Height = 21 + Caption = 'Notes Area (&Blank)' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + end + object cbxPrintStyleWeeklyArrange: TcxComboBox + Left = 115 + Top = 2 + Width = 186 + Height = 23 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + 'Top to Bottom' + 'Left to Right') + TabOrder = 0 + OnClick = cbxPrintStyleWeeklyArrangeClick + end + object cbxPrintStyleWeeklyLayout: TcxComboBox + Left = 115 + Top = 32 + Width = 186 + Height = 23 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/day' + '2 pages/day') + TabOrder = 1 + OnClick = cbxPrintStyleWeeklyLayoutClick + end + object chbxPrintStyleWeeklyTaskPad: TcxCheckBox + Left = 111 + Top = 94 + Width = 190 + Height = 21 + Caption = 'TaskPad' + TabOrder = 3 + OnClick = chbxPrintStyleOptionsViewClick + end + object chbxPrintStyleWeeklyDontPrintWeekends: TcxCheckBox + Left = 9 + Top = 223 + Width = 285 + Height = 21 + Caption = 'Don'#39't Print &Weekends' + TabOrder = 8 + OnClick = chbxPrintStyleWeeklyDontPrintWeekendsClick + end + object sePrintStyleWeeklyResourceCountPerPage: TcxSpinEdit + Tag = 1 + Left = 115 + Top = 63 + Width = 100 + Height = 21 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 2 + end + end + object tshMonthly: TTabSheet + Caption = 'Monthly' + ImageIndex = 2 + TabVisible = False + object lblPrintStyleMonthlyLayout: TLabel + Left = 14 + Top = 7 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleMonthlyLayout + end + object lblPrintStyleMonthlyInclude: TLabel + Left = 14 + Top = 67 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleMonthlyResourceCountPerPage: TLabel + Left = 14 + Top = 37 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleMonthlyResourceCountPerPage + end + object cbxPrintStyleMonthlyLayout: TcxComboBox + Left = 115 + Top = 2 + Width = 186 + Height = 23 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/month' + '2 pages/month') + TabOrder = 0 + OnClick = cbxPrintStyleMonthlyLayoutClick + end + object chbxPrintStyleMonthlyTaskPad: TcxCheckBox + Left = 111 + Top = 64 + Width = 190 + Height = 21 + Caption = 'Task&Pad' + TabOrder = 2 + OnClick = chbxPrintStyleOptionsViewClick + end + object chbxPrintStyleMonthlyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 85 + Width = 190 + Height = 21 + Caption = 'Notes Area (&Blank)' + TabOrder = 3 + OnClick = chbxPrintStyleOptionsViewClick + end + object chbxPrintStyleMonthlyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 106 + Width = 190 + Height = 21 + Caption = 'Notes Area (&Lined)' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + end + object chbxPrintStyleMonthlyDontPrintWeekends: TcxCheckBox + Left = 9 + Top = 144 + Width = 285 + Height = 21 + Caption = 'Don'#39't Print &Weekends' + TabOrder = 5 + OnClick = chbxPrintStyleMonthlyDontPrintWeekendsClick + end + object chbxPrintStyleMonthlyPrintExactlyOneMonthPerPage: TcxCheckBox + Left = 9 + Top = 167 + Width = 285 + Height = 21 + Caption = 'Print Exactly One Month Per Page' + TabOrder = 6 + OnClick = chbxPrintStyleMonthlyPrintExactlyOneMonthPerPageClick + end + object sePrintStyleMonthlyResourceCountPerPage: TcxSpinEdit + Tag = 2 + Left = 115 + Top = 33 + Width = 100 + Height = 21 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 1 + end + end + object tshTrifold: TTabSheet + Caption = 'Tri-fold' + ImageIndex = 3 + TabVisible = False + object lblPrintStyleTrifoldSectionLeft: TLabel + Left = 14 + Top = 7 + Width = 61 + Height = 13 + Caption = '&Left Section:' + FocusControl = cbxPrintStyleTrifoldSectionLeft + end + object lblPrintStyleTrifoldSectionMiddle: TLabel + Left = 14 + Top = 41 + Width = 72 + Height = 13 + Caption = '&Middle Section:' + FocusControl = cbxPrintStyleTrifoldSectionMiddle + end + object lblPrintStyleTrifoldSectionRight: TLabel + Left = 14 + Top = 74 + Width = 67 + Height = 13 + Caption = '&Right Section:' + FocusControl = cbxPrintStyleTrifoldSectionRight + end + object cbxPrintStyleTrifoldSectionLeft: TcxComboBox + Left = 100 + Top = 2 + Width = 200 + Height = 23 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + TabOrder = 0 + OnClick = cbxPrintStyleTrifoldSectionModeClick + end + object cbxPrintStyleTrifoldSectionMiddle: TcxComboBox + Tag = 1 + Left = 100 + Top = 36 + Width = 200 + Height = 23 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + TabOrder = 1 + OnClick = cbxPrintStyleTrifoldSectionModeClick + end + object cbxPrintStyleTrifoldSectionRight: TcxComboBox + Tag = 2 + Left = 100 + Top = 69 + Width = 200 + Height = 23 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + TabOrder = 2 + OnClick = cbxPrintStyleTrifoldSectionModeClick + end + end + object tshDetails: TTabSheet + Caption = 'Details' + ImageIndex = 4 + TabVisible = False + object chbxPrintStyleDetailsUsePagination: TcxCheckBox + Left = 14 + Top = 3 + Width = 187 + Height = 21 + Caption = 'Start a New Page Each:' + TabOrder = 0 + OnClick = chbxPrintStyleDetailsUsePaginationClick + end + object cbxPrintStyleDetailsPagination: TcxComboBox + Left = 203 + Top = 2 + Width = 97 + Height = 23 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + 'Day' + 'Week' + 'Month') + TabOrder = 1 + OnClick = cbxPrintStyleDetailsPaginationClick + end + end + object tshMemo: TTabSheet + Caption = 'Memo' + ImageIndex = 5 + TabVisible = False + object chbxPrintStyleMemoStartEachItemOnNewPage: TcxCheckBox + Left = 14 + Top = 3 + Width = 187 + Height = 21 + Caption = 'Start Each Item On New Page' + TabOrder = 0 + OnClick = chbxPrintStyleMemoStartEachItemOnNewPageClick + end + object chbxPrintStyleMemoPrintOnlySelectedEvents: TcxCheckBox + Left = 14 + Top = 27 + Width = 187 + Height = 21 + Caption = 'Print Only Selected Events' + State = cbsChecked + TabOrder = 1 + OnClick = chbxPrintStyleMemoPrintOnlySelectedEventsClick + end + end + end + object pnlPrintStylesPreview: TPanel + Left = 323 + Top = 17 + Width = 275 + Height = 356 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 3 + object pbxPrintStylesPreview: TPaintBox + Left = 1 + Top = 1 + Width = 273 + Height = 354 + Align = alClient + OnPaint = pbxPrintStylesPreviewPaint + end + end + end + object tshFormatting: TTabSheet + Caption = 'Formatting' + ImageIndex = 2 + object bvlLookAndFeel: TBevel + Left = 85 + Top = 13 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object lblLookAndFeel: TLabel + Left = 5 + Top = 8 + Width = 66 + Height = 13 + Caption = 'Look and Feel' + end + object imgLookAndFeel: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDD77777777777777777777 + 7777D0000000000000000000000007DDDDDDDDDDDDD000000000000000000000 + 0007D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0FFFFFFFFFF78888877787807DDDDDDDDDDDDD0FFFFFFFFFF7888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7888888888 + 8807D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCDDDDCDDDD077777777777777777777 + 7707D0888877787878888877787807DDDCCCCDCCDDD088887778787888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF07DDDCCCCCCCCDD088888888887888888888 + 8807D0777777777777777777777707DDDCCCCDCCDDD077777777777777777777 + 7707D0FFFFFFFFFF7FFFFFFFFFFF07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0FFFFFFFFFF7FFFFFFFFFFF07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDCCCCDCCDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCCCCCCCCDD077777777777777777777 + 7707D0888877787878888877787807DDDCCCCDCCDDD088887778787888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF07DDDCDDDDCDDDD088888888887888888888 + 8807D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D0888877787878888877787807DDDDDDDDDDDDD088887778787888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF0DDDDDDDDDDDDDD088888888887888888888 + 8807D000000000000000000000000DDDDDDDDDDDDDD000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblRefinements: TLabel + Left = 5 + Top = 78 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlRefinements: TBevel + Left = 75 + Top = 82 + Width = 236 + Height = 4 + Shape = bsBottomLine + end + object imgRefinements: TImage + Left = 8 + Top = 100 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDD77777777777777777777 + 7777D0000000000000000000000007DDDDDDDDDDDDD000000000000000000000 + 0007D0FAFAFAFAFA7AFAFAFAFAFA07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0FAFAFAFAFA788888777CC807DDDDDDDDDDDDD0FFFFFFFFFF7888887778 + 7807D0AFAFAFAFAF78888888888807DDDDDDDDDDDDD0FFFFFFFFFF7888888888 + 8807D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0AFAFAFAFAF7FAFAFAFAFAF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FAFAFAFAFA7AFAFAFAFAFA07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCDDDDCDDDD077777777777777777777 + 7707D08888777CC8788888777CC807DDDCCCCDCCDDD088887778787888887778 + 7807D0888888888878888888888807DDDCCCCCCCCDD088888888887888888888 + 8807D0777777777777777777777707DDDCCCCDCCDDD077777777777777777777 + 7707D0FEFEFEFEFE7EFEFEFEFEFE07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0EFEFEFEFEF7FEFEFEFEFEF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0EFEFEFEFEF7FEFEFEFEFEF07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FEFEFEFEFE7EFEFEFEFEFE07DDDCCCCDCCDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCCCCCCCCDD077777777777777777777 + 7707D08888777CC8788888777CC807DDDCCCCDCCDDD088887778787888887778 + 7807D0888888888878888888888807DDDCDDDDCDDDD088888888887888888888 + 8807D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D0FBFBFBFBFB7BFBFBFBFBFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0BFBFBFBFBF7FBFBFBFBFBF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0BFBFBFBFBF7FBFBFBFBFBF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FBFBFBFBFB7BFBFBFBFBFB07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D08888777CC8788888777CC807DDDDDDDDDDDDD088887778787888887778 + 7807D088888888887888888888880DDDDDDDDDDDDDD088888888887888888888 + 8807D000000000000000000000000DDDDDDDDDDDDDD000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object cbxLookAndFeel: TcxComboBox + Left = 90 + Top = 37 + Width = 215 + Height = 23 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.OnChange = cbxLookAndFeelPropertiesChange + TabOrder = 0 + OnClick = LookAndFeelChange + end + object chbxSuppressBackgroundBitmaps: TcxCheckBox + Tag = 1 + Left = 90 + Top = 104 + Width = 200 + Height = 21 + Caption = 'Suppress Background Textures' + TabOrder = 1 + OnClick = OptionsFormattingClick + end + object chbxSuppressContentColoration: TcxCheckBox + Tag = 2 + Left = 90 + Top = 130 + Width = 200 + Height = 21 + Caption = 'Suppress Content Coloration' + TabOrder = 2 + OnClick = OptionsFormattingClick + end + end + object tshStyles: TTabSheet + Caption = 'Styles' + ImageIndex = 1 + object bvlStyles: TBevel + Left = 118 + Top = 13 + Width = 193 + Height = 4 + Shape = bsBottomLine + end + object bvlStyleSheets: TBevel + Left = 72 + Top = 302 + Width = 239 + Height = 5 + Shape = bsBottomLine + end + object lblStyleSheets: TLabel + Left = 6 + Top = 298 + Width = 60 + Height = 13 + Caption = 'Style Sheets' + end + object bvlStylesHost: TBevel + Left = 6 + Top = 33 + Width = 228 + Height = 222 + end + object Label1: TLabel + Left = 85 + Top = 140 + Width = 64 + Height = 13 + Caption = '[ Styles Site ]' + Visible = False + end + object lblUseNativeStyles: TLabel + Left = 24 + Top = 9 + Width = 84 + Height = 13 + Caption = '&Use Native Styles' + FocusControl = chbxUseNativeStyles + OnClick = lblUseNativeStylesClick + end + object btnStyleColor: TButton + Left = 243 + Top = 61 + Width = 68 + Height = 23 + Caption = 'Co&lor...' + TabOrder = 0 + OnClick = btnStyleColorClick + end + object btnStyleFont: TButton + Left = 243 + Top = 33 + Width = 68 + Height = 23 + Caption = '&Font...' + TabOrder = 1 + OnClick = btnStyleFontClick + end + object btnStyleBackgroundBitmap: TButton + Left = 243 + Top = 97 + Width = 68 + Height = 23 + Caption = '&Bitmap...' + TabOrder = 2 + OnClick = btnStyleBackgroundBitmapClick + end + object cbxStyleSheets: TcxComboBox + Left = 6 + Top = 318 + Width = 305 + Height = 24 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 20 + Properties.OnDrawItem = cbxStyleSheetsPropertiesDrawItem + TabOrder = 3 + OnClick = cbxStyleSheetsClick + OnKeyDown = cbxStyleSheetsKeyDown + end + object btnStyleSheetNew: TButton + Left = 6 + Top = 350 + Width = 71 + Height = 23 + Caption = '&New...' + TabOrder = 4 + OnClick = btnStyleSheetNewClick + end + object btnStyleSheetCopy: TButton + Left = 84 + Top = 350 + Width = 71 + Height = 23 + Caption = '&Copy...' + TabOrder = 5 + OnClick = btnStyleSheetCopyClick + end + object btnStyleSheetDelete: TButton + Left = 162 + Top = 350 + Width = 71 + Height = 23 + Caption = '&Delete...' + TabOrder = 6 + OnClick = btnStyleSheetDeleteClick + end + object btnStylesSaveAs: TButton + Left = 123 + Top = 263 + Width = 112 + Height = 23 + Caption = 'Save &As...' + TabOrder = 7 + OnClick = btnStylesSaveAsClick + end + object btnStyleSheetRename: TButton + Left = 240 + Top = 350 + Width = 71 + Height = 23 + Caption = '&Rename...' + TabOrder = 8 + OnClick = btnStyleSheetRenameClick + end + object btnStyleBackgroundBitmapClear: TButton + Left = 243 + Top = 125 + Width = 68 + Height = 23 + Caption = 'Cle&ar' + TabOrder = 9 + OnClick = btnStyleBackgroundBitmapClearClick + end + object btnStyleRestoreDefaults: TButton + Left = 6 + Top = 263 + Width = 112 + Height = 23 + Caption = 'Rest&ore Defaults' + TabOrder = 10 + OnClick = btnStyleRestoreDefaultsClick + end + object chbxUseNativeStyles: TcxCheckBox + Left = 3 + Top = 6 + Width = 22 + Height = 21 + TabOrder = 11 + OnClick = OptionsFormattingClick + end + end + end + object pnlPreview: TPanel + Left = 331 + Top = 46 + Width = 275 + Height = 356 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + object pbPreview: TPaintBox + Left = 1 + Top = 1 + Width = 273 + Height = 354 + Align = alClient + OnPaint = pbPreviewPaint + end + end + object pmStyles: TPopupMenu + Images = ilStylesPopup + OnPopup = pmStylesPopup + Left = 6 + Top = 417 + object miStyleFont: TMenuItem + Caption = '&Font...' + ImageIndex = 0 + OnClick = btnStyleFontClick + end + object miStyleColor: TMenuItem + Caption = '&Color...' + OnClick = btnStyleColorClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miStyleBackgroundBitmap: TMenuItem + Caption = '&Bitmap...' + ImageIndex = 1 + ShortCut = 16463 + OnClick = btnStyleBackgroundBitmapClick + end + object miStyleBackgroundBitmapClear: TMenuItem + Caption = 'Clear' + ImageIndex = 3 + ShortCut = 16430 + OnClick = btnStyleBackgroundBitmapClearClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miStyleRestoreDefaults: TMenuItem + Caption = 'Restore Defaults' + OnClick = btnStyleRestoreDefaultsClick + end + object milLine: TMenuItem + Caption = '-' + end + object miStylesSelectAll: TMenuItem + Caption = 'Select A&ll' + ShortCut = 16449 + OnClick = miStylesSelectAllClick + end + object miLine4: TMenuItem + Caption = '-' + end + object miStylesSaveAs: TMenuItem + Caption = 'Save &As...' + ImageIndex = 2 + ShortCut = 16467 + OnClick = btnStylesSaveAsClick + end + end + object ilStylesPopup: TImageList + Left = 34 + Top = 417 + Bitmap = { + 494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00000000000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF000000 + 0000008080000080800000808000008080000080800000808000008080000080 + 8000008080000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000000000000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000008080000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF00FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800080808000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00C0C0C00000FFFF00C0C0C000FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000000000008080800080808000000000008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C00000000000C0C0C00000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFC001FFFF + FE07001F8001FFF9FF9F000F8001E7FFFF9F00078001C3F3E01F00038001C3E7 + F99F00018001E1C7F99B00008001F08FF99B00018001F81FF89300018001FC3F + D80300018001F81FD9BF80018001F09FC93FE0018001C1C7C03FE001800183E3 + FFFFE00180018FF1FFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end + object cxEditStyleController1: TcxEditStyleController + OnStyleChanged = StyleController1StyleChanged + Left = 64 + Top = 416 + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxSchedulerLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxSchedulerLnk.pas new file mode 100644 index 00000000..5e789ce9 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxSchedulerLnk.pas @@ -0,0 +1,9870 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxSchedulerLnk; + +{$I cxVer.Inc} + +interface + +uses + Windows, Classes, SysUtils, Forms, Graphics, Controls, StdCtrls, ExtCtrls, ComCtrls, + ImgList, Menus, cxGraphics, cxClasses, cxControls, cxStyles, cxLookAndFeels, cxLookAndFeelPainters, + cxScheduler, cxEdit, cxContainer, cxTextEdit, cxMaskEdit, cxDropDownEdit, + cxCalendar, cxCheckBox, cxImageComboBox, cxTimeEdit, cxSpinEdit, cxDateUtils, + dxPSCore, dxPSGlbl, dxExtCtrls, dxPScxCommon, dxPrevw, dxPgsdlg, dxPrnPg, cxSchedulerUtils, + cxSchedulerStorage, cxSchedulerCustomControls, cxSchedulerCustomResourceView, + cxSchedulerDayView, cxSchedulerDateNavigator, cxSchedulerWeekView, cxGeometry; + +const + // visual print style indexes + + vspsSchedulerFirst = 0; + + vspsSchedulerControlFirst = vspsSchedulerFirst + 0; + vspsSchedulerContent = vspsSchedulerControlFirst + 0; + vspsSchedulerDayHeader = vspsSchedulerControlFirst + 1; + vspsSchedulerEvent = vspsSchedulerControlFirst + 2; + vspsSchedulerResourceHeader = vspsSchedulerControlFirst + 3; + vspsSchedulerControlLast = vspsSchedulerControlFirst + 3; + + vspsSchedulerViewDayFirst = vspsSchedulerControlLast + 1; + vspsSchedulerTimeRuler = vspsSchedulerViewDayFirst + 0; + vspsSchedulerViewDayLast = vspsSchedulerViewDayFirst + 0; + + vspsSchedulerDateNavigatorFirst = vspsSchedulerViewDayLast + 1; + vspsSchedulerDateNavigatorContent = vspsSchedulerDateNavigatorFirst + 0; + vspsSchedulerDateNavigatorHeader = vspsSchedulerDateNavigatorFirst + 1; + vspsSchedulerDateNavigatorLast = vspsSchedulerDateNavigatorFirst + 1; + + vspsSchedulerNativeFirst = vspsSchedulerDateNavigatorLast + 1; + vspsSchedulerSchedulerHeader = vspsSchedulerNativeFirst + 0; + vspsSchedulerNotesAreaBlank = vspsSchedulerNativeFirst + 1; + vspsSchedulerNotesAreaLined = vspsSchedulerNativeFirst + 2; + vspsSchedulerTaskPad = vspsSchedulerNativeFirst + 3; + vspsSchedulerNativeLast = vspsSchedulerNativeFirst + 3; + + vspsSchedulerLast = vspsSchedulerNativeLast; + + // custom draw ID's + cdidSchedulerFirst = 1; + cdidSchedulerSchedulerHeader = cdidSchedulerFirst + 0; + cdidSchedulerDateNavigatorHeader = cdidSchedulerFirst + 1; + cdidSchedulerDateNavigatorDay = cdidSchedulerFirst + 2; + cdidSchedulerDateNavigatorDayCaption = cdidSchedulerFirst + 3; + cdidSchedulerDateNavigatorWeekNumber = cdidSchedulerFirst + 4; + cdidSchedulerTimeRuler = cdidSchedulerFirst + 5; + cdidSchedulerNotesArea = cdidSchedulerFirst + 6; + cdidSchedulerTaskPad = cdidSchedulerFirst + 7; + cdidSchedulerContent = cdidSchedulerFirst + 8; + cdidSchedulerHeader = cdidSchedulerFirst + 9; + // keep order + cdidSchedulerEventCaption = cdidSchedulerFirst + 10; + cdidSchedulerEventStart = cdidSchedulerFirst + 11; + cdidSchedulerEventFinish = cdidSchedulerFirst + 12; + cdidSchedulerEventIcons = cdidSchedulerFirst + 13; + cdidSchedulerEventMessage = cdidSchedulerFirst + 14; + cdidSchedulerEventTimeLine = cdidSchedulerFirst + 15; + + InterAreaSpace = 5; + NotesAreaWidth = 1 / 3; + SchedulerHeaderMinHeight = 1 / 10; + SchedulerHeaderMaxHeight = 1 / 4; + SchedulerHeaderSmallHeight = 1 / 18; + +type + TcxSchedulerReportItemsType = (srSchedulingArea, srHeader, srDateNavigator, + srNotesBlank, srNotesLined, srTaskPad, srUnknownItem); + TcxSchedulerReportEventPartType = (epCaption, epStart, epFinish, epIcons, + epMessage, epTimeLine); + + TcxfmSchedulerReportLinkDesignWindow = class; + + TcxSchedulerReportLink = class; + TcxCustomSchedulerReportLinkPrintStyle = class; + TcxCustomSchedulerReportLinkPrintStyleClass = class of TcxCustomSchedulerReportLinkPrintStyle; + + TcxSchedulerReportLinkPrintStyles = class; + TcxSchedulerReportPageItemCell = class; + TcxSchedulerReportPageSite = class; + TcxSchedulerReportSchedulingAreaCell = class; + TcxSchedulerReportSchedulerHeaderCell = class; + TcxSchedulerReportDateNavigatorCell = class; + TcxSchedulerReportNotesAreaCell = class; + TcxSchedulerReportTaskPadCell = class; + + TcxSchedulerReportCustomCell = class; + TcxSchedulerReportCustomCellClass = class of TcxSchedulerReportCustomCell; + TcxSchedulerReportCommonCellsProducer = class; + + // for options + TcxCustomSchedulerReportLinkOptions = class; + TcxSchedulerReportDateNavigatorHeader = class; + TcxSchedulerReportDateNavigatorDay = class; + TcxSchedulerReportDateNavigatorDayCaption = class; + TcxSchedulerReportDateNavigatorWeekNumber = class; + TcxSchedulerReportDailyTimeRulerCell = class; + TcxSchedulerReportContentCell = class; + TcxSchedulerReportCustomEventCell = class; + TcxSchedulerReportSchedulerHeaderDataCell = class; + TcxSchedulerReportNotesDataCell = class; + TcxSchedulerReportHeaderItemCell = class; + TcxSchedulerReportDetailsEventCell = class; + TcxSchedulerReportDetailsEventCellClass = class of TcxSchedulerReportDetailsEventCell; + + { TcxCustomSchedulerReportLinkOptions } + + TcxCustomSchedulerReportLinkOptions = class(TdxCustomReportLinkOptions) + private + function GetReportLink: TcxSchedulerReportLink; + function GetScheduler: TcxScheduler; + public + property ReportLink: TcxSchedulerReportLink read GetReportLink; + property Scheduler: TcxScheduler read GetScheduler; + end; + + { TcxSchedulerReportLinkPrintRange } + + TcxSchedulerReportLinkPrintRange = class(TcxCustomSchedulerReportLinkOptions) + private + FDatePrint: array[0..1] of TDate; + FTimePrint: array[0..1] of TTime; + function GetActiveStyle: TcxCustomSchedulerReportLinkPrintStyle; + function GetDayCount: Integer; + function GetMonthCount: Integer; + function GetPrintDate(AIndex: Integer): TDate; + function GetPrintTime(AIndex: Integer): TTime; + function GetWeekCount: Integer; + procedure SetPrintDate(AIndex: Integer; const Value: TDate); + procedure SetPrintTime(AIndex: Integer; const Value: TTime); + + function IsDateStored(AIndex: Integer): Boolean; + function IsTimeStored(AIndex: Integer): Boolean; + protected + procedure CheckTimeRange; virtual; + function GetDateTimeIF(const AValue, ADefaultValue: TDateTime): TDateTime; + + function DesignerTabIndex: Integer; override; + property ActiveStyle: TcxCustomSchedulerReportLinkPrintStyle read GetActiveStyle; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + + function DefaultDatePrintFrom: TDate; virtual; + function DefaultDatePrintTo: TDate; virtual; + function DefaultTimePrintFrom: TTime; virtual; + function DefaultTimePrintTo: TTime; virtual; + + property DayCount: Integer read GetDayCount; + property MonthCount: Integer read GetMonthCount; + property WeekCount: Integer read GetWeekCount; + published + property PrintFrom: TDate index 0 read GetPrintDate write SetPrintDate stored IsDateStored; + property PrintTo: TDate index 1 read GetPrintDate write SetPrintDate stored IsDateStored; + property TimePrintFrom: TTime index 0 read GetPrintTime write SetPrintTime stored IsTimeStored; + property TimePrintTo: TTime index 1 read GetPrintTime write SetPrintTime stored IsTimeStored; + end; + + { TcxSchedulerReportLinkOptionsFormatting } + + TcxSchedulerReportLinkOptionsFormatting = class(TdxCustomReportLinkOptionsFormatting) + private + FSuppressContentColoration: Boolean; + function GetReportLink: TcxSchedulerReportLink; + procedure SetSuppressContentColoration(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + + property ReportLink: TcxSchedulerReportLink read GetReportLink; + published + property SuppressContentColoration: Boolean read FSuppressContentColoration write SetSuppressContentColoration default False; + property UseLookAndFeelColors; + end; + + { TcxSchedulerReportLinkStyles } + + TcxSchedulerReportLinkStyles = class(TdxCustomReportLinkStyles, IcxSchedulerStylesAdapter, IcxSchedulerTimeRulerParams) + private + function GetExtStyles: TcxSchedulerStyles; + function GetReportLink: TcxSchedulerReportLink; + function GetUseSchedulerStyles: Boolean; + protected + FReportLink: TcxSchedulerReportLink; + function DesignerTabIndex: Integer; override; + + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + class function GetStyleCaption(AnIndex: Integer): string; override; + function GetStyleIndexByCaption(const Caption: string): Integer; override; + + // IcxSchedulerStylesAdapter + function GetDayHeaderStyle: TcxStyle; + function GetResourceHeaderStyle: TcxStyle; + + property ExtStyles: TcxSchedulerStyles read GetExtStyles; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + + function GetSchedulerHeaderParams: TcxViewParams; virtual; + function GetContentParams(const ADateTime: TDateTime; + AResource: TcxSchedulerStorageResourceItem): TcxViewParams; overload; virtual; + function GetContentParams(const ADateTime: TDateTime; ALightColor: Boolean; + AResource: TcxSchedulerStorageResourceItem): TcxViewParams; overload; virtual; + function GetDateNavigatorContentParams: TcxViewParams; virtual; + function GetDateNavigatorHeaderParams: TcxViewParams; virtual; + function GetDayHeaderParams(const ADateTime: TDateTime): TcxViewParams; virtual; + function GetEventParams(AEvent: TcxSchedulerEvent): TcxViewParams; virtual; + function GetNotesAreaBlankParams: TcxViewParams; virtual; + function GetNotesAreaLinedParams: TcxViewParams; virtual; + function GetResourceHeaderParams(AResource: TcxSchedulerStorageResourceItem): TcxViewParams; virtual; + function GetTaskPadParams: TcxViewParams; virtual; + function GetTimeRulerParams: TcxViewParams; virtual; + + property UseSchedulerStyles: Boolean read GetUseSchedulerStyles; + property ReportLink: TcxSchedulerReportLink read GetReportLink; + published + property SchedulerHeader: TcxStyle Index vspsSchedulerSchedulerHeader read GetValue write SetValue; + property Content: TcxStyle Index vspsSchedulerContent read GetValue write SetValue; + property DateNavigatorContent: TcxStyle Index vspsSchedulerDateNavigatorContent read GetValue write SetValue; + property DateNavigatorHeader: TcxStyle Index vspsSchedulerDateNavigatorHeader read GetValue write SetValue; + property DayHeader: TcxStyle Index vspsSchedulerDayHeader read GetValue write SetValue; + property Event: TcxStyle Index vspsSchedulerEvent read GetValue write SetValue; + property ResourceHeader: TcxStyle Index vspsSchedulerResourceHeader read GetValue write SetValue; + property NotesAreaBlank: TcxStyle Index vspsSchedulerNotesAreaBlank read GetValue write SetValue; + property NotesAreaLined: TcxStyle Index vspsSchedulerNotesAreaLined read GetValue write SetValue; + property TaskPad: TcxStyle Index vspsSchedulerTaskPad read GetValue write SetValue; + property TimeRuler: TcxStyle Index vspsSchedulerTimeRuler read GetValue write SetValue; + + property StyleSheet; + end; + + TcxSchedulerReportLinkStyleSheet = class(TdxCustomReportLinkStyleSheet) + private + function GetStylesValue: TcxSchedulerReportLinkStyles; + procedure SetStylesValue(Value: TcxSchedulerReportLinkStyles); + public + class function GetStylesClass: TcxCustomStylesClass; override; + published + property Styles: TcxSchedulerReportLinkStyles read GetStylesValue write SetStylesValue; + end; + + { TcxSchedulerReportLinkRenderInfo } + + TcxSchedulerReportLinkRenderInfo = class(TdxPSReportRenderInfo) + private + function GetReportLink: TcxSchedulerReportLink; + protected + Rendering: Boolean; + FPageColCount: Integer; + FPageRowCount: Integer; + procedure DoCalculate; override; + function GetPageColCount: Integer; override; + function GetPageRowCount: Integer; override; + function IsLoading: Boolean; + public + function IsDrawPageTitleOnPage(APageIndex: Integer): Boolean; override; + function IsDrawReportTitleOnPage(APageIndex: Integer): Boolean; + property ReportLink: TcxSchedulerReportLink read GetReportLink; + end; + + { TcxSchedulerReportRenderer } + + TcxSchedulerReportRenderer = class(TdxPSReportRenderer) + public + procedure PrepareRenderPage; override; + procedure UnprepareRenderPage; override; + end; + + { TcxSchedulerReportLink } + TcxSchedulerReportLinkCanPrintEventEvent = procedure(Sender: TcxSchedulerReportLink; + AEvent: TcxSchedulerEvent; var AllowPrint: Boolean) of object; + + { Initilization Events } + + TcxSchedulerReportLinkInitializeSchedulerHeaderEvent = procedure( + Sender: TcxSchedulerReportLink; AItem: TcxSchedulerReportSchedulerHeaderCell) of object; + TcxSchedulerReportLinkInitializeSchedulingAreaEvent = procedure( + Sender: TcxSchedulerReportLink; AItem: TcxSchedulerReportSchedulingAreaCell) of object; + TcxSchedulerReportLinkInitializeNotesEvent = procedure( + Sender: TcxSchedulerReportLink; AItem: TcxSchedulerReportNotesAreaCell) of object; + TcxSchedulerReportLinkInitializeTaskPadEvent = procedure( + Sender: TcxSchedulerReportLink; AItem: TcxSchedulerReportTaskPadCell) of object; + TcxSchedulerReportLinkInitializeEventCellEvent = procedure( + Sender: TcxSchedulerReportLink; AItem: TcxSchedulerReportCustomEventCell) of object; + + { CustomDraw Events } + + TcxSchedulerReportLinkCustomDrawSchedulerHeaderCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportSchedulerHeaderDataCell; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawDateNavigatorHeaderCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorHeader; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawDateNavigatorDayCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorDay; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawDateNavigatorDayCaptionCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorDayCaption; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawDateNavigatorWeekNumberCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorWeekNumber; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawTimeRulerCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportDailyTimeRulerCell; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawNotesCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportNotesDataCell; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawContentCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportContentCell; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawHeaderCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TcxSchedulerReportHeaderItemCell; var ADone: Boolean) of object; + TcxSchedulerReportLinkCustomDrawEventPartCellEvent = procedure(Sender: TcxSchedulerReportLink; + ACanvas: TCanvas; AItem: TAbstractdxReportCellData; + APart: TcxSchedulerReportEventPartType; var ADone: Boolean) of object; + + TcxSchedulerReportLink = class(TdxCustomcxControlReportLink, IdxReportLinkController) + private + FLinkInPreviewMode: Boolean; + FLookAndFeelItems: TList; + FPageSites: TList; + FPrintRange: TcxSchedulerReportLinkPrintRange; + FPrintStyles: TcxSchedulerReportLinkPrintStyles; + FTaskPadReportLink: TBasedxReportLink; + FOnActivePrintStyleChanged: TNotifyEvent; + FOnCanPrintEvent: TcxSchedulerReportLinkCanPrintEventEvent; + + FOnCustomDrawSchedulerHeaderCell: TcxSchedulerReportLinkCustomDrawSchedulerHeaderCellEvent; + FOnCustomDrawDateNavigatorHeaderCell: TcxSchedulerReportLinkCustomDrawDateNavigatorHeaderCellEvent; + FOnCustomDrawDateNavigatorDayCell: TcxSchedulerReportLinkCustomDrawDateNavigatorDayCellEvent; + FOnCustomDrawDateNavigatorDayCaptionCell: TcxSchedulerReportLinkCustomDrawDateNavigatorDayCaptionCellEvent; + FOnCustomDrawDateNavigatorWeekNumberCell: TcxSchedulerReportLinkCustomDrawDateNavigatorWeekNumberCellEvent; + FOnCustomDrawTimeRulerCell: TcxSchedulerReportLinkCustomDrawTimeRulerCellEvent; + FOnCustomDrawContentCell: TcxSchedulerReportLinkCustomDrawContentCellEvent; + FOnCustomDrawHeaderCell: TcxSchedulerReportLinkCustomDrawHeaderCellEvent; + FOnCustomDrawEventPartCell: TcxSchedulerReportLinkCustomDrawEventPartCellEvent; + FOnCustomDrawNotesCell: TcxSchedulerReportLinkCustomDrawNotesCellEvent; + FOnCustomDrawTaskPadCell: TcxSchedulerReportLinkCustomDrawNotesCellEvent; + + FOnInitializeSchedulingAreaCell: TcxSchedulerReportLinkInitializeSchedulingAreaEvent; + FOnInitializeEventCell: TcxSchedulerReportLinkInitializeEventCellEvent; + FOnInitializeHeaderPrimaryCell: TcxSchedulerReportLinkInitializeSchedulerHeaderEvent; + FOnInitializeHeaderSecondaryCell: TcxSchedulerReportLinkInitializeSchedulerHeaderEvent; + FOnInitializeNotesAreaCell: TcxSchedulerReportLinkInitializeNotesEvent; + FOnInitializeTaskPadCell: TcxSchedulerReportLinkInitializeTaskPadEvent; + function GetActiveStyles: TcxSchedulerReportLinkStyles; + function GetDesignWindow: TcxfmSchedulerReportLinkDesignWindow; + function GetEdgeMode: TdxCellEdgeMode; + function GetLookAndFeelItem(Index: Integer): TdxReportVisualItem; + function GetLookAndFeelItemCount: Integer; + function GetOptionsFormatting: TcxSchedulerReportLinkOptionsFormatting; + function GetPrintStyles: TcxSchedulerReportLinkPrintStyles; + function GetRenderInfo: TcxSchedulerReportLinkRenderInfo; + function GetScheduler: TcxScheduler; + function GetStyles: TcxSchedulerReportLinkStyles; + procedure SetOptionsFormatting(Value: TcxSchedulerReportLinkOptionsFormatting); + procedure SetPrintRange(Value: TcxSchedulerReportLinkPrintRange); + procedure SetPrintStyles(Value: TcxSchedulerReportLinkPrintStyles); + procedure SetStyles(Value: TcxSchedulerReportLinkStyles); + procedure SetTaskPadReportLink(Value: TBasedxReportLink); + + protected + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + { IdxReportLinkController } + function GetControlSiteBounds(AControl: TControl): TRect; virtual; + + procedure ConstructReport(AReportCells: TdxReportCells); override; + procedure DoCreateReport; override; + + procedure CustomDraw(AItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); override; + + procedure DoCanPrintEvent(AEvent: TcxSchedulerEvent; var AllowPrint: Boolean); virtual; + + procedure DoCustomDrawSchedulerHeaderCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportSchedulerHeaderDataCell; var ADone: Boolean); virtual; + procedure DoCustomDrawDateNavigatorHeaderCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportDateNavigatorHeader; var ADone: Boolean); virtual; + procedure DoCustomDrawDateNavigatorDayCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportDateNavigatorDay; var ADone: Boolean); virtual; + procedure DoCustomDrawDateNavigatorDayCaptionCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportDateNavigatorDayCaption; var ADone: Boolean); virtual; + procedure DoCustomDrawDateNavigatorWeekNumberCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportDateNavigatorWeekNumber; var ADone: Boolean); virtual; + procedure DoCustomDrawTimeRulerCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportDailyTimeRulerCell; var ADone: Boolean); virtual; + procedure DoCustomDrawContentCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportContentCell; var ADone: Boolean); virtual; + procedure DoCustomDrawHeaderCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportHeaderItemCell; var ADone: Boolean); virtual; + procedure DoCustomDrawEventPartCell(ACanvas: TCanvas; + AItem: TAbstractdxReportCellData; var ADone: Boolean); virtual; + procedure DoCustomDrawNotesCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportNotesDataCell; var ADone: Boolean); virtual; + procedure DoCustomDrawTaskPadCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportNotesDataCell; var ADone: Boolean); virtual; + + function GetRealScaleFactor: Integer; override; + function GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; override; + function GetRendererClass: TdxPSReportRendererClass; override; + function GetRenderInfoClass: TdxPSReportRenderInfoClass; override; + procedure InternalRestoreDefaults; override; + procedure InternalRestoreFromOriginal; override; + procedure PrepareConstruct; override; + procedure UnprepareConstruct; override; + + procedure CreateOptions; override; + procedure DestroyOptions; override; + function GetOptionsFormattingClass: TdxCustomReportLinkOptionsFormattingClass; override; + + function CreatePrintRange: TcxSchedulerReportLinkPrintRange; virtual; + function CreatePrintStyles: TcxSchedulerReportLinkPrintStyles; virtual; + + function GetAreNativeStylesAvailable: Boolean; override; + function GetStylesClass: TdxCustomReportLinkStylesClass; override; + function GetStyleSheetClass: TdxCustomReportLinkStyleSheetClass; override; + function GetStyleSheetPrototype: TdxCustomReportLinkStyleSheet; override; + + procedure ActivePrintStyleChanged; virtual; + procedure DoActivePrintStyleChanged; virtual; + + procedure FormatLookAndFeelItems; + procedure RegisterLookAndFeelItem(AItem: TdxReportVisualItem; AEdgeStyle: TdxCellEdgeStyle); + + procedure DoInitializeSchedulingAreaCell(AItem: TcxSchedulerReportSchedulingAreaCell); virtual; + procedure DoInitializeEventCell(AItem: TcxSchedulerReportCustomEventCell); virtual; + procedure DoInitializeHeaderPrimaryCell(AItem: TcxSchedulerReportSchedulerHeaderCell); virtual; + procedure DoInitializeHeaderSecondaryCell(AItem: TcxSchedulerReportSchedulerHeaderCell); virtual; + procedure DoInitializeNotesAreaCell(AItem: TcxSchedulerReportNotesAreaCell); virtual; + procedure DoInitializeTaskPadCell(AItem: TcxSchedulerReportTaskPadCell); virtual; + + procedure AssignTaskPadData(ATaskPad: TcxSchedulerReportTaskPadCell); + procedure InitializeTaskPadCell(ATaskPad: TcxSchedulerReportTaskPadCell); virtual; + + procedure SetCellViewParams(ACell: TdxReportVisualItem; const AParams: TcxViewParams); overload; + procedure SetCellViewParams(ACell: TdxReportVisualItem; const AParams: TdxReportItemViewParams); overload; + + function AddPageSite(const ABounds: TRect): TcxSchedulerReportPageSite; + procedure BuildStyle; virtual; + + property ActiveStyles: TcxSchedulerReportLinkStyles read GetActiveStyles; + + property EdgeMode: TdxCellEdgeMode read GetEdgeMode; + property LinkInPreviewMode: Boolean read FLinkInPreviewMode write FLinkInPreviewMode; + property LookAndFeelItemCount: Integer read GetLookAndFeelItemCount; + property LookAndFeelItems[Index: Integer]: TdxReportVisualItem read GetLookAndFeelItem; + property PageSites: TList read FPageSites; + property RenderInfo: TcxSchedulerReportLinkRenderInfo read GetRenderInfo; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + class function Aggregable: Boolean; override; + procedure RebuildReport; override; + + property DesignWindow: TcxfmSchedulerReportLinkDesignWindow read GetDesignWindow; + property Scheduler: TcxScheduler read GetScheduler; + + published + property Color; + property Font; + + property OptionsFormatting: TcxSchedulerReportLinkOptionsFormatting read GetOptionsFormatting write SetOptionsFormatting; + property PrintRange: TcxSchedulerReportLinkPrintRange read FPrintRange write SetPrintRange; + property PrintStyles: TcxSchedulerReportLinkPrintStyles read GetPrintStyles write SetPrintStyles; + property ScaleFonts; + property StyleRepository; + property Styles: TcxSchedulerReportLinkStyles read GetStyles write SetStyles; + property SupportedCustomDraw; + property TaskPadReportLink: TBasedxReportLink read FTaskPadReportLink write SetTaskPadReportLink; + + property OnActivePrintStyleChanged: TNotifyEvent read FOnActivePrintStyleChanged write FOnActivePrintStyleChanged; + property OnCanPrintEvent: TcxSchedulerReportLinkCanPrintEventEvent read FOnCanPrintEvent write FOnCanPrintEvent; + + property OnCustomDrawSchedulerHeaderCell: TcxSchedulerReportLinkCustomDrawSchedulerHeaderCellEvent + read FOnCustomDrawSchedulerHeaderCell write FOnCustomDrawSchedulerHeaderCell; + property OnCustomDrawDateNavigatorHeaderCell: TcxSchedulerReportLinkCustomDrawDateNavigatorHeaderCellEvent + read FOnCustomDrawDateNavigatorHeaderCell write FOnCustomDrawDateNavigatorHeaderCell; + property OnCustomDrawDateNavigatorDayCell: TcxSchedulerReportLinkCustomDrawDateNavigatorDayCellEvent + read FOnCustomDrawDateNavigatorDayCell write FOnCustomDrawDateNavigatorDayCell; + property OnCustomDrawDateNavigatorDayCaptionCell: TcxSchedulerReportLinkCustomDrawDateNavigatorDayCaptionCellEvent + read FOnCustomDrawDateNavigatorDayCaptionCell write FOnCustomDrawDateNavigatorDayCaptionCell; + property OnCustomDrawDateNavigatorWeekNumberCell: TcxSchedulerReportLinkCustomDrawDateNavigatorWeekNumberCellEvent + read FOnCustomDrawDateNavigatorWeekNumberCell write FOnCustomDrawDateNavigatorWeekNumberCell; + property OnCustomDrawTimeRulerCell: TcxSchedulerReportLinkCustomDrawTimeRulerCellEvent + read FOnCustomDrawTimeRulerCell write FOnCustomDrawTimeRulerCell; + property OnCustomDrawContentCell: TcxSchedulerReportLinkCustomDrawContentCellEvent + read FOnCustomDrawContentCell write FOnCustomDrawContentCell; + property OnCustomDrawHeaderCell: TcxSchedulerReportLinkCustomDrawHeaderCellEvent + read FOnCustomDrawHeaderCell write FOnCustomDrawHeaderCell; + property OnCustomDrawEventPartCell: TcxSchedulerReportLinkCustomDrawEventPartCellEvent + read FOnCustomDrawEventPartCell write FOnCustomDrawEventPartCell; + property OnCustomDrawNotesCell: TcxSchedulerReportLinkCustomDrawNotesCellEvent + read FOnCustomDrawNotesCell write FOnCustomDrawNotesCell; + property OnCustomDrawTaskPadCell: TcxSchedulerReportLinkCustomDrawNotesCellEvent + read FOnCustomDrawTaskPadCell write FOnCustomDrawTaskPadCell; + + property OnInitializeSchedulingAreaCell: TcxSchedulerReportLinkInitializeSchedulingAreaEvent + read FOnInitializeSchedulingAreaCell write FOnInitializeSchedulingAreaCell; + property OnInitializeEventCell: TcxSchedulerReportLinkInitializeEventCellEvent + read FOnInitializeEventCell write FOnInitializeEventCell; + property OnInitializeHeaderPrimaryCell: TcxSchedulerReportLinkInitializeSchedulerHeaderEvent + read FOnInitializeHeaderPrimaryCell write FOnInitializeHeaderPrimaryCell; + property OnInitializeHeaderSecondaryCell: TcxSchedulerReportLinkInitializeSchedulerHeaderEvent + read FOnInitializeHeaderSecondaryCell write FOnInitializeHeaderSecondaryCell; + property OnInitializeNotesAreaCell: TcxSchedulerReportLinkInitializeNotesEvent + read FOnInitializeNotesAreaCell write FOnInitializeNotesAreaCell; + property OnInitializeTaskPadCell: TcxSchedulerReportLinkInitializeTaskPadEvent + read FOnInitializeTaskPadCell write FOnInitializeTaskPadCell; + end; + + { TcxCustomSchedulerReportLinkPrintStyle } + + TcxSchedulerReportLinkPeriodicPrintStyleLayout = (pslOnePage, pslTwoPages); + + TcxCustomSchedulerReportLinkPrintStyle = class(TPersistent, + IUnknown, IdxPSCellParams, IdxPSCellParams2) + private + FBoldedDays: TcxSchedulerDateList; + FCaption: string; + FCompressWeekends: Boolean; + FDontPrintWeekends: Boolean; + FEvents: TcxSchedulerCachedEventList; + FLayout: TcxSchedulerReportLinkPeriodicPrintStyleLayout; + FPagesPerPeriod: Integer; + FResourceCountPerPage: Integer; + FShowNotesAreaBlank: Boolean; + FShowNotesAreaLined: Boolean; + FShowTaskPad: Boolean; + FStyles: TcxSchedulerReportLinkPrintStyles; + FUsedDays: TcxSchedulerDateList; + function GetActive: Boolean; + function GetHasAdditionalArea: Boolean; + function GetIndex: Integer; + function GetPageSite(AIndex: Integer): TcxSchedulerReportPageSite; + function GetPeriodCount: Integer; + function GetPrintRange: TcxSchedulerReportLinkPrintRange; + function GetReportLink: TcxSchedulerReportLink; + function GetResourceCount: Integer; + function GetScheduler: TcxScheduler; + function GetStorage: TcxCustomSchedulerStorage; + function GetTimePrintFrom: TTime; + function GetTimePrintTo: TTime; + function GetVisualStyles: TcxSchedulerReportLinkStyles; + function IsCaptionStored: Boolean; + function IsLayoutStored: Boolean; + function IsShowNotesAreaBlankStored: Boolean; + function IsActiveStored: Boolean; + procedure SetActive(Value: Boolean); + procedure SetCaption(const Value: string); + procedure SetCompressWeekends(Value: Boolean); + procedure SetDontPrintWeekends(Value: Boolean); + procedure SetLayout(Value: TcxSchedulerReportLinkPeriodicPrintStyleLayout); + procedure SetResourceCountPerPage(Value: Integer); + procedure SetShowNotesAreaBlank(Value: Boolean); + procedure SetShowNotesAreaLined(Value: Boolean); + procedure SetShowTaskPad(Value: Boolean); + procedure SetTimePrintFrom(Value: TTime); + procedure SetTimePrintTo(Value: TTime); + protected + CurrentDate: TDateTime; + { IUnknown } + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + { IdxReportLinkController } + function GetControlSiteBounds(AControl: TControl): TRect; virtual; + { IdxPSCellParams } + function IdxPSCellParams.GetAutoHeight = IdxPSCellParams_GetAutoHeight; + function IdxPSCellParams.GetDC = IdxPSCellParams_GetDC; + function IdxPSCellParams.GetDisplayGraphicsAsText = IdxPSCellParams_GetDisplayGraphicsAsText; + function IdxPSCellParams.GetEndEllipsis = IdxPSCellParams_GetEndEllipsis; + function IdxPSCellParams.GetFlatCheckMarks = IdxPSCellParams_GetFlatCheckMarks; + function IdxPSCellParams.GetGraphicsText = IdxPSCellParams_GetGraphicsText; + function IdxPSCellParams.GetMultiline = IdxPSCellParams_GetMultiline; + function IdxPSCellParams.GetTransparentGraphics = IdxPSCellParams_GetTransparentGraphics; + function IdxPSCellParams_GetAutoHeight: Boolean; virtual; + function IdxPSCellParams_GetDC: HDC; virtual; + function IdxPSCellParams_GetDisplayGraphicsAsText: Boolean; virtual; + function IdxPSCellParams_GetEndEllipsis: Boolean; virtual; + function IdxPSCellParams_GetFlatCheckMarks: Boolean; virtual; + function IdxPSCellParams_GetGraphicsText: string; virtual; + function IdxPSCellParams_GetMultiline: Boolean; virtual; + function IdxPSCellParams_GetTransparentGraphics: Boolean; virtual; + { IdxPSCellParams2 } + function IdxPSCellParams2.GetPreviewMarginLeft = IdxPSCellParams2_GetPreviewMarginLeft; + function IdxPSCellParams2.GetPreviewMarginRight = IdxPSCellParams2_GetPreviewMarginRight; + function IdxPSCellParams2.GetPreviewMaxHeight = IdxPSCellParams2_GetPreviewMaxHeight; + function IdxPSCellParams2.GetPreviewMaxLineCount = IdxPSCellParams2_GetPreviewMaxLineCount; + function IdxPSCellParams2.GetRichEditGraphicClass = IdxPSCellParams2_GetRichEditGraphicClass; + function IdxPSCellParams2.GetRichEditTransparent = IdxPSCellParams2_GetRichEditTransparent; + function IdxPSCellParams2_GetPreviewMarginLeft: Integer; virtual; + function IdxPSCellParams2_GetPreviewMarginRight: Integer; virtual; + function IdxPSCellParams2_GetPreviewMaxHeight: Integer; virtual; + function IdxPSCellParams2_GetPreviewMaxLineCount: Integer; virtual; + function IdxPSCellParams2_GetRichEditGraphicClass: TGraphicClass; virtual; + function IdxPSCellParams2_GetRichEditTransparent: Boolean; virtual; + + // + function AddPageSite(const ABounds: TRect): TcxSchedulerReportPageSite; virtual; + + procedure AfterBuild; virtual; + procedure BeforeBuild; virtual; + procedure Build; virtual; + procedure BuildPages; virtual; + procedure BuildSchedulerCells(ASite: TcxSchedulerReportSchedulingAreaCell); virtual; + procedure Progress(APercentDone: Double); virtual; + + procedure PrepareEvents; virtual; + procedure DoCanPrintEvent(AEvent: TcxSchedulerEvent; var AllowPrint: Boolean); virtual; + + procedure Changed; virtual; + procedure CreateObjects; virtual; + procedure DestroyObjects; virtual; + function GetPageCount: Integer; virtual; + + function GetRebuildOnPageParamsChange(AnUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; virtual; + + function GetActualDatePrintFrom: TDate; virtual; + function GetActualDatePrintTo: TDate; virtual; + function GetCorrespondedView: TcxSchedulerCustomResourceView; virtual; + function GetPagesPerPeriod: Integer; virtual; + + function GetGlyphIndex: Integer; virtual; + function GetPreviewGlyphIndex: Integer; virtual; + function GetSchedulerHeaderParams: TdxReportItemViewParams; virtual; + + procedure DrawDesignWindowPreview(ACanvas: TCanvas; const ABounds: TRect); + // actually option state + function GetResourcePageCount: Integer; virtual; + function GetShowDateNavigator(APageIndex: Integer): Boolean; virtual; + function GetShowNotesAreaBlank: Boolean; virtual; + + procedure SetBoolOption(var AOption: Boolean; Value: Boolean); + function SupportTimeRange: Boolean; virtual; + // draw options + function SupportIcons: Boolean; virtual; + function SupportMessage: Boolean; virtual; + + // report cells creation + function CreateDateNavigatorCell(ASite: TdxReportCell; AYear, AMonth: Word): TcxSchedulerReportDateNavigatorCell; virtual; + function CreateHeaderCell(ASite: TdxReportCell): TcxSchedulerReportSchedulerHeaderCell; virtual; + function CreateNotesCell(ASite: TdxReportCell): TcxSchedulerReportNotesAreaCell; virtual; + function CreateNotesLinedCell(ASite: TdxReportCell): TcxSchedulerReportNotesAreaCell; virtual; + function CreateSchedulingAreaCell(ASite: TdxReportCell): TcxSchedulerReportSchedulingAreaCell; virtual; + function CreateSchedulingCellsProducer(ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; virtual; + function CreateTaskPadCell(ASite: TdxReportCell): TcxSchedulerReportTaskPadCell; virtual; + + procedure InitHeaderCell(ACell: TcxSchedulerReportSchedulerHeaderCell); virtual; + function InitReportCell(ACell: TdxReportCell; const ABounds: TRect): TdxReportCell; + + procedure CorrectBoundsWithHeader(AHeader: TcxSchedulerReportSchedulerHeaderCell; var ABounds: TRect); + procedure CreateAdditionalControls(ASite: TdxReportCell; AHasCalendar, + AHasTaskPad, AHasNotes, AHasNotesLined, ARightSide: Boolean; var ABounds: TRect); virtual; + + procedure CreateControlsOnFirstPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); virtual; + procedure CreateControlsOnSecondPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); virtual; + procedure CreateHeaderDateNavigator(AHeader: TcxSchedulerReportSchedulerHeaderCell; APageIndex: Integer; out ABounds: TRect); virtual; + procedure CreateLayoutForPeriod(APeriodIndex: Integer); virtual; + procedure CreatePageSiteWithHeader(APageIndex: Integer; + out ASite: TcxSchedulerReportPageSite; out AHeader: TcxSchedulerReportSchedulerHeaderCell; + out ABounds: TRect; AIsPrimary: Boolean = True); + // items visibility + function CanSplitSchedulingOnTwoPages: Boolean; virtual; + function GetHasPageHeader(APageIndex: Integer): Boolean; virtual; + function GetHasPageReportTitle(APageIndex: Integer): Boolean; virtual; + function GetPageHeaderHeight(const ASiteBounds: TRect; APageIndex: Integer): Integer; + function GetPageIndex(APeriodIndex, AIndex: Integer): Integer; + procedure GetPagePeriodAndIndex(APageIndex: Integer; var APeriodIndex, ASubIndex: Integer); + function GetPageSiteBounds(APageIndex: Integer): TRect; virtual; + function GetStartOfWeekOffset: Integer; virtual; + // extracting events and dates for period + procedure GetPageDateNavigatorInfo( + APageIndex: Integer; out AYear, AMonth: Word); virtual; + function GetDaysPerPeriod: Integer; virtual; + procedure FillDatesForPage(ADateList: TcxSchedulerDateList; + APageIndex, APeriodIndex, ASubIndex: Integer); virtual; + + property CompressWeekends: Boolean read FCompressWeekends write SetCompressWeekends default True; + property DontPrintWeekends: Boolean read FDontPrintWeekends write SetDontPrintWeekends default False; + property Events: TcxSchedulerCachedEventList read FEvents; + property GlyphIndex: Integer read GetGlyphIndex; + property Layout: TcxSchedulerReportLinkPeriodicPrintStyleLayout read FLayout write SetLayout stored IsLayoutStored; + property PagesPerPeriod: Integer read FPagesPerPeriod; + property PageSites[Index: Integer]: TcxSchedulerReportPageSite read GetPageSite; + property PreviewGlyphIndex: Integer read GetPreviewGlyphIndex; + property PrintRange: TcxSchedulerReportLinkPrintRange read GetPrintRange; + property ResourceCount: Integer read GetResourceCount; + property ResourceCountPerPage: Integer read FResourceCountPerPage write SetResourceCountPerPage default 0; + property ShowNotesAreaBlank: Boolean read GetShowNotesAreaBlank write SetShowNotesAreaBlank stored IsShowNotesAreaBlankStored; + property ShowNotesAreaLined: Boolean read FShowNotesAreaLined write SetShowNotesAreaLined default False; + property ShowTaskPad: Boolean read FShowTaskPad write SetShowTaskPad default False; + property StartOfWeekOffset: Integer read GetStartOfWeekOffset; + property Storage: TcxCustomSchedulerStorage read GetStorage; + property TimePrintFrom: TTime read GetTimePrintFrom write SetTimePrintFrom stored False; + property TimePrintTo: TTime read GetTimePrintTo write SetTimePrintTo stored False; + property UsedDays: TcxSchedulerDateList read FUsedDays; + public + constructor Create(AStyles: TcxSchedulerReportLinkPrintStyles); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + function DefaultCaption: string; virtual; + function IsCompatibleWith(AView: TcxSchedulerCustomView): Boolean; virtual; + procedure RestoreDefaults; virtual; + + property ActualDatePrintFrom: TDate read GetActualDatePrintFrom; + property ActualDatePrintTo: TDate read GetActualDatePrintTo; + property CorrespondedView: TcxSchedulerCustomResourceView read GetCorrespondedView; + property HasAdditionalArea: Boolean read GetHasAdditionalArea; + property Index: Integer read GetIndex; + property PageCount: Integer read GetPageCount; + property PeriodCount: Integer read GetPeriodCount; + property ReportLink: TcxSchedulerReportLink read GetReportLink; + property Scheduler: TcxScheduler read GetScheduler; + property Styles: TcxSchedulerReportLinkPrintStyles read FStyles; + property VisualStyles: TcxSchedulerReportLinkStyles read GetVisualStyles; + published + property Active: Boolean read GetActive write SetActive stored IsActiveStored; + property Caption: string read FCaption write SetCaption stored IsCaptionStored; + end; + + { TcxSchedulerReportLinkDailyPrintStyle } + + TcxSchedulerReportLinkDailyPrintStyle = class(TcxCustomSchedulerReportLinkPrintStyle) + private + FCurrentPagePerDate: Integer; + protected + procedure BeforeBuild; override; + function CanSplitSchedulingOnTwoPages: Boolean; override; + procedure CreateControlsOnFirstPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + procedure CreateControlsOnSecondPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + function CreateSchedulingCellsProducer(ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; override; + procedure FillDatesForPage(ADateList: TcxSchedulerDateList; + APageIndex, APeriodIndex, ASubIndex: Integer); override; + function GetCorrespondedView: TcxSchedulerCustomResourceView; override; + function GetGlyphIndex: Integer; override; + function GetPageCount: Integer; override; + function GetPagesPerPeriod: Integer; override; + function GetShowNotesAreaBlank: Boolean; override; + procedure InitHeaderCell(ACell: TcxSchedulerReportSchedulerHeaderCell); override; + function SupportIcons: Boolean; override; + function SupportMessage: Boolean; override; + function SupportTimeRange: Boolean; override; + public + function DefaultCaption: string; override; + function IsCompatibleWith(AView: TcxSchedulerCustomView): Boolean; override; + published + property Active; + property Caption; + property Layout; + property ResourceCountPerPage; + property ShowNotesAreaBlank; + property ShowNotesAreaLined; + property ShowTaskPad; + end; + + { TcxSchedulerReportLinkCustomDetailsPrintStyle } + + TcxSchedulerReportLinkCustomDetailsPrintStyle = class(TcxCustomSchedulerReportLinkPrintStyle) + private + FTimeWidth: Integer; + function GetPageWidth: Integer; + protected + BuildedPageCount: Integer; + CellsOnPage: Integer; + CurrentPage: TcxSchedulerReportPageSite; + function AddPageSite(const ABounds: TRect): TcxSchedulerReportPageSite; override; + procedure BeforeBuild; override; + function GetNextPage(APrevPage: TcxSchedulerReportPageSite; out ABounds: TRect): TcxSchedulerReportPageSite; + function GetPageCount: Integer; override; + function MeasureTimeWidth: Integer; virtual; + + property PageWidth: Integer read GetPageWidth; + property TimeWidth: Integer read FTimeWidth; + end; + + { TcxSchedulerReportLinkDetailsPrintStyle } + + TcxSchedulerReportLinkDetailsPrintStylePaginationMode = (dpmByDay, dpmByWeek, dpmByMonth); + + TcxSchedulerReportLinkDetailsPrintStyle = class(TcxSchedulerReportLinkCustomDetailsPrintStyle) + private + FPaginationMode: TcxSchedulerReportLinkDetailsPrintStylePaginationMode; + FUsePagination: Boolean; + procedure SetPaginationMode(Value: TcxSchedulerReportLinkDetailsPrintStylePaginationMode); + procedure SetUsePagination(Value: Boolean); + protected + EventIndex, DayIndex: Integer; + CurrentCell: TcxSchedulerReportDetailsEventCell; + CurrentPageBounds: TRect; + PreviousHeader: TcxSchedulerReportSchedulerHeaderCell; + Site: TcxSchedulerReportPageSite; + function AddDayHeader(ADate: TDateTime; AContinue: Boolean; + var ABounds: TRect): TcxSchedulerReportSchedulerHeaderCell; + procedure BeforeBuild; override; + procedure BuildPages; override; + function GetDayHeaderHeight: Integer; virtual; + function GetDayHeaderText(AContinue: Boolean): string; virtual; + function GetGlyphIndex: Integer; override; + function GetPreviewGlyphIndex: Integer; override; + function GetSchedulerHeaderParams: TdxReportItemViewParams; override; + + // layout calculation + function AddEventCell(AEvent: TcxSchedulerEvent): TcxSchedulerReportDetailsEventCell; virtual; + procedure CheckPagination; + procedure HeaderNeeded; virtual; + function NeedAddDayHeader: Boolean; + function MeasureCellBounds: TRect; virtual; + procedure PrepareNextPage; + procedure SetCellPlace; + + property DayHeaderHeight: Integer read GetDayHeaderHeight; + public + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; override; + procedure RestoreDefaults; override; + published + property Active; + property Caption; + property PaginationMode: TcxSchedulerReportLinkDetailsPrintStylePaginationMode read FPaginationMode write SetPaginationMode default dpmByDay; + property UsePagination: Boolean read FUsePagination write SetUsePagination default False; + end; + + { TcxSchedulerReportLinkMemoPrintStyle } + + TcxSchedulerReportLinkMemoPrintStyle = class(TcxSchedulerReportLinkCustomDetailsPrintStyle) + private + FSelectedEventsOnly: Boolean; + FStartEachItemOnNewPage: Boolean; + protected + Site: TdxReportCell; + function AddEventCell(AEvent: TcxSchedulerEvent): TcxSchedulerReportDetailsEventCell; virtual; + procedure BuildPages; override; + procedure DoCanPrintEvent(AEvent: TcxSchedulerEvent; var AllowPrint: Boolean); override; + function GetGlyphIndex: Integer; override; + function GetPreviewGlyphIndex: Integer; override; + function MeasureTimeWidth: Integer; override; + public + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; override; + procedure RestoreDefaults; override; + published + property Active; + property Caption; + property SelectedEventsOnly: Boolean read FSelectedEventsOnly write FSelectedEventsOnly default True; + property StartEachItemOnNewPage: Boolean read FStartEachItemOnNewPage write FStartEachItemOnNewPage default True; + end; + + { TcxSchedulerReportLinkMonthlyPrintStyle } + + TcxSchedulerReportLinkMonthlyPrintStyle = class(TcxCustomSchedulerReportLinkPrintStyle) + private + FPrintExactlyOneMonthPerPage: Boolean; + procedure SetPrintExactlyOneMonthPerPage(Value: Boolean); + protected + procedure CreateControlsOnFirstPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + procedure CreateControlsOnSecondPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + procedure FillDatesForPage(ADateList: TcxSchedulerDateList; + APageIndex, APeriodIndex, ASubIndex: Integer); override; + function GetCorrespondedView: TcxSchedulerCustomResourceView; override; + function GetDateForPage(APageIndex: Integer): TDateTime; + function GetDaysPerPeriod: Integer; override; + function GetGlyphIndex: Integer; override; + function GetPageCount: Integer; override; + procedure InitHeaderCell(ACell: TcxSchedulerReportSchedulerHeaderCell); override; + public + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; override; + function IsCompatibleWith(AView: TcxSchedulerCustomView): Boolean; override; + procedure RestoreDefaults; override; + published + property Active; + property Caption; + property DontPrintWeekends; + property Layout; + property PrintExactlyOneMonthPerPage: Boolean read FPrintExactlyOneMonthPerPage write SetPrintExactlyOneMonthPerPage default False; + property ResourceCountPerPage; + property ShowNotesAreaBlank; + property ShowNotesAreaLined; + property ShowTaskPad; + end; + + { TcxSchedulerReportLinkTrifoldPrintStyle } + + TcxSchedulerReportLinkTrifoldPrintStyleSectionMode = (smDailyCalendar, smWeeklyCalendar, + smMonthlyCalendar, smTaskPad, smNotesAreaBlank, smNotesAreaLined); + + TcxSchedulerReportLinkTrifoldPrintStyle = class(TcxCustomSchedulerReportLinkPrintStyle) + private + FSections: array[0..2] of TcxSchedulerReportLinkTrifoldPrintStyleSectionMode; + function GetSection(Index: Integer): TcxSchedulerReportLinkTrifoldPrintStyleSectionMode; + procedure SetSection(Index: Integer; AValue: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode); + function IsSectionStored(Index: Integer): Boolean; + protected + FCurrentSection: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode; + FCurrentSchedulingArea: TcxSchedulerReportSchedulingAreaCell; + FPageRange: Byte; + procedure CreateLayoutForPeriod(APeriodIndex: Integer); override; + procedure CreateLayoutForSection(ASite: TdxReportCell; APeriodIndex: Integer; const ABounds: TRect; + ASection: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode); virtual; + procedure CreateSchedulingAreaWithHeader(ASite: TdxReportCell; ABounds: TRect); virtual; + function CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; override; + procedure FillDatesForPage(ADateList: TcxSchedulerDateList; + APageIndex, APeriodIndex, ASubIndex: Integer); override; + function GetCorrespondedView: TcxSchedulerCustomResourceView; override; + function GetGlyphIndex: Integer; override; + function GetPageCount: Integer; override; + procedure InitHeaderCell(ACell: TcxSchedulerReportSchedulerHeaderCell); override; + public + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; override; + procedure RestoreDefaults; override; + published + property Active; + property Caption; + property LeftSection: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode index 0 read GetSection write SetSection stored IsSectionStored; + property MiddleSection: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode index 1 read GetSection write SetSection stored IsSectionStored; + property RightSection: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode index 2 read GetSection write SetSection stored IsSectionStored; + end; + + { TcxSchedulerReportLinkWeeklyPrintStyle } + + TcxSchedulerReportLinkWeeklyPrintStyleArrange = (wsaTopToBottom, wsaLeftToRight); + + TcxSchedulerReportLinkWeeklyPrintStyle = class(TcxCustomSchedulerReportLinkPrintStyle) + private + FArrange: TcxSchedulerReportLinkWeeklyPrintStyleArrange; + function IsArrangeStored: Boolean; + procedure SetArrange(Value: TcxSchedulerReportLinkWeeklyPrintStyleArrange); + protected + procedure CreateControlsOnFirstPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + procedure CreateControlsOnSecondPage(APageIndex: Integer; + ASite, AHeader: TdxReportCell; ABounds: TRect); override; + function CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; override; + procedure FillDatesForPage(ADateList: TcxSchedulerDateList; + APageIndex, APeriodIndex, ASubIndex: Integer); override; + function GetCorrespondedView: TcxSchedulerCustomResourceView; override; + function GetGlyphIndex: Integer; override; + function GetDateForPage(APageIndex: Integer): TDateTime; + function GetDaysPerPeriod: Integer; override; + function GetPageCount: Integer; override; + function GetStartOfWeekOffset: Integer; override; + procedure InitHeaderCell(ACell: TcxSchedulerReportSchedulerHeaderCell); override; + function CanDontPrintWeekends: Boolean; virtual; + function SupportTimeRange: Boolean; override; + public + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; override; + function IsCompatibleWith(AView: TcxSchedulerCustomView): Boolean; override; + procedure RestoreDefaults; override; + published + property Active; + property Arrange: TcxSchedulerReportLinkWeeklyPrintStyleArrange read FArrange write SetArrange stored IsArrangeStored; + property Caption; + property DontPrintWeekends; + property Layout; + property ResourceCountPerPage; + property ShowNotesAreaBlank; + property ShowNotesAreaLined; + property ShowTaskPad; + end; + + { TcxSchedulerReportLinkPrintStyles } + + TcxSchedulerReportLinkPrintStyles = class(TcxCustomSchedulerReportLinkOptions) + private + FActiveStyle: TcxCustomSchedulerReportLinkPrintStyle; + FActiveStyleAssigned: Boolean; + FItems: TList; + function GetCount: Integer; + function GetItem(Index: Integer): TcxCustomSchedulerReportLinkPrintStyle; + function GetStyleDaily: TcxSchedulerReportLinkDailyPrintStyle; + function GetStyleDetails: TcxSchedulerReportLinkDetailsPrintStyle; + function GetStyleMemo: TcxSchedulerReportLinkMemoPrintStyle; + function GetStyleMonthly: TcxSchedulerReportLinkMonthlyPrintStyle; + function GetStyleTrifold: TcxSchedulerReportLinkTrifoldPrintStyle; + function GetStyleWeekly: TcxSchedulerReportLinkWeeklyPrintStyle; + procedure SetActiveStyle(Value: TcxCustomSchedulerReportLinkPrintStyle); + procedure SetActiveStyleAssigned(Value: Boolean); + procedure SetItem(Index: Integer; Value: TcxCustomSchedulerReportLinkPrintStyle); + procedure SetStyleDaily(Value: TcxSchedulerReportLinkDailyPrintStyle); + procedure SetStyleDetails(Value: TcxSchedulerReportLinkDetailsPrintStyle); + procedure SetStyleMemo(Value: TcxSchedulerReportLinkMemoPrintStyle); + procedure SetStyleMonthly(Value: TcxSchedulerReportLinkMonthlyPrintStyle); + procedure SetStyleTrifold(Value: TcxSchedulerReportLinkTrifoldPrintStyle); + procedure SetStyleWeekly(Value: TcxSchedulerReportLinkWeeklyPrintStyle); + protected + procedure CreateObjects; override; + procedure DestroyObjects; override; + + { IdxReportLinkOptionsDesignerSupport } + + function DesignerTabIndex: Integer; override; + + function CreateStyle(AStyleClass: TcxCustomSchedulerReportLinkPrintStyleClass): TcxCustomSchedulerReportLinkPrintStyle; virtual; + procedure CreateStyles; virtual; + procedure DestroyStyles; virtual; + procedure GetStyleByClassEx(AClass: TcxCustomSchedulerReportLinkPrintStyleClass; var AInstance); + procedure SetActiveStyleEx(Value: TcxCustomSchedulerReportLinkPrintStyle); + + procedure ActiveStyleChanged; virtual; + procedure StyleChanged(AStyle: TcxCustomSchedulerReportLinkPrintStyle); virtual; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + + function GetCorrespondingStyle: TcxCustomSchedulerReportLinkPrintStyle; virtual; + function GetStyleByClass(AClass: TcxCustomSchedulerReportLinkPrintStyleClass): TcxCustomSchedulerReportLinkPrintStyle; + function GetStyleByName(const Name: string): TcxCustomSchedulerReportLinkPrintStyle; + function GetStyleByView(View: TcxSchedulerCustomView): TcxCustomSchedulerReportLinkPrintStyle; + + function IndexOf(AItem: TcxCustomSchedulerReportLinkPrintStyle): Integer; + + property ActiveStyle: TcxCustomSchedulerReportLinkPrintStyle read FActiveStyle write SetActiveStyle stored False; + property ActiveStyleAssigned: Boolean read FActiveStyleAssigned write SetActiveStyleAssigned; + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxCustomSchedulerReportLinkPrintStyle read GetItem write SetItem; default; + published + property Daily: TcxSchedulerReportLinkDailyPrintStyle read GetStyleDaily write SetStyleDaily; + property Details: TcxSchedulerReportLinkDetailsPrintStyle read GetStyleDetails write SetStyleDetails; + property Memo: TcxSchedulerReportLinkMemoPrintStyle read GetStyleMemo write SetStyleMemo; + property Monthly: TcxSchedulerReportLinkMonthlyPrintStyle read GetStyleMonthly write SetStyleMonthly; + property Trifold: TcxSchedulerReportLinkTrifoldPrintStyle read GetStyleTrifold write SetStyleTrifold; + property Weekly: TcxSchedulerReportLinkWeeklyPrintStyle read GetStyleWeekly write SetStyleWeekly; + end; + + { DesignWindow } + + TcxfmSchedulerReportLinkDesignWindow = class(TdxfmCustomcxControlReportLinkDesignWindow) + PageControl1: TPageControl; + tshPrintStyles: TTabSheet; + tshStyles: TTabSheet; + bvlStyles: TBevel; + bvlStyleSheets: TBevel; + lblStyleSheets: TLabel; + bvlStylesHost: TBevel; + Label1: TLabel; + lblUseNativeStyles: TLabel; + btnStyleColor: TButton; + btnStyleFont: TButton; + btnStyleBackgroundBitmap: TButton; + cbxStyleSheets: TcxComboBox; + btnStyleSheetNew: TButton; + btnStyleSheetCopy: TButton; + btnStyleSheetDelete: TButton; + btnStylesSaveAs: TButton; + btnStyleSheetRename: TButton; + btnStyleBackgroundBitmapClear: TButton; + btnStyleRestoreDefaults: TButton; + chbxUseNativeStyles: TcxCheckBox; + pmStyles: TPopupMenu; + miStyleFont: TMenuItem; + miStyleColor: TMenuItem; + miLine3: TMenuItem; + miStyleBackgroundBitmap: TMenuItem; + miStyleBackgroundBitmapClear: TMenuItem; + miLine2: TMenuItem; + miStyleRestoreDefaults: TMenuItem; + milLine: TMenuItem; + miStylesSelectAll: TMenuItem; + miLine4: TMenuItem; + miStylesSaveAs: TMenuItem; + ilStylesPopup: TImageList; + lblPreviewWindow: TStaticText; + pnlPreview: TPanel; + cbxPrintStyles: TcxImageComboBox; + lblPrintStylesOptions: TLabel; + bvlPrintStyleOptions: TBevel; + pcPrintStyleOptions: TPageControl; + tshWeekly: TTabSheet; + tshMonthly: TTabSheet; + tshTrifold: TTabSheet; + tshDetails: TTabSheet; + tshMemo: TTabSheet; + lblPrintStyleTrifoldSectionLeft: TLabel; + lblPrintStyleTrifoldSectionMiddle: TLabel; + lblPrintStyleTrifoldSectionRight: TLabel; + lblPrintStyleWeeklyPrintTo: TLabel; + lblPrintStyleWeeklyPrintFrom: TLabel; + chbxPrintStyleWeeklyNotesAreaLined: TcxCheckBox; + chbxPrintStyleWeeklyNotesAreaBlank: TcxCheckBox; + lblPrintStyleWeeklyInclude: TLabel; + lblPrintStyleWeeklyLayout: TLabel; + lblPrintStyleWeeklyArrange: TLabel; + cbxPrintStyleWeeklyArrange: TcxComboBox; + cbxPrintStyleWeeklyLayout: TcxComboBox; + chbxPrintStyleWeeklyTaskPad: TcxCheckBox; + tePrintStyleWeeklyPrintFrom: TcxTimeEdit; + tePrintStyleWeeklyPrintTo: TcxTimeEdit; + cbxPrintStyleMonthlyLayout: TcxComboBox; + lblPrintStyleMonthlyLayout: TLabel; + lblPrintStyleMonthlyInclude: TLabel; + chbxPrintStyleMonthlyTaskPad: TcxCheckBox; + chbxPrintStyleMonthlyNotesAreaBlank: TcxCheckBox; + chbxPrintStyleMonthlyNotesAreaLined: TcxCheckBox; + chbxPrintStyleMonthlyDontPrintWeekends: TcxCheckBox; + chbxPrintStyleMonthlyPrintExactlyOneMonthPerPage: TcxCheckBox; + chbxPrintStyleWeeklyDontPrintWeekends: TcxCheckBox; + pnlPrintStylesPreview: TPanel; + pbxPrintStylesPreview: TPaintBox; + chbxPrintStyleDetailsUsePagination: TcxCheckBox; + cbxPrintStyleDetailsPagination: TcxComboBox; + tshFormatting: TTabSheet; + bvlLookAndFeel: TBevel; + lblLookAndFeel: TLabel; + imgLookAndFeel: TImage; + cbxLookAndFeel: TcxComboBox; + lblRefinements: TLabel; + bvlRefinements: TBevel; + imgRefinements: TImage; + chbxSuppressBackgroundBitmaps: TcxCheckBox; + tshPrintRange: TTabSheet; + lblPrintRangeStart: TLabel; + lblPrintRangeEnd: TLabel; + lblPrintRangesMiscellaneous: TLabel; + Bevel1: TBevel; + dePrintRangeStart: TcxDateEdit; + dePrintRangeEnd: TcxDateEdit; + chbxHideDetailsOfPrivateAppointments: TcxCheckBox; + cbxPrintStyleTrifoldSectionLeft: TcxComboBox; + cbxPrintStyleTrifoldSectionMiddle: TcxComboBox; + cbxPrintStyleTrifoldSectionRight: TcxComboBox; + chbxSuppressContentColoration: TcxCheckBox; + sePrintStyleMonthlyResourceCountPerPage: TcxSpinEdit; + lblPrintStyleMonthlyResourceCountPerPage: TLabel; + lblPrintStyleWeeklyResourceCountPerPage: TLabel; + sePrintStyleWeeklyResourceCountPerPage: TcxSpinEdit; + tshDaily: TTabSheet; + lblPrintStyleDailyLayout: TLabel; + lblPrintStyleDailyInclude: TLabel; + lblPrintStyleDailyPrintFrom: TLabel; + lblPrintStyleDailyPrintTo: TLabel; + lblPrintStyleDailyResourceCountPerPage: TLabel; + cbxPrintStyleDailyLayout: TcxComboBox; + chbxPrintStyleDailyTaskPad: TcxCheckBox; + chbxPrintStyleDailyNotesAreaBlank: TcxCheckBox; + chbxPrintStyleDailyNotesAreaLined: TcxCheckBox; + tePrintStyleDailyPrintFrom: TcxTimeEdit; + tePrintStyleDailyPrintTo: TcxTimeEdit; + sePrintStyleDailyResourceCountPerPage: TcxSpinEdit; + cxEditStyleController1: TcxEditStyleController; + pbPreview: TPaintBox; + chbxPrintStyleMemoStartEachItemOnNewPage: TcxCheckBox; + chbxPrintStyleMemoPrintOnlySelectedEvents: TcxCheckBox; + procedure PageControl1Change(Sender: TObject); + procedure lbxStylesClick(Sender: TObject); + procedure btnStyleFontClick(Sender: TObject); + procedure btnStyleColorClick(Sender: TObject); + procedure btnStyleBackgroundBitmapClick(Sender: TObject); + procedure btnStyleBackgroundBitmapClearClick(Sender: TObject); + procedure btnStyleRestoreDefaultsClick(Sender: TObject); + procedure btnStylesSaveAsClick(Sender: TObject); + procedure cbxStyleSheetsClick(Sender: TObject); + procedure miStylesSelectAllClick(Sender: TObject); + procedure cbxStyleSheetsKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure btnStyleSheetNewClick(Sender: TObject); + procedure btnStyleSheetCopyClick(Sender: TObject); + procedure btnStyleSheetDeleteClick(Sender: TObject); + procedure btnStyleSheetRenameClick(Sender: TObject); + procedure lblUseNativeStylesClick(Sender: TObject); + procedure OptionsFormattingClick(Sender: TObject); + procedure pmStylesPopup(Sender: TObject); + procedure cbxPrintStylesClick(Sender: TObject); + procedure pbxPrintStylesPreviewPaint(Sender: TObject); + procedure cbxPrintStyleDailyLayoutClick(Sender: TObject); + procedure chbxPrintStyleOptionsViewClick(Sender: TObject); + procedure cbxPrintStyleWeeklyArrangeClick(Sender: TObject); + procedure chbxPrintStyleWeeklyDontPrintWeekendsClick(Sender: TObject); + procedure chbxPrintStyleMonthlyDontPrintWeekendsClick(Sender: TObject); + procedure chbxPrintStyleMonthlyPrintExactlyOneMonthPerPageClick( + Sender: TObject); + procedure cbxPrintStyleTrifoldSectionModeClick(Sender: TObject); + procedure chbxPrintStyleDetailsUsePaginationClick(Sender: TObject); + procedure cbxPrintStyleDetailsPaginationClick(Sender: TObject); + procedure cbxPrintStyleWeeklyLayoutClick(Sender: TObject); + procedure cbxPrintStyleMonthlyLayoutClick(Sender: TObject); + procedure dePrintRangeStartEditValueChanged(Sender: TObject); + procedure dePrintRangeEndEditValueChanged(Sender: TObject); + procedure cbxStyleSheetsPropertiesDrawItem(AControl: TcxCustomComboBox; + ACanvas: TcxCanvas; AIndex: Integer; const ARect: TRect; + AState: TOwnerDrawState); + procedure tePrintStylePrintRangePropertiesEditValueChanged( + Sender: TObject); + procedure LookAndFeelChange(Sender: TObject); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + procedure sePrintStyleResourceCountPerPagePropertiesEditValueChanged( + Sender: TObject); + procedure tePrintStylePrintRangePropertiesChange(Sender: TObject); + procedure sePrintStyleResourceCountPerPagePropertiesChanged( + Sender: TObject); + procedure StyleController1StyleChanged(Sender: TObject); + procedure pbPreviewPaint(Sender: TObject); + procedure cbxLookAndFeelPropertiesChange(Sender: TObject); + procedure chbxPrintStyleMemoStartEachItemOnNewPageClick( + Sender: TObject); + procedure chbxPrintStyleMemoPrintOnlySelectedEventsClick( + Sender: TObject); + private + FActiveStyle: TcxCustomSchedulerReportLinkPrintStyle; + FActiveStyleAssigned: Boolean; + FIsFormClosing: Boolean; + lbxStyles: TdxStylesListBox; + wpPrintStyles: TList; + + function GetActivePrintStyle: TcxCustomSchedulerReportLinkPrintStyle; + function GetActiveStyle: TcxStyle; + function GetComponent: TcxScheduler; + function GetHasSelectedStyles: Boolean; + function GetHasSelectedStylesWithAssignedBitmap: Boolean; + function GetReportLink: TcxSchedulerReportLink; + + function CanSelectAllStyles: Boolean; + procedure CreateControls; + + procedure RecreateStylesListBox; + procedure RestoreSelectedStyles(AList: TList); + procedure SaveSelectedStyles(AList: TList); + procedure SetActivePage; + + procedure SetOptionsFormattingByIndex(AnIndex: Integer; AValue: Boolean); + procedure SetPrintStyleOptionsViewByIndex(AnIndex: Integer; AValue: Boolean); + procedure SetPrintStyleRangeByIndex(AnIndex: Integer; const ATime: TDateTime); + procedure SetPrintStyleResourceCountPerPageByIndex(AnIndex: Integer; AValue: TcxEditValue); + + protected + procedure AssignDailyTabObjects; virtual; + procedure AssignDetailsTabObjects; virtual; + procedure AssignMemoTabObjects; virtual; + procedure AssignMonthlyTabObjects; virtual; + procedure AssignTrifoldTabObjects; virtual; + procedure AssignWeeklyTabObjects; virtual; + + function CanApply: Boolean; override; + procedure DoApply; override; + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + + function CheckPrintRange: Boolean; virtual; + function CheckPrintStyleSettings: Boolean; virtual; + function IsValidConditions: Boolean; virtual; + procedure LoadCaption(AControl: TControl; StrPtr: Pointer); overload; + procedure LoadCaption(AItem: TMenuItem; StrPtr: Pointer); overload; + procedure LoadStrings; override; + procedure LoadStringsCombo(ACombo: TcxComboBox; ACaptions: array of Pointer); + procedure LoadStringsDaily; virtual; + procedure LoadStringsDetails; virtual; + procedure LoadStringsMemo; virtual; + procedure LoadStringsMonthly; virtual; + procedure LoadStringsOther; virtual; + procedure LoadStringsTrifold; virtual; + procedure LoadStringsWeekly; virtual; + + procedure PreviewDrawPageContent(ACanvas: TCanvas; ABounds: TRect); virtual; + + procedure UpdateControlsState; override; + procedure UpdateEnabled(AControl: TControl; AEnabled: Boolean); overload; + procedure UpdateEnabled(AItem: TMenuItem; AEnabled: Boolean); overload; + procedure UpdateEnabledControls(AControls: array of TControl; AEnabled: Boolean); + procedure UpdatePreview; override; + + function GetDesignerTabIndex: Integer; override; + procedure SetDesignerTabIndex(Value: Integer); override; + + procedure DoActiveStyleSheetChanged; override; + procedure DoFormActivated(AnActive: Boolean); override; + procedure DoRefreshStylesList; override; + procedure DoStyleChanged(const ACaption: string; AStyle: TcxStyle); override; + procedure DoStylesChanged(AStrings: TStrings; ARecreate: Boolean); override; + + procedure GetSelectedStyleNames(AStrings: TStrings); override; + procedure GetStyleNames(out AStrings: TStrings); override; + procedure GetStyleSheetNames(out AStrings: TStrings); override; + + procedure ActivatePrintStyleTab; virtual; + procedure AssignTabSheetObjects; virtual; + function FindTabIndexByPrintStyle(APrintStyle: TcxCustomSchedulerReportLinkPrintStyle): Integer; virtual; + procedure RefreshPrintStyles; virtual; + + property ActivePrintStyle: TcxCustomSchedulerReportLinkPrintStyle read GetActivePrintStyle; + property ActiveStyle: TcxStyle read GetActiveStyle; + property HasSelectedStyles: Boolean read GetHasSelectedStyles; + property HasSelectedStylesWithAssignedBitmap: Boolean read GetHasSelectedStylesWithAssignedBitmap; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function Execute: Boolean; override; + + property Component: TcxScheduler read GetComponent; + property ReportLink: TcxSchedulerReportLink read GetReportLink; + end; + + // cells + + { TcxSchedulerReportPageSite } + + TcxSchedulerReportPageSite = class(TdxReportCell) + protected + FPageIndex: Integer; + FPrimaryPage: Boolean; + + procedure ReadProperties(AReader: TdxPSDataReader); override; + procedure WriteProperties(AWriter: TdxPSDataWriter); override; + public + property PageIndex: Integer read FPageIndex; + property PrimaryPage: Boolean read FPrimaryPage; + end; + + { TcxSchedulerReportPageItemCell } + + TcxSchedulerReportPageItemCell = class(TdxReportCell) + private + function GetPageIndex: Integer; + function GetPageSite: TcxSchedulerReportPageSite; + function GetPrimaryPage: Boolean; + function GetReportLink: TcxSchedulerReportLink; + protected + function GetType: TcxSchedulerReportItemsType; virtual; + + procedure SetCellViewParams(AItem: TdxReportVisualItem; const AParams: TcxViewParams); overload; + procedure SetCellViewParams(AItem: TdxReportVisualItem; const AParams: TdxReportItemViewParams); overload; + + property ReportLink: TcxSchedulerReportLink read GetReportLink; + public + constructor Create(AParent: TdxReportCell); override; + property PageSite: TcxSchedulerReportPageSite read GetPageSite; + property PrimaryPage: Boolean read GetPrimaryPage; + property PageIndex: Integer read GetPageIndex; + end; + + { TcxSchedulerReportNotesDataCell } + + TcxSchedulerReportNotesDataCell = class(TAbstractdxReportCellData) + private + FCaption: string; + FCaptionHeight: Integer; + FLined: Boolean; + function GetMultiLine: Boolean; + function GetTextAlignX: TdxTextAlignX; + function GetTextAlignY: TdxTextAlignY; + procedure SetMultiLine(Value: Boolean); + procedure SetTextAlignX(Value: TdxTextAlignX); + procedure SetTextAlignY(Value: TdxTextAlignY); + protected + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor Create(AParent: TdxReportCell); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + + property Caption: string read FCaption write FCaption; + property CaptionHeight: Integer read FCaptionHeight write FCaptionHeight; + property Lined: Boolean read FLined write FLined; + property MultiLine: Boolean read GetMultiLine write SetMultiLine; + property TextAlignX: TdxTextAlignX read GetTextAlignX write SetTextAlignX; + property TextAlignY: TdxTextAlignY read GetTextAlignY write SetTextAlignY; + end; + + TcxSchedulerReportNotesDataCellClass = class of TcxSchedulerReportNotesDataCell; + + { TcxSchedulerReportNotesAreaCell } + + TcxSchedulerReportNotesAreaCell = class(TcxSchedulerReportPageItemCell) + private + FLined: Boolean; + function GetDataCell: TcxSchedulerReportNotesDataCell; + protected + procedure BoundsChanged; override; + procedure ConvertCoords(APixelsNumerator, APixelsDenominator: Integer); override; + function GetType: TcxSchedulerReportItemsType; override; + function GetDataCellClass: TcxSchedulerReportNotesDataCellClass; virtual; + procedure SetFontIndex(Value: Integer); override; + public + constructor Create(AParent: TdxReportCell); override; + constructor CreateEx(AParent: TdxReportCell; ALined: Boolean); virtual; + property DataCell: TcxSchedulerReportNotesDataCell read GetDataCell; + property Lined: Boolean read FLined; + end; + + { TcxSchedulerReportTaskPadCell } + + TcxSchedulerReportTaskPadCell = class(TcxSchedulerReportNotesAreaCell) + private + function GetTaskPadDataSite: TdxReportCell; + protected + procedure BoundsChanged; override; + function CalculateTaskPadDataSiteBounds: TRect; virtual; + function GetType: TcxSchedulerReportItemsType; override; + public + constructor CreateEx(AParent: TdxReportCell; ALined: Boolean); override; + + property TaskPadDataSite: TdxReportCell read GetTaskPadDataSite; + end; + + { TcxSchedulerReportSchedulerHeaderDataCell } + + TcxSchedulerReportSchedulerHeaderDataCell = class(TAbstractdxReportCellData) + public + constructor Create(AParent: TdxReportCell); override; + end; + + { TcxSchedulerReportSchedulerHeaderCell } + + TcxSchedulerReportSchedulerHeaderCell = class(TcxSchedulerReportPageItemCell) + private + FContent: TcxSchedulerReportSchedulerHeaderDataCell; + FDate: TDateTime; + FPrimaryText: string; //todo: remove + FSecondaryText: string; //todo: remove + FPrimaryTextCell: TdxReportCellString; + FSecondaryTextCell: TdxReportCellString; + protected + function AddContentCell: TcxSchedulerReportSchedulerHeaderDataCell; virtual; + function AddTextCell(AText: string; const ABounds: TRect; AMultiLine: Boolean): TdxReportCellString; + function GetType: TcxSchedulerReportItemsType; override; + + property Date: TDateTime read FDate write FDate; + property PrimaryText: string read FPrimaryText write FPrimaryText; //todo: remove + property SecondaryText: string read FSecondaryText write FSecondaryText; //todo: remove + public + constructor Create(AParent: TdxReportCell); override; + procedure AdjustTextSize; + + property Content: TcxSchedulerReportSchedulerHeaderDataCell read FContent; + property PrimaryTextCell: TdxReportCellString read FPrimaryTextCell; + property SecondaryTextCell: TdxReportCellString read FSecondaryTextCell; + end; + + { TcxSchedulerReportDateNavigatorItem } + + TcxSchedulerReportDateNavigatorItem = class(TdxReportCellPreviewText) + private + function GetDateNavigator: TcxSchedulerReportDateNavigatorCell; + protected + function GetDefaultDTFormat: DWORD; override; + procedure SetText(const Value: string); override; + public + constructor Create(AParent: TdxReportCell); override; + + property DateNavigator: TcxSchedulerReportDateNavigatorCell read GetDateNavigator; + end; + + { TcxSchedulerReportDateNavigatorHeader } + + TcxSchedulerReportDateNavigatorHeader = class(TcxSchedulerReportDateNavigatorItem) + private + FMonth: Word; + FYear: Word; + protected + function GetText: string; override; + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateEx(AParent: TdxReportCell; AYear, AMonth: Word); + procedure Assign(Source: TPersistent); override; + + property Month: Word read FMonth; + property Year: Word read FYear; + end; + + { TcxSchedulerReportDateNavigatorDay } + + TcxSchedulerReportDateNavigatorDay = class(TcxSchedulerReportDateNavigatorItem) + private + FDay: Integer; + FCol: Integer; + FRow: Integer; + function GetBold: Boolean; + function GetDate: TDate; + function GetMonth: Word; + function GetYear: Word; + procedure SetBold(Value: Boolean); + protected + function GetText: string; override; + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateEx(AParent: TdxReportCell; + ADay, ACol, ARow: Integer; ABold: Boolean); virtual; + procedure Assign(Source: TPersistent); override; + + property Col: Integer read FCol; + property Date: TDate read GetDate; + property Day: Integer read FDay write FDay; + property Bold: Boolean read GetBold write SetBold; + property Month: Word read GetMonth; + property Row: Integer read FRow; + property Year: Word read GetYear; + end; + + { TcxSchedulerReportDateNavigatorDayCaption } + + TcxSchedulerReportDateNavigatorDayCaption = class(TcxSchedulerReportDateNavigatorItem) + private + FCol: Integer; + FDayOfWeek: TDay; + FDayText: string; + protected + function GetText: string; override; + function GetDayText: string; virtual; + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateEx(AParent: TdxReportCell; ADayOfWeek: TDay; ACol: Integer); virtual; + procedure Assign(Source: TPersistent); override; + + property Col: Integer read FCol; + property DayOfWeek: TDay read FDayOfWeek; + end; + + { TcxSchedulerReportDateNavigatorWeekNumber } + + TcxSchedulerReportDateNavigatorWeekNumber = class(TcxSchedulerReportDateNavigatorItem) + private + FWeekNumber: Integer; + FRow: Integer; + protected + function GetText: string; override; + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateEx(AParent: TdxReportCell; AWeekNumber, ARow: Integer); virtual; + procedure Assign(Source: TPersistent); override; + + property Row: Integer read FRow; + property WeekNumber: Integer read FWeekNumber write FWeekNumber; + end; + + { TcxSchedulerReportDateNavigatorCell } + + TcxSchedulerReportDateNavigatorCell = class(TcxSchedulerReportPageItemCell) + private + FBoldedDays: TcxSchedulerDateList; + FFirstWeekOfYear: TcxFirstWeekOfYear; + FMonth: Word; + FShowDatesContainingEventsInBold: Boolean; + FShowWeekNumbers: Boolean; + FStartOfWeek: TDay; + FYear: Word; + + FColWidth: Integer; + FDayCaptionsHeight: Integer; + FHeaderHeight: Integer; + FMonthSize: TSize; + FRowHeight: Integer; + FVertOffset: Integer; + FContentParams: TdxReportItemViewParams; + FHeaderParams: TdxReportItemViewParams; + + FDayCaptionCount: Integer; + FDayCount: Integer; + FWeekNumberCount: Integer; + + class function GetMonthHeight(AHeaderHeight, ADayCaptionsHeight, ARowHeight: Integer): Integer; + function GetDay(Index: Integer): TcxSchedulerReportDateNavigatorDay; + function GetDayCaption(Index: Integer): TcxSchedulerReportDateNavigatorDayCaption; + function GetHeader: TcxSchedulerReportDateNavigatorHeader; + function GetWeekNumber(Index: Integer): TcxSchedulerReportDateNavigatorWeekNumber; + protected + procedure AdjustItemsVertical; + function ColOfDate(ADate: TDateTime): Integer; + procedure CreateDayCaptions; virtual; + procedure CreateDay(const ABounds: TRect; ADate: TDateTime; ACol, ARow: Integer); virtual; + procedure CreateItems; + procedure CreateLines; virtual; + procedure CreateMonth; virtual; + procedure CreateMonthHeader; virtual; + procedure CreateWeekNumber(const ABounds: TRect; ADate: TDateTime; ARow: Integer); virtual; + class procedure GetContentPartSizes(AFont: TFont; var AColWidth, ARowHeight, + ADayCaptionsHeight: Integer; AFontSize: Integer = 0); virtual; + function GetDayBoundsFromColAndRow(ACol, ARow: Integer): TRect; virtual; + function GetDayIsBold(ADate: TDateTime): Boolean; virtual; + function GetHeaderBounds: TRect; virtual; + class procedure GetHeaderPartSizes(AFont: TFont; var AHeaderHeight: Integer; + AFontSize: Integer = 0); virtual; + function GetMonthSize(const AContentParams, AHeaderParams: TdxReportItemViewParams): TSize; + function GetType: TcxSchedulerReportItemsType; override; + procedure SetViewParams(const AContentParams, AHeaderParams: TdxReportItemViewParams); virtual; + + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + + property ColWidth: Integer read FColWidth; + property DayCaptionsHeight: Integer read FDayCaptionsHeight; + property HeaderHeight: Integer read FHeaderHeight; + property MonthSize: TSize read FMonthSize; + property RowHeight: Integer read FRowHeight; + property ContentParams: TdxReportItemViewParams read FContentParams; + property HeaderParams: TdxReportItemViewParams read FHeaderParams; + public + constructor Create(AParent: TdxReportCell); override; + constructor CreateEx(AParent: TdxReportCell; AFirstWeekOfYear: TcxFirstWeekOfYear; + AYear, AMonth: Word; AShowDatesContainingEventsInBold, AShowWeekNumbers: Boolean); virtual; + + procedure AdjustSize(var AContentParams, AHeaderParams: TdxReportItemViewParams; AHeight, AMaxHeight: Integer); virtual; + function CalculateSize(const AContentParams, AHeaderParams: TdxReportItemViewParams): TSize; + class function MeasureDateNavigatorHeight(const AContentParams, AHeaderParams: TcxViewParams): Integer; virtual; + + property FirstWeekOfYear: TcxFirstWeekOfYear read FFirstWeekOfYear write FFirstWeekOfYear; + property Month: Word read FMonth write FMonth; + property ShowDatesContainingEventsInBold: Boolean read FShowDatesContainingEventsInBold write FShowDatesContainingEventsInBold; + property ShowWeekNumbers: Boolean read FShowWeekNumbers write FShowWeekNumbers; + property StartOfWeek: TDay read FStartOfWeek; + property Year: Word read FYear write FYear; + + // Helpers + property DayCaptionCount: Integer read FDayCaptionCount; + property DayCaptions[Index: Integer]: TcxSchedulerReportDateNavigatorDayCaption read GetDayCaption; + property DayCount: Integer read FDayCount; + property Days[Index: Integer]: TcxSchedulerReportDateNavigatorDay read GetDay; + property Header: TcxSchedulerReportDateNavigatorHeader read GetHeader; + property WeekNumberCount: Integer read FWeekNumberCount; + property WeekNumbers[Index: Integer]: TcxSchedulerReportDateNavigatorWeekNumber read GetWeekNumber; + end; + + { TcxSchedulerReportSchedulingAreaCell } + + TcxSchedulerReportSchedulingAreaCell = class(TcxSchedulerReportPageItemCell) + private + FVisibleDays: TcxSchedulerDateList; + FDaysList: TStringList; + protected + function GetType: TcxSchedulerReportItemsType; override; + property VisibleDays: TcxSchedulerDateList read FVisibleDays; + public + constructor Create(AParent: TdxReportCell); override; + destructor Destroy; override; + procedure DrawContent(DC: HDC; DrawRect: TRect; const OriginRect: TRect; AStage: TdxPSRenderStages); override; + procedure DrawItself(DC: HDC; AStage: TdxPSRenderStages); override; + end; + + TcxSchedulerReportCustomCell = class(TAbstractdxReportCellData) + private + function GetReportLink: TcxSchedulerReportLink; + protected + FDateTime: TDateTime; + FDayBorderColor: TColor; + procedure DrawCellFrame(DC: HDC; const ARect: TRect; ABorders: TcxBorders = []; + ABorderColor: TColor = clDefault; ALineWidth: Integer = 1); + procedure DrawCellRect(DC: HDC; const ARect: TRect; ABorders: TcxBorders = []; + ABorderColor: TColor = clDefault; ALineWidth: Integer = 1; AColor: TColor = clDefault); + procedure DrawCellText(DC: HDC; const ARect: TRect; const AText: string; + AlignHorz: TdxTextAlignX; AlignVert: TdxTextAlignY; AFont: TFont = nil; AColor: TColor = clDefault); + procedure DrawCellTextVert(DC: HDC; const ARect: TRect; const AText: string); + procedure DrawCellState(DC: HDC; R: TRect; + AState: Integer; ABorders: TcxBorders = []; ABorderColor: TColor = clBlack); + + function ExcludeBorders(const ARect: TRect; ABorders: TcxBorders; ABorderWidth: Integer = 1): TRect; + function FixupWidth(AWidth: Integer): Integer; + function GetFixupRect(DC: HDC; const ARect: TRect): TRect; + function InflateRect(const ARect: TRect; dX, dY: Integer): TRect; + function TextRect(const ARect: TRect): TRect; + + property ReportLink: TcxSchedulerReportLink read GetReportLink; + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); virtual; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + class procedure RegisterMirrorClass; virtual; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; virtual; + procedure SuppressColoration; virtual; + end; + + { TcxSchedulerReportContentCell } + + TcxSchedulerReportContentCell = class(TcxSchedulerReportCustomCell) + protected + FBorderColor: TColor; + FShowTimeLine: Boolean; + FState: Integer; + FTimeLineBorders: TcxBorders; + function HasBorderColoration: Boolean; override; + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + procedure Assign(Source: TPersistent); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + procedure SuppressColoration; override; + end; + + { TcxSchedulerReportHeaderItemCell } + + TcxSchedulerReportHeaderItemCell = class(TcxSchedulerReportCustomCell) + private + FCaption: string; + FDate: TDateTime; + FIsResourceHeader: Boolean; + FResourceID: Variant; + FRotateText: Boolean; + function GetTextAlignX: TdxTextAlignX; + function GetTextAlignY: TdxTextAlignY; + procedure SetTextAlignX(Value: TdxTextAlignX); + procedure SetTextAlignY(Value: TdxTextAlignY); + protected + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + procedure Assign(Source: TPersistent); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + property TextAlignX: TdxTextAlignX read GetTextAlignX write SetTextAlignX; + property TextAlignY: TdxTextAlignY read GetTextAlignY write SetTextAlignY; + property Caption: string read FCaption write FCaption; + property Date: TDateTime read FDate; + property IsResourceHeader: Boolean read FIsResourceHeader; + property ResourceID: Variant read FResourceID; + property RotateText: Boolean read FRotateText; + end; + + { TcxSchedulerReportGroupSeparatorCell } + + TcxSchedulerReportGroupSeparatorCell = class(TcxSchedulerReportCustomCell) + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + end; + + { TcxSchedulerReportContainerCell } + + TcxSchedulerReportContainerCell = class(TcxSchedulerReportCustomCell) + public + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + end; + + { TcxSchedulerReportBackgroundSlotCell } + + TcxSchedulerReportBackgroundSlotCell = class(TcxSchedulerReportCustomCell) + protected + FDisplayText: string; + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + property DisplayText: string read FDisplayText write FDisplayText; + end; + + { TcxSchedulerReportDailyTimeRulerCellsSite } + + TcxSchedulerReportDailyTimeRulerCellsSite = class(TdxReportCell) + private + FLargeFont: TFont; + FLargeFontIndex: Integer; + function GetLargeFont: TFont; + protected + procedure SetFontIndex(Index: Integer); override; + procedure ReadProperties(AReader: TdxPSDataReader); override; + procedure WriteProperties(AWriter: TdxPSDataWriter); override; + public + constructor Create(AParent: TdxReportCell); override; + destructor Destroy; override; + property LargeFont: TFont read GetLargeFont; + end; + + { TcxSchedulerReportDailyTimeRulerCell } + + TcxSchedulerReportDailyTimeRulerCell = class(TcxSchedulerReportCustomCell) + private + function GetBoundsRect(AType: Boolean): TRect; + function GetDisplayText(AType: Boolean): string; + function GetLargeFont: TFont; + function GetTimeRulerSite: TcxSchedulerReportDailyTimeRulerCellsSite; + protected + FHasAdditionalTimeZone: Boolean; + FLineCount: Integer; + FLineColor: TColor; + FBounds: array[Boolean] of TRect; + FDisplayTexts: array[Boolean] of string; + FHour: Integer; + procedure CalculateDisplayInfo; + procedure DrawTimeZone(DC: HDC; const ABounds: TRect; const AText: string; AIsCurrent: Boolean); virtual; + procedure DrawTimeZoneLabel(DC: HDC; const ABounds: TRect; const AText: string; ABorders: TcxBorders); virtual; + + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + + property LargeFont: TFont read GetLargeFont; + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + procedure Assign(Source: TPersistent); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + procedure SuppressColoration; override; + + property Bounds[ACurrentTimeZone: Boolean]: TRect read GetBoundsRect; + property DisplayTexts[ACurrentTimeZone: Boolean]: string read GetDisplayText; + property HasAdditionalTimeZone: Boolean read FHasAdditionalTimeZone; + property Hour: Integer read FHour; + property LineCount: Integer read FLineCount; + property TimeRulerSite: TcxSchedulerReportDailyTimeRulerCellsSite read GetTimeRulerSite; + end; + + { TcxSchedulerReportMonthDayCell } + + TcxSchedulerReportMonthDayCell = class(TcxSchedulerReportContentCell) + private + FDisplayText: string; + FDontPrint: Boolean; + protected + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + public + constructor CreateFrom(AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); override; + procedure Assign(Source: TPersistent); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + class function SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; override; + property DisplayText: string read FDisplayText write FDisplayText; + end; + + { TcxSchedulerReportTimeLinePart} + + TcxSchedulerReportTimeLinePart = class(TdxReportCellBox) + private + FState: Integer; + FTriangle: Boolean; + protected + procedure ReadData(AReader: TdxPSDataReader); override; + procedure WriteData(AWriter: TdxPSDataWriter); override; + property State: Integer read FState write FState; + public + constructor CreateEx(AParent: TdxReportCell; ATriangle: Boolean; AState: Integer); + procedure Assign(Source: TPersistent); override; + procedure DrawContent(DC: HDC; AStage: TdxPSRenderStages); override; + end; + + { TcxSchedulerReportTimeLineCell } + + TcxSchedulerReportTimeLineCell = class(TdxReportCell) + private + FCurrentValue: TAbstractdxReportCellData; + public + constructor Create(AParent: TdxReportCell); override; + procedure SetTimeRect(const ABounds: TRect; AState: Integer); + end; + + { TcxSchedulerReportCustomEventCell } + + TcxSchedulerReportCustomEventCell = class(TdxReportCell) + private + function GetPrintStyle: TcxCustomSchedulerReportLinkPrintStyle; + function GetReportLink: TcxSchedulerReportLink; + function GetSuppressColoration: Boolean; + protected + FCaptionCell: TdxReportCellString; + FIconsCell: TdxReportCellString; + FMessageCell: TAbstractdxReportCellData; + FStartCell: TdxReportCellString; + FFinishCell: TdxReportCellString; + FTimeLineCell: TcxSchedulerReportTimeLineCell; + procedure SetViewParams(const AViewParams: TcxViewParams); virtual; + public + function CreateStringCell(const AText: string; AData: Integer = 0): TdxReportCellString; virtual; + + property CaptionCell: TdxReportCellString read FCaptionCell; + property IconsCell: TdxReportCellString read FIconsCell; + property StartCell: TdxReportCellString read FStartCell; + property FinishCell: TdxReportCellString read FFinishCell; + property MessageCell: TAbstractdxReportCellData read FMessageCell; + property PrintStyle: TcxCustomSchedulerReportLinkPrintStyle read GetPrintStyle; + property ReportLink: TcxSchedulerReportLink read GetReportLink; + property TimeLineCell: TcxSchedulerReportTimeLineCell read FTimeLineCell; + property SuppressColoration: Boolean read GetSuppressColoration; + end; + + { TcxSchedulerReportEventCell } + + TcxSchedulerReportEventCell = class(TcxSchedulerReportCustomEventCell) + private + FContentBounds: TRect; + FEditViewInfo: TcxCustomEditViewInfo; + FEventViewInfo: TcxSchedulerEventCellViewInfo; + FHasDetailInfo: Boolean; + FHasIcons: Boolean; + FHasMessage: Boolean; + FIconsString: string; + FIsHeaderEvent: Boolean; + FIsNeedCreateTimeCells: Boolean; + FMessage: Variant; + procedure CheckBounds(var ABounds: TRect); + function GetEvent: TcxSchedulerControlEvent; + protected + procedure AdjustItemsHeight; virtual; + procedure CalculateLayout; virtual; + procedure CalculateTimeLine(DC: HDC); virtual; + function CreateCaptionCell: TdxReportCellString; virtual; + procedure CreateDataItems; virtual; + function CreateIconCells: TdxReportCellString; virtual; + procedure CreateMessageCell(AMessage: Variant; + AProperties: TcxCustomEditProperties; AViewParams: TcxViewParams); + function CreateTimeLineCell: TcxSchedulerReportTimeLineCell; virtual; + function CreateTimeTextCell(const ATimeText: string): TdxReportCellString; virtual; + function GetCaptionRect(DC: HDC): TRect; virtual; + function GetContentBounds(DC: HDC): TRect; virtual; + function GetHasIcons: Boolean; virtual; + function GetHasMessage: Boolean; virtual; + function GetIconsRect(DC: HDC): TRect; virtual; + function GetIconsString: string; virtual; + function GetMessageClass(AProperties: TcxCustomEditProperties): TdxReportCellDataClass; virtual; + function GetMessageRect(DC: HDC): TRect; virtual; + function GetRelativeRect(const R: TRect): TRect; + function GetTimeLineRect(DC: HDC): TRect; virtual; + procedure InitializeFromViewInfo(AEventViewInfo: TcxSchedulerEventCellViewInfo); + procedure SetViewParams(const AViewParams: TcxViewParams); override; + + property ContentBounds: TRect read FContentBounds; + property Event: TcxSchedulerControlEvent read GetEvent; + property EventViewInfo: TcxSchedulerEventCellViewInfo read FEventViewInfo; + property HasDetailInfo: Boolean read FHasDetailInfo; + property HasIcons: Boolean read FHasIcons; + property IsHeaderEvent: Boolean read FIsHeaderEvent; + property IsNeedCreateTimeCells: Boolean read FIsNeedCreateTimeCells; + public + constructor CreateFrom(AParent: TdxReportCell; AEventViewInfo: TcxSchedulerEventCellViewInfo); virtual; + + property CaptionCell: TdxReportCellString read FCaptionCell; + property HasMessage: Boolean read FHasMessage; + property Message: Variant read FMessage; + property MessageCell; + property TimeLineCell; + property IconsCell; + property IconsString: string read FIconsString; + property StartCell; + property FinishCell; + end; + + { TcxSchedulerReportDetailsEventCell } + + TcxSchedulerReportDetailsEventCell = class(TcxSchedulerReportCustomEventCell) + protected + FContinued: Boolean; + FDate: TDateTime; + + FEvent: TcxSchedulerEvent; + FLineHeight: Integer; + procedure CreateCaptionCell; virtual; + procedure CreateDataItems; virtual; + procedure CreateMessageCell; virtual; + procedure CreateTimeCell; virtual; + function GetCaptionCellText: string; virtual; + function GetMessageCellText: string; virtual; + function GetTimeCellText: string; virtual; + procedure SetViewParams(const AViewParams: TcxViewParams); override; + public + constructor CreateEx(AParent: TdxReportCell; AEvent: TcxSchedulerEvent; + ADate: TDateTime; const AParams: TcxViewParams; AContinued: Boolean = False); + function CalculateHeight: Integer; virtual; + procedure CalculateLayout(AWidth, ATimeWidth: Integer); virtual; + + property Date: TDateTime read FDate; + property Event: TcxSchedulerEvent read FEvent; + property Continued: Boolean read FContinued; + end; + + { TcxSchedulerReportMemoEventCell } + + TcxSchedulerReportMemoEventCell = class(TcxSchedulerReportDetailsEventCell) + protected + FCaptionLabelCell: TdxReportCellString; + FHeaderCell: TdxReportCellString; + FLocationCell: TdxReportCellString; + FLocationLabelCell: TdxReportCellString; + FShowTimeAsCell: TdxReportCellString; + FShowTimeAsLabelCell: TdxReportCellString; + FStartLabelCell: TdxReportCellString; + FFinishLabelCell: TdxReportCellString; + FRecurrenceCell: TdxReportCellString; + FRecurrenceLabelCell: TdxReportCellString; + FRecurrencePatternCell: TdxReportCellString; + FRecurrencePatternLabelCell: TdxReportCellString; + procedure CreateDataItems; override; + function GetCaptionCellText: string; override; + function GetMessageCellText: string; override; + function GetTimeCellText: string; override; + procedure SetViewParams(const AViewParams: TcxViewParams); override; + + procedure CalculateLabelAndData(ALabelCell, ADataCell: TAbstractdxReportCellData; + DC: HDC; ATimeWidth, AWidth: Integer; var ATop: Integer); virtual; + procedure CreateHeader; virtual; + procedure CreateFinish; virtual; + procedure CreateFinishCell; virtual; + procedure CreateFinishLabelCell; virtual; + procedure CreateLocation; virtual; + procedure CreateLocationCell; virtual; + procedure CreateLocationLabelCell; virtual; + procedure CreateMessage; virtual; + procedure CreateRecurrence; virtual; + procedure CreateRecurrenceCell; virtual; + procedure CreateRecurrenceLabelCell; virtual; + procedure CreateRecurrencePattern; virtual; + procedure CreateRecurrencePatternCell; virtual; + procedure CreateRecurrencePatternLabelCell; virtual; + procedure CreateShowTimeAs; virtual; + procedure CreateShowTimeAsCell; virtual; + procedure CreateShowTimeAsLabelCell; virtual; + procedure CreateStart; virtual; + procedure CreateStartLabelCell; virtual; + procedure CreateSubject; virtual; + procedure CreateSubjectLabelCell; virtual; + function GetHeaderCellText: string; virtual; + function GetRecurrenceCellText: string; virtual; + function GetRecurrencePatternCellText: string; virtual; + function GetShowTimeAsCellText: string; virtual; + public + procedure CalculateLayout(AWidth, ATimeWidth: Integer); override; + + property CaptionLabelCell: TdxReportCellString read FCaptionLabelCell; + property HeaderCell: TdxReportCellString read FHeaderCell; + property LocationCell: TdxReportCellString read FLocationCell; + property LocationLabelCell: TdxReportCellString read FLocationLabelCell; + property ShowTimeAsCell: TdxReportCellString read FShowTimeAsCell; + property ShowTimeAsLabelCell: TdxReportCellString read FShowTimeAsLabelCell; + property StartLabelCell: TdxReportCellString read FStartLabelCell; + property FinishLabelCell: TdxReportCellString read FFinishLabelCell; + property RecurrenceCell: TdxReportCellString read FRecurrenceCell; + property RecurrenceLabelCell: TdxReportCellString read FRecurrenceLabelCell; + property RecurrencePatternCell: TdxReportCellString read FRecurrencePatternCell; + property RecurrencePatternLabelCell: TdxReportCellString read FRecurrencePatternLabelCell; + end; + + { TcxSchedulerReportCommonCellsProducer } + + TcxSchedulerReportCommonCellsProducer = class(TcxCustomResourceViewAdapter) + private + FSite: TcxSchedulerReportSchedulingAreaCell; + FStyle: TcxCustomSchedulerReportLinkPrintStyle; + function GetStyles: TcxSchedulerReportLinkStyles; + protected + FBounds: TRect; + + procedure AfterCalculatePage; override; + + function CanCalculate: Boolean; override; + + procedure ConvertSchedulerCellToPSCells(AItem: TcxSchedulerCustomViewInfoItem; + AReportItemClass: TcxSchedulerReportCustomCellClass); virtual; + function CreateEventCell(AEventViewInfo: TcxSchedulerEventCellViewInfo): TcxSchedulerReportEventCell; virtual; + + procedure DoInitialize( + var ASelectedDays: TcxSchedulerDateList; var AEvents: TcxSchedulerCachedEventList); override; + // layout settings + function GetCompressWeekends: Boolean; override; + function GetDontPrintWeekEnds: Boolean; override; + function GetHideSelection: Boolean; override; + function GetPageBounds: TRect; override; + function GetPagesPerWeek: Byte; override; + function GetPrintExactlyOneMonth: Boolean; override; + function GetPrintRange(Index: Integer): TDateTime; override; + function GetPrimaryPage: Boolean; override; + function GetStylesAdapter: IcxSchedulerStylesAdapter; override; + // styles + procedure SetCellViewParams(ACell: TdxReportVisualItem; const AParams: TcxViewParams); virtual; + public + constructor CreateEx(AStyle: TcxCustomSchedulerReportLinkPrintStyle; + ASite: TcxSchedulerReportSchedulingAreaCell); virtual; + procedure GetPageResources(AResources: TcxObjectList); override; + procedure Produce; virtual; + property Site: TcxSchedulerReportSchedulingAreaCell read FSite; + property Style: TcxCustomSchedulerReportLinkPrintStyle read FStyle; + property Styles: TcxSchedulerReportLinkStyles read GetStyles; + end; + + TcxSchedulerReportCommonCellsProducerClass = class of TcxSchedulerReportCommonCellsProducer; + + { TcxSchedulerReportWeeksCellsProducer } + + TcxSchedulerReportWeeksCellsProducer = class(TcxSchedulerReportCommonCellsProducer) + end; + + { TcxSchedulerReportDailyCellsProducer } + + TcxSchedulerReportDailyCellsProducer = class(TcxSchedulerReportCommonCellsProducer) + private + FRulerSite: TcxSchedulerReportDailyTimeRulerCellsSite; + protected + procedure AfterCalculatePage; override; + procedure BeforeCalculatePage; override; + + function CreateTimeRulerSite: TcxSchedulerReportDailyTimeRulerCellsSite; virtual; + procedure ConvertSchedulerCellToPSCells(AItem: TcxSchedulerCustomViewInfoItem; + AReportItemClass: TcxSchedulerReportCustomCellClass); override; + end; + +var + SpecialSymbolFont: TFont; + +implementation + +{$R *.dfm} +{$R dxPScxSchedulerLnk.res} + +uses + Messages, ShlObj, dxPSUtl, dxPSRes, dxPSPopupMan, Math, +{$IFDEF DELPHI6} + DateUtils, Types, +{$ENDIF} + ActiveX, CommCtrl, dxPSTextOut; + +const + IDB_DXPSSCHEDULER_STYLEDESIGNPREVIEW = 'IDB_DXPSSCHEDULER_STYLEDESIGNPREVIEW'; + IDB_DXPSSCHEDULER_SMALLDESIGNPREVIEW = 'IDB_DXPSSCHEDULER_SMALLDESIGNPREVIEW'; + dxFormatShowDaysWithEventsInBold = dxPSGlbl.dxFormatCheckEnabled; + dxFormatDayIsBold = dxPSGlbl.dxFormatCheckChecked; + +type + TLongRec = packed record + Bytes: array [0..3] of Byte; + end; + + TControlAccess = class(TControl); + TcxSchedulerCachedEventListAccess = class(TcxSchedulerCachedEventList); + +var + MirrorClasses: TList; + StyleImages: TImageList; + SchedulerFontHandle: THandle; + SchedulerFontFileName: string; + StylePreviewImages: TImageList; + StyleSheetPrototype: TcxSchedulerReportLinkStyleSheet; + +{$IFNDEF DELPHI6} +function StartOfTheDay(const AValue: TDateTime): TDateTime; +begin + Result := Trunc(AValue); +end; + +function EndOfTheDay(const AValue: TDateTime): TDateTime; +begin + Result := Trunc(AValue) + EncodeTime(23, 59, 59, 999); +end; + +function StartOfTheWeek(const AValue: TDateTime): TDateTime; +begin + Result := Trunc(AValue) - (DayOfTheWeek(AValue) - 1); +end; + +function EndOfTheWeek(const AValue: TDateTime): TDateTime; +begin + Result := EndOfTheDay(StartOfTheWeek(AValue) + 6); +end; + +{$ENDIF} + +procedure Rect2RectsVert(const ASource: TRect; var R1, R2: TRect); overload; +begin + R1 := ASource; + R2 := ASource; + R1.Bottom := (ASource.Bottom + ASource.Top - InterAreaSpace) div 2; + R2.Top := R1.Bottom + InterAreaSpace; +end; + +procedure Rect2RectsVert(const ASource: TRect; var R1, R2, R3: TRect); overload; +var + H: Integer; +begin + R1 := ASource; + R2 := ASource; + R3 := ASource; + H := ASource.Bottom - ASource.Top; + R1.Bottom := ASource.Top + MulDiv(H, 1, 3); + R2.Top := R1.Bottom + InterAreaSpace; + R2.Bottom := ASource.Top + MulDiv(H, 2, 3); + R3.Top := R2.Bottom + InterAreaSpace; +end; + +procedure Rect2RectsHorz(const ASource: TRect; var R1, R2: TRect); overload; +begin + R1 := ASource; + R2 := ASource; + R1.Right := (ASource.Left + ASource.Right - InterAreaSpace) div 2; + R2.Left := R1.Right + InterAreaSpace; +end; + +procedure Rect2RectsHorz(const ASource: TRect; var R1, R2, R3: TRect); overload; +var + W: Integer; +begin + R1 := ASource; + R2 := ASource; + R3 := ASource; + W := ASource.Right - ASource.Left; + R1.Right := ASource.Left + MulDiv(W, 1, 3); + R2.Left := R1.Right + InterAreaSpace; + R2.Right := ASource.Left + MulDiv(W, 2, 3); + R3.Left := R2.Right + InterAreaSpace; +end; + +function AdditionalWidth(const ABounds: TRect): Integer; +begin + with ABounds do + Result := Round((Right - Left) * NotesAreaWidth) - InterAreaSpace div 2; +end; + +procedure SplitToRects(const ASource: TRect; AShowCalendar, + AIsRightArea: Boolean; out R1, R2: TRect); +begin + R1 := ASource; + R2 := ASource; + if AShowCalendar then + begin + if AIsRightArea then + begin + R2.Left := R2.Right - AdditionalWidth(R1); + R1.Right := R2.Left - InterAreaSpace; + end + else + begin + R2.Right := R2.Left + AdditionalWidth(R1); + R1.Left := R2.Right + InterAreaSpace; + end; + end; +end; + +function SchedulerLinkStyleSheetPrototype: TcxSchedulerReportLinkStyleSheet; + + function CreateStyle(AColor, AFontColor: TColor): TcxStyle; + begin + Result := TcxStyle.Create(StyleSheetPrototype); + with Result do + begin + Color := AColor; + Font.Name := dxPSCore.dxPSDefaultFontName; + Font.Color := AFontColor; + end; + end; + +begin + if StyleSheetPrototype = nil then + begin + StyleSheetPrototype := TcxSchedulerReportLinkStyleSheet.Create(nil); + with StyleSheetPrototype.Styles as TcxSchedulerReportLinkStyles do + begin + SchedulerHeader := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + Content := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + DateNavigatorContent := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + DateNavigatorHeader := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + DayHeader := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Event := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + ResourceHeader := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + NotesAreaBlank := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + NotesAreaLined := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + TaskPad := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + TimeRuler := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + end; + end; + Result := StyleSheetPrototype; +end; + +function FindMirorClassForItem(AItem: TObject; + var APSItemClass: TcxSchedulerReportCustomCellClass): Boolean; +var + I: Integer; +begin + APSItemClass := nil; + Result := False; + for I := MirrorClasses.Count - 1 downto 0 do + begin + APSItemClass := MirrorClasses[I]; + if AItem.InheritsFrom(APSItemClass.SchedulerCellClass) then + begin + Result := True; + Break; + end; + end; +end; + +{ TcxSchedulerReportLinkRenderInfo } + +procedure TcxSchedulerReportLinkRenderInfo.DoCalculate; +var + I: Integer; +begin + if not IsLoading then + begin + if (ReportLink <> nil) and (ReportLink.PrintStyles.ActiveStyle <> nil) then + begin + FPageColCount := Byte(ReportLink.PrintStyles.ActiveStyle.Layout) + 1; + FPageRowCount := ReportLink.PageSites.Count; + end + else + begin + FPageColCount := 1; + FPageRowCount := 1; + end; + end; + inherited DoCalculate; + for I := 0 to PageRenderInfoCount - 1 do + with PageRenderInfos[I] do + TitleOffset := DataOffset; +end; + +function TcxSchedulerReportLinkRenderInfo.GetPageColCount: Integer; +begin + if not IsLoading then + Result := 1//FPageColCount + else + Result := inherited GetPageColCount; +end; + +function TcxSchedulerReportLinkRenderInfo.GetPageRowCount: Integer; +begin + if not IsLoading then + Result := FPageRowCount + else + Result := inherited GetPageColCount; +end; + +function TcxSchedulerReportLinkRenderInfo.IsLoading: Boolean; +begin + Result := ReportLink.DataSource = rldsExternalStorage; +end; + +function TcxSchedulerReportLinkRenderInfo.IsDrawPageTitleOnPage( + APageIndex: Integer): Boolean; +begin + Result := Rendering and IsDrawReportTitleOnPage(APageIndex); +end; + +function TcxSchedulerReportLinkRenderInfo.IsDrawReportTitleOnPage( + APageIndex: Integer): Boolean; +begin + case ReportLink.ReportTitleMode of + tmNone: + Result := False; + tmOnFirstPage: + Result := APageIndex = 0; + else + Result := APageIndex mod FPageColCount = 0; + end; +end; + +function TcxSchedulerReportLinkRenderInfo.GetReportLink: TcxSchedulerReportLink; +begin + Result := TcxSchedulerReportLink(inherited ReportLink); +end; + +{ TcxSchedulerReportRenderer } + +procedure TcxSchedulerReportRenderer.PrepareRenderPage; +begin + inherited PrepareRenderPage; + TcxSchedulerReportLinkRenderInfo(RenderInfo).Rendering := True; +end; + +procedure TcxSchedulerReportRenderer.UnprepareRenderPage; +begin + TcxSchedulerReportLinkRenderInfo(RenderInfo).Rendering := False; + inherited UnprepareRenderPage; +end; + +{ TcxSchedulerReportLink } + +constructor TcxSchedulerReportLink.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FPageSites := TList.Create; + FLookAndFeelItems := TList.Create; +end; + +destructor TcxSchedulerReportLink.Destroy; +begin + FreeAndNil(FPageSites); + FreeAndNil(FLookAndFeelItems); + inherited Destroy; +end; + +procedure TcxSchedulerReportLink.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLink then + with TcxSchedulerReportLink(Source) do + begin + Self.PrintRange := PrintRange; + Self.PrintStyles := PrintStyles; + end; + inherited; +end; + +class function TcxSchedulerReportLink.Aggregable: Boolean; +begin + Result := False; +end; + +procedure TcxSchedulerReportLink.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited; + if (TaskPadReportLink = AComponent) and (Operation = opRemove) then + TaskPadReportLink := nil; +end; + +// IdxReportLinkController +function TcxSchedulerReportLink.GetControlSiteBounds(AControl: TControl): TRect; +begin + if PrintStyles.ActiveStyle <> nil then + Result := PrintStyles.ActiveStyle.GetControlSiteBounds(AControl) + else + Result := NullRect; +end; + +procedure TcxSchedulerReportLink.ConstructReport(AReportCells: TdxReportCells); + + procedure CalculateSizes; + + procedure CalculateReportPartSizes(ACell: TdxReportCell); + var + Width, I, V: Integer; + begin + if ACell.CellCount > 0 then + begin + Width := 0; + for I := 0 to ACell.CellCount - 1 do + begin + V := ACell.Cells[I].Width; + if Width < V then Width := V; + end; + ACell.BoundsRect := MakeRect(0, 0, Width, ACell.LastCell.BoundsRect.Bottom); + end; + end; + + begin + with AReportCells do + begin + CalculateReportPartSizes(Cells); + if AreFooterCellsAllocated then CalculateReportPartSizes(FooterCells); + if AreHeaderCellsAllocated then CalculateReportPartSizes(HeaderCells); + end; + end; + +begin + if Scheduler = nil then Exit; + inherited; + + if PrintStyles.ActiveStyle = nil then + Exit; + + PrepareConstruct; + try + BuildStyle; + if not AbortBuilding then CalculateSizes; + finally + UnprepareConstruct; + end; +end; + +procedure TcxSchedulerReportLink.DoCreateReport; +begin + if (PrintStyles.ActiveStyle = nil) or not PrintStyles.ActiveStyleAssigned then + PrintStyles.SetActiveStyleEx(PrintStyles.GetCorrespondingStyle); + inherited DoCreateReport; +end; + +function TcxSchedulerReportLink.GetRealScaleFactor: Integer; +begin + Result := 100; +end; + +procedure TcxSchedulerReportLink.CustomDraw(AItem: TAbstractdxReportCellData; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); +begin + case AItem.GetCustomDrawID of + cdidSchedulerContent: + DoCustomDrawContentCell(ACanvas, TcxSchedulerReportContentCell(AItem), ADone); + cdidSchedulerSchedulerHeader: + DoCustomDrawSchedulerHeaderCell(ACanvas, TcxSchedulerReportSchedulerHeaderDataCell(AItem), ADone); + cdidSchedulerDateNavigatorHeader: + DoCustomDrawDateNavigatorHeaderCell(ACanvas, TcxSchedulerReportDateNavigatorHeader(AItem), ADone); + cdidSchedulerDateNavigatorDay: + DoCustomDrawDateNavigatorDayCell(ACanvas, TcxSchedulerReportDateNavigatorDay(AItem), ADone); + cdidSchedulerDateNavigatorDayCaption: + DoCustomDrawDateNavigatorDayCaptionCell(ACanvas, TcxSchedulerReportDateNavigatorDayCaption(AItem), ADone); + cdidSchedulerDateNavigatorWeekNumber: + DoCustomDrawDateNavigatorWeekNumberCell(ACanvas, TcxSchedulerReportDateNavigatorWeekNumber(AItem), ADone); + cdidSchedulerTimeRuler: + DoCustomDrawTimeRulerCell(ACanvas, TcxSchedulerReportDailyTimeRulerCell(AItem), ADone); + cdidSchedulerEventCaption..cdidSchedulerEventTimeLine: + DoCustomDrawEventPartCell(ACanvas, AItem, ADone); + cdidSchedulerNotesArea: + DoCustomDrawNotesCell(ACanvas, TcxSchedulerReportNotesDataCell(AItem), ADone); + cdidSchedulerTaskPad: + DoCustomDrawTaskPadCell(ACanvas, TcxSchedulerReportNotesDataCell(AItem), ADone); + cdidSchedulerHeader: + DoCustomDrawHeaderCell(ACanvas, TcxSchedulerReportHeaderItemCell(AItem), ADone); + end; +end; + +procedure TcxSchedulerReportLink.DoCanPrintEvent(AEvent: TcxSchedulerEvent; + var AllowPrint: Boolean); +begin + if Assigned(FOnCanPrintEvent) then + FOnCanPrintEvent(Self, AEvent, AllowPrint); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawSchedulerHeaderCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportSchedulerHeaderDataCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawSchedulerHeaderCell) then + FOnCustomDrawSchedulerHeaderCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawDateNavigatorHeaderCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorHeader; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawDateNavigatorHeaderCell) then + FOnCustomDrawDateNavigatorHeaderCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawDateNavigatorDayCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorDay; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawDateNavigatorDayCell) then + FOnCustomDrawDateNavigatorDayCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawDateNavigatorDayCaptionCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorDayCaption; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawDateNavigatorDayCaptionCell) then + FOnCustomDrawDateNavigatorDayCaptionCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawDateNavigatorWeekNumberCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportDateNavigatorWeekNumber; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawDateNavigatorWeekNumberCell) then + FOnCustomDrawDateNavigatorWeekNumberCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawTimeRulerCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportDailyTimeRulerCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawTimeRulerCell) then + FOnCustomDrawTimeRulerCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawContentCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportContentCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawContentCell) then + FOnCustomDrawContentCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawHeaderCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportHeaderItemCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawHeaderCell) then + FOnCustomDrawHeaderCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawEventPartCell( + ACanvas: TCanvas; AItem: TAbstractdxReportCellData; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawEventPartCell) then + FOnCustomDrawEventPartCell(Self, ACanvas, AItem, + TcxSchedulerReportEventPartType(AItem.GetCustomDrawID - cdidSchedulerEventCaption), + ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawNotesCell(ACanvas: TCanvas; + AItem: TcxSchedulerReportNotesDataCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawNotesCell) then + FOnCustomDrawNotesCell(Self, ACanvas, AItem, ADone); +end; + +procedure TcxSchedulerReportLink.DoCustomDrawTaskPadCell( + ACanvas: TCanvas; AItem: TcxSchedulerReportNotesDataCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawTaskPadCell) then + FOnCustomDrawTaskPadCell(Self, ACanvas, AItem, ADone); +end; + +function TcxSchedulerReportLink.GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; +begin + if PrintStyles.ActiveStyle <> nil then + Result := PrintStyles.ActiveStyle.GetRebuildOnPageParamsChange(AUpdateCodes) + else + Result := inherited GetRebuildOnPageParamsChange(AUpdateCodes); +end; + +function TcxSchedulerReportLink.GetRendererClass: TdxPSReportRendererClass; +begin + Result := TcxSchedulerReportRenderer; +end; + +function TcxSchedulerReportLink.GetRenderInfoClass: TdxPSReportRenderInfoClass; +begin + Result := TcxSchedulerReportLinkRenderInfo; +end; + +procedure TcxSchedulerReportLink.InternalRestoreDefaults; +begin + inherited; + PrintRange.RestoreDefaults; + PrintStyles.RestoreDefaults; +end; + +procedure TcxSchedulerReportLink.InternalRestoreFromOriginal; +begin + inherited; +end; + +procedure TcxSchedulerReportLink.RebuildReport; +begin + inherited RebuildReport; + if DesignWindow <> nil then + DesignWindow.UpdatePreview; +end; + +procedure TcxSchedulerReportLink.PrepareConstruct; +begin + FLookAndFeelItems.Clear; + inherited PrepareConstruct; +end; + +procedure TcxSchedulerReportLink.UnprepareConstruct; +begin + FormatLookAndFeelItems; + inherited UnprepareConstruct; +end; + +procedure TcxSchedulerReportLink.CreateOptions; +begin + inherited CreateOptions; + FPrintRange := CreatePrintRange; + FPrintStyles := CreatePrintStyles; +end; + +procedure TcxSchedulerReportLink.DestroyOptions; +begin + FreeAndNil(FPrintStyles); + FreeAndNil(FPrintRange); + inherited DestroyOptions; +end; + +function TcxSchedulerReportLink.GetOptionsFormattingClass: TdxCustomReportLinkOptionsFormattingClass; +begin + Result := TcxSchedulerReportLinkOptionsFormatting; +end; + +function TcxSchedulerReportLink.CreatePrintRange: TcxSchedulerReportLinkPrintRange; +begin + Result := TcxSchedulerReportLinkPrintRange.Create(Self); +end; + +function TcxSchedulerReportLink.CreatePrintStyles: TcxSchedulerReportLinkPrintStyles; +begin + Result := TcxSchedulerReportLinkPrintStyles.Create(Self); +end; + +function TcxSchedulerReportLink.GetAreNativeStylesAvailable: Boolean; +begin + Result := OptionsFormatting.UseNativeStyles; +end; + +function TcxSchedulerReportLink.GetStylesClass: TdxCustomReportLinkStylesClass; +begin + Result := TcxSchedulerReportLinkStyles; +end; + +function TcxSchedulerReportLink.GetStyleSheetClass: TdxCustomReportLinkStyleSheetClass; +begin + Result := TcxSchedulerReportLinkStyleSheet; +end; + +function TcxSchedulerReportLink.GetStyleSheetPrototype: TdxCustomReportLinkStyleSheet; +begin + Result := SchedulerLinkStyleSheetPrototype; +end; + +procedure TcxSchedulerReportLink.ActivePrintStyleChanged; +begin + if not IsDestroying and not IsLoading then + begin + if Active then + begin + FreeRenderInfos; + FreeRenderer; + RebuildReport; + end; + DoActivePrintStyleChanged; + end; +end; + +procedure TcxSchedulerReportLink.DoActivePrintStyleChanged; +begin + if Assigned(FOnActivePrintStyleChanged) then FOnActivePrintStyleChanged(Self); +end; + +procedure TcxSchedulerReportLink.FormatLookAndFeelItems; +const + Borders3D: array[Boolean] of TdxPSCellBorderClass = + (TdxPSCellRaisedBorder, TdxPSCellRaisedSoftBorder); +var + I: Integer; +begin + for I := 0 to LookAndFeelItemCount - 1 do + with LookAndFeelItems[I] do + if Effects3D then + BorderClass := Borders3D[Soft3D] + else + BorderClass := TdxPSCellUltraFlatBorder; +end; + +procedure TcxSchedulerReportLink.RegisterLookAndFeelItem(AItem: TdxReportVisualItem; + AEdgeStyle: TdxCellEdgeStyle); +begin + AItem.EdgeMode := Self.EdgeMode; + AItem.Edge3DStyle := AEdgeStyle; + FLookAndFeelItems.Add(AItem); +end; + +procedure TcxSchedulerReportLink.DoInitializeSchedulingAreaCell( + AItem: TcxSchedulerReportSchedulingAreaCell); +begin + if Assigned(FOnInitializeSchedulingAreaCell) then + FOnInitializeSchedulingAreaCell(Self, AItem); +end; + +procedure TcxSchedulerReportLink.DoInitializeEventCell(AItem: TcxSchedulerReportCustomEventCell); +begin + if Assigned(FOnInitializeEventCell) then + FOnInitializeEventCell(Self, AItem); +end; + +procedure TcxSchedulerReportLink.DoInitializeHeaderPrimaryCell( + AItem: TcxSchedulerReportSchedulerHeaderCell); +begin + if Assigned(FOnInitializeHeaderPrimaryCell) then + FOnInitializeHeaderPrimaryCell(Self, AItem); +end; + +procedure TcxSchedulerReportLink.DoInitializeHeaderSecondaryCell( + AItem: TcxSchedulerReportSchedulerHeaderCell); +begin + if Assigned(FOnInitializeHeaderSecondaryCell) then + FOnInitializeHeaderSecondaryCell(Self, AItem); +end; + +procedure TcxSchedulerReportLink.DoInitializeNotesAreaCell( + AItem: TcxSchedulerReportNotesAreaCell); +begin + if Assigned(FOnInitializeNotesAreaCell) then + FOnInitializeNotesAreaCell(Self, AItem); +end; + +procedure TcxSchedulerReportLink.DoInitializeTaskPadCell( + AItem: TcxSchedulerReportTaskPadCell); +begin + if Assigned(FOnInitializeTaskPadCell) then + FOnInitializeTaskPadCell(Self, AItem); +end; + +procedure TcxSchedulerReportLink.AssignTaskPadData(ATaskPad: TcxSchedulerReportTaskPadCell); + + procedure CropData(ASite: TdxReportCell); + var + CropBounds, R: TRect; + I: Integer; + Cell: TdxReportCell; + begin + CropBounds := ASite.AbsoluteRect; + for I := ASite.CellCount - 1 downto 0 do + begin + Cell := ASite.Cells[I]; + if not IntersectRect(R, Cell.AbsoluteRect, CropBounds) then + Cell.Free; + end; + end; + +begin + if (TaskPadReportLink <> nil) and TaskPadReportLink.DataProviderPresent then + begin + TaskPadReportLink.Controller := Renderer.ReportLink; + try + TaskPadReportLink.RebuildReport; + ATaskPad.TaskPadDataSite.Assign(TaskPadReportLink.ReportCells.Cells); + CropData(ATaskPad.TaskPadDataSite); + ATaskPad.TaskPadDataSite.ClipChildren := True; + finally + TaskPadReportLink.Controller := nil; + end; + end; +end; + +procedure TcxSchedulerReportLink.InitializeTaskPadCell(ATaskPad: TcxSchedulerReportTaskPadCell); +begin + AssignTaskPadData(ATaskPad); + DoInitializeTaskPadCell(ATaskPad); +end; + +procedure TcxSchedulerReportLink.SetCellViewParams( + ACell: TdxReportVisualItem; const AParams: TcxViewParams); +var + AdxPSViewParams: TdxReportItemViewParams; +begin + if not Assigned(ACell) then Exit; + FillChar(AdxPSViewParams, SizeOf(AdxPSViewParams), 0); + AdxPSViewParams.NativeParams := AParams; + SetCellViewParams(ACell, AdxPSViewParams); +end; + +procedure TcxSchedulerReportLink.SetCellViewParams( + ACell: TdxReportVisualItem; const AParams: TdxReportItemViewParams); +var + AFont: TFont; + AHasBitmap: Boolean; +begin + if not Assigned(ACell) then Exit; + AFont := TFont.Create; + try + AFont.Assign(AParams.NativeParams.Font); + if not dxPSUtl.dxIsTrueTypeFont(AFont) then + AFont.Name := Font.Name; + AFont.Color := ColorToRGB(AParams.NativeParams.TextColor); + if AParams.FontSize <> 0 then + AFont.Size := AParams.FontSize; + AFont.Style := AFont.Style + AParams.FontStyle; + ACell.FontIndex := AddFontToPool(AFont); + ACell.Transparent := ACell.Transparent or AParams.Transparent; + with AParams.NativeParams do + begin + AHasBitmap := not OptionsFormatting.SuppressBackgroundBitmaps and + (Bitmap <> nil) and not Bitmap.Empty; + if AHasBitmap then + ACell.BackgroundBitmapIndex := AddBackgroundBitmapToPool(Bitmap); + end; + if OptionsFormatting.SuppressContentColoration and not AHasBitmap then + ACell.Color := clWhite + else + ACell.Color := ColorToRGB(AParams.NativeParams.Color); + finally + AFont.Free; + end; +end; + +function TcxSchedulerReportLink.AddPageSite( + const ABounds: TRect): TcxSchedulerReportPageSite; +begin + Result := TcxSchedulerReportPageSite.Create(ReportCells.Cells); + Result.BoundsRect := ABounds; + Result.CellSides := []; + Result.Transparent := True; + FPageSites.Add(Result); + AddVerticalDelimiter(Result); + AddHorizontalDelimiter(Result); +end; + +procedure TcxSchedulerReportLink.BuildStyle; +begin + FPageSites.Clear; + if PrintStyles.ActiveStyle <> nil then + with PrintStyles.ActiveStyle do + begin + BeforeBuild; + RenderInfo.FPageColCount := Byte(PrintStyles.ActiveStyle.Layout) + 1; + try + Build; + finally + AfterBuild; + end; + end; +end; + +function TcxSchedulerReportLink.GetActiveStyles: TcxSchedulerReportLinkStyles; +begin + Result := inherited ActiveStyles as TcxSchedulerReportLinkStyles; +end; + +function TcxSchedulerReportLink.GetDesignWindow: TcxfmSchedulerReportLinkDesignWindow; +begin + Result := inherited DesignWindow as TcxfmSchedulerReportLinkDesignWindow; +end; + +function TcxSchedulerReportLink.GetEdgeMode: TdxCellEdgeMode; +const + EdgeModeMap: array[Boolean] of TdxCellEdgeMode = (cemPattern, cem3DEffects); +begin + Result := EdgeModeMap[OptionsFormatting.LookAndFeelKind <> lfUltraFlat]; +end; + +function TcxSchedulerReportLink.GetLookAndFeelItem(Index: Integer): TdxReportVisualItem; +begin + Result := TdxReportVisualItem(FLookAndFeelItems[Index]); +end; + +function TcxSchedulerReportLink.GetLookAndFeelItemCount: Integer; +begin + Result := FLookAndFeelItems.Count; +end; + +function TcxSchedulerReportLink.GetOptionsFormatting: TcxSchedulerReportLinkOptionsFormatting; +begin + Result := inherited OptionsFormatting as TcxSchedulerReportLinkOptionsFormatting; +end; + +function TcxSchedulerReportLink.GetPrintStyles: TcxSchedulerReportLinkPrintStyles; +begin + Result := FPrintStyles; +end; + +function TcxSchedulerReportLink.GetRenderInfo: TcxSchedulerReportLinkRenderInfo; +begin + Result := TcxSchedulerReportLinkRenderInfo(inherited RenderInfo); +end; + +function TcxSchedulerReportLink.GetScheduler: TcxScheduler; +begin + Result := Component as TcxScheduler; +end; + +function TcxSchedulerReportLink.GetStyles: TcxSchedulerReportLinkStyles; +begin + Result := inherited Styles as TcxSchedulerReportLinkStyles; +end; + +procedure TcxSchedulerReportLink.SetOptionsFormatting(Value: TcxSchedulerReportLinkOptionsFormatting); +begin + inherited OptionsFormatting := Value; +end; + +procedure TcxSchedulerReportLink.SetPrintRange(Value: TcxSchedulerReportLinkPrintRange); +begin + PrintRange.Assign(Value); +end; + +procedure TcxSchedulerReportLink.SetPrintStyles(Value: TcxSchedulerReportLinkPrintStyles); +begin + FPrintStyles.Assign(Value); +end; + +procedure TcxSchedulerReportLink.SetStyles(Value: TcxSchedulerReportLinkStyles); +begin + inherited Styles := Value; +end; + +procedure TcxSchedulerReportLink.SetTaskPadReportLink(Value: TBasedxReportLink); +begin + if (Value <> Self) and (FTaskPadReportLink <> Value) then + begin + FTaskPadReportLink := Value; + if FTaskPadReportLink <> nil then + FTaskPadReportLink.FreeNotification(Self); + LinkModified(True); + end; +end; + +{ TcxSchedulerReportLinkPrintRange } + +procedure TcxSchedulerReportLinkPrintRange.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLinkPrintRange then + with TcxSchedulerReportLinkPrintRange(Source) do + begin + Move(FDatePrint, Self.FDatePrint[0], SizeOf(FDatePrint)); + Move(FTimePrint, Self.FTimePrint[0], SizeOf(FTimePrint)); + end; + inherited Assign(Source); +end; + +procedure TcxSchedulerReportLinkPrintRange.RestoreDefaults; +begin + inherited RestoreDefaults; + FDatePrint[0] := NullDate; + FDatePrint[1] := NullDate; + FTimePrint[0] := NullDate; + FTimePrint[1] := NullDate; +end; + +function TcxSchedulerReportLinkPrintRange.DefaultDatePrintFrom: TDate; +begin + if Scheduler <> nil then + Result := Scheduler.CurrentView.FirstVisibleDate + else + Result := Date; +end; + +function TcxSchedulerReportLinkPrintRange.DefaultDatePrintTo: TDate; +begin + if Scheduler <> nil then + Result := Scheduler.CurrentView.LastVisibleDate + else + Result := Date; +end; + +function TcxSchedulerReportLinkPrintRange.DefaultTimePrintFrom: TTime; +begin + if Scheduler <> nil then + Result := Scheduler.OptionsView.WorkStart + else + Result := 0; +end; + +function TcxSchedulerReportLinkPrintRange.DefaultTimePrintTo: TTime; +begin + if Scheduler <> nil then + Result := Scheduler.OptionsView.WorkFinish + else + Result := 0; +end; + +procedure TcxSchedulerReportLinkPrintRange.CheckTimeRange; +begin +{ if (PrintTo - PrintFrom) < 0 then + FPrintTo := DateOf(PrintFrom) + TimeOf(FPrintTo);} +end; + +function TcxSchedulerReportLinkPrintRange.GetDateTimeIF( + const AValue, ADefaultValue: TDateTime): TDateTime; +begin + Result := AValue; + if Trunc(Result) = NullDate then + Result := ADefaultValue; +end; + +function TcxSchedulerReportLinkPrintRange.DesignerTabIndex: Integer; +begin + Result := 0; +end; + +function TcxSchedulerReportLinkPrintRange.GetActiveStyle: TcxCustomSchedulerReportLinkPrintStyle; +begin + Result := ReportLink.PrintStyles.ActiveStyle; +end; + +function TcxSchedulerReportLinkPrintRange.GetDayCount: Integer; +begin + Result := Trunc(PrintTo) - Trunc(PrintFrom) + 1; + if Result < 1 then + Result := 1; +end; + +function TcxSchedulerReportLinkPrintRange.GetMonthCount: Integer; + + function MonthOfDate(const ADate: TDateTime): Integer; + var + Y, M, D: Word; + begin + DecodeDate(ADate, Y, M, D); + Result := Y * 12 + M; + end; + +begin + Result := MonthOfDate(PrintTo) - MonthOfDate(PrintFrom) + 1; +end; + +function TcxSchedulerReportLinkPrintRange.GetPrintDate(AIndex: Integer): TDate; +var + DefaultDate: TTime; +begin + if AIndex = 0 then + DefaultDate := DefaultDatePrintFrom + else + DefaultDate := DefaultDatePrintTo; + Result := GetDateTimeIF(DateOf(FDatePrint[AIndex]), DefaultDate); +end; + +function TcxSchedulerReportLinkPrintRange.GetPrintTime(AIndex: Integer): TTime; +var + DefaultTime: TTime; +begin + if AIndex = 0 then + DefaultTime := DefaultTimePrintFrom + else + DefaultTime := DefaultTimePrintTo; + Result := TimeOf(GetDateTimeIF(FTimePrint[AIndex], DefaultTime)); +end; + +function TcxSchedulerReportLinkPrintRange.GetWeekCount: Integer; +begin + Result := WeeksBetween(StartOfTheWeek(PrintFrom), IncDay(EndOfTheWeek(PrintTo))); + if Result < 1 then Result := 1; +end; + +procedure TcxSchedulerReportLinkPrintRange.SetPrintDate( + AIndex: Integer; const Value: TDate); +begin + if FDatePrint[AIndex] <> Value then + begin + FDatePrint[AIndex] := Value; + Changed; + end; +end; + +procedure TcxSchedulerReportLinkPrintRange.SetPrintTime( + AIndex: Integer; const Value: TTime); +begin + if FTimePrint[AIndex] <> Value then + begin + FTimePrint[AIndex] := Value; + Changed; + end; +end; + +function TcxSchedulerReportLinkPrintRange.IsDateStored( + AIndex: Integer): Boolean; +begin + Result := FDatePrint[AIndex] <> NullDate; +end; + +function TcxSchedulerReportLinkPrintRange.IsTimeStored( + AIndex: Integer): Boolean; +begin + Result := FTimePrint[AIndex] <> NullDate; +end; + +{ TcxSchedulerReportLinkOptionsFormatting } + +procedure TcxSchedulerReportLinkOptionsFormatting.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxSchedulerReportLinkOptionsFormatting then + with TcxSchedulerReportLinkOptionsFormatting(Source) do + begin + Self.SuppressContentColoration := SuppressContentColoration; + end; +end; + +procedure TcxSchedulerReportLinkOptionsFormatting.RestoreDefaults; +begin + inherited; + SuppressContentColoration := False; +end; + +function TcxSchedulerReportLinkOptionsFormatting.DesignerTabIndex: Integer; +begin + Result := 2; +end; + +function TcxSchedulerReportLinkOptionsFormatting.GetReportLink: TcxSchedulerReportLink; +begin + Result := inherited ReportLink as TcxSchedulerReportLink; +end; + +procedure TcxSchedulerReportLinkOptionsFormatting.SetSuppressContentColoration(Value: Boolean); +begin + if FSuppressContentColoration <> Value then + begin + FSuppressContentColoration := Value; + Changed; + end; +end; + +{ TcxCustomSchedulerReportLinkOptions } + +function TcxCustomSchedulerReportLinkOptions.GetReportLink: TcxSchedulerReportLink; +begin + Result := inherited ReportLink as TcxSchedulerReportLink; +end; + +function TcxCustomSchedulerReportLinkOptions.GetScheduler: TcxScheduler; +begin + if ReportLink <> nil then + Result := ReportLink.Scheduler + else + Result := nil; +end; + +{ TcxSchedulerReportLinkStyles } + +constructor TcxSchedulerReportLinkStyles.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + BitmapInViewParams := True; +end; + +procedure TcxSchedulerReportLinkStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxSchedulerReportLinkStyles then + with TcxSchedulerReportLinkStyles(Source) do + begin + Self.SchedulerHeader := SchedulerHeader; + Self.Content := Content; + Self.DateNavigatorContent := DateNavigatorContent; + Self.DateNavigatorHeader := DateNavigatorHeader; + Self.DayHeader := DayHeader; + Self.Event := Event; + Self.ResourceHeader := ResourceHeader; + Self.NotesAreaBlank := NotesAreaBlank; + Self.NotesAreaLined := NotesAreaLined; + Self.TaskPad := TaskPad; + Self.TimeRuler := TimeRuler; + end; +end; + +function TcxSchedulerReportLinkStyles.GetSchedulerHeaderParams: TcxViewParams; +begin + GetViewParams(vspsSchedulerSchedulerHeader, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetContentParams(const ADateTime: TDateTime; + AResource: TcxSchedulerStorageResourceItem): TcxViewParams; +begin + if UseSchedulerStyles then + Result := ExtStyles.GetContentParams(ADateTime, AResource) + else + GetViewParams(vspsSchedulerContent, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetContentParams(const ADateTime: TDateTime; + ALightColor: Boolean; AResource: TcxSchedulerStorageResourceItem): TcxViewParams; +begin + if UseSchedulerStyles then + Result := ExtStyles.GetContentParams(ADateTime, ALightColor, AResource) + else + GetViewParams(vspsSchedulerContent, nil, nil, Result) +end; + +function TcxSchedulerReportLinkStyles.GetDateNavigatorContentParams: TcxViewParams; +begin + if UseSchedulerStyles then + begin + Result := TcxSchedulerDateNavigator( + ExtStyles.Scheduler.DateNavigator).Styles.GetContentParams + end + else + GetViewParams(vspsSchedulerDateNavigatorContent, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetDateNavigatorHeaderParams: TcxViewParams; +begin + if UseSchedulerStyles then + begin + Result := TcxSchedulerDateNavigator( + ExtStyles.Scheduler.DateNavigator).Styles.GetHeaderParams + end + else + GetViewParams(vspsSchedulerDateNavigatorHeader, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetDayHeaderParams( + const ADateTime: TDateTime): TcxViewParams; +begin + if UseSchedulerStyles then + Result := ExtStyles.GetDayHeaderParams(ADateTime) + else + GetViewParams(vspsSchedulerDayHeader, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetEventParams( + AEvent: TcxSchedulerEvent): TcxViewParams; +begin + if UseSchedulerStyles then + Result := ExtStyles.GetEventContentParams(AEvent) + else + GetViewParams(vspsSchedulerEvent, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetNotesAreaBlankParams: TcxViewParams; +begin + GetViewParams(vspsSchedulerNotesAreaBlank, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetNotesAreaLinedParams: TcxViewParams; +begin + GetViewParams(vspsSchedulerNotesAreaLined, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetResourceHeaderParams( + AResource: TcxSchedulerStorageResourceItem): TcxViewParams; +begin + if UseSchedulerStyles then + Result := ExtStyles.GetResourceHeaderParams(AResource) + else + GetViewParams(vspsSchedulerResourceHeader, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetTaskPadParams: TcxViewParams; +begin + GetViewParams(vspsSchedulerTaskPad, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.GetTimeRulerParams: TcxViewParams; +begin + if UseSchedulerStyles then + Result := ReportLink.Scheduler.ViewDay.Styles.GetTimeRulerParams + else + GetViewParams(vspsSchedulerTimeRuler, nil, nil, Result); +end; + +function TcxSchedulerReportLinkStyles.DesignerTabIndex: Integer; +begin + Result := 3; +end; + +procedure TcxSchedulerReportLinkStyles.GetDefaultViewParams(Index: Integer; + AData: TObject; out AParams: TcxViewParams); +const + FixedParts = [vspsSchedulerDayHeader, vspsSchedulerResourceHeader, vspsSchedulerTimeRuler]; +begin + inherited; + if ReportLink <> nil then + with AParams do + begin + if Index in FixedParts then + Color := dxPSCore.dxDefaultFixedColor + else + Color := dxDefaultContentColor; + Font := ReportLink.Font; + TextColor := Font.Color; + end; +end; + +class function TcxSchedulerReportLinkStyles.GetStyleCaption(AnIndex: Integer): string; +begin + case AnIndex of + vspsSchedulerSchedulerHeader: + Result := cxGetResourceString(@sdxSchedulerSchedulerHeader); + vspsSchedulerContent: + Result := cxGetResourceString(@sdxSchedulerContent); + vspsSchedulerDateNavigatorContent: + Result := cxGetResourceString(@sdxSchedulerDateNavigatorContent); + vspsSchedulerDateNavigatorHeader: + Result := cxGetResourceString(@sdxSchedulerDateNavigatorHeader); + vspsSchedulerDayHeader: + Result := cxGetResourceString(@sdxSchedulerDayHeader); + vspsSchedulerEvent: + Result := cxGetResourceString(@sdxSchedulerEvent); + vspsSchedulerResourceHeader: + Result := cxGetResourceString(@sdxSchedulerResourceHeader); + vspsSchedulerNotesAreaBlank: + Result := cxGetResourceString(@sdxSchedulerNotesAreaBlank); + vspsSchedulerNotesAreaLined: + Result := cxGetResourceString(@sdxSchedulerNotesAreaLined); + vspsSchedulerTaskPad: + Result := cxGetResourceString(@sdxSchedulerTaskPad); + else {vspsSchedulerTimeRuler} + Result := cxGetResourceString(@sdxSchedulerTimeRuler); + end; +end; + +function TcxSchedulerReportLinkStyles.GetStyleIndexByCaption(const Caption: string): Integer; +begin + for Result := vspsSchedulerFirst to vspsSchedulerLast do + if dxPSUtl.dxSameText(Caption, GetStyleCaption(Result)) then + Exit; + Result := -1; +end; + +// IcxSchedulerStylesAdapter +function TcxSchedulerReportLinkStyles.GetDayHeaderStyle: TcxStyle; +begin + if UseSchedulerStyles then + Result := ExtStyles.DayHeader + else + Result := DayHeader; +end; + +function TcxSchedulerReportLinkStyles.GetResourceHeaderStyle: TcxStyle; +begin + if UseSchedulerStyles then + Result := ExtStyles.ResourceHeader + else + Result := ResourceHeader; +end; + +function TcxSchedulerReportLinkStyles.GetExtStyles: TcxSchedulerStyles; +begin + Result := ReportLink.Scheduler.Styles; +end; + +function TcxSchedulerReportLinkStyles.GetReportLink: TcxSchedulerReportLink; +begin + Result := inherited ReportLink as TcxSchedulerReportLink; + if Result = nil then + Result := FReportLink; +end; + +function TcxSchedulerReportLinkStyles.GetUseSchedulerStyles: Boolean; +begin + if ReportLink = nil then + begin + Result := False; + Exit; + end; + Result := not ReportLink.OptionsFormatting.UseNativeStyles; + if not Result then + Result := (ReportLink = nil) or (ReportLink.Scheduler = nil); +end; + +{ TcxSchedulerReportLinkStyleSheet } + +class function TcxSchedulerReportLinkStyleSheet.GetStylesClass: TcxCustomStylesClass; +begin + Result := TcxSchedulerReportLinkStyles; +end; + +function TcxSchedulerReportLinkStyleSheet.GetStylesValue: TcxSchedulerReportLinkStyles; +begin + if GetStyles is TcxSchedulerReportLinkStyles then + Result := TcxSchedulerReportLinkStyles(GetStyles) + else + Result := nil; +end; + +procedure TcxSchedulerReportLinkStyleSheet.SetStylesValue(Value: TcxSchedulerReportLinkStyles); +begin + SetStyles(Value); +end; + +{ TcxSchedulerReportLinkPrintStyles } + +procedure TcxSchedulerReportLinkPrintStyles.Assign(Source: TPersistent); +var + I: Integer; +begin + if Source is TcxSchedulerReportLinkPrintStyles then + for I := 0 to Count - 1 do + Items[I] := TcxSchedulerReportLinkPrintStyles(Source).Items[I]; + inherited; +end; + +procedure TcxSchedulerReportLinkPrintStyles.RestoreDefaults; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].RestoreDefaults; + inherited; +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleByClass( + AClass: TcxCustomSchedulerReportLinkPrintStyleClass): TcxCustomSchedulerReportLinkPrintStyle; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I]; + if Result.ClassType = AClass then Exit; + end; + Result := nil; +end; + +function TcxSchedulerReportLinkPrintStyles.GetCorrespondingStyle: TcxCustomSchedulerReportLinkPrintStyle; +begin + Result := nil; + if Scheduler = nil then Exit; + Result := GetStyleByView(Scheduler.CurrentView) +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleByName( + const Name: string): TcxCustomSchedulerReportLinkPrintStyle; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I]; + if CompareText(Result.Caption, Name) = 0 then Exit; + end; + Result := nil; +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleByView( + View: TcxSchedulerCustomView): TcxCustomSchedulerReportLinkPrintStyle; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I]; + if Result.IsCompatibleWith(View) then Exit; + end; + Result := nil; +end; + +function TcxSchedulerReportLinkPrintStyles.IndexOf(AItem: TcxCustomSchedulerReportLinkPrintStyle): Integer; +begin + Result := FItems.IndexOf(AItem); +end; + +procedure TcxSchedulerReportLinkPrintStyles.CreateObjects; +begin + inherited CreateObjects; + FItems := TList.Create; + CreateStyles; +end; + +procedure TcxSchedulerReportLinkPrintStyles.DestroyObjects; +begin + DestroyStyles; + FreeAndNil(FItems); + inherited DestroyObjects; +end; + +function TcxSchedulerReportLinkPrintStyles.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +function TcxSchedulerReportLinkPrintStyles.CreateStyle( + AStyleClass: TcxCustomSchedulerReportLinkPrintStyleClass): TcxCustomSchedulerReportLinkPrintStyle; +begin + Result := AStyleClass.Create(Self); + FItems.Add(Result); +end; + +procedure TcxSchedulerReportLinkPrintStyles.CreateStyles; +begin + CreateStyle(TcxSchedulerReportLinkDailyPrintStyle); + CreateStyle(TcxSchedulerReportLinkWeeklyPrintStyle); + CreateStyle(TcxSchedulerReportLinkMonthlyPrintStyle); + CreateStyle(TcxSchedulerReportLinkTrifoldPrintStyle); + CreateStyle(TcxSchedulerReportLinkDetailsPrintStyle); + CreateStyle(TcxSchedulerReportLinkMemoPrintStyle); +end; + +procedure TcxSchedulerReportLinkPrintStyles.DestroyStyles; +var + I: Integer; +begin + for I := Count - 1 downto 0 do + Items[I].Free; + FItems.Clear; +end; + +procedure TcxSchedulerReportLinkPrintStyles.GetStyleByClassEx( + AClass: TcxCustomSchedulerReportLinkPrintStyleClass; var AInstance); +begin + TPersistent(AInstance) := GetStyleByClass(AClass); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetActiveStyleEx( + Value: TcxCustomSchedulerReportLinkPrintStyle); +begin + if (ActiveStyle <> Value) or ActiveStyleAssigned then + begin + FActiveStyle := Value; + ActiveStyleAssigned := False; + end; +end; + +procedure TcxSchedulerReportLinkPrintStyles.ActiveStyleChanged; +begin + if ReportLink <> nil then + ReportLink.ActivePrintStyleChanged; +end; + +procedure TcxSchedulerReportLinkPrintStyles.StyleChanged(AStyle: TcxCustomSchedulerReportLinkPrintStyle); +begin + Changed; +end; + +function TcxSchedulerReportLinkPrintStyles.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxSchedulerReportLinkPrintStyles.GetItem( + Index: Integer): TcxCustomSchedulerReportLinkPrintStyle; +begin + Result := TcxCustomSchedulerReportLinkPrintStyle(FItems[Index]); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleDaily: TcxSchedulerReportLinkDailyPrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkDailyPrintStyle, Result); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleDetails: TcxSchedulerReportLinkDetailsPrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkDetailsPrintStyle, Result); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleMemo: TcxSchedulerReportLinkMemoPrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkMemoPrintStyle, Result); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleMonthly: TcxSchedulerReportLinkMonthlyPrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkMonthlyPrintStyle, Result); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleTrifold: TcxSchedulerReportLinkTrifoldPrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkTrifoldPrintStyle, Result); +end; + +function TcxSchedulerReportLinkPrintStyles.GetStyleWeekly: TcxSchedulerReportLinkWeeklyPrintStyle; +begin + GetStyleByClassEx(TcxSchedulerReportLinkWeeklyPrintStyle, Result); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetActiveStyle( + Value: TcxCustomSchedulerReportLinkPrintStyle); +begin + if (FActiveStyle <> Value) or not FActiveStyleAssigned then + begin + FActiveStyle := Value; + FActiveStyleAssigned := Value <> nil; + ActiveStyleChanged; + DesignerModified; + end; +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetActiveStyleAssigned( + Value: Boolean); +begin + if FActiveStyleAssigned <> Value then + begin + FActiveStyleAssigned := Value; + DesignerModified; + end; +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetItem(Index: Integer; + Value: TcxCustomSchedulerReportLinkPrintStyle); +begin + Items[Index].Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleDaily( + Value: TcxSchedulerReportLinkDailyPrintStyle); +begin + Daily.Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleDetails( + Value: TcxSchedulerReportLinkDetailsPrintStyle); +begin + GetStyleDetails.Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleMemo( + Value: TcxSchedulerReportLinkMemoPrintStyle); +begin + GetStyleMemo.Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleMonthly( + Value: TcxSchedulerReportLinkMonthlyPrintStyle); +begin + Monthly.Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleTrifold( + Value: TcxSchedulerReportLinkTrifoldPrintStyle); +begin + GetStyleTrifold.Assign(Value); +end; + +procedure TcxSchedulerReportLinkPrintStyles.SetStyleWeekly( + Value: TcxSchedulerReportLinkWeeklyPrintStyle); +begin + Weekly.Assign(Value); +end; + +{ TcxCustomSchedulerReportLinkPrintStyle } + +constructor TcxCustomSchedulerReportLinkPrintStyle.Create(AStyles: TcxSchedulerReportLinkPrintStyles); +begin + inherited Create; + FStyles := AStyles; + FCaption := DefaultCaption; + CreateObjects; + RestoreDefaults; +end; + +destructor TcxCustomSchedulerReportLinkPrintStyle.Destroy; +begin + Active := False; + DestroyObjects; + inherited Destroy; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.Assign(Source: TPersistent); +var + ASource: TcxCustomSchedulerReportLinkPrintStyle; +begin + if Source is TcxCustomSchedulerReportLinkPrintStyle then + begin + ASource := TcxCustomSchedulerReportLinkPrintStyle(Source); + Caption := ASource.Caption; + CompressWeekends := ASource.CompressWeekends; + DontPrintWeekends := ASource.DontPrintWeekends; + Layout := ASource.Layout; + ResourceCountPerPage := ASource.ResourceCountPerPage; + ShowNotesAreaBlank := ASource.ShowNotesAreaBlank; + ShowNotesAreaLined := ASource.ShowNotesAreaLined; + ShowTaskPad := ASource.ShowTaskPad; + if SupportTimeRange then + begin + TimePrintFrom := ASource.TimePrintFrom; + TimePrintTo := ASource.TimePrintTo; + end; + end + else + inherited; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.DefaultCaption: string; +begin + Result := ''; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IsCompatibleWith(AView: TcxSchedulerCustomView): Boolean; +begin + Result := False; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.RestoreDefaults; +begin + FCaption := DefaultCaption; + FCompressWeekends := True; + FDontPrintWeekends := False; + FLayout := pslOnePage; + ResourceCountPerPage := 0; + ShowNotesAreaBlank := False; + ShowNotesAreaLined := False; + ShowTaskPad := False; + if SupportTimeRange and (Scheduler <> nil) then + begin + TimePrintFrom := TimeOf(Scheduler.OptionsView.WorkStart); + TimePrintTo := TimeOf(Scheduler.OptionsView.WorkFinish); + end; +end; + +// IdxReportLinkController +function TcxCustomSchedulerReportLinkPrintStyle.GetControlSiteBounds(AControl: TControl): TRect; +begin + Result := NullRect; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.Build; +begin + FBoldedDays := TcxSchedulerDateList.Create; + try + if Storage <> nil then + begin + Events.SelStart := PrintRange.PrintFrom - 30; + Events.SelFinish := PrintRange.PrintTo + 30; + Storage.GetEvents(Events, Events.SelStart, Events.SelFinish); + end; + Events.ExtractUsedDays(FBoldedDays); + PrepareEvents; + BuildPages; + Events.Clear; + UsedDays.Clear; + finally + FreeAndNil(FBoldedDays); + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.BuildPages; +var + I: Integer; +begin + for I := 0 to PeriodCount - 1 do + begin + CreateLayoutForPeriod(I); + Progress(100 * (I + 1) / PeriodCount); + if ReportLink.AbortBuilding or ReportLink.LinkInPreviewMode then Break; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.BuildSchedulerCells( + ASite: TcxSchedulerReportSchedulingAreaCell); +var + APageIndex, APeriodIndex, ASubIndex: Integer; +begin + APageIndex := ASite.PageIndex; + GetPagePeriodAndIndex(APageIndex, APeriodIndex, ASubIndex); + FillDatesForPage(ASite.VisibleDays, APageIndex, APeriodIndex, ASubIndex); + with CreateSchedulingCellsProducer(ASite) do + try + Produce; + finally + Free; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.PrepareEvents; +var + I: Integer; + AEvent: TcxSchedulerEvent; + AllowPrint: Boolean; +begin + for I := 0 to FEvents.AbsoluteCount - 1 do + begin + AEvent := FEvents.AbsoluteItems[I]; + AllowPrint := True; + DoCanPrintEvent(AEvent, AllowPrint); + if not AllowPrint then + FEvents.Remove(AEvent); + end; + FEvents.Sort(TcxCompareEventsProc(@cxCompareSchedulerControlEvents)); + TcxSchedulerCachedEventListAccess(FEvents).Changed; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.DoCanPrintEvent( + AEvent: TcxSchedulerEvent; var AllowPrint: Boolean); +begin + ReportLink.DoCanPrintEvent(AEvent, AllowPrint); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.Progress(APercentDone: Double); +begin + if ReportLink <> nil then + ReportLink.DoProgress(APercentDone); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.AfterBuild; +begin + VisualStyles.FReportLink := nil; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.BeforeBuild; +begin + VisualStyles.FReportLink := ReportLink; + CurrentDate := PrintRange.PrintFrom; + FPagesPerPeriod := GetPagesPerPeriod; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.QueryInterface(const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +function TcxCustomSchedulerReportLinkPrintStyle._AddRef: Integer; +begin + Result := 1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle._Release: Integer; +begin + Result := 1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetDC: HDC; +begin + Result := ReportLink.Renderer.DC; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetDisplayGraphicsAsText: Boolean; +begin + Result := ReportLink.OptionsRefinements.DisplayGraphicsAsText; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetEndEllipsis: Boolean; +begin + Result := False; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetFlatCheckMarks: Boolean; +begin + Result := ReportLink.OptionsRefinements.FlatCheckMarks; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetGraphicsText: string; +begin + Result := ReportLink.OptionsRefinements.GraphicsText; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetMultiline: Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams_GetTransparentGraphics: Boolean; +begin + Result := ReportLink.OptionsRefinements.TransparentGraphics; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams2_GetPreviewMarginLeft: Integer; +begin + Result := 2; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams2_GetPreviewMarginRight: Integer; +begin + Result := 2; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams2_GetPreviewMaxHeight: Integer; +begin + Result := -1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams2_GetPreviewMaxLineCount: Integer; +begin + Result := -1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams2_GetRichEditGraphicClass: TGraphicClass; +const + GraphicClasses: array[Boolean] of TGraphicClass = (TMetafile, TBitmap); +begin + Result := GraphicClasses[IdxPSCellParams2_GetRichEditTransparent]; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IdxPSCellParams2_GetRichEditTransparent: Boolean; +begin + {$IFDEF DXVER500} + Result := ReportLink.OptionsRefinements.TransparentRichEdits; + {$ELSE} + Result := False; + {$ENDIF} +end; + +function TcxCustomSchedulerReportLinkPrintStyle.AddPageSite( + const ABounds: TRect): TcxSchedulerReportPageSite; +begin + Result := ReportLink.AddPageSite(ABounds); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.Changed; +begin + if Styles <> nil then Styles.StyleChanged(Self); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreateObjects; +begin + FUsedDays := TcxSchedulerDateList.Create; + FEvents := TcxSchedulerCachedEventList.Create; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.DestroyObjects; +begin + FEvents.Free; + FUsedDays.Free; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPageCount: Integer; +begin + Result := 0; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetRebuildOnPageParamsChange( + AnUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetActualDatePrintFrom: TDate; +begin + if PrintRange <> nil then + Result := PrintRange.PrintFrom + else + Result := 0; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetActualDatePrintTo: TDate; +begin + if PrintRange <> nil then + Result := PrintRange.PrintTo + else + Result := 0; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetCorrespondedView: TcxSchedulerCustomResourceView; +begin + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPagesPerPeriod: Integer; +begin + Result := 1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetGlyphIndex: Integer; +begin + Result := -1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPreviewGlyphIndex: Integer; +begin + Result := GetGlyphIndex; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetSchedulerHeaderParams: TdxReportItemViewParams; +begin + FillChar(Result, SizeOf(Result), 0); + Result.NativeParams := VisualStyles.GetSchedulerHeaderParams; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.DrawDesignWindowPreview(ACanvas: TCanvas; const ABounds: TRect); +var + ALeft, ATop: Integer; +begin + with ABounds do + begin + ALeft := (Left + Right - StylePreviewImages.Width) div 2; + ATop := (Top + Bottom - StylePreviewImages.Height) div 2; + end; + StylePreviewImages.Draw(ACanvas, ALeft, ATop, PreviewGlyphIndex); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetResourcePageCount: Integer; +begin + Result := ResourceCountPerPage; + if Result = 0 then + Result := 1 + else + if ResourceCount > 0 then + begin + Result := ResourceCount div ResourceCountPerPage + + Byte(ResourceCount mod ResourceCountPerPage > 0); + end; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetShowDateNavigator( + APageIndex: Integer): Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetShowNotesAreaBlank: Boolean; +begin + Result := FShowNotesAreaBlank; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetBoolOption( + var AOption: Boolean; Value: Boolean); +begin + if AOption <> Value then + begin + AOption := Value; + Changed; + end; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.SupportTimeRange: Boolean; +begin + Result := False; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.SupportIcons: Boolean; +begin + Result := False; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.SupportMessage: Boolean; +begin + Result := False; +end; + +// report cells creation + +function TcxCustomSchedulerReportLinkPrintStyle.CreateSchedulingAreaCell( + ASite: TdxReportCell): TcxSchedulerReportSchedulingAreaCell; +begin + Result := TcxSchedulerReportSchedulingAreaCell.Create(ASite); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; +begin + Result := TcxSchedulerReportCommonCellsProducer.CreateEx(Self, ASite); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CreateDateNavigatorCell( + ASite: TdxReportCell; AYear, AMonth: Word): TcxSchedulerReportDateNavigatorCell; +begin + with Scheduler.DateNavigator do + begin + Result := TcxSchedulerReportDateNavigatorCell.CreateEx(ASite, + ActualFirstWeekOfYear, AYear, AMonth, ShowDatesContainingEventsInBold, ShowWeekNumbers); + Result.FBoldedDays := Self.FBoldedDays; + end; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CreateHeaderCell( + ASite: TdxReportCell): TcxSchedulerReportSchedulerHeaderCell; +begin + Result := TcxSchedulerReportSchedulerHeaderCell.Create(ASite); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CreateNotesCell( + ASite: TdxReportCell): TcxSchedulerReportNotesAreaCell; +begin + Result := TcxSchedulerReportNotesAreaCell.CreateEx(ASite, False); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CreateNotesLinedCell( + ASite: TdxReportCell): TcxSchedulerReportNotesAreaCell; +begin + Result := TcxSchedulerReportNotesAreaCell.CreateEx(ASite, True); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CreateTaskPadCell( + ASite: TdxReportCell): TcxSchedulerReportTaskPadCell; +begin + Result := TcxSchedulerReportTaskPadCell.CreateEx(ASite, False); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.InitHeaderCell( + ACell: TcxSchedulerReportSchedulerHeaderCell); +begin + ReportLink.SetCellViewParams(ACell, GetSchedulerHeaderParams); + ReportLink.SetCellViewParams(ACell.Content, GetSchedulerHeaderParams); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.InitReportCell( + ACell: TdxReportCell; const ABounds: TRect): TdxReportCell; + + procedure InitAdditionalAreaCell(const AViewParams: TcxViewParams); + begin + ReportLink.SetCellViewParams(ACell, AViewParams); + ReportLink.SetCellViewParams(TcxSchedulerReportNotesAreaCell( + ACell).DataCell, AViewParams); + end; + +begin + ACell.BoundsRect := ABounds; + Result := ACell; + if ReportLink = nil then Exit; + ACell.Transparent := not ReportLink.OptionsFormatting.UseNativeStyles; + if ACell is TcxSchedulerReportPageItemCell then + begin + case TcxSchedulerReportPageItemCell(ACell).GetType of + srSchedulingArea: + begin + BuildSchedulerCells(TcxSchedulerReportSchedulingAreaCell(ACell)); + ReportLink.DoInitializeSchedulingAreaCell( + TcxSchedulerReportSchedulingAreaCell(ACell)); + end; + srHeader: + InitHeaderCell(TcxSchedulerReportSchedulerHeaderCell(ACell)); + srNotesBlank: + begin + InitAdditionalAreaCell(VisualStyles.GetNotesAreaBlankParams); + ReportLink.DoInitializeNotesAreaCell( + TcxSchedulerReportNotesAreaCell(ACell)); + end; + srNotesLined: + begin + InitAdditionalAreaCell(VisualStyles.GetNotesAreaLinedParams); + ReportLink.DoInitializeNotesAreaCell( + TcxSchedulerReportNotesAreaCell(ACell)); + end; + srTaskPad: + begin + InitAdditionalAreaCell(VisualStyles.GetTaskPadParams); + ReportLink.InitializeTaskPadCell( + TcxSchedulerReportTaskPadCell(ACell)); + end; + end; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CorrectBoundsWithHeader( + AHeader: TcxSchedulerReportSchedulerHeaderCell; var ABounds: TRect); +begin + if not AHeader.Visible then + ABounds.Top := 0 + else + ABounds.Top := AHeader.BoundsRect.Bottom + InterAreaSpace; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreateAdditionalControls( + ASite: TdxReportCell; AHasCalendar, AHasTaskPad, AHasNotes, + AHasNotesLined, ARightSide: Boolean; var ABounds: TRect); +var + R: array[0..2] of TRect; + C: Integer; + + function GetAreaBounds(AllowShow: Boolean; + var ABounds: TRect; var AIndex: Integer): Boolean; + begin + Result := AllowShow; + if not Result then Exit; + ABounds := R[AIndex]; + Inc(AIndex); + end; + + procedure CreateCells; + var + AIndex: Integer; + ABounds: TRect; + begin + AIndex := 0; + if GetAreaBounds(AHasTaskPad, ABounds, AIndex) then + InitReportCell(CreateTaskPadCell(ASite), ABounds); + if GetAreaBounds(AHasNotes, ABounds, AIndex) then + InitReportCell(CreateNotesCell(ASite), ABounds); + if GetAreaBounds(AHasNotesLined, ABounds, AIndex) then + InitReportCell(CreateNotesLinedCell(ASite), ABounds); + end; + +begin + C := Byte(AHasTaskPad) + Byte(AHasNotes) + Byte(AHasNotesLined); + if C = 0 then Exit; + SplitToRects(ABounds, AHasCalendar, ARightSide, ABounds, R[0]); + if C = 2 then + Rect2RectsVert(R[0], R[0], R[1]) + else + if C = 3 then + begin + if AHasCalendar then + Rect2RectsVert(R[0], R[0], R[1], R[2]) + else + begin + Rect2RectsVert(R[0], R[1], R[0]); + Rect2RectsHorz(R[1], R[1], R[2]); + end; + end; + CreateCells; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreateControlsOnFirstPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +begin +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreateControlsOnSecondPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +begin +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreateHeaderDateNavigator( + AHeader: TcxSchedulerReportSchedulerHeaderCell; APageIndex: Integer; out ABounds: TRect); +var + R: TRect; + Y, M, D: Word; + AHeight, H, ALeft: Integer; + CP, HP: TdxReportItemViewParams; + ACell: TcxSchedulerReportDateNavigatorCell; +begin + FillChar(CP, SizeOf(CP), 0); + FillChar(HP, SizeOf(HP), 0); + AHeight := ABounds.Bottom - ABounds.Top; + CP.NativeParams := VisualStyles.GetDateNavigatorContentParams; + HP.NativeParams := VisualStyles.GetDateNavigatorHeaderParams; + HP.Transparent := not ReportLink.OptionsFormatting.UseNativeStyles; + GetPageDateNavigatorInfo(APageIndex, Y, M); + ACell := CreateDateNavigatorCell(AHeader, Y, M); + H := ACell.MeasureDateNavigatorHeight(CP.NativeParams, HP.NativeParams); + if H > AHeight then + ACell.AdjustSize(CP, HP, H, AHeight); + R.TopLeft := Point(0, 0); + R.BottomRight := TPoint(ACell.CalculateSize(CP, HP)); + OffsetRect(R, ABounds.Right - ABounds.Left - R.Right, 0); + InflateRect(R, 0, -3); + ACell.BoundsRect := R; + ALeft := R.Left; + if PrintRange.MonthCount > 1 then + begin + IncAMonth(Y, M, D); + ACell.BoundsRect := cxRectSetRight(R, R.Left); + ALeft := R.Left - (R.Right - R.Left); + ACell := CreateDateNavigatorCell(AHeader, Y, M); + if H > AHeight then + ACell.AdjustSize(CP, HP, H, AHeight); + ACell.CalculateSize(CP, HP); + ACell.BoundsRect := R; + end; + AHeader.Content.BoundsRect := MakeRect(ABounds.Left + cxTextOffset, + ABounds.Top + cxTextOffset, ALeft, ABounds.Bottom - cxTextOffset); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreateLayoutForPeriod( + APeriodIndex: Integer); +var + APageIndex: Integer; + R: TRect; + APage: TcxSchedulerReportPageSite; + AHeader: TcxSchedulerReportSchedulerHeaderCell; +begin + APageIndex := GetPageIndex(APeriodIndex, 0); + CreatePageSiteWithHeader(APageIndex, APage, AHeader, R); + CorrectBoundsWithHeader(AHeader, R); + CreateControlsOnFirstPage(APageIndex, APage, AHeader, R); + if Layout = pslTwoPages then + begin + CreatePageSiteWithHeader(APageIndex + 1, APage, AHeader, R, False); + CorrectBoundsWithHeader(AHeader, R); + CreateControlsOnSecondPage(APageIndex + 1, APage, AHeader, R); + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.CreatePageSiteWithHeader( + APageIndex: Integer; out ASite: TcxSchedulerReportPageSite; + out AHeader: TcxSchedulerReportSchedulerHeaderCell; + out ABounds: TRect; AIsPrimary: Boolean = True); +var + R: TRect; +begin + ABounds := GetPageSiteBounds(APageIndex); + ASite := AddPageSite(ABounds); + ASite.FPageIndex := APageIndex; + ASite.FPrimaryPage := AIsPrimary; + ABounds := ASite.GetInnerBounds(0); + if GetHasPageReportTitle(APageIndex) then + Inc(ABounds.Top, ReportLink.RenderInfo.CalculateTitleHeight); + if GetHasPageHeader(APageIndex) then + begin + R := ABounds; + R.Bottom := R.Top + GetPageHeaderHeight(R, APageIndex); + ABounds.Top := R.Bottom + InterAreaSpace; + AHeader := CreateHeaderCell(ASite); + Inc(R.Bottom, AHeader.BorderEdgeThicknesses[csBottom]); + InitReportCell(AHeader, R); + if GetShowDateNavigator(APageIndex) then + begin + R := AHeader.GetInnerBounds(0); + CreateHeaderDateNavigator(TcxSchedulerReportSchedulerHeaderCell(AHeader), APageIndex, R); + end; + AHeader.AdjustTextSize; + if AIsPrimary then + ReportLink.DoInitializeHeaderPrimaryCell(AHeader) + else + ReportLink.DoInitializeHeaderSecondaryCell(AHeader); + end; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.CanSplitSchedulingOnTwoPages: Boolean; +begin + Result := Layout = pslTwoPages; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetHasPageHeader( + APageIndex: Integer): Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetHasPageReportTitle( + APageIndex: Integer): Boolean; +begin + case ReportLink.ReportTitleMode of + tmNone: + Result := False; + tmOnFirstPage: + Result := APageIndex div (Byte(Layout) + 1) = 0; + else + Result := True; + end; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPageHeaderHeight( + const ASiteBounds: TRect; APageIndex: Integer): Integer; +var + AMin, AMax: Integer; +begin + Result := 0; + AMin := Round((ASiteBounds.Bottom - ASiteBounds.Top) * SchedulerHeaderMinHeight); + AMax := Round((ASiteBounds.Bottom - ASiteBounds.Top) * SchedulerHeaderMaxHeight); + if GetShowDateNavigator(APageIndex) and (ReportLink <> nil) then + begin + with VisualStyles do + Result := TcxSchedulerReportDateNavigatorCell.MeasureDateNavigatorHeight( + GetDateNavigatorContentParams, GetDateNavigatorHeaderParams); + end; + Result := Max(Min(AMax, Result), AMin); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPageIndex( + APeriodIndex, AIndex: Integer): Integer; +begin + Result := (APeriodIndex * (Byte(Layout) + 1) + AIndex); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.GetPagePeriodAndIndex( + APageIndex: Integer; var APeriodIndex, ASubIndex: Integer); +begin + ASubIndex := 0; + if Layout = pslTwoPages then + begin + APeriodIndex := APageIndex div 2; + ASubIndex := APageIndex mod 2; + end + else + APeriodIndex := APageIndex; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPageSiteBounds( + APageIndex: Integer): TRect; +begin + Result := MakeBounds(0, 0, ReportLink.PageWidth, ReportLink.PageHeight); + OffsetRect(Result, 0, APageIndex * ReportLink.PageHeight); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetStartOfWeekOffset: Integer; +begin + Result := 0; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.GetPageDateNavigatorInfo( + APageIndex: Integer; out AYear, AMonth: Word); +var + ADate: TDateTime; + ADayCount: Integer; +begin + ADayCount := APageIndex * GetDaysPerPeriod div + ((Byte(Layout) + 1) * GetResourcePageCount); + ADate := PrintRange.PrintFrom + ADayCount; + AYear := YearOf(ADate); + AMonth := MonthOf(ADate); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetDaysPerPeriod: Integer; +begin + Result := 1; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.FillDatesForPage( + ADateList: TcxSchedulerDateList; APageIndex, APeriodIndex, ASubIndex: Integer); +begin +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetActive: Boolean; +begin + if Styles <> nil then + Result := (Styles.ActiveStyle = Self) and Styles.ActiveStyleAssigned + else + Result := False; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetHasAdditionalArea: Boolean; +begin + Result := ShowNotesAreaBlank or ShowNotesAreaLined or ShowTaskPad; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetIndex: Integer; +begin + if Styles <> nil then + Result := Styles.IndexOf(Self) + else + Result := -1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPageSite( + AIndex: Integer): TcxSchedulerReportPageSite; +begin + if ReportLink <> nil then + Result := TcxSchedulerReportPageSite(ReportLink.PageSites[AIndex]) + else + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPeriodCount: Integer; +begin + Result := PageCount; + if Layout = pslTwoPages then + Result := Result div 2; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetPrintRange: TcxSchedulerReportLinkPrintRange; +begin + if ReportLink <> nil then + Result := ReportLink.PrintRange + else + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetReportLink: TcxSchedulerReportLink; +begin + if Styles <> nil then + Result := Styles.ReportLink + else + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetResourceCount: Integer; +begin + if (Scheduler <> nil) and (Scheduler.Storage <> nil) and + (Scheduler.Storage.Resources.ResourceItems.VisibleResourceCount > 0) then + Result := Scheduler.Storage.Resources.ResourceItems.VisibleResourceCount + else + Result := 1; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetScheduler: TcxScheduler; +begin + if ReportLink <> nil then + Result := ReportLink.Scheduler + else + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetStorage: TcxCustomSchedulerStorage; +begin + if Scheduler <> nil then + Result := Scheduler.Storage + else + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetTimePrintFrom: TTime; +begin + Result := TimeOf(PrintRange.TimePrintFrom); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetTimePrintTo: TTime; +begin + Result := TimeOf(PrintRange.TimePrintTo); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.GetVisualStyles: TcxSchedulerReportLinkStyles; +begin + if ReportLink <> nil then + Result := ReportLink.ActiveStyles + else + Result := nil; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IsCaptionStored: Boolean; +begin + Result := (FCaption <> DefaultCaption); +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IsLayoutStored: Boolean; +begin + Result := Layout <> pslOnePage; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IsShowNotesAreaBlankStored: Boolean; +begin + Result := FShowNotesAreaBlank <> False; +end; + +function TcxCustomSchedulerReportLinkPrintStyle.IsActiveStored: Boolean; +begin + Result := Active and Styles.ActiveStyleAssigned; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetActive(Value: Boolean); +begin + if Styles <> nil then + begin + if Value then + Styles.ActiveStyle := Self + else + Styles.ActiveStyle := nil; + Styles.ActiveStyleAssigned := Value; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetCaption(const Value: string); +begin + if Caption <> Value then + begin + FCaption := Value; + Changed; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetCompressWeekends( + Value: Boolean); +begin + SetBoolOption(FCompressWeekends, Value); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetDontPrintWeekends( + Value: Boolean); +begin + SetBoolOption(FDontPrintWeekEnds, Value); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetLayout( + Value: TcxSchedulerReportLinkPeriodicPrintStyleLayout); +begin + if FLayout <> Value then + begin + FLayout := Value; + Changed; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetResourceCountPerPage( + Value: Integer); +begin + if FResourceCountPerPage <> Value then + begin + FResourceCountPerPage := Value; + Changed; + end; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetShowNotesAreaBlank( + Value: Boolean); +begin + SetBoolOption(FShowNotesAreaBlank, Value); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetShowNotesAreaLined( + Value: Boolean); +begin + SetBoolOption(FShowNotesAreaLined, Value); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetShowTaskPad(Value: Boolean); +begin + SetBoolOption(FShowTaskPad, Value); +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetTimePrintFrom(Value: TTime); +begin + PrintRange.TimePrintFrom := Value; +end; + +procedure TcxCustomSchedulerReportLinkPrintStyle.SetTimePrintTo(Value: TTime); +begin + PrintRange.TimePrintTo := Value; +end; + +{ TcxSchedulerReportLinkDailyPrintStyle } + +function TcxSchedulerReportLinkDailyPrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionDaily); +end; + +function TcxSchedulerReportLinkDailyPrintStyle.IsCompatibleWith( + AView: TcxSchedulerCustomView): Boolean; +begin + Result := AView is TcxSchedulerDayView; +end; + +procedure TcxSchedulerReportLinkDailyPrintStyle.BeforeBuild; +begin + inherited BeforeBuild; + FCurrentPagePerDate := PagesPerPeriod; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.CanSplitSchedulingOnTwoPages: Boolean; +begin + Result := False; +end; + +procedure TcxSchedulerReportLinkDailyPrintStyle.CreateControlsOnFirstPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +begin + if Layout = pslOnePage then + CreateAdditionalControls(ASite, True, ShowTaskPad, + ShowNotesAreaBlank, ShowNotesAreaLined, True, ABounds); + InitReportCell(CreateSchedulingAreaCell(ASite), ABounds); +end; + +procedure TcxSchedulerReportLinkDailyPrintStyle.CreateControlsOnSecondPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +begin + CreateAdditionalControls(ASite, False, ShowTaskPad, + ShowNotesAreaBlank, ShowNotesAreaLined, True, ABounds); +end; + +function TcxSchedulerReportLinkDailyPrintStyle.CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; +begin + Result := TcxSchedulerReportDailyCellsProducer.CreateEx(Self, ASite); +end; + +procedure TcxSchedulerReportLinkDailyPrintStyle.FillDatesForPage( + ADateList: TcxSchedulerDateList; APageIndex, APeriodIndex, ASubIndex: Integer); +begin + APageIndex := APageIndex div GetResourcePageCount; + ADateList.Add(PrintRange.PrintFrom + APageIndex); +end; + +function TcxSchedulerReportLinkDailyPrintStyle.GetCorrespondedView: TcxSchedulerCustomResourceView; +begin + if Scheduler <> nil then + Result := Scheduler.ViewDay + else + Result := inherited GetCorrespondedView; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.GetGlyphIndex: Integer; +begin + Result := Byte(HasAdditionalArea); + if Layout = pslTwoPages then + Result := 2; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.GetPageCount: Integer; +begin + Result := GetResourcePageCount * PrintRange.DayCount * (Byte(Layout) + 1); +end; + +function TcxSchedulerReportLinkDailyPrintStyle.GetPagesPerPeriod: Integer; +var + I, J: Integer; +begin + if (ResourceCountPerPage = 0) or (ResourceCount < 2) then + Result := Byte(Layout) + 1 + else + begin + I := Min(ResourceCount, ResourceCountPerPage); + J := ResourceCount div I; + if J * I < ResourceCount then Inc(J); + Result := J * (Byte(Layout) + 1); + end; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.GetShowNotesAreaBlank: Boolean; +begin + Result := inherited GetShowNotesAreaBlank; + if not Result and (Layout <> pslOnePage) then + Result := not (ShowTaskPad or ShowNotesAreaLined); +end; + +procedure TcxSchedulerReportLinkDailyPrintStyle.InitHeaderCell( + ACell: TcxSchedulerReportSchedulerHeaderCell); +begin + ReportLink.SetCellViewParams(ACell, VisualStyles.GetSchedulerHeaderParams); + ACell.PrimaryText := DateTimeHelper.DateToLongDateStr(CurrentDate); + ACell.SecondaryText := LongDayNames[DayOfWeek(CurrentDate)]; + inherited InitHeaderCell(ACell); + Dec(FCurrentPagePerDate); + if FCurrentPagePerDate = 0 then + begin + CurrentDate := CurrentDate + 1; + FCurrentPagePerDate := PagesPerPeriod; + end; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.SupportIcons: Boolean; +begin + Result := True; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.SupportMessage: Boolean; +begin + Result := True; +end; + +function TcxSchedulerReportLinkDailyPrintStyle.SupportTimeRange: Boolean; +begin + Result := True; +end; + +{ TcxSchedulerReportLinkCustomDetailsPrintStyle } + +function TcxSchedulerReportLinkCustomDetailsPrintStyle.AddPageSite( + const ABounds: TRect): TcxSchedulerReportPageSite; +begin + Inc(BuildedPageCount); + Result := inherited AddPageSite(ABounds); +end; + +procedure TcxSchedulerReportLinkCustomDetailsPrintStyle.BeforeBuild; +begin + CurrentPage := nil; + CellsOnPage := 0; + BuildedPageCount := 0; + FTimeWidth := MeasureTimeWidth; + inherited BeforeBuild; +end; + +function TcxSchedulerReportLinkCustomDetailsPrintStyle.GetNextPage( + APrevPage: TcxSchedulerReportPageSite; out ABounds: TRect): TcxSchedulerReportPageSite; +begin + CellsOnPage := 0; + if APrevPage = nil then + Result := PageSites[0] + else + Result := AddPageSite(GetPageSiteBounds(BuildedPageCount)); + ABounds := Result.GetInnerBounds(0); + if GetHasPageReportTitle(BuildedPageCount - 1) then + Inc(ABounds.Top, ReportLink.RenderInfo.CalculateTitleHeight); +end; + +function TcxSchedulerReportLinkCustomDetailsPrintStyle.GetPageCount: Integer; +begin + Result := Max(1, BuildedPageCount); +end; + +function TcxSchedulerReportLinkCustomDetailsPrintStyle.MeasureTimeWidth: Integer; +var + AFont: TFont; +begin + AFont := ReportLink.Font; + if (VisualStyles.Event <> nil) and (cxStyles.svFont in VisualStyles.Event.AssignedValues) then + AFont := VisualStyles.Event.Font; + Result := cxTextWidth(AFont, '00:00 - 00:00') * 2; +end; + +function TcxSchedulerReportLinkCustomDetailsPrintStyle.GetPageWidth: Integer; +begin + Result := ReportLink.PageWidth; +end; + +{ TcxSchedulerReportLinkDetailsPrintStyle } + +procedure TcxSchedulerReportLinkDetailsPrintStyle.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLinkDetailsPrintStyle then + begin + PaginationMode := TcxSchedulerReportLinkDetailsPrintStyle(Source).PaginationMode; + UsePagination := TcxSchedulerReportLinkDetailsPrintStyle(Source).UsePagination; + end; + inherited Assign(Source); +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionDetails); +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.RestoreDefaults; +begin + PaginationMode := dpmByDay; + UsePagination := False; + inherited RestoreDefaults; +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.AddDayHeader(ADate: TDateTime; + AContinue: Boolean; var ABounds: TRect): TcxSchedulerReportSchedulerHeaderCell; +var + R: TRect; +begin + Result := TcxSchedulerReportSchedulerHeaderCell.Create(CurrentPage); + Result.Date := ADate; + R := cxRectSetHeight(ABounds, DayHeaderHeight); + ABounds.Top := R.Bottom + InterAreaSpace; + Result.Transparent := False; + Result.PrimaryText := GetDayHeaderText(AContinue); + InitReportCell(Result, R); + Result.Content.BoundsRect := Result.GetInnerBounds(0); + Result.AdjustTextSize; +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.BeforeBuild; +begin + PreviousHeader := nil; + CellsOnPage := 0; + inherited BeforeBuild; +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.BuildPages; +var + ADayEvents: TcxSchedulerEventList; +begin + ADayEvents := TcxSchedulerEventList.Create; + try + CellsOnPage := 0; + Site := nil; + DayIndex := 0; + while DayIndex < PrintRange.DayCount do + begin + ADayEvents.Clear; + Events.ExtractEvents(CurrentDate, ADayEvents); + Events.Sort(TcxCompareEventsProc(@cxCompareSchedulerControlEvents)); + if (ADayEvents.Count > 0) and (Site = nil) then + begin + Site := AddPageSite(GetPageSiteBounds(0)); + PrepareNextPage; + end; + if (CellsOnPage > 0) and (ADayEvents.Count > 0) then + CheckPagination; + EventIndex := 0; + while EventIndex < ADayEvents.Count do + begin + CurrentCell := AddEventCell(ADayEvents[EventIndex]); + ReportLink.DoInitializeEventCell(CurrentCell); + if (CellsOnPage > 0) and (MeasureCellBounds.Bottom > CurrentPageBounds.Bottom) then + PrepareNextPage; + HeaderNeeded; + SetCellPlace; + Inc(EventIndex); + end; + CurrentDate := CurrentDate + 1; + Inc(DayIndex); + end; + finally + ADayEvents.Free; + end; +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.GetDayHeaderHeight: Integer; +var + DC: HDC; +begin + DC := GetDC(0); + try + Result := ReportLink.Renderer.CalcTextHeight(DC, 'Wg', False, GetSchedulerHeaderParams.NativeParams.Font) * 2; + finally + ReleaseDC(0, DC); + end +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.GetDayHeaderText(AContinue: Boolean): string; +begin + Result := DateTimeHelper.DateToLongDateStr(CurrentDate); + if AContinue then + Result := Result + ' ' + cxGetResourceString(@sdxContinuedMessage); +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.GetGlyphIndex: Integer; +begin + Result := 22; +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.GetPreviewGlyphIndex: Integer; +begin + Result := 16; +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.GetSchedulerHeaderParams: TdxReportItemViewParams; +begin + FillChar(Result, SizeOf(Result), 0); + Result.NativeParams := VisualStyles.GetDayHeaderParams(CurrentDate); + Include(Result.FontStyle, fsBold); +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.AddEventCell( + AEvent: TcxSchedulerEvent): TcxSchedulerReportDetailsEventCell; +begin + Result := TcxSchedulerReportDetailsEventCell.CreateEx(Site, AEvent, + CurrentDate, VisualStyles.GetEventParams(AEvent), + (AEvent.Start < CurrentDate) and (CurrentDate > PrintRange.PrintFrom)); + Result.CalculateLayout(PageWidth, TimeWidth); +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.CheckPagination; +begin + if not UsePagination then Exit; + case PaginationMode of + dpmByDay: + PrepareNextPage; + dpmByWeek: + if GetWeekNumber(CurrentDate, dSunday, fwySystem) <> + GetWeekNumber(PreviousHeader.Date, dSunday, fwySystem) then + PrepareNextPage; + dpmByMonth: + if MonthOf(CurrentDate) <> MonthOf(PreviousHeader.Date) then + PrepareNextPage; + end; +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.HeaderNeeded; +begin + if NeedAddDayHeader then + PreviousHeader := AddDayHeader(CurrentDate, EventIndex > 0, CurrentPageBounds); +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.NeedAddDayHeader: Boolean; +begin + Result := (CellsOnPage = 0) or (PreviousHeader = nil) or (PreviousHeader.Date <> CurrentDate); +end; + +function TcxSchedulerReportLinkDetailsPrintStyle.MeasureCellBounds: TRect; +begin + Result := CurrentPageBounds; + Result.Bottom := Result.Top + CurrentCell.CalculateHeight; + if NeedAddDayHeader then + Inc(Result.Bottom, DayHeaderHeight); +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.PrepareNextPage; +begin + CurrentPage := GetNextPage(CurrentPage, CurrentPageBounds); +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.SetCellPlace; +begin + Inc(CellsOnPage); + CurrentCell.BoundsRect := MeasureCellBounds; + CurrentCell.Parent := CurrentPage; + CurrentPageBounds.Top := CurrentCell.BoundsRect.Bottom + InterAreaSpace; +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.SetPaginationMode( + Value: TcxSchedulerReportLinkDetailsPrintStylePaginationMode); +begin + if FPaginationMode <> Value then + begin + FPaginationMode := Value; + Changed; + end; +end; + +procedure TcxSchedulerReportLinkDetailsPrintStyle.SetUsePagination( + Value: Boolean); +begin + SetBoolOption(FUsePagination, Value); +end; + +{ TcxSchedulerReportLinkMemoPrintStyle } + +procedure TcxSchedulerReportLinkMemoPrintStyle.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLinkMemoPrintStyle then + with TcxSchedulerReportLinkMemoPrintStyle(Source) do + begin + Self.FSelectedEventsOnly := FSelectedEventsOnly; + Self.FStartEachItemOnNewPage := FStartEachItemOnNewPage; + end; + inherited Assign(Source); +end; + +function TcxSchedulerReportLinkMemoPrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionMemo); +end; + +procedure TcxSchedulerReportLinkMemoPrintStyle.RestoreDefaults; +begin + FSelectedEventsOnly := True; + FStartEachItemOnNewPage := True; + inherited RestoreDefaults; +end; + +function TcxSchedulerReportLinkMemoPrintStyle.AddEventCell( + AEvent: TcxSchedulerEvent): TcxSchedulerReportDetailsEventCell; +begin + Result := TcxSchedulerReportMemoEventCell.CreateEx(CurrentPage, AEvent, + NullDate, VisualStyles.GetEventParams(AEvent)); + Result.CalculateLayout(PageWidth, TimeWidth); +end; + +procedure TcxSchedulerReportLinkMemoPrintStyle.BuildPages; +var + I: Integer; + APageBounds: TRect; + ACell: TcxSchedulerReportDetailsEventCell; + + function GetCellBounds: TRect; + begin + Result := APageBounds; + Result.Bottom := Result.Top + ACell.CalculateHeight; + end; + +begin + Site := nil; + if Events.Count = 0 then Exit; + Site := AddPageSite(GetPageSiteBounds(0)); + CurrentPage := GetNextPage(CurrentPage, APageBounds); + for I := 0 to Events.AbsoluteCount - 1 do + begin + ACell := AddEventCell(Events[I]); + ReportLink.DoInitializeEventCell(ACell); + if (CellsOnPage > 0) and (StartEachItemOnNewPage or + (GetCellBounds.Bottom > APageBounds.Bottom)) then + CurrentPage := GetNextPage(CurrentPage, APageBounds); + ACell.Parent := CurrentPage; + ACell.BoundsRect := GetCellBounds; + APageBounds.Top := ACell.BoundsRect.Bottom + InterAreaSpace; + Inc(CellsOnPage); + end; +end; + +procedure TcxSchedulerReportLinkMemoPrintStyle.DoCanPrintEvent( + AEvent: TcxSchedulerEvent; var AllowPrint: Boolean); +var + I: Integer; + AUseEvent: Boolean; +begin + if SelectedEventsOnly and (Scheduler <> nil) then + begin + AllowPrint := False; + for I := 0 to Scheduler.SelectedEventCount - 1 do + begin + AllowPrint := Scheduler.SelectedEvents[I].Source = TcxSchedulerControlEvent(AEvent).Source; + if AllowPrint then Break; + end; + end; + AUseEvent := False; + for I := 0 to PrintRange.DayCount - 1 do + if AEvent.IsDayEvent(PrintRange.PrintFrom + I) then + begin + AUseEvent := True; + Break; + end; + if AUseEvent then + inherited DoCanPrintEvent(AEvent, AllowPrint) + else + AllowPrint := False; +end; + +function TcxSchedulerReportLinkMemoPrintStyle.GetGlyphIndex: Integer; +begin + Result := 20; +end; + +function TcxSchedulerReportLinkMemoPrintStyle.GetPreviewGlyphIndex: Integer; +begin + Result := 17; +end; + +function TcxSchedulerReportLinkMemoPrintStyle.MeasureTimeWidth: Integer; +var + AFont: TFont; +begin + AFont := ReportLink.Font; + if (VisualStyles.Event <> nil) and (cxStyles.svFont in VisualStyles.Event.AssignedValues) then + AFont := VisualStyles.Event.Font; + Result := 0; + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxSubjectLabelCaption))); + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxLocationLabelCaption))); + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxStartLabelCaption))); + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxFinishLabelCaption))); + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxShowTimeAsLabelCaption))); + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxRecurrenceLabelCaption))); + Result := Max(Result, cxTextWidth(AFont, cxGetResourceString(@sdxRecurrencePatternLabelCaption))); + if Result = 0 then + Result := inherited MeasureTimeWidth + else + Inc(Result, cxTextWidth(AFont, '0000 - 0000')); + Result := Min(PageWidth div 3, Result); +end; + +{ TcxSchedulerReportLinkMonthlyPrintStyle } + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLinkMonthlyPrintStyle then + PrintExactlyOneMonthPerPage := + TcxSchedulerReportLinkMonthlyPrintStyle(Source).PrintExactlyOneMonthPerPage; + inherited Assign(Source); +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionMonthly); +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.IsCompatibleWith( + AView: TcxSchedulerCustomView): Boolean; +begin + Result := AView is TcxSchedulerWeeksView; +end; + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.RestoreDefaults; +begin + PrintExactlyOneMonthPerPage := False; + inherited RestoreDefaults; +end; + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.CreateControlsOnFirstPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +begin + if Layout = pslTwoPages then + CreateAdditionalControls(ASite, True, ShowTaskPad and + (ShowNotesAreaLined or ShowNotesAreaBlank), False, False, False, ABounds) + else + CreateAdditionalControls(ASite, True, ShowTaskPad, + ShowNotesAreaBlank, ShowNotesAreaLined, True, ABounds); + InitReportCell(CreateSchedulingAreaCell(ASite), ABounds); +end; + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.CreateControlsOnSecondPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +var + HasTaskPad: Boolean; +begin + HasTaskPad := ShowTaskPad and not (ShowNotesAreaBlank or ShowNotesAreaLined); + CreateAdditionalControls(ASite, True, HasTaskPad, ShowNotesAreaBlank, + ShowNotesAreaLined, True, ABounds); + InitReportCell(CreateSchedulingAreaCell(ASite), ABounds); +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.GetCorrespondedView: TcxSchedulerCustomResourceView; +begin + if Scheduler <> nil then + Result := Scheduler.ViewWeeks + else + Result := inherited GetCorrespondedView; +end; + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.FillDatesForPage( + ADateList: TcxSchedulerDateList; APageIndex, APeriodIndex, ASubIndex: Integer); +var + I: Integer; + Y, M, D: Word; + AStart: TDateTime; +begin + AStart := GetDateForPage(APageIndex); + DecodeDate(AStart, Y, M, D); + for I := 0 to DaysInAMonth(Y, M) - 1 do + ADateList.Add(AStart + I); +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.GetDaysPerPeriod: Integer; +begin + Result := 30; +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.GetDateForPage( + APageIndex: Integer): TDateTime; +var + Y, M, D: Word; + APeriodIndex: Integer; +begin + APeriodIndex := APageIndex div (Byte(Layout) + 1) div GetResourcePageCount; + DecodeDate(PrintRange.PrintFrom, Y, M, D); + D := 1; + IncAMonth(Y, M, D, APeriodIndex); + Result := EncodeDate(Y, M, D); +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.GetGlyphIndex: Integer; +begin + Result := 11 + Byte(HasAdditionalArea); + if Layout = pslTwoPages then + Inc(Result, 2); +end; + +function TcxSchedulerReportLinkMonthlyPrintStyle.GetPageCount: Integer; +begin + Result := PrintRange.MonthCount * (Byte(Layout) + 1) * GetResourcePageCount; +end; + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.InitHeaderCell( + ACell: TcxSchedulerReportSchedulerHeaderCell); + + function GetMonthText(ADate: TDateTime): string; + begin + Result := FormatDateTime('mmmm', ADate) + ' ' + IntToStr(YearOf(ADate)); + end; + +var + ADate: TDateTime; +begin + ADate := GetDateForPage(ACell.PageIndex); + if PrintExactlyOneMonthPerPage then + ACell.PrimaryText := GetMonthText(ADate) + else + ACell.PrimaryText := GetMonthText(ADate) + ' - ' + GetMonthText(ADate + 32); + inherited InitHeaderCell(ACell); +end; + +procedure TcxSchedulerReportLinkMonthlyPrintStyle.SetPrintExactlyOneMonthPerPage( + Value: Boolean); +begin + SetBoolOption(FPrintExactlyOneMonthPerPage, Value); +end; + +{ TcxSchedulerReportLinkTrifoldPrintStyle } + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerReportLinkTrifoldPrintStyle then + with TcxSchedulerReportLinkTrifoldPrintStyle(Source) do + begin + Self.LeftSection := LeftSection; + Self.MiddleSection := MiddleSection; + Self.RightSection := RightSection; + end; +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionTrifold); +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.RestoreDefaults; +begin + inherited RestoreDefaults; + FSections[0] := smDailyCalendar; + FSections[1] := smTaskPad; + FSections[2] := smWeeklyCalendar; +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.CreateLayoutForPeriod( + APeriodIndex: Integer); +var + I: Integer; + R: array[0..2] of TRect; + ABounds: TRect; + ASite: TcxSchedulerReportPageSite; +begin + ABounds := GetPageSiteBounds(APeriodIndex); + ASite := AddPageSite(ABounds); + ASite.FPageIndex := APeriodIndex; + ASite.FPrimaryPage := True; + ABounds := ASite.GetInnerBounds(0); + Rect2RectsHorz(ABounds, R[0], R[1], R[2]); + for I := 0 to 2 do + CreateLayoutForSection(ASite, APeriodIndex, R[I], FSections[I]); +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.CreateLayoutForSection( + ASite: TdxReportCell; APeriodIndex: Integer; const ABounds: TRect; + ASection: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode); +begin + FCurrentSection := ASection; + case ASection of + smDailyCalendar: + CreateSchedulingAreaWithHeader(ASite, ABounds); + smWeeklyCalendar: + CreateSchedulingAreaWithHeader(ASite, ABounds); + smMonthlyCalendar: + CreateSchedulingAreaWithHeader(ASite, ABounds); + smTaskPad: + InitReportCell(CreateTaskPadCell(ASite), ABounds); + smNotesAreaBlank: + InitReportCell(CreateNotesCell(ASite), ABounds); + smNotesAreaLined: + InitReportCell(CreateNotesLinedCell(ASite), ABounds); + end; +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.CreateSchedulingAreaWithHeader( + ASite: TdxReportCell; ABounds: TRect); +var + R: TRect; + AHeader: TcxSchedulerReportSchedulerHeaderCell; +begin + R := ABounds; + R.Bottom := R.Top + Round((R.Bottom - R.Top) * SchedulerHeaderSmallHeight); + ABounds.Top := R.Bottom + InterAreaSpace; + FCurrentSchedulingArea := CreateSchedulingAreaCell(ASite); + InitReportCell(FCurrentSchedulingArea, ABounds); + AHeader := CreateHeaderCell(ASite); + InitReportCell(AHeader, R); + AHeader.Content.BoundsRect := AHeader.GetInnerBounds(0); + AHeader.AdjustTextSize; +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; +begin + case FCurrentSection of + smDailyCalendar: + Result := TcxSchedulerReportDailyCellsProducer.CreateEx(Self, ASite); + smWeeklyCalendar, smMonthlyCalendar: + Result := TcxSchedulerReportWeeksCellsProducer.CreateEx(Self, ASite); + else + Result := nil; + end; +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.FillDatesForPage( + ADateList: TcxSchedulerDateList; APageIndex, APeriodIndex, ASubIndex: Integer); +var + I: Integer; + ADate: TDateTime; +begin + ADateList.Clear; + case FCurrentSection of + smDailyCalendar: + ADateList.Add(APageIndex + PrintRange.PrintFrom); + smWeeklyCalendar: + begin + ADate := StartOfTheWeek(PrintRange.PrintFrom + + MulDiv(APageIndex * 7, PrintRange.WeekCount, PageCount)); + for I := 0 to 7 do + ADateList.Add(ADate + I); + end; + smMonthlyCalendar: + begin + ADate := StartOfTheMonth(PrintRange.PrintFrom + APageIndex * FPageRange); + for I := 0 to DaysInMonth(ADate) do + ADateList.Add(ADate + I); + end; + end; +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.GetCorrespondedView: TcxSchedulerCustomResourceView; +begin + case FCurrentSection of + smDailyCalendar: + Result := Scheduler.ViewDay; + smWeeklyCalendar: + Result := Scheduler.ViewWeek; + smMonthlyCalendar: + Result := Scheduler.ViewWeeks; + else + Result := inherited GetCorrespondedView; + end; +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.GetGlyphIndex: Integer; +begin + Result := 15; +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.GetPageCount: Integer; +var + I: Integer; +begin + Result := 1; + FPageRange := 30; + for I := 0 to 2 do + begin + case FSections[I] of + smDailyCalendar: + begin + Result := Max(Result, PrintRange.DayCount); + FPageRange := 1; + end; + smWeeklyCalendar: + begin + Result := Max(Result, PrintRange.WeekCount); + FPageRange := Min(FPageRange, 7); + end; + smMonthlyCalendar: + begin + Result := Max(Result, PrintRange.MonthCount); + FPageRange := Min(FPageRange, 30); + end; + end; + end; +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.InitHeaderCell( + ACell: TcxSchedulerReportSchedulerHeaderCell); +var + AText: string; + ADate1, ADate2: TDateTime; +begin + with FCurrentSchedulingArea.VisibleDays do + begin + ADate1 := Items[0]; + ADate2 := Items[Count - 1]; + end; + case FCurrentSection of + smDailyCalendar: + AText := DateTimeHelper.DateToLongDateStr(ADate1); + smWeeklyCalendar: + AText := DateTimeHelper.DayToStr(ADate1, 0, False) + ' - ' + + DateTimeHelper.DayToStr(ADate2 - 1, 0, False); + smMonthlyCalendar: + if not cxGetDateFormat(ADate1, AText, DATE_YEARMONTH) then + AText := FormatDateTime('mmmm', ADate1) + ' ' + IntToStr(YearOf(ADate1)) + end; + ACell.PrimaryText := AText; + inherited InitHeaderCell(ACell); +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.GetSection( + Index: Integer): TcxSchedulerReportLinkTrifoldPrintStyleSectionMode; +begin + Result := FSections[Index]; +end; + +procedure TcxSchedulerReportLinkTrifoldPrintStyle.SetSection( + Index: Integer; AValue: TcxSchedulerReportLinkTrifoldPrintStyleSectionMode); +begin + if AValue <> FSections[Index] then + begin + FSections[Index] := AValue; + Changed; + end; +end; + +function TcxSchedulerReportLinkTrifoldPrintStyle.IsSectionStored( + Index: Integer): Boolean; +const + Sections: array[0..2] of TcxSchedulerReportLinkTrifoldPrintStyleSectionMode = + (smDailyCalendar, smTaskPad, smWeeklyCalendar); +begin + Result := FSections[Index] <> Sections[Index]; +end; + +{ TcxSchedulerReportLinkWeeklyPrintStyle } + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportLinkWeeklyPrintStyle then + Arrange := TcxSchedulerReportLinkWeeklyPrintStyle(Source).Arrange; + inherited Assign(Source); +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxPrintStyleCaptionWeekly); +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.IsCompatibleWith( + AView: TcxSchedulerCustomView): Boolean; +begin + Result := AView is TcxSchedulerWeekView; +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.RestoreDefaults; +begin + Arrange := wsaTopToBottom; + inherited RestoreDefaults; +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.CreateControlsOnFirstPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +begin + if Layout = pslTwoPages then + CreateAdditionalControls(ASite, True, ShowTaskPad and + (ShowNotesAreaLined or ShowNotesAreaBlank), False, False, False, ABounds) + else + CreateAdditionalControls(ASite, True, ShowTaskPad, + ShowNotesAreaBlank, ShowNotesAreaLined, True, ABounds); + InitReportCell(CreateSchedulingAreaCell(ASite), ABounds); +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.CreateControlsOnSecondPage( + APageIndex: Integer; ASite, AHeader: TdxReportCell; ABounds: TRect); +var + HasTaskPad: Boolean; +begin + HasTaskPad := ShowTaskPad and not (ShowNotesAreaBlank or ShowNotesAreaLined); + CreateAdditionalControls(ASite, True, HasTaskPad, ShowNotesAreaBlank, + ShowNotesAreaLined, True, ABounds); + InitReportCell(CreateSchedulingAreaCell(ASite), ABounds); +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.CreateSchedulingCellsProducer( + ASite: TcxSchedulerReportSchedulingAreaCell): TcxSchedulerReportCommonCellsProducer; +const + CellsProducers: array[Boolean] of TcxSchedulerReportCommonCellsProducerClass = + (TcxSchedulerReportDailyCellsProducer, TcxSchedulerReportWeeksCellsProducer); +begin + Result := CellsProducers[Arrange = wsaTopToBottom].CreateEx(Self, ASite); +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetCorrespondedView: TcxSchedulerCustomResourceView; +begin + if Scheduler <> nil then + begin + if Arrange = wsaTopToBottom then + Result := Scheduler.ViewWeek + else + Result := Scheduler.ViewDay; + end + else + Result := inherited GetCorrespondedView; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetGlyphIndex: Integer; +begin + Result := 3 + Byte(Arrange) + Byte(HasAdditionalArea) * 4 + + Byte(Layout = pslTwoPages) * 2 +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetDateForPage( + APageIndex: Integer): TDateTime; +begin + Result := PrintRange.PrintFrom + (APageIndex div GetResourcePageCount div + (Byte(Layout) + 1)) * 7 + GetStartOfWeekOffset; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetDaysPerPeriod: Integer; +begin + Result := 7; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetPageCount: Integer; +begin + Result := PrintRange.WeekCount * (Byte(Layout) + 1) * GetResourcePageCount; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.GetStartOfWeekOffset: Integer; +begin + Result := -DayOfWeek(PrintRange.PrintFrom) + 2; // +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.FillDatesForPage( + ADateList: TcxSchedulerDateList; APageIndex, APeriodIndex, ASubIndex: Integer); +const + DayCount: array[TcxSchedulerReportLinkPeriodicPrintStyleLayout, Boolean] of Integer = + ((7, 7), (3, 4)); +var + I: Integer; + AStart, ADate: TDateTime; +begin + AStart := GetDateForPage(APageIndex); + if Arrange = wsaLeftToRight then + for I := 0 to DayCount[Layout, ASubIndex <> 0] - 1 do + begin + ADate := AStart + ASubIndex * 3 + I; + if not DontPrintWeekEnds or not (DayOfWeek(ADate) in [1, 7]) then + ADateList.Add(ADate); + end + else + begin + AStart := AStart + Byte(Scheduler.OptionsView.ActualStartOfWeek); + for I := 0 to 6 do + ADateList.Add(AStart + I); + end; +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.InitHeaderCell( + ACell: TcxSchedulerReportSchedulerHeaderCell); + + function GetWeekDayText(ADate: TDateTime): string; + begin + Result := DateTimeHelper.DayToStr(ADate, 0, False); + end; + +var + AWeekDate: TDateTime; +begin + AWeekDate := GetDateForPage(ACell.PageIndex); + ACell.PrimaryText := GetWeekDayText(AWeekDate) + ' - ' + + GetWeekDayText(AWeekDate + 6); + inherited InitHeaderCell(ACell); +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.CanDontPrintWeekends: Boolean; +begin + Result := True; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.SupportTimeRange: Boolean; +begin + Result := Arrange = wsaLeftToRight; +end; + +function TcxSchedulerReportLinkWeeklyPrintStyle.IsArrangeStored: Boolean; +begin + Result := Arrange <> wsaTopToBottom; +end; + +procedure TcxSchedulerReportLinkWeeklyPrintStyle.SetArrange( + Value: TcxSchedulerReportLinkWeeklyPrintStyleArrange); +begin + if Arrange <> Value then + begin + FArrange := Value; + Changed; + end; +end; + +{ TdxfmSchedulerReportLinkDesignWindow } + +constructor TcxfmSchedulerReportLinkDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxhccxSchedulerReportLinkDesigner; + inherited; + wpPrintStyles := TList.Create; + CreateControls; + SetActivePage; +end; + +destructor TcxfmSchedulerReportLinkDesignWindow.Destroy; +begin + FreeAndNil(wpPrintStyles); + dxPSPopupMan.dxPSPopupMenuController.UnregisterControl(lbxStyles); + inherited; +end; + +function TcxfmSchedulerReportLinkDesignWindow.Execute: Boolean; +begin + Self.FActiveStyle := ReportLink.PrintStyles.FActiveStyle; + Self.FActiveStyleAssigned := ReportLink.PrintStyles.FActiveStyleAssigned; + if (ReportLink.PrintStyles.ActiveStyle = nil) or not FActiveStyleAssigned then + with ReportLink.PrintStyles do SetActiveStyleEx(GetCorrespondingStyle); + Result := inherited Execute; + if Result then + ReportLink.PrintStyles.ActiveStyle := ActivePrintStyle + else + begin + ReportLink.PrintStyles.FActiveStyleAssigned := FActiveStyleAssigned; + ReportLink.PrintStyles.FActiveStyle := FActiveStyle; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignDailyTabObjects; +var + ADailyStyle: TcxSchedulerReportLinkDailyPrintStyle; +begin + ADailyStyle := ReportLink.PrintStyles.Daily; + cbxPrintStyleDailyLayout.ItemIndex := Integer(ADailyStyle.Layout); + sePrintStyleDailyResourceCountPerPage.Properties.MaxValue := ADailyStyle.ResourceCount; + sePrintStyleDailyResourceCountPerPage.Value := ADailyStyle.ResourceCountPerPage; + chbxPrintStyleDailyTaskPad.Checked := ADailyStyle.ShowTaskPad; + chbxPrintStyleDailyNotesAreaBlank.Checked := ADailyStyle.ShowNotesAreaBlank; + chbxPrintStyleDailyNotesAreaLined.Checked := ADailyStyle.ShowNotesAreaLined; + tePrintStyleDailyPrintFrom.Time := ADailyStyle.TimePrintFrom; + tePrintStyleDailyPrintTo.Time := ADailyStyle.TimePrintTo; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignDetailsTabObjects; +var + ADetailsStyle: TcxSchedulerReportLinkDetailsPrintStyle; +begin + ADetailsStyle := ReportLink.PrintStyles.Details; + chbxPrintStyleDetailsUsePagination.Checked := ADetailsStyle.UsePagination; + cbxPrintStyleDetailsPagination.ItemIndex := Integer(ADetailsStyle.PaginationMode); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignMemoTabObjects; +var + AMemoStyle: TcxSchedulerReportLinkMemoPrintStyle; +begin + AMemoStyle := ReportLink.PrintStyles.Memo; + chbxPrintStyleMemoStartEachItemOnNewPage.Checked := AMemoStyle.StartEachItemOnNewPage; + chbxPrintStyleMemoPrintOnlySelectedEvents.Checked := AMemoStyle.SelectedEventsOnly; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignMonthlyTabObjects; +var + AMonthlyStyle: TcxSchedulerReportLinkMonthlyPrintStyle; +begin + AMonthlyStyle := ReportLink.PrintStyles.Monthly; + cbxPrintStyleMonthlyLayout.ItemIndex := Integer(AMonthlyStyle.Layout); + sePrintStyleMonthlyResourceCountPerPage.Properties.MaxValue := AMonthlyStyle.ResourceCount; + sePrintStyleMonthlyResourceCountPerPage.Value := AMonthlyStyle.ResourceCountPerPage; + chbxPrintStyleMonthlyTaskPad.Checked := AMonthlyStyle.ShowTaskPad; + chbxPrintStyleMonthlyNotesAreaBlank.Checked := AMonthlyStyle.ShowNotesAreaBlank; + chbxPrintStyleMonthlyNotesAreaLined.Checked := AMonthlyStyle.ShowNotesAreaLined; + chbxPrintStyleMonthlyDontPrintWeekends.Checked := AMonthlyStyle.DontPrintWeekends; + chbxPrintStyleMonthlyPrintExactlyOneMonthPerPage.Checked := AMonthlyStyle.PrintExactlyOneMonthPerPage; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignTrifoldTabObjects; +var + ATrifoldStyle: TcxSchedulerReportLinkTrifoldPrintStyle; +begin + ATrifoldStyle := ReportLink.PrintStyles.Trifold; + cbxPrintStyleTrifoldSectionLeft.ItemIndex := Byte(ATrifoldStyle.LeftSection); + cbxPrintStyleTrifoldSectionMiddle.ItemIndex := Byte(ATrifoldStyle.MiddleSection); + cbxPrintStyleTrifoldSectionRight.ItemIndex := Byte(ATrifoldStyle.RightSection); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignWeeklyTabObjects; +var + AWeeklyStyle: TcxSchedulerReportLinkWeeklyPrintStyle; +begin + AWeeklyStyle := ReportLink.PrintStyles.Weekly; + cbxPrintStyleWeeklyArrange.ItemIndex := Integer(AWeeklyStyle.Arrange); + cbxPrintStyleWeeklyLayout.ItemIndex := Integer(AWeeklyStyle.Layout); + sePrintStyleWeeklyResourceCountPerPage.Properties.MaxValue := AWeeklyStyle.ResourceCount; + sePrintStyleWeeklyResourceCountPerPage.Value := AWeeklyStyle.ResourceCountPerPage; + chbxPrintStyleWeeklyTaskPad.Checked := AWeeklyStyle.ShowTaskPad; + chbxPrintStyleWeeklyNotesAreaBlank.Checked := AWeeklyStyle.ShowNotesAreaBlank; + chbxPrintStyleWeeklyNotesAreaLined.Checked := AWeeklyStyle.ShowNotesAreaLined; + chbxPrintStyleWeeklyDontPrintWeekends.Checked := AWeeklyStyle.DontPrintWeekends; + tePrintStyleWeeklyPrintFrom.Time := AWeeklyStyle.TimePrintFrom; + tePrintStyleWeeklyPrintTo.Time := AWeeklyStyle.TimePrintTo; +end; + +function TcxfmSchedulerReportLinkDesignWindow.CanApply: Boolean; +begin + Result := inherited CanApply;// and not ReportLink.IsInconsistentState; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoApply; +begin + if not IsValidConditions then Exit; + ReportLink.PrintStyles.ActiveStyle := ActivePrintStyle; + FActiveStyle := ReportLink.PrintStyles.FActiveStyle; + FActiveStyleAssigned := ReportLink.PrintStyles.FActiveStyleAssigned; + inherited DoApply; + ReportLink.RebuildReport; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoInitialize; +begin + + lbxStyles.ReportLinkStyles := ReportLink.ActiveStyles; + inherited DoInitialize; + + with ReportLink.PrintRange do + begin + dePrintRangeStart.Date := PrintFrom; + dePrintRangeEnd.Date := PrintTo; + end; + + AssignTabSheetObjects; + RefreshPrintStyles; + ActivatePrintStyleTab; + + AssignDailyTabObjects; + AssignDetailsTabObjects; + AssignMemoTabObjects; + AssignMonthlyTabObjects; + AssignTrifoldTabObjects; + AssignWeeklyTabObjects; + + // Formatting + with ReportLink.OptionsFormatting do + begin + cbxLookAndFeel.ItemIndex := Min(2, Integer(LookAndFeelKind)); + chbxSuppressBackgroundBitmaps.Checked := SuppressBackgroundBitmaps; + chbxSuppressContentColoration.Checked := SuppressContentColoration; + chbxUseNativeStyles.Checked := UseNativeStyles; + end; + + PageControl1Change(nil); +end; + +{$IFDEF DELPHI7} +function TcxfmSchedulerReportLinkDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +function TcxfmSchedulerReportLinkDesignWindow.CheckPrintRange: Boolean; +begin + Result := dePrintRangeEnd.Date >= dePrintRangeStart.Date; + if not Result then + begin + MessageBox(0, + PChar(cxGetResourceString(@sdxBadDatePrintRange)), + PChar(cxGetResourceString(@sdxReportDesignerCaption)), + MB_ICONINFORMATION or MB_OK); + PageControl1.ActivePage := tshPrintRange; + ActiveControl := dePrintRangeEnd; + end; +end; + +function TcxfmSchedulerReportLinkDesignWindow.CheckPrintStyleSettings: Boolean; + + procedure ShowWarning; + begin + MessageBox(0, + PChar(cxGetResourceString(@sdxBadTimePrintRange)), + PChar(cxGetResourceString(@sdxReportDesignerCaption)), + MB_ICONINFORMATION or MB_OK); + end; + +begin + if pcPrintStyleOptions.ActivePage = tshDaily then + begin + Result := TimeOf(tePrintStyleDailyPrintFrom.Time) <= TimeOf(tePrintStyleDailyPrintTo.Time); + if not Result then + begin + ShowWarning; + PageControl1.ActivePage := tshPrintStyles; + pcPrintStyleOptions.ActivePage := tshDaily; + ActiveControl := tePrintStyleDailyPrintTo; + end; + end + else + if pcPrintStyleOptions.ActivePage = tshWeekly then + begin + Result := TimeOf(tePrintStyleWeeklyPrintFrom.Time) <= TimeOf(tePrintStyleWeeklyPrintTo.Time); + if not Result then + begin + ShowWarning; + PageControl1.ActivePage := tshPrintStyles; + pcPrintStyleOptions.ActivePage := tshWeekly; + ActiveControl := tePrintStyleWeeklyPrintTo; + end; + end + else + Result := True; +end; + +function TcxfmSchedulerReportLinkDesignWindow.IsValidConditions: Boolean; +begin + Result := CheckPrintRange and CheckPrintStyleSettings; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadCaption( + AControl: TControl; StrPtr: Pointer); +begin + TControlAccess(AControl).Caption := cxGetResourceString(StrPtr); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadCaption( + AItem: TMenuItem; StrPtr: Pointer); +begin + AItem.Caption := cxGetResourceString(StrPtr); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStrings; +begin + inherited LoadStrings; + LoadStringsDaily; + LoadStringsMonthly; + LoadStringsWeekly; + LoadStringsTrifold; + LoadStringsDetails; + LoadStringsMemo; + LoadStringsOther; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsCombo( + ACombo: TcxComboBox; ACaptions: array of Pointer); +var + I: Integer; +begin + with ACombo.Properties.Items do + begin + BeginUpdate; + try + Clear; + for I := 0 to High(ACaptions) do + if ACaptions[I] <> nil then Add(cxGetResourceString(ACaptions[I])); + finally + EndUpdate; + end; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsDaily; +begin + LoadCaption(lblPrintStyleDailyLayout, @sdxPrintStyleLayout); + LoadStringsCombo(cbxPrintStyleDailyLayout, + [@sdxPrintStyleDailyLayout1PPD, + @sdxPrintStyleDailyLayout2PPD]); + LoadCaption(lblPrintStyleDailyResourceCountPerPage, + @sdxResourceCountPerPage); + LoadCaption(lblPrintStyleDailyInclude, + @sdxPrintStyleInclude); + LoadCaption(chbxPrintStyleDailyTaskPad, + @sdxPrintStyleIncludeTaskPad); + LoadCaption(chbxPrintStyleDailyNotesAreaBlank, + @sdxPrintStyleIncludeNotesAreaBlank); + LoadCaption(chbxPrintStyleDailyNotesAreaLined, + @sdxPrintStyleIncludeNotesAreaLined); + LoadCaption(lblPrintStyleDailyPrintFrom, @sdxPrintStylePrintFrom); + LoadCaption(lblPrintStyleDailyPrintTo, @sdxPrintStylePrintTo); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsDetails; +begin + LoadCaption(chbxPrintStyleDetailsUsePagination, + @sdxPrintStyleDetailsStartNewPageEach); + LoadStringsCombo(cbxPrintStyleDetailsPagination, + [@sdxDay, @sdxWeek, @sdxMonth]); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsMemo; +begin + LoadCaption(chbxPrintStyleMemoStartEachItemOnNewPage, + @sdxPrintStyleMemoStartEachItemOnNewPage); + LoadCaption(chbxPrintStyleMemoPrintOnlySelectedEvents, + @sdxPrintStyleMemoPrintOnlySelectedEvents); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsMonthly; +begin + LoadCaption(lblPrintStyleMonthlyLayout, @sdxPrintStyleLayout); + LoadStringsCombo(cbxPrintStyleMonthlyLayout, + [@sdxPrintStyleMonthlyLayout1PPM, @sdxPrintStyleMonthlyLayout2PPM]); + LoadCaption(lblPrintStyleMonthlyResourceCountPerPage, @sdxResourceCountPerPage); + LoadCaption(lblPrintStyleMonthlyInclude, @sdxPrintStyleInclude); + LoadCaption(chbxPrintStyleMonthlyTaskPad, @sdxPrintStyleIncludeTaskPad); + LoadCaption(chbxPrintStyleMonthlyNotesAreaBlank, @sdxPrintStyleIncludeNotesAreaBlank); + LoadCaption(chbxPrintStyleMonthlyNotesAreaLined, @sdxPrintStyleIncludeNotesAreaLined); + + LoadCaption(chbxPrintStyleMonthlyDontPrintWeekends, @sdxPrintStyleDontPrintWeekEnds); + LoadCaption(chbxPrintStyleMonthlyPrintExactlyOneMonthPerPage, @sdxPrintStyleMonthlyPrintExactly1MPP); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsOther; + + procedure AdjustBevelSize(ABevel: TBevel; AControl: TControl); + var + Right: Integer; + begin + Right := ABevel.BoundsRect.Right; + ABevel.Left := AControl.Left + AControl.Width + 10; + ABevel.Width := Right - ABevel.Left; + end; + +begin + lblPreviewWindow.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + // Misc + LoadCaption(tshPrintRange, @sdxPrintRanges); + LoadCaption(lblPrintRangeStart, @sdxPrintRangeStart); + LoadCaption(lblPrintRangeEnd, @sdxPrintRangeEnd); + LoadCaption(lblPrintRangesMiscellaneous, @sdxMiscellaneous); + LoadCaption(chbxHideDetailsOfPrivateAppointments, + @sdxHideDetailsOfPrivateAppointments); + LoadCaption(tshPrintStyles, @sdxTabPrintStyles); + LoadCaption(lblPrintStylesOptions, @sdxOptions); + AdjustBevelSize(bvlPrintStyleOptions, lblPrintStylesOptions); + // Formatting + LoadCaption(tshFormatting, @sdxFormatting); + LoadCaption(lblLookAndFeel, @sdxLookAndFeel); + AdjustBevelSize(bvlLookAndFeel, lblLookAndFeel); + LoadStringsCombo(cbxLookAndFeel, [@sdxLookAndFeelFlat, + @sdxLookAndFeelStandard, @sdxLookAndFeelUltraFlat]); + LoadCaption(lblRefinements, @sdxRefinements); + AdjustBevelSize(bvlRefinements, lblRefinements); + LoadCaption(chbxSuppressBackgroundBitmaps, @sdxSuppressBackgroundBitmaps); + LoadCaption(chbxSuppressContentColoration, @sdxSuppressContentColoration); + // Styles + LoadCaption(tshStyles, @sdxStyles); + LoadCaption(lblUseNativeStyles, @sdxUseNativeStyles); + AdjustBevelSize(bvlStyles, lblUseNativeStyles); + LoadCaption(btnStyleColor, @sdxBtnColor); + LoadCaption(btnStyleFont, @sdxBtnFont); + LoadCaption(btnStyleBackgroundBitmap, @sdxBtnTexture); + LoadCaption(btnStyleBackgroundBitmapClear, @sdxBtnTextureClear); + LoadCaption(btnStyleRestoreDefaults, @sdxBtnRestoreDefaults); + LoadCaption(btnStylesSaveAs, @sdxBtnSaveAs); + LoadCaption(miStyleColor, @sdxBtnColor); + LoadCaption(miStyleFont, @sdxBtnFont); + LoadCaption(miStyleBackgroundBitmap, @sdxBtnTexture); + LoadCaption(miStyleBackgroundBitmapClear, @sdxBtnTextureClear); + LoadCaption(miStyleRestoreDefaults, @sdxBtnRestoreDefaults); + LoadCaption(miStylesSelectAll, @sdxSelectAll); + LoadCaption(miStylesSaveAs, @sdxBtnSaveAs); + LoadCaption(lblStyleSheets, @sdxStyleSheets); + AdjustBevelSize(bvlStyleSheets, lblStyleSheets); + LoadCaption(btnStyleSheetNew, @sdxBtnNew); + LoadCaption(btnStyleSheetCopy, @sdxBtnCopy); + LoadCaption(btnStyleSheetDelete, @sdxBtnDelete); + LoadCaption(btnStyleSheetRename, @sdxBtnRename); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsTrifold; + + procedure FillTrifoldSectionStrings(ACombobox: TcxCombobox); + begin + LoadStringsCombo(ACombobox, + [@sdxPrintStyleTrifoldSectionModeDailyCalendar, + @sdxPrintStyleTrifoldSectionModeWeeklyCalendar, + @sdxPrintStyleTrifoldSectionModeMonthlyCalendar, + @sdxPrintStyleTrifoldSectionModeTaskPad, + @sdxPrintStyleTrifoldSectionModeNotesBlank, + @sdxPrintStyleTrifoldSectionModeNotesLined]); + end; + +begin + LoadCaption(lblPrintStyleTrifoldSectionLeft, @sdxPrintStyleTrifoldSectionLeft); + FillTrifoldSectionStrings(cbxPrintStyleTrifoldSectionLeft); + LoadCaption(lblPrintStyleTrifoldSectionMiddle, @sdxPrintStyleTrifoldSectionMiddle); + FillTrifoldSectionStrings(cbxPrintStyleTrifoldSectionMiddle); + LoadCaption(lblPrintStyleTrifoldSectionRight, @sdxPrintStyleTrifoldSectionRight); + FillTrifoldSectionStrings(cbxPrintStyleTrifoldSectionRight); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LoadStringsWeekly; +begin + LoadCaption(lblPrintStyleWeeklyArrange, @sdxPrintStyleWeeklyArrange); + LoadStringsCombo(cbxPrintStyleWeeklyArrange, + [@sdxPrintStyleWeeklyArrangeT2B, @sdxPrintStyleWeeklyArrangeL2R]); + + LoadCaption(lblPrintStyleWeeklyLayout, @sdxPrintStyleLayout); + LoadStringsCombo(cbxPrintStyleWeeklyLayout, + [@sdxPrintStyleWeeklyLayout1PPW, @sdxPrintStyleWeeklyLayout2PPW]); + LoadCaption(lblPrintStyleWeeklyResourceCountPerPage, @sdxResourceCountPerPage); + LoadCaption(lblPrintStyleWeeklyInclude, @sdxPrintStyleInclude); + LoadCaption(chbxPrintStyleWeeklyTaskPad, @sdxPrintStyleIncludeTaskPad); + LoadCaption(chbxPrintStyleWeeklyNotesAreaBlank, @sdxPrintStyleIncludeNotesAreaBlank); + LoadCaption(chbxPrintStyleWeeklyNotesAreaLined, @sdxPrintStyleIncludeNotesAreaLined); + + LoadCaption(lblPrintStyleWeeklyPrintFrom, @sdxPrintStylePrintFrom); + LoadCaption(lblPrintStyleWeeklyPrintTo, @sdxPrintStylePrintTo); + + LoadCaption(chbxPrintStyleWeeklyDontPrintWeekends, @sdxPrintStyleDontPrintWeekEnds); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.PreviewDrawPageContent( + ACanvas: TCanvas; ABounds: TRect); +const + AMessageFlags = DXTO_CENTER_HORIZONTALLY or DXTO_CENTER_VERTICALLY or DXTO_WORDBREAK; +var + AMsg: PChar; + R, R1: TRect; + APrinter: TdxComponentPrinter; + ALink: TcxSchedulerReportLink; + ASource, ADest: TBitmap; +begin + if ReportLink.Component = nil then + begin + ACanvas.Brush.Color := clWindow; + ACanvas.FillRect(ABounds); + Exit; + end; + APrinter := TdxComponentPrinter.Create(nil); + try + ALink := TcxSchedulerReportLink.Create(APrinter); + ALink.LinkInPreviewMode := True; + try + ALink.Assign(ReportLink); + ALink.PrinterPage.RestoreDefaults; + ALink.Component := ReportLink.Component; + ALink.ComponentPrinter := APrinter; + AMsg := nil; + with ALink do + R1 := MakeBounds(0, 0, PageWidth, PageHeight); + ASource := cxCreateBitmap(cxSize(R1.Right, R1.Bottom)); + ASource.Canvas.Lock; + try + R := cxRectOffset(ABounds, -ABounds.Left, -ABounds.Top); + ALink.PrintStyles.ActiveStyle := ALink.PrintStyles[ + ReportLink.PrintStyles.IndexOf(ReportLink.PrintStyles.ActiveStyle)]; + ALink.RebuildReport; + FillRect(ASource.Canvas.Handle, R1, GetSysColorBrush(COLOR_WINDOW)); + if ALink.PageCount > 0 then + APrinter.PaintPage(ASource.Canvas, 0, R1, R1, ALink) + else + with ReportLink.PrintStyles do + begin + if (FActiveStyle = Memo) and Memo.SelectedEventsOnly then + AMsg := PChar(cxGetResourceString(@sdxCannotPrintNoSelectedItems)) + else + AMsg := PChar(cxGetResourceString(@sdxCannotPrintNoItemsAvailable)); + end; + ADest := cxCreateBitmap(cxSize(R.Right, R.Bottom)); + ADest.Canvas.Lock; + try + cxSmoothResizeBitmap(ASource, ADest); + if AMsg <> nil then + dxTextOut(ADest.Canvas.Handle, AMsg, R, AMessageFlags); + ACanvas.Draw(0, 0, ADest); + finally + ADest.Canvas.UnLock; + ADest.Free; + end; + finally + ASource.Canvas.Unlock; + ASource.Free; + end; + finally + ALink.Free; + end; + finally + APrinter.Free; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.UpdateControlsState; +begin + inherited UpdateControlsState; + + UpdateEnabledControls([lblPrintStyleDailyPrintFrom, tePrintStyleDailyPrintFrom, + lblPrintStyleDailyPrintTo, tePrintStyleDailyPrintTo], + ReportLink.PrintStyles.Daily.SupportTimeRange); + UpdateEnabledControls([lblPrintStyleWeeklyPrintFrom, tePrintStyleWeeklyPrintFrom, + lblPrintStyleWeeklyPrintTo, tePrintStyleWeeklyPrintTo], + ReportLink.PrintStyles.Weekly.SupportTimeRange); + + chbxPrintStyleWeeklyDontPrintWeekends.Enabled := + ReportLink.PrintStyles.Weekly.CanDontPrintWeekends; + + UpdateEnabled(lbxStyles, AreNativeStylesAvailable); + UpdateEnabled(btnStyleColor, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(btnStyleFont, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(btnStyleBackgroundBitmap, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(btnStyleBackgroundBitmapClear, AreNativeStylesAvailable and HasSelectedStylesWithAssignedBitmap); + UpdateEnabled(btnStyleRestoreDefaults, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(btnStylesSaveAs, CanSaveStyles); + + UpdateEnabled(lblStyleSheets, AreNativeStylesAvailable); + UpdateEnabled(cbxStyleSheets, AreNativeStylesAvailable); + UpdateEnabled(btnStyleSheetNew, CanCreateStyleSheet); + UpdateEnabled(btnStyleSheetCopy, CanCopyStyleSheet); + UpdateEnabled(btnStyleSheetDelete, CanDeleteStyleSheet); + UpdateEnabled(btnStyleSheetRename, CanRenameStyleSheet); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.UpdateEnabled( + AControl: TControl; AEnabled: Boolean); +begin + TControlAccess(AControl).Enabled := AEnabled; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.UpdateEnabled( + AItem: TMenuItem; AEnabled: Boolean); +begin + AItem.Enabled := AEnabled; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.UpdateEnabledControls( + AControls: array of TControl; AEnabled: Boolean); +var + I: Integer; +begin + for I := 0 to High(AControls) do + UpdateEnabled(AControls[I], AEnabled); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.UpdatePreview; +begin + if Visible then + begin + RefreshPrintStyles; + pbxPrintStylesPreview.Refresh; + pbPreview.Refresh; + end; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetDesignerTabIndex: Integer; +begin + Result := PageControl1.ActivePage.TabIndex; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SetDesignerTabIndex(Value: Integer); +begin + if Value < 0 then Value := 0; + if Value > PageControl1.PageCount - 1 then + Value := PageControl1.PageCount - 1; + PageControl1.ActivePage := PageControl1.Pages[Value]; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoActiveStyleSheetChanged; +begin + inherited; + lbxStyles.ReportLinkStyles := ReportLink.ActiveStyles; + with cbxStyleSheets do + ItemIndex := Properties.Items.IndexOfObject(ActiveStyleSheet); + + if not LockControlsUpdate then + begin + Modified := True; + UpdatePreview; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoFormActivated(AnActive: Boolean); +begin + inherited; + if not AnActive then lbxStyles.HideToolTips; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoRefreshStylesList; +var + Styles: TcxSchedulerReportLinkStyles; + List: TList; +begin + Styles := ReportLink.ActiveStyles; + with lbxStyles.Items do + begin + BeginUpdate; + try + List := TList.Create; + try + SaveSelectedStyles(List); + try + Clear; + AddObject(cxGetResourceString(@sdxSchedulerSchedulerHeader), Styles.SchedulerHeader); + AddObject(cxGetResourceString(@sdxSchedulerContent), Styles.Content); + AddObject(cxGetResourceString(@sdxSchedulerDateNavigatorContent), Styles.DateNavigatorContent); + AddObject(cxGetResourceString(@sdxSchedulerDateNavigatorHeader), Styles.DateNavigatorHeader); + AddObject(cxGetResourceString(@sdxSchedulerDayHeader), Styles.DayHeader); + AddObject(cxGetResourceString(@sdxSchedulerEvent), Styles.Event); + AddObject(cxGetResourceString(@sdxSchedulerResourceHeader), Styles.ResourceHeader); + AddObject(cxGetResourceString(@sdxSchedulerNotesAreaBlank), Styles.NotesAreaBlank); + AddObject(cxGetResourceString(@sdxSchedulerNotesAreaLined), Styles.NotesAreaLined); + AddObject(cxGetResourceString(@sdxSchedulerTaskPad), Styles.TaskPad); + AddObject(cxGetResourceString(@sdxSchedulerTimeRuler), Styles.TimeRuler); + finally + RestoreSelectedStyles(List); + end; + finally + List.Free; + end; + finally + EndUpdate; + end; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoStyleChanged(const ACaption: string; + AStyle: TcxStyle); +begin + inherited; + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.DoStylesChanged(AStrings: TStrings; + ARecreate: Boolean); +begin + if ARecreate then + RecreateStylesListBox + else + lbxStyles.Invalidate; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.GetSelectedStyleNames(AStrings: TStrings); +var + I: Integer; +begin + AStrings.Clear; + with lbxStyles do + for I := 0 to Items.Count - 1 do + if Selected[I] then + AStrings.AddObject(Items[I], Items.Objects[I]); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.GetStyleNames(out AStrings: TStrings); +begin + AStrings := lbxStyles.Items; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.GetStyleSheetNames(out AStrings: TStrings); +begin + AStrings := cbxStyleSheets.Properties.Items; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.ActivatePrintStyleTab; +begin + pcPrintStyleOptions.ActivePageIndex := FindTabIndexByPrintStyle(ActivePrintStyle); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.AssignTabSheetObjects; +begin + with ReportLink.PrintStyles do + begin + tshDaily.Tag := MakeTTag(Daily); + tshWeekly.Tag := MakeTTag(Weekly); + tshMonthly.Tag := MakeTTag(Monthly); + tshTrifold.Tag := MakeTTag(Trifold); + tshDetails.Tag := MakeTTag(Details); + tshMemo.Tag := MakeTTag(Memo); + end; +end; + +function TcxfmSchedulerReportLinkDesignWindow.FindTabIndexByPrintStyle(APrintStyle: TcxCustomSchedulerReportLinkPrintStyle): Integer; +begin + for Result := 0 to pcPrintStyleOptions.PageCount - 1 do + if pcPrintStyleOptions.Pages[Result].Tag = MakeTTag(APrintStyle) then Exit; + Result := -1; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.RefreshPrintStyles; +var + AItems: TcxImageComboBoxItems; + ActiveStyleIndex, I: Integer; + + procedure CheckAndAddPrintStyle(APrintStyle: TcxCustomSchedulerReportLinkPrintStyle); + begin + with TcxImageComboBoxItem(AItems.Add) do + begin + ImageIndex := APrintStyle.GlyphIndex; + Description := APrintStyle.Caption; + Value := Index; + Tag := Integer(APrintStyle); + end; + if (ActiveStyleIndex = -1) and (APrintStyle = ReportLink.PrintStyles.ActiveStyle) then + ActiveStyleIndex := AItems.Count - 1; + end; + +begin + ActiveStyleIndex := cbxPrintStyles.ItemIndex; + cbxPrintStyles.Properties.Images := StyleImages; + AItems := cbxPrintStyles.Properties.Items; + AItems.BeginUpdate; + try + AItems.Clear; + for I := 0 to ReportLink.PrintStyles.Count - 1 do + CheckAndAddPrintStyle(ReportLink.PrintStyles.Items[I]); + cbxPrintStyles.ItemIndex := ActiveStyleIndex; + finally + AItems.EndUpdate; + end; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetActivePrintStyle: TcxCustomSchedulerReportLinkPrintStyle; +begin + if cbxPrintStyles.ItemIndex <> -1 then + begin + with cbxPrintStyles.Properties.Items[cbxPrintStyles.ItemIndex] do + Result := TcxCustomSchedulerReportLinkPrintStyle(Tag) + end + else + Result := nil; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetActiveStyle: TcxStyle; +begin + with lbxStyles do + if ItemIndex <> -1 then + Result := TcxStyle(Items.Objects[ItemIndex]) + else + Result := nil; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetComponent: TcxScheduler; +begin + Result := inherited Component as TcxScheduler; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetHasSelectedStyles: Boolean; +begin + Result := lbxStyles.SelCount <> 0; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetHasSelectedStylesWithAssignedBitmap: Boolean; +var + Strings: TStrings; + I: Integer; + cxStyle: TcxStyle; +begin + Result := True; + Strings := TStringList.Create; + try + GetSelectedStyleNames(Strings); + for I := 0 to Strings.Count - 1 do + begin + cxStyle := TcxStyle(Strings.Objects[I]); + if (cxStyle <> nil) and (cxStyle.Bitmap <> nil) and not cxStyle.Bitmap.Empty then + Exit; + end; + finally + Strings.Free; + end; + Result := False; +end; + +function TcxfmSchedulerReportLinkDesignWindow.GetReportLink: TcxSchedulerReportLink; +begin + Result := inherited ReportLink as TcxSchedulerReportLink; +end; + +function TcxfmSchedulerReportLinkDesignWindow.CanSelectAllStyles: Boolean; +var + I: Integer; +begin + Result := AreNativeStylesAvailable; + if Result then + begin + for I := 0 to lbxStyles.Items.Count - 1 do + if not lbxStyles.Selected[I] then Exit; + Result := False; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.CreateControls; + + procedure CreateStylesListBox; + begin + lbxStyles := TdxStylesListBox.Create(Self); + lbxStyles.Parent := tshStyles; + lbxStyles.BoundsRect := bvlStylesHost.BoundsRect; + lbxStyles.PopupMenu := pmStyles; + lbxStyles.TabOrder := chbxUseNativeStyles.TabOrder + 1; + lbxStyles.OnClick := lbxStylesClick; + bvlStylesHost.Visible := False; + + dxPSPopupMan.dxPSPopupMenuController.RegisterControl(lbxStyles); + end; + +begin + CreateStylesListBox; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.RecreateStylesListBox; +var + List: TList; +begin + List := TList.Create; + try + SaveSelectedStyles(List); + dxPSUtl.dxRecreateWnd(lbxStyles); + RestoreSelectedStyles(List); + finally + List.Free; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.RestoreSelectedStyles(AList: TList); +var + I: Integer; +begin + for I := 0 to AList.Count - 1 do + lbxStyles.Selected[Integer(AList[I])] := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SaveSelectedStyles(AList: TList); +var + I: Integer; +begin + AList.Clear; + for I := 0 to lbxStyles.Items.Count - 1 do + if lbxStyles.Selected[I] then AList.Add(TObject(I)); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SetActivePage; +begin + PageControl1.ActivePage := PageControl1.Pages[DesignerTabIndex]; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SetOptionsFormattingByIndex(AnIndex: Integer; + AValue: Boolean); +begin + if LockControlsUpdate then Exit; + + with ReportLink.OptionsFormatting do + case AnIndex of + 0: + begin + UseNativeStyles := AValue; + RecreateStylesListBox; + end; + 1: SuppressBackgroundBitmaps := AValue; + 2: SuppressContentColoration := AValue; + end; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SetPrintStyleOptionsViewByIndex(AnIndex: Integer; + AValue: Boolean); +begin + if not LockControlsUpdate then + begin + case AnIndex of + 0: + ActivePrintStyle.ShowTaskPad := AValue; + 1: + ActivePrintStyle.ShowNotesAreaBlank := AValue; + 2: + ActivePrintStyle.ShowNotesAreaLined := AValue; + end; + Modified := True; + UpdatePreview; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SetPrintStyleRangeByIndex(AnIndex: Integer; + const ATime: TDateTime); +begin + if not LockControlsUpdate then + begin + case AnIndex of + 0: + ActivePrintStyle.TimePrintFrom := ATime; + 1: + ActivePrintStyle.TimePrintTo := ATime; + end; + Modified := True; + UpdatePreview; + UpdateControlsState; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.SetPrintStyleResourceCountPerPageByIndex(AnIndex: Integer; + AValue: TcxEditValue); +begin + if LockControlsUpdate then Exit; + with ReportLink.PrintStyles do + case AnIndex of + 0: Daily.ResourceCountPerPage := AValue; + 1: Weekly.ResourceCountPerPage := AValue; + 2: Monthly.ResourceCountPerPage := AValue; + end; + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.FormCloseQuery(Sender: TObject; + var CanClose: Boolean); + + procedure ValidateEditors; + begin + FIsFormClosing := True; + try + dePrintRangeStart.ValidateEdit(False); + dePrintRangeEnd.ValidateEdit(False); + + tePrintStyleDailyPrintFrom.ValidateEdit(False); + tePrintStyleDailyPrintTo.ValidateEdit(False); + tePrintStyleWeeklyPrintFrom.ValidateEdit(False); + tePrintStyleWeeklyPrintTo.ValidateEdit(False); + finally + FisFormClosing := False; + end; + end; + +begin + if ModalResult = mrOK then + begin + ValidateEditors; + CanClose := IsValidConditions; + end; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.PageControl1Change(Sender: TObject); +begin + pnlPrintStylesPreview.Visible := PageControl1.ActivePage = tshPrintStyles; + pnlPreview.Visible := PageControl1.ActivePage <> tshPrintStyles; + lblPreviewWindow.Parent := PageControl1.ActivePage; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.lbxStylesClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + UpdateControlsState; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleFontClick(Sender: TObject); +begin + PerformStylesChangeFont; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleColorClick(Sender: TObject); +begin + PerformStylesChangeColor; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleBackgroundBitmapClick(Sender: TObject); +begin + PerformStylesChangeBitmap; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleBackgroundBitmapClearClick(Sender: TObject); +begin + PerformStylesClearBitmap; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.miStylesSelectAllClick(Sender: TObject); +{$IFNDEF DELPHI6} +var + I: Integer; +{$ENDIF} +begin + with lbxStyles do + begin + {$IFDEF DELPHI6} + SelectAll; + {$ELSE} + Items.BeginUpdate; + try + for I := 0 to Items.Count - 1 do + Selected[I] := True; + finally + Items.EndUpdate; + end; + {$ENDIF} + end; + UpdateControlsState; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleRestoreDefaultsClick(Sender: TObject); +begin + PerformStylesRestoreDefaults; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStylesSaveAsClick(Sender: TObject); +begin + PerformStylesSaveAsStyleSheet; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxStyleSheetsClick(Sender: TObject); +begin + with TcxComboBox(Sender) do + ActiveStyleSheet := TcxCustomStyleSheet(Properties.Items.Objects[ItemIndex]); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxStyleSheetsPropertiesDrawItem( + AControl: TcxCustomComboBox; ACanvas: TcxCanvas; AIndex: Integer; + const ARect: TRect; AState: TOwnerDrawState); +begin + PerformStyleSheetDrawItem(ACanvas.Canvas, AIndex, ARect, AState, AControl.Enabled); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxStyleSheetsKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + PerformStyleSheetKeyDown(Sender, Key, Shift); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleSheetNewClick(Sender: TObject); +begin + PerformStyleSheetNew; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleSheetCopyClick(Sender: TObject); +begin + PerformStyleSheetCopy; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleSheetDeleteClick(Sender: TObject); +begin + PerformStyleSheetDelete; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.btnStyleSheetRenameClick(Sender: TObject); +begin + PerformStyleSheetRename; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.lblUseNativeStylesClick(Sender: TObject); +begin + if chbxUseNativeStyles.CanFocus then ActiveControl := chbxUseNativeStyles; + chbxUseNativeStyles.Checked := not chbxUseNativeStyles.Checked; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.OptionsFormattingClick(Sender: TObject); +begin + with TcxCheckBox(Sender) do + SetOptionsFormattingByIndex(TTagToInt(Tag), Checked); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.LookAndFeelChange(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TcxComboBox(Sender) do + ReportLink.OptionsFormatting.LookAndFeelKind := TcxLookAndFeelKind(Properties.Items.Objects[ItemIndex]); + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.pmStylesPopup(Sender: TObject); +begin + lbxStyles.HideToolTips; + UpdateEnabled(miStyleColor, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(miStyleFont, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(miStyleBackgroundBitmap, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(miStyleBackgroundBitmapClear, AreNativeStylesAvailable and HasSelectedStylesWithAssignedBitmap); + UpdateEnabled(miStyleRestoreDefaults, AreNativeStylesAvailable and HasSelectedStyles); + UpdateEnabled(miStylesSelectAll, CanSelectAllStyles); + UpdateEnabled(miStylesSaveAs, CanSaveStyles); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.dePrintRangeStartEditValueChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintRange.PrintFrom := TcxDateEdit(Sender).Date; + Modified := True; + UpdatePreview; + UpdateControlsState; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.dePrintRangeEndEditValueChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintRange.PrintTo := TcxDateEdit(Sender).Date; + Modified := True; + UpdatePreview; + UpdateControlsState; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStylesClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with ReportLink.PrintStyles do + FActiveStyle := Items[TcxComboBox(Sender).ItemIndex]; + ActivatePrintStyleTab; + Modified := True; + UpdatePreview; + UpdateControlsState; +end; + +// Daily +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleDailyLayoutClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Daily.Layout := + TcxSchedulerReportLinkPeriodicPrintStyleLayout(TcxComboBox(Sender).ItemIndex); + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.sePrintStyleResourceCountPerPagePropertiesChanged( + Sender: TObject); +begin + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.sePrintStyleResourceCountPerPagePropertiesEditValueChanged( + Sender: TObject); +begin + with TcxSpinEdit(Sender) do + SetPrintStyleResourceCountPerPageByIndex(TTagToInt(Tag), Value); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleOptionsViewClick( + Sender: TObject); +begin + with TcxCheckBox(Sender) do + SetPrintStyleOptionsViewByIndex(TTagToInt(Tag), Checked); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.tePrintStylePrintRangePropertiesEditValueChanged( + Sender: TObject); +begin + with TcxTimeEdit(Sender) do + SetPrintStyleRangeByIndex(TTagToInt(Tag), Time); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.tePrintStylePrintRangePropertiesChange( + Sender: TObject); +begin + Modified := True; +end; + +// Weekly +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleWeeklyArrangeClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Weekly.Arrange := + TcxSchedulerReportLinkWeeklyPrintStyleArrange(TcxComboBox(Sender).ItemIndex); + cbxPrintStyles.Invalidate; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleWeeklyLayoutClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Weekly.Layout := + TcxSchedulerReportLinkPeriodicPrintStyleLayout(TcxComboBox(Sender).ItemIndex); + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleWeeklyDontPrintWeekendsClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Weekly.DontPrintWeekends := TcxCheckBox(Sender).Checked; + Modified := True; +end; + +// Monthly +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleMonthlyLayoutClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Monthly.Layout := + TcxSchedulerReportLinkPeriodicPrintStyleLayout(TcxComboBox(Sender).ItemIndex); + Modified := True; + UpdatePreview; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleMonthlyDontPrintWeekendsClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Monthly.DontPrintWeekends := + TcxCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleMonthlyPrintExactlyOneMonthPerPageClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Monthly.PrintExactlyOneMonthPerPage := + TcxCheckBox(Sender).Checked; + Modified := True; +end; + +// Tri-fold +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleTrifoldSectionModeClick( + Sender: TObject); +begin + if LockControlsUpdate or not (ActivePrintStyle is TcxSchedulerReportLinkTrifoldPrintStyle) then Exit; + with TcxSchedulerReportLinkTrifoldPrintStyle(ActivePrintStyle) do + FSections[TTagToInt(TcxComboBox(Sender).Tag)] := TcxSchedulerReportLinkTrifoldPrintStyleSectionMode(TcxComboBox(Sender).ItemIndex); + Modified := True; + UpdateControlsState; +end; + +// Details +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleDetailsUsePaginationClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Details.UsePagination := TcxCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxPrintStyleDetailsPaginationClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Details.PaginationMode := + TcxSchedulerReportLinkDetailsPrintStylePaginationMode(TcxComboBox(Sender).ItemIndex); + Modified := True; +end; + +// Memo +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleMemoStartEachItemOnNewPageClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Memo.StartEachItemOnNewPage := TcxCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.chbxPrintStyleMemoPrintOnlySelectedEventsClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PrintStyles.Memo.SelectedEventsOnly := TcxCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.pbxPrintStylesPreviewPaint(Sender: TObject); +begin + with TPaintBox(Sender) do + if ActivePrintStyle <> nil then + ActivePrintStyle.DrawDesignWindowPreview(Canvas, ClientRect); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.StyleController1StyleChanged( + Sender: TObject); +begin +// +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.pbPreviewPaint( + Sender: TObject); +begin + PreviewDrawPageContent(pbPreview.Canvas, pbPreview.ClientRect); +end; + +procedure TcxfmSchedulerReportLinkDesignWindow.cbxLookAndFeelPropertiesChange( + Sender: TObject); +begin + ReportLink.OptionsFormatting.LookAndFeelKind := TcxLookAndFeelKind(cbxLookAndFeel.ItemIndex); +end; + +{ TcxSchedulerReportPageSite } + +procedure TcxSchedulerReportPageSite.ReadProperties(AReader: TdxPSDataReader); +begin + inherited ReadProperties(AReader); + FPageIndex := AReader.ReadInteger; + FPrimaryPage := AReader.ReadBoolean; +end; + +procedure TcxSchedulerReportPageSite.WriteProperties(AWriter: TdxPSDataWriter); +begin + inherited WriteProperties(AWriter); + AWriter.WriteInteger(FPageIndex); + AWriter.WriteBoolean(FPrimaryPage); +end; + +{ TcxSchedulerReportPageItemCell } + +constructor TcxSchedulerReportPageItemCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + BorderClass := TdxPSCellUltraFlatBorder; + ClipChildren := True; +end; + +function TcxSchedulerReportPageItemCell.GetType: TcxSchedulerReportItemsType; +begin + Result := srUnknownItem; +end; + +procedure TcxSchedulerReportPageItemCell.SetCellViewParams( + AItem: TdxReportVisualItem; const AParams: TcxViewParams); +begin + ReportLink.SetCellViewParams(AItem, AParams); +end; + +procedure TcxSchedulerReportPageItemCell.SetCellViewParams( + AItem: TdxReportVisualItem; const AParams: TdxReportItemViewParams); +begin + ReportLink.SetCellViewParams(AItem, AParams); +end; + +function TcxSchedulerReportPageItemCell.GetPageIndex: Integer; +begin + Result := PageSite.PageIndex; +end; + +function TcxSchedulerReportPageItemCell.GetPageSite: TcxSchedulerReportPageSite; +var + AParent: TdxReportCell; +begin + AParent := inherited Parent; + while (AParent <> nil) and not (AParent is TcxSchedulerReportPageSite) do + AParent := AParent.Parent; + Result := AParent as TcxSchedulerReportPageSite; +end; + +function TcxSchedulerReportPageItemCell.GetPrimaryPage: Boolean; +begin + Result := PageSite.PrimaryPage; +end; + +function TcxSchedulerReportPageItemCell.GetReportLink: TcxSchedulerReportLink; +begin + Result := TcxSchedulerReportLink(Renderer.ReportLink); +end; + +{ TcxSchedulerReportNotesDataCell } + +constructor TcxSchedulerReportNotesDataCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + TextAlignX := taCenterX; + TextAlignY := taCenterY; + CaptionHeight := 16; + Data := cdidSchedulerNotesArea; +end; + +procedure TcxSchedulerReportNotesDataCell.DrawContent( + DC: HDC; AStage: TdxPSRenderStages); +var + R: TRect; + C, I: Integer; +begin + inherited DrawContent(DC, AStage); + if CaptionHeight <= 0 then Exit; + R := GetInnerBounds(DC); + FixupRect(DC, R); + C := R.Bottom - R. Top; + R.Bottom := R.Top + CaptionHeight; + // + if Caption <> '' then + begin + Renderer.DrawText(DC, R, -1, cxTextOffset, cxTextOffset, Caption, Font, + Color, TextAlignX, TextAlignY, False, MultiLine, False); + end; + // + Inc(R.Bottom, Max(1, Renderer.LineThickness div 2)); + if Lined then + C := (C - Renderer.LineThickness) div CaptionHeight + else + C := 1; + R.Top := R.Bottom - Renderer.LineThickness; + for I := 0 to C - 1 do + begin + FixupRect(DC, R); + Renderer.FillRect(DC, R, clBlack); + OffsetRect(R, 0, CaptionHeight); + end; +end; + +procedure TcxSchedulerReportNotesDataCell.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FCaption := AReader.ReadString; + FCaptionHeight := AReader.ReadInteger; + FLined := AReader.ReadBoolean; +end; + +procedure TcxSchedulerReportNotesDataCell.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteString(FCaption); + AWriter.WriteInteger(FCaptionHeight); + AWriter.WriteBoolean(FLined); +end; + +function TcxSchedulerReportNotesDataCell.GetMultiLine: Boolean; +begin + Result := inherited MultiLine; +end; + +function TcxSchedulerReportNotesDataCell.GetTextAlignX: TdxTextAlignX; +begin + Result := inherited TextAlignX; +end; + +function TcxSchedulerReportNotesDataCell.GetTextAlignY: TdxTextAlignY; +begin + Result := inherited TextAlignY; +end; + +procedure TcxSchedulerReportNotesDataCell.SetMultiLine(Value: Boolean); +begin + inherited MultiLine := Value; +end; + +procedure TcxSchedulerReportNotesDataCell.SetTextAlignX( + Value: TdxTextAlignX); +begin + inherited TextAlignX := Value; +end; + +procedure TcxSchedulerReportNotesDataCell.SetTextAlignY( + Value: TdxTextAlignY); +begin + inherited TextAlignY := Value; +end; + +{ TcxSchedulerReportNotesAreaCell } + +constructor TcxSchedulerReportNotesAreaCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + AddDataItem(GetDataCellClass) +end; + +constructor TcxSchedulerReportNotesAreaCell.CreateEx(AParent: TdxReportCell; ALined: Boolean); +begin + Create(AParent); + FLined := ALined; + DataCell.CellSides := []; + DataCell.Caption := cxGetResourceString(@sdxNotes); + DataCell.Lined := ALined; + ClipChildren := True; +end; + +procedure TcxSchedulerReportNotesAreaCell.BoundsChanged; +begin + inherited BoundsChanged; + DataCell.BoundsRect := GetInnerBounds(0); +end; + +procedure TcxSchedulerReportNotesAreaCell.ConvertCoords( + APixelsNumerator, APixelsDenominator: Integer); +begin + inherited ConvertCoords(APixelsNumerator, APixelsDenominator); + DataCell.CaptionHeight := MulDiv(DataCell.CaptionHeight, APixelsNumerator, APixelsDenominator); +end; + +function TcxSchedulerReportNotesAreaCell.GetType: TcxSchedulerReportItemsType; +begin + Result := srNotesBlank; + if DataCell.Lined then + Result := srNotesLined; +end; + +function TcxSchedulerReportNotesAreaCell.GetDataCellClass: TcxSchedulerReportNotesDataCellClass; +begin + Result := TcxSchedulerReportNotesDataCell; +end; + +procedure TcxSchedulerReportNotesAreaCell.SetFontIndex(Value: Integer); +begin + inherited SetFontIndex(Value); + if Font <> nil then + DataCell.CaptionHeight := cxTextHeight(Font) + cxTextOffset * 2; +end; + +function TcxSchedulerReportNotesAreaCell.GetDataCell: TcxSchedulerReportNotesDataCell; +begin + if (DataItemCount > 0) and (DataItems[0] is TcxSchedulerReportNotesDataCell) then + Result := TcxSchedulerReportNotesDataCell(DataItems[0]) + else + Result := nil; +end; + +{ TcxSchedulerReportTaskPadCell } + +constructor TcxSchedulerReportTaskPadCell.CreateEx( + AParent: TdxReportCell; ALined: Boolean); +begin + inherited CreateEx(AParent, ALined); + DataCell.Caption := cxGetResourceString(@sdxTaskPad); + DataCell.Data := cdidSchedulerTaskPad; +end; + +procedure TcxSchedulerReportTaskPadCell.BoundsChanged; +begin + inherited; + TaskPadDataSite.BoundsRect := CalculateTaskPadDataSiteBounds; +end; + +function TcxSchedulerReportTaskPadCell.CalculateTaskPadDataSiteBounds: TRect; +begin + Result := GetInnerBounds(NullDC); + Inc(Result.Top, DataCell.CaptionHeight); +end; + +function TcxSchedulerReportTaskPadCell.GetType: TcxSchedulerReportItemsType; +begin + Result := srTaskPad; +end; + +function TcxSchedulerReportTaskPadCell.GetTaskPadDataSite: TdxReportCell; +begin + if CellCount = 0 then AddCell; + Result := Cells[0]; + Result.CellSides := []; + Result.BoundsRect := CalculateTaskPadDataSiteBounds; +end; + +{ TcxSchedulerReportSchedulerHeaderDataCell } + +constructor TcxSchedulerReportSchedulerHeaderDataCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + CellSides := []; + Transparent := True; + Data := cdidSchedulerSchedulerHeader; +end; + +{ TcxSchedulerReportSchedulerHeaderCell } + +constructor TcxSchedulerReportSchedulerHeaderCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + FContent := AddContentCell; +end; + +procedure TcxSchedulerReportSchedulerHeaderCell.AdjustTextSize; +var + R1, R2: TRect; +begin + R1 := Content.BoundsRect; + R2 := R1; + if (SecondaryText <> '') and (PrimaryText <> '') then + begin + with R1 do + Bottom := Bottom - (Bottom - Top) div 4; + R2.Top := R1.Bottom; + end; + FPrimaryTextCell := AddTextCell(PrimaryText, R1, True); + FSecondaryTextCell := AddTextCell(SecondaryText, R2, False); + FContent.Index := MaxInt; //send to back +end; + +function TcxSchedulerReportSchedulerHeaderCell.AddContentCell: TcxSchedulerReportSchedulerHeaderDataCell; +begin + Result := TcxSchedulerReportSchedulerHeaderDataCell(AddDataItem(TcxSchedulerReportSchedulerHeaderDataCell)); +end; + +function TcxSchedulerReportSchedulerHeaderCell.AddTextCell(AText: string; + const ABounds: TRect; AMultiLine: Boolean): TdxReportCellString; +var + AFontH, ABoundsH: Integer; + AParams: TdxReportItemViewParams; +begin + if PrimaryText = '' then + begin + Result := nil; + Exit; + end; + Result := AddDataItem(TdxReportCellString) as TdxReportCellString; + Result.BoundsRect := ABounds; + Result.Text := AText; + Result.CellSides := []; + Result.Transparent := True; + Result.TextAlignY := taTop; + Result.TextAlignX := taLeft; + Result.Multiline := AMultiLine; + if AMultiLine and (Pos('#13', AText) <> 0) then + AText := Copy(AText, 1, Pos('#13', AText)); + AFontH := cxTextHeight(Font); + ABoundsH := (ABounds.Bottom - ABounds.Top) - cxTextOffset * 2; + if AMultiLine then + ABoundsH := ABoundsH div 2; + FillChar(AParams, SizeOf(AParams), 0); + AParams.FontStyle := []; + AParams.FontSize := MulDiv(Font.Size, ABoundsH, AFontH); + while (AParams.FontSize > 3) and (cxTextWidth(Font, AText, AParams.FontSize) > + ((ABounds.Right - ABounds.Left) - cxTextOffset * 2)) do Dec(AParams.FontSize, 2); + AParams.Transparent := True; + AParams.NativeParams.Font := Font; + AParams.NativeParams.TextColor := Font.Color; + ReportLink.SetCellViewParams(Result, AParams); +end; + +function TcxSchedulerReportSchedulerHeaderCell.GetType: TcxSchedulerReportItemsType; +begin + Result := srHeader; +end; + +{ TcxSchedulerReportDateNavigatorItem } + +constructor TcxSchedulerReportDateNavigatorItem.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + CellSides := []; +end; + +function TcxSchedulerReportDateNavigatorItem.GetDefaultDTFormat: DWORD; +begin + Result := DXTO_PATTERNEDTEXT or DXTO_SINGLELINE; +end; + +procedure TcxSchedulerReportDateNavigatorItem.SetText(const Value: string); +begin +end; + +function TcxSchedulerReportDateNavigatorItem.GetDateNavigator: TcxSchedulerReportDateNavigatorCell; +begin + Result := Parent as TcxSchedulerReportDateNavigatorCell; +end; + +{ TcxSchedulerReportDateNavigatorHeader } + +constructor TcxSchedulerReportDateNavigatorHeader.CreateEx(AParent: TdxReportCell; AYear, AMonth: Word); +begin + Create(AParent); + Transparent := False; + TextAlignX := taCenterX; + Data := cdidSchedulerDateNavigatorHeader; + FMonth := AMonth; + FYear := AYear; +end; + +procedure TcxSchedulerReportDateNavigatorHeader.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportDateNavigatorHeader then + with TcxSchedulerReportDateNavigatorHeader(Source) do + begin + Self.FMonth := Month; + Self.FYear := Year; + end; + inherited Assign(Source); +end; + +function TcxSchedulerReportDateNavigatorHeader.GetText: string; +begin + Result := LongMonthNames[Month] + ' ' + IntToStr(Year); +end; + +procedure TcxSchedulerReportDateNavigatorHeader.ReadData( + AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FMonth := AReader.ReadInteger; + FYear := AReader.ReadInteger; +end; + +procedure TcxSchedulerReportDateNavigatorHeader.WriteData( + AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteInteger(FMonth); + AWriter.WriteInteger(FYear); +end; + +{ TcxSchedulerReportDateNavigatorDay } + +constructor TcxSchedulerReportDateNavigatorDay.CreateEx(AParent: TdxReportCell; + ADay, ACol, ARow: Integer; ABold: Boolean); +begin + Create(AParent); + RightIndent := 2; + TextAlignX := taRight; + TextAlignY := taCenterY; + Data := cdidSchedulerDateNavigatorDay; + FDay := ADay; + FCol := ACol; + FRow := ARow; + Bold := ABold; +end; + +procedure TcxSchedulerReportDateNavigatorDay.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerReportDateNavigatorDay then + with TcxSchedulerReportDateNavigatorDay(Source) do + begin + Self.FDay := Day; + Self.FCol := Col; + Self.FRow := Row; + end; +end; + +function TcxSchedulerReportDateNavigatorDay.GetText: string; +begin + Result := IntToStr(Day); +end; + +procedure TcxSchedulerReportDateNavigatorDay.ReadData(AReader: TdxPSDataReader); +var + Value: Integer; +begin + inherited ReadData(AReader); + Value := AReader.ReadInteger; + FDay := TLongRec(Value).Bytes[0]; + FCol := TLongRec(Value).Bytes[1]; + FRow := TLongRec(Value).Bytes[2]; +end; + +procedure TcxSchedulerReportDateNavigatorDay.WriteData(AWriter: TdxPSDataWriter); +var + Value: Integer; +begin + inherited WriteData(AWriter); + TLongRec(Value).Bytes[0] := Day; + TLongRec(Value).Bytes[1] := Col; + TLongRec(Value).Bytes[2] := Row; + AWriter.WriteInteger(Value); +end; + +function TcxSchedulerReportDateNavigatorDay.GetDate: TDate; +begin + Result := EncodeDate(Year, Month, Day); +end; + +function TcxSchedulerReportDateNavigatorDay.GetBold: Boolean; +begin + Result := GetFormatBit(dxFormatDayIsBold); +end; + +function TcxSchedulerReportDateNavigatorDay.GetMonth: Word; +begin + if DateNavigator <> nil then + Result := DateNavigator.Month + else + Result := 1; +end; + +function TcxSchedulerReportDateNavigatorDay.GetYear: Word; +begin + if DateNavigator <> nil then + Result := DateNavigator.Year + else + Result := 1; +end; + +procedure TcxSchedulerReportDateNavigatorDay.SetBold(Value: Boolean); +begin + SetFormatBit(dxFormatDayIsBold, Value); +end; + +{ TcxSchedulerReportDateNavigatorDayCaption } + +constructor TcxSchedulerReportDateNavigatorDayCaption.CreateEx(AParent: TdxReportCell; + ADayOfWeek: TDay; ACol: Integer); +begin + inherited Create(AParent); + RightIndent := 2; + TextAlignX := taRight; + TextAlignY := taCenterY; + Data := cdidSchedulerDateNavigatorDayCaption; + FCol := ACol; + FDayOfWeek := ADayOfWeek; + FDayText := GetDayText; +end; + +procedure TcxSchedulerReportDateNavigatorDayCaption.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerReportDateNavigatorDayCaption then + with TcxSchedulerReportDateNavigatorDayCaption(Source) do + begin + Self.FDayOfWeek := DayOfWeek; + Self.FCol := Col; + Self.FDayText := FDayText; + end; +end; + +function TcxSchedulerReportDateNavigatorDayCaption.GetText: string; +begin + Result := FDayText; +end; + +function TcxSchedulerReportDateNavigatorDayCaption.GetDayText: string; +var + FDayIndex: Integer; +begin + FDayIndex := Byte(DateNavigator.StartOfWeek) + 1 + Col; + if FDayIndex > 7 then Dec(FDayIndex, 7); + + if Font.Charset in [ARABIC_CHARSET, CHINESEBIG5_CHARSET, GB2312_CHARSET] then + Result := AnsiLastChar(ShortDayNames[FDayIndex]) + else + Result := WideString(ShortDayNames[FDayIndex])[1]; +end; + +procedure TcxSchedulerReportDateNavigatorDayCaption.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FDayText := AReader.ReadString; +end; + +procedure TcxSchedulerReportDateNavigatorDayCaption.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteString(FDayText); +end; + +{ TcxSchedulerReportDateNavigatorWeekNumber } + +constructor TcxSchedulerReportDateNavigatorWeekNumber.CreateEx(AParent: TdxReportCell; + AWeekNumber, ARow: Integer); +begin + Create(AParent); + RightIndent := 4; + TextAlignX := taRight; + TextAlignY := taCenterY; + Data := cdidSchedulerDateNavigatorWeekNumber; + FRow := ARow; + FWeekNumber := AWeekNumber; +end; + +procedure TcxSchedulerReportDateNavigatorWeekNumber.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxSchedulerReportDateNavigatorWeekNumber then + with TcxSchedulerReportDateNavigatorWeekNumber(Source) do + begin + Self.FWeekNumber := WeekNumber; + Self.FRow := Row; + end; +end; + +function TcxSchedulerReportDateNavigatorWeekNumber.GetText: string; +begin + Result := IntToStr(WeekNumber); +end; + +procedure TcxSchedulerReportDateNavigatorWeekNumber.ReadData(AReader: TdxPSDataReader); +var + Value: Integer; +begin + inherited ReadData(AReader); + Value := AReader.ReadInteger; + FWeekNumber := TLongRec(Value).Bytes[0]; + FRow := TLongRec(Value).Bytes[1]; +end; + +procedure TcxSchedulerReportDateNavigatorWeekNumber.WriteData(AWriter: TdxPSDataWriter); +var + Value: Integer; +begin + inherited WriteData(AWriter); + TLongRec(Value).Bytes[0] := WeekNumber; + TLongRec(Value).Bytes[1] := Row; + AWriter.WriteInteger(Value); +end; + +{ TcxSchedulerReportDateNavigatorCell } + +constructor TcxSchedulerReportDateNavigatorCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + CellSides := []; + Transparent := False; + FStartOfWeek := TDay(DateTimeHelper.StartOfWeek); +end; + +constructor TcxSchedulerReportDateNavigatorCell.CreateEx(AParent: TdxReportCell; + AFirstWeekOfYear: TcxFirstWeekOfYear; AYear, AMonth: Word; + AShowDatesContainingEventsInBold, AShowWeekNumbers: Boolean); +begin + Create(AParent); + FYear := AYear; + FMonth := AMonth; + FVertOffset := -1; + FFirstWeekOfYear := AFirstWeekOfYear; + FShowWeekNumbers := AShowWeekNumbers; + FShowDatesContainingEventsInBold := AShowDatesContainingEventsInBold; +end; + +procedure TcxSchedulerReportDateNavigatorCell.AdjustSize(var AContentParams, + AHeaderParams: TdxReportItemViewParams; AHeight, AMaxHeight: Integer); + + function TestSize: Boolean; + var + ATestHeight: Integer; + begin + ATestHeight := GetMonthSize(AContentParams, AHeaderParams).cy; + if AMaxHeight > (ATestHeight + RowHeight) then + begin + FVertOffset := (AMaxHeight - ATestHeight) div 2; + Result := True; + end + else + Result := False; + end; + +begin + if TestSize then Exit; + AContentParams.FontSize := Abs(AContentParams.NativeParams.Font.Size); + AHeaderParams.FontSize := Abs(AHeaderParams.NativeParams.Font.Size); + repeat + if AContentParams.FontSize > AHeaderParams.FontSize then + Dec(AContentParams.FontSize) + else + if AContentParams.FontSize < AHeaderParams.FontSize then + Dec(AHeaderParams.FontSize) + else + begin + Dec(AContentParams.FontSize); + Dec(AHeaderParams.FontSize); + end; + until TestSize; +end; + +function TcxSchedulerReportDateNavigatorCell.CalculateSize( + const AContentParams, AHeaderParams: TdxReportItemViewParams): TSize; +begin + FMonthSize := GetMonthSize(AContentParams, AHeaderParams); + Result := FMonthSize; + Inc(Result.cy, 2 * RowHeight); + CreateItems; + AdjustItemsVertical; + SetViewParams(AContentParams, AHeaderParams); +end; + +class function TcxSchedulerReportDateNavigatorCell.MeasureDateNavigatorHeight( + const AContentParams, AHeaderParams: TcxViewParams): Integer; +var + AColWidth, ARowHeight, ADayCaptionsHeight, AHeaderHeight: Integer; +begin + GetContentPartSizes(AContentParams.Font, AColWidth, ARowHeight, ADayCaptionsHeight); + GetHeaderPartSizes(AHeaderParams.Font, AHeaderHeight); + Result := GetMonthHeight(AHeaderHeight, ADayCaptionsHeight, ARowHeight) + 2 * ARowHeight; +end; + +procedure TcxSchedulerReportDateNavigatorCell.AdjustItemsVertical; +var + I: Integer; +begin + if FVertOffset < 0 then FVertOffset := RowHeight; + for I := 0 to DataItemCount - 1 do + with DataItems[I] do Top := Top + FVertOffset; +end; + +function TcxSchedulerReportDateNavigatorCell.ColOfDate(ADate: TDateTime): Integer; +begin + Result := DayOfWeek(ADate) - Byte(StartOfWeek) - 1; + if Result < 0 then Inc(Result, 7); +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateDayCaptions; +var + R: TRect; + I, ADayOfWeek: Integer; + ACaption: TcxSchedulerReportDateNavigatorDayCaption; +begin + R.Top := HeaderHeight; + R.Bottom := R.Top + DayCaptionsHeight - 2; + R.Right := ColWidth; + FDayCaptionCount := 7; + for I := 0 to FDayCaptionCount - 1 do + begin + ADayOfWeek := I + Byte(StartOfWeek); + if ADayOfWeek > 6 then Dec(ADayOfWeek, 7); + ACaption := TcxSchedulerReportDateNavigatorDayCaption.CreateEx(Self, TDay(ADayOfWeek), I); + with ACaption do + begin + R.Left := R.Right; + R.Right := R.Left + ColWidth; + BoundsRect := R; + end; + end; +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateDay(const ABounds: TRect; + ADate: TDateTime; ACol, ARow: Integer); +var + ADay: TcxSchedulerReportDateNavigatorDay; +begin + ADay := TcxSchedulerReportDateNavigatorDay.CreateEx(Self, DayOf(ADate), + ACol, ARow, GetDayIsBold(ADate)); + ADay.BoundsRect := ABounds; +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateItems; +begin + CreateMonthHeader; + CreateDayCaptions; + CreateMonth; + CreateLines; +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateLines; +var + R: TRect; +begin + R := GetHeaderBounds; + R.Top := R.Bottom + DayCaptionsHeight; + R.Bottom := R.Top + WeekNumberCount * RowHeight; + with TdxReportCellBox.Create(Self) do + begin + if ShowWeekNumbers then CellSides := [csTop, csLeft] else CellSides := [csTop]; + BoundsRect := R; + end; +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateMonth; +var + R: TRect; + I, J, ADayBase, ADaysPerMonth: Integer; + ADate, ADateBase: TDateTime; + AHasDate: Boolean; + + function GetDate(out ADate: TDateTime): Boolean; + begin + ADate := ADateBase + ADayBase + J * 7 + I; + Result := (ADate > ADateBase) and (ADate <= ADateBase + ADaysPerMonth); + end; + +begin + FDayCount := 0; + FWeekNumberCount := 0; + ADateBase := EncodeDate(FYear, FMonth, 1) - 1; + ADayBase := 1 - ColOfDate(ADateBase + 1); + ADaysPerMonth := DaysPerMonth(FYear, FMonth); + //loop has been split into two loops for the correct order of the DataItems + for I := 0 to 6 do + for J := 0 to 5 do + if GetDate(ADate) then + begin + CreateDay(GetDayBoundsFromColAndRow(I, J), ADate, I, J); + Inc(FDayCount); + end; + for I := 0 to 6 do + for J := 0 to 5 do + begin + AHasDate := GetDate(ADate); + if ShowWeekNumbers and (I = 0) and not ((J = 5) and not AHasDate) then + begin + R := cxRectOffset(GetDayBoundsFromColAndRow(I, J), -ColWidth, 0); + Dec(R.Right, ColWidth div 8); + CreateWeekNumber(R, ADate, J); + Inc(FWeekNumberCount); + end; + end; +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateMonthHeader; +begin + TcxSchedulerReportDateNavigatorHeader.CreateEx(Self, Year, Month).BoundsRect := GetHeaderBounds; +end; + +procedure TcxSchedulerReportDateNavigatorCell.CreateWeekNumber( + const ABounds: TRect; ADate: TDateTime; ARow: Integer); +var + AWeekNumber: TcxSchedulerReportDateNavigatorWeekNumber; +begin + AWeekNumber := TcxSchedulerReportDateNavigatorWeekNumber.CreateEx(Self, + cxDateUtils.GetWeekNumber(ADate, StartOfWeek, FirstWeekOfYear), ARow); + AWeekNumber.BoundsRect := ABounds; +end; + +class procedure TcxSchedulerReportDateNavigatorCell.GetContentPartSizes( + AFont: TFont; var AColWidth, ARowHeight, ADayCaptionsHeight: Integer; + AFontSize: Integer = 0); +var + ASymbolSize: TSize; +begin + ASymbolSize := cxTextExtent(AFont, '0', AFontSize); + AColWidth := 3 * ASymbolSize.cx; + ADayCaptionsHeight := ASymbolSize.cy + 1; + ARowHeight := ASymbolSize.cy; +end; + +function TcxSchedulerReportDateNavigatorCell.GetDayBoundsFromColAndRow( + ACol, ARow: Integer): TRect; +begin + with Result do + begin + Left := Succ(ACol) * ColWidth; + Top := HeaderHeight + DayCaptionsHeight + ARow * RowHeight; + Right := Left + ColWidth; + Bottom := Top + RowHeight; + end; +end; + +function TcxSchedulerReportDateNavigatorCell.GetDayIsBold( + ADate: TDateTime): Boolean; +begin + Result := FBoldedDays.IndexOf(ADate) <> -1; +end; + +function TcxSchedulerReportDateNavigatorCell.GetHeaderBounds: TRect; +begin + Result := cxRect(ColWidth, 0, MonthSize.cx - MulDiv(ColWidth, 2, 3), HeaderHeight); +end; + +class procedure TcxSchedulerReportDateNavigatorCell.GetHeaderPartSizes( + AFont: TFont; var AHeaderHeight: Integer; AFontSize: Integer = 0); +begin + AHeaderHeight := MulDiv(cxTextHeight(AFont, 'Wg', AFontSize), 3 , 2); +end; + +function TcxSchedulerReportDateNavigatorCell.GetMonthSize( + const AContentParams, AHeaderParams: TdxReportItemViewParams): TSize; +begin + GetContentPartSizes(AContentParams.NativeParams.Font, FColWidth, FRowHeight, + FDayCaptionsHeight, AContentParams.FontSize); + GetHeaderPartSizes(AHeaderParams.NativeParams.Font, FHeaderHeight, + AHeaderParams.FontSize); + Result.cx := 9 * FColWidth; + Result.cy := FHeaderHeight + FDayCaptionsHeight + 6 * FRowHeight + 1; +end; + +function TcxSchedulerReportDateNavigatorCell.GetType: TcxSchedulerReportItemsType; +begin + Result := srDateNavigator; +end; + +procedure TcxSchedulerReportDateNavigatorCell.SetViewParams( + const AContentParams, AHeaderParams: TdxReportItemViewParams); +var + I: Integer; + AParams: TdxReportItemViewParams; +begin + FContentParams := AContentParams; + FHeaderParams := AHeaderParams; + SetCellViewParams(Self, AContentParams); + SetCellViewParams(Header, AHeaderParams); + for I := 0 to DayCount - 1 do + begin + AParams := AContentParams; + if Days[I].Bold then + Include(AParams.FontStyle, fsBold); + SetCellViewParams(Days[I], AParams); + end; + for I := 0 to DayCaptionCount - 1 do + SetCellViewParams(DayCaptions[I], AContentParams); + AParams := AContentParams; + if AParams.FontSize <> 0 then + AParams.FontSize := MulDiv(AParams.FontSize, 2, 3) + else + AParams.FontSize := MulDiv(AParams.NativeParams.Font.Size, 2, 3); + for I := 0 to WeekNumberCount - 1 do + SetCellViewParams(WeekNumbers[I], AParams); +end; + +procedure TcxSchedulerReportDateNavigatorCell.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + AReader.Read(FFirstWeekOfYear, SizeOf(FFirstWeekOfYear)); + FMonth := AReader.ReadInteger; + FYear := AReader.ReadInteger; + FShowDatesContainingEventsInBold := AReader.ReadBoolean; + FShowWeekNumbers := AReader.ReadBoolean; +end; + +procedure TcxSchedulerReportDateNavigatorCell.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.Write(FFirstWeekOfYear, SizeOf(FFirstWeekOfYear)); + AWriter.WriteInteger(FMonth); + AWriter.WriteInteger(FYear); + AWriter.WriteBoolean(FShowDatesContainingEventsInBold); + AWriter.WriteBoolean(FShowWeekNumbers); +end; + +class function TcxSchedulerReportDateNavigatorCell.GetMonthHeight( + AHeaderHeight, ADayCaptionsHeight, ARowHeight: Integer): Integer; +begin + Result := (AHeaderHeight + ADayCaptionsHeight + 6 * ARowHeight); +end; + +function TcxSchedulerReportDateNavigatorCell.GetDay( + Index: Integer): TcxSchedulerReportDateNavigatorDay; +begin + Result := DataItems[Index + 1 + 7] as TcxSchedulerReportDateNavigatorDay; +end; + +function TcxSchedulerReportDateNavigatorCell.GetDayCaption( + Index: Integer): TcxSchedulerReportDateNavigatorDayCaption; +begin + Result := DataItems[Index + 1] as TcxSchedulerReportDateNavigatorDayCaption; +end; + +function TcxSchedulerReportDateNavigatorCell.GetHeader: TcxSchedulerReportDateNavigatorHeader; +begin + Result := DataItems[0] as TcxSchedulerReportDateNavigatorHeader; +end; + +function TcxSchedulerReportDateNavigatorCell.GetWeekNumber( + Index: Integer): TcxSchedulerReportDateNavigatorWeekNumber; +begin + Result := DataItems[Index + 1 + 7 + FDayCount] as TcxSchedulerReportDateNavigatorWeekNumber; +end; + +{ TcxSchedulerReportSchedulingAreaCell } + +constructor TcxSchedulerReportSchedulingAreaCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + FVisibleDays := TcxSchedulerDateList.Create; + FDaysList := TStringList.Create; + CellSides := [csLeft, csTop]; +end; + +destructor TcxSchedulerReportSchedulingAreaCell.Destroy; +begin + FDaysList.Free; + FVisibleDays.Free; + inherited Destroy; +end; + +procedure TcxSchedulerReportSchedulingAreaCell.DrawContent( + DC: HDC; DrawRect: TRect; const OriginRect: TRect; AStage: TdxPSRenderStages); +begin + inherited DrawContent(DC, DrawRect, OriginRect, AStage); + if rsFirstPass in AStage then + DrawBorders(DC); +end; + +procedure TcxSchedulerReportSchedulingAreaCell.DrawItself( + DC: HDC; AStage: TdxPSRenderStages); +begin + if rsFirstPass in AStage then + begin + if IsBackgroundBitmapDrawn then + DrawBackgroundBitmap(DC) + else + if IsBackgroundDrawn then + DrawBackground(DC); + end; +end; + +function TcxSchedulerReportSchedulingAreaCell.GetType: TcxSchedulerReportItemsType; +begin + Result := srSchedulingArea; +end; + +{ TcxSchedulerReportCustomCell } + +constructor TcxSchedulerReportCustomCell.CreateFrom(AParent: TdxReportCell; + AViewInfo: TcxSchedulerCustomViewInfoItem); +begin + inherited Create(AParent); + Transparent := False; + BoundsRect := AViewInfo.Bounds; + CellSides := TdxCellSides(AViewInfo.Borders); +end; + +procedure TcxSchedulerReportCustomCell.DrawContent(DC: HDC; AStage: TdxPSRenderStages); +begin + inherited; + //Renderer.ExcludeClipRect(GetFixupRect(DC, BoundsRect)); +end; + +class procedure TcxSchedulerReportCustomCell.RegisterMirrorClass; +begin + MirrorClasses.Add(Self); +end; + +class function TcxSchedulerReportCustomCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := nil; +end; + +procedure TcxSchedulerReportCustomCell.SuppressColoration; +begin + FDayBorderColor := clBlack; + Color := dxPSCore.dxDefaultContentColor; +end; + +procedure TcxSchedulerReportCustomCell.DrawCellFrame(DC: HDC; const ARect: TRect; + ABorders: TcxBorders = []; ABorderColor: TColor = clDefault; ALineWidth: Integer = 1); +begin + Renderer.FrameRect(DC, GetFixupRect(DC, ARect), + ABorderColor, TdxCellSides(ABorders), ALineWidth); +end; + +procedure TcxSchedulerReportCustomCell.DrawCellRect(DC: HDC; const ARect: TRect; + ABorders: TcxBorders = []; ABorderColor: TColor = clDefault; ALineWidth: Integer = 1; + AColor: TColor = clDefault); +var + R: TRect; +begin + if Transparent then + DrawCellFrame(DC, ARect, ABorders, ABorderColor, ALineWidth) + else + begin + R := GetFixupRect(DC, ARect); + if AColor = clDefault then + AColor := Color; + Renderer.FillRect(DC, R, AColor); + Renderer.FrameRect(DC, R, ABorderColor, TdxCellSides(ABorders), ALineWidth); + end; +end; + +procedure TcxSchedulerReportCustomCell.DrawCellText(DC: HDC; const ARect: TRect; + const AText: string; AlignHorz: TdxTextAlignX; AlignVert: TdxTextAlignY; + AFont: TFont = nil; AColor: TColor = clDefault); +const + Horz: array[TdxTextAlignX] of Integer = + (DXTO_LEFT, DXTO_CENTER_HORIZONTALLY, DXTO_RIGHT, DXTO_LEFT, DXTO_LEFT); + Vert: array[TdxTextAlignY] of Integer = + (DXTO_TOP, DXTO_CENTER_VERTICALLY, DXTO_BOTTOM, DXTO_TOP); +var + R: TRect; + AMode: Integer; + Flags: Integer; +begin + if Length(AText) = 0 then Exit; + R := GetFixupRect(DC, ARect); + Flags := DXTO_PREVENT_LEFT_EXCEED or DXTO_PREVENT_TOP_EXCEED or DXTO_NOCLIP or + Horz[AlignHorz] or Vert[AlignVert] + DXTO_SINGLELINE; + if AFont = nil then + AFont := Font; + AMode := SetBkMode(DC, Windows.TRANSPARENT); + Renderer.DrawTextEx(DC, R, -1, cxTextOffset, + cxTextOffset, AText, AFont, Flags); + SetBkMode(DC, AMode); +end; + +procedure TcxSchedulerReportCustomCell.DrawCellTextVert(DC: HDC; const ARect: TRect; + const AText: string); + + function CreateRotatedFont: HFONT; + var + ALogFont: TLogFont; + begin + FillChar(ALogFont, SizeOf(ALogFont), 0); + with ALogFont do + begin + lfHeight := Font.Height; + lfEscapement := 900; + if fsBold in Font.Style then + lfWeight := FW_BOLD + else + lfWeight := FW_NORMAL; + lfItalic := Byte(fsItalic in Font.Style); + lfUnderline := Byte(fsUnderline in Font.Style); + lfStrikeOut := Byte(fsStrikeOut in Font.Style); + lfCharSet := Byte(Font.Charset); + StrPCopy(lfFaceName, Font.Name); + case Font.Pitch of + fpVariable: lfPitchAndFamily := VARIABLE_PITCH; + fpFixed: lfPitchAndFamily := FIXED_PITCH; + else + lfPitchAndFamily := DEFAULT_PITCH; + end; + end; + Result := CreateFontIndirect(ALogFont); + end; + +var + R: TRect; + AFont: THandle; + ASavedDC: Integer; + ASize: TSize; +begin + if Length(AText) = 0 then Exit; + ASavedDC := SaveDC(DC); + AFont := CreateRotatedFont; + SelectObject(DC, AFont); + SetTextAlign(DC, TA_LEFT or TA_TOP or TA_NOUPDATECP); + GetTextExtentPoint(DC, PChar(AText), Length(AText), ASize); + R.Bottom := ARect.Bottom - ((ARect.Bottom - ARect.Top - ASize.cx) div 2); + R.Top := R.Bottom - ASize.cx; + R.Left := ARect.Left + ((ARect.Right - ARect.Left - ASize.cy) div 2); + R.Right := R.Left + ASize.cy; + if R.Left < ARect.Left then R := cxRectOffset(R, ARect.Left - R.Left, 0); + if R.Top < ARect.Top then R := cxRectOffset(R, 0, ARect.Top - R.Top); + R := GetFixupRect(DC, R); + TextOut(DC, R.Left, R.Bottom, PChar(AText), Length(AText)); + RestoreDC(DC, ASavedDC); + DeleteObject(AFont); +end; + +procedure TcxSchedulerReportCustomCell.DrawCellState(DC: HDC; R: TRect; + AState: Integer; ABorders: TcxBorders = []; ABorderColor: TColor = clBlack); +var + ABrushHandle: HBrush; + APenHandle: HPen; + Points: array[0..2] of TPoint; +begin + FixupRect(DC, R); + if R.Top = R.Bottom then + begin + R := ExcludeBorders(R, ABorders); + ABrushHandle := SelectObject(DC, StateBrushes[AState].Handle); + APenHandle := SelectObject(DC, GetStockObject(BLACK_PEN)); + Points[0] := Point(R.Left, R.Top); + Points[1] := Point(R.Right, R.Top); + Points[2] := Point(R.Right, R.Top + R.Right - R.Left); + Windows.Polygon(DC, Points, 3); + SelectObject(DC, APenHandle); + SelectObject(DC, ABrushHandle); + end + else + begin + DrawCellFrame(DC, R, ABorders, ABorderColor, 1); + FillRect(DC, ExcludeBorders(R, ABorders), StateBrushes[AState].Handle); + end; +end; + +function TcxSchedulerReportCustomCell.ExcludeBorders(const ARect: TRect; + ABorders: TcxBorders; ABorderWidth: Integer = 1): TRect; +begin + Result := ARect; + with Result do + begin + if bLeft in ABorders then + Inc(Left, ABorderWidth * LineThickness); + if bRight in ABorders then + Dec(Right, ABorderWidth * LineThickness); + if bTop in ABorders then + Inc(Top, ABorderWidth * LineThickness); + if bBottom in ABorders then + Dec(Bottom, ABorderWidth * LineThickness); + end; +end; + +function TcxSchedulerReportCustomCell.FixupWidth(AWidth: Integer): Integer; +begin + if not Renderer.IsPrinting then + Result := MulDiv(AWidth * Renderer.UnitsPerPixel, Renderer.ZoomFactor, 100) + else + Result := MulDiv(AWidth * Renderer.UnitsPerPixel, Renderer.PPI * 5, 72 * 7); +end; + +function TcxSchedulerReportCustomCell.GetFixupRect(DC: HDC; const ARect: TRect): TRect; +begin + Result := ARect; + FixupRect(DC, Result); +end; + +function TcxSchedulerReportCustomCell.InflateRect(const ARect: TRect; dX, dY: Integer): TRect; +begin + Result := ARect; +end; + +function TcxSchedulerReportCustomCell.TextRect(const ARect: TRect): TRect; +var + L: Integer; +begin + L := FixupWidth(cxTextOffset); + Result := ARect; + InflateRect(Result, -L, -L); +end; + +function TcxSchedulerReportCustomCell.GetReportLink: TcxSchedulerReportLink; +begin + Result := TcxSchedulerReportLink(Renderer.ReportLink); +end; + +{ TcxSchedulerReportContentCell } + +constructor TcxSchedulerReportContentCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); +var + R: TRect; +begin + inherited CreateFrom(AParent, AViewInfo); + Data := cdidSchedulerContent; + if AViewInfo is TcxSchedulerContentCellViewInfo then + with TcxSchedulerContentCellViewInfo(AViewInfo) do + begin + R := Bounds; + //Self.FDontPrint := DontPrint; + Self.BoundsRect := R; + Self.FBorderColor := BorderColor; + Self.FShowTimeLine := ShowTimeLine; + Self.FTimeLineBorders := TimeLineBorders; + if TimeEvent <> nil then + Self.FState := TimeEvent.Event.State + else + Self.FState := -1; + if ShowTimeLine then + begin + CellSideColors[csRight] := clBlack; + CellSideColors[csbottom] := FBorderColor; + end; + CellSides := csAll; + end; +end; + +procedure TcxSchedulerReportContentCell.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportContentCell then + with TcxSchedulerReportContentCell(Source) do + begin + Self.FBorderColor := FBorderColor; + Self.FShowTimeLine := FShowTimeLine; + Self.FState := FState; + Self.FTimeLineBorders := FTimeLineBorders; + end; + inherited Assign(Source); +end; + +procedure TcxSchedulerReportContentCell.DrawContent(DC: HDC; + AStage: TdxPSRenderStages); +var + R: TRect; +begin + inherited DrawContent(DC, AStage); + R := BoundsRect; + if FShowTimeLine then + begin + R.Right := R.Left + FixupWidth(cxTimeLineWidth); + if FState = -1 then + DrawCellRect(DC, R, FTimeLineBorders - [bLeft], clBlack, 1, clWhite) + else + DrawCellState(DC, R, FState, FTimeLineBorders, clBlack); + end +end; + +class function TcxSchedulerReportContentCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerContentCellViewInfo; +end; + +procedure TcxSchedulerReportContentCell.SuppressColoration; +var + I: TdxCellSide; +begin + for I := csLeft to csBottom do + CellSideColors[I] := clBlack; + FBorderColor := clBlack; + if FState <> -1 then + Inc(FState, 4); + inherited SuppressColoration; +end; + +function TcxSchedulerReportContentCell.HasBorderColoration: Boolean; +begin + Result := True; +end; + +{ TcxSchedulerReportHeaderItemCell } + +constructor TcxSchedulerReportHeaderItemCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); +begin + inherited CreateFrom(AParent, AViewInfo); + Data := cdidSchedulerHeader; + if AViewInfo is TcxSchedulerHeaderCellViewInfo then + with TcxSchedulerHeaderCellViewInfo(AViewInfo) do + begin + Self.TextAlignX := TextAlignXMap[AlignHorz]; + Self.TextAlignY := TextAlignYMap[AlignVert]; + Self.FRotateText := RotateText; + Self.FCaption := DisplayText; + Self.FIsResourceHeader := IsResourceHeader; + Self.FResourceID := ResourceID; + end; + CellSides := csAll; + ReportLink.RegisterLookAndFeelItem(Self, cesRaised); +end; + +procedure TcxSchedulerReportHeaderItemCell.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerReportHeaderItemCell then + with TcxSchedulerReportHeaderItemCell(Source) do + begin + Self.FCaption := FCaption; + Self.FDate := FDate; + Self.FResourceID := FResourceID; + Self.FRotateText := FRotateText; + end; + inherited Assign(Source); +end; + +procedure TcxSchedulerReportHeaderItemCell.DrawContent( + DC: HDC; AStage: TdxPSRenderStages); +begin + inherited DrawContent(DC, AStage); + if FRotateText then + DrawCellTextVert(DC, BoundsRect, FCaption) + else + DrawCellText(DC, BoundsRect, FCaption, TextAlignX, TextAlignY, Font); +end; + +class function TcxSchedulerReportHeaderItemCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerHeaderCellViewInfo; +end; + +procedure TcxSchedulerReportHeaderItemCell.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FRotateText := AReader.ReadBoolean; + FCaption := AReader.ReadString; +end; + +procedure TcxSchedulerReportHeaderItemCell.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteBoolean(FRotateText); + AWriter.WriteString(FCaption); +end; + +function TcxSchedulerReportHeaderItemCell.GetTextAlignX: TdxTextAlignX; +begin + Result := inherited TextAlignX; +end; + +function TcxSchedulerReportHeaderItemCell.GetTextAlignY: TdxTextAlignY; +begin + Result := inherited TextAlignY; +end; + +procedure TcxSchedulerReportHeaderItemCell.SetTextAlignX( + Value: TdxTextAlignX); +begin + inherited TextAlignX := Value; +end; + +procedure TcxSchedulerReportHeaderItemCell.SetTextAlignY( + Value: TdxTextAlignY); +begin + inherited TextAlignY := Value; +end; + +{ TcxSchedulerReportGroupSeparatorCell } + +constructor TcxSchedulerReportGroupSeparatorCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); +begin + inherited CreateFrom(AParent, AViewInfo); + CellSides := csAll; + ReportLink.RegisterLookAndFeelItem(Self, cesRaised); +end; + +class function TcxSchedulerReportGroupSeparatorCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerGroupSeparatorCellViewInfo; +end; + +{ TcxSchedulerReportContainerCell } + +class function TcxSchedulerReportContainerCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerContainerCellViewInfo; +end; + +{ TcxSchedulerReportBackgroundSlotCell } + +constructor TcxSchedulerReportBackgroundSlotCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); +begin + inherited CreateFrom(AParent, AViewInfo); + if AViewInfo is TcxSchedulerBackgroundSlotCellViewInfo then + with TcxSchedulerBackgroundSlotCellViewInfo(AViewInfo) do + Self.FDisplayText := DisplayText; +end; + +procedure TcxSchedulerReportBackgroundSlotCell.DrawContent( + DC: HDC; AStage: TdxPSRenderStages); +begin + DrawCellRect(DC, BoundsRect, TcxBorders(CellSides), clWindowText); + DrawCellText(DC, BoundsRect, DisplayText, taLeft, taTop); +end; + +class function TcxSchedulerReportBackgroundSlotCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerBackgroundSlotCellViewInfo; +end; + +procedure TcxSchedulerReportBackgroundSlotCell.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FDisplayText := AReader.ReadString; +end; + +procedure TcxSchedulerReportBackgroundSlotCell.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteString(FDisplayText); +end; + +{ TcxSchedulerReportDailyTimeRulerCellsSite } + +constructor TcxSchedulerReportDailyTimeRulerCellsSite.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + FLargeFont := TFont.Create; + FontIndex := ReportCells.ReportLink.AddFontToPool(Font); + CellSides := []; +end; + +destructor TcxSchedulerReportDailyTimeRulerCellsSite.Destroy; +begin + FLargeFont.Free; + inherited Destroy; +end; + +procedure TcxSchedulerReportDailyTimeRulerCellsSite.SetFontIndex(Index: Integer); +begin + inherited SetFontIndex(Index); + if Font <> nil then + begin + FLargeFont.Assign(Font); + FLargeFont.Size := Font.Size * 2; + FLargeFontIndex := ReportCells.ReportLink.AddFontToPool(FLargeFont); + end; +end; + +procedure TcxSchedulerReportDailyTimeRulerCellsSite.ReadProperties( + AReader: TdxPSDataReader); +begin + inherited ReadProperties(AReader); + FLargeFontIndex := AReader.ReadInteger; +end; + +procedure TcxSchedulerReportDailyTimeRulerCellsSite.WriteProperties( + AWriter: TdxPSDataWriter); +begin + inherited WriteProperties(AWriter); + AWriter.WriteInteger(FLargeFontIndex); +end; + +function TcxSchedulerReportDailyTimeRulerCellsSite.GetLargeFont: TFont; +begin + if (FLargeFontIndex <> -1) and (ReportCells <> nil) then + Result := ReportCells.GetFontByIndex(FLargeFontIndex) + else + Result := nil; +end; + +{ TcxSchedulerReportDailyTimeRulerCell } + +constructor TcxSchedulerReportDailyTimeRulerCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); +var + I: Boolean; +begin + inherited CreateFrom(AParent, AViewInfo); + CellSides := [csRight]; + Data := cdidSchedulerTimeRuler; + FLineColor := clBtnShadow; + TimeRulerSite.Width := Max(TimeRulerSite.Width, Width); + if AViewInfo is TcxSchedulerTimeRulerCellViewInfo then + with TcxSchedulerTimeRulerCellViewInfo(AViewInfo) do + begin + TimeRulerSite.Height := Max(TimeRulerSite.Height, ClipRect.Bottom); + Self.FHour := Hour; + Self.FHasAdditionalTimeZone := HasAdditionalTimeZone; + Self.FLineCount:= LineCount; + for I := False to True do + begin + Self.FBounds[I] := Bounds[I]; + Self.FDisplayTexts[I] := DisplayTexts[I]; + end; + end; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerReportDailyTimeRulerCell then + with TcxSchedulerReportDailyTimeRulerCell(Source) do + begin + Self.FHasAdditionalTimeZone := FHasAdditionalTimeZone; + Self.FLineCount := FLineCount; + Self.FBounds[False] := FBounds[False]; + Self.FBounds[True] := FBounds[True]; + Self.FDisplayTexts[False] := FDisplayTexts[False]; + Self.FDisplayTexts[True] := FDisplayTexts[True]; + Self.FHour := FHour; + end; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.DrawContent( + DC: HDC; AStage: TdxPSRenderStages); +var + I: Boolean; +const + ABorders: array[Boolean] of TcxBorders = ([bBottom], [bBottom, bRight]); +begin + if Index = 0 then + CellSides := CellSides + [csBottom]; + inherited; + CalculateDisplayInfo; + for I := not HasAdditionalTimeZone to True do + begin + if Hour >= 0 then + DrawTimeZone(DC, Bounds[I], DisplayTexts[I], I) + else + DrawTimeZoneLabel(DC, Bounds[I], DisplayTexts[I], ABorders[I]); + end; +end; + +class function TcxSchedulerReportDailyTimeRulerCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerTimeRulerCellViewInfo; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.SuppressColoration; +begin + inherited SuppressColoration; + FLineColor := clBlack; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.CalculateDisplayInfo; +begin + FBounds[True] := BoundsRect; + FBounds[False] := BoundsRect; + if HasAdditionalTimeZone then + begin + FBounds[True].Left := cxRectCenter(BoundsRect).X; + FBounds[False].Right := FBounds[True].Left; + end; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.DrawTimeZone(DC: HDC; + const ABounds: TRect; const AText: string; AIsCurrent: Boolean); +var + J, LH: Integer; + R, TextR: TRect; +begin + LH := cxRectHeight(BoundsRect) div LineCount; + R := BoundsRect; + Dec(R.Right, FixupWidth(6)); + if not IsLastItem then + DrawCellFrame(DC, R, [bBottom], FLineColor); + + R := cxRectSetHeight(ABounds, LH); + R.Left := (R.Left + R.Right) div 2 + FixupWidth(cxTextOffset * 2); + Dec(R.Right, FixupWidth(6)); + for J := 0 to LineCount - 2 do + begin + DrawCellFrame(DC, R, [bBottom], FLineColor, 1); + OffsetRect(R, 0, LH); + end; + TextR := cxRectInflate(ExcludeBorders(ABounds, + [bRight, bBottom]), -FixupWidth(5), -FixupWidth(cxTextOffset)); + + if LineCount > 1 then + begin + J := Length(AText); + DrawCellText(DC, Rect(TextR.Left, TextR.Top, R.Left - FixupWidth(cxTextOffset), TextR.Bottom), + Copy(AText, 1, J - 3), taRight, taTop, LargeFont, LargeFont.Color); + DrawCellText(DC, Rect(R.Left, TextR.Top, TextR.Right, TextR.Top + LH - FixupWidth(3)), + Copy(AText, J - 1, 2), taCenterX, taTop, Font); + end + else + DrawCellText(DC, TextR, AText, taRight, taCenterY, Font); + R.Left := ABounds.Left + FixupWidth(5); + if not IsLastItem then + begin + if Hour <> 23 then + DrawCellFrame(DC, R, [bBottom], FLineColor) + else + DrawCellFrame(DC, ABounds, [bBottom], FLineColor); + end; + if HasAdditionalTimeZone then + begin + R := GetInnerBounds(DC); + R.Left := (R.Left + R.Right) div 2; + R.Right := R.Left + LineThickness; + Renderer.FillRect(DC, R, clBlack); + end; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FHasAdditionalTimeZone := AReader.ReadBoolean; + FLineCount := AReader.ReadInteger; + FBounds[False] := AReader.ReadRect; + FBounds[True] := AReader.ReadRect; + FDisplayTexts[False] := AReader.ReadString; + FDisplayTexts[True] := AReader.ReadString; + FHour := AReader.ReadInteger; + FLineColor := AReader.ReadInteger; +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteBoolean(FHasAdditionalTimeZone); + AWriter.WriteInteger(FLineCount); + AWriter.WriteRect(FBounds[False]); + AWriter.WriteRect(FBounds[True]); + AWriter.WriteString(FDisplayTexts[False]); + AWriter.WriteString(FDisplayTexts[True]); + AWriter.WriteInteger(FHour); + AWriter.WriteInteger(FLineColor); +end; + +procedure TcxSchedulerReportDailyTimeRulerCell.DrawTimeZoneLabel(DC: HDC; + const ABounds: TRect; const AText: string; ABorders: TcxBorders); +begin + DrawCellText(DC, TextRect(ABounds), AText, taLeft, taBottom, Font, Font.Color); +end; + +function TcxSchedulerReportDailyTimeRulerCell.GetBoundsRect(AType: Boolean): TRect; +begin + Result := FBounds[AType]; +end; + +function TcxSchedulerReportDailyTimeRulerCell.GetDisplayText(AType: Boolean): string; +begin + Result := FDisplayTexts[AType]; +end; + +function TcxSchedulerReportDailyTimeRulerCell.GetLargeFont: TFont; +begin + Result := TimeRulerSite.LargeFont; +end; + +function TcxSchedulerReportDailyTimeRulerCell.GetTimeRulerSite: TcxSchedulerReportDailyTimeRulerCellsSite; +begin + Result := TcxSchedulerReportDailyTimeRulerCellsSite(Parent); +end; + +{ TcxSchedulerReportMonthDayCell } + +constructor TcxSchedulerReportMonthDayCell.CreateFrom( + AParent: TdxReportCell; AViewInfo: TcxSchedulerCustomViewInfoItem); +begin + inherited CreateFrom(AParent, AViewInfo); + if AViewInfo is TcxSchedulerMonthDayContentCellViewInfo then + begin + FDontPrint := TcxSchedulerMonthDayContentCellViewInfo(AViewInfo).DontPrint; + if FDontPrint then + begin + Transparent := True; + FDisplayText := ''; + end + else + FDisplayText := TcxSchedulerMonthDayContentCellViewInfo(AViewInfo).DisplayText; + end; +end; + +procedure TcxSchedulerReportMonthDayCell.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerReportMonthDayCell then + begin + FDontPrint := TcxSchedulerReportMonthDayCell(Source).FDontPrint; + FDisplayText := TcxSchedulerReportMonthDayCell(Source).FDisplayText; + end; +end; + +procedure TcxSchedulerReportMonthDayCell.DrawContent( + DC: HDC; AStage: TdxPSRenderStages); +var + R: TRect; +begin + inherited DrawContent(DC, AStage); + if FDontPrint then Exit; + if FDisplayText <> '' then + begin + R := ExcludeBorders(BoundsRect, TcxBorders(CellSides)); + DrawCellText(DC, R, FDisplayText, taRight, taTop); + end; +end; + +class function TcxSchedulerReportMonthDayCell.SchedulerCellClass: TcxSchedulerCustomViewInfoItemClass; +begin + Result := TcxSchedulerMonthDayContentCellViewInfo; +end; + +procedure TcxSchedulerReportMonthDayCell.ReadData(AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FDisplayText := AReader.ReadString; + FDontPrint := AReader.ReadBoolean; +end; + +procedure TcxSchedulerReportMonthDayCell.WriteData(AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteString(FDisplayText); + AWriter.WriteBoolean(FDontPrint); +end; + +{ TcxSchedulerReportTimeLinePart } + +constructor TcxSchedulerReportTimeLinePart.CreateEx(AParent: TdxReportCell; + ATriangle: Boolean; AState: Integer); +begin + inherited Create(AParent); + Transparent := False; + FTriangle := ATriangle; + FState := AState; + Data := cdidSchedulerEventTimeLine; +end; + +procedure TcxSchedulerReportTimeLinePart.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerReportTimeLinePart then + begin + FState := TcxSchedulerReportTimeLinePart(Source).FState; + FTriangle := TcxSchedulerReportTimeLinePart(Source).FTriangle; + end; +end; + +procedure TcxSchedulerReportTimeLinePart.DrawContent(DC: HDC; + AStage: TdxPSRenderStages); +var + R: TRect; + ABrushHandle: HBrush; + APenHandle: HPen; + Points: array[0..2] of TPoint; +begin + R := GetOuterBounds(DC); + if FTriangle then + begin + Renderer.FillRect(DC, R, clWhite); + ABrushHandle := SelectObject(DC, StateBrushes[FState].Handle); + APenHandle := SelectObject(DC, GetStockObject(NULL_PEN)); + Points[0] := R.TopLeft; + Points[1] := Point(R.Right, R.Top); + Points[2] := Point(R.Right, R.Top + R.Right - R.Left); + Windows.Polygon(DC, Points, 3); + SelectObject(DC, GetStockObject(BLACK_PEN)); + Windows.MoveToEx(DC, R.Left, R.Top, nil); + Windows.LineTo(DC, R.Right, R.Top + R.Right - R.Left); + SelectObject(DC, APenHandle); + SelectObject(DC, ABrushHandle); + end + else + Windows.FillRect(DC, R, StateBrushes[FState].Handle); + DrawBorders(DC); +end; + +procedure TcxSchedulerReportTimeLinePart.ReadData( + AReader: TdxPSDataReader); +begin + inherited ReadData(AReader); + FTriangle := AReader.ReadBoolean; + FState := AReader.ReadInteger; +end; + +procedure TcxSchedulerReportTimeLinePart.WriteData( + AWriter: TdxPSDataWriter); +begin + inherited WriteData(AWriter); + AWriter.WriteBoolean(FTriangle); + AWriter.WriteInteger(FState); +end; + +{ TcxSchedulerReportTimeLineCell } + +constructor TcxSchedulerReportTimeLineCell.Create(AParent: TdxReportCell); +begin + inherited Create(AParent); + Transparent := False; + Color := clWhite; +end; + +procedure TcxSchedulerReportTimeLineCell.SetTimeRect(const ABounds: TRect; AState: Integer); +var + ATriangle: Boolean; +begin + ATriangle := cxRectIsEmpty(ABounds); + FCurrentValue := TcxSchedulerReportTimeLinePart.CreateEx(Self, ATriangle, AState); + if ATriangle then + FCurrentValue.BoundsRect := BoundsRect + else + FCurrentValue.BoundsRect := ABounds; +end; + +{ TcxSchedulerReportCustomEventCell } + +function TcxSchedulerReportCustomEventCell.CreateStringCell( + const AText: string; AData: Integer = 0): TdxReportCellString; +begin + Result := TdxReportCellString.Create(Self); + Result.CellSides := []; + Result.Multiline := True; + Result.Text := AText; + Result.Data := AData; +end; + +procedure TcxSchedulerReportCustomEventCell.SetViewParams(const AViewParams: TcxViewParams); +var + I: Integer; +begin + ReportLink.SetCellViewParams(Self, AViewParams); + for I := 0 to DataItemCount - 1 do + ReportLink.SetCellViewParams(DataItems[I], AViewParams); +end; + +function TcxSchedulerReportCustomEventCell.GetPrintStyle: TcxCustomSchedulerReportLinkPrintStyle; +begin + Result := ReportLink.PrintStyles.ActiveStyle; +end; + +function TcxSchedulerReportCustomEventCell.GetReportLink: TcxSchedulerReportLink; +begin + Result := ReportCells.ReportLink as TcxSchedulerReportLink; +end; + +function TcxSchedulerReportCustomEventCell.GetSuppressColoration: Boolean; +begin + Result := ReportLink.OptionsFormatting.SuppressContentColoration; +end; + +{ TcxSchedulerReportEventCell } + +constructor TcxSchedulerReportEventCell.CreateFrom(AParent: TdxReportCell; + AEventViewInfo: TcxSchedulerEventCellViewInfo); +begin + inherited Create(AParent); + ClipChildren := True; + Transparent := False; + InitializeFromViewInfo(AEventViewInfo); + CreateDataItems; + SetViewParams(AEventViewInfo.ViewParams); + CalculateLayout; +end; + +procedure TcxSchedulerReportEventCell.AdjustItemsHeight; + + procedure CheckItem(AItem: TAbstractdxReportCellData); + var + R: TRect; + begin + if Assigned(AItem) then + begin + R := AItem.BoundsRect; + if HasMessage then + R.Bottom := MessageCell.Top + else + R.Bottom := ContentBounds.Bottom; + AItem.BoundsRect := R; + end; + end; + +begin + CheckItem(CaptionCell); + CheckItem(IconsCell); + CheckItem(StartCell); + CheckItem(FinishCell); +end; + +procedure TcxSchedulerReportEventCell.CalculateLayout; +var + DC: HDC; + W, H, ALeft, AHalfWidth: Integer; +begin + DC := GetDC(0); + try + FContentBounds := GetContentBounds(DC); + if Assigned(FTimeLineCell) then + CalculateTimeLine(DC); + if Assigned(IconsCell) then + begin + IconsCell.BoundsRect := GetIconsRect(DC); + ALeft := IconsCell.BoundsRect.Right; + end + else ALeft := 0; + if IsNeedCreateTimeCells then + begin + H := Renderer.CalcTextHeight(DC, '0', False, CaptionCell.Font); + W := Renderer.CalcTextWidth(DC, '00:00', CaptionCell.Font); + AHalfWidth := cxRectWidth(ContentBounds) div 2; + if W < AHalfWidth then + begin + StartCell.BoundsRect := cxRectBounds(ALeft, 0, W, H); + if W * 2 < AHalfWidth then + FinishCell.BoundsRect := cxRectBounds(StartCell.BoundsRect.Right, 0, W, H) + else + FreeAndNil(FFinishCell); + end + else + FreeAndNil(FStartCell); + end; + CaptionCell.BoundsRect := GetCaptionRect(DC); + if Assigned(MessageCell) then + begin + MessageCell.BoundsRect := GetMessageRect(DC); + MessageCell.AdjustContent(DC); + end; + AdjustItemsHeight; + finally + ReleaseDC(0, DC); + end; +end; + +procedure TcxSchedulerReportEventCell.CalculateTimeLine(DC: HDC); + + function GetTimeRectBrushIndex: Integer; + begin + Result := Event.State; + if SuppressColoration then + Inc(Result, 4); + end; + + function GetActualTimeRect: TRect; + begin + Result := GetRelativeRect(EventViewInfo.EventTimeRect); + if not cxRectIsEmpty(Result) then + Result := cxRectInflate(Result, 0, 1); + end; + +begin + if FTimeLineCell = nil then Exit; + FTimeLineCell.BoundsRect := GetTimeLineRect(DC); + FTimeLineCell.SetTimeRect(GetActualTimeRect, GetTimeRectBrushIndex); +end; + +function TcxSchedulerReportEventCell.CreateCaptionCell: TdxReportCellString; +begin + Result := AddDataItem(TdxReportCellString) as TdxReportCellString; + with Result do + begin + Text := EventViewInfo.Caption; + CellSides := []; + Multiline := FHasDetailInfo and not IsHeaderEvent; + if HasDetailInfo then TextAlignY := taTop; + if IsHeaderEvent then TextAlignX := taCenterX; + end; +end; + +procedure TcxSchedulerReportEventCell.CreateDataItems; +begin + if HasDetailInfo and not IsHeaderEvent then + FTimeLineCell := CreateTimeLineCell; + if HasIcons then + begin + FIconsCell := CreateIconCells; + FIconsCell.Data := cdidSchedulerEventIcons; + end; + if IsNeedCreateTimeCells then + begin + FStartCell := CreateTimeTextCell(EventViewInfo.StartText); + FStartCell.Data := cdidSchedulerEventStart; + FFinishCell := CreateTimeTextCell(EventViewInfo.FinishText); + FFinishCell.Data := cdidSchedulerEventFinish; + end; + FCaptionCell := CreateCaptionCell; + FCaptionCell.Data := cdidSchedulerEventCaption; + if HasMessage then + begin + CreateMessageCell(Event.Message, EventViewInfo.EventViewData.EditProperties, + EventViewInfo.ViewParams); + FMessageCell.Data := cdidSchedulerEventMessage; + end; +end; + +procedure TcxSchedulerReportEventCell.CreateMessageCell(AMessage: Variant; + AProperties: TcxCustomEditProperties; AViewParams: TcxViewParams); +var + AParams: TdxReportItemViewParams; +begin + if AProperties = nil then + FMessageCell := nil + else + begin + FMessageCell := AddDataItem(GetMessageClass(AProperties)); + FillChar(AViewParams, SizeOf(AViewParams), 0); + AParams.NativeParams := AViewParams; + dxPScxCommon.dxPSDataMaps.InitializeItem(FMessageCell, AProperties, AMessage, + PrintStyle, AParams); + if not SuppressColoration then + MessageCell.BorderColor := EventViewInfo.SeparatorColor; + FMessageCell.CellSides := [csTop]; + end; +end; + +function TcxSchedulerReportEventCell.CreateTimeTextCell( + const ATimeText: string): TdxReportCellString; +begin + Result := TdxReportCellString.Create(Self); + Result.Text := ATimeText; + Result.TextAlignX := taRight; + Result.CellSides := []; +end; + +function TcxSchedulerReportEventCell.CreateTimeLineCell: TcxSchedulerReportTimeLineCell; +begin + Result := TcxSchedulerReportTimeLineCell.Create(Self); +end; + +function TcxSchedulerReportEventCell.CreateIconCells: TdxReportCellString; +begin + Result := AddDataItem(TdxReportCellString) as TdxReportCellString; + with Result do + begin + CellSides := []; + if HasDetailInfo then TextAlignY := taTop; + FontIndex := Self.Parent.FontIndex; + Text := IconsString; + end; +end; + +function TcxSchedulerReportEventCell.GetCaptionRect(DC: HDC): TRect; +begin + Result := FContentBounds; + if Assigned(FinishCell) then + Result.Left := FinishCell.BoundsRect.Right + else + if Assigned(StartCell) then + Result.Left := StartCell.BoundsRect.Right + else + if HasIcons then + Result.Left := IconsCell.BoundsRect.Right; + if HasMessage then + begin + Result.Bottom := Result.Top + CaptionCell.MeasureFontHeight(DC); + Renderer.CalcTextRect(DC, CaptionCell.Text, Result, True, Font); + Result.Right := ContentBounds.Right; + CheckBounds(Result); + end; +end; + +function TcxSchedulerReportEventCell.GetContentBounds(DC: HDC): TRect; +begin + Result := GetRelativeRect(EventViewInfo.Bounds); + Dec(Result.Right); + Dec(Result.Bottom); +end; + +function TcxSchedulerReportEventCell.GetHasIcons: Boolean; +begin + Result := PrintStyle.SupportIcons and (Event.IsRecurring {or Event.Remainder}); +end; + +function TcxSchedulerReportEventCell.GetHasMessage: Boolean; +begin + Result := PrintStyle.SupportMessage and HasDetailInfo; +end; + +function TcxSchedulerReportEventCell.GetIconsRect(DC: HDC): TRect; +begin + Result := ContentBounds; + Renderer.CalcTextRect(DC, IconsString, Result, False, IconsCell.Font); + Result.Right := Result.Left + Renderer.CalcTextWidth(DC, IconsString, IconsCell.Font); + if not HasDetailInfo then Result.Bottom := ContentBounds.Bottom; + CheckBounds(Result); +end; + +function TcxSchedulerReportEventCell.GetIconsString: string; +const + //etNone, etPattern, etOccurrence, etException, etCustom + IconChars: array[TcxEventType] of Char = (' ', ' ', 'B', ' ', 'C'); +begin + Result := ''; + if not HasIcons then Exit; + with Event do + begin + //if Reminder then Result := 'A'; + if IsRecurring then Result := Result + IconChars[EventType]; + end; +end; + +function TcxSchedulerReportEventCell.GetMessageClass(AProperties: TcxCustomEditProperties): TdxReportCellDataClass; +begin + Result := dxPScxCommon.dxPSDataMaps.ItemClass(AProperties); +end; + +function TcxSchedulerReportEventCell.GetMessageRect(DC: HDC): TRect; +begin + Result := ContentBounds; + if HasIcons then + Result.Top := IconsCell.BoundsRect.Bottom; + if CaptionCell.BoundsRect.Bottom > Result.Top then + Result.Top := CaptionCell.BoundsRect.Bottom; +end; + +function TcxSchedulerReportEventCell.GetRelativeRect(const R: TRect): TRect; +begin + Result := cxRectOffset(R, cxPointInvert(BoundsRect.TopLeft)); +end; + +function TcxSchedulerReportEventCell.GetTimeLineRect(DC: HDC): TRect; +begin + Result := cxRect(0, 0, ContentBounds.Left, Height); +end; + +procedure TcxSchedulerReportEventCell.InitializeFromViewInfo( + AEventViewInfo: TcxSchedulerEventCellViewInfo); +begin + FEventViewInfo := AEventViewInfo; + FEditViewInfo := AEventViewInfo.EditViewInfo; + BoundsRect := AEventViewInfo.EventViewData.Bounds; //include timeline + CellSides := TdxCellSides(AEventViewInfo.Borders); + FIsHeaderEvent := Event.AllDayEvent or (Event.Duration > 1); + FHasDetailInfo := AEventViewInfo.IsDetailInfo; + FIsNeedCreateTimeCells := not (FIsHeaderEvent or FHasDetailInfo) and + AEventViewInfo.ShowStartTime; + FHasIcons := GetHasIcons; + FHasMessage := GetHasMessage and AEventViewInfo.ShowMessage; + FIconsString := GetIconsString; + FMessage := AEventViewInfo.Message; +end; + +procedure TcxSchedulerReportEventCell.SetViewParams(const AViewParams: TcxViewParams); +begin + inherited SetViewParams(AViewParams); + if HasIcons then + begin + SpecialSymbolFont.Size := AViewParams.Font.Size; + IconsCell.FontIndex := Renderer.ReportLink.AddFontToPool(SpecialSymbolFont); + end; +end; + +procedure TcxSchedulerReportEventCell.CheckBounds(var ABounds: TRect); +begin + cxRectIntersect(ABounds, ABounds, ContentBounds); +end; + +function TcxSchedulerReportEventCell.GetEvent: TcxSchedulerControlEvent; +begin + Result := EventViewInfo.Event; +end; + +{ TcxSchedulerReportDetailsEventCell } + +constructor TcxSchedulerReportDetailsEventCell.CreateEx(AParent: TdxReportCell; + AEvent: TcxSchedulerEvent; ADate: TDateTime; const AParams: TcxViewParams; + AContinued: Boolean = False); +begin + inherited Create(AParent); + CellSides := []; + FContinued := AContinued; + FDate := ADate; + FEvent := AEvent; + CreateDataItems; + SetViewParams(AParams); +end; + +procedure TcxSchedulerReportDetailsEventCell.CalculateLayout(AWidth, ATimeWidth: Integer); +var + DC: HDC; + ATop: Integer; +begin + FCaptionCell.BoundsRect := MakeRect(ATimeWidth, 0, AWidth, 0); + DC := GetDC(0); + try + FLineHeight := FCaptionCell.MeasureFontHeight(DC); + FStartCell.BoundsRect := MakeRect(0, 0, ATimeWidth, FLineHeight); + ATop := FCaptionCell.MeasureContentHeight(DC); + FCaptionCell.Height := ATop; + FMessageCell.BoundsRect := MakeRect(ATimeWidth, ATop, AWidth, ATop); + ATop := FMessageCell.MeasureContentHeight(DC); + FMessageCell.Height := Max(ATop, FLineHeight); + finally + ReleaseDC(0, DC); + end; +end; + +function TcxSchedulerReportDetailsEventCell.CalculateHeight: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to DataItemCount - 1 do + with DataItems[I] do + if Visible then Result := Max(Result, BoundsRect.Bottom); +end; + +procedure TcxSchedulerReportDetailsEventCell.CreateCaptionCell; +begin + FCaptionCell := CreateStringCell(GetCaptionCellText, + cdidSchedulerEventCaption); +end; + +procedure TcxSchedulerReportDetailsEventCell.CreateDataItems; +begin + CreateCaptionCell; + CreateTimeCell; + CreateMessageCell; +end; + +procedure TcxSchedulerReportDetailsEventCell.CreateMessageCell; +begin + FMessageCell := CreateStringCell(GetMessageCellText, cdidSchedulerEventMessage); +end; + +procedure TcxSchedulerReportDetailsEventCell.CreateTimeCell; +begin + FStartCell := CreateStringCell(GetTimeCellText, cdidSchedulerEventStart); +end; + +function TcxSchedulerReportDetailsEventCell.GetCaptionCellText: string; +begin + Result := Event.Caption; + if Trim(Event.Location) <> '' then + Result := Result + ' -- ' + Event.Location; +end; + +function TcxSchedulerReportDetailsEventCell.GetMessageCellText: string; +begin + if Continued then + Result := cxGetResourceString(@sdxSeeAboveMessage) + else + Result := Event.Message; +end; + +function TcxSchedulerReportDetailsEventCell.GetTimeCellText: string; +begin + if Event.AllDayEvent or ((DateOf(Event.Start) < Date) and (DateOf(Event.Finish) > Date)) then + Result := cxGetResourceString(@sdxAllDayMessage) + else + Result := DateTimeHelper.TimeToStr(Max(Event.Start, Date)) + ' - ' + + DateTimeHelper.TimeToStr(Min(Event.Finish, Date + 1)); +end; + +procedure TcxSchedulerReportDetailsEventCell.SetViewParams( + const AViewParams: TcxViewParams); +var + AParams: TdxReportItemViewParams; +begin + inherited SetViewParams(AViewParams); + FillChar(AParams, SizeOf(AParams), 0); + AParams.NativeParams := AViewParams; + Include(AParams.FontStyle, fsBold); + ReportLink.SetCellViewParams(CaptionCell, AParams); + ReportLink.SetCellViewParams(StartCell, AParams); +end; + +{ TcxSchedulerReportMemoEventCell } + +procedure TcxSchedulerReportMemoEventCell.CalculateLayout(AWidth, + ATimeWidth: Integer); +var + ATop, ASpace: Integer; + DC: HDC; +begin + DC := GetDC(0); + try + FLineHeight := Renderer.CalcTextHeight(DC, 'Wg', False, Font); + ASpace := FLineHeight div 2; + ATop := FLineHeight * 2; + HeaderCell.BoundsRect := MakeRect(0, 0, AWidth, ATop); + Inc(ATop, ASpace); + CalculateLabelAndData(CaptionLabelCell, CaptionCell, DC, ATimeWidth, AWidth, ATop); + CalculateLabelAndData(LocationLabelCell, LocationCell, DC, ATimeWidth, AWidth, ATop); + if Assigned(CaptionLabelCell) or Assigned(LocationLabelCell) then Inc(ATop, ASpace); + CalculateLabelAndData(StartLabelCell, StartCell, DC, ATimeWidth, AWidth, ATop); + CalculateLabelAndData(FinishLabelCell, FinishCell, DC, ATimeWidth, AWidth, ATop); + CalculateLabelAndData(ShowTimeAsLabelCell, ShowTimeAsCell, DC, ATimeWidth, AWidth, ATop); + Inc(ATop, ASpace); + CalculateLabelAndData(RecurrenceLabelCell, RecurrenceCell, DC, ATimeWidth, AWidth, ATop); + CalculateLabelAndData(RecurrencePatternLabelCell, RecurrencePatternCell, DC, ATimeWidth, AWidth, ATop); + if Assigned(MessageCell) then + begin + Inc(ATop, ASpace); + MessageCell.BoundsRect := MakeRect(0, ATop, AWidth, ATop); + MessageCell.Height := MessageCell.MeasureContentHeight(DC); + end; + finally + ReleaseDC(0, DC); + end; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateDataItems; +begin + CreateHeader; + CreateSubject; + CreateLocation; + CreateStart; + CreateFinish; + CreateShowTimeAs; + CreateRecurrence; + CreateRecurrencePattern; + CreateMessage; +end; + +function TcxSchedulerReportMemoEventCell.GetCaptionCellText: string; +begin + Result := Event.Caption; +end; + +function TcxSchedulerReportMemoEventCell.GetMessageCellText: string; +begin + Result := Event.Message; +end; + +function TcxSchedulerReportMemoEventCell.GetTimeCellText: string; +begin + Result := FormatDateTime('ddd ddddd t', Event.Start); +end; + +procedure TcxSchedulerReportMemoEventCell.SetViewParams( + const AViewParams: TcxViewParams); +var + AParams: TdxReportItemViewParams; +begin + ReportLink.SetCellViewParams(Self, AViewParams); + ReportLink.SetCellViewParams(CaptionCell, AViewParams); + ReportLink.SetCellViewParams(LocationCell, AViewParams); + ReportLink.SetCellViewParams(StartCell, AViewParams); + ReportLink.SetCellViewParams(FinishCell, AViewParams); + ReportLink.SetCellViewParams(ShowTimeAsCell, AViewParams); + ReportLink.SetCellViewParams(RecurrenceCell, AViewParams); + ReportLink.SetCellViewParams(RecurrencePatternCell, AViewParams); + ReportLink.SetCellViewParams(MessageCell, AViewParams); + + FillChar(AParams, SizeOf(AParams), 0); + AParams.NativeParams := AViewParams; + Include(AParams.FontStyle, fsBold); + ReportLink.SetCellViewParams(CaptionLabelCell, AParams); + ReportLink.SetCellViewParams(LocationLabelCell, AParams); + ReportLink.SetCellViewParams(StartLabelCell, AParams); + ReportLink.SetCellViewParams(FinishLabelCell, AParams); + ReportLink.SetCellViewParams(ShowTimeAsLabelCell, AParams); + ReportLink.SetCellViewParams(RecurrenceLabelCell, AParams); + ReportLink.SetCellViewParams(RecurrencePatternLabelCell, AParams); + + AParams.FontSize := MulDiv(AViewParams.Font.Size, 3, 2); + ReportLink.SetCellViewParams(HeaderCell, AParams); +end; + +procedure TcxSchedulerReportMemoEventCell.CalculateLabelAndData( + ALabelCell, ADataCell: TAbstractdxReportCellData; DC: HDC; + ATimeWidth, AWidth: Integer; var ATop: Integer); +begin + if Assigned(ALabelCell) then + begin + ALabelCell.BoundsRect := MakeBounds(0, ATop, ATimeWidth, FLineHeight); + ADataCell.BoundsRect := MakeRect(ATimeWidth, ATop, AWidth, ATop); + ADataCell.Height := ADataCell.MeasureContentHeight(DC); + Inc(ATop, Max(ADataCell.Height, FLineHeight)); + end; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateHeader; +begin + FHeaderCell := CreateStringCell(GetHeaderCellText); + FHeaderCell.BorderClass := TdxPSCellBoldFlatBorder; + FHeaderCell.CellSides := [csBottom]; + FHeaderCell.TextAlignY := taBottom; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateFinish; +begin + CreateFinishLabelCell; + CreateFinishCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateFinishCell; +begin + FFinishCell := CreateStringCell(FormatDateTime('ddd ddddd t', Event.Finish)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateFinishLabelCell; +begin + FFinishLabelCell := CreateStringCell( + cxGetResourceString(@sdxFinishLabelCaption)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateLocation; +begin + if Event.Location = '' then Exit; + CreateLocationLabelCell; + CreateLocationCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateLocationCell; +begin + FLocationCell := CreateStringCell(Event.Location); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateLocationLabelCell; +begin + FLocationLabelCell := CreateStringCell( + cxGetResourceString(@sdxLocationLabelCaption)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateMessage; +begin + if GetMessageCellText = '' then Exit; + CreateMessageCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateRecurrence; +begin + CreateRecurrenceLabelCell; + CreateRecurrenceCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateRecurrenceCell; +begin + FRecurrenceCell := CreateStringCell(GetRecurrenceCellText); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateRecurrenceLabelCell; +begin + FRecurrenceLabelCell := CreateStringCell( + cxGetResourceString(@sdxRecurrenceLabelCaption)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateRecurrencePattern; +begin + if not Event.IsRecurring then Exit; + CreateRecurrencePatternLabelCell; + CreateRecurrencePatternCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateRecurrencePatternCell; +begin + FRecurrencePatternCell := CreateStringCell(GetRecurrencePatternCellText); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateRecurrencePatternLabelCell; +begin + FRecurrencePatternLabelCell := CreateStringCell( + cxGetResourceString(@sdxRecurrencePatternLabelCaption)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateShowTimeAs; +begin + if GetShowTimeAsCellText = '' then Exit; + CreateShowTimeAsLabelCell; + CreateShowTimeAsCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateShowTimeAsCell; +begin + FShowTimeAsCell := CreateStringCell(GetShowTimeAsCellText); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateShowTimeAsLabelCell; +begin + FShowTimeAsLabelCell := CreateStringCell( + cxGetResourceString(@sdxShowTimeAsLabelCaption)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateStart; +begin + CreateStartLabelCell; + CreateTimeCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateStartLabelCell; +begin + FStartLabelCell := CreateStringCell( + cxGetResourceString(@sdxStartLabelCaption)); +end; + +procedure TcxSchedulerReportMemoEventCell.CreateSubject; +begin + if GetCaptionCellText = '' then Exit; + CreateSubjectLabelCell; + CreateCaptionCell; +end; + +procedure TcxSchedulerReportMemoEventCell.CreateSubjectLabelCell; +begin + FCaptionLabelCell := CreateStringCell( + cxGetResourceString(@sdxSubjectLabelCaption)); +end; + +function TcxSchedulerReportMemoEventCell.GetHeaderCellText: string; +var + AResource: TcxSchedulerStorageResourceItem; +begin + AResource := Event.GetResourceItem; + if AResource <> nil then + Result := AResource.Name + else + Result := dxPSUtl.GetUserName; +end; + +function TcxSchedulerReportMemoEventCell.GetRecurrenceCellText: string; +begin + if Event.IsRecurring then + case Event.RecurrenceInfo.Recurrence of + cxreDaily: + Result := cxGetResourceString(@scxRecurrenceDailyMessage); + cxreWeekly: + Result := cxGetResourceString(@scxRecurrenceWeeklyMessage); + cxreMonthly: + Result := cxGetResourceString(@scxRecurrenceMonthlyMessage); + cxreYearly: + Result := cxGetResourceString(@scxRecurrenceYearlyMessage); + else + Result := ''; + end + else + Result := cxGetResourceString(@sdxRecurrenceNoneMessage); +end; + +function TcxSchedulerReportMemoEventCell.GetRecurrencePatternCellText: string; +begin + if Event.IsRecurring and Assigned(cxGetRecurrenceDescriptionStringProc) then + Result := cxGetRecurrenceDescriptionStringProc(Event.RecurrenceInfo) + else + Result := ''; +end; + +function TcxSchedulerReportMemoEventCell.GetShowTimeAsCellText: string; +begin + case Event.State of + tlsFree: + Result := cxGetResourceString(@sdxShowTimeAsFreeMessage); + tlsTentative: + Result := cxGetResourceString(@sdxShowTimeAsTentativeMessage); + tlsOutOfOffice: + Result := cxGetResourceString(@sdxShowTimeAsOutOfOfficeMessage); + else + Result := ''; + end; +end; + +{ TcxSchedulerReportCommonCellsProducer } + +constructor TcxSchedulerReportCommonCellsProducer.CreateEx( + AStyle: TcxCustomSchedulerReportLinkPrintStyle; + ASite: TcxSchedulerReportSchedulingAreaCell); +begin + inherited Create(AStyle.GetCorrespondedView); + FStyle := AStyle; + FSite := ASite; +end; + +procedure TcxSchedulerReportCommonCellsProducer.GetPageResources( + AResources: TcxObjectList); +var + ResPerPage, APageIndex, I, J: Integer; +begin + ResPerPage := Style.ResourceCountPerPage; + if (Resources = nil) or (ResPerPage <= 0) or + (ResPerPage >= Resources.VisibleResourceCount) then + begin + inherited GetPageResources(AResources); + Exit; + end; + APageIndex := (Site.PageIndex div PagesPerWeek) mod Style.GetResourcePageCount; + I := ResPerPage * APageIndex; + J := Min(ResPerPage * (APageIndex + 1), Resources.VisibleResourceCount); + while I < J do + begin + AResources.Add(TcxSchedulerResourceViewInfo.Create( + Resources.VisibleResources[I])); + I := I + 1; + end; +end; + +procedure TcxSchedulerReportCommonCellsProducer.Produce; +begin + Calculate; +end; + +procedure TcxSchedulerReportCommonCellsProducer.AfterCalculatePage; +var + I, J: Integer; + ASubList: TcxSchedulerViewInfoCellList; + AItem: TcxSchedulerCustomViewInfoItem; + AReportItemClass: TcxSchedulerReportCustomCellClass; + AEventCell: TcxSchedulerReportEventCell; +begin + for I := 0 to Cells.Count - 1 do + begin + ASubList := TcxSchedulerViewInfoCellList(Cells[I]); + for J := 0 to ASubList.Count - 1 do + begin + AItem := ASubList[J]; + if AItem.Visible then + begin + if AItem is TcxSchedulerEventCellViewInfo then + begin + AEventCell := CreateEventCell(TcxSchedulerEventCellViewInfo(AItem)); + Style.ReportLink.DoInitializeEventCell(AEventCell); + end + else + if FindMirorClassForItem(AItem, AReportItemClass) then + ConvertSchedulerCellToPSCells(AItem, AReportItemClass); + end; + end; + end; +end; + +function TcxSchedulerReportCommonCellsProducer.CanCalculate: Boolean; +begin + Result := True; +end; + +function TcxSchedulerReportCommonCellsProducer.CreateEventCell( + AEventViewInfo: TcxSchedulerEventCellViewInfo): TcxSchedulerReportEventCell; +begin + Result := TcxSchedulerReportEventCell.CreateFrom(Site, AEventViewInfo); +end; + +procedure TcxSchedulerReportCommonCellsProducer.ConvertSchedulerCellToPSCells( + AItem: TcxSchedulerCustomViewInfoItem; + AReportItemClass: TcxSchedulerReportCustomCellClass); +var + APSItem: TcxSchedulerReportCustomCell; +begin + APSItem := AReportItemClass.CreateFrom(FSite, AItem); + SetCellViewParams(APSItem, AItem.ViewParams); +end; + +procedure TcxSchedulerReportCommonCellsProducer.DoInitialize( + var ASelectedDays: TcxSchedulerDateList; var AEvents: TcxSchedulerCachedEventList); +begin + ASelectedDays := Site.VisibleDays; + AEvents := Style.Events; +end; + +function TcxSchedulerReportCommonCellsProducer.GetCompressWeekends: Boolean; +begin + Result := Style.CompressWeekends; +end; + +function TcxSchedulerReportCommonCellsProducer.GetDontPrintWeekEnds: Boolean; +begin + Result := Style.DontPrintWeekends; +end; + +function TcxSchedulerReportCommonCellsProducer.GetHideSelection: Boolean; +begin + Result := True; +end; + +function TcxSchedulerReportCommonCellsProducer.GetPageBounds: TRect; +begin + Result := Site.GetInnerBounds(0); +end; + +function TcxSchedulerReportCommonCellsProducer.GetPagesPerWeek: Byte; +begin + Result := Integer(Style.Layout) + 1; +end; + +function TcxSchedulerReportCommonCellsProducer.GetPrintExactlyOneMonth: Boolean; +begin + Result := (Style is TcxSchedulerReportLinkMonthlyPrintStyle) and + TcxSchedulerReportLinkMonthlyPrintStyle(Style).PrintExactlyOneMonthPerPage; +end; + +function TcxSchedulerReportCommonCellsProducer.GetPrintRange( + Index: Integer): TDateTime; +begin + if Index = 0 then + Result := Style.TimePrintFrom + else + Result := Style.TimePrintTo; +end; + +function TcxSchedulerReportCommonCellsProducer.GetPrimaryPage: Boolean; +begin + Result := Site.PrimaryPage; +end; + +function TcxSchedulerReportCommonCellsProducer.GetStylesAdapter: IcxSchedulerStylesAdapter; +begin + Result := Styles; +end; + +procedure TcxSchedulerReportCommonCellsProducer.SetCellViewParams( + ACell: TdxReportVisualItem; const AParams: TcxViewParams); +begin + Site.SetCellViewParams(ACell, AParams); + if Style.ReportLink.OptionsFormatting.SuppressContentColoration then + if ACell is TcxSchedulerReportCustomCell then + TcxSchedulerReportCustomCell(ACell).SuppressColoration; +end; + +function TcxSchedulerReportCommonCellsProducer.GetStyles: TcxSchedulerReportLinkStyles; +begin + Result := Style.VisualStyles; +end; + +{ TcxSchedulerReportDailyCellsProducer } + +procedure TcxSchedulerReportDailyCellsProducer.AfterCalculatePage; +begin + FRulerSite := CreateTimeRulerSite; + SetCellViewParams(FRulerSite, Styles.GetTimeRulerParams); +{ FRulerSite.Transparent := + Style.ReportLink.OptionsFormatting.SuppressContentColoration;} + inherited AfterCalculatePage; +end; + +procedure TcxSchedulerReportDailyCellsProducer.BeforeCalculatePage; +begin + Site.CellSides := csAll; + inherited BeforeCalculatePage; +end; + +procedure TcxSchedulerReportDailyCellsProducer.ConvertSchedulerCellToPSCells( + AItem: TcxSchedulerCustomViewInfoItem; + AReportItemClass: TcxSchedulerReportCustomCellClass); +begin + if AReportItemClass = TcxSchedulerReportDailyTimeRulerCell then + SetCellViewParams(AReportItemClass.CreateFrom(FRulerSite, AItem), AItem.ViewParams) + else + inherited ConvertSchedulerCellToPSCells(AItem, AReportItemClass); +end; + +function TcxSchedulerReportDailyCellsProducer.CreateTimeRulerSite: TcxSchedulerReportDailyTimeRulerCellsSite; +begin + Result := TcxSchedulerReportDailyTimeRulerCellsSite.Create(FSite); + Result.Transparent := True; + Result.ClipChildren := True; +end; + +// registration unit part + +procedure RegisterMirrorClasses; +begin + MirrorClasses := TList.Create; + TcxSchedulerReportContentCell.RegisterMirrorClass; + TcxSchedulerReportHeaderItemCell.RegisterMirrorClass; + TcxSchedulerReportGroupSeparatorCell.RegisterMirrorClass; + TcxSchedulerReportContainerCell.RegisterMirrorClass; + TcxSchedulerReportDailyTimeRulerCell.RegisterMirrorClass; +// TcxSchedulerReportEventCell.RegisterMirrorClass; + TcxSchedulerReportMonthDayCell.RegisterMirrorClass; + TcxSchedulerReportBackgroundSlotCell.RegisterMirrorClass; +end; + +procedure UnRegisterMirrorClasses; +begin + MirrorClasses.Free; +end; + +function GetFontFolder : string; +var + APIDL: PItemIDList; + APath: array[0..MAX_PATH] of Char; + AMalloc: IMalloc; +begin + Result := ''; + if ShGetSpecialFolderLocation(Application.Handle, CSIDL_FONTS, APIDL) = S_OK then + begin + if ShGetPathFromIDList(APIDL, APath) then + Result := APath; + if Succeeded(SHGetMalloc(AMalloc)) then + AMalloc.Free(APIDL); + end; +end; + +procedure RegisterReportLinkClasses; +begin + RegisterClasses([TcxSchedulerReportLinkStyles]); + + TcxSchedulerReportSchedulingAreaCell.Register; + TcxSchedulerReportNotesAreaCell.Register; + TcxSchedulerReportTaskPadCell.Register; + TcxSchedulerReportSchedulerHeaderCell.Register; + TcxSchedulerReportSchedulerHeaderDataCell.Register; + + //datenavigator + TcxSchedulerReportDateNavigatorCell.Register; + TcxSchedulerReportDateNavigatorHeader.Register; + TcxSchedulerReportDateNavigatorDay.Register; + TcxSchedulerReportDateNavigatorDayCaption.Register; + TcxSchedulerReportDateNavigatorWeekNumber.Register; + + //scheduling area items + TcxSchedulerReportContentCell.Register; + TcxSchedulerReportHeaderItemCell.Register; + TcxSchedulerReportGroupSeparatorCell.Register; + TcxSchedulerReportContainerCell.Register; + TcxSchedulerReportBackgroundSlotCell.Register; + TcxSchedulerReportDailyTimeRulerCellsSite.Register; + TcxSchedulerReportDailyTimeRulerCell.Register; + TcxSchedulerReportMonthDayCell.Register; + + TcxSchedulerReportEventCell.Register; + TcxSchedulerReportDetailsEventCell.Register; + TcxSchedulerReportMemoEventCell.Register; + + TcxSchedulerReportTimeLineCell.Register; + TcxSchedulerReportTimeLinePart.Register; + + TcxSchedulerReportPageSite.Register; + + dxPSRegisterReportLink(TcxSchedulerReportLink, + TcxScheduler, TcxfmSchedulerReportLinkDesignWindow); +end; + +type + TAddFontMemResource = function (p1: Pointer; p2: DWORD; p3: PDesignVector; p4: LPDWORD): THandle; stdcall; + TRemoveFontMemResource = function (p1: THandle): BOOL; stdcall; + +var + GDI32Lib: HMODULE; + AddFontMemResource: TAddFontMemResource; + RemoveFontMemResource: TRemoveFontMemResource; + +procedure InitializeSchedulerLink; + + function LoadImagesFromResource(AWidth, AHeight: Integer; + const AResourceName: string): TImageList; + begin + Result := TImageList.Create(nil); + Result.Width := AWidth; + Result.Height := AHeight; + Result.Handle := ImageList_LoadImage(HInstance, PAnsiChar(AResourceName), AWidth, + AHeight, CLR_DEFAULT, IMAGE_BITMAP, LR_DEFAULTCOLOR); + end; + +var + Res : TResourceStream; + Count: DWORD; +begin + RegisterMirrorClasses; + // images loading + StyleImages := LoadImagesFromResource(58, 31, IDB_DXPSSCHEDULER_SMALLDESIGNPREVIEW); + StylePreviewImages := LoadImagesFromResource(128, 76, IDB_DXPSSCHEDULER_STYLEDESIGNPREVIEW); + + // font loading + GDI32Lib := LoadLibrary(gdi32); + AddFontMemResource := GetProcAddress(GDI32Lib, 'AddFontMemResourceEx'); + RemoveFontMemResource := GetProcAddress(GDI32Lib, 'RemoveFontMemResourceEx'); + Res := TResourceStream.Create(hInstance, 'SCHEDULERFONT', 'PSSCHEDULERFONT'); + try + if IsWin2KOrXP then + SchedulerFontHandle := AddFontMemResource(Res.Memory, Res.Size, nil, @Count) + else + begin + SchedulerFontFileName := GetFontFolder + '\' + 'dxPScxSchedulerLnk.ttf'; + Res.SavetoFile(SchedulerFontFileName); + AddFontResource(PChar(SchedulerFontFileName)); + end; + finally + Res.Free; + end; + SpecialSymbolFont := TFont.Create; + SpecialSymbolFont.Name := 'dxPScxScheduler'; + RegisterReportLinkClasses; +end; + +procedure UnregisterReportLinkClasses; +begin + TcxSchedulerReportSchedulingAreaCell.Unregister; + TcxSchedulerReportNotesAreaCell.Unregister; + TcxSchedulerReportTaskPadCell.Unregister; + TcxSchedulerReportSchedulerHeaderCell.Unregister; + TcxSchedulerReportSchedulerHeaderDataCell.Unregister; + //datenavigator + TcxSchedulerReportDateNavigatorCell.Unregister; + TcxSchedulerReportDateNavigatorHeader.Unregister; + TcxSchedulerReportDateNavigatorDay.Unregister; + TcxSchedulerReportDateNavigatorDayCaption.Unregister; + TcxSchedulerReportDateNavigatorWeekNumber.Unregister; + + //scheduling area items + TcxSchedulerReportContentCell.Unregister; + TcxSchedulerReportHeaderItemCell.Unregister; + TcxSchedulerReportGroupSeparatorCell.Unregister; + TcxSchedulerReportContainerCell.Unregister; + TcxSchedulerReportBackgroundSlotCell.Unregister; + TcxSchedulerReportDailyTimeRulerCellsSite.Unregister; + TcxSchedulerReportDailyTimeRulerCell.Unregister; + TcxSchedulerReportMonthDayCell.Unregister; + + TcxSchedulerReportEventCell.Unregister; + TcxSchedulerReportDetailsEventCell.Unregister; + TcxSchedulerReportMemoEventCell.Unregister; + + TcxSchedulerReportTimeLineCell.Unregister; + TcxSchedulerReportTimeLinePart.Unregister; + + TcxSchedulerReportPageSite.Unregister; + + dxPSUnregisterReportLink(TcxSchedulerReportLink, + TcxScheduler, TcxfmSchedulerReportLinkDesignWindow); + UnRegisterClasses([TcxSchedulerReportLinkStyles]); + UnRegisterMirrorClasses; +end; + +procedure FinalizeSchedulerLink; +begin + // images removing + FreeAndNil(StyleImages); + FreeAndNil(StylePreviewImages); + + // font removing + if IsWin2KOrXP then + begin + if SchedulerFontHandle <> 0 then + RemoveFontMemResource(SchedulerFontHandle); + end + else + begin + RemoveFontResource(PChar(SchedulerFontFileName)); + DeleteFile(PChar(SchedulerFontFileName)); + end; + + SpecialSymbolFont.Free; + FreeLibrary(GDI32Lib); + + UnregisterReportLinkClasses; +end; + +initialization + InitializeSchedulerLink; + +finalization + FinalizeSchedulerLink; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxSchedulerLnk.res b/official/x.35/ExpressPrinting System/Sources/dxPScxSchedulerLnk.res new file mode 100644 index 00000000..574c0437 Binary files /dev/null and b/official/x.35/ExpressPrinting System/Sources/dxPScxSchedulerLnk.res differ diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxSchedulerLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxSchedulerLnkReg.pas new file mode 100644 index 00000000..0ad4e1e3 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxSchedulerLnkReg.pas @@ -0,0 +1,165 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxSchedulerLnkReg; + +interface + +{$I cxVer.Inc} + +procedure Register; + +implementation + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignEditors, + {$ELSE} + DsgnIntf, + {$ENDIF} + Classes, TypInfo, cxStyles, cxStyleSheetEditor, dxPSCore, dxPScxSchedulerLnk; + +const + sdxAllResources = '(All resources)'; + sdxAuto = 'Auto'; + sdxDefault = 'Default'; + sdxTypeDefault = '(Type "Default" to restore original Caption)'; + +{ TcxSchedulerReportLinkActiveStylePropertyEditor } + +type + + TcxSchedulerReportLinkResourceCountPerPagePropertyEditor = class(TIntegerProperty) + public + function GetValue: string; override; + end; + + { TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor } + + TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor = class(TComponentProperty) + private + FComponents: TStringList; + function GetReportLink: TBasedxReportLink; + protected + procedure AddComponent(const AName: string); + procedure GetComponents; virtual; + function IsComponentValid(AComponent: TComponent): Boolean; virtual; + public + destructor Destroy; override; + procedure Initialize; override; + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + property ReportLink: TBasedxReportLink read GetReportLink; + end; + +{ TcxSchedulerReportLinkResourceCountPerPagePropertyEditor } + +function TcxSchedulerReportLinkResourceCountPerPagePropertyEditor.GetValue: string; +begin + Result := inherited GetValue; + if GetOrdValue = 0 then + Result := Result + ' ' + sdxAllResources; +end; + +{ TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor } + +destructor TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.Destroy; +begin + FComponents.Free; + inherited Destroy; +end; + +procedure TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.Initialize; +begin + inherited; + FComponents := TStringList.Create; +end; + +function TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes - [paMultiSelect]; +end; + +procedure TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + GetComponents; + for I := 0 to FComponents.Count - 1 do + Proc(FComponents[I]); +end; + +function TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.GetReportLink: TBasedxReportLink; +begin + Result := TBasedxReportLink(GetComponent(0)); +end; + +procedure TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.AddComponent(const AName: string); +begin + if IsComponentValid(Designer.GetComponent(AName)) then FComponents.Add(AName); +end; + +procedure TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.GetComponents; +begin + FComponents.Clear; + Designer.GetComponentNames(GetTypeData(PTypeInfo(TBasedxReportLink.ClassInfo)), AddComponent); +end; + +function TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor.IsComponentValid(AComponent: TComponent): Boolean; +begin + Result := (AComponent <> GetComponent(0)) and TBasedxReportLink(AComponent).Aggregable; +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterNoIcon([TcxSchedulerReportLink, TcxSchedulerReportLinkStyleSheet]); + + RegisterPropertyEditor(TypeInfo(Integer), TcxCustomSchedulerReportLinkPrintStyle, + 'ResourceCountPerPage', TcxSchedulerReportLinkResourceCountPerPagePropertyEditor); + RegisterPropertyEditor(TypeInfo(TBasedxReportLink), TcxSchedulerReportLink, + 'TaskPadReportLink', TcxSchedulerReportLinkTaskPadReportLinkPropertyEditor); +end; + +initialization + cxStyles.RegisterStyleSheetClass(TcxSchedulerReportLinkStyleSheet); + +finalization + cxStyles.UnregisterStyleSheetClass(TcxSchedulerReportLinkStyleSheet); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxTLLnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPScxTLLnk.dfm new file mode 100644 index 00000000..61aea1a6 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxTLLnk.dfm @@ -0,0 +1,1582 @@ +object dxfmTreeListReportLinkDesignWindow: TdxfmTreeListReportLinkDesignWindow + Left = 426 + Top = 272 + BorderStyle = bsDialog + Caption = 'Property Sheets' + ClientHeight = 391 + ClientWidth = 624 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 4 + Width = 618 + Height = 353 + ActivePage = tshStyles + TabOrder = 0 + OnChange = PageControl1Change + object tshView: TTabSheet + Caption = 'View' + object lblShow: TLabel + Left = 5 + Top = 8 + Width = 26 + Height = 13 + Caption = 'Show' + end + object imgShow: TImage + Left = 8 + Top = 34 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlShow: TBevel + Left = 43 + Top = 12 + Width = 253 + Height = 4 + Shape = bsBottomLine + end + object lblOnEveryPage: TLabel + Left = 5 + Top = 166 + Width = 72 + Height = 13 + Caption = 'On Every Page' + end + object imgOnEveryPage: TImage + Left = 8 + Top = 192 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888777777777777777708888888888 + 888887FFFFFFFFFFFFFFF08888888888888887F7777777777777F07777708888 + 888887F7777777777777F0FFFFF08888888887F7777777777777F07777F07777 + 708887FFFFFFFFFFFFFFF07777F0FFFFF08887F777777777777FF07777F07777 + F08887FFFFFFFFFFFFFFF0FFFFF07777F08887F77777777777FFF077FFF07777 + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777777FFFFF0777FF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777FFFFFFFF07FFFF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF0777FF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF077FFF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777777F077FFF077FF + F08887F7777777777777F0FFFFF0FFFFF08887F7777777777777F0FFFFF07FFF + F08887FFFFFFFFFFFFFFF07777F0FFFFF0888000000000000000007777F077FF + F08888888887F7777777777777F0FFFFF08888888887FFFFFFFFFFFFFFF07777 + F0888888888000000000000000007777F08888888888888887F7777777777777 + F08888888888888887FFFFFFFFFFFFFFF0888888888888888000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlOnEveryPage: TBevel + Left = 90 + Top = 171 + Width = 205 + Height = 4 + Shape = bsBottomLine + end + object bvlWarningHost: TBevel + Left = 5 + Top = 251 + Width = 293 + Height = 70 + Visible = False + end + object Bevel2: TBevel + Left = 90 + Top = 91 + Width = 205 + Height = 4 + Shape = bsBottomLine + end + object chbxShowBands: TCheckBox + Left = 90 + Top = 26 + Width = 200 + Height = 17 + Caption = 'Ba&nds' + TabOrder = 0 + OnClick = OptionsViewClick + end + object chbxShowHeaders: TCheckBox + Tag = 1 + Left = 90 + Top = 47 + Width = 200 + Height = 17 + Caption = '&Headers' + TabOrder = 1 + OnClick = OptionsViewClick + end + object chbxShowFooters: TCheckBox + Tag = 2 + Left = 90 + Top = 68 + Width = 200 + Height = 17 + Caption = 'Foo&ters' + TabOrder = 2 + OnClick = OptionsViewClick + end + object chbxShowExpandButtons: TCheckBox + Tag = 3 + Left = 90 + Top = 124 + Width = 200 + Height = 17 + Caption = 'Expand Buttons' + TabOrder = 4 + OnClick = OptionsViewClick + end + object chbxBandsOnEveryPage: TCheckBox + Left = 90 + Top = 184 + Width = 200 + Height = 17 + Caption = 'Ba&nds' + TabOrder = 6 + OnClick = OptionsOnEveryPageClick + end + object chbxHeadersOnEveryPage: TCheckBox + Tag = 1 + Left = 90 + Top = 205 + Width = 200 + Height = 17 + Caption = 'Headers' + TabOrder = 7 + OnClick = OptionsOnEveryPageClick + end + object chbxFootersOnEveryPage: TCheckBox + Tag = 2 + Left = 90 + Top = 226 + Width = 200 + Height = 17 + Caption = 'Footers' + TabOrder = 8 + OnClick = OptionsOnEveryPageClick + end + object chbxShowTreeLines: TCheckBox + Tag = 4 + Left = 90 + Top = 145 + Width = 200 + Height = 17 + Caption = 'TreeLines' + TabOrder = 5 + OnClick = OptionsViewClick + end + object chbxShowBorders: TCheckBox + Tag = 5 + Left = 90 + Top = 103 + Width = 200 + Height = 17 + Caption = 'Borders' + TabOrder = 3 + OnClick = OptionsViewClick + end + object lblPreviewWindow: TStaticText + Left = 305 + Top = 0 + Width = 82 + Height = 14 + AutoSize = False + Caption = 'Preview' + TabOrder = 9 + end + end + object tshBehaviors: TTabSheet + Caption = 'Behaviors' + ImageIndex = 1 + object pnlBehaviors: TPanel + Left = 0 + Top = 0 + Width = 299 + Height = 325 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object pnlSelection: TPanel + Left = 0 + Top = 0 + Width = 299 + Height = 75 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object lblSelection: TLabel + Left = 5 + Top = 8 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object imgSelection: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlSelection: TBevel + Left = 57 + Top = 12 + Width = 239 + Height = 4 + Shape = bsBottomLine + end + object chbxProcessSelection: TCheckBox + Left = 90 + Top = 26 + Width = 205 + Height = 17 + Caption = 'Process Selection' + TabOrder = 0 + OnClick = OptionsSelectionClick + end + object chbxProcessExactSelection: TCheckBox + Tag = 1 + Left = 90 + Top = 51 + Width = 205 + Height = 17 + Caption = 'Process Exact Selection' + TabOrder = 1 + OnClick = OptionsSelectionClick + end + end + object pnlExpanding: TPanel + Left = 0 + Top = 75 + Width = 299 + Height = 70 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object lblExpanding: TLabel + Left = 5 + Top = 8 + Width = 50 + Height = 13 + Caption = 'Expanding' + end + object imgExpanding: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 7778800000000000000000000000078888888888880000000000000000000000 + 007880FFF7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7FF777777FFF77777FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F8F7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7F7F8888FF7F88888FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F8F7777777777777777777078888888888880F7F7F888FFF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F0788077777777777777777777770788C8888C88880F7FF888888FFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880F0F7777777FFFFFFFFFFFF0788CCCCCCCC880F77777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7F7F8888FF7F88888FF7 + F0788077777777777777777777770788C8888C88880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F7F7F8888FF7F888888F7 + F0788077777777777777777777770788CCCC8CC8880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCCCCCC880F7FF88888FFFFFFFFFFF7 + F07880F0F777777FFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F77777777777777777777 + F078800000000000000000000000078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F888888880F88888888888078888888888880F77777777777777777777 + F07880F800008880F80000000008078888888888880F77777777777777777777 + F07880FFFFFFFFF0FFFFFFFFFFFF078888888888880FFFFFFFFFFFFFFFFFFFFF + F078800000000000000000000000088888888888880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlExpanding: TBevel + Left = 62 + Top = 13 + Width = 234 + Height = 4 + Shape = bsBottomLine + end + object chbxExpandNodes: TCheckBox + Left = 90 + Top = 26 + Width = 205 + Height = 17 + Caption = 'Nodes' + TabOrder = 0 + OnClick = OptionsExpandingClick + end + object chbxExplicitlyExpandNodes: TCheckBox + Tag = 1 + Left = 90 + Top = 51 + Width = 205 + Height = 17 + Caption = 'Explicitly Expand Nodes' + TabOrder = 1 + OnClick = OptionsExpandingClick + end + end + object pnlSize: TPanel + Left = 0 + Top = 145 + Width = 299 + Height = 68 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object lblSize: TLabel + Left = 5 + Top = 8 + Width = 19 + Height = 13 + Caption = 'Size' + end + object bvlSize: TBevel + Left = 33 + Top = 13 + Width = 262 + Height = 4 + Shape = bsBottomLine + end + object imgGridSize: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000008088F07DDDDDDDDDDDD0800000000000000000000 + 807DD0F0FFFF8FFFF8FFFF0FFF0F07DDDDDDDDDDDD0F0F77FFF8F777F8F777F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCDDDDCDDDD0F0F00FFF8F00FF8F00FF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCCCCCDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCDDDDCDDDD0F0FFFFFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCCCCDCCDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCCCCCDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCDCCDDD0F0FFFFFF8F0FFF8F0FFF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0777777777777770FFF0F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F0F8887F8887F8880FFF8F07DDDDDDDDDDDD0F0F888887F88887F88880 + F07DD0F0F0087F0087F0080FFF0F07DDDDDDDDDDDD0F0F800087F80087F80080 + F07DD0F0FFFF7FFFF7FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF7FFFFF7FFFFF0 + F07DD0800000000000000008080807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxAutoWidth: TCheckBox + Left = 90 + Top = 26 + Width = 205 + Height = 17 + Caption = '&Auto Width' + TabOrder = 0 + OnClick = OptionsSizeClick + end + end + object pnlSeparators: TPanel + Left = 0 + Top = 213 + Width = 299 + Height = 94 + Align = alTop + BevelOuter = bvNone + TabOrder = 3 + object lblSeparators: TLabel + Left = 5 + Top = 8 + Width = 53 + Height = 13 + Caption = 'Separators' + end + object bvlSeparator: TBevel + Left = 68 + Top = 13 + Width = 229 + Height = 4 + Shape = bsBottomLine + end + object lblSeparatorsThickness: TLabel + Left = 90 + Top = 38 + Width = 50 + Height = 13 + Caption = 'Thickness:' + end + object lblSeparatorsColor: TLabel + Left = 90 + Top = 67 + Width = 29 + Height = 13 + Caption = 'Color:' + end + object bvlSeparatorThicknessHost: TBevel + Left = 152 + Top = 34 + Width = 80 + Height = 21 + end + object bvlSeparatorColorHost: TBevel + Left = 152 + Top = 62 + Width = 143 + Height = 21 + end + object imgSeparators: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000000000F07DDDDDDDDDDDD0800000000000000000000 + 807DD0F0F77FFF8F777F8F777F0F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFFFF8FFFFF8FFFFF0F07DDDDDDDDDDDD0F0F00FFF8F00FF8F000F0 + F07DD0F08888888888888888880F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFFFF8FFFFF8FFFFF0F07DDDDDDDDDDDD0F0F0000F8F000F8F000F0 + F07DD0F0F00FFF8F00FF8F00FF0F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFFFF8FFFFF8FFFFF0F07DDCCCCDCCDDD0F00000000000000000000 + F07DD0F08888888888888888880F07DDCCCCCCCCDD0F00000000000000000000 + F07DD0F0FFFFFF8FFFFF8FFFFF0F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFFFF8F000F8F000F0F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFFFF8FFFFF8FFFFF0F07DDDDDDDDDDDD0F0F000FF8F000F8F00FF0 + F07DD0F0F00FFF8F000F8F000F0F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFFFF8FFFFF8FFFFF0F07DDCDDDDCDDDD0F00000000000000000000 + F07DD0F08888888888888888880F07DDCCCCDCCDDD0F00000000000000000000 + F07DD0F0FFFFFF8FFFFF8FFFFF0F07DDCCCCCCCCDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFFFF8F0FFF8F0FFF0F07DDCCCCDCCDDD0F0FFFFFF8F0FFF8F0FFF0 + F07DD0F0FFFFFF8FFFFF8FFFFF0F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00FFF8F000F8F000F0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFFFF8FFFFF8FFFFF0F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F07777777777777777770F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F0F888887F88887F88880F07DDDDDDDDDDDD0F0F888887F88887F88880 + F07DD0F0F800087F80087F80080F07DDDDDDDDDDDD0F0F800087F80087F80080 + F07DD0F0FFFFFF7FFFFF7FFFFF0F07DDDDDDDDDDDD0F0FFFFFF7FFFFF7FFFFF0 + F07DD0800000000000000000000807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + end + end + end + object tshFormatting: TTabSheet + Caption = 'Formatting' + ImageIndex = 4 + object lblLookAndFeel: TLabel + Left = 5 + Top = 8 + Width = 66 + Height = 13 + Caption = 'Look and Feel' + end + object bvlLookAndFeel: TBevel + Left = 85 + Top = 12 + Width = 211 + Height = 4 + Shape = bsBottomLine + end + object imgLookAndFeel: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D08777777777780877777788807DCCCCDCCDDD0877777777778787777788 + 8F07D08888888888880888888888807DCCCCCCCCDD0888888888888788888888 + 8F07D00000000000000000000000007DCCCCDCCDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F7777777FF07DDDDDDDDDDD0F777777777FF7F7777777 + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F777777FFF07DDDDDDDDDDD0F777777FFFFF7F777777F + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F7777777777F7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F77777FFFF07DDDDDDDDDDD0F77777777FFF7F77777FF + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D00000000000000000000000007DCDDDDCDDDD0000000000000000000000 + 0007D08888888888880888888888807DCCCCDCCDDD0777777777777777777777 + 7707D08888888888880888888888807DCCCCCCCCDD0F88888888888788888888 + 8707D08000000008880880000000807DCCCCDCCDDD0F00000000888788000000 + 8707D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + F707D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgRefinements: TImage + Left = 7 + Top = 100 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FF7FFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF777777F + F07DD0F77777777FF7FF70888FFF07DDCCCCCCCCDD0F77777777FF7FF7FFFF7F + F07DD0FFFFFFFFFFF7FF70FF8FFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF7F00F7F + F07DD0F777777FFFF7FF70FF8FFF07DDCDDDDCDDDD0F777777FFFF7FF7F00F7F + F07DD0FFFFFFFFFFF7FF70000FFF07DDDDDDDDDDDD0FFFFFFFFFFF7FF7FFFF7F + F07DD0F77777777FF7FF777777FF07DDDDDDDDDDDD0F77777777FF7FF777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFCCCCCFFF07DDCCCCCCCCDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FCCCCCCCFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F7777777FFF7FFCCCCCFFF07DDCDDDDCDDDD0F7777777FFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7F9999999FF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F777777777F7FF99999FFF07DDDDDDDDDDDD0F777777777F7F7777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F80000888887F88888888707DDDDDDDDDDDD0F80000888887F88888888 + 707DD0F80000000087F80000008707DDDDDDDDDDDD0F80000000087F80000008 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0FFFFFFFFFFF7FFFFFFFFF707DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + 707DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblRefinements: TLabel + Left = 5 + Top = 78 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlRefinements: TBevel + Left = 70 + Top = 83 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object bvlRefinementsSeparator: TBevel + Left = 90 + Top = 168 + Width = 205 + Height = 4 + Shape = bsBottomLine + end + object cbxLookAndFeel: TComboBox + Left = 90 + Top = 37 + Width = 202 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + OnChange = LookAndFeelChange + end + object chbxFlatCheckMarks: TCheckBox + Tag = 2 + Left = 90 + Top = 145 + Width = 210 + Height = 17 + Caption = 'Flat Check &Marks' + TabOrder = 3 + OnClick = OptionsRefinementsClick + end + object chbxDisplayGraphicsAsText: TCheckBox + Tag = 1 + Left = 90 + Top = 122 + Width = 210 + Height = 17 + Caption = 'Display Graphics As &Text' + TabOrder = 2 + OnClick = OptionsRefinementsClick + end + object chbxTransparentGraphics: TCheckBox + Left = 90 + Top = 100 + Width = 210 + Height = 17 + Caption = 'Transparent &Graphics' + TabOrder = 1 + OnClick = OptionsRefinementsClick + end + object chbxSuppressBackgroundBitmaps: TCheckBox + Tag = 1 + Left = 90 + Top = 181 + Width = 210 + Height = 17 + Caption = 'Suppress Background Textures' + TabOrder = 4 + OnClick = OptionsFormattingClick + end + object chbxConsumeSelectionStyle: TCheckBox + Tag = 2 + Left = 90 + Top = 204 + Width = 210 + Height = 17 + Caption = 'Consume Selection Style' + TabOrder = 5 + OnClick = OptionsFormattingClick + end + end + object tshStyles: TTabSheet + Caption = 'Styles' + ImageIndex = 4 + object bvlStyles: TBevel + Left = 115 + Top = 13 + Width = 181 + Height = 4 + Shape = bsBottomLine + end + object bvlStyleSheets: TBevel + Left = 72 + Top = 249 + Width = 224 + Height = 5 + Shape = bsBottomLine + end + object lblStyleSheets: TLabel + Left = 6 + Top = 246 + Width = 60 + Height = 13 + Caption = 'Style Sheets' + end + object bvlStylesHost: TBevel + Left = 6 + Top = 33 + Width = 214 + Height = 173 + end + object Label1: TLabel + Left = 79 + Top = 110 + Width = 68 + Height = 13 + Caption = '[ Styles Host ]' + Visible = False + end + object lblUseNativeStyles: TLabel + Left = 24 + Top = 9 + Width = 84 + Height = 13 + Caption = '&Use Native Styles' + FocusControl = chbxUseNativeStyles + OnClick = lblUseNativeStylesClick + end + object btnStyleColor: TButton + Left = 229 + Top = 61 + Width = 68 + Height = 23 + Caption = 'Co&lor...' + TabOrder = 2 + OnClick = StyleColorClick + end + object btnStyleFont: TButton + Left = 229 + Top = 33 + Width = 68 + Height = 23 + Caption = '&Font...' + TabOrder = 1 + OnClick = StyleFontClick + end + object btnStyleBackgroundBitmap: TButton + Left = 229 + Top = 97 + Width = 68 + Height = 23 + Caption = '&Texture...' + TabOrder = 3 + OnClick = StyleBackgroundBitmapClick + end + object chbxUseNativeStyles: TCheckBox + Left = 5 + Top = 8 + Width = 15 + Height = 17 + TabOrder = 0 + OnClick = OptionsFormattingClick + end + object cbxStyleSheets: TComboBox + Left = 6 + Top = 265 + Width = 288 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 7 + OnClick = cbxStyleSheetsClick + OnDrawItem = cbxStyleSheetsDrawItem + OnKeyDown = cbxStyleSheetsKeyDown + end + object btnStyleSheetNew: TButton + Left = 6 + Top = 297 + Width = 68 + Height = 23 + Caption = '&New...' + TabOrder = 8 + OnClick = btnStyleSheetNewClick + end + object btnStyleSheetCopy: TButton + Left = 79 + Top = 297 + Width = 68 + Height = 23 + Caption = '&Copy...' + TabOrder = 9 + OnClick = btnStyleSheetCopyClick + end + object btnStyleSheetDelete: TButton + Left = 153 + Top = 297 + Width = 68 + Height = 23 + Caption = '&Delete...' + TabOrder = 10 + OnClick = btnStyleSheetDeleteClick + end + object btnStylesSaveAs: TButton + Left = 116 + Top = 213 + Width = 104 + Height = 23 + Caption = 'Save &As...' + TabOrder = 6 + OnClick = StylesSaveAsClick + end + object btnStyleSheetRename: TButton + Left = 226 + Top = 297 + Width = 68 + Height = 23 + Caption = '&Rename...' + TabOrder = 11 + OnClick = btnStyleSheetRenameClick + end + object btnStyleBackgroundBitmapClear: TButton + Left = 229 + Top = 125 + Width = 68 + Height = 23 + Caption = 'Clear' + TabOrder = 4 + OnClick = StyleBackgroundBitmapClearClick + end + object btnStyleRestoreDefaults: TButton + Left = 6 + Top = 213 + Width = 105 + Height = 23 + Caption = 'Restore Defaults' + TabOrder = 5 + OnClick = StyleRestoreDefaultsClick + end + end + object tshPreview: TTabSheet + Caption = 'Preview' + ImageIndex = 2 + object lblPreviewOptions: TLabel + Left = 5 + Top = 8 + Width = 37 + Height = 13 + Caption = 'Options' + end + object bvlPreviewOptions: TBevel + Left = 54 + Top = 12 + Width = 242 + Height = 5 + Shape = bsBottomLine + end + object lblPreviewMaxLineCount: TLabel + Left = 90 + Top = 75 + Width = 78 + Height = 13 + Caption = 'Max Line Count:' + end + object bvlPreviewMaxLineCountHost: TBevel + Left = 215 + Top = 71 + Width = 68 + Height = 21 + Visible = False + end + object imgPreview: TImage + Left = 8 + Top = 33 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDD7777777777777777777777777DDDDDD0000000000000000000000000 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F07DDDDDD0F7FC9F77777777777777F7F0 + 7DDDDDD0F7F9CF77777777777777F7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7F7FFCCFFCCCCFFCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7F7FFCCCCCFCCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7F7FFCCCCCCCFCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7F7FFCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7F7FFCCCCCCCCFCCFCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7F7FFCCCCCFFCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7F7FFCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FC9F77777777777777F7F07DDDDDD0F7F9CF77777777777777F7F0 + 7DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F88887F888887F888887F07DDDDDD0F7F00087F000087F000087F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0000000000000000000000000 + DDDD} + Transparent = True + end + object chbxPreviewVisible: TCheckBox + Left = 90 + Top = 30 + Width = 207 + Height = 17 + Caption = 'Visible' + TabOrder = 0 + OnClick = PreviewVisibleClick + end + object chbxPreviewAutoHeight: TCheckBox + Left = 90 + Top = 51 + Width = 207 + Height = 17 + Caption = 'Auto Height' + TabOrder = 1 + OnClick = PreviewAutoHeightClick + end + end + end + object pnlPreview: TPanel + Left = 313 + Top = 44 + Width = 300 + Height = 304 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + object PreviewTreeList: TcxTreeList + Left = 5 + Top = 5 + Width = 291 + Height = 294 + Bands = < + item + Caption.Text = 'Manufacturer Data' + Width = 173 + end + item + Caption.Text = 'Car Data' + Width = 116 + end> + BufferedPaint = False + DefaultRowHeight = 17 + Enabled = False + OptionsBehavior.AutomateLeftMostIndent = False + OptionsView.CellAutoHeight = True + OptionsView.ScrollBars = ssNone + OptionsView.Bands = True + OptionsView.ColumnAutoWidth = True + OptionsView.GridLines = tlglBoth + OptionsView.UseNodeColorForIndent = False + Preview.Column = colManufacturerCountry + TabOrder = 0 + OnCustomDrawBandHeader = PreviewTreeListCustomDrawBandHeader + OnCustomDrawCell = PreviewTreeListCustomDrawCell + OnCustomDrawFooterCell = PreviewTreeListCustomDrawFooterCell + OnCustomDrawHeaderCell = PreviewTreeListCustomDrawHeader + object colManufacturerName: TcxTreeListColumn + Caption.Text = 'Name' + DataBinding.ValueType = 'String' + Width = 113 + Position.ColIndex = 0 + Position.RowIndex = 0 + Position.BandIndex = 0 + end + object colManufacturerLogo: TcxTreeListColumn + Caption.Text = 'Logo' + DataBinding.ValueType = 'String' + Width = 60 + Position.ColIndex = 1 + Position.RowIndex = 0 + Position.BandIndex = 0 + end + object colManufacturerCountry: TcxTreeListColumn + Caption.Text = 'Country' + DataBinding.ValueType = 'String' + Width = 167 + Position.ColIndex = 2 + Position.RowIndex = 0 + Position.BandIndex = 0 + end + object colCarModel: TcxTreeListColumn + Caption.Text = 'Model' + DataBinding.ValueType = 'String' + Width = 86 + Position.ColIndex = 0 + Position.RowIndex = 0 + Position.BandIndex = 1 + end + object colCarIsSUV: TcxTreeListColumn + Caption.Text = 'SUV' + DataBinding.ValueType = 'String' + Width = 30 + Position.ColIndex = 1 + Position.RowIndex = 0 + Position.BandIndex = 1 + end + end + end + object cxStyleRepository1: TcxStyleRepository + Left = 4 + Top = 362 + object styleBandHeaders: TcxStyle + AssignedValues = [svFont] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + end + object styleStandard: TcxStyle + AssignedValues = [svFont] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + end + object stylePreview: TcxStyle + AssignedValues = [svFont] + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + end + object styleCardShadow: TcxStyle + end + end + object pmStyles: TPopupMenu + Images = ilStylesPopup + OnPopup = pmStylesPopup + Left = 32 + Top = 362 + object miStyleFont: TMenuItem + Caption = '&Font...' + ImageIndex = 0 + ShortCut = 16454 + OnClick = StyleFontClick + end + object miStyleColor: TMenuItem + Caption = '&Color...' + OnClick = StyleColorClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miStyleBackgroundBitmap: TMenuItem + Caption = '&Texture...' + ImageIndex = 1 + OnClick = StyleBackgroundBitmapClick + end + object miStyleBackgroundBitmapClear: TMenuItem + Caption = 'Clear' + ImageIndex = 3 + ShortCut = 16430 + OnClick = StyleBackgroundBitmapClearClick + end + object milLine: TMenuItem + Caption = '-' + end + object miStylesSelectAll: TMenuItem + Caption = 'Select A&ll' + ShortCut = 16449 + OnClick = miStylesSelectAllClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miStyleRestoreDefaults: TMenuItem + Caption = 'Restore Defaults' + OnClick = StyleRestoreDefaultsClick + end + object miLine4: TMenuItem + Caption = '-' + end + object miStylesSaveAs: TMenuItem + Caption = 'Save &As...' + ImageIndex = 2 + ShortCut = 16467 + OnClick = StylesSaveAsClick + end + end + object ilStylesPopup: TImageList + Left = 60 + Top = 362 + Bitmap = { + 494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00000000000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF000000 + 0000008080000080800000808000008080000080800000808000008080000080 + 8000008080000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000000000000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000008080000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF00FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800080808000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00C0C0C00000FFFF00C0C0C000FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000000000008080800080808000000000008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C00000000000C0C0C00000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFC001FFFF + FE07001F8001FFF9FF9F000F8001E7FFFF9F00078001C3F3E01F00038001C3E7 + F99F00018001E1C7F99B00008001F08FF99B00018001F81FF89300018001FC3F + D80300018001F81FD9BF80018001F09FC93FE0018001C1C7C03FE001800183E3 + FFFFE00180018FF1FFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxTLLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxTLLnk.pas new file mode 100644 index 00000000..099cc5ed --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxTLLnk.pas @@ -0,0 +1,7511 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxTLLnk; + +interface + +{$I cxVer.inc} + +uses + Windows, SysUtils, Messages, Classes, Graphics, Controls, StdCtrls, ComCtrls, + ExtCtrls, ImgList, dxExtCtrls, Menus, Dialogs, ExtDlgs, cxClasses, cxControls, + cxGraphics, cxStyles, cxLookAndFeels, cxLookAndFeelPainters, cxEdit, cxTextEdit, + cxInplaceContainer, cxTL, cxDBTL, cxTLData, cxCustomData, dxBase, dxPSSngltn, + dxPrnPg, dxPSCore, dxPScxCommon; + +const + vspsTreeListFirst = 0; + vspsTreeListBandHeader = vspsTreeListFirst + 0; + vspsTreeListContent = vspsTreeListFirst + 1; + vspsTreeListContentEven = vspsTreeListFirst + 2; + vspsTreeListContentOdd = vspsTreeListFirst + 3; + vspsTreeListFooter = vspsTreeListFirst + 4; + vspsTreeListFooterRow = vspsTreeListFirst + 5; + vspsTreeListHeader = vspsTreeListFirst + 6; + vspsTreeListIndent = vspsTreeListFirst + 7; + vspsTreeListPreview = vspsTreeListFirst + 8; + vspsTreeListSelection = vspsTreeListFirst + 9; + vspsTreeListLast = vspsTreeListSelection; + + cxTreeListAttributeIDBase = 0; + cxTreeListUndefinedID = cxTreeListAttributeIDBase + 0; + cxTreeListBandID = cxTreeListAttributeIDBase + 1; + cxTreeListFooterID = cxTreeListAttributeIDBase + 2; + cxTreeListHeaderID = cxTreeListAttributeIDBase + 3; + cxTreeListIndentID = cxTreeListAttributeIDBase + 4; + cxTreeListNodeID = cxTreeListAttributeIDBase + 5; + +type + TcxTreeListNodeClass = class of TcxTreeListNode; + + TcxTreeListControlReportLink = class; + TdxfmTreeListReportLinkDesignWindow = class; + + TcxTreeListControlAttributeHostInfo = class; + TcxTreeListControlAdapterClass = class of TcxTreeListControlAdapter; + TcxTreeListControlAdapter = class; + TcxTreeListControlReportLinkFormatterClass = class of TcxTreeListControlReportLinkFormatter; + TcxTreeListControlReportLinkFormatter = class; + TcxTreeListControlReportLinkBuilderClass = class of TcxTreeListControlReportLinkBuilder; + TcxTreeListControlReportLinkBuilder = class; + + TcxTreeListAttributeClass = class of TcxTreeListAttribute; + TcxTreeListAttribute = class end; + TcxTreeListBandAttribute = class(TcxTreeListAttribute); + TcxTreeListNodeAttribute = class(TcxTreeListAttribute); + TcxTreeListFooterAttribute = class(TcxTreeListAttribute); + TcxTreeListHeaderAttribute = class(TcxTreeListAttribute); + + TcxTreeListAttributeID = type Integer; + + TcxTreeListCellCustomDrawInfo = record + AttributeID: TcxTreeListAttributeID; + Band: TcxTreeListBand; + Column: TcxTreeListColumn; + Node: TcxTreeListNode; + Index: Integer; + end; + + TdxTLColumnPlace = record + Left: Integer; + Right: Integer; + RowIndex: Integer; + LineCount: Integer; + end; + + { producers } + + TcxTreeListControlReportLinkRowProducerClass = class of TcxTreeListControlReportLinkRowProducer; + + TcxTreeListControlReportLinkRowProducer = class + private + FBuilder: TcxTreeListControlReportLinkBuilder; + FHost: TdxReportCell; + FRow: TdxReportCell; + FRowHeight: Integer; + function GetDC: HDC; + function GetIndentWidth: Integer; + function GetRowWidth: Integer; + protected + procedure CalculateRowAutoHeight; virtual; + procedure CalculateRowHeight; virtual; + procedure CreateRow; virtual; + procedure CreateRowHost(const AHostInfo: TcxTreeListControlAttributeHostInfo); virtual; + function DoesItemParticipateInRowAutoHeightCalculation(AnItem: TdxReportVisualItem): Boolean; virtual; + procedure FixupRowDataHeight; virtual; + procedure FixupRowHeight; virtual; + procedure FixupRowItselfHeight; virtual; + procedure InitializeRow; virtual; + + function GetAutoHeight: Boolean; virtual; + function GetLineCount: Integer; virtual; + function GetLineHeight: Integer; virtual; + + property DC: HDC read GetDC; + public + constructor Create(ABuilder: TcxTreeListControlReportLinkBuilder); virtual; + + function Adapter: TcxTreeListControlAdapter; overload; virtual; + function Builder: TcxTreeListControlReportLinkBuilder; overload; virtual; + function Formatter: TcxTreeListControlReportLinkFormatter; overload; virtual; + + function Produce(AHostInfo: TcxTreeListControlAttributeHostInfo): TdxReportCell; virtual; + + property AutoHeight: Boolean read GetAutoHeight; + property Host: TdxReportCell read FHost; + property IndentWidth: Integer read GetIndentWidth; + property LineCount: Integer read GetLineCount; + property LineHeight: Integer read GetLineHeight; + property Row: TdxReportCell read FRow; + property RowHeight: Integer read FRowHeight write FRowHeight; + property RowWidth: Integer read GetRowWidth; + end; + + TcxTreeListControlReportLinkCustomRowProducerClass = class of TcxTreeListControlReportLinkCustomRowProducer; + + TcxTreeListControlReportLinkCustomRowProducer = class(TcxTreeListControlReportLinkRowProducer) + private + FItem: TAbstractdxReportCellData; + protected + procedure CreateItem; virtual; + procedure InitializeItem; virtual; + + function GetAutoHeight: Boolean; override; + function GetItemClass: TdxReportCellDataClass; virtual; + + property Item: TAbstractdxReportCellData read FItem; + public + function Produce(AHostInfo: TcxTreeListControlAttributeHostInfo): TdxReportCell; override; + end; + + TcxTreeListControlReportLinkNodeSeparatorProducerClass = class of TcxTreeListControlReportLinkNodeSeparatorProducer; + + TcxTreeListControlReportLinkNodeSeparatorProducer = class(TcxTreeListControlReportLinkCustomRowProducer) + private + function GetItem: TdxReportCellBox; + protected + procedure InitializeItem; override; + procedure InitializeRow; override; + + function GetItemClass: TdxReportCellDataClass; override; + function GetLineHeight: Integer; override; + public + property Item: TdxReportCellBox read GetItem; + end; + + TcxTreeListControlReportLinkRowSubItemsProducerClass = class of TcxTreeListControlReportLinkRowSubItemsProducer; + + TcxTreeListControlReportLinkRowSubItemsProducer = class(TcxTreeListControlReportLinkRowProducer) + private + function GetColumn(Index: Integer): TcxTreeListColumn; + protected + procedure CreateDataItems(AParent: TdxReportCell); virtual; + procedure CreateIcons(AParent: TdxReportCell); virtual; + procedure CreateIndents(AParent: TdxReportCell); virtual; + procedure CreateRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + + function GetHasSubItem(Index: Integer): Boolean; virtual; + function GetSubItemBound(Index: Integer): TRect; virtual; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; virtual; abstract; + function GetSubItemCount: Integer; virtual; + public + property Columns[Index: Integer]: TcxTreeListColumn read GetColumn; + property HasSubItem[Index: Integer]: Boolean read GetHasSubItem; + property SubItemBounds[Index: Integer]: TRect read GetSubItemBound; + property SubItemClasses[Index: Integer]: TdxReportCellDataClass read GetSubItemClass; + property SubItemCount: Integer read GetSubItemCount; + end; + + TcxTreeListControlReportLinkBandsProducerClass = class of TcxTreeListControlReportLinkBandsProducer; + + TcxTreeListControlReportLinkBandsProducer = class(TcxTreeListControlReportLinkRowSubItemsProducer) + protected + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AnIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + function GetSubItemCount: Integer; override; + end; + + TcxTreeListControlReportLinkFootersProducerClass = class of TcxTreeListControlReportLinkFootersProducer; + + TcxTreeListControlReportLinkFootersProducer = class(TcxTreeListControlReportLinkRowSubItemsProducer) + protected + procedure CalculateRowHeight; override; + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AnIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetHasSubItem(Index: Integer): Boolean; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + end; + + TcxTreeListControlReportLinkHeadersProducerClass = class of TcxTreeListControlReportLinkHeadersProducer; + + TcxTreeListControlReportLinkHeadersProducer = class(TcxTreeListControlReportLinkRowSubItemsProducer) + protected + procedure InitializeRow; override; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AnIndex: Integer); override; + + function GetAutoHeight: Boolean; override; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + end; + + TcxTreeListControlReportLinkNodeProducerClass = class of TcxTreeListControlReportLinkNodeProducer; + + TcxTreeListControlReportLinkNodeProducer = class(TcxTreeListControlReportLinkRowSubItemsProducer) + private + FImage: TdxReportCellGraphic; + FIndents: TList; + FNode: TcxTreeListNode; + FPreviewItem: TAbstractdxReportCellData; + FStateImage: TdxReportCellGraphic; + function GetImageIndentIndex: Integer; + function GetIndent(Index: Integer): TdxReportCellExpandButton; + function GetIndentArea: Integer; + function GetIndentBound(Index: Integer): TRect; + function GetPreviewColumn: TcxTreeListColumn; + function GetPreviewPlace: TcxTreeListPreviewPlace; + function GetStateImageIndentIndex: Integer; + protected + procedure CalculateRowAutoHeight; override; + procedure CreateDataItems(AParent: TdxReportCell); override; + procedure CreateIcons(AParent: TdxReportCell); override; + procedure CreateImages(AParent: TdxReportCell); virtual; + procedure CreateIndents(AParent: TdxReportCell); override; + procedure CreatePreview(AParent: TdxReportCell); virtual; + procedure CreateStateImages(AParent: TdxReportCell); virtual; + function DoesItemParticipateInRowAutoHeightCalculation(AnItem: TdxReportVisualItem): Boolean; override; + procedure FixupRowDataHeight; override; + procedure InitializeImage(AnIndex: Integer); virtual; + procedure InitializeIndent(AnIndent: TdxReportCellExpandButton; AnIndex: Integer); virtual; + procedure InitializeRow; override; + procedure InitializeStateImage(AnIndex: Integer); virtual; + procedure InitializeSubItem(ASubItem: TAbstractdxReportCellData; AnIndex: Integer); override; + function IsItemIndent(AnItem: TdxReportVisualItem): Boolean; + + function GetAutoHeight: Boolean; override; + function GetCellAutoHeight: Boolean; virtual; + function GetHasPreview: Boolean; virtual; + function GetImageRect: TRect; virtual; + function GetIndentCount: Integer; virtual; + function GetLineCount: Integer; override; + function GetLineHeight: Integer; override; + function GetPreviewHeight: Integer; virtual; + function GetPreviewIndent: Integer; virtual; + function GetPreviewLineCount: Integer; virtual; + function GetPreviewLineHeight: Integer; virtual; + function GetStateImageRect: TRect; virtual; + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemClass(Index: Integer): TdxReportCellDataClass; override; + public + constructor Create(ABuilder: TcxTreeListControlReportLinkBuilder); override; + destructor Destroy; override; + + function Node: TcxTreeListNode; overload; virtual; + function Produce(AHostInfo: TcxTreeListControlAttributeHostInfo; ANode: TcxTreeListNode): TdxReportCell; reintroduce; virtual; + + property CellAutoHeight: Boolean read GetCellAutoHeight; + property HasPreview: Boolean read GetHasPreview; + property Image: TdxReportCellGraphic read FImage; + property ImageIndentIndex: Integer read GetImageIndentIndex; + property ImageRect: TRect read GetImageRect; + property IndentArea: Integer read GetIndentArea; + property IndentBounds[Index: Integer]: TRect read GetIndentBound; + property IndentCount: Integer read GetIndentCount; + property Indents[Index: Integer]: TdxReportCellExpandButton read GetIndent; + property PreviewColumn: TcxTreeListColumn read GetPreviewColumn; + property PreviewHeight: Integer read GetPreviewHeight; + property PreviewIndent: Integer read GetPreviewIndent; + property PreviewItem: TAbstractdxReportCellData read FPreviewItem; + property PreviewLineCount: Integer read GetPreviewLineCount; + property PreviewLineHeight: Integer read GetPreviewLineHeight; + property PreviewPlace: TcxTreeListPreviewPlace read GetPreviewPlace; + property StateImage: TdxReportCellGraphic read FStateImage; + property StateImageIndentIndex: Integer read GetStateImageIndentIndex; + property StateImageRect: TRect read GetStateImageRect; + end; + + TcxTreeListControlReportLinkCategorizedNodeProducer = class(TcxTreeListControlReportLinkNodeProducer) + protected + function GetSubItemBound(Index: Integer): TRect; override; + function GetSubItemCount: Integer; override; + end; + + { helpers } + + TcxTreeListNodeHelperClass = class of TcxTreeListNodeHelper; + + TcxTreeListNodeHelper = class(TdxCustomClassMapItem) + private + FAdapter: TcxTreeListControlAdapter; + FNode: TcxTreeListNode; + protected + function Adapter: TcxTreeListControlAdapter; overload; virtual; + class function NodeClass: TcxTreeListNodeClass; virtual; + + function GetHasSelectedChildren: Boolean; virtual; + function GetHasSelectedParents: Boolean; virtual; + public + constructor Create(AnAdapter: TcxTreeListControlAdapter); virtual; + + class function PairClass: TClass; override; + class function ProducerClass: TcxTreeListControlReportLinkNodeProducerClass; virtual; + class procedure Register; + class procedure Unregister; + + property HasSelectedChildren: Boolean read GetHasSelectedChildren; + property HasSelectedParents: Boolean read GetHasSelectedParents; + property Node: TcxTreeListNode read FNode write FNode; + end; + + TcxTreeListNodeHelperCache = class(TdxCustomCache) + private + FAdapter: TcxTreeListControlAdapter; + function GetHelper(Node: TcxTreeListNode): TcxTreeListNodeHelper; + function GetItem(Index: Integer): TcxTreeListNodeHelper; + protected + function IndexOf(Node: TcxTreeListNode): Integer; + property Items[Index: Integer]: TcxTreeListNodeHelper read GetItem; + public + constructor Create(AnAdapter: TcxTreeListControlAdapter); + + property Adapter: TcxTreeListControlAdapter read FAdapter; + property Helpers[Node: TcxTreeListNode]: TcxTreeListNodeHelper read GetHelper; default; + end; + + TcxTreeListControlReportLinkProducerCache = class(TdxCustomCache) + private + FBuilder: TcxTreeListControlReportLinkBuilder; + function GetItem(Index: Integer): TcxTreeListControlReportLinkRowProducer; + function GetProducer(ProducerClass: TcxTreeListControlReportLinkRowProducerClass): TcxTreeListControlReportLinkRowProducer; + protected + function IndexOf(AProducerClass: TcxTreeListControlReportLinkRowProducerClass): Integer; + property Items[Index: Integer]: TcxTreeListControlReportLinkRowProducer read GetItem; + public + constructor Create(ABuilder: TcxTreeListControlReportLinkBuilder); + property Builder: TcxTreeListControlReportLinkBuilder read FBuilder; + property Producers[ProducerClass: TcxTreeListControlReportLinkRowProducerClass]: TcxTreeListControlReportLinkRowProducer read GetProducer; default; + end; + + TcxTreeListControlReportLinkBuilder = class + private + FAdapter: TcxTreeListControlAdapter; + FFormatter: TcxTreeListControlReportLinkFormatter; + FProducerCache: TcxTreeListControlReportLinkProducerCache; + FReportLink: TcxTreeListControlReportLink; + FReportRows: TList; + function GetAutoWidth: Boolean; + function GetAvailableWidth: Integer; + function GetHost: TdxReportCell; + function GetReportCells: TdxReportCells; + function GetReportRow(Index: Integer): TdxReportCell; + function GetReportRowCount: Integer; + function GetTreeListControl: TcxCustomTreeListControl; + protected + procedure AddReportRow(ARow: TdxReportCell); + procedure AfterBuilding; virtual; + procedure BeforeBuilding; virtual; + { bands } + procedure CreateBands; virtual; + function GetBandsProducer: TcxTreeListControlReportLinkBandsProducer; + function GetBandsProducerClass: TcxTreeListControlReportLinkBandsProducerClass; virtual; + { footers } + procedure CreateFooters; virtual; + function GetFootersProducer: TcxTreeListControlReportLinkFootersProducer; + function GetFootersProducerClass: TcxTreeListControlReportLinkFootersProducerClass; virtual; + { headers } + procedure CreateHeaders; virtual; + function GetHeadersProducer: TcxTreeListControlReportLinkHeadersProducer; + function GetHeadersProducerClass: TcxTreeListControlReportLinkHeadersProducerClass; virtual; + { nodes } + procedure CreateNode(ANode: TcxTreeListNode); virtual; + procedure CreateNodes; virtual; + function GetNodeProducer(ANode: TcxTreeListNode): TcxTreeListControlReportLinkNodeProducer; + function GetNodeProducerClass(ANode: TcxTreeListNode): TcxTreeListControlReportLinkNodeProducerClass; virtual; + { separators } + procedure CreateNodeSeparator(ANode: TcxTreeListNode); virtual; + function GetNodeSeparatorProducer: TcxTreeListControlReportLinkNodeSeparatorProducer; + function GetNodeSeparatorProducerClass: TcxTreeListControlReportLinkNodeSeparatorProducerClass; virtual; + + procedure DoBuild; virtual; + function IsAborted: Boolean; + + property ProducerCache: TcxTreeListControlReportLinkProducerCache read FProducerCache; + property ReportLink: TcxTreeListControlReportLink read FReportLink; + public + constructor Create(AReportLink: TcxTreeListControlReportLink); virtual; + destructor Destroy; override; + + procedure Build; virtual; + procedure Progress(const APercentDone: Double); + + function Adapter: TcxTreeListControlAdapter; overload; virtual; + class function AdapterClass: TcxTreeListControlAdapterClass; virtual; + function Formatter: TcxTreeListControlReportLinkFormatter; overload; virtual; + class function FormatterClass: TcxTreeListControlReportLinkFormatterClass; virtual; + + property AutoWidth: Boolean read GetAutoWidth; + property AvailableWidth: Integer read GetAvailableWidth; + property Host: TdxReportCell read GetHost; + property ReportCells: TdxReportCells read GetReportCells; + property ReportRowCount: Integer read GetReportRowCount; + property ReportRows[Index: Integer]: TdxReportCell read GetReportRow; + property TreeListControl: TcxCustomTreeListControl read GetTreeListControl; + end; + + TcxTreeListReportLinkBuilderHandler = class + private + FBuilder: TcxTreeListControlReportLinkBuilder; + function GetReportLink: TcxTreeListControlReportLink; + public + constructor Create(ABuilder: TcxTreeListControlReportLinkBuilder); virtual; + function Builder: TcxTreeListControlReportLinkBuilder; overload; virtual; + + property ReportLink: TcxTreeListControlReportLink read GetReportLink; + end; + + TcxTreeListControlAdapter = class(TcxTreeListReportLinkBuilderHandler) + private + FAutoWidth: Boolean; + FAvailableWidth: Integer; + FBandLineCount: Integer; + FBandPlaces: array of TRect; + FBandWidths: array of Integer; + FColumnPlaces: array of TdxTLColumnPlace; + FColumnWidths: array of Integer; + FDetailsLineCount: Integer; + FFooterLineCount: Integer; + FHelperCache: TcxTreeListNodeHelperCache; + function GetBand(Index: Integer): TcxTreeListBand; + function GetBandCount: Integer; + function GetBandOrigin(Index: Integer): Integer; + function GetBandPlace(Index: Integer): TRect; + function GetBandWidth(Index: Integer): Integer; + function GetCanUseLookAndFeelColors: Boolean; + function GetCategorizedColumn: TcxTreeListColumn; + function GetCellAutoHeight: Boolean; + function GetCellEndEllipsis: Boolean; + function GetCellMultiline: Boolean; + function GetColumn(Index: Integer): TcxTreeListColumn; + function GetColumnCount: Integer; + function GetColumnPlace(Index: Integer): TdxTLColumnPlace; + function GetColumnWidth(Index: Integer): Integer; + function GetDefaultRowHeight: Integer; + function GetFooterItemText(Index: Integer): string; + function GetGridLines: TcxTreeListGridLines; + function GetGridLinesColor: TColor; + function GetHasFooterItem(Index: Integer): Boolean; + function GetHasPreview: Boolean; + function GetHeaderAutoHeight: Boolean; + function GetHelper(Node: TcxTreeListNode): TcxTreeListNodeHelper; + function GetImages: TCustomImageList; + function GetIndentWidth: Integer; + function GetIsDefaultRowHeightAssigned: Boolean; + function GetIsNodeColorUsedForIndents: Boolean; + function GetLookAndFeelKind: TcxLookAndFeelKind; + function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; + function GetMultiSelection: Boolean; + function GetNode(Index: Integer): TcxTreeListNode; + function GetNodeCount: Integer; + function GetOptionsView: TcxTreeListOptionsView; + function GetPaintStyle: TcxTreeListPaintStyle; + function GetPreviewColumn: TcxTreeListColumn; + function GetPreviewLeftIndent: Integer; + function GetPreviewPlace: TcxTreeListPreviewPlace; + function GetPreviewRightIndent: Integer; + function GetShowRoot: Boolean; + function GetShowHorzGridLines: Boolean; + function GetShowTreeLines: Boolean; + function GetShowVertGridLines: Boolean; + function GetStateImages: TCustomImageList; + function GetStyles: TcxTreeListStyles; + function GetThemedBandHeaderItemColor: TColor; + function GetThemedBandHeaderItemTextColor: TColor; + function GetThemedFooterItemColor: TColor; + function GetThemedFooterItemTextColor: TColor; + function GetThemedHeaderItemColor: TColor; + function GetThemedHeaderItemTextColor: TColor; + function GetThemedHeaderRowColor: TColor; + function GetTreeLinesColor: TColor; + function GetTreeLinesStyle: TcxTreeListTreeLineStyle; + function GetTreeListControl: TcxCustomTreeListControl; + function GetUseStylesForIndents: Boolean; + function GetViewWidth: Integer; + protected + procedure AfterBuilding; virtual; + procedure BeforeBuilding; virtual; + + procedure AfterCalculate; virtual; + procedure BeforeCalculate; virtual; + procedure Calculate(AAvailableWidth: Integer; AnAutoWidth: Boolean); virtual; + procedure CalculateBandPlaces; virtual; + procedure CalculateBandWidths; virtual; + procedure CalculateColumnPlaces; virtual; + procedure CalculateColumnWidths; virtual; + procedure CalculateLineCounts; virtual; + procedure DoCalculate; virtual; + { properties } + class function GetProperties(AColumn: TcxTreeListColumn; ANode: TcxTreeListNode): TcxCustomEditProperties; + class function GetPropertiesClass(AColumn: TcxTreeListColumn; ANode: TcxTreeListNode): TcxCustomEditPropertiesClass; + class function GetRepositoryItem(AColumn: TcxTreeListColumn; ANode: TcxTreeListNode): TcxEditRepositoryItem; + { styles } + function GetBackgroundViewParams: TcxViewParams; virtual; + function GetBandBackgroundViewParams: TcxViewParams; virtual; + function GetBandHeaderViewParams(ABand: TcxTreeListBand): TcxViewParams; virtual; + function GetColumnFooterViewParams(AColumn: TcxTreeListColumn): TcxViewParams; virtual; + function GetColumnHeaderViewParams(AColumn: TcxTreeListColumn): TcxViewParams; virtual; + function GetContentViewParams(ANode: TcxTreeListNode; AColumn: TcxTreeListColumn): TcxViewParams; virtual; + function GetIndentViewParams(ANode: TcxTreeListNode; AnIndent: Integer): TcxViewParams; virtual; + function GetPreviewViewParams(ANode: TcxTreeListNode; AColumn: TcxTreeListColumn): TcxViewParams; virtual; + function GetFooterRowViewParams: TcxViewParams; virtual; + function GetSelectionViewParams: TcxViewParams; virtual; + function HasSelectionStyle: Boolean; + { Backgrounds } + function GetBackgroundBitmap(Index: Integer): TBitmap; + function HasBackgroundBitmap(Index: Integer): Boolean; + + function GetImagesHeight(ANode: TcxTreeListNode): Integer; + function GetImagesWidth(ANode: TcxTreeListNode): Integer; + function GetStateImagesHeight(ANode: TcxTreeListNode): Integer; + function GetStateImagesWidth(ANode: TcxTreeListNode): Integer; + function HasImages(ANode: TcxTreeListNode): Boolean; + function HasStateImages(ANode: TcxTreeListNode): Boolean; + function IsGroupNode(ANode: TcxTreeListNode): Boolean; + + property AutoWidth: Boolean read FAutoWidth write FAutoWidth; + property Helpers[Node: TcxTreeListNode]: TcxTreeListNodeHelper read GetHelper; + property LookAndFeelKind: TcxLookAndFeelKind read GetLookAndFeelKind; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter; + property OptionsView: TcxTreeListOptionsView read GetOptionsView; + property Styles: TcxTreeListStyles read GetStyles; + property TreeListControl: TcxCustomTreeListControl read GetTreeListControl; + property ViewWidth: Integer read GetViewWidth; + public + constructor Create(ABuilder: TcxTreeListControlReportLinkBuilder); override; + destructor Destroy; override; + + property AvailableWidth: Integer read FAvailableWidth write FAvailableWidth; + property BandCount: Integer read GetBandCount; + property BandLineCount: Integer read FBandLineCount write FBandLineCount; + property BandOrigins[Index: Integer]: Integer read GetBandOrigin; + property BandPlaces[Index: Integer]: TRect read GetBandPlace; + property Bands[Index: Integer]: TcxTreeListBand read GetBand; + property BandWidths[Index: Integer]: Integer read GetBandWidth; + property CanUseLookAndFeelColors: Boolean read GetCanUseLookAndFeelColors; + property CategorizedColumn: TcxTreeListColumn read GetCategorizedColumn; + property CellAutoHeight: Boolean read GetCellAutoHeight; + property CellEndEllipsis: Boolean read GetCellEndEllipsis; + property CellMultiline: Boolean read GetCellMultiline; + property ColumnCount: Integer read GetColumnCount; + property ColumnPlaces[Index: Integer]: TdxTLColumnPlace read GetColumnPlace; + property Columns[Index: Integer]: TcxTreeListColumn read GetColumn; + property ColumnWidths[Index: Integer]: Integer read GetColumnWidth; + property DefaultRowHeight: Integer read GetDefaultRowHeight; + property DetailsLineCount: Integer read FDetailsLineCount write FDetailsLineCount; + property FooterItemTexts[Index: Integer]: string read GetFooterItemText; + property FooterLineCount: Integer read FFooterLineCount write FFooterLineCount; + property GridLines: TcxTreeListGridLines read GetGridLines; + property GridLinesColor: TColor read GetGridLinesColor; + property HasFooterItem[Index: Integer]: Boolean read GetHasFooterItem; + property HasPreview: Boolean read GetHasPreview; + property HeaderAutoHeight: Boolean read GetHeaderAutoHeight; + property Images: TCustomImageList read GetImages; + property IndentWidth: Integer read GetIndentWidth; + property IsDefaultRowHeightAssigned: Boolean read GetIsDefaultRowHeightAssigned; + property IsNodeColorUsedForIndents: Boolean read GetIsNodeColorUsedForIndents; + property MultiSelection: Boolean read GetMultiSelection; + property PaintStyle: TcxTreeListPaintStyle read GetPaintStyle; + property PreviewColumn: TcxTreeListColumn read GetPreviewColumn; + property PreviewLeftIndent: Integer read GetPreviewLeftIndent; + property PreviewPlace: TcxTreeListPreviewPlace read GetPreviewPlace; + property PreviewRightIndent: Integer read GetPreviewRightIndent; + property NodeCount: Integer read GetNodeCount; + property Nodes[Index: Integer]: TcxTreeListNode read GetNode; + property ShowRoot: Boolean read GetShowRoot; + property ShowHorzGridLines: Boolean read GetShowHorzGridLines; + property ShowTreeLines: Boolean read GetShowTreeLines; + property ShowVertGridLines: Boolean read GetShowVertGridLines; + property StateImages: TCustomImageList read GetStateImages; + property ThemedBandHeaderItemColor: TColor read GetThemedBandHeaderItemColor; + property ThemedBandHeaderItemTextColor: TColor read GetThemedBandHeaderItemTextColor; + property ThemedFooterItemColor: TColor read GetThemedFooterItemColor; + property ThemedFooterItemTextColor: TColor read GetThemedFooterItemTextColor; + property ThemedHeaderItemColor: TColor read GetThemedHeaderItemColor; + property ThemedHeaderItemTextColor: TColor read GetThemedHeaderItemTextColor; + property ThemedHeaderRowColor: TColor read GetThemedHeaderRowColor; + property TreeLinesColor: TColor read GetTreeLinesColor; + property TreeLinesStyle: TcxTreeListTreeLineStyle read GetTreeLinesStyle; + property UseStylesForIndents: Boolean read GetUseStylesForIndents; + end; + + TcxTreeListControlReportLinkFormatter = class(TcxTreeListReportLinkBuilderHandler, + IUnknown, IdxPSCellParams, IdxPSCellParams2) + private + FBandLineHeight: Integer; + FDetailsLineHeight: Integer; + FFont: TFont; + FFooterLineHeight: Integer; + FHeaderLineHeight: Integer; + FLookAndFeelItems: TList; + FNodes: TList; + FPreviewLineHeight: Integer; + FTransparentColor: TColor; + function GetAutoWidth: Boolean; + function GetDC: HDC; + function GetExpandButtonColor: TColor; + function GetExpandButtonSize: Integer; + function GetGridLinesColor: TColor; + function GetHasNodeSeparator: Boolean; + function GetHasPreview: Boolean; + function GetIndentCount(Node: TcxTreeListNode): Integer; + function GetIsNodeColorUsedForIndents: Boolean; + function GetLookAndFeelItem(Index: Integer): TdxReportVisualItem; + function GetLookAndFeelItemCount: Integer; + function GetNode(Index: Integer): TcxTreeListNode; + function GetNodeCount: Integer; + function GetNodeSeparatorColor: TColor; + function GetNodeSeparatorThickness: Integer; + function GetPreviewAutoHeight: Boolean; + function GetPreviewColumn: TcxTreeListColumn; + function GetPreviewMaxLineCount: Integer; + function GetRenderer: TdxPSReportRenderer; + function GetShowBandHeaders: Boolean; + function GetShowFooters: Boolean; + function GetShowHeaders: Boolean; + function GetShowPreview: Boolean; + function GetUseLookAndFeelColors: Boolean; + function GetViewWidth: Integer; + function GetTreeLinesColor: TColor; + function GetTreeLinesStyle: TcxTreeListTreeLineStyle; + + procedure FormatLookAndFeelItems; + protected + { IUnknown } + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + { IdxPSCellParams } + function IdxPSCellParams.GetAutoHeight = IdxPSCellParams_GetAutoHeight; + function IdxPSCellParams.GetDC = IdxPSCellParams_GetDC; + function IdxPSCellParams.GetDisplayGraphicsAsText = IdxPSCellParams_GetDisplayGraphicsAsText; + function IdxPSCellParams.GetEndEllipsis = IdxPSCellParams_GetEndEllipsis; + function IdxPSCellParams.GetFlatCheckMarks = IdxPSCellParams_GetFlatCheckMarks; + function IdxPSCellParams.GetGraphicsText = IdxPSCellParams_GetGraphicsText; + function IdxPSCellParams.GetMultiline = IdxPSCellParams_GetMultiline; + function IdxPSCellParams.GetTransparentGraphics = IdxPSCellParams_GetTransparentGraphics; + function IdxPSCellParams_GetAutoHeight: Boolean; virtual; + function IdxPSCellParams_GetDC: HDC; virtual; + function IdxPSCellParams_GetDisplayGraphicsAsText: Boolean; virtual; + function IdxPSCellParams_GetEndEllipsis: Boolean; virtual; + function IdxPSCellParams_GetFlatCheckMarks: Boolean; virtual; + function IdxPSCellParams_GetGraphicsText: string; virtual; + function IdxPSCellParams_GetMultiline: Boolean; virtual; + function IdxPSCellParams_GetTransparentGraphics: Boolean; virtual; + { IdxPSCellParams2 } + function IdxPSCellParams2.GetPreviewMarginLeft = IdxPSCellParams2_GetPreviewMarginLeft; + function IdxPSCellParams2.GetPreviewMarginRight = IdxPSCellParams2_GetPreviewMarginRight; + function IdxPSCellParams2.GetPreviewMaxHeight = IdxPSCellParams2_GetPreviewMaxHeight; + function IdxPSCellParams2.GetPreviewMaxLineCount = IdxPSCellParams2_GetPreviewMaxLineCount; + function IdxPSCellParams2.GetRichEditGraphicClass = IdxPSCellParams2_GetRichEditGraphicClass; + function IdxPSCellParams2.GetRichEditTransparent = IdxPSCellParams2_GetRichEditTransparent; + function IdxPSCellParams2_GetPreviewMarginLeft: Integer; virtual; + function IdxPSCellParams2_GetPreviewMarginRight: Integer; virtual; + function IdxPSCellParams2_GetPreviewMaxHeight: Integer; virtual; + function IdxPSCellParams2_GetPreviewMaxLineCount: Integer; virtual; + function IdxPSCellParams2_GetRichEditGraphicClass: TGraphicClass; virtual; + function IdxPSCellParams2_GetRichEditTransparent: Boolean; virtual; + + procedure AddDelimiters; virtual; + procedure AddHorizontalDelimiters; virtual; + procedure AddVerticalDelimiters; virtual; + procedure AfterBuilding; virtual; + procedure BeforeBuilding; virtual; + procedure CalculateLineHeights; virtual; + function CanProcessSelectionStyle(ANode: TcxTreeListNode): Boolean; + procedure CreateNodeList; virtual; + function IsSelectedNode(ANode: TcxTreeListNode): Boolean; virtual; + + function GetBackgroundBitmap(Index: Integer): TBitmap; + function GetBackgroundBitmapIndex(Index: Integer): Integer; + function HasBackgroundBitmap(Index: Integer): Boolean; + function MapStyleBackgroundBitmapIndex(ATreeListBackgroundBitmapIndex: Integer): Integer; + + procedure CalculateHeight(const AParams: TdxReportItemViewParams; var AHeight: Integer); + function CalculatePatternHeight(const AParams: TdxReportItemViewParams): Integer; + function GetNodeParent(ANode: TcxTreeListNode; ALevel: Integer): TcxTreeListNode; + function GetNextNode(ANode: TcxTreeListNode): TcxTreeListNode; + function GetPrevNode(ANode: TcxTreeListNode): TcxTreeListNode; + function GetStyleFontIndex(const AParams: TdxReportItemViewParams): Integer; + function HasParent(ANode: TcxTreeListNode): Boolean; + function IndexOfNode(ANode: TcxTreeListNode): Integer; + function IsColorTransparent(AColor: TColor): Boolean; + function IsFirstNode(ANode: TcxTreeListNode): Boolean; + function IsLastNode(ANode: TcxTreeListNode): Boolean; + function IsNodeExpanded(ANode: TcxTreeListNode): Boolean; + function IsNodeFirstChild(ANode: TcxTreeListNode): Boolean; + function IsNodeLastChild(ANode: TcxTreeListNode): Boolean; + function IsOddNode(ANode: TcxTreeListNode): Boolean; + function IsNodeSelected(ANode: TcxTreeListNode): Boolean; + procedure RegisterLookAndFeelItem(AnItem: TdxReportVisualItem; AEdgeStyle: TdxCellEdgeStyle); + procedure SetViewParams(AnItem: TdxReportVisualItem; const AParams: TdxReportItemViewParams); + + function MakeIndentIndex(AnIndex: Integer): DWORD; + + property DC: HDC read GetDC; + property LookAndFeelItemCount: Integer read GetLookAndFeelItemCount; + property LookAndFeelItems[Index: Integer]: TdxReportVisualItem read GetLookAndFeelItem; + property Renderer: TdxPSReportRenderer read GetRenderer; + property ViewWidth: Integer read GetViewWidth; + public + constructor Create(ABuilder: TcxTreeListControlReportLinkBuilder); override; + destructor Destroy; override; + + function Adapter: TcxTreeListControlAdapter; overload; virtual; + + procedure DoInitializeHost(AHost: TdxReportCell); virtual; + { Bands } + procedure DoInitializeBandItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + procedure DoInitializeBandRow(ARow: TdxReportCell); virtual; + procedure DoReportLinkInitializeBandItem(AnItem: TAbstractdxReportCellData; AIndex: Integer); virtual; + function GetBandBackgroundViewParams: TdxReportItemViewParams; virtual; + function GetBandItemClass(Index: Integer): TdxReportCellTextClass; virtual; + function GetBandItemBounds(Index: Integer): TRect; + function GetBandItemViewParams(ABand: TcxTreeListBand): TdxReportItemViewParams; virtual; + { Footers } + procedure DoInitializeFooterItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + procedure DoInitializeFooterRow(ARow: TdxReportCell); virtual; + procedure DoReportLinkInitializeFooterItem(AnItem: TAbstractdxReportCellData; AIndex: Integer); virtual; + function GetFooterItemBounds(Index: Integer): TRect; virtual; + function GetFooterItemClass(AnIndex: Integer): TdxReportCellTextClass; virtual; + function GetFooterItemViewParams(AColumn: TcxTreeListColumn): TdxReportItemViewParams; virtual; + function GetFooterRowViewParams: TdxReportItemViewParams; virtual; + { Headers } + procedure DoInitializeHeaderItem(AnItem: TAbstractdxReportCellData; AnIndex: Integer); virtual; + procedure DoInitializeHeaderRow(ARow: TdxReportCell); virtual; + procedure DoReportLinkInitializeHeaderItem(AnItem: TAbstractdxReportCellData; AIndex: Integer); virtual; + function GetHeaderItemBounds(Index: Integer): TRect; virtual; + function GetHeaderItemClass(AnIndex: Integer): TdxReportCellTextClass; virtual; + function GetHeaderItemViewParams(AColumn: TcxTreeListColumn): TdxReportItemViewParams; virtual; + { Images } + procedure DoInitializeNodeImage(AnItem: TdxReportCellGraphic; ANode: TcxTreeListNode; AnIndex: Integer); virtual; + procedure DoReportLinkInitializeNodeImage(AnItem: TAbstractdxReportCellData; ANode: TcxTreeListNode; AnIndex: Integer); virtual; + function GetNodeImageCellSides(ANode: TcxTreeListNode; AnIndex: Integer): TdxCellSides; + function GetNodeImageClass: TdxReportCellGraphicClass; virtual; + function GetNodeImageViewParams(ANode: TcxTreeListNode; AnIndex: Integer): TdxReportItemViewParams; virtual; + { Indents and Expand Buttons } + procedure DoInitializeNodeIndent(AnItem: TdxReportCellExpandButton; AnIndex, AnIndentCount: Integer; ANode: TcxTreeListNode); virtual; + procedure DoInitializeExpandButton(AnItem: TdxReportCellExpandButton; AnIndex, AnIndentCount: Integer; ANode: TcxTreeListNode); virtual; + procedure DoReportLinkInitializeNodeIndent(AnItem: TAbstractdxReportCellData; AnIndex, AnIndentCount: Integer; ANode: TcxTreeListNode); virtual; + function GetNodeIndentCellSides(ANode: TcxTreeListNode; AnIndex, AnIndentCount: Integer): TdxCellSides; virtual; + function GetNodeIndentClass: TdxReportCellExpandButtonClass; virtual; + function GetNodeIndentTreeLineMode(AnIndex, AnIndentCount: Integer; ANode: TcxTreeListNode): TdxPSTreeLineMode; + function GetNodeIndentViewParams(ANode: TcxTreeListNode; AnIndex, AnIndentCount: Integer): TdxReportItemViewParams; virtual; + { Nodes } + procedure DoInitializeNodeRow(ARow: TdxReportCell; ANode: TcxTreeListNode); virtual; + procedure DoInitializeNodeItem(AnItem: TAbstractdxReportCellData; + AColumn: TcxTreeListColumn; ANode: TcxTreeListNode; AnIsPreview: Boolean = False); virtual; + procedure DoReportLinkInitializeNodeItem(AnItem: TAbstractdxReportCellData; + AColumn: TcxTreeListColumn; ANode: TcxTreeListNode); virtual; + function GetCellValue(AProperties: TcxCustomEditProperties; + AColumn: TcxTreeListColumn; ANode: TcxTreeListNode): TcxEditValue; virtual; + function GetNodeBackgroundBitmapStyleIndex(ANode: TcxTreeListNode): Integer; + function GetNodeItemBounds(ANode: TcxTreeListNode; Index, IndentCount: Integer): TRect; virtual; + function GetNodeItemCellSides(AColumn: TcxTreeListColumn; ANode: TcxTreeListNode): TdxCellSides; + function GetNodeItemClass(AColumn: TcxTreeListColumn; ANode: TcxTreeListNode; + AnIsPreview: Boolean = False): TdxReportCellDataClass; virtual; + function GetNodeItemViewParams(AColumn: TcxTreeListColumn; ANode: TcxTreeListNode): TdxReportItemViewParams; virtual; + { Preview } + procedure DoInitializePreview(AnItem: TAbstractdxReportCellData; AColumn: TcxTreeListColumn; ANode: TcxTreeListNode); virtual; + function GetPreviewCellSides(ANode: TcxTreeListNode): TdxCellSides; virtual; + function GetPreviewClass(AColumn: TcxTreeListColumn; ANode: TcxTreeListNode): TdxReportCellDataClass; virtual; + function GetPreviewViewParams(AColumn: TcxTreeListColumn; ANode: TcxTreeListNode): TdxReportItemViewParams; virtual; + { Separators } + procedure DoInitializeNodeSeparator(AnItem: TdxReportCellBox); virtual; + procedure DoInitializeNodeSeparatorRow(ARow: TdxReportCell); virtual; + function GetNodeSeparatorClass: TdxReportCellBoxClass; virtual; + { State images } + procedure DoInitializeNodeStateImage(AnItem: TdxReportCellGraphic; ANode: TcxTreeListNode; AnIndex: Integer); virtual; + procedure DoReportLinkInitializeNodeStateImage(AnItem: TAbstractdxReportCellData; ANode: TcxTreeListNode; AnIndex: Integer); virtual; + function GetNodeStateImageCellSides(ANode: TcxTreeListNode; AnIndex: Integer): TdxCellSides; virtual; + function GetNodeStateImageClass: TdxReportCellGraphicClass; virtual; + function GetNodeStateImageViewParams(ANode: TcxTreeListNode; AnIndex: Integer): TdxReportItemViewParams; virtual; + + property AutoWidth: Boolean read GetAutoWidth; + property BandLineHeight: Integer read FBandLineHeight write FBandLineHeight; + property DetailsLineHeight: Integer read FDetailsLineHeight write FDetailsLineHeight; + property ExpandButtonColor: TColor read GetExpandButtonColor; + property ExpandButtonSize: Integer read GetExpandButtonSize; + property FooterLineHeight: Integer read FFooterLineHeight write FFooterLineHeight; + property GridLinesColor: TColor read GetGridLinesColor; + property HasNodeSeparator: Boolean read GetHasNodeSeparator; + property HasPreview: Boolean read GetHasPreview; + property HeaderLineHeight: Integer read FHeaderLineHeight write FHeaderLineHeight; + property IndentCounts[Node: TcxTreeListNode]: Integer read GetIndentCount; + property IsNodeColorUsedForIndents: Boolean read GetIsNodeColorUsedForIndents; + property NodeCount: Integer read GetNodeCount; + property Nodes[Index: Integer]: TcxTreeListNode read GetNode; + property NodeSeparatorColor: TColor read GetNodeSeparatorColor; + property NodeSeparatorThickness: Integer read GetNodeSeparatorThickness; + property PreviewAutoHeight: Boolean read GetPreviewAutoHeight; + property PreviewColumn: TcxTreeListColumn read GetPreviewColumn; + property PreviewLineHeight: Integer read FPreviewLineHeight write FPreviewLineHeight; + property PreviewMaxLineCount: Integer read GetPreviewMaxLineCount; + property ShowBandHeaders: Boolean read GetShowBandHeaders; + property ShowFooters: Boolean read GetShowFooters; + property ShowHeaders: Boolean read GetShowHeaders; + property ShowPreview: Boolean read GetShowPreview; + property UseLookAndFeelColors: Boolean read GetUseLookAndFeelColors; + property TransparentColor: TColor read FTransparentColor write FTransparentColor default clWindow; + property TreeLinesColor: TColor read GetTreeLinesColor; + property TreeLinesStyle: TcxTreeListTreeLineStyle read GetTreeLinesStyle; + end; + + { Options } + + TcxTreeListReportLinkOptionsExpanding = class(TdxCustomReportLinkOptionsExpanding) + private + FAutoExpandNodes: Boolean; + FExplicitlyExpandNodes: Boolean; + function GetReportLink: TcxTreeListControlReportLink; + procedure SetAutoExpandNodes(Value: Boolean); + procedure SetExplicitlyExpandNodes(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + property ReportLink: TcxTreeListControlReportLink read GetReportLink; + published + property AutoExpandNodes: Boolean read FAutoExpandNodes write SetAutoExpandNodes default False; + property ExplicitlyExpandNodes: Boolean read FExplicitlyExpandNodes write SetExplicitlyExpandNodes default False; + end; + + TcxTreeListReportLinkOptionsFormatting = class(TdxCustomReportLinkOptionsFormatting) + private + FConsumeSelectionStyle: Boolean; + FNodeSeparatorColor: TColor; + FNodeSeparatorThickness: Integer; + function GetActualNodeSeparatorColor: TColor; + function GetReportLink: TcxTreeListControlReportLink; + procedure SetConsumeSelectionStyle(Value: Boolean); + procedure SetNodeSeparatorColor(Value: TColor); + procedure SetNodeSeparatorThickness(Value: Integer); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + + property ActualNodeSeparatorColor: TColor read GetActualNodeSeparatorColor; + property ReportLink: TcxTreeListControlReportLink read GetReportLink; + published + property ConsumeSelectionStyle: Boolean read FConsumeSelectionStyle write SetConsumeSelectionStyle default False; + property NodeSeparatorColor: TColor read FNodeSeparatorColor write SetNodeSeparatorColor default clDefault; + property NodeSeparatorThickness: Integer read FNodeSeparatorThickness write SetNodeSeparatorThickness default 0; + property UseLookAndFeelColors; + end; + + TcxTreeListReportLinkOptionsOnEveryPage = class(TdxCustomTableControlReportLinkOptionsOnEveryPage) + private + function GetReportLink: TcxTreeListControlReportLink; + protected + function DesignerTabIndex: Integer; override; + public + property ReportLink: TcxTreeListControlReportLink read GetReportLink; + published + property BandHeaders; + property Footers; + property Headers; + end; + + TcxTreeListReportLinkOptionsPagination = class(TdxCustomTableControlReportLinkOptionsPagination) + private + function GetNode: Boolean; + function GetReportLink: TcxTreeListControlReportLink; + procedure SetNode(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + property ReportLink: TcxTreeListControlReportLink read GetReportLink; + published + property Band; + property Column; + property Custom; + property Node: Boolean read GetNode write SetNode default True; + end; + + TcxTreeListReportLinkOptionsPreview = class(TdxCustomTableControlReportLinkOptionsPreview) + private + function GetReportLink: TcxTreeListControlReportLink; + protected + function DesignerTabIndex: Integer; override; + public + property ReportLink: TcxTreeListControlReportLink read GetReportLink; + end; + + TcxTreeListReportLinkOptionsRefinements = class(TdxCustomReportLinkOptionsRefinements) + private + function GetReportLink: TcxTreeListControlReportLink; + protected + function DesignerTabIndex: Integer; override; + public + property ReportLink: TcxTreeListControlReportLink read GetReportLink; + end; + + TcxTreeListReportLinkOptionsSelection = class(TdxCustomTableControlReportLinkOptionsSelection) + private + function GetReportLink: TcxTreeListControlReportLink; + protected + function DesignerTabIndex: Integer; override; + public + property ReportLink: TcxTreeListControlReportLink read GetReportLink; + end; + + TcxTreeListReportLinkOptionsSize = class(TdxCustomReportLinkOptionsSize) + private + function GetReportLink: TcxTreeListControlReportLink; + protected + function DesignerTabIndex: Integer; override; + public + property ReportLink: TcxTreeListControlReportLink read GetReportLink; + published + property AutoWidth; + end; + + TcxTreeListReportLinkOptionsView = class(TdxCustomTableControlReportLinkOptionsView) + private + FBorders: Boolean; + FTreeLines: Boolean; + function GetReportLink: TcxTreeListControlReportLink; + procedure SetBorders(Value: Boolean); + procedure SetTreeLines(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + property ReportLink: TcxTreeListControlReportLink read GetReportLink; + published + property BandHeaders; + property Borders: Boolean read FBorders write SetBorders default True; + property ExpandButtons; + property Footers; + property Headers; + property TreeLines: Boolean read FTreeLines write SetTreeLines default True; + end; + + { TcxTreeListReportLinkStyles } + + TcxTreeListReportLinkStylesClass = class of TcxTreeListReportLinkStyles; + + TcxTreeListReportLinkStyles = class(TdxCustomReportLinkStyles) + private + FOnGetNodeIndentStyle: TcxtlOnGetNodeIndentStyleEvent; + function GetReportLink: TcxTreeListControlReportLink; + protected + function DesignerTabIndex: Integer; override; + + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + class function GetStyleCaption(AnIndex: Integer): string; override; + function GetStyleIndexByCaption(const Caption: string): Integer; override; + public + procedure Assign(Source: TPersistent); override; + + procedure GetBandHeaderParams(ABand: TcxTreeListBand; out AParams: TcxViewParams); virtual; + procedure GetColumnFooterParams(ANode: TcxTreeListNode; AColumn: TcxTreeListColumn; + out AParams: TcxViewParams); virtual; + procedure GetColumnHeaderParams(AColumn: TcxTreeListColumn; out AParams: TcxViewParams); virtual; + procedure GetContentParams(ANode: TcxTreeListNode; AColumn: TcxTreeListColumn; + out AParams: TcxViewParams); virtual; + procedure GetFooterRowParams(out AParams: TcxViewParams); virtual; + procedure GetImagesParams(ANode: TcxTreeListNode; out AParams: TcxViewParams); virtual; + procedure GetIndentParams(ANode: TcxTreeListNode; AnIndent: Integer; out AParams: TcxViewParams); virtual; + procedure GetPreviewParams(ANode: TcxTreeListNode; AColumn: TcxTreeListColumn; + out AParams: TcxViewParams); virtual; + procedure GetSelectionParams(out AParams: TcxViewParams); virtual; + + property ReportLink: TcxTreeListControlReportLink read GetReportLink; + published + property BandHeader: TcxStyle Index vspsTreeListBandHeader read GetValue write SetValue; + property Content: TcxStyle Index vspsTreeListContent read GetValue write SetValue; + property ContentEven: TcxStyle Index vspsTreeListContentEven read GetValue write SetValue; + property ContentOdd: TcxStyle Index vspsTreeListContentOdd read GetValue write SetValue; + property Footer: TcxStyle Index vspsTreeListFooter read GetValue write SetValue; + property FooterRow: TcxStyle Index vspsTreeListFooterRow read GetValue write SetValue; + property Header: TcxStyle Index vspsTreeListHeader read GetValue write SetValue; + property Preview: TcxStyle Index vspsTreeListPreview read GetValue write SetValue; + property Selection: TcxStyle Index vspsTreeListSelection read GetValue write SetValue; + property StyleSheet; + property OnGetNodeIndentStyle: TcxtlOnGetNodeIndentStyleEvent read FOnGetNodeIndentStyle write FOnGetNodeIndentStyle; + end; + + TcxTreeListReportLinkStyleSheet = class(TdxCustomReportLinkStyleSheet) + private + function GetStylesValue: TcxTreeListReportLinkStyles; + procedure SetStylesValue(Value: TcxTreeListReportLinkStyles); + public + class function GetStylesClass: TcxCustomStylesClass; override; + published + property Styles: TcxTreeListReportLinkStyles read GetStylesValue write SetStylesValue; + end; + + { Host Services } + + TcxTreeListControlAttributeHostInfo = class + private + FParent: TdxReportCell; + public + Origin: TPoint; + procedure Initialize(AParent: TdxReportCell); + property Parent: TdxReportCell read FParent; + end; + + TcxTreeListAttributeHostInfoServicesClass = class of TcxTreeListAttributeHostInfoServices; + + TcxTreeListAttributeHostInfoServices = class + private + FPageDetailsHostInfo: TcxTreeListControlAttributeHostInfo; + FPageFootersHostInfo: TcxTreeListControlAttributeHostInfo; + FPageHeadersHostInfo: TcxTreeListControlAttributeHostInfo; + FReportLink: TcxTreeListControlReportLink; + function GetArePageFootersAssigned: Boolean; + function GetArePageHeadersAssigned: Boolean; + function GetCanUseBandHeadersOnEveyPage: Boolean; + function GetCanUseFootersOnEveryPage: Boolean; + function GetCanUseHeadersOnEveryPage: Boolean; + function GetIsInconsistentHeadersState: Boolean; + function GetOptionsOnEveryPage: TcxTreeListReportLinkOptionsOnEveryPage; + function GetOptionsView: TcxTreeListReportLinkOptionsView; + function GetPageDetails: TdxReportCell; + function GetPageFooters: TdxReportCell; + function GetPageHeaders: TdxReportCell; + protected + procedure CreateHostInfos; + procedure DestroyHostInfos; + + function GetBandHeadersHostInfo: TcxTreeListControlAttributeHostInfo; virtual; + function GetFootersHostInfo: TcxTreeListControlAttributeHostInfo; virtual; + function GetHeadersHostInfo: TcxTreeListControlAttributeHostInfo; virtual; + function GetInconsistentStateText: string; virtual; + function GetIsInconsistentState: Boolean; virtual; + function HasCells: Boolean; + + property OptionsOnEveryPage: TcxTreeListReportLinkOptionsOnEveryPage read GetOptionsOnEveryPage; + property OptionsView: TcxTreeListReportLinkOptionsView read GetOptionsView; + property PageDetails: TdxReportCell read GetPageDetails; + property PageFooters: TdxReportCell read GetPageFooters; + property PageHeaders: TdxReportCell read GetPageHeaders; + public + constructor Create(AReportLink: TcxTreeListControlReportLink); virtual; + destructor Destroy; override; + procedure InitializeHostInfos; + + property ArePageFootersAssigned: Boolean read GetArePageFootersAssigned; + property ArePageHeadersAssigned: Boolean read GetArePageHeadersAssigned; + property BandHeadersHostInfo: TcxTreeListControlAttributeHostInfo read GetBandHeadersHostInfo; + property CanUseBandHeadersOnEveyPage: Boolean read GetCanUseBandHeadersOnEveyPage; + property CanUseFootersOnEveryPage: Boolean read GetCanUseFootersOnEveryPage; + property CanUseHeadersOnEveryPage: Boolean read GetCanUseHeadersOnEveryPage; + property FootersHostInfo: TcxTreeListControlAttributeHostInfo read GetFootersHostInfo; + property HeadersHostInfo: TcxTreeListControlAttributeHostInfo read GetHeadersHostInfo; + property InconsistentStateText: string read GetInconsistentStateText; + property IsInconsistentHeadersState: Boolean read GetIsInconsistentHeadersState; + property IsInconsistentState: Boolean read GetIsInconsistentState; + property PageDetailsHostInfo: TcxTreeListControlAttributeHostInfo read FPageDetailsHostInfo; + property PageFootersHostInfo: TcxTreeListControlAttributeHostInfo read FPageFootersHostInfo; + property PageHeadersHostInfo: TcxTreeListControlAttributeHostInfo read FPageHeadersHostInfo; + property ReportLink: TcxTreeListControlReportLink read FReportLink; + end; + + { TcxTreeListControlReportLink } + + TcxTreeListNodeArray = array of TcxTreeListNode; + + TcxTreeListReportLinkGetCustomPageBreaksEvent = procedure(Sender: TcxTreeListControlReportLink) of object; + + TcxTreeListReportLinkCustomDrawBandCellEvent = procedure(Sender: TcxTreeListControlReportLink; + ACanvas: TCanvas; ABand: TcxTreeListBand; AnItem: TdxReportCellImage; + var ADone: Boolean) of object; + + TcxTreeListReportLinkCustomDrawCellEvent = procedure(Sender: TcxTreeListControlReportLink; + ACanvas: TCanvas; ANode: TcxTreeListNode; AColumn: TcxTreeListColumn; + AnItem: TAbstractdxReportCellData; var ADone: Boolean) of object; + + TcxTreeListReportLinkCustomDrawFooterCellEvent = procedure(Sender: TcxTreeListControlReportLink; + ACanvas: TCanvas; AColumn: TcxTreeListColumn; AnItem: TdxReportCellString; var ADone: Boolean) of object; + + TcxTreeListReportLinkCustomDrawHeaderCellEvent = procedure(Sender: TcxTreeListControlReportLink; + ACanvas: TCanvas; AColumn: TcxTreeListColumn; AnItem: TdxReportCellImage; var ADone: Boolean) of object; + + TcxTreeListReportLinkCustomDrawIndentCellEvent = procedure(Sender: TcxTreeListControlReportLink; + ACanvas: TCanvas; ANode: TcxTreeListNode; AnIndex: Integer; AnItem: TAbstractdxReportCellData; + var ADone: Boolean) of object; + + TcxTreeListReportLinkInitializeBandCellEvent = procedure(Sender: TcxTreeListControlReportLink; + ABand: TcxTreeListBand; AnItem: TdxReportCellImage) of object; + + TcxTreeListReportLinkInitializeCellEvent = procedure(Sender: TcxTreeListControlReportLink; + ANode: TcxTreeListNode; AColumn: TcxTreeListColumn; AnItem: TAbstractdxReportCellData) of object; + + TcxTreeListReportLinkInitializeFooterCellEvent = procedure(Sender: TcxTreeListControlReportLink; + AColumn: TcxTreeListColumn; AnItem: TdxReportCellString) of object; + + TcxTreeListReportLinkInitializeHeaderCellEvent = procedure(Sender: TcxTreeListControlReportLink; + AColumn: TcxTreeListColumn; AnItem: TdxReportCellImage) of object; + + TcxTreeListReportLinkInitializeIndentCellEvent = procedure(Sender: TcxTreeListControlReportLink; + ANode: TcxTreeListNode; AnIndex: Integer; AnItem: TAbstractdxReportCellData) of object; + + TcxTreeListControlReportLink = class(TdxCustomTableControlReportLink) + private + FBuilder: TcxTreeListControlReportLinkBuilder; + FDelimitersHardVert: TList; + FHostInfoServices: TcxTreeListAttributeHostInfoServices; + FReportRows: TList; + FOnCustomDrawBandCell: TcxTreeListReportLinkCustomDrawBandCellEvent; + FOnCustomDrawCell: TcxTreeListReportLinkCustomDrawCellEvent; + FOnCustomDrawFooterCell: TcxTreeListReportLinkCustomDrawFooterCellEvent; + FOnCustomDrawHeaderCell: TcxTreeListReportLinkCustomDrawHeaderCellEvent; + FOnCustomDrawIndentCell: TcxTreeListReportLinkCustomDrawIndentCellEvent; + FOnGetCustomPageBreaks: TcxTreeListReportLinkGetCustomPageBreaksEvent; + FOnInitializeBandCell: TcxTreeListReportLinkInitializeBandCellEvent; + FOnInitializeCell: TcxTreeListReportLinkInitializeCellEvent; + FOnInitializeFooterCell: TcxTreeListReportLinkInitializeFooterCellEvent; + FOnInitializeHeaderCell: TcxTreeListReportLinkInitializeHeaderCellEvent; + FOnInitializeIndentCell: TcxTreeListReportLinkInitializeIndentCellEvent; + function GetActiveStyles: TcxTreeListReportLinkStyles; + function GetDesignWindow: TdxfmTreeListReportLinkDesignWindow; + function GetReportRow(Index: Integer): TdxReportCell; + function GetReportRowByNode(Node: TcxTreeListNode): TdxReportCell; + function GetReportRowCount: Integer; + function GetOptionsExpanding: TcxTreeListReportLinkOptionsExpanding; + function GetOptionsFormatting: TcxTreeListReportLinkOptionsFormatting; + function GetOptionsOnEveryPage: TcxTreeListReportLinkOptionsOnEveryPage; + function GetOptionsPagination: TcxTreeListReportLinkOptionsPagination; + function GetOptionsPreview: TcxTreeListReportLinkOptionsPreview; + function GetOptionsRefinements: TcxTreeListReportLinkOptionsRefinements; + function GetOptionsSelection: TcxTreeListReportLinkOptionsSelection; + function GetOptionsSize: TcxTreeListReportLinkOptionsSize; + function GetOptionsView: TcxTreeListReportLinkOptionsView; + function GetStyles: TcxTreeListReportLinkStyles; + function GetTreeListControl: TcxCustomTreeListControl; + procedure SetOnCustomDrawBandCell(Value: TcxTreeListReportLinkCustomDrawBandCellEvent); + procedure SetOnCustomDrawCell(Value: TcxTreeListReportLinkCustomDrawCellEvent); + procedure SetOnCustomDrawFooterCell(Value: TcxTreeListReportLinkCustomDrawFooterCellEvent); + procedure SetOnCustomDrawHeaderCell(Value: TcxTreeListReportLinkCustomDrawHeaderCellEvent); + procedure SetOnCustomDrawIndentCell(Value: TcxTreeListReportLinkCustomDrawIndentCellEvent); + procedure SetOptionsExpanding(Value: TcxTreeListReportLinkOptionsExpanding); + procedure SetOptionsFormatting(Value: TcxTreeListReportLinkOptionsFormatting); + procedure SetOptionsOnEveryPage(Value: TcxTreeListReportLinkOptionsOnEveryPage); + procedure SetOptionsPagination(Value: TcxTreeListReportLinkOptionsPagination); + procedure SetOptionsPreview(Value: TcxTreeListReportLinkOptionsPreview); + procedure SetOptionsRefinements(Value: TcxTreeListReportLinkOptionsRefinements); + procedure SetOptionsSelection(Value: TcxTreeListReportLinkOptionsSelection); + procedure SetOptionsSize(Value: TcxTreeListReportLinkOptionsSize); + procedure SetOptionsView(Value: TcxTreeListReportLinkOptionsView); + procedure SetStyles(Value: TcxTreeListReportLinkStyles); + protected + procedure ConstructReport(AReportCells: TdxReportCells); override; + procedure ConvertCoords; override; + procedure CustomDraw(AItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); override; + function GetBreakPagesByHardDelimiters: Boolean; override; + procedure GetImageLists(AProc: TdxPSGetImageListProc); override; + function GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; override; + function GetUseHardVertDelimiters: Boolean; override; + procedure InternalRestoreFromOriginal; override; + function IsDrawFootersOnEveryPage: Boolean; override; + function IsDrawHeadersOnEveryPage: Boolean; override; + function IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; override; + procedure MakeHardDelimiters(AReportCells: TdxReportCells; AVertDelimiters: TList); override; + + function GetAreNativeStylesAvailable: Boolean; override; + function GetStylesClass: TdxCustomReportLinkStylesClass; override; + function GetStyleSheetClass: TdxCustomReportLinkStyleSheetClass; override; + function GetStyleSheetPrototype: TdxCustomReportLinkStyleSheet; override; + procedure PrepareConstruct; override; + + procedure DoCustomDrawBandCell(ACanvas: TCanvas; ABand: TcxTreeListBand; + AnItem: TdxReportCellImage; var ADone: Boolean); dynamic; + procedure DoCustomDrawCell(ACanvas: TCanvas; ANode: TcxTreeListNode; + AColumn: TcxTreeListColumn; AnItem: TAbstractdxReportCellData; + var ADone: Boolean); dynamic; + procedure DoCustomDrawFooterCell(ACanvas: TCanvas; AColumn: TcxTreeListColumn; + AnItem: TdxReportCellString; var ADone: Boolean); dynamic; + procedure DoCustomDrawHeaderCell(ACanvas: TCanvas; AColumn: TcxTreeListColumn; + AnItem: TdxReportCellImage; var ADone: Boolean); dynamic; + procedure DoCustomDrawIndentCell(ACanvas: TCanvas; ANode: TcxTreeListNode; + AnIndex: Integer; AnItem: TAbstractdxReportCellData; var ADone: Boolean); dynamic; + procedure DoGetCustomPageBreaks; dynamic; + procedure DoInitializeBandCell(ABand: TcxTreeListBand; AnItem: TdxReportCellImage); dynamic; + procedure DoInitializeCell(ANode: TcxTreeListNode; AColumn: TcxTreeListColumn; AnItem: TAbstractdxReportCellData); dynamic; + procedure DoInitializeFooterCell(AColumn: TcxTreeListColumn; AnItem: TdxReportCellString); dynamic; + procedure DoInitializeHeaderCell(AColumn: TcxTreeListColumn; AnItem: TdxReportCellImage); dynamic; + procedure DoInitializeIndentCell(ANode: TcxTreeListNode; AnIndex: Integer; AnItem: TAbstractdxReportCellData); dynamic; + + function GetOptionsExpandingClass: TdxCustomReportLinkOptionsExpandingClass; override; + function GetOptionsFormattingClass: TdxCustomReportLinkOptionsFormattingClass; override; + function GetOptionsOnEveryPageClass: TdxCustomTableControlReportLinkOptionsOnEveryPageClass; override; + function GetOptionsPaginationClass: TdxCustomReportLinkOptionsPaginationClass; override; + function GetOptionsPreviewClass: TdxCustomTableControlReportLinkOptionsPreviewClass; override; + function GetOptionsRefinementsClass: TdxCustomReportLinkOptionsRefinementsClass; override; + function GetOptionsSelectionClass: TdxCustomTableControlReportLinkOptionsSelectionClass; override; + function GetOptionsSizeClass: TdxCustomReportLinkOptionsSizeClass; override; + function GetOptionsViewClass: TdxCustomReportLinkOptionsViewClass; override; + + procedure AddReportRow(AReportRow: TdxReportCell); + procedure AddVerticalHardDelimiter(ADelimiter: TdxReportCell); overload; + procedure AddVerticalHardDelimiter(ADelimiter: Integer); overload; + + function CreateBuilder: TcxTreeListControlReportLinkBuilder; virtual; + class function GetBuilderClass: TcxTreeListControlReportLinkBuilderClass; virtual; + + function ExtractIndentIndex(AData: Integer): Integer; + function GetItemCustomDrawInfo(AnItem: TdxReportVisualItem; + out ADrawInfo: TcxTreeListCellCustomDrawInfo): TcxTreeListAttributeID; virtual; + function IsCustomDrawn(AnAttributeID: TcxTreeListAttributeID): Boolean; virtual; + function MakeIndentIndex(AnIndex: Integer): DWORD; + + property ActiveStyles: TcxTreeListReportLinkStyles read GetActiveStyles; + property Builder: TcxTreeListControlReportLinkBuilder read FBuilder; + property DelimitersHardVert: TList read FDelimitersHardVert; + property HostInfoServices: TcxTreeListAttributeHostInfoServices read FHostInfoServices; + property TreeListControl: TcxCustomTreeListControl read GetTreeListControl; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + procedure AddPageBreak(ANode: TcxTreeListNode); overload; + procedure AddPageBreak(const ANodes: array of TcxTreeListNode); overload; + procedure AddPageBreak(const ANodes: TcxTreeListNodeArray); overload; + procedure AddPageBreak(ANodes: TList); overload; // List of TcxCustomGridRecord + + property DesignWindow: TdxfmTreeListReportLinkDesignWindow read GetDesignWindow; + property ReportRows[Index: Integer]: TdxReportCell read GetReportRow; + property ReportRowsByNode[Node: TcxTreeListNode]: TdxReportCell read GetReportRowByNode; + property ReportRowCount: Integer read GetReportRowCount; + published + property Color; + property Font; + property OptionsExpanding: TcxTreeListReportLinkOptionsExpanding read GetOptionsExpanding write SetOptionsExpanding; + property OptionsFormatting: TcxTreeListReportLinkOptionsFormatting read GetOptionsFormatting write SetOptionsFormatting; + property OptionsOnEveryPage: TcxTreeListReportLinkOptionsOnEveryPage read GetOptionsOnEveryPage write SetOptionsOnEveryPage; + property OptionsPagination: TcxTreeListReportLinkOptionsPagination read GetOptionsPagination write SetOptionsPagination; + property OptionsPreview: TcxTreeListReportLinkOptionsPreview read GetOptionsPreview write SetOptionsPreview; + property OptionsRefinements: TcxTreeListReportLinkOptionsRefinements read GetOptionsRefinements write SetOptionsRefinements; + property OptionsSelection: TcxTreeListReportLinkOptionsSelection read GetOptionsSelection write SetOptionsSelection; + property OptionsSize: TcxTreeListReportLinkOptionsSize read GetOptionsSize write SetOptionsSize; + property OptionsView: TcxTreeListReportLinkOptionsView read GetOptionsView write SetOptionsView; + property ScaleFonts; + property StyleRepository; + property Styles: TcxTreeListReportLinkStyles read GetStyles write SetStyles; + property SupportedCustomDraw; + + property OnCustomDrawBandCell: TcxTreeListReportLinkCustomDrawBandCellEvent read FOnCustomDrawBandCell + write SetOnCustomDrawBandCell; + property OnCustomDrawCell: TcxTreeListReportLinkCustomDrawCellEvent read FOnCustomDrawCell + write SetOnCustomDrawCell; + property OnCustomDrawFooterCell: TcxTreeListReportLinkCustomDrawFooterCellEvent read FOnCustomDrawFooterCell + write SetOnCustomDrawFooterCell; + property OnCustomDrawHeaderCell: TcxTreeListReportLinkCustomDrawHeaderCellEvent read FOnCustomDrawHeaderCell + write SetOnCustomDrawHeaderCell; + property OnCustomDrawIndentCell: TcxTreeListReportLinkCustomDrawIndentCellEvent read FOnCustomDrawIndentCell + write SetOnCustomDrawIndentCell; + property OnGetCustomPageBreaks: TcxTreeListReportLinkGetCustomPageBreaksEvent read FOnGetCustomPageBreaks write FOnGetCustomPageBreaks; + property OnInitializeBandCell: TcxTreeListReportLinkInitializeBandCellEvent read FOnInitializeBandCell + write FOnInitializeBandCell; + property OnInitializeCell: TcxTreeListReportLinkInitializeCellEvent read FOnInitializeCell + write FOnInitializeCell; + property OnInitializeFooterCell: TcxTreeListReportLinkInitializeFooterCellEvent read FOnInitializeFooterCell + write FOnInitializeFooterCell; + property OnInitializeHeaderCell: TcxTreeListReportLinkInitializeHeaderCellEvent read FOnInitializeHeaderCell + write FOnInitializeHeaderCell; + property OnInitializeIndentCell: TcxTreeListReportLinkInitializeIndentCellEvent read FOnInitializeIndentCell + Write FOnInitializeIndentCell; + end; + + TcxTreeListReportLink = class(TcxTreeListControlReportLink) + private + function GetTreeList: TcxTreeList; + public + property TreeList: TcxTreeList read GetTreeList; + end; + + TcxDBTreeListReportLink = class(TcxTreeListControlReportLink) + private + function GetDBTreeList: TcxDBTreeList; + public + property DBTreeList: TcxDBTreeList read GetDBTreeList; + end; + + TcxVirtualTreeListReportLink = class(TcxTreeListControlReportLink) + private + function GetVirtualTreeList: TcxVirtualTreeList; + public + property VirtualTreeList: TcxVirtualTreeList read GetVirtualTreeList; + end; + + TdxfmTreeListReportLinkDesignWindow = class(TdxfmCustomcxControlReportLinkDesignWindow) + PageControl1: TPageControl; + tshView: TTabSheet; + lblShow: TLabel; + imgShow: TImage; + bvlShow: TBevel; + lblOnEveryPage: TLabel; + imgOnEveryPage: TImage; + bvlOnEveryPage: TBevel; + bvlWarningHost: TBevel; + chbxShowBands: TCheckBox; + chbxShowHeaders: TCheckBox; + chbxShowFooters: TCheckBox; + chbxShowExpandButtons: TCheckBox; + chbxBandsOnEveryPage: TCheckBox; + chbxHeadersOnEveryPage: TCheckBox; + chbxFootersOnEveryPage: TCheckBox; + chbxShowTreeLines: TCheckBox; + tshBehaviors: TTabSheet; + tshFormatting: TTabSheet; + lblLookAndFeel: TLabel; + bvlLookAndFeel: TBevel; + imgLookAndFeel: TImage; + imgRefinements: TImage; + lblRefinements: TLabel; + bvlRefinements: TBevel; + cbxLookAndFeel: TComboBox; + chbxFlatCheckMarks: TCheckBox; + chbxDisplayGraphicsAsText: TCheckBox; + chbxTransparentGraphics: TCheckBox; + tshPreview: TTabSheet; + lblPreviewOptions: TLabel; + bvlPreviewOptions: TBevel; + lblPreviewMaxLineCount: TLabel; + bvlPreviewMaxLineCountHost: TBevel; + imgPreview: TImage; + chbxPreviewVisible: TCheckBox; + chbxPreviewAutoHeight: TCheckBox; + pnlPreview: TPanel; + cxStyleRepository1: TcxStyleRepository; + styleBandHeaders: TcxStyle; + styleStandard: TcxStyle; + stylePreview: TcxStyle; + styleCardShadow: TcxStyle; + chbxSuppressBackgroundBitmaps: TCheckBox; + tshStyles: TTabSheet; + bvlStyles: TBevel; + bvlStyleSheets: TBevel; + lblStyleSheets: TLabel; + btnStyleColor: TButton; + btnStyleFont: TButton; + btnStyleBackgroundBitmap: TButton; + chbxUseNativeStyles: TCheckBox; + cbxStyleSheets: TComboBox; + btnStyleSheetNew: TButton; + btnStyleSheetCopy: TButton; + btnStyleSheetDelete: TButton; + btnStylesSaveAs: TButton; + btnStyleSheetRename: TButton; + pmStyles: TPopupMenu; + miStyleFont: TMenuItem; + miStyleColor: TMenuItem; + miStyleBackgroundBitmap: TMenuItem; + milLine: TMenuItem; + miStylesSaveAs: TMenuItem; + btnStyleBackgroundBitmapClear: TButton; + btnStyleRestoreDefaults: TButton; + miLine2: TMenuItem; + miLine3: TMenuItem; + miStyleBackgroundBitmapClear: TMenuItem; + miStyleRestoreDefaults: TMenuItem; + bvlStylesHost: TBevel; + ilStylesPopup: TImageList; + PreviewTreeList: TcxTreeList; + colManufacturerName: TcxTreeListColumn; + colManufacturerLogo: TcxTreeListColumn; + colManufacturerCountry: TcxTreeListColumn; + colCarModel: TcxTreeListColumn; + colCarIsSUV: TcxTreeListColumn; + chbxShowBorders: TCheckBox; + miStylesSelectAll: TMenuItem; + miLine4: TMenuItem; + chbxConsumeSelectionStyle: TCheckBox; + bvlRefinementsSeparator: TBevel; + Bevel2: TBevel; + pnlBehaviors: TPanel; + pnlSelection: TPanel; + lblSelection: TLabel; + imgSelection: TImage; + bvlSelection: TBevel; + chbxProcessSelection: TCheckBox; + chbxProcessExactSelection: TCheckBox; + pnlExpanding: TPanel; + lblExpanding: TLabel; + imgExpanding: TImage; + bvlExpanding: TBevel; + chbxExpandNodes: TCheckBox; + pnlSize: TPanel; + lblSize: TLabel; + bvlSize: TBevel; + imgGridSize: TImage; + chbxAutoWidth: TCheckBox; + pnlSeparators: TPanel; + lblSeparators: TLabel; + bvlSeparator: TBevel; + lblSeparatorsThickness: TLabel; + lblSeparatorsColor: TLabel; + bvlSeparatorThicknessHost: TBevel; + bvlSeparatorColorHost: TBevel; + imgSeparators: TImage; + chbxExplicitlyExpandNodes: TCheckBox; + lblPreviewWindow: TStaticText; + Label1: TLabel; + lblUseNativeStyles: TLabel; + procedure LookAndFeelChange(Sender: TObject); + procedure OptionsRefinementsClick(Sender: TObject); + procedure PreviewVisibleClick(Sender: TObject); + procedure PreviewAutoHeightClick(Sender: TObject); + procedure OptionsSelectionClick(Sender: TObject); + procedure OptionsExpandingClick(Sender: TObject); + procedure OptionsViewClick(Sender: TObject); + procedure OptionsOnEveryPageClick(Sender: TObject); + procedure OptionsSizeClick(Sender: TObject); + procedure OptionsFormattingClick(Sender: TObject); + procedure pmStylesPopup(Sender: TObject); + procedure StyleColorClick(Sender: TObject); + procedure StyleFontClick(Sender: TObject); + procedure StyleBackgroundBitmapClick(Sender: TObject); + procedure cbxStyleSheetsClick(Sender: TObject); + procedure btnStyleSheetNewClick(Sender: TObject); + procedure btnStyleSheetCopyClick(Sender: TObject); + procedure btnStyleSheetDeleteClick(Sender: TObject); + procedure btnStyleSheetRenameClick(Sender: TObject); + procedure StylesSaveAsClick(Sender: TObject); + procedure cbxStyleSheetsKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure lbxStylesClick(Sender: TObject); + procedure StyleBackgroundBitmapClearClick(Sender: TObject); + procedure StyleRestoreDefaultsClick(Sender: TObject); + procedure PreviewTreeListCustomDrawCell(Sender: TObject; + Canvas: TcxCanvas; AViewInfo: TcxTreeListEditCellViewInfo; + var ADone: Boolean); + procedure PreviewTreeListCustomDrawHeader(Sender: TObject; + ACanvas: TcxCanvas; AViewInfo: TcxTreeListHeaderViewInfo; + var ADone: Boolean); + procedure PreviewTreeListCustomDrawFooterCell(Sender: TObject; + Canvas: TcxCanvas; AViewInfo: TcxTreeListFooterItemViewInfo; + var ADone: Boolean); + procedure miStylesSelectAllClick(Sender: TObject); + procedure PreviewTreeListCustomDrawBandHeader(Sender: TObject; + ACanvas: TcxCanvas; AViewInfo: TcxTreeListHeaderViewInfo; + var ADone: Boolean); + procedure PageControl1Change(Sender: TObject); + procedure cbxStyleSheetsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure lblUseNativeStylesClick(Sender: TObject); + private + lbxStyles: TdxStylesListBox; + sePreviewMaxLineCount: TdxPSSpinEdit; + seSeparatorThickness: TdxPSSpinEdit; + ccbxSeparatorColor: TdxPSColorCombo; + wpIncorrectOnEveryPageState: TdxPSWarningPane; + + function GetActiveStyle: TcxStyle; + function GetHasSelectedStyles: Boolean; + function GetHasSelectedStylesWithAssignedBitmap: Boolean; + function GetReportLink: TcxTreeListControlReportLink; + + procedure PreviewMaxLineCountChanged(Sender: TObject); + procedure SeparatorColorChanged(Sender: TObject); + procedure SeparatorThicknessChanged(Sender: TObject); + + function CanSelectAllStyles: Boolean; + procedure CreateControls; + procedure CustomDrawBorders(ACanvas: TcxCanvas; const R: TRect); + procedure CustomDrawCheckMark(ACanvas: TcxCanvas; AViewInfo: TcxTreeListEditCellViewInfo); + procedure CustomDrawFooter(ACanvas: TcxCanvas; R: TRect; AViewInfo: TcxTreeListFooterItemViewInfo); + procedure CustomDrawHeader(ACanvas: TcxCanvas; R: TRect; AViewInfo: TcxTreeListHeaderViewInfo); + procedure CustomDrawTextRect(ACanvas: TcxCanvas; R: TRect; const AText: string; + AnAlignmentHorz: TAlignment; AnAlignmentVert: TcxAlignmentVert; AParams: TcxViewParams); + function ExtractAlignmentHorz(AViewInfo: TcxTreeListEditCellViewInfo): TAlignment; + function ExtractAlignmentVert(AViewInfo: TcxTreeListEditCellViewInfo): TcxAlignmentVert; + procedure InitializePreviewTreeList; + procedure InitializePreviewTreeListStyles; + procedure LoadDataIntoPreviewTreeList; + procedure RecreateStylesListBox; + procedure RestoreSelectedStyles(AList: TList); + procedure SaveSelectedStyles(AList: TList); + procedure SetActivePage; + procedure UpdatePreviewTreeListStyles(const ACaption: string; AStyle: TcxStyle); + procedure WarningPaneUpdate; + + procedure SetOptionsExpandingByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsFormattingByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsOnEveryPageByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsRefinementsByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsSelectionByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsSizeByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsViewByIndex(Index: Integer; Value: Boolean); + protected + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + procedure LoadStrings; override; + procedure UpdateControlsState; override; + procedure UpdatePreview; override; + + function GetDesignerTabIndex: Integer; override; + procedure SetDesignerTabIndex(Value: Integer); override; + + procedure DoActiveStyleSheetChanged; override; + procedure DoFormActivated(AnActive: Boolean); override; + procedure DoRefreshStylesList; override; + procedure DoStyleChanged(const ACaption: string; AStyle: TcxStyle); override; + procedure DoStylesChanged(AStrings: TStrings; ARecreate: Boolean); override; + + procedure GetSelectedStyleNames(AStrings: TStrings); override; + procedure GetStyleNames(out AStrings: TStrings); override; + procedure GetStyleSheetNames(out AStrings: TStrings); override; + + property ActiveStyle: TcxStyle read GetActiveStyle; + property HasSelectedStyles: Boolean read GetHasSelectedStyles; + property HasSelectedStylesWithAssignedBitmap: Boolean read GetHasSelectedStylesWithAssignedBitmap; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property ReportLink: TcxTreeListControlReportLink read GetReportLink; + end; + +const + dxPSDefaultTreeListNodeSeparatorColor: TColor = clBtnShadow; + +implementation + +{$R *.dfm} + +{ 634x420 - DesignWindow } +{.3 - chbxTransparentRichEdits } + +uses + {$IFDEF DELPHI6} + Variants, + {$ENDIF} Forms, Registry, dxThemeManager, cxDataStorage, cxDataUtils, cxTLIntf, + cxImage, cxCheckBox, dxPSGlbl, dxPSRes, dxPSImgs, dxPSTextOut, dxPSPopupMan, + dxPSUtl, dxBkgnd; + +const + CellSidesMap: array[TcxTreeListGridLines] of TdxCellSides = ([], csTopBottom, csLeftRight, csAll); + SortOrderMap: array[TcxDataSortOrder] of TdxCellSortOrder = (csoNone, csoUp, csoDown); + TreeLinesStyleMap: array[TcxTreeListTreeLineStyle] of TdxPSTreeLineStyle = (tlsDot, tlsDot, tlsSolid); + + DefaultExpandButtonSize = 9; + DefaultIndentWidth = 15; + ExpandButtonInteriorColors: array[Boolean] of TColor = (clWindow, clBtnShadow); + FooterItemInflateHorz = 2; + FooterItemInflateVert = 3; + + NodeIndentMask = $00000FF0; + NodeIndentOffset = $00000004; + +var + FDefaultdxPScxTreeListLinkStyleSheet: TcxTreeListReportLinkStyleSheet; + +type + TcxTreeListNodeHelperFactory = class(TdxCustomClassMaps) + private + function GetHelperClass(Node: TcxTreeListNode): TcxTreeListNodeHelperClass; + public + class function Instance: TcxTreeListNodeHelperFactory; reintroduce; overload; + property HelperClasses[Node: TcxTreeListNode]: TcxTreeListNodeHelperClass read GetHelperClass; default; + end; + + + TcxCustomTreeListControlAccess = class(TcxCustomTreeListControl); + TcxTreeListColumnAccess = class(TcxTreeListColumn); + +{ Helpers } + +{ CustomTreeListControl Helpers } + +function CustomTreeListControl_DoIsGroupNode(AInstance: TcxCustomTreeListControl; ANode: TcxTreeListNode): Boolean; +begin + Result := TcxCustomTreeListControlAccess(AInstance).DoIsGroupNode(ANode); +end; + +function CustomTreeListControl_GetHeaderLineCount(AInstance: TcxCustomTreeListControl): Integer; +begin + Result := TcxCustomTreeListControlAccess(AInstance).HeaderLineCount; +end; + +function CustomTreeListControl_GetImages(AInstance: TcxCustomTreeListControl): TCustomImageList; +begin + Result := TcxCustomTreeListControlAccess(AInstance).Images; +end; + +function CustomTreeListControl_GetLookAndFeel(AInstance: TcxCustomTreeListControl): TcxLookAndFeel; +begin + Result := TcxCustomTreeListControlAccess(AInstance).LookAndFeel; +end; + +function CustomTreeListControl_GetLookAndFeelPainter(AInstance: TcxCustomTreeListControl): TcxCustomLookAndFeelPainterClass; +begin + Result := TcxCustomTreeListControlAccess(AInstance).LookAndFeelPainter; +end; + +function CustomTreeListControl_GetNodes(AInstance: TcxCustomTreeListControl): TcxTreeListNodes; +begin + Result := TcxCustomTreeListControlAccess(AInstance).Nodes; +end; + +function CustomTreeListControl_GetOptionsSelection(AInstance: TcxCustomTreeListControl): TcxTreeListOptionsSelection; +begin + Result := TcxCustomTreeListControlAccess(AInstance).OptionsSelection; +end; + +function CustomTreeListControl_GetOptionsView(AInstance: TcxCustomTreeListControl): TcxTreeListOptionsView; +begin + Result := TcxCustomTreeListControlAccess(AInstance).OptionsView; +end; + +function CustomTreeListControl_GetPreview(AInstance: TcxCustomTreeListControl): TcxTreeListPreview; +begin + Result := TcxCustomTreeListControlAccess(AInstance).Preview; +end; + +function CustomTreeListControl_GetStateImages(AInstance: TcxCustomTreeListControl): TCustomImageList; +begin + Result := TcxCustomTreeListControlAccess(AInstance).StateImages; +end; + +function CustomTreeListControl_GetStyles(AInstance: TcxCustomTreeListControl): TcxTreeListStyles; +begin + Result := TcxCustomTreeListControlAccess(AInstance).Styles; +end; + +function CustomTreeListControl_GetVisibleBand(AInstance: TcxCustomTreeListControl; + Index: Integer): TcxTreeListBand; +begin + Result := TcxCustomTreeListControlAccess(AInstance).VisibleBands[Index]; +end; + +function CustomTreeListControl_GetVisibleBandCount(AInstance: TcxCustomTreeListControl): Integer; +begin + Result := TcxCustomTreeListControlAccess(AInstance).VisibleBandCount; +end; + +function CustomTreeListControl_GetVisibleColumn(AInstance: TcxCustomTreeListControl; + Index: Integer): TcxTreeListColumn; +begin + Result := TcxCustomTreeListControlAccess(AInstance).VisibleColumns[Index]; +end; + +function CustomTreeListControl_GetVisibleColumnCount(AInstance: TcxCustomTreeListControl): Integer; +begin + Result := TcxCustomTreeListControlAccess(AInstance).VisibleColumnCount; +end; + +{ TreeListColumn Helpers } + +function TreeListColumn_DoGetEditProperties(AInstance: TcxTreeListColumn; + ANode: TcxTreeListNode): TcxCustomEditProperties; +begin + Result := TcxTreeListColumnAccess(AInstance).DoGetEditProperties(ANode); +end; + +{ Utilities } + +function DefaultdxPScxTreeListLinkStyleSheet: TcxTreeListReportLinkStyleSheet; + + function CreateStyle(AColor: TColor; AFontColor: TColor): TcxStyle; + begin + Result := TcxStyle.Create(DefaultdxPScxTreeListLinkStyleSheet); + with Result do + begin + Color := AColor; + Font.Name := dxPSCore.dxPSDefaultFontName; + Font.Color := AFontColor; + end; + end; + +begin + if FDefaultdxPScxTreeListLinkStyleSheet = nil then + begin + FDefaultdxPScxTreeListLinkStyleSheet := TcxTreeListReportLinkStyleSheet.Create(nil); + with FDefaultdxPScxTreeListLinkStyleSheet.Styles as TcxTreeListReportLinkStyles do + begin + BandHeader := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Content := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + ContentEven := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + ContentOdd := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + Footer := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + FooterRow := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Header := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Preview := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + Selection := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + end; + end; + Result := FDefaultdxPScxTreeListLinkStyleSheet; +end; + +function IsValidPointer(const AData: Integer): Boolean; +begin + //Result := (HInstance = 0) or (FindHInstance(Pointer(AData)) = HInstance); + Result := DWORD(AData) > HInstance; +end; + +function ColumnIndex(AColumn: TcxTreeListColumn): Integer; +var + IndexedItem: IcxTreeListIndexedItem; +begin + if Supports(TObject(AColumn), IcxTreeListIndexedItem, IndexedItem) then + Result := IndexedItem.ItemIndex + else + Result := -1; +end; + +{ TcxTreeListNodeHelperFactory } + +function cxTreeListNodeHelperFactory: TcxTreeListNodeHelperFactory; +begin + Result := TcxTreeListNodeHelperFactory.Instance; +end; + +class function TcxTreeListNodeHelperFactory.Instance: TcxTreeListNodeHelperFactory; +begin + Result := inherited Instance as TcxTreeListNodeHelperFactory; +end; + +function TcxTreeListNodeHelperFactory.GetHelperClass(Node: TcxTreeListNode): TcxTreeListNodeHelperClass; +begin + Result := TcxTreeListNodeHelperClass(PairClasses[Node.ClassType]); +end; + +{ CLR Accessors } + + +{ TcxTreeListControlReportLinkRowProducer } + +constructor TcxTreeListControlReportLinkRowProducer.Create(ABuilder: TcxTreeListControlReportLinkBuilder); +begin + inherited Create; + FBuilder := ABuilder; +end; + +function TcxTreeListControlReportLinkRowProducer.Adapter: TcxTreeListControlAdapter; +begin + Result := Builder.Adapter; +end; + +function TcxTreeListControlReportLinkRowProducer.Builder: TcxTreeListControlReportLinkBuilder; +begin + Result := FBuilder; +end; + +function TcxTreeListControlReportLinkRowProducer.Formatter: TcxTreeListControlReportLinkFormatter; +begin + Result := Builder.Formatter; +end; + +function TcxTreeListControlReportLinkRowProducer.Produce(AHostInfo: TcxTreeListControlAttributeHostInfo): TdxReportCell; +begin + CalculateRowHeight; + + CreateRowHost(AHostInfo); + CreateRow; + if AutoHeight then + begin + CalculateRowAutoHeight; + FixupRowHeight; + end; + + Inc(AHostInfo.Origin.Y, RowHeight); + Result := Host; +end; + +procedure TcxTreeListControlReportLinkRowProducer.CalculateRowAutoHeight; +var + DC: HDC; + MaxRowHeight, I, V: Integer; + Item: TdxReportVisualItem; +begin + DC := Self.DC; + MaxRowHeight := 0; + for I := 0 to Row.DataItemCount - 1 do + begin + Item := Row.DataItems[I]; + if DoesItemParticipateInRowAutoHeightCalculation(Item) then + begin + V := Item.MeasureContentHeight(DC); + if MaxRowHeight < V then MaxRowHeight := V; + end; + end; + // v3.1 + for I := 0 to Row.CellCount - 1 do + begin + Item := Row.Cells[I]; + if DoesItemParticipateInRowAutoHeightCalculation(Item) then + begin + V := Item.MeasureContentHeight(DC); + if MaxRowHeight < V then MaxRowHeight := V; + end; + end; + if RowHeight < MaxRowHeight then + RowHeight := MaxRowHeight; +end; + +procedure TcxTreeListControlReportLinkRowProducer.CalculateRowHeight; +begin + FRowHeight := LineCount * LineHeight; +end; + +procedure TcxTreeListControlReportLinkRowProducer.CreateRow; +begin + FRow := TdxReportCell.Create(Host); + FRow.BoundsRect := MakeBounds(0, 0, RowWidth, RowHeight); + InitializeRow; +end; + +procedure TcxTreeListControlReportLinkRowProducer.CreateRowHost(const AHostInfo: TcxTreeListControlAttributeHostInfo); +begin + FHost := TdxReportCell.Create(AHostInfo.Parent); + FHost.BoundsRect := MakeBounds(AHostInfo.Origin.X, AHostInfo.Origin.Y, RowWidth, RowHeight); + Formatter.DoInitializeHost(Host); +end; + +function TcxTreeListControlReportLinkRowProducer.DoesItemParticipateInRowAutoHeightCalculation( + AnItem: TdxReportVisualItem): Boolean; +begin + Result := True; +end; + +procedure TcxTreeListControlReportLinkRowProducer.FixupRowDataHeight; +var + I: Integer; +begin + for I := 0 to Row.DataItemCount - 1 do + Row.DataItems[I].Height := RowHeight; + // v3.1 + for I := 0 to Row.CellCount - 1 do + Row.Cells[I].Height := RowHeight; +end; + +procedure TcxTreeListControlReportLinkRowProducer.FixupRowHeight; +begin + FixupRowItselfHeight; + FixupRowDataHeight; +end; + +procedure TcxTreeListControlReportLinkRowProducer.FixupRowItselfHeight; +begin + Host.Height := RowHeight; + Row.Height := RowHeight; +end; + +procedure TcxTreeListControlReportLinkRowProducer.InitializeRow; +begin +end; + +function TcxTreeListControlReportLinkRowProducer.GetAutoHeight: Boolean; +begin + Result := LineCount = 1; +end; + +function TcxTreeListControlReportLinkRowProducer.GetLineCount: Integer; +begin + Result := 1; +end; + +function TcxTreeListControlReportLinkRowProducer.GetLineHeight: Integer; +begin + Result := 20; +end; + +function TcxTreeListControlReportLinkRowProducer.GetDC: HDC; +begin + Result := Formatter.DC; +end; + +function TcxTreeListControlReportLinkRowProducer.GetIndentWidth: Integer; +begin + Result := Adapter.IndentWidth; +end; + +function TcxTreeListControlReportLinkRowProducer.GetRowWidth: Integer; +begin + Result := Formatter.ViewWidth; +end; + +{ TcxTreeListControlReportLinkCustomRowProducer } + +function TcxTreeListControlReportLinkCustomRowProducer.Produce(AHostInfo: TcxTreeListControlAttributeHostInfo): TdxReportCell; +begin + Result := inherited Produce(AHostInfo); + CreateItem; +end; + +procedure TcxTreeListControlReportLinkCustomRowProducer.CreateItem; +begin + FItem := GetItemClass.Create(Row); + FItem.BoundsRect := MakeRect(0, 0, RowWidth, RowHeight); + InitializeItem; +end; + +procedure TcxTreeListControlReportLinkCustomRowProducer.InitializeItem; +begin +end; + +function TcxTreeListControlReportLinkCustomRowProducer.GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TcxTreeListControlReportLinkCustomRowProducer.GetItemClass: TdxReportCellDataClass; +begin + Result := TAbstractdxReportCellData; +end; + +{ TcxTreeListControlReportLinkNodeSeparatorProducer } + +procedure TcxTreeListControlReportLinkNodeSeparatorProducer.InitializeItem; +begin + inherited; + Formatter.DoInitializeNodeSeparator(Item); +end; + +procedure TcxTreeListControlReportLinkNodeSeparatorProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeNodeSeparatorRow(Row); +end; + +function TcxTreeListControlReportLinkNodeSeparatorProducer.GetItemClass: TdxReportCellDataClass; +begin + Result := Formatter.GetNodeSeparatorClass; +end; + +function TcxTreeListControlReportLinkNodeSeparatorProducer.GetLineHeight: Integer; +begin + Result := Formatter.NodeSeparatorThickness; +end; + +function TcxTreeListControlReportLinkNodeSeparatorProducer.GetItem: TdxReportCellBox; +begin + Result := TdxReportCellBox(inherited Item); +end; + +{ TcxTreeListControlReportLinkRowSubItemsProducer } + +procedure TcxTreeListControlReportLinkRowSubItemsProducer.CreateDataItems(AParent: TdxReportCell); +var + I: Integer; + Item: TAbstractdxReportCellData; +begin + for I := 0 to SubItemCount - 1 do + if HasSubItem[I] then + begin + Item := SubItemClasses[I].Create(AParent); + Item.BoundsRect := SubItemBounds[I]; + InitializeSubItem(Item, I); + end; +end; + +procedure TcxTreeListControlReportLinkRowSubItemsProducer.CreateIcons(AParent: TdxReportCell); +begin +end; + +procedure TcxTreeListControlReportLinkRowSubItemsProducer.CreateIndents(AParent: TdxReportCell); +begin +end; + +procedure TcxTreeListControlReportLinkRowSubItemsProducer.CreateRow; +begin + inherited; + CreateIndents(Row); + CreateIcons(Row); + CreateDataItems(Row); +end; + +procedure TcxTreeListControlReportLinkRowSubItemsProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AnIndex: Integer); +begin +end; + +function TcxTreeListControlReportLinkRowSubItemsProducer.GetHasSubItem(Index: Integer): Boolean; +begin + Result := True; +end; + +function TcxTreeListControlReportLinkRowSubItemsProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := MakeRect(0, 0, -1, -1); +end; + +function TcxTreeListControlReportLinkRowSubItemsProducer.GetSubItemCount: Integer; +begin + Result := Adapter.ColumnCount; +end; + +function TcxTreeListControlReportLinkRowSubItemsProducer.GetColumn(Index: Integer): TcxTreeListColumn; +begin + Result := Adapter.Columns[Index]; +end; + +{ TcxTreeListControlReportLinkBandsProducer } + +function TcxTreeListControlReportLinkBandsProducer.GetSubItemCount: Integer; +begin + Result := Adapter.BandCount; +end; + +procedure TcxTreeListControlReportLinkBandsProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeBandRow(Row); +end; + +procedure TcxTreeListControlReportLinkBandsProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AnIndex: Integer); +begin + inherited; + Formatter.DoInitializeBandItem(ASubItem, AnIndex); + Formatter.DoReportLinkInitializeBandItem(ASubItem, AnIndex); +end; + +function TcxTreeListControlReportLinkBandsProducer.GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TcxTreeListControlReportLinkBandsProducer.GetLineCount: Integer; +begin + Result := Adapter.BandLineCount; +end; + +function TcxTreeListControlReportLinkBandsProducer.GetLineHeight: Integer; +begin + Result := Formatter.BandLineHeight; +end; + +function TcxTreeListControlReportLinkBandsProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := Formatter.GetBandItemBounds(Index); +end; + +function TcxTreeListControlReportLinkBandsProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetBandItemClass(Index); +end; + +{ TcxTreeListControlReportLinkFootersProducer } + +procedure TcxTreeListControlReportLinkFootersProducer.CalculateRowHeight; +begin + if AutoHeight then + inherited + else + RowHeight := LineCount * LineHeight; +end; + +procedure TcxTreeListControlReportLinkFootersProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeFooterRow(Row); +end; + +procedure TcxTreeListControlReportLinkFootersProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AnIndex: Integer); +begin + inherited; + Formatter.DoInitializeFooterItem(ASubItem, AnIndex); + Formatter.DoReportLinkInitializeFooterItem(ASubItem, AnIndex); +end; + +function TcxTreeListControlReportLinkFootersProducer.GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TcxTreeListControlReportLinkFootersProducer.GetHasSubItem(Index: Integer): Boolean; +begin + Result := Adapter.HasFooterItem[Index]; +end; + +function TcxTreeListControlReportLinkFootersProducer.GetLineCount: Integer; +begin + Result := Adapter.DetailsLineCount; +end; + +function TcxTreeListControlReportLinkFootersProducer.GetLineHeight: Integer; +begin + Result := Formatter.FooterLineHeight; +end; + +function TcxTreeListControlReportLinkFootersProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := Formatter.GetFooterItemBounds(Index); +end; + +function TcxTreeListControlReportLinkFootersProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetFooterItemClass(Index); +end; + +{ TcxTreeListControlReportLinkHeadersProducer } + +procedure TcxTreeListControlReportLinkHeadersProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeHeaderRow(Row); +end; + +procedure TcxTreeListControlReportLinkHeadersProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AnIndex: Integer); +begin + inherited; + Formatter.DoInitializeHeaderItem(ASubItem, AnIndex); + Formatter.DoReportLinkInitializeHeaderItem(ASubItem, AnIndex); +end; + +function TcxTreeListControlReportLinkHeadersProducer.GetAutoHeight: Boolean; +begin + Result := inherited GetAutoHeight and Adapter.HeaderAutoHeight; +end; + +function TcxTreeListControlReportLinkHeadersProducer.GetLineCount: Integer; +begin + Result := Adapter.DetailsLineCount; +end; + +function TcxTreeListControlReportLinkHeadersProducer.GetLineHeight: Integer; +begin + Result := Formatter.HeaderLineHeight; +end; + +function TcxTreeListControlReportLinkHeadersProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := Formatter.GetHeaderItemBounds(Index); +end; + +function TcxTreeListControlReportLinkHeadersProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetHeaderItemClass(Index); +end; + +{ TcxTreeListControlReportLinkNodeProducer } + +constructor TcxTreeListControlReportLinkNodeProducer.Create(ABuilder: TcxTreeListControlReportLinkBuilder); +begin + inherited; + FIndents := TList.Create; +end; + +destructor TcxTreeListControlReportLinkNodeProducer.Destroy; +begin + FIndents.Free; + inherited; +end; + +function TcxTreeListControlReportLinkNodeProducer.Produce(AHostInfo: TcxTreeListControlAttributeHostInfo; + ANode: TcxTreeListNode): TdxReportCell; +begin + FIndents.Clear; + FNode := ANode; + Result := inherited Produce(AHostInfo); + FNode := nil; +end; + +function TcxTreeListControlReportLinkNodeProducer.Node: TcxTreeListNode; +begin + Result := FNode; +end; + +procedure TcxTreeListControlReportLinkNodeProducer.CalculateRowAutoHeight; +begin + if CellAutoHeight then + inherited CalculateRowAutoHeight; + if PreviewItem <> nil then + RowHeight := RowHeight + PreviewItem.Height; +end; + +procedure TcxTreeListControlReportLinkNodeProducer.CreateDataItems(AParent: TdxReportCell); +begin + inherited; + if HasPreview then CreatePreview(AParent); +end; + +procedure TcxTreeListControlReportLinkNodeProducer.CreateIcons(AParent: TdxReportCell); +begin + if Adapter.HasStateImages(Node) then CreateStateImages(AParent); + if Adapter.HasImages(Node) then CreateImages(AParent); +end; + +procedure TcxTreeListControlReportLinkNodeProducer.CreateImages(AParent: TdxReportCell); +begin + FImage := Formatter.GetNodeImageClass.Create(AParent); + FImage.BoundsRect := ImageRect; + InitializeImage(ImageIndentIndex); +end; + +procedure TcxTreeListControlReportLinkNodeProducer.CreateIndents(AParent: TdxReportCell); +var + I: Integer; + Indent: TdxReportCellExpandButton; +begin + inherited; + for I := 0 to IndentCount - 1 do + begin + Indent := Formatter.GetNodeIndentClass.Create(AParent); + Indent.BoundsRect := IndentBounds[I]; + InitializeIndent(Indent, I); + FIndents.Add(Indent); + end; +end; + +procedure TcxTreeListControlReportLinkNodeProducer.CreatePreview(AParent: TdxReportCell); +begin + FPreviewItem := Formatter.GetPreviewClass(PreviewColumn, Node).Create(AParent); + PreviewItem.Left := PreviewIndent; + // We have to set Width before because we use this value for PreviewHeight calculation + PreviewItem.Width := RowWidth - PreviewItem.Left; + Formatter.DoInitializePreview(FPreviewItem, PreviewColumn, Node); // v3.1 because cxRichEdit + PreviewItem.Height := PreviewHeight; + PreviewItem.AdjustContent(Formatter.DC); // v3.1 +end; + +procedure TcxTreeListControlReportLinkNodeProducer.CreateStateImages(AParent: TdxReportCell); +begin + FStateImage := Formatter.GetNodeStateImageClass.Create(AParent); + FStateImage.BoundsRect := StateImageRect; + InitializeStateImage(StateImageIndentIndex); +end; + +function TcxTreeListControlReportLinkNodeProducer.DoesItemParticipateInRowAutoHeightCalculation( + AnItem: TdxReportVisualItem): Boolean; +var + Column: TcxTreeListColumn; + Properties: TcxCustomEditProperties; +begin + Result := AnItem <> FPreviewItem; + // v3.2 + if Result and not IsItemIndent(AnItem) and IsDelphiObject(AnItem.Data) then + begin + Column := TcxTreeListColumn(AnItem.Data); + Properties := Adapter.GetProperties(Column, Node); + Result := dxPScxCommon.dxPSDataMaps.DoesItemParticipateInAutoHeightCalculation(Properties); + end; +end; + +procedure TcxTreeListControlReportLinkNodeProducer.FixupRowDataHeight; +var + NewHeight, I: Integer; + Item: TdxReportVisualItem; +begin + NewHeight := RowHeight; + if PreviewItem <> nil then + Dec(NewHeight, PreviewItem.Height); + + for I := 0 to Row.DataItemCount - 1 do + begin + Item := Row.DataItems[I]; + if Item = PreviewItem then + if PreviewPlace = tlppTop then + Item.Top := 0 + else + Item.Top := NewHeight + else + if IsItemIndent(Item) or (Item = StateImage) or (Item = Image) then + begin + Item.Top := 0; + Item.Height := RowHeight; + end + else + begin + if CellAutoHeight then + Item.Height := NewHeight; + if HasPreview and (PreviewPlace = tlppTop) then + Item.Top := Item.Top + PreviewItem.Height; + end; + end; + // v3.1 + for I := 0 to Row.CellCount - 1 do + begin + Item := Row.Cells[I]; + if Item = PreviewItem then + if PreviewPlace = tlppTop then + Item.Top := 0 + else + Item.Top := NewHeight + else + begin + if CellAutoHeight then + Item.Height := NewHeight; + if HasPreview and (PreviewPlace = tlppTop) then + Item.Top := Item.Top + PreviewItem.Height; + end; + end; +end; + +procedure TcxTreeListControlReportLinkNodeProducer.InitializeImage(AnIndex: Integer); +begin + Formatter.DoInitializeNodeImage(Image, Node, AnIndex); +end; + +procedure TcxTreeListControlReportLinkNodeProducer.InitializeIndent(AnIndent: TdxReportCellExpandButton; + AnIndex: Integer); +begin + Formatter.DoInitializeNodeIndent(AnIndent, AnIndex, IndentCount, Node); + Formatter.DoReportLinkInitializeNodeIndent(AnIndent, AnIndex, IndentCount, Node); +end; + +procedure TcxTreeListControlReportLinkNodeProducer.InitializeRow; +begin + inherited; + Formatter.DoInitializeNodeRow(Row, FNode); +end; + +procedure TcxTreeListControlReportLinkNodeProducer.InitializeStateImage(AnIndex: Integer); +begin + Formatter.DoInitializeNodeStateImage(StateImage, Node, AnIndex); + Formatter.DoReportLinkInitializeNodeStateImage(StateImage, Node, AnIndex); +end; + +procedure TcxTreeListControlReportLinkNodeProducer.InitializeSubItem(ASubItem: TAbstractdxReportCellData; + AnIndex: Integer); +begin + inherited; + Formatter.DoInitializeNodeItem(ASubItem, Columns[AnIndex], Node, False); + Formatter.DoReportLinkInitializeNodeItem(ASubItem, Columns[AnIndex], Node); +end; + +function TcxTreeListControlReportLinkNodeProducer.IsItemIndent(AnItem: TdxReportVisualItem): Boolean; +begin + Result := FIndents.IndexOf(AnItem) <> -1; +end; + +function TcxTreeListControlReportLinkNodeProducer.GetAutoHeight: Boolean; +begin + Result := CellAutoHeight or HasPreview; +end; + +function TcxTreeListControlReportLinkNodeProducer.GetCellAutoHeight: Boolean; +begin + Result := inherited GetAutoHeight and Adapter.CellAutoHeight; +end; + +function TcxTreeListControlReportLinkNodeProducer.GetHasPreview: Boolean; +begin + Result := Formatter.HasPreview; +end; + +function TcxTreeListControlReportLinkNodeProducer.GetImageRect: TRect; +begin + Result := MakeBounds(IndentWidth * IndentCount, 0, Adapter.GetImagesWidth(Node), RowHeight); + OffsetRect(Result, Adapter.GetStateImagesWidth(Node), 0); +end; + +function TcxTreeListControlReportLinkNodeProducer.GetIndentCount: Integer; +begin + Result := Formatter.IndentCounts[Node]; +end; + +function TcxTreeListControlReportLinkNodeProducer.GetLineCount: Integer; +begin + Result := Adapter.DetailsLineCount; +end; + +function TcxTreeListControlReportLinkNodeProducer.GetLineHeight: Integer; +begin + Result := Formatter.DetailsLineHeight; +end; + +function TcxTreeListControlReportLinkNodeProducer.GetPreviewHeight: Integer; +begin + Result := PreviewLineCount * PreviewLineHeight; + if not (Formatter.PreviewAutoHeight and (Formatter.PreviewMaxLineCount = 0)) then + Inc(Result, 2 * dxTextSpace); +end; + +function TcxTreeListControlReportLinkNodeProducer.GetPreviewIndent: Integer; +begin + Result := IndentArea + Adapter.GetStateImagesWidth(Node) + Adapter.GetImagesWidth(Node); +end; + +function TcxTreeListControlReportLinkNodeProducer.GetPreviewLineCount: Integer; +begin + if FPreviewItem <> nil then + if not Formatter.PreviewAutoHeight then + begin + Result := PreviewItem.CalculateLineCount(Formatter.DC); + if Result <> Formatter.PreviewMaxLineCount then + Result := Formatter.PreviewMaxLineCount; + end + else + Result := 1 + else + Result := 0; +end; + +function TcxTreeListControlReportLinkNodeProducer.GetPreviewLineHeight: Integer; +var + LineHeight: Integer; +begin + if FPreviewItem <> nil then + if Formatter.PreviewAutoHeight then + begin + Result := PreviewItem.MeasureContentHeight(Formatter.DC); + if Formatter.PreviewMaxLineCount <> 0 then + begin + LineHeight := PreviewItem.MeasureFontHeight(Formatter.DC) - 2 * dxTextSpace; + if Result > LineHeight * Formatter.PreviewMaxLineCount then + Result := LineHeight * Formatter.PreviewMaxLineCount; + end; + end + else + Result := PreviewItem.MeasureFontHeight(Formatter.DC) - 2 * dxTextSpace + else + Result := 0; +end; + +function TcxTreeListControlReportLinkNodeProducer.GetStateImageRect: TRect; +begin + Result := MakeBounds(IndentWidth * IndentCount, 0, Adapter.GetStateImagesWidth(Node), RowHeight); +end; + +function TcxTreeListControlReportLinkNodeProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := Formatter.GetNodeItemBounds(Node, Index, IndentCount); +end; + +function TcxTreeListControlReportLinkNodeProducer.GetSubItemClass(Index: Integer): TdxReportCellDataClass; +begin + Result := Formatter.GetNodeItemClass(Columns[Index], Node, False); +end; + +function TcxTreeListControlReportLinkNodeProducer.GetImageIndentIndex: Integer; +begin + Result := IndentCount; + if Adapter.HasStateImages(Node) then Inc(Result); +end; + +function TcxTreeListControlReportLinkNodeProducer.GetIndent(Index: Integer): TdxReportCellExpandButton; +begin + Result := FIndents[Index]; +end; + +function TcxTreeListControlReportLinkNodeProducer.GetIndentArea: Integer; +begin + Result := IndentCount * IndentWidth; +end; + +function TcxTreeListControlReportLinkNodeProducer.GetIndentBound(Index: Integer): TRect; +begin + Result := MakeBounds(IndentWidth * Index, 0, IndentWidth, RowHeight); +end; + +function TcxTreeListControlReportLinkNodeProducer.GetPreviewColumn: TcxTreeListColumn; +begin + Result := Adapter.PreviewColumn; +end; + +function TcxTreeListControlReportLinkNodeProducer.GetPreviewPlace: TcxTreeListPreviewPlace; +begin + Result := Adapter.PreviewPlace; +end; + +function TcxTreeListControlReportLinkNodeProducer.GetStateImageIndentIndex: Integer; +begin + Result := IndentCount; +end; + +{ TcxTreeListControlReportLinkCategorizedNodeProducer } + +function TcxTreeListControlReportLinkCategorizedNodeProducer.GetSubItemBound(Index: Integer): TRect; +begin + Result := MakeRect(IndentWidth * IndentCount + Adapter.GetImagesWidth(Node) + + Adapter.GetStateImagesWidth(Node), 0, RowWidth, RowHeight); +end; + +function TcxTreeListControlReportLinkCategorizedNodeProducer.GetSubItemCount: Integer; +begin + Result := 1; +end; + +{ TcxTreeListNodeHelper } + +constructor TcxTreeListNodeHelper.Create(AnAdapter: TcxTreeListControlAdapter); +begin + inherited Create; + FAdapter := AnAdapter; +end; + +class function TcxTreeListNodeHelper.PairClass: TClass; +begin + Result := NodeClass; +end; + +class function TcxTreeListNodeHelper.ProducerClass: TcxTreeListControlReportLinkNodeProducerClass; +begin + Result := TcxTreeListControlReportLinkNodeProducer; +end; + +class procedure TcxTreeListNodeHelper.Register; +begin + cxTreeListNodeHelperFactory.Register(Self); +end; + +class procedure TcxTreeListNodeHelper.Unregister; +begin + cxTreeListNodeHelperFactory.Unregister(Self); +end; + +function TcxTreeListNodeHelper.Adapter: TcxTreeListControlAdapter; +begin + Result := FAdapter; +end; + +function TcxTreeListNodeHelper.GetHasSelectedChildren: Boolean; +var + SaveNode: TcxTreeListNode; + I: Integer; +begin + Result := True; + SaveNode := Node; + try + with Node do + for I := 0 to Count - 1 do + begin + Node := Items[I]; + if Node.Selected or Adapter.Helpers[Node].HasSelectedChildren then Exit; + end; + finally + Node := SaveNode; + end; + Result := False; +end; + +function TcxTreeListNodeHelper.GetHasSelectedParents: Boolean; +var + Parent: TcxTreeListNode; +begin + Parent := Node; + while (Parent <> nil) and not Parent.Selected do + Parent := Parent.Parent; + Result := Parent <> nil; +end; + +class function TcxTreeListNodeHelper.NodeClass: TcxTreeListNodeClass; +begin + Result := TcxTreeListNode; +end; + +{ TcxTreeListNodeHelperCache } + +constructor TcxTreeListNodeHelperCache.Create(AnAdapter: TcxTreeListControlAdapter); +begin + inherited Create; + FAdapter := AnAdapter; +end; + +function TcxTreeListNodeHelperCache.IndexOf(Node: TcxTreeListNode): Integer; +begin + for Result := 0 to Count - 1 do + if Items[Result].NodeClass = Node.ClassType then Exit; + + Result := Add(cxTreeListNodeHelperFactory.HelperClasses[Node].Create(Adapter)); +end; + +function TcxTreeListNodeHelperCache.GetHelper(Node: TcxTreeListNode): TcxTreeListNodeHelper; +begin + Result := Items[IndexOf(Node)]; + Result.Node := Node; +end; + +function TcxTreeListNodeHelperCache.GetItem(Index: Integer): TcxTreeListNodeHelper; +begin + Result := TcxTreeListNodeHelper(inherited Items[Index]); +end; + +{ TcxTreeListControlReportLinkProducerCache } + +constructor TcxTreeListControlReportLinkProducerCache.Create(ABuilder: TcxTreeListControlReportLinkBuilder); +begin + inherited Create; + FBuilder := ABuilder; +end; + +function TcxTreeListControlReportLinkProducerCache.IndexOf(AProducerClass: TcxTreeListControlReportLinkRowProducerClass): Integer; +begin + for Result := 0 to Count - 1 do + if Items[Result].ClassType = AProducerClass then Exit; + + Result := Add(AProducerClass.Create(Builder)); +end; + +function TcxTreeListControlReportLinkProducerCache.GetProducer(ProducerClass: TcxTreeListControlReportLinkRowProducerClass): TcxTreeListControlReportLinkRowProducer; +begin + Result := Items[IndexOf(ProducerClass)]; +end; + +function TcxTreeListControlReportLinkProducerCache.GetItem(Index: Integer): TcxTreeListControlReportLinkRowProducer; +begin + Result := TcxTreeListControlReportLinkRowProducer(inherited Items[Index]); +end; + +{ TcxTreeListControlReportLinkBuilder } + +constructor TcxTreeListControlReportLinkBuilder.Create(AReportLink: TcxTreeListControlReportLink); +begin + inherited Create; + FReportLink := AReportLink; + FAdapter := AdapterClass.Create(Self); + FFormatter := FormatterClass.Create(Self); + FProducerCache := TcxTreeListControlReportLinkProducerCache.Create(Self); + FReportRows := TList.Create; + Adapter.Calculate(AvailableWidth, AutoWidth); +end; + +destructor TcxTreeListControlReportLinkBuilder.Destroy; +begin + FreeAndNil(FReportRows); + FreeAndNil(FProducerCache); + FreeAndNil(FFormatter); + FreeAndNil(FAdapter); + inherited; +end; + +procedure TcxTreeListControlReportLinkBuilder.Build; +begin + BeforeBuilding; + try + DoBuild; + finally + AfterBuilding; + end; +end; + +procedure TcxTreeListControlReportLinkBuilder.Progress(const APercentDone: Double); +begin + ReportLink.DoProgress(APercentDone); +end; + +function TcxTreeListControlReportLinkBuilder.Adapter: TcxTreeListControlAdapter; +begin + Result := FAdapter; +end; + +class function TcxTreeListControlReportLinkBuilder.AdapterClass: TcxTreeListControlAdapterClass; +begin + Result := TcxTreeListControlAdapter; +end; + +function TcxTreeListControlReportLinkBuilder.Formatter: TcxTreeListControlReportLinkFormatter; +begin + Result := FFormatter; +end; + +class function TcxTreeListControlReportLinkBuilder.FormatterClass: TcxTreeListControlReportLinkFormatterClass; +begin + Result := TcxTreeListControlReportLinkFormatter; +end; + +procedure TcxTreeListControlReportLinkBuilder.AddReportRow(ARow: TdxReportCell); +begin + if ARow.Parent = ReportLink.ReportCells.Cells then + FReportRows.Add(ARow); +end; + +procedure TcxTreeListControlReportLinkBuilder.AfterBuilding; +begin + Formatter.AfterBuilding; + Adapter.AfterBuilding; +end; + +procedure TcxTreeListControlReportLinkBuilder.BeforeBuilding; +begin + Adapter.BeforeBuilding; + Formatter.BeforeBuilding; +end; + +procedure TcxTreeListControlReportLinkBuilder.CreateBands; +begin + AddReportRow(GetBandsProducer.Produce(ReportLink.HostInfoServices.BandHeadersHostInfo)); +end; + +function TcxTreeListControlReportLinkBuilder.GetBandsProducer: TcxTreeListControlReportLinkBandsProducer; +begin + Result := ProducerCache[GetBandsProducerClass] as TcxTreeListControlReportLinkBandsProducer; +end; + +function TcxTreeListControlReportLinkBuilder.GetBandsProducerClass: TcxTreeListControlReportLinkBandsProducerClass; +begin + Result := TcxTreeListControlReportLinkBandsProducer; +end; + +procedure TcxTreeListControlReportLinkBuilder.CreateFooters; +begin + AddReportRow(GetFootersProducer.Produce(ReportLink.HostInfoServices.FootersHostInfo)); +end; + +function TcxTreeListControlReportLinkBuilder.GetFootersProducer: TcxTreeListControlReportLinkFootersProducer; +begin + Result := ProducerCache[GetFootersProducerClass] as TcxTreeListControlReportLinkFootersProducer; +end; + +function TcxTreeListControlReportLinkBuilder.GetFootersProducerClass: TcxTreeListControlReportLinkFootersProducerClass; +begin + Result := TcxTreeListControlReportLinkFootersProducer; +end; + +procedure TcxTreeListControlReportLinkBuilder.CreateHeaders; +begin + AddReportRow(GetHeadersProducer.Produce(ReportLink.HostInfoServices.HeadersHostInfo)); +end; + +function TcxTreeListControlReportLinkBuilder.GetHeadersProducer: TcxTreeListControlReportLinkHeadersProducer; +begin + Result := ProducerCache[GetHeadersProducerClass] as TcxTreeListControlReportLinkHeadersProducer; +end; + +function TcxTreeListControlReportLinkBuilder.GetHeadersProducerClass: TcxTreeListControlReportLinkHeadersProducerClass; +begin + Result := TcxTreeListControlReportLinkHeadersProducer; +end; + +procedure TcxTreeListControlReportLinkBuilder.CreateNode(ANode: TcxTreeListNode); +begin + AddReportRow(GetNodeProducer(ANode).Produce(ReportLink.HostInfoServices.PageDetailsHostInfo, ANode)); +end; + +procedure TcxTreeListControlReportLinkBuilder.CreateNodes; +var + HasNodeSeparator: Boolean; + I: Integer; + Node: TcxTreeListNode; +begin + HasNodeSeparator := Formatter.HasNodeSeparator; + for I := 0 to Formatter.NodeCount - 1 do + begin + Node := Formatter.Nodes[I]; + CreateNode(Node); + if HasNodeSeparator and (I < Formatter.NodeCount - 1) then + CreateNodeSeparator(Node); + + Progress(100 * (I + 1) / Formatter.NodeCount); + if IsAborted then Break; + end; +end; + +function TcxTreeListControlReportLinkBuilder.GetNodeProducer(ANode: TcxTreeListNode): TcxTreeListControlReportLinkNodeProducer; +begin + Result := ProducerCache[GetNodeProducerClass(ANode)] as TcxTreeListControlReportLinkNodeProducer; +end; + +function TcxTreeListControlReportLinkBuilder.GetNodeProducerClass(ANode: TcxTreeListNode): TcxTreeListControlReportLinkNodeProducerClass; +begin + if Adapter.IsGroupNode(ANode) then + Result := TcxTreeListControlReportLinkCategorizedNodeProducer + else + Result := Adapter.Helpers[ANode].ProducerClass; +end; + +procedure TcxTreeListControlReportLinkBuilder.CreateNodeSeparator(ANode: TcxTreeListNode); +begin + AddReportRow(GetNodeSeparatorProducer.Produce(ReportLink.HostInfoServices.PageDetailsHostInfo)); +end; + +function TcxTreeListControlReportLinkBuilder.GetNodeSeparatorProducer: TcxTreeListControlReportLinkNodeSeparatorProducer; +begin + Result := ProducerCache[GetNodeSeparatorProducerClass] as TcxTreeListControlReportLinkNodeSeparatorProducer; +end; + +function TcxTreeListControlReportLinkBuilder.GetNodeSeparatorProducerClass: TcxTreeListControlReportLinkNodeSeparatorProducerClass; +begin + Result := TcxTreeListControlReportLinkNodeSeparatorProducer; +end; + +procedure TcxTreeListControlReportLinkBuilder.DoBuild; +begin + if Formatter.ShowBandHeaders then CreateBands; + if Formatter.ShowHeaders then CreateHeaders; + CreateNodes; + + if not IsAborted and Formatter.ShowFooters then + CreateFooters; +end; + +function TcxTreeListControlReportLinkBuilder.IsAborted: Boolean; +begin + Result := ReportLink.AbortBuilding; +end; + +function TcxTreeListControlReportLinkBuilder.GetAutoWidth: Boolean; +begin + Result := ReportLink.OptionsSize.AutoWidth; +end; + +function TcxTreeListControlReportLinkBuilder.GetAvailableWidth: Integer; +var + ControllerIntf: IdxReportLinkController; + R: TRect; +begin + if Formatter.AutoWidth then + if ReportLink.IsAggregated and + Supports(TObject(ReportLink.Controller), IdxReportLinkController, ControllerIntf) then + R := ControllerIntf.GetControlSiteBounds(ReportLink.TreeListControl) + else + R := ReportLink.RealPrinterPage.PaintRectPixels + else + R := TreeListControl.ClientBounds; + + Result := R.Right - R.Left - 1; +end; + +function TcxTreeListControlReportLinkBuilder.GetHost: TdxReportCell; +begin + Result := ReportLink.ReportCells.Cells; +end; + +function TcxTreeListControlReportLinkBuilder.GetReportCells: TdxReportCells; +begin + Result := ReportLink.ReportCells; +end; + +function TcxTreeListControlReportLinkBuilder.GetReportRow(Index: Integer): TdxReportCell; +begin + Result := TdxReportCell(FReportRows[Index]); +end; + +function TcxTreeListControlReportLinkBuilder.GetReportRowCount: Integer; +begin + Result := FReportRows.Count; +end; + +function TcxTreeListControlReportLinkBuilder.GetTreeListControl: TcxCustomTreeListControl; +begin + Result := ReportLink.TreeListControl; +end; + +{ TcxTreeListReportLinkBuilderHandler } + +constructor TcxTreeListReportLinkBuilderHandler.Create(ABuilder: TcxTreeListControlReportLinkBuilder); +begin + inherited Create; + FBuilder := ABuilder; +end; + +function TcxTreeListReportLinkBuilderHandler.Builder: TcxTreeListControlReportLinkBuilder; +begin + Result := FBuilder; +end; + +function TcxTreeListReportLinkBuilderHandler.GetReportLink: TcxTreeListControlReportLink; +begin + Result := Builder.ReportLink; +end; + +{ TcxTreeListControlAdapter } + +constructor TcxTreeListControlAdapter.Create(ABuilder: TcxTreeListControlReportLinkBuilder); +begin + inherited; + FHelperCache := TcxTreeListNodeHelperCache.Create(Self); + FBandLineCount := 1; + FDetailsLineCount := 1; + FFooterLineCount := 1; +end; + +destructor TcxTreeListControlAdapter.Destroy; +begin + FreeAndNil(FHelperCache); + inherited; +end; + +procedure TcxTreeListControlAdapter.AfterBuilding; +begin +end; + +procedure TcxTreeListControlAdapter.BeforeBuilding; +begin +end; + +procedure TcxTreeListControlAdapter.AfterCalculate; +begin +end; + +procedure TcxTreeListControlAdapter.BeforeCalculate; +begin + SetLength(FBandPlaces, 0); + SetLength(FBandWidths, 0); + SetLength(FColumnPlaces, 0); + SetLength(FColumnWidths, 0); +end; + +procedure TcxTreeListControlAdapter.Calculate(AAvailableWidth: Integer; AnAutoWidth: Boolean); +begin + AvailableWidth := AAvailableWidth; + AutoWidth := AnAutoWidth; + + BeforeCalculate; + try + DoCalculate; + finally + AfterCalculate; + end; +end; + +procedure TcxTreeListControlAdapter.CalculateBandPlaces; +var + I, Origin: Integer; +begin + SetLength(FBandPlaces, BandCount); + + Origin := 0; + for I := 0 to BandCount - 1 do + begin + FBandPlaces[I] := MakeRect(Origin, 0, BandWidths[I], 0); + Inc(Origin, BandWidths[I]); + end +end; + +procedure TcxTreeListControlAdapter.CalculateBandWidths; +var + I: Integer; +begin + SetLength(FBandWidths, BandCount); + + for I := 0 to BandCount - 1 do + if AutoWidth then + FBandWidths[I] := Bands[I].DisplayWidth + else + FBandWidths[I] := Bands[I].Width; +end; + +procedure TcxTreeListControlAdapter.CalculateColumnPlaces; +var + BandIndex, RowIndex, ColIndex, BandOrigin, ColumnOrigin, ColumnWidth: Integer; + BandRows: TcxTreeListBandRows; + BandRow: TcxTreeListBandRow; + Column: TcxTreeListColumn; +begin + SetLength(FColumnPlaces, ColumnCount); + SetLength(FBandPlaces, BandCount); + + for BandIndex := 0 to BandCount - 1 do + begin + BandOrigin := BandOrigins[BandIndex]; + BandRows := Bands[BandIndex].BandRows; + for RowIndex := 0 to BandRows.Count - 1 do + begin + ColumnOrigin := BandOrigin; + BandRow := BandRows.Items[RowIndex]; + for ColIndex := 0 to BandRow.Count - 1 do + begin + Column := BandRow.Items[ColIndex]; + ColumnWidth := ColumnWidths[Column.VisibleIndex]; + with FColumnPlaces[Column.VisibleIndex] do + begin + Left := ColumnOrigin; + Right := ColumnOrigin + ColumnWidth; + RowIndex := BandRow.LineOffset;//Index; //TODO: BandRow.VisibleIndex; + LineCount := Column.Position.LineCount; + end; + Inc(ColumnOrigin, ColumnWidth); + end; + end; + FBandPlaces[BandIndex] := MakeBounds(BandOrigin, 0, BandWidths[BandIndex], 0); + end; +end; + +procedure TcxTreeListControlAdapter.CalculateColumnWidths; + + procedure CalculateBandWidths; + + procedure CalculateBandWidths(ABand: TcxTreeListBand; var AMinWidth, AWidth: Integer); + var + RowMinWidth, RowWidth, RowIndex, ColIndex: Integer; + NeedCalculateWidth: Boolean; + Row: TcxTreeListBandRow; + Column: TcxTreeListColumn; + begin + AMinWidth := 0; + AWidth := ABand.Width; + NeedCalculateWidth := AWidth = 0;//cxTL.cxTreeListDefWidth; //TODO: CalculateBandWidths !? + + if ABand.BandRows.Count <> 0 then + begin + for RowIndex := 0 to ABand.BandRows.Count - 1 do + begin + Row := ABand.BandRows.Items[RowIndex]; + + RowMinWidth := 0; + RowWidth := 0; + for ColIndex := 0 to Row.Count - 1 do + begin + Column := Row.Items[ColIndex]; + //Inc(RowMinWidth, Column.MinWidth); + //if Column.IsLeftMost then + // Inc(RowMinWidth, IndentWidth); + Inc(RowMinWidth, Column.RealMinWidth); + if NeedCalculateWidth then + Inc(RowWidth, Column.DisplayWidth); // TODO: GetColumnWidth + end; + + if RowMinWidth > AMinWidth then AMinWidth := RowMinWidth; + if RowWidth > AWidth then AWidth := RowWidth; + end; + if AWidth < AMinWidth then AWidth := AMinWidth; + end + else + if NeedCalculateWidth then AWidth := cxTL.cxTreeListDefWidth; + end; + + procedure AssignBandWidths; + var + I, MinWidth, Width: Integer; + begin + for I := 0 to BandCount - 1 do + begin + CalculateBandWidths(Bands[I], MinWidth, Width); + FBandWidths[I] := Width; + end; + end; + + procedure CalculateBandAutoWidths; + var + AutoWidthObject: cxClasses.TcxAutoWidthObject; + I, MinWidthValue, WidthValue: Integer; + Band: TcxTreeListBand; + AutoWidthItem: cxClasses.TcxAutoWidthItem; + begin + AutoWidthObject := cxClasses.TcxAutoWidthObject.Create(BandCount); + try + for I := 0 to BandCount - 1 do + begin + Band := Bands[I]; + CalculateBandWidths(Band, MinWidthValue, WidthValue); + AutoWidthItem := AutoWidthObject.AddItem; + with AutoWidthItem do + begin + Width := WidthValue; + MinWidth := MinWidthValue; + Fixed := not Band.Options.Sizing; + end; + end; + AutoWidthObject.AvailableWidth := AvailableWidth; + AutoWidthObject.Calculate; + for I := 0 to BandCount - 1 do + FBandWidths[I]:= AutoWidthObject[I].AutoWidth; + finally + AutoWidthObject.Free; + end; + end; + + begin + if AutoWidth or OptionsView.ColumnAutoWidth then + CalculateBandAutoWidths + else + AssignBandWidths; + end; + + procedure CalculateBandColumnWidths; + + procedure CalculateBandRowColumnWidths(ABand: TcxTreeListBand; ABandWidth: Integer; + ABandRow: TcxTreeListBandRow); + var + AutoWidthObject: cxClasses.TcxAutoWidthObject; + I, ColumnIndex: Integer; + AutoWidthItem: cxClasses.TcxAutoWidthItem; + begin + AutoWidthObject := cxClasses.TcxAutoWidthObject.Create(ABandRow.Count); + try + for I := 0 to ABandRow.Count - 1 do + begin + AutoWidthItem := AutoWidthObject.AddItem; + with ABandRow.Items[I] do + begin + AutoWidthItem.Width := ABandRow.Items[I].DisplayWidth; + AutoWidthItem.MinWidth := ABandRow.Items[I].RealMinWidth; + AutoWidthItem.Fixed := ABand.FixedKind <> tlbfNone; + end; + end; + AutoWidthObject.AvailableWidth := ABandWidth; + AutoWidthObject.Calculate; + + for I := 0 to ABandRow.Count - 1 do + begin + ColumnIndex := ABandRow.Items[I].VisibleIndex; + FColumnWidths[ColumnIndex]:= AutoWidthObject[I].AutoWidth; + end; + finally + AutoWidthObject.Free; + end; + end; + + var + BandIndex, RowIndex, BandWidth: Integer; + Band: TcxTreeListBand; + begin + for BandIndex := 0 to BandCount - 1 do + begin + BandWidth := BandWidths[BandIndex]; + Band := Bands[BandIndex]; + for RowIndex := 0 to Band.BandRows.Count - 1 do + CalculateBandRowColumnWidths(Band, BandWidth, Band.BandRows.Items[RowIndex]); + end; + end; + +begin + SetLength(FBandWidths, BandCount); + SetLength(FColumnWidths, ColumnCount); + + CalculateBandWidths; + CalculateBandColumnWidths; +end; + +procedure TcxTreeListControlAdapter.CalculateLineCounts; +begin + BandLineCount := OptionsView.BandLineCount; + DetailsLineCount := CustomTreeListControl_GetHeaderLineCount(TreeListControl); + FooterLineCount := CustomTreeListControl_GetHeaderLineCount(TreeListControl); +end; + +procedure TcxTreeListControlAdapter.DoCalculate; +begin + CalculateLineCounts; + CalculateBandWidths; + CalculateBandPlaces; + CalculateColumnWidths; + CalculateColumnPlaces; +end; + +class function TcxTreeListControlAdapter.GetProperties(AColumn: TcxTreeListColumn; + ANode: TcxTreeListNode): TcxCustomEditProperties; +begin + Result := TreeListColumn_DoGetEditProperties(AColumn, ANode); + if Result = nil then + Result := GetRepositoryItem(AColumn, ANode).Properties; +end; + +class function TcxTreeListControlAdapter.GetPropertiesClass(AColumn: TcxTreeListColumn; + ANode: TcxTreeListNode): TcxCustomEditPropertiesClass; +begin + Result := TcxCustomEditPropertiesClass(GetProperties(AColumn, ANode).ClassType); +end; + +class function TcxTreeListControlAdapter.GetRepositoryItem(AColumn: TcxTreeListColumn; + ANode: TcxTreeListNode): TcxEditRepositoryItem; +begin + Result := AColumn.RepositoryItem; +end; + +function TcxTreeListControlAdapter.GetBackgroundViewParams: TcxViewParams; +begin + Result := Styles.GetBackgroundParams; +end; + +function TcxTreeListControlAdapter.GetBandBackgroundViewParams: TcxViewParams; +begin + Result := Styles.GetBandBackgroundParams(nil); +end; + +function TcxTreeListControlAdapter.GetBandHeaderViewParams(ABand: TcxTreeListBand): TcxViewParams; +begin + Result := Styles.GetBandHeaderParams(ABand); + if ABand = nil then + Result.Color := LookAndFeelPainter.DefaultHeaderBackgroundColor +end; + +function TcxTreeListControlAdapter.GetContentViewParams(ANode: TcxTreeListNode; + AColumn: TcxTreeListColumn): TcxViewParams; +begin + Result := Styles.GetContentParams(ANode, AColumn); + // v3.2 + if Result.Color = clWindow then + Result.Color := dxPSCore.dxDefaultContentColor; +end; + +function TcxTreeListControlAdapter.GetColumnFooterViewParams(AColumn: TcxTreeListColumn): TcxViewParams; +begin + Result := Styles.GetColumnFooterParams(AColumn); + Result.Color := LookAndFeelPainter.DefaultHeaderColor +end; + +function TcxTreeListControlAdapter.GetColumnHeaderViewParams(AColumn: TcxTreeListColumn): TcxViewParams; +begin + if AColumn = nil then + begin + FillChar(Result, SizeOf(Result), 0); + Result.Color := LookAndFeelPainter.DefaultHeaderBackgroundColor; + end + else + Result := Styles.GetColumnHeaderParams(AColumn); +end; + +function TcxTreeListControlAdapter.GetIndentViewParams(ANode: TcxTreeListNode; + AnIndent: Integer): TcxViewParams; +begin + Result := Styles.GetIndentParams(ANode, AnIndent); + // v3.2 + if Result.Color = clWindow then + Result.Color := dxPSCore.dxDefaultContentColor; +end; + +function TcxTreeListControlAdapter.GetPreviewViewParams(ANode: TcxTreeListNode; + AColumn: TcxTreeListColumn): TcxViewParams; +begin + Result := Styles.GetPreviewParams(ANode); + // v3.2 + if Result.Color = clWindow then + Result.Color := dxPSCore.dxDefaultContentColor; +end; + +function TcxTreeListControlAdapter.GetFooterRowViewParams: TcxViewParams; +begin + Result := Styles.GetFooterParams; +end; + +function TcxTreeListControlAdapter.GetSelectionViewParams: TcxViewParams; +begin + FillChar(Result, SizeOf(Result), 0); + with Styles.Selection do + begin + Result.Bitmap := nil; + Result.Color := Color; + Result.Font := Font; + Result.TextColor := TextColor; + end; +end; + +function TcxTreeListControlAdapter.HasSelectionStyle: Boolean; +begin + Result := Styles.Selection <> nil; +end; + +function TcxTreeListControlAdapter.GetBackgroundBitmap(Index: Integer): TBitmap; +begin + Result := Styles.GetBitmap(Index); +end; + +function TcxTreeListControlAdapter.HasBackgroundBitmap(Index: Integer): Boolean; +begin + Result := GetBackgroundBitmap(Index) <> nil; +end; + +function TcxTreeListControlAdapter.GetImagesHeight(ANode: TcxTreeListNode): Integer; +begin + if HasImages(ANode) then + Result := 1 + Images.Height + 1 + else + Result := 0; +end; + +function TcxTreeListControlAdapter.GetImagesWidth(ANode: TcxTreeListNode): Integer; +begin + if HasImages(ANode) then + Result := 1 + Images.Width + 1 + else + Result := 0; +end; + +function TcxTreeListControlAdapter.GetStateImagesHeight(ANode: TcxTreeListNode): Integer; +begin + if HasStateImages(ANode) then + Result := 1 + StateImages.Height + 1 + else + Result := 0; +end; + +function TcxTreeListControlAdapter.GetStateImagesWidth(ANode: TcxTreeListNode): Integer; +begin + if HasStateImages(ANode) then + Result := 1 + StateImages.Width + 1 + else + Result := 0; +end; + +function TcxTreeListControlAdapter.HasImages(ANode: TcxTreeListNode): Boolean; +begin + Result := Images <> nil; + if Result and (ANode <> nil) then + Result := (ANode.ImageIndex > -1) and (ANode.ImageIndex < Images.Count); +end; + +function TcxTreeListControlAdapter.HasStateImages(ANode: TcxTreeListNode): Boolean; +begin + Result := StateImages <> nil; + if Result and (ANode <> nil) then + Result := (ANode.StateIndex > -1) and (ANode.StateIndex < StateImages.Count); +end; + +function TcxTreeListControlAdapter.IsGroupNode(ANode: TcxTreeListNode): Boolean; +begin + Result := CustomTreeListControl_DoIsGroupNode(TreeListControl, ANode); +end; + +function TcxTreeListControlAdapter.GetBand(Index: Integer): TcxTreeListBand; +begin + Result := CustomTreeListControl_GetVisibleBand(TreeListControl, Index); +end; + +function TcxTreeListControlAdapter.GetBandCount: Integer; +begin + Result := CustomTreeListControl_GetVisibleBandCount(TreeListControl); +end; + +function TcxTreeListControlAdapter.GetBandOrigin(Index: Integer): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Index - 1 do + Inc(Result, BandWidths[I]); +end; + +function TcxTreeListControlAdapter.GetBandPlace(Index: Integer): TRect; +begin + Result := FBandPlaces[Index]; +end; + +function TcxTreeListControlAdapter.GetBandWidth(Index: Integer): Integer; +begin + Result := FBandWidths[Index]; +end; + +function TcxTreeListControlAdapter.GetCanUseLookAndFeelColors: Boolean; +begin + Result := CustomTreeListControl_GetLookAndFeel(TreeListControl).NativeStyle and + dxThemeManager.AreVisualStylesAvailable; +end; + +function TcxTreeListControlAdapter.GetCategorizedColumn: TcxTreeListColumn; +begin + Result := OptionsView.GetCategorizedColumn; +end; + +function TcxTreeListControlAdapter.GetColumnCount: Integer; +begin + Result := CustomTreeListControl_GetVisibleColumnCount(TreeListControl); +end; + +function TcxTreeListControlAdapter.GetCellAutoHeight: Boolean; +begin + Result := OptionsView.CellAutoHeight and (DetailsLineCount = 1); +end; + +function TcxTreeListControlAdapter.GetCellEndEllipsis: Boolean; +begin + Result := OptionsView.CellEndEllipsis; +end; + +function TcxTreeListControlAdapter.GetCellMultiline: Boolean; +begin + Result := OptionsView.CellAutoHeight and (DetailsLineCount = 1); +end; + +function TcxTreeListControlAdapter.GetColumn(Index: Integer): TcxTreeListColumn; +begin + Result := CustomTreeListControl_GetVisibleColumn(TreeListControl, Index); +end; + +function TcxTreeListControlAdapter.GetColumnPlace(Index: Integer): TdxTLColumnPlace; +begin + Result := FColumnPlaces[Index]; +end; + +function TcxTreeListControlAdapter.GetColumnWidth(Index: Integer): Integer; +begin + Result := FColumnWidths[Index]; +end; + +function TcxTreeListControlAdapter.GetDefaultRowHeight: Integer; +begin + Result := TreeListControl.DefaultRowHeight; +end; + +function TcxTreeListControlAdapter.GetFooterItemText(Index: Integer): string; +begin + Result := Columns[Index].SummaryFooter.SummaryText; +end; + +function TcxTreeListControlAdapter.GetGridLines: TcxTreeListGridLines; +begin + Result := OptionsView.GridLines; +end; + +function TcxTreeListControlAdapter.GetGridLinesColor: TColor; +begin + Result := OptionsView.GridLineColor; +end; + +function TcxTreeListControlAdapter.GetHasFooterItem(Index: Integer): Boolean; +begin + Result := Columns[Index].Options.Footer; +end; + +function TcxTreeListControlAdapter.GetHasPreview: Boolean; +begin + Result := PreviewColumn <> nil; +end; + +function TcxTreeListControlAdapter.GetHeaderAutoHeight: Boolean; +begin + Result := (DetailsLineCount = 1) and OptionsView.CellAutoHeight; +end; + +function TcxTreeListControlAdapter.GetHelper(Node: TcxTreeListNode): TcxTreeListNodeHelper; +begin + Result := FHelperCache.Helpers[Node]; +end; + +function TcxTreeListControlAdapter.GetIndentWidth: Integer; +begin + Result := GetStateImagesWidth(nil); + if GetImagesWidth(nil) > GetStateImagesWidth(nil) then + Result := GetImagesWidth(nil); + if Result = 0 then + Result := DefaultIndentWidth; +end; + +function TcxTreeListControlAdapter.GetIsDefaultRowHeightAssigned: Boolean; +begin + Result := DefaultRowHeight <> 0; +end; + +function TcxTreeListControlAdapter.GetImages: TCustomImageList; +begin + Result := CustomTreeListControl_GetImages(TreeListControl); +end; + +function TcxTreeListControlAdapter.GetIsNodeColorUsedForIndents: Boolean; +begin + Result := OptionsView.UseNodeColorForIndent; +end; + +function TcxTreeListControlAdapter.GetLookAndFeelKind: TcxLookAndFeelKind; +begin + Result := CustomTreeListControl_GetLookAndFeel(TreeListControl).Kind; +end; + +function TcxTreeListControlAdapter.GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := CustomTreeListControl_GetLookAndFeelPainter(TreeListControl); +end; + +function TcxTreeListControlAdapter.GetMultiSelection: Boolean; +begin + Result := CustomTreeListControl_GetOptionsSelection(TreeListControl).MultiSelect; +end; + +function TcxTreeListControlAdapter.GetNode(Index: Integer): TcxTreeListNode; +begin + Result := CustomTreeListControl_GetNodes(TreeListControl).Root[Index]; +end; + +function TcxTreeListControlAdapter.GetNodeCount: Integer; +begin + Result := CustomTreeListControl_GetNodes(TreeListControl).Root.Count; +end; + +function TcxTreeListControlAdapter.GetOptionsView: TcxTreeListOptionsView; +begin + Result := CustomTreeListControl_GetOptionsView(TreeListControl); +end; + +function TcxTreeListControlAdapter.GetPaintStyle: TcxTreeListPaintStyle; +begin + Result := OptionsView.PaintStyle; +end; + +function TcxTreeListControlAdapter.GetPreviewColumn: TcxTreeListColumn; +begin + Result := CustomTreeListControl_GetPreview(TreeListControl).Column; +end; + +function TcxTreeListControlAdapter.GetPreviewLeftIndent: Integer; +begin + Result := CustomTreeListControl_GetPreview(TreeListControl).LeftIndent; +end; + +function TcxTreeListControlAdapter.GetPreviewPlace: TcxTreeListPreviewPlace; +begin + Result := CustomTreeListControl_GetPreview(TreeListControl).Place; +end; + +function TcxTreeListControlAdapter.GetPreviewRightIndent: Integer; +begin + Result := CustomTreeListControl_GetPreview(TreeListControl).RightIndent; +end; + +function TcxTreeListControlAdapter.GetShowRoot: Boolean; +begin + Result := OptionsView.ShowRoot; +end; + +function TcxTreeListControlAdapter.GetShowHorzGridLines: Boolean; +begin + Result := GridLines in [tlglHorz, tlglBoth]; +end; + +function TcxTreeListControlAdapter.GetShowTreeLines: Boolean; +begin + Result := OptionsView.TreeLineStyle <> tllsNone; +end; + +function TcxTreeListControlAdapter.GetShowVertGridLines: Boolean; +begin + Result := GridLines in [tlglVert, tlglBoth]; +end; + +function TcxTreeListControlAdapter.GetStateImages: TCustomImageList; +begin + Result := CustomTreeListControl_GetStateImages(TreeListControl); +end; + +function TcxTreeListControlAdapter.GetStyles: TcxTreeListStyles; +begin + Result := CustomTreeListControl_GetStyles(TreeListControl); +end; + +function TcxTreeListControlAdapter.GetThemedBandHeaderItemColor: TColor; +begin + Result := LookAndFeelPainter.DefaultHeaderColor; +end; + +function TcxTreeListControlAdapter.GetThemedBandHeaderItemTextColor: TColor; +begin + Result := LookAndFeelPainter.DefaultHeaderTextColor; +end; + +function TcxTreeListControlAdapter.GetThemedFooterItemColor: TColor; +begin + Result := LookAndFeelPainter.DefaultFooterColor; +end; + +function TcxTreeListControlAdapter.GetThemedFooterItemTextColor: TColor; +begin + Result := LookAndFeelPainter.DefaultFooterTextColor; +end; + +function TcxTreeListControlAdapter.GetThemedHeaderItemColor: TColor; +begin + Result := LookAndFeelPainter.DefaultHeaderColor; +end; + +function TcxTreeListControlAdapter.GetThemedHeaderItemTextColor: TColor; +begin + Result := LookAndFeelPainter.DefaultHeaderTextColor; +end; + +function TcxTreeListControlAdapter.GetThemedHeaderRowColor: TColor; +begin + Result := LookAndFeelPainter.DefaultHeaderBackgroundColor; +end; + +function TcxTreeListControlAdapter.GetTreeLinesColor: TColor; +begin + Result := OptionsView.TreeLineColor; +end; + +function TcxTreeListControlAdapter.GetTreeLinesStyle: TcxTreeListTreeLineStyle; +begin + Result := OptionsView.TreeLineStyle; +end; + +function TcxTreeListControlAdapter.GetTreeListControl: TcxCustomTreeListControl; +begin + Result := Builder.TreeListControl; +end; + +function TcxTreeListControlAdapter.GetUseStylesForIndents: Boolean; +begin + Result := OptionsView.UseNodeColorForIndent; +end; + +function TcxTreeListControlAdapter.GetViewWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to BandCount - 1 do + Inc(Result, BandWidths[I]); +end; + +{ TcxTreeListControlReportLinkFormatter } + +constructor TcxTreeListControlReportLinkFormatter.Create(ABuilder: TcxTreeListControlReportLinkBuilder); +begin + inherited; + FFont := TFont.Create; + FLookAndFeelItems := TList.Create; + FNodes := TList.Create; + CreateNodeList; + FTransparentColor := dxPSCore.dxDefaultContentColor; +end; + +destructor TcxTreeListControlReportLinkFormatter.Destroy; +begin + FreeAndNil(FNodes); + FreeAndNil(FLookAndFeelItems); + FreeAndNil(FFont); + inherited; +end; + +function TcxTreeListControlReportLinkFormatter.Adapter: TcxTreeListControlAdapter; +begin + Result := Builder.Adapter; +end; + +procedure TcxTreeListControlReportLinkFormatter.DoInitializeHost(AHost: TdxReportCell); +begin + AHost.CellSides := []; + AHost.Transparent := True; +end; + +procedure TcxTreeListControlReportLinkFormatter.DoInitializeBandItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +var + Band: TcxTreeListBand; +begin + Band := Adapter.Bands[AnIndex]; + SetViewParams(AnItem, GetBandItemViewParams(Band)); + RegisterLookAndFeelItem(AnItem, cesRaised); + if HasBackgroundBitmap(tlsv_BandHeader) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(tlsv_BandHeader); + + with AnItem as TdxReportCellImage do + begin + Data := Integer(Band); + EndEllipsis := Band.Caption.ShowEndEllipsis; + if not Band.Caption.Glyph.Empty then + begin + Image := Band.Caption.Glyph; + ImageLayout := HeaderImageLayoutMap[Band.Caption.GlyphAlignHorz, Band.Caption.GlyphAlignVert]; + ImageTransparent := True; + IsTextDrawnForCenteredImage := True; + IsTextShiftedForHorizontallyCenteredImage := not (ImageLayout in [ilImageTopCenter, ilImageCenterCenter, ilImageBottomCenter]); + end; + Multiline := Band.Caption.Multiline; + Text := Band.Caption.Text; + TextAlignX := TextAlignXMap[Band.Caption.AlignHorz]; + TextAlignY := TextAlignYMap[Band.Caption.AlignVert]; + end; +end; + +procedure TcxTreeListControlReportLinkFormatter.DoInitializeBandRow(ARow: TdxReportCell); +begin + //SetViewParams(ARow, GetBandBackgroundViewParams); + ARow.Transparent := True; //??? + ARow.Data := Integer(TcxTreeListBandAttribute); +end; + +procedure TcxTreeListControlReportLinkFormatter.DoReportLinkInitializeBandItem(AnItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + ReportLink.DoInitializeBandCell(Adapter.Bands[AIndex], TdxReportCellImage(AnItem)); +end; + +function TcxTreeListControlReportLinkFormatter.GetBandBackgroundViewParams: TdxReportItemViewParams; +begin + Result.NativeParams := Adapter.GetBandBackgroundViewParams; + Result.CellSides := []; + Result.FontStyle := []; + Result.Transparent := True; +end; + +function TcxTreeListControlReportLinkFormatter.GetBandItemBounds(Index: Integer): TRect; +begin + Result := Adapter.BandPlaces[Index]; + Result.Bottom := Result.Top + BandLineHeight * Adapter.BandLineCount; +end; + +function TcxTreeListControlReportLinkFormatter.GetBandItemClass(Index: Integer): TdxReportCellTextClass; +begin + Result := TdxReportCellImage; +end; + +function TcxTreeListControlReportLinkFormatter.GetBandItemViewParams(ABand: TcxTreeListBand): TdxReportItemViewParams; +begin + FillChar(Result, SizeOf(Result), 0); + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetBandHeaderParams(ABand, Result.NativeParams) + else + Result.NativeParams := Adapter.GetBandHeaderViewParams(ABand); + + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + if ABand <> nil then + begin + Result.NativeParams.Color := Adapter.ThemedBandHeaderItemColor; + Result.NativeParams.TextColor := Adapter.ThemedBandHeaderItemTextColor; + end; + + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); // ReportLink.FixedTransparent; +end; + +procedure TcxTreeListControlReportLinkFormatter.DoInitializeFooterItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +var + Column: TcxTreeListColumn; +begin + Column := Adapter.Columns[AnIndex]; + SetViewParams(AnItem, GetFooterItemViewParams(Column)); + RegisterLookAndFeelItem(AnItem, cesSunken); + if HasBackgroundBitmap(tlsv_ColumnFooter) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(tlsv_ColumnFooter); + + with AnItem as TdxReportCellString do + begin + Data := Integer(Column); + //ExcludeFromClipRgn := True; + Multiline := Column.SummaryFooter.MultiLine; + Text := Adapter.FooterItemTexts[AnIndex]; + TextAlignX := TextAlignXMap[Column.SummaryFooter.AlignHorz]; + TextAlignY := TextAlignYMap[Column.SummaryFooter.AlignVert]; + end; +end; + +procedure TcxTreeListControlReportLinkFormatter.DoInitializeFooterRow(ARow: TdxReportCell); +begin + SetViewParams(ARow, GetFooterRowViewParams); + RegisterLookAndFeelItem(ARow, cesRaised); + ARow.Data := Integer(TcxTreeListFooterAttribute); +end; + +procedure TcxTreeListControlReportLinkFormatter.DoReportLinkInitializeFooterItem(AnItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + ReportLink.DoInitializeFooterCell(Adapter.Columns[AIndex], TdxReportCellString(AnItem)); +end; + +function TcxTreeListControlReportLinkFormatter.GetFooterItemBounds(Index: Integer): TRect; +begin + with Adapter.ColumnPlaces[Index] do + Result := MakeRect(Left, RowIndex * FooterLineHeight, Right, (RowIndex + LineCount) * FooterLineHeight); + + InflateRect(Result, -FooterItemInflateHorz, -FooterItemInflateVert); + if Adapter.Columns[Index].IsLeftMost then + Inc(Result.Left, 2); +end; + +function TcxTreeListControlReportLinkFormatter.GetFooterItemClass(AnIndex: Integer): TdxReportCellTextClass; +begin + Result := TdxReportCellString; +end; + +function TcxTreeListControlReportLinkFormatter.GetFooterItemViewParams(AColumn: TcxTreeListColumn): TdxReportItemViewParams; +begin + FillChar(Result, SizeOf(Result), 0); + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetColumnFooterParams(nil, AColumn, Result.NativeParams) + else + Result.NativeParams := Adapter.GetColumnFooterViewParams(AColumn); + + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + if AColumn <> nil then + begin + Result.NativeParams.Color := Adapter.ThemedFooterItemColor; + Result.NativeParams.TextColor := Adapter.ThemedFooterItemTextColor; + end; + + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); +end; + +function TcxTreeListControlReportLinkFormatter.GetFooterRowViewParams: TdxReportItemViewParams; +begin + FillChar(Result, SizeOf(Result), 0); + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetFooterRowParams(Result.NativeParams) + else + Result.NativeParams := Adapter.GetFooterRowViewParams; + + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); +end; + +procedure TcxTreeListControlReportLinkFormatter.DoInitializeHeaderItem(AnItem: TAbstractdxReportCellData; + AnIndex: Integer); +var + Column: TcxTreeListColumn; +begin + Column := Adapter.Columns[AnIndex]; + SetViewParams(AnItem, GetHeaderItemViewParams(Column)); + RegisterLookAndFeelItem(AnItem, cesRaised); + if HasBackgroundBitmap(tlsv_ColumnHeader) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(tlsv_ColumnHeader); + + with AnItem as TdxReportCellImage do + begin + Data := Integer(Column); + EndEllipsis := Column.Caption.ShowEndEllipsis; + if not Column.Caption.Glyph.Empty then + begin + Image := Column.Caption.Glyph; + ImageLayout := HeaderImageLayoutMap[Column.Caption.GlyphAlignHorz, Column.Caption.GlyphAlignVert]; + IsTextDrawnForCenteredImage := True; + IsTextShiftedForHorizontallyCenteredImage := not (ImageLayout in [ilImageTopCenter, ilImageCenterCenter, ilImageBottomCenter]); + end; + Multiline := Column.Caption.MultiLine; + SortOrder := SortOrderMap[Column.SortOrder]; + Text := Column.Caption.Text; + TextAlignX := TextAlignXMap[Column.Caption.AlignHorz]; + TextAlignY := TextAlignYMap[Column.Caption.AlignVert]; + end; +end; + +procedure TcxTreeListControlReportLinkFormatter.DoInitializeHeaderRow(ARow: TdxReportCell); +begin +// SetViewParams(ARow, GetHeaderItemViewParams(Adapter.Columns[0])); + SetViewParams(ARow, GetHeaderItemViewParams(nil)); + ARow.Data := Integer(TcxTreeListHeaderAttribute); +end; + +procedure TcxTreeListControlReportLinkFormatter.DoReportLinkInitializeHeaderItem(AnItem: TAbstractdxReportCellData; + AIndex: Integer); +begin + ReportLink.DoInitializeHeaderCell(Adapter.Columns[AIndex], TdxReportCellImage(AnItem)); +end; + +function TcxTreeListControlReportLinkFormatter.GetHeaderItemBounds(Index: Integer): TRect; +begin + with Adapter.ColumnPlaces[Index] do + Result := MakeRect(Left, RowIndex * HeaderLineHeight, Right, (RowIndex + LineCount) * HeaderLineHeight); +end; + +function TcxTreeListControlReportLinkFormatter.GetHeaderItemClass(AnIndex: Integer): TdxReportCellTextClass; +begin + Result := TdxReportCellImage; +end; + +function TcxTreeListControlReportLinkFormatter.GetHeaderItemViewParams(AColumn: TcxTreeListColumn): TdxReportItemViewParams; +begin + FillChar(Result, SizeOf(Result), 0); + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetColumnHeaderParams(AColumn, Result.NativeParams) + else + Result.NativeParams := Adapter.GetColumnHeaderViewParams(AColumn); + + if UseLookAndFeelColors and Adapter.CanUseLookAndFeelColors then + if AColumn <> nil then + begin + Result.NativeParams.Color := Adapter.ThemedHeaderItemColor; + Result.NativeParams.TextColor := Adapter.ThemedHeaderItemTextColor; + end; + + Result.CellSides := csAll; + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.FixedTransparent; +end; + +procedure TcxTreeListControlReportLinkFormatter.DoInitializeNodeImage(AnItem: TdxReportCellGraphic; + ANode: TcxTreeListNode; AnIndex: Integer); +begin + SetViewParams(AnItem, GetNodeImageViewParams(ANode, AnIndex)); + if HasBackgroundBitmap(tlsv_Content) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(tlsv_Content); + + AnItem.Data := MakeIndentIndex(AnIndex); + AnItem.DrawMode := gdmCenter; + AnItem.ImageIndex := ANode.ImageIndex; + AnItem.ImageList := Adapter.Images; + AnItem.ImageTransparent := True; +end; + +procedure TcxTreeListControlReportLinkFormatter.DoReportLinkInitializeNodeImage(AnItem: TAbstractdxReportCellData; + ANode: TcxTreeListNode; AnIndex: Integer); +begin + ReportLink.DoInitializeIndentCell(ANode, AnIndex, AnItem); +end; + +function TcxTreeListControlReportLinkFormatter.GetNodeImageCellSides(ANode: TcxTreeListNode; + AnIndex: Integer): TdxCellSides; +begin + Result := []; + if ((AnIndex <> 0) and Adapter.ShowVertGridLines and not Adapter.HasStateImages(ANode)) or + ((AnIndex = 0) and ReportLink.OptionsView.Borders) then + Include(Result, csLeft); + if Adapter.ShowHorzGridLines then + begin + if not IsFirstNode(ANode) then Include(Result, csTop); + if not IsLastNode(ANode) then Include(Result, csBottom); + end; + if ReportLink.OptionsView.Borders then + begin + if IsFirstNode(ANode) then Include(Result, csTop); + if IsLastNode(ANode) then Include(Result, csBottom); + end; +end; + +function TcxTreeListControlReportLinkFormatter.GetNodeImageClass: TdxReportCellGraphicClass; +begin + Result := TdxReportCellGraphic; +end; + +function TcxTreeListControlReportLinkFormatter.GetNodeImageViewParams(ANode: TcxTreeListNode; + AnIndex: Integer): TdxReportItemViewParams; +begin + FillChar(Result, SizeOf(Result), 0); + if ReportLink.OptionsFormatting.UseNativeStyles then + if CanProcessSelectionStyle(ANode) then + ReportLink.Styles.GetSelectionParams(Result.NativeParams) + else + ReportLink.Styles.GetImagesParams(ANode, Result.NativeParams) + else + if CanProcessSelectionStyle(ANode) then + Result.NativeParams := Adapter.GetSelectionViewParams + else + Result.NativeParams := Adapter.GetIndentViewParams(ANode, AnIndex); + + Result.CellSides := GetNodeImageCellSides(ANode, AnIndex); + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); // ReportLink.FixedTransparent; +end; + +procedure TcxTreeListControlReportLinkFormatter.DoInitializeNodeIndent(AnItem: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ANode: TcxTreeListNode); +begin + SetViewParams(AnItem, GetNodeIndentViewParams(ANode, AnIndex, AnIndentCount)); + if HasBackgroundBitmap(tlsv_Content) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(tlsv_Content); + + AnItem.Data := MakeIndentIndex(AnIndex); + AnItem.ShowButton := (AnIndex = AnIndentCount - 1) and ANode.HasChildren and ReportLink.OptionsView.ExpandButtons; + if AnItem.ShowButton then + DoInitializeExpandButton(AnItem, AnIndex, AnIndentCount, ANode); + if ReportLink.OptionsView.TreeLines then + AnItem.TreeLineMode := GetNodeIndentTreeLineMode(AnIndex, AnIndentCount, ANode); +end; + +procedure TcxTreeListControlReportLinkFormatter.DoInitializeExpandButton(AnItem: TdxReportCellExpandButton; + AnIndex, AnIndentCount: Integer; ANode: TcxTreeListNode); +begin + with AnItem do + begin + ButtonExpanded := IsNodeExpanded(ANode); + ButtonSize := ExpandButtonSize; + ButtonInteriorColor := ExpandButtonColor; + ButtonTransparent := IsColorTransparent(ButtonInteriorColor); + end; +end; + +procedure TcxTreeListControlReportLinkFormatter.DoReportLinkInitializeNodeIndent(AnItem: TAbstractdxReportCellData; + AnIndex, AnIndentCount: Integer; ANode: TcxTreeListNode); +begin + ReportLink.DoInitializeIndentCell(ANode, AnIndex, AnItem); +end; + +function TcxTreeListControlReportLinkFormatter.GetNodeIndentCellSides(ANode: TcxTreeListNode; + AnIndex, AnIndentCount: Integer): TdxCellSides; +var + Level: Integer; + NextNode: TcxTreeListNode; +begin + Result := []; + if not ReportLink.OptionsView.Borders then Exit; + if Adapter.ShowVertGridLines then + Result := csLeftRight; + if (AnIndex = 0) and not ReportLink.OptionsView.Borders then + Exclude(Result, csLeft); + + if Adapter.ShowHorzGridLines then + begin + if not IsFirstNode(ANode) and (AnIndex = ANode.Level) then + Include(Result, csTop); + if not IsLastNode(ANode) then + begin + Level := 0; + NextNode := GetNextNode(ANode); + if NextNode <> nil then + Level := NextNode.Level; + if (ANode.Level > Level) and (AnIndex >= Level) then + Include(Result, csBottom); + end; + end; + if ReportLink.OptionsView.Borders then + begin + if IsFirstNode(ANode) then Include(Result, csTop); + if IsLastNode(ANode) then Include(Result, csBottom); + end; +end; + +function TcxTreeListControlReportLinkFormatter.GetNodeIndentClass: TdxReportCellExpandButtonClass; +begin + Result := TdxReportCellExpandButton; +end; + +function TcxTreeListControlReportLinkFormatter.GetNodeIndentTreeLineMode(AnIndex, + AnIndentCount: Integer; ANode: TcxTreeListNode): TdxPSTreeLineMode; +var + Level: Integer; + Parent: TcxTreeListNode; +begin + Level := AnIndentCount - AnIndex - 1; +// if Adapter.ShowRoot then Dec(Level); + Parent := GetNodeParent(ANode, Level); + + if Parent = ANode then + if IsNodeLastChild(ANode) then + Result := tlmBottomRightCorner + else + if not HasParent(ANode) and IsNodeFirstChild(ANode) then + Result := tlmTopRightCorner + else + Result := tlmCross + else + if IsNodeLastChild(Parent) then + Result := tlmNone + else + Result := tlmVertical; +end; + +function TcxTreeListControlReportLinkFormatter.GetNodeIndentViewParams(ANode: TcxTreeListNode; + AnIndex, AnIndentCount: Integer): TdxReportItemViewParams; +begin + FillChar(Result, 0, SizeOf(Result)); + if ReportLink.OptionsFormatting.UseNativeStyles then + if CanProcessSelectionStyle(ANode) then + ReportLink.Styles.GetSelectionParams(Result.NativeParams) + else + ReportLink.Styles.GetIndentParams(ANode, AnIndex, Result.NativeParams) + else + if CanProcessSelectionStyle(ANode) then + Result.NativeParams := Adapter.GetSelectionViewParams + else + Result.NativeParams := Adapter.GetIndentViewParams(ANode, AnIndex); + +// if not CanProcessSelectionStyle(ANode) and not IsNodeColorUsedForIndents then +// Result.Color := ReportLink.Color; + + Result.CellSides := GetNodeIndentCellSides(ANode, AnIndex, AnIndentCount); + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.FixedTransparent +end; + +procedure TcxTreeListControlReportLinkFormatter.DoInitializeNodeRow(ARow: TdxReportCell; + ANode: TcxTreeListNode); +const + CellSidesMap: array[Boolean] of TdxCellSides = ([], csLeftRight); +begin + ARow.CellSides := CellSidesMap[ReportLink.OptionsView.Borders]; + ARow.Data := Integer(ANode); + ARow.Transparent := True; + + ReportLink.AddReportRow(ARow); +end; + +procedure TcxTreeListControlReportLinkFormatter.DoInitializeNodeItem(AnItem: TAbstractdxReportCellData; + AColumn: TcxTreeListColumn; ANode: TcxTreeListNode; AnIsPreview: Boolean = False); + + function GetViewParams: TdxReportItemViewParams; + begin + if AnIsPreview then + Result := GetPreviewViewParams(AColumn, ANode) + else + Result := GetNodeItemViewParams(AColumn, ANode); + end; + +var + Properties: TcxCustomEditProperties; + ViewParams: TdxReportItemViewParams; + CellValue: TcxEditValue; +begin + Properties := Adapter.GetProperties(AColumn, ANode); + ViewParams := GetViewParams; + CellValue := GetCellValue(Properties, AColumn, ANode); + dxPScxCommon.dxPSDataMaps.InitializeItem(AnItem, Properties, CellValue, Self, ViewParams, AnIsPreview, ANode.RecordIndex); + dxPScxCommon.dxPSDataMaps.GetImageLists(Properties, ReportLink.AppendImageList); + SetViewParams(AnItem, ViewParams); + + with ViewParams, NativeParams do + if (Bitmap <> nil) and not Bitmap.Empty then + AnItem.BackgroundBitmapIndex := ReportLink.AddBackgroundBitmapToPool(Bitmap); + + AnItem.Data := Integer(AColumn); +end; + +procedure TcxTreeListControlReportLinkFormatter.DoReportLinkInitializeNodeItem(AnItem: TAbstractdxReportCellData; + AColumn: TcxTreeListColumn; ANode: TcxTreeListNode); +begin + ReportLink.DoInitializeCell(ANode, AColumn, AnItem); +end; + +function TcxTreeListControlReportLinkFormatter.GetCellValue(AProperties: TcxCustomEditProperties; + AColumn: TcxTreeListColumn; ANode: TcxTreeListNode): TcxEditValue; +begin + if AProperties.GetEditValueSource(False) = evsValue then + Result := ANode.Values[ColumnIndex(AColumn)] + else + Result := ANode.Texts[ColumnIndex(AColumn)]; +end; + +function TcxTreeListControlReportLinkFormatter.GetNodeBackgroundBitmapStyleIndex(ANode: TcxTreeListNode): Integer; + + function HasBackgroundBitmap(AStyle: TcxStyle): Boolean; + begin + Result := (AStyle <> nil) and (svBitmap in AStyle.AssignedValues); + end; + +begin + Result := tlsv_Content; + if IsOddNode(ANode) and HasBackgroundBitmap(ReportLink.Styles.StylesByCaption[cxGetResourceString(@sdxContentOddStyle)]) then + Result := tlsv_ContentOdd + else + if not IsOddNode(ANode) and HasBackgroundBitmap(ReportLink.Styles.StylesByCaption[cxGetResourceString(@sdxContentEvenStyle)]) then + Result := tlsv_ContentEven +end; + +function TcxTreeListControlReportLinkFormatter.GetNodeItemBounds(ANode: TcxTreeListNode; + Index, IndentCount: Integer): TRect; +begin + with Adapter.ColumnPlaces[Index] do + Result := MakeRect(Left, RowIndex * DetailsLineHeight, Right, (RowIndex + LineCount) * DetailsLineHeight); + + if Adapter.Columns[Index].IsLeftMost then + Inc(Result.Left, (Adapter.IndentWidth * IndentCount) + Adapter.GetImagesWidth(ANode) + Adapter.GetStateImagesWidth(ANode)); +end; + +function TcxTreeListControlReportLinkFormatter.GetNodeItemCellSides(AColumn: TcxTreeListColumn; + ANode: TcxTreeListNode): TdxCellSides; +begin + if ReportLink.OptionsView.Borders then + begin + Result := csAll; + if AColumn.IsLeftMost and ((IndentCounts[ANode] <> 0) or Adapter.HasImages(nil) or Adapter.HasStateImages(nil)) then + Exclude(Result, csLeft); + end + else + Result := []; +end; + +function TcxTreeListControlReportLinkFormatter.GetNodeItemClass(AColumn: TcxTreeListColumn; + ANode: TcxTreeListNode; AnIsPreview: Boolean = False): TdxReportCellDataClass; +begin + Result := dxPSDataMaps.ItemClass(Adapter.GetProperties(AColumn, ANode), AnIsPreview); +end; + +function TcxTreeListControlReportLinkFormatter.GetNodeItemViewParams(AColumn: TcxTreeListColumn; + ANode: TcxTreeListNode): TdxReportItemViewParams; +begin + FillChar(Result, 0, SizeOf(Result)); + if ReportLink.OptionsFormatting.UseNativeStyles then + if CanProcessSelectionStyle(ANode) then + ReportLink.Styles.GetSelectionParams(Result.NativeParams) + else + ReportLink.Styles.GetContentParams(ANode, AColumn, Result.NativeParams) + else + if CanProcessSelectionStyle(ANode) then + Result.NativeParams := Adapter.GetSelectionViewParams + else + Result.NativeParams := Adapter.GetContentViewParams(ANode, AColumn); + + Result.CellSides := GetNodeItemCellSides(AColumn, ANode); + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.Transparent; + +end; + +procedure TcxTreeListControlReportLinkFormatter.DoInitializePreview(AnItem: TAbstractdxReportCellData; + AColumn: TcxTreeListColumn; ANode: TcxTreeListNode); +begin + DoInitializeNodeItem(AnItem, AColumn, ANode, True); +end; + +function TcxTreeListControlReportLinkFormatter.GetPreviewCellSides(ANode: TcxTreeListNode): TdxCellSides; +begin + Result := CellSidesMap[Adapter.GridLines]; + if (IndentCounts[ANode] <> 0) or Adapter.HasImages(nil) or Adapter.HasStateImages(nil) then + Exclude(Result, csLeft); + if ReportLink.OptionsView.Borders then + begin + Include(Result, csRight); + if IsLastNode(ANode) then + Include(Result, csBottom); + end + else + Exclude(Result, csRight); +end; + +function TcxTreeListControlReportLinkFormatter.GetPreviewClass(AColumn: TcxTreeListColumn; + ANode: TcxTreeListNode): TdxReportCellDataClass; +begin + Result := GetNodeItemClass(AColumn, ANode, True); +end; + +function TcxTreeListControlReportLinkFormatter.GetPreviewViewParams(AColumn: TcxTreeListColumn; + ANode: TcxTreeListNode): TdxReportItemViewParams; +begin + FillChar(Result, SizeOf(Result), 0); + if ReportLink.OptionsFormatting.UseNativeStyles then + if CanProcessSelectionStyle(ANode) then + ReportLink.Styles.GetSelectionParams(Result.NativeParams) + else + ReportLink.Styles.GetPreviewParams(ANode, AColumn, Result.NativeParams) + else + if CanProcessSelectionStyle(ANode) then + Result.NativeParams := Adapter.GetSelectionViewParams + else + Result.NativeParams := Adapter.GetPreviewViewParams(ANode, AColumn); + + Result.CellSides := GetPreviewCellSides(ANode); + Result.FontStyle := []; + Result.Transparent := {True;//}IsColorTransparent(Result.NativeParams.Color); //ReportLink.Transparent; +end; + +procedure TcxTreeListControlReportLinkFormatter.DoInitializeNodeSeparator(AnItem: TdxReportCellBox); +begin + with AnItem do + begin + CellSides := csAll; + Color := NodeSeparatorColor; + Transparent := False; + end; +end; + +procedure TcxTreeListControlReportLinkFormatter.DoInitializeNodeSeparatorRow(ARow: TdxReportCell); +begin +end; + +function TcxTreeListControlReportLinkFormatter.GetNodeSeparatorClass: TdxReportCellBoxClass; +begin + Result := TdxReportCellBox; +end; + +{ state images } + +procedure TcxTreeListControlReportLinkFormatter.DoInitializeNodeStateImage(AnItem: TdxReportCellGraphic; + ANode: TcxTreeListNode; AnIndex: Integer); +begin + SetViewParams(AnItem, GetNodeStateImageViewParams(ANode, AnIndex)); + if HasBackgroundBitmap(tlsv_Content) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(tlsv_Content); + + AnItem.Data := MakeIndentIndex(AnIndex); + AnItem.DrawMode := gdmCenter; + AnItem.ImageIndex := ANode.StateIndex; + AnItem.ImageList := Adapter.StateImages; + AnItem.ImageTransparent := True; +end; + +procedure TcxTreeListControlReportLinkFormatter.DoReportLinkInitializeNodeStateImage(AnItem: TAbstractdxReportCellData; + ANode: TcxTreeListNode; AnIndex: Integer); +begin + ReportLink.DoInitializeIndentCell(ANode, AnIndex, AnItem); +end; + +function TcxTreeListControlReportLinkFormatter.GetNodeStateImageCellSides(ANode: TcxTreeListNode; + AnIndex: Integer): TdxCellSides; +begin + Result := []; + if ((AnIndex <> 0) and Adapter.ShowVertGridLines) or ((AnIndex = 0) and ReportLink.OptionsView.Borders) then + Include(Result, csLeft); + + if Adapter.ShowHorzGridLines then + begin + if not IsFirstNode(ANode) then Include(Result, csTop); + if not IsLastNode(ANode) then Include(Result, csBottom); + end; + if ReportLink.OptionsView.Borders then + begin + if IsFirstNode(ANode) then Include(Result, csTop); + if IsLastNode(ANode) then Include(Result, csBottom); + end; +end; + +function TcxTreeListControlReportLinkFormatter.GetNodeStateImageClass: TdxReportCellGraphicClass; +begin + Result := TdxReportCellGraphic; +end; + +function TcxTreeListControlReportLinkFormatter.GetNodeStateImageViewParams(ANode: TcxTreeListNode; + AnIndex: Integer): TdxReportItemViewParams; +begin + FillChar(Result, SizeOf(Result), 0); + if ReportLink.OptionsFormatting.UseNativeStyles then + if CanProcessSelectionStyle(ANode) then + ReportLink.Styles.GetSelectionParams(Result.NativeParams) + else + ReportLink.Styles.GetImagesParams(ANode, Result.NativeParams) + else + if CanProcessSelectionStyle(ANode) then + Result.NativeParams := Adapter.GetSelectionViewParams + else + Result.NativeParams := Adapter.GetIndentViewParams(ANode, AnIndex); + + Result.CellSides := GetNodeStateImageCellSides(ANode, AnIndex); + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); // ReportLink.FixedTransparent; +end; + +function TcxTreeListControlReportLinkFormatter.QueryInterface(const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +function TcxTreeListControlReportLinkFormatter._AddRef: Integer; +begin + Result := 1; +end; + +function TcxTreeListControlReportLinkFormatter._Release: Integer; +begin + Result := 1; +end; + +function TcxTreeListControlReportLinkFormatter.IdxPSCellParams_GetAutoHeight: Boolean; +begin + Result := Adapter.CellAutoHeight; +end; + +function TcxTreeListControlReportLinkFormatter.IdxPSCellParams_GetDC: HDC; +begin + Result := Self.DC; +end; + +function TcxTreeListControlReportLinkFormatter.IdxPSCellParams_GetDisplayGraphicsAsText: Boolean; +begin + Result := ReportLink.OptionsRefinements.DisplayGraphicsAsText; +end; + +function TcxTreeListControlReportLinkFormatter.IdxPSCellParams_GetEndEllipsis: Boolean; +begin + Result := Adapter.CellEndEllipsis; +end; + +function TcxTreeListControlReportLinkFormatter.IdxPSCellParams_GetFlatCheckMarks: Boolean; +begin + Result := ReportLink.OptionsRefinements.FlatCheckMarks; +end; + +function TcxTreeListControlReportLinkFormatter.IdxPSCellParams_GetGraphicsText: string; +begin + Result := ReportLink.OptionsRefinements.GraphicsText; +end; + +function TcxTreeListControlReportLinkFormatter.IdxPSCellParams_GetMultiline: Boolean; +begin + Result := Adapter.CellMultiline; +end; + +function TcxTreeListControlReportLinkFormatter.IdxPSCellParams_GetTransparentGraphics: Boolean; +begin + Result := ReportLink.OptionsRefinements.TransparentGraphics; +end; + +function TcxTreeListControlReportLinkFormatter.IdxPSCellParams2_GetPreviewMarginLeft: Integer; +begin + Result := Adapter.PreviewLeftIndent; +end; + +function TcxTreeListControlReportLinkFormatter.IdxPSCellParams2_GetPreviewMarginRight: Integer; +begin + Result := Adapter.PreviewRightIndent; +end; + +function TcxTreeListControlReportLinkFormatter.IdxPSCellParams2_GetPreviewMaxHeight: Integer; +begin + if PreviewAutoHeight then + Result := -1 + else + Result := PreviewLineHeight * PreviewMaxLineCount; +end; + +function TcxTreeListControlReportLinkFormatter.IdxPSCellParams2_GetPreviewMaxLineCount: Integer; +begin + Result := PreviewMaxLineCount; +end; + +function TcxTreeListControlReportLinkFormatter.IdxPSCellParams2_GetRichEditGraphicClass: TGraphicClass; +const + GraphicClasses: array[Boolean] of TGraphicClass = (TMetafile, TBitmap); +begin + Result := GraphicClasses[IdxPSCellParams2_GetRichEditTransparent]; +end; + +function TcxTreeListControlReportLinkFormatter.IdxPSCellParams2_GetRichEditTransparent: Boolean; +begin + {$IFDEF DXVER500} + Result := ReportLink.OptionsRefinements.TransparentRichEdits; + {$ELSE} + Result := False; + {$ENDIF} +end; + +procedure TcxTreeListControlReportLinkFormatter.AddDelimiters; +begin + with ReportLink.OptionsPagination do + begin + if Band or Column then AddHorizontalDelimiters; + if Node then AddVerticalDelimiters; + end; +end; + +procedure TcxTreeListControlReportLinkFormatter.AddHorizontalDelimiters; +var + X, I: Integer; +begin + if ReportLink.OptionsPagination.Band then + begin + X := 0; + for I := 0 to Adapter.BandCount - 1 do + begin + ReportLink.AddHorizontalDelimiter(X); + Inc(X, Adapter.BandWidths[I]); + end; + end + else + for I := 0 to Adapter.ColumnCount - 1 do + with Adapter.ColumnPlaces[I] do + begin + ReportLink.AddHorizontalDelimiter(Left); + ReportLink.AddHorizontalDelimiter(Right); + end; +end; + +procedure TcxTreeListControlReportLinkFormatter.AddVerticalDelimiters; +var + I: Integer; +begin + for I := 0 to Builder.ReportRowCount - 1 do + ReportLink.AddVerticalDelimiter(Builder.ReportRows[I]); +end; + +procedure TcxTreeListControlReportLinkFormatter.AfterBuilding; +begin + if not Builder.IsAborted then + begin + FormatLookAndFeelItems; + AddDelimiters; + Builder.ReportCells.BorderColor := GridLinesColor; + Builder.ReportCells.TreeLineColor := Adapter.TreeLinesColor; + Builder.ReportCells.TreeLineStyle := TreeLinesStyleMap[Adapter.TreeLinesStyle]; + end; +end; + +procedure TcxTreeListControlReportLinkFormatter.BeforeBuilding; +begin + CalculateLineHeights; +end; + +procedure TcxTreeListControlReportLinkFormatter.CalculateLineHeights; +var + I: Integer; + Column: TcxTreeListColumn; +begin + FBandLineHeight := 0; + FDetailsLineHeight := Adapter.DefaultRowHeight; + FFooterLineHeight := 0; + FHeaderLineHeight := 0; + + for I := 0 to Adapter.ColumnCount - 1 do + begin + Column := Adapter.Columns[I]; + CalculateHeight(GetFooterItemViewParams(Column), FFooterLineHeight); + CalculateHeight(GetHeaderItemViewParams(Column), FHeaderLineHeight); + if not Adapter.IsDefaultRowHeightAssigned and Column.IsPreview then + CalculateHeight(GetNodeItemViewParams(Column, Nodes[0]), FDetailsLineHeight); + end; + //if FDetailsLineHeight + Inc(FFooterLineHeight, 2 * FooterItemInflateVert); + + FPreviewLineHeight := Adapter.DefaultRowHeight; + if PreviewColumn <> nil then + CalculateHeight(GetPreviewViewParams(PreviewColumn, Nodes[0]), FPreviewLineHeight); + + for I := 0 to Adapter.BandCount - 1 do + CalculateHeight(GetBandItemViewParams(Adapter.Bands[I]), FBandLineHeight); +end; + +function TcxTreeListControlReportLinkFormatter.CanProcessSelectionStyle(ANode: TcxTreeListNode): Boolean; +begin + Result := (ANode <> nil) and ReportLink.OptionsFormatting.ConsumeSelectionStyle and IsSelectedNode(ANode); + if Result and not ReportLink.OptionsFormatting.UseNativeStyles then + Result := Adapter.HasSelectionStyle; +end; + +procedure TcxTreeListControlReportLinkFormatter.CreateNodeList; + + function IsNodeProcessed(ANode: TcxTreeListNode): Boolean; + var + Helper: TcxTreeListNodeHelper; + begin + Helper := Adapter.Helpers[ANode]; + Result := not Adapter.MultiSelection or not ReportLink.OptionsSelection.ProcessSelection or + (ANode.Selected or Helper.HasSelectedChildren or + (not ReportLink.OptionsSelection.ProcessExactSelection and Helper.HasSelectedParents)); + end; + + procedure ProcessNode(ANode: TcxTreeListNode); + var + I: Integer; + Node: TcxTreeListNode; + begin + FNodes.Add(ANode); + if (ANode.Count > 0) and (ReportLink.OptionsExpanding.ExplicitlyExpandNodes or + (ANode.Expanded or (ReportLink.OptionsExpanding.AutoExpandNodes and ANode.CanExpand))) then + for I := 0 to ANode.Count - 1 do + begin + Node := ANode[I]; + if IsNodeProcessed(Node) then ProcessNode(Node); + end; + end; + +var + I: Integer; + Node: TcxTreeListNode; +begin + FNodes.Clear; + for I := 0 to Adapter.NodeCount - 1 do + begin + Node := Adapter.Nodes[I]; + if IsNodeProcessed(Node) then ProcessNode(Node); + end; +end; + +function TcxTreeListControlReportLinkFormatter.IsSelectedNode(ANode: TcxTreeListNode): Boolean; +begin + Result := ReportLink.OptionsSelection.ProcessSelection or ANode.Selected; +end; + +function TcxTreeListControlReportLinkFormatter.GetBackgroundBitmap(Index: Integer): TBitmap; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + Result := ReportLink.Styles.GetBitmap(MapStyleBackgroundBitmapIndex(Index)) + else + Result := Adapter.GetBackgroundBitmap(Index); +end; + +function TcxTreeListControlReportLinkFormatter.GetBackgroundBitmapIndex(Index: Integer): Integer; +begin + Result := ReportLink.AddBackgroundBitmapToPool(GetBackgroundBitmap(Index)); +end; + +function TcxTreeListControlReportLinkFormatter.HasBackgroundBitmap(Index: Integer): Boolean; +var + Bitmap: TBitmap; +begin + if not ReportLink.OptionsFormatting.SuppressBackgroundBitmaps then + begin + Bitmap := GetBackgroundBitmap(Index); + Result := (Bitmap <> nil) and not Bitmap.Empty; + end + else + Result := False; +end; + +function TcxTreeListControlReportLinkFormatter.MapStyleBackgroundBitmapIndex(ATreeListBackgroundBitmapIndex: Integer): Integer; +begin + case ATreeListBackgroundBitmapIndex of + tlsv_BandHeader: + Result := vspsTreeListBandHeader; + tlsv_Content: + Result := vspsTreeListContent; + tlsv_ContentOdd: + Result := vspsTreeListContentOdd; + tlsv_ContentEven: + Result := vspsTreeListContentEven; + tlsv_ColumnFooter: + Result := vspsTreeListFooter; + tlsv_ColumnHeader: + Result := vspsTreeListHeader; + tlsv_Footer: + Result := vspsTreeListFooterRow; + tlsv_Preview: + Result := vspsTreeListPreview; + else + Result := 0; + end; +end; + +procedure TcxTreeListControlReportLinkFormatter.CalculateHeight(const AParams: TdxReportItemViewParams; + var AHeight: Integer); +var + Value: Integer; +begin + Value := CalculatePatternHeight(AParams); + if Value > AHeight then AHeight := Value; +end; + +function TcxTreeListControlReportLinkFormatter.CalculatePatternHeight(const AParams: TdxReportItemViewParams): Integer; +begin + Result := Renderer.CalcTextPatternHeight(DC, AParams.NativeParams.Font); +end; + +function TcxTreeListControlReportLinkFormatter.GetNodeParent(ANode: TcxTreeListNode; + ALevel: Integer): TcxTreeListNode; +begin + Result := ANode; + while ALevel > 0 do + begin + Result := Result.Parent; + Dec(ALevel); + end; +end; + +function TcxTreeListControlReportLinkFormatter.GetNextNode(ANode: TcxTreeListNode): TcxTreeListNode; +var + Index: Integer; +begin + Index := IndexOfNode(ANode); + if Index < NodeCount - 1 then + Result := Nodes[Index + 1] + else + Result := nil; +end; + +function TcxTreeListControlReportLinkFormatter.GetPrevNode(ANode: TcxTreeListNode): TcxTreeListNode; +var + Index: Integer; +begin + Index := IndexOfNode(ANode); + if Index > 0 then + Result := Nodes[Index - 1] + else + Result := nil; +end; + +function TcxTreeListControlReportLinkFormatter.GetStyleFontIndex(const AParams: TdxReportItemViewParams): Integer; +begin + if AParams.NativeParams.Font <> nil then + begin + FFont.Assign(AParams.NativeParams.Font); + if not dxPSUtl.dxIsTrueTypeFont(FFont) then + FFont.Name := ReportLink.Font.Name; + FFont.Color := ColorToRGB(AParams.NativeParams.TextColor); + FFont.Style := FFont.Style + AParams.FontStyle; + Result := ReportLink.AddFontToPool(FFont); + end + else + Result := 0; +end; + +function TcxTreeListControlReportLinkFormatter.HasParent(ANode: TcxTreeListNode): Boolean; +begin + Result := ANode.Level > 0; +end; + +function TcxTreeListControlReportLinkFormatter.IndexOfNode(ANode: TcxTreeListNode): Integer; +begin + Result := FNodes.IndexOf(ANode); +end; + +function TcxTreeListControlReportLinkFormatter.IsColorTransparent(AColor: TColor): Boolean; +begin + Result := ColorToRGB(AColor) = ColorToRGB(TransparentColor); +end; + +function TcxTreeListControlReportLinkFormatter.IsFirstNode(ANode: TcxTreeListNode): Boolean; +begin + Result := ANode = FNodes.First; +end; + +function TcxTreeListControlReportLinkFormatter.IsLastNode(ANode: TcxTreeListNode): Boolean; +begin + Result := ANode = FNodes.Last; +end; + +function TcxTreeListControlReportLinkFormatter.IsNodeExpanded(ANode: TcxTreeListNode): Boolean; +var + NextNode: TcxTreeListNode; +begin + Result := ANode.Expanded; + if not Result then + begin + NextNode := GetNextNode(ANode); + Result := (NextNode <> nil) and (NextNode.Level > ANode.Level); + end; +end; + +function TcxTreeListControlReportLinkFormatter.IsNodeFirstChild(ANode: TcxTreeListNode): Boolean; +begin + Result := ANode.IsFirst; +end; + +function TcxTreeListControlReportLinkFormatter.IsNodeLastChild(ANode: TcxTreeListNode): Boolean; +begin + Result := ANode.IsLast; +end; + +function TcxTreeListControlReportLinkFormatter.IsOddNode(ANode: TcxTreeListNode): Boolean; +begin + Result := Odd(FNodes.IndexOf(ANode)); +end; + +function TcxTreeListControlReportLinkFormatter.IsNodeSelected(ANode: TcxTreeListNode): Boolean; +begin + Result := ANode.Selected; +end; + +procedure TcxTreeListControlReportLinkFormatter.RegisterLookAndFeelItem(AnItem: TdxReportVisualItem; + AEdgeStyle: TdxCellEdgeStyle); +begin + AnItem.EdgeMode := cem3DEffects; + AnItem.Edge3DStyle := AEdgeStyle; + FLookAndFeelItems.Add(AnItem); +end; + +procedure TcxTreeListControlReportLinkFormatter.SetViewParams(AnItem: TdxReportVisualItem; + const AParams: TdxReportItemViewParams); +begin + with AnItem do + begin + CellSides := AParams.CellSides; + Color := ColorToRGB(AParams.NativeParams.Color); + FontIndex := GetStyleFontIndex(AParams); + Transparent := AParams.Transparent; + end; +end; + +function TcxTreeListControlReportLinkFormatter.MakeIndentIndex(AnIndex: Integer): DWORD; +begin + Result := ReportLink.MakeIndentIndex(AnIndex); +end; + +function TcxTreeListControlReportLinkFormatter.GetAutoWidth: Boolean; +begin + Result := ReportLink.OptionsSize.AutoWidth; +end; + +function TcxTreeListControlReportLinkFormatter.GetDC: HDC; +begin + Result := ReportLink.ScreenDC; +end; + +function TcxTreeListControlReportLinkFormatter.GetExpandButtonColor: TColor; +begin + Result := ExpandButtonInteriorColors[Adapter.TreeLinesStyle = tllsSolid]; +end; + +function TcxTreeListControlReportLinkFormatter.GetExpandButtonSize: Integer; +begin + Result := DefaultExpandButtonSize; +end; + +function TcxTreeListControlReportLinkFormatter.GetGridLinesColor: TColor; +begin + Result := ReportLink.OptionsFormatting.GridLineColor; + if Result = clDefault then + Result := Adapter.GridLinesColor; +end; + +function TcxTreeListControlReportLinkFormatter.GetHasNodeSeparator: Boolean; +begin + Result := NodeSeparatorThickness > 0; +end; + +function TcxTreeListControlReportLinkFormatter.GetHasPreview: Boolean; +begin + Result := Adapter.HasPreview and ShowPreview and (PreviewAutoHeight or (PreviewMaxLineCount > 0)); +end; + +function TcxTreeListControlReportLinkFormatter.GetIndentCount(Node: TcxTreeListNode): Integer; +begin + Result := Node.Level; + if Adapter.ShowRoot then Inc(Result); +end; + +function TcxTreeListControlReportLinkFormatter.GetIsNodeColorUsedForIndents: Boolean; +begin + Result := Adapter.IsNodeColorUsedForIndents; +end; + +function TcxTreeListControlReportLinkFormatter.GetLookAndFeelItem(Index: Integer): TdxReportVisualItem; +begin + Result := TdxReportVisualItem(FLookAndFeelItems[Index]); +end; + +function TcxTreeListControlReportLinkFormatter.GetLookAndFeelItemCount: Integer; +begin + Result := FLookAndFeelItems.Count; +end; + +function TcxTreeListControlReportLinkFormatter.GetNode(Index: Integer): TcxTreeListNode; +begin + Result := TcxTreeListNode(FNodes[Index]); +end; + +function TcxTreeListControlReportLinkFormatter.GetNodeCount: Integer; +begin + Result := FNodes.Count; +end; + +function TcxTreeListControlReportLinkFormatter.GetNodeSeparatorColor: TColor; +begin + Result := ReportLink.OptionsFormatting.ActualNodeSeparatorColor; +end; + +function TcxTreeListControlReportLinkFormatter.GetNodeSeparatorThickness: Integer; +begin + Result := ReportLink.OptionsFormatting.NodeSeparatorThickness; +end; + +function TcxTreeListControlReportLinkFormatter.GetPreviewAutoHeight: Boolean; +begin + Result := ReportLink.OptionsPreview.AutoHeight; +end; + +function TcxTreeListControlReportLinkFormatter.GetPreviewColumn: TcxTreeListColumn; +begin + Result := Adapter.PreviewColumn; +end; + +function TcxTreeListControlReportLinkFormatter.GetPreviewMaxLineCount: Integer; +begin + Result := ReportLink.OptionsPreview.MaxLineCount; +end; + +function TcxTreeListControlReportLinkFormatter.GetRenderer: TdxPSReportRenderer; +begin + Result := ReportLink.Renderer; +end; + +function TcxTreeListControlReportLinkFormatter.GetShowBandHeaders: Boolean; +begin + Result := ReportLink.OptionsView.BandHeaders; +end; + +function TcxTreeListControlReportLinkFormatter.GetShowFooters: Boolean; +begin + Result := ReportLink.OptionsView.Footers; +end; + +function TcxTreeListControlReportLinkFormatter.GetShowHeaders: Boolean; +begin + Result := ReportLink.OptionsView.Headers; +end; + +function TcxTreeListControlReportLinkFormatter.GetShowPreview: Boolean; +begin + Result := ReportLink.OptionsPreview.Visible; +end; + +function TcxTreeListControlReportLinkFormatter.GetUseLookAndFeelColors: Boolean; +begin + Result := ReportLink.OptionsFormatting.UseLookAndFeelColors; +end; + +function TcxTreeListControlReportLinkFormatter.GetViewWidth: Integer; +begin + Result := Adapter.ViewWidth; +end; + +function TcxTreeListControlReportLinkFormatter.GetTreeLinesColor: TColor; +begin + Result := Adapter.TreeLinesColor; +end; + +function TcxTreeListControlReportLinkFormatter.GetTreeLinesStyle: TcxTreeListTreeLineStyle; +begin + Result := Adapter.TreeLinesStyle; +end; + +procedure TcxTreeListControlReportLinkFormatter.FormatLookAndFeelItems; +const + Borders3D: array[TdxCellEdgeStyle, Boolean] of TdxPSCellBorderClass = + ((TdxPSCellRaisedBorder, TdxPSCellRaisedSoftBorder), + (TdxPSCellSunkenBorder, TdxPSCellSunkenSoftBorder)); +var + I: Integer; +begin + for I := 0 to LookAndFeelItemCount - 1 do + with LookAndFeelItems[I] do + if ReportLink.Effects3D then + BorderClass := Borders3D[Edge3DStyle, ReportLink.Soft3D] + else + BorderClass := TdxPSCellUltraFlatBorder; +end; + +{ TcxTreeListReportLinkOptionsExpanding } + +procedure TcxTreeListReportLinkOptionsExpanding.Assign(Source: TPersistent); +begin + if Source is TcxTreeListReportLinkOptionsExpanding then + with TcxTreeListReportLinkOptionsExpanding(Source) do + begin + Self.AutoExpandNodes := AutoExpandNodes; + Self.ExplicitlyExpandNodes := ExplicitlyExpandNodes; + end; + inherited; +end; + +procedure TcxTreeListReportLinkOptionsExpanding.RestoreDefaults; +begin + inherited; + AutoExpandNodes := False; + ExplicitlyExpandNodes := False; +end; + +function TcxTreeListReportLinkOptionsExpanding.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +function TcxTreeListReportLinkOptionsExpanding.GetReportLink: TcxTreeListControlReportLink; +begin + Result := inherited ReportLink as TcxTreeListControlReportLink; +end; + +procedure TcxTreeListReportLinkOptionsExpanding.SetAutoExpandNodes(Value: Boolean); +begin + if FAutoExpandNodes <> Value then + begin + FAutoExpandNodes := Value; + Changed; + end; +end; + +procedure TcxTreeListReportLinkOptionsExpanding.SetExplicitlyExpandNodes(Value: Boolean); +begin + if FExplicitlyExpandNodes <> Value then + begin + FExplicitlyExpandNodes := Value; + Changed; + end; +end; + +{ TcxTreeListReportLinkOptionsFormatting } + +procedure TcxTreeListReportLinkOptionsFormatting.Assign(Source: TPersistent); +begin + if Source is TcxTreeListReportLinkOptionsFormatting then + with TcxTreeListReportLinkOptionsFormatting(Source) do + begin + Self.ConsumeSelectionStyle := ConsumeSelectionStyle; + Self.NodeSeparatorColor := NodeSeparatorColor; + Self.NodeSeparatorThickness := NodeSeparatorThickness; + end; + inherited; +end; + +procedure TcxTreeListReportLinkOptionsFormatting.RestoreDefaults; +begin + inherited; + ConsumeSelectionStyle := False; + NodeSeparatorColor := clDefault; + NodeSeparatorThickness := 0; +end; + +function TcxTreeListReportLinkOptionsFormatting.DesignerTabIndex: Integer; +begin + Result := 2; +end; + +function TcxTreeListReportLinkOptionsFormatting.GetActualNodeSeparatorColor: TColor; +begin + Result := NodeSeparatorColor; + if Result = clDefault then + Result := dxPSDefaultTreeListNodeSeparatorColor; +end; + +function TcxTreeListReportLinkOptionsFormatting.GetReportLink: TcxTreeListControlReportLink; +begin + Result := inherited ReportLink as TcxTreeListControlReportLink; +end; + +procedure TcxTreeListReportLinkOptionsFormatting.SetConsumeSelectionStyle(Value: Boolean); +begin + if FConsumeSelectionStyle <> Value then + begin + FConsumeSelectionStyle := Value; + Changed; + end; +end; + +procedure TcxTreeListReportLinkOptionsFormatting.SetNodeSeparatorColor(Value: TColor); +begin + if FNodeSeparatorColor <> Value then + begin + FNodeSeparatorColor := Value; + if NodeSeparatorThickness <> 0 then Changed; + end; +end; + +procedure TcxTreeListReportLinkOptionsFormatting.SetNodeSeparatorThickness(Value: Integer); +begin + if Value < 0 then Value := 0; + if FNodeSeparatorThickness <> Value then + begin + FNodeSeparatorThickness := Value; + Changed; + end; +end; + +{ TcxTreeListReportLinkOptionsOnEveryPage } + +function TcxTreeListReportLinkOptionsOnEveryPage.DesignerTabIndex: Integer; +begin + Result := 0; +end; + +function TcxTreeListReportLinkOptionsOnEveryPage.GetReportLink: TcxTreeListControlReportLink; +begin + Result := inherited ReportLink as TcxTreeListControlReportLink; +end; + +{ TcxTreeListReportLinkOptionsPagination } + +function TcxTreeListReportLinkOptionsPagination.DesignerTabIndex: Integer; +begin + Result := 0; +end; + +function TcxTreeListReportLinkOptionsPagination.GetNode: Boolean; +begin + Result := inherited Row; +end; + +function TcxTreeListReportLinkOptionsPagination.GetReportLink: TcxTreeListControlReportLink; +begin + Result := inherited ReportLink as TcxTreeListControlReportLink; +end; + +procedure TcxTreeListReportLinkOptionsPagination.SetNode(Value: Boolean); +begin + inherited Row := Value; +end; + +{ TcxTreeListReportLinkOptionsPreview } + +function TcxTreeListReportLinkOptionsPreview.DesignerTabIndex: Integer; +begin + Result := 4; +end; + +function TcxTreeListReportLinkOptionsPreview.GetReportLink: TcxTreeListControlReportLink; +begin + Result := inherited ReportLink as TcxTreeListControlReportLink; +end; + +{ TcxTreeListReportLinkOptionsRefinements } + +function TcxTreeListReportLinkOptionsRefinements.DesignerTabIndex: Integer; +begin + Result := 2; +end; + +function TcxTreeListReportLinkOptionsRefinements.GetReportLink: TcxTreeListControlReportLink; +begin + Result := inherited ReportLink as TcxTreeListControlReportLink; +end; + +{ TcxTreeListReportLinkOptionsSelection } + +function TcxTreeListReportLinkOptionsSelection.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +function TcxTreeListReportLinkOptionsSelection.GetReportLink: TcxTreeListControlReportLink; +begin + Result := inherited ReportLink as TcxTreeListControlReportLink; +end; + +{ TcxTreeListReportLinkOptionsSize } + +function TcxTreeListReportLinkOptionsSize.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +function TcxTreeListReportLinkOptionsSize.GetReportLink: TcxTreeListControlReportLink; +begin + Result := inherited ReportLink as TcxTreeListControlReportLink; +end; + +{ TcxTreeListReportLinkOptionsView } + +procedure TcxTreeListReportLinkOptionsView.Assign(Source: TPersistent); +begin + if Source is TcxTreeListReportLinkOptionsView then + with TcxTreeListReportLinkOptionsView(Source) do + begin + Self.Borders := Borders; + Self.TreeLines := TreeLines; + end; + inherited; +end; + +procedure TcxTreeListReportLinkOptionsView.RestoreDefaults; +begin + inherited; + Borders := True; + TreeLines := True; +end; + +function TcxTreeListReportLinkOptionsView.DesignerTabIndex: Integer; +begin + Result := 0; +end; + +function TcxTreeListReportLinkOptionsView.GetReportLink: TcxTreeListControlReportLink; +begin + Result := inherited ReportLink as TcxTreeListControlReportLink; +end; + +procedure TcxTreeListReportLinkOptionsView.SetBorders(Value: Boolean); +begin + if FBorders <> Value then + begin + FBorders := Value; + Changed; + end; +end; + +procedure TcxTreeListReportLinkOptionsView.SetTreeLines(Value: Boolean); +begin + if FTreeLines <> Value then + begin + FTreeLines := Value; + Changed; + end; +end; + +{ TcxTreeListReportLinkStyles } + +procedure TcxTreeListReportLinkStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxTreeListReportLinkStyles then + with TcxTreeListReportLinkStyles(Source) do + begin + Self.BandHeader := BandHeader; + Self.Content := Content; + Self.ContentEven := ContentEven; + Self.ContentOdd := ContentOdd; + Self.Footer := Footer; + Self.FooterRow := FooterRow; + Self.Header := Header; + Self.Preview := Preview; + end; +end; + +procedure TcxTreeListReportLinkStyles.GetBandHeaderParams(ABand: TcxTreeListBand; + out AParams: TcxViewParams); +begin + GetViewParams(vspsTreeListBandHeader, ABand, nil, AParams); +end; + +procedure TcxTreeListReportLinkStyles.GetColumnFooterParams(ANode: TcxTreeListNode; + AColumn: TcxTreeListColumn; out AParams: TcxViewParams); +begin + GetViewParams(vspsTreeListFooter, ANode, nil, AParams); +end; + +procedure TcxTreeListReportLinkStyles.GetColumnHeaderParams(AColumn: TcxTreeListColumn; + out AParams: TcxViewParams); +begin + GetViewParams(vspsTreeListHeader, nil, nil, AParams); +end; + +procedure TcxTreeListReportLinkStyles.GetContentParams(ANode: TcxTreeListNode; + AColumn: TcxTreeListColumn; out AParams: TcxViewParams); + + function IsOddNode(ANode: TcxTreeListNode): Boolean; + var + Builder: TcxTreeListControlReportLinkBuilder; + begin + Builder := ReportLink.Builder; + if Builder <> nil then + Result := Builder.Formatter.IsOddNode(ANode) + else + Result := Odd(ANode.VisibleIndex); + end; + +const + StyleIndexes: array[Boolean] of Integer = (vspsTreeListContentEven, vspsTreeListContentOdd); +begin + if (ANode <> nil) and (GetValue(StyleIndexes[IsOddNode(ANode)]) <> nil) then + GetViewParams(StyleIndexes[IsOddNode(ANode)], ANode, nil, AParams) + else + GetViewParams(vspsTreeListContent, ANode, nil, AParams); +end; + +procedure TcxTreeListReportLinkStyles.GetFooterRowParams(out AParams: TcxViewParams); +begin + GetViewParams(vspsTreeListFooterRow, nil, nil, AParams); +end; + +procedure TcxTreeListReportLinkStyles.GetImagesParams(ANode: TcxTreeListNode; + out AParams: TcxViewParams); +begin + GetContentParams(ANode, nil, AParams); +end; + +procedure TcxTreeListReportLinkStyles.GetIndentParams(ANode: TcxTreeListNode; + AnIndent: Integer; out AParams: TcxViewParams); + + function IsNodeColorUsedForIndents: Boolean; + var + Builder: TcxTreeListControlReportLinkBuilder; + begin + Builder := ReportLink.Builder; + Result := (Builder <> nil) and Builder.Formatter.IsNodeColorUsedForIndents; + end; + +begin + if IsNodeColorUsedForIndents then + GetContentParams(ANode, nil, AParams) + else + GetViewParams(vspsTreeListIndent, ANode, nil{AnIndent}, AParams); +end; + +procedure TcxTreeListReportLinkStyles.GetPreviewParams(ANode: TcxTreeListNode; + AColumn: TcxTreeListColumn; out AParams: TcxViewParams); +begin + GetViewParams(vspsTreeListPreview, ANode, nil, AParams); +end; + +procedure TcxTreeListReportLinkStyles.GetSelectionParams(out AParams: TcxViewParams); +begin + GetViewParams(vspsTreeListSelection, nil, nil, AParams); +end; + +function TcxTreeListReportLinkStyles.DesignerTabIndex: Integer; +begin + Result := 3; +end; + +procedure TcxTreeListReportLinkStyles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +const + FixedParts = [vspsTreeListBandHeader, vspsTreeListFooter, vspsTreeListFooterRow, + vspsTreeListHeader, vspsTreeListSelection]; +begin + inherited; + if ReportLink <> nil then + with AParams do + begin + if Index in FixedParts then + Color := dxPSCore.dxDefaultFixedColor + else + Color := dxPSCore.dxDefaultContentColor; //TreeListReportLink.Color; // ??? + + Font := ReportLink.Font; + TextColor := Font.Color; + end; +end; + +class function TcxTreeListReportLinkStyles.GetStyleCaption(AnIndex: Integer): string; +begin + case AnIndex of + vspsTreeListBandHeader: + Result := cxGetResourceString(@sdxBandHeaderStyle); + vspsTreeListContent: + Result := cxGetResourceString(@sdxContentStyle); + vspsTreeListContentEven: + Result := cxGetResourceString(@sdxContentEvenStyle); + vspsTreeListContentOdd: + Result := cxGetResourceString(@sdxContentOddStyle); + vspsTreeListFooter: + Result := cxGetResourceString(@sdxFooterStyle); + vspsTreeListFooterRow: + Result := cxGetResourceString(@sdxFooterRowStyle); + vspsTreeListHeader: + Result := cxGetResourceString(@sdxHeaderStyle); + vspsTreeListIndent: + Result := cxGetResourceString(@sdxIndentStyle); + vspsTreeListPreview: + Result := cxGetResourceString(@sdxPreviewStyle); + else + Result := cxGetResourceString(@sdxSelectionStyle); + end; +end; + +function TcxTreeListReportLinkStyles.GetStyleIndexByCaption(const Caption: string): Integer; +begin + for Result := vspsTreeListFirst to vspsTreeListLast do + if dxPSUtl.dxSameText(Caption, GetStyleCaption(Result)) then + Exit; + Result := -1; +end; + +function TcxTreeListReportLinkStyles.GetReportLink: TcxTreeListControlReportLink; +begin + Result := inherited ReportLink as TcxTreeListControlReportLink; +end; + +{ TcxTreeListReportLinkStyleSheet } + +class function TcxTreeListReportLinkStyleSheet.GetStylesClass: TcxCustomStylesClass; +begin + Result := TcxTreeListReportLinkStyles; +end; + +function TcxTreeListReportLinkStyleSheet.GetStylesValue: TcxTreeListReportLinkStyles; +begin + if GetStyles is TcxTreeListReportLinkStyles then + Result := TcxTreeListReportLinkStyles(GetStyles) + else + Result := nil; +end; + +procedure TcxTreeListReportLinkStyleSheet.SetStylesValue(Value: TcxTreeListReportLinkStyles); +begin + SetStyles(Value); +end; + +{ TcxTreeListControlAttributeHostInfo } + +procedure TcxTreeListControlAttributeHostInfo.Initialize(AParent: TdxReportCell); +begin + Origin := NullPoint; + FParent := AParent; +end; + +{ TcxTreeListControlAttributeHostInfoServices } + +constructor TcxTreeListAttributeHostInfoServices.Create(AReportLink: TcxTreeListControlReportLink); +begin + inherited Create; + FReportLink := AReportLink; + CreateHostInfos; +end; + +destructor TcxTreeListAttributeHostInfoServices.Destroy; +begin + DestroyHostInfos; + inherited; +end; + +procedure TcxTreeListAttributeHostInfoServices.InitializeHostInfos; +begin + PageDetailsHostInfo.Initialize(PageDetails); + PageFootersHostInfo.Initialize(PageFooters); + PageHeadersHostInfo.Initialize(PageHeaders); +end; + +procedure TcxTreeListAttributeHostInfoServices.CreateHostInfos; +begin + FPageDetailsHostInfo := TcxTreeListControlAttributeHostInfo.Create; + FPageFootersHostInfo := TcxTreeListControlAttributeHostInfo.Create; + FPageHeadersHostInfo := TcxTreeListControlAttributeHostInfo.Create; +end; + +procedure TcxTreeListAttributeHostInfoServices.DestroyHostInfos; +begin + FreeAndNil(FPageHeadersHostInfo); + FreeAndNil(FPageFootersHostInfo); + FreeAndNil(FPageDetailsHostInfo); +end; + +function TcxTreeListAttributeHostInfoServices.GetBandHeadersHostInfo: TcxTreeListControlAttributeHostInfo; +begin + if CanUseBandHeadersOnEveyPage then + Result := PageHeadersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TcxTreeListAttributeHostInfoServices.GetFootersHostInfo: TcxTreeListControlAttributeHostInfo; +begin + if CanUseFootersOnEveryPage then + Result := PageFootersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TcxTreeListAttributeHostInfoServices.GetHeadersHostInfo: TcxTreeListControlAttributeHostInfo; +begin + if CanUseHeadersOnEveryPage then + Result := PageHeadersHostInfo + else + Result := PageDetailsHostInfo; +end; + +function TcxTreeListAttributeHostInfoServices.GetInconsistentStateText: string; +begin + if ReportLink.IsAggregated then + Result := cxGetResourceString(@sdxCannotUseOnEveryPageModeInAggregatedState) + else + if IsInconsistentHeadersState then + Result := cxGetResourceString(@sdxTLIncorrectHeadersState) + else + Result := ''; +end; + +function TcxTreeListAttributeHostInfoServices.GetIsInconsistentState: Boolean; +begin + Result := ReportLink.IsAggregated or IsInconsistentHeadersState; +end; + +function TcxTreeListAttributeHostInfoServices.HasCells: Boolean; +begin + Result := ReportLink.ReportCells <> nil; +end; + +function TcxTreeListAttributeHostInfoServices.GetArePageFootersAssigned: Boolean; +begin + Result := FootersHostInfo.Parent = ReportLink.ReportCells.FooterCells; +end; + +function TcxTreeListAttributeHostInfoServices.GetArePageHeadersAssigned: Boolean; +begin + with ReportLink.ReportCells do + Result := (BandHeadersHostInfo.Parent = HeaderCells) or (HeadersHostInfo.Parent = HeaderCells); +end; + +function TcxTreeListAttributeHostInfoServices.GetCanUseBandHeadersOnEveyPage: Boolean; +begin + Result := not ReportLink.IsAggregated and OptionsOnEveryPage.BandHeaders; +end; + +function TcxTreeListAttributeHostInfoServices.GetCanUseFootersOnEveryPage: Boolean; +begin + Result := not ReportLink.IsAggregated and OptionsOnEveryPage.Footers; +end; + +function TcxTreeListAttributeHostInfoServices.GetCanUseHeadersOnEveryPage: Boolean; +begin + Result := not ReportLink.IsAggregated and OptionsOnEveryPage.Headers and + ((BandHeadersHostInfo = PageHeadersHostInfo) or not OptionsView.BandHeaders); +end; + +function TcxTreeListAttributeHostInfoServices.GetIsInconsistentHeadersState: Boolean; +begin + Result := OptionsOnEveryPage.Headers and OptionsView.Headers and OptionsView.BandHeaders and not OptionsOnEveryPage.BandHeaders; +end; + +function TcxTreeListAttributeHostInfoServices.GetOptionsOnEveryPage: TcxTreeListReportLinkOptionsOnEveryPage; +begin + Result := ReportLink.OptionsOnEveryPage; +end; + +function TcxTreeListAttributeHostInfoServices.GetOptionsView: TcxTreeListReportLinkOptionsView; +begin + Result := ReportLink.OptionsView; +end; + +function TcxTreeListAttributeHostInfoServices.GetPageDetails: TdxReportCell; +begin + if HasCells then + Result := ReportLink.ReportCells.Cells + else + Result := nil; +end; + +function TcxTreeListAttributeHostInfoServices.GetPageFooters: TdxReportCell; +begin + if HasCells then + Result := ReportLink.ReportCells.FooterCells + else + Result := PageDetails; +end; + +function TcxTreeListAttributeHostInfoServices.GetPageHeaders: TdxReportCell; +begin + if HasCells then + Result := ReportLink.ReportCells.HeaderCells + else + Result := PageDetails; +end; + +{ TcxTreeListControlReportLink } + +constructor TcxTreeListControlReportLink.Create(AOwner: TComponent); +begin + inherited; + FDelimitersHardVert := TList.Create; + FHostInfoServices := TcxTreeListAttributeHostInfoServices.Create(Self); + FReportRows := TList.Create; + InternalRestoreDefaults; + LinkModified(False); +end; + +destructor TcxTreeListControlReportLink.Destroy; +begin + FreeAndNil(FReportRows); + FreeAndNil(FHostInfoServices); + FreeAndNil(FDelimitersHardVert); + inherited; +end; + +procedure TcxTreeListControlReportLink.AddPageBreak(ANode: TcxTreeListNode); +var + ReportRow: TdxReportCell; +begin + ReportRow := ReportRowsByNode[ANode]; + if ReportRow <> nil then + AddVerticalHardDelimiter(ReportRow); +end; + +procedure TcxTreeListControlReportLink.AddPageBreak(const ANodes: array of TcxTreeListNode); +var + I: Integer; +begin + for I := Low(ANodes) to High(ANodes) do + AddPageBreak(ANodes[I]); +end; + +procedure TcxTreeListControlReportLink.AddPageBreak(const ANodes: TcxTreeListNodeArray); +var + I: Integer; +begin + for I := 0 to Length(ANodes) - 1 do + AddPageBreak(ANodes[I]); +end; + +procedure TcxTreeListControlReportLink.AddPageBreak(ANodes: TList); +var + I: Integer; + P: Pointer ; +begin + for I := 0 to ANodes.Count - 1 do + begin + P := ANodes[I]; + if TObject(P) is TcxTreeListNode then + AddPageBreak(TcxTreeListNode(P)); + end; +end; + +procedure TcxTreeListControlReportLink.ConstructReport(AReportCells: TdxReportCells); + + function HasData: Boolean; + begin + Result := (CustomTreeListControl_GetVisibleColumnCount(TreeListControl) <> 0) and + (CustomTreeListControl_GetNodes(TreeListControl).Count <> 0); + end; + + procedure Build; + begin + FBuilder := CreateBuilder; + try + FBuilder.Build; + finally + FreeAndNil(FBuilder); + end; + end; + + procedure CalculateSizes; + + procedure CalculateReportPartSizes(ACell: TdxReportCell); + var + Width, I, V: Integer; + begin + if ACell.CellCount > 0 then + begin + Width := 0; + for I := 0 to ACell.CellCount - 1 do + begin + V := ACell.Cells[I].Width; + if Width < V then Width := V; + end; + ACell.BoundsRect := MakeRect(0, 0, Width, ACell[ACell.CellCount - 1].BoundsRect.Bottom); + end; + end; + + begin + with AReportCells do + begin + CalculateReportPartSizes(Cells); + if AreFooterCellsAllocated then CalculateReportPartSizes(FooterCells); + if AreHeaderCellsAllocated then CalculateReportPartSizes(HeaderCells); + end; + end; + +begin + if TreeListControl = nil then Exit; + inherited; + if not HasData then Exit; + + PrepareConstruct; + try + Build; + if not AbortBuilding then CalculateSizes; + finally + UnprepareConstruct; + end; +end; + +procedure TcxTreeListControlReportLink.ConvertCoords; +begin + inherited; + ConvertDelimiters(DelimitersHardVert); +end; + +procedure TcxTreeListControlReportLink.CustomDraw(AItem: TAbstractdxReportCellData; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); +var + DrawInfo: TcxTreeListCellCustomDrawInfo; +begin + GetItemCustomDrawInfo(AItem, DrawInfo); + with DrawInfo do + case AttributeID of + cxTreeListBandID: + DoCustomDrawBandCell(ACanvas, Band, TdxReportCellImage(AItem), ADone); + cxTreeListFooterID: + DoCustomDrawFooterCell(ACanvas, Column, TdxReportCellString(AItem), ADone); + cxTreeListHeaderID: + DoCustomDrawHeaderCell(ACanvas, Column, TdxReportCellImage(AItem), ADone); + cxTreeListIndentID: + DoCustomDrawIndentCell(ACanvas, Node, Index, AItem, ADone); + cxTreeListNodeID: + DoCustomDrawCell(ACanvas, Node, Column, AItem, ADone); + end; +end; + +function TcxTreeListControlReportLink.GetBreakPagesByHardDelimiters: Boolean; +begin + Result := OptionsPagination.Custom; +end; + +procedure TcxTreeListControlReportLink.GetImageLists(AProc: TdxPSGetImageListProc); +begin + inherited; + AProc(CustomTreeListControl_GetImages(TreeListControl)); + AProc(CustomTreeListControl_GetStateImages(TreeListControl)); +end; + +function TcxTreeListControlReportLink.GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; +begin + Result := (AUpdateCodes * uaMarginsVert <> []) and OptionsSize.AutoWidth; +end; + +function TcxTreeListControlReportLink.GetUseHardVertDelimiters: Boolean; +begin + Result := OptionsPagination.Custom; +end; + +procedure TcxTreeListControlReportLink.InternalRestoreFromOriginal; +var + TreeListOptionsView: TcxTreeListOptionsView; + TreeListPreview: TcxTreeListPreview; +begin + inherited; + if TreeListControl <> nil then + begin + OptionsFormatting.LookAndFeelKind := CustomTreeListControl_GetLookAndFeel(TreeListControl).Kind; + + TreeListPreview := CustomTreeListControl_GetPreview(TreeListControl); + with OptionsPreview do + begin + AutoHeight := TreeListPreview.AutoHeight; + MaxLineCount := TreeListPreview.MaxLineCount; + Visible := TreeListPreview.Visible; + end; + + TreeListOptionsView := CustomTreeListControl_GetOptionsView(TreeListControl); + with OptionsView do + begin + BandHeaders := TreeListOptionsView.Bands; + ExpandButtons := TreeListOptionsView.Buttons; + Footers := TreeListOptionsView.Footer; + Headers := TreeListOptionsView.Headers; + TreeLines := TreeListOptionsView.TreeLineStyle <> tllsNone; + end; + OptionsSize.AutoWidth := TreeListOptionsView.ColumnAutoWidth; + end; +end; + +function TcxTreeListControlReportLink.IsDrawFootersOnEveryPage: Boolean; +begin + Result := HostInfoServices.ArePageFootersAssigned; +end; + +function TcxTreeListControlReportLink.IsDrawHeadersOnEveryPage: Boolean; +begin + Result := HostInfoServices.ArePageHeadersAssigned; +end; + +function TcxTreeListControlReportLink.IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; +var + DrawInfo: TcxTreeListCellCustomDrawInfo; +begin + Result := inherited IsSupportedCustomDraw(Item) and + (Item <> nil) and IsCustomDrawn(GetItemCustomDrawInfo(Item, DrawInfo)); +end; + +procedure TcxTreeListControlReportLink.MakeHardDelimiters(AReportCells: TdxReportCells; + AVertDelimiters: TList); +begin + inherited; + + if OptionsPagination.Custom then + try + DoGetCustomPageBreaks; + except + Application.HandleException(Self); + end; + dxPSUtl.dxCopyList(DelimitersHardVert, AVertDelimiters); +end; + +function TcxTreeListControlReportLink.GetAreNativeStylesAvailable: Boolean; +begin + Result := OptionsFormatting.UseNativeStyles; +end; + +function TcxTreeListControlReportLink.GetStylesClass: TdxCustomReportLinkStylesClass; +begin + Result := TcxTreeListReportLinkStyles; +end; + +function TcxTreeListControlReportLink.GetStyleSheetClass: TdxCustomReportLinkStyleSheetClass; +begin + Result := TcxTreeListReportLinkStyleSheet; +end; + +function TcxTreeListControlReportLink.GetStyleSheetPrototype: TdxCustomReportLinkStyleSheet; +begin + Result := DefaultdxPScxTreeListLinkStyleSheet; +end; + +procedure TcxTreeListControlReportLink.PrepareConstruct; +begin + inherited; + DelimitersHardVert.Clear; + FReportRows.Clear; + + ReportCells.LookAndFeel := nil;//CreateGroupLookAndFeel(TdxPSReportGroupNullLookAndFeel); + + HostInfoServices.InitializeHostInfos; + if OptionsExpanding.ExplicitlyExpandNodes then + TreeListControl.FullExpand; +end; + +procedure TcxTreeListControlReportLink.DoCustomDrawBandCell(ACanvas: TCanvas; + ABand: TcxTreeListBand; AnItem: TdxReportCellImage; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawBandCell) then + FOnCustomDrawBandCell(Self, ACanvas, ABand, AnItem, ADone); +end; + +procedure TcxTreeListControlReportLink.DoCustomDrawCell(ACanvas: TCanvas; + ANode: TcxTreeListNode; AColumn: TcxTreeListColumn; + AnItem: TAbstractdxReportCellData; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawCell) then + FOnCustomDrawCell(Self, ACanvas, ANode, AColumn, AnItem, ADone); +end; + +procedure TcxTreeListControlReportLink.DoCustomDrawFooterCell(ACanvas: TCanvas; + AColumn: TcxTreeListColumn; AnItem: TdxReportCellString; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawFooterCell) then + FOnCustomDrawFooterCell(Self, ACanvas, AColumn, AnItem, ADone); +end; + +procedure TcxTreeListControlReportLink.DoCustomDrawHeaderCell(ACanvas: TCanvas; + AColumn: TcxTreeListColumn; AnItem: TdxReportCellImage; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawHeaderCell) then + FOnCustomDrawHeaderCell(Self, ACanvas, AColumn, AnItem, ADone); +end; + +procedure TcxTreeListControlReportLink.DoCustomDrawIndentCell(ACanvas: TCanvas; + ANode: TcxTreeListNode; AnIndex: Integer; AnItem: TAbstractdxReportCellData; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawIndentCell) then + FOnCustomDrawIndentCell(Self, ACanvas, ANode, AnIndex, AnItem, ADone); +end; + +procedure TcxTreeListControlReportLink.DoGetCustomPageBreaks; +begin + if Assigned(FOnGetCustomPageBreaks) then FOnGetCustomPageBreaks(Self); +end; + +procedure TcxTreeListControlReportLink.DoInitializeBandCell(ABand: TcxTreeListBand; + AnItem: TdxReportCellImage); +begin + if Assigned(FOnInitializeBandCell) then + FOnInitializeBandCell(Self, ABand, AnItem); +end; + +procedure TcxTreeListControlReportLink.DoInitializeCell(ANode: TcxTreeListNode; + AColumn: TcxTreeListColumn; AnItem: TAbstractdxReportCellData); +begin + if Assigned(FOnInitializeCell) then + FOnInitializeCell(Self, ANode, AColumn, AnItem); +end; + +procedure TcxTreeListControlReportLink.DoInitializeFooterCell(AColumn: TcxTreeListColumn; + AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeFooterCell) then + FOnInitializeFooterCell(Self, AColumn, AnItem); +end; + +procedure TcxTreeListControlReportLink.DoInitializeHeaderCell(AColumn: TcxTreeListColumn; + AnItem: TdxReportCellImage); +begin + if Assigned(FOnInitializeHeaderCell) then + FOnInitializeHeaderCell(Self, AColumn, AnItem); +end; + +procedure TcxTreeListControlReportLink.DoInitializeIndentCell(ANode: TcxTreeListNode; + AnIndex: Integer; AnItem: TAbstractdxReportCellData); +begin + if Assigned(FOnInitializeIndentCell) then + FOnInitializeIndentCell(Self, ANode, AnIndex, AnItem); +end; + +function TcxTreeListControlReportLink.GetOptionsExpandingClass: TdxCustomReportLinkOptionsExpandingClass; +begin + Result := TcxTreeListReportLinkOptionsExpanding; +end; + +function TcxTreeListControlReportLink.GetOptionsFormattingClass: TdxCustomReportLinkOptionsFormattingClass; +begin + Result := TcxTreeListReportLinkOptionsFormatting; +end; + +function TcxTreeListControlReportLink.GetOptionsOnEveryPageClass: TdxCustomTableControlReportLinkOptionsOnEveryPageClass; +begin + Result := TcxTreeListReportLinkOptionsOnEveryPage; +end; + +function TcxTreeListControlReportLink.GetOptionsPaginationClass: TdxCustomReportLinkOptionsPaginationClass; +begin + Result := TcxTreeListReportLinkOptionsPagination; +end; + +function TcxTreeListControlReportLink.GetOptionsPreviewClass: TdxCustomTableControlReportLinkOptionsPreviewClass; +begin + Result := TcxTreeListReportLinkOptionsPreview; +end; + +function TcxTreeListControlReportLink.GetOptionsRefinementsClass: TdxCustomReportLinkOptionsRefinementsClass; +begin + Result := TcxTreeListReportLinkOptionsRefinements; +end; + +function TcxTreeListControlReportLink.GetOptionsSelectionClass: TdxCustomTableControlReportLinkOptionsSelectionClass; +begin + Result := TcxTreeListReportLinkOptionsSelection; +end; + +function TcxTreeListControlReportLink.GetOptionsSizeClass: TdxCustomReportLinkOptionsSizeClass; +begin + Result := TcxTreeListReportLinkOptionsSize; +end; + +function TcxTreeListControlReportLink.GetOptionsViewClass: TdxCustomReportLinkOptionsViewClass; +begin + Result := TcxTreeListReportLinkOptionsView; +end; + +procedure TcxTreeListControlReportLink.AddReportRow(AReportRow: TdxReportCell); +begin + FReportRows.Add(AReportRow); +end; + +procedure TcxTreeListControlReportLink.AddVerticalHardDelimiter(ADelimiter: TdxReportCell); +begin + AddVerticalHardDelimiter(ADelimiter.AbsoluteRect.Top); +end; + +procedure TcxTreeListControlReportLink.AddVerticalHardDelimiter(ADelimiter: Integer); +begin + FDelimitersHardVert.Add(TObject(ADelimiter)); +end; + +function TcxTreeListControlReportLink.CreateBuilder: TcxTreeListControlReportLinkBuilder; +begin + Result := GetBuilderClass.Create(Self); +end; + +class function TcxTreeListControlReportLink.GetBuilderClass: TcxTreeListControlReportLinkBuilderClass; +begin + Result := TcxTreeListControlReportLinkBuilder; +end; + +function TcxTreeListControlReportLink.ExtractIndentIndex(AData: Integer): Integer; +begin + Result := (AData and NodeIndentMask) shr NodeIndentOffset; +end; + +function TcxTreeListControlReportLink.GetItemCustomDrawInfo(AnItem: TdxReportVisualItem; + out ADrawInfo: TcxTreeListCellCustomDrawInfo): TcxTreeListAttributeID; + + function IsBand(AData: DWORD): Boolean; + begin + try + Result := IsDelphiObject(AData) and (TObject(AData) is TcxTreeListBand); + except + Result := False; + end; + if Result then + begin + ADrawInfo.Band := TcxTreeListBand(AData); + ADrawInfo.AttributeID := cxTreeListBandID; + end; + end; + + function IsColumn(AData: DWORD): Boolean; + begin + try + Result := IsDelphiObject(AData) and (TObject(AData) is TcxTreeListColumn); + except + Result := False; + end; + if Result then + ADrawInfo.Column := TcxTreeListColumn(AData); + end; + + function IsFooter(AData: DWORD): Boolean; + begin + try + Result := TClass(AData) = TcxTreeListFooterAttribute; + except + Result := False; + end; + if Result then + ADrawInfo.AttributeID := cxTreeListFooterID; + end; + + function IsHeader(AData: Integer): Boolean; + begin + try + Result := IsDelphiObject(AData) and TClass(AData).InheritsFrom(TcxTreeListHeaderAttribute); + except + Result := False; + end; + if Result then + ADrawInfo.AttributeID := cxTreeListHeaderID; + end; + + function IsIndent(AData: DWORD): Boolean; + begin + Result := True; + ADrawInfo.Index := ExtractIndentIndex(AData); + ADrawInfo.AttributeID := cxTreeListIndentID; + end; + + function IsNode(AData: DWORD): Boolean; + begin + try + Result := IsDelphiObject(AData) and (TObject(AData) is TcxTreeListNode); + except + Result := False; + end; + if Result then + begin + ADrawInfo.Node := TcxTreeListNode(AData); + ADrawInfo.AttributeID := cxTreeListNodeID; + end; + end; + +var + Data: DWORD; +begin + FillChar(ADrawInfo, SizeOf(ADrawInfo), 0); + try + try + Data := AnItem.Data; + if IsColumn(Data) then + begin + if AnItem.Parent <> nil then + begin + Data := AnItem.Parent.Data; + if not IsNode(Data) then + if not IsHeader(Data) then IsFooter(Data); + end; + end + else + if not IsBand(Data) then IsIndent(Data); + except + FillChar(ADrawInfo, SizeOf(ADrawInfo), 0); + end; + finally + Result := ADrawInfo.AttributeID; + end; +end; + +function TcxTreeListControlReportLink.IsCustomDrawn(AnAttributeID: TcxTreeListAttributeID): Boolean; +begin + Result := False; + case AnAttributeID of + cxTreeListBandID: + Result := Assigned(FOnCustomDrawBandCell); + cxTreeListFooterID: + Result := Assigned(FOnCustomDrawFooterCell); + cxTreeListHeaderID: + Result := Assigned(FOnCustomDrawHeaderCell); + cxTreeListIndentID: + Result := Assigned(FOnCustomDrawIndentCell); + cxTreeListNodeID: + Result := Assigned(FOnCustomDrawCell); + end; +end; + +function TcxTreeListControlReportLink.MakeIndentIndex(AnIndex: Integer): DWORD; +begin + Result := AnIndex shl NodeIndentOffset; +end; + +function TcxTreeListControlReportLink.GetActiveStyles: TcxTreeListReportLinkStyles; +begin + Result := inherited ActiveStyles as TcxTreeListReportLinkStyles; +end; + +function TcxTreeListControlReportLink.GetDesignWindow: TdxfmTreeListReportLinkDesignWindow; +begin + Result := inherited DesignWindow as TdxfmTreeListReportLinkDesignWindow; +end; + +function TcxTreeListControlReportLink.GetReportRow(Index: Integer): TdxReportCell; +begin + Result := FReportRows[Index]; +end; + +function TcxTreeListControlReportLink.GetReportRowByNode(Node: TcxTreeListNode): TdxReportCell; +var + I: Integer; +begin + if (Node <> nil) and not Node.IsFirstVisible then + for I := 0 to ReportRowCount - 1 do + begin + Result := ReportRows[I]; + if Result.Data = Integer(Node) then Exit; + end; + Result := nil; +end; + +function TcxTreeListControlReportLink.GetReportRowCount: Integer; +begin + Result := FReportRows.Count; +end; + +function TcxTreeListControlReportLink.GetOptionsExpanding: TcxTreeListReportLinkOptionsExpanding; +begin + Result := inherited OptionsExpanding as TcxTreeListReportLinkOptionsExpanding; +end; + +function TcxTreeListControlReportLink.GetOptionsFormatting: TcxTreeListReportLinkOptionsFormatting; +begin + Result := inherited OptionsFormatting as TcxTreeListReportLinkOptionsFormatting; +end; + +function TcxTreeListControlReportLink.GetOptionsOnEveryPage: TcxTreeListReportLinkOptionsOnEveryPage; +begin + Result := inherited OptionsOnEveryPage as TcxTreeListReportLinkOptionsOnEveryPage; +end; + +function TcxTreeListControlReportLink.GetOptionsPagination: TcxTreeListReportLinkOptionsPagination; +begin + Result := inherited OptionsPagination as TcxTreeListReportLinkOptionsPagination; +end; + +function TcxTreeListControlReportLink.GetOptionsPreview: TcxTreeListReportLinkOptionsPreview; +begin + Result := inherited OptionsPreview as TcxTreeListReportLinkOptionsPreview; +end; + +function TcxTreeListControlReportLink.GetOptionsRefinements: TcxTreeListReportLinkOptionsRefinements; +begin + Result := inherited OptionsRefinements as TcxTreeListReportLinkOptionsRefinements; +end; + +function TcxTreeListControlReportLink.GetOptionsSelection: TcxTreeListReportLinkOptionsSelection; +begin + Result := inherited OptionsSelection as TcxTreeListReportLinkOptionsSelection; +end; + +function TcxTreeListControlReportLink.GetOptionsSize: TcxTreeListReportLinkOptionsSize; +begin + Result := inherited OptionsSize as TcxTreeListReportLinkOptionsSize; +end; + +function TcxTreeListControlReportLink.GetOptionsView: TcxTreeListReportLinkOptionsView; +begin + Result := inherited OptionsView as TcxTreeListReportLinkOptionsView; +end; + +function TcxTreeListControlReportLink.GetStyles: TcxTreeListReportLinkStyles; +begin + Result := inherited Styles as TcxTreeListReportLinkStyles; +end; + +function TcxTreeListControlReportLink.GetTreeListControl: TcxCustomTreeListControl; +begin + Result := TcxCustomTreeListControl(Component); +end; + +procedure TcxTreeListControlReportLink.SetOnCustomDrawBandCell(Value: TcxTreeListReportLinkCustomDrawBandCellEvent); +begin + if @FOnCustomDrawBandCell <> @Value then + begin + FOnCustomDrawBandCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TcxTreeListControlReportLink.SetOnCustomDrawCell(Value: TcxTreeListReportLinkCustomDrawCellEvent); +begin + if @FOnCustomDrawCell <> @Value then + begin + FOnCustomDrawCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TcxTreeListControlReportLink.SetOnCustomDrawFooterCell(Value: TcxTreeListReportLinkCustomDrawFooterCellEvent); +begin + if @FOnCustomDrawFooterCell <> @Value then + begin + FOnCustomDrawFooterCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TcxTreeListControlReportLink.SetOnCustomDrawHeaderCell(Value: TcxTreeListReportLinkCustomDrawHeaderCellEvent); +begin + if @FOnCustomDrawHeaderCell <> @Value then + begin + FOnCustomDrawHeaderCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TcxTreeListControlReportLink.SetOnCustomDrawIndentCell(Value: TcxTreeListReportLinkCustomDrawIndentCellEvent); +begin + if @FOnCustomDrawIndentCell <> @Value then + begin + FOnCustomDrawIndentCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TcxTreeListControlReportLink.SetOptionsExpanding(Value: TcxTreeListReportLinkOptionsExpanding); +begin + inherited OptionsExpanding := Value; +end; + +procedure TcxTreeListControlReportLink.SetOptionsFormatting(Value: TcxTreeListReportLinkOptionsFormatting); +begin + inherited OptionsFormatting := Value; +end; + +procedure TcxTreeListControlReportLink.SetOptionsOnEveryPage(Value: TcxTreeListReportLinkOptionsOnEveryPage); +begin + inherited OptionsOnEveryPage := Value; +end; + +procedure TcxTreeListControlReportLink.SetOptionsPagination(Value: TcxTreeListReportLinkOptionsPagination); +begin + inherited OptionsPagination := Value; +end; + +procedure TcxTreeListControlReportLink.SetOptionsPreview(Value: TcxTreeListReportLinkOptionsPreview); +begin + inherited OptionsPreview := Value; +end; + +procedure TcxTreeListControlReportLink.SetOptionsRefinements(Value: TcxTreeListReportLinkOptionsRefinements); +begin + inherited OptionsRefinements := Value; +end; + +procedure TcxTreeListControlReportLink.SetOptionsSelection(Value: TcxTreeListReportLinkOptionsSelection); +begin + inherited OptionsSelection := Value; +end; + +procedure TcxTreeListControlReportLink.SetOptionsSize(Value: TcxTreeListReportLinkOptionsSize); +begin + inherited OptionsSize := Value; +end; + +procedure TcxTreeListControlReportLink.SetOptionsView(Value: TcxTreeListReportLinkOptionsView); +begin + inherited OptionsView := Value; +end; + +procedure TcxTreeListControlReportLink.SetStyles(Value: TcxTreeListReportLinkStyles); +begin + inherited Styles := Value; +end; + +{ TcxTreeListReportLink } + +function TcxTreeListReportLink.GetTreeList: TcxTreeList; +begin + Result := TcxTreeList(Component); +end; + +{ TcxDBTreeListReportLink } + +function TcxDBTreeListReportLink.GetDBTreeList: TcxDBTreeList; +begin + Result := TcxDBTreeList(Component); +end; + +{ TcxVirtualTreeListReportLink } + +function TcxVirtualTreeListReportLink.GetVirtualTreeList: TcxVirtualTreeList; +begin + Result := TcxVirtualTreeList(Component); +end; + +{ TdxfmTreeListReportLinkDesignWindow } + +constructor TdxfmTreeListReportLinkDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxPSGlbl .dxhccxTreeListReportLinkDesigner; + inherited; + CreateControls; + SetActivePage; +end; + +destructor TdxfmTreeListReportLinkDesignWindow.Destroy; +begin + dxPSPopupMan.dxPSPopupMenuController.UnregisterControl(lbxStyles); + inherited; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.DoInitialize; +begin + lbxStyles.ReportLinkStyles := ReportLink.ActiveStyles; + inherited; + RefreshStylesList; + + InitializePreviewTreeList; + InitializePreviewTreeListStyles; + LoadDataIntoPreviewTreeList; + + (*{$IFNDEF DXVER500} {.3} + chbxTransparentRichEdits.Visible := False; + bvlRefinementsSeparator.Top := bvlRefinementsSeparator.Top - 15; + chbxSuppressBackgroundBitmaps.Top := chbxSuppressBackgroundBitmaps.Top - 15; + chbxConsumeSelectionStyle.Top := chbxConsumeSelectionStyle.Top - 15; + {$ENDIF} *) + + with ReportLink.OptionsView do + begin + chbxShowBands.Checked := BandHeaders; + chbxShowBorders.Checked := Borders; + chbxShowExpandButtons.Checked := ExpandButtons; + chbxShowFooters.Checked := Footers; + chbxShowHeaders.Checked := Headers; + chbxShowTreeLines.Checked := TreeLines; + end; + + with ReportLink.OptionsOnEveryPage do + begin + chbxBandsOnEveryPage.Checked := BandHeaders; + chbxFootersOnEveryPage.Checked := Footers; + chbxHeadersOnEveryPage.Checked := Headers; + end; + + with cbxLookAndFeel do + begin + Items.Clear; + Items.AddObject(cxGetResourceString(@sdxLookAndFeelFlat), TObject(lfFlat)); + Items.AddObject(cxGetResourceString(@sdxLookAndFeelStandard), TObject(lfStandard)); + Items.AddObject(cxGetResourceString(@sdxLookAndFeelUltraFlat), TObject(lfUltraFlat)); + + ItemIndex := Items.IndexOfObject(TObject(ReportLink.OptionsFormatting.LookAndFeelKind)); + end; + + with ReportLink.OptionsFormatting do + begin + ccbxSeparatorColor.ColorValue := ActualNodeSeparatorColor; + seSeparatorThickness.AsInteger := NodeSeparatorThickness; + chbxConsumeSelectionStyle.Checked := ConsumeSelectionStyle; + chbxSuppressBackgroundBitmaps.Checked := SuppressBackgroundBitmaps; + chbxUseNativeStyles.Checked := UseNativeStyles; + end; + + with ReportLink.OptionsSelection do + begin + chbxProcessSelection.Checked := ProcessSelection; + chbxProcessExactSelection.Checked := ProcessExactSelection; + end; + + with ReportLink.OptionsExpanding do + begin + chbxExpandNodes.Checked := AutoExpandNodes; + chbxExplicitlyExpandNodes.Checked := ExplicitlyExpandNodes; + end; + + with ReportLink.OptionsSize do + begin + chbxAutoWidth.Checked := AutoWidth; + end; + + with ReportLink.OptionsRefinements do + begin + chbxTransparentGraphics.Checked := TransparentGraphics; + chbxDisplayGraphicsAsText.Checked := DisplayGraphicsAsText; + chbxFlatCheckMarks.Checked := FlatCheckMarks; + (*{$IFDEF DXVER500} {.3} + chbxTransparentRichEdits.Checked := TransparentRichEdits; + {$ENDIF} *) + end; + + with ReportLink.OptionsPreview do + begin + chbxPreviewVisible.Checked := Visible; + chbxPreviewAutoHeight.Checked := AutoHeight; + sePreviewMaxLineCount.AsInteger := MaxLineCount; + end; +end; + +{$IFDEF DELPHI7} +function TdxfmTreeListReportLinkDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +procedure TdxfmTreeListReportLinkDesignWindow.LoadStrings; + + procedure AdjustBevelSize(ABevel: TBevel; ALabel: TControl); + var + Right: Integer; + begin + Right := ABevel.BoundsRect.Right; + ABevel.Left := ALabel.Left + ALabel.Width + 10; + ABevel.Width := Right - ABevel.Left; + end; + +begin + inherited; + + lblPreviewWindow.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + tshView.Caption := cxGetResourceString(@sdxViewTab); + + lblShow.Caption := cxGetResourceString(@sdxShow); + AdjustBevelSize(bvlShow, lblShow); + chbxShowBands.Caption := cxGetResourceString(@sdxBands); + chbxShowHeaders.Caption := cxGetResourceString(@sdxHeaders); + chbxShowFooters.Caption := cxGetResourceString(@sdxFooters); + Bevel2.Width := bvlShow.Width - (Bevel2.Left - bvlShow.Left); + chbxShowBorders.Caption := cxGetResourceString(@sdxBorders); + chbxShowExpandButtons.Caption := cxGetResourceString(@sdxExpandButtons); + chbxShowTreeLines.Caption := cxGetResourceString(@sdxTreeLines); + + lblOnEveryPage.Caption := cxGetResourceString(@sdxOnEveryPage); + AdjustBevelSize(bvlOnEveryPage, lblOnEveryPage); + chbxBandsOnEveryPage.Caption := DropAmpersand(cxGetResourceString(@sdxBands)); + chbxHeadersOnEveryPage.Caption := DropAmpersand(cxGetResourceString(@sdxHeaders)); + chbxFootersOnEveryPage.Caption := DropAmpersand(cxGetResourceString(@sdxFooters)); + + tshBehaviors.Caption := cxGetResourceString(@sdxBehaviorsTab); + + lblSelection.Caption := cxGetResourceString(@sdxSelection); + AdjustBevelSize(bvlSelection, lblSelection); + chbxProcessSelection.Caption := cxGetResourceString(@sdxProcessSelection); + chbxProcessExactSelection.Caption := cxGetResourceString(@sdxProcessExactSelection); + + lblExpanding.Caption := cxGetResourceString(@sdxExpanding); + AdjustBevelSize(bvlExpanding, lblExpanding); + chbxExpandNodes.Caption := cxGetResourceString(@sdxNodes); + chbxExplicitlyExpandNodes.Caption := cxGetResourceString(@sdxExplicitlyExpandNodes); + + lblSize.Caption := cxGetResourceString(@sdxSize); + AdjustBevelSize(bvlSize, lblSize); + chbxAutoWidth.Caption := cxGetResourceString(@sdxAutoWidth); + + tshFormatting.Caption := cxGetResourceString(@sdxFormatting); + lblLookAndFeel.Caption := cxGetResourceString(@sdxLookAndFeel); + AdjustBevelSize(bvlLookAndFeel, lblLookAndFeel); + + lblRefinements.Caption := cxGetResourceString(@sdxRefinements); + AdjustBevelSize(bvlRefinements, lblRefinements); + chbxTransparentGraphics.Caption := cxGetResourceString(@sdxTransparentGraphics); + chbxDisplayGraphicsAsText.Caption := DropAmpersand(cxGetResourceString(@sdxDisplayGraphicsAsText)); + chbxFlatCheckMarks.Caption := cxGetResourceString(@sdxFlatCheckMarks); + //chbxTransparentRichEdits.Caption := cxGetResourceString(@sdxTransparentRichEdits); {.3} + chbxSuppressBackgroundBitmaps.Caption := cxGetResourceString(@sdxSuppressBackgroundBitmaps); + chbxConsumeSelectionStyle.Caption := cxGetResourceString(@sdxConsumeSelectionStyle); + + lblSeparators.Caption := cxGetResourceString(@sdxSeparators); + AdjustBevelSize(bvlSeparator, lblSeparators); + lblSeparatorsColor.Caption := cxGetResourceString(@sdxColor); + lblSeparatorsThickness.Caption := cxGetResourceString(@sdxThickness); + + tshStyles.Caption := cxGetResourceString(@sdxStyles); + lblUseNativeStyles.Caption := cxGetResourceString(@sdxUseNativeStyles); + AdjustBevelSize(bvlStyles, lblUseNativeStyles); + btnStyleColor.Caption := cxGetResourceString(@sdxBtnColor); + btnStyleFont.Caption := cxGetResourceString(@sdxBtnFont); + btnStyleBackgroundBitmap.Caption := cxGetResourceString(@sdxBtnTexture); + btnStyleBackgroundBitmapClear.Caption := cxGetResourceString(@sdxBtnTextureClear); + btnStyleRestoreDefaults.Caption := cxGetResourceString(@sdxBtnRestoreDefaults); + btnStylesSaveAs.Caption := cxGetResourceString(@sdxBtnSaveAs); + + btnStyleSheetNew.Caption := cxGetResourceString(@sdxBtnNew); + btnStyleSheetCopy.Caption := cxGetResourceString(@sdxBtnCopy); + btnStyleSheetDelete.Caption := cxGetResourceString(@sdxBtnDelete); + btnStyleSheetRename.Caption := cxGetResourceString(@sdxBtnRename); + + miStyleColor.Caption := cxGetResourceString(@sdxBtnColor); + miStyleFont.Caption := cxGetResourceString(@sdxBtnFont); + miStyleBackgroundBitmap.Caption := cxGetResourceString(@sdxBtnTexture); + miStyleBackgroundBitmapClear.Caption := cxGetResourceString(@sdxBtnTextureClear); + miStyleRestoreDefaults.Caption := cxGetResourceString(@sdxBtnRestoreDefaults); + miStylesSelectAll.Caption := cxGetResourceString(@sdxSelectAll); + miStylesSaveAs.Caption := cxGetResourceString(@sdxBtnSaveAs); + + tshPreview.Caption := cxGetResourceString(@sdxPreviewTab); + lblPreviewOptions.Caption := cxGetResourceString(@sdxOptions); + AdjustBevelSize(bvlPreviewOptions, lblPreviewOptions); + chbxPreviewVisible.Caption := cxGetResourceString(@sdxVisible); + chbxPreviewAutoHeight.Caption := cxGetResourceString(@sdxPreviewAutoHeight); + lblPreviewMaxLineCount.Caption := cxGetResourceString(@sdxPreviewMaxLineCount); + lblStyleSheets.Caption := cxGetResourceString(@sdxStyleSheets); +end; + +procedure TdxfmTreeListReportLinkDesignWindow.UpdateControlsState; +begin + inherited; + chbxProcessExactSelection.Enabled := chbxProcessSelection.Checked; + chbxExplicitlyExpandNodes.Enabled := chbxExpandNodes.Checked; + + lbxStyles.Enabled := AreNativeStylesAvailable; + btnStyleColor.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + btnStyleFont.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + btnStyleBackgroundBitmap.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + btnStyleBackgroundBitmapClear.Enabled := AreNativeStylesAvailable and HasSelectedStylesWithAssignedBitmap; + btnStyleRestoreDefaults.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + btnStylesSaveAs.Enabled := CanSaveStyles; + + lblStyleSheets.Enabled := AreNativeStylesAvailable; + cbxStyleSheets.Enabled := AreNativeStylesAvailable; + btnStyleSheetNew.Enabled := CanCreateStyleSheet; + btnStyleSheetCopy.Enabled := CanCopyStyleSheet; + btnStyleSheetDelete.Enabled := CanDeleteStyleSheet; + btnStyleSheetRename.Enabled := CanRenameStyleSheet; + + WarningPaneUpdate; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.UpdatePreview; +const + TransparentsMap: array[Boolean] of TcxImageTransparency = (gtOpaque, gtTransparent); + TreeLineStylesMap: array[Boolean] of TcxTreeListTreeLineStyle = (tllsNone, tllsDot); +begin + PreviewTreeList.Enabled := False; + PreviewTreeList.LookAndFeel.Kind := ReportLink.OptionsFormatting.LookAndFeelKind; + PreviewTreeList.LookAndFeel.NativeStyle := False; + PreviewTreeList.Font := ReportLink.Font; + + chbxBandsOnEveryPage.Enabled := not ReportLink.IsAggregated; + chbxHeadersOnEveryPage.Enabled := not ReportLink.IsAggregated; + chbxFootersOnEveryPage.Enabled := not ReportLink.IsAggregated; + + TcxImageProperties(colManufacturerLogo.Properties).GraphicTransparency := + TransparentsMap[ReportLink.OptionsRefinements.TransparentGraphics]; + + PreviewTreeList.OptionsView.Bands := ReportLink.OptionsView.BandHeaders; + PreviewTreeList.OptionsView.Footer := ReportLink.OptionsView.Footers; + PreviewTreeList.OptionsView.Headers := ReportLink.OptionsView.Headers; + PreviewTreeList.OptionsView.Buttons := ReportLink.OptionsView.ExpandButtons; + PreviewTreeList.OptionsView.TreeLineStyle := TreeLineStylesMap[ReportLink.OptionsView.TreeLines]; + PreviewTreeList.OptionsView.ShowRoot := (ReportLink.TreeListControl <> nil) and + CustomTreeListControl_GetOptionsView(ReportLink.TreeListControl).ShowRoot; + PreviewTreeList.Preview.Visible := ReportLink.OptionsPreview.Visible; + + if ReportLink.TreeListControl <> nil then + PreviewTreeList.OptionsView.UseNodeColorForIndent := + CustomTreeListControl_GetOptionsView(ReportLink.TreeListControl).UseNodeColorForIndent; + + PreviewTreeList.Invalidate; +end; + +function TdxfmTreeListReportLinkDesignWindow.GetDesignerTabIndex: Integer; +begin + Result := PageControl1.ActivePage.TabIndex; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.SetDesignerTabIndex(Value: Integer); +begin + if Value < 0 then Value := 0; + if Value > PageControl1.PageCount - 1 then + Value := PageControl1.PageCount - 1; + PageControl1.ActivePage := PageControl1.Pages[Value]; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.DoActiveStyleSheetChanged; +begin + lbxStyles.ReportLinkStyles := ReportLink.ActiveStyles; + inherited; + with cbxStyleSheets do + ItemIndex := Items.IndexOfObject(ActiveStyleSheet); + + if not LockControlsUpdate then + begin + Modified := True; + UpdatePreview; + end; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.DoFormActivated(AnActive: Boolean); +begin + inherited; + if not AnActive then lbxStyles.HideToolTips; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.DoRefreshStylesList; +var + Styles: TcxTreeListReportLinkStyles; + List: TList; +begin + Styles := ReportLink.ActiveStyles; + with lbxStyles.Items do + begin + BeginUpdate; + try + List := TList.Create; + try + SaveSelectedStyles(List); + try + Clear; + AddObject(cxGetResourceString(@sdxBandHeaderStyle), Styles.BandHeader); + AddObject(cxGetResourceString(@sdxContentStyle), Styles.Content); + AddObject(cxGetResourceString(@sdxContentEvenStyle), Styles.ContentEven); + AddObject(cxGetResourceString(@sdxContentOddStyle), Styles.ContentOdd); + AddObject(cxGetResourceString(@sdxFooterStyle), Styles.Footer); + AddObject(cxGetResourceString(@sdxFooterRowStyle), Styles.FooterRow); + AddObject(cxGetResourceString(@sdxHeaderStyle), Styles.Header); + AddObject(cxGetResourceString(@sdxPreviewStyle), Styles.Preview); + AddObject(cxGetResourceString(@sdxSelectionStyle), Styles.Selection); + finally + RestoreSelectedStyles(List); + end; + finally + List.Free; + end; + finally + EndUpdate; + end; + end; + InitializePreviewTreeListStyles; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.DoStyleChanged(const ACaption: string; + AStyle: TcxStyle); +begin + inherited; + UpdatePreviewTreeListStyles(ACaption, AStyle); +end; + +procedure TdxfmTreeListReportLinkDesignWindow.DoStylesChanged(AStrings: TStrings; + ARecreate: Boolean); +begin + if ARecreate then + RecreateStylesListBox + else + lbxStyles.Invalidate; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.GetSelectedStyleNames(AStrings: TStrings); +var + I: Integer; +begin + AStrings.Clear; + with lbxStyles do + for I := 0 to Items.Count - 1 do + if Selected[I] then + AStrings.AddObject(Items[I], Items.Objects[I]); +end; + +procedure TdxfmTreeListReportLinkDesignWindow.GetStyleNames(out AStrings: TStrings); +begin + AStrings := lbxStyles.Items; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.GetStyleSheetNames(out AStrings: TStrings); +begin + AStrings := cbxStyleSheets.Items; +end; + +function TdxfmTreeListReportLinkDesignWindow.GetActiveStyle: TcxStyle; +begin + with lbxStyles do + if ItemIndex <> -1 then + Result := TcxStyle(Items.Objects[ItemIndex]) + else + Result := nil; +end; + +function TdxfmTreeListReportLinkDesignWindow.GetHasSelectedStyles: Boolean; +begin + Result := lbxStyles.SelCount <> 0; +end; + +function TdxfmTreeListReportLinkDesignWindow.GetHasSelectedStylesWithAssignedBitmap: Boolean; +var + Styles: TStrings; + I: Integer; + Style: TcxStyle; +begin + Result := True; + Styles := TStringList.Create; + try + GetSelectedStyleNames(Styles); + for I := 0 to Styles.Count - 1 do + begin + Style := TcxStyle(Styles.Objects[I]); + if (Style <> nil) and (Style.Bitmap <> nil) and not Style.Bitmap.Empty then + Exit; + end; + finally + Styles.Free; + end; + Result := False; +end; + +function TdxfmTreeListReportLinkDesignWindow.GetReportLink: TcxTreeListControlReportLink; +begin + Result := inherited ReportLink as TcxTreeListControlReportLink; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.PreviewMaxLineCountChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsPreview.MaxLineCount := TdxPSSpinEdit(Sender).AsInteger; + Modified := True; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.SeparatorColorChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + if TdxPSColorCombo(Sender).IsAutoColorSelected then + ReportLink.OptionsFormatting.NodeSeparatorColor := clDefault + else + ReportLink.OptionsFormatting.NodeSeparatorColor := TdxPSColorCombo(Sender).ColorValue; + Modified := True; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.SeparatorThicknessChanged(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsFormatting.NodeSeparatorThickness := TdxPSSpinEdit(Sender).AsInteger; + Modified := True; +end; + +function TdxfmTreeListReportLinkDesignWindow.CanSelectAllStyles: Boolean; +var + I: Integer; +begin + Result := AreNativeStylesAvailable; + if Result then + begin + for I := 0 to lbxStyles.Items.Count - 1 do + if not lbxStyles.Selected[I] then Exit; + Result := False; + end; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.CreateControls; + + function CreateSpin(AHost: TControl; ALabel: TLabel; ATabOrder: TTabOrder; + AMinValue, AMaxValue, AValue: Integer): TdxPSSpinEdit; + begin + Result := TdxPSSpinEdit.Create(Self); + with Result do + begin + Parent := AHost.Parent; + BoundsRect := AHost.BoundsRect; + TabOrder := ATabOrder; + + MinValue := AMinValue; + MaxValue := AMaxValue; + Value := AValue; + DefaultValue := AValue; + end; + ALabel.FocusControl := Result; + end; + + function CreateColorCombo(AHost: TControl; ALabel: TLabel; ATabOrder: TTabOrder; + ATag: Integer; AAutoColor: TColor): TdxPSColorCombo; + begin + Result := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(Result) do + begin + BoundsRect := AHost.BoundsRect; + Tag := MakeTTag(ATag); + Parent := AHost.Parent; + TabOrder := ATabOrder; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := AAutoColor; + end; + ALabel.FocusControl := Result; + AHost.Visible := False; + end; + + procedure CreateWarningPane; + begin + wpIncorrectOnEveryPageState := TdxPSWarningPane.Create(Self); + wpIncorrectOnEveryPageState.Parent := tshView; + wpIncorrectOnEveryPageState.BoundsRect := bvlWarningHost.BoundsRect; + bvlWarningHost.Visible := False; + end; + + procedure CreateStylesListBox; + begin + lbxStyles := TdxStylesListBox.Create(Self); + lbxStyles.Parent := tshStyles; + lbxStyles.BoundsRect := bvlStylesHost.BoundsRect; + lbxStyles.PopupMenu := pmStyles; + lbxStyles.TabOrder := chbxUseNativeStyles.TabOrder + 1; + lbxStyles.OnClick := lbxStylesClick; + bvlStylesHost.Visible := False; + + dxPSPopupMan.dxPSPopupMenuController.RegisterControl(lbxStyles); + end; + +begin + sePreviewMaxLineCount := CreateSpin(bvlPreviewMaxLineCountHost, lblPreviewMaxLineCount, + chbxPreviewAutoHeight.TabOrder + 1, 0, 1000, 0); + sePreviewMaxLineCount.OnChange := PreviewMaxLineCountChanged; + + seSeparatorThickness := CreateSpin(bvlSeparatorThicknessHost, lblSeparatorsThickness, + chbxConsumeSelectionStyle.TabOrder + 1, 0, 16, 0); + seSeparatorThickness.OnChange := SeparatorThicknessChanged; + + ccbxSeparatorColor := CreateColorCombo(bvlSeparatorColorHost, lblSeparatorsColor, + seSeparatorThickness.TabOrder + 1, 0, dxPSDefaultTreeListNodeSeparatorColor); + ccbxSeparatorColor.OnChange := SeparatorColorChanged; + + CreateWarningPane; + CreateStylesListBox; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.CustomDrawBorders(ACanvas: TcxCanvas; + const R: TRect); +var + GridLinesColor: TColor; +begin + with ReportLink do + begin + GridLinesColor := PreviewTreeList.OptionsView.GridLineColor; + {if TreeListControl <> nil then + GridLinesColor := CustomTreeListControl_GetOptionsView(TreeListControl).GridLineColor + else + GridLinesColor := PreviewTreeList.OptionsView.GridLineColor;//clWindowText;} + if GridLinesColor = clDefault then + GridLinesColor := CustomTreeListControl_GetLookAndFeelPainter(PreviewTreeList).DefaultGridLineColor; + end; + ACanvas.DrawComplexFrame(R, GridLinesColor, GridLinesColor, [bLeft, bBottom, bRight]); +end; + +procedure TdxfmTreeListReportLinkDesignWindow.CustomDrawCheckMark(ACanvas: TcxCanvas; + AViewInfo: TcxTreeListEditCellViewInfo); +const + Painters: array[Boolean] of TcxCustomLookAndFeelPainterClass = + (TcxStandardLookAndFeelPainter, TcxUltraFlatLookAndFeelPainter); +var + PrevColor: TColor; + R: TRect; + Params: TcxViewParams; + X, Y: Integer; + CheckValue: Variant; +begin + PrevColor := ACanvas.Brush.Color; + R := AViewInfo.BoundsRect; + Params := PreviewTreeList.Styles.GetContentParams(AViewInfo.Node, AViewInfo.Column); + + if Params.Bitmap = nil then + begin + ACanvas.Brush.Color := Params.Color; + ACanvas.FillRect(R); + end + else + dxBkgnd.DrawPicture(Params.Bitmap, ACanvas.Canvas, R, ppmTile, 1, 1, -R.Left, -R.Top); + + X := R.Left + (R.Right - R.Left - CheckWidth) div 2; + Y := R.Top + (R.Bottom - R.Top - CheckWidth) div 2; + R := MakeBounds(X, Y, CheckWidth, CheckWidth); + CheckValue := cbsChecked; + if AViewInfo.Node.Index = 0 then + CheckValue := cbsUnchecked; + with Painters[ReportLink.OptionsRefinements.FlatCheckMarks] do + DrawCheckButton(ACanvas, R, cxbsDefault, CheckValue = cbsChecked); + ACanvas.Brush.Color := PrevColor; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.CustomDrawFooter(ACanvas: TcxCanvas; + R: TRect; AViewInfo: TcxTreeListFooterItemViewInfo); +begin + case ReportLink.OptionsFormatting.LookAndFeelKind of + lfStandard, + lfFlat: + ACanvas.DrawComplexFrame(R, AViewInfo.ViewParams.TextColor, clBtnHighlight); + lfUltraFlat: + ACanvas.FrameRect(R, AViewInfo.ViewParams.TextColor); + end; + + InflateRect(R, -1, -1); + with AViewInfo do + CustomDrawTextRect(ACanvas, R, Text, AlignHorz, AlignVert, ViewParams); +end; + +procedure TdxfmTreeListReportLinkDesignWindow.CustomDrawHeader(ACanvas: TcxCanvas; + R: TRect; AViewInfo: TcxTreeListHeaderViewInfo); +const + BottomRightColors: array[Boolean] of TColor = (clBtnFace, clBtnShadow); +begin + ACanvas.FrameRect(R, clWindowText);//AViewInfo.ViewParams.TextColor); + if ReportLink.OptionsFormatting.LookAndFeelKind <> lfUltraFlat then + begin + InflateRect(R, -1, -1); + ACanvas.DrawComplexFrame(R, clBtnHighlight, + BottomRightColors[ReportLink.OptionsFormatting.LookAndFeelKind = lfStandard]); + end; + + InflateRect(R, -1, -1); + with AViewInfo do + CustomDrawTextRect(ACanvas, R, Text, AlignHorz, AlignVert, ViewParams); +end; + +procedure TdxfmTreeListReportLinkDesignWindow.CustomDrawTextRect(ACanvas: TcxCanvas; + R: TRect; const AText: string; AnAlignmentHorz: TAlignment; AnAlignmentVert: TcxAlignmentVert; + AParams: TcxViewParams); +const + AlignmentHorzMap: array[TAlignment] of Integer = (cxAlignLeft, cxAlignRight, cxAlignCenter); + AlignmentVertMap: array[TcxAlignmentVert] of Integer = (cxAlignTop, cxAlignBottom, cxAlignVCenter); +begin + if AParams.Bitmap = nil then + begin + ACanvas.Brush.Color := AParams.Color; + ACanvas.FillRect(R); + end + else + dxBkgnd.DrawPicture(AParams.Bitmap, ACanvas.Canvas, R, ppmTile, 1, 1, - R.Left - 0, - R.Top - 0); + + InflateRect(R, -2, -1); + if AParams.Font <> nil then + ACanvas.Font := AParams.Font; + ACanvas.Font.Color := AParams.TextColor; + ACanvas.Brush.Style := bsClear; + ACanvas.DrawText(AText, R, + AlignmentHorzMap[AnAlignmentHorz] or AlignmentVertMap[AnAlignmentVert] or cxSingleLine); + ACanvas.Brush.Style := bsSolid; +end; + +function TdxfmTreeListReportLinkDesignWindow.ExtractAlignmentHorz( + AViewInfo: TcxTreeListEditCellViewInfo): TAlignment; +begin + with AViewInfo.Column do + if Properties <> nil then + Result := cxEditProperties_GetAlignment(Properties).Horz + else + Result := taLeftJustify; +end; + +function TdxfmTreeListReportLinkDesignWindow.ExtractAlignmentVert( + AViewInfo: TcxTreeListEditCellViewInfo): TcxAlignmentVert; +const + EditAlignmentVertMap: array[TcxEditVertAlignment] of TcxAlignmentVert = + (vaTop, vaBottom, vaCenter); +begin + with AViewInfo.Column do + if Properties <> nil then + Result := EditAlignmentVertMap[cxEditProperties_GetAlignment(Properties).Vert] + else + Result := vaCenter; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.InitializePreviewTreeList; + + procedure SetupDataBindings; + + function GetColumnCaption(AnIndex: Integer): string; + begin + case AnIndex of + 0: Result := cxGetResourceString(@sdxManufacturerNameColumnCaption); + 1: Result := cxGetResourceString(@sdxManufacturerLogoColumnCaption); + 2: Result := cxGetResourceString(@sdxManufacturerCountryColumnCaption); + 3: Result := cxGetResourceString(@sdxCarModelColumnCaption); + else + Result := cxGetResourceString(@sdxCarIsSUVColumnCaption); + end; + end; + + const + ColumnProperties: array[0..4] of string = + ('TcxTextEditProperties', 'TcxImageProperties', 'TcxTextEditProperties', + 'TcxTextEditProperties', 'TcxCheckBoxProperties'); + var + I: Integer; + begin + for I := 0 to PreviewTreeList.ColumnCount - 1 do + with PreviewTreeList.Columns[I] do + begin + PropertiesClassName := ColumnProperties[I]; + Caption.Text := GetColumnCaption(I); + end; + end; + +begin + SetupDataBindings; + //TcxImageProperties(colManufacturerLogo.Properties).Stretch := True; + PreviewTreeList.Bands[0].Caption.Text := cxGetResourceString(@sdxManufacturerBandCaption); + PreviewTreeList.Bands[1].Caption.Text := cxGetResourceString(@sdxModelBandCaption); + PreviewTreeList.OptionsView.Footer := True; + PreviewTreeList.Columns[0].Options.Footer := True; + PreviewTreeList.Columns[0].SummaryFooter.Kind := skCount; + PreviewTreeList.Columns[0].SummaryFooter.Format := cxGetResourceString(@sdxSummaryFormat); +end; + +procedure TdxfmTreeListReportLinkDesignWindow.InitializePreviewTreeListStyles; + + procedure ResetEvents(AStyles: TcxTreeListStyles); + begin + with AStyles do + begin + OnGetBandBackgroundStyle := nil; + OnGetBandContentStyle := nil; + OnGetBandHeaderStyle := nil; + OnGetBandFooterStyle := nil; + OnGetColumnFooterStyle := nil; + OnGetColumnHeaderStyle := nil; + OnGetContentStyle := nil; + OnGetNodeIndentStyle := nil; + OnGetPreviewStyle := nil; + end; + end; + +var + Styles: TcxTreeListReportLinkStyles; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + begin + Styles := ReportLink.ActiveStyles; + dxPSResetStyles(PreviewTreeList.Styles); + with PreviewTreeList.Styles do + begin + BandHeader := Styles.BandHeader; + Content := Styles.Content; + ContentEven := Styles.ContentEven; + ContentOdd := Styles.ContentOdd; + ColumnFooter := Styles.Footer; + ColumnHeader := Styles.Header; + Footer := Styles.FooterRow; + Preview := Styles.Preview; + end; + end + else + if ReportLink.TreeListControl <> nil then + PreviewTreeList.Styles := CustomTreeListControl_GetStyles(ReportLink.TreeListControl) + else + dxPScxCommon.dxPSResetStyles(PreviewTreeList.Styles); + + ResetEvents(PreviewTreeList.Styles); +end; + +procedure TdxfmTreeListReportLinkDesignWindow.LoadDataIntoPreviewTreeList; + + function GetManufacturerName(AnIndex: Integer): string; + begin + case AnIndex of + 0: Result := cxGetResourceString(@sdxCarManufacturerName5); + 1: Result := cxGetResourceString(@sdxCarManufacturerName1); + 2: Result := cxGetResourceString(@sdxCarManufacturerName2); + else + Result := cxGetResourceString(@sdxCarManufacturerName4); + end; + end; + + function GetManufacturerCountry(AnIndex: Integer): string; + begin + case AnIndex of + 0: Result := cxGetResourceString(@sdxCarManufacturerCountry5); + 1: Result := cxGetResourceString(@sdxCarManufacturerCountry1); + 2: Result := cxGetResourceString(@sdxCarManufacturerCountry2); + else + Result := cxGetResourceString(@sdxCarManufacturerCountry4); + end; + end; + + function GetCarModel(AnIndex: Integer): string; + begin + case AnIndex of + 0: Result := cxGetResourceString(@sdxCarModel5); + 1: Result := cxGetResourceString(@sdxCarModel1); + 2: Result := cxGetResourceString(@sdxCarModel2); + else + Result := cxGetResourceString(@sdxCarModel4); + end; + end; + +const + RecordCount = 4; + CarLogosIndexes: array[0..RecordCount - 1] of Integer = (4, 0, 1, 3); + AreCarsSUV: array[0..RecordCount - 1] of string = ('False', 'True', 'True', 'True'); +var + I: Integer; +begin + PreviewTreeList.Clear; + for I := 0 to RecordCount - 1 do + with PreviewTreeList.Add do + begin + Values[0] := GetManufacturerName(I); + Values[1] := dxPScxCommon.dxPSPreviewCarLogosAsString(CarLogosIndexes[I]); + Values[2] := GetManufacturerCountry(I); + Values[3] := GetCarModel(I); + Values[4] := AreCarsSUV[I]; + end; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.RecreateStylesListBox; +var + List: TList; +begin + List := TList.Create; + try + SaveSelectedStyles(List); + dxPSUtl.dxRecreateWnd(lbxStyles); + RestoreSelectedStyles(List); + finally + List.Free; + end; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.RestoreSelectedStyles(AList: TList); +var + I: Integer; +begin + for I := 0 to AList.Count - 1 do + lbxStyles.Selected[Integer(AList[I])] := True; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.SaveSelectedStyles(AList: TList); +var + I: Integer; +begin + AList.Clear; + for I := 0 to lbxStyles.Items.Count - 1 do + if lbxStyles.Selected[I] then AList.Add(TObject(I)); +end; + +procedure TdxfmTreeListReportLinkDesignWindow.SetActivePage; +begin + PageControl1.ActivePage := PageControl1.Pages[DesignerTabIndex]; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.UpdatePreviewTreeListStyles(const ACaption: string; + AStyle: TcxStyle); +begin + with PreviewTreeList.Styles do + begin + if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxBandHeaderStyle)) then + BandHeader := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentStyle)) then + Content := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentEvenStyle)) then + ContentEven := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentOddStyle)) then + ContentOdd := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxFooterStyle)) then + ColumnFooter := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxHeaderStyle)) then + ColumnHeader := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxFooterRowStyle)) then + Footer := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxPreviewStyle)) then + Preview := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxSelectionStyle)) then + Selection := AStyle + end; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.WarningPaneUpdate; +begin + with ReportLink.HostInfoServices do + wpIncorrectOnEveryPageState.SetStateAndHint(IsInconsistentState, InconsistentStateText); +end; + +procedure TdxfmTreeListReportLinkDesignWindow.SetOptionsExpandingByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + with ReportLink.OptionsExpanding do + case Index of + 0: AutoExpandNodes := Value; + 1: ExplicitlyExpandNodes := Value; + end; + Modified := True; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.SetOptionsFormattingByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + with ReportLink.OptionsFormatting do + case Index of + 0: + begin + UseNativeStyles := Value; + InitializePreviewTreeListStyles; + end; + 1: SuppressBackgroundBitmaps := Value; + 2: ConsumeSelectionStyle := Value; + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.SetOptionsOnEveryPageByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + with ReportLink.OptionsOnEveryPage do + case Index of + 0: BandHeaders := Value; + 1: Headers := Value; + 2: Footers := Value; + end; + Modified := True; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.SetOptionsRefinementsByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + with ReportLink.OptionsRefinements do + case Index of + 0: TransparentGraphics := Value; + 1: DisplayGraphicsAsText := Value; + 2: FlatCheckMarks := Value; + {$IFDEF DXVER500} + 3: TransparentRichEdits := Value; + {$ENDIF} + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.SetOptionsSelectionByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + with ReportLink.OptionsSelection do + case Index of + 0: ProcessSelection := Value; + 1: ProcessExactSelection := Value; + end; + Modified := True; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.SetOptionsSizeByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + with ReportLink.OptionsSize do + case Index of + 0: AutoWidth := Value; + end; + Modified := True; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.SetOptionsViewByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + with ReportLink.OptionsView do + case Index of + 0: BandHeaders := Value; + 1: Headers := Value; + 2: Footers := Value; + 3: ExpandButtons := Value; + 4: TreeLines := Value; + 5: Borders := Value; + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.PreviewTreeListCustomDrawCell( + Sender: TObject; Canvas: TcxCanvas; AViewInfo: TcxTreeListEditCellViewInfo; + var ADone: Boolean); +var + ViewInfo: TcxTreeListEditCellViewInfo; +begin + ViewInfo := TcxTreeListEditCellViewInfo(AViewInfo); + if ViewInfo.Column = colManufacturerLogo then + if ReportLink.OptionsRefinements.DisplayGraphicsAsText then + begin + CustomDrawTextRect(Canvas, ViewInfo.BoundsRect, ReportLink.OptionsRefinements.GraphicsText, + ExtractAlignmentHorz(ViewInfo), ExtractAlignmentVert(ViewInfo), ViewInfo.ViewParams); + CustomDrawBorders(Canvas, ViewInfo.BoundsRect); + ADone := True; + end; + + if ViewInfo.Column = colCarIsSUV then + begin + CustomDrawCheckMark(Canvas, ViewInfo); + CustomDrawBorders(Canvas, AViewInfo.BoundsRect); + ADone := True; + end; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.PreviewTreeListCustomDrawBandHeader( + Sender: TObject; ACanvas: TcxCanvas; AViewInfo: TcxTreeListHeaderViewInfo; + var ADone: Boolean); +var + R: TRect; +begin + R := AViewInfo.BoundsRect; + Dec(R.Top); + Dec(R.Left); + CustomDrawHeader(ACanvas, R, AViewInfo); + + ADone := True; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.PreviewTreeListCustomDrawHeader( + Sender: TObject; ACanvas: TcxCanvas; AViewInfo: TcxTreeListHeaderViewInfo; + var ADone: Boolean); +var + R: TRect; +begin + R := AViewInfo.BoundsRect; + Dec(R.Top); + Dec(R.Left); + CustomDrawHeader(ACanvas, R, AViewInfo); + + ADone := True; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.PreviewTreeListCustomDrawFooterCell( + Sender: TObject; Canvas: TcxCanvas; AViewInfo: TcxTreeListFooterItemViewInfo; + var ADone: Boolean); +begin + CustomDrawFooter(Canvas, AViewInfo.BoundsRect, TcxTreeListFooterItemViewInfo(AViewInfo)); + ADone := True; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.LookAndFeelChange(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TComboBox(Sender) do + ReportLink.OptionsFormatting.LookAndFeelKind := TcxLookAndFeelKind(Items.Objects[ItemIndex]); + Modified := True; + UpdatePreview; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.OptionsRefinementsClick( + Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsRefinementsByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmTreeListReportLinkDesignWindow.PreviewVisibleClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsPreview.Visible := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.PreviewAutoHeightClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OptionsPreview.AutoHeight := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.OptionsSelectionClick( + Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsSelectionByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmTreeListReportLinkDesignWindow.OptionsExpandingClick( + Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsExpandingByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmTreeListReportLinkDesignWindow.OptionsSizeClick( + Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsSizeByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmTreeListReportLinkDesignWindow.OptionsViewClick( + Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsViewByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmTreeListReportLinkDesignWindow.OptionsOnEveryPageClick( + Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsOnEveryPageByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmTreeListReportLinkDesignWindow.OptionsFormattingClick( + Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsFormattingByIndex(TTagToInt(Tag), Checked); +end; + +procedure TdxfmTreeListReportLinkDesignWindow.lblUseNativeStylesClick( + Sender: TObject); +begin + if chbxUseNativeStyles.CanFocus then ActiveControl := chbxUseNativeStyles; + chbxUseNativeStyles.Checked := not chbxUseNativeStyles.Checked; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.pmStylesPopup(Sender: TObject); +begin + lbxStyles.HideToolTips; + miStyleColor.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + miStyleFont.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + miStyleBackgroundBitmap.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + miStyleBackgroundBitmapClear.Enabled := AreNativeStylesAvailable and HasSelectedStylesWithAssignedBitmap; + miStyleRestoreDefaults.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + miStylesSelectAll.Enabled := CanSelectAllStyles; + miStylesSaveAs.Enabled := CanSaveStyles; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.StyleColorClick(Sender: TObject); +begin + PerformStylesChangeColor; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.StyleFontClick(Sender: TObject); +begin + PerformStylesChangeFont; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.StyleBackgroundBitmapClick( + Sender: TObject); +begin + PerformStylesChangeBitmap; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.StyleBackgroundBitmapClearClick( + Sender: TObject); +begin + PerformStylesClearBitmap; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.StyleRestoreDefaultsClick( + Sender: TObject); +begin + PerformStylesRestoreDefaults; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.cbxStyleSheetsClick(Sender: TObject); +begin + with TComboBox(Sender) do + ActiveStyleSheet := TcxCustomStyleSheet(Items.Objects[ItemIndex]); +end; + +procedure TdxfmTreeListReportLinkDesignWindow.btnStyleSheetNewClick(Sender: TObject); +begin + PerformStyleSheetNew; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.btnStyleSheetCopyClick(Sender: TObject); +begin + PerformStyleSheetCopy; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.btnStyleSheetDeleteClick(Sender: TObject); +begin + PerformStyleSheetDelete; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.btnStyleSheetRenameClick(Sender: TObject); +begin + PerformStyleSheetRename; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.miStylesSelectAllClick(Sender: TObject); +{$IFNDEF DELPHI6} +var + I: Integer; +{$ENDIF} +begin + with lbxStyles do + begin + {$IFDEF DELPHI6} + SelectAll; + {$ELSE} + Items.BeginUpdate; + try + for I := 0 to Items.Count - 1 do + Selected[I] := True; + finally + Items.EndUpdate; + end; + {$ENDIF} + end; + UpdateControlsState; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.StylesSaveAsClick(Sender: TObject); +begin + PerformStylesSaveAsStyleSheet; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.cbxStyleSheetsKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + PerformStyleSheetKeyDown(Sender, Key, Shift); +end; + +procedure TdxfmTreeListReportLinkDesignWindow.cbxStyleSheetsDrawItem( + Control: TWinControl; Index: Integer; Rect: TRect; + State: TOwnerDrawState); +begin + PerformStyleSheetDrawItem(TComboBox(Control).Canvas, Index, Rect, State, Control.Enabled); +end; + +procedure TdxfmTreeListReportLinkDesignWindow.lbxStylesClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + UpdateControlsState; +end; + +procedure TdxfmTreeListReportLinkDesignWindow.PageControl1Change(Sender: TObject); +begin + lblPreviewWindow.Parent := TPageControl(Sender).ActivePage; +end; + +procedure RegisterAssistants; +begin + TcxTreeListNodeHelper.Register; + TcxTreeListReportLinkStyleSheet.Register; +end; + +procedure UnregisterAssistants; +begin + TcxTreeListReportLinkStyleSheet.Unregister; + TcxTreeListNodeHelperFactory.ReleaseInstance; +end; + +initialization + RegisterAssistants; + + dxPSRegisterReportLink(TcxTreeListReportLink, TcxTreeList, TdxfmTreeListReportLinkDesignWindow); + dxPSRegisterReportLink(TcxDBTreeListReportLink, TcxDBTreeList, TdxfmTreeListReportLinkDesignWindow); + dxPSRegisterReportLink(TcxVirtualTreeListReportLink, TcxVirtualTreeList, TdxfmTreeListReportLinkDesignWindow); + +finalization + dxPSUnregisterReportLink(TcxVirtualTreeListReportLink, TcxVirtualTreeList, TdxfmTreeListReportLinkDesignWindow); + dxPSUnregisterReportLink(TcxDBTreeListReportLink, TcxDBTreeList, TdxfmTreeListReportLinkDesignWindow); + dxPSUnregisterReportLink(TcxTreeListReportLink, TcxTreeList, TdxfmTreeListReportLinkDesignWindow); + + UnregisterAssistants; + + FreeAndNil(FDefaultdxPScxTreeListLinkStyleSheet); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxTLLnkPredefinedStyleSheets.dfm b/official/x.35/ExpressPrinting System/Sources/dxPScxTLLnkPredefinedStyleSheets.dfm new file mode 100644 index 00000000..dbd927fa --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxTLLnkPredefinedStyleSheets.dfm @@ -0,0 +1,297 @@ +object dxdmPScxTreeListLnkPredefinedStyles: TdxdmPScxTreeListLnkPredefinedStyles + OldCreateOrder = False + Left = 483 + Top = 307 + Height = 150 + Width = 215 + object StyleRepository: TcxStyleRepository + Left = 37 + Top = 12 + object styleProfessionalFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3355443 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = 13033414 + end + object styleProfessionalGroup: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4214088 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 13033414 + end + object styleProfessionalRowCaption: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6582120 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object styleProfessionalCaptionRow: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = 13033414 + end + object styleProfessionalContentOdd: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 13033414 + end + object styleProfessionalContentEven: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4214088 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 536870912 + end + object styleProfessionalPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14541789 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleProfessionalSelection: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object styleGreenFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9358956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleGreenFooter: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9358956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenLightContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12778719 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenLightPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14154698 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenSelected: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6005301 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenGroup: TcxStyle + AssignedValues = [svFont] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + end + object styleNoneContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleNoneFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentBandHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContentEven: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContentOdd: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentFooter: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentFooterRow: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsItalic] + TextColor = clBlack + end + object styleTransparentSelection: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13816275 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object ssProfessional: TcxTreeListReportLinkStyleSheet + Caption = 'Professional' + Styles.BandHeader = styleProfessionalFixed + Styles.Content = styleNoneContent + Styles.ContentEven = styleProfessionalContentEven + Styles.ContentOdd = styleProfessionalContentOdd + Styles.Footer = styleProfessionalFixed + Styles.FooterRow = styleProfessionalFixed + Styles.Header = styleProfessionalFixed + Styles.Preview = styleProfessionalPreview + Styles.Selection = styleProfessionalSelection + BuiltIn = True + end + object ssGreen: TcxTreeListReportLinkStyleSheet + Caption = 'Green' + Styles.BandHeader = styleGreenFixed + Styles.Content = styleNoneContent + Styles.ContentEven = styleGreenLightContent + Styles.ContentOdd = styleNoneContent + Styles.Footer = styleGreenFixed + Styles.FooterRow = styleGreenFixed + Styles.Header = styleGreenFixed + Styles.Preview = styleGreenLightPreview + Styles.Selection = styleGreenSelected + BuiltIn = True + end + object ssTransparent: TcxTreeListReportLinkStyleSheet + Caption = 'Transparent' + Styles.BandHeader = styleTransparentBandHeader + Styles.Content = styleTransparentContent + Styles.ContentEven = styleTransparentContentEven + Styles.ContentOdd = styleTransparentContentOdd + Styles.Footer = styleTransparentFooter + Styles.FooterRow = styleTransparentFooterRow + Styles.Header = styleTransparentHeader + Styles.Preview = styleTransparentPreview + Styles.Selection = styleTransparentSelection + BuiltIn = True + end + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxTLLnkPredefinedStyleSheets.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxTLLnkPredefinedStyleSheets.pas new file mode 100644 index 00000000..c5c36ee7 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxTLLnkPredefinedStyleSheets.pas @@ -0,0 +1,140 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxTLLnkPredefinedStyleSheets; + +interface + +{$I cxVer.inc} + +uses + Classes, {$IFNDEF DELPHI6} Forms, {$ENDIF} cxClasses, cxStyles, dxPScxTLLnk, + dxPScxCommon; + +type + TdxdmPScxTreeListLnkPredefinedStyles = class(TDataModule) + StyleRepository: TcxStyleRepository; + styleProfessionalFixed: TcxStyle; + styleProfessionalGroup: TcxStyle; + styleProfessionalRowCaption: TcxStyle; + styleProfessionalCaptionRow: TcxStyle; + styleProfessionalContentOdd: TcxStyle; + styleProfessionalContentEven: TcxStyle; + styleProfessionalPreview: TcxStyle; + styleProfessionalSelection: TcxStyle; + styleGreenFixed: TcxStyle; + styleGreenFooter: TcxStyle; + styleGreenLightContent: TcxStyle; + styleGreenLightPreview: TcxStyle; + styleGreenSelected: TcxStyle; + styleGreenGroup: TcxStyle; + styleNoneContent: TcxStyle; + styleNoneFixed: TcxStyle; + ssProfessional: TcxTreeListReportLinkStyleSheet; + ssGreen: TcxTreeListReportLinkStyleSheet; + ssTransparent: TcxTreeListReportLinkStyleSheet; + styleTransparentBandHeader: TcxStyle; + styleTransparentContent: TcxStyle; + styleTransparentContentEven: TcxStyle; + styleTransparentContentOdd: TcxStyle; + styleTransparentFooter: TcxStyle; + styleTransparentFooterRow: TcxStyle; + styleTransparentHeader: TcxStyle; + styleTransparentPreview: TcxStyle; + styleTransparentSelection: TcxStyle; + end; + +implementation + +{$R *.dfm} + +uses + cxStyleSheetsLoad; + +type + TdxPScxGridLnkPredefinedStyleSheets = class(TcxPredefinedStyleSheets) + private + FDataModule: TdxdmPScxTreeListLnkPredefinedStyles; + protected + procedure AddStyleSheets; override; + property DataModule: TdxdmPScxTreeListLnkPredefinedStyles read FDataModule; + public + constructor Create; override; + destructor Destroy; override; + + class procedure Register; + class procedure Unregister; + end; + +constructor TdxPScxGridLnkPredefinedStyleSheets.Create; +begin + inherited; + FDataModule := TdxdmPScxTreeListLnkPredefinedStyles.Create(nil); + AddStyleSheets; +end; + +destructor TdxPScxGridLnkPredefinedStyleSheets.Destroy; +begin + FDataModule.Free; + inherited; +end; + +class procedure TdxPScxGridLnkPredefinedStyleSheets.Register; +begin + cxStyleSheetsLoad.RegisterPredefinedStyleSheets(Self); +end; + +class procedure TdxPScxGridLnkPredefinedStyleSheets.Unregister; +begin + cxStyleSheetsLoad.UnregisterPredefinedStyleSheets(Self); +end; + +procedure TdxPScxGridLnkPredefinedStyleSheets.AddStyleSheets; +var + I: Integer; +begin + with DataModule.StyleRepository do + for I := 0 to StyleSheetCount - 1 do + AddStyleSheet(StyleSheets[I]); +end; + +initialization + TdxPScxGridLnkPredefinedStyleSheets.Register; + +finalization + TdxPScxGridLnkPredefinedStyleSheets.Unregister; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxTLLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxTLLnkReg.pas new file mode 100644 index 00000000..2067ecff --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxTLLnkReg.pas @@ -0,0 +1,262 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxTLLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignEditors, + {$ELSE} + DsgnIntf, + {$ENDIF} + Classes, Controls, StdCtrls, cxStyles, cxStyleSheetEditor, cxCustomData, cxTL, + cxImage, dxPSRes, dxPScxTLLnk, dxPScxCommon; + +type + TcxTreeListReportLinkStyleSheetEditorPreview = class(TcxStyleSheetEditorPreview) + private + FTreeList: TcxTreeList; + protected + procedure Initialize; virtual; + property TreeList: TcxTreeList read FTreeList; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + class function GetStyleSheetClass: TcxCustomStyleSheetClass; override; + procedure SetStyleSheet(AStyleSheet: TcxCustomStyleSheet); override; + + function Control: TWinControl; override; + + class procedure Register; + class procedure Unregister; + end; + + TcxCustomTreeListControlAccess = class(TcxCustomTreeListControl); + +constructor TcxTreeListReportLinkStyleSheetEditorPreview.Create(AOwner: TComponent); +begin +// inherited; cannot call ancestor method if it's an abstract method in Delphi4(5) !!!! + FTreeList := TcxTreeList.Create(AOwner); + Initialize; +end; + +destructor TcxTreeListReportLinkStyleSheetEditorPreview.Destroy; +begin + FTreeList.Free; + inherited; +end; + +class function TcxTreeListReportLinkStyleSheetEditorPreview.GetStyleSheetClass: TcxCustomStyleSheetClass; +begin + Result := TcxTreeListReportLinkStyleSheet; +end; + +procedure TcxTreeListReportLinkStyleSheetEditorPreview.SetStyleSheet(AStyleSheet: TcxCustomStyleSheet); +var + TreeListStyles: TcxTreeListStyles; +begin + if AStyleSheet is TcxTreeListReportLinkStyleSheet then + begin + TreeListStyles := TcxCustomTreeListControlAccess(TreeList).Styles; + with TcxTreeListReportLinkStyleSheet(AStyleSheet).Styles do + begin + TreeListStyles.BandHeader := BandHeader; + TreeListStyles.ColumnFooter := Footer; + TreeListStyles.ColumnHeader := Header; + TreeListStyles.Content := Content; + TreeListStyles.ContentEven := ContentEven; + TreeListStyles.ContentOdd := ContentOdd; + TreeListStyles.Footer := FooterRow; + TreeListStyles.Preview := Preview; + end; + end + else + TreeList.Styles.ResetStyles; +end; + +function TcxTreeListReportLinkStyleSheetEditorPreview.Control: TWinControl; +begin + Result := TreeList; +end; + +class procedure TcxTreeListReportLinkStyleSheetEditorPreview.Register; +begin + cxStyleSheetEditor.RegisterStyleSheetEditorPreview(Self); +end; + +class procedure TcxTreeListReportLinkStyleSheetEditorPreview.Unregister; +begin + cxStyleSheetEditor.UnregisterStyleSheetEditorPreview(Self); +end; + +procedure TcxTreeListReportLinkStyleSheetEditorPreview.Initialize; +const + cBandCount = 2; + cColumnCount = 5; + cNodeCount = 4; + + procedure InitializeBands; + const + BandCaptions: array[0..cBandCount - 1] of string = (sdxManufacturerBandCaption, sdxModelBandCaption); + BandWidths: array[0..cBandCount - 1] of Integer = (300, 200); + var + I: Integer; + begin + for I := 0 to cBandCount - 1 do + with TcxCustomTreeListControlAccess(TreeList).Bands.Add do + begin + Caption.Text := BandCaptions[I]; + Width := BandWidths[I]; + end; + end; + + procedure InitializeColumns; + const + ColumnBandIndexes: array[0..cColumnCount - 1] of Integer = (0, 0, 1, 1, 1); + ColumnCaptions: array[0..cColumnCount - 1] of string = + (sdxManufacturerNameColumnCaption, sdxManufacturerLogoColumnCaption, sdxManufacturerCountryColumnCaption, + sdxCarModelColumnCaption, sdxCarIsSUVColumnCaption); + ColumnProperties: array[0..cColumnCount - 1] of string = + ('TcxTextEditProperties', 'TcxImageProperties', 'TcxTextEditProperties', + 'TcxTextEditProperties', 'TcxCheckBoxProperties'); + ColumnWidths: array[0..cColumnCount - 1] of Integer = (150, 150, 0, 120, 80); + var + I: Integer; + begin + with TcxCustomTreeListControlAccess(TreeList) do + begin + for I := 0 to cColumnCount - 1 do + with CreateColumn do + begin + Caption.Text := ColumnCaptions[I]; + Position.BandIndex := ColumnBandIndexes[I]; + Position.ColIndex := Bands[ColumnBandIndexes[I]].ColumnCount - 1; + PropertiesClassName := ColumnProperties[I]; + Width := ColumnWidths[I]; + end; + + Columns[0].Options.Footer := True; + Columns[0].SummaryFooter.Kind := skCount; + Columns[0].SummaryFooter.Format := sdxSummaryFormat; + + TcxImageProperties(Columns[1].Properties).GraphicTransparency := gtTransparent; + + Preview.Column := Columns[2]; + Preview.Visible := True; + end; + end; + + procedure InitializeData; + const + ManufacturerNames: array[0..cNodeCount - 1] of string = + (sdxCarManufacturerName5, sdxCarManufacturerName1, sdxCarManufacturerName2, sdxCarManufacturerName4); + ManufacturerCountries: array[0..cNodeCount - 1] of string = + (sdxCarManufacturerCountry5, sdxCarManufacturerCountry1, sdxCarManufacturerCountry2, sdxCarManufacturerCountry4); + CarLogosIndexes: array[0..cNodeCount - 1] of Integer = + (4, 0, 1, 3); + CarModels: array[0..cNodeCount - 1] of string = + (sdxCarModel5, sdxCarModel1, sdxCarModel2, sdxCarModel4); + AreCarsSUV: array[0..cNodeCount - 1] of string = ('False', 'True', 'True', 'True'); + var + I: Integer; + begin + for I := 0 to cNodeCount - 1 do + with TreeList.Add do + begin + Values[0] := ManufacturerNames[I]; + Values[1] := dxPScxCommon.dxPSPreviewCarLogosAsString(CarLogosIndexes[I]); + Values[2] := ManufacturerCountries[I]; + Values[3] := CarModels[I]; + Values[4] := AreCarsSUV[I]; + end; + end; + + procedure InitializeOptions; + begin + with TcxCustomTreeListControlAccess(TreeList) do + begin + OptionsView.Bands := True; + OptionsView.CellAutoHeight := True; + OptionsView.ColumnAutoWidth := True; + OptionsView.Footer := True; + OptionsView.UseNodeColorForIndent := False; + + OptionsData.Editing := False; + end; + end; + +begin + InitializeBands; + InitializeColumns; + InitializeData; + InitializeOptions; +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterNoIcon([TcxTreeListReportLink, TcxDBTreeListReportLink, TcxVirtualTreeListReportLink, TcxTreeListReportLinkStyleSheet]); +end; + +procedure RegisterStyleSheetAssistants; +begin + cxStyles.RegisterStyleSheetClass(TcxTreeListReportLinkStyleSheet); + TcxTreeListReportLinkStyleSheetEditorPreview.Register; +end; + +procedure UnregisterStyleSheetAssistants; +begin + TcxTreeListReportLinkStyleSheetEditorPreview.Unregister; + cxStyles.UnregisterStyleSheetClass(TcxTreeListReportLinkStyleSheet); +end; + +initialization + RegisterStyleSheetAssistants; + +finalization + UnregisterStyleSheetAssistants; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxVGridLnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPScxVGridLnk.dfm new file mode 100644 index 00000000..3f72d8d1 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxVGridLnk.dfm @@ -0,0 +1,1297 @@ +object cxfmVerticalGridReportLinkDesignWindow: TcxfmVerticalGridReportLinkDesignWindow + Left = 397 + Top = 325 + BorderStyle = bsDialog + Caption = 'cxfmVerticalGridReportLinkDesignWindow' + ClientHeight = 405 + ClientWidth = 644 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 5 + Width = 636 + Height = 363 + ActivePage = tshView + TabOrder = 0 + OnChange = PageControl1Change + object tshView: TTabSheet + Caption = 'View' + object lblShow: TLabel + Left = 5 + Top = 8 + Width = 26 + Height = 13 + Caption = 'Show' + end + object imgShow: TImage + Left = 8 + Top = 34 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDCDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDCCCDDDDDDDDDDDDDDDDDDDDDDDDDDDDCCCCCDDDDDDDDDDDDDDDDDD + DDDDD00000CCC0000000000000000000000DD08888CCC8888887FFFFFFFFFFFF + FF0DD08007CCC7000887F000000000000F0DD088888888888887FFFFFFFFFFFF + FF0DD077777777777777777777777777770DD088888888888887FFFFFFFFFFFF + FF0DD088888888888887FFFFFFFFFFFFFF0DD080000880000887F00000FF0000 + FF0DD088888888888887FFFFFFFFFFFFFF0DD077777777777777777777777777 + 770DD088888888888887FFFFFFFFFFFFFF0DD088888888888887F88888888FFF + FF0DD080000000008887F00000000000FF0DD088888888888887FFFFFFFFFFFF + FF0DD077777777777777777777777777770DD088888888888887FFFFFFFFFFFF + FF0DD088888888888887F88888FFFFFFFF0DD080000000008887F00000000000 + FF0DD088888888888887FFFFFFFFFFFFFF0DD077777777777777777777777777 + 770DD088888888888887FFFFFFFFFFFFFF0DD087777777788887F888888FFFFF + FF0DD08007CCC7000087F0000000F888FF0DD08888CCC8888887FFFFFFFFFFFF + FF0DD00000CCC0000000000000000000000DDDDDDCCCCCDDDDDDDDDDDDDDDDDD + DDDDDDDDDDCCCDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDCDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object bvlShow: TBevel + Left = 43 + Top = 13 + Width = 253 + Height = 4 + Shape = bsBottomLine + end + object bvlMultipleRecords: TBevel + Left = 89 + Top = 101 + Width = 208 + Height = 4 + Shape = bsBottomLine + end + object lblPrintMode: TLabel + Left = 91 + Top = 117 + Width = 33 + Height = 13 + Caption = 'Mode: ' + FocusControl = cbxPrintMode + end + object chbxShowHeaders: TCheckBox + Left = 90 + Top = 29 + Width = 200 + Height = 17 + Caption = '&Headers' + TabOrder = 0 + OnClick = OptionsViewClick + end + object chbxShowExpandButtons: TCheckBox + Tag = 1 + Left = 90 + Top = 75 + Width = 200 + Height = 17 + Caption = 'Expand Buttons' + TabOrder = 2 + OnClick = OptionsViewClick + end + object chbxShowBorders: TCheckBox + Tag = 2 + Left = 90 + Top = 52 + Width = 200 + Height = 17 + Caption = 'Borders' + TabOrder = 1 + OnClick = OptionsViewClick + end + object lblPreviewWindow: TStaticText + Left = 306 + Top = 0 + Width = 82 + Height = 14 + AutoSize = False + Caption = 'Preview' + TabOrder = 3 + end + object cbxPrintMode: TComboBox + Left = 156 + Top = 114 + Width = 140 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 4 + OnChange = cbxPrintModeChange + Items.Strings = ( + 'Current Record' + 'Loaded Records' + 'All Recods') + end + end + object tshBehaviors: TTabSheet + Caption = 'Behaviors' + ImageIndex = 1 + object lblExpanding: TLabel + Left = 5 + Top = 8 + Width = 50 + Height = 13 + Caption = 'Expanding' + end + object imgExpanding: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0888777777777777777777707DDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFFF + F07DD08887888887FFFFFFFFFFFF07DDDDDDDDDDDD0F77777777777777777777 + F07DD08887800087F00000000FFF07DDDDDDDDDDDD0F78887888887FFFFFFFF7 + F07DD08887888887FFFFFFFFFFFF07DDDDDDDDDDDD0F78887888887FFFFFFFF7 + F07DD0888777777777777777777707DDDDDDDDDDDD0F78887800087F00000FF7 + F07DD08887888887FFFFFFFFFFFF07DDDDDDDDDDDD0F78887888887FFFFFFFF7 + F07DD08887800087F0000000000F07DDDDDDDDDDDD0F78887777777777777777 + F07DD08887888887FFFFFFFFFFFF07DDDDDDDDDDDD0F78887888887FFFFFFFF7 + F07DD0888777777777777777777707DDDDDDDDDDDD0F78887800087F000000F7 + F07DD0888888888888888888888807DDDDDDDDDDDD0F78887888887FFFFFFFF7 + F07DD0808887777777777778888807DDDDDDDDDDDD0F78887777777777777777 + F07DD0888888888888888888888807DDDDDDDDDDDD0F78888888888888888887 + F07DD0777777777777777777777707DDCDDDDCDDDD0F78089C80000000088887 + F07DD0888888888888888888888807DDCCCCDCCDDD0F78888888888888888887 + F07DD0808998000000000008888807DDCCCCCCCCDD0F77777777777777777777 + F07DD0888888888888888888888807DDCCCCDCCDDD0F78887888887FFFFFFFF7 + F07DD0777777777777777777777707DDCDDDDCDDDD0F78887800087F000000F7 + F07DD0888888888888888888888807DDDDDDDDDDDD0F78887888887FFFFFFFF7 + F07DD08089C8000000000088888807DDDDDDDDDDDD0F78887777777777777777 + F07DD0888888888888888888888807DDCDDDDCDDDD0F78887888887FFFFFFFF7 + F07DD0777777777777777777777707DDCCCCDCCDDD0F78887800087F00000FF7 + F07DD0888888888888888888888807DDCCCCCCCCDD0F78887888887FFFFFFFF7 + F07DD0808998000000888888888807DDCCCCDCCDDD0F78887777777777777777 + F07DD0888888888888888888888807DDCDDDDCDDDD0F78888888888888888887 + F07DD0777777777777777777777707DDDDDDDDDDDD0F78089980000008888887 + F07DD08888888887FFFFFFFFFFFF07DDDDDDDDDDDD0F78888888888888888887 + F07DD08800008887FF000000000F07DDDDDDDDDDDD0F77777777777777777777 + F07DD08888888887FFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFFF + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object bvlExpanding: TBevel + Left = 62 + Top = 13 + Width = 234 + Height = 4 + Shape = bsBottomLine + end + object lblSize: TLabel + Left = 5 + Top = 78 + Width = 19 + Height = 13 + Caption = 'Size' + end + object bvlSize: TBevel + Left = 33 + Top = 82 + Width = 263 + Height = 4 + Shape = bsBottomLine + end + object imgGridSize: TImage + Left = 8 + Top = 100 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000008088F07DDDDDDDDDDDD0800000000000000000000 + 807DD0F088887FFFF8FFFF0FFF0F07DDDDDDDDDDDD0F08778887F777F7F777F0 + F07DD0F088887FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F08888887FFFFF7FFFFF0 + F07DD0F080087F00F8F00F0FFF0F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F088887FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F08888887FFFFF7FFFFF0 + F07DD0F0777777777777770FFF0F07DDCDDDDCDDDD0F08008887F00FF7F00FF0 + F07DD0F088887FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F08888887FFFFF7FFFFF0 + F07DD0F088887F00F8F00F0FFF0F07DDCCCCCCCCDD0F07777777777777777770 + F07DD0F088887FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F08888887FFFFF7FFFFF0 + F07DD0F088887F00F8F00F0FFF0F07DDCDDDDCDDDD0F08888887F000F7F000F0 + F07DD0F088887FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F08888887FFFFF7FFFFF0 + F07DD0F080087F00F8F00F0FFF0F07DDDDDDDDDDDD0F08008887F000F7F000F0 + F07DD0F088887FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F08888887FFFFF7FFFFF0 + F07DD0F0777777777777770FFF0F07DDCCCCDCCDDD0F07777777777777777770 + F07DD0F088887FFFF8FFFF0FFF8F07DDCCCCCCCCDD0F08888887FFFFF7FFFFF0 + F07DD0F088887F00F8F00F0FFF0F07DDCCCCDCCDDD0F08888887F0FFF7F0FFF0 + F07DD0F088887FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F08888887FFFFF7FFFFF0 + F07DD0F080087F00F8F00F0FFF0F07DDDDDDDDDDDD0F08008887F000F7F000F0 + F07DD0F088887FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F08888887FFFFF7FFFFF0 + F07DD0F0777777777777770FFF0F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F088887FFFF7FFFF0FFF8F07DDDDDDDDDDDD0F08888887FFFFF7FFFFF0 + F07DD0F080087F00F7F00F0FFF0F07DDDDDDDDDDDD0F08008887F00FF7F00FF0 + F07DD0F088887FFFF7FFFF0FFF8F07DDDDDDDDDDDD0F08888887FFFFF7FFFFF0 + F07DD0800000000000000008080807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxExpandRows: TCheckBox + Left = 90 + Top = 29 + Width = 200 + Height = 17 + Caption = 'Rows' + TabOrder = 0 + OnClick = OptionsExpandingClick + end + object chbxAutoWidth: TCheckBox + Left = 90 + Top = 100 + Width = 200 + Height = 17 + Caption = '&Auto Width' + TabOrder = 1 + OnClick = OptionsSizeClick + end + object chbxBestFit: TCheckBox + Tag = 1 + Left = 90 + Top = 123 + Width = 200 + Height = 17 + Caption = 'BestFit' + TabOrder = 2 + OnClick = OptionsSizeClick + end + object chbxWrapRecords: TCheckBox + Tag = 3 + Left = 90 + Top = 169 + Width = 200 + Height = 17 + Caption = '&Wrap Records' + TabOrder = 4 + OnClick = OptionsSizeClick + end + object chbxKeepSameRecordWidths: TCheckBox + Tag = 2 + Left = 90 + Top = 146 + Width = 200 + Height = 17 + Caption = 'Keep Equal Record Widths' + TabOrder = 3 + OnClick = OptionsSizeClick + end + end + object tshFormatting: TTabSheet + Caption = 'Formatting' + ImageIndex = 4 + object lblLookAndFeel: TLabel + Left = 5 + Top = 8 + Width = 66 + Height = 13 + Caption = 'Look and Feel' + end + object bvlLookAndFeel: TBevel + Left = 85 + Top = 13 + Width = 211 + Height = 4 + Shape = bsBottomLine + end + object imgLookAndFeel: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D0887777787787FFFFFFFFFFF07DDDDDDDDDDD0F87777787787FFFFFFFFF + FF07D0888888888887F000FF0000F07DDDDDDDDDDD0F88888888887F000FF000 + 0F07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0880000080087F00000000FF07DDDDDDDDDDD0F80000080087F00000000 + FF07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0888888888887FFFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D07777777777777777777777707DCCCCDCCDDD0777777777777777777777 + 7707D0888888888887FFFFFFFFFFF07DCCCCCCCCDD0F88888888887FFFFFFFFF + FF07D0880000000887F000000000F07DCCCCDCCDDD0F80000000887F00000000 + 0F07D0888888888887FFFFFFFFFFF07DCDDDDCDDDD0F88888888887FFFFFFFFF + FF07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0880000000887F000000F00F07DDDDDDDDDDD0F80000000887F000000F0 + 0F07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0888888888887FFFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D07777777777777777777777707DCCCCDCCDDD0777777777777777777777 + 7707D0888888888887FFFFFFFFFFF07DCCCCCCCCDD0F88888888887FFFFFFFFF + FF07D0880000008887F00000FF00F07DCCCCDCCDDD0F80000008887F00000FF0 + 0F07D0888888888887FFFFFFFFFFF07DCDDDDCDDDD0F88888888887FFFFFFFFF + FF07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0880000000887F00000000FF07DDDDDDDDDDD0F80000000887F00000000 + FF07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgRefinements: TImage + Left = 8 + Top = 100 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777888888888 + 807DD0888888888887FFFFFFFFFF07DDCDDDDCDDDD0888888888887FFFFFFFFF + F07DD0888888888887FF7FFFFFFF07DDCCCCDCCDDD0888888888887FF777777F + F07DD0888888888887FF70888FFF07DDCCCCCCCCDD0888888888887FF7FFFF7F + F07DD0880000000887FF70FF8FFF07DDCCCCDCCDDD0880000000887FF7F00F7F + F07DD0888888888887FF70FF8FFF07DDCDDDDCDDDD0888888888887FF7F00F7F + F07DD0880008888887FF70000FFF07DDDDDDDDDDDD0880008888887FF7FFFF7F + F07DD0888888888887FF777777FF07DDDDDDDDDDDD0888888888887FF777777F + F07DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777888888888 + 807DD0888888888887FFFFFFFFFF07DDCDDDDCDDDD0888888888887FFFFFFFFF + F07DD0888888888887FFFFFFFFFF07DDCCCCDCCDDD0888888888887FFFFFFFFF + F07DD0888888888887FFCCCCCFFF07DDCCCCCCCCDD0888888888887FFFFFFFFF + F07DD0880000000887FCCCCCCCFF07DDCCCCDCCDDD0888888888887FFFFFFFFF + F07DD0888888888887FFCCCCCFFF07DDCDDDDCDDDD0888888888887FFFFFFFFF + F07DD0880000000887F9999999FF07DDDDDDDDDDDD0880000000887F88888FFF + F07DD0888888888887FF99999FFF07DDDDDDDDDDDD0888888888887F888888FF + F07DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777888888888 + 807DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0888888888887FF888FFFFF07DDDDDDDDDDDD0888888888887FF888FFFF + F07DD0880000888887FFFFFFFFFF07DDDDDDDDDDDD0880000888887FFFFFFFFF + F07DD0880000000087FF888888FF07DDDDDDDDDDDD0880000000087FF888888F + F07DD0888888888887FF888888FF07DDDDDDDDDDDD0888888888887FF888888F + F07DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblRefinements: TLabel + Left = 5 + Top = 78 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlRefinements: TBevel + Left = 70 + Top = 82 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object lblPagination: TLabel + Left = 5 + Top = 190 + Width = 50 + Height = 13 + Caption = 'Pagination' + end + object bvlPagination: TBevel + Left = 64 + Top = 195 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object imgPagination: TImage + Left = 8 + Top = 212 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDD0000000000000000000000007DDDDDDDDDDDD77777777777777770DDDDD + DDDDD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD7FFFFFFFFFFFFFFF0DDDDD + DDDDD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD7F7777777777777F0DDDDD + DDDDD0888000000000000000088F07DDDDDDDDDDDD7F78887F88F7FF7F07770D + DDDDD0F8F088887FFFF8FFFF0F8F07DDDDDDDDDDDD7F78887FFFF7FF7F0FFF0D + DDDDD0F8F080087F00F8F00F0F8F07DDDDDDDDDDDD7F7777777777777F077F0D + DDDDD0F8F088887FFFF8FFFF0F8F07DDDDDDDDDDDD7F78887F88F7FF7F0F7F07 + 770DD098F0000000000000000F8907DDDDDDDDDDDD7F78887FFFF7FF7F0F7F0F + FF0DD099FFFFFFFFFFFFFFFFFF9907DDCDDDDCDDDD7F7777777777777F0F7F07 + 7F0DD0999999999999999999999907DDCCCCDCCDDD7F78887FFFF7FF7F0F7F0F + 7F0DD099F0000000000000000F9907DDCCCCCCCCDD7F78787F88F7FF7F0F7F0F + 7F0DD098F088887FFFF8FFFF0F8907DDCCCCDCCDDD7F78887FFFF7FF7F0F7F0F + 7F0DD0F8F088887F88F8F88F0F8F07DDCDDDDCDDDD7F7777777777777F0F7F0F + 7F0DD0F8F080087F00F8F00F0F8F07DDDDDDDDDDDD7F78887FFFF7FF7F0F7F0F + 7F0DD0F8F088887FFFF8FFFF0F8F07DDDDDDDDDDDD7F78787F88F7FF7F0F7F0F + 7F0DD098F0000000000000000F8907DDCDDDDCDDDD7F78887FFFF7FF7F0F7F0F + 7F0DD099FFFFFFFFFFFFFFFFFF9907DDCCCCDCCDDD7F7777777777777F0F7F0F + 7F0DD0999999999999999999999907DDCCCCCCCCDD7F78887FFFF7FF7F0F7F0F + 7F0DD099F0000000000000000F9907DDCCCCDCCDDD7F78787F88F7FF7F0F7F0F + 7F0DD098F088887FFFF8FFFF0F8907DDCDDDDCDDDD7F78887FFFF7FF7F0F7F0F + 7F0DD0F8F088887F88F8F88F0F8F07DDDDDDDDDDDD7F7777777777777F0F7F0F + 7F0DD0F8F080087F00F8F00F0F8F07DDDDDDDDDDDD7FFFFFFFFFFFFFFF0F7F0F + 7F0DD0F8F088887FFFF8FFFF0F8F07DDDDDDDDDDDD00000000000000000F7F0F + 7F0DD0F8F0777778888888880F8F07DDDDDDDDDDDDDDDD7F7777777777777F0F + 7F0DD0F8F088887FFFF8FFFF0F8F07DDDDDDDDDDDDDDDD7FFFFFFFFFFFFFFF0F + 7F0DD0F8F080087F00F8F00F0F8F07DDDDDDDDDDDDDDDD00000000000000000F + 7F0DD0F8F088887FFFF8FFFF0F8807DDDDDDDDDDDDDDDDDDDD7F777777777777 + 7F0DD0888000000000000000088F07DDDDDDDDDDDDDDDDDDDD7FFFFFFFFFFFFF + FF0DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDDDDDDDDDD00000000000000 + 000DD000000000000000000000000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object cbxLookAndFeel: TComboBox + Left = 90 + Top = 37 + Width = 202 + Height = 21 + Style = csDropDownList + ItemHeight = 0 + TabOrder = 0 + OnChange = LookAndFeelChange + end + object chbxFlatCheckMarks: TCheckBox + Tag = 2 + Left = 90 + Top = 146 + Width = 200 + Height = 17 + Caption = 'Flat Check &Marks' + TabOrder = 3 + OnClick = OptionsRefinementsClick + end + object chbxDisplayGraphicsAsText: TCheckBox + Tag = 1 + Left = 90 + Top = 123 + Width = 200 + Height = 17 + Caption = 'Display Graphics As &Text' + TabOrder = 2 + OnClick = OptionsRefinementsClick + end + object chbxTransparentGraphics: TCheckBox + Left = 90 + Top = 100 + Width = 200 + Height = 17 + Caption = 'Transparent &Graphics' + TabOrder = 1 + OnClick = OptionsRefinementsClick + end + object chbxSuppressBackgroundBitmaps: TCheckBox + Tag = 1 + Left = 90 + Top = 169 + Width = 200 + Height = 17 + Caption = 'Suppress Background Textures' + TabOrder = 4 + OnClick = OptionsFormattingClick + end + object chbxPaginateByRows: TCheckBox + Left = 90 + Top = 213 + Width = 200 + Height = 17 + Caption = 'By Rows' + TabOrder = 5 + OnClick = OptionsPaginationClick + end + object chbxPaginateByWrapping: TCheckBox + Tag = 1 + Left = 90 + Top = 236 + Width = 200 + Height = 17 + Caption = 'By Wrapping' + TabOrder = 6 + OnClick = OptionsPaginationClick + end + object chbxOneWrappingPerPage: TCheckBox + Tag = 2 + Left = 90 + Top = 259 + Width = 200 + Height = 17 + Caption = 'One Wrapping Per Page' + TabOrder = 7 + OnClick = OptionsPaginationClick + end + end + object tshStyles: TTabSheet + Caption = 'Styles' + ImageIndex = 4 + object bvlStyles: TBevel + Left = 115 + Top = 13 + Width = 181 + Height = 4 + Shape = bsBottomLine + end + object bvlStyleSheets: TBevel + Left = 72 + Top = 259 + Width = 224 + Height = 5 + Shape = bsBottomLine + end + object lblStyleSheets: TLabel + Left = 6 + Top = 255 + Width = 60 + Height = 13 + Caption = 'Style Sheets' + end + object bvlStylesHost: TBevel + Left = 6 + Top = 33 + Width = 214 + Height = 183 + end + object Label1: TLabel + Left = 77 + Top = 118 + Width = 68 + Height = 13 + Caption = '[ Styles Host ]' + Visible = False + end + object lblUseNativeStyles: TLabel + Left = 23 + Top = 9 + Width = 84 + Height = 13 + Caption = '&Use Native Styles' + FocusControl = chbxUseNativeStyles + OnClick = lblUseNativeStylesClick + end + object btnStyleColor: TButton + Left = 228 + Top = 61 + Width = 68 + Height = 23 + Caption = 'Co&lor...' + TabOrder = 2 + OnClick = StyleColorClick + end + object btnStyleFont: TButton + Left = 228 + Top = 33 + Width = 68 + Height = 23 + Caption = '&Font...' + TabOrder = 1 + OnClick = StyleFontClick + end + object btnStyleBackgroundBitmap: TButton + Left = 228 + Top = 97 + Width = 68 + Height = 23 + Caption = '&Bitmap...' + TabOrder = 3 + OnClick = StyleBackgroundBitmapClick + end + object chbxUseNativeStyles: TCheckBox + Left = 5 + Top = 8 + Width = 15 + Height = 17 + Caption = '&Use Native Styles' + TabOrder = 0 + OnClick = OptionsFormattingClick + end + object cbxStyleSheets: TComboBox + Left = 6 + Top = 275 + Width = 288 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 7 + OnClick = cbxStyleSheetsClick + OnDrawItem = cbxStyleSheetsDrawItem + OnKeyDown = cbxStyleSheetsKeyDown + end + object btnStyleSheetNew: TButton + Left = 6 + Top = 307 + Width = 68 + Height = 23 + Caption = '&New...' + TabOrder = 8 + OnClick = btnStyleSheetNewClick + end + object btnStyleSheetCopy: TButton + Left = 79 + Top = 307 + Width = 68 + Height = 23 + Caption = '&Copy...' + TabOrder = 9 + OnClick = btnStyleSheetCopyClick + end + object btnStyleSheetDelete: TButton + Left = 153 + Top = 307 + Width = 68 + Height = 23 + Caption = '&Delete...' + TabOrder = 10 + OnClick = btnStyleSheetDeleteClick + end + object btnStylesSaveAs: TButton + Left = 116 + Top = 223 + Width = 105 + Height = 23 + Caption = 'Save &As...' + TabOrder = 6 + OnClick = StylesSaveAsClick + end + object btnStyleSheetRename: TButton + Left = 226 + Top = 307 + Width = 68 + Height = 23 + Caption = '&Rename...' + TabOrder = 11 + OnClick = btnStyleSheetRenameClick + end + object btnStyleBackgroundBitmapClear: TButton + Left = 228 + Top = 125 + Width = 68 + Height = 23 + Caption = 'Clear' + TabOrder = 4 + OnClick = StyleBackgroundBitmapClearClick + end + object btnStyleRestoreDefaults: TButton + Left = 6 + Top = 223 + Width = 105 + Height = 23 + Caption = 'Restore Defaults' + TabOrder = 5 + OnClick = StyleRestoreDefaultsClick + end + end + end + object pnlPreview: TPanel + Left = 313 + Top = 44 + Width = 318 + Height = 315 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + object PreviewVGrid: TcxVerticalGrid + Left = 6 + Top = 8 + Width = 307 + Height = 303 + BorderStyle = cxcbsNone + OptionsView.ScrollBars = ssNone + OptionsView.RowHeaderWidth = 112 + OptionsView.ValueWidth = 150 + TabOrder = 0 + OnDrawValue = PreviewVGridDrawValue + object rowLuxurySedan: TcxCategoryRow + Properties.Caption = 'Luxury sedans' + Properties.HeaderAlignmentVert = vaCenter + object rowManufacturer: TcxEditorRow + Properties.Caption = 'Manufacturer' + Properties.HeaderAlignmentVert = vaCenter + Properties.EditPropertiesClassName = 'TcxTextEditProperties' + Properties.EditProperties.MaxLength = 0 + Properties.DataBinding.ValueType = 'String' + Properties.Value = 'BMW' + end + object rowModel: TcxEditorRow + Properties.Caption = 'Model' + Properties.HeaderAlignmentVert = vaCenter + Properties.EditPropertiesClassName = 'TcxTextEditProperties' + Properties.EditProperties.MaxLength = 0 + Properties.DataBinding.ValueType = 'String' + Properties.Value = '760 Li V12' + end + object rowPicture: TcxEditorRow + Height = 116 + Properties.Caption = 'Picture' + Properties.HeaderAlignmentVert = vaCenter + Properties.EditPropertiesClassName = 'TcxImageProperties' + Properties.DataBinding.ValueType = 'String' + Properties.Value = Null + end + object rowEngine: TcxEditorRow + Height = 57 + Properties.Caption = 'Engine' + Properties.EditPropertiesClassName = 'TcxMemoProperties' + Properties.EditProperties.MaxLength = 0 + Properties.DataBinding.ValueType = 'String' + Properties.Value = + '6.0L DOHC V12 438 HP 48V DI Valvetronic 12-cylinder engine with ' + + '6.0-liter displacement, dual overhead cam valvetrain' + end + object rowTransmission: TcxEditorRow + Height = 17 + Properties.Caption = 'Transmission' + Properties.DataBinding.ValueType = 'String' + Properties.Value = 'Elec 6-Speed Automatic w/Steptronic' + end + object rowTires: TcxEditorRow + Height = 44 + Properties.Caption = 'Tires' + Properties.EditPropertiesClassName = 'TcxMemoProperties' + Properties.EditProperties.MaxLength = 0 + Properties.DataBinding.ValueType = 'String' + Properties.Value = + 'P245/45R19 Fr - P275/40R19 Rr Performance. Low Profile tires wit' + + 'h 245mm width, 19.0" rim' + end + end + end + end + object cxStyleRepository1: TcxStyleRepository + Left = 4 + Top = 373 + object styleCategory: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWindowText + end + object styleHeader: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWindowText + end + object styleContent: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWindowText + end + end + object pmStyles: TPopupMenu + Images = ilStylesPopup + OnPopup = pmStylesPopup + Left = 32 + Top = 373 + object miStyleFont: TMenuItem + Caption = '&Font...' + ImageIndex = 0 + ShortCut = 16454 + OnClick = StyleFontClick + end + object miStyleColor: TMenuItem + Caption = '&Color...' + ShortCut = 16451 + OnClick = StyleColorClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miStyleBackgroundBitmap: TMenuItem + Caption = '&Bitmap...' + ImageIndex = 1 + OnClick = StyleBackgroundBitmapClick + end + object miStyleBackgroundBitmapClear: TMenuItem + Caption = 'Clear' + ImageIndex = 3 + ShortCut = 16430 + OnClick = StyleBackgroundBitmapClearClick + end + object milLine: TMenuItem + Caption = '-' + end + object miStylesSelectAll: TMenuItem + Caption = 'Select A&ll' + ShortCut = 16449 + OnClick = miStylesSelectAllClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miStyleRestoreDefaults: TMenuItem + Caption = 'Restore Defaults' + OnClick = StyleRestoreDefaultsClick + end + object miLine4: TMenuItem + Caption = '-' + end + object miStylesSaveAs: TMenuItem + Caption = 'Save &As...' + ImageIndex = 2 + ShortCut = 16467 + OnClick = StylesSaveAsClick + end + end + object ilStylesPopup: TImageList + Left = 60 + Top = 373 + Bitmap = { + 494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00000000000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF000000 + 0000008080000080800000808000008080000080800000808000008080000080 + 8000008080000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000000000000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000008080000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF00FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800080808000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00C0C0C00000FFFF00C0C0C000FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000000000008080800080808000000000008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C00000000000C0C0C00000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFC001FFFF + FE07001F8001FFF9FF9F000F8001E7FFFF9F00078001C3F3E01F00038001C3E7 + F99F00018001E1C7F99B00008001F08FF99B00018001F81FF89300018001FC3F + D80300018001F81FD9BF80018001F09FC93FE0018001C1C7C03FE001800183E3 + FFFFE00180018FF1FFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxVGridLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxVGridLnk.pas new file mode 100644 index 00000000..df83f0f0 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxVGridLnk.pas @@ -0,0 +1,8038 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxVGridLnk; + +interface + +{$I cxVer.inc} + +uses + Windows, SysUtils, Classes, Graphics, Controls, StdCtrls, ExtCtrls, ComCtrls, + Menus, ImgList, cxClasses, cxControls, cxGraphics, cxLookAndFeels, cxStyles, + cxCustomData, cxInplaceContainer, cxVGrid, cxDBVGrid, cxOI, cxEdit, cxTextEdit, + cxMemo, cxImage, dxBase, dxPSSngltn, dxPSGlbl, dxPScxCommon, dxPSCore, dxPrnPg, + dxExtCtrls; + +const + vspsVGridFirst = 0; + vspsVGridContent = vspsVGridFirst + 0; + vspsVGridHeader = vspsVGridFirst + 1; + vspsVGridCategory = vspsVGridFirst + 2; + vspsVGridLast = vspsVGridFirst + 2; + + cxVerticalGridBaseAttributeID = 0; + cxVerticalGridUndefinedID = cxVerticalGridBaseAttributeID + 0; + cxVerticalGridCategoryRowID = cxVerticalGridBaseAttributeID + 1; + cxVerticalGridRowHeaderID = cxVerticalGridBaseAttributeID + 2; + cxVerticalGridRowHeaderSeparatorID = cxVerticalGridBaseAttributeID + 3; + cxVerticalGridRowValueID = cxVerticalGridBaseAttributeID + 4; + cxVerticalGridRowValueSeparatorID = cxVerticalGridBaseAttributeID + 5; + cxVerticalGridRowIndentID = cxVerticalGridBaseAttributeID + 6; + +type + TcxCustomVerticalGridReportLink = class; + TcxfmVerticalGridReportLinkDesignWindow = class; + TcxVerticalGridReportLinkOptionsView = class; + + TcxCustomVerticalGridAdapterClass = class of TcxCustomVerticalGridAdapter; + TcxCustomVerticalGridAdapter = class; + TcxCustomVerticalGridReportLinkBuilderClass = class of TcxCustomVerticalGridReportLinkBuilder; + TcxCustomVerticalGridReportLinkBuilder = class; + TcxCustomVerticalGridReportLinkFormatterClass = class of TcxCustomVerticalGridReportLinkFormatter; + TcxCustomVerticalGridReportLinkFormatter = class; + + TcxVerticalGridCustomRowHelperClass = class of TcxVerticalGridCustomRowHelper; + TcxVerticalGridCustomRowHelper = class; + TcxVerticalGridCategoryRowHelper = class; + TcxVerticalGridCustomEditorRowHelper = class; + TcxVerticalGridCustomMultiEditorRowHelper = class; + + TcxVerticalGridHostInfo = class; + + TcxVerticalGridAttributeID = type Integer; + + TcxVerticalGridCellCustomDrawInfo = record + AttributeID: TcxVerticalGridAttributeID; + Row: TcxCustomRow; + CellIndex: Integer; + RecordIndex: Integer; + end; + + { Row Places } + + TcxVerticalGridRowElementPlace = class + public + Offset: Integer; + Width: Integer; + procedure Clear; + end; + + TcxVerticalGridCustomRowPlaceClass = class of TcxVerticalGridCustomRowPlace; + + TcxVerticalGridCustomRowPlace = class + private + FFormatter: TcxCustomVerticalGridReportLinkFormatter; + FRow: TcxCustomRow; + FWrapIndex: Integer; + function GetDC: HDC; + function GetHasHeader: Boolean; + function GetIndentArea: Integer; + function GetInterRecordsSpace: Integer; + function GetItemCount: Integer; + function GetRecordCount: Integer; + function GetRecordWidth(RecordIndex: Integer): Integer; + function GetStartRecordIndex: Integer; + function GetStopRecordIndex: Integer; + protected + procedure AddDelimiters(AReportLink: TcxCustomVerticalGridReportLink); virtual; + + procedure Calculate; virtual; + function CalculatedHeaderWidth: Integer; virtual; + function CalculatedMinHeight: Integer; virtual; + function CalculatedMinWidth: Integer; virtual; + function CalculatedRecordWidth(ARecordIndex: Integer): Integer; virtual; + function CalculatedTextPatternHeight(AFont: HFONT): Integer; + function CalculatedTextWidth(const AText: string; AFont: HFONT): Integer; + procedure Clear; virtual; + + function GetHeaderAvailableWidth: Integer; virtual; + function GetValueAvailableWidth(RecordIndex: Integer): Integer; virtual; + + function Row: TcxCustomRow; overload; virtual; + function RowHelper: TcxVerticalGridCustomRowHelper; overload; virtual; + + property DC: HDC read GetDC; + property Formatter: TcxCustomVerticalGridReportLinkFormatter read FFormatter; + property HasHeader: Boolean read GetHasHeader; + property HeaderAvailableWidth: Integer read GetHeaderAvailableWidth; + property InterRecordsSpace: Integer read GetInterRecordsSpace; + property ItemCount: Integer read GetItemCount; + property RecordCount: Integer read GetRecordCount; + property RecordWidths[RecordIndex: Integer]: Integer read GetRecordWidth; + property StartRecordIndex: Integer read GetStartRecordIndex; + property StopRecordIndex: Integer read GetStopRecordIndex; + property ValueAvailableWidths[RecordIndex: Integer]: Integer read GetValueAvailableWidth; + public + constructor Create(AFormatter: TcxCustomVerticalGridReportLinkFormatter; ARow: TcxCustomRow; AWrapIndex: Integer); virtual; + + property IndentArea: Integer read GetIndentArea; + property WrapIndex: Integer read FWrapIndex; + end; + + TcxVerticalGridCategoryRowPlace = class(TcxVerticalGridCustomRowPlace) + private + FPlace: TcxVerticalGridRowElementPlace; + function GetCaption: string; + function GetFont: TFont; + function GetOffset: Integer; + function GetWidth: Integer; + protected + procedure Calculate; override; + function CalculatedHeaderWidth: Integer; override; + function CalculatedMinHeight: Integer; override; + function CalculatedMinWidth: Integer; override; + + function Row: TcxCategoryRow; reintroduce; overload; + function RowHelper: TcxVerticalGridCategoryRowHelper; reintroduce; overload; + + property Caption: string read GetCaption; + property Font: TFont read GetFont; + public + constructor Create(AFormatter: TcxCustomVerticalGridReportLinkFormatter; ARow: TcxCustomRow; AWrapIndex: Integer); override; + destructor Destroy; override; + + property Offset: Integer read GetOffset; + property Width: Integer read GetWidth; + end; + + TcxVerticalGridCustomEditorRowPlace = class(TcxVerticalGridCustomRowPlace) + private + FHeaderPlace: TcxVerticalGridRowElementPlace; + FValuePlaces: TList; + function GetHeaderFont: TFont; + function GetProperty(RecordIndex: Integer): TcxCustomEditProperties; + function GetValueFont(RecordIndex: Integer): TFont; + function GetValuePlace(RecordIndex: Integer): TcxVerticalGridRowElementPlace; + function GetValuePlaceCount: Integer; + function GetValue(RecordIndex: Integer): TcxEditValue; + function GetValuesOffset: Integer; + protected + procedure AddDelimiters(AReportLink: TcxCustomVerticalGridReportLink); override; + + procedure Calculate; override; + function CalculatedHeaderWidth: Integer; override; + function CalculatedMinHeight: Integer; override; + function CalculatedRecordWidth(ARecordIndex: Integer): Integer; override; + procedure CalculateHeaderPlace; virtual; + procedure CalculateValuePlaces; virtual; + procedure Clear; override; + + procedure ClearValuePlaces; + procedure CreateValuePlaces; + procedure FreeAndNilValuePlaces; + + function DoesItemParticipateInBestFitCalculation(ARecordIndex: Integer): Boolean; + function MeasureWidth(ARecordIndex: Integer): Integer; + + function Row: TcxCustomEditorRow; reintroduce; overload; + function RowHelper: TcxVerticalGridCustomEditorRowHelper; reintroduce; overload; + + property HeaderFont: TFont read GetHeaderFont; + property Properties[RecordIndex: Integer]: TcxCustomEditProperties read GetProperty; + property ValueFonts[RecordIndex: Integer]: TFont read GetValueFont; + property Values[RecordIndex: Integer]: TcxEditValue read GetValue; + property ValuesOffset: Integer read GetValuesOffset; + public + constructor Create(AFormatter: TcxCustomVerticalGridReportLinkFormatter; ARow: TcxCustomRow; AWrapIndex: Integer); override; + destructor Destroy; override; + + property HeaderPlace: TcxVerticalGridRowElementPlace read FHeaderPlace; + property ValuePlaceCount: Integer read GetValuePlaceCount; + property ValuePlaces[RecordIndex: Integer]: TcxVerticalGridRowElementPlace read GetValuePlace; + end; + + TcxVerticalGridCustomMultiEditorRowPlace = class(TcxVerticalGridCustomRowPlace) + private + FHeaderPlaces: TList; + FHeaderSeparatorPlaces: TList; + FValuePlaces: TList; + FValueSeparatorPlaces: TList; + function GetHasHeaderSeparators: Boolean; + function GetHasValueSeparators: Boolean; + function GetHeaderFont(CellIndex: Integer): TFont; + function GetHeaderPlace(CellIndex: Integer): TcxVerticalGridRowElementPlace; + function GetHeaderPlaceCount: Integer; + function GetHeaderSeparatorCount: Integer; + function GetHeaderSeparatorPlace(CellIndex: Integer): TcxVerticalGridRowElementPlace; + function GetHeaderSeparatorPlaceCount: Integer; + function GetHeaderSeparatorsArea: Integer; + function GetHeaderSeparatorsFont(CellIndex: Integer): TFont; + function GetProperty(CellIndex, RecordIndex: Integer): TcxCustomEditProperties; + function GetValue(CellIndex, RecordIndex: Integer): TcxEditValue; + function GetValueFlatIndex(CellIndex, RecordIndex: Integer): Integer; + function GetValueFont(CellIndex, RecordIndex: Integer): TFont; + function GetValuePlace(CellIndex, RecordIndex: Integer): TcxVerticalGridRowElementPlace; + function GetValuePlaceCount: Integer; + function GetValueSeparatorCount: Integer; + function GetValueSeparatorFlatIndex(CellIndex, RecordIndex: Integer): Integer; + function GetValueSeparatorPlace(CellIndex, RecordIndex: Integer): TcxVerticalGridRowElementPlace; + function GetValueSeparatorPlaceCount: Integer; + function GetValueSeparatorsArea(RecordIndex: Integer): Integer; + function GetValueSeparatorsFont(CellIndex, RecordIndex: Integer): TFont; + function GetValuesOffset: Integer; + protected + procedure AddDelimiters(AReportLink: TcxCustomVerticalGridReportLink); override; + + procedure Calculate; override; + function CalculatedHeaderWidth: Integer; override; + function CalculatedMinHeight: Integer; override; + function CalculatedRecordWidth(ARecordIndex: Integer): Integer; override; + procedure CalculateHeaderPartWidths; + procedure CalculateHeaderPlaces; virtual; + procedure CalculateHeaderSeparatorPlaces; virtual; + procedure CalculateHeaderSeparatorWidths; virtual; + procedure CalculatePartWidths(AnAutoWidthObject: TcxAutoWidthObject; AnAvailableWidth: Integer); + procedure CalculateValuePartWidths; + procedure CalculateValuePlaces; virtual; + procedure CalculateValueSeparatorPlaces; virtual; + procedure CalculateValueSeparatorWidths; virtual; + procedure Clear; override; + + function GetHeaderAvailableWidth: Integer; override; + function GetValueAvailableWidth(RecordIndex: Integer): Integer; override; + + procedure ClearPlaces; + procedure CreatePlaces; + procedure FreeAndNilPlaces; + + function DoesItemParticipateInBestFitCalculation(ACellIndex, ARecordIndex: Integer): Boolean; + function MeasureWidth(ACellIndex, ARecordIndex: Integer): Integer; + + function Row: TcxCustomMultiEditorRow; reintroduce; overload; + function RowHelper: TcxVerticalGridCustomMultiEditorRowHelper; reintroduce; overload; + + property HasHeaderSeparators: Boolean read GetHasHeaderSeparators; + property HasValueSeparators: Boolean read GetHasValueSeparators; + property HeaderFonts[CellIndex: Integer]: TFont read GetHeaderFont; + property HeaderSeparatorCount: Integer read GetHeaderSeparatorCount; + property HeaderSeparatorsArea: Integer read GetHeaderSeparatorsArea; + property HeaderSeparatorsFonts[Index: Integer]: TFont read GetHeaderSeparatorsFont; + property Properties[CellIndex, RecordIndex: Integer]: TcxCustomEditProperties read GetProperty; + property ValueFlatIndexes[CellIndex, RecordIndex: Integer]: Integer read GetValueFlatIndex; + property ValueFonts[CellIndex, RecordIndex: Integer]: TFont read GetValueFont; + property Values[CellIndex, RecordIndex: Integer]: TcxEditValue read GetValue; + property ValueSeparatorCount: Integer read GetValueSeparatorCount; + property ValueSeparatorFlatIndexes[CellIndex, RecordIndex: Integer]: Integer read GetValueSeparatorFlatIndex; + property ValueSeparatorsAreas[RecordIndex: Integer]: Integer read GetValueSeparatorsArea; + property ValueSeparatorsFonts[CellIndex, RecordIndex: Integer]: TFont read GetValueSeparatorsFont; + property ValuesOffset: Integer read GetValuesOffset; + public + constructor Create(AFormatter: TcxCustomVerticalGridReportLinkFormatter; ARow: TcxCustomRow; AWrapIndex: Integer); override; + destructor Destroy; override; + + property HeaderPlaceCount: Integer read GetHeaderPlaceCount; + property HeaderPlaces[CellIndex: Integer]: TcxVerticalGridRowElementPlace read GetHeaderPlace; + property HeaderSeparatorPlaceCount: Integer read GetHeaderSeparatorPlaceCount; + property HeaderSeparatorPlaces[CellIndex: Integer]: TcxVerticalGridRowElementPlace read GetHeaderSeparatorPlace; + property ValuePlaceCount: Integer read GetValuePlaceCount; + property ValuePlaces[CellIndex, RecordIndex: Integer]: TcxVerticalGridRowElementPlace read GetValuePlace; + property ValueSeparatorPlaceCount: Integer read GetValueSeparatorPlaceCount; + property ValueSeparatorPlaces[CellIndex, RecordIndex: Integer]: TcxVerticalGridRowElementPlace read GetValueSeparatorPlace; + end; + + { Row Producers } + + TcxVerticalGridReportLinkCustomElementProducerClass = class of TcxVerticalGridReportLinkCustomElementProducer; + + TcxVerticalGridReportLinkCustomElementProducer = class + private + FBuilder: TcxCustomVerticalGridReportLinkBuilder; + FHost: TdxReportCell; + FRow: TdxReportCell; + FRowHeight: Integer; + FWrapIndex: Integer; + function GetDC: HDC; + function GetRowWidth: Integer; + protected + procedure CalculateRowHeight; virtual; + procedure CreateRow; virtual; + procedure CreateRowHost(AHostInfo: TcxVerticalGridHostInfo); virtual; + procedure InitializeRow; virtual; + + property DC: HDC read GetDC; + property WrapIndex: Integer read FWrapIndex; + public + constructor Create(ABuilder: TcxCustomVerticalGridReportLinkBuilder); virtual; + + function Adapter: TcxCustomVerticalGridAdapter; overload; virtual; + function Builder: TcxCustomVerticalGridReportLinkBuilder; overload; virtual; + function Formatter: TcxCustomVerticalGridReportLinkFormatter; overload; virtual; + + function Produce(AHostInfo: TcxVerticalGridHostInfo; AWrapIndex: Integer): TdxReportCell; virtual; + + property Host: TdxReportCell read FHost; + property Row: TdxReportCell read FRow; + property RowHeight: Integer read FRowHeight write FRowHeight; + property RowWidth: Integer read GetRowWidth; + end; + + TcxVerticalGridReportLinkWrapSeparatorProducerClass = class of TcxVerticalGridReportLinkWrapSeparatorProducer; + + TcxVerticalGridReportLinkWrapSeparatorProducer = class(TcxVerticalGridReportLinkCustomElementProducer) + private + FSeparator: TdxReportCellString; + function GetSeparatorBounds: TRect; + protected + procedure CreateRow; override; + procedure CreateSeparator(AParent: TdxReportCell); virtual; + procedure InitializeRow; override; + procedure InitializeSeparator; virtual; + public + property Separator: TdxReportCellString read FSeparator; + property SeparatorBounds: TRect read GetSeparatorBounds; + end; + + TcxVerticalGridReportLinkCustomRowProducerClass = class of TcxVerticalGridReportLinkCustomRowProducer; + + TcxVerticalGridReportLinkCustomRowProducer = class(TcxVerticalGridReportLinkCustomElementProducer) + private + FGridRow: TcxCustomRow; + FIndents: TList; + function GetIndent(Index: Integer): TdxReportCellExpandButton; + function GetIndentBounds(Index: Integer): TRect; + function GetIndentCount: Integer; + function GetIndentWidth: Integer; + function GetItemCount: Integer; + function GetRecordCount: Integer; + function GetStartRecordIndex: Integer; + function GetStopRecordIndex: Integer; + protected + procedure CalculateRowAutoHeight; virtual; + procedure CalculateRowHeight; override; + procedure ClearItems; virtual; + procedure CreateRow; override; + function CreateRowIndent(AParent: TdxReportCell): TdxReportCellExpandButton; + procedure CreateRowIndents(AParent: TdxReportCell); virtual; + function DoesItemParticipateInRowAutoHeightCalculation(AnItem: TAbstractdxReportCellData): Boolean; virtual; + procedure FixupRowDataHeight; virtual; + procedure FixupRowHeight; virtual; + procedure FixupRowItselfHeight; virtual; + procedure InitializeRow; override; + procedure InitializeRowIndent(AnItem: TdxReportCellExpandButton; AnIndex: Integer); virtual; + + function GetAutoHeight: Boolean; virtual; + function GetHasIndents: Boolean; virtual; + function GetLineHeight: Integer; virtual; + + property ItemCount: Integer read GetItemCount; + property RecordCount: Integer read GetRecordCount; + public + constructor Create(ABuilder: TcxCustomVerticalGridReportLinkBuilder); override; + destructor Destroy; override; + + function GridRow: TcxCustomRow; overload; virtual; + function GridRowHelper: TcxVerticalGridCustomRowHelper; overload; virtual; + function GridRowPlace: TcxVerticalGridCustomRowPlace; overload; virtual; + + function Produce(AHostInfo: TcxVerticalGridHostInfo; AGridRow: TcxCustomRow; + AWrapIndex: Integer): TdxReportCell; reintroduce; overload; + + property AutoHeight: Boolean read GetAutoHeight; + property HasIndents: Boolean read GetHasIndents; + property IndentBounds[Index: Integer]: TRect read GetIndentBounds; + property IndentCount: Integer read GetIndentCount; + property Indents[Index: Integer]: TdxReportCellExpandButton read GetIndent; + property IndentWidth: Integer read GetIndentWidth; + property LineHeight: Integer read GetLineHeight; + property StartRecordIndex: Integer read GetStartRecordIndex; + property StopRecordIndex: Integer read GetStopRecordIndex; + end; + + TcxVerticalGridReportLinkCategoryRowProducer = class(TcxVerticalGridReportLinkCustomRowProducer) + private + function GetCategoryBounds: TRect; + protected + procedure CreateCategoryRow(AParent: TdxReportCell); virtual; + procedure CreateRow; override; + public + function GridRow: TcxCategoryRow; reintroduce; overload; + function GridRowHelper: TcxVerticalGridCategoryRowHelper; reintroduce; overload; + function GridRowPlace: TcxVerticalGridCategoryRowPlace; reintroduce; overload; + + property CategoryBounds: TRect read GetCategoryBounds; + end; + + TcxVerticalGridReportLinkCustomEditableRowProducer = class(TcxVerticalGridReportLinkCustomRowProducer) + private + FHeaders: TList; + FValues: TList; + function GetHeader(Index: Integer): TdxReportCellImage; + function GetHeaderCount: Integer; + function GetValue(Index: Integer): TAbstractdxReportCellData; + function GetValueCount: Integer; + protected + procedure ClearItems; override; + function CreateHeaderItem(AParent: TdxReportCell; ACellIndex: Integer): TdxReportCellImage; + function CreateValueItem(AParent: TdxReportCell; ACellIndex, ARecordIndex: Integer): TAbstractdxReportCellData; + procedure DoInitializeHeader(AnItem: TdxReportCellImage; AnIndex: Integer); virtual; + procedure DoInitializeValue(AnItem: TAbstractdxReportCellData; ACellIndex, ARecordIndex: Integer); virtual; + function DoesItemParticipateInRowAutoHeightCalculation(AnItem: TAbstractdxReportCellData): Boolean; override; + + property HeaderCount: Integer read GetHeaderCount; + property Headers[Index: Integer]: TdxReportCellImage read GetHeader; + property ValueCount: Integer read GetValueCount; + property Values[Index: Integer]: TAbstractdxReportCellData read GetValue; + public + constructor Create(ABuilder: TcxCustomVerticalGridReportLinkBuilder); override; + destructor Destroy; override; + + property RecordCount; + end; + + TcxVerticalGridReportLinkCustomEditorRowProducer = class(TcxVerticalGridReportLinkCustomEditableRowProducer) + private + function GetHasHeader: Boolean; + function GetHeader: TdxReportCellImage; + function GetHeaderBounds: TRect; + function GetValueBounds(Index: Integer): TRect; + protected + procedure CreateHeader(AParent: TdxReportCell); virtual; + procedure CreateRow; override; + procedure CreateValues(AParent: TdxReportCell); virtual; + + property HasHeader: Boolean read GetHasHeader; + property HeaderBounds: TRect read GetHeaderBounds; + property ValueBounds[Index: Integer]: TRect read GetValueBounds; + public + function GridRow: TcxCustomEditorRow; reintroduce; overload; + function GridRowHelper: TcxVerticalGridCustomEditorRowHelper; reintroduce; overload; + function GridRowPlace: TcxVerticalGridCustomEditorRowPlace; reintroduce; overload; + + property Header: TdxReportCellImage read GetHeader; + property ValueCount; + property Values; + end; + + TcxVerticalGridReportLinkCustomMultiEditorRowProducer = class(TcxVerticalGridReportLinkCustomEditableRowProducer) + private + FHeaderSeparators: TList; + FValueSeparators: TList; + function GetHasHeaderSeparators: Boolean; + function GetHasValueSeparators: Boolean; + function GetHeaderBounds(Index: Integer): TRect; + function GetHeaderSeparator(Index: Integer): TdxReportCellString; + function GetHeaderSeparatorBounds(Index: Integer): TRect; + function GetHeaderSeparatorCount: Integer; + function GetHeaderSeparatorText(Index: Integer): string; + function GetValue(CellIndex, RecordIndex: Integer): TAbstractdxReportCellData; + function GetValueBounds(CellIndex, RecordIndex: Integer): TRect; + function GetValueSeparator(Index: Integer): TdxReportCellString; + function GetValueSeparatorBounds(Index, RecordIndex: Integer): TRect; + function GetValueSeparatorCount: Integer; + function GetValueSeparatorText(Index: Integer): string; + protected + procedure ClearItems; override; + procedure CreateRow; override; + + procedure CreateHeaders(AParent: TdxReportCell); virtual; + function CreateHeaderSeparator(AParent: TdxReportCell): TdxReportCellString; + procedure CreateHeaderSeparators(AParent: TdxReportCell); virtual; + procedure CreateValues(AParent: TdxReportCell); virtual; + function CreateValueSeparator(AParent: TdxReportCell): TdxReportCellString; + procedure CreateValueSeparators(AParent: TdxReportCell); virtual; + procedure DoInitializeHeaderSeparator(AnItem: TdxReportCellString; AnIndex: Integer); virtual; + procedure DoInitializeValueSeparator(AnItem: TdxReportCellString; AnIndex, ARecordIndex: Integer); virtual; + + property HasHeaderSeparators: Boolean read GetHasHeaderSeparators; + property HasValueSeparators: Boolean read GetHasValueSeparators; + property HeaderBounds[Index: Integer]: TRect read GetHeaderBounds; + property HeaderSeparatorBounds[Index: Integer]: TRect read GetHeaderSeparatorBounds; + property HeaderSeparatorTexts[Index: Integer]: string read GetHeaderSeparatorText; + property ValueSeparatorBounds[Index, RecordIndex: Integer]: TRect read GetValueSeparatorBounds; + property ValueBounds[CellIndex, RecordIndex: Integer]: TRect read GetValueBounds; + property ValueSeparatorTexts[Index: Integer]: string read GetValueSeparatorText; + public + constructor Create(ABuilder: TcxCustomVerticalGridReportLinkBuilder); override; + destructor Destroy; override; + + function GridRow: TcxCustomMultiEditorRow; reintroduce; overload; + function GridRowHelper: TcxVerticalGridCustomMultiEditorRowHelper; reintroduce; overload; + function GridRowPlace: TcxVerticalGridCustomMultiEditorRowPlace; reintroduce; overload; + + property HeaderCount; + property Headers; + property HeaderSeparatorCount: Integer read GetHeaderSeparatorCount; + property HeaderSeparators[Index: Integer]: TdxReportCellString read GetHeaderSeparator; + property ValueCount; + property Values[CellIndex, RecordIndex: Integer]: TAbstractdxReportCellData read GetValue; + property ValueSeparatorCount: Integer read GetValueSeparatorCount; + property ValueSeparators[Index: Integer]: TdxReportCellString read GetValueSeparator; + end; + + { Row Helpers } + + TcxVerticalGridCustomRowHelper = class(TdxCustomClassMapItem) + private + FAdapter: TcxCustomVerticalGridAdapter; + FRow: TcxCustomRow; + protected + function Adapter: TcxCustomVerticalGridAdapter; overload; virtual; + + function GetDisplayText(Index, RecordIndex: Integer): string; virtual; + function GetEditProperties(Index, RecordIndex: Integer): TcxCustomEditProperties; virtual; + function GetHasHeaderImage(Index: Integer): Boolean; virtual; + function GetHasHeaderSeparators: Boolean; virtual; + function GetHasValueSeparators: Boolean; virtual; + function GetHeaderAlignmentHorz(Index: Integer): TdxTextAlignX; virtual; + function GetHeaderAlignmentVert(Index: Integer): TdxTextAlignY; virtual; + function GetHeaderCaption(Index: Integer): string; virtual; + function GetImageIndex(Index: Integer): Integer; virtual; + function GetIndentCount: Integer; virtual; + function GetItemCount: Integer; virtual; + function GetRecordMinWidth: Integer; virtual; + function GetRowProperties(Index: Integer): TcxCustomRowProperties; virtual; + function GetSeparatorsAlignmentVert: TcxAlignmentVert; virtual; + function GetValue(Index, RecordIndex: Integer): TcxEditValue; virtual; + + property HasHeaderSeparators: Boolean read GetHasHeaderSeparators; + property HasValueSeparators: Boolean read GetHasValueSeparators; + property ItemCount: Integer read GetItemCount; + property RecordMinWidth: Integer read GetRecordMinWidth; + property SeparatorsAlignmentVert: TcxAlignmentVert read GetSeparatorsAlignmentVert; + public + constructor Create(AnAdapter: TcxCustomVerticalGridAdapter); virtual; + procedure Initialize(ARow: TcxCustomRow); virtual; + + class function PairClass: TClass; override; + class procedure Register; + class procedure Unregister; + + class function ProducerClass: TcxVerticalGridReportLinkCustomRowProducerClass; virtual; + function Properties(Index: Integer): TcxCustomRowProperties; overload; virtual; + function Row: TcxCustomRow; overload; virtual; + class function RowClass: TcxCustomRowClass; virtual; + class function RowPlaceClass: TcxVerticalGridCustomRowPlaceClass; virtual; + + property DisplayTexts[Index, RecordIndex: Integer]: string read GetDisplayText; + property EditProperties[Index, RecordIndex: Integer]: TcxCustomEditProperties read GetEditProperties; + property HasHeaderImages[Index: Integer]: Boolean read GetHasHeaderImage; + property HeaderAlignmentHorzs[Index: Integer]: TdxTextAlignX read GetHeaderAlignmentHorz; + property HeaderAlignmentVerts[Index: Integer]: TdxTextAlignY read GetHeaderAlignmentVert; + property HeaderCaptions[Index: Integer]: string read GetHeaderCaption; + property ImageIndexes[Index: Integer]: Integer read GetImageIndex; + property IndentCount: Integer read GetIndentCount; + property Values[Index, RecordIndex: Integer]: TcxEditValue read GetValue; + end; + + TcxVerticalGridCategoryRowHelper = class(TcxVerticalGridCustomRowHelper) + protected + function GetCaption: string; + function GetHeaderAlignmentHorz(Index: Integer): TdxTextAlignX; override; + function GetHeaderAlignmentVert(Index: Integer): TdxTextAlignY; override; + function GetHeaderCaption(Index: Integer): string; override; + function GetImageIndex(Index: Integer): Integer; override; + public + class function ProducerClass: TcxVerticalGridReportLinkCustomRowProducerClass; override; + function Properties(Index: Integer): TcxCaptionRowProperties; reintroduce; overload; + function Row: TcxCategoryRow; reintroduce; overload; + class function RowClass: TcxCustomRowClass; override; + class function RowPlaceClass: TcxVerticalGridCustomRowPlaceClass; override; + + property Caption: string read GetCaption; + end; + + TcxVerticalGridCustomEditorRowHelper = class(TcxVerticalGridCustomRowHelper) + protected + function GetDisplayText(Index, RecordIndex: Integer): string; override; + function GetEditProperties(Index, RecordIndex: Integer): TcxCustomEditProperties; override; + function GetHeaderAlignmentHorz(Index: Integer): TdxTextAlignX; override; + function GetHeaderAlignmentVert(Index: Integer): TdxTextAlignY; override; + function GetHeaderCaption(Index: Integer): string; override; + function GetImageIndex(Index: Integer): Integer; override; + function GetRecordMinWidth: Integer; override; + function GetValue(Index, RecordIndex: Integer): TcxEditValue; override; + public + class function ProducerClass: TcxVerticalGridReportLinkCustomRowProducerClass; override; + function Properties(Index: Integer): TcxCustomEditorRowProperties; reintroduce; overload; + function Row: TcxCustomEditorRow; reintroduce; overload; + class function RowClass: TcxCustomRowClass; override; + class function RowPlaceClass: TcxVerticalGridCustomRowPlaceClass; override; + + property RecordMinWidth; + end; + + TcxVerticalGridEditorRowHelper = class(TcxVerticalGridCustomEditorRowHelper) + public + function Properties(Index: Integer): TcxEditorRowProperties; reintroduce; overload; + function Row: TcxEditorRow; reintroduce; overload; + class function RowClass: TcxCustomRowClass; override; + end; + + TcxVerticalGridDBEditorRowHelper = class(TcxVerticalGridCustomEditorRowHelper) + public + function Properties(Index: Integer): TcxDBEditorRowProperties; reintroduce; overload; + function Row: TcxDBEditorRow; reintroduce; overload; + class function RowClass: TcxCustomRowClass; override; + end; + + TcxVerticalGridCustomMultiEditorRowHelper = class(TcxVerticalGridCustomRowHelper) + private + function GetHeaderSeparatorCount: Integer; + function GetHeaderSeparatorText(Index: Integer): string; + function GetValueSeparatorCount: Integer; + function GetValueSeparatorText(Index: Integer): string; + protected + function GetDisplayText(Index, RecordIndex: Integer): string; override; + function GetEditProperties(Index, RecordIndex: Integer): TcxCustomEditProperties; override; + function GetHasHeaderSeparators: Boolean; override; + function GetHasValueSeparators: Boolean; override; + function GetHeaderAlignmentHorz(Index: Integer): TdxTextAlignX; override; + function GetHeaderAlignmentVert(Index: Integer): TdxTextAlignY; override; + function GetHeaderCaption(Index: Integer): string; override; + function GetImageIndex(Index: Integer): Integer; override; + function GetItemCount: Integer; override; + function GetRecordMinWidth: Integer; override; + function GetRowProperties(Index: Integer): TcxCustomRowProperties; override; + function GetSeparatorsAlignmentVert: TcxAlignmentVert; override; + function GetValue(Index, RecordIndex: Integer): TcxEditValue; override; + public + class function ProducerClass: TcxVerticalGridReportLinkCustomRowProducerClass; override; + function Properties(Index: Integer): TcxEditorRowItemProperties; reintroduce; overload; + function RootProperties: TcxMultiEditorRowProperties; overload; virtual; + function Row: TcxCustomMultiEditorRow; reintroduce; overload; + class function RowClass: TcxCustomRowClass; override; + class function RowPlaceClass: TcxVerticalGridCustomRowPlaceClass; override; + + property HasHeaderSeparators; + property HasValueSeparators; + property HeaderSeparatorCount: Integer read GetHeaderSeparatorCount; + property HeaderSeparatorTexts[Index: Integer]: string read GetHeaderSeparatorText; + property ItemCount; + property RecordMinWidth; + property SeparatorsAlignmentVert; + property ValueSeparatorCount: Integer read GetValueSeparatorCount; + property ValueSeparatorTexts[Index: Integer]: string read GetValueSeparatorText; + end; + + { Caches } + + TcxVerticalGridRowHelperCache = class(TdxCustomCache) + private + FAdapter: TcxCustomVerticalGridAdapter; + function GetHelper(Row: TcxCustomRow): TcxVerticalGridCustomRowHelper; + function GetItem(Index: Integer): TcxVerticalGridCustomRowHelper; + protected + function IndexOf(Row: TcxCustomRow): Integer; + property Items[Index: Integer]: TcxVerticalGridCustomRowHelper read GetItem; + public + constructor Create(AnAdapter: TcxCustomVerticalGridAdapter); + + property Adapter: TcxCustomVerticalGridAdapter read FAdapter; + property Helpers[Row: TcxCustomRow]: TcxVerticalGridCustomRowHelper read GetHelper; default; + end; + + TcxVerticalGridReportLinkProducerCache = class(TdxCustomCache) + private + FBuilder: TcxCustomVerticalGridReportLinkBuilder; + function GetItem(Index: Integer): TcxVerticalGridReportLinkCustomRowProducer; + function GetProducer(ProducerClass: TcxVerticalGridReportLinkCustomRowProducerClass): TcxVerticalGridReportLinkCustomRowProducer; + protected + function IndexOf(AProducerClass: TcxVerticalGridReportLinkCustomRowProducerClass): Integer; + property Items[Index: Integer]: TcxVerticalGridReportLinkCustomRowProducer read GetItem; + public + constructor Create(ABuilder: TcxCustomVerticalGridReportLinkBuilder); + property Builder: TcxCustomVerticalGridReportLinkBuilder read FBuilder; + property Producers[ProducerClass: TcxVerticalGridReportLinkCustomRowProducerClass]: TcxVerticalGridReportLinkCustomRowProducer read GetProducer; default; + end; + + TcxCustomVerticalGridReportLinkBuilder = class + private + FAdapter: TcxCustomVerticalGridAdapter; + FFormatter: TcxCustomVerticalGridReportLinkFormatter; + FProducerCache: TcxVerticalGridReportLinkProducerCache; + FReportLink: TcxCustomVerticalGridReportLink; + FReportRows: TList; + FWrapSeparatorProducer: TcxVerticalGridReportLinkWrapSeparatorProducer; + function GetAvailableSiteWidth: Integer; + function GetAvailableWidth: Integer; + function GetHost: TdxReportCell; + function GetReportCells: TdxReportCells; + function GetReportRow(Index: Integer): TdxReportCell; + function GetReportRowCount: Integer; + function GetVerticalGrid: TcxCustomVerticalGrid; + protected + procedure AddReportRow(ARow: TdxReportCell); + procedure AfterBuilding; virtual; + procedure BeforeBuilding; virtual; + + procedure CreateRow(ARow: TcxCustomRow; AWrapIndex: Integer); virtual; + procedure CreateRows; virtual; + procedure CreateWrapSeparator(AWrapIndex: Integer); virtual; + function GetRowProducer(ARow: TcxCustomRow): TcxVerticalGridReportLinkCustomRowProducer; + function GetRowProducerClass(ARow: TcxCustomRow): TcxVerticalGridReportLinkCustomRowProducerClass; virtual; + function GetWrapSeparatorProducer(AWrapIndex: Integer): TcxVerticalGridReportLinkWrapSeparatorProducer; + function GetWrapSeparatorProducerClass: TcxVerticalGridReportLinkWrapSeparatorProducerClass; virtual; + + function AreWrapSeparatorsNeeded: Boolean; + procedure DoBuild; virtual; + function IsAborted: Boolean; + + property ProducerCache: TcxVerticalGridReportLinkProducerCache read FProducerCache; + property ReportLink: TcxCustomVerticalGridReportLink read FReportLink; + public + constructor Create(AReportLink: TcxCustomVerticalGridReportLink); virtual; + destructor Destroy; override; + + procedure Build; virtual; + procedure Progress(const APercentDone: Double); + + function Adapter: TcxCustomVerticalGridAdapter; overload; virtual; + class function AdapterClass: TcxCustomVerticalGridAdapterClass; virtual; + function Formatter: TcxCustomVerticalGridReportLinkFormatter; overload; virtual; + class function FormatterClass: TcxCustomVerticalGridReportLinkFormatterClass; virtual; + + property AvailableSiteWidth: Integer read GetAvailableSiteWidth; + property AvailableWidth: Integer read GetAvailableWidth; + property Host: TdxReportCell read GetHost; + property ReportCells: TdxReportCells read GetReportCells; + property ReportRowCount: Integer read GetReportRowCount; + property ReportRows[Index: Integer]: TdxReportCell read GetReportRow; + property VerticalGrid: TcxCustomVerticalGrid read GetVerticalGrid; + end; + + TcxVerticalGridReportLinkBuilderHandler = class + private + FBuilder: TcxCustomVerticalGridReportLinkBuilder; + function GetReportLink: TcxCustomVerticalGridReportLink; + public + constructor Create(ABuilder: TcxCustomVerticalGridReportLinkBuilder); virtual; + function Builder: TcxCustomVerticalGridReportLinkBuilder; overload; virtual; + + property ReportLink: TcxCustomVerticalGridReportLink read GetReportLink; + end; + + TcxCustomVerticalGridAdapter = class(TcxVerticalGridReportLinkBuilderHandler) + private + FHelperCache: TcxVerticalGridRowHelperCache; + function GetCellAutoHeight: Boolean; + function GetCellEndEllipsis: Boolean; + function GetCellMultiline: Boolean; + function GetDataController: TcxCustomDataController; + function GetDefaultRowHeight: Integer; + function GetFirstRecordIndex: Integer; + function GetGridLinesColor: TColor; + function GetHeaderAvailableWidth(Row: TcxCustomRow): Integer; + function GetHeaderMinWidth: Integer; + function GetHeaderWidth: Integer; + function GetHelper(Row: TcxCustomRow): TcxVerticalGridCustomRowHelper; + function GetImages: TCustomImageList; + function GetIndentArea(Row: TcxCustomRow): Integer; + function GetIndentCount(Row: TcxCustomRow): Integer; + function GetIndentWidth: Integer; + function GetMakeSpaceForEmptyImage: Boolean; + function GetOptionsView: TcxvgOptionsView; + function GetPaintStyle: TcxvgPaintStyle; + function GetRecordCount: Integer; + function GetRecordMinWidth(RecordIndex: Integer): Integer; + function GetRecordWidth(RecordCount: Integer): Integer; + function GetRow(Index: Integer): TcxCustomRow; + function GetRowCount: Integer; + function GetRowHeight(Row: TcxCustomRow): Integer; + function GetShowHeaders: Boolean; + function GetShowHorzGridLines: Boolean; + function GetShowVertGridLines: Boolean; + function GetStyles: TcxVerticalGridStyles; + function GetValueMinWidth: Integer; + function GetVerticalGrid: TcxCustomVerticalGrid; + protected + procedure AfterBuilding; virtual; + procedure BeforeBuilding; virtual; + + function GetInterRecordsSpace: Integer; virtual; + function GetLayoutStyle: TcxvgLayoutStyle; virtual; abstract; + { properties } + function GetProperties(ARow: TcxCustomRow; AnIndex, ARecordIndex: Integer): TcxCustomEditProperties; + function GetPropertiesClass(ARow: TcxCustomRow; AnIndex, ARecordIndex: Integer): TcxCustomEditPropertiesClass; + { styles } + function GetCategoryViewParams(ARow: TcxCustomRow): TcxViewParams; virtual; + function GetContentViewParams(ARow: TcxCustomRow; AnIndex, ARecordIndex: Integer): TcxViewParams; virtual; + function GetHeaderViewParams(ARow: TcxCustomRow): TcxViewParams; virtual; + function GetImageViewParams(ARow: TcxCustomRow): TcxViewParams; virtual; + function GetIndentViewParams(ARow: TcxCustomRow): TcxViewParams; virtual; + { backgrounds } + function GetBackgroundBitmap(Index: Integer): TBitmap; + function GetRowIndentBackgroundBitmapIndex(ARow: TcxCustomRow; Alevel: Integer): Integer; + function HasBackgroundBitmap(Index: Integer): Boolean; + + procedure FullExpand; + function GetImageHeight(ARow: TcxCustomRow; AnIndex: Integer): Integer; + function GetImageWidth(ARow: TcxCustomRow; AnIndex: Integer): Integer; + function GetRowParentAtLevel(ARow: TcxCustomRow; ALevel: Integer): TcxCustomRow; + function HasCategoryRowAsParentAtLevel(ARow: TcxCustomRow; ALevel: Integer; ACheckFollow: Boolean): Boolean; + function HasRowImage(ARow: TcxCustomRow; AnIndex: Integer): Boolean; + function IsRowLastChildAtLevel(ARow: TcxCustomRow; ALevel: Integer): Boolean; + function IsRowVisible(ARow: TcxCustomRow): Boolean; + + property Helpers[Row: TcxCustomRow]: TcxVerticalGridCustomRowHelper read GetHelper; + property OptionsView: TcxvgOptionsView read GetOptionsView; + property Styles: TcxVerticalGridStyles read GetStyles; + property VerticalGrid: TcxCustomVerticalGrid read GetVerticalGrid; + public + constructor Create(ABuilder: TcxCustomVerticalGridReportLinkBuilder); override; + destructor Destroy; override; + + property DataController: TcxCustomDataController read GetDataController; + property CellAutoHeight: Boolean read GetCellAutoHeight; + property CellEndEllipsis: Boolean read GetCellEndEllipsis; + property CellMultiline: Boolean read GetCellMultiline; + property DefaultRowHeight: Integer read GetDefaultRowHeight; + property FirstRecordIndex: Integer read GetFirstRecordIndex; + property GridLinesColor: TColor read GetGridLinesColor; + property HeaderAvailableWidths[Row: TcxCustomRow]: Integer read GetHeaderAvailableWidth; + property HeaderMinWidth: Integer read GetHeaderMinWidth; + property HeaderWidth: Integer read GetHeaderWidth; + property Images: TCustomImageList read GetImages; + property IndentAreas[Row: TcxCustomRow]: Integer read GetIndentArea; + property IndentCounts[Row: TcxCustomRow]: Integer read GetIndentCount; + property IndentWidth: Integer read GetIndentWidth; + property InterRecordsSpace: Integer read GetInterRecordsSpace; + property LayoutStyle: TcxvgLayoutStyle read GetLayoutStyle; + property MakeSpaceForEmptyImage: Boolean read GetMakeSpaceForEmptyImage; + property PaintStyle: TcxvgPaintStyle read GetPaintStyle; + property RecordCount: Integer read GetRecordCount; + property RecordMinWidths[RecordIndex: Integer]: Integer read GetRecordMinWidth; + property RecordWidth[RecordCount: Integer]: Integer read GetRecordWidth; + property RowCount: Integer read GetRowCount; + property RowHeights[Row: TcxCustomRow]: Integer read GetRowHeight; + property Rows[Index: Integer]: TcxCustomRow read GetRow; + property ShowHeaders: Boolean read GetShowHeaders; + property ShowHorzGridLines: Boolean read GetShowHorzGridLines; + property ShowVertGridLines: Boolean read GetShowVertGridLines; + property ValueMinWidth: Integer read GetValueMinWidth; + end; + + TcxCustomVerticalGridReportLinkFormatter = class(TcxVerticalGridReportLinkBuilderHandler, + IUnknown, IdxPSCellParams, IdxPSCellParams2) + private + FFont: TFont; + FHeaderWidth: Integer; + FInterRecordsSpace: Integer; + FIsPrevGridMode: Boolean; + FLookAndFeelItems: TList; + FRecordWidths: TList; + FRowHeights: TList; + FRowPlaces: TList; + FRows: TList; + FTransparentColor: TColor; + FViewWidths: TList; + FWrappedRecordStartIndexes: TList; + function GetAutoWidth: Boolean; + function GetDataController: TcxCustomDataController; + function GetDC: HDC; + function GetExpandButtonColor(Row: TcxCustomRow): TColor; + function GetExpandButtonSize: Integer; + function GetGridLinesColor: TColor; + function GetHeaderAvailableWidth(Row: TcxCustomRow): Integer; + function GetHeaderMinWidth: Integer; + function GetHeaderWidth: Integer; + function GetIndentArea(Row: TcxCustomRow): Integer; + function GetInternalIndexByRecordIndex(RecordIndex: Integer): Integer; + function GetInternalRecordWidth: Integer; + function GetInterRecordsSpace: Integer; + function GetLookAndFeelItem(Index: Integer): TdxReportVisualItem; + function GetLookAndFeelItemCount: Integer; + function GetOptionsView: TcxVerticalGridReportLinkOptionsView; + function GetRecordCount(Index: Integer): Integer; + function GetRecordMinWidth(RecordIndex: Integer): Integer; + function GetRecordWidth(RecordIndex: Integer): Integer; + function GetRow(Index: Integer): TcxCustomRow; + function GetRowCount: Integer; + function GetRowHeight(Row: TcxCustomRow): Integer; + function GetRowHelper(Row: TcxCustomRow): TcxVerticalGridCustomRowHelper; + function GetRowPlace(WrapIndex, Index: Integer): TcxVerticalGridCustomRowPlace; + function GetRowPlaceByRow(Row: TcxCustomRow; WrapIndex: Integer): TcxVerticalGridCustomRowPlace; + function GetRowPlaceFlatIndex(WrapIndex, Index: Integer): Integer; + function GetRowPlaceCount: Integer; + function GetRenderer: TdxPSReportRenderer; + function GetShowBorders: Boolean; + function GetShowHeaders: Boolean; + function GetShowHorzGridLines: Boolean; + function GetShowVertGridLines: Boolean; + function GetViewMaxWidth: Integer; + function GetViewWidth(WrapIndex: Integer): Integer; + function GetWrapCount: Integer; + function GetWrappedRecordStartIndex(Index: Integer): Integer; + function GetWrappedRecordStopIndex(Index: Integer): Integer; + function GetWrapSeparatorHeight: Integer; + procedure SetInterRecordsSpace(Value: Integer); + procedure SetRecordWidth(RecordIndex: Integer; Value: Integer); + procedure SetRowHeight(Row: TcxCustomRow; Value: Integer); + procedure SetViewWidth(WrapIndex: Integer; Value: Integer); + + procedure FormatLookAndFeelItems; + protected + { IUnknown } + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + { IdxPSCellParams } + function IdxPSCellParams.GetAutoHeight = IdxPSCellParams_GetAutoHeight; + function IdxPSCellParams.GetDC = IdxPSCellParams_GetDC; + function IdxPSCellParams.GetDisplayGraphicsAsText = IdxPSCellParams_GetDisplayGraphicsAsText; + function IdxPSCellParams.GetEndEllipsis = IdxPSCellParams_GetEndEllipsis; + function IdxPSCellParams.GetFlatCheckMarks = IdxPSCellParams_GetFlatCheckMarks; + function IdxPSCellParams.GetGraphicsText = IdxPSCellParams_GetGraphicsText; + function IdxPSCellParams.GetMultiline = IdxPSCellParams_GetMultiline; + function IdxPSCellParams.GetTransparentGraphics = IdxPSCellParams_GetTransparentGraphics; + function IdxPSCellParams_GetAutoHeight: Boolean; virtual; + function IdxPSCellParams_GetDC: HDC; virtual; + function IdxPSCellParams_GetDisplayGraphicsAsText: Boolean; virtual; + function IdxPSCellParams_GetEndEllipsis: Boolean; virtual; + function IdxPSCellParams_GetFlatCheckMarks: Boolean; virtual; + function IdxPSCellParams_GetGraphicsText: string; virtual; + function IdxPSCellParams_GetMultiline: Boolean; virtual; + function IdxPSCellParams_GetTransparentGraphics: Boolean; virtual; + { IdxPSCellParams2 } + function IdxPSCellParams2.GetPreviewMarginLeft = IdxPSCellParams2_GetPreviewMarginLeft; + function IdxPSCellParams2.GetPreviewMarginRight = IdxPSCellParams2_GetPreviewMarginRight; + function IdxPSCellParams2.GetPreviewMaxHeight = IdxPSCellParams2_GetPreviewMaxHeight; + function IdxPSCellParams2.GetPreviewMaxLineCount = IdxPSCellParams2_GetPreviewMaxLineCount; + function IdxPSCellParams2.GetRichEditGraphicClass = IdxPSCellParams2_GetRichEditGraphicClass; + function IdxPSCellParams2.GetRichEditTransparent = IdxPSCellParams2_GetRichEditTransparent; + function IdxPSCellParams2_GetPreviewMarginLeft: Integer; virtual; + function IdxPSCellParams2_GetPreviewMarginRight: Integer; virtual; + function IdxPSCellParams2_GetPreviewMaxHeight: Integer; virtual; + function IdxPSCellParams2_GetPreviewMaxLineCount: Integer; virtual; + function IdxPSCellParams2_GetRichEditGraphicClass: TGraphicClass; virtual; + function IdxPSCellParams2_GetRichEditTransparent: Boolean; virtual; + + procedure AddDelimiters; virtual; + procedure AddHorizontalDelimiters; virtual; + procedure AddVerticalDelimiters; virtual; + procedure AfterBuilding; virtual; + procedure BeforeBuilding; virtual; + + function GetAreRecordsNeededLoading: Boolean; virtual; + function GetAreRecordsNeededUnloading: Boolean; virtual; + function GetFirstInternalRecordIndex: Integer; virtual; + function GetInternalRecordCount: Integer; virtual; + procedure LoadRecords; virtual; + procedure UnloadRecords; virtual; + + procedure AddWrappedRecordStartIndex(Value: Integer); + procedure Calculate; virtual; + procedure CalculateBestFit; virtual; + procedure CalculateHeight(const AParams: TdxReportItemViewParams; var AHeight: Integer); + function CalculatedMinWidth: Integer; virtual; + procedure CalculateRecordAutoWidths; + procedure CalculateRecordCounts; + procedure CalculateRowHeights; + procedure CalculateRowPlaces; + procedure CalculateViewWidths; + procedure CreateRowList; virtual; + procedure CreateRowPlaces; + function CreateRowPlace(ARow: TcxCustomRow; AWrapIndex: Integer): TcxVerticalGridCustomRowPlace; virtual; + procedure InitializeRecordWidths; virtual; + procedure InitializeRowHeights; virtual; + procedure InitializeWrappedRecordIndexes; virtual; + + function GetBackgroundBitmap(Index: Integer): TBitmap; + function GetBackgroundBitmapIndex(Index: Integer): Integer; + function HasBackgroundBitmap(Index: Integer): Boolean; + function MapStyleBackgroundBitmapIndex(AVerticalGridBackgroundBitmapIndex: Integer): Integer; + + function GetCategoryRowFont(ARow: TcxCustomRow): TFont; + function GetRowHeaderFont(ARow: TcxCustomRow; AnIndex: Integer): TFont; + function GetRowHeaderSeparatorsFont(ARow: TcxCustomRow; AnIndex: Integer): TFont; + function GetRowValueFont(ARow: TcxCustomRow; AnIndex, ARecordIndex: Integer): TFont; + function GetRowValueSeparatorsFont(ARow: TcxCustomRow; AnIndex, ARecordIndex: Integer): TFont; + + procedure ClearRowPlaces; + function FixupHorzCellSides(ARow: TcxCustomRow; ACellSides: TdxCellSides): TdxCellSides; + procedure FreeAndNilRowPlaces; + function GetImageHeight(ARow: TcxCustomRow; ACellIndex: Integer): Integer; + function GetImageWidth(ARow: TcxCustomRow; ACellIndex: Integer): Integer; + function GetNextRow(ARow: TcxCustomRow): TcxCustomRow; + function GetPrevRow(ARow: TcxCustomRow): TcxCustomRow; + function GetRowByReportRow(ARow: TdxReportCell): TcxCustomRow; + function GetStyleFontIndex(const AParams: TdxReportItemViewParams): Integer; + function IndexOfRow(ARow: TcxCustomRow): Integer; + function IsColorTransparent(AColor: TColor): Boolean; + function IsFirstRow(ARow: TcxCustomRow): Boolean; + function IsLastRow(ARow: TcxCustomRow): Boolean; + function MakeCustomDrawCodeData(AnAttribute: TcxVerticalGridAttributeID; ACellIndex, ARecordIndex: Integer): Integer; + procedure RegisterLookAndFeelItem(AnItem: TdxReportVisualItem; AEdgeStyle: TdxCellEdgeStyle); + procedure SetViewParams(AnItem: TdxReportVisualItem; const AParams: TdxReportItemViewParams); + + property AreRecordsNeededLoading: Boolean read GetAreRecordsNeededLoading; + property AreRecordsNeededUnloading: Boolean read GetAreRecordsNeededUnloading; + property DataController: TcxCustomDataController read GetDataController; + property DC: HDC read GetDC; + property FirstInternalRecordIndex: Integer read GetFirstInternalRecordIndex; + property HeaderAvailableWidths[Row: TcxCustomRow]: Integer read GetHeaderAvailableWidth; + property IndentAreas[Row: TcxCustomRow]: Integer read GetIndentArea; + property InternalIndexesByRecordIndex[RecordIndex: Integer]: Integer read GetInternalIndexByRecordIndex; + property InternalRecordCount: Integer read GetInternalRecordCount; + property InternalRecordWidth: Integer read GetInternalRecordWidth; + property IsPrevGridMode: Boolean read FIsPrevGridMode; + property LookAndFeelItemCount: Integer read GetLookAndFeelItemCount; + property LookAndFeelItems[Index: Integer]: TdxReportVisualItem read GetLookAndFeelItem; + property Renderer: TdxPSReportRenderer read GetRenderer; + property RowHelpers[Row: TcxCustomRow]: TcxVerticalGridCustomRowHelper read GetRowHelper; + property RowPlaceCount: Integer read GetRowPlaceCount; + property RowPlaceFlatIndexes[WrapIndex, Index: Integer]: Integer read GetRowPlaceFlatIndex; + property RowPlaces[WrapIndex, Index: Integer]: TcxVerticalGridCustomRowPlace read GetRowPlace; + property RowPlacesByRow[Row: TcxCustomRow; WrapIndex: Integer]: TcxVerticalGridCustomRowPlace read GetRowPlaceByRow; + property ViewWidths[WrapIndex: Integer]: Integer read GetViewWidth write SetViewWidth; + property WrappedRecordStartIndexes[Index: Integer]: Integer read GetWrappedRecordStartIndex; + property WrappedRecordStopIndexes[Index: Integer]: Integer read GetWrappedRecordStopIndex; + public + constructor Create(ABuilder: TcxCustomVerticalGridReportLinkBuilder); override; + destructor Destroy; override; + + function Adapter: TcxCustomVerticalGridAdapter; overload; virtual; + + procedure DoInitializeHost(AHost: TdxReportCell); virtual; + { Images } + procedure DoInitializeRowImage(ARow: TcxCustomRow; AnItem: TdxReportCellGraphic; AnIndex: Integer); virtual; + function GetRowImageCellSides(ARow: TcxCustomRow): TdxCellSides; virtual; + function GetRowImageClass: TdxReportCellGraphicClass; virtual; + function GetRowImageViewParams(ARow: TcxCustomRow; AnIndex: Integer): TdxReportItemViewParams; virtual; + { Indents and Expand Buttons } + procedure DoInitializeRowIndent(ARow: TcxCustomRow; AnItem: TdxReportCellExpandButton; AnIndex, AnIndentCount: Integer); virtual; + procedure DoInitializeExpandButton(ARow: TcxCustomRow; AnItem: TdxReportCellExpandButton; AnIndex, AnIndentCount: Integer); virtual; + procedure DoReportLinkInitializeRowIndent(ARow: TcxCustomRow; AnItem: TdxReportCellExpandButton; AnIndex: Integer); virtual; + function GetRowIndentCellSides(ARow: TcxCustomRow; AnIndex, AnIndentCount: Integer): TdxCellSides; virtual; + function GetRowIndentClass: TdxReportCellExpandButtonClass; virtual; + function GetRowIndentViewParams(ARow: TcxCustomRow; AnIndex, AnIndentCount: Integer): TdxReportItemViewParams; virtual; + { Rows } + procedure DoInitializeCategoryRow(ARow: TcxCategoryRow; AnItem: TdxReportCellImage); virtual; + procedure DoInitializeRowReportRow(ARow: TcxCustomRow; AReportRow: TdxReportCell); virtual; + procedure DoInitializeRowHeader(ARow: TcxCustomRow; AnItem: TdxReportCellImage; AnIndex: Integer); virtual; + procedure DoInitializeRowValue(ARow: TcxCustomRow; AnItem: TAbstractdxReportCellData; AnIndex, ARecordIndex: Integer); virtual; + procedure DoReportLinkInitializeRowHeader(ARow: TcxCustomRow; AnItem: TdxReportCellImage; AnIndex: Integer); virtual; + procedure DoReportLinkInitializeRowValue(ARow: TcxCustomRow; AnItem: TAbstractdxReportCellData; AnIndex, ARecordIndex: Integer); virtual; + function GetCategoryRowCellSides(ARow: TcxCustomRow): TdxCellSides; virtual; + function GetCategoryRowClass(ARow: TcxCustomRow): TdxReportCellImageClass; virtual; + function GetCategoryRowViewParams(ARow: TcxCustomRow): TdxReportItemViewParams; virtual; + function GetCellValue(ARow: TcxCustomRow; AProperties: TcxCustomEditProperties; AnIndex, ARecordIndex: Integer): TcxEditValue; virtual; + function GetRowHeaderCellSides(ARow: TcxCustomRow; AnIndex: Integer): TdxCellSides; virtual; + function GetRowHeaderClass(ARow: TcxCustomRow): TdxReportCellImageClass; virtual; + function GetRowHeaderViewParams(ARow: TcxCustomRow; AnIndex: Integer): TdxReportItemViewParams; virtual; + function GetRowValueCellSides(ARow: TcxCustomRow; AnIndex, ARecordIndex: Integer): TdxCellSides; virtual; + function GetRowValueClass(ARow: TcxCustomRow; AnIndex, ARecordIndex: Integer): TdxReportCellDataClass; virtual; + function GetRowValueViewParams(ARow: TcxCustomRow; AnIndex, ARecordIndex: Integer): TdxReportItemViewParams; virtual; + { Value and Header Separators } + procedure DoInitializeRowHeaderSeparator(ARow: TcxCustomMultiEditorRow; AnItem: TdxReportCellString; AnIndex: Integer); virtual; + procedure DoInitializeRowValueSeparator(ARow: TcxCustomMultiEditorRow; AnItem: TdxReportCellString; AnIndex, ARecordIndex: Integer); virtual; + procedure DoReportLinkInitializeRowHeaderSeparator(ARow: TcxCustomMultiEditorRow; AnItem: TdxReportCellString; AnIndex: Integer); virtual; + procedure DoReportLinkInitializeRowValueSeparator(ARow: TcxCustomMultiEditorRow; AnItem: TdxReportCellString; AnIndex, ARecordIndex: Integer); virtual; + function GetRowHeaderSeparatorCellSides(ARow: TcxCustomMultiEditorRow): TdxCellSides; + function GetRowHeaderSeparatorClass(ARow: TcxCustomMultiEditorRow): TdxReportCellStringClass; virtual; + function GetRowHeaderSeparatorViewParams(ARow: TcxCustomMultiEditorRow; AnIndex: Integer): TdxReportItemViewParams; virtual; + function GetRowValueSeparatorCellSides(ARow: TcxCustomMultiEditorRow): TdxCellSides; + function GetRowValueSeparatorClass(ARow: TcxCustomMultiEditorRow): TdxReportCellStringClass; virtual; + function GetRowValueSeparatorViewParams(ARow: TcxCustomMultiEditorRow; AnIndex, ARecordIndex: Integer): TdxReportItemViewParams; virtual; + { Wrap Separators} + procedure DoInitializeWrapSeparatorItem(AnItem: TdxReportCellString; AWrapIndex: Integer); virtual; + procedure DoInitializeWrapSeparatorRow(ARow: TdxReportCell); virtual; + function GetWrapSeparatorClass: TdxReportCellStringClass; virtual; + + property AutoWidth: Boolean read GetAutoWidth; + property ExpandButtonColors[Row: TcxCustomRow]: TColor read GetExpandButtonColor; + property ExpandButtonSize: Integer read GetExpandButtonSize; + property GridLinesColor: TColor read GetGridLinesColor; + property HeaderMinWidth: Integer read GetHeaderMinWidth; + property HeaderWidth: Integer read GetHeaderWidth write FHeaderWidth; + property InterRecordsSpace: Integer read GetInterRecordsSpace write SetInterRecordsSpace; + property OptionsView: TcxVerticalGridReportLinkOptionsView read GetOptionsView; + property RecordCounts[Index: Integer]: Integer read GetRecordCount; + property RecordMinWidths[RecordIndex: Integer]: Integer read GetRecordMinWidth; + property RecordWidths[RecordIndex: Integer]: Integer read GetRecordWidth write SetRecordWidth; + property RowCount: Integer read GetRowCount; + property RowHeights[Row: TcxCustomRow]: Integer read GetRowHeight write SetRowHeight; + property Rows[Index: Integer]: TcxCustomRow read GetRow; + property ShowBorders: Boolean read GetShowBorders; + property ShowHeaders: Boolean read GetShowHeaders; + property ShowHorzGridLines: Boolean read GetShowHorzGridLines; + property ShowVertGridLines: Boolean read GetShowVertGridLines; + property TransparentColor: TColor read FTransparentColor write FTransparentColor default clWindow; + property ViewMaxWidth: Integer read GetViewMaxWidth; + property WrapCount: Integer read GetWrapCount; + property WrapSeparatorHeight: Integer read GetWrapSeparatorHeight; + end; + + { Options } + + TcxVerticalGridReportLinkOptionsExpanding = class(TdxCustomReportLinkOptionsExpanding) + private + FAutoExpandRows: Boolean; + function GetReportLink: TcxCustomVerticalGridReportLink; + procedure SetAutoExpandRows(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + property ReportLink: TcxCustomVerticalGridReportLink read GetReportLink; + published + property AutoExpandRows: Boolean read FAutoExpandRows write SetAutoExpandRows default False; + end; + + TcxVerticalGridReportLinkOptionsFormatting = class(TdxCustomReportLinkOptionsFormatting) + private + function GetReportLink: TcxCustomVerticalGridReportLink; + protected + function DesignerTabIndex: Integer; override; + public + property ReportLink: TcxCustomVerticalGridReportLink read GetReportLink; + end; + + TcxVerticalGridReportLinkOptionsPagination = class(TdxCustomReportLinkOptionsPagination) + private + FByRows: Boolean; + FByWrapping: Boolean; + FOneWrappingPerPage: Boolean; + function GetReportLink: TcxCustomVerticalGridReportLink; + procedure SetByRows(Value: Boolean); + procedure SetByWrapping(Value: Boolean); + procedure SetOneWrappingPerPage(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + property ReportLink: TcxCustomVerticalGridReportLink read GetReportLink; + published + property ByRows: Boolean read FByRows write SetByRows default True; + property ByWrapping: Boolean read FByWrapping write SetByWrapping default True; + property OneWrappingPerPage: Boolean read FOneWrappingPerPage write SetOneWrappingPerPage default False; + end; + + TcxVerticalGridReportLinkOptionsRefinements = class(TdxCustomReportLinkOptionsRefinements) + private + function GetReportLink: TcxCustomVerticalGridReportLink; + function GetSuppressBackgroundBitmaps: Boolean; + procedure SetSuppressBackgroundBitmaps(Value: Boolean); + protected + function DesignerTabIndex: Integer; override; + public + property ReportLink: TcxCustomVerticalGridReportLink read GetReportLink; + published + // for backward compatibility only -> now is moved to OptionsFormatting + property SuppressBackgroundBitmaps: Boolean read GetSuppressBackgroundBitmaps write SetSuppressBackgroundBitmaps stored False; + end; + + TcxVerticalGridReportLinkOptionsSize = class(TdxCustomReportLinkOptionsSize) + private + FBestFit: Boolean; + FKeepSameRecordWidths: Boolean; + FWrapRecords: Boolean; + FWrapSeparatorHeight: Integer; + function GetReportLink: TcxCustomVerticalGridReportLink; + procedure SetBestFit(Value: Boolean); + procedure SetKeepSameRecordWidths(Value: Boolean); + procedure SetWrapRecords(Value: Boolean); + procedure SetWrapSeparatorHeight(Value: Integer); + protected + function DesignerTabIndex: Integer; override; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + property ReportLink: TcxCustomVerticalGridReportLink read GetReportLink; + published + property AutoWidth; + property BestFit: Boolean read FBestFit write SetBestFit default False; + property KeepSameRecordWidths: Boolean read FKeepSameRecordWidths write SetKeepSameRecordWidths default True; + property WrapRecords: Boolean read FWrapRecords write SetWrapRecords default True; + property WrapSeparatorHeight: Integer read FWrapSeparatorHeight write SetWrapSeparatorHeight default 20; + end; + + TcxVerticalGridReportLinkPrintMode = (vpmLoadedRecords, vpmAllRecords); + + TcxVerticalGridReportLinkOptionsView = class(TdxCustomReportLinkOptionsView) + private + FBorders: Boolean; + FExpandButtons: Boolean; + FHeaders: Boolean; + FMode: TcxVerticalGridReportLinkPrintMode; + function GetReportLink: TcxCustomVerticalGridReportLink; + procedure SetBorders(Value: Boolean); + procedure SetExpandButtons(Value: Boolean); + procedure SetHeaders(Value: Boolean); + procedure SetMode(Value: TcxVerticalGridReportLinkPrintMode); + protected + function DesignerTabIndex: Integer; override; + function GetActualMode: TcxVerticalGridReportLinkPrintMode; virtual; + property Mode: TcxVerticalGridReportLinkPrintMode read FMode write SetMode default vpmLoadedRecords; + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + property ActualMode: TcxVerticalGridReportLinkPrintMode read GetActualMode; + property ReportLink: TcxCustomVerticalGridReportLink read GetReportLink; + published + property Borders: Boolean read FBorders write SetBorders default True; + property ExpandButtons: Boolean read FExpandButtons write SetExpandButtons default True; + property Headers: Boolean read FHeaders write SetHeaders default True; + end; + + { Styles } + + TcxVerticalGridReportLinkStylesClass = class of TcxVerticalGridReportLinkStyles; + + TcxVerticalGridReportLinkStyles = class(TdxCustomReportLinkStyles) + private + function GetReportLink: TcxCustomVerticalGridReportLink; + protected + function DesignerTabIndex: Integer; override; + + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + class function GetStyleCaption(AnIndex: Integer): string; override; + function GetStyleIndexByCaption(const Caption: string): Integer; override; + public + procedure Assign(Source: TPersistent); override; + + procedure GetCategoryParams(ARow: TcxCustomRow; out AParams: TcxViewParams); virtual; + procedure GetContentParams(ARow: TcxCustomRow; AnIndex, ARecordIndex: Integer; out AParams: TcxViewParams); virtual; + procedure GetHeaderParams(ARow: TcxCustomRow; out AParams: TcxViewParams); virtual; + procedure GetIndentParams(ARow: TcxCustomRow; out AParams: TcxViewParams); virtual; + + property ReportLink: TcxCustomVerticalGridReportLink read GetReportLink; + published + property Category: TcxStyle Index vspsVGridCategory read GetValue write SetValue; + property Content: TcxStyle Index vspsVGridContent read GetValue write SetValue; + property Header: TcxStyle Index vspsVGridHeader read GetValue write SetValue; + property StyleSheet; + end; + + TcxVerticalGridReportLinkStyleSheet = class(TdxCustomReportLinkStyleSheet) + private + function GetStylesValue: TcxVerticalGridReportLinkStyles; + procedure SetStylesValue(Value: TcxVerticalGridReportLinkStyles); + public + class function GetStylesClass: TcxCustomStylesClass; override; + published + property Styles: TcxVerticalGridReportLinkStyles read GetStylesValue write SetStylesValue; + end; + + { HostInfo } + + TcxVerticalGridHostInfo = class + private + FParent: TdxReportCell; + public + Origin: TPoint; + procedure Initialize(AParent: TdxReportCell); + property Parent: TdxReportCell read FParent; + end; + + { TcxCustomVerticalGridReportLink } + + { CustomDraw Events } + + TcxVerticalGridReportLinkCustomDrawRowHeaderCellEvent = procedure(Sender: TcxCustomVerticalGridReportLink; + ACanvas: TCanvas; ARow: TcxCustomRow; ACellIndex: Integer; + AnItem: TdxReportCellImage; var ADone: Boolean) of object; + + TcxVerticalGridReportLinkCustomDrawRowHeaderSeparatorCellEvent = procedure(Sender: TcxCustomVerticalGridReportLink; + ACanvas: TCanvas; ARow: TcxCustomRow; AnIndex: Integer; + AnItem: TdxReportCellString; var ADone: Boolean) of object; + + TcxVerticalGridReportLinkCustomDrawRowIndentCellEvent = procedure(Sender: TcxCustomVerticalGridReportLink; + ACanvas: TCanvas; ARow: TcxCustomRow; AnIndex: Integer; + AnItem: TdxReportCellExpandButton; var ADone: Boolean) of object; + + TcxVerticalGridReportLinkCustomDrawRowValueCellEvent = procedure(Sender: TcxCustomVerticalGridReportLink; + ACanvas: TCanvas; ARow: TcxCustomRow; ACellIndex, ARecordIndex: Integer; + AnItem: TAbstractdxReportCellData; var ADone: Boolean) of object; + + TcxVerticalGridReportLinkCustomDrawRowValueSeparatorCellEvent = procedure(Sender: TcxCustomVerticalGridReportLink; + ACanvas: TCanvas; ARow: TcxCustomRow; ACellIndex, ARecordIndex: Integer; + AnItem: TdxReportCellString; var ADone: Boolean) of object; + + { Initialiazation Events } + + TcxVerticalGridReportLinkInitializeRowHeaderCellEvent = procedure(Sender: TcxCustomVerticalGridReportLink; + ARow: TcxCustomRow; ACellIndex: Integer; AnItem: TdxReportCellImage) of object; + + TcxVerticalGridReportLinkInitializeRowHeaderSeparatorCellEvent = procedure(Sender: TcxCustomVerticalGridReportLink; + ARow: TcxCustomRow; AnIndex: Integer; AnItem: TdxReportCellString) of object; + + TcxVerticalGridReportLinkInitializeRowIndentCellEvent = procedure(Sender: TcxCustomVerticalGridReportLink; + ARow: TcxCustomRow; AnIndex: Integer; AnItem: TdxReportCellExpandButton) of object; + + TcxVerticalGridReportLinkInitializeRowValueCellEvent = procedure(Sender: TcxCustomVerticalGridReportLink; + ARow: TcxCustomRow; ACellIndex, ARecordIndex: Integer; + AnItem: TAbstractdxReportCellData) of object; + + TcxVerticalGridReportLinkInitializeRowValueSeparatorCellEvent = procedure(Sender: TcxCustomVerticalGridReportLink; + ARow: TcxCustomRow; ACellIndex, ARecordIndex: Integer; + AnItem: TdxReportCellString) of object; + + TcxCustomVerticalGridReportLink = class(TdxCustomcxControlReportLink) + private + FBuilder: TcxCustomVerticalGridReportLinkBuilder; + FCategoryFont: TFont; + FDelimitersHardVert: TList; + FHostInfo: TcxVerticalGridHostInfo; + FOnCustomDrawRowHeaderCell: TcxVerticalGridReportLinkCustomDrawRowHeaderCellEvent; + FOnCustomDrawRowHeaderSeparatorCell: TcxVerticalGridReportLinkCustomDrawRowHeaderSeparatorCellEvent; + FOnCustomDrawRowIndentCell: TcxVerticalGridReportLinkCustomDrawRowIndentCellEvent; + FOnCustomDrawRowValueCell: TcxVerticalGridReportLinkCustomDrawRowValueCellEvent; + FOnCustomDrawRowValueSeparatorCell: TcxVerticalGridReportLinkCustomDrawRowValueSeparatorCellEvent; + FOnInitializeRowHeaderCell: TcxVerticalGridReportLinkInitializeRowHeaderCellEvent; + FOnInitializeRowHeaderSeparatorCell: TcxVerticalGridReportLinkInitializeRowHeaderSeparatorCellEvent; + FOnInitializeRowIndentCell: TcxVerticalGridReportLinkInitializeRowIndentCellEvent; + FOnInitializeRowValueCell: TcxVerticalGridReportLinkInitializeRowValueCellEvent; + FOnInitializeRowValueSeparatorCell: TcxVerticalGridReportLinkInitializeRowValueSeparatorCellEvent; + function GetActiveStyles: TcxVerticalGridReportLinkStyles; + function GetDesignWindow: TcxfmVerticalGridReportLinkDesignWindow; + function GetOptionsExpanding: TcxVerticalGridReportLinkOptionsExpanding; + function GetOptionsFormatting: TcxVerticalGridReportLinkOptionsFormatting; + function GetOptionsPagination: TcxVerticalGridReportLinkOptionsPagination; + function GetOptionsRefinements: TcxVerticalGridReportLinkOptionsRefinements; + function GetOptionsSize: TcxVerticalGridReportLinkOptionsSize; + function GetOptionsView: TcxVerticalGridReportLinkOptionsView; + function GetStyles: TcxVerticalGridReportLinkStyles; + function GetVerticalGrid: TcxCustomVerticalGrid; + procedure SetCategoryFont(Value: TFont); + procedure SetOnCustomDrawRowHeaderCell(Value: TcxVerticalGridReportLinkCustomDrawRowHeaderCellEvent); + procedure SetOnCustomDrawRowHeaderSeparatorCell(Value: TcxVerticalGridReportLinkCustomDrawRowHeaderSeparatorCellEvent); + procedure SetOnCustomDrawRowIndentCell(Value: TcxVerticalGridReportLinkCustomDrawRowIndentCellEvent); + procedure SetOnCustomDrawRowValueCell(Value: TcxVerticalGridReportLinkCustomDrawRowValueCellEvent); + procedure SetOnCustomDrawRowValueSeparatorCell(Value: TcxVerticalGridReportLinkCustomDrawRowValueSeparatorCellEvent); + procedure SetOptionsExpanding(Value: TcxVerticalGridReportLinkOptionsExpanding); + procedure SetOptionsFormatting(Value: TcxVerticalGridReportLinkOptionsFormatting); + procedure SetOptionsPagination(Value: TcxVerticalGridReportLinkOptionsPagination); + procedure SetOptionsRefinements(Value: TcxVerticalGridReportLinkOptionsRefinements); + procedure SetOptionsSize(Value: TcxVerticalGridReportLinkOptionsSize); + procedure SetOptionsView(Value: TcxVerticalGridReportLinkOptionsView); + procedure SetStyles(Value: TcxVerticalGridReportLinkStyles); + protected + procedure ConstructReport(AReportCells: TdxReportCells); override; + procedure ConvertCoords; override; + procedure CustomDraw(AItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); override; + procedure FontChanged(Sender: TObject); override; + function GetBreakPagesByHardDelimiters: Boolean; override; + procedure GetImageLists(AProc: TdxPSGetImageListProc); override; + function GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; override; + function GetUseHardVertDelimiters: Boolean; override; + procedure InternalRestoreFromOriginal; override; + function IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; override; + procedure MakeHardDelimiters(AReportCells: TdxReportCells; AVertDelimiters: TList); override; + + procedure DoCustomDrawRowHeaderCell(ACanvas: TCanvas; ARow: TcxCustomRow; + AnIndex: Integer; AnItem: TdxReportCellImage; var ADone: Boolean); dynamic; + procedure DoCustomDrawRowHeaderSeparatorCell(ACanvas: TCanvas; ARow: TcxCustomRow; + AnIndex: Integer; AnItem: TdxReportCellString; var ADone: Boolean); dynamic; + procedure DoCustomDrawRowIndentCell(ACanvas: TCanvas; ARow: TcxCustomRow; + AnIndex: Integer; AnItem: TdxReportCellExpandButton; var ADone: Boolean); dynamic; + procedure DoCustomDrawRowValueCell(ACanvas: TCanvas; ARow: TcxCustomRow; + ACellIndex, ARecordIndex: Integer; AnItem: TAbstractdxReportCellData; var ADone: Boolean); dynamic; + procedure DoCustomDrawRowValueSeparatorCell(ACanvas: TCanvas; ARow: TcxCustomRow; + ACellIndex, ARecordIndex: Integer; AnItem: TdxReportCellString; var ADone: Boolean); dynamic; + procedure DoInitializeRowHeaderCell(ARow: TcxCustomRow; ACellIndex: Integer; + AnItem: TdxReportCellImage); dynamic; + procedure DoInitializeRowHeaderSeparatorCell(ARow: TcxCustomRow; AnIndex: Integer; + AnItem: TdxReportCellString); dynamic; + procedure DoInitializeRowIndentCell(ARow: TcxCustomRow; AnIndex: Integer; + AnItem: TdxReportCellExpandButton); dynamic; + procedure DoInitializeRowValueCell(ARow: TcxCustomRow; ACellIndex, ARecordIndex: Integer; + AnItem: TAbstractdxReportCellData); dynamic; + procedure DoInitializeRowValueSeparatorCell(ARow: TcxCustomRow; + ACellIndex, ARecordIndex: Integer; AnItem: TdxReportCellString); dynamic; + + function GetOptionsExpandingClass: TdxCustomReportLinkOptionsExpandingClass; override; + function GetOptionsFormattingClass: TdxCustomReportLinkOptionsFormattingClass; override; + function GetOptionsPaginationClass: TdxCustomReportLinkOptionsPaginationClass; override; + function GetOptionsRefinementsClass: TdxCustomReportLinkOptionsRefinementsClass; override; + function GetOptionsSizeClass: TdxCustomReportLinkOptionsSizeClass; override; + function GetOptionsViewClass: TdxCustomReportLinkOptionsViewClass; override; + + function GetAreNativeStylesAvailable: Boolean; override; + function GetStylesClass: TdxCustomReportLinkStylesClass; override; + function GetStyleSheetClass: TdxCustomReportLinkStyleSheetClass; override; + function GetStyleSheetPrototype: TdxCustomReportLinkStyleSheet; override; + procedure PrepareConstruct; override; + procedure UnprepareConstruct; override; + + procedure AddVerticalHardDelimiter(ADelimiter: TdxReportCell); overload; + procedure AddVerticalHardDelimiter(ADelimiter: Integer); overload; + + // Builder + function CreateBuilder: TcxCustomVerticalGridReportLinkBuilder; virtual; + class function GetBuilderClass: TcxCustomVerticalGridReportLinkBuilderClass; virtual; + + // CustomDraw + procedure ExtractCustomDrawCodeDataValues(ACode: Integer; + var AnAttribute: TcxVerticalGridAttributeID; var ACellIndex, ARecordIndex: Integer); + function GetItemCustomDrawInfo(AnItem: TdxReportVisualItem; + out ADrawInfo: TcxVerticalGridCellCustomDrawInfo): TcxVerticalGridAttributeID; virtual; + function IsCustomDrawn(AnAttributeID: TcxVerticalGridAttributeID): Boolean; virtual; + function MakeCustomDrawCodeData(AnAttribute: TcxVerticalGridAttributeID; + ACellIndex, ARecordIndex: Integer): Integer; + + // DesignWindow + procedure InitializePrintModeControl(AControl: TComboBox); virtual; + procedure UpdateStatePrintModeControl(AControl: TComboBox); virtual; + + property ActiveStyles: TcxVerticalGridReportLinkStyles read GetActiveStyles; + property Builder: TcxCustomVerticalGridReportLinkBuilder read FBuilder; + property CategoryFont: TFont read FCategoryFont write SetCategoryFont; + property DelimitersHardVert: TList read FDelimitersHardVert; + property HostInfo: TcxVerticalGridHostInfo read FHostInfo; + property VerticalGrid: TcxCustomVerticalGrid read GetVerticalGrid; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property DesignWindow: TcxfmVerticalGridReportLinkDesignWindow read GetDesignWindow; + published + property Color; + property Font; + property OptionsExpanding: TcxVerticalGridReportLinkOptionsExpanding read GetOptionsExpanding write SetOptionsExpanding; + property OptionsFormatting: TcxVerticalGridReportLinkOptionsFormatting read GetOptionsFormatting write SetOptionsFormatting; + property OptionsPagination: TcxVerticalGridReportLinkOptionsPagination read GetOptionsPagination write SetOptionsPagination; + property OptionsRefinements: TcxVerticalGridReportLinkOptionsRefinements read GetOptionsRefinements write SetOptionsRefinements; + property OptionsSize: TcxVerticalGridReportLinkOptionsSize read GetOptionsSize write SetOptionsSize; + property OptionsView: TcxVerticalGridReportLinkOptionsView read GetOptionsView write SetOptionsView; + property ScaleFonts; + property StyleRepository; + property Styles: TcxVerticalGridReportLinkStyles read GetStyles write SetStyles; + property SupportedCustomDraw; + + property OnCustomDrawRowHeaderCell: TcxVerticalGridReportLinkCustomDrawRowHeaderCellEvent + read FOnCustomDrawRowHeaderCell write SetOnCustomDrawRowHeaderCell; + property OnCustomDrawRowHeaderSeparatorCell: TcxVerticalGridReportLinkCustomDrawRowHeaderSeparatorCellEvent + read FOnCustomDrawRowHeaderSeparatorCell write SetOnCustomDrawRowHeaderSeparatorCell; + property OnCustomDrawRowIndentCell: TcxVerticalGridReportLinkCustomDrawRowIndentCellEvent + read FOnCustomDrawRowIndentCell write SetOnCustomDrawRowIndentCell; + property OnCustomDrawRowValueCell: TcxVerticalGridReportLinkCustomDrawRowValueCellEvent + read FOnCustomDrawRowValueCell write SetOnCustomDrawRowValueCell; + property OnCustomDrawRowValueSeparatorCell: TcxVerticalGridReportLinkCustomDrawRowValueSeparatorCellEvent + read FOnCustomDrawRowValueSeparatorCell write SetOnCustomDrawRowValueSeparatorCell; + property OnInitializeRowHeaderCell: TcxVerticalGridReportLinkInitializeRowHeaderCellEvent + read FOnInitializeRowHeaderCell write FOnInitializeRowHeaderCell; + property OnInitializeRowHeaderSeparatorCell: TcxVerticalGridReportLinkInitializeRowHeaderSeparatorCellEvent + read FOnInitializeRowHeaderSeparatorCell write FOnInitializeRowHeaderSeparatorCell; + property OnInitializeRowIndentCell: TcxVerticalGridReportLinkInitializeRowIndentCellEvent + read FOnInitializeRowIndentCell write FOnInitializeRowIndentCell; + property OnInitializeRowValueCell: TcxVerticalGridReportLinkInitializeRowValueCellEvent + read FOnInitializeRowValueCell write FOnInitializeRowValueCell; + property OnInitializeRowValueSeparatorCell: TcxVerticalGridReportLinkInitializeRowValueSeparatorCellEvent + read FOnInitializeRowValueSeparatorCell write FOnInitializeRowValueSeparatorCell; + end; + + TcxUnboundVerticalGridReportLinkBuilder = class(TcxCustomVerticalGridReportLinkBuilder) + public + class function AdapterClass: TcxCustomVerticalGridAdapterClass; override; + end; + + TcxUnboundVerticalGridAdapter = class(TcxCustomVerticalGridAdapter) + private + function GetVerticalGrid: TcxUnboundVerticalGrid; + protected + function GetLayoutStyle: TcxvgLayoutStyle; override; + property VerticalGrid: TcxUnboundVerticalGrid read GetVerticalGrid; + end; + + TcxUnboundVerticalGridReportLink = class(TcxCustomVerticalGridReportLink) + protected + class function GetBuilderClass: TcxCustomVerticalGridReportLinkBuilderClass; override; + end; + + TcxVerticalGridReportLink = class(TcxUnboundVerticalGridReportLink) + private + function GetVerticalGrid: TcxVerticalGrid; + public + property VerticalGrid: TcxVerticalGrid read GetVerticalGrid; + end; + + { RTTI Inspector } + + TcxRTTIInspectorReportLink = class(TcxUnboundVerticalGridReportLink) + private + function GetRTTIInspector: TcxRTTIInspector; + public + property RTTIInspector: TcxRTTIInspector read GetRTTIInspector; + end; + + { VirtualVerticalGrid } + + TcxVirtualVerticalGridReportLinkBuilder = class(TcxCustomVerticalGridReportLinkBuilder) + public + class function AdapterClass: TcxCustomVerticalGridAdapterClass; override; + class function FormatterClass: TcxCustomVerticalGridReportLinkFormatterClass; override; + end; + + TcxVirtualVerticalGridAdapter = class(TcxCustomVerticalGridAdapter) + private + function GetOptionsView: TcxvgMultiRecordsOptionsView; + function GetVerticalGrid: TcxVirtualVerticalGrid; + protected + function GetInterRecordsSpace: Integer; override; + function GetLayoutStyle: TcxvgLayoutStyle; override; + public + property OptionsView: TcxvgMultiRecordsOptionsView read GetOptionsView; + property VerticalGrid: TcxVirtualVerticalGrid read GetVerticalGrid; + end; + + TcxVirtualVerticalGridReportLinkFormatter = class(TcxCustomVerticalGridReportLinkFormatter) + protected + function GetFirstInternalRecordIndex: Integer; override; + function GetInternalRecordCount: Integer; override; + end; + + TcxVirtualVerticalGridReportLink = class; + + TcxVirtualVerticalGridReportLinkOptionsView = class(TcxVerticalGridReportLinkOptionsView) + private + function GetReportLink: TcxVirtualVerticalGridReportLink; + protected + function GetActualMode: TcxVerticalGridReportLinkPrintMode; override; + public + property ReportLink: TcxVirtualVerticalGridReportLink read GetReportLink; + published + property Mode; + end; + + TcxVirtualVerticalGridReportLink = class(TcxCustomVerticalGridReportLink) + private + function GetOptionsView: TcxVirtualVerticalGridReportLinkOptionsView; + function GetVirtualVerticalGrid: TcxVirtualVerticalGrid; + procedure SetOptionsView(Value: TcxVirtualVerticalGridReportLinkOptionsView); + protected + procedure InternalRestoreFromOriginal; override; + + class function GetBuilderClass: TcxCustomVerticalGridReportLinkBuilderClass; override; + function GetOptionsViewClass: TdxCustomReportLinkOptionsViewClass; override; + + procedure InitializePrintModeControl(AControl: TComboBox); override; + procedure UpdateStatePrintModeControl(AControl: TComboBox); override; + public + property VirtualVerticalGrid: TcxVirtualVerticalGrid read GetVirtualVerticalGrid; + published + property OptionsView: TcxVirtualVerticalGridReportLinkOptionsView read GetOptionsView write SetOptionsView; + end; + + { DBVericalGrid } + + TcxDBVerticalGridReportLinkBuilder = class(TcxVirtualVerticalGridReportLinkBuilder) + public + class function FormatterClass: TcxCustomVerticalGridReportLinkFormatterClass; override; + end; + + TcxDBVerticalGridReportLinkFormatter = class(TcxVirtualVerticalGridReportLinkFormatter) + private + function GetDataController: TcxDBVerticalGridDataController; + protected + function GetAreRecordsNeededLoading: Boolean; override; + function GetAreRecordsNeededUnloading: Boolean; override; + procedure LoadRecords; override; + procedure UnloadRecords; override; + public + property DataController: TcxDBVerticalGridDataController read GetDataController; + end; + + TcxDBVerticalGridReportLink = class(TcxVirtualVerticalGridReportLink) + private + function GetDBVerticalGrid: TcxDBVerticalGrid; + protected + class function GetBuilderClass: TcxCustomVerticalGridReportLinkBuilderClass; override; + public + property DBVerticalGrid: TcxDBVerticalGrid read GetDBVerticalGrid; + end; + + TcxfmVerticalGridReportLinkDesignWindow = class(TdxfmCustomcxControlReportLinkDesignWindow) + PageControl1: TPageControl; + tshView: TTabSheet; + lblShow: TLabel; + imgShow: TImage; + bvlShow: TBevel; + chbxShowHeaders: TCheckBox; + chbxShowExpandButtons: TCheckBox; + chbxShowBorders: TCheckBox; + tshBehaviors: TTabSheet; + lblExpanding: TLabel; + imgExpanding: TImage; + bvlExpanding: TBevel; + lblSize: TLabel; + bvlSize: TBevel; + imgGridSize: TImage; + chbxExpandRows: TCheckBox; + chbxAutoWidth: TCheckBox; + tshFormatting: TTabSheet; + lblLookAndFeel: TLabel; + bvlLookAndFeel: TBevel; + imgLookAndFeel: TImage; + imgRefinements: TImage; + lblRefinements: TLabel; + bvlRefinements: TBevel; + cbxLookAndFeel: TComboBox; + chbxFlatCheckMarks: TCheckBox; + chbxDisplayGraphicsAsText: TCheckBox; + chbxTransparentGraphics: TCheckBox; + chbxSuppressBackgroundBitmaps: TCheckBox; + tshStyles: TTabSheet; + bvlStyles: TBevel; + bvlStyleSheets: TBevel; + lblStyleSheets: TLabel; + bvlStylesHost: TBevel; + btnStyleColor: TButton; + btnStyleFont: TButton; + btnStyleBackgroundBitmap: TButton; + chbxUseNativeStyles: TCheckBox; + cbxStyleSheets: TComboBox; + btnStyleSheetNew: TButton; + btnStyleSheetCopy: TButton; + btnStyleSheetDelete: TButton; + btnStylesSaveAs: TButton; + btnStyleSheetRename: TButton; + btnStyleBackgroundBitmapClear: TButton; + btnStyleRestoreDefaults: TButton; + cxStyleRepository1: TcxStyleRepository; + styleCategory: TcxStyle; + pmStyles: TPopupMenu; + miStyleFont: TMenuItem; + miStyleColor: TMenuItem; + miLine3: TMenuItem; + miStyleBackgroundBitmap: TMenuItem; + miStyleBackgroundBitmapClear: TMenuItem; + milLine: TMenuItem; + miStylesSelectAll: TMenuItem; + miLine2: TMenuItem; + miStyleRestoreDefaults: TMenuItem; + miLine4: TMenuItem; + miStylesSaveAs: TMenuItem; + ilStylesPopup: TImageList; + pnlPreview: TPanel; + chbxBestFit: TCheckBox; + PreviewVGrid: TcxVerticalGrid; + chbxWrapRecords: TCheckBox; + chbxKeepSameRecordWidths: TCheckBox; + lblPagination: TLabel; + bvlPagination: TBevel; + chbxPaginateByRows: TCheckBox; + chbxPaginateByWrapping: TCheckBox; + chbxOneWrappingPerPage: TCheckBox; + imgPagination: TImage; + rowLuxurySedan: TcxCategoryRow; + rowManufacturer: TcxEditorRow; + rowModel: TcxEditorRow; + rowPicture: TcxEditorRow; + rowEngine: TcxEditorRow; + rowTransmission: TcxEditorRow; + rowTires: TcxEditorRow; + styleHeader: TcxStyle; + styleContent: TcxStyle; + lblPreviewWindow: TStaticText; + bvlMultipleRecords: TBevel; + cbxPrintMode: TComboBox; + lblPrintMode: TLabel; + Label1: TLabel; + lblUseNativeStyles: TLabel; + procedure LookAndFeelChange(Sender: TObject); + procedure OptionsExpandingClick(Sender: TObject); + procedure OptionsFormattingClick(Sender: TObject); + procedure OptionsPaginationClick(Sender: TObject); + procedure OptionsRefinementsClick(Sender: TObject); + procedure OptionsSizeClick(Sender: TObject); + procedure OptionsViewClick(Sender: TObject); + procedure pmStylesPopup(Sender: TObject); + procedure StyleColorClick(Sender: TObject); + procedure StyleFontClick(Sender: TObject); + procedure StyleBackgroundBitmapClick(Sender: TObject); + procedure cbxStyleSheetsClick(Sender: TObject); + procedure btnStyleSheetNewClick(Sender: TObject); + procedure btnStyleSheetCopyClick(Sender: TObject); + procedure btnStyleSheetDeleteClick(Sender: TObject); + procedure btnStyleSheetRenameClick(Sender: TObject); + procedure StylesSaveAsClick(Sender: TObject); + procedure cbxStyleSheetsKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure lbxStylesClick(Sender: TObject); + procedure StyleBackgroundBitmapClearClick(Sender: TObject); + procedure StyleRestoreDefaultsClick(Sender: TObject); + procedure miStylesSelectAllClick(Sender: TObject); + procedure PreviewVGridDrawValue(Sender: TObject; ACanvas: TcxCanvas; + APainter: TcxvgPainter; AValueInfo: TcxRowValueInfo; + var Done: Boolean); + procedure PageControl1Change(Sender: TObject); + procedure cbxPrintModeChange(Sender: TObject); + procedure cbxStyleSheetsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure lblUseNativeStylesClick(Sender: TObject); + private + lbxStyles: TdxStylesListBox; + + function GetActiveStyle: TcxStyle; + function GetComponent: TcxCustomVerticalGrid; + function GetHasSelectedStyles: Boolean; + function GetHasSelectedStylesWithAssignedBitmap: Boolean; + function GetReportLink: TcxCustomVerticalGridReportLink; + + function CanSelectAllStyles: Boolean; + procedure CreateControls; + procedure CustomDrawTextRect(ACanvas: TcxCanvas; AViewInfo: TcxRowValueInfo; const AText: string); + procedure InitializePreviewVerticalGridStyles; + procedure LoadDataIntoPreviewVerticalGrid; + procedure RecreateStylesListBox; + procedure RestoreSelectedStyles(AList: TList); + procedure SaveSelectedStyles(AList: TList); + procedure SetActivePage; + procedure UpdatePreviewVerticalGridStyles(const ACaption: string; AStyle: TcxStyle); + + procedure SetOptionsExpandingByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsFormattingByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsPaginationByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsRefinementsByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsSizeByIndex(Index: Integer; Value: Boolean); + procedure SetOptionsViewByIndex(Index: Integer; Value: Boolean); + protected + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + procedure LoadStrings; override; + procedure UpdateControlsState; override; + procedure UpdatePreview; override; + + function GetDesignerTabIndex: Integer; override; + procedure SetDesignerTabIndex(Value: Integer); override; + + procedure DoActiveStyleSheetChanged; override; + procedure DoFormActivated(AnActive: Boolean); override; + procedure DoRefreshStylesList; override; + procedure DoStyleChanged(const ACaption: string; AStyle: TcxStyle); override; + procedure DoStylesChanged(AStrings: TStrings; ARecreate: Boolean); override; + + procedure GetSelectedStyleNames(AStrings: TStrings); override; + procedure GetStyleSheetNames(out AStrings: TStrings); override; + procedure GetStyleNames(out AStrings: TStrings); override; + + property ActiveStyle: TcxStyle read GetActiveStyle; + property Component: TcxCustomVerticalGrid read GetComponent; + property HasSelectedStyles: Boolean read GetHasSelectedStyles; + property HasSelectedStylesWithAssignedBitmap: Boolean read GetHasSelectedStylesWithAssignedBitmap; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property ReportLink: TcxCustomVerticalGridReportLink read GetReportLink; + end; + +function PreviewImage: TPicture; +function PreviewImageAsString: string; + +implementation + +{$R *.dfm} + +{ 652 x 432 - DesignWindow } +{.3 - chbxTransparentRichEdits} + +uses + {$IFDEF DELPHI6} + Variants, + {$ENDIF} + Math, Forms, Registry, cxLookAndFeelPainters, cxDataUtils, cxDataStorage, + dxPSRes, dxPSImgs, dxPSUtl, dxBkgnd, dxPSPopupMan; + +const + DefaultExpandButtonSize = 11; + DefaultIndentWidth = 20; + DefaultRowMinHeight = 20; + ExpandButtonInteriorColor: TColor = clWindow; + + // ------------------------------------------------------------------ // + // Cell.Data = 0000.0000.0000.0000.0000.0000.0000.0000 = DWORD, 32b // + // | | | | // + // | | | | // + // |ID,4| Index,8b| RecordIndex,20b | // + // ------------------------------------------------------------------ // + // ^ ^ ^ + // | | | + // | | ---- + // | ---------------- | + // --------------------- | | + // | | | + // | | | + CodeAttributeMask = $0000000F; // -- | | + CodeAttributeOffset = $0000001C; // | | + CodeIndexMask = $000000FF; //------ | + CodeIndexOffset = $00000014; // | + CodeRecordIndexMask = $000FFFFF; //--------- + CodeRecordIndexOffset = $00000000; + +var + FBMW760Li: TPicture; + FDefaultdxPScxVerticalGridLinkStyleSheet: TcxVerticalGridReportLinkStyleSheet; + +type + TcxVerticalGridRowHelperFactory = class(TdxCustomClassMaps) + private + function GetHelperClass(Row: TcxCustomRow): TcxVerticalGridCustomRowHelperClass; + public + class function Instance: TcxVerticalGridRowHelperFactory; reintroduce; overload; + property HelperClasses[Row: TcxCustomRow]: TcxVerticalGridCustomRowHelperClass read GetHelperClass; default; + end; + + + TcxCustomMultiEditorRowAccess = class(TcxCustomMultiEditorRow); + TcxCustomRowAccess = class(TcxCustomRow); + TcxCustomVerticalGridAccess = class(TcxCustomVerticalGrid); + TcxUnboundVerticalGridAccess = class(TcxUnboundVerticalGrid); + +{ Helpers } + +{ CustomMultiEditorRow Helpers } + +function CustomMultiEditorRow_GetProperties(AInstance: TcxCustomMultiEditorRow): TcxMultiEditorRowProperties; +begin + Result := TcxCustomMultiEditorRowAccess(AInstance).Properties; +end; + +{ CustomRow Helpers } + +function CustomRow_GetProperties(AInstance: TcxCustomRow): TcxCustomRowProperties; +begin + Result := TcxCustomRowAccess(AInstance).FProperties; +end; + +function CustomRow_IsHeightAssigned(AInstance: TcxCustomRow): Boolean; +begin + Result := TcxCustomRowAccess(AInstance).IsHeightAssigned; +end; + +{ CustomVerticalGrid Helpers } + +function CustomVerticalGrid_GetCategoryFont(AInstance: TcxCustomVerticalGrid): TFont; +begin + Result := TcxCustomVerticalGridAccess(AInstance).CategoryFont; +end; + +function CustomVerticalGrid_GetDataController(AInstance: TcxCustomVerticalGrid): TcxCustomDataController; +begin + Result := TcxCustomVerticalGridAccess(AInstance).DataController; +end; + +function CustomVerticalGrid_GetRecordCount(AInstance: TcxCustomVerticalGrid): Integer; +begin + Result := TcxCustomVerticalGridAccess(AInstance).RecordCount; +end; + +{ UnboundVerticalGrid Helpers } + +function UnboundVerticalGrid_GetLayoutStyle(AInstance: TcxUnboundVerticalGrid): TcxvgUnboundLayoutStyle; +begin + Result := TcxUnboundVerticalGridAccess(AInstance).LayoutStyle; +end; + +{ Utilities } + +function PreviewImage: TPicture; +begin + if FBMW760Li = nil then + begin + FBMW760Li := TPicture.Create; + Bitmap_LoadFromResourceName(FBMW760Li.Bitmap, IDB_DXPSCARBMW760LI); + end; + Result := FBMW760Li; +end; + +function PreviewImageAsString: string; +begin + cxImage.SavePicture(PreviewImage, Result); +end; + +function DefaultdxPScxVerticalGridLinkStyleSheet: TcxVerticalGridReportLinkStyleSheet; + + function CreateStyle(AColor: TColor; AFontColor: TColor): TcxStyle; + begin + Result := TcxStyle.Create(DefaultdxPScxVerticalGridLinkStyleSheet); + with Result do + begin + Color := AColor; + Font.Name := dxPSCore.dxPSDefaultFontName; + Font.Color := AFontColor; + end; + end; + +begin + if FDefaultdxPScxVerticalGridLinkStyleSheet = nil then + begin + FDefaultdxPScxVerticalGridLinkStyleSheet := TcxVerticalGridReportLinkStyleSheet.Create(nil); + with FDefaultdxPScxVerticalGridLinkStyleSheet.Styles as TcxVerticalGridReportLinkStyles do + begin + Category := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + Content := CreateStyle(dxPSCore.dxDefaultContentColor, dxPSCore.dxPSDefaultFontColor); + Header := CreateStyle(dxPSCore.dxDefaultFixedColor, dxPSCore.dxPSDefaultFontColor); + end; + end; + Result := FDefaultdxPScxVerticalGridLinkStyleSheet; +end; + +{ PlaceList Helpers } + +procedure ClearPlaceList(AList: TList); +var + I: Integer; +begin + for I := 0 to AList.Count - 1 do + TObject(AList[I]).Free; + AList.Clear; +end; + +function CreatePlaceList(ACount: Integer): TList; +var + I: Integer; +begin + Result := TList.Create; + Result.Capacity := ACount; + for I := 0 to ACount - 1 do + Result.Add(TcxVerticalGridRowElementPlace.Create); +end; + +{ TcxVerticalGridRowHelperFactory } + +function dxVerticalGridRowHelperFactory: TcxVerticalGridRowHelperFactory; +begin + Result := TcxVerticalGridRowHelperFactory.Instance; +end; + +class function TcxVerticalGridRowHelperFactory.Instance: TcxVerticalGridRowHelperFactory; +begin + Result := inherited Instance as TcxVerticalGridRowHelperFactory; +end; + +function TcxVerticalGridRowHelperFactory.GetHelperClass(Row: TcxCustomRow): TcxVerticalGridCustomRowHelperClass; +begin + Result := TcxVerticalGridCustomRowHelperClass(PairClasses[Row.ClassType]); +end; + +{ CLR Accessors } + + +{ TcxVerticalGridRowElementPlace } + +procedure TcxVerticalGridRowElementPlace.Clear; +begin + Offset := 0; + Width := 0; +end; + +{ TcxVerticalGridCustomRowPlace } + +constructor TcxVerticalGridCustomRowPlace.Create(AFormatter: TcxCustomVerticalGridReportLinkFormatter; + ARow: TcxCustomRow; AWrapIndex: Integer); +begin + inherited Create; + FFormatter := AFormatter; + FRow := ARow; + FWrapIndex := AWrapIndex; +end; + +procedure TcxVerticalGridCustomRowPlace.AddDelimiters(AReportLink: TcxCustomVerticalGridReportLink); +begin +end; + +procedure TcxVerticalGridCustomRowPlace.Calculate; +begin +end; + +function TcxVerticalGridCustomRowPlace.CalculatedHeaderWidth: Integer; +begin + Result := CalculatedMinWidth; +end; + +function TcxVerticalGridCustomRowPlace.CalculatedMinHeight: Integer; +begin + Result := Formatter.GetImageHeight(Row, 0); + if Result = 0 then + Result := DefaultRowMinHeight; +end; + +function TcxVerticalGridCustomRowPlace.CalculatedMinWidth: Integer; +begin + Result := IndentArea; +end; + +function TcxVerticalGridCustomRowPlace.CalculatedRecordWidth(ARecordIndex: Integer): Integer; +begin + Result := 0; +end; + +function TcxVerticalGridCustomRowPlace.CalculatedTextPatternHeight(AFont: HFONT): Integer; +var + Size: TSize; +begin + SelectObject(DC, AFont); + GetTextExtentPoint(DC, 'Wg', 2, Size); + Result := 2 + Size.cy + 2; +end; + +function TcxVerticalGridCustomRowPlace.CalculatedTextWidth(const AText: string; + AFont: HFONT): Integer; +var + Size: TSize; +begin + SelectObject(DC, AFont); + GetTextExtentPoint(DC, PChar(AText), Length(AText), Size); + Result := 3 + Size.cx + 3; +end; + +procedure TcxVerticalGridCustomRowPlace.Clear; +begin +end; + +function TcxVerticalGridCustomRowPlace.GetHeaderAvailableWidth: Integer; +begin + Result := Formatter.HeaderAvailableWidths[Row]; +end; + +function TcxVerticalGridCustomRowPlace.GetValueAvailableWidth(RecordIndex: Integer): Integer; +begin + Result := Formatter.RecordWidths[RecordIndex]; +end; + +function TcxVerticalGridCustomRowPlace.Row: TcxCustomRow; +begin + Result := FRow; +end; + +function TcxVerticalGridCustomRowPlace.RowHelper: TcxVerticalGridCustomRowHelper; +begin + Result := Formatter.RowHelpers[Row]; +end; + +function TcxVerticalGridCustomRowPlace.GetDC: HDC; +begin + Result := Formatter.DC; +end; + +function TcxVerticalGridCustomRowPlace.GetHasHeader: Boolean; +begin + Result := Formatter.ShowHeaders; +end; + +function TcxVerticalGridCustomRowPlace.GetIndentArea: Integer; +begin + Result := Formatter.IndentAreas[Row]; +end; + +function TcxVerticalGridCustomRowPlace.GetInterRecordsSpace: Integer; +begin + Result := Formatter.InterRecordsSpace; +end; + +function TcxVerticalGridCustomRowPlace.GetItemCount: Integer; +begin + Result := RowHelper.ItemCount; +end; + +function TcxVerticalGridCustomRowPlace.GetRecordCount: Integer; +begin + Result := Formatter.RecordCounts[WrapIndex]; +end; + +function TcxVerticalGridCustomRowPlace.GetRecordWidth(RecordIndex: Integer): Integer; +begin + Result := Formatter.RecordWidths[RecordIndex]; +end; + +function TcxVerticalGridCustomRowPlace.GetStartRecordIndex: Integer; +begin + Result := Formatter.WrappedRecordStartIndexes[WrapIndex]; +end; + +function TcxVerticalGridCustomRowPlace.GetStopRecordIndex: Integer; +begin + Result := Formatter.WrappedRecordStopIndexes[WrapIndex]; +end; + +{ TcxVerticalGridCategoryRowPlace } + +constructor TcxVerticalGridCategoryRowPlace.Create(AFormatter: TcxCustomVerticalGridReportLinkFormatter; + ARow: TcxCustomRow; AWrapIndex: Integer); +begin + inherited; + FPlace := TcxVerticalGridRowElementPlace.Create; +end; + +destructor TcxVerticalGridCategoryRowPlace.Destroy; +begin + FreeAndNil(FPlace); + inherited; +end; + +procedure TcxVerticalGridCategoryRowPlace.Calculate; +begin + inherited; + FPlace.Offset := IndentArea; + FPlace.Width := Formatter.ViewWidths[WrapIndex] - IndentArea; +end; + +function TcxVerticalGridCategoryRowPlace.CalculatedHeaderWidth: Integer; +begin + Result := IndentArea; +end; + +function TcxVerticalGridCategoryRowPlace.CalculatedMinHeight: Integer; +var + F: HFONT; + V: Integer; +begin + Result := inherited CalculatedMinHeight; + F := Windows.GetCurrentObject(DC, OBJ_FONT); + V := CalculatedTextPatternHeight(Font.Handle); + Windows.SelectObject(DC, F); + if Result < V then + Result := V; +end; + +function TcxVerticalGridCategoryRowPlace.CalculatedMinWidth: Integer; +var + F: HFONT; +begin + Result := inherited CalculatedMinWidth; + + F := Windows.GetCurrentObject(DC, OBJ_FONT); + Inc(Result, CalculatedTextWidth(Caption, Font.Handle)); + Windows.SelectObject(DC, F); + + Inc(Result, Formatter.GetImageWidth(Row, 0)); +end; + +function TcxVerticalGridCategoryRowPlace.Row: TcxCategoryRow; +begin + Result := inherited Row as TcxCategoryRow; +end; + +function TcxVerticalGridCategoryRowPlace.RowHelper: TcxVerticalGridCategoryRowHelper; +begin + Result := inherited RowHelper as TcxVerticalGridCategoryRowHelper; +end; + +function TcxVerticalGridCategoryRowPlace.GetCaption: string; +begin + Result := RowHelper.Caption; +end; + +function TcxVerticalGridCategoryRowPlace.GetFont: TFont; +begin + Result := Formatter.GetCategoryRowFont(Row); +end; + +function TcxVerticalGridCategoryRowPlace.GetOffset: Integer; +begin + Result := FPlace.Offset; +end; + +function TcxVerticalGridCategoryRowPlace.GetWidth: Integer; +begin + Result := FPlace.Width; +end; + +{ TcxVerticalGridCustomEditorRowPlace } + +constructor TcxVerticalGridCustomEditorRowPlace.Create(AFormatter: TcxCustomVerticalGridReportLinkFormatter; + ARow: TcxCustomRow; AWrapIndex: Integer); +begin + inherited; + FHeaderPlace := TcxVerticalGridRowElementPlace.Create; + CreateValuePlaces; +end; + +destructor TcxVerticalGridCustomEditorRowPlace.Destroy; +begin + FreeAndNilValuePlaces; + FreeAndNil(FHeaderPlace); + inherited; +end; + +procedure TcxVerticalGridCustomEditorRowPlace.AddDelimiters(AReportLink: TcxCustomVerticalGridReportLink); +var + I: Integer; +begin + inherited; + if HasHeader then + begin + AReportLink.AddHorizontalDelimiter(HeaderPlace.Offset); + AReportLink.AddHorizontalDelimiter(HeaderPlace.Offset + HeaderPlace.Width); + end; + for I := StartRecordIndex to StartRecordIndex + ValuePlaceCount - 1 do + begin + AReportLink.AddHorizontalDelimiter(ValuePlaces[I].Offset); + AReportLink.AddHorizontalDelimiter(ValuePlaces[I].Offset + ValuePlaces[I].Width); + end; +end; + +procedure TcxVerticalGridCustomEditorRowPlace.Calculate; +begin + inherited; + CalculateHeaderPlace; + CalculateValuePlaces; +end; + +function TcxVerticalGridCustomEditorRowPlace.CalculatedHeaderWidth: Integer; +var + F: HFONT; +begin + Result := inherited CalculatedHeaderWidth; + + F := Windows.GetCurrentObject(DC, OBJ_FONT); + Inc(Result, CalculatedTextWidth(RowHelper.HeaderCaptions[0], HeaderFont.Handle)); + SelectObject(DC, F); + + Inc(Result, Formatter.GetImageWidth(Row, 0)); + if Result <> 0 then + Inc(Result, 1 + 1); // Borders +end; + +function TcxVerticalGridCustomEditorRowPlace.CalculatedMinHeight: Integer; +var + I, HeaderMinHeight, V, RowMinHeight: Integer; +begin + Result := inherited CalculatedMinHeight; + HeaderMinHeight := CalculatedTextPatternHeight(HeaderFont.Handle); + RowMinHeight := 0; + for I := 0 to RecordCount - 1 do + begin + V := CalculatedTextPatternHeight(ValueFonts[I].Handle); + if RowMinHeight < V then + RowMinHeight := V; + end; + Result := Round(Math.MaxValue([Result, HeaderMinHeight, RowMinHeight])); +end; + +function TcxVerticalGridCustomEditorRowPlace.CalculatedRecordWidth(ARecordIndex: Integer): Integer; +begin + if DoesItemParticipateInBestFitCalculation(ARecordIndex) then + begin + Result := MeasureWidth(ARecordIndex); + if Result <> 0 then + Inc(Result, 1 + 1); // Borders + end + else + Result := 0; +end; + +procedure TcxVerticalGridCustomEditorRowPlace.CalculateHeaderPlace; +begin + HeaderPlace.Offset := IndentArea; + if HasHeader then + HeaderPlace.Width := HeaderAvailableWidth; +end; + +procedure TcxVerticalGridCustomEditorRowPlace.CalculateValuePlaces; +var + CurrentOffset, I: Integer; +begin + CurrentOffset := ValuesOffset; + for I := StartRecordIndex to StopRecordIndex do + begin + with ValuePlaces[I] do + begin + Offset := CurrentOffset; + Width := RecordWidths[I]; + end; + Inc(CurrentOffset, ValuePlaces[I].Width + InterRecordsSpace); + end; +end; + +procedure TcxVerticalGridCustomEditorRowPlace.Clear; +begin + inherited; + HeaderPlace.Clear; + ClearValuePlaces; +end; + +procedure TcxVerticalGridCustomEditorRowPlace.ClearValuePlaces; +begin + ClearPlaceList(FValuePlaces); +end; + +procedure TcxVerticalGridCustomEditorRowPlace.CreateValuePlaces; +begin + FValuePlaces := CreatePlaceList(RecordCount); +end; + +procedure TcxVerticalGridCustomEditorRowPlace.FreeAndNilValuePlaces; +begin + ClearValuePlaces; + FreeAndNil(FValuePlaces); +end; + +function TcxVerticalGridCustomEditorRowPlace.DoesItemParticipateInBestFitCalculation(ARecordIndex: Integer): Boolean; +begin + Result := dxPScxCommon.dxPSDataMaps.DoesItemParticipateInBestFitCalculation(Properties[ARecordIndex]); +end; + +function TcxVerticalGridCustomEditorRowPlace.MeasureWidth(ARecordIndex: Integer): Integer; +begin + Result := dxPScxCommon.dxPSDataMaps.MeasureWidth(Properties[ARecordIndex], + Values[ARecordIndex], Formatter, ValueFonts[ARecordIndex], ARecordIndex); +end; + +function TcxVerticalGridCustomEditorRowPlace.Row: TcxCustomEditorRow; +begin + Result := inherited Row as TcxCustomEditorRow; +end; + +function TcxVerticalGridCustomEditorRowPlace.RowHelper: TcxVerticalGridCustomEditorRowHelper; +begin + Result := inherited RowHelper as TcxVerticalGridCustomEditorRowHelper; +end; + +function TcxVerticalGridCustomEditorRowPlace.GetHeaderFont: TFont; +begin + Result := Formatter.GetRowHeaderFont(Row, 0); +end; + +function TcxVerticalGridCustomEditorRowPlace.GetProperty(RecordIndex: Integer): TcxCustomEditProperties; +begin + Result := RowHelper.EditProperties[0, RecordIndex]; +end; + +function TcxVerticalGridCustomEditorRowPlace.GetValueFont(RecordIndex: Integer): TFont; +begin + Result := Formatter.GetRowValueFont(Row, 0, RecordIndex); +end; + +function TcxVerticalGridCustomEditorRowPlace.GetValuePlace(RecordIndex: Integer): TcxVerticalGridRowElementPlace; +begin + Result := FValuePlaces[RecordIndex - StartRecordIndex]; +end; + +function TcxVerticalGridCustomEditorRowPlace.GetValuePlaceCount: Integer; +begin + Result := FValuePlaces.Count; +end; + +function TcxVerticalGridCustomEditorRowPlace.GetValue(RecordIndex: Integer): TcxEditValue; +begin + Result := RowHelper.Values[0, RecordIndex]; +end; + +function TcxVerticalGridCustomEditorRowPlace.GetValuesOffset: Integer; +begin + Result := HeaderPlace.Offset + HeaderPlace.Width; +end; + +{ TcxVerticalGridCustomMultiEditorRowPlace } + +constructor TcxVerticalGridCustomMultiEditorRowPlace.Create(AFormatter: TcxCustomVerticalGridReportLinkFormatter; + ARow: TcxCustomRow; AWrapIndex: Integer); +begin + inherited; + CreatePlaces; +end; + +destructor TcxVerticalGridCustomMultiEditorRowPlace.Destroy; +begin + FreeAndNilPlaces; + inherited; +end; + +procedure TcxVerticalGridCustomMultiEditorRowPlace.AddDelimiters(AReportLink: TcxCustomVerticalGridReportLink); +begin + inherited; + AReportLink.AddHorizontalDelimiter(ValuesOffset); +end; + +procedure TcxVerticalGridCustomMultiEditorRowPlace.Calculate; +begin + inherited; + if HasHeaderSeparators then CalculateHeaderSeparatorWidths; + if HasValueSeparators then CalculateValueSeparatorWidths; + CalculateHeaderPlaces; + CalculateValuePlaces; + if HasHeaderSeparators then CalculateHeaderSeparatorPlaces; + if HasValueSeparators then CalculateValueSeparatorPlaces; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.CalculatedHeaderWidth: Integer; +var + I: Integer; +begin + Result := inherited CalculatedHeaderWidth; + + for I := 0 to ItemCount - 1 do + begin + Inc(Result, Formatter.GetImageWidth(Row, I)); + Inc(Result, CalculatedTextWidth(RowHelper.HeaderCaptions[I], HeaderFonts[I].Handle)); + end; + + if HasHeaderSeparators then + begin + CalculateHeaderSeparatorWidths; + Inc(Result, HeaderSeparatorsArea); + end; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.CalculatedMinHeight: Integer; +var + I, J, V, RowMinHeight, ImageHeight, RowHeaderMinHeight, ValueSeparatorMinHeight: Integer; +begin + RowHeaderMinHeight := 0; + ImageHeight := 0; + + for I := 0 to ItemCount - 1 do + begin + V := CalculatedTextPatternHeight(HeaderFonts[I].Handle); + if RowHeaderMinHeight < V then + RowHeaderMinHeight := V; + + V := Formatter.GetImageHeight(Row, I); + if ImageHeight < V then + ImageHeight := V; + end; + + RowMinHeight := 0; + ValueSeparatorMinHeight := 0; + for I := 0 to RecordCount - 1 do + for J := 0 to ItemCount - 1 do + begin + V := CalculatedTextPatternHeight(ValueFonts[J, I].Handle); + if RowMinHeight < V then + RowMinHeight := V; + + V := CalculatedTextPatternHeight(ValueSeparatorsFonts[J, I].Handle); + if ValueSeparatorMinHeight < V then + ValueSeparatorMinHeight := V; + end; + + Result := Round(Math.MaxValue([RowHeaderMinHeight, RowMinHeight, ValueSeparatorMinHeight, ImageHeight, DefaultRowMinHeight])); +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.CalculatedRecordWidth(ARecordIndex: Integer): Integer; +var + I, W: Integer; +begin + Result := 0; + + for I := 0 to ItemCount - 1 do + if DoesItemParticipateInBestFitCalculation(I, ARecordIndex) then + begin + W := MeasureWidth(I, ARecordIndex); + if W <> 0 then Inc(W, 1 + 1); // borders + Inc(Result, W); + end; + if HasValueSeparators then + begin + CalculateValueSeparatorWidths; + Inc(Result, ValueSeparatorsAreas[ARecordIndex]); + end; + + if Result <> 0 then + Inc(Result, 1 + 1); // Borders +end; + +procedure TcxVerticalGridCustomMultiEditorRowPlace.CalculateHeaderPartWidths; +var + AutoWidthObject: TcxAutoWidthObject; + I: Integer; +begin + AutoWidthObject := TcxAutoWidthObject.Create(RowHelper.ItemCount); + try + CalculatePartWidths(AutoWidthObject, HeaderAvailableWidth); + for I := 0 to AutoWidthObject.Count - 1 do + HeaderPlaces[I].Width := AutoWidthObject[I].AutoWidth; + finally + AutoWidthObject.Free; + end; +end; + +procedure TcxVerticalGridCustomMultiEditorRowPlace.CalculateHeaderPlaces; +var + CurrentOffset, I: Integer; +begin + if HasHeader then CalculateHeaderPartWidths; + + CurrentOffset := IndentArea; + for I := 0 to ItemCount - 1 do + begin + HeaderPlaces[I].Offset := CurrentOffset; + Inc(CurrentOffset, HeaderPlaces[I].Width); + if HasHeaderSeparators and (I < ItemCount - 1) then + Inc(CurrentOffset, HeaderSeparatorPlaces[I].Width); + end; +end; + +procedure TcxVerticalGridCustomMultiEditorRowPlace.CalculateHeaderSeparatorPlaces; +var + CurrentOffset, I: Integer; +begin + CurrentOffset := IndentArea; + for I := 0 to HeaderSeparatorCount - 1 do + begin + Inc(CurrentOffset, HeaderPlaces[I].Width); + HeaderSeparatorPlaces[I].Offset := CurrentOffset; + Inc(CurrentOffset, HeaderSeparatorPlaces[I].Width); + end; +end; + +procedure TcxVerticalGridCustomMultiEditorRowPlace.CalculateHeaderSeparatorWidths; +var + F: HFONT; + I: Integer; +begin + F := Windows.GetCurrentObject(DC, OBJ_FONT); + for I := 0 to HeaderSeparatorCount - 1 do + HeaderSeparatorPlaces[I].Width := CalculatedTextWidth(RowHelper.HeaderSeparatorTexts[I], HeaderSeparatorsFonts[I].Handle); + Windows.SelectObject(DC, F); +end; + +procedure TcxVerticalGridCustomMultiEditorRowPlace.CalculatePartWidths(AnAutoWidthObject: TcxAutoWidthObject; + AnAvailableWidth: Integer); + + procedure AssignAutoWidthItem(AnItem: TcxAutoWidthItem; AProperties: TcxEditorRowItemProperties); + begin + AnItem.MinWidth := 0; + AnItem.Width := AProperties.Width; + end; + +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + AssignAutoWidthItem(AnAutoWidthObject.AddItem, RowHelper.Properties(I)); + AnAutoWidthObject.AvailableWidth := AnAvailableWidth; + AnAutoWidthObject.Calculate; +end; + +procedure TcxVerticalGridCustomMultiEditorRowPlace.CalculateValuePartWidths; + + procedure CalculateValueRecordPartWidths(ARecordIndex: Integer); + var + AutoWidthObject: TcxAutoWidthObject; + I: Integer; + begin + AutoWidthObject := TcxAutoWidthObject.Create(RowHelper.ItemCount); + try + CalculatePartWidths(AutoWidthObject, ValueAvailableWidths[ARecordIndex]); + for I := 0 to AutoWidthObject.Count - 1 do + ValuePlaces[I, ARecordIndex].Width := AutoWidthObject[I].AutoWidth; + finally + AutoWidthObject.Free; + end; + end; + +var + I: Integer; +begin + for I := StartRecordIndex to StopRecordIndex do + CalculateValueRecordPartWidths(I); +end; + +procedure TcxVerticalGridCustomMultiEditorRowPlace.CalculateValuePlaces; +var + CurrentOffset, I, J: Integer; +begin + CalculateValuePartWidths; + + CurrentOffset := ValuesOffset; + for I := StartRecordIndex to StopRecordIndex do + begin + for J := 0 to ItemCount - 1 do + begin + ValuePlaces[J, I].Offset := CurrentOffset; + Inc(CurrentOffset, ValuePlaces[J, I].Width); + if HasValueSeparators and (J < ItemCount - 1) then + Inc(CurrentOffset, ValueSeparatorPlaces[J, I].Width); + end; + Inc(CurrentOffset, InterRecordsSpace); + end; +end; + +procedure TcxVerticalGridCustomMultiEditorRowPlace.CalculateValueSeparatorPlaces; +var + CurrentOffset, I, J: Integer; +begin + CurrentOffset := ValuesOffset; + for I := StartRecordIndex to StopRecordIndex do + begin + Inc(CurrentOffset, ValuePlaces[0, I].Width); + for J := 0 to ValueSeparatorCount - 1 do + begin + ValueSeparatorPlaces[J, I].Offset := CurrentOffset; + Inc(CurrentOffset, ValuePlaces[J + 1, I].Width + ValueSeparatorPlaces[J, I].Width); + end; + Inc(CurrentOffset, InterRecordsSpace); + end; +end; + +procedure TcxVerticalGridCustomMultiEditorRowPlace.CalculateValueSeparatorWidths; +var + F: HFONT; + I, J: Integer; +begin + F := Windows.GetCurrentObject(DC, OBJ_FONT); + for I := StartRecordIndex to StopRecordIndex do + for J := 0 to ValueSeparatorCount - 1 do + ValueSeparatorPlaces[J, I].Width := CalculatedTextWidth(RowHelper.ValueSeparatorTexts[J], ValueSeparatorsFonts[J, I].Handle); + Windows.SelectObject(DC, F); +end; + +procedure TcxVerticalGridCustomMultiEditorRowPlace.Clear; +begin + inherited; + ClearPlaces; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetHeaderAvailableWidth: Integer; +begin + Result := inherited GetHeaderAvailableWidth - HeaderSeparatorsArea; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetValueAvailableWidth(RecordIndex: Integer): Integer; +begin + Result := inherited GetValueAvailableWidth(RecordIndex) - ValueSeparatorsAreas[RecordIndex]; +end; + +procedure TcxVerticalGridCustomMultiEditorRowPlace.ClearPlaces; +begin + ClearPlaceList(FHeaderPlaces); + ClearPlaceList(FHeaderSeparatorPlaces); + ClearPlaceList(FValuePlaces); + ClearPlaceList(FValueSeparatorPlaces); +end; + +procedure TcxVerticalGridCustomMultiEditorRowPlace.CreatePlaces; +begin + FHeaderPlaces := CreatePlaceList(ItemCount); + FHeaderSeparatorPlaces := CreatePlaceList(HeaderSeparatorCount); + FValuePlaces := CreatePlaceList(RecordCount * ItemCount); + FValueSeparatorPlaces := CreatePlaceList(RecordCount * ValueSeparatorCount); +end; + +procedure TcxVerticalGridCustomMultiEditorRowPlace.FreeAndNilPlaces; +begin + ClearPlaces; + FreeAndNil(FHeaderPlaces); + FreeAndNil(FHeaderSeparatorPlaces); + FreeAndNil(FValuePlaces); + FreeAndNil(FValueSeparatorPlaces); +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.DoesItemParticipateInBestFitCalculation(ACellIndex, + ARecordIndex: Integer): Boolean; +begin + Result := dxPScxCommon.dxPSDataMaps.DoesItemParticipateInBestFitCalculation(Properties[ACellIndex, ARecordIndex]); +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.MeasureWidth(ACellIndex, + ARecordIndex: Integer): Integer; +begin + Result := dxPScxCommon.dxPSDataMaps.MeasureWidth(Properties[ACellIndex, ARecordIndex], + Values[ACellIndex, ARecordIndex], Formatter, ValueFonts[ACellIndex, ARecordIndex], ARecordIndex); +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.Row: TcxCustomMultiEditorRow; +begin + Result := inherited Row as TcxCustomMultiEditorRow; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.RowHelper: TcxVerticalGridCustomMultiEditorRowHelper; +begin + Result := inherited RowHelper as TcxVerticalGridCustomMultiEditorRowHelper; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetHasHeaderSeparators: Boolean; +begin + Result := HasHeader and RowHelper.HasHeaderSeparators; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetHasValueSeparators: Boolean; +begin + Result := RowHelper.HasValueSeparators; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetHeaderFont(CellIndex: Integer): TFont; +begin + Result := Formatter.GetRowHeaderFont(Row, CellIndex); +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetHeaderPlace(CellIndex: Integer): TcxVerticalGridRowElementPlace; +begin + Result := FHeaderPlaces[CellIndex]; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetHeaderPlaceCount: Integer; +begin + Result := FHeaderPlaces.Count; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetHeaderSeparatorCount: Integer; +begin + Result := RowHelper.HeaderSeparatorCount; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetHeaderSeparatorPlace(CellIndex: Integer): TcxVerticalGridRowElementPlace; +begin + Result := FHeaderSeparatorPlaces[CellIndex]; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetHeaderSeparatorPlaceCount: Integer; +begin + Result := FHeaderSeparatorPlaces.Count; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetHeaderSeparatorsArea: Integer; +var + I: Integer; +begin + if HasHeaderSeparators then + begin + Result := 0; + for I := 0 to HeaderSeparatorCount - 1 do + Inc(Result, HeaderSeparatorPlaces[I].Width); + end + else + Result := 0; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetHeaderSeparatorsFont(CellIndex: Integer): TFont; +begin + Result := Formatter.GetRowHeaderSeparatorsFont(Row, CellIndex); +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetProperty(CellIndex, RecordIndex: Integer): TcxCustomEditProperties; +begin + Result := RowHelper.EditProperties[CellIndex, RecordIndex]; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetValue(CellIndex, RecordIndex: Integer): TcxEditValue; +begin + Result := RowHelper.Values[CellIndex, RecordIndex]; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetValueFlatIndex(CellIndex, RecordIndex: Integer): Integer; +begin + Result := RecordIndex * ItemCount + CellIndex; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetValueFont(CellIndex, RecordIndex: Integer): TFont; +begin + Result := Formatter.GetRowValueFont(Row, CellIndex, RecordIndex); +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetValuePlace(CellIndex, RecordIndex: Integer): TcxVerticalGridRowElementPlace; +begin + Result := FValuePlaces[ValueFlatIndexes[CellIndex, RecordIndex - StartRecordIndex]]; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetValuePlaceCount: Integer; +begin + Result := FValuePlaces.Count; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetValueSeparatorsArea(RecordIndex: Integer): Integer; +var + I: Integer; +begin + if HasValueSeparators then + begin + Result := 0; + for I := 0 to RowHelper.ValueSeparatorCount - 1 do + Inc(Result, ValueSeparatorPlaces[I, RecordIndex].Width); + end + else + Result := 0; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetValueSeparatorCount: Integer; +begin + Result := RowHelper.ValueSeparatorCount; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetValueSeparatorFlatIndex(CellIndex, RecordIndex: Integer): Integer; +begin + Result := RecordIndex * ValueSeparatorCount + CellIndex; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetValueSeparatorPlace(CellIndex, RecordIndex: Integer): TcxVerticalGridRowElementPlace; +begin + Result := FValueSeparatorPlaces[ValueSeparatorFlatIndexes[CellIndex, RecordIndex - StartRecordIndex]]; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetValueSeparatorPlaceCount: Integer; +begin + Result := FValueSeparatorPlaces.Count; +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetValueSeparatorsFont(CellIndex, RecordIndex: Integer): TFont; +begin + Result := Formatter.GetRowValueSeparatorsFont(Row, CellIndex, RecordIndex); +end; + +function TcxVerticalGridCustomMultiEditorRowPlace.GetValuesOffset: Integer; +begin + with HeaderPlaces[RowHelper.ItemCount - 1] do + Result := Offset + Width; +end; + +{ TcxVerticalGridReportLinkCustomElementProducer } + +constructor TcxVerticalGridReportLinkCustomElementProducer.Create(ABuilder: TcxCustomVerticalGridReportLinkBuilder); +begin + inherited Create; + FBuilder := ABuilder; +end; + +function TcxVerticalGridReportLinkCustomElementProducer.Adapter: TcxCustomVerticalGridAdapter; +begin + Result := Builder.Adapter; +end; + +function TcxVerticalGridReportLinkCustomElementProducer.Builder: TcxCustomVerticalGridReportLinkBuilder; +begin + Result := FBuilder; +end; + +function TcxVerticalGridReportLinkCustomElementProducer.Formatter: TcxCustomVerticalGridReportLinkFormatter; +begin + Result := Builder.Formatter; +end; + +function TcxVerticalGridReportLinkCustomElementProducer.Produce(AHostInfo: TcxVerticalGridHostInfo; + AWrapIndex: Integer): TdxReportCell; +begin + FWrapIndex := AWrapIndex; + CalculateRowHeight; + CreateRowHost(AHostInfo); + CreateRow; + Inc(AHostInfo.Origin.Y, RowHeight); + Result := Host; +end; + +procedure TcxVerticalGridReportLinkCustomElementProducer.CalculateRowHeight; +begin + FRowHeight := Formatter.WrapSeparatorHeight; +end; + +procedure TcxVerticalGridReportLinkCustomElementProducer.CreateRow; +begin + FRow := TdxReportCell.Create(Host); + FRow.BoundsRect := MakeBounds(0, 0, RowWidth, RowHeight); + InitializeRow; +end; + +procedure TcxVerticalGridReportLinkCustomElementProducer.CreateRowHost(AHostInfo: TcxVerticalGridHostInfo); +begin + FHost := TdxReportCell.Create(AHostInfo.Parent); + FHost.BoundsRect := MakeBounds(AHostInfo.Origin.X, AHostInfo.Origin.Y, RowWidth, RowHeight); + Formatter.DoInitializeHost(Host); +end; + +procedure TcxVerticalGridReportLinkCustomElementProducer.InitializeRow; +begin + +end; + +function TcxVerticalGridReportLinkCustomElementProducer.GetDC: HDC; +begin + Result := Formatter.DC; +end; + +function TcxVerticalGridReportLinkCustomElementProducer.GetRowWidth: Integer; +begin + Result := Formatter.ViewWidths[WrapIndex]; +end; + +{ TcxVerticalGridReportLinkWrapSeparatorProducer } + +procedure TcxVerticalGridReportLinkWrapSeparatorProducer.CreateRow; +begin + inherited; + CreateSeparator(Row); +end; + +procedure TcxVerticalGridReportLinkWrapSeparatorProducer.CreateSeparator(AParent: TdxReportCell); +begin + FSeparator := Formatter.GetWrapSeparatorClass.Create(AParent); + FSeparator.BoundsRect := SeparatorBounds; + InitializeSeparator; +end; + +procedure TcxVerticalGridReportLinkWrapSeparatorProducer.InitializeRow; +begin + Formatter.DoInitializeWrapSeparatorRow(Row); +end; + +procedure TcxVerticalGridReportLinkWrapSeparatorProducer.InitializeSeparator; +begin + Formatter.DoInitializeWrapSeparatorItem(Separator, WrapIndex); +end; + +function TcxVerticalGridReportLinkWrapSeparatorProducer.GetSeparatorBounds: TRect; +begin + Result := Row.BoundsRect; + OffsetRect(Result, -Result.Left, -Result.Top); +end; + +{ TcxVerticalGridReportLinkCustomRowProducer } + +constructor TcxVerticalGridReportLinkCustomRowProducer.Create(ABuilder: TcxCustomVerticalGridReportLinkBuilder); +begin + inherited; + FIndents := TList.Create; +end; + +destructor TcxVerticalGridReportLinkCustomRowProducer.Destroy; +begin + FreeAndNil(FIndents); + inherited; +end; + +function TcxVerticalGridReportLinkCustomRowProducer.GridRow: TcxCustomRow; +begin + Result := FGridRow; +end; + +function TcxVerticalGridReportLinkCustomRowProducer.GridRowHelper: TcxVerticalGridCustomRowHelper; +begin + Result := Formatter.RowHelpers[GridRow]; +end; + +function TcxVerticalGridReportLinkCustomRowProducer.GridRowPlace: TcxVerticalGridCustomRowPlace; +begin + Result := Formatter.RowPlacesByRow[GridRow, WrapIndex]; +end; + +function TcxVerticalGridReportLinkCustomRowProducer.Produce(AHostInfo: TcxVerticalGridHostInfo; + AGridRow: TcxCustomRow; AWrapIndex: Integer): TdxReportCell; +begin + ClearItems; + + FWrapIndex := AWrapIndex; + FGridRow := AGridRow; + try + CalculateRowHeight; + + CreateRowHost(AHostInfo); + CreateRow; + if AutoHeight then + begin + CalculateRowAutoHeight; + FixupRowHeight; + end; + + Inc(AHostInfo.Origin.Y, RowHeight); + Result := Host; + finally + FGridRow := nil; + end; +end; + +procedure TcxVerticalGridReportLinkCustomRowProducer.CalculateRowAutoHeight; +var + DC: HDC; + MaxRowHeight, I, V: Integer; + Item: TAbstractdxReportCellData; +begin + DC := Self.DC; + MaxRowHeight := 0; + for I := 0 to Row.DataItemCount - 1 do + begin + Item := Row.DataItems[I]; + if DoesItemParticipateInRowAutoHeightCalculation(Item) then + begin + V := Item.MeasureContentHeight(DC); + if MaxRowHeight < V then MaxRowHeight := V; + end; + end; + RowHeight := MaxRowHeight; +end; + +procedure TcxVerticalGridReportLinkCustomRowProducer.CalculateRowHeight; +begin + FRowHeight := Formatter.RowHeights[GridRow]; + Inc(FRowHeight, 1 + 1); +end; + +procedure TcxVerticalGridReportLinkCustomRowProducer.ClearItems; +begin + FIndents.Clear; +end; + +procedure TcxVerticalGridReportLinkCustomRowProducer.CreateRow; +begin + inherited; + if HasIndents then CreateRowIndents(Row); +end; + +function TcxVerticalGridReportLinkCustomRowProducer.CreateRowIndent(AParent: TdxReportCell): TdxReportCellExpandButton; +begin + Result := Formatter.GetRowIndentClass.Create(AParent); + FIndents.Add(Result); +end; + +procedure TcxVerticalGridReportLinkCustomRowProducer.CreateRowIndents(AParent: TdxReportCell); +var + I: Integer; + Indent: TdxReportCellExpandButton; +begin + for I := 0 to IndentCount - 1 do + begin + Indent := CreateRowIndent(AParent); + Indent.BoundsRect := IndentBounds[I]; + InitializeRowIndent(Indent, I); + end; +end; + +function TcxVerticalGridReportLinkCustomRowProducer.DoesItemParticipateInRowAutoHeightCalculation(AnItem: TAbstractdxReportCellData): Boolean; +begin + Result := True; +end; + +procedure TcxVerticalGridReportLinkCustomRowProducer.FixupRowDataHeight; +var + I: Integer; +begin + for I := 0 to Row.DataItemCount - 1 do + Row.DataItems[I].Height := RowHeight; +end; + +procedure TcxVerticalGridReportLinkCustomRowProducer.FixupRowHeight; +begin + FixupRowItselfHeight; + FixupRowDataHeight; +end; + +procedure TcxVerticalGridReportLinkCustomRowProducer.FixupRowItselfHeight; +begin + Host.Height := RowHeight; + Row.Height := RowHeight; +end; + +procedure TcxVerticalGridReportLinkCustomRowProducer.InitializeRow; +begin + Formatter.DoInitializeRowReportRow(GridRow, Row); +end; + +procedure TcxVerticalGridReportLinkCustomRowProducer.InitializeRowIndent(AnItem: TdxReportCellExpandButton; + AnIndex: Integer); +begin + Formatter.DoInitializeRowIndent(GridRow, AnItem, AnIndex, IndentCount); + Formatter.DoReportLinkInitializeRowIndent(GridRow, AnItem, AnIndex); +end; + +function TcxVerticalGridReportLinkCustomRowProducer.GetAutoHeight: Boolean; +begin + Result := Adapter.CellAutoHeight and GridRow.Options.CanAutoHeight and + not CustomRow_IsHeightAssigned(GridRow); +end; + +function TcxVerticalGridReportLinkCustomRowProducer.GetLineHeight: Integer; +begin + if not CustomRow_IsHeightAssigned(GridRow) then + Result := GridRow.Height + else + Result := Row.Height; +end; + +function TcxVerticalGridReportLinkCustomRowProducer.GetHasIndents: Boolean; +begin + Result := IndentCount <> 0; +end; + +function TcxVerticalGridReportLinkCustomRowProducer.GetIndent(Index: Integer): TdxReportCellExpandButton; +begin + Result := TdxReportCellExpandButton(FIndents[Index]); +end; + +function TcxVerticalGridReportLinkCustomRowProducer.GetIndentBounds(Index: Integer): TRect; +begin + Result := MakeBounds(IndentWidth * Index, 0, IndentWidth, RowHeight); +end; + +function TcxVerticalGridReportLinkCustomRowProducer.GetIndentCount: Integer; +begin + if Formatter.ShowHeaders then + Result := Adapter.IndentCounts[GridRow] + else + Result := 0; +end; + +function TcxVerticalGridReportLinkCustomRowProducer.GetIndentWidth: Integer; +begin + Result := Adapter.IndentWidth; +end; + +function TcxVerticalGridReportLinkCustomRowProducer.GetItemCount: Integer; +begin + Result := GridRowHelper.ItemCount; +end; + +function TcxVerticalGridReportLinkCustomRowProducer.GetRecordCount: Integer; +begin + Result := Formatter.RecordCounts[WrapIndex]; +end; + +function TcxVerticalGridReportLinkCustomRowProducer.GetStartRecordIndex: Integer; +begin + Result := Formatter.WrappedRecordStartIndexes[WrapIndex]; +end; + +function TcxVerticalGridReportLinkCustomRowProducer.GetStopRecordIndex: Integer; +begin + Result := Formatter.WrappedRecordStopIndexes[WrapIndex]; +end; + +{ TcxVerticalGridReportLinkCategoryRowProducer } + +function TcxVerticalGridReportLinkCategoryRowProducer.GridRow: TcxCategoryRow; +begin + Result := inherited GridRow as TcxCategoryRow; +end; + +function TcxVerticalGridReportLinkCategoryRowProducer.GridRowHelper: TcxVerticalGridCategoryRowHelper; +begin + Result := inherited GridRowHelper as TcxVerticalGridCategoryRowHelper; +end; + +function TcxVerticalGridReportLinkCategoryRowProducer.GridRowPlace: TcxVerticalGridCategoryRowPlace; +begin + Result := inherited GridRowPlace as TcxVerticalGridCategoryRowPlace; +end; + +procedure TcxVerticalGridReportLinkCategoryRowProducer.CreateCategoryRow(AParent: TdxReportCell); +var + Item: TdxReportCellImage; +begin + Item := Formatter.GetCategoryRowClass(GridRow).Create(Row); + Item.BoundsRect := CategoryBounds; + Formatter.DoInitializeCategoryRow(GridRow, Item); +end; + +procedure TcxVerticalGridReportLinkCategoryRowProducer.CreateRow; +begin + inherited; + CreateCategoryRow(Row); +end; + +function TcxVerticalGridReportLinkCategoryRowProducer.GetCategoryBounds: TRect; +begin + Result := MakeBounds(GridRowPlace.Offset, 0, GridRowPlace.Width, RowHeight); +end; + +{ TcxVerticalGridReportLinkCustomEditableRowProducer } + +constructor TcxVerticalGridReportLinkCustomEditableRowProducer.Create(ABuilder: TcxCustomVerticalGridReportLinkBuilder); +begin + inherited; + FHeaders := TList.Create; + FValues := TList.Create; +end; + +destructor TcxVerticalGridReportLinkCustomEditableRowProducer.Destroy; +begin + FreeAndNil(FValues); + FreeAndNil(FHeaders); + inherited; +end; + +procedure TcxVerticalGridReportLinkCustomEditableRowProducer.ClearItems; +begin + inherited; + FHeaders.Clear; + FValues.Clear; +end; + +function TcxVerticalGridReportLinkCustomEditableRowProducer.CreateHeaderItem(AParent: TdxReportCell; + ACellIndex: Integer): TdxReportCellImage; +begin + Result := Formatter.GetRowHeaderClass(GridRow).Create(AParent); + FHeaders.Add(Result); +end; + +function TcxVerticalGridReportLinkCustomEditableRowProducer.CreateValueItem(AParent: TdxReportCell; + ACellIndex, ARecordIndex: Integer): TAbstractdxReportCellData; +begin + Result := Formatter.GetRowValueClass(GridRow, ACellIndex, ARecordIndex).Create(AParent); + FValues.Add(Result); +end; + +procedure TcxVerticalGridReportLinkCustomEditableRowProducer.DoInitializeHeader(AnItem: TdxReportCellImage; + AnIndex: Integer); +begin + Formatter.DoInitializeRowHeader(GridRow, AnItem, AnIndex); + Formatter.DoReportLinkInitializeRowHeader(GridRow, AnItem, AnIndex); +end; + +procedure TcxVerticalGridReportLinkCustomEditableRowProducer.DoInitializeValue(AnItem: TAbstractdxReportCellData; + ACellIndex, ARecordIndex: Integer); +begin + Formatter.DoInitializeRowValue(GridRow, AnItem, ACellIndex, ARecordIndex); + Formatter.DoReportLinkInitializeRowValue(GridRow, AnItem, ACellIndex, ARecordIndex); +end; + +function TcxVerticalGridReportLinkCustomEditableRowProducer.DoesItemParticipateInRowAutoHeightCalculation( + AnItem: TAbstractdxReportCellData): Boolean; +begin + Result := True; +end; + +function TcxVerticalGridReportLinkCustomEditableRowProducer.GetHeader(Index: Integer): TdxReportCellImage; +begin + Result := TdxReportCellImage(FHeaders[Index]); +end; + +function TcxVerticalGridReportLinkCustomEditableRowProducer.GetHeaderCount: Integer; +begin + Result := FHeaders.Count; +end; + +function TcxVerticalGridReportLinkCustomEditableRowProducer.GetValue(Index: Integer): TAbstractdxReportCellData; +begin + Result := TAbstractdxReportCellData(FValues[Index]); +end; + +function TcxVerticalGridReportLinkCustomEditableRowProducer.GetValueCount: Integer; +begin + Result := FValues.Count; +end; + +{ TcxVerticalGridReportLinkCustomEditorRowProducer } + +function TcxVerticalGridReportLinkCustomEditorRowProducer.GridRow: TcxCustomEditorRow; +begin + Result := inherited GridRow as TcxCustomEditorRow; +end; + +function TcxVerticalGridReportLinkCustomEditorRowProducer.GridRowHelper: TcxVerticalGridCustomEditorRowHelper; +begin + Result := inherited GridRowHelper as TcxVerticalGridCustomEditorRowHelper; +end; + +function TcxVerticalGridReportLinkCustomEditorRowProducer.GridRowPlace: TcxVerticalGridCustomEditorRowPlace; +begin + Result := inherited GridRowPlace as TcxVerticalGridCustomEditorRowPlace; +end; + +procedure TcxVerticalGridReportLinkCustomEditorRowProducer.CreateRow; +begin + inherited; + if HasHeader then CreateHeader(Row); + CreateValues(Row); +end; + +procedure TcxVerticalGridReportLinkCustomEditorRowProducer.CreateHeader(AParent: TdxReportCell); +var + Header: TdxReportCellImage; +begin + Header := CreateHeaderItem(AParent, 0); + Header.BoundsRect := HeaderBounds; + DoInitializeHeader(Header, 0); +end; + +procedure TcxVerticalGridReportLinkCustomEditorRowProducer.CreateValues(AParent: TdxReportCell); +var + I: Integer; + Value: TAbstractdxReportCellData; +begin + for I := StartRecordIndex to StopRecordIndex do + begin + Value := CreateValueItem(AParent, 0, I); + Value.BoundsRect := ValueBounds[I]; + DoInitializeValue(Value, 0, I); + end; +end; + +function TcxVerticalGridReportLinkCustomEditorRowProducer.GetHasHeader: Boolean; +begin + Result := Formatter.ShowHeaders; +end; + +function TcxVerticalGridReportLinkCustomEditorRowProducer.GetHeader: TdxReportCellImage; +begin + Result := Headers[0]; +end; + +function TcxVerticalGridReportLinkCustomEditorRowProducer.GetHeaderBounds: TRect; +begin + with GridRowPlace.HeaderPlace do + Result := MakeBounds(Offset, 0, Width, RowHeight); +end; + +function TcxVerticalGridReportLinkCustomEditorRowProducer.GetValueBounds(Index: Integer): TRect; +begin + with GridRowPlace do + Result := MakeBounds(ValuePlaces[Index].Offset, 0, ValuePlaces[Index].Width, RowHeight); +end; + +{ TcxVerticalGridReportLinkCustomMultiEditorRowProducer } + +constructor TcxVerticalGridReportLinkCustomMultiEditorRowProducer.Create(ABuilder: TcxCustomVerticalGridReportLinkBuilder); +begin + inherited; + FHeaderSeparators := TList.Create; + FValueSeparators := TList.Create; +end; + +destructor TcxVerticalGridReportLinkCustomMultiEditorRowProducer.Destroy; +begin + FreeAndNil(FValueSeparators); + FreeAndNil(FHeaderSeparators); + inherited; +end; + +function TcxVerticalGridReportLinkCustomMultiEditorRowProducer.GridRow: TcxCustomMultiEditorRow; +begin + Result := inherited GridRow as TcxCustomMultiEditorRow; +end; + +function TcxVerticalGridReportLinkCustomMultiEditorRowProducer.GridRowHelper: TcxVerticalGridCustomMultiEditorRowHelper; +begin + Result := inherited GridRowHelper as TcxVerticalGridCustomMultiEditorRowHelper; +end; + +function TcxVerticalGridReportLinkCustomMultiEditorRowProducer.GridRowPlace: TcxVerticalGridCustomMultiEditorRowPlace; +begin + Result := inherited GridRowPlace as TcxVerticalGridCustomMultiEditorRowPlace; +end; + +procedure TcxVerticalGridReportLinkCustomMultiEditorRowProducer.ClearItems; +begin + inherited; + FHeaderSeparators.Clear; + FValueSeparators.Clear; +end; + +procedure TcxVerticalGridReportLinkCustomMultiEditorRowProducer.CreateRow; +begin + inherited; + CreateHeaders(Row); + CreateValues(Row); + if HasHeaderSeparators then CreateHeaderSeparators(Row); + if HasValueSeparators then CreateValueSeparators(Row); +end; + +procedure TcxVerticalGridReportLinkCustomMultiEditorRowProducer.CreateHeaders(AParent: TdxReportCell); +var + I: Integer; + Header: TdxReportCellImage; +begin + for I := 0 to GridRowHelper.ItemCount - 1 do + begin + Header := CreateHeaderItem(AParent, I); + Header.BoundsRect := HeaderBounds[I]; + DoInitializeHeader(Header, I); + end; +end; + +function TcxVerticalGridReportLinkCustomMultiEditorRowProducer.CreateHeaderSeparator(AParent: TdxReportCell): TdxReportCellString; +begin + Result := Formatter.GetRowHeaderSeparatorClass(GridRow).Create(AParent); + FValueSeparators.Add(Result); +end; + +procedure TcxVerticalGridReportLinkCustomMultiEditorRowProducer.CreateHeaderSeparators(AParent: TdxReportCell); +var + I: Integer; + Separator: TdxReportCellString; +begin + for I := 0 to HeaderSeparatorCount - 1 do + begin + Separator := CreateHeaderSeparator(AParent); + Separator.BoundsRect := HeaderSeparatorBounds[I]; + Separator.Text := HeaderSeparatorTexts[I]; + DoInitializeHeaderSeparator(Separator, I); + end; +end; + +procedure TcxVerticalGridReportLinkCustomMultiEditorRowProducer.CreateValues(AParent: TdxReportCell); +var + I, J: Integer; + Item: TAbstractdxReportCellData; +begin + for I := StartRecordIndex to StopRecordIndex do + for J := 0 to ItemCount - 1 do + begin + Item := CreateValueItem(AParent, J, I); + Item.BoundsRect := ValueBounds[J, I]; + DoInitializeValue(Item, J, I); + end; +end; + +function TcxVerticalGridReportLinkCustomMultiEditorRowProducer.CreateValueSeparator(AParent: TdxReportCell): TdxReportCellString; +begin + Result := Formatter.GetRowValueSeparatorClass(GridRow).Create(AParent); + FValueSeparators.Add(Result); +end; + +procedure TcxVerticalGridReportLinkCustomMultiEditorRowProducer.CreateValueSeparators(AParent: TdxReportCell); +var + I, J: Integer; + Separator: TdxReportCellString; +begin + for I := StartRecordIndex to StopRecordIndex do + for J := 0 to ValueSeparatorCount - 1 do + begin + Separator := CreateValueSeparator(AParent); + Separator.BoundsRect := ValueSeparatorBounds[J, I]; + Separator.Text := ValueSeparatorTexts[J]; + DoInitializeValueSeparator(Separator, J, I); + end; +end; + +procedure TcxVerticalGridReportLinkCustomMultiEditorRowProducer.DoInitializeHeaderSeparator(AnItem: TdxReportCellString; + AnIndex: Integer); +begin + Formatter.DoInitializeRowHeaderSeparator(GridRow, AnItem, AnIndex); + Formatter.DoReportLinkInitializeRowHeaderSeparator(GridRow, AnItem, AnIndex); +end; + +procedure TcxVerticalGridReportLinkCustomMultiEditorRowProducer.DoInitializeValueSeparator(AnItem: TdxReportCellString; + AnIndex, ARecordIndex: Integer); +begin + Formatter.DoInitializeRowValueSeparator(GridRow, AnItem, AnIndex, ARecordIndex); + Formatter.DoReportLinkInitializeRowValueSeparator(GridRow, AnItem, AnIndex, ARecordIndex); +end; + +function TcxVerticalGridReportLinkCustomMultiEditorRowProducer.GetHasHeaderSeparators: Boolean; +begin + Result := GridRowHelper.HasHeaderSeparators; +end; + +function TcxVerticalGridReportLinkCustomMultiEditorRowProducer.GetHasValueSeparators: Boolean; +begin + Result := GridRowHelper.HasValueSeparators; +end; + +function TcxVerticalGridReportLinkCustomMultiEditorRowProducer.GetHeaderBounds(Index: Integer): TRect; +begin + with GridRowPlace.HeaderPlaces[Index] do + Result := MakeBounds(Offset, 0, Width, RowHeight); +end; + +function TcxVerticalGridReportLinkCustomMultiEditorRowProducer.GetHeaderSeparator(Index: Integer): TdxReportCellString; +begin + Result := TdxReportCellString(FHeaderSeparators[Index]); +end; + +function TcxVerticalGridReportLinkCustomMultiEditorRowProducer.GetHeaderSeparatorBounds(Index: Integer): TRect; +begin + with GridRowPlace do + Result := MakeBounds(HeaderSeparatorPlaces[Index].Offset, 0, HeaderSeparatorPlaces[Index].Width, RowHeight); +end; + +function TcxVerticalGridReportLinkCustomMultiEditorRowProducer.GetHeaderSeparatorCount: Integer; +begin + Result := GridRowHelper.HeaderSeparatorCount; +end; + +function TcxVerticalGridReportLinkCustomMultiEditorRowProducer.GetHeaderSeparatorText(Index: Integer): string; +begin + Result := GridRowHelper.HeaderSeparatorTexts[Index]; +end; + +function TcxVerticalGridReportLinkCustomMultiEditorRowProducer.GetValue(CellIndex, RecordIndex: Integer): TAbstractdxReportCellData; +begin + Result := FValues[RecordIndex * GridRowHelper.ItemCount + CellIndex]; +end; + +function TcxVerticalGridReportLinkCustomMultiEditorRowProducer.GetValueBounds(CellIndex, RecordIndex: Integer): TRect; +begin + with GridRowPlace do + Result := MakeBounds(ValuePlaces[CellIndex, RecordIndex].Offset, 0, ValuePlaces[CellIndex, RecordIndex].Width, RowHeight); +end; + +function TcxVerticalGridReportLinkCustomMultiEditorRowProducer.GetValueSeparator(Index: Integer): TdxReportCellString; +begin + Result := TdxReportCellString(FValueSeparators[Index]); +end; + +function TcxVerticalGridReportLinkCustomMultiEditorRowProducer.GetValueSeparatorBounds(Index, RecordIndex: Integer): TRect; +begin + with GridRowPlace do + Result := MakeBounds(ValueSeparatorPlaces[Index, RecordIndex].Offset, 0, ValueSeparatorPlaces[Index, RecordIndex].Width, RowHeight); +end; + +function TcxVerticalGridReportLinkCustomMultiEditorRowProducer.GetValueSeparatorCount: Integer; +begin + Result := GridRowHelper.ValueSeparatorCount; +end; + +function TcxVerticalGridReportLinkCustomMultiEditorRowProducer.GetValueSeparatorText(Index: Integer): string; +begin + Result := GridRowHelper.ValueSeparatorTexts[Index]; +end; + +{ TcxVerticalGridCustomRowHelper } + +constructor TcxVerticalGridCustomRowHelper.Create(AnAdapter: TcxCustomVerticalGridAdapter); +begin + inherited Create; + FAdapter := AnAdapter; +end; + +procedure TcxVerticalGridCustomRowHelper.Initialize(ARow: TcxCustomRow); +begin + FRow := ARow; +end; + +class function TcxVerticalGridCustomRowHelper.PairClass: TClass; +begin + Result := RowClass; +end; + +class function TcxVerticalGridCustomRowHelper.ProducerClass: TcxVerticalGridReportLinkCustomRowProducerClass; +begin + Result := TcxVerticalGridReportLinkCustomRowProducer; +end; + +class procedure TcxVerticalGridCustomRowHelper.Register; +begin + dxVerticalGridRowHelperFactory.Register(Self); +end; + +class procedure TcxVerticalGridCustomRowHelper.Unregister; +begin + dxVerticalGridRowHelperFactory.Unregister(Self); +end; + +function TcxVerticalGridCustomRowHelper.Properties(Index: Integer): TcxCustomRowProperties; +begin + Result := GetRowProperties(Index); +end; + +function TcxVerticalGridCustomRowHelper.Row: TcxCustomRow; +begin + Result := FRow; +end; + +class function TcxVerticalGridCustomRowHelper.RowClass: TcxCustomRowClass; +begin + Result := TcxCustomRow; +end; + +class function TcxVerticalGridCustomRowHelper.RowPlaceClass: TcxVerticalGridCustomRowPlaceClass; +begin + Result := TcxVerticalGridCustomRowPlace; +end; + +function TcxVerticalGridCustomRowHelper.Adapter: TcxCustomVerticalGridAdapter; +begin + Result := FAdapter; +end; + +function TcxVerticalGridCustomRowHelper.GetEditProperties(Index, RecordIndex: Integer): TcxCustomEditProperties; +begin + Result := nil; +end; + +function TcxVerticalGridCustomRowHelper.GetHasHeaderImage(Index: Integer): Boolean; +begin + Result := (Adapter.Images <> nil) and (ImageIndexes[Index] > -1) and (ImageIndexes[Index] < Adapter.Images.Count); +end; + +function TcxVerticalGridCustomRowHelper.GetHasHeaderSeparators: Boolean; +begin + Result := False; +end; + +function TcxVerticalGridCustomRowHelper.GetHasValueSeparators: Boolean; +begin + Result := False; +end; + +function TcxVerticalGridCustomRowHelper.GetHeaderAlignmentHorz(Index: Integer): TdxTextAlignX; +begin + Result := taLeft; +end; + +function TcxVerticalGridCustomRowHelper.GetHeaderAlignmentVert(Index: Integer): TdxTextAlignY; +begin + Result := taCenterY; +end; + +function TcxVerticalGridCustomRowHelper.GetHeaderCaption(Index: Integer): string; +begin + Result := ''; +end; + +function TcxVerticalGridCustomRowHelper.GetImageIndex(Index: Integer): Integer; +begin + Result := -1; +end; + +function TcxVerticalGridCustomRowHelper.GetIndentCount: Integer; +begin + Result := Row.Level + 1; +end; + +function TcxVerticalGridCustomRowHelper.GetItemCount: Integer; +begin + Result := 1; +end; + +function TcxVerticalGridCustomRowHelper.GetRecordMinWidth: Integer; +begin + Result := DefaultIndentWidth; +end; + +function TcxVerticalGridCustomRowHelper.GetRowProperties(Index: Integer): TcxCustomRowProperties; +begin + Result := CustomRow_GetProperties(Row); +end; + +function TcxVerticalGridCustomRowHelper.GetDisplayText(Index, RecordIndex: Integer): string; +begin + Result := ''; +end; + +function TcxVerticalGridCustomRowHelper.GetSeparatorsAlignmentVert: TcxAlignmentVert; +begin + Result := vaCenter; +end; + +function TcxVerticalGridCustomRowHelper.GetValue(Index, RecordIndex: Integer): TcxEditValue; +begin + Result := ''; +end; + +{ TcxVerticalGridCategoryRowHelper } + +class function TcxVerticalGridCategoryRowHelper.ProducerClass: TcxVerticalGridReportLinkCustomRowProducerClass; +begin + Result := TcxVerticalGridReportLinkCategoryRowProducer; +end; + +function TcxVerticalGridCategoryRowHelper.Properties(Index: Integer): TcxCaptionRowProperties; +begin + Result := Row.Properties; +end; + +function TcxVerticalGridCategoryRowHelper.Row: TcxCategoryRow; +begin + Result := inherited Row as TcxCategoryRow; +end; + +class function TcxVerticalGridCategoryRowHelper.RowClass: TcxCustomRowClass; +begin + Result := TcxCategoryRow; +end; + +class function TcxVerticalGridCategoryRowHelper.RowPlaceClass: TcxVerticalGridCustomRowPlaceClass; +begin + Result := TcxVerticalGridCategoryRowPlace; +end; + +function TcxVerticalGridCategoryRowHelper.GetCaption: string; +begin + Result := HeaderCaptions[0]; +end; + +function TcxVerticalGridCategoryRowHelper.GetHeaderAlignmentHorz(Index: Integer): TdxTextAlignX; +begin + Result := TextAlignXMap[Properties(Index).HeaderAlignmentHorz]; +end; + +function TcxVerticalGridCategoryRowHelper.GetHeaderAlignmentVert(Index: Integer): TdxTextAlignY; +begin + Result := TextAlignYMap[Properties(Index).HeaderAlignmentVert]; +end; + +function TcxVerticalGridCategoryRowHelper.GetHeaderCaption(Index: Integer): string; +begin + Result := Properties(Index).Caption; +end; + +function TcxVerticalGridCategoryRowHelper.GetImageIndex(Index: Integer): Integer; +begin + Result := Properties(Index).ImageIndex; +end; + +{ TcxVerticalGridCustomEditorRowHelper } + +class function TcxVerticalGridCustomEditorRowHelper.ProducerClass: TcxVerticalGridReportLinkCustomRowProducerClass; +begin + Result := TcxVerticalGridReportLinkCustomEditorRowProducer; +end; + +function TcxVerticalGridCustomEditorRowHelper.Properties(Index: Integer): TcxCustomEditorRowProperties; +begin + Result := TcxCustomEditorRowProperties(inherited Properties(Index)); +end; + +function TcxVerticalGridCustomEditorRowHelper.Row: TcxCustomEditorRow; +begin + Result := inherited Row as TcxCustomEditorRow; +end; + +class function TcxVerticalGridCustomEditorRowHelper.RowClass: TcxCustomRowClass; +begin + Result := TcxCustomEditorRow; +end; + +class function TcxVerticalGridCustomEditorRowHelper.RowPlaceClass: TcxVerticalGridCustomRowPlaceClass; +begin + Result := TcxVerticalGridCustomEditorRowPlace; +end; + +function TcxVerticalGridCustomEditorRowHelper.GetEditProperties(Index, RecordIndex: Integer): TcxCustomEditProperties; +begin + Result := TcxCustomEditorRowProperties(Properties(Index)).DisplayEditProperties[RecordIndex]; +end; + +function TcxVerticalGridCustomEditorRowHelper.GetHeaderAlignmentHorz(Index: Integer): TdxTextAlignX; +begin + Result := TextAlignXMap[Properties(Index).HeaderAlignmentHorz]; +end; + +function TcxVerticalGridCustomEditorRowHelper.GetHeaderAlignmentVert(Index: Integer): TdxTextAlignY; +begin + Result := TextAlignYMap[Properties(Index).HeaderAlignmentVert]; +end; + +function TcxVerticalGridCustomEditorRowHelper.GetHeaderCaption(Index: Integer): string; +begin + Result := Properties(Index).Caption; +end; + +function TcxVerticalGridCustomEditorRowHelper.GetImageIndex(Index: Integer): Integer; +begin + Result := Properties(Index).ImageIndex; +end; + +function TcxVerticalGridCustomEditorRowHelper.GetDisplayText(Index, RecordIndex: Integer): string; +begin + Result := Properties(Index).DisplayTexts[RecordIndex]; +end; + +function TcxVerticalGridCustomEditorRowHelper.GetRecordMinWidth: Integer; +begin + Result := Adapter.ValueMinWidth; +end; + +function TcxVerticalGridCustomEditorRowHelper.GetValue(Index, RecordIndex: Integer): TcxEditValue; +begin + Result := Properties(Index).Values[RecordIndex]; +end; + +{ TcxVerticalGridEditorRowHelper } + +function TcxVerticalGridEditorRowHelper.Properties(Index: Integer): TcxEditorRowProperties; +begin + Result := Row.Properties; +end; + +function TcxVerticalGridEditorRowHelper.Row: TcxEditorRow; +begin + Result := inherited Row as TcxEditorRow; +end; + +class function TcxVerticalGridEditorRowHelper.RowClass: TcxCustomRowClass; +begin + Result := TcxEditorRow; +end; + +{ TcxVerticalGridDBEditorRowHelper } + +function TcxVerticalGridDBEditorRowHelper.Properties(Index: Integer): TcxDBEditorRowProperties; +begin + Result := Row.Properties; +end; + +function TcxVerticalGridDBEditorRowHelper.Row: TcxDBEditorRow; +begin + Result := inherited Row as TcxDBEditorRow; +end; + +class function TcxVerticalGridDBEditorRowHelper.RowClass: TcxCustomRowClass; +begin + Result := TcxDBEditorRow; +end; + +{ TcxVerticalGridCustomMultiEditorRowHelper } + +class function TcxVerticalGridCustomMultiEditorRowHelper.ProducerClass: TcxVerticalGridReportLinkCustomRowProducerClass; +begin + Result := TcxVerticalGridReportLinkCustomMultiEditorRowProducer; +end; + +function TcxVerticalGridCustomMultiEditorRowHelper.Properties(Index: Integer): TcxEditorRowItemProperties; +begin + Result := TcxEditorRowItemProperties(GetRowProperties(Index)); +end; + +function TcxVerticalGridCustomMultiEditorRowHelper.RootProperties: TcxMultiEditorRowProperties; +begin + Result := CustomMultiEditorRow_GetProperties(Row); +end; + +function TcxVerticalGridCustomMultiEditorRowHelper.Row: TcxCustomMultiEditorRow; +begin + Result := inherited Row as TcxCustomMultiEditorRow; +end; + +class function TcxVerticalGridCustomMultiEditorRowHelper.RowClass: TcxCustomRowClass; +begin + Result := TcxCustomMultiEditorRow; +end; + +class function TcxVerticalGridCustomMultiEditorRowHelper.RowPlaceClass: TcxVerticalGridCustomRowPlaceClass; +begin + Result := TcxVerticalGridCustomMultiEditorRowPlace; +end; + +function TcxVerticalGridCustomMultiEditorRowHelper.GetEditProperties(Index, RecordIndex: Integer): TcxCustomEditProperties; +begin + Result := TcxCustomEditorRowProperties(Properties(Index)).DisplayEditProperties[RecordIndex]; +end; + +function TcxVerticalGridCustomMultiEditorRowHelper.GetHasHeaderSeparators: Boolean; +begin + Result := RootProperties.SeparatorKind = skString; +end; + +function TcxVerticalGridCustomMultiEditorRowHelper.GetHasValueSeparators: Boolean; +begin + Result := RootProperties.SeparatorKind = skString; +end; + +function TcxVerticalGridCustomMultiEditorRowHelper.GetHeaderAlignmentHorz(Index: Integer): TdxTextAlignX; +begin + Result := TextAlignXMap[Properties(Index).HeaderAlignmentHorz]; +end; + +function TcxVerticalGridCustomMultiEditorRowHelper.GetHeaderAlignmentVert(Index: Integer): TdxTextAlignY; +begin + Result := TextAlignYMap[Properties(Index).HeaderAlignmentVert]; +end; + +function TcxVerticalGridCustomMultiEditorRowHelper.GetHeaderCaption(Index: Integer): string; +begin + Result := Properties(Index).Caption; +end; + +function TcxVerticalGridCustomMultiEditorRowHelper.GetImageIndex(Index: Integer): Integer; +begin + Result := Properties(Index).ImageIndex; +end; + +function TcxVerticalGridCustomMultiEditorRowHelper.GetItemCount: Integer; +begin + Result := RootProperties.Editors.Count; +end; + +function TcxVerticalGridCustomMultiEditorRowHelper.GetRecordMinWidth: Integer; +begin + Result := Adapter.ValueMinWidth * ItemCount; +end; + +function TcxVerticalGridCustomMultiEditorRowHelper.GetRowProperties(Index: Integer): TcxCustomRowProperties; +begin + Result := RootProperties.Editors[Index]; +end; + +function TcxVerticalGridCustomMultiEditorRowHelper.GetDisplayText(Index, RecordIndex: Integer): string; +begin + Result := Properties(Index).DisplayTexts[RecordIndex]; +end; + +function TcxVerticalGridCustomMultiEditorRowHelper.GetHeaderSeparatorCount: Integer; +begin + if HasValueSeparators then + Result := ItemCount - 1 + else + Result := 0; +end; + +function TcxVerticalGridCustomMultiEditorRowHelper.GetHeaderSeparatorText(Index: Integer): string; +begin + Result := RootProperties.SeparatorString; +end; + +function TcxVerticalGridCustomMultiEditorRowHelper.GetSeparatorsAlignmentVert: TcxAlignmentVert; +begin + Result := RootProperties.SeparatorAlignmentVert; +end; + +function TcxVerticalGridCustomMultiEditorRowHelper.GetValue(Index, RecordIndex: Integer): TcxEditValue; +begin + Result := Properties(Index).Values[RecordIndex]; +end; + +function TcxVerticalGridCustomMultiEditorRowHelper.GetValueSeparatorCount: Integer; +begin + if HasValueSeparators then + Result := ItemCount - 1 + else + Result := 0; +end; + +function TcxVerticalGridCustomMultiEditorRowHelper.GetValueSeparatorText(Index: Integer): string; +begin + Result := RootProperties.SeparatorString; +end; + +{ TcxVerticalGridRowHelperCache } + +constructor TcxVerticalGridRowHelperCache.Create(AnAdapter: TcxCustomVerticalGridAdapter); +begin + inherited Create; + FAdapter := AnAdapter; +end; + +function TcxVerticalGridRowHelperCache.IndexOf(Row: TcxCustomRow): Integer; +begin + for Result := 0 to Count - 1 do + if Items[Result].RowClass = Row.ClassType then Exit; + + Result := Add(dxVerticalGridRowHelperFactory.HelperClasses[Row].Create(Adapter)); +end; + +function TcxVerticalGridRowHelperCache.GetHelper(Row: TcxCustomRow): TcxVerticalGridCustomRowHelper; +begin + Result := Items[IndexOf(Row)]; + Result.Initialize(Row); +end; + +function TcxVerticalGridRowHelperCache.GetItem(Index: Integer): TcxVerticalGridCustomRowHelper; +begin + Result := TcxVerticalGridCustomRowHelper(inherited Items[Index]); +end; + +{ TcxVerticalGridReportLinkProducerCache } + +constructor TcxVerticalGridReportLinkProducerCache.Create(ABuilder: TcxCustomVerticalGridReportLinkBuilder); +begin + inherited Create; + FBuilder := ABuilder; +end; + +function TcxVerticalGridReportLinkProducerCache.IndexOf(AProducerClass: TcxVerticalGridReportLinkCustomRowProducerClass): Integer; +begin + for Result := 0 to Count - 1 do + if Items[Result].ClassType = AProducerClass then Exit; + + Result := Add(AProducerClass.Create(Builder)); +end; + +function TcxVerticalGridReportLinkProducerCache.GetProducer(ProducerClass: TcxVerticalGridReportLinkCustomRowProducerClass): TcxVerticalGridReportLinkCustomRowProducer; +begin + Result := Items[IndexOf(ProducerClass)]; +end; + +function TcxVerticalGridReportLinkProducerCache.GetItem(Index: Integer): TcxVerticalGridReportLinkCustomRowProducer; +begin + Result := TcxVerticalGridReportLinkCustomRowProducer(inherited Items[Index]); +end; + +{ TcxCustomVerticalGridReportLinkBuilder } + +constructor TcxCustomVerticalGridReportLinkBuilder.Create(AReportLink: TcxCustomVerticalGridReportLink); +begin + inherited Create; + FReportLink := AReportLink; + FAdapter := AdapterClass.Create(Self); + FFormatter := FormatterClass.Create(Self); + FProducerCache := TcxVerticalGridReportLinkProducerCache.Create(Self); + FReportRows := TList.Create; +end; + +destructor TcxCustomVerticalGridReportLinkBuilder.Destroy; +begin + FreeAndNil(FWrapSeparatorProducer); + FreeAndNil(FReportRows); + FreeAndNil(FProducerCache); + FreeAndNil(FFormatter); + FreeAndNil(FAdapter); + inherited; +end; + +procedure TcxCustomVerticalGridReportLinkBuilder.Build; +begin + BeforeBuilding; + try + DoBuild; + finally + AfterBuilding; + end; +end; + +procedure TcxCustomVerticalGridReportLinkBuilder.Progress(const APercentDone: Double); +begin + ReportLink.DoProgress(APercentDone); +end; + +function TcxCustomVerticalGridReportLinkBuilder.Adapter: TcxCustomVerticalGridAdapter; +begin + Result := FAdapter; +end; + +class function TcxCustomVerticalGridReportLinkBuilder.AdapterClass: TcxCustomVerticalGridAdapterClass; +begin + Result := TcxCustomVerticalGridAdapter; +end; + +function TcxCustomVerticalGridReportLinkBuilder.Formatter: TcxCustomVerticalGridReportLinkFormatter; +begin + Result := FFormatter; +end; + +class function TcxCustomVerticalGridReportLinkBuilder.FormatterClass: TcxCustomVerticalGridReportLinkFormatterClass; +begin + Result := TcxCustomVerticalGridReportLinkFormatter; +end; + +procedure TcxCustomVerticalGridReportLinkBuilder.AddReportRow(ARow: TdxReportCell); +begin + if ARow.Parent = ReportLink.ReportCells.Cells then + FReportRows.Add(ARow); +end; + +procedure TcxCustomVerticalGridReportLinkBuilder.AfterBuilding; +begin + Formatter.AfterBuilding; + Adapter.AfterBuilding; +end; + +procedure TcxCustomVerticalGridReportLinkBuilder.BeforeBuilding; +begin + Adapter.BeforeBuilding; + Formatter.BeforeBuilding; +end; + +procedure TcxCustomVerticalGridReportLinkBuilder.CreateRow(ARow: TcxCustomRow; AWrapIndex: Integer); +var + ReportRow: TdxReportCell; +begin + ReportRow := GetRowProducer(ARow).Produce(ReportLink.HostInfo, ARow, AWrapIndex); + AddReportRow(ReportRow); +end; + +procedure TcxCustomVerticalGridReportLinkBuilder.CreateRows; +var + I, J: Integer; + Row: TcxCustomRow; +begin + for I := 0 to Formatter.WrapCount - 1 do + begin + for J := 0 to Formatter.RowCount - 1 do + begin + Row := Formatter.Rows[J]; + CreateRow(Row, I); + Progress(100 * (I * Formatter.RowCount + J) / (Formatter.WrapCount * Formatter.RowCount)); + if IsAborted then Break; + end; + if IsAborted then Break; + if AreWrapSeparatorsNeeded and (I < Formatter.WrapCount - 1) then + CreateWrapSeparator(I); + end; +end; + +procedure TcxCustomVerticalGridReportLinkBuilder.CreateWrapSeparator(AWrapIndex: Integer); +var + ReportRow: TdxReportCell; +begin + ReportRow := GetWrapSeparatorProducer(AWrapIndex).Produce(ReportLink.HostInfo, AWrapIndex); + AddReportRow(ReportRow); +end; + +function TcxCustomVerticalGridReportLinkBuilder.GetRowProducer(ARow: TcxCustomRow): TcxVerticalGridReportLinkCustomRowProducer; +begin + Result := ProducerCache[GetRowProducerClass(ARow)] as TcxVerticalGridReportLinkCustomRowProducer; +end; + +function TcxCustomVerticalGridReportLinkBuilder.GetRowProducerClass(ARow: TcxCustomRow): TcxVerticalGridReportLinkCustomRowProducerClass; +begin + Result := Formatter.RowHelpers[ARow].ProducerClass; +end; + +function TcxCustomVerticalGridReportLinkBuilder.GetWrapSeparatorProducer(AWrapIndex: Integer): TcxVerticalGridReportLinkWrapSeparatorProducer; +begin + if FWrapSeparatorProducer = nil then + FWrapSeparatorProducer := GetWrapSeparatorProducerClass.Create(Self); + Result := FWrapSeparatorProducer; +end; + +function TcxCustomVerticalGridReportLinkBuilder.GetWrapSeparatorProducerClass: TcxVerticalGridReportLinkWrapSeparatorProducerClass; +begin + Result := TcxVerticalGridReportLinkWrapSeparatorProducer; +end; + +function TcxCustomVerticalGridReportLinkBuilder.AreWrapSeparatorsNeeded: Boolean; +begin + with ReportLink.OptionsPagination do + Result := ByRows or (ByWrapping and not OneWrappingPerPage); +end; + +procedure TcxCustomVerticalGridReportLinkBuilder.DoBuild; +begin + CreateRows; +end; + +function TcxCustomVerticalGridReportLinkBuilder.IsAborted: Boolean; +begin + Result := ReportLink.AbortBuilding; +end; + +function TcxCustomVerticalGridReportLinkBuilder.GetAvailableSiteWidth: Integer; +var + ControllerIntf: IdxReportLinkController; +begin + if ReportLink.IsAggregated and + Supports(TObject(ReportLink.Controller), IdxReportLinkController, ControllerIntf) then + with ControllerIntf.GetControlSiteBounds(ReportLink.VerticalGrid) do + Result := Bottom - Top - 1 + else + with ReportLink.RealPrinterPage.PaintRectPixels do + Result := Right - Left - 1; + Result := MulDiv(Result, 100, ReportLink.GetRealScaleFactor); +end; + +function TcxCustomVerticalGridReportLinkBuilder.GetAvailableWidth: Integer; +begin + if Formatter.AutoWidth then + Result := GetAvailableSiteWidth + else + with VerticalGrid.ClientBounds do + Result := Right - Left; +end; + +function TcxCustomVerticalGridReportLinkBuilder.GetHost: TdxReportCell; +begin + Result := ReportLink.ReportCells.Cells; +end; + +function TcxCustomVerticalGridReportLinkBuilder.GetReportCells: TdxReportCells; +begin + Result := ReportLink.ReportCells; +end; + +function TcxCustomVerticalGridReportLinkBuilder.GetReportRow(Index: Integer): TdxReportCell; +begin + Result := TdxReportCell(FReportRows[Index]); +end; + +function TcxCustomVerticalGridReportLinkBuilder.GetReportRowCount: Integer; +begin + Result := FReportRows.Count; +end; + +function TcxCustomVerticalGridReportLinkBuilder.GetVerticalGrid: TcxCustomVerticalGrid; +begin + Result := ReportLink.VerticalGrid; +end; + +{ TcxVerticalGridReportLinkBuilderHandler } + +constructor TcxVerticalGridReportLinkBuilderHandler.Create(ABuilder: TcxCustomVerticalGridReportLinkBuilder); +begin + inherited Create; + FBuilder := ABuilder; +end; + +function TcxVerticalGridReportLinkBuilderHandler.Builder: TcxCustomVerticalGridReportLinkBuilder; +begin + Result := FBuilder; +end; + +function TcxVerticalGridReportLinkBuilderHandler.GetReportLink: TcxCustomVerticalGridReportLink; +begin + Result := Builder.ReportLink; +end; + +{ TcxCustomVerticalGridAdapter } + +constructor TcxCustomVerticalGridAdapter.Create(ABuilder: TcxCustomVerticalGridReportLinkBuilder); +begin + inherited; + FHelperCache := TcxVerticalGridRowHelperCache.Create(Self); +end; + +destructor TcxCustomVerticalGridAdapter.Destroy; +begin + FreeAndNil(FHelperCache); + inherited; +end; + +procedure TcxCustomVerticalGridAdapter.AfterBuilding; +begin +end; + +procedure TcxCustomVerticalGridAdapter.BeforeBuilding; +begin +end; + +function TcxCustomVerticalGridAdapter.GetInterRecordsSpace: Integer; +begin + Result := 0; +end; + +function TcxCustomVerticalGridAdapter.GetProperties(ARow: TcxCustomRow; + AnIndex, ARecordIndex: Integer): TcxCustomEditProperties; +begin + Result := Helpers[ARow].GetEditProperties(AnIndex, ARecordIndex); +end; + +function TcxCustomVerticalGridAdapter.GetPropertiesClass(ARow: TcxCustomRow; + AnIndex, ARecordIndex: Integer): TcxCustomEditPropertiesClass; +begin + Result := TcxCustomEditPropertiesClass(GetProperties(ARow, AnIndex, ARecordIndex).ClassType); +end; + +function TcxCustomVerticalGridAdapter.GetCategoryViewParams(ARow: TcxCustomRow): TcxViewParams; +begin + Result := Styles.GetCategoryParams(ARow); + // v3.2 + if Result.Color = clWindow then + Result.Color := dxPSCore.dxDefaultContentColor; +end; + +function TcxCustomVerticalGridAdapter.GetContentViewParams(ARow: TcxCustomRow; + AnIndex, ARecordIndex: Integer): TcxViewParams; +var + Properties: TcxCustomEditorRowProperties; +begin + Properties := TcxCustomEditorRowProperties(Helpers[ARow].GetRowProperties(AnIndex)); + Result := Styles.GetContentParams(Properties, False, ARecordIndex); + // v3.2 + if Result.Color = clWindow then + Result.Color := dxPSCore.dxDefaultContentColor; +end; + +function TcxCustomVerticalGridAdapter.GetHeaderViewParams(ARow: TcxCustomRow): TcxViewParams; +begin + Result := Styles.GetHeaderParams(ARow); + // v3.2 + if Result.Color = clWindow then + Result.Color := dxPSCore.dxDefaultContentColor; +end; + +function TcxCustomVerticalGridAdapter.GetImageViewParams(ARow: TcxCustomRow): TcxViewParams; +begin + Result := GetHeaderViewParams(ARow); +end; + +function TcxCustomVerticalGridAdapter.GetIndentViewParams(ARow: TcxCustomRow): TcxViewParams; +begin + if ARow is TcxCategoryRow then + Result := GetCategoryViewParams(ARow) + else + Result := GetHeaderViewParams(ARow); +end; + +function TcxCustomVerticalGridAdapter.GetBackgroundBitmap(Index: Integer): TBitmap; +begin + Result := Styles.GetBitmap(Index); +end; + +function TcxCustomVerticalGridAdapter.GetRowIndentBackgroundBitmapIndex(ARow: TcxCustomRow; + ALevel: Integer): Integer; +const + BackgroundBitmapIndexes: array[Boolean] of Integer = (vgs_Header, vgs_Category); +begin + Result := BackgroundBitmapIndexes[GetRowParentAtLevel(ARow, ALevel) is TcxCategoryRow]; +end; + +function TcxCustomVerticalGridAdapter.HasBackgroundBitmap(Index: Integer): Boolean; +begin + Result := GetBackgroundBitmap(Index) <> nil; +end; + +procedure TcxCustomVerticalGridAdapter.FullExpand; +begin + VerticalGrid.FullExpand; +end; + +function TcxCustomVerticalGridAdapter.GetImageHeight(ARow: TcxCustomRow; AnIndex: Integer): Integer; +begin + if HasRowImage(ARow, AnIndex) then + Result := 1 + Images.Height + 1 + else + Result := 0; +end; + +function TcxCustomVerticalGridAdapter.GetImageWidth(ARow: TcxCustomRow; AnIndex: Integer): Integer; +begin + if HasRowImage(ARow, AnIndex) then + Result := 1 + Images.Width + 1 + else + Result := 0; +end; + +function TcxCustomVerticalGridAdapter.GetRowParentAtLevel(ARow: TcxCustomRow; + ALevel: Integer): TcxCustomRow; +begin + Result := ARow; + while ALevel > 0 do + begin + Result := Result.Parent; + Dec(ALevel); + end; +end; + +function TcxCustomVerticalGridAdapter.HasCategoryRowAsParentAtLevel(ARow: TcxCustomRow; + ALevel: Integer; ACheckFollow: Boolean): Boolean; +begin + while ALevel > 0 do + begin + ARow := ARow.Parent; + if ACheckFollow and (ARow is TcxCategoryRow) then + Break; + Dec(ALevel); + end; + Result := ARow is TcxCategoryRow; +end; + +function TcxCustomVerticalGridAdapter.HasRowImage(ARow: TcxCustomRow; AnIndex: Integer): Boolean; +var + Helper: TcxVerticalGridCustomRowHelper; +begin + Result := Images <> nil; + if Result and (ARow <> nil) and not MakeSpaceForEmptyImage then + begin + Helper := Helpers[ARow]; + Result := (Helper.ImageIndexes[AnIndex] > -1) and (Helper.ImageIndexes[AnIndex] < Images.Count); + end; +end; + +function TcxCustomVerticalGridAdapter.IsRowLastChildAtLevel(ARow: TcxCustomRow; ALevel: Integer): Boolean; +begin + while (ALevel > 0) and ARow.IsLastVisible do + begin + ARow := ARow.Parent; + Dec(ALevel); + end; + Result := ARow.IsLastVisible; +end; + +function TcxCustomVerticalGridAdapter.IsRowVisible(ARow: TcxCustomRow): Boolean; +begin + Result := VerticalGrid.IsRowVisible(ARow); +end; + +function TcxCustomVerticalGridAdapter.GetCellAutoHeight: Boolean; +begin + Result := OptionsView.CellAutoHeight; +end; + +function TcxCustomVerticalGridAdapter.GetCellEndEllipsis: Boolean; +begin + Result := OptionsView.CellEndEllipsis; +end; + +function TcxCustomVerticalGridAdapter.GetCellMultiline: Boolean; +begin + Result := OptionsView.CellAutoHeight; +end; + +function TcxCustomVerticalGridAdapter.GetDataController: TcxCustomDataController; +begin + Result := CustomVerticalGrid_GetDataController(VerticalGrid); +end; + +function TcxCustomVerticalGridAdapter.GetDefaultRowHeight: Integer; +begin + Result := OptionsView.RowHeight; +end; + +function TcxCustomVerticalGridAdapter.GetFirstRecordIndex: Integer; +begin + if VerticalGrid.ViewInfo <> nil then + Result := VerticalGrid.ViewInfo.FirstVisibleRecordIndex + else + Result := 0; +end; + +function TcxCustomVerticalGridAdapter.GetGridLinesColor: TColor; +begin + Result := OptionsView.GridLineColor; +end; + +function TcxCustomVerticalGridAdapter.GetHeaderAvailableWidth(Row: TcxCustomRow): Integer; +begin + Result := HeaderWidth - IndentAreas[Row]; +end; + +function TcxCustomVerticalGridAdapter.GetHeaderMinWidth: Integer; +begin + Result := OptionsView.RowHeaderMinWidth; +end; + +function TcxCustomVerticalGridAdapter.GetHeaderWidth: Integer; +begin + Result := OptionsView.RowHeaderWidth; +end; + +function TcxCustomVerticalGridAdapter.GetHelper(Row: TcxCustomRow): TcxVerticalGridCustomRowHelper; +begin + Result := FHelperCache[Row]; +end; + +function TcxCustomVerticalGridAdapter.GetImages: TCustomImageList; +begin + Result := VerticalGrid.Images; +end; + +function TcxCustomVerticalGridAdapter.GetIndentArea(Row: TcxCustomRow): Integer; +begin + Result := IndentCounts[Row] * IndentWidth; +end; + +function TcxCustomVerticalGridAdapter.GetIndentCount(Row: TcxCustomRow): Integer; +begin + Result := Helpers[Row].IndentCount; +end; + +function TcxCustomVerticalGridAdapter.GetIndentWidth: Integer; +begin + Result := GetImageWidth(nil, 0); + if Result = 0 then + Result := DefaultIndentWidth; +end; + +function TcxCustomVerticalGridAdapter.GetMakeSpaceForEmptyImage: Boolean; +begin + Result := OptionsView.ShowEmptyRowImage; +end; + +function TcxCustomVerticalGridAdapter.GetOptionsView: TcxvgOptionsView; +begin + Result := VerticalGrid.OptionsView; +end; + +function TcxCustomVerticalGridAdapter.GetPaintStyle: TcxvgPaintStyle; +begin + Result := OptionsView.PaintStyle; +end; + +function TcxCustomVerticalGridAdapter.GetRecordCount: Integer; +begin + Result := CustomVerticalGrid_GetRecordCount(VerticalGrid); +end; + +function TcxCustomVerticalGridAdapter.GetRecordMinWidth(RecordIndex: Integer): Integer; +var + I, V: Integer; + Row: TcxCustomRow; +begin + Result := 0; + for I := 0 to RowCount - 1 do + begin + Row := Rows[I]; + if IsRowVisible(Row) then + begin + V := Helpers[Row].RecordMinWidth; + if Result < V then Result := V; + end; + end; +end; + +function TcxCustomVerticalGridAdapter.GetRecordWidth(RecordCount: Integer): Integer; +begin + // v3.1 + if LayoutStyle in [lsMultiRecordView, lsBandsView] then + //if RecordCount <> 1 then + Result := OptionsView.ValueWidth + else + Result := VerticalGrid.ClientWidth - HeaderWidth; +end; + +function TcxCustomVerticalGridAdapter.GetRow(Index: Integer): TcxCustomRow; +begin + Result := VerticalGrid.Rows[Index]; +end; + +function TcxCustomVerticalGridAdapter.GetRowCount: Integer; +begin + Result := VerticalGrid.Rows.Count; +end; + +function TcxCustomVerticalGridAdapter.GetRowHeight(Row: TcxCustomRow): Integer; +begin + Result := VerticalGrid.ViewInfo.CalcRowHeight(Row); +end; + +function TcxCustomVerticalGridAdapter.GetShowHeaders: Boolean; +begin + Result := OptionsView.ShowHeaders; +end; + +function TcxCustomVerticalGridAdapter.GetShowHorzGridLines: Boolean; +begin + Result := OptionsView.GridLines in [vglBoth, vglHorizontal]; +end; + +function TcxCustomVerticalGridAdapter.GetShowVertGridLines: Boolean; +begin + Result := OptionsView.GridLines in [vglBoth, vglVertical]; +end; + +function TcxCustomVerticalGridAdapter.GetStyles: TcxVerticalGridStyles; +begin + Result := VerticalGrid.Styles; +end; + +function TcxCustomVerticalGridAdapter.GetValueMinWidth: Integer; +begin + Result := OptionsView.ValueMinWidth; +end; + +function TcxCustomVerticalGridAdapter.GetVerticalGrid: TcxCustomVerticalGrid; +begin + Result := Builder.VerticalGrid; +end; + +{ TcxCustomVerticalGridReportLinkFormatter } + +constructor TcxCustomVerticalGridReportLinkFormatter.Create(ABuilder: TcxCustomVerticalGridReportLinkBuilder); +begin + inherited; + FFont := TFont.Create; + FHeaderWidth := -1; + FInterRecordsSpace := -1; + FLookAndFeelItems := TList.Create; + FRecordWidths := TList.Create; + FRowHeights := TList.Create; + FRowPlaces := TList.Create; + FRows := TList.Create; + FTransparentColor := dxPSCore.dxDefaultContentColor; + FViewWidths := TList.Create; + FWrappedRecordStartIndexes := TList.Create; +end; + +destructor TcxCustomVerticalGridReportLinkFormatter.Destroy; +begin + FreeAndNilRowPlaces; + FreeAndNil(FViewWidths); + FreeAndNil(FWrappedRecordStartIndexes); + FreeAndNil(FRows); + FreeAndNil(FRowHeights); + FreeAndNil(FRecordWidths); + FreeAndNil(FLookAndFeelItems); + FreeAndNil(FFont); + inherited; +end; + +function TcxCustomVerticalGridReportLinkFormatter.Adapter: TcxCustomVerticalGridAdapter; +begin + Result := Builder.Adapter; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.DoInitializeHost(AHost: TdxReportCell); +begin + AHost.CellSides := []; + AHost.Transparent := True; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.DoInitializeRowImage(ARow: TcxCustomRow; + AnItem: TdxReportCellGraphic; AnIndex: Integer); +begin + SetViewParams(AnItem, GetRowImageViewParams(ARow, AnIndex)); + if HasBackgroundBitmap(vgs_Content) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(vgs_Content); + + AnItem.DrawMode := gdmCenter; + AnItem.ImageIndex := RowHelpers[ARow].ImageIndexes[AnIndex]; + AnItem.ImageList := Adapter.Images; + AnItem.ImageTransparent := True; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowImageCellSides(ARow: TcxCustomRow): TdxCellSides; +begin + Result := csTopBottom; + Result := FixupHorzCellSides(ARow, Result); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowImageClass: TdxReportCellGraphicClass; +begin + Result := TdxReportCellGraphic; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowImageViewParams(ARow: TcxCustomRow; + AnIndex: Integer): TdxReportItemViewParams; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetHeaderParams(ARow, Result.NativeParams) + else + Result.NativeParams := Adapter.GetImageViewParams(ARow); + + Result.CellSides := GetRowImageCellSides(ARow); + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); // ReportLink.FixedTransparent; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.DoInitializeRowIndent(ARow: TcxCustomRow; + AnItem: TdxReportCellExpandButton; AnIndex, AnIndentCount: Integer); +var + BackgroundBitmapIndex: Integer; +begin + SetViewParams(AnItem, GetRowIndentViewParams(ARow, AnIndex, AnIndentCount)); + BackgroundBitmapIndex := Adapter.GetRowIndentBackgroundBitmapIndex(ARow, AnIndentCount - AnIndex - 1); + if HasBackgroundBitmap(BackgroundBitmapIndex) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(BackgroundBitmapIndex); + + AnItem.Data := MakeCustomDrawCodeData(cxVerticalGridRowIndentID, AnIndex, 0); + AnItem.ShowButton := (AnIndex = AnIndentCount - 1) and OptionsView.ExpandButtons and ARow.HasChildren; + if AnItem.ShowButton then + DoInitializeExpandButton(ARow, AnItem, AnIndex, AnIndentCount); +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.DoInitializeExpandButton(ARow: TcxCustomRow; + AnItem: TdxReportCellExpandButton; AnIndex, AnIndentCount: Integer); +begin + with AnItem do + begin + ButtonBorder3D := ReportLink.Effects3D; + ButtonBorder3DSoft := ReportLink.Soft3D; + ButtonExpanded := ARow.Expanded; + ButtonInteriorColor := ExpandButtonColors[ARow]; + ButtonSize := ExpandButtonSize; + ButtonTransparent := False;//IsColorTransparent(ButtonInteriorColor); + end; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.DoReportLinkInitializeRowIndent(ARow: TcxCustomRow; + AnItem: TdxReportCellExpandButton; AnIndex: Integer); +begin + ReportLink.DoInitializeRowIndentCell(ARow, AnIndex, AnItem); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowIndentCellSides(ARow: TcxCustomRow; + AnIndex, AnIndentCount: Integer): TdxCellSides; +var + Level: Integer; + NextRow: TcxCustomRow; +begin + if Adapter.PaintStyle = psdotNet then + begin + Result := []; + Level := AnIndentCount - AnIndex - 1; + + if (ARow is TcxCategoryRow) and ((AnIndex = AnIndentCount - 1) or + ((AnIndex = AnIndentCount - 2) and not Adapter.HasCategoryRowAsParentAtLevel(ARow, Level, False))) then + Include(Result, csTop); + if not (ARow is TcxCategoryRow) and not Adapter.HasCategoryRowAsParentAtLevel(ARow, Level, True) then + Result := Result + csTopBottom; + if not (ARow is TcxCategoryRow) and Adapter.IsRowLastChildAtLevel(ARow, Level) and + Adapter.HasCategoryRowAsParentAtLevel(ARow, Level, False) then + Include(Result, csBottom); + if IsLastRow(ARow) then + Include(Result, csBottom); + + if (AnIndex = 0) or ((ARow is TcxCategoryRow) and (AnIndex = AnIndentCount - 1)) then + Include(Result, csLeft); + if (AnIndex <> AnIndentCount - 1) and Adapter.HasCategoryRowAsParentAtLevel(ARow, Level, False) then + Result := Result + csLeftRight; + if AnIndex = AnIndentCount - 1 then + begin + if (ARow is TcxCategoryRow) and ARow.HasChildren then + begin + NextRow := GetNextRow(ARow); + if (NextRow <> nil) and (NextRow.Level > ARow.Level) then + Result := Result - [csBottom, csRight]; + end; + if not (ARow is TcxCategoryRow) then + Include(Result, csLeft); + end; + end + else + begin + Result := csTopBottom; + if AnIndex = 0 then Include(Result, csLeft); + end; + + Result := FixupHorzCellSides(ARow, Result); + if not ShowVertGridLines then + begin + Exclude(Result, csRight); + if AnIndex <> 0 then Exclude(Result, csLeft); + end; + if (AnIndex = 0) and not ShowBorders then + Exclude(Result, csLeft); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowIndentClass: TdxReportCellExpandButtonClass; +begin + Result := TdxReportCellExpandButton; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowIndentViewParams(ARow: TcxCustomRow; + AnIndex, AnIndentCount: Integer): TdxReportItemViewParams; +var + ParentRow: TcxCustomRow; +begin + ParentRow := Adapter.GetRowParentAtLevel(ARow, AnIndentCount - AnIndex - 1); + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetIndentParams(ParentRow, Result.NativeParams) + else + Result.NativeParams := Adapter.GetIndentViewParams(ParentRow); + + Result.CellSides := GetRowIndentCellSides(ARow, AnIndex, AnIndentCount); + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.FixedTransparent +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.DoInitializeCategoryRow(ARow: TcxCategoryRow; + AnItem: TdxReportCellImage); +var + Helper: TcxVerticalGridCustomRowHelper; +begin + SetViewParams(AnItem, GetCategoryRowViewParams(ARow)); + if HasBackgroundBitmap(vgs_Category) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(vgs_Category); + + Helper := RowHelpers[ARow]; + with AnItem as TdxReportCellImage do + begin + Data := MakeCustomDrawCodeData(cxVerticalGridCategoryRowID, 0, 0); + EndEllipsis := Adapter.CellEndEllipsis and not ReportLink.OptionsSize.BestFit; + if Helper.HasHeaderImages[0] then + begin + ImageIndex := Helper.ImageIndexes[0]; + ImageList := Adapter.Images; + ImageLayout := ilImageCenterLeft; + end; + Multiline := False; + Text := Helper.HeaderCaptions[0]; + TextAlignX := Helper.HeaderAlignmentHorzs[0]; + TextAlignY := Helper.HeaderAlignmentVerts[0]; + end; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.DoInitializeRowReportRow(ARow: TcxCustomRow; + AReportRow: TdxReportCell); +begin + AReportRow.CellSides := []; + AReportRow.Data := Integer(ARow); + AReportRow.Transparent := True; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.DoInitializeRowHeader(ARow: TcxCustomRow; + AnItem: TdxReportCellImage; AnIndex: Integer); +var + Helper: TcxVerticalGridCustomRowHelper; +begin + SetViewParams(AnItem, GetRowHeaderViewParams(ARow, AnIndex)); + if HasBackgroundBitmap(vgs_Header) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(vgs_Header); + + Helper := RowHelpers[ARow]; + with AnItem as TdxReportCellImage do + begin + Data := MakeCustomDrawCodeData(cxVerticalGridRowHeaderID, AnIndex, 0); + EndEllipsis := Adapter.CellEndEllipsis and not ReportLink.OptionsSize.BestFit; + ImageIndex := Helper.ImageIndexes[AnIndex]; + ImageList := Adapter.Images; + ImageLayout := ilImageCenterLeft; + MakeSpaceForEmptyImage := Adapter.MakeSpaceForEmptyImage; + Multiline := False; + Text := Helper.HeaderCaptions[AnIndex]; + TextAlignX := Helper.HeaderAlignmentHorzs[AnIndex]; + TextAlignY := Helper.HeaderAlignmentVerts[AnIndex]; + end; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.DoInitializeRowValue(ARow: TcxCustomRow; + AnItem: TAbstractdxReportCellData; AnIndex, ARecordIndex: Integer); +var + Properties: TcxCustomEditProperties; + ViewParams: TdxReportItemViewParams; + CellValue: TcxEditValue; +begin + Properties := Adapter.GetProperties(ARow, AnIndex, ARecordIndex); + ViewParams := GetRowValueViewParams(ARow, AnIndex, ARecordIndex); + CellValue := GetCellValue(ARow, Properties, AnIndex, ARecordIndex); + dxPScxCommon.dxPSDataMaps.InitializeItem(AnItem, Properties, CellValue, Self, ViewParams, False, ARecordIndex, + TcxCustomRowAccess(ARow).GetEditContainer(AnIndex)); + dxPScxCommon.dxPSDataMaps.GetImageLists(Properties, ReportLink.AppendImageList); + + SetViewParams(AnItem, ViewParams); + if HasBackgroundBitmap(vgs_Content) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(vgs_Content); + + AnItem.Data := MakeCustomDrawCodeData(cxVerticalGridRowValueID, AnIndex, ARecordIndex); +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.DoReportLinkInitializeRowHeader(ARow: TcxCustomRow; + AnItem: TdxReportCellImage; AnIndex: Integer); +begin + ReportLink.DoInitializeRowHeaderCell(ARow, AnIndex, AnItem); +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.DoReportLinkInitializeRowValue(ARow: TcxCustomRow; + AnItem: TAbstractdxReportCellData; AnIndex, ARecordIndex: Integer); +begin + ReportLink.DoInitializeRowValueCell(ARow, AnIndex, ARecordIndex, AnItem); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetCategoryRowCellSides(ARow: TcxCustomRow): TdxCellSides; +begin + Result := [csTop, csRight, csBottom]; + if not ShowHeaders then + Include(Result, csLeft); + if not ShowBorders then + Exclude(Result, csRight); + Result := FixupHorzCellSides(ARow, Result); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetCategoryRowClass(ARow: TcxCustomRow): TdxReportCellImageClass; +begin + Result := TdxReportCellImage; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetCategoryRowViewParams(ARow: TcxCustomRow): TdxReportItemViewParams; +begin + FillChar(Result, 0, SizeOf(Result)); + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetCategoryParams(ARow, Result.NativeParams) + else + Result.NativeParams := Adapter.GetCategoryViewParams(ARow); + + Result.CellSides := GetCategoryRowCellSides(ARow); + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.Transparent; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetCellValue(ARow: TcxCustomRow; + AProperties: TcxCustomEditProperties; AnIndex, ARecordIndex: Integer): TcxEditValue; +var + Helper: TcxVerticalGridCustomRowHelper; +begin + Helper := RowHelpers[ARow]; + if AProperties.GetEditValueSource(False) = evsValue then + Result := Helper.Values[AnIndex, ARecordIndex] + else + Result := Helper.DisplayTexts[AnIndex, ARecordIndex]; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowHeaderCellSides(ARow: TcxCustomRow; + AnIndex: Integer): TdxCellSides; +var + Helper: TcxVerticalGridCustomRowHelper; +begin + Helper := RowHelpers[ARow]; + + Result := csAll; + if Helper.HasHeaderSeparators and (Helper.ItemCount <> 1) then + begin + if AnIndex <> 0 then + Exclude(Result, csLeft); + if AnIndex <> Helper.ItemCount - 1 then + Exclude(Result, csRight); + end; + if AnIndex = 0 then + Exclude(Result, csLeft); + if not ShowVertGridLines then + Result := Result - csLeftRight; + Result := FixupHorzCellSides(ARow, Result); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowHeaderClass(ARow: TcxCustomRow): TdxReportCellImageClass; +begin + Result := TdxReportCellImage; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowHeaderViewParams(ARow: TcxCustomRow; + AnIndex: Integer): TdxReportItemViewParams; +begin + FillChar(Result, 0, SizeOf(Result)); + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetHeaderParams(ARow, Result.NativeParams) + else + Result.NativeParams := Adapter.GetHeaderViewParams(ARow); + + Result.CellSides := GetRowHeaderCellSides(ARow, AnIndex); + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.Transparent; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowValueCellSides(ARow: TcxCustomRow; + AnIndex, ARecordIndex: Integer): TdxCellSides; +var + Helper: TcxVerticalGridCustomRowHelper; +begin + Helper := RowHelpers[ARow]; + + Result := csAll; + if Helper.HasValueSeparators and (Helper.ItemCount <> 1) then + begin + if AnIndex <> 0 then + Exclude(Result, csLeft); + if AnIndex <> Helper.ItemCount - 1 then + Exclude(Result, csRight); + end; + if not ShowVertGridLines then + begin + Exclude(Result, csLeft); + if AnIndex <> Helper.ItemCount - 1 then + Exclude(Result, csRight); + end; + if not ShowBorders and (AnIndex = Helper.ItemCount - 1) then + Exclude(Result, csRight); + Result := FixupHorzCellSides(ARow, Result); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowValueClass(ARow: TcxCustomRow; + AnIndex, ARecordIndex: Integer): TdxReportCellDataClass; +begin + Result := dxPScxCommon.dxPSDataMaps.ItemClass(Adapter.GetProperties(ARow, AnIndex, ARecordIndex)); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowValueViewParams(ARow: TcxCustomRow; + AnIndex, ARecordIndex: Integer): TdxReportItemViewParams; +begin + FillChar(Result, 0, SizeOf(Result)); + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetContentParams(ARow, AnIndex, ARecordIndex, Result.NativeParams) + else + Result.NativeParams := Adapter.GetContentViewParams(ARow, AnIndex, ARecordIndex); + + Result.CellSides := GetRowValueCellSides(ARow, AnIndex, ARecordIndex); + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.Transparent; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.DoInitializeRowHeaderSeparator(ARow: TcxCustomMultiEditorRow; + AnItem: TdxReportCellString; AnIndex: Integer); +begin + SetViewParams(AnItem, GetRowHeaderSeparatorViewParams(ARow, AnIndex)); + if HasBackgroundBitmap(vgs_Header) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(vgs_Header); + + with TdxReportCellString(AnItem) do + begin + Data := MakeCustomDrawCodeData(cxVerticalGridRowHeaderSeparatorID, AnIndex, 0); + EndEllipsis := False; + Multiline := False; + TextAlignX := taLeft; + TextAlignY := dxPScxCommon.TextAlignYMap[RowHelpers[ARow].SeparatorsAlignmentVert]; + end; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.DoInitializeRowValueSeparator(ARow: TcxCustomMultiEditorRow; + AnItem: TdxReportCellString; AnIndex, ARecordIndex: Integer); +begin + SetViewParams(AnItem, GetRowValueSeparatorViewParams(ARow, AnIndex, ARecordIndex)); + if HasBackgroundBitmap(vgs_Content) then + AnItem.BackgroundBitmapIndex := GetBackgroundBitmapIndex(vgs_Content); + + with TdxReportCellString(AnItem) do + begin + Data := MakeCustomDrawCodeData(cxVerticalGridRowValueSeparatorID, AnIndex, ARecordIndex); + EndEllipsis := False; + Multiline := False; + TextAlignX := taLeft; + TextAlignY := dxPScxCommon.TextAlignYMap[RowHelpers[ARow].SeparatorsAlignmentVert]; + end; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.DoReportLinkInitializeRowHeaderSeparator(ARow: TcxCustomMultiEditorRow; + AnItem: TdxReportCellString; AnIndex: Integer); +begin + ReportLink.DoInitializeRowHeaderSeparatorCell(ARow, AnIndex, AnItem); +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.DoReportLinkInitializeRowValueSeparator(ARow: TcxCustomMultiEditorRow; + AnItem: TdxReportCellString; AnIndex, ARecordIndex: Integer); +begin + ReportLink.DoInitializeRowValueSeparatorCell(ARow, AnIndex, ARecordIndex, AnItem); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowHeaderSeparatorCellSides(ARow: TcxCustomMultiEditorRow): TdxCellSides; +begin + Result := FixupHorzCellSides(ARow, csTopBottom); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowHeaderSeparatorClass(ARow: TcxCustomMultiEditorRow): TdxReportCellStringClass; +begin + Result := TdxReportCellString; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowHeaderSeparatorViewParams(ARow: TcxCustomMultiEditorRow; + AnIndex: Integer): TdxReportItemViewParams; +begin + FillChar(Result, 0, SizeOf(Result)); + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetHeaderParams(ARow, Result.NativeParams) + else + Result.NativeParams := Adapter.GetHeaderViewParams(ARow); + + Result.CellSides := GetRowHeaderSeparatorCellSides(ARow); + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.Transparent; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowValueSeparatorCellSides(ARow: TcxCustomMultiEditorRow): TdxCellSides; +begin + Result := FixupHorzCellSides(ARow, csTopBottom); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowValueSeparatorClass(ARow: TcxCustomMultiEditorRow): TdxReportCellStringClass; +begin + Result := TdxReportCellString; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowValueSeparatorViewParams(ARow: TcxCustomMultiEditorRow; + AnIndex, ARecordIndex: Integer): TdxReportItemViewParams; +begin + FillChar(Result, 0, SizeOf(Result)); + if ReportLink.OptionsFormatting.UseNativeStyles then + ReportLink.Styles.GetContentParams(ARow, AnIndex, ARecordIndex, Result.NativeParams) + else + Result.NativeParams := Adapter.GetContentViewParams(ARow, AnIndex, ARecordIndex); + + Result.CellSides := GetRowValueSeparatorCellSides(ARow); + Result.FontStyle := []; + Result.Transparent := IsColorTransparent(Result.NativeParams.Color); //ReportLink.Transparent; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.DoInitializeWrapSeparatorItem(AnItem: TdxReportCellString; + AWrapIndex: Integer); +begin + AnItem.CellSides := []; + AnItem.Data := AWrapIndex; + AnItem.Transparent := True; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.DoInitializeWrapSeparatorRow(ARow: TdxReportCell); +begin + ARow.CellSides := []; + ARow.Transparent := True; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetWrapSeparatorClass: TdxReportCellStringClass; +begin + Result := TdxReportCellString; +end; + +function TcxCustomVerticalGridReportLinkFormatter.QueryInterface(const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +function TcxCustomVerticalGridReportLinkFormatter._AddRef: Integer; +begin + Result := 1; +end; + +function TcxCustomVerticalGridReportLinkFormatter._Release: Integer; +begin + Result := 1; +end; + +function TcxCustomVerticalGridReportLinkFormatter.IdxPSCellParams_GetAutoHeight: Boolean; +begin + Result := Adapter.CellAutoHeight; +end; + +function TcxCustomVerticalGridReportLinkFormatter.IdxPSCellParams_GetDC: HDC; +begin + Result := Self.DC; +end; + +function TcxCustomVerticalGridReportLinkFormatter.IdxPSCellParams_GetDisplayGraphicsAsText: Boolean; +begin + Result := ReportLink.OptionsRefinements.DisplayGraphicsAsText; +end; + +function TcxCustomVerticalGridReportLinkFormatter.IdxPSCellParams_GetEndEllipsis: Boolean; +begin + Result := Adapter.CellEndEllipsis and not ReportLink.OptionsSize.BestFit; +end; + +function TcxCustomVerticalGridReportLinkFormatter.IdxPSCellParams_GetFlatCheckMarks: Boolean; +begin + Result := ReportLink.OptionsRefinements.FlatCheckMarks; +end; + +function TcxCustomVerticalGridReportLinkFormatter.IdxPSCellParams_GetGraphicsText: string; +begin + Result := ReportLink.OptionsRefinements.GraphicsText; +end; + +function TcxCustomVerticalGridReportLinkFormatter.IdxPSCellParams_GetMultiline: Boolean; +begin + Result := Adapter.CellMultiline; +end; + +function TcxCustomVerticalGridReportLinkFormatter.IdxPSCellParams_GetTransparentGraphics: Boolean; +begin + Result := ReportLink.OptionsRefinements.TransparentGraphics; +end; + +function TcxCustomVerticalGridReportLinkFormatter.IdxPSCellParams2_GetPreviewMarginLeft: Integer; +begin + Result := 2; +end; + +function TcxCustomVerticalGridReportLinkFormatter.IdxPSCellParams2_GetPreviewMarginRight: Integer; +begin + Result := 2; +end; + +function TcxCustomVerticalGridReportLinkFormatter.IdxPSCellParams2_GetPreviewMaxHeight: Integer; +begin + Result := -1; +end; + +function TcxCustomVerticalGridReportLinkFormatter.IdxPSCellParams2_GetPreviewMaxLineCount: Integer; +begin + Result := -1; +end; + +function TcxCustomVerticalGridReportLinkFormatter.IdxPSCellParams2_GetRichEditGraphicClass: TGraphicClass; +const + GraphicClasses: array[Boolean] of TGraphicClass = (TMetafile, TBitmap); +begin + Result := GraphicClasses[IdxPSCellParams2_GetRichEditTransparent]; +end; + +function TcxCustomVerticalGridReportLinkFormatter.IdxPSCellParams2_GetRichEditTransparent: Boolean; +begin + {$IFDEF DXVER500} + Result := ReportLink.OptionsRefinements.TransparentRichEdits; + {$ELSE} + Result := False; + {$ENDIF} +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.AddDelimiters; +begin + AddHorizontalDelimiters; + AddVerticalDelimiters; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.AddHorizontalDelimiters; +var + I, J: Integer; +begin + for I := 0 to WrapCount - 1 do + for J := 0 to RowCount - 1 do + RowPlaces[I, J].AddDelimiters(ReportLink); +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.AddVerticalDelimiters; +var + I: Integer; + Row: TdxReportCell; +begin + for I := 0 to Builder.ReportRowCount - 1 do + begin + Row := Builder.ReportRows[I]; + ReportLink.AddVerticalDelimiter(Row); + if ReportLink.OptionsPagination.ByWrapping and IsLastRow(GetRowByReportRow(Row)) then + ReportLink.AddVerticalHardDelimiter(Row); + end; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.AfterBuilding; +begin + if not Builder.IsAborted then + begin + FormatLookAndFeelItems; + AddDelimiters; + Builder.ReportCells.BorderColor := GridLinesColor; + end; + + if AreRecordsNeededUnloading then + UnloadRecords; + FIsPrevGridMode := False; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.BeforeBuilding; +begin + FIsPrevGridMode := DataController.IsGridMode; + if AreRecordsNeededLoading then + LoadRecords; + if ReportLink.OptionsExpanding.AutoExpandRows then + Adapter.FullExpand; + CreateRowList; + InitializeWrappedRecordIndexes; + InitializeRecordWidths; + InitializeRowHeights; + Calculate; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetAreRecordsNeededLoading: Boolean; +begin + Result := False; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetAreRecordsNeededUnloading: Boolean; +begin + Result := False; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetFirstInternalRecordIndex: Integer; +begin + Result := 0; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetInternalRecordCount: Integer; +begin + Result := Adapter.RecordCount; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.LoadRecords; +begin +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.UnloadRecords; +begin +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.AddWrappedRecordStartIndex(Value: Integer); +begin + FWrappedRecordStartIndexes.Add(TObject(Value)); +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.Calculate; +begin + CreateRowPlaces; + + if ReportLink.OptionsSize.BestFit and not ReportLink.OptionsSize.AutoWidth then + CalculateBestFit; + if ReportLink.OptionsSize.WrapRecords and (InternalRecordCount > 1) then + begin + CalculateRecordCounts; + CreateRowPlaces; + end; + if ReportLink.OptionsSize.AutoWidth then + CalculateRecordAutoWidths; + + CalculateViewWidths; + CalculateRowHeights; + CalculateRowPlaces; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.CalculateBestFit; +var + RecordMinWidth, I, V, J, RecordMaxWidth: Integer; +begin + RecordMinWidth := CalculatedMinWidth; + + if ShowHeaders then + begin + for I := 0 to RowCount - 1 do + begin + V := RowPlaces[0, I].CalculatedHeaderWidth; + if HeaderWidth < V then HeaderWidth := V; + end; + Dec(RecordMinWidth, HeaderWidth); + end; + + RecordMaxWidth := 0; + for I := WrappedRecordStartIndexes[0] to WrappedRecordStopIndexes[WrapCount - 1] do // v3.03 {0 to InternalRecordCount - 1} + begin + for J := 0 to RowCount - 1 do + begin + V := RowPlaces[0, J].CalculatedRecordWidth(I); + if RecordWidths[I] < V then RecordWidths[I] := V; + end; + if RecordWidths[I] < RecordMinWidth then + RecordWidths[I] := RecordMinWidth; + if RecordMaxWidth < RecordWidths[I] then + RecordMaxWidth := RecordWidths[I]; + end; + + if ReportLink.OptionsSize.KeepSameRecordWidths then + for I := WrappedRecordStartIndexes[0] to WrappedRecordStopIndexes[WrapCount - 1] do // v3.03 {0 to InternalRecordCount - 1} + RecordWidths[I] := RecordMaxWidth; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.CalculateHeight(const AParams: TdxReportItemViewParams; + var AHeight: Integer); + + function CalculatedPatternHeight: Integer; + begin + Result := Renderer.CalcTextPatternHeight(DC, AParams.NativeParams.Font); + end; + +var + Value: Integer; +begin + Value := CalculatedPatternHeight; + if Value > AHeight then AHeight := Value; +end; + +function TcxCustomVerticalGridReportLinkFormatter.CalculatedMinWidth: Integer; +var + I, V: Integer; +begin + Result := 0; + for I := 0 to RowCount - 1 do + begin + V := RowPlaces[0, I].CalculatedMinWidth; + if Result < V then Result := V; + end; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.CalculateRecordCounts; +var + V, RecordIndex, RecordCount: Integer; +begin + V := Builder.AvailableSiteWidth - HeaderWidth; + if V > 0 then + begin + RecordIndex := 0; + repeat + RecordCount := 0; + while (V > 0) and (RecordIndex < InternalRecordCount) do + begin + Dec(V, RecordWidths[RecordIndex]); + Inc(RecordIndex); + Inc(RecordCount); + if V > 0 then + begin + Dec(V, InterRecordsSpace); + if (V < 0) and (RecordCount <> 1) then + Inc(RecordIndex); + end; + end; + if V <= 0 then + begin + if RecordCount > 1 then Dec(RecordIndex); + AddWrappedRecordStartIndex(RecordIndex); + V := Builder.AvailableSiteWidth - HeaderWidth; + end; + until RecordIndex > InternalRecordCount - 1; + end + else + for RecordIndex := 1 to InternalRecordCount - 1 do + AddWrappedRecordStartIndex(RecordIndex); + AddWrappedRecordStartIndex(InternalRecordCount); +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.CalculateRowHeights; +var + I, RowHeight: Integer; + Row: TcxCustomRow; +begin + for I := 0 to RowCount - 1 do + begin + Row := Rows[I]; + RowHeight := Adapter.RowHeights[Row]; + if RowHeight = -1 then + RowHeight := RowPlaces[0, IndexOfRow(Row)].CalculatedMinHeight; + RowHeights[Row] := RowHeight; + end; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.CalculateRecordAutoWidths; + + procedure AssignAutoWidthItem(AnItem: TcxAutoWidthItem; AMinWidth, AWidth: Integer); + begin + AnItem.MinWidth := AMinWidth; + AnItem.Width := AWidth; + end; + + function GetAvailableSiteWidth(ARecordCount: Integer): Integer; + begin + Result := Builder.AvailableSiteWidth - InterRecordsSpace * (ARecordCount - 1) - HeaderWidth; + end; + +var + I, J: Integer; + AutoWidthObject: TcxAutoWidthObject; +begin + if InternalRecordCount <> 1 then + for I := 0 to WrapCount - 1 do + begin + AutoWidthObject := TcxAutoWidthObject.Create(RecordCounts[I]); + try + for J := WrappedRecordStartIndexes[I] to WrappedRecordStopIndexes[I] do + AssignAutoWidthItem(AutoWidthObject.AddItem, RecordMinWidths[J], RecordWidths[J]); + + AutoWidthObject.AvailableWidth := GetAvailableSiteWidth(RecordCounts[I]); + AutoWidthObject.Calculate; + + for J := WrappedRecordStartIndexes[I] to WrappedRecordStopIndexes[I] do + RecordWidths[J] := AutoWidthObject[J - WrappedRecordStartIndexes[I]].AutoWidth; + finally + AutoWidthObject.Free; + end; + end + else + for I := WrappedRecordStartIndexes[0] to WrappedRecordStopIndexes[WrapCount - 1] do // v3.03 {0 to InternalRecordCount - 1} + RecordWidths[I] := GetAvailableSiteWidth(InternalRecordCount); +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.CalculateRowPlaces; +var + I, J: Integer; +begin + for I := 0 to WrapCount - 1 do + for J := 0 to RowCount - 1 do + RowPlaces[I, J].Calculate; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.CalculateViewWidths; +var + I, J, V: Integer; +begin + FViewWidths.Count := WrapCount; + for I := 0 to WrapCount - 1 do + begin + V := HeaderWidth; + for J := WrappedRecordStartIndexes[I] to WrappedRecordStopIndexes[I] do + begin + Inc(V, RecordWidths[J]); + if J < WrappedRecordStopIndexes[I] then + Inc(V, InterRecordsSpace); + end; + ViewWidths[I] := V; + end; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.CreateRowList; +var + I: Integer; + Row: TcxCustomRow; +begin + FRows.Clear; + for I := 0 to Adapter.RowCount - 1 do + begin + Row := Adapter.Rows[I]; + if Adapter.IsRowVisible(Row) then FRows.Add(Row); + end; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.CreateRowPlaces; +var + I, J: Integer; + Place: TcxVerticalGridCustomRowPlace; +begin + ClearRowPlaces; + for I := 0 to WrapCount - 1 do + for J := 0 to RowCount - 1 do + begin + Place := CreateRowPlace(Rows[J], I); + FRowPlaces.Add(Place); + end; +end; + +function TcxCustomVerticalGridReportLinkFormatter.CreateRowPlace(ARow: TcxCustomRow; + AWrapIndex: Integer): TcxVerticalGridCustomRowPlace; +begin + Result := RowHelpers[ARow].RowPlaceClass.Create(Self, ARow, AWrapIndex); +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.InitializeRecordWidths; +var + I: Integer; +begin + FRecordWidths.Count := InternalRecordCount; + for I := WrappedRecordStartIndexes[0] to WrappedRecordStopIndexes[WrapCount - 1] do // v3.03 {0 to InternalRecordCount - 1} + RecordWidths[I] := -1; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.InitializeRowHeights; +var + I: Integer; +begin + FRowHeights.Count := RowCount; + for I := 0 to RowCount - 1 do + RowHeights[Rows[I]] := -1; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.InitializeWrappedRecordIndexes; +begin + AddWrappedRecordStartIndex(FirstInternalRecordIndex); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetBackgroundBitmap(Index: Integer): TBitmap; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + Result := ReportLink.Styles.GetBitmap(MapStyleBackgroundBitmapIndex(Index)) + else + Result := Adapter.GetBackgroundBitmap(Index); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetBackgroundBitmapIndex(Index: Integer): Integer; +begin + Result := ReportLink.AddBackgroundBitmapToPool(GetBackgroundBitmap(Index)); +end; + +function TcxCustomVerticalGridReportLinkFormatter.HasBackgroundBitmap(Index: Integer): Boolean; +var + Bitmap: TBitmap; +begin + if not ReportLink.OptionsFormatting.SuppressBackgroundBitmaps then + begin + Bitmap := GetBackgroundBitmap(Index); + Result := (Bitmap <> nil) and not Bitmap.Empty; + end + else + Result := False; +end; + +function TcxCustomVerticalGridReportLinkFormatter.MapStyleBackgroundBitmapIndex(AVerticalGridBackgroundBitmapIndex: Integer): Integer; +begin + case AVerticalGridBackgroundBitmapIndex of + vgs_Category: + Result := vspsVGridCategory; + vgs_Content: + Result := vspsVGridContent; + vgs_Header: + Result := vspsVGridHeader; + else + Result := 0; + end; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetCategoryRowFont(ARow: TcxCustomRow): TFont; +begin + Result := GetCategoryRowViewParams(ARow).NativeParams.Font; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowHeaderFont(ARow: TcxCustomRow; + AnIndex: Integer): TFont; +begin + Result := GetRowHeaderViewParams(ARow, AnIndex).NativeParams.Font; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowHeaderSeparatorsFont(ARow: TcxCustomRow; + AnIndex: Integer): TFont; +begin + Result := GetRowHeaderViewParams(ARow, AnIndex).NativeParams.Font; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowValueFont(ARow: TcxCustomRow; + AnIndex, ARecordIndex: Integer): TFont; +begin + Result := GetRowValueViewParams(ARow, AnIndex, ARecordIndex).NativeParams.Font; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowValueSeparatorsFont(ARow: TcxCustomRow; + AnIndex, ARecordIndex: Integer): TFont; +begin + Result := GetRowValueViewParams(ARow, AnIndex, ARecordIndex).NativeParams.Font; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.ClearRowPlaces; +var + I: Integer; +begin + for I := 0 to FRowPlaces.Count - 1 do + TObject(FRowPlaces[I]).Free; + FRowPlaces.Clear; +end; + +function TcxCustomVerticalGridReportLinkFormatter.FixupHorzCellSides(ARow: TcxCustomRow; + ACellSides: TdxCellSides): TdxCellSides; +begin + Result := ACellSides; + if not ShowHorzGridLines then + begin + if not IsFirstRow(ARow) then Exclude(Result, csTop); + if not IsLastRow(ARow) then Exclude(Result, csBottom); + end; + if not ShowBorders then + begin + if IsFirstRow(ARow) then Exclude(Result, csTop); + if IsLastRow(ARow) then Exclude(Result, csBottom); + end; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.FreeAndNilRowPlaces; +begin + ClearRowPlaces; + FreeAndNil(FRowPlaces); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetImageHeight(ARow: TcxCustomRow; + ACellIndex: Integer): Integer; +begin + Result := Adapter.GetImageHeight(ARow, ACellIndex); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetImageWidth(ARow: TcxCustomRow; + ACellIndex: Integer): Integer; +begin + Result := Adapter.GetImageWidth(ARow, ACellIndex); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetNextRow(ARow: TcxCustomRow): TcxCustomRow; +var + Index: Integer; +begin + Index := IndexOfRow(ARow); + if Index < RowCount - 1 then + Result := Rows[Index + 1] + else + Result := nil; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowByReportRow(ARow: TdxReportCell): TcxCustomRow; +begin + Result := TcxCustomRow(ARow.Cells[0].Data); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetPrevRow(ARow: TcxCustomRow): TcxCustomRow; +var + Index: Integer; +begin + Index := IndexOfRow(ARow); + if Index > 0 then + Result := Rows[Index - 1] + else + Result := nil; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetStyleFontIndex(const AParams: TdxReportItemViewParams): Integer; +begin + if AParams.NativeParams.Font <> nil then + begin + FFont.Assign(AParams.NativeParams.Font); + if not dxPSUtl.dxIsTrueTypeFont(FFont) then + FFont.Name := ReportLink.Font.Name; + FFont.Color := ColorToRGB(AParams.NativeParams.TextColor); + FFont.Style := FFont.Style + AParams.FontStyle; + Result := ReportLink.AddFontToPool(FFont); + end + else + Result := 0; +end; + +function TcxCustomVerticalGridReportLinkFormatter.IndexOfRow(ARow: TcxCustomRow): Integer; +begin + Result := FRows.IndexOf(ARow); +end; + +function TcxCustomVerticalGridReportLinkFormatter.IsColorTransparent(AColor: TColor): Boolean; +begin + Result := ColorToRGB(AColor) = ColorToRGB(TransparentColor); +end; + +function TcxCustomVerticalGridReportLinkFormatter.IsFirstRow(ARow: TcxCustomRow): Boolean; +begin + Result := ARow = FRows.First; +end; + +function TcxCustomVerticalGridReportLinkFormatter.IsLastRow(ARow: TcxCustomRow): Boolean; +begin + Result := ARow = FRows.Last; +end; + +function TcxCustomVerticalGridReportLinkFormatter.MakeCustomDrawCodeData(AnAttribute: TcxVerticalGridAttributeID; + ACellIndex, ARecordIndex: Integer): Integer; +begin + Result := ReportLink.MakeCustomDrawCodeData(AnAttribute, ACellIndex, ARecordIndex); +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.RegisterLookAndFeelItem(AnItem: TdxReportVisualItem; + AEdgeStyle: TdxCellEdgeStyle); +begin + AnItem.EdgeMode := cem3DEffects; + AnItem.Edge3DStyle := AEdgeStyle; + FLookAndFeelItems.Add(AnItem); +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.SetViewParams(AnItem: TdxReportVisualItem; + const AParams: TdxReportItemViewParams); +begin + with AnItem do + begin + CellSides := AParams.CellSides; + Color := ColorToRGB(AParams.NativeParams.Color); + FontIndex := GetStyleFontIndex(AParams); + Transparent := AParams.Transparent; + end; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetAutoWidth: Boolean; +begin + Result := ReportLink.OptionsSize.AutoWidth; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetDataController: TcxCustomDataController; +begin + Result := Adapter.DataController; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetDC: HDC; +begin + Result := ReportLink.ScreenDC; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetExpandButtonColor(Row: TcxCustomRow): TColor; +begin + if Row is TcxCategoryRow then + Result := GetCategoryRowViewParams(Row).NativeParams.Color + else + Result := ExpandButtonInteriorColor; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetExpandButtonSize: Integer; +begin + Result := DefaultExpandButtonSize; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetGridLinesColor: TColor; +begin + Result := ReportLink.OptionsFormatting.GridLineColor; + if Result = clDefault then + Result := Adapter.GridLinesColor; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetHeaderAvailableWidth(Row: TcxCustomRow): Integer; +begin + if ShowHeaders then + if HeaderWidth <> -1 then + begin + Result := HeaderWidth - IndentAreas[Row]; + if Result < 0 then Result := 0; + end + else + Result := Adapter.HeaderAvailableWidths[Row] + else + Result := 0; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetHeaderMinWidth: Integer; +begin + Result := Adapter.HeaderMinWidth; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetHeaderWidth: Integer; +begin + if ShowHeaders then + if FHeaderWidth = -1 then + Result := Adapter.HeaderWidth + else + Result := FHeaderWidth + else + Result := 0; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetIndentArea(Row: TcxCustomRow): Integer; +begin + if ShowHeaders then + Result := Adapter.IndentAreas[Row] + else + Result := 0; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetInternalRecordWidth: Integer; +begin + Result := Adapter.RecordWidth[InternalRecordCount]; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetInterRecordsSpace: Integer; +begin + if FInterRecordsSpace = -1 then + Result := Adapter.InterRecordsSpace + else + Result := FInterRecordsSpace; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetLookAndFeelItem(Index: Integer): TdxReportVisualItem; +begin + Result := TdxReportVisualItem(FLookAndFeelItems[Index]); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetLookAndFeelItemCount: Integer; +begin + Result := FLookAndFeelItems.Count; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetOptionsView: TcxVerticalGridReportLinkOptionsView; +begin + Result := ReportLink.OptionsView; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRecordCount(Index: Integer): Integer; +begin + Result := WrappedRecordStopIndexes[Index] - WrappedRecordStartIndexes[Index] + 1; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetInternalIndexByRecordIndex(RecordIndex: Integer): Integer; +begin + Result := RecordIndex - FirstInternalRecordIndex; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRecordMinWidth(RecordIndex: Integer): Integer; +begin + Result := Adapter.RecordMinWidths[RecordIndex]; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRecordWidth(RecordIndex: Integer): Integer; +begin + Result := Integer(FRecordWidths[InternalIndexesByRecordIndex[RecordIndex]]); + if Result = -1 then + Result := InternalRecordWidth; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRow(Index: Integer): TcxCustomRow; +begin + Result := TcxCustomRow(FRows[Index]); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowCount: Integer; +begin + Result := FRows.Count; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowHeight(Row: TcxCustomRow): Integer; +begin + Result := Integer(FRowHeights[IndexOfRow(Row)]); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowHelper(Row: TcxCustomRow): TcxVerticalGridCustomRowHelper; +begin + Result := Adapter.Helpers[Row]; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowPlace(WrapIndex, Index: Integer): TcxVerticalGridCustomRowPlace; +begin + Result := FRowPlaces[RowPlaceFlatIndexes[WrapIndex, Index]]; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowPlaceByRow(Row: TcxCustomRow; WrapIndex: Integer): TcxVerticalGridCustomRowPlace; +begin + Result := RowPlaces[WrapIndex, IndexOfRow(Row)]; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowPlaceFlatIndex(WrapIndex, Index: Integer): Integer; +begin + Result := WrapIndex * RowCount + Index; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRowPlaceCount: Integer; +begin + Result := FRowPlaces.Count; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetRenderer: TdxPSReportRenderer; +begin + Result := ReportLink.Renderer; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetShowBorders: Boolean; +begin + Result := OptionsView.Borders; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetShowHeaders: Boolean; +begin + Result := OptionsView.Headers; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetShowHorzGridLines: Boolean; +begin + Result := Adapter.ShowHorzGridLines; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetShowVertGridLines: Boolean; +begin + Result := Adapter.ShowVertGridLines; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetViewMaxWidth: Integer; +var + I, V: Integer; +begin + Result := 0; + for I := 0 to WrapCount - 1 do + begin + V := ViewWidths[I]; + if Result < V then Result := V; + end; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetViewWidth(WrapIndex: Integer): Integer; +begin + Result := Integer(FViewWidths[WrapIndex]); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetWrapCount: Integer; +begin + Result := Max(1, FWrappedRecordStartIndexes.Count - 1); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetWrappedRecordStartIndex(Index: Integer): Integer; +begin + Result := Integer(FWrappedRecordStartIndexes[Index]); +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetWrappedRecordStopIndex(Index: Integer): Integer; +begin + if Index < WrapCount - 1 then + Result := WrappedRecordStartIndexes[Index + 1] - 1 + else + Result := WrappedRecordStartIndexes[0] + InternalRecordCount - 1; +end; + +function TcxCustomVerticalGridReportLinkFormatter.GetWrapSeparatorHeight: Integer; +begin + Result := ReportLink.OptionsSize.WrapSeparatorHeight; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.SetInterRecordsSpace(Value: Integer); +begin + if Value < 0 then Value := 0; + FInterRecordsSpace := Value; +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.SetRecordWidth(RecordIndex: Integer; Value: Integer); +begin + FRecordWidths[InternalIndexesByRecordIndex[RecordIndex]] := TObject(Value); +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.SetRowHeight(Row: TcxCustomRow; Value: Integer); +begin + FRowHeights[IndexOfRow(Row)] := TObject(Value); +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.SetViewWidth(WrapIndex: Integer; Value: Integer); +begin + FViewWidths[WrapIndex] := TObject(Value); +end; + +procedure TcxCustomVerticalGridReportLinkFormatter.FormatLookAndFeelItems; +const + Borders3D: array[TdxCellEdgeStyle, Boolean] of TdxPSCellBorderClass = + ((TdxPSCellRaisedBorder, TdxPSCellRaisedSoftBorder), + (TdxPSCellSunkenBorder, TdxPSCellSunkenSoftBorder)); +var + I: Integer; +begin + for I := 0 to LookAndFeelItemCount - 1 do + with LookAndFeelItems[I] do + if ReportLink.Effects3D then + BorderClass := Borders3D[Edge3DStyle, ReportLink.Soft3D] + else + BorderClass := TdxPSCellUltraFlatBorder; +end; + +{ TcxVerticalGridReportLinkOptionsExpanding } + +procedure TcxVerticalGridReportLinkOptionsExpanding.Assign(Source: TPersistent); +begin + if Source is TcxVerticalGridReportLinkOptionsExpanding then + with TcxVerticalGridReportLinkOptionsExpanding(Source) do + begin + Self.AutoExpandRows := AutoExpandRows; + end; + inherited; +end; + +procedure TcxVerticalGridReportLinkOptionsExpanding.RestoreDefaults; +begin + inherited; + AutoExpandRows := False; +end; + +function TcxVerticalGridReportLinkOptionsExpanding.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +function TcxVerticalGridReportLinkOptionsExpanding.GetReportLink: TcxCustomVerticalGridReportLink; +begin + Result := inherited ReportLink as TcxCustomVerticalGridReportLink; +end; + +procedure TcxVerticalGridReportLinkOptionsExpanding.SetAutoExpandRows(Value: Boolean); +begin + if FAutoExpandRows <> Value then + begin + FAutoExpandRows := Value; + Changed; + end; +end; + +{ TcxVerticalGridReportLinkOptionsFormatting } + +function TcxVerticalGridReportLinkOptionsFormatting.DesignerTabIndex: Integer; +begin + Result := 2; +end; + +function TcxVerticalGridReportLinkOptionsFormatting.GetReportLink: TcxCustomVerticalGridReportLink; +begin + Result := inherited ReportLink as TcxCustomVerticalGridReportLink; +end; + +{ TcxVerticalGridReportLinkOptionsPagination } + +procedure TcxVerticalGridReportLinkOptionsPagination.Assign(Source: TPersistent); +begin + if Source is TcxVerticalGridReportLinkOptionsPagination then + with TcxVerticalGridReportLinkOptionsPagination(Source) do + begin + Self.ByRows := ByRows; + Self.ByWrapping := ByWrapping; + Self.OneWrappingPerPage := OneWrappingPerPage; + end; + inherited; +end; + +procedure TcxVerticalGridReportLinkOptionsPagination.RestoreDefaults; +begin + inherited; + ByRows := True; + ByWrapping := True; + OneWrappingPerPage := False; +end; + +function TcxVerticalGridReportLinkOptionsPagination.DesignerTabIndex: Integer; +begin + Result := 2; +end; + +function TcxVerticalGridReportLinkOptionsPagination.GetReportLink: TcxCustomVerticalGridReportLink; +begin + Result := inherited ReportLink as TcxCustomVerticalGridReportLink; +end; + +procedure TcxVerticalGridReportLinkOptionsPagination.SetByRows(Value: Boolean); +begin + if FByRows <> Value then + begin + FByRows := Value; + Changed; + end; +end; + +procedure TcxVerticalGridReportLinkOptionsPagination.SetByWrapping(Value: Boolean); +begin + if FByWrapping <> Value then + begin + FByWrapping := Value; + Changed; + end; +end; + +procedure TcxVerticalGridReportLinkOptionsPagination.SetOneWrappingPerPage(Value: Boolean); +begin + if FOneWrappingPerPage <> Value then + begin + FOneWrappingPerPage := Value; + if ByWrapping then Changed; + end; +end; + +{ TcxVerticalGridReportLinkOptionsRefinements } + +function TcxVerticalGridReportLinkOptionsRefinements.DesignerTabIndex: Integer; +begin + Result := 2; +end; + +function TcxVerticalGridReportLinkOptionsRefinements.GetReportLink: TcxCustomVerticalGridReportLink; +begin + Result := inherited ReportLink as TcxCustomVerticalGridReportLink; +end; + +function TcxVerticalGridReportLinkOptionsRefinements.GetSuppressBackgroundBitmaps: Boolean; +begin + Result := ReportLink.OptionsFormatting.SuppressBackgroundBitmaps; +end; + +procedure TcxVerticalGridReportLinkOptionsRefinements.SetSuppressBackgroundBitmaps(Value: Boolean); +begin + ReportLink.OptionsFormatting.SuppressBackgroundBitmaps := Value; +end; + +{ TcxVerticalGridReportLinkOptionsSize } + +procedure TcxVerticalGridReportLinkOptionsSize.Assign(Source: TPersistent); +begin + if Source is TcxVerticalGridReportLinkOptionsSize then + with TcxVerticalGridReportLinkOptionsSize(Source) do + begin + Self.BestFit := BestFit; + Self.KeepSameRecordWidths := KeepSameRecordWidths; + Self.WrapRecords := WrapRecords; + Self.WrapSeparatorHeight := WrapSeparatorHeight; + end; + inherited; +end; + +procedure TcxVerticalGridReportLinkOptionsSize.RestoreDefaults; +begin + inherited; + BestFit := False; + KeepSameRecordWidths := True; + WrapRecords := True; + WrapSeparatorHeight := 20; +end; + +function TcxVerticalGridReportLinkOptionsSize.DesignerTabIndex: Integer; +begin + Result := 1; +end; + +function TcxVerticalGridReportLinkOptionsSize.GetReportLink: TcxCustomVerticalGridReportLink; +begin + Result := inherited ReportLink as TcxCustomVerticalGridReportLink; +end; + +procedure TcxVerticalGridReportLinkOptionsSize.SetBestFit(Value: Boolean); +begin + if FBestFit <> Value then + begin + FBestFit := Value; + Changed; + end; +end; + +procedure TcxVerticalGridReportLinkOptionsSize.SetKeepSameRecordWidths(Value: Boolean); +begin + if FKeepSameRecordWidths <> Value then + begin + FKeepSameRecordWidths := Value; + if BestFit then Changed; + end; +end; + +procedure TcxVerticalGridReportLinkOptionsSize.SetWrapRecords(Value: Boolean); +begin + if FWrapRecords <> Value then + begin + FWrapRecords := Value; + Changed; + end; +end; + +procedure TcxVerticalGridReportLinkOptionsSize.SetWrapSeparatorHeight(Value: Integer); +begin + if Value < 0 then Value := 0; + if FWrapSeparatorHeight <> Value then + begin + FWrapSeparatorHeight := Value; + Changed; + end; +end; + +{ TcxVerticalGridReportLinkOptionsView } + +procedure TcxVerticalGridReportLinkOptionsView.Assign(Source: TPersistent); +begin + if Source is TcxVerticalGridReportLinkOptionsView then + with TcxVerticalGridReportLinkOptionsView(Source) do + begin + Self.Borders := Borders; + Self.ExpandButtons := ExpandButtons; + Self.Headers := Headers; + Self.Mode := Mode; + end; + inherited; +end; + +procedure TcxVerticalGridReportLinkOptionsView.RestoreDefaults; +begin + inherited; + Borders := True; + ExpandButtons := True; + Headers := True; + Mode := vpmLoadedRecords; +end; + +function TcxVerticalGridReportLinkOptionsView.DesignerTabIndex: Integer; +begin + Result := 0; +end; + +function TcxVerticalGridReportLinkOptionsView.GetActualMode: TcxVerticalGridReportLinkPrintMode; +begin + Result := vpmLoadedRecords; // i.e. always equals 1 record for non Virtual(DB)VerticalGrid +end; + +function TcxVerticalGridReportLinkOptionsView.GetReportLink: TcxCustomVerticalGridReportLink; +begin + Result := inherited ReportLink as TcxCustomVerticalGridReportLink; +end; + +procedure TcxVerticalGridReportLinkOptionsView.SetBorders(Value: Boolean); +begin + if FBorders <> Value then + begin + FBorders := Value; + Changed; + end; +end; + +procedure TcxVerticalGridReportLinkOptionsView.SetExpandButtons(Value: Boolean); +begin + if FExpandButtons <> Value then + begin + FExpandButtons := Value; + Changed; + end; +end; + +procedure TcxVerticalGridReportLinkOptionsView.SetHeaders(Value: Boolean); +begin + if FHeaders <> Value then + begin + FHeaders := Value; + Changed; + end; +end; + +procedure TcxVerticalGridReportLinkOptionsView.SetMode(Value: TcxVerticalGridReportLinkPrintMode); +begin + if FMode <> Value then + begin + FMode := Value; + Changed; + end; +end; + +{ TcxVerticalGridReportLinkStyles } + +procedure TcxVerticalGridReportLinkStyles.Assign(Source: TPersistent); +begin + if Source is TcxVerticalGridReportLinkStyles then + with TcxVerticalGridReportLinkStyles(Source) do + begin + Self.Category := Category; + Self.Content := Content; + Self.Header := Header; + end; + inherited; +end; + +procedure TcxVerticalGridReportLinkStyles.GetCategoryParams(ARow: TcxCustomRow; + out AParams: TcxViewParams); +begin + GetViewParams(vspsVGridCategory, ARow, nil, AParams); +end; + +procedure TcxVerticalGridReportLinkStyles.GetContentParams(ARow: TcxCustomRow; + AnIndex, ARecordIndex: Integer; out AParams: TcxViewParams); +begin + GetViewParams(vspsVGridContent, ARow, nil, AParams); +end; + +procedure TcxVerticalGridReportLinkStyles.GetHeaderParams(ARow: TcxCustomRow; + out AParams: TcxViewParams); +begin + GetViewParams(vspsVGridHeader, nil, nil, AParams); +end; + +procedure TcxVerticalGridReportLinkStyles.GetIndentParams(ARow: TcxCustomRow; + out AParams: TcxViewParams); +const + StyleIndexes: array[Boolean] of Integer = (vspsVGridHeader, vspsVGridCategory); +begin + GetViewParams(StyleIndexes[ARow is TcxCategoryRow], ARow, nil, AParams) +end; + +function TcxVerticalGridReportLinkStyles.DesignerTabIndex: Integer; +begin + Result := 3; +end; + +procedure TcxVerticalGridReportLinkStyles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +const + FixedParts = [vspsVGridCategory, vspsVGridHeader]; +begin + inherited; + if ReportLink <> nil then + with AParams do + begin + if Index in FixedParts then + Color := dxPSCore.dxDefaultFixedColor + else + Color := dxPSCore.dxDefaultContentColor; + + if Index = vspsVGridCategory then + Font := ReportLink.CategoryFont + else + Font := ReportLink.Font; + + TextColor := Font.Color; + end; +end; + +class function TcxVerticalGridReportLinkStyles.GetStyleCaption(AnIndex: Integer): string; +begin + case AnIndex of + vspsVGridContent: + Result := cxGetResourceString(@sdxContentStyle); + vspsVGridHeader: + Result := cxGetResourceString(@sdxHeaderStyle); + else + Result := cxGetResourceString(@sdxCategoryStyle); + end; +end; + +function TcxVerticalGridReportLinkStyles.GetStyleIndexByCaption(const Caption: string): Integer; +begin + for Result := vspsVGridFirst to vspsVGridLast do + if dxPSUtl.dxSameText(Caption, GetStyleCaption(Result)) then + Exit; + Result := -1; +end; + +function TcxVerticalGridReportLinkStyles.GetReportLink: TcxCustomVerticalGridReportLink; +begin + Result := inherited ReportLink as TcxCustomVerticalGridReportLink; +end; + +{ TcxVerticalGridReportLinkStyleSheet } + +class function TcxVerticalGridReportLinkStyleSheet.GetStylesClass: TcxCustomStylesClass; +begin + Result := TcxVerticalGridReportLinkStyles; +end; + +function TcxVerticalGridReportLinkStyleSheet.GetStylesValue: TcxVerticalGridReportLinkStyles; +begin + if GetStyles is TcxVerticalGridReportLinkStyles then + Result := TcxVerticalGridReportLinkStyles(GetStyles) + else + Result := nil; +end; + +procedure TcxVerticalGridReportLinkStyleSheet.SetStylesValue(Value: TcxVerticalGridReportLinkStyles); +begin + SetStyles(Value); +end; + +{ TcxVerticalGridHostInfo } + +procedure TcxVerticalGridHostInfo.Initialize(AParent: TdxReportCell); +begin + FParent := AParent; +end; + +{ TcxCustomVerticalGridReportLink } + +constructor TcxCustomVerticalGridReportLink.Create(AOwner: TComponent); +begin + inherited; + FCategoryFont := TFont.Create; + CategoryFont := Font; + FDelimitersHardVert := TList.Create; + InternalRestoreDefaults; + LinkModified(False); +end; + +destructor TcxCustomVerticalGridReportLink.Destroy; +begin + FreeAndNil(FDelimitersHardVert); + FreeAndNil(FCategoryFont); + inherited; +end; + +procedure TcxCustomVerticalGridReportLink.ConstructReport(AReportCells: TdxReportCells); + + function HasData: Boolean; + begin + Result := VerticalGrid.HasVisibleRows; + end; + + procedure Build; + begin + FBuilder := CreateBuilder; + try + FBuilder.Build; + finally + FreeAndNil(FBuilder); + end; + end; + + procedure CalculateSizes; + + procedure CalculateReportPartSizes(ACell: TdxReportCell); + var + Width, I, V: Integer; + begin + if ACell.CellCount > 0 then + begin + Width := 0; + for I := 0 to ACell.CellCount - 1 do + begin + V := ACell.Cells[I].Width; + if Width < V then Width := V; + end; + ACell.BoundsRect := MakeRect(0, 0, Width, ACell[ACell.CellCount - 1].BoundsRect.Bottom); + end; + end; + + begin + CalculateReportPartSizes(AReportCells.Cells); + end; + +begin + if VerticalGrid = nil then Exit; + inherited; + if not HasData then Exit; + + PrepareConstruct; + try + Build; + if not AbortBuilding then CalculateSizes; + finally + UnprepareConstruct; + end; +end; + +procedure TcxCustomVerticalGridReportLink.ConvertCoords; +begin + inherited; + ConvertDelimiters(DelimitersHardVert); +end; + +procedure TcxCustomVerticalGridReportLink.CustomDraw(AItem: TAbstractdxReportCellData; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); +var + DrawInfo: TcxVerticalGridCellCustomDrawInfo; +begin + GetItemCustomDrawInfo(AItem, DrawInfo); + with DrawInfo do + case AttributeID of + cxVerticalGridCategoryRowID: + DoCustomDrawRowHeaderCell(ACanvas, Row, CellIndex, TdxReportCellImage(AItem), ADone); + cxVerticalGridRowHeaderID: + DoCustomDrawRowHeaderCell(ACanvas, Row, CellIndex, TdxReportCellImage(AItem), ADone); + cxVerticalGridRowHeaderSeparatorID: + DoCustomDrawRowHeaderSeparatorCell(ACanvas, Row, CellIndex, TdxReportCellString(AItem), ADone); + cxVerticalGridRowValueID: + DoCustomDrawRowValueCell(ACanvas, Row, CellIndex, RecordIndex, AItem, ADone); + cxVerticalGridRowValueSeparatorID: + DoCustomDrawRowValueSeparatorCell(ACanvas, Row, CellIndex, RecordIndex, TdxReportCellString(AItem), ADone); + cxVerticalGridRowIndentID: + DoCustomDrawRowIndentCell(ACanvas, Row, CellIndex, TdxReportCellExpandButton(AItem), ADone); + end; +end; + +procedure TcxCustomVerticalGridReportLink.FontChanged(Sender: TObject); +begin + if CategoryFont <> nil then CategoryFont := Font; + inherited; +end; + +function TcxCustomVerticalGridReportLink.GetBreakPagesByHardDelimiters: Boolean; +begin + Result := OptionsPagination.OneWrappingPerPage; +end; + +procedure TcxCustomVerticalGridReportLink.GetImageLists(AProc: TdxPSGetImageListProc); +begin + inherited; + AProc(VerticalGrid.Images); +end; + +function TcxCustomVerticalGridReportLink.GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; +begin + Result := (AUpdateCodes * uaMarginsVert <> []) and (OptionsSize.AutoWidth or OptionsSize.WrapRecords); +end; + +function TcxCustomVerticalGridReportLink.GetUseHardVertDelimiters: Boolean; +begin + Result := OptionsPagination.ByWrapping; +end; + +procedure TcxCustomVerticalGridReportLink.InternalRestoreFromOriginal; +begin + inherited; + if VerticalGrid <> nil then + begin + OptionsFormatting.LookAndFeelKind := VerticalGrid.LookAndFeel.Kind; + OptionsSize.AutoWidth := VerticalGrid.OptionsView.AutoScaleBands; + OptionsView.ExpandButtons := VerticalGrid.OptionsView.ShowButtons; + OptionsView.Headers := VerticalGrid.OptionsView.ShowHeaders; + end; +end; + +function TcxCustomVerticalGridReportLink.IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; +var + DrawInfo: TcxVerticalGridCellCustomDrawInfo; +begin + Result := inherited IsSupportedCustomDraw(Item) and + (Item <> nil) and IsCustomDrawn(GetItemCustomDrawInfo(Item, DrawInfo)); +end; + +procedure TcxCustomVerticalGridReportLink.MakeHardDelimiters(AReportCells: TdxReportCells; + AVertDelimiters: TList); +begin + inherited; + dxPSUtl.dxCopyList(DelimitersHardVert, AVertDelimiters); +end; + +procedure TcxCustomVerticalGridReportLink.DoCustomDrawRowHeaderCell(ACanvas: TCanvas; + ARow: TcxCustomRow; AnIndex: Integer; AnItem: TdxReportCellImage; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawRowHeaderCell) then + FOnCustomDrawRowHeaderCell(Self, ACanvas, ARow, AnIndex, AnItem, ADone); +end; + +procedure TcxCustomVerticalGridReportLink.DoCustomDrawRowHeaderSeparatorCell(ACanvas: TCanvas; + ARow: TcxCustomRow; AnIndex: Integer; AnItem: TdxReportCellString; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawRowHeaderSeparatorCell) then + FOnCustomDrawRowHeaderSeparatorCell(Self, ACanvas, ARow, AnIndex, AnItem, ADone); +end; + +procedure TcxCustomVerticalGridReportLink.DoCustomDrawRowIndentCell(ACanvas: TCanvas; + ARow: TcxCustomRow; AnIndex: Integer; AnItem: TdxReportCellExpandButton; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawRowIndentCell) then + FOnCustomDrawRowIndentCell(Self, ACanvas, ARow, AnIndex, AnItem, ADone); +end; + +procedure TcxCustomVerticalGridReportLink.DoCustomDrawRowValueCell(ACanvas: TCanvas; + ARow: TcxCustomRow; ACellIndex, ARecordIndex: Integer; AnItem: TAbstractdxReportCellData; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawRowValueCell) then + FOnCustomDrawRowValueCell(Self, ACanvas, ARow, ACellIndex, ARecordIndex, AnItem, ADone); +end; + +procedure TcxCustomVerticalGridReportLink.DoCustomDrawRowValueSeparatorCell(ACanvas: TCanvas; + ARow: TcxCustomRow; ACellIndex, ARecordIndex: Integer; AnItem: TdxReportCellString; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawRowValueSeparatorCell) then + FOnCustomDrawRowValueSeparatorCell(Self, ACanvas, ARow, ACellIndex, ARecordIndex, AnItem, ADone); +end; + +procedure TcxCustomVerticalGridReportLink.DoInitializeRowHeaderCell(ARow: TcxCustomRow; + ACellIndex: Integer; AnItem: TdxReportCellImage); +begin + if Assigned(FOnInitializeRowHeaderCell) then + FOnInitializeRowHeaderCell(Self, ARow, ACellIndex, AnItem); +end; + +procedure TcxCustomVerticalGridReportLink.DoInitializeRowHeaderSeparatorCell(ARow: TcxCustomRow; + AnIndex: Integer; AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeRowHeaderSeparatorCell) then + FOnInitializeRowHeaderSeparatorCell(Self, ARow, AnIndex, AnItem); +end; + +procedure TcxCustomVerticalGridReportLink.DoInitializeRowIndentCell(ARow: TcxCustomRow; + AnIndex: Integer; AnItem: TdxReportCellExpandButton); +begin + if Assigned(FOnInitializeRowIndentCell) then + FOnInitializeRowIndentCell(Self, ARow, AnIndex, AnItem); +end; + +procedure TcxCustomVerticalGridReportLink.DoInitializeRowValueCell(ARow: TcxCustomRow; + ACellIndex, ARecordIndex: Integer; AnItem: TAbstractdxReportCellData); +begin + if Assigned(FOnInitializeRowValueCell) then + FOnInitializeRowValueCell(Self, ARow, ACellIndex, ARecordIndex, AnItem); +end; + +procedure TcxCustomVerticalGridReportLink.DoInitializeRowValueSeparatorCell(ARow: TcxCustomRow; + ACellIndex, ARecordIndex: Integer; AnItem: TdxReportCellString); +begin + if Assigned(FOnInitializeRowValueSeparatorCell) then + FOnInitializeRowValueSeparatorCell(Self, ARow, ACellIndex, ARecordIndex, AnItem); +end; + +function TcxCustomVerticalGridReportLink.GetOptionsExpandingClass: TdxCustomReportLinkOptionsExpandingClass; +begin + Result := TcxVerticalGridReportLinkOptionsExpanding; +end; + +function TcxCustomVerticalGridReportLink.GetOptionsFormattingClass: TdxCustomReportLinkOptionsFormattingClass; +begin + Result := TcxVerticalGridReportLinkOptionsFormatting; +end; + +function TcxCustomVerticalGridReportLink.GetOptionsPaginationClass: TdxCustomReportLinkOptionsPaginationClass; +begin + Result := TcxVerticalGridReportLinkOptionsPagination; +end; + +function TcxCustomVerticalGridReportLink.GetOptionsRefinementsClass: TdxCustomReportLinkOptionsRefinementsClass; +begin + Result := TcxVerticalGridReportLinkOptionsRefinements; +end; + +function TcxCustomVerticalGridReportLink.GetOptionsSizeClass: TdxCustomReportLinkOptionsSizeClass; +begin + Result := TcxVerticalGridReportLinkOptionsSize; +end; + +function TcxCustomVerticalGridReportLink.GetOptionsViewClass: TdxCustomReportLinkOptionsViewClass; +begin + Result := TcxVerticalGridReportLinkOptionsView; +end; + +function TcxCustomVerticalGridReportLink.GetAreNativeStylesAvailable: Boolean; +begin + Result := OptionsFormatting.UseNativeStyles; +end; + +function TcxCustomVerticalGridReportLink.GetStylesClass: TdxCustomReportLinkStylesClass; +begin + Result := TcxVerticalGridReportLinkStyles; +end; + +function TcxCustomVerticalGridReportLink.GetStyleSheetClass: TdxCustomReportLinkStyleSheetClass; +begin + Result := TcxVerticalGridReportLinkStyleSheet; +end; + +function TcxCustomVerticalGridReportLink.GetStyleSheetPrototype: TdxCustomReportLinkStyleSheet; +begin + Result := DefaultdxPScxVerticalGridLinkStyleSheet; +end; + +procedure TcxCustomVerticalGridReportLink.PrepareConstruct; +begin + inherited; + DelimitersHardVert.Clear; + ReportCells.LookAndFeel := nil;//CreateGroupLookAndFeel(TdxPSReportGroupNullLookAndFeel); + FHostInfo := TcxVerticalGridHostInfo.Create; + FHostInfo.Initialize(ReportCells.Cells); +end; + +procedure TcxCustomVerticalGridReportLink.UnprepareConstruct; +begin + FreeAndNil(FHostInfo); + inherited; +end; + +procedure TcxCustomVerticalGridReportLink.AddVerticalHardDelimiter(ADelimiter: TdxReportCell); +begin + AddVerticalHardDelimiter(ADelimiter.AbsoluteRect.Bottom); +end; + +procedure TcxCustomVerticalGridReportLink.AddVerticalHardDelimiter(ADelimiter: Integer); +begin + FDelimitersHardVert.Add(TObject(ADelimiter)); +end; + +function TcxCustomVerticalGridReportLink.CreateBuilder: TcxCustomVerticalGridReportLinkBuilder; +begin + Result := GetBuilderClass.Create(Self); +end; + +class function TcxCustomVerticalGridReportLink.GetBuilderClass: TcxCustomVerticalGridReportLinkBuilderClass; +begin + Result := TcxCustomVerticalGridReportLinkBuilder; +end; + +procedure TcxCustomVerticalGridReportLink.ExtractCustomDrawCodeDataValues(ACode: Integer; + var AnAttribute: TcxVerticalGridAttributeID; var ACellIndex, ARecordIndex: Integer); +begin + AnAttribute := (ACode shr CodeAttributeOffset) and CodeAttributeMask; + ACellIndex := (ACode shr CodeIndexOffset) and CodeIndexMask; + ARecordIndex := (ACode shr CodeRecordIndexOffset) and CodeRecordIndexMask; +end; + +function TcxCustomVerticalGridReportLink.GetItemCustomDrawInfo(AnItem: TdxReportVisualItem; + out ADrawInfo: TcxVerticalGridCellCustomDrawInfo): TcxVerticalGridAttributeID; +begin + FillChar(ADrawInfo, SizeOf(ADrawInfo), 0); + try + try + with ADrawInfo do + begin + Row := TcxCustomRow(AnItem.Parent.Data); + ExtractCustomDrawCodeDataValues(AnItem.Data, AttributeID, CellIndex, RecordIndex); + end; + except + FillChar(ADrawInfo, SizeOf(ADrawInfo), 0); + end; + finally + Result := ADrawInfo.AttributeID; + end; +end; + +function TcxCustomVerticalGridReportLink.IsCustomDrawn(AnAttributeID: TcxVerticalGridAttributeID): Boolean; +begin + Result := False; + case AnAttributeID of + cxVerticalGridCategoryRowID: + Result := Assigned(FOnCustomDrawRowHeaderCell); + cxVerticalGridRowHeaderID: + Result := Assigned(FOnCustomDrawRowHeaderCell); + cxVerticalGridRowHeaderSeparatorID: + Result := Assigned(FOnCustomDrawRowHeaderSeparatorCell); + cxVerticalGridRowValueID: + Result := Assigned(FOnCustomDrawRowValueCell); + cxVerticalGridRowValueSeparatorID: + Result := Assigned(FOnCustomDrawRowValueSeparatorCell); + cxVerticalGridRowIndentID: + Result := Assigned(FOnCustomDrawRowIndentCell); + end; +end; + +function TcxCustomVerticalGridReportLink.MakeCustomDrawCodeData(AnAttribute: TcxVerticalGridAttributeID; + ACellIndex, ARecordIndex: Integer): Integer; +begin + Result := ((AnAttribute and CodeAttributeMask) shl CodeAttributeOffset) or + ((ACellIndex and CodeIndexMask) shl CodeIndexOffset) or + ((ARecordIndex and CodeRecordIndexMask) shl CodeRecordIndexOffset); +end; + +procedure TcxCustomVerticalGridReportLink.InitializePrintModeControl(AControl: TComboBox); +begin +end; + +procedure TcxCustomVerticalGridReportLink.UpdateStatePrintModeControl(AControl: TComboBox); +begin + AControl.Enabled := False; + AControl.Visible := False; +end; + +function TcxCustomVerticalGridReportLink.GetActiveStyles: TcxVerticalGridReportLinkStyles; +begin + Result := inherited ActiveStyles as TcxVerticalGridReportLinkStyles; +end; + +function TcxCustomVerticalGridReportLink.GetDesignWindow: TcxfmVerticalGridReportLinkDesignWindow; +begin + Result := inherited DesignWindow as TcxfmVerticalGridReportLinkDesignWindow; +end; + +function TcxCustomVerticalGridReportLink.GetOptionsExpanding: TcxVerticalGridReportLinkOptionsExpanding; +begin + Result := inherited OptionsExpanding as TcxVerticalGridReportLinkOptionsExpanding; +end; + +function TcxCustomVerticalGridReportLink.GetOptionsFormatting: TcxVerticalGridReportLinkOptionsFormatting; +begin + Result := inherited OptionsFormatting as TcxVerticalGridReportLinkOptionsFormatting; +end; + +function TcxCustomVerticalGridReportLink.GetOptionsPagination: TcxVerticalGridReportLinkOptionsPagination; +begin + Result := inherited OptionsPagination as TcxVerticalGridReportLinkOptionsPagination; +end; + +function TcxCustomVerticalGridReportLink.GetOptionsRefinements: TcxVerticalGridReportLinkOptionsRefinements; +begin + Result := inherited OptionsRefinements as TcxVerticalGridReportLinkOptionsRefinements; +end; + +function TcxCustomVerticalGridReportLink.GetOptionsSize: TcxVerticalGridReportLinkOptionsSize; +begin + Result := inherited OptionsSize as TcxVerticalGridReportLinkOptionsSize; +end; + +function TcxCustomVerticalGridReportLink.GetOptionsView: TcxVerticalGridReportLinkOptionsView; +begin + Result := inherited OptionsView as TcxVerticalGridReportLinkOptionsView; +end; + +function TcxCustomVerticalGridReportLink.GetStyles: TcxVerticalGridReportLinkStyles; +begin + Result := inherited Styles as TcxVerticalGridReportLinkStyles; +end; + +function TcxCustomVerticalGridReportLink.GetVerticalGrid: TcxCustomVerticalGrid; +begin + Result := TcxCustomVerticalGrid(Component); +end; + +procedure TcxCustomVerticalGridReportLink.SetOnCustomDrawRowHeaderCell( + Value: TcxVerticalGridReportLinkCustomDrawRowHeaderCellEvent); +begin + if @FOnCustomDrawRowHeaderCell <> @Value then + begin + FOnCustomDrawRowHeaderCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TcxCustomVerticalGridReportLink.SetCategoryFont(Value: TFont); +begin + CategoryFont.Assign(Value); + CategoryFont.Style := CategoryFont.Style + [fsBold]; +end; + +procedure TcxCustomVerticalGridReportLink.SetOnCustomDrawRowHeaderSeparatorCell( + Value: TcxVerticalGridReportLinkCustomDrawRowHeaderSeparatorCellEvent); +begin + if @FOnCustomDrawRowHeaderSeparatorCell <> @Value then + begin + FOnCustomDrawRowHeaderSeparatorCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TcxCustomVerticalGridReportLink.SetOnCustomDrawRowIndentCell( + Value: TcxVerticalGridReportLinkCustomDrawRowIndentCellEvent); +begin + if @FOnCustomDrawRowIndentCell <> @Value then + begin + FOnCustomDrawRowIndentCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TcxCustomVerticalGridReportLink.SetOnCustomDrawRowValueCell( + Value: TcxVerticalGridReportLinkCustomDrawRowValueCellEvent); +begin + if @FOnCustomDrawRowValueCell <> @Value then + begin + FOnCustomDrawRowValueCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TcxCustomVerticalGridReportLink.SetOnCustomDrawRowValueSeparatorCell( + Value: TcxVerticalGridReportLinkCustomDrawRowValueSeparatorCellEvent); +begin + if @FOnCustomDrawRowValueSeparatorCell <> @Value then + begin + FOnCustomDrawRowValueSeparatorCell := Value; + if SupportedCustomDraw then LinkModified(True); + end; +end; + +procedure TcxCustomVerticalGridReportLink.SetOptionsExpanding(Value: TcxVerticalGridReportLinkOptionsExpanding); +begin + inherited OptionsExpanding := Value; +end; + +procedure TcxCustomVerticalGridReportLink.SetOptionsFormatting(Value: TcxVerticalGridReportLinkOptionsFormatting); +begin + inherited OptionsFormatting := Value; +end; + +procedure TcxCustomVerticalGridReportLink.SetOptionsPagination(Value: TcxVerticalGridReportLinkOptionsPagination); +begin + inherited OptionsPagination := Value; +end; + +procedure TcxCustomVerticalGridReportLink.SetOptionsRefinements(Value: TcxVerticalGridReportLinkOptionsRefinements); +begin + inherited OptionsRefinements := Value; +end; + +procedure TcxCustomVerticalGridReportLink.SetOptionsSize(Value: TcxVerticalGridReportLinkOptionsSize); +begin + inherited OptionsSize := Value; +end; + +procedure TcxCustomVerticalGridReportLink.SetOptionsView(Value: TcxVerticalGridReportLinkOptionsView); +begin + inherited OptionsView := Value; +end; + +procedure TcxCustomVerticalGridReportLink.SetStyles(Value: TcxVerticalGridReportLinkStyles); +begin + inherited Styles := Value; +end; + +{ TcxUnboundVerticalGridReportLinkBuilder } + +class function TcxUnboundVerticalGridReportLinkBuilder.AdapterClass: TcxCustomVerticalGridAdapterClass; +begin + Result := TcxUnboundVerticalGridAdapter; +end; + +{ TcxUnboundVerticalGridAdapter } + +function TcxUnboundVerticalGridAdapter.GetLayoutStyle: TcxvgLayoutStyle; +begin + Result := TcxvgLayoutStyle(UnboundVerticalGrid_GetLayoutStyle(VerticalGrid)); +end; + +function TcxUnboundVerticalGridAdapter.GetVerticalGrid: TcxUnboundVerticalGrid; +begin + Result := inherited VerticalGrid as TcxUnboundVerticalGrid; +end; + +{ TcxUnboundVerticalGridReportLink } + +class function TcxUnboundVerticalGridReportLink.GetBuilderClass: TcxCustomVerticalGridReportLinkBuilderClass; +begin + Result := TcxUnboundVerticalGridReportLinkBuilder; +end; + +{ TcxVerticalGridReportLink } + +function TcxVerticalGridReportLink.GetVerticalGrid: TcxVerticalGrid; +begin + Result := TcxVerticalGrid(Component); +end; + +{ TcxRTTIInspectorReportLink } + +function TcxRTTIInspectorReportLink.GetRTTIInspector: TcxRTTIInspector; +begin + Result := TcxRTTIInspector(Component); +end; + +{ TcxVirtualVerticalGridReportLinkBuilder } + +class function TcxVirtualVerticalGridReportLinkBuilder.AdapterClass: TcxCustomVerticalGridAdapterClass; +begin + Result := TcxVirtualVerticalGridAdapter; +end; + +class function TcxVirtualVerticalGridReportLinkBuilder.FormatterClass: TcxCustomVerticalGridReportLinkFormatterClass; +begin + Result := TcxVirtualVerticalGridReportLinkFormatter; +end; + +{ TcxVirtualVerticalGridAdapter } + +function TcxVirtualVerticalGridAdapter.GetInterRecordsSpace: Integer; +begin + Result := OptionsView.RecordsInterval; +end; + +function TcxVirtualVerticalGridAdapter.GetLayoutStyle: TcxvgLayoutStyle; +begin + Result := VerticalGrid.LayoutStyle; +end; + +function TcxVirtualVerticalGridAdapter.GetOptionsView: TcxvgMultiRecordsOptionsView; +begin + Result := inherited OptionsView as TcxvgMultiRecordsOptionsView; +end; + +function TcxVirtualVerticalGridAdapter.GetVerticalGrid: TcxVirtualVerticalGrid; +begin + Result := inherited VerticalGrid as TcxVirtualVerticalGrid; +end; + +{ TcxVirtualVerticalGridReportLinkFormatter } + +function TcxVirtualVerticalGridReportLinkFormatter.GetFirstInternalRecordIndex: Integer; +begin + Result := inherited GetFirstInternalRecordIndex; + if (Adapter.LayoutStyle <> lsMultiRecordView) and (InternalRecordCount = 1) and + (ReportLink.OptionsView.ActualMode = vpmLoadedRecords) then + Result := Adapter.FirstRecordIndex; +end; + +function TcxVirtualVerticalGridReportLinkFormatter.GetInternalRecordCount: Integer; +begin + Result := inherited GetInternalRecordCount; + if (Adapter.LayoutStyle <> lsMultiRecordView) and (Result <> 0) and + (ReportLink.OptionsView.ActualMode = vpmLoadedRecords) then + Result := 1; +end; + +{ TcxVirtualVerticalGridReportLinkOptionsView } + +function TcxVirtualVerticalGridReportLinkOptionsView.GetActualMode: TcxVerticalGridReportLinkPrintMode; +begin + Result := Mode; + if ReportLink.VirtualVerticalGrid <> nil then + with ReportLink.VirtualVerticalGrid do + if not DataController.IsGridMode and (LayoutStyle = lsMultiRecordView) then + Result := vpmAllRecords; +end; + +function TcxVirtualVerticalGridReportLinkOptionsView.GetReportLink: TcxVirtualVerticalGridReportLink; +begin + Result := inherited ReportLink as TcxVirtualVerticalGridReportLink; +end; + +{ TcxVirtualVerticalGridReportLink } + +procedure TcxVirtualVerticalGridReportLink.InternalRestoreFromOriginal; +begin + inherited; + if VirtualVerticalGrid <> nil then + if VirtualVerticalGrid.DataController.IsGridMode then + OptionsView.Mode := vpmLoadedRecords + else + if VirtualVerticalGrid.LayoutStyle = lsMultiRecordView then + OptionsView.Mode := vpmAllRecords + else + OptionsView.Mode := vpmLoadedRecords; +end; + +class function TcxVirtualVerticalGridReportLink.GetBuilderClass: TcxCustomVerticalGridReportLinkBuilderClass; +begin + Result := TcxVirtualVerticalGridReportLinkBuilder; +end; + +function TcxVirtualVerticalGridReportLink.GetOptionsViewClass: TdxCustomReportLinkOptionsViewClass; +begin + Result := TcxVirtualVerticalGridReportLinkOptionsView; +end; + +procedure TcxVirtualVerticalGridReportLink.InitializePrintModeControl(AControl: TComboBox); + + function IsModeAccepted(AMode: TcxVerticalGridReportLinkPrintMode): Boolean; + begin + if VirtualVerticalGrid <> nil then + if VirtualVerticalGrid.DataController.IsGridMode then + Result := True + else + if VirtualVerticalGrid.LayoutStyle = lsMultiRecordView then + Result := AMode = vpmAllRecords + else + Result := True + else + Result := True; + end; + + function PrintModeString(AMode: TcxVerticalGridReportLinkPrintMode): string; + begin + if (VirtualVerticalGrid = nil) or (VirtualVerticalGrid.LayoutStyle = lsMultiRecordView) then + if AMode = vpmLoadedRecords then + Result := cxGetResourceString(@sdxLoadedRecords) + else + Result := cxGetResourceString(@sdxAllRecords) + else + if AMode = vpmLoadedRecords then + Result := cxGetResourceString(@sdxCurrentRecord) + else + Result := cxGetResourceString(@sdxAllRecords); + end; + +var + I: TcxVerticalGridReportLinkPrintMode; +begin + with AControl do + begin + Items.BeginUpdate; + try + Clear; + for I := Low(TcxVerticalGridReportLinkPrintMode) to High(TcxVerticalGridReportLinkPrintMode) do + if IsModeAccepted(I) then + Items.AddObject(PrintModeString(I), TObject(I)); + + ItemIndex := Items.IndexOfObject(TObject(OptionsView.ActualMode)); + finally + Items.EndUpdate; + end; + end; +end; + +procedure TcxVirtualVerticalGridReportLink.UpdateStatePrintModeControl(AControl: TComboBox); +begin + AControl.Enabled := AControl.Items.Count > 1; + AControl.Visible := True; +end; + +function TcxVirtualVerticalGridReportLink.GetOptionsView: TcxVirtualVerticalGridReportLinkOptionsView; +begin + Result := inherited OptionsView as TcxVirtualVerticalGridReportLinkOptionsView; +end; + +function TcxVirtualVerticalGridReportLink.GetVirtualVerticalGrid: TcxVirtualVerticalGrid; +begin + Result := Component as TcxVirtualVerticalGrid; +end; + +procedure TcxVirtualVerticalGridReportLink.SetOptionsView(Value: TcxVirtualVerticalGridReportLinkOptionsView); +begin + inherited OptionsView := Value; +end; + +{ TcxDBVerticalGridReportLinkBuilder } + +class function TcxDBVerticalGridReportLinkBuilder.FormatterClass: TcxCustomVerticalGridReportLinkFormatterClass; +begin + Result := TcxDBVerticalGridReportLinkFormatter; +end; + +{ TcxDBVerticalGridReportLinkFormatter } + +function TcxDBVerticalGridReportLinkFormatter.GetAreRecordsNeededLoading: Boolean; +begin + Result := DataController.IsGridMode and (OptionsView.Mode = vpmAllRecords); +end; + +function TcxDBVerticalGridReportLinkFormatter.GetAreRecordsNeededUnloading: Boolean; +begin + Result := IsPrevGridMode and (OptionsView.Mode = vpmAllRecords); +end; + +procedure TcxDBVerticalGridReportLinkFormatter.LoadRecords; +begin + DataController.GridMode := False; +end; + +procedure TcxDBVerticalGridReportLinkFormatter.UnloadRecords; +begin + DataController.GridMode := True; +end; + +function TcxDBVerticalGridReportLinkFormatter.GetDataController: TcxDBVerticalGridDataController; +begin + Result := inherited DataController as TcxDBVerticalGridDataController; +end; + +{ TcxDBVerticalGridReportLink } + +class function TcxDBVerticalGridReportLink.GetBuilderClass: TcxCustomVerticalGridReportLinkBuilderClass; +begin + Result := TcxDBVerticalGridReportLinkBuilder; +end; + +function TcxDBVerticalGridReportLink.GetDBVerticalGrid: TcxDBVerticalGrid; +begin + Result := Component as TcxDBVerticalGrid; +end; + +{ TcxfmVerticalGridReportLinkDesignWindow } + +constructor TcxfmVerticalGridReportLinkDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxPSGlbl.dxhccxVerticalGridReportLinkDesigner; + inherited; + CreateControls; + SetActivePage; +end; + +destructor TcxfmVerticalGridReportLinkDesignWindow.Destroy; +begin + dxPSPopupMan.dxPSPopupMenuController.UnregisterControl(lbxStyles); + inherited; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.LookAndFeelChange(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TComboBox(Sender) do + ReportLink.OptionsFormatting.LookAndFeelKind := TcxLookAndFeelKind(Items.Objects[ItemIndex]); + Modified := True; + UpdatePreview; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.OptionsExpandingClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsExpandingByIndex(TTagToInt(Tag), Checked); +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.OptionsFormattingClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsFormattingByIndex(TTagToInt(Tag), Checked); +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.OptionsRefinementsClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsRefinementsByIndex(TTagToInt(Tag), Checked); +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.OptionsPaginationClick( + Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsPaginationByIndex(TTagToInt(Tag), Checked); +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.OptionsSizeClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsSizeByIndex(TTagToInt(Tag), Checked); +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.OptionsViewClick(Sender: TObject); +begin + with TCheckBox(Sender) do + SetOptionsViewByIndex(TTagToInt(Tag), Checked); +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.cbxPrintModeChange(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TComboBox(Sender) do + ReportLink.OptionsView.Mode := TcxVerticalGridReportLinkPrintMode(Items.Objects[ItemIndex]); + Modified := True; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.pmStylesPopup(Sender: TObject); +begin + lbxStyles.HideToolTips; + miStyleColor.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + miStyleFont.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + miStyleBackgroundBitmap.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + miStyleBackgroundBitmapClear.Enabled := AreNativeStylesAvailable and HasSelectedStylesWithAssignedBitmap; + miStyleRestoreDefaults.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + miStylesSelectAll.Enabled := CanSelectAllStyles; + miStylesSaveAs.Enabled := CanSaveStyles; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.lblUseNativeStylesClick( + Sender: TObject); +begin + if chbxUseNativeStyles.CanFocus then ActiveControl := chbxUseNativeStyles; + chbxUseNativeStyles.Checked := not chbxUseNativeStyles.Checked; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.StyleColorClick(Sender: TObject); +begin + PerformStylesChangeColor; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.StyleFontClick(Sender: TObject); +begin + PerformStylesChangeFont; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.StyleBackgroundBitmapClick( + Sender: TObject); +begin + PerformStylesChangeBitmap; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.StyleBackgroundBitmapClearClick( + Sender: TObject); +begin + PerformStylesClearBitmap; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.StyleRestoreDefaultsClick( + Sender: TObject); +begin + PerformStylesRestoreDefaults; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.DoInitialize; +begin + lbxStyles.ReportLinkStyles := ReportLink.ActiveStyles; + inherited; + RefreshStylesList; + + LoadDataIntoPreviewVerticalGrid; + InitializePreviewVerticalGridStyles; + + (*{$IFNDEF DXVER500} {.3} + chbxTransparentRichEdits.Visible := False; + {$ENDIF} *) + + with ReportLink.OptionsView do + begin + chbxShowBorders.Checked := Borders; + chbxShowExpandButtons.Checked := ExpandButtons; + chbxShowHeaders.Checked := Headers; + end; + ReportLink.InitializePrintModeControl(cbxPrintMode); + + with cbxLookAndFeel do + begin + Items.Clear; + Items.AddObject(cxGetResourceString(@sdxLookAndFeelFlat), TObject(lfFlat)); + Items.AddObject(cxGetResourceString(@sdxLookAndFeelStandard), TObject(lfStandard)); + Items.AddObject(cxGetResourceString(@sdxLookAndFeelUltraFlat), TObject(lfUltraFlat)); + + ItemIndex := Items.IndexOfObject(TObject(ReportLink.OptionsFormatting.LookAndFeelKind)); + end; + + with ReportLink.OptionsFormatting do + begin + chbxSuppressBackgroundBitmaps.Checked := SuppressBackgroundBitmaps; + chbxUseNativeStyles.Checked := UseNativeStyles; + end; + + with ReportLink.OptionsExpanding do + begin + chbxExpandRows.Checked := AutoExpandRows; + end; + + with ReportLink.OptionsSize do + begin + chbxAutoWidth.Checked := AutoWidth; + chbxBestFit.Checked := BestFit; + chbxKeepSameRecordWidths.Checked := KeepSameRecordWidths; + chbxWrapRecords.Checked := WrapRecords; + end; + + with ReportLink.OptionsRefinements do + begin + chbxTransparentGraphics.Checked := TransparentGraphics; + chbxDisplayGraphicsAsText.Checked := DisplayGraphicsAsText; + chbxFlatCheckMarks.Checked := FlatCheckMarks; + (*{$IFDEF DXVER500} {.3} + chbxTransparentRichEdits.Checked := TransparentRichEdits; + {$ENDIF}*) + end; + + with ReportLink.OptionsPagination do + begin + chbxPaginateByRows.Checked := ByRows; + chbxPaginateByWrapping.Checked := ByWrapping; + chbxOneWrappingPerPage.Checked := OneWrappingPerPage; + end; +end; + +{$IFDEF DELPHI7} +function TcxfmVerticalGridReportLinkDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +procedure TcxfmVerticalGridReportLinkDesignWindow.LoadStrings; + + procedure AdjustBevelSize(ABevel: TBevel; ALabel: TControl); + var + Right: Integer; + begin + Right := ABevel.BoundsRect.Right; + ABevel.Left := ALabel.Left + ALabel.Width + 10; + ABevel.Width := Right - ABevel.Left; + end; + +begin + inherited; + + lblPreviewWindow.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + tshView.Caption := cxGetResourceString(@sdxViewTab); + + lblShow.Caption := cxGetResourceString(@sdxShow); + AdjustBevelSize(bvlShow, lblShow); + chbxShowHeaders.Caption := cxGetResourceString(@sdxHeaders); + chbxShowBorders.Caption := cxGetResourceString(@sdxBorders); + chbxShowExpandButtons.Caption := cxGetResourceString(@sdxExpandButtons); + lblPrintMode.Caption := cxGetResourceString(@sdxMode); + + tshBehaviors.Caption := cxGetResourceString(@sdxBehaviorsTab); + + lblExpanding.Caption := cxGetResourceString(@sdxExpanding); + AdjustBevelSize(bvlExpanding, lblExpanding); + chbxExpandRows.Caption := cxGetResourceString(@sdxRows); + + lblSize.Caption := cxGetResourceString(@sdxSize); + AdjustBevelSize(bvlSize, lblSize); + chbxAutoWidth.Caption := cxGetResourceString(@sdxAutoWidth); + chbxBestFit.Caption := cxGetResourceString(@sdxBestFit); + chbxKeepSameRecordWidths.Caption := cxGetResourceString(@sdxKeepSameRecordWidths); + chbxWrapRecords.Caption := cxGetResourceString(@sdxWrapRecords); + + tshFormatting.Caption := cxGetResourceString(@sdxFormatting); + lblLookAndFeel.Caption := cxGetResourceString(@sdxLookAndFeel); + AdjustBevelSize(bvlLookAndFeel, lblLookAndFeel); + + lblRefinements.Caption := cxGetResourceString(@sdxRefinements); + AdjustBevelSize(bvlRefinements, lblRefinements); + chbxTransparentGraphics.Caption := cxGetResourceString(@sdxTransparentGraphics); + chbxDisplayGraphicsAsText.Caption := DropAmpersand(cxGetResourceString(@sdxDisplayGraphicsAsText)); + chbxFlatCheckMarks.Caption := cxGetResourceString(@sdxFlatCheckMarks); + //chbxTransparentRichEdits.Caption := cxGetResourceString(@sdxTransparentRichEdits); {.3} + chbxSuppressBackgroundBitmaps.Caption := cxGetResourceString(@sdxSuppressBackgroundBitmaps); + + lblPagination.Caption := cxGetResourceString(@sdxPagination); + AdjustBevelSize(bvlPagination, lblPagination); + chbxPaginateByRows.Caption := cxGetResourceString(@sdxByRows); + chbxPaginateByWrapping.Caption := cxGetResourceString(@sdxByWrapping); + chbxOneWrappingPerPage.Caption := cxGetResourceString(@sdxOneWrappingPerPage); + + tshStyles.Caption := cxGetResourceString(@sdxStyles); + lblStyleSheets.Caption := cxGetResourceString(@sdxStyleSheets); + lblUseNativeStyles.Caption := cxGetResourceString(@sdxUseNativeStyles); + AdjustBevelSize(bvlStyles, lblUseNativeStyles); + btnStyleColor.Caption := cxGetResourceString(@sdxBtnColor); + btnStyleFont.Caption := cxGetResourceString(@sdxBtnFont); + btnStyleBackgroundBitmap.Caption := cxGetResourceString(@sdxBtnTexture); + btnStyleBackgroundBitmapClear.Caption := cxGetResourceString(@sdxBtnTextureClear); + btnStyleRestoreDefaults.Caption := cxGetResourceString(@sdxBtnRestoreDefaults); + btnStylesSaveAs.Caption := cxGetResourceString(@sdxBtnSaveAs); + btnStyleSheetNew.Caption := cxGetResourceString(@sdxBtnNew); + btnStyleSheetCopy.Caption := cxGetResourceString(@sdxBtnCopy); + btnStyleSheetDelete.Caption := cxGetResourceString(@sdxBtnDelete); + btnStyleSheetRename.Caption := cxGetResourceString(@sdxBtnRename); + + miStyleColor.Caption := cxGetResourceString(@sdxBtnColor); + miStyleFont.Caption := cxGetResourceString(@sdxBtnFont); + miStyleBackgroundBitmap.Caption := cxGetResourceString(@sdxBtnTexture); + miStyleBackgroundBitmapClear.Caption := cxGetResourceString(@sdxBtnTextureClear); + miStyleRestoreDefaults.Caption := cxGetResourceString(@sdxBtnRestoreDefaults); + miStylesSelectAll.Caption := cxGetResourceString(@sdxSelectAll); + miStylesSaveAs.Caption := cxGetResourceString(@sdxBtnSaveAs); +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.UpdateControlsState; +begin + inherited; + ReportLink.UpdateStatePrintModeControl(cbxPrintMode); + lblPrintMode.Visible := cbxPrintMode.Visible; + bvlMultipleRecords.Visible := cbxPrintMode.Visible; + + chbxBestFit.Enabled := not chbxAutoWidth.Checked; + chbxKeepSameRecordWidths.Enabled := chbxBestFit.Enabled and chbxBestFit.Checked; + chbxOneWrappingPerPage.Enabled := chbxPaginateByWrapping.Checked; + + lbxStyles.Enabled := AreNativeStylesAvailable; + btnStyleColor.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + btnStyleFont.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + btnStyleBackgroundBitmap.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + btnStyleBackgroundBitmapClear.Enabled := AreNativeStylesAvailable and HasSelectedStylesWithAssignedBitmap; + btnStyleRestoreDefaults.Enabled := AreNativeStylesAvailable and HasSelectedStyles; + btnStylesSaveAs.Enabled := CanSaveStyles; + + lblStyleSheets.Enabled := AreNativeStylesAvailable; + cbxStyleSheets.Enabled := AreNativeStylesAvailable; + btnStyleSheetNew.Enabled := CanCreateStyleSheet; + btnStyleSheetCopy.Enabled := CanCopyStyleSheet; + btnStyleSheetDelete.Enabled := CanDeleteStyleSheet; + btnStyleSheetRename.Enabled := CanRenameStyleSheet; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.UpdatePreview; +const + TransparentsMap: array[Boolean] of TcxImageTransparency = (gtOpaque, gtTransparent); +begin + PreviewVGrid.Enabled := False; + PreviewVGrid.Font := ReportLink.Font; + CustomVerticalGrid_GetCategoryFont(PreviewVGrid).Assign(ReportLink.CategoryFont); + + TcxImageProperties(rowPicture.Properties.EditProperties).GraphicTransparency := + TransparentsMap[ReportLink.OptionsRefinements.TransparentGraphics]; + + PreviewVGrid.OptionsView.ShowHeaders := ReportLink.OptionsView.Headers; + PreviewVGrid.OptionsView.ShowButtons := ReportLink.OptionsView.ExpandButtons; + PreviewVGrid.Invalidate; +end; + +function TcxfmVerticalGridReportLinkDesignWindow.GetDesignerTabIndex: Integer; +begin + Result := PageControl1.ActivePage.TabIndex; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.SetDesignerTabIndex(Value: Integer); +begin + if Value < 0 then Value := 0; + if Value > PageControl1.PageCount - 1 then + Value := PageControl1.PageCount - 1; + PageControl1.ActivePage := PageControl1.Pages[Value]; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.DoActiveStyleSheetChanged; +begin + lbxStyles.ReportLinkStyles := ReportLink.ActiveStyles; + inherited; + with cbxStyleSheets do + ItemIndex := Items.IndexOfObject(ActiveStyleSheet); + + if not LockControlsUpdate then + begin + Modified := True; + UpdatePreview; + end; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.DoFormActivated(AnActive: Boolean); +begin + inherited; + if not AnActive then lbxStyles.HideToolTips; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.DoRefreshStylesList; +var + Styles: TcxVerticalGridReportLinkStyles; + List: TList; +begin + Styles := ReportLink.ActiveStyles; + with lbxStyles.Items do + begin + BeginUpdate; + try + List := TList.Create; + try + SaveSelectedStyles(List); + try + Clear; + AddObject(cxGetResourceString(@sdxCategoryStyle), Styles.Category); + AddObject(cxGetResourceString(@sdxContentStyle), Styles.Content); + AddObject(cxGetResourceString(@sdxHeaderStyle), Styles.Header); + finally + RestoreSelectedStyles(List); + end; + finally + List.Free; + end; + finally + EndUpdate; + end; + end; + InitializePreviewVerticalGridStyles; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.DoStyleChanged(const ACaption: string; + AStyle: TcxStyle); +begin + inherited; + UpdatePreviewVerticalGridStyles(ACaption, AStyle); +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.DoStylesChanged(AStrings: TStrings; + ARecreate: Boolean); +begin + if ARecreate then + RecreateStylesListBox + else + lbxStyles.Invalidate; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.GetSelectedStyleNames(AStrings: TStrings); +var + I: Integer; +begin + AStrings.Clear; + with lbxStyles do + for I := 0 to Items.Count - 1 do + if Selected[I] then + AStrings.AddObject(Items[I], Items.Objects[I]); +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.GetStyleSheetNames(out AStrings: TStrings); +begin + AStrings := cbxStyleSheets.Items; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.GetStyleNames(out AStrings: TStrings); +begin + AStrings := lbxStyles.Items; +end; + +function TcxfmVerticalGridReportLinkDesignWindow.GetActiveStyle: TcxStyle; +begin + with lbxStyles do + if ItemIndex <> -1 then + Result := TcxStyle(Items.Objects[ItemIndex]) + else + Result := nil; +end; + +function TcxfmVerticalGridReportLinkDesignWindow.GetComponent: TcxCustomVerticalGrid; +begin + Result := inherited Component as TcxCustomVerticalGrid; +end; + +function TcxfmVerticalGridReportLinkDesignWindow.GetHasSelectedStyles: Boolean; +begin + Result := lbxStyles.SelCount <> 0; +end; + +function TcxfmVerticalGridReportLinkDesignWindow.GetHasSelectedStylesWithAssignedBitmap: Boolean; +var + Styles: TStrings; + I: Integer; + cxStyle: TcxStyle; +begin + Result := True; + Styles := TStringList.Create; + try + GetSelectedStyleNames(Styles); + for I := 0 to Styles.Count - 1 do + begin + cxStyle := TcxStyle(Styles.Objects[I]); + if (cxStyle <> nil) and (cxStyle.Bitmap <> nil) and not cxStyle.Bitmap.Empty then + Exit; + end; + finally + Styles.Free; + end; + Result := False; +end; + +function TcxfmVerticalGridReportLinkDesignWindow.GetReportLink: TcxCustomVerticalGridReportLink; +begin + Result := inherited ReportLink as TcxCustomVerticalGridReportLink; +end; + +function TcxfmVerticalGridReportLinkDesignWindow.CanSelectAllStyles: Boolean; +var + I: Integer; +begin + Result := AreNativeStylesAvailable; + if Result then + begin + for I := 0 to lbxStyles.Items.Count - 1 do + if not lbxStyles.Selected[I] then Exit; + Result := False; + end; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.CreateControls; + + procedure CreateStylesListBox; + begin + lbxStyles := TdxStylesListBox.Create(Self); + lbxStyles.Parent := tshStyles; + lbxStyles.BoundsRect := bvlStylesHost.BoundsRect; + lbxStyles.PopupMenu := pmStyles; + lbxStyles.TabOrder := chbxUseNativeStyles.TabOrder + 1; + lbxStyles.OnClick := lbxStylesClick; + bvlStylesHost.Visible := False; + + dxPSPopupMan.dxPSPopupMenuController.RegisterControl(lbxStyles); + end; + +begin + CreateStylesListBox; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.CustomDrawTextRect(ACanvas: TcxCanvas; + AViewInfo: TcxRowValueInfo; const AText: string); +const + AlignmentHorz = cxAlignLeft; + AlignmentVert = cxAlignTop; +var + R: TRect; +begin + with AViewInfo do + begin + R := BoundsRect; + + if ViewParams.Bitmap = nil then + begin + ACanvas.Brush.Color := ViewParams.Color; + ACanvas.FillRect(R); + end + else + dxBkgnd.DrawPicture(ViewParams.Bitmap, ACanvas.Canvas, R, ppmTile, 1, 1, -R.Left, -R.Top); + + InflateRect(R, -2, -1); + if ViewParams.Font <> nil then + ACanvas.Font := ViewParams.Font; + ACanvas.Font.Color := ViewParams.TextColor; + ACanvas.Brush.Style := bsClear; + ACanvas.DrawText(AText, R, AlignmentHorz or AlignmentVert or cxSingleLine); + ACanvas.Brush.Style := bsSolid; + end; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.InitializePreviewVerticalGridStyles; + + procedure ResetEvents(AStyles: TcxVerticalGridStyles); + begin + with AStyles do + begin + OnGetCategoryStyle := nil; + OnGetHeaderStyle := nil; + OnGetContentStyle := nil; + end; + end; + +var + Styles: TcxVerticalGridReportLinkStyles; +begin + if ReportLink.OptionsFormatting.UseNativeStyles then + begin + dxPScxCommon.dxPSResetStyles(PreviewVGrid.Styles); + + Styles := ReportLink.ActiveStyles; + with PreviewVGrid.Styles do + begin + Category := Styles.Category; + Content := Styles.Content; + Header := Styles.Header; + end; + end + else + if Component <> nil then + PreviewVGrid.Styles := Component.Styles + else + dxPScxCommon.dxPSResetStyles(PreviewVGrid.Styles); + + ResetEvents(PreviewVGrid.Styles); +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.LoadDataIntoPreviewVerticalGrid; +const + RowCount = 6; + RowEditProperties: array[0..RowCount - 1] of TcxCustomEditPropertiesClass = + (TcxTextEditProperties, TcxTextEditProperties, TcxImageProperties, + TcxMemoProperties, TcxTextEditProperties, TcxMemoProperties); + RowHeights: array[0..RowCount - 1] of Integer = + (-1, -1, 116, 57, -1, 44); + + function RowCaptionString(Index: Integer): string; + begin + case Index of + 0: Result := cxGetResourceString(@sdxCarManufacturer); + 1: Result := cxGetResourceString(@sdxCarModel); + 2: Result := cxGetResourceString(@sdxPicture); + 3: Result := cxGetResourceString(@sdxCarEngine); + 4: Result := cxGetResourceString(@sdxCarTransmission); + else + Result := cxGetResourceString(@sdxCarTires); + end; + end; + + function RowValueString(Index: Integer): string; + begin + case Index of + 0: Result := cxGetResourceString(@sdx760V12Manufacturer); + 1: Result := cxGetResourceString(@sdx760V12Model); + 2: Result := ''; + 3: Result := cxGetResourceString(@sdx760V12Engine); + 4: Result := cxGetResourceString(@sdx760V12Transmission); + else + Result := cxGetResourceString(@sdx760V12Tires); + end; + end; + +var + I: Integer; + S: string; +begin + rowLuxurySedan.Properties.Caption := cxGetResourceString(@sdxLuxurySedans); + for I := 0 to rowLuxurySedan.Count - 1 do + with TcxEditorRow(rowLuxurySedan.Rows[I]) do + begin + Properties.Caption := DropAmpersand(RowCaptionString(I)); + Properties.EditPropertiesClass := RowEditProperties[I]; + if RowValueString(I) <> '' then + Properties.Value := RowValueString(I); + if RowHeights[I] <> -1 then + Height := RowHeights[I]; + end; + cxImage.SavePicture(PreviewImage, S); + rowPicture.Properties.Value := S; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.RecreateStylesListBox; +var + List: TList; +begin + List := TList.Create; + try + SaveSelectedStyles(List); + dxPSUtl.dxRecreateWnd(lbxStyles); + RestoreSelectedStyles(List); + finally + List.Free; + end; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.RestoreSelectedStyles(AList: TList); +var + I: Integer; +begin + for I := 0 to AList.Count - 1 do + lbxStyles.Selected[Integer(AList[I])] := True; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.SaveSelectedStyles(AList: TList); +var + I: Integer; +begin + AList.Clear; + for I := 0 to lbxStyles.Items.Count - 1 do + if lbxStyles.Selected[I] then AList.Add(TObject(I)); +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.SetActivePage; +begin + PageControl1.ActivePage := PageControl1.Pages[DesignerTabIndex]; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.UpdatePreviewVerticalGridStyles(const ACaption: string; + AStyle: TcxStyle); +begin + with PreviewVGrid.Styles do + begin + if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxCategoryStyle)) then + Category := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxContentStyle)) then + Content := AStyle + else if dxPSUtl.dxSameText(ACaption, cxGetResourceString(@sdxHeaderStyle)) then + Header := AStyle; + end; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.SetOptionsExpandingByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + with ReportLink.OptionsExpanding do + case Index of + 0: AutoExpandRows := Value; + end; + Modified := True; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.SetOptionsFormattingByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + with ReportLink.OptionsFormatting do + case Index of + 0: + begin + UseNativeStyles := Value; + InitializePreviewVerticalGridStyles; + end; + 1: SuppressBackgroundBitmaps := Value; + end; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.SetOptionsPaginationByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + with ReportLink.OptionsPagination do + case Index of + 0: ByRows := Value; + 1: ByWrapping := Value; + 2: OneWrappingPerPage := Value; + end; + Modified := True; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.SetOptionsRefinementsByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + with ReportLink.OptionsRefinements do + case Index of + 0: TransparentGraphics := Value; + 1: DisplayGraphicsAsText := Value; + 2: FlatCheckMarks := Value; + {$IFDEF DXVER500} + 3: TransparentRichEdits := Value; + {$ENDIF} + end; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.SetOptionsSizeByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + with ReportLink.OptionsSize do + case Index of + 0: AutoWidth := Value; + 1: BestFit := Value; + 2: KeepSameRecordWidths := Value; + 3: WrapRecords := Value; + end; + Modified := True; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.SetOptionsViewByIndex(Index: Integer; + Value: Boolean); +begin + if LockControlsUpdate then Exit; + with ReportLink.OptionsView do + case Index of + 0: Headers := Value; + 1: ExpandButtons := Value; + 2: Borders := Value; + end; + Modified := True; + UpdatePreview; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.PreviewVGridDrawValue( + Sender: TObject; ACanvas: TcxCanvas; APainter: TcxvgPainter; + AValueInfo: TcxRowValueInfo; var Done: Boolean); +begin + if AValueInfo.Row = rowPicture then + with ReportLink.OptionsRefinements do + if DisplayGraphicsAsText then + begin + CustomDrawTextRect(ACanvas, AValueInfo, GraphicsText); + Done := True; + end; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.cbxStyleSheetsClick(Sender: TObject); +begin + with TComboBox(Sender) do + ActiveStyleSheet := TcxCustomStyleSheet(Items.Objects[ItemIndex]); +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.btnStyleSheetNewClick(Sender: TObject); +begin + PerformStyleSheetNew; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.btnStyleSheetCopyClick( + Sender: TObject); +begin + PerformStyleSheetCopy; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.btnStyleSheetDeleteClick(Sender: TObject); +begin + PerformStyleSheetDelete; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.btnStyleSheetRenameClick(Sender: TObject); +begin + PerformStyleSheetRename; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.miStylesSelectAllClick(Sender: TObject); +{$IFNDEF DELPHI6} +var + I: Integer; +{$ENDIF} +begin + with lbxStyles do + begin + {$IFDEF DELPHI6} + SelectAll; + {$ELSE} + Items.BeginUpdate; + try + for I := 0 to Items.Count - 1 do + Selected[I] := True; + finally + Items.EndUpdate; + end; + {$ENDIF} + end; + UpdateControlsState; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.StylesSaveAsClick(Sender: TObject); +begin + PerformStylesSaveAsStyleSheet; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.cbxStyleSheetsKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + PerformStyleSheetKeyDown(Sender, Key, Shift); +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.cbxStyleSheetsDrawItem( + Control: TWinControl; Index: Integer; Rect: TRect; + State: TOwnerDrawState); +begin + PerformStyleSheetDrawItem(TComboBox(Control).Canvas, Index, Rect, State, Control.Enabled); +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.lbxStylesClick(Sender: TObject); +begin + if not LockControlsUpdate then + UpdateControlsState; +end; + +procedure TcxfmVerticalGridReportLinkDesignWindow.PageControl1Change(Sender: TObject); +begin + lblPreviewWindow.Parent := TPageControl(Sender).ActivePage; +end; + +procedure RegisterAssistants; +begin + TcxVerticalGridCustomRowHelper.Register; + TcxVerticalGridCategoryRowHelper.Register; + TcxVerticalGridCustomEditorRowHelper.Register; + TcxVerticalGridEditorRowHelper.Register; + TcxVerticalGridDBEditorRowHelper.Register; + TcxVerticalGridCustomMultiEditorRowHelper.Register; + + TcxVerticalGridReportLinkStyleSheet.Register; +end; + +procedure UnregisterAssistants; +begin + TcxVerticalGridReportLinkStyleSheet.Unregister; + + TcxVerticalGridCustomMultiEditorRowHelper.Unregister; + TcxVerticalGridDBEditorRowHelper.Unregister; + TcxVerticalGridEditorRowHelper.Unregister; + TcxVerticalGridCustomEditorRowHelper.Unregister; + TcxVerticalGridCategoryRowHelper.Unregister; + TcxVerticalGridCustomRowHelper.Unregister; + + TcxVerticalGridRowHelperFactory.ReleaseInstance; +end; + +procedure RegisterVGridReportLink(AReportLinkClass: TdxReportLinkClass; AVGridClass: TComponentClass); +begin + dxPSRegisterReportLink(AReportLinkClass, AVGridClass, TcxfmVerticalGridReportLinkDesignWindow); +end; + +procedure UnregisterVGridReportLink(AReportLinkClass: TdxReportLinkClass; AVGridClass: TComponentClass); +begin + dxPSUnregisterReportLink(AReportLinkClass, AVGridClass, TcxfmVerticalGridReportLinkDesignWindow); +end; + +initialization + RegisterAssistants; + + RegisterVGridReportLink(TcxVerticalGridReportLink, TcxVerticalGrid); + RegisterVGridReportLink(TcxRTTIInspectorReportLink, TcxRTTIInspector); + RegisterVGridReportLink(TcxDBVerticalGridReportLink, TcxDBVerticalGrid); + RegisterVGridReportLink(TcxVirtualVerticalGridReportLink, TcxVirtualVerticalGrid); + +finalization + UnregisterVGridReportLink(TcxVirtualVerticalGridReportLink, TcxVirtualVerticalGrid); + UnregisterVGridReportLink(TcxDBVerticalGridReportLink, TcxDBVerticalGrid); + UnregisterVGridReportLink(TcxRTTIInspectorReportLink, TcxRTTIInspector); + UnregisterVGridReportLink(TcxVerticalGridReportLink, TcxVerticalGrid); + + UnregisterAssistants; + FreeAndNil(FDefaultdxPScxVerticalGridLinkStyleSheet); + FreeAndNil(FBMW760Li); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxVGridLnkPredefinedStyleSheets.dfm b/official/x.35/ExpressPrinting System/Sources/dxPScxVGridLnkPredefinedStyleSheets.dfm new file mode 100644 index 00000000..8819b679 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxVGridLnkPredefinedStyleSheets.dfm @@ -0,0 +1,112 @@ +object cxdmPScxVGridLnkPredefinedStyles: TcxdmPScxVGridLnkPredefinedStyles + OldCreateOrder = False + Left = 435 + Top = 202 + Height = 150 + Width = 215 + object StyleRepository: TcxStyleRepository + Left = 63 + Top = 28 + object styleProfessionalCategory: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object styleProfessionalHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7566195 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object styleGrayCategory: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6579300 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleGrayHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8559005 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleNoneContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentCategory: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object ssProfessional: TcxVerticalGridReportLinkStyleSheet + Caption = 'Professional' + Styles.Category = styleProfessionalCategory + Styles.Content = styleNoneContent + Styles.Header = styleProfessionalHeader + BuiltIn = True + end + object ssGray: TcxVerticalGridReportLinkStyleSheet + Caption = 'Gray' + Styles.Category = styleGrayCategory + Styles.Content = styleNoneContent + Styles.Header = styleGrayHeader + BuiltIn = True + end + object ssTransparent: TcxVerticalGridReportLinkStyleSheet + Caption = 'Transparent' + Styles.Category = styleTransparentCategory + Styles.Content = styleTransparentContent + Styles.Header = styleTransparentHeader + BuiltIn = True + end + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxVGridLnkPredefinedStyleSheets.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxVGridLnkPredefinedStyleSheets.pas new file mode 100644 index 00000000..e2ac19c9 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxVGridLnkPredefinedStyleSheets.pas @@ -0,0 +1,122 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxVGridLnkPredefinedStyleSheets; + +interface + +{$I cxVer.inc} + +uses + Classes, {$IFNDEF DELPHI6} Forms, {$ENDIF} cxClasses, cxStyles, dxPScxVGridLnk, + dxPScxCommon; + +type + TcxdmPScxVGridLnkPredefinedStyles = class(TDataModule) + StyleRepository: TcxStyleRepository; + styleGrayCategory: TcxStyle; + styleProfessionalCategory: TcxStyle; + styleGrayHeader: TcxStyle; + styleProfessionalHeader: TcxStyle; + styleNoneContent: TcxStyle; + ssProfessional: TcxVerticalGridReportLinkStyleSheet; + ssGray: TcxVerticalGridReportLinkStyleSheet; + ssTransparent: TcxVerticalGridReportLinkStyleSheet; + styleTransparentCategory: TcxStyle; + styleTransparentHeader: TcxStyle; + styleTransparentContent: TcxStyle; + end; + +implementation + +{$R *.dfm} + +uses + cxStyleSheetsLoad; + +type + TcxPScxVGridLnkPredefinedStyleSheets = class(TcxPredefinedStyleSheets) + private + FDataModule: TcxdmPScxVGridLnkPredefinedStyles; + protected + procedure AddStyleSheets; override; + property DataModule: TcxdmPScxVGridLnkPredefinedStyles read FDataModule; + public + constructor Create; override; + destructor Destroy; override; + + class procedure Register; + class procedure Unregister; + end; + +constructor TcxPScxVGridLnkPredefinedStyleSheets.Create; +begin + inherited; + FDataModule := TcxdmPScxVGridLnkPredefinedStyles.Create(nil); + AddStyleSheets; +end; + +destructor TcxPScxVGridLnkPredefinedStyleSheets.Destroy; +begin + FDataModule.Free; + inherited; +end; + +class procedure TcxPScxVGridLnkPredefinedStyleSheets.Register; +begin + cxStyleSheetsLoad.RegisterPredefinedStyleSheets(Self); +end; + +class procedure TcxPScxVGridLnkPredefinedStyleSheets.Unregister; +begin + cxStyleSheetsLoad.UnregisterPredefinedStyleSheets(Self); +end; + +procedure TcxPScxVGridLnkPredefinedStyleSheets.AddStyleSheets; +var + I: Integer; +begin + with DataModule.StyleRepository do + for I := 0 to StyleSheetCount - 1 do + AddStyleSheet(StyleSheets[I]); +end; + +initialization + TcxPScxVGridLnkPredefinedStyleSheets.Register; + +finalization + TcxPScxVGridLnkPredefinedStyleSheets.Unregister; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPScxVGridLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPScxVGridLnkReg.pas new file mode 100644 index 00000000..d35d1511 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPScxVGridLnkReg.pas @@ -0,0 +1,215 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPScxVGridLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignEditors, + {$ELSE} + DsgnIntf, + {$ENDIF} + Windows, Classes, Controls, StdCtrls, cxStyles, cxStyleSheetEditor, + cxCustomData, cxVGrid, cxEdit, cxTextEdit, cxMemo, cxImage, dxPSRes, dxPSUtl, + dxPScxCommon, dxPScxVGridLnk; + +type + TcxVerticalGridReportLinkStyleSheetEditorPreview = class(TcxStyleSheetEditorPreview) + private + FVerticalGrid: TcxVerticalGrid; + protected + procedure Initialize; virtual; + property VerticalGrid: TcxVerticalGrid read FVerticalGrid; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + class function GetStyleSheetClass: TcxCustomStyleSheetClass; override; + procedure SetStyleSheet(AStyleSheet: TcxCustomStyleSheet); override; + + function Control: TWinControl; override; + function GetSize: TPoint; override; + + class procedure Register; + class procedure Unregister; + end; + +constructor TcxVerticalGridReportLinkStyleSheetEditorPreview.Create(AOwner: TComponent); +begin +// inherited; cannot call ancestor method if it's an abstract method in Delphi4(5) !!!! + FVerticalGrid := TcxVerticalGrid.Create(AOwner); + Initialize; +end; + +destructor TcxVerticalGridReportLinkStyleSheetEditorPreview.Destroy; +begin + FVerticalGrid.Free; + inherited; +end; + +class function TcxVerticalGridReportLinkStyleSheetEditorPreview.GetStyleSheetClass: TcxCustomStyleSheetClass; +begin + Result := TcxVerticalGridReportLinkStyleSheet; +end; + +procedure TcxVerticalGridReportLinkStyleSheetEditorPreview.SetStyleSheet(AStyleSheet: TcxCustomStyleSheet); +var + VGridStyles: TcxVerticalGridStyles; +begin + if AStyleSheet is TcxVerticalGridReportLinkStyleSheet then + begin + VGridStyles := VerticalGrid.Styles; + with TcxVerticalGridReportLinkStyleSheet(AStyleSheet).Styles do + begin + VGridStyles.Category := Category; + VGridStyles.Content := Content; + VGridStyles.Header := Header; + end; + end + else + VerticalGrid.Styles.ResetStyles; +end; + +function TcxVerticalGridReportLinkStyleSheetEditorPreview.Control: TWinControl; +begin + Result := VerticalGrid; +end; + +function TcxVerticalGridReportLinkStyleSheetEditorPreview.GetSize: TPoint; +var + I: Integer; +begin + Result := inherited GetSize; + with VerticalGrid.FirstRow do + begin + Result.Y := Height; + for I := 0 to Count - 1 do + Inc(Result.Y, Height); + end; +end; + +class procedure TcxVerticalGridReportLinkStyleSheetEditorPreview.Register; +begin + RegisterStyleSheetEditorPreview(Self); +end; + +class procedure TcxVerticalGridReportLinkStyleSheetEditorPreview.Unregister; +begin + UnregisterStyleSheetEditorPreview(Self); +end; + +procedure TcxVerticalGridReportLinkStyleSheetEditorPreview.Initialize; +const + RowCount = 7; + RowCaptions: array[0..RowCount - 1] of string = + (sdxLuxurySedans, sdxCarManufacturer, sdxCarModel, sdxPicture, sdxCarEngine, + sdxCarTransmission, sdxCarTires); + RowClasses: array[0..RowCount - 1] of TcxCustomRowClass = + (TcxCategoryRow, TcxEditorRow, TcxEditorRow, TcxEditorRow, TcxEditorRow, + TcxEditorRow, TcxEditorRow); + RowEditProperties: array[0..RowCount - 1] of TcxCustomEditPropertiesClass = + (nil, TcxTextEditProperties, TcxTextEditProperties, TcxImageProperties, + TcxMemoProperties, TcxTextEditProperties, TcxMemoProperties); + RowHeights: array[0..RowCount - 1] of Integer = + (-1, -1, -1, 116, 57, -1, 44); + RowValues: array[0..RowCount - 1] of string = + ('', sdx760V12Manufacturer, sdx760V12Model, '', sdx760V12Engine, + sdx760V12Transmission, sdx760V12Tires); +var + I: Integer; + Row: TcxCustomRow; +begin + VerticalGrid.ClearRows; + for I := 0 to RowCount - 1 do + begin + Row := VerticalGrid.Add(RowClasses[I]); + if Row is TcxEditorRow then + with TcxEditorRow(Row) do + begin + Properties.Caption := DropAmpersand(RowCaptions[I]); + Properties.EditPropertiesClass := RowEditProperties[I]; + Properties.Value := RowValues[I]; + if Properties.EditPropertiesClass.InheritsFrom(TcxImageProperties) then + Properties.Value := PreviewImageAsString; + if RowHeights[I] <> -1 then Height := RowHeights[I]; + Parent := VerticalGrid.FirstRow; + end + else + TcxCategoryRow(Row).Properties.Caption := DropAmpersand(RowCaptions[I]); + end; + VerticalGrid.OptionsData.Editing := False; +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterNoIcon([TcxVerticalGridReportLink, TcxVirtualVerticalGridReportLink, + TcxRTTIInspectorReportLink, TcxDBVerticalGridReportLink, + TcxVerticalGridReportLinkStyleSheet]); + // Hide moved property + RegisterPropertyEditor(TypeInfo(Boolean), TcxVerticalGridReportLinkOptionsRefinements, + 'SuppressBackgroundBitmaps', nil); +end; + +procedure RegisterStyleSheetAssistants; +begin + cxStyles.RegisterStyleSheetClass(TcxVerticalGridReportLinkStyleSheet); + TcxVerticalGridReportLinkStyleSheetEditorPreview.Register; +end; + +procedure UnregisterStyleSheetAssistants; +begin + TcxVerticalGridReportLinkStyleSheetEditorPreview.Unregister; + cxStyles.UnregisterStyleSheetClass(TcxVerticalGridReportLinkStyleSheet); +end; + +initialization + RegisterStyleSheetAssistants; + +finalization + UnregisterStyleSheetAssistants; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxDBCtrlLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxDBCtrlLnk.pas new file mode 100644 index 00000000..60a96e7e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxDBCtrlLnk.pas @@ -0,0 +1,427 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxDBCtrlLnk; + +interface + +{$I cxVer.inc} + +uses + Classes, Graphics, DB, dxTL, dxDBCtrl, dxPSCore, dxPSdxTLLnk; + +type + TdxDBTreeListImageColumnHelper = class(TdxTreeListColumnHelper) + protected + class procedure GetImageLists(AColumn: TdxTreeListColumn; AProc: TdxPSGetImageListProc); override; + public + class function ColumnClass: TdxTreeListColumnClass; override; + end; + + TdxDBTreeListControlReportLink = class(TCustomdxTreeListReportLink) + private + FBookmark: TBookmark; + FPrevGridMode: Boolean; + FPrevLockRefresh: Boolean; + FTopIndex: Integer; + function GetDBTreeListControl: TCustomdxDBTreeListControl; + protected + procedure AssignValues(ADataItem: TAbstractdxReportCellData; + ANode: TdxTreeListNode; AColumn, AReferenceColumn: TdxTreeListColumn); override; + function GetDataClass(AColumn: TdxTreeListColumn; + ANode: TdxTreeListNode): TdxReportCellDataClass; override; + function GetReferenceColumn(AColumn: TdxTreeListColumn; + ANode: TdxTreeListNode): TdxTreeListColumn; override; + function GetCheckColumnGlyph(AColumn: TdxTreeListColumn): TBitmap; override; + function IsCheckColumn(AColumn: TdxTreeListColumn): Boolean; override; + function IsGraphicColumn(AColumn: TdxTreeListColumn): Boolean; override; + function IsHyperLinkColumn(AColumn: TdxTreeListColumn): Boolean; override; + procedure PrepareConstruct(AReportCells: TdxReportCells); override; + procedure UnprepareConstruct(AReportCells: TdxReportCells); override; + + function GetPrevGridMode: Boolean; virtual; + function NeedLoadAllRecords: Boolean; virtual; + procedure SaveOptionsDB; virtual; + procedure TryLoadAllRecords; virtual; + procedure UnloadAllRecords; virtual; + + property DBTreeListControl: TCustomdxDBTreeListControl read GetDBTreeListControl; + public + function IsTreeListLink: Boolean; override; + end; + +var + FdxDBTreeListControlAssignDataProc: TdxTreeListAssignDataProc; + FdxDBTreeListControlColumnMapperProc: TdxTreeListColumnMapperProc; + +function DefaultdxDBTreeListControlColumnMapperProc(AColumn: TdxTreeListColumn; + AReportLink: TCustomdxTreeListReportLink; ANode: TdxTreeListNode): TdxReportCellDataClass; +procedure DefaultdxDBTreeListControlAssignDataProc(AReportLink: TCustomdxTreeListReportLink; + ADataItem: TAbstractdxReportCellData; TreeList: TCustomdxTreeList; + ANode: TdxTreeListNode; AColumn, AReferenceColumn: TdxTreeListColumn); + +implementation + +uses + StdCtrls, dxExEdtr, dxDBTLCL, dxPSGlbl; + +type + TCustomdxDBTreeListControlAccess = class(TCustomdxDBTreeListControl); + TdxDBTreeListGraphicColumnAccess = class(TdxDBTreeListGraphicColumn); + TCustomdxTreeListControlAccess = class(TCustomdxTreeListControl); + TdxDBTreeListWrapperColumnAccess = class(TdxDBTreeListWrapperColumn); + +{ - generic text columns - + TdxDBTreeListColumn, TdxDBTreeListMaskColumn, TdxDBTreeListButtonColumn, + TdxDBTreeListDateColumn, TdxDBTreeListSpinColumn, TdxDBTreeListExtLookupColumn, + TdxDBTreeListPickColumn, TdxDBTreeListCalcColumn, TdxDBTreeListHyperLinkColumn, + TdxDBTreeListTimeColumn, TdxDBTreeListCurrencyColumn, TdxDBTreeListMemoColumn, + TdxDBTreeListPopupColumn, TdxDBTreeListExtLookupColumn} + +function DefaultdxDBTreeListControlColumnMapperProc(AColumn: TdxTreeListColumn; + AReportLink: TCustomdxTreeListReportLink; ANode: TdxTreeListNode): TdxReportCellDataClass; +const + CheckClasses: array[Boolean] of TdxReportCellDataClass = (TdxReportCellCheckImage, TdxReportCellString); + ImageClasses: array[Boolean] of TdxReportCellDataClass = (TdxReportCellGraphic, TdxReportCellImage); + GraphicClasses: array[Boolean] of TdxReportCellDataClass = (TdxReportCellString, TdxReportCellGraphic); +begin + if AColumn is TdxDBTreeListCheckColumn then + Result := CheckClasses[tlpoCheckMarksAsText in AReportLink.Options] + else + if AColumn is TdxDBTreeListImageColumn then + Result := ImageClasses[TdxDBTreeListImageColumn(AColumn).ShowDescription] + else + Result := GraphicClasses[(AColumn is TdxDBTreeListGraphicColumn) and not (tlpoGraphicAsText in AReportLink.Options)]; +end; + +procedure DefaultdxDBTreeListControlAssignDataProc(AReportLink: TCustomdxTreeListReportLink; + ADataItem: TAbstractdxReportCellData; TreeList: TCustomdxTreeList; + ANode: TdxTreeListNode; AColumn, AReferenceColumn: TdxTreeListColumn); +var + ATreeList: TCustomdxTreeListControlAccess; + GraphicClass: TGraphicClass; + Stub, AImageIndex: Integer; + AState: TCheckBoxState; + NullStyle: TdxShowNullFieldStyle; + S: string; +begin + ATreeList := TCustomdxTreeListControlAccess(TreeList); + + if ADataItem is TdxReportCellCheck then + begin + with TdxReportCellCheckImage(ADataItem) do + begin + S := ATreeList.GetNodeString(ANode, AColumn.Index); + AState := TCheckBoxState(TdxDBTreeListCheckColumn(AReferenceColumn).GetCheckBoxState(S)); + NullStyle := TdxDBTreeListCheckColumn(AReferenceColumn).ShowNullFieldStyle; + Enabled := (AState <> cbGrayed) or (NullStyle = nsUnchecked); + Checked := (AState = cbChecked) or ((AState = cbGrayed) and (NullStyle = nsGrayedChecked)); + FlatBorder := TdxDBTreeListControlReportLink(AReportLink).FlatCheckMarks; + if not TdxDBTreeListCheckColumn(AReferenceColumn).Glyph.Empty then + begin + Glyph := TdxDBTreeListCheckColumn(AReferenceColumn).Glyph; + GlyphCount := TdxDBTreeListCheckColumn(AReferenceColumn).GlyphCount; + end; + end; + Exit; + end; + + if AColumn is TdxDBTreeListMemoColumn then + begin + with TdxReportCellString(ADataItem) do + begin + Text := ATreeList.GetDisplayValue(ANode, AColumn.Index); + EndEllipsis := aoDrawEndEllipsis in TreeList.Options; + Multiline := True; + TextAlignX := dxTextAlignX[ATreeList.GetCellAlignment(ANode, AColumn.Index)]; + TextAlignY := taTop; + end; + Exit; + end; + + if ADataItem is TdxReportCellImage then + begin + with TdxReportCellImage(ADataItem) do + begin + S := ATreeList.GetDisplayValue(ANode, AColumn.Index); + Text := AReferenceColumn.GetDisplayValue(ANode, S); + EndEllipsis := True; + Multiline := TdxDBTreeListImageColumn(AReferenceColumn).MultilineText; + TextAlignX := dxTextAlignX[ATreeList.GetCellAlignment(ANode, {AReferenceColumn ?}AColumn.Index)]; + if Multiline then + TextAlignY := dxMultilineTextAlignY[Multiline] + else + TextAlignY := dxTextAlignY[AReferenceColumn.VertAlignment]; + S := ATreeList.GetCellText(ANode, AColumn.Index); + TdxDBTreeListImageColumn(AColumn).GetIndexes(S, AImageIndex, Stub); + ImageList := TdxDBTreeListImageColumn(AReferenceColumn).Images; + ImageIndex := AImageIndex; + MakeSpaceForEmptyImage := True; + end; + Exit; + end; + + if ADataItem is TdxReportCellGraphic then + begin + if AColumn is TdxDBTreeListGraphicColumn then + begin + GraphicClass := TdxDBTreeListGraphicColumnAccess(AReferenceColumn).GetGraphicClass(ANode); + LoadPicture(FPicture, GraphicClass, ANode.Values[AColumn.Index]); + if GraphicClass = nil then GraphicClass := TBitmap; + with TdxReportCellGraphic(ADataItem) do + begin + Image := FPicture.Graphic; + ImageTransparent := (tlpoTransparentColumnGraphic in AReportLink.Options) or GraphicClass.InheritsFrom(TIcon); + if not GraphicClass.InheritsFrom(TIcon) and TdxDBTreeListGraphicColumn(AReferenceColumn).Stretch then + DrawMode := gdmStretchProportional + else + begin + if TdxDBTreeListGraphicColumn(AReferenceColumn).Center then + DrawMode := gdmCenter + else + DrawMode := gdmNone; + end; + end; + end + else + begin + with TdxReportCellGraphic(ADataItem) do + begin + ImageTransparent := True; + ImageList := TdxDBTreeListImageColumn(AReferenceColumn).Images; + S := ATreeList.GetCellText(ANode, AColumn.Index); + TdxDBTreeListImageColumn(AReferenceColumn).GetIndexes(S, AImageIndex, Stub); + ImageIndex := AImageIndex; + DrawMode := gdmCenter; + end + end; + Exit; + end; + + with TdxReportCellString(ADataItem) do + begin + if AColumn is TdxDBTreeListGraphicColumn then + begin + Text := AReportLink.GraphicAsTextValue; + Multiline := False; + end + else + begin + Text := ATreeList.GetDisplayValue(ANode, AColumn.Index); + Multiline := TdxDBTreeListGraphicColumnAccess(AReferenceColumn).IsColumnMultiline or + ((ATreeList.GetHeaderMaxRowCount = 1) and (aoRowAutoHeight in ATreeList.OptionsEx)); + //(ATreeList.GetRowLineCount(ANode, Stub) > 1) or (aoRowAutoHeight in ATreeList.OptionsEx); + //AColumn.HeaderMaxLineCount = 0; + end; + EndEllipsis := ATreeList.IsDrawEndEllipsis; + TextAlignX := dxTextAlignX[ATreeList.GetCellAlignment(ANode, AColumn.Index)]; + if Multiline then + TextAlignY := dxMultilineTextAlignY[Multiline] + else + if AReferenceColumn.VertAlignment in [tlTop, tlCenter] then + TextAlignY := taCenterY + else + TextAlignY := taBottom; +// TextAlignY := dxTextAlignY[AReferenceColumn.VertAlignment]; + end; +end; + +{ TdxDBTreeListImageColumnHelper } + +class function TdxDBTreeListImageColumnHelper.ColumnClass: TdxTreeListColumnClass; +begin + Result := TdxDBTreeListImageColumn; +end; + +class procedure TdxDBTreeListImageColumnHelper.GetImageLists(AColumn: TdxTreeListColumn; + AProc: TdxPSGetImageListProc); +begin + inherited; + AProc(TdxDBTreeListImageColumn(AColumn).Images); +end; + +{ TdxDBTreeListControlReportLink } + +procedure TdxDBTreeListControlReportLink.AssignValues(ADataItem: TAbstractdxReportCellData; + ANode: TdxTreeListNode; AColumn, AReferenceColumn: TdxTreeListColumn); +begin + if Assigned(FdxDBTreeListControlAssignDataProc) then + FdxDBTreeListControlAssignDataProc(Self, ADataItem, DBTreeListControl, ANode, + AColumn, AReferenceColumn); +end; + +function TdxDBTreeListControlReportLink.GetDataClass(AColumn: TdxTreeListColumn; + ANode: TdxTreeListNode): TdxReportCellDataClass; +begin + if Assigned(FdxDBTreeListControlColumnMapperProc) then + Result := FdxDBTreeListControlColumnMapperProc(AColumn, Self, ANode) + else + Result := nil; +end; + +function TdxDBTreeListControlReportLink.GetDBTreeListControl: TCustomdxDBTreeListControl; +begin + Result := TCustomdxDBTreeListControl(Component); +end; + +function TdxDBTreeListControlReportLink.GetReferenceColumn(AColumn: TdxTreeListColumn; + ANode: TdxTreeListNode): TdxTreeListColumn; +begin + if AColumn is TdxDBTreeListWrapperColumn then + begin + Result := TdxDBTreeListWrapperColumnAccess(AColumn).ReferenceColumn(ANode); + if Result = nil then Result := AColumn; + end + else + Result := AColumn; +end; + +function TdxDBTreeListControlReportLink.GetCheckColumnGlyph(AColumn: TdxTreeListColumn): TBitmap; +begin + Result := TdxDBTreeListCheckColumn(AColumn).Glyph; + if (Result <> nil) and Result.Empty then + Result := nil; +end; + +function TdxDBTreeListControlReportLink.IsCheckColumn(AColumn: TdxTreeListColumn): Boolean; +begin + Result := AColumn is TdxDBTreeListCheckColumn; +end; + +function TdxDBTreeListControlReportLink.IsGraphicColumn(AColumn: TdxTreeListColumn): Boolean; +begin + Result := AColumn is TdxDBTreeListGraphicColumn; +end; + +function TdxDBTreeListControlReportLink.IsHyperLinkColumn(AColumn: TdxTreeListColumn): Boolean; +begin + Result := AColumn is TdxDBTreeListHyperLinkColumn; +end; + +function TdxDBTreeListControlReportLink.IsTreeListLink: Boolean; +begin + Result := False; +end; + +procedure TdxDBTreeListControlReportLink.PrepareConstruct(AReportCells: TdxReportCells); +var + DataSet: TDataSet; +begin + if DBTreeListControl.DataSource <> nil then + begin + DataSet := DBTreeListControl.DataSource.DataSet; + if DataSet <> nil then + begin + FPrevLockRefresh := TCustomdxDBTreeListControlAccess(DBTreeListControl).LockRefresh; + TCustomdxDBTreeListControlAccess(DBTreeListControl).LockRefresh := True; + DataSet.DisableControls; + if DataSet.Active and (DataSet.RecordCount > 0) then + FBookmark := DataSet.GetBookmark; + FTopIndex := TCustomdxTreeListControlAccess(DBTreeListControl).TopIndex; + FPrevGridMode := GetPrevGridMode; + SaveOptionsDB; + if FPrevGridMode and NeedLoadAllRecords then + try + TryLoadAllRecords; + except + UnloadAllRecords; + FPrevGridMode := False; + raise; + end; + end; + end; + inherited; +end; + +function TdxDBTreeListControlReportLink.GetPrevGridMode: Boolean; +begin + Result := False; +end; + +function TdxDBTreeListControlReportLink.NeedLoadAllRecords: Boolean; +begin + Result := not (csDesigning in Component.ComponentState); //True; +end; + +procedure TdxDBTreeListControlReportLink.SaveOptionsDB; +begin +end; + +procedure TdxDBTreeListControlReportLink.TryLoadAllRecords; +begin +end; + +procedure TdxDBTreeListControlReportLink.UnloadAllRecords; +begin +end; + +procedure TdxDBTreeListControlReportLink.UnprepareConstruct(AReportCells: TdxReportCells); +var + DataSet: TDataSet; +begin + if DBTreeListControl.DataSource <> nil then + begin + DataSet := DBTreeListControl.DataSource.DataSet; + if DataSet <> nil then + begin + //if AutoNodesExpand or{and} FPrevGridMode then + if FPrevGridMode and NeedLoadAllRecords then + UnloadAllRecords; + if (FBookmark <> nil) and DataSet.Active then + DataSet.GotoBookmark(FBookmark); + DataSet.FreeBookmark(FBookmark); + FBookmark := nil; + TCustomdxTreeListControlAccess(DBTreeListControl).TopIndex := FTopIndex; + DataSet.EnableControls; + TCustomdxDBTreeListControlAccess(DBTreeListControl).LockRefresh := FPrevLockRefresh; + end; + end; + inherited; +end; + +procedure RegisterHelpers; +begin + TdxDBTreeListImageColumnHelper.Register; +end; + +initialization + RegisterHelpers; + + if @FdxDBTreeListControlAssignDataProc = nil then + FdxDBTreeListControlAssignDataProc := DefaultdxDBTreeListControlAssignDataProc; + if @FdxDBTreeListControlColumnMapperProc = nil then + FdxDBTreeListControlColumnMapperProc := DefaultdxDBTreeListControlColumnMapperProc; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxDBGrLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxDBGrLnk.pas new file mode 100644 index 00000000..07675e95 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxDBGrLnk.pas @@ -0,0 +1,143 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxDBGrLnk; + +interface + +{$I cxVer.inc} + +uses + dxTL, dxDBGrid, dxPSdxTLLnk, dxPSdxDBCtrlLnk; + +type + TdxDBGridReportLink = class(TdxDBTreeListControlReportLink) + private + FSaveOptionsDB: TdxDBGridOptionsDB; + function GetDBGrid: TdxDBGrid; + protected + function GetGroupColumnIndex(ANode: TdxTreeListNode): Integer; override; + function GetPrevGridMode: Boolean; override; + procedure InternalRestoreDefaults; override; + procedure SaveOptionsDB; override; + procedure TryLoadAllRecords; override; + procedure UnloadAllRecords; override; + public + function IsDBGridLink: Boolean; override; + function IsDBTreeListLink: Boolean; override; + + property DBGrid: TdxDBGrid read GetDBGrid; + published + property Options default [tlpoBands, tlpoHeaders, tlpoFooters, tlpoRowFooters, tlpoPreview, + tlpoPreviewGrid, tlpoGrid, tlpoFlatCheckMarks, tlpoSoft3D, tlpoRowFooterGrid, + tlpoExpandButtons]; + property OnCustomDrawBandCell; + property OnCustomDrawCell; + property OnCustomDrawFooterCell; + property OnCustomDrawHeaderCell; + property OnCustomDrawPreviewCell; + property OnCustomDrawRowFooterCell; + end; + +const + dxDefaultDBGridPaintOptions: TdxTreeListPaintOptions = + [tlpoBands, tlpoHeaders, tlpoFooters, tlpoRowFooters, tlpoPreview, + tlpoPreviewGrid, tlpoGrid, tlpoFlatCheckMarks, tlpoSoft3D, tlpoRowFooterGrid, + tlpoExpandButtons]; + +implementation + +uses + dxPSCore; + +{ TdxDBGridReportLink } + +function TdxDBGridReportLink.IsDBGridLink: Boolean; +begin + Result := True; +end; + +function TdxDBGridReportLink.IsDBTreeListLink: Boolean; +begin + Result := False; +end; + +function TdxDBGridReportLink.GetDBGrid: TdxDBGrid; +begin + Result := TdxDBGrid(Component) +end; + +procedure TdxDBGridReportLink.InternalRestoreDefaults; +begin + inherited InternalRestoreDefaults; + Options := dxDefaultDBGridPaintOptions; +end; + +function TdxDBGridReportLink.GetPrevGridMode: Boolean; +begin + Result := not (edgoLoadAllRecords in DBGrid.OptionsDB); +end; + +procedure TdxDBGridReportLink.SaveOptionsDB; +begin + FSaveOptionsDB := DBGrid.OptionsDB; +end; + +procedure TdxDBGridReportLink.TryLoadAllRecords; +begin + DBGrid.OptionsDB := DBGrid.OptionsDB + [edgoLoadAllRecords] - [edgoCanNavigation]; +end; + +procedure TdxDBGridReportLink.UnloadAllRecords; +begin + DBGrid.OptionsDB := FSaveOptionsDB; +end; + +function TdxDBGridReportLink.GetGroupColumnIndex(ANode: TdxTreeListNode): Integer; +begin + if ANode.HasChildren then + Result := DBGrid.GroupColumns[ANode.Level].Index + else + Result := inherited GetGroupColumnIndex(ANode); +end; + +initialization + dxPSRegisterReportLink(TdxDBGridReportLink, TdxDBGrid, TdxTLReportLinkDesignWindow); + +finalization + dxPSUnregisterReportLink(TdxDBGridReportLink, TdxDBGrid, TdxTLReportLinkDesignWindow); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxDBGrLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxDBGrLnkReg.pas new file mode 100644 index 00000000..c4b14925 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxDBGrLnkReg.pas @@ -0,0 +1,87 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxDBGrLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignEditors, + {$ELSE} + DsgnIntf, + {$ENDIF} + Classes, dxPSdxTLLnk, dxPSdxDBGrLnk; + +type + TdxDBGridOptionsPropertyEditor = class(TSetProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + +function TdxDBGridOptionsPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog]; +end; + +procedure TdxDBGridOptionsPropertyEditor.Edit; +var + I: Integer; +begin + inherited; + if TdxDBGridReportLink(GetComponent(0)).DesignReport() then + begin + Designer.Modified; + if PropCount > 1 then + for I := 1 to PropCount - 1 do + GetComponent(I).Assign(GetComponent(0)); + end; +end; + +procedure Register; +begin + RegisterNoIcon([TdxDBGridReportLink]); + RegisterPropertyEditor(TypeInfo(TdxTreeListPaintOptions), TdxDBGridReportLink, 'Options', TdxDBGridOptionsPropertyEditor); +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxDBInsLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxDBInsLnk.pas new file mode 100644 index 00000000..5c8d2d44 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxDBInsLnk.pas @@ -0,0 +1,70 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxDBInsLnk; + +interface + +{$I cxVer.inc} + +uses + dxDBInsp, dxPSdxInsLnk; + +type + TdxDBInspectorReportLink = class(TCustomdxInspectorReportLink) + private + function GetDBInspector: TdxDBInspector; + public + property DBInspector: TdxDBInspector read GetDBInspector; + end; + +implementation + +uses + dxPSCore; + +function TdxDBInspectorReportLink.GetDBInspector: TdxDBInspector; +begin + Result := TdxDBInspector(Component); +end; + +initialization + dxPSRegisterReportLink(TdxDBInspectorReportLink, TdxDBInspector, TdxInspectorDesignWindow); + +finalization + dxPSUnregisterReportLink(TdxDBInspectorReportLink, TdxDBInspector, TdxInspectorDesignWindow); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxDBOCLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxDBOCLnk.pas new file mode 100644 index 00000000..e58ec765 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxDBOCLnk.pas @@ -0,0 +1,77 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxDBOCLnk; + +interface + +{$I cxVer.inc} + +uses + dxDBOrgC, dxPSdxOCLnk; + +type + TdxDBOrgChartReportLink = class(TCustomdxOrgChartReportLink) + private + function GetDBOrgChart: TdxDBOrgChart; + public + property DBOrgChart: TdxDBOrgChart read GetDBOrgChart; + published + property BorderColor; + property Color; + property DrawBorder; + property FullExpand; + property Transparent; + property TransparentColor; + property UseMetafile; + end; + +implementation + +uses + dxPSCore; + +function TdxDBOrgChartReportLink.GetDBOrgChart: TdxDBOrgChart; +begin + Result := TdxDBOrgChart(Component); +end; + +initialization + dxPSRegisterReportLink(TdxDBOrgChartReportLink, TdxDBOrgChart, TdxOCReportLinkDesignWindow); + +finalization + dxPSUnRegisterReportLink(TdxDBOrgChartReportLink, TdxDBOrgChart, TdxOCReportLinkDesignWindow); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxDBOCLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxDBOCLnkReg.pas new file mode 100644 index 00000000..4cd1ce71 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxDBOCLnkReg.pas @@ -0,0 +1,61 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxDBOCLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI9} + DesignIntf, +{$ENDIF} + Classes, dxPSdxDBOCLnk; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterNoIcon([TdxDBOrgChartReportLink]) +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxDBTLLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxDBTLLnk.pas new file mode 100644 index 00000000..5c907579 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxDBTLLnk.pas @@ -0,0 +1,150 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxDBTLLnk; + +interface + +{$I cxVer.inc} + +uses + dxDBTL, dxPSCore, dxPSdxTLLnk, dxPSdxDBCtrlLnk; + +type + TdxDBTreeListReportLink = class(TdxDBTreeListControlReportLink) + private + function GetDBTreeList: TdxDBTreeList; + function GetHasCollapsedNodes: Boolean; + protected + procedure GetOwnedImageLists(AProc: TdxPSGetImageListProc); override; + procedure InternalRestoreDefaults; override; + + function GetPrevGridMode: Boolean; override; + function NeedLoadAllRecords: Boolean; override; + procedure TryLoadAllRecords; override; + procedure UnloadAllRecords; override; + + property HasCollapsedNodes: Boolean read GetHasCollapsedNodes; + public + function IsDBGridLink: Boolean; override; + function IsDBTreeListLink: Boolean; override; + + property DBTreeList: TdxDBTreeList read GetDBTreeList; + published + property Options default [tlpoBands, tlpoHeaders, tlpoFooters, tlpoRowFooters, + tlpoPreview, tlpoPreviewGrid, tlpoGrid, tlpoFlatCheckmarks, tlpoSoft3D, + tlpoRowFooterGrid, tlpoTreeLines, tlpoExpandButtons]; + property OnCustomDrawBandCell; + property OnCustomDrawCell; + property OnCustomDrawFooterCell; + property OnCustomDrawHeaderCell; + property OnCustomDrawPreviewCell; + property OnCustomDrawRowFooterCell; + end; + +const + dxDefaultDBTreeListPaintOptions: TdxTreeListPaintOptions = + [tlpoBands, tlpoHeaders, tlpoFooters, tlpoRowFooters, tlpoPreview, tlpoPreviewGrid, + tlpoGrid, tlpoFlatCheckmarks, tlpoSoft3D, tlpoRowFooterGrid, tlpoTreeLines, tlpoExpandButtons]; + +implementation + +function TdxDBTreeListReportLink.IsDBGridLink: Boolean; +begin + Result := False; +end; + +function TdxDBTreeListReportLink.IsDBTreeListLink: Boolean; +begin + Result := True; +end; + +procedure TdxDBTreeListReportLink.GetOwnedImageLists(AProc: TdxPSGetImageListProc); +begin + inherited; + AProc(DBTreeList.Images); + AProc(DBTreeList.StateImages); +end; + +procedure TdxDBTreeListReportLink.InternalRestoreDefaults; +begin + inherited; + Options := dxDefaultDBTreeListPaintOptions; +end; + +function TdxDBTreeListReportLink.GetPrevGridMode: Boolean; +begin + Result := not (etoLoadAllRecords in DBTreeList.OptionsDB); +end; + +function TdxDBTreeListReportLink.NeedLoadAllRecords: Boolean; +begin + Result := inherited NeedLoadAllRecords and AutoNodesExpand and HasCollapsedNodes; +end; + +procedure TdxDBTreeListReportLink.TryLoadAllRecords; +begin + DBTreeList.OptionsDB := DBTreeList.OptionsDB + [etoLoadAllRecords]; +end; + +procedure TdxDBTreeListReportLink.UnloadAllRecords; +begin + DBTreeList.OptionsDB := DBTreeList.OptionsDB - [etoLoadAllRecords]; +end; + +function TdxDBTreeListReportLink.GetDBTreeList: TdxDBTreeList; +begin + Result := TdxDBTreeList(Component); +end; + +function TdxDBTreeListReportLink.GetHasCollapsedNodes: Boolean; +var + I: Integer; +begin + Result := True; + for I := 0 to DBTreeList.Count - 1 do + if DBTreeList.Items[I].Count <> 0 then + Exit; + Result := False; +end; + +initialization + dxPSCore.dxPSRegisterReportLink(TdxDBTreeListReportLink, TdxDBTreeList, TdxTLReportLinkDesignWindow); + +finalization + dxPSCore.dxPSUnregisterReportLink(TdxDBTreeListReportLink, TdxDBTreeList, TdxTLReportLinkDesignWindow); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxDBTLLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxDBTLLnkReg.pas new file mode 100644 index 00000000..6149acaa --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxDBTLLnkReg.pas @@ -0,0 +1,88 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxDBTLLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignEditors, + {$ELSE} + DsgnIntf, + {$ENDIF} + Classes, dxPSdxTLLnk, dxPSdxDBTLLnk; + +type + TdxDBTreeListOptionsPropertyEditor = class(TSetProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + +function TdxDBTreeListOptionsPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog]; +end; + +procedure TdxDBTreeListOptionsPropertyEditor.Edit; +var + I: Integer; +begin + inherited; + if TdxDBTreeListReportLink(GetComponent(0)).DesignReport then + begin + Designer.Modified; + if PropCount > 1 then + for I := 1 to PropCount - 1 do + GetComponent(I).Assign(GetComponent(0)); + end; +end; + +procedure Register; +begin + RegisterNoIcon([TdxDBTreeListReportLink]); + RegisterPropertyEditor(TypeInfo(TdxTreeListPaintOptions), + TdxDBTreeListReportLink, 'Options', TdxDBTreeListOptionsPropertyEditor); +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxDBTVLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxDBTVLnk.pas new file mode 100644 index 00000000..63ab11c9 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxDBTVLnk.pas @@ -0,0 +1,158 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxDBTVLnk; + +interface + +{$I cxVer.inc} + +uses + DB, dxTree, dxDBTree, dxPSTVLnk; + +type + TdxTreeViewExReportLink = class(TCustomdxTreeViewReportLink) + private + function GetdxTreeView: TdxTreeView; + protected + procedure InternalRestoreFromOriginal; override; + public + property dxTreeView: TdxTreeView read GetdxTreeView; + published + property AutoNodesExpand; + property AutoWidth; + property Color; + property ExpandLevel; + property ExplicitTreeViewExpand; + property Font; + property GridLineColor; + property Options; + property ScaleFonts; + property SupportedCustomDraw; + property Transparent; + property TreeLineColor; + property UseVertDelimiters; + property Width; + + property OnCustomDrawNode; + property OnInitializeNode; + end; + + TdxDBTreeViewReportLink = class(TdxTreeViewExReportLink) + private + FBookmark: TBookmark; + function GetDBTreeView: TdxDBTreeView; + protected + procedure PrepareContruct; override; + procedure UnprepareContruct; override; + public + property DBTreeView: TdxDBTreeView read GetDBTreeView; + end; + +implementation + +uses + dxPSCore; + +{ TdxTreeViewExReportLink } + +function TdxTreeViewExReportLink.GetdxTreeView: TdxTreeView; +begin + Result := TdxTreeView(Component); +end; + +procedure TdxTreeViewExReportLink.InternalRestoreFromOriginal; +begin + inherited; + SupportedCustomDraw := dxTreeView.IsCustomDraw; +end; + +{ TdxDBTreeViewReportLink } + +function TdxDBTreeViewReportLink.GetDBTreeView: TdxDBTreeView; +begin + Result := TdxDBTreeView(Component); +end; + +procedure TdxDBTreeViewReportLink.PrepareContruct; +var + DataSet: TDataSet; +begin + inherited; + + if DBTreeView.DataSource <> nil then + DataSet := DBTreeView.DataSource.DataSet + else + DataSet := nil; + if DataSet <> nil then + begin + FBookmark := DataSet.GetBookmark; + DataSet.DisableControls; + end; +end; + +procedure TdxDBTreeViewReportLink.UnprepareContruct; +var + DataSet: TDataSet; +begin + if DBTreeView.DataSource <> nil then + DataSet := DBTreeView.DataSource.DataSet + else + DataSet := nil; + + if DataSet <> nil then + begin + if FBookmark <> nil then + begin + DataSet.GotoBookmark(FBookmark); + DataSet.FreeBookmark(FBookmark); + FBookmark := nil; + end; + DataSet.EnableControls; + end; + + inherited; +end; + +initialization + dxPSRegisterReportLink(TdxTreeViewExReportLink, TdxTreeView, TdxfmTVReportLinkDesignWindow); + dxPSRegisterReportLink(TdxDBTreeViewReportLink, TdxDBTreeView, TdxfmTVReportLinkDesignWindow); + +finalization + dxPSUnRegisterReportLink(TdxTreeViewReportLink, TdxDBTreeView, TdxfmTVReportLinkDesignWindow); + dxPSUnRegisterReportLink(TdxTreeViewExReportLink, TdxTreeView, TdxfmTVReportLinkDesignWindow); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxDBTVLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxDBTVLnkReg.pas new file mode 100644 index 00000000..762a7939 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxDBTVLnkReg.pas @@ -0,0 +1,61 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxDBTVLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI9} + DesignIntf, +{$ENDIF} + Classes, dxPSdxDBTVLnk; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterNoIcon([TdxTreeViewExReportLink, TdxDBTreeViewReportLink]); +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxFCLnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSdxFCLnk.dfm new file mode 100644 index 00000000..69e27e82 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxFCLnk.dfm @@ -0,0 +1,414 @@ +object dxFCReportLinkDesignWindow: TdxFCReportLinkDesignWindow + Left = 372 + Top = 310 + ActiveControl = chbxTransparent + BorderStyle = bsDialog + Caption = 'Report Designer' + ClientHeight = 319 + ClientWidth = 552 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 3 + Width = 544 + Height = 280 + ActivePage = tshOptions + MultiLine = True + TabOrder = 0 + object tshOptions: TTabSheet + Caption = '&Options' + object pnlOptions: TPanel + Left = 0 + Top = 0 + Width = 536 + Height = 252 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblPreview: TLabel + Left = 242 + Top = 2 + Width = 38 + Height = 13 + Caption = 'Preview' + end + object gbxTransparent: TGroupBox + Left = 5 + Top = 14 + Width = 226 + Height = 51 + Caption = ' ' + TabOrder = 1 + object lblColor: TLabel + Left = 7 + Top = 24 + Width = 35 + Height = 13 + Caption = 'Co&lor : ' + OnClick = lblColorClick + end + object bvlColorHolder: TBevel + Left = 86 + Top = 20 + Width = 132 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 17 + Top = 12 + Width = 15 + Height = 17 + TabOrder = 0 + OnClick = chbxTransparentClick + end + object gbxBorder: TGroupBox + Left = 5 + Top = 75 + Width = 226 + Height = 51 + Caption = ' ' + TabOrder = 3 + object lblGridLinesColor: TLabel + Left = 7 + Top = 24 + Width = 67 + Height = 13 + Caption = '&Border Color: ' + OnClick = lblColorClick + end + object bvlLineColorHolder: TBevel + Left = 86 + Top = 20 + Width = 132 + Height = 21 + Visible = False + end + end + object chbxDrawBorder: TCheckBox + Left = 17 + Top = 73 + Width = 15 + Height = 17 + TabOrder = 2 + OnClick = chbxDrawBorderClick + end + object stTransparent: TStaticText + Left = 32 + Top = 13 + Width = 76 + Height = 17 + Caption = ' &Transparent ' + FocusControl = chbxTransparent + TabOrder = 4 + OnClick = stTransparentClick + end + object stDrawBorder: TStaticText + Left = 32 + Top = 74 + Width = 70 + Height = 17 + Caption = ' Draw Border ' + FocusControl = chbxDrawBorder + TabOrder = 5 + OnClick = stDrawBorderClick + end + end + end + end + object pnlPreview: TPanel + Left = 250 + Top = 46 + Width = 288 + Height = 226 + BevelInner = bvLowered + BevelOuter = bvNone + Color = clWindow + TabOrder = 1 + end + object ilFlowChart: TImageList + Left = 36 + Top = 197 + Bitmap = { + 494C010101000500040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000002000000001002000000000000020 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084848400848484008484840084848400000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000FF00000000000000FF000000FF000000FF0000000000008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000FFFF0000840000000084000000000000840000000000008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000084000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000084000000000084848400000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000008400000000000000000000848484000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000FF000000FFFF0000FF000000840000000000000084 + 0000008400008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FF00000084 + 000000FF000000FF000000FF000000FF0000008400000084000000FF000000FF + 0000008400000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FF000000FF + 000000FF000000FF000000FF000000FF000000FF00000084000000FF000000FF + FF00008400008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000FF + 0000000000000084000000FF000000FF000000FF000000FF000000FF00000000 + 0000848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000FF000000FF00000084000000FF000000FF000000FF000000FF000000FF + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000008484840000FFFF000084000000840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FF000000840000848484000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFF000000000000FC3F000000000000 + F00F000000000000F00F000000000000FE7F000000000000FF7F000000000000 + FC3F000000000000F81F000000000000C0030000000000008003000000000000 + 8003000000000000C007000000000000F007000000000000F01F000000000000 + FE1F000000000000FFFF00000000000000000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxFCLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxFCLnk.pas new file mode 100644 index 00000000..1a11dc2a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxFCLnk.pas @@ -0,0 +1,564 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxFCLnk; + +interface + +{$I cxVer.inc} + +uses + Classes, Windows, Graphics, Controls, Forms, StdCtrls, ComCtrls, ExtCtrls, + dxFlChrt, dxPSGraphicLnk, dxPSCore, ImgList; + +type + TdxFlowChartReportLink = class(TCustomdxGraphicReportLink) + private + FUseMetafile: Boolean; + function GetFlowChart: TdxCustomFlowChart; + protected + function GetGraphic: TGraphic; override; + function GetGraphicClass: TGraphicClass; override; + procedure InitializeGraphicItem(AnItem: TdxReportCellGraphic); override; + procedure InternalRestoreDefaults; override; + procedure InternalRestoreFromOriginal; override; + public + constructor Create(AOwner: TComponent); override; + procedure Assign(Source: TPersistent); override; + property FlowChart: TdxCustomFlowChart read GetFlowChart; + published + property BorderColor; + property Color; + property DrawBorder; + property Transparent; + property TransparentColor; + property UseMetafile: Boolean read FUseMetafile write FUseMetafile default True; + end; + + TdxFCReportLinkDesignWindow = class(TStandarddxReportLinkDesignWindow) + PageControl1: TPageControl; + tshOptions: TTabSheet; + pnlOptions: TPanel; + gbxTransparent: TGroupBox; + lblColor: TLabel; + bvlColorHolder: TBevel; + chbxTransparent: TCheckBox; + gbxBorder: TGroupBox; + lblGridLinesColor: TLabel; + bvlLineColorHolder: TBevel; + chbxDrawBorder: TCheckBox; + pnlPreview: TPanel; + ilFlowChart: TImageList; + lblPreview: TLabel; + stTransparent: TStaticText; + stDrawBorder: TStaticText; + procedure lblColorClick(Sender: TObject); + procedure chbxDrawBorderClick(Sender: TObject); + procedure chbxTransparentClick(Sender: TObject); + procedure stTransparentClick(Sender: TObject); + procedure stDrawBorderClick(Sender: TObject); + private + procedure ccbxColorChange(Sender: TObject); + procedure CreateControls; + function GetReportLink: TdxFlowChartReportLink; + procedure pbxPreviewPaint(Sender: TObject); + protected + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + procedure LoadStrings; override; + procedure PaintPreview(ACanvas: TCanvas; R: TRect); override; + procedure UpdatePreview; override; + procedure UpdateControlsState; override; + public + ccbxColor: TCustomComboBox; + ccbxGridLineColor: TCustomComboBox; + FPreviewBox: TCustomControl; + constructor Create(AOwner: TComponent); override; + property ReportLink: TdxFlowChartReportLink read GetReportLink; + end; + + PdxFlowChartGetAsGraphicData = ^TdxFlowChartGetAsGraphicData; + TdxFlowChartGetAsGraphicData = record + FlowChart: TdxCustomFlowChart; + GraphicClass: TGraphicClass; + Transparent: Boolean; + TransparentColor: TColor; + Enhanced: Boolean; + end; + +function dxGetFlowChartAsGraphic(const AData: PdxFlowChartGetAsGraphicData): TGraphic; + +implementation + +{$R *.DFM} + +uses + SysUtils, cxClasses, dxPSUtl, dxExtCtrls, dxPSRes, dxPSGlbl; + +type + TdxFlowChartAccess = class(TdxCustomFlowChart); + +function dxGetFlowChartAsGraphic(const AData: PdxFlowChartGetAsGraphicData): TGraphic; + + procedure SaveSelection(AFlowChart: TdxCustomFlowChart; ASelections: TList); + var + I: Integer; + Item: TdxFcItem; + begin + for I := 0 to AFlowChart.SelectedObjectCount - 1 do + begin + Item := AFlowChart.SelectedObjects[I]; + ASelections.Add(Item); + Item.Selected := False; + end; + for I := 0 to AFlowChart.SelectedConnectionCount - 1 do + begin + Item := AFlowChart.SelectedConnections[I]; + ASelections.Add(Item); + Item.Selected := False; + end; + end; + + procedure RestoreSelection(ASelections: TList); + var + I: Integer; + begin + for I := 0 to ASelections.Count - 1 do + TdxFCItem(ASelections[I]).Selected := True; + ASelections.Free; + end; + +var + Graphic: TGraphic; + Canvas: TCanvas; + DC: HDC; + IsBitmap: Boolean; + IsMetafile: Boolean; + Selections: TList; + SaveTopEdge, SaveLeftEdge: Integer; +begin + Result := nil; + if (AData = nil) or (AData^.FlowChart = nil) or (AData^.GraphicClass = nil) then Exit; + IsBitmap := AData^.GraphicClass.InheritsFrom(TBitmap); + IsMetafile := AData^.GraphicClass.InheritsFrom(TMetafile); + try + if IsMetafile then + Graphic := TMetafile.Create + else + Graphic := TBitmap.Create; + try + Graphic.Width := TdxFlowChartAccess(AData^.FlowChart).ChartWidth; + Graphic.Height := TdxFlowChartAccess(AData^.FlowChart).ChartHeight; + if IsMetafile then + begin + TMetafile(Graphic).Enhanced := AData^.Enhanced; + Canvas := TMetafileCanvas.Create(TMetafile(Graphic), 0) + end + else + Canvas := TBitmap(Graphic).Canvas; + + try + if not IsMetafile and AData^.Transparent then + begin + Canvas.Brush.Color := ColorToRGB(AData^.TransparentColor); + Canvas.FillRect(Rect(0, 0, Graphic.Width, Graphic.Height)); + end; + DC := Canvas.Handle; + with TdxFlowChartAccess(AData^.FlowChart) do + begin + BeginUpdate; + try + ControlState := ControlState + [csPaintCopy]; + SaveTopEdge := TopEdge; + SaveLeftEdge := LeftEdge; + Selections := TList.Create; + try + SaveSelection(AData^.FlowChart, Selections); + TopEdge := 0; + LeftEdge := 0; + PaintWindow(DC); + finally + TopEdge := SaveTopEdge; + LeftEdge := SaveLeftEdge; + RestoreSelection(Selections); + end; + ControlState := ControlState - [csPaintCopy]; + finally + CancelUpdate; + end; + end; + + if IsBitmap and AData^.Transparent then + TBitmap(Graphic).TransparentColor := AData^.TransparentColor; + + if not IsMetafile and not IsBitmap then + begin + Result := dxPSUtl.CreateGraphic(AData^.GraphicClass); + Result.Assign(Graphic); + end + else + Result := Graphic; + finally + if IsMetafile then Canvas.Free; + end; + finally + if not IsMetafile and not IsBitmap then Graphic.Free; + end; + except + if Result <> nil then Result.Free; + raise; + end; +end; + +{ TdxFlowChartReportLink } + +constructor TdxFlowChartReportLink.Create(AOwner: TComponent); +begin + inherited; + FUseMetafile := True; +end; + +procedure TdxFlowChartReportLink.Assign(Source: TPersistent); +begin + inherited; + if Source is TdxFlowChartReportLink then + UseMetafile := TdxFlowChartReportLink(Source).UseMetafile; +end; + +function TdxFlowChartReportLink.GetGraphic: TGraphic; +var + Data: TdxFlowChartGetAsGraphicData; +begin + Result := nil; + if (FlowChart = nil) or (FlowChart.ObjectCount = 0) then + Exit; + + FillChar(Data, SizeOf(TdxFlowChartGetAsGraphicData), 0); + Data.FlowChart := FlowChart; + Data.GraphicClass := GetGraphicClass; + Data.Transparent := Transparent; + Data.TransparentColor := TransparentColor; + Data.Enhanced := True; + Result := dxGetFlowChartAsGraphic(@Data); +end; + +function TdxFlowChartReportLink.GetGraphicClass: TGraphicClass; +const + GraphicClasses: array[Boolean] of TGraphicClass = (TBitmap, TMetafile); +begin + Result := GraphicClasses[UseMetafile]; +end; + +procedure TdxFlowChartReportLink.InitializeGraphicItem( + AnItem: TdxReportCellGraphic); +begin + inherited InitializeGraphicItem(AnItem); + AnItem.ImageTransparent := UseMetafile; + AnItem.Transparent := Transparent; + AnItem.Color := Color; +end; + +procedure TdxFlowChartReportLink.InternalRestoreDefaults; +begin + inherited; + UseMetafile := True; +end; + +procedure TdxFlowChartReportLink.InternalRestoreFromOriginal; +begin + inherited; + if FlowChart <> nil then + TransparentColor := dxPSUtl.Control_GetColor(FlowChart); +end; + +function TdxFlowChartReportLink.GetFlowChart: TdxCustomFlowChart; +begin + Result := TdxCustomFlowChart(Component); +end; + +{ TdxFCReportLinkDesignWindow } + +constructor TdxFCReportLinkDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxhcFlowChartReportLinkDesigner; + inherited; + CreateControls; + PageControl1.ActivePage := PageControl1.Pages[0]; +end; + +procedure TdxFCReportLinkDesignWindow.CreateControls; +var + R: TRect; +begin + ccbxColor := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(ccbxColor) do + begin + BoundsRect := bvlColorHolder.BoundsRect; + Tag := 0; + Parent := gbxTransparent; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := dxDefaultColor; +// DropDownCount := Items.Count; + OnChange := ccbxColorChange; + end; + lblColor.FocusControl := ccbxColor; + + ccbxGridLineColor := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(ccbxGridLineColor) do + begin + BoundsRect := bvlLineColorHolder.BoundsRect; + Tag := 1; + Parent := gbxBorder; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := dxDefaultGridLineColor; +// DropDownCount := Items.Count; + OnChange := ccbxColorChange; + end; + lblGridLinesColor.FocusControl := ccbxGridLineColor; + FPreviewBox := TdxPSPaintPanel.Create(Self); + with TdxPSPaintPanel(FPreviewBox) do + begin + Parent := pnlPreview; + R := pnlPreview.BoundsRect; + OffsetRect(R, -R.Left, -R.Top); + InflateRect(R, -4, -4); + BoundsRect := R; + EdgeInner := esNone; + EdgeOuter := esNone; + OnPaint := pbxPreviewPaint; + end; +end; + +{$IFDEF DELPHI7} +function TdxFCReportLinkDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +procedure TdxFCReportLinkDesignWindow.LoadStrings; +begin + inherited; + tshOptions.Caption := cxGetResourceString(@sdxOptions); + lblPreview.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + stDrawBorder.Caption := ' ' + cxGetResourceString(@sdxBorderLines) + ' '; + stTransparent.Caption := ' ' + cxGetResourceString(@sdxTransparent) + ' '; + lblColor.Caption := cxGetResourceString(@sdxColor); + lblGridLinesColor.Caption := cxGetResourceString(@sdxGridLinesColor); +end; + +procedure TdxFCReportLinkDesignWindow.DoInitialize; +begin + inherited; + chbxDrawBorder.Checked := ReportLink.DrawBorder; + chbxTransparent.Checked := ReportLink.Transparent; + TdxPSColorCombo(ccbxColor).ColorValue := ReportLink.Color; + TdxPSColorCombo(ccbxGridLineColor).ColorValue := ReportLink.BorderColor; + lblPreview.ParentFont := True; +end; + +procedure TdxFCReportLinkDesignWindow.UpdateControlsState; +begin + inherited; + ccbxColor.Enabled := not chbxTransparent.Checked; + lblColor.Enabled := not chbxTransparent.Checked; + ccbxGridLineColor.Enabled := chbxDrawBorder.Checked; + lblGridLinesColor.Enabled := chbxDrawBorder.Checked; +end; + +procedure TdxFCReportLinkDesignWindow.pbxPreviewPaint(Sender: TObject); +begin + with TdxPSPaintPanel(Sender) do + PaintPreview(Canvas, ClientRect); +end; + +procedure TdxFCReportLinkDesignWindow.PaintPreview(ACanvas: TCanvas; R: TRect); + + procedure DrawText(ACanvas: TCanvas; const R: TRect; const S: string); + const + uFormat: UINT = DT_CENTER or DT_VCENTER or DT_SINGLELINE; + begin + ACanvas.Brush.Style := bsClear; + Windows.DrawText(ACanvas.Handle, PChar(S), Length(S), PRect(@R)^, uFormat); + end; + +var + R2: TRect; + W, H: Integer; +begin + inherited; + OffsetRect(R, -R.Left, -R.Top); + InflateRect(R, -4, -4); + + ACanvas.Brush.Style := bsSolid; + ACanvas.Pen.Color := clWindowText; + { Border } + if ReportLink.DrawBorder then + begin + InflateRect(R, 1, 1); + ACanvas.Brush.Color := ReportLink.BorderColor; + ACanvas.FrameRect(R); + InflateRect(R, -1, -1); + end; + + { Interior } + if not ReportLink.Transparent then + begin + ACanvas.Brush.Color := ReportLink.Color; + ACanvas.FillRect(R); + end; + + { Charts } + W := R.Right - R.Left; + H := R.Bottom - R.Top; + + { Plan } + R2 := Bounds(R.Left + 2, 4, R.Right, 12); + ACanvas.Font.Style := [fsBold]; + DrawText(ACanvas, R2, cxGetResourceString(@sdxPlan)); + R2 := Rect(R.Left + 30, R2.Bottom + 2, R.Right - 30, R2.Bottom + 3); + ACanvas.Brush.Style := bsSolid; + ACanvas.Brush.Color := clWindowText; + ACanvas.FillRect(R2); + + ACanvas.Brush.Style := bsClear; + { Swimming-pool } + R2 := Bounds(R.Left + 2, 27, R.Left + W div 2 - 22, H div 4); + ACanvas.RoundRect(R2.Left, R2.Top, R2.Right, R2.Bottom, 10, 10); + DrawText(ACanvas, R2, cxGetResourceString(@sdxSwimmingPool)); + + { Administration } + OffsetRect(R2, R2.Right - R2.Left + 30, 0); + ACanvas.Rectangle(R2.Left, R2.Top, R2.Right, R2.Bottom); + DrawText(ACanvas, R2, cxGetResourceString(@sdxAdministration)); + + { Park } + OffsetRect(R2, 0, R2.Bottom - R2.Top + 30); + Inc(R2.Bottom, R2.Bottom - R2.Top); + ACanvas.Ellipse(R2.Left, R2.Top, R2.Right, R2.Bottom); + ilFlowChart.Draw(ACanvas, R2.Left + (R2.Right - R2.Left) div 2 - 1 * ilFlowChart.Width div 2, R2.Top + 10, 0); + ilFlowChart.Draw(ACanvas, R2.Left + (R2.Right - R2.Left) div 2 - 2 * ilFlowChart.Width, R2.Top + ilFlowChart.Height + 20, 0); + ilFlowChart.Draw(ACanvas, R2.Left + (R2.Right - R2.Left) div 2 + 1 * ilFlowChart.Width, R2.Top + ilFlowChart.Height + 20, 0); + DrawText(ACanvas, R2, cxGetResourceString(@sdxPark)); + + { Car-parking } + OffsetRect(R2, -R2.Right + R2.Left - 30, 0); + ACanvas.Rectangle(R2.Left, R2.Top, R2.Right, R2.Bottom); + DrawText(ACanvas, R2, cxGetResourceString(@sdxCarParking)); + + { Crosses } + ACanvas.Brush.Style := bsSolid; + ACanvas.Brush.Color := clBtnShadow; + R2 := Rect(R.Left + W div 2 - 10, 27, R.Left + W div 2 + 8, R.Bottom - 2); + ACanvas.FillRect(R2); + R2 := Rect(R.Left + 2, R.Top + 28 + H div 4, R.Right - 2, R.Top + 27 + H div 4 + 20); + ACanvas.FillRect(R2); + + ACanvas.Font.Style := []; +end; + +function TdxFCReportLinkDesignWindow.GetReportLink: TdxFlowChartReportLink; +begin + Result := inherited ReportLink as TdxFlowChartReportLink; +end; + +procedure TdxFCReportLinkDesignWindow.ccbxColorChange(Sender: TObject); +var + Color: TColor; +begin + if LockControlsUpdate then Exit; + Color := TdxPSColorCombo(Sender).ColorValue; + case TdxPSColorCombo(Sender).Tag of + 0: ReportLink.Color := Color; + 1: ReportLink.BorderColor := Color; + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxFCReportLinkDesignWindow.UpdatePreview; +begin + FPreviewBox.Invalidate; +end; + +procedure TdxFCReportLinkDesignWindow.chbxTransparentClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.Transparent := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TdxFCReportLinkDesignWindow.stTransparentClick(Sender: TObject); +begin + if chbxTransparent.CanFocus then ActiveControl := chbxTransparent; + chbxTransparent.Checked := not chbxTransparent.Checked; +end; + +procedure TdxFCReportLinkDesignWindow.chbxDrawBorderClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.DrawBorder := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TdxFCReportLinkDesignWindow.stDrawBorderClick(Sender: TObject); +begin + if chbxDrawBorder.CanFocus then ActiveControl := chbxDrawBorder; + chbxDrawBorder.Checked := not chbxDrawBorder.Checked; +end; + +procedure TdxFCReportLinkDesignWindow.lblColorClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; + TCustomComboBox(ActiveControl).DroppedDown := True; +end; + +initialization + dxPSRegisterReportLink(TdxFlowChartReportLink, TdxCustomFlowChart, TdxFCReportLinkDesignWindow); + +finalization + dxPSUnregisterReportLink(TdxFlowChartReportLink, TdxCustomFlowChart, TdxFCReportLinkDesignWindow); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxFCLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxFCLnkReg.pas new file mode 100644 index 00000000..29d6cc26 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxFCLnkReg.pas @@ -0,0 +1,61 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxFCLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI9} + DesignIntf, +{$ENDIF} + Classes, dxPSdxFCLnk; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterNoIcon([TdxFlowChartReportLink]) +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxInsLnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSdxInsLnk.dfm new file mode 100644 index 00000000..9940cbda --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxInsLnk.dfm @@ -0,0 +1,2322 @@ +object dxInspectorDesignWindow: TdxInspectorDesignWindow + Left = 353 + Top = 289 + BorderStyle = bsDialog + Caption = 'dxInspectorDesignWindow' + ClientHeight = 341 + ClientWidth = 585 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 5 + Width = 577 + Height = 300 + ActivePage = tshOptions + MultiLine = True + TabOrder = 0 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = '&Options' + object lblShow: TLabel + Left = 6 + Top = 6 + Width = 26 + Height = 13 + Caption = 'Show' + end + object bvlShow: TBevel + Left = 40 + Top = 10 + Width = 222 + Height = 4 + Shape = bsBottomLine + end + object imgGrid: TImage + Left = 6 + Top = 32 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblBehaviors: TLabel + Left = 6 + Top = 142 + Width = 47 + Height = 13 + Caption = 'Behaviors' + end + object bvlBehaviors: TBevel + Left = 66 + Top = 147 + Width = 196 + Height = 4 + Shape = bsBottomLine + end + object Image4: TImage + Left = 6 + Top = 166 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 7778800000000000000000000000078888888888880000000000000000000000 + 007880FFF7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7FF777777FFF77777FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F8F7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7F7F8888FF7F88888FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F8F7777777777777777777078888888888880F7F7F888FFF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F0788077777777777777777777770788C8888C88880F7FF888888FFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880F0F7777777FFFFFFFFFFFF0788CCCCCCCC880F77777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7F7F8888FF7F88888FF7 + F0788077777777777777777777770788C8888C88880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F7F7F8888FF7F888888F7 + F0788077777777777777777777770788CCCC8CC8880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCCCCCC880F7FF88888FFFFFFFFFFF7 + F07880F0F777777FFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F77777777777777777777 + F078800000000000000000000000078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F888888880F88888888888078888888888880F77777777777777777777 + F07880F877778880F87777777778078888888888880F77777777777777777777 + F07880FFFFFFFFF0FFFFFFFFFFFF078888888888880FFFFFFFFFFFFFFFFFFFFF + F078800000000000000000000000088888888888880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object chbxShowBorders: TCheckBox + Left = 90 + Top = 29 + Width = 169 + Height = 17 + Caption = 'Border' + TabOrder = 0 + OnClick = chbxOptionsClick + end + object chbxShowHorzLines: TCheckBox + Tag = 1 + Left = 90 + Top = 51 + Width = 169 + Height = 17 + Caption = 'Horizontal Lines' + TabOrder = 1 + OnClick = chbxOptionsClick + end + object chbxShowVertLines: TCheckBox + Tag = 2 + Left = 90 + Top = 73 + Width = 169 + Height = 17 + Caption = 'Vertical Lines' + TabOrder = 2 + OnClick = chbxOptionsClick + end + object chbxShowImages: TCheckBox + Tag = 5 + Left = 90 + Top = 117 + Width = 169 + Height = 17 + Caption = 'Images' + TabOrder = 4 + OnClick = chbxOptionsClick + end + object chbxShowExpandButtons: TCheckBox + Tag = 8 + Left = 90 + Top = 95 + Width = 169 + Height = 17 + Caption = 'Expand Buttons' + TabOrder = 3 + OnClick = chbxOptionsClick + end + object chbxAutoNodesExpand: TCheckBox + Left = 90 + Top = 167 + Width = 169 + Height = 17 + Caption = '&Auto Node Expand' + TabOrder = 5 + OnClick = chbxAutoNodesExpandClick + end + object chbxAutoWidth: TCheckBox + Left = 90 + Top = 189 + Width = 169 + Height = 17 + Caption = '&Auto &Width' + TabOrder = 6 + OnClick = chbxAutoWidthClick + end + object lblPreview: TStaticText + Left = 275 + Top = 3 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 7 + end + end + object tshColors: TTabSheet + Caption = '&Color' + object lblGridLinesColor: TLabel + Left = 10 + Top = 219 + Width = 79 + Height = 13 + Caption = '&Grid lines color : ' + end + object bvlGridLineColorHolder: TBevel + Left = 91 + Top = 215 + Width = 168 + Height = 21 + Visible = False + end + object gbxCaptionTransparent: TGroupBox + Left = 5 + Top = 73 + Width = 262 + Height = 61 + Caption = ' ' + TabOrder = 3 + object lblCaptionColor: TLabel + Left = 6 + Top = 29 + Width = 72 + Height = 13 + Caption = 'Caption Color: ' + end + object bvlFixedColorHolder: TBevel + Left = 86 + Top = 25 + Width = 168 + Height = 21 + Visible = False + end + end + object gbxTransparent: TGroupBox + Left = 5 + Top = 7 + Width = 262 + Height = 60 + Caption = ' ' + TabOrder = 1 + object lblColor: TLabel + Left = 6 + Top = 29 + Width = 35 + Height = 13 + Caption = 'Co&lor : ' + end + object bvlColorHolder: TBevel + Left = 86 + Top = 25 + Width = 168 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 18 + Top = 5 + Width = 15 + Height = 17 + TabOrder = 0 + OnClick = chbxTransparentClick + end + object chbxCaptionTransparent: TCheckBox + Tag = 1 + Left = 18 + Top = 70 + Width = 15 + Height = 17 + TabOrder = 2 + OnClick = chbxTransparentClick + end + object gbxGroupTransparent: TGroupBox + Left = 5 + Top = 141 + Width = 262 + Height = 61 + Caption = ' ' + TabOrder = 5 + object lblGroupColor: TLabel + Left = 6 + Top = 29 + Width = 64 + Height = 13 + Caption = '&Group Color: ' + end + object bvlGroupColorHolder: TBevel + Left = 86 + Top = 25 + Width = 168 + Height = 21 + Visible = False + end + end + object chbxGroupTransparent: TCheckBox + Tag = 2 + Left = 18 + Top = 139 + Width = 15 + Height = 17 + TabOrder = 4 + OnClick = chbxTransparentClick + end + object stTransparent: TStaticText + Left = 33 + Top = 6 + Width = 76 + Height = 17 + Caption = ' &Transparent ' + FocusControl = chbxTransparent + TabOrder = 6 + OnClick = stTransparentClick + end + object stCaptionTransparent: TStaticText + Left = 33 + Top = 71 + Width = 109 + Height = 17 + Caption = ' Caption Transparent ' + FocusControl = chbxCaptionTransparent + TabOrder = 7 + OnClick = stCaptionTransparentClick + end + object stGroupTransparent: TStaticText + Left = 33 + Top = 140 + Width = 101 + Height = 17 + Caption = ' Group Transparent ' + FocusControl = chbxGroupTransparent + TabOrder = 8 + OnClick = stGroupTransparentClick + end + end + object tshFonts: TTabSheet + Caption = '&Font' + object btnFont: TButton + Left = 8 + Top = 14 + Width = 110 + Height = 23 + Caption = 'Fo&nt ...' + TabOrder = 0 + OnClick = btnFontClick + end + object edFont: TEdit + Left = 8 + Top = 42 + Width = 256 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + end + object btnGroupFont: TButton + Tag = 2 + Left = 8 + Top = 130 + Width = 110 + Height = 23 + Caption = 'Grou&p Font ...' + TabOrder = 4 + OnClick = btnFontClick + end + object edGroupFont: TEdit + Left = 9 + Top = 158 + Width = 256 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 5 + end + object btnFixedFont: TButton + Tag = 1 + Left = 8 + Top = 72 + Width = 110 + Height = 23 + Caption = 'Fi&xed Font ...' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 2 + OnClick = btnFontClick + end + object edFixedFont: TEdit + Left = 8 + Top = 100 + Width = 256 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 3 + end + end + object tshFormatting: TTabSheet + Caption = 'Formatting' + ImageIndex = 4 + object lblRefinements: TLabel + Left = 6 + Top = 6 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlAppearance: TBevel + Left = 79 + Top = 10 + Width = 183 + Height = 4 + Shape = bsBottomLine + end + object imgGraphics: TImage + Left = 6 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FF7FFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF777777F + F07DD0F77777777FF7FF70888FFF07DDCCCCCCCCDD0F77777777FF7FF7FFFF7F + F07DD0FFFFFFFFFFF7FF70FF8FFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF7F00F7F + F07DD0F777777FFFF7FF70FF8FFF07DDCDDDDCDDDD0F777777FFFF7FF7F00F7F + F07DD0FFFFFFFFFFF7FF70000FFF07DDDDDDDDDDDD0FFFFFFFFFFF7FF7FFFF7F + F07DD0F77777777FF7FF777777FF07DDDDDDDDDDDD0F77777777FF7FF777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFCCCCCFFF07DDCCCCCCCCDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FCCCCCCCFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F7777777FFF7FFCCCCCFFF07DDCDDDDCDDDD0F7777777FFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7F9999999FF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F777777777F7FF99999FFF07DDDDDDDDDDDD0F777777777F7F7777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F80000888887F88888888707DDDDDDDDDDDD0F80000888887F88888888 + 707DD0F80000000087F80000008707DDDDDDDDDDDD0F80000000087F80000008 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0FFFFFFFFFFF7FFFFFFFFF707DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + 707DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxFlatCheckMarks: TCheckBox + Tag = 3 + Left = 90 + Top = 29 + Width = 169 + Height = 17 + Caption = 'Flat CheckMarks' + TabOrder = 0 + OnClick = chbxOptionsClick + end + object chbxCheckMarksAsText: TCheckBox + Tag = 4 + Left = 90 + Top = 51 + Width = 169 + Height = 17 + Caption = 'Display Check Marks as Text' + TabOrder = 1 + OnClick = chbxOptionsClick + end + object chbxDisplayGraphicsAsText: TCheckBox + Tag = 7 + Left = 90 + Top = 73 + Width = 171 + Height = 17 + Caption = 'Display Graphics As &Text' + TabOrder = 2 + OnClick = chbxOptionsClick + end + object chbxTransparentColumnGraphics: TCheckBox + Tag = 6 + Left = 90 + Top = 95 + Width = 171 + Height = 17 + Caption = 'Transparent Column &Graphics' + TabOrder = 3 + OnClick = chbxOptionsClick + end + end + end + object pnlPreview: TPanel + Left = 283 + Top = 50 + Width = 290 + Height = 246 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + object pnlPreviewHost: TPanel + Left = 5 + Top = 5 + Width = 279 + Height = 234 + BevelOuter = bvNone + BorderStyle = bsSingle + Ctl3D = False + ParentCtl3D = False + TabOrder = 0 + object insPreview: TdxInspector + Left = 0 + Top = 0 + Width = 279 + Height = 234 + BorderStyle = bsNone + Color = clWindow + Ctl3D = False + Enabled = False + ParentCtl3D = False + TabOrder = 0 + DividerPos = 133 + GridColor = clBtnFace + Flat = True + Images = ilVendorLogos + PaintStyle = ipsNET + Data = { + DB0000000200000008000000030000000E00000069724D657273656465734265 + 6E7A08000000000000000900000069724D424D6F64656C080000000000000007 + 00000069724D4253555608000000000000000900000069724D4250686F746F08 + 00000003000000050000006972424D5708000000000000000A0000006972424D + 574D6F64656C0800000000000000080000006972424D57535556080000000000 + 00000A0000006972424D5750686F746F02000000080000006C46080A0E000000 + 69724D6572736564657342656E7A08000000FCF9080A050000006972424D57} + object irMersedesBenz: TdxInspectorTextRow + Caption = 'Mersedes-Benz' + ImageIndex = 0 + IsCategory = True + RowHeight = 22 + OnDrawCaption = InspectorDrawCaption + end + object irMBPhoto: TdxInspectorTextGraphicRow + Caption = 'Photo' + RowHeight = 44 + OnDrawCaption = InspectorDrawCaption + OnDrawValue = irMBPhotoDrawValue + end + object irMBSUV: TdxInspectorTextCheckRow + Caption = 'SUV' + OnDrawCaption = InspectorDrawCaption + OnDrawValue = irMBSUVDrawValue + ValueChecked = 'True' + ValueUnchecked = 'False' + Text = 'False' + end + object irMBModel: TdxInspectorTextRow + Caption = 'Model' + OnDrawCaption = InspectorDrawCaption + OnDrawValue = InspectorDrawValue + Text = 'S600' + end + object irBMW: TdxInspectorTextRow + Caption = 'BMW' + ImageIndex = 1 + IsCategory = True + RowHeight = 22 + OnDrawCaption = InspectorDrawCaption + end + object irBMWModel: TdxInspectorTextRow + Caption = 'Model' + OnDrawCaption = InspectorDrawCaption + OnDrawValue = InspectorDrawValue + Text = 'X5 4WD' + end + object irBMWSUV: TdxInspectorTextCheckRow + Caption = 'SUV' + OnDrawCaption = InspectorDrawCaption + OnDrawValue = irMBSUVDrawValue + ValueChecked = 'True' + ValueUnchecked = 'False' + Text = 'True' + end + object irBMWPhoto: TdxInspectorTextGraphicRow + Caption = 'Photo' + RowHeight = 44 + OnDrawCaption = InspectorDrawCaption + OnDrawValue = irMBPhotoDrawValue + end + end + end + end + object ilVendorLogos: TImageList + AllocBy = 2 + Height = 21 + Width = 22 + Left = 4 + Top = 310 + Bitmap = { + 494C010102000400040016001500FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 000000000000360000002800000058000000150000000100180000000000A815 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000C0C0C0C0C0C0C0C0C0C0C0C000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000C0C0C0A6C4A5737273615F5FA2A9A2D2BCD10000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000C2C5C27B7C795D595B696165746C716359 + 6065676693969600000000000000000000000000000000000000000000000000 + 00000000000000000000000000008D6A8D366A35000000000000000000000000 + 0000000000001C441C7BB07B0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000D6D4D55F6560989394E3E3E4FFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFC9C5C6424848A1A1A10000000000000000000000 + 00000000000000000000000000000000A18EA1384538000D0000000003020702 + 0000000000000000000000000000000000000000282E26A69FA5000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000B4B3B54D4248EAE9E7FF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9B9799656A69 + 00000000000000000000000000000000000000000091AA91000D000000000706 + 040808060000000302001F1F1C25242E23262A04070D00000002020000000000 + 0E00647063000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000C7C9C85B58 + 5BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFB7B2B8676C6B000000000000000000000000000000C0C0C0161C16 + 0000001C1C1A1616120000001F1F1E93908D808080DFC285C5C1C07D81871115 + 2200000003030800000008180BAEBAAF00000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + C0C0C0695F65FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF928B8FBBB9BA00000000000000000000 + 00008190800403042A2928262425000000637362D6D6D5F6F4F1808080BE9B37 + B18414C09F4AA1947F2F31390000000706040000005A62590000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000ACA0A595A096A1A0A1E7E3E6FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2EEEFA1A0A1CCD4CF433E400000 + 00000000000000E0DBE12329202022203E3C3D141112668164FFFFFFFDFAFEF4 + F7EE808080C5A336B98F00BE9500C69B20A69777181F2F000000000000121513 + B1DCB10000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000737172FFFFFFC6C2C3655C63828983CD + C8C9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCDCDCC757577616866D2D2CF + FFFFFF9E9D9DC5C8C5000000000000A2AEA113131248494A272627384736FFFF + FFFFFFFFECF9ECF5F1EC808080CFA93AC49D00C5A100BB9400C7A1247B7C7C00 + 000D0000000000006C8F6B000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000C0C0C0959192FFFFFFFFFF + FFE3EBE7A5A2A27472773831377D7A7DE3E1E3E8E3E68E8E8C443E44575A5CAA + ABAAEEF1EEFFFFFFFFFFFFEAEBE9877D82000000C0C0C0767D772E312B5B5A59 + 383738959495FFFFFFF9FFFBF4FFF6FFFFFF808080D8AD37CDA200D0A700C8A1 + 00C59900BEA46424273A0000000000003C3F3CC0C0C000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000CDD0CE + B5B1B5FFFFFFFFFFFFFFFFFFEBECECB6BCB8C2BCBD2F3C38000000332C344849 + 4DBDB6BABBB9B9F1EEEEFFFFFFFFFFFFFFFFFFFCFFFF716C6F000000C0C0C06A + 74695050506362626D6A6BCAC9CAF3F5F3EDEEF0ECEFF0F6EEF2808080D2B54E + C59F18CBA728C5A327C29D1FCFAD60454D6503090E000000292929C0C0C00000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000BEB8BEC5C6C4FFFFFFFFFFFFFFFFFFFFFFFFF8F8F7A9A5A9EAE7E6 + 969496969196E0E0DEABAEAAF5F7F4FFFFFFFFFFFFFFFFFFFFFFFFFCFFFF776E + 74000000C0C0C076817467656479797A827F7BC8B78FDCC487D1BA7FD0B574D6 + BB63B8A351D7D5C9DADCD1D9D8D4D5D4D1D8D6D2E1DFDA43464B060607000000 + 242524C0C0C00000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000C5BFC4B9C2BBFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFA0A1A0E6ECE83A3639A2A4A2FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFF9F9F7767F78000000C0C0C0969D957A7873989792818388B2A383F2D3 + 7BE1C26ADFBA5CE2B642B9AB00808080FDFFFFF8FAFFF1F3FAFFFFFFE3E5E812 + 110E080908000000333232C0C0C0000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000C0C0C093898FFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFD4CED1CECACC222022DEDBDBFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFDEDEDE908D8D000000C0C0C0B9C2B6898782A5A29F + 8D8E95918F8DEDD498EBCC87E0C581E8C471BCC233808080FCFFFFF5FAF4F4FC + F2FFFFFF90918D000000000000000000546A54C0C0C000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 5E585CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE3E1E1B9B7B72F443FF2EE + F0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF999D98C1BDC0000000000000E2 + E2E192918BA5A19F808080808080A8A18EFBE69DEBD18AEDCC84C2C94B808080 + FFFFFFFFFFFFFFFFFF8080804954478080807574750E0C0D8EBB8DC0C0C00000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000676766E6E5E4FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3F0F1 + A0989D575658FAFBFAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFD545A550000 + 00000000000000F9C8F9BCC4B9D7D4D48080808080809FA0A6B0AB99F2DEA5FF + E39DCEDA5F808080FFFFFFFFFFFF808080707A707A637A808080808080818C80 + D7CDD70000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000C0C0C0444749FFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFF98A49B70666CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 8E8C8CB6AFB5000000000000000000000000E2FFE1C6C4C48080808080808080 + 8084868D929290E0DAB5CAD876808080808080AB8FAB2945248A878880808080 + 808080808088A988808080000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000ACABA97D87 + 85FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF958F93878787FFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFBEB5BC585256000000000000000000000000000000000000C5F0C3 + DBDADB808080808080808080A0A1A17F90888DA68D55695980A07B474644625E + 5E373937808080B1B3B1728672C0C0C000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008F858C797A78FFFFFFFFFFFFFFFFFFFFFFFFA9A7A99E9F9EFFFF + FFFFFFFFFFFFFFFFFFFFABADAA5C605D00000000000000000000000000000000 + 0000000000000000C3D6C0A8AFA2ABA8A2B8B5B4B1AAAA808080808080472F3F + 8080805E825D646263423F3F192318A0AC9EC6D3C50000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000B7B8B7424645BFBBBDFFFFFFFFFFFF + CFCCCBC5C3C4FFFFFFFFFFFFD8D8D77875768B898A0000000000000000000000 + 00000000000000000000000000000000000000C0C0C0B7D0B3A1B29B8E9087D3 + C8CFAE9EAFC0C0C08080802237233345323C553CC0C0C0C0C0C0000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000009B + A09D525052706B6E7C75798C89888782836E6D6D8E898BC0C0C0000000000000 + 000000000000000000000000000000000000000000000000000000000000C0C0 + C0C0C0C0A8D5A6AECBAB718670534951B8B7B7527450808080D88CD800000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000C0C0C0C0C0C0C0C0C0C0C0C0C0C0C000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C00000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000424D3E000000 + 000000003E0000002800000058000000150000000100010000000000FC000000 + 0000000000000000000000000000000000000000FFFFFF00FF87FFFC0FF00000 + 00000000FE01FFF003F0000000000000F8007FC000F0000000000000F0003F80 + 0070000000000000E0001F000030000000000000C0000F000030000000000000 + C0000E000010000000000000C000060000100000000000008000040000000000 + 0000000080000400000000000000000080000400000000000000000080000400 + 0000000000000000800004000000000000000000C00006000000000000000000 + C0000E000010000000000000C0000F000010000000000000E0001F8000300000 + 00000000F0003FC00070000000000000F8007FE000F0000000000000FE00FFF0 + 03F0000000000000FF83FFFC0FF0000000000000000000000000000000000000 + 00000000000000000000} + end + object ilCarPhotos: TImageList + AllocBy = 2 + Height = 44 + Width = 87 + Left = 32 + Top = 310 + Bitmap = { + 494C010102000400040057002C00FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 00000000000036000000280000005C0100002C000000010018000000000070B3 + 000000000000000000000000000000000000000000FDCBFF6D5D8FA47AD38A6D + BD8A6AC18B72C07D62B2665B9B6C5BA26E609B654E9767599369549565579664 + 559362538F655C92695B9469589567559360579262599564548C6254895F528C + 5E4E895D4A885B50885954875D54895D5489555483584F7E5F477C5A457A554A + 7B5850774B4D642E3B481F2A2E1D261B1F271C2229231E29201B281D1A261D1C + 241E1A231D16221D19231E18241B18221A19221A1129150F2A1415281915301A + 162F181C261D1E2325192420152B16182F18152B19152C1A162F1B192A1B0F30 + 181B2A1B253027222A20242F1426321A24320E142508333F18111E1D24351F33 + 3E32332B293333302526022E40302435193F402C07080B000000727689656C7D + 666C80646A7C666A7D6A6D81696C7F65687C6C6F83686E7E6B717E6E75836E72 + 7C6F727F72778371768270737E69707C68727D68727F6A71816B7484686F8068 + 6D7E666B7C6C717B6B6E7C6D737E73747F7674807374807475826F717D747681 + 70727E71737C6F737D6E747E73737E74758074758074768176768275747F7775 + 8173747F7576817476806F707B6E6F7A6D717B65737B69767E6C737C69707A69 + 707C6C7180686C7D696F7F6C6E816E6D7E686F7869707B6B717C6E737D6B707A + 6F747D70757F71757F73737E73758074758172748173757F72717C73737E7475 + 7E75777F76778076748074737E72727C73727D75737F85838E4A4C4E00000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000007000EFCC8FF53466C8764BB785C9E7A5FAB6C5F9E57427C6751 + 93644A8E574783584687584E855540825F4E8C5A458562508863508B594E8753 + 4A865C4F855C4B845C4C7F57477D56458250407D55467C594A7E55447D503D79 + 523D79503F734B3F6C463F6B49436A4A446C403E5A2622221316001E26111920 + 2C09161C0B180E111D18142219111E19081F120C2C0D142C140D1C150D1C1616 + 221A16231B111F160F1F120F22140C23160B20140C1F151A251D20241F132018 + 1C2F1F1B271F15251912261914231A18261B13231B0D1E0E2938251B240E1628 + 0E202C1A19251116270D1D2C181929141A20142E3F271E1F201829113C393906 + 2A0000120033301E1B180F687382B7C5E4A7B5CFABBBD3AABAD1AABCD3A6BAD1 + AABBD3AFBCD4AFBDD4AFBCD6AFBBD6B0BDD7B3BBD5B5BED8B1BBD4B5C0D7B9C4 + DBBEC6DBBEC4D8BFC5D9BEC1D6BFC3D7B9C1D5B9C1D6B3BCD1B0BCD7B2BCD6B3 + BFD7B8C0D8BBC2D9BCC2D8BFC4DABEC3D9BEC2D9BDC3D9C6C7DCBABDD3BFC5D9 + C5C6DCC5C6DAC2C9DDBFC5D8C0C5D9C3C7DBC2C6DBC5CADFC3C5DAC7CAE0C2C3 + DAC3C5DAC2C4D8C4C5DABFBFD4BBBDD4BEC0D5BFC3D7B9C1D5BAC1D4BDC4D9B7 + BFD7B1BBD2B5BDD9B4BDD8B2BCD5B3BED5B2BDD5BABED7B9BED6B9BDD5BCBFD6 + C0C3DBB8BFD6B7C3D7BDC5DBC3C5D9C3C8DDC9C6DAC7C6DACBC7DCC6C5DAC7C5 + DCC5C2D8C9C3DBC6C1D7D6D1E57F7F8500000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000009150FEBADFF + 524873805EAC765DA16C549C59468D665088664F95543E815E52875942855944 + 855C448864558F645289594582614F8C62528A5B4C855545825B477D594F7A55 + 497E55438053437A55457B55487C5044794D42735043735044744C406D493C6A + 48406C4437532F31442E5591465EC03A315B1E1F00192519181C240E1614091C + 130F20131D2A1D152E1D0B2518132218121E13141F1619261E13221B18231A19 + 2016121D1512221F11201B1B261C2327201A231F2329220E201819231F202625 + 1E251F23291F2024261A241F192B0F1928181B2C1F242F1C1C2F20272F201A2A + 2013240F162812222E222F361C021F201D2400464B2C0622004B394A00060861 + 6A75A5AFCD9AA4BB97A2BA97A1BB9BA8C399A7C197A3BD9EA7C09CA5C09BA4BC + 9CA7BE9DA9C1A0A8C0A1ACC2A0AAC1A1AAC39A9FB795A0B897A1B99AA3BC9FA7 + BCA1AAC0A7AEC2ABB2C4ABADC3AAAFC3B0B5C8AAB1C6A3ABBFA8AFC3A4ABBDA1 + A8BAA8AFC1A9AEC1ADB2C5B1B5C5A8ADBDA9AFBEACAEBFADAFBFADB3C3AEB4C4 + B2B5C5B1B7C5A4AAB9B6BAC9B2B1C2B0B0C2AEB3C2ABAFBEAFB0C1B8B5C8B9B6 + C8B7B6C5B6B4C4B4B2C2B3B2C4B1AEBFB1AFC1B1B1C4B5B6C7B2B2C5ACB0C4A7 + ADC0AAB1C3A8B0C3ADB0C3ACB0C2AAAFC2A7AEC0A5AABEA7AFC2A8ADC2A8ACC0 + B0B4C2AFB3C3AEAEC0B4B3C5B0B1C2B2B5C5B3B7C6B6B6C6B9B5C5B4B0C1C5C1 + D0706E7700000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000001509D097FF52476F7F65A36A4E986D5E8F + 634D8C573C8F57447E5B4E85573C7E5C468958438761548B5940845A4C895943 + 845D4B885D4D815E477E5C4A815848845246794C407657467B55467C5347794A + 40704A3C6F4F42715046734E44734C406F483E6D403557302B52313C877A76B9 + C5C6EF84A6F00728620F0C00232012031115001400031600001B0B001F150725 + 1D18291C0E1B07001502031C0E02190B00180900190B021A06001208000C0202 + 1600001904001404061F08001200000F080B1A0B02190300140200130D152511 + 001E001329141A23131B2A1218250F19291E2731280015041622082A2E1B031E + 0B1B3A00392C3B3A254B3D33397D7A7C000406616572A0A6C4969FB497A2BA9B + A6BD9DA8BF96A1B997A2BA9EA8C09CA6BE98A6BD96A8BD8DA4BBA0A7BF9DA8C1 + 95A6B9A9B1C2A9A5B99AA3BA98A3BC99A5BC9AA6BE96A1BB94A2B794A0B5A2A6 + BD9DA5BB9DA5BBA5A8BBA6A9BAAAAFC1B0B2C5ADACC1ABAFC3AAAFC4A8ADC1A9 + AEBFAEB2C4B0B5C6A9B2C1ABB4C3A8ABBCADB3C5ACAFC0B0B0C3B2B0C4B5B3C5 + B9B4C6B5B0C4B7B5C5C0BECFC0BED0B8B6C7B5B5C7B4B0C0C1BDCDC0BCCCC1BE + CEB9B6C7B7B6C5B9B8C8B2B1C2ACABBCAEB1C2B3B0C2BFB7C8B8B3C5B5B5C6B1 + B0C1B3B3C5B1B2C3A9AABCAAADC2AFB2C7B9B5C9ADAEBFB2B3C4B5B7C8BDBDCD + B3B4C5B6B7C8B3B4C5B6B5C5B5B0C2B7B3C5CFC9D97C79860000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000012D5B0FF4B3B696D57987251995C548C644F8A543E87624F7F5F4E87 + 5440845E468A6250835C5C88513D845645885B51835850825E4B7E5E4A7C5047 + 7458487E5A4C80554777514873544977534574534472494073404572484B6F46 + 456E44477046496536324D1E2865616DACDED4DEFFFFFCECEFFF6E7CB5000B27 + 0012000C2E09433D54724C8364436A54395A55385E583E5B513F4F4438443F31 + 434A344A543E4C594551574553563D47574B5F605276664D6E634B665E496262 + 4C655F4B635F496961566C615463564057453D4C36373D3E3746453520082222 + 0D3202241D00002B18082E11031D001F3427543D5B3E4C404D455E6B506E3831 + 47AAA0BD1D00126C707DB5BED8A4A9C0A1A6BF9EA5BEA1A4B9A6A9BDA0A3BA9D + A5B8A0A6BCA7ACC4A9ADC7A9B2CAA1ADC6A6B3CBA5AFC69FABC19BABC3A0ACC5 + A2ADC4A0ABC29DA9C19CA7BF9EACC49CAAC29FABC29CA9BF9AA7BFA3B0C89CA9 + C4A1ADC7A3AEC1ABB5C6A9B0C4ABB2C6AEB5C9B2B5C7B4B6C8B5B7C9B9BACCB9 + B9CAB6BCCFADB5C6AFB4C8ACB3C7A8AFC5A6AFC2A6B0BFAAB2C3ABB3C3A1A7B7 + 9EA0AFA5A4B49FA2B0B8B3C1B6B1C0B0AEBDB6B5C5B9B7C8C0BECFBFBACBC5BF + D0C8C5D4C3C1D0BEBBCAC0B9C8C2BAC8C5BDCCC6BECEC4BDCCC3BECEC5C1CFC1 + C1D0B9B8C6C0BECEBDBBCCBCBBCBBEB9CBB6B2C5B8B6C7BFBCCDBDBBCCBEBBCC + BFBBCEBAB6C9CBC6D97973810000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000060813C197FF46355B65 + 5098705592584284655890543E886754875B44865B478B5F4E8C5F5082604B8A + 5949855E4784574B7B5C4A7E58427B55457A55487653467B55447B5142774D43 + 6F4E45734F44744E4073483F7147406C453E68453F66454460353E4815284932 + 3F81B0B0C8EADAEBA594D6B9B1EEC4C7EE3A40690000001A2023836EA7B387D2 + 9A72AC9269A19266A08D6294895781844870814B6D784D657549606A42575627 + 3F995D76CD8DB3AD78AC735677483C483A2C3B45324747384B45364A483A4E46 + 394C433C4B4436434931455C4E5D5C43596743606E546A583D504A4348381F39 + 00220000000059646E745C84603E686855643C2940B387B1150E0B636A78A3B1 + C997A4BA96A2B99DA5BD9DA2B69FA6B8929CAF8A95A7939CB28189A060667947 + 4B604F5257595B675258675057664E54664552683E4F644C586F555F73586075 + 5460754B596E4F5E72566175626E805F6880626D865C6880526078555F795560 + 79515D7557647D4D596F50607449586D4651674753694B566C485166444E643C + 485F3A496137445A36425835475C2E3B51161D2B0C14260D13281113262B2A34 + 292936282836303347282C4632374D3D46583D455845475C50546A575D705962 + 716164746A6A7970717F7C7B8A7D7D8F9090A1A09DACA6A2B0ABA9B7B8AEBDBA + B1C0BDB4C2B5B5C2ADA8B5B0ADBDB2AEBFAFABBDB2AEC0B4B0C2C8C5D878737E + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000081109BD87FF362A5B6B4D926B508D6B5B9158428A4C + 38836F5E935E448A5D4688614E8A58497F654D845B467B5844785C457D5A4878 + 52437B59437B5848765042765342795140745047725243724C3D714C39704B3E + 6B453B644337623F39593B37492E2B3A00004543428BE0D4E3CFC3EB9296D8D3 + D2F8DBD3FF64688E000000322739AD93D0BCA3E59B88C2977EB89971AE97619A + 9352828D4E73653D571C1B1B001400000D00000000492F3F8E577A7D4868361F + 2E14120D1B1D141F180F201D0D1A151814160C091F00001300000D0000180000 + 190000000013000C061E0B3434446E4C5A7B43659058867E5D5E111312242044 + 7C586F7B4E6945394EB586AE150018676C78AEB5CD9CA5BA99A1B8A1A4BE9CA2 + B89AA6B8919FB398A0B593A1B2141F33242736333444030B1300000804001800 + 000C000000313340616B824D5A6F3A44542E354A161F370B1830020F2800031E + 00031E00001600001800001D000820141C3300031E0000150000160000180000 + 1800041E0C122F00021D00001606091F070C24090E270D1A3012182E282A3F00 + 001918152B4E5360868893464B5800041400001600001300000C00000031394B + 3A3E50353E4E3B43533A43563843563D42553E44543E4857424958424B58474E + 5D606676444A59131423222230262732312F3935334337343E4A4D55968B9680 + 7987817A89827C888A86908D8793A196A3605A63000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000E11 + 0DB27FF446345C7960A06035865E50845B4E8B654F8758518A633E856A528C68 + 4C885B437B5B44766643805E477D5644735E47795A4876574375554074534071 + 5642734E3F7146466D4B3E704B386C493866473E60463C5738324C2C2942332C + 3E292E3C0003465A5293F0EAF6E0DFFACFD7F0EBF3FFD1CDFF726FA10000003A + 2F46B09BE0B49DDD9678B28C67A5885C93814B7A7543666F425C523346220F1F + 1902152919253C3745423A4A40293C53304C633E5C623F595F445A5D38535E3C + 5964445C64465C5C3F5E5B3C635D3E5561405062354B503F4F4B3238533E4326 + 1A19000000544755AD6EAF251C006A484D63376455605185386F4F324AAC92B0 + 19001272737DC3C4D8B1B0C4B7B6CBAFACC1B1B0C5B0B2C5AAACC1C8C5D62F33 + 40565D6BC7C5CFE5DAE2B3ABB22B354200001D09081F03090C0000008D919CB2 + B6CCA1A7BEA1A6BD9AA1B4979EB09199AD8C92A9878DA57F889F717C8E6F7B8D + 7D8795191E2B02000F0E07150B06140B04151106160703123642517E8B9F7881 + 9769798E6C7A8D6A78896E788A8188994F5261001220BDBBC7F9EBEF948E97C7 + BFC998979B00001A03081B0C0D1A06021227263A959BA7878F9B8089938C8897 + 8C8B988B8B988C8E9B838A988A8C9B8C8B9BA8A6B577707803000606001C0003 + 1F00001A03001D03001E00001B000007504F59B0ABBA9C97A59D97A6A5A0ADA3 + 9CA7B4AAB76B656F000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000110706BF8BFF523562665F946243 + 845C45826F5F8D5E4282594D836C4686613E8162487E64487C5843795A47775E + 48765748765C467A5944785542765A3F74524473503B724C3F6D4A476A43396A + 453A5E403A54362F4C2C2E42292C3C2F2A3F2F2E39111A230000397472A3FBF7 + FFEDE9FAE0E1EFEAF5FFDCDEFF7E7DA80000004F455FBDA9F5B095DB9774B192 + 6AA98962998558857A486A6E395B703860743E657242647444667845697B3D66 + 793B6373446871486B6E3F6574426979456D76496B72426A6E376070405F784C + 657344676C45656A396468486663465C6645576F405E543E563B334F78516B00 + 1A000000009D5A775F5E727A4B6F502C48C78FB70B0C0E726F7ABDB5CBACA8B9 + ABA9BBACABBCAEABBAAEABBBC3BDD0887F8D293440E3D7E3DCC7D23E2F3D524F + 5DADA9AE1E1F31000013070B11020203020406BDBBCDA19EB6A2A5BAA0A2B59B + A1B1A1A6B89BA0B5A3AABDA3A2B9AAACBEB6B7C644445000000D0F0F1E0C0B1C + 0606190808120306120C0B14000000323A4A9CA4B88A96AA8B92A88F97AC8393 + A88B96AA1415278C8D97C5B5B4483844CBB7C99A8B98928E9A6C697400000309 + 0B19090916020211767786B1B3C8A0A1B5A1A4BAA0A2B8A5A8BEA0A3B8A7A8BD + A1A3BAB2B1C585839100000003061D0D081D0B061B0D0C19040615060B1A0B09 + 1F0D0E260000085A5D6FBBBBCDA9A8BDA6A9BCA8A8B9B9BBCC6C727D00000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000F041AC797EE4B3C6C633A876D5C866A52896850885D43826648 + 7A65458161407C5F4782654B7B5B4B785B49775B4277573D7C604E7856427757 + 3E775B4B75493F6C493E6B4B3B674D3F643E375739314B362F4429263B232636 + 2A283C1D20260C1A0606081F0C07508B90A7FFFFFFE1E1F9D4D2EDF2F8FEE5E8 + FF7776A0000009685F84CBBDFFAD9BE69E87C7A18CC6977AB893619C8C4F7E80 + 466B7E45687F446D7F4472834871874D7B804B7E794D7F85558A87588B80528B + 89578F8D5F958D64968D62938D60968C6295886095885D938A5A8E905E868356 + 858B527C824A7181527581517C73405F71545F6D40713E2733504860000000AD + 7F93844075D698BD1A09127B737FCDC4D8BCB4C6BFB5C6B9B0C2BCB0C3B7ABC0 + D6C9D93C3A4887969FD5BCC5F5E9F15E5F69282630C6B6BE3C3D4E00000F090B + 110C070C000000878490D3CADEBAB8C9BCBBCDB8B6C9B9B8CABCB8C9BBB9CAB5 + AFC3C7C4D68C89950C090902071208091A0706160E0B1B0E0C1604040F090914 + 0F0D1C000000898D9FBDB9CAACAEBEA9AEBEB3B6C5797C8C353942E1CAD45855 + 5A000000F1ECF284818A000000C1B4BB00000806091A0B0B0F0403131D1D2C68 + 68777C7D8C787B9082869888879C8F8B9F938FA29397A89B9BA827273200000B + 0D0E1D090D19000000685F6A4F505900000E080818090E24060B2911162BA7A1 + B5BFB7CBB5B2C2B4ADBBC5BFD076717E00000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000070D19CC87E3 + 423C6673458C6C5982654E7F6138825F4D7E694C7D6847806746805E457C624B + 77634B7B5540735E467A5F467D57426E4F3D6F523E704D3966534570473B6640 + 345640324C372C4730273C2E293622232C13201E000800040606574A6E855EB8 + 3D287B7B808BFDFFF9BABEEE9596CFEFF1F6EBF2FF5A6398000028847CA6D9D1 + FFC8C0F1C5BDE9B2A4E59884D59880C49B76A79C64909B608F9B67959B6E9F9D + 79AFA083BAA98BC2AC91C6A891C7AA98CAAF9BCAAB87BCAF91C5B79CCFB99AD0 + B497CEAF96CCA893C9A88AC7B08FC7A888BAA58EBFA987C1A180B89C76AC9672 + 9E985D88955A878C5881955B7D945E7E55495D691E4D987776EA94CC1A06147D + 737DD2C5DAC0B6C8BAB1C3BFB6C7C4B7C8C5B4C6C8BACB222532DCD0D9472E37 + 969E9FF1EFF2B6ABB5EDDCE686808A0000150B090E0E0E0400000038354C8F87 + 986A6670635B6C5A5164544E5E534E5D514C594C495953515E29273702000F09 + 09190B09190806180B081A070713040311060613060B1C00000D231F369F9BAA + 787687706E836E6B7D32354064626CC3ABB5E1D4DCA39FA4D8D4DB8E89916B67 + 7BC5AFB5191E3002031806080707071103001600000E00001100000900000F02 + 000F0B07110C0913080B0F0F111303000B07081307081208091302030C272426 + 2C2E320603140706160B071B08041F000019756F83C0BACCB0A7B5B0A5B2BFB4 + C4756C7700000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000200F19C587E54B326B7A58875D3C6463437C + 6848836B5182663D79724B8768467D604C786A4C6E563D7959477F5C46725D47 + 735240694E406B4C3E674D3C61503D574C3D4E362B3B2A2C2E222623201B241C + 1D1300110000000023133C784CA3B086D39A85BB2C2555525666F7F9F3D8DDF6 + A7B2D8EEF4FADEE0FC46458311073BB0AAC6FFFFFF9293D70003B16174D4F6FD + FEF9F8FFD0B2D0C47E98BC788EBE8299BE7E96BA7993B97E92BC818FBB788DB7 + 6C85C06C84BD7181C46E84CF6B88D37389D17A8DD2758AD77A8ADD8190DB7E93 + DC7F97D48099CB839EC5819BC786A5C591B4CFACD4AA93C0BA95C1A56292A774 + 989A578EBE6A87575A59500230FFC7EA280318777681C9C3DDB4AEC3B6B1C2B6 + B1C3B5AEBFD2C3D5C7C2D031313EDDCBD7534E59ABA1ABB4A0A7ACA1A7635C63 + 73707706061A0303080E0C0908061800001202030D00001200000D00000F0000 + 0F00001100001100000B00000E0000110906160B081607021503001304021400 + 001202001202001202061500001800001807070900000C00000300000600000E + 7C7484BFB3BCCFC1C5FFE0E8897E84837A82FFEAF9493D454B4D58000012030B + 0D0B081808041F0406190006190D0B180B091807041404031606001406040E06 + 060F0809140708120808130909140B0B1504030D02001408041A07041609071B + 0D041E040B2212112C5A5A71A69FAE98919FB5ABBA69646E0000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000015D29EE54D3855664078704F80674A7F775D84654F7B7A568A6A3F80 + 5F3D7262517660437E5D486B52366D5E397C54446E583F6C533D684838573B3A + 392B3333282730201C1F0C0B0D070B1300180703110035163F744C9AA282CEB1 + A1D4D1D6F6C8C8F5342B5E1E202BD7D8DBFFFFFFF3F9FBEDEFFFA8A8E226245B + 383C64E6E9EEE8ECFE5C6BCE737CD0EFEAF6F4DBE1C6879DC05D73C56279C468 + 7ABD6675BB687CC57285C77587C57389BB6A83C1747FD18895C67A9AB77196AD + 78919E71919F66879A718E86668A825D85845B86906686996984A76F7AAF7090 + BC6C8DBA6176BC5C77DD889FAA616CD2B2D6C5A4BEC38EA7A9809FE57CB03B11 + 1BF6B8F92F0D2367646AB4A8BCA4A0B39B98ABA3A2B3AAA4B57B7C8D4E4A5D32 + 3848D3C5CFFFEDF7CBAEBCB5A5B0A79EA711141980797C09090F0707120B0611 + 110D25070B1503031904031F02021A00021A00021B02031C03021C080B1E0B0D + 1B0B0D1E0B0B1D09091D0F12220E0D1E0D0D1E120F22130F220F11220C122212 + 142914192E12182F151A30292B400002140B0B1F8E7D8D726871151C2CB0A8B4 + AF9EA2C4B1B5887980C7B9C140394200001208081408041B07091B0304130607 + 160B070F0907110706140708160704150909110908120708120B091309091308 + 09120909130708120906190906150907150808190C041C070C24000222000000 + D1D0DEB5B3C0C6C2D273737C0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000080213CD8ED947294E76 + 5188744F7C7555856E4C81755281644677643A776A507B5A4970563C6F5D3D6B + 573E67543D6B50485A43344E4230462F1F36231C1D1A18150D12160F0C16090D + 030000023522446F43888E69B6AC9ED2BBBAE0C5CAF2CDC9FFA08FD42015360F + 1316ACABCDF9F4FFE1E3F8D3D8FF8488C2020048605E84F4F7F9FFFFFFFFFFFD + FDFCFEF1EDF8E4D4E6DDABC1CE809BB36379A4657CB78AA7B690A9B08099C99E + B4CCB2C8B399B6B297ACAA839FA87DA9A18EB79D86AC937695938FA6A5A3B9B3 + A4B99685A1B7AEC5A29DB98777979C80A291809BAC94B4C7A0C97D465DC29BBD + DEBBD7A36480BC7B98CE98B8CCA9D8D57F814F1E3AFFCAFF2A152366636EA8A7 + B79796A7928CA1ADA3B56C667600192F060E20201E38D4C9D38175795C59647A + 7F8BC5B5C1968F9DA798A004020E0800120F1223242639232A3C383D4F393F4F + 3C3F503C3F513A3D4F333D4F333C4D30394B30394D343C4E3C4253343F523A44 + 563942543740533842533842523742533842543B46573F4556444658383D4F3E + 4A5A0000020F0F236D66766E7279524E5E848293787F8778747E0000003C4249 + 3C3A4900001407041402092007091D0906190D0B1C04030F0603130404130404 + 130604130708140708160806140E09160F09150907160606130403110B041308 + 000E08061604021508081506091E0D0E270000076D6D78B5B5C6C2C0D36F7279 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000161213CA82D7472C4D825E9377547D7552826C467B67 + 3E736E56816742766956755B43715B2E6F5B49725C4B704B39531C1E2012040F + 110C00140808140026001100000B000000001C12286A4687805CAA9487C5C6CC + F3CFD1F8ABA1DB9E8ED6B3A1EE9F8DC92F274900001B586187C8D0EEEEEEFFCE + CCF747477E00002CA4A2B3FFFFFFFEFFFEEBEDF1E9F0F3FEFFFFE2D5E3B490B5 + AE6F90C17F92D9C1D2D5DEF6CAC2E2C7A1BEAB8294C5A1B3E6BAD0C496B5AC87 + AECD96B7A388947D797C7B6D77726175716C777A797F545A5DA99FAF6E556D6F + 6D6E826F876B7076807C867A6575D4B4D1874E86C8B0E7CDBBCEC2A5C1935484 + C486A6C56D6F484B71FFDBFF29041B7B717DC5BDD0B1AABCB3A8BDC5B6C73C3E + 4F1622390D0F23131327A59DAA34343F5558658E898F595363DECED7796A7A00 + 0D190E001400021C0B1129585E707278867278867377857678867679876F7886 + 6D7685727B87737D89767D8A767A887A818E79838E79818E7B84907C85917C84 + 917C84927D84917C84927F82908083908487946069780000030B0D1F464653B2 + AEB6D2C2CC81757D4C4F59A8A7B434384D7F7A8303060F0E0E230402120B1125 + 11152B1113290308230E08190B081D0B071A0B061A0C0318070B1D121B29090D + 1E09091C08091C08061A00021609061602031400021302001500001400001300 + 001409092306082000000E585B6FCFC8DD767680000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000E00 + 00DC98F25F4260705487764F84745A846442747151816C43766550815B3F725E + 38676A58850F181D14000000000000000012130C35303E29293C131E2732182A + 3000407350949778C6A49AD2CCCDEFD6D8FFAA9EE0917EC8988ACEADA3E2CCC5 + FFB1A8D6392F4E0000282024546A6E88B2B3E06C6FA0000023474767E8E6EDFF + FFFFE6E6F0F2F4FAFFFFFED9C9D6C4ACC9D2C6ECC1A6D4A96287B16880C2819A + BB7F9DAB819EA2738FB96D83BD7786B084A3DD9DC0CB8CA07A6B787666777568 + 6F726A6B796A727A6576534B5AA598AA857F867B72838D8088676157A1749903 + 1502C3BFC7C97AA3D7D9FF730748A68193F8EEFFEDB2A66F225C877395FFC9F2 + 31092A827783DCCADECFB8C9D1C0D23133451E2E3C242A3E00000E2C32434443 + 53ACA7B8DFD0E094878D08090BB1ABB1363A5307142004000E000219666B7C8C + 909F8083908184927F84937F84927E82917B808D787D8B7F8390818392828591 + 7E83907E84927F83908185938084928084927F83907E828F7F85927F85918282 + 917F818E8184917079850000000C0F20151B279C919EBEB4B93530304C4A4EBF + B8C0C5B9C249444608111E00081508091D00001100091D00061C000007000008 + 00000700000F00000E07041D06061C0F12270606190B081B0404180F0D1D6C34 + 428784886B666A7268736A616C635D676B676F4C47530000150B0C2700002232 + 3444C7C3D37A7882000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000001C0D0EDC9AEE5029577561877148 + 766643786F517F724D775F407662517D4E4075704367352F755E83B800000024 + 1A000000000207004636555C477F4D33666F4889856AAEAEA1D9C4C4ECCACCF7 + B2A7E89686D09C8ED4AC9FE1B2A5E3BCB4E5D4D5FFC0C0ED433E4D00000B3D3C + 8225245B0000300F09591C14578E8CA1FBFBFBFFFFFFFEFDFCFFFFFFEFF5F2D6 + D0DFCAA2C3C596B4CDA7C0E1BACAD3A4B7BD839ED8B5C6FFF9FFF0D5E5B17792 + 9A6783D69AB5E9A3BA846173594A56735A67755F6E6F6073775E727358675F52 + 5FB387A266666E756774746176775C72A299A1433B3DA7A2B3D8A4CFD4B5D19B + 6AA0BA89A1D0D5FFFF96A82A495DA34A89F5CAF92402187A737ED1C2D4C2B8C8 + 8A8795878796B1B1BE51525E00000F070F25333748827A87AE9AA7CBBDC42C2E + 376D6A75222C3F00000D0000155154649597A3838693888A9887889685869584 + 8596848596848692848794878796878795878795878995878895868894878896 + 878795878996878996878996888A978688958787948787968787967579890000 + 000C0D231216292A2A39C5B4C13A3F48777075A198A25857600B131F1F243009 + 0D180000006666785C5C6753505F57505E4044503D3F4B3E3A483B34451E2C36 + 07041B00001408021A06041B02001A001923B53249747C81AC9AA6877B7CB2A7 + AA998E929C949780767C0000120800200E1323A19DA6DDD0E06D6B7300000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000160011DAA1DF593362675475714A76704A7B714E7C6043775F45 + 7C5C457D5B4072602E5B3E3FAAFFFFFF524D610000000013000200025533717A + 4F9F785BA7A29ACBCACDF3C3C4F2ABA1DCA08DD49C8DD4ABA0DCB5AFE6B5AEE8 + B4ABDFBFBBDFD7DEFACFD4FB62617B0000002423455C5EAD5657A11812502F2E + 51CFCFD4FFFFFFFAF9FAFCFAFAFCFFFFDDE6F4C4A1C1BD5E78D59DA4EEE3EEC8 + A7C5A07598AB84A0E1B7C8F9DCEAB18BA8925173BA7C92F6A6C0C5879760565C + 5B505B6C4F5D6A5A625F5C676A5A673E4652454E5B9662764459624444505246 + 553C5B567C6E7E2025377B898DFFDBF8AF5D9675505AC088BDFBE6FFC387A059 + 4368995C84FCD4FF2E09207A7480CDC1D4A9A0AF9E94A3AB9EAEBBABB8777282 + 0000190402153235443134464848578480895655621C24351F1D32000007242E + 439293A1898A9887879687889584849186839387859586859583829084859287 + 869385859184859184859283859283849181839081829080828F828491828491 + 85859187879480818E8483908F8F9F85879800000408031E1D23351C222C241E + 31646676706E7D504E590D0B1928394B07072000000C060618F9EFFFC9C0CDC5 + B8C5B8A7B8B5A5B1B5A6B5786B71B8A1ACC8B6C1726B7816152400061B00001B + 00001900091C51182E72697660556163576871606B65565E72686F4F46510003 + 1A060B1A7D707AB4AAB5D5CCDC7D747E00000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000001B0E1AD38DCD + 4B3155734C7E724C6D714F79673E7A684C7C5E3B7A744D7D96608D994F83263B + A9FFFFFF8E93C2000000140D18B886F06C559E9C96C5D2DAF9D4CFFDA598DB96 + 83CFA991D4B1A5DFB8B3E9BCB5EDB7B8E7C2C6E6DBDAEBDADEEED4D8F9DFDFFF + A0A1BF151A1F04000031253D0E09380C0D259D9DA3FFFFFFFEFAFEF7F2F9FFFF + FFF6F8F9C5C1D6C7ACCDDCBAD1CFB4D2C49EC8AF7090B3677BBA8597B2839BA5 + 5D76AE5C70D691A1DD92A7BB718AB7758DCF899ED48FA0CA8C9CD190A0D195A8 + D593A4C7939DC88C95D7879ABB8C97C88894C58794C08D98CF8E9EA28783D697 + ADBA5A7EBFC0E8C87F8EAA4668FFB39D6F4278A588BF6D4D75EDBFFF1F0D207B + 727ED2C5D7B1A2B3A79BA8AB9BACB0A2B2A197A714132402071F090B1E303244 + 2E334623253823293929293D090218000008777D8B928F9D8A88968C8B998F8E + 9D8E8D9C938D9B948E9C948E9C95909E9993A19993A19794A29996A39C99A59D + 9BA7A19CA9A19AA7A29EABA8A0AEA8A0AEA8A1AEADA5B0B0A3B0AEA4B2ABA3B2 + BBB1BEC5BCC600000806022502021C2324392B30431D22371B1F321B26352E35 + 4809182803001A0000079491A1DECAD9C8BDC8C5B8C3B1A1AEAC96A3B29DA940 + 3E473B424DAD9EA9A4969F8D8489666169504D5A4C485740444F3C4252343740 + 3C3744373443342F3B33333D31354031304020263966697589797FAC9CAAD4C6 + D677717B00000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000001B1113C288BC563054835587754A72655175 + 673A7774447A8163909A6091B47A9FA0498B376FB9FFFFFF929ED8000000764F + AFDAD0FFC0C9DED4D6FFAB99E18A76BF9D88CFABA1E1B6B4E7B5B5E8B6B5E6C9 + D0EAE2E6F3E9ECFAD4D9F4C0C5EEC0C5EFDEE4FFE7EEFC74738D000000000000 + 04040E838196FFFDFFFDF8FDF4EDF6F9F4FAFFFCFFF3F3F7C7BBD8AC7FAC8F46 + 6CA14F6DBD75859F616D8B5367985A6FAB566BCB6980E191A6CF879AC76F7CC7 + 6978BF6A84BF6B88BD6E88B96886B86983BF7286BD7B8FBB7A93C57A95BA718A + C58093C18092CD809CC48293C27799D2818DB57FAADE949A871227FFE9FFB898 + AEFFB4C54F356D9885AD463B6DF2CDFF090C1D686470B8AEC0B5A9B8AE9FB1A6 + 98AAAA9DABBEB1BE333544000011040D2500061E0F14291C20350E1E2F02091E + 00000081808DE0CFDBD4C5D0D6C7D2DBCBD5E1CDDBE1CFDCE1D1DCE5D4E0E7D6 + E1E6D4E0E5D6E1EAD5E1EBD6E1EAD5E1ECD6E2EDD7E1ECD8E4EADAE5EDDBE5ED + DDE6EBDCE6EBDCE6EDD7E4EED6E4EDD5E1E5D3DFD4C5D2E9DEE343404A000003 + 09092503021F0F152E22293C2B37481D2B3C0214280E081E00000058626FF9F3 + FCE7D5DEE3CAD2DBBAC4C6A4AFBE9099BC979FB58C95A5808AC2909DBC919BB9 + 939BBD97A1C6A0A8B08E98B3919BB591A1B5949BB08B97B18C97AE8B94B39099 + B18C959F8A909D8A8EAD8E997B646D9D8E9BDBCCDE7F79840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000070E00ED93E0623E5B7C4681664A77765478875786875C8E95618DA26D95 + AA75977B1973749FD5FFFFFFB5BBDE000000FFFFFFD8E1FEA699E09587CE9488 + CCAB98DBB1A6E5BBB5E6BFBEE6CCD1ECEAF0F8E9EBF4D4D6F4C3CEF2B8BBEEBA + B8ECC3C7F0CAD5F7EFF8FFF4F5F377748C2F2B52ABA9BAFFFCFFF5E2F5E8D9EC + F6F0F8F2ECF6F5EEFCF8EFFFCAA3C09245668D4054A26570BB707CCE6F7FD372 + 85D57487DA8093DA899ECF7C8FC5697CC86B7CCD7082CD7182CB6C7ECD6C83CD + 6982CB6E7BCD6F81D1697CBE627DC1687BCA6B7ECF6E84C86F81C76C7DCE6E80 + C66F7FCA7281DA93A6C5668BE8877A884B6FFFEFFFAC869F775088888DA65749 + 77E1E9FF00061C6B6973B0A6B9AEA5B3FEFAF9F8EEF0F3E4EEE7D8E2C6BFC809 + 0E2600061B00092003091F00081F000019000C1E797789FFEEFAE9D4E0EADCE5 + F4E2ECF4E4EEF2E5EEF3E5F0F3E7F0F2E6EFF3E6EFF8E9F3F4E6F0F3E6EFF2E6 + F0F3E6EFF2E7EFF4EAF0F8EBF2F9E8F0F9E9F2F9E8F1F8E9F1F5E7F0F1E8F3F3 + E5F1EFE7F1F2E6EEF3E4EEEEDFE5D3CCD2060C2000001500001C000019000018 + 00001200001A00001A02081C6C7881F2EDF3EDE0E8E9D6DDE1D0D2C8B3B5B093 + 98AE8D90A58C90AC8B8DB5969996858A8B7378A78A8D9B7E848D727C97888C85 + 777A83727882787895888C877D7F86797A8E7C7F937B80BF8A91CB8C94CA8C95 + EFB7C3CEBBC5CBC2D1716D770000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000D0E02FFA0F94D2B5072 + 5278845584895885875686925F919D65929E6C98AC6E9677125A6F98D2FFFFFF + A6B5D4000000FFFFFF9186D99782CBAEA5E1B3AAE3A3A0E1B9BDE7DFE1F4ECED + F7E8ECF9D4D7F0C7CAF0BABDF0B4B5ECB9BBE7C2C5EDC9D2F6CDD8F7DBE3F4F1 + F7F8FEFFFEFFFFFFF9EFF9E8D4E9E7D7E7F3ECF5F3EFFBEDE6F9E4D3E8D8A4BB + CE7C91CA8596CF92A5D98599D97687D37888D47E91D58294D17F90CE7386CC6C + 80CE7082CF7687CD7687CD7687CB7484CE7387D07387CE7885D57889CB677CC4 + 879FCD8899D07887D18193D27D93D78094D27F8FE08A9AD0A1AECD7C96C17D88 + F2AEC2F06065A05F7F5281AA6F74A0568A9B534F8095EDFF00021E6A646DAAA0 + B0887F86AC9ABAD0BBCBD3C1C8D9CAD5F8E7F1D2C7D368727D3E46583542573C + 4D61666773B5AEBCF9E8F4F0E1EBF7EAF4F7EBF7F9EAF7FAECF7F9EBF5F8E9F4 + F6E6F3F1E2EEF5E5F1F3E4F0F1E4F0F4E2EEF3E0EEF5E1EEF1E1EBF1E1EAEEE0 + E7E9DDE6E9DEE5ECDEE6EADDE5E4D7E1E7D7E1E6D7E1DFD2DCE6DAE4E9DBE6F9 + EBF6FAEEF8B9B5BC444652161F330D182B121C301F293C303C4C515F69AAABB7 + FFFFFFFFF7FBFFF2FAF9F0F9C7C2D2C5B4C0CDB6C57E6A77625864342A397E71 + 8268666E03091C322F3C5C4C5AA69BA4605F643E3A4047454B494B50968B9248 + 484F463D425A4E54A1929E998C948D828787777AB4ADBCB6A7BACEBCCD766E79 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000C110EE98BE0523258886A868C5986794873865F8A91 + 66909A64959C6592AE6A9397357B004A7CFFFFFF7F8EC7000029FEE1FF9EA0DF + B6AFE7ADA5E1B4B3DAE1E7F6F3F9FBE2E8F7D3DBF6C3C6EEB7BCF0B9BAEEBEBC + EEBBC0EFBFC2EEC8CEF1D1DAF9D4DEF8E0E7F5F6F9FAFFFFFBFAF5F7EEE1F0EA + DFEFF2EAF7F1EDFBE9DDF3DEB6CBCF869ACB7689D48D9CD997A5D97E93D37288 + D08490D48897CF7B91CE7489D37687D17786D07887D2798BD2798AD07A8AD27D + 8BD07A8BD47C8DD47B8DD48091D7778DD4798BCB94ADD594AAD48193D6899CD8 + 8D9EDA8A9BDF9CACD2A4B5C77F98DE929CF892A9E5797E57789F6477A83580A3 + 5E819F268BA21F437A7AF4FF11091466626BA197ACB0A5893831D79387DFFAED + E7F9EFFDF9F3FDFFF8FFFBF2F9E9E1EAE5DDE5EAE3ECF2E3EAFFF4FAF8ECF5F9 + EDF7FAEFF9FCF1FCF5E7F3EADAE5E4D5E0DFD2DCDDCED9DECDD9DCCCDAD7C8D4 + D6C7D4D7C6D3D8C8D4D6C5D2D4C5D0D4C4CFD2C4CED0C3CED0C2CCD3C2CED1C0 + CDD0C1CDD1C3CDCFC1CBD3C4CDD9C8D4D8C8D4E1D3DDFAF0F9FCF4FAE9E5ECC0 + BEC8B0B5B9B5BABFC6CACFDCDFE1EFF2F1FFFFFFFAF2F9F9ECF8FFFCFEC5C3CC + 9793B2C5B8C8C5B6C46A676D59555E201622838293A197952B2B380307127D67 + 71BEAFB53A3E3E635C60766B71534E53A190966461676865665F6265AA95A1AB + 9DA3AA929BAF9397AEA2AFAFA4B4C5B7C8716A75000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000C00 + 12CFA1D06435588F59877448748D61898E5E8D9563868D5B8E996491AA5D80BA + 95E500001DFFFFFF8C91BE130064FFFFFF958ED4B4B2E1DBE0F2F9FFFCE5E8F9 + CBCEF2BCC5EEB8BBEBB8BAECBABBEEBDC2EEBFC6EFC3C7F0C6CCF2CBD3F7D3DD + F7DFE9F2F2F8F7FCFEFAFAF8F9F9F2F9F8F0FAF1EFFDEBE5F7E2C1D8D592A6CF + 798AD48294D78D9FD28594D17D8CD08392D08796D27D91CF7286CE7586CF7889 + D27A8CD57B8FD47C8ED47E8ED47D90D67C8ED48091D48595D48394D38591D985 + 98D78C99DB8A99D3899BD38797D98CA1D68F9EE19AA8E4AFC0D2ACBAD88D96FB + 96ABD78FA59C6B950074A44A899E427EA3557596457DA3357BA136547185E6FF + 181414665E66A399ACA1978E4B3AC8B9B8FDFFFCF6FDEFFEF9EFF9FBF2FDFFF5 + FEFFFAFFFEF8FFFCF4FCF5F1F9F9F2FBFDF2FAF9F5F9FFF6FCEFE0EBD6C5D1CE + BECACEC0CBCFC1CCCAC0CBCCC3CECABFCBCDBCC9CDBDCAD3C3D0D0C3CDD3C3CF + D0C3CFD2C5D1D3C4D0D5C5D3D7C8D5DBC8D4DAC9D4DAC6D4DEC7D5DEC8D6E2CC + D7E7D6E1E3D4DEF2E3F0F2E4F0FBF0FAFFF7FEFFFCFFFFFDFFFFFDFFFFFCFFFF + FAFFFBF5F9F6EEF5F5EEF2F9F2F9FDF6FDE1DCE3A4A6B99890A1927781514749 + 4F3E444533395D51549E787F46313691767BD7A8B0BF9EA20B120F3B47461B38 + 3957575AC9A0A648484643464D33353EBC97A5BE9EA6AF8A8FC9A2ADA69DAAAD + A3B4C5B7C6736A74000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000190013D89BCD623D6481578D924F + 7D996E99985D8E996593A66D969D5C86BA689CA3A4F7000000FFFFFFA9A3CE3A + 2393F9F5FFDBDFEBF9FEFDDEE6F3C3C8F2B7BEEFB8BBEEB9BAEBBCBDEABCBCEE + BFC4EEC4CBF0C6CAF3C8CFF5C9D4F4D4DBF2EEF1F6FEFFFAFFFDF9FAF5F9F6F0 + F9F4EEFDEEE6F9E0C7DDD799AFD28093D08592D48996D48597D5869AD4879BD1 + 8395CD7A8BCB7588D0768CD67D90D58091D37C8ED37C8DD57F90D68193D68696 + D88696D78695D68796D58897D68997D98C9ADD91A2DC94A5D48F9CDC90A1DA97 + A3D89DA6E1ABBAE5B6CED6A4BAE28FAADB86A340869F1983AB2083A43472A55D + 7F97337F9D4B76A24A7D9C5093AC31566F7EE5FF0608136A5F6BA9A0B3989687 + A28BE0C7C5FBFFFFFDFAEEFBFAF1F9EFF1F2EDEAEEF5F1F6FFFBFFF9F3F9FEFD + FFFFFBFFFEFFFFFFFAFFF1DEE9DAC8D4E0CDD9E1D0DCE0CCD8DFCCD8DFCBD8E1 + CCD8E0CBD7E1CFDAE0D0DCE3D2DFDDC8D5DFCCD8DCCCD8E0CFDCDDCDD9DECEDA + DBCCD6D6CBD5D5CAD4D2C6D1CEC2CECBC1CBCEC1CCC9C3CCCAC3CDCCC2CAD9D0 + D7FAF4FBFBF8FBFCF7FAFAF3F9F9F4F9F9F2F8F8F0F8F9F1F8FAF5F9FFFDFFFC + FBFFFBF6FAFDF9FDFAE8EDE6BFC4E1AAB0ECB4BDEDB7BEEEB9C1E7B0B9D8AAB1 + F4BCC5E6AEB6CA919BD39AA3D9A0ABCE909BC5929BE098A3C58D95B88A92B480 + 89C89197DE97A0D89194D9949DB899A4A399A6AB9FAEB6A9BA6F667000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000EA9FE067305E7C4C78AB76A6A26794A56997A05F93A76C + 94AD6B8AAF68A0B1B8FF000000253288868ED6ECE8F5FFFFFFCCD3EDC2C0EFB7 + BAF1B1B9EEBBB9EEBFBEEFC0C4EEC0C6F0C4C9F1C5CAF2C8CEF0CED7F4DEE6F9 + EEF3F9F9FAF9FFFEFBFBF8FAF9F2FAF7F2FDEAE2F5DEC5DDD8A1B5D47F92D07D + 90D3879AD9879CD8879BD38599CF7E94CE778CD1788CD57D91D68094D78596D7 + 8799D78799D68799D88A9BD98A9ADA8A9ADA8E9ED88F9EDB909DDC919FD993A1 + DB96A2E096A5DE9FADDB99A7D6A0B1E1ADBFEBBACDE8B4C5D994ADB88AAA997D + A3537CA3007BA14B7FAE4D84A944839A587FA9207B9E5E82A8558AA42B739237 + 77A633526953CBFF1207006A5F69AFA1B49E9197AF9DC4F2F3FFFFFDFFFDF3FF + FDF3FCF0E5EFF2E7F1ECE5ECF1EFF1F1EDF1EEEBEDE8E5E7E1DBE3D9C6D4D2C1 + CED5C7D4D4C5D3D2C4D0D6C5D2D4C4D0D0C5D1D0C5CFCDC1CDCBC3CEBEB3BEB0 + A9B4A8A1ADC5BFC9D1C7D1D4C7D3D4CAD4D4CAD4D8CED9D9CFDAD9D0DAD8CDD7 + D9CAD6D5C7D3E4D6E1E5DDE6E7E0E8F3ECF1FAF6FAFBF7FBFBFBFBF9F9FAFCF7 + FCFEFCFFFFFDFFFEFEFFFCF9FEF7F4F5EDE3E8E4D5DADAC1C5C79CA4C38E96C0 + 8892BD8893BF8B90BD8A90BA8B90C08C92C49197C6929ACB8F97CC929CCD949D + C89099CD949CC5989CBB878CD4919DDC939FE69DA1E8A4A8E4A8AFD9A3AFC4A2 + AFA49EAAA59AA7A599A9B8AABB6D646F00000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000070F00E48EDD + 68254EA17199A777A1AB709FA2638EA8759CAA6895A15A789F76BECEDDFF0000 + 00000050817CC9FFFFFFB0B3E9A6A7EBBBC0EEBABBECBAB9EEBEBFF0C1C5EFC3 + C8F1BEC5EFC3C9F0D5DBF6E8ECF9F6FAF9FFFFF9FEFCF9F9F9F9F9F8FCF3F4FF + EDE8FBE5CBE1D5A0B8CD899CD28A96D78A9AD5879AD68596D58395D38294D481 + 94D48194D58294D88495D88696D78795DA8C99DC8F9ED9909DD98E9ADC8E9EDB + 929FDC909DDE8D9FDD93A0DD99A4DE9AA8DD9BADDB9FB2D7A4B7DAA9BBE7C7D5 + F9D0E1EAADC2CA8EA6AB6C9465749B487CA01885A24585A74881A55A85A5457B + A33F759A36779B306F993971953D69982A697F236B9011507568D0FF190C0870 + 636EBAA8BAA293A4AD9EA8EAE2E6DED4DCDDD6DFDCD4DDD3CAD4DDD4DED4CAD4 + D8CFD8D6CDD5DFD0DBD3C7D1B0A6B3A39AA5DED2DEDED1DEDED1E0E0D4E1E2D7 + E1E4D7E2E9DCE6EDDFE9EEE1ECEEE1EDECE0E8B9B0B7E1D6E0F9F2FAFBF0FAFC + F3FBFEF5FDFFFAFFFFFDFFFFFFFFFFFFFFFFFFFFF0DAE5EDD8E2FFF5FBFEF9FC + F7F1F6FAFFFFFCFFFFFFFFFFFFFFFFFEFFFFFAF8FCF0EBEDE7DADEE5CED3D8BF + C5D7A8B2D099A2CB919BC68B94CE8A95CE929CC9929BC7919BC9939DCE919DD4 + 919BD8949CDA919AD6939BD8929CD7929AD48D96D58F98E0959BE5999EECA0A3 + F5A3AAEAA5B0D4A8AEC3A4ACB09EAAA99BADA89CACA59DADA196A5A397A7B5A8 + B76A646E00000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000F0000D58DCA935887C395C4AE748B9E6091 + AE7B9DAA7295AA75A3A35E798367C7FFFFFF14130B000000E1DCFAFFFFFF8487 + E1C5C9EEBCBCEEBBBEEFC0C4EDBFC5F0C5CCF7C5C9F6D4D9F3F5F8F9FFFFFBFE + FEFAFDFFFAFEFEFFE8E6FBD1CAEDE2D3E7EDCCDCDBA6BBCF8EA2CD8597D58797 + D6899CD4869AD58497D98798DD8D9CDD91A1E096A5E39BA8E19DACE2A1B1E2A4 + B3E1A4B5E3A6B7E3AAB7E2ADB8E6B0BEE8B0C3E4B4C5E2B9CAE3BBCEE5C0D1E4 + C6D6E6CCE1E7CCDFE6CBDFEBD4EDF8E6F9F3ACC8AA628D6C628A3E769B1A86A7 + 3885A74A82A13B789F2B719B4478A1266A8E2F6F9A2E6C8C1560863B72922C69 + 842F79A11D72965484AA454C6D4AD2FF130D0F70626EB7A3B59D90A1A89CADFF + FEFEF8F4F8F8F6F8F9F7F9F0EAF3E5DFE9EEE2EDFEF1FCF9E9F6FFFAFFFFFCFF + E8E4EBF9F2F9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFCF7FAF8F1F5EFE9ECE1DCE1CBCBD2C0 + C3C6B5B8BC9F9FA64B4758656172DCD6DCFFFEFFF7F3F8FBEFF3F5DCE2E2CFD4 + DBBEC3D5B3B9D9A6AFD49BA6D49BA6CC959DD4929ED499A1DBA0A7DFA1A8E5A5 + ACD4969DD3979FD998A1DC969FE2949FE196A1E29AA4E09DA4E0A1A6DE9CA2E1 + A0A6E9A7ADF5B4B8F8AFB6F4B2B7E6B2B9D6AAB7AB97A19D96A59F92A49F92A3 + 9E91A3A89BABA69BACA7A0AFAAA0AFA49BAABAACBD6C66700000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000FFB1FF976482995D89A76697A46B889D5F96A86B97AE7696720963 + CED1F6FFFFFF8A80E41A1200FFFFFFC7CCFC9FA1E0CACDF1BFBEEEC1C5F0CAD1 + F7D4D8F9DAE0EDF2F1F3FFFFFFFFFFFFFFFFFFFFFFFFFDFBFEC6BCE38975BDB2 + 95C5DAB9D3D59AABC67A8BCC7A94DA849CDC889DDE90A1DF95A1DF94A1DA8999 + D48191D17C8ECB778CC8768BC9758ACB7387CB7288CC778FCE7F93D08396D182 + 98CF7D95C97E92C6798EC7728CC67A92C78799B86F85AE6282C382A1B9788FD5 + 7886A14C7A184E810E76A21875A41F6F9B5379AD3875A63C729C196FA1326A97 + 3E709E356FA81D6B99396E9B3E749D27749B3D73A62B6AA11A6F95457EA2253C + 7278DFFF0007196B636DB7A4B6A192A1938A98FFFFFFFBF2FAFAF1FCFCF3FDF4 + F2F4F1EDF0E8E4E8E4DEE3E1D9E0DBD3D8DDD8DBDBD7D7D1CBCECBC6CCC5BFC3 + BEB8BDBDB7BAB7ADB2AFA6A9A8A1A4A1999C928A8C6360695C5A616862656C66 + 686A6465625F58625F595C5C536864669D91A3736D7F847D8D6F667600000B00 + 0000595964FFFFFFFBE7EEE8BBC4C3969FC89BA3C796A1C996A1CC99A1D49CA3 + D59B9FD99CA5DE9CA2C79698B48788A77C7FAE7E84CA949BE7ACB3EAAFB5EAA5 + ADE8B0B4E2B5B4D0A1A1C6979CC999A1E6B5BFE4B5BCD8A9B6C5A0ACB09CA4A5 + 95A19C91A18B88989A90A29D93A39D92A2A29AA99E97A4A69CABA89FAEA69DAC + A89EADAEA0AFBAAEBC6F67710000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000020611FFB1FF643F4A94 + 5D8C8E5D818F57789F679FA269A08A5D786A1E54B5AECBB6B8FF9881DFFFFFFF + F6FCFCB2ADE4C5C4F2BEBEEECDD2F2DEE3F8F7FFFEFDFBF9C5B5D0BAA4CCFFFF + FFF4F3F1CEC5CBC5BBCAA794B76E4B8F8871B0E3E5FFF1D8F0B66C7F69253263 + 3445854C5888545E8A56628650587C464D7B3F497A39467B38487E3E4A773E42 + 703D497540627236536B343B70464B78545A775255673D4552262E4F201E5E29 + 3272333D85565C6D3C5099475DB16F855F48556F1622425F8B118CC23378A946 + 6CA5366FA81E79A7276DA14674A73974B0336DA2356AA24774B1356DA131679B + 507CAC1E6BA13273A34A70A02A70A1427EAE2F4F7966C9FF000D1E68616AAFA1 + B29E91A18C8492ECE6EDFFFDFFFFFDFFD4CBD382797EA2999C8E87878F898980 + 79775A56635E59647A7477878483868182706B6C837B7E8881838E83868A7F83 + 8885858B8989807B7E4A4C5C4042526F73718184808386838B88858986837F7F + 788C8E8FFFF9FFDCB4BCDAB1B9E3B7BFA1848E4B4454888C96FFFFFFD7BFC56A + 5B5D332E2C372E323028302A262F35333F3D3037523E406F585C7B5D638C6869 + 8E6A6D8B6A6C8363657A5A5B826064805F6494676C916A6D8D686B9964669A73 + 779C909AA694A3A0909F9B8F9F998EA0908D9B968EA09A8EA19E91A1A092A39C + 91A1A195A6A196A6A397A8A398A9A497A8A59CABA69DACA397A8B0A5B66A646E + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000080D14E292C0563C3D7E4480814A67865E739249A184 + 4C4C50355AA77FB89775BA767DE1E9D8F6EEEAEEC5CEF2B5B0EECDDBEDF2EEFB + F4F9F9FAFEFBFDFFF9FDFDFAE4E1F6EEE1F9F8F1F5615189130040673869784D + 83A1648EB87787D4B0C6F1C4E2984D5D11000000030006080406040604000200 + 0000090B0D26282E1D221F090802180E0D0F0C06000007201C3F342C4E2A191E + 290E0F2913242B1D2A3C2F2C451F2850193266364E64526455485B9E5C7AF38C + A83E363F653B37D13A46475F931484BA337FAC3474AA2971AA2972A63974AA43 + 70AB3375AE2E71AB4C78AA3770A10D699B4871A1336A98257195556FAA377EA5 + 2B7FB54080B633618272D4FF00041169616BA8A0B19D94A4938A9CADA5B3FAFA + FBFFFFFFB5B0B5756A71B7A9A7B6ABA5B1A9A2B7ADA467677864636F756E7997 + 8E958F8989827B7D8D87898E878893878A92888B8E8A8A8C898A8B87886A616C + 665D697F7C7C7B7A777876747A78737876726F6B68898C8EE4DBDEDDB1B8D5AE + B5E1BFC4C8B4BA80788CE9EDEFEBD1D2523F403E34354D3A3F473A3B4A38384E + 3D3E5A53595F565A6E626393897F7E726B6C5456765F607C686678645F886D6A + 9A867F91807888655FA06B69B46666AD6B6EC794A19990A49A8D9F9A91A19B91 + A1998F9D928F9B9991A1988E9F9A91A19890A09F90A19F93A4A195A7A196A59E + 92A3A093A4A69AABA199A89C98A8B1AABA686670000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 06C588A1502A435B4254834E72703D74573E376D3860B29DE08B78A960357893 + 93E6E7E2FFC2ABE7D5E9F4E1E5EAF5E2F2FFFFFFF7FCF7FBF9FBFFF9FDF7EBF6 + E9DBECD9CADFD9DAE8DFCFE8C06F94B85676C27787B13F55A81F46D49DBEEABC + D36E24320000000B1E192F18242C0E1D29161E2715192C181E34233034253129 + 19202718182E231D2C141D230011260D16381D224422284C293B502E44572B37 + 7040507D5E7672697C5D54678F5E7BE693B16C4F515D313BE46379FF8191487E + AB0073AE297AAD3684B22684B2397FB24280B12B71A92876A63976A934739F3E + 769F3A71A13C7A9A4C7CAA2A71AB458BA82875AB5583B0066FA73D547565D9FF + 200F1669616BB2A4B69F95A49B92A19A8B9EC3BBC5FFFFFFCBC8CC6B626E9D93 + 909B8D909F9395A397908C8A8979728350515DB8B0B6A79F9E948A8D90878F99 + 8E8E95908F9891908E898A8780838781826969737A7C877E7878837B7A8F8887 + 9F9792A7A3A3C5C1C2CBC5C4C0B7BAB9B5B9B7B8B8E0D8D4B2A5A8AFB0BAFFFF + FF53394032242554454538383F4A3F465645455D484C513F40736D6C857B817E + 6D6C86776776615F8A74728F78749B847EB9A397AA958796716BBB7F7FB96762 + 7A666CA993A6A491A2958D9A968D9E998E9F9A8F9E988E9C988F9D988A9A998A + 9BA293A39B8F9FA092A39F94A2988F9E9A91A19E96A5A49AA9A298A7A39AA6A7 + 99A7B1A3B56C606B000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000070213BC819D542A466145549C5F + 804A15306E5468BFA0E0A788CC6860872E0022A193F6E5E8FFE9F2EEFFFFFFDD + D5E79582ADFFFFFFF9EEF9F3E1F1E5D2E4E0CCE1D9D9E2D9DFE7DCE6E8F1E6EB + CC7C93BD5974CB7F8DCD9FA7D9D5E2EFDAF3CD7A96440009000000161A162F16 + 222A131E29161B2813162A1522311F302F1F2928141C281519281B14280F112A + 0D1B2C1C28382430422029441D274E263F583D5862536D645F7857556D805874 + D28AA4AF5E616F3E4B526A95507CB21878AD167DB03981B7347BB33180B23182 + B61674A61F73A53C7EA94276AA3974A32F6D9C35709D4273A33D799D3C76A13C + 7DB5237CA94D7BA818689C397EA33552676AC9FF030C0B6B636DB0A2B49991A0 + A098A7A696A8968796C8BFC7FFFFFF928E929F939CC0B3B3BCB2B0C1B4B6C3BF + BF988D9A938D9F8B8790E8D8DDB5A7AFB7AEBBC9BDC2CBBFC4D1C4CAC9BEC5C0 + B6BDCABDC59594A988889DC6BFC3D3CACCD0C6C9C6BFC1BAB4B3D3C8C5AAA0A1 + 9792969A9096938C8CC5B5B4ACABB0FFFFFF8E686B0000003F313C42353C4543 + 4454464A5243454F393E523F3E928875988C7C8D80758F7D7BA39382AA9586B0 + 9B8FB5A197A07E79926462B5797199555D716F819A94A4958C9B96909D998D9B + 968B9B988D9F9A8F9F958D9A998F9E988D9D968A9C958B99948D9D968F9F9990 + A09F94A39E95A39D98A7A397A9A59AA8A096A59A8D9CACA1B26C626D00000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000D0C0EBA7C97672F5B87566F915D7A380700C69CE7B59AD78C73 + A03F304E3B00169479D4FFFFFFFAFFF8FFFDF9F8F4F9EADEF1FDF2F9D6CBDFE0 + D8E8E9E4EBF8F8F6FBFFFFE4EAF2D4D0DBF7F6F2FFFEFFF0ECF3F2EEF6F0F4FB + F5FEFFF2D2EAB5506B3000000004001F18152B1416240D0D200F091C0F0C180F + 0F1B1216361D313F2334200C0F1A0B1E36184C3F1B4B37222F3B28273D161F40 + 192C57455C67597560587650566B755573CD84A6C0666C7B474E456C993171B0 + 2E6A9F366EA2277BB01E7EB4327EB52873AD3777AF3B7DAD2A70A33C76A72C73 + A33968A144709F3A719D27649439689E2A6695325E8746678C3C6A8F34748A4F + 7E9A3B526C42C4FF1E141666626CB1A3B5A096A5A196A5A296A6A797A89E8C9C + D2C7D1FFFFFF9B959DCCC4C5DED2D0D2C5C7D3C6C7AFAAB1978B9E8E8897B5AB + B1BBB2B4ACA5A8C5BAB6BEB2B1BAAFAEB8ADADB4A8A8B5AAA98F8694746C7FA4 + 9B9EAFA2A6B0A3A8A79EA0B8ACA9D0C1BFB7ABAEAFA9ABB2A9AAB3A7A3A29B9D + E6E1E6C3A4AC1815195B4E4D514445352C35453B3B4437394F40425342457563 + 5FA08E8397877C9A8B81A18D83A59185AD998CAF93889A746C9B625FAC706F91 + 64658779909D99A898909C978C99978A99978C9B968C9B998E9F998E9D9D91A0 + 958B9998909F968E9E958E9D97909F9F97A79B93A29F97A6A098A6A097A7A094 + A49E92A198919E9E91A1B4A7B6695F6A00000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000001C0712EA9BBA + 945B7EA355824C2330653456B6A2E7A791B24D2B69513B4056223D1A0046FFFF + FFFFFFFFFFF9FFF8EDF8C5BCC7BABBCBFFFFFFEDEAEEFFFFFFF9FBFBFFFFFEE7 + E4F2C3BED3E6E1E3FFFFFFEEE9F6EAE3F3E5DDEEF0E4F9E9B7D597394F150000 + 0011071F110E1A00001F0C00200712200F261E1D131D140D29122F2B1A1E1B13 + 002C1B45492A7947275F3E273A3B26243912184C293D62536B615B7653536C6F + 5775C17E97C46264894E5E377AAD1383C33771AC3B6C9D3A69A23377AB296DA4 + 3D75A9357FAE237BB53480AF377DA9407AA72B77A34374A63A73A6286E9D3E69 + 971D678D487F9E34607B436580295B81535F7B3D5D8B1B5C616FB3FF1D132B69 + 626BB6A2B5A398A6A397A7A196A6A495A6A594A7998799CDC8CEF8F8F9A3A0A3 + BCB2B5E5D2D2D4C8C8D4CACCAB9FAA91889CA496A2CCC3C5AAA1A6CFC1C0C3B6 + B7C5B8B8C3B6B7C5B8BBBDB0AF9E94A17E7788B3AEAEBDB4B5C5B9BBD6CBC8DC + CCCBDECDCCC8BBBABFB3B4CDBFC3B1A8AAC7C6CEDFC3C9473B3B867C7191867A + 695C582C1F225443455C474F664F5265494F907B779B8A7F9F8D7DA48E84AE98 + 8DB49D93A18178996963A45D5DA065618C6C75998C9F9A909E958B9894899894 + 8B9A958A9A928899978D9A968F9C978D9A9A8C9D92889897909F9A93A3948E9C + 9B92A09E95A29C93A4A29AAB9F96A6A295A69D93A29E93A1998E9D9E92A0B6A5 + B46E5F6C00000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000001B0D1BFFB1D587557AAC77995A081E92566F + AF9FF1B383BE3022286B3B3E705A75400018593D87FFFFFFF5EFF7FFFFFFD4D4 + DB818AA2FFFFFFE1DCE3FFFFFFF7F0F4FBF9FCEAE9F5C7BFD6D8CDDCFCF9FFE9 + DFF1E3D4E9E6D3EAECDDF2E1A6C382293C0300000007002F2920544759624D6C + 4D39582F1F3A1A11081A13040E16290B1924231A163B244E482E7B4731684434 + 4A351F22381512583740604F68544E6F6C5272B97289D1657292576F3582B509 + 8FC52678AB3969A3366A99355E913D66973A659C2C6193386C953A70A11F79A9 + 3481B15082B02777A93D85B12681B72A79B0487395376D9827648950697E1F64 + 9562558D445C89346D913125477195ED07091B6C6670B5A4B6A196A5A69DADA6 + 9BABA398A8A498A8A499A9928795CDC0C8FAF9FBACA8ACAEA1A3EBD7D7E7D5D0 + DBC7CC968C9E918694BEB3B9A498A1DECECED4C7C8D6C7C8D5C7C8D8CACAD9C9 + C9B8AEB9857B8D9E979AB9AFB0B2A6A7C5B6B6D4C2C1CFC0BEB5A6A4A2939491 + 8486BDBDC6F6E3EE644946827460948774998D7E968A786E5E575E43506B5156 + 70535978565D816669A4908AAD9E91B5A195B494889A6D6BAA6362AB635F8B55 + 538076879693A2978E9B958C97958C9A918996948A9A988D9E948B9C988E9B98 + 8E9B948A999A91A18F8A989891A19893A295909E9C91A09B92A19C90A1A194A5 + A396A69D91A3988FA1988A9BA494A3A18FA0B5A4B36D606D0000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000019030DFFB1DA794259AF77A9994F606D273ED8BCEDF6D8FF71588A300000 + 7F4B7576535F52344E000000470057D1C6DCFFFFFFD2CFDFC5C4D3F6F2F5FFFF + FFF2EBF4F6F1FBF5ECF8C6B7D3B8A6C3FCF0FDF5E4F9DDC4DBDFC9DEECD2EAD8 + 8BAA520F1F0000001D1C0D4A31455E4E79655482463F6526224425162932242F + 3C273C42203A4926355235404D3254401E4B3F18313C1A204B2C3463485D614B + 6C754A70BD6E85D46F7680637F3477B51384C31B80B23277AA2C70A622639533 + 547E4950723858782C51814458873C52834458872A568B3A5F98305A88345C85 + 3B639048678E3C4E7E3B4475404D7D4E488648659C37508E556392473F742832 + 5B5B72B51103116C6771B9A8BAA297A6A397A8A095A59C91A1A195A5A398A7A5 + 9BA9918695D2C7D1FFFFFFD1D2D3948791B1A0ABD0C2BEBBAEB894869B918893 + A0979EBFB3B6D1BEBEC8B7B8C5B6B9C7B7BBC8B9BBB5A7B19A899A8C8384C2B6 + B6BAAAAAB5A9A6B2ACAABEB1AFB7AFAE969498BEB6C0F8D7E14B2B3203040729 + 24293325284034374B40425A4A4C6B4F5573585F70595D826B678C786F93746D + 8C6664874E5288524AA05C5D9A56607F6A768D8F9D9B94A6908794958C999A90 + A1978B9B9C8FA0998D9D978A9B968999938A9A8F8998928C9C9B92A29891A19A + 91A19A8F9F988F9E9C93A19F96A49C93A19B8F9FA395A39B92A19F93A2A396A6 + 9B8E9D9F93A1ADA4B4645F680000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000191213D07FB062364593 + 5574A3718B772C60522E2EA78CBFB299DB705978452044614055654E4E6C4F69 + 52305C350047A9A3BCFFFFFFD9D2DEC5BECFF4EAF9FFFEFFEADFEEF3E9F8DAC6 + DDAF97B3DCCBDCF5E1F5DAB5CAE5C8DAEEC8E5C3718E340003000B08392E333B + 2732403B4E594C734C436827283F29193B421F4C4B26404E2C3355373754373B + 462E3C391D34361524391C28503049623D617A4060B05C68C268777A50792F4A + 8A3A569B35568E37558C3E5D933B5D9232457C453F673D536C3B53844A50733B + 3B531C233B39334C3C395939396531355A393951302E4F3B39622F4D81424278 + 4D4A7B5F4C8B39458233447740457A4B508318354E7582C00700166C6670B8A9 + B9A195A4A195A5A195A7A197A7A195A6A095A5A095A49B93A1A591A0C3A6B3E1 + C9D6ECD7DFCFBBC6B49DA9B5A4ABAC9FA4AC9AA5A3979EADA1A7BFAEB6B6A6AF + B8A7ACB8A9ADB7A8ACAFA2A7958A957C717AA5989F9D8E96A0969EA59DA3AA9D + A3AB99A1D8BDC6F1BFC9B17C838C65698B5C6A7D505F724F5475555A7E5C6088 + 5E6387595E8E5D6297646A9B6269996068995D65A4686EB1737AB17D81AF8194 + 8687939694A2958D9C938C9B928998938997958D9A948B9B968C9D928A998C87 + 95938C9B998D9E948E9F9791A19A92A19790A09A94A39992A19F97A79E94A39A + 91A09991A09F94A3A293A2A395A5A198A79E98A4A399A89A92A0ACA3B3615D67 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000060008B272974C304866393D6E466C885B745E3A5A36 + 191A6D496F7C609A67598767496F5E475967465F674A695F435B360032AD96BA + FFFFFFDED4E1A38CA9FFFFFFE7DCEFEADCF0EBD4EEB899B5B398AFEDD1E4E1B5 + C5E1C0D2EEC4E1A5556A1600000609122E242C0C1D0E0E190D261F29181E1F00 + 150B030C0F0406080000000B00070B001300070B00070012040732091E421528 + 5B2A318F474BBB5F6FB06182605080283A793A2E712A315D2F3E684F46874947 + 8540386E4D3B724346873D4673424B6E38435227323E303544282F3F4A446244 + 4272493F673C3D632936483A3F5837405E3B38733642705053803E38854C647C + 4042754653850818368387BF03001268646EB7A7B8A49AA79D93A3A195A5A59A + A9A397A8A599A9A298A59D92A19B91A1948B9A8F87959E8898A691A1B59DACAF + 979DB69FA6B7A0ACBDA8B0BBA3ABB0939CCAAFB5CDB1B7D0B4BACCAFB7D2B1B8 + D4B2BBD6B4BADAB6BDD1ACB5D8AEB7C99FA8B99AA1B99BA1D09BA1DC9BA4E4A1 + A8F2ACB2F5B2B7F6B3B8F1B4B9EBAEB5E5AAB2D8A4ABD7A3ACD1A1A7C79EA1B5 + 9099B5959BB7969FB99FA9AE9CABA39BAC9491A1928B9A948A98948B9A988D9E + 978E9D958C9A9289978C87969189998F8B9A8788968C8D9B988E9E9691A19994 + A29C93A39790A09893A19994A39B95A59E94A29A909F9A8E9E9D93A2A093A3A3 + 94A39F98A695919E9E97A49A94A2ACA3B465616B000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000180C + 15995C6F3F324D714751592C3C58384E643E636F4A615F3A424C354952235361 + 3C6F70596967476367486D705F7A5944571D00296A4F71FFFFFFF5F1F8B79FC1 + F0DFEFEDD6EBF1D6EED4B3CB9D788FC598ADE6BCD1DCC4DFDCADC78C35423100 + 002E161C441C25360E1D3307183111183D16204A091E4A0614520B195F192F67 + 313D75393C8A38469B455AA95F6FBF7887D38B98E09AA8CB97B57D77AA2E4C8D + 22366C2E33602C39623B466A474876393469383061473F73544B8545517C2335 + 541D2239263436151F372B2B442F3A5F38466F394270241F2B28323E4451583D + 44664245664D4A7F455476364C74464F8E495787405A8C4B5C870D24458691C0 + 00000D6C646FB3A5B6A49AA9A59AA9A69DABA497A7A195A5A195A49F92A29B8F + 9E9D91A19D91A19F93A39187999A8EA09990A19991A09C909D9E8EA0968B9B90 + 8993847B87988D99968692978693998994928992988B95988992968B929D9099 + 9E8F988A848C8F8A92979199A496A1A4929E9387918D858E887D878279857E78 + 8377747E73747E70727D7D7E8885808C88808D7A76838B8491938A9F928A9D8F + 8A998E8796958D9C958D9B948D9B978D98A08C9B9589978F8998878390888496 + 8C88998B89999193A190909F938F9F9893A29692A19B92A19B94A39D95A49D95 + A496909F9A91A0A193A2A491A3A495A69A96A59994A29993A197909F9F98A59E + 97A3AFA4B46A656F000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000D0000A775873C1D35604946552B + 3F52334352314B58434D57373D52385351404D573F37582F535B3B574F385A59 + 4A6A694F856A537D3E1B4D2F0442E6E6EEFFFFFFC9B5D1D3B7D0E0C2D8D9BBD3 + C194B5BD9BB8EBD8ECDDAFC8BE6783C55A74D9788DD6758CD66F86DB758AD97C + 8FDC7F8FDF8294E189A3E495ADE79EB1E6A2B1E29FB0E19EB7D8A2C1C99AB6B8 + 8DA6A281957762803D3C7A1C32842F3A834D3E7E463F732F3C663036623B3873 + 2C34612E2E3F3E344330313D242B4C3449533342552B2C5551506A191B2F0000 + 00000E07000000242F2B14231D253850473C67383D5F2C42543D4A724A4F763E + 5B782E53763F4C77405E7B266287433D625E9AC90C00096E6670BAACBDA197A5 + A399A9A195A6A29AA8A39BAB9D95A59B93A3A196A89D94A69E95A8958CA0A29A + A99D95A4A196A9A499AB9F99A7A196ACA399AE9D97A9A79FB4A195AAA89DB1A1 + 97AAA19AADA895AB9D93A89E96AA9E96AE9D96ABA097AAA69BAFA494A7A69AA9 + 9B94A59690A39595A79392A49C8EA19992A79A92A4908B9F938D9F9D8D9E9C8B + 9BA194A59B92A39791A1968E9F948D9C978F9D968D9C958D9C938A99938A9994 + 8B9A9286968C8794938FA19190A29495A79791A28E8C9D908D9D8E89989791A2 + 9B95A59690A0948F9F9A93A29890A0978D9E9B91A19F92A3A395A39C95A19B92 + A29891A19D96A59893A19E97A59C95A3A199A79D97A4B3A9B868636C00000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000180025B186C3403244643A695F455E593B4C57385758354B5038 + 4053344E4832444E324B50384A4934404A3C474E3D4C4F36315440555B4B6452 + 34592000315A4B70C2C0CBD4C1D6D5B5D3D1C0D4D3C5DDCBB2CEC5A1BAC7A6BB + CEB7C9C6BACEBAAEC7B8A7C7B5ADCBAFACC9ABA3C1AAA1C1A49CBE9A8DAC8C80 + 9F76739C4E5797253D8506284E00090B00000000082500071D000006221C373B + 2F4431222F28274B3136632932552E306039366A20223C1D192F23303C1E3625 + 3639443F4871454E8B35476E152E321A20241D20221D2A253543464A49635E52 + 85524C814342734F4F6F424F5F5D4E814C49823A4982504D74454F5600365248 + 56711F285A5D859B09110B6D636DB5A6B8A59BA9A397A6A299A79B94A6A19BAC + A29CADA19BAD9C96A8A196ABA199AD9E95AA9F99A6A19AA9A197AAA59EAE9996 + A5A29AA99C96A39A96A39993A7A299ACA497ADA496ADA193A99C97A39E98A69A + 92A39E95A69B92A3A39BA9948F9F9694A19A95A29D94A3958D9C948E9C948F9C + 938F9E91909C8F89978C87948D8996918B9890909D8F8C97948B98918C999B90 + A2958F9B958F9B948A99988E9C968D9A988F9C968FA0918EA58A8BA08788998A + 8D9D8B90A0938E9D918E9C948F9E938D9B9892A1968F9E9A94A39A94A2948F9D + 958F9D9B909D9F91A0A193A19A909E9D95A1918E9C9792A19C95A39C94A29C95 + A2A19AA79C95A19D95A2B3A8B76A616C00000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000070B09936CC5 + 493C586246816757936B4A8B66598D6A4290625A7B5E477F5B457B5F4B785B4E + 715846685C44685848685C4B6352455B583D5761435B614A624B28523C183F53 + 3B585F49655C4A60594B62594A62574D655851695148604A3D5A513F65503E67 + 493B5B4A39584B38614B3B684C345D572F515E39583B3D620C3B6A1F49813251 + 73202F3C2C29443A4667243337030B00020D0E0C1F0D041600080C0E12020D1B + 091335304F2837572536403232472E2E452F344B4744775052933E4F7F3F3660 + 142923153B3038425D504A7B5A5A8D4F4A80404E6E45466F4948854B52875454 + 8A4E4B7F535F84333C6D4A447049467527546D42446B164467727E9611091B76 + 6D7AC5B8CDB3A5B9B3A5B9ADA6B9AEA8BCB2ABBEAFA9BDAEA7BCAEA8BCB5AABF + B1A7BDB3A8BDAFA9BCB0A8BEADA7BAB2ABBDAEA7BAB0A7BBB1A7BCB0A7BBB0A7 + BDB3A9BFB0A5BBADA2B8B2A7BDB0A5B7ADA6B8ACA4B8AFA7B9A8A2B4ADA3B8AA + A1B5ABA2B6A9A1B4ABA1B6A6A1B0A49DADA59EAEA19EAD9C96A59992A19D96A6 + 9991A19F95A69B95A69F98AAA398ADA196ABA396A9A299AC9993A69694A39997 + A79E99AA9A98A89E9BADA09DB3A5A1B6A09EB1A1A0B19F9DAFA6A0B0A29CADA9 + A2B4A59DAEA8A2B1A59DADA49EAEA49BABAA9DAFA69AAAA299A8A59BA9A8A0AD + A19DADA8A1B2A8A2B3AEA9B8ADA8B7ACA4B5AFA8B9B3AAB9B3A8B6B0A5B5C5B8 + C579717A00000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000030202493F4F00001342360640004B152F31 + 1837453318652A2B472F2C553027593228582C4053322C523B24572C2E4F2C2F + 45312A502A2C453032452E2A443A31493E344E342F472B203730243730283331 + 252F3A2334311D3519223226273629222B2B1E2638252F2A2731332739432640 + 382C3B292A33302B3830304315263919263A2B314C272B42232B45253151201D + 281E09031D07121A061B220C1A22150B0413000612182A234631395525315C23 + 2F531E2529241F2F180C3C25132A2B28300026300F29311D1B372B2748383259 + 282A461D252C1B253F292A2C202840112047333E4D2C325E15264E080D002614 + 193231481B24522B283E352C3B2B426E1B0D1C433F45726C7869636E6A657066 + 667166656D66636C68666F67627167647169646F69636E6A636E67646D67636E + 69667068626F65636F68616D65606A66606C6A667169636F66636D64616D6560 + 6B69606B67636E696470635D68645D6967616D645E6A68636C615C68635D6A5F + 5A64645D67635D685F5D665C576354545D56555D55565F52586157535B5C5662 + 5856625B58635D575F54545A56575F5A57615E5B665C59605F5C645A58625C5B + 685A5D68605E6A62606B5D5C685D5B63605C65615C66645F6766626B625E675D + 58625E5962625D675E5A645D5A635F5961635F67665F6A656069615D6764626B + 68656F69636D67626B69646C6C646B69646A7771794644480000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000424D3E000000000000003E000000280000005C0100002C00000001000100 + 00000000900700000000000000000000000000000000000000000000FFFFFF00 + 8000000000000000000001000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxInsLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxInsLnk.pas new file mode 100644 index 00000000..fecea8de --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxInsLnk.pas @@ -0,0 +1,2997 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxInsLnk; + +interface + +{$I cxVer.inc} + +uses + Classes, Windows, Graphics, ExtCtrls, StdCtrls, Controls, ComCtrls, Dialogs, + ImgList, Forms, dxInspct, dxExEdtr, dxInspRw, dxCntner, dxPSGlbl, dxPSCore, + dxBase; + +type + TdxInspectorPaintOption = (ipoBorder, ipoHorzLines, ipoVertLines, + ipoFlatCheckMarks, ipoCheckMarksAsText, + ipoImages, ipoTransparentRowGraphic, ipoGraphicAsText, + ipoExpandButtons); + TdxInspectorPaintOptions = set of TdxInspectorPaintOption; + + TdxInspectorRowHelperClass = class of TdxInspectorRowHelper; + + TdxInspectorRowHelper = class(TdxCustomClassMapItem) + protected + class procedure GetImageLists(ARow: TdxInspectorRow; AProc: TdxPSGetImageListProc); virtual; + public + class function PairClass: TClass; override; + class procedure Register; + class function RowClass: TdxInspectorRowClass; virtual; + end; + + TdxInspectorImageRowHelper = class(TdxInspectorRowHelper) + protected + class procedure GetImageLists(ARow: TdxInspectorRow; AProc: TdxPSGetImageListProc); override; + public + class function RowClass: TdxInspectorRowClass; override; + end; + + TdxInspectorReportLinkCustomEvent = procedure(Sender: TBasedxReportLink; + ARow: TdxInspectorRow; ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; + var AText: string; var AColor: TColor; AFont: TFont; + var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean) of object; + + TCustomdxInspectorReportLink = class(TBasedxReportLink) + private + FAutoNodesExpand: Boolean; + FAutoWidth: Boolean; + FDefaultGroupFont: TFont; + FFixedTransparent: Boolean; + FFixedColor: TColor; + FFixedFont: TFont; + FGraphicAsTextText: string; + FGridLineColor: TColor; + FGroupColor: TColor; + FGroupFont: TFont; + FGroupTransparent: Boolean; + FIsGraphicAsTextAssigned: Boolean; + FOddFont: TFont; + FOptions: TdxInspectorPaintOptions; + FSupportedCustomDraw: Boolean; + FOnCustomDrawCaption: TdxInspectorReportLinkCustomEvent; + FOnCustomDrawValue: TdxInspectorReportLinkCustomEvent; + FOnCustomDrawCaptionSeparator: TdxInspectorReportLinkCustomEvent; + FOnCustomDrawValueSeparator: TdxInspectorReportLinkCustomEvent; + FCustomDrawFontChanged: Boolean; + FFixedFontIndex: Integer; + FGroupFontIndex: Integer; + FSaveFont: TFont; + // Layout fields + FCaptionWidth: Integer; + FBandCount: Integer; + FBands: TList; + FBandWidth: Integer; + FFullWidth: Integer; + FIndent: Integer; + FMaxBandHeight: Integer; + FRowHeight: Integer; + FRowHeights: TList; + FRows: TList; + FValueWidth: Integer; + function GetCustomInspector: TCustomdxInspectorControl; + function GetGraphicAsTextText: string; + function GetOddColor: TColor; + function GetOptions: TdxInspectorPaintOptions; + function IsGraphicAsTextTextStored: Boolean; + function IsGroupFontStored: Boolean; + procedure SetAutoNodesExpand(Value: Boolean); + procedure SetAutoWidth(Value: Boolean); + procedure SetFixedColor(Value: TColor); + procedure SetFixedFont(Value: TFont); + procedure SetFixedTransparent(Value: Boolean); + procedure SetGraphicAsTextText(const Value: string); + procedure SetGridLineColor(Value: TColor); + procedure SetGroupFont(Value: TFont); + procedure SetGroupNodeColor(Value: TColor); + procedure SetGroupTransparent(Value: Boolean); + procedure SetOddFont(Value: TFont); + procedure SetOddColor(Value: TColor); + procedure SetOnCustomDrawCaption(Value: TdxInspectorReportLinkCustomEvent); + procedure SetOnCustomDrawValue(Value: TdxInspectorReportLinkCustomEvent); + procedure SetOnCustomDrawCaptionSeparator(Value: TdxInspectorReportLinkCustomEvent); + procedure SetOnCustomDrawValueSeparator(Value: TdxInspectorReportLinkCustomEvent); + procedure SetOptions(Value: TdxInspectorPaintOptions); + procedure SetSupportCustomDraw(Value: Boolean); + + procedure CalcAutoWidths; + procedure CalcLayout; + procedure CalcMaxBandHeight; + procedure CalcRowHeights; + procedure CalcStandardRowHeight; + procedure CustomDrawFontChanged(Sender: TObject); + function GetRow(AIndex: Integer): TdxInspectorRow; + function GetRowCellSides(ARow: TdxInspectorRow): TdxCellSides; + function GetRowCaptionColor(ARow: TdxInspectorRow): TColor; + function GetRowCaptionCellSides(ARow: TdxInspectorRow): TdxCellSides; + function GetRowCaptionTransparency(ARow: TdxInspectorRow): Boolean; + function GetRowHeight(ARowIndex: Integer): Integer; + function GetRowIndentCellSides(ARow: TdxInspectorRow; ALevelIndex: Integer): TdxCellSides; + function GetRowIndentColor(ARow: TdxInspectorRow; ALevelIndex: Integer): TColor; + function GetRowIndentCount(ARow: TdxInspectorRow): Integer; + function GetRowIndentTransparency(ARow: TdxInspectorRow; ALevelIndex: Integer): Boolean; + function GetRowSeparatorCellSides(ARow: TdxInspectorRow): TdxCellSides; + function GetRowTextIndent(ARow: TdxInspectorRow; AIncludeImageWidth: Boolean): Integer; + function GetRowValueCellSides(ARow: TdxInspectorRow): TdxCellSides; + function GetRowValueText(ARow: TdxInspectorRow): string; + procedure PlaceRow(ARow: TdxInspectorRow; ARowIndex: Integer; ACell: TdxReportCell); + + function IsCheckMarksAsText: Boolean; + function IsDisplayGraphicsAsText: Boolean; + function IsDrawAnyLines: Boolean; + function IsDrawBorder: Boolean; + function IsDrawEndEllipsis: Boolean; + function IsDrawExpandButtons: Boolean; + function IsDrawHorzLines: Boolean; + function IsDrawVertLines: Boolean; + function IsFlatCheckMarks: Boolean; + function IsShowExpandButtons: Boolean; + function IsShowImages: Boolean; + function IsTransparentColumnGraphics: Boolean; + + function IsAutoBandCount: Boolean; + function IsBottomRow(ARow: TdxInspectorRow): Boolean; + function IsRowAutoHeight: Boolean; + function IsRowCaptionMultilined(ARow: TdxInspectorRow): Boolean; + function IsRowValueMultilined(ARow: TdxInspectorRow): Boolean; + function IsTopRow(ARow: TdxInspectorRow): Boolean; + + procedure InsertRowCaption(ACell: TdxReportCell; ARow: TdxInspectorRow; ARowIndex: Integer); + procedure InsertRowImage(ACell: TdxReportCell; ARow: TdxInspectorRow); + procedure InsertRowIndent(ACell: TdxReportCell; ARow: TdxInspectorRow); + procedure InsertRowValue(ACell: TdxReportCell; ARow: TdxInspectorRow; ARowIndex: Integer); + + procedure CalcComplexRowItemsWidths; + function CanDrawRowImage(ARow: TdxInspectorRow): Boolean; + function ComplexRowByRow(ARow: TdxInspectorRow): TdxInspectorComplexRow; + function GetComplexRowSeparatorText(ARow: TdxInspectorRow): string; + function GetRowImageCellSides(ARow: TdxInspectorRow): TdxCellSides; + function GetRowItemByRow(ARow: TdxInspectorRow): Pointer; + function GetUltimateParentRow(ARow: TdxInspectorRow): TdxInspectorRow; + function IsComplexRowSeparator(ARow: TdxInspectorComplexRow; AIndex: Integer): Boolean; + function IsNetCategoryRow(ARow: TdxInspectorRow): Boolean; + function IsNetMode: Boolean; + function IsNetUltimateLastRowInParent(ARow: TdxInspectorRow): Boolean; + + procedure AddRows; + procedure ClearRows; + procedure DistributeRowsByBands; + procedure FreeAndNilRows; + + procedure ClearBands; + procedure FreeAndNilBands; + + procedure ReadIsGraphicAsTextValueAssigned(AReader: TReader); + procedure WriteIsGraphicAsTextValueAssigned(AWriter: TWriter); + protected + procedure DefineProperties(Filer: TFiler); override; + procedure ConstructReport(AReportCells: TdxReportCells); override; + procedure GetImageLists(AProc: TdxPSGetImageListProc); override; + procedure InternalRestoreDefaults; override; + procedure InternalRestoreFromOriginal; override; + procedure MakeDelimiters(AReportCells: TdxReportCells; AHorzDelimiters, + AVertDelimiters: TList); override; + + procedure AssignValues(ADataItem: TAbstractdxReportCellData; + ARow: TdxInspectorRow); virtual; + function GetDataClass(ARow: TdxInspectorRow): TdxReportCellDataClass; virtual; + procedure GetImageListsFromRows(AProc: TdxPSGetImageListProc); virtual; + function GetRowFontIndex(ARow: TdxInspectorRow): Integer; virtual; + procedure PrepareConstruct(AReportCells: TdxReportCells); virtual; + procedure UnprepareConstruct(AReportCells: TdxReportCells); virtual; + + procedure CustomDraw(AItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); override; + procedure DoCustomDrawCaption(ARow: TdxInspectorRow; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var AText: string; var AColor: TColor; + AFont: TFont; var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean); virtual; + procedure DoCustomDrawValue(ARow: TdxInspectorRow; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var AText: string; var AColor: TColor; + AFont: TFont; var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean); virtual; + procedure DoCustomDrawCaptionSeparator(ARow: TdxInspectorRow; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var AText: string; var AColor: TColor; + AFont: TFont; var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean); virtual; + procedure DoCustomDrawValueSeparator(ARow: TdxInspectorRow; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var AText: string; var AColor: TColor; + AFont: TFont; var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean); virtual; + function IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; override; + + procedure InitializeDefaultGroupFont(AFont: TFont); + + property CustomInspector: TCustomdxInspectorControl read GetCustomInspector; + published + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function DefaultGraphicAsTextText: string; virtual; + function DefaultGroupFont: TFont; virtual; + + property AutoNodesExpand: Boolean read FAutoNodesExpand write SetAutoNodesExpand default False; + property AutoWidth: Boolean read FAutoWidth write SetAutoWidth default False; + property Color; + property FixedTransparent: Boolean read FFixedTransparent write SetFixedTransparent default False; + property FixedColor: TColor read FFixedColor write SetFixedColor default clBtnFace; {dxDefaultFixedColor} + property FixedFont: TFont read FFixedFont write SetFixedFont stored IsFontStored; + property Font; + property GraphicAsTextText: string read GetGraphicAsTextText write SetGraphicAsTextText stored IsGraphicAsTextTextStored; + property GridLineColor: TColor read FGridLineColor write SetGridLineColor default clBlack; {dxDefaultGridLineColor} + property GroupColor: TColor read FGroupColor write SetGroupNodeColor default clBtnFace; {dxDefaultFixedColor} + property GroupFont: TFont read FGroupFont write SetGroupFont stored IsGroupFontStored; + property GroupTransparent: Boolean read FGroupTransparent write SetGroupTransparent default False; + property OddColor: TColor read GetOddColor write SetOddColor default clWhite; {clDefaultColor} + property OddFont: TFont read FOddFont write SetOddFont stored IsFontStored; + property Options: TdxInspectorPaintOptions read GetOptions write SetOptions + default [ipoBorder..ipoFlatCheckMarks , + ipoImages , ipoExpandButtons]; {dxDefaultInspectorPaintOptions} + property ScaleFonts; + property SupportedCustomDraw: Boolean read FSupportedCustomDraw write SetSupportCustomDraw default False; + property Transparent; + property UseHorzDelimiters; + property UseVertDelimiters; + + property OnCustomDrawCaption: TdxInspectorReportLinkCustomEvent read FOnCustomDrawCaption write SetOnCustomDrawCaption; + property OnCustomDrawValue: TdxInspectorReportLinkCustomEvent read FOnCustomDrawValue write SetOnCustomDrawValue; + property OnCustomDrawCaptionSeparator: TdxInspectorReportLinkCustomEvent read FOnCustomDrawCaptionSeparator write SetOnCustomDrawCaptionSeparator; + property OnCustomDrawValueSeparator: TdxInspectorReportLinkCustomEvent read FOnCustomDrawValueSeparator write SetOnCustomDrawValueSeparator; + end; + + TdxInspectorReportLink = class(TCustomdxInspectorReportLink) + private + function GetInspector: TdxInspector; + public + property Inspector: TdxInspector read GetInspector; + end; + + TdxInspectorDesignWindow = class(TStandarddxReportLinkDesignWindow) + PageControl1: TPageControl; + tshOptions: TTabSheet; + tshColors: TTabSheet; + tshFonts: TTabSheet; + pnlPreview: TPanel; + chbxTransparent: TCheckBox; + gbxTransparent: TGroupBox; + lblColor: TLabel; + bvlColorHolder: TBevel; + chbxCaptionTransparent: TCheckBox; + gbxCaptionTransparent: TGroupBox; + lblCaptionColor: TLabel; + bvlFixedColorHolder: TBevel; + lblGridLinesColor: TLabel; + bvlGridLineColorHolder: TBevel; + lblShow: TLabel; + bvlShow: TBevel; + chbxShowBorders: TCheckBox; + chbxShowHorzLines: TCheckBox; + chbxShowVertLines: TCheckBox; + btnFont: TButton; + edFont: TEdit; + btnGroupFont: TButton; + edGroupFont: TEdit; + btnFixedFont: TButton; + edFixedFont: TEdit; + chbxShowImages: TCheckBox; + gbxGroupTransparent: TGroupBox; + chbxGroupTransparent: TCheckBox; + lblGroupColor: TLabel; + bvlGroupColorHolder: TBevel; + imgGrid: TImage; + chbxShowExpandButtons: TCheckBox; + ilVendorLogos: TImageList; + ilCarPhotos: TImageList; + tshFormatting: TTabSheet; + lblRefinements: TLabel; + bvlAppearance: TBevel; + chbxFlatCheckMarks: TCheckBox; + chbxCheckMarksAsText: TCheckBox; + imgGraphics: TImage; + chbxDisplayGraphicsAsText: TCheckBox; + chbxTransparentColumnGraphics: TCheckBox; + lblBehaviors: TLabel; + chbxAutoNodesExpand: TCheckBox; + chbxAutoWidth: TCheckBox; + bvlBehaviors: TBevel; + Image4: TImage; + lblPreview: TStaticText; + pnlPreviewHost: TPanel; + insPreview: TdxInspector; + irMersedesBenz: TdxInspectorTextRow; + irMBPhoto: TdxInspectorTextGraphicRow; + irMBSUV: TdxInspectorTextCheckRow; + irMBModel: TdxInspectorTextRow; + irBMW: TdxInspectorTextRow; + irBMWModel: TdxInspectorTextRow; + irBMWSUV: TdxInspectorTextCheckRow; + irBMWPhoto: TdxInspectorTextGraphicRow; + stTransparent: TStaticText; + stCaptionTransparent: TStaticText; + stGroupTransparent: TStaticText; + procedure chbxAutoNodesExpandClick(Sender: TObject); + procedure chbxTransparentClick(Sender: TObject); + procedure chbxAutoWidthClick(Sender: TObject); + procedure btnFontClick(Sender: TObject); + procedure chbxOptionsClick(Sender: TObject); + procedure irMBSUVDrawValue(Sender: TdxInspectorRow; + ACanvas: TCanvas; ARect: TRect; var AText: String; AFont: TFont; + var AColor: TColor; var ADone: Boolean); + procedure InspectorDrawValue(Sender: TdxInspectorRow; ACanvas: TCanvas; + ARect: TRect; var AText: String; AFont: TFont; var AColor: TColor; + var ADone: Boolean); + procedure irMBPhotoDrawValue(Sender: TdxInspectorRow; ACanvas: TCanvas; + ARect: TRect; var AText: String; AFont: TFont; var AColor: TColor; + var ADone: Boolean); + procedure InspectorDrawCaption(Sender: TdxInspectorRow; + ACanvas: TCanvas; ARect: TRect; var AText: String; AFont: TFont; + var AColor: TColor; var ADone: Boolean); + procedure PageControl1Change(Sender: TObject); + procedure stTransparentClick(Sender: TObject); + procedure stCaptionTransparentClick(Sender: TObject); + procedure stGroupTransparentClick(Sender: TObject); + private + FccbxColor: TCustomComboBox; + FccbxCaptionColor: TCustomComboBox; + FccbxGroupColor: TCustomComboBox; + FccbxGridLineColor: TCustomComboBox; + + procedure ccbxColorChange(Sender: TObject); + procedure CreateControls; + function GetReportLink: TCustomdxInspectorReportLink; + procedure LoadDataToInspector; + function CaptionColor: TColor; + function GroupColor: TColor; + function ValueColor: TColor; + + procedure CMDialogChar(var message: TCMDialogChar); message CM_DIALOGCHAR; + protected + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + procedure LoadStrings; override; + procedure UpdateControlsState; override; + procedure UpdatePreview; override; + public + constructor Create(AOwner: TComponent); override; + property ReportLink: TCustomdxInspectorReportLink read GetReportLink; + end; + + TdxInspectorColumnMapperProc = function(ARow: TdxInspectorRow; + AReportLink: TCustomdxInspectorReportLink): TdxReportCellDataClass; + TdxInspectorAssignDataProc = procedure(AReportLink: TCustomdxInspectorReportLink; + ADataItem: TAbstractdxReportCellData; AInspector: TCustomdxInspector; + ARow: TdxInspectorRow); + +function DefaultdxInspectorMapperProc(ARow: TdxInspectorRow; + AReportLink: TCustomdxInspectorReportLink): TdxReportCellDataClass; +procedure DefaultdxInspectorAssignDataProc(AReportLink: TCustomdxInspectorReportLink; + ADataItem: TAbstractdxReportCellData; AInspector: TCustomdxInspector; + ARow: TdxInspectorRow); + +const + FdxInspectorAssignDataProc: TdxInspectorAssignDataProc = DefaultdxInspectorAssignDataProc; + FdxInspectorColumnMapperProc: TdxInspectorColumnMapperProc = DefaultdxInspectorMapperProc; + + dxDefaultInspectorPaintOptions: TdxInspectorPaintOptions = + [ipoBorder..ipoFlatCheckMarks , ipoImages , + ipoExpandButtons]; + +implementation + +{$R *.DFM} + +uses + SysUtils, Math, cxClasses, dxExtCtrls, dxPSRes, dxPrnDev, dxPSUtl, dxPSTextOut; + +var + FPicture: TPicture; + +type + TCustomdxInspectorControlAccess = class(TCustomdxInspectorControl); + TdxInspectorRowAccess = class(TdxInspectorRow); + TdxInspectorGraphicRowAccess = class(TdxInspectorGraphicRow); + TdxInspectorMemoRowAccess = class(TdxInspectorMemoRow); + + TdxInspectorCellType = (ictNone, ictCaption, ictValue, ictCaptionSeparator, ictValueSeparator); + + PdxRowItem = ^TdxRowItem; + TdxRowItem = record + Row: TdxInspectorRow; + CaptionWidths: TList; + ValueWidths: TList; + end; + + PdxBandItem = ^TdxBandItem; + TdxBandItem = record + Rows: TList; + end; + +function GetTextWidth(ADC: HDC; AFont: HFONT; const S: string): Integer; +var + TextSize: TSize; +begin + if S <> '' then + begin + SelectObject(ADC, AFont); + GetTextExtentPoint32(ADC, PChar(S), Length(S), TextSize); + Result := 3 + TextSize.cX + 3; + end + else + Result := 0; +end; + + {TdxInspectorRow, TdxInspectorMaskRow, TdxInspectorMemoRow, + TdxInspectorDateRow, TdxInspectorButtonRow,TdxInspectorCheckRow, + TdxInspectorImageRow, TdxInspectorSpinRow, TdxInspectorPickRow, + TdxInspectorHyperLinkRow, TdxInspectorTimeRow, TdxInspectorCurrencyRow, + TdxInspectorGraphicRow, TdxInspectorBlobRow, TdxInspectorMRURow, + TdxInspectorPopupRow, TdxInspectorLookupRow, TdxInspectorCalcRow, + TdxInspectorExtLookupRow} + +function DefaultdxInspectorMapperProc(ARow: TdxInspectorRow; + AReportLink: TCustomdxInspectorReportLink): TdxReportCellDataClass; +const + CheckClasses: array[Boolean] of TdxReportCellDataClass = (TdxReportCellCheckImage, TdxReportCellString); + ImageClasses: array[Boolean] of TdxReportCellDataClass = (TdxReportCellGraphic, TdxReportCellImage); + GraphicClasses: array[Boolean] of TdxReportCellDataClass = (TdxReportCellString, TdxReportCellGraphic); +begin + if ARow is TdxInspectorCheckRow then + Result := CheckClasses[ipoCheckMarksAsText in AReportLink.Options] + else + if ARow is TdxInspectorImageRow then + Result := ImageClasses[TdxInspectorImageRow(ARow).ShowDescription] + else + Result := GraphicClasses[(ARow is TdxInspectorGraphicRow) and not (ipoGraphicAsText in AReportLink.Options)]; +end; + +procedure DefaultdxInspectorAssignDataProc(AReportLink: TCustomdxInspectorReportLink; + ADataItem: TAbstractdxReportCellData; AInspector: TCustomdxInspector; + ARow: TdxInspectorRow); +var + AState: TCheckBoxState; + ANullStyle: TdxShowNullFieldStyle; + AImageIndex, ATextIndex: Integer; + S: string; + GraphicClass: TGraphicClass; + BaseRow: TdxInspectorRow; + ComplexRow: TdxInspectorComplexRow; +begin + case TdxInspectorCellType(ADataItem.Data) of + ictCaptionSeparator: + with TdxReportCellString(ADataItem) do + begin + CellSides := AReportLink.GetRowSeparatorCellSides(ARow); + EndEllipsis := AReportLink.IsDrawEndEllipsis; + FontIndex := AReportLink.GetRowFontIndex(ARow); + Indent := 0; + Text := AReportLink.GetComplexRowSeparatorText(ARow); + TextAlignX := taCenterX; + TextAlignY := taCenterY; + Transparent := AReportLink.GetRowCaptionTransparency(ARow); + if not Transparent then + Color := AReportLink.GetRowCaptionColor(ARow); + end; + ictValueSeparator: + with TdxReportCellString(ADataItem) do + begin + CellSides := AReportLink.GetRowSeparatorCellSides(ARow); + EndEllipsis := AReportLink.IsDrawEndEllipsis; + FontIndex := 0; + Indent := 0; + Text := AReportLink.GetComplexRowSeparatorText(ARow); + TextAlignX := taCenterX; + TextAlignY := taCenterY; + Transparent := AReportLink.Transparent; + if not Transparent then + Color := AReportLink.Color; + end; + ictCaption: + with TdxReportCellString(ADataItem) do + begin + CellSides := AReportLink.GetRowCaptionCellSides(ARow); + EndEllipsis := AReportLink.IsDrawEndEllipsis; + FontIndex := AReportLink.GetRowFontIndex(ARow); + Indent := 2; + BaseRow := ARow; + ComplexRow := AReportLink.ComplexRowByRow(ARow); + if ComplexRow <> nil then BaseRow := ComplexRow; + Multiline := AReportLink.IsRowCaptionMultilined(BaseRow); + Text := ARow.Caption; + TextAlignY := dxMultilineTextAlignY[Multiline]; + Transparent := AReportLink.GetRowCaptionTransparency(ARow); + if not Transparent then + Color := AReportLink.GetRowCaptionColor(ARow); + end; + ictValue: + if TdxInspectorCellType(ADataItem.Data) = ictValue then + begin + TdxReportVisualItem(ADataItem).CellSides := AReportLink.GetRowValueCellSides(ARow); + TdxReportVisualItem(ADataItem).Transparent := AReportLink.Transparent; + if not TdxReportVisualItem(ADataItem).Transparent then + TdxReportVisualItem(ADataItem).Color := AReportLink.Color; + if ADataItem is TdxReportCellCheck then + with TdxReportCellCheck(ADataItem) do + + begin + AState := TCheckBoxState(TdxInspectorCheckRow(ARow).GetCheckBoxState(AReportLink.GetRowValueText(ARow))); + ANullStyle := TdxInspectorCheckRow(ARow).ShowNullFieldStyle; + Enabled := not ((AState = cbGrayed) and (ANullStyle > nsUnchecked)); + Checked := (AState = cbChecked) or + ((AState = cbGrayed) and (ANullStyle = nsGrayedChecked)); + FlatBorder := AReportLink.IsFlatCheckMarks; + end + else + if ADataItem is TdxReportCellImage then + with TdxReportCellImage(ADataItem) do + begin + S := AReportLink.GetRowValueText(ARow); + TdxInspectorImageRow(ARow).GetIndexes(S, AImageIndex, ATextIndex); + if ATextIndex <> -1 then + Text := TdxInspectorImageRow(ARow).Descriptions[ATextIndex]; + ImageList := TdxInspectorImageRow(ARow).Images; + ImageIndex := AImageIndex; + MakeSpaceForEmptyImage := True; + EndEllipsis := True; + Multiline := TdxInspectorImageRow(ARow).MultilineText; + TextAlignX := dxTextAlignX[ARow.Alignment]; + TextAlignY := dxMultilineTextAlignY[Multiline]; + end + else + if ADataItem is TdxReportCellGraphic then + if ARow is TdxInspectorGraphicRow then + begin + GraphicClass := TdxInspectorGraphicRowAccess(ARow).GetGraphicClass; + LoadPicture(FPicture, GraphicClass, TdxInspectorGraphicRowAccess(ARow).GetGraphicValue); + if GraphicClass = nil then GraphicClass := TBitmap; + with TdxReportCellGraphic(ADataItem) do + begin + Image := FPicture.Graphic; + ImageTransparent := + (ipoTransparentRowGraphic in AReportLink.Options) or GraphicClass.InheritsFrom(TIcon); + if not GraphicClass.InheritsFrom(TIcon) and TdxInspectorGraphicRow(ARow).Stretch then + DrawMode := gdmStretchProportional + else + if TdxInspectorGraphicRow(ARow).Center then + DrawMode := gdmCenter + else + DrawMode := gdmNone; + end + end + else + with TdxReportCellGraphic(ADataItem) do + begin + S := AReportLink.GetRowValueText(ARow); + TdxInspectorImageRow(ARow).GetIndexes(S, AImageIndex, ATextIndex); + ImageList := TdxInspectorImageRow(ARow).Images; + ImageIndex := AImageIndex; + DrawMode := gdmCenter; + end + else + { TdxInspectorTextRow, TdxInspectorMaskRow, TdxInspectorDateRow + TdxInspectorCalcRow, TdxInspectorButtonRow, TdxInspectorSpinRow, + TdxInspectorPickRow, TdxInspectorTimeRow, TdxInspectorCurrencyRow, + TdxInspectorHyperLinkRow } + with TdxReportCellString(ADataItem) do + begin + Text := AReportLink.GetRowValueText(ARow); + EndEllipsis := ioDrawEndEllipsis in TCustomdxInspectorControlAccess(AInspector).Options; + Multiline := AReportLink.IsRowValueMultilined(ARow); + TextAlignX := dxTextAlignX[ARow.Alignment]; + TextAlignY := dxMultilineTextAlignY[Multiline]; + end; + end; + end; +end; + +{ TdxRowHelpersFactory } + +type + TdxRowHelpersFactory = class(TdxCustomClassMaps) + private + function GetHelperClass(Row: TdxInspectorRow): TdxInspectorRowHelperClass; + public + class function Instance: TdxRowHelpersFactory; reintroduce; overload; + property HelperClasses[Row: TdxInspectorRow]: TdxInspectorRowHelperClass read GetHelperClass; default; + end; + +function dxRowHelpersFactory: TdxRowHelpersFactory; +begin + Result := TdxRowHelpersFactory.Instance; +end; + +class function TdxRowHelpersFactory.Instance: TdxRowHelpersFactory; +begin + Result := inherited Instance as TdxRowHelpersFactory; +end; + +function TdxRowHelpersFactory.GetHelperClass(Row: TdxInspectorRow): TdxInspectorRowHelperClass; +begin + Result := TdxInspectorRowHelperClass(PairClasses[Row.ClassType]); +end; + +{ TdxInspectorRowHelper } + +class function TdxInspectorRowHelper.PairClass: TClass; +begin + Result := RowClass; +end; + +class procedure TdxInspectorRowHelper.Register; +begin + dxRowHelpersFactory.Register(Self); +end; + +class function TdxInspectorRowHelper.RowClass: TdxInspectorRowClass; +begin + Result := TdxInspectorRow; +end; + +class procedure TdxInspectorRowHelper.GetImageLists(ARow: TdxInspectorRow; + AProc: TdxPSGetImageListProc); +begin +end; + +{ TdxInspectorImageRowHelper } + +class function TdxInspectorImageRowHelper.RowClass: TdxInspectorRowClass; +begin + Result := TdxInspectorImageRow; +end; + +class procedure TdxInspectorImageRowHelper.GetImageLists(ARow: TdxInspectorRow; + AProc: TdxPSGetImageListProc); +begin + AProc(TdxInspectorImageRow(ARow).Images); +end; + +{ TCustomdxInspectorReportLink } + +constructor TCustomdxInspectorReportLink.Create(AOwner: TComponent); +begin + inherited; + FFixedFont := TFont.Create; + FOddFont := TFont.Create; + FGroupFont := TFont.Create; + + InternalRestoreDefaults; + LinkModified(False); + + FFixedFont.OnChange := FontChanged; + FOddFont.OnChange := FontChanged; + FGroupFont.OnChange := FontChanged; + FSaveFont := TFont.Create; + FSaveFont.OnChange := CustomDrawFontChanged; + + FRows := TList.Create; + FBands := TList.Create; + FRowHeights := TList.Create; +end; + +destructor TCustomdxInspectorReportLink.Destroy; +begin + FreeAndNil(FDefaultGroupFont); + FreeAndNil(FRowHeights); + FreeAndNilRows; + FreeAndNilBands; + FreeAndNil(FSaveFont); + FreeAndNil(FGroupFont); + FreeAndNil(FOddFont); + FreeAndNil(FFixedFont); + inherited; +end; + +procedure TCustomdxInspectorReportLink.Assign(Source: TPersistent); +begin + if Source is TCustomdxInspectorReportLink then + with TCustomdxInspectorReportLink(Source) do + begin + Self.FIsGraphicAsTextAssigned := FIsGraphicAsTextAssigned; + Self.AutoNodesExpand := AutoNodesExpand; + Self.AutoWidth := AutoWidth; + Self.FixedTransparent := FixedTransparent; + Self.GroupTransparent := GroupTransparent; + Self.FixedColor := FixedColor; + Self.FixedFont := FixedFont; + Self.GridLineColor := GridLineColor; + Self.GroupFont := GroupFont; + Self.GroupColor := GroupColor; + Self.OddFont := OddFont; + Self.Options := Options; + Self.SupportedCustomDraw := SupportedCustomDraw; + end; + inherited; +end; + +function TCustomdxInspectorReportLink.DefaultGraphicAsTextText: string; +begin + Result := cxGetResourceString(@sdxGraphicAsTextValue); +end; + +function TCustomdxInspectorReportLink.DefaultGroupFont: TFont; +begin + if FDefaultGroupFont = nil then + begin + FDefaultGroupFont := TFont.Create; + InitializeDefaultGroupFont(FDefaultGroupFont); + end; + Result := FDefaultGroupFont; +end; + +procedure TCustomdxInspectorReportLink.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('IsGraphicAsTextValueAssigned', ReadIsGraphicAsTextValueAssigned, + WriteIsGraphicAsTextValueAssigned, + FIsGraphicAsTextAssigned and (GraphicAsTextText = '')); +end; + +procedure TCustomdxInspectorReportLink.ConstructReport(AReportCells: TdxReportCells); +var + I: Integer; + ParentCell, Cell: TdxReportCell; + CurrentRow: TdxInspectorRow; +begin + if CustomInspector = nil then Exit; + inherited; + if CustomInspector.TotalRowCount = 0 then Exit; + + PrepareConstruct(AReportCells); + try + AReportCells.BorderColor := GridLineColor; + AReportCells.Cells.FontIndex := FFontIndex; + AReportCells.Cells.Color := Color; + + if IsAutoBandCount then + begin + ParentCell := TdxReportCell.Create(AReportCells.Cells); + ParentCell.CellSides := []; + ParentCell.Transparent := True; + end + else + ParentCell := AReportCells.Cells; + + for I := 0 to FRows.Count - 1 do + begin + CurrentRow := GetRow(I); + + Cell := TdxReportCell.Create(ParentCell); + Cell.CellSides := GetRowCellSides(CurrentRow); + Cell.Data := Integer(CurrentRow); + PlaceRow(CurrentRow, I, Cell); + + InsertRowIndent(Cell, CurrentRow); + if CanDrawRowImage(CurrentRow) then + InsertRowImage(Cell, CurrentRow); + InsertRowCaption(Cell, CurrentRow, I); + if not CurrentRow.IsCategory then + InsertRowValue(Cell, CurrentRow, I); + + AReportCells.DoProgress(MulDiv(I, 100, FRows.Count)); + if AbortBuilding then Break; + end; + + if not AbortBuilding then + begin + ParentCell.BoundsRect := Rect(0, 0, FBandCount * FBandWidth, FMaxBandHeight); + AReportCells.Cells.BoundsRect := ParentCell.BoundsRect; + end; + finally + UnprepareConstruct(AReportCells); + end; +end; + +procedure TCustomdxInspectorReportLink.GetImageLists(AProc: TdxPSGetImageListProc); +begin + inherited; + AProc(TCustomdxInspectorControlAccess(CustomInspector).Images); + GetImageListsFromRows(AProc); +end; + +procedure TCustomdxInspectorReportLink.InternalRestoreDefaults; +begin + inherited; + FAutoNodesExpand := False; + FAutoWidth := False; + FFixedTransparent := False; + FGroupTransparent := False; + FFixedColor := dxDefaultFixedColor; + GridLineColor := dxDefaultGridLineColor; + FGroupColor := FixedColor; + FOptions := dxDefaultInspectorPaintOptions; + SupportedCustomDraw := False; + + FixedFont := DefaultFont; + GroupFont := DefaultGroupFont; + OddFont := DefaultFont; + + FIsGraphicAsTextAssigned := False; +end; + +procedure TCustomdxInspectorReportLink.InternalRestoreFromOriginal; +begin + inherited; + FixedTransparent := + TCustomdxInspectorControlAccess(CustomInspector).PaintStyle = ipsSimple; + FixedTransparent := + FixedTransparent or (TCustomdxInspectorControlAccess(CustomInspector).PaintStyle = ipsNET); + if TCustomdxInspectorControlAccess(CustomInspector).PaintStyle = ipsCategorized then + begin + GroupColor := clBtnShadow; + GridLineColor := dxDefaultFixedColor; + end; +end; + +procedure TCustomdxInspectorReportLink.MakeDelimiters(AReportCells: TdxReportCells; + AHorzDelimiters, AVertDelimiters: TList); +var + I, RowIndex: Integer; + Cell: TdxReportCell; +begin + inherited; + if IsAutoBandCount then + Cell := AReportCells.Cells[0] + else + Cell := AReportCells.Cells; + + { horz. } + if Cell.CellCount > 0 then + begin + RowIndex := 0; + while (RowIndex < Cell.CellCount) and GetRow(RowIndex).IsCategory do + Inc(RowIndex); + if RowIndex = Cell.CellCount then RowIndex := 0; + for I := 0 to Cell[RowIndex].DataItemCount - 1 do + AHorzDelimiters.Add(Pointer(Cell[RowIndex].DataItems[I].BoundsRect.Right)); + end; + + { vert. } + if UseVertDelimiters then + for I := 0 to Cell.CellCount - 1 do + AVertDelimiters.Add(Pointer(Cell[I].BoundsRect.Bottom)); +end; + +procedure TCustomdxInspectorReportLink.CalcLayout; +begin + case TCustomdxInspectorControlAccess(CustomInspector).PaintStyle of + ipsSimple , ipsNET : + FIndent := dxInspectorButtonSize + 6; + ipsCategorized: + FIndent := dxInspectorButtonSize + 5 + else + FIndent := dxInspectorButtonExSize + 4; + end; + + with TCustomdxInspectorControlAccess(CustomInspector) do + begin + FBandCount := GetBandIndexByNode(LastNode) + 1; + if FBandCount = 0 then FBandCount := 1; + if IsAutoBandCount then + FBandWidth := BandWidth + else + FBandWidth := ClientWidth; + end; + FCaptionWidth := TCustomdxInspectorControlAccess(CustomInspector).DividerPos; + FValueWidth := FBandWidth - FCaptionWidth; + CalcStandardRowHeight; + CalcComplexRowItemsWidths; + if AutoWidth then CalcAutoWidths; + FFullWidth := FBandWidth * FBandCount; + CalcRowHeights; + DistributeRowsByBands; + CalcMaxBandHeight; +end; + +procedure TCustomdxInspectorReportLink.CalcMaxBandHeight; +var + I, J, V: Integer; + Rows: TList; +begin + FMaxBandHeight := 0; + for I := 0 to FBands.Count - 1 do + begin + Rows := PdxBandItem(FBands.List[I])^.Rows; + V := 0; + for J := 0 to Rows.Count - 1 do + Inc(V, GetRowHeight(J)); + if FMaxBandHeight < V then + FMaxBandHeight := V; + end; +end; + +procedure TCustomdxInspectorReportLink.PrepareConstruct(AReportCells: TdxReportCells); +begin + AddRows; + CalcLayout; + FFixedFontIndex := AddFontToPool(FixedFont); + FGroupFontIndex := AddFontToPool(GroupFont); +end; + +procedure TCustomdxInspectorReportLink.UnprepareConstruct(AReportCells: TdxReportCells); +begin +end; + +procedure TCustomdxInspectorReportLink.AssignValues(ADataItem: TAbstractdxReportCellData; + ARow: TdxInspectorRow); +begin + if Assigned(FdxInspectorAssignDataProc) then + FdxInspectorAssignDataProc(Self, ADataItem, CustomInspector, ARow); +end; + +function TCustomdxInspectorReportLink.GetDataClass(ARow: TdxInspectorRow): TdxReportCellDataClass; +begin + if Assigned(FdxInspectorColumnMapperProc) then + Result := FdxInspectorColumnMapperProc(ARow, Self) + else + Result := nil; +end; + +procedure TCustomdxInspectorReportLink.GetImageListsFromRows(AProc: TdxPSGetImageListProc); +var + I: Integer; + Row: TdxInspectorRow; +begin + for I := 0 to CustomInspector.Count - 1 do + begin + Row := CustomInspector.Rows[I]; + dxRowHelpersFactory[Row].GetImageLists(Row, AProc); + end; +end; + +function TCustomdxInspectorReportLink.GetRowFontIndex(ARow: TdxInspectorRow): Integer; +begin + if ARow.IsCategory then + Result := FGroupFontIndex + else + Result := FFixedFontIndex; +end; + +procedure TCustomdxInspectorReportLink.CustomDraw(AItem: TAbstractdxReportCellData; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); +var + AColor: TColor; + AText: string; + ATextAlignX: TdxTextAlignX; + ATextAlignY: TdxTextAlignY; + ARow: TdxInspectorRow; +begin + if AItem.Data = 0 then Exit; + with TdxReportCellString(AItem) do + begin + //!!! + //ParentColor := False; + AColor := ColorToRGB(Color); + if Transparent then AColor := clNone; + FSaveFont.Assign(Font); + FCustomDrawFontChanged := False; + AText := Text; + ATextAlignX := TextAlignX; + ATextAlignY := TextAlignY; + ARow := TdxInspectorRow(AItem.Parent.Data); + case TdxInspectorCellType(AItem.Data) of + ictCaption: + DoCustomDrawCaption(ARow, ACanvas, ABoundsRect, AClientRect, AText, AColor, + FSaveFont, ATextAlignX, ATextAlignY, ADone); + ictValue: + DoCustomDrawValue(ARow, ACanvas, ABoundsRect, AClientRect, AText, AColor, + FSaveFont, ATextAlignX, ATextAlignY, ADone); + ictCaptionSeparator: + DoCustomDrawCaptionSeparator(ARow, ACanvas, ABoundsRect, AClientRect, AText, AColor, + FSaveFont, ATextAlignX, ATextAlignY, ADone); + ictValueSeparator: + DoCustomDrawValueSeparator(ARow, ACanvas, ABoundsRect, AClientRect, AText, AColor, + FSaveFont, ATextAlignX, ATextAlignY, ADone); + end; + if not ADone then + begin + if FCustomDrawFontChanged then + begin + SelectObject(ACanvas.Handle, FSaveFont.Handle); + SetTextColor(ACanvas.Handle, ColorToRGB(FSaveFont.Color)); + FontIndex := -1; + end; + if (AColor <> clNone) then + begin + Color := AColor; + Transparent := False; + end; + Text := AText; + TextAlignX := ATextAlignX; + TextAlignY := ATextAlignY; + end; + end; +end; + +procedure TCustomdxInspectorReportLink.DoCustomDrawCaption(ARow: TdxInspectorRow; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var AText: string; + var AColor: TColor; AFont: TFont; var ATextAlignX: TdxTextAlignX; + var ATextAlignY: TdxTextAlignY; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawCaption) then + FOnCustomDrawCaption(Self, ARow, ACanvas, ABoundsRect, AClientRect, AText, + AColor, AFont, ATextAlignX, ATextAlignY, ADone) +end; + +procedure TCustomdxInspectorReportLink.DoCustomDrawValue(ARow: TdxInspectorRow; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var AText: string; + var AColor: TColor; AFont: TFont; var ATextAlignX: TdxTextAlignX; + var ATextAlignY: TdxTextAlignY; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawValue) then + FOnCustomDrawValue(Self, ARow, ACanvas, ABoundsRect, AClientRect, AText, + AColor, AFont, ATextAlignX, ATextAlignY, ADone) +end; + +procedure TCustomdxInspectorReportLink.DoCustomDrawCaptionSeparator(ARow: TdxInspectorRow; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var AText: string; + var AColor: TColor; AFont: TFont; var ATextAlignX: TdxTextAlignX; + var ATextAlignY: TdxTextAlignY; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawCaptionSeparator) then + FOnCustomDrawCaptionSeparator(Self, ARow, ACanvas, ABoundsRect, AClientRect, + AText, AColor, AFont, ATextAlignX, ATextAlignY, ADone) +end; +procedure TCustomdxInspectorReportLink.DoCustomDrawValueSeparator(ARow: TdxInspectorRow; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var AText: string; + var AColor: TColor; AFont: TFont; var ATextAlignX: TdxTextAlignX; + var ATextAlignY: TdxTextAlignY; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawValueSeparator) then + FOnCustomDrawValueSeparator(Self, ARow, ACanvas, ABoundsRect, AClientRect, + AText, AColor, AFont, ATextAlignX, ATextAlignY, ADone) +end; + +function TCustomdxInspectorReportLink.IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; +begin + Result := SupportedCustomDraw; + if Result and (Item <> nil) then + case TdxInspectorCellType(Item.Data) of + ictCaption: + Result := Assigned(FOnCustomDrawCaption); + ictValue: + Result := Assigned(FOnCustomDrawValue); + ictCaptionSeparator: + Result := Assigned(FOnCustomDrawCaptionSeparator); + ictValueSeparator: + Result := Assigned(FOnCustomDrawValueSeparator); + else + Result := False; + end; +end; + +procedure TCustomdxInspectorReportLink.InitializeDefaultGroupFont(AFont: TFont); +begin + AFont.Assign(DefaultFont); + AFont.Style := AFont.Style + [fsBold]; +end; + +function TCustomdxInspectorReportLink.GetCustomInspector: TCustomdxInspectorControl; +begin + Result := TCustomdxInspectorControl(Component); +end; + +function TCustomdxInspectorReportLink.GetGraphicAsTextText: string; +begin + if FIsGraphicAsTextAssigned then + Result := FGraphicAsTextText + else + Result := DefaultGraphicAsTextText; +end; + +function TCustomdxInspectorReportLink.GetOddColor: TColor; +begin + Result := inherited Color; +end; + +function TCustomdxInspectorReportLink.GetOptions: TdxInspectorPaintOptions; +begin + Result := FOptions; +end; + +function TCustomdxInspectorReportLink.IsGraphicAsTextTextStored: Boolean; +begin + Result := FIsGraphicAsTextAssigned and (FGraphicAsTextText <> DefaultGraphicAsTextText); +end; + +function TCustomdxInspectorReportLink.IsGroupFontStored: Boolean; +begin + Result := not dxPSUtl.dxAreFontsEqual(GroupFont, DefaultGroupFont); +end; + +procedure TCustomdxInspectorReportLink.SetAutoNodesExpand(Value: Boolean); +begin + if FAutoNodesExpand <> Value then + begin + FAutoNodesExpand := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxInspectorReportLink.SetAutoWidth(Value: Boolean); +begin + if FAutoWidth <> Value then + begin + FAutoWidth := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxInspectorReportLink.SetFixedColor(Value: TColor); +begin + if FFixedColor <> Value then + begin + FFixedColor := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxInspectorReportLink.SetFixedFont(Value: TFont); +begin + FFixedFont.Assign(Value); + LinkModified(True); +end; + +procedure TCustomdxInspectorReportLink.SetFixedTransparent(Value: Boolean); +begin + if FFixedTransparent <> Value then + begin + FFixedTransparent := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxInspectorReportLink.SetGraphicAsTextText(const Value: string); +begin + if GraphicAsTextText <> Value then + begin + FGraphicAsTextText := Value; + FIsGraphicAsTextAssigned := True; + if ipoGraphicAsText in Options then LinkModified(True); + end; +end; + +procedure TCustomdxInspectorReportLink.SetGridLineColor(Value: TColor); +begin + if FGridLineColor <> Value then + begin + FGridLineColor := Value; + if IsDrawAnyLines then LinkModified(True); + end; +end; + +procedure TCustomdxInspectorReportLink.SetGroupFont(Value: TFont); +begin + GroupFont.Assign(Value); +end; + +procedure TCustomdxInspectorReportLink.SetGroupNodeColor(Value: TColor); +begin + if FGroupColor <> Value then + begin + FGroupColor := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxInspectorReportLink.SetGroupTransparent(Value: Boolean); +begin + if FGroupTransparent <> Value then + begin + FGroupTransparent := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxInspectorReportLink.SetOddColor(Value: TColor); +begin + inherited Color := Value; +end; + +procedure TCustomdxInspectorReportLink.SetOddFont(Value: TFont); +begin + OddFont.Assign(Value); +end; + +procedure TCustomdxInspectorReportLink.SetOnCustomDrawCaption(Value: TdxInspectorReportLinkCustomEvent); +begin + if @FOnCustomDrawCaption <> @Value then + begin + FOnCustomDrawCaption := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxInspectorReportLink.SetOnCustomDrawValue(Value: TdxInspectorReportLinkCustomEvent); +begin + if @FOnCustomDrawValue <> @Value then + begin + FOnCustomDrawValue := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxInspectorReportLink.SetOnCustomDrawCaptionSeparator(Value: TdxInspectorReportLinkCustomEvent); +begin + if @FOnCustomDrawCaptionSeparator <> @Value then + begin + FOnCustomDrawCaptionSeparator := Value; + LinkModified(True); + end; +end; +procedure TCustomdxInspectorReportLink.SetOnCustomDrawValueSeparator(Value: TdxInspectorReportLinkCustomEvent); +begin + if @FOnCustomDrawValueSeparator <> @Value then + begin + FOnCustomDrawValueSeparator := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxInspectorReportLink.SetOptions(Value: TdxInspectorPaintOptions); +begin + if FOptions <> Value then + begin + FOptions := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxInspectorReportLink.SetSupportCustomDraw(Value: Boolean); +begin + if FSupportedCustomDraw <> Value then + begin + FSupportedCustomDraw := Value; + if Assigned(FOnCustomDrawCaption) or Assigned(FOnCustomDrawValue) then + LinkModified(True); + end; +end; + +procedure TCustomdxInspectorReportLink.CalcAutoWidths; + + function CalcSum(AData: TList): Integer; + var + I: Integer; + begin + Result := 0; + for I := 0 to AData.Count - 1 do + Inc(Result, Integer(AData.List^[I])); + end; + + function GetFont(ARow: TdxInspectorRow; AIsCaption: Boolean): HFONT; + begin + if ARow.IsCategory then + Result := GroupFont.Handle + else + if AIsCaption then + Result := FixedFont.Handle + else + Result := Font.Handle; + end; + + procedure GetRowWidths(ADC: HDC; ARow: TdxInspectorRow; ARowIndex: Integer; + var ACaptionWidth, AValueWidth: Integer); + var + I, V: Integer; + RowItem: PdxRowItem; + ChildRow: TdxInspectorRowAccess; + Separator: Boolean; + S: string; + begin + if ARow is TdxInspectorComplexRow then + begin + RowItem := PdxRowItem(FRows.List^[ARowIndex]); + for I := 0 to RowItem.CaptionWidths.Count - 1 do + begin + Separator := IsComplexRowSeparator(TdxInspectorComplexRow(ARow), I); + ChildRow := TdxInspectorRowAccess(TdxInspectorComplexRow(ARow).Items[I div 2].Row); + if not IsRowCaptionMultilined(ARow) then + begin + if Separator then + S := GetComplexRowSeparatorText(ARow) + else + S := ChildRow.Caption; + V := GetTextWidth(ADC, GetFont(ChildRow, True), S); + if Integer(RowItem^.CaptionWidths.List^[I]) < V then + RowItem^.CaptionWidths[I] := Pointer(V); + end; + if not IsRowValueMultilined(ChildRow) then + begin + if Separator then + S := GetComplexRowSeparatorText(ARow) + else + S := GetRowValueText(ChildRow); + V := GetTextWidth(ADC, GetFont(ChildRow, False), S); + if Integer(RowItem^.ValueWidths.List^[I]) < V then + RowItem^.ValueWidths[I] := Pointer(V); + end; + end; + ACaptionWidth := CalcSum(RowItem^.CaptionWidths); + AValueWidth := CalcSum(RowItem^.ValueWidths); + Exit; + end + else + begin + if not IsRowCaptionMultilined(ARow) then + ACaptionWidth := GetTextWidth(ADC, GetFont(ARow, True), ARow.Caption); + if not IsRowValueMultilined(ARow) and not ARow.IsCategory then + AValueWidth := GetTextWidth(ADC, GetFont(ARow, False), GetRowValueText(ARow)); + end; + end; + +var + DC: HDC; + PrevFont: HFONT; + I: Integer; + Row: TdxInspectorRow; + CW, VW: Integer; +begin + DC := GetDC(0); + try + PrevFont := GetCurrentObject(DC, OBJ_FONT); + for I := 0 to FRows.Count - 1 do + begin + CW := FCaptionWidth; + VW := FValueWidth; + Row := GetRow(I); + GetRowWidths(DC, Row, I, CW, VW); + Inc(CW, GetRowTextIndent(Row, True)); + if FCaptionWidth < CW then FCaptionWidth := CW; + if FValueWidth < VW then FValueWidth := VW; + end; + SelectObject(DC, PrevFont); + FBandWidth := FCaptionWidth + FValueWidth; + finally + ReleaseDC(0, DC) + end; +end; + +procedure TCustomdxInspectorReportLink.CalcRowHeights; + + function CalcHeight(ADC: HDC; AFont: TFont; const S: string; AMultiline: Boolean; + ABaseWidth: Integer): Integer; + var + R: TRect; + Size: TSize; + begin + SelectObject(ADC, AFont.Handle); + if AMultiline and IsRowAutoHeight then + if S <> '' then + begin + R := Rect(0, 0, ABaseWidth - 4, 0); + if R.Right < R.Left then R.Right := R.Left; + Result := Windows.DrawText(ADC, PChar(S), Length(S), R, + DT_CALCRECT or DT_EDITCONTROL or DT_LEFT or DT_WORDBREAK) + 2; + end + else + Result := 0 + else + begin + GetTextExtentPoint32(ADC, 'Wg', 2, Size); + Result := Size.cY; + end; + end; + +var + DC: HDC; + PrevFont: HFONT; + I, V, RowHeight, OriginalRowHeight: Integer; + RowItem: PdxRowItem; + Row: TdxInspectorRow; + J: Integer; + ChildRow: TdxInspectorRow; +begin + FRowHeights.Clear; + DC := GetDC(0); + try + PrevFont := GetCurrentObject(DC, OBJ_FONT); + for I := 0 to FRows.Count - 1 do + begin + RowItem := PdxRowItem(FRows.List^[I]); + Row := RowItem^.Row; + RowHeight := FRowHeight; + if Row.IsCategory then + RowHeight := CalcHeight(DC, GroupFont, Row.Caption, False, FBandWidth) + else + begin + if Row is TdxInspectorComplexRow then + for J := 0 to TdxInspectorComplexRow(Row).Items.Count - 1 do + begin + ChildRow := TdxInspectorComplexRow(Row).Items[J].Row; + V := CalcHeight(DC, FixedFont, ChildRow.Caption, IsRowCaptionMultilined(Row), Integer(RowItem^.CaptionWidths.List^[2 * J])); + if RowHeight < V then RowHeight := V; + V := CalcHeight(DC, Font, GetRowValueText(ChildRow), IsRowValueMultilined(Row), Integer(RowItem^.ValueWidths.List^[2 * J])); + if RowHeight < V then + RowHeight := V; + end + else + begin + V := CalcHeight(DC, FixedFont, Row.Caption, IsRowCaptionMultilined(Row), FCaptionWidth); + if RowHeight < V then RowHeight := V; + V := CalcHeight(DC, Font, GetRowValueText(Row), IsRowValueMultilined(Row), FValueWidth); + if RowHeight < V then + RowHeight := V; + end; + end; + OriginalRowHeight := TCustomdxInspectorControlAccess(CustomInspector).GetRowHeight(Row); + if RowHeight < OriginalRowHeight then + RowHeight := OriginalRowHeight; + + Inc(RowHeight, 1 + 1); + if IsRowCaptionMultilined(Row) then + Inc(RowHeight, 1 + 1); + + FRowHeights.Add(Pointer(RowHeight)); + end; + SelectObject(DC, PrevFont); + finally + ReleaseDC(0, DC); + end; +end; + +procedure TCustomdxInspectorReportLink.CalcStandardRowHeight; + + function GetHeight(ADC: HDC; AFont: TFont): Integer; + var + TextSize: TSize; + begin + SelectObject(ADC, AFont.Handle); + GetTextExtentPoint32(ADC, 'Wg', 2, TextSize); + Result := TextSize.cy; + end; + +var + DC: HDC; + PrevFont: HFONT; +begin + DC := GetDC(0); + try + PrevFont := GetCurrentObject(DC, OBJ_FONT); + FRowHeight := MaxIntValue([GetHeight(DC, Font), GetHeight(DC, GroupFont), GetHeight(DC, FixedFont)]); + SelectObject(DC, PrevFont); + finally + ReleaseDC(0, DC); + end; +end; + +procedure TCustomdxInspectorReportLink.CustomDrawFontChanged(Sender: TObject); +begin + FCustomDrawFontChanged := True; +end; + +function TCustomdxInspectorReportLink.GetRow(AIndex: Integer): TdxInspectorRow; +begin + Result := PdxRowItem(FRows.List^[AIndex])^.Row; +end; + +function TCustomdxInspectorReportLink.GetRowCellSides(ARow: TdxInspectorRow): TdxCellSides; +begin + if IsDrawBorder then + begin + Result := [csLeft, csRight]; + if IsTopRow(ARow) then Result := Result + [csTop]; + if IsBottomRow(ARow) then Result := Result + [csBottom]; + end + else + Result := []; +end; + +function TCustomdxInspectorReportLink.GetRowIndentCellSides(ARow: TdxInspectorRow; + ALevelIndex: Integer): TdxCellSides; +begin + if (ALevelIndex = 0) and IsNetMode then + begin + Result := [csLeft]; + if not IsNetCategoryRow(ARow) or (ARow.Node.Level > 0) then + Include(Result, csRight); +// if (ARow.Node.Level = 0) and (ARow.Node.Count > 0) then + if IsNetCategoryRow(ARow) then + Include(Result, csTop); + {ver. 2.31 + if ARow.Node <> nil then + begin + if (ARow.Node.Level = 0) and (ARow.Node.Count > 0) and not ARow.Node.Expanded and not AutoNodesExpand then + Include(Result, csBottom); + end;} + if IsNetUltimateLastRowInParent(ARow) then + Include(Result, csBottom); + end + else + Result := [csTop, csBottom]; + + if (ALevelIndex = 1) and (ARow.Node <> nil) and (ARow.Node.Level = 0) and ARow.IsCategory then + Include(Result, csLeft); + + if not IsDrawBorder then + begin + if IsTopRow(ARow) then Exclude(Result, csTop); + if IsBottomRow(ARow) then Exclude(Result, csBottom); + if ALevelIndex = 0 then + begin + Exclude(Result, csLeft); + Exclude(Result, csRight); + end; + + if ALevelIndex = 1 then + Exclude(Result, csRight); + + if IsNetMode then + begin + if IsNetCategoryRow(ARow) then + begin + Exclude(Result, csTop); + Exclude(Result, csBottom); + end; + if IsNetUltimateLastRowInParent(ARow) then + Exclude(Result, csBottom); + if (ARow.Node <> nil) and (ARow.Node.Level = 1) and (ARow.Node.Index = 0) and + TdxInspectorRowNode(ARow.Node.Parent).Row.IsCategory then + Exclude(Result, csTop); + end; + end; + + if not IsDrawHorzLines then + begin + if IsNetMode then + begin + case ALevelIndex of + 0: if IsNetCategoryRow(ARow) then Exclude(Result, csTop); + 1: if not ((ARow.Node <> nil) and (ARow.Node.Level = 1) and (ARow.Node.Index = 0) and + TdxInspectorRowNode(ARow.Node.Parent).Row.IsCategory) then + Exclude(Result, csTop); + else + Exclude(Result, csTop); + end; + if not IsNetUltimateLastRowInParent(ARow) then + Exclude(Result, csBottom); + end + else + begin + if not IsTopRow(ARow) then Exclude(Result, csTop); + if not IsBottomRow(ARow) then Exclude(Result, csBottom); + end; + end; + + if not IsDrawVertLines and IsNetMode then + if not GetUltimateParentRow(ARow).IsCategory then + begin + if ALevelIndex = 0 then Exclude(Result, csRight); + if ALevelIndex = 1 then Exclude(Result, csLeft); + end; +end; + +function TCustomdxInspectorReportLink.GetRowIndentColor(ARow: TdxInspectorRow; + ALevelIndex: Integer): TColor; +begin + if IsNetMode and (ALevelIndex = 0) and GetUltimateParentRow(ARow).IsCategory then + Result := GroupColor + else + Result := GetRowCaptionColor(ARow); +end; + +function TCustomdxInspectorReportLink.GetRowIndentCount(ARow: TdxInspectorRow): Integer; +begin + Result := ARow.Node.Level; + with TCustomdxInspectorControlAccess(CustomInspector) do + if PaintStyle in [ipsStandard, ipsSimple, ipsExtended, ipsNet] then + Inc(Result); +end; + +function TCustomdxInspectorReportLink.GetRowIndentTransparency(ARow: TdxInspectorRow; + ALevelIndex: Integer): Boolean; +begin + if IsNetMode and (ALevelIndex = 0) and GetUltimateParentRow(ARow).IsCategory then + Result := GroupTransparent + else + Result := GetRowCaptionTransparency(ARow); +end; + +function TCustomdxInspectorReportLink.GetRowSeparatorCellSides(ARow: TdxInspectorRow): TdxCellSides; +begin + Result := [csTop, csBottom]; + if not IsDrawBorder then + begin + if IsTopRow(ARow) then Exclude(Result, csTop); + if IsBottomRow(ARow) then Exclude(Result, csBottom); + end; + if not IsDrawHorzLines then + begin + if not IsTopRow(ARow) then Exclude(Result, csTop); + if not IsBottomRow(ARow) then Exclude(Result, csBottom); + end; +end; + +function TCustomdxInspectorReportLink.GetRowTextIndent(ARow: TdxInspectorRow; + AIncludeImageWidth: Boolean): Integer; +begin + Result := FIndent * GetRowIndentCount(ARow); + if AIncludeImageWidth and CanDrawRowImage(ARow) then + Inc(Result, TCustomdxInspectorControlAccess(CustomInspector).Images.Width); +end; + +function TCustomdxInspectorReportLink.GetRowCaptionColor(ARow: TdxInspectorRow): TColor; +begin + if ARow.IsCategory then + Result := GroupColor + else + Result := FixedColor; +end; + +function TCustomdxInspectorReportLink.GetRowCaptionCellSides(ARow: TdxInspectorRow): TdxCellSides; +var + ComplexRow: TdxInspectorComplexRow; + Index: Integer; +begin + Result := csAll; + ComplexRow := ComplexRowByRow(ARow); + Index := 0; + if ComplexRow <> nil then + Index := ComplexRow.Items.IndexOfRow(ARow); + if (ComplexRow = nil) or (Index = 0) then + Exclude(Result, csLeft); + if (ComplexRow <> nil) and (GetComplexRowSeparatorText(ARow) <> '') then + begin + Exclude(Result, csLeft); + if Index < ComplexRow.Items.Count - 1 then + Exclude(Result, csRight); + end; + if ComplexRow <> nil then ARow := ComplexRow; + + if not IsDrawBorder then + begin + if ARow.IsCategory then Exclude(Result, csRight); + if IsTopRow(ARow) then Exclude(Result, csTop); + if IsBottomRow(ARow) then Exclude(Result, csBottom); + if IsNetMode then + begin + if IsNetCategoryRow(ARow) then + begin + Exclude(Result, csTop); + Exclude(Result, csBottom); + end; + if IsNetUltimateLastRowInParent(ARow) then + Exclude(Result, csBottom); + end; + end; + +// not IsNetCategoryRow(ARow) and not (IsNetUltimateLastRowInParent(ARow) + if not IsDrawHorzLines then + if not IsNetMode or not IsNetCategoryRow(ARow) then + begin + if not IsTopRow(ARow) then Exclude(Result, csTop); + if not IsBottomRow(ARow) and not IsNetUltimateLastRowInParent(ARow) then + Exclude(Result, csBottom); + end; + + if not IsDrawVertLines then + begin + if not ARow.IsCategory then Exclude(Result, csRight); + if ComplexRow <> nil then + begin + if Index < ComplexRow.Items.Count - 1 then Exclude(Result, csRight); + if Index > 0 then Exclude(Result, csLeft); + end; + end; +end; + +function TCustomdxInspectorReportLink.GetRowCaptionTransparency(ARow: TdxInspectorRow): Boolean; +begin + if IsNetMode then + if IsNetCategoryRow(ARow) then + Result := GroupTransparent + else + Result := FixedTransparent + else + if ARow.IsCategory then + Result := GroupTransparent + else + Result := FixedTransparent +end; + +function TCustomdxInspectorReportLink.GetRowHeight(ARowIndex: Integer): Integer; +begin + Result := Integer(FRowHeights.List^[ARowIndex]); +end; + +function TCustomdxInspectorReportLink.GetRowValueCellSides(ARow: TdxInspectorRow): TdxCellSides; +var + ComplexRow: TdxInspectorComplexRow; + Index: Integer; +begin + Result := csAll; + ComplexRow := ComplexRowByRow(ARow); + Index := 0; + if ComplexRow <> nil then + Index := ComplexRow.Items.IndexOfRow(ARow); + if (ComplexRow = nil) or (Index = 0) then + Exclude(Result, csLeft); + if (ComplexRow <> nil) and (GetComplexRowSeparatorText(ARow) <> '') then + begin + Exclude(Result, csLeft); + if Index < ComplexRow.Items.Count - 1 then + Exclude(Result, csRight); + end; + + if not IsDrawBorder then + begin + if ComplexRow = nil then + Exclude(Result, csRight) + else + if Index = ComplexRow.Items.Count - 1 then + Exclude(Result, csRight); + Exclude(Result, csRight); + if IsTopRow(ARow) then Exclude(Result, csTop); + if IsBottomRow(ARow) then Exclude(Result, csBottom); + if IsNetMode and IsNetUltimateLastRowInParent(ARow) then + Exclude(Result, csBottom); + end; + + if not IsDrawHorzLines then + begin + if not IsTopRow(ARow) then Exclude(Result, csTop); + if not IsBottomRow(ARow) and not IsNetUltimateLastRowInParent(ARow) then + Exclude(Result, csBottom); + end; + + if not IsDrawVertLines then + begin + if not ARow.IsCategory then Exclude(Result, csLeft); + if ComplexRow <> nil then + begin + if Index < ComplexRow.Items.Count - 1 then Exclude(Result, csRight); + if Index > 0 then Exclude(Result, csLeft); + end; + end; +end; + +function TCustomdxInspectorReportLink.GetRowValueText(ARow: TdxInspectorRow): string; +begin + if ARow is TdxInspectorMemoRow then + Result := TdxInspectorMemoRowAccess(ARow).GetMemoText + else + if (ARow is TdxInspectorTextRow) and (TdxInspectorTextRow(ARow).PasswordChar <> #0) then + Result := ReplicateChar(TdxInspectorTextRow(ARow).PasswordChar, Length(TdxInspectorRowAccess(ARow).GetDisplayText)) + else + if ARow is TdxInspectorGraphicRow then + Result := GraphicAsTextText + else + Result := TdxInspectorRowAccess(ARow).GetDisplayText; +end; + +procedure TCustomdxInspectorReportLink.PlaceRow(ARow: TdxInspectorRow; + ARowIndex: Integer; ACell: TdxReportCell); +var + PrevSibl: TdxReportItem; + BandIndex, PrevBandIndex: Integer; +begin + ACell.BoundsRect := Rect(0, 0, FBandWidth, GetRowHeight(ARowIndex)); + BandIndex := 0; + PrevSibl := ACell.GetPrevSibling; + if PrevSibl <> nil then + begin + if IsAutoBandCount then + begin + BandIndex := + TCustomdxInspectorControlAccess(CustomInspector).GetBandIndexByNode(ARow.Node); + PrevBandIndex := + TCustomdxInspectorControlAccess(CustomInspector).GetBandIndexByNode(TdxInspectorRow(PrevSibl.Data).Node); + end + else + PrevBandIndex := 0; + if BandIndex <> PrevBandIndex then + ACell.Left := TdxReportVisualItem(PrevSibl).BoundsRect.Right + else + begin + ACell.Top := TdxReportVisualItem(PrevSibl).BoundsRect.Bottom; + ACell.Left := TdxReportVisualItem(PrevSibl).Left; + end; + end; +end; + +function TCustomdxInspectorReportLink.IsDisplayGraphicsAsText: Boolean; +begin + Result := ipoGraphicAsText in Options; +end; + +function TCustomdxInspectorReportLink.IsCheckMarksAsText: Boolean; +begin + Result := ipoCheckMarksAsText in Options; +end; + +function TCustomdxInspectorReportLink.IsDrawAnyLines: Boolean; +begin + Result := Options * [ipoBorder..ipoVertLines] <> []; +end; + +function TCustomdxInspectorReportLink.IsDrawBorder: Boolean; +begin + Result := ipoBorder in Options; +end; + +function TCustomdxInspectorReportLink.IsDrawEndEllipsis: Boolean; +begin + Result := ioDrawEndEllipsis in TCustomdxInspectorControlAccess(CustomInspector).Options; +end; + +function TCustomdxInspectorReportLink.IsDrawExpandButtons: Boolean; +begin + Result := ipoExpandButtons in Options; +end; + +function TCustomdxInspectorReportLink.IsDrawHorzLines: Boolean; +begin + Result := ipoHorzLines in Options; +end; + +function TCustomdxInspectorReportLink.IsDrawVertLines: Boolean; +begin + Result := ipoVertLines in Options; +end; + +function TCustomdxInspectorReportLink.IsFlatCheckMarks: Boolean; +begin + Result := ipoFlatCheckMarks in Options; +end; + +function TCustomdxInspectorReportLink.IsShowExpandButtons: Boolean; +begin + Result := ipoExpandButtons in Options; +end; + +function TCustomdxInspectorReportLink.IsShowImages: Boolean; +begin + Result := ipoImages in Options; +end; + +function TCustomdxInspectorReportLink.IsTransparentColumnGraphics: Boolean; +begin + Result := ipoTransparentRowGraphic in Options; +end; + +function TCustomdxInspectorReportLink.IsAutoBandCount: Boolean; +begin + Result := (CustomInspector <> nil) and + (ioAutoBandCount in TCustomdxInspectorControlAccess(CustomInspector).Options); +end; + +function TCustomdxInspectorReportLink.IsRowAutoHeight: Boolean; +begin + Result := (CustomInspector <> nil) and + (ioRowAutoHeight in TCustomdxInspectorControlAccess(CustomInspector).Options); +end; + +function TCustomdxInspectorReportLink.IsRowCaptionMultilined(ARow: TdxInspectorRow): Boolean; +begin + Result := (rvRowHeight in ARow.AssignedValues) or IsRowValueMultilined(ARow); +end; + +function TCustomdxInspectorReportLink.IsRowValueMultilined(ARow: TdxInspectorRow): Boolean; +begin + Result := (ARow is TdxInspectorMemoRow) or ((ARow is TdxInspectorCustomBlobRow) and (TdxInspectorCustomBlobRow(ARow).BlobPaintStyle = bpsText)); +end; + +function TCustomdxInspectorReportLink.IsBottomRow(ARow: TdxInspectorRow): Boolean; +var + I: Integer; +begin + for I := 0 to FBands.Count - 1 do + begin + Result := PdxBandItem(FBands.List^[I]).Rows.Last = ARow; + if Result then Exit; + end; + Result := False; +end; + +function TCustomdxInspectorReportLink.IsTopRow(ARow: TdxInspectorRow): Boolean; +var + I: Integer; +begin + for I := 0 to FBands.Count - 1 do + begin + Result := PdxBandItem(FBands.List^[I]).Rows.First = ARow; + if Result then Exit; + end; + Result := False; +end; + +procedure TCustomdxInspectorReportLink.InsertRowCaption(ACell: TdxReportCell; + ARow: TdxInspectorRow; ARowIndex: Integer); + + procedure PlaceRowCaptionPart(ADataItem: TdxReportVisualItem; + ARow: TdxInspectorRow; AItemIndex: Integer); + var + PrevSibl: TdxReportItem; + V: Integer; + ComplexRow: TdxInspectorComplexRow; + W: Integer; + begin + V := 0; + PrevSibl := ADataItem.GetPrevSibling; + if PrevSibl <> nil then + V := TdxReportVisualItem(PrevSibl).BoundsRect.Right; + ComplexRow := ComplexRowByRow(ARow); + if ComplexRow <> nil then + begin + if ARow = ComplexRow.Items[ComplexRow.Items.Count - 1].Row then + W := FCaptionWidth - V + else + W := Integer(PdxRowItem(GetRowItemByRow(ComplexRow)).CaptionWidths.List^[AItemIndex]); + ADataItem.BoundsRect := Rect(V, 0, V + W, ADataItem.Parent.Height); + end + else + if ARow.IsCategory then + ADataItem.BoundsRect := Rect(V, 0, ADataItem.Parent.Width, ADataItem.Parent.Height) + else + ADataItem.BoundsRect := Rect(V, 0, FCaptionWidth, ADataItem.Parent.Height); + end; + + procedure InsertRowCaptionPart(ARow: TdxInspectorRow; AItemIndex: Integer; + AIsRowSeparator: Boolean); + var + DataItem: TdxReportCellString; + Separator: Boolean; + I: Integer; + ChildRow: TdxInspectorRow; + begin + if not AIsRowSeparator and (ARow is TdxInspectorComplexRow) and not ARow.IsCategory then + begin + for I := 0 to PdxRowItem(FRows.List^[ARowIndex]).CaptionWidths.Count - 1 do + begin + if (GetComplexRowSeparatorText(ARow) = '') and Odd(I) then + Continue; + Separator := IsComplexRowSeparator(TdxInspectorComplexRow(ARow), I); + ChildRow := TdxInspectorComplexRow(ARow).Items[I div 2].Row; + InsertRowCaptionPart(ChildRow, I, Separator); + end; + Exit; + end + else + begin + DataItem := TdxReportCellString.Create(ACell); + if AIsRowSeparator then + DataItem.Data := Integer(ictCaptionSeparator) + else + DataItem.Data := Integer(ictCaption); + + PlaceRowCaptionPart(DataItem, ARow, AItemIndex); + AssignValues(DataItem, ARow); + end; + end; + +begin + InsertRowCaptionPart(ARow, 0, False); +end; + +procedure TCustomdxInspectorReportLink.InsertRowIndent(ACell: TdxReportCell; ARow: TdxInspectorRow); + + function GetButtonSize: Integer; + begin + with TCustomdxInspectorControlAccess(CustomInspector) do + if PaintStyle in [ipsSimple , ipsNET, ipsCategorized ] then + Result := dxInspectorButtonSize + else + Result := dxInspectorButtonExSize + 1; + end; + + procedure InsertRowIndentPart(ALevelIndex, AMaxLevel: Integer); + var + IndentBox: TdxReportCellExpandButton; + V: Integer; + PrevSibl: TdxReportItem; + begin + IndentBox := TdxReportCellExpandButton.Create(ACell); + with IndentBox do + begin + V := 0; + PrevSibl := GetPrevSibling; + if PrevSibl <> nil then + V := TdxReportVisualItem(PrevSibl).BoundsRect.Right; + BoundsRect := Rect(V, 0, V + FIndent, ACell.Height); + Transparent := GetRowIndentTransparency(ARow, ALevelIndex); + if not Transparent then + Color := GetRowIndentColor(ARow, ALevelIndex); + CellSides := GetRowIndentCellSides(ARow, ALevelIndex); + + { 2.3 } + ShowButton := IsShowExpandButtons and (ALevelIndex = AMaxLevel) and + (ARow.Node <> nil) and (ARow.Node.Count <> 0); + if ShowButton then + begin + ButtonExpanded := (ARow.Node <> nil) and ARow.Node.Expanded or AutoNodesExpand; + ShowButtonBorder := TCustomdxInspectorControlAccess(CustomInspector).PaintStyle <> ipsStandard; + if ShowButtonBorder then + begin + ButtonBorder3D := TCustomdxInspectorControlAccess(CustomInspector).PaintStyle = ipsExtended; + ButtonSize := GetButtonSize; + end; + end; + end; + end; + + function IndentExists(ARow: TdxInspectorRow): Boolean; + begin + Result := (ComplexRowByRow(ARow) = nil) and + not ((TCustomdxInspectorControlAccess(CustomInspector).PaintStyle = ipsCategorized) and + ARow.IsCategory and (ARow.Node.Level = 0)); + end; + +var + I, MaxLevel: Integer; +begin + if IndentExists(ARow) then + begin + MaxLevel := GetRowIndentCount(ARow) - 1; + for I := 0 to MaxLevel do + InsertRowIndentPart(I, MaxLevel); + end; +end; + +procedure TCustomdxInspectorReportLink.InsertRowValue(ACell: TdxReportCell; ARow: TdxInspectorRow; + ARowIndex: Integer); + + procedure PlaceRowValuePart(ADataItem: TdxReportVisualItem; ARow: TdxInspectorRow; + AItemIndex: Integer); + var + PrevSibl: TdxReportItem; + V: Integer; + ComplexRow: TdxInspectorComplexRow; + W: Integer; + begin + V := 0; + PrevSibl := ADataItem.GetPrevSibling; + if PrevSibl <> nil then + V := TdxReportVisualItem(PrevSibl).BoundsRect.Right; + ComplexRow := ComplexRowByRow(ARow); + if ComplexRow <> nil then + begin + if ARow = ComplexRow.Items[ComplexRow.Items.Count - 1].Row then + W := FBandWidth - V + else + W := Integer(PdxRowItem(GetRowItemByRow(ComplexRow)).ValueWidths.List^[AItemIndex]); + ADataItem.BoundsRect := Rect(V, 0, V + W, ADataItem.Parent.Height); + end + else + ADataItem.BoundsRect := Rect(V, 0, V + FValueWidth, ADataItem.Parent.Height); + end; + + procedure InsertRowValuePart(ARow: TdxInspectorRow; AItemIndex: Integer; + AIsRowSeparator: Boolean); + var + DataClass: TdxReportCellDataClass; + DataItem: TAbstractdxReportCellData; + Separator: Boolean; + I: Integer; + ChildRow: TdxInspectorRow; + begin + if ARow is TdxInspectorComplexRow then + begin + for I := 0 to PdxRowItem(FRows.List^[ARowIndex]).CaptionWidths.Count - 1 do + begin + if (GetComplexRowSeparatorText(ARow) = '') and Odd(I) then + Continue; + Separator := IsComplexRowSeparator(TdxInspectorComplexRow(ARow), I); + ChildRow := TdxInspectorComplexRow(ARow).Items[I div 2].Row; + InsertRowValuePart(ChildRow, I, Separator); + end; + Exit; + end + else + begin + if AIsRowSeparator then + begin + DataItem := TdxReportCellString.Create(ACell); + DataItem.Data := Integer(ictValueSeparator) + end + else + begin + DataClass := GetDataClass(ARow); + DataItem := DataClass.Create(ACell); + DataItem.Data := Integer(ictValue); + end; + PlaceRowValuePart(DataItem, ARow, AItemIndex); + AssignValues(DataItem, ARow); + end; + end; + +begin + InsertRowValuePart(ARow, 0, False); +end; + +procedure TCustomdxInspectorReportLink.CalcComplexRowItemsWidths; +var + DC: HDC; + I, J: Integer; + RowItem: PdxRowItem; + Row: TdxInspectorRow; + S: string; + CaptionSeparatorWidth, ValueSeparatorWidth: Integer; + CaptionViewInfo, ValueViewInfo: TdxInspectorComplexRowViewInfo; +begin + DC := GetDC(0); + try + for I := 0 to FRows.Count - 1 do + begin + RowItem := PdxRowItem(FRows.List^[I]); + Row := RowItem^.Row; + if (Row is TdxInspectorComplexRow) and not Row.IsCategory then + begin + if GetComplexRowSeparatorText(Row) <> '' then + begin + S := GetComplexRowSeparatorText(Row) + '_'; + CaptionSeparatorWidth := GetTextWidth(DC, FixedFont.Handle, S); + if TCustomdxInspectorControlAccess(CustomInspector).PaintStyle = ipsCategorized then + ValueSeparatorWidth := 4 + else + ValueSeparatorWidth := GetTextWidth(DC, Font.Handle, S); + end + else + begin + ValueSeparatorWidth := 4; + CaptionSeparatorWidth := 4; + end; + CaptionViewInfo := TdxInspectorComplexRowViewInfo.Create(TdxInspectorComplexRow(Row), CaptionSeparatorWidth); + ValueViewInfo := TdxInspectorComplexRowViewInfo.Create(TdxInspectorComplexRow(Row), ValueSeparatorWidth); + try + RowItem^.CaptionWidths := TList.Create; + RowItem^.ValueWidths := TList.Create; + CaptionViewInfo.Calculate(Rect(0, 0, FCaptionWidth - GetRowTextIndent(Row, True), 0)); + ValueViewInfo.Calculate(Rect(0, 0, FValueWidth, 0)); + RowItem^.CaptionWidths.Count := ValueViewInfo.Count; + RowItem^.ValueWidths.Count := ValueViewInfo.Count; + for J := 0 to RowItem^.CaptionWidths.Count - 1 do + begin + with CaptionViewInfo[J].Bounds do + RowItem^.CaptionWidths[J] := Pointer(Right - Left); + with ValueViewInfo[J].Bounds do + RowItem^.ValueWidths[J] := Pointer(Right - Left); + end; + finally + ValueViewInfo.Free; + CaptionViewInfo.Free; + end; + end; + end; + finally + ReleaseDC(0, DC); + end; +end; +function TCustomdxInspectorReportLink.CanDrawRowImage(ARow: TdxInspectorRow): Boolean; +begin + Result := IsShowImages and (TCustomdxInspectorControlAccess(CustomInspector).Images <> nil) and + (ComplexRowByRow(ARow) = nil) and + (ARow.ImageIndex > -1) and (ARow.ImageIndex < TCustomdxInspectorControlAccess(CustomInspector).Images.Count); +end; +function TCustomdxInspectorReportLink.ComplexRowByRow(ARow: TdxInspectorRow): TdxInspectorComplexRow; +begin + Result := TCustomdxInspectorControl(CustomInspector).ComplexRowByRow(ARow); +end; +function TCustomdxInspectorReportLink.GetComplexRowSeparatorText(ARow: TdxInspectorRow): string; +begin + Result := TCustomdxInspectorControlAccess(CustomInspector).ComplexRowSeparator; +end; +function TCustomdxInspectorReportLink.GetRowImageCellSides(ARow: TdxInspectorRow): TdxCellSides; +begin + Result := []; + if IsDrawHorzLines then + Result := Result + [csTop, csBottom]; +end; +function TCustomdxInspectorReportLink.GetRowItemByRow(ARow: TdxInspectorRow): Pointer; +var + I: Integer; +begin + for I := 0 to FRows.Count - 1 do + begin + Result := FRows[I]; + if PdxRowItem(Result)^.Row = ARow then Exit; + end; + Result := nil; +end; +function TCustomdxInspectorReportLink.GetUltimateParentRow(ARow: TdxInspectorRow): TdxInspectorRow; +var + Node: TdxInspectorNode; +begin + Node := ARow.Node; + while Node.Level <> 0 do Node := Node.Parent; + Result := TdxInspectorRowNode(Node).Row; +end; +function TCustomdxInspectorReportLink.IsComplexRowSeparator(ARow: TdxInspectorComplexRow; + AIndex: Integer): Boolean; +begin + Result := (GetComplexRowSeparatorText(ARow) <> '') and Odd(AIndex); +end; +procedure TCustomdxInspectorReportLink.InsertRowImage(ACell: TdxReportCell; ARow: TdxInspectorRow); +var + PrevSibl: TdxReportItem; + DataItem: TdxReportCellImage; +begin + DataItem := TdxReportCellImage.Create(ACell); + with DataItem do + begin + BoundsRect := + Bounds(1, 0, TCustomdxInspectorControlAccess(CustomInspector).Images.Width + 1, DataItem.Parent.Height); + PrevSibl := DataItem.GetPrevSibling; + if PrevSibl <> nil then + Left := TdxReportVisualItem(PrevSibl).BoundsRect.Right; + ImageList := TCustomdxInspectorControlAccess(CustomInspector).Images; + ImageIndex := ARow.ImageIndex; + CellSides := GetRowImageCellSides(ARow); + ImageTransparent := True; + Transparent := FixedTransparent; + Color := GetRowCaptionColor(ARow); + end; +end; + +function TCustomdxInspectorReportLink.IsNetCategoryRow(ARow: TdxInspectorRow): Boolean; +begin + Result := IsNetMode and (ARow.Node <> nil) and (ARow.Node.Level = 0) and ARow.IsCategory; +end; + +function TCustomdxInspectorReportLink.IsNetMode: Boolean; +begin + Result := TCustomdxInspectorControlAccess(CustomInspector).PaintStyle = ipsNET; +end; + +function TCustomdxInspectorReportLink.IsNetUltimateLastRowInParent(ARow: TdxInspectorRow): Boolean; +var + Node: TdxInspectorRowNode; +begin + Node := ARow.Node; + if Node <> nil then + begin + while (Node.Level <> 0) and Node.IsLast do + Node := TdxInspectorRowNode(Node.Parent); + Result := + (Node.Level = 0) and ((ARow.Node.Count = 0) or (not ARow.Node.Expanded and not AutoNodesExpand)) and + (Node.Row.IsCategory or IsBottomRow(ARow)); + end + else + Result := IsBottomRow(ARow); +end; + +procedure TCustomdxInspectorReportLink.AddRows; + + procedure AddRow(ANode: TdxInspectorRowNode); + var + I: Integer; + RowItem: PdxRowItem; + begin + New(RowItem); + FillChar(RowItem^, SizeOf(TdxRowItem), 0); + RowItem^.Row := ANode.Row; + FRows.Add(RowItem); + + if ANode.Expanded or AutoNodesExpand then + for I := 0 to ANode.Count - 1 do + AddRow(TdxInspectorRowNode(ANode[I])); + end; + +var + I: Integer; +begin + ClearRows; + if CustomInspector.TotalRowCount > 0 then + begin + if not AutoNodesExpand then + FRows.Capacity := TCustomdxInspectorControlAccess(CustomInspector).GetAbsoluteCount; + for I := 0 to CustomInspector.Count - 1 do + AddRow(TdxInspectorRowNode(CustomInspector.Items[I])); + end; +end; + +procedure TCustomdxInspectorReportLink.ClearRows; +var + I: Integer; + RowItem: PdxRowItem; +begin + for I := 0 to FRows.Count - 1 do + begin + RowItem := FRows.List^[I]; + if RowItem^.CaptionWidths <> nil then RowItem^.CaptionWidths.Free; + if RowItem^.ValueWidths <> nil then RowItem^.ValueWidths.Free; + Dispose(PdxRowItem(RowItem)); + end; + FRows.Clear; +end; + +procedure TCustomdxInspectorReportLink.DistributeRowsByBands; +var + I, BandIndex: Integer; + BandItem: PdxBandItem; +begin + ClearBands; + if TCustomdxInspectorControlAccess(CustomInspector).IsAutoBandCount then + begin + CustomInspector.HandleNeeded; + for I := 0 to FRows.Count - 1 do + begin + BandIndex := TCustomdxInspectorControlAccess(CustomInspector).GetBandIndexByNode(GetRow(I).Node); + if BandIndex > FBands.Count - 1 then + FBands.Count := 1 + BandIndex; + if FBands.List^[BandIndex] = nil then + begin + New(BandItem); + FillChar(BandItem^, SizeOf(TdxBandItem), 0); + BandItem^.Rows := TList.Create; + FBands[BandIndex] := BandItem; + end; + PdxBandItem(FBands.List^[BandIndex])^.Rows.Add(GetRow(I)); + end; + Exit; + end + else + begin + New(BandItem); + FillChar(BandItem^, SizeOf(TdxBandItem), 0); + BandItem^.Rows := TList.Create; + FBands.Add(BandItem); + for I := 0 to FRows.Count - 1 do + BandItem^.Rows.Add(GetRow(I)); + end; +end; + +procedure TCustomdxInspectorReportLink.FreeAndNilRows; +begin + ClearRows; + FreeAndNil(FRows); +end; + +procedure TCustomdxInspectorReportLink.ClearBands; +var + I: Integer; + BandItem: PdxBandItem; +begin + for I := 0 to FBands.Count - 1 do + begin + BandItem := FBands.List^[I]; + BandItem^.Rows.Free; + Dispose(PdxBandItem(BandItem)); + end; + FBands.Clear; +end; + +procedure TCustomdxInspectorReportLink.FreeAndNilBands; +begin + ClearBands; + FreeAndNil(FBands); +end; + +procedure TCustomdxInspectorReportLink.ReadIsGraphicAsTextValueAssigned(AReader: TReader); +begin + FIsGraphicAsTextAssigned := AReader.ReadBoolean; +end; +procedure TCustomdxInspectorReportLink.WriteIsGraphicAsTextValueAssigned(AWriter: TWriter); +begin + AWriter.WriteBoolean(FIsGraphicAsTextAssigned); +end; + +{ TdxInspectorReportLink } + +function TdxInspectorReportLink.GetInspector: TdxInspector; +begin + Result := TdxInspector(Component); +end; + +{ TdxInspectorDesignWindow } + +constructor TdxInspectorDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxhcInspectorGridReportLinkDesigner; + inherited; + CreateControls; + PageControl1.ActivePage := PageControl1.Pages[0]; +end; + +function TdxInspectorDesignWindow.GetReportLink: TCustomdxInspectorReportLink; +begin + Result := inherited ReportLink as TCustomdxInspectorReportLink; +end; + +procedure TdxInspectorDesignWindow.LoadDataToInspector; + + function BitmapToText(AImageIndex: Integer): string; + var + Picture: TPicture; + begin + Picture := TPicture.Create; + try + Picture.Bitmap.Width := ilCarPhotos.Width; + Picture.Bitmap.Height := ilCarPhotos.Height; + ilCarPhotos.Draw(Picture.Bitmap.Canvas, 0, 0, AImageIndex); + dxExEdtr.SavePicture(Picture, Result); + finally + Picture.Free; + end; + end; + +begin + irMBPhoto.Text := BitmapToText(0); + irBMWPhoto.Text := BitmapToText(1); +end; + +procedure TdxInspectorDesignWindow.CMDialogChar(var message: TCMDialogChar); +var + I: Integer; +begin + inherited; + with PageControl1 do + for I := 0 to PageCount - 1 do + if IsAccel(message.CharCode, Pages[I].Caption) then + begin + message.Result := 1; + ActivePage := Pages[I]; + Exit; + end; +end; + +procedure TdxInspectorDesignWindow.CreateControls; + + function CreateColorCombo(AParent: TWinControl; AHost: TControl; + ATag: Integer; AAutoColor: TColor; ALabel: TLabel): TdxPSColorCombo; + begin + Result := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(Result) do + begin + BoundsRect := AHost.BoundsRect; + Tag := ATag; + Parent := AParent; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := AAutoColor; + OnChange := ccbxColorChange; + end; + ALabel.FocusControl := Result; + AHost.Visible := False; + end; + +begin + FccbxColor := + CreateColorCombo(gbxTransparent, bvlColorHolder, 0, dxDefaultColor, lblColor); + FccbxCaptionColor := + CreateColorCombo(gbxCaptionTransparent, bvlFixedColorHolder, 1, dxDefaultFixedColor, lblCaptionColor); + FccbxGroupColor := + CreateColorCombo(gbxGroupTransparent, bvlGroupColorHolder, 2, dxDefaultFixedColor, lblGroupColor); + FccbxGridLineColor := + CreateColorCombo(tshColors, bvlGridLineColorHolder, 3, dxDefaultGridLineColor, lblGridLinesColor); +end; + +procedure TdxInspectorDesignWindow.DoInitialize; +begin + inherited DoInitialize; + LoadDataToInspector; + TCustomdxInspectorControlAccess(insPreview).SetFocusedNode(nil); + + chbxShowBorders.Checked := ReportLink.IsDrawBorder; + chbxShowHorzLines.Checked := ReportLink.IsDrawHorzLines; + chbxShowVertLines.Checked := ReportLink.IsDrawVertLines; + chbxShowExpandButtons.Checked := ReportLink.IsShowExpandButtons; + chbxFlatCheckMarks.Checked := ReportLink.IsFlatCheckMarks; + chbxShowImages.Checked := ReportLink.IsShowImages; + chbxCheckMarksAsText.Checked := ReportLink.IsCheckMarksAsText; + chbxDisplayGraphicsAsText.Checked := ReportLink.IsDisplayGraphicsAsText; + chbxTransparentColumnGraphics.Checked := ReportLink.IsTransparentColumnGraphics; + chbxAutoWidth.Checked := ReportLink.AutoWidth; + + chbxTransparent.Checked := ReportLink.Transparent; + TdxPSColorCombo(FccbxColor).ColorValue := ColorToRGB(ReportLink.Color); + chbxCaptionTransparent.Checked := ReportLink.FixedTransparent; + chbxGroupTransparent.Checked := ReportLink.GroupTransparent; + + TdxPSColorCombo(FccbxCaptionColor).ColorValue := ReportLink.FixedColor; + TdxPSColorCombo(FccbxGroupColor).ColorValue := ReportLink.GroupColor; + TdxPSColorCombo(FccbxGridLineColor).ColorValue := ReportLink.GridLineColor; + + FontInfoToText(ReportLink.Font, edFont); + FontInfoToText(ReportLink.FixedFont, edFixedFont); + FontInfoToText(ReportLink.GroupFont, edGroupFont); + + chbxAutoNodesExpand.Checked := ReportLink.AutoNodesExpand; +end; + +procedure TdxInspectorDesignWindow.UpdateControlsState; +begin + inherited UpdateControlsState; + FccbxColor.Enabled := not chbxTransparent.Checked; + lblColor.Enabled := FccbxColor.Enabled; + FccbxCaptionColor.Enabled := not chbxCaptionTransparent.Checked; + lblCaptionColor.Enabled := FccbxCaptionColor.Enabled; + FccbxGroupColor.Enabled := not chbxGroupTransparent.Checked; + lblGroupColor.Enabled := FccbxGroupColor.Enabled; + + UpdatePreview; +end; + +{$IFDEF DELPHI7} +function TdxInspectorDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +procedure TdxInspectorDesignWindow.LoadStrings; + + procedure AdjustBevelSize(ABevel: TBevel; ALabel: TLabel); + var + Right: Integer; + begin + Right := ABevel.BoundsRect.Right; + ABevel.Left := ALabel.Left + ALabel.Width + 10; + ABevel.Width := Right - ABevel.Left; + end; + +begin + inherited; + lblPreview.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + irMBModel.Caption := cxGetResourceString(@sdxCarModelColumnCaption); + irMBSUV.Caption := cxGetResourceString(@sdxCarIsSUVColumnCaption); + irMBPhoto.Caption := cxGetResourceString(@sdxCarPhotoColumnCaption); + + irBMWModel.Caption := cxGetResourceString(@sdxCarModelColumnCaption); + irBMWSUV.Caption := cxGetResourceString(@sdxCarIsSUVColumnCaption); + irBMWPhoto.Caption := cxGetResourceString(@sdxCarPhotoColumnCaption); + + tshOptions.Caption := cxGetResourceString(@sdxOptions); + lblShow.Caption := cxGetResourceString(@sdxShow); + AdjustBevelSize(bvlShow, lblShow); + chbxShowBorders.Caption := cxGetResourceString(@sdxBorderLines); + chbxShowHorzLines.Caption := cxGetResourceString(@sdxHorzLines); + chbxShowVertLines.Caption := cxGetResourceString(@sdxVertLines); + chbxShowExpandButtons.Caption := cxGetResourceString(@sdxExpandButtons); + chbxShowImages.Caption := cxGetResourceString(@sdxImages); + + lblBehaviors.Caption := cxGetResourceString(@sdxBehaviors); + AdjustBevelSize(bvlBehaviors, lblBehaviors); + chbxAutoNodesExpand.Caption := cxGetResourceString(@sdxAutoNodesExpand); + chbxAutoWidth.Caption := cxGetResourceString(@sdxAutoWidth); + + tshColors.Caption := cxGetResourceString(@sdxColors); + stTransparent.Caption := ' ' + cxGetResourceString(@sdxTransparent) + ' '; + lblColor.Caption := cxGetResourceString(@sdxColor); + stCaptionTransparent.Caption := ' ' + cxGetResourceString(@sdxCaptionTransparent) + ' '; + lblCaptionColor.Caption := cxGetResourceString(@sdxCaptionColor); + stGroupTransparent.Caption := ' ' + cxGetResourceString(@sdxGroupTransparent) + ' '; + lblGroupColor.Caption := cxGetResourceString(@sdxGroupColor); + lblGridLinesColor.Caption := cxGetResourceString(@sdxGridLinesColor); + + tshFonts.Caption := cxGetResourceString(@sdxFonts); + btnFont.Caption := cxGetResourceString(@sdxBtnFont); + btnFixedFont.Caption := cxGetResourceString(@sdxBtnFixedFont); + btnGroupFont.Caption := cxGetResourceString(@sdxBtnGroupFont); + + tshFormatting.Caption := cxGetResourceString(@sdxFormatting); + lblRefinements.Caption := cxGetResourceString(@sdxRefinements); + AdjustBevelSize(bvlAppearance, lblRefinements); + chbxFlatCheckMarks.Caption := cxGetResourceString(@sdxFlatCheckMarks); + chbxCheckMarksAsText.Caption := cxGetResourceString(@sdxCheckMarksAsText); + chbxDisplayGraphicsAsText.Caption := cxGetResourceString(@sdxDisplayGraphicsAsText); + chbxTransparentColumnGraphics.Caption := cxGetResourceString(@sdxTransparentColumnGraphics); +end; + +procedure TdxInspectorDesignWindow.ccbxColorChange(Sender: TObject); +var + AColor: TColor; +begin + if LockControlsUpdate then Exit; + AColor := TdxPSColorCombo(Sender).ColorValue; + case TdxPSColorCombo(Sender).Tag of + 0: ReportLink.Color := AColor; + 1: ReportLink.FixedColor := AColor; + 2: ReportLink.GroupColor := AColor; + 3: ReportLink.GridLineColor := AColor; + end; + Modified := True; +end; + +procedure TdxInspectorDesignWindow.chbxAutoNodesExpandClick( + Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.AutoNodesExpand := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxInspectorDesignWindow.UpdatePreview; +const + BorderStyleMap: array[Boolean] of TBorderStyle = (bsNone, bsSingle); + MBImageIndexes: array[Boolean] of Integer = (-1, 0); + BMWImageIndexes: array[Boolean] of Integer = (-1, 1); +begin + if ReportLink.CustomInspector <> nil then + insPreview.PaintStyle := TCustomdxInspectorControlAccess(ReportLink.CustomInspector).PaintStyle; + insPreview.GridColor := ReportLink.GridLineColor; + irMersedesBenz.ImageIndex := MBImageIndexes[ReportLink.IsShowImages]; + irBMW.ImageIndex := BMWImageIndexes[ReportLink.IsShowImages]; + irMBSUV.Border3D := not ReportLink.IsFlatCheckMarks; + irBMWSUV.Border3D := not ReportLink.IsFlatCheckMarks; + + insPreview.Invalidate; + pnlPreviewHost.BorderStyle := BorderStyleMap[ReportLink.IsDrawBorder]; + //shPreviewFrame.Pen.Color := ReportLink.GridLineColor; +end; + +procedure TdxInspectorDesignWindow.chbxTransparentClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + case TCheckBox(Sender).Tag of + 0: ReportLink.Transparent := TCheckBox(Sender).Checked; + 1: ReportLink.FixedTransparent := TCheckBox(Sender).Checked; + 2: ReportLink.GroupTransparent := TCheckBox(Sender).Checked; + end; + Modified := True; +end; + +procedure TdxInspectorDesignWindow.stCaptionTransparentClick(Sender: TObject); +begin + if chbxCaptionTransparent.CanFocus then ActiveControl := chbxCaptionTransparent; + chbxCaptionTransparent.Checked := not chbxCaptionTransparent.Checked; +end; + +procedure TdxInspectorDesignWindow.stGroupTransparentClick(Sender: TObject); +begin + if chbxGroupTransparent.CanFocus then ActiveControl := chbxGroupTransparent; + chbxGroupTransparent.Checked := not chbxGroupTransparent.Checked; +end; + +procedure TdxInspectorDesignWindow.stTransparentClick(Sender: TObject); +begin + if chbxTransparent.CanFocus then ActiveControl := chbxTransparent; + chbxTransparent.Checked := not chbxTransparent.Checked; +end; + +procedure TdxInspectorDesignWindow.chbxAutoWidthClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.AutoWidth := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxInspectorDesignWindow.btnFontClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with dxPSGlbl.FontDialog do + begin + case TButton(Sender).Tag of + 0: Font := ReportLink.Font; + 1: Font := ReportLink.FixedFont; + 2: Font := ReportLink.GroupFont; + end; + + if Execute then + begin + case TButton(Sender).Tag of + 0: + begin + ReportLink.Font := Font; + FontInfoToText(ReportLink.Font, edFont); + end; + 1: + begin + ReportLink.FixedFont := Font; + FontInfoToText(ReportLink.FixedFont, edFixedFont); + end; + 2: + begin + ReportLink.GroupFont := Font; + FontInfoToText(ReportLink.GroupFont, edGroupFont); + end; + end; + Modified := True; + end; + end; +end; + +procedure TdxInspectorDesignWindow.chbxOptionsClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TCheckBox(Sender) do + if Checked then + ReportLink.Options := ReportLink.Options + [TdxInspectorPaintOption(Tag)] + else + ReportLink.Options := ReportLink.Options - [TdxInspectorPaintOption(Tag)]; + Modified := True; +end; + +function TdxInspectorDesignWindow.CaptionColor: TColor; +begin + if ReportLink.FixedTransparent then + Result := clWindow + else + Result := ReportLink.FixedColor; +end; + +function TdxInspectorDesignWindow.GroupColor: TColor; +begin + if ReportLink.GroupTransparent then + Result := clWindow + else + Result := ReportLink.GroupColor; +end; + +function TdxInspectorDesignWindow.ValueColor: TColor; +begin + if ReportLink.Transparent then + Result := clWindow + else + Result := ReportLink.Color; +end; + +{ custom draw helpers } + +procedure FillRectColor(ACanvas: TCanvas; const R: TRect; AColor: TColor); +begin + ACanvas.Brush.Color := AColor; + ACanvas.FillRect(R); +end; + +procedure DrawTextRect(ACanvas: TCanvas; R: TRect; const AText: string; + AFont: TFont; AColor: TColor; ATextAlignY: TdxTextAlignY); +var + X, Y: Integer; +begin + FillRectColor(ACanvas, R, AColor); + InflateRect(R, -2, 0); + ACanvas.Font := AFont; + ACanvas.Brush.Style := bsClear; + X := R.Left + 2; + if ATextAlignY = taTop then + Y := R.Top + 2 + else + Y := R.Top + (R.Bottom - R.Top - ACanvas.TextHeight(AText)) div 2; + ACanvas.TextRect(R, X, Y, AText); +end; + +procedure DrawExpandButton(ACanvas: TCanvas; R: TRect; AColor: TColor; + APaintStyle: TdxInspectorPaintStyle); +const + AreDrawBorders: array[TdxInspectorPaintStyle] of Boolean = + (False, True, True, True, False); + IsDrawSign: array[TdxInspectorPaintStyle] of Boolean = + (True, True, True, True, False); + Borders3D: array[TdxInspectorPaintStyle] of Boolean = + (False, False, True, False, False); + ButtonSizes: array[TdxInspectorPaintStyle] of Integer = + (dxInspectorButtonSize, dxInspectorButtonSize, dxInspectorButtonExSize, + dxInspectorButtonSize, dxInspectorButtonSize); +var + ButtonSize: Integer; +begin + ACanvas.Brush.Color := AColor; + ACanvas.FillRect(R); + + ButtonSize := ButtonSizes[APaintStyle]; + with R do + R := Bounds(Left + (Right - Left - ButtonSize) div 2, + Top + (Bottom - Top - ButtonSize) div 2, ButtonSize, ButtonSize); + if AreDrawBorders[APaintStyle] then + begin + if Borders3D[APaintStyle] then + begin + DrawEdge(ACanvas.Handle, R, EDGE_RAISED, BF_RECT or BF_SOFT); + InflateRect(R, -1, -1); + Dec(R.Right); + Dec(R.Bottom); + end + else + begin + ACanvas.Brush.Color := clWindowText; + ACanvas.FrameRect(R); + InflateRect(R, -1, -1); + end; + end + else + begin + InflateRect(R, -1, -2); + OffsetRect(R, 1, 0); + end; + + if IsDrawSign[APaintStyle] then + begin + with R do + R := Rect(Left + 1, Top + (Bottom - Top) div 2, Right - 1, Top + (Bottom - Top) div 2 + 1); + ACanvas.Brush.Color := clWindowText; + ACanvas.FillRect(R); + end; +end; + +procedure TdxInspectorDesignWindow.irMBSUVDrawValue( + Sender: TdxInspectorRow; ACanvas: TCanvas; ARect: TRect; + var AText: String; AFont: TFont; var AColor: TColor; var ADone: Boolean); +begin + AFont := ReportLink.Font; + AColor := ValueColor; + if ReportLink.IsCheckMarksAsText then + begin + DrawTextRect(ACanvas, ARect, AText, AFont, AColor, taCenterY); + ADone := True; + end; +end; + +procedure TdxInspectorDesignWindow.InspectorDrawValue( + Sender: TdxInspectorRow; ACanvas: TCanvas; ARect: TRect; + var AText: String; AFont: TFont; var AColor: TColor; var ADone: Boolean); +begin + DrawTextRect(ACanvas, ARect, AText, ReportLink.Font, ValueColor, taCenterY); + ADone := True; +end; + +procedure TdxInspectorDesignWindow.irMBPhotoDrawValue( + Sender: TdxInspectorRow; ACanvas: TCanvas; ARect: TRect; + var AText: String; AFont: TFont; var AColor: TColor; var ADone: Boolean); +begin + AFont := ReportLink.Font; + AColor := ValueColor; + if ReportLink.IsDisplayGraphicsAsText then + begin + DrawTextRect(ACanvas, ARect, ReportLink.GraphicAsTextText, AFont, AColor, taTop); + ADone := True; + end; +end; + +procedure TdxInspectorDesignWindow.InspectorDrawCaption( + Sender: TdxInspectorRow; ACanvas: TCanvas; ARect: TRect; + var AText: string; AFont: TFont; var AColor: TColor; var ADone: Boolean); +type + TdxInspectorCaptionIndentDrawInfo = record + CategoryIndentRect: TRect; + ImageRect: TRect; + IndentRect: TRect; + end; + + procedure CalcDrawInfo(var ADrawInfo: TdxInspectorCaptionIndentDrawInfo); + const + IndentWidth = 14; + begin + FillChar(ADrawInfo, SizeOf(TdxInspectorCaptionIndentDrawInfo), 0); + + with ADrawInfo do + begin + ImageRect := ARect; + CategoryIndentRect := ARect; + IndentRect := ARect; + + ImageRect.Right := ImageRect.Left; + IndentRect.Right := IndentRect.Left; + CategoryIndentRect.Right := CategoryIndentRect.Left; + + if Sender.IsCategory then + begin + if Sender.ImageIndex <> -1 then + Dec(ImageRect.Left, ilVendorLogos.Width); + CategoryIndentRect.Right := ImageRect.Left; + CategoryIndentRect.Left := 0; + end + else + begin + IndentRect.Left := IndentRect.Right - IndentWidth; + if insPreview.PaintStyle = ipsNet then + begin + CategoryIndentRect.Right := IndentRect.Left; + CategoryIndentRect.Left := 0; + end + else + IndentRect.Left := 0; + end; + if (insPreview.PaintStyle = ipsNet) and ((Sender <> irMBPhoto) and (Sender <> irBMWPhoto)) then + Inc(CategoryIndentRect.Bottom); + end; + end; + + procedure DrawImage(const R: TRect); + begin + FillRectColor(ACanvas, R, GroupColor); + ilVendorLogos.Draw(ACanvas, R.Left, R.Top, Sender.ImageIndex); + end; + +const + TextAligns: array[Boolean] of TdxTextAlignY = (taCenterY, taTop); +var + DrawInfo: TdxInspectorCaptionIndentDrawInfo; +begin + if Sender.IsCategory then + begin + AColor := GroupColor; + AFont := ReportLink.GroupFont; + end + else + begin + AColor := CaptionColor; + AFont := ReportLink.FixedFont; + end; + + DrawTextRect(ACanvas, ARect, AText, AFont, AColor, TextAligns[Sender is TdxInspectorTextGraphicRow]); + CalcDrawInfo(DrawInfo); + with DrawInfo do + begin + if not IsRectEmpty(ImageRect) then + DrawImage(ImageRect); + if not IsRectEmpty(IndentRect) then + FillRectColor(ACanvas, IndentRect, AColor); + if not IsRectEmpty(CategoryIndentRect) then + begin + if Sender.IsCategory and ReportLink.IsDrawExpandButtons then + DrawExpandButton(ACanvas, CategoryIndentRect, GroupColor, insPreview.PaintStyle) + else + FillRectColor(ACanvas, CategoryIndentRect, GroupColor); + if not Sender.IsCategory then + begin + CategoryIndentRect.Left := CategoryIndentRect.Right - 1; + FillRectColor(ACanvas, CategoryIndentRect, ReportLink.GridLineColor); + end; + end; + end; + ADone := True; +end; + +procedure TdxInspectorDesignWindow.PageControl1Change(Sender: TObject); +begin + lblPreview.Parent := TPageControl(Sender).ActivePage; +end; + +procedure RegisterHelpers; +begin + TdxInspectorRowHelper.Register; + TdxInspectorImageRowHelper.Register; +end; + +procedure UnregisterHelpers; +begin + TdxRowHelpersFactory.ReleaseInstance; +end; + +initialization + RegisterHelpers; + + dxPSRegisterReportLink(TdxInspectorReportLink, TdxInspector, TdxInspectorDesignWindow); + FPicture := TPicture.Create; + +finalization + FPicture.Free; + dxPSUnregisterReportLink(TdxInspectorReportLink, TdxInspector, TdxInspectorDesignWindow); + UnregisterHelpers; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxInsLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxInsLnkReg.pas new file mode 100644 index 00000000..6871566c --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxInsLnkReg.pas @@ -0,0 +1,88 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxInsLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignEditors, + {$ELSE} + DsgnIntf, + {$ENDIF} + Classes, dxPSdxInsLnk, dxPSdxDBInsLnk; + +type + TdxInspectorOptionsPropertyEditor = class(TSetProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + +function TdxInspectorOptionsPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog]; +end; + +procedure TdxInspectorOptionsPropertyEditor.Edit; +var + I: Integer; +begin + inherited; + if TCustomdxInspectorReportLink(GetComponent(0)).DesignReport then + begin + Designer.Modified; + if PropCount > 1 then + for I := 1 to PropCount - 1 do + GetComponent(I).Assign(GetComponent(0)); + end; +end; + +procedure Register; +begin + RegisterNoIcon([TdxInspectorReportLink, TdxDBInspectorReportLink]); + RegisterPropertyEditor(TypeInfo(TdxInspectorPaintOptions), + TCustomdxInspectorReportLink, 'Options', TdxInspectorOptionsPropertyEditor); +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxLCLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxLCLnk.pas new file mode 100644 index 00000000..8dbdce78 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxLCLnk.pas @@ -0,0 +1,2454 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxLCLnk; + +interface + +{$I cxVer.inc} + +uses + Classes, Windows, Graphics, Controls, ComCtrls, dxLayoutLookAndFeels, + dxLayoutControl, dxBase, dxPrnPg, dxPSCore, dxPSContainerLnk; + +type + TdxLayoutControlReportLink = class; + TdxLayoutControlReportLinkOptionsPagination = class; + TdxLayoutControlReportLinkOptionsTransparent = class; + + { Report Items} + + TdxLCCacheItemKind = (ikLayoutItem, ikLayoutGroup, ikLayoutItemCaption, ikControl); + + TdxLCBoundsCacheItem = class + public + Component: TComponent; // nil if ItemKind = ikItemCaption + Bounds: TRect; + EmbeddedLink: Boolean; + end; + + TdxReportLayoutControlHost = class(TdxReportWinControlHost) + protected + function GetControlItem: TdxReportVisualItem; override; + end; + + TdxCustomReportLayoutItem = class(TdxReportGroup) + private + function GetLayoutItemBounds: TRect; + protected + procedure AdjustBounds(DC: HDC); virtual; + property LayoutItemBounds: TRect read GetLayoutItemBounds; + public + function LayoutItem: TdxCustomLayoutItem; overload; virtual; + end; + + TdxReportLayoutGroup = class(TdxCustomReportLayoutItem) + public + function LayoutItem: TdxLayoutGroup; reintroduce; overload; + end; + + TdxReportLayoutItem = class(TdxCustomReportLayoutItem) + private + function GetAdapter: TdxCustomLayoutControlAdapter; + function GetCaptionBounds: TRect; + function GetCaptionItem: TdxReportCellString; + function GetControl: TControl; + function GetControlBounds: TRect; + function GetControlItem: TdxReportVisualItem; + function GetHasCaptionItem: Boolean; + function GetHasControlItem: Boolean; + function GetIsControlAccessible: Boolean; + protected + procedure AdjustBounds(DC: HDC); override; + function CreateCaption(AReportLink: TdxLayoutControlReportLink): TdxReportCellString; virtual; + function CreateControl(AReportLink: TdxLayoutControlReportLink): TdxReportVisualItem; virtual; + procedure CreateNestedItems(AReportLink: TdxLayoutControlReportLink); virtual; + function IsCreateCaption(AReportLink: TdxLayoutControlReportLink): Boolean; virtual; + function IsCreateControl(AReportLink: TdxLayoutControlReportLink): Boolean; virtual; + + property Adapter: TdxCustomLayoutControlAdapter read GetAdapter; + property CaptionBounds: TRect read GetCaptionBounds; + property ControlBounds: TRect read GetControlBounds; + property IsControlAccessible: Boolean read GetIsControlAccessible; + public + function LayoutItem: TdxLayoutItem; reintroduce; overload; + + property CaptionItem: TdxReportCellString read GetCaptionItem; + property Control: TControl read GetControl; + property ControlItem: TdxReportVisualItem read GetControlItem; + property HasCaptionItem: Boolean read GetHasCaptionItem; + property HasControlItem: Boolean read GetHasControlItem; + end; + + { Definitions } + + TdxPSCustomLayoutItemDefinition = class(TdxPSCustomContainerItemDefinition) + private + function GetLayoutItem: TdxCustomLayoutItem; + function GetReportItem: TdxCustomReportLayoutItem; + procedure SetLayoutItem(Value: TdxCustomLayoutItem); + protected + procedure AdjustBounds(DC: HDC); virtual; + procedure SaveOriginalItemSize; virtual; + procedure SetupOriginalControlSize; virtual; + public + function OptionsPagination: TdxLayoutControlReportLinkOptionsPagination; reintroduce; overload; + property LayoutItem: TdxCustomLayoutItem read GetLayoutItem write SetLayoutItem; + property ReportItem: TdxCustomReportLayoutItem read GetReportItem; + end; + + TdxPSLayoutGroupDefinition = class(TdxPSCustomLayoutItemDefinition) + private + function GetLayoutItem: TdxLayoutGroup; + protected + procedure AddDelimitersHorz(AList: TList); override; + procedure AddDelimitersVert(AList: TList); override; + public + property LayoutItem: TdxLayoutGroup read GetLayoutItem; + end; + + TdxPSLayoutItemDefinition = class(TdxPSCustomLayoutItemDefinition) + private + function GetLayoutItem: TdxLayoutItem; + function GetReportItem: TdxReportLayoutItem; + protected + procedure AddDelimitersHorz(AList: TList); override; + procedure AddDelimitersVert(AList: TList); override; + procedure SaveOriginalItemSize; override; + procedure SetupOriginalControlSize; override; + public + property LayoutItem: TdxLayoutItem read GetLayoutItem; + property ReportItem: TdxReportLayoutItem read GetReportItem; + end; + + { Producers } + + TdxPSLayoutControlObjectProducer = class(TdxPSCustomProducer) + public + function ReportLink: TdxLayoutControlReportLink; reintroduce; overload; + function RootContainer: TdxLayoutControl; reintroduce; overload; + end; + + TdxPSLayoutLookAndFeelProducerClass = class of TdxPSLayoutLookAndFeelProducer; + + TdxPSLayoutLookAndFeelProducer = class(TdxPSLayoutControlObjectProducer) + protected + function GetContentColor: TColor; virtual; + function GetGroupCaptionColor: TColor; virtual; + function GetIsContentTransparent: Boolean; virtual; + function GetIsGroupCaptionTransparent: Boolean; virtual; + function GetTransparentColor: TColor; virtual; + + procedure InitializeReportLookAndFeel(ALookAndFeel: TdxPSReportGroupLookAndFeel); virtual; + class function ReportLookAndFeelClass: TdxPSReportGroupLookAndFeelClass; virtual; + + property GroupCaptionColor: TColor read GetGroupCaptionColor; + property IsGroupCaptionTransparent: Boolean read GetIsGroupCaptionTransparent; + public + function LayoutLookAndFeel: TdxCustomLayoutLookAndFeel; overload; virtual; + class function LayoutLookAndFeelClass: TdxCustomLayoutLookAndFeelClass; virtual; + + class function PairClass: TClass; override; + class procedure Register; override; + class procedure Unregister; override; + + property ContentColor: TColor read GetContentColor; + property IsContentTransparent: Boolean read GetIsContentTransparent; + property TransparentColor: TColor read GetTransparentColor; + end; + + TdxPSLayoutStandardLookAndFeelProducer = class(TdxPSLayoutLookAndFeelProducer) + protected + function GetTransparentColor: TColor; override; + class function ReportLookAndFeelClass: TdxPSReportGroupLookAndFeelClass; override; + public + function LayoutLookAndFeel: TdxLayoutStandardLookAndFeel; reintroduce; overload; + class function LayoutLookAndFeelClass: TdxCustomLayoutLookAndFeelClass; override; + end; + + TdxPSLayoutOfficeLookAndFeelProducer = class(TdxPSLayoutStandardLookAndFeelProducer) + protected + class function ReportLookAndFeelClass: TdxPSReportGroupLookAndFeelClass; override; + public + function LayoutLookAndFeel: TdxLayoutOfficeLookAndFeel; reintroduce; overload; + class function LayoutLookAndFeelClass: TdxCustomLayoutLookAndFeelClass; override; + end; + + TdxPSLayoutWebLookAndFeelProducer = class(TdxPSLayoutLookAndFeelProducer) + protected + function GetGroupCaptionColor: TColor; override; + function GetTransparentColor: TColor; override; + procedure InitializeReportLookAndFeel(ALookAndFeel: TdxPSReportGroupLookAndFeel); override; + class function ReportLookAndFeelClass: TdxPSReportGroupLookAndFeelClass; override; + public + function LayoutLookAndFeel: TdxLayoutWebLookAndFeel; reintroduce; overload; + class function LayoutLookAndFeelClass: TdxCustomLayoutLookAndFeelClass; override; + + property GroupCaptionColor; + property IsGroupCaptionTransparent; + end; + + TdxPSCustomLayoutItemProducerClass = class of TdxPSCustomLayoutItemProducer; + + TdxPSCustomLayoutItemProducer = class(TdxPSLayoutControlObjectProducer) + private + function GetLayoutItemBounds: TRect; + protected + function GetContentColor: TColor; virtual; + function GetIsContentTransparent: Boolean; virtual; + function GetLayoutLookAndFeel: TdxCustomLayoutLookAndFeel; virtual; + function GetLayoutLookAndFeelProducer: TdxPSLayoutLookAndFeelProducer; + + procedure InitializeReportItem(AnItem: TdxReportCell); virtual; + class function ReportItemClass: TdxReportCellClass; virtual; + + function OptionsTransparent: TdxLayoutControlReportLinkOptionsTransparent; reintroduce; overload; + + procedure AdjustBounds; virtual; + procedure SaveOriginalItemSize; + public + function Definition: TdxPSCustomLayoutItemDefinition; reintroduce; overload; + class function DefinitionClass: TdxPSCustomContainerItemDefinitionClass; override; + + function LayoutItem: TdxCustomLayoutItem; overload; virtual; + class function LayoutItemClass: TdxCustomLayoutItemClass; virtual; + + class function PairClass: TClass; override; + function ProducingObjectFriendlyName: string; override; + procedure Reposition; override; + + class procedure Register; override; + class procedure Unregister; override; + + property ContentColor: TColor read GetContentColor; + property IsContentTransparent: Boolean read GetIsContentTransparent; + property LayoutItemBounds: TRect read GetLayoutItemBounds; + property LayoutLookAndFeel: TdxCustomLayoutLookAndFeel read GetLayoutLookAndFeel; + property LayoutLookAndFeelProducer: TdxPSLayoutLookAndFeelProducer read GetLayoutLookAndFeelProducer; + end; + + TdxPSLayoutGroupProducer = class(TdxPSCustomLayoutItemProducer) + protected + function GetGroupCaptionContentColor: TColor; virtual; + function GetIsGroupCaptionTransparent: Boolean; virtual; + procedure InitializeReportItem(AnItem: TdxReportCell); override; + class function ReportItemClass: TdxReportCellClass; override; + public + function Definition: TdxPSLayoutGroupDefinition; reintroduce; overload; + class function DefinitionClass: TdxPSCustomContainerItemDefinitionClass; override; + + function LayoutItem: TdxLayoutGroup; reintroduce; overload; + class function LayoutItemClass: TdxCustomLayoutItemClass; override; + + function ProducingObjectFriendlyName: string; override; + procedure Reposition; override; + + property GroupCaptionContentColor: TColor read GetGroupCaptionContentColor; + property IsGroupCaptionTransparent: Boolean read GetIsGroupCaptionTransparent; + end; + + TdxPSLayoutItemProducer = class(TdxPSCustomLayoutItemProducer) + private + function GetControl: TControl; + function GetHasControl: Boolean; + protected + function GetContentColor: TColor; override; + procedure InitializeReportItem(AnItem: TdxReportCell); override; + class function ReportItemClass: TdxReportCellClass; override; + public + function Definition: TdxPSLayoutItemDefinition; reintroduce; overload; + class function DefinitionClass: TdxPSCustomContainerItemDefinitionClass; override; + + function LayoutItem: TdxLayoutItem; reintroduce; overload; + class function LayoutItemClass: TdxCustomLayoutItemClass; override; + + function ProducingObjectFriendlyName: string; override; + procedure Reposition; override; + + property Control: TControl read GetControl; + property HasControl: Boolean read GetHasControl; + end; + + { Caches } + + TdxPSCustomLayoutObjectProducerCache = class(TdxPSContainerReportLinkCustomCache) + public + function ReportLink: TdxLayoutControlReportLink; reintroduce; overload; + end; + + TdxPSLayoutItemProducerCache = class(TdxPSCustomLayoutObjectProducerCache) + private + function GetItem(Index: Integer): TdxPSCustomLayoutItemProducer; + function GetProducer(AProducerClass: TdxPSCustomLayoutItemProducerClass; + ALayoutItem: TdxCustomLayoutItem): TdxPSCustomLayoutItemProducer; + protected + property Items[Index: Integer]: TdxPSCustomLayoutItemProducer read GetItem; + public + property Producers[AProducerClass: TdxPSCustomLayoutItemProducerClass; + ALayoutItem: TdxCustomLayoutItem]: TdxPSCustomLayoutItemProducer read GetProducer; default; + end; + + TdxPSLayoutLookAndFeelProducerCache = class(TdxPSCustomLayoutObjectProducerCache) + private + function GetItem(Index: Integer): TdxPSLayoutLookAndFeelProducer; + function GetProducer(AProducerClass: TdxPSLayoutLookAndFeelProducerClass; + ALayoutLookAndFeel: TdxCustomLayoutLookAndFeel): TdxPSLayoutLookAndFeelProducer; + protected + property Items[Index: Integer]: TdxPSLayoutLookAndFeelProducer read GetItem; + public + property Producers[AProducerClass: TdxPSLayoutLookAndFeelProducerClass; + ALayoutLookAndFeel: TdxCustomLayoutLookAndFeel]: TdxPSLayoutLookAndFeelProducer read GetProducer; default; + end; + + TdxPSNativeLayoutControlProducer = class(TdxPSNativePrintableControlProducer) + public + function Control: TdxCustomLayoutControl; reintroduce; overload; + class function ControlClass: TControlClass; override; + + class function HasNativeSupportForBorders: Boolean; override; + + function ObjectExpandHeight: Boolean; override; + function ObjectExpandWidth: Boolean; override; + end; + + TdxPSLayoutControlProducer = class(TdxPSRootContainerProducer) + private + function GetAvailableBounds: TRect; + function GetProducer(LayoutItem: TdxCustomLayoutItem): TdxPSCustomLayoutItemProducer; + protected + procedure CreateLayoutItems(AnItem: TdxReportVisualItem); virtual; + procedure GetLayoutItemList(AnItems: TList); + function HostClass: TdxReportCellClass; override; + procedure InitializeHost(ACell: TdxReportCell); override; + procedure InitializeItem(AnItem: TdxReportVisualItem); override; + function ItemClass: TdxReportVisualItemClass; override; + procedure ReportLinkInitializeItem(AnItem: TdxReportVisualItem); + + property AvailableBounds: TRect read GetAvailableBounds; + property Producers[LayoutItem: TdxCustomLayoutItem]: TdxPSCustomLayoutItemProducer read GetProducer; + public + class function CanHasAvailableChildren: Boolean; override; + class function Reenterable: Boolean; override; + + function Control: TdxLayoutControl; reintroduce; overload; + class function ControlClass: TControlClass; override; + + class function HasNativeSupportForBorders: Boolean; override; + + function ObjectExpandHeight: Boolean; override; + function ObjectExpandWidth: Boolean; override; + + function ReportLink: TdxLayoutControlReportLink; reintroduce; overload; + procedure Reposition; override; + end; + + PdxPSLayoutCacheFontItem = ^TdxPSLayoutCacheFontItem; + TdxPSLayoutCacheFontItem = record + CaptionOptions: TdxLayoutLookAndFeelCaptionOptions; + FontIndex: Integer; + end; + + { Options } + + TdxLayoutControlReportLinkOptionsPaginationClass = class of TdxLayoutControlReportLinkOptionsPagination; + + TdxLayoutControlReportLinkOptionsPagination = class(TdxCustomContainerReportLinkOptionsPagination) + private + FGroups: Boolean; + FItems: Boolean; + procedure SetGroups(Value: Boolean); + procedure SetItems(Value: Boolean); + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property Groups: Boolean read FGroups write SetGroups default True; + property Items: Boolean read FItems write SetItems default True; + end; + + TdxLayoutControlReportLinkOptionsSizeClass = class of TdxLayoutControlReportLinkOptionsSize; + + TdxLayoutControlReportLinkOptionsSize = class(TdxCustomContainerReportLinkOptions) + private + FAutoWidth: Boolean; + procedure SetAutoWidth(Value: Boolean); + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property AutoWidth: Boolean read FAutoWidth write SetAutoWidth default True; + end; + + TdxLayoutControlReportLinkOptionsTransparent = class(TdxCustomContainerReportLinkOptionsTransparent) + private + FGroups: Boolean; + FItems: Boolean; + procedure SetGroups(Value: Boolean); + procedure SetItems(Value: Boolean); + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property Groups: Boolean read FGroups write SetGroups default True; + property Items: Boolean read FItems write SetItems default True; + end; + + { Report Link } + + TdxLayoutControlReportLink = class(TdxCustomContainerReportLink, IUnknown, IdxReportLinkController) + private + FCachedBounds: TList; + FCachedFonts: TList; + FCurrentLayoutItem: TdxCustomLayoutItem; + FLayoutItemProducerCache: TdxPSLayoutItemProducerCache; + FLayoutLookAndFeelProducerCache: TdxPSLayoutLookAndFeelProducerCache; + FOptionsSize: TdxLayoutControlReportLinkOptionsSize; + function GetAvailableBounds: TRect; + function GetCachedBoundsCount: Integer; + function GetCachedBoundsItem(Index: Integer): TdxLCBoundsCacheItem; + function GetCachedFontItem(Index: Integer): PdxPSLayoutCacheFontItem; + function GetCachedFontItemCount: Integer; + function GetCurrentHost: TdxReportCell; + function GetLayoutControl: TdxLayoutControl; + function GetLayoutItemProducer(LayoutItem: TdxCustomLayoutItem): TdxPSCustomLayoutItemProducer; + function GetLayoutLookAndFeelProducer(LayoutLookAndFeel: TdxCustomLayoutLookAndFeel): TdxPSLayoutLookAndFeelProducer; + function GetOptionsPagination: TdxLayoutControlReportLinkOptionsPagination; + function GetOptionsTransparent: TdxLayoutControlReportLinkOptionsTransparent; + function GetRootLayoutGroup: TdxLayoutGroup; + procedure SetOptionsPagination(Value: TdxLayoutControlReportLinkOptionsPagination); + procedure SetOptionsSize(Value: TdxLayoutControlReportLinkOptionsSize); + procedure SetOptionsTransparent(Value: TdxLayoutControlReportLinkOptionsTransparent); + protected + function GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; override; + procedure InternalRestoreDefaults; override; + + procedure CacheControlsBounds; + procedure ConstructReport(AReportCells: TdxReportCells); override; + procedure PostCheckEmbeddedControls; + procedure PrepareConstruct; override; + procedure PrepareLookAndFeels; + procedure RepositionControls; override; + + procedure AddHiddenItem(ATreeView: TTreeView; AParent: TTreeNode; AnItem: TdxCustomLayoutItem); + procedure AddItem(ATreeView: TTreeView; AParent: TTreeNode; AnItem: TdxCustomLayoutItem); + function IsComponentEditable(AComponent: TComponent): Boolean; override; + procedure LoadControlsTree(ATreeView: TTreeView); override; + procedure LoadHiddenControlsTree(ATreeView: TTreeView); override; + function AddBoundsToCache(AComponent: TComponent; const ABounds: TRect): Integer; + function AddCaptionOptionsFontToCache(ACaptionOptions: TdxLayoutLookAndFeelCaptionOptions): Integer; + procedure ClearCachedBounds; + procedure ClearCachedFonts; + function FindBoundsByComponent(AComponent: TComponent; var ABounds: TRect; ASetEmbedded: Boolean): Boolean; + function FindFontIndexByCaptionOptions(ACaptionOptions: TdxLayoutLookAndFeelCaptionOptions): Integer; + procedure FreeAndNilCachedBounds; + procedure FreeAndNilCachedFonts; + + procedure CreateOptions; override; + procedure DestroyOptions; override; + function GetOptionsPaginationClass: TdxCustomContainerReportLinkOptionsPaginationClass; override; + function GetOptionsSizeClass: TdxLayoutControlReportLinkOptionsSizeClass; virtual; + function GetOptionsTransparentClass: TdxCustomContainerReportLinkOptionsTransparentClass; override; + + function FindReportGroupLookAndFeel(ALayoutLookAndFeel: TdxCustomLayoutLookAndFeel): TdxPSReportGroupLookAndFeel; + function FindReportItemByLayoutItem(ALayoutItem: TdxCustomLayoutItem): TdxReportCell; + procedure GetLayoutItemList(AControl: TdxLayoutControl; AnItems: TList); + function GetPreparedFontIndex(ACaptionOptions: TdxLayoutLookAndFeelCaptionOptions): Integer; overload; + // IdxReportLinkController + function GetControlSiteBounds(AControl: TControl): TRect; virtual; + + property AvailableBounds: TRect read GetAvailableBounds; + property CachedBoundsCount: Integer read GetCachedBoundsCount; + property CachedBoundsItem[Index: Integer]: TdxLCBoundsCacheItem read GetCachedBoundsItem; + property CachedBounds: TList read FCachedBounds; + + property CachedFontItemCount: Integer read GetCachedFontItemCount; + property CachedFontItems[Index: Integer]: PdxPSLayoutCacheFontItem read GetCachedFontItem; + property CachedFonts: TList read FCachedFonts; + + property CurrentHost: TdxReportCell read GetCurrentHost; + property CurrentLayoutItem: TdxCustomLayoutItem read FCurrentLayoutItem Write FCurrentLayoutItem; + property LayoutItemProducerCache: TdxPSLayoutItemProducerCache read FLayoutItemProducerCache; + property LayoutItemProducers[LayoutItem: TdxCustomLayoutItem]: TdxPSCustomLayoutItemProducer read GetLayoutItemProducer; + property LayoutLookAndFeelProducerCache: TdxPSLayoutLookAndFeelProducerCache read FLayoutLookAndFeelProducerCache; + property LayoutLookAndFeelProducers[LayoutLookAndFeel: TdxCustomLayoutLookAndFeel]: TdxPSLayoutLookAndFeelProducer read GetLayoutLookAndFeelProducer; + property RootLayoutGroup: TdxLayoutGroup read GetRootLayoutGroup; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + class function Aggregable: Boolean; override; + + property LayoutControl: TdxLayoutControl read GetLayoutControl; + published + property OptionsPagination: TdxLayoutControlReportLinkOptionsPagination read GetOptionsPagination write SetOptionsPagination; + property OptionsSize: TdxLayoutControlReportLinkOptionsSize read FOptionsSize write SetOptionsSize; + property OptionsTransparent: TdxLayoutControlReportLinkOptionsTransparent read GetOptionsTransparent write SetOptionsTransparent; + end; + + { Design Window } + + TdxPSLayoutControlDesignWindow = class(TdxfmCustomContainerDesignWindow) + private + function GetLayoutReportLink: TdxLayoutControlReportLink; + protected + procedure DoInitialize; override; + + procedure SetOptionsPaginationByIndex(AnIndex: Integer; AValue: Boolean); override; + procedure SetOptionsSizeByIndex(AnIndex: Integer; AValue: Boolean); override; + procedure SetOptionsTransparentByIndex(AnIndex: Integer; AValue: Boolean); override; + + procedure InitializeControlsTree; override; + procedure InitializeHiddenControlsTree; override; + function IsBoldNode(ANode: TTreeNode): Boolean; override; + public + property LayoutReportLink: TdxLayoutControlReportLink read GetLayoutReportLink; + end; + +implementation + +uses + {$IFDEF DELPHI6} Variants, {$ENDIF} SysUtils, StdCtrls, Forms, cxClasses, + dxPSGlbl, dxPSRes, dxPSUtl, dxLayoutControlAdapters, cxControls; + +const + LayoutBorderStyleMap: array[TdxLayoutBorderStyle] of TdxPSCellBorderClass = + (TdxPSCellNullBorder, TdxPSCellUltraFlatBorder, TdxPSCellSunkenSoftBorder, TdxPSCellSunkenBorder); + LayoutCaptionAlignHorzMap: array[TAlignment] of TdxTextAlignX = (taLeft, taRight, taCenterX); + LayoutCaptionAlignVertMap: array[TdxAlignmentVert] of TdxTextAlignY = (taTop, taCenterY, taBottom); + LayoutGroupCaptionAlignHorzMap: array[TAlignment] of TdxTextAlignX = (taLeft, taRight, taCenterX); + +type + TcxControlAccess = class(TcxControl); + TdxCustomContainerReportLinkAccess = class(TdxCustomContainerReportLink); + TdxCustomLayoutControlAccess = class(TdxCustomLayoutControl); + TdxCustomLayoutItemAccess = class(TdxCustomLayoutItem); + TdxCustomLayoutLookAndFeelAccess = class(TdxCustomLayoutLookAndFeel); + TdxLayoutControlViewInfoAccess = class(TdxLayoutControlViewInfo); + TdxLayoutItemAccess = class(TdxLayoutItem); + +{ Helpers } + +function GetLayoutItemRelativeBounds(ALayoutItem: TdxCustomLayoutItem): TRect; + + function LayoutControl: TdxCustomLayoutControlAccess; + begin + Result := TdxCustomLayoutControlAccess(ALayoutItem.Container); + end; + + function ScrollLeft: Integer; + begin + Result := LayoutControl.HScrollBar.Position; + end; + + function ScrollTop: Integer; + begin + Result := LayoutControl.VScrollBar.Position; + end; + + function ParentLeft: Integer; + begin + Result := ALayoutItem.Parent.ViewInfo.Bounds.Left; + end; + + function ParentTop: Integer; + begin + Result := ALayoutItem.Parent.ViewInfo.Bounds.Top; + end; + +begin + if ALayoutItem.ViewInfo <> nil then + begin + Result := ALayoutItem.ViewInfo.Bounds; + if ALayoutItem.IsRoot or ALayoutItem.Parent.IsRoot then + OffsetRect(Result, ScrollLeft, ScrollTop) + else + OffsetRect(Result, -ParentLeft, -ParentTop); + end + else + Result := NullRect; +end; + +{ Factories } + +type + TdxPSLayoutItemProducerFactory = class(TdxCustomClassMaps) + private + function GetProducerClass(LayoutItem: TdxCustomLayoutItem): TdxPSCustomLayoutItemProducerClass; + public + class function Instance: TdxPSLayoutItemProducerFactory; reintroduce; overload; + property ProducerClasses[LayoutItem: TdxCustomLayoutItem]: TdxPSCustomLayoutItemProducerClass read GetProducerClass; default; + end; + + TdxPSLayoutLookAndFeelProducerFactory = class(TdxCustomClassMaps) + private + function GetProducerClass(LayoutLookAndFeel: TdxCustomLayoutLookAndFeel): TdxPSLayoutLookAndFeelProducerClass; + public + class function Instance: TdxPSLayoutLookAndFeelProducerFactory; reintroduce; overload; + property ProducerClasses[LayoutLookAndFeel: TdxCustomLayoutLookAndFeel]: TdxPSLayoutLookAndFeelProducerClass read GetProducerClass; default; + end; + +{ TdxPSLayoutItemProducerFactory } + +function dxPSLayoutItemProducerFactory: TdxPSLayoutItemProducerFactory; +begin + Result := TdxPSLayoutItemProducerFactory.Instance; +end; + +class function TdxPSLayoutItemProducerFactory.Instance: TdxPSLayoutItemProducerFactory; +begin + Result := inherited Instance as TdxPSLayoutItemProducerFactory; +end; + +function TdxPSLayoutItemProducerFactory.GetProducerClass(LayoutItem: TdxCustomLayoutItem): TdxPSCustomLayoutItemProducerClass; +begin + Result := TdxPSCustomLayoutItemProducerClass(PairClasses[LayoutItem.ClassType]); +end; + +{ TdxPSLayoutLookAndFeelProducerFactory } + +function dxPSLayoutLookAndFeelProducerFactory: TdxPSLayoutLookAndFeelProducerFactory; +begin + Result := TdxPSLayoutLookAndFeelProducerFactory.Instance; +end; + +class function TdxPSLayoutLookAndFeelProducerFactory.Instance: TdxPSLayoutLookAndFeelProducerFactory; +begin + Result := inherited Instance as TdxPSLayoutLookAndFeelProducerFactory; +end; + +function TdxPSLayoutLookAndFeelProducerFactory.GetProducerClass(LayoutLookAndFeel: TdxCustomLayoutLookAndFeel): TdxPSLayoutLookAndFeelProducerClass; +begin + Result := TdxPSLayoutLookAndFeelProducerClass(PairClasses[LayoutLookAndFeel.ClassType]); +end; + +{ TdxReportLayoutControlHost } + +function TdxReportLayoutControlHost.GetControlItem: TdxReportVisualItem; +begin + if CellCount <> 0 then + Result := Cells[0] + else + Result := nil; +end; + +{ TdxCustomReportLayoutItem } + +function TdxCustomReportLayoutItem.LayoutItem: TdxCustomLayoutItem; +begin + Result := TdxCustomLayoutItem(Data); +end; + +procedure TdxCustomReportLayoutItem.AdjustBounds(DC: HDC); +begin + BoundsRect := LayoutItemBounds; +end; + +function TdxCustomReportLayoutItem.GetLayoutItemBounds: TRect; +begin + Result := GetLayoutItemRelativeBounds(LayoutItem); +end; + +{ TdxReportLayoutGroup } + +function TdxReportLayoutGroup.LayoutItem: TdxLayoutGroup; +begin + Result := inherited LayoutItem as TdxLayoutGroup; +end; + +{ TdxReportLayoutItem } + +function TdxReportLayoutItem.LayoutItem: TdxLayoutItem; +begin + Result := inherited LayoutItem as TdxLayoutItem; +end; + +procedure TdxReportLayoutItem.AdjustBounds(DC: HDC); +begin + inherited; + if HasControlItem then + ControlItem.BoundsRect := ControlBounds; + if HasCaptionItem then + with CaptionItem do + begin + BoundsRect := CaptionBounds; + Width := MeasureWidth(DC); + Height := MeasureHeight(DC); + end; +end; + +function TdxReportLayoutItem.CreateCaption(AReportLink: TdxLayoutControlReportLink): TdxReportCellString; +begin + Result := TdxReportCellString.Create(Self); + with Result do + begin + BoundsRect := CaptionBounds; + CellSides := {csAll;//}[]; + with AReportLink.LayoutItemProducers[LayoutItem].LayoutLookAndFeel.ItemOptions do + FontIndex := AReportLink.FindFontIndexByCaptionOptions(CaptionOptions); + HidePrefix := True; + Multiline := LayoutItem.CaptionOptions.Width <> 0; + Text := LayoutItem.Caption; + TextAlignX := LayoutCaptionAlignHorzMap[LayoutItem.CaptionOptions.AlignHorz]; + TextAlignY := LayoutCaptionAlignVertMap[LayoutItem.CaptionOptions.AlignVert]; + Transparent := True; + AdjustFont := True; + end; +end; + +function TdxReportLayoutItem.CreateControl(AReportLink: TdxLayoutControlReportLink): TdxReportVisualItem; + + function LayoutItemProducer: TdxPSCustomLayoutItemProducer; + begin + Result := AReportLink.LayoutItemProducers[LayoutItem]; + end; + + function HasBorder(AControl: TWinControl): Boolean; + var + V: Variant; + begin + Result := csFramed in Control.ControlStyle; + if not Result and AControl.HandleAllocated then + Result := (GetWindowLong(AControl.Handle, GWL_STYLE) and WS_BORDER = WS_BORDER) or + (GetWindowLong(AControl.Handle, GWL_EXSTYLE) and WS_EX_CLIENTEDGE = WS_EX_CLIENTEDGE); + if not Result and dxPSUtl.HasProperty(AControl, 'BorderStyle') then + begin + V := dxPSUtl.GetProperty(AControl, 'BorderStyle'); + Result := not VarIsNull(V) and (V <> Forms.bsNone); + end; + end; + +const + CellSidesMap: array[Boolean] of TdxCellSides = ([], csAll); +begin + if Control is TWinControl then + begin + Result := AReportLink.ActiveBuilder.BuildNestedContainer(TWinControl(Control), Self); + if not AReportLink.Producers[Control].HasNativeSupportForBorders then + with LayoutItemProducer.LayoutLookAndFeel.ItemOptions do + begin + TdxReportWinControlHost(Result).ControlItem.BorderClass := LayoutBorderStyleMap[ControlBorderStyle]; + TdxReportWinControlHost(Result).ControlItem.BorderColor := ControlBorderColor; + TdxReportWinControlHost(Result).ControlItem.CellSides := CellSidesMap[LayoutItem.ControlOptions.ShowBorder or HasBorder(TWinControl(Control))]; + end; + end + else + Result := AReportLink.ActiveBuilder.BuildControl(Control, Self); + + Result.BoundsRect := ControlBounds; + Result.CellSides := []; +end; + +procedure TdxReportLayoutItem.CreateNestedItems(AReportLink: TdxLayoutControlReportLink); +begin + if IsCreateCaption(AReportLink) then CreateCaption(AReportLink); + if IsCreateControl(AReportLink) then CreateControl(AReportLink); +end; + +function TdxReportLayoutItem.IsCreateCaption(AReportLink: TdxLayoutControlReportLink): Boolean; +begin + with TdxLayoutItemAccess(LayoutItem) do + Result := ShowCaption and (not HasControl or AReportLink.DoIsComponentProcessed(Control)); +end; + +function TdxReportLayoutItem.IsCreateControl(AReportLink: TdxLayoutControlReportLink): Boolean; +begin + Result := TdxLayoutItemAccess(LayoutItem).HasControl and AReportLink.DoIsComponentProcessed(Control); +end; + +function TdxReportLayoutItem.GetAdapter: TdxCustomLayoutControlAdapter; +begin + Result := TdxLayoutItemAccess(LayoutItem).ControlAdapter; +end; + +function TdxReportLayoutItem.GetCaptionBounds: TRect; +const + DeltaX = 1; + DeltaY = 4; +begin + with LayoutItem do + begin + Result := ViewInfo.CaptionViewInfo.Bounds; + with ViewInfo.Bounds do + OffsetRect(Result, -Left, -Top); + if CaptionOptions.Width <> 0 then + Result.Right := Result.Left + CaptionOptions.Width; + OffsetRect(Result, -DeltaX, -DeltaY); + //Inc(Result.Left, DeltaX); + Inc(Result.Bottom, DeltaY); // multiline captions + end; +end; + +function TdxReportLayoutItem.GetCaptionItem: TdxReportCellString; +begin + if (DataItemCount <> 0) and (DataItems[0].Data = 0) then + Result := TdxReportCellString(DataItems[0]) + else + Result := nil; +end; + +function TdxReportLayoutItem.GetControl: TControl; +begin + Result := LayoutItem.Control; +end; + +function TdxReportLayoutItem.GetControlBounds: TRect; +begin + with LayoutItem do + begin + Result := ViewInfo.ControlViewInfo.ControlBounds; + with ViewInfo.Bounds do + OffsetRect(Result, -Left, -Top); + end; +end; + +function TdxReportLayoutItem.GetControlItem: TdxReportVisualItem; +const + Indexes: array[Boolean] of Integer = (0, 1); +var + Index: Integer; +begin + if CellCount = 0 then + begin + Index := Indexes[HasCaptionItem]; + if (DataItemCount > Index) and (DataItems[Index].Data <> 0) then + Result := DataItems[Index] + else + Result := nil; + end + else + Result := Cells[0]; +end; + +function TdxReportLayoutItem.GetHasCaptionItem: Boolean; +begin + Result := CaptionItem <> nil; +end; + +function TdxReportLayoutItem.GetHasControlItem: Boolean; +begin + Result := ControlItem <> nil; +end; + +function TdxReportLayoutItem.GetIsControlAccessible: Boolean; +begin + Result := (LayoutItem.Control <> nil) and LayoutItem.Control.Visible; +end; + +{ TdxPSCustomLayoutItemDefinition } + +function TdxPSCustomLayoutItemDefinition.OptionsPagination: TdxLayoutControlReportLinkOptionsPagination; +begin + Result := inherited OptionsPagination as TdxLayoutControlReportLinkOptionsPagination; +end; + +procedure TdxPSCustomLayoutItemDefinition.AdjustBounds(DC: HDC); +begin + ReportItem.AdjustBounds(DC); +end; + +procedure TdxPSCustomLayoutItemDefinition.SaveOriginalItemSize; +begin +end; + +procedure TdxPSCustomLayoutItemDefinition.SetupOriginalControlSize; +begin +end; + +function TdxPSCustomLayoutItemDefinition.GetLayoutItem: TdxCustomLayoutItem; +begin + Result := TdxCustomLayoutItem(Component); +end; + +function TdxPSCustomLayoutItemDefinition.GetReportItem: TdxCustomReportLayoutItem; +begin + Result := inherited ReportItem as TdxCustomReportLayoutItem; +end; + +procedure TdxPSCustomLayoutItemDefinition.SetLayoutItem(Value: TdxCustomLayoutItem); +begin + Component := Value; +end; + +{ TdxPSLayoutGroupDefinition } + +procedure TdxPSLayoutGroupDefinition.AddDelimitersHorz(AList: TList); +begin + inherited; + if OptionsPagination.Groups then AddReportItemToDelimitersHorz(AList); +end; + +procedure TdxPSLayoutGroupDefinition.AddDelimitersVert(AList: TList); +begin + inherited; + if OptionsPagination.Groups then AddReportItemToDelimitersVert(AList); +end; + +function TdxPSLayoutGroupDefinition.GetLayoutItem: TdxLayoutGroup; +begin + Result := inherited LayoutItem as TdxLayoutGroup; +end; + +{ TdxPSLayoutItemDefinition } + +procedure TdxPSLayoutItemDefinition.AddDelimitersHorz(AList: TList); +begin + inherited; + if OptionsPagination.Items then AddReportItemToDelimitersHorz(AList); +end; + +procedure TdxPSLayoutItemDefinition.AddDelimitersVert(AList: TList); +begin + inherited; + if OptionsPagination.Items then AddReportItemToDelimitersVert(AList); +end; + +procedure TdxPSLayoutItemDefinition.SaveOriginalItemSize; +begin + with TdxLayoutItemAccess(LayoutItem) do + if Control <> nil then SaveOriginalControlSize; +end; + +procedure TdxPSLayoutItemDefinition.SetupOriginalControlSize; +begin + with ReportItem do + if HasControlItem then + LayoutItem.OriginalControlSize := Point(ControlItem.Width, ControlItem.Height); +end; + +function TdxPSLayoutItemDefinition.GetLayoutItem: TdxLayoutItem; +begin + Result := inherited LayoutItem as TdxLayoutItem; +end; + +function TdxPSLayoutItemDefinition.GetReportItem: TdxReportLayoutItem; +begin + Result := inherited ReportItem as TdxReportLayoutItem; +end; + +{ TdxPSLayoutControlObjectProducer } + +function TdxPSLayoutControlObjectProducer.ReportLink: TdxLayoutControlReportLink; +begin + Result := inherited ReportLink as TdxLayoutControlReportLink; +end; + +function TdxPSLayoutControlObjectProducer.RootContainer: TdxLayoutControl; +begin + Result := inherited RootContainer as TdxLayoutControl; +end; + +{ TdxPSLayoutLookAndFeelProducer } + +function TdxPSLayoutLookAndFeelProducer.LayoutLookAndFeel: TdxCustomLayoutLookAndFeel; +begin + Result := inherited ProducingObject as TdxCustomLayoutLookAndFeel; +end; + +class function TdxPSLayoutLookAndFeelProducer.LayoutLookAndFeelClass: TdxCustomLayoutLookAndFeelClass; +begin + Result := TdxCustomLayoutLookAndFeel; +end; + +class function TdxPSLayoutLookAndFeelProducer.PairClass: TClass; +begin + Result := LayoutLookAndFeelClass; +end; + +class procedure TdxPSLayoutLookAndFeelProducer.Register; +begin + dxPSLayoutLookAndFeelProducerFactory.Register(Self); +end; + +class procedure TdxPSLayoutLookAndFeelProducer.Unregister; +begin + dxPSLayoutLookAndFeelProducerFactory.Unregister(Self); +end; + +function TdxPSLayoutLookAndFeelProducer.GetContentColor: TColor; +begin + Result := LayoutLookAndFeel.GroupOptions.GetColor; +end; + +function TdxPSLayoutLookAndFeelProducer.GetGroupCaptionColor: TColor; +begin + Result := LayoutLookAndFeel.GroupOptions.GetColor; +end; + +function TdxPSLayoutLookAndFeelProducer.GetIsContentTransparent: Boolean; +begin + Result := ColorToRGB(ContentColor) = ColorToRGB(TransparentColor); +end; + +function TdxPSLayoutLookAndFeelProducer.GetIsGroupCaptionTransparent: Boolean; +begin + Result := ColorToRGB(GroupCaptionColor) = ColorToRGB(TransparentColor); +end; + +function TdxPSLayoutLookAndFeelProducer.GetTransparentColor: TColor; +begin + Result := clDefault; +end; + +procedure TdxPSLayoutLookAndFeelProducer.InitializeReportLookAndFeel(ALookAndFeel: TdxPSReportGroupLookAndFeel); +begin + ALookAndFeel.Color := LayoutLookAndFeel.GroupOptions.GetColor; + ALookAndFeel.Data := LayoutLookAndFeel; + ALookAndFeel.FontIndex := ReportLink.FindFontIndexByCaptionOptions(LayoutLookAndFeel.GroupOptions.CaptionOptions); + ALookAndFeel.CaptionFontIndex := ALookAndFeel.FontIndex; +end; + +class function TdxPSLayoutLookAndFeelProducer.ReportLookAndFeelClass: TdxPSReportGroupLookAndFeelClass; +begin + Result := TdxPSReportGroupLookAndFeel; +end; + +{ TdxPSLayoutStandardLookAndFeelProducer } + +function TdxPSLayoutStandardLookAndFeelProducer.LayoutLookAndFeel: TdxLayoutStandardLookAndFeel; +begin + Result := inherited LayoutLookAndFeel as TdxLayoutStandardLookAndFeel; +end; + +class function TdxPSLayoutStandardLookAndFeelProducer.LayoutLookAndFeelClass: TdxCustomLayoutLookAndFeelClass; +begin + Result := TdxLayoutStandardLookAndFeel; +end; + +function TdxPSLayoutStandardLookAndFeelProducer.GetTransparentColor: TColor; +begin + Result := clBtnFace; +end; + +class function TdxPSLayoutStandardLookAndFeelProducer.ReportLookAndFeelClass: TdxPSReportGroupLookAndFeelClass; +begin + Result := TdxPSReportGroupStandardLookAndFeel; +end; + +{ TdxPSLayoutOfficeLookAndFeelProducer } + +function TdxPSLayoutOfficeLookAndFeelProducer.LayoutLookAndFeel: TdxLayoutOfficeLookAndFeel; +begin + Result := inherited LayoutLookAndFeel as TdxLayoutOfficeLookAndFeel; +end; + +class function TdxPSLayoutOfficeLookAndFeelProducer.LayoutLookAndFeelClass: TdxCustomLayoutLookAndFeelClass; +begin + Result := TdxLayoutOfficeLookAndFeel; +end; + +class function TdxPSLayoutOfficeLookAndFeelProducer.ReportLookAndFeelClass: TdxPSReportGroupLookAndFeelClass; +begin + Result := TdxPSReportGroupOfficeLookAndFeel; +end; + +{ TdxPSLayoutWebLookAndFeelProducer } + +function TdxPSLayoutWebLookAndFeelProducer.LayoutLookAndFeel: TdxLayoutWebLookAndFeel; +begin + Result := inherited LayoutLookAndFeel as TdxLayoutWebLookAndFeel; +end; + +class function TdxPSLayoutWebLookAndFeelProducer.LayoutLookAndFeelClass: TdxCustomLayoutLookAndFeelClass; +begin + Result := TdxLayoutWebLookAndFeel; +end; + +function TdxPSLayoutWebLookAndFeelProducer.GetGroupCaptionColor: TColor; +begin + Result := LayoutLookAndFeel.GroupOptions.CaptionOptions.GetColor; +end; + +function TdxPSLayoutWebLookAndFeelProducer.GetTransparentColor: TColor; +begin + Result := clWindow; +end; + +procedure TdxPSLayoutWebLookAndFeelProducer.InitializeReportLookAndFeel(ALookAndFeel: TdxPSReportGroupLookAndFeel); +begin + inherited; + with TdxPSReportGroupWebLookAndFeel(ALookAndFeel) do + begin + BorderThickness := LayoutLookAndFeel.GroupOptions.FrameWidth; + BorderColor := LayoutLookAndFeel.GroupOptions.GetFrameColor; + CaptionColor := LayoutLookAndFeel.GroupOptions.CaptionOptions.GetColor; + CaptionSeparatorColor := LayoutLookAndFeel.GroupOptions.GetFrameColor; + CaptionSeparatorThickness := LayoutLookAndFeel.GroupOptions.CaptionOptions.SeparatorWidth; + end; +end; + +class function TdxPSLayoutWebLookAndFeelProducer.ReportLookAndFeelClass: TdxPSReportGroupLookAndFeelClass; +begin + Result := TdxPSReportGroupWebLookAndFeel; +end; + +{ TdxPSCustomLayoutItemProducer } + +function TdxPSCustomLayoutItemProducer.Definition: TdxPSCustomLayoutItemDefinition; +begin + Result := inherited Definition as TdxPSCustomLayoutItemDefinition; +end; + +class function TdxPSCustomLayoutItemProducer.DefinitionClass: TdxPSCustomContainerItemDefinitionClass; +begin + Result := TdxPSCustomLayoutItemDefinition; +end; + +function TdxPSCustomLayoutItemProducer.LayoutItem: TdxCustomLayoutItem; +begin + Result := inherited ProducingObject as TdxCustomLayoutItem; +end; + +class function TdxPSCustomLayoutItemProducer.LayoutItemClass: TdxCustomLayoutItemClass; +begin + Result := TdxCustomLayoutItem; +end; + +class function TdxPSCustomLayoutItemProducer.PairClass: TClass; +begin + Result := LayoutItemClass; +end; + +function TdxPSCustomLayoutItemProducer.ProducingObjectFriendlyName: string; +begin + Result := ''; + if not IsDesigning then + Result := LayoutItem.Caption; + if Result = '' then + Result := inherited ProducingObjectFriendlyName; +end; + +procedure TdxPSCustomLayoutItemProducer.Reposition; +begin +end; + +class procedure TdxPSCustomLayoutItemProducer.Register; +begin + inherited; + dxPSLayoutItemProducerFactory.Register(Self); +end; + +class procedure TdxPSCustomLayoutItemProducer.Unregister; +begin + if Self <> TdxPSCustomLayoutItemProducer then + dxPSLayoutItemProducerFactory.Unregister(Self); + inherited; +end; + +function TdxPSCustomLayoutItemProducer.GetContentColor: TColor; +begin + Result := LayoutLookAndFeelProducer.ContentColor; +end; + +function TdxPSCustomLayoutItemProducer.GetIsContentTransparent: Boolean; +begin + Result := LayoutLookAndFeelProducer.IsContentTransparent; +end; + +function TdxPSCustomLayoutItemProducer.GetLayoutLookAndFeel: TdxCustomLayoutLookAndFeel; +begin + Result := TdxCustomLayoutItemAccess(LayoutItem).GetLookAndFeel; +end; + +function TdxPSCustomLayoutItemProducer.GetLayoutLookAndFeelProducer: TdxPSLayoutLookAndFeelProducer; +begin + Result := ReportLink.LayoutLookAndFeelProducers[LayoutLookAndFeel]; +end; + +procedure TdxPSCustomLayoutItemProducer.InitializeReportItem(AnItem: TdxReportCell); +begin + AnItem.BoundsRect := LayoutItemBounds; + AnItem.CellSides := csAll; + AnItem.Color := ContentColor; + AnItem.Data := Integer(LayoutItem); + //AnItem.ExcludeFromClipRgn := True; + AnItem.Transparent := False; + ReportLink.CreateItemDefinition(LayoutItem, AnItem); +end; + +class function TdxPSCustomLayoutItemProducer.ReportItemClass: TdxReportCellClass; +begin + Result := TdxCustomReportLayoutItem; +end; + +function TdxPSCustomLayoutItemProducer.OptionsTransparent: TdxLayoutControlReportLinkOptionsTransparent; +begin + Result := inherited OptionsTransparent as TdxLayoutControlReportLinkOptionsTransparent; +end; + +procedure TdxPSCustomLayoutItemProducer.AdjustBounds; +begin + Definition.AdjustBounds(DC); +end; + +procedure TdxPSCustomLayoutItemProducer.SaveOriginalItemSize; +begin + Definition.SaveOriginalItemSize; +end; + +function TdxPSCustomLayoutItemProducer.GetLayoutItemBounds: TRect; +begin + Result := GetLayoutItemRelativeBounds(LayoutItem); +end; + +{ TdxPSLayoutGroupProducer } + +function TdxPSLayoutGroupProducer.Definition: TdxPSLayoutGroupDefinition; +begin + Result := inherited Definition as TdxPSLayoutGroupDefinition; +end; + +class function TdxPSLayoutGroupProducer.DefinitionClass: TdxPSCustomContainerItemDefinitionClass; +begin + Result := TdxPSLayoutGroupDefinition; +end; + +function TdxPSLayoutGroupProducer.ProducingObjectFriendlyName: string; +begin + Result := ''; + if not IsDesigning then + Result := LayoutItem.Caption; + if Result = '' then + Result := cxGetResourceString(@sdxLayoutGroupDefaultCaption); +end; + +procedure TdxPSLayoutGroupProducer.Reposition; +begin +end; + +function TdxPSLayoutGroupProducer.LayoutItem: TdxLayoutGroup; +begin + Result := inherited LayoutItem as TdxLayoutGroup; +end; + +class function TdxPSLayoutGroupProducer.LayoutItemClass: TdxCustomLayoutItemClass; +begin + Result := TdxLayoutGroup; +end; + +function TdxPSLayoutGroupProducer.GetGroupCaptionContentColor: TColor; +begin + Result := LayoutLookAndFeelProducer.GroupCaptionColor; +end; + +function TdxPSLayoutGroupProducer.GetIsGroupCaptionTransparent: Boolean; +begin + Result := LayoutLookAndFeelProducer.IsGroupCaptionTransparent; +end; + +procedure TdxPSLayoutGroupProducer.InitializeReportItem(AnItem: TdxReportCell); +begin + inherited; + with TdxReportGroup(AnItem) do + begin + CaptionAlignment := LayoutGroupCaptionAlignHorzMap[LayoutItem.CaptionOptions.AlignHorz]; + CaptionText := LayoutItem.Caption; + CaptionTransparent := OptionsTransparent.Groups; + //HidePrefix := True; + LookAndFeel := ReportLink.FindReportGroupLookAndFeel(LayoutLookAndFeel); + ShowCaption := LayoutItem.ShowCaption; + Transparent := OptionsTransparent.Groups; + + CellSides := []; + if LayoutItem.ShowBorder then + CellSides := LookAndFeel.DefaultBorderSides; + + CalculateCaptionTextWidth(DC); + end; +end; + +class function TdxPSLayoutGroupProducer.ReportItemClass: TdxReportCellClass; +begin + Result := TdxReportLayoutGroup; +end; + +{ TdxPSLayoutItemProducer } + +function TdxPSLayoutItemProducer.Definition: TdxPSLayoutItemDefinition; +begin + Result := inherited Definition as TdxPSLayoutItemDefinition; +end; + +class function TdxPSLayoutItemProducer.DefinitionClass: TdxPSCustomContainerItemDefinitionClass; +begin + Result := TdxPSLayoutItemDefinition; +end; + +function TdxPSLayoutItemProducer.LayoutItem: TdxLayoutItem; +begin + Result := inherited LayoutItem as TdxLayoutItem; +end; + +class function TdxPSLayoutItemProducer.LayoutItemClass: TdxCustomLayoutItemClass; +begin + Result := TdxLayoutItem; +end; + +function TdxPSLayoutItemProducer.ProducingObjectFriendlyName: string; +begin + Result := ''; + if not IsDesigning then + Result := LayoutItem.Caption; + if Result = '' then + Result := cxGetResourceString(@sdxLayoutItemDefaultCaption); + Result := dxPSUtl.DropColon(Result); +end; + +procedure TdxPSLayoutItemProducer.Reposition; +begin + if HasControl then + begin + ReportLink.Producers[Control].Reposition; + Definition.SetupOriginalControlSize; + end; +end; + +function TdxPSLayoutItemProducer.GetContentColor: TColor; +begin + Result := ReportLink.LayoutLookAndFeelProducers[TdxCustomLayoutItemAccess(LayoutItem.Parent).GetLookAndFeel].ContentColor; +end; + +procedure TdxPSLayoutItemProducer.InitializeReportItem(AnItem: TdxReportCell); +//var +// AControl: TControl; +// ALayoutItem: TdxCustomLayoutItem; +begin + inherited; + AnItem.CellSides := []; + AnItem.Transparent := OptionsTransparent.Items; +// ALayoutItem := TdxLayoutControlReportLink(ReportLink).CurrentLayoutItem; + +// AControl := TdxReportLayoutItem(AnItem).Control; + TdxReportLayoutItem(AnItem).CreateNestedItems(ReportLink); +end; + +class function TdxPSLayoutItemProducer.ReportItemClass: TdxReportCellClass; +begin + Result := TdxReportLayoutItem; +end; + +function TdxPSLayoutItemProducer.GetControl: TControl; +begin + Result := LayoutItem.Control; +end; + +function TdxPSLayoutItemProducer.GetHasControl: Boolean; +begin + Result := (Control <> nil) and Control.Visible; +end; + +{ TdxPSCustomLayoutObjectProducerCache } + +function TdxPSCustomLayoutObjectProducerCache.ReportLink: TdxLayoutControlReportLink; +begin + Result := inherited ReportLink as TdxLayoutControlReportLink; +end; + +{ TdxPSLayoutItemProducerCache } + +function TdxPSLayoutItemProducerCache.GetItem(Index: Integer): TdxPSCustomLayoutItemProducer; +begin + Result := TdxPSCustomLayoutItemProducer(inherited Items[Index]); +end; + +function TdxPSLayoutItemProducerCache.GetProducer(AProducerClass: TdxPSCustomLayoutItemProducerClass; + ALayoutItem: TdxCustomLayoutItem): TdxPSCustomLayoutItemProducer; +var + Index: Integer; +begin + Index := IndexOfByClass(AProducerClass); + if Index = -1 then + Index := Add(AProducerClass.Create(ReportLink, ALayoutItem)); + Result := Items[Index]; + Result.Initialize(ALayoutItem); +end; + +{ TdxPSLayoutLookAndFeelProducerCache } + +function TdxPSLayoutLookAndFeelProducerCache.GetItem(Index: Integer): TdxPSLayoutLookAndFeelProducer; +begin + Result := TdxPSLayoutLookAndFeelProducer(inherited Items[Index]); +end; + +function TdxPSLayoutLookAndFeelProducerCache.GetProducer(AProducerClass: TdxPSLayoutLookAndFeelProducerClass; + ALayoutLookAndFeel: TdxCustomLayoutLookAndFeel): TdxPSLayoutLookAndFeelProducer; +var + Index: Integer; +begin + Index := IndexOfByClass(AProducerClass); + if Index = -1 then + Index := Add(AProducerClass.Create(ReportLink, ALayoutLookAndFeel)); + Result := Items[Index]; + Result.Initialize(ALayoutLookAndFeel); +end; + +{ TdxPSNativeLayoutControlProducer } + +class function TdxPSNativeLayoutControlProducer.HasNativeSupportForBorders: Boolean; +begin + Result := True; +end; + +function TdxPSNativeLayoutControlProducer.ObjectExpandHeight: Boolean; +begin + Result := True; +end; + +function TdxPSNativeLayoutControlProducer.ObjectExpandWidth: Boolean; +begin + Result := True; +end; + +function TdxPSNativeLayoutControlProducer.Control: TdxCustomLayoutControl; +begin + Result := inherited Control as TdxCustomLayoutControl; +end; + +class function TdxPSNativeLayoutControlProducer.ControlClass: TControlClass; +begin + Result := TdxCustomLayoutControl; +end; + +{ TdxPSLayoutControlProducer } + +class function TdxPSLayoutControlProducer.CanHasAvailableChildren: Boolean; +begin + Result := False; +end; + +class function TdxPSLayoutControlProducer.Reenterable: Boolean; +begin + Result := False; +end; + +function TdxPSLayoutControlProducer.Control: TdxLayoutControl; +begin + Result := inherited Control as TdxLayoutControl; +end; + +class function TdxPSLayoutControlProducer.ControlClass: TControlClass; +begin + Result := TdxCustomLayoutControl; +end; + +class function TdxPSLayoutControlProducer.HasNativeSupportForBorders: Boolean; +begin + Result := False; +end; + +function TdxPSLayoutControlProducer.ObjectExpandHeight: Boolean; +begin + Result := True; +end; + +function TdxPSLayoutControlProducer.ObjectExpandWidth: Boolean; +begin + Result := True; +end; + +function TdxPSLayoutControlProducer.ReportLink: TdxLayoutControlReportLink; +begin + Result := inherited ReportLink as TdxLayoutControlReportLink; +end; + +procedure TdxPSLayoutControlProducer.Reposition; + + procedure CalculateViewInfo; + begin + Control.ViewInfo.Calculate; + end; + + procedure SetupOriginalControlSize(AnItems: TList); + var + I, Index: Integer; + Item: TdxCustomLayoutItem; + begin + for I := 0 to AnItems.Count - 1 do + begin + Item := AnItems[I]; + if ReportLink.IsComponentProcessed(Item) then + if (Item is TdxLayoutGroup) or ReportLink.FindDefinition(TdxLayoutItem(Item).Control, Index) then + Producers[Item].Reposition + else + else + Item.Visible := False; + end; + CalculateViewInfo; + end; + + procedure UpdateItemsBounds(AnItems: TList); + var + I, Index: Integer; + Item: TdxCustomLayoutItem; + begin + for I := 0 to AnItems.Count - 1 do + begin + Item := AnItems[I]; + if ReportLink.IsComponentProcessed(Item) and + ((Item is TdxLayoutGroup) or ReportLink.FindDefinition(TdxLayoutItem(Item).Control, Index)) then + Producers[Item].AdjustBounds; + end; + end; + + procedure RestoreOriginalControlSize(AnItems: TList); + var + I: Integer; + Item: TdxCustomLayoutItem; + begin + for I := 0 to AnItems.Count - 1 do + begin + Item := AnItems[I]; + Item.Visible := True; + if ReportLink.IsComponentProcessed(Item) then + Producers[Item].SaveOriginalItemSize; + end; + CalculateViewInfo; + end; + +var + Items: TList; + Cell: TdxReportCell; +begin + Control.BeginUpdate; + try + TcxControlAccess(Control).FBounds := AvailableBounds; + Items := TList.Create; + try + GetLayoutItemList(Items); + SetupOriginalControlSize(Items); + try + UpdateItemsBounds(Items); + finally + RestoreOriginalControlSize(Items); + end; + finally + Items.Free; + end; + finally + TdxLayoutControlViewInfoAccess(Control.ViewInfo).DestroyViewInfos; + TcxControlAccess(Control).FBounds := dxPSGlbl.NullRect; + Control.EndUpdate; + end; + + with TdxReportCell(Definition.SizeChangeReportItem) do + begin + Cell := Cells[0].Cells[0]; + + Cells[0].Height := Cell.Height; + Cells[0].Width := Cell.Width; + + Height := Cell.Height; + Width := Cell.Width; + end; +end; + +procedure TdxPSLayoutControlProducer.CreateLayoutItems(AnItem: TdxReportVisualItem); + + function CreateReportItem(AParent: TdxReportCell; ALayoutItem: TdxCustomLayoutItem): TdxReportCell; + begin + ReportLink.CurrentLayoutItem := ALayoutItem; + try + with Producers[ALayoutItem] do + begin + Result := ReportItemClass.Create(AParent); + InitializeReportItem(Result); + end; + ReportLinkInitializeItem(Result); + finally + ReportLink.CurrentLayoutItem := nil; + end; + end; + + procedure ProduceItem(AParent: TdxReportCell; ALayoutItem: TdxCustomLayoutItem); + var + I: Integer; + LayoutItem: TdxCustomLayoutItem; + begin + AParent := CreateReportItem(AParent, ALayoutItem); + if ALayoutItem is TdxLayoutGroup then + with TdxLayoutGroup(ALayoutItem) do + for I := 0 to VisibleCount - 1 do + begin + LayoutItem := VisibleItems[I]; + if ReportLink.DoIsComponentProcessed(LayoutItem) then + ProduceItem(AParent, LayoutItem); + end; + end; + +begin + ProduceItem(TdxReportCell(AnItem), Control.Items); // Root is always processed +end; + +procedure TdxPSLayoutControlProducer.GetLayoutItemList(AnItems: TList); +begin + ReportLink.GetLayoutItemList(Control, AnItems); +end; + +function TdxPSLayoutControlProducer.HostClass: TdxReportCellClass; +begin + Result := TdxReportLayoutControlHost; +end; + +procedure TdxPSLayoutControlProducer.InitializeHost(ACell: TdxReportCell); +begin + inherited; + ACell.Height := Control.ViewInfo.ContentHeight; + ACell.Width := Control.ViewInfo.ContentWidth; +end; + +procedure TdxPSLayoutControlProducer.InitializeItem(AnItem: TdxReportVisualItem); +begin + inherited; + AnItem.BorderClass := TdxPSCellNullBorder; + AnItem.Height := Control.ViewInfo.ContentHeight; + AnItem.Width := Control.ViewInfo.ContentWidth; + AnItem.CellSides := []; + AnItem.Transparent := True; + + CreateLayoutItems(AnItem); +end; + +function TdxPSLayoutControlProducer.ItemClass: TdxReportVisualItemClass; +begin + Result := TdxReportCell; +end; + +procedure TdxPSLayoutControlProducer.ReportLinkInitializeItem(AnItem: TdxReportVisualItem); +begin + ReportLink.DoInitializeItem(AnItem); + ReportLink.DoInitializeItemOptionsPlace(AnItem); +end; + +function TdxPSLayoutControlProducer.GetAvailableBounds: TRect; +begin + Result := ReportLink.AvailableBounds; +end; + +function TdxPSLayoutControlProducer.GetProducer(LayoutItem: TdxCustomLayoutItem): TdxPSCustomLayoutItemProducer; +begin + Result := ReportLink.LayoutItemProducers[LayoutItem]; +end; + +{ TdxLayoutControlReportLinkOptionsPagination } + +procedure TdxLayoutControlReportLinkOptionsPagination.Assign(Source: TPersistent); +begin + inherited; + if Source is TdxLayoutControlReportLinkOptionsPagination then + with TdxLayoutControlReportLinkOptionsPagination(Source) do + begin + Self.Groups := Groups; + Self.Items := Items; + end; +end; + +procedure TdxLayoutControlReportLinkOptionsPagination.RestoreDefaults; +begin + inherited; + Controls := False; + Groups := True; + Items := True; +end; + +procedure TdxLayoutControlReportLinkOptionsPagination.SetGroups(Value: Boolean); +begin + if FGroups <> Value then + begin + FGroups := Value; + Changed; + end; +end; + +procedure TdxLayoutControlReportLinkOptionsPagination.SetItems(Value: Boolean); +begin + if FItems <> Value then + begin + FItems := Value; + Changed; + end; +end; + +{ TdxLayoutControlReportLinkOptionsSize } + +procedure TdxLayoutControlReportLinkOptionsSize.Assign(Source: TPersistent); +begin + if Source is TdxLayoutControlReportLinkOptionsSize then + AutoWidth := TdxLayoutControlReportLinkOptionsSize(Source).AutoWidth; + inherited; +end; + +procedure TdxLayoutControlReportLinkOptionsSize.RestoreDefaults; +begin + inherited; + AutoWidth := True; +end; + +procedure TdxLayoutControlReportLinkOptionsSize.SetAutoWidth(Value: Boolean); +begin + if FAutoWidth <> Value then + begin + FAutoWidth := Value; + Changed; + end; +end; + +{ TdxLayoutControlReportLinkOptionsTransparent } + +procedure TdxLayoutControlReportLinkOptionsTransparent.Assign(Source: TPersistent); +begin + inherited; + if Source is TdxLayoutControlReportLinkOptionsTransparent then + with TdxLayoutControlReportLinkOptionsTransparent(Source) do + begin + Self.Groups := Groups; + Self.Items := Items; + end; +end; + +procedure TdxLayoutControlReportLinkOptionsTransparent.RestoreDefaults; +begin + Groups := True; + Items := True; + inherited; +end; + +procedure TdxLayoutControlReportLinkOptionsTransparent.SetGroups(Value: Boolean); +begin + if FGroups <> Value then + begin + FGroups := Value; + Changed; + end; +end; + +procedure TdxLayoutControlReportLinkOptionsTransparent.SetItems(Value: Boolean); +begin + if FItems <> Value then + begin + FItems := Value; + Changed; + end; +end; + +{ TdxLayoutControlReportLink } + +constructor TdxLayoutControlReportLink.Create(AOwner: TComponent); +begin + inherited; + FCachedFonts := TList.Create; + FCachedBounds := TList.Create; + FLayoutItemProducerCache := TdxPSLayoutItemProducerCache.Create(Self); + FLayoutLookAndFeelProducerCache := TdxPSLayoutLookAndFeelProducerCache.Create(Self); +end; + +destructor TdxLayoutControlReportLink.Destroy; +begin + FreeAndNil(FLayoutLookAndFeelProducerCache); + FreeAndNil(FLayoutItemProducerCache); + FreeAndNilCachedFonts; + FreeAndNilCachedBounds; + inherited; +end; + +class function TdxLayoutControlReportLink.Aggregable: Boolean; +begin + Result := True; +end; + +function TdxLayoutControlReportLink.GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; +begin + Result := ([ucMarginLeft, ucMarginRight] * AUpdateCodes <> []) and OptionsSize.AutoWidth; +end; + +procedure TdxLayoutControlReportLink.InternalRestoreDefaults; +begin + inherited; + OptionsSize.RestoreDefaults; +end; + +procedure TdxLayoutControlReportLink.CacheControlsBounds; + + procedure EnumItems(AGroup: TdxLayoutGroupViewInfo); + var + I: Integer; + ControlViewInfo: TdxLayoutItemControlViewInfo; + begin + for I := 0 to AGroup.ItemViewInfoCount - 1 do + if AGroup.ItemViewInfos[I] is TdxLayoutItemViewInfo then + begin + ControlViewInfo := TdxLayoutItemViewInfo(AGroup.ItemViewInfos[I]).ControlViewInfo; + if ControlViewInfo <> nil then + AddBoundsToCache(ControlViewInfo.Control, ControlViewInfo.ControlBounds); + end + else + if AGroup.ItemViewInfos[I] is TdxLayoutGroupViewInfo then + EnumItems(TdxLayoutGroupViewInfo(AGroup.ItemViewInfos[I])) + end; + +begin + try + TcxControlAccess(LayoutControl).FBounds := AvailableBounds; + LayoutControl.ViewInfo.Calculate; + EnumItems(LayoutControl.ViewInfo.ItemsViewInfo); + finally + TcxControlAccess(LayoutControl).FBounds := NullRect; + LayoutControl.ViewInfo.Calculate; + end; +end; + +procedure TdxLayoutControlReportLink.ConstructReport(AReportCells: TdxReportCells); +begin + inherited ConstructReport(AReportCells); + PostCheckEmbeddedControls; +end; + +procedure TdxLayoutControlReportLink.PostCheckEmbeddedControls; +var + I: Integer; + LayoutItem: TdxLayoutItem; + ReportItem: TdxReportCell; + ADataItem: TdxReportVisualItem; + BottomPosition: Integer; + NeedAddBorder: Boolean; + + procedure DoCheckBounds(ACell: TdxReportCell; ATopOffset: Integer); + var + I: Integer; + begin + for I := 0 to ACell.CellCount - 1 do + DoCheckBounds(ACell.Cells[I], ATopOffset + ACell.Cells[I].Top); + for I := 0 to ACell.DataItemCount - 1 do + begin + if ADataItem = nil then + ADataItem := ACell.DataItems[I]; + NeedAddBorder := NeedAddBorder or + (ACell.DataItems[I].BoundsRect.Bottom + ATopOffset > BottomPosition); + end; + end; + +begin + for I := 0 to CachedBoundsCount - 1 do + begin + ADataItem := nil; + NeedAddBorder := False; + if not CachedBoundsItem[I].EmbeddedLink then Continue; + LayoutItem := LayoutControl.FindItem(TControl(CachedBoundsItem[I].Component)); + Assert(LayoutItem <> nil); + ReportItem := FindReportItemByLayoutItem(LayoutItem); + Assert(ReportItem <> nil); + BottomPosition := ReportItem.Cells[0].Height; + DoCheckBounds(ReportItem.Cells[0], 0); + if (ADataItem <> nil) and NeedAddBorder then + with TdxReportCellString(ReportItem.AddDataItem(TdxReportCellString)) do + begin + BoundsRect := ReportItem.Cells[0].BoundsRect; + Width := Width - 1; + CellSides := [csBottom]; + BorderClass := ADataItem.BorderClass; + BorderColor := ADataItem.BorderColor; + end; + end; +end; + +procedure TdxLayoutControlReportLink.PrepareConstruct; +begin + ClearCachedBounds; + LayoutControl.ViewInfo.Calculate; + CacheControlsBounds; + inherited; + ClearCachedFonts; + PrepareLookAndFeels; +end; + +procedure TdxLayoutControlReportLink.PrepareLookAndFeels; + + procedure CreateReportLookAndFeel(ALayoutLookAndFeel: TdxCustomLayoutLookAndFeel); + var + ReportLookAndFeel: TdxPSReportGroupLookAndFeel; + begin + if ALayoutLookAndFeel = nil then Exit; + + AddCaptionOptionsFontToCache(ALayoutLookAndFeel.GroupOptions.CaptionOptions); + AddCaptionOptionsFontToCache(ALayoutLookAndFeel.ItemOptions.CaptionOptions); + + with LayoutLookAndFeelProducers[ALayoutLookAndFeel] do + begin + ReportLookAndFeel := CreateGroupLookAndFeel(ReportLookAndFeelClass, False); + InitializeReportLookAndFeel(ReportLookAndFeel); + ReportLookAndFeel.Prepare(ScreenDC); + end; + end; + + procedure CreateReportLookAndFeels(ALookAndFeels: TList); + var + I: Integer; + begin + for I := 0 to ALookAndFeels.Count - 1 do + CreateReportLookAndFeel(TdxCustomLayoutLookAndFeel(ALookAndFeels[I])); + end; + + procedure EnumerateLayoutGroup(AGroup: TdxLayoutGroup; ALookAndFeels: TList); + var + I: Integer; + Child: TdxCustomLayoutItem; + LookAndFeel: TdxCustomLayoutLookAndFeel; + begin + for I := 0 to AGroup.Count - 1 do + begin + Child := AGroup.Items[I]; + if Child.Visible then + begin + LookAndFeel := Child.LookAndFeel; + if ALookAndFeels.IndexOf(LookAndFeel) = -1 then + ALookAndFeels.Add(LookAndFeel); + if Child is TdxLayoutGroup then + EnumerateLayoutGroup(TdxLayoutGroup(Child), ALookAndFeels); + end; + end; + end; + +var + LookAndFeels: TList; +begin + LookAndFeels := TList.Create; + try + LookAndFeels.Add(LayoutControl.LookAndFeel); + LookAndFeels.Add(LayoutControl.Items.LookAndFeel); + EnumerateLayoutGroup(LayoutControl.Items, LookAndFeels); + + CreateReportLookAndFeels(LookAndFeels); + finally + LookAndFeels.Free; + end; +end; + +procedure TdxLayoutControlReportLink.RepositionControls; +begin + Producers[LayoutControl].Reposition; +end; + +procedure TdxLayoutControlReportLink.AddHiddenItem(ATreeView: TTreeView; + AParent: TTreeNode; AnItem: TdxCustomLayoutItem); +var + Index, I: Integer; +begin + AParent := AddNode(ATreeView, AParent, AnItem, not FindHiddenComponent(AnItem, Index)); + if AnItem is TdxLayoutGroup then + for I := 0 to TdxLayoutGroup(AnItem).VisibleCount - 1 do + AddHiddenItem(ATreeView, AParent, TdxLayoutGroup(AnItem).VisibleItems[I]); +end; + +procedure TdxLayoutControlReportLink.AddItem(ATreeView: TTreeView; + AParent: TTreeNode; AnItem: TdxCustomLayoutItem); +var + Index, I: Integer; +begin + if not FindHiddenComponent(AnItem, Index) then + begin + AParent := AddNode(ATreeView, AParent, AnItem, not FindExcludedComponent(AnItem, Index)); + if AnItem is TdxLayoutGroup then + for I := 0 to TdxLayoutGroup(AnItem).VisibleCount - 1 do + AddItem(ATreeView, AParent, TdxLayoutGroup(AnItem).VisibleItems[I]); + end; +end; + +function TdxLayoutControlReportLink.IsComponentEditable(AComponent: TComponent): Boolean; +begin + Result := inherited IsComponentEditable(AComponent) and (AComponent <> LayoutControl.Items); +end; + +procedure TdxLayoutControlReportLink.LoadControlsTree(ATreeView: TTreeView); +begin + ATreeView.Items.Clear; + if Container <> nil then + AddItem(ATreeView, AddNode(ATreeView, nil, Container, True), RootLayoutGroup); +end; + +procedure TdxLayoutControlReportLink.LoadHiddenControlsTree(ATreeView: TTreeView); +begin + ATreeView.Items.Clear; + if Container <> nil then + AddHiddenItem(ATreeView, AddNode(ATreeView, nil, Container, True), RootLayoutGroup); +end; + +function TdxLayoutControlReportLink.AddBoundsToCache( + AComponent: TComponent; const ABounds: TRect): Integer; +var + AItem: TdxLCBoundsCacheItem; +begin + AItem := TdxLCBoundsCacheItem.Create; + AItem.Component := AComponent; + AItem.Bounds := ABounds; + Result := CachedBounds.Add(AItem); +end; + +function TdxLayoutControlReportLink.AddCaptionOptionsFontToCache(ACaptionOptions: TdxLayoutLookAndFeelCaptionOptions): Integer; +var + Item: PdxPSLayoutCacheFontItem; +begin + New(Item); + Item^.CaptionOptions := ACaptionOptions; + Item^.FontIndex := GetPreparedFontIndex(ACaptionOptions); + CachedFonts.Add(Item); + + Result := Item^.FontIndex; +end; + +procedure TdxLayoutControlReportLink.ClearCachedBounds; +var + I: Integer; +begin + for I := 0 to CachedBoundsCount - 1 do + CachedBoundsItem[I].Free; + CachedBounds.Clear; +end; + +procedure TdxLayoutControlReportLink.ClearCachedFonts; +var + I: Integer; +begin + for I := 0 to CachedFontItemCount - 1 do + Dispose(PdxPSLayoutCacheFontItem(CachedFontItems[I])); + CachedFonts.Clear; +end; + +function TdxLayoutControlReportLink.FindBoundsByComponent( + AComponent: TComponent; var ABounds: TRect; ASetEmbedded: Boolean): Boolean; +var + I: Integer; +begin + Result := AComponent <> nil; + if not Result then Exit; + for I := 0 to CachedBoundsCount - 1 do + if AComponent = CachedBoundsItem[I].Component then + begin + ABounds := CachedBoundsItem[I].Bounds; + CachedBoundsItem[I].EmbeddedLink := ASetEmbedded; + Exit; + end; + Result := False; +end; + +function TdxLayoutControlReportLink.FindFontIndexByCaptionOptions(ACaptionOptions: TdxLayoutLookAndFeelCaptionOptions): Integer; +var + I: Integer; + Item: PdxPSLayoutCacheFontItem; +begin + for I := 0 to CachedFontItemCount - 1 do + begin + Item := CachedFontItems[I]; + if Item^.CaptionOptions = ACaptionOptions then + begin + Result := Item^.FontIndex; + Exit; + end; + end; + Result := 0; +end; + +procedure TdxLayoutControlReportLink.FreeAndNilCachedBounds; +begin + ClearCachedBounds; + FreeAndNil(FCachedBounds) +end; + +procedure TdxLayoutControlReportLink.FreeAndNilCachedFonts; +begin + ClearCachedFonts; + FreeAndNil(FCachedFonts); +end; + +procedure TdxLayoutControlReportLink.CreateOptions; +begin + inherited; + FOptionsSize := GetOptionsSizeClass.Create(Self); +end; + +procedure TdxLayoutControlReportLink.DestroyOptions; +begin + FreeAndNil(FOptionsSize); + inherited; +end; + +function TdxLayoutControlReportLink.GetOptionsPaginationClass: TdxCustomContainerReportLinkOptionsPaginationClass; +begin + Result := TdxLayoutControlReportLinkOptionsPagination; +end; + +function TdxLayoutControlReportLink.GetOptionsSizeClass: TdxLayoutControlReportLinkOptionsSizeClass; +begin + Result := TdxLayoutControlReportLinkOptionsSize; +end; + +function TdxLayoutControlReportLink.GetOptionsTransparentClass: TdxCustomContainerReportLinkOptionsTransparentClass; +begin + Result := TdxLayoutControlReportLinkOptionsTransparent; +end; + +function TdxLayoutControlReportLink.FindReportGroupLookAndFeel(ALayoutLookAndFeel: TdxCustomLayoutLookAndFeel): TdxPSReportGroupLookAndFeel; +begin + Result := ReportCells.FindGroupLookAndFeelByData(ALayoutLookAndFeel) +end; + +function TdxLayoutControlReportLink.FindReportItemByLayoutItem(ALayoutItem: TdxCustomLayoutItem): TdxReportCell; + + function SearchCell(ACell: TdxReportCell): TdxReportCell; + var + I: Integer; + begin + Result := ACell; + if TObject(Result.Data) = ALayoutItem then Exit; + + for I := 0 to ACell.CellCount - 1 do + begin + Result := SearchCell(ACell[I]); + if Result <> nil then Exit; + end; + Result := nil; + end; + +begin + Result := SearchCell(RootCell); +end; + +procedure TdxLayoutControlReportLink.GetLayoutItemList(AControl: TdxLayoutControl; + AnItems: TList); + + procedure EnumerateLayoutGroup(AGroup: TdxLayoutGroup); + var + I: Integer; + Item: TdxCustomLayoutItem; + begin + for I := 0 to AGroup.VisibleCount - 1 do + begin + Item := AGroup.VisibleItems[I]; +// if IsComponentProcessed(Item) then + begin + AnItems.Add(Item); + if Item is TdxLayoutGroup then + EnumerateLayoutGroup(TdxLayoutGroup(Item)); + end; + end; + end; + +begin + if IsComponentProcessed(AControl.Items) then + begin + AnItems.Add(AControl.Items); + EnumerateLayoutGroup(AControl.Items); + end; +end; + +function TdxLayoutControlReportLink.GetPreparedFontIndex(ACaptionOptions: TdxLayoutLookAndFeelCaptionOptions): Integer; +begin + with PreparationFont do + begin + Assign(ACaptionOptions.GetFont(LayoutControl)); + Color := ACaptionOptions.GetTextColor; + if ACaptionOptions.HotTrack and (htsUnderlineCold in ACaptionOptions.HotTrackStyles) then + Style := Style + [fsUnderline]; + if not dxIsTrueTypeFont(PreparationFont) then + Name := Font.Name; + end; + Result := AddFontToPool(PreparationFont); +end; + +// IdxReportLinkController + +function TdxLayoutControlReportLink.GetControlSiteBounds(AControl: TControl): TRect; +var + LayoutItem: TdxLayoutItem; + ReportItem: TdxReportCell; +begin + if not FindBoundsByComponent(AControl, Result, True) then + begin + LayoutItem := LayoutControl.FindItem(AControl); + Assert(LayoutItem <> nil); + ReportItem := FindReportItemByLayoutItem(LayoutItem); + Assert(ReportItem <> nil); + Result := (ReportItem as TdxReportLayoutItem).ControlBounds; + end; +end; + +function TdxLayoutControlReportLink.GetAvailableBounds: TRect; +begin + Result := LayoutControl.ClientBounds; + if OptionsSize.AutoWidth then + with RealPrinterPage.PaintRectPixels do + begin + Result.Left := 0; + Result.Right := Right - Left - 1; + end; +end; + +function TdxLayoutControlReportLink.GetCachedBoundsCount: Integer; +begin + Result := CachedBounds.Count; +end; + +function TdxLayoutControlReportLink.GetCachedBoundsItem(Index: Integer): TdxLCBoundsCacheItem; +begin + Result := TdxLCBoundsCacheItem(CachedBounds[Index]); +end; + +function TdxLayoutControlReportLink.GetCachedFontItem(Index: Integer): PdxPSLayoutCacheFontItem; +begin + Result := FCachedFonts[Index]; +end; + +function TdxLayoutControlReportLink.GetCachedFontItemCount: Integer; +begin + Result := FCachedFonts.Count; +end; + +function TdxLayoutControlReportLink.GetCurrentHost: TdxReportCell; +begin + Result := FindReportItemByLayoutItem(CurrentLayoutItem); +end; + +function TdxLayoutControlReportLink.GetLayoutControl: TdxLayoutControl; +begin + Result := TdxLayoutControl(Container); +end; + +function TdxLayoutControlReportLink.GetLayoutItemProducer(LayoutItem: TdxCustomLayoutItem): TdxPSCustomLayoutItemProducer; +begin + Result := LayoutItemProducerCache[dxPSLayoutItemProducerFactory[LayoutItem], LayoutItem]; +end; + +function TdxLayoutControlReportLink.GetLayoutLookAndFeelProducer(LayoutLookAndFeel: TdxCustomLayoutLookAndFeel): TdxPSLayoutLookAndFeelProducer; +begin + Result := LayoutLookAndFeelProducerCache[dxPSLayoutLookAndFeelProducerFactory[LayoutLookAndFeel], LayoutLookAndFeel]; +end; + +function TdxLayoutControlReportLink.GetOptionsPagination: TdxLayoutControlReportLinkOptionsPagination; +begin + Result := inherited OptionsPagination as TdxLayoutControlReportLinkOptionsPagination; +end; + +function TdxLayoutControlReportLink.GetOptionsTransparent: TdxLayoutControlReportLinkOptionsTransparent; +begin + Result := inherited OptionsTransparent as TdxLayoutControlReportLinkOptionsTransparent; +end; + +function TdxLayoutControlReportLink.GetRootLayoutGroup: TdxLayoutGroup; +begin + Result := LayoutControl.Items; +end; + +procedure TdxLayoutControlReportLink.SetOptionsPagination(Value: TdxLayoutControlReportLinkOptionsPagination); +begin + inherited OptionsPagination := Value; +end; + +procedure TdxLayoutControlReportLink.SetOptionsSize(Value: TdxLayoutControlReportLinkOptionsSize); +begin + OptionsSize.Assign(Value); +end; + +procedure TdxLayoutControlReportLink.SetOptionsTransparent(Value: TdxLayoutControlReportLinkOptionsTransparent); +begin + inherited OptionsTransparent := Value; +end; + +{ TdxPSLayoutControlDesignWindow } + +procedure TdxPSLayoutControlDesignWindow.DoInitialize; +begin + inherited; + + with LayoutReportLink.OptionsPagination do + begin + chbxPaginateByGroups.Checked := Groups; + chbxPaginateByItems.Checked := Items; + end; + chbxPaginateByGroups.Visible := True; + chbxPaginateByItems.Visible := True; + + with LayoutReportLink.OptionsTransparent do + begin + chbxTransparentGroups.Checked := Groups; + chbxTransparentItems.Checked := Items; + end; + chbxTransparentGroups.Visible := True; + chbxTransparentItems.Visible := True; + + chbxAutoWidth.Checked := LayoutReportLink.OptionsSize.AutoWidth; + chbxAutoWidth.Visible := True; + lblSize.Visible := True; + bvlSize.Visible := True; + imgSize.Visible := True; +end; + +procedure TdxPSLayoutControlDesignWindow.SetOptionsPaginationByIndex(AnIndex: Integer; + AValue: Boolean); +begin + if LockControlsUpdate then Exit; + + if AnIndex > 1 then + begin + case AnIndex of + 2: LayoutReportLink.OptionsPagination.Groups := AValue; + 3: LayoutReportLink.OptionsPagination.Items := AValue; + end; + Modified := True; + end + else + inherited; +end; + +procedure TdxPSLayoutControlDesignWindow.SetOptionsSizeByIndex(AnIndex: Integer; + AValue: Boolean); +begin + if LockControlsUpdate then Exit; + + inherited; + if AnIndex = 0 then + begin + LayoutReportLink.OptionsSize.AutoWidth := AValue; + Modified := True; + end; +end; + +procedure TdxPSLayoutControlDesignWindow.SetOptionsTransparentByIndex(AnIndex: Integer; + AValue: Boolean); +begin + if LockControlsUpdate then Exit; + + if AnIndex > 3 then + begin + case AnIndex of + 4: LayoutReportLink.OptionsTransparent.Groups := AValue; + 5: LayoutReportLink.OptionsTransparent.Items := AValue; + end; + Modified := True; + end + else + inherited; +end; + +procedure TdxPSLayoutControlDesignWindow.InitializeControlsTree; +var + Root: TTreeNode; +begin + inherited; + Root := TreeView_GetRoot(tvControls); + if (Root <> nil) and (Root.Count <> 0) then + Root[0].Expand(False); +end; + +procedure TdxPSLayoutControlDesignWindow.InitializeHiddenControlsTree; +var + Root: TTreeNode; +begin + inherited; + Root := TreeView_GetRoot(tvHiddenControls); + if (Root <> nil) and (Root.Count <> 0) then + Root[0].Expand(False); +end; + +function TdxPSLayoutControlDesignWindow.IsBoldNode(ANode: TTreeNode): Boolean; +begin + Result := inherited IsBoldNode(ANode) or (TreeView_GetNodeObject(ANode).Component is TdxLayoutGroup); +end; + +function TdxPSLayoutControlDesignWindow.GetLayoutReportLink: TdxLayoutControlReportLink; +begin + Result := TdxLayoutControlReportLink(ReportLink); +end; + +procedure RegisterAssistants; +begin + TdxPSLayoutLookAndFeelProducer.Register; + TdxPSLayoutStandardLookAndFeelProducer.Register; + TdxPSLayoutOfficeLookAndFeelProducer.Register; + TdxPSLayoutWebLookAndFeelProducer.Register; + + TdxPSCustomLayoutItemProducer.Register; + TdxPSLayoutGroupProducer.Register; + TdxPSLayoutItemProducer.Register; + + TdxPSLayoutControlProducer.Register; + + TdxPSNativeLayoutControlProducer.Register; +end; + +procedure RegisterItems; +begin + TdxReportLayoutControlHost.Register; + TdxCustomReportLayoutItem.Register; + TdxReportLayoutGroup.Register; + TdxReportLayoutItem.Register; +end; + +procedure UnregisterAssistants; +begin + TdxPSNativeLayoutControlProducer.Unregister; + + TdxPSLayoutControlProducer.Unregister; + + TdxPSLayoutItemProducer.Unregister; + TdxPSLayoutGroupProducer.Unregister; + TdxPSCustomLayoutItemProducer.Unregister; + + TdxPSLayoutWebLookAndFeelProducer.Unregister; + TdxPSLayoutOfficeLookAndFeelProducer.Unregister; + TdxPSLayoutStandardLookAndFeelProducer.Unregister; + TdxPSLayoutLookAndFeelProducer.Unregister; + + TdxPSLayoutItemProducerFactory.ReleaseInstance; + TdxPSLayoutLookAndFeelProducerFactory.ReleaseInstance; +end; + +procedure UnregisterItems; +begin + TdxReportLayoutItem.Unregister; + TdxReportLayoutGroup.Unregister; + TdxCustomReportLayoutItem.Unregister; + TdxReportLayoutControlHost.Unregister; +end; + +initialization + RegisterAssistants; + RegisterItems; + + dxPSRegisterReportLink(TdxLayoutControlReportLink, TdxLayoutControl, TdxPSLayoutControlDesignWindow); + +finalization + dxPSUnregisterReportLink(TdxLayoutControlReportLink, TdxLayoutControl, TdxPSLayoutControlDesignWindow); + + UnregisterItems; + UnregisterAssistants; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxLCLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxLCLnkReg.pas new file mode 100644 index 00000000..63004d36 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxLCLnkReg.pas @@ -0,0 +1,61 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxLCLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI9} + DesignIntf, +{$ENDIF} + Classes, dxPSdxLCLnk; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterNoIcon([TdxLayoutControlReportLink]); +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxMVLnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSdxMVLnk.dfm new file mode 100644 index 00000000..b0ba45d0 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxMVLnk.dfm @@ -0,0 +1,832 @@ +object dxMVReportLinkDesignWindow: TdxMVReportLinkDesignWindow + Left = 386 + Top = 219 + BorderStyle = bsDialog + Caption = 'dxMVReportLinkDesignWindow' + ClientHeight = 414 + ClientWidth = 597 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 5 + Width = 589 + Height = 373 + ActivePage = tshColors + TabOrder = 0 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = '&Options' + object Bevel11: TBevel + Left = 40 + Top = 13 + Width = 242 + Height = 4 + Shape = bsBottomLine + end + object imgShow: TImage + Left = 9 + Top = 34 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblShow: TLabel + Left = 6 + Top = 8 + Width = 26 + Height = 13 + Caption = 'Show' + end + object Bevel16: TBevel + Left = 90 + Top = 102 + Width = 193 + Height = 4 + Shape = bsBottomLine + end + object chbxShowGrid: TCheckBox + Tag = 3 + Left = 90 + Top = 119 + Width = 173 + Height = 17 + Caption = '&Grid' + TabOrder = 3 + OnClick = ShowClick + end + object chbxShowGroupFooterGrid: TCheckBox + Tag = 5 + Left = 90 + Top = 163 + Width = 173 + Height = 17 + Caption = 'Group Footers Grid' + TabOrder = 5 + OnClick = ShowClick + end + object chbxShowHeaders: TCheckBox + Left = 90 + Top = 31 + Width = 173 + Height = 17 + Caption = '&Headers' + TabOrder = 0 + OnClick = ShowClick + end + object chbxShowFooters: TCheckBox + Tag = 1 + Left = 90 + Top = 53 + Width = 173 + Height = 17 + Caption = 'Foo&ters' + TabOrder = 1 + OnClick = ShowClick + end + object chbxShowPreviewGrid: TCheckBox + Tag = 4 + Left = 90 + Top = 141 + Width = 173 + Height = 17 + Caption = 'Nodes Grid' + TabOrder = 4 + OnClick = ShowClick + end + object chbxShowExpandButtons: TCheckBox + Tag = 12 + Left = 90 + Top = 75 + Width = 173 + Height = 17 + Caption = 'ExpandButtons' + TabOrder = 2 + OnClick = ShowClick + end + object lblPreviewWindow: TStaticText + Left = 295 + Top = 0 + Width = 88 + Height = 12 + AutoSize = False + Caption = 'Preview' + TabOrder = 6 + end + end + object tshColors: TTabSheet + Caption = '&Color' + object lblGridLineColor: TLabel + Left = 11 + Top = 304 + Width = 74 + Height = 13 + Caption = '&Grid Line color :' + end + object bvlGridLineColorHolder: TBevel + Left = 129 + Top = 299 + Width = 152 + Height = 22 + Visible = False + end + object lblDrawMode: TLabel + Left = 8 + Top = 21 + Width = 58 + Height = 13 + Caption = 'Draw &Mode:' + FocusControl = cbxDrawMode + end + object gbxFixedTransparent: TGroupBox + Left = 6 + Top = 164 + Width = 283 + Height = 126 + Caption = ' ' + TabOrder = 4 + object lblHeaderColor: TLabel + Left = 5 + Top = 49 + Width = 71 + Height = 13 + Caption = '&Header color : ' + end + object lblFooterColor: TLabel + Left = 5 + Top = 75 + Width = 65 + Height = 13 + Caption = 'Footer color :' + end + object bvlHeaderColorHolder: TBevel + Left = 123 + Top = 44 + Width = 152 + Height = 22 + Visible = False + end + object bvlFooterColorHolder: TBevel + Left = 123 + Top = 70 + Width = 152 + Height = 22 + Visible = False + end + object lblGroupNodeColor: TLabel + Left = 5 + Top = 101 + Width = 87 + Height = 13 + Caption = 'Group&Node color :' + end + object bvlGroupNodeColorHolder: TBevel + Left = 123 + Top = 96 + Width = 152 + Height = 22 + Visible = False + end + object lblLevelCaptionColor: TLabel + Left = 5 + Top = 23 + Width = 100 + Height = 13 + Caption = 'CaptionNode Color : ' + end + object bvlCaptionColorHolder: TBevel + Left = 123 + Top = 18 + Width = 152 + Height = 22 + Visible = False + end + end + object gbxTransparent: TGroupBox + Left = 6 + Top = 53 + Width = 283 + Height = 104 + Caption = ' ' + TabOrder = 2 + object lblColor: TLabel + Left = 5 + Top = 23 + Width = 29 + Height = 13 + Caption = 'C&olor:' + end + object bvlColorHolder: TBevel + Left = 123 + Top = 18 + Width = 152 + Height = 22 + Visible = False + end + object lblPreviewColor: TLabel + Left = 5 + Top = 77 + Width = 71 + Height = 13 + Caption = '&Preview color :' + end + object bvlPreviewColorHolder: TBevel + Tag = 1 + Left = 123 + Top = 72 + Width = 152 + Height = 22 + Visible = False + end + object lblEvenColor: TLabel + Left = 5 + Top = 47 + Width = 59 + Height = 13 + Caption = 'Even Color :' + end + object bvlEvenColorHolder: TBevel + Left = 123 + Top = 43 + Width = 152 + Height = 22 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 17 + Top = 51 + Width = 15 + Height = 17 + Caption = ' Tr&ansparent ' + TabOrder = 1 + OnClick = chbxTransparentClick + end + object chbxFixedTransparent: TCheckBox + Tag = 1 + Left = 17 + Top = 163 + Width = 15 + Height = 17 + Caption = ' Fi&xed transparent ' + TabOrder = 3 + OnClick = chbxTransparentClick + end + object cbxDrawMode: TComboBox + Left = 89 + Top = 15 + Width = 193 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 0 + OnClick = cbxDrawModeClick + OnDrawItem = cbxDrawModeDrawItem + Items.Strings = ( + 'Simpe' + 'Odd\Even Rows Mode' + 'Borrow From Source') + end + object stTransparent: TStaticText + Left = 32 + Top = 52 + Width = 76 + Height = 17 + Caption = ' &Transparent ' + FocusControl = chbxTransparent + TabOrder = 5 + OnClick = stTransparentClick + end + object stFixedTransparent: TStaticText + Left = 32 + Top = 164 + Width = 98 + Height = 17 + Caption = ' Fixed Transparent ' + FocusControl = chbxFixedTransparent + TabOrder = 6 + OnClick = stFixedTransparentClick + end + end + object tshFonts: TTabSheet + Caption = '&Font' + object btnChangeFont: TButton + Left = 6 + Top = 170 + Width = 116 + Height = 23 + Caption = 'Change Fo&nt ...' + TabOrder = 1 + OnClick = btnChangeFontClick + end + object lbxFonts: TListBox + Left = 6 + Top = 15 + Width = 282 + Height = 148 + Style = lbOwnerDrawFixed + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ItemHeight = 16 + MultiSelect = True + ParentFont = False + ParentShowHint = False + PopupMenu = pmChangeFont + ShowHint = True + TabOrder = 0 + OnClick = lbxFontsClick + OnDblClick = lbxFontsDblClick + OnDrawItem = lbxFontsDrawItem + OnKeyDown = lbxFontsKeyDown + OnMouseMove = lbxFontsMouseMove + end + end + object tshBehaviors: TTabSheet + Caption = '&Behaviors' + object Bevel12: TBevel + Left = 57 + Top = 12 + Width = 228 + Height = 4 + Shape = bsBottomLine + end + object Bevel13: TBevel + Left = 92 + Top = 83 + Width = 192 + Height = 4 + Shape = bsBottomLine + end + object imgSelection: TImage + Left = 9 + Top = 30 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object imgNodeExpanding: TImage + Left = 9 + Top = 104 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 7778800000000000000000000000078888888888880000000000000000000000 + 007880FFF7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7FF777777FFF77777FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F8F7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7F7F8888FF7F88888FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F8F7777777777777777777078888888888880F7F7F888FFF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F0788077777777777777777777770788C8888C88880F7FF888888FFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880F0F7777777FFFFFFFFFFFF0788CCCCCCCC880F77777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7F7F8888FF7F88888FF7 + F0788077777777777777777777770788C8888C88880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F7F7F8888FF7F888888F7 + F0788077777777777777777777770788CCCC8CC8880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCCCCCC880F7FF88888FFFFFFFFFFF7 + F07880F0F777777FFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F77777777777777777777 + F078800000000000000000000000078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F888888880F88888888888078888888888880F77777777777777777777 + F07880F877778880F87777777778078888888888880F77777777777777777777 + F07880FFFFFFFFF0FFFFFFFFFFFF078888888888880FFFFFFFFFFFFFFFFFFFFF + F078800000000000000000000000088888888888880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblSelection: TLabel + Left = 6 + Top = 8 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object lblExpanding: TLabel + Left = 6 + Top = 79 + Width = 78 + Height = 13 + Caption = 'Node Expanding' + end + object lblRefinements: TLabel + Left = 7 + Top = 215 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlGraphic: TBevel + Left = 76 + Top = 220 + Width = 208 + Height = 4 + Shape = bsBottomLine + end + object imgGraphics: TImage + Left = 9 + Top = 241 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FF7FFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF777777F + F07DD0F77777777FF7FF70888FFF07DDCCCCCCCCDD0F77777777FF7FF7FFFF7F + F07DD0FFFFFFFFFFF7FF70FF8FFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF7F00F7F + F07DD0F777777FFFF7FF70FF8FFF07DDCDDDDCDDDD0F777777FFFF7FF7F00F7F + F07DD0FFFFFFFFFFF7FF70000FFF07DDDDDDDDDDDD0FFFFFFFFFFF7FF7FFFF7F + F07DD0F77777777FF7FF777777FF07DDDDDDDDDDDD0F77777777FF7FF777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFCCCCCFFF07DDCCCCCCCCDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FCCCCCCCFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F7777777FFF7FFCCCCCFFF07DDCDDDDCDDDD0F7777777FFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7F9999999FF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F777777777F7FF99999FFF07DDDDDDDDDDDD0F777777777F7F7777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F80000888887F88888888707DDDDDDDDDDDD0F80000888887F88888888 + 707DD0F80000000087F80000008707DDDDDDDDDDDD0F80000000087F80000008 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0FFFFFFFFFFF7FFFFFFFFF707DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + 707DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblLookAndFeel: TLabel + Left = 6 + Top = 148 + Width = 67 + Height = 13 + Caption = 'Look And Feel' + end + object img3DEffects: TImage + Left = 9 + Top = 172 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D08777777777780877777788807DCCCCDCCDDD0877777777778787777788 + 8F07D08888888888880888888888807DCCCCCCCCDD0888888888888788888888 + 8F07D00000000000000000000000007DCCCCDCCDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F7777777FF07DDDDDDDDDDD0F777777777FF7F7777777 + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F777777FFF07DDDDDDDDDDD0F777777FFFFF7F777777F + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F7777777777F7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F77777FFFF07DDDDDDDDDDD0F77777777FFF7F77777FF + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D00000000000000000000000007DCDDDDCDDDD0000000000000000000000 + 0007D08888888888880888888888807DCCCCDCCDDD0777777777777777777777 + 7707D08888888888880888888888807DCCCCCCCCDD0F88888888888788888888 + 8707D08000000008880880000000807DCCCCDCCDDD0F00000000888788000000 + 8707D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + F707D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object Bevel15: TBevel + Left = 83 + Top = 152 + Width = 200 + Height = 4 + Shape = bsBottomLine + end + object chbxTransparentColumnGraphic: TCheckBox + Tag = 7 + Left = 90 + Top = 239 + Width = 188 + Height = 17 + Caption = 'Transparent Column &Graphics' + TabOrder = 5 + OnClick = ShowClick + end + object chbxDisplayGraphicsAsText: TCheckBox + Tag = 8 + Left = 90 + Top = 261 + Width = 188 + Height = 17 + Caption = 'Display Graphics As &Text' + TabOrder = 6 + OnClick = ShowClick + end + object chbxOnlySelected: TCheckBox + Left = 90 + Top = 31 + Width = 188 + Height = 17 + Caption = 'Only &selected' + TabOrder = 0 + OnClick = chbxOnlySelectedClick + end + object chbxExtendedSelect: TCheckBox + Left = 90 + Top = 53 + Width = 188 + Height = 17 + Caption = '&Extended select' + TabOrder = 1 + OnClick = chbxExtendedSelectClick + end + object chbxAutoNodesExpand: TCheckBox + Left = 90 + Top = 102 + Width = 188 + Height = 17 + Caption = '&Auto Node Expanded' + TabOrder = 2 + OnClick = chbxAutoNodesExpandClick + end + object chbxUse3DEffects: TCheckBox + Tag = 9 + Left = 90 + Top = 171 + Width = 188 + Height = 17 + Caption = '&Use 3D Effects' + TabOrder = 3 + OnClick = ShowClick + end + object chbxUseSoft3D: TCheckBox + Tag = 10 + Left = 90 + Top = 193 + Width = 188 + Height = 17 + Caption = 'Soft &3D' + TabOrder = 4 + OnClick = ShowClick + end + object chbxCheckMarksAsText: TCheckBox + Tag = 11 + Left = 90 + Top = 305 + Width = 173 + Height = 17 + Caption = 'Display CheckMarks as Text' + TabOrder = 8 + OnClick = ShowClick + end + object chbxFlatCheckMarks: TCheckBox + Tag = 6 + Left = 90 + Top = 283 + Width = 173 + Height = 17 + Caption = 'Flat Check &Marks' + TabOrder = 7 + OnClick = ShowClick + end + end + object tshPreview: TTabSheet + Caption = 'Preview' + ImageIndex = 4 + object lblPreviewLineCount: TLabel + Left = 90 + Top = 82 + Width = 99 + Height = 13 + Caption = 'Preview &Line Count: ' + end + object bvlPreviewLineCountHolder: TBevel + Left = 193 + Top = 78 + Width = 81 + Height = 21 + Visible = False + end + object lblPreview: TLabel + Left = 6 + Top = 8 + Width = 38 + Height = 13 + Caption = 'Preview' + end + object Bevel1: TBevel + Left = 52 + Top = 13 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object imgPreview: TImage + Left = 9 + Top = 30 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDD7777777777777777777777777DDDDDD0000000000000000000000000 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F888F7FF888F7F8888F7F07DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F0 + 7DDDDDD0F777777777777777777777F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCFFCCCCFFCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCFCCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCFCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCFCCFCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCFFCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F777777777777777777777F07DDDDDD0F7F888F7FF888F7FF888F7F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F88887F888887F888887F07DDDDDD0F7F00087F000087F000087F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0000000000000000000000000 + DDDD} + Transparent = True + end + object chbxShowPreview: TCheckBox + Tag = 2 + Left = 90 + Top = 31 + Width = 97 + Height = 17 + Caption = 'Pre&view' + TabOrder = 0 + OnClick = ShowClick + end + object chbxAutoCalcPreviewLines: TCheckBox + Left = 90 + Top = 53 + Width = 169 + Height = 17 + Caption = '&Auto Calc Preview Lines' + TabOrder = 1 + OnClick = chbxAutoCalcPreviewLinesClick + end + end + end + object pnlPreview: TPanel + Left = 303 + Top = 44 + Width = 281 + Height = 324 + BevelInner = bvLowered + BevelOuter = bvNone + Color = clWindow + TabOrder = 1 + object dxMVPreview: TdxMasterView + Left = 5 + Top = 5 + Width = 271 + Height = 313 + Enabled = False + TabOrder = 0 + Visible = False + OptionsView = [movAutoColumnWidth, movHideFocusRect, movHideSelection, movKeepColumnWidths, movTransparentDragAndDrop, movUseBitmap, movUseBitmapToDrawPreview] + ScrollBars = sbNone + object mvsCaptionStyle: TdxMasterViewStyle + end + object mvsContentStyle: TdxMasterViewStyle + end + object mvsFooterStyle: TdxMasterViewStyle + end + object mvsGroupStyle: TdxMasterViewStyle + end + object mvsHeaderStyle: TdxMasterViewStyle + end + object mvsPreviewStyle: TdxMasterViewStyle + end + object mvsAnotherContentStyle: TdxMasterViewStyle + end + end + end + object pmChangeFont: TPopupMenu + OnPopup = pmChangeFontPopup + Left = 4 + Top = 383 + object miChangeFont: TMenuItem + Caption = 'Change Fo&nt ...' + Default = True + ShortCut = 16454 + OnClick = btnChangeFontClick + end + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxMVLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxMVLnk.pas new file mode 100644 index 00000000..02ddb582 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxMVLnk.pas @@ -0,0 +1,3618 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxMVLnk; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls, ComCtrls, Menus, Db, dxMasterView, dxMasterViewColumns, + dxBase, dxPSCore, dxPSGlbl, dxPSMD; + +type + TdxMasterViewPaintOption = + (mvpoHeaders, mvpoFooters, mvpoPreview, mvpoGrid, mvpoPreviewGrid, + mvpoGroupFooterGrid, mvpoFlatCheckMarks, mvpoTransparentColumnGraphic, + mvpoGraphicAsText, mvpo3DEffects, mvpoSoft3D, mvpoCheckMarksAsText, mvpoExpandButtons); + TdxMasterViewPaintOptions = set of TdxMasterViewPaintOption; + TdxMasterViewLinkCellType = (mvctUnknown, mvctCell, mvctFooter, mvctHeader, mvctPreview); + TdxMasterViewDrawMode = (mvdmStrict, mvdmOddEven, mvdmBorrowSource); + + PdxMasterViewLevel = ^TdxMasterViewLevel; + PdxMasterViewColumn = ^TdxMasterViewColumn; + PdxMasterViewNode = ^TdxMasterViewNode; + + TdxMasterViewColumnHelperClass = class of TdxMasterViewColumnHelper; + + TdxMasterViewColumnHelper = class(TdxCustomClassMapItem) + protected + class procedure GetImageLists(AColumn: TdxMasterViewColumn; AProc: TdxPSGetImageListProc); virtual; + public + class function ColumnClass: TdxMasterViewColumnClass; virtual; + class function PairClass: TClass; override; + class procedure Register; + end; + + TdxMasterViewImageColumnHelper = class(TdxMasterViewColumnHelper) + protected + class procedure GetImageLists(AColumn: TdxMasterViewColumn; AProc: TdxPSGetImageListProc); override; + public + class function ColumnClass: TdxMasterViewColumnClass; override; + end; + + TdxMVReportLinkCustomDrawCellEvent = procedure(Sender: TBasedxReportLink; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; ANode: TdxMasterViewNode; + AColumn: TdxMasterViewColumn; var AText: string; var AColor: TColor; + AFont: TFont; var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean) of object; + + TdxMVReportLinkCustomDrawFooterCellEvent = procedure(Sender: TBasedxReportLink; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; ANode: TdxMasterViewNode; + AColumn: TdxMasterViewColumn; var AText: string; var AColor: TColor; + AFont: TFont; var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean) of object; + + TdxMVReportLinkCustomDrawHeaderCellEvent = procedure(Sender: TBasedxReportLink; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; AColumn: TdxMasterViewColumn; + var AText: string; var AColor: TColor; AFont: TFont; + var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ASorted: TdxCellSortOrder; var ADone: Boolean) of object; + + TdxMVReportLinkCustomDrawPreviewCellEvent = procedure(Sender: TBasedxReportLink; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; ANode: TdxMasterViewNode; + var AText: string; var AColor: TColor; AFont: TFont; + var ADone: Boolean) of object; + + TdxMasterViewReportLink = class(TBasedxReportLink) + private + FAutoNodesExpand: Boolean; + FCaptionColor: TColor; + FCaptionNodeFont: TFont; + FDrawMode: TdxMasterViewDrawMode; + FEvenColor: TColor; + FEvenFont: TFont; + FExtendedSelect: Boolean; + FFixedTransparent: Boolean; + FFooterColor: TColor; + FFooterFont: TFont; + FGridLineColor: TColor; + FGroupNodeFont: TFont; + FGroupNodeColor: TColor; + FHeaderColor: TColor; + FHeaderFont: TFont; + FOddFont: TFont; + FOnlySelected: Boolean; + FOptions: TdxMasterViewPaintOptions; + FPreviewColor: TColor; + FPreviewFont: TFont; + FPreviewLineCount: Integer; + FSupportedCustomDraw: Boolean; + + FOnCustomDrawCell: TdxMVReportLinkCustomDrawCellEvent; + FOnCustomDrawFooterCell: TdxMVReportLinkCustomDrawFooterCellEvent; + FOnCustomDrawHeaderCell: TdxMVReportLinkCustomDrawHeaderCellEvent; + FOnCustomDrawPreviewCell: TdxMVReportLinkCustomDrawPreviewCellEvent; + + FColumnPlaces: TList; + FCustomDrawFontChanged: Boolean; + FDelimitersCells: TList; + FFontIndexes: TList; + FFonts: TList; + FIndent: Integer; + FLevels: TList; + FNodes: TList; + FSaveFont: TFont; + FSelectedNodes: TList; + + FFooterLineHeight: Integer; + FGroupNodeHeight: Integer; + FHeaderLineHeight: Integer; + FLevelCaptionHeight: Integer; + FLineHeight: Integer; + FPreviewFullHeight: Integer; + FPreviewLineHeight: Integer; + function GetOddColor: TColor; + function GetOptions: TdxMasterViewPaintOptions; + procedure SetAutoNodesExpand(Value: Boolean); + procedure SetCaptionColor(Value: TColor); + procedure SetCaptionNodeFont(Value: TFont); + procedure SetDrawMode(Value: TdxMasterViewDrawMode); + procedure SetEvenColor(Value: TColor); + procedure SetEvenFont(Value: TFont); + procedure SetExtendedSelect(Value: Boolean); + procedure SetFixedTransparent(Value: Boolean); + procedure SetFooterFont(Value: TFont); + procedure SetGridLineColor(Value: TColor); + procedure SetFooterColor(Value: TColor); + procedure SetGroupNodeFont(Value: TFont); + procedure SetGroupNodeColor(Value: TColor); + procedure SetHeaderColor(Value: TColor); + procedure SetHeaderFont(Value: TFont); + function GetMasterView: TdxMasterView; + procedure SetOddColor(Value: TColor); + procedure SetOddFont(Value: TFont); + procedure SetOnCustomDrawCell(Value: TdxMVReportLinkCustomDrawCellEvent); + procedure SetOnCustomDrawFooterCell(Value: TdxMVReportLinkCustomDrawFooterCellEvent); + procedure SetOnCustomDrawHeaderCell(Value: TdxMVReportLinkCustomDrawHeaderCellEvent); + procedure SetOnCustomDrawPreviewCell(Value: TdxMVReportLinkCustomDrawPreviewCellEvent); + procedure SetOnlySelected(Value: Boolean); + procedure SetOptions(Value: TdxMasterViewPaintOptions); + procedure SetPreviewColor(Value: TColor); + procedure SetPreviewFont(Value: TFont); + procedure SetPreviewLineCount(Value: Integer); + procedure SetSupportCustomDraw(Value: Boolean); + + procedure AddNodes; + procedure BuildSelectedNodeList; + procedure CalcFontIndexes(AReportCells: TdxReportCells); + procedure CustomDrawFontChanged(Sender: TObject); + procedure FreeColumnPlaces; + procedure FreeFontIndexes; + function GetCellCustomDrawInfo(AItem: TdxReportVisualItem; + ANode: PdxMasterViewNode; AColumn: PdxMasterViewColumn): TdxMasterViewLinkCellType; + function IsExtendedSelect: Boolean; + function IsExistSelectedNodes: Boolean; + function IsSelectedNode(ANode: TdxMasterViewNode): Boolean; + procedure LoadColumnPlaces; + procedure LoadFontIndexes(AReportCells: TdxReportCells); + function NodeExpanded(ANode: TdxMasterViewNode): Boolean; + procedure PrepareData(Value: Boolean); + protected + FCaptionNodeFontIndex: Integer; + FEvenFontIndex: Integer; + FGroupNodeFontIndex: Integer; + FFooterFontIndex: Integer; + FHeaderFontIndex: Integer; + FOddFontIndex: Integer; + FPreviewFontIndex: Integer; + procedure ConstructReport(AReportCells: TdxReportCells); override; + function GetEmptyPagesCanExist: Boolean; override; + procedure GetImageLists(AProc: TdxPSGetImageListProc); override; + procedure InternalRestoreDefaults; override; + procedure InternalRestoreFromOriginal; override; + procedure MakeDelimiters(AReportCells: TdxReportCells; + AHorzDelimiters, AVertDelimiters: TList); override; + procedure PrepareConstruct(AReportCells: TdxReportCells); virtual; + procedure UnprepareConstruct(AReportCells: TdxReportCells); virtual; + + procedure AssignValues(ADataItem: TAbstractdxReportCellData; + ANode: TdxMasterViewNode; AColumn: TdxMasterViewColumn; + ACellType: TdxMasterViewLinkCellType); virtual; + function GetDataClass(ANode: TdxMasterViewNode; AColumn: TdxMasterViewColumn; + ACellType: TdxMasterViewLinkCellType): TdxReportCellDataClass; virtual; + { custom draw support } + procedure CustomDraw(AItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); override; + procedure DoCustomDrawCell(ACanvas: TCanvas; ABoundsRect, + AClientRect: TRect; ANode: TdxMasterViewNode; AColumn: TdxMasterViewColumn; + var AText: string; var AColor: TColor; AFont: TFont; + var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean); virtual; + procedure DoCustomDrawFooterCell(ACanvas: TCanvas; ABoundsRect, + AClientRect: TRect; ANode: TdxMasterViewNode; AColumn: TdxMasterViewColumn; + var AText: string; var AColor: TColor; AFont: TFont; + var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean); virtual; + procedure DoCustomDrawHeaderCell(ACanvas: TCanvas; ABoundsRect, + AClientRect: TRect; AColumn: TdxMasterViewColumn; var AText: string; + var AColor: TColor; AFont: TFont; var ATextAlignX: TdxTextAlignX; + var ATextAlignY: TdxTextAlignY; var ASorted: TdxCellSortOrder; + var ADone: Boolean); virtual; + procedure DoCustomDrawPreviewCell(ACanvas: TCanvas; ABoundsRect, + AClientRect: TRect; ANode: TdxMasterViewNode; var AText: string; + var AColor: TColor; AFont: TFont; var ADone: Boolean); virtual; + function IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; override; + { options access } + function AutoCalcPreviewLines: Boolean; + function FlatCheckMarks: Boolean; + function GraphicsAsText: Boolean; + function OddEvenMode: Boolean; + function ShowExpandButtons: Boolean; + function ShowFooters(ANode: TdxMasterViewNode): Boolean; + function ShowGrid(ANode: TdxMasterViewNode): Boolean; + function ShowHeaders(ANode: TdxMasterViewNode): Boolean; + function ShowPreview(ANode: TdxMasterViewNode): Boolean; + function ShowPreviewGrid(ANode: TdxMasterViewNode): Boolean; + function ShowGroupFooterGrid: Boolean; + function TransparentColumnGraphics: Boolean; + function Use3DEffects: Boolean; + function UseSoft3D: Boolean; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + property MasterView: TdxMasterView read GetMasterView; + published + property AutoNodesExpand: Boolean read FAutoNodesExpand write SetAutoNodesExpand default False; + property CaptionColor: TColor read FCaptionColor write SetCaptionColor default clBtnFace; + property CaptionNodeFont: TFont read FCaptionNodeFont write SetCaptionNodeFont stored IsFontStored; + property Color; + property DrawMode: TdxMasterViewDrawMode read FDrawMode write SetDrawMode default mvdmStrict; + property EvenColor: TColor read FEvenColor write SetEvenColor default clWhite; + property EvenFont: TFont read FEvenFont write SetEvenFont stored IsFontStored; + property ExtendedSelect: Boolean read FExtendedSelect write SetExtendedSelect default True; + property FixedTransparent: Boolean read FFixedTransparent write SetFixedTransparent default False; + property Font; + property FooterColor: TColor read FFooterColor write SetFooterColor default clBtnFace; + property FooterFont: TFont read FFooterFont write SetFooterFont stored IsFontStored; + property GridLineColor: TColor read FGridLineColor write SetGridLineColor default clBlack; + property GroupNodeFont: TFont read FGroupNodeFont write SetGroupNodeFont stored IsFontStored; + property GroupNodeColor: TColor read FGroupNodeColor write SetGroupNodeColor default clBtnFace; + property HeaderColor: TColor read FHeaderColor write SetHeaderColor default clBtnFace; + property HeaderFont: TFont read FHeaderFont write SetHeaderFont stored IsFontStored; + property OddColor: TColor read GetOddColor write SetOddColor default clWhite; + property OddFont: TFont read FOddFont write SetOddFont stored IsFontStored; + property OnlySelected: Boolean read FOnlySelected write SetOnlySelected default False; + property Options: TdxMasterViewPaintOptions read GetOptions write SetOptions + default [mvpoHeaders, mvpoFooters, mvpoPreview, mvpoGrid, mvpoPreviewGrid, + mvpoGroupFooterGrid, mvpoFlatCheckMarks, mvpo3DEffects, mvpoSoft3D, mvpoExpandButtons]; + property PreviewColor: TColor read FPreviewColor write SetPreviewColor default clWhite; + property PreviewFont: TFont read FPreviewFont write SetPreviewFont stored IsFontStored; + property PreviewLineCount: Integer read FPreviewLineCount write SetPreviewLineCount default -1; + property ScaleFonts; + property ShowEmptyPages; + property SupportedCustomDraw: Boolean read FSupportedCustomDraw write SetSupportCustomDraw default False; + property Transparent; + property UseHorzDelimiters; + property UseVertDelimiters; + property OnCustomDrawCell: TdxMVReportLinkCustomDrawCellEvent + read FOnCustomDrawCell write SetOnCustomDrawCell; + property OnCustomDrawFooterCell: TdxMVReportLinkCustomDrawFooterCellEvent + read FOnCustomDrawFooterCell write SetOnCustomDrawFooterCell; + property OnCustomDrawHeaderCell: TdxMVReportLinkCustomDrawHeaderCellEvent + read FOnCustomDrawHeaderCell write SetOnCustomDrawHeaderCell; + property OnCustomDrawPreviewCell: TdxMVReportLinkCustomDrawPreviewCellEvent + read FOnCustomDrawPreviewCell write SetOnCustomDrawPreviewCell; + end; + + TdxMVReportLinkDesignWindow = class(TStandarddxReportLinkDesignWindow) + PageControl1: TPageControl; + tshOptions: TTabSheet; + Bevel11: TBevel; + imgShow: TImage; + lblShow: TLabel; + Bevel16: TBevel; + chbxShowGrid: TCheckBox; + chbxShowGroupFooterGrid: TCheckBox; + chbxShowHeaders: TCheckBox; + chbxShowFooters: TCheckBox; + tshColors: TTabSheet; + lblGridLineColor: TLabel; + bvlGridLineColorHolder: TBevel; + gbxFixedTransparent: TGroupBox; + lblHeaderColor: TLabel; + lblFooterColor: TLabel; + bvlHeaderColorHolder: TBevel; + bvlFooterColorHolder: TBevel; + lblGroupNodeColor: TLabel; + bvlGroupNodeColorHolder: TBevel; + gbxTransparent: TGroupBox; + lblColor: TLabel; + bvlColorHolder: TBevel; + lblPreviewColor: TLabel; + bvlPreviewColorHolder: TBevel; + lblEvenColor: TLabel; + bvlEvenColorHolder: TBevel; + chbxTransparent: TCheckBox; + chbxFixedTransparent: TCheckBox; + tshFonts: TTabSheet; + btnChangeFont: TButton; + lbxFonts: TListBox; + tshBehaviors: TTabSheet; + Bevel12: TBevel; + Bevel13: TBevel; + imgSelection: TImage; + imgNodeExpanding: TImage; + lblSelection: TLabel; + lblExpanding: TLabel; + lblRefinements: TLabel; + bvlGraphic: TBevel; + imgGraphics: TImage; + lblLookAndFeel: TLabel; + img3DEffects: TImage; + Bevel15: TBevel; + chbxTransparentColumnGraphic: TCheckBox; + chbxDisplayGraphicsAsText: TCheckBox; + chbxOnlySelected: TCheckBox; + chbxExtendedSelect: TCheckBox; + chbxAutoNodesExpand: TCheckBox; + chbxUse3DEffects: TCheckBox; + chbxUseSoft3D: TCheckBox; + pnlPreview: TPanel; + pmChangeFont: TPopupMenu; + miChangeFont: TMenuItem; + lblLevelCaptionColor: TLabel; + bvlCaptionColorHolder: TBevel; + chbxShowPreviewGrid: TCheckBox; + dxMVPreview: TdxMasterView; + mvsCaptionStyle: TdxMasterViewStyle; + mvsContentStyle: TdxMasterViewStyle; + mvsFooterStyle: TdxMasterViewStyle; + mvsGroupStyle: TdxMasterViewStyle; + mvsHeaderStyle: TdxMasterViewStyle; + mvsPreviewStyle: TdxMasterViewStyle; + mvsAnotherContentStyle: TdxMasterViewStyle; + tshPreview: TTabSheet; + chbxCheckMarksAsText: TCheckBox; + chbxFlatCheckMarks: TCheckBox; + chbxShowExpandButtons: TCheckBox; + lblPreviewLineCount: TLabel; + bvlPreviewLineCountHolder: TBevel; + lblPreview: TLabel; + Bevel1: TBevel; + imgPreview: TImage; + chbxShowPreview: TCheckBox; + chbxAutoCalcPreviewLines: TCheckBox; + lblDrawMode: TLabel; + cbxDrawMode: TComboBox; + lblPreviewWindow: TStaticText; + stTransparent: TStaticText; + stFixedTransparent: TStaticText; + procedure ShowClick(Sender: TObject); + procedure chbxAutoNodesExpandClick(Sender: TObject); + procedure chbxOnlySelectedClick(Sender: TObject); + procedure chbxExtendedSelectClick(Sender: TObject); + procedure chbxAutoCalcPreviewLinesClick(Sender: TObject); + procedure chbxTransparentClick(Sender: TObject); + procedure btnChangeFontClick(Sender: TObject); + procedure lbxFontsMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure lbxFontsKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure lbxFontsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure lbxFontsClick(Sender: TObject); + procedure cbxDrawModeClick(Sender: TObject); + procedure pmChangeFontPopup(Sender: TObject); + procedure lbxFontsDblClick(Sender: TObject); + procedure PageControl1Change(Sender: TObject); + procedure cbxDrawModeDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure stTransparentClick(Sender: TObject); + procedure stFixedTransparentClick(Sender: TObject); + private + FccbxColor: TCustomComboBox; + FccbxEvenColor: TCustomComboBox; + FccbxCaptionColor: TCustomComboBox; + FccbxHeaderColor: TCustomComboBox; + FccbxGroupNodeColor: TCustomComboBox; + FccbxPreviewColor: TCustomComboBox; + FccbxFooterColor: TCustomComboBox; + FccbxGridLineColor: TCustomComboBox; + FPreviewBox: TCustomControl; + FsePreviewLineCount: TCustomEdit; + + FMVDetailLevel: TdxMasterViewLevel; + FMVMasterLevel: TdxMasterViewLevel; + FMVColumnAddress: TdxMasterViewColumn; + FMVColumnName: TdxMasterViewColumn; + FMVColumnCash: TdxMasterViewCheckColumn; + FMVColumnCount: TdxMasterViewColumn; + FMVColumnPrice: TdxMasterViewColumn; + FdsDetail: TDataSource; + FdsMaster: TDataSource; + FmdDetail: TdxEasyMemData; + FmdMaster: TdxEasyMemData; + + FLastIndex: Integer; + procedure ccbxColorChange(Sender: TObject); + procedure CreateControls; + procedure CreateDataSets; + procedure DoChangeFont(Index: Integer); + procedure dxMVPreviewGetContentStyle(Sender: TdxMasterViewLevel; + Node: TdxMasterViewNode; Column: TdxMasterViewColumn; + var NewStyle: TdxMasterViewStyle); + function GetFontByIndex(AIndex: Integer): TFont; + function GetFontInfoText(AIndex: Integer): string; + function GetReportLink: TdxMasterViewReportLink; + function GetMaxWidth: Integer; + procedure InitializeMasterView; + function IsChangeFontEnabled: Boolean; + function IsDisableIndex(AIndex: Integer): Boolean; + procedure LoadMemData; + procedure pbxPreviewPaint(Sender: TObject); + procedure PreviewLineCountChange(Sender: TObject); + procedure CMDialogChar(var Msg: TCMDialogChar); message CM_DIALOGCHAR; + protected + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + procedure LoadStrings; override; + procedure PaintPreview(ACanvas: TCanvas; R: TRect); override; + procedure UpdateControlsState; override; + procedure UpdatePreview; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property ReportLink: TdxMasterViewReportLink read GetReportLink; + end; + +const + dxDefaultMasterViewPaintOptions: TdxMasterViewPaintOptions = + [mvpoHeaders, mvpoFooters, mvpoPreview, mvpoGrid, mvpoPreviewGrid, + mvpoGroupFooterGrid, mvpoFlatCheckMarks, mvpo3DEffects, mvpoSoft3D, mvpoExpandButtons]; + +implementation + +{$R *.DFM} + +uses + cxClasses, dxExtCtrls, dxPSRes, dxPSPopupMan, dxPrnDev, dxPSUtl; + +type + PColumnPlace = ^TColumnPlace; + TColumnPlace = record + Column: TdxMasterViewColumn; + RowIndex, ColIndex, RowCount: Integer; + end; + + TdxMasterViewColumnAccess = class(TdxMasterViewColumn); + TdxMasterViewLevelAccess = class(TdxMasterViewLevel); + TdxMasterViewNodeAccess = class(TdxMasterViewNode); + TdxMasterViewCheckColumnAccess = class(TdxMasterViewCheckColumn); + TdxMasterViewImageColumnAccess = class(TdxMasterViewImageColumn); + TdxMasterViewGraphicColumnAccess = class(TdxMasterViewGraphicColumn); + +function ExposeLevel(ALevel: TdxMasterViewLevel): TdxMasterViewLevelAccess; +begin + Result := TdxMasterViewLevelAccess(ALevel); +end; + +function ExposeNode(ANode: TdxMasterViewNode): TdxMasterViewNodeAccess; +begin + Result := TdxMasterViewNodeAccess(ANode); +end; + +function ExposeColumn(AColumn: TdxMasterViewColumn): TdxMasterViewColumnAccess; +begin + Result := TdxMasterViewColumnAccess(AColumn); +end; + +{ TdxColumnHelpersFactory } + +type + TdxColumnHelpersFactory = class(TdxCustomClassMaps) + private + function GetHelperClass(Column: TdxMasterViewColumn): TdxMasterViewColumnHelperClass; + public + class function Instance: TdxColumnHelpersFactory; reintroduce; overload; + property HelperClasses[Column: TdxMasterViewColumn]: TdxMasterViewColumnHelperClass read GetHelperClass; default; + end; + +function dxColumnHelpersFactory: TdxColumnHelpersFactory; +begin + Result := TdxColumnHelpersFactory.Instance; +end; + +class function TdxColumnHelpersFactory.Instance: TdxColumnHelpersFactory; +begin + Result := inherited Instance as TdxColumnHelpersFactory; +end; + +function TdxColumnHelpersFactory.GetHelperClass(Column: TdxMasterViewColumn): TdxMasterViewColumnHelperClass; +begin + Result := TdxMasterViewColumnHelperClass(PairClasses[Column.ClassType]); +end; + +{ TdxMasterViewColumnHelper } + +class function TdxMasterViewColumnHelper.ColumnClass: TdxMasterViewColumnClass; +begin + Result := TdxMasterViewColumn; +end; + +class function TdxMasterViewColumnHelper.PairClass: TClass; +begin + Result := ColumnClass; +end; + +class procedure TdxMasterViewColumnHelper.Register; +begin + dxColumnHelpersFactory.Register(Self); +end; + +class procedure TdxMasterViewColumnHelper.GetImageLists(AColumn: TdxMasterViewColumn; + AProc: TdxPSGetImageListProc); +begin +end; + +{ TdxMasterViewImageColumnHelper } + +class function TdxMasterViewImageColumnHelper.ColumnClass: TdxMasterViewColumnClass; +begin + Result := TdxMasterViewImageColumn; +end; + +class procedure TdxMasterViewImageColumnHelper.GetImageLists(AColumn: TdxMasterViewColumn; + AProc: TdxPSGetImageListProc); +begin + inherited GetImageLists(AColumn, AProc); + AProc(TdxMasterViewImageColumn(AColumn).Images); +end; + +{ TdxMasterViewReportLink } + +constructor TdxMasterViewReportLink.Create(AOwner: TComponent); + + function CreateFont: TFont; + begin + Result := TFont.Create; + Result.OnChange := FontChanged + end; + +begin + inherited Create(AOwner); + FCaptionNodeFont := CreateFont; + FEvenFont := CreateFont; + FFooterFont := CreateFont; + FGroupNodeFont := CreateFont; + FHeaderFont := CreateFont; + FOddFont := CreateFont; + FPreviewFont := CreateFont; + + FNodes := TList.Create; + FDelimitersCells := TList.Create; + FSaveFont := TFont.Create; + FSaveFont.OnChange := CustomDrawFontChanged; + + InternalRestoreDefaults; + LinkModified(False); +end; + +destructor TdxMasterViewReportLink.Destroy; +begin + FSaveFont.Free; + FDelimitersCells.Free; + FNodes.Free; + FPreviewFont.Free; + FOddFont.Free; + FHeaderFont.Free; + FGroupNodeFont.Free; + FFooterFont.Free; + FEvenFont.Free; + FCaptionNodeFont.Free; + inherited Destroy; +end; + +procedure TdxMasterViewReportLink.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TdxMasterViewReportLink then + begin + AutoNodesExpand := TdxMasterViewReportLink(Source).AutoNodesExpand; + DrawMode := TdxMasterViewReportLink(Source).DrawMode; + ExtendedSelect := TdxMasterViewReportLink(Source).ExtendedSelect; + FixedTransparent := TdxMasterViewReportLink(Source).FixedTransparent; + OnlySelected := TdxMasterViewReportLink(Source).OnlySelected; + Options := TdxMasterViewReportLink(Source).Options; + PreviewLineCount := TdxMasterViewReportLink(Source).PreviewLineCount; + SupportedCustomDraw := TdxMasterViewReportLink(Source).SupportedCustomDraw; + + EvenColor := TdxMasterViewReportLink(Source).EvenColor; + GroupNodeColor := TdxMasterViewReportLink(Source).GroupNodeColor; + GridLineColor := TdxMasterViewReportLink(Source).GridLineColor; + HeaderColor := TdxMasterViewReportLink(Source).HeaderColor; + PreviewColor := TdxMasterViewReportLink(Source).PreviewColor; + FooterColor := TdxMasterViewReportLink(Source).FooterColor; + + CaptionNodeFont := TdxMasterViewReportLink(Source).CaptionNodeFont; + EvenFont := TdxMasterViewReportLink(Source).EvenFont; + HeaderFont := TdxMasterViewReportLink(Source).HeaderFont; + OddFont := TdxMasterViewReportLink(Source).OddFont; + PreviewFont := TdxMasterViewReportLink(Source).PreviewFont; + FooterFont := TdxMasterViewReportLink(Source).FooterFont; + GroupNodeFont := TdxMasterViewReportLink(Source).GroupNodeFont; + end; +end; + +function TdxMasterViewReportLink.GetMasterView: TdxMasterView; +begin + Result := TdxMasterView(Component); +end; + +procedure TdxMasterViewReportLink.CustomDrawFontChanged(Sender: TObject); +begin + FCustomDrawFontChanged := True; +end; + +function TdxMasterViewReportLink.GetCellCustomDrawInfo(AItem: TdxReportVisualItem; + ANode: PdxMasterViewNode; AColumn: PdxMasterViewColumn): TdxMasterViewLinkCellType; +var + Parent: TdxReportCell; +begin + Result := mvctUnknown; + try + if AItem.Data <> 0 then + begin + if TObject(AItem.Data) is TdxMasterViewColumn then + begin + Parent := AItem.Parent; + if Parent <> nil then + begin + if Parent.Data = 0 then + Result := mvctHeader + else + if TObject(Parent.Data) is TdxMasterViewNode then + begin + Parent := Parent.Parent; + if Parent <> nil then + begin + if Parent = AItem.ReportCells.Cells then + Result := mvctCell + else + Result := mvctFooter + end; + end; + end; + end + else + if TObject(AItem.Data) is TdxMasterViewNode then // Caption Node + Result := mvctCell + end + else + begin + Parent := AItem.Parent; + if (Parent <> nil) and (Parent.Data <> 0) and + (TObject(Parent.Data) is TdxMasterViewNode) then + Result := mvctPreview; + end; + except + // eat exception if any Node or Column have been deleted already + end; + + if Result <> mvctUnknown then + begin + if (AColumn <> nil) and (Result <> mvctPreview) then + AColumn^ := TdxMasterViewColumn(AItem.Data); + if (ANode <> nil) and (Result <> mvctHeader) then + ANode^ := TdxMasterViewNode(AItem.Parent.Data); + end; +end; + +procedure TdxMasterViewReportLink.CustomDraw(AItem: TAbstractdxReportCellData; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); +var + AColumn: TdxMasterViewColumn; + ANode: TdxMasterViewNode; + AColor: TColor; + ASorted: TdxCellSortOrder; + AText: string; + ATextAlignX: TdxTextAlignX; + ATextAlignY: TdxTextAlignY; + ACellType: TdxMasterViewLinkCellType; +begin + if AItem.Data = 0 then Exit; + ACellType := GetCellCustomDrawInfo(AItem, @ANode, @AColumn); + if ACellType = mvctUnknown then Exit; + with TdxReportCellString(AItem) do + begin + AColor := ColorToRGB(Color); + if Transparent then AColor := clNone; + FSaveFont.Assign(Font); + FCustomDrawFontChanged := False; + AText := Text; + if ACellType = mvctHeader then ASorted := SortOrder; + if ACellType <> mvctPreview then + begin + ATextAlignX := TextAlignX; + ATextAlignY := TextAlignY; + end; + case ACellType of + mvctCell: + DoCustomDrawCell(ACanvas, ABoundsRect, AClientRect, ANode, AColumn, + AText, AColor, FSaveFont, ATextAlignX, ATextAlignY, ADone); + mvctFooter: + DoCustomDrawFooterCell(ACanvas, ABoundsRect, AClientRect, ANode, AColumn, + AText, AColor, FSaveFont, ATextAlignX, ATextAlignY, ADone); + mvctHeader: + DoCustomDrawHeaderCell(ACanvas, ABoundsRect, AClientRect, AColumn, AText, + AColor, FSaveFont, ATextAlignX, ATextAlignY, ASorted, ADone); + mvctPreview: + DoCustomDrawPreviewCell(ACanvas, ABoundsRect, AClientRect, ANode, AText, + AColor, FSaveFont, ADone); + end; + if not ADone then + begin + if FCustomDrawFontChanged then + begin + SelectObject(ACanvas.Handle, FSaveFont.Handle); + SetTextColor(ACanvas.Handle, ColorToRGB(FSaveFont.Color)); + FontIndex := -1; + end; + if AColor <> clNone then + begin + Color := AColor; + Transparent := False; + end; + Text := AText; + if ACellType = mvctHeader then + SortOrder := ASorted; + if ACellType <> mvctPreview then + begin + TextAlignX := ATextAlignX; + TextAlignY := ATextAlignY; + end; + end; + end; +end; + +procedure TdxMasterViewReportLink.SetSupportCustomDraw(Value: Boolean); +begin + if FSupportedCustomDraw <> Value then + begin + FSupportedCustomDraw := Value; + LinkModified(True); + end; +end; + +function TdxMasterViewReportLink.IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; +begin + Result := SupportedCustomDraw; + if Result and (Item <> nil) {and (Item.Data <> 0)} then + case GetCellCustomDrawInfo(Item, nil, nil) of + mvctCell: + Result := Assigned(FOnCustomDrawCell); + mvctFooter: + Result := Assigned(FOnCustomDrawFooterCell); + mvctHeader: + Result := Assigned(FOnCustomDrawHeaderCell); + mvctPreview: + Result := Assigned(FOnCustomDrawPreviewCell); + else + Result := False; + end; +end; + +procedure TdxMasterViewReportLink.DoCustomDrawCell(ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; ANode: TdxMasterViewNode; + AColumn: TdxMasterViewColumn; var AText: string; var AColor: TColor; + AFont: TFont; var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawCell) then + FOnCustomDrawCell(Self, ACanvas, ABoundsRect, AClientRect, ANode, AColumn, + AText, AColor, AFont, ATextAlignX, ATextAlignY, ADone); +end; + +procedure TdxMasterViewReportLink.DoCustomDrawFooterCell(ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; ANode: TdxMasterViewNode; + AColumn: TdxMasterViewColumn; var AText: string; var AColor: TColor; + AFont: TFont; var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawFooterCell) then + FOnCustomDrawFooterCell(Self, ACanvas, ABoundsRect, AClientRect, ANode, + AColumn, AText, AColor, AFont, ATextAlignX, ATextAlignY, ADone); +end; + +procedure TdxMasterViewReportLink.DoCustomDrawHeaderCell(ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; AColumn: TdxMasterViewColumn; + var AText: string; var AColor: TColor; AFont: TFont; + var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ASorted: TdxCellSortOrder; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawHeaderCell) then + FOnCustomDrawHeaderCell(Self, ACanvas, ABoundsRect, AClientRect, AColumn, + AText, AColor, AFont, ATextAlignX, ATextAlignY, ASorted, ADone); +end; + +procedure TdxMasterViewReportLink.DoCustomDrawPreviewCell(ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; ANode: TdxMasterViewNode; var AText: string; + var AColor: TColor; AFont: TFont; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawPreviewCell) then + FOnCustomDrawPreviewCell(Self, ACanvas, ABoundsRect, AClientRect, ANode, + AText, AColor, AFont, ADone); +end; + +function TdxMasterViewReportLink.AutoCalcPreviewLines: Boolean; +begin + Result := PreviewLineCount = -1; +end; + +function TdxMasterViewReportLink.FlatCheckMarks: Boolean; +begin + Result := mvpoFlatCheckMarks in Options; +end; + +function TdxMasterViewReportLink.GraphicsAsText: Boolean; +begin + Result := mvpoGraphicAsText in Options; +end; + +function TdxMasterViewReportLink.ShowExpandButtons: Boolean; +begin + Result := mvpoExpandButtons in Options; +end; + +function TdxMasterViewReportLink.ShowFooters(ANode: TdxMasterViewNode): Boolean; +begin + if (DrawMode = mvdmBorrowSource) and (ANode <> nil) then + Result := lovFooter in ANode.Level.OptionsView + else + Result := mvpoFooters in Options; +end; + +function TdxMasterViewReportLink.ShowGrid(ANode: TdxMasterViewNode): Boolean; +begin + if (DrawMode = mvdmBorrowSource) and (ANode <> nil) then + Result := lovGrid in ANode.Level.OptionsView + else + Result := mvpoGrid in Options; +end; + +function TdxMasterViewReportLink.ShowGroupFooterGrid: Boolean; +begin + Result := mvpoGroupFooterGrid in Options; +end; + +function TdxMasterViewReportLink.ShowHeaders(ANode: TdxMasterViewNode): Boolean; +begin + if (DrawMode = mvdmBorrowSource) and (ANode <> nil) then + Result := lovHeader in ANode.Level.OptionsView + else + Result := mvpoHeaders in Options; +end; + +function TdxMasterViewReportLink.ShowPreviewGrid(ANode: TdxMasterViewNode): Boolean; +begin + if (DrawMode = mvdmBorrowSource) and (ANode <> nil) then + Result := lovGridWithPreview in ANode.Level.OptionsView + else + Result := mvpoPreviewGrid in Options; +end; + +function TdxMasterViewReportLink.ShowPreview(ANode: TdxMasterViewNode): Boolean; +begin + if (DrawMode = mvdmBorrowSource) and (ANode <> nil) then + Result := lovPreview in ANode.Level.OptionsView + else + Result := mvpoPreview in Options; +end; + +function TdxMasterViewReportLink.IsExtendedSelect: Boolean; +begin + Result := IsExistSelectedNodes and ExtendedSelect; +end; + +function TdxMasterViewReportLink.IsExistSelectedNodes: Boolean; +begin + Result := OnlySelected and (MasterView.SelectedItemCount > 0); +end; + +function TdxMasterViewReportLink.IsSelectedNode(ANode: TdxMasterViewNode): Boolean; + + function IsExistSelectedChild(ANode: TdxMasterViewNode): Boolean; + var + I, J: Integer; + begin + Result := False; + with MasterView do + for I := 0 to ANode.Count - 1 do + begin + for J := 0 to SelectedItemCount - 1 do + begin + Result := (ANode[I] = SelectedItems[J]); + if Result then Exit; + end; + if (ANode[I].Count > 0) then + begin + Result := IsExistSelectedChild(ANode[I]); + if Result then Exit; + end; + end; + end; + + function FindInOriginal(ANode: TdxMasterViewNode): Boolean; + var + I: Integer; + begin + Result := False; + with MasterView do + for I := 0 to SelectedItemCount - 1 do + begin + Result := ANode = SelectedItems[I]; + if Result then Exit; + end; + end; + + function FindInChildren(ANode: TdxMasterViewNode): Boolean; + var + I: Integer; + begin + Result := False; + for I := 0 to ANode.Count - 1 do + begin + Result := FindInOriginal(ANode[I]); + if Result then + Break + else + if ANode[I].Count > 0 then + Result := FindInChildren(ANode[I]); + if Result then Break; + end; + end; + + function FindInParent(ANode: TdxMasterViewNode): Boolean; + begin + Result := False; + ANode := ANode.ParentNode; + while Assigned(ANode) do + begin + Result := FindInOriginal(ANode); + if Result then Break; + ANode := ANode.ParentNode; + end; + end; + +begin + Result := FindInOriginal(ANode); + if not Result and (ANode.Count > 0) then + Result := FindInChildren(ANode); + if not Result and not IsExtendedSelect then + Result := FindInParent(ANode); +end; + +function TdxMasterViewReportLink.TransparentColumnGraphics: Boolean; +begin + Result := mvpoTransparentColumnGraphic in Options; +end; + +function TdxMasterViewReportLink.OddEvenMode: Boolean; +begin + Result := DrawMode = mvdmOddEven; +end; + +function TdxMasterViewReportLink.Use3DEffects: Boolean; +begin + Result := mvpo3DEffects in Options; +end; + +function TdxMasterViewReportLink.UseSoft3D: Boolean; +begin + Result := mvpoSoft3D in Options; +end; + +procedure TdxMasterViewReportLink.SetExtendedSelect(Value: Boolean); +begin + if FExtendedSelect <> Value then + begin + FExtendedSelect := Value; + LinkModified(True); + end; +end; + +procedure TdxMasterViewReportLink.SetOnlySelected(Value: Boolean); +begin + if FOnlySelected <> Value then + begin + FOnlySelected := Value; +// if OnlySelected then FAutoNodesExpand := False; + LinkModified(True); + end; +end; + +procedure TdxMasterViewReportLink.SetAutoNodesExpand(Value: Boolean); +begin + if FAutoNodesExpand <> Value then + begin + FAutoNodesExpand := Value; + //if AutoNodesExpand then FOnlySelected := False; + LinkModified(True); + end; +end; + +procedure TdxMasterViewReportLink.SetDrawMode(Value: TdxMasterViewDrawMode); +begin + if FDrawMode <> Value then + begin + FDrawMode := Value; + LinkModified(True); + end; +end; + +function TdxMasterViewReportLink.GetOptions: TdxMasterViewPaintOptions; +begin + Result := FOptions; +end; + +procedure TdxMasterViewReportLink.SetOptions(Value: TdxMasterViewPaintOptions); +begin + if FOptions <> Value then + begin + FOptions := Value; + LinkModified(True); + end; +end; + +procedure TdxMasterViewReportLink.SetOddFont(Value: TFont); +begin + FOddFont.Assign(Value); +end; + +procedure TdxMasterViewReportLink.SetEvenFont(Value: TFont); +begin + FEvenFont.Assign(Value); +end; + +procedure TdxMasterViewReportLink.SetHeaderFont(Value: TFont); +begin + FHeaderFont.Assign(Value); +end; + +procedure TdxMasterViewReportLink.SetCaptionNodeFont(Value: TFont); +begin + FCaptionNodeFont.Assign(Value); +end; + +procedure TdxMasterViewReportLink.SetGroupNodeFont(Value: TFont); +begin + FGroupNodeFont.Assign(Value); +end; + +procedure TdxMasterViewReportLink.SetPreviewFont(Value: TFont); +begin + FPreviewFont.Assign(Value); +end; + +procedure TdxMasterViewReportLink.SetFooterFont(Value: TFont); +begin + FFooterFont.Assign(Value); +end; + +procedure TdxMasterViewReportLink.SetEvenColor(Value: TColor); +begin + if FEvenColor <> Value then + begin + FEvenColor := Value; + if OddEvenMode then LinkModified(True); + end; +end; + +function TdxMasterViewReportLink.GetOddColor: TColor; +begin + Result := Color; +end; + +procedure TdxMasterViewReportLink.SetOddColor(Value: TColor); +begin + inherited Color := Value; +end; + +procedure TdxMasterViewReportLink.SetGroupNodeColor(Value: TColor); +begin + if FGroupNodeColor <> Value then + begin + FGroupNodeColor := Value; + LinkModified(True); + end; +end; + +procedure TdxMasterViewReportLink.SetCaptionColor(Value: TColor); +begin + if FCaptionColor <> Value then + begin + FCaptionColor := Value; + LinkModified(True); + end; +end; + +procedure TdxMasterViewReportLink.SetGridLineColor(Value: TColor); +begin + if FGridLineColor <> Value then + begin + FGridLineColor := Value; + LinkModified(True); + end; +end; + +procedure TdxMasterViewReportLink.SetHeaderColor(Value: TColor); +begin + if FHeaderColor <> Value then + begin + FHeaderColor := Value; + LinkModified(True); + end; +end; + +procedure TdxMasterViewReportLink.SetPreviewColor(Value: TColor); +begin + if FPreviewColor <> Value then + begin + FPreviewColor := Value; + LinkModified(True); + end; +end; + +procedure TdxMasterViewReportLink.SetFooterColor(Value: TColor); +begin + if FFooterColor <> Value then + begin + FFooterColor := Value; + LinkModified(True); + end; +end; + +procedure TdxMasterViewReportLink.SetFixedTransparent(Value: Boolean); +begin + if FFixedTransparent <> Value then + begin + FFixedTransparent := Value; + LinkModified(True); + end; +end; + +procedure TdxMasterViewReportLink.SetPreviewLineCount(Value: Integer); +begin + if FPreviewLineCount < -1 then FPreviewLineCount := -1; + if FPreviewLineCount <> Value then + begin + FPreviewLineCount := Value; + LinkModified(True); + end; +end; + +procedure TdxMasterViewReportLink.SetOnCustomDrawCell(Value: TdxMVReportLinkCustomDrawCellEvent); +begin + if @FOnCustomDrawCell <> @Value then + begin + FOnCustomDrawCell := Value; + LinkModified(True); + end; +end; + +procedure TdxMasterViewReportLink.SetOnCustomDrawFooterCell(Value: TdxMVReportLinkCustomDrawFooterCellEvent); +begin + if @FOnCustomDrawFooterCell <> @Value then + begin + FOnCustomDrawFooterCell := Value; + LinkModified(True); + end; +end; + +procedure TdxMasterViewReportLink.SetOnCustomDrawHeaderCell(Value: TdxMVReportLinkCustomDrawHeaderCellEvent); +begin + if @FOnCustomDrawHeaderCell <> @Value then + begin + FOnCustomDrawHeaderCell := Value; + LinkModified(True); + end; +end; + +procedure TdxMasterViewReportLink.SetOnCustomDrawPreviewCell(Value: TdxMVReportLinkCustomDrawPreviewCellEvent); +begin + if @FOnCustomDrawPreviewCell <> @Value then + begin + FOnCustomDrawPreviewCell := Value; + LinkModified(True); + end; +end; + +procedure TdxMasterViewReportLink.InternalRestoreFromOriginal; + + procedure XorOption(var AOptions: TdxMasterViewPaintOptions; + AItem: TdxMasterViewPaintOption; AValue: Boolean); + begin + if AValue then + Include(AOptions, AItem) + else + Exclude(AOptions, AItem); + end; + + procedure SetColorAndFont(AStyle: TdxMasterViewStyle; AFont: TFont; var AColor: TColor); + begin + if AStyle <> nil then + begin + if svFont in AStyle.AssignedValues then AFont.Assign(AStyle.Font); + if svColor in AStyle.AssignedValues then AColor := AStyle.Color; + end; + end; + +var + Level: TdxMasterViewLevel; +begin + inherited; + + if (MasterView = nil) or (MasterView.Levels.Count = 0) then Exit; + + Level := MasterView.Levels[0]; + PreviewLineCount := Level.PreviewLineCount; + FGridLineColor := Level.GridLinesColor; + + Font := MasterView.Font; + + SetColorAndFont(Level.ContentStyle, Font, FColor); + SetColorAndFont(Level.HeaderStyle, HeaderFont, FHeaderColor); + SetColorAndFont(Level.PreviewStyle, PreviewFont, FPreviewColor); + SetColorAndFont(Level.GroupStyle, GroupNodeFont, FGroupNodeColor); + SetColorAndFont(Level.FooterStyle, FooterFont, FFooterColor); + SetColorAndFont(Level.CaptionStyle, CaptionNodeFont, FCaptionColor); + + XorOption(FOptions, mvpoHeaders, lovHeader in Level.OptionsView); + XorOption(FOptions, mvpoFooters, lovFooter in Level.OptionsView); + XorOption(FOptions, mvpoPreview, lovPreview in Level.OptionsView); + XorOption(FOptions, mvpoGrid, lovGrid in Level.OptionsView); + XorOption(FOptions, mvpoPreviewGrid, lovGridWithPreview in Level.OptionsView); +end; + +procedure TdxMasterViewReportLink.InternalRestoreDefaults; +begin + inherited; + + FAutoNodesExpand := False; + DrawMode := mvdmStrict; + FixedTransparent := False; + FOnlySelected := False; + Options := dxDefaultMasterViewPaintOptions; + FPreviewLineCount := -1; + FSupportedCustomDraw := False; + + FEvenColor := Color; + FGridLineColor := dxDefaultGridLineColor; + FGroupNodeColor := dxDefaultFixedColor; + FCaptionColor := dxDefaultFixedColor; + FHeaderColor := dxDefaultFixedColor; + FFooterColor := dxDefaultFixedColor; + FPreviewColor := Color; + + CaptionNodeFont := DefaultFont; + EvenFont := DefaultFont; + FooterFont := DefaultFont; + GroupNodeFont := DefaultFont; + HeaderFont := DefaultFont; + OddFont := DefaultFont; + PreviewFont := DefaultFont; + + FExtendedSelect := True; +end; + +function TdxMasterViewReportLink.GetEmptyPagesCanExist: Boolean; +begin + Result := True; +end; + +procedure TdxMasterViewReportLink.GetImageLists(AProc: TdxPSGetImageListProc); +var + I, J: Integer; + Level: TdxMasterViewLevel; + Column: TdxMasterViewColumn; +begin + inherited; + + for I := 0 to MasterView.AbsoluteLevelCount - 1 do + begin + Level := MasterView.AbsoluteLevels[I]; + for J := 0 to Level.ColumnCount - 1 do + begin + Column := Level.Columns[J]; + dxColumnHelpersFactory[Column].GetImageLists(Column, AProc); + end; + end; +end; + +procedure TdxMasterViewReportLink.MakeDelimiters(AReportCells: TdxReportCells; + AHorzDelimiters, AVertDelimiters: TList); + + procedure IterateChildrens(ACell: TdxReportCell); + var + I: Integer; + Cell: TdxReportCell; + begin + for I := 0 to ACell.CellCount - 1 do + begin + Cell := ACell[I]; + AVertDelimiters.Add(Pointer(Cell.AbsoluteOrigin.Y)); + if Cell.HasChildren then IterateChildrens(Cell); + end; + end; + +var + I, J: Integer; + Cell: TdxReportCell; +begin + inherited MakeDelimiters(AReportCells, AHorzDelimiters, AVertDelimiters); + if AReportCells.Cells.CellCount = 0 then Exit; + + // horizontally + if UseHorzDelimiters then + for I := 0 to FDelimitersCells.Count - 1 do + begin + Cell := TdxReportCell(FDelimitersCells.List^[I]); + for J := 0 to Cell.DataItemCount - 1 do + with Cell.DataItems[J] do + begin + AHorzDelimiters.Add(Pointer(AbsoluteOrigin.X)); + AHorzDelimiters.Add(Pointer(AbsoluteOrigin.X + Width)); + end; + end; + + //vertically + if UseVertDelimiters then + IterateChildrens(AReportCells.Cells); +end; + +function TdxMasterViewReportLink.GetDataClass(ANode: TdxMasterViewNode; + AColumn: TdxMasterViewColumn; ACellType: TdxMasterViewLinkCellType): TdxReportCellDataClass; +const + CheckClasses: array[Boolean] of TdxReportCellDataClass = (TdxReportCellCheckImage, TdxReportCellString); + ImageClasses: array[Boolean] of TdxReportCellDataClass = (TdxReportCellGraphic, TdxReportCellImage); + GraphicClasses: array[Boolean] of TdxReportCellDataClass = (TdxReportCellString, TdxReportCellGraphic); +begin + case ACellType of + mvctCell: + if ANode.NodeType in [ntCaption, ntGroup] then + Result := TdxReportCellString + else + if AColumn is TdxMasterViewCheckColumn then + Result := CheckClasses[mvpoCheckMarksAsText in Options] + else + if AColumn is TdxMasterViewImageColumn then + Result := ImageClasses[TdxMasterViewImageColumn(AColumn).ShowDescription] + else + Result := GraphicClasses[(AColumn is TdxMasterViewGraphicColumn) and not (mvpoGraphicAsText in Options)]; + mvctFooter, + mvctPreview: + Result := TdxReportCellString; + mvctHeader: + Result := TdxReportCellImage; + else + Result := TdxReportCellString; + end; +end; + +procedure TdxMasterViewReportLink.AssignValues(ADataItem: TAbstractdxReportCellData; + ANode: TdxMasterViewNode; AColumn: TdxMasterViewColumn; ACellType: TdxMasterViewLinkCellType); +const + SortOrderMap: array[TdxMasterViewSortOrder] of TdxCellSortOrder = (csoNone, csoUp, csoDown); +var + AState: TdxMVCheckState; + ANullStyle: TdxMVShowNullFieldStyle; + AGraphicClass: TGraphicClass; +begin + if ADataItem is TdxReportCellCheck then + begin + with TdxMasterViewCheckColumnAccess(AColumn) do + begin + AState := GetCheckState(ANode.Strings[Index]); + ANullStyle := ShowNullFieldStyle; + end; + with TdxReportCellCheck(ADataItem) do + begin + Enabled := not ((AState = csInactive) and (ANullStyle > nfsUnchecked)); + Checked := (AState = csChecked) or + ((AState = csInactive) and (ANullStyle = nfsGrayedChecked)); + FlatBorder := FlatCheckMarks; + end; + Exit; + end; + + if ADataItem is TdxReportCellImage then + begin + with TdxReportCellImage(ADataItem) do + begin + if ACellType = mvctCell then + begin + ImageIndex := TdxMasterViewImageColumnAccess(AColumn).GetItemIndex(ANode); + ImageList := TdxMasterViewImageColumn(AColumn).Images; + Multiline := AColumn.Multiline; + if (ImageIndex > -1) and (ImageIndex < TdxMasterViewImageColumn(AColumn).Items.Count) then + Text := TdxMasterViewImageColumn(AColumn).Items.Descriptions[ImageIndex]; + TextAlignX := dxTextAlignX[AColumn.Alignment]; + end + else + begin + if not AColumn.HeaderGlyph.Empty then + begin + Image := AColumn.HeaderGlyph; + ImageLayout := dxImageLayout[AColumn.HeaderGlyphAlignment] + end; + Multiline := False; + Text := AColumn.Caption; + SortOrder := SortOrderMap[AColumn.SortOrder]; + TextAlignX := dxTextAlignX[AColumn.HeaderAlignment]; + end; + EndEllipsis := movDrawEndEllipsis in MasterView.OptionsView; + ImageTransparent := True; + MakeSpaceForEmptyImage := ACellType = mvctCell; + TextAlignY := dxMultilineTextAlignY[Multiline]; + end; + Exit; + end; + + if ADataItem is TdxReportCellGraphic then + begin + if AColumn is TdxMasterViewImageColumn then {ShowDescription} + with TdxReportCellGraphic(ADataItem) do + begin + DrawMode := gdmCenter; + ImageIndex := TdxMasterViewImageColumnAccess(AColumn).GetItemIndex(ANode); + ImageList := TdxMasterViewImageColumn(AColumn).Images; + end + else + begin + AGraphicClass := TdxMasterViewGraphicColumnAccess(AColumn).GetGraphicClass(ANode); + TdxMasterViewGraphicColumnAccess(AColumn).LoadPicture(AGraphicClass, ANode.Values[AColumn.Index]); + with TdxReportCellGraphic(ADataItem) do + begin + Image := TdxMasterViewGraphicColumn(AColumn).Picture.Graphic; + ImageTransparent := TransparentColumnGraphics; + if AGraphicClass = nil then AGraphicClass := TBitmap; + if not AGraphicClass.InheritsFrom(TIcon) and TdxMasterViewGraphicColumn(AColumn).Stretch then + DrawMode := gdmStretchProportional + else + DrawMode := gdmNone; + end + end; + Exit; + end; + + if ADataItem is TdxReportCellString then + begin + with TdxReportCellString(ADataItem) do + begin + if ACellType = mvctFooter then + begin + Multiline := False; + Text := ExposeColumn(AColumn).GetFooterText(ANode); + TextAlignX := dxTextAlignX[AColumn.FooterAlignment]; + end + else + begin + if AColumn is TdxMasterViewGraphicColumn then + Text := cxGetResourceString(@sdxGraphicAsTextValue) + else + begin + Multiline := AColumn.Multiline; + if Multiline then + Text := ANode.Values[AColumn.Index] + else + Text := ANode.Strings[AColumn.Index]; + end; + TextAlignX := dxTextAlignX[AColumn.Alignment]; + end; + EndEllipsis := movDrawEndEllipsis in MasterView.OptionsView; + TextAlignY := dxMultilineTextAlignY[Multiline]; + end; + Exit; + end +end; + +procedure TdxMasterViewReportLink.PrepareData(Value: Boolean); +begin + if Value and AutoNodesExpand then + MasterView.Items.LoadChildren(True); +end; + +procedure TdxMasterViewReportLink.PrepareConstruct(AReportCells: TdxReportCells); +var + DC: HDC; +begin + DC := GetDC(0); + try + FLineHeight := Renderer.CalcTextPatternHeight(DC, Font); + FHeaderLineHeight := Renderer.CalcTextPatternHeight(DC, HeaderFont); + FFooterLineHeight := Renderer.CalcTextPatternHeight(DC, FooterFont) + 2 * Byte(ShowGroupFooterGrid); + FLevelCaptionHeight := Renderer.CalcTextPatternHeight(DC, CaptionNodeFont); + FGroupNodeHeight := Renderer.CalcTextPatternHeight(DC, GroupNodeFont); + FPreviewLineHeight := Renderer.CalcTextPatternHeight(DC, PreviewFont); + finally + ReleaseDC(0, DC); + end; + + FIndent := 19; + + PrepareData(True); + CalcFontIndexes(AReportCells); + LoadColumnPlaces; + AddNodes; + FDelimitersCells.Clear; + if IsExistSelectedNodes then + begin + FSelectedNodes := TList.Create; + BuildSelectedNodeList; + end; +end; + +procedure TdxMasterViewReportLink.UnprepareConstruct(AReportCells: TdxReportCells); +begin + FreeAndNil(FSelectedNodes); + FreeFontIndexes; + FreeColumnPlaces; + PrepareData(False); +end; + +procedure TdxMasterViewReportLink.CalcFontIndexes(AReportCells: TdxReportCells); +begin + FCaptionNodeFontIndex := AddFontToPool(CaptionNodeFont); + FEvenFontIndex := AddFontToPool(EvenFont); + FGroupNodeFontIndex := AddFontToPool(GroupNodeFont); + FFooterFontIndex := AddFontToPool(FooterFont); + FHeaderFontIndex := AddFontToPool(HeaderFont); + FOddFontIndex := AddFontToPool(OddFont); + FPreviewFontIndex := AddFontToPool(PreviewFont); + + if DrawMode = mvdmBorrowSource then + LoadFontIndexes(AReportCells); +end; + +procedure TdxMasterViewReportLink.LoadFontIndexes(AReportCells: TdxReportCells); +var + I, Index: Integer; + F: TFont; + Style: TdxMasterViewStyle; +begin + FFonts := TList.Create; + FFonts.Capacity := 1 + MasterView.StyleCount; + + FFontIndexes := TList.Create; + FFontIndexes.Capacity := 1 + MasterView.StyleCount; + + F := MasterView.Font; + FFonts.Add(F); + Index := AddFontToPool(F); + FFontIndexes.Add(Pointer(Index)); + + for I := 0 to MasterView.StyleCount - 1 do + begin + Style := MasterView.Styles[I]; + if svFont in Style.AssignedValues then + begin + F := Style.Font; + FFonts.Add(F); + Index := AddFontToPool(F); + FFontIndexes.Add(Pointer(Index)); + end; + end; +end; + +procedure TdxMasterViewReportLink.FreeFontIndexes; +begin + FreeAndNil(FFontIndexes); + FreeAndNil(FFonts); +end; + +procedure TdxMasterViewReportLink.LoadColumnPlaces; +var + I: Integer; + List: TList; + Level: TdxMasterViewLevelAccess; +begin + FLevels := TList.Create; + FLevels.Capacity := MasterView.AbsoluteLevelCount; + FColumnPlaces := TList.Create; + FColumnPlaces.Capacity := FLevels.Capacity; + for I := 0 to MasterView.AbsoluteLevelCount - 1 do + begin + Level := ExposeLevel(MasterView.AbsoluteLevels[I]); + FLevels.Add(Level); + Level.SaveVisibleColumnsPlaces(List); + FColumnPlaces.Add(List); + end; +end; + +procedure TdxMasterViewReportLink.FreeColumnPlaces; +var + I: Integer; + Level: TdxMasterViewLevelAccess; + ColumnPlace: TList; +begin + if FColumnPlaces <> nil then + begin + for I := 0 to FColumnPlaces.Count - 1 do + begin + Level := FLevels.List^[I]; + ColumnPlace := FColumnPlaces.List^[I]; + Level.FreeVisibleColumnsPlaces(ColumnPlace); + end; + FreeAndNil(FColumnPlaces); + end; + FreeAndNil(FLevels); +end; + +function TdxMasterViewReportLink.NodeExpanded(ANode: TdxMasterViewNode): Boolean; +begin + Result := ANode.Expanded or (AutoNodesExpand and ExposeNode(ANode).CanExpand); +end; + +procedure TdxMasterViewReportLink.AddNodes; + + procedure AddNode(ANode: TdxMasterViewNode); + var + I: Integer; + Node: TdxMasterViewNode; + begin + for I := 0 to ANode.Count - 1 do + begin + Node := ANode[I]; + if not IsExistSelectedNodes or IsSelectedNode(Node) then + FNodes.Add(Node); + if NodeExpanded(Node) then + AddNode(Node); + end; + end; + +begin + FNodes.Clear; + if not AutoNodesExpand then + if OnlySelected then + FNodes.Capacity := MasterView.SelectedItemCount + else + FNodes.Capacity := MasterView.AbsoluteItemCount; + AddNode(MasterView.Items); +end; + +function SortFunc(AItem1, AItem2: Pointer): Integer; +begin + Result := Integer(TdxMasterViewNode(AItem1).ParentNode) - Integer(TdxMasterViewNode(AItem2).ParentNode); + if Result = 0 then + Result := TdxMasterViewNode(AItem1).Index - TdxMasterViewNode(AItem2).Index; +end; + +procedure TdxMasterViewReportLink.BuildSelectedNodeList; +var + I: Integer; + Node, TestNode: TdxMasterViewNode; +begin + for I := 0 to MasterView.SelectedItemCount - 1 do + FSelectedNodes.Add(MasterView.SelectedItems[I]); + FSelectedNodes.Sort(SortFunc); + Node := nil; + for I := 0 to FSelectedNodes.Count - 1 do + begin + TestNode := FSelectedNodes.List^[I]; + if (Node <> nil) and (TestNode.ParentNode = Node.ParentNode) then + FSelectedNodes[I] := nil + else + Node := TestNode; + end; + FSelectedNodes.Pack; +end; + +procedure TdxMasterViewReportLink.ConstructReport(AReportCells: TdxReportCells); + + function CalcPreviewHeight(const S: string; AWidth: Integer): Integer; + var + DC: hDC; + //PrevFont: HFONT; + R: TRect; + begin + R := Rect(0, 0, AWidth, 0); + DC := GetDC(0); + Result := Renderer.CalcTextRect(DC, S, R, True, PreviewFont); + {PrevFont := SelectObject(DC, PreviewFont.Handle); + Result := 2 + Windows.DrawText(DC, PChar(S), Length(S), R, CalcFormat); + SelectObject(DC, PrevFont);} + ReleaseDC(0, DC); + end; + + function GetPreviewHeight(const S: string; AWidth: Integer): Integer; + begin + if AutoCalcPreviewLines then + if S <> '' then + Result := CalcPreviewHeight(S, AWidth) + else + Result := 0 + else + Result := PreviewLineCount * FPreviewLineHeight; + end; + + function GetItemHeight(ANode: TdxMasterViewNode; ACellType: TdxMasterViewLinkCellType; + AFullHeight: Boolean; AWidth: Integer; APreviewHeight: PInteger): Integer; + var + ALineHeight: Integer; + begin + case ANode.NodeType of + ntData: + begin + case ACellType of + mvctCell: + ALineHeight := FLineHeight; + mvctFooter: + ALineHeight := FFooterLineHeight; + mvctHeader: + ALineHeight := FHeaderLineHeight; + else + ALineHeight := FLineHeight; + end; + if AFullHeight then + Result := ANode.Level.Layout.RowCount * ALineHeight + else + Result := ALineHeight; + if APreviewHeight <> nil then + begin + APreviewHeight^ := GetPreviewHeight(ANode.PreviewText, + AWidth - ANode.Level.PreviewLeftIndent); + if AFullHeight then Inc(Result, APreviewHeight^); + end; + end; + ntCaption: + Result := FLevelCaptionHeight; + ntGroup: + Result := FGroupNodeHeight; + else + Result := FLevelCaptionHeight; + end; + end; + + function IsGridExists(ANode: TdxMasterViewNode): Boolean; + begin + Result := ((ANode.PreviewText <> '') and (lovGridWithPreview in ANode.Level.OptionsView)) or + (lovGrid in ANode.Level.OptionsView) + end; + + function GetParentLevelsSeparatorWidth(ALevel: TdxMasterViewLevel): Integer; + begin + Result := 0; + while ALevel <> nil do + begin + Inc(Result, ALevel.LevelSeparatorWidth); + ALevel := ALevel.Parent; + end; + end; + + function GetLevelWidth(ALevel: TdxMasterViewLevel): Integer; + var + {Decrease, }Increase: Integer; + begin + {ver 2.3} +// Decrease := -2; + Result := ALevel.Layout.VisibleWidth + {ver 2.3} GetParentLevelsSeparatorWidth(ALevel.Parent); + repeat + Increase := ALevel.GroupColumnCount; + if lovCaption in ALevel.OptionsView then + Inc(Increase); + if ALevel.Parent <> MasterView.Levels then + Inc(Increase); + Inc(Result, FIndent * Increase); +// if not (lovGrid in ALevel.Parent.OptionsView) then Dec(Result); + {ver 2.3} +// Inc(Decrease); + ALevel := ALevel.Parent; + until ALevel = MasterView.Levels; + {ver 2.3} + {if Decrease > 0 then + Dec(Result, Decrease) + else + Inc(Result, Decrease);} + end; + + function CanShowPreviewGrid(ANode: TdxMasterViewNode): Boolean; + begin + Result := ShowGrid(ANode) and ShowPreviewGrid(ANode); + end; + + function CanShowGroupFooterGrid(ANode: TdxMasterViewNode): Boolean; + begin + Result := ShowGrid(ANode) and ShowGroupFooterGrid; + end; + + function GetDataItemSides(ANode: TdxMasterViewNode; AColumnPlace: PColumnPlace; + ACellType: TdxMasterViewLinkCellType): TdxCellSides; + begin + Result := []; + case ACellType of + mvctCell: + case ANode.NodeType of + ntData: + if CanShowPreviewGrid(ANode) then + begin + Result := csAll; + if AColumnPlace^.ColIndex = 0 then Result := Result - [csLeft]; + end + else + begin + if ANode.Level.Layout.IsColumnLast(AColumnPlace^.Column) or (ANode.Level.ViewMode = vmVertical) then + Result := Result + [csRight]; + if ShowGrid(ANode) then + begin + if AColumnPlace^.RowIndex = 0 then + Result := Result + [csTop]; + if (not ShowPreview(ANode) or (FPreviewLineCount = 0) or (ANode.Level.ViewMode = vmVertical)) and + // (ANode.Count > 0) and + ((AColumnPlace^.RowIndex + AColumnPlace^.RowCount) = ANode.Level.Layout.RowCount) then + Result := Result + [csBottom]; + end; + end; + ntGroup, + ntCaption: + if CanShowPreviewGrid(ANode) then Result := csAll - [csLeft]; + end; + + mvctPreview: + begin + Result := [csRight]; + if ShowGrid(nil) then + begin + Result := Result + [csBottom]; + if ShowPreviewGrid(ANode) then Result := Result + [csTop]; + end; + end; + + mvctHeader: + Result := csAll; + + mvctFooter: + if CanShowGroupFooterGrid(ANode) then Result := csAll; + end; + end; + + function GetDataItemRect(ANode: TdxMasterViewNode; AColumnPlace: PColumnPlace; + ACell: TdxReportCell; ACellType: TdxMasterViewLinkCellType): TRect; + var + AColumn: TdxMasterViewColumnAccess; + ALineHeight, ANodeLevelIndex, ColIndex: Integer; + Layout: TdxMasterViewLayout; + begin + AColumn := nil; + ColIndex := 0; + if AColumnPlace <> nil then + begin + AColumn := ExposeColumn(AColumnPlace^.Column); + ColIndex := AColumnPlace^.ColIndex; + end; + ANodeLevelIndex := ExposeNode(ANode).GetLevelIndex; + ALineHeight := GetItemHeight(ANode, ACellType, False, 0, nil); + Result := Rect(0, 0, 0, 0); + with Result do + begin + if AColumn <> nil then + begin + Left := AColumn.Offset + MasterView.LeftPos - GetParentLevelsSeparatorWidth(ANode.Level.Parent); + //Inc(Left, ANodeLevelIndex); + + // v 2.3 + //if (ACellType in [mvctCell, mvctHeader]) and (ANode.Level.ViewMode = vmVertical) then + // Inc(Left, 1 + ANodeLevelIndex); + + if not IsGridExists(ANode) then + Inc(Left); + + if (ACellType = mvctCell) and (ANode.NodeType = ntData) and + (ANode.Level.ViewMode = vmHorizontal) and (ColIndex = 0) and + ExposeNode(ANode).HasExpandButton then + Inc(Left, FIndent); + + Top := AColumnPlace^.RowIndex * ALineHeight; + Bottom := Top + AColumnPlace^.RowCount * ALineHeight; + if ANode.Level.ViewMode = vmHorizontal then + begin + Right := Left + AColumn.VisibleWidth; + if (ACellType = mvctCell) and (ANode.NodeType = ntData) and + ExposeNode(ANode).HasExpandButton and (ColIndex = 0) then + Dec(Right, FIndent); + if AColumn.Level.Layout.IsColumnLast(AColumn) then + Right := ACell.BoundsRect.Right; + end + else + begin + Layout := ANode.Level.Layout; + if ACellType in [mvctCell, mvctFooter] then + begin + if ShowHeaders(ANode) then + Inc(Left, Layout.HeaderWidths[ColIndex]); + Right := Left + Layout.ContentWidths[ColIndex]; + if not ShowHeaders(ANode) then + Inc(Right, Layout.HeaderWidths[ColIndex]); + end + else + Right := Left + Layout.HeaderWidths[ColIndex]; + end + end + else + begin + Right := Left + GetLevelWidth(ANode.Level); + Bottom := Top + ACell.Height; + end; + if ANode.NodeType > ntData then + Inc(Left, FIndent * (ANodeLevelIndex + 1)); + end; + + if ACellType = mvctFooter then + begin + OffsetRect(Result, -ACell.Left, 0); + InflateRect(Result, -2, -2); + //if Use3DEffects then OffsetRect(Result, 0, -1); + end; + + if Use3DEffects and (ACellType in [mvctFooter{, mvctHeader}]) then //2.3 + begin + Inc(Result.Left); + Inc(Result.Top); + end; + end; + + function GetPreviewRect(ANode: TdxMasterViewNode; ACell: TdxReportCell): TRect; + begin + with Result do + begin + Left := FIndent * ExposeNode(ANode).GetLevelIndex; + if (ANode.NodeType = ntData) and ExposeNode(ANode).HasExpandButton then + Inc(Left, FIndent); + Top := ACell.Height - FPreviewFullHeight; + Right := ACell.Width; + Bottom := ACell.Height; + end; + end; + + function GetNodeFontIndex(ANode: TdxMasterViewNode; AIsOdd, ADirect: Boolean): Integer; + begin + case ANode.NodeType of + ntData: + if ADirect then + Result := FFontIndex + else + if AIsOdd then + Result := FOddFontIndex + else + Result := FEvenFontIndex; + ntCaption: + Result := FCaptionNodeFontIndex; + else {ntGroup} + Result := FGroupNodeFontIndex; + end; + end; + + function GetFontIndex(AFont: TFont): Integer; + var + Index: Integer; + begin + Index := FFonts.IndexOf(AFont); + if Index > -1 then + Result := Integer(FFontIndexes.List^[Index]) + else + Result := FFontIndex; + end; + + function GetCellFontIndex(ANode: TdxMasterViewNode; AColumn: TdxMasterViewColumn; + ACellType: TdxMasterViewLinkCellType; AIsOdd: Boolean): Integer; + begin + case ACellType of + mvctCell, + mvctPreview: + case DrawMode of + mvdmStrict: + if ACellType = mvctPreview then + Result := FPreviewFontIndex + else + Result := GetNodeFontIndex(ANode, AIsOdd, True); + mvdmOddEven: + if ACellType = mvctPreview then + Result := FPreviewFontIndex + else + Result := GetNodeFontIndex(ANode, AIsOdd, False); + else {mvdmBorrowSource} + if ACellType = mvctPreview then + Result := GetFontIndex(ExposeLevel(ANode.Level).PreviewFont) + else + if AColumn <> nil then + Result := GetFontIndex(ExposeColumn(AColumn).ContentFont) + else + case ANode.NodeType of + ntData: + Result := GetFontIndex(ExposeLevel(ANode.Level).ContentFont); + ntCaption: + Result := GetFontIndex(ExposeLevel(ANode.Level).CaptionFont); + else {ntGroup} + Result := GetFontIndex(ExposeLevel(ANode.Level).GroupFont); + end; + end; + mvctHeader: + if DrawMode < mvdmBorrowSource then + Result := FHeaderFontIndex + else + if AColumn <> nil then + Result := GetFontIndex(ExposeColumn(AColumn).HeaderFont) + else + Result := GetFontIndex(ExposeLevel(ANode.Level).HeaderFont); + mvctFooter: + if DrawMode < mvdmBorrowSource then + Result := FFooterFontIndex + else + if AColumn <> nil then + Result := GetFontIndex(ExposeColumn(AColumn).FooterFont) + else + Result := GetFontIndex(ExposeLevel(ANode.Level).FooterFont); + else + Result := 0; + end; + end; + + function GetNodeColor(ANode: TdxMasterViewNode; AIsOdd, ADirect: Boolean): TColor; + begin + case ANode.NodeType of + ntData: + if ADirect then + Result := Color + else + if AIsOdd then + Result := OddColor + else + Result := EvenColor; + ntCaption: + Result := CaptionColor; + else {ntGroup} + Result := GroupNodeColor; + end; + end; + + function GetCellColor(ANode: TdxMasterViewNode; AColumn: TdxMasterViewColumn; + ACellType: TdxMasterViewLinkCellType; AIsOdd: Boolean): TColor; + var + IsOdd: Boolean; + begin + case ACellType of + mvctCell, + mvctPreview: + case DrawMode of + mvdmStrict: + if ACellType = mvctPreview then + Result := PreviewColor + else + Result := GetNodeColor(ANode, AIsOdd, True); + mvdmOddEven: + Result := GetNodeColor(ANode, AIsOdd, False); + + else {mvdmBorrowSource} + begin + IsOdd := Odd(ANode.Index) and (ANode.NodeType = ntData); + if ACellType = mvctPreview then + begin + if IsOdd then + begin + Result := ExposeLevel(ANode.Level).PreviewAnotherColor; + if Result = clNone then + Result := ExposeLevel(ANode.Level).PreviewColor; + end + else + Result := ExposeLevel(ANode.Level).PreviewColor + end + else + begin + if AColumn <> nil then + begin + if IsOdd then + begin + Result := ExposeColumn(AColumn).ContentAnotherColor; + if Result = clNone then + Result := ExposeLevel(ANode.Level).ContentColor; + end + else + Result := ExposeColumn(AColumn).ContentColor + end + else + begin + case ANode.NodeType of + ntData: + if IsOdd then + begin + Result := ExposeLevel(ANode.Level).ContentAnotherColor; + if Result = clNone then + Result := ExposeLevel(ANode.Level).ContentColor; + end + else + Result := ExposeLevel(ANode.Level).ContentColor; + ntCaption: + Result := ExposeLevel(ANode.Level).CaptionColor; + else {ntGroup} + Result := ExposeLevel(ANode.Level).GroupColor; + end; + end; + end; + end; + end; + + mvctHeader: + if DrawMode < mvdmBorrowSource then + Result := HeaderColor + else + if AColumn <> nil then + Result := ExposeColumn(AColumn).HeaderColor + else + Result := ExposeLevel(ANode.Level).HeaderColor; + + mvctFooter: + if DrawMode < mvdmBorrowSource then + Result := FooterColor + else + if AColumn <> nil then + Result := ExposeColumn(AColumn).FooterColor + else + Result := ExposeLevel(ANode.Level).FooterColor; + else + Result := Color; + end; + Result := ColorToRGB(Result); + end; + + function IsCellTransparent(ANode: TdxMasterViewNode; AColumn: TdxMasterViewColumn; + ACellType: TdxMasterViewLinkCellType; AIsOdd: Boolean): Boolean; + begin + if DrawMode < mvdmBorrowSource then + if (ANode.NodeType = ntData) and (ACellType in [mvctCell, mvctPreview]) then + Result := Transparent + else + Result := FixedTransparent + else + Result := ColorToRGB(GetCellColor(ANode, AColumn, ACellType, AIsOdd)) = ColorToRGB(Color); + end; + + function FirstInSelection(ANode: TdxMasterViewNode): Boolean; + begin + Result := FSelectedNodes.IndexOf(ANode) <> -1; + end; + + function CanDrawHeaders(ANode: TdxMasterViewNode): Boolean; + begin + with ANode do + Result := ShowHeaders(ANode) and (NodeType = ntData) and (ANode.Level.ViewMode = vmHorizontal) and + ( + (([lohForFirstNode, lohForFirstVisibleNode] * Level.OptionsHeader <> []) and + (IsFirstInLevel or (IsExistSelectedNodes and FirstInSelection(ANode))) + ) + or + (([lohAfterExpandedNode] * Level.OptionsHeader <> []) and + (IsFirstInLevel or NodeExpanded(ParentNode[Index - 1]))) + ); + end; + + function CanDrawFooters(ANode: TdxMasterViewNode): Boolean; + begin + with ExposeNode(ANode) do + Result := ShowFooters(ANode) and (NodeType in [ntData, ntCaption]) and IsLastInLevel and + (not Expanded and (not AutoNodesExpand or not CanExpand)); + end; + + function GetNodeFooterCount(ANode: TdxMasterViewNode): Integer; + var + FooterSize, EndLevelCount, EndLevelData, I: Integer; + + function HasFooter(AParentIndex: Integer): Boolean; + var + Level: TdxMasterViewLevelAccess; + begin + Result := (FooterSize <> 0) and ((AParentIndex <> 0) or (ANode.NodeType = ntData)); + if Result and (AParentIndex <> -1) then + begin + Level := ExposeLevel(ANode.Level); + with ExposeLevel(Level.Parents[AParentIndex]) do + Result := ShowFooter and (AParentIndex < EndLevelCount); + end; + end; + + begin + ExposeNode(ANode).EndLevel(FooterSize, EndLevelCount, EndLevelData); + Result := 0; + for I := 0 to EndLevelCount - 1 do + if HasFooter(I) then Inc(Result); + end; + + function GetIndentCellSides(ANode: TdxMasterViewNode; + ACellType: TdxMasterViewLinkCellType; ALevelIndex, ACurrentIndex: Integer): TdxCellSides; + var + ParentNode: TdxMasterViewNode; + begin + Result := []; + if ShowGrid(nil) then + begin + Result := [csLeft]; + if (ACurrentIndex < ALevelIndex) or (ANode.NodeType = ntData) then + Result := Result + [csRight]; + + if (ACellType = mvctCell) and (ACurrentIndex = ALevelIndex) and + (ANode.NodeType in [ntCaption, ntGroup]) then + Result := Result + [csTop]; + + ParentNode := ANode.ParentNodes[ALevelIndex - ACurrentIndex - Byte(ANode.NodeType <> ntData)]; + if ACellType = mvctCell then + begin + if not NodeExpanded(ParentNode) then + if ANode.NodeType = ntData then + begin + if ParentNode.IsLast and (not CanDrawFooters(ANode) or (GetNodeFooterCount(ANode) = 0)) then + Result := Result + [csBottom] + end + else + if (ACurrentIndex = ALevelIndex) or ParentNode.IsLast then + Result := Result + [csBottom] + end + else + if (ACellType = mvctFooter) and (ACurrentIndex = ALevelIndex) and ANode.Level.IsLast then + Result := Result + [csBottom]; + end + else + if ACurrentIndex = 0 then Result := [csLeft]; + end; + + procedure SetupExpandButtons(ANode: TdxMasterViewNode; AItem: TdxReportCellExpandButton; AShowButton: Boolean); + begin + with AItem do + begin + ShowButton := AShowButton; + if ShowButton then + begin + ButtonBorder3D := Use3DEffects; + ButtonBorder3DSoft := Use3DEffects and UseSoft3D; + ButtonTransparent := False; + ButtonInteriorColor := clBtnFace; + ButtonExpanded := NodeExpanded(ANode); + if ButtonBorder3D then + if ButtonBorder3DSoft then + ButtonSize := 11 + else + ButtonSize := 12 + else + ButtonSize := 11; + end; + end; + end; + + function DrawIndent(ANode: TdxMasterViewNode; ACell: TdxReportCell; + ACellType: TdxMasterViewLinkCellType; AIsOdd: Boolean): Integer; + var + I, L, LevelIndex: Integer; + Item: TdxReportCellExpandButton; + B, IsOdd: Boolean; + PrevSibl: TdxReportItem; + ParentNode: TdxMasterViewNode; + begin + LevelIndex := ExposeNode(ANode).GetLevelIndex; + if ANode.NodeType = ntData then + Dec(LevelIndex); + + for I := 0 to LevelIndex do + begin + Item := TdxReportCellExpandButton.Create(ACell); + with Item do + begin + L := 0; + PrevSibl := GetPrevSibling; + if PrevSibl <> nil then + L := TdxReportVisualItem(PrevSibl).BoundsRect.Right; + BoundsRect := Rect(L, 0, L + FIndent, ACell.Height); + ParentNode := ANode.ParentNodes[LevelIndex - I + Byte(ANode.NodeType = ntData)]; + IsOdd := Odd(ParentNode.Index) and (ParentNode.NodeType = ntData); + Transparent := IsCellTransparent(ParentNode, nil, mvctCell, IsOdd); + Color := GetCellColor(ParentNode, nil, mvctCell, IsOdd); + CellSides := GetIndentCellSides(ANode, ACellType, LevelIndex, I); + + // 2.3 expand buttons + B := ShowExpandButtons and (I = LevelIndex) and + (ANode.NodeType in [ntCaption, ntGroup]) and + ExposeNode(ANode).HasExpandButton and ExposeNode(ANode).ShowExpandButton; + SetupExpandButtons(ANode, Item, B); + end; + end; + + if (ACellType = mvctCell) and (ANode.NodeType = ntData) and + (ExposeNode(ANode).HasExpandButton or NodeExpanded(ANode)) then + begin + Item := TdxReportCellExpandButton.Create(ACell); + with Item do + begin + L := 0; + PrevSibl := GetPrevSibling; + if PrevSibl <> nil then + L := TdxReportVisualItem(PrevSibl).BoundsRect.Right; + BoundsRect := + Rect(L, 0, L + FIndent, ACell.Height); + CellSides := [csLeft]; + if ShowGrid(ANode) then + begin + CellSides := CellSides + [csTop]; + if {ANode.IsLast or }not NodeExpanded(ANode) then + CellSides := CellSides + [csBottom]; + if ANode.Level.ViewMode = vmVertical then + CellSides := CellSides + [csRight]; + end; + Transparent := IsCellTransparent(ANode, nil, mvctCell, AIsOdd); + Color := GetCellColor(ANode, nil, mvctCell, AIsOdd); + + // 2.3 expand buttons + B := ShowExpandButtons and ExposeNode(ANode).HasExpandButton and ExposeNode(ANode).ShowExpandButton; + SetupExpandButtons(ANode, Item, B); + end; + end; + + Result := FIndent * (LevelIndex + Byte(ANode.NodeType = ntData)); + end; + + procedure Setup3DEffects(AItem: TdxReportVisualItem; ACellType: TdxMasterViewLinkCellType); + begin + with AItem do + if Use3DEffects then + begin + EdgeMode := cem3DEffects; + case ACellType of + mvctFooter: + if AItem is TdxReportCell then + begin + Edge3DStyle := cesRaised; + Edge3DSoft := UseSoft3D; + end + else + begin + Edge3DStyle := cesSunken; + Edge3DSoft := True; + end; + mvctHeader: + begin + Edge3DStyle := cesRaised; + Edge3DSoft := UseSoft3D; + end + end; + end + else + EdgeMode := cemPattern; + end; + + procedure ProcessCells(ANode: TdxMasterViewNode; AParent: TdxReportCell; + ACellType: TdxMasterViewLinkCellType; AIsOdd: Boolean); + var + I, L, ACellHeight: Integer; + R: TRect; + ADataClass: TdxReportCellDataClass; + ADataItem: TAbstractdxReportCellData; + ACell: TdxReportCell; + APrevSibl: TdxReportItem; + AColumn, AGroupColumn: TdxMasterViewColumn; + AColumnPlaces: TList; + AColumnPlace: PColumnPlace; + begin + if ShowPreview(ANode) and (ACellType = mvctCell) and (ANode.NodeType = ntData) then + begin + L := GetLevelWidth(ANode.Level); + ACellHeight := GetItemHeight(ANode, ACellType, True, L, @FPreviewFullHeight); + end + else + begin + ACellHeight := GetItemHeight(ANode, ACellType, True, 0, nil); + FPreviewFullHeight := 0; + end; + + ACell := TdxReportCell.Create(AParent); + with ACell do + begin + BoundsRect := Rect(0, 0, GetLevelWidth(ANode.Level), ACellHeight); + APrevSibl := GetPrevSibling; + if APrevSibl <> nil then + Top := TdxReportCell(APrevSibl).BoundsRect.Bottom; + CellSides := [csLeft, csRight]; + if ANode = FNodes.List^[0] then + CellSides := CellSides + [csTop]; + Transparent := {False;//} True; //??? rest spaces in column and data areas if ones exist must be drawn with special colors + if IsSupportedCustomDraw(nil) and ((ACellType <> mvctHeader) or (ANode.Level.ViewMode = vmVertical)) then + Data := Integer(ANode); + end; + + L := DrawIndent(ANode, ACell, ACellType, AIsOdd); + + if ACellType = mvctFooter then + begin + ACell := TdxReportCell.Create(ACell); + with ACell do + begin + R := Rect(L, 0, Parent.BoundsRect.Right, ACellHeight); + { 2.3 + if Use3DEffects then + begin + Inc(R.Left); + Inc(R.Top); + end;} + BoundsRect := R; + APrevSibl := GetPrevSibling; + if APrevSibl <> nil then + Top := TdxReportCell(APrevSibl).BoundsRect.Bottom; + CellSides := csAll; + Transparent := FixedTransparent; + if not Transparent then + Color := GetCellColor(ANode, nil, mvctFooter, False); + if Use3DEffects then + Setup3DEffects(ACell, ACellType); + if IsSupportedCustomDraw(nil) then + Data := Integer(ANode); + end; + end; + + case ANode.NodeType of + ntData: + begin + if (ACellType = mvctHeader) or (ANode.Level.ViewMode = vmVertical) or + (not ShowHeaders(ANode) and ANode.IsFirstinLevel) then + FDelimitersCells.Add(ACell); + + AColumnPlaces := FColumnPlaces.List^[FLevels.IndexOf(ANode.Level)]; + + for I := 0 to AColumnPlaces.Count - 1 do + begin + AColumnPlace := AColumnPlaces.List^[I]; + AColumn := AColumnPlace^.Column; + if (ACellType = mvctFooter) and (AColumn.SummaryType = dxMasterView.stNone) then + Continue; + ADataClass := GetDataClass(ANode, AColumn, ACellType); + if ADataClass = nil then Continue; + + ADataItem := ADataClass.Create(ACell); + AssignValues(ADataItem, ANode, AColumn, ACellType); + ADataItem.CellSides := + GetDataItemSides(ANode, AColumnPlace, ACellType); + ADataItem.BoundsRect := + GetDataItemRect(ANode, AColumnPlace, ACell, ACellType); + ADataItem.Transparent := + IsCellTransparent(ANode, AColumn, ACellType, AIsOdd); + if not ADataItem.Transparent then + ADataItem.Color := GetCellColor(ANode, AColumn, ACellType, AIsOdd); + ADataItem.FontIndex := + GetCellFontIndex(ANode, AColumn, ACellType, AIsOdd); + if Use3DEffects and (ACellType in [mvctFooter, mvctHeader]) then + Setup3DEffects(ADataItem, ACellType); + if IsSupportedCustomDraw(nil) then + ADataItem.Data := Integer(AColumn); + + if (ANode.Level.ViewMode = vmVertical) and (ACellType <> mvctFooter) and ShowHeaders(ANode) then + begin + ADataClass := GetDataClass(ANode, AColumn, mvctHeader); + ADataItem := ADataClass.Create(ACell); + with ADataItem do + begin + AssignValues(ADataItem, ANode, AColumn, mvctHeader); + CellSides := + GetDataItemSides(ANode, AColumnPlace, mvctHeader); + BoundsRect := + GetDataItemRect(ANode, AColumnPlace, ACell, mvctHeader); + Transparent := + IsCellTransparent(ANode, nil, mvctHeader, AIsOdd); + if not Transparent then + Color := GetCellColor(ANode, AColumn, mvctHeader, AIsOdd); + FontIndex := + GetCellFontIndex(ANode, AColumn, mvctHeader, AIsOdd); + if Use3DEffects then + Setup3DEffects(ADataItem, mvctHeader); + if IsSupportedCustomDraw(nil) then + Data := Integer(AColumn); + end; + end; + end; + if ShowPreview(ANode) and (FPreviewFullHeight > 0) then + begin + ADataItem := TdxReportCellString.Create(ACell); + with TdxReportCellString(ADataItem) do + begin + Text := ANode.PreviewText; + Indent := ANode.Level.PreviewLeftIndent; + Multiline := True; + CellSides := + GetDataItemSides(ANode, nil, mvctPreview); + BoundsRect := + GetPreviewRect(ANode, ACell); + Transparent := + IsCellTransparent(ANode, nil, mvctPreview, AIsOdd); + if not Transparent then + Color := GetCellColor(ANode, nil, mvctPreview, AIsOdd); + FontIndex := + GetCellFontIndex(ANode, nil, mvctPreview, AIsOdd); + end; + end; + end; + ntCaption: + begin + ADataItem := TdxReportCellString.Create(ACell); + with TdxReportCellString(ADataItem) do + begin + Text := ANode.Level.Caption; + CellSides := + GetDataItemSides(ANode, nil, ACellType); + BoundsRect := + GetDataItemRect(ANode, nil, ACell, mvctCell); + Transparent := + IsCellTransparent(ANode, nil, ACellType, AIsOdd); + if not Transparent then + Color := GetCellColor(ANode, nil, ACellType, AIsOdd); + FontIndex := + GetCellFontIndex(ANode, nil, ACellType, AIsOdd); + if IsSupportedCustomDraw(nil) then + Data := Integer(ANode); + end; + end; + ntGroup: + begin + ADataItem := TdxReportCellString.Create(ACell); + with TdxReportCellString(ADataItem) do + begin + AGroupColumn := ANode.Level.GroupColumns[ANode.GroupIndex]; + Text := AGroupColumn.Caption + ' : ' + + ExposeColumn(AGroupColumn).GetGroupDisplayText(ANode); + CellSides := + GetDataItemSides(ANode, nil, ACellType); + BoundsRect := + GetDataItemRect(ANode, nil, ACell, mvctCell); + Transparent := + IsCellTransparent(ANode, nil, ACellType, AIsOdd); + if not Transparent then + Color := GetCellColor(ANode, nil, ACellType, AIsOdd); + FontIndex := + GetCellFontIndex(ANode, nil, ACellType, AIsOdd); + if IsSupportedCustomDraw(nil) then + Data := Integer(AGroupColumn); + end; + end; + end; + end; + + procedure IterateNodes; + var + I, J, FooterCount: Integer; + Node, FooterNode: TdxMasterViewNode; + IsOdd: Boolean; + begin + for I := 0 to FNodes.Count - 1 do + begin + Node := TdxMasterViewNode(FNodes.List^[I]); + IsOdd := not (Odd(Node.Index) and (Node.NodeType = ntData)); + + if CanDrawHeaders(Node) then + ProcessCells(Node, AReportCells.Cells, mvctHeader, IsOdd); + + ProcessCells(Node, AReportCells.Cells, mvctCell, IsOdd); + + if CanDrawFooters(Node) then + begin + FooterCount := GetNodeFooterCount(Node); + if FooterCount > 0 then + begin + FooterNode := Node; + if FooterNode.NodeType = ntCaption then + FooterNode := FooterNode.ParentNodeWithData; + J := 0; + while J < FooterCount do + begin + if lovFooter in FooterNode.Level.OptionsView then + begin + ProcessCells(FooterNode, AReportCells.Cells, mvctFooter, True); + Inc(J); + end; + FooterNode := FooterNode.ParentNodeWithData; + end; + end; + end; + AReportCells.DoProgress(MulDiv(I, 100, FNodes.Count)); + if AbortBuilding then Break; + end; + end; + +var + I, Width, Height: Integer; + Cell: TdxReportCell; +begin + if Component = nil then Exit; + inherited ConstructReport(AReportCells); + + PrepareConstruct(AReportCells); + try + AReportCells.BorderColor := GridLineColor; + with AReportCells.Cells do + begin + Color := dxDefaultColor; + CellSides := []; + Transparent := True; + FontIndex := 0; + end; + + if FNodes.Count > 0 then IterateNodes; + + if not AbortBuilding then + begin + Width := 0; + for I := 0 to AReportCells.Cells.CellCount - 1 do + begin + Cell := AReportCells.Cells[I]; + if Cell.Width > Width then Width := Cell.Width; + end; + Height := 0; + Cell := AReportCells.Cells.LastCell; + if Cell <> nil then Height := Cell.BoundsRect.Bottom; + AReportCells.Cells.BoundsRect := Rect(0, 0, Width, Height); + end; + finally + UnprepareConstruct(AReportCells); + end; +end; + +{ TdxMVReportLinkDesignWindow } + +constructor TdxMVReportLinkDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxhcMasterViewReportLinkDesigner; + inherited Create(AOwner); + CreateControls; + + LoadMemData; + PageControl1.ActivePage := PageControl1.Pages[0]; + FLastIndex := -1; + dxPSPopupMenuController.RegisterControl(lbxFonts); +end; + +destructor TdxMVReportLinkDesignWindow.Destroy; +begin + dxPSPopupMenuController.UnregisterControl(lbxFonts); + inherited Destroy; +end; + +const + sdxOrderNo = 'OrderNo'; + sdxName = 'Name'; + sdxCount = 'Count'; + sdxCompany = 'Company'; + sdxAddress = 'Address'; + sdxPrice = 'Price'; + sdxCash = 'Cash'; + +procedure TdxMVReportLinkDesignWindow.CreateDataSets; + + procedure AddField(AFieldClass: TFieldClass; ADataSet: TDataSet; + const AFieldName: string; ASize: Integer; ARequired: Boolean); + begin + with AFieldClass.Create(Self) do + begin + FieldName := AFieldName; + DataSet := ADataSet; + Size := ASize; + Required := ARequired; + end; + end; + +begin + FmdMaster := TdxEasyMemData.Create(Self); + AddField(TIntegerField, FmdMaster, sdxOrderNo, 0, True); + AddField(TStringField, FmdMaster, sdxName, 30, False); + AddField(TStringField, FmdMaster, sdxCompany, 30, False); + AddField(TStringField, FmdMaster, sdxAddress, 50, False); + + FmdDetail := TdxEasyMemData.Create(Self); + AddField(TIntegerField, FmdDetail, sdxOrderNo, 0, True); + AddField(TIntegerField, FmdDetail, sdxCount, 0, False); + AddField(TCurrencyField, FmdDetail, sdxPrice, 0, False); + AddField(TBooleanField, FmdDetail, sdxCash, 0, False); + + FmdMaster.Open; + FmdMaster.InsertRecord([1, sdxName1, sdxCompany1, sdxAddress1]); + FmdMaster.InsertRecord([2, sdxName2, sdxCompany2, sdxAddress2]); + + FmdDetail.Open; + FmdDetail.InsertRecord([1, 100, 9.00, True]); + FmdDetail.InsertRecord([1, 120, 19.00, False]); + FmdDetail.InsertRecord([2, 110, 21.00, True]); + FmdDetail.InsertRecord([2, 90, 100.00, True]); + FmdDetail.InsertRecord([2, 140, 111.00, False]); + FmdDetail.InsertRecord([2, 100, 112.00, False]); + + FdsMaster := TDataSource.Create(Self); + FdsMaster.DataSet := FmdMaster; + + FdsDetail := TDataSource.Create(Self); + FdsDetail.DataSet := FmdDetail; +end; + +procedure TdxMVReportLinkDesignWindow.InitializeMasterView; + + function CreateColumn(ALevel: TdxMasterViewLevel; AColumnClass: TdxMasterViewColumnClass; + const AFieldName: string; const ACaption: string; AMinWidth: Integer): TdxMasterViewColumn; + begin + Result := ALevel.CreateColumn(AColumnClass); + with Result do + begin + FieldName := AFieldName; + MinWidth := AMinWidth; + Caption := ACaption; + end; + end; + + function CreateLevel(AParent: TdxMasterViewLevel; ADataSource: TDataSource): TdxMasterViewLevel; + begin + Result := AParent.Add; + with Result do + begin + CaptionStyle := mvsCaptionStyle; + ContentStyle := mvsContentStyle; + FooterStyle := mvsFooterStyle; + GroupStyle := mvsGroupStyle; + HeaderStyle := mvsHeaderStyle; + PreviewStyle := mvsPreviewStyle; + + OnGetContentStyle := dxMVPreviewGetContentStyle; + OnGetPreviewStyle := dxMVPreviewGetContentStyle; + + DataSource := ADataSource; + ID := sdxOrderNo; + end; + end; + +begin + FMVMasterLevel := CreateLevel(dxMVPreview.Levels, FdsMaster); + with FMVMasterLevel do + begin + OptionsView := FMVMasterLevel.OptionsView + [lovPreview]; + PreviewFieldName := sdxAddress; + end; + FMVColumnName := CreateColumn(FMVMasterLevel, TdxMasterViewColumn, sdxName, sdxNameCaption, 80); + FMVColumnAddress := CreateColumn(FMVMasterLevel, TdxMasterViewColumn, sdxCompany, sdxCompanyCaption, 154); + + FMVDetailLevel := CreateLevel(FMVMasterLevel, FdsDetail); + with FMVDetailLevel do + begin + DetailKey := sdxOrderNo; + MasterKey := sdxOrderNo; + end; + FMVColumnCount := CreateColumn(FMVDetailLevel, TdxMasterViewColumn, sdxCount, + sdxCountCaption, 83); + with FMVColumnCount do + begin + SummaryType := stAverage; + SummaryFieldName := sdxCount; + end; + FMVColumnPrice := CreateColumn(FMVDetailLevel, TdxMasterViewColumn, sdxPrice, + sdxPriceCaption, 100); + with FMVColumnPrice do + begin + SummaryType := stAverage; + SummaryFieldName := sdxPrice; + end; + + FMVColumnCash := TdxMasterViewCheckColumn(CreateColumn(FMVDetailLevel, + TdxMasterViewCheckColumn, sdxCash, sdxCashCaption, 50)); + with FMVColumnCash do + begin + ValueChecked := 'True'; + ValueUnchecked := 'False'; + end; +end; + +procedure TdxMVReportLinkDesignWindow.LoadMemData; +begin + CreateDataSets; + InitializeMasterView; + dxMVPreview.ApplyBestFit(nil, nil); +end; + +{ + dxMVMasterLevelName.Width := 80; + dxMVMasterLevelOrderNo.Width := 50; + dxMVMasterLevelAddress.Width := 104; + + dxMVDetailLevelOrderNo.Width := 50; + dxMVDetailLevelCount.Width := 83; + dxMVDetailLevelPrice.Width := 100; +} + +procedure TdxMVReportLinkDesignWindow.pbxPreviewPaint(Sender: TObject); +begin + with TdxPSPaintPanel(Sender) do + PaintPreview(Canvas, ClientRect); +end; + +procedure FrameRectColor(DC: hDC; const R: TRect; AColor: TColor); +var + Brush: HBRUSH; +begin + Brush := CreateSolidBrush(ColorToRGB(AColor)); + FrameRect(DC, R, Brush); + DeleteObject(Brush); +end; + +procedure TdxMVReportLinkDesignWindow.PaintPreview(ACanvas: TCanvas; R: TRect); +var + DC: HDC; +begin + inherited; + DC := ACanvas.Handle; + dxMVPreview.PaintTo(DC, R.Left, R.Top); + Dec(R.Right, 2); + Dec(R.Bottom); + FrameRectColor(DC, R, ReportLink.GridLineColor); +end; + +procedure TdxMVReportLinkDesignWindow.CreateControls; + + function CreateColorCombo(AParent: TWinControl; AHost: TControl; + ATag: Integer; AAutoColor: TColor; ALabel: TLabel): TdxPSColorCombo; + begin + Result := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(Result) do + begin + BoundsRect := AHost.BoundsRect; + Tag := ATag; + Parent := AParent; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := AAutoColor; + OnChange := ccbxColorChange; + end; + ALabel.FocusControl := Result; + AHost.Visible := False; + end; + +begin + FccbxColor := + CreateColorCombo(gbxTransparent, bvlColorHolder, 0, dxDefaultColor, lblColor); + FccbxEvenColor := + CreateColorCombo(gbxTransparent, bvlEvenColorHolder, 1, dxDefaultColor, lblEvenColor); + FccbxPreviewColor := + CreateColorCombo(gbxTransparent, bvlPreviewColorHolder, 2, dxDefaultColor, lblPreviewColor); + + FccbxCaptionColor := + CreateColorCombo(gbxFixedTransparent, bvlCaptionColorHolder, 3, dxDefaultFixedColor, lblLevelCaptionColor); + FccbxHeaderColor := + CreateColorCombo(gbxFixedTransparent, bvlHeaderColorHolder, 5, dxDefaultFixedColor, lblHeaderColor); + FccbxFooterColor := + CreateColorCombo(gbxFixedTransparent, bvlFooterColorHolder, 6, dxDefaultFixedColor, lblFooterColor); + FccbxGroupNodeColor := + CreateColorCombo(gbxFixedTransparent, bvlGroupNodeColorHolder, 4, dxDefaultFixedColor, lblGroupNodeColor); + + FccbxGridLineColor := + CreateColorCombo(tshColors, bvlGridLineColorHolder, 7, dxDefaultGridLineColor, lblGridLineColor); + FccbxGridLineColor.TabOrder := FccbxGridLineColor.Parent.ControlCount - 1; + + FsePreviewLineCount := TdxPSSpinEdit.Create(Self); + with TdxPSSpinEdit(FsePreviewLineCount) do + begin + BoundsRect := bvlPreviewLineCountHolder.BoundsRect; + MinValue := 0; + MaxValue := 100; + Flat := False; + Parent := tshPreview; + TabOrder := chbxAutoCalcPreviewLines.TabOrder + 1; + OnChange := PreviewLineCountChange; + end; + lblPreviewLineCount.FocusControl := FsePreviewLineCount; + + FPreviewBox := TdxPSPaintPanel.Create(Self); + with TdxPSPaintPanel(FPreviewBox) do + begin + Parent := pnlPreview; + Height := dxMVPreview.Height; + Width := dxMVPreview.Width; + Left := (Parent.Width - Width) div 2; + Top := (Parent.Height - Height) div 2; + EdgeInner := esNone; + EdgeOuter := esNone; + OnPaint := pbxPreviewPaint; + end; +end; + +{$IFDEF DELPHI7} +function TdxMVReportLinkDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +procedure TdxMVReportLinkDesignWindow.LoadStrings; +begin + inherited LoadStrings; + lblPreviewWindow.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + tshOptions.Caption := cxGetResourceString(@sdxOptions); + tshFonts.Caption := cxGetResourceString(@sdxFonts); + tshColors.Caption := cxGetResourceString(@sdxColors); + tshBehaviors.Caption := cxGetResourceString(@sdxBehaviors); + tshPreview.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + lblShow.Caption := cxGetResourceString(@sdxShow); + chbxShowHeaders.Caption := cxGetResourceString(@sdxHeaders); + chbxShowFooters.Caption := cxGetResourceString(@sdxFooters); + chbxShowExpandButtons.Caption := cxGetResourceString(@sdxExpandButtons); + chbxShowGrid.Caption := cxGetResourceString(@sdxGrid); + chbxShowPreviewGrid.Caption := cxGetResourceString(@sdxNodesGrid); + chbxShowGroupFooterGrid.Caption := cxGetResourceString(@sdxGroupFooterGrid); + + lblDrawMode.Caption := cxGetResourceString(@sdxDrawMode); + with cbxDrawMode.Items do + begin + BeginUpdate; + try + Clear; + AddObject(cxGetResourceString(@sdxDrawModeStrict), TObject(mvdmStrict)); + AddObject(cxGetResourceString(@sdxDrawModeOddEven), TObject(mvdmOddEven)); + AddObject(cxGetResourceString(@sdxDrawModeBorrow), TObject(mvdmBorrowSource)); + finally + EndUpdate; + end; + end; + + stTransparent.Caption := ' ' + cxGetResourceString(@sdxTransparent) + ' '; + lblColor.Caption := cxGetResourceString(@sdxColor); + lblEvenColor.Caption := cxGetResourceString(@sdxEvenColor); + lblPreviewColor.Caption := cxGetResourceString(@sdxPreviewColor); + + stFixedTransparent.Caption := ' ' + cxGetResourceString(@sdxFixedTransparent) + ' '; + lblLevelCaptionColor.Caption := cxGetResourceString(@sdxLevelCaptionColor); + lblHeaderColor.Caption := cxGetResourceString(@sdxHeaderColor); + lblFooterColor.Caption := cxGetResourceString(@sdxFooterColor); + lblGroupNodeColor.Caption := cxGetResourceString(@sdxGroupNodeColor); + lblGridLineColor.Caption := cxGetResourceString(@sdxGridLinesColor); + + with lbxFonts.Items do + begin + BeginUpdate; + try + Clear; + Add(cxGetResourceString(@sdxFont)); + Add(cxGetResourceString(@sdxOddFont)); + Add(cxGetResourceString(@sdxEvenFont)); + Add(cxGetResourceString(@sdxCaptionNodeFont)); + Add(cxGetResourceString(@sdxGroupNodeFont)); + Add(cxGetResourceString(@sdxFooterFont)); + Add(cxGetResourceString(@sdxHeaderFont)); + Add(cxGetResourceString(@sdxPreviewFont)); + finally + EndUpdate; + end; + end; + + btnChangeFont.Caption := cxGetResourceString(@sdxBtnChangeFont); + miChangeFont.Caption := cxGetResourceString(@sdxBtnChangeFont); + + chbxAutoNodesExpand.Caption := cxGetResourceString(@sdxAutoNodesExpand); + chbxOnlySelected.Caption := cxGetResourceString(@sdxOnlySelected); + chbxExtendedSelect.Caption := cxGetResourceString(@sdxExtendedSelect); + + lblSelection.Caption := cxGetResourceString(@sdxSelection); + lblExpanding.Caption := cxGetResourceString(@sdxNodeExpanding); + lblLookAndFeel.Caption := cxGetResourceString(@sdxLookAndFeel); + lblRefinements.Caption := cxGetResourceString(@sdxRefinements); + + chbxUse3DEffects.Caption := cxGetResourceString(@sdxUse3DEffects); + chbxUseSoft3D.Caption := cxGetResourceString(@sdxSoft3D); + + chbxTransparentColumnGraphic.Caption := cxGetResourceString(@sdxTransparentColumnGraphics); + chbxDisplayGraphicsAsText.Caption := cxGetResourceString(@sdxDisplayGraphicsAsText); + chbxFlatCheckMarks.Caption := cxGetResourceString(@sdxFlatCheckMarks); + chbxCheckMarksAsText.Caption := cxGetResourceString(@sdxCheckMarksAsText); + + lblPreview.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + chbxShowPreview.Caption := DropAmpersand(cxGetResourceString(@sdxVisible)); + chbxAutoCalcPreviewLines.Caption := cxGetResourceString(@sdxAutoCalcPreviewLineCount); + lblPreviewLineCount.Caption := cxGetResourceString(@sdxPreviewLineCount); +end; + +procedure TdxMVReportLinkDesignWindow.CMDialogChar(var Msg: TCMDialogChar); +var + I: Integer; +begin + inherited; + with PageControl1 do + for I := 0 to PageCount - 1 do + if IsAccel(Msg.CharCode, Pages[I].Caption) then + begin + Msg.Result := 1; + ActivePage := Pages[I]; + Exit; + end; +end; + +procedure TdxMVReportLinkDesignWindow.UpdateControlsState; +begin + inherited UpdateControlsState; + + if ReportLink.OddEvenMode then + lblColor.Caption := cxGetResourceString(@sdxOddColor) + else + lblColor.Caption := cxGetResourceString(@sdxColor); + + chbxOnlySelected.Checked := ReportLink.OnlySelected; + chbxExtendedSelect.Enabled := chbxOnlySelected.Checked; + + chbxAutoNodesExpand.Checked := ReportLink.AutoNodesExpand; + + chbxAutoCalcPreviewLines.Enabled := ReportLink.ShowPreview(nil); + FsePreviewLineCount.Enabled := ReportLink.ShowPreview(nil) and + not ReportLink.AutoCalcPreviewLines; + lblPreviewLineCount.Enabled := FsePreviewLineCount.Enabled; + + chbxShowPreviewGrid.Enabled := chbxShowGrid.Checked; + chbxShowGroupFooterGrid.Enabled := chbxShowGrid.Checked; + + chbxUseSoft3D.Enabled := chbxUse3DEffects.Checked; + + FccbxColor.Enabled := not chbxTransparent.Checked; + lblColor.Enabled := FccbxColor.Enabled; + FccbxEvenColor.Enabled := not chbxTransparent.Checked and ReportLink.OddEvenMode; + lblEvenColor.Enabled := FccbxEvenColor.Enabled; + FccbxPreviewColor.Enabled := not chbxTransparent.Checked and not ReportLink.OddEvenMode; + lblPreviewColor.Enabled := FccbxPreviewColor.Enabled; + + FccbxCaptionColor.Enabled := not chbxFixedTransparent.Checked; + lblLevelCaptionColor.Enabled := FccbxCaptionColor.Enabled; + FccbxGroupNodeColor.Enabled := not chbxFixedTransparent.Checked; + lblGroupNodeColor.Enabled := FccbxGroupNodeColor.Enabled; + FccbxHeaderColor.Enabled := not chbxFixedTransparent.Checked; + lblHeaderColor.Enabled := FccbxHeaderColor.Enabled; + FccbxFooterColor.Enabled := not chbxFixedTransparent.Checked; + lblFooterColor.Enabled := FccbxFooterColor.Enabled; + + btnChangeFont.Enabled := IsChangeFontEnabled; + lbxFonts.Perform(LB_SETHORIZONTALEXTENT, GetMaxWidth, 0); +end; + +function TdxMVReportLinkDesignWindow.IsChangeFontEnabled: Boolean; +var + I: Integer; +begin + if ReportLink.OddEvenMode then + Result := lbxFonts.SelCount > 0 + else + begin + Result := True; + for I := 0 to lbxFonts.Items.Count - 1 do + if lbxFonts.Selected[I] and not (I in [1, 2]) then Exit; + Result := False; + end; +end; + +function TdxMVReportLinkDesignWindow.IsDisableIndex(AIndex: Integer): Boolean; +begin + Result := not ReportLink.OddEvenMode and (AIndex in [1, 2]); +end; + +procedure TdxMVReportLinkDesignWindow.DoInitialize; +begin + inherited; + + with lbxFonts do + begin + Canvas.Font := Font; + ItemHeight := 1 + lbxFonts.Canvas.TextHeight('Wg') + 2; + Height := 4{border} + GetSystemMetrics(SM_CYHSCROLL) + Items.Count * ItemHeight; + end; + btnChangeFont.Top := lbxFonts.Top + lbxFonts.Height + 6; + + with ReportLink do + begin + chbxShowHeaders.Checked := ShowHeaders(nil); + chbxShowFooters.Checked := ShowFooters(nil); + chbxShowPreview.Checked := ShowPreview(nil); + chbxAutoCalcPreviewLines.Checked := AutoCalcPreviewLines; + TdxPSSpinEdit(FsePreviewLineCount).Enabled := ShowPreview(nil) and not AutoCalcPreviewLines; + TdxPSSpinEdit(FsePreviewLineCount).MinValue := -Byte(AutoCalcPreviewLines); + TdxPSSpinEdit(FsePreviewLineCount).Value := PreviewLineCount; + + chbxShowGrid.Checked := ShowGrid(nil); + chbxShowPreviewGrid.Checked := ShowPreviewGrid(nil); + chbxShowGroupFooterGrid.Checked := ShowGroupFooterGrid; + + chbxFlatCheckMarks.Checked := FlatCheckMarks; + chbxShowExpandButtons.Checked := ShowExpandButtons; + + if OddEvenMode then lblColor.Caption := cxGetResourceString(@sdxOddColor); + + chbxTransparent.Checked := Transparent; + chbxFixedTransparent.Checked := FixedTransparent; + cbxDrawMode.ItemIndex := cbxDrawMode.Items.IndexOfObject(TObject(DrawMode)); + + TdxPSColorCombo(FccbxColor).ColorValue := ReportLink.Color; + TdxPSColorCombo(FccbxEvenColor).ColorValue := EvenColor; + TdxPSColorCombo(FccbxPreviewColor).ColorValue := PreviewColor; + TdxPSColorCombo(FccbxCaptionColor).ColorValue := CaptionColor; + TdxPSColorCombo(FccbxFooterColor).ColorValue := FooterColor; + TdxPSColorCombo(FccbxGridLineColor).ColorValue := GridLineColor; + TdxPSColorCombo(FccbxGroupNodeColor).ColorValue := GroupNodeColor; + TdxPSColorCombo(FccbxHeaderColor).ColorValue := HeaderColor; + + chbxOnlySelected.Checked := OnlySelected; + chbxExtendedSelect.Checked := ExtendedSelect; + + chbxUse3DEffects.Checked := Use3DEffects; + chbxUseSoft3D.Checked := UseSoft3D; + + chbxTransparentColumnGraphic.Checked := TransparentColumnGraphics; + chbxDisplayGraphicsAsText.Checked := GraphicsAsText; + end; + dxMVPreview.FullExpand; + UpdatePreview; + lbxFonts.Invalidate; +end; + +procedure TdxMVReportLinkDesignWindow.PreviewLineCountChange(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PreviewLineCount := TdxPSSpinEdit(Sender).AsInteger; + Modified := True; +end; + +procedure TdxMVReportLinkDesignWindow.UpdatePreview; + + procedure XorOption(var AOptions: TdxMasterViewLevelOptionsView; + AElement: TdxMasterViewLevelOptionView; Value: Boolean); + begin + if Value then + AOptions := AOptions + [AElement] + else + AOptions := AOptions - [AElement]; + end; + +var + I: Integer; + OV: TdxMasterViewLevelOptionsView; +begin + inherited UpdatePreview; + OV := FMVMasterLevel.OptionsView; + with ReportLink do + begin + XorOption(OV, lovHeader, ShowHeaders(nil)); + XorOption(OV, lovPreview, ShowPreview(nil)); + XorOption(OV, lovGrid, ShowGrid(nil)); + XorOption(OV, lovGridWithPreview, ShowPreviewGrid(nil)); + end; + FMVMasterLevel.OptionsView := OV; + + FMVColumnCash.Border3D := not ReportLink.FlatCheckMarks; + + OV := FMVDetailLevel.OptionsView; + with ReportLink do + begin + XorOption(OV, lovHeader, ShowHeaders(nil)); + XorOption(OV, lovFooter, ShowFooters(nil)); + XorOption(OV, lovGrid, ShowGrid(nil)); + XorOption(OV, lovGridWithPreview, ShowPreviewGrid(nil)); + end; + FMVDetailLevel.OptionsView := OV; + + FMVMasterLevel.GridLinesColor := ReportLink.GridLineColor; + FMVDetailLevel.GridLinesColor := FMVMasterLevel.GridLinesColor; + + with ReportLink do + begin + if FixedTransparent then + begin + mvsCaptionStyle.Color := clWindow; + mvsHeaderStyle.Color := clWindow; + mvsFooterStyle.Color := clWindow; + mvsGroupStyle.Color := clWindow; + end + else + begin + mvsCaptionStyle.Color := CaptionColor; + mvsHeaderStyle.Color := HeaderColor; + mvsFooterStyle.Color := FooterColor; + mvsGroupStyle.Color := GroupNodeColor; + end; + + if Transparent then + begin + mvsContentStyle.Color := clWindow; + mvsContentStyle.AnotherColor := clWindow; + mvsPreviewStyle.Color := clWindow; + mvsPreviewStyle.AnotherColor := clWindow; + end + else + begin + if DrawMode = mvdmOddEven then + begin + mvsContentStyle.Color := OddColor; + mvsContentStyle.AnotherColor := OddColor; + mvsPreviewStyle.Color := OddColor; + mvsPreviewStyle.AnotherColor := EvenColor; + end + else + begin + mvsContentStyle.Color := Color; + mvsContentStyle.AnotherColor := Color; + mvsPreviewStyle.Color := PreviewColor; + mvsPreviewStyle.AnotherColor := PreviewColor; + end; + end; + + with mvsPreviewStyle do + AssignedValues := AssignedValues + [svAnotherColor]; + + if DrawMode = mvdmOddEven then + begin + mvsAnotherContentStyle.Color := EvenColor; + mvsAnotherContentStyle.Font := EvenFont; + end; + + mvsCaptionStyle.Font := CaptionNodeFont; + mvsHeaderStyle.Font := HeaderFont; + mvsFooterStyle.Font := FooterFont; + mvsGroupStyle.Font := GroupNodeFont; + + if DrawMode = mvdmOddEven then + begin + mvsContentStyle.Font := OddFont; + mvsPreviewStyle.Font := OddFont; + end + else + begin + mvsContentStyle.Font := Font; + mvsPreviewStyle.Font := PreviewFont; + end; + + for I := 0 to dxMVPreview.StyleCount - 1 do + dxMVPreview.Styles[I].Font.Size := dxMVPreview.Font.Size; + end; + FPreviewBox.HandleNeeded; + FPreviewBox.Invalidate; +end; + +function TdxMVReportLinkDesignWindow.GetReportLink: TdxMasterViewReportLink; +begin + Result := inherited ReportLink as TdxMasterViewReportLink; +end; + +procedure TdxMVReportLinkDesignWindow.ShowClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + if Sender <> nil then + begin + with ReportLink do + if TCheckBox(Sender).Checked then + Options := Options + [TdxMasterViewPaintOption(TCheckBox(Sender).Tag)] + else + Options := Options - [TdxMasterViewPaintOption(TCheckBox(Sender).Tag)]; + Modified := True; + end; + UpdatePreview; +end; + +procedure TdxMVReportLinkDesignWindow.cbxDrawModeClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TComboBox(Sender) do + ReportLink.DrawMode := TdxMasterViewDrawMode(Items.Objects[ItemIndex]); + Modified := True; + UpdatePreview; +end; + +procedure TdxMVReportLinkDesignWindow.cbxDrawModeDrawItem( + Control: TWinControl; Index: Integer; Rect: TRect; + State: TOwnerDrawState); +const + ImageIndexMap: array[TdxMasterViewDrawMode] of Integer = (0, 1, 3); +begin + with TComboBox(Control) do + dxPSUtl.dxDrawComboBoxItem(Canvas, Rect, Items[Index], dxPSUtl.dxPSDrawModeImages, + ImageIndexMap[TdxMasterViewDrawMode(Items.Objects[Index])], State); +end; + +procedure TdxMVReportLinkDesignWindow.chbxAutoNodesExpandClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.AutoNodesExpand := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxMVReportLinkDesignWindow.chbxOnlySelectedClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OnlySelected := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxMVReportLinkDesignWindow.chbxExtendedSelectClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.ExtendedSelect := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxMVReportLinkDesignWindow.chbxAutoCalcPreviewLinesClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PreviewLineCount := -Byte(TCheckBox(Sender).Checked); + TdxPSSpinEdit(FsePreviewLineCount).MinValue := -Byte(ReportLink.AutoCalcPreviewLines); + TdxPSSpinEdit(FsePreviewLineCount).Value := -Byte(ReportLink.AutoCalcPreviewLines); + Modified := True; +end; + +procedure TdxMVReportLinkDesignWindow.chbxTransparentClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + case TCheckBox(Sender).Tag of + 0: ReportLink.Transparent := TCheckBox(Sender).Checked; + 1: ReportLink.FixedTransparent := TCheckBox(Sender).Checked; + end; + UpdatePreview; + Modified := True; +end; + +procedure TdxMVReportLinkDesignWindow.stTransparentClick(Sender: TObject); +begin + if chbxTransparent.CanFocus then ActiveControl := chbxTransparent; + chbxTransparent.Checked := not chbxTransparent.Checked; +end; + +procedure TdxMVReportLinkDesignWindow.stFixedTransparentClick(Sender: TObject); +begin + if chbxFixedTransparent.CanFocus then ActiveControl := chbxFixedTransparent; + chbxFixedTransparent.Checked := not chbxFixedTransparent.Checked; +end; + +procedure TdxMVReportLinkDesignWindow.ccbxColorChange(Sender: TObject); +var + AColor: TColor; +begin + if LockControlsUpdate then Exit; + AColor := TdxPSColorCombo(Sender).ColorValue; + case TdxPSColorCombo(Sender).Tag of + 0: ReportLink.Color := AColor; + 1: ReportLink.EvenColor := AColor; + 2: ReportLink.PreviewColor := AColor; + 3: ReportLink.CaptionColor := AColor; + 4: ReportLink.GroupNodeColor := AColor; + 5: ReportLink.HeaderColor := AColor; + 6: ReportLink.FooterColor := AColor; + 7: ReportLink.GridLineColor := AColor; + end; + UpdatePreview; + Modified := True; +end; + +procedure TdxMVReportLinkDesignWindow.btnChangeFontClick(Sender: TObject); +begin + DoChangeFont(lbxFonts.ItemIndex); +end; + +procedure TdxMVReportLinkDesignWindow.lbxFontsMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +var + W: Integer; + S: string; + AIndex: Integer; +begin + AIndex := lbxFonts.ItemAtPos(Point(X, Y), True); + if (AIndex = -1) or (AIndex = FLastIndex ) then Exit; + lbxFonts.Hint := ''; + Application.CancelHint; + S := GetFontInfoText(AIndex); + W := lbxFonts.Canvas.TextWidth(S); + if W > lbxFonts.Width - lbxFonts.Canvas.TextWidth(lbxFonts.Items[AIndex]) then + begin + lbxFonts.Hint := S; + FLastIndex := AIndex; + end; +end; + +procedure TdxMVReportLinkDesignWindow.lbxFontsKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +var + ItemIndex: Integer; +begin + if (ReportLink.DrawMode <> mvdmOddEven) and (Key in [VK_UP, VK_DOWN]) then + begin + ItemIndex := TListBox(Sender).ItemIndex; + case Key of + VK_UP: + if IsDisableIndex(ItemIndex - 1) then + while IsDisableIndex(ItemIndex - 1) do Dec(ItemIndex); + VK_DOWN: + if IsDisableIndex(ItemIndex + 1) then + while IsDisableIndex(ItemIndex + 1) do Inc(ItemIndex); + end; + TListBox(Sender).ItemIndex := ItemIndex; + end; + if (Key = VK_RETURN) and (ssCtrl in Shift) then + btnChangeFont.Click; +end; + +procedure TdxMVReportLinkDesignWindow.lbxFontsDrawItem( + Control: TWinControl; Index: Integer; Rect: TRect; + State: TOwnerDrawState); + + function GetMaxLength: Integer; + var + V, I: Integer; + begin + Result := 0; + with TListBox(Control) do + for I := 0 to Items.Count - 1 do + begin + V := Canvas.TextWidth(Items[I]); + if (V > Result) then Result := V; + end; + Inc(Result, 8); + end; + + function GetFontColor(AIndex: Integer): TColor; + begin + if IsDisableIndex(AIndex) then + Result := ColorToRGB(clBtnFace) + else + Result := ColorToRGB(clWindowText);//GetFontByIndex(AIndex).Color; + end; + +const + FirstEntries: Boolean = True; + MaxLength: Integer = 0; +var + R: TRect; + BrushColor, FontColor: TColor; + S: string; +begin + if FirstEntries then + begin + MaxLength := GetMaxLength; + FirstEntries := False; + end; + + with TListBox(Control) do + begin + BrushColor := Canvas.Brush.Color; + if IsDisableIndex(Index) then + Canvas.Brush.Color := ColorToRGB(clWindow); + with Rect do + R := Classes.Rect(Left, Top, Left + MaxLength, Bottom); + FontColor := Canvas.Font.Color; + if not (odSelected in State) or IsDisableIndex(Index) then + Canvas.Font.Color := GetFontColor(Index); + Canvas.TextRect(R, R.Left + 2, R.Top + 2, Items[Index]); + R.Left := R.Right; + Inc(R.Right); + Canvas.Brush.Color := ColorToRGB(clBtnShadow); + Canvas.FrameRect(R); + if IsDisableIndex(Index) then + Canvas.Brush.Color := ColorToRGB(clWindow) + else + Canvas.Brush.Color := BrushColor; + R.Left := R.Right; + R.Right := Rect.Right; + S := GetFontInfoText(Index); + Canvas.TextRect(R, R.Left + 2, R.Top + 2, S); + if not (odSelected in State) or IsDisableIndex(Index) then + Canvas.Font.Color := FontColor; + if (odFocused in State) and IsDisableIndex(Index) then + Canvas.DrawFocusRect(Rect); + Canvas.Brush.Color := BrushColor; + end +end; + +function TdxMVReportLinkDesignWindow.GetFontInfoText(AIndex: Integer): string; +begin + Result := FormatFontInfo(GetFontByIndex(AIndex)); +end; + +function TdxMVReportLinkDesignWindow.GetMaxWidth: Integer; +var + I, L, W: Integer; +begin + with lbxFonts do + begin + W := Canvas.TextWidth(Items[0] + 'X'); + for I := 1 to Items.Count - 1 do + begin + L := Canvas.TextWidth(Items[I] + 'X'); + if L > W then W := L; + end; + + Result := W; + W := Canvas.TextWidth(GetFontInfoText(0) + 'X'); + for I := 1 to Items.Count - 1 do + begin + L := Canvas.TextWidth(GetFontInfoText(I) + 'X'); + if L > W then W := L; + end; + end; + Inc(Result, W + 2 + 8 + 3); +end; + +procedure TdxMVReportLinkDesignWindow.lbxFontsClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + UpdateControlsState; +end; + +procedure TdxMVReportLinkDesignWindow.pmChangeFontPopup(Sender: TObject); +begin + miChangeFont.Enabled := btnChangeFont.Enabled; +end; + +procedure TdxMVReportLinkDesignWindow.lbxFontsDblClick(Sender: TObject); +begin + if btnChangeFont.Enabled then btnChangeFont.Click; +end; + +function TdxMVReportLinkDesignWindow.GetFontByIndex(AIndex: Integer): TFont; +begin + with ReportLink do + case AIndex of + 0: Result := Font; + 1: Result := OddFont; + 2: Result := EvenFont; + 3: Result := CaptionNodeFont; + 4: Result := GroupNodeFont; + 5: Result := FooterFont; + 6: Result := HeaderFont; + else + Result := ReportLink.PreviewFont; + end; +end; + +procedure TdxMVReportLinkDesignWindow.DoChangeFont(Index: Integer); +var + I: Integer; +begin + with dxPSGlbl.FontDialog do + begin + Font := GetFontByIndex(Index); + if Execute then + begin + with lbxFonts do + begin + for I := 0 to Items.Count - 1 do + if Selected[I] then GetFontByIndex(I).Assign(Font); + end; + lbxFonts.Refresh; + UpdatePreview; + Modified := True; + end; + end; +end; + +procedure TdxMVReportLinkDesignWindow.dxMVPreviewGetContentStyle( + Sender: TdxMasterViewLevel; Node: TdxMasterViewNode; + Column: TdxMasterViewColumn; var NewStyle: TdxMasterViewStyle); +begin + if (ReportLink.DrawMode = mvdmOddEven) and not ReportLink.Transparent and Odd(Node.Index) then + NewStyle := mvsAnotherContentStyle; +end; + +procedure TdxMVReportLinkDesignWindow.PageControl1Change(Sender: TObject); +begin + lblPreviewWindow.Parent := TPageControl(Sender).ActivePage; +end; + +procedure RegisterHelpers; +begin + TdxMasterViewColumnHelper.Register; + TdxMasterViewImageColumnHelper.Register; +end; + +procedure UnregisterHelpers; +begin + TdxColumnHelpersFactory.ReleaseInstance; +end; + +initialization + RegisterHelpers; + dxPSRegisterReportLink(TdxMasterViewReportLink, TdxMasterView, TdxMVReportLinkDesignWindow); + +finalization + dxPSUnregisterReportLink(TdxMasterViewReportLink, TdxMasterView, TdxMVReportLinkDesignWindow); + UnregisterHelpers; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxMVLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxMVLnkReg.pas new file mode 100644 index 00000000..4078b7d4 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxMVLnkReg.pas @@ -0,0 +1,89 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxMVLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignEditors, + {$ELSE} + DsgnIntf, + {$ENDIF} + Classes, dxPSdxMVLnk; + +type + TdxMasterViewOptionsPropertyEditor = class(TSetProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + +function TdxMasterViewOptionsPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog]; +end; + +procedure TdxMasterViewOptionsPropertyEditor.Edit; +var + I: Integer; +begin + inherited; + if TdxMasterViewReportLink(GetComponent(0)).DesignReport then + begin + Designer.Modified; + if PropCount > 1 then + for I := 1 to PropCount - 1 do + GetComponent(I).Assign(GetComponent(0)); + end; +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterNoIcon([TdxMasterViewReportLink]); + RegisterPropertyEditor(TypeInfo(TdxMasterViewPaintOptions), TdxMasterViewReportLink, 'Options', TdxMasterViewOptionsPropertyEditor); +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxOCLnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSdxOCLnk.dfm new file mode 100644 index 00000000..890ff015 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxOCLnk.dfm @@ -0,0 +1,170 @@ +object dxOCReportLinkDesignWindow: TdxOCReportLinkDesignWindow + Left = 518 + Top = 415 + ActiveControl = chbxFullExpand + BorderStyle = bsDialog + Caption = 'Report Designer' + ClientHeight = 293 + ClientWidth = 552 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 4 + Width = 544 + Height = 254 + ActivePage = tshOptions + MultiLine = True + TabOrder = 0 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = '&Options' + object pnlOptions: TPanel + Left = 0 + Top = 0 + Width = 536 + Height = 226 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblPreview: TLabel + Left = 241 + Top = 2 + Width = 38 + Height = 13 + Caption = 'Preview' + end + object chbxFullExpand: TCheckBox + Left = 17 + Top = 10 + Width = 216 + Height = 17 + Caption = 'Full &Expand' + TabOrder = 0 + OnClick = chbxFullExpandClick + end + object gbxTransparent: TGroupBox + Left = 5 + Top = 43 + Width = 231 + Height = 56 + Caption = ' ' + TabOrder = 2 + object lblColor: TLabel + Left = 7 + Top = 26 + Width = 35 + Height = 13 + Caption = 'Co&lor : ' + OnClick = lblColorClick + end + object bvlColorHolder: TBevel + Left = 86 + Top = 22 + Width = 138 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 17 + Top = 41 + Width = 15 + Height = 17 + TabOrder = 1 + OnClick = chbxTransparentClick + end + object gbxBorder: TGroupBox + Left = 5 + Top = 109 + Width = 231 + Height = 56 + Caption = ' ' + TabOrder = 4 + object lblGridLinesColor: TLabel + Left = 7 + Top = 26 + Width = 67 + Height = 13 + Caption = '&Border Color: ' + OnClick = lblColorClick + end + object bvlLineColorHolder: TBevel + Left = 86 + Top = 22 + Width = 138 + Height = 21 + Visible = False + end + end + object chbxDrawBorder: TCheckBox + Left = 17 + Top = 107 + Width = 15 + Height = 17 + TabOrder = 3 + OnClick = chbxDrawBorderClick + end + object stTransparent: TStaticText + Left = 32 + Top = 42 + Width = 76 + Height = 17 + Caption = ' &Transparent ' + FocusControl = chbxTransparent + TabOrder = 5 + OnClick = stTransparentClick + end + object stDrawBorder: TStaticText + Left = 32 + Top = 108 + Width = 70 + Height = 17 + Caption = ' Draw Border ' + FocusControl = chbxDrawBorder + TabOrder = 6 + OnClick = stDrawBorderClick + end + end + end + end + object pnlPreview: TPanel + Left = 250 + Top = 46 + Width = 290 + Height = 201 + BevelInner = bvLowered + BevelOuter = bvNone + Color = clWindow + TabOrder = 1 + object ocPreview: TdxOrgChart + Left = 6 + Top = 5 + Width = 279 + Height = 192 + DefaultImageAlign = iaLT + BorderStyle = bsNone + Options = [ocDblClick, ocEdit, ocCanDrag, ocShowDrag, ocRect3D] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Visible = False + Items = { + 000001005A000000FFFFFF1F01000200011600436F72706F7261746520486561 + 647175617274657273020050000000FFFFFF1F0100010001130053616C657320 + 616E64204D61726B6574696E67010050000000FFFFFF1F010003000117004669 + 656C64204F66666963653A2043616E6164610D0A09000050000000FFFFFF1F01 + 000000010B00456E67696E656572696E670000} + end + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxOCLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxOCLnk.pas new file mode 100644 index 00000000..cf5306df --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxOCLnk.pas @@ -0,0 +1,598 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxOCLnk; + +interface + +{$I cxVer.inc} + +uses + Classes, Windows, Graphics, Controls, Forms, StdCtrls, ExtCtrls, ComCtrls, + dxOrgChr, dxPSCore, dxPSGraphicLnk; + +type + TCustomdxOrgChartReportLink = class(TCustomdxGraphicReportLink) + private + FFullExpand: Boolean; + FUseMetafile: Boolean; + function GetOrgChart: TdxOrgChart; + procedure SetFullExpand(Value: Boolean); + protected + function GetGraphic: TGraphic; override; + function GetGraphicClass: TGraphicClass; override; + procedure InternalRestoreDefaults; override; + procedure InternalRestoreFromOriginal; override; + property OrgChart: TdxOrgChart read GetOrgChart; + public + constructor Create(AOwner: TComponent); override; + procedure Assign(Source: TPersistent); override; + property Color; + property FullExpand: Boolean read FFullExpand write SetFullExpand default False; + property Transparent; + property UseMetafile: Boolean read FUseMetafile write FUseMetafile default True; + end; + + TdxOrgChartReportLink = class(TCustomdxOrgChartReportLink) + public + property OrgChart; + published + property BorderColor; + property Color; + property DrawBorder; + property FullExpand; + property Transparent; + property TransparentColor; + property UseMetafile; + end; + + TdxOCReportLinkDesignWindow = class(TStandarddxReportLinkDesignWindow) + PageControl1: TPageControl; + tshOptions: TTabSheet; + pnlOptions: TPanel; + chbxFullExpand: TCheckBox; + pnlPreview: TPanel; + chbxDrawBorder: TCheckBox; + gbxTransparent: TGroupBox; + lblColor: TLabel; + bvlColorHolder: TBevel; + chbxTransparent: TCheckBox; + gbxBorder: TGroupBox; + lblGridLinesColor: TLabel; + bvlLineColorHolder: TBevel; + ocPreview: TdxOrgChart; + lblPreview: TLabel; + stTransparent: TStaticText; + stDrawBorder: TStaticText; + procedure lblColorClick(Sender: TObject); + procedure chbxFullExpandClick(Sender: TObject); + procedure chbxDrawBorderClick(Sender: TObject); + procedure chbxTransparentClick(Sender: TObject); + procedure PageControl1Change(Sender: TObject); + procedure stTransparentClick(Sender: TObject); + procedure stDrawBorderClick(Sender: TObject); + private + FOCBmp: TBitmap; + procedure ccbxColorChange(Sender: TObject); + procedure CreateControls; + function GetReportLink: TCustomdxOrgChartReportLink; + procedure pbxPreviewPaint(Sender: TObject); + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + protected + ccbxColor: TCustomComboBox; + ccbxGridLineColor: TCustomComboBox; + FPreviewBox: TCustomControl; + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + procedure LoadStrings; override; + procedure PaintPreview(ACanvas: TCanvas; R: TRect); override; + procedure UpdatePreview; override; + procedure UpdateControlsState; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property ReportLink: TCustomdxOrgChartReportLink read GetReportLink; + end; + + PdxOrgChartGetAsGraphicData = ^TdxOrgChartGetAsGraphicData; + TdxOrgChartGetAsGraphicData = record + OrgChart: TdxCustomOrgChart; + GraphicClass: TGraphicClass; + FullExpand: Boolean; + Transparent: Boolean; + TransparentColor: TColor; + Enhanced: Boolean; + end; + +function dxGetOrgChartAsGraphic(const AData: TdxOrgChartGetAsGraphicData): TGraphic; + +implementation + +{$R *.DFM} + +uses + SysUtils, Messages, cxClasses, dxPSRes, dxPSUtl, dxPSGlbl, dxExtCtrls; + +type + TdxOrgChartAccess = class(TdxCustomOrgChart); + +function dxGetOrgChartAsGraphic(const AData: TdxOrgChartGetAsGraphicData): TGraphic; + + procedure ProcessPaintMessages; + var + Msg: TMsg; + begin + while PeekMessage(Msg, 0, WM_PAINT, WM_PAINT, PM_NOREMOVE) do + begin + case Integer(GetMessage(Msg, 0, WM_PAINT, WM_PAINT)) of + -1: Break; + 0: begin + PostQuitMessage(Msg.wParam); + Break; + end; + end; + DispatchMessage(Msg); + end; + end; + +var + Graphic: TGraphic; + Canvas: TCanvas; + DC: HDC; + IsBitmap, IsMetafile: Boolean; + SaveLeftEdge, SaveTopEdge: Integer; + SaveSelected: TdxOcNode; + SaveAnimated: Boolean; +begin + Result := nil; + if (AData.OrgChart = nil) or (AData.GraphicClass = nil) then + Exit; + + if AData.FullExpand then + begin + AData.OrgChart.FullExpand; + ProcessPaintMessages; + end; + + IsBitmap := AData.GraphicClass.InheritsFrom(TBitmap); + IsMetafile := AData.GraphicClass.InheritsFrom(TMetafile); + try + if IsMetafile then + Graphic := TMetafile.Create + else + Graphic := TBitmap.Create; + Graphic.Width := AData.OrgChart.FullWidth; + Graphic.Height := AData.OrgChart.FullHeight; + try + if IsMetafile then + begin + TMetafile(Graphic).Enhanced := AData.Enhanced; + Canvas := TMetafileCanvas.Create(TMetafile(Graphic), 0); + end + else + Canvas := TBitmap(Graphic).Canvas; + + try + if not IsMetafile and AData.Transparent then + begin + Canvas.Brush.Color := AData.TransparentColor; + Canvas.FillRect(MakeRect(0, 0, Graphic.Width, Graphic.Height)); + end; + DC := Canvas.Handle; + with TdxOrgChartAccess(AData.OrgChart) do + begin + SaveSelected := Selected; + SaveAnimated := ocAnimate in Options; + SaveLeftEdge := LeftEdge; + SaveTopEdge := TopEdge; + LeftEdge := 0; + TopEdge := 0; + MoveWindowOrg(DC, LeftEdge, TopEdge); + ControlState := ControlState + [csPaintCopy]; + try + Selected := nil; + if SaveAnimated then Options := Options - [ocAnimate]; + PaintWindow(DC); + finally + ControlState := ControlState - [csPaintCopy]; + MoveWindowOrg(DC, -LeftEdge, -TopEdge); + LeftEdge := SaveLeftEdge; + TopEdge := SaveTopEdge; + if SaveAnimated then Options := Options + [ocAnimate]; + Selected := SaveSelected; + end; + end; + if IsBitmap and AData.Transparent then + TBitmap(Graphic).TransparentColor := AData.TransparentColor; + if not IsMetafile and not IsBitmap then + begin + Result := dxPSUtl.CreateGraphic(AData.GraphicClass); + Result.Assign(Graphic); + end + else + Result := Graphic; + finally + if IsMetafile then Canvas.Free; + end; + finally + if not IsMetafile and not IsBitmap then Graphic.Free; + end; + except + if Result <> nil then Result.Free; + raise; + end; +end; + +{ TCustomdxOrgChartReportLink } + +constructor TCustomdxOrgChartReportLink.Create(AOwner: TComponent); +begin + inherited; + FFullExpand := False; + FUseMetafile := True; +end; + +procedure TCustomdxOrgChartReportLink.Assign(Source: TPersistent); +begin + inherited; + if Source is TCustomdxOrgChartReportLink then + with TCustomdxOrgChartReportLink(Source) do + begin + Self.FullExpand := FullExpand; + Self.UseMetafile := UseMetafile; + end; +end; + +function TCustomdxOrgChartReportLink.GetGraphic: TGraphic; +var + Data: TdxOrgChartGetAsGraphicData; +begin + Result := nil; + if (OrgChart = nil) or (OrgChart.Count = 0) then Exit; + FillChar(Data, SizeOf(TdxOrgChartGetAsGraphicData), 0); + Data.OrgChart := OrgChart; + Data.GraphicClass := GetGraphicClass; + Data.FullExpand := FullExpand; + Data.Transparent := Transparent; + Data.TransparentColor := TransparentColor; + Data.Enhanced := True; + Result := dxGetOrgChartAsGraphic(Data); +end; + +function TCustomdxOrgChartReportLink.GetGraphicClass: TGraphicClass; +const + GraphicClasses: array[Boolean] of TGraphicClass = (TBitmap, TMetafile); +begin + Result := GraphicClasses[UseMetafile]; +end; + +procedure TCustomdxOrgChartReportLink.InternalRestoreDefaults; +begin + inherited; + FullExpand := False; + UseMetafile := True; +end; + +procedure TCustomdxOrgChartReportLink.InternalRestoreFromOriginal; +begin + inherited; + if OrgChart <> nil then TransparentColor := OrgChart.Color; +end; + +procedure TCustomdxOrgChartReportLink.SetFullExpand(Value: Boolean); +begin + if FFullExpand <> Value then + begin + FFullExpand := Value; + LinkModified(True); + end; +end; + +function TCustomdxOrgChartReportLink.GetOrgChart: TdxOrgChart; +begin + Result := TdxOrgChart(Component); +end; + +{ TdxOCReportLinkDesignWindow } + +constructor TdxOCReportLinkDesignWindow.Create(AOwner: TComponent); + + function CreatePreviewBitmap: TBitmap; + begin + Result := TBitmap.Create; + try + ocPreview.FullExpand; + Result.Width := ocPreview.FullWidth + 1; + Result.Height := ocPreview.FullHeight + 1; + Control_PaintWindow(ocPreview, Result.Canvas.Handle); + except + FreeAndNil(Result); + raise; + end; + end; + +begin + HelpContext := dxhcOrgChartReportLinkDesigner; + inherited; + CreateControls; + PageControl1.ActivePage := PageControl1.Pages[0]; + + FOCBmp := CreatePreviewBitmap; +end; + +destructor TdxOCReportLinkDesignWindow.Destroy; +begin + FreeAndNil(FOCBmp); + inherited; +end; + +procedure TdxOCReportLinkDesignWindow.CreateControls; +var + R: TRect; +begin + ccbxColor := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(ccbxColor) do + begin + BoundsRect := bvlColorHolder.BoundsRect; + Tag := MakeTTag(0); + Parent := gbxTransparent; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := dxDefaultColor; +// DropDownCount := Items.Count; + OnChange := ccbxColorChange; + end; + lblColor.FocusControl := ccbxColor; + + ccbxGridLineColor := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(ccbxGridLineColor) do + begin + BoundsRect := bvlLineColorHolder.BoundsRect; + Tag := MakeTTag(1); + Parent := gbxBorder; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := dxDefaultGridLineColor; +// DropDownCount := Items.Count; + OnChange := ccbxColorChange; + end; + lblGridLinesColor.FocusControl := ccbxGridLineColor; + FPreviewBox := TdxPSPaintPanel.Create(Self); + with TdxPSPaintPanel(FPreviewBox) do + begin + Parent := pnlPreview; + R := pnlPreview.BoundsRect; + OffsetRect(R, -R.Left, -R.Top); + InflateRect(R, -4, -4); + BoundsRect := R; + EdgeInner := esNone; + EdgeOuter := esNone; + OnPaint := pbxPreviewPaint; + end; +end; + +{$IFDEF DELPHI7} +function TdxOCReportLinkDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +procedure TdxOCReportLinkDesignWindow.LoadStrings; +var + Item: TdxOcNode; +begin + inherited; + tshOptions.Caption := cxGetResourceString(@sdxOptions); + + Item := ocPreview.Items[0]; + Item.Text := cxGetResourceString(@sdxCorporateHeadquarters); + Item[0].Text := cxGetResourceString(@sdxSalesAndMarketing); + Item[0].Items[0].Text := cxGetResourceString(@sdxFieldOfficeCanada); + Item[1].Text := cxGetResourceString(@sdxEngineering); + + stDrawBorder.Caption := ' ' + cxGetResourceString(@sdxBorderLines) + ' '; + stTransparent.Caption := ' ' + cxGetResourceString(@sdxTransparent) + ' '; + lblColor.Caption := cxGetResourceString(@sdxColor); + lblGridLinesColor.Caption := cxGetResourceString(@sdxGridLinesColor); + lblPreview.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); +end; + +procedure TdxOCReportLinkDesignWindow.DoInitialize; +begin + inherited; + gbxTransparent.Visible := not ReportLink.UseMetafile; + chbxTransparent.Visible := not ReportLink.UseMetafile; + stTransparent.Visible := not ReportLink.UseMetafile; + if ReportLink.UseMetafile then + begin + stDrawBorder.BoundsRect := stTransparent.BoundsRect; + chbxDrawBorder.BoundsRect := chbxTransparent.BoundsRect; + gbxBorder.BoundsRect := gbxTransparent.BoundsRect; + end; + + chbxFullExpand.Checked := ReportLink.FullExpand; + chbxDrawBorder.Checked := ReportLink.DrawBorder; + chbxTransparent.Checked := ReportLink.Transparent; + TdxPSColorCombo(ccbxColor).ColorValue := ReportLink.Color; + TdxPSColorCombo(ccbxGridLineColor).ColorValue := ReportLink.BorderColor; +end; + +procedure TdxOCReportLinkDesignWindow.UpdateControlsState; +begin + inherited; + ccbxColor.Enabled := not chbxTransparent.Checked; + lblColor.Enabled := not chbxTransparent.Checked; + ccbxGridLineColor.Enabled := chbxDrawBorder.Checked; + lblGridLinesColor.Enabled := chbxDrawBorder.Checked; +end; + +procedure TdxOCReportLinkDesignWindow.pbxPreviewPaint(Sender: TObject); +begin + with TdxPSPaintPanel(Sender) do + PaintPreview(Canvas, ClientRect); +end; + +procedure TdxOCReportLinkDesignWindow.PaintPreview(ACanvas: TCanvas; R: TRect); +var + OffsetX, OffsetY: Integer; +begin + inherited; + OffsetRect(R, -R.Left, -R.Top); + InflateRect(R, -4, -4); + + ACanvas.Brush.Style := bsSolid; + { border } + if ReportLink.DrawBorder then + begin + InflateRect(R, 1, 1); + ACanvas.Brush.Color := ReportLink.BorderColor; + ACanvas.FrameRect(R); + InflateRect(R, -1, -1); + end; + { interior } + if not ReportLink.Transparent then + begin + ACanvas.Brush.Color := ReportLink.Color; + ACanvas.FillRect(R); + end; + { charts } + OffsetX := R.Left + (R.Right - R.Left - FOCBmp.Width) div 2; + OffsetY := R.Top + (R.Bottom - R.Top - FOCBmp.Height) div 2; + ACanvas.Brush.Style := bsClear; + ACanvas.BrushCopy(Bounds(OffsetX, OffsetY, FOCBmp.Width, FOCBmp.Height), + FOCBmp, Rect(0, 0, FOCBmp.Width, FOCBmp.Height), + FOCBmp.Canvas.Pixels[0, FOCBmp.Height - 1]); +end; + +function TdxOCReportLinkDesignWindow.GetReportLink: TCustomdxOrgChartReportLink; +begin + Result := inherited ReportLink as TCustomdxOrgChartReportLink; +end; + +procedure TdxOCReportLinkDesignWindow.ccbxColorChange(Sender: TObject); +var + AColor: TColor; +begin + if LockControlsUpdate then Exit; + AColor := TdxPSColorCombo(Sender).ColorValue; + case TTagToInt(TdxPSColorCombo(Sender).Tag) of + 0: ReportLink.Color := AColor; + 1: ReportLink.BorderColor := AColor; + end; + Modified := True; + UpdatePreview; +end; + +procedure TdxOCReportLinkDesignWindow.UpdatePreview; +begin + FPreviewBox.Invalidate; +end; + +procedure TdxOCReportLinkDesignWindow.lblColorClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; + TCustomComboBox(ActiveControl).DroppedDown := True; +end; + +procedure TdxOCReportLinkDesignWindow.chbxFullExpandClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.FullExpand := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TdxOCReportLinkDesignWindow.chbxDrawBorderClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.DrawBorder := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TdxOCReportLinkDesignWindow.chbxTransparentClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.Transparent := TCheckBox(Sender).Checked; + Modified := True; + UpdatePreview; +end; + +procedure TdxOCReportLinkDesignWindow.stTransparentClick(Sender: TObject); +begin + if chbxTransparent.CanFocus then ActiveControl := chbxTransparent; + chbxTransparent.Checked := not chbxTransparent.Checked; +end; + +procedure TdxOCReportLinkDesignWindow.PageControl1Change(Sender: TObject); +begin + lblPreview.Parent := TPageControl(Sender).ActivePage; +end; + +procedure TdxOCReportLinkDesignWindow.stDrawBorderClick(Sender: TObject); +begin + if chbxDrawBorder.CanFocus then ActiveControl := chbxDrawBorder; + chbxDrawBorder.Checked := not chbxDrawBorder.Checked; +end; + +procedure TdxOCReportLinkDesignWindow.CMDialogChar(var Message: TCMDialogChar); +var + I: Integer; +begin + inherited; + with PageControl1 do + for I := 0 to PageCount - 1 do + if IsAccel(Message.CharCode, Pages[I].Caption) then + begin + Message.Result := 1; + ActivePage := Pages[I]; + Exit; + end; +end; + +initialization + dxPSRegisterReportLink(TdxOrgChartReportLink, TdxOrgChart, TdxOCReportLinkDesignWindow); + +finalization + dxPSUnregisterReportLink(TdxOrgChartReportLink, TdxOrgChart, TdxOCReportLinkDesignWindow); + +end. + + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxOCLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxOCLnkReg.pas new file mode 100644 index 00000000..60988f43 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxOCLnkReg.pas @@ -0,0 +1,60 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxOCLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI9} + DesignIntf, +{$ENDIF} + Classes, dxPSdxOCLnk; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterNoIcon([TdxOrgChartReportLink]) +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxOILnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxOILnk.pas new file mode 100644 index 00000000..b035a6a2 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxOILnk.pas @@ -0,0 +1,70 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxOILnk; + +interface + +{$I cxVer.inc} + +uses + dxOI, dxPSdxInsLnk; + +type + TdxRTTIInspectorReportLink = class(TCustomdxInspectorReportLink) + private + function GetRTTIInspector: TdxRTTIInspector; + public + property RTTIInspector: TdxRTTIInspector read GetRTTIInspector; + end; + +implementation + +uses + dxPSCore; + +function TdxRTTIInspectorReportLink.GetRTTIInspector: TdxRTTIInspector; +begin + Result := TdxRTTIInspector(Component); +end; + +initialization + dxPSRegisterReportLink(TdxRTTIInspectorReportLink, TdxRTTIInspector, TdxInspectorDesignWindow); + +finalization + dxPSUnregisterReportLink(TdxRTTIInspectorReportLink, TdxRTTIInspector, TdxInspectorDesignWindow); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxOILnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxOILnkReg.pas new file mode 100644 index 00000000..98e7c349 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxOILnkReg.pas @@ -0,0 +1,54 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxOILnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + Classes, dxPSdxOILnk; + +procedure Register; +begin + RegisterNoIcon([TdxRTTIInspectorReportLink]); +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxPageControlProducer.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxPageControlProducer.pas new file mode 100644 index 00000000..04937709 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxPageControlProducer.pas @@ -0,0 +1,145 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxPageControlProducer; + +interface + +{$I cxVer.inc} + +uses + Classes, Controls, dxPSContainerLnk, dxPageControl; + +type + TdxPSdxPageControlIterator = class(TdxPSWinControlIterator) + private + function GetPageControl: TdxPageControl; + protected + function GetControl(Index: Integer): TControl; override; + function GetControlCount: Integer; override; + public + property PageControl: TdxPageControl read GetPageControl; + end; + + TdxPSdxTabSheetProducer = class(TdxPSRootContainerProducer) + public + function Control: TdxTabSheet; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + + TdxPSdxPageControlProducer = class(TdxPSRootContainerProducer) + protected + function CanProcessChild(AChildControl: TControl): Boolean; override; + class function IteratorClass: TdxPSWinControlIteratorClass; override; + public + function Control: TdxPageControl; reintroduce; overload; + class function ControlClass: TControlClass; override; + end; + +implementation + +{ TdxPSdxPageControlIterator } + +function TdxPSdxPageControlIterator.GetControl(Index: Integer): TControl; +begin + Result := PageControl.ActivePage; +end; + +function TdxPSdxPageControlIterator.GetControlCount: Integer; +begin + Result := Ord(PageControl.PageCount > 0); +end; + +function TdxPSdxPageControlIterator.GetPageControl: TdxPageControl; +begin + Result := TdxPageControl(Control); +end; + +{ TdxPSdxTabSheetProducer } + +function TdxPSdxTabSheetProducer.Control: TdxTabSheet; +begin + Result := inherited Control as TdxTabSheet; +end; + +class function TdxPSdxTabSheetProducer.ControlClass: TControlClass; +begin + Result := TdxTabSheet; +end; + +{ TdxPSdxPageControlProducer } + +function TdxPSdxPageControlProducer.Control: TdxPageControl; +begin + Result := inherited Control as TdxPageControl; +end; + +class function TdxPSdxPageControlProducer.ControlClass: TControlClass; +begin + Result := TdxPageControl; +end; + +function TdxPSdxPageControlProducer.CanProcessChild(AChildControl: TControl): Boolean; +begin + Result := AChildControl = Control.ActivePage; +end; + +class function TdxPSdxPageControlProducer.IteratorClass: TdxPSWinControlIteratorClass; +begin + Result := TdxPSdxPageControlIterator; +end; + +procedure RegisterAssistants; +begin + TdxPSdxTabSheetProducer.Register; + TdxPSdxPageControlProducer.Register; +end; + +procedure UnregisterAssistants; +begin + TdxPSdxPageControlProducer.Unregister; + TdxPSdxTabSheetProducer.Unregister; +end; + +initialization + RegisterAssistants; + dxPSContainerLnk.dxPSRegisterContainers([TdxTabSheet, TdxPageControl]); + +finalization + dxPSContainerLnk.dxPSUnregisterContainers([TdxTabSheet, TdxPageControl]); + UnregisterAssistants; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxTLLnk.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSdxTLLnk.dfm new file mode 100644 index 00000000..d68ed744 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxTLLnk.dfm @@ -0,0 +1,1468 @@ +object dxTLReportLinkDesignWindow: TdxTLReportLinkDesignWindow + Left = 485 + Top = 220 + BorderStyle = bsDialog + Caption = 'dxTLReportLinkDesigner' + ClientHeight = 434 + ClientWidth = 582 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 4 + Width = 574 + Height = 395 + ActivePage = tshColors + TabOrder = 0 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = '&Options' + object Bevel11: TBevel + Left = 46 + Top = 13 + Width = 221 + Height = 4 + Shape = bsBottomLine + end + object imgShow: TImage + Left = 9 + Top = 35 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblShow: TLabel + Left = 6 + Top = 9 + Width = 26 + Height = 13 + Caption = 'Show' + end + object Bevel16: TBevel + Left = 89 + Top = 107 + Width = 178 + Height = 4 + Shape = bsBottomLine + end + object bvlShowImages: TBevel + Left = 89 + Top = 223 + Width = 178 + Height = 4 + Shape = bsBottomLine + end + object Bevel2: TBevel + Left = 89 + Top = 164 + Width = 178 + Height = 3 + Shape = bsBottomLine + end + object Bevel10: TBevel + Left = 90 + Top = 282 + Width = 177 + Height = 4 + Shape = bsBottomLine + end + object Image1: TImage + Left = 9 + Top = 303 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888777777777777777708888888888 + 888887FFFFFFFFFFFFFFF08888888888888887F7777777777777F07777708888 + 888887F7777777777777F0FFFFF08888888887F7777777777777F07777F07777 + 708887FFFFFFFFFFFFFFF07777F0FFFFF08887F777777777777FF07777F07777 + F08887FFFFFFFFFFFFFFF0FFFFF07777F08887F77777777777FFF077FFF07777 + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777777FFFFF0777FF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777FFFFFFFF07FFFF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF0777FF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF077FFF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777777F077FFF077FF + F08887F7777777777777F0FFFFF0FFFFF08887F7777777777777F0FFFFF07FFF + F08887FFFFFFFFFFFFFFF07777F0FFFFF0888000000000000000007777F077FF + F08888888887F7777777777777F0FFFFF08888888887FFFFFFFFFFFFFFF07777 + F0888888888000000000000000007777F08888888888888887F7777777777777 + F08888888888888887FFFFFFFFFFFFFFF0888888888888888000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblOnEveryPage: TLabel + Left = 8 + Top = 278 + Width = 72 + Height = 13 + Caption = 'On Every Page' + end + object chbxShowGrid: TCheckBox + Tag = 6 + Left = 90 + Top = 177 + Width = 165 + Height = 17 + Caption = '&Grid Lines' + TabOrder = 6 + OnClick = chbxShowClick + end + object chbxShowNodeGrid: TCheckBox + Tag = 5 + Left = 90 + Top = 198 + Width = 165 + Height = 17 + Caption = 'Node Grid Lines' + TabOrder = 7 + OnClick = chbxShowClick + end + object chbxShowBands: TCheckBox + Left = 90 + Top = 23 + Width = 165 + Height = 17 + Caption = 'Ba&nds' + TabOrder = 0 + OnClick = chbxShowClick + end + object chbxShowHeaders: TCheckBox + Tag = 1 + Left = 90 + Top = 43 + Width = 165 + Height = 17 + Caption = '&Headers' + TabOrder = 1 + OnClick = chbxShowClick + end + object chbxShowFooters: TCheckBox + Tag = 2 + Left = 90 + Top = 64 + Width = 165 + Height = 17 + Caption = 'Foo&ters' + TabOrder = 2 + OnClick = chbxShowClick + end + object chbxShowGroupFooters: TCheckBox + Tag = 3 + Left = 90 + Top = 84 + Width = 165 + Height = 17 + Caption = 'G&roup Footers' + TabOrder = 3 + OnClick = chbxShowClick + end + object chbxShowStateImages: TCheckBox + Tag = 9 + Left = 90 + Top = 236 + Width = 165 + Height = 17 + Caption = 'State Images' + TabOrder = 8 + OnClick = chbxShowClick + end + object chbxShowImages: TCheckBox + Tag = 8 + Left = 90 + Top = 256 + Width = 165 + Height = 17 + Caption = 'Images' + TabOrder = 9 + OnClick = chbxShowClick + end + object chbxShowExpandButtons: TCheckBox + Tag = 17 + Left = 90 + Top = 119 + Width = 165 + Height = 17 + Caption = 'Expand Buttons' + TabOrder = 4 + OnClick = chbxShowClick + end + object chbxShowTreeLines: TCheckBox + Tag = 16 + Left = 90 + Top = 140 + Width = 165 + Height = 17 + Caption = 'TreeLines' + TabOrder = 5 + OnClick = chbxShowClick + end + object chbxBandsOnEveryPage: TCheckBox + Left = 90 + Top = 300 + Width = 165 + Height = 17 + Caption = 'Ba&nds On Every Page' + TabOrder = 10 + OnClick = chbxBandsOnEveryPageClick + end + object chbxHeadersOnEveryPage: TCheckBox + Left = 90 + Top = 322 + Width = 165 + Height = 17 + Caption = 'Headers On Every &Page' + TabOrder = 11 + OnClick = chbxHeadersOnEveryPageClick + end + object chbxFootersOnEveryPage: TCheckBox + Left = 90 + Top = 344 + Width = 165 + Height = 17 + Caption = 'Footers On E&very Page' + TabOrder = 12 + OnClick = chbxFootersOnEveryPageClick + end + object lblPreviewWindow: TStaticText + Left = 279 + Top = 0 + Width = 82 + Height = 14 + AutoSize = False + Caption = 'Preview' + TabOrder = 13 + end + end + object tshColors: TTabSheet + Caption = '&Color' + object lblGridlineColor: TLabel + Left = 9 + Top = 296 + Width = 74 + Height = 13 + Caption = '&Grid Line color :' + OnClick = lblColorClick + end + object bvlGridLineColorHolder: TBevel + Left = 122 + Top = 291 + Width = 145 + Height = 22 + Visible = False + end + object bvlTreeLineColorHolder: TBevel + Left = 122 + Top = 320 + Width = 145 + Height = 22 + end + object lblTreeLineColor: TLabel + Left = 9 + Top = 325 + Width = 78 + Height = 13 + Caption = 'TreeLines Color:' + end + object lblDrawMode: TLabel + Left = 7 + Top = 21 + Width = 58 + Height = 13 + Caption = 'Draw &Mode:' + FocusControl = cbxDrawMode + OnClick = lblDrawModeClick + end + object gbxFixedTransparent: TGroupBox + Left = 4 + Top = 162 + Width = 269 + Height = 121 + Caption = ' ' + TabOrder = 4 + object lblBandColor: TLabel + Left = 5 + Top = 23 + Width = 60 + Height = 13 + Caption = '&Band color : ' + OnClick = lblColorClick + end + object lblHeaderColor: TLabel + Left = 5 + Top = 47 + Width = 71 + Height = 13 + Caption = '&Header color : ' + OnClick = lblColorClick + end + object lblRowFooterColor: TLabel + Left = 5 + Top = 96 + Width = 94 + Height = 13 + Caption = 'Gro&upFooter color :' + OnClick = lblColorClick + end + object bvlBandColorHolder: TBevel + Tag = 2 + Left = 118 + Top = 17 + Width = 145 + Height = 22 + Visible = False + end + object bvlHeaderColorHolder: TBevel + Left = 118 + Top = 42 + Width = 145 + Height = 22 + Visible = False + end + object bvlRowFooterColorHolder: TBevel + Left = 118 + Top = 92 + Width = 145 + Height = 22 + Visible = False + end + object lblGroupNodeColor: TLabel + Left = 5 + Top = 72 + Width = 87 + Height = 13 + Caption = 'Group&Node color :' + OnClick = lblColorClick + end + object bvlGroupNodeColorHolder: TBevel + Left = 118 + Top = 67 + Width = 145 + Height = 22 + Visible = False + end + end + object gbxTransparent: TGroupBox + Left = 4 + Top = 51 + Width = 269 + Height = 104 + Caption = ' ' + TabOrder = 2 + object lblColor: TLabel + Left = 5 + Top = 23 + Width = 29 + Height = 13 + Caption = 'C&olor:' + OnClick = lblColorClick + end + object bvlColorHolder: TBevel + Left = 118 + Top = 18 + Width = 145 + Height = 22 + Visible = False + end + object lblPreviewColor: TLabel + Left = 5 + Top = 77 + Width = 71 + Height = 13 + Caption = '&Preview color :' + OnClick = lblColorClick + end + object bvlPreviewColorHolder: TBevel + Tag = 1 + Left = 118 + Top = 72 + Width = 145 + Height = 22 + Visible = False + end + object lblEvenColor: TLabel + Left = 5 + Top = 47 + Width = 59 + Height = 13 + Caption = 'Even Color :' + OnClick = lblColorClick + end + object bvlEvenColorHolder: TBevel + Left = 118 + Top = 43 + Width = 145 + Height = 22 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 15 + Top = 49 + Width = 15 + Height = 17 + Caption = ' Tr&ansparent ' + TabOrder = 1 + OnClick = chbxTransparentClick + end + object chbxFixedTransparent: TCheckBox + Tag = 1 + Left = 15 + Top = 160 + Width = 15 + Height = 17 + TabOrder = 3 + OnClick = chbxTransparentClick + end + object cbxDrawMode: TComboBox + Left = 104 + Top = 15 + Width = 169 + Height = 25 + Style = csOwnerDrawFixed + ItemHeight = 19 + TabOrder = 0 + OnChange = cbxDrawModeChange + OnDrawItem = cbxDrawModeDrawItem + Items.Strings = ( + 'Simpe' + 'Odd\Even Rows Mode' + 'Borrow From Source') + end + object stTransparent: TStaticText + Left = 30 + Top = 50 + Width = 76 + Height = 17 + Caption = ' &Transparent ' + FocusControl = chbxTransparent + TabOrder = 5 + OnClick = stTransparentClick + end + object stFixedTransparent: TStaticText + Left = 30 + Top = 161 + Width = 98 + Height = 17 + Caption = ' Fixed Transparent ' + FocusControl = chbxFixedTransparent + TabOrder = 6 + OnClick = stFixedTransparentClick + end + end + object tshFonts: TTabSheet + Caption = '&Font' + object btnChangeFont: TButton + Left = 6 + Top = 189 + Width = 116 + Height = 23 + Caption = 'Change Fo&nt ...' + TabOrder = 0 + OnClick = btnChangeFontClick + end + object lbxFonts: TListBox + Left = 6 + Top = 16 + Width = 268 + Height = 167 + Style = lbOwnerDrawFixed + ItemHeight = 16 + MultiSelect = True + ParentShowHint = False + PopupMenu = pmChangeFont + ShowHint = True + TabOrder = 1 + OnClick = lbxFontsClick + OnDblClick = lbxFontsDblClick + OnDrawItem = lbxFontsDrawItem + OnKeyDown = FontsKeyDown + OnMouseMove = FontsMouseMove + end + end + object tshBehaviors: TTabSheet + Caption = '&Behaviors' + object Bevel12: TBevel + Left = 57 + Top = 13 + Width = 210 + Height = 4 + Shape = bsBottomLine + end + object Bevel13: TBevel + Left = 63 + Top = 85 + Width = 204 + Height = 4 + Shape = bsBottomLine + end + object Image3: TImage + Left = 9 + Top = 33 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object Image4: TImage + Left = 9 + Top = 104 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 7778800000000000000000000000078888888888880000000000000000000000 + 007880FFF7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7FF777777FFF77777FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F8F7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7F7F8888FF7F88888FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F8F7777777777777777777078888888888880F7F7F888FFF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F0788077777777777777777777770788C8888C88880F7FF888888FFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880F0F7777777FFFFFFFFFFFF0788CCCCCCCC880F77777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7F7F8888FF7F88888FF7 + F0788077777777777777777777770788C8888C88880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F7F7F8888FF7F888888F7 + F0788077777777777777777777770788CCCC8CC8880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCCCCCC880F7FF88888FFFFFFFFFFF7 + F07880F0F777777FFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F77777777777777777777 + F078800000000000000000000000078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F888888880F88888888888078888888888880F77777777777777777777 + F07880F800008880F80000000008078888888888880F77777777777777777777 + F07880FFFFFFFFF0FFFFFFFFFFFF078888888888880FFFFFFFFFFFFFFFFFFFFF + F078800000000000000000000000088888888888880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblExpandLevel: TLabel + Left = 90 + Top = 124 + Width = 68 + Height = 13 + Caption = 'Expand &level: ' + OnClick = lblExpandLevelClick + end + object bvlExpandLevelHolder: TBevel + Left = 210 + Top = 122 + Width = 58 + Height = 21 + Visible = False + end + object lblSelection: TLabel + Left = 6 + Top = 9 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object lblExpanding: TLabel + Left = 6 + Top = 81 + Width = 50 + Height = 13 + Caption = 'Expanding' + end + object lblRefinements: TLabel + Left = 7 + Top = 225 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlRefinements: TBevel + Left = 73 + Top = 230 + Width = 194 + Height = 4 + Shape = bsBottomLine + end + object imgRefinements: TImage + Left = 9 + Top = 248 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFF99999FF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F77777777FF7FCC99999FF07DDCCCCCCCCDD0F77777777FF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FCC99999FF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F777777FFFF7FCC99999FF07DDCDDDDCDDDD0F777777FFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FCC99999FF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F77777777FF7FCCCCCFFFF07DDDDDDDDDDDD0F77777777FF7F7777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFCCCCCFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFCCCCCCCF07DDCCCCCCCCDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFCCCCCFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F7777777FFF7FF9999999F07DDCDDDDCDDDD0F7777777FFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFF99999FF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F777777777F7FFFFFFFFFF07DDDDDDDDDDDD0F777777777F7F7777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F80000888887F88888888707DDDDDDDDDDDD0F80000888887F88888888 + 707DD0F80000000087F80000008707DDDDDDDDDDDD0F80000000087F80000008 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0FFFFFFFFFFF7FFFFFFFFF707DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + 707DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblLookAndFeel: TLabel + Left = 6 + Top = 152 + Width = 67 + Height = 13 + Caption = 'Look And Feel' + end + object Image8: TImage + Left = 9 + Top = 174 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D08777777777780877777788807DCCCCDCCDDD0877777777778787777788 + 8F07D08888888888880888888888807DCCCCCCCCDD0888888888888788888888 + 8F07D00000000000000000000000007DCCCCDCCDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F7777777FF07DDDDDDDDDDD0F777777777FF7F7777777 + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F777777FFF07DDDDDDDDDDD0F777777FFFFF7F777777F + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F7777777777F7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F77777FFFF07DDDDDDDDDDD0F77777777FFF7F77777FF + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D00000000000000000000000007DCDDDDCDDDD0000000000000000000000 + 0007D08888888888880888888888807DCCCCDCCDDD0777777777777777777777 + 7707D08888888888880888888888807DCCCCCCCCDD0F88888888888788888888 + 8707D08000000008880880000000807DCCCCDCCDDD0F00000000888788000000 + 8707D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + F707D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object Bevel15: TBevel + Left = 82 + Top = 156 + Width = 185 + Height = 4 + Shape = bsBottomLine + end + object chbxTransparentColumnGraphic: TCheckBox + Tag = 10 + Left = 90 + Top = 246 + Width = 179 + Height = 17 + Caption = 'Transparent &Graphics' + TabOrder = 5 + OnClick = chbxShowClick + end + object chbxDisplayGraphicsAsText: TCheckBox + Tag = 11 + Left = 90 + Top = 268 + Width = 179 + Height = 17 + Caption = 'Display Graphics As &Text' + TabOrder = 6 + OnClick = chbxShowClick + end + object chbxOnlySelected: TCheckBox + Left = 90 + Top = 31 + Width = 179 + Height = 17 + Caption = 'Only &selected' + TabOrder = 0 + OnClick = chbxOnlySelectedClick + end + object chbxExtendedSelect: TCheckBox + Left = 90 + Top = 53 + Width = 179 + Height = 17 + Caption = '&Extended select' + TabOrder = 1 + OnClick = chbxExtendedSelectClick + end + object chbxAutoNodesExpand: TCheckBox + Left = 90 + Top = 98 + Width = 179 + Height = 17 + Caption = '&Auto Node Expanded' + TabOrder = 2 + OnClick = chbxAutoNodesExpandClick + end + object chbxUse3DEffects: TCheckBox + Tag = 12 + Left = 90 + Top = 172 + Width = 179 + Height = 17 + Caption = '&Use 3D Effects' + TabOrder = 3 + OnClick = chbxShowClick + end + object chbxUseSoft3D: TCheckBox + Tag = 13 + Left = 90 + Top = 194 + Width = 179 + Height = 17 + Caption = 'Soft &3D' + TabOrder = 4 + OnClick = chbxShowClick + end + object chbxCheckMarksAsText: TCheckBox + Tag = 15 + Left = 90 + Top = 312 + Width = 179 + Height = 17 + Caption = 'Display Check Marks as Text' + TabOrder = 8 + OnClick = chbxShowClick + end + object chbxFlatCheckMarks: TCheckBox + Tag = 7 + Left = 90 + Top = 290 + Width = 179 + Height = 17 + Caption = 'Flat Check &Marks' + TabOrder = 7 + OnClick = chbxShowClick + end + end + object tshPreview: TTabSheet + Caption = 'Preview' + object Bevel9: TBevel + Left = 54 + Top = 13 + Width = 213 + Height = 4 + Shape = bsBottomLine + end + object lblPreviewLineCount: TLabel + Left = 90 + Top = 69 + Width = 99 + Height = 13 + Caption = 'Preview &Line Count: ' + OnClick = lblExpandLevelClick + end + object bvlPreviewLineCountHolder: TBevel + Left = 196 + Top = 66 + Width = 67 + Height = 21 + Visible = False + end + object lblPreview: TLabel + Left = 6 + Top = 9 + Width = 38 + Height = 13 + Caption = 'Preview' + end + object imgPreview: TImage + Left = 9 + Top = 33 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDD7777777777777777777777777DDDDDD0000000000000000000000000 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F888F7FF888F7F8888F7F07DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F0 + 7DDDDDD0F777777777777777777777F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCFFCCCCFFCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCFCCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCFCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCFCCFCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCFFCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F777777777777777777777F07DDDDDD0F7F888F7FF888F7FF888F7F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F88887F888887F888887F07DDDDDD0F7F00087F000087F000087F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0000000000000000000000000 + DDDD} + Transparent = True + end + object chbxShowPreview: TCheckBox + Tag = 4 + Left = 90 + Top = 23 + Width = 169 + Height = 17 + Caption = 'Pre&view' + TabOrder = 0 + OnClick = chbxShowClick + end + object chbxAutoCalcPreviewLines: TCheckBox + Left = 90 + Top = 43 + Width = 169 + Height = 17 + Caption = '&Auto Calc Preview Lines' + TabOrder = 1 + OnClick = chbxAutoCalcPreviewLinesClick + end + end + end + object pnlPreview: TPanel + Left = 287 + Top = 44 + Width = 282 + Height = 343 + BevelInner = bvLowered + BevelOuter = bvNone + Color = clWindow + Ctl3D = True + ParentCtl3D = False + TabOrder = 1 + object dxTLPreview: TdxTreeList + Left = 7 + Top = 4 + Width = 268 + Height = 330 + Bands = < + item + Caption = 'Item Data' + Width = 201 + end> + DefaultLayout = False + HeaderPanelRowCount = 1 + BorderStyle = bsNone + Ctl3D = True + Enabled = False + ParentCtl3D = False + TabOrder = 0 + Visible = False + Images = ilTLImages + LookAndFeel = lfFlat + Options = [aoColumnSizing, aoColumnMoving, aoEditing, aoTabThrough, aoRowSelect, aoPreview, aoAutoWidth] + OptionsEx = [aoBandHeaderWidth, aoAutoCalcPreviewLines, aoBandSizing, aoBandMoving, aoDragScroll, aoDragExpand] + PaintStyle = psOutlook + StateImages = ilTLImages + TreeLineColor = clGrayText + ScrollBars = ssNone + ShowBands = True + ShowButtons = False + ShowGrid = True + ShowRowFooter = True + ShowFooter = True + OnCustomDrawBand = dxTLPreviewCustomDrawBand + OnCustomDrawColumnHeader = dxTLPreviewCustomDrawColumnHeader + OnCustomDrawCell = dxTLPreviewCustomDrawCell + OnCustomDrawFooterNode = dxTLPreviewCustomDrawFooterNode + OnCustomDrawFooter = dxTLPreviewCustomDrawFooter + OnCustomDrawPreviewCell = dxTLPreviewCustomDrawPreviewCell + OnGetFooterCellText = dxTLPreviewGetFooterCellText + OnGetPreviewLineCount = dxTLPreviewGetPreviewLineCount + OnGetPreviewText = dxTLPreviewGetPreviewText + OnIsExistRowFooterCell = dxTLPreviewIsExistRowFooterCell + OnIsExistFooterCell = dxTLPreviewIsExistFooterCell + OnIsLevelFooter = dxTLPreviewIsLevelFooter + Data = { + FFFFFFFF03000000180000000000000000000000010000000000000000000000 + 020000000D0000004E6F6465203120436F6C2023310D0000004E6F6465203120 + 436F6C2023331800000000000000000000000100000000000000020000000200 + 00000D0000004E6F6465203220436F6C20233104000000547275651800000000 + 0000000000000001000000000000000000000002000000090000005375624E6F + 6465203100000000180000000000000000000000010000000000000000000000 + 01000000090000005375624E6F64652032180000000000000000000000010000 + 000000000001000000020000000D0000004E6F6465203320436F6C2023310400 + 0000547275651800000000000000000000000100000000000000000000000200 + 0000090000005375624E6F64652033090000005375624E6F64652033} + object dxTLPreviewColumn1: TdxTreeListColumn + Alignment = taLeftJustify + Width = 117 + BandIndex = 0 + RowIndex = 0 + end + object dxTLPreviewColumn3: TdxTreeListCheckColumn + Caption = 'Axisymmetric' + Width = 83 + BandIndex = 0 + RowIndex = 0 + OnCustomDrawCell = dxTLPreviewColumn3CustomDrawCell + AllowGrayed = True + ShowNullFieldStyle = nsInactive + ValueChecked = 'True' + ValueUnchecked = 'False' + end + object dxTLPreviewColumn4: TdxTreeListImageColumn + Alignment = taLeftJustify + Caption = 'Shape' + MinWidth = 16 + Width = 68 + BandIndex = 0 + RowIndex = 0 + OnCustomDrawCell = dxTLPreviewColumn4CustomDrawCell + Images = ilTLImages + ImageIndexes.Strings = ( + '0' + '1' + '2' + '3' + '4' + '5' + '6') + Values.Strings = ( + '' + '' + '2' + '3' + '4' + '5' + '6') + end + end + end + object ilTLImages: TImageList + Left = 5 + Top = 404 + Bitmap = { + 494C010107000A00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FF000000000000008400000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FF000000FF000000FF000000000000008400000084000000840000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF00000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF000000000000008400000084000000840000008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF00000000000000FF0000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FF000000FF000000FF00 + 0000FF000000FF000000FF000000000000008400000084000000840000008400 + 0000840000008400000000000000000000000000000000000000FF000000FF00 + 0000FF00000000000000FF000000FF000000FF00000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF00000000000000FF000000FF00 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FF000000FF00 + 0000FF000000FF000000FF000000000000008400000084000000840000008400 + 0000840000000000000000000000000000000000000000000000FF000000FF00 + 0000FF00000000000000FF000000FF000000FF00000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF00000000000000FF000000FF00 + 0000FF0000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF000000000000008400000084000000840000008400 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000000084000000000000008400FF000000FF000000000000000000 + 0000000000000000000000000000000000000000000000000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF00000000000000FF000000FF00 + 0000FF000000FF00000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF000000000000008400000084000000840000008400 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000000084000000840000000000000084000000840000008400000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FF0000008400 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FF000000FF000000FF000000000000008400000084000000840000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000000000008400 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FF000000FF000000000000008400000084000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000840000008400000084000000000000008400000084000000 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000FF000000FF000000FF000000FF000000FF00000084000000840000000000 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FF000000FF000000000000008400000084000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000008400000084000000840000000000000084000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FF000000FF000000FF000000FF00000084000000840000008400 + 0000000000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FF000000000000008400000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FF000000FF0000008400000084000000840000008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FF0000008400000084000000840000008400 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000084000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008484840000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FF00000084000000FF00000084000000840000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FF000000FF000000FF00000084000000FF000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000840000008400000084000000FF000000840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000848484008484840084848400C6C6C60084848400000000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF000000FF0000008400000084000000000000008400 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF00000084000000FF00000084000000840000000000 + 0000000000000000000000000000000000000000000000000000000000000084 + 000000840000FFFFFF0000FF0000FFFFFF0000FF000000840000008400000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 840084848400FFFFFF00C6C6C600FFFFFF00C6C6C60084848400848484000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF00000084000000FF00000084000000840000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF000000FF0000008400000084000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 0000FFFFFF0000FF0000FFFFFF0000FF000000FF000000840000008400000084 + 000000000000000000000000000000000000000000000000000084848400C6C6 + C600FFFFFF00C6C6C600FFFFFF00C6C6C600C6C6C60084848400848484008484 + 840000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF00000084000000FF0000008400000084000000840000008400 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF00000084000000FF00000084000000840000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF0000FF0000FFFFFF0000FF0000FFFFFF0000FF000000840000008400000084 + 000000840000000000000000000000000000000000000000000084848400FFFF + FF00C6C6C600FFFFFF00C6C6C600FFFFFF00C6C6C60084848400848484008484 + 840084848400000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF00000084000000FF00000084000000840000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF000000FF0000008400000084000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 0000FFFFFF00FFFFFF0000FF000000FF000000FF000000840000008400000084 + 000000840000000000000000000000000000000000000000000084848400C6C6 + C600FFFFFF00FFFFFF00C6C6C600C6C6C600C6C6C60084848400848484008484 + 840084848400000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF000000FF0000008400000084000000000000008400 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FF000000FF000000FF00000084000000FF00000084000000840000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF0000FF000000FF000000FF000000FF000000FF000000FF0000008400000084 + 000000840000000000000000000000000000000000000000000084848400FFFF + FF00C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600848484008484 + 840084848400000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF00000084000000FF00000084000000840000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FF000000FF000000FF000000FF0000008400000000000000840000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF00000084 + 000000840000000000000000000000000000000000000000000084848400C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6008484 + 840084848400000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF00000084000000FF0000008400000084000000840000008400 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FF000000FF000000FF0000008400000084000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF00000084 + 000000840000000000000000000000000000000000000000000084848400C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6008484 + 840084848400000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF00000084000000FF00000084000000840000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FF000000FF000000FF0000008400000084000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000084 + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF + 0000008400000084000000000000000000000000000000000000000000008484 + 8400C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6 + C60084848400848484000000000000000000000000000000000000000000FF00 + 0000FF0000000000000000000000000000000000000000000000000000008400 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FF000000FF0000008400000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000084000000FF000000FF000000FF000000FF000000FF0000008400000084 + 0000000000000000000000000000000000000000000000000000000000000000 + 000084848400C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600848484008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 000000000000FF000000FF000000FF000000FF000000FF000000FF0000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FF000000FF0000008400000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000084000000FF000000FF00000084000000840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000084848400C6C6C600C6C6C6008484840084848400000000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF0000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000840000008400000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084848400848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FF000000FF000000FF000000FF000000FF000000FF0000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFF0000FC7F003FFFFF0000 + F01F7FDF803F0000C0077FEF801F000000010077800F00000001003B80070000 + 8003003D80030000C007400180010000C007401D80010000E00F600DC0010000 + F01F7001E0010000F01FB805F0010000F83FDC0DF8010000FC7FEDFDFC010000 + FC7FF5FDFE010000FEFFF801FFFF0000FFFFFFFFFFFFFFFFFFFFFFFFF81FF83F + FF3FFF3FE007E00FF81FF81FC003C007E00FE00FC003C007C007C007C003C007 + C003C003C003C007C003C003C003E00FC003C003C003E00FC003C003C003F01F + C003C003C003F01FE003E003C003F83FF00FF00FC003F83FF83FF83FC003FC7F + FCFFFCFFE007FC7FFFFFFFFFF81FFEFF00000000000000000000000000000000 + 000000000000} + end + object pmChangeFont: TPopupMenu + OnPopup = pmChangeFontPopup + Left = 33 + Top = 404 + object miChangeFont: TMenuItem + Caption = 'Change Fo&nt ...' + Default = True + ShortCut = 16454 + OnClick = btnChangeFontClick + end + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxTLLnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxTLLnk.pas new file mode 100644 index 00000000..089bfd90 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxTLLnk.pas @@ -0,0 +1,5176 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxTLLnk; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + Menus, StdCtrls, ExtCtrls, ComCtrls, ImgList, dxCntner, dxTL, dxTLClms, + dxExEdtr, dxPSGlbl, dxBase, dxPSCore; + +type + TdxTreeListPaintOption = + (tlpoBands, tlpoHeaders, tlpoFooters, tlpoRowFooters, tlpoPreview, + tlpoPreviewGrid, tlpoGrid, tlpoFlatCheckMarks, tlpoImages, + tlpoStateImages, tlpoTransparentColumnGraphic, tlpoGraphicAsText, + tlpo3DEffects, tlpoSoft3D, tlpoRowFooterGrid, tlpoCheckMarksAsText, + tlpoTreeLines, tlpoExpandButtons); + TdxTreeListPaintOptions = set of TdxTreeListPaintOption; + + TdxTreeListLinkCellType = + (tlctUnknown, tlstBand, tlstCell, tlstFooter, tlstGroupFooter, tlstHeader, tlstPreview); + + TdxTreeListDrawMode = (tldmStrict, tldmOddEven, tldmBorrowSource); + + PdxTreeListBand = ^TdxTreeListBand; + PdxTreeListColumn = ^TdxTreeListColumn; + PdxTreeListNode = ^TdxTreeListNode; + + TdxTreeListColumnHelperClass = class of TdxTreeListColumnHelper; + + TdxTreeListColumnHelper = class(TdxCustomClassMapItem) + protected + class procedure GetImageLists(AColumn: TdxTreeListColumn; AProc: TdxPSGetImageListProc); virtual; + public + class function ColumnClass: TdxTreeListColumnClass; virtual; + class function PairClass: TClass; override; + class procedure Register; + end; + + TdxTreeListImageColumnHelper = class(TdxTreeListColumnHelper) + protected + class procedure GetImageLists(AColumn: TdxTreeListColumn; AProc: TdxPSGetImageListProc); override; + public + class function ColumnClass: TdxTreeListColumnClass; override; + end; + + TdxTLReportLinkCustomDrawBandCellEvent = procedure(Sender: TBasedxReportLink; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; ABand: TdxTreeListBand; + var AText: string; var AColor: TColor; AFont: TFont; + var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean) of object; + + TdxTLReportLinkCustomDrawCellEvent = procedure(Sender: TBasedxReportLink; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; ANode: TdxTreeListNode; + AColumn: TdxTreeListColumn; var AText: string; var AColor: TColor; + AFont: TFont; var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean) of object; + + TdxTLReportLinkCustomDrawFooterCellEvent = procedure(Sender: TBasedxReportLink; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; ANode: TdxTreeListNode; + AColumn: TdxTreeListColumn; var AText: string; var AColor: TColor; + AFont: TFont; var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean) of object; + + TdxTLReportLinkCustomDrawHeaderCellEvent = procedure(Sender: TBasedxReportLink; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; AColumn: TdxTreeListColumn; + var AText: string; var AColor: TColor; AFont: TFont; + var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ASorted: TdxCellSortOrder; var ADone: Boolean) of object; + + TdxTLReportLinkCustomDrawPreviewCellEvent = procedure(Sender: TBasedxReportLink; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; ANode: TdxTreeListNode; + var AText: string; var AColor, ATextColor: TColor; AFont: TFont; + var ADone: Boolean) of object; + + TdxTLReportLinkCustomDrawRowFooterCellEvent = procedure(Sender: TBasedxReportLink; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; ANode: TdxTreeListNode; + AColumn: TdxTreeListColumn; AFooterIndex: Integer; var AText: string; + var AColor: TColor; AFont: TFont; var ATextAlignX: TdxTextAlignX; + var ATextAlignY: TdxTextAlignY; var ADone: Boolean) of object; + + TCustomdxTreeListReportLink = class(TBasedxReportLink) + private + FAutoNodesExpand: Boolean; + FBandColor: TColor; + FBandFont: TFont; + FBandsOnEveryPage: Boolean; + FDrawMode: TdxTreeListDrawMode; + FEvenColor: TColor; + FEvenFont: TFont; + FExpandLevel: Integer; + FExtendedSelect: Boolean; + FFixedTransparent: Boolean; + FFooterFont: TFont; + FGraphicAsTextValue: string; + FGridLineColor: TColor; + FGroupNodeColor: TColor; + FGroupNodeFont: TFont; + FHeaderColor: TColor; + FHeaderFont: TFont; + FHorzDelimitByBands: Boolean; + FIsGraphicAsTextValueAssigned: Boolean; + FOddFont: TFont; + FOnlySelected: Boolean; + FOptions: TdxTreeListPaintOptions; + FPreviewColor: TColor; + FPreviewFont: TFont; + FPreviewLineCount: Integer; + FRowFooterColor: TColor; + FRowFooterFont: TFont; + FSupportedCustomDraw: Boolean; + FTreeLineColor: TColor; + + FOnCustomDrawBandCell: TdxTLReportLinkCustomDrawBandCellEvent; + FOnCustomDrawCell: TdxTLReportLinkCustomDrawCellEvent; + FOnCustomDrawFooterCell: TdxTLReportLinkCustomDrawFooterCellEvent; + FOnCustomDrawHeaderCell: TdxTLReportLinkCustomDrawHeaderCellEvent; + FOnCustomDrawPreviewCell: TdxTLReportLinkCustomDrawPreviewCellEvent; + FOnCustomDrawRowFooterCell: TdxTLReportLinkCustomDrawRowFooterCellEvent; + + FAbsoluteIndexes: TList; + FColumnInfos: TList; + FNodes: TList; + + FBandFontIndex: Integer; + FBandHeight: Integer; + FCustomDrawFontChanged: Boolean; + FEvenFontIndex: Integer; + FEvenHyperLinkFontIndex: Integer; + FFooterPanelHeight: Integer; + FFooterRowHeight: Integer; + FFullWidth: Integer; + FGroupNodeFontIndex: Integer; + FGroupRowHeight: Integer; + FGroupFooterRowHeight: Integer; + FFooterFontIndex: Integer; + FHeaderFontIndex: Integer; + FHeaderRowHeight: Integer; + FHorzDelimiterCell: TdxReportCell; + FHyperLinkFontIndex: Integer; + FOddHyperLinkFontIndex: Integer; + FOddFontIndex: Integer; + FPaintStyle: TdxTreeListPaintStyle; + FPreviewFontIndex: Integer; + FPreviewHeight: Integer; + FPreviewLineHeight: Integer; + FRowFooterFontIndex: Integer; + FRowHeight: Integer; + FSaveFont: TFont; + FShowRoot: Boolean; + + function GetCustomTreeList: TCustomdxTreeListControl; + function GetExpandLevel: Integer; + function GetExtendedColorManage: Boolean; + function GetGraphicAsTextValue: string; + function GetOddColor: TColor; + function GetOptions: TdxTreeListPaintOptions; + function GetUseColumnFont: Boolean; + function IsGraphicAsTextValueStored: Boolean; + procedure SetAutoNodesExpand(Value: Boolean); + procedure SetBandFont(Value: TFont); + procedure SetBandColor(Value: TColor); + procedure SetBandsOnEveryPage(Value: Boolean); + procedure SetDrawMode(Value: TdxTreeListDrawMode); + procedure SetEvenColor(Value: TColor); + procedure SetEvenFont(Value: TFont); + procedure SetExpandLevel(Value: Integer); + procedure SetExtendedColorManage(Value: Boolean); + procedure SetExtendedSelect(Value: Boolean); + procedure SetFixedTransparent(Value: Boolean); + procedure SetFooterFont(Value: TFont); + procedure SetGraphicAsTextValue(const Value: string); + procedure SetGridLineColor(Value: TColor); + procedure SetGroupNodeColor(Value: TColor); + procedure SetGroupNodeFont(Value: TFont); + procedure SetHeaderColor(Value: TColor); + procedure SetHeaderFont(Value: TFont); + procedure SetHorzDelimitByBands(Value: Boolean); + procedure SetOddFont(Value: TFont); + procedure SetOddColor(Value: TColor); + procedure SetPreviewLineCount(Value: Integer); + procedure SetOnCustomDrawBandCell(Value: TdxTLReportLinkCustomDrawBandCellEvent); + procedure SetOnCustomDrawCell(Value: TdxTLReportLinkCustomDrawCellEvent); + procedure SetOnCustomDrawFooterCell(Value: TdxTLReportLinkCustomDrawFooterCellEvent); + procedure SetOnCustomDrawHeaderCell(Value: TdxTLReportLinkCustomDrawHeaderCellEvent); + procedure SetOnCustomDrawPreviewCell(Value: TdxTLReportLinkCustomDrawPreviewCellEvent); + procedure SetOnCustomDrawRowFooterCell(Value: TdxTLReportLinkCustomDrawRowFooterCellEvent); + procedure SetOnlySelected(Value: Boolean); + procedure SetOptions(Value: TdxTreeListPaintOptions); + procedure SetPreviewColor(Value: TColor); + procedure SetPreviewFont(Value: TFont); + procedure SetRowFooterColor(Value: TColor); + procedure SetRowFooterFont(Value: TFont); + procedure SetSupportCustomDraw(Value: Boolean); + procedure SetTreeLineColor(Value: TColor); + procedure SetUseColumnFont(Value: Boolean); + + procedure AddNodes; + procedure CalcAbsoluteIndexes; + procedure CalcColumnInfos(AReportCells: TdxReportCells); + procedure CalcDelimiterCell(AReportCells: TdxReportCells); + procedure CalcFontIndexes(AReportCells: TdxReportCells); + procedure FreeHeaderInfos; + + function CanDrawImages(ANode: TdxTreeListNode): Boolean; + function CanDrawStateImages(ANode: TdxTreeListNode): Boolean; + function CanUseOddEvenMode(ANode: TdxTreeListNode; ANodeIndex: Integer): Boolean; + procedure CustomDrawFontChanged(Sender: TObject); + function GetBandLeft(AVisibleIndex: Integer): Integer; + function GetBandRect(AVisibleIndex: Integer): TRect; + function GetBandRegionHeight: Integer; + function GetBandWidth(AVisibleIndex: Integer): Integer; + function GetCellColor(ANode: TdxTreeListNode; AColumnIndex, ANodeIndex: Integer): TColor; + function GetCellCustomDrawInfo(AItem: TdxReportVisualItem; ANode: PdxTreeListNode; + AColumn: PdxTreeListColumn; ABand: PdxTreeListBand; + AFooterIndex: PInteger): TdxTreeListLinkCellType; + function GetEvenNodeFontIndex(AColumn: TdxTreeListColumn): Integer; + function GetOddEvenModeCellColor(ANodeIndex: Integer): TColor; + function GetOddEvenModeFontIndex(AColumn: TdxTreeListColumn; ANodeIndex: Integer): Integer; + function GetOddNodeFontIndex(AColumn: TdxTreeListColumn): Integer; + function GetCellFontIndex(ANode: TdxTreeListNode; AColumn: TdxTreeListColumn; + ANodeIndex: Integer): Integer; + procedure GetCellRect(AAbsoluteIndex: Integer; ACellType: TdxTreeListLinkCellType; + var R: TRect); + procedure GetColumnInfos(AAbsoluteIndex: Integer; ABandIndex, ARowIndex, + AColIndex, ARowCount, AColCount: PInteger; AIsFirstColumn, AIsLastColumn: PBoolean); + function GetLevelColor(ANode: TdxTreeListNode; ANodeIndex: Integer): TColor; + function GetPreviewColor(ANodeIndex: Integer): TColor; + function GetPreviewFontIndex(ANode: TdxTreeListNode; ANodeIndex: Integer): Integer; + function AreSelectedNodesExist: Boolean; + function IsCellTransparent(ANode: TdxTreeListNode): Boolean; + function IsLevelTransparent(ANode: TdxTreeListNode): Boolean; + function IsExtendedSelect: Boolean; + function IsHyperLinkColumnsExists: Boolean; + function IsPreviewTransparent(ANode: TdxTreeListNode): Boolean; + function IsSelectedNode(ANode: TdxTreeListNode): Boolean; + function MakeLookAndFeel: TdxLookAndFeel; + function NeedGroupNodeFontIndex(ANode: TdxTreeListNode; AFontIndex: Integer): Boolean; + + procedure ReadIsGraphicAsTextValueAssigned(AReader: TReader); + procedure WriteIsGraphicAsTextValueAssigned(AWriter: TWriter); + protected + FIndent: Integer; + procedure DefineProperties(Filer: TFiler); override; + + procedure ConstructReport(AReportCells: TdxReportCells); override; + procedure GetImageLists(AProc: TdxPSGetImageListProc); override; + procedure InternalRestoreDefaults; override; + procedure InternalRestoreFromOriginal; override; + function IsDrawFootersOnEveryPage: Boolean; override; + function IsDrawHeadersOnEveryPage: Boolean; override; + procedure MakeDelimiters(AReportCells: TdxReportCells; + AHorzDelimiters, AVertDelimiters: TList); override; + + procedure AssignValues(ADataItem: TAbstractdxReportCellData; + ANode: TdxTreeListNode; AColumn, AReferenceColumn: TdxTreeListColumn); virtual; abstract; + function GetDataClass(AColumn: TdxTreeListColumn; + ANode: TdxTreeListNode): TdxReportCellDataClass; virtual; + function GetGroupColumnIndex(ANode: TdxTreeListNode): Integer; virtual; + procedure GetImageListsFromColumns(AProc: TdxPSGetImageListProc); virtual; + procedure GetOwnedImageLists(AProc: TdxPSGetImageListProc); virtual; + function GetReferenceColumn(AColumn: TdxTreeListColumn; + ANode: TdxTreeListNode): TdxTreeListColumn; virtual; + function GetCheckColumnGlyph(AColumn: TdxTreeListColumn): TBitmap; virtual; + function IsCheckColumn(AColumn: TdxTreeListColumn): Boolean; virtual; + function IsGraphicColumn(AColumn: TdxTreeListColumn): Boolean; virtual; + function IsHyperLinkColumn(AColumn: TdxTreeListColumn): Boolean; virtual; + procedure PrepareConstruct(AReportCells: TdxReportCells); virtual; + procedure UnprepareConstruct(AReportCells: TdxReportCells); virtual; + + { custom draw support } + procedure CustomDraw(AItem: TAbstractdxReportCellData; ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; var ADone: Boolean); override; + procedure DoCustomDrawBandCell(ACanvas: TCanvas; ABoundsRect, + AClientRect: TRect; ABand: TdxTreeListBand; var AText: string; + var AColor: TColor; AFont: TFont; var ATextAlignX: TdxTextAlignX; + var ATextAlignY: TdxTextAlignY; var ADone: Boolean); virtual; + procedure DoCustomDrawCell(ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; + ANode: TdxTreeListNode; AColumn: TdxTreeListColumn; var AText: string; + var AColor: TColor; AFont: TFont; var ATextAlignX: TdxTextAlignX; + var ATextAlignY: TdxTextAlignY; var ADone: Boolean); virtual; + procedure DoCustomDrawFooterCell(ACanvas: TCanvas; ABoundsRect, + AClientRect: TRect; ANode: TdxTreeListNode; AColumn: TdxTreeListColumn; + var AText: string; var AColor: TColor; AFont: TFont; + var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean); virtual; + procedure DoCustomDrawHeaderCell(ACanvas: TCanvas; ABoundsRect, + AClientRect: TRect; AColumn: TdxTreeListColumn; var AText: string; + var AColor: TColor; AFont: TFont; var ATextAlignX: TdxTextAlignX; + var ATextAlignY: TdxTextAlignY; var ASorted: TdxCellSortOrder; + var ADone: Boolean); virtual; + procedure DoCustomDrawPreviewCell(ACanvas: TCanvas; ABoundsRect, + AClientRect: TRect; ANode: TdxTreeListNode; var AText: string; + var AColor: TColor; AFont: TFont; var ADone: Boolean); virtual; + procedure DoCustomDrawRowFooterCell(ACanvas: TCanvas; ABoundsRect, + AClientRect: TRect; ANode: TdxTreeListNode; AColumn: TdxTreeListColumn; + AFooterIndex: Integer; var AText: string; var AColor: TColor; AFont: TFont; + var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean); virtual; + function IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; override; + + { options access } + function AutoCalcPreviewLines: Boolean; + function CheckMarksAsText: Boolean; + function FlatCheckMarks: Boolean; + function GraphicsAsText: Boolean; + function OddEvenMode: Boolean; + function ShowBands: Boolean; + function ShowExpandButtons: Boolean; + function ShowFooters: Boolean; + function ShowGrid: Boolean; + function ShowHeaders: Boolean; + function ShowImages: Boolean; + function ShowPreview: Boolean; + function ShowPreviewGrid: Boolean; + function ShowRowFooterGrid: Boolean; + function ShowRowFooters: Boolean; + function ShowStateImages: Boolean; + function ShowTreeLines: Boolean; + function TransparentColumnGraphics: Boolean; + function Use3DEffects: Boolean; + function UseSoft3D: Boolean; + + property CustomTreeList: TCustomdxTreeListControl read GetCustomTreeList; + property OnCustomDrawBandCell: TdxTLReportLinkCustomDrawBandCellEvent + read FOnCustomDrawBandCell write SetOnCustomDrawBandCell; + property OnCustomDrawCell: TdxTLReportLinkCustomDrawCellEvent + read FOnCustomDrawCell write SetOnCustomDrawCell; + property OnCustomDrawFooterCell: TdxTLReportLinkCustomDrawFooterCellEvent + read FOnCustomDrawFooterCell write SetOnCustomDrawFooterCell; + property OnCustomDrawHeaderCell: TdxTLReportLinkCustomDrawHeaderCellEvent + read FOnCustomDrawHeaderCell write SetOnCustomDrawHeaderCell; + property OnCustomDrawPreviewCell: TdxTLReportLinkCustomDrawPreviewCellEvent + read FOnCustomDrawPreviewCell write SetOnCustomDrawPreviewCell; + property OnCustomDrawRowFooterCell: TdxTLReportLinkCustomDrawRowFooterCellEvent + read FOnCustomDrawRowFooterCell write SetOnCustomDrawRowFooterCell; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function DefaultGraphicAsTextValue: string; virtual; + + function IsDBGridLink: Boolean; virtual; + function IsDBTreeListLink: Boolean; virtual; + function IsTreeListLink: Boolean; virtual; + published + property AutoNodesExpand: Boolean read FAutoNodesExpand write SetAutoNodesExpand default False; + property BandColor: TColor read FBandColor write SetBandColor default dxDefaultFixedColor;//clSilver; + property BandFont: TFont read FBandFont write SetBandFont stored IsFontStored; + property BandsOnEveryPage: Boolean read FBandsOnEveryPage write SetBandsOnEveryPage default True; + property Color; + property DrawMode: TdxTreeListDrawMode read FDrawMode write SetDrawMode default tldmStrict; + property ExpandLevel: Integer read GetExpandLevel write SetExpandLevel default -1; {full expand} + {obsolete - use instead: DrawMode = tldmBorrowSource} + property ExtendedColorManage: Boolean read GetExtendedColorManage write SetExtendedColorManage default False; + property ExtendedSelect: Boolean read FExtendedSelect write SetExtendedSelect default True; + property EvenColor: TColor read FEvenColor write SetEvenColor default clWhite; + property EvenFont: TFont read FEvenFont write SetEvenFont stored IsFontStored; + property FixedTransparent: Boolean read FFixedTransparent write SetFixedTransparent default False; + property Font; + property FooterFont: TFont read FFooterFont write SetFooterFont stored IsFontStored; + property GraphicAsTextValue: string read GetGraphicAsTextValue write SetGraphicAsTextValue stored IsGraphicAsTextValueStored; + property GridLineColor: TColor read FGridLineColor write SetGridLineColor default clBlack; + property GroupNodeFont: TFont read FGroupNodeFont write SetGroupNodeFont stored IsFontStored; + property GroupNodeColor: TColor read FGroupNodeColor write SetGroupNodeColor default dxDefaultFixedColor;//clSilver; + property HeaderColor: TColor read FHeaderColor write SetHeaderColor default dxDefaultFixedColor;//clSilver; + property HeaderFont: TFont read FHeaderFont write SetHeaderFont stored IsFontStored; + property HorzDelimitByBands: Boolean read FHorzDelimitByBands write SetHorzDelimitByBands default False; + property OddColor: TColor read GetOddColor write SetOddColor default clWhite; + property OddFont: TFont read FOddFont write SetOddFont stored IsFontStored; + property OnlySelected: Boolean read FOnlySelected write SetOnlySelected default False; + property Options: TdxTreeListPaintOptions read GetOptions write SetOptions + default [tlpoBands..tlpoStateImages, tlpoSoft3D, tlpoRowFooterGrid, tlpoTreeLines, tlpoExpandButtons]; + property FootersOnEveryPage; + property HeadersOnEveryPage default True; + property PreviewColor: TColor read FPreviewColor write SetPreviewColor default clWhite; + property PreviewFont: TFont read FPreviewFont write SetPreviewFont stored IsFontStored; + property PreviewLineCount: Integer read FPreviewLineCount write SetPreviewLineCount default -1; + property RowFooterColor: TColor read FRowFooterColor write SetRowFooterColor default dxDefaultFixedColor;//clSilver; + property RowFooterFont: TFont read FRowFooterFont write SetRowFooterFont stored IsFontStored; + property ScaleFonts; + property SupportedCustomDraw: Boolean read FSupportedCustomDraw write SetSupportCustomDraw default False; + property Transparent; + property TreeLineColor: TColor read FTreeLineColor write SetTreeLineColor default clGray; + property UseHorzDelimiters; + property UseVertDelimiters; + {obsolete -> you should use DrawMode = tldmBorrowSource} + property UseColumnFont: Boolean read GetUseColumnFont write SetUseColumnFont default False; + end; + + TdxTreeListReportLink = class(TCustomdxTreeListReportLink) + private + function GetTreeList: TdxTreeList; + protected + procedure AssignValues(ADataItem: TAbstractdxReportCellData; + ANode: TdxTreeListNode; AColumn, AReferenceColumn: TdxTreeListColumn); override; + function GetDataClass(AColumn: TdxTreeListColumn; + ANode: TdxTreeListNode): TdxReportCellDataClass; override; + procedure GetOwnedImageLists(AProc: TdxPSGetImageListProc); override; + public + property TreeList: TdxTreeList read GetTreeList; + published + property OnCustomDrawBandCell; + property OnCustomDrawCell; + property OnCustomDrawFooterCell; + property OnCustomDrawHeaderCell; + property OnCustomDrawPreviewCell; + property OnCustomDrawRowFooterCell; + end; + + TdxTLReportLinkDesignWindow = class(TStandarddxReportLinkDesignWindow) + PageControl1: TPageControl; + tshColors: TTabSheet; + tshFonts: TTabSheet; + pnlPreview: TPanel; + chbxTransparent: TCheckBox; + chbxFixedTransparent: TCheckBox; + gbxTransparent: TGroupBox; + lblColor: TLabel; + bvlColorHolder: TBevel; + gbxFixedTransparent: TGroupBox; + lblBandColor: TLabel; + lblHeaderColor: TLabel; + lblRowFooterColor: TLabel; + bvlBandColorHolder: TBevel; + bvlHeaderColorHolder: TBevel; + bvlRowFooterColorHolder: TBevel; + lblGridLineColor: TLabel; + bvlGridLineColorHolder: TBevel; + dxTLPreview: TdxTreeList; + dxTLPreviewColumn1: TdxTreeListColumn; + ilTLImages: TImageList; + btnChangeFont: TButton; + lblGroupNodeColor: TLabel; + bvlGroupNodeColorHolder: TBevel; + lblPreviewColor: TLabel; + bvlPreviewColorHolder: TBevel; + dxTLPreviewColumn3: TdxTreeListCheckColumn; + lbxFonts: TListBox; + dxTLPreviewColumn4: TdxTreeListImageColumn; + tshBehaviors: TTabSheet; + lblEvenColor: TLabel; + bvlEvenColorHolder: TBevel; + tshOptions: TTabSheet; + Bevel11: TBevel; + chbxShowGrid: TCheckBox; + chbxShowNodeGrid: TCheckBox; + chbxShowBands: TCheckBox; + chbxShowHeaders: TCheckBox; + chbxShowFooters: TCheckBox; + chbxShowGroupFooters: TCheckBox; + imgShow: TImage; + lblShow: TLabel; + chbxTransparentColumnGraphic: TCheckBox; + chbxDisplayGraphicsAsText: TCheckBox; + chbxShowStateImages: TCheckBox; + chbxShowImages: TCheckBox; + Bevel12: TBevel; + Bevel13: TBevel; + Image3: TImage; + chbxOnlySelected: TCheckBox; + chbxExtendedSelect: TCheckBox; + chbxAutoNodesExpand: TCheckBox; + Image4: TImage; + lblExpandLevel: TLabel; + bvlExpandLevelHolder: TBevel; + lblSelection: TLabel; + lblExpanding: TLabel; + lblRefinements: TLabel; + bvlRefinements: TBevel; + imgRefinements: TImage; + lblLookAndFeel: TLabel; + Image8: TImage; + Bevel15: TBevel; + chbxUse3DEffects: TCheckBox; + chbxUseSoft3D: TCheckBox; + Bevel16: TBevel; + bvlShowImages: TBevel; + pmChangeFont: TPopupMenu; + miChangeFont: TMenuItem; + bvlTreeLineColorHolder: TBevel; + lblTreeLineColor: TLabel; + tshPreview: TTabSheet; + Bevel9: TBevel; + lblPreviewLineCount: TLabel; + bvlPreviewLineCountHolder: TBevel; + lblPreview: TLabel; + imgPreview: TImage; + chbxShowPreview: TCheckBox; + chbxAutoCalcPreviewLines: TCheckBox; + chbxShowExpandButtons: TCheckBox; + chbxShowTreeLines: TCheckBox; + Bevel2: TBevel; + lblDrawMode: TLabel; + cbxDrawMode: TComboBox; + Bevel10: TBevel; + Image1: TImage; + lblOnEveryPage: TLabel; + chbxBandsOnEveryPage: TCheckBox; + chbxHeadersOnEveryPage: TCheckBox; + chbxFootersOnEveryPage: TCheckBox; + chbxCheckMarksAsText: TCheckBox; + chbxFlatCheckMarks: TCheckBox; + lblPreviewWindow: TStaticText; + stTransparent: TStaticText; + stFixedTransparent: TStaticText; + procedure FontClick(Sender: TObject); + procedure chbxTransparentClick(Sender: TObject); + procedure lblColorClick(Sender: TObject); + procedure lblExpandLevelClick(Sender: TObject); + procedure chbxOnlySelectedClick(Sender: TObject); + procedure chbxExtendedSelectClick(Sender: TObject); + procedure dxTLPreviewGetFooterCellText(Sender: TObject; + ANode: TdxTreeListNode; AColumn, AFooterIndex: Integer; + var AText: string); + procedure dxTLPreviewGetPreviewText(Sender: TObject; + ANode: TdxTreeListNode; var AText: string); + procedure dxTLPreviewIsExistFooterCell(Sender: TObject; + AColumn: Integer; var AExist: Boolean); + procedure dxTLPreviewIsExistRowFooterCell(Sender: TObject; + ANode: TdxTreeListNode; AColumn, AFooterIndex: Integer; + var AExist: Boolean); + procedure dxTLPreviewIsLevelFooter(Sender: TObject; ALevel: Integer; + var AExist: Boolean); + procedure dxTLPreviewCustomDrawFooterNode(Sender: TObject; + ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; + AColumn: TdxTreeListColumn; AFooterIndex: Integer; var AText: string; + var AColor: TColor; AFont: TFont; var AAlignment: TAlignment; + var ADone: Boolean); + procedure dxTLPreviewCustomDrawFooter(Sender: TObject; + ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; + AColumn: TdxTreeListColumn; var AText: string; var AColor: TColor; + AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean); + procedure btnChangeFontClick(Sender: TObject); + procedure FontsMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure dxTLPreviewCustomDrawPreviewCell(Sender: TObject; + ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; + ASelected: Boolean; var AText: string; var AColor, + ATextColor: TColor; AFont: TFont; var ADone: Boolean); + procedure FontsKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure lbxFontsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure lbxFontsClick(Sender: TObject); + procedure dxTLPreviewColumn4CustomDrawCell(Sender: TObject; + ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; + AColumn: TdxTreeListColumn; ASelected, AFocused, + ANewItemRow: Boolean; var AText: string; var AColor: TColor; + AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean); + procedure chbxAutoNodesExpandClick(Sender: TObject); + procedure chbxHeadersOnEveryPageClick(Sender: TObject); + procedure chbxBandsOnEveryPageClick(Sender: TObject); + procedure chbxFootersOnEveryPageClick(Sender: TObject); + procedure dxTLPreviewCustomDrawColumnHeader(Sender: TObject; + AColumn: TdxTreeListColumn; ACanvas: TCanvas; ARect: TRect; + var AText: string; var AColor: TColor; AFont: TFont; + var AAlignment: TAlignment; var ASorted: TdxTreeListColumnSort; + var ADone: Boolean); + procedure dxTLPreviewCustomDrawBand(Sender: TObject; + ABand: TdxTreeListBand; ACanvas: TCanvas; ARect: TRect; + var AText: string; var AColor: TColor; AFont: TFont; + var AAlignment: TAlignment; var ADone: Boolean); + procedure chbxAutoCalcPreviewLinesClick(Sender: TObject); + procedure dxTLPreviewCustomDrawCell(Sender: TObject; ACanvas: TCanvas; + ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxTreeListColumn; + ASelected, AFocused, ANewItemRow: Boolean; var AText: string; + var AColor: TColor; AFont: TFont; var AAlignment: TAlignment; + var ADone: Boolean); + procedure dxTLPreviewGetPreviewLineCount(Sender: TObject; + ANode: TdxTreeListNode; var LCount: Integer); + procedure chbxShowClick(Sender: TObject); + procedure cbxDrawModeChange(Sender: TObject); + procedure lblDrawModeClick(Sender: TObject); + procedure pmChangeFontPopup(Sender: TObject); + procedure lbxFontsDblClick(Sender: TObject); + procedure dxTLPreviewColumn3CustomDrawCell(Sender: TObject; + ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; + AColumn: TdxTreeListColumn; ASelected, AFocused, + ANewItemRow: Boolean; var AText: String; var AColor: TColor; + AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean); + procedure PageControl1Change(Sender: TObject); + procedure cbxDrawModeDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure stTransparentClick(Sender: TObject); + procedure stFixedTransparentClick(Sender: TObject); + private + ccbxColor: TCustomComboBox; + ccbxEvenColor: TCustomComboBox; + ccbxBandColor: TCustomComboBox; + ccbxHeaderColor: TCustomComboBox; + ccbxGroupNodeColor: TCustomComboBox; + ccbxPreviewColor: TCustomComboBox; + ccbxRowFooterColor: TCustomComboBox; + ccbxGridLineColor: TCustomComboBox; + ccbxTreeLineColor: TCustomComboBox; + seExpandLevel: TCustomEdit; + sePreviewLineCount: TCustomEdit; + FPreviewBox: TCustomControl; + procedure ccbxColorChange(Sender: TObject); + procedure CreateControls; + procedure DoChangeFont(AIndex: Integer); + procedure ExpandLevelChange(Sender: TObject); + procedure FillTreeListData; + function GetFontByIndex(AIndex: Integer): TFont; + function GetFontInfoText(AIndex: Integer): string; + function GetMaxWidth: Integer; + function GetNodeFont(ANode: TdxTreeListNode; ANodeIndex: Integer): TFont; + function GetNodeIndex(ANode: TdxTreeListNode): Integer; + function GetPreviewFont(ANode: TdxTreeListNode; ANodeIndex: Integer): TFont; + function GetReportLink: TCustomdxTreeListReportLink; + function IsChangeFontEnabled: Boolean; + function IsDisableIndex(AIndex: Integer): Boolean; + procedure pbxPreviewPaint(Sender: TObject); + procedure PreviewLineCountChange(Sender: TObject); + procedure SetColorByTag(ATag: Integer; AColor: TColor); + procedure SetupPreview; + procedure CMDialogChar(var Msg: TCMDialogChar); message CM_DIALOGCHAR; + protected + procedure DoInitialize; override; + {$IFDEF DELPHI7} + function GetPreviewHost: TCustomPanel; override; + {$ENDIF} + procedure LoadStrings; override; + procedure PaintPreview(ACanvas: TCanvas; R: TRect); override; + procedure UpdateControlsState; override; + procedure UpdatePreview; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property ReportLink: TCustomdxTreeListReportLink read GetReportLink; + end; + + TdxTreeListColumnMapperProc = function(AColumn: TdxTreeListColumn; + AReportLink: TCustomdxTreeListReportLink; ANode: TdxTreeListNode): TdxReportCellDataClass; + + TdxTreeListAssignDataProc = procedure(AReportLink: TCustomdxTreeListReportLink; + ADataItem: TAbstractdxReportCellData; TreeList: TCustomdxTreeList; + ANode: TdxTreeListNode; AColumn, AReferenceColumn: TdxTreeListColumn); + +function DefaultdxTreeListMapperProc(AColumn: TdxTreeListColumn; + AReportLink: TCustomdxTreeListReportLink; ANode: TdxTreeListNode): TdxReportCellDataClass; +procedure DefaultdxTreeListAssignDataProc(AReportLink: TCustomdxTreeListReportLink; + ADataItem: TAbstractdxReportCellData; TreeList: TCustomdxTreeList; + ANode: TdxTreeListNode; AColumn, AReferenceColumn: TdxTreeListColumn); + +var + FdxTreeListAssignDataProc: TdxTreeListAssignDataProc = nil; + FdxTreeListColumnMapperProc: TdxTreeListColumnMapperProc = nil; + FPicture: TPicture; + +const + dxDefaultTreeListPaintOptions: TdxTreeListPaintOptions = + [tlpoBands, tlpoHeaders, tlpoFooters, tlpoRowFooters, tlpoPreview, + tlpoPreviewGrid, tlpoGrid, tlpoFlatCheckMarks, tlpoImages, tlpoStateImages, + tlpoSoft3D, tlpoRowFooterGrid, tlpoTreeLines, tlpoExpandButtons]; + +implementation + +{$R *.DFM} + +uses + Math, {$IFDEF DELPHI7} Themes, UxTheme, {$ENDIF} cxClasses, dxExtCtrls, + dxPSRes, dxPSPopupMan, dxPrnDev, dxPSUtl; + +const + SortOrderMap: array[TdxTreeListColumnSort] of TdxCellSortOrder = (csoNone, csoDown, csoUp); + TreeLineStylesMap: array[TdxTreeLineStyle] of TdxPSTreeLineStyle = (tlsSolid, tlsDot); + +function GetDesignerString(AnIndex: Integer): string; +begin + case AnIndex of + 0: Result := cxGetResourceString(@sdxItem1Description); + 1: Result := cxGetResourceString(@sdxItem2Description); + 2: Result := cxGetResourceString(@sdxItem3Description); + 3: Result := cxGetResourceString(@sdxItem4Description); + 4: Result := cxGetResourceString(@sdxItem5Description); + 5: Result := cxGetResourceString(@sdxItem6Description); + else + Result := cxGetResourceString(@sdxItem7Description); + end; +end; + +type + TdxTreeListAccess = class(TCustomdxTreeListControl); + TdxTreeListColumnAccess = class(TdxTreeListColumn); + TdxTreeListGraphicColumnAccess = class(TdxTreeListGraphicColumn); + TdxTreeListWrapperColumnAccess = class(TdxTreeListWrapperColumn); + + PdxColumnInfo = ^TdxColumnInfo; + TdxColumnInfo = record + BandIndex: Integer; + ColIndex: Integer; + ColCount: Integer; + RowIndex: Integer; + RowCount: Integer; + ColumnLeft: Integer; + ColumnRight: Integer; + CellTop: Integer; + CellBottom: Integer; + FooterTop: Integer; + FooterBottom: Integer; + HeaderTop: Integer; + HeaderBottom: Integer; + NodeFooterTop: Integer; + NodeFooterBottom: Integer; + IsFirstColumn: Boolean; + IsLastColumn: Boolean; + IsHeaderMultiline: Boolean; + IsMultiline: Boolean; + FontIndex: Integer; + end; + + TdxColumnHelpersFactory = class(TdxCustomClassMaps) + private + function GetHelperClass(Column: TdxTreeListColumn): TdxTreeListColumnHelperClass; + public + class function Instance: TdxColumnHelpersFactory; reintroduce; overload; + property HelperClasses[Column: TdxTreeListColumn]: TdxTreeListColumnHelperClass read GetHelperClass; default; + end; + +function dxColumnHelpersFactory: TdxColumnHelpersFactory; +begin + Result := TdxColumnHelpersFactory.Instance; +end; + +class function TdxColumnHelpersFactory.Instance: TdxColumnHelpersFactory; +begin + Result := inherited Instance as TdxColumnHelpersFactory; +end; + +function TdxColumnHelpersFactory.GetHelperClass(Column: TdxTreeListColumn): TdxTreeListColumnHelperClass; +begin + Result := TdxTreeListColumnHelperClass(PairClasses[Column.ClassType]); +end; + +{ TdxTreeListColumnHelper } + +class function TdxTreeListColumnHelper.ColumnClass: TdxTreeListColumnClass; +begin + Result := TdxTreeListColumn; +end; + +class function TdxTreeListColumnHelper.PairClass: TClass; +begin + Result := ColumnClass; +end; + +class procedure TdxTreeListColumnHelper.Register; +begin + dxColumnHelpersFactory.Register(Self); +end; + +class procedure TdxTreeListColumnHelper.GetImageLists(AColumn: TdxTreeListColumn; + AProc: TdxPSGetImageListProc); +begin +end; + +{ TdxTreeListImageColumnHelper } + +class function TdxTreeListImageColumnHelper.ColumnClass: TdxTreeListColumnClass; +begin + Result := TdxTreeListImageColumn; +end; + +class procedure TdxTreeListImageColumnHelper.GetImageLists(AColumn: TdxTreeListColumn; + AProc: TdxPSGetImageListProc); +begin + inherited GetImageLists(AColumn, AProc); + AProc(TdxTreeListImageColumn(AColumn).Images); +end; + +{ Utility routines } + +function IsValidPointer(const AData: Integer): Boolean; +begin + Result := DWORD(AData) > SysInit.HInstance; +end; + +function ExposeTreeList(ATreeList: TCustomdxTreeListControl): TdxTreeListAccess; +begin + Result := TdxTreeListAccess(ATreeList); +end; + +{ - generic text columns - + TdxTreeListColumn, TdxTreeListMaskColumn, TdxTreeListButtonColumn, + TdxTreeListDateColumn, TdxTreeListSpinColumn, TdxTreeListPickColumn, + TdxTreeListCalcColumn, TdxTreeListHyperLinkColumn, TdxTreeListTimeColumn, + TdxTreeListCurrencyColumn, TdxTreeListMemoColumn, TdxTreeListMRUColumn, + TdxTreeListBlobColumn, TdxTreeListWrapperColumn, TdxTreeListPopupColumn } + +function DefaultdxTreeListMapperProc(AColumn: TdxTreeListColumn; + AReportLink: TCustomdxTreeListReportLink; ANode: TdxTreeListNode): TdxReportCellDataClass; +const + CheckClasses: array[Boolean] of TdxReportCellDataClass = (TdxReportCellCheckImage, TdxReportCellString); + ImageClasses: array[Boolean] of TdxReportCellDataClass = (TdxReportCellGraphic, TdxReportCellImage); + GraphicClasses: array[Boolean] of TdxReportCellDataClass = (TdxReportCellString, TdxReportCellGraphic); +begin + if AColumn is TdxTreeListCheckColumn then + Result := CheckClasses[tlpoCheckMarksAsText in AReportLink.Options] + else + if AColumn is TdxTreeListImageColumn then + Result := ImageClasses[TdxTreeListImageColumn(AColumn).ShowDescription] + else + Result := GraphicClasses[(AColumn is TdxTreeListGraphicColumn) and not (tlpoGraphicAsText in AReportLink.Options)]; +end; + +procedure DefaultdxTreeListAssignDataProc(AReportLink: TCustomdxTreeListReportLink; + ADataItem: TAbstractdxReportCellData; TreeList: TCustomdxTreeList; + ANode: TdxTreeListNode; AColumn, AReferenceColumn: TdxTreeListColumn); +var + ATreeList: TdxTreeListAccess; + S: string; + AImageIndex, Stub: Integer; + AState: TCheckBoxState; + NullStyle: TdxShowNullFieldStyle; + GraphicClass: TGraphicClass; +begin + ATreeList := TdxTreeListAccess(TreeList); + + if ADataItem is TdxReportCellCheck then + begin + with TdxReportCellCheckImage(ADataItem) do + begin + S := ATreeList.GetNodeString(ANode, AColumn.Index); + AState := TCheckBoxState(TdxTreeListCheckColumn(AReferenceColumn).GetCheckBoxState(S)); + NullStyle := TdxTreeListCheckColumn(AReferenceColumn).ShowNullFieldStyle; + Enabled := not ((AState = cbGrayed) and (NullStyle > nsUnchecked)); + Checked := (AState = cbChecked) or + ((AState = cbGrayed) and (NullStyle = nsGrayedChecked)); + FlatBorder := AReportLink.FlatCheckMarks; + if not TdxTreeListCheckColumn(AReferenceColumn).Glyph.Empty then + begin + Glyph := TdxTreeListCheckColumn(AReferenceColumn).Glyph; + GlyphCount := TdxTreeListCheckColumn(AReferenceColumn).GlyphCount; + end; + end; + Exit; + end; + + if AReferenceColumn is TdxTreeListMemoColumn then + begin + with TdxReportCellString(ADataItem) do + begin + Text := ATreeList.GetDisplayValue(ANode, AColumn.Index); + EndEllipsis := (aoDrawEndEllipsis in TreeList.Options); + Multiline := True; + TextAlignX := dxTextAlignX[ATreeList.GetCellAlignment(ANode, AColumn.Index)]; + TextAlignY := taTop; + end; + Exit; + end; + + if ADataItem is TdxReportCellImage then + begin + with TdxReportCellImage(ADataItem) do + begin + S := ATreeList.GetDisplayValue(ANode, AColumn.Index); + Text := AReferenceColumn.GetDisplayValue(ANode, S); + EndEllipsis := True; + Multiline := TdxTreeListImageColumn(AReferenceColumn).MultilineText; + TextAlignX := dxTextAlignX[ATreeList.GetCellAlignment(ANode, {AReferenceColumn ?}AColumn.Index)]; + if Multiline then + TextAlignY := dxMultilineTextAlignY[Multiline] + else + TextAlignY := dxTextAlignY[AReferenceColumn.VertAlignment]; + S := ATreeList.GetCellText(ANode, AColumn.Index); + TdxTreeListImageColumn(AReferenceColumn).GetIndexes(S, AImageIndex, Stub); + ImageList := TdxTreeListImageColumn(AReferenceColumn).Images; + ImageIndex := AImageIndex; + MakeSpaceForEmptyImage := True; + end; + Exit; + end; + + if ADataItem is TdxReportCellGraphic then + begin + if AReferenceColumn is TdxTreeListGraphicColumn then + begin + GraphicClass := TdxTreeListGraphicColumnAccess(AReferenceColumn).GetGraphicClass(ANode); + LoadPicture(FPicture, GraphicClass, ANode.Values[AColumn.Index]); + if GraphicClass = nil then GraphicClass := TBitmap; + with TdxReportCellGraphic(ADataItem) do + begin + Image := FPicture.Graphic; + ImageTransparent := + (tlpoTransparentColumnGraphic in AReportLink.Options) or GraphicClass.InheritsFrom(TIcon); + if not GraphicClass.InheritsFrom(TIcon) and TdxTreeListGraphicColumn(AReferenceColumn).Stretch then + DrawMode := gdmStretchProportional + else + if TdxTreeListGraphicColumn(AReferenceColumn).Center then + DrawMode := gdmCenter + else + DrawMode := gdmNone; + end + end + else // AColumn is TdxTreeListImageColumn + begin + with TdxReportCellGraphic(ADataItem) do + begin + ImageTransparent := True; + ImageList := TdxTreeListImageColumn(AReferenceColumn).Images; + S := ATreeList.GetCellText(ANode, AColumn.Index); + TdxTreeListImageColumn(AReferenceColumn).GetIndexes(S, AImageIndex, Stub); + ImageIndex := AImageIndex; + DrawMode := gdmCenter; + end + end; + Exit; + end; + + with TdxReportCellString(ADataItem) do + begin + if (AReferenceColumn is TdxTreeListGraphicColumn) then + begin + Text := AReportLink.GraphicAsTextValue; + Multiline := False; + end + else + begin + Text := ATreeList.GetDisplayValue(ANode, AColumn.Index); + Multiline := TdxTreeListGraphicColumnAccess(AReferenceColumn).IsColumnMultiline or + ((ATreeList.GetHeaderMaxRowCount = 1) and (aoRowAutoHeight in ATreeList.OptionsEx)); + end; + EndEllipsis := ATreeList.IsDrawEndEllipsis; + TextAlignX := dxTextAlignX[ATreeList.GetCellAlignment(ANode, {AReferenceColumn ?}AColumn.Index)]; + if Multiline then + TextAlignY := dxMultilineTextAlignY[Multiline] + else + if AReferenceColumn.VertAlignment in [tlTop, tlCenter] then + TextAlignY := taCenterY + else + TextAlignY := taBottom; + //TextAlignY := dxTextAlignY[AReferenceColumn.VertAlignment]; + end; +end; + +{ TCustomdxTreeListReportLink } + +constructor TCustomdxTreeListReportLink.Create(AOwner: TComponent); + + function CreateFont: TFont; + begin + Result := TFont.Create; + Result.OnChange := FontChanged; + end; + +begin + inherited; + FBandFont := CreateFont; + FEvenFont := CreateFont; + FFooterFont := CreateFont; + FGroupNodeFont := CreateFont; + FHeaderFont := CreateFont; + FOddFont := CreateFont; + FPreviewFont := CreateFont; + FRowFooterFont := CreateFont; + InternalRestoreDefaults; + LinkModified(False); + FNodes := TList.Create; + + FSaveFont := TFont.Create; + FSaveFont.OnChange := CustomDrawFontChanged; +end; + +destructor TCustomdxTreeListReportLink.Destroy; +begin + FreeAndNil(FSaveFont); + FreeAndNil(FNodes); + FreeAndNil(FRowFooterFont); + FreeAndNil(FPreviewFont); + FreeAndNil(FOddFont); + FreeAndNil(FHeaderFont); + FreeAndNil(FGroupNodeFont); + FreeAndNil(FFooterFont); + FreeAndNil(FEvenFont); + FreeAndNil(FBandFont); + inherited; +end; + +procedure TCustomdxTreeListReportLink.Assign(Source: TPersistent); +begin + inherited; + if Source is TCustomdxTreeListReportLink then + with TCustomdxTreeListReportLink(Source) do + begin + Self.FIsGraphicAsTextValueAssigned := FIsGraphicAsTextValueAssigned; + + Self.AutoNodesExpand := AutoNodesExpand; + Self.BandsOnEveryPage := BandsOnEveryPage; + Self.DrawMode := DrawMode; + Self.ExpandLevel := ExpandLevel; + Self.ExtendedSelect := ExtendedSelect; + Self.FixedTransparent := FixedTransparent; + Self.OnlySelected := OnlySelected; + Self.Options := Options; + Self.PreviewLineCount := PreviewLineCount; + Self.SupportedCustomDraw := SupportedCustomDraw; + + Self.BandColor := BandColor; + Self.EvenColor := EvenColor; + Self.GroupNodeColor := GroupNodeColor; + Self.GridLineColor := GridLineColor; + Self.HeaderColor := HeaderColor; + Self.PreviewColor := PreviewColor; + Self.RowFooterColor := RowFooterColor; + + Self.BandFont := BandFont; + Self.EvenFont := EvenFont; + Self.HeaderFont := HeaderFont; + Self.OddFont := OddFont; + Self.PreviewFont := PreviewFont; + Self.FooterFont := FooterFont; + Self.GroupNodeFont := GroupNodeFont; + Self.RowFooterFont := RowFooterFont; + end; +end; + +function TCustomdxTreeListReportLink.DefaultGraphicAsTextValue: string; +begin + Result := cxGetResourceString(@sdxGraphicAsTextValue); +end; + +function TCustomdxTreeListReportLink.IsDBTreeListLink: Boolean; +begin + Result := False; +end; + +function TCustomdxTreeListReportLink.IsDBGridLink: Boolean; +begin + Result := False; +end; + +function TCustomdxTreeListReportLink.IsTreeListLink: Boolean; +begin + Result := True; +end; + +procedure TCustomdxTreeListReportLink.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('IsGraphicAsTextValueAssigned', ReadIsGraphicAsTextValueAssigned, + WriteIsGraphicAsTextValueAssigned, + FIsGraphicAsTextValueAssigned and (GraphicAsTextValue = '')); +end; + +function TCustomdxTreeListReportLink.GetCustomTreeList: TCustomdxTreeListControl; +begin + Result := TCustomdxTreeListControl(Component); +end; + +function TCustomdxTreeListReportLink.GetCellCustomDrawInfo(AItem: TdxReportVisualItem; + ANode: PdxTreeListNode; AColumn: PdxTreeListColumn; ABand: PdxTreeListBand; + AFooterIndex: PInteger): TdxTreeListLinkCellType; +begin + Result := tlctUnknown; + with AItem do + begin + try + if IsValidPointer(Data) and (Data <> 0) and (TObject(Data) is TClass) then + if TObject(Data) is TdxTreeListBand then + Result := tlstBand + else + if TObject(Data) is TdxTreeListColumn then + begin + if Parent <> nil then + if Parent.Data = 0 then + Result := tlstFooter + else + if TClass(Parent.Data) = TdxTreeListColumn then + Result := tlstHeader + else + if IsValidPointer(Parent.Data) and (TObject(Parent.Data) is TdxTreeListNode) then + if (Parent.Parent <> nil) and (Parent.Parent.Data <> 0) then + Result := tlstGroupFooter + else + Result := tlstCell; + end + else + if TObject(Data) is TdxTreeListNode then Result := tlstPreview; + except + // eat exception if any Node or Column already deleted + end; + + if Result <> tlctUnknown then + begin + if (ABand <> nil) and (Result = tlstBand) then + ABand^ := TdxTreeListBand(Data); + if (AColumn <> nil) and (Result in [tlstCell, tlstFooter, tlstHeader, tlstGroupFooter]) then + AColumn^ := TdxTreeListColumn(Data); + if (ANode <> nil) and (Result in [tlstCell, tlstHeader, tlstPreview, tlstGroupFooter]) then + ANode^ := TdxTreeListNode(Parent.Data); + if (AFooterIndex <> nil) and (Result = tlstGroupFooter) then + AFooterIndex^ := Parent.Parent.Data - 1; + end; + end; +end; + +procedure TCustomdxTreeListReportLink.CustomDrawFontChanged(Sender: TObject); +begin + FCustomDrawFontChanged := True; +end; + +procedure TCustomdxTreeListReportLink.CustomDraw(AItem: TAbstractdxReportCellData; + ACanvas: TCanvas; ABoundsRect, AClientRect: TRect; var ADone: Boolean); +var + ABand: TdxTreeListBand; + AColumn: TdxTreeListColumn; + ANode: TdxTreeListNode; + AFooterIndex: Integer; + AColor: TColor; + ASorted: TdxCellSortOrder; + AText: string; + ATextAlignX: TdxTextAlignX; + ATextAlignY: TdxTextAlignY; + AType: TdxTreeListLinkCellType; +begin + if AItem.Data = 0 then Exit; + AType := GetCellCustomDrawInfo(AItem, @ANode, @AColumn, @ABand, @AFooterIndex); + if AType = tlctUnknown then Exit; + + with TdxReportCellString(AItem) do + begin + AColor := ColorToRGB(Color); + if Transparent then AColor := clNone; + FSaveFont.Assign(Font); + FCustomDrawFontChanged := False; + AText := Text; + if AType = tlstHeader then ASorted := SortOrder; + if AType <> tlstPreview then + begin + ATextAlignX := TextAlignX; + ATextAlignY := TextAlignY; + end; + case AType of + tlstBand: + DoCustomDrawBandCell(ACanvas, ABoundsRect, AClientRect, ABand, AText, + AColor, FSaveFont, ATextAlignX, ATextAlignY, ADone); + tlstCell: + DoCustomDrawCell(ACanvas, ABoundsRect, AClientRect, ANode, AColumn, AText, + AColor, FSaveFont, ATextAlignX, ATextAlignY, ADone); + tlstFooter: + DoCustomDrawFooterCell(ACanvas, ABoundsRect, AClientRect, ANode, AColumn, + AText, AColor, FSaveFont, ATextAlignX, ATextAlignY, ADone); + tlstGroupFooter: + DoCustomDrawRowFooterCell(ACanvas, ABoundsRect, AClientRect, ANode, AColumn, + AFooterIndex, AText, AColor, FSaveFont, ATextAlignX, ATextAlignY, ADone); + tlstHeader: + DoCustomDrawHeaderCell(ACanvas, ABoundsRect, AClientRect, AColumn, AText, + AColor, FSaveFont, ATextAlignX, ATextAlignY, ASorted, ADone); + tlstPreview: + DoCustomDrawPreviewCell(ACanvas, ABoundsRect, AClientRect, ANode, AText, + AColor, FSaveFont, ADone); + end; + if not ADone then + begin + if FCustomDrawFontChanged then + begin + SelectObject(ACanvas.Handle, FSaveFont.Handle); + SetTextColor(ACanvas.Handle, ColorToRGB(FSaveFont.Color)); + FontIndex := -1; + end; + if AColor <> clNone then + begin + Color := AColor; + Transparent := False; + end; + Text := AText; + if AType = tlstHeader then SortOrder := ASorted; + if AType <> tlstPreview then + begin + TextAlignX := ATextAlignX; + TextAlignY := ATextAlignY; + end; + end; + end; +end; + +procedure TCustomdxTreeListReportLink.SetSupportCustomDraw(Value: Boolean); +begin + if FSupportedCustomDraw <> Value then + begin + FSupportedCustomDraw := Value; + LinkModified(True); + end; +end; + +function TCustomdxTreeListReportLink.IsSupportedCustomDraw(Item: TAbstractdxReportCellData): Boolean; +begin + Result := SupportedCustomDraw; + if Result and (Item <> nil) then + if Item.Data = 0 then + Result := False + else + case GetCellCustomDrawInfo(Item, nil, nil, nil, nil) of + tlstBand: + Result := Assigned(FOnCustomDrawBandCell); + tlstCell: + Result := Assigned(FOnCustomDrawCell); + tlstFooter: + Result := Assigned(FOnCustomDrawFooterCell); + tlstGroupFooter: + Result := Assigned(FOnCustomDrawRowFooterCell); + tlstHeader: + Result := Assigned(FOnCustomDrawHeaderCell); + tlstPreview: + Result := Assigned(FOnCustomDrawPreviewCell); + end; +end; + +function TCustomdxTreeListReportLink.TransparentColumnGraphics: Boolean; +begin + Result := (tlpoTransparentColumnGraphic in Options); +end; + +function TCustomdxTreeListReportLink.IsDrawFootersOnEveryPage: Boolean; +begin + Result := not IsAggregated and FootersOnEveryPage and ShowFooters and + (CustomTreeList <> nil) and (CustomTreeList.Count > 0); +end; + +function TCustomdxTreeListReportLink.IsDrawHeadersOnEveryPage: Boolean; +begin + Result := not IsAggregated and BandsOnEveryPage and + (ShowBands or (HeadersOnEveryPage and ShowHeaders)) and + (CustomTreeList <> nil) and (CustomTreeList.Count > 0); +end; + +function TCustomdxTreeListReportLink.GetCheckColumnGlyph(AColumn: TdxTreeListColumn): TBitmap; +begin + Result := TdxTreeListCheckColumn(AColumn).Glyph; + if (Result <> nil) and Result.Empty then + Result := nil; +end; + +function TCustomdxTreeListReportLink.IsCheckColumn(AColumn: TdxTreeListColumn): Boolean; +begin + Result := AColumn is TdxTreeListCheckColumn; +end; + +function TCustomdxTreeListReportLink.IsGraphicColumn(AColumn: TdxTreeListColumn): Boolean; +begin + Result := AColumn is TdxTreeListGraphicColumn; +end; + +function TCustomdxTreeListReportLink.IsHyperLinkColumn(AColumn: TdxTreeListColumn): Boolean; +begin + Result := AColumn is TdxTreeListHyperLinkColumn; +end; + +function TCustomdxTreeListReportLink.IsHyperLinkColumnsExists: Boolean; +var + I, AbsoluteIndex: Integer; +begin + with FAbsoluteIndexes do + for I := 0 to Count - 1 do + begin + AbsoluteIndex := Integer(List^[I]); + if IsHyperLinkColumn(CustomTreeList.Columns[AbsoluteIndex]) then + begin + Result := True; + Exit; + end; + end; + Result := False; +end; + +function TCustomdxTreeListReportLink.GetExpandLevel: Integer; +begin + if IsDBGridLink or IsDBTreeListLink then + Result := -1 + else + Result := FExpandLevel; +end; + +procedure TCustomdxTreeListReportLink.GetImageLists(AProc: TdxPSGetImageListProc); +begin + inherited GetImageLists(AProc); + GetOwnedImageLists(AProc); + GetImageListsFromColumns(AProc); +end; + +procedure TCustomdxTreeListReportLink.InternalRestoreFromOriginal; + + procedure XorOption(var AOptions: TdxTreeListPaintOptions; AItem: TdxTreeListPaintOption; AValue: Boolean); + begin + if AValue then + Include(AOptions, AItem) + else + Exclude(AOptions, AItem); + end; + +begin + inherited; + + with ExposeTreeList(CustomTreeList) do + begin + PreviewLineCount := PreviewLines; + if aoAutoCalcPreviewLines in OptionsEx then + PreviewLineCount := -1; + + Self.BandFont := BandFont; + Self.Font := Font; + Self.HeaderFont := HeaderFont; + Self.PreviewFont := PreviewFont; + Self.GroupNodeFont := Font; + Self.GroupNodeFont.Color := GroupNodeTextColor; + Self.FooterFont := Font; + Self.RowFooterFont := FooterFont; + + FBandColor := BandColor; + FGroupNodeColor := GroupNodeColor; + FGridLineColor := GetGridColor(Color); + FHeaderColor := HeaderColor; + FRowFooterColor := RowFooterColor; + FTreeLineColor := TreeLineColor; + + XorOption(FOptions, tlpoBands, ShowBands); + XorOption(FOptions, tlpoHeaders, ShowHeader); + XorOption(FOptions, tlpoFooters, ShowFooter); + XorOption(FOptions, tlpoRowFooters, ShowRowFooter); + XorOption(FOptions, tlpoGrid, ShowGrid); + XorOption(FOptions, tlpoPreviewGrid, ShowPreviewGrid); + XorOption(FOptions, tlpoPreview, aoPreview in CustomTreeList.Options); + XorOption(FOptions, tlpoImages, Images <> nil); + XorOption(FOptions, tlpoStateImages, StateImages <> nil); + XorOption(FOptions, tlpo3DEffects, LookAndFeel in [lfStandard, lfFlat]); + XorOption(FOptions, tlpoSoft3D, LookAndFeel = lfFlat); + XorOption(FOptions, tlpoTreeLines, (PaintStyle = psStandard) and ShowLines); + XorOption(FOptions, tlpoExpandButtons, ShowButtons); + end; +end; + +procedure TCustomdxTreeListReportLink.InternalRestoreDefaults; +begin + inherited; + FAutoNodesExpand := False; + BandsOnEveryPage := True; + DrawMode := tldmStrict; + FixedTransparent := False; + FOnlySelected := False; + HeadersOnEveryPage := True; + Options := dxDefaultTreeListPaintOptions; + FPreviewLineCount := -1; + FSupportedCustomDraw := False; + + FBandColor := dxDefaultFixedColor; + FEvenColor := Color; + FGridLineColor := dxDefaultGridLineColor; + FGroupNodeColor := dxDefaultFixedColor; + FHeaderColor := dxDefaultFixedColor; + FRowFooterColor := dxDefaultFixedColor; + FPreviewColor := Color; + FTreeLineColor := dxDefaultTreeLineColor; + + BandFont := DefaultFont; + EvenFont := DefaultFont; + FooterFont := DefaultFont; + GroupNodeFont := DefaultFont; + HeaderFont := DefaultFont; + OddFont := DefaultFont; + PreviewFont := DefaultFont; + RowFooterFont := FooterFont; + + FExpandLevel := -1; + FExtendedSelect := True; + FIsGraphicAsTextValueAssigned := False; +end; + +function TCustomdxTreeListReportLink.AutoCalcPreviewLines: Boolean; +begin + Result := PreviewLineCount = -1; +end; + +function TCustomdxTreeListReportLink.CheckMarksAsText: Boolean; +begin + Result := tlpoCheckMarksAsText in Options; +end; + +function TCustomdxTreeListReportLink.FlatCheckMarks: Boolean; +begin + Result := tlpoFlatCheckMarks in Options; +end; + +function TCustomdxTreeListReportLink.ShowBands: Boolean; +begin + Result := tlpoBands in Options; +end; + +function TCustomdxTreeListReportLink.GraphicsAsText: Boolean; +begin + Result := (tlpoGraphicAsText in Options); +end; + +function TCustomdxTreeListReportLink.ShowGrid: Boolean; +begin + Result := ((DrawMode < tldmBorrowSource) and (tlpoGrid in Options)) or + ((DrawMode = tldmBorrowSource) and + ((CustomTreeList = nil) or ExposeTreeList(CustomTreeList).ShowGrid)); +end; + +function TCustomdxTreeListReportLink.ShowHeaders: Boolean; +begin + Result := tlpoHeaders in Options; +end; + +function TCustomdxTreeListReportLink.ShowExpandButtons: Boolean; +begin + Result := tlpoExpandButtons in Options; +end; + +function TCustomdxTreeListReportLink.ShowFooters: Boolean; +begin + Result := tlpoFooters in Options; +end; + +function TCustomdxTreeListReportLink.ShowPreview: Boolean; +begin + Result := tlpoPreview in Options; +end; + +function TCustomdxTreeListReportLink.ShowPreviewGrid: Boolean; +begin + Result := ((DrawMode < tldmBorrowSource) and (tlpoPreviewGrid in Options)) or + ((DrawMode = tldmBorrowSource) and + ((CustomTreeList = nil) or ExposeTreeList(CustomTreeList).ShowPreviewGrid)); +end; + +function TCustomdxTreeListReportLink.ShowRowFooterGrid: Boolean; +begin + Result := tlpoRowFooterGrid in Options; +end; + +function TCustomdxTreeListReportLink.IsExtendedSelect: Boolean; +begin + Result := AreSelectedNodesExist and ExtendedSelect; +end; + +function TCustomdxTreeListReportLink.ShowRowFooters: Boolean; +begin + Result := tlpoRowFooters in Options; +end; + +function TCustomdxTreeListReportLink.ShowImages: Boolean; +begin + Result := tlpoImages in Options; +end; + +function TCustomdxTreeListReportLink.ShowStateImages: Boolean; +begin + Result := tlpoStateImages in Options; +end; + +function TCustomdxTreeListReportLink.ShowTreeLines: Boolean; +begin + Result := tlpoTreeLines in Options; +end; + +function TCustomdxTreeListReportLink.CanDrawImages(ANode: TdxTreeListNode): Boolean; +begin + with ExposeTreeList(CustomTreeList) do + Result := ShowImages and Assigned(Images) and + (ANode.ImageIndex > -1) and (ANode.ImageIndex < Images.Count); +end; + +function TCustomdxTreeListReportLink.CanDrawStateImages(ANode: TdxTreeListNode): Boolean; +begin + with ExposeTreeList(CustomTreeList) do + Result := ShowStateImages and Assigned(StateImages) and + (ANode.StateIndex > -1) and (ANode.StateIndex < StateImages.Count); +end; + +function TCustomdxTreeListReportLink.OddEvenMode: Boolean; +begin + Result := DrawMode = tldmOddEven; +end; + +function TCustomdxTreeListReportLink.Use3DEffects: Boolean; +begin + Result := tlpo3DEffects in Options; +end; + +function TCustomdxTreeListReportLink.UseSoft3D: Boolean; +begin + Result := tlpoSoft3D in Options; +end; + +procedure TCustomdxTreeListReportLink.SetExtendedSelect(Value: Boolean); +begin + if FExtendedSelect <> Value then + begin + FExtendedSelect := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxTreeListReportLink.SetOnlySelected(Value: Boolean); +begin + if FOnlySelected <> Value then + begin + FOnlySelected := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxTreeListReportLink.SetAutoNodesExpand(Value: Boolean); +begin + if FAutoNodesExpand <> Value then + begin + FAutoNodesExpand := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxTreeListReportLink.SetDrawMode(Value: TdxTreeListDrawMode); +begin + if FDrawMode <> Value then + begin + FDrawMode := Value; + LinkModified(True); + end; +end; + +function TCustomdxTreeListReportLink.GetOptions: TdxTreeListPaintOptions; +begin + Result := FOptions; +end; + +procedure TCustomdxTreeListReportLink.SetOptions(Value: TdxTreeListPaintOptions); +begin + if FOptions <> Value then + begin + FOptions := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxTreeListReportLink.SetBandsOnEveryPage(Value: Boolean); +begin + if not IsAggregated then + if FBandsOnEveryPage <> Value then + begin + FBandsOnEveryPage := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxTreeListReportLink.SetBandFont(Value: TFont); +begin + BandFont.Assign(Value); +end; + +procedure TCustomdxTreeListReportLink.SetOddFont(Value: TFont); +begin + OddFont.Assign(Value); +end; + +procedure TCustomdxTreeListReportLink.SetEvenFont(Value: TFont); +begin + EvenFont.Assign(Value); +end; + +procedure TCustomdxTreeListReportLink.SetHeaderFont(Value: TFont); +begin + HeaderFont.Assign(Value); +end; + +procedure TCustomdxTreeListReportLink.SetGroupNodeFont(Value: TFont); +begin + GroupNodeFont.Assign(Value); +end; + +procedure TCustomdxTreeListReportLink.SetPreviewFont(Value: TFont); +begin + PreviewFont.Assign(Value); +end; + +procedure TCustomdxTreeListReportLink.SetFooterFont(Value: TFont); +begin + FFooterFont.Assign(Value); +end; + +procedure TCustomdxTreeListReportLink.SetRowFooterFont(Value: TFont); +begin + FRowFooterFont.Assign(Value); +end; + +procedure TCustomdxTreeListReportLink.SetBandColor(Value: TColor); +begin + if FBandColor <> Value then + begin + FBandColor := Value; + if tlpoBands in Options then + LinkModified(True); + end; +end; + +procedure TCustomdxTreeListReportLink.SetEvenColor(Value: TColor); +begin + if FEvenColor <> Value then + begin + FEvenColor := Value; + if OddEvenMode then + LinkModified(True); + end; +end; + +function TCustomdxTreeListReportLink.GetOddColor: TColor; +begin + Result := Color; +end; + +procedure TCustomdxTreeListReportLink.SetOddColor(Value: TColor); +begin + inherited Color := Value; +end; + +procedure TCustomdxTreeListReportLink.SetGroupNodeColor(Value: TColor); +begin + if FGroupNodeColor <> Value then + begin + FGroupNodeColor := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxTreeListReportLink.SetGridLineColor(Value: TColor); +begin + if FGridLineColor <> Value then + begin + FGridLineColor := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxTreeListReportLink.SetHeaderColor(Value: TColor); +begin + if FHeaderColor <> Value then + begin + FHeaderColor := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxTreeListReportLink.SetPreviewColor(Value: TColor); +begin + if FPreviewColor <> Value then + begin + FPreviewColor := Value; + if tlpoPreview in Options then + LinkModified(True); + end; +end; + +procedure TCustomdxTreeListReportLink.SetRowFooterColor(Value: TColor); +begin + if FRowFooterColor <> Value then + begin + FRowFooterColor := Value; + if tlpoRowFooters in Options then + LinkModified(True); + end; +end; + +procedure TCustomdxTreeListReportLink.SetHorzDelimitByBands(Value: Boolean); +begin + if FHorzDelimitByBands <> Value then + begin + FHorzDelimitByBands := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxTreeListReportLink.SetFixedTransparent(Value: Boolean); +begin + if FFixedTransparent <> Value then + begin + FFixedTransparent := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxTreeListReportLink.SetExpandLevel(Value: Integer); +begin + if Value < -1 then + Value := -1; + if FExpandLevel <> Value then + begin + FExpandLevel := Value; + if AutoNodesExpand then LinkModified(True); + end; +end; + +function TCustomdxTreeListReportLink.GetExtendedColorManage: Boolean; +begin + Result := DrawMode = tldmBorrowSource; +end; + +function TCustomdxTreeListReportLink.GetGraphicAsTextValue: string; +begin + if FIsGraphicAsTextValueAssigned then + Result := FGraphicAsTextValue + else + Result := DefaultGraphicAsTextValue; +end; + +procedure TCustomdxTreeListReportLink.SetExtendedColorManage(Value: Boolean); +begin + DrawMode := tldmBorrowSource; +end; + +function TCustomdxTreeListReportLink.GetUseColumnFont: Boolean; +begin + Result := DrawMode = tldmBorrowSource; +end; + +procedure TCustomdxTreeListReportLink.SetTreeLineColor(Value: TColor); +begin + if FTreeLineColor <> Value then + begin + FTreeLineColor := Value; + LinkModified(True); + end; +end; + +procedure TCustomdxTreeListReportLink.SetUseColumnFont(Value: Boolean); +begin + DrawMode := tldmBorrowSource; +end; + +procedure TCustomdxTreeListReportLink.SetPreviewLineCount(Value: Integer); +begin + if Value < -1 then + Value := -1; + if FPreviewLineCount <> Value then + begin + FPreviewLineCount := Value; + if tlpoPreview in Options then LinkModified(True); + end; +end; + +procedure TCustomdxTreeListReportLink.SetOnCustomDrawBandCell + (Value: TdxTLReportLinkCustomDrawBandCellEvent); +begin + if @FOnCustomDrawBandCell <> @Value then + begin + FOnCustomDrawBandCell := Value; + if IsSupportedCustomDraw(nil) then + LinkModified(True); + end; +end; + +procedure TCustomdxTreeListReportLink.SetOnCustomDrawCell + (Value: TdxTLReportLinkCustomDrawCellEvent); +begin + if @FOnCustomDrawCell <> @Value then + begin + FOnCustomDrawCell := Value; + if IsSupportedCustomDraw(nil) then + LinkModified(True); + end; +end; + +procedure TCustomdxTreeListReportLink.SetOnCustomDrawFooterCell + (Value: TdxTLReportLinkCustomDrawFooterCellEvent); +begin + if @FOnCustomDrawFooterCell <> @Value then + begin + FOnCustomDrawFooterCell := Value; + if IsSupportedCustomDraw(nil) then + LinkModified(True); + end; +end; + +procedure TCustomdxTreeListReportLink.SetOnCustomDrawHeaderCell + (Value: TdxTLReportLinkCustomDrawHeaderCellEvent); +begin + if @FOnCustomDrawHeaderCell <> @Value then + begin + FOnCustomDrawHeaderCell := Value; + if IsSupportedCustomDraw(nil) then + LinkModified(True); + end; +end; + +procedure TCustomdxTreeListReportLink.SetOnCustomDrawPreviewCell + (Value: TdxTLReportLinkCustomDrawPreviewCellEvent); +begin + if @FOnCustomDrawPreviewCell <> @Value then + begin + FOnCustomDrawPreviewCell := Value; + if IsSupportedCustomDraw(nil) then + LinkModified(True); + end; +end; + +procedure TCustomdxTreeListReportLink.SetOnCustomDrawRowFooterCell + (Value: TdxTLReportLinkCustomDrawRowFooterCellEvent); +begin + if @FOnCustomDrawRowFooterCell <> @Value then + begin + FOnCustomDrawRowFooterCell := Value; + if IsSupportedCustomDraw(nil) then + LinkModified(True); + end; +end; + +function TCustomdxTreeListReportLink.GetDataClass(AColumn: TdxTreeListColumn; + ANode: TdxTreeListNode): TdxReportCellDataClass; +begin + Result := nil; +end; + +function TCustomdxTreeListReportLink.GetGroupColumnIndex( + ANode: TdxTreeListNode): Integer; +begin + Result := 0; +end; + +procedure TCustomdxTreeListReportLink.GetOwnedImageLists(AProc: TdxPSGetImageListProc); +begin +end; + +procedure TCustomdxTreeListReportLink.GetImageListsFromColumns(AProc: TdxPSGetImageListProc); +var + I: Integer; + Column: TdxTreeListColumn; +begin + for I := 0 to CustomTreeList.ColumnCount - 1 do + begin + Column := CustomTreeList.Columns[I]; + dxColumnHelpersFactory[Column].GetImageLists(Column, AProc); + end; +end; + +function TCustomdxTreeListReportLink.IsGraphicAsTextValueStored: Boolean; +begin + Result := FIsGraphicAsTextValueAssigned and (GraphicAsTextValue <> DefaultGraphicAsTextValue); +end; + +procedure TCustomdxTreeListReportLink.SetGraphicAsTextValue(const Value: string); +begin + if GraphicAsTextValue <> Value then + begin + FGraphicAsTextValue := Value; + FIsGraphicAsTextValueAssigned := True; + if tlpoGraphicAsText in Options then LinkModified(True); + end; +end; + +function TCustomdxTreeListReportLink.GetReferenceColumn(AColumn: TdxTreeListColumn; + ANode: TdxTreeListNode): TdxTreeListColumn; +begin + if AColumn is TdxTreeListWrapperColumn then + begin + Result := TdxTreeListWrapperColumnAccess(AColumn).ReferenceColumn(ANode); + if Result = nil then + Result := AColumn; + end + else + Result := AColumn; +end; + +procedure TCustomdxTreeListReportLink.PrepareConstruct(AReportCells: TdxReportCells); + + function CalcRowHeight(DC: HDC; AFont: TFont; AMinHeight: Integer; AKeepParity: Boolean): Integer; + begin + Result := Renderer.CalcTextPatternHeight(DC, AFont); + if Result < AMinHeight then + Result := AMinHeight; + if AKeepParity and Odd(Result) then + Inc(Result); + end; + +var + DC: HDC; +begin + DC := GetDC(0); + try + FRowHeight := CalcRowHeight(DC, Font, CustomTreeList.RowHeight, True); + FHeaderRowHeight := 3 + CalcRowHeight(DC, HeaderFont, CustomTreeList.HeaderRowHeight, False); + FFooterRowHeight := CalcRowHeight(DC, FooterFont, 4 + CustomTreeList.FooterRowHeight, False); + FGroupRowHeight := CalcRowHeight(DC, GroupNodeFont, CustomTreeList.RowHeight, False); + FGroupFooterRowHeight := 2 + CalcRowHeight(DC, RowFooterFont, CustomTreeList.FooterRowHeight, True); + FBandHeight := CalcRowHeight(DC, BandFont, CustomTreeList.BandPanelHeight, False); + FPreviewLineHeight := CalcRowHeight(DC, PreviewFont, CustomTreeList.DescTextHeight, True); + finally + ReleaseDC(0, DC); + end; + + FFooterPanelHeight := FFooterRowHeight * + ExposeTreeList(CustomTreeList).GetHeaderMaxRowCount + Byte(Use3DEffects); + + FFullWidth := GetBandRect(ExposeTreeList(CustomTreeList).GetBandCount - 1).Right; + FIndent := ExposeTreeList(CustomTreeList).Indent; + FPaintStyle := ExposeTreeList(CustomTreeList).PaintStyle; + FShowRoot := ExposeTreeList(CustomTreeList).ShowRoot; + + FAbsoluteIndexes := TList.Create; + CalcAbsoluteIndexes; + CalcColumnInfos(AReportCells); + CalcFontIndexes(AReportCells); + AddNodes; +end; + +procedure TCustomdxTreeListReportLink.UnprepareConstruct(AReportCells: TdxReportCells); +begin + FreeHeaderInfos; + FreeAndNil(FAbsoluteIndexes); +end; + +function TCustomdxTreeListReportLink.GetBandRegionHeight: Integer; +begin + Result := Byte(ShowBands) * Self.FBandHeight +end; + +function TCustomdxTreeListReportLink.GetBandRect(AVisibleIndex: Integer): TRect; +begin + with Result do + begin + Left := GetBandLeft(AVisibleIndex); + Top := 0; + Right := Left + GetBandWidth(AVisibleIndex); + Bottom := Top + GetBandRegionHeight; +// ver 2.3 +// Inc(Left, Byte(Use3DEffects)); +// Inc(Top, Byte(Use3DEffects)); + end; +end; + +procedure TCustomdxTreeListReportLink.ConstructReport(AReportCells: TdxReportCells); +var + ATreeList: TdxTreeListAccess; + + function GetHeaderRegionHeight: Integer; + begin + if ShowHeaders then + Result := 0 + ATreeList.GetHeaderMaxRowCount * FHeaderRowHeight + else + Result := 0; + end; + + function IsNodeImagesExists(ANode: TdxTreeListNode): Boolean; + begin + Result := CanDrawImages(ANode) or CanDrawStateImages(ANode); + end; + + function GetColumnFont(AIndex: Integer): TFont; + begin + Result := ATreeList.GetColumnFont(AIndex); + end; + + function GetTextIndent(ANode: TdxTreeListNode): Integer; + begin + Result := ANode.Level * (FIndent + 0); + if ((FPaintStyle = psStandard) and FShowRoot) or + ((FPaintStyle = psOutlook) and (ANode.Count > 0)) then + Inc(Result, FIndent); + if CanDrawStateImages(ANode) then Inc(Result, ATreeList.StateImages.Width); + if CanDrawImages(ANode) then Inc(Result, ATreeList.Images.Width); + end; + + function GetDataItemSides(ANode: TdxTreeListNode; AAbsoluteIndex: Integer): TdxCellSides; + var + RowIndex: Integer; + IsFirstColumn, IsLastColumn: Boolean; + begin + Result := []; + GetColumnInfos(AAbsoluteIndex, nil, @RowIndex, nil, nil, nil, @IsFirstColumn, @IsLastColumn); + if ShowGrid then + begin + if (RowIndex = 0) or (ShowPreviewGrid) then {!}//} or (ANode = FNodes.List^[0])) then + Include(Result, csTop); + if ShowPreviewGrid then + Include(Result, csBottom); + if ShowPreviewGrid or IsLastColumn then + Include(Result, csRight); + if IsFirstColumn then + begin + if ExposeTreeList(CustomTreeList).IsRowGroup(ANode) or not IsNodeImagesExists(ANode) then + Include(Result, csLeft) + end + else + if ShowPreviewGrid then Include(Result, csLeft) + end + else + begin + if (ANode = FNodes.List^[0]) and (RowIndex = 0) then + Include(Result, csTop); + if IsLastColumn then + Include(Result, csRight); + end; + end; + + function CalcColumnHeight(DC: HDC; ANode: TdxTreeListNode; AColumn: TdxTreeListColumn; + AnAbsoluteIndex, APreviewHeight, ARowHeight: Integer): Integer; + var + Glyph: TBitmap; + S: string; + R: TRect; + begin + if IsGraphicColumn(AColumn) then + Result := ATreeList.GetRowHeight(ANode, ARowHeight, True) - APreviewHeight + else + if IsCheckColumn(AColumn) then + begin + Glyph := GetCheckColumnGlyph(AColumn); + if Glyph <> nil then + Result := Glyph.Height + else + Result := dxPSGlbl.CheckHeight; + end + else + begin + if UseColumnFont and ATreeList.IsExistColumnFont(AnAbsoluteIndex) then + SelectObject(DC, ATreeList.GetColumnFont(AnAbsoluteIndex).Handle); + S := ATreeList.GetDisplayValue(ANode, AnAbsoluteIndex); + if S <> '' then + begin + R := Rect(0, 0, ATreeList.GetHeaderBoundsWidth(AnAbsoluteIndex), 0); + Result := Renderer.CalcTextRect(DC, S, R, True, nil); + end + else + Result := FRowHeight; + end; + end; + + function CalcRowAutoHeight(DC: HDC; ANode: TdxTreeListNode; APreviewHeight: Integer): Integer; + var + PrevFont: HFONT; + I, AbsoluteIndex, V: Integer; + Column: TdxTreeListColumn; + begin + Result := 0; + PrevFont := SelectObject(DC, Font.Handle); + for I := 0 to FAbsoluteIndexes.Count - 1 do + begin + AbsoluteIndex := Integer(FAbsoluteIndexes.List[I]); + Column := ATreeList.Columns[AbsoluteIndex]; + Column := GetReferenceColumn(Column, ANode); + V := CalcColumnHeight(DC, ANode, Column, AbsoluteIndex, APreviewHeight, FRowHeight); + if Result < V then + Result := V; + end; + SelectObject(DC, PrevFont); + end; + + function CalcPreviewHeight(DC: hDC; const S: string; AWidth: Integer): Integer; + var + R: TRect; + begin + R := Rect(0, 0, AWidth, 0); + Result := Renderer.CalcTextRect(DC, S, R, True, PreviewFont); + end; + + function GetPreviewHeight(DC: hDC; ANode: TdxTreeListNode; AWidth: Integer): Integer; + var + S: string; + begin + if AutoCalcPreviewLines then + begin + S := ATreeList.GetPreviewText(ANode); + if S <> '' then + Result := CalcPreviewHeight(DC, S, AWidth - ATreeList.IndentDesc) + else + Result := 0; + end + else + Result := PreviewLineCount * FPreviewLineHeight; + end; + + function GetNodeHeight(ANode: TdxTreeListNode; AWidth: Integer; + APreviewHeight: PInteger): Integer; + var + NeedAllocateDC: Boolean; + DC: HDC; + V: Integer; + begin + with ExposeTreeList(CustomTreeList) do + if IsRowGroup(ANode) then + if FRowHeight < FGroupRowHeight then + Result := FGroupRowHeight + else + Result := FRowHeight + else + begin + NeedAllocateDC := + ((aoPreview in CustomTreeList.Options) and AutoCalcPreviewLines) or + (IsRowAutoHeight and (GetHeaderMaxRowCount = 1)); + DC := 0; + if NeedAllocateDC then DC := GetDC(0); + try + if (aoPreview in CustomTreeList.Options) then + V := GetPreviewHeight(DC, ANode, AWidth) + else + V := 0; + + if IsRowAutoHeight and (GetHeaderMaxRowCount = 1) then + Result := CalcRowAutoHeight(DC, ANode, V) + else + Result := GetHeaderMaxRowCount * FRowHeight; + finally + if NeedAllocateDC then ReleaseDC(0, DC); + end; + + if (APreviewHeight <> nil) and ShowPreview then + begin + APreviewHeight^ := V; + Inc(Result, V); + end; + end + end; + + function GetCellHeight(ANode: TdxTreeListNode; AAbsoluteIndex: PInteger; + ACellType: TdxTreeListLinkCellType; AParent: TdxReportCell): Integer; + var + BandIndex, RowIndex, ColIndex: Integer; + UseParentHeight: Boolean; + begin + if AParent <> nil then + begin + UseParentHeight := ATreeList.IsRowAutoHeight and (ATreeList.GetHeaderMaxRowCount = 1); + if UseParentHeight and (ACellType = tlstCell) then + UseParentHeight := UseParentHeight or ATreeList.IsRowGroup(ANode); // and (GetPreviewLineCount(ANode) = 0) + end + else + UseParentHeight := False; + + if UseParentHeight then + Result := AParent.Height - FPreviewHeight + else + begin + if AAbsoluteIndex <> nil then + begin + GetColumnInfos(AAbsoluteIndex^, @BandIndex, @RowIndex, @ColIndex, nil, nil, nil, nil); + Result := ATreeList.GetHeaderLineCount(ATreeList.GetVisibleBandIndex(BandIndex), RowIndex, ColIndex); + end + else + Result := ATreeList.GetHeaderMaxRowCount; + + case ACellType of + tlstCell: + Result := Result * FRowHeight; + tlstFooter: + Result := Result * FFooterRowHeight + 3; + tlstGroupFooter: + Result := Result * FGroupFooterRowHeight + 3; + tlstHeader: + Result := 0 + Result * FHeaderRowHeight; + end; + end; + end; + + function GetDataItemRect(ANode: TdxTreeListNode; AAbsoluteIndex: Integer; + AParent: TdxReportCell): TRect; + var + IsFirstColumn, IsLastColumn: Boolean; + begin + GetCellRect(AAbsoluteIndex, tlstCell, Result); + if ExposeTreeList(CustomTreeList).IsRowAutoHeight and (ExposeTreeList(CustomTreeList).GetHeaderMaxRowCount = 1) then + Result.Bottom := AParent.Height - FPreviewHeight; + GetColumnInfos(AAbsoluteIndex, nil, nil, nil, nil, nil, @IsFirstColumn, @IsLastColumn); + if IsLastColumn then + Result.Right := FFullWidth; + if IsFirstColumn then + Result.Left := GetTextIndent(ANode); + end; + + { Bands } + procedure InsertBandItem(AVisibleIndex: Integer; AParent: TdxReportCell); + var + DataItem: TAbstractdxReportCellData; + begin + DataItem := TdxReportCellString.Create(AParent); + with TdxReportCellString(DataItem) do + begin + FontIndex := FBandFontIndex; + Text := ATreeList.GetBandText(AVisibleIndex); + Multiline := ATreeList.BandRowCount > 1; + EndEllipsis := not Multiline; + CellSides := csAll; + Transparent := True; + TextAlignX := dxTextAlignX[ATreeList.GetBandAlignment(AVisibleIndex)]; + TextAlignY := taTop; + + if Use3DEffects then + begin + EdgeMode := cem3DEffects; + Edge3DStyle := cesRaised; + Edge3DSoft := UseSoft3D; + end + else + EdgeMode := cemPattern; + + BoundsRect := GetBandRect(AVisibleIndex); + if IsSupportedCustomDraw(nil) then + Data := Integer(ATreeList.Bands[AVisibleIndex]); + end; + end; + + procedure InsertBands; + var + CellParent, Cell: TdxReportCell; + I: Integer; + begin + if not IsAggregated and BandsOnEveryPage and (CustomTreeList.Count > 0) then + CellParent := AReportCells.HeaderCells + else + CellParent := AReportCells.Cells; + Cell := TdxReportCell.Create(CellParent); + with Cell do + begin + CellSides := csAll; + Transparent := FixedTransparent; + if not Transparent then Color := BandColor; + BoundsRect := Rect(0, 0, FFullWidth, GetBandRegionHeight); + end; + for I := 0 to ExposeTreeList(CustomTreeList).GetBandCount - 1 do + InsertBandItem(I, Cell); + end; + + { Headers } + function GetHeaderRect(AAbsoluteIndex: Integer; AParent: TdxReportCell): TRect; + begin + GetCellRect(AAbsoluteIndex, tlstHeader, Result); + end; + + procedure InsertHeaderItem(AAbsoluteIndex: Integer; AParent: TdxReportCell); + var + IsMultilined: Boolean; + DataItem: TdxReportCellImage; + begin + IsMultilined := PdxColumnInfo(FColumnInfos.List^[AAbsoluteIndex])^.IsHeaderMultiline; + DataItem := TdxReportCellImage.Create(AParent); + with DataItem do + begin + FontIndex := FHeaderFontIndex; + Transparent := True; + CellSides := csAll; + BoundsRect := GetHeaderRect(AAbsoluteIndex, AParent); + Text := ATreeList.GetHeaderText(AAbsoluteIndex); + EndEllipsis := not IsMultilined; + Multiline := IsMultilined; + TextAlignX := dxTextAlignX[ATreeList.GetHeaderAlignment(AAbsoluteIndex)]; + TextAlignY := dxMultilineTextAlignY[Multiline]; + SortOrder := SortOrderMap[ATreeList.GetHeaderSorted(AAbsoluteIndex)]; + MakeSpaceForEmptyImage := False; + + if Use3DEffects then + begin + EdgeMode := cem3DEffects; + Edge3DStyle := cesRaised; + Edge3DSoft := UseSoft3D; + end + else + EdgeMode := cemPattern; + + if ATreeList.IsExistHeaderGlyph(AAbsoluteIndex) then + Image := ATreeList.GetHeaderGlyph(AAbsoluteIndex); + if IsSupportedCustomDraw(nil) then + Data := Integer(ATreeList.Columns[AAbsoluteIndex]); + end; + end; + + procedure InsertHeaders; + var + CellParent, Cell: TdxReportCell; + PrevSibl: TdxReportItem; + I: Integer; + begin + if not IsAggregated and BandsOnEveryPage and HeadersOnEveryPage and (CustomTreeList.Count > 0) then + CellParent := AReportCells.HeaderCells + else + CellParent := AReportCells.Cells; + Cell := TdxReportCell.Create(CellParent); + with Cell do + begin + CellSides := csAll; + Transparent := FixedTransparent; + if not Transparent then Color := HeaderColor; + BoundsRect := Bounds(GetBandLeft(0), 0, FFullWidth, GetHeaderRegionHeight); + PrevSibl := GetPrevSibling; + if PrevSibl <> nil then + Top := TdxReportVisualItem(PrevSibl).BoundsRect.Bottom; + if IsSupportedCustomDraw(nil) then + Data := Integer(TdxTreeListColumn); + end; + for I := 0 to FAbsoluteIndexes.Count - 1 do + InsertHeaderItem(Integer(FAbsoluteIndexes.List^[I]), Cell); + end; + + { Footers } + function GetFooterRect(AAbsoluteIndex: Integer; AParent: TdxReportCell): TRect; + var + IsFirstColumn, IsLastColumn: Boolean; + begin + GetCellRect(AAbsoluteIndex, tlstFooter, Result); + InflateRect(Result, -1, -3); + Inc(Result.Left); + Inc(Result.Top); + with Result do + begin + GetColumnInfos(AAbsoluteIndex, nil, nil, nil, nil, nil, @IsFirstColumn, @IsLastColumn); + if IsLastColumn then Dec(Right, 2); + if IsFirstColumn then Inc(Left, 2); + end; + end; + + procedure InsertFooterItem(AAbsoluteIndex: Integer; AParent: TdxReportCell); + var + DataItem: TAbstractdxReportCellData; + begin + DataItem := TdxReportCellString.Create(AParent); + with TdxReportCellString(DataItem) do + begin + FontIndex := FFooterFontIndex; + Text := ATreeList.GetFooterCellText(nil, AAbsoluteIndex, -1); + Transparent := True; + BoundsRect := GetFooterRect(AAbsoluteIndex, AParent); + if Use3DEffects then + begin + EdgeMode := cem3DEffects; + Edge3DStyle := cesSunken; + Edge3DSoft := True; + end + else + EdgeMode := cemPattern; + + CellSides := csAll; + TextAlignX := dxTextAlignX[ATreeList.GetFooterCellAlignment(nil, AAbsoluteIndex, -1)]; + TextAlignY := taCenterY; + if IsSupportedCustomDraw(nil) then + Data := Integer(ATreeList.Columns[AAbsoluteIndex]); + end; + end; + + procedure InsertFooters; + var + CellParent, Cell: TdxReportCell; +// R: TRect; + PrevSibl: TdxReportItem; + I, AbsoluteIndex: Integer; + begin + if not IsAggregated and FootersOnEveryPage and (ATreeList.Count > 0) then + CellParent := AReportCells.FooterCells + else + CellParent := AReportCells.Cells; + Cell := TdxReportCell.Create(CellParent); + with Cell do + begin + CellSides := csAll; + Transparent := FixedTransparent; + if not Transparent then + Color := HeaderColor; + if Use3DEffects then + begin + EdgeMode := cem3DEffects; + Edge3DStyle := cesRaised; + Edge3DSoft := UseSoft3D; + end + else + EdgeMode := cemPattern; + + { 2.3 } + BoundsRect := Rect(0, 0, FFullWidth, GetCellHeight(nil, nil, tlstFooter, nil)); + PrevSibl := GetPrevSibling; + if PrevSibl <> nil then + Top := TdxReportCell(PrevSibl).BoundsRect.Bottom; + end; + for I := 0 to FAbsoluteIndexes.Count - 1 do + begin + AbsoluteIndex := Integer(FAbsoluteIndexes.List^[I]); + if ATreeList.IsExistFooterCell(AbsoluteIndex) then + InsertFooterItem(AbsoluteIndex, Cell); + end; + end; + + procedure InsertStub; + var + Last: TdxReportCell; + begin + Last := AReportCells.Cells.LastCell; + if Last <> nil then + with TdxReportCell.Create(AReportCells.Cells) do + begin + BoundsRect := Bounds(0, Last.BoundsRect.Bottom, FFullWidth, 1); + CellSides := [csTop]; + Transparent := True; + end; + end; + + function GetNodeParentAtLevel(ANode: TdxTreeListNode; AtLevel: Integer): TdxTreeListNode; + begin + Result := ANode; + if (FPaintStyle = psOutlook) and (ANode.Count = 0) then + Result := Result.Parent; + + while AtLevel > 0 do + begin + Result := Result.Parent; + Dec(AtLevel); + end; + end; + + { RowFooters } + function GetRowFooterCount(Node: TdxTreeListNode): Integer; + var + ANode: TdxTreeListNode; + begin + Result := 0; + if (Node = nil) or (Node.Count <> 0) or not Node.IsLast then Exit; +// if (Node <> nil) and (Node.Count = 0) and Node.IsLast then + ANode := Node.Parent; + while (Node <> nil) and Node.IsLast do + begin + if ExposeTreeList(CustomTreeList).IsLevelFooter(ANode.Level) then + Inc(Result); + Node := ANode; + ANode := ANode.Parent; + end + end; + + function GetRowFooterItemIndent(ANode: TdxTreeListNode): Integer; + begin + Result := (FIndent + 0) * (ANode.Level + Ord(FShowRoot and (FPaintStyle = psStandard))); + if CanDrawStateImages(ANode) then + Inc(Result, ATreeList.StateImages.Width) + else + if CanDrawImages(ANode) then + Inc(Result, ATreeList.Images.Width); + end; + + function GetRowFooterRect(ANode: TdxTreeListNode; AAbsoluteIndex: Integer; + AParent: TdxReportCell): TRect; + var + Level: Integer; + IsFirstColumn, IsLastColumn: Boolean; + begin + GetCellRect(AAbsoluteIndex, tlstGroupFooter, Result); + Level := ANode.Level - Ord(not FShowRoot and (FPaintStyle = psStandard)); + OffsetRect(Result, -Level * (FIndent + 0), 0); + + GetColumnInfos(AAbsoluteIndex, nil, nil, nil, nil, nil, @IsFirstColumn, @IsLastColumn); + if IsFirstColumn then + Inc(Result.Left, GetRowFooterItemIndent(ANode) + 1); + InflateRect(Result, -2, -3); + Inc(Result.Right); + if IsLastColumn then Dec(Result.Right, 2); + end; + + procedure InsertRowFooterItem(ANode, AFooterNode: TdxTreeListNode; + AAbsoluteIndex: Integer; AFooterIndex: Integer; AParent: TdxReportCell); + var + DataItem: TAbstractdxReportCellData; + begin + DataItem := TdxReportCellString.Create(AParent); + with TdxReportCellString(DataItem) do + begin + FontIndex := FRowFooterFontIndex; + Text := ATreeList.GetFooterCellText(AFooterNode, AAbsoluteIndex, AFooterIndex); + Transparent := True; + CellSides := []; + if ShowGrid and ShowRowFooterGrid then + CellSides := csAll; + BoundsRect := GetRowFooterRect(ANode, AAbsoluteIndex, AParent); + TextAlignX := dxTextAlignX[ATreeList.GetFooterCellAlignment(AFooterNode, AAbsoluteIndex, AFooterIndex)]; + TextAlignY := taCenterY; + MultiLine := False; + if Use3DEffects then + begin + EdgeMode := cem3DEffects; + Edge3DStyle := cesSunken; + Edge3DSoft := True; + end + else + EdgeMode := cemPattern; + + if IsSupportedCustomDraw(nil) then + Data := Integer(CustomTreeList.Columns[AAbsoluteIndex]); + end; + end; + + procedure SetupExpandButtonAndTreeLines(AItem: TdxReportCellExpandButton; AIndex: Integer; + ANode: TdxTreeListNode; AGroupFooter: Boolean); + + function GetExpandButtonSize: Integer; + begin + if FPaintStyle = psStandard then + Result := 9 + else + if Use3dEffects then + if UseSoft3D then + Result := 11 + else + Result := 12 + else + Result := 12; + end; + + function GetIndentShowButton(AtLevel: Integer; ANode: TdxTreeListNode): Boolean; + begin + Result := ShowExpandButtons and ((FPaintStyle = psStandard) or (ANode.Count <> 0)) and + (GetNodeParentAtLevel(ANode, AtLevel) = ANode) and ANode.HasChildren; + end; + + function GetIndentButtonExpanded(ANode: TdxTreeListNode): Boolean; + begin + if AutoNodesExpand then + Result := ANode.Expanded or ((ANode.Count <> 0) and ((ExpandLevel = -1) or (ExpandLevel > ANode.Level))) + else + Result := ANode.Expanded; + end; + + function GetIndentTreeLineMode(AtLevel: Integer; ANode: TdxTreeListNode): TdxPSTreeLineMode; + var + Parent: TdxTreeListNode; + begin + if ShowTreeLines and (FPaintStyle = psStandard) then + begin + Parent := GetNodeParentAtLevel(ANode, AtLevel); + if Parent = ANode then + if ANode.IsLast then + Result := tlmBottomRightCorner + else + if (ANode.Level = 0) and (ANode.Index = 0) then + Result := tlmTopRightCorner + else + Result := tlmCross + else + if (Parent <> nil) and Parent.IsLast then + Result := tlmNone + else + Result := tlmVertical; + end + else + Result := tlmNone + end; + + function GetIndentTreeLineModeInFooter(AtLevel: Integer; ANode: TdxTreeListNode): TdxPSTreeLineMode; + var + Parent: TdxTreeListNode; + begin + if ShowTreeLines and (FPaintStyle = psStandard) then + begin + Parent := GetNodeParentAtLevel(ANode, AtLevel); + if (Parent = nil) or Parent.IsLast then + Result := tlmNone + else + Result := tlmVertical; + end + else + Result := tlmNone + end; + + begin + with AItem do + begin + ShowButton := not AGroupFooter and GetIndentShowButton(AIndex, ANode); + if ShowButton then + begin + ButtonBorder3D := Use3DEffects and (FPaintStyle = psOutlook); + ButtonBorder3DSoft := UseSoft3D and (FPaintStyle = psOutlook); + ButtonBorderShadow := not ButtonBorder3D and (FPaintStyle = psOutlook); + ButtonExpanded := GetIndentButtonExpanded(ANode); + ButtonSize := GetExpandButtonSize; + end; + if AGroupFooter then + TreeLineMode := GetIndentTreeLineModeInFooter(AIndex, ANode) + else + TreeLineMode := GetIndentTreeLineMode(AIndex, ANode); + end; + end; + + procedure InsertRowFooters(ANode, AFooterNode: TdxTreeListNode; + AParent: TdxReportCell; AFooterIndex: Integer); + var + I, J, AAbsoluteIndex, ALevel, RowFooterHeight: Integer; + ACell: TdxReportCell; + APrevSibl: TdxReportItem; + ADataItem: TAbstractdxReportCellData; + Node: TdxTreeListNode; + begin + if FPaintStyle = psStandard then + ALevel := ANode.Level - 1 - Ord(not FShowRoot) + else + ALevel := ANode.Level - 1; //Byte(ANode.Count = 0); + + RowFooterHeight := GetCellHeight(ANode, nil, tlstGroupFooter, nil); + ACell := TdxReportCell.Create(AParent); + with ACell do + begin + Transparent := True;//(ALevel > -1) or FixedTransparent; + if not Transparent then Color := RowFooterColor; + CellSides := [csLeft, csRight]; + if not Transparent and ShowGrid then + CellSides := CellSides + [csTop, csBottom]; + BoundsRect := Rect(0, 0, FFullWidth, RowFooterHeight); + APrevSibl := GetPrevSibling; + if Assigned(APrevSibl) then + Top := TdxReportCell(APrevSibl).BoundsRect.Bottom; + if IsSupportedCustomDraw(nil) then + Data := 1 + AFooterIndex; + end; + + ADataItem := nil; + Node := AFooterNode; + for I := 0 to ALevel do + begin + ADataItem := TdxReportCellExpandButton.Create(ACell); + with TdxReportCellExpandButton(ADataItem) do + begin + BoundsRect := Rect(0, 0, FIndent + 0, RowFooterHeight); + APrevSibl := GetPrevSibling; + if APrevSibl <> nil then + Left := TdxReportVisualItem(APrevSibl).BoundsRect.Right; + CellSides := []; + if ShowGrid then + begin + CellSides := CellSides + [csLeft, csRight]; + if I = ALevel then CellSides := CellSides + [csBottom]; + end + else + if I = 0 then + CellSides := CellSides + [csLeft]; + Node := AFooterNode; + for J := AFooterNode.Level - 1 downto I + Byte(FPaintStyle = psStandard) do + Node := Node.Parent; + Transparent := IsLevelTransparent(Node); + if OddEvenMode and (FPaintStyle = psStandard) then + Transparent := FixedTransparent; + if not Transparent then + Color := GetLevelColor(Node, -1); + + // 2.3 ExpandButtons and TreeLines + SetupExpandButtonAndTreeLines(TdxReportCellExpandButton(ADataItem), ALevel - I, ANode.Parent, True); + end; + end; + + ACell := TdxReportCell.Create(ACell); + with ACell do + begin + CellSides := [csRight]; + if ShowGrid then + CellSides := CellSides + [csLeft, csTop, csBottom]; + Transparent := FixedTransparent; + if not Transparent then + {2.0} if DrawMode = tldmBorrowSource then + Color := GetLevelColor(Node, -1) + else + Color := RowFooterColor; + I := 0; + if Assigned(ADataItem) then + I := ADataItem.BoundsRect.Right; + BoundsRect := Rect(I, 0, FFullWidth, RowFooterHeight); + if IsSupportedCustomDraw(nil) then + Data := Integer(AFooterNode); + end; + + for I := 0 to FAbsoluteIndexes.Count - 1 do + begin + AAbsoluteIndex := Integer(FAbsoluteIndexes.List^[I]); + if ATreeList.IsExistRowFooterCell(AFooterNode, AAbsoluteIndex, AFooterIndex) then + InsertRowFooterItem(ANode, AFooterNode, AAbsoluteIndex, AFooterIndex, ACell); + end; + end; + +{Preview} + function GetPreviewCellSides(ANode: TdxTreeListNode): TdxCellSides; + begin + Result := [csRight]; + if ShowGrid then + begin + Include(Result, csBottom); + if (FPaintStyle = psOutlook) and not IsNodeImagesExists(ANode) then + Include(Result, csLeft); + if ShowPreviewGrid then + Include(Result, csTop); + end; + end; + +{Nodes} + function IsLastNodeEx(Node, ANode: TdxTreeListNode): Boolean; + begin + repeat + Result := ANode.IsLast; + ANode := ANode.Parent; + until not Result or (ANode = nil) or (ANode = Node); + end; + + procedure ProcessCells(ANode: TdxTreeListNode; AParent: TdxReportCell; ANodeIndex: Integer); + var + I, AAbsoluteIndex, ACellHeight, ALevel: Integer; + ADataClass: TdxReportCellDataClass; + ADataItem: TAbstractdxReportCellData; + ACell: TdxReportCell; + APrevSibl: TdxReportItem; + ParentNode: TdxTreeListNode; + Column, ReferenceColumn: TdxTreeListColumn; + begin + if not ATreeList.IsRowGroup(ANode) and ShowPreview then + ACellHeight := GetNodeHeight(ANode, FFullWidth - GetTextIndent(ANode), @FPreviewHeight) + else + begin + ACellHeight := GetNodeHeight(ANode, 0, nil); + FPreviewHeight := 0; + end; + + ACell := TdxReportCell.Create(AParent); + with ACell do + begin + BoundsRect := Rect(0, 0, FFullWidth, ACellHeight); + APrevSibl := GetPrevSibling; + if Assigned(APrevSibl) then + Top := TdxReportCell(APrevSibl).BoundsRect.Bottom; + CellSides := [csLeft, csRight]; + if (ANode = FNodes.List^[0]) then + CellSides := CellSides + [csTop]; + Transparent := IsLevelTransparent(ANode); + if not Transparent then + Color := GetLevelColor(ANode, ANodeIndex); + if IsSupportedCustomDraw(nil) then + Data := Integer(ANode); + end; + + if FPaintStyle = psStandard then + ALevel := ANode.Level - Ord(not FShowRoot) + else + ALevel := ANode.Level - 1 + Ord(ANode.Count <> 0); + + for I := 0 to ALevel do + begin + ParentNode := GetNodeParentAtLevel(ANode, ALevel - I);// + Ord(FPaintStyle = psOutlook)); + //for J := ANode.Level - 1 downto I + Byte(FPaintStyle = psStandard) do + // ParentNode := ParentNode.Parent; + ADataItem := TdxReportCellExpandButton.Create(ACell); + with TdxReportCellExpandButton(ADataItem) do + begin + BoundsRect := Bounds(0, 0, FIndent + 0, ACellHeight); + APrevSibl := GetPrevSibling; + if APrevSibl <> nil then + Left := TdxReportVisualItem(APrevSibl).BoundsRect.Right; + CellSides := []; + + if ShowGrid then + begin + CellSides := CellSides + [csLeft]; + if ANode.Parent = nil then + CellSides := CellSides + [csTop]; + if not ((FPaintStyle = psOutlook) and (I = ALevel) and (ANode.Count <> 0)) then + CellSides := CellSides + [csRight]; + if FPaintStyle = psStandard then + begin + if I = ALevel then + begin + CellSides := CellSides + [csTop]; + if ANode.Count = 0 then CellSides := CellSides + [csBottom]; + end; + end + else + if (I = ALevel) and (ANode.Count > 0) then + CellSides := CellSides + [csTop]; + + if ((ANode.Count = 0) or (not ANode.Expanded and not AutoNodesExpand)) and + (not ShowRowFooters or (ATreeList.GetRowFooterCount(ANode) = 0)) and + IsLastNodeEx(ParentNode, ANode) then + CellSides := CellSides + [csBottom]; + end + else + begin + if I = 0 then + CellSides := CellSides + [csLeft]; + if ANode = FNodes.List^[0] then + CellSides := CellSides + [csTop]; + if ANode = FNodes.Last then + CellSides := CellSides + [csBottom]; + end; + + Transparent := IsLevelTransparent(ParentNode); + if not Transparent then + Color := GetLevelColor(ParentNode, ANodeIndex); + + // 2.3 ExpandButtons and TreeLines + SetupExpandButtonAndTreeLines(TdxReportCellExpandButton(ADataItem), ALevel - I, ANode, False) + end; + end; + + if IsTreeListLink or IsDBTreeListLink then + begin + { state images } + if CanDrawStateImages(ANode) then + begin + ADataItem := TdxReportCellGraphic.Create(ACell); + with TdxReportCellGraphic(ADataItem) do + begin + CellSides := []; + if {ShowPreviewGrid and }ShowGrid then + begin + CellSides := [csTop, csBottom]; + if (ANode.Count = 0) or (not ANode.Expanded and not AutoNodesExpand) then + CellSides := CellSides + [csLeft]; + end; + DrawMode := gdmCenter; + Transparent := True; + if OddEvenMode and not Self.Transparent and (FPaintStyle = psOutlook) and (ANode.Count = 0) then + begin + Transparent := False; + if Odd(ANodeIndex) then + Color := OddColor + else + Color := EvenColor; + end; + ImageList := ATreeList.StateImages; + ImageIndex := ANode.StateIndex; + BoundsRect := Bounds(0, 0, ImageList.Width, Parent.Height); + APrevSibl := GetPrevSibling; + if APrevSibl <> nil then + Left := TdxReportCell(APrevSibl).BoundsRect.Right; + end; + end; + + { images } + if CanDrawImages(ANode) then + begin + ADataItem := TdxReportCellGraphic.Create(ACell); + with TdxReportCellGraphic(ADataItem) do + begin + CellSides := []; + if {ShowPreviewGrid and }ShowGrid then + begin + CellSides := [csTop, csBottom]; + if not CanDrawStateImages(ANode) and (ANode.Count = 0) or (not ANode.Expanded and not AutoNodesExpand) then + CellSides := CellSides + [csLeft]; + end; + DrawMode := gdmCenter; + Transparent := True; + if OddEvenMode and not Self.Transparent and (FPaintStyle = psOutlook) and (ANode.Count = 0) then + begin + Transparent := False; + if Odd(ANodeIndex) then + Color := OddColor + else + Color := EvenColor; + end; + ImageList := ATreeList.Images; + ImageIndex := ANode.ImageIndex; + BoundsRect := Bounds(0, 0, ImageList.Width, Parent.Height); + APrevSibl := GetPrevSibling; + if APrevSibl <> nil then + Left := TdxReportCell(APrevSibl).BoundsRect.Right; + end; + end; + end; + + if not ATreeList.IsRowGroup(ANode) then + begin + for I := 0 to FAbsoluteIndexes.Count - 1 do + begin + AAbsoluteIndex := Integer(FAbsoluteIndexes.List^[I]); + Column := ATreeList.Columns[AAbsoluteIndex]; + ReferenceColumn := GetReferenceColumn(Column, ANode); + ADataClass := GetDataClass(ReferenceColumn, ANode); + if (ADataClass <> nil) then + begin + ADataItem := ADataClass.Create(ACell); + AssignValues(ADataItem, ANode, Column, ReferenceColumn); + with ADataItem do + begin + CellSides := GetDataItemSides(ANode, AAbsoluteIndex); + BoundsRect := GetDataItemRect(ANode, AAbsoluteIndex, ACell); + Transparent := IsCellTransparent(ANode); + if not Transparent then + Color := GetCellColor(ANode, AAbsoluteIndex, ANodeIndex); + FontIndex := GetCellFontIndex(ANode, Column, ANodeIndex); + if IsSupportedCustomDraw(nil) then + Data := Integer(Column); + end; + end; + end + end + else + begin + ADataItem := TdxReportCellString.Create(ACell); + with TdxReportCellString(ADataItem) do + begin + Column := ATreeList.Columns[GetGroupColumnIndex(ANode)]; + Text := ATreeList.GetNodeString(ANode, Column.Index); + TextAlignY := taCenterY; + Transparent := IsCellTransparent(ANode); + if not Transparent then + Color := GetCellColor(ANode, 0, -1); + FontIndex := FGroupNodeFontIndex; + BoundsRect := Rect(GetTextIndent(ANode), 0, FFullWidth, ACellHeight); + if ShowGrid then + CellSides := [csTop..csBottom] + else // ver. 2.3 + CellSides := [csRight]; + if IsSupportedCustomDraw(nil) then + Data := Integer(Column); + end; + end; + +{preview} + if not ATreeList.IsRowGroup(ANode) and ShowPreview and (FPreviewHeight <> 0) then + begin + ADataItem := TdxReportCellString.Create(ACell); + with TdxReportCellString(ADataItem) do + begin + CellSides := GetPreviewCellSides(ANode); + Multiline := True; + Text := ATreeList.GetPreviewText(ANode); + TextAlignY := dxMultilineTextAlignY[Multiline]; + Transparent := IsPreviewTransparent(ANode); + if not Transparent then + Color := GetPreviewColor(ANodeIndex); + FontIndex := GetPreviewFontIndex(ANode, ANodeIndex); + Indent := ATreeList.IndentDesc; + BoundsRect := + Rect(GetTextIndent(ANode), ACellHeight - FPreviewHeight, FFullWidth, ACellHeight); + if IsSupportedCustomDraw(nil) then + ADataItem.Data := Integer(ANode); + end; + end; + +{row footers} + if ShowRowFooters and ANode.IsLast and (ANode.Count = 0) then + begin + ParentNode := ANode; + for I := 0 to ATreeList.GetRowFooterCount(ANode) - 1 do + begin + InsertRowFooters(ParentNode, ANode, AParent, I); + ParentNode := ParentNode.Parent; + end; + end; + end; + + procedure IterateNodes; + var + I, M: Integer; + Node: TdxTreeListNode; + begin + M := 0; + for I := 0 to FNodes.Count - 1 do + begin + Inc(M); + Node := TdxTreeListNode(FNodes.List^[I]); + if ATreeList.IsRowGroup(Node) or ((ATreeList.PaintStyle = psOutlook) and (Node.Count > 0)) then + M := 0; + ProcessCells(Node, AReportCells.Cells, M); + AReportCells.DoProgress(MulDiv(I, 100, FNodes.Count)); + if AbortBuilding then Break; + end; + end; + +begin + if Component = nil then Exit; + inherited ConstructReport(AReportCells); + PrepareConstruct(AReportCells); + try + if (FAbsoluteIndexes.Count > 0) then + begin + ATreeList := ExposeTreeList(CustomTreeList); + + AReportCells.BorderColor := GridLineColor; + AReportCells.TreeLineColor := TreeLineColor; + if ATreeList.PaintStyle = psStandard then + AReportCells.ExpandButtonBorderColor := clBtnShadow + else + AReportCells.ExpandButtonBorderColor := clBlack; + AReportCells.TreeLineStyle := TreeLineStylesMap[ATreeList.TreeLineStyle]; + + with AReportCells.Cells do + begin + Color := dxDefaultColor; + CellSides := []; + Transparent := True; + FontIndex := 0; + end; + if IsDrawHeadersOnEveryPage then + with AReportCells.HeaderCells do + begin + Color := dxDefaultFixedColor; + CellSides := []; + Transparent := False; + FontIndex := FHeaderFontIndex; + end; + if IsDrawFootersOnEveryPage then + with AReportCells.FooterCells do + begin + Color := dxDefaultFixedColor; + CellSides := []; + Transparent := False; + FontIndex := FFooterFontIndex; + end; + + if ShowBands then InsertBands; + if ShowHeaders then InsertHeaders; + if (FNodes <> nil) and (FNodes.Count > 0) then + IterateNodes; + + if not AbortBuilding then + if ShowFooters then + InsertFooters + else + InsertStub; + + if not AbortBuilding then + begin + with AReportCells do + begin + if Cells.CellCount > 0 then + Cells.BoundsRect := Rect(0, 0, FFullWidth, Cells.LastCell.BoundsRect.Bottom); + if IsDrawHeadersOnEveryPage and (HeaderCells.CellCount > 0) then + HeaderCells.BoundsRect := Rect(0, 0, FFullWidth, HeaderCells.LastCell.BoundsRect.Bottom); + if IsDrawFootersOnEveryPage and (FooterCells.CellCount > 0) then + FooterCells.BoundsRect := Rect(0, 0, FFullWidth, FooterCells.LastCell.BoundsRect.Bottom); + end; + CalcDelimiterCell(AReportCells); + end; + end; + finally + UnprepareConstruct(AReportCells); + end; +end; + +function TCustomdxTreeListReportLink.GetBandLeft(AVisibleIndex: Integer): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to AVisibleIndex - 1 do + Inc(Result, GetBandWidth(I)); +end; + +function TCustomdxTreeListReportLink.GetBandWidth(AVisibleIndex: Integer): Integer; +begin + Result := ExposeTreeList(CustomTreeList).GetBandWidth(AVisibleIndex); + if (AVisibleIndex = 0) then + Inc(Result, ExposeTreeList(CustomTreeList).GetIndentWidth); +end; + +function TCustomdxTreeListReportLink.GetPreviewColor(ANodeIndex: Integer): TColor; +begin + case DrawMode of + tldmStrict: + Result := PreviewColor; + tldmOddEven: + if Odd(ANodeIndex) then + Result := OddColor + else + Result := EvenColor + else + Result := PreviewColor; + end; +end; + +function TCustomdxTreeListReportLink.CanUseOddEvenMode(ANode: TdxTreeListNode; + ANodeIndex: Integer): Boolean; +begin + Result := (DrawMode = tldmOddEven) and (ANodeIndex <> -1) and + ((FPaintStyle <> psOutlook) or (ANode.Count = 0)) +end; + +function TCustomdxTreeListReportLink.GetOddEvenModeCellColor(ANodeIndex: Integer): TColor; +begin + if Odd(ANodeIndex) then + Result := OddColor + else + Result := EvenColor; +end; + +function TCustomdxTreeListReportLink.GetCellColor(ANode: TdxTreeListNode; + AColumnIndex: Integer; ANodeIndex: Integer): TColor; +begin + if CanUseOddEvenMode(ANode, ANodeIndex) then + Result := GetOddEvenModeCellColor(ANodeIndex) + else + if DrawMode = tldmBorrowSource then + if (FPaintStyle = psOutlook) and (ANode.Count > 0) then + begin + Result := GroupNodeColor; + ExposeTreeList(CustomTreeList).DoGetLevelColor(ANode.Level, Result); + end + else + begin + Result := ExposeTreeList(CustomTreeList).GetColumnColor(AColumnIndex); + if (Result = ExposeTreeList(CustomTreeList).Color) then + Result := Color; + end + else + if (FPaintStyle = psOutlook) and (ANode.Count > 0) then + Result := GroupNodeColor + else + Result := Color; +end; + +function TCustomdxTreeListReportLink.IsPreviewTransparent(ANode: TdxTreeListNode): Boolean; +begin + if (FPaintStyle = psStandard) or (ANode.Count = 0) then + Result := Transparent + else + Result := True; +end; + +function TCustomdxTreeListReportLink.IsCellTransparent(ANode: TdxTreeListNode): Boolean; +begin + if (FPaintStyle = psStandard) or (ANode.Count = 0) then + Result := Transparent + else + Result := FixedTransparent; +end; + +function TCustomdxTreeListReportLink.GetLevelColor(ANode: TdxTreeListNode; + ANodeIndex: Integer): TColor; +begin + if FPaintStyle = psStandard then + begin + case DrawMode of + tldmStrict: + Result := Color; + tldmOddEven: + if ANodeIndex = -1 then + Result := RowFooterColor + else + if Odd(ANodeIndex) then + Result := OddColor + else + Result := EvenColor; + else {tldmBorrowSource} + Result := ExposeTreeList(CustomTreeList).Color + end + end + else + begin + if (ANode = nil) or (ANode.Count = 0) then + Result := ColorToRGB(Color) + else + Result := ColorToRGB(GroupNodeColor); + + if (DrawMode = tldmBorrowSource) and (ANode <> nil) and (ANode.Count <> 0) then + ExposeTreeList(CustomTreeList).DoGetLevelColor(ANode.Level, Result) + end; +end; + +function TCustomdxTreeListReportLink.IsLevelTransparent(ANode: TdxTreeListNode): Boolean; +begin + if (FPaintStyle = psStandard) or (ANode.Count = 0) then + Result := Transparent + else + Result := FixedTransparent; +end; + +function TCustomdxTreeListReportLink.GetOddNodeFontIndex(AColumn: TdxTreeListColumn): Integer; +begin + if IsHyperLinkColumn(AColumn) then + Result := FOddHyperLinkFontIndex + else + Result := FOddFontIndex; +end; + +function TCustomdxTreeListReportLink.GetEvenNodeFontIndex(AColumn: TdxTreeListColumn): Integer; +begin + if IsHyperLinkColumn(AColumn) then + Result := FEvenHyperLinkFontIndex + else + Result := FEvenFontIndex; +end; + +function TCustomdxTreeListReportLink.GetOddEvenModeFontIndex(AColumn: TdxTreeListColumn; + ANodeIndex: Integer): Integer; +begin + if Odd(ANodeIndex) then + Result := GetOddNodeFontIndex(AColumn) + else + Result := GetEvenNodeFontIndex(AColumn); +end; + +function TCustomdxTreeListReportLink.MakeLookAndFeel: TdxLookAndFeel; +begin + if Use3DEffects then + begin + if UseSoft3D then + Result := lfFlat + else + Result := lfStandard; + end + else + Result := lfUltraFlat; +end; + +function TCustomdxTreeListReportLink.NeedGroupNodeFontIndex(ANode: TdxTreeListNode; + AFontIndex: Integer): Boolean; +begin + Result := (AFontIndex = FFontIndex) and ((FPaintStyle = psOutLook) and (ANode.Count > 0)); +end; + +function TCustomdxTreeListReportLink.AreSelectedNodesExist: Boolean; +begin + Result := OnlySelected and (ExposeTreeList(CustomTreeList).SelectedCount > 0); +end; + +function TCustomdxTreeListReportLink.GetCellFontIndex(ANode: TdxTreeListNode; + AColumn: TdxTreeListColumn; ANodeIndex: Integer): Integer; +begin + if CanUseOddEvenMode(ANode, ANodeIndex) then + Result := GetOddEvenModeFontIndex(AColumn, ANodeIndex) + else + begin + if ExposeTreeList(CustomTreeList).IsRowGroup(ANode) then + Result := FGroupNodeFontIndex + else + begin + if DrawMode = tldmBorrowSource then + begin + Result := PdxColumnInfo(FColumnInfos.List^[AColumn.Index]).FontIndex; + if NeedGroupNodeFontIndex(ANode, Result) then + Result := FGroupNodeFontIndex; + end + else + begin + if IsHyperLinkColumn(AColumn) then + Result := FHyperLinkFontIndex + else + Result := FFontIndex; + end; + end; + end; +end; + +function TCustomdxTreeListReportLink.GetPreviewFontIndex(ANode: TdxTreeListNode; + ANodeIndex: Integer): Integer; +begin + if CanUseOddEvenMode(ANode, ANodeIndex) then + begin + if Odd(ANodeIndex) then + Result := FOddFontIndex + else + Result := FEvenFontIndex + end + else + Result := FPreviewFontIndex; +end; + +function TCustomdxTreeListReportLink.IsSelectedNode(ANode: TdxTreeListNode): Boolean; + + function IsExistSelectedChild(ANode: TdxTreeListNode): Boolean; + var + I, J: Integer; + begin + Result := False; + with ExposeTreeList(CustomTreeList) do + for I := 0 to ANode.Count - 1 do + begin + for J := 0 to SelectedCount - 1 do + begin + Result := ANode[I] = SelectedNodes[J]; + if Result then Exit; + end; + if ANode[I].Count > 0 then + begin + Result := IsExistSelectedChild(ANode[I]); + if Result then Exit; + end; + end; + end; + + function FindInOriginal(ANode: TdxTreeListNode): Boolean; + var + I: Integer; + begin + Result := False; + with ExposeTreeList(CustomTreeList) do + for I := 0 to SelectedCount - 1 do + begin + Result := ANode = SelectedNodes[I]; + //Result := ANode.Selected; + if Result then Exit; + end; + end; + + function FindInChildren(ANode: TdxTreeListNode): Boolean; + var + I: Integer; + begin + Result := False; + for I := 0 to ANode.Count - 1 do + begin + Result := FindInOriginal(ANode[I]); + if Result then + Break + else + if ANode[I].Count > 0 then + Result := FindInChildren(ANode[I]); + if Result then Break; + end; + end; + + function FindInParent(ANode: TdxTreeListNode): Boolean; + begin + Result := False; + ANode := ANode.Parent; + while Assigned(ANode) do + begin + Result := FindInOriginal(ANode); + //if not Result then Result := FindInChildren(ANode); + if Result then Break; + ANode := ANode.Parent; + end; + end; + +begin + Result := FindInOriginal(ANode); + if not Result and (ANode.Count > 0) then + Result := FindInChildren(ANode); + if not Result and not IsExtendedSelect then + Result := FindInParent(ANode); +end; + +procedure TCustomdxTreeListReportLink.AddNodes; + + procedure AddNode(ANode: TdxTreeListNode); + var + I: Integer; + Node: TdxTreeListNode; + begin + FNodes.Add(ANode); + if ANode.Expanded or (AutoNodesExpand and ((ExpandLevel = -1) or (ExpandLevel > ANode.Level))) then + for I := 0 to ANode.Count - 1 do + begin + Node := ANode[I]; + if not AreSelectedNodesExist or IsSelectedNode(Node) then + AddNode(Node); + end; + end; + +var + I: Integer; + Node: TdxTreeListNode; +begin + FNodes.Clear; + if CustomTreeList.Count > 0 then + begin + if not AutoNodesExpand then + begin + if OnlySelected then + FNodes.Capacity := ExposeTreeList(CustomTreeList).SelectedCount + else + FNodes.Capacity := ExposeTreeList(CustomTreeList).GetAbsoluteCount; + end; + + for I := 0 to CustomTreeList.Count - 1 do + begin + Node := CustomTreeList.Items[I]; + if not AreSelectedNodesExist or IsSelectedNode(Node) then + AddNode(Node); + end; + end; +end; + +procedure TCustomdxTreeListReportLink.CalcColumnInfos(AReportCells: TdxReportCells); +type + PIntArray = ^TIntArray; + TIntArray = array[0..0] of Integer; +var + ATreeList: TdxTreeListAccess; + Column: TdxTreeListColumnAccess; + I, J, LineCount, HeaderWidth, AbsoluteIndex: Integer; + HeaderInfo: PdxColumnInfo; + F: TFont; + HyperLinkColumn: Boolean; +begin + if FAbsoluteIndexes.Count = 0 then Exit; + + ATreeList := ExposeTreeList(CustomTreeList); + + FColumnInfos := TList.Create; + +{$IFOPT R+}{$DEFINE PREVRANGECHECK}{$R-}{$ENDIF} + FColumnInfos.Count := + 1 + Math.MaxIntValue(Slice(PIntArray(FAbsoluteIndexes.List)^, FAbsoluteIndexes.Count)); +{$IFDEF SAVERANGECHECK}{$UNDEF PREVRANGECHECK}{$R+}{$ENDIF} + + F := TFont.Create; + try + with FAbsoluteIndexes do + for I := 0 to Count - 1 do + begin + AbsoluteIndex := Integer(List^[I]); + Column := TdxTreeListColumnAccess(ATreeList.Columns[AbsoluteIndex]); + New(HeaderInfo); + with HeaderInfo^ do + begin + HyperLinkColumn := IsHyperLinkColumn(Column); + if UseColumnFont and (ATreeList.IsExistColumnFont(AbsoluteIndex) or HyperLinkColumn) then + begin + F.Assign(ATreeList.GetColumnFont(AbsoluteIndex)); + if HyperLinkColumn then + begin + //F.Color := clBlue; // TODO: HyperLinkColumn Font Color + F.Style := [fsUnderline]; + end; + FontIndex := AddFontToPool(F); + end + else + FontIndex := FFontIndex; + + BandIndex := ATreeList.GetVisibleBandIndex(ATreeList.GetHeaderBandIndex(AbsoluteIndex)); + RowIndex := ATreeList.GetHeaderRowIndex(AbsoluteIndex); + RowCount := ATreeList.GetHeaderRowCount(BandIndex); + ColIndex := ATreeList.GetHeaderColIndex(AbsoluteIndex); + ColCount := ATreeList.GetHeaderColCount(BandIndex, RowIndex); + + ColumnLeft := GetBandLeft(BandIndex); + for J := 0 to ColIndex - 1 do + begin + HeaderWidth := ATreeList.GetHeaderBoundsWidth(ATreeList.GetHeaderAbsoluteIndex(BandIndex, RowIndex, J)); + Inc(ColumnLeft, HeaderWidth); + end; + ColumnRight := ColumnLeft + ATreeList.GetHeaderBoundsWidth(AbsoluteIndex); + CellTop := 0; + FooterTop := 0; + HeaderTop := 0; + NodeFooterTop := 0; + for J := 0 to RowIndex - 1 do + begin + LineCount := ATreeList.GetHeaderLineCount(BandIndex, J, ColIndex); + Inc(CellTop, LineCount * FRowHeight); + Inc(FooterTop, LineCount * FFooterRowHeight); + Inc(HeaderTop, LineCount * FHeaderRowHeight); + Inc(NodeFooterTop, LineCount * FGroupFooterRowHeight); + end; + LineCount := ATreeList.GetHeaderLineCount(BandIndex, RowIndex, ColIndex); + CellBottom := CellTop + LineCount * FRowHeight; + FooterBottom := FooterTop + LineCount * FFooterRowHeight + 3; + HeaderBottom := HeaderTop + LineCount * FHeaderRowHeight + 0; + NodeFooterBottom := NodeFooterTop + LineCount * FGroupFooterRowHeight + 3; + IsFirstColumn := (BandIndex = 0) and (ColIndex = 0); + IsLastColumn := (BandIndex = ATreeList.GetBandCount - 1) and (ColIndex = ColCount - 1); + + IsHeaderMultiline := (ATreeList.GetHeaderLineCount(BandIndex, RowIndex, ColIndex) > 1) or + (ATreeList.GetHeaderLineRowCount > 1); + + IsMultiline := (ATreeList.GetHeaderLineCount(BandIndex, RowIndex, ColIndex) > 1) or + ((ATreeList.GetHeaderLineRowCount > 1) and Column.IsColumnMultiline); + + //IsMultiline := (ATreeList.GetHeaderLineCount(ATreeList.GetVisibleBandIndex(BandIndex), RowIndex, ColIndex) > 1) or + // ((ATreeList.GetHeaderLineRowCount > 1) and Column.IsColumnMultiline); + end; + FColumnInfos.List^[AbsoluteIndex] := HeaderInfo; + end; + finally + F.Free; + end; +end; + +procedure TCustomdxTreeListReportLink.CalcDelimiterCell(AReportCells: TdxReportCells); +var + TreeList: TdxTreeListAccess; + I: Integer; +begin + TreeList := ExposeTreeList(CustomTreeList); + FHorzDelimiterCell := nil; + if UseHorzDelimiters then + begin + if ShowBands and HorzDelimitByBands then + if not IsAggregated and BandsOnEveryPage and (CustomTreeList.Count > 0) then + FHorzDelimiterCell := AReportCells.HeaderCells[0] + else + FHorzDelimiterCell := AReportCells.Cells[0] + else + if ShowHeaders then + if not IsAggregated and BandsOnEveryPage and HeadersOnEveryPage and (CustomTreeList.Count > 0)then + FHorzDelimiterCell := AReportCells.HeaderCells[Byte(ShowBands)] + else + FHorzDelimiterCell := AReportCells.Cells[Byte(ShowBands)] + else + if ShowBands then + FHorzDelimiterCell := AReportCells.Cells[Byte(IsAggregated or not BandsOnEveryPage)] + else + if AReportCells.Cells.CellCount > 0 then + FHorzDelimiterCell := AReportCells.Cells[0] + end; + + if FHorzDelimiterCell <> nil then + if not ShowBands and not ShowHeaders and (CustomTreeList.Count > 0) and + (AReportCells.Cells.CellCount > 0) and + TreeList.IsRowGroup(TdxTreeListNode(FNodes.List[0])) then + begin + I := 0; + while (I < FNodes.Count) and TreeList.IsRowGroup(TdxTreeListNode(FNodes.List[I])) do + Inc(I); + if I < FNodes.Count then + FHorzDelimiterCell := FHorzDelimiterCell.Parent.Cells[I] + else + FHorzDelimiterCell := nil; + end; +end; + +procedure TCustomdxTreeListReportLink.FreeHeaderInfos; +var + I: Integer; +begin + if FColumnInfos = nil then Exit; + with FColumnInfos do + begin + for I := 0 to Count - 1 do + if List^[I] <> nil then + Dispose(PdxColumnInfo(List^[I])); + end; + FColumnInfos.Free; + FColumnInfos := nil; +end; + +procedure TCustomdxTreeListReportLink.CalcFontIndexes(AReportCells: TdxReportCells); +var + F: TFont; +begin + if FAbsoluteIndexes.Count = 0 then Exit; + + FBandFontIndex := AddFontToPool(BandFont); + FEvenFontIndex := AddFontToPool(EvenFont); + FGroupNodeFontIndex := AddFontToPool(GroupNodeFont); + FFooterFontIndex := AddFontToPool(FooterFont); + FHeaderFontIndex := AddFontToPool(HeaderFont); + FOddFontIndex := AddFontToPool(OddFont); + FPreviewFontIndex := AddFontToPool(PreviewFont); + FRowFooterFontIndex := AddFontToPool(RowFooterFont); + if IsHyperLinkColumnsExists then + begin + F := TFont.Create; + try + F.Assign(Self.Font); + F.Style := F.Style + [fsUnderline]; + FHyperLinkFontIndex := AddFontToPool(F); + if (DrawMode = tldmOddEven) then + begin + F.Assign(Self.OddFont); + F.Style := F.Style + [fsUnderline]; + FOddHyperLinkFontIndex := AddFontToPool(F); + F.Assign(Self.EvenFont); + F.Style := F.Style + [fsUnderline]; + FEvenHyperLinkFontIndex := AddFontToPool(F); + end; + finally + F.Free; + end; + end; +end; + +procedure TCustomdxTreeListReportLink.GetColumnInfos(AAbsoluteIndex: Integer; + ABandIndex, ARowIndex, AColIndex, ARowCount, AColCount: PInteger; + AIsFirstColumn, AIsLastColumn: PBoolean); +begin + with PdxColumnInfo(FColumnInfos.List^[AAbsoluteIndex])^ do + begin + if ABandIndex <> nil then ABandIndex^ := BandIndex; + if AColIndex <> nil then AColIndex^ := ColIndex; + if AColCount <> nil then AColCount^ := ColCount; + if ARowIndex <> nil then ARowIndex^ := RowIndex; + if ARowCount <> nil then ARowCount^ := RowCount; + if AIsFirstColumn <> nil then AIsFirstColumn^ := IsFirstColumn; + if AIsLastColumn <> nil then AIsLastColumn^ := IsLastColumn; + end; +end; + +procedure TCustomdxTreeListReportLink.GetCellRect(AAbsoluteIndex: Integer; + ACellType: TdxTreeListLinkCellType; var R: TRect); +begin + with PdxColumnInfo(FColumnInfos.List^[AAbsoluteIndex])^ do + begin + R.Left := ColumnLeft; + R.Right := ColumnRight; + case ACellType of + tlstCell: + begin + R.Top := CellTop; + R.Bottom := CellBottom; + end; + tlstFooter: + begin + R.Top := FooterTop; + R.Bottom := FooterBottom; + end; + tlstGroupFooter: + begin + R.Top := NodeFooterTop; + R.Bottom := NodeFooterBottom; + end; + tlstHeader: + begin + R.Top := HeaderTop; + R.Bottom := HeaderBottom; + end; + else + R.Top := 0; + R.Bottom := 0; + end; + end; +end; + +procedure TCustomdxTreeListReportLink.CalcAbsoluteIndexes; +var + I, J, K, Ind: Integer; +begin + with ExposeTreeList(CustomTreeList) do + begin + for I := 0 to GetBandCount - 1 do + for J := 0 to GetHeaderRowCount(I) - 1 do + for K := 0 to GetHeaderColCount(I, J) - 1 do + begin + Ind := GetHeaderAbsoluteIndex(I, J, K); + FAbsoluteIndexes.Add(Pointer(Ind)); + end; + end; +end; + +procedure TCustomdxTreeListReportLink.MakeDelimiters(AReportCells: TdxReportCells; + AHorzDelimiters, AVertDelimiters: TList); + + procedure IterateChildrens(ACell: TdxReportCell); + var + I: Integer; + Cell: TdxReportCell; + begin + for I := 0 to ACell.CellCount - 1 do + begin + Cell := ACell[I]; + AVertDelimiters.Add(Pointer(Cell.AbsoluteOrigin.Y)); + if Cell.HasChildren then + IterateChildrens(Cell); + end; + end; + +var + I: Integer; +begin + inherited MakeDelimiters(AReportCells, AHorzDelimiters, AVertDelimiters); + + if (AReportCells.Cells.CellCount > 0) or + (IsDrawHeadersOnEveryPage and (AReportCells.HeaderCells.CellCount > 0)) or + (IsDrawFootersOnEveryPage and (AReportCells.FooterCells.CellCount > 0)) then + begin + {horz.} + if UseHorzDelimiters and (FHorzDelimiterCell <> nil) then + for I := 0 to FHorzDelimiterCell.DataItemCount - 1 do + with FHorzDelimiterCell.DataItems[I] do + begin + AHorzDelimiters.Add(Pointer(AbsoluteOrigin.X)); + AHorzDelimiters.Add(Pointer(AbsoluteOrigin.X + Width)); + end; + + {vert.} + if UseVertDelimiters then + begin + if AReportCells.Cells.CellCount > 0 then + IterateChildrens(AReportCells.Cells); + //if (IsDrawHeadersOnEveryPage and (AReportCells.HeaderCells.CellCount > 0)) then + if not IsDrawHeadersOnEveryPage then + IterateChildrens(AReportCells.HeaderCells); + //if (IsDrawFootersOnEveryPage and (AReportCells.FooterCells.CellCount > 0)) then + if not IsDrawFootersOnEveryPage then + IterateChildrens(AReportCells.FooterCells); + end; + end + else + begin + AHorzDelimiters.Add(Pointer(1)); + AVertDelimiters.Add(Pointer(1)); + end; +end; + +procedure TCustomdxTreeListReportLink.DoCustomDrawBandCell(ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; ABand: TdxTreeListBand; var AText: string; + var AColor: TColor; AFont: TFont; var ATextAlignX: TdxTextAlignX; + var ATextAlignY: TdxTextAlignY; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawBandCell) then + FOnCustomDrawBandCell(Self, ACanvas, ABoundsRect, AClientRect, ABand, AText, + AColor, AFont, ATextAlignX, ATextAlignY, ADone); +end; + +procedure TCustomdxTreeListReportLink.DoCustomDrawCell(ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; ANode: TdxTreeListNode; + AColumn: TdxTreeListColumn; var AText: string; var AColor: TColor; + AFont: TFont; var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawCell) then + FOnCustomDrawCell(Self, ACanvas, ABoundsRect, AClientRect, ANode, AColumn, + AText, AColor, AFont, ATextAlignX, ATextAlignY, ADone); +end; + +procedure TCustomdxTreeListReportLink.DoCustomDrawFooterCell(ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; ANode: TdxTreeListNode; + AColumn: TdxTreeListColumn; var AText: string; var AColor: TColor; + AFont: TFont; var ATextAlignX: TdxTextAlignX; var ATextAlignY: TdxTextAlignY; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawFooterCell) then + FOnCustomDrawFooterCell(Self, ACanvas, ABoundsRect, AClientRect, ANode, + AColumn, AText, AColor, AFont, ATextAlignX, ATextAlignY, ADone); +end; + +procedure TCustomdxTreeListReportLink.DoCustomDrawHeaderCell(ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; AColumn: TdxTreeListColumn; var AText: string; + var AColor: TColor; AFont: TFont; var ATextAlignX: TdxTextAlignX; + var ATextAlignY: TdxTextAlignY; var ASorted: TdxCellSortOrder; + var ADone: Boolean); +begin + if Assigned(FOnCustomDrawHeaderCell) then + FOnCustomDrawHeaderCell(Self, ACanvas, ABoundsRect, AClientRect, AColumn, + AText, AColor, AFont, ATextAlignX, ATextAlignY, ASorted, ADone); +end; + +procedure TCustomdxTreeListReportLink.DoCustomDrawPreviewCell(ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; ANode: TdxTreeListNode; var AText: string; + var AColor: TColor; AFont: TFont; var ADone: Boolean); +var + ATextColor, C: TColor; +begin + if Assigned(FOnCustomDrawPreviewCell) then + begin + ATextColor := AFont.Color; + C := ATextColor; + FOnCustomDrawPreviewCell(Self, ACanvas, ABoundsRect, AClientRect, ANode, AText, + AColor, ATextColor, AFont, ADone); + if C <> ATextColor then AFont.Color := ATextColor; + end; +end; + +procedure TCustomdxTreeListReportLink.DoCustomDrawRowFooterCell(ACanvas: TCanvas; + ABoundsRect, AClientRect: TRect; ANode: TdxTreeListNode; + AColumn: TdxTreeListColumn; AFooterIndex: Integer; var AText: string; + var AColor: TColor; AFont: TFont; var ATextAlignX: TdxTextAlignX; + var ATextAlignY: TdxTextAlignY; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawRowFooterCell) then + FOnCustomDrawRowFooterCell(Self, ACanvas, ABoundsRect, AClientRect, ANode, + AColumn, AFooterIndex, AText, AColor, AFont, ATextAlignX, ATextAlignY, ADone); +end; + +procedure TCustomdxTreeListReportLink.ReadIsGraphicAsTextValueAssigned(AReader: TReader); +begin + FIsGraphicAsTextValueAssigned := AReader.ReadBoolean; +end; + +procedure TCustomdxTreeListReportLink.WriteIsGraphicAsTextValueAssigned(AWriter: TWriter); +begin + AWriter.WriteBoolean(FIsGraphicAsTextValueAssigned); +end; + +{ TdxTreeListReportLink } + +procedure TdxTreeListReportLink.AssignValues(ADataItem: TAbstractdxReportCellData; + ANode: TdxTreeListNode; AColumn, AReferenceColumn: TdxTreeListColumn); +begin + if Assigned(FdxTreeListAssignDataProc) then + FdxTreeListAssignDataProc(Self, ADataItem, TreeList, ANode, AColumn, AReferenceColumn); +end; + +function TdxTreeListReportLink.GetDataClass(AColumn: TdxTreeListColumn; + ANode: TdxTreeListNode): TdxReportCellDataClass; +begin + if Assigned(FdxTreeListColumnMapperProc) then + Result := FdxTreeListColumnMapperProc(AColumn, Self, ANode) + else + Result := nil; +end; + +procedure TdxTreeListReportLink.GetOwnedImageLists(AProc: TdxPSGetImageListProc); +begin + inherited GetOwnedImageLists(AProc); + AProc(TreeList.Images); + AProc(TreeList.StateImages); +end; + +function TdxTreeListReportLink.GetTreeList: TdxTreeList; +begin + Result := TdxTreeList(Component) +end; + +{ TdxTLReportLinkDesignWindow } + +constructor TdxTLReportLinkDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxhcTreeListReportLinkDesigner; + inherited Create(AOwner); + CreateControls; + FillTreeListData; + dxTLPreview.FullExpand; + PageControl1.ActivePage := PageControl1.Pages[0]; + dxPSPopupMenuController.RegisterControl(lbxFonts); +end; + +destructor TdxTLReportLinkDesignWindow.Destroy; +begin + dxPSPopupMenuController.UnregisterControl(lbxFonts); + inherited Destroy; +end; + +procedure TdxTLReportLinkDesignWindow.FillTreeListData; + + procedure AddNodeData(ANode: TdxTreeListNode; const AText1, AText2, AText3: string; + AValue: Integer; AData: Integer); + begin + with ANode do + begin + Strings[0] := AText1; + Strings[1] := AText2; + Strings[2] := AText3; + Values[2] := IntToStr(AValue); + Data := Pointer(AData); + StateIndex := 1; + ImageIndex := 0; + SelectedIndex := 0; + end; + end; + +var + Node: TdxTreeListNode; +begin + dxTLPreview.Bands[0].Caption := cxGetResourceString(@sdxTLBand); + dxTLPreview.Columns[0].Caption := cxGetResourceString(@sdxTLColumnName); + dxTLPreview.Columns[1].Caption := cxGetResourceString(@sdxTLColumnAxisymmetric); + dxTLPreview.Columns[2].Caption := cxGetResourceString(@sdxTLColumnItemShape); + + dxTLPreview.ClearNodes; + Node := dxTLPreview.Add; + AddNodeData(Node, sdxRegular, dxBoolToStr(True), cxGetResourceString(@sdxItemShapeAsText), -1, 0); + AddNodeData(Node.AddChild, cxGetResourceString(@sdxItem1Name), dxBoolToStr(True), cxGetResourceString(@sdxItemShapeAsText), 2, 1); + AddNodeData(Node.AddChild, cxGetResourceString(@sdxItem2Name), dxBoolToStr(True), cxGetResourceString(@sdxItemShapeAsText), 3, 2); + AddNodeData(Node.AddChild, cxGetResourceString(@sdxItem3Name), dxBoolToStr(True), cxGetResourceString(@sdxItemShapeAsText), 4, 3); + AddNodeData(Node.AddChild, cxGetResourceString(@sdxItem4Name), dxBoolToStr(False), cxGetResourceString(@sdxItemShapeAsText), 6, 4); + + Node := dxTLPreview.Add; + AddNodeData(Node, cxGetResourceString(@sdxIrregular), dxBoolToStr(False), cxGetResourceString(@sdxItemShapeAsText), -1, 5); + AddNodeData(Node.AddChild, cxGetResourceString(@sdxItem5Name), dxBoolToStr(False), cxGetResourceString(@sdxItemShapeAsText), 5, 6); +end; + +function TdxTLReportLinkDesignWindow.GetReportLink: TCustomdxTreeListReportLink; +begin + Result := inherited ReportLink as TCustomdxTreeListReportLink; +end; + +procedure TdxTLReportLinkDesignWindow.pbxPreviewPaint(Sender: TObject); +begin + with TdxPSPaintPanel(Sender) do + PaintPreview(Canvas, ClientRect); +end; + +procedure FrameRectColor(DC: HDC; const R: TRect; AColor: TColor); +var + Brush: HBRUSH; +begin + Brush := CreateSolidBrush(ColorToRGB(AColor)); + FrameRect(DC, R, Brush); + DeleteObject(Brush); +end; + +procedure FillRectColor(DC: HDC; const R: TRect; AColor: TColor); +var + Brush: HBRUSH; +begin + Brush := CreateSolidBrush(ColorToRGB(AColor)); + FillRect(DC, R, Brush); + DeleteObject(Brush); +end; + +const + Alignments: array[TAlignment] of UINT = (DT_LEFT, DT_RIGHT, DT_CENTER); + +procedure DrawTextRect(ACanvas: TCanvas; R: TRect; const AText: string; + AAlignment: TAlignment; AColor: TColor); +var + DC: HDC; +begin + DC := ACanvas.Handle; + FillRectColor(DC, R, AColor); + InflateRect(R, -2, 0); + SetBkMode(DC, Windows.TRANSPARENT); + DrawText(DC, PChar(AText), Length(AText), R, DT_SINGLELINE or DT_VCENTER or Alignments[AAlignment]); +end; + +procedure DrawFooterRect(ACanvas: TCanvas; R: TRect; const AText: string; + AAlignment: TAlignment; ALookAndFeel: TdxLookAndFeel; ABorderColor, AColor: TColor); +var + DC: HDC; +begin + DC := ACanvas.Handle; + case ALookAndFeel of + lfStandard, lfFlat: + DrawEdge(DC, R, BDR_SUNKENOUTER, BF_RECT or BF_SOFT); + lfUltraFlat: + FrameRectColor(DC, R, ABorderColor); + end; + InflateRect(R, -1, -1); + DrawTextRect(ACanvas, R, AText, AAlignment, AColor); +end; + +procedure DrawHeaderRect(ACanvas: TCanvas; R: TRect; const AText: string; + AAlignment: TAlignment; ALookAndFeel: TdxLookAndFeel; ABorderColor, AColor: TColor); +var + DC: HDC; +begin + DC := ACanvas.Handle; + case ALookAndFeel of + lfStandard: + begin + DrawEdge(DC, R, BDR_RAISEDINNER, BF_LEFT or BF_TOP); + DrawEdge(DC, R, BDR_RAISEDOUTER, BF_RIGHT or BF_BOTTOM); + Dec(R.Right); Dec(R.Bottom); + DrawEdge(DC, R, BDR_RAISEDINNER, BF_RIGHT or BF_BOTTOM); + end; + lfFlat: + begin + DrawEdge(DC, R, BDR_RAISEDINNER, BF_LEFT or BF_TOP); + DrawEdge(DC, R, BDR_RAISEDOUTER, BF_RIGHT or BF_BOTTOM); + end; + lfUltraFlat: + begin + Dec(R.Left); Dec(R.Top); + FrameRectColor(DC, R, ABorderColor); + end; + end; + InflateRect(R, -1, -1); + DrawTextRect(ACanvas, R, AText, AAlignment, AColor); +end; + +procedure TdxTLReportLinkDesignWindow.PaintPreview(ACanvas: TCanvas; R: TRect); +var + DC: HDC; + R2: TRect; + DrawInfo: TdxGridDrawInfo; +begin + inherited; + DC := ACanvas.Handle; + Inc(R.Left); + Inc(R.Top); + dxTLPreview.PaintTo(DC, R.Left, R.Top); + + dxTLPreview.CalcDrawInfo(DrawInfo); + try + R2 := DrawInfo.EmptyRectBottom; + if not IsRectEmpty(R2) then + begin + OffsetRect(R2, R.Left, R.Top); + FillRectColor(DC, R2, clWindow); + end; + finally + dxTLPreview.FreeDrawInfo(DrawInfo); + end; + + Dec(R.Left); + Dec(R.Top); + FrameRectColor(DC, R, ReportLink.GridLineColor); +end; + +procedure TdxTLReportLinkDesignWindow.SetupPreview; +begin + if ReportLink.Component <> nil then + with dxTLPreview do + begin + if ReportLink.IsDBGridLink then + begin + Images := nil; + StateImages := nil; + end; + PaintStyle := ReportLink.FPaintStyle; + FullExpand; + end; +end; + +procedure TdxTLReportLinkDesignWindow.CreateControls; + + function CreateColorCombo(AParent: TWinControl; AHost: TControl; + ATag: Integer; AAutoColor: TColor; ALabel: TLabel): TdxPSColorCombo; + begin + Result := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(Result) do + begin + BoundsRect := AHost.BoundsRect; + Tag := ATag; + Parent := AParent; + ColorTypes := [ctPure]; + ShowColorName := True; + ShowAutoColor := True; + AutoColor := AAutoColor; + OnChange := ccbxColorChange; + end; + ALabel.FocusControl := Result; + AHost.Visible := False; + end; + +begin + ccbxColor := + CreateColorCombo(gbxTransparent, bvlColorHolder, 0, dxDefaultColor, lblColor); + ccbxEvenColor := + CreateColorCombo(gbxTransparent, bvlEvenColorHolder, 1, dxDefaultColor, lblEvenColor); + ccbxPreviewColor := + CreateColorCombo(gbxTransparent, bvlPreviewColorHolder, 2, dxDefaultColor, lblPreviewColor); + ccbxBandColor := + CreateColorCombo(gbxFixedTransparent, bvlBandColorHolder, 3, dxDefaultFixedColor, lblBandColor); + + ccbxHeaderColor := + CreateColorCombo(gbxFixedTransparent, bvlHeaderColorHolder, 5, dxDefaultFixedColor, lblHeaderColor); + ccbxGroupNodeColor := + CreateColorCombo(gbxFixedTransparent, bvlGroupNodeColorHolder, 4, dxDefaultFixedColor, lblGroupNodeColor); + ccbxRowFooterColor := + CreateColorCombo(gbxFixedTransparent, bvlRowFooterColorHolder, 6, dxDefaultFixedColor, lblRowFooterColor); + + ccbxGridLineColor := + CreateColorCombo(tshColors, bvlGridLineColorHolder, 7, dxDefaultGridLineColor, lblGridLineColor); + ccbxGridLineColor.TabOrder := ccbxGridLineColor.Parent.ControlCount - 1; + + ccbxTreeLineColor := + CreateColorCombo(tshColors, bvlTreeLineColorHolder, 8, dxDefaultTreeLineColor, lblTreeLineColor); + ccbxTreeLineColor.TabOrder := ccbxTreeLineColor.Parent.ControlCount - 1; + + seExpandLevel := TdxPSSpinEdit.Create(Self); + with TdxPSSpinEdit(seExpandLevel) do + begin + BoundsRect := bvlExpandLevelHolder.BoundsRect; + MinValue := -1; + MaxValue := 100; + Flat := False; + Parent := tshBehaviors; + TabOrder := chbxAutoNodesExpand.TabOrder + 1; + OnChange := ExpandLevelChange; + end; + lblExpandLevel.FocusControl := seExpandLevel; + + sePreviewLineCount := TdxPSSpinEdit.Create(Self); + with TdxPSSpinEdit(sePreviewLineCount) do + begin + BoundsRect := bvlPreviewLineCountHolder.BoundsRect; + MinValue := 0; + MaxValue := 100; + Flat := False; + Parent := tshPreview; + TabOrder := chbxAutoCalcPreviewLines.TabOrder + 1; + OnChange := PreviewLineCountChange; + end; + lblPreviewLineCount.FocusControl := sePreviewLineCount; + + FPreviewBox := TdxPSPaintPanel.Create(Self); + with TdxPSPaintPanel(FPreviewBox) do + begin + Parent := pnlPreview; + Height := dxTLPreview.Height + 1; + Width := dxTLPreview.Width + 1; + Left := (Parent.Width - Width) div 2; + Top := (Parent.Height - Height) div 2; + EdgeInner := esNone; + EdgeOuter := esNone; + OnPaint := pbxPreviewPaint; + end; +end; + +{$IFDEF DELPHI7} +function TdxTLReportLinkDesignWindow.GetPreviewHost: TCustomPanel; +begin + Result := pnlPreview; +end; +{$ENDIF} + +procedure TdxTLReportLinkDesignWindow.LoadStrings; +begin + inherited LoadStrings; + tshOptions.Caption := cxGetResourceString(@sdxOptions); + tshFonts.Caption := cxGetResourceString(@sdxFonts); + tshColors.Caption := cxGetResourceString(@sdxColors); + tshBehaviors.Caption := cxGetResourceString(@sdxBehaviors); + tshPreview.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + lblPreviewWindow.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + lblDrawMode.Caption := cxGetResourceString(@sdxDrawMode); + with cbxDrawMode.Items do + begin + BeginUpdate; + try + Clear; + AddObject(cxGetResourceString(@sdxDrawModeStrict), TObject(tldmStrict)); + AddObject(cxGetResourceString(@sdxDrawModeOddEven), TObject(tldmOddEven)); + AddObject(cxGetResourceString(@sdxDrawModeBorrow), TObject(tldmBorrowSource)); + finally + EndUpdate; + end; + end; + + lblShow.Caption := cxGetResourceString(@sdxShow); + + chbxShowExpandButtons.Caption := cxGetResourceString(@sdxExpandButtons); + chbxShowTreeLines.Caption := cxGetResourceString(@sdxTreeLines); + + chbxShowGrid.Caption := cxGetResourceString(@sdxGrid); + chbxShowNodeGrid.Caption := cxGetResourceString(@sdxNodesGrid); +// chbxShowGroupFooterGrid.Caption := cxGetResourceString(@sdxGroupFooterGrid); + + chbxShowImages.Caption := cxGetResourceString(@sdxImages); + chbxShowStateImages.Caption := cxGetResourceString(@sdxStateImages); + + chbxBandsOnEveryPage.Caption := cxGetResourceString(@sdxBandsOnEveryPage); + chbxHeadersOnEveryPage.Caption := cxGetResourceString(@sdxHeadersOnEveryPage); + chbxFootersOnEveryPage.Caption := cxGetResourceString(@sdxFootersOnEveryPage); + chbxAutoNodesExpand.Caption := cxGetResourceString(@sdxAutoNodesExpand); + chbxOnlySelected.Caption := cxGetResourceString(@sdxOnlySelected); + chbxExtendedSelect.Caption := cxGetResourceString(@sdxExtendedSelect); + lblExpandLevel.Caption := cxGetResourceString(@sdxExpandLevel); + lblPreview.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + stTransparent.Caption := ' ' + cxGetResourceString(@sdxTransparent) + ' '; + stFixedTransparent.Caption := ' ' + cxGetResourceString(@sdxFixedTransparent) + ' '; + + lblColor.Caption := cxGetResourceString(@sdxColor); + lblEvenColor.Caption := cxGetResourceString(@sdxEvenColor); + lblPreviewColor.Caption := cxGetResourceString(@sdxPreviewColor); + + lblBandColor.Caption := cxGetResourceString(@sdxBandColor); + lblHeaderColor.Caption := cxGetResourceString(@sdxHeaderColor); + lblRowFooterColor.Caption := cxGetResourceString(@sdxGroupFooterColor); + lblGroupNodeColor.Caption := cxGetResourceString(@sdxGroupNodeColor); + lblGridLineColor.Caption := cxGetResourceString(@sdxGridLinesColor); + lblTreeLineColor.Caption := cxGetResourceString(@sdxTreeLinesColor); + + with lbxFonts.Items do + begin + BeginUpdate; + try + Clear; + Add(cxGetResourceString(@sdxBandFont)); + Add(cxGetResourceString(@sdxFont)); + Add(cxGetResourceString(@sdxOddFont)); + Add(cxGetResourceString(@sdxEvenFont)); + Add(cxGetResourceString(@sdxGroupNodeFont)); + Add(cxGetResourceString(@sdxFooterFont)); + Add(cxGetResourceString(@sdxHeaderFont)); + Add(cxGetResourceString(@sdxPreviewFont)); + Add(cxGetResourceString(@sdxGroupFooterFont)); + finally + EndUpdate; + end; + end; + + btnChangeFont.Caption := cxGetResourceString(@sdxBtnChangeFont); + miChangeFont.Caption := cxGetResourceString(@sdxBtnChangeFont); + + chbxShowBands.Caption := cxGetResourceString(@sdxBands); + chbxShowHeaders.Caption := cxGetResourceString(@sdxHeaders); + chbxShowFooters.Caption := cxGetResourceString(@sdxFooters); + chbxShowGroupFooters.Caption := cxGetResourceString(@sdxGroupFooters); + chbxShowPreview.Caption := DropAmpersand(cxGetResourceString(@sdxVisible)); + chbxAutoCalcPreviewLines.Caption := cxGetResourceString(@sdxAutoCalcPreviewLineCount); + lblPreviewLineCount.Caption := cxGetResourceString(@sdxPreviewLineCount); + + lblOnEveryPage.Caption := cxGetResourceString(@sdxOnEveryPage); + lblSelection.Caption := cxGetResourceString(@sdxSelection); + lblExpanding.Caption := cxGetResourceString(@sdxExpanding); + lblLookAndFeel.Caption := cxGetResourceString(@sdxLookAndFeel); + lblRefinements.Caption := cxGetResourceString(@sdxRefinements); + + chbxUse3DEffects.Caption := cxGetResourceString(@sdxUse3DEffects); + chbxUseSoft3D.Caption := cxGetResourceString(@sdxSoft3D); + + chbxTransparentColumnGraphic.Caption := cxGetResourceString(@sdxTransparentColumnGraphics); + chbxDisplayGraphicsAsText.Caption := cxGetResourceString(@sdxDisplayGraphicsAsText); + chbxFlatCheckMarks.Caption := cxGetResourceString(@sdxFlatCheckMarks); + chbxCheckMarksAsText.Caption := cxGetResourceString(@sdxCheckMarksAsText); +end; + +procedure TdxTLReportLinkDesignWindow.CMDialogChar(var Msg: TCMDialogChar); +var + I: Integer; +begin + inherited; + with PageControl1 do + for I := 0 to PageCount - 1 do + if IsAccel(Msg.CharCode, Pages[I].Caption) then + begin + Msg.Result := 1; + ActivePage := Pages[I]; + Exit; + end; +end; + +procedure TdxTLReportLinkDesignWindow.UpdateControlsState; +begin + inherited; + + if ReportLink.OddEvenMode then + lblColor.Caption := cxGetResourceString(@sdxOddColor) + else + lblColor.Caption := cxGetResourceString(@sdxColor); + + chbxBandsOnEveryPage.Checked := ReportLink.BandsOnEveryPage; + chbxBandsOnEveryPage.Enabled := not ReportLink.IsAggregated; + + chbxHeadersOnEveryPage.Enabled := not ReportLink.IsAggregated and chbxBandsOnEveryPage.Checked; + chbxHeadersOnEveryPage.Checked := ReportLink.HeadersOnEveryPage; + + chbxFootersOnEveryPage.Enabled := not ReportLink.IsAggregated; + chbxFootersOnEveryPage.Checked := ReportLink.FootersOnEveryPage; + +// chbxShowTreeLines.Enabled := not ReportLink.IsDBGridLink; + if ReportLink.CustomTreeList <> nil then + with ExposeTreeList(ReportLink.CustomTreeList) do + begin + lblTreeLineColor.Visible := PaintStyle = psStandard; + ccbxTreeLineColor.Visible := PaintStyle = psStandard; + chbxShowTreeLines.Enabled := PaintStyle = psStandard; + end; + + chbxOnlySelected.Checked := ReportLink.OnlySelected; + chbxAutoNodesExpand.Checked := ReportLink.AutoNodesExpand; + + chbxExtendedSelect.Enabled := chbxOnlySelected.Checked; + seExpandLevel.Visible := ReportLink.IsTreeListLink; + lblExpandLevel.Visible := seExpandLevel.Visible; + if seExpandLevel.Visible then + begin + seExpandLevel.Enabled := chbxAutoNodesExpand.Checked and not chbxOnlySelected.Checked; + lblExpandLevel.Enabled := seExpandLevel.Enabled; + end; + + //bvlShowImages.Visible := not ReportLink.IsDBGridLink; + chbxShowStateImages.Enabled := not ReportLink.IsDBGridLink; + chbxShowImages.Enabled := not ReportLink.IsDBGridLink; + + chbxAutoCalcPreviewLines.Enabled := ReportLink.ShowPreview; + sePreviewLineCount.Enabled := ReportLink.ShowPreview and not ReportLink.AutoCalcPreviewLines; + lblPreviewLineCount.Enabled := sePreviewLineCount.Enabled; + + chbxShowNodeGrid.Enabled := chbxShowGrid.Checked; + //chbxShowGroupFooterGrid.Enabled := chbxShowGrid.Checked; + + chbxUseSoft3D.Enabled := chbxUse3DEffects.Checked; + + ccbxColor.Enabled := not chbxTransparent.Checked; + lblColor.Enabled := ccbxColor.Enabled; + ccbxEvenColor.Enabled := not chbxTransparent.Checked and ReportLink.OddEvenMode; + lblEvenColor.Enabled := ccbxEvenColor.Enabled; + ccbxPreviewColor.Enabled := not chbxTransparent.Checked and not ReportLink.OddEvenMode; + lblPreviewColor.Enabled := ccbxPreviewColor.Enabled; + + ccbxBandColor.Enabled := not chbxFixedTransparent.Checked; + lblBandColor.Enabled := ccbxBandColor.Enabled; + ccbxGroupNodeColor.Enabled := not chbxFixedTransparent.Checked; + lblGroupNodeColor.Enabled := ccbxGroupNodeColor.Enabled; + + ccbxHeaderColor.Enabled := not chbxFixedTransparent.Checked; + lblHeaderColor.Enabled := ccbxHeaderColor.Enabled; + ccbxRowFooterColor.Enabled := not chbxFixedTransparent.Checked; + lblRowFooterColor.Enabled := ccbxRowFooterColor.Enabled; + + if ReportLink.Use3DEffects then + dxTLPreview.LookAndFeel := TdxLookAndFeel(ReportLink.UseSoft3D) + else + dxTLPreview.LookAndFeel := lfFlat; + + + dxTLPreview.HandleNeeded; + btnChangeFont.Enabled := IsChangeFontEnabled; + lbxFonts.Perform(LB_SETHORIZONTALEXTENT, GetMaxWidth, 0); +end; + +function TdxTLReportLinkDesignWindow.IsChangeFontEnabled: Boolean; +var + I: Integer; +begin + if ReportLink.OddEvenMode then + Result := lbxFonts.SelCount > 0 + else + begin + Result := True; + for I := 0 to lbxFonts.Items.Count - 1 do + if lbxFonts.Selected[I] and not (I in [2, 3]) then Exit; + Result := False; + end; +end; + +function TdxTLReportLinkDesignWindow.IsDisableIndex(AIndex: Integer): Boolean; +begin + Result := not ReportLink.OddEvenMode and (AIndex in [2, 3]); +end; + +procedure TdxTLReportLinkDesignWindow.DoInitialize; +begin + inherited; + with lbxFonts do + begin + Canvas.Font := Font; + ItemHeight := 1 + lbxFonts.Canvas.TextHeight('Wg') + 2; + Height := 4{border} + GetSystemMetrics(SM_CYHSCROLL) + Items.Count * ItemHeight; + end; + btnChangeFont.Top := lbxFonts.Top + lbxFonts.Height + 6; + + with ReportLink do + begin + chbxShowBands.Checked := ShowBands; + chbxShowHeaders.Checked := ShowHeaders; + chbxShowFooters.Checked := ShowFooters; + chbxShowGroupFooters.Checked := ShowRowFooters; + chbxShowPreview.Checked := ShowPreview; + chbxAutoCalcPreviewLines.Checked := AutoCalcPreviewLines; + TdxPSSpinEdit(sePreviewLineCount).Enabled := ShowPreview and not AutoCalcPreviewLines; + TdxPSSpinEdit(sePreviewLineCount).MinValue := -Byte(AutoCalcPreviewLines); + TdxPSSpinEdit(sePreviewLineCount).Value := PreviewLineCount; + + chbxShowGrid.Checked := ShowGrid; + chbxShowNodeGrid.Checked := ShowPreviewGrid; + //chbxShowGroupFooterGrid.Checked := ShowRowFooterGrid; + + chbxShowImages.Checked := ShowImages; + chbxShowStateImages.Checked := ShowStateImages; + + cbxDrawMode.ItemIndex := Integer(DrawMode); + + if OddEvenMode then + lblColor.Caption := cxGetResourceString(@sdxOddColor); + + chbxTransparent.Checked := Transparent; + chbxFixedTransparent.Checked := FixedTransparent; + + TdxPSColorCombo(ccbxColor).ColorValue := ReportLink.Color; + TdxPSColorCombo(ccbxEvenColor).ColorValue := EvenColor; + TdxPSColorCombo(ccbxPreviewColor).ColorValue := PreviewColor; + TdxPSColorCombo(ccbxBandColor).ColorValue := BandColor; + TdxPSColorCombo(ccbxHeaderColor).ColorValue := HeaderColor; + TdxPSColorCombo(ccbxGridLineColor).ColorValue := GridLineColor; + TdxPSColorCombo(ccbxGroupNodeColor).ColorValue := GroupNodeColor; + TdxPSColorCombo(ccbxRowFooterColor).ColorValue := RowFooterColor; + + TdxPSSpinEdit(seExpandLevel).Enabled := not chbxOnlySelected.Checked; + TdxPSSpinEdit(seExpandLevel).Value := ExpandLevel; + + chbxOnlySelected.Checked := OnlySelected; + chbxExtendedSelect.Checked := ExtendedSelect; + + chbxUse3DEffects.Checked := Use3DEffects; + chbxUseSoft3D.Checked := UseSoft3D; + + chbxTransparentColumnGraphic.Checked := TransparentColumnGraphics; + chbxDisplayGraphicsAsText.Checked := GraphicsAsText; + + chbxFlatCheckMarks.Checked := FlatCheckMarks; + chbxCheckMarksAsText.Checked := CheckMarksAsText; + + chbxShowExpandButtons.Checked := ShowExpandButtons; + chbxShowTreeLines.Checked := ShowTreeLines; + end; + SetupPreview; + UpdatePreview; + + lbxFonts.Invalidate; +end; + +procedure TdxTLReportLinkDesignWindow.ExpandLevelChange(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.ExpandLevel := TdxPSSpinEdit(Sender).AsInteger; + Modified := True; +end; + +procedure TdxTLReportLinkDesignWindow.PreviewLineCountChange(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PreviewLineCount := TdxPSSpinEdit(Sender).AsInteger; + Modified := True; +end; + +procedure TdxTLReportLinkDesignWindow.UpdatePreview; +var + R: TRect; +begin + inherited; + R := dxTLPreview.BoundsRect; + InflateRect(R, 1, 1); + Dec(R.Right); + if ReportLink.Use3DEffects and not ReportLink.UseSoft3D then + Dec(R.Bottom); + + dxTLPreview.BeginUpdate; + try + if ReportLink.FixedTransparent then + begin + dxTLPreview.BandColor := clWindow; + dxTLPreview.HeaderColor := clWindow; + dxTLPreview.RowFooterColor := clWindow; + dxTLPreview.GroupNodeColor := clWindow; + end + else + begin + dxTLPreview.BandColor := ReportLink.BandColor; + dxTLPreview.GroupNodeColor := ReportLink.GroupNodeColor; + dxTLPreview.HeaderColor := ReportLink.HeaderColor; + dxTLPreview.RowFooterColor := ReportLink.RowFooterColor; + end; + + if ReportLink.Transparent then + dxTLPreview.Color := clWindow + else + dxTLPreview.Color := ReportLink.Color; + + dxTLPreview.GridLineColor := ReportLink.GridLineColor; + dxTLPreview.TreeLineColor := ReportLink.TreeLineColor; + + dxTLPreview.BandFont := ReportLink.BandFont; + dxTLPreview.BandFont.Size := 8; + dxTLPreview.HeaderFont := ReportLink.HeaderFont; + dxTLPreview.HeaderFont.Size := 8; + dxTLPreview.Font := ReportLink.Font; + dxTLPreview.Font.Size := 8; + dxTLPreview.PreviewFont := ReportLink.PreviewFont; + dxTLPreview.PreviewFont.Size := 8; + + dxTLPreview.ShowGrid := ReportLink.ShowGrid; + dxTLPreview.ShowPreviewGrid := ReportLink.ShowPreviewGrid; + dxTLPreview.ShowBands := ReportLink.ShowBands; + dxTLPreview.ShowHeader := ReportLink.ShowHeaders; + dxTLPreview.ShowFooter := ReportLink.ShowFooters; + dxTLPreview.ShowRowFooter := ReportLink.ShowRowFooters; + + dxTLPreview.ShowButtons := ReportLink.ShowExpandButtons; + dxTLPreview.ShowLines := ReportLink.ShowTreeLines; + if dxTLPreview.PaintStyle = psOutlook then + begin + if ReportLink.Use3DEffects then + begin + if ReportLink.UseSoft3D then + dxTLPreview.LookAndFeel := lfFlat + else + dxTLPreview.LookAndFeel := lfStandard + end + else + dxTLPreview.LookAndFeel := lfUltraFlat;//ExposeTreeList(ReportLink.CustomTreeList).LookAndFeel; + end; + + + if ReportLink.ShowPreview then + dxTLPreview.Options := dxTLPreview.Options + [aoPreview] + else + dxTLPreview.Options := dxTLPreview.Options - [aoPreview]; + + if tlpoImages in ReportLink.Options then + dxTLPreview.Images := ilTLImages + else + dxTLPreview.Images := nil; + + if tlpoStateImages in ReportLink.Options then + dxTLPreview.StateImages := ilTLImages + else + dxTLPreview.StateImages := nil; + + dxTLPreviewColumn3.Border3D := not ReportLink.FlatCheckMarks; + finally + dxTLPreview.EndUpdate; + end; + FPreviewBox.Invalidate; +end; + +procedure TdxTLReportLinkDesignWindow.SetColorByTag(ATag: Integer; AColor: TColor); +begin + with ReportLink do + case ATag of + 0: Color := AColor; + 1: EvenColor := AColor; + 2: PreviewColor := AColor; + 3: BandColor := AColor; + 4: GroupNodeColor := AColor; + 5: HeaderColor := AColor; + 6: RowFooterColor := AColor; + 7: GridLineColor := AColor; + 8: TreeLineColor := AColor; + end; +end; + +procedure TdxTLReportLinkDesignWindow.ccbxColorChange(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with TdxPSColorCombo(Sender) do + SetColorByTag(Tag, ColorValue); + UpdatePreview; + Modified := True; +end; + +procedure TdxTLReportLinkDesignWindow.FontClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + if ReportLink.OddEvenMode or (lbxFonts.ItemIndex <> 2) then + DoChangeFont(lbxFonts.ItemIndex); +end; + +procedure TdxTLReportLinkDesignWindow.DoChangeFont(AIndex: Integer); +var + I: Integer; +begin + with dxPSGlbl.FontDialog do + begin + Font := GetFontByIndex(AIndex); + if Execute then + begin + for I := 0 to lbxFonts.Items.Count - 1 do + if lbxFonts.Selected[I] then + GetFontByIndex(I).Assign(Font); + + lbxFonts.Refresh; + UpdatePreview; + Modified := True; + end; + end; +end; + +procedure TdxTLReportLinkDesignWindow.btnChangeFontClick(Sender: TObject); +begin + if lbxFonts.SelCount > 0 then DoChangeFont(lbxFonts.ItemIndex); +end; + +procedure TdxTLReportLinkDesignWindow.pmChangeFontPopup(Sender: TObject); +begin + miChangeFont.Enabled := btnChangeFont.Enabled; +end; + +procedure TdxTLReportLinkDesignWindow.chbxTransparentClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + + case TCheckBox(Sender).Tag of + 0: ReportLink.Transparent := TCheckBox(Sender).checked; + 1: ReportLink.FixedTransparent := TCheckBox(Sender).checked; + end; + UpdatePreview; + Modified := True; +end; + +procedure TdxTLReportLinkDesignWindow.stTransparentClick(Sender: TObject); +begin + if chbxTransparent.CanFocus then ActiveControl := chbxTransparent; + chbxTransparent.Checked := not chbxTransparent.Checked; +end; + +procedure TdxTLReportLinkDesignWindow.stFixedTransparentClick(Sender: TObject); +begin + if chbxFixedTransparent.CanFocus then ActiveControl := chbxFixedTransparent; + chbxFixedTransparent.Checked := not chbxFixedTransparent.Checked; +end; + +procedure TdxTLReportLinkDesignWindow.chbxHeadersOnEveryPageClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.HeadersOnEveryPage := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxTLReportLinkDesignWindow.chbxBandsOnEveryPageClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.BandsOnEveryPage := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxTLReportLinkDesignWindow.chbxFootersOnEveryPageClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.FootersOnEveryPage := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxTLReportLinkDesignWindow.chbxAutoNodesExpandClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.AutoNodesExpand := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxTLReportLinkDesignWindow.chbxOnlySelectedClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.OnlySelected := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxTLReportLinkDesignWindow.chbxExtendedSelectClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.ExtendedSelect := TCheckBox(Sender).Checked; + Modified := True; +end; + +procedure TdxTLReportLinkDesignWindow.lblColorClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; + TCustomComboBox(ActiveControl).DroppedDown := True; +end; + +procedure TdxTLReportLinkDesignWindow.lblExpandLevelClick(Sender: TObject); +begin + if TLabel(Sender).FocusControl <> nil then + ActiveControl := TLabel(Sender).FocusControl; +end; + +procedure TdxTLReportLinkDesignWindow.dxTLPreviewGetFooterCellText( + Sender: TObject; ANode: TdxTreeListNode; AColumn, AFooterIndex: Integer; + var AText: string); +begin + if AFooterIndex = -1 then + AText := Format(cxGetResourceString(@sdxCountIs), [6]) + else + AText := Format(cxGetResourceString(@sdxCountIs), [ANode.Parent.Count]); +end; + +procedure TdxTLReportLinkDesignWindow.dxTLPreviewGetPreviewText( + Sender: TObject; ANode: TdxTreeListNode; var AText: string); +begin + AText := GetDesignerString(Integer(ANode.Data)); +end; + +procedure TdxTLReportLinkDesignWindow.dxTLPreviewIsExistFooterCell( + Sender: TObject; AColumn: Integer; var AExist: Boolean); +begin + AExist := AColumn = 0; +end; + +procedure TdxTLReportLinkDesignWindow.dxTLPreviewIsExistRowFooterCell( + Sender: TObject; ANode: TdxTreeListNode; AColumn, AFooterIndex: Integer; + var AExist: Boolean); +begin + AExist := AColumn = 0; +end; + +procedure TdxTLReportLinkDesignWindow.dxTLPreviewIsLevelFooter(Sender: TObject; + ALevel: Integer; var AExist: Boolean); +begin + AExist := True; +end; + +procedure TdxTLReportLinkDesignWindow.FontsMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +const + FLastIndex: Integer = -1; +var + W: Integer; + S: string; + AIndex: Integer; +begin + AIndex := lbxFonts.ItemAtPos(Point(X, Y), True); + if (AIndex = -1) or (AIndex = FLastIndex) then Exit; + lbxFonts.Hint := ''; + Application.CancelHint; + S := GetFontInfoText(AIndex); + W := lbxFonts.Canvas.TextWidth(S); + if W > lbxFonts.Width - lbxFonts.Canvas.TextWidth(lbxFonts.Items[AIndex]) then + begin + lbxFonts.Hint := S; + FLastIndex := AIndex; + end; +end; + +procedure TdxTLReportLinkDesignWindow.FontsKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +var + ItemIndex: Integer; +begin + if (ReportLink.DrawMode <> tldmOddEven) and (Key in [VK_UP, VK_DOWN]) then + begin + ItemIndex := TListBox(Sender).ItemIndex; + case Key of + VK_UP: + if IsDisableIndex(ItemIndex - 1) then + while IsDisableIndex(ItemIndex - 1) do Dec(ItemIndex); + VK_DOWN: + if IsDisableIndex(ItemIndex + 1) then + while IsDisableIndex(ItemIndex + 1) do Inc(ItemIndex); + end; + TListBox(Sender).ItemIndex := ItemIndex; + end; + if (Key = VK_RETURN) and (ssCtrl in Shift) then + btnChangeFont.Click; +end; + +function TdxTLReportLinkDesignWindow.GetFontByIndex(AIndex: Integer): TFont; +begin + Result := nil; + with ReportLink do + case AIndex of + 0: Result := BandFont; + 1: Result := Font; + 2: Result := OddFont; + 3: Result := EvenFont; + 4: Result := GroupNodeFont; + 5: Result := FooterFont; + 6: Result := HeaderFont; + 7: Result := PreviewFont; + 8: Result := RowFooterFont; + end; +end; + +procedure TdxTLReportLinkDesignWindow.lbxFontsDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); + + function GetMaxLength: Integer; + var + I, V: Integer; + begin + Result := 0; + with TListBox(Control) do + for I := 0 to Items.Count - 1 do + begin + V := Canvas.TextWidth(Items[I]); + if V > Result then Result := V; + end; + Inc(Result, 8); + end; + + function GetFontColor(AIndex: Integer): TColor; + begin + if IsDisableIndex(AIndex) then + Result := ColorToRGB(clBtnFace) + else + Result := ColorToRGB(clWindowText);//GetFontByIndex(AIndex).Color; + end; + +const + FirstEntry: Boolean = True; + MaxLength: Integer = 0; +var + R: TRect; + BrushColor, FontColor: TColor; + S: string; +begin + if FirstEntry then + begin + MaxLength := GetMaxLength; + FirstEntry := False; + end; + + with TListBox(Control) do + begin + BrushColor := Canvas.Brush.Color; + if IsDisableIndex(Index) then + Canvas.Brush.Color := ColorToRGB(clWindow); + + with Rect do + R := Classes.Rect(Left, Top, Left + MaxLength, Bottom); + + FontColor := Canvas.Font.Color; + if not (odSelected in State) or IsDisableIndex(Index) then + Canvas.Font.Color := GetFontColor(Index); + + Canvas.TextRect(R, R.Left + 2, R.Top + 2, Items[Index]); + R.Left := R.Right; + Inc(R.Right); + Canvas.Brush.Color := ColorToRGB(clBtnShadow); + Canvas.FrameRect(R); + if IsDisableIndex(Index) then + Canvas.Brush.Color := ColorToRGB(clWindow) + else + Canvas.Brush.Color := BrushColor; + R.Left := R.Right; + R.Right := Rect.Right; + S := GetFontInfoText(Index); + Canvas.TextRect(R, R.Left + 2, R.Top + 2, S); + if not (odSelected in State) or IsDisableIndex(Index) then + Canvas.Font.Color := FontColor; + if (odFocused in State) and IsDisableIndex(Index) then + Canvas.DrawFocusRect(Rect); + Canvas.Brush.Color := BrushColor; + end +end; + +function TdxTLReportLinkDesignWindow.GetFontInfoText(AIndex: Integer): string; +begin + Result := FormatFontInfo(GetFontByIndex(AIndex)); +end; + +function TdxTLReportLinkDesignWindow.GetMaxWidth: Integer; +var + I, L, L2, W, W2: Integer; +begin + with lbxFonts do + begin + W := Canvas.TextWidth(Items[0] + 'X'); + for I := 1 to Items.Count - 1 do + begin + L := Canvas.TextWidth(Items[I] + 'X'); + if L > W then W := L; + end; + + W2 := Canvas.TextWidth(GetFontInfoText(0) + 'X'); + for I := 1 to Items.Count - 1 do + begin + L2 := Canvas.TextWidth(GetFontInfoText(I) + 'X'); + if L2 > W2 then W2 := L2; + end; + end; + Result := W + W2 + 2 + 8 + 3; +end; + +procedure TdxTLReportLinkDesignWindow.lbxFontsClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + UpdateControlsState; +end; + +procedure TdxTLReportLinkDesignWindow.lbxFontsDblClick(Sender: TObject); +begin + if btnChangeFont.Enabled then btnChangeFont.Click; +end; + +function TdxTLReportLinkDesignWindow.GetNodeIndex(ANode: TdxTreeListNode): Integer; +begin + if TdxTreeListAccess(ANode.Owner).PaintStyle = psOutlook then + begin + if ANode.Count > 0 then + Result := -1 + else + Result := ANode.Index + end + else + Result := ANode.AbsoluteIndex; + Inc(Result); +end; + +function TdxTLReportLinkDesignWindow.GetNodeFont(ANode: TdxTreeListNode; + ANodeIndex: Integer): TFont; +var + TreeList: TdxTreeListAccess; +begin + TreeList := TdxTreeListAccess(ANode.Owner); + with ReportLink do + if TreeList.IsRowGroup(ANode) or ((FPaintStyle = psOutLook) and (ANode.Count > 0)) then + Result := GroupNodeFont + else + if (DrawMode = tldmOddEven) and ((TreeList.PaintStyle = psStandard) or (ANode.Count = 0)) then + begin + if Odd(ANodeIndex) then + Result := OddFont + else + Result := EvenFont + end + else + Result := Font; +end; + +function TdxTLReportLinkDesignWindow.GetPreviewFont(ANode: TdxTreeListNode; + ANodeIndex: Integer): TFont; +var + TreeList: TdxTreeListAccess; +begin + TreeList := TdxTreeListAccess(ANode.Owner); + with ReportLink do + if (DrawMode = tldmOddEven) and ((TreeList.PaintStyle = psStandard) or (ANode.Count = 0)) then + begin + if Odd(ANodeIndex) then + Result := OddFont + else + Result := EvenFont + end + else + Result := PreviewFont; +end; + +procedure TdxTLReportLinkDesignWindow.dxTLPreviewCustomDrawPreviewCell( + Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; + ASelected: Boolean; var AText: string; var AColor, ATextColor: TColor; + AFont: TFont; var ADone: Boolean); +var + AIndex: Integer; +begin + with ReportLink do + begin + AIndex := GetNodeIndex(ANode); + if not IsPreviewTransparent(ANode) then AColor := GetPreviewColor(AIndex); + AFont.Assign(GetPreviewFont(ANode, AIndex)); + AFont.Size := 8; + ATextColor := AFont.Color; + end; +end; + +procedure TdxTLReportLinkDesignWindow.dxTLPreviewCustomDrawCell( + Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; + AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean; + var AText: string; var AColor: TColor; AFont: TFont; + var AAlignment: TAlignment; var ADone: Boolean); +var + AIndex: Integer; +begin + AIndex := GetNodeIndex(ANode); + with ReportLink do + begin + if not IsCellTransparent(ANode) then + AColor := GetCellColor(ANode, AColumn.Index, AIndex); + AFont.Assign(GetNodeFont(ANode, AIndex)); + AFont.Size := 8; + end; +end; + +procedure TdxTLReportLinkDesignWindow.dxTLPreviewColumn4CustomDrawCell( + Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; + AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean; + var AText: string; var AColor: TColor; AFont: TFont; + var AAlignment: TAlignment; var ADone: Boolean); + + function GetText: string; + begin + if ANode.Values[AColumn.Index] <> -1 then + Result := ReportLink.GraphicAsTextValue + else + Result := ''; + end; + + procedure DrawImages(AImages: TCustomImageList); + var + Index: Integer; + begin + FillRectColor(ACanvas.Handle, ARect, AColor); + Index := ANode.Values[AColumn.Index]; + if Index <> -1 then + with ARect do + AImages.Draw(ACanvas, Left + (Right - Left - AImages.Width) div 2, Top + 1, Index); + end; + +begin + if ReportLink.GraphicsAsText then + DrawTextRect(ACanvas, ARect, GetText, taCenter, AColor) + else + DrawImages(TdxTreeListImageColumn(AColumn).Images); + ADone := True; +end; + +procedure TdxTLReportLinkDesignWindow.dxTLPreviewColumn3CustomDrawCell( + Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; + AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean; + var AText: string; var AColor: TColor; AFont: TFont; + var AAlignment: TAlignment; var ADone: Boolean); +begin + if ReportLink.CheckMarksAsText then + begin + DrawTextRect(ACanvas, ARect, AText, taCenter, AColor); + ADone := True; + end; +end; + +procedure TdxTLReportLinkDesignWindow.dxTLPreviewCustomDrawColumnHeader( + Sender: TObject; AColumn: TdxTreeListColumn; ACanvas: TCanvas; + ARect: TRect; var AText: string; var AColor: TColor; AFont: TFont; + var AAlignment: TAlignment; var ASorted: TdxTreeListColumnSort; + var ADone: Boolean); +begin + DrawHeaderRect(ACanvas, ARect, AText, AAlignment, ReportLink.MakeLookAndFeel, + ReportLink.GridLineColor, AColor); + ADone := True; +end; + +procedure TdxTLReportLinkDesignWindow.dxTLPreviewCustomDrawBand( + Sender: TObject; ABand: TdxTreeListBand; ACanvas: TCanvas; ARect: TRect; + var AText: string; var AColor: TColor; AFont: TFont; + var AAlignment: TAlignment; var ADone: Boolean); +begin + DrawHeaderRect(ACanvas, ARect, AText, AAlignment, ReportLink.MakeLookAndFeel, + ReportLink.GridLineColor, AColor); + ADone := True; +end; + +procedure TdxTLReportLinkDesignWindow.dxTLPreviewCustomDrawFooter( + Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; + AColumn: TdxTreeListColumn; var AText: string; var AColor: TColor; + AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean); + + function GetInteriorColor: TColor; + begin + with ReportLink do + if FixedTransparent then + Result := clWindow + else + Result := HeaderColor; + end; + + function GetBorderColor: TColor; + begin + with ReportLink do + if ShowGrid and ShowRowFooterGrid and not Use3DEffects then + Result := GridLineColor + else + Result := GetInteriorColor; + end; + + procedure DrawFooterFrame(ACanvas: TCanvas); + var + DrawInfo: TdxGridDrawInfo; + begin + TdxTreeList(Sender).CalcDrawInfo(DrawInfo); + try + Inc(DrawInfo.FooterRect.Top); + FillRectColor(ACanvas.Handle, DrawInfo.FooterRect, AColor); + finally + TdxTreeList(Sender).FreeDrawInfo(DrawInfo); + end; + end; + +begin + AFont.Assign(ReportLink.FooterFont); + AFont.Size := 8; + + if not ReportLink.Use3DEffects and (AColumn.Index = 0) then + DrawFooterFrame(ACanvas); + + InflateRect(ARect, 1, 1); + DrawFooterRect(ACanvas, ARect, AText, AAlignment, ReportLink.MakeLookAndFeel, + GetBorderColor, GetInteriorColor); + + ADone := True; +end; + +procedure TdxTLReportLinkDesignWindow.dxTLPreviewCustomDrawFooterNode( + Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; + AColumn: TdxTreeListColumn; AFooterIndex: Integer; var AText: string; + var AColor: TColor; AFont: TFont; var AAlignment: TAlignment; + var ADone: Boolean); + + function GetInteriorColor: TColor; + begin + with ReportLink do + if FixedTransparent then + Result := clWindow + else + Result := RowFooterColor; + end; + + function GetBorderColor: TColor; + begin + with ReportLink do + if ShowGrid and ShowRowFooterGrid and not Use3DEffects then + Result := GridLineColor + else + Result := GetInteriorColor; + end; + +begin + AFont.Assign(ReportLink.RowFooterFont); + AFont.Size := 8; + + InflateRect(ARect, 1, 1); + DrawFooterRect(ACanvas, ARect, AText, AAlignment, ReportLink.MakeLookAndFeel, + GetBorderColor, GetInteriorColor); + + ADone := True; +end; + +procedure TdxTLReportLinkDesignWindow.dxTLPreviewGetPreviewLineCount( + Sender: TObject; ANode: TdxTreeListNode; var LCount: Integer); +begin + if ReportLink <> nil then + if ReportLink.IsDBGridLink and (ANode.Count > 0) then + LCount := 0; +end; + +procedure TdxTLReportLinkDesignWindow.chbxShowClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + with ReportLink do + if TCheckBox(Sender).Checked then + Options := Options + [TdxTreeListPaintOption(TCheckBox(Sender).Tag)] + else + Options := Options - [TdxTreeListPaintOption(TCheckBox(Sender).Tag)]; + Modified := True; + UpdatePreview; +end; + +procedure TdxTLReportLinkDesignWindow.chbxAutoCalcPreviewLinesClick(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.PreviewLineCount := -Byte(TCheckBox(Sender).Checked); + TdxPSSpinEdit(sePreviewLineCount).MinValue := -Byte(ReportLink.AutoCalcPreviewLines); + TdxPSSpinEdit(sePreviewLineCount).Value := -Byte(ReportLink.AutoCalcPreviewLines); + Modified := True; +end; + +procedure TdxTLReportLinkDesignWindow.cbxDrawModeChange(Sender: TObject); +begin + if LockControlsUpdate then Exit; + ReportLink.DrawMode := TdxTreeListDrawMode(TComboBox(Sender).ItemIndex); + Modified := True; + UpdatePreview; +end; + +procedure TdxTLReportLinkDesignWindow.lblDrawModeClick(Sender: TObject); +begin + if TLabel(Sender).FocusControl <> nil then + begin + ActiveControl := TLabel(Sender).FocusControl; + if ActiveControl is TComboBox then + TComboBox(ActiveControl).DroppedDown := True; + end; +end; + +procedure TdxTLReportLinkDesignWindow.PageControl1Change(Sender: TObject); +begin + lblPreviewWindow.Parent := TPageControl(Sender).ActivePage; +end; + +procedure TdxTLReportLinkDesignWindow.cbxDrawModeDrawItem( + Control: TWinControl; Index: Integer; Rect: TRect; + State: TOwnerDrawState); +const + ImageIndexMap: array[TdxTreeListDrawMode] of Integer = (0, 1, 3); +begin + with TComboBox(Control) do + dxPSUtl.dxDrawComboBoxItem(Canvas, Rect, Items[Index], dxPSUtl.dxPSDrawModeImages, + ImageIndexMap[TdxTreeListDrawMode(Items.Objects[Index])], State); +end; + +procedure RegisterHelpers; +begin + TdxTreeListColumnHelper.Register; + TdxTreeListImageColumnHelper.Register; +end; + +procedure UnregisterHelpers; +begin + TdxColumnHelpersFactory.ReleaseInstance; +end; + +initialization + if not Assigned(FdxTreeListAssignDataProc) then + FdxTreeListAssignDataProc := DefaultdxTreeListAssignDataProc; + if not Assigned(FdxTreeListColumnMapperProc) then + FdxTreeListColumnMapperProc := DefaultdxTreeListMapperProc; + + RegisterHelpers; + dxPSCore.dxPSRegisterReportLink(TdxTreeListReportLink, TdxTreeList, TdxTLReportLinkDesignWindow); + FPicture := TPicture.Create; + +finalization + FreeAndNil(FPicture); + dxPSCore.dxPSUnregisterReportLink(TdxTreeListReportLink, TdxTreeList, TdxTLReportLinkDesignWindow); + UnregisterHelpers; + + @FdxTreeListAssignDataProc := nil; + @FdxTreeListColumnMapperProc := nil; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSdxTLLnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSdxTLLnkReg.pas new file mode 100644 index 00000000..2dbd1e1f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSdxTLLnkReg.pas @@ -0,0 +1,87 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSdxTLLnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignEditors, + {$ELSE} + DsgnIntf, + {$ENDIF} + Classes, dxPSdxTLLnk; + +type + TdxTreeListOptionsPropertyEditor = class(TSetProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + +function TdxTreeListOptionsPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog]; +end; + +procedure TdxTreeListOptionsPropertyEditor.Edit; +var + I: Integer; +begin + inherited; + if TCustomdxTreeListReportLink(GetComponent(0)).DesignReport then + begin + Designer.Modified; + if PropCount > 1 then + for I := 1 to PropCount - 1 do + GetComponent(I).Assign(GetComponent(0)); + end; +end; + +procedure Register; +begin + RegisterNoIcon([TdxTreeListReportLink]); + RegisterPropertyEditor(TypeInfo(TdxTreeListPaintOptions), TdxTreeListReportLink, 'Options', TdxTreeListOptionsPropertyEditor); +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSfmAutoHFTextFmt.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSfmAutoHFTextFmt.dfm new file mode 100644 index 00000000..3e65a5ec --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSfmAutoHFTextFmt.dfm @@ -0,0 +1,128 @@ +object dxfmAutoText: TdxfmAutoText + Left = 467 + Top = 306 + BorderStyle = bsDialog + Caption = 'AutoText' + ClientHeight = 358 + ClientWidth = 394 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object gbxEnterAutoTextEntriesHere: TGroupBox + Left = 4 + Top = 4 + Width = 387 + Height = 317 + Caption = ' Enter A&utoText Entries Here: ' + TabOrder = 0 + object lblPreview: TLabel + Left = 9 + Top = 215 + Width = 38 + Height = 13 + Caption = 'Preview' + end + object ToolBar: TToolBar + Left = 9 + Top = 176 + Width = 275 + Height = 30 + Align = alNone + ButtonHeight = 24 + ButtonWidth = 25 + EdgeBorders = [ebLeft, ebTop, ebRight, ebBottom] + EdgeInner = esLowered + ParentShowHint = False + ShowHint = True + TabOrder = 3 + end + object btnAdd: TButton + Left = 289 + Top = 20 + Width = 90 + Height = 23 + Caption = '&Add' + Default = True + TabOrder = 1 + OnClick = btnAddClick + end + object btnDelete: TButton + Left = 289 + Top = 47 + Width = 90 + Height = 23 + Caption = '&Delete' + TabOrder = 2 + OnClick = btnDeleteClick + end + object cbxAutoEntries: TComboBox + Left = 9 + Top = 20 + Width = 274 + Height = 154 + Style = csSimple + ItemHeight = 13 + Sorted = True + TabOrder = 0 + OnChange = NewAutoTextChange + OnClick = AutoEntriesClick + OnEnter = cbxAutoEntriesEnter + OnExit = cbxAutoEntriesExit + OnKeyDown = NewAutoTextKeyDown + end + object Panel1: TPanel + Left = 9 + Top = 231 + Width = 370 + Height = 76 + BevelOuter = bvNone + Color = clWindow + TabOrder = 4 + object pbxPreview: TPaintBox + Left = 0 + Top = 0 + Width = 370 + Height = 76 + Align = alClient + Color = clBtnFace + ParentColor = False + OnPaint = pbxPreviewPaint + end + end + end + object btnOK: TButton + Left = 146 + Top = 329 + Width = 79 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 229 + Top = 329 + Width = 79 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object btnHelp: TButton + Left = 312 + Top = 329 + Width = 79 + Height = 23 + Caption = '&Help' + TabOrder = 3 + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSfmAutoHFTextFmt.pas b/official/x.35/ExpressPrinting System/Sources/dxPSfmAutoHFTextFmt.pas new file mode 100644 index 00000000..4598242a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSfmAutoHFTextFmt.pas @@ -0,0 +1,335 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSfmAutoHFTextFmt; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + ExtCtrls, StdCtrls, ComCtrls, ToolWin, dxPSForm; + +type + TdxfmAutoText = class(TCustomdxPSForm) + gbxEnterAutoTextEntriesHere: TGroupBox; + btnOK: TButton; + btnCancel: TButton; + btnHelp: TButton; + ToolBar: TToolBar; + lblPreview: TLabel; + btnAdd: TButton; + btnDelete: TButton; + cbxAutoEntries: TComboBox; + Panel1: TPanel; + pbxPreview: TPaintBox; + procedure pbxPreviewPaint(Sender: TObject); + procedure AutoEntriesClick(Sender: TObject); + procedure NewAutoTextChange(Sender: TObject); + procedure NewAutoTextKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure btnAddClick(Sender: TObject); + procedure btnDeleteClick(Sender: TObject); + procedure cbxAutoEntriesExit(Sender: TObject); + procedure cbxAutoEntriesEnter(Sender: TObject); + private + FHFFunctionList: TStringList; + FilToolBar: TImageList; + function GetEntries: TStrings; + procedure SetEntries(Value: TStrings); + + procedure EnableToolbar(Value: Boolean); + procedure LoadStrings; + procedure ToolButtonClick(Sender: TObject); + procedure UpdateControlsState; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function Execute: Boolean; + property Entries: TStrings read GetEntries write SetEntries; + end; + +function dxShowAutoTextDlg(AStrings: TStrings): Boolean; + +implementation + +{$R *.DFM} + +uses + {$IFDEF DELPHI7} UxTheme, Themes, {$ENDIF} Registry, cxClasses, dxPSCore, + dxPSRes, dxPSUtl, dxPsGlbl, dxPgSDlg, dxPSESys, dxPSEvnt, dxPSHFToolBarBld; + +function dxShowAutoTextDlg(AStrings: TStrings): Boolean; +var + Dialog: TdxfmAutoText; +begin + Result := False; + if AStrings = nil then Exit; + + Dialog := TdxfmAutoText.Create(nil); + with Dialog do + try + Entries := AStrings; + Result := Execute; + if Result then + AStrings.Assign(Entries); + finally + Free; + end; +end; + +{ TdxfmAutoText } + +constructor TdxfmAutoText.Create(AOwner: TComponent); +begin + HelpContext := dxhcAutoHFTextEntriesDlg; + inherited; + btnHelp.Visible := HelpContext <> 0; + if not btnHelp.Visible then + begin + btnOK.BoundsRect := btnCancel.BoundsRect; + btnCancel.BoundsRect := btnHelp.BoundsRect; + end; + + FHFFunctionList := TStringList.Create; + dxGetHFFunctionsList(FHFFunctionList); + + FilToolBar := TImageList.Create(Self); + FilToolBar.AllocBy := FHFFunctionList.Count; + TdxPSHFToolBarBuilder.Build(ToolBar, FilToolBar, False, FHFFunctionList, nil, ToolButtonClick, nil, False); + ToolBar.Top := ((cbxAutoEntries.Top + cbxAutoEntries.Height) + + lblPreview.Top - ToolBar.Height) div 2; + ToolBar.Left := cbxAutoEntries.Left; + LoadStrings; +end; + +destructor TdxfmAutoText.Destroy; +begin + FreeAndNil(FHFFunctionList); + inherited; +end; + +function TdxfmAutoText.Execute: Boolean; +begin + UpdateControlsState; + Result := ShowModal = mrOK; +end; + +procedure TdxfmAutoText.pbxPreviewPaint(Sender: TObject); + + procedure PaintPart(ACanvas: TCanvas; const S: string; var ARect: TRect; AFormat: UINT); + begin + DrawText(ACanvas.Handle, PChar(S), Length(S), ARect, + DT_TOP or DT_NOPREFIX or AFormat); + end; + + function GetBorderColor: TColor; + {$IFDEF DELPHI7} + var + Theme: HTHEME; + C: COLORREF; + {$ENDIF} + begin + {$IFDEF DELPHI7} + if ThemeServices.ThemesEnabled then + begin + Theme := ThemeServices.Theme[teEdit]; + if Failed(UxTheme.GetThemeColor(Theme, 0, 0, TMT_BORDERCOLOR, C)) then + Result := clWindowText + else + Result := C; + end + else + Result := C; + {$ELSE} + Result := clWindowText; + {$ENDIF} + end; + +var + R, R2: TRect; + S, Part1, Part2, Part3: string; + Index: Integer; +begin + with TPaintBox(Sender) do + begin + R := ClientRect; + Canvas.Brush.Color := GetBorderColor; + Canvas.FrameRect(R); + + InflateRect(R, -1, -1); + Canvas.Brush.Color := clWindow; + Canvas.FillRect(R); + + Canvas.Brush.Style := bsClear; + Index := cbxAutoEntries.ItemIndex; + if Index > -1 then + begin + InflateRect(R, -2, -2); + + S := cbxAutoEntries.Items[Index]; + dxPgsDlg.dxPSSplitAutoHFTextEntry(S, Part1, Part2, Part3); + R2 := R; + if Part1 <> '' then + PaintPart(Canvas, dxProcessHFString(Part1), R2, DT_LEFT); + Inc(R2.Left, (R.Right - R.Left) div 3); + Dec(R2.Right, (R.Right - R.Left) div 3); + if Part2 <> '' then + PaintPart(Canvas, dxProcessHFString(Part2), R2, DT_CENTER); + OffsetRect(R2, (R.Right - R.Left) div 3, 0); + if Part3 <> '' then + PaintPart(Canvas, dxProcessHFString(Part3), R2, DT_RIGHT); + end; + end; +end; + +procedure TdxfmAutoText.AutoEntriesClick(Sender: TObject); +begin + UpdateControlState; + pbxPreview.Invalidate; +end; + +procedure TdxfmAutoText.NewAutoTextChange(Sender: TObject); +var + Index: Integer; +begin + UpdateControlsState; + Index := cbxAutoEntries.Items.IndexOf(cbxAutoEntries.Text); + if Index <> -1 then + cbxAutoEntries.ItemIndex := Index; +end; + +procedure TdxfmAutoText.NewAutoTextKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + case Key of + VK_RETURN: + begin + btnAdd.Click; + Key := 0; + end; + VK_ESCAPE: + ModalResult := mrCancel; + end; +end; + +procedure TdxfmAutoText.btnAddClick(Sender: TObject); +begin + with cbxAutoEntries do + Items.Add(Text); + cbxAutoEntries.Text := ''; + UpdateControlsState; + ActiveControl := cbxAutoEntries; +end; + +procedure TdxfmAutoText.btnDeleteClick(Sender: TObject); +var + Index: Integer; +begin + with cbxAutoEntries do + begin + Index := ItemIndex; + if Index > -1 then + begin + Items.Delete(Index); + if Index > Items.Count - 1 then + Index := Items.Count - 1; + if Index > -1 then + ItemIndex := Index; + UpdateControlsState; + end; + end; +end; + +procedure TdxfmAutoText.cbxAutoEntriesEnter(Sender: TObject); +begin + EnableToolbar(True); +end; + +procedure TdxfmAutoText.cbxAutoEntriesExit(Sender: TObject); +begin + EnableToolbar(False); +end; + +procedure TdxfmAutoText.ToolButtonClick(Sender: TObject); +begin + if ActiveControl = cbxAutoEntries then + cbxAutoEntries.SelText := FHFFunctionList[TTagToInt(TComponent(Sender).Tag)]; +end; + +function TdxfmAutoText.GetEntries: TStrings; +begin + Result := cbxAutoEntries.Items; +end; + +procedure TdxfmAutoText.SetEntries(Value: TStrings); +begin + cbxAutoEntries.Items := Value; +end; + +procedure TdxfmAutoText.EnableToolbar(Value: Boolean); +var + I: Integer; +begin + for I := 0 to ToolBar.ButtonCount - 1 do + ToolBar.Buttons[I].Enabled := Value; + ToolBar.Enabled := Value; +end; + +procedure TdxfmAutoText.LoadStrings; +begin + Caption := cxGetResourceString(@sdxAutoTextDialogCaption); + btnOK.Caption := cxGetResourceString(@sdxBtnOK); + btnCancel.Caption := cxGetResourceString(@sdxBtnCancel); + btnHelp.Caption := cxGetResourceString(@sdxBtnHelp); + btnAdd.Caption := cxGetResourceString(@sdxBtnAdd); + btnDelete.Caption := cxGetResourceString(@sdxBtnDelete); + gbxEnterAutoTextEntriesHere.Caption := cxGetResourceString(@sdxEnterAutoTextEntriesHere); + lblPreview.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); +end; + +procedure TdxfmAutoText.UpdateControlsState; +var + S: string; + Index: Integer; +begin + S := cbxAutoEntries.Text; + Index := cbxAutoEntries.Items.IndexOf(S); + btnAdd.Enabled := (S <> '') and (Index = -1); + btnDelete.Enabled := Index > -1; +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSfmCompositionAdd.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSfmCompositionAdd.dfm new file mode 100644 index 00000000..6d8daf64 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSfmCompositionAdd.dfm @@ -0,0 +1,110 @@ +object dxfmCompositionAddItems: TdxfmCompositionAddItems + Left = 426 + Top = 382 + ActiveControl = lvItems + BorderStyle = bsDialog + Caption = 'Add Items to Composition' + ClientHeight = 381 + ClientWidth = 329 + Color = clBtnFace + Constraints.MinHeight = 250 + Constraints.MinWidth = 337 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object btnOK: TButton + Left = 87 + Top = 352 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 168 + Top = 352 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object btnHelp: TButton + Left = 249 + Top = 352 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = '&Help' + TabOrder = 3 + end + object pgctrlItems: TPageControl + Left = 5 + Top = 7 + Width = 319 + Height = 339 + ActivePage = tshItems + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + TabStop = False + object tshItems: TTabSheet + Caption = 'Available Items' + object lvItems: TListView + Left = 0 + Top = 0 + Width = 311 + Height = 280 + Align = alTop + Anchors = [akLeft, akTop, akRight, akBottom] + Columns = <> + ColumnClick = False + MultiSelect = True + ReadOnly = True + TabOrder = 0 + OnDblClick = lvItemsDblClick + end + object pnlNoItems: TPanel + Tag = 20 + Left = 19 + Top = 33 + Width = 277 + Height = 22 + BevelOuter = bvNone + Caption = 'There are no Items do Display' + Color = clWindow + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnShadow + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + TabOrder = 1 + end + object chbxHideIncludedItems: TCheckBox + Left = 2 + Top = 287 + Width = 303 + Height = 17 + Anchors = [akLeft, akRight, akBottom] + Caption = 'Hide Already Included Items' + Checked = True + State = cbChecked + TabOrder = 2 + OnClick = chbxHideIncludedItemsClick + end + end + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSfmCompositionAdd.pas b/official/x.35/ExpressPrinting System/Sources/dxPSfmCompositionAdd.pas new file mode 100644 index 00000000..f26057c5 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSfmCompositionAdd.pas @@ -0,0 +1,398 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSfmCompositionAdd; + +interface + +{$I cxVer.inc} + +uses + Windows, Classes, Messages, Controls, Forms, StdCtrls, ExtCtrls, ComCtrls, + dxPSForm, dxPSCore; + +type + TdxCompositionAddItemsDlgOption = (caiShowDescription); + TdxCompositionAddItemsDlgOptions = set of TdxCompositionAddItemsDlgOption; + + TdxfmCompositionAddItems = class(TCustomdxPSForm) + btnOK: TButton; + btnCancel: TButton; + btnHelp: TButton; + pgctrlItems: TPageControl; + tshItems: TTabSheet; + lvItems: TListView; + pnlNoItems: TPanel; + chbxHideIncludedItems: TCheckBox; + procedure chbxHideIncludedItemsClick(Sender: TObject); + procedure lvItemsDblClick(Sender: TObject); + procedure FormResize(Sender: TObject); + private + FComposition: TdxCompositionReportLink; + FOptions: TdxCompositionAddItemsDlgOptions; + FNoItemsState: Boolean; + FSavedHideIncludedItems: Boolean; + + function GetActiveItem: TBasedxReportLink; + function GetItem(Index: Integer): TBasedxReportLink; + function GetItemCount: Integer; + function GetSelected(Index: Integer): Boolean; + function GetSelectedCount: Integer; + procedure SetSelected(Index: Integer; Value: Boolean); + + procedure GetSelection(AList: TList); + procedure Initialize; + procedure LoadStrings; + procedure RefreshColumns; + procedure RefreshList; + procedure UpdateNoItems; + + procedure CMDialogChar(var Msg: TCMDialogChar); message CM_DIALOGCHAR; + protected + procedure BeforeConstruction; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function Execute: Boolean; + procedure LoadFromRegistry(const APath: string); override; + procedure SaveToRegistry(const APath: string); override; + + property ActiveItem: TBasedxReportLink read GetActiveItem; + property Composition: TdxCompositionReportLink read FComposition write FComposition; + property ItemCount: Integer read GetItemCount; + property Items[Index: Integer]: TBasedxReportLink read GetItem; + property Selected[Index: Integer]: Boolean read GetSelected write SetSelected; + property SelectedCount: Integer read GetSelectedCount; + end; + + PdxAddItemsToCompositionDlgData = ^TdxAddItemsToCompositionDlgData; + TdxAddItemsToCompositionDlgData = record + Composition: TdxCompositionReportLink; + Items: TList; + Options: TdxCompositionAddItemsDlgOptions; + end; + +function dxShowAddItemsToCompositionDlg(var AData: TdxAddItemsToCompositionDlgData): Boolean; + +implementation + +{$R *.DFM} + +uses + Graphics, Registry, cxClasses, dxPSGlbl, dxPSUtl, dxPSRes, dxPSPopupMan; + +const + sdxHideIncludedItems = 'HideIncludedItems'; // Don't Localize + +function dxShowAddItemsToCompositionDlg(var AData: TdxAddItemsToCompositionDlgData): Boolean; +var + Dialog: TdxfmCompositionAddItems; +begin + Result := False; + if (AData.Composition = nil) or (AData.Items = nil) then Exit; + + Dialog := TdxfmCompositionAddItems.Create(nil); + try + Dialog.Composition := AData.Composition; + Dialog.FOptions := AData.Options; + Result := Dialog.Execute; + if Result then + Dialog.GetSelection(AData.Items); + finally + Dialog.Free; + end; +end; + +{ TdxfmCompositionAddItems } + +procedure TdxfmCompositionAddItems.chbxHideIncludedItemsClick(Sender: TObject); +begin + RefreshList; +end; + +procedure TdxfmCompositionAddItems.lvItemsDblClick(Sender: TObject); +begin + if SelectedCount = 1 then ModalResult := mrOK; +end; + +procedure TdxfmCompositionAddItems.FormResize(Sender: TObject); +begin + UpdateNoItems; +end; + +constructor TdxfmCompositionAddItems.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + HelpContext := dxPSGlbl.dxhcAddItemsToCompositionDlg; + RefreshColumns; + dxPSPopupMenuController.RegisterControl(lvItems); +end; + +destructor TdxfmCompositionAddItems.Destroy; +begin + dxPSPopupMenuController.UnregisterControl(lvItems); + inherited Destroy; +end; + +function TdxfmCompositionAddItems.Execute: Boolean; +begin + Initialize; + Result := (ShowModal = mrOk) and (SelectedCount <> 0); +end; + +procedure TdxfmCompositionAddItems.LoadFromRegistry(const APath: string); +begin + inherited LoadFromRegistry(APath); + dxLoadListViewColumnsFromRegistry(lvItems, APath); + with TRegistry.Create do + try + if OpenKey(APath, False) then + try + if ValueExists(sdxHideIncludedItems) then + FSavedHideIncludedItems := ReadBool(sdxHideIncludedItems); + except + on ERegistryException do + { ignore } + else + raise; + end; + finally + Free; + end; +end; + +procedure TdxfmCompositionAddItems.SaveToRegistry(const APath: string); +begin + inherited SaveToRegistry(APath); + dxSaveListViewColumnsToRegistry(lvItems, APath); + with TRegistry.Create do + try + if OpenKey(APath, True) then + try + WriteBool(sdxHideIncludedItems, chbxHideIncludedItems.Checked); + except + on ERegistryException do + { ignore } + else + raise; + end; + finally + Free; + end; +end; + +procedure TdxfmCompositionAddItems.BeforeConstruction; +begin + inherited BeforeConstruction; + Options := Options + [foSizeableDialog]; +end; + +function TdxfmCompositionAddItems.GetActiveItem: TBasedxReportLink; +begin + if SelectedCount = 1 then + Result := TBasedxReportLink(lvItems.Selected.Data) + else + Result := nil; +end; + +function TdxfmCompositionAddItems.GetItem(Index: Integer): TBasedxReportLink; +begin + Result := TBasedxReportLink(lvItems.Items[Index].Data); +end; + +function TdxfmCompositionAddItems.GetItemCount: Integer; +begin + Result := lvItems.Items.Count; +end; + +function TdxfmCompositionAddItems.GetSelected(Index: Integer): Boolean; +begin + Result := lvItems.Items[Index].Selected; +end; + +function TdxfmCompositionAddItems.GetSelectedCount: Integer; +begin + Result := lvItems.SelCount; +end; + +procedure TdxfmCompositionAddItems.SetSelected(Index: Integer; Value: Boolean); +begin + lvItems.Items[Index].Selected := Value; +end; + +procedure TdxfmCompositionAddItems.GetSelection(AList: TList); +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + if Selected[I] then AList.Add(Items[I]); +end; + +procedure TdxfmCompositionAddItems.Initialize; +begin + btnHelp.Visible := HelpContext <> 0; + if not btnHelp.Visible then + begin + btnOK.BoundsRect := btnCancel.BoundsRect; + btnCancel.BoundsRect := btnHelp.BoundsRect; + end + else + BorderIcons := BorderIcons + [biHelp]; + + pnlNoItems.Parent := lvItems; + chbxHideIncludedItems.Checked := FSavedHideIncludedItems; + LoadStrings; + RefreshColumns; + RefreshList; + + FormResize(nil); +end; + +procedure TdxfmCompositionAddItems.LoadStrings; +begin + Caption := cxGetResourceString(@sdxAddItemsToComposition); + btnOK.Caption := cxGetResourceString(@sdxBtnOK); + btnCancel.Caption := cxGetResourceString(@sdxBtnCancel); + btnHelp.Caption := cxGetResourceString(@sdxBtnHelp); + tshItems.Caption := cxGetResourceString(@sdxAvailableItems); + pnlNoItems.Caption := cxGetResourceString(@sdxThereAreNowItemsForShow); + chbxHideIncludedItems.Caption := cxGetResourceString(@sdxHideAlreadyIncludedItems); +end; + +procedure TdxfmCompositionAddItems.RefreshColumns; +var + ColumnWidths: array of Integer; + I: Integer; +begin + lvItems.Columns.BeginUpdate; + try + SetLength(ColumnWidths, lvItems.Columns.Count); + for I := 0 to lvItems.Columns.Count - 1 do + ColumnWidths[I] := lvItems.Columns[I].Width; + + lvItems.Columns.Clear; + with lvItems.Columns.Add do + begin + Width := 2 * (lvItems.Width - GetSystemMetrics(SM_CXHSCROLL) - 2) div 3; + Caption := cxGetResourceString(@sdxItemName); + end; + + if caiShowDescription in FOptions then + with lvItems.Columns.Add do + begin + Width := (lvItems.Width - GetSystemMetrics(SM_CXHSCROLL) - 2) div 3; + Caption := cxGetResourceString(@sdxItemDescription); + end; + + for I := 0 to Min(lvItems.Columns.Count - 1, Length(ColumnWidths) - 1) do + lvItems.Columns[I].Width := ColumnWidths[I]; + finally + lvItems.Columns.EndUpdate; + end; +end; + +procedure TdxfmCompositionAddItems.RefreshList; +const + Styles: array[Boolean] of TViewStyle = (vsReport, vsList); +var + Selection: TList; + Strings: TStrings; + I, J: Integer; +begin + Selection := TList.Create; + try + GetSelection(Selection); + lvItems.Items.BeginUpdate; + try + Strings := TStringList.Create; + try + lvItems.Items.Clear; + if (Composition <> nil) and (Composition.ComponentPrinter <> nil) then + Composition.ComponentPrinter.GetItems(Composition, Strings, chbxHideIncludedItems.Checked); + for I := 0 to Strings.Count - 1 do + with lvItems.Items.Add do + begin + Caption := Strings[I]; + Data := Strings.Objects[I]; + SubItems.Add(TBasedxReportLink(Data).Description); + end; + + for I := 0 to Selection.Count - 1 do + for J := 0 to lvItems.Items.Count - 1 do + if lvItems.Items[J].Data = Selection[I] then + begin + lvItems.Items[J].Selected := True; + Break; + end; + finally + Strings.Free; + end; + + FNoItemsState := lvItems.Items.Count = 0; + lvItems.ViewStyle := Styles[FNoItemsState]; + lvItems.Enabled := not FNoItemsState; + lvItems.HideSelection := FNoItemsState; + if (lvItems.SelCount = 0) and (lvItems.Items.Count <> 0) then + lvItems.Selected := lvItems.Items[0]; + finally + lvItems.Items.EndUpdate; + end; + finally + Selection.Free; + end; + UpdateNoItems; +end; + +procedure TdxfmCompositionAddItems.UpdateNoItems; +begin + with pnlNoItems do + begin + SetBounds(3, Height, lvItems.ClientWidth - 2 * 3, Height); + Visible := FNoItemsState; + end; +end; + +procedure TdxfmCompositionAddItems.CMDialogChar(var Msg: TCMDialogChar); +begin + inherited; + if IsAccel(Msg.CharCode, tshItems.Caption) then + begin + Msg.Result := 1; + if lvItems.CanFocus then + ActiveControl := lvItems; + end; +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSfmCompositionDsg.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSfmCompositionDsg.dfm new file mode 100644 index 00000000..07921c6d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSfmCompositionDsg.dfm @@ -0,0 +1,614 @@ +object dxfmCompositionDesignWindow: TdxfmCompositionDesignWindow + Left = 380 + Top = 267 + ActiveControl = lvItems + BorderStyle = bsDialog + Caption = 'Composition Designer' + ClientHeight = 279 + ClientWidth = 454 + Color = clBtnFace + Constraints.MinHeight = 278 + Constraints.MinWidth = 462 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + KeyPreview = True + OldCreateOrder = True + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + OnKeyDown = FormKeyDown + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object btnClose: TButton + Left = 271 + Top = 251 + Width = 86 + Height = 23 + Caption = 'Close' + ModalResult = 1 + TabOrder = 1 + end + object pcItems: TPageControl + Left = 5 + Top = 7 + Width = 444 + Height = 237 + ActivePage = tbsItems + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + TabStop = False + object tbsItems: TTabSheet + Caption = 'Items' + OnResize = tbsItemsResize + object lvItems: TListView + Left = 0 + Top = 0 + Width = 347 + Height = 209 + Align = alLeft + Anchors = [akLeft, akTop, akRight, akBottom] + Columns = <> + ColumnClick = False + DragMode = dmAutomatic + MultiSelect = True + RowSelect = True + PopupMenu = pmItems + TabOrder = 0 + ViewStyle = vsReport + OnChange = lvItemsChange + OnDblClick = DesignerClick + OnEdited = lvItemsEdited + OnEditing = lvItemsEditing + OnDragDrop = lvItemsDragDrop + OnDragOver = lvItemsDragOver + OnStartDrag = lvItemsStartDrag + end + object btnMoveDown: TButton + Left = 353 + Top = 134 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Move Down' + TabOrder = 5 + OnClick = MoveDownClick + end + object btnMoveUp: TButton + Left = 353 + Top = 106 + Width = 79 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Move Up' + TabOrder = 4 + OnClick = MoveUpClick + end + object btnDesign: TButton + Left = 353 + Top = 69 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Desi&gn...' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 3 + OnClick = DesignerClick + end + object btnDelete: TButton + Left = 353 + Top = 32 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Delete...' + TabOrder = 2 + OnClick = DeleteClick + end + object btnAdd: TButton + Left = 353 + Top = 5 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Add...' + TabOrder = 1 + OnClick = AddClick + end + object pnlNoItems: TPanel + Left = 60 + Top = 99 + Width = 248 + Height = 23 + BevelOuter = bvNone + Caption = 'There are no Items to dispay' + Color = clWindow + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnShadow + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + TabOrder = 6 + end + end + end + object btnHelp: TButton + Left = 363 + Top = 251 + Width = 86 + Height = 23 + Caption = '&Help' + TabOrder = 2 + end + object pmItems: TPopupMenu + Images = ilItems + OnPopup = pmItemsPopup + Left = 4 + Top = 248 + object miAdd: TMenuItem + Caption = '&Add...' + ImageIndex = 1 + ShortCut = 45 + OnClick = AddClick + end + object miDelete: TMenuItem + Caption = '&Delete' + ImageIndex = 2 + ShortCut = 46 + OnClick = DeleteClick + end + object N1: TMenuItem + Caption = '-' + end + object miRename: TMenuItem + Caption = 'Rena&me' + ShortCut = 113 + OnClick = RenameClick + end + object miSelectAll: TMenuItem + Caption = 'Select All' + ShortCut = 16449 + OnClick = SelectAllClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miDesign: TMenuItem + Caption = 'Desi&gn...' + Default = True + ImageIndex = 0 + ShortCut = 16397 + OnClick = DesignerClick + end + object miLine1: TMenuItem + Caption = '-' + end + object miMoveUp: TMenuItem + Caption = 'Move &Up' + ImageIndex = 3 + ShortCut = 16422 + OnClick = MoveUpClick + end + object miMoveDown: TMenuItem + Caption = 'Move &Down' + ImageIndex = 4 + ShortCut = 16424 + OnClick = MoveDownClick + end + end + object ilItems: TImageList + Left = 32 + Top = 248 + Bitmap = { + 494C010105000A00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000808000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080000080800000808000008080000080800000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000808000008080000080800000808000008080000080800000808000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000007F7F7F007F7F7F007F7F7F0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F00000000007F7F + 7F007F7F7F000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000007F7F + 7F00000000000000000000000000000000000000000000000000000000000000 + 0000000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F000000 + 00000000000000000000BFBFBF00BFBFBF00BFBFBF0000000000000000000000 + 000000000000000000007F7F7F0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F0000000000BFBF + BF007F7F7F000000000000000000BFBFBF00BFBFBF00000000007F7F7F00BFBF + BF0000000000000000007F7F7F0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F00BFBF + BF007F7F7F00BFBFBF00BFBFBF007F7F7F0000000000BFBFBF007F7F7F007F7F + 7F007F7F7F007F7F7F007F7F7F0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000BFBFBF00BFBFBF0000000000FFFFFF00FFFFFF0000000000BFBFBF000000 + 00000000000000000000000000007F7F7F00000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000BFBFBF000000 + 0000BFBFBF0000000000BFBFBF00BFBFBF00BFBFBF00FFFFFF007F7F7F000000 + 0000BFBFBF00BFBFBF00000000007F7F7F00000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000BFBFBF00BFBF + BF00FFFFFF00000000007F7F7F0000000000BFBFBF00FFFFFF007F7F7F00BFBF + BF00BFBFBF00BFBFBF00000000007F7F7F00000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000000000000000 + 0000FFFFFF00000000007F7F7F007F7F7F00BFBFBF0000000000BFBFBF000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000808000008080000080800000808000008080000080800000808000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000BFBFBF00FFFFFF00000000000000000000000000BFBFBF00BFBFBF000000 + 0000000000007F7F7F000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080000080800000808000008080000080800000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F00BFBF + BF007F7F7F00BFBFBF00FFFFFF00FFFFFF00BFBFBF00BFBFBF007F7F7F007F7F + 7F007F7F7F00000000007F7F7F0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F0000000000BFBF + BF007F7F7F000000000000000000BFBFBF000000000000000000BFBFBF00BFBF + BF00000000007F7F7F000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000808000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F000000 + 00007F7F7F0000000000BFBFBF00BFBFBF00BFBFBF00000000007F7F7F000000 + 00007F7F7F00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000007F7F + 7F0000000000000000000000000000000000000000007F7F7F00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000007F7F7F007F7F7F007F7F7F0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFF000000000000FFFF000000000000 + FFFF000000000000FFFF000000000000FEFF000000000000FC7F000000000000 + F83F000000000000F01F000000000000E00F000000000000C007000000000000 + F83F000000000000F83F000000000000F83F000000000000F83F000000000000 + FFFF000000000000FFFF000000000000FC7FFFFFFFFFFFFFFC27FFFFFFFFFFFF + EC23C007FFF9FFFFC401C007E7FFFFFF8001C007C3F3F83FC001C007C3E7F83F + E000C007E1C7F83F0000C007F08FF83F0000C007F81FC0070003C007FC3FE00F + E003C007F81FF01FC001C007F09FF83F8003C00FC1C7FC7FC407C01F83E3FEFF + EC3FC03F8FF1FFFFFC7FFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSfmCompositionDsg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSfmCompositionDsg.pas new file mode 100644 index 00000000..89fdce89 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSfmCompositionDsg.pas @@ -0,0 +1,735 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSfmCompositionDsg; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, Classes, Graphics, Controls, Forms, StdCtrls, ImgList, + Menus, ExtCtrls, ComCtrls, dxPSCore; + +type + TdxfmCompositionDesignWindow = class(TAbstractdxReportLinkDesignWindow) + pmItems: TPopupMenu; + miAdd: TMenuItem; + miDelete: TMenuItem; + miLine1: TMenuItem; + miMoveUp: TMenuItem; + miMoveDown: TMenuItem; + miLine2: TMenuItem; + miDesign: TMenuItem; + ilItems: TImageList; + btnClose: TButton; + pcItems: TPageControl; + tbsItems: TTabSheet; + lvItems: TListView; + btnHelp: TButton; + miRename: TMenuItem; + miSelectAll: TMenuItem; + N1: TMenuItem; + btnMoveDown: TButton; + btnMoveUp: TButton; + btnDesign: TButton; + btnDelete: TButton; + btnAdd: TButton; + pnlNoItems: TPanel; + procedure MoveUpClick(Sender: TObject); + procedure MoveDownClick(Sender: TObject); + procedure DeleteClick(Sender: TObject); + procedure DesignerClick(Sender: TObject); + procedure AddClick(Sender: TObject); + procedure pmItemsPopup(Sender: TObject); + procedure lvItemsDragDrop(Sender, Source: TObject; X, Y: Integer); + procedure lvItemsDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure lvItemsStartDrag(Sender: TObject; var DragObject: TDragObject); + procedure lvItemsChange(Sender: TObject; Item: TListItem; Change: TItemChange); + procedure lvItemsEdited(Sender: TObject; Item: TListItem; var S: String); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure lvItemsEditing(Sender: TObject; Item: TListItem; + var AllowEdit: Boolean); + procedure RenameClick(Sender: TObject); + procedure SelectAllClick(Sender: TObject); + procedure tbsItemsResize(Sender: TObject); + procedure FormResize(Sender: TObject); + private + FIsRefreshing: Boolean; + FListViewWndProc: TWndMethod; + FSaveDragIndex: Integer; + + function GetActiveItem: TdxCompositionLinkItem; + function GetComposition: TdxCompositionReportLink; + function GetHasOnlyBuiltInsAreInSelection: Boolean; + function GetIsSelected(Index: Integer): Boolean; + function GetItem(Index: Integer): TdxCompositionLinkItem; + function GetItemCount: Integer; + function GetSelectedCount: Integer; + function GetShowDescription: Boolean; + procedure SetActiveItem(Value: TdxCompositionLinkItem); + procedure SetIsSelected(Index: Integer; Value: Boolean); + + function CanAdd: Boolean; + function CanDelete: Boolean; + function CanDesign: Boolean; + function CanEdit: Boolean; + function CanMoveDown: Boolean; + function CanMoveUp: Boolean; + function CanRename: Boolean; + function CanSelectAll: Boolean; + + procedure DeleteSelection; + function GetSelectedItemsAsString: string; + procedure MoveSelection(ADelta: Integer); + procedure RefreshColumns; + procedure RefreshList; + + procedure ListViewWndProc(var Message: TMessage); + procedure SubClassListView; + procedure UnsubClassListView; + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + protected + procedure BeforeConstruction; override; + procedure Initialize; override; + procedure LoadStrings; override; + procedure UpdateControlsState; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure LoadFromRegistry(const APath: string); override; + procedure SaveToRegistry(const APath: string); override; + + property ActiveItem: TdxCompositionLinkItem read GetActiveItem write SetActiveItem; + property Composition: TdxCompositionReportLink read GetComposition; + property HasOnlyBuiltInsAreInSelection: Boolean read GetHasOnlyBuiltInsAreInSelection; + property IsSelected[Index: Integer]: Boolean read GetIsSelected write SetIsSelected; + property ItemCount: Integer read GetItemCount; + property Items[Index: Integer]: TdxCompositionLinkItem read GetItem; + property SelectedCount: Integer read GetSelectedCount; + property ShowDescription: Boolean read GetShowDescription; + end; + +implementation + +{$R *.DFM} + +uses + SysUtils, CommCtrl, cxClasses, dxPSRes, dxPSGlbl, dxPSUtl, dxPSForm, + dxPSPopupMan, dxPSfmCompositionAdd; + +constructor TdxfmCompositionDesignWindow.Create(AOwner: TComponent); +begin + HelpContext := dxhcCompositionReportLinkDesigner; + inherited; + dxPSPopupMenuController.RegisterControl(lvItems); + SubClassListView; +end; + +destructor TdxfmCompositionDesignWindow.Destroy; +begin + UnsubClassListView; + dxPSPopupMenuController.UnregisterControl(lvItems); + inherited; +end; + +procedure TdxfmCompositionDesignWindow.LoadFromRegistry(const APath: string); +begin + inherited; + dxLoadListViewColumnsFromRegistry(lvItems, APath); +end; + +procedure TdxfmCompositionDesignWindow.SaveToRegistry(const APath: string); +begin + inherited; + dxSaveListViewColumnsToRegistry(lvItems, APath); +end; + +procedure TdxfmCompositionDesignWindow.FormResize(Sender: TObject); +const + BtnOffsetY = 6; +var + BtnOffsetX, RightOrigin, TopOrigin: Integer; +begin + BtnOffsetX := pcItems.Left; + RightOrigin := BtnOffsetX + pcItems.Width; + TopOrigin := pcItems.Top + pcItems.Height + BtnOffsetY; + + dxPSUtl.PlaceButtons([btnHelp, btnClose], BtnOffsetX, RightOrigin, TopOrigin); +end; + +procedure TdxfmCompositionDesignWindow.tbsItemsResize(Sender: TObject); +var + R: TRect; +begin + R := lvItems.ClientRect; + InflateRect(R, -3, -3); + with R do + begin + Top := (Bottom - Top - pnlNoItems.Height) div 2; + Bottom := Top + pnlNoItems.Height; + end; + pnlNoItems.BoundsRect := R; +end; + +procedure TdxfmCompositionDesignWindow.MoveUpClick(Sender: TObject); +begin + MoveSelection(-1); +end; + +procedure TdxfmCompositionDesignWindow.MoveDownClick(Sender: TObject); +begin + MoveSelection(1); +end; + +procedure TdxfmCompositionDesignWindow.lvItemsChange(Sender: TObject; + Item: TListItem; Change: TItemChange); +begin + if (Change = ctState) and not FIsRefreshing then + UpdateControlsState; +end; + +procedure TdxfmCompositionDesignWindow.DesignerClick(Sender: TObject); +begin + if CanDesign then + if ActiveItem.ReportLink.DesignReport then + Modified := True + else + UpdateControlsState; +end; + +procedure TdxfmCompositionDesignWindow.AddClick(Sender: TObject); +var + Data: TdxAddItemsToCompositionDlgData; + I: Integer; +begin + FillChar(Data, SizeOf(TdxAddItemsToCompositionDlgData), 0); + Data.Composition := Composition; + if ShowDescription then + Data.Options := [caiShowDescription]; + Data.Items := TList.Create; + try + if dxShowAddItemsToCompositionDlg(Data) then + begin + Modified := True; + if Data.Items.Count > 1 then Composition.Items.BeginUpdate; + try + for I := 0 to Data.Items.Count - 1 do + Composition.Items.AddLink(TBasedxReportLink(Data.Items[I])); + finally + if Data.Items.Count > 1 then Composition.Items.EndUpdate; + end; + RefreshList; + end; + finally + Data.Items.Free; + end; +end; + +procedure TdxfmCompositionDesignWindow.DeleteClick(Sender: TObject); +begin + if not lvItems.IsEditing and + MessageQuestion(Format(cxGetResourceString(@sdxConfirmDeleteItem), [GetSelectedItemsAsString])) then + DeleteSelection; +end; + +procedure TdxfmCompositionDesignWindow.RenameClick(Sender: TObject); +begin + if SelectedCount = 1 then + lvItems.Selected.EditCaption; +end; + +procedure TdxfmCompositionDesignWindow.SelectAllClick(Sender: TObject); +var + I: Integer; +begin + lvItems.Items.BeginUpdate; + try + for I := 0 to lvItems.Items.Count - 1 do + lvItems.Items[I].Selected := True; + finally + lvItems.Items.EndUpdate; + end; +end; + +procedure TdxfmCompositionDesignWindow.pmItemsPopup(Sender: TObject); +begin + miDesign.Enabled := CanDesign; + miAdd.Enabled := CanAdd; + miDelete.Enabled := CanDelete; + miRename.Enabled := CanRename; + miSelectAll.Enabled := CanSelectAll; + miMoveUp.Enabled := CanMoveUp; + miMoveDown.Enabled := CanMoveDown; +end; + +procedure TdxfmCompositionDesignWindow.lvItemsEditing(Sender: TObject; + Item: TListItem; var AllowEdit: Boolean); +begin + AllowEdit := IsDesigning or not Items[Item.Index].BuiltIn; + if AllowEdit then + lvItems.PopupMenu := nil; +end; + +procedure TdxfmCompositionDesignWindow.lvItemsEdited(Sender: TObject; + Item: TListItem; var S: string); +begin + Items[Item.Index].ReportLink.Caption := S; +end; + +procedure TdxfmCompositionDesignWindow.FormCloseQuery(Sender: TObject; + var CanClose: Boolean); +begin + CanClose := not lvItems.IsEditing; +end; + +procedure TdxfmCompositionDesignWindow.FormKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if (Key = VK_ESCAPE) or (Key = VK_RETURN) then + Close; +end; + +procedure TdxfmCompositionDesignWindow.lvItemsDragDrop(Sender, + Source: TObject; X, Y: Integer); +begin + MoveSelection(FSaveDragIndex - TListView(Sender).ItemFocused.Index); +end; + +procedure TdxfmCompositionDesignWindow.lvItemsDragOver(Sender, + Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); +var + Item: TListItem; +begin + Accept := Sender = Source; + if Accept then + begin + Item := TListView(Sender).GetItemAt(X, Y); + Accept := (Item <> nil) and (FSaveDragIndex <> TListView(Sender).ItemFocused.Index); + if Item <> nil then + FSaveDragIndex := Item.Index + else + FSaveDragIndex := -1; + end; +end; + +procedure TdxfmCompositionDesignWindow.lvItemsStartDrag(Sender: TObject; + var DragObject: TDragObject); +begin + FSaveDragIndex := -1; +end; + +procedure TdxfmCompositionDesignWindow.BeforeConstruction; +begin + inherited; + Options := Options + [foSizeableDialog]; +end; + +procedure TdxfmCompositionDesignWindow.Initialize; +begin + inherited; + btnHelp.Visible := HelpContext <> 0; + if not btnHelp.Visible then + btnClose.BoundsRect := btnHelp.BoundsRect + else + BorderIcons := BorderIcons + [biHelp]; + + RefreshColumns; + RefreshList; + pnlNoItems.Parent := lvItems; + FormResize(nil); + tbsItemsResize(nil); +end; + +procedure TdxfmCompositionDesignWindow.LoadStrings; +begin + inherited; + tbsItems.Caption := cxGetResourceString(@sdxItems); + pnlNoItems.Caption := cxGetResourceString(@sdxThereAreNowItemsForShow); + + btnDesign.Caption := cxGetResourceString(@sdxBtnDesign); + btnAdd.Caption := AddEndEllipsis(cxGetResourceString(@sdxBtnAdd)); + btnDelete.Caption := cxGetResourceString(@sdxBtnDelete); + btnMoveUp.Caption := cxGetResourceString(@sdxBtnMoveUp); + btnMoveDown.Caption := cxGetResourceString(@sdxBtnMoveDown); + btnClose.Caption := cxGetResourceString(@sdxBtnClose); + + miDesign.Caption := cxGetResourceString(@sdxBtnDesign); + miAdd.Caption := AddEndEllipsis(cxGetResourceString(@sdxBtnAdd)); + miDelete.Caption := cxGetResourceString(@sdxBtnDelete); + miRename.Caption := cxGetResourceString(@sdxRename); + miSelectAll.Caption := cxGetResourceString(@sdxSelectAll); + miMoveUp.Caption := cxGetResourceString(@sdxBtnMoveUp); + miMoveDown.Caption := cxGetResourceString(@sdxBtnMoveDown); +end; + +procedure TdxfmCompositionDesignWindow.UpdateControlsState; +begin + pnlNoItems.Visible := ItemCount = 0; + btnDesign.Enabled := CanDesign; + btnAdd.Enabled := CanAdd; + btnDelete.Enabled := CanDelete; + btnMoveUp.Enabled := CanMoveUp; + btnMoveDown.Enabled := CanMoveDown; +end; + +function TdxfmCompositionDesignWindow.GetActiveItem: TdxCompositionLinkItem; +begin + if SelectedCount = 1 then + Result := TdxCompositionLinkItem(lvItems.Selected.Data) + else + Result := nil; +end; + +function TdxfmCompositionDesignWindow.GetComposition: TdxCompositionReportLink; +begin + Result := TdxCompositionReportLink(ReportLink); +end; + +function TdxfmCompositionDesignWindow.GetHasOnlyBuiltInsAreInSelection: Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to ItemCount - 1 do + if IsSelected[I] and not Items[I].BuiltIn then + Exit; + Result := True; +end; + +function TdxfmCompositionDesignWindow.GetIsSelected(Index: Integer): Boolean; +begin + Result := lvItems.Items[Index].Selected; +end; + +function TdxfmCompositionDesignWindow.GetItem(Index: Integer): TdxCompositionLinkItem; +begin + Result := TdxCompositionLinkItem(lvItems.Items[Index].Data); +end; + +function TdxfmCompositionDesignWindow.GetItemCount: Integer; +begin + Result := lvItems.Items.Count; +end; + +function TdxfmCompositionDesignWindow.GetSelectedCount: Integer; +begin + Result := lvItems.SelCount; +end; + +function TdxfmCompositionDesignWindow.GetShowDescription: Boolean; +begin + Result := (Composition <> nil) and (coShowDescription in Composition.DesignerOptions); +end; + +procedure TdxfmCompositionDesignWindow.SetActiveItem(Value: TdxCompositionLinkItem); +var + I: Integer; + Item: TListItem; +begin + for I := 0 to lvItems.Items.Count - 1 do + begin + Item := lvItems.Items[I]; + if Item.Selected then Item.Selected := False; + end; + + Item := lvItems.FindData(0, Value, True, True); + if Item <> nil then + begin + Item.Selected := True; + Item.Focused := True; + end; +end; + +procedure TdxfmCompositionDesignWindow.SetIsSelected(Index: Integer; Value: Boolean); +begin + lvItems.Items[Index].Selected := Value; +end; + +function TdxfmCompositionDesignWindow.CanAdd: Boolean; +begin + Result := CanEdit; +end; + +function TdxfmCompositionDesignWindow.CanDelete: Boolean; +begin + Result := not lvItems.IsEditing and CanEdit and (SelectedCount <> 0) and + (IsDesigning or not HasOnlyBuiltInsAreInSelection); +end; + +function TdxfmCompositionDesignWindow.CanDesign: Boolean; +begin + Result := (SelectedCount = 1) and ActiveItem.ReportLink.CheckToDesign; +end; + +function TdxfmCompositionDesignWindow.CanEdit: Boolean; +begin + Result := (Composition <> nil) and (coCanEdit in Composition.DesignerOptions); +end; + +function TdxfmCompositionDesignWindow.CanMoveDown: Boolean; +var + I, Counter: Integer; +begin + if CanEdit then + begin + Counter := 0; + for I := ItemCount - 1 downto 0 do + begin + if not IsSelected[I] then + begin + Result := Counter < SelectedCount; + Exit; + end; + Inc(Counter); + end; + end; + Result := False; +end; + +function TdxfmCompositionDesignWindow.CanMoveUp: Boolean; +var + I: Integer; +begin + if CanEdit then + for I := 0 to ItemCount - 1 do + if not IsSelected[I] then + begin + Result := I < SelectedCount; + Exit; + end; + Result := False; +end; + +function TdxfmCompositionDesignWindow.CanRename: Boolean; +begin + Result := (SelectedCount = 1) and (IsDesigning or not ActiveItem.BuiltIn); +end; + +function TdxfmCompositionDesignWindow.CanSelectAll: Boolean; +begin + Result := (ItemCount <> 0) and (SelectedCount <> ItemCount); +end; + +procedure TdxfmCompositionDesignWindow.DeleteSelection; +var + SelCount, I: Integer; +begin + SelCount := SelectedCount; + if SelCount > 1 then Composition.Items.BeginUpdate; + try + for I := 0 to ItemCount - 1 do + if IsSelected[I] and (IsDesigning or not Items[I].BuiltIn) then + TObject(lvItems.Items[I].Data).Free; + finally + if SelCount > 1 then Composition.Items.EndUpdate; + end; + RefreshList; + Modified := True; +end; + +function TdxfmCompositionDesignWindow.GetSelectedItemsAsString: string; +var + I: Integer; +begin + Result := ''; + for I := 0 to ItemCount - 1 do + if IsSelected[I] and (IsDesigning or not Items[I].BuiltIn) then + begin + if Result <> '' then + Result := Result + ', '; + Result := Result + '"' + lvItems.Items[I].Caption + '"'; + end; +end; + +procedure TdxfmCompositionDesignWindow.MoveSelection(ADelta: Integer); + + procedure MoveDown(ADelta: Integer); + var + I, Index: Integer; + begin + for I := ItemCount - 1 downto 0 do + if IsSelected[I] then + begin + Index := Items[I].Index; + Inc(Index, ADelta); + if Index > ItemCount - 1 then Index := ItemCount - 1; +// while (Index < ItemCount) and IsSelected[Index] do Inc(Index); + Items[I].Index := Index; + end; + end; + + procedure MoveUp(ADelta: Integer); + var + I, Index: Integer; + begin + for I := 0 to ItemCount - 1 do + if IsSelected[I] then + begin + Index := Items[I].Index; + Inc(Index, ADelta); + if Index < 0 then Index := 0; +// while (Index > -1) and IsSelected[Index] do Dec(Index); + Items[I].Index := Index; + end; + end; + +begin + Composition.Items.BeginUpdate; + try + if ADelta > 0 then + MoveDown(ADelta) + else + MoveUp(ADelta); + finally + Composition.Items.EndUpdate; + end; + RefreshList; +end; + +procedure TdxfmCompositionDesignWindow.RefreshColumns; +var + ColumnWidths: array of Integer; + I: Integer; +begin + lvItems.Columns.BeginUpdate; + try + SetLength(ColumnWidths, lvItems.Columns.Count); + for I := 0 to lvItems.Columns.Count - 1 do + ColumnWidths[I] := lvItems.Columns[I].Width; + + lvItems.Columns.Clear; + with lvItems.Columns.Add do + begin + Width := 2 * //+ Ord(not(coShowDescription in Composition.DesignerOptions))) * + (lvItems.Width - GetSystemMetrics(SM_CXHSCROLL)) div 3 - 3; + Caption := cxGetResourceString(@sdxItemName); + end; + + if coShowDescription in Composition.DesignerOptions then + with lvItems.Columns.Add do + begin + Width := (lvItems.Width - GetSystemMetrics(SM_CXHSCROLL)) div 3 - 3; + Caption := cxGetResourceString(@sdxItemDescription); + end; + + for I := 0 to Min(lvItems.Columns.Count - 1, Length(ColumnWidths) - 1) do + lvItems.Columns[I].Width := ColumnWidths[I]; + finally + lvItems.Columns.EndUpdate; + end; +end; + +procedure TdxfmCompositionDesignWindow.RefreshList; +const + Styles: array[Boolean] of TViewStyle = (vsReport, vsList); +var + Selection: TList; + I: Integer; + Strings: TStrings; +begin + lvItems.Items.BeginUpdate; + FIsRefreshing := True; + try + Selection := TList.Create; + try + dxSaveListViewSelection(lvItems, Selection); + Strings := TStringList.Create; + try + lvItems.Items.Clear; + if Composition <> nil then + Composition.GetItems(Strings, True); + + for I := 0 to Strings.Count - 1 do + with lvItems.Items.Add do + begin + Caption := Strings[I]; + Data := Strings.Objects[I]; + SubItems.Add(TdxCompositionLinkItem(Data).ReportLink.Description); + end; + finally + Strings.Free; + end; + dxRestoreListViewSelection(lvItems, Selection); + finally + Selection.Free; + end; + + lvItems.ViewStyle := Styles[ItemCount = 0]; +// lvItems.Enabled := not FNoItemsState; + lvItems.HideSelection := ItemCount = 0; + if (lvItems.SelCount = 0) and (ItemCount <> 0) then + lvItems.Selected := lvItems.Items[0]; + finally + FIsRefreshing := False; + lvItems.Items.EndUpdate; + end; + UpdateControlsState; + lvItems.Refresh; +end; + +procedure TdxfmCompositionDesignWindow.ListViewWndProc(var Message: TMessage); +begin + FListViewWndProc(Message); + if Message.Msg = CN_NOTIFY then + if TWMNotify(Message).NMHdr^.Code = LVN_ENDLABELEDIT then + lvItems.PopupMenu := pmItems; +end; + +procedure TdxfmCompositionDesignWindow.SubClassListView; +begin + lvItems.HandleNeeded; + FListViewWndProc := lvItems.WindowProc; + lvItems.WindowProc := ListViewWndProc; +end; + +procedure TdxfmCompositionDesignWindow.UnsubClassListView; +begin + lvItems.WindowProc := FListViewWndProc; +end; + +procedure TdxfmCompositionDesignWindow.CMDialogChar(var Message: TCMDialogChar); +begin + inherited; + if IsAccel(Message.CharCode, tbsItems.Caption) then + begin + Message.Result := 1; + if lvItems.Enabled then ActiveControl := lvItems; + end; +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSfmLnkAdd.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSfmLnkAdd.dfm new file mode 100644 index 00000000..05de77e4 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSfmLnkAdd.dfm @@ -0,0 +1,500 @@ +object dxfmAddComponent: TdxfmAddComponent + Left = 675 + Top = 331 + BorderStyle = bsDialog + ClientHeight = 457 + ClientWidth = 392 + Color = clBtnFace + Constraints.MinHeight = 400 + Constraints.MinWidth = 400 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Icon.Data = { + 0000010001001010100000000000280100001600000028000000100000002000 + 00000100040000000000C0000000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000 + 00000000000000000000000000000000000000000000000FFFFFFFFF0000000F + FFFFFFFF0000000FFFFFFFFF0000000FFFFFFFFF0000000FFFFFFFFF0000000F + FFFFFFFF0000000FFFFFFFFF0000000FFFFFFFFF0000000FFFFFF0000000000F + FFFFF0F00000000FFFFFF000000000000000000000000000000000000000FFFF + 0000FFFF0000C0070000C0070000C0070000C0070000C0070000C0070000C007 + 0000C0070000C0070000C0070000C00F0000C01F0000C03F0000FFFF0000} + OldCreateOrder = True + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + OnCreate = FormCreate + OnDestroy = FormDestroy + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object pnlHost: TPanel + Left = 6 + Top = 5 + Width = 380 + Height = 417 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + TabOrder = 4 + object pgctrlItems: TPageControl + Left = 0 + Top = 104 + Width = 380 + Height = 313 + ActivePage = tbsItems + Align = alClient + TabOrder = 4 + TabStop = False + object tbsItems: TTabSheet + Caption = '&Available Components' + object pnlBottomHost: TPanel + Left = 0 + Top = 211 + Width = 372 + Height = 74 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object bvlOnlyUnLinked: TBevel + Left = 0 + Top = 50 + Width = 372 + Height = 24 + Align = alTop + Shape = bsSpacer + end + object bvlHideCustomContainers: TBevel + Left = 0 + Top = 0 + Width = 372 + Height = 26 + Align = alTop + Shape = bsSpacer + end + object bvlOnlyInCurrentModule: TBevel + Left = 0 + Top = 26 + Width = 372 + Height = 24 + Align = alTop + Shape = bsSpacer + end + object chbxOnlyUnLinked: TCheckBox + Left = 7 + Top = 53 + Width = 253 + Height = 17 + Caption = 'Only Components &without Existing ReportLinks' + TabOrder = 2 + OnClick = chbxClick + end + object chbxOnlyInCurrentModule: TCheckBox + Left = 7 + Top = 29 + Width = 258 + Height = 17 + Caption = 'Only Components in the Active &Form' + TabOrder = 1 + OnClick = chbxClick + end + object chbxHideCustomContainers: TCheckBox + Left = 7 + Top = 5 + Width = 253 + Height = 17 + Caption = 'Hide Custom Containers' + TabOrder = 0 + OnClick = chbxClick + end + end + object lvItems: TListView + Left = 0 + Top = 0 + Width = 372 + Height = 211 + Align = alClient + Columns = <> + HideSelection = False + MultiSelect = True + ReadOnly = True + RowSelect = True + PopupMenu = pmItems + TabOrder = 0 + ViewStyle = vsReport + OnChange = lvItemsChange + OnColumnClick = lvItemsColumnClick + OnCompare = lvItemsCompare + OnDblClick = lvItemsDblClick + end + object pnlNoItems: TPanel + Left = 48 + Top = 72 + Width = 266 + Height = 22 + BevelOuter = bvNone + Caption = 'There are no Items in this View' + Color = clWindow + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnShadow + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + TabOrder = 2 + end + end + end + object pnlNameHost: TPanel + Left = 0 + Top = 0 + Width = 380 + Height = 30 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object lblName: TLabel + Left = 6 + Top = 8 + Width = 31 + Height = 13 + Caption = '&Name:' + FocusControl = edName + end + object edName: TEdit + Left = 55 + Top = 5 + Width = 230 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + end + end + object pnlCreatorHost: TPanel + Left = 0 + Top = 60 + Width = 380 + Height = 30 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object lblCreator: TLabel + Left = 6 + Top = 10 + Width = 41 + Height = 13 + Caption = 'Creato&r:' + FocusControl = edCreator + end + object edCreator: TEdit + Left = 55 + Top = 6 + Width = 230 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + end + object btnDescription: TButton + Left = 294 + Top = 6 + Width = 83 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Description...' + TabOrder = 1 + OnClick = btnDescriptionClick + end + end + object pnlSeparatorHost: TPanel + Left = 0 + Top = 90 + Width = 380 + Height = 14 + Align = alTop + BevelOuter = bvNone + TabOrder = 3 + object bvlSeparator: TBevel + Left = 0 + Top = 0 + Width = 380 + Height = 4 + Align = alTop + Shape = bsBottomLine + end + end + object pnlCaptionHost: TPanel + Left = 0 + Top = 30 + Width = 380 + Height = 30 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object lblCaption: TLabel + Left = 6 + Top = 9 + Width = 41 + Height = 13 + Caption = '&Caption:' + FocusControl = edCaption + end + object edCaption: TEdit + Left = 55 + Top = 5 + Width = 230 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + end + end + end + object btnOK: TButton + Left = 68 + Top = 429 + Width = 75 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object btnCancel: TButton + Left = 149 + Top = 429 + Width = 75 + Height = 23 + Cancel = True + Caption = 'OK' + ModalResult = 2 + TabOrder = 1 + end + object btnHelp: TButton + Left = 311 + Top = 429 + Width = 75 + Height = 23 + Caption = 'OK' + TabOrder = 3 + end + object btnDesign: TButton + Left = 230 + Top = 429 + Width = 75 + Height = 23 + Caption = 'OK' + TabOrder = 2 + OnClick = btnDesignClick + end + object ilItems: TImageList + AllocBy = 3 + Left = 2 + Top = 427 + Bitmap = { + 494C010101000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000001000000001002000000000000010 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000007F7F7F007F7F7F007F7F7F0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F00000000007F7F + 7F007F7F7F000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000007F7F + 7F00000000000000000000000000000000000000000000000000000000000000 + 0000000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F000000 + 00000000000000000000BFBFBF00BFBFBF00BFBFBF0000000000000000000000 + 000000000000000000007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F0000000000BFBF + BF007F7F7F000000000000000000BFBFBF00BFBFBF00000000007F7F7F00BFBF + BF0000000000000000007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F00BFBF + BF007F7F7F00BFBFBF00BFBFBF007F7F7F0000000000BFBFBF007F7F7F007F7F + 7F007F7F7F007F7F7F007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000BFBFBF00BFBFBF0000000000FFFFFF00FFFFFF0000000000BFBFBF000000 + 00000000000000000000000000007F7F7F000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000BFBFBF000000 + 0000BFBFBF0000000000BFBFBF00BFBFBF00BFBFBF00FFFFFF007F7F7F000000 + 0000BFBFBF00BFBFBF00000000007F7F7F000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000BFBFBF00BFBF + BF00FFFFFF00000000007F7F7F0000000000BFBFBF00FFFFFF007F7F7F00BFBF + BF00BFBFBF00BFBFBF00000000007F7F7F000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000000000000000 + 0000FFFFFF00000000007F7F7F007F7F7F00BFBFBF0000000000BFBFBF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000BFBFBF00FFFFFF00000000000000000000000000BFBFBF00BFBFBF000000 + 0000000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F00BFBF + BF007F7F7F00BFBFBF00FFFFFF00FFFFFF00BFBFBF00BFBFBF007F7F7F007F7F + 7F007F7F7F00000000007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F0000000000BFBF + BF007F7F7F000000000000000000BFBFBF000000000000000000BFBFBF00BFBF + BF00000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F000000 + 00007F7F7F0000000000BFBFBF00BFBFBF00BFBFBF00000000007F7F7F000000 + 00007F7F7F000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000007F7F + 7F0000000000000000000000000000000000000000007F7F7F00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000007F7F7F007F7F7F007F7F7F0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000100000000100010000000000800000000000000000000000 + 000000000000000000000000FFFFFF00FC7F000000000000FC27000000000000 + EC23000000000000C4010000000000008001000000000000C001000000000000 + E000000000000000000000000000000000000000000000000003000000000000 + E003000000000000C0010000000000008003000000000000C407000000000000 + EC3F000000000000FC7F00000000000000000000000000000000000000000000 + 000000000000} + end + object pmItems: TPopupMenu + Images = ilItems + OnPopup = pmItemsPopup + Left = 30 + Top = 427 + object miAdd: TMenuItem + Caption = '&Add' + Default = True + OnClick = lvItemsDblClick + end + object miLine1: TMenuItem + Caption = '-' + end + object miDesign: TMenuItem + Caption = 'Add and D&esign Report...' + ImageIndex = 0 + OnClick = btnDesignClick + end + end + object ilColumns: TImageList + AllocBy = 2 + Height = 8 + Width = 8 + Left = 58 + Top = 427 + Bitmap = { + 494C010102000400040008000800FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000200000000800000001002000000000000004 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000808080008080 + 8000808080008080800080808000808080000000000000000000000000000000 + 0000808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000000000000000000000000000000000008080 + 8000808080008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800000000000000000000000000000000000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000808080000000000000000000000000000000000080808000808080008080 + 8000808080008080800080808000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000020000000080000000100010000000000200000000000000000000000 + 000000000000000000000000FFFFFF00FFFF0000FFFF000080F70000C1E30000 + E3C10000F7800000FFFF0000FFFF000000000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSfmLnkAdd.pas b/official/x.35/ExpressPrinting System/Sources/dxPSfmLnkAdd.pas new file mode 100644 index 00000000..9b37f75f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSfmLnkAdd.pas @@ -0,0 +1,912 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSfmLnkAdd; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Registry, + ExtCtrls, StdCtrls, ComCtrls, Menus, ImgList, dxPSForm, dxPSCompsProvider, + dxPSCore; + +type + TSortOrder = (soNone, soUp, soDown); + + TdxAddReportLinkDlgDataOption = (adoShowDesignButton, adoShowDescriptionColumn, + adoShowOnlyComponentsWOLinks, adoShowOnlyComponentsInActiveForm, + adoAllowMultiSelect, adoShowNameEdit, adoShowCaptionEdit, + adoShowHideCustomContainers, adoShowCreatorEdit); + TdxAddReportLinkDlgDataOptions = set of TdxAddReportLinkDlgDataOption; + + TdxfmAddComponent = class(TCustomdxPSForm) + btnOK: TButton; + btnCancel: TButton; + btnHelp: TButton; + btnDesign: TButton; + ilItems: TImageList; + pmItems: TPopupMenu; + miAdd: TMenuItem; + miLine1: TMenuItem; + miDesign: TMenuItem; + pnlHost: TPanel; + pgctrlItems: TPageControl; + tbsItems: TTabSheet; + pnlBottomHost: TPanel; + chbxOnlyUnLinked: TCheckBox; + chbxOnlyInCurrentModule: TCheckBox; + lvItems: TListView; + pnlNoItems: TPanel; + pnlNameHost: TPanel; + pnlCreatorHost: TPanel; + lblName: TLabel; + edName: TEdit; + lblCreator: TLabel; + edCreator: TEdit; + pnlSeparatorHost: TPanel; + bvlSeparator: TBevel; + chbxHideCustomContainers: TCheckBox; + bvlOnlyUnLinked: TBevel; + bvlHideCustomContainers: TBevel; + bvlOnlyInCurrentModule: TBevel; + btnDescription: TButton; + pnlCaptionHost: TPanel; + lblCaption: TLabel; + edCaption: TEdit; + ilColumns: TImageList; + procedure chbxClick(Sender: TObject); + procedure btnDesignClick(Sender: TObject); + procedure lvItemsDblClick(Sender: TObject); + procedure pmItemsPopup(Sender: TObject); + procedure FormResize(Sender: TObject); + procedure lvItemsChange(Sender: TObject; Item: TListItem; Change: TItemChange); + procedure btnDescriptionClick(Sender: TObject); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + procedure lvItemsColumnClick(Sender: TObject; Column: TListColumn); + procedure lvItemsCompare(Sender: TObject; Item1, Item2: TListItem; + Data: Integer; var Compare: Integer); + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + private + FComponentPrinter: TdxComponentPrinter; + FDesignBtnPressed: Boolean; + FOptions: TdxAddReportLinkDlgDataOptions; + FOriginalReportLinkName: string; + FReportLink: TBasedxReportLink; + FPrevListViewWndProc: TWndMethod; + FReportLinkDescription: string; + FSortedColumnIndex: Integer; + FSortOrder: TSortOrder; + function GetItemCount: Integer; + function GetListViewHeader: HWND; + function GetReportLinkCaption: string; + function GetReportLinkCreator: string; + function GetReportLinkName: string; + function GetSelectedComponent: TComponent; + procedure GetSelection(AList: TList); + procedure SetReportLinkCaption(const Value: string); + procedure SetReportLinkCreator(const Value: string); + procedure SetReportLinkName(const Value: string); + + procedure AssignListViewHeaderImages; + procedure ListViewWndProc(var Message: TMessage); + procedure RestoreListViewWndProc; + procedure SubstituteListViewWndProc; + + function CanEditName: Boolean; + function CanDesign: Boolean; + function CanSelect: Boolean; + function CheckUserInput: Boolean; + procedure ClearList; + procedure Initialize; + procedure LoadStrings; + function PreparedOptions: TdxPSGetComponentOptions; + procedure RefreshColumns; + procedure RefreshList; + procedure RefreshSorting; + procedure SetActiveControl; + procedure SetColumnSortMark(AIndex: Integer; ASortOrder: TSortOrder); + procedure SortColumn(Column: TListColumn; ASortOrder: TSortOrder); + procedure UpdateControlsState; + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + protected + procedure CreateWnd; override; + procedure BeforeConstruction; override; + + procedure LoadComponentState(const APath: string); + procedure LoadListViewSorting(const APath: string); + procedure SaveComponentState(const APath: string); + procedure SaveListViewSorting(const APath: string); + + property ListViewHeader: HWND read GetListViewHeader; + public + function Execute: Boolean; + procedure LoadFromRegistry(const APath: string); override; + procedure SaveToRegistry(const APath: string); override; + + property ItemCount: Integer read GetItemCount; + property OriginalReportLinkName: string read FOriginalReportLinkName write FOriginalReportLinkName; + property ReportLinkCaption: string read GetReportLinkCaption write SetReportLinkCaption; + property ReportLinkCreator: string read GetReportLinkCreator write SetReportLinkCreator; + property ReportLinkDescription: string read FReportLinkDescription write FReportLinkDescription; + property ReportLinkName: string read GetReportLinkName write SetReportLinkName; + property SelectedComponent: TComponent read GetSelectedComponent; + end; + + PdxAddReportLinkDlgData = ^TdxAddReportLinkDlgData; + TdxAddReportLinkDlgData = record + Components: TList; + ComponentPrinter: TdxComponentPrinter; + ReportLink: TBasedxReportLink; + ReportLinkName: string; + ReportLinkCaption: string; + ReportLinkCreator: string; + ReportLinkDescription: string; + Options: TdxAddReportLinkDlgDataOptions; + DesignBtnPressed: Boolean; + Title: string; + end; + +function dxShowAddComponentsDlg(var AData: TdxAddReportLinkDlgData): Boolean; + +implementation + +{$R *.DFM} + +uses + CommCtrl, cxClasses, dxPSRes, dxPSUtl, dxPSGlbl, dxPSPopupMan, dxPSfmEditDesc; + +const + sdxOnlyWithoutLinks = 'OnlyWithoutLinks'; // Don't Localize + sdxOnlyInCurrentModule = 'OnlyInCurrentModule'; // Don't Localize + sdxHideCustomContainers_ = 'HideCustomContainers'; // Don't Localize + sdxSortedColumnIndex = 'SortedColumnIndex'; // Don't Localize + sdxSortOrder = 'SortOrder'; // Don't Localize + +function dxShowAddComponentsDlg(var AData: TdxAddReportLinkDlgData): Boolean; +var + Dialog: TdxfmAddComponent; +begin + Result := False; + if AData.Components = nil then Exit; + + Dialog := TdxfmAddComponent.Create(nil); + try + Dialog.FOptions := AData.Options; + Dialog.FComponentPrinter := AData.ComponentPrinter; + Dialog.FReportLink := AData.ReportLink; + Dialog.ReportLinkName := AData.ReportLinkName; + Dialog.OriginalReportLinkName := Dialog.ReportLinkName; + Dialog.ReportLinkCaption := AData.ReportLinkCaption; + Dialog.ReportLinkCreator := AData.ReportLinkCreator; + Dialog.ReportLinkDescription := AData.ReportLinkDescription; + if AData.Title <> '' then + Dialog.Caption := AData.Title; + + Result := Dialog.Execute; + + if Result then + begin + Dialog.GetSelection(AData.Components); + AData.DesignBtnPressed := Dialog.FDesignBtnPressed; + if Dialog.SelectedComponent <> nil then + AData.ReportLinkName := Dialog.ReportLinkName; + AData.ReportLinkCaption := Dialog.ReportLinkCaption; + AData.ReportLinkCreator := Dialog.ReportLinkCreator; + AData.ReportLinkDescription := Dialog.ReportLinkDescription; + end; + finally + Dialog.Free; + end; +end; + +{ TdxfmAddComponent } + +procedure TdxfmAddComponent.FormCreate(Sender: TObject); +begin + FSortedColumnIndex := -1; + HelpContext := dxPSGlbl.dxhcAddLinkDlg; + Application.MainForm.Caption := Caption; + SubstituteListViewWndProc; + AssignListViewHeaderImages; + dxPSPopupMenuController.RegisterControl(lvItems); +end; + +procedure TdxfmAddComponent.FormDestroy(Sender: TObject); +begin + dxPSPopupMenuController.UnregisterControl(lvItems); + RestoreListViewWndProc; + ClearList; +end; + +procedure TdxfmAddComponent.FormResize(Sender: TObject); +const + BtnOffsetY = 6; + Offset = 3; +var + BtnOffsetX, RightOrigin, TopOrigin: Integer; +begin + BtnOffsetX := pnlHost.Left; + RightOrigin := BtnOffsetX + pnlHost.Width; + TopOrigin := pnlHost.Top + pnlHost.Height + BtnOffsetY; + + dxPSUtl.PlaceButtons([btnHelp, btnDesign, btnCancel, btnOK], BtnOffsetX, RightOrigin, TopOrigin); + with pnlNoItems do + begin + Left := Offset; + Top := (lvItems.ClientHeight - Height) div 2; + Width := lvItems.ClientWidth - 2 * Offset; + end; +end; + +procedure TdxfmAddComponent.chbxClick(Sender: TObject); +begin + RefreshList; + RefreshSorting; +end; + +procedure TdxfmAddComponent.btnDesignClick(Sender: TObject); +begin + FDesignBtnPressed := True; + ModalResult := mrOk; +end; + +procedure TdxfmAddComponent.lvItemsChange(Sender: TObject; Item: TListItem; + Change: TItemChange); +begin + if Change = ctState then UpdateControlsState; +end; + +procedure TdxfmAddComponent.btnDescriptionClick(Sender: TObject); +var + S: string; +begin + S := ReportLinkDescription; + if dxEditDescriptionDlg(S) then + ReportLinkDescription := S; +end; + +procedure TdxfmAddComponent.FormCloseQuery(Sender: TObject; + var CanClose: Boolean); +begin + if ModalResult = mrOK then + CanClose := CheckUserInput; +end; + +procedure TdxfmAddComponent.lvItemsColumnClick(Sender: TObject; + Column: TListColumn); +const + SortOrderToggleMap: array[TSortOrder] of TSortOrder = (soUp, soDown, soUp); +var + KeyboardState: TKeyboardState; +begin + Windows.GetKeyboardState(KeyboardState); + if KeyboardState[VK_CONTROL] and $80 <> 0 then + if FSortedColumnIndex <> -1 then + begin + RefreshList; + SetColumnSortMark(FSortedColumnIndex, soNone); + FSortOrder := soNone; + FSortedColumnIndex := -1; + end + else + else + begin + FSortOrder := SortOrderToggleMap[FSortOrder]; + SortColumn(Column, FSortOrder); + end; +end; + +procedure TdxfmAddComponent.lvItemsCompare(Sender: TObject; Item1, Item2: TListItem; + Data: Integer; var Compare: Integer); +begin + if Data = 0 then + Compare := CompareText(Item1.Caption, Item2.Caption) + else + Compare := CompareText(Item1.SubItems[Data - 1], Item2.SubItems[Data - 1]); + + if FSortOrder = soUp then + Compare := -Compare; +end; + +procedure TdxfmAddComponent.lvItemsDblClick(Sender: TObject); +begin + ModalResult := mrOk; +end; + +procedure TdxfmAddComponent.pmItemsPopup(Sender: TObject); +begin + miAdd.Enabled := CanSelect; + miDesign.Enabled := CanDesign; + miDesign.Visible := adoShowDesignButton in FOptions; + miLine1.Visible := miDesign.Visible; +end; + +function TdxfmAddComponent.Execute: Boolean; +begin + Initialize; + Result := ShowModal = mrOk; +end; + +procedure TdxfmAddComponent.LoadFromRegistry(const APath: string); +begin + inherited; + dxLoadListViewColumnsFromRegistry(lvItems, APath); + LoadComponentState(APath); + LoadListViewSorting(APath + '\' + lvItems.Name); +end; + +procedure TdxfmAddComponent.SaveToRegistry(const APath: string); +begin + inherited; + dxSaveListViewColumnsToRegistry(lvItems, APath); + SaveComponentState(APath); + SaveListViewSorting(APath + '\' + lvItems.Name); +end; + +procedure TdxfmAddComponent.CreateWnd; +begin + inherited; + SendMessage(Handle, WM_SETICON, 1, Icon.Handle); +end; + +procedure TdxfmAddComponent.BeforeConstruction; +begin + inherited; + Options := Options + [foSizeableDialog]; +end; + +procedure TdxfmAddComponent.LoadComponentState(const APath: string); +var + Registry: TRegistry; +begin + Registry := TRegistry.Create; + try + if Registry.OpenKey(APath, False) then + try + if Registry.ValueExists(sdxOnlyWithoutLinks) then + chbxOnlyUnLinked.Checked := Registry.ReadBool(sdxOnlyWithoutLinks); + if Registry.ValueExists(sdxOnlyInCurrentModule) then + chbxOnlyInCurrentModule.Checked := Registry.ReadBool(sdxOnlyInCurrentModule); + if Registry.ValueExists(sdxHideCustomContainers_) then + chbxHideCustomContainers.Checked := Registry.ReadBool(sdxHideCustomContainers_); + except + on ERegistryException do + { ignore } + else + raise; + end; + finally + Registry.Free; + end; +end; + +procedure TdxfmAddComponent.LoadListViewSorting(const APath: string); +begin + with TRegistry.Create do + try + if OpenKey(APath, False) then + try + if ValueExists(sdxSortedColumnIndex) then + FSortedColumnIndex := ReadInteger(sdxSortedColumnIndex); + if ValueExists(sdxSortOrder) then + FSortOrder := TSortOrder(ReadInteger(sdxSortOrder)); + except + end; + finally + Free; + end; +end; + +procedure TdxfmAddComponent.SaveListViewSorting(const APath: string); +begin + with TRegistry.Create do + try + if OpenKey(APath, True) then + begin + WriteInteger(sdxSortedColumnIndex, FSortedColumnIndex); + WriteInteger(sdxSortOrder, Integer(FSortOrder)); + end; + finally + Free; + end; +end; + +procedure TdxfmAddComponent.SaveComponentState(const APath: string); +var + Registry: TRegistry; +begin + Registry := TRegistry.Create; + try + if Registry.OpenKey(APath, True) then + try + Registry.WriteBool(sdxOnlyWithoutLinks, chbxOnlyUnLinked.Checked); + Registry.WriteBool(sdxOnlyInCurrentModule, chbxOnlyInCurrentModule.Checked); + Registry.WriteBool(sdxHideCustomContainers_, chbxHideCustomContainers.Checked); + except + on ERegistryException do + { ignore } + else + raise; + end; + finally + Registry.Free; + end; +end; + +function TdxfmAddComponent.GetItemCount: Integer; +begin + Result := lvItems.Items.Count; +end; + +function TdxfmAddComponent.GetListViewHeader: HWND; +begin + lvItems.HandleNeeded; + if lvItems.HandleAllocated then + Result := ListView_GetHeader(lvItems.Handle) + else + Result := 0; +end; + +function TdxfmAddComponent.GetReportLinkCaption: string; +begin + Result := edCaption.Text; +end; + +function TdxfmAddComponent.GetReportLinkCreator: string; +begin + Result := edCreator.Text; +end; + +function TdxfmAddComponent.GetReportLinkName: string; +begin + Result := edName.Text; +end; + +function TdxfmAddComponent.GetSelectedComponent: TComponent; +begin + if lvItems.SelCount = 1 then + Result := TdxComponentItem(lvItems.Selected.Data).Component + else + Result := nil; +end; + +procedure TdxfmAddComponent.GetSelection(AList: TList); +var + I: Integer; +begin + with lvItems do + begin + for I := 0 to Items.Count - 1 do + if Items[I].Selected then + AList.Add(TdxComponentItem(Items[I].Data).Component); + end; +end; + +procedure TdxfmAddComponent.SetReportLinkCaption(const Value: string); +begin + edCaption.Text := Value; +end; + +procedure TdxfmAddComponent.SetReportLinkCreator(const Value: string); +begin + edCreator.Text := Value; +end; + +procedure TdxfmAddComponent.SetReportLinkName(const Value: string); +begin + edName.Text := Value; +end; + +procedure TdxfmAddComponent.AssignListViewHeaderImages; +var + Header: HWND; +begin + Header := ListViewHeader; + if IsWindow(Header) and not IsWindow(Header_GetImageList(Header)) then + Header_SetImageList(Header, ilColumns.Handle); +end; + +procedure TdxfmAddComponent.ListViewWndProc(var Message: TMessage); +begin + FPrevListViewWndProc(Message); + + if (FSortedColumnIndex <> -1) and (Message.Msg = WM_NOTIFY) then + if (TWMNotify(Message).NMHdr^.hWndFrom = ListViewHeader) and + (TWMNotify(Message).NMHdr^.Code = HDN_ENDTRACK) then + SetColumnSortMark(FSortedColumnIndex, FSortOrder); +end; + +procedure TdxfmAddComponent.RestoreListViewWndProc; +begin + lvItems.WindowProc := FPrevListViewWndProc; +end; + +procedure TdxfmAddComponent.SubstituteListViewWndProc; +begin + FPrevListViewWndProc := lvItems.WindowProc; + lvItems.WindowProc := ListViewWndProc; +end; + +function TdxfmAddComponent.CanDesign: Boolean; +begin + Result := (SelectedComponent <> nil) and + FComponentPrinter.DesignerExistsByComponent(SelectedComponent); +end; + +function TdxfmAddComponent.CanEditName: Boolean; +begin + Result := SelectedComponent <> nil; +end; + +function TdxfmAddComponent.CanSelect: Boolean; +begin + Result := lvItems.Selected <> nil; +end; + +function TdxfmAddComponent.CheckUserInput: Boolean; +begin + if adoShowNameEdit in FOptions then + begin + Result := IsValidIdent(ReportLinkName); + if Result then + begin + Result := FComponentPrinter.Owner.FindComponent(ReportLinkName) = nil; + if not Result then + MessageError(Format(cxGetResourceString(@sdxComponentAlreadyExists), [ReportLinkName])); + end + else + MessageError(Format(cxGetResourceString(@sdxInvalidComponentName), [ReportLinkName])); + + if not Result and edName.CanFocus then + begin + edName.Text := FOriginalReportLinkName; + edName.SelectAll; + ActiveControl := edName; + end; + end + else + Result := True; +end; + +procedure TdxfmAddComponent.ClearList; +var + I: Integer; +begin + for I := 0 to lvItems.Items.Count - 1 do + TObject(lvItems.Items[I].Data).Free; + lvItems.Items.Clear; +end; + +procedure TdxfmAddComponent.Initialize; +begin + pnlNameHost.Visible := adoShowNameEdit in FOptions; + pnlCaptionHost.Visible := adoShowCaptionEdit in FOptions; + pnlCreatorHost.Visible := adoShowCreatorEdit in FOptions; + pnlSeparatorHost.Visible := pnlNameHost.Visible or pnlCaptionHost.Visible or pnlCreatorHost.Visible; + btnDesign.Visible := adoShowDesignButton in FOptions; + + btnHelp.Visible := HelpContext <> 0; + if HelpContext <> 0 then + BorderIcons := BorderIcons + [biHelp]; + + lvItems.MultiSelect := adoAllowMultiSelect in FOptions; + + chbxOnlyInCurrentModule.Visible := adoShowOnlyComponentsInActiveForm in FOptions; + chbxOnlyUnLinked.Visible := adoShowOnlyComponentsWOLinks in FOptions; + chbxHideCustomContainers.Visible := adoShowHideCustomContainers in FOptions; + + pnlBottomHost.Visible := chbxOnlyInCurrentModule.Visible or chbxOnlyUnLinked.Visible or chbxHideCustomContainers.Visible; + if pnlBottomHost.Visible then + begin + if not chbxHideCustomContainers.Visible then + pnlBottomHost.Height := pnlBottomHost.Height - bvlHideCustomContainers.Height; + if not chbxOnlyInCurrentModule.Visible then + pnlBottomHost.Height := pnlBottomHost.Height - bvlOnlyInCurrentModule.Height; + if not chbxOnlyUnLinked.Visible then + pnlBottomHost.Height := pnlBottomHost.Height - bvlOnlyUnLinked.Height; + + if not chbxHideCustomContainers.Visible then + begin + chbxOnlyUnLinked.BoundsRect := chbxOnlyInCurrentModule.BoundsRect; + chbxOnlyInCurrentModule.BoundsRect := chbxHideCustomContainers.BoundsRect; + end; + if not chbxOnlyInCurrentModule.Visible then + chbxOnlyUnLinked.BoundsRect := chbxOnlyInCurrentModule.BoundsRect; + end; + + pnlNoItems.Parent := lvItems; + + RefreshColumns; + RefreshList; + LoadStrings; + + FormResize(nil); + SetActiveControl; +end; + +procedure TdxfmAddComponent.LoadStrings; +begin + if (FComponentPrinter = nil) or not (csDesigning in FComponentPrinter.ComponentState) then + Caption := cxGetResourceString(@sdxAddReport); + + lblName.Caption := cxGetResourceString(@sdxName); + lblCaption.Caption := cxGetResourceString(@sdxCaption); + lblCreator.Caption := cxGetResourceString(@sdxCreator); + btnDescription.Caption := cxGetResourceString(@sdxBtnDescription); + + tbsItems.Caption := cxGetResourceString(@sdxAvailableSources); + + chbxHideCustomContainers.Caption := cxGetResourceString(@sdxHideCustomContainers); + chbxOnlyInCurrentModule.Caption := cxGetResourceString(@sdxOnlyComponentsInActiveForm); + chbxOnlyUnLinked.Caption := cxGetResourceString(@sdxOnlyComponentsWithoutLinks); + + pnlNoItems.Caption := cxGetResourceString(@sdxThereAreNowItemsForShow); + miAdd.Caption := cxGetResourceString(@sdxAddReport); + miDesign.Caption := cxGetResourceString(@sdxAddAndDesignReport); + + btnOK.Caption := cxGetResourceString(@sdxBtnOK); + btnDesign.Caption := cxGetResourceString(@sdxBtnDesign); + btnCancel.Caption := cxGetResourceString(@sdxBtnCancel); + btnHelp.Caption := cxGetResourceString(@sdxBtnHelp); +end; + +function TdxfmAddComponent.PreparedOptions: TdxPSGetComponentOptions; +begin + Result := []; + if (adoShowOnlyComponentsWOLinks in FOptions) and chbxOnlyUnLinked.Checked then + Include(Result, gcoExcludeExisting); + if (adoShowOnlyComponentsInActiveForm in FOptions) and chbxOnlyInCurrentModule.Checked then + Include(Result, gcoExcludeOutOfActiveForm); + if (adoShowHideCustomContainers in FOptions) and chbxHideCustomContainers.Checked then + Include(Result, gcoHideCustomContainers); +end; + +procedure TdxfmAddComponent.RefreshColumns; +var + ColumnWidths: array of Integer; + I: Integer; +begin + lvItems.Columns.BeginUpdate; + try + SetLength(ColumnWidths, lvItems.Columns.Count); + for I := 0 to lvItems.Columns.Count - 1 do + ColumnWidths[I] := lvItems.Columns[I].Width; + + lvItems.Columns.Clear; + with lvItems.Columns.Add do + begin + Width := 2 * (lvItems.Width - GetSystemMetrics(SM_CXHSCROLL) - 2) div 3; + Caption := cxGetResourceString(@sdxItemName); + end; + + if adoShowDescriptionColumn in FOptions then + with lvItems.Columns.Add do + begin + Width := (lvItems.Width - GetSystemMetrics(SM_CXHSCROLL) - 2) div 3; + Caption := cxGetResourceString(@sdxItemDescription); + end; + + for I := 0 to Min(lvItems.Columns.Count - 1, Length(ColumnWidths) - 1) do + lvItems.Columns[I].Width := ColumnWidths[I]; + finally + lvItems.ColumnClick := True; + lvItems.Columns.EndUpdate; + end; +end; + +procedure TdxfmAddComponent.RefreshList; + + procedure LoadStrings(AStrings: TStrings; AnOptions: TdxPSGetComponentOptions); + begin + dxPSComponentProvidersFactory.GetComponents(FComponentPrinter, FReportLink, AStrings, AnOptions); + end; + + procedure FillList(AStrings: TStrings); + var + I: Integer; + begin + for I := 0 to AStrings.Count - 1 do + with lvItems.Items.Add do + begin + Caption := AStrings[I]; + Data := AStrings.Objects[I]; + SubItems.Add(TdxComponentItem(Data).Description); + end; + end; + + procedure RestoreSelection(ASelection: TList); + var + I, J: Integer; + Item: TListItem; + begin + for I := 0 to ASelection.Count - 1 do + for J := 0 to lvItems.Items.Count - 1 do + begin + Item := TListItem(lvItems.Items[J]); + if TdxComponentItem(Item.Data).Component = ASelection[I] then + begin + Item.Selected := True; + Item.MakeVisible(True); + Break; + end; + end; + end; + + procedure UpdateListViewState; + const + Styles: array[Boolean] of TViewStyle = (vsReport, vsList); + begin + lvItems.ViewStyle := Styles[ItemCount = 0]; + lvItems.ColumnClick := True; + lvItems.Enabled := ItemCount <> 0; + lvItems.HideSelection := ItemCount = 0; + if (lvItems.SelCount = 0) and (ItemCount <> 0) then + lvItems.Selected := lvItems.Items[0]; + end; + +var + Selection: TList; + Strings: TStrings; +begin + lvItems.Items.BeginUpdate; + try + Selection := TList.Create; + try + GetSelection(Selection); + + Strings := TStringList.Create; + try + ClearList; + LoadStrings(Strings, PreparedOptions); + FillList(Strings); + finally + Strings.Free; + end; + + RestoreSelection(Selection); + + UpdateListViewState; + finally + Selection.Free; + end; + finally + lvItems.Items.EndUpdate; + end; + UpdateControlsState; +end; + +procedure TdxfmAddComponent.RefreshSorting; +begin + if (FSortedColumnIndex > -1) and (FSortedColumnIndex < lvItems.Columns.Count) and + (FSortOrder <> soNone) then + SortColumn(lvItems.Columns[FSortedColumnIndex], FSortOrder); +end; + +procedure TdxfmAddComponent.SetActiveControl; +begin + if lvItems.CanFocus then + ActiveControl := lvItems + else + if edName.CanFocus then + begin + ActiveControl := edName; + edName.SelectAll; + end + else + if edCaption.CanFocus then + begin + ActiveControl := edCaption; + edCaption.SelectAll; + end + else + if edCreator.CanFocus then + begin + ActiveControl := edCreator; + edCreator.SelectAll; + end; +end; + +procedure TdxfmAddComponent.SetColumnSortMark(AIndex: Integer; ASortOrder: TSortOrder); +const + Format: Integer = HDF_IMAGE or HDF_BITMAP_ON_RIGHT; + ImageIndexes: array[TSortOrder] of Integer = (-1, 0, 1); +var + Header: HWND; + HDItem: THDItem; +begin + AssignListViewHeaderImages; + Header := ListViewHeader; + if IsWindow(Header) then + begin + FillChar(HDItem, SizeOf(HDItem), 0); + HDItem.Mask := HDI_FORMAT or HDI_IMAGE; + Header_GetItem(Header, AIndex, HDItem); + if ASortOrder <> soNone then + HDItem.fmt := HDItem.fmt or Format + else + HDItem.fmt := HDItem.fmt and not Format; + HDItem.iImage := ImageIndexes[ASortOrder]; + Header_SetItem(Header, AIndex, HDItem); + end; +end; + +procedure TdxfmAddComponent.SortColumn(Column: TListColumn; ASortOrder: TSortOrder); +var + Item: TListItem; +begin + dxPSCore.dxPSStartWait; + try + if (FSortedColumnIndex <> Column.Index) and (FSortedColumnIndex <> -1) then + SetColumnSortMark(FSortedColumnIndex, soNone); + FSortedColumnIndex := Column.Index; + if ASortOrder <> soNone then + begin + lvItems.CustomSort(nil, MakeTTag(FSortedColumnIndex)); + SetColumnSortMark(FSortedColumnIndex, ASortOrder); + end; + Item := lvItems.Selected; + if Item <> nil then + Item.MakeVisible(True); + finally + dxPSCore.dxPSStopWait; + end; + lvItems.Invalidate; +end; + +procedure TdxfmAddComponent.UpdateControlsState; +begin + edName.Enabled := CanEditName; + edCaption.Enabled := ItemCount <> 0; + edCreator.Enabled := ItemCount <> 0; + btnDescription.Enabled := ItemCount <> 0; + pnlNoItems.Visible := ItemCount = 0; + btnDesign.Enabled := CanDesign; +end; + +procedure TdxfmAddComponent.CMDialogChar(var Message: TCMDialogChar); +begin + inherited; + if IsAccel(Message.CharCode, tbsItems.Caption) then + begin + Message.Result := 1; + if lvItems.Enabled then ActiveControl := lvItems; + end; +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSfmLnkAdde.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSfmLnkAdde.dfm new file mode 100644 index 00000000..c3518f3e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSfmLnkAdde.dfm @@ -0,0 +1,432 @@ +object dxfmAddReportLinkClass: TdxfmAddReportLinkClass + Left = 472 + Top = 300 + BorderStyle = bsDialog + Caption = 'Add Report' + ClientHeight = 463 + ClientWidth = 430 + Color = clBtnFace + Constraints.MinHeight = 350 + Constraints.MinWidth = 438 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Icon.Data = { + 0000010001001010100000000000280100001600000028000000100000002000 + 00000100040000000000C0000000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000 + 00000000000000000000000000000000000000000000000FFFFFFFFF0000000F + FFFFFFFF0000000FFFFFFFFF0000000FFFFFFFFF0000000FFFFFFFFF0000000F + FFFFFFFF0000000FFFFFFFFF0000000FFFFFFFFF0000000FFFFFF0000000000F + FFFFF0F00000000FFFFFF000000000000000000000000000000000000000FFFF + 0000FFFF0000C0070000C0070000C0070000C0070000C0070000C0070000C007 + 0000C0070000C0070000C0070000C00F0000C01F0000C03F0000FFFF0000} + OldCreateOrder = True + Position = poScreenCenter + OnCreate = FormCreate + OnDestroy = FormDestroy + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object btnOK: TButton + Left = 107 + Top = 433 + Width = 75 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object btnCancel: TButton + Left = 188 + Top = 433 + Width = 75 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + object btnHelp: TButton + Left = 350 + Top = 433 + Width = 75 + Height = 23 + Caption = '&Help' + TabOrder = 3 + OnClick = btnHelpClick + end + object btnDesign: TButton + Left = 269 + Top = 433 + Width = 75 + Height = 23 + Caption = 'D&esign...' + TabOrder = 2 + OnClick = btnDesignClick + end + object pnlHost: TPanel + Left = 5 + Top = 3 + Width = 420 + Height = 422 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + TabOrder = 4 + object pnlNameHost: TPanel + Left = 0 + Top = 0 + Width = 420 + Height = 30 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object lblName: TLabel + Left = 6 + Top = 7 + Width = 31 + Height = 13 + Caption = '&Name:' + FocusControl = edName + end + object edName: TEdit + Left = 55 + Top = 4 + Width = 271 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + end + end + object pnlCaptionHost: TPanel + Left = 0 + Top = 30 + Width = 420 + Height = 30 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object lblCaption: TLabel + Left = 6 + Top = 9 + Width = 41 + Height = 13 + Caption = '&Caption:' + FocusControl = edCaption + end + object edCaption: TEdit + Left = 55 + Top = 5 + Width = 271 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + end + end + object pnlSeparatorHost: TPanel + Left = 0 + Top = 90 + Width = 420 + Height = 14 + Align = alTop + BevelOuter = bvNone + TabOrder = 3 + object bvlSeparator: TBevel + Left = 0 + Top = 0 + Width = 420 + Height = 4 + Align = alTop + Shape = bsBottomLine + end + end + object pgctrlItems: TPageControl + Left = 0 + Top = 104 + Width = 420 + Height = 318 + ActivePage = tbsItems + Align = alClient + TabOrder = 4 + TabStop = False + object tbsItems: TTabSheet + Caption = ' &Active Report Links ' + object lvItems: TListView + Left = 0 + Top = 0 + Width = 412 + Height = 290 + Align = alClient + Columns = < + item + Caption = 'Supported Component Class(es)' + Width = 200 + end + item + Caption = 'ReportLink Class(es)' + Width = 200 + end> + HideSelection = False + ReadOnly = True + RowSelect = True + PopupMenu = pmLinks + SortType = stText + TabOrder = 0 + ViewStyle = vsReport + OnChange = lvItemsChange + OnColumnClick = lvItemsColumnClick + OnCompare = lvItemsCompare + OnCustomDrawItem = lvItemsCustomDrawItem + OnDblClick = lvItemsDblClick + end + end + end + object pnlCreatorHost: TPanel + Left = 0 + Top = 60 + Width = 420 + Height = 30 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object lblCreator: TLabel + Left = 6 + Top = 9 + Width = 41 + Height = 13 + Caption = 'Creato&r:' + FocusControl = edCreator + end + object edCreator: TEdit + Left = 55 + Top = 5 + Width = 271 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + end + object btnDescription: TButton + Left = 334 + Top = 4 + Width = 83 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Description...' + TabOrder = 1 + OnClick = btnDescriptionClick + end + end + end + object ilLinks: TImageList + AllocBy = 3 + Left = 7 + Top = 429 + Bitmap = { + 494C010101000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000001000000001002000000000000010 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000007F7F7F007F7F7F007F7F7F0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F00000000007F7F + 7F007F7F7F000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000007F7F + 7F00000000000000000000000000000000000000000000000000000000000000 + 0000000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F000000 + 00000000000000000000BFBFBF00BFBFBF00BFBFBF0000000000000000000000 + 000000000000000000007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F0000000000BFBF + BF007F7F7F000000000000000000BFBFBF00BFBFBF00000000007F7F7F00BFBF + BF0000000000000000007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F00BFBF + BF007F7F7F00BFBFBF00BFBFBF007F7F7F0000000000BFBFBF007F7F7F007F7F + 7F007F7F7F007F7F7F007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000BFBFBF00BFBFBF0000000000FFFFFF00FFFFFF0000000000BFBFBF000000 + 00000000000000000000000000007F7F7F000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000BFBFBF000000 + 0000BFBFBF0000000000BFBFBF00BFBFBF00BFBFBF00FFFFFF007F7F7F000000 + 0000BFBFBF00BFBFBF00000000007F7F7F000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000BFBFBF00BFBF + BF00FFFFFF00000000007F7F7F0000000000BFBFBF00FFFFFF007F7F7F00BFBF + BF00BFBFBF00BFBFBF00000000007F7F7F000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000000000000000 + 0000FFFFFF00000000007F7F7F007F7F7F00BFBFBF0000000000BFBFBF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000BFBFBF00FFFFFF00000000000000000000000000BFBFBF00BFBFBF000000 + 0000000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F00BFBF + BF007F7F7F00BFBFBF00FFFFFF00FFFFFF00BFBFBF00BFBFBF007F7F7F007F7F + 7F007F7F7F00000000007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F0000000000BFBF + BF007F7F7F000000000000000000BFBFBF000000000000000000BFBFBF00BFBF + BF00000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F000000 + 00007F7F7F0000000000BFBFBF00BFBFBF00BFBFBF00000000007F7F7F000000 + 00007F7F7F000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000007F7F + 7F0000000000000000000000000000000000000000007F7F7F00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000007F7F7F007F7F7F007F7F7F0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000100000000100010000000000800000000000000000000000 + 000000000000000000000000FFFFFF00FC7F000000000000FC27000000000000 + EC23000000000000C4010000000000008001000000000000C001000000000000 + E000000000000000000000000000000000000000000000000003000000000000 + E003000000000000C0010000000000008003000000000000C407000000000000 + EC3F000000000000FC7F00000000000000000000000000000000000000000000 + 000000000000} + end + object pmLinks: TPopupMenu + OnPopup = pmLinksPopup + Left = 35 + Top = 429 + object miSelect: TMenuItem + Caption = '&Add Report' + Default = True + OnClick = lvItemsDblClick + end + object miLine1: TMenuItem + Caption = '-' + end + object miDesign: TMenuItem + Caption = 'Add and D&esign Report...' + OnClick = btnDesignClick + end + end + object ilColumns: TImageList + AllocBy = 2 + Height = 8 + Width = 8 + Left = 63 + Top = 429 + Bitmap = { + 494C010102000400040008000800FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000200000000800000001002000000000000004 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000808080008080 + 8000808080008080800080808000808080000000000000000000000000000000 + 0000808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000000000000000000000000000000000008080 + 8000808080008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800000000000000000000000000000000000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000808080000000000000000000000000000000000080808000808080008080 + 8000808080008080800080808000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000020000000080000000100010000000000200000000000000000000000 + 000000000000000000000000FFFFFF00FFFF0000FFFF000080F70000C1E30000 + E3C10000F7800000FFFF0000FFFF000000000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSfmLnkAdde.pas b/official/x.35/ExpressPrinting System/Sources/dxPSfmLnkAdde.pas new file mode 100644 index 00000000..04caf7ab --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSfmLnkAdde.pas @@ -0,0 +1,731 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSfmLnkAddE; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, StdCtrls, Registry, + Menus, Forms, ComCtrls, ExtCtrls, ImgList, dxPSCore, dxPSForm; + +type + TSortOrder = (soNone, soUp, soDown); + + TdxfmAddReportLinkClass = class(TCustomdxPSForm) + btnOK: TButton; + btnCancel: TButton; + btnHelp: TButton; + ilLinks: TImageList; + btnDesign: TButton; + pmLinks: TPopupMenu; + miSelect: TMenuItem; + miDesign: TMenuItem; + miLine1: TMenuItem; + pnlHost: TPanel; + pnlNameHost: TPanel; + lblName: TLabel; + edName: TEdit; + pnlCaptionHost: TPanel; + lblCaption: TLabel; + edCaption: TEdit; + pnlSeparatorHost: TPanel; + bvlSeparator: TBevel; + pgctrlItems: TPageControl; + tbsItems: TTabSheet; + lvItems: TListView; + pnlCreatorHost: TPanel; + lblCreator: TLabel; + edCreator: TEdit; + btnDescription: TButton; + ilColumns: TImageList; + procedure btnHelpClick(Sender: TObject); + procedure lvItemsDblClick(Sender: TObject); + procedure lvItemsColumnClick(Sender: TObject; Column: TListColumn); + procedure lvItemsCompare(Sender: TObject; Item1, Item2: TListItem; + Data: Integer; var Compare: Integer); + procedure FormResize(Sender: TObject); + procedure btnDesignClick(Sender: TObject); + procedure pmLinksPopup(Sender: TObject); + procedure lvItemsChange(Sender: TObject; Item: TListItem; Change: TItemChange); + procedure btnDescriptionClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure lvItemsCustomDrawItem(Sender: TCustomListView; + Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean); + private + FDesignBtnPressed: Boolean; + {$IFDEF DELPHI5} + FPrevListViewWndProc: TWndMethod; + {$ENDIF} + FReportLinkDescription: string; + FSortedColumnIndex: Integer; + FSortOrder: TSortOrder; + function GetListViewHeader: HWND; + function GetReportLinkCaption: string; + function GetReportLinkCreator: string; + function GetReportLinkName: string; + function GetSelectedReportLinkClass: TdxReportLinkClass; + procedure SetReportLinkCaption(const Value: string); + procedure SetReportLinkCreator(Value: string); + procedure SetReportLinkName(const Value: string); + + function CanEditCaption: Boolean; + function CanEditCreator: Boolean; + function CanEditDescription: Boolean; + function CanEditName: Boolean; + function CanDesign: Boolean; + function CanSelect: Boolean; + procedure Initialize; + procedure RefreshList; + procedure SetActiveControl; + {$IFDEF DELPHI5} + procedure SetColumnSortMark(AIndex: Integer; ASortOrder: TSortOrder); + {$ENDIF} + procedure SortColumn(Column: TListColumn; ASortOrder: TSortOrder); + procedure RefreshSorting; + procedure UpdateControlsState; + + {$IFDEF DELPHI5} + procedure AssignListViewHeaderImages; + procedure ListViewWndProc(var Message: TMessage); + procedure RestoreListViewWndProc; + procedure SubstituteListViewWndProc; + {$ENDIF} + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + protected + procedure CreateWnd; override; + procedure BeforeConstruction; override; + + procedure LoadSorting(const APath: string); + procedure SaveSorting(const APath: string); + + property ListViewHeader: HWND read GetListViewHeader; + public + function Execute: Boolean; + procedure LoadFromRegistry(const APath: string); override; + procedure SaveToRegistry(const APath: string); override; + + property ReportLinkCaption: string read GetReportLinkCaption write SetReportLinkCaption; + property ReportLinkCreator: string read GetReportLinkCreator write SetReportLinkCreator; + property ReportLinkDescription: string read FReportLinkDescription write FReportLinkDescription; + property ReportLinkName: string read GetReportLinkName write SetReportLinkName; + property SelectedReportLinkClass: TdxReportLinkClass read GetSelectedReportLinkClass; + end; + + PdxAddReportLinkClassDlgData = ^TdxAddReportLinkClassDlgData; + TdxAddReportLinkClassDlgData = record + ReportLinkClass: TdxReportLinkClass; + ReportLinkName: string; + ReportLinkCaption: string; + ReportLinkCreator: string; + ReportLinkDescription: string; + DesignBtnPressed: Boolean; + HelpContext: THelpContext; + end; + +function dxShowAddReportLinkClassDlg(var AData: TdxAddReportLinkClassDlgData): Boolean; + +implementation + +{$R *.DFM} + +uses + Dialogs, CommCtrl, dxBase, dxPSGlbl, dxPSUtl, dxPSDsgProxies, dxPSPopupMan, + dxPSfmEditDesc; + +const + sdxSortedColumnIndex = 'SortedColumnIndex'; // Don't Localize + sdxSortOrder = 'SortOrder'; // Don't Localize + +type + TCustomListViewAccess = class(TCustomListView); + +function dxShowAddReportLinkClassDlg(var AData: TdxAddReportLinkClassDlgData): Boolean; +var + Dialog: TdxfmAddReportLinkClass; +begin + Dialog := TdxfmAddReportLinkClass.Create(nil); + try + Dialog.ReportLinkName := AData.ReportLinkName; + Dialog.ReportLinkCaption := AData.ReportLinkCaption; + Dialog.ReportLinkCreator := AData.ReportLinkCreator; + Dialog.ReportLinkDescription := AData.ReportLinkDescription; + if AData.HelpContext <> 0 then + Dialog.HelpContext := AData.HelpContext; + Result := Dialog.Execute; + if Result then + begin + AData.ReportLinkClass := Dialog.SelectedReportLinkClass; + AData.ReportLinkName := Dialog.ReportLinkName; + AData.ReportLinkCaption := Dialog.ReportLinkCaption; + AData.ReportLinkCreator := Dialog.ReportLinkCreator; + AData.ReportLinkDescription := Dialog.ReportLinkDescription; + AData.DesignBtnPressed := Dialog.FDesignBtnPressed; + end; + finally + Dialog.Free; + end; +end; + +{ TfmAddEmptyReportLink } + +procedure TdxfmAddReportLinkClass.FormCreate(Sender: TObject); +begin + FSortedColumnIndex := -1; + HelpContext := dxPSGlbl.dxhcAddEmptyLinkDlg; + dxPSDsgProxies.dxIdeImagesProvider.Refresh; + lvItems.SmallImages := dxPSDsgProxies.dxIdeImagesProvider.Images; + {$IFDEF DELPHI5} + SubstituteListViewWndProc; + AssignListViewHeaderImages; + {$ENDIF} + dxPSPopupMenuController.RegisterControl(lvItems); +end; + +procedure TdxfmAddReportLinkClass.FormDestroy(Sender: TObject); +begin + dxPSPopupMenuController.UnregisterControl(lvItems); + {$IFDEF DELPHI5} + RestoreListViewWndProc; + {$ENDIF} +end; + +function TdxfmAddReportLinkClass.Execute: Boolean; +begin + Initialize; + Result := (ShowModal = mrOk) and (lvItems.Selected <> nil); +end; + +procedure TdxfmAddReportLinkClass.LoadFromRegistry(const APath: string); +begin + inherited; + dxLoadListViewColumnsFromRegistry(lvItems, APath); + LoadSorting(APath + '\' + lvItems.Name); +end; + +procedure TdxfmAddReportLinkClass.SaveToRegistry(const APath: string); +begin + inherited; + dxSaveListViewColumnsToRegistry(lvItems, APath); + SaveSorting(APath + '\' + lvItems.Name); +end; + +procedure TdxfmAddReportLinkClass.CreateWnd; +begin + inherited; + SendMessage(Handle, WM_SETICON, 1, Icon.Handle); +end; + +procedure TdxfmAddReportLinkClass.BeforeConstruction; +begin + inherited; + Options := Options + [foSizeableDialog]; +end; + +procedure TdxfmAddReportLinkClass.LoadSorting(const APath: string); +begin + with TRegistry.Create do + try + if OpenKey(APath, False) then + try + if ValueExists(sdxSortedColumnIndex) then + FSortedColumnIndex := ReadInteger(sdxSortedColumnIndex); + if ValueExists(sdxSortOrder) then + FSortOrder := TSortOrder(ReadInteger(sdxSortOrder)); + except + end; + finally + Free; + end; +end; + +procedure TdxfmAddReportLinkClass.SaveSorting(const APath: string); +begin + with TRegistry.Create do + try + if OpenKey(APath, True) then + begin + WriteInteger(sdxSortedColumnIndex, FSortedColumnIndex); + WriteInteger(sdxSortOrder, Integer(FSortOrder)); + end; + finally + Free; + end; +end; + +procedure TdxfmAddReportLinkClass.pmLinksPopup(Sender: TObject); +begin + miSelect.Enabled := CanSelect; + miDesign.Enabled := CanDesign; +end; + +procedure TdxfmAddReportLinkClass.lvItemsChange(Sender: TObject; + Item: TListItem; Change: TItemChange); +begin + if Change = ctState then UpdateControlsState; +end; + +procedure TdxfmAddReportLinkClass.btnDescriptionClick(Sender: TObject); +var + S: string; +begin + S := ReportLinkDescription; + if dxEditDescriptionDlg(S) then + ReportLinkDescription := S; +end; + +procedure TdxfmAddReportLinkClass.btnDesignClick(Sender: TObject); +begin + FDesignBtnPressed := True; + ModalResult := mrOk; +end; + +procedure TdxfmAddReportLinkClass.btnHelpClick(Sender: TObject); +begin + if HelpContext <> 0 then Application.HelpContext(HelpContext); +end; + +procedure TdxfmAddReportLinkClass.lvItemsDblClick(Sender: TObject); +begin + if lvItems.Selected <> nil then ModalResult := mrOk; +end; + +procedure TdxfmAddReportLinkClass.lvItemsColumnClick(Sender: TObject; Column: TListColumn); +const + SortOrderToggleMap: array[TSortOrder] of TSortOrder = (soUp, soDown, soUp); +var + KeyboardState: TKeyboardState; +begin + Windows.GetKeyboardState(KeyboardState); + if KeyboardState[VK_CONTROL] and $80 <> 0 then + if FSortedColumnIndex <> -1 then + begin + RefreshList; + {$IFDEF DELPHI5} + SetColumnSortMark(FSortedColumnIndex, soNone); + {$ENDIF} + FSortOrder := soNone; + FSortedColumnIndex := -1; + end + else + else + begin + FSortOrder := SortOrderToggleMap[FSortOrder]; + SortColumn(Column, FSortOrder); + end; +end; + +procedure TdxfmAddReportLinkClass.FormResize(Sender: TObject); +const + BtnOffsetY = 6; +var + BtnOffsetX, RightOrigin, TopOrigin: Integer; +begin + BtnOffsetX := pnlHost.Left; + + with pnlHost do + SetBounds(Left, Top, Self.ClientWidth - 2 * Left, + Self.ClientHeight - Top - btnOK.Height - 2 * BtnOffsetY); + + RightOrigin := pnlHost.Left + pnlHost.Width; + TopOrigin := pnlHost.Top + pnlHost.Height + BtnOffsetY; + + PlaceButtons([btnHelp, btnDesign, btnCancel, btnOK], BtnOffsetX, RightOrigin, TopOrigin); +end; + +procedure TdxfmAddReportLinkClass.lvItemsCompare(Sender: TObject; Item1, Item2: TListItem; + Data: Integer; var Compare: Integer); +begin + if Data = 0 then + Compare := CompareText(Item1.Caption, Item2.Caption) + else + Compare := CompareText(Item1.SubItems[Data - 1], Item2.SubItems[Data - 1]); + + if FSortOrder = soUp then + Compare := -Compare; +end; + +procedure TdxfmAddReportLinkClass.lvItemsCustomDrawItem( + Sender: TCustomListView; Item: TListItem; State: TCustomDrawState; + var DefaultDraw: Boolean); +var + R: TRect; + DC: HDC; + BkColor, TextColor: COLORREF; + X, Y: Integer; +begin + if [cdsSelected, cdsFocused] * State = [cdsSelected, cdsFocused] then + begin + R := Item.DisplayRect(drIcon); + if Item.ImageIndex = -1 then + begin + Sender.Canvas.Brush.Color := clWindow; + Sender.Canvas.FillRect(R); + end + else + TCustomListViewAccess(Sender).SmallImages.Draw(Sender.Canvas, R.Left, R.Top, Item.ImageIndex); + + DC := Sender.Canvas.Handle; + BkColor := SetBkColor(DC, ColorToRGB(clHighLight)); + TextColor := SetTextColor(DC, ColorToRGB(clHighLightText)); + + R := Item.DisplayRect(drLabel); + with R do + begin + X := R.Left + 2; + Y := Top + (Bottom - Top - Canvas.TextHeight(Item.Caption)) div 2; + end; + Sender.Canvas.TextRect(R, X, Y, Item.Caption); + + ListView_GetSubItemRect(Sender.Handle, Item.Index, 1, LVIR_LABEL, @R); + with R do + begin + X := R.Left + 6; + Y := Top + (Bottom - Top - Sender.Canvas.TextHeight(Item.SubItems[0])) div 2; + end; + Sender.Canvas.TextRect(R, X, Y, Item.SubItems[0]); + + SetTextColor(DC, TextColor); + SetBkColor(DC, BkColor); + + if cdsFocused in State then + begin + UnionRect(R, R, Item.DisplayRect(drLabel)); + Sender.Canvas.DrawFocusRect(R); + end; + DefaultDraw := False; + end; +end; + +function TdxfmAddReportLinkClass.GetListViewHeader: HWND; +begin + lvItems.HandleNeeded; + if lvItems.HandleAllocated then + Result := ListView_GetHeader(lvItems.Handle) + else + Result := 0; +end; + +function TdxfmAddReportLinkClass.GetReportLinkCaption: string; +begin + Result := edCaption.Text; +end; + +function TdxfmAddReportLinkClass.GetReportLinkCreator: string; +begin + Result := edCreator.Text; +end; + +function TdxfmAddReportLinkClass.GetReportLinkName: string; +begin + Result := edName.Text; +end; + +function TdxfmAddReportLinkClass.GetSelectedReportLinkClass: TdxReportLinkClass; +begin + if lvItems.Selected <> nil then + Result := TdxReportLinkClass(lvItems.Selected.Data) + else + Result := nil; +end; + +procedure TdxfmAddReportLinkClass.SetReportLinkCaption(const Value: string); +begin + edCaption.Text := Value; +end; + +procedure TdxfmAddReportLinkClass.SetReportLinkCreator(Value: string); +begin + edCreator.Text := Value; +end; + +procedure TdxfmAddReportLinkClass.SetReportLinkName(const Value: string); +begin + edName.Text := Value; +end; + +function TdxfmAddReportLinkClass.CanDesign: Boolean; +begin + Result := dxPSDesignerClassByLinkClass(SelectedReportLinkClass) <> nil; +end; + +function TdxfmAddReportLinkClass.CanEditCaption: Boolean; +begin + Result := SelectedReportLinkClass <> nil; +end; + +function TdxfmAddReportLinkClass.CanEditCreator: Boolean; +begin + Result := SelectedReportLinkClass <> nil; +end; + +function TdxfmAddReportLinkClass.CanEditDescription: Boolean; +begin + Result := SelectedReportLinkClass <> nil; +end; + +function TdxfmAddReportLinkClass.CanEditName: Boolean; +begin + Result := SelectedReportLinkClass <> nil; +end; + +function TdxfmAddReportLinkClass.CanSelect: Boolean; +begin + Result := lvItems.Selected <> nil; +end; + +procedure TdxfmAddReportLinkClass.Initialize; +begin + btnHelp.Visible := HelpContext <> 0; + RefreshList; + with lvItems do + begin + btnOK.Enabled := Items.Count > 0; + if Items.Count > 0 then + begin + Selected := Items[0]; + ItemFocused := Selected; + end; + end; + + pmLinks.Images := ilLinks; + miDesign.ImageIndex := 0; + + FormResize(nil); + SetActiveControl; + RefreshSorting; +end; + +procedure TdxfmAddReportLinkClass.RefreshList; +var + Selection: TList; + I, J: Integer; + LinkClasses: TdxClassList; + ComponentClasses: TdxClassList; + LinkClass: TdxReportLinkClass; + ComponentClass: TComponentClass; +begin + lvItems.Items.BeginUpdate; + try + Selection := TList.Create; + try + dxPSUtl.dxSaveListViewSelection(lvItems, Selection); + try + lvItems.Items.Clear; + LinkClasses := TdxClassList.Create; + try + ComponentClasses := TdxClassList.Create; + try + dxPSGetActiveReportLinksList(LinkClasses); + for I := 0 to LinkClasses.Count - 1 do + begin + ComponentClasses.Clear; + + LinkClass := TdxReportLinkClass(LinkClasses[I]); + with lvItems.Items.Add do + begin + LinkClass.GetSupportedComponentList(ComponentClasses); + for J := 0 to ComponentClasses.Count - 1 do + begin + ComponentClass := TComponentClass(ComponentClasses[J]); + if J = 0 then + ImageIndex := dxPSDsgProxies.dxIdeImagesProvider.ImageIndexes[ComponentClass]; + if Caption <> '' then + Caption := Caption + ', '; + if ComponentClass <> nil then + Caption := Caption + ComponentClass.ClassName; + end; + Data := (LinkClass); + StateIndex := -1; + + SubItems.Add(LinkClass.ClassName); + end; + end; + finally + ComponentClasses.Free; + end; + finally + LinkClasses.Free; + end; + finally + dxPSUtl.dxRestoreListViewSelection(lvItems, Selection); + end; + finally + Selection.Free; + end; + finally + lvItems.Items.EndUpdate; + end; +end; + +procedure TdxfmAddReportLinkClass.SetActiveControl; +begin + if lvItems.CanFocus then + ActiveControl := lvItems + else + if edName.CanFocus then + begin + ActiveControl := edName; + edName.SelectAll; + end + else + if edCaption.CanFocus then + begin + ActiveControl := edCaption; + edCaption.SelectAll; + end + else + if edCreator.CanFocus then + begin + ActiveControl := edCreator; + edCreator.SelectAll; + end; +end; + +{$IFDEF DELPHI5} +procedure TdxfmAddReportLinkClass.SetColumnSortMark(AIndex: Integer; ASortOrder: TSortOrder); +const + Format: Integer = HDF_IMAGE or HDF_BITMAP_ON_RIGHT; + ImageIndexes: array[TSortOrder] of Integer = (-1, 0, 1); +var + Header: HWND; + HDItem: THDItem; +begin + AssignListViewHeaderImages; + Header := ListViewHeader; + if IsWindow(Header) then + begin + FillChar(HDItem, SizeOf(HDItem), 0); + HDItem.Mask := HDI_FORMAT or HDI_IMAGE; + Header_GetItem(Header, AIndex, HDItem); + if ASortOrder <> soNone then + HDItem.fmt := HDItem.fmt or Format + else + HDItem.fmt := HDItem.fmt and not Format; + HDItem.iImage := ImageIndexes[ASortOrder]; + Header_SetItem(Header, AIndex, HDItem); + end; +end; +{$ENDIF} + +procedure TdxfmAddReportLinkClass.SortColumn(Column: TListColumn; ASortOrder: TSortOrder); +var + Item: TListItem; +begin + dxPSCore.dxPSStartWait; + try + {$IFDEF DELPHI5} + if (FSortedColumnIndex <> Column.Index) and (FSortedColumnIndex <> -1) then + SetColumnSortMark(FSortedColumnIndex, soNone); + {$ENDIF} + FSortedColumnIndex := Column.Index; + if ASortOrder <> soNone then + begin + lvItems.CustomSort(nil, MakeTTag(FSortedColumnIndex)); + {$IFDEF DELPHI5} + SetColumnSortMark(FSortedColumnIndex, ASortOrder); + {$ENDIF} + end; + Item := lvItems.Selected; + if Item <> nil then + Item.MakeVisible(True); + finally + dxPSCore.dxPSStopWait; + end; + lvItems.Invalidate; +end; + +procedure TdxfmAddReportLinkClass.RefreshSorting; +begin + if (FSortedColumnIndex <> -1) and (FSortOrder <> soNone) then + SortColumn(lvItems.Columns[FSortedColumnIndex], FSortOrder); +end; + +procedure TdxfmAddReportLinkClass.UpdateControlsState; +begin + btnDesign.Enabled := CanDesign; + edCaption.Enabled := CanEditCaption; + edCreator.Enabled := CanEditCreator; + btnDescription.Enabled := CanEditDescription; + edName.Enabled := CanEditName; +end; + +{$IFDEF DELPHI5} +procedure TdxfmAddReportLinkClass.AssignListViewHeaderImages; +var + Header: HWND; +begin + Header := ListViewHeader; + if IsWindow(Header) and not IsWindow(Header_GetImageList(Header)) then + Header_SetImageList(Header, ilColumns.Handle); +end; + +procedure TdxfmAddReportLinkClass.ListViewWndProc(var Message: TMessage); +begin + FPrevListViewWndProc(Message); + + if (FSortedColumnIndex <> -1) and (Message.Msg = WM_NOTIFY) then + with TWMNotify(Message).NMHdr^ do + if (hWndFrom = ListViewHeader) and (Code = HDN_ENDTRACK) then + SetColumnSortMark(FSortedColumnIndex, FSortOrder); +end; + +procedure TdxfmAddReportLinkClass.RestoreListViewWndProc; +begin + lvItems.WindowProc := FPrevListViewWndProc; +end; + +procedure TdxfmAddReportLinkClass.SubstituteListViewWndProc; +begin + FPrevListViewWndProc := lvItems.WindowProc; + lvItems.WindowProc := ListViewWndProc; +end; +{$ENDIF} + +procedure TdxfmAddReportLinkClass.CMDialogChar(var Message: TCMDialogChar); +begin + inherited; + if IsAccel(Message.CharCode, tbsItems.Caption) then + begin + Message.Result := 1; + ActiveControl := lvItems; + end; +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSfmLnkDsg.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSfmLnkDsg.dfm new file mode 100644 index 00000000..0f6ec5c9 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSfmLnkDsg.dfm @@ -0,0 +1,938 @@ +object dxfmReportLinkDesignWindow: TdxfmReportLinkDesignWindow + Left = 699 + Top = 105 + BorderStyle = bsDialog + Caption = 'Report Links' + ClientHeight = 343 + ClientWidth = 367 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Icon.Data = { + 0000010001001010100000000000280100001600000028000000100000002000 + 00000100040000000000C0000000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000 + 00000000000000000000000000000FFFFFFFFFF000000F00F00000F000000FFF + FFFFFFF000000F00F00000F000000FFFFFFFFFF000000FFFFFFF0FF000000F00 + FFF080F000000F080F08080000440FF080808088804400000808088888440000 + 008088888844000000088888804400000000000000440000000000000000FFFF + 0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F + 0000000400000000000000000000F8000000FC000000FE040000FFFF0000} + KeyPreview = True + OldCreateOrder = True + OnClose = FormClose + OnKeyDown = FormKeyDown + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object pnlButtons: TPanel + Left = 240 + Top = 0 + Width = 127 + Height = 343 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btnAdd: TButton + Left = 5 + Top = 4 + Width = 98 + Height = 22 + Caption = '&Add...' + TabOrder = 0 + OnClick = AddClick + end + object btnDelete: TButton + Tag = 4 + Left = 5 + Top = 31 + Width = 119 + Height = 22 + Caption = '&Delete' + TabOrder = 2 + OnClick = EditClick + end + object btnShowDesigner: TButton + Left = 5 + Top = 147 + Width = 119 + Height = 22 + Caption = 'Show D&esigner...' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 6 + OnClick = LinkDesignClick + end + object btnSelectAll: TButton + Tag = 6 + Left = 5 + Top = 58 + Width = 119 + Height = 22 + Caption = 'Se&lect All' + TabOrder = 3 + OnClick = EditClick + end + object btnRestoreOriginal: TButton + Left = 5 + Top = 233 + Width = 119 + Height = 22 + Caption = 'Rest&ore Or&iginal' + TabOrder = 9 + OnClick = RestoreOriginalClick + end + object btnChangeComponent: TButton + Tag = 3 + Left = 5 + Top = 174 + Width = 119 + Height = 22 + Caption = 'C&hange Component...' + TabOrder = 7 + OnClick = LinkChangeComponentClick + end + object btnPrintPreview: TButton + Tag = 2 + Left = 5 + Top = 291 + Width = 119 + Height = 22 + Caption = 'Pre&view...' + TabOrder = 11 + OnClick = PrintPreviewClick + end + object btnPrint: TButton + Tag = 3 + Left = 5 + Top = 318 + Width = 119 + Height = 22 + Caption = 'Print...' + TabOrder = 12 + OnClick = PrintClick + end + object btnPageSetup: TButton + Tag = 1 + Left = 5 + Top = 264 + Width = 119 + Height = 22 + Caption = 'Pa&ge Setup...' + TabOrder = 10 + OnClick = PageSetupClick + end + object btnMoveUp: TButton + Left = 5 + Top = 89 + Width = 119 + Height = 22 + Caption = 'Move &Up' + TabOrder = 4 + OnClick = MoveUpClick + end + object btnMoveDown: TButton + Tag = 1 + Left = 5 + Top = 116 + Width = 119 + Height = 22 + Caption = 'Move Dow&n' + TabOrder = 5 + OnClick = MoveDownClick + end + object btnRestoreDefaults: TButton + Left = 5 + Top = 206 + Width = 119 + Height = 22 + Caption = 'Rest&ore Defaults' + TabOrder = 8 + OnClick = RestoreDefaultsClick + end + object btnDropDownMenu: TButton + Left = 103 + Top = 4 + Width = 21 + Height = 22 + Caption = '6' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -19 + Font.Name = 'Marlett' + Font.Style = [] + ParentFont = False + TabOrder = 1 + OnClick = btnDropDownMenuClick + end + end + object lbxLinks: TListBox + Left = 0 + Top = 0 + Width = 240 + Height = 343 + Style = lbOwnerDrawVariable + Align = alClient + Ctl3D = True + DragMode = dmAutomatic + ItemHeight = 16 + MultiSelect = True + ParentCtl3D = False + PopupMenu = pmLinks + TabOrder = 1 + OnClick = lbxLinksClick + OnDblClick = lbxLinksDblClick + OnDragDrop = lbxLinksDragDrop + OnDragOver = lbxLinksDragOver + OnDrawItem = lbxLinksDrawItem + OnEndDrag = lbxLinksEndDrag + OnKeyPress = lbxLinksKeyPress + OnMeasureItem = lbxLinksMeasureItem + OnStartDrag = lbxLinksStartDrag + end + object pmLinks: TPopupMenu + Images = ilLinks + OnPopup = pmLinksPopup + Left = 7 + Top = 6 + object miAdd: TMenuItem + Caption = '&Add...' + ImageIndex = 0 + ShortCut = 45 + OnClick = AddClick + end + object miAddComposition: TMenuItem + Caption = 'Add Composition...' + ImageIndex = 1 + OnClick = AddCompositionClick + end + object miLine7: TMenuItem + Caption = '-' + end + object miAddExisting: TMenuItem + Caption = 'Add Existing' + ShortCut = 32813 + OnClick = AddExistingClick + end + object miAddStandard: TMenuItem + Caption = 'Add Standard Link...' + ShortCut = 16429 + OnClick = AddStandardClick + end + object miLine5: TMenuItem + Caption = '-' + end + object miEdit: TMenuItem + Caption = '&Edit' + object miCut: TMenuItem + Tag = 2 + Caption = 'Cu&t' + ImageIndex = 3 + ShortCut = 16472 + OnClick = EditClick + end + object miCopy: TMenuItem + Tag = 1 + Caption = '&Copy' + ImageIndex = 2 + ShortCut = 16451 + OnClick = EditClick + end + object miPaste: TMenuItem + Tag = 3 + Caption = '&Paste' + ImageIndex = 4 + ShortCut = 16470 + OnClick = EditClick + end + object miDelete: TMenuItem + Tag = 4 + Caption = '&Delete' + ImageIndex = 5 + ShortCut = 46 + OnClick = EditClick + end + object N3: TMenuItem + Caption = '-' + end + object miSelectAll: TMenuItem + Tag = 6 + Caption = 'Se&lect All' + ShortCut = 16449 + OnClick = EditClick + end + end + object N2: TMenuItem + Caption = '-' + end + object miMoveUp: TMenuItem + Caption = 'Move &Up' + ImageIndex = 10 + ShortCut = 16422 + OnClick = MoveUpClick + end + object miMoveDown: TMenuItem + Caption = 'Move Dow&n' + ImageIndex = 11 + ShortCut = 16424 + OnClick = MoveDownClick + end + object miLine1: TMenuItem + Caption = '-' + end + object miShowDesigner: TMenuItem + Caption = 'Show Designer...' + Default = True + ImageIndex = 6 + ShortCut = 16397 + OnClick = LinkDesignClick + end + object miSetAsCurrent: TMenuItem + Caption = '&Make Current' + ShortCut = 16416 + OnClick = SetAsCurrentClick + end + object miChangeComponent: TMenuItem + Caption = 'C&hange Component...' + OnClick = LinkChangeComponentClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miRestoreDefaults: TMenuItem + Caption = 'Rest&ore Defaults' + ShortCut = 16463 + OnClick = RestoreDefaultsClick + end + object miRestoreOriginal: TMenuItem + Caption = 'Rest&ore Or&iginal' + ShortCut = 16457 + OnClick = RestoreOriginalClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miPageSetup: TMenuItem + Tag = 1 + Caption = 'Pa&ge Setup...' + ImageIndex = 7 + OnClick = PageSetupClick + end + object miPrintPreview: TMenuItem + Tag = 2 + Caption = 'Print Pre&view...' + ImageIndex = 8 + OnClick = PrintPreviewClick + end + object miPrint: TMenuItem + Tag = 3 + Caption = '&Print...' + ImageIndex = 9 + ShortCut = 16464 + OnClick = PrintClick + end + object N1: TMenuItem + Caption = '-' + end + object miBackground: TMenuItem + Caption = 'Bac&kground' + object miBackgroundEffects: TMenuItem + Tag = 4 + Caption = 'E&ffects...' + ImageIndex = 12 + OnClick = BackgroundClick + end + object miBackgroundClear: TMenuItem + Tag = 5 + Caption = 'Clear' + OnClick = ClearBackgroundClick + end + end + object miLine: TMenuItem + Caption = '-' + end + object miShowButtons: TMenuItem + Caption = 'Show &Button Bar' + Checked = True + OnClick = ShowButtonsClick + end + end + object ilLinks: TImageList + Left = 63 + Top = 6 + Bitmap = { + 494C01010D000E00040010001000FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000004000000001002000000000000040 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084848400FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084848400FFFF + FF000000000000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484000000 + 00008484840000000000FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400848484008484840000000000FFFFFF00FFFFFF0000FFFF0084848400FFFF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C6C6C600C6C6 + C600C6C6C600848484008484840000000000FFFFFF00FFFFFF00840000008484 + 8400FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00C6C6C600C6C6 + C600C6C6C600C6C6C60084848400848484000000000000FFFF00840000008400 + 0000FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000C6C6C600FFFFFF00FFFFFF00C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084000000840000008400 + 0000FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000C6C6C600FFFFFF00FFFF + FF00C6C6C60000000000C6C6C600C6C6C6008484840084000000840000008400 + 0000FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C6C6C600FFFF + FF00000000008400000000000000C6C6C6008400000084000000840000008484 + 8400FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C600FFFFFF0084000000C6C6C60084848400840000008400000084848400FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000840000000000 + 0000C6C6C60084000000848484000000000084848400FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084000000C6C6 + C60000000000840000000000000084848400FFFFFF0000FFFF00FFFFFF008484 + 8400C6C6C6000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084000000C6C6 + C600C6C6C600840000008484840000FFFF00FFFFFF00FFFFFF00FFFFFF008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484008400 + 0000840000008484840084848400848484008484840084848400848484008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C6000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C60000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000084848400C6C6C600C6C6C6008484 + 84000000000084848400000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C60000FFFF0000FFFF0000FFFF00C6C6C600C6C6 + C600000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000084848400C6C6C600C6C6C600FFFF00008484 + 84008484840000000000000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084848400C6C6C600C6C6 + C60000000000C6C6C60000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848400000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000C6C6C600C6C6C600C6C6C600C6C6C6008484 + 8400C6C6C6000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C600C6C6C600000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000C6C6C600FFFF0000C6C6C600C6C6C6008484 + 8400C6C6C60000000000000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C60000000000C6C6C600000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008484000084840000848400008484000084840000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000084848400FFFF0000FFFF0000C6C6C6008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C60000000000C6C6C60000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000848400008484000084840000848400008484000084840000848400000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000084848400C6C6C600C6C6C6008484 + 840000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000C6C6C60000000000C6C6C600848484000000000000000000000000000000 + 0000848400008484000084840000848400008484000084840000848400000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008484 + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000000000008484000084840000848400008484000084840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000084848400000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + 0000848400000000000000000000848484000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFF00008484 + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848400000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000C6C6C600000000000000 + 0000000000000000000000000000000000000000000084848400000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + 0000848400000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00848484008484 + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000007B7B7B007B7B7B007B7B7B0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000840000008400000084000000840000008400 + 0000840000008400000084000000840000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007B7B7B00000000007B7B + 7B007B7B7B000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00840000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000007B7B + 7B00000000000000000000000000000000000000000000000000000000000000 + 0000000000007B7B7B0000000000000000000000000000000000000000000000 + 0000000000008400000084000000840000008400000084000000000000000000 + 0000000000000000000000000000000000000000000084848400008484008484 + 8400008484008484840084000000FFFFFF008400000084000000840000008400 + 00008400000084000000FFFFFF00840000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007B7B7B000000 + 00000000000000000000BDBDBD00BDBDBD00BDBDBD0000000000000000000000 + 000000000000000000007B7B7B00000000008400000084000000840000008400 + 0000840000008400000084000000840000008400000084000000840000008400 + 0000840000008400000084000000000000000000000000848400848484000084 + 8400848484000084840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00840000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF000000000000000000000000007B7B7B0000000000BDBD + BD007B7B7B000000000000000000BDBDBD00BDBDBD00000000007B7B7B00BDBD + BD0000000000000000007B7B7B00000000008400000084000000840000008400 + 000084000000840000008484840084000000FFFFFF0084000000840000008400 + 0000840000008400000084000000000000000000000084848400008484008484 + 8400008484008484840084000000FFFFFF00840000008400000084000000FFFF + FF00840000008400000084000000840000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF0000000000000000000000000000000000000000007B7B7B00BDBD + BD007B7B7B00BDBDBD00BDBDBD007B7B7B0000000000BDBDBD007B7B7B007B7B + 7B007B7B7B007B7B7B007B7B7B00000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000848400848484000084 + 8400848484000084840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0084000000FFFFFF0084000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000BDBDBD00BDBDBD0000000000FFFFFF00FFFFFF0000000000BDBDBD000000 + 00000000000000000000000000007B7B7B008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000084848400008484008484 + 8400008484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000007B7B7B0000000000BDBDBD000000 + 0000BDBDBD0000000000BDBDBD00BDBDBD00BDBDBD00FFFFFF007B7B7B000000 + 0000BDBDBD00BDBDBD00000000007B7B7B008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000848400848484000084 + 8400848484000084840084000000840000008400000084000000840000008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000007B7B7B0000000000BDBDBD00BDBD + BD00FFFFFF00000000007B7B7B0000000000BDBDBD00FFFFFF007B7B7B00BDBD + BD00BDBDBD00BDBDBD00000000007B7B7B008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000084848400008484008484 + 8400008484008484840000848400848484000084840084848400008484008484 + 8400008484000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000007B7B7B0000000000000000000000 + 0000FFFFFF00000000007B7B7B007B7B7B00BDBDBD0000000000BDBDBD000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000848400848484000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000BDBDBD00FFFFFF00000000000000000000000000BDBDBD00BDBDBD000000 + 0000000000007B7B7B0000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000084848400848484000000 + 0000C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600000000008484 + 8400008484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 00000000000000000000000000000000000000000000000000007B7B7B00BDBD + BD007B7B7B00BDBDBD00FFFFFF00FFFFFF00BDBDBD00BDBDBD007B7B7B007B7B + 7B007B7B7B00000000007B7B7B00000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000848400848484000084 + 84000000000000FFFF00000000000000000000FFFF0000000000848484000084 + 8400848484000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF00000000000000000000000000000000007B7B7B0000000000BDBD + BD007B7B7B000000000000000000BDBDBD000000000000000000BDBDBD00BDBD + BD00000000007B7B7B0000000000000000008400000084000000848484008484 + 84008484840084848400840000000000000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000000000 + 0000000000000000000000FFFF0000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF00000000000000000000000000000000007B7B7B000000 + 00007B7B7B0000000000BDBDBD00BDBDBD00BDBDBD00000000007B7B7B000000 + 00007B7B7B000000000000000000000000000000000084000000840000008400 + 0000840000008400000000000000000000000000000084000000840000008400 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000007B7B + 7B0000000000000000000000000000000000000000007B7B7B00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000007B7B7B007B7B7B007B7B7B0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000840000008400000084000000840000008400 + 0000840000008400000084000000000000000000000000000000000000008400 + 0000000000000000000084000000000000000000000084000000840000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00C0C0C000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000000000000000008400 + 0000000000000000000084000000000000008400000000000000000000008400 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000FFFFFF00FF00 + 0000FF000000C0C0C000FFFFFF00FFFFFF00FFFFFF0000FFFF000000000000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF000000000000000000000000000000 + 000000000000FFFFFF0084000000000000000000000000000000000000008400 + 0000000000000000000084000000000000008400000000000000000000008400 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00000000000000000000000000000000000000000000000000C0C0C000FF00 + 0000FF000000C0C0C000C0C0C000C0C0C000FFFFFF00FFFFFF0000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000000000000000000000 + 0000840000008400000084000000000000008400000000000000000000008400 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00C0C0C000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF000000000000000000000000000000000000000000FF000000FF000000FF00 + 0000FF000000FF000000FF000000C0C0C000FFFFFF00FFFFFF000000000000FF + FF000000000000FFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF000000000000000000000000000000 + 000000000000FFFFFF0084000000000000000000000000000000000000000000 + 0000000000000000000084000000000000008400000084000000840000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FF000000FF000000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF000000000000000000000000000000000000000000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FFFFFF00FFFFFF00FFFFFF0000000000FFFF + FF0000000000FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000000000000000000000 + 0000000000000000000084000000000000008400000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C0C0 + C000FF000000FF000000C0C0C000C0C0C000C0C0C000FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000FFFFFF00FF00 + 0000FF000000C0C0C000FFFFFF0000000000000000000000000000000000FFFF + FF000000000000FFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF000000000000000000FFFFFF008400 + 0000840000008400000084000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000C0C0C000FFFFFF00FFFFFF0000FF + FF00000000000000000000000000000000000000000000000000FFFFFF00FF00 + 0000FF000000FFFFFF00FFFFFF0000000000FFFFFF0000000000FFFFFF00FFFF + FF0000000000FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 0000FFFFFF008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 000000000000FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FF000000FF000000C0C0C000FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000000000FFFFFF000000 + 0000FFFFFF00FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000FFFFFF000000000084000000840000008400000084000000840000008400 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FF000000FF000000FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000400000000100010000000000000200000000000000000000 + 000000000000000000000000FFFFFF00FFFF000000000000C001000000000000 + C001000000000000C001000000000000C001000000000000C001000000000000 + 8001000000000000000100000000000000010000000000000001000000000000 + 8001000000000000C001000000000000C001000000000000C003000000000000 + C007000000000000C00F000000000000FFFFFFFFFFFFFFFF000CC007FFFFFFFF + 00088003FFFFFFFF00010001FFFFFFFF00030001F83FFEFF00030001F83FFC7F + 00030000F83FF83F00030000F83FF01F00038000C007E00F0007C000E00FC007 + 000FE000F01FF83F000F8000F83FF83F000F8007FC7FF83F001F8000FEFFF83F + 003FF000FFFFFFFF007FF800FFFFFFFFFFFFFFFFFC7FFFFFFC00FFFFFC27FFFF + 8000FFF9EC23F83F0000E7FFC40100010000C3F3800100010000C3E7C0010001 + 0001E1C7E00000010003F08F000000010003F81F000000010003FC3F00030001 + 0003F81FE00300010003F09FC00100010003C1C780030101800783E3C4078383 + F87F8FF1EC3FFFFFFFFFFFFFFC7FFFFFFFFFFFFFFFFFFFFFFFFF801FFFFFF3FF + C007801FFC01ED9FC0078007FC01ED6FC0078007FC01ED6FC00780010001F16F + C00780010001FD1FC00780010001FC7FC00780010001FEFFC00780010003FC7F + C00780010007FD7FC0078001000FF93FC00FE00100FFFBBFC01FE00301FFFBBF + C03FF80703FFFBBFFFFFF80FFFFFFFFF} + end + object pmAdd: TPopupMenu + Images = ilLinks + OnPopup = pmLinksPopup + Left = 35 + Top = 6 + object miAdd1: TMenuItem + Caption = '&Add...' + Default = True + ImageIndex = 0 + ShortCut = 45 + OnClick = AddClick + end + object miAddComposition1: TMenuItem + Caption = 'Add Composition...' + Hint = 'miAddComposition' + ImageIndex = 1 + OnClick = AddCompositionClick + end + object miLine6: TMenuItem + Caption = '-' + end + object miAddExisting1: TMenuItem + Caption = 'Add Existing' + ShortCut = 32813 + OnClick = AddExistingClick + end + object miAddStandard1: TMenuItem + Caption = 'Add Standard...' + ShortCut = 16429 + OnClick = AddStandardClick + end + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSfmLnkDsg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSfmLnkDsg.pas new file mode 100644 index 00000000..032f7a3a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSfmLnkDsg.pas @@ -0,0 +1,1886 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSfmLnkDsg; + +interface + +{$I cxVer.inc} + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignWindows, + {$ELSE} + DsgnIntf, DsgnWnds, LibIntf, + {$ENDIF} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + Menus, StdCtrls, ExtCtrls, ComCtrls, Buttons, ImgList, dxPSfmLnkAdd, dxPSCore, + dxPSDsgProxies, dxPSGlbl; + +type + TdxfmReportLinkDesignWindow = class(TDesignWindow) + pmLinks: TPopupMenu; + pnlButtons: TPanel; + btnAdd: TButton; + btnDelete: TButton; + btnShowDesigner: TButton; + miAdd: TMenuItem; + miDelete: TMenuItem; + miLine1: TMenuItem; + miShowDesigner: TMenuItem; + miLine2: TMenuItem; + miSelectAll: TMenuItem; + btnSelectAll: TButton; + btnRestoreOriginal: TButton; + btnChangeComponent: TButton; + miChangeComponent: TMenuItem; + btnPrintPreview: TButton; + btnPrint: TButton; + miPrintPreview: TMenuItem; + miPrint: TMenuItem; + btnPageSetup: TButton; + miPageSetup: TMenuItem; + miLine3: TMenuItem; + miCopy: TMenuItem; + miCut: TMenuItem; + miPaste: TMenuItem; + miRestoreDefaults: TMenuItem; + miLine: TMenuItem; + miShowButtons: TMenuItem; + miLine5: TMenuItem; + ilLinks: TImageList; + btnMoveUp: TButton; + btnMoveDown: TButton; + miMoveUp: TMenuItem; + miMoveDown: TMenuItem; + miBackgroundEffects: TMenuItem; + miAddStandard: TMenuItem; + N1: TMenuItem; + miBackgroundClear: TMenuItem; + N2: TMenuItem; + btnRestoreDefaults: TButton; + miRestoreOriginal: TMenuItem; + miSetAsCurrent: TMenuItem; + lbxLinks: TListBox; + miEdit: TMenuItem; + N3: TMenuItem; + miBackground: TMenuItem; + miAddExisting: TMenuItem; + pmAdd: TPopupMenu; + miAdd1: TMenuItem; + miAddStandard1: TMenuItem; + miAddExisting1: TMenuItem; + btnDropDownMenu: TButton; + miLine6: TMenuItem; + miAddComposition1: TMenuItem; + miAddComposition: TMenuItem; + miLine7: TMenuItem; + procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure AddClick(Sender: TObject); + procedure AddStandardClick(Sender: TObject); + procedure AddExistingClick(Sender: TObject); + procedure lbxLinksClick(Sender: TObject); + procedure LinkDesignClick(Sender: TObject); + procedure SetAsCurrentClick(Sender: TObject); + procedure LinkChangeComponentClick(Sender: TObject); + procedure RestoreDefaultsClick(Sender: TObject); + procedure RestoreOriginalClick(Sender: TObject); + procedure PageSetupClick(Sender: TObject); + procedure PrintPreviewClick(Sender: TObject); + procedure PrintClick(Sender: TObject); + procedure lbxLinksDblClick(Sender: TObject); + procedure lbxLinksStartDrag(Sender: TObject; var DragObject: TDragObject); + procedure lbxLinksEndDrag(Sender, Target: TObject; X, Y: Integer); + procedure lbxLinksDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure lbxLinksDragDrop(Sender, Source: TObject; X, Y: Integer); + procedure lbxLinksKeyPress(Sender: TObject; var Key: Char); + procedure EditClick(Sender: TObject); + procedure MoveUpClick(Sender: TObject); + procedure MoveDownClick(Sender: TObject); + procedure lbxLinksDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure BackgroundClick(Sender: TObject); + procedure ClearBackgroundClick(Sender: TObject); + procedure pmLinksPopup(Sender: TObject); + procedure ShowButtonsClick(Sender: TObject); + procedure btnDropDownMenuClick(Sender: TObject); + procedure FormResize(Sender: TObject); + procedure lbxLinksMeasureItem(Control: TWinControl; Index: Integer; + var Height: Integer); + procedure AddCompositionClick(Sender: TObject); + private + FController: TCustomdxComponentPrinter; + FSaveCursor: TCursor; + FSaveDragIndex: Integer; + + function GetControllerDesigner: TAbstractdxReportLinkDesigner; + function GetCurrentLink: TBasedxReportLink; + function GetLink(Index: Integer): TBasedxReportLink; + function GetLinkCount: Integer; + function GetLinkDescription(Index: Integer): string; + function GetRegistryPath: string; + function GetSelected(Index: Integer): Boolean; + function GetSelectedCount: Integer; + procedure SetController(Value: TCustomdxComponentPrinter); + procedure SetSelected(Index: Integer; Value: Boolean); + + function CalculateLinkCaptionWidth: Integer; + function CalculateLinkDescriptionOffset: Integer; + function CalculateLinkDescriptionWidth: Integer; + function CalculateLinkMaxRowWidth: Integer; + + function CanAdd: Boolean; + function CanAddExisting: Boolean; + function CanBackgroundClear: Boolean; + function CanBackgroundEffects: Boolean; + function CanChangeComponent: Boolean; + function CanCopy: Boolean; + function CanCut: Boolean; + function CanDelete: Boolean; + function CanMoveDown: Boolean; + function CanMoveUp: Boolean; + function CanPaste: Boolean; + function CanPageSetup: Boolean; + function CanPrint: Boolean; + function CanPrintPreview: Boolean; + function CanRestoreDefaults: Boolean; + function CanRestoreOriginal: Boolean; + function CanSelectAll: Boolean; + function CanSetAsCurrent: Boolean; + function CanShowDesigner: Boolean; + {$IFDEF DELPHI5} + procedure CheckAddLink; + {$ENDIF} + procedure CheckDeleteLink; + procedure Copy; + procedure Cut; + procedure Delete; + procedure DeleteItem(AItem: TBasedxReportLink); + procedure DrawDragRect; + function GetMinWindowSize: TPoint; + procedure GetSelections(const ASelections: TdxDesignSelectionList); + function IndexOf(AItem: TBasedxReportLink): Integer; + procedure InternalAddLink(ALinkClass: TdxReportLinkClass; AComponent: TComponent; + const AName, ACaption, ACreator, ADescription: string; AShowDesigner: Boolean); + procedure MakeLinkable(AComponent: TComponent); + procedure MoveSelection(ADelta: Integer); + procedure Paste; + procedure PrepareAddExistingItem(AMenuItem: TMenuItem); + procedure RefreshList; + procedure RestoreLayout; + procedure SaveLayout; + procedure Select(AItem: TPersistent; AddToSelection: Boolean); + procedure SelectAll; + procedure SelectController; + procedure StartWait; + procedure StopWait; + procedure UpdateCaption; + procedure UpdateControlsState; + procedure UpdateHScrollBar; + procedure UpdateItem(AItem: TBasedxReportLink); + procedure UpdateMenuState; + procedure UpdateSelections(const ASelections: TdxDesignSelectionList); + procedure WMAppCommand(var Message: TMessage); message WM_APPCOMMAND; + procedure WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); message WM_GETMINMAXINFO; + procedure WMNCCreate(var Message: TWMNCCreate); message WM_NCCREATE; + procedure WMNCDestroy(var Message: TWMNCCreate); message WM_NCDESTROY; + protected + procedure Activated; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + function UniqueName(Comp: TComponent): string; override; + property LinkDescriptions[Index: Integer]: string read GetLinkDescription; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + {$IFDEF DELPHI6} + function EditAction(Action: TEditAction): Boolean; override; + procedure ItemDeleted(const ADesigner: IDesigner; Item: TPersistent); override; + procedure ItemsModified(const Designer: IDesigner); override; + procedure SelectionChanged(const ADesigner: IDesigner; const ASelection: IDesignerSelections); override; + {$ELSE} + procedure ComponentDeleted(Component: IPersistent); override; + procedure EditAction(Action: TEditAction); override; + procedure SelectionChanged(ASelection: {$IFDEF DELPHI5} TDesignerSelectionList {$ELSE} TComponentList{$ENDIF}); override; + procedure FormModified; override; + {$ENDIF} + function GetEditState: TEditState; override; + + property Controller: TCustomdxComponentPrinter read FController write SetController; + property ControllerDesigner: TAbstractdxReportLinkDesigner read GetControllerDesigner; + property CurrentLink: TBasedxReportLink read GetCurrentLink; + property LinkCount: Integer read GetLinkCount; + property Links[Index: Integer]: TBasedxReportLink read GetLink; + property RegistryPath: string read GetRegistryPath; + property Selected[Index: Integer]: Boolean read GetSelected write SetSelected; + property SelectedCount: Integer read GetSelectedCount; + end; + +procedure dxShowReportLinkDesigner(AComponentPrinter: TCustomdxComponentPrinter; + AFormDesigner: TFormDesigner); +function dxReportLinkUniqueName(AComponentPrinter: TCustomdxComponentPrinter; + AComponent: TComponent): string; + +implementation + +{$R *.DFM} + +uses + {$IFDEF DELPHI5} + DesignConst, + {$IFDEF DELPHI6} + ComponentDesigner, + {$ENDIF} + {$ELSE} + LibConst, + {$ENDIF} + Registry, TypInfo, CommCtrl, ColnEdit, cxClasses, dxPSRes, dxPrnPg, dxBkgnd, + dxPSPrVwDsg, dxPSPopupMan, dxPSfmLnkAddE, dxPSUtl, dxPSContainerLnk, + dxPSCompsProvider; + +const + sdxButtonBar = 'ButtonBar'; // Don't localize + sdxWidth = 'Width'; // Don't localize + sdxHeight = 'Height'; // Don't localize + + sdxCantPasteComponent = 'Can''t paste component %s here !'; + sdxCantCreateUniqueName = 'Can''t create unique name for %s.'; + sdxLinkDesigner = 'Editing %s%s%s Links'; + sdxChangeComponent = 'Change Component'; + + sdxLinked = 'Linked'; + sdxLinkedTo = 'Linked to'; + sdxUnassigned = 'Unassigned'; + +type + TdxPSDesignTimedxComponentsProvider = class(TAbstractdxPSComponentsProvider) + private + FComponents: TStrings; + FExistingComponents: TList; + FOptions: TdxPSGetComponentOptions; + FReportLink: TBasedxReportLink; + procedure AppendComponent(AComponent: TComponent; const APathName: string); + procedure EnumComponentsProc(const S: string); + procedure EnumReportLinksProc(const S: string); + procedure GetExistingComponents; + function IsComponentAccessible(AComponent: TComponent): Boolean; + public + function ActiveDesigner: TFormDesigner; + procedure GetComponents(AComponentPrinter: TdxComponentPrinter; AReportLink: TBasedxReportLink; + AComponents: TStrings; AnOptions: TdxPSGetComponentOptions); override; + end; + + TdxReportLinkDesigner = class(TAbstractdxReportLinkDesigner) + private + FDesignWindow: TdxfmReportLinkDesignWindow; + FFormDesigner: TFormDesigner; + FUpdateCount: Integer; + function GetDesignWindow: TdxfmReportLinkDesignWindow; + procedure Activate; + protected + procedure Modified; override; + procedure Update(AItem: TBasedxReportLink); override; + public + constructor Create(AComponentPrinter: TCustomdxComponentPrinter; AFormDesigner: TFormDesigner); + destructor Destroy; override; + + procedure BeginUpdate; override; + procedure CancelUpdate; override; + procedure EndUpdate; override; + + property DesignWindow: TdxfmReportLinkDesignWindow read GetDesignWindow; + property FormDesigner: TFormDesigner read FFormDesigner; + end; + +procedure dxShowReportLinkDesigner(AComponentPrinter: TCustomdxComponentPrinter; AFormDesigner: TFormDesigner); +begin + if AComponentPrinter.ReportLinkDesigner = nil then + TdxReportLinkDesigner.Create(AComponentPrinter, AFormDesigner); + TdxReportLinkDesigner(AComponentPrinter.ReportLinkDesigner).Activate; +end; + +function dxReportLinkUniqueName(AComponentPrinter: TCustomdxComponentPrinter; + AComponent: TComponent): string; +var + I, J: Integer; + S: string; + NameExists: Boolean; + Item: TBasedxReportLink; +begin + S := AComponentPrinter.Name + AComponentPrinter.GetNewLinkName(TBasedxReportLink(AComponent)); + for I := 1 to High(Integer) do + begin + Result := Format(S, [I]); + NameExists := False; + Item := AComponentPrinter.LinkByName(Result); + if Item = nil then + begin + for J := 0 to AComponentPrinter.Owner.ComponentCount - 1 do + if CompareText(AComponentPrinter.Owner.Components[J].Name, Result) = 0 then + begin + NameExists := True; + Break; + end; + if not NameExists then Exit; + end; + end; + raise Exception.CreateFmt(sdxCantCreateUniqueName, [AComponent.ClassName]); +end; + +{ TdxPSDesignTimedxComponentsProvider } + +function TdxPSDesignTimedxComponentsProvider.ActiveDesigner: TFormDesigner; +begin + {$IFDEF DELPHI6} + Result := ComponentDesigner.ActiveRoot.GetDesigner; + {$ELSE} + Result := TIForm(CompLib.GetActiveForm).Designer; + {$ENDIF} +end; + +procedure TdxPSDesignTimedxComponentsProvider.GetComponents(AComponentPrinter: TdxComponentPrinter; + AReportLink: TBasedxReportLink; AComponents: TStrings; AnOptions: TdxPSGetComponentOptions); +var + Root: TComponent; +begin + if ActiveDesigner = nil then Exit; + + FComponents := AComponents; + FOptions := AnOptions; + FReportLink := AReportLink; + + FExistingComponents := nil; + if gcoExcludeExisting in FOptions then FExistingComponents := TList.Create; + try + if FExistingComponents <> nil then GetExistingComponents; + Root := ActiveDesigner.GetRoot; + if IsComponentAccessible(Root) then AppendComponent(Root, Root.Name); + ActiveDesigner.GetComponentNames(GetTypeData(PTypeInfo(TComponent.ClassInfo)), EnumComponentsProc); + finally + FreeAndNil(FExistingComponents); + end; +end; + +procedure TdxPSDesignTimedxComponentsProvider.AppendComponent(AComponent: TComponent; + const APathName: string); +var + ComponentItem: TdxComponentItem; +begin + if (not (gcoExcludeOutOfActiveForm in FOptions) or (Pos('.', APathName) = 0)) and + (((FReportLink = nil) and dxPSIsSupportedCompClass(AComponent)) or + ((FReportLink <> nil) and FReportLink.Supports(AComponent) and + (FReportLink.Component <> AComponent))) then + begin + ComponentItem := TdxComponentItem.Create(AComponent, APathName, AComponent.ClassName); + FComponents.AddObject(ComponentItem.Caption, ComponentItem); + end; +end; + +procedure TdxPSDesignTimedxComponentsProvider.EnumComponentsProc(const S: string); +var + Component: TComponent; +begin + if ActiveDesigner <> nil then + begin + Component := ActiveDesigner.GetComponent(S); + if IsComponentAccessible(Component) then AppendComponent(Component, S); + end; +end; + +procedure TdxPSDesignTimedxComponentsProvider.EnumReportLinksProc(const S: string); +var + Component: TComponent; +begin + if ActiveDesigner <> nil then + begin + Component := ActiveDesigner.GetComponent(S); + if (Component is TBasedxReportLink) and (TBasedxReportLink(Component).Component <> nil) then + FExistingComponents.Add(TBasedxReportLink(Component).Component); + end; +end; + +procedure TdxPSDesignTimedxComponentsProvider.GetExistingComponents; +begin + if ActiveDesigner <> nil then + ActiveDesigner.GetComponentNames(GetTypeData(TComponent.ClassInfo), EnumReportLinksProc); +end; + +function TdxPSDesignTimedxComponentsProvider.IsComponentAccessible(AComponent: TComponent): Boolean; +var + Inaccessible: Boolean; +begin + Inaccessible := ((AComponent = nil) or (AComponent is TBasedxReportLink) or (AComponent is TCustomdxComponentPrinter)) or + ((FExistingComponents <> nil) and (FExistingComponents.IndexOf(AComponent) <> -1)) or + ((gcoHideCustomContainers in FOptions) and dxPSContainerLnk.dxPSIsComponentContainer(AComponent)); + Result := not Inaccessible; +end; + +{ TdxReportLinkDesigner } + +constructor TdxReportLinkDesigner.Create(AComponentPrinter: TCustomdxComponentPrinter; + AFormDesigner: TFormDesigner); +begin + inherited Create(AComponentPrinter); + FFormDesigner := AFormDesigner; +end; + +destructor TdxReportLinkDesigner.Destroy; +begin + if FDesignWindow <> nil then + begin + FDesignWindow.Designer := nil; + FDesignWindow.Free; + end; + inherited Destroy; +end; + +procedure TdxReportLinkDesigner.BeginUpdate; +begin + Inc(FUpdateCount); +end; + +procedure TdxReportLinkDesigner.CancelUpdate; +begin + if FUpdateCount <> 0 then Dec(FUpdateCount); +end; + +procedure TdxReportLinkDesigner.EndUpdate; +begin + if FUpdateCount <> 0 then + begin + Dec(FUpdateCount); + if FUpdateCount = 0 then Update(nil); + end; +end; + +function TdxReportLinkDesigner.GetDesignWindow: TdxfmReportLinkDesignWindow; +begin + if FDesignWindow = nil then + begin + FDesignWindow := TdxfmReportLinkDesignWindow.Create(nil); + FDesignWindow.Designer := FormDesigner; + FDesignWindow.Controller := ComponentPrinter; + end; + Result := FDesignWindow; +end; + +procedure TdxReportLinkDesigner.Activate; +begin + DesignWindow.Show; +end; + +procedure TdxReportLinkDesigner.Modified; +begin + if FormDesigner <> nil then FormDesigner.Modified; +end; + +procedure TdxReportLinkDesigner.Update(AItem: TBasedxReportLink); +begin + if (FUpdateCount = 0) and (FDesignWindow <> nil) then + DesignWindow.UpdateItem(AItem); +end; + +{ TdxfmReportLinkDesigner } + +constructor TdxfmReportLinkDesignWindow.Create(AOwner: TComponent); + + function MakeTTag(AnAction: TEditAction): Integer ; + begin + Result := Integer(AnAction); + end; + +begin + HelpContext := dxPSGlbl.dxhcReportLinkDesignWindow; + inherited; + + miCut.Tag := MakeTTag(eaCut); + miCopy.Tag := MakeTTag(eaCopy); + miPaste.Tag := MakeTTag(eaPaste); + miDelete.Tag := MakeTTag(eaDelete); + miSelectAll.Tag := MakeTTag(eaSelectAll); + + btnDelete.Tag := MakeTTag(eaDelete); + btnSelectAll.Tag := MakeTTag(eaSelectAll); + + RestoreLayout; + dxPSPopupMenuController.RegisterControl(lbxLinks); +end; + +destructor TdxfmReportLinkDesignWindow.Destroy; +begin + dxPSPopupMenuController.UnregisterControl(lbxLinks); + SaveLayout; + if ControllerDesigner <> nil then + TdxReportLinkDesigner(ControllerDesigner).FDesignWindow := nil; + inherited Destroy; +end; + +procedure TdxfmReportLinkDesignWindow.FormKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +var + MenuItem: TMenuItem; +begin + MenuItem := pmLinks.FindItem(Key, fkShortCut); + if (MenuItem <> nil) and MenuItem.Enabled and MenuItem.Visible then + begin + MenuItem.Click; + Key := 0; + end + else + if Key = VK_ESCAPE then + begin + Close; + Key := 0; + end; +end; + +procedure TdxfmReportLinkDesignWindow.FormResize(Sender: TObject); +begin + UpdateHScrollBar; +end; + +procedure TdxfmReportLinkDesignWindow.FormClose(Sender: TObject; + var Action: TCloseAction); +begin + if not (csDestroying in Controller.ComponentState) then + SelectController; + Action := caFree; +end; + +procedure TdxfmReportLinkDesignWindow.AddClick(Sender: TObject); +var + Data: TdxAddReportLinkDlgData; + I: Integer; + Component: TComponent; + LinkClass: TdxReportLinkClass; +begin + {$IFDEF DELPHI5} + CheckAddLink; + {$ENDIF} + FillChar(Data, SizeOf(TdxAddReportLinkDlgData), 0); + Data.Options := [adoShowDesignButton..adoShowCreatorEdit]; + Data.ReportLinkName := UniqueName(nil); + Data.ReportLinkCaption := cxGetResourceString(@sdxNewReport); + Data.ReportLinkCreator := dxPSUtl.GetUserName; + Data.ComponentPrinter := TdxComponentPrinter(Controller); + Data.Components := TList.Create; + try + Data.Title := sdxAddReport; + if dxShowAddComponentsDlg(Data) then + for I := 0 to Data.Components.Count - 1 do + begin + Component := TComponent(Data.Components[I]); + LinkClass := dxPSLinkClassByCompClass(Component); + if LinkClass <> nil then + begin + if (Data.ReportLinkName = '') or (Data.Components.Count <> 1) then + Data.ReportLinkName := UniqueName(nil); + InternalAddLink(LinkClass, Component, Data.ReportLinkName, + Data.ReportLinkCaption, Data.ReportLinkCreator, + Data.ReportLinkDescription, Data.DesignBtnPressed); + end; + end; + finally + Data.Components.Free; + end; +end; + +procedure TdxfmReportLinkDesignWindow.AddCompositionClick(Sender: TObject); +begin + {$IFDEF DELPHI5} + CheckAddLink; + {$ENDIF} + InternalAddLink(TdxCompositionReportLink, nil, UniqueName(nil), + '', dxPSUtl.GetUserName, cxGetResourceString(@sdxComposition), False); +end; + +procedure TdxfmReportLinkDesignWindow.btnDropDownMenuClick(Sender: TObject); +var + X, Y: Integer; +begin + with btnAdd do + begin + X := ClientOrigin.X; + Y := ClientOrigin.Y + Height; + end; + dxPSPopupMan.dxPSPopupMenuController.ShowPopup(X, Y, nil, pmAdd); +end; + +procedure TdxfmReportLinkDesignWindow.AddStandardClick(Sender: TObject); +var + Data: TdxAddReportLinkClassDlgData; +begin + {$IFDEF DELPHI5} + CheckAddLink; + {$ENDIF} + FillChar(Data, SizeOf(TdxAddReportLinkClassDlgData), 0); + Data.ReportLinkName := UniqueName(nil); + Data.ReportLinkCaption := sdxNewReport; + Data.ReportLinkCreator := dxPSUtl.GetUserName; + if dxShowAddReportLinkClassDlg(Data) then + begin + if Data.ReportLinkName = '' then + Data.ReportLinkName := UniqueName(nil); + InternalAddLink(Data.ReportLinkClass, nil, Data.ReportLinkName, Data.ReportLinkCaption, + Data.ReportLinkCreator, Data.ReportLinkDescription, Data.DesignBtnPressed); + end; +end; + +procedure TdxfmReportLinkDesignWindow.AddExistingClick(Sender: TObject); +var + Link: TBasedxReportLink; +begin + {$IFDEF DELPHI5} + CheckAddLink; + {$ENDIF} + Link := TBasedxReportLink(TComponent(Sender).Tag); + if Link <> nil then + InternalAddLink(Link.LinkClass, nil, UniqueName(Link), + Link.ReportDocument.Caption, Link.ReportDocument.Creator, + Link.ReportDocument.Description, False); +end; + +procedure TdxfmReportLinkDesignWindow.lbxLinksClick(Sender: TObject); +var + Selections: TdxDesignSelectionList; +begin + Selections := CreateDesignSelectionList; + GetSelections(Selections); + Designer.SetSelections(Selections); +end; + +procedure TdxfmReportLinkDesignWindow.LinkDesignClick(Sender: TObject); +begin + CurrentLink.IsCurrentLink := True; + if CurrentLink is TdxCompositionReportLink then + ShowCollectionEditor(Designer, CurrentLink, TdxCompositionReportLink(CurrentLink).Items, 'Items') + else + if Controller.DesignReport(CurrentLink) then + Designer.Modified; +end; + +procedure TdxfmReportLinkDesignWindow.SetAsCurrentClick(Sender: TObject); +begin + Controller.CurrentLink := CurrentLink; +end; + +procedure TdxfmReportLinkDesignWindow.LinkChangeComponentClick(Sender: TObject); +var + Data: TdxAddReportLinkDlgData; +begin + FillChar(Data, SizeOf(TdxAddReportLinkDlgData), 0); + Data.ReportLink := CurrentLink; + Data.ComponentPrinter := TdxComponentPrinter(Controller); + Data.Components := TList.Create; + try + Data.Options := [adoShowOnlyComponentsWOLinks..adoShowOnlyComponentsInActiveForm, adoShowHideCustomContainers]; + Data.Title := sdxChangeComponent; + if dxShowAddComponentsDlg(Data) and (Data.Components.Count <> 0) then + begin + CurrentLink.Component := TComponent(Data.Components[0]); + Designer.Modified; + ActiveControl := lbxLinks; + end; + finally + Data.Components.Free; + end; +end; + +procedure TdxfmReportLinkDesignWindow.RestoreDefaultsClick(Sender: TObject); +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + if Selected[I] or (SelectedCount = 0) then + begin + Links[I].RestoreDefaults; + Links[I].RealPrinterPage.RestoreDefaults; + end; +end; + +procedure TdxfmReportLinkDesignWindow.RestoreOriginalClick(Sender: TObject); +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + if (Selected[I] or (SelectedCount = 0)) and Links[I].DataProviderPresent then + Links[I].RestoreFromOriginal; +end; + +procedure TdxfmReportLinkDesignWindow.PageSetupClick(Sender: TObject); +begin + CurrentLink.IsCurrentLink := True; + if CurrentLink.PageSetup then Designer.Modified; +end; + +procedure TdxfmReportLinkDesignWindow.PrintPreviewClick(Sender: TObject); +begin + CurrentLink.IsCurrentLink := True; + dxShowPreviewWindow(Controller, Designer); +end; + +procedure TdxfmReportLinkDesignWindow.PrintClick(Sender: TObject); +begin + CurrentLink.IsCurrentLink := True; + Controller.Print(True, nil, nil); +end; + +procedure TdxfmReportLinkDesignWindow.lbxLinksDblClick(Sender: TObject); +begin + if CanShowDesigner then + LinkDesignClick(Sender) + else + if CanPrintPreview then + PrintPreviewClick(Sender) + else + if CanPageSetup then + PageSetupClick(Sender); +end; + +procedure TdxfmReportLinkDesignWindow.lbxLinksStartDrag(Sender: TObject; + var DragObject: TDragObject); +begin + FSaveDragIndex := -1; +end; + +procedure TdxfmReportLinkDesignWindow.lbxLinksEndDrag(Sender, Target: TObject; + X, Y: Integer); +begin + DrawDragRect; +end; + +procedure TdxfmReportLinkDesignWindow.lbxLinksDragOver(Sender, Source: TObject; + X, Y: Integer; State: TDragState; var Accept: Boolean); +var + Index: Integer; +begin + Accept := Sender = Source; + if Accept then + with TListBox(Sender) do + begin + Index := ItemAtPos(MakePoint(X, Y), True); + Accept := (Index <> -1) and (FSaveDragIndex <> ItemIndex); + DrawDragRect; + FSaveDragIndex := Index; + DrawDragRect; + end; +end; + +procedure TdxfmReportLinkDesignWindow.lbxLinksDragDrop(Sender, Source: TObject; + X, Y: Integer); +begin + MoveSelection(FSaveDragIndex - TListBox(Sender).ItemIndex); +end; + +procedure TdxfmReportLinkDesignWindow.lbxLinksKeyPress(Sender: TObject; + var Key: Char); +begin + case Key of + #13, #33..#126: + begin + if Key = #13 then Key := #0; + ActivateInspector(Key); + Key := #0; + end; + #27: + begin + SelectController; + Key := #0; + end; + end; +end; + +procedure TdxfmReportLinkDesignWindow.EditClick(Sender: TObject); +begin + EditAction(TEditAction(TComponent(Sender).Tag)); +end; + +procedure TdxfmReportLinkDesignWindow.MoveUpClick(Sender: TObject); +begin + MoveSelection(-1); +end; + +procedure TdxfmReportLinkDesignWindow.MoveDownClick(Sender: TObject); +begin + MoveSelection(1); +end; + +procedure TdxfmReportLinkDesignWindow.lbxLinksMeasureItem( + Control: TWinControl; Index: Integer; var Height: Integer); +begin + with TListBox(Control).Canvas do + begin + Font.Style := Font.Style + [fsBold]; + Height := 2 + TextHeight('Wg') + 2; + Font.Style := Font.Style - [fsBold]; + end; +end; + +procedure TdxfmReportLinkDesignWindow.lbxLinksDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +var + Link: TBasedxReportLink; + S: string; + X, Y, Ri: Integer; + TextColor, BrushColor: TColor; +begin + Link := Links[Index]; + S := LinkDescriptions[Index]; + + with TListBox(Control) do + begin + Canvas.FillRect(Rect); + + if Link.IsCurrentLink then + Canvas.Font.Style := Canvas.Font.Style + [fsBold]; + with Rect do + begin + X := Left + 2; + Y := Top + (Bottom - Top - Canvas.TextHeight('Wg')) div 2; + Ri := Right; + if S <> '' then + Right := Left + 2 + Canvas.TextWidth(Link.Name) + 2; + end; + + BrushColor := Canvas.Brush.Color; + Canvas.Brush.Style := bsClear; + Canvas.TextRect(Rect, X, Y, Link.Name); + + if S <> '' then + begin + X := Rect.Left + CalculateLinkDescriptionOffset; + Rect.Right := Ri; + + TextColor := Canvas.Font.Color; + if not (odSelected in State) then + Canvas.Font.Color := clBlue; + Canvas.TextRect(Rect, X, Y, S); + Canvas.Font.Color := TextColor; + end; + Canvas.Brush.Style := bsSolid; + Canvas.Brush.Color := BrushColor; + if Link.IsCurrentLink then + Canvas.Font.Style := Canvas.Font.Style - [fsBold]; + end; +end; + +procedure TdxfmReportLinkDesignWindow.BackgroundClick(Sender: TObject); +var + Background: TdxBackground; + I: Integer; +begin + StartWait; + try + Background := TdxBackground.Create; + try + for I := 0 to LinkCount - 1 do + if Selected[I] or (SelectedCount = 0) then + begin + Background.Assign(Links[I].RealPrinterPage.Background); + Break; + end; + if Background.SetupEffects then + begin + for I := 0 to LinkCount - 1 do + if Selected[I] or (SelectedCount = 0) then + Links[I].RealPrinterPage.Background := Background; + Designer.Modified; + end; + finally + Background.Free; + end; + finally + StopWait; + end; +end; + +procedure TdxfmReportLinkDesignWindow.ClearBackgroundClick(Sender: TObject); +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + if Selected[I] or (SelectedCount = 0) then + Links[I].RealPrinterPage.Background.Clear; + Designer.Modified; +end; + +procedure TdxfmReportLinkDesignWindow.pmLinksPopup(Sender: TObject); +begin + UpdateMenuState; +end; + +procedure TdxfmReportLinkDesignWindow.ShowButtonsClick(Sender: TObject); +begin + pnlButtons.Visible := not pnlButtons.Visible; +end; + +{$IFDEF DELPHI6} +function TdxfmReportLinkDesignWindow.EditAction(Action: TEditAction): Boolean; +{$ELSE} +procedure TdxfmReportLinkDesignWindow.EditAction(Action: TEditAction); +{$ENDIF} +begin +{$IFDEF DELPHI6} + Result := True; +{$ENDIF} + case Action of + eaCut: Cut; + eaCopy: Copy; + eaPaste: Paste; + eaDelete: Delete; + eaSelectAll: SelectAll; + end; +end; + +function TdxfmReportLinkDesignWindow.GetEditState: TEditState; +begin + Result := []; + if CanCut then + Result := Result + [esCanCut]; + if CanCopy then + Result := Result + [esCanCopy]; + if CanPaste then + Result := Result + [esCanPaste]; + if CanDelete then + Result := Result + [esCanDelete]; + if CanSelectAll then + Result := Result + [esCanSelectAll]; +end; + +{$IFDEF DELPHI6} + +procedure TdxfmReportLinkDesignWindow.ItemDeleted(const ADesigner: IDesigner; + Item: TPersistent); +begin + inherited ItemDeleted(ADesigner, Item); + if (ADesigner = Designer) and (Item is TBasedxReportLink) and + (Controller <> nil) and not (csDestroying in Controller.ComponentState) then + DeleteItem(TBasedxReportLink(Item)); +end; + +procedure TdxfmReportLinkDesignWindow.ItemsModified(const Designer: IDesigner); +begin + inherited ItemsModified(Designer); + UpdateCaption; +end; + +procedure TdxfmReportLinkDesignWindow.SelectionChanged(const ADesigner: IDesigner; + const ASelection: IDesignerSelections); +begin + inherited SelectionChanged(ADesigner, ASelection); + if ADesigner = Designer then UpdateSelections(ASelection); +end; + +{$ELSE} + +procedure TdxfmReportLinkDesignWindow.ComponentDeleted(Component: IPersistent); +var + Item: TPersistent; +begin + inherited ComponentDeleted(Component); + Item := dxPSDsgProxies.TryExtractPersistent(Component); + if (Item is TBasedxReportLink) and (Controller <> nil) and + not (csDestroying in Controller.ComponentState) then + DeleteItem(TBasedxReportLink(Item)); +end; + +procedure TdxfmReportLinkDesignWindow.SelectionChanged( + ASelection: {$IFDEF DELPHI5} TDesignerSelectionList {$ELSE} TComponentList {$ENDIF}); +begin + inherited SelectionChanged(ASelection); + UpdateSelections(ASelection); +end; + +procedure TdxfmReportLinkDesignWindow.FormModified; +begin + inherited FormModified; + UpdateCaption; +end; +{$ENDIF} + +procedure TdxfmReportLinkDesignWindow.Activated; +var + Selections: TdxDesignSelectionList; +begin + inherited Activated; + Selections := CreateDesignSelectionList; + try + Designer.GetSelections(Selections); + UpdateSelections(Selections); + finally + FreeDesignSelectionList(Selections); + end; +end; + +procedure TdxfmReportLinkDesignWindow.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + Style := Style or WS_THICKFRAME; +{$IFDEF DELPHI9} + Params.WndParent := Application.MainForm.Handle; +{$ENDIF} +end; + +procedure TdxfmReportLinkDesignWindow.CreateWnd; +begin + inherited CreateWnd; + SendMessage(Handle, WM_SETICON, 1, Icon.Handle) +end; + +function TdxfmReportLinkDesignWindow.UniqueName(Comp: TComponent): string; +begin + Result := dxReportLinkUniqueName(Controller, Comp); +end; + +function TdxfmReportLinkDesignWindow.GetControllerDesigner: TAbstractdxReportLinkDesigner; +begin + if Controller <> nil then + Result := Controller.ReportLinkDesigner + else + Result := nil; +end; + +function TdxfmReportLinkDesignWindow.GetCurrentLink: TBasedxReportLink; +begin + if LinkCount <> 0 then + Result := Links[lbxLinks.ItemIndex] + else + Result := nil; +end; + +function TdxfmReportLinkDesignWindow.GetLink(Index: Integer): TBasedxReportLink; +begin + Result := TBasedxReportLink(lbxLinks.Items.Objects[Index]); +end; + +function TdxfmReportLinkDesignWindow.GetLinkCount: Integer; +begin + Result := lbxLinks.Items.Count; +end; + +function TdxfmReportLinkDesignWindow.GetLinkDescription(Index: Integer): string; +var + Link: TBasedxReportLink; +begin + Link := Links[Index]; + if Link.Component <> nil then + Result := sdxLinkedTo + ' ' + Link.Component.Name + else + if Link.DataProviderPresent then + Result := sdxLinked + else + Result := sdxUnassigned; + + Result := '[' + Result + ']'; +end; + +function TdxfmReportLinkDesignWindow.GetRegistryPath: string; +begin + Result := dxPSDsgProxies.GetBaseRegistryKey + '\' + sdxPSRegPathRunTimeFormLayouts + '\' + DropT(ClassName); +end; + +function TdxfmReportLinkDesignWindow.GetSelected(Index: Integer): Boolean; +begin + Result := lbxLinks.Selected[Index] +end; + +function TdxfmReportLinkDesignWindow.GetSelectedCount: Integer; +begin + Result := lbxLinks.SelCount; +end; + +procedure TdxfmReportLinkDesignWindow.SetController(Value: TCustomdxComponentPrinter); +begin + if FController <> Value then + begin + FController := Value; + UpdateCaption; + RefreshList; + end; +end; + +procedure TdxfmReportLinkDesignWindow.SetSelected(Index: Integer; Value: Boolean); +begin + lbxLinks.Selected[Index] := Value; +end; + +function TdxfmReportLinkDesignWindow.CalculateLinkCaptionWidth: Integer; +var + I, W: Integer; +begin + Result := 0; + with lbxLinks do + for I := 0 to Items.Count - 1 do + begin + if Links[I].IsCurrentLink then + Canvas.Font.Style := Canvas.Font.Style + [fsBold]; + W := Canvas.TextWidth(Items[I]); + Canvas.Font.Style := Canvas.Font.Style - [fsBold]; + if Result < W then Result := W; + end; +end; + +function TdxfmReportLinkDesignWindow.CalculateLinkDescriptionOffset: Integer; +begin + Result := CalculateLinkCaptionWidth + 10; +end; + +function TdxfmReportLinkDesignWindow.CalculateLinkDescriptionWidth: Integer; +var + I, W: Integer; +begin + Result := 0; + with lbxLinks do + for I := 0 to LinkCount - 1 do + begin + if Links[I].IsCurrentLink then + Canvas.Font.Style := Canvas.Font.Style + [fsBold]; + W := Canvas.TextWidth(LinkDescriptions[I]); + Canvas.Font.Style := Canvas.Font.Style - [fsBold]; + if Result < W then Result := W; + end; +end; + +function TdxfmReportLinkDesignWindow.CalculateLinkMaxRowWidth: Integer; +begin + Result := CalculateLinkDescriptionOffset + CalculateLinkDescriptionWidth; +end; + +function TdxfmReportLinkDesignWindow.CanAdd: Boolean; +begin + {$IFDEF DELPHI5} + Result := not ((Controller <> nil) and (Controller.Owner <> nil) and + (csInline in Controller.Owner.ComponentState)); + {$ELSE} + Result := True; + {$ENDIF} +end; + +function TdxfmReportLinkDesignWindow.CanAddExisting: Boolean; +begin + Result := CanAdd and (CurrentLink <> nil); +end; + +function TdxfmReportLinkDesignWindow.CanBackgroundClear: Boolean; +begin + Result := LinkCount <> 0; +end; + +function TdxfmReportLinkDesignWindow.CanBackgroundEffects: Boolean; +begin + Result := LinkCount <> 0; +end; + +function TdxfmReportLinkDesignWindow.CanChangeComponent: Boolean; +begin + Result := (SelectedCount = 1) and not (CurrentLink is TdxCompositionReportLink); +end; + +function TdxfmReportLinkDesignWindow.CanCopy: Boolean; +begin + Result := SelectedCount <> 0; +end; + +function TdxfmReportLinkDesignWindow.CanCut: Boolean; +begin + Result := CanCopy and CanDelete; +end; + +function TdxfmReportLinkDesignWindow.CanDelete: Boolean; +var + I: Integer; +begin + Result := SelectedCount <> 0; + if Result then + for I := 0 to LinkCount - 1 do + if Selected[I] and (csAncestor in Links[I].ComponentState) then + begin + Result := False; + Exit; + end; +end; + +function TdxfmReportLinkDesignWindow.CanMoveDown: Boolean; +var + I, Counter: Integer; +begin + Counter := 0; + for I := LinkCount - 1 downto 0 do + begin + if not Selected[I] then + begin + Result := Counter < SelectedCount; + Exit; + end; + Inc(Counter); + end; + Result := False; +end; + +function TdxfmReportLinkDesignWindow.CanMoveUp: Boolean; +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + if not Selected[I] then + begin + Result := I < SelectedCount; + Exit; + end; + Result := False; +end; + +function TdxfmReportLinkDesignWindow.CanPaste: Boolean; +begin + Result := CanAdd and ClipboardComponents {$IFDEF DELPHI5} and Designer.CanPaste {$ENDIF}; +end; + +function TdxfmReportLinkDesignWindow.CanPageSetup: Boolean; +begin + Result := SelectedCount = 1; +end; + +function TdxfmReportLinkDesignWindow.CanPrint: Boolean; +begin + Result := (SelectedCount = 1) and (CurrentLink <> nil) and CurrentLink.DataProviderPresent; +end; + +function TdxfmReportLinkDesignWindow.CanPrintPreview: Boolean; +begin + Result := (SelectedCount = 1) and (CurrentLink <> nil) and CurrentLink.DataProviderPresent; +end; + +function TdxfmReportLinkDesignWindow.CanRestoreDefaults: Boolean; +begin + Result := CurrentLink <> nil; +end; + +function TdxfmReportLinkDesignWindow.CanRestoreOriginal: Boolean; +begin + Result := LinkCount > 0; +end; + +function TdxfmReportLinkDesignWindow.CanSelectAll: Boolean; +begin + Result := LinkCount <> SelectedCount; +end; + +function TdxfmReportLinkDesignWindow.CanSetAsCurrent: Boolean; +begin + Result := (SelectedCount = 1) and (CurrentLink <> nil) and not CurrentLink.IsCurrentLink; +end; + +function TdxfmReportLinkDesignWindow.CanShowDesigner: Boolean; +begin + Result := (SelectedCount = 1) and (CurrentLink <> nil) and CurrentLink.CheckToDesign; +end; + +{$IFDEF DELPHI5} +procedure TdxfmReportLinkDesignWindow.CheckAddLink; +begin + if not CanAdd then + raise Exception.CreateRes(@SCantAddToFrame); +end; +{$ENDIF} + +procedure TdxfmReportLinkDesignWindow.CheckDeleteLink; +begin + if not CanDelete then + {$IFDEF DELPHI5} + raise Exception.CreateRes(@SCantDeleteAncestor); + {$ELSE} + raise Exception.Create(SCantDeleteAncestor); + {$ENDIF} +end; + +procedure TdxfmReportLinkDesignWindow.Copy; +var + Components: TdxDesignSelectionList; +begin + Components := CreateDesignSelectionList; + try + GetSelections(Components); + CopyComponents(Controller.Owner, Components); + finally + FreeDesignSelectionList(Components); + end; + UpdateHScrollBar; +end; + +procedure TdxfmReportLinkDesignWindow.Cut; +begin + Copy; + CheckDeleteLink; + Delete; +end; + +procedure TdxfmReportLinkDesignWindow.Delete; +var + Selections: TdxDesignSelectionList; + I, ItemIndex: Integer; + Item: TComponent; +begin + StartWait; + try + ControllerDesigner.BeginUpdate; + try + Selections := CreateDesignSelectionList; + try + GetSelections(Selections); + ItemIndex := lbxLinks.ItemIndex; + for I := 0 to Selections.Count - 1 do + begin + Item := TComponent(Selections[I]); + if not (csAncestor in Item.ComponentState) then Item.Free; + end; + if ItemIndex < 0 then + ItemIndex := 0; + if ItemIndex > LinkCount - 1 then + ItemIndex := LinkCount - 1; + finally + FreeDesignSelectionList(Selections); + end; + finally + ControllerDesigner.CancelUpdate; + end; + if ItemIndex <> -1 then + Select(Links[ItemIndex], False) + else + SelectController; + UpdateHScrollBar; + finally + StopWait; + end; +end; + +procedure TdxfmReportLinkDesignWindow.DeleteItem(AItem: TBasedxReportLink); +var + Index, ItemIndex: Integer; +begin + Index := IndexOf(AItem); + if Index <> -1 then + begin + ItemIndex := lbxLinks.ItemIndex; + lbxLinks.Items.Delete(Index); + if ItemIndex < 0 then + ItemIndex := 0; + if ItemIndex > LinkCount - 1 then + ItemIndex := LinkCount - 1; + if ItemIndex <> -1 then + Select(Links[ItemIndex], False) + else + SelectController; + UpdateHScrollBar; + end; +end; + +procedure TdxfmReportLinkDesignWindow.DrawDragRect; +begin + with lbxLinks do + if (FSaveDragIndex <> -1) and (FSaveDragIndex <> ItemIndex) then + DrawFocusRect(Canvas.Handle, ItemRect(FSaveDragIndex)); +end; + +function TdxfmReportLinkDesignWindow.GetMinWindowSize: TPoint; +begin + Result.X := 300; + Result.Y := btnPrint.Top + btnPrint.Height + + GetSystemMetrics(SM_CYCAPTION) + 2 * GetSystemMetrics(SM_CXFRAME) + 4; +end; + +procedure TdxfmReportLinkDesignWindow.GetSelections(const ASelections: TdxDesignSelectionList); +var + I: Integer; +begin + for I := 0 to LinkCount - 1 do + if Selected[I] then + ASelections.Add(Links[I]); + if ASelections.Count = 0 then + ASelections.Add(Controller); +end; + +function TdxfmReportLinkDesignWindow.IndexOf(AItem: TBasedxReportLink): Integer; +begin + Result := lbxLinks.Items.IndexOfObject(AItem); +end; + +procedure TdxfmReportLinkDesignWindow.InternalAddLink(ALinkClass: TdxReportLinkClass; + AComponent: TComponent; const AName, ACaption, ACreator, ADescription: string; + AShowDesigner: Boolean); +var + Link: TBasedxReportLink; +begin +// ALink := TBasedxReportLink(Designer.CreateComponent(ALinkClass, Designer.GetRoot, 0, 0, 0, 0)); + ControllerDesigner.BeginUpdate; + try + Link := Controller.AddEmptyLinkEx(ALinkClass, Designer.GetRoot); + Link.Component := AComponent; + Link.Name := AName; + if ACaption <> cxGetResourceString(@sdxNewReport) then + Link.ReportDocument.Caption := ACaption; + Link.ReportDocument.Creator := ACreator; + Link.ReportDocument.Description := ADescription; + finally + ControllerDesigner.CancelUpdate; + end; + + if AComponent <> nil then + Self.MakeLinkable(AComponent); + + lbxLinks.Items.AddObject(Link.Name, Link); + Select(Link, False); + UpdateHScrollBar; + lbxLinks.Update; + + if AShowDesigner then LinkDesignClick(nil); +end; + +procedure TdxfmReportLinkDesignWindow.MakeLinkable(AComponent: TComponent); +begin + with Designer do + if (GetRoot.FindComponent(AComponent.Name) <> AComponent) and not IsComponentLinkable(AComponent) then + MakeComponentLinkable(AComponent) +end; + +procedure TdxfmReportLinkDesignWindow.MoveSelection(ADelta: Integer); + + procedure MoveDown(ADelta: Integer); + var + I, Index: Integer; + begin + for I := LinkCount - 1 downto 0 do + if Selected[I] then + begin + Index := Links[I].Index; + Inc(Index, ADelta); + if Index > LinkCount - 1 then + Index := LinkCount - 1; +// while (Index < LinkCount) and Selected[Index] do +// Inc(Index); + Links[I].Index := Index; + end; + end; + + procedure MoveUp(ADelta: Integer); + var + I, Index: Integer; + begin + for I := 0 to LinkCount - 1 do + if Selected[I] then + begin + Index := Links[I].Index; + Inc(Index, ADelta); + if Index < 0 then + Index := 0; +// while (Index > -1) and Selected[Index] do +// Dec(Index); + Links[I].Index := Index; + end; + end; + +begin + ControllerDesigner.BeginUpdate; + try + if ADelta > 0 then + MoveDown(ADelta) + else + MoveUp(ADelta); + finally + ControllerDesigner.EndUpdate; + end; +end; + +procedure TdxfmReportLinkDesignWindow.Paste; +var + Components: TdxDesignSelectionList; + I: Integer; +begin + Components := CreateDesignSelectionList; + try + StartWait; + try + lbxLinks.Items.BeginUpdate; + try + ControllerDesigner.BeginUpdate; + try + PasteComponents(Controller.Owner, Controller, Components); + finally + ControllerDesigner.EndUpdate; + end; + for I := LinkCount - 1 downto LinkCount - Components.Count do + Selected[I] := True; + Designer.SetSelections(Components); + finally + lbxLinks.Items.EndUpdate; + end; + finally + StopWait; + end; + finally + FreeDesignSelectionList(Components); + end; + UpdateHScrollBar; +end; + +procedure TdxfmReportLinkDesignWindow.PrepareAddExistingItem(AMenuItem: TMenuItem); +begin + if CanAddExisting then + begin + AMenuItem.Caption := 'Add ' + DropT(CurrentLink.ClassName); + AMenuItem.Tag := Integer(CurrentLink); + end; +end; + +procedure TdxfmReportLinkDesignWindow.RefreshList; +var + Selections: TdxDesignSelectionList; + I, Index: Integer; + Item: TBasedxReportLink; + Component: TPersistent; +begin + lbxLinks.Items.BeginUpdate; + try + Selections := CreateDesignSelectionList; + try + GetSelections(Selections); + + lbxLinks.Items.Clear; + if Controller = nil then Exit; + + for I := 0 to Controller.LinkCount - 1 do + begin + Item := Controller.ReportLink[I]; + if Item.Owner = Controller.Owner then + lbxLinks.Items.AddObject(Item.Name, Item); + end; + + for I := 0 to Selections.Count - 1 do + begin + Component := Selections[I]; + if Component is TBasedxReportLink then + begin + Index := IndexOf(TBasedxReportLink(Component)); + if Index <> -1 then + Selected[Index] := True; + end; + end; + finally + FreeDesignSelectionList(Selections); + end; + finally + lbxLinks.Items.EndUpdate; + end; + UpdateHScrollBar; +end; + +procedure TdxfmReportLinkDesignWindow.RestoreLayout; +begin + with TRegistry.Create do + try + try + if OpenKey(RegistryPath, False) then + begin + if ValueExists(sdxButtonBar) then + pnlButtons.Visible := ReadBool(sdxButtonBar); + if ValueExists(sdxWidth) then + Width := ReadInteger(sdxWidth); + if ValueExists(sdxHeight) then + Height := ReadInteger(sdxHeight); + end; + except + // + end; + finally + Free; + end; +end; + +procedure TdxfmReportLinkDesignWindow.SaveLayout; +begin + with TRegistry.Create do + try + try + if OpenKey(RegistryPath, True) then + begin + WriteBool(sdxButtonBar, pnlButtons.Visible); + WriteInteger(sdxWidth, Width); + WriteInteger(sdxHeight, Height); + end; + except + // + end; + finally + Free; + end; +end; + +procedure TdxfmReportLinkDesignWindow.Select(AItem: TPersistent; AddToSelection: Boolean); +var + Selections: TdxDesignSelectionList; +begin + Selections := CreateDesignSelectionList; + if AddToSelection then + Designer.GetSelections(Selections); + Selections.Add(AItem); + Designer.SetSelections(Selections); +end; + +procedure TdxfmReportLinkDesignWindow.SelectAll; +var + Selections: TdxDesignSelectionList; + I: Integer; +begin + Selections := CreateDesignSelectionList; + for I := 0 to LinkCount - 1 do + Selections.Add(Links[I]); + Designer.SetSelections(Selections); +end; + +procedure TdxfmReportLinkDesignWindow.SelectController; +begin + Select(Controller, False); +end; + +procedure TdxfmReportLinkDesignWindow.StartWait; +begin + FSaveCursor := Screen.Cursor; + Screen.Cursor := crHourGlass; +end; + +procedure TdxfmReportLinkDesignWindow.StopWait; +begin + Screen.Cursor := FSaveCursor; +end; + +procedure TdxfmReportLinkDesignWindow.UpdateCaption; +var + NewCaption: string; +begin + if (Controller <> nil) and (Controller.Owner <> nil) then + NewCaption := Format(sdxLinkDesigner, [Controller.Owner.Name, '.', Controller.Name]); + if Caption <> NewCaption then + Caption := NewCaption; +end; + +procedure TdxfmReportLinkDesignWindow.UpdateControlsState; +begin + btnAdd.Enabled := CanAdd; + btnDropDownMenu.Enabled := CanAdd; + btnDelete.Enabled := CanDelete; + btnSelectAll.Enabled := CanSelectAll; + btnMoveUp.Enabled := CanMoveUp; + btnMoveDown.Enabled := CanMoveDown; + btnShowDesigner.Enabled := CanShowDesigner; + btnChangeComponent.Enabled := CanChangeComponent; + btnRestoreDefaults.Enabled := CanRestoreDefaults; + btnRestoreOriginal.Enabled := CanRestoreOriginal; + btnPageSetup.Enabled := CanPageSetup; + btnPrintPreview.Enabled := CanPrintPreview; + btnPrint.Enabled := CanPrint; +end; + +procedure TdxfmReportLinkDesignWindow.UpdateHScrollBar; +begin + lbxLinks.Perform(LB_SETHORIZONTALEXTENT, 2 + CalculateLinkMaxRowWidth + 2, 0); +end; + +procedure TdxfmReportLinkDesignWindow.UpdateItem(AItem: TBasedxReportLink); +var + Index: Integer; +begin + if AItem <> nil then + begin + Index := IndexOf(AItem); + if Index <> -1 then + begin + lbxLinks.Items[Index] := AItem.Name; + UpdateHScrollBar; + end; + end + else + RefreshList; + UpdateControlsState; +end; + +procedure TdxfmReportLinkDesignWindow.UpdateMenuState; +begin + miAdd.Enabled := CanAdd; + miAdd1.Enabled := CanAdd; + miAddComposition.Enabled := CanAdd; + miAddComposition1.Enabled := CanAdd; + miAddStandard.Visible := CanAdd; + miAddStandard1.Visible := CanAdd; + miAddExisting.Visible := CanAddExisting; + miAddExisting1.Visible := CanAddExisting; + PrepareAddExistingItem(miAddExisting); + PrepareAddExistingItem(miAddExisting1); + + miCut.Enabled := CanCut; + miCopy.Enabled := CanCopy; + miPaste.Enabled := CanPaste; + miDelete.Enabled := CanDelete; + miSelectAll.Enabled := CanSelectAll; + miMoveUp.Enabled := CanMoveUp; + miMoveDown.Enabled := CanMoveDown; + miShowDesigner.Enabled := CanShowDesigner; + miSetAsCurrent.Enabled := CanSetAsCurrent; + miChangeComponent.Enabled := CanChangeComponent; + miRestoreDefaults.Enabled := CanRestoreDefaults; + miRestoreOriginal.Enabled := CanRestoreOriginal; + miPageSetup.Enabled := CanPageSetup; + miPrintPreview.Enabled := CanPrintPreview; + miPrint.Enabled := CanPrint; + miBackgroundEffects.Enabled := CanBackgroundEffects; + miBackgroundClear.Enabled := CanBackgroundClear; + miShowButtons.Checked := pnlButtons.Visible; + + if CanShowDesigner then + miShowDesigner.Default := True + else + if CanPrintPreview then + miPrintPreview.Default := True + else + if CanPageSetup then + miPageSetup.Default := True; +end; + +procedure TdxfmReportLinkDesignWindow.UpdateSelections(const ASelections: TdxDesignSelectionList); + + function InSelection(ALink: TBasedxReportLink): Boolean; + var + I: Integer; + begin + for I := 0 to ASelections.Count - 1 do + if ALink = ASelections[I] then + begin + Result := True; + Exit; + end; + Result := False; + end; + +var + I: Integer; +begin + if (ASelections = nil) or (Controller = nil) or (csDestroying in Controller.ComponentState) or + (ControllerDesigner = nil) or (TdxReportLinkDesigner(ControllerDesigner).FUpdateCount <> 0) then + Exit; + for I := 0 to LinkCount - 1 do + if Selected[I] <> InSelection(Links[I]) then + Selected[I] := not Selected[I]; + UpdateControlsState; +end; + +procedure TdxfmReportLinkDesignWindow.WMAppCommand(var Message: TMessage); +begin + with Message do + case dxPSGlbl.GET_APPCOMMAND_LPARAM(lParam) of + APPCOMMAND_COPY: + begin + Result := Ord(CanCopy); + if Result = 1 then EditAction(eaCopy); + end; + + APPCOMMAND_CUT: + begin + Result := Ord(CanCut); + if Result = 1 then EditAction(eaCut); + end; + + APPCOMMAND_PASTE: + begin + Result := Ord(CanPaste); + if Result = 1 then EditAction(eaPaste); + end; + + APPCOMMAND_PRINT: + begin + Result := Ord(CanPrint); + if Result = 1 then + begin + CurrentLink.IsCurrentLink := True; + Controller.Print(True, nil, nil); + end; + end; + end; + inherited; +end; + +procedure TdxfmReportLinkDesignWindow.WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); +begin + inherited; + with Message.MinMaxInfo^ do + ptMinTrackSize := GetMinWindowSize; +end; + +procedure TdxfmReportLinkDesignWindow.WMNCCreate(var Message: TWMNCCreate); +const + TypeDataSize = 32; +var + SysMenu: HMENU; + P: Pointer; + S: array[0..TypeDataSize - 1] of Char; + Info: TMenuItemInfo; + ItemExist: Boolean; +begin + SysMenu := GetSystemMenu(Handle, False); + P := @S[0]; + Info.cbSize := SizeOf(Info) - SizeOf(HBITMAP); + Info.fMask := MIIM_ID or MIIM_TYPE; + Info.dwTypeData := P; + Info.cch := TypeDataSize; + ItemExist := GetMenuItemInfo(SysMenu, SC_SIZE, False, Info); + inherited; + if ItemExist then + InsertMenuItem(SysMenu, 0, True, Info); +end; + +procedure TdxfmReportLinkDesignWindow.WMNCDestroy(var Message: TWMNCCreate); +begin + GetSystemMenu(Handle, True); + inherited; +end; + +initialization + TdxPSDesignTimedxComponentsProvider.Register; + +finalization + TdxPSDesignTimedxComponentsProvider.Unregister; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSfmReportProperties.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSfmReportProperties.dfm new file mode 100644 index 00000000..4bbf7a0e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSfmReportProperties.dfm @@ -0,0 +1,220 @@ +object dxfmPSReportProperties: TdxfmPSReportProperties + Left = 357 + Top = 319 + ActiveControl = edName + BorderIcons = [biSystemMenu, biMinimize, biMaximize, biHelp] + BorderStyle = bsDialog + Caption = 'Properties' + ClientHeight = 477 + ClientWidth = 359 + Color = clBtnFace + Constraints.MinHeight = 502 + Constraints.MinWidth = 367 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Icon.Data = { + 0000010001001010100000000000280100001600000028000000100000002000 + 00000100040000000000C0000000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000 + 00000000000000000000000000000FFFFFFFFFF000000F00F00000F000000FFF + FFFFFFF000000F00F00000F000000FFFFFFFFFF000000FFFFFFF0FF000000F00 + FFF080F000000F080F08080000440FF080808088804400000808088888440000 + 008088888844000000088888804400000000000000440000000000000000FFFF + 0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F + 0000000400000000000000000000F8000000FC000000FE040000FFFF0000} + OldCreateOrder = False + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + PixelsPerInch = 96 + TextHeight = 13 + object pcSummary: TPageControl + Left = 5 + Top = 6 + Width = 349 + Height = 434 + ActivePage = tshSummary + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + object tshSummary: TTabSheet + Caption = 'Summary' + object Image1: TImage + Left = 10 + Top = 8 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDD777777777777777777777777777DDDD00000000000000000000000000 + 07DDDD0FFFFFFFFFFFFFFFFFFFFFFFFF07DDDD0FFFFFFFFFFFFFFFFFFFFFFFFF + 07DDDD0F88888888888888888888888F07DDDD0F8FFF8FFF8FFF8FFFF8FFFF8F + 07DDDD0F8FFF8FFF8FFF8FFFF8FFFF8F07DDDD0F88888888888888888888888F + 07DDDD0F8FFF8FFF8FFF8FFFF8FFFF8F07DDDD0F8FFF8FFF8FFF8FFFF8FFFF8F + 07DDDD0F88888888888888888888888F07DDDD0F8FFF8FFF8FFF8FFFF8FFFF8F + 07DDDD0F8FFF8FFF8FFF8FFFF8FFFF8F07DDDD0F88888888888888888888888F + 07DDDD0F8FFF8FFF8FFF8FFFF8FFFF8F07DDDD0F8FFF8FFF8FFF8FFFF8FFFF8F + 07DDDD0F88888888888888888888888F07DDDD0FFFFFFFFFFFFFFFFFFFFFFFFF + 07DDDD0FFFFFFFFFFFFFFFFFFFFFFFFF07DDDD0F0000FF7777777777FFFFFFFF + 07DDDD0FFFFFFFFFFFFFFFFFFFFFFFFF07DDDD0F0000FF7777777777FFFFFFFF + 07DDDD0FFFFFFFFFFFFFFFFFFFFFFFFF07DDDD0F0000FF7777777777FFFFFFFF + 07DDDD0FFFFFFFFFFFFFFFFFFFFFFFFF07DDDD0FFFFFFFFFFFFFFFFFFFFFFFFF + 07DDDD0F77777777777777777777777F07DDDD0F7777777FFFFFFFFFFFFFFFFF + 07DDDD0FFFFFFFFFFFFFFFFFFFFFFFFF07DDDD0FFFFFFFFFFFFFFFFFFFFFFFFF + 07DDDD000000000000000000000000000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object Bevel1: TBevel + Left = 8 + Top = 46 + Width = 320 + Height = 6 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object lblCreator: TLabel + Left = 10 + Top = 80 + Width = 41 + Height = 13 + Caption = 'Creator:' + FocusControl = edCreator + end + object lblCreationDate: TLabel + Left = 10 + Top = 105 + Width = 71 + Height = 13 + Caption = 'Creation Date:' + FocusControl = edCreationDate + end + object Bevel2: TBevel + Left = 8 + Top = 142 + Width = 320 + Height = 6 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object edName: TEdit + Left = 66 + Top = 16 + Width = 262 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + Text = 'edName' + end + object edCreator: TEdit + Left = 112 + Top = 80 + Width = 215 + Height = 14 + TabStop = False + Anchors = [akLeft, akTop, akRight] + AutoSize = False + BorderStyle = bsNone + Ctl3D = False + ParentCtl3D = False + ReadOnly = True + TabOrder = 1 + Text = 'edCreator' + end + object edCreationDate: TEdit + Left = 112 + Top = 105 + Width = 215 + Height = 14 + TabStop = False + Anchors = [akLeft, akTop, akRight] + AutoSize = False + BorderStyle = bsNone + Ctl3D = False + ParentCtl3D = False + ReadOnly = True + TabOrder = 2 + Text = 'edCreationDate' + end + object pcDescription: TPageControl + Left = 10 + Top = 158 + Width = 319 + Height = 237 + ActivePage = tshPreview + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 3 + object tshDescription: TTabSheet + Caption = '&Description' + object memDescription: TMemo + Left = 0 + Top = 0 + Width = 311 + Height = 209 + Align = alClient + ScrollBars = ssBoth + TabOrder = 0 + end + end + object tshPreview: TTabSheet + Caption = '&Preview' + ImageIndex = 1 + object bvlPreviewHost: TBevel + Left = 0 + Top = 0 + Width = 311 + Height = 172 + Align = alTop + Anchors = [akLeft, akTop, akRight, akBottom] + end + object btnPreview: TButton + Left = 206 + Top = 180 + Width = 100 + Height = 23 + Anchors = [akRight, akBottom] + Caption = 'Pre&view...' + TabOrder = 0 + OnClick = PreviewClick + end + end + end + end + end + object btnOK: TButton + Left = 116 + Top = 447 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 197 + Top = 447 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object btnHelp: TButton + Left = 279 + Top = 447 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Caption = '&Help' + TabOrder = 3 + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSfmReportProperties.pas b/official/x.35/ExpressPrinting System/Sources/dxPSfmReportProperties.pas new file mode 100644 index 00000000..e6fd1c6a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSfmReportProperties.pas @@ -0,0 +1,319 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSfmReportProperties; + +interface + +{$I cxVer.inc} + +uses + Windows, Classes, Controls, Graphics, StdCtrls, ComCtrls, ExtCtrls, Forms, + dxPSCore, dxPSForm, dxExtCtrls; + +type + TdxfmPSReportProperties = class(TCustomdxPSExplorerItemPropertySheets) + pcSummary: TPageControl; + tshSummary: TTabSheet; + btnOK: TButton; + btnCancel: TButton; + btnHelp: TButton; + Image1: TImage; + edName: TEdit; + Bevel1: TBevel; + lblCreator: TLabel; + lblCreationDate: TLabel; + Bevel2: TBevel; + edCreator: TEdit; + edCreationDate: TEdit; + pcDescription: TPageControl; + tshDescription: TTabSheet; + tshPreview: TTabSheet; + memDescription: TMemo; + btnPreview: TButton; + bvlPreviewHost: TBevel; + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + procedure PreviewClick(Sender: TObject); + private + FPreviewBox: TdxPSImageScrollBox; + function GetReportCaption: string; + function GetReportCreationDateTime: TDateTime; + function GetReportCreator: string; + function GetReportDescription: string; + procedure SetReportCaption(const Value: string); + procedure SetReportCreationDateTime(const Value: TDateTime); + procedure SetReportCreator(const Value: string); + procedure SetReportDescription(const Value: string); + procedure SetReportPreview(Value: TGraphic); + protected + procedure CreateWnd; override; + + procedure BeforeConstruction; override; + procedure Done; override; + procedure Initialize; override; + + procedure CreateControls; virtual; + function HasGraphic: Boolean; + procedure LoadStrings; virtual; + public + constructor Create(AOwner: TComponent); override; + + function ExplorerItem: TdxPSExplorerItem; reintroduce; overload; + + property ReportCaption: string read GetReportCaption write SetReportCaption; + property ReportCreationDateTime: TDateTime read GetReportCreationDateTime write SetReportCreationDateTime; + property ReportCreator: string read GetReportCreator write SetReportCreator; + property ReportDescription: string read GetReportDescription write SetReportDescription; + property ReportPreview: TGraphic write SetReportPreview; + + property PreviewBox: TdxPSImageScrollBox read FPreviewBox; + end; + +implementation + +{$R *.dfm} + +uses + {$IFDEF DELPHI7} + Themes, + {$ENDIF} + Messages, SysUtils, Dialogs, ExtDlgs, cxClasses, dxPSGlbl, dxPSUtl, dxPSRes, + dxPcPrVW; + +{ TdxfmPSReportProperties } + +constructor TdxfmPSReportProperties.Create(AOwner: TComponent); +begin + inherited; + + HelpContext := dxPSGlbl.dxhcPSReportPropertiesDlg; + if HelpContext = 0 then + begin + btnOK.BoundsRect := btnCancel.BoundsRect; + btnCancel.BoundsRect := btnHelp.BoundsRect; + btnHelp.Visible := False; + BorderIcons := BorderIcons - [biHelp]; + end; + + CreateControls; + LoadStrings; + pcDescription.ActivePage := tshDescription; +end; + +function TdxfmPSReportProperties.ExplorerItem: TdxPSExplorerItem; +begin + Result := inherited ExplorerItem as TdxPSExplorerItem; +end; + +procedure TdxfmPSReportProperties.CreateWnd; +begin + inherited; + SendMessage(Handle, WM_SETICON, 1, Icon.Handle); +end; + +procedure TdxfmPSReportProperties.BeforeConstruction; +begin + inherited; + Options := Options + [foSizeableDialog]; +end; + +procedure TdxfmPSReportProperties.Done; +begin + if ModalResult = mrOK then + with ExplorerItem.ReportDocument do + begin + BeginUpdate; + try + Caption := ReportCaption; + Description := ReportDescription; + finally + EndUpdate; + end; + end; +end; + +procedure TdxfmPSReportProperties.Initialize; +const + Colors: array[Boolean] of TColor = (clWindow, clBtnFace); +begin + with ExplorerItem.ReportDocument do + begin + ReportCaption := Caption; + ReportCreator := Creator; + ReportCreationDateTime := CreationDate; + ReportDescription := Description; + ReportPreview := Preview; + end; + + Caption := ReportCaption; + if Caption <> '' then + Caption := '"' + Caption + '" '; + Caption := Caption + DropAmpersand(cxGetResourceString(@sdxProperties)); + + edName.ReadOnly := ExplorerItem.IsCurrentlyLoaded; + {$IFDEF DELPHI7} + if not Themes.ThemeServices.ThemesEnabled then + begin + {$ENDIF} + edName.Color := Colors[edName.ReadOnly]; + edCreator.ParentColor := True; + edCreationDate.ParentColor := True; + {$IFDEF DELPHI7} + end + else + begin + Control_SetParentBackground(edCreator, True); + Control_SetParentBackground(edCreationDate, True); + end; + {$ENDIF} + + btnPreview.Enabled := HasGraphic; + PreviewBox.Enabled := HasGraphic; +end; + +procedure TdxfmPSReportProperties.CreateControls; +begin + bvlPreviewHost.Visible := False; + + FPreviewBox := TdxPSImageScrollBox.Create(Self); + with FPreviewBox do + begin + Parent := tshPreview; + Align := alTop; + Anchors := [akLeft..akBottom]; + Height := bvlPreviewHost.Height; + end; +end; + +function TdxfmPSReportProperties.HasGraphic: Boolean; +begin + Result := PreviewBox.HasGraphic; +end; + +procedure TdxfmPSReportProperties.LoadStrings; +begin + inherited; + btnOK.Caption := cxGetResourceString(@sdxBtnOK); + btnCancel.Caption := cxGetResourceString(@sdxBtnCancel); + btnHelp.Caption := cxGetResourceString(@sdxBtnHelp); + btnPreview.Caption := AddEndEllipsis(cxGetResourceString(@sdxPreview)); + + tshSummary.Caption := cxGetResourceString(@sdxSummary); + lblCreator.Caption := cxGetResourceString(@sdxCreator); + lblCreationDate.Caption := cxGetResourceString(@sdxCreationDate); + tshDescription.Caption := DropColon(DropAmpersand(cxGetResourceString(@sdxDescription))); + tshPreview.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); +end; + +function TdxfmPSReportProperties.GetReportCaption: string; +begin + Result := edName.Text; +end; + +function TdxfmPSReportProperties.GetReportCreationDateTime: TDateTime; +begin + Result := SysUtils.StrToDateTime(edCreationDate.Text); +end; + +function TdxfmPSReportProperties.GetReportCreator: string; +begin + Result := edCreator.Text; +end; + +function TdxfmPSReportProperties.GetReportDescription: string; +begin + Result := memDescription.Text; +end; + +procedure TdxfmPSReportProperties.SetReportCaption(const Value: string); +begin + edName.Text := Value; +end; + +procedure TdxfmPSReportProperties.SetReportCreationDateTime(const Value: TDateTime); +const + LongDateFormat = 'mmmm d, yyyy'; +var + SystemTime: TSystemTime; + DefaultLCID: LCID; + DateFormat, TimeFormat: string; + Buffer: array[Byte] of Char; +begin + DateTimeToSystemTime(Value, SystemTime); + DefaultLCID := GetThreadLocale; + + DateFormat := GetLocaleStr(DefaultLCID, LOCALE_SLONGDATE, LongDateFormat); + GetDateFormat(DefaultLCID, 0, @SystemTime, PChar(DateFormat), @Buffer, SizeOf(Buffer)); + edCreationDate.Text := Buffer; + + TimeFormat := GetLocaleStr(DefaultLCID, LOCALE_STIMEFORMAT, LongTimeFormat); + GetTimeFormat(DefaultLCID, 0, @SystemTime, PChar(TimeFormat), @Buffer, SizeOf(Buffer)); + edCreationDate.Text := edCreationDate.Text + ', ' + Buffer; +end; + +procedure TdxfmPSReportProperties.SetReportCreator(const Value: string); +begin + edCreator.Text := Value; +end; + +procedure TdxfmPSReportProperties.SetReportDescription(const Value: string); +begin + memDescription.Text := Value; +end; + +procedure TdxfmPSReportProperties.SetReportPreview(Value: TGraphic); +begin + PreviewBox.Picture.Graphic := Value; +end; + +procedure TdxfmPSReportProperties.FormCloseQuery(Sender: TObject; + var CanClose: Boolean); +begin + CanClose := (ModalResult = mrCancel) or ExplorerItem.IsCurrentlyLoaded or + not ExplorerItem.IsNameChanged(ReportCaption) or ExplorerItem.CanRenameTo(ReportCaption); + if not CanClose then + begin + dxPSUtl.MessageError(ExplorerItem.CannotRenameMessageText(ExplorerItem.DisplayName, ReportCaption)); + ActiveControl := edName; + edName.SelectAll; + end; +end; + +procedure TdxfmPSReportProperties.PreviewClick(Sender: TObject); +begin + dxPcPrVW.dxShowPicturePreview(PreviewBox.Picture.Graphic); +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSfmStlAdd.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSfmStlAdd.dfm new file mode 100644 index 00000000..198f3340 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSfmStlAdd.dfm @@ -0,0 +1,71 @@ +object dxfmSelectStyleClass: TdxfmSelectStyleClass + Left = 427 + Top = 284 + BorderStyle = bsDialog + Caption = 'Select PrintStyle Type' + ClientHeight = 91 + ClientWidth = 279 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + PixelsPerInch = 96 + TextHeight = 13 + object GroupBox1: TGroupBox + Left = 2 + Top = -2 + Width = 275 + Height = 58 + TabOrder = 0 + object Label1: TLabel + Left = 7 + Top = 24 + Width = 28 + Height = 13 + Caption = '&Type:' + FocusControl = cbxStyleTypes + OnClick = Label1Click + end + object cbxStyleTypes: TComboBox + Left = 44 + Top = 20 + Width = 220 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + OnChange = cbxStyleTypesChange + end + end + object btnOK: TButton + Left = 31 + Top = 63 + Width = 79 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 115 + Top = 63 + Width = 79 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object btnHelp: TButton + Left = 198 + Top = 63 + Width = 79 + Height = 23 + Caption = '&Help' + TabOrder = 3 + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSfmStlAdd.pas b/official/x.35/ExpressPrinting System/Sources/dxPSfmStlAdd.pas new file mode 100644 index 00000000..0fe8796e --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSfmStlAdd.pas @@ -0,0 +1,157 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSfmStlAdd; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, dxPSForm, dxPgsDlg; + +type + TdxfmSelectStyleClass = class(TCustomdxPSForm) + GroupBox1: TGroupBox; + btnOK: TButton; + btnCancel: TButton; + btnHelp: TButton; + Label1: TLabel; + cbxStyleTypes: TComboBox; + procedure Label1Click(Sender: TObject); + procedure cbxStyleTypesChange(Sender: TObject); + private + FStyleClass: TdxPrintStyleClass; + procedure RefreshList; + public + constructor Create(AOwner: TComponent); override; + function Execute(const Pt: TPoint): TdxPrintStyleClass; + end; + +function dxSelectStyleClass(const Pt: TPoint): TdxPrintStyleClass; + +implementation + +{$R *.DFM} + +uses + dxPSGlbl; + +function dxSelectStyleClass(const Pt: TPoint): TdxPrintStyleClass; +begin + with TdxfmSelectStyleClass.Create(nil) do + try + Result := Execute(Pt); + finally + Free; + end; +end; + +{ TdxfmAddNewPrintStyle } + +constructor TdxfmSelectStyleClass.Create(AOwner: TComponent); +begin + inherited; + HelpContext := dxPSGlbl.dxhcAddStyleDlg; + btnHelp.Visible := HelpContext <> 0; + if not btnHelp.Visible then + begin + btnOK.BoundsRect := btnCancel.BoundsRect; + btnCancel.BoundsRect := btnHelp.BoundsRect; + end; + FStyleClass := nil; + RefreshList; +end; + +procedure TdxfmSelectStyleClass.RefreshList; +var + SaveCursor: TCursor; +begin + SaveCursor := Screen.Cursor; + Screen.Cursor := crHourGlass; + try + with cbxStyleTypes do + begin + Items.BeginUpdate; + try + Items.Clear; + dxPSGetRegisteredPrintStylesList(cbxStyleTypes.Items); + finally + Items.EndUpdate; + end; + if Items.Count <> 0 then + begin + ItemIndex := Items.IndexOfObject(TObject(dxPgsDlg.dxDefaultPrintStyleClass)); + if ItemIndex = -1 then ItemIndex := 0; + cbxStyleTypesChange(nil); + end; + end; + finally + Screen.Cursor := SaveCursor; + end; +end; + +function TdxfmSelectStyleClass.Execute(const Pt: TPoint): TdxPrintStyleClass; +begin + if (Pt.X = MaxInt) and (Pt.Y = MaxInt) then + Position := poScreenCenter + else + begin + Left := Pt.X; + Top := Pt.Y; + end; + + if ShowModal = mrOK then + Result := FStyleClass + else + Result := nil; +end; + +procedure TdxfmSelectStyleClass.Label1Click(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; + if TComboBox(ActiveControl).Style = csDropDownList then + TComboBox(ActiveControl).DroppedDown := True; +end; + +procedure TdxfmSelectStyleClass.cbxStyleTypesChange(Sender: TObject); +begin + with cbxStyleTypes do + FStyleClass := TdxPrintStyleClass(Items.Objects[ItemIndex]); +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSfmStlDsg.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSfmStlDsg.dfm new file mode 100644 index 00000000..0adb8e98 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSfmStlDsg.dfm @@ -0,0 +1,796 @@ +object dxfmPrintStylesDesignWindow: TdxfmPrintStylesDesignWindow + Left = 395 + Top = 187 + BorderStyle = bsDialog + Caption = 'Print Styles' + ClientHeight = 199 + ClientWidth = 358 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Icon.Data = { + 0000010001001010100000000000280100001600000028000000100000002000 + 00000100040000000000C0000000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000 + 00000000000000000000000000000FFFFFFFFFF000000F00F00000F000000FFF + FFFFFFF000000F00F00000F000000FFFFFFFFFF000000FFFFFFF0FF000000F00 + FFF080F000000F080F08080000440FF080808088804400000808088888440000 + 008088888844000000088888804400000000000000440000000000000000FFFF + 0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F + 0000000400000000000000000000F8000000FC000000FE040000FFFF0000} + KeyPreview = True + OldCreateOrder = True + OnClose = FormClose + OnKeyDown = FormKeyDown + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object pnlButtons: TPanel + Left = 249 + Top = 0 + Width = 109 + Height = 199 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btnAdd: TButton + Left = 6 + Top = 4 + Width = 100 + Height = 22 + Caption = '&Add...' + TabOrder = 0 + OnClick = AddClick + end + object btnDelete: TButton + Tag = 4 + Left = 6 + Top = 31 + Width = 100 + Height = 22 + Caption = '&Delete' + TabOrder = 1 + OnClick = EditClick + end + object btnSelectAll: TButton + Tag = 6 + Left = 6 + Top = 58 + Width = 100 + Height = 22 + Caption = 'Se&lect All' + TabOrder = 2 + OnClick = EditClick + end + object btnPageSetup: TButton + Tag = 1 + Left = 6 + Top = 147 + Width = 100 + Height = 22 + Caption = 'Pa&ge Setup...' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 5 + OnClick = PageSetupClick + end + object btnMoveUp: TButton + Left = 6 + Top = 89 + Width = 100 + Height = 22 + Caption = 'Move &Up' + TabOrder = 3 + OnClick = MoveUpClick + end + object btnMoveDown: TButton + Tag = 1 + Left = 6 + Top = 116 + Width = 100 + Height = 22 + Caption = 'Move Dow&n' + TabOrder = 4 + OnClick = MoveDownClick + end + object btnRestoreDefaults: TButton + Left = 6 + Top = 174 + Width = 100 + Height = 22 + Caption = 'Rest&ore Defaults' + TabOrder = 6 + OnClick = RestoreDefaultsClick + end + end + object lbxStyles: TListBox + Left = 0 + Top = 0 + Width = 249 + Height = 199 + Style = lbOwnerDrawFixed + Align = alClient + Ctl3D = True + DragMode = dmAutomatic + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ItemHeight = 34 + MultiSelect = True + ParentCtl3D = False + ParentFont = False + PopupMenu = pmStyles + TabOrder = 1 + OnClick = lbxStylesClick + OnDblClick = PageSetupClick + OnDragDrop = lbxStylesDragDrop + OnDragOver = lbxStylesDragOver + OnDrawItem = lbxStylesDrawItem + OnEndDrag = lbxStylesEndDrag + OnKeyPress = lbxStylesKeyPress + OnStartDrag = lbxStylesStartDrag + end + object pmStyles: TPopupMenu + OnPopup = pmStylesPopup + Left = 13 + Top = 9 + object miAdd: TMenuItem + Caption = '&Add...' + ShortCut = 45 + OnClick = AddClick + end + object miAddStandard: TMenuItem + Caption = 'Add' + ShortCut = 32813 + OnClick = AddStandardClick + end + object miLine5: TMenuItem + Caption = '-' + end + object miEdit: TMenuItem + Caption = '&Edit' + object miCut: TMenuItem + Tag = 2 + Caption = 'Cu&t' + ShortCut = 16472 + OnClick = EditClick + end + object miCopy: TMenuItem + Tag = 1 + Caption = '&Copy' + ShortCut = 16451 + OnClick = EditClick + end + object miPaste: TMenuItem + Tag = 3 + Caption = '&Paste' + ShortCut = 16470 + OnClick = EditClick + end + object miDelete: TMenuItem + Tag = 4 + Caption = '&Delete' + ShortCut = 46 + OnClick = EditClick + end + object N2: TMenuItem + Caption = '-' + end + object miSelectAll: TMenuItem + Tag = 6 + Caption = 'Se&lect All' + ShortCut = 16449 + OnClick = EditClick + end + end + object N1: TMenuItem + Caption = '-' + end + object miMoveUp: TMenuItem + Caption = 'Move &Up' + ShortCut = 16422 + OnClick = MoveUpClick + end + object miMoveDown: TMenuItem + Caption = 'Move Dow&n' + ShortCut = 16424 + OnClick = MoveDownClick + end + object miLine1: TMenuItem + Caption = '-' + end + object miPageSetup: TMenuItem + Tag = 1 + Caption = 'Pa&ge Setup...' + Default = True + ShortCut = 16397 + OnClick = PageSetupClick + end + object miSetAsCurrent: TMenuItem + Caption = '&Make Current' + ShortCut = 16416 + OnClick = miSetAsCurrentClick + end + object miLine: TMenuItem + Caption = '-' + end + object miRestoreDefaults: TMenuItem + Caption = 'Rest&ore Defaults' + ShortCut = 16463 + OnClick = RestoreDefaultsClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miBackground: TMenuItem + Caption = 'Bac&kground' + object miBackgroundEffects: TMenuItem + Tag = 4 + Caption = 'E&ffects...' + OnClick = BackgroundClick + end + object miBackgroundClear: TMenuItem + Tag = 5 + Caption = 'Clear' + OnClick = ClearBackgroundClick + end + end + object N3: TMenuItem + Caption = '-' + end + object miShowButtons: TMenuItem + Caption = 'Show &Button Bar' + Checked = True + OnClick = miShowButtonsClick + end + end + object ilMenu: TImageList + Left = 41 + Top = 9 + Bitmap = { + 494C01010A000F00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000004000000001002000000000000040 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084848400FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084848400FFFF + FF000000000000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484000000 + 00008484840000000000FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848400000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400848484008484840000000000FFFFFF00FFFFFF0000FFFF0084848400FFFF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C6C6C600C6C6 + C600C6C6C600848484008484840000000000FFFFFF00FFFFFF00840000008484 + 8400FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008484000084840000848400008484000084840000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00C6C6C600C6C6 + C600C6C6C600C6C6C60084848400848484000000000000FFFF00840000008400 + 0000FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000848400008484000084840000848400008484000084840000848400000000 + 000000000000000000000000000000000000C6C6C600FFFFFF00FFFFFF00C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084000000840000008400 + 0000FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 00000000000000000000000000000000000000000000C6C6C600FFFFFF00FFFF + FF00C6C6C60000000000C6C6C600C6C6C6008484840084000000840000008400 + 0000FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C6C6C600FFFF + FF00000000008400000000000000C6C6C6008400000084000000840000008484 + 8400FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C600FFFFFF0084000000C6C6C60084848400840000008400000084848400FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000840000000000 + 0000C6C6C60084000000848484000000000084848400FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084000000C6C6 + C60000000000840000000000000084848400FFFFFF0000FFFF00FFFFFF008484 + 8400C6C6C6000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084000000C6C6 + C600C6C6C600840000008484840000FFFF00FFFFFF00FFFFFF00FFFFFF008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484008400 + 0000840000008484840084848400848484008484840084848400848484008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000008400000084000000840000008400000084000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFF + FF00000000000000000000000000000000008400000084000000840000008400 + 0000840000008400000084000000840000008400000084000000840000008400 + 0000840000008400000084000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFF + FF00000000000000000000000000000000008400000084000000840000008400 + 000084000000840000008484840084000000FFFFFF0084000000840000008400 + 0000840000008400000084000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000000000 + 0000848400008484000084840000848400008484000084840000848400000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000000000 + 0000000000008484000084840000848400008484000084840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000008400000084000000848484008484 + 84008484840084848400840000000000000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000000000 + 0000000000000000000000000000848400000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084000000840000008400 + 0000840000008400000000000000000000000000000084000000840000008400 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000840000008400000084000000840000008400 + 000084000000840000008400000084000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000840000008400000084000000840000008400 + 0000840000008400000084000000000000000000000000000000000000008400 + 0000000000000000000084000000000000000000000084000000840000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0084000000000000000000000000000000FFFF + FF000000000000FF000000000000FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000000000000000008400 + 0000000000000000000084000000000000008400000000000000000000008400 + 0000000000000000000000000000000000000000000084848400008484008484 + 8400008484008484840084000000FFFFFF008400000084000000840000008400 + 00008400000084000000FFFFFF0084000000000000000000000000000000FFFF + FF000000000000FF000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF000000000000000000000000000000 + 000000000000FFFFFF0084000000000000000000000000000000000000008400 + 0000000000000000000084000000000000008400000000000000000000008400 + 0000000000000000000000000000000000000000000000848400848484000084 + 8400848484000084840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0084000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000000000000000000000 + 0000840000008400000084000000000000008400000000000000000000008400 + 0000000000000000000000000000000000000000000084848400008484008484 + 8400008484008484840084000000FFFFFF00840000008400000084000000FFFF + FF0084000000840000008400000084000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF000000000000000000000000000000 + 000000000000FFFFFF0084000000000000000000000000000000000000000000 + 0000000000000000000084000000000000008400000084000000840000000000 + 0000000000000000000000000000000000000000000000848400848484000084 + 8400848484000084840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0084000000FFFFFF008400000000000000000000000000000000000000FFFF + FF00FF000000FF0000008400000000000000000000000000000000000000FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000000000000000000000 + 0000000000000000000084000000000000008400000000000000000000000000 + 0000000000000000000000000000000000000000000084848400008484008484 + 8400008484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00840000008400000000000000000000000000000000000000000000000000 + 0000FF000000FF00000084000000000000000000000000000000000000000000 + 0000FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF000000000000000000FFFFFF008400 + 0000840000008400000084000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000848400848484000084 + 8400848484000084840084000000840000008400000084000000840000008400 + 0000840000000000000000000000000000000000000084000000840000008400 + 0000FF000000FF00000084000000840000008400000000000000000000000000 + 0000FFFFFF0000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 0000FFFFFF008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400008484008484 + 8400008484008484840000848400848484000084840084848400008484008484 + 84000084840000000000000000000000000000000000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF00000000000000000000000000 + 0000FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000848400848484000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 84008484840000000000000000000000000000000000FF000000FF000000FF00 + 0000FF000000FF000000840000008400000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00000000000000 + 0000FFFFFF000000000084000000840000008400000084000000840000008400 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400848484000000 + 0000C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600000000008484 + 840000848400000000000000000000000000000000000000000000000000FFFF + FF00FF000000FF0000008400000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000848400848484000084 + 84000000000000FFFF00000000000000000000FFFF0000000000848484000084 + 840084848400000000000000000000000000000000000000000000000000FFFF + FF00FF000000FF00000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000FFFF0000FFFF000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000400000000100010000000000000200000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFF00000000FFFFC00100000000 + FFFFC00100000000FFFFC00100000000FEFFC00100000000FC7FC00100000000 + F83F800100000000F01F000100000000E00F000100000000C007000100000000 + F83F800100000000F83FC00100000000F83FC00100000000F83FC00300000000 + FFFFC00700000000FFFFC00F00000000FFFFF80FFFFFFFFFFFFFF007FFFFFFFF + FFF9F007F83FFFFFE7FFF0070001FFFFC3F3F0070001F83FC3E7F0070001F83F + E1C7F0070001F83FF08FF0070001F83FF81FF0070001C007FC3FF0070001E00F + F81FF0070001F01FF09FE0030001F83FC1C7E0030101FC7F83E3F0078383FEFF + 8FF1FE3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC03FFFFFF3FFFC00 + C09FFC01ED9F8000CAAFFC01ED6F0000CA97FC01ED6F0000C0030001F16F0000 + C1C30001FD1F0001C1E30001FC7F0003D1F30001FEFF000380330003FC7F0003 + 80330007FD7F00038003000FF93F0003C10300FFFBBF0003C00301FFFBBF8007 + C00303FFFBBFF87FC003FFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSfmStlDsg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSfmStlDsg.pas new file mode 100644 index 00000000..66660fb4 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSfmStlDsg.pas @@ -0,0 +1,1373 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSfmStlDsg; + +interface + +{$I cxVer.inc} + +uses + {$IFDEF DELPHI6} + DesignIntf, DesignWindows, + {$ELSE} + DsgnIntf, DsgnWnds, LibIntf, + {$ENDIF} + Windows, Messages, SysUtils, Classes, Graphics, Controls, StdCtrls, Dialogs, + ExtCtrls, ComCtrls, Menus, Forms, Buttons, ImgList, dxPgsDlg, dxPSDsgProxies; + +type + TdxfmPrintStylesDesignWindow = class(TDesignWindow) + pmStyles: TPopupMenu; + pnlButtons: TPanel; + btnAdd: TButton; + btnDelete: TButton; + miAdd: TMenuItem; + miDelete: TMenuItem; + miLine1: TMenuItem; + miLine2: TMenuItem; + miSelectAll: TMenuItem; + btnSelectAll: TButton; + btnPageSetup: TButton; + miPageSetup: TMenuItem; + miCopy: TMenuItem; + miCut: TMenuItem; + miPaste: TMenuItem; + miRestoreDefaults: TMenuItem; + miLine: TMenuItem; + miShowButtons: TMenuItem; + miLine5: TMenuItem; + ilMenu: TImageList; + btnMoveUp: TButton; + btnMoveDown: TButton; + miMoveUp: TMenuItem; + miMoveDown: TMenuItem; + miBackgroundEffects: TMenuItem; + miBackgroundClear: TMenuItem; + N2: TMenuItem; + btnRestoreDefaults: TButton; + miSetAsCurrent: TMenuItem; + N3: TMenuItem; + lbxStyles: TListBox; + miEdit: TMenuItem; + N1: TMenuItem; + miBackground: TMenuItem; + miAddStandard: TMenuItem; + procedure pmStylesPopup(Sender: TObject); + procedure lbxStylesClick(Sender: TObject); + procedure lbxStylesDragDrop(Sender, Source: TObject; X, Y: Integer); + procedure lbxStylesDragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); + procedure FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure RestoreDefaultsClick(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure EditClick(Sender: TObject); + procedure miShowButtonsClick(Sender: TObject); + procedure MoveUpClick(Sender: TObject); + procedure MoveDownClick(Sender: TObject); + procedure lbxStylesEndDrag(Sender, Target: TObject; X, Y: Integer); + procedure lbxStylesStartDrag(Sender: TObject; + var DragObject: TDragObject); + procedure PageSetupClick(Sender: TObject); + procedure BackgroundClick(Sender: TObject); + procedure ClearBackgroundClick(Sender: TObject); + procedure lbxStylesDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure miSetAsCurrentClick(Sender: TObject); + procedure lbxStylesKeyPress(Sender: TObject; var Key: Char); + procedure AddClick(Sender: TObject); + procedure AddStandardClick(Sender: TObject); + procedure FormResize(Sender: TObject); + private + FController: TdxPrintStyleManager; + FSaveCursor: TCursor; + FSaveDragIndex: Integer; + + function GetCurrentStyle: TBasedxPrintStyle; + function GetControllerDesigner: TAbstractdxStyleManagerDesigner; + function GetRegistryPath: string; + function GetSelected(Index: Integer): Boolean; + function GetSelectedCount: Integer; + function GetStyleCount: Integer; + function GetStyle(Index: Integer): TBasedxPrintStyle; + procedure SetController(Value: TdxPrintStyleManager); + procedure SetSelected(Index: Integer; Value: Boolean); + + procedure AddStyle; + function CanAdd: Boolean; + function CanAddStandard: Boolean; + function CanBackgroundClear: Boolean; + function CanBackgroundEffects: Boolean; + function CanCopy: Boolean; + function CanCut: Boolean; + function CanDelete: Boolean; + function CanMoveDown: Boolean; + function CanMoveUp: Boolean; + function CanPaste: Boolean; + function CanPageSetup: Boolean; + function CanRestoreDefaults: Boolean; + function CanSelectAll: Boolean; + function CanSetAsCurrent: Boolean; + {$IFDEF DELPHI5} + procedure CheckAddStyle; + {$ENDIF} + procedure CheckDeleteStyle; + procedure Copy; + procedure Cut; + procedure Delete; + procedure DeleteItem(AItem: TBasedxPrintStyle); + procedure DrawDragRect; + function GetMinWindowSize: TPoint; + procedure GetSelections(const ASelections: TdxDesignSelectionList); + function IndexOf(AItem: TBasedxPrintStyle): Integer; + procedure InternalAddStyle(AStyleClass: TdxPrintStyleClass); + procedure MoveSelection(ADelta: Integer); + procedure Paste; + procedure PrepareAddStandardItem(MenuItem: TMenuItem); + procedure RefreshList; + procedure RestoreLayout; + procedure Select(AItem: TPersistent; AddToSelection: Boolean); + procedure SelectAll; + procedure SelectController; + procedure StartWait; + procedure StopWait; + procedure StoreLayout; + procedure UpdateCaption; + procedure UpdateControlsState; + procedure UpdateHScrollBar; + procedure UpdateItem(AItem: TBasedxPrintStyle); + procedure UpdateMenuState; + procedure UpdateSelections(const ASelections: TdxDesignSelectionList); + procedure WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); message WM_GETMINMAXINFO; + procedure WMNCCreate(var Message: TWMNCCreate); message WM_NCCREATE; + procedure WMNCDestroy(var Message: TWMNCCreate); message WM_NCDESTROY; + protected + procedure Activated; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + function UniqueName(Comp: TComponent): string; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + {$IFDEF DELPHI6} + function EditAction(Action: TEditAction): Boolean; override; + procedure ItemDeleted(const ADesigner: IDesigner; Item: TPersistent); override; + procedure ItemsModified(const Designer: IDesigner); override; + procedure SelectionChanged(const ADesigner: IDesigner; const ASelection: IDesignerSelections); override; + {$ELSE} + procedure ComponentDeleted(Component: IPersistent); override; + procedure EditAction(Action: TEditAction); override; + procedure SelectionChanged(ASelection: {$IFDEF DELPHI5} TDesignerSelectionList {$ELSE} TComponentList{$ENDIF}); override; + procedure FormModified; override; + {$ENDIF} + function GetEditState: TEditState; override; + + property CurrentStyle: TBasedxPrintStyle read GetCurrentStyle; + property Controller: TdxPrintStyleManager read FController write SetController; + property ControllerDesigner: TAbstractdxStyleManagerDesigner read GetControllerDesigner; + property RegistryPath: string read GetRegistryPath; + property Selected[Index: Integer]: Boolean read GetSelected write SetSelected; + property SelectedCount: Integer read GetSelectedCount; + property StyleCount: Integer read GetStyleCount; + property Styles[Index: Integer]: TBasedxPrintStyle read GetStyle; + end; + +procedure dxShowPrintStylesDesigner(AStyleController: TdxPrintStyleManager; AFormDesigner: TFormDesigner); +//function dxPrintStyleUniqueName(AStyleController: TdxPrintStyleManager; AComponent: TComponent): string; + +implementation + +{$R *.DFM} + +uses + {$IFDEF DELPHI5} + DesignConst, + {$ELSE} + LibConst, + {$ENDIF} + Registry, CommCtrl, dxPrnPg, dxBkgnd, dxPSGlbl, dxPSUtl, dxPSPopupMan, + dxPSfmStlAdd; + +const + sdxCantPasteComponent = 'Can''t paste component %s here !'; + sdxStyleDesigner = 'Editing %s%s%s Styles'; + + { don't localize } + sdxButtonBar = 'ButtonBar'; + sdxWidth = 'Width'; + sdxHeight = 'Height'; + +type + TdxStyleManagerDesigner = class(TAbstractdxStyleManagerDesigner) + private + FDesignWindow: TdxfmPrintStylesDesignWindow; + FFormDesigner: TFormDesigner; + FUpdateCount: Integer; + + function GetDesignWindow: TdxfmPrintStylesDesignWindow; + procedure Activate; + protected + procedure Modified; override; + procedure Update(AItem: TBasedxPrintStyle); override; + public + constructor Create(AStyleController: TdxPrintStyleManager; AFormDesigner: TFormDesigner); + destructor Destroy; override; + + procedure BeginUpdate; override; + procedure CancelUpdate; override; + procedure EndUpdate; override; + + property DesignWindow: TdxfmPrintStylesDesignWindow read GetDesignWindow; + property FormDesigner: TFormDesigner read FFormDesigner; + end; + +procedure dxShowPrintStylesDesigner(AStyleController: TdxPrintStyleManager; AFormDesigner: TFormDesigner); +begin + if AStyleController.Designer = nil then + TdxStyleManagerDesigner.Create(AStyleController, AFormDesigner); + TdxStyleManagerDesigner(AStyleController.Designer).Activate; +end; + +{ TdxStyleManagerDesigner } + +constructor TdxStyleManagerDesigner.Create(AStyleController: TdxPrintStyleManager; + AFormDesigner: TFormDesigner); +begin + inherited Create(AStyleController); + FFormDesigner := AFormDesigner; +end; + +destructor TdxStyleManagerDesigner.Destroy; +begin + if FDesignWindow <> nil then + begin + FDesignWindow.Designer := nil; + FDesignWindow.Free; + end; + inherited Destroy; +end; + +procedure TdxStyleManagerDesigner.BeginUpdate; +begin + Inc(FUpdateCount); +end; + +procedure TdxStyleManagerDesigner.CancelUpdate; +begin + if FUpdateCount <> 0 then Dec(FUpdateCount); +end; + +procedure TdxStyleManagerDesigner.EndUpdate; +begin + if FUpdateCount <> 0 then + begin + Dec(FUpdateCount); + if FUpdateCount = 0 then Update(nil); + end; +end; + +function TdxStyleManagerDesigner.GetDesignWindow: TdxfmPrintStylesDesignWindow; +begin + if FDesignWindow = nil then + begin + FDesignWindow := TdxfmPrintStylesDesignWindow.Create(nil); + FDesignWindow.Designer := FormDesigner; + FDesignWindow.Controller := StyleManager; + end; + Result := FDesignWindow; +end; + +procedure TdxStyleManagerDesigner.Activate; +begin + DesignWindow.Show; +end; + +procedure TdxStyleManagerDesigner.Modified; +begin + if FormDesigner <> nil then FormDesigner.Modified; +end; + +procedure TdxStyleManagerDesigner.Update(AItem: TBasedxPrintStyle); +begin + if (FUpdateCount = 0) and (FDesignWindow <> nil) then + DesignWindow.UpdateItem(AItem); +end; + +{ TdxfmPrintStylesDesignWindow } + +constructor TdxfmPrintStylesDesignWindow.Create(AOwner: TComponent); + + function MakeTTag(AnAction: TEditAction): Integer ; + begin + Result := Integer(AnAction); + end; + +begin + HelpContext := dxPSGlbl.dxhcPrintStylesDesignWindow; + inherited; + + pmStyles.Images := ilMenu; + miAdd.ImageIndex := 0; + miCopy.ImageIndex := 1; + miCut.ImageIndex := 2; + miPaste.ImageIndex := 3; + miDelete.ImageIndex := 4; + miPageSetup.ImageIndex := 6; + miMoveUp.ImageIndex := 7; + miMoveDown.ImageIndex := 8; + miBackgroundEffects.ImageIndex := 9; + + miCut.Tag := MakeTTag(eaCut); + miCopy.Tag := MakeTTag(eaCopy); + miPaste.Tag := MakeTTag(eaPaste); + miDelete.Tag := MakeTTag(eaDelete); + miSelectAll.Tag := MakeTTag(eaSelectAll); + + btnDelete.Tag := MakeTTag(eaDelete); + btnSelectAll.Tag := MakeTTag(eaSelectAll); + + RestoreLayout; + dxPSPopupMenuController.RegisterControl(lbxStyles); +end; + +destructor TdxfmPrintStylesDesignWindow.Destroy; +begin + dxPSPopupMenuController.UnregisterControl(lbxStyles); + StoreLayout; + if ControllerDesigner <> nil then + TdxStyleManagerDesigner(ControllerDesigner).FDesignWindow := nil; + inherited Destroy; +end; + +procedure TdxfmPrintStylesDesignWindow.FormKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +var + MenuItem: TMenuItem; +begin + MenuItem := pmStyles.FindItem(Key, fkShortCut); + if (MenuItem <> nil) and MenuItem.Enabled and MenuItem.Visible then + begin + MenuItem.Click; + Key := 0; + end + else + if Key = VK_ESCAPE then + begin + Close; + Key := 0; + end; +end; + +procedure TdxfmPrintStylesDesignWindow.FormResize(Sender: TObject); +begin + UpdateHScrollBar; +end; + +procedure TdxfmPrintStylesDesignWindow.FormClose(Sender: TObject; + var Action: TCloseAction); +begin + if not (csDestroying in Controller.ComponentState) then + SelectController; + Action := caFree; +end; + +procedure TdxfmPrintStylesDesignWindow.AddClick(Sender: TObject); +begin + AddStyle; + ActiveControl := lbxStyles; +end; + +procedure TdxfmPrintStylesDesignWindow.lbxStylesClick(Sender: TObject); +var + Selections: TdxDesignSelectionList; +begin + Selections := CreateDesignSelectionList; + GetSelections(Selections); + Designer.SetSelections(Selections); +end; + +procedure TdxfmPrintStylesDesignWindow.PageSetupClick(Sender: TObject); +begin + if CurrentStyle.PageSetup then Designer.Modified; +end; + +procedure TdxfmPrintStylesDesignWindow.lbxStylesStartDrag(Sender: TObject; + var DragObject: TDragObject); +begin + FSaveDragIndex := -1; +end; + +procedure TdxfmPrintStylesDesignWindow.lbxStylesEndDrag(Sender, + Target: TObject; X, Y: Integer); +begin + DrawDragRect; +end; + +procedure TdxfmPrintStylesDesignWindow.lbxStylesDragOver(Sender, + Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); +var + Index: Integer; +begin + Accept := Sender = Source; + if Accept then + with TListBox(Sender) do + begin + Index := ItemAtPos(MakePoint(X, Y), True); + Accept := (Index <> -1) and (FSaveDragIndex <> ItemIndex); + DrawDragRect; + FSaveDragIndex := Index; + DrawDragRect; + end; +end; + +procedure TdxfmPrintStylesDesignWindow.lbxStylesDragDrop(Sender, + Source: TObject; X, Y: Integer); +begin + MoveSelection(FSaveDragIndex - TListBox(Sender).ItemIndex); +end; + +procedure TdxfmPrintStylesDesignWindow.lbxStylesKeyPress(Sender: TObject; + var Key: Char); +begin + case Key of + #13, #33..#126: + begin + if Key = #13 then Key := #0; + ActivateInspector(Key); + Key := #0; + end; + #27: + begin + SelectController; + Key := #0; + end; + end; +end; + +procedure TdxfmPrintStylesDesignWindow.EditClick(Sender: TObject); +begin + EditAction(TEditAction(TComponent(Sender).Tag)); +end; + +procedure TdxfmPrintStylesDesignWindow.MoveUpClick(Sender: TObject); +begin + MoveSelection(-1); +end; + +procedure TdxfmPrintStylesDesignWindow.MoveDownClick(Sender: TObject); +begin + MoveSelection(1); +end; + +procedure TdxfmPrintStylesDesignWindow.lbxStylesDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +begin + dxPgsDlg.dxPSDrawStyleItem(Styles[Index], TListBox(Control), Index, State, Rect, False, True); +end; + +procedure TdxfmPrintStylesDesignWindow.miSetAsCurrentClick(Sender: TObject); +begin + Controller.CurrentStyle := CurrentStyle; +end; + +procedure TdxfmPrintStylesDesignWindow.RestoreDefaultsClick(Sender: TObject); +var + I: Integer; +begin + for I := 0 to StyleCount - 1 do + if Selected[I] or (SelectedCount = 0) then + Styles[I].RestoreDefaults; +end; + +procedure TdxfmPrintStylesDesignWindow.BackgroundClick(Sender: TObject); +var + Background: TdxBackground; + I: Integer; +begin + StartWait; + try + Background := TdxBackground.Create; + try + for I := 0 to StyleCount - 1 do + if Selected[I] or (SelectedCount = 0) then + begin + Background.Assign(Styles[I].PrinterPage.Background); + Break; + end; + + if Background.SetupEffects then + begin + for I := 0 to StyleCount - 1 do + if Selected[I] or (SelectedCount = 0) then + Styles[I].PrinterPage.Background := Background; + Designer.Modified; + end; + finally + Background.Free; + end; + finally + StopWait; + end; +end; + +procedure TdxfmPrintStylesDesignWindow.ClearBackgroundClick(Sender: TObject); +var + I: Integer; +begin + for I := 0 to StyleCount - 1 do + if Selected[I] or (SelectedCount = 0) then + Styles[I].PrinterPage.Background.Clear; + Designer.Modified; +end; + +procedure TdxfmPrintStylesDesignWindow.pmStylesPopup(Sender: TObject); +begin + UpdateMenuState; +end; + +procedure TdxfmPrintStylesDesignWindow.miShowButtonsClick(Sender: TObject); +begin + pnlButtons.Visible := not pnlButtons.Visible; +end; + +{$IFDEF DELPHI6} +function TdxfmPrintStylesDesignWindow.EditAction(Action: TEditAction): Boolean; +{$ELSE} +procedure TdxfmPrintStylesDesignWindow.EditAction(Action: TEditAction); +{$ENDIF} +begin + {$IFDEF DELPHI6} + Result := True; + {$ENDIF} + case Action of + eaCut: Cut; + eaCopy: Copy; + eaPaste: Paste; + eaDelete: Delete; + eaSelectAll: SelectAll; + end; +end; + +function TdxfmPrintStylesDesignWindow.GetEditState: TEditState; +begin + Result := []; + if CanCut then + Result := Result + [esCanCut]; + if CanCopy then + Result := Result + [esCanCopy]; + if CanPaste then + Result := Result + [esCanPaste]; + if CanDelete then + Result := Result + [esCanDelete]; + if CanSelectAll then + Result := Result + [esCanSelectAll]; +end; + +{$IFDEF DELPHI6} + +procedure TdxfmPrintStylesDesignWindow.ItemDeleted(const ADesigner: IDesigner; + Item: TPersistent); +begin + inherited; + if (ADesigner = Designer) and (Item is TBasedxPrintStyle) and + (Controller <> nil) and not (csDestroying in Controller.ComponentState) then + DeleteItem(TBasedxPrintStyle(Item)); +end; + +procedure TdxfmPrintStylesDesignWindow.ItemsModified(const Designer: IDesigner); +begin + inherited; + UpdateCaption; +end; + +procedure TdxfmPrintStylesDesignWindow.SelectionChanged(const ADesigner: IDesigner; + const ASelection: IDesignerSelections); +begin + inherited; + UpdateSelections(ASelection); +end; + +{$ELSE} + +procedure TdxfmPrintStylesDesignWindow.ComponentDeleted(Component: IPersistent); +var + Item: TPersistent; +begin + inherited; + Item := dxPSDsgProxies.TryExtractPersistent(Component); + if (Item is TBasedxPrintStyle) and + (Controller <> nil) and not (csDestroying in Controller.ComponentState) then + DeleteItem(TBasedxPrintStyle(Item)); +end; + +procedure TdxfmPrintStylesDesignWindow.SelectionChanged( + ASelection: {$IFDEF DELPHI5} TDesignerSelectionList {$ELSE} TComponentList {$ENDIF}); +begin + inherited; + UpdateSelections(ASelection); +end; + +procedure TdxfmPrintStylesDesignWindow.FormModified; +begin + inherited; + UpdateCaption; +end; + +{$ENDIF} + +procedure TdxfmPrintStylesDesignWindow.Activated; +var + Selections: TdxDesignSelectionList; +begin + inherited Activated; + Selections := CreateDesignSelectionList; + try + Designer.GetSelections(Selections); + UpdateSelections(Selections); + finally + FreeDesignSelectionList(Selections); + end; +end; + +procedure TdxfmPrintStylesDesignWindow.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + Style := Style or WS_THICKFRAME; +{$IFDEF DELPHI9} + Params.WndParent := Application.MainForm.Handle; +{$ENDIF} +end; + +procedure TdxfmPrintStylesDesignWindow.CreateWnd; +begin + inherited CreateWnd; + SendMessage(Handle, WM_SETICON, 1, Icon.Handle) +end; + +function TdxfmPrintStylesDesignWindow.UniqueName(Comp: TComponent): string; +begin + Result := dxPgsDlg.dxPSPrintStyleUniqueName(Controller, Comp); +end; + +function TdxfmPrintStylesDesignWindow.GetCurrentStyle: TBasedxPrintStyle; +begin + if StyleCount <> 0 then + Result := Styles[lbxStyles.ItemIndex] + else + Result := nil; +end; + +function TdxfmPrintStylesDesignWindow.GetControllerDesigner: TAbstractdxStyleManagerDesigner; +begin + if Controller <> nil then + Result := Controller.Designer + else + Result := nil; +end; + +function TdxfmPrintStylesDesignWindow.GetRegistryPath: string; +begin + Result := + dxPSDsgProxies.GetBaseRegistryKey + '\' + dxPSGlbl.sdxPSRegPathRunTimeFormLayouts + '\' + dxPSUtl.DropT(ClassName); +end; + +function TdxfmPrintStylesDesignWindow.GetSelected(Index: Integer): Boolean; +begin + Result := lbxStyles.Selected[Index]; +end; + +function TdxfmPrintStylesDesignWindow.GetSelectedCount: Integer; +begin + Result := lbxStyles.SelCount; +end; + +function TdxfmPrintStylesDesignWindow.GetStyleCount: Integer; +begin + Result := lbxStyles.Items.Count; +end; + +function TdxfmPrintStylesDesignWindow.GetStyle(Index: Integer): TBasedxPrintStyle; +begin + Result := TBasedxPrintStyle(lbxStyles.Items.Objects[Index]); +end; + +procedure TdxfmPrintStylesDesignWindow.SetController(Value: TdxPrintStyleManager); +begin + if FController <> Value then + begin + FController := Value; + UpdateCaption; + RefreshList; + end; +end; + +procedure TdxfmPrintStylesDesignWindow.SetSelected(Index: Integer; Value: Boolean); +begin + lbxStyles.Selected[Index] := Value; +end; + +procedure TdxfmPrintStylesDesignWindow.AddStyle; +var + StyleClass: TdxPrintStyleClass; + Origin: TPoint; +begin + {$IFDEF DELPHI5} + CheckAddStyle; + {$ENDIF} + Origin := ClientToScreen(MakePoint(btnAdd.Left + btnAdd.Width, btnAdd.Top - 40)); + StyleClass := dxSelectStyleClass(Origin); + if StyleClass <> nil then + InternalAddStyle(StyleClass); +end; + +procedure TdxfmPrintStylesDesignWindow.AddStandardClick(Sender: TObject); +var + StyleClass: TdxPrintStyleClass; +begin + {$IFDEF DELPHI5} + CheckAddStyle; + {$ENDIF} + StyleClass := TdxPrintStyleClass(TComponent(Sender).Tag); + if StyleClass <> nil then + InternalAddStyle(StyleClass); +end; + +function TdxfmPrintStylesDesignWindow.CanAdd: Boolean; +begin +{$IFDEF DELPHI5} + Result := not ((Controller <> nil) and (Controller.Owner <> nil) and + (csInline in Controller.Owner.ComponentState)); +{$ELSE} + Result := True; +{$ENDIF} +end; + +function TdxfmPrintStylesDesignWindow.CanAddStandard: Boolean; +begin + Result := CanAdd and (CurrentStyle <> nil); +end; + +function TdxfmPrintStylesDesignWindow.CanBackgroundClear: Boolean; +begin + Result := StyleCount <> 0; +end; + +function TdxfmPrintStylesDesignWindow.CanBackgroundEffects: Boolean; +begin + Result := StyleCount <> 0; +end; + +function TdxfmPrintStylesDesignWindow.CanCopy: Boolean; +begin + Result := SelectedCount <> 0; +end; + +function TdxfmPrintStylesDesignWindow.CanCut: Boolean; +begin + Result := CanCopy and CanDelete; +end; + +function TdxfmPrintStylesDesignWindow.CanDelete: Boolean; +var + I: Integer; +begin + Result := SelectedCount <> 0; + if Result then + for I := 0 to StyleCount - 1 do + if Selected[I] and (csAncestor in Styles[I].ComponentState) then + begin + Result := False; + Exit; + end; +end; + +function TdxfmPrintStylesDesignWindow.CanMoveDown: Boolean; +var + I, Counter: Integer; +begin + Counter := 0; + for I := StyleCount - 1 downto 0 do + begin + if not Selected[I] then + begin + Result := Counter < SelectedCount; + Exit; + end; + Inc(Counter); + end; + Result := False; +end; + +function TdxfmPrintStylesDesignWindow.CanMoveUp: Boolean; +var + I: Integer; +begin + for I := 0 to StyleCount - 1 do + if not Selected[I] then + begin + Result := I < SelectedCount; + Exit; + end; + Result := False; +end; + +function TdxfmPrintStylesDesignWindow.CanPaste: Boolean; +begin + Result := CanAdd and ClipboardComponents {$IFDEF DELPHI5} and Designer.CanPaste {$ENDIF}; +end; + +function TdxfmPrintStylesDesignWindow.CanPageSetup: Boolean; +begin + Result := SelectedCount = 1; +end; + +function TdxfmPrintStylesDesignWindow.CanRestoreDefaults: Boolean; +begin + Result := CurrentStyle <> nil; +end; + +function TdxfmPrintStylesDesignWindow.CanSelectAll: Boolean; +begin + Result := StyleCount <> SelectedCount; +end; + +function TdxfmPrintStylesDesignWindow.CanSetAsCurrent: Boolean; +begin + Result := (SelectedCount = 1) and not CurrentStyle.IsCurrentStyle; +end; + +{$IFDEF DELPHI5} +procedure TdxfmPrintStylesDesignWindow.CheckAddStyle; +begin + if not CanAdd then + raise Exception.CreateRes(@SCantAddToFrame); +end; +{$ENDIF} + +procedure TdxfmPrintStylesDesignWindow.CheckDeleteStyle; +begin + if not CanDelete then + {$IFDEF DELPHI5} + raise Exception.CreateRes(@SCantDeleteAncestor); + {$ELSE} + raise Exception.Create(SCantDeleteAncestor); + {$ENDIF} +end; + +procedure TdxfmPrintStylesDesignWindow.Copy; +var + Components: TdxDesignSelectionList; +begin + Components := CreateDesignSelectionList; + try + GetSelections(Components); + CopyComponents(Controller.Owner, Components); + finally + FreeDesignSelectionList(Components); + end; + UpdateHScrollBar; +end; + +procedure TdxfmPrintStylesDesignWindow.Cut; +begin + Copy; + CheckDeleteStyle; + Delete; +end; + +procedure TdxfmPrintStylesDesignWindow.Delete; +var + Selections: TdxDesignSelectionList; + I, ItemIndex: Integer; + Item: TComponent; +begin + StartWait; + try + ControllerDesigner.BeginUpdate; + try + Selections := CreateDesignSelectionList; + try + GetSelections(Selections); + ItemIndex := lbxStyles.ItemIndex; + for I := 0 to Selections.Count - 1 do + begin + Item := TComponent(Selections[I]); + if not (csAncestor in Item.ComponentState) then Item.Free; + end; + if ItemIndex < 0 then + ItemIndex := 0; + if ItemIndex > StyleCount - 1 then + ItemIndex := StyleCount - 1; + finally + FreeDesignSelectionList(Selections); + end; + finally + ControllerDesigner.CancelUpdate; + end; + if ItemIndex <> -1 then + Select(Styles[ItemIndex], False) + else + SelectController; + UpdateHScrollBar; + finally + StopWait; + end; +end; + +procedure TdxfmPrintStylesDesignWindow.DeleteItem(AItem: TBasedxPrintStyle); +var + Index, ItemIndex: Integer; +begin + Index := IndexOf(AItem); + if Index <> -1 then + begin + ItemIndex := lbxStyles.ItemIndex; + lbxStyles.Items.Delete(Index); + + if ItemIndex < 0 then + ItemIndex := 0; + if ItemIndex > StyleCount - 1 then + ItemIndex := StyleCount - 1; + if ItemIndex <> -1 then + Select(Styles[ItemIndex], False) + else + SelectController; + UpdateHScrollBar; + end; +end; + +procedure TdxfmPrintStylesDesignWindow.DrawDragRect; +begin + with lbxStyles do + if (FSaveDragIndex <> -1) and (FSaveDragIndex <> ItemIndex) then + Canvas.DrawFocusRect(ItemRect(FSaveDragIndex)); +end; + +function TdxfmPrintStylesDesignWindow.GetMinWindowSize: TPoint; +begin + Result.X := 300; + Result.Y := btnRestoreDefaults.Top + btnRestoreDefaults.Height + + GetSystemMetrics(SM_CYCAPTION) + 2 * GetSystemMetrics(SM_CXFRAME) + 4; +end; + +procedure TdxfmPrintStylesDesignWindow.GetSelections(const ASelections: TdxDesignSelectionList); +var + I: Integer; +begin + for I := 0 to StyleCount - 1 do + if Selected[I] then + ASelections.Add(Styles[I]); + if ASelections.Count = 0 then + ASelections.Add(Controller); +end; + +function TdxfmPrintStylesDesignWindow.IndexOf(AItem: TBasedxPrintStyle): Integer; +begin + Result := lbxStyles.Items.IndexOfObject(AItem); +end; + +procedure TdxfmPrintStylesDesignWindow.InternalAddStyle(AStyleClass: TdxPrintStyleClass); +var + Style: TBasedxPrintStyle; +begin +// AStyle := TBasedxPrintStyle(Designer.CreateComponent(AStyleClass, Designer.GetRoot, 0, 0, 0, 0)); + ControllerDesigner.BeginUpdate; + try + Style := Controller.AddStyleEx(AStyleClass, Designer.GetRoot); + Style.Name := UniqueName(Style); + finally + ControllerDesigner.CancelUpdate; + end; + lbxStyles.Items.AddObject(Style.Name, Style); + Select(Style, False); + UpdateHScrollBar; + lbxStyles.Update; +end; + +procedure TdxfmPrintStylesDesignWindow.MoveSelection(ADelta: Integer); + + procedure MoveDown(ADelta: Integer); + var + I, Index: Integer; + begin + for I := StyleCount - 1 downto 0 do + if Selected[I] then + begin + Index := Styles[I].Index; + Inc(Index, ADelta); + if Index > StyleCount - 1 then Index := StyleCount - 1; +// while (Index < StyleCount) and Selected[Index] do Inc(Index); + Styles[I].Index := Index; + end; + end; + + procedure MoveUp(ADelta: Integer); + var + I, Index: Integer; + begin + for I := 0 to StyleCount - 1 do + if Selected[I] then + begin + Index := Styles[I].Index; + Inc(Index, ADelta); + if Index < 0 then Index := 0; +// while (Index > -1) and Selected[Index] do Dec(Index); + Styles[I].Index := Index; + end; + end; + +begin + ControllerDesigner.BeginUpdate; + try + if ADelta > 0 then + MoveDown(ADelta) + else + MoveUp(ADelta); + finally + ControllerDesigner.EndUpdate; + end; +end; + +procedure TdxfmPrintStylesDesignWindow.Paste; +var + Components: TdxDesignSelectionList; + I: Integer; +begin + Components := CreateDesignSelectionList; + try + StartWait; + try + lbxStyles.Items.BeginUpdate; + try + ControllerDesigner.BeginUpdate; + try + PasteComponents(Controller.Owner, Controller, Components); + finally + ControllerDesigner.EndUpdate; + end; + for I := StyleCount - 1 downto StyleCount - Components.Count do + Selected[I] := True; + Designer.SetSelections(Components); + finally + lbxStyles.Items.EndUpdate; + end; + finally + StopWait; + end; + finally + FreeDesignSelectionList(Components); + end; + UpdateHScrollBar; +end; + +procedure TdxfmPrintStylesDesignWindow.PrepareAddStandardItem(MenuItem: TMenuItem); +begin + if CanAddStandard then + begin + MenuItem.Caption := 'Add ' + DropT(CurrentStyle.ClassName); + MenuItem.Tag := MakeTTag(CurrentStyle.ClassType); + end; +end; + +procedure TdxfmPrintStylesDesignWindow.RefreshList; +var + Selections: TdxDesignSelectionList; + I, Index: Integer; + Item: TBasedxPrintStyle; + Component: TPersistent; +begin + lbxStyles.Items.BeginUpdate; + try + Selections := CreateDesignSelectionList; + try + GetSelections(Selections); + + lbxStyles.Items.Clear; + if Controller = nil then Exit; + + for I := 0 to Controller.Count - 1 do + begin + Item := Controller[I]; + if Item.Owner = Controller.Owner then + lbxStyles.Items.AddObject(Item.Name, Item); + end; + + for I := 0 to Selections.Count - 1 do + begin + Component := Selections[I]; + if Component is TBasedxPrintStyle then + begin + Index := IndexOf(TBasedxPrintStyle(Component)); + if Index <> -1 then + Selected[Index] := True; + end; + end; + finally + FreeDesignSelectionList(Selections); + end; + finally + lbxStyles.Items.EndUpdate; + end; +end; + +procedure TdxfmPrintStylesDesignWindow.RestoreLayout; +begin + with TRegistry.Create do + try + try + if OpenKey(RegistryPath, False) then + begin + if ValueExists(sdxButtonBar) then + pnlButtons.Visible := ReadBool(sdxButtonBar); + if ValueExists(sdxWidth) then + Width := ReadInteger(sdxWidth); + if ValueExists(sdxHeight) then + Height := ReadInteger(sdxHeight); + end; + except + Abort; + end; + finally + Free; + end; +end; + +procedure TdxfmPrintStylesDesignWindow.Select(AItem: TPersistent; AddToSelection: Boolean); +var + Selections: TdxDesignSelectionList; +begin + Selections := CreateDesignSelectionList; + if AddToSelection then + Designer.GetSelections(Selections); + Selections.Add(AItem); + Designer.SetSelections(Selections); +end; + +procedure TdxfmPrintStylesDesignWindow.SelectAll; +var + Selections: TdxDesignSelectionList; + I: Integer; +begin + Selections := CreateDesignSelectionList; + for I := 0 to StyleCount - 1 do + Selections.Add(Styles[I]); + Designer.SetSelections(Selections); +end; + +procedure TdxfmPrintStylesDesignWindow.SelectController; +begin + Select(Controller, False); +end; + +procedure TdxfmPrintStylesDesignWindow.StartWait; +begin + FSaveCursor := Screen.Cursor; + Screen.Cursor := crHourGlass; +end; + +procedure TdxfmPrintStylesDesignWindow.StopWait; +begin + Screen.Cursor := FSaveCursor; +end; + +procedure TdxfmPrintStylesDesignWindow.StoreLayout; +begin + with TRegistry.Create do + try + try + if OpenKey(RegistryPath, True) then + begin + WriteBool(sdxButtonBar, pnlButtons.Visible); + WriteInteger(sdxWidth, Width); + WriteInteger(sdxHeight, Height); + end; + except + Abort; + end; + finally + Free; + end; +end; + +procedure TdxfmPrintStylesDesignWindow.UpdateCaption; +var + NewCaption: string; +begin + if (Controller <> nil) and (Controller.Owner <> nil) then + NewCaption := Format(sdxStyleDesigner, [Controller.Owner.Name, '.', Controller.Name]); + if Caption <> NewCaption then + Caption := NewCaption; +end; + +procedure TdxfmPrintStylesDesignWindow.UpdateControlsState; +begin + btnAdd.Enabled := CanAdd; + btnDelete.Enabled := CanDelete; + btnSelectAll.Enabled := CanSelectAll; + btnMoveUp.Enabled := CanMoveUp; + btnMoveDown.Enabled := CanMoveDown; + btnPageSetup.Enabled := CanPageSetup; + btnRestoreDefaults.Enabled := CanRestoreDefaults; +end; + +procedure TdxfmPrintStylesDesignWindow.UpdateHScrollBar; +var + I, W, W2: Integer; +begin + W := 0; + with lbxStyles, Items do + begin + for I := 0 to Count - 1 do + begin + if I = Controller.CurrentStyleIndex then + Canvas.Font.Style := [fsBold] + else + Canvas.Font.Style := []; + W2 := dxStyleGlyphSize.X + 4 + Canvas.TextWidth(Items[I]); + if W2 > W then W := W2; + end; + Perform(LB_SETHORIZONTALEXTENT, W, 0); + Canvas.Font.Style := []; + end; +end; + +procedure TdxfmPrintStylesDesignWindow.UpdateItem(AItem: TBasedxprintStyle); +var + Index: Integer; + R: TRect; +begin + if AItem <> nil then + begin + Index := IndexOf(AItem); + if Index <> -1 then + begin + lbxStyles.Items[Index] := AItem.Name; + R := lbxStyles.ItemRect(Index); + InvalidateRect(lbxStyles.Handle, @R, False); + UpdateHScrollBar; + end + end + else + RefreshList; + UpdateControlsState; +end; + +procedure TdxfmPrintStylesDesignWindow.UpdateMenuState; +begin + miAdd.Enabled := CanAdd; + miAddStandard.Visible := CanAddStandard; + PrepareAddStandardItem(miAddStandard); + miCut.Enabled := CanCut; + miCopy.Enabled := CanCopy; + miPaste.Enabled := CanPaste; + miDelete.Enabled := CanDelete; + miSelectAll.Enabled := CanSelectAll; + miMoveUp.Enabled := CanMoveUp; + miMoveDown.Enabled := CanMoveDown; + miPageSetup.Enabled := CanPageSetup; + miSetAsCurrent.Enabled := CanSetAsCurrent; + miRestoreDefaults.Enabled := CanRestoreDefaults; + miBackgroundEffects.Enabled := CanBackgroundEffects; + miBackgroundClear.Enabled := CanBackgroundClear; + miShowButtons.Checked := pnlButtons.Visible; +end; + +procedure TdxfmPrintStylesDesignWindow.UpdateSelections(const ASelections: TdxDesignSelectionList); + + function InSelection(AStyle: TBasedxPrintStyle): Boolean; + var + I: Integer; + begin + for I := 0 to ASelections.Count - 1 do + if AStyle = ASelections[I] then + begin + Result := True; + Exit; + end; + Result := False; + end; + +var + I: Integer; +begin + if (ASelections = nil) or (Controller = nil) or (csDestroying in Controller.ComponentState) or + (ControllerDesigner = nil) or (TdxStyleManagerDesigner(ControllerDesigner).FUpdateCount <> 0) then + Exit; + for I := 0 to StyleCount - 1 do + if Selected[I] xor InSelection(Styles[I]) then + Selected[I] := not Selected[I]; + UpdateControlsState; +end; + +procedure TdxfmPrintStylesDesignWindow.WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); +begin + inherited; + with Message.MinMaxInfo^ do + ptMinTrackSize := GetMinWindowSize; +end; + +procedure TdxfmPrintStylesDesignWindow.WMNCCreate(var Message: TWMNCCreate); +const + TypeDataSize = 32; +var + SysMenu: HMENU; + P: Pointer; + S: array[0..TypeDataSize - 1] of Char; + Info: TMenuItemInfo; + ItemExist: Boolean; +begin + SysMenu := GetSystemMenu(Handle, False); + P := @S[0]; + Info.cbSize := SizeOf(Info) - SizeOf(HBITMAP); + Info.fMask := MIIM_ID or MIIM_TYPE; + Info.dwTypeData := P; + Info.cch := TypeDataSize; + ItemExist := GetMenuItemInfo(SysMenu, SC_SIZE, False, Info); + inherited; + if ItemExist then + InsertMenuItem(SysMenu, 0, True, Info); +end; + +procedure TdxfmPrintStylesDesignWindow.WMNCDestroy(var Message: TWMNCCreate); +begin + GetSystemMenu(Handle, True); + inherited; +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSfmTtl.dfm b/official/x.35/ExpressPrinting System/Sources/dxPSfmTtl.dfm new file mode 100644 index 00000000..acb2dbb5 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSfmTtl.dfm @@ -0,0 +1,691 @@ +object dxfmReportTitleProperties: TdxfmReportTitleProperties + Left = 442 + Top = 242 + ActiveControl = chbxTransparent + BorderIcons = [biSystemMenu, biMinimize, biMaximize, biHelp] + BorderStyle = bsDialog + Caption = 'Report Title' + ClientHeight = 443 + ClientWidth = 392 + Color = clBtnFace + Constraints.MinHeight = 470 + Constraints.MinWidth = 400 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + KeyPreview = True + OldCreateOrder = True + Position = poScreenCenter + OnClose = FormClose + OnKeyDown = FormKeyDown + PixelsPerInch = 96 + TextHeight = 13 + object lblMode: TLabel + Left = 8 + Top = 11 + Width = 30 + Height = 13 + Caption = '&Mode:' + FocusControl = cbxMode + end + object btnOK: TButton + Left = 151 + Top = 413 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 2 + end + object btnCancel: TButton + Left = 231 + Top = 413 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 3 + end + object btnHelp: TButton + Left = 311 + Top = 413 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Caption = '&Help' + TabOrder = 4 + end + object pctlMain: TPageControl + Left = 6 + Top = 39 + Width = 380 + Height = 366 + ActivePage = tshProperties + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 1 + object tshText: TTabSheet + Caption = '&Text' + object memText: TMemo + Left = 0 + Top = 0 + Width = 372 + Height = 338 + Align = alClient + Lines.Strings = ( + '') + TabOrder = 0 + OnChange = TitleChanged + end + end + object tshProperties: TTabSheet + Caption = '&Properties' + OnResize = tshPropertiesResize + object bvlFont: TBevel + Left = 41 + Top = 84 + Width = 324 + Height = 4 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object lblAlignment: TLabel + Left = 7 + Top = 173 + Width = 47 + Height = 13 + Caption = 'Alignment' + end + object lblTextAlignY: TLabel + Left = 196 + Top = 199 + Width = 47 + Height = 13 + Caption = '&Vertically:' + FocusControl = cbxTextAlignY + end + object bvlTransparent: TBevel + Left = 100 + Top = 15 + Width = 265 + Height = 5 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object bvlAlignment: TBevel + Left = 74 + Top = 177 + Width = 290 + Height = 5 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object lblColor: TLabel + Left = 65 + Top = 41 + Width = 29 + Height = 13 + Alignment = taRightJustify + Caption = '&Color:' + end + object bvlColorHolder: TBevel + Left = 104 + Top = 37 + Width = 261 + Height = 21 + Anchors = [akLeft, akTop, akRight] + end + object lblTextAlignX: TLabel + Left = 8 + Top = 199 + Width = 60 + Height = 13 + Caption = 'Hori&zontally:' + FocusControl = cbxTextAlignX + end + object imgFont: TImage + Left = 9 + Top = 79 + Width = 16 + Height = 16 + AutoSize = True + Picture.Data = { + 07544269746D6170F6000000424DF60000000000000076000000280000001000 + 0000100000000100040000000000800000000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD000000DDDDDDDDDDDD00D + DDDDDDDDDDDDD00DDDDDDDD77777700DDDDDDDDDD77DD00DDDDDDDDDD70DD00D + D0DDDDDDD70DD00DD0DDDDDDD700D00D00DDDD7DD700000000DDDD7DD77DD7DD + DDDDDD77D77D77DDDDDDDD77777777DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object Bevel2: TBevel + Left = 10 + Top = 294 + Width = 354 + Height = 5 + Anchors = [akLeft, akRight, akBottom] + Shape = bsBottomLine + end + object lblTransparent: TLabel + Left = 25 + Top = 11 + Width = 62 + Height = 13 + Caption = '&Transparent ' + FocusControl = chbxTransparent + OnClick = lblTransparentClick + end + object cbxTextAlignX: TComboBox + Left = 92 + Top = 194 + Width = 95 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 4 + OnChange = TitleChanged + OnDrawItem = cbxTextAlignYDrawItem + Items.Strings = ( + 'Left' + 'Center' + 'Right') + end + object cbxTextAlignY: TComboBox + Tag = 1 + Left = 270 + Top = 194 + Width = 95 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 5 + OnChange = TitleChanged + OnDrawItem = cbxTextAlignYDrawItem + Items.Strings = ( + 'Top' + 'Center' + 'Bottom') + end + object chbxAdjustOnScale: TCheckBox + Left = 104 + Top = 137 + Width = 261 + Height = 17 + Anchors = [akLeft, akTop, akRight] + Caption = '&Adjust on Scale' + TabOrder = 3 + OnClick = TitleChanged + end + object edFont: TEdit + Left = 104 + Top = 107 + Width = 261 + Height = 21 + TabStop = False + Anchors = [akLeft, akTop, akRight] + Color = clBtnFace + ReadOnly = True + TabOrder = 2 + end + object btnFont: TButton + Left = 8 + Top = 105 + Width = 88 + Height = 25 + Caption = 'Fo&nt...' + TabOrder = 1 + OnClick = btnFontClick + end + object btnRestoreDefaults: TButton + Left = 189 + Top = 307 + Width = 176 + Height = 23 + Anchors = [akRight, akBottom] + Caption = '&Restore Defaults' + TabOrder = 6 + OnClick = btnRestoreDefaultsClick + end + object chbxTransparent: TCheckBox + Left = 7 + Top = 10 + Width = 15 + Height = 17 + Caption = '&Transparent' + TabOrder = 0 + OnClick = TitleChanged + end + end + end + object cbxMode: TComboBox + Left = 48 + Top = 8 + Width = 338 + Height = 21 + Style = csDropDownList + Anchors = [akLeft, akTop, akRight] + ItemHeight = 13 + TabOrder = 0 + OnChange = TitleChanged + Items.Strings = ( + 'None' + 'On First Page, ' + 'On Every Top Page') + end + object ilAlignments: TImageList + AllocBy = 6 + Left = 10 + Top = 411 + Bitmap = { + 494C010106000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FF7FFFFF00000000FF7FFFFF00000000 + FF7FE00300000000FC1FFFFF00000000FE3FFF7F00000000FF7FFE3F00000000 + FFFFFC1F00000000E003FF7F00000000FFFFFF7F00000000FF7FFF7F00000000 + FE3FFF7F00000000FC1FFFFF00000000FF7FFFFF00000000FF7FFFFF00000000 + FF7FFFFF00000000FFFFFFFF00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFF003FC00FF003FFFFFFFFFFFFFFFFFFFF000300030003FF7F + FFFFFFFFFFFFFF7F003FC00FF003FF7FFFFFFFFFFFFFFF7F000300030003FC1F + FFFFFFFFFFFFFE3F003FC00FF003FF7FFFFFFFFFFFFFFFFF000300030003E003 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSfmTtl.pas b/official/x.35/ExpressPrinting System/Sources/dxPSfmTtl.pas new file mode 100644 index 00000000..974ed325 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSfmTtl.pas @@ -0,0 +1,430 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSfmTtl; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ComCtrls, ExtCtrls, dxPSForm, ImgList; + +type + TdxfmReportTitleProperties = class(TCustomdxPSForm) + btnOK: TButton; + btnCancel: TButton; + btnHelp: TButton; + pctlMain: TPageControl; + tshText: TTabSheet; + memText: TMemo; + tshProperties: TTabSheet; + lblMode: TLabel; + cbxMode: TComboBox; + bvlFont: TBevel; + lblAlignment: TLabel; + lblTextAlignY: TLabel; + bvlTransparent: TBevel; + bvlAlignment: TBevel; + lblColor: TLabel; + bvlColorHolder: TBevel; + lblTextAlignX: TLabel; + imgFont: TImage; + cbxTextAlignX: TComboBox; + cbxTextAlignY: TComboBox; + chbxAdjustOnScale: TCheckBox; + edFont: TEdit; + btnFont: TButton; + btnRestoreDefaults: TButton; + Bevel2: TBevel; + chbxTransparent: TCheckBox; + ilAlignments: TImageList; + lblTransparent: TLabel; + procedure TitleChanged(Sender: TObject); + procedure btnFontClick(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure btnRestoreDefaultsClick(Sender: TObject); + procedure cbxTextAlignYDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure tshPropertiesResize(Sender: TObject); + procedure lblTransparentClick(Sender: TObject); + private + FActivePage: Integer; + FccbxColor: TCustomComboBox; + FModified: Boolean; + FReportTitle: TPersistent; {TdxReportTitle} + procedure SetReportTitle(Value: TPersistent{TdxReportTitle}); + + procedure CreateControls; + procedure InitializeControls; + procedure LoadStrings; + procedure SaveUserInput; + procedure SetModified(Value: Boolean); + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + + property Modified: Boolean read FModified write SetModified; + protected + procedure BeforeConstruction; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + procedure LoadFromRegistry(const APath: string); override; + procedure SaveToRegistry(const APath: string); override; + + function Execute: Boolean; + property ReportTitle: TPersistent{TdxReportTitle} read FReportTitle write SetReportTitle; + end; + +function dxShowReportTitlePropertiesDlg(AReportTitle: TPersistent{TdxReportTitle}): Boolean; + +implementation + +{$R *.DFM} + +uses + Registry, cxClasses, dxPSCore, dxPrnDev, dxPSRes, dxPSUtl, dxPSGlbl, + dxExtCtrls; + +const + sdxActivePage = 'ActivePage'; //Don't Localize + +function dxShowReportTitlePropertiesDlg(AReportTitle: TPersistent{TdxReportTitle}): Boolean; +var + Dialog: TdxfmReportTitleProperties; +begin + Result := False; + if AReportTitle = nil then Exit; + + Dialog := TdxfmReportTitleProperties.Create(nil); + try + Dialog.ReportTitle := TdxReportTitle(AReportTitle); + Result := Dialog.Execute; + if Result then + AReportTitle.Assign(Dialog.ReportTitle); + finally + Dialog.Free; + end; +end; + +procedure PlaceBevel(ABevel: TBevel; AControl: TControl); +var + RightBound: Integer; +begin + RightBound := ABevel.BoundsRect.Right; + ABevel.Left := AControl.Left + AControl.Width + 10; + ABevel.Width := RightBound - ABevel.Left; +end; + +{ TdxfmReportTitleProperties } + +constructor TdxfmReportTitleProperties.Create(AOwner: TComponent); +begin + HelpContext := dxhcTitlePropertiesDlg; + inherited; + if HelpContext = 0 then + begin + btnOK.BoundsRect := btnCancel.BoundsRect; + btnCancel.BoundsRect := btnHelp.BoundsRect; + btnHelp.Visible := False; + BorderIcons := BorderIcons - [biHelp]; + end; + FReportTitle := TdxReportTitle.Create(nil); + CreateControls; + LoadStrings; +end; + +destructor TdxfmReportTitleProperties.Destroy; +begin + FreeAndNil(FReportTitle); + inherited; +end; + +function TdxfmReportTitleProperties.Execute: Boolean; +begin + InitializeControls; + with pctlMain do + ActivePage := Pages[FActivePage]; + Modified := False; + Result := (ShowModal = mrOK) and Modified; +end; + +procedure TdxfmReportTitleProperties.BeforeConstruction; +begin + inherited; + Options := Options + [foSizeableDialog]; +end; + +procedure TdxfmReportTitleProperties.FormClose(Sender: TObject; + var Action: TCloseAction); +begin + if ModalResult = mrOK then SaveUserInput; +end; + +procedure TdxfmReportTitleProperties.InitializeControls; +begin + with TdxReportTitle(ReportTitle) do + begin + chbxAdjustOnScale.Checked := AdjustOnReportScale; + TdxPSColorCombo(FccbxColor).ColorValue := Color; + FontInfoToText(Font, edFont); + cbxMode.ItemIndex := Integer(Mode); + memText.Text := Text; + cbxTextAlignX.ItemIndex := Integer(TextAlignX); + cbxTextAlignY.ItemIndex := Integer(TextAlignY); + chbxTransparent.Checked := Transparent; + FccbxColor.Enabled := not chbxTransparent.Checked; + end; +end; + +procedure TdxfmReportTitleProperties.SetModified(Value: Boolean); +begin + if FModified <> Value then + begin + FModified := Value; + //btnOK.Enabled := Value; + end; + FccbxColor.Enabled := not chbxTransparent.Checked; +end; + +procedure TdxfmReportTitleProperties.TitleChanged(Sender: TObject); +begin + FccbxColor.Enabled := not chbxTransparent.Checked; + Modified := True; +end; + +procedure TdxfmReportTitleProperties.lblTransparentClick(Sender: TObject); +begin + if chbxTransparent.CanFocus then ActiveControl := chbxTransparent; + chbxTransparent.Checked := not chbxTransparent.Checked; +end; + +procedure TdxfmReportTitleProperties.FormKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if (ActiveControl = memText) and (Key = VK_ESCAPE) and (Shift = []) then + ModalResult := mrCancel; +end; + +procedure TdxfmReportTitleProperties.SetReportTitle(Value: TPersistent{TdxReportTitle}); +begin + FReportTitle.Assign(Value); +end; + +procedure TdxfmReportTitleProperties.CreateControls; +begin + FccbxColor := TdxPSColorCombo.Create(Self); + with TdxPSColorCombo(FccbxColor) do + begin + Anchors := bvlColorHolder.Anchors; + BoundsRect := bvlColorHolder.BoundsRect; + Parent := tshProperties; + ColorTypes := [ctPure]; + AutoColor := dxDefaultColor; + ShowAutoColor := True; + TabOrder := chbxTransparent.TabOrder + 1; + OnChange := TitleChanged; + end; + lblColor.FocusControl := FccbxColor; +end; + +procedure TdxfmReportTitleProperties.LoadStrings; +begin + Caption := cxGetResourceString(@sdxReportTitleDlgCaption); + btnOK.Caption := cxGetResourceString(@sdxBtnOkAccelerated); + btnCancel.Caption := cxGetResourceString(@sdxBtnCancel); + btnHelp.Caption := cxGetResourceString(@sdxBtnHelp); + btnRestoreDefaults.Caption := cxGetResourceString(@sdxBtnRestoreDefaults); + + lblMode.Caption := cxGetResourceString(@sdxMode); + cbxMode.Clear; + cbxMode.Items.Add(cxGetResourceString(@sdxTitleModeNone)); + cbxMode.Items.Add(cxGetResourceString(@sdxTitleModeOnFirstPage)); + cbxMode.Items.Add(cxGetResourceString(@sdxTitleModeOnEveryTopPage)); + + tshText.Caption := cxGetResourceString(@sdxText); + tshProperties.Caption := cxGetResourceString(@sdxProperties); + lblColor.Caption := cxGetResourceString(@sdxColor); + PlaceBevel(bvlFont, imgFont); + btnFont.Caption := cxGetResourceString(@sdxBtnFont); + chbxAdjustOnScale.Caption := cxGetResourceString(@sdxAdjustOnScale); + + lblAlignment.Caption := DropAmpersand(cxGetResourceString(@sdxAlignment)); + PlaceBevel(bvlAlignment, lblAlignment); + + lblTextAlignX.Caption := cxGetResourceString(@sdxTextAlignHorz) + ':'; + cbxTextAlignX.Clear; + cbxTextAlignX.Items.Add(cxGetResourceString(@sdxTextAlignLeft)); + cbxTextAlignX.Items.Add(cxGetResourceString(@sdxTextAlignCenter)); + cbxTextAlignX.Items.Add(cxGetResourceString(@sdxTextAlignRight)); + + lblTextAlignY.Caption := cxGetResourceString(@sdxTextAlignVert) + ':'; + cbxTextAlignY.Clear; + cbxTextAlignY.Items.Add(cxGetResourceString(@sdxTextAlignTop)); + cbxTextAlignY.Items.Add(cxGetResourceString(@sdxTextAlignVCenter)); + cbxTextAlignY.Items.Add(cxGetResourceString(@sdxTextAlignBottom)); + + lblTransparent.Caption := cxGetResourceString(@sdxTransparent); + PlaceBevel(bvlTransparent, lblTransparent); +end; + +procedure TdxfmReportTitleProperties.SaveUserInput; +begin + with TdxReportTitle(FReportTitle) do + begin + AdjustOnReportScale := chbxAdjustOnScale.Checked; + Color := TdxPSColorCombo(FccbxColor).ColorValue; + Mode := TdxReportTitleMode(cbxMode.ItemIndex); + Text := memText.Text; + TextAlignX := TdxTextAlignX(cbxTextAlignX.ItemIndex); + TextAlignY := TdxTextAlignY(cbxTextAlignY.ItemIndex); + Transparent := chbxTransparent.Checked; + end; +end; + +procedure TdxfmReportTitleProperties.CMDialogChar(var message: TCMDialogChar); +var + I: Integer; +begin + inherited; + with pctlMain do + for I := 0 to PageCount - 1 do + if IsAccel(message.CharCode, Pages[I].Caption) then + begin + message.Result := 1; + ActivePage := Pages[I]; + Exit; + end; +end; + +procedure TdxfmReportTitleProperties.btnFontClick(Sender: TObject); +begin + FontDialog.Font := TdxReportTitle(ReportTitle).Font; + if FontDialog.Execute then + begin + TdxReportTitle(ReportTitle).Font := FontDialog.Font; + FontInfoToText(TdxReportTitle(ReportTitle).Font, edFont); + TitleChanged(nil); + end; +end; + +procedure TdxfmReportTitleProperties.LoadFromRegistry(const APath: string); +begin + inherited LoadFromRegistry(APath); + with TRegistry.Create do + try + if OpenKey(APath, False) then + try + if ValueExists(sdxActivePage) then + FActivePage := ReadInteger(sdxActivePage); + except + on ERegistryException do + // ignore + else + raise; + end; + finally + Free; + end; +end; + +procedure TdxfmReportTitleProperties.SaveToRegistry(const APath: string); +begin + inherited SaveToRegistry(APath); + with TRegistry.Create do + try + if OpenKey(APath, True) then + try + WriteInteger(sdxActivePage, pctlMain.ActivePage.PageIndex); + except + on ERegistryException do + // ignore + else + raise; + end; + finally + Free; + end; +end; + +procedure TdxfmReportTitleProperties.btnRestoreDefaultsClick(Sender: TObject); +begin + TdxReportTitle(ReportTitle).RestoreDefaults; + InitializeControls; + TitleChanged(nil); +end; + +procedure TdxfmReportTitleProperties.cbxTextAlignYDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +var + X, Y: Integer; +begin + with TComboBox(Control) do + begin + Canvas.FillRect(Rect); + + ilAlignments.Draw(Canvas, Rect.Left + 1, Rect.Top + 1, 3 * TTagToInt(Tag) + Index, True); + + Inc(Rect.Left, 1 + ilAlignments.Width + 2); + with Rect do + begin + X := Left; + Y := Top + (Bottom - Top - Canvas.TextHeight(Items[Index])) div 2; + end; + Canvas.TextRect(Rect, X, Y, Items[Index]); + end; +end; + +procedure TdxfmReportTitleProperties.tshPropertiesResize(Sender: TObject); +const + MinRightBound = 7; +var + W: Integer; +begin + W := TControl(Sender).Width div 2 - cbxTextAlignX.Left; + cbxTextAlignX.Width := W; + + lblTextAlignY.Left := cbxTextAlignX.Left + W + 12; + cbxTextAlignY.Left := lblTextAlignY.Left + lblTextAlignY.Width + + (cbxTextAlignX.Left - lblTextAlignX.Left - lblTextAlignX.Width); + if (TControl(Sender).Width - cbxTextAlignY.BoundsRect.Right) < MinRightBound then + cbxTextAlignY.Left := TControl(Sender).Width - MinRightBound - cbxTextAlignY.Width; + + cbxTextAlignY.Width := W; +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSrxRELnk.pas b/official/x.35/ExpressPrinting System/Sources/dxPSrxRELnk.pas new file mode 100644 index 00000000..6e607f35 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSrxRELnk.pas @@ -0,0 +1,88 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSrxRELnk; + +interface + +{$I cxVer.inc} + +uses + Classes, Windows, dxPSRELnk, ARichEd; + +type + TrxRichEditReportLink = class(TAbstractdxRichEditReportLink) + private + function GetrxRichEdit: TAutoRichEdit; + protected + function GetRichEditHandle: HWND; override; + public + constructor Create(AOwner: TComponent); override; + property rxRichEdit: TAutoRichEdit read GetrxRichEdit; + end; + +implementation + +uses + dxPSCore; + +constructor TrxRichEditReportLink.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + RichEditVersion := 2; + LinkModified(False); +end; + +function TrxRichEditReportLink.GetrxRichEdit: TAutoRichEdit; +begin + Result := TAutoRichEdit(Component); +end; + +function TrxRichEditReportLink.GetRichEditHandle: HWND; +begin + if rxRichEdit <> nil then + Result := rxRichEdit.Handle + else + Result := 0; +end; + +initialization + dxPSRegisterReportLink(TrxRichEditReportLink, TAutoRichEdit, nil); + +finalization + dxPSUnregisterReportLink(TrxRichEditReportLink, TAutoRichEdit, nil); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPSrxRELnkReg.pas b/official/x.35/ExpressPrinting System/Sources/dxPSrxRELnkReg.pas new file mode 100644 index 00000000..c0c201f8 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPSrxRELnkReg.pas @@ -0,0 +1,54 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSrxRELnkReg; + +interface + +{$I cxVer.inc} + +procedure Register; + +implementation + +uses + Classes, dxPSrxRELnk; + +procedure Register; +begin + RegisterNoIcon([TrxRichEditReportLink]); +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPcPrVw.pas b/official/x.35/ExpressPrinting System/Sources/dxPcPrVw.pas new file mode 100644 index 00000000..e6ab800d --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPcPrVw.pas @@ -0,0 +1,167 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPcPrVw; + +interface + +{$I cxVer.inc} + +uses + Graphics; + +procedure dxShowPicturePreview(AGraphic: TGraphic); + +implementation + +uses + Classes, SysUtils, Controls, ComCtrls, cxClasses, dxPSUtl, dxPSRes, dxPSImgs, + dxPSForm, dxExtCtrls; + +type + TdxfmPicturePreview = class(TCustomdxPSForm) + private + FPictureBox: TdxPSImageScrollBox; + FStatusBar: TStatusBar; + function GetGraphic: TGraphic; + function GetHasGraphic: Boolean; + protected + procedure KeyPress(var Key: Char); override; + procedure CreateControls; + procedure UpdateControls; + + property Graphic: TGraphic read GetGraphic; + property HasGraphic: Boolean read GetHasGraphic; + public + constructor CreateNew(AOwner: TComponent; Dummy: Integer = 0); override; + procedure Execute(AGraphic: TGraphic); + + property PreviewBox: TdxPSImageScrollBox read FPictureBox; + property StatusBar: TStatusBar read FStatusBar; + end; + +procedure dxShowPicturePreview(AGraphic: TGraphic); +begin + with TdxfmPicturePreview.CreateNew(nil) do + try + Execute(AGraphic); + finally + Free; + end; +end; + +constructor TdxfmPicturePreview.CreateNew(AOwner: TComponent; Dummy: Integer = 0); +begin + inherited; + Caption := cxGetResourceString(@sdxFSPCaption); + Constraints.MinHeight := 200; + Constraints.MinWidth := 200; + Icon_LoadFromResourceName(Icon, IDB_DXPSPREVIEW); + + CreateControls; +end; + +procedure TdxfmPicturePreview.Execute(AGraphic: TGraphic); +begin + PreviewBox.Picture.Assign(AGraphic); + UpdateControls; + + ShowModal; +end; + +procedure TdxfmPicturePreview.KeyPress(var Key: Char); +begin + if Key = #27 then + Close + else + inherited; +end; + +procedure TdxfmPicturePreview.CreateControls; +begin + FStatusBar := TStatusBar.Create(Self); + with StatusBar do + begin + Parent := Self; + Align := alBottom; + with Panels.Add do Width := 250; + with Panels.Add do Width := -1; + end; + + FPictureBox := TdxPSImageScrollBox.Create(Self); + with FPictureBox do + begin + Parent := Self; + Align := alClient; + BuiltInMenuItemsVisibility := BuiltInMenuItemsVisibility - [biiPreview]; + end; +end; + +procedure TdxfmPicturePreview.UpdateControls; +begin + Width := 400; + Height := 400; + + if HasGraphic then + begin + ClientWidth := Graphic.Width + 10; + ClientHeight := Graphic.Height + StatusBar.Height + 10; + with dxPSUtl.GetDesktopWorkArea do + begin + if Width > Right - Left then Width := Right - Left; + if Height > Bottom - Top then Height := Bottom - Top; + Self.Left := (Right - Left - Width) div 2; + Self.Top := (Bottom - Top - Height) div 2; + end; + StatusBar.Panels[0].Text := Format('%s: %d %s: %d', + [cxGetResourceString(@sdxWidth), Graphic.Width, + cxGetResourceString(@sdxHeight), Graphic.Height]); + end + else + PreviewBox.HintText := cxGetResourceString(@sdxNone); +end; + +function TdxfmPicturePreview.GetGraphic: TGraphic; +begin + Result := PreviewBox.Picture.Graphic; +end; + +function TdxfmPicturePreview.GetHasGraphic: Boolean; +begin + Result := PreviewBox.HasGraphic; +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPgsDlg.dfm b/official/x.35/ExpressPrinting System/Sources/dxPgsDlg.dfm new file mode 100644 index 00000000..297c662a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPgsDlg.dfm @@ -0,0 +1,3666 @@ +object dxfmPageSetupDialog: TdxfmPageSetupDialog + Left = 448 + Top = 228 + BorderStyle = bsDialog + Caption = 'Page Setup' + ClientHeight = 435 + ClientWidth = 526 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + KeyPreview = True + OldCreateOrder = True + Position = poScreenCenter + OnClose = FormClose + OnCloseQuery = FormCloseQuery + OnKeyDown = FormKeyDown + PixelsPerInch = 96 + TextHeight = 13 + object pnlStyleName: TPanel + Left = 0 + Top = 0 + Width = 526 + Height = 31 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object lblStyleName: TLabel + Left = 4 + Top = 9 + Width = 61 + Height = 13 + Caption = 'Style &Name: ' + FocusControl = edStyleName + end + object edStyleName: TEdit + Left = 66 + Top = 6 + Width = 259 + Height = 21 + MaxLength = 31 + TabOrder = 0 + OnChange = edStyleNameChange + OnExit = edStyleNameExit + end + object btnOptions: TButton + Left = 331 + Top = 5 + Width = 88 + Height = 24 + Caption = '&Options ...' + TabOrder = 1 + end + end + object pnlButtons: TPanel + Left = 0 + Top = 399 + Width = 526 + Height = 36 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object btnPrintPreview: TButton + Left = 117 + Top = 7 + Width = 106 + Height = 23 + Caption = 'Print Preview...' + TabOrder = 1 + OnClick = btnPrintPreviewClick + end + object btnPrint: TButton + Left = 5 + Top = 7 + Width = 106 + Height = 23 + Caption = 'Print...' + TabOrder = 0 + OnClick = btnPrintClick + end + object btnOK: TButton + Left = 273 + Top = 7 + Width = 79 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 2 + end + object btnCancel: TButton + Left = 358 + Top = 7 + Width = 79 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 3 + end + object btnHelp: TButton + Left = 443 + Top = 7 + Width = 79 + Height = 23 + Caption = '&Help' + TabOrder = 4 + end + end + object Panel4: TPanel + Left = 0 + Top = 31 + Width = 526 + Height = 368 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object pgctrlMain: TPageControl + Left = 5 + Top = 3 + Width = 517 + Height = 365 + ActivePage = tshMargins + MultiLine = True + TabOrder = 0 + OnChange = pgctrlMainChange + OnChanging = pgctrlMainChanging + object tshPage: TTabSheet + Caption = '&Page' + object Panel5: TPanel + Left = 0 + Top = 0 + Width = 509 + Height = 337 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object gbxPaper: TGroupBox + Left = 5 + Top = 5 + Width = 231 + Height = 326 + Caption = ' Paper ' + TabOrder = 0 + object lblPaperWidth: TLabel + Left = 18 + Top = 208 + Width = 32 + Height = 13 + Caption = '&Width:' + OnClick = lblMarginTopClick + end + object lblPaperHeight: TLabel + Left = 18 + Top = 234 + Width = 35 + Height = 13 + Caption = 'H&eight:' + OnClick = lblMarginTopClick + end + object bvlPaperDimensions: TBevel + Left = 64 + Top = 191 + Width = 157 + Height = 4 + Shape = bsBottomLine + end + object bvlPaperSource: TBevel + Left = 79 + Top = 278 + Width = 142 + Height = 4 + Shape = bsBottomLine + end + object bvlPaperType: TBevel + Left = 36 + Top = 20 + Width = 185 + Height = 4 + Shape = bsBottomLine + end + object bvlPaperWidthHolder: TBevel + Left = 81 + Top = 204 + Width = 100 + Height = 22 + Visible = False + end + object bvlPaperHeightHolder: TBevel + Left = 81 + Top = 230 + Width = 100 + Height = 22 + Visible = False + end + object lblPaperSource: TLabel + Left = 6 + Top = 272 + Width = 63 + Height = 13 + Caption = 'Paper so&urce' + FocusControl = cbxPaperSource + OnClick = lblPaperSourceClick + end + object lblPaperType: TLabel + Left = 6 + Top = 15 + Width = 24 + Height = 13 + Caption = 'T&ype' + FocusControl = lbxPaperType + end + object lblPaperDimensions: TLabel + Left = 6 + Top = 186 + Width = 53 + Height = 13 + Caption = 'Dimensions' + end + object lbxPaperType: TListBox + Left = 12 + Top = 31 + Width = 208 + Height = 148 + Style = lbOwnerDrawFixed + IntegralHeight = True + ItemHeight = 18 + TabOrder = 0 + OnClick = lbxPaperTypeClick + OnDrawItem = lbxPaperTypeDrawItem + end + object cbxPaperSource: TComboBox + Left = 12 + Top = 289 + Width = 208 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 1 + OnChange = cbxPaperSourceChange + OnDrawItem = cbxPaperSourceDrawItem + end + end + object Panel1: TPanel + Left = 239 + Top = 0 + Width = 270 + Height = 337 + Align = alRight + BevelOuter = bvNone + ParentColor = True + TabOrder = 1 + object Label1: TLabel + Left = 265 + Top = 5 + Width = 5 + Height = 326 + Align = alRight + AutoSize = False + Transparent = True + end + object Label2: TLabel + Left = 0 + Top = 5 + Width = 5 + Height = 326 + Align = alLeft + AutoSize = False + Transparent = True + end + object Label3: TLabel + Left = 0 + Top = 0 + Width = 270 + Height = 5 + Align = alTop + AutoSize = False + Transparent = True + end + object Label4: TLabel + Left = 0 + Top = 331 + Width = 270 + Height = 6 + Align = alBottom + AutoSize = False + Transparent = True + end + object Panel6: TPanel + Left = 5 + Top = 5 + Width = 260 + Height = 326 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object gbxOrientation: TGroupBox + Left = 0 + Top = 0 + Width = 260 + Height = 187 + Align = alTop + Caption = ' Orientation ' + TabOrder = 0 + object bvlOrientationHolder: TBevel + Left = 8 + Top = 20 + Width = 145 + Height = 159 + Visible = False + end + object rBtnLandscape: TRadioButton + Tag = 1 + Left = 162 + Top = 109 + Width = 93 + Height = 17 + Caption = '&Landscape' + TabOrder = 1 + OnClick = OrientationClick + OnDblClick = OrientationDblClick + end + object rBtnPortrait: TRadioButton + Left = 162 + Top = 62 + Width = 93 + Height = 17 + Caption = 'P&ortrait' + Checked = True + TabOrder = 0 + TabStop = True + OnClick = OrientationClick + OnDblClick = OrientationDblClick + end + end + object gbxPrintOrder: TGroupBox + Left = 0 + Top = 187 + Width = 260 + Height = 80 + Align = alTop + Caption = ' Print Order ' + TabOrder = 1 + object pbxPageOrder: TPaintBox + Left = 10 + Top = 20 + Width = 74 + Height = 49 + OnDblClick = pbxPageOrderDblClick + OnPaint = pbxPageOrderPaint + end + object rbtnOverThenDown: TRadioButton + Left = 105 + Top = 47 + Width = 150 + Height = 17 + Caption = 'O&ver, then down' + TabOrder = 0 + OnClick = PageOrderClick + end + object rbtnDownThenOver: TRadioButton + Tag = 1 + Left = 105 + Top = 24 + Width = 150 + Height = 17 + Caption = '&Down, then over' + Checked = True + TabOrder = 1 + TabStop = True + OnClick = PageOrderClick + end + end + object gbxShading: TGroupBox + Left = 0 + Top = 267 + Width = 260 + Height = 59 + Align = alClient + Caption = ' Shading ' + TabOrder = 2 + object chbxShading: TCheckBox + Left = 11 + Top = 25 + Width = 206 + Height = 17 + Caption = 'Print using &gray shading' + TabOrder = 0 + OnClick = chbxShadingClick + end + end + end + end + end + end + object tshMargins: TTabSheet + Caption = '&Margins' + object pnlInMargins: TPanel + Left = 0 + Top = 0 + Width = 509 + Height = 337 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Bevel12: TBevel + Left = 297 + Top = 7 + Width = 201 + Height = 5 + Shape = bsBottomLine + end + object bvlPreviewHolder: TBevel + Left = 252 + Top = 18 + Width = 246 + Height = 310 + Visible = False + end + object lblPreview: TLabel + Left = 252 + Top = 3 + Width = 38 + Height = 13 + Caption = 'Preview' + end + object Panel14: TPanel + Left = 0 + Top = 0 + Width = 237 + Height = 337 + Align = alLeft + BevelOuter = bvNone + ParentColor = True + TabOrder = 0 + object Label5: TLabel + Left = 0 + Top = 0 + Width = 237 + Height = 5 + Align = alTop + AutoSize = False + Transparent = True + end + object Label6: TLabel + Left = 0 + Top = 332 + Width = 237 + Height = 5 + Align = alBottom + AutoSize = False + Transparent = True + end + object Label7: TLabel + Left = 0 + Top = 5 + Width = 5 + Height = 327 + Align = alLeft + AutoSize = False + Transparent = True + end + object Label8: TLabel + Left = 232 + Top = 5 + Width = 5 + Height = 327 + Align = alRight + AutoSize = False + Transparent = True + end + object Panel8: TPanel + Left = 5 + Top = 5 + Width = 227 + Height = 327 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object bvlMarginsWarningHolder: TBevel + Left = 4 + Top = 281 + Width = 222 + Height = 33 + Visible = False + end + object gbxMargins: TGroupBox + Left = 0 + Top = 0 + Width = 227 + Height = 223 + Align = alTop + TabOrder = 0 + object pnlMargins: TPanel + Left = 2 + Top = 15 + Width = 223 + Height = 106 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object lblMarginTop: TLabel + Left = 13 + Top = 8 + Width = 22 + Height = 13 + Caption = '&Top:' + OnClick = lblMarginTopClick + end + object lblMarginBottom: TLabel + Left = 13 + Top = 34 + Width = 41 + Height = 13 + Caption = '&Bottom: ' + OnClick = lblMarginTopClick + end + object lblMarginLeft: TLabel + Left = 13 + Top = 60 + Width = 26 + Height = 13 + Caption = 'Le&ft: ' + OnClick = lblMarginTopClick + end + object lblMarginRight: TLabel + Left = 13 + Top = 86 + Width = 32 + Height = 13 + Caption = 'Ri&ght: ' + OnClick = lblMarginTopClick + end + object bvlMarginTopHolder: TBevel + Left = 97 + Top = 3 + Width = 117 + Height = 22 + Visible = False + end + object bvlMarginBottomHolder: TBevel + Left = 97 + Top = 29 + Width = 117 + Height = 22 + Visible = False + end + object bvlMarginLeftHolder: TBevel + Left = 97 + Top = 55 + Width = 117 + Height = 22 + Visible = False + end + object bvlMarginRightHolder: TBevel + Left = 97 + Top = 81 + Width = 117 + Height = 22 + Visible = False + end + end + object pnlHFMargins: TPanel + Left = 2 + Top = 121 + Width = 223 + Height = 58 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object lblMarginHeader: TLabel + Left = 13 + Top = 11 + Width = 42 + Height = 13 + Caption = 'H&eader: ' + OnClick = lblMarginTopClick + end + object lblMarginFooter: TLabel + Left = 13 + Top = 38 + Width = 36 + Height = 13 + Caption = 'Foote&r:' + OnClick = lblMarginTopClick + end + object bvlMarginHeaderHolder: TBevel + Left = 97 + Top = 6 + Width = 117 + Height = 22 + Visible = False + end + object bvlMarginFooterHolder: TBevel + Left = 97 + Top = 33 + Width = 117 + Height = 22 + Visible = False + end + end + object Panel3: TPanel + Left = 2 + Top = 179 + Width = 223 + Height = 39 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object btnFix: TButton + Left = 6 + Top = 13 + Width = 79 + Height = 23 + Caption = 'Fi&x' + TabOrder = 0 + OnClick = btnFixClick + end + object btnRestoreOriginalMargins: TButton + Left = 88 + Top = 13 + Width = 127 + Height = 23 + Caption = 'Restore &Original' + TabOrder = 1 + OnClick = btnRestoreOriginalMarginsClick + end + end + end + object pnlCenterOnPage: TPanel + Left = 0 + Top = 223 + Width = 227 + Height = 54 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object bvlCenterOnPage: TBevel + Left = 99 + Top = 16 + Width = 128 + Height = 4 + Shape = bsBottomLine + end + object lblCenterOnPage: TLabel + Left = 1 + Top = 13 + Width = 78 + Height = 13 + Caption = 'Center on page ' + end + object chbxCenterHorz: TCheckBox + Left = 9 + Top = 33 + Width = 112 + Height = 17 + Caption = 'Hori&zontaly' + Color = clBtnFace + ParentColor = False + TabOrder = 0 + OnClick = CenterOnPageClick + end + object chbxCenterVert: TCheckBox + Tag = 1 + Left = 131 + Top = 33 + Width = 92 + Height = 17 + Caption = '&Verticaly' + TabOrder = 1 + OnClick = CenterOnPageClick + end + end + end + end + end + end + object tshHeaderFooter: TTabSheet + Caption = '&Header\Footer' + object Panel7: TPanel + Left = 0 + Top = 0 + Width = 509 + Height = 337 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object pnlBottom: TPanel + Left = 0 + Top = 236 + Width = 509 + Height = 67 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object pnlHFOpt: TPanel + Left = 0 + Top = 0 + Width = 509 + Height = 67 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Label18: TLabel + Left = 0 + Top = 65 + Width = 509 + Height = 2 + Align = alBottom + AutoSize = False + Transparent = True + end + object Label17: TLabel + Left = 0 + Top = 2 + Width = 4 + Height = 63 + Align = alLeft + AutoSize = False + Transparent = True + end + object Label19: TLabel + Left = 505 + Top = 2 + Width = 4 + Height = 63 + Align = alRight + AutoSize = False + Transparent = True + end + object Label20: TLabel + Left = 0 + Top = 0 + Width = 509 + Height = 2 + Align = alTop + AutoSize = False + Transparent = True + end + object Panel9: TPanel + Left = 4 + Top = 2 + Width = 501 + Height = 63 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object pnlVertAlignment: TPanel + Left = 0 + Top = 0 + Width = 125 + Height = 63 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object gbxVertAlignment: TGroupBox + Left = 0 + Top = 0 + Width = 120 + Height = 63 + Caption = ' Vertical Alignment ' + TabOrder = 0 + object tbTAVert: TToolBar + Left = 22 + Top = 23 + Width = 79 + Height = 30 + Align = alNone + ButtonHeight = 24 + ButtonWidth = 25 + EdgeBorders = [ebLeft, ebTop, ebRight, ebBottom] + EdgeInner = esLowered + Images = ilPaperTypes + TabOrder = 0 + Wrapable = False + object ToolButton12: TToolButton + Left = 0 + Top = 2 + Caption = 'ToolButton9' + Down = True + Grouped = True + ImageIndex = 0 + Style = tbsCheck + OnClick = VertTextAlignClick + end + object ToolButton13: TToolButton + Tag = 1 + Left = 25 + Top = 2 + Caption = 'ToolButton10' + Grouped = True + ImageIndex = 1 + Style = tbsCheck + OnClick = VertTextAlignClick + end + object ToolButton14: TToolButton + Tag = 2 + Left = 50 + Top = 2 + Caption = 'ToolButton11' + Grouped = True + ImageIndex = 2 + Style = tbsCheck + OnClick = VertTextAlignClick + end + end + end + end + object gbxFunctions: TGroupBox + Left = 125 + Top = 0 + Width = 376 + Height = 63 + Align = alClient + Caption = ' Predefined Functions ' + TabOrder = 1 + object pnlToolBar: TPanel + Left = 2 + Top = 15 + Width = 372 + Height = 46 + Align = alClient + BevelOuter = bvNone + Caption = 'Panel1' + TabOrder = 0 + object tbPredefined: TToolBar + Left = 19 + Top = 8 + Width = 335 + Height = 30 + Align = alNone + ButtonHeight = 24 + ButtonWidth = 25 + EdgeBorders = [ebLeft, ebTop, ebRight, ebBottom] + EdgeInner = esLowered + ParentShowHint = False + ShowHint = True + TabOrder = 0 + Wrapable = False + end + end + end + end + end + end + object pnlHeader: TPanel + Left = 0 + Top = 0 + Width = 509 + Height = 118 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object pnlHeaderMemos: TPanel + Left = 0 + Top = 46 + Width = 509 + Height = 72 + Align = alClient + BevelOuter = bvNone + ParentColor = True + TabOrder = 2 + object Label9: TLabel + Left = 0 + Top = 4 + Width = 4 + Height = 64 + Align = alLeft + AutoSize = False + Transparent = True + end + object Label10: TLabel + Left = 505 + Top = 4 + Width = 4 + Height = 64 + Align = alRight + AutoSize = False + Transparent = True + end + object Label11: TLabel + Left = 0 + Top = 0 + Width = 509 + Height = 4 + Align = alTop + AutoSize = False + Transparent = True + end + object Label12: TLabel + Left = 0 + Top = 68 + Width = 509 + Height = 4 + Align = alBottom + AutoSize = False + Transparent = True + end + object pnlHeaderMemosHost: TPanel + Left = 4 + Top = 4 + Width = 501 + Height = 64 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object memHeaderLeft: TMemo + Left = 0 + Top = 0 + Width = 167 + Height = 64 + Align = alClient + ScrollBars = ssVertical + TabOrder = 0 + OnChange = MemoChange + OnEnter = MemoEnter + OnExit = MemoExit + end + object memHeaderCenter: TMemo + Tag = 1 + Left = 167 + Top = 0 + Width = 167 + Height = 64 + Align = alRight + Alignment = taCenter + ScrollBars = ssVertical + TabOrder = 1 + OnChange = MemoChange + OnEnter = MemoEnter + OnExit = MemoExit + end + object memHeaderRight: TMemo + Tag = 2 + Left = 334 + Top = 0 + Width = 167 + Height = 64 + Align = alRight + Alignment = taRightJustify + ScrollBars = ssVertical + TabOrder = 2 + OnChange = MemoChange + OnEnter = MemoEnter + OnExit = MemoExit + end + end + end + object pnlHeaderFont: TPanel + Left = 0 + Top = 16 + Width = 509 + Height = 30 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object btnHeaderFont: TButton + Left = 4 + Top = 3 + Width = 75 + Height = 26 + Caption = '&Font...' + TabOrder = 0 + OnClick = btnHFFontClick + end + object edHeaderFontInfo: TEdit + Left = 84 + Top = 6 + Width = 244 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + end + object btnHeaderBackground: TBitBtn + Left = 333 + Top = 3 + Width = 172 + Height = 26 + Caption = '&Background' + TabOrder = 2 + OnClick = BackgroundClick + Layout = blGlyphRight + end + end + object pnlHeaderTitle: TPanel + Left = 0 + Top = 0 + Width = 509 + Height = 16 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object bvlHeader: TBevel + Left = 47 + Top = 6 + Width = 454 + Height = 5 + Shape = bsBottomLine + end + object lblHeader: TLabel + Left = 6 + Top = 2 + Width = 35 + Height = 13 + Caption = 'Header' + end + end + end + object pnlFooter: TPanel + Left = 0 + Top = 118 + Width = 509 + Height = 118 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object pnlFooterTitle: TPanel + Left = 0 + Top = 0 + Width = 509 + Height = 16 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object bvlFooter: TBevel + Left = 48 + Top = 8 + Width = 456 + Height = 4 + Shape = bsBottomLine + end + object lblFooter: TLabel + Left = 6 + Top = 3 + Width = 32 + Height = 13 + Caption = 'Footer' + end + end + object pnlFooterFont: TPanel + Left = 0 + Top = 16 + Width = 509 + Height = 30 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object btnFooterFont: TButton + Tag = 1 + Left = 4 + Top = 3 + Width = 75 + Height = 26 + Caption = 'Fo&nt...' + TabOrder = 0 + OnClick = btnHFFontClick + end + object edFooterFontInfo: TEdit + Left = 83 + Top = 6 + Width = 244 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + end + object btnFooterBackGround: TBitBtn + Tag = 1 + Left = 332 + Top = 3 + Width = 172 + Height = 26 + Caption = 'Back&ground' + TabOrder = 2 + OnClick = BackgroundClick + Layout = blGlyphRight + end + end + object pnlFooterMemos: TPanel + Left = 0 + Top = 46 + Width = 509 + Height = 72 + Align = alClient + BevelOuter = bvNone + ParentColor = True + TabOrder = 2 + object Label14: TLabel + Left = 0 + Top = 0 + Width = 509 + Height = 4 + Align = alTop + AutoSize = False + Transparent = True + end + object Label15: TLabel + Left = 0 + Top = 68 + Width = 509 + Height = 4 + Align = alBottom + AutoSize = False + Transparent = True + end + object Label13: TLabel + Left = 0 + Top = 4 + Width = 4 + Height = 64 + Align = alLeft + AutoSize = False + Transparent = True + end + object Label16: TLabel + Left = 505 + Top = 4 + Width = 4 + Height = 64 + Align = alRight + AutoSize = False + Transparent = True + end + object pnlFooterMemosHost: TPanel + Left = 4 + Top = 4 + Width = 501 + Height = 64 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object memFooterLeft: TMemo + Tag = 3 + Left = 0 + Top = 0 + Width = 167 + Height = 64 + Align = alClient + ScrollBars = ssVertical + TabOrder = 0 + OnChange = MemoChange + OnEnter = MemoEnter + OnExit = MemoExit + end + object memFooterCenter: TMemo + Tag = 4 + Left = 167 + Top = 0 + Width = 167 + Height = 64 + Align = alRight + Alignment = taCenter + ScrollBars = ssVertical + TabOrder = 1 + OnChange = MemoChange + OnEnter = MemoEnter + OnExit = MemoExit + end + object memFooterRight: TMemo + Tag = 5 + Left = 334 + Top = 0 + Width = 167 + Height = 64 + Align = alRight + Alignment = taRightJustify + ScrollBars = ssVertical + TabOrder = 2 + OnChange = MemoChange + OnEnter = MemoEnter + OnExit = MemoExit + end + end + end + end + object pnlReverse: TPanel + Left = 0 + Top = 303 + Width = 509 + Height = 28 + Align = alTop + BevelOuter = bvNone + TabOrder = 3 + object chbxReverseOnEvenPages: TCheckBox + Left = 7 + Top = 8 + Width = 264 + Height = 17 + Caption = '&Reverse on even pages' + TabOrder = 0 + OnClick = chbxReverseOnEvenPagesClick + end + end + end + end + object tshScaling: TTabSheet + Caption = '&Scaling' + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 509 + Height = 337 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object bvlAdjustToHolder: TBevel + Left = 35 + Top = 32 + Width = 75 + Height = 22 + Visible = False + end + object bvlFitToPageHolder: TBevel + Left = 35 + Top = 84 + Width = 75 + Height = 22 + Visible = False + end + object lblPagesWideBy: TLabel + Left = 119 + Top = 91 + Width = 77 + Height = 13 + Caption = 'page(s) &wide by' + end + object lblPercentOfNormalSize: TLabel + Left = 118 + Top = 39 + Width = 67 + Height = 13 + Caption = '% normal size' + end + object bvlFitToPageTallHolder: TBevel + Left = 261 + Top = 84 + Width = 75 + Height = 22 + Visible = False + end + object lblTall: TLabel + Left = 343 + Top = 91 + Width = 14 + Height = 13 + Caption = '&tall' + end + object rbtnAdjustTo: TRadioButton + Left = 12 + Top = 9 + Width = 150 + Height = 17 + Caption = '&Adjust To:' + Checked = True + TabOrder = 0 + TabStop = True + OnClick = ScalingClick + end + object rbtnFitTo: TRadioButton + Tag = 1 + Left = 12 + Top = 62 + Width = 150 + Height = 17 + Caption = '&Fit To:' + TabOrder = 1 + OnClick = ScalingClick + end + end + end + end + end + object ilPrintOrders: TImageList + BkColor = clWhite + AllocBy = 2 + Height = 49 + Masked = False + Width = 74 + Left = 210 + Top = 65534 + Bitmap = { + 494C01010200040004004A003100FFFFFF00FE00FFFFFFFFFFFFFFFF424D3600 + 000000000000360000002800000028010000310000000100200000000000A0E2 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080000000 + 0000000000008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080000000000000000000000000000000 + 0000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000000000000000000080800000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 80008080800080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000000000000000000000000000000000008080 + 00008080000080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF0000000000000000008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF000000 + 00000000000080800000808000000000000000000000FFFFFF0080808000FFFF + FF0000000000000000000000000000000000FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000808000008080 + 00008080000080800000FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 000000000000808000008080000080800000FFFFFF00FFFFFF0080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000080800000808000008080 + 0000808000008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000080800000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000008080000080800000808000008080 + 000080800000808000008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 000080800000808000008080000080800000808000008080000080800000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF000000 + 000000000000808000008080000080800000808000008080000080808000FFFF + FF0000000000000000000000000000000000FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000808000008080000080800000808000008080 + 000080800000808000008080000080800000808000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF008080800080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 000000000000808000008080000080800000808000008080000080800000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000008080000080800000808000008080000080800000808000008080 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 000080800000808000008080000080800000808000008080000080800000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF000000 + 0000000000008080000080800000808000008080000080800000808000008080 + 000080800000000000000000000000000000FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00000000000000000080800000808000008080 + 0000808000008080000000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF000000 + 0000000000000000000000000000FFFFFF0080808000FFFFFF00000000000000 + 0000000000000000000080800000808000008080000080800000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00808000008080 + 0000808000008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF0000000000FFFFFF00808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00808080008080 + 0000808000008080000080800000FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 000080800000808000008080000080800000FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080000000 + 0000000000008080000080800000808000008080000080808000808080008080 + 8000808000008080000080800000808000008080800080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080000000000000000000808000008080 + 0000808000008080000080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808000008080000080800000808000008080000080808000808080008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080800000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 80008080800080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF008080000080800000808000008080000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008080000080800000808000008080000080800000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00000000000000000080800000808000008080000080800000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0080800000808000008080000080800000808000008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00000000000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF0000000000000000000000000080800000808000008080000080800000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000808000008080000080800000808000008080 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00000000000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080000080800000808000008080 + 0000FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080000080800000808000008080 + 000080800000FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080000000 + 0000000000008080000080800000808000008080000080808000808080008080 + 8000808080008080800080808000808080008080800080800000808000008080 + 000080800000FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080000000000000000000808000008080 + 0000808000008080000080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080800000808000008080 + 00008080000080800000FFFFFF00FFFFFF008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 80008080800080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00808000008080 + 0000808000008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 0000808000008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 000080800000808000008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080800000808000008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF008080000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008080000080800000808000008080000080800000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080000000 + 0000000000008080000080800000808000008080000080808000808080008080 + 8000808080008080800080808000808080008080800080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080800000808000008080000080800000808080008080 + 8000808080008080800080808000808080000000000000000000808000008080 + 0000808000008080000080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000FFFFFF00FFFFFF0080800000808000008080000080800000808000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 80008080800080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF008080800080800000808000008080000080800000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00808000008080000080800000808000008080 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF0000000000000000000000000000000000FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF008080000080800000808000008080 + 000000000000FFFFFF0080808000FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF008080000080800000808000008080 + 0000808000000000000000000000FFFFFF0080808000FFFFFF00000000000000 + 00000000000000000000FFFFFF0080808000FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0080800000808000008080 + 000080800000FFFFFF0080808000FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF008080800080800000808000008080 + 00008080000080800000FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00808000008080 + 0000808000008080000080808000FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00808000008080 + 0000808000008080000080800000FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF0000000000000000000000000000000000FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000008080 + 0000808000008080000080800000FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF008080 + 00008080000080800000808000008080000080808000FFFFFF00000000000000 + 00000000000000000000FFFFFF0080808000FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00808000008080000080800000808000000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF008080000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008080000080800000808000008080000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF008080000080800000808000008080000080800000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF0000000000000000000000000000000000FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF0080800000808000008080000080800000808000008080 + 00008080000080800000FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF000000 + 0000000000000000000080800000808000008080000080800000808000000000 + 00000000000000000000FFFFFF0080808000FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000808000008080000080800000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000808000008080000080800000808000008080 + 0000FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF008080000080800000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080000080800000808000008080 + 000080800000FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080000000 + 0000000000008080000080800000808000008080000080808000808080008080 + 8000808080008080800080808000808080008080800080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080800000808000008080 + 0000808000008080000080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000000000000000000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 80008080800080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF0000000000000000000000000000000000FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000008080 + 00008080000080800000FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000FFFFFF00FFFFFF0080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 000080800000808000008080000080800000FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF0000000000000000000000000000000000FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 00008080000080800000FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000FFFFFF00FFFFFF0080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 80008080800080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000} + end + object ilPaperTypes: TImageList + AllocBy = 8 + Left = 126 + Top = 65534 + Bitmap = { + 494C010103000800080010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000002000000001002000000000000020 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFF7FFFFF0000FFFFFF7FFFFF0000 + FFFFFF7FE0030000FFFFFC1FFFFF0000FFFFFE3FFFBF0000FF7FFF7FFF1F0000 + FF7FFFFFFE0F0000FF7FE003FFBF0000FF7FFFFFFFBF0000FC1FFF7FFFBF0000 + FE3FFE3FFFBF0000FF7FFC1FFFFF0000FFFFFF7FFFFF0000E003FF7FFFFF0000 + FFFFFF7FFFFF0000FFFFFFFFFFFF000000000000000000000000000000000000 + 000000000000} + end + object ilBins: TImageList + Left = 154 + Top = 65534 + Bitmap = { + 494C010102000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000001000000001002000000000000010 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000000000FF + FF00000000000000000000000000FFFFFF008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00000000000000 + 0000FFFFFF008080800000000000808080000000000000000000808080008080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 800080808000808080008080800000000000000000000000000080808000FFFF + FF00808080008080800000000000FFFFFF008080800080808000000000000000 + 0000808080008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF00000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00808080000000000080808000FFFFFF00808080008080 + 8000FFFFFF008080800000000000FFFFFF008080800080808000808080008080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF0000FFFF00808080008080800080808000808080000000000000000000FFFF + FF0000FFFF00FFFFFF008080800000000000808080008080800080808000FFFF + FF00808080008080800000000000FFFFFF008080800080808000808080008080 + 8000808080008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF0000FF + FF00FFFFFF0080808000FFFFFF00FFFFFF008080800080808000808080000000 + 0000FFFFFF0000FFFF00808080000000000080808000FFFFFF00808080008080 + 800080808000FFFFFF00FFFFFF00FFFFFF008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF0000FFFF00808080008080800000FF00000000FF0000000000808080000000 + 000000FFFF00FFFFFF008080800000000000808080008080800080808000FFFF + FF00FFFFFF008080800080808000FFFFFF00FFFFFF00FFFFFF00808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000808080008080800000FF + FF00FFFFFF0000FFFF00FFFFFF008080800080808000808080000000000000FF + FF00FFFFFF0000FFFF0080808000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000FF000000FF00FFFFFF00FFFFFF00FFFF + FF00808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0080808000FFFFFF00FFFFFF000000 + 000000FFFF00FFFFFF008080800000000000000000000000000080808000FFFF + FF00FFFFFF0000FF000000FF0000FFFFFF00FFFFFF00FFFFFF00808080008080 + 800000000000FFFFFF0080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00808080008080800000FF + FF00FFFFFF0000FFFF0080808000000000000000000000000000808080008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF008080800080808000FFFFFF00FFFF + FF0000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000000000000000000000000000000000000000 + 00008080800080808000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000008080800000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF0080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000080808000808080008080800080808000808080008080 + 8000FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000008080800000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF008080800000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000100000000100010000000000800000000000000000000000 + 000000000000000000000000FFFFFF00FFFFFE3F00000000E000E00F00000000 + C000800300000000800000010000000080000001000000008000000100000000 + 8000000000000000800000000000000080008000000000008000800000000000 + 8000C001000000008000F003000000008001FC0100000000C07FFF0000000000 + E0FFFF8100000000FFFFFFC70000000000000000000000000000000000000000 + 000000000000} + end + object ilPapers: TImageList + Left = 182 + Top = 65534 + Bitmap = { + 494C010102000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000001000000001002000000000000010 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00808080008080800080808000808080008080800080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000080800000808000FFFFFF00FFFF + FF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF0000FFFF0000808000008080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000808000FFFFFF000080800000FF + FF00FFFFFF00FFFFFF00FFFFFF000080800000808000FFFFFF00FFFFFF0000FF + FF00FFFFFF0000808000FFFFFF00008080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF0080808000808080008080800080808000808080008080800080808000FFFF + FF00FFFFFF00FFFFFF0000000000000000000080800000FFFF00FFFFFF000080 + 8000FFFFFF0000FFFF0000808000FFFFFF00FFFFFF0000808000FFFFFF00FFFF + FF000080800000FFFF00FFFFFF00008080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000808000FFFFFF00FFFFFF0000FF + FF000000000000808000FFFFFF0000FFFF00FFFFFF00FFFFFF00008080000000 + 0000FFFFFF00FFFFFF00FFFFFF00008080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF0080808000808080008080800080808000808080008080800080808000FFFF + FF00FFFFFF00FFFFFF0000000000000000000080800000FFFF00FFFFFF00FFFF + FF000080800000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF000080 + 8000FFFFFF0000FFFF00FFFFFF00008080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000808000FFFFFF00FFFFFF000080 + 8000FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF0000808000FFFFFF00FFFFFF00008080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF0080808000808080008080800080808000808080008080800080808000FFFF + FF00FFFFFF00FFFFFF0000000000000000000080800000FFFF0000808000FFFF + FF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF0000808000FFFFFF00008080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000080800000808000FFFFFF0000FF + FF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF00FFFFFF0000808000008080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000080800000808000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000008080000080800000808000008080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000100000000100010000000000800000000000000000000000 + 000000000000000000000000FFFFFF00C001FFFF00000000C001FFFF00000000 + C001FFFF00000000C001000000000000C001000000000000C001000000000000 + C001000000000000C001081000000000C001000000000000C001000000000000 + C001000000000000C001000000000000C001000000000000C003FFFF00000000 + C007FFFF00000000C00FFFFF0000000000000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPgsDlg.pas b/official/x.35/ExpressPrinting System/Sources/dxPgsDlg.pas new file mode 100644 index 00000000..e4d72cbe --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPgsDlg.pas @@ -0,0 +1,6180 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPgsDlg; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + ExtCtrls, StdCtrls, ComCtrls, Buttons, Menus, ToolWin, Registry, ImgList, + cxClasses, dxPSESys, dxPSForm, dxBkgnd, dxPreVw, dxPSGlbl, dxfmClr, dxPrnPg, + dxPrnDev, dxExtCtrls; + +type + TdxPageSetupDlgButtonKind = (psbHelp, psbStyleOptions, psbPreview, psbPrint); + TdxPageSetupDlgButtons = set of TdxPageSetupDlgButtonKind; + TdxPageSetupDlgOption = + (psoCenterOnPage, psoMargins, psoPageOrder, psoShading, psoStyleCaption, + psoHFAutoText, psoHFBackground, psoHFFont, psoHFText, psoHFFunctions, + psoHFMargins, psoHFReverse, psoHFVertAlignment); + TdxPageSetupDlgOptions = set of TdxPageSetupDlgOption; + TdxHFMode = (hfmThreeSections, hfmOneSection); + +const + psbAll = [Low(TdxPageSetupDlgButtonKind)..High(TdxPageSetupDlgButtonKind)]; + psbDefault = [psbStyleOptions, psbPreview, psbPrint]; + psoAll = [Low(TdxPageSetupDlgOption)..High(TdxPageSetupDlgOption)]; + psoDefaultOptionsEnabled = psoAll; + psoDefaultOptionsVisible = psoAll; + +type + TdxPrintStyleManager = class; + TBasedxPrintStyle = class; + TdxPrintStyleClass = class of TBasedxPrintStyle; + TAbstractdxStyleManagerDesigner = class; + TdxPageSetupDialog = class; + + TdxPrintStylePrinterPageClass = class of TdxPrintStylePrinterPage; + + TdxPrintStylePrinterPage = class(TdxPrinterPage) + private + FPrintStyle: TBasedxPrintStyle; + protected + function GetOwner: TPersistent; override; + + function IsPageFooterTitleStored(Index: Integer): Boolean; override; + function IsPageHeaderTitleStored(Index: Integer): Boolean; override; + procedure PageParamsChanged(AUpdateCodes: TdxPrinterPageUpdateCodes); override; + public + property PrintStyle: TBasedxPrintStyle read FPrintStyle; + end; + + TdxPrintStyleState = (pssCopy, pssOptionsDialog); + TdxPrintStyleStates = set of TdxPrintStyleState; + + TdxPageParamsChangedEvent = procedure(Sender: TdxPrinterPage; + APrintStyle: TBasedxPrintStyle; AUpdateCodes: TdxPrinterPageUpdateCodes) of object; + + TdxFilterPaperEvent = procedure(Sender: TBasedxPrintStyle; + const APaper: TdxPaperInfo; var AIsSupported: Boolean) of object; + + TBasedxPrintStyle = class(TComponent) + private + FAllowChangeHFText: Boolean; + FAllowChangeMargins: Boolean; + FAllowChangeOrientation: Boolean; + FAllowChangePaper: Boolean; + FAllowChangeScale: Boolean; + FAllowCustomPaperSizes: Boolean; + FBuiltIn: Boolean; + FData: Pointer; + FDefaultStyleGlyph: TBitmap; + FDescription: string; + FImageIndex: Integer; + FIsDescriptionAssigned: Boolean; + FIsStyleCaptionAssigned: Boolean; + FIsStyleGlyphAssigned: Boolean; + FPrinterPage: TdxPrinterPage; + FShowPageSetupDlg: Boolean; + FState: TdxPrintStyleStates; + FStyleCaption: string; + FStyleGlyph: TBitmap; + FStyleManager: TdxPrintStyleManager; + FOnDestroy: TNotifyEvent; + FOnFilterPaper: TdxFilterPaperEvent; + function GetDescription: string; + function GetIndex: Integer; + function GetIsCurrentStyle: Boolean; + function GetStyleCaption: string; + function GetStyleGlyph: TBitmap; + function IsDescriptionStored: Boolean; + function IsStyleCaptionStored: Boolean; + function IsStyleGlyphStored: Boolean; + procedure SetBuiltIn(Value: Boolean); + procedure SetDescription(const Value: string); + procedure SetImageIndex(Value: Integer); + procedure SetIndex(Value: Integer); + procedure SetIsCurrentStyle(Value: Boolean); + procedure SetPrinterPage(Value: TdxPrinterPage); + procedure SetStyleCaption(const Value: string); + procedure SetStyleGlyph(Value: TBitmap); + procedure SetStyleManager(Value: TdxPrintStyleManager); + + procedure DesignerModified; + procedure DesignerUpdate(TheAll: Boolean); + function IsDesigning: Boolean; + function IsLoading: Boolean; + + procedure ReadData(Reader: TReader); + procedure ReadIsDescriptionAssigned(Reader: TReader); + procedure ReadIsStyleCaptionAssigned(Reader: TReader); + procedure ReadIsStyleGlyphAssigned(Reader: TReader); + procedure WriteData(Writer: TWriter); + procedure WriteIsDescriptionAssigned(Writer: TWriter); + procedure WriteIsStyleCaptionAssigned(Writer: TWriter); + procedure WriteIsStyleGlyphAssigned(Writer: TWriter); + protected + procedure DefineProperties(Filer: TFiler); override; + procedure ReadState(Reader: TReader); override; + procedure SetName(const NewName: TComponentName); override; + procedure SetParentComponent(AParent: TComponent); override; + + function GetAllowChangeHFText: Boolean; virtual; + function GetAllowChangeMargins: Boolean; virtual; + function GetAllowChangeOrientation: Boolean; virtual; + function GetAllowChangePaper: Boolean; virtual; + function GetAllowChangeScale: Boolean; virtual; + function GetAllowCustomPaperSizes: Boolean; virtual; + procedure SetAllowChangeHFText(Value: Boolean); virtual; + procedure SetAllowChangeMargins(Value: Boolean); virtual; + procedure SetAllowChangeOrientation(Value: Boolean); virtual; + procedure SetAllowChangePaper(Value: Boolean); virtual; + procedure SetAllowChangeScale(Value: Boolean); virtual; + procedure SetAllowCustomPaperSizes(Value: Boolean); virtual; + + function CreatePrinterPage: TdxPrinterPage; virtual; + function GetPrinterPageClass: TdxPrinterPageClass; virtual; + procedure InitializePrinterPage(APrinterPage: TdxPrinterPage); virtual; + + procedure DoAfterPrinting; dynamic; + procedure DoBeforePrinting; dynamic; + procedure DoDestroy; dynamic; + function IsSupportedPaper(const APaper: TdxPaperInfo): Boolean; dynamic; + procedure PageParamsChanged(AUpdateCodes: TdxPrinterPageUpdateCodes); dynamic; + + procedure InitializeDefaultStyleGlyph(ABitmap: TBitmap); virtual; + procedure StyleGlyphChanged(Sender: TObject); virtual; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure BeforeDestruction; override; + procedure Assign(Source: TPersistent); override; + function GetParentComponent: TComponent; override; + function HasParent: Boolean; override; + + class function StyleClass: TdxPrintStyleClass; + + function DefaultDescription: string; virtual; + function DefaultPageFooterText(APart: TdxPageTitlePart): string; virtual; + function DefaultPageHeaderText(APart: TdxPageTitlePart): string; virtual; + function DefaultStyleCaption: string; virtual; + function DefaultStyleGlyph: TBitmap; virtual; + + procedure AfterPrinting; + procedure BeforePrinting; + + procedure GetFilteredPapers(AStrings: TStrings); + + function PageSetup: Boolean; overload; + function PageSetup(AnActivePageIndex: Integer; AShowPreviewBtn, AShowPrintBtn: Boolean; + out APreviewBtnClicked, APrintBtnClicked: Boolean): Boolean; overload; + function PageSetup(AnActivePageIndex: Integer; + APreviewBtnClicked, APrintBtnClicked: PBoolean): Boolean; overload; //{$IFDEF DELPHI6} deprecated; {$ENDIF} + function PageSetupEx(AnActivePageIndex: Integer; + APreviewBtnClicked, APrintBtnClicked: PBoolean): Boolean; overload; //{$IFDEF DELPHI6} deprecated; {$ENDIF} + + function SetupOptions: Boolean; // obsolete - do nothing ! + + procedure RestoreDefaultGlyph; virtual; + procedure RestoreDefaults; virtual; + + property BuiltIn: Boolean read FBuiltIn write SetBuiltIn; + property Data: Pointer read FData write FData; + property IsStyleGlyphAssigned: Boolean read FIsStyleGlyphAssigned; + property State: TdxPrintStyleStates read FState; + property StyleManager: TdxPrintStyleManager read FStyleManager write SetStyleManager; + published + property AllowChangeHFText: Boolean read GetAllowChangeHFText write SetAllowChangeHFText default True; + property AllowChangeMargins: Boolean read GetAllowChangeMargins write SetAllowChangeMargins default True; + property AllowChangeOrientation: Boolean read GetAllowChangeOrientation write SetAllowChangeOrientation default True; + property AllowChangePaper: Boolean read GetAllowChangePaper write SetAllowChangePaper default True; + property AllowChangeScale: Boolean read GetAllowChangeScale write SetAllowChangeScale default True; + property AllowCustomPaperSizes: Boolean read GetAllowCustomPaperSizes write SetAllowCustomPaperSizes default True; + property Description: string read GetDescription write SetDescription stored IsDescriptionStored; + property ImageIndex: Integer read FImageIndex write SetImageIndex default -1; + property Index: Integer read GetIndex write SetIndex stored False; + property IsCurrentStyle: Boolean read GetIsCurrentStyle write SetIsCurrentStyle stored False; + property PrinterPage: TdxPrinterPage read FPrinterPage write SetPrinterPage; + property ShowPageSetupDlg: Boolean read FShowPageSetupDlg write FShowPageSetupDlg stored False; + property StyleCaption: string read GetStyleCaption write SetStyleCaption stored IsStyleCaptionStored; + property StyleGlyph: TBitmap read GetStyleGlyph write SetStyleGlyph stored IsStyleGlyphStored; {32 x 32} + + property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy; + property OnFilterPaper: TdxFilterPaperEvent read FOnFilterPaper write FOnFilterPaper; + end; + + TdxPrintStyleManager = class(TComponent) + private + FAlreadySaved: Boolean; + FAutoHFTextEntries: TStrings; + FAutoSave: Boolean; + FCloneStyleCaptionPrefix: string; + FCurrentStyle: TBasedxPrintStyle; + FDesigner: TAbstractdxStyleManagerDesigner; + FHelpContext: THelpContext; + FImages: TImageList; + FInternalStreaming: Boolean; + FIsCloneStyleCaptionPrefixAssigned: Boolean; + FIsTitleAssigned: Boolean; + FLoadedExistingStyles: TStringList; + FPageSetupDialog: TdxPageSetupDialog; + FPreviewBtnClicked: Boolean; + FPrintBtnClicked: Boolean; + FStorageName: string; + FStyles: TList; + FTitle: string; + FVersion: Integer; + FUpdateCount: Integer; + FWindowHandle: hWnd; + FOnChangeCurrentStyle: TNotifyEvent; + FOnStyleListChanged: TNotifyEvent; + function GetCloneStyleCaptionPrefix: string; + function GetCount: Integer; + function GetCurrentStyleIndex: Integer; + function GetRegistryPath: string; + function GetStyle(Index: Integer): TBasedxPrintStyle; + function GetTitle: string; + function IsAutoHFTextEntriesStored: Boolean; + function IsCloneStyleCaptionPrefixStored: Boolean; + function IsTitleStored: Boolean; + procedure SetAutoHFTextEntries(Value: TStrings); + procedure SetCloneStyleCaptionPrefix(const Value: string); + procedure SetCurrentStyle(Value: TBasedxPrintStyle); + procedure SetCurrentStyleIndex(Value: Integer); + procedure SetImages(Value: TImageList); + procedure SetNewStyleCaption(AStyle: TBasedxPrintStyle; AIndex: Integer); + procedure SetPageSetupDialog(Value: TdxPageSetupDialog); + procedure SetStyle(Index: Integer; Value: TBasedxPrintStyle); + procedure SetTitle(const Value: string); + + function AllowAutoSave: Boolean; + procedure DesignerModified; + procedure DesignerUpdate(AStyle: TBasedxPrintStyle); + function IsDesigning: Boolean; + function IsDestroying: Boolean; + function IsLoading: Boolean; + + procedure FreeAndNilStyles; + procedure InsertStyle(Value: TBasedxPrintStyle); + procedure MoveStyle(ACurIndex, ANewIndex: Integer); + procedure RemoveStyle(Value: TBasedxPrintStyle); + procedure ResyncCurrentStyle(AIndex: Integer); + + // AutoHFTextEntries - v2.2 + procedure AutoHFTextEntriesChanged(Sender: TObject); + procedure OnAutoHFTextEntryClick(Sender: TObject); + procedure OnEditAutoHFTextEntriesClick(Sender: TObject); + + procedure WndProc(var Message: TMessage); + + procedure SetNameHandler(Reader: TReader; Component: TComponent; var Name: string); + + procedure ReadIsCloneStyleCaptionPrefixAssigned(Reader: TReader); + procedure ReadIsTitleAssigned(Reader: TReader); + procedure WriteIsCloneStyleCaptionPrefixAssigned(Writer: TWriter); + procedure WriteIsTitleAssigned(Writer: TWriter); + protected + procedure DefineProperties(Filer: TFiler); override; + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + procedure Loaded; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure ReadState(Reader: TReader); override; + procedure SetChildOrder(Child: TComponent; Order: Integer); override; + procedure SetName(const NewName: TComponentName); override; + + function CreateAutoHFTextEntries: TStrings; virtual; + procedure DoRestoreDefaults; virtual; + + procedure ChangeCurrentStyle; dynamic; + procedure PageParamsChanged(APrintStyle: TBasedxPrintStyle; + AUpdateCodes: TdxPrinterPageUpdateCodes); dynamic; + procedure StyleListChanged; dynamic; + + property RegistryPath: string read GetRegistryPath; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + function AddStyle(AStyleClass: TdxPrintStyleClass): TBasedxPrintStyle; + function AddStyleEx(AStyleClass: TdxPrintStyleClass; AOwner: TComponent): TBasedxPrintStyle; + procedure AssignStyles(Source: TdxPrintStyleManager); + procedure Clear; + procedure Delete(Index: Integer); + procedure DeleteNonBuiltIns; + function IndexOfStyle(Value: TBasedxPrintStyle): Integer; + function NonBuiltInsExists: Boolean; + function StyleByCaption(const ACaption: string): TBasedxPrintStyle; + function StyleByName(const AName: string): TBasedxPrintStyle; + + function BeginClone(AIndex: Integer): TBasedxPrintStyle; + procedure EndClone(AStyle: TBasedxPrintStyle); + + procedure BeginUpdate; + procedure EndUpdate; + + function DefaultCloneStyleCaptionPrefix: string; virtual; + function DefaultTitle: string; virtual; + + // AutoHFTextEntries - v2.2 + procedure BuildAutoHFTextEntriesMenu(ARootItem: TComponent; AData: Pointer; + AIncludeSetupAutoHFTextEntriesItem: Boolean = True); + procedure RefreshAutoHFTextEntries; + function ShowAutoHFTextEntriesDlg: Boolean; + + procedure LoadFromRegistry(const APath: string); + procedure SaveToRegistry(const APath: string); + + procedure DefinePrintStylesDlg(out APreviewBtnClicked, APrintBtnClicked: Boolean); overload; + procedure DefinePrintStylesDlg(APreviewBtnClicked, APrintBtnClicked: PBoolean); overload; {$IFDEF DELPHI6} deprecated; {$ENDIF} + + procedure RestoreDefaultAutoHFTextEntries; + procedure RestoreDefaults; + procedure RestoreDefaultStyles; + + procedure LoadFromFile(const AName: string); + procedure LoadFromStream(AStream: TStream); + procedure SaveToFile(const AName: string); + procedure SaveToStream(AStream: TStream); + + property Count: Integer read GetCount; + property CurrentStyleIndex: Integer read GetCurrentStyleIndex write SetCurrentStyleIndex; + property Designer: TAbstractdxStyleManagerDesigner read FDesigner; {accessible only in DesignTime} + property PreviewBtnClicked: Boolean read FPreviewBtnClicked; + property PrintBtnClicked: Boolean read FPrintBtnClicked; + property Styles[Index: Integer]: TBasedxPrintStyle read GetStyle write SetStyle; default; + property UpdateCount: Integer read FUpdateCount; + published + property AutoHFTextEntries: TStrings read FAutoHFTextEntries write SetAutoHFTextEntries stored IsAutoHFTextEntriesStored; + property AutoSave: Boolean read FAutoSave write FAutoSave default False; + property CloneStyleCaptionPrefix: string read GetCloneStyleCaptionPrefix write SetCloneStyleCaptionPrefix stored IsCloneStyleCaptionPrefixStored; + property CurrentStyle: TBasedxPrintStyle read FCurrentStyle write SetCurrentStyle; + property HelpContext: THelpContext read FHelpContext write FHelpContext default 0; + property Images: TImageList read FImages write SetImages; + property PageSetupDialog: TdxPageSetupDialog read FPageSetupDialog write SetPageSetupDialog; + property StorageName: string read FStorageName write FStorageName; + property Title: string read GetTitle write SetTitle stored IsTitleStored; + property Version: Integer read FVersion write FVersion; + + property OnChangeCurrentStyle: TNotifyEvent read FOnChangeCurrentStyle write FOnChangeCurrentStyle; + property OnStyleListChanged: TNotifyEvent read FOnStyleListChanged write FOnStyleListChanged; + end; + + TAbstractdxStyleManagerDesigner = class + private + FStyleManager: TdxPrintStyleManager; + protected + procedure Modified; virtual; abstract; + procedure Update(AItem: TBasedxPrintStyle); virtual; abstract; + public + constructor Create(AStyleManager: TdxPrintStyleManager); + destructor Destroy; override; + + procedure BeginUpdate; virtual; abstract; + procedure CancelUpdate; virtual; abstract; + procedure EndUpdate; virtual; abstract; + + property StyleManager: TdxPrintStyleManager read FStyleManager; + end; + + { TdxPageSetupDialog } + + TdxCustomDrawPreviewEvent = procedure(APrintStyle: TBasedxPrintStyle; + ACanvas: TCanvas; APageRect, AContentRect, AHeaderRect, AFooterRect: TRect) of object; + + PdxPageSetupDlgEvents = ^TdxPageSetupDlgEvents; + TdxPageSetupDlgEvents = record + OnClose: TNotifyEvent; + OnCustomDrawPreview: TdxCustomDrawPreviewEvent; + OnShow: TNotifyEvent; + end; + + PdxPageSetupDlgData = ^TdxPageSetupDlgData; + TdxPageSetupDlgData = packed record + PrintStyle: TBasedxPrintStyle; + ActivePageIndex: Integer; + Title: string; + HelpContext: THelpContext; + HFMode: TdxHFMode; + ButtonsEnabled: TdxPageSetupDlgButtons; + ButtonsVisible: TdxPageSetupDlgButtons; + OptionsEnabled: TdxPageSetupDlgOptions; + OptionsVisible: TdxPageSetupDlgOptions; + Events: TdxPageSetupDlgEvents; + PreviewBtnClicked: Boolean; + PrintBtnClicked: Boolean; + iReserved: Integer; + end; + + TdxPageSetupDialog = class(TComponent) + private + FActivePageIndex: Integer; + FButtonsEnabled: TdxPageSetupDlgButtons; + FButtonsVisible: TdxPageSetupDlgButtons; + FHFMode: TdxHFMode; + FHelpContext: THelpContext; + FIsTitleAssigned: Boolean; + FOptionsEnabled: TdxPageSetupDlgOptions; + FOptionsVisible: TdxPageSetupDlgOptions; + FPreviewBtnClicked: Boolean; + FPrintBtnClicked: Boolean; + FPrintStyle: TBasedxPrintStyle; + FTitle: string; + FOnClose: TNotifyEvent; + FOnCustomDrawPreview: TdxCustomDrawPreviewEvent; + FOnShow: TNotifyEvent; + function GetTitle: string; + function IsTitleStored: Boolean; + procedure SetPrintStyle(Value: TBasedxPrintStyle); + procedure SetTitle(const Value: string); + + procedure ReadIsTitleAssigned(Reader: TReader); + procedure WriteIsTitleAssigned(Writer: TWriter); + protected + procedure DefineProperties(Filer: TFiler); override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + public + constructor Create(AOwner: TComponent); override; + procedure Assign(Source: TPersistent); override; + + function DefaultTitle: string; virtual; + function Execute: Boolean; + function RealTitle: string; + procedure RestoreDefaults; virtual; + + property PreviewBtnClicked: Boolean read FPreviewBtnClicked; + property PrintBtnClicked: Boolean read FPrintBtnClicked; + published + property ActivePageIndex: Integer read FActivePageIndex write FActivePageIndex default 0; + property ButtonsEnabled: TdxPageSetupDlgButtons read FButtonsEnabled write FButtonsEnabled + default [psbStyleOptions, psbPreview, psbPrint]; + property ButtonsVisible: TdxPageSetupDlgButtons read FButtonsVisible write FButtonsVisible + default [psbStyleOptions, psbPreview, psbPrint]; + property HelpContext: THelpContext read FHelpContext write FHelpContext default 0; + property HFMode: TdxHFMode read FHFMode write FHFMode default hfmThreeSections; + property OptionsEnabled: TdxPageSetupDlgOptions read FOptionsEnabled write FOptionsEnabled + default [Low(TdxPageSetupDlgOption)..High(TdxPageSetupDlgOption)]; {psoDefaultOptionsEnabled} + property OptionsVisible: TdxPageSetupDlgOptions read FOptionsVisible write FOptionsVisible + default psoDefaultOptionsVisible; + property PrintStyle: TBasedxPrintStyle read FPrintStyle write SetPrintStyle; + property Title: string read GetTitle write SetTitle stored IsTitleStored; + + property OnClose: TNotifyEvent read FOnClose write FOnClose; + property OnCustomDrawPreview: TdxCustomDrawPreviewEvent read FOnCustomDrawPreview write FOnCustomDrawPreview; + property OnShow: TNotifyEvent read FOnShow write FOnShow; + end; + + TdxfmPageSetupDialog = class(TCustomdxPSForm) + pnlStyleName: TPanel; + lblStyleName: TLabel; + edStyleName: TEdit; + ilPrintOrders: TImageList; + ilPaperTypes: TImageList; + btnOptions: TButton; + pnlButtons: TPanel; + btnPrintPreview: TButton; + btnPrint: TButton; + btnOK: TButton; + btnCancel: TButton; + btnHelp: TButton; + Panel4: TPanel; + pgctrlMain: TPageControl; + tshPage: TTabSheet; + Panel5: TPanel; + gbxPaper: TGroupBox; + lblPaperType: TLabel; + lblPaperDimensions: TLabel; + lblPaperSource: TLabel; + lblPaperWidth: TLabel; + lblPaperHeight: TLabel; + bvlPaperDimensions: TBevel; + bvlPaperSource: TBevel; + bvlPaperType: TBevel; + bvlPaperWidthHolder: TBevel; + bvlPaperHeightHolder: TBevel; + lbxPaperType: TListBox; + cbxPaperSource: TComboBox; + Panel1: TPanel; + tshMargins: TTabSheet; + pnlInMargins: TPanel; + lblPreview: TLabel; + Bevel12: TBevel; + bvlPreviewHolder: TBevel; + Panel14: TPanel; + tshHeaderFooter: TTabSheet; + Panel7: TPanel; + pnlBottom: TPanel; + pnlHFOpt: TPanel; + pnlHeader: TPanel; + pnlHeaderMemos: TPanel; + pnlHeaderFont: TPanel; + btnHeaderFont: TButton; + edHeaderFontInfo: TEdit; + btnHeaderBackground: TBitBtn; + pnlHeaderTitle: TPanel; + lblHeader: TLabel; + bvlHeader: TBevel; + pnlFooter: TPanel; + pnlFooterTitle: TPanel; + lblFooter: TLabel; + bvlFooter: TBevel; + pnlFooterFont: TPanel; + btnFooterFont: TButton; + edFooterFontInfo: TEdit; + btnFooterBackGround: TBitBtn; + pnlFooterMemos: TPanel; + pnlReverse: TPanel; + chbxReverseOnEvenPages: TCheckBox; + tshScaling: TTabSheet; + Panel2: TPanel; + bvlAdjustToHolder: TBevel; + bvlFitToPageHolder: TBevel; + lblPagesWideBy: TLabel; + lblPercentOfNormalSize: TLabel; + bvlFitToPageTallHolder: TBevel; + lblTall: TLabel; + rbtnAdjustTo: TRadioButton; + rbtnFitTo: TRadioButton; + ilBins: TImageList; + ilPapers: TImageList; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + Panel6: TPanel; + gbxOrientation: TGroupBox; + bvlOrientationHolder: TBevel; + rBtnLandscape: TRadioButton; + rBtnPortrait: TRadioButton; + gbxPrintOrder: TGroupBox; + pbxPageOrder: TPaintBox; + rbtnOverThenDown: TRadioButton; + rbtnDownThenOver: TRadioButton; + gbxShading: TGroupBox; + chbxShading: TCheckBox; + Label5: TLabel; + Label6: TLabel; + Label7: TLabel; + Label8: TLabel; + Panel8: TPanel; + gbxMargins: TGroupBox; + pnlMargins: TPanel; + lblMarginTop: TLabel; + lblMarginBottom: TLabel; + lblMarginLeft: TLabel; + lblMarginRight: TLabel; + bvlMarginTopHolder: TBevel; + bvlMarginBottomHolder: TBevel; + bvlMarginLeftHolder: TBevel; + bvlMarginRightHolder: TBevel; + pnlHFMargins: TPanel; + lblMarginHeader: TLabel; + lblMarginFooter: TLabel; + bvlMarginHeaderHolder: TBevel; + bvlMarginFooterHolder: TBevel; + Panel3: TPanel; + btnFix: TButton; + btnRestoreOriginalMargins: TButton; + pnlCenterOnPage: TPanel; + lblCenterOnPage: TLabel; + bvlCenterOnPage: TBevel; + chbxCenterHorz: TCheckBox; + chbxCenterVert: TCheckBox; + bvlMarginsWarningHolder: TBevel; + Label9: TLabel; + Label10: TLabel; + Label11: TLabel; + Label12: TLabel; + pnlHeaderMemosHost: TPanel; + memHeaderLeft: TMemo; + memHeaderCenter: TMemo; + memHeaderRight: TMemo; + Label14: TLabel; + Label15: TLabel; + Label13: TLabel; + Label16: TLabel; + pnlFooterMemosHost: TPanel; + memFooterLeft: TMemo; + memFooterCenter: TMemo; + memFooterRight: TMemo; + Label18: TLabel; + Label17: TLabel; + Label19: TLabel; + Label20: TLabel; + Panel9: TPanel; + pnlVertAlignment: TPanel; + gbxVertAlignment: TGroupBox; + tbTAVert: TToolBar; + ToolButton12: TToolButton; + ToolButton13: TToolButton; + ToolButton14: TToolButton; + gbxFunctions: TGroupBox; + pnlToolBar: TPanel; + tbPredefined: TToolBar; + procedure btnHFFontClick(Sender: TObject); + procedure SpecialInsertClick(Sender: TObject); + procedure pgctrlMainChange(Sender: TObject); + procedure BackgroundClick(Sender: TObject); + procedure VertTextAlignClick(Sender: TObject); + procedure memHeaderLeftChange(Sender: TObject); + procedure chbxReverseOnEvenPagesClick(Sender: TObject); + procedure btnPrintPreviewClick(Sender: TObject); + procedure lblMarginTopClick(Sender: TObject); + procedure btnPrintClick(Sender: TObject); + procedure lblPaperSourceClick(Sender: TObject); + procedure pbxPageOrderPaint(Sender: TObject); + procedure PageOrderClick(Sender: TObject); + procedure pbxPageOrderDblClick(Sender: TObject); + procedure CenterOnPageClick(Sender: TObject); + procedure OrientationClick(Sender: TObject); + procedure cbxPaperSourceChange(Sender: TObject); + procedure lbxPaperTypeClick(Sender: TObject); + procedure ScalingClick(Sender: TObject); + procedure cbxPaperSourceDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure lbxPaperTypeDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure MemoChange(Sender: TObject); + procedure MemoEnter(Sender: TObject); + procedure MemoExit(Sender: TObject); + procedure edStyleNameChange(Sender: TObject); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + procedure edStyleNameExit(Sender: TObject); + procedure chbxShadingClick(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure pgctrlMainChanging(Sender: TObject; + var AllowChange: Boolean); + procedure btnRestoreOriginalMarginsClick(Sender: TObject); + procedure btnFixClick(Sender: TObject); + procedure OrientationDblClick(Sender: TObject); + private + FBmpArrow: TBitmap; + FControlsUpdating: Boolean; + FilPredefined: TImageList; + FFooterBkGndGlyph: TBitmap; + FHeaderBkGndGlyph: TBitmap; + FHFFunctionList: TStringList; + FModified: Boolean; + FMarginsChanged: Boolean; + FMarginsChanging: Boolean; + FMarginsInvalid: Boolean; + FMarginsOutside: Boolean; + FOrientationPreview: TdxPreview; + FPaperSizeLocked: Boolean; + FPreview: TdxPreview; + FPreviewBtnClicked: Boolean; + FPrintBtnClicked: Boolean; + FPrintStyle: TBasedxPrintStyle; + FSavePrintStyle: TBasedxPrintStyle; + FStyleManager: TdxPrintStyleManager; + FwpMargins: TdxPSWarningPane; + + FOnClose: TNotifyEvent; + FOnCustomDrawPreview: TdxCustomDrawPreviewEvent; + FOnShow: TNotifyEvent; + procedure AdjustToExit(Sender: TObject); + procedure AutoHFTextEntriesClick(Sender: TObject); + procedure ChangeBkgndGlyph(AGlyph: TBitmap; ABackground: TdxBackground); + procedure FitToPageChange(Sender: TObject); + procedure FitToPageExit(Sender: TObject); + procedure FitToPageTallExit(Sender: TObject); + procedure MarginButtonClick(Sender: TObject; ButtonType: TdxButtonType; + Button: TUDBtnType); + procedure MarginChange(Sender: TObject); + procedure MarginExit(Sender: TObject); + procedure OrientationPreviewCalcPageCount(Sender: TObject); + procedure PaperHeightButtonClick(Sender: TObject; ButtonType: TdxButtonType; + Button: TUDBtnType); + procedure PaperWidthButtonClick(Sender: TObject; ButtonType: TdxButtonType; + Button: TUDBtnType); + procedure PaperHeightExit(Sender: TObject); + procedure PaperWidthExit(Sender: TObject); + procedure PaperWidthChange(Sender: TObject); + procedure PaperHeightChange(Sender: TObject); + procedure PreviewCalcPageCount(Sender: TObject); + procedure PreviewDrawPageContent(Sender: TObject; ACanvas: TCanvas; + ABounds: TRect; APageIndex: Integer); + procedure PreviewAfterDragMargin(Sender: TObject; AMargin: TdxPreviewPageMargin); + procedure ScaleChanged(Sender: TObject); + + procedure CheckModified; + procedure CreateControls; + procedure EnabledMemoAttr(AEnabled: Boolean); + function FindControlPageIndex(AControl: TWinControl): Integer; + procedure FixupMargins; + procedure FixupMarginsOutside; + function GetEditColor(Value: Boolean): TColor; + function GetCurrentPaperInfo: TdxPaperInfo; + function GetPage: TdxPrinterPage; + function GetPaperInfo(Index: Integer): TdxPaperInfo; + function GetPaperInfoCount: Integer; + procedure LoadStrings; + procedure RestoreOriginalMargins; + procedure SaveMargins; + procedure SaveStyleCaption; + procedure SaveUserInput; + procedure SetMarginsInvalid(Value: Boolean); + procedure SetMarginsOutside(Value: Boolean); + procedure SetupDialog(const APageSetupDlgData: TdxPageSetupDlgData); + procedure StartSetting; + procedure TrySetActiveControl(AControl: TWinControl); + procedure UpdateControlsState; + procedure UpdateMarginsBounds; + procedure UpdateMarginsEdits; + procedure UpdatePageInfos; + procedure UpdatePreviewMargin(const AValue: Extended; AMargin: TdxPreviewPageMargin); + procedure UpdatePreviewMargins; + procedure UpdateWarningPane(AValue, APairValue: Boolean; const AHint, APairHint: string); + function ValidateMargins(out AInvalidMarginControl: TWinControl): Boolean; + function ValidateMarginsOutside(out AInvalidMarginControl: TWinControl): Boolean; + function ValidateStyleCaption: Boolean; + function ValidateUserInput(out AControl: TWinControl): Boolean; + + procedure CMSysColorChange(var Message: TMessage); message CM_SYSCOLORCHANGE; + + property MarginsInvalid: Boolean read FMarginsInvalid write SetMarginsInvalid; + property MarginsOutside: Boolean read FMarginsOutside write SetMarginsOutside; + protected + procedure CreateWnd; override; + procedure DoHide; override; + procedure DoShow; override; + public + FseAdjustTo: TdxPSSpinEdit; + FseFitToPage: TdxPSSpinEdit; + FseFitToPageTall: TdxPSSpinEdit; + FseMarginBottom: TdxPSSpinEdit; + FseMarginFooter: TdxPSSpinEdit; + FseMarginHeader: TdxPSSpinEdit; + FseMarginLeft: TdxPSSpinEdit; + FseMarginRight: TdxPSSpinEdit; + FseMarginTop: TdxPSSpinEdit; + FsePaperHeight: TdxPSSpinEdit; + FsePaperWidth: TdxPSSpinEdit; + + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function Execute: Boolean; + + procedure SetPrintStyle(Value: TBasedxPrintStyle); + + property CurrentPaperInfo: TdxPaperInfo read GetCurrentPaperInfo; + property Modified: Boolean read FModified; + property Page: TdxPrinterPage read GetPage; + property PaperInfoCount: Integer read GetPaperInfoCount; + property PaperInfos[Index: Integer]: TdxPaperInfo read GetPaperInfo; + property PreviewBtnClicked: Boolean read FPreviewBtnClicked; + property PrintBtnClicked: Boolean read FPrintBtnClicked; + property PrintStyle: TBasedxPrintStyle read FPrintStyle; + property OnCustomDrawPreview: TdxCustomDrawPreviewEvent read FOnCustomDrawPreview write FOnCustomDrawPreview; + end; + + TdxHFFunctionFormatObjectClass = class of TdxHFFunctionFormatObject; + + TdxHFFunctionFormatObject = class + private + FCurrentPage: Integer; + FDateFormat: string; + FDateTime: TDateTime; + FMachineName: string; + FPageNumberFormat: TdxPageNumberFormat; + FStartPageIndex: Integer; + FTimeFormat: string; + FTotalPages: Integer; + FUserName: string; + protected + procedure Initialize; virtual; + public + constructor Create; virtual; + property CurrentPage: Integer read FCurrentPage write FCurrentPage; + property DateFormat: string read FDateFormat write FDateFormat; + property DateTime: TDateTime read FDateTime write FDateTime; + property MachineName: string read FMachineName write FMachineName; + property PageNumberFormat: TdxPageNumberFormat read FPageNumberFormat write FPageNumberFormat; + property StartPageIndex: Integer read FStartPageIndex write FStartPageIndex; + property TimeFormat: string read FTimeFormat write FTimeFormat; + property TotalPages: Integer read FTotalPages write FTotalPages; + property UserName: string read FUserName write FUserName; + end; + + { Function Categories } + + TdxHFFunctionCustomCategoryClass = class of TdxHFFunctionCustomCategory; + TdxHFFunctionCustomCategory = class end; + TdxHFFunctionDateTimeCategory = class(TdxHFFunctionCustomCategory); + TdxHFFunctionPagesCategory = class(TdxHFFunctionCustomCategory); + TdxHFFunctionAuthenticationCategory = class(TdxHFFunctionCustomCategory); + + { Function } + + TdxHFConvertFunction = function(const Source: string; const AFormatObject: TdxHFFunctionFormatObject): string; + + TdxHFCustomFunctionClass = class of TdxHFCustomFunction; + + TdxHFCustomFunction = class(TPersistent) + private + FGlyph: TBitmap; + FHint: string; + FTemplateString: string; + procedure SetGlyph(Value: Graphics.TBitmap); + procedure SetTemplateString(const Value: string); + protected + function ConvertFunc(const Source: string; const AFormatObject: TdxHFFunctionFormatObject): string; virtual; + public + constructor Create; virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + function DoProcess(const Source: string; const AFormatObject: TdxHFFunctionFormatObject): string; virtual; + class function FunctionClass: TdxHFCustomFunctionClass; + class function GetCategory: TdxHFFunctionCustomCategoryClass; virtual; + class function GetName: string; virtual; + + property Glyph: TBitmap read FGlyph write SetGlyph; + property Hint: string read FHint write FHint; + property TemplateString: string read FTemplateString write SetTemplateString; + end; + + TdxHFPagesFunctions = class(TdxHFCustomFunction) + public + class function GetCategory: TdxHFFunctionCustomCategoryClass; override; + end; + + TdxHFPageNumberFunction = class(TdxHFPagesFunctions) + protected + function ConvertFunc(const Source: string; const AFormatObject: TdxHFFunctionFormatObject): string; override; + public + constructor Create; override; + class function GetName: string; override; + end; + + TdxHFTotalPagesFunction = class(TdxHFPagesFunctions) + protected + function ConvertFunc(const Source: string; const AFormatObject: TdxHFFunctionFormatObject): string; override; + public + constructor Create; override; + class function GetName: string; override; + end; + + TdxHFPageOfPagesFunction = class(TdxHFPagesFunctions) + protected + function ConvertFunc(const Source: string; const AFormatObject: TdxHFFunctionFormatObject): string; override; + public + constructor Create; override; + class function GetName: string; override; + end; + + TdxHFAuthenticationFunctions = class(TdxHFCustomFunction) + public + class function GetCategory: TdxHFFunctionCustomCategoryClass; override; + end; + + TdxHFMachineNameFunction = class(TdxHFAuthenticationFunctions) + protected + function ConvertFunc(const Source: string; const AFormatObject: TdxHFFunctionFormatObject): string; override; + public + constructor Create; override; + class function GetName: string; override; + end; + + TdxHFUserNameFunction = class(TdxHFAuthenticationFunctions) + protected + function ConvertFunc(const Source: string; const AFormatObject: TdxHFFunctionFormatObject): string; override; + public + constructor Create; override; + class function GetName: string; override; + end; + + TdxHFDateTimeFunctions = class(TdxHFCustomFunction) + public + class function GetCategory: TdxHFFunctionCustomCategoryClass; override; + end; + + TdxHFDateTimeFunction = class(TdxHFDateTimeFunctions) + protected + function ConvertFunc(const Source: string; const AFormatObject: TdxHFFunctionFormatObject): string; override; + public + constructor Create; override; + class function GetName: string; override; + end; + + TdxHFDateFunction = class(TdxHFDateTimeFunctions) + protected + function ConvertFunc(const Source: string; const AFormatObject: TdxHFFunctionFormatObject): string; override; + public + constructor Create; override; + class function GetName: string; override; + end; + + TdxHFTimeFunction = class(TdxHFDateTimeFunctions) + protected + function ConvertFunc(const Source: string; const AFormatObject: TdxHFFunctionFormatObject): string; override; + public + constructor Create; override; + class function GetName: string; override; + end; + + { TdxHFFunctionLibrary } + + TdxHFFunctionLibrary = class; + + TdxHFFunctionEnumProc = procedure(Sender: TdxHFFunctionLibrary; const AHFFunction: TdxHFCustomFunction) of object; + + TdxHFFunctionLibraryClass = class of TdxHFFunctionLibrary; + + TdxHFFunctionLibrary = class(TPersistent) + private + FItems: TStringList; + function GetCount: Integer; + function GetFunction(Index: Integer): TdxHFCustomFunction; + function GetFunctionByClass(FunctionClass: TdxHFCustomFunctionClass): TdxHFCustomFunction; + procedure SetFunction(Index: Integer; Value: TdxHFCustomFunction); + procedure SetFunctionByClass(FunctionClass: TdxHFCustomFunctionClass; Value: TdxHFCustomFunction); + procedure FreeAndNilItems; + public + constructor Create; virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + function Add(AFunctionClass: TdxHFCustomFunctionClass): TdxHFCustomFunction; + procedure Clear; + procedure Delete(AnIndex: Integer); + procedure Enumerate(AProc: TdxHFFunctionEnumProc); virtual; + procedure GetFunctions(AStrings: TStrings); + procedure GetFunctionsByCategory(ACategory: TdxHFFunctionCustomCategoryClass; AStrings: TStrings); + function IndexOf(const ATemplateString: string): Integer; + function IndexOfByName(const AFunctionName: string): Integer; + function IndexOfByClass(AFunctionClass: TdxHFCustomFunctionClass): Integer; + function ProcessString(const Source: string; const AFormatObject: TdxHFFunctionFormatObject): string; virtual; + + property Count: Integer read GetCount; + property Funcs[Index: Integer]: TdxHFCustomFunction read GetFunction write SetFunction; default; + property FuncsByClass[FunctionClass: TdxHFCustomFunctionClass]: TdxHFCustomFunction read GetFunctionByClass write SetFunctionByClass; + end; + + TdxStandardHFFunctionLibrary = class(TdxHFFunctionLibrary) + protected + procedure AddStandardFuncitons; virtual; + public + constructor Create; override; + end; + +function dxProcessHFString(const Source: string): string; +procedure dxGetHFFunctionsList(AStrings: TStrings); +procedure dxGetHFFunctionsListByCategory(ACategory: TdxHFFunctionCustomCategoryClass; AStrings: TStrings); + +type + TdxGetDateTimeFormatsProc = procedure(AStrings: TStrings); + TdxGetAutoHFTextEntriesProc = procedure(AStrings: TStrings); + +var + dxGetDateFormatsProc: TdxGetDateTimeFormatsProc = nil; + dxGetTimeFormatsProc: TdxGetDateTimeFormatsProc = nil; + dxGetAutoHFTextEntriesProc: TdxGetAutoHFTextEntriesProc = nil; + +function DateFormats: TStrings; +function PageNumberFormats: TStrings; +function TimeFormats: TStrings; +procedure RefreshDateFormats; +procedure RefreshTimeFormats; +function GetFormatedDate(const ADateTime: TDateTime; const AFormat: string): string; +procedure GetFormatedDateStrings(const ADateTime: TDateTime; ADateFormats, AFormatedStrings: TStrings); +function GetFormatedTime(const ADateTime: TDateTime; const AFormat: string): string; +procedure GetFormatedTimeStrings(const ADateTime: TDateTime; ATimeFormats, AFormatedStrings: TStrings); +function DefaultAutoHFTextEntries: TStrings; + +{ Registration routines } +procedure dxPSRegisterPrintStyle(AStyleClass: TdxPrintStyleClass; AMakeAsDefault: Boolean = False); +procedure dxPSUnregisterPrintStyle(AStyleClass: TdxPrintStyleClass); +procedure dxPSGetRegisteredPrintStylesList(AStrings: TStrings); + +{ Utility routines } +procedure dxPSDrawStyleItem(AStyle: TBasedxPrintStyle; AListBox: TListBox; + Index: Integer; State: TOwnerDrawState; ABounds: TRect; AMultiline, ABoldedCurrent: Boolean); +procedure dxPSDefaultDrawPagePreview(APrintStyle: TBasedxPrintStyle; ACanvas: TCanvas; + APageBounds, AContentBounds, AHeaderBounds, AFooterBounds: TRect); +function dxPSPrintStyleUniqueName(AStyleController: TdxPrintStyleManager; AComponent: TComponent): string; +procedure dxPSSplitAutoHFTextEntry(Source: string; var APart1, APart2, APart3: string); + +function dxPageSetupDialog(var APageSetupDlgData: TdxPageSetupDlgData): Boolean; + +const + dxMaxStyleCaption = 31; + dxFunctionDelimiters: array[Boolean] of Char = ('[', ']'); + dxHFFunctionSeparator = ','; + dxHFFunctionLibrary: TdxHFFunctionLibrary = nil; + dxHFFormatObject: TdxHFFunctionFormatObject = nil; + dxDefaultPrintStyleClass: TdxPrintStyleClass = nil; + +implementation + +{$R *.DFM} + +uses + TypInfo, CommCtrl, Consts, dxPSImgs, dxPSEngn, dxPSEvnt, dxfmMnPg, dxfmDfnStl, + dxPSUtl, dxPSRes, dxPSAutoHFTextMnuBld, dxPSfmAutoHFTextFmt, dxPSHFToolBarBld, + dxBase; + +const + FDefaultAutoHFTextEntries: TStrings = nil; + FStyleClassList: TdxPersistentClassList = nil; + FDateFormats: TStrings = nil; + FPageNumberFormats: TStrings = nil; + FTimeFormats: TStrings = nil; + + sdxAutoHFTextEntries = '\AutoHFTextEntries'; // Don't localize + sdxCantCreateUniqueName = 'Can''t create unique name for %s.'; // Don't localize + sdxStyleNameTemplate = 'Style%d'; // Don't localize + +function dxPageSetupDialog(var APageSetupDlgData: TdxPageSetupDlgData): Boolean; +var + Dialog: TdxfmPageSetupDialog; +begin + Result := False; + if APageSetupDlgData.PrintStyle = nil then Exit; + + Dialog := TdxfmPageSetupDialog.Create(nil); + try + Dialog.SetupDialog(APageSetupDlgData); + Result := Dialog.Execute; + if Result then + begin + if Dialog.Modified then + APageSetupDlgData.PrintStyle.Assign(Dialog.FPrintStyle); + if Dialog.PreviewBtnClicked or Dialog.PrintBtnClicked then + APageSetupDlgData.PrintStyle.IsCurrentStyle := True; + end; + APageSetupDlgData.ActivePageIndex := Dialog.pgctrlMain.ActivePage.PageIndex; + APageSetupDlgData.PreviewBtnClicked := Dialog.PreviewBtnClicked; + APageSetupDlgData.PrintBtnClicked := Dialog.PrintBtnClicked; + finally + Dialog.Free; + end; +end; + +{ PrintStyle Registration Routines } + +procedure dxPSRegisterPrintStyle(AStyleClass: TdxPrintStyleClass; + AMakeAsDefault: Boolean = False); +begin + if FStyleClassList = nil then + FStyleClassList := TdxPersistentClassList.Create; + FStyleClassList.Register(AStyleClass); + if AMakeAsDefault then + dxDefaultPrintStyleClass := AStyleClass; +end; + +procedure dxPSUnregisterPrintStyle(AStyleClass: TdxPrintStyleClass); +begin + if FStyleClassList <> nil then + FStyleClassList.Unregister(AStyleClass); +end; + +procedure dxPSUnregisterAllPrintStyles; +begin + FreeAndNil(FStyleClassList); +end; + +procedure dxPSGetRegisteredPrintStylesList(AStrings: TStrings); +var + I: Integer; + StyleClass: TPersistentClass; +begin + if FStyleClassList <> nil then + begin + AStrings.BeginUpdate; + try + for I := 0 to FStyleClassList.Count - 1 do + begin + StyleClass := FStyleClassList[I]; + AStrings.AddObject(StyleClass.ClassName, TObject(StyleClass)); + end; + finally + AStrings.EndUpdate; + end; + end; +end; + +{ utility routines } + +procedure PlaceBevel(ABevel: TBevel; AControl: TControl); +var + RightBound: Integer; +begin + RightBound := ABevel.BoundsRect.Right; + ABevel.Left := AControl.Left + AControl.Width + 10; + ABevel.Width := RightBound - ABevel.Left; +end; + +function MarginsMessageDlg(const Message: string): TModalResult; +var + Form: TForm; + B: TComponent; +begin + Form := CreateMessageDialog(Message, mtWarning, mbYesNoCancel); + try + B := Form.FindComponent('Yes'); + if B is TButton then + with TButton(B) do + begin + Form.Width := Form.Width + 3 * Width div 2; + Width := 3 * Width div 2; + Caption := cxGetResourceString(@sdxBtnFix); + end; + + B := Form.FindComponent('No'); + if B is TButton then + with TButton(B) do + begin + Left := Left + Width div 2; + Width := 3 * Width div 2; + Caption := cxGetResourceString(@sdxBtnRestoreOriginal); + end; + + B := Form.FindComponent('Cancel'); + if B is TButton then + with TButton(B) do + begin + Left := Left + Width; + Width := 3 * Width div 2; + Caption := cxGetResourceString(@sdxBtnClose); + end; + Result := Form.ShowModal; + finally + Form.Free; + end; +end; + +function MarginsOutsideMessageDlg(const Message: string): TModalResult; +var + Form: TForm; + B: TComponent; +begin + Form := CreateMessageDialog(Message, mtWarning, [mbYes, mbIgnore]); + try + B := Form.FindComponent('Yes'); + if B is TButton then + TButton(B).Caption := cxGetResourceString(@sdxBtnFix); + Result := Form.ShowModal; + finally + Form.Free; + end; +end; + +procedure dxPSDrawStyleItem(AStyle: TBasedxPrintStyle; AListBox: TListBox; + Index: Integer; State: TOwnerDrawState; ABounds: TRect; + AMultiline, ABoldedCurrent: Boolean); + + function GetColor: TColor; + begin + if odSelected in State then + Result := clHighlight + else + Result := clWindow; + end; + +const + uFormat: array[Boolean] of UINT = (DT_LEFT or DT_WORDBREAK, DT_LEFT or DT_SINGLELINE or DT_VCENTER); +var + B: TBitmap; + S: string; + R: TRect; + AreImagesDrawn: Boolean; +begin + with AListBox do + begin + AreImagesDrawn := (AStyle.StyleManager <> nil) and + (AStyle.StyleManager.Images <> nil) and (AStyle.ImageIndex > -1) and + (AStyle.ImageIndex < AStyle.StyleManager.Images.Count); + + B := nil; + if AreImagesDrawn then B := TBitmap.Create; + try + if AreImagesDrawn then + begin + B.Width := AStyle.StyleManager.Images.Width; + B.Height := AStyle.StyleManager.Images.Height; + R := MakeRect(0, 0, B.Width, B.Height); + B.Canvas.FillRect(R); + AStyle.StyleManager.Images.Draw(B.Canvas, 0, 0, AStyle.ImageIndex); + + OffsetRect(R, ABounds.Left + (dxStyleGlyphSize.X - B.Width) div 2, + ABounds.Top + (dxStyleGlyphSize.Y - B.Height) div 2); + end + else + if not AStyle.StyleGlyph.Empty then + begin + R := MakeBounds(ABounds.Left + 1, ABounds.Top + 1, dxStyleGlyphSize.X, dxStyleGlyphSize.Y); + B := AStyle.StyleGlyph; + end; + + if AreImagesDrawn or not AStyle.StyleGlyph.Empty then + begin + B.Transparent := True; + Canvas.Brush.Color := GetColor; + Canvas.BrushCopy(R, B, MakeRect(0, 0, B.Width, B.Height), clFuchsia); + with R do + ExcludeClipRect(Canvas.Handle, Left, Top, Right, Bottom); + end; + finally + if AreImagesDrawn then B.Free; + end; + + Canvas.FillRect(ABounds); + Inc(ABounds.Left, dxStyleGlyphSize.X + 4); + + Canvas.Brush.Style := bsClear; + if ABoldedCurrent and AStyle.IsCurrentStyle then + Canvas.Font.Style := Canvas.Font.Style + [fsBold]; + + S := Items[Index]; + if AMultiline then + begin + R := ABounds; + DrawText(Canvas.Handle, PChar(S), Length(S), ABounds, DT_LEFT or DT_SINGLELINE or DT_CALCRECT); + DrawText(Canvas.Handle, PChar(S), Length(S), R, uFormat[(ABounds.Right - ABounds.Left) <= (R.Right - R.Left)]); + end + else + DrawText(Canvas.Handle, PChar(S), Length(S), ABounds, uFormat[True]); + + if ABoldedCurrent and AStyle.IsCurrentStyle then + Canvas.Font.Style := Canvas.Font.Style - [fsBold]; + Canvas.Brush.Style := bsSolid; + end; +end; + +procedure dxPSDefaultDrawPagePreview(APrintStyle: TBasedxPrintStyle; ACanvas: TCanvas; + APageBounds, AContentBounds, AHeaderBounds, AFooterBounds: TRect); +const + LineStepX = 15; + LineStepY = 7; +var + R, LineBounds: TRect; + LineCountX, LineCountY, I: Integer; +begin + R := AContentBounds; + with R do + begin + LineCountX := (Right - Left - 1) div LineStepX; + LineCountY := (Bottom - Top - 1) div LineStepY; + Right := Left + LineCountX * LineStepX; + Bottom := Top + LineCountY * LineStepY; + + if APrintStyle.PrinterPage.CenterOnPageH then + OffsetRect(R, ((AContentBounds.Right - AContentBounds.Left) - (Right - Left)) div 2, 0); + if APrintStyle.PrinterPage.CenterOnPageV then + OffsetRect(R, 0, ((AContentBounds.Bottom - AContentBounds.Top) - (Bottom - Top)) div 2); + end; + + ACanvas.Brush.Color := clBtnFace; + + {vert lines} + for I := 0 to LineCountX do + begin + LineBounds := MakeRect(R.Left + I * LineStepX, R.Top, R.Left + I * LineStepX + 1, R.Bottom); + if RectVisible(ACanvas.Handle, LineBounds) then + ACanvas.FillRect(LineBounds); + end; + + {horz lines} + for I := 0 to LineCountY do + begin + LineBounds := MakeRect(R.Left, R.Top + I * LineStepY, R.Right + 1, R.Top + I * LineStepY + 1); + if RectVisible(ACanvas.Handle, LineBounds) then + ACanvas.FillRect(LineBounds); + end; +end; + +function dxPSPrintStyleUniqueName(AStyleController: TdxPrintStyleManager; AComponent: TComponent): string; +var + S: string; + I, J: Integer; + NameExists: Boolean; + Item: TBasedxPrintStyle; +begin + S := AStyleController.Name + sdxStyleNameTemplate; + for I := 1 to High(Integer) do + begin + Result := Format(S, [I]); + NameExists := False; + Item := AStyleController.StyleByName(Result); + if Item = nil then + begin + with AStyleController.Owner do + for J := 0 to ComponentCount - 1 do + if dxSameText(Components[J].Name, Result) then + begin + NameExists := True; + Break; + end; + if not NameExists then Exit; + end; + end; + if AStyleController.IsDesigning then + raise Exception.CreateFmt(sdxCantCreateUniqueName, [AComponent.ClassName]) + else + Result := ''; +end; + +procedure dxPSSplitAutoHFTextEntry(Source: string; var APart1, APart2, APart3: string); + + function DoExtract(var Source: string): string; + var + P: Integer; + begin + P := Pos(dxHFFunctionSeparator, Source); + if P = 0 then + begin + Result := Source; + P := Length(Source); + end + else + Result := Copy(Source, 1, P - 1); + + Delete(Source, 1, P); + Result := Trim(Result); + end; + +begin + APart1 := ''; + APart2 := ''; + APart3 := ''; + APart1 := DoExtract(Source); + if Source <> '' then APart2 := DoExtract(Source); + if Source <> '' then APart3 := DoExtract(Source); +end; + +{ TdxPageSetupDialog } + +constructor TdxPageSetupDialog.Create(AOwner: TComponent); +begin + inherited; + FButtonsEnabled := psbDefault; + FOptionsEnabled := psoDefaultOptionsEnabled; + FHFMode := hfmThreeSections; + FButtonsVisible := psbDefault; + FOptionsVisible := psoDefaultOptionsVisible; +end; + +procedure TdxPageSetupDialog.Assign(Source: TPersistent); +begin + if Source is TdxPageSetupDialog then + with TdxPageSetupDialog(Source) do + begin + Self.ActivePageIndex := ActivePageIndex; + Self.ButtonsEnabled := ButtonsEnabled; + Self.OptionsEnabled := OptionsEnabled; + Self.HFMode := HFMode; + Self.Title := Title; + Self.ButtonsVisible := ButtonsVisible; + Self.OptionsVisible := OptionsVisible; + + Self.FIsTitleAssigned := FIsTitleAssigned; + end + else + inherited; +end; + +function TdxPageSetupDialog.DefaultTitle: string; +begin + Result := cxGetResourceString(@sdxPageSetupCaption); +end; + +procedure TdxPageSetupDialog.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('IsTitleAssigned', ReadIsTitleAssigned, WriteIsTitleAssigned, + FIsTitleAssigned and (Title = '')); +end; + +procedure TdxPageSetupDialog.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if (AComponent = PrintStyle) and (Operation = opRemove) then + PrintStyle := nil; +end; + +function TdxPageSetupDialog.Execute: Boolean; +var + APageSetupDlgData: TdxPageSetupDlgData; + APageSetupDlgEvents: TdxPageSetupDlgEvents; +begin + if PrintStyle = nil then + begin + Result := False; + Exit; + end; + FillChar(APageSetupDlgData, SizeOf(TdxPageSetupDlgData), 0); + FillChar(APageSetupDlgEvents, SizeOf(TdxPageSetupDlgEvents), 0); + with APageSetupDlgEvents do + begin + OnClose := Self.OnClose; + OnCustomDrawPreview := Self.OnCustomDrawPreview; + OnShow := Self.OnShow; + end; + APageSetupDlgData.Events := APageSetupDlgEvents; + APageSetupDlgData.PrintStyle := Self.PrintStyle; + APageSetupDlgData.HelpContext := Self.HelpContext; + APageSetupDlgData.Title := Self.RealTitle; + APageSetupDlgData.ActivePageIndex := ActivePageIndex; + +{ + if (csDesigning in ComponentState) then + begin + APageSetupDlgData.ButtonsEnabled := psbDefault; + APageSetupDlgData.ButtonsVisible := psbDefault; + APageSetupDlgData.OptionsEnabled := psoDefaultOptionsEnabled; + APageSetupDlgData.OptionsVisible := psoDefaultOptionsVisible; + end + else +} + begin + APageSetupDlgData.ButtonsEnabled := ButtonsEnabled; + APageSetupDlgData.ButtonsVisible := ButtonsVisible; + //if not PrintStyle.OptionsDialogExists then + // APageSetupDlgData.ButtonsVisible := APageSetupDlgData.ButtonsVisible - [psbStyleOptions]; + APageSetupDlgData.OptionsEnabled := OptionsEnabled; + APageSetupDlgData.OptionsVisible := OptionsVisible; + end; + APageSetupDlgData.HFMode := HFMode; + + Result := dxPageSetupDialog(APageSetupDlgData); + FPreviewBtnClicked := APageSetupDlgData.PreviewBtnClicked; + FPrintBtnClicked := APageSetupDlgData.PrintBtnClicked; +end; + +function TdxPageSetupDialog.RealTitle: string; +begin + Result := Title; + if PrintStyle.StyleManager <> nil then + begin + if PrintStyle <> nil then + Result := Result + ': ' + PrintStyle.StyleCaption; + if Result[Length(Result) - 1] = ':' then + Delete(Result, Length(Result) - 1, 1); + end; +end; + +procedure TdxPageSetupDialog.RestoreDefaults; +begin + FIsTitleAssigned := False; + ActivePageIndex := 0; + FButtonsEnabled := psbDefault; + FOptionsEnabled := psoDefaultOptionsEnabled; + FHFMode := hfmThreeSections; + FButtonsVisible := psbDefault; + FOptionsVisible := psoDefaultOptionsVisible; +end; + +function TdxPageSetupDialog.GetTitle: string; +begin + if FIsTitleAssigned then + Result := FTitle + else + Result := DefaultTitle; +end; + +function TdxPageSetupDialog.IsTitleStored: Boolean; +begin + Result := FisTitleAssigned and (Title <> DefaultTitle); +end; + +procedure TdxPageSetupDialog.SetPrintStyle(Value: TBasedxPrintStyle); +begin + if FPrintStyle <> Value then + begin + FPrintStyle := Value; + if Value <> nil then Value.FreeNotification(Self); + end; +end; + +procedure TdxPageSetupDialog.SetTitle(const Value: string); +begin + if Title <> Value then + begin + FTitle := Value; + FIsTitleAssigned := True; + end; +end; + +procedure TdxPageSetupDialog.ReadIsTitleAssigned(Reader: TReader); +begin + FIsTitleAssigned := Reader.ReadBoolean; +end; + +procedure TdxPageSetupDialog.WriteIsTitleAssigned(Writer: TWriter); +begin + Writer.WriteBoolean(FIsTitleAssigned); +end; + +{ TdxfmPageSetupDialog } + +constructor TdxfmPageSetupDialog.Create(AOwner: TComponent); + + function CreateGlyph(AWidth, AHeight: Integer): TBitmap; + begin + Result := TBitmap.Create; + Result.Height := AHeight; + Result.Width := AWidth; + end; + +const + cGlyphWidth = 75 + 4 + 16; { TextArea width + Separator width + DownArrow width} +begin + inherited; + FBmpArrow := dxPSUtl.CreateArrowBitmap(udgDown); + FFooterBkGndGlyph := CreateGlyph(cGlyphWidth, btnFooterBackGround.Height - 10); + FHeaderBkGndGlyph := CreateGlyph(cGlyphWidth, btnHeaderBackGround.Height - 10); + + FHFFunctionList := TStringList.Create; + dxGetHFFunctionsList(FHFFunctionList); + + HelpContext := dxPSGlbl.dxhcPageSetupDlg; + + FPreviewBtnClicked := False; + FPrintBtnClicked := False; + + CreateControls; + LoadStrings; +end; + +destructor TdxfmPageSetupDialog.Destroy; +begin + FreeAndNil(FHFFunctionList); + FreeAndNil(FFooterBkGndGlyph); + FreeAndNil(FHeaderBkGndGlyph); + FreeAndNil(FBmpArrow); + FreeAndNil(FPrintStyle); + inherited; +end; + +function TdxfmPageSetupDialog.Execute: Boolean; +begin + Result := False; + if PrintStyle = nil then Exit; + StartSetting; + Result := ShowModal = mrOk;// and FModified; +end; + +procedure TdxfmPageSetupDialog.SetPrintStyle(Value: TBasedxPrintStyle); +begin + if FPrintStyle <> nil then + begin + FPrintStyle.Free; + FPrintStyle := nil; + end; + if Value <> nil then + begin + FSavePrintStyle := Value; + FPrintStyle := Value.StyleClass.Create(nil); + FPrintStyle.Assign(Value); +// MarginsOutside := not ValidateMarginsOutside(nil); + end; +end; + +procedure TdxfmPageSetupDialog.CreateWnd; +begin + inherited; + if Icon.Handle = 0 then + Icon_LoadFromResourceName(Icon, IDB_DXPSPAGESETUP); + SendMessage(Handle, WM_SETICON, 1, Icon.Handle); +end; + +procedure TdxfmPageSetupDialog.DoHide; +begin + if Assigned(FOnClose) then FOnClose(Self); + inherited; +end; + +procedure TdxfmPageSetupDialog.DoShow; +begin + inherited; + if Assigned(FOnShow) then FOnShow(Self); +end; + +function TdxfmPageSetupDialog.GetEditColor(Value: Boolean): TColor; +begin + if Value then + Result := clBtnFace + else + Result := clWindow; +end; + +procedure TdxfmPageSetupDialog.SetupDialog(const APageSetupDlgData: TdxPageSetupDlgData); +var + I, Denominator: Integer; + AutoHFTextEntries: TStrings; + Control: TControl; + LegendText: string; +begin + FControlsUpdating := True; + + // it is very important because property TabVisible doesn't work properly without this line + pgctrlMain.HandleNeeded; + + SetPrintStyle(APageSetupDlgData.PrintStyle); + FStyleManager := FSavePrintStyle.StyleManager; + + Caption := APageSetupDlgData.Title; + if APageSetupDlgData.HelpContext <> 0 then + HelpContext := APageSetupDlgData.HelpContext; + + FOnShow := APageSetupDlgData.Events.OnShow; + FOnClose := APageSetupDlgData.Events.OnClose; + OnCustomDrawPreview := APageSetupDlgData.Events.OnCustomDrawPreview; + + btnOptions.Enabled := psbStyleOptions in APageSetupDlgData.ButtonsEnabled; + btnPrintPreview.Enabled := psbPreview in APageSetupDlgData.ButtonsEnabled; + btnPrint.Enabled := psbPrint in APageSetupDlgData.ButtonsEnabled; + btnOptions.Visible := psbStyleOptions in APageSetupDlgData.ButtonsVisible; + btnPrintPreview.Visible := psbPreview in APageSetupDlgData.ButtonsVisible; + btnPrint.Visible := psbPrint in APageSetupDlgData.ButtonsVisible; + if not btnPrint.Visible and btnPrintPreview.Visible then + btnPrintPreview.BoundsRect := btnPrint.BoundsRect; + + pnlStyleName.Visible := psoStyleCaption in APageSetupDlgData.OptionsVisible; + if not pnlStyleName.Visible then + Self.Height := Self.Height - pnlStyleName.Height; + + rBtnPortrait.Checked := PrintStyle.PrinterPage.Orientation = poPortrait; + rBtnLandscape.Checked := PrintStyle.PrinterPage.Orientation = poLandscape; + + gbxPrintOrder.Visible := psoPageOrder in APageSetupDlgData.OptionsVisible; + gbxShading.Visible := psoShading in APageSetupDlgData.OptionsVisible; + + gbxMargins.Visible := psoMargins in APageSetupDlgData.OptionsVisible; + if psoMargins in APageSetupDlgData.OptionsVisible then + FPreview.OptionsView := FPreview.OptionsView + [povMargins] + else + FPreview.OptionsView := FPreview.OptionsView - [povMargins]; + + pnlHFMargins.Visible := gbxMargins.Visible and (psoHFMargins in APageSetupDlgData.OptionsVisible); + if povMargins in FPreview.OptionsView then + begin + FPreview.Margins.Header.Visible := pnlHFMargins.Visible; + FPreview.Margins.Footer.Visible := pnlHFMargins.Visible; + end; + if not pnlHFMargins.Visible and gbxMargins.Visible then + gbxMargins.Height := gbxMargins.Height - pnlHFMargins.Height; + + pnlCenterOnPage.Visible := psoCenterOnPage in APageSetupDlgData.OptionsVisible; + tshMargins.TabVisible := gbxMargins.Visible or pnlCenterOnPage.Visible; + + btnHeaderFont.Visible := psoHFFont in APageSetupDlgData.OptionsVisible; + edHeaderFontInfo.Visible := psoHFFont in APageSetupDlgData.OptionsVisible; + btnHeaderBackground.Visible := psoHFBackground in APageSetupDlgData.OptionsVisible; + if btnHeaderBackground.Visible and not btnHeaderFont.Visible then + begin + btnHeaderBackground.Left := btnHeaderFont.Left; + btnHeaderBackground.Top := btnHeaderFont.Top; + end; + pnlHeaderFont.Visible := btnHeaderFont.Visible or btnHeaderBackGround.Visible; + pnlHeaderMemos.Visible := (psoHFText in APageSetupDlgData.OptionsVisible); + if not pnlHeaderMemos.Visible then + pnlHeader.Height := pnlHeader.Height - pnlHeaderMemos.Height; + if pnlHeaderMemos.Visible and (APageSetupDlgData.HFMode = hfmOneSection) then + begin + memHeaderCenter.Visible := False; + memHeaderRight.Visible := False; + end; + pnlHeader.Visible := pnlHeaderFont.Visible or pnlHeaderMemos.Visible; + + btnFooterFont.Visible := (psoHFFont in APageSetupDlgData.OptionsVisible); + edFooterFontInfo.Visible := (psoHFFont in APageSetupDlgData.OptionsVisible); + btnFooterBackground.Visible := (psoHFBackground in APageSetupDlgData.OptionsVisible); + if btnFooterBackground.Visible and not btnFooterFont.Visible then + begin + btnFooterBackground.Left := btnFooterFont.Left; + btnFooterBackground.Top := btnFooterFont.Top; + end; + + pnlFooterFont.Visible := btnHeaderFont.Visible or btnHeaderBackGround.Visible; + + pnlFooterMemos.Visible := (psoHFText in APageSetupDlgData.OptionsVisible); + if not pnlFooterMemos.Visible then + pnlFooter.Height := pnlFooter.Height - pnlFooterMemos.Height; + + if pnlFooterMemos.Visible and (APageSetupDlgData.HFMode = hfmOneSection) then + begin + memFooterCenter.Visible := False; + memFooterRight.Visible := False; + end; + pnlFooter.Visible := pnlFooterFont.Visible or pnlFooterMemos.Visible; + + pnlToolBar.Visible := (psoHFFunctions in APageSetupDlgData.OptionsVisible); +// pnlAutoText.Visible := (psoHFAutoText in APageSetupDlgData.OptionsVisible); + gbxFunctions.Visible := pnlToolBar.Visible; // or pnlAutoText.Visible; + pnlVertAlignment.Visible := (psoHFVertAlignment in APageSetupDlgData.OptionsVisible); + pnlHFOpt.Visible := gbxFunctions.Visible or pnlVertAlignment.Visible; + pnlReverse.Visible := (psoHFReverse in APageSetupDlgData.OptionsVisible); + + tshHeaderFooter.TabVisible := + pnlHeader.Visible or pnlFooter.Visible or pnlHFOpt.Visible or pnlReverse.Visible; + tshScaling.TabVisible := PrintStyle.AllowChangeScale; + + if pnlStyleName.Visible then + begin + pnlStyleName.Enabled := + not FSavePrintStyle.BuiltIn; // or (csDesigning in FSavePrintStyle.ComponentState); + edStyleName.ReadOnly := not pnlStyleName.Enabled; + edStyleName.TabStop := not edStyleName.ReadOnly; + edStyleName.Color := GetEditColor(edStyleName.ReadOnly); + edStyleName.MaxLength := dxMaxStyleCaption; + end; + + lbxPaperType.Enabled := PrintStyle.AllowChangePaper; + lbxPaperType.Color := GetEditColor(not lbxPaperType.Enabled); + + rBtnPortrait.Enabled := PrintStyle.AllowChangeOrientation; + rBtnLandscape.Enabled := PrintStyle.AllowChangeOrientation; + + if gbxPrintOrder.Visible then + begin + gbxPrintOrder.Enabled := (psoPageOrder in APageSetupDlgData.OptionsEnabled); + rbtnDownThenOver.Enabled := gbxPrintOrder.Enabled; + rbtnOverThenDown.Enabled := gbxPrintOrder.Enabled; + end; + if gbxShading.Visible then + begin + gbxShading.Enabled := (psoShading in APageSetupDlgData.OptionsEnabled); + chbxShading.Enabled := gbxShading.Enabled; + end; + + if gbxMargins.Visible then + begin + gbxMargins.Enabled := + PrintStyle.AllowChangeMargins and (psoMargins in APageSetupDlgData.OptionsEnabled); + + for I := 0 to pnlMargins.ControlCount - 1 do + begin + Control := pnlMargins.Controls[I]; + + if Control is TLabel then + Control.Enabled := gbxMargins.Enabled; + + if Control is TdxPSSpinEdit then + with TdxPSSpinEdit(Control) do + begin + ReadOnly := not gbxMargins.Enabled; + TabStop := not ReadOnly; + Color := GetEditColor(ReadOnly); + end; + end; + end; + + if gbxMargins.Enabled then + FPreview.OptionsBehavior := FPreview.OptionsBehavior + [pobAllowDragMargins] + else + FPreview.OptionsBehavior := FPreview.OptionsBehavior - [pobAllowDragMargins]; + + if pnlHFMargins.Visible then + begin + pnlHFMargins.Enabled := + gbxMargins.Enabled and (psoHFMargins in APageSetupDlgData.OptionsEnabled); + + for I := 0 to pnlHFMargins.ControlCount - 1 do + begin + Control := pnlHFMargins.Controls[I]; + + if Control is TLabel then + Control.Enabled := pnlHFMargins.Enabled; + + if Control is TdxPSSpinEdit then + with TdxPSSpinEdit(Control) do + begin + ReadOnly := not pnlHFMargins.Enabled; + TabStop := not ReadOnly; + Color := GetEditColor(ReadOnly); + end; + end; + end; + FPreview.Margins.Header.Enabled := pnlHFMargins.Enabled; + FPreview.Margins.Footer.Enabled := pnlHFMargins.Enabled; + + if pnlCenterOnPage.Visible then + begin + pnlCenterOnPage.Enabled := psoCenterOnPage in APageSetupDlgData.OptionsEnabled; + for I := 0 to pnlCenterOnPage.ControlCount - 1 do + pnlCenterOnPage.Controls[I].Enabled := pnlCenterOnPage.Enabled; + end; + + if btnHeaderFont.Visible then + btnHeaderFont.Enabled := (psoHFFont in APageSetupDlgData.OptionsEnabled); + if btnHeaderBackground.Visible then + btnHeaderBackground.Enabled := (psoHFBackground in APageSetupDlgData.OptionsEnabled); + + if pnlHeaderMemos.Visible then + begin + pnlHeaderMemos.Enabled := + PrintStyle.AllowChangeHFText and (psoHFText in APageSetupDlgData.OptionsEnabled); + memHeaderLeft.ReadOnly := not pnlHeaderMemos.Enabled; + memHeaderLeft.TabStop := not memHeaderLeft.ReadOnly; + memHeaderLeft.Color := GetEditColor(memHeaderLeft.ReadOnly); + memHeaderCenter.ReadOnly := not pnlHeaderMemos.Enabled; + memHeaderCenter.TabStop := not memHeaderCenter.ReadOnly; + memHeaderCenter.Color := GetEditColor(memHeaderCenter.ReadOnly); + memHeaderRight.ReadOnly := not pnlHeaderMemos.Enabled; + memHeaderRight.TabStop := not memHeaderRight.ReadOnly; + memHeaderRight.Color := GetEditColor(memHeaderRight.ReadOnly); + end; + + if btnFooterFont.Visible then + btnFooterFont.Enabled := (psoHFFont in APageSetupDlgData.OptionsEnabled); + if btnFooterBackground.Visible then + btnFooterBackground.Enabled := (psoHFBackground in APageSetupDlgData.OptionsEnabled); + if pnlFooterMemos.Visible then + begin + pnlFooterMemos.Enabled := PrintStyle.AllowChangeHFText and (psoHFText in APageSetupDlgData.OptionsEnabled); + memFooterLeft.ReadOnly := not pnlFooterMemos.Enabled; + memFooterLeft.TabStop := not memFooterLeft.ReadOnly; + memFooterLeft.Color := GetEditColor(memFooterLeft.ReadOnly); + memFooterCenter.ReadOnly := not pnlFooterMemos.Enabled; + memFooterCenter.TabStop := not memFooterCenter.ReadOnly; + memFooterCenter.Color := GetEditColor(memFooterCenter.ReadOnly); + memFooterRight.ReadOnly := not pnlFooterMemos.Enabled; + memFooterRight.TabStop := not memFooterRight.ReadOnly; + memFooterRight.Color := GetEditColor(memFooterRight.ReadOnly); + end; + + if pnlToolBar.Visible then + begin + FilPredefined := TImageList.Create(Self); + FilPredefined.AllocBy := FHFFunctionList.Count; + pnlToolBar.Enabled := psoHFFunctions in APageSetupDlgData.OptionsEnabled; + + if FStyleManager <> nil then + AutoHFTextEntries := FStyleManager.AutoHFTextEntries + else + AutoHFTextEntries := nil; + + TdxPSHFToolBarBuilder.Build(tbPredefined, FilPredefined, + (FStyleManager <> nil) and (psoHFAutoText in APageSetupDlgData.OptionsVisible), + FHFFunctionList, AutoHFTextEntries, SpecialInsertClick, AutoHFTextEntriesClick, True); + end; + + if pnlVertAlignment.Visible then + pnlVertAlignment.Enabled := psoHFVertAlignment in APageSetupDlgData.OptionsEnabled; + + if pnlReverse.Visible then + chbxReverseOnEvenPages.Enabled := psoHFReverse in APageSetupDlgData.OptionsEnabled; + + if tshScaling.TabVisible then + begin + rbtnAdjustTo.Enabled := tshScaling.Enabled; + rbtnFitTo.Enabled := tshScaling.Enabled; + rbtnFitTo.Enabled := tshScaling.Enabled; + lblPercentOfNormalSize.Enabled := tshScaling.Enabled; + lblPagesWideBy.Enabled := tshScaling.Enabled; + lblTall.Enabled := tshScaling.Enabled; + FseFitToPage.Enabled := tshScaling.Enabled; + FseAdjustTo.Enabled := tshScaling.Enabled; + + rbtnAdjustTo.Checked := PrintStyle.PrinterPage.ScaleMode = smAdjust; + rbtnFitTo.Checked := PrintStyle.PrinterPage.ScaleMode = smFit; + TdxPSSpinEdit(FseAdjustTo).AsInteger := PrintStyle.PrinterPage.ScaleFactor; + TdxPSSpinEdit(FseFitToPage).AsInteger := PrintStyle.PrinterPage.FitToPagesByWide; + TdxPSSpinEdit(FseFitToPage).AsInteger := PrintStyle.PrinterPage.FitToPagesByTall; + end; + + case Page.GetInnerMeasurementUnits of + muInches: + begin + Denominator := 254; + LegendText := cxGetResourceString(@sdxUnitsInches); + end; + muMillimeters: + begin + Denominator := 10; + LegendText := cxGetResourceString(@sdxUnitsMillimeters); + end; + else + Denominator := 10; + end; + + if Page.Orientation = poPortrait then + begin + FsePaperWidth.MinValue := dxPrintDevice.MinExtentX / Denominator; + FsePaperWidth.MaxValue := dxPrintDevice.MaxExtentX / Denominator; + FsePaperHeight.MinValue := dxPrintDevice.MinExtentY / Denominator; + FsePaperHeight.MaxValue := dxPrintDevice.MaxExtentY / Denominator; + end + else + begin + FsePaperWidth.MinValue := dxPrintDevice.MinExtentY / Denominator; + FsePaperWidth.MaxValue := dxPrintDevice.MaxExtentY / Denominator; + FsePaperHeight.MinValue := dxPrintDevice.MinExtentX / Denominator; + FsePaperHeight.MaxValue := dxPrintDevice.MaxExtentX / Denominator; + end; + + FsePaperWidth.LegendText := LegendText; + FsePaperHeight.LegendText := LegendText; + FseMarginTop.LegendText := LegendText; + FseMarginLeft.LegendText := LegendText; + FseMarginRight.LegendText := LegendText; + FseMarginBottom.LegendText := LegendText; + FseMarginHeader.LegendText := LegendText; + FseMarginFooter.LegendText := LegendText; + + FsePaperWidth.ReadOnly := not PrintStyle.AllowCustomPaperSizes; + FsePaperWidth.TabStop := not FsePaperWidth.ReadOnly; + FsePaperWidth.Color := GetEditColor(FsePaperWidth.ReadOnly); + + FsePaperHeight.ReadOnly := not PrintStyle.AllowCustomPaperSizes; + FsePaperHeight.TabStop := not FsePaperHeight.ReadOnly; + FsePaperHeight.Color := GetEditColor(FsePaperHeight.ReadOnly); + + with pgctrlMain do + begin + I := APageSetupDlgData.ActivePageIndex; + if I < 0 then I := 0; + if I > PageCount - 1 then I := PageCount - 1; + if not Pages[I].TabVisible then I := 0; + ActivePage := Pages[I]; + end; + + FControlsUpdating := False; + + if pssCopy in FSavePrintStyle.State then CheckModified; +end; + +procedure TdxfmPageSetupDialog.ChangeBkgndGlyph(AGlyph: TBitmap; ABackground: TdxBackground); +var + DC: HDC; + PrevFont: HFONT; + PrevFontColor: COLORREF; + R: TRect; + PrevColor: COLORREF; + S: string; + Brush: HBRUSH; +begin + DC := AGlyph.Canvas.Handle; + PrevFont := SelectObject(DC, Font.Handle); + PrevFontColor := SetTextColor(DC, ColorToRGB(Font.Color)); + + R := MakeRect(0, 0, AGlyph.Width - FBmpArrow.Width - 4, AGlyph.Height); + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + InflateRect(R, -1, -1); + + case ABackground.Mode of + bmNone: + begin + S := DropAmpersand(cxGetResourceString(@sdxBtnNoFill)); + S := '[' + S + ']'; + + FillRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + SetBkMode(DC, Windows.TRANSPARENT); + SetTextColor(DC, ColorToRGB(clHighlight)); + DrawText(DC, PChar(S), Length(S), R, DT_SINGLELINE or DT_CENTER or DT_VCENTER); + end; + + bmBrush: + begin + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNSHADOW)); + InflateRect(R, -1, -1); + + PrevColor := SetBkColor(DC, ColorToRGB(ABackground.BkColor)); + Brush := CreateSolidBrush(ColorToRGB(ABackground.Brush.Color)); + FillRect(DC, R, Brush); + DeleteObject(Brush); + SetBkColor(DC, PrevColor); + end; + + bmBrushBitmap: + begin + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNSHADOW)); + InflateRect(R, -1, -1); + + Brush := CreatePatternBrush(TBitmap(ABackground.Picture).Handle); + FillRect(DC, R, Brush); + DeleteObject(Brush); + end; + + bmPicture: + begin + S := DropAmpersand(cxGetResourceString(@sdxPicture)); + S := '[' + S + ']'; + + FillRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + SetBkMode(DC, Windows.TRANSPARENT); + SetTextColor(DC, ColorToRGB(clHighlight)); + DrawText(DC, PChar(S), Length(S), R, DT_SINGLELINE or DT_CENTER or DT_VCENTER); + end; + end; + + R := MakeBounds(AGlyph.Width - FBmpArrow.Width, 0, FBmpArrow.Width, AGlyph.Height); + FillRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + // Down arrow + AGlyph.Canvas.Draw(R.Left + 4, R.Top, FBmpArrow); + // Separator vertical lines + R.Left := R.Left - 4; + R.Right := R.Left + 1; + FillRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + OffsetRect(R, 1, 0); + FillRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + OffsetRect(R, 1, 0); + FillRect(DC, R, GetSysColorBrush(COLOR_BTNSHADOW)); + OffsetRect(R, 1, 0); + FillRect(DC, R, GetSysColorBrush(COLOR_BTNHIGHLIGHT)); + + SetTextColor(DC, PrevFontColor); + SelectObject(DC, PrevFont); +end; + +procedure TdxfmPageSetupDialog.CreateControls; + + function CreateMarginSpin(AHost: TBevel; ATag, ATabOrder: Integer; ALabel: TLabel): TdxPSSpinEdit; + begin + Result := TdxPSSpinEdit.Create(Self); + with Result do + begin + Parent := AHost.Parent; + BoundsRect := AHost.BoundsRect; + LegendText := FsePaperHeight.LegendText; + ValueType := svtFloat; + Decimal := 2; + Increment := 0.1; + PageIncrement := 1; + TabOrder := ATabOrder; + Tag := MakeTTag(ATag); + OnButtonClick := MarginButtonClick; + OnChange := MarginChange; + OnExit := MarginExit; + end; + lblMarginTop.FocusControl := Result; + end; + +begin + FseAdjustTo := TdxPSSpinEdit.Create(Self); + with FseAdjustTo do + begin + Parent := tshScaling; + BoundsRect := bvlAdjustToHolder.BoundsRect; + Increment := 1; + PageIncrement := 10; + MinValue := 10; + MaxValue := 500; + TabOrder := rbtnAdjustTo.TabOrder + 1; + OnChange := ScaleChanged; + OnExit := AdjustToExit; + end; + FseFitToPage := TdxPSSpinEdit.Create(Self); + with FseFitToPage do + begin + Parent := tshScaling; + BoundsRect := bvlFitToPageHolder.BoundsRect; + Increment := 1; + PageIncrement := 10; + MinValue := 1; + MaxValue := 100; + TabOrder := rbtnFitTo.TabOrder + 1; + OnChange := FitToPageChange; + OnExit := FitToPageExit; + end; + lblPagesWideBy.FocusControl := FseFitToPage; + FseFitToPageTall := TdxPSSpinEdit.Create(Self); + with FseFitToPageTall do + begin + Parent := tshScaling; + BoundsRect := bvlFitToPageTallHolder.BoundsRect; + Increment := 1; + PageIncrement := 10; + MinValue := 1; + MaxValue := 100; + TabOrder := rbtnFitTo.TabOrder + 2; + OnChange := FitToPageChange; + OnExit := FitToPageTallExit; + end; + lblTall.FocusControl := FseFitToPageTall; + + FsePaperWidth := TdxPSSpinEdit.Create(Self); + with FsePaperWidth do + begin + Parent := gbxPaper; + BoundsRect := bvlPaperWidthHolder.BoundsRect; + ValueType := svtFloat; + Decimal := 2; + Increment := 0.1; + PageIncrement := 1.0; + TabOrder := lbxPaperType.TabOrder + 1; + OnButtonClick := PaperWidthButtonClick; + OnChange := PaperWidthChange; + OnExit := PaperWidthExit; + lblPaperWidth.FocusControl := FsePaperWidth; + end; + FsePaperHeight := TdxPSSpinEdit.Create(Self); + with FsePaperHeight do + begin + Parent := gbxPaper; + BoundsRect := bvlPaperHeightHolder.BoundsRect; + LegendText := FsePaperWidth.LegendText; + ValueType := svtFloat; + Decimal := 2; + Increment := 0.1; + PageIncrement := 1.0; + TabOrder := lbxPaperType.TabOrder + 2; + OnButtonClick := PaperHeightButtonClick; + OnChange := PaperHeightChange; + OnExit := PaperHeightExit; + lblPaperHeight.FocusControl := FsePaperHeight; + end; + + FseMarginTop := CreateMarginSpin(bvlMarginTopHolder, 1, 0, lblMarginTop); + FseMarginBottom := CreateMarginSpin(bvlMarginBottomHolder, 3, 1, lblMarginBottom); + FseMarginLeft := CreateMarginSpin(bvlMarginLeftHolder, 0, 2, lblMarginLeft); + FseMarginRight := CreateMarginSpin(bvlMarginRightHolder, 2, 3, lblMarginRight); + FseMarginHeader := CreateMarginSpin(bvlMarginHeaderHolder, 5, 4, lblMarginHeader); + FseMarginFooter := CreateMarginSpin(bvlMarginFooterHolder, 6, 5, lblMarginFooter); + + FOrientationPreview := TdxPreview.Create(Self); + with FOrientationPreview do + begin + Parent := gbxOrientation; + Enabled := False; + BoundsRect := bvlOrientationHolder.BoundsRect; + Color := clBtnFace; + {$IFDEF DELPHI7} + ControlStyle := ControlStyle + [csParentBackground]; + {$ENDIF} + ZoomMode := pzmPages; + PageXCount := 1; + ScrollBars := ssNone; + OptionsHint := OptionsHint - [pohShowForMargins, pohShowOnDrag]; + OptionsView := OptionsView - [povPageSelection, povMargins]; + LookAndFeel := plfFlat; + OptionsZoom := OptionsZoom - [pozZoomOnClick]; + MinHeaderSize := 0; + MinFooterSize := 0; + Margins.Footer.Value := 0; + Margins.Bottom.Value := 0; + Margins.Left.Value := 0; + Margins.Header.Value := 0; + Margins.Top.Value := 0; + Margins.Right.Value := 0; + MinUsefulSize := NullPoint; + BorderStyle := bsNone; + OnCalcPageCount := OrientationPreviewCalcPageCount; + end; + + FPreview := TdxPreview.Create(Self); + with FPreview do + begin + Parent := pnlInMargins; + BoundsRect := bvlPreviewHolder.BoundsRect; + OptionsZoom := OptionsZoom - [pozZoomOnClick]; + OptionsView := OptionsView - [povPageSelection]; + MinHeaderSize := 0; + MinFooterSize := 0; + ScrollBars := ssNone; + ZoomMode := pzmPages; + OnCalcPageCount := PreviewCalcPageCount; + OnDrawPageContent := PreviewDrawPageContent; + OnAfterDragMargin := PreviewAfterDragMargin; + end; + + FwpMargins := TdxPSWarningPane.Create(Self); + FwpMargins.Parent := bvlMarginsWarningHolder.Parent; + FwpMargins.BoundsRect := bvlMarginsWarningHolder.BoundsRect; +end; + +procedure TdxfmPageSetupDialog.LoadStrings; +begin + btnOK.Caption := cxGetResourceString(@sdxBtnOK); + btnCancel.Caption := cxGetResourceString(@sdxBtnCancel); + btnHelp.Caption := cxGetResourceString(@sdxBtnHelp); + btnPrint.Caption := cxGetResourceString(@sdxBtnPrint); + btnPrintPreview.Caption := cxGetResourceString(@sdxBtnPrintPreview); + btnOptions.Caption := cxGetResourceString(@sdxBtnOptions); + + lblStyleName.Caption := cxGetResourceString(@sdxStyleName); + + tshPage.Caption := cxGetResourceString(@sdxPage); + tshMargins.Caption := cxGetResourceString(@sdxMargins); + tshHeaderFooter.Caption := cxGetResourceString(@sdxHeaderFooter); + tshScaling.Caption := cxGetResourceString(@sdxScaling); + + gbxPaper.Caption := cxGetResourceString(@sdxPaper); + lblPaperType.Caption := cxGetResourceString(@sdxPaperType); + PlaceBevel(bvlPaperType, lblPaperType); + lblPaperDimensions.Caption := cxGetResourceString(@sdxPaperDimension); + PlaceBevel(bvlPaperDimensions, lblPaperDimensions); + lblPaperWidth.Caption := cxGetResourceString(@sdxPaperWidth); + lblPaperHeight.Caption := cxGetResourceString(@sdxPaperHeight); + lblPaperSource.Caption := cxGetResourceString(@sdxPaperSource); + PlaceBevel(bvlPaperSource, lblPaperSource); + + gbxOrientation.Caption := cxGetResourceString(@sdxOrientation); + rBtnPortrait.Caption := cxGetResourceString(@sdxPortrait); + rBtnLandscape.Caption := cxGetResourceString(@sdxLandscape); + gbxPrintOrder.Caption := cxGetResourceString(@sdxPrintOrder); + rbtnDownThenOver.Caption := cxGetResourceString(@sdxDownThenOver); + rbtnOverThenDown.Caption := cxGetResourceString(@sdxOverThenDown); + gbxShading.Caption := cxGetResourceString(@sdxShading); + chbxShading.Caption := cxGetResourceString(@sdxPrintUsingGrayShading); + + lblMarginTop.Caption := cxGetResourceString(@sdxTop); + lblMarginLeft.Caption := cxGetResourceString(@sdxLeft); + lblMarginRight.Caption := cxGetResourceString(@sdxRight); + lblMarginBottom.Caption := cxGetResourceString(@sdxBottom); + lblMarginHeader.Caption := cxGetResourceString(@sdxHeader2); + lblMarginFooter.Caption := cxGetResourceString(@sdxFooter2); + btnFix.Caption := cxGetResourceString(@sdxBtnFix); + btnRestoreOriginalMargins.Caption := cxGetResourceString(@sdxBtnRestoreOriginal); + + lblCenterOnPage.Caption := cxGetResourceString(@sdxCenterOnPage); + PlaceBevel(bvlCenterOnPage, lblCenterOnPage); + chbxCenterHorz.Caption := cxGetResourceString(@sdxHorizontally); + chbxCenterVert.Caption := cxGetResourceString(@sdxVertically); + + lblPreview.Caption := DropAmpersand(cxGetResourceString(@sdxPreview)); + + lblHeader.Caption := cxGetResourceString(@sdxHeader); + PlaceBevel(bvlHeader, lblHeader); + btnHeaderFont.Caption := cxGetResourceString(@sdxBtnHeaderFont); + btnHeaderBackground.Caption := cxGetResourceString(@sdxBtnHeaderBackground); + lblFooter.Caption := cxGetResourceString(@sdxFooter); + PlaceBevel(bvlFooter, lblFooter); + btnFooterFont.Caption := cxGetResourceString(@sdxBtnFooterFont); + btnFooterBackground.Caption := cxGetResourceString(@sdxBtnFooterBackground); + + gbxVertAlignment.Caption := cxGetResourceString(@sdxVertAlignment); + gbxFunctions.Caption := cxGetResourceString(@sdxPredefinedFunctions); + chbxReverseOnEvenPages.Caption := cxGetResourceString(@sdxReverseOnEvenPages); + + rbtnAdjustTo.Caption := cxGetResourceString(@sdxAdjustTo); + rbtnFitTo.Caption := cxGetResourceString(@sdxFitTo); + lblPercentOfNormalSize.Caption := cxGetResourceString(@sdxPercentOfNormalSize); + lblPagesWideBy.Caption := cxGetResourceString(@sdxPagesWideBy); + lblTall.Caption := cxGetResourceString(@sdxTall); +end; + +procedure TdxfmPageSetupDialog.PaperWidthExit(Sender: TObject); +begin + UpdatePageInfos; +end; + +procedure TdxfmPageSetupDialog.PaperWidthChange(Sender: TObject); +begin + if FControlsUpdating then Exit; + CheckModified; +end; + +procedure TdxfmPageSetupDialog.PaperHeightButtonClick(Sender: TObject; + ButtonType: TdxButtonType; Button: TUDBtnType); +begin + UpdatePageInfos; +end; + +procedure TdxfmPageSetupDialog.PaperWidthButtonClick(Sender: TObject; + ButtonType: TdxButtonType; Button: TUDBtnType); +begin + UpdatePageInfos; +end; + +procedure TdxfmPageSetupDialog.PaperHeightExit(Sender: TObject); +begin + UpdatePageInfos; +end; + +procedure TdxfmPageSetupDialog.UpdatePageInfos; +var + I: Integer; +begin + Page.RealPageSize := MakePoint(Round(1000 * FsePaperWidth.Value), Round(1000 * FsePaperHeight.Value)); + FPreview.OriginalPageSize.Point := Page.PageSizeLoMetric; + FOrientationPreview.OriginalPageSize.Point := Page.PageSizeLoMetric; + UpdateMarginsBounds; + FPaperSizeLocked := True; + try + for I := 0 to PaperInfoCount - 1 do + if PaperInfos[I].DMPaper = Page.DMPaper then + begin + lbxPaperType.ItemIndex := I; + Break; + end; + finally + FPaperSizeLocked := False; + end; +end; + +procedure TdxfmPageSetupDialog.PaperHeightChange(Sender: TObject); +begin + if FControlsUpdating then Exit; + CheckModified; +end; + +procedure TdxfmPageSetupDialog.AdjustToExit(Sender: TObject); +begin + if FControlsUpdating then Exit; + rbtnAdjustTo.Checked := True; + PrintStyle.PrinterPage.ScaleFactor := fseAdjustTo.AsInteger; +end; + +procedure TdxfmPageSetupDialog.ScaleChanged(Sender: TObject); +begin + if FControlsUpdating then Exit; + rbtnAdjustTo.Checked := True; + ActiveControl := TWinControl(Sender); + CheckModified; +end; + +procedure TdxfmPageSetupDialog.FitToPageChange(Sender: TObject); +begin + if FControlsUpdating then Exit; + rbtnFitTo.Checked := True; + ActiveControl := TWinControl(Sender); + CheckModified; +end; + +procedure TdxfmPageSetupDialog.FitToPageExit(Sender: TObject); +begin + if FControlsUpdating then Exit; + PrintStyle.PrinterPage.FitToPagesByWide := FseFitToPage.AsInteger; +end; + +procedure TdxfmPageSetupDialog.FitToPageTallExit(Sender: TObject); +begin + if FControlsUpdating then Exit; + PrintStyle.PrinterPage.FitToPagesByTall := FseFitToPageTall.AsInteger; +end; + +procedure TdxfmPageSetupDialog.UpdateControlsState; +begin + FControlsUpdating := True; + try +// btnOK.Enabled := FModified; + btnPrintPreview.Enabled := True; + btnPrint.Enabled := True; + //btnOptions.Enabled := PrintStyle.OptionsDialogExists; + btnFix.Enabled := MarginsOutside or MarginsInvalid; + btnRestoreOriginalMargins.Enabled := gbxMargins.Enabled and FMarginsChanged; + finally + FControlsUpdating := False; + end +end; + +procedure TdxfmPageSetupDialog.CheckModified; +begin + if not FModified then FModified := True; + UpdateControlsState; +end; + +function TdxfmPageSetupDialog.GetCurrentPaperInfo: TdxPaperInfo; +begin + with lbxPaperType do + if ItemIndex <> -1 then + Result := PaperInfos[ItemIndex] + else + Result := nil; +end; + +function TdxfmPageSetupDialog.GetPage: TdxPrinterPage; +begin + if PrintStyle <> nil then + Result := PrintStyle.PrinterPage + else + Result := nil +end; + +function TdxfmPageSetupDialog.GetPaperInfo(Index: Integer): TdxPaperInfo; +begin + Result := TdxPaperInfo(lbxPaperType.Items.Objects[Index]); +end; + +function TdxfmPageSetupDialog.GetPaperInfoCount: Integer; +begin + Result := lbxPaperType.Items.Count; +end; + +procedure TdxfmPageSetupDialog.StartSetting; + + procedure DeleteCustomPapers; + var + I: Integer; + begin + // TODO: Check + for I := lbxPaperType.Items.Count - 1 downto 0 do + if PaperInfos[I].DMPaper >= DMPAPER_USER then + lbxPaperType.Items.Delete(I); + end; + + procedure SetupPapers; + var + I: Integer; + begin + lbxPaperType.Items.BeginUpdate; + try + lbxPaperType.Clear; + PrintStyle.GetFilteredPapers(lbxPaperType.Items); + if lbxPaperType.Items.Count > 0 then + begin + if not PrintStyle.AllowCustomPaperSizes then + DeleteCustomPapers; + + for I := 0 to PaperInfoCount - 1 do + if PrintStyle.PrinterPage.DMPaper = PaperInfos[I].DMPaper then // TODO: FindByDMPaper + begin + lbxPaperType.ItemIndex := I; + Break; + end; + + if lbxPaperType.ItemIndex = -1 then + if not PrintStyle.AllowCustomPaperSizes then + lbxPaperType.ItemIndex := 0 + else + begin + I := 0; + //TdxPaperInfo(lbxPaperType.Items.Objects[I]).DMPaper < DMPAPER_USER + while (I < lbxPaperType.Items.Count) and (Pos('Custom', lbxPaperType.Items[I]) = 0) do + Inc(I); + if (I < lbxPaperType.Items.Count) then + lbxPaperType.ItemIndex := I + else + lbxPaperType.ItemIndex := 0; + end; + end; + finally + lbxPaperType.Items.EndUpdate; + end; + if lbxPaperType.Enabled then + lbxPaperType.Enabled := lbxPaperType.Items.Count > 0; + end; + + procedure SetupBins; + var + I: Integer; + begin + with cbxPaperSource do + begin + Items.BeginUpdate; + try + Items.Clear; + if dxPrintDevice.Bins <> nil then + Items := dxPrintDevice.Bins; + Enabled := Items.Count > 0; + if Enabled then + begin + I := Items.IndexOfObject(TObject(Page.PaperSource)); + if I <> -1 then + ItemIndex := I + else + ItemIndex := 0; + end; + finally + Items.EndUpdate; + end; + end; + end; + +begin + FControlsUpdating := True; + try + SetupPapers; + if lbxPaperType.Items.Count > 0 then lbxPaperTypeClick(lbxPaperType); + SetupBins; + ChangeBkgndGlyph(FHeaderBkgndGlyph, Page.PageHeader.Background); + btnHeaderBackGround.Glyph := FHeaderBkgndGlyph; + ChangeBkgndGlyph(FFooterBkgndGlyph, Page.PageFooter.Background); + btnFooterBackGround.Glyph := FFooterBkgndGlyph; + edStyleName.Text := Copy(FSavePrintStyle.StyleCaption, 1, edStyleName.MaxLength); + + chbxShading.Checked := PrintStyle.PrinterPage.GrayShading; + + EnabledMemoAttr(False); + UpdateMarginsEdits; + with Page do + begin + FPreview.MeasurementUnits := TdxPreviewMeasurementUnits(MeasurementUnits); + FPreview.MinUsefulSize := MakePoint(MinPrintableAreaLoMetric, MinPrintableAreaLoMetric); + FPreview.Orientation := TdxPreviewPaperOrientation(Orientation); + FPreview.Margins.Header.Value := HeaderLoMetric; + FPreview.Margins.Footer.Value := FooterLoMetric; + with MarginsLoMetric do + begin + FPreview.Margins.Left.Value := Left; + FPreview.Margins.Top.Value := Top; + FPreview.Margins.Right.Value := Right; + FPreview.Margins.Bottom.Value := Bottom; + end; + FOrientationPreview.MeasurementUnits := TdxPreviewMeasurementUnits(MeasurementUnits); + FOrientationPreview.Orientation := TdxPreviewPaperOrientation(Orientation); + + chbxCenterHorz.Checked := PrintStyle.PrinterPage.CenterOnPageH; + chbxCenterVert.Checked := PrintStyle.PrinterPage.CenterOnPageV; + rbtnDownThenOver.Checked := (PrintStyle.PrinterPage.PageOrder = poDownThenOver); + rbtnOverThenDown.Checked := (PrintStyle.PrinterPage.PageOrder = poOverThenDown); + + memHeaderLeft.Lines := PageHeader.LeftTitle; + memHeaderCenter.Lines := PageHeader.CenterTitle; + memHeaderRight.Lines := PageHeader.RightTitle; + memFooterLeft.Lines := PageFooter.LeftTitle; + memFooterCenter.Lines := PageFooter.CenterTitle; + memFooterRight.Lines := PageFooter.RightTitle; + FontInfoToText(PageHeader.Font, edHeaderFontInfo); + FontInfoToText(PageFooter.Font, edFooterFontInfo); + + rbtnAdjustTo.Checked := ScaleMode = smAdjust; + rbtnFitTo.Checked := ScaleMode = smFit; + TdxPSSpinEdit(FseAdjustTo).AsInteger := ScaleFactor; + TdxPSSpinEdit(FseFitToPage).AsInteger := FitToPagesByWide; + TdxPSSpinEdit(FseFitToPageTall).AsInteger := FitToPagesByTall; + chbxReverseOnEvenPages.Checked := ReverseTitlesOnEvenPages; + end; + btnHelp.Visible := (HelpContext <> 0); + if (HelpContext = 0) then + begin + btnOK.BoundsRect := btnCancel.BoundsRect; + btnCancel.BoundsRect := btnHelp.BoundsRect; + end; + finally + FControlsUpdating := False; + UpdateControlsState; + end; + + if (FStyleManager <> nil) and edStyleName.CanFocus then + ActiveControl := edStyleName + else + if pgctrlMain.ActivePage.PageIndex = 0 then + begin + if lbxPaperType.CanFocus then ActiveControl := lbxPaperType + end + else + if pgctrlMain.ActivePage.PageIndex = 1 then + if FseMarginTop.CanFocus and not FseMarginTop.ReadOnly then + ActiveControl := FseMarginTop; +end; + +procedure TdxfmPageSetupDialog.UpdateMarginsBounds; +var + APrevValue: Boolean; +begin + APrevValue := FControlsUpdating; + if not APrevValue then FControlsUpdating := True; + try + with Page do + begin + FseMarginHeader.MinValue := MinMargins.Top / 1000; + FseMarginHeader.MaxValue := (RealPageSize.Y - MinPrintableArea - MinMargins.Bottom) / 1000; + FseMarginFooter.MinValue := MinMargins.Bottom / 1000; + FseMarginFooter.MaxValue := (RealPageSize.Y - MinPrintableArea - MinMargins.Top) / 1000; + FseMarginTop.MinValue := MinMargins.Top / 1000; + FseMarginTop.MaxValue := (RealPageSize.Y - MinPrintableArea - MinMargins.Bottom) / 1000; + FseMarginBottom.MinValue := MinMargins.Bottom / 1000; + FseMarginBottom.MaxValue := (RealPageSize.Y - MinPrintableArea - MinMargins.Top) / 1000; + FseMarginLeft.MinValue := MinMargins.Left / 1000; + FseMarginLeft.MaxValue := (RealPageSize.X - MinPrintableArea - MinMargins.Right) / 1000; + FseMarginRight.MinValue := MinMargins.Right / 1000; + FseMarginRight.MaxValue := (RealPageSize.X - MinPrintableArea - MinMargins.Left) / 1000; + end; + finally + if not APrevValue then FControlsUpdating := False; + end; +end; + +procedure TdxfmPageSetupDialog.SetMarginsInvalid(Value: Boolean); +begin + if FMarginsInvalid <> Value then + begin + FMarginsInvalid := Value; + UpdateWarningPane(MarginsInvalid, MarginsOutside, + cxGetResourceString(@sdxInvalidMargins), cxGetResourceString(@sdxOutsideMargins)); + FPreview.InvalidatePages; + end; +end; + +procedure TdxfmPageSetupDialog.SetMarginsOutside(Value: Boolean); +begin + if FMarginsOutside <> Value then + begin + FMarginsOutside := Value; + UpdateWarningPane(MarginsOutside, MarginsInvalid, + cxGetResourceString(@sdxOutsideMargins), cxGetResourceString(@sdxInvalidMargins)); + end; +end; + +procedure TdxfmPageSetupDialog.MarginExit(Sender: TObject); +var + InvalidMarginControl: TWinControl; +begin + if FMarginsChanging then Exit; + FMarginsChanging := True; + try + MarginsInvalid := not ValidateMargins(InvalidMarginControl); + MarginsOutside := not ValidateMarginsOutside(InvalidMarginControl); + if not MarginsInvalid then UpdatePreviewMargins; + finally + FMarginsChanging := False; + end; + UpdateControlsState; +end; + +procedure TdxfmPageSetupDialog.MarginButtonClick(Sender: TObject; + ButtonType: TdxButtonType; Button: TUDBtnType); +begin + MarginExit(Sender); + CheckModified; +end; + +procedure TdxfmPageSetupDialog.MarginChange(Sender: TObject); +begin + if FControlsUpdating or FMarginsChanging then Exit; + FMarginsChanged := True; + CheckModified; +end; + +procedure TdxfmPageSetupDialog.btnHFFontClick(Sender: TObject); +var + PageObject: TCustomdxPageObject; + Editor: TEdit; +begin + if TTagToInt(TComponent(Sender).Tag) = 0 then + begin + PageObject := Page.PageHeader; + Editor := edHeaderFontInfo; + end + else + begin + PageObject := Page.PageFooter; + Editor := edFooterFontInfo; + end; + + dxPSGlbl.FontDialog.Font := PageObject.Font; + if dxPSGlbl.FontDialog.Execute then + begin + PageObject.Font := dxPSGlbl.FontDialog.Font; + FontInfoToText(PageObject.Font, Editor); + CheckModified; + end; +end; + +procedure TdxfmPageSetupDialog.AutoHFTextEntriesClick(Sender: TObject); +var + Part1, Part2, Part3: string; +begin + dxPSSplitAutoHFTextEntry(FStyleManager.AutoHFTextEntries[TTagToInt(TComponent(Sender).Tag)], Part1, Part2, Part3); + if (Part2 = '') and (Part3 = '') then + TCustomMemo(ActiveControl).SelText := Part1 + else + if TTagToInt(TCustomMemo(ActiveControl).Tag) < 4 then + begin + if Part1 <> '' then memHeaderLeft.SelText := Part1; + if Part2 <> '' then memHeaderCenter.SelText := Part2; + if Part3 <> '' then memHeaderRight.SelText := Part3; + end + else + begin + if Part1 <> '' then memFooterLeft.SelText := Part1; + if Part2 <> '' then memFooterCenter.SelText := Part2; + if Part3 <> '' then memFooterRight.SelText := Part3; + end; + CheckModified; +end; + +procedure TdxfmPageSetupDialog.SpecialInsertClick(Sender: TObject); +begin + if ActiveControl is TCustomMemo then + begin + TCustomMemo(ActiveControl).SelText := FHFFunctionList[TTagToInt(TComponent(Sender).Tag)]; + CheckModified; + end; +end; + +const + PageTitlePartMap: array[0..2] of TdxPageTitlePart = (tpLeft, tpCenter, tpRight); + +procedure TdxfmPageSetupDialog.MemoExit(Sender: TObject); +var + T: Integer; +begin + if not (ActiveControl is TCustomMemo) then + EnabledMemoAttr(False); + + T := TTagToInt(TCustomMemo(Sender).Tag); + if T < 3 then + Page.PageHeader.Titles[PageTitlePartMap[T]].Text := TCustomMemo(Sender).Text + else + Page.PageFooter.Titles[PageTitlePartMap[T - 3]].Text := TCustomMemo(Sender).Text; +end; + +procedure TdxfmPageSetupDialog.MemoEnter(Sender: TObject); +var + T, ButtonIndex: Integer; +begin + EnabledMemoAttr(True); + T := TTagToInt(TCustomMemo(Sender).Tag); + if T < 3 then + ButtonIndex := Integer(Page.PageHeader.TextAlignY[PageTitlePartMap[T]]) + else + ButtonIndex := Integer(Page.PageFooter.TextAlignY[PageTitlePartMap[T - 3]]); + tbTAVert.Buttons[ButtonIndex].Down := True; +end; + +procedure TdxfmPageSetupDialog.pgctrlMainChange(Sender: TObject); +begin + EnabledMemoAttr(False); +end; + +procedure TdxfmPageSetupDialog.EnabledMemoAttr(AEnabled: Boolean); +var + I: Integer; +begin + tbPredefined.Enabled := AEnabled; + for I := 0 to tbPredefined.ButtonCount - 1 do + tbPredefined.Buttons[I].Enabled := AEnabled; + + tbTAVert.Enabled := AEnabled; + for I := 0 to tbTAVert.ButtonCount - 1 do + tbTAVert.Buttons[I].Enabled := AEnabled; +end; + +procedure TdxfmPageSetupDialog.BackgroundClick(Sender: TObject); +var + Pt: TPoint; + T: Integer; + ABackground: TdxBackground; + AParams: TdxBackgroundDlgData; +begin + Pt := TWinControl(Sender).ClientOrigin; + Inc(Pt.Y, TWinControl(Sender).Height); + FillChar(AParams, SizeOf(TdxBackgroundDlgData), 0); + with AParams do + begin + BorderStyle := bsNone; + NoBtnCaption := cxGetResourceString(@sdxBtnNoFill); + ShowFillEffects := True; + ShowMoreColors := True; + end; + T := TTagToInt(TComponent(Sender).Tag); + if T = 0 then + ABackground := Page.PageHeader.Background + else + ABackground := Page.PageFooter.Background; + if dxChooseBackgroundDlg(ABackground, Pt, AParams) then + begin + if T = 0 then + begin + ChangeBkgndGlyph(FHeaderBkgndGlyph, ABackground); + TBitBtn(Sender).Glyph := FHeaderBkgndGlyph; + end + else + begin + ChangeBkgndGlyph(FFooterBkgndGlyph, ABackground); + TBitBtn(Sender).Glyph := FFooterBkgndGlyph; + end; + CheckModified; + end; +end; + +procedure TdxfmPageSetupDialog.VertTextAlignClick(Sender: TObject); +var + T: Integer; +begin + if ActiveControl is TCustomMemo then + begin + T := TTagToInt(TCustomMemo(ActiveControl).Tag); + if T < 3 then + Page.PageHeader.TextAlignY[PageTitlePartMap[T]] := TdxTextAlignY(TTagToInt(TToolButton(Sender).Tag)) + else + Page.PageFooter.TextAlignY[PageTitlePartMap[T - 3]] := TdxTextAlignY(TTagToInt(TToolButton(Sender).Tag)); + CheckModified; + end; +end; + +procedure TdxfmPageSetupDialog.memHeaderLeftChange(Sender: TObject); +begin + CheckModified; + TWinControl(Sender).Invalidate; +end; + +procedure TdxfmPageSetupDialog.chbxReverseOnEvenPagesClick(Sender: TObject); +begin + if FControlsUpdating then Exit; + PrintStyle.PrinterPage.ReverseTitlesOnEvenPages := TCheckBox(Sender).Checked; + CheckModified; +end; + +procedure TdxfmPageSetupDialog.btnPrintPreviewClick(Sender: TObject); +begin + FModified := True; + FPreviewBtnClicked := True; + ModalResult := mrOK +end; + +procedure TdxfmPageSetupDialog.btnPrintClick(Sender: TObject); +begin + FModified := True; + FPrintBtnClicked := True; + ModalResult := mrOK; +end; + +procedure TdxfmPageSetupDialog.OrientationPreviewCalcPageCount(Sender: TObject); +begin + TdxPreview(Sender).PageCount := 1; +end; + +procedure TdxfmPageSetupDialog.PreviewCalcPageCount(Sender: TObject); +begin + TdxPreview(Sender).PageCount := 1; +end; + +procedure TdxfmPageSetupDialog.PreviewDrawPageContent(Sender: TObject; + ACanvas: TCanvas; ABounds: TRect; APageIndex: Integer); +var + ContentBounds, FooterBounds, HeaderBounds: TRect; + InvalidMarginControl: TWinControl; +begin + with TdxPreview(Sender) do + begin + ContentBounds := MakeRect(ABounds.Left + Margins.Left.VisibleValue, + ABounds.Top + Margins.Top.VisibleValue, + ABounds.Right - Margins.Right.VisibleValue, + ABounds.Bottom - Margins.Bottom.VisibleValue); + FooterBounds := MakeRect(ABounds.Left + Margins.Left.VisibleValue, + ABounds.Bottom - Margins.Footer.VisibleValue, + ABounds.Right - Margins.Right.VisibleValue, + ABounds.Bottom - Margins.Bottom.VisibleValue); + HeaderBounds := MakeRect(ABounds.Left + Margins.Left.VisibleValue, + ABounds.Top + Margins.Header.VisibleValue, + ABounds.Right - Margins.Right.VisibleValue, + ABounds.Top + Margins.Top.VisibleValue); + + if ValidateMargins(InvalidMarginControl) then + OptionsView := OptionsView + [povMargins] + else + OptionsView := OptionsView - [povMargins]; + + if povMargins in OptionsView then + if Assigned(FOnCustomDrawPreview) then + FOnCustomDrawPreview(PrintStyle, ACanvas, ABounds, ContentBounds, HeaderBounds, FooterBounds) + else + dxPSDefaultDrawPagePreview(PrintStyle, ACanvas, ABounds, ContentBounds, HeaderBounds, FooterBounds); + end; +end; + +procedure TdxfmPageSetupDialog.PreviewAfterDragMargin(Sender: TObject; + AMargin: TdxPreviewPageMargin); +var + V: Extended; +begin + case Page.GetInnerMeasurementUnits of + muInches: + V := AMargin.Value / 254; + muMillimeters: + V := AMargin.Value / 10; + else + V := 0; + end; + + if (AMargin is TdxPreviewPageMarginFooter) or (AMargin is TdxPreviewPageMarginHeader) then + FMarginsChanging := True; + + try + if AMargin is TdxPreviewPageMarginLeft then + begin + FseMarginLeft.Value := V; + MarginExit(FseMarginLeft); + end; + if AMargin is TdxPreviewPageMarginTop then + begin + FseMarginTop.Value := V; + MarginExit(FseMarginTop); + end; + if AMargin is TdxPreviewPageMarginRight then + begin + FseMarginRight.Value := V; + MarginExit(FseMarginRight); + end; + if AMargin is TdxPreviewPageMarginBottom then + begin + FseMarginBottom.Value := V; + MarginExit(FseMarginBottom); + end; + if AMargin is TdxPreviewPageMarginHeader then + begin + FseMarginHeader.Value := V; + if FseMarginTop.Value < FseMarginHeader.Value then + FseMarginTop.Value := FseMarginHeader.Value; + FMarginsChanged := True; + end; + if AMargin is TdxPreviewPageMarginFooter then + begin + FseMarginFooter.Value := V; + if FseMarginBottom.Value < FseMarginFooter.Value then + FseMarginBottom.Value := FseMarginFooter.Value; + FMarginsChanged := True; + end; + finally + if (AMargin is TdxPreviewPageMarginFooter) or (AMargin is TdxPreviewPageMarginHeader) then + begin + FMarginsChanging := False; + if AMargin is TdxPreviewPageMarginHeader then + MarginExit(FseMarginHeader) + else + MarginExit(FseMarginBottom); + end; + end; +end; + +procedure TdxfmPageSetupDialog.lblMarginTopClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; +end; + +procedure TdxfmPageSetupDialog.lblPaperSourceClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; + TComboBox(ActiveControl).DroppedDown := True; +end; + +procedure TdxfmPageSetupDialog.pbxPageOrderPaint(Sender: TObject); +const + ImageIndexes: array[Boolean] of Integer = (1, 0); +begin + ilPrintOrders.Draw(TPaintBox(Sender).Canvas, 0, 0, + ImageIndexes[rbtnDownThenOver.Checked], gbxPrintOrder.Enabled); +end; + +procedure TdxfmPageSetupDialog.PageOrderClick(Sender: TObject); +begin + if FControlsUpdating then Exit; + PrintStyle.PrinterPage.PageOrder := TdxPageOrder(TTagToInt(TRadioButton(Sender).Tag)); + pbxPageOrder.Invalidate; + CheckModified; +end; + +procedure TdxfmPageSetupDialog.pbxPageOrderDblClick(Sender: TObject); +begin + rbtnDownThenOver.Checked := not rbtnDownThenOver.Checked; + rbtnOverThenDown.Checked := not rbtnDownThenOver.Checked; +end; + +procedure TdxfmPageSetupDialog.chbxShadingClick(Sender: TObject); +begin + if FControlsUpdating then Exit; + PrintStyle.PrinterPage.GrayShading := TCheckBox(Sender).Checked; + CheckModified; +end; + +procedure TdxfmPageSetupDialog.CenterOnPageClick(Sender: TObject); +begin + if FControlsUpdating then Exit; + with TCheckBox(Sender) do + if TTagToInt(Tag) = 0 then + PrintStyle.PrinterPage.CenterOnPageH := Checked + else + PrintStyle.PrinterPage.CenterOnPageV := Checked; + CheckModified; + FPreview.InvalidatePages; +end; + +procedure TdxfmPageSetupDialog.OrientationClick(Sender: TObject); +var + T: Integer; + V, W, H: Extended; +begin + if FControlsUpdating then Exit; + T := TTagToInt(TComponent(Sender).Tag); + if not Page.AutoSwapMargins then + begin + FPreview.OptionsBehavior := FPreview.OptionsBehavior - [pobAutoSwapMargins]; + FOrientationPreview.OptionsBehavior := FOrientationPreview.OptionsBehavior - [pobAutoSwapMargins]; + end; + FPreview.Orientation := TdxPreviewPaperOrientation(T); + FOrientationPreview.Orientation := TdxPreviewPaperOrientation(T); + SaveMargins; + Page.Orientation := TdxPrinterOrientation(T); + + W := FsePaperWidth.Value; + H := FsePaperHeight.Value; + V := FsePaperWidth.MaxValue; + FsePaperWidth.MaxValue := FsePaperHeight.MaxValue; + FsePaperHeight.MaxValue := V; + V := FsePaperWidth.MinValue; + FsePaperWidth.MinValue := FsePaperHeight.MinValue; + FsePaperHeight.MinValue := V; + FsePaperWidth.Value := H; + FsePaperHeight.Value := W; + + UpdateMarginsEdits; + CheckModified; +end; + +procedure TdxfmPageSetupDialog.OrientationDblClick(Sender: TObject); +begin + ModalResult := mrOk; +end; + +procedure TdxfmPageSetupDialog.UpdateMarginsEdits; +begin + UpdateMarginsBounds; + with Page do + begin + FseMarginHeader.Value := Header / 1000; + FseMarginFooter.Value := Footer / 1000; + FseMarginTop.Value := Margins.Top / 1000; + FseMarginBottom.Value := Margins.Bottom / 1000; + FseMarginLeft.Value := Margins.Left / 1000; + FseMarginRight.Value := Margins.Right / 1000; + end; + if not FControlsUpdating then + begin + MarginExit(FseMarginHeader); + MarginExit(FseMarginFooter); + MarginExit(FseMarginTop); + MarginExit(FseMarginBottom); + MarginExit(FseMarginLeft); + MarginExit(FseMarginRight); + end; +end; + +procedure TdxfmPageSetupDialog.cbxPaperSourceChange(Sender: TObject); +begin + if FControlsUpdating then Exit; + with TComboBox(Sender) do + Page.PaperSource := Integer(Items.Objects[ItemIndex]); + CheckModified; +end; + +procedure TdxfmPageSetupDialog.lbxPaperTypeClick(Sender: TObject); +var + PaperInfo: TdxPaperInfo; + Pt: TPoint; +begin + if FPaperSizeLocked then Exit; + + PaperInfo := CurrentPaperInfo; + + Pt := MakePoint(PaperInfo.Width, PaperInfo.Height); + FPreview.OriginalPageSize.Point := Pt; + FOrientationPreview.OriginalPageSize.Point := Pt; + + Page.DMPaper := PaperInfo.DMPaper; + FsePaperWidth.Value := Page.RealPageSize.X / 1000; + FsePaperHeight.Value := Page.RealPageSize.Y / 1000; + + UpdateMarginsBounds; + if not FControlsUpdating then CheckModified; +end; + +procedure TdxfmPageSetupDialog.ScalingClick(Sender: TObject); +begin + if FControlsUpdating then Exit; + case TTagToInt(TComponent(Sender).Tag) of + 0: + begin + PrintStyle.PrinterPage.ScaleMode := smAdjust; + ActiveControl := FseAdjustTo; + end; + 1: + begin + PrintStyle.PrinterPage.ScaleMode := smFit; + if FseFitToPage.Enabled then + ActiveControl := FseFitToPage + else if FseFitToPageTall.Enabled then + ActiveControl := FseFitToPageTall; + end; + end; + CheckModified; +end; + +procedure TdxfmPageSetupDialog.MemoChange(Sender: TObject); +begin + if FControlsUpdating then Exit; + CheckModified; +end; + +procedure TdxfmPageSetupDialog.cbxPaperSourceDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +begin + with TComboBox(Control) do + begin + Canvas.FillRect(Rect); + InflateRect(Rect, -2, -1); + ilBins.Draw(Canvas, Rect.Left, Rect.Top, Integer(dxPrintDevice.IsAutoSelectBin(Index))); + Inc(Rect.Left, ilPaperTypes.Width + 2); + Canvas.TextRect(Rect, Rect.Left, + Rect.Top + (Rect.Bottom - Rect.Top - Canvas.TextHeight(Items[Index])) div 2, Items[Index]); + end; +end; + +procedure TdxfmPageSetupDialog.lbxPaperTypeDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +const + ImageIndexes: array[Boolean] of Integer = (0, 1); +begin + with TListBox(Control) do + begin + Canvas.FillRect(Rect); + InflateRect(Rect, -2, -1); + ilPapers.Draw(Canvas, Rect.Left, Rect.Top, ImageIndexes[dxPrintDevice.IsEnvelopePaper(Index)], Enabled); + Inc(Rect.Left, ilPaperTypes.Width + 2); + if not Enabled then + Canvas.Font.Color := clGrayText; + Canvas.TextRect(Rect, Rect.Left, + Rect.Top + (Rect.Bottom - Rect.Top - Canvas.TextHeight(Items[Index])) div 2, Items[Index]); + Canvas.Font.Color := clWindowText; + end; +end; + +procedure TdxfmPageSetupDialog.FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if (Key = VK_ESCAPE) and (Shift = []) and (ActiveControl is TCustomMemo) then + ModalResult := mrCancel; +end; + +procedure TdxfmPageSetupDialog.edStyleNameChange(Sender: TObject); +begin + if FControlsUpdating then Exit; + CheckModified; +end; + +procedure TdxfmPageSetupDialog.edStyleNameExit(Sender: TObject); +var + StyleManager: TdxPrintStyleManager; +begin + if edStyleName.Enabled then + begin + PrintStyle.StyleCaption := edStyleName.Text; + StyleManager := FSavePrintStyle.StyleManager; + if (StyleManager <> nil) and (StyleManager.PageSetupDialog <> nil) then + Caption := StyleManager.PageSetupDialog.RealTitle + else + Caption := cxGetResourceString(@sdxPageSetupCaption) + ': ' + PrintStyle.StyleCaption; + end; +end; + +function TdxfmPageSetupDialog.ValidateStyleCaption: Boolean; +var + S: string; + I: Integer; + AStyle: TBasedxPrintStyle; +begin + Result := True; + if (FStyleManager <> nil) and not edStyleName.ReadOnly then + begin + S := edStyleName.Text; + for I := 0 to FStyleManager.Count - 1 do + begin + AStyle := FStyleManager[I]; + if (AStyle <> FSavePrintStyle) and dxSameText(AStyle.StyleCaption, S) then + begin + Result := False; + Exit; + end; + end; + end; +end; + +function TdxfmPageSetupDialog.ValidateUserInput(out AControl: TWinControl): Boolean; +var + IsFixupMarginsOutside: Boolean; + Stub: TWinControl; +begin + AControl := nil; + Result := ValidateStyleCaption; + if not Result then + begin + MessageWarning(Format(cxGetResourceString(@sdxInvalideStyleCaption), [edStyleName.Text])); + AControl := edStyleName; + end + else + begin + IsFixupMarginsOutside := False; + if not ValidateMarginsOutside(Stub) then + begin + Result := True; + Beep; + IsFixupMarginsOutside := MarginsOutsideMessageDlg(cxGetResourceString(@sdxOutsideMarginsMessage2)) = mrYes; + if IsFixupMarginsOutside then FixupMarginsOutside; + end; + if not IsFixupMarginsOutside then + begin + Result := ValidateMargins(AControl); + if not Result then + begin + Beep; + Result := True; + case MarginsMessageDlg(cxGetResourceString(@sdxInvalidMarginsMessage)) of + mrYes: + FixupMargins; + mrNo: + RestoreOriginalMargins; + end; + end; + end; + end; +end; + +procedure TdxfmPageSetupDialog.SaveMargins; +begin + Page.BeginUpdate; + try + Page.Header := Round(FseMarginHeader.Value * 1000); + Page.Footer := Round(FseMarginFooter.Value * 1000); + Page.Margins.Left := Round(FseMarginLeft.Value * 1000); + Page.Margins.Top := Round(FseMarginTop.Value * 1000); + Page.Margins.Right := Round(FseMarginRight.Value * 1000); + Page.Margins.Bottom := Round(FseMarginBottom.Value * 1000); + finally + Page.EndUpdate; + end; +end; + +procedure TdxfmPageSetupDialog.SaveStyleCaption; +begin + if not edStyleName.ReadOnly then + PrintStyle.StyleCaption := edStyleName.Text; +end; + +procedure TdxfmPageSetupDialog.SaveUserInput; +begin + SaveStyleCaption; + SaveMargins; +end; + +function TdxfmPageSetupDialog.ValidateMarginsOutside(out AInvalidMarginControl: TWinControl): Boolean; +var + MinX, MinY: Extended; +begin + if dxInitPrintDevice(False) then + begin + MinX := dxPrintDevice.PhysOffsetX / GetDeviceCaps(dxPrintDevice.Handle, LOGPIXELSX); + MinY := dxPrintDevice.PhysOffsetY / GetDeviceCaps(dxPrintDevice.Handle, LOGPIXELSX); + case Page.GetInnerMeasurementUnits of + muInches: ; + muMillimeters: + begin + MinX := 25.4 * MinX; + MinY := 25.4 * MinY; + end; + end; + end + else + begin + MinX := 0; + MinY := 0; + end; + Result := FseMarginHeader.Value >= MinY; + if Result then + Result := FseMarginFooter.Value >= MinY + else + begin + AInvalidMarginControl := FseMarginHeader; + Exit; + end; + if Result then + Result := FseMarginLeft.Value >= MinX + else + begin + AInvalidMarginControl := FseMarginFooter; + Exit; + end; + if Result then + Result := FseMarginRight.Value >= MinX + else + begin + AInvalidMarginControl := FseMarginLeft; + Exit; + end; + + if Result then + AInvalidMarginControl := nil + else + AInvalidMarginControl := FseMarginRight; +end; + +function TdxfmPageSetupDialog.ValidateMargins(out AInvalidMarginControl: TWinControl): Boolean; + + function EqualOrGreaterThen(const AValue1, AValue2: Extended): Boolean; + const + Eps = 0.00001; + begin + Result := (AValue1 > AValue2) or (Abs(AValue1 - AValue2) < Eps); + end; + + function EqualOrLessThen(const AValue1, AValue2: Extended): Boolean; + const + Eps = 0.00001; + begin + Result := (AValue1 < AValue2) or (Abs(AValue1 - AValue2) < Eps); + end; + +var + Min, Max, APageSizeX, APageSizeY, AMinPrintableArea: Extended; +begin + with Page do + begin + APageSizeX := RealPageSize.X / 1000; + APageSizeY := RealPageSize.Y / 1000; + AMinPrintableArea := MinPrintableArea / 1000; + {header} + Min := 0; + Max := APageSizeY - AMinPrintableArea; + Result := EqualOrGreaterThen(FseMarginHeader.Value, Min) and EqualOrLessThen(FseMarginHeader.Value, Max); + if Result then + begin + {footer} + Min := 0; + Max := APageSizeY - AMinPrintableArea - FseMarginHeader.Value; + Result := EqualOrGreaterThen(FseMarginFooter.Value, Min) and EqualOrLessThen(FseMarginFooter.Value, Max); + end + else + begin + AInvalidMarginControl := FseMarginHeader; + Exit; + end; + {top} + if Result then + begin + Min := FseMarginHeader.Value; + Max := APageSizeY - AMinPrintableArea - FseMarginBottom.Value; + Result := EqualOrGreaterThen(FseMarginTop.Value, Min) and EqualOrLessThen(FseMarginTop.Value, Max); + end + else + begin + AInvalidMarginControl := FseMarginFooter; + Exit; + end; + if Result then + begin {bottom} + Min := FseMarginFooter.Value; + Max := APageSizeY - AMinPrintableArea - FseMarginTop.Value; + Result := EqualOrGreaterThen(FseMarginBottom.Value, Min) and EqualOrLessThen(FseMarginBottom.Value, Max); + end + else + begin + AInvalidMarginControl := FseMarginTop; + Exit; + end; + if Result then + begin {left} + Min := 0; + Max := APageSizeX - AMinPrintableArea; + Result := EqualOrGreaterThen(FseMarginLeft.Value, Min) and EqualOrLessThen(FseMarginLeft.Value, Max); + end + else + begin + AInvalidMarginControl := FseMarginBottom; + Exit; + end; + if Result then + begin {right} + Min := 0; + Max := APageSizeX - AMinPrintableArea - FseMarginLeft.Value; + Result := EqualOrGreaterThen(FseMarginRight.Value, Min) and EqualOrLessThen(FseMarginRight.Value, Max); + end + else + begin + AInvalidMarginControl := FseMarginLeft; + Exit; + end; + end; + if Result then + AInvalidMarginControl := nil + else + AInvalidMarginControl := FseMarginRight; +end; + +procedure TdxfmPageSetupDialog.UpdatePreviewMargin(const AValue: Extended; + AMargin: TdxPreviewPageMargin); +var + V: Integer; +begin + V := Round(AValue * 1000); + case Page.GetInnerMeasurementUnits of + muInches: + V := MulDiv(V, 254, 1000); + muMillimeters: + V := V div 100; + end; + AMargin.Value := V; +end; + +procedure TdxfmPageSetupDialog.UpdatePreviewMargins; +begin + UpdatePreviewMargin(FseMarginHeader.Value, FPreview.Margins.Header); + UpdatePreviewMargin(FseMarginTop.Value, FPreview.Margins.Top); + UpdatePreviewMargin(FseMarginFooter.Value, FPreview.Margins.Footer); + UpdatePreviewMargin(FseMarginBottom.Value, FPreview.Margins.Bottom); + UpdatePreviewMargin(FseMarginLeft.Value, FPreview.Margins.Left); + UpdatePreviewMargin(FseMarginRight.Value, FPreview.Margins.Right); +end; + +procedure TdxfmPageSetupDialog.UpdateWarningPane(AValue, APairValue: Boolean; + const AHint, APairHint: string); +begin + if AValue then + FwpMargins.SetStateAndHint(AValue, AHint) + else + if APairValue then + FwpMargins.SetStateAndHint(APairValue, APairHint) + else + FwpMargins.State := False; +end; + +procedure TdxfmPageSetupDialog.FixupMarginsOutside; +var + AMinLeft, AMinRight, AMinTop, AMinBottom: Integer; +begin + Page.GetRealMinMargins(AMinLeft, AMinRight, AMinTop, AMinBottom); + FMarginsChanging := True; + try + if FseMarginTop.Value < AMinTop / 1000 then + begin + FseMarginTop.Value := AMinTop / 1000; + UpdatePreviewMargin(AMinTop / 1000, FPreview.Margins.Top); + end; + if FseMarginHeader.Value < AMinTop / 1000 then + begin + FseMarginHeader.Value := AMinTop / 1000; + UpdatePreviewMargin(AMinTop / 1000, FPreview.Margins.Header); + end; + if FseMarginBottom.Value < AMinBottom / 1000 then + begin + FseMarginBottom.Value := AMinBottom / 1000; + UpdatePreviewMargin(AMinBottom / 1000, FPreview.Margins.Bottom); + end; + if FseMarginFooter.Value < AMinBottom / 1000 then + begin + FseMarginFooter.Value := AMinBottom / 1000; + UpdatePreviewMargin(AMinBottom / 1000, FPreview.Margins.Footer); + end; + if FseMarginLeft.Value < AMinLeft / 1000 then + begin + FseMarginLeft.Value := AMinLeft / 1000; + UpdatePreviewMargin(AMinLeft / 1000, FPreview.Margins.Left); + end; + if FseMarginRight.Value < AMinRight / 1000 then + begin + FseMarginRight.Value := AMinRight / 1000; + UpdatePreviewMargin(AMinRight / 1000, FPreview.Margins.Right); + end; + finally + FMarginsChanging := False; + end; + MarginsOutside := False; + MarginsInvalid := False; + CheckModified; +end; + +procedure TdxfmPageSetupDialog.FixupMargins; + + function MinMax(const Value, Min, Max: Double): Double; + begin + if Value < Min then + Result := Min + else if Value > Max then + Result := Max + else + Result := Value; + end; + +var + V: Double; + AMinLeft, AMinRight, AMinTop, AMinBottom: Integer; +begin + Page.GetRealMinMargins(AMinLeft, AMinRight, AMinTop, AMinBottom); + FMarginsChanging := True; + try + V := (Page.RealPageSize.Y - Page.MinPrintableArea - AMinBottom) / 1000; + FseMarginHeader.Value := MinMax(FseMarginHeader.Value, AMinTop / 1000, V); + V := (Page.RealPageSize.Y - Page.MinPrintableArea - 1000 * FseMarginHeader.Value) / 1000; + FseMarginFooter.Value := MinMax(FseMarginFooter.Value, AMinBottom / 1000, V); + V := (Page.RealPageSize.Y - Page.MinPrintableArea - 1000 * FseMarginFooter.Value) / 1000; + FseMarginTop.Value := MinMax(FseMarginTop.Value, FseMarginHeader.Value, V); + V := (Page.RealPageSize.Y - Page.MinPrintableArea - 1000 * FseMarginTop.Value) / 1000; + FseMarginBottom.Value := MinMax(FseMarginBottom.Value, FseMarginFooter.Value, V); + + V := (Page.RealPageSize.X - Page.MinPrintableArea - AMinRight) / 1000; + FseMarginLeft.Value := MinMax(FseMarginLeft.Value, AMinLeft / 1000, V); + V := (Page.RealPageSize.X - Page.MinPrintableArea - 1000 * FseMarginLeft.Value) / 1000; + FseMarginRight.Value := MinMax(FseMarginRight.Value, AMinRight / 1000, V); + + UpdatePreviewMargin(0, FPreview.Margins.Footer); + UpdatePreviewMargin(0, FPreview.Margins.Bottom); + UpdatePreviewMargin(0, FPreview.Margins.Right); + UpdatePreviewMargin(FseMarginTop.Value, FPreview.Margins.Top); + UpdatePreviewMargin(FseMarginHeader.Value, FPreview.Margins.Header); + UpdatePreviewMargin(FseMarginBottom.Value, FPreview.Margins.Bottom); + UpdatePreviewMargin(FseMarginFooter.Value, FPreview.Margins.Footer); + UpdatePreviewMargin(FseMarginLeft.Value, FPreview.Margins.Left); + UpdatePreviewMargin(FseMarginRight.Value, FPreview.Margins.Right); + finally + FMarginsChanging := False; + end; + + MarginsInvalid := False; + CheckModified; +end; + +procedure TdxfmPageSetupDialog.RestoreOriginalMargins; +begin + FMarginsChanging := True; + try + with FSavePrintStyle.PrinterPage do + begin + FseMarginHeader.Value := Footer / 1000; + FPreview.Margins.Header.Value := HeaderLoMetric; + FseMarginFooter.Value := Footer / 1000; + FPreview.Margins.Footer.Value := FooterLoMetric; + FseMarginLeft.Value := Margins.Left / 1000; + FPreview.Margins.Left.Value := MarginsLoMetric.Left; + FseMarginTop.Value := Margins.Top / 1000; + FPreview.Margins.Top.Value := MarginsLoMetric.Top; + FseMarginRight.Value := Margins.Right / 1000; + FPreview.Margins.Right.Value := MarginsLoMetric.Right; + FseMarginBottom.Value := Margins.Bottom / 1000; + FPreview.Margins.Bottom.Value := MarginsLoMetric.Bottom; + end; + finally + FMarginsChanging := False; + end; + MarginsOutside := False; + MarginsInvalid := False; + CheckModified; +end; + +function TdxfmPageSetupDialog.FindControlPageIndex(AControl: TWinControl): Integer; +begin + for Result := 0 to pgctrlMain.PageCount - 1 do + if pgctrlMain.Pages[Result].ContainsControl(AControl) then Exit; + Result := -1; +end; + +procedure TdxfmPageSetupDialog.TrySetActiveControl(AControl: TWinControl); +var + PageIndex: Integer; +begin + PageIndex := FindControlPageIndex(AControl); + if PageIndex = -1 then Exit; + //if pgctrlMain.Pages[PageIndex].CanFocus then + begin + pgctrlMain.ActivePage := pgctrlMain.Pages[PageIndex]; + if AControl.CanFocus then ActiveControl := AControl; + end; +end; + +procedure TdxfmPageSetupDialog.pgctrlMainChanging(Sender: TObject; var AllowChange: Boolean); +var + InvalidMarginControl: TWinControl; +begin + if TPageControl(Sender).ActivePage.PageIndex = 1 then + begin + AllowChange := ValidateMargins(InvalidMarginControl); + if not AllowChange then + begin + Beep; + case MarginsMessageDlg(cxGetResourceString(@sdxInvalidMarginsMessage)) of + mrYes: + FixupMargins; + mrNo: + RestoreOriginalMargins; + end; + ActiveControl := InvalidMarginControl; + end; + end; +end; + +procedure TdxfmPageSetupDialog.btnRestoreOriginalMarginsClick( + Sender: TObject); +begin + RestoreOriginalMargins; +end; + +procedure TdxfmPageSetupDialog.btnFixClick(Sender: TObject); +begin + if MarginsOutside then + FixupMarginsOutside + else + if MarginsInvalid then + FixupMargins; +end; + +procedure TdxfmPageSetupDialog.FormCloseQuery(Sender: TObject; + var CanClose: Boolean); +var + Control: TWinControl; +begin + if FPreview.DraggingMargin <> nil then + CanClose := False + else + if ModalResult = mrOK then + begin + CanClose := ValidateUserInput(Control); + if not CanClose then + begin + FPrintBtnClicked := False; + FPreviewBtnClicked := False; + TrySetActiveControl(Control); + end + else + SaveUserInput; + end; +end; + +procedure TdxfmPageSetupDialog.FormClose(Sender: TObject; + var Action: TCloseAction); +begin + if (ModalResult = mrOK) and (ActiveControl is TdxPSSpinEdit) then + TdxPSSpinEdit(ActiveControl).Perform(CM_EXIT, 0, 0); +end; + +procedure TdxfmPageSetupDialog.CMSysColorChange(var Message: TMessage); +begin + inherited; + if pgctrlMain.ActivePage = tshMargins then FPreview.Invalidate; +end; + +{ TdxPrintStylePrinterPage } + +function TdxPrintStylePrinterPage.GetOwner: TPersistent; +begin + Result := PrintStyle; +end; + +function TdxPrintStylePrinterPage.IsPageFooterTitleStored(Index: Integer): Boolean; +var + Part: TdxPageTitlePart; +begin + Part := dxPSPageTitlePartMap[Index]; + Result := PageFooter.Titles[Part].Text <> PrintStyle.DefaultPageFooterText(Part); +end; + +function TdxPrintStylePrinterPage.IsPageHeaderTitleStored(Index: Integer): Boolean; +var + Part: TdxPageTitlePart; +begin + Part := dxPSPageTitlePartMap[Index]; + Result := PageHeader.Titles[Part].Text <> PrintStyle.DefaultPageHeaderText(Part); +end; + +procedure TdxPrintStylePrinterPage.PageParamsChanged(AUpdateCodes: TdxPrinterPageUpdateCodes); +begin + inherited; + if (UpdateCount = 0) and PrintStyle.IsCurrentStyle then + PrintStyle.PageParamsChanged(AUpdateCodes); +end; + +{ TBasedxPrintStyle } + +constructor TBasedxPrintStyle.Create(AOwner: TComponent); +begin + inherited; + FAllowChangeHFText := True; + FAllowChangeMargins := True; + FAllowChangeOrientation := True; + FAllowChangePaper := True; + FAllowChangeScale := True; + FAllowCustomPaperSizes := True; + FImageIndex := -1; + FBuiltIn := IsDesigning; + + FPrinterPage := CreatePrinterPage; + + FStyleGlyph := TBitmap.Create; + FStyleGlyph.OnChange := StyleGlyphChanged; +end; + +destructor TBasedxPrintStyle.Destroy; +begin + try + if (StyleManager <> nil) and StyleManager.AllowAutoSave then + try + StyleManager.SaveToFile(StyleManager.StorageName); + finally + StyleManager.FAlreadySaved := True; + end; + finally + {$IFNDEF DELPHI5} + Destroying; + {$ENDIF} + StyleManager := nil; + FreeAndNil(FPrinterPage); + FreeAndNil(FStyleGlyph); + FreeAndNil(FDefaultStyleGlyph); + inherited; + end; +end; + +procedure TBasedxPrintStyle.BeforeDestruction; +begin + DoDestroy; + inherited; +end; + +procedure TBasedxPrintStyle.Assign(Source: TPersistent); +begin + if Source is TBasedxPrintStyle then + with TBasedxPrintStyle(Source) do + begin + Self.AllowChangeHFText := AllowChangeHFText; + Self.AllowChangeMargins := AllowChangeMargins; + Self.AllowChangeOrientation := AllowChangeOrientation; + Self.AllowChangePaper := AllowChangePaper; + Self.AllowChangeScale := AllowChangeScale; + Self.AllowCustomPaperSizes := AllowCustomPaperSizes; + Self.Description := Description; + Self.ImageIndex := ImageIndex; + Self.PrinterPage := PrinterPage; + Self.StyleGlyph := StyleGlyph; + Self.StyleCaption := StyleCaption; + + Self.FIsDescriptionAssigned := FIsDescriptionAssigned; + Self.FIsStyleCaptionAssigned := FIsStyleCaptionAssigned; + Self.FIsStyleGlyphAssigned := FIsStyleGlyphAssigned; + end + else + inherited; +end; + +function TBasedxPrintStyle.GetParentComponent: TComponent; +begin + Result := StyleManager; +end; + +function TBasedxPrintStyle.HasParent: Boolean; +begin + Result := StyleManager <> nil; +end; + +procedure TBasedxPrintStyle.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('BuiltInStyle', ReadData, WriteData, True); + Filer.DefineProperty('IsDescriptonAssigned', ReadIsDescriptionAssigned, WriteIsDescriptionAssigned, + FIsDescriptionAssigned and (Description = '')); + Filer.DefineProperty('IsStyleCaptionAssigned', ReadIsStyleCaptionAssigned, WriteIsStyleCaptionAssigned, + FIsStyleCaptionAssigned and (StyleCaption = '')); + Filer.DefineProperty('IsStyleGlyphAssigned', ReadIsStyleGlyphAssigned, WriteIsStyleGlyphAssigned, + FIsStyleGlyphAssigned and StyleGlyph.Empty); +end; + +procedure TBasedxPrintStyle.ReadState(Reader: TReader); +begin + inherited; + if Reader.Parent is TdxPrintStyleManager then + StyleManager := Reader.Parent as TdxPrintStyleManager; +end; + +procedure TBasedxPrintStyle.SetName(const NewName: TComponentName); +begin + inherited; + DesignerUpdate(False); +end; + +procedure TBasedxPrintStyle.SetParentComponent(AParent: TComponent); +begin + inherited; + if not IsLoading then + StyleManager := AParent as TdxPrintStyleManager; +end; + +class function TBasedxPrintStyle.StyleClass: TdxPrintStyleClass; +begin + Result := TdxPrintStyleClass(GetTypeData(ClassInfo)^.ClassType); +end; + +function TBasedxPrintStyle.DefaultDescription: string; +begin + Result := ''; +end; + +function TBasedxPrintStyle.DefaultPageFooterText(APart: TdxPageTitlePart): string; +begin + Result := ''; +end; + +function TBasedxPrintStyle.DefaultPageHeaderText(APart: TdxPageTitlePart): string; +begin + Result := ''; +end; + +function TBasedxPrintStyle.DefaultStyleCaption: string; +begin + Result := cxGetResourceString(@sdxBaseStyle); +end; + +function TBasedxPrintStyle.DefaultStyleGlyph: TBitmap; +begin + if FDefaultStyleGlyph = nil then + begin + FDefaultStyleGlyph := TBitmap.Create; + InitializeDefaultStyleGlyph(FDefaultStyleGlyph); + end; + Result := FDefaultStyleGlyph; +end; + +procedure TBasedxPrintStyle.AfterPrinting; +begin + DoAfterPrinting; +end; + +procedure TBasedxPrintStyle.BeforePrinting; +begin + DoBeforePrinting; +end; + +procedure TBasedxPrintStyle.GetFilteredPapers(AStrings: TStrings); +var + Papers: TStrings; + I: Integer; + Paper: TdxPaperInfo; +begin + if AStrings = nil then Exit; + + AStrings.BeginUpdate; + try + Papers := dxPrintDevice.Papers; + if Papers = nil then Exit; + + for I := 0 to Papers.Count - 1 do + begin + Paper := TdxPaperInfo(Papers.Objects[I]); + if IsSupportedPaper(Paper) then + AStrings.AddObject(Paper.Name, Paper); + if Paper.DMPaper = DMPAPER_USER then + begin + Paper.Width := PrinterPage.PageSizeLoMetric.X; + Paper.Height := PrinterPage.PageSizeLoMetric.Y; + end; + end; + finally + AStrings.EndUpdate; + end; +end; + +function TBasedxPrintStyle.PageSetup: Boolean; +var + PreviewBtnClicked, PrintBtnClicked: Boolean; +begin + Result := PageSetup(0, False, False, PreviewBtnClicked, PrintBtnClicked); +end; + +function TBasedxPrintStyle.PageSetup(AnActivePageIndex: Integer; AShowPreviewBtn, AShowPrintBtn: Boolean; + out APreviewBtnClicked, APrintBtnClicked: Boolean): Boolean; + + function GetDialog(out ANewCreated: Boolean): TdxPageSetupDialog; + begin + if StyleManager <> nil then + Result := StyleManager.PageSetupDialog + else + Result := nil; + ANewCreated := Result = nil; + if ANewCreated then + Result := TdxPageSetupDialog.Create(nil); + end; + +var + Dialog: TdxPageSetupDialog; + NewCreated: Boolean; + PrevStyle: TBasedxPrintStyle; +begin + Dialog := GetDialog(NewCreated); + try + PrevStyle := Dialog.PrintStyle; + Dialog.PrintStyle := Self; + Dialog.ActivePageIndex := AnActivePageIndex; + + if not AShowPreviewBtn then + Dialog.ButtonsVisible := Dialog.ButtonsVisible - [psbPreview]; + + if not AShowPrintBtn then + Dialog.ButtonsVisible := Dialog.ButtonsVisible - [psbPrint]; + + if StyleManager = nil then + Dialog.OptionsVisible := Dialog.OptionsVisible - [psoStyleCaption]; + + Result := Dialog.Execute; + Dialog.PrintStyle := PrevStyle; + + APreviewBtnClicked := AShowPreviewBtn and Dialog.PreviewBtnClicked; + APrintBtnClicked := AShowPrintBtn and Dialog.PrintBtnClicked; + finally + if NewCreated then Dialog.Free; + end; +end; + +function TBasedxPrintStyle.PageSetup(AnActivePageIndex: Integer; + APreviewBtnClicked, APrintBtnClicked: PBoolean): Boolean; +var + ShowPreviewBtn, ShowPrintBtn: Boolean; + PreviewBtnClicked, PrintBtnClicked: Boolean; +begin + ShowPreviewBtn := APreviewBtnClicked <> nil; + ShowPrintBtn := APrintBtnClicked <> nil; + Result := PageSetup(0, ShowPreviewBtn, ShowPrintBtn, PreviewBtnClicked, PrintBtnClicked); + + if ShowPreviewBtn then + APreviewBtnClicked^ := PreviewBtnClicked; + + if ShowPrintBtn then + APrintBtnClicked^ := PrintBtnClicked; +end; + +function TBasedxPrintStyle.PageSetupEx(AnActivePageIndex: Integer; + APreviewBtnClicked, APrintBtnClicked: PBoolean): Boolean; +var + ShowPreviewBtn, ShowPrintBtn: Boolean; + PreviewBtnClicked, PrintBtnClicked: Boolean; +begin + ShowPreviewBtn := APreviewBtnClicked <> nil; + ShowPrintBtn := APrintBtnClicked <> nil; + Result := PageSetup(0, ShowPreviewBtn, ShowPrintBtn, PreviewBtnClicked, PrintBtnClicked); + + if ShowPreviewBtn then + APreviewBtnClicked^ := PreviewBtnClicked; + + if ShowPrintBtn then + APrintBtnClicked^ := PrintBtnClicked; +end; + +function TBasedxPrintStyle.SetupOptions: Boolean; +begin + Result := False; +end; + +procedure TBasedxPrintStyle.RestoreDefaultGlyph; +begin + FIsStyleGlyphAssigned := False; + DesignerModified; + DesignerUpdate(False); +end; + +procedure TBasedxPrintStyle.RestoreDefaults; +begin + AllowChangeHFText := True; + AllowChangeMargins := True; + AllowChangeOrientation := True; + AllowChangePaper := True; + AllowChangeScale := True; + AllowCustomPaperSizes := True; + PrinterPage.RestoreDefaults; + + FIsDescriptionAssigned := False; + FIsStyleCaptionAssigned := False; + FIsStyleGlyphAssigned := False; +end; + +function TBasedxPrintStyle.GetAllowChangeHFText: Boolean; +begin + Result := FAllowChangeHFText; +end; + +function TBasedxPrintStyle.GetAllowChangeMargins: Boolean; +begin + Result := FAllowChangeMargins; +end; + +function TBasedxPrintStyle.GetAllowChangePaper: Boolean; +begin + Result := FAllowChangePaper; +end; + +function TBasedxPrintStyle.GetAllowChangeScale: Boolean; +begin + Result := FAllowChangeScale; +end; + +procedure TBasedxPrintStyle.SetAllowChangeHFText(Value: Boolean); +begin + FAllowChangeHFText := Value; +end; + +function TBasedxPrintStyle.GetAllowChangeOrientation: Boolean; +begin + Result := FAllowChangeOrientation; +end; + +function TBasedxPrintStyle.GetAllowCustomPaperSizes: Boolean; +begin + Result := FAllowCustomPaperSizes; +end; + +procedure TBasedxPrintStyle.SetAllowChangeMargins(Value: Boolean); +begin + FAllowChangeMargins := Value; +end; + +procedure TBasedxPrintStyle.SetAllowChangeOrientation(Value: Boolean); +begin + FAllowChangeOrientation := Value; +end; + +procedure TBasedxPrintStyle.SetAllowChangePaper(Value: Boolean); +begin + FAllowChangePaper := Value; +end; + +procedure TBasedxPrintStyle.SetAllowChangeScale(Value: Boolean); +begin + FAllowChangeScale := Value; +end; + +procedure TBasedxPrintStyle.SetAllowCustomPaperSizes(Value: Boolean); +begin + FAllowCustomPaperSizes := Value; +end; + +function TBasedxPrintStyle.CreatePrinterPage: TdxPrinterPage; +begin + Result := GetPrinterPageClass.Create; + InitializePrinterPage(Result); +end; + +function TBasedxPrintStyle.GetPrinterPageClass: TdxPrinterPageClass; +begin + Result := TdxPrintStylePrinterPage; +end; + +procedure TBasedxPrintStyle.InitializePrinterPage(APrinterPage: TdxPrinterPage); +begin + TdxPrintStylePrinterPage(APrinterPage).FPrintStyle := Self; +end; + +procedure TBasedxPrintStyle.DoAfterPrinting; +begin +end; + +procedure TBasedxPrintStyle.DoBeforePrinting; +begin +end; + +procedure TBasedxPrintStyle.DoDestroy; +begin + if Assigned(FOnDestroy) then FOnDestroy(Self); +end; + +function TBasedxPrintStyle.IsSupportedPaper(const APaper: TdxPaperInfo): Boolean; +begin + Result := True; + if Assigned(FOnFilterPaper) then + begin + FOnFilterPaper(Self, APaper, Result); + if not Result and (APaper.DMPaper = PrinterPage.DMPaper) then + Result := True; + end; +end; + +procedure TBasedxPrintStyle.PageParamsChanged(AUpdateCodes: TdxPrinterPageUpdateCodes); +begin + if StyleManager <> nil then + StyleManager.PageParamsChanged(Self, AUpdateCodes); +end; + +procedure TBasedxPrintStyle.InitializeDefaultStyleGlyph(ABitmap: TBitmap); +begin +end; + +procedure TBasedxPrintStyle.StyleGlyphChanged(Sender: TObject); +begin + FIsStyleGlyphAssigned := True; + DesignerUpdate(False); +end; + +function TBasedxPrintStyle.GetDescription: string; +begin + if FIsDescriptionAssigned then + Result := FDescription + else + Result := DefaultDescription; +end; + +function TBasedxPrintStyle.GetIndex: Integer; +begin + if StyleManager <> nil then + Result := StyleManager.IndexOfStyle(Self) + else + Result := -1; +end; + +function TBasedxPrintStyle.GetIsCurrentStyle: Boolean; +begin + Result := (StyleManager <> nil) and (StyleManager.CurrentStyle = Self); +end; + +function TBasedxPrintStyle.GetStyleCaption: string; +begin + if FIsStyleCaptionAssigned then + Result := FStyleCaption + else + Result := DefaultStyleCaption; +end; + +function TBasedxPrintStyle.GetStyleGlyph: TBitmap; +begin + if FIsStyleGlyphAssigned or (csLoading in ComponentState) then + Result := FStyleGlyph + else + Result := DefaultStyleGlyph; +end; + +function TBasedxPrintStyle.IsDescriptionStored: Boolean; +begin + Result := FIsDescriptionAssigned and (FDescription <> DefaultDescription); +end; + +function TBasedxPrintStyle.IsStyleCaptionStored: Boolean; +begin + Result := FIsStyleCaptionAssigned and (FStyleCaption <> DefaultStyleCaption); +end; + +function TBasedxPrintStyle.IsStyleGlyphStored: Boolean; +begin + Result := FIsStyleGlyphAssigned and not dxPSUtl.dxAreGraphicsEqual(FStyleGlyph, DefaultStyleGlyph); +end; + +procedure TBasedxPrintStyle.SetBuiltIn(Value: Boolean); +begin + FBuiltIn := Value; +end; + +procedure TBasedxPrintStyle.SetDescription(const Value: string); +begin + if Description <> Value then + begin + FDescription := Value; + FIsDescriptionAssigned := True; + end; +end; + +procedure TBasedxPrintStyle.SetImageIndex(Value: Integer); +begin + if FImageIndex <> Value then + begin + FImageIndex := Value; + if (StyleManager <> nil) and (StyleManager.Images <> nil) then + DesignerUpdate(False); + end; +end; + +procedure TBasedxPrintStyle.SetIndex(Value: Integer); +var + CurIndex: Integer; +begin + if FStyleManager = nil then Exit; + if Value < 0 then Value := 0; + if Value > StyleManager.Count - 1 then + Value := StyleManager.Count - 1; + CurIndex := GetIndex; + if CurIndex <> Value then + StyleManager.MoveStyle(CurIndex, Value); +end; + +procedure TBasedxPrintStyle.SetIsCurrentStyle(Value: Boolean); +begin + if Value then + if not (csReading in ComponentState) and (StyleManager <> nil) then + StyleManager.CurrentStyle := Self; +end; + +procedure TBasedxPrintStyle.SetPrinterPage(Value: TdxPrinterPage); +begin + PrinterPage.Assign(Value); +end; + +procedure TBasedxPrintStyle.SetStyleCaption(const Value: string); +begin + if StyleCaption <> Value then + begin + FStyleCaption := Value; + FIsStyleCaptionAssigned := True; + end; +end; + +procedure TBasedxPrintStyle.SetStyleGlyph(Value: TBitmap); +begin + FStyleGlyph.Assign(Value); +end; + +procedure TBasedxPrintStyle.SetStyleManager(Value: TdxPrintStyleManager); +begin + if FStyleManager <> Value then + begin + if FStyleManager <> nil then + FStyleManager.RemoveStyle(Self); + if Value <> nil then + Value.InsertStyle(Self); + end; +end; + +procedure TBasedxPrintStyle.DesignerModified; +begin + if StyleManager <> nil then StyleManager.DesignerModified; +end; + +procedure TBasedxPrintStyle.DesignerUpdate(TheAll: Boolean); +begin + if StyleManager <> nil then + if TheAll then + StyleManager.DesignerUpdate(nil) + else + StyleManager.DesignerUpdate(Self); +end; + +function TBasedxPrintStyle.IsDesigning: Boolean; +begin + Result := csDesigning in ComponentState; +end; + +function TBasedxPrintStyle.IsLoading: Boolean; +begin + Result := csLoading in ComponentState; +end; + +procedure TBasedxPrintStyle.ReadData(Reader: TReader); +begin + FBuiltIn := Reader.ReadBoolean; +end; + +procedure TBasedxPrintStyle.ReadIsDescriptionAssigned(Reader: TReader); +begin + FIsDescriptionAssigned := Reader.ReadBoolean; +end; + +procedure TBasedxPrintStyle.ReadIsStyleCaptionAssigned(Reader: TReader); +begin + FIsStyleCaptionAssigned := Reader.ReadBoolean; +end; + +procedure TBasedxPrintStyle.ReadIsStyleGlyphAssigned(Reader: TReader); +begin + FIsStyleGlyphAssigned := Reader.ReadBoolean; +end; + +procedure TBasedxPrintStyle.WriteData(Writer: TWriter); +begin + Writer.WriteBoolean(FBuiltIn); +end; + +procedure TBasedxPrintStyle.WriteIsDescriptionAssigned(Writer: TWriter); +begin + Writer.WriteBoolean(FIsDescriptionAssigned); +end; + +procedure TBasedxPrintStyle.WriteIsStyleCaptionAssigned(Writer: TWriter); +begin + Writer.WriteBoolean(FIsStyleCaptionAssigned); +end; + +procedure TBasedxPrintStyle.WriteIsStyleGlyphAssigned(Writer: TWriter); +begin + Writer.WriteBoolean(FIsStyleGlyphAssigned); +end; + +{ TdxPrintStyleManager } + +constructor TdxPrintStyleManager.Create(AOwner: TComponent); +begin + inherited; + FAutoHFTextEntries := CreateAutoHFTextEntries; + FStyles := TList.Create; + FWindowHandle := dxPSUtl.dxAllocatehWnd(WndProc); +end; + +destructor TdxPrintStyleManager.Destroy; +begin + try + if AllowAutoSave then + try + SaveToFile(StorageName); + finally + FAlreadySaved := True; + end; + finally + {$IFNDEF DELPHI5} + Destroying; + {$ENDIF} + dxPSUtl.dxDeallocateHWnd(FWindowHandle); + + FreeAndNil(FDesigner); + FreeAndNilStyles; + if not IsDesigning and (RegistryPath <> '') then + SaveToRegistry(RegistryPath); + FreeAndNil(FAutoHFTextEntries); + inherited; + end; +end; + +procedure TdxPrintStyleManager.Assign(Source: TPersistent); +begin + if Source is TdxPrintStyleManager then + with TdxPrintStyleManager(Source) do + begin + Self.AutoHFTextEntries := AutoHFTextEntries; + Self.AssignStyles(TdxPrintStyleManager(Source)); + + Self.FIsCloneStyleCaptionPrefixAssigned := FIsCloneStyleCaptionPrefixAssigned; + Self.FIsTitleAssigned := FIsTitleAssigned; + end + else + inherited; +end; + +procedure TdxPrintStyleManager.Loaded; +begin + inherited; + if not IsDesigning and (RegistryPath <> '') then + LoadFromRegistry(RegistryPath); + + if not FInternalStreaming and not IsDesigning and AutoSave then + LoadFromFile(StorageName); +end; + +procedure TdxPrintStyleManager.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if Operation = opRemove then + begin + if AComponent = Images then Images := nil; + if AComponent = PageSetupDialog then PageSetupDialog := nil; + end; +end; + +procedure TdxPrintStyleManager.ReadState(Reader: TReader); +begin + if FInternalStreaming then + Reader.OnSetName := SetNameHandler; + try + inherited; + finally + if FInternalStreaming then + Reader.OnSetName := nil; + end; +end; + +procedure TdxPrintStyleManager.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('IsTitleAssigned', ReadIsTitleAssigned, WriteIsTitleAssigned, + FIsTitleAssigned and (Title = '')); + Filer.DefineProperty('IsCloneStyleCaptionPrefixAssigned', + ReadIsCloneStyleCaptionPrefixAssigned, WriteIsCloneStyleCaptionPrefixAssigned, + FIsCloneStyleCaptionPrefixAssigned and (CloneStyleCaptionPrefix = '')); +end; + +procedure TdxPrintStyleManager.GetChildren(Proc: TGetChildProc; Root: TComponent); +var + I: Integer; + Style: TBasedxPrintStyle; +begin + for I := 0 to Count - 1 do + begin + Style := Styles[I]; + if (Root = Style.Owner) or (FInternalStreaming and (Root = Style.StyleManager)) then + Proc(Style); + end; +end; + +procedure TdxPrintStyleManager.SetChildOrder(Child: TComponent; Order: Integer); +begin + inherited; + if FStyles.IndexOf(Child) > -1 then + (Child as TBasedxPrintStyle).Index := Order; +end; + +procedure TdxPrintStyleManager.AutoHFTextEntriesChanged(Sender: TObject); +var + Event: TdxEvent; +begin + Event := TdxHFTextEntriesChangedEvent.Create(Self); + dxPSProcessEvent(Event); +end; + +procedure TdxPrintStyleManager.OnAutoHFTextEntryClick(Sender: TObject); +var + S: string; + Event: TdxEvent; +begin + try + S := AutoHFTextEntries[dxPSAutoHFTextMenuBuilderFactory.ActiveBuilder.ExtractAutoHFTextEntryIndexFromObj(Sender)]; + Event := TdxHFTextEntryChooseEvent.Create(Self, S); + dxPSProcessEvent(Event); + except + Application.HandleException(Self); + end; +end; + +procedure TdxPrintStyleManager.OnEditAutoHFTextEntriesClick(Sender: TObject); +begin + ShowAutoHFTextEntriesDlg; +end; + +procedure TdxPrintStyleManager.WndProc(var Message: TMessage); +var + I: Integer; +begin + with Message do + begin + case Msg of + WM_SETTINGCHANGE: + // if (PChar(message.lParam) = 'devices') then + begin + RereadDefaultPrinterPage; + for I := 0 to Count - 1 do + TdxPrintStylePrinterPage(Styles[I].PrinterPage).SynchronizeMeasurementUnits; + DesignerModified; + end; + + WMPS_PRINTSTYLELISTCHANGED: + begin + StyleListChanged; + ChangeCurrentStyle; + end; + end; + Result := DefWindowProc(FWindowHandle, Msg, WParam, LParam); + end; +end; + +procedure TdxPrintStyleManager.SetNameHandler(Reader: TReader; Component: TComponent; + var Name: string); +begin + if (Component is TBasedxPrintStyle) and (StyleByName(Name) <> nil) then + begin + if FLoadedExistingStyles = nil then + FLoadedExistingStyles := TStringList.Create; + FLoadedExistingStyles.AddObject(Name, Component); + Name := ''; + end; +end; + +procedure TdxPrintStyleManager.ReadIsCloneStyleCaptionPrefixAssigned(Reader: TReader); +begin + FIsCloneStyleCaptionPrefixAssigned := Reader.ReadBoolean; +end; + +procedure TdxPrintStyleManager.ReadIsTitleAssigned(Reader: TReader); +begin + FIsTitleAssigned := Reader.ReadBoolean; +end; + +procedure TdxPrintStyleManager.WriteIsCloneStyleCaptionPrefixAssigned(Writer: TWriter); +begin + Writer.WriteBoolean(FIsCloneStyleCaptionPrefixAssigned); +end; + +procedure TdxPrintStyleManager.WriteIsTitleAssigned(Writer: TWriter); +begin + Writer.WriteBoolean(FIsTitleAssigned); +end; + +function TdxPrintStyleManager.IsDesigning: Boolean; +begin + Result := csDesigning in ComponentState; +end; + +function TdxPrintStyleManager.IsDestroying: Boolean; +begin + Result := csDestroying in ComponentState; +end; + +function TdxPrintStyleManager.IsLoading: Boolean; +begin + Result := csLoading in ComponentState; +end; + +function TdxPrintStyleManager.AllowAutoSave: Boolean; +begin + Result := AutoSave and not IsDesigning and IsDestroying and not FAlreadySaved; +end; + +procedure TdxPrintStyleManager.DesignerUpdate(AStyle: TBasedxPrintStyle); +begin + if IsDesigning and (Designer <> nil) then + Designer.Update(AStyle); +end; + +procedure TdxPrintStyleManager.DesignerModified; +begin + if IsDesigning and (Designer <> nil) then + Designer.Modified; +end; + +procedure TdxPrintStyleManager.SetName(const NewName: TComponentName); +var + OldName, ItemName, AName: string; + P, I: Integer; +begin + OldName := Name; + inherited SetName(NewName); + if IsDesigning and (Count > 0) then + try + if Designer <> nil then Designer.BeginUpdate; + try + for I := 0 to Count - 1 do + begin + ItemName := Styles[I].Name; + P := Pos(OldName, ItemName); + if P = 0 then + AName := Name + ItemName + else + AName := Copy(ItemName, 1, P - 1) + Name + + Copy(ItemName, P + Length(OldName), Length(ItemName) - P - Length(OldName) + 1); + Styles[I].Name := AName; + end; + finally + if Designer <> nil then Designer.EndUpdate; + end; + except + on EComponentError do ; {Ignore rename errors } + end; +end; + +procedure TdxPrintStyleManager.SetPageSetupDialog(Value: TdxPageSetupDialog); +begin + if FPageSetupDialog <> Value then + begin + FPageSetupDialog := Value; + if Value <> nil then Value.FreeNotification(Self); + end; +end; + +function TdxPrintStyleManager.GetStyle(Index: Integer): TBasedxPrintStyle; +begin + Result := TBasedxPrintStyle(FStyles[Index]); +end; + +function TdxPrintStyleManager.GetTitle: string; +begin + if FIsTitleAssigned then + Result := FTitle + else + Result := DefaultTitle; +end; + +function TdxPrintStyleManager.IsAutoHFTextEntriesStored: Boolean; +begin + Result := not AutoHFTextEntries.Equals(DefaultAutoHFTextEntries); +end; + +function TdxPrintStyleManager.IsCloneStyleCaptionPrefixStored: Boolean; +begin + Result := FIsCloneStyleCaptionPrefixAssigned and (FCloneStyleCaptionPrefix <> DefaultCloneStyleCaptionPrefix); +end; + +function TdxPrintStyleManager.IsTitleStored: Boolean; +begin + Result := FIsTitleAssigned and (FTitle <> DefaultTitle); +end; + +procedure TdxPrintStyleManager.SetStyle(Index: Integer; Value: TBasedxPrintStyle); +begin + Styles[Index].Assign(Value); +end; + +procedure TdxPrintStyleManager.SetTitle(const Value: string); +begin + if Title <> Value then + begin + FTitle := Value; + FIsTitleAssigned := True; + end; +end; + +procedure TdxPrintStyleManager.SetImages(Value: TImageList); +begin + if FImages <> Value then + begin + FImages := Value; + if FImages <> nil then + FImages.FreeNotification(Self); + DesignerUpdate(nil); + end; +end; + +procedure TdxPrintStyleManager.AssignStyles(Source: TdxPrintStyleManager); +var + I: Integer; + Style: TBasedxPrintStyle; +begin + BeginUpdate; + try + Clear; + Images := Source.Images; + for I := 0 to Source.Count - 1 do + begin + Style := Source[I]; + AddStyle(Style.StyleClass).Assign(Style); + end; + finally + EndUpdate; + end; +end; + +function TdxPrintStyleManager.IndexOfStyle(Value: TBasedxPrintStyle): Integer; +begin + Result := FStyles.IndexOf(Value); +end; + +function TdxPrintStyleManager.StyleByCaption(const ACaption: string): TBasedxPrintStyle; +var + I: Integer; +begin + for I := 0 to Count - 1 do + if dxSameText(ACaption, Styles[I].StyleCaption) then + begin + Result := Styles[I]; + Exit; + end; + Result := nil; +end; + +function TdxPrintStyleManager.StyleByName(const AName: string): TBasedxPrintStyle; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Styles[I]; + if CompareText(AName, Result.Name) = 0 then Exit; + end; + Result := nil; +end; + +procedure TdxPrintStyleManager.Delete(Index: Integer); +var + Style: TBasedxPrintStyle; +begin + if (Index > -1) and (Index < Count) then + begin + Style := Styles[Index]; + Style.Free; + end; +end; + +procedure TdxPrintStyleManager.Clear; +begin + BeginUpdate; + try + while Count > 0 do Delete(Count - 1); + finally + EndUpdate; + end; +end; + +function TdxPrintStyleManager.NonBuiltInsExists: Boolean; +var + I: Integer; +begin + Result := True; + for I := 0 to Count - 1 do + if not Styles[I].BuiltIn then Exit; + Result := False; +end; + +procedure TdxPrintStyleManager.DeleteNonBuiltIns; +var + I: Integer; +begin + BeginUpdate; + try + for I := Count - 1 downto 0 do + if not Styles[I].BuiltIn then Delete(I); + finally + EndUpdate; + end; +end; + +function TdxPrintStyleManager.BeginClone(AIndex: Integer): TBasedxPrintStyle; +var + StyleClass: TdxPrintStyleClass; +begin + Result := nil; + if (AIndex < -1) or (AIndex > Count - 1) then Exit; + if AIndex = -1 then + StyleClass := dxDefaultPrintStyleClass + else + StyleClass := Styles[AIndex].StyleClass; + if StyleClass = nil then Exit; + BeginUpdate; + Result := AddStyle(StyleClass); + Result.Index := AIndex + 1; + Include(Result.FState, pssCopy); + if AIndex > -1 then + begin + Result.Assign(Styles[AIndex]); + SetNewStyleCaption(Result, AIndex); + end; +end; + +procedure TdxPrintStyleManager.EndClone(AStyle: TBasedxPrintStyle); +begin +// CurrentStyle := AStyle; + if IsDesigning then + AStyle.Name := dxPSPrintStyleUniqueName(Self, AStyle); + EndUpdate; + Exclude(AStyle.FState, pssCopy); +end; + +procedure TdxPrintStyleManager.SetNewStyleCaption(AStyle: TBasedxPrintStyle; + AIndex: Integer); + + function CheckName(const Source: string): Boolean; + var + I: Integer; + begin + for I := 0 to Count - 1 do + if Styles[I] <> AStyle then + begin + Result := not dxSameStr(Source, Styles[I].StyleCaption); + if not Result then Exit; + end; + Result := True; + end; + +const + MaskCount = 4; + Mask: array[0..MaskCount - 1] of string = ('(%d) ', '(%d)', '%d ', '%d'); +var + S, S2: string; + OkName: Boolean; + I, K: Integer; +begin + OkName := False; + if not OkName then + begin + S := CloneStyleCaptionPrefix + Styles[AIndex].StyleCaption; + for K := 0 to MaskCount - 1 do + begin + I := Pos(Mask[K], S); + if I > 0 then + begin + System.Delete(S, I, Length(Mask[K])); + Break; + end; + end; + if Length(S) > dxMaxStyleCaption then SetLength(S, dxMaxStyleCaption); + OkName := CheckName(S); + if not OkName then + begin + S2 := CloneStyleCaptionPrefix + Styles[AIndex].StyleCaption; + if (Length(S2) > dxMaxStyleCaption) then SetLength(S2, dxMaxStyleCaption); + I := 2; + while not OkName and (I < MaxInt) do + begin + try + S := Format(S2, [I]); + except + S := S2; + end; + if Length(S) > dxMaxStyleCaption then + SetLength(S, dxMaxStyleCaption); + if dxSameStr(S, S2) then + begin + AStyle.StyleCaption := S; + Exit; + end; + OkName := CheckName(S); + Inc(I); + end; + end; + end; + if OkName then AStyle.StyleCaption := S; +end; + +function TdxPrintStyleManager.AddStyle(AStyleClass: TdxPrintStyleClass): TBasedxPrintStyle; +begin + Result := AddStyleEx(AStyleClass, Self.Owner); +end; + +function TdxPrintStyleManager.AddStyleEx(AStyleClass: TdxPrintStyleClass; + AOwner: TComponent): TBasedxPrintStyle; +begin + Result := nil; + if AStyleClass = nil then + Exit; + Result := AStyleClass.Create(AOwner); + Result.StyleManager := Self; +end; + +procedure TdxPrintStyleManager.ResyncCurrentStyle(AIndex: Integer); +begin + if AIndex > Count - 1 then + AIndex := Count - 1; + if AIndex < 0 then + begin + FCurrentStyle := nil; + ChangeCurrentStyle; + end + else + CurrentStyle := Styles[AIndex]; +end; +procedure TdxPrintStyleManager.FreeAndNilStyles; +begin + Clear; + FreeAndNil(FStyles); +end; + +procedure TdxPrintStyleManager.InsertStyle(Value: TBasedxPrintStyle); +begin + FStyles.Add(Value); + Value.FStyleManager := Self; + if Count = 1 then + CurrentStyle := Value; + StyleListChanged; +end; + +procedure TdxPrintStyleManager.MoveStyle(ACurIndex, ANewIndex: Integer); +begin + FStyles.Move(ACurIndex, ANewIndex); + DesignerUpdate(nil); +end; + +procedure TdxPrintStyleManager.RemoveStyle(Value: TBasedxPrintStyle); +var + Index: Integer; +begin + if FCurrentStyle = Value then + Index := Value.Index + else + Index := -1; + FStyles.Remove(Value); + Value.FStyleManager := nil; + if Index <> -1 then + ResyncCurrentStyle(Index); + StyleListChanged; +end; + +function TdxPrintStyleManager.GetCloneStyleCaptionPrefix: string; +begin + if FIsCloneStyleCaptionPrefixAssigned then + Result := FCloneStyleCaptionPrefix + else + Result := DefaultCloneStyleCaptionPrefix; +end; + +function TdxPrintStyleManager.GetCount: Integer; +begin + Result := FStyles.Count; +end; + +procedure TdxPrintStyleManager.RestoreDefaultAutoHFTextEntries; +begin + AutoHFTextEntries.Assign(DefaultAutoHFTextEntries); +end; + +procedure TdxPrintStyleManager.RestoreDefaults; +begin + BeginUpdate; + try + DoRestoreDefaults; + finally + EndUpdate; + end; +end; + +procedure TdxPrintStyleManager.RestoreDefaultStyles; +var + I: Integer; +begin + BeginUpdate; + try + for I := 0 to Count - 1 do + Styles[I].RestoreDefaults; + finally + EndUpdate; + end; +end; + +procedure TdxPrintStyleManager.LoadFromFile(const AName: string); +var + AStream: TFileStream; +begin + if (AName <> '') and FileExists(AName) then + begin + AStream := TFileStream.Create(AName, fmOpenRead or fmShareDenyWrite); + try + LoadFromStream(AStream); + finally + AStream.Free; + end; + end; +end; + +procedure TdxPrintStyleManager.LoadFromStream(AStream: TStream); + + procedure CheckExistingStyles(AExistingStyleCount: Integer); + var + I, ALoadedExistingStyleIndex: Integer; + AStyle: TBasedxPrintStyle; + begin + for I := AExistingStyleCount - 1 downto 0 do + begin + if FLoadedExistingStyles = nil then + ALoadedExistingStyleIndex := -1 + else + ALoadedExistingStyleIndex := FLoadedExistingStyles.IndexOf(Styles[I].Name); + if ALoadedExistingStyleIndex = -1 then + Styles[I].Free + else + begin + AStyle := TBasedxPrintStyle(FLoadedExistingStyles.Objects[ALoadedExistingStyleIndex]); + Styles[I].Assign(AStyle); + AStyle.Free; + end; + end; + FreeAndNil(FLoadedExistingStyles); + end; + +var + Version: Integer; + M: TMemoryStream; + AExistingStyleCount, I: Integer; + Style: TBasedxPrintStyle; + CurrentStyleIndex: Integer; +begin + AStream.ReadBuffer(Version , SizeOf(Integer)); + if Version <> Self.Version then Exit; + BeginUpdate; + try + M := TMemoryStream.Create; + try + AExistingStyleCount := Count; + FInternalStreaming := True; + try + M.WriteComponent(Self); + try + try + AStream.ReadBuffer(CurrentStyleIndex , SizeOf(Integer)); + AStream.ReadComponent(Self); + Self.CurrentStyleIndex := CurrentStyleIndex; + finally + CheckExistingStyles(AExistingStyleCount); + end; + except + Clear; // links to styles in other components will be lost + M.Position := 0; + M.ReadComponent(Self); + Application.HandleException(Self); + end; + finally + Loaded; + for I := 0 to Count - 1 do + begin + Style := Styles[I]; + if Style.Owner = Self then + begin + RemoveComponent(Style); + Owner.InsertComponent(Style); + end; + Style.Loaded; + end; + FInternalStreaming := False; + end; + finally + M.Free; + end; + finally + EndUpdate; + end; +end; + +procedure TdxPrintStyleManager.SaveToFile(const AName: string); +var + AStream: TFileStream; +begin + if ValidateFileName(AName) then + begin + AStream := TFileStream.Create(AName, fmCreate or fmShareDenyWrite); + try + SaveToStream(AStream); + finally + AStream.Free; + end; + end; +end; + +procedure TdxPrintStyleManager.SaveToStream(AStream: TStream); +var + ACurrentStyleIndex: Integer; +begin + FInternalStreaming := True; + try + AStream.WriteBuffer(Version , SizeOf(Integer)); + ACurrentStyleIndex := CurrentStyleIndex; + AStream.WriteBuffer(ACurrentStyleIndex , SizeOf(Integer)); + AStream.WriteComponent(Self); + finally + FInternalStreaming := False; + end; +end; + +function TdxPrintStyleManager.CreateAutoHFTextEntries: TStrings; +begin + FAutoHFTextEntries := TStringList.Create; + with TStringList(FAutoHFTextEntries) do + begin + Duplicates := dupIgnore; + Assign(DefaultAutoHFTextEntries); + OnChange := AutoHFTextEntriesChanged; + end; + Result := FAutoHFTextEntries; +end; + +procedure TdxPrintStyleManager.DoRestoreDefaults; +begin + RestoreDefaultAutoHFTextEntries; + RestoreDefaultStyles; + AutoSave := False; + FIsCloneStyleCaptionPrefixAssigned := False; + FIsTitleAssigned := False; +end; + +procedure TdxPrintStyleManager.ChangeCurrentStyle; +begin + if (FUpdateCount = 0) and not IsLoading and not IsDestroying then + if Assigned(FOnChangeCurrentStyle) then FOnChangeCurrentStyle(Self); +end; + +procedure TdxPrintStyleManager.StyleListChanged; +var + Event: TdxEvent; +begin + if (FUpdateCount = 0) and not IsLoading and not IsDestroying then + begin + if Assigned(FOnStyleListChanged) then FOnStyleListChanged(Self); + Event := TdxSMStyleListChangedEvent.Create(Self); + dxPSProcessEvent(Event); + end; +end; + +procedure TdxPrintStyleManager.BeginUpdate; +begin + Inc(FUpdateCount); +end; + +procedure TdxPrintStyleManager.EndUpdate; +begin + if FUpdateCount <> 0 then + begin + Dec(FUpdateCount); + if FUpdateCount = 0 then + begin + StyleListChanged; + ChangeCurrentStyle; + end; + end; +end; + +function TdxPrintStyleManager.DefaultCloneStyleCaptionPrefix: string; +begin + Result := cxGetResourceString(@sdxCloneStyleCaptionPrefix); +end; + +function TdxPrintStyleManager.DefaultTitle: string; +begin + Result := cxGetResourceString(@sdxDefinePrintStylesCaption); +end; + +procedure TdxPrintStyleManager.PageParamsChanged(APrintStyle: TBasedxPrintStyle; + AUpdateCodes: TdxPrinterPageUpdateCodes); +var + Event: TdxEvent; +begin + Event := TdxSMPageParamsChangedEvent.Create(Self, APrintStyle, AUpdateCodes); + dxPSProcessEvent(Event); +end; + +procedure TdxPrintStyleManager.SetAutoHFTextEntries(Value: TStrings); +begin + AutoHFTextEntries.Assign(Value); +end; + +procedure TdxPrintStyleManager.SetCloneStyleCaptionPrefix(const Value: string); +begin + if CloneStyleCaptionPrefix <> Value then + begin + FCloneStyleCaptionPrefix := Value; + FIsCloneStyleCaptionPrefixAssigned := True; + end; +end; + +procedure TdxPrintStyleManager.SetCurrentStyle(Value: TBasedxPrintStyle); +begin + if (FCurrentStyle <> Value) and (IndexOfStyle(Value) <> -1) then + begin + FCurrentStyle := Value; + PageParamsChanged(Value, ucAll); + ChangeCurrentStyle; + DesignerUpdate(Value);//nil); + end; +end; + +function TdxPrintStyleManager.GetCurrentStyleIndex: Integer; +begin + if CurrentStyle <> nil then + Result := CurrentStyle.Index + else + Result := -1; +end; + +function TdxPrintStyleManager.GetRegistryPath: string; +begin + if dxPSEngine.RealRegistryPath <> '' then + Result := dxPSEngine.RealRegistryPath + sdxAutoHFTextEntries + '\' + Name + else + Result := ''; +end; + +procedure TdxPrintStyleManager.SetCurrentStyleIndex(Value: Integer); +begin + if Value < 0 then Value := 0; + if Value > Count - 1 then + Value := Count - 1; + if Value <> CurrentStyleIndex then + CurrentStyle := Styles[Value]; +end; + +procedure TdxPrintStyleManager.BuildAutoHFTextEntriesMenu(ARootItem: TComponent; + AData: Pointer; AIncludeSetupAutoHFTextEntriesItem: Boolean = True); +var + MenuBuilder: TAbstractdxPSAutoHFTextMenuBuilder; +begin + MenuBuilder := dxPSAutoHFTextMenuBuilderFactory.ActiveBuilder.Create; + try + try + MenuBuilder.BuildAutoHFTextEntriesMenu(ARootItem, AData, AIncludeSetupAutoHFTextEntriesItem, + AutoHFTextEntries, OnAutoHFTextEntryClick, OnEditAutoHFTextEntriesClick); + except + Application.HandleException(Self); + end; + finally + MenuBuilder.Free; + end; +end; + +procedure TdxPrintStyleManager.RefreshAutoHFTextEntries; +begin + FreeAndNil(FAutoHFTextEntries); +end; + +function TdxPrintStyleManager.ShowAutoHFTextEntriesDlg: Boolean; +begin + Result := dxShowAutoTextDlg(AutoHFTextEntries); +end; + +procedure TdxPrintStyleManager.LoadFromRegistry(const APath: string); +begin + dxLoadStringsFromRegistry(APath, AutoHFTextEntries); +end; + +procedure TdxPrintStyleManager.SaveToRegistry(const APath: string); +begin + dxSaveStringsToRegistry(APath, AutoHFTextEntries); +end; + +procedure TdxPrintStyleManager.DefinePrintStylesDlg(out APreviewBtnClicked, APrintBtnClicked: Boolean); +var + Data: TdxDefinePrintStylesDlgData; +begin + FillChar(Data, SizeOf(TdxDefinePrintStylesDlgData), 0); + Data.StyleManager := Self; + Data.Title := Title; + dxDefinePrintStylesDlg(Data); + + APreviewBtnClicked := Data.PreviewBtnClicked; + APrintBtnClicked := Data.PrintBtnClicked; + + DesignerUpdate(nil); + PostMessage(FWindowHandle, WMPS_PRINTSTYLELISTCHANGED, 0, 0); +end; + +procedure TdxPrintStyleManager.DefinePrintStylesDlg(APreviewBtnClicked, + APrintBtnClicked: PBoolean); +var + PreviewBtnClicked, PrintBtnClicked: Boolean; +begin + DefinePrintStylesDlg(PreviewBtnClicked, PrintBtnClicked); + + if APreviewBtnClicked <> nil then + APreviewBtnClicked^ := PreviewBtnClicked; + + if APrintBtnClicked <> nil then + APrintBtnClicked^ := PrintBtnClicked; +end; + +{ TAbstractdxStyleManagerDesigner } + +constructor TAbstractdxStyleManagerDesigner.Create(AStyleManager: TdxPrintStyleManager); +begin + inherited Create; + FStyleManager := AStyleManager; + if FStyleManager <> nil then FStyleManager.FDesigner := Self; +end; + +destructor TAbstractdxStyleManagerDesigner.Destroy; +begin + if FStyleManager <> nil then FStyleManager.FDesigner := nil; + inherited; +end; + +{ Header & footer parser functions } + +function dxProcessHFString(const Source: string): string; +begin + if dxHFFunctionLibrary <> nil then + Result := dxHFFunctionLibrary.ProcessString(Source, dxHFFormatObject) + else + Result := Source; +end; + +procedure dxGetHFFunctionsList(AStrings: TStrings); +begin + if dxHFFunctionLibrary <> nil then + dxHFFunctionLibrary.GetFunctions(AStrings); +end; + +procedure dxGetHFFunctionsListByCategory(ACategory: TdxHFFunctionCustomCategoryClass; AStrings: TStrings); +begin + if dxHFFunctionLibrary <> nil then + dxHFFunctionLibrary.GetFunctionsByCategory(ACategory, AStrings); +end; + +{ TdxHFFunctionFormatObject } + +constructor TdxHFFunctionFormatObject.Create; +begin + inherited Create; + Initialize; +end; + +procedure TdxHFFunctionFormatObject.Initialize; +begin + FDateTime := Now; + FCurrentPage := 1; + FDateFormat := LongDateFormat; + FMachineName := dxPSUtl.GetMachineName; + FPageNumberFormat := pnfNumeral; + FTimeFormat := LongTimeFormat; + FTotalPages := 1; + FUserName := dxPSUtl.GetUserName; +end; + +{ TdxHFCustomFunction } + +constructor TdxHFCustomFunction.Create; +begin + inherited Create; + FGlyph := TBitmap.Create; +end; + +destructor TdxHFCustomFunction.Destroy; +begin + FreeAndNil(FGlyph); + inherited; +end; + +procedure TdxHFCustomFunction.Assign(Source: TPersistent); +begin + if Source is TdxHFCustomFunction then + with TdxHFCustomFunction(Source) do + begin + Self.TemplateString := TemplateString; + Self.Hint := Hint; + Self.Glyph := Glyph; + end + else + inherited; +end; + +class function TdxHFCustomFunction.FunctionClass: TdxHFCustomFunctionClass; +begin + Result := TdxHFCustomFunctionClass(GetTypeData(ClassInfo)^.ClassType); +end; + +function TdxHFCustomFunction.DoProcess(const Source: string; + const AFormatObject: TdxHFFunctionFormatObject): string; +begin + if AFormatObject <> nil then + Result := ConvertFunc(Source, AFormatObject) + else + Result := Source; +end; + +procedure TdxHFCustomFunction.SetTemplateString(const Value: string); +begin + FTemplateString := Value; + if Length(FTemplateString) > 0 then + begin + if FTemplateString[1] <> dxFunctionDelimiters[False] then + FTemplateString := dxFunctionDelimiters[False] + FTemplateString; + if FTemplateString[Length(FTemplateString)] <> dxFunctionDelimiters[True] then + FTemplateString := FTemplateString + dxFunctionDelimiters[True]; + end; +end; + +procedure TdxHFCustomFunction.SetGlyph(Value: Graphics.TBitmap); +begin + Glyph.Assign(Value); +end; + +class function TdxHFCustomFunction.GetName: string; +begin + Result := cxGetResourceString(@sdxHFFunctionNameUnknown); +end; + +class function TdxHFCustomFunction.GetCategory: TdxHFFunctionCustomCategoryClass; +begin + Result := TdxHFFunctionCustomCategory; +end; + +function TdxHFCustomFunction.ConvertFunc(const Source: string; + const AFormatObject: TdxHFFunctionFormatObject): string; +begin + Result := Source; +end; + +{ TdxHFPagesFunctions } + +class function TdxHFPagesFunctions.GetCategory: TdxHFFunctionCustomCategoryClass; +begin + Result := TdxHFFunctionPagesCategory; +end; + +{ TdxHFPageNumberFunction } + +constructor TdxHFPageNumberFunction.Create; +begin + inherited; + Bitmap_LoadFromResourceName(Glyph, IDB_DXPSFUNCTION_PAGENUMBER); + TemplateString := cxGetResourceString(@sdxHFFunctionTemplatePageNumber); + Hint := cxGetResourceString(@sdxHFFunctionHintPageNumber); +end; + +function TdxHFPageNumberFunction.ConvertFunc(const Source: string; + const AFormatObject: TdxHFFunctionFormatObject): string; +var + ACurrentPage: Integer; +begin + ACurrentPage := AFormatObject.StartPageIndex + AFormatObject.CurrentPage - 1; + + case AFormatObject.PageNumberFormat of + pnfNumeral: + Result := IntToStr(ACurrentPage); + pnfChars: + Result := Int2Chars(ACurrentPage, False); + pnfUpperChars: + Result := Int2Chars(ACurrentPage, True); + pnfRoman: + Result := Int2Roman(ACurrentPage, False); + else // pnfUpperRoman + Result := Int2Roman(ACurrentPage, True); + end +end; + +class function TdxHFPageNumberFunction.GetName: string; +begin + Result := cxGetResourceString(@sdxHFFunctionNamePageNumber); +end; + +{ TdxHFTotalPagesFunction } + +constructor TdxHFTotalPagesFunction.Create; +begin + inherited; + Bitmap_LoadFromResourceName(Glyph, IDB_DXPSFUNCTION_TOTALPAGES); + TemplateString := cxGetResourceString(@sdxHFFunctionTemplateTotalPages); + Hint := cxGetResourceString(@sdxHFFunctionHintTotalPages); +end; + +function TdxHFTotalPagesFunction.ConvertFunc(const Source: string; + const AFormatObject: TdxHFFunctionFormatObject): string; +var + ATotalPages: Integer; +begin + ATotalPages := AFormatObject.StartPageIndex + AFormatObject.TotalPages - 1; + + case AFormatObject.PageNumberFormat of + pnfNumeral: + Result := IntToStr(ATotalPages); + pnfChars: + Result := Int2Chars(ATotalPages, False); + pnfUpperChars: + Result := Int2Chars(ATotalPages, True); + pnfRoman: + Result := Int2Roman(ATotalPages, False); + else // pnfUpperRoman + Result := Int2Roman(ATotalPages, True); + end +end; + +class function TdxHFTotalPagesFunction.GetName: string; +begin + Result := cxGetResourceString(@sdxHFFunctionNameTotalPages); +end; + +{ TdxHFPageOfPagesFunction } + +constructor TdxHFPageOfPagesFunction.Create; +begin + inherited; + Bitmap_LoadFromResourceName(Glyph, IDB_DXPSFUNCTION_PAGENUMBEROFPAGES); + TemplateString := cxGetResourceString(@sdxHFFunctionTemplatePageOfPages); + Hint := cxGetResourceString(@sdxHFFunctionHintPageOfPages); +end; + +function TdxHFPageOfPagesFunction.ConvertFunc(const Source: string; + const AFormatObject: TdxHFFunctionFormatObject): string; +var + CurrentPage, TotalPages: Integer; +begin + CurrentPage := AFormatObject.CurrentPage + AFormatObject.StartPageIndex - 1; + TotalPages := AFormatObject.TotalPages + AFormatObject.StartPageIndex - 1; + + case AFormatObject.PageNumberFormat of + pnfNumeral: + Result := IntToStr(CurrentPage) + ' ' + cxGetResourceString(@sdxOf) + ' ' + IntToStr(TotalPages); + pnfChars: + Result := Int2Chars(CurrentPage, False) + ' ' + cxGetResourceString(@sdxOf) + ' ' + Int2Chars(TotalPages, False); + pnfUpperChars: + Result := Int2Chars(CurrentPage, True) + ' ' + cxGetResourceString(@sdxOf) + ' ' + Int2Chars(TotalPages, True); + pnfRoman: + Result := Int2Roman(CurrentPage, False) + ' ' + cxGetResourceString(@sdxOf) + ' ' + Int2Roman(TotalPages, False); + else // pnfUpperRoman + Result := Int2Roman(CurrentPage, True) + ' ' + cxGetResourceString(@sdxOf) + ' ' + Int2Roman(TotalPages, True); + end +end; + +class function TdxHFPageOfPagesFunction.GetName: string; +begin + Result := cxGetResourceString(@sdxHFFunctionNamePageOfPages); +end; + +{ TdxHFAuthenticationFunctions } + +class function TdxHFAuthenticationFunctions.GetCategory: TdxHFFunctionCustomCategoryClass; +begin + Result := TdxHFFunctionAuthenticationCategory; +end; + +{ TdxHFMachineNameFunction } + +constructor TdxHFMachineNameFunction.Create; +begin + inherited; + Bitmap_LoadFromResourceName(Glyph, IDB_DXPSFUNCTION_MACHINENAME); + TemplateString := cxGetResourceString(@sdxHFFunctionTemplateMachineName); + Hint := cxGetResourceString(@sdxHFFunctionHintMachineName); +end; + +function TdxHFMachineNameFunction.ConvertFunc(const Source: string; + const AFormatObject: TdxHFFunctionFormatObject): string; +begin + Result := AFormatObject.MachineName +end; + +class function TdxHFMachineNameFunction.GetName: string; +begin + Result := cxGetResourceString(@sdxHFFunctionNameMachineName); +end; + +{ TdxHFMachineNameFunction } + +constructor TdxHFUserNameFunction.Create; +begin + inherited; + Bitmap_LoadFromResourceName(Glyph, IDB_DXPSFUNCTION_USERNAME); + TemplateString := cxGetResourceString(@sdxHFFunctionTemplateUserName); + Hint := cxGetResourceString(@sdxHFFunctionHintUserName); +end; + +function TdxHFUserNameFunction.ConvertFunc(const Source: string; + const AFormatObject: TdxHFFunctionFormatObject): string; +begin + Result := AFormatObject.UserName +end; + +class function TdxHFUserNameFunction.GetName: string; +begin + Result := cxGetResourceString(@sdxHFFunctionNameUserName); +end; + +{ TdxHFDateTimeFunctions } + +class function TdxHFDateTimeFunctions.GetCategory: TdxHFFunctionCustomCategoryClass; +begin + Result := TdxHFFunctionDateTimeCategory; +end; + +{ TdxHFDateTimeFunction } + +constructor TdxHFDateTimeFunction.Create; +begin + inherited; + Bitmap_LoadFromResourceName(Glyph, IDB_DXPSFUNCTION_DATETIME); + TemplateString := cxGetResourceString(@sdxHFFunctionTemplateDateTime); + Hint := cxGetResourceString(@sdxHFFunctionHintDateTime); +end; + +function TdxHFDateTimeFunction.ConvertFunc(const Source: string; + const AFormatObject: TdxHFFunctionFormatObject): string; +begin + with AFormatObject do + Result := GetFormatedDate(DateTime, DateFormat) + ' ' + + GetFormatedTime(DateTime, TimeFormat); +end; + +class function TdxHFDateTimeFunction.GetName: string; +begin + Result := cxGetResourceString(@sdxHFFunctionNameDateTime); +end; + +{ TdxHFDateFunction } + +constructor TdxHFDateFunction.Create; +begin + inherited; + Bitmap_LoadFromResourceName(Glyph, IDB_DXPSFUNCTION_DATE); + TemplateString := cxGetResourceString(@sdxHFFunctionTemplateDate); + Hint := cxGetResourceString(@sdxHFFunctionHintDate); +end; + +function TdxHFDateFunction.ConvertFunc(const Source: string; + const AFormatObject: TdxHFFunctionFormatObject): string; +begin + with AFormatObject do + Result := GetFormatedDate(DateTime, DateFormat); +end; + +class function TdxHFDateFunction.GetName: string; +begin + Result := cxGetResourceString(@sdxHFFunctionNameDate); +end; + +{ TdxHFDateFunction } + +constructor TdxHFTimeFunction.Create; +begin + inherited; + Bitmap_LoadFromResourceName(Glyph, IDB_DXPSFUNCTION_TIME); + TemplateString := cxGetResourceString(@sdxHFFunctionTemplateTime); + Hint := cxGetResourceString(@sdxHFFunctionHintTime); +end; + +function TdxHFTimeFunction.ConvertFunc(const Source: string; + const AFormatObject: TdxHFFunctionFormatObject): string; +begin + with AFormatObject do + Result := GetFormatedTime(DateTime, TimeFormat); +end; + +class function TdxHFTimeFunction.GetName: string; +begin + Result := cxGetResourceString(@sdxHFFunctionNameTime); +end; + +{ TdxHFFunctionLibrary } + +constructor TdxHFFunctionLibrary.Create; +begin + inherited Create; + FItems := TStringList.Create; +end; + +destructor TdxHFFunctionLibrary.Destroy; +begin + FreeAndNilItems; + inherited; +end; + +procedure TdxHFFunctionLibrary.Assign(Source: TPersistent); +var + I: Integer; +begin + if Source is TdxHFFunctionLibrary then + begin + Clear; + with TdxHFFunctionLibrary(Source) do + for I := 0 to Count - 1 do + Self.Add(Funcs[I].FunctionClass); + end + else + inherited; +end; + +procedure TdxHFFunctionLibrary.GetFunctions(AStrings: TStrings); +var + I: Integer; + AFunction: TdxHFCustomFunction; +begin + AStrings.BeginUpdate; + try + for I := 0 to Count - 1 do + begin + AFunction := Funcs[I]; + AStrings.AddObject(AFunction.TemplateString, AFunction); + end; + finally + AStrings.EndUpdate; + end; +end; + +procedure TdxHFFunctionLibrary.GetFunctionsByCategory(ACategory: TdxHFFunctionCustomCategoryClass; + AStrings: TStrings); +var + I: Integer; + AFunction: TdxHFCustomFunction; +begin + AStrings.BeginUpdate; + try + for I := 0 to Count - 1 do + begin + AFunction := Funcs[I]; + if AFunction.GetCategory = ACategory then + AStrings.AddObject(AFunction.TemplateString, AFunction); + end; + finally + AStrings.EndUpdate; + end; +end; + +procedure TdxHFFunctionLibrary.Enumerate(AProc: TdxHFFunctionEnumProc); +var + I: Integer; +begin + if Assigned(AProc) then + for I := 0 to Count - 1 do + AProc(Self, Funcs[I]); +end; + +function TdxHFFunctionLibrary.ProcessString(const Source: string; + const AFormatObject: TdxHFFunctionFormatObject): string; +var + I, J, Left, Right: Integer; + S: string; +begin + Result := Source; + if Length(Result) = 0 then Exit; + + I := 1; + while I <= Length(Result) do + begin + while (I <= Length(Result)) and (Result[I] <> dxFunctionDelimiters[False]) do + Inc(I); + + if I < Length(Result) then + Left := I + else + Left := 0; + if Left = 0 then Break; + + while (I <= Length(Result)) and (Result[I] <> dxFunctionDelimiters[True]) do + Inc(I); + + if I <= Length(Result) then + Right := I + else + Right := 0; + if Right = 0 then Break; + + if Right - Left > 1 then + begin + S := Copy(Result, Left {+1}, Right - Left + 1 {-1}); + J := IndexOf(S); + if J <> -1 then + begin + System.Delete(Result, Left, Right - Left + 1); + S := Funcs[J].DoProcess(S, AFormatObject); + if S <> '' then + Insert(' ' + S + ' ', Result, Left); + I := Left + Length(S) + 2 {left and right spaces}; + end; + end; + end; +end; + +function TdxHFFunctionLibrary.Add(AFunctionClass: TdxHFCustomFunctionClass): TdxHFCustomFunction; +begin + Result := AFunctionClass.Create; + FItems.AddObject(Result.TemplateString, Result); +end; + +procedure TdxHFFunctionLibrary.Clear; +begin + while Count > 0 do Delete(Count - 1); +end; + +procedure TdxHFFunctionLibrary.Delete(AnIndex: Integer); +begin + FItems.Objects[AnIndex].Free; + FItems.Delete(AnIndex); +end; + +function TdxHFFunctionLibrary.IndexOf(const ATemplateString: string): Integer; +begin + Result := FItems.IndexOf(ATemplateString); +end; + +function TdxHFFunctionLibrary.IndexOfByName(const AFunctionName: string): Integer; +begin + for Result := 0 to Count - 1 do + if dxSameText(Funcs[Result].GetName, AFunctionName) then Exit; + Result := -1; +end; + +function TdxHFFunctionLibrary.IndexOfByClass(AFunctionClass: TdxHFCustomFunctionClass): Integer; +begin + for Result := 0 to Count - 1 do + if Funcs[Result].FunctionClass = AFunctionClass then Exit; +// if Assigned(AFunctionClass) and AFunctionClass.InheritsFrom(Funcs[Result].FunctionClass) then Exit; + Result := -1; +end; + +function TdxHFFunctionLibrary.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxHFFunctionLibrary.GetFunction(Index: Integer): TdxHFCustomFunction; +begin + Result := TdxHFCustomFunction(FItems.Objects[Index]); +end; + +function TdxHFFunctionLibrary.GetFunctionByClass(FunctionClass: TdxHFCustomFunctionClass): TdxHFCustomFunction; +var + Index: Integer; +begin + Index := IndexOfByClass(FunctionClass); + if Index <> -1 then + Result := Funcs[Index] + else + Result := nil; +end; + +procedure TdxHFFunctionLibrary.SetFunction(Index: Integer; Value: TdxHFCustomFunction); +begin + Funcs[Index].Assign(Value); +end; + +procedure TdxHFFunctionLibrary.SetFunctionByClass(FunctionClass: TdxHFCustomFunctionClass; Value: TdxHFCustomFunction); +var + Index: Integer; +begin + Index := IndexOfByClass(FunctionClass); + if Index <> -1 then + Funcs[Index] := Value; +end; + +procedure TdxHFFunctionLibrary.FreeAndNilItems; +begin + Clear; + FreeAndNil(FItems); +end; + +{ TdxStdHFFunctionLibrary } + +constructor TdxStandardHFFunctionLibrary.Create; +begin + inherited; + AddStandardFuncitons; +end; + +procedure TdxStandardHFFunctionLibrary.AddStandardFuncitons; +begin + Add(TdxHFPageNumberFunction); + Add(TdxHFTotalPagesFunction); + Add(TdxHFPageOfPagesFunction); + Add(TdxHFDateTimeFunction); + Add(TdxHFDateFunction); + Add(TdxHFTimeFunction); + Add(TdxHFUserNameFunction); + Add(TdxHFMachineNameFunction); +end; + +{ functions } + +function DateFormats: TStrings; +begin + if FDateFormats = nil then + begin + FDateFormats := TStringList.Create; + if Assigned(dxGetDateFormatsProc) then dxGetDateFormatsProc(FDateFormats); + end; + Result := FDateFormats; +end; + +function TimeFormats: TStrings; +begin + if FTimeFormats = nil then + begin + FTimeFormats := TStringList.Create; + if Assigned(dxGetTimeFormatsProc) then dxGetTimeFormatsProc(FTimeFormats); + end; + Result := FTimeFormats; +end; + +procedure RefreshDateFormats; +begin + FreeAndNil(FDateFormats); +end; + +procedure RefreshTimeFormats; +begin + FreeAndNil(FTimeFormats); +end; + +procedure DeleteLeadingGarbage(var Source: string); +begin + while (Length(Source) > 0) and ((Source[1] = '.') or (Source[1] = ',') or (Source[1] = ' ')) do + Delete(Source, 1, 1); +end; + +function ExtractLongMonthFormat(AnExcludeDelimiters: Boolean): string; +const + ValidChars: array[Boolean] of string = (' M:\.,/', ' M:\'); +var + I: Integer; + Ch: char; +begin + Result := ''; + for I := 1 to Length(LongDateFormat) do + begin + Ch := LongDateFormat[I]; + if Pos(Ch, ValidChars[AnExcludeDelimiters]) <> 0 then + Result := Result + Ch; + end; + Result := Trim(Result); + DeleteLeadingGarbage(Result); +end; + +function ReducedLongDayFormat: string; +var + P: Integer; +begin + Result := LongDateFormat; + repeat + P := Pos('dddd', Result); + if P <> 0 then Delete(Result, P, 4); + until P = 0; + + Result := Trim(Result); + DeleteLeadingGarbage(Result); +end; + +procedure dxGetDateFormats(AStrings: TStrings); +var + S: string; + P: Integer; +begin + AStrings.BeginUpdate; + try + AStrings.Clear; +{1} AStrings.Add(ShortDateFormat); + + S := Trim(LongDateFormat); + if Pos('dddd', S) = 0 then S := 'dddd, ' + S; +{2} AStrings.Add(S); + +{3} AStrings.Add(ReducedLongDayFormat); + + S := ShortDateFormat; + P := Pos('yyyy', S); + if P <> 0 then + Delete(S, P, 2) + else + begin + P := Pos('yy', S); + if P <> 0 then Insert('yy', S, P); + end; +{4} AStrings.Add(S); + +{5} AStrings.Add('yyyy-MM-dd'); +{6} AStrings.Add('d-MMM-yy'); + + S := ShortDateFormat; + if DateSeparator <> '/' then + S := ReplaceSubStr(S, DateSeparator, '/') + else + S := ReplaceSubStr(S, DateSeparator, '.'); +{7} AStrings.Add(S); + +{8} AStrings.Add(ExtractLongMonthFormat(False) + ' yyyy'); +{9} AStrings.Add('d MMMM yyyy'); +{10}AStrings.Add(ExtractLongMonthFormat(True) + ' yy'); +{11}AStrings.Add('MMM-yy'); + finally + AStrings.EndUpdate; + end; +end; + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} +{$ENDIF} + +procedure dxGetTimeFormats(AStrings: TStrings); +const + HourFormats: array[Boolean] of string = ('hh', 'h'); +var + HourFormat: string; +begin + HourFormat := HourFormats[StrToIntDef(GetLocaleChar(GetThreadLocale, LOCALE_ITLZERO, '0'), 0) = 0]; + with AStrings do + begin + BeginUpdate; + try + Clear; + Add(HourFormat + ':mm tt'); + Add(HourFormat + ':mm:ss tt'); + Add(UpperCase(HourFormat) + ':mm'); + Add(UpperCase(HourFormat) + ':mm:ss'); + finally + EndUpdate; + end; + end; +end; + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM ON} +{$ENDIF} + +function PageNumberFormats: TStrings; +begin + if FPageNumberFormats = nil then + begin + FPageNumberFormats := TStringList.Create; + FPageNumberFormats.AddObject('1, 2, 3, 4, 5, ...', TObject(Integer(pnfNumeral))); + FPageNumberFormats.AddObject('a, b, c, d, e, ...', TObject(Integer(pnfChars))); + FPageNumberFormats.AddObject('A, B, C, D, E, ...', TObject(Integer(pnfUpperChars))); + FPageNumberFormats.AddObject('i, ii, iii, iv, v, ...', TObject(Integer(pnfRoman))); + FPageNumberFormats.AddObject('I, II, III, IV, V, ...', TObject(Integer(pnfUpperRoman))); + end; + Result := FPageNumberFormats; +end; + +function System_GetFormatedDate(const ASystemTime: TSystemTime; const AFormat: string): string; +var + DefaultLCID: LCID; + BufferSize: Integer; + Buffer: array[0..255] of Char; +begin + if AFormat <> '' then + begin + DefaultLCID := GetThreadLocale; + FillChar(Buffer, SizeOf(Buffer), 0); + BufferSize := GetDateFormat(DefaultLCID, 0, @ASystemTime, PChar(AFormat), @Buffer, Length(Buffer)); + if BufferSize = 0 then + Result := '' + else + Result := Buffer; + end + else + Result := ''; +end; + +function System_GetFormatedTime(const ASystemTime: TSystemTime; const AFormat: string): string; +var + DefaultLCID: LCID; + BufferSize: Integer; + Buffer: array[0..255] of Char; +begin + if AFormat <> '' then + begin + DefaultLCID := GetThreadLocale; + FillChar(Buffer, SizeOf(Buffer), 0); + BufferSize := GetTimeFormat(DefaultLCID, 0, @ASystemTime, PChar(AFormat), @Buffer, Length(Buffer)); + if BufferSize = 0 then + Result := '' + else + Result := Buffer; + Result := Buffer; + end + else + Result := ''; +end; + +function GetFormatedDate(const ADateTime: TDateTime; const AFormat: string): string; +var + SystemTime: TSystemTime; +begin + DateTimeToSystemTime(ADateTime, SystemTime); + Result := System_GetFormatedDate(SystemTime, AFormat); +end; + +function GetFormatedTime(const ADateTime: TDateTime; const AFormat: string): string; +var + SystemTime: TSystemTime; +begin + DateTimeToSystemTime(ADateTime, SystemTime); + Result := System_GetFormatedTime(SystemTime, AFormat); +end; + +procedure GetFormatedDateStrings(const ADateTime: TDateTime; + ADateFormats, AFormatedStrings: TStrings); +var + I: Integer; +begin + with AFormatedStrings do + begin + BeginUpdate; + try + for I := 0 to ADateFormats.Count - 1 do + Add(GetFormatedDate(ADateTime, ADateFormats[I])); + finally + EndUpdate; + end; + end; +end; + +procedure GetFormatedTimeStrings(const ADateTime: TDateTime; + ATimeFormats, AFormatedStrings: TStrings); +var + I: Integer; +begin + with AFormatedStrings do + begin + BeginUpdate; + try + for I := 0 to ATimeFormats.Count - 1 do + Add(GetFormatedTime(ADateTime, ATimeFormats[I])); + finally + EndUpdate; + end; + end; +end; + +function DefaultAutoHFTextEntries: TStrings; +begin + if FDefaultAutoHFTextEntries = nil then + begin + FDefaultAutoHFTextEntries := TStringList.Create; + TStringList(FDefaultAutoHFTextEntries).Duplicates := dupIgnore; + if Assigned(dxGetAutoHFTextEntriesProc) then + dxGetAutoHFTextEntriesProc(FDefaultAutoHFTextEntries); + end; + Result := FDefaultAutoHFTextEntries; +end; + +procedure dxGetAutoHFTextEntries(AStrings: TStrings); +var + F: TdxHFCustomFunction; + S: string; +begin + with AStrings do + begin + //, -Page #-, + F := dxHFFunctionLibrary.FuncsByClass[TdxHFPageNumberFunction]; + if F <> nil then + Add(dxHFFunctionSeparator + ' ' + '-' + F.TemplateString + '-' + ' ' + dxHFFunctionSeparator); + + // Author, Page #, Date + S := ''; + F := dxHFFunctionLibrary.FuncsByClass[TdxHFUserNameFunction]; + if F <> nil then + S := F.TemplateString; + F := dxHFFunctionLibrary.FuncsByClass[TdxHFPageNumberFunction]; + if F <> nil then + S := S + dxHFFunctionSeparator + ' ' + DropAmpersand(cxGetResourceString(@sdxPage)) + ' ' + F.TemplateString; + F := dxHFFunctionLibrary.FuncsByClass[TdxHFDateFunction]; + if F <> nil then + S := S + dxHFFunctionSeparator + ' ' + F.TemplateString; + Add(S); + + // Confidential, Page #, Date + S := cxGetResourceString(@sdxConfidential); + F := dxHFFunctionLibrary.FuncsByClass[TdxHFPageNumberFunction]; + if F <> nil then + S := S + dxHFFunctionSeparator + ' ' + DropAmpersand(cxGetResourceString(@sdxPage)) + ' ' + F.TemplateString; + F := dxHFFunctionLibrary.FuncsByClass[TdxHFDateFunction]; + if F <> nil then + S := S + dxHFFunctionSeparator + ' ' + F.TemplateString; + Add(S); + + // Created By + F := dxHFFunctionLibrary.FuncsByClass[TdxHFUserNameFunction]; + if F <> nil then + Add(cxGetResourceString(@sdxCreatedBy) + F.TemplateString); + + // Created On + F := dxHFFunctionLibrary.FuncsByClass[TdxHFDateTimeFunction]; + if F <> nil then + Add(cxGetResourceString(@sdxCreatedOn) + F.TemplateString); + + // Printed By + F := dxHFFunctionLibrary.FuncsByClass[TdxHFUserNameFunction]; + if F <> nil then + Add(cxGetResourceString(@sdxPrintedBy) + F.TemplateString); + + // Printed On + F := dxHFFunctionLibrary.FuncsByClass[TdxHFDateTimeFunction]; + if F <> nil then + Add(cxGetResourceString(@sdxPrintedOn) + F.TemplateString); + + // Last Printed + F := dxHFFunctionLibrary.FuncsByClass[TdxHFDateTimeFunction]; + if F <> nil then + Add(cxGetResourceString(@sdxLastPrinted) + F.TemplateString); + + // Page # + F := dxHFFunctionLibrary.FuncsByClass[TdxHFPageOfPagesFunction]; + if F <> nil then + Add(DropAmpersand(cxGetResourceString(@sdxPage)) + ' ' + F.TemplateString); + end; +end; + +var + FHFFunctionLibrary: TdxHFFunctionLibrary; + FHFFormatObject: TdxHFFunctionFormatObject; + +initialization + dxGetDateFormatsProc := dxGetDateFormats; + dxGetTimeFormatsProc := dxGetTimeFormats; + dxGetAutoHFTextEntriesProc := dxGetAutoHFTextEntries; + + FHFFunctionLibrary := TdxStandardHFFunctionLibrary.Create; + dxHFFunctionLibrary := FHFFunctionLibrary; + + FHFFormatObject := TdxHFFunctionFormatObject.Create; + dxHFFormatObject := FHFFormatObject; + + dxPSRegisterPrintStyle(TBasedxPrintStyle, False); + if dxDefaultPrintStyleClass = nil then dxDefaultPrintStyleClass := TBasedxPrintStyle; + +finalization + dxPSUnregisterAllPrintStyles; + + if dxHFFormatObject = FHFFormatObject then dxHFFormatObject := nil; + if dxHFFunctionLibrary = FHFFunctionLibrary then dxHFFunctionLibrary := nil; + + FreeAndNil(FDefaultAutoHFTextEntries); + FreeAndNil(FHFFormatObject); + FreeAndNil(FHFFunctionLibrary); + FreeAndNil(FDateFormats); + FreeAndNil(FPageNumberFormats); + FreeAndNil(FTimeFormats); + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPrevw.pas b/official/x.35/ExpressPrinting System/Sources/dxPrevw.pas new file mode 100644 index 00000000..122af0ba --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPrevw.pas @@ -0,0 +1,5399 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPreVw; + +interface + +{$I cxVer.inc} + +uses + Classes, Controls, Messages, Windows, Graphics, Forms, StdCtrls, SysUtils, + ExtCtrls, FlatSB, dxWrap, dxBkgnd, dxPSUtl, dxPSGlbl; + +const + dxPreviewIndent1 = 4; + dxPreviewIndent2 = 9; + dxPreviewIndent = dxPreviewIndent1 + dxPreviewIndent2; + dxPreviewDragHintOffset = 5; + dxPreviewMarginSelectDelta = 3; + dxPreviewMinZoomFactor = 5; + dxPreviewScrollStep = 30; + dxPreviewMinUsefulSize: TPoint = (X: 500; Y: 500); + dxPreviewMinHeaderFooterSize = 127; + +type + TCMHintHide = TWMNoParams; + + TCustomdxPreview = class; + TdxPreviewPageMargins = class; + + TdxPreviewPageClass = class of TdxPreviewPage; + + TdxPreviewPage = class + private + FBounds: TRect; + FPreview: TCustomdxPreview; + function GetIndex: Integer; + function GetPartVisible: Boolean; + function GetSelected: Boolean; + function GetSiteBounds: TRect; + function GetVisible: Boolean; + function GetZoomed: Boolean; + procedure SetBounds(const Value: TRect); + procedure SetSelected(Value: Boolean); + protected + //procedure DrawBackground; + //procedure DrawBorder; + //procedure DrawContent; + //procedure DrawMargins; + public + constructor Create(APreview: TCustomdxPreview); virtual; + + function GetCursor: TCursor; virtual; + function HasPoint(const Pt: TPoint): Boolean; overload; + function HasPoint(X, Y: Integer): Boolean; overload; + procedure MakeVisible; + + property Bounds: TRect read FBounds write SetBounds; + property Index: Integer read GetIndex; + property PartVisible: Boolean read GetPartVisible; + property Preview: TCustomdxPreview read FPreview; + property Selected: Boolean read GetSelected write SetSelected; + property SiteBounds: TRect read GetSiteBounds; + property Visible: Boolean read GetVisible; + property Zoomed: Boolean read GetZoomed; + end; + + TdxPreviewHitTest = (phtNoWhere, phtPage, phtMarginLeft, phtMarginTop, + phtMarginRight, phtMarginBottom, phtMarginHeader, phtMarginFooter); + TdxPreviewHitTests = set of TdxPreviewHitTest; + + TdxPreviewPageMarginClass = class of TdxPreviewPageMargin; + + TdxPreviewPageMargin = class(TPersistent) + private + FCaption: string; + FDraggingPos: Integer; + FEnabled: Boolean; + FIsCaptionAssigned: Boolean; + FMargins: TdxPreviewPageMargins; + FMaxValue: Integer; + FMinValue: Integer; + FScreenBitmap: HBITMAP; + FValue: Integer; + FVisible: Boolean; + function GetActualMaxValue: Integer; + function GetActualMinValue: Integer; + function GetBounds: TRect; + function GetCaption: string; + function GetDisplayText: string; + function GetDraggingValue: Integer; + function GetIsDragging: Boolean; + function GetMaxPos: Integer; + function GetMinPos: Integer; + function GetPageBounds: TRect; + function GetPreview: TCustomdxPreview; + function GetSelectableBounds: TRect; + function GetVisibleValue: Integer; + function IsCaptionStored: Boolean; + function IsValueStored: Boolean; + procedure SetCaption(const Value: string); + procedure SetDraggingPos(Value: Integer); + procedure SetEnabled(Value: Boolean); + procedure SetMaxValue(Value: Integer); + procedure SetMinValue(Value: Integer); + procedure SetValue(Value: Integer); + procedure SetVisible(Value: Boolean); + + procedure ReadIsCaptionAssigned(AReader: TReader); + procedure WriteIsCaptionAssigned(AWriter: TWriter); + protected + procedure DefineProperties(Filer: TFiler); override; + + function GetIsForceRecalculatePageCount: Boolean; virtual; + function GetIsForward: Boolean; virtual; + function GetIsVertical: Boolean; virtual; + function DoGetActualMaxValue: Integer; virtual; + function DoGetActualMinValue: Integer; virtual; + function DoGetMaxMinValue: Integer; virtual; + function DoPosFromValue(AValue: Integer): Integer; virtual; + function DoValueFromPos(APos: Integer): Integer; virtual; + + procedure Changed(HardRefresh: Boolean); virtual; + procedure DoAssign(Source: TdxPreviewPageMargin); virtual; + procedure DoDragAfter; + procedure DoDragBefore; + procedure DoRestoreDefaults; virtual; + + procedure Draw(DC: HDC); virtual; + procedure Invalidate; virtual; + procedure Invert(DC: HDC); virtual; + + function CheckValue(Value: Integer): Integer; + function PosFromValue(AValue: Integer): Integer; + function ValueFromPos(APos: Integer): Integer; + + property ActualMaxValue: Integer read GetActualMaxValue; + property ActualMinValue: Integer read GetActualMinValue; + property Bounds: TRect read GetBounds; + property DraggingPos: Integer read FDraggingPos write SetDraggingPos; + property IsForceRecalculatePageCount: Boolean read GetIsForceRecalculatePageCount; + property MaxPos: Integer read GetMaxPos; + property MaxValue: Integer read FMaxValue write SetMaxValue; // HIMETRIC + property MinPos: Integer read GetMinPos; + property PageBounds: TRect read GetPageBounds; + property Preview: TCustomdxPreview read GetPreview; + property SelectableBounds: TRect read GetSelectableBounds; + public + constructor Create(AMargins: TdxPreviewPageMargins); virtual; + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; + + procedure BeginUpdate; + procedure EndUpdate; + + function DefaultCaption: string; virtual; + function DefaultValue: Integer; virtual; + function GetHitTest: TdxPreviewHitTest; virtual; + function GetCursor: TCursor; virtual; + + function HasPoint(const Pt: TPoint): Boolean; overload; + function HasPoint(const Pt: TSmallPoint): Boolean; overload; + function HasPoint(X, Y: Integer): Boolean; overload; + + property DisplayText: string read GetDisplayText; + property DraggingValue: Integer read GetDraggingValue; + property IsDragging: Boolean read GetIsDragging; + property IsForward: Boolean read GetIsForward; + property IsVertical: Boolean read GetIsVertical; + property Margins: TdxPreviewPageMargins read FMargins; + property VisibleValue: Integer read GetVisibleValue; // pixels + published + property Caption: string read GetCaption write SetCaption stored IsCaptionStored; + property Enabled: Boolean read FEnabled write SetEnabled default True; + property MinValue: Integer read FMinValue write SetMinValue default 0; // HIMETRIC + property Value: Integer read FValue write SetValue stored IsValueStored; // HIMETRIC + property Visible: Boolean read FVisible write SetVisible default True; + end; + + TdxPreviewPageMarginBottom = class(TdxPreviewPageMargin) + protected + function GetIsForceRecalculatePageCount: Boolean; override; + function GetIsForward: Boolean; override; + function GetIsVertical: Boolean; override; + function DoGetActualMaxValue: Integer; override; + function DoGetActualMinValue: Integer; override; + function DoGetMaxMinValue: Integer; override; + function DoPosFromValue(AValue: Integer): Integer; override; + function DoValueFromPos(APos: Integer): Integer; override; + public + function DefaultCaption: string; override; + function DefaultValue: Integer; override; + function GetHitTest: TdxPreviewHitTest; override; + function GetCursor: TCursor; override; + end; + + TdxPreviewPageMarginFooter = class(TdxPreviewPageMargin) + protected + function GetIsForward: Boolean; override; + function GetIsVertical: Boolean; override; + function DoGetActualMaxValue: Integer; override; + function DoGetMaxMinValue: Integer; override; + function DoPosFromValue(AValue: Integer): Integer; override; + function DoValueFromPos(APos: Integer): Integer; override; + public + function DefaultCaption: string; override; + function DefaultValue: Integer; override; + function GetHitTest: TdxPreviewHitTest; override; + function GetCursor: TCursor; override; + end; + + TdxPreviewPageMarginHeader = class(TdxPreviewPageMargin) + protected + function GetIsForward: Boolean; override; + function GetIsVertical: Boolean; override; + function DoGetActualMaxValue: Integer; override; + function DoGetMaxMinValue: Integer; override; + function DoPosFromValue(AValue: Integer): Integer; override; + function DoValueFromPos(APos: Integer): Integer; override; + public + function DefaultCaption: string; override; + function DefaultValue: Integer; override; + function GetHitTest: TdxPreviewHitTest; override; + function GetCursor: TCursor; override; + end; + + TdxPreviewPageMarginLeft = class(TdxPreviewPageMargin) + protected + function GetIsForceRecalculatePageCount: Boolean; override; + function GetIsForward: Boolean; override; + function GetIsVertical: Boolean; override; + function DoGetActualMaxValue: Integer; override; + function DoGetMaxMinValue: Integer; override; + function DoPosFromValue(AValue: Integer): Integer; override; + function DoValueFromPos(APos: Integer): Integer; override; + public + function DefaultCaption: string; override; + function DefaultValue: Integer; override; + function GetHitTest: TdxPreviewHitTest; override; + function GetCursor: TCursor; override; + end; + + TdxPreviewPageMarginRight = class(TdxPreviewPageMargin) + protected + function GetIsForceRecalculatePageCount: Boolean; override; + function GetIsForward: Boolean; override; + function GetIsVertical: Boolean; override; + function DoGetActualMaxValue: Integer; override; + function DoGetMaxMinValue: Integer; override; + function DoPosFromValue(AValue: Integer): Integer; override; + function DoValueFromPos(APos: Integer): Integer; override; + public + function DefaultCaption: string; override; + function DefaultValue: Integer; override; + function GetHitTest: TdxPreviewHitTest; override; + function GetCursor: TCursor; override; + end; + + TdxPreviewPageMarginTop = class(TdxPreviewPageMargin) + protected + function GetIsForceRecalculatePageCount: Boolean; override; + function GetIsForward: Boolean; override; + function GetIsVertical: Boolean; override; + function DoGetActualMaxValue: Integer; override; + function DoGetActualMinValue: Integer; override; + function DoGetMaxMinValue: Integer; override; + function DoPosFromValue(AValue: Integer): Integer; override; + function DoValueFromPos(APos: Integer): Integer; override; + public + function DefaultCaption: string; override; + function DefaultValue: Integer; override; + function GetHitTest: TdxPreviewHitTest; override; + function GetCursor: TCursor; override; + end; + + TdxPreviewPageMarginsClass = class of TdxPreviewPageMargins; + + TdxPreviewPageMargins = class(TPersistent) + private + FMargins: TList; + FPreview: TCustomdxPreview; + FUpdateCount: Integer; + function GetCount: Integer; + function GetMargin(Index: Integer): TdxPreviewPageMargin; + function GetMarginByCaption(const Caption: string): TdxPreviewPageMargin; + function GetMarginByClass(Index: TdxPreviewPageMarginClass): TdxPreviewPageMargin; + function GetMarginBottom: TdxPreviewPageMarginBottom; + function GetMarginFooter: TdxPreviewPageMarginFooter; + function GetMarginHeader: TdxPreviewPageMarginHeader; + function GetMarginLeft: TdxPreviewPageMarginLeft; + function GetMarginRight: TdxPreviewPageMarginRight; + function GetMarginTop: TdxPreviewPageMarginTop; + procedure SetMargin(Index: Integer; Value: TdxPreviewPageMargin); + procedure SetMarginByClass(Index: TdxPreviewPageMarginClass; Value: TdxPreviewPageMargin); + procedure SetMarginBottom(Value: TdxPreviewPageMarginBottom); + procedure SetMarginFooter(Value: TdxPreviewPageMarginFooter); + procedure SetMarginHeader(Value: TdxPreviewPageMarginHeader); + procedure SetMarginLeft(Value: TdxPreviewPageMarginLeft); + procedure SetMarginRight(Value: TdxPreviewPageMarginRight); + procedure SetMarginTop(Value: TdxPreviewPageMarginTop); + protected + procedure DoAssign(Source: TdxPreviewPageMargins); virtual; + procedure DoRestoreDefaults; virtual; + + function AddMargin(AClass: TdxPreviewPageMarginClass): TdxPreviewPageMargin; virtual; + procedure AddMargins; virtual; + procedure FreeAndNilMargins; + procedure Update(AMargin: TdxPreviewPageMargin); virtual; + public + constructor Create(APreview: TCustomdxPreview); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; + + procedure BeginUpdate; + procedure EndUpdate; + + property Count: Integer read GetCount; + property Margins[Index: Integer]: TdxPreviewPageMargin read GetMargin write SetMargin; default; + property MarginsByCaption[const Caption: string]: TdxPreviewPageMargin read GetMarginByCaption; + property MarginsByClass[Index: TdxPreviewPageMarginClass]: TdxPreviewPageMargin read GetMarginByClass write SetMarginByClass; + property Preview: TCustomdxPreview read FPreview; + published + property Bottom: TdxPreviewPageMarginBottom read GetMarginBottom write SetMarginBottom; + property Footer: TdxPreviewPageMarginFooter read GetMarginFooter write SetMarginFooter; + property Header: TdxPreviewPageMarginHeader read GetMarginHeader write SetMarginHeader; + property Left: TdxPreviewPageMarginLeft read GetMarginLeft write SetMarginLeft; + property Right: TdxPreviewPageMarginRight read GetMarginRight write SetMarginRight; + property Top: TdxPreviewPageMarginTop read GetMarginTop write SetMarginTop; + end; + + TdxPreviewPageBackground = class(TdxBackground) + private + FBitmap: TBitmap; + FPreview: TCustomdxPreview; + protected + procedure DoApply; override; + procedure DoChange(AChangeWhats: TdxBackgroundParams); override; + function HasPreview: Boolean; + public + constructor Create; override; + destructor Destroy; override; + procedure Paint(ACanvas: TCanvas; const R: TRect); override; + property Preview: TCustomdxPreview read FPreview; + property OnApply; + end; + + TdxPreviewOptionBehavior = (pobAllowDragMargins, pobHotTrack, pobKeyNavigation, + pobStoreInRegistry, pobThumbTracking, pobAutoSwapMargins, pobNonCenterizePages); + TdxPreviewOptionsBehavior = set of TdxPreviewOptionBehavior; + + TdxPreviewOptionHint = (pohShowForMargins, pohShowOnDrag, pohShowOnScroll); + TdxPreviewOptionsHint = set of TdxPreviewOptionHint; + + TdxPreviewOptionStore = (posZoom); + TdxPreviewOptionsStore = set of TdxPreviewOptionStore; + + TdxPreviewOptionView = (povAutoHideScrollBars, povDefaultDrawPageBackground, povMargins, povPageSelection); + TdxPreviewOptionsView = set of TdxPreviewOptionView; + + TdxPreviewOptionZoom = (pozZoomOnClick, pozZoomOnMouseRoll); + TdxPreviewOptionsZoom = set of TdxPreviewOptionZoom; + + TdxPreviewDragStage = (pdsAfter, pdsBefore, pdsDrag); + TdxPreviewLookAndFeel = (plfStandard, plfFlat, plfUltraFlat); + TdxPreviewMeasurementUnits = (pmuDefault, pmuInches, pmuMillimeters, pmuCentimeters, pmuPoints, pmuPicas); + TdxPreviewPaperOrientation = (ppoPortrait, ppoLandscape); + TdxPreviewScrollDirection = (psdLeft, psdUp, psdRight, psdDown); + TdxPreviewZoomMode = (pzmNone, pzmPageWidth, pzmPages); + + TdxDrawPageContentEvent = procedure(Sender: TObject; ACanvas: TCanvas; + ARect: TRect; APageIndex: Integer) of object; + + TdxGetPageNumberHintEvent = procedure(Sender: TObject; + AStartPage, AEndPage: Integer; var AHintString: string) of object; + + TdxCanShowMarginHintEvent = procedure(Sender: TObject; + var ACanShowHint: Boolean) of object; + + TdxMarginEvent = procedure(Sender: TObject; AMargin: TdxPreviewPageMargin) of object; + + TdxPreviewPageEvent = procedure(Sender: TObject; APageIndex: Integer) of object; + + TdxPageBackgroundDrawEvent = procedure(Sender: TObject; ACanvas: TCanvas; + const ARect: TRect; APageIndex: Integer) of object; + + TdxSelectingPageEvent = procedure(Sender: TObject; APagePage: Integer; + var ACanSelect: Boolean) of object; + + TCustomdxPreview = class(TCustomControl) + private + FActualOriginalPageSize: TPoint; + FBeforeDragPos: Integer; + FBorderStyle: TBorderStyle; + FDC: HDC; + FDraggingMargin: TdxPreviewPageMargin; + FDragOffset: Integer; + FHintHideLongTimer: TTimer; + FHintHideShortTimer: TTimer; + FHintShowTimer: TTimer; + FHintWindow: TCustomControl; + FHintWindowPageNumber: TCustomControl; + FIndent: Integer; + FIsColorAssigned: Boolean; + FIsNoPagesTextAssigned: Boolean; + FLastMousePos: TPoint; + FLeftPos: Integer; + FLookAndFeel: TdxPreviewLookAndFeel; + FMarginColor: TColor; + FMarginPen: HPEN; + FMargins: TdxPreviewPageMargins; + FMaxZoomFactor: Integer; + FMeasurementUnits: TdxPreviewMeasurementUnits; + FMinFooterSize: Integer; + FMinHeaderSize: Integer; + FMinUsefulSize: TPoint; + FMinZoomFactor: Integer; + FNoPagesText: string; + FOptionsBehavior: TdxPreviewOptionsBehavior; + FOptionsHint: TdxPreviewOptionsHint; + FOptionsStore: TdxPreviewOptionsStore; + FOptionsView: TdxPreviewOptionsView; + FOptionsZoom: TdxPreviewOptionsZoom; + FOrientation: TdxPreviewPaperOrientation; + FOriginalPageSize: TdxPointWrapper; + FPageBackground: TdxBackground; + FPages: TList; + FPageSize: TPoint; + FPageStack: TList; + FPageXCount: Integer; + FPageYCount: Integer; + FRegistryPath: string; + FScrollBars: TScrollStyle; + FScrollBarStyle: TScrollBarStyle; + FSelectionFrameThickness: Integer; + FSelPageIndex: Integer; + FTopPos: Integer; + FUnzoomedFactor: Integer; + FUnzoomedMode: TdxPreviewZoomMode; + FUpdateCount: Integer; + FZoomed: Boolean; + FZoomFactor: Integer; + FZoomedFixed: Boolean; + FZooming: Boolean; + FZoomMode: TdxPreviewZoomMode; + FZoomModeFixed: Boolean; + FZoomStep: Integer; + FOnAfterDragMargin: TdxMarginEvent; + FOnBeforeDragMargin: TdxMarginEvent; + FOnCalcPageCount: TNotifyEvent; + FOnDrawPageBackground: TdxPageBackgroundDrawEvent; + FOnDragMargin: TdxMarginEvent; + FOnDrawPageContent: TdxDrawPageContentEvent; + FOnGetPageNumberHint: TdxGetPageNumberHintEvent; + FOnCanShowMarginHint: TdxCanShowMarginHintEvent; + FOnChangePageCount: TNotifyEvent; + FOnMarginChanged: TdxMarginEvent; + FOnPostDrawPageContent: TdxDrawPageContentEvent; + FOnSelectedPageChanged: TdxPreviewPageEvent; + FOnSelectedPageChanging: TdxPreviewPageEvent; + FOnSelectingPage: TdxSelectingPageEvent; + FOnZoomFactorChanged: TNotifyEvent; + FOnZoomModeChanged: TNotifyEvent; + function GetActualMeasurementUnits: TdxPreviewMeasurementUnits; + function GetAllRowCount: Integer; + function GetColCount: Integer; + function GetColor: TColor; + function GetNoPagesText: string; + function GetPage(Index: Integer): TdxPreviewPage; + function GetPageCount: Integer; + function GetRowCount: Integer; + function GetSelPageCol: Integer; + function GetSelPageRow: Integer; + function GetVirtualHeight: Integer; + function GetVirtualWidth: Integer; + function GetVisiblePageSize: TPoint; + function IsColorStored: Boolean; + function IsNoPagesTextStored: Boolean; + procedure SetBorderStyle(Value: TBorderStyle); + procedure SetColor(Value: TColor); + procedure SetLeftPos(Value: Integer); + procedure SetLookAndFeel(Value: TdxPreviewLookAndFeel); + procedure SetMarginColor(Value: TColor); + procedure SetMargins(Value: TdxPreviewPageMargins); + procedure SetMaxZoomFactor(Value: Integer); + procedure SetMinZoomFactor(Value: Integer); + procedure SetMinFooterSize(Value: Integer); + procedure SetMinHeaderSize(Value: Integer); + procedure SetMinUsefulSize(const Value: TPoint); + procedure SetNoPagesText(const Value: string); + procedure SetOnCalcPageCount(Value: TNotifyEvent); + procedure SetOptionsBehavior(Value: TdxPreviewOptionsBehavior); + procedure SetOptionsHint(Value: TdxPreviewOptionsHint); + procedure SetOptionsStore(Value: TdxPreviewOptionsStore); + procedure SetOptionsView(Value: TdxPreviewOptionsView); + procedure SetOptionsZoom(Value: TdxPreviewOptionsZoom); + procedure SetOrientation(Value: TdxPreviewPaperOrientation); + procedure SetOriginalPageSize(Value: TdxPointWrapper); + procedure SetPageBackground(Value: TdxBackground); + procedure SetPageCount(Value: Integer); + procedure SetPageXCount(Value: Integer); + procedure SetPageYCount(Value: Integer); + procedure SetScrollBars(Value: TScrollStyle); + procedure SetScrollBarStyle(Value: TScrollBarStyle); + procedure SetSelectionFrameThickness(Value: Integer); + procedure SetSelPageIndex(Value: Integer); + procedure SetTopPos(Value: Integer); + procedure SetZoomed(Value: Boolean); + procedure SetZoomFactor(Value: Integer); + procedure SetZoomMode(Value: TdxPreviewZoomMode); + procedure SetZoomStep(Value: Integer); + + procedure AdjustOrientation; + procedure AdjustPagesBounds; + + procedure DrawNoPages; + procedure DrawPages; + procedure DrawPagesContent; + procedure DrawRestSpaceBackgroundRect(const R: TRect); + procedure DrawRestSpaceBackgroundRgn(ARgn: HRGN); + + procedure PageParametersChanging(Sender: TObject; Coords: TdxPointCoords; + var Values: array of Integer); + procedure PageParametersChanged(Sender: TObject; Coords: TdxPointCoords); + procedure ResyncSelPageIndex; + + function CanAnyScrolling: Boolean; + function CanHorzScrolling: Boolean; + function CanPageScrolling(ADirection: TdxPreviewScrollDirection): Boolean; + function CanVertScrolling: Boolean; + function CanHorzScrollBarBeVisible: Boolean; + function CanVertScrollBarBeVisible: Boolean; + function DoublePassUpdateScrollBars: Boolean; + function GetScrollInfo(ABarFlag: Integer; var AScrollInfo: TScrollInfo): BOOL; + procedure ScrollPage(ADirection: TdxPreviewScrollDirection); + function SetScrollInfo(ABarFlag: Integer; const AScrollInfo: TScrollInfo; ARedraw: BOOL): Integer; + procedure UpdateScrollBars; + + procedure CancelDragMargin; + function CanChangeMargins: Boolean; + procedure ClearLastMousePos; + procedure RecreateMarginPen; + + procedure ActivateHint(AMargin: TdxPreviewPageMargin); + procedure CancelHintHide; + procedure CancelHintShow; + procedure CreateHint; + procedure DestroyHint; + procedure ResetHintShowTimer(X, Y: Integer); + procedure StartHintShow; + + procedure DestroyPageNumberHint; + procedure UpdatePageNumberHint; + + procedure DesignerModified; + function IsDesigning: Boolean; + function IsParentFormActive: Boolean; + + procedure HintHideLongTimerHandler(Sender: TObject); + procedure HintHideShortTimerHandler(Sender: TObject); + procedure HintShowTimerHandler(Sender: TObject); + + procedure ReadIsNoPagesTextAssigned(AReader: TReader); + procedure WriteIsNoPagesTextAssigned(AWriter: TWriter); + + procedure WMCaptureChanged(var Message: TMessage); Message WM_CAPTURECHANGED; + procedure WMDestroy(var Message: TWMDestroy); Message WM_DESTROY; + procedure WMGetDlgCode(var Message: TWMGetDlgCode); Message WM_GETDLGCODE; + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); Message WM_ERASEBKGND; + procedure WMHScroll(var Message: TWMHScroll); Message WM_HSCROLL; + procedure WMKillFocus(var Message: TWMKillFocus); Message WM_KILLFOCUS; + procedure WMRButtonUp(var Message: TWMRButtonUp); Message WM_RBUTTONUP; + procedure WMMouseActivate(var Message: TWMMouseActivate); Message WM_MOUSEACTIVATE; + procedure WMMouseWheel(var Message: TWMMouseWheel); Message WM_MOUSEWHEEL; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); Message WM_NCCALCSIZE; + procedure WMNCDestroy(var Message: TWMNCDestroy); Message WM_NCDESTROY; + procedure WMNCHitTest(var Message: TWMNCHitTest); Message WM_NCHITTEST; + procedure WMNCPaint(var Message: TWMNCPaint); Message WM_NCPAINT; + procedure WMSetCursor(var Message: TWMSetCursor); Message WM_SETCURSOR; + procedure WMSize(var Message: TWMSize); Message WM_SIZE; + procedure WMVScroll(var Message: TWMVScroll); Message WM_VSCROLL; + procedure CMCancelMode(var Message: TCMCancelMode); Message CM_CANCELMODE; + procedure CMColorChanged(var Message: TMessage); Message CM_COLORCHANGED; + procedure CMCtl3DChanged(var Message: TMessage); Message CM_CTL3DCHANGED; + procedure CMDesignHitTest(var Message: TCMDesignHitTest); Message CM_DESIGNHITTEST; + procedure CMHintShow(var Message: TCMHintShow); Message CM_HINTSHOW; + procedure CMSysColorChange(var Message: TMessage); Message CM_SYSCOLORCHANGE; + protected + procedure AdjustSize; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWindowHandle(const Params: TCreateParams); override; + procedure CreateWnd; override; + procedure DefineProperties(Filer: TFiler); override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure Loaded; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure Paint; override; + procedure WndProc(var Message: TMessage); override; + + function CreateMargins: TdxPreviewPageMargins; virtual; + function GetMarginsClass: TdxPreviewPageMarginsClass; virtual; + + function CreatePage: TdxPreviewPage; virtual; + function GetPageClass: TdxPreviewPageClass; virtual; + + function CheckLeftPos(Value: Integer): Integer; + function CheckTopPos(Value: Integer): Integer; + procedure CheckMargins; + procedure CheckZoomFactor; + procedure DoScrolling; + + function CanSelectPage(APageIndex: Integer): Boolean; dynamic; + function CanShowMarginHint: Boolean; dynamic; + procedure DoAfterDragMargin(AMargin: TdxPreviewPageMargin); dynamic; + procedure DoBeforeDragMargin(AMargin: TdxPreviewPageMargin); dynamic; + procedure DoCalcPageCount; dynamic; + procedure DoChangePageCount; dynamic; + procedure DoDragMargin(AMargin: TdxPreviewPageMargin); dynamic; + procedure DoDrawPageContent(R: TRect; APageIndex: Integer); dynamic; + procedure DoGetPageNumberHintText(out AText: string); dynamic; + procedure DoMarginChanged(AMargin: TdxPreviewPageMargin); dynamic; + procedure DoZoomFactorChanged; dynamic; + procedure DoZoomModeChanged; dynamic; + procedure DoSelectedPageChanging; dynamic; + procedure DoSelectedPageChanged; dynamic; + + procedure DrawMargins(DC: HDC); + procedure DrawPageBackground(const R: TRect; APageIndex: Integer); virtual; + procedure DrawPageBorder(DC: HDC; APageIndex: Integer); virtual; + + procedure InvalidateMargins; + procedure InvalidatePageBorder(APageIndex: Integer); + + property ScrollBarStyle: TScrollBarStyle read FScrollBarStyle write SetScrollBarStyle default ssRegular; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + procedure LoadFromRegistry(const ARegistryPath: string); virtual; + procedure SaveToRegistry(const ARegistryPath: string); virtual; + + function DefaultColor: TColor; virtual; + function DefaultNoPagesText: string; virtual; + + procedure BeginUpdate; + procedure CancelUpdate; + procedure EndUpdate; + function IsUpdateLocked: Boolean; + + procedure GetPartVisiblePageRanges(AStartIndex, AEndIndex: PInteger ); overload; + procedure GetPartVisiblePageRanges(out AStartIndex, AEndIndex: Integer); overload; + procedure GetVisiblePageRanges(AStartIndex, AEndIndex: PInteger ); overload; + procedure GetVisiblePageRanges(out AStartIndex, AEndIndex: Integer); overload; + + procedure InvalidatePage(APageIndex: Integer); + procedure InvalidatePages; + procedure InvalidatePagesContent; + procedure InvalidatePagesFooter; + procedure InvalidatePagesHeader; + + procedure CalcPagesBounds(ATopPos, VWidth, VHeight: Integer); + function GetHitInfoAt(const Pt: TPoint): TdxPreviewHitTests; overload; + function GetHitInfoAt(const Pt: TSmallPoint): TdxPreviewHitTests; overload; + function GetHitInfoAt(X, Y: Integer): TdxPreviewHitTests; overload; + procedure HideAllHints; + procedure MakeVisible(APageIndex: Integer); + procedure SetPageXYCount(XCount, YCount: Integer); + + procedure ZoomIn; + procedure ZoomOut; + + function MarginFromPoint(const Pt: TPoint): TdxPreviewPageMargin; overload; + function MarginFromPoint(const Pt: TSmallPoint): TdxPreviewPageMargin; overload; + function MarginFromPoint(X, Y: Integer): TdxPreviewPageMargin; overload; + function MarginValueToString(Value: Integer): string; + + function IndexOfPage(APage: TdxPreviewPage): Integer; + function PageIndexFromPoint(const Pt: TPoint): Integer; overload; + function PageIndexFromPoint(const Pt: TSmallPoint): Integer; overload; + function PageIndexFromPoint(X, Y: Integer): Integer; overload; + function PageSizeToString: string; + + procedure SelectFirstPage; + procedure SelectLastPage; + procedure SelectNextPage; + procedure SelectPrevPage; + + property ActualMeasurementUnits: TdxPreviewMeasurementUnits read GetActualMeasurementUnits; + property ActualOriginalPageSize: TPoint read FActualOriginalPageSize; // in tenths of a mm with Orientation + property AllRowCount: Integer read GetAllRowCount; + property BorderStyle: TBorderStyle read FBorderStyle write SetBorderStyle default bsSingle; + property ColCount: Integer read GetColCount; + property Color: TColor read GetColor write SetColor stored IsColorStored default clDefault; + property DraggingMargin: TdxPreviewPageMargin read FDraggingMargin; + property Indent: Integer read FIndent; + property LeftPos: Integer read FLeftPos write SetLeftPos; + property LookAndFeel: TdxPreviewLookAndFeel read FLookAndFeel write SetLookAndFeel default plfStandard; + property MarginColor: TColor read FMarginColor write SetMarginColor default clWindowText; + property Margins: TdxPreviewPageMargins read FMargins write SetMargins; + property MaxZoomFactor: Integer read FMaxZoomFactor write SetMaxZoomFactor default 500; + property MeasurementUnits: TdxPreviewMeasurementUnits read FMeasurementUnits write FMeasurementUnits default pmuDefault; + property MinFooterSize: Integer read FMinFooterSize write SetMinFooterSize default dxPreviewMinHeaderFooterSize; + property MinHeaderSize: Integer read FMinHeaderSize write SetMinHeaderSize default dxPreviewMinHeaderFooterSize; + property MinUsefulSize: TPoint read FMinUsefulSize write SetMinUsefulSize; + property MinZoomFactor: Integer read FMinZoomFactor write SetMinZoomFactor default 10; + property NoPagesText: string read GetNoPagesText write SetNoPagesText stored IsNoPagesTextStored; + property OptionsBehavior: TdxPreviewOptionsBehavior read FOptionsBehavior write SetOptionsBehavior + default [pobAllowDragMargins, pobKeyNavigation, pobThumbTracking, pobAutoSwapMargins]; + property OptionsHint: TdxPreviewOptionsHint read FOptionsHint write SetOptionsHint + default [pohShowForMargins, pohShowOnDrag, pohShowOnScroll]; + property OptionsStore: TdxPreviewOptionsStore read FOptionsStore write SetOptionsStore default [posZoom]; + property OptionsView: TdxPreviewOptionsView read FOptionsView write SetOptionsView + default [povAutoHideScrollBars, povDefaultDrawPageBackground, povMargins, povPageSelection]; + property OptionsZoom: TdxPreviewOptionsZoom read FOptionsZoom write SetOptionsZoom default [pozZoomOnClick]; + property Orientation: TdxPreviewPaperOrientation read FOrientation write SetOrientation default ppoPortrait; + property OriginalPageSize: TdxPointWrapper read FOriginalPageSize write SetOriginalPageSize; // in tenths of a mm + property PageBackground: TdxBackground read FPageBackground write SetPageBackground; + property PageCount: Integer read GetPageCount write SetPageCount; + property Pages[Index: Integer]: TdxPreviewPage read GetPage; + property PageSize: TPoint read FPageSize; // in pixels = 100% zoom + property PageXCount: Integer read FPageXCount write SetPageXCount default 1; + property PageYCount: Integer read FPageYCount write SetPageYCount default 1; + property RegistryPath: string read FRegistryPath write FRegistryPath; + property RowCount: Integer read GetRowCount; + property ScrollBars: TScrollStyle read FScrollBars write SetScrollBars default ssBoth; + property SelectionFrameThickness: Integer read FSelectionFrameThickness write SetSelectionFrameThickness default 2; + property SelPageCol: Integer read GetSelPageCol; + property SelPageIndex: Integer read FSelPageIndex write SetSelPageIndex; + property SelPageRow: Integer read GetSelPageRow; + property TopPos: Integer read FTopPos write SetTopPos; + property VirtualHeight: Integer read GetVirtualHeight; + property VirtualWidth: Integer read GetVirtualWidth; + property VisiblePageSize: TPoint read GetVisiblePageSize; + property Zoomed: Boolean read FZoomed write SetZoomed; + property ZoomFactor: Integer read FZoomFactor write SetZoomFactor stored True default 100; + property ZoomMode: TdxPreviewZoomMode read FZoomMode write SetZoomMode default pzmNone; //Pages; + property ZoomStep: Integer read FZoomStep write SetZoomStep default 10; + + property OnAfterDragMargin: TdxMarginEvent read FOnAfterDragMargin write FOnAfterDragMargin; + property OnBeforeDragMargin: TdxMarginEvent read FOnBeforeDragMargin write FOnBeforeDragMargin; + property OnCalcPageCount: TNotifyEvent read FOnCalcPageCount write SetOnCalcPageCount; + property OnDrawPageBackground: TdxPageBackgroundDrawEvent read FOnDrawPageBackground write FOnDrawPageBackground; + property OnDragMargin: TdxMarginEvent read FOnDragMargin write FOnDragMargin; + property OnDrawPageContent: TdxDrawPageContentEvent read FOnDrawPageContent write FOnDrawPageContent; + property OnGetPageNumberHint: TdxGetPageNumberHintEvent read FOnGetPageNumberHint write FOnGetPageNumberHint; + property OnCanShowMarginHint: TdxCanShowMarginHintEvent read FOnCanShowMarginHint write FOnCanShowMarginHint; + property OnChangePageCount: TNotifyEvent read FOnChangePageCount write FOnChangePageCount; + property OnMarginChanged: TdxMarginEvent read FOnMarginChanged write FOnMarginChanged; + property OnPostDrawPageContent: TdxDrawPageContentEvent read FOnPostDrawPageContent write FOnPostDrawPageContent; + property OnSelectedPageChanged: TdxPreviewPageEvent read FOnSelectedPageChanged write FOnSelectedPageChanged; + property OnSelectedPageChanging: TdxPreviewPageEvent read FOnSelectedPageChanging write FOnSelectedPageChanging; + property OnSelectingPage: TdxSelectingPageEvent read FOnSelectingPage write FOnSelectingPage; + property OnZoomFactorChanged: TNotifyEvent read FOnZoomFactorChanged write FOnZoomFactorChanged; + property OnZoomModeChanged: TNotifyEvent read FOnZoomModeChanged write FOnZoomModeChanged; + end; + + TdxPreview = class(TCustomdxPreview) + published + property Align; + property Anchors; + property BorderStyle; + property Color default clBtnShadow; + property Constraints; + property Ctl3D; + property DragMode; + property Enabled; + property LookAndFeel; + property MarginColor; + property Margins; + property MaxZoomFactor; + property MeasurementUnits; + property MinFooterSize; + property MinHeaderSize; + property MinZoomFactor; + property OptionsBehavior; + property OptionsHint; + property OptionsStore; + property OptionsView; + property OptionsZoom; + property Orientation; + property OriginalPageSize; + property PageBackground; + property PageXCount; + property PageYCount; + {$IFDEF DELPHI7} + property ParentBackground; + {$ENDIF} + property ParentColor default False; + property ParentCtl3D; + property ParentShowHint; + property PopupMenu; + property ScrollBars; + property ShowHint; + property TabOrder; + property TabStop; + property Visible; + property ZoomFactor; + property ZoomMode; + property ZoomStep; + property OnAfterDragMargin; + property OnBeforeDragMargin; + property OnCalcPageCount; + property OnCanResize; + property OnConstrainedResize; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnClick; + property OnDblClick; + property OnDragDrop; + property OnDragMargin; + property OnDragOver; + property OnDrawPageBackground; + property OnDrawPageContent; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnGetPageNumberHint; + property OnCanShowMarginHint; + property OnMarginChanged; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnResize; + property OnSelectedPageChanged; + property OnSelectedPageChanging; + property OnSelectingPage; + property OnStartDrag; + property OnZoomFactorChanged; + property OnZoomModeChanged; + end; + +const + phtMargins: TdxPreviewHitTests = [phtMarginLeft..phtMarginFooter]; + phtMarginsHorz: TdxPreviewHitTests = [phtMarginTop, phtMarginBottom, phtMarginHeader]; + phtMarginsVert: TdxPreviewHitTests = [phtMarginLeft, phtMarginRight]; + PreviewScrollBarStyleMap: array[TdxPreviewLookAndFeel] of TScrollBarStyle = (ssRegular, ssFlat, ssHotTrack); + +implementation + +uses + {$IFDEF DELPHI7} + Themes, + UxTheme, + {$ENDIF} + Math, TypInfo, Registry, CommCtrl, cxClasses, dxPSRes, dxPSImgs, dxExtCtrls; + +type + TFloat = Extended; + +const + { strings used when saving(loading) properties to(from) registry } + sdxOptionsBehavior = 'OptionsBehavior'; // Don't localize + sdxOptionsHint = 'OptionHint'; // Don't localize + sdxOptionsView = 'OptionView'; // Don't localize + sdxOptionsZoom = 'OptionZoom'; // Don't localize + sdxZoomFactor = 'ZoomFactor'; // Don't localize + sdxZoomStep = 'ZoomStep'; // Don't localize + sdxZoomMode = 'ZoomMode'; // Don't localize + sdxPageXCount = 'PageXCount'; // Don't localize + sdxPageYCount = 'PageYCount'; // Don't localize + sdxMarginColor = 'MarginColor'; // Don't localize + sdxMeasurementUnits = 'MeasurementUnits'; // Don't localize + sdxOrientation = 'Orientation'; // Don't localize + + NullDraggingPos = -Maxint; + dxShowHintTimerID = 1; + dxHideHintTimerID = 2; + + dxPreviewHideHintShortTime = 500; + dxPreviewHideHintLongTime = 10000; + dxPreviewShowHintTime = 500; + +var + A4_LOMETRIC: TPoint = (X: 2100; Y: 2970); + FLongShowHintTime: DWORD; + + crdxPreviewHorzResize: TCursor; + crdxPreviewVertResize: TCursor; + crdxPreviewZoomIn: TCursor; + crdxPreviewZoomOut: TCursor; + crdxPreviewFullScroll: TCursor; + crdxPreviewHorzScroll: TCursor; + crdxPreviewVertScroll: TCursor; + crdxPreviewUpScroll: TCursor; + crdxPreviewRightScroll: TCursor; + crdxPreviewDownScroll: TCursor; + crdxPreviewLeftScroll: TCursor; + crdxPreviewTopLeftScroll: TCursor; + crdxPreviewBottomLeftScroll: TCursor; + crdxPreviewTopRightLeftScroll: TCursor; + crdxPreviewBottomRightScroll: TCursor; + + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} +{$ENDIF} + +function GetDefaultMeasurementUnits: TdxPreviewMeasurementUnits; +begin + if GetLocaleChar(LOCALE_USER_DEFAULT, LOCALE_IMEASURE, '0') = '0' then + Result := pmuMillimeters + else + Result := pmuInches; +end; + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM ON} +{$ENDIF} + +function LoMetricToPixels(const Pt: TPoint): TPoint; overload; +var + DC: HDC; +begin + DC := GetDC(0); + try + Result.X := MulDiv(Pt.X, GetDeviceCaps(DC, LOGPIXELSX), 254); + Result.Y := MulDiv(Pt.Y, GetDeviceCaps(DC, LOGPIXELSY), 254); + //Result.X := MulDiv(Value.X, GetDeviceCaps(DC, HORZRES), 10 * GetDeviceCaps(DC, HORZSIZE)); + //Result.Y := MulDiv(Value.Y, GetDeviceCaps(DC, VERTRES), 10 * GetDeviceCaps(DC, VERTSIZE)); + finally + ReleaseDC(0, DC); + end; +end; + +function LoMetricToPixels(Value: Integer): Integer; overload; +var + DC: HDC; +begin + DC := GetDC(0); + try + Result := MulDiv(Value, GetDeviceCaps(DC, LOGPIXELSX), 254); + //Result := MulDiv(Value, GetDeviceCaps(DC, HORZRES), 10 * GetDeviceCaps(DC, HORZSIZE)); + finally + ReleaseDC(0, DC); + end; +end; + +function PixelsToLoMetric(Value: Integer): Integer; +var + DC: HDC; +begin + DC := GetDC(0); + try + Result := MulDiv(Value, 254, GetDeviceCaps(DC, LOGPIXELSX)); + finally + ReleaseDC(0, DC); + end; +end; + +function LoMetricToAnother(Units: TdxPreviewMeasurementUnits; Value: Integer): TFloat; +var + AUnits: TdxPreviewMeasurementUnits; +begin + if Units = pmuDefault then + AUnits := GetDefaultMeasurementUnits + else + AUnits := Units; + + case AUnits of + pmuInches: + Result := Value / 254; + pmuMillimeters: + Result := Value / 10; + pmuCentimeters: + Result := Value / 100; + pmuPoints: + Result := Value * 72 / 254; + else { pmuPicas} + Result := Value * 6 / 254; + end; +end; + +function Min(const V1, V2: Integer): Integer; +begin + if V1 < V2 then + Result := V1 + else + Result := V2; +end; + +function Max(const V1, V2: Integer): Integer; +begin + if V1 > V2 then + Result := V1 + else + Result := V2; +end; + +function MinMax(const V, V1, V2: Integer): Integer; +begin + if (V2 >= V1) then + begin + if (V < V1) then + Result := V1 + else if (V > V2) then + Result := V2 + else + Result := V; + end + else + Result := V2; +end; + +type + TdxPreviewHintWindow = class(TCustomControl) + private + FirstPos: TPoint; + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); Message WM_ERASEBKGND; + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure Paint; override; + + procedure DrawBorder(DC: HDC; R: TRect); + procedure DrawText(DC: HDC; const R: TRect); + public + constructor Create(AOwner: TComponent); override; + procedure ActivateHint(P: TPoint; const AHint: string; Margin: TdxPreviewPageMargin); + end; + +constructor TdxPreviewHintWindow.Create(AOwner: TComponent); +var + NCM: TNonClientMetrics; +begin + inherited; + NCM.cbSize := SizeOf(TNonClientMetrics); + if SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, @NCM, 0) then + Canvas.Font.Handle := CreateFontIndirect(NCM.lfStatusFont) + else + Canvas.Font.Size := 8; +end; + +procedure TdxPreviewHintWindow.ActivateHint(P: TPoint; const AHint: string; Margin: TdxPreviewPageMargin); +var + R: TRect; + AWidth, AHeight: Integer; +begin + Application.CancelHint; + Caption := AHint; + + R := MakeRect(0, 0, Screen.Width, 0); + Windows.DrawText(Canvas.Handle, PChar(AHint), Length(AHint), R, + DT_CALCRECT or DT_LEFT or DT_NOPREFIX); + Inc(R.Right, 2 * (1 + 2)); + Inc(R.Bottom, 2 * (1 + 2)); + AWidth := R.Right; + AHeight := R.Bottom; + if IsWindowVisible(Handle) then + begin + if AWidth < Width then AWidth := Width; + if AHeight < Height then AHeight := Height; + end + else + FirstPos := P; + + if Assigned(Margin) then + begin + if Margin.IsForward then + if Margin.IsVertical then + OffsetRect(R, -(dxPreviewDragHintOffset + AWidth), dxPreviewDragHintOffset) + else + OffsetRect(R, dxPreviewDragHintOffset, -(dxPreviewDragHintOffset + AHeight)) + else + OffsetRect(R, dxPreviewDragHintOffset, dxPreviewDragHintOffset); + end + else {scroll bar hint} + OffsetRect(R, -(GetSystemMetrics(SM_CXVSCROLL) + AWidth), 0); + + OffsetRect(R, FirstPos.X, FirstPos.Y); + + with R do + begin + if Right > Screen.Width then + OffsetRect(R, Screen.Width - Right, 0); + if Bottom > Screen.Height then + OffsetRect(R, 0, Screen.Height - Bottom); + if Left < 0 then OffsetRect(R, -Left, 0); + if Top < 0 then OffsetRect(R, 0, -Top); + end; + + if IsWindowVisible(Handle) then + if (Width <> AWidth) or (Height <> AHeight) then + ShowWindow(Handle, SW_HIDE) + else + begin + InvalidateRect(Handle, nil, False); + UpdateWindow(Handle); + end; + + if not IsWindowVisible(Handle) then + SetWindowPos(Handle, HWND_TOPMOST, R.Left, R.Top, AWidth, AHeight, + SWP_SHOWWINDOW or SWP_NOACTIVATE); +end; + +procedure TdxPreviewHintWindow.WMEraseBkgnd(var Message: TWMEraseBkgnd); +begin + Message.Result := 1; +end; + +procedure TdxPreviewHintWindow.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + begin + Style := WS_POPUP or WS_DISABLED; + WindowClass.Style := WindowClass.Style or CS_SAVEBITS; + if IsWin32Version(5, 1) then + WindowClass.Style := WindowClass.Style or CS_DROPSHADOW; + ExStyle := WS_EX_TOOLWINDOW; + end; +end; + +procedure TdxPreviewHintWindow.Paint; +var + R: TRect; + DC: HDC; +begin + //GetClientRect(Handle, ); + R := ClientRect; + DC := Canvas.Handle; + DrawBorder(DC, R); + InflateRect(R, -1, -1); + DrawText(DC, R); +end; + +procedure TdxPreviewHintWindow.DrawBorder(DC: HDC; R: TRect); +begin + {$IFDEF DELPHI7} + with ThemeServices do + if ThemesEnabled then + begin + DrawEdge(DC, GetElementDetails(twWindowRoot), R, BDR_RAISEDOUTER, BF_RECT); + Exit; + end; + {$ENDIF} + DrawEdge(DC, R, BDR_RAISEDOUTER, BF_RECT); +end; + +procedure TdxPreviewHintWindow.DrawText(DC: HDC; const R: TRect); +begin + SetTextColor(DC, GetSysColor(COLOR_INFOTEXT)); + SetBkColor(DC, GetSysColor(COLOR_INFOBK)); + ExtTextOut(DC, R.Left + 2, R.Top + 2, ETO_OPAQUE, @R, PChar(Caption), Length(Caption), nil); +end; + +{ TdxPreviewPageBackground } + +constructor TdxPreviewPageBackground.Create; +begin + inherited; + FBitmap := TBitmap.Create; +end; + +destructor TdxPreviewPageBackground.Destroy; +begin + FreeAndNil(FBitmap); + inherited; +end; + +procedure TdxPreviewPageBackground.Paint(ACanvas: TCanvas; const R: TRect); +begin + if (Mode = bmPicture) and (PictureMode = ppmCenter) and (Preview.ZoomFactor <> 100) then + begin + FBitmap.Width := MulDiv(Picture.Width, Preview.ZoomFactor, 100); + FBitmap.Height := MulDiv(Picture.Height, Preview.ZoomFactor, 100); + FBitmap.Canvas.StretchDraw(MakeRect(0, 0, FBitmap.Width, FBitmap.Height), Picture); + dxBkgnd.DrawPicture(FBitmap, ACanvas, R, PictureMode, 1, 1); + end + else + inherited; +end; + +procedure TdxPreviewPageBackground.DoApply; +begin + inherited; + if HasPreview and not Preview.IsUpdateLocked then + begin + Preview.InvalidatePages; + Preview.DesignerModified; + end; +end; + +procedure TdxPreviewPageBackground.DoChange(AChangeWhats: TdxBackgroundParams); +begin + inherited; + if (UpdateCount = 0) and IsRepaintNeeded and HasPreview and not Preview.IsUpdateLocked then + FPreview.InvalidatePages; +end; + +function TdxPreviewPageBackground.HasPreview: Boolean; +begin + Result := Preview <> nil; +end; + +{ TdxPreviewPage } + +constructor TdxPreviewPage.Create(APreview: TCustomdxPreview); +begin + inherited Create; + Assert(APreview <> nil); + FPreview := APreview; +end; + +function TdxPreviewPage.GetCursor: TCursor; +begin + //if Selected then + if Zoomed then + Result := crdxPreviewZoomOut + else + Result := crdxPreviewZoomIn; +end; + +function TdxPreviewPage.HasPoint(const Pt: TPoint): Boolean; +var + R: TRect; +begin + Result := IntersectRect(R, SiteBounds, Preview.ClientRect) and PtInRect(R, Pt); +end; + +function TdxPreviewPage.HasPoint(X, Y: Integer): Boolean; +begin + Result := HasPoint(MakePoint(X, Y)); +end; + +procedure TdxPreviewPage.MakeVisible; +begin + Preview.MakeVisible(Index); +end; + +function TdxPreviewPage.GetIndex: Integer; +begin + Result := Preview.IndexOfPage(Self); +end; + +function TdxPreviewPage.GetPartVisible: Boolean; +var + R: TRect; +begin + Result := IntersectRect(R, Bounds, Preview.ClientRect); +end; + +function TdxPreviewPage.GetSelected: Boolean; +begin + Result := Preview.SelPageIndex = Index; +end; + +function TdxPreviewPage.GetSiteBounds: TRect; +begin + Result := Bounds; + with Result do + begin + Dec(Left, 2); + Dec(Top, 2); + Inc(Right, Preview.Indent - 2); + Inc(Bottom, Preview.Indent - 2); + end; +end; + +function TdxPreviewPage.GetVisible: Boolean; +var + R: TRect; +begin + Result := IntersectRect(R, Bounds, Preview.ClientRect) and EqualRect(R, Bounds); +end; + +function TdxPreviewPage.GetZoomed: Boolean; +begin + Result := Selected and Preview.Zoomed; +end; + +procedure TdxPreviewPage.SetBounds(const Value: TRect); +begin + FBounds := Value; +end; + +procedure TdxPreviewPage.SetSelected(Value: Boolean); +begin + Preview.SelPageIndex := Index; +end; + +{ TdxPreviewPageMargin } + +constructor TdxPreviewPageMargin.Create(AMargins: TdxPreviewPageMargins); +begin + inherited Create; + FMargins := AMargins; + FDraggingPos := NullDraggingPos; + FEnabled := True; + FMaxValue := -1; + FVisible := True; +end; + +procedure TdxPreviewPageMargin.Assign(Source: TPersistent); +begin + if Source is TdxPreviewPageMargin then + begin + BeginUpdate; + try + DoAssign(TdxPreviewPageMargin(Source)); + finally + EndUpdate; + end; + end + else + inherited; +end; + +procedure TdxPreviewPageMargin.RestoreDefaults; +begin + BeginUpdate; + try + DoRestoreDefaults; + finally + EndUpdate; + end; +end; + +procedure TdxPreviewPageMargin.BeginUpdate; +begin + if Margins <> nil then Margins.BeginUpdate; +end; + +procedure TdxPreviewPageMargin.EndUpdate; +begin + if Margins <> nil then Margins.EndUpdate; +end; + +function TdxPreviewPageMargin.DefaultCaption: string; +begin + Result := ''; +end; + +function TdxPreviewPageMargin.DefaultValue: Integer; +begin + Result := 0; +end; + +function TdxPreviewPageMargin.GetHitTest: TdxPreviewHitTest; +begin + Result := phtPage; +end; + +function TdxPreviewPageMargin.GetCursor: TCursor; +begin + Result := crDefault; +end; + +function TdxPreviewPageMargin.HasPoint(const Pt: TPoint): Boolean; +begin + Result := Visible and Enabled and PtInRect(SelectableBounds, Pt); +end; + +function TdxPreviewPageMargin.HasPoint(const Pt: TSmallPoint): Boolean; +begin + Result := HasPoint(SmallPointToPoint(Pt)); +end; + +function TdxPreviewPageMargin.HasPoint(X, Y: Integer): Boolean; +begin + Result := HasPoint(MakePoint(X, Y)); +end; + +procedure TdxPreviewPageMargin.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('IsCaptionAssigned', ReadIsCaptionAssigned, WriteIsCaptionAssigned, + FIsCaptionAssigned and (FCaption = '')); +end; + +function TdxPreviewPageMargin.GetIsForceRecalculatePageCount: Boolean; +begin + Result := False; +end; + +function TdxPreviewPageMargin.GetIsForward: Boolean; +begin + Result := False; +end; + +function TdxPreviewPageMargin.GetIsVertical: Boolean; +begin + Result := False; +end; + +function TdxPreviewPageMargin.DoGetActualMaxValue: Integer; +begin + Result := MaxValue; +end; + +function TdxPreviewPageMargin.DoGetActualMinValue: Integer; +begin + Result := MinValue; +end; + +function TdxPreviewPageMargin.DoGetMaxMinValue: Integer; +begin + Result := 0; +end; + +function TdxPreviewPageMargin.DoPosFromValue(AValue: Integer): Integer; +begin + Result := AValue; +end; + +function TdxPreviewPageMargin.DoValueFromPos(APos: Integer): Integer; +begin + Result := APos; +end; + +procedure TdxPreviewPageMargin.Changed(HardRefresh: Boolean); +begin + if Margins <> nil then + if HardRefresh then + Margins.Update(nil) + else + Margins.Update(Self) +end; + +procedure TdxPreviewPageMargin.DoAssign(Source: TdxPreviewPageMargin); +begin + Enabled := Source.Enabled; + MaxValue := Source.MaxValue; + MinValue := Source.MinValue; + Value := Source.Value; + Visible := Source.Visible; +end; + +procedure TdxPreviewPageMargin.DoDragAfter; +begin + if Preview <> nil then + begin + Preview.DestroyHint; + DeleteObject(FScreenBitmap); + Invert(Preview.FDC); + Preview.DoAfterDragMargin(Self); + end; +end; + +procedure TdxPreviewPageMargin.DoDragBefore; +var + DC: HDC; +begin + if Preview <> nil then + begin + Preview.DoBeforeDragMargin(Self); + + DC := GetDC(Preview.Handle); + try + Invert(DC); + with PageBounds do + if IsVertical then + FScreenBitmap := CreateCompatibleBitmap(DC, 1, Bottom - Top) + else + FScreenBitmap := CreateCompatibleBitmap(DC, Right - Left, 1); + finally + ReleaseDC(Preview.Handle, DC); + end; + + with Preview do + if pohShowOnDrag in OptionsHint then + CreateHint + else + DestroyHint; + end; +end; + +procedure TdxPreviewPageMargin.DoRestoreDefaults; +begin + Enabled := True; + MaxValue := -1; + MinValue := 0; + Value := DefaultValue; + Visible := True; + FIsCaptionAssigned := False; +end; + +procedure TdxPreviewPageMargin.Draw(DC: HDC); +var + R: TRect; + Pen: HPEN; +begin + if Preview <> nil then + begin + R := Bounds; + Pen := SelectObject(DC, Preview.FMarginPen); + SetBkMode(DC, Windows.TRANSPARENT); + with R do + if IsVertical then + begin + MoveToEx(DC, Left, Top, nil); + LineTo(DC, Left, Bottom); + end + else + begin + MoveToEx(DC, Left, Top, nil); + LineTo(DC, Right, Top); + end; + SetBkMode(DC, Windows.OPAQUE); + SelectObject(DC, Pen); + end; +end; + +procedure TdxPreviewPageMargin.Invalidate; +var + R: TRect; +begin + if (Preview <> nil) and Preview.HandleAllocated then + begin + R := Bounds; + if IsVertical then + Inc(R.Right) + else + Inc(R.Bottom); + + InvalidateRect(Preview.Handle, @R, False); + end; +end; + +procedure TdxPreviewPageMargin.Invert(DC: HDC); +begin + with Bounds do + BitBlt(DC, Left, Top, + Right - Left + Ord(IsVertical), Bottom - Top + Ord(not IsVertical), 0, 0, 0, DSTINVERT); +end; + +function TdxPreviewPageMargin.CheckValue(Value: Integer): Integer; +begin + Result := Value; + if Result < ActualMinValue then Result := ActualMinValue; + if Result > ActualMaxValue then Result := ActualMaxValue; +end; + +function TdxPreviewPageMargin.PosFromValue(AValue: Integer): Integer; +begin + Result := LoMetricToPixels(AValue); + if Preview <> nil then + Result := MulDiv(Result, Preview.ZoomFactor, 100); + Result := DoPosFromValue(Result); +end; + +function TdxPreviewPageMargin.ValueFromPos(APos: Integer): Integer; +begin + if APos = MinPos then + if IsForward then + Result := ActualMinValue + else + Result := ActualMaxValue + else + if APos = MaxPos then + if IsForward then + Result := ActualMaxValue + else + Result := ActualMinValue + else + if APos = PosFromValue(FValue) then + Result := FValue + else + begin + Result := DoValueFromPos(APos); + if Preview <> nil then + Result := PixelsToLoMetric(MulDiv(Result, 100, Preview.ZoomFactor)); + CheckValue(Result); + end; +end; + +function TdxPreviewPageMargin.GetActualMaxValue: Integer; +begin + if (Preview <> nil) and Preview.CanChangeMargins then + begin + Result := DoGetActualMaxValue; + if (FMaxValue <> -1) and (Result > FMaxValue) then + Result := FMaxValue; + end + else + Result := FMaxValue; +end; + +function TdxPreviewPageMargin.GetActualMinValue: Integer; +begin + if (Preview <> nil) and Preview.CanChangeMargins then + begin + Result := DoGetActualMinValue; + if Result < MinValue then Result := MinValue; + end + else + Result := MinValue; +end; + +function TdxPreviewPageMargin.GetBounds: TRect; +var + V: Integer; +begin + if IsDragging and (DraggingPos <> NullDraggingPos) then + V := DraggingPos + else + V := PosFromValue(Value); + + Result := PageBounds; + with Result do + if IsVertical then + begin + Left := V; + Right := V; + end + else + begin + Top := V; + Bottom := V; + end; +end; + +function TdxPreviewPageMargin.GetCaption: string; +begin + if FIsCaptionAssigned then + Result := FCaption + else + Result := DefaultCaption; +end; + +function TdxPreviewPageMargin.GetDisplayText: string; +begin + Result := Caption; + if Preview <> nil then + begin + Result := Result + ': '; + if IsDragging then + Result := Result + Preview.MarginValueToString(DraggingValue) + else + Result := Result + Preview.MarginValueToString(Value); + end; +end; + +function TdxPreviewPageMargin.GetDraggingValue: Integer; +begin + if FDraggingPos = NullDraggingPos then + Result := -1 + else + Result := ValueFromPos(FDraggingPos); +end; + +function TdxPreviewPageMargin.GetIsDragging: Boolean; +begin + Result := (Preview <> nil) and (Preview.DraggingMargin = Self); +end; + +function TdxPreviewPageMargin.GetMaxPos: Integer; +begin + if IsForward then + Result := PosFromValue(ActualMaxValue) + else + Result := PosFromValue(ActualMinValue); +end; + +function TdxPreviewPageMargin.GetMinPos: Integer; +begin + if IsForward then + Result := PosFromValue(ActualMinValue) + else + Result := PosFromValue(ActualMaxValue); +end; + +function TdxPreviewPageMargin.GetPageBounds: TRect; +begin + if Preview <> nil then + with Preview do + if SelPageIndex = -1 then + if PageCount > 0 then + Result := Pages[0].Bounds + else + Result := NullRect + else + Result := Pages[SelPageIndex].Bounds + else + Result := NullRect; +end; + +function TdxPreviewPageMargin.GetPreview: TCustomdxPreview; +begin + if Margins <> nil then + Result := Margins.Preview + else + Result := nil; +end; + +function TdxPreviewPageMargin.GetSelectableBounds: TRect; +begin + Result := Bounds; + if IsVertical then + InflateRect(Result, dxPreviewMarginSelectDelta, 0) + else + InflateRect(Result, 0, dxPreviewMarginSelectDelta); +end; + +function TdxPreviewPageMargin.GetVisibleValue: Integer; +begin + Result := LoMetricToPixels(Value); + if Preview <> nil then + Result := MulDiv(Result, Preview.ZoomFactor, 100); +end; + +function TdxPreviewPageMargin.IsCaptionStored: Boolean; +begin + Result := FIsCaptionAssigned and (FCaption <> DefaultCaption); +end; + +function TdxPreviewPageMargin.IsValueStored: Boolean; +begin + Result := Value <> DefaultValue; +end; + +procedure TdxPreviewPageMargin.SetCaption(const Value: string); +begin + if Caption <> Value then + begin + FCaption := Value; + FIsCaptionAssigned := True; + end; +end; + +procedure TdxPreviewPageMargin.SetDraggingPos(Value: Integer); +var + DC, BitmapDC: HDC; +begin + if Preview <> nil then + begin + if Value <> NullDraggingPos then + begin + if Value < MinPos then Value := MinPos; + if Value > MaxPos then Value := MaxPos; + end; + + if FDraggingPos <> Value then + begin + DC := GetDC(Preview.Handle); + try + BitmapDC := CreateCompatibleDC(DC); + try + FScreenBitmap := SelectObject(BitmapDC, FScreenBitmap); + if FDraggingPos <> NullDraggingPos then + // restore screen image + with PageBounds do + if IsVertical then + BitBlt(DC, FDraggingPos, Top, 1, Bottom - Top, BitmapDC, 0, 0, SRCCOPY) + else + BitBlt(DC, Left, FDraggingPos, Right - Left, 1, BitmapDC, 0, 0, SRCCOPY); + FDraggingPos := Value; + if FDraggingPos <> NullDraggingPos then + begin + Preview.ActivateHint(Self); + // save screen image + with PageBounds do + if IsVertical then + BitBlt(BitmapDC, 0, 0, 1, Bottom - Top, DC, FDraggingPos, Top, SRCCOPY) + else + BitBlt(BitmapDC, 0, 0, Right - Left, 1, DC, Left, FDraggingPos, SRCCOPY); + Draw(DC); + end; + FScreenBitmap := SelectObject(BitmapDC, FScreenBitmap); + finally + DeleteDC(BitmapDC); + end; + finally + ReleaseDC(Preview.Handle, DC); + end; + + if FDraggingPos <> NullDraggingPos then + Preview.DoDragMargin(Self); + end; + end; +end; + +procedure TdxPreviewPageMargin.SetMaxValue(Value: Integer); +begin + if Value < -1 then Value := -1; + if FMaxValue <> Value then + begin + FMaxValue := Value; + if MaxValue <> -1 then + begin + if MaxValue < MinValue then MinValue := MaxValue; + if FValue > MaxValue then Self.Value := MaxValue; + end; + end; +end; + +procedure TdxPreviewPageMargin.SetMinValue(Value: Integer); +var + V: Integer; +begin + if Value < 0 then Value := 0; + + if FMinValue <> Value then + begin + if (Preview <> nil) and Preview.CanChangeMargins then + begin + V := DoGetMaxMinValue; + if Value > V then Value := V; + end; + FMinValue := Value; + if (MaxValue <> -1) and (MinValue > MaxValue) then + MaxValue := MinValue; + if FValue < MinValue then + Self.Value := MinValue; + end; +end; + +procedure TdxPreviewPageMargin.SetValue(Value: Integer); +begin + Value := CheckValue(Value); + if FValue <> Value then + begin + FValue := Value; + if (Preview <> nil) and Preview.CanChangeMargins then + begin + Preview.DoMarginChanged(Self); + Changed(True); + end; + end; +end; + +procedure TdxPreviewPageMargin.SetEnabled(Value: Boolean); +begin + if FEnabled <> Value then + begin + FEnabled := Value; + Changed(False); + end; +end; + +procedure TdxPreviewPageMargin.SetVisible(Value: Boolean); +begin + if FVisible <> Value then + begin + FVisible := Value; + Changed(False); + end; +end; + +procedure TdxPreviewPageMargin.ReadIsCaptionAssigned(AReader: TReader); +begin + FIsCaptionAssigned := AReader.ReadBoolean; +end; + +procedure TdxPreviewPageMargin.WriteIsCaptionAssigned(AWriter: TWriter); +begin + AWriter.WriteBoolean(FIsCaptionAssigned); +end; + +{ TdxPreviewPageMarginBottom } + +function TdxPreviewPageMarginBottom.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxBottomMargin); +end; + +function TdxPreviewPageMarginBottom.DefaultValue: Integer; +begin + Result := 254; +end; + +function TdxPreviewPageMarginBottom.GetHitTest: TdxPreviewHitTest; +begin + Result := phtMarginBottom; +end; + +function TdxPreviewPageMarginBottom.GetCursor: TCursor; +begin + Result := crdxPreviewVertResize; +end; + +function TdxPreviewPageMarginBottom.GetIsForceRecalculatePageCount: Boolean; +begin + Result := True; +end; + +function TdxPreviewPageMarginBottom.GetIsForward: Boolean; +begin + Result := False; +end; + +function TdxPreviewPageMarginBottom.GetIsVertical: Boolean; +begin + Result := False; +end; + +function TdxPreviewPageMarginBottom.DoGetActualMaxValue: Integer; +begin + Result := Preview.ActualOriginalPageSize.Y - (Preview.MinUsefulSize.Y + + MaxIntValue([Margins.Top.Value, Margins.Top.MinValue, Margins.Header.MinValue + Preview.MinHeaderSize])); +end; + +function TdxPreviewPageMarginBottom.DoGetActualMinValue: Integer; +begin + Result := Min(Margins.Footer.Value + Preview.MinFooterSize, ActualMaxValue); +end; + +function TdxPreviewPageMarginBottom.DoGetMaxMinValue: Integer; +begin + Result := Preview.ActualOriginalPageSize.Y - (Margins.Top.Value + Preview.MinUsefulSize.Y); +end; + +function TdxPreviewPageMarginBottom.DoPosFromValue(AValue: Integer): Integer; +begin + Result := PageBounds.Bottom - 1 - AValue; +end; + +function TdxPreviewPageMarginBottom.DoValueFromPos(APos: Integer): Integer; +begin + Result := PageBounds.Bottom - 1 - APos; +end; + +{ TdxPreviewPageMarginFooter } + +function TdxPreviewPageMarginFooter.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxFooterMargin); +end; + +function TdxPreviewPageMarginFooter.DefaultValue: Integer; +begin + Result := 127; +end; + +function TdxPreviewPageMarginFooter.GetHitTest: TdxPreviewHitTest; +begin + Result := phtMarginFooter; +end; + +function TdxPreviewPageMarginFooter.GetCursor: TCursor; +begin + Result := crdxPreviewVertResize; +end; + +function TdxPreviewPageMarginFooter.GetIsForward: Boolean; +begin + Result := False; +end; + +function TdxPreviewPageMarginFooter.GetIsVertical: Boolean; +begin + Result := False; +end; + +function TdxPreviewPageMarginFooter.DoGetActualMaxValue: Integer; +begin + Result := Preview.ActualOriginalPageSize.Y - (Margins.Top.Value + Preview.MinUsefulSize.Y + Preview.MinFooterSize); +end; + +function TdxPreviewPageMarginFooter.DoGetMaxMinValue: Integer; +begin + Result := Preview.ActualOriginalPageSize.Y - (Margins.Top.Value + Preview.MinUsefulSize.Y + Preview.MinFooterSize); +end; + +function TdxPreviewPageMarginFooter.DoPosFromValue(AValue: Integer): Integer; +begin + Result := PageBounds.Bottom - 1 - AValue; +end; + +function TdxPreviewPageMarginFooter.DoValueFromPos(APos: Integer): Integer; +begin + Result := PageBounds.Bottom - 1 - APos; +end; + +{ TdxPreviewPageMarginHeader } + +function TdxPreviewPageMarginHeader.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxHeaderMargin); +end; + +function TdxPreviewPageMarginHeader.DefaultValue: Integer; +begin + Result := 127; +end; + +function TdxPreviewPageMarginHeader.GetHitTest: TdxPreviewHitTest; +begin + Result := phtMarginHeader; +end; + +function TdxPreviewPageMarginHeader.GetCursor: TCursor; +begin + Result := crdxPreviewVertResize; +end; + +function TdxPreviewPageMarginHeader.GetIsForward: Boolean; +begin + Result := True; +end; + +function TdxPreviewPageMarginHeader.GetIsVertical: Boolean; +begin + Result := False; +end; + +function TdxPreviewPageMarginHeader.DoGetActualMaxValue: Integer; +begin + Result := Preview.ActualOriginalPageSize.Y - (Preview.MinHeaderSize + Preview.MinUsefulSize.Y + Margins.Bottom.Value); +end; + +function TdxPreviewPageMarginHeader.DoGetMaxMinValue: Integer; +begin + Result := Preview.ActualOriginalPageSize.Y - (Margins.Bottom.Value + Preview.MinUsefulSize.Y + Preview.MinHeaderSize); +end; + +function TdxPreviewPageMarginHeader.DoPosFromValue(AValue: Integer): Integer; +begin + Result := PageBounds.Top + AValue; +end; + +function TdxPreviewPageMarginHeader.DoValueFromPos(APos: Integer): Integer; +begin + Result := APos - PageBounds.Top; +end; + +{ TdxPreviewPageMarginLeft } + +function TdxPreviewPageMarginLeft.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxLeftMargin); +end; + +function TdxPreviewPageMarginLeft.DefaultValue: Integer; +begin + Result := 254; +end; + +function TdxPreviewPageMarginLeft.GetHitTest: TdxPreviewHitTest; +begin + Result := phtMarginLeft; +end; + +function TdxPreviewPageMarginLeft.GetCursor: TCursor; +begin + Result := crdxPreviewHorzResize; +end; + +function TdxPreviewPageMarginLeft.GetIsForceRecalculatePageCount: Boolean; +begin + Result := True; +end; + +function TdxPreviewPageMarginLeft.GetIsForward: Boolean; +begin + Result := True; +end; + +function TdxPreviewPageMarginLeft.GetIsVertical: Boolean; +begin + Result := True; +end; + +function TdxPreviewPageMarginLeft.DoGetActualMaxValue: Integer; +begin + Result := Max(ActualMinValue, Preview.ActualOriginalPageSize.X - (Preview.MinUsefulSize.X + Margins.Right.Value)); +end; + +function TdxPreviewPageMarginLeft.DoGetMaxMinValue: Integer; +begin + Result := Preview.ActualOriginalPageSize.X - (Margins.Right.Value + Preview.MinUsefulSize.X); +end; + +function TdxPreviewPageMarginLeft.DoPosFromValue(AValue: Integer): Integer; +begin + Result := PageBounds.Left + AValue; +end; + +function TdxPreviewPageMarginLeft.DoValueFromPos(APos: Integer): Integer; +begin + Result := APos - PageBounds.Left; +end; + +{ TdxPreviewPageMarginRight } + +function TdxPreviewPageMarginRight.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxRightMargin); +end; + +function TdxPreviewPageMarginRight.DefaultValue: Integer; +begin + Result := 254; +end; + +function TdxPreviewPageMarginRight.GetHitTest: TdxPreviewHitTest; +begin + Result := phtMarginRight; +end; + +function TdxPreviewPageMarginRight.GetCursor: TCursor; +begin + Result := crdxPreviewHorzResize; +end; + +function TdxPreviewPageMarginRight.GetIsForceRecalculatePageCount: Boolean; +begin + Result := True; +end; + +function TdxPreviewPageMarginRight.GetIsForward: Boolean; +begin + Result := False; +end; + +function TdxPreviewPageMarginRight.GetIsVertical: Boolean; +begin + Result := True; +end; + +function TdxPreviewPageMarginRight.DoGetActualMaxValue: Integer; +begin + Result := Max(ActualMinValue, Preview.ActualOriginalPageSize.X - (Margins.Left.Value + Preview.MinUsefulSize.X)); +end; + +function TdxPreviewPageMarginRight.DoGetMaxMinValue: Integer; +begin + Result := Preview.ActualOriginalPageSize.X - (Margins.Left.Value + Preview.MinUsefulSize.X); +end; + +function TdxPreviewPageMarginRight.DoPosFromValue(AValue: Integer): Integer; +begin + Result := PageBounds.Right - 1 - AValue; +end; + +function TdxPreviewPageMarginRight.DoValueFromPos(APos: Integer): Integer; +begin + Result := PageBounds.Right - 1 - APos; +end; + +{ TdxPreviewPageMarginTop } + +function TdxPreviewPageMarginTop.DefaultCaption: string; +begin + Result := cxGetResourceString(@sdxTopMargin); +end; + +function TdxPreviewPageMarginTop.DefaultValue: Integer; +begin + Result := 254; +end; + +function TdxPreviewPageMarginTop.GetHitTest: TdxPreviewHitTest; +begin + Result := phtMarginLeft; +end; + +function TdxPreviewPageMarginTop.GetCursor: TCursor; +begin + Result := crdxPreviewVertResize; +end; + +function TdxPreviewPageMarginTop.GetIsForceRecalculatePageCount: Boolean; +begin + Result := True; +end; + +function TdxPreviewPageMarginTop.GetIsForward: Boolean; +begin + Result := True; +end; + +function TdxPreviewPageMarginTop.GetIsVertical: Boolean; +begin + Result := False; +end; + +function TdxPreviewPageMarginTop.DoGetActualMaxValue: Integer; +begin + Result := Preview.ActualOriginalPageSize.Y - + (Preview.MinUsefulSize.Y + + MaxIntValue([Margins.Bottom.Value, Margins.Bottom.MinValue, Preview.MinFooterSize + Margins.Footer.MinValue])); +end; + +function TdxPreviewPageMarginTop.DoGetActualMinValue: Integer; +begin + Result := Min(Margins.Header.Value + Preview.MinHeaderSize, ActualMaxValue); +end; + +function TdxPreviewPageMarginTop.DoGetMaxMinValue: Integer; +begin + Result := Preview.ActualOriginalPageSize.Y - (Margins.Bottom.Value + Preview.MinUsefulSize.Y); +end; + +function TdxPreviewPageMarginTop.DoPosFromValue(AValue: Integer): Integer; +begin + Result := PageBounds.Top + AValue; +end; + +function TdxPreviewPageMarginTop.DoValueFromPos(APos: Integer): Integer; +begin + Result := APos - PageBounds.Top; +end; + +{ TdxPreviewPageMargins } + +constructor TdxPreviewPageMargins.Create(APreview: TCustomdxPreview); +begin + inherited Create; + FPreview := APreview; + FMargins := TList.Create; + AddMargins; +end; + +destructor TdxPreviewPageMargins.Destroy; +begin + FreeAndNilMargins; + inherited; +end; + +procedure TdxPreviewPageMargins.Assign(Source: TPersistent); +begin + if Source is TdxPreviewPageMargins then + begin + BeginUpdate; + try + DoAssign(TdxPreviewPageMargins(Source)); + finally + EndUpdate; + end; + end + else + inherited; +end; + +procedure TdxPreviewPageMargins.RestoreDefaults; +begin + BeginUpdate; + try + DoRestoreDefaults; + finally + EndUpdate; + end; +end; + +procedure TdxPreviewPageMargins.BeginUpdate; +begin + Inc(FUpdateCount); +end; + +procedure TdxPreviewPageMargins.EndUpdate; +begin + Dec(FUpdateCount); + if FUpdateCount = 0 then Update(nil); +end; + +procedure TdxPreviewPageMargins.DoAssign(Source: TdxPreviewPageMargins); +var + I: Integer; +begin + for I := 0 to Count - 1 do + Margins[I].Assign(Source[I]); +end; + +procedure TdxPreviewPageMargins.DoRestoreDefaults; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Margins[I].RestoreDefaults; +end; + +function TdxPreviewPageMargins.AddMargin(AClass: TdxPreviewPageMarginClass): TdxPreviewPageMargin; +begin + Result := AClass.Create(Self); + FMargins.Add(Result); +end; + +procedure TdxPreviewPageMargins.AddMargins; +begin + AddMargin(TdxPreviewPageMarginLeft); + AddMargin(TdxPreviewPageMarginTop); + AddMargin(TdxPreviewPageMarginRight); + AddMargin(TdxPreviewPageMarginBottom); + AddMargin(TdxPreviewPageMarginHeader); + AddMargin(TdxPreviewPageMarginFooter); +end; + +procedure TdxPreviewPageMargins.FreeAndNilMargins; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Margins[I].Free; + FreeAndNil(FMargins); +end; + +procedure TdxPreviewPageMargins.Update(AMargin: TdxPreviewPageMargin); +begin + if (Preview <> nil) and not Preview.IsUpdateLocked then + if AMargin <> nil then + AMargin.Invalidate + else + Preview.Invalidate; +end; + +function TdxPreviewPageMargins.GetCount: Integer; +begin + Result := FMargins.Count; +end; + +function TdxPreviewPageMargins.GetMargin(Index: Integer): TdxPreviewPageMargin; +begin + Result := TdxPreviewPageMargin(FMargins[Index]); +end; + +function TdxPreviewPageMargins.GetMarginByCaption(const Caption: string): TdxPreviewPageMargin; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Margins[I]; + if dxSameText(Result.Caption, Caption) then Exit; + end; + Result := nil; +end; + +function TdxPreviewPageMargins.GetMarginByClass(Index: TdxPreviewPageMarginClass): TdxPreviewPageMargin; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Margins[I]; + if Result.ClassType = Index then Exit; + end; + Result := nil; +end; + +function TdxPreviewPageMargins.GetMarginBottom: TdxPreviewPageMarginBottom; +begin + Result := MarginsByClass[TdxPreviewPageMarginBottom] as TdxPreviewPageMarginBottom; +end; + +function TdxPreviewPageMargins.GetMarginFooter: TdxPreviewPageMarginFooter; +begin + Result := MarginsByClass[TdxPreviewPageMarginFooter] as TdxPreviewPageMarginFooter; +end; + +function TdxPreviewPageMargins.GetMarginHeader: TdxPreviewPageMarginHeader; +begin + Result := MarginsByClass[TdxPreviewPageMarginHeader] as TdxPreviewPageMarginHeader; +end; + +function TdxPreviewPageMargins.GetMarginLeft: TdxPreviewPageMarginLeft; +begin + Result := MarginsByClass[TdxPreviewPageMarginLeft] as TdxPreviewPageMarginLeft; +end; + +function TdxPreviewPageMargins.GetMarginRight: TdxPreviewPageMarginRight; +begin + Result := MarginsByClass[TdxPreviewPageMarginRight] as TdxPreviewPageMarginRight; +end; + +function TdxPreviewPageMargins.GetMarginTop: TdxPreviewPageMarginTop; +begin + Result := MarginsByClass[TdxPreviewPageMarginTop] as TdxPreviewPageMarginTop; +end; + +procedure TdxPreviewPageMargins.SetMargin(Index: Integer; Value: TdxPreviewPageMargin); +begin + Margins[Index].Assign(Value); +end; + +procedure TdxPreviewPageMargins.SetMarginByClass(Index: TdxPreviewPageMarginClass; + Value: TdxPreviewPageMargin); +var + Margin: TdxPreviewPageMargin; +begin + Margin := MarginsByClass[Index]; + if Margin <> nil then + Margin.Assign(Value); +end; + +procedure TdxPreviewPageMargins.SetMarginBottom(Value: TdxPreviewPageMarginBottom); +begin + MarginsByClass[TdxPreviewPageMarginBottom] := Value; +end; + +procedure TdxPreviewPageMargins.SetMarginFooter(Value: TdxPreviewPageMarginFooter); +begin + MarginsByClass[TdxPreviewPageMarginFooter] := Value; +end; + +procedure TdxPreviewPageMargins.SetMarginHeader(Value: TdxPreviewPageMarginHeader); +begin + MarginsByClass[TdxPreviewPageMarginHeader] := Value; +end; + +procedure TdxPreviewPageMargins.SetMarginLeft(Value: TdxPreviewPageMarginLeft); +begin + MarginsByClass[TdxPreviewPageMarginLeft] := Value; +end; + +procedure TdxPreviewPageMargins.SetMarginRight(Value: TdxPreviewPageMarginRight); +begin + MarginsByClass[TdxPreviewPageMarginRight] := Value; +end; + +procedure TdxPreviewPageMargins.SetMarginTop(Value: TdxPreviewPageMarginTop); +begin + MarginsByClass[TdxPreviewPageMarginTop] := Value; +end; + +{ TCustomdxPreview } + +constructor TCustomdxPreview.Create(AOwner: TComponent); + + function CreateTimer(AHandler: TNotifyEvent; AnInterval: Integer): TTimer; + begin + Result := TTimer.Create(Self); + Result.Enabled := True; + Result.Interval := AnInterval; + Result.OnTimer := AHandler; + end; + +begin + inherited; + ControlStyle := ControlStyle - [csAcceptsControls, csCaptureMouse]; + ParentColor := False; + //Font.Name := 'Tahoma'; + Brush.Color := Color; + + FHintHideLongTimer := CreateTimer(HintHideLongTimerHandler, dxPreviewHideHintLongTime); + FHintHideShortTimer := CreateTimer(HintHideShortTimerHandler, dxPreviewHideHintShortTime); + FHintShowTimer := CreateTimer(HintShowTimerHandler, dxPreviewShowHintTime); + + FOptionsBehavior := [pobAllowDragMargins, pobKeyNavigation, pobThumbTracking, pobAutoSwapMargins]; + FOptionsHint := [pohShowForMargins, pohShowOnDrag, pohShowOnScroll]; + FOptionsStore := [posZoom]; + FOptionsView := [povAutoHideScrollBars, povDefaultDrawPageBackground, povMargins, povPageSelection]; + FOptionsZoom := [pozZoomOnClick]; + + FBorderStyle := bsSingle; + FPageBackground := TdxPreviewPageBackground.Create; + TdxPreviewPageBackground(FPageBackground).FPreview := Self; + MarginColor := clWindowText; + FScrollBars := ssBoth; + + ClearLastMousePos; + FMargins := CreateMargins; + + FMaxZoomFactor := 500; + FMinFooterSize := dxPreviewMinHeaderFooterSize; + FMinHeaderSize := dxPreviewMinHeaderFooterSize; + FMinUsefulSize := dxPreviewMinUsefulSize; + FMinZoomFactor := 5; + + FOriginalPageSize := TdxPointWrapper.Create(0, 0); + FOriginalPageSize.OnChanging := PageParametersChanging; + FOriginalPageSize.OnChanged := PageParametersChanged; + FOriginalPageSize.Point := A4_LOMETRIC; + + FLookAndFeel := plfStandard; + FPages := TList.Create; + FPageXCount := 1; + FPageYCount := 1; + FSelectionFrameThickness := 2; + FSelPageIndex := -1; + FScrollBars := ssBoth; + FScrollBarStyle := ssRegular; + FUnzoomedFactor := 50; + ZoomFactor := 100; + ZoomMode := pzmNone; + FZoomStep := 10; + Height := 460; + Width := 320; + + if IsDesigning then + begin + PageCount := 1; + SelPageIndex := 0; + end; + FPageStack := TList.Create; +end; + +destructor TCustomdxPreview.Destroy; +begin + if not IsDesigning and (pobStoreInRegistry in OptionsBehavior) and (RegistryPath <> '') then + SaveToRegistry(RegistryPath); + {$IFNDEF DELPHI5} + Destroying; + {$ENDIF} + DestroyPageNumberHint; + DestroyHint; + if FMarginPen <> 0 then DeleteObject(FMarginPen); + FreeAndnil(FPageStack); + FreeAndnil(FOriginalPageSize); + FreeAndnil(FPageBackground); + PageCount := 0; + FreeAndNil(FPages); + FreeAndNil(FMargins); + inherited; +end; + +procedure TCustomdxPreview.LoadFromRegistry(const ARegistryPath: string); +begin + with TRegistry.Create do + try + if OpenKey(ARegistryPath, True) then + try + if ValueExists(sdxOptionsHint) then + OptionsHint := TdxPreviewOptionsHint(Byte(ReadInteger(sdxOptionsHint))); + if ValueExists(sdxOptionsView) then + OptionsView := TdxPreviewOptionsView(Byte(ReadInteger(sdxOptionsView))); + if ValueExists(sdxOptionsZoom) then + OptionsZoom := TdxPreviewOptionsZoom(Byte(ReadInteger(sdxOptionsZoom))); + if ValueExists(sdxZoomStep) then + ZoomStep := ReadInteger(sdxZoomStep); + if ValueExists(sdxMarginColor) then + MarginColor := TColor(ReadInteger(sdxMarginColor)); + if ValueExists(sdxMeasurementUnits) then + MeasurementUnits := TdxPreviewMeasurementUnits(ReadInteger(sdxMeasurementUnits)); + if ValueExists(sdxOrientation) then + Orientation := TdxPreviewPaperOrientation(ReadInteger(sdxOrientation)); + if posZoom in OptionsStore then + begin + if ValueExists(sdxZoomFactor) then + ZoomFactor := ReadInteger(sdxZoomFactor); + if ValueExists(sdxZoomMode) then + ZoomMode := TdxPreviewZoomMode(ReadInteger(sdxZoomMode)); + if ZoomMode = pzmPages then + begin + if ValueExists(sdxPageXCount) then + PageXCount := ReadInteger(sdxPageXCount); + if ValueExists(sdxPageYCount) then + PageYCount := ReadInteger(sdxPageYCount); + end; + end; + except + on ERegistryException do + else + raise; + end; + finally + Free; + end; +end; + +procedure TCustomdxPreview.SaveToRegistry(const ARegistryPath: string); +begin + with TRegistry.Create do + try + if OpenKey(ARegistryPath, True) then + try + WriteInteger(sdxOptionsHint, Integer(Byte(OptionsHint))); + WriteInteger(sdxOptionsView, Integer(Byte(OptionsView))); + WriteInteger(sdxOptionsZoom, Integer(Byte(OptionsZoom))); + WriteInteger(sdxZoomStep, ZoomStep); + WriteInteger(sdxMarginColor, Integer(MarginColor)); + WriteInteger(sdxMeasurementUnits, Integer(MeasurementUnits)); + WriteInteger(sdxOrientation, Integer(Orientation)); + if posZoom in OptionsStore then + begin + WriteInteger(sdxZoomFactor, ZoomFactor); + WriteInteger(sdxZoomMode, Integer(ZoomMode)); + if ZoomMode = pzmPages then + begin + WriteInteger(sdxPageXCount, PageXCount); + WriteInteger(sdxPageYCount, PageYCount); + end; + end; + except + on ERegistryException do + else + raise; + end; + finally + Free; + end; +end; + +function TCustomdxPreview.DefaultColor: TColor; + + function GetUltraFlatBkColor: TColor; + + function GetUltraFlatValue(Value: Byte): Byte; + begin + Result := Value + (255 - Value) div 3; + end; + + var + R, G, B: Byte; + begin + Result := ColorToRGB(clBtnShadow); + R := GetUltraFlatValue(GetRValue(Result)); + G := GetUltraFlatValue(GetGValue(Result)); + B := GetUltraFlatValue(GetBValue(Result)); + Result := RGB(R, G, B); + end; + +begin + if LookAndFeel in [plfStandard, plfFlat] then + Result := clBtnShadow + else + Result := GetUltraFlatBkColor; +end; + +function TCustomdxPreview.DefaultNoPagesText: string; +begin + Result := cxGetResourceString(@sdxNoPages); +end; + +procedure TCustomdxPreview.BeginUpdate; +begin + Inc(FUpdateCount); +end; + +procedure TCustomdxPreview.CancelUpdate; +begin + if FUpdateCount <> 0 then Dec(FUpdateCount); +end; + +procedure TCustomdxPreview.EndUpdate; +begin + if FUpdateCount <> 0 then + begin + Dec(FUpdateCount); + if not IsUpdateLocked then + begin + DoCalcPageCount; + Invalidate; + end; + end; +end; + +function TCustomdxPreview.IsUpdateLocked: Boolean; +begin + Result := (FUpdateCount <> 0) or (csLoading in ComponentState); +end; + +procedure TCustomdxPreview.GetPartVisiblePageRanges(AStartIndex, AEndIndex: PInteger ); +var + StartIndex, EndIndex: Integer; +begin + GetPartVisiblePageRanges(StartIndex, EndIndex); + + if AStartIndex <> nil then + AStartIndex^ := StartIndex; + + if AEndIndex <> nil then + AEndIndex^ := EndIndex; +end; + +procedure TCustomdxPreview.GetPartVisiblePageRanges(out AStartIndex, AEndIndex: Integer); +begin + if PageCount <> 0 then + begin + AStartIndex := 0; + while (AStartIndex < PageCount) and not Pages[AStartIndex].PartVisible do + Inc(AStartIndex); + + AEndIndex := AStartIndex; + while (AEndIndex < PageCount) and Pages[AEndIndex].PartVisible do + Inc(AEndIndex); + Dec(AEndIndex); + end + else + begin + AStartIndex := -1; + AEndIndex := -1; + end; +end; + +procedure TCustomdxPreview.GetVisiblePageRanges(AStartIndex, AEndIndex: PInteger ); +var + StartIndex, EndIndex: Integer; +begin + GetVisiblePageRanges(StartIndex, EndIndex); + + if AStartIndex <> nil then + AStartIndex^ := StartIndex; + + if AEndIndex <> nil then + AEndIndex^ := EndIndex; +end; + +procedure TCustomdxPreview.GetVisiblePageRanges(out AStartIndex, AEndIndex: Integer); +begin + if PageCount <> 0 then + begin + AStartIndex := 0; + while (AStartIndex < PageCount) and not Pages[AStartIndex].Visible do + Inc(AStartIndex); + + if AStartIndex = PageCount then + begin + AStartIndex := -1; + AEndIndex := -1; + end + else + begin + AEndIndex := AStartIndex; + while (AEndIndex < PageCount) and Pages[AEndIndex].Visible do + Inc(AEndIndex); + Dec(AEndIndex); + end; + end + else + begin + AStartIndex := -1; + AEndIndex := -1; + end; +end; + +procedure TCustomdxPreview.InvalidatePage(APageIndex: Integer); +var + R: TRect; +begin + if (APageIndex > -1) and (APageIndex < PageCount) and HandleAllocated and + IntersectRect(R, Pages[APageIndex].Bounds, ClientRect) then + InvalidateRect(Handle, @Pages[APageIndex].Bounds, False); +end; + +procedure TCustomdxPreview.InvalidatePages; +var + StartIndex, EndIndex, I: Integer; +begin + if not HandleAllocated or (PageCount = 0) then Exit; + + GetPartVisiblePageRanges(StartIndex, EndIndex); + if StartIndex < 0 then Exit; + + for I := StartIndex to EndIndex do + InvalidateRect(Handle, @Pages[I].Bounds, False); +end; + +procedure TCustomdxPreview.InvalidatePagesContent; +var + StartIndex, EndIndex, I: Integer; + R: TRect; +begin + if not HandleAllocated or (PageCount = 0) then Exit; + + GetPartVisiblePageRanges(StartIndex, EndIndex); + if StartIndex < 0 then Exit; + + for I := StartIndex to EndIndex do + begin + with Pages[I].Bounds do + R := MakeRect(Left + Margins.Left.VisibleValue, + Top + Margins.Top.VisibleValue, + Right - Margins.Right.VisibleValue, + Bottom - Margins.Bottom.VisibleValue); + InvalidateRect(Handle, @R, False); + end; +end; + +procedure TCustomdxPreview.InvalidatePagesFooter; +var + StartIndex, EndIndex, I: Integer; + R, CR: TRect; +begin + if not HandleAllocated or (PageCount = 0) then Exit; + + GetPartVisiblePageRanges(StartIndex, EndIndex); + if StartIndex < 0 then Exit; + + CR := ClientRect; + for I := StartIndex to EndIndex do + begin + with Pages[I].Bounds do + R := MakeRect(Left + Margins.Left.VisibleValue, + Bottom - Margins.Bottom.VisibleValue, + Right - Margins.Right.VisibleValue, + Bottom - Margins.Footer.VisibleValue); + if IntersectRect(R, R, CR) then + InvalidateRect(Handle, @R, False); + end; +end; + +procedure TCustomdxPreview.InvalidatePagesHeader; +var + StartIndex, EndIndex, I: Integer; + R, CR: TRect; +begin + if not HandleAllocated or (PageCount = 0) then Exit; + + GetPartVisiblePageRanges(StartIndex, EndIndex); + if StartIndex < 0 then Exit; + + CR := ClientRect; + for I := StartIndex to EndIndex do + begin + with Pages[I].Bounds do + R := MakeRect(Left + Margins.Left.VisibleValue, + Top + Margins.Header.VisibleValue, + Right - Margins.Right.VisibleValue, + Top + Margins.Top.VisibleValue); + if IntersectRect(R, R, CR) then + InvalidateRect(Handle, @R, False); + end; +end; + +procedure TCustomdxPreview.CalcPagesBounds(ATopPos, VWidth, VHeight: Integer); +var + R: TRect; + APageSize: TPoint; + AWidth, AHeight, LeftOffset, TopOffset, I, J, PageIndex: Integer; +begin + APageSize := VisiblePageSize; + AWidth := VWidth; + AHeight := VHeight; + + R := ClientRect; + if (AWidth > R.Right - R.Left) or (pobNonCenterizePages in OptionsBehavior) then + LeftOffset := Indent + else + LeftOffset := (R.Right - (AWidth - 2 * Indent)) div 2; + if (AHeight > R.Bottom - R.Top) or (pobNonCenterizePages in OptionsBehavior) then + TopOffset := Indent + else + TopOffset := (R.Bottom - (AHeight - 2 * Indent)) div 2; + + if ZoomFactor = MinZoomFactor then + begin + if LeftOffset < Indent then LeftOffset := Indent; + if TopOffset < Indent then TopOffset := Indent; + end; + +// Inc(TopOffset, Indent); + for J := 0 to AllRowCount - 1 do + for I := 0 to ColCount - 1 do + begin + PageIndex := J * ColCount + I; + if PageIndex > PageCount - 1 then + Break; + + with R do + begin + Left := -LeftPos + LeftOffset + I * (APageSize.X + Indent); + Top := -ATopPos + TopOffset + J * (APageSize.Y + Indent); + Right := Left + APageSize.X; + Bottom := Top + APageSize.Y; + end; + Pages[PageIndex].Bounds := R; + end; +end; + +function TCustomdxPreview.GetHitInfoAt(const Pt: TPoint): TdxPreviewHitTests; +var + Margin: TdxPreviewPageMargin; +begin + if PtInRect(ClientRect, Pt) then + if PageIndexFromPoint(Pt) > -1 then + begin + Result := [phtPage]; + Margin := MarginFromPoint(Pt); + if Margin <> nil then + Result := Result + [Margin.GetHitTest]; + end + else + Result := [phtNoWhere] + else + Result := []; +end; + +function TCustomdxPreview.GetHitInfoAt(const Pt: TSmallPoint): TdxPreviewHitTests; +begin + Result := GetHitInfoAt(SmallPointToPoint(Pt)); +end; + +function TCustomdxPreview.GetHitInfoAt(X, Y: Integer): TdxPreviewHitTests; +begin + Result := GetHitInfoAt(MakePoint(X, Y)); +end; + +procedure TCustomdxPreview.HideAllHints; +begin + CancelHintShow; + CancelHintHide; +end; + +procedure TCustomdxPreview.MakeVisible(APageIndex: Integer); + + function GetDeltaX(const R: TRect): Integer; + begin + Result := 0; + if R.Right > ClientWidth then + Result := R.Right - ClientWidth; + if R.Left - Result < 0 then + Result := R.Left; + end; + + function GetDeltaY(const R: TRect): Integer; + begin + Result := 0; + if R.Bottom > ClientHeight then + Result := R.Bottom - ClientHeight; + if R.Top - Result < 0 then + Result := R.Top; + end; + +begin + if HandleAllocated and (APageIndex > -1) and (APageIndex < PageCount) then + begin + CalcPagesBounds(TopPos, VirtualWidth, VirtualHeight); + LeftPos := LeftPos + GetDeltaX(Pages[APageIndex].SiteBounds); + TopPos := TopPos + GetDeltaY(Pages[APageIndex].SiteBounds); + CalcPagesBounds(TopPos, VirtualWidth, VirtualHeight); + end; +end; + +procedure TCustomdxPreview.SetPageXYCount(XCount, YCount: Integer); +begin + BeginUpdate; + try + PageXCount := XCount; + PageYCount := YCount; + finally + EndUpdate; + end; +end; + +procedure TCustomdxPreview.ZoomIn; +begin + ZoomFactor := ZoomFactor + ZoomStep; +end; + +procedure TCustomdxPreview.ZoomOut; +begin + ZoomFactor := ZoomFactor - ZoomStep; +end; + +function TCustomdxPreview.MarginFromPoint(const Pt: TPoint): TdxPreviewPageMargin; +var + I: Integer; +begin + if SelPageIndex <> -1 then + for I := Margins.Count - 1 downto 0 do + begin + Result := Margins[I]; + if Result.HasPoint(Pt) then Exit; + end; + Result := nil; +end; + +function TCustomdxPreview.MarginFromPoint(const Pt: TSmallPoint): TdxPreviewPageMargin; +begin + Result := MarginFromPoint(SmallPointToPoint(Pt)); +end; + +function TCustomdxPreview.MarginFromPoint(X, Y: Integer): TdxPreviewPageMargin; +begin + Result := MarginFromPoint(MakePoint(X, Y)); +end; + +function TCustomdxPreview.MarginValueToString(Value: Integer): string; +var + DisplayValue: TFloat; + Mask: string; +begin + DisplayValue := LoMetricToAnother(FMeasurementUnits, Value); + case ActualMeasurementUnits of + pmuInches: + Result := cxGetResourceString(@sdxUnitsInches); + pmuMillimeters: + Result := cxGetResourceString(@sdxUnitsMillimeters); + pmuCentimeters: + Result := cxGetResourceString(@sdxUnitsCentimeters); + pmuPoints: + Result := cxGetResourceString(@sdxUnitsPoints); + pmuPicas: + Result := cxGetResourceString(@sdxUnitsPicas); + end; + Mask := '########0.#'; + if ActualMeasurementUnits in [pmuInches, pmuCentimeters, pmuPicas] then + Mask := Mask + '#'; + Result := FormatFloat(Mask, DisplayValue) + ' ' + Result; +end; + +function TCustomdxPreview.IndexOfPage(APage: TdxPreviewPage): Integer; +begin + Result := FPages.IndexOf(APage); +end; + +function TCustomdxPreview.PageIndexFromPoint(const Pt: TPoint): Integer; +begin + for Result := 0 to PageCount - 1 do + if Pages[Result].HasPoint(Pt) then + Exit; + + Result := -1; +end; + +function TCustomdxPreview.PageIndexFromPoint(const Pt: TSmallPoint): Integer; +begin + Result := PageIndexFromPoint(SmallPointToPoint(Pt)); +end; + +function TCustomdxPreview.PageIndexFromPoint(X, Y: Integer): Integer; +begin + Result := PageIndexFromPoint(MakePoint(X, Y)); +end; + +function TCustomdxPreview.PageSizeToString: string; +var + PageWidth, PageHeight: Double; + Mask: string; +begin + case ActualMeasurementUnits of + pmuInches: + Result := cxGetResourceString(@sdxUnitsInches); + pmuMillimeters: + Result := cxGetResourceString(@sdxUnitsMillimeters); + pmuCentimeters: + Result := cxGetResourceString(@sdxUnitsCentimeters); + pmuPoints: + Result := cxGetResourceString(@sdxUnitsPoints); + pmuPicas: + Result := cxGetResourceString(@sdxUnitsPicas); + end; + + Mask := '########0.#'; + if ActualMeasurementUnits in [pmuInches, pmuCentimeters, pmuPicas] then + Mask := Mask + '#'; + PageWidth := LoMetricToAnother(FMeasurementUnits, OriginalPageSize.X); + PageHeight := LoMetricToAnother(FMeasurementUnits, OriginalPageSize.Y); + + Result := FormatFloat(Mask, PageWidth) + ' ' + Result + ' x ' + + FormatFloat(Mask, PageHeight) + ' ' + Result; +end; + +procedure TCustomdxPreview.SelectFirstPage; +var + I: Integer; + OldSelPageIndex: Integer; +begin + I := 0; + OldSelPageIndex := SelPageIndex; + repeat + SelPageIndex := I; + Inc(I); + until (SelPageIndex + I = PageCount + 1) or (SelPageIndex <> OldSelPageIndex); +end; + +procedure TCustomdxPreview.SelectLastPage; +var + I: Integer; + OldSelPageIndex: Integer; +begin + I := 1; + OldSelPageIndex := SelPageIndex; + repeat + SelPageIndex := PageCount - I; + Inc(I); + until (I = -1) or (SelPageIndex <> OldSelPageIndex); +end; + +procedure TCustomdxPreview.SelectNextPage; +var + I: Integer; + OldSelPageIndex: Integer; +begin + I := 1; + OldSelPageIndex := SelPageIndex; + repeat + SelPageIndex := SelPageIndex + I; + Inc(I); + until (SelPageIndex + I = PageCount + 1) or (SelPageIndex <> OldSelPageIndex); +end; + +procedure TCustomdxPreview.SelectPrevPage; +var + I: Integer; + OldSelPageIndex: Integer; +begin + if SelPageIndex > 0 then + begin + I := 1; + OldSelPageIndex := SelPageIndex; + repeat + SelPageIndex := SelPageIndex - I; + Inc(I); + until (SelPageIndex - I = -2) or (SelPageIndex <> OldSelPageIndex); + end; +end; + +procedure TCustomdxPreview.AdjustSize; +begin +end; + +procedure TCustomdxPreview.CreateParams(var Params: TCreateParams); +const + CS_ON = CS_OWNDC; + CS_OFF = CS_HREDRAW or CS_VREDRAW; +begin + inherited; + with Params do + begin + if FScrollBars in [ssVertical, ssBoth] then + Style := Style or WS_VSCROLL; + if FScrollBars in [ssHorizontal, ssBoth] then + Style := Style or WS_HSCROLL; + WindowClass.Style := WindowClass.Style + CS_ON - CS_OFF; + if (FBorderStyle = bsSingle) and (LookAndFeel = plfStandard) then + if NewStyleControls and Ctl3D then + begin + Style := Style and not WS_BORDER; + ExStyle := ExStyle or WS_EX_CLIENTEDGE; + end + else + Style := Style or WS_BORDER; + end; +end; + +procedure TCustomdxPreview.CreateWindowHandle(const Params: TCreateParams); +begin + inherited; + if HandleAllocated then FDC := GetDC(Handle); +end; + +procedure TCustomdxPreview.CreateWnd; +const + Styles: array[TScrollBarStyle] of Integer = (FSB_REGULAR_MODE, FSB_ENCARTA_MODE, FSB_FLAT_MODE); +begin + inherited; + if not SysLocale.MiddleEast then + InitializeFlatSB(Handle); + FlatSB_SetScrollProp(Handle, WSB_PROP_HSTYLE, Styles[ScrollBarStyle], True); + FlatSB_SetScrollProp(Handle, WSB_PROP_VSTYLE, Styles[ScrollBarStyle], True); +end; + +procedure TCustomdxPreview.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('IsNoPagesTextAssigned', ReadIsNoPagesTextAssigned, WriteIsNoPagesTextAssigned, + FIsNoPagesTextAssigned and (FNoPagesText = '')); +end; + +procedure TCustomdxPreview.KeyDown(var Key: Word; Shift: TShiftState); +begin + case Key of + VK_RETURN: + if (SelPageIndex > -1) and (DraggingMargin = nil) then + begin + HideAllHints; + Zoomed := not Zoomed; + end; + + VK_ADD: + if (SelPageIndex > -1) and (DraggingMargin = nil) then + begin + HideAllHints; + if GetKeyState(VK_CONTROL) < 0 then + ZoomIn + else + if not Zoomed then + Zoomed := True; + end; + + VK_SUBTRACT: + if (SelPageIndex > -1) and (DraggingMargin = nil) then + begin + HideAllHints; + if GetKeyState(VK_CONTROL) < 0 then + ZoomOut + else + if Zoomed then + Zoomed := False; + end; + + VK_MENU: + if DraggingMargin = nil then + HideAllHints; + + VK_APPS: + if (PopupMenu <> nil) or IsDesigning then + HideAllHints; + + VK_ESCAPE: + if GetCapture = Handle then + begin + ReleaseCapture; + Key := 0; + end; + + VK_PRIOR: + if not (ssCtrl in Shift) then + SelectPrevPage + else + if CanPageScrolling(psdUp) then + begin + ScrollPage(psdUp); + ScrollPage(psdUp); + end; + + VK_NEXT: + if not (ssCtrl in Shift) then + SelectNextPage + else + if CanPageScrolling(psdDown) then + begin + ScrollPage(psdDown); + ScrollPage(psdDown); + end; + + VK_END: + SelectLastPage; + + VK_HOME: + SelectFirstPage; + + VK_LEFT: + if (ssCtrl in Shift) or (ColCount = 1) then + if CanPageScrolling(psdLeft) then + ScrollPage(psdLeft) + else + else + if SelPageCol > 0 then + SelectPrevPage; + + VK_UP: + if ssAlt in Shift then + ZoomIn + else + if (ssCtrl in Shift) or (ColCount = 1) then + if CanPageScrolling(psdUp) then + ScrollPage(psdUp) + else + else + if SelPageRow > 0 then + SelPageIndex := SelPageIndex - ColCount; + + VK_RIGHT: + if (ssCtrl in Shift) or (ColCount = 1) then + if CanPageScrolling(psdRight) then + ScrollPage(psdRight) + else + else + if SelPageCol < ColCount - 1 then + SelectNextPage; + + VK_DOWN: + if ssAlt in Shift then + ZoomOut + else + if (ssCtrl in Shift) or (ColCount = 1) then + if CanPageScrolling(psdDown) then + ScrollPage(psdDown) + else + else + if SelPageRow < Ceil(PageCount / ColCount) - 1 then + SelPageIndex := SelPageIndex + ColCount; + end; + inherited; +end; + +procedure TCustomdxPreview.Loaded; +begin + inherited; + DoCalcPageCount; + if not IsDesigning and (pobStoreInRegistry in OptionsBehavior) and (RegistryPath <> '') then + LoadFromRegistry(RegistryPath); +end; + +procedure TCustomdxPreview.MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +var + PageIndex, OldPageIndex: Integer; + Margin: TdxPreviewPageMargin; + R: TRect; +begin + if Button = mbLeft then + begin + PageIndex := PageIndexFromPoint(X, Y); + if PageIndex <> -1 then + if SelPageIndex = PageIndex then + begin + Margin := MarginFromPoint(X, Y); + if Margin = nil then + if pozZoomOnClick in OptionsZoom then + Zoomed := not Zoomed + else + else + begin + if (pobAllowDragMargins in OptionsBehavior) and Margin.Enabled and not (ssDouble in Shift) then + begin + Margin.DoDragBefore; + R := Margin.Bounds; + FDraggingMargin := Margin; + if Margin.IsVertical then + begin + FBeforeDragPos := X; + FDragOffset := X - R.Left; + end + else + begin + FBeforeDragPos := Y; + FDragOffset := Y - R.Top; + end; + Margin.DraggingPos := FBeforeDragPos - FDragOffset; + SetCapture(Handle); + end; + end; + end + else + begin + OldPageIndex := SelPageIndex; + SelPageIndex := PageIndex; + if OldPageIndex <> SelPageIndex then ResetHintShowTimer(X, Y); + end; + end + else + if DraggingMargin <> nil then ReleaseCapture; + + if (Button = mbMiddle) and (DraggingMargin = nil) and CanAnyScrolling then + DoScrolling; + + inherited; +end; + +procedure TCustomdxPreview.MouseMove(Shift: TShiftState; X, Y: Integer); +var + Pos: Integer; + APageIndex: Integer; +begin + inherited; + if (FLastMousePos.X <> X) or (FLastMousePos.Y <> Y) then + begin + FLastMousePos := MakePoint(X, Y); + if FDraggingMargin = nil then + begin + ResetHintShowTimer(X, Y); + if (pobHotTrack in OptionsBehavior) and IsParentFormActive then + begin + APageIndex := PageIndexFromPoint(X, Y); + if APageIndex <> -1 then SelPageIndex := APageIndex; + end; + end + else + begin + if DraggingMargin.IsVertical then + Pos := X + else + Pos := Y; + DraggingMargin.DraggingPos := Pos - FDragOffset; + end; + end; +end; + +procedure TCustomdxPreview.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + Margin: TdxPreviewPageMargin; + Pos: Integer; +begin + inherited; + if (Button = mbLeft) and (DraggingMargin <> nil) then + begin + Margin := DraggingMargin; +// ReleaseCapture; + with Margin do + begin + if IsVertical then + Pos := X + else + Pos := Y; + if FBeforeDragPos <> Pos then + Value := ValueFromPos(Pos - FDragOffset); + end; + ReleaseCapture; + end; +end; + +{.$DEFINE DEBUG_PREVIEW} + +procedure TCustomdxPreview.Paint; +{$IFDEF DEBUG_PREVIEW} +var + T: DWORD; +{$ENDIF} +begin +{$IFDEF DEBUG_PREVIEW} + T := GetTickCount; +{$ENDIF} + + FPageStack.Clear; + AdjustPagesBounds; + DrawPages; + DrawPagesContent; + if PageCount = 0 then DrawNoPages; +// UpdateScrollBars; + +{$IFDEF DEBUG_PREVIEW} + GetParentForm(Self).Caption := Format('%d', [GetTickCount - T]); +{$ENDIF} +end; + +procedure TCustomdxPreview.WndProc(var Message: TMessage); +var + MouseMsg: TWMMouse; +begin + if (Message.Msg = WM_MOUSEMOVE) and (DraggingMargin <> nil) then + inherited + else + if not IsDesigning and + ((Message.Msg = WM_LBUTTONDOWN) or (Message.Msg = WM_LBUTTONDBLCLK)) and + not Dragging and (DragMode = dmAutomatic) and (DragKind = dkDrag) then + begin + MouseMsg := TWMMouse(Message); + if not IsControlMouseMsg(MouseMsg) and (not (pozZoomOnClick in OptionsZoom) or (PageIndexFromPoint(MouseMsg.Pos) = -1)) then + begin + ControlState := ControlState + [csLButtonDown]; + Dispatch(Message); + end + end + else + inherited; +end; + +function TCustomdxPreview.CreateMargins: TdxPreviewPageMargins; +begin + Result := GetMarginsClass.Create(Self); +end; + +function TCustomdxPreview.GetMarginsClass: TdxPreviewPageMarginsClass; +begin + Result := TdxPreviewPageMargins; +end; + +function TCustomdxPreview.CreatePage: TdxPreviewPage; +begin + Result := GetPageClass.Create(Self); + FPages.Add(Result); +end; + +function TCustomdxPreview.GetPageClass: TdxPreviewPageClass; +begin + Result := TdxPreviewPage; +end; + +function TCustomdxPreview.CheckLeftPos(Value: Integer): Integer; +begin + Result := Value; + if Result > VirtualWidth - ClientWidth then + Result := VirtualWidth - ClientWidth; + if Result < 0 then Result := 0; +end; + +function TCustomdxPreview.CheckTopPos(Value: Integer): Integer; +begin + Result := Value; + if Result > VirtualHeight - ClientHeight then + Result := VirtualHeight - ClientHeight; + if Result < 0 then Result := 0; +end; + +procedure TCustomdxPreview.CheckMargins; +var + I: Integer; +begin + for I := 0 to Margins.Count - 1 do + with Margins[I] do + Value := Value; +end; + +procedure TCustomdxPreview.CheckZoomFactor; +var + PageIndex, FirstPageIndex, LastPageIndex, I, ZoomFactorX, ZoomFactorY: Integer; + + function CalcZoomFactor(Size, PageSize: Integer): Integer; + begin + Result := MulDiv(Size - dxPreviewIndent1 * (1 + I), 100, + dxPreviewIndent2 + I * (PageSize + dxPreviewIndent2)); + end; + +begin + if not HandleAllocated then Exit; + + GetVisiblePageRanges(FirstPageIndex, LastPageIndex); + if FirstPageIndex = 0 then + GetPartVisiblePageRanges(FirstPageIndex, LastPageIndex); + if (SelPageIndex <> -1) and Pages[SelPageIndex].PartVisible then + PageIndex := SelPageIndex + else + PageIndex := FirstPageIndex; + + FZoomModeFixed := True; + try + case ZoomMode of + pzmPageWidth: + ZoomFactor := MulDiv(ClientWidth, 100, PageSize.X + 2 * dxPreviewIndent); + pzmPages: + begin + ZoomFactorX := MinZoomFactor; + for I := FPageXCount downto 1 do + begin + ZoomFactorX := CalcZoomFactor(ClientWidth, PageSize.X); + if ZoomFactorX >= MinZoomFactor then Break; + end; + if ZoomFactorX < MinZoomFactor then ZoomFactorX := MinZoomFactor; +// calc Y zoom factor + ZoomFactorY := MinZoomFactor; + for I := FPageYCount downto 1 do + begin + ZoomFactorY := CalcZoomFactor(ClientHeight, PageSize.Y); + if ZoomFactorY >= MinZoomFactor then Break; + end; + if ZoomFactorY < MinZoomFactor then ZoomFactorY := MinZoomFactor; +// select the smallest zoom factor + if ZoomFactorX < ZoomFactorY then + ZoomFactor := ZoomFactorX + else + ZoomFactor := ZoomFactorY; + end; + end; + finally + FZoomModeFixed := False; + UpdateScrollBars; + LeftPos := LeftPos; + TopPos := TopPos; + MakeVisible(FirstPageIndex); + if FirstPageIndex <> PageIndex then MakeVisible(PageIndex); + if FUpdateCount = 0 then Invalidate; + end; +end; + +procedure TCustomdxPreview.DoScrolling; +type + TdxPreviewScrollDirection = + (dirNone, dirLeft, dirTop, dirRight, dirBottom, dirTopLeft, dirTopRight, dirBottomRight, dirBottomLeft); +const + ScrollTimeStep = 20; + ScrollValueStep = 5; + MaxSpeed = 12; + KeyDelta = 10; +var + BreakOnMouseUp: Boolean; + AllowHorScrolling, AllowVerScrolling: Boolean; + P, PrevP: TPoint; + AnchorPos: TPoint; + AnchorSize: Integer; + AnchorWnd: HWND; + Direction: TdxPreviewScrollDirection; + Speed: Integer; + TimerHits: Integer; + Timer: UINT; + CaptureWnd: HWND; + Msg: TMsg; + Form : TCustomForm; + + function CreateScrollingAnchorWnd: HWND; + var + B: TBitmap; + W, H: Integer; + Rgn: HRGN; + DC: HDC; + + function GetBitmapResourceName: string; + begin + if AllowHorScrolling and AllowVerScrolling then + Result := IDB_DXPSPREVIEW_ANCHORSCROLLFULL + else + if AllowHorScrolling then + Result := IDB_DXPSPREVIEW_ANCHORSCROLLHORZ + else + Result := IDB_DXPSPREVIEW_ANCHORSCROLLVERT; + end; + + begin + B := TBitmap.Create; + try + Bitmap_LoadFromResourceName(B, GetBitmapResourceName); + + W := B.Width; + H := B.Height; + AnchorSize := W; + with AnchorPos do + Result := CreateWindow('STATIC', nil, WS_POPUP, + X - W div 2, Y - H div 2 - 2, W, H, Handle, 0, HInstance, nil); + Rgn := CreateEllipticRgn(0, 0, W + 1, H + 1); + SetWindowRgn(Result, Rgn, True); + SetWindowPos(Result, 0, 0, 0, 0, 0, + SWP_NOZORDER or SWP_NOMOVE or SWP_NOSIZE or SWP_SHOWWINDOW or SWP_NOACTIVATE); + + DC := GetWindowDC(Result); + BitBlt(DC, 0, 0, W, H, B.Canvas.Handle, 0, 0, SRCCOPY); + Rgn := CreateEllipticRgn(0, 0, W + 1, H + 1); + FrameRgn(DC, Rgn, GetSysColorBrush(COLOR_WINDOWTEXT), 1, 1); + DeleteObject(Rgn); + ReleaseDC(Result, DC); + finally + B.Free; + end; + end; + + procedure CalcDirectionAndSpeed(const P: TPoint); + var + DeltaX, DeltaY, SpeedValueX, SpeedValueY: Integer; + Angle, Angle2: Double; + + function GetNeutralZone: TRect; + begin + with AnchorPos do + Result := MakeBounds(X - AnchorSize div 2, Y - AnchorSize div 2, AnchorSize, AnchorSize); + if not AllowHorScrolling then + begin + Result.Left := 0; + Result.Right := Screen.Width; + end; + if not AllowVerScrolling then + begin + Result.Top := 0; + Result.Bottom := Screen.Height; + end; + end; + + begin + Direction := dirNone; + if PtInRect(GetNeutralZone, P) then + begin + Direction := dirNone; + Speed := 0; + Exit; + end + else + begin + BreakOnMouseUp := True; + DeltaX := P.X - AnchorPos.X; + DeltaY := P.Y - AnchorPos.Y; + SpeedValueX := Abs(DeltaX) - AnchorSize div 2; + SpeedValueY := Abs(DeltaY) - AnchorSize div 2; + if SpeedValueY > SpeedValueX then + SpeedValueX := SpeedValueY; + Speed := 1 + SpeedValueX div ScrollValueStep; + if Speed > MaxSpeed then + Speed := MaxSpeed; + if 0.5 * AnchorSize/SQRT(DeltaX * DeltaX + DeltaY * DeltaY) <= 1 then + Angle2 := ArcSin(0.5 * AnchorSize/SQRT(DeltaX * DeltaX + DeltaY * DeltaY)) + else + Angle2 := 0; + Angle := ArcTan2(Abs(DeltaY), Abs(DeltaX)); + if DeltaX <= 0 then + if DeltaY > 0 then + Angle := Angle + Pi + else + Angle := Pi - Angle + else + if DeltaY > 0 then + Angle := 2 * Pi - Angle; + + if (Angle <= Angle2) or (Angle >= 2 * Pi - Angle2) then + Direction := dirRight + else + if (Angle > Angle2) and (Angle < 0.5 * Pi - Angle2) then + if not AllowHorScrolling then + Direction := dirTop + else + if not AllowVerScrolling then + Direction := dirRight + else + Direction := dirTopRight + else + if (Angle >= 0.5 * Pi - Angle2) and (Angle <= 0.5 * Pi + Angle2) then + Direction := dirTop + else + if (Angle > 0.5 * Pi + Angle2) and (Angle < Pi - Angle2) then + if not AllowHorScrolling then + Direction := dirTop + else + if not AllowVerScrolling then + Direction := dirLeft + else + Direction := dirTopLeft + else + if (Angle >= Pi - Angle2) and (Angle <= Pi + Angle2) then + Direction := dirLeft + else + if (Angle > Pi + Angle2) and (Angle < 1.5 * Pi - Angle2) then + if not AllowHorScrolling then + Direction := dirBottom + else + if not AllowVerScrolling then + Direction := dirLeft + else + Direction := dirBottomLeft + else + if (Angle >= 1.5 * Pi - Angle2) and (Angle <= 1.5 * Pi + Angle2) then + Direction := dirBottom + else + if (Angle > 1.5 * Pi + Angle2) and (Angle < 2 * Pi - Angle2) then + if not AllowHorScrolling then + Direction := dirBottom + else + if not AllowVerScrolling then + Direction := dirRight + else + Direction := dirBottomRight + else + Direction := dirNone; + end; + end; + + procedure SetMouseCursor; + var + Cursor: TCursor; + begin + case Direction of + dirLeft: + Cursor := crdxPreviewLeftScroll; + dirTop: + Cursor := crdxPreviewUpScroll; + dirRight: + Cursor := crdxPreviewRightScroll; + dirBottom: + Cursor := crdxPreviewDownScroll; + dirTopLeft: + Cursor := crdxPreviewTopLeftScroll; + dirTopRight: + Cursor := crdxPreviewTopRightLeftScroll; + dirBottomRight: + Cursor := crdxPreviewBottomRightScroll; + dirBottomLeft: + Cursor := crdxPreviewBottomLeftScroll; + else + if AllowHorScrolling and AllowVerScrolling then + Cursor := crdxPreviewFullScroll + else if AllowHorScrolling then + Cursor := crdxPreviewHorzScroll + else + Cursor := crdxPreviewVertScroll; + end; + SetCursor(Screen.Cursors[Cursor]); + end; + + procedure Scroll(Direction: TdxPreviewScrollDirection); + const + Scrolls: array[Boolean] of Longint = (WM_HSCROLL, WM_VSCROLL); + Flags: array[Boolean] of WPARAM = (SB_LINEUP, SB_LINEDOWN); + begin + if Direction > dirNone then + if Direction < dirTopLeft then + SendMessage(Handle, Scrolls[Direction in [dirTop, dirBottom]], Flags[Direction in [dirRight, dirBottom]], 0) + else {dirTopLeft..dirBottomLeft} + begin + SendMessage(Handle, WM_HSCROLL, Flags[Direction in [dirTopRight, dirBottomRight]], 0); + SendMessage(Handle, WM_VSCROLL, Flags[Direction in [dirBottomRight, dirBottomLeft]], 0); + end; + end; + +begin + BreakOnMouseUp := False; + AllowHorScrolling := CanHorzScrolling; + AllowVerScrolling := CanVertScrolling; + GetCursorPos(PrevP); + AnchorPos := PrevP; + AnchorWnd := CreateScrollingAnchorWnd; + Direction := dirNone; + SetMouseCursor; + Speed := 1; + TimerHits := 0; + Timer := SetTimer(0, 0, ScrollTimeStep, nil); + + CaptureWnd := Handle; + SetCapture(CaptureWnd); + try + while GetCapture = CaptureWnd do + begin + case Integer(GetMessage(Msg, 0, 0, 0)) of + -1: Break; + 0: + begin + PostQuitMessage(Msg.wParam); + Break; + end; + end; + case Msg.Message of + WM_KEYDOWN, WM_KEYUP: + case Msg.wParam of + VK_ESCAPE, VK_MENU, VK_APPS: + Break; + VK_UP, VK_DOWN, VK_LEFT, VK_RIGHT, VK_HOME, VK_PRIOR, VK_END, VK_NEXT: + begin + GetCursorPos(P); + if Msg.wParam in [VK_UP, VK_HOME, VK_PRIOR] then Dec(P.Y, KeyDelta); + if Msg.wParam in [VK_DOWN, VK_END, VK_NEXT] then Inc(P.Y, KeyDelta); + if Msg.wParam in [VK_LEFT, VK_HOME, VK_END] then Dec(P.X, KeyDelta); + if Msg.wParam in [VK_RIGHT, VK_PRIOR, VK_NEXT] then Inc(P.X, KeyDelta); + SetCursorPos(P.X, P.Y); + end; + end; + WM_MOUSEMOVE: + begin + P.X := SmallInt(LoWord(Msg.lParam)); + P.Y := SmallInt(HiWord(Msg.lParam)); + Windows.ClientToScreen(Msg.hWnd, P); + if (P.X <> PrevP.X) or (P.Y <> PrevP.Y) then + begin + CalcDirectionAndSpeed(P); + SetMouseCursor; + PrevP := P; + end; + end; + WM_MBUTTONUP: + if BreakOnMouseUp then Break; + WM_TIMER: + if UINT(Msg.wParam) = Timer then + begin + Inc(TimerHits); + if TimerHits mod (MaxSpeed - Speed + 1) = 0 then + Scroll(Direction); + end; + WM_SYSCOMMAND: + if Msg.wParam = SC_CLOSE then Break; + else + if (Msg.Message = WM_PAINT) and (Msg.hwnd = AnchorWnd) then + begin + ValidateRect(AnchorWnd, nil); + Continue; + end; + if (Msg.Message >= WM_MOUSEFIRST) and (Msg.Message <= WM_MOUSELAST) then + Break; + TranslateMessage(Msg); + DispatchMessage(Msg); + end; + end; + finally + if GetCapture = CaptureWnd then + ReleaseCapture; + KillTimer(0, Timer); + DestroyWindow(AnchorWnd); + if (Msg.Message = WM_SYSCOMMAND) and (Msg.wParam = SC_CLOSE) then + begin + Form := GetParentForm(Self); + if Form <> nil then + PostMessage(Form.Handle, WM_SYSCOMMAND, SC_CLOSE, 0); + end; + end; +end; + +function TCustomdxPreview.CanSelectPage(APageIndex: Integer): Boolean; +begin + Result := True; + if Assigned(FOnSelectingPage) then FOnSelectingPage(Self, APageIndex, Result); +end; + +function TCustomdxPreview.CanShowMarginHint: Boolean; +begin + Result := True; + if Assigned(FOnCanShowMarginHint) then FOnCanShowMarginHint(Self, Result); +end; + +procedure TCustomdxPreview.DoAfterDragMargin(AMargin: TdxPreviewPageMargin); +begin + if Assigned(FOnAfterDragMargin) then FOnAfterDragMargin(Self, AMargin); +end; + +procedure TCustomdxPreview.DoBeforeDragMargin(AMargin: TdxPreviewPageMargin); +begin + if Assigned(FOnBeforeDragMargin) then FOnBeforeDragMargin(Self, AMargin); +end; + +procedure TCustomdxPreview.DoCalcPageCount; +begin + if FUpdateCount > 0 then Exit; + if Assigned(FOnCalcPageCount) then FOnCalcPageCount(Self); +end; + +procedure TCustomdxPreview.DoChangePageCount; +begin + if Assigned(FOnChangePageCount) then FOnChangePageCount(Self); +end; + +procedure TCustomdxPreview.DoDragMargin(AMargin: TdxPreviewPageMargin); +begin + if Assigned(FOnDragMargin) then FOnDragMargin(Self, AMargin); +end; + +procedure TCustomdxPreview.DoDrawPageContent(R: TRect; APageIndex: Integer); +begin + if Assigned(FOnDrawPageContent) then FOnDrawPageContent(Self, Canvas, R, APageIndex); +end; + +procedure TCustomdxPreview.DoGetPageNumberHintText(out AText: string); +var + StartPage, EndPage: Integer; +begin + AText := DropAmpersand(cxGetResourceString(@sdxPage)) + ': '; + GetPartVisiblePageRanges(StartPage, EndPage); + AText := AText + IntToStr(StartPage + 1); + if StartPage <> EndPage then + AText := AText + ' - ' + IntToStr(EndPage + 1); + + if Assigned(FOnGetPageNumberHint) then + FOnGetPageNumberHint(Self, StartPage, EndPage, AText); +end; + +procedure TCustomdxPreview.DoMarginChanged(AMargin: TdxPreviewPageMargin); +begin + if Assigned(FOnMarginChanged) then FOnMarginChanged(Self, AMargin); + if (AMargin <> nil) and AMargin.IsForceRecalculatePageCount then + DoCalcPageCount; +end; + + {case FMarginType of + pmHeader: + if Margins.Top.Value - FValue < Preview.MinHeaderSize then + Margins.Top.Value := FValue + Preview.MinHeaderSize; + pmFooter: + if Margins.Bottom.Value - FValue < Preview.MinFooterSize then + Margins.Bottom.Value := FValue + Preview.MinFooterSize; + end;} + +procedure TCustomdxPreview.DoZoomFactorChanged; +begin + if Assigned(FOnZoomFactorChanged) then FOnZoomFactorChanged(Self); +end; + +procedure TCustomdxPreview.DoZoomModeChanged; +begin + if Assigned(FOnZoomModeChanged) then FOnZoomModeChanged(Self); +end; + +procedure TCustomdxPreview.DoSelectedPageChanging; +begin + if Assigned(FOnSelectedPageChanging) then FOnSelectedPageChanging(Self, FSelPageIndex); +end; + +procedure TCustomdxPreview.DoSelectedPageChanged; +begin + if Assigned(FOnSelectedPageChanged) then FOnSelectedPageChanged(Self, FSelPageIndex); +end; + +procedure TCustomdxPreview.DrawMargins(DC: HDC); +var + I: Integer; + Margin: TdxPreviewPageMargin; +begin + for I := 0 to Margins.Count - 1 do + begin + Margin := Margins[I]; + if Margin.Visible then Margin.Draw(DC); + end; +end; + +procedure TCustomdxPreview.DrawPageBackground(const R: TRect; APageIndex: Integer); +begin + if Assigned(FOnDrawPageBackground) then + FOnDrawPageBackground(Self, Canvas, R, APageIndex) + else + if povDefaultDrawPageBackground in OptionsView then + with PageBackground do + if Mode = bmNone then + FillRect(FDC, R, HBRUSH(COLOR_WINDOW + 1)) + else + begin + if (Mode = bmPicture) and (PictureMode in [ppmCenter, ppmProportional]) then + FillRect(FDC, R, HBRUSH(COLOR_WINDOW + 1)); + Paint(Canvas, R); + end; +end; + +procedure TCustomdxPreview.DrawPageBorder(DC: HDC; APageIndex: Integer); +var + BorderBounds, SiteBounds: TRect; + BrushColor: COLORREF; + SiteBrush: HBRUSH; + I: Integer; +begin + BorderBounds := Pages[APageIndex].Bounds; + InflateRect(BorderBounds, 1, 1); + + if (povPageSelection in OptionsView) and (APageIndex = SelPageIndex) then + BrushColor := COLOR_HIGHLIGHT + else + BrushColor := COLOR_WINDOWTEXT; + + FrameRect(DC, BorderBounds, GetSysColorBrush(BrushColor)); + if (povPageSelection in OptionsView) and (APageIndex = SelPageIndex) then + begin + InflateRect(BorderBounds, 1, 1); + FrameRect(DC, BorderBounds, GetSysColorBrush(BrushColor)); + if SelectionFrameThickness > 2 then + begin + InflateRect(BorderBounds, -2, -2); + for I := 0 to SelectionFrameThickness - 2 do + begin + FrameRect(DC, BorderBounds, GetSysColorBrush(BrushColor)); + InflateRect(BorderBounds, -1, -1); + end; + InflateRect(BorderBounds, SelectionFrameThickness, SelectionFrameThickness); + end; + end; + + SiteBounds := Pages[APageIndex].SiteBounds; + SiteBrush := CreateSolidBrush(ColorToRGB(Color)); + with SiteBounds do + begin + DrawRestSpaceBackgroundRect(MakeRect(Left, Top, Right, BorderBounds.Top)); + DrawRestSpaceBackgroundRect(MakeRect(Left, BorderBounds.Top, BorderBounds.Left, Bottom)); + end; + OffsetRect(BorderBounds, 2, 2); + with BorderBounds do + begin + DrawRestSpaceBackgroundRect(MakeRect(Left - 2, Bottom - 2, Left, Bottom)); + FillRect(DC, MakeRect(Left, Bottom - 2, Right, Bottom), GetSysColorBrush(COLOR_WINDOWTEXT)); + DrawRestSpaceBackgroundRect(MakeRect(Right - 2, Top - 2, Right, Top)); + FillRect(DC, MakeRect(Right - 2, Top, Right, Bottom - 2), GetSysColorBrush(COLOR_WINDOWTEXT)); + end; + with SiteBounds do + begin + FillRect(DC, MakeRect(BorderBounds.Left - 2, BorderBounds.Bottom, Right, Bottom), SiteBrush); + FillRect(DC, MakeRect(BorderBounds.Right, BorderBounds.Top - 2, Right, BorderBounds.Bottom), SiteBrush); + end; + DeleteObject(SiteBrush); +end; + +procedure TCustomdxPreview.InvalidateMargins; +var + I: Integer; +begin + if povMargins in OptionsView then + for I := 0 to Margins.Count - 1 do + Margins[I].Invalidate; +end; + +procedure TCustomdxPreview.InvalidatePageBorder(APageIndex: Integer); +var + R1, R2: TRect; + Rgn1, Rgn2: HRGN; +begin + if not HandleAllocated or (APageIndex < 0) or (APageIndex > PageCount - 1) then + Exit; + + R2 := Pages[APageIndex].Bounds; + R1 := Pages[APageIndex].SiteBounds; + InflateRect(R2, -(SelectionFrameThickness - 1), -(SelectionFrameThickness - 1)); + Rgn1 := CreateRectRgnIndirect(R1); + Rgn2 := CreateRectRgnIndirect(R2); + CombineRgn(Rgn1, Rgn1, Rgn2, RGN_DIFF); + DeleteObject(Rgn2); + InvalidateRgn(Handle, Rgn1, False); + DeleteObject(Rgn1); +end; + +function TCustomdxPreview.GetActualMeasurementUnits: TdxPreviewMeasurementUnits; +begin + if MeasurementUnits = pmuDefault then + Result := GetDefaultMeasurementUnits + else + Result := MeasurementUnits; +end; + +function TCustomdxPreview.GetAllRowCount: Integer; +begin + Result := ColCount; + Result := PageCount div Result + Byte(PageCount mod Result > 0); +end; + +function TCustomdxPreview.GetColCount: Integer; +begin + if FZoomMode = pzmPageWidth then + Result := 1 + else + begin + if FZoomMode = pzmNone then + Result := (ClientWidth - Indent) div (VisiblePageSize.X + Indent) + else + Result := + (MulDiv(ClientWidth, 100, FZoomFactor) - dxPreviewIndent) div (PageSize.X + dxPreviewIndent); + if Result > PageCount then Result := PageCount; + if Result < 1 then Result := 1; + if (FZoomMode = pzmPages) and (Result > FPageXCount) then + Result := FPageXCount; + end; +end; + +function TCustomdxPreview.GetColor: TColor; +begin + if FIsColorAssigned then + Result := inherited Color + else + Result := DefaultColor; +end; + +function TCustomdxPreview.GetNoPagesText: string; +begin + if FIsNoPagesTextAssigned then + Result := FNoPagesText + else + Result := DefaultNoPagesText; +end; + +procedure TCustomdxPreview.SetLookAndFeel(Value: TdxPreviewLookAndFeel); +begin + if LookAndFeel <> Value then + begin + FLookAndFeel := Value; + ScrollBarStyle := PreviewScrollBarStyleMap[Value]; + Brush.Color := Color; + RecreateWnd; + end; +end; + +procedure TCustomdxPreview.SetOptionsBehavior(Value: TdxPreviewOptionsBehavior); +var + Changes: TdxPreviewOptionsBehavior; + I: Integer; +begin + Changes := FOptionsBehavior + Value - FOptionsBehavior * Value; + if Changes <> [] then + begin + FOptionsBehavior := Value; + if pobAllowDragMargins in Changes then + for I := 0 to Margins.Count - 1 do + Margins[I].Enabled := pobAllowDragMargins in Value; + end; +end; + +procedure TCustomdxPreview.SetOptionsHint(Value: TdxPreviewOptionsHint); +var + Changes: TdxPreviewOptionsHint; +begin + Changes := FOptionsHint + Value - FOptionsHint * Value; + if Changes <> [] then + FOptionsHint := Value; +end; + +procedure TCustomdxPreview.SetOptionsStore(Value: TdxPreviewOptionsStore); +var + Changes: TdxPreviewOptionsStore; +begin + Changes := FOptionsStore + Value - FOptionsStore * Value; + if Changes <> [] then + FOptionsStore := Value; +end; + +procedure TCustomdxPreview.SetOptionsView(Value: TdxPreviewOptionsView); +var + Changes: TdxPreviewOptionsView; + I: Integer; +begin + Changes := FOptionsView + Value - FOptionsView * Value; + if Changes <> [] then + begin + FOptionsView := Value; + + if HandleAllocated then + if [povDefaultDrawPageBackground, povPageSelection] * Changes <> [] then + InvalidatePages + else + if povAutoHideScrollBars in Changes then + RecreateWnd; + + if povMargins in Changes then + for I := 0 to Margins.Count - 1 do + Margins[I].Visible := povMargins in Value; + end; +end; + +procedure TCustomdxPreview.SetOptionsZoom(Value: TdxPreviewOptionsZoom); +var + Changes: TdxPreviewOptionsZoom; +begin + Changes := FOptionsZoom + Value - FOptionsZoom * Value; + if Changes <> [] then + FOptionsZoom := Value; +end; + +procedure TCustomdxPreview.SetMarginColor(Value: TColor); +begin + if FMarginColor <> Value then + begin + FMarginColor := Value; + RecreateMarginPen; + if HandleAllocated then InvalidateMargins; + end; +end; + +procedure TCustomdxPreview.RecreateMarginPen; +begin + if FMarginPen <> 0 then DeleteObject(FMarginPen); + FMarginPen := CreatePen(PS_DOT, 1, ColorToRGB(MarginColor)); +end; + +function TCustomdxPreview.IsColorStored: Boolean; +begin + Result := FIsColorAssigned and (Color <> DefaultColor); +end; + +function TCustomdxPreview.IsNoPagesTextStored: Boolean; +begin + Result := FIsNoPagesTextAssigned and (FNoPagesText <> DefaultNoPagesText); +end; + +procedure TCustomdxPreview.SetBorderStyle(Value: TBorderStyle); +begin + if FBorderStyle <> Value then + begin + FBorderStyle := Value; + RecreateWnd; + end; +end; + +procedure TCustomdxPreview.SetColor(Value: TColor); +begin + if Color <> Value then + begin + inherited Color := Value; + FIsColorAssigned := True; + end; +end; + +function TCustomdxPreview.GetPage(index: Integer): TdxPreviewPage; +begin + Result := TdxPreviewPage(FPages[index]); +end; + +function TCustomdxPreview.GetPageCount: Integer; +begin + Result := FPages.Count; +end; + +function TCustomdxPreview.GetSelPageRow: Integer; +begin + Result := SelPageIndex div ColCount; +end; + +function TCustomdxPreview.GetSelPageCol: Integer; +begin + Result := SelPageIndex - SelPageRow * ColCount; +end; + +function TCustomdxPreview.GetRowCount: Integer; +begin + if ZoomMode = pzmPageWidth then + Result := 1 + else + begin + Result := (MulDiv(ClientHeight, 100, FZoomFactor) - dxPreviewIndent) div (PageSize.Y + dxPreviewIndent); + if Result < 1 then Result := 1; + if (ZoomMode = pzmPages) and (Result > FPageYCount) then + Result := FPageYCount; + end; +end; + +function TCustomdxPreview.GetVirtualHeight: Integer; +begin + { Result := MulDiv(dxPreviewIndent + AllRowCount * (PageSize.Y + dxPreviewIndent), + FZoomFactor, 100);} + Result := Indent + AllRowCount * (VisiblePageSize.Y + Indent); +end; + +function TCustomdxPreview.GetVirtualWidth: Integer; +begin + if (PageCount = 0) or (ZoomMode = pzmPageWidth) then + Result := ClientWidth + else + Result := Indent + ColCount * (VisiblePageSize.X + Indent); +end; + +procedure TCustomdxPreview.SetMinFooterSize(Value: Integer); +begin + if Value < 0 then + Value := 0; + if FMinFooterSize <> Value then + begin + Value := Min(Value, ActualOriginalPageSize.Y - MinUsefulSize.Y - MinHeaderSize - + Margins.Footer.Value - Margins.Header.Value); + FMinFooterSize := Value; + Margins.Bottom.Value := Max(Margins.Bottom.Value, Margins.Footer.Value + Value); + end; +end; + +procedure TCustomdxPreview.SetMinHeaderSize(Value: Integer); +begin + if Value < 0 then + Value := 0; + if FMinHeaderSize <> Value then + begin + Value := Min(Value, ActualOriginalPageSize.Y - MinUsefulSize.Y - MinFooterSize - + Margins.Footer.Value - Margins.Header.Value); + FMinHeaderSize := Value; + Margins.Top.Value := Max(Margins.Top.Value, Margins.Header.Value + Value); + end; +end; + +procedure TCustomdxPreview.SetMinUsefulSize(const Value: TPoint); +begin + FMinUsefulSize.X := MinMax(Value.X, 0, + ActualOriginalPageSize.X - Margins.Left.Value - Margins.Right.Value); + FMinUsefulSize.Y := MinMax(Value.Y, 0, + ActualOriginalPageSize.Y - Margins.Top.Value - Margins.Bottom.Value); +end; + +procedure TCustomdxPreview.SetNoPagesText(const Value: string); +begin + if NoPagesText <> Value then + begin + FNoPagesText := Value; + FIsNoPagesTextAssigned := True; + if PageCount = 0 then Invalidate; + end; +end; + +function TCustomdxPreview.GetVisiblePageSize: TPoint; +begin + Result.X := MulDiv(FPageSize.X, FZoomFactor, 100); + Result.Y := MulDiv(FPageSize.Y, FZoomFactor, 100); +end; + +procedure TCustomdxPreview.SetMargins(Value: TdxPreviewPageMargins); +begin + FMargins.Assign(Value); + if FUpdateCount = 0 then Invalidate; +end; + +procedure TCustomdxPreview.SetLeftPos(Value: Integer); +begin + Value := CheckLeftPos(Value); + if FLeftPos <> Value then + begin + if not FZooming then + ScrollWindowEx(Handle, FLeftPos - Value, 0, nil, nil, 0, nil, SW_INVALIDATE); + FLeftPos := Value; + if HandleAllocated then UpdateScrollBars; + end; +end; + +procedure TCustomdxPreview.SetMaxZoomFactor(Value: Integer); +begin + if Value < FMinZoomFactor then + Value := FMinZoomFactor; + if FMaxZoomFactor <> Value then + begin + FMaxZoomFactor := Value; + if ZoomFactor > FMaxZoomFactor then + ZoomFactor := FMaxZoomFactor; + end; +end; + +procedure TCustomdxPreview.SetMinZoomFactor(Value: Integer); +begin + if Value < dxPreviewMinZoomFactor then + Value := dxPreviewMinZoomFactor; + if Value > FMaxZoomFactor then + Value := FMaxZoomFactor; + if FMinZoomFactor <> Value then + begin + FMinZoomFactor := Value; + if ZoomFactor < FMinZoomFactor then + ZoomFactor := FMinZoomFactor; + end; +end; + +procedure TCustomdxPreview.SetOnCalcPageCount(Value: TNotifyEvent); +begin + if @FOnCalcPageCount <> @Value then + begin + FOnCalcPageCount := Value; + if Assigned(FOnCalcPageCount) and ([csReading, csLoading] * ComponentState = []) then + begin + DoCalcPageCount; + if HandleAllocated then Invalidate; + end; + end; +end; + +procedure TCustomdxPreview.SetOrientation(Value: TdxPreviewPaperOrientation); +begin + if FOrientation <> Value then + begin + FOrientation := Value; + AdjustOrientation; + end; +end; + +procedure TCustomdxPreview.AdjustOrientation; +var + Temp, Temp1: Integer; +begin + BeginUpdate; + try + if pobAutoSwapMargins in OptionsBehavior then + if Orientation = ppoLandscape then + begin + Temp := Margins.Left.Value; + Margins.Left.Value := Margins.Bottom.Value; + Temp1 := Margins.Top.Value; + Margins.Top.Value := Temp; + Temp := Margins.Right.Value; + Margins.Right.Value := Temp1; + Margins.Bottom.Value := Temp; + end + else + begin + Temp := Margins.Bottom.Value; + Margins.Bottom.Value := Margins.Left.Value; + Temp1 := Margins.Right.Value; + Margins.Right.Value := Temp; + Temp := Margins.Top.Value; + Margins.Top.Value := Temp1; + Margins.Left.Value := Temp; + end; + PageParametersChanged(FOriginalPageSize, [pcX, pcY]); + CheckMargins; + finally + EndUpdate; + CheckZoomFactor; + end; +end; + +procedure TCustomdxPreview.PageParametersChanging(Sender: TObject; + Coords: TdxPointCoords; var Values: array of Integer); +begin + if (pcX in Coords) and (Values[0] < MinUsefulSize.X) then + Values[0] := MinUsefulSize.X; + if (pcY in Coords) and (Values[1] < MinUsefulSize.Y) then + Values[1] := MinUsefulSize.Y; +end; + +procedure TCustomdxPreview.PageParametersChanged(Sender: TObject; Coords: TdxPointCoords); +var + V: Integer; +begin + FActualOriginalPageSize := OriginalPageSize.Point; + if Orientation = ppoLandscape then + with FActualOriginalPageSize do + begin + V := Y; + Y := X; + X := V; + end; + FPageSize := LoMetricToPixels(ActualOriginalPageSize); + CheckMargins; + CheckZoomFactor; +end; + +procedure TCustomdxPreview.SetOriginalPageSize(Value: TdxPointWrapper); +begin + if Value <> nil then OriginalPageSize.Assign(Value); +end; + +procedure TCustomdxPreview.SetPageBackground(Value: TdxBackground); +begin + PageBackground.Assign(Value); +end; + +procedure TCustomdxPreview.SetPageCount(Value: Integer); +var + I: Integer; +begin + if Value < 0 then Value := 0; + if PageCount <> Value then + begin + if Value < PageCount then + begin + for I := Value to FPages.Count - 1 do + TdxPreviewPage(FPages[I]).Free; + FPages.Count := Value; + end + else + for I := PageCount to Value - 1 do + CreatePage; + // check SelPageIndex + if not (csDestroying in ComponentState) then + begin + ResyncSelPageIndex; + CheckZoomFactor; + end; + end; +end; + +procedure TCustomdxPreview.ResyncSelPageIndex; +var + Value: Integer; +begin + Value := SelPageIndex; + while (Value > -1) and not CanSelectPage(Value) do + Dec(Value); + if Value = -1 then + begin + Value := 0; + while (Value < PageCount) and not CanSelectPage(Value) do + Inc(Value); + end; + if Value = PageCount then Value := -1; + SelPageIndex := Value; +end; + +procedure TCustomdxPreview.SetPageXCount(Value: Integer); +begin + if Value < 1 then Value := 1; + if FPageXCount <> Value then + begin + FPageXCount := Value; + ZoomMode := pzmPages; + CheckZoomFactor; + end; +end; + +procedure TCustomdxPreview.SetPageYCount(Value: Integer); +begin + if Value < 1 then Value := 1; + if FPageYCount <> Value then + begin + FPageYCount := Value; + ZoomMode := pzmPages; + CheckZoomFactor; + end; +end; + +procedure TCustomdxPreview.SetSelPageIndex(Value: Integer); +begin + if Value < -1 then Value := -1; + if Value > PageCount - 1 then Value := PageCount - 1; + + if FSelPageIndex <> Value then + if (Value = -1) or CanSelectPage(Value) then + begin + DoSelectedPageChanging; + if FSelPageIndex < PageCount then + begin + InvalidatePageBorder(FSelPageIndex); + InvalidateMargins; + end; + FSelPageIndex := Value; + if FSelPageIndex <> -1 then + begin + InvalidatePageBorder(FSelPageIndex); + InvalidateMargins; + MakeVisible(FSelPageIndex); + end; + DoSelectedPageChanged; + end; +end; + +procedure TCustomdxPreview.SetTopPos(Value: Integer); +begin + Value := CheckTopPos(Value); + if FTopPos <> Value then + begin + if not FZooming then + ScrollWindowEx(Handle, 0, FTopPos - Value, nil, nil, 0, nil, SW_INVALIDATE); + FTopPos := Value; + if HandleAllocated then UpdateScrollBars; + end; +end; + +procedure TCustomdxPreview.SetZoomed(Value: Boolean); +begin + FZoomedFixed := True; + if not FZoomed and Value then + begin + FZoomed := True; + FUnzoomedFactor := ZoomFactor; + FUnzoomedMode := ZoomMode; + ZoomFactor := 100; + end + else if FZoomed then + if ZoomFactor = 100 then + begin + FZoomed := False; + ZoomMode := FUnzoomedMode; + ZoomFactor := FUnzoomedFactor; + end + else + ZoomFactor := 100; + FZoomedFixed := False; + UpdateWindow(Handle); +end; + +procedure TCustomdxPreview.SetZoomStep(Value: Integer); +begin + if (Value < 1) then Value := 1; + if (FZoomStep <> Value) then FZoomStep := Value; +end; + +procedure TCustomdxPreview.SetZoomFactor(Value: Integer); +begin + if Value < FMinZoomFactor then Value := FMinZoomFactor; + if Value > FMaxZoomFactor then Value := FMaxZoomFactor; + if FZoomFactor <> Value then + begin + FZoomFactor := Value; + if not FZoomModeFixed then FZoomMode := pzmNone; + if not FZoomedFixed then FZoomed := FZoomFactor >= 100; + // FIndent := dxPreviewIndent1 + MulDiv(dxPreviewIndent2, FZoomFactor, 100); + FIndent := dxPreviewIndent1 + dxPreviewIndent2 * FZoomFactor div 100; + if FZoomMode = pzmNone then + begin + FZooming := True; + try + CheckZoomFactor; + finally + FZooming := False; + end; + end + else + if (FUpdateCount = 0) then Invalidate; + DoZoomFactorChanged; + end; +end; + +procedure TCustomdxPreview.SetZoomMode(Value: TdxPreviewZoomMode); +begin + if FZoomMode <> Value then + begin + FZoomMode := Value; + CheckZoomFactor; + DoZoomModeChanged; + end; +end; + +procedure TCustomdxPreview.CreateHint; +begin + if FHintWindow = nil then + FHintWindow := TdxPreviewHintWindow.Create(nil); +end; + +procedure TCustomdxPreview.DestroyHint; +begin + FreeAndNil(FHintWindow); +end; + +procedure TCustomdxPreview.ActivateHint(AMargin: TdxPreviewPageMargin); +var + Pt: TPoint; +begin + if FHintWindow = nil then Exit; + Pt := ScreenToClient(Mouse.CursorPos); + with AMargin do + begin + if IsVertical then + if IsDragging then + Pt.X := DraggingPos + else + Pt.X := Bounds.Left + else + if IsDragging then + Pt.Y := DraggingPos + else + Pt.Y := Bounds.Top; + Windows.ClientToScreen(Handle, Pt); + end; + TdxPreviewHintWindow(FHintWindow).ActivateHint(Pt, AMargin.DisplayText, AMargin); +end; + +procedure TCustomdxPreview.CancelHintHide; +begin + FHintHideShortTimer.Enabled := False; +end; + +procedure TCustomdxPreview.CancelHintShow; +begin + FHintShowTimer.Enabled := False; + DestroyHint; +end; + +procedure TCustomdxPreview.StartHintShow; +begin + FHintShowTimer.Enabled := True; +end; + +procedure TCustomdxPreview.ClearLastMousePos; +begin + FLastMousePos := MakePoint(MaxInt, MaxInt); +end; + +procedure TCustomdxPreview.CancelDragMargin; +begin + if DraggingMargin = nil then Exit; + DraggingMargin.DraggingPos := NullDraggingPos; + DraggingMargin.DoDragAfter; + FDraggingMargin := nil; + ClearLastMousePos; +end; + +procedure TCustomdxPreview.DestroyPageNumberHint; +begin + FreeAndNil(FHintWindowPageNumber); +end; + +procedure TCustomdxPreview.UpdatePageNumberHint; +var + HintText: string; +begin + if FHintWindowPageNumber = nil then + FHintWindowPageNumber := TdxPreviewHintWindow.Create(nil); + DoGetPageNumberHintText(HintText); + TdxPreviewHintWindow(FHintWindowPageNumber).ActivateHint(Mouse.CursorPos, HintText, nil); +end; + +function TCustomdxPreview.GetScrollInfo(ABarFlag: Integer; var AScrollInfo: TScrollInfo): BOOL; +begin + Result := FlatSB_GetScrollInfo(Handle, ABarFlag, AScrollInfo); +end; + +function TCustomdxPreview.SetScrollInfo(ABarFlag: Integer; const AScrollInfo: TScrollInfo; + ARedraw: BOOL): Integer; +begin + Result := FlatSB_SetScrollInfo(Handle, ABarFlag, AScrollInfo, ARedraw); +end; + +procedure TCustomdxPreview.SetSelectionFrameThickness(Value: Integer); +begin + if Value < 2 then Value := 2; + if FSelectionFrameThickness <> Value then + begin + FSelectionFrameThickness := Value; + if SelPageIndex <> -1 then InvalidatePage(SelPageIndex); + end; +end; + +procedure TCustomdxPreview.SetScrollBarStyle(Value: TScrollBarStyle); +begin + if Value <> FScrollBarStyle then + begin + FScrollBarStyle := Value; + RecreateWnd; + end; +end; + +function TCustomdxPreview.CanChangeMargins: Boolean; +begin + Result := [csReading, csLoading] * ComponentState = []; +end; + +procedure TCustomdxPreview.ScrollPage(ADirection: TdxPreviewScrollDirection); +const + MsgMap: array[TdxPreviewScrollDirection] of Cardinal = (WM_HSCROLL, WM_VSCROLL, WM_HSCROLL, WM_VSCROLL); + ScrollCodeMap: array[TdxPreviewScrollDirection] of Smallint = (SB_LINELEFT, SB_LINEUP, SB_LINERIGHT, SB_LINEDOWN); + BarMap: array[TdxPreviewScrollDirection] of Integer = (SB_HORZ, SB_VERT, SB_HORZ, SB_VERT); +var + Message: TWMScroll; +begin + FillChar(Message, SizeOf(TMessage), 0); + Message.Msg := MsgMap[ADirection]; + Message.ScrollCode := ScrollCodeMap[ADirection]; + Message.Pos := GetScrollPos(Handle, BarMap[ADirection]); + Dispatch(Message); +end; + +procedure TCustomdxPreview.DrawNoPages; +var + R: TRect; + H: Integer; + F: HFONT; + C: TColor; +begin + R := ClientRect; + FillRect(FDC, R, Brush.Handle); + SetBkMode(FDC, TRANSPARENT); + + H := DrawText(FDC, PChar(NoPagesText), Length(NoPagesText), R, DT_LEFT or DT_CALCRECT or DT_WORDBREAK); + R := ClientRect; + R.Top := R.Top + (R.Bottom - R.Top - H) div 2; + R.Bottom := R.Top + H; + + F := SelectObject(FDC, Font.Handle); + C := SetTextColor(FDC, ColorToRGB(clWindow)); + DrawText(FDC, PChar(NoPagesText), Length(NoPagesText), R, DT_WORDBREAK or DT_CENTER or DT_TOP); + SetTextColor(FDC, C); + SelectObject(FDC, F); +end; + +procedure TCustomdxPreview.DrawPages; +var + I, J, H, PageIndex: Integer; + Page: TdxPreviewPage; + R: TRect; + Rgn, RestRgn: HRGN; + + procedure ExcludePageRect(const R: TRect); + begin + Rgn := CreateRectRgnIndirect(R); + CombineRgn(RestRgn, RestRgn, Rgn, RGN_DIFF); + DeleteObject(Rgn); + end; + +begin + H := ClientHeight; + GetClipBox(FDC, R); + RestRgn := CreateRectRgnIndirect(R); + for J := 0 to AllRowCount - 1 do + for I := 0 to ColCount - 1 do + begin + PageIndex := J * ColCount + I; + if PageIndex > PageCount - 1 then Break; + Page := Pages[PageIndex]; + R := Page.SiteBounds; + if (R.Bottom > 0) and (R.Top < H) and RectVisible(FDC, R) then + begin + ExcludePageRect(R); + R := Page.Bounds; + if RectVisible(FDC, R) then + begin + FPageStack.Add(TObject(PageIndex)); + DrawPageBackground(R, PageIndex); + end; + DrawPageBorder(FDC, PageIndex); + end; + end; + + if GetRgnBox(RestRgn, R) <> NULLREGION then + DrawRestSpaceBackgroundRgn(RestRgn); + DeleteObject(RestRgn); +end; + +procedure TCustomdxPreview.DrawPagesContent; +var + I, PageIndex: Integer; +begin + for I := 0 to FPageStack.Count - 1 do + begin + PageIndex := Integer(FPageStack[I]); + DoDrawPageContent(Pages[PageIndex].Bounds, PageIndex); + if (povMargins in OptionsView) and (PageIndex = SelPageIndex) then + DrawMargins(FDC); + end; +end; + +procedure TCustomdxPreview.DrawRestSpaceBackgroundRgn(ARgn: HRGN); +{$IFDEF DELPHI7} +var + Count, I: Integer; + RgnHeader: TRgnDataHeader; + Rects: TRects; +{$ENDIF} +begin + {$IFDEF DELPHI7} + if ThemeServices.ThemesEnabled and (Parent <> nil) and (csParentBackground in ControlStyle) then + begin + Count := GetRgnData(ARgn, RgnHeader, Rects); + for I := 0 to Count - 1 do + ThemeServices.DrawParentBackground(Handle, FDC, nil, False, @Rects[I]); + end + else + {$ENDIF} + FillRgn(FDC, ARgn, Brush.Handle); +end; + +procedure TCustomdxPreview.DrawRestSpaceBackgroundRect(const R: TRect); +begin + {$IFDEF DELPHI7} + if ThemeServices.ThemesEnabled and (Parent <> nil) and (csParentBackground in ControlStyle) then + ThemeServices.DrawParentBackground(Handle, FDC, nil, False, @R) + else + {$ENDIF} + FillRect(FDC, R, Brush.Handle); +end; + +procedure TCustomdxPreview.AdjustPagesBounds; +begin + if povAutoHideScrollBars in OptionsView then + begin + CalcPagesBounds(TopPos, VirtualWidth + GetSystemMetrics(SM_CXVSCROLL), + VirtualHeight + GetSystemMetrics(SM_CXHSCROLL)); + if (VirtualWidth > ClientWidth) or (VirtualHeight > ClientHeight) then + CalcPagesBounds(TopPos, VirtualWidth, VirtualHeight); + end + else + CalcPagesBounds(TopPos, VirtualWidth, VirtualHeight); +end; + +function TCustomdxPreview.CanHorzScrollBarBeVisible: Boolean; +begin + Result := ScrollBars in [ssBoth, ssHorizontal]; +end; + +function TCustomdxPreview.CanVertScrollBarBeVisible: Boolean; +begin + Result := ScrollBars in [ssBoth, ssVertical]; +end; + +function TCustomdxPreview.CanAnyScrolling: Boolean; +begin + Result := CanHorzScrolling or CanVertScrolling; +end; + +function TCustomdxPreview.CanHorzScrolling: Boolean; +begin + Result := (ZoomMode <> pzmPageWidth) and + (ClientWidth < VirtualWidth - Byte(ZoomMode = pzmPages) * Indent); +end; + +function TCustomdxPreview.CanVertScrolling: Boolean; +begin + Result := ClientHeight < VirtualHeight - Byte(ZoomMode = pzmPages) * Indent; +end; + +function TCustomdxPreview.CanPageScrolling(ADirection: TdxPreviewScrollDirection): Boolean; +begin + Result := ((ZoomMode <> pzmPages) or (PageCount <> 1)) and + ((ADirection in [psdLeft, psdRight]) and CanHorzScrolling) or + ((ADirection in [psdUp, psdDown]) and CanVertScrolling); +end; + +procedure TCustomdxPreview.UpdateScrollBars; +const + DisableNoScroll: array[Boolean] of UINT = (SIF_DISABLENOSCROLL, 0); +var + ScrollInfo: TScrollInfo; + + procedure UpdateHorzScrollBar; + begin + with ScrollInfo do + begin + cbSize := SizeOf(ScrollInfo); + fMask := SIF_ALL or DisableNoScroll[povAutoHideScrollBars in OptionsView]; + nMin := 0; + nMax := VirtualWidth - Byte(ZoomMode = pzmPages) * Indent - 1; + nPage := ClientWidth; + nPos := LeftPos; + end; + SetScrollInfo(SB_HORZ, ScrollInfo, True); + end; + + procedure UpdateVertScrollBar; + begin + with ScrollInfo do + begin + cbSize := SizeOf(ScrollInfo); + fMask := SIF_ALL or DisableNoScroll[povAutoHideScrollBars in OptionsView]; + nMin := 0; + nMax := VirtualHeight - Byte(ZoomMode = pzmPages) * Indent - 1; + nPage := ClientHeight; + nPos := TopPos; + end; + SetScrollInfo(SB_VERT, ScrollInfo, True); + end; + +begin + if CanHorzScrollBarBeVisible then UpdateHorzScrollBar; + if CanVertScrollBarBeVisible then UpdateVertScrollBar; + if DoublePassUpdateScrollBars then + begin + UpdateHorzScrollBar; + UpdateVertScrollBar; + end; +end; + +function TCustomdxPreview.DoublePassUpdateScrollBars: Boolean; +begin + Result := (povAutoHideScrollBars in OptionsView) and + CanHorzScrollBarBeVisible and CanVertScrollBarBeVisible; +end; + +procedure TCustomdxPreview.ResetHintShowTimer(X, Y: Integer); +begin + CancelHintShow; + if not IsDesigning and IsParentFormActive and (pohShowForMargins in OptionsHint) and + (GetHitInfoAt(X, Y) * phtMargins <> []) and CanShowMarginHint then + StartHintShow; +end; + +procedure TCustomdxPreview.SetScrollBars(Value: TScrollStyle); +begin + if FScrollBars <> Value then + begin + FScrollBars := Value; + RecreateWnd; + end; +end; + +procedure TCustomdxPreview.DesignerModified; +var + Designer: IDesignerNotify; +begin + if IsDesigning then + begin + Designer := GetParentForm(Self).Designer; + if Designer <> nil then Designer.Modified; + end; +end; + +function TCustomdxPreview.IsDesigning: Boolean; +begin + Result := csDesigning in ComponentState; +end; + +function TCustomdxPreview.IsParentFormActive: Boolean; +var + Form: TCustomForm; +begin + Form := GetParentForm(Self); + Result := (Form <> nil) and Form.Active; +end; + +procedure TCustomdxPreview.HintHideLongTimerHandler(Sender: TObject); +begin +end; + +procedure TCustomdxPreview.HintHideShortTimerHandler(Sender: TObject); +begin + if not IsParentFormActive or (Time - FLongShowHintTime > dxPreviewHideHintLongTime) then + begin + DestroyHint; + //FHintHideTimer.Enabled := False; + end; +end; + +procedure TCustomdxPreview.HintShowTimerHandler(Sender: TObject); +var + Margin: TdxPreviewPageMargin; +begin + FHintShowTimer.Enabled := False; + Margin := MarginFromPoint(ScreenToClient(Mouse.CursorPos)); + if (Margin <> nil) and (not Margin.IsDragging or (pohShowOnDrag in OptionsHint)) then + begin + CreateHint; + ActivateHint(Margin); + FLongShowHintTime := GetTickCount; + FHintHideShortTimer.Enabled := True; + end; +end; + +procedure TCustomdxPreview.ReadIsNoPagesTextAssigned(AReader: TReader); +begin + FIsNoPagesTextAssigned := AReader.ReadBoolean; +end; + +procedure TCustomdxPreview.WriteIsNoPagesTextAssigned(AWriter: TWriter); +begin + AWriter.WriteBoolean(FIsNoPagesTextAssigned); +end; + +procedure TCustomdxPreview.WMCaptureChanged(var Message: TMessage); +begin + CancelDragMargin; + DestroyPageNumberHint; + inherited; +end; + +procedure TCustomdxPreview.WMDestroy(var Message: TWMDestroy); +begin + if (FDC <> 0) and HandleAllocated then + ReleaseDC(Handle, FDC); + FDC := 0; + inherited; +end; + +procedure TCustomdxPreview.WMGetDlgCode(var Message: TWMGetDlgCode); +const + AllKeys: array[Boolean] of LongInt = (0, DLGC_WANTALLKEYS); + ArrowKeys: array[Boolean] of LongInt = (0, DLGC_WANTARROWS); +begin + inherited; + Message.Result := Message.Result or + AllKeys[DraggingMargin <> nil] or ArrowKeys[pobKeyNavigation in OptionsBehavior]; +end; + +procedure TCustomdxPreview.WMEraseBkgnd(var Message: TWMEraseBkgnd); +begin + Message.Result := 1; +end; + +procedure TCustomdxPreview.WMHScroll(var Message: TWMHScroll); +begin + inherited; + case Message.ScrollCode of + SB_LINEUP: + LeftPos := LeftPos - dxPreviewScrollStep; + SB_LINEDOWN: + LeftPos := LeftPos + dxPreviewScrollStep; + SB_PAGEUP: + LeftPos := LeftPos - ClientWidth; + SB_PAGEDOWN: + LeftPos := LeftPos + ClientWidth; + SB_THUMBTRACK: + if pobThumbTracking in OptionsBehavior then LeftPos := Message.Pos; + SB_THUMBPOSITION: + if not (pobThumbTracking in OptionsBehavior) then + begin + LeftPos := Message.Pos; + UpdateWindow(Handle); + end; + end; +end; + +procedure TCustomdxPreview.WMKillFocus(var Message: TWMKillFocus); +begin + ClearLastMousePos; + HideAllHints; + inherited; +end; + +procedure TCustomdxPreview.WMRButtonUp(var Message: TWMRButtonUp); +begin + if ((PopupMenu <> nil) and PopupMenu.AutoPopup) or IsDesigning then + HideAllHints; + inherited; +end; + +procedure TCustomdxPreview.WMMouseActivate(var Message: TWMMouseActivate); +var + Control: TWinControl; + Pt: TPoint; +begin + inherited; + if not IsDesigning then + begin + Control := FindControl(GetFocus); + if (Control = nil) or (GetParentForm(Control) <> GetParentForm(Self)) then + begin + Pt := ScreenToClient(Mouse.CursorPos); + if (PageIndexFromPoint(Pt) > -1) {and not Assigned(MarginFromPoint(APt)) } then + Message.Result := MA_ACTIVATEANDEAT; + end; + if CanFocus then SetFocus; + end; +end; + +procedure TCustomdxPreview.WMMouseWheel(var Message: TWMMouseWheel); + + function IsZoomRequested: Boolean; + begin + Result := (pozZoomOnMouseRoll in OptionsZoom) or (GetKeyState(VK_CONTROL) < 0); + end; + + function IsScrolledUp: Boolean; + begin + Result := Message.WheelDelta > 0; + end; + +const + BarValueMap: array[Boolean] of WPARAM = (SB_LINEDOWN, SB_LINEUP); +begin + inherited; + if DraggingMargin <> nil then + Perform(WM_LBUTTONUP, Message.Keys, TMessage(Message).lParam); + HideAllHints; + + if PageCount <> 0 then + if IsZoomRequested then + if IsScrolledUp then + ZoomIn + else + ZoomOut + else + if CanVertScrolling then + SendMessage(Handle, WM_VSCROLL, BarValueMap[IsScrolledUp], 0); +end; + +procedure TCustomdxPreview.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + inherited; + if (LookAndFeel <> plfStandard) and (BorderStyle <> bsNone) then + begin + InflateRect(Message.CalcSize_Params^.rgrc[0], -1, -1); + end; +end; + +procedure TCustomdxPreview.WMNCDestroy(var Message: TWMNCDestroy); +begin + HideAllHints; + inherited; +end; + +procedure TCustomdxPreview.WMNCHitTest(var Message: TWMNCHitTest); +begin + DefaultHandler(Message); +end; + +procedure TCustomdxPreview.WMNCPaint(var Message: TWMNCPaint); +const + Flat: array[Boolean] of UINT = (0, BF_FLAT); +var + R: TRect; + DC: HDC; + AStyle: DWORD; +begin + inherited; + if (LookAndFeel <> plfStandard) and (BorderStyle <> bsNone) then + begin + GetWindowRect(Handle, R); + OffsetRect(R, -R.Left, -R.Top); + DC := GetWindowDC(Handle); + try + DrawEdge(DC, R, BDR_SUNKENOUTER, BF_RECT or Flat[LookAndFeel = plfUltraFlat]); + + AStyle := GetWindowLong(Handle, GWL_STYLE); + if (AStyle and WS_HSCROLL <> 0) and (AStyle and WS_VSCROLL <> 0) then + begin + InflateRect(R, -1, -1); + R.Left := R.Right - GetSystemMetrics(SM_CXVSCROLL); + R.Top := R.Bottom - GetSystemMetrics(SM_CYHSCROLL); + + FillRect(DC, R, HBRUSH(COLOR_BTNFACE + 1)); + end; + finally + ReleaseDC(Handle, DC); + end; + end; +end; + +procedure TCustomdxPreview.WMSetCursor(var Message: TWMSetCursor); +var + Cursor: HCURSOR; + Margin: TdxPreviewPageMargin; + Pt: TPoint; + HitInfo: TdxPreviewHitTests; +begin + Cursor := 0; + if Message.HitTest = HTCLIENT then + begin + Margin := DraggingMargin; + if (Margin = nil) and IsParentFormActive then + begin + Pt := ScreenToClient(Mouse.CursorPos); + HitInfo := GetHitInfoAt(Pt); + if phtPage in HitInfo then + if phtMargins * HitInfo <> [] then + begin + Margin := MarginFromPoint(Pt); + if Margin.Enabled then + Cursor := Screen.Cursors[Margin.GetCursor]; + end + else + if not IsDesigning and (pozZoomOnClick in OptionsZoom) and (PageIndexFromPoint(Pt) = SelPageIndex) then + if Zoomed then + Cursor := Screen.Cursors[crdxPreviewZoomOut] + else + Cursor := Screen.Cursors[crdxPreviewZoomIn]; + end; + end; + + if Cursor <> 0 then + SetCursor(Cursor) + else + inherited; +end; + +procedure TCustomdxPreview.WMSize(var Message: TWMSize); +begin + inherited; + CheckZoomFactor; +end; + +procedure TCustomdxPreview.WMVScroll(var Message: TWMVScroll); + + function GetScrollTrackPos: Integer; + var + ScrollInfo: TScrollInfo; + begin + with ScrollInfo do + begin + cbSize := SizeOf(ScrollInfo); + fMask := SIF_TRACKPOS; + end; + GetScrollInfo(SB_VERT, ScrollInfo); + Result := ScrollInfo.nTrackPos; + end; + +var + TrackPos: Integer; +begin + inherited; + case Message.ScrollCode of + SB_LINEUP: + TopPos := TopPos - dxPreviewScrollStep; + SB_LINEDOWN: + TopPos := TopPos + dxPreviewScrollStep; + SB_PAGEUP: + TopPos := TopPos - ClientHeight; + SB_PAGEDOWN: + TopPos := TopPos + ClientHeight; + SB_THUMBTRACK: + begin + TrackPos := GetScrollTrackPos; + FHintShowTimer.Enabled := False; + if pobThumbTracking in OptionsBehavior then + TopPos := TrackPos; + if (pohShowOnScroll in OptionsHint) and (AllRowCount > 1) then + begin + CalcPagesBounds(TrackPos, VirtualWidth, VirtualHeight); + UpdatePageNumberHint; + end; + end; + SB_THUMBPOSITION: + if not (pobThumbTracking in OptionsBehavior) then + begin + TopPos := GetScrollTrackPos;; + UpdateWindow(Handle); + end; + SB_ENDSCROLL: + DestroyPageNumberHint; + end; +end; + +procedure TCustomdxPreview.CMCancelMode(var Message: TCMCancelMode); +begin + HideAllHints; + inherited; +end; + +procedure TCustomdxPreview.CMColorChanged(var Message: TMessage); +begin + inherited; + Brush.Color := Color; + NotifyControls(CM_PARENTCOLORCHANGED); +end; + +procedure TCustomdxPreview.CMCtl3DChanged(var Message: TMessage); +begin + inherited; + if (BorderStyle = bsSingle) and (LookAndFeel = plfStandard) then + RecreateWnd; +end; + +procedure TCustomdxPreview.CMDesignHitTest(var Message: TCMDesignHitTest); +begin + Message.Result := Integer((DraggingMargin <> nil) or (GetHitInfoAt(Message.Pos) * phtMargins <> [])); +end; + +procedure TCustomdxPreview.CMHintShow(var Message: TCMHintShow); +begin + inherited; + Message.Result := Integer((DraggingMargin <> nil) and + (PageIndexFromPoint(Message.HintInfo^.CursorPos) <> -1)); +end; + +procedure TCustomdxPreview.CMSysColorChange(var Message: TMessage); +begin + inherited; + if MarginColor and $80000000 = $80000000 then + begin + RecreateMarginPen; + InvalidateMargins; + end; +end; + +function DefineCursor(const AResName: PChar): TCursor; +var + Handle: HCURSOR; +begin + Result := crDefault; + Handle := LoadCursor(hInstance, AResName); + if Handle > 0 then + begin + for Result := 100 to High(TCursor) do + if Screen.Cursors[Result] = Screen.Cursors[crDefault] then + begin + Screen.Cursors[Result] := Handle; + Exit; + end; + DestroyCursor(Handle); + raise EOutOfResources.Create(cxGetResourceString(@sdxOutOfResources)); + end; +end; + +procedure DefineCursors; +begin + crdxPreviewHorzResize := DefineCursor(IDC_DXPSPREVIEW_MARGINSMOVEHORZ); + crdxPreviewVertResize := DefineCursor(IDC_DXPSPREVIEW_MARGINSMOVEVERT); + crdxPreviewZoomIn := DefineCursor(IDC_DXPSPREVIEW_ZOOMIN); + crdxPreviewZoomOut := DefineCursor(IDC_DXPSPREVIEW_ZOOMOUT); + crdxPreviewFullScroll := DefineCursor(IDC_DXPSPREVIEW_SCROLLFULL); + crdxPreviewHorzScroll := DefineCursor(IDC_DXPSPREVIEW_SCROLLHORZ); + crdxPreviewVertScroll := DefineCursor(IDC_DXPSPREVIEW_SCROLLVERT); + crdxPreviewUpScroll := DefineCursor(IDC_DXPSPREVIEW_WHEELSCROLLUP); + crdxPreviewRightScroll := DefineCursor(IDC_DXPSPREVIEW_WHEELSCROLLRIGHT); + crdxPreviewDownScroll := DefineCursor(IDC_DXPSPREVIEW_WHEELSCROLLDOWN); + crdxPreviewLeftScroll := DefineCursor(IDC_DXPSPREVIEW_WHEELSCROLLLEFT); + crdxPreviewTopLeftScroll := DefineCursor(IDC_DXPSPREVIEW_WHEELSCROLLTOPLEFT); + crdxPreviewBottomLeftScroll := DefineCursor(IDC_DXPSPREVIEW_WHEELSCROLLBOTTOMLEFT); + crdxPreviewTopRightLeftScroll := DefineCursor(IDC_DXPSPREVIEW_WHEELSCROLLTOPRIGHT); + crdxPreviewBottomRightScroll := DefineCursor(IDC_DXPSPREVIEW_WHEELSCROLLBOTTOMRIGHT); +end; + +initialization + DefineCursors; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxPrnDev.pas b/official/x.35/ExpressPrinting System/Sources/dxPrnDev.pas new file mode 100644 index 00000000..9609ec5b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPrnDev.pas @@ -0,0 +1,2380 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPrnDev; + +interface + +(*$HPPEMIT '#include ' *) + +{$I cxVer.inc} + +uses + Windows, Classes, ImgList, Controls, SysUtils, Graphics, Messages, dxPSGlbl; + +type + // Follow structures are supported only in W2K and upper + + // specifies the global default printer settings + + {$IFDEF CBUILDER5} + {$EXTERNALSYM _PRINTER_INFO_8A} + {$ENDIF} + _PRINTER_INFO_8A = record + DevMode: PDeviceModeA ; + end; + {$IFDEF CBUILDER5} + {$EXTERNALSYM _PRINTER_INFO_8W} + {$ENDIF} + _PRINTER_INFO_8W = record + DevMode: PDeviceModeW ; + end; + {$IFDEF CBUILDER5} + {$EXTERNALSYM _PRINTER_INFO_8} + {$ENDIF} + _PRINTER_INFO_8 = _PRINTER_INFO_8A; + TPrinterInfo8A = _PRINTER_INFO_8A; + TPrinterInfo8W = _PRINTER_INFO_8W; + TPrinterInfo8 = TPrinterInfo8A; + {$IFDEF CBUILDER5} + {$EXTERNALSYM PRINTER_INFO_8A} + {$ENDIF} + PRINTER_INFO_8A = _PRINTER_INFO_8A; + {$IFDEF CBUILDER5} + {$EXTERNALSYM PRINTER_INFO_8W} + {$ENDIF} + PRINTER_INFO_8W = _PRINTER_INFO_8W; + {$IFDEF CBUILDER5} + {$EXTERNALSYM PRINTER_INFO_8} + {$ENDIF} + PRINTER_INFO_8 = PRINTER_INFO_8A; + PPrinterInfo8A = ^TPrinterInfo8A; + PPrinterInfo8W = ^TPrinterInfo8W; + PPrinterInfo8 = PPrinterInfo8A; + + // specifies the per-user default printer settings + + {$IFDEF CBUILDER5} + {$EXTERNALSYM _PRINTER_INFO_9A} + {$ENDIF} + _PRINTER_INFO_9A = record + DevMode: PDeviceModeA ; + end; + {$IFDEF CBUILDER5} + {$EXTERNALSYM _PRINTER_INFO_9W} + {$ENDIF} + _PRINTER_INFO_9W = record + DevMode: PDeviceModeW ; + end; + {$IFDEF CBUILDER5} + {$EXTERNALSYM _PRINTER_INFO_8} + {$ENDIF} + _PRINTER_INFO_9 = _PRINTER_INFO_9A; + TPrinterInfo9A = _PRINTER_INFO_9A; + TPrinterInfo9W = _PRINTER_INFO_9W; + TPrinterInfo9 = TPrinterInfo9A; + {$IFDEF CBUILDER5} + {$EXTERNALSYM PRINTER_INFO_9A} + {$ENDIF} + PRINTER_INFO_9A = _PRINTER_INFO_9A; + {$IFDEF CBUILDER5} + {$EXTERNALSYM PRINTER_INFO_9W} + {$ENDIF} + PRINTER_INFO_9W = _PRINTER_INFO_9W; + {$IFDEF CBUILDER5} + {$EXTERNALSYM PRINTER_INFO_9} + {$ENDIF} + PRINTER_INFO_9 = PRINTER_INFO_9A; + PPrinterInfo9A = ^TPrinterInfo9A; + PPrinterInfo9W = ^TPrinterInfo9W; + PPrinterInfo9 = PPrinterInfo9A; + + TdxPrinterState = (psNoHandle, psHandleIC, psHandleDC); + TdxDuplexMode = (dmSimplex, dmHorizontal, dmVertical); + TdxPrinterOrientation = (poPortrait, poLandscape); + TdxPrinterCapability = (pcCopies, pcOrientation, pcCollation);//, pcDuplex, pcColor); + TdxPrinterCapabilities = set of TdxPrinterCapability; + + EdxPrintDevice = class(Exception); + + TdxPrintDeviceInfo = class + private + FDevice: PChar ; + FDriver: PChar ; + FPort: PChar ; + FIsDefault: Boolean; + FIsNetwork: Boolean; + public + constructor Create(ADriver, ADevice, APort: PChar ; + AnIsDefault, AnIsNetwork: Boolean); + destructor Destroy; override; + function IsEqual(ADriver, ADevice, APort: PChar ): Boolean; + + property Device: PChar read FDevice; + property Driver: PChar read FDriver; + property Port: PChar read FPort; + property IsDefault: Boolean read FIsDefault write FIsDefault; + property IsNetwork: Boolean read FIsNetwork; + end; + + TdxPrintDevice = class + private + FAborted: Boolean; + FAutoRefresh: Boolean; + FBins: TStrings; + FCanvas: TCanvas; + FCapabilities: TdxPrinterCapabilities; + FCurrentDevice: PChar ; + FCurrentDriver: PChar ; + FCurrentPort: PChar ; + FDC: HDC; + FDeviceHandle: THandle; + FDeviceMode: PDeviceMode ; + FDeviceModeChanged: Boolean; + FHDeviceMode: THandle; + FFileName: string; + FFonts: TStrings; + FIsDeviceModePersistent: Boolean; + FMaxCopies: Integer; + FMaxExtents: Integer; + FMinExtents: Integer; + FPageNumber: Integer; + FPapers: TStrings; + FPrinters: TStrings; + FPrinterIndex: Integer; + FPrinting: Boolean; + FState: TdxPrinterState; + FTitle: string; + FWindowHandle: HWND; + FOnNewPage: TNotifyEvent; + FOnPrinterChange: TNotifyEvent; + FOnRefresh: TNotifyEvent; + function GetBinIndex: Integer; + function GetBins: TStrings; + function GetCanvas: TCanvas; + function GetCollate: Boolean; + function GetColorMode: Boolean; + function GetCurrentDevice: PChar ; + function GetCurrentDriver: PChar ; + function GetCurrentPort: PChar ; + function GetDefaultDMPaper: Integer; + function GetDeviceMode: PDeviceMode; + function GetDuplex: TdxDuplexMode; + function GetFonts: TStrings; + function GetHandle: HDC; + function GetHDeviceMode: THandle; + function GetIsDefault: Boolean; + function GetIsInitialized: Boolean; + function GetIsNetwork: Boolean; + function GetMaxExtents(Index: Integer): Integer; + function GetMinExtents(Index: Integer): Integer; + function GetNumCopies: Integer; + function GetOrientation: TdxPrinterOrientation; + function GetPageHeight: Integer; + function GetPageHeightLoMetric: Integer; + function GetPageWidth: Integer; + function GetPageWidthLoMetric: Integer; + function GetPaperCount: Integer; + function GetPaperIndex: Integer; + function GetPapers: TStrings; + function GetPhysOffset(Index: Integer): Integer; + function GetPrinterCount: Integer; + function GetPrinterIndex: Integer; + function GetPrinterInfo(Index: Integer): TdxPrintDeviceInfo; + function GetPrinters: TStrings; + procedure SetBinIndex(Value: Integer); + procedure SetCollate(Value: Boolean); + procedure SetColorMode(Value: Boolean); + procedure SetDuplex(Value: TdxDuplexMode); + procedure SetIsDefault(Value: Boolean); + procedure SetNumCopies(Value: Integer); + procedure SetOrientation(Value: TdxPrinterOrientation); + procedure SetPaperIndex(Value: Integer); + procedure SetPrinterCapabilities(Value: Integer); + procedure SetPrinterIndex(Value: Integer); + + procedure CheckPrinting(Value: Boolean); + procedure ClosePrintDevice; + procedure DeselectHandles; + procedure FixMinMaxExtents; + procedure FreeAndNilBins; + procedure FreeAndNilCanvas; + procedure FreeAndNilFonts; + procedure FreeAndNilPapers; + procedure FreeAndNilPrinters; + procedure InternalSelectPaperBySize(var AWidth, AHeight: Integer); + procedure OpenPrintDevice(AIndex: Integer); + procedure SetState(Value: TdxPrinterState); + procedure SetToDefaultPrintDevice; + procedure WndProc(var Message: TMessage); + protected + procedure DoNewPage; dynamic; + procedure DoPrinterChanged; dynamic; + procedure DoRefresh; dynamic; + public + constructor Create; + destructor Destroy; override; + + procedure Abort; + function BeginDoc: Integer; {returns the print job identifier for the document} + procedure EndDoc; + procedure NewPage; + + function FindPrintDevice(ADevice, APort: PChar ): Integer; + function IsDeviceModeChanged: Boolean; + procedure Refresh; + procedure ResetDC(IsForced: Boolean); + procedure ResetPrintDevice; + + function FindBin(ABin: Integer): Integer; overload; + function FindBin(const AName: string): Integer; overload; + function IsAutoSelectBin(AIndex: Integer): Boolean; + function IsUserPaperSource(AIndex: Integer): Boolean; + function SelectBin(Value: Integer): Boolean; overload; + function SelectBin(const AName: string): Boolean; overload; + + function FindPaper(ADMPaper: Integer): Integer; overload; + function FindPaper(const AName: string): Integer; overload; + function FindPaper(const ASize: TPoint): Integer; overload; + function FindPaper(AWidth, AHeight: Integer): Integer; overload; + function IsEnvelopePaper(AIndex: Integer): Boolean; + function IsUserPaperSize(AIndex: Integer): Boolean; + function SelectPaper(ADMPaper: Integer): Boolean; overload; + function SelectPaper(const AName: string): Boolean; overload; + function SelectPaper(var AWidth, AHeight: Integer): Boolean; overload; + + function IsSupportColoration: Boolean; + function IsSupportDuplex: Boolean; + + property Aborted: Boolean read FAborted; + property AutoRefresh: Boolean read FAutoRefresh write FAutoRefresh; + property BinIndex: Integer read GetBinIndex write SetBinIndex; + property Bins: TStrings read GetBins; + property Canvas: TCanvas read GetCanvas; + property Capabilities: TdxPrinterCapabilities read FCapabilities; + property Collate: Boolean read GetCollate write SetCollate; + property ColorMode: Boolean read GetColorMode write SetColorMode; + property Copies: Integer read GetNumCopies write SetNumCopies; + property CurrentDevice: PChar read GetCurrentDevice; + property CurrentDriver: PChar read GetCurrentDriver; + property CurrentPort: PChar read GetCurrentPort; + property DefaultDMPaper: Integer read GetDefaultDMPaper; + property DeviceMode: PDeviceMode read GetDeviceMode; + property Duplex: TdxDuplexMode read GetDuplex write SetDuplex; + property FileName: string read FFileName write FFileName; + property Fonts: TStrings read GetFonts; + property Handle: HDC read GetHandle; + property HDeviceMode: THandle read GetHDeviceMode; + property IsDefault: Boolean read GetIsDefault write SetIsDefault; + property IsDeviceModePersistent: Boolean read FIsDeviceModePersistent write FIsDeviceModePersistent; + property IsInitialized: Boolean read GetIsInitialized; + property IsNetwork: Boolean read GetIsNetwork; + property MaxCopies: Longint read FMaxCopies; + property MaxExtentX: Integer index 0 read GetMaxExtents; + property MaxExtentY: Integer index 1 read GetMaxExtents; + property MinExtentX: Integer index 0 read GetMinExtents; + property MinExtentY: Integer index 1 read GetMinExtents; + property Orientation: TdxPrinterOrientation read GetOrientation write SetOrientation; + property PageHeight: Integer read GetPageHeight; + property PageHeightLoMetric: Integer read GetPageHeightLoMetric; + property PageWidth: Integer read GetPageWidth; + property PageWidthLoMetric: Integer read GetPageWidthLoMetric; + property PageNumber: Integer read FPageNumber; + property PaperIndex: Integer read GetPaperIndex write SetPaperIndex; + property PaperCount: Integer read GetPaperCount; + property Papers: TStrings read GetPapers; + property PhysOffsetX: Integer index 0 read GetPhysOffset; + property PhysOffsetY: Integer index 1 read GetPhysOffset; + property PrinterCount: Integer read GetPrinterCount; + property PrinterIndex: Integer read GetPrinterIndex write SetPrinterIndex; + property PrinterInfos[Index: Integer]: TdxPrintDeviceInfo read GetPrinterInfo; + property Printers: TStrings read GetPrinters; + property Printing: Boolean read FPrinting; + property Title: string read FTitle write FTitle; + + property OnNewPage: TNotifyEvent read FOnNewPage write FOnNewPage; + property OnPrinterChange: TNotifyEvent read FOnPrinterChange write FOnPrinterChange; + property OnRefresh: TNotifyEvent read FOnRefresh write FOnRefresh; + end; + + TdxPaperInfo = class + private + FDMPaper: Integer; + FName: string; + FPrintDevice: TdxPrintDevice; + FSize: TPoint; + function GetSize(Index: Integer): Integer; + procedure SetSize(Index: Integer; Value: Integer); + public + constructor Create(APrintDevice: TdxPrintDevice); + procedure Assign(Source: TdxPaperInfo); + function IsEqual(Source: TdxPaperInfo): Boolean; + + property DMPaper: Integer read FDMPaper; + property Height: Integer index 1 read GetSize write SetSize; + property Name: string read FName; + property Size: TPoint read FSize; + property Width: Integer index 0 read GetSize write SetSize; + end; + +function dxConnectToNetPrinter(AParentWnd: HWND): Boolean; +function dxDocumentProperties(AParentWnd: HWND): Boolean; +function dxInitPrintDevice(ARaiseException: Boolean): Boolean; +function dxIsAutoSelectBin(const AName: string): Boolean; +function dxIsEnvelopePaper(const AName: string): Boolean; +function dxIsPrintDeviceAllocated: Boolean; +function dxIsPrintDeviceInitialized: Boolean; +function dxPrintDevice: TdxPrintDevice; +procedure dxReleasePrintDevice; +function dxSetPrintDevice(APrintDevice: TdxPrintDevice): TdxPrintDevice; + +procedure dxDrawPrinter(ACanvas: TCanvas; ARect: TRect; const AText: string; + AImageList: TCustomImageList; AImageIndex: Integer); +procedure dxGetPrinterList(AStrings: TStrings); + +function dxGetDefaultDMPaper: Integer; +function dxGetDefaultPrinter: string; + +function dxIsDefaultPrinter(ADevice: PChar ): Boolean; +procedure dxSetDefaultPrinter(ADevice: PChar ); + +type + TConnectToPrinterDlg = function(hWnd: HWND; Flags: DWORD): THandle; stdcall; + TGetDefaultPrinter = function(pszBuffer: PChar; var cchBuffer: DWORD): BOOL; stdcall; + TGetDefaultPrinterA = function(pszBuffer: PAnsiChar; var cchBuffer: DWORD): BOOL; stdcall; + TGetDefaultPrinterW = function(pszBuffer: PWideChar; var cchBuffer: DWORD): BOOL; stdcall; + TSetDefaultPrinter = function(pszPrinter: PChar): BOOL; stdcall; + TSetDefaultPrinterA = function(pszPrinter: PAnsiChar): BOOL; stdcall; + TSetDefaultPrinterW = function(pszPrinter: PWideChar): BOOL; stdcall; + +var + dxPSUseCachedDMPaper: Boolean = True; + +const + cMinPaperExtent = 254; + cMaxPaperExtent = 30 * cMinPaperExtent; + + {$EXTERNALSYM LOCALE_IPAPERSIZE} + LOCALE_IPAPERSIZE = $0000100A; + +implementation + +uses + Forms, WinSpool, cxClasses, dxPSUtl, dxPSRes; + + +const + dxDefaultMaxPaperExtents = 5000; + dxDefaultMinPaperExtents = 500; + + DuplexModeMap: array[DMDUP_SIMPLEX..DMDUP_HORIZONTAL] of TdxDuplexMode = (dmSimplex, dmHorizontal, dmVertical); + OrientationMap: array[DMORIENT_PORTRAIT..DMORIENT_LANDSCAPE] of TdxPrinterOrientation = (poPortrait, poLandscape); + PrinterOrientationMap: array[TdxPrinterOrientation] of Integer = (DMORIENT_PORTRAIT, DMORIENT_LANDSCAPE); + +var + FPrintDevice: TdxPrintDevice = nil; + FConnectToPrinterDlg: TConnectToPrinterDlg = nil; + FGetDefaultPrinter: TGetDefaultPrinter = nil; + FSetDefaultPrinter: TSetDefaultPrinter = nil; + + +function DocumentProperties(hWnd: HWND; hPrinter: THandle; pDeviceName: PChar; + pDevModeOutput, pDevModeInput: PDeviceMode; fMode: DWORD): Longint; + overload; stdcall; external winspl name 'DocumentPropertiesA'; +function DocumentPropertiesA(hWnd: HWND; hPrinter: THandle; pDeviceName: PAnsiChar; + pDevModeOutput, pDevModeInput: PDeviceModeA; fMode: DWORD): Longint; + overload; stdcall; external winspl name 'DocumentPropertiesA'; +function DocumentProperties(hWnd: HWND; hPrinter: THandle; pDeviceName: PWideChar; + pDevModeOutput, pDevModeInput: PDeviceModeW; fMode: DWORD): Longint; + overload; stdcall; external winspl name 'DocumentPropertiesW'; + + +function IsConnectToPrinterDlgInitialized: Boolean; +begin + Result := @FConnectToPrinterDlg <> nil; +end; + +function IsGetDefaultPrinterInitialized: Boolean; +begin + Result := @FGetDefaultPrinter <> nil; +end; + +function IsSetDefaultPrinterInitialized: Boolean; +begin + Result := @FSetDefaultPrinter <> nil; +end; + +{ Memory Management Routines } + +function dxAllocMem(ASize: Integer): Pointer; +begin + Result := AllocMem(ASize); +end; + +procedure dxFreeMem(var P: Pointer; ASize: Integer); +begin + FreeMem(P, ASize); + P := nil; +end; + +{.$DEFINE DEBUG_PRINTDEVICE} + +{$IFDEF DEBUG_PRINTDEVICE} +var + LogFile: TextFile; + +procedure RewriteLog; +begin + Rewrite(LogFile); +end; + +procedure WriteLog(const S: string); +begin + WriteLn(LogFile, S); +end; + +{$ENDIF} + +function FetchStr(var Str: PChar): PChar; +var + P: PChar; +begin + Result := Str; + if Str = nil then Exit; + P := Str; + while P^ = ' ' do + Inc(P); + Result := P; + while (P^ <> #0) and (P^ <> ',') do + P := StrNextChar(P); + if P^ = ',' then + begin + P^ := #0; + Inc(P); + end; + Str := P; +end; + +procedure RaiseError(const Msg: string); +begin + raise EdxPrintDevice.Create(Msg); +end; + +function AbortProc(Prn: HDC; Error: Integer): Bool; stdcall; +begin +{$IFDEF DEBUG_PRINTDEVICE} + WriteLog('AbortProc'); +{$ENDIF} +// Application.ProcessMessages; + Result := not FPrintDevice.Aborted; +end; + +function dxIsPrintDeviceAllocated: Boolean; +begin + Result := FPrintDevice <> nil; +end; + +function dxIsPrintDeviceInitialized: Boolean; +begin + Result := dxIsPrintDeviceAllocated and dxPrintDevice.IsInitialized; +end; + +function dxPrintDevice: TdxPrintDevice; +begin + if FPrintDevice = nil then FPrintDevice := TdxPrintDevice.Create; + Result := FPrintDevice; +end; + +function dxConnectToNetPrinter(AParentWnd: HWND): Boolean; +var + Handle: THandle; +begin + if IsConnectToPrinterDlgInitialized then + begin + Handle := FConnectToPrinterDlg(AParentWnd, 0); + Result := Handle <> 0; + if Result then + begin + ClosePrinter(Handle); + dxPrintDevice.Refresh; + end; + end + else + Result := False; +end; + +{.$WARN SYMBOL_DEPRECATED OFF} + +function dxDocumentProperties(AParentWnd: HWND): Boolean; +var + HNewDevMode: THandle; + PNewDevMode: PDevMode ; +begin + Result := False; + HNewDevMode := 0; + try + HNewDevMode := CopyDeviceMode(dxPrintDevice.HDeviceMode); + if HNewDevMode <> 0 then + try + PNewDevMode := GlobalLock(HNewDevMode); + try + with dxPrintDevice do + Result := IDOK = DocumentProperties(AParentWnd, FDeviceHandle, CurrentDevice, + PNewDevMode, DeviceMode, DM_IN_PROMPT or DM_OUT_BUFFER or DM_IN_BUFFER); + finally + GlobalUnlock(HNewDevMode); + end; + finally + if Result then + with dxPrintDevice do + begin + while GlobalUnlock(FHDeviceMode) do; + GlobalFree(FHDeviceMode); + FHDeviceMode := HNewDevMode; + FDeviceMode := GlobalLock(FHDeviceMode); + end + else + if HNewDevMode <> 0 then GlobalFree(HNewDevMode); + end; + except + if HNewDevMode <> 0 then GlobalFree(HNewDevMode); + end; +end; + +{.$WARN SYMBOL_DEPRECATED ON} + +{$HINTS OFF} + +function dxInitPrintDevice(ARaiseException: Boolean): Boolean; +var + Stub: HDC; +begin + Result := True; + try + Result := dxPrintDevice.Printers.Count > 0; + if Result then Stub := dxPrintDevice.Handle; + except + Result := False; + if ARaiseException then raise; + end; +end; + +{$HINTS ON} + +procedure dxReleasePrintDevice; +begin + dxSetPrintDevice(nil).Free; +end; + +function dxSetPrintDevice(APrintDevice: TdxPrintDevice): TdxPrintDevice; +begin + Result := FPrintDevice; + FPrintDevice := APrintDevice; +end; + +function dxIsAutoSelectBin(const AName: string): Boolean; +begin + Result := Pos(UpperCase(cxGetResourceString(@sdxAuto)), UpperCase(AName)) > 0; +end; + +function dxIsEnvelopePaper(const AName: string): Boolean; +begin + Result := Pos(UpperCase(cxGetResourceString(@sdxEnv)), UpperCase(AName)) > 0; +end; + +function dxGetDefaultDMPaper: Integer; +const + CachedDMPaper: Integer = -1; +var + Device: string; + HPrinter: THandle; + dwNeeded: DWORD; + PI9: PPrinterInfo9; +begin + if not dxPSUseCachedDMPaper or (CachedDMPaper = -1) then + begin + Result := Windows.DMPAPER_FIRST; + if IsWin2KOrXP then + begin + Device := dxGetDefaultPrinter; + if (Device <> '') and OpenPrinter(PChar(Device), HPrinter, nil) and (HPrinter <> 0) then + try + dwNeeded := 0; {3.03} + if GetPrinter(HPrinter, 9, nil, 0, @dwNeeded) or (dwNeeded <> 0) then + begin + PI9 := GlobalAllocPtr(GPTR, dwNeeded); + if PI9 <> nil then + try + if GetPrinter(HPrinter, 9, PI9, dwNeeded, @dwNeeded) then + if PI9^.DevMode <> nil then + try + Result := PI9^.DevMode^.dmPaperSize; + finally + //GlobalFreePtr(PI9^.DevMode); //TODO: check necessity + end; + finally + GlobalFreePtr(PI9); + end; + end; + finally + ClosePrinter(HPrinter); + end + else + case GetLocaleChar(LOCALE_USER_DEFAULT, LOCALE_IPAPERSIZE, '0') of + '1': Result := Windows.DMPAPER_LETTER; + '5': Result := Windows.DMPAPER_LEGAL; + '8': Result := Windows.DMPAPER_A3; + '9': Result := Windows.DMPAPER_A4; + end; + end; + CachedDMPaper := Result; + end + else + Result := CachedDMPaper; +end; + +function dxGetDefaultPrinter: string; +const + MAX_BUFFER_SIZE = 1024; +var + L: DWORD; + Buffer: array[0..MAX_BUFFER_SIZE] of Char; + C: PChar; +begin + Result := ''; + L := MAX_BUFFER_SIZE; + FillChar(Buffer, SizeOf(Buffer), 0); + if false and IsGetDefaultPrinterInitialized and FGetDefaultPrinter(@Buffer, L) and + (GetLastError = ERROR_SUCCESS) then + Result := Buffer + else + if GetProfileString('WINDOWS', 'DEVICE', '', Buffer, L) > 0 then + begin + C := @Buffer[0]; + Result := FetchStr(C); + end; +end; + +function dxIsDefaultPrinter(ADevice: PChar ): Boolean; +begin + Result := StrIComp(PChar(dxGetDefaultPrinter), ADevice) = 0; +end; + +procedure dxSetDefaultPrinter(ADevice: PChar ); +var + dwNeeded: DWORD; + HPrinter: THandle; + PI2: PPrinterInfo2; + S: string; +begin + if IsSetDefaultPrinterInitialized then // Win2KOrXP + FSetDefaultPrinter(ADevice) + else + if OpenPrinter(ADevice, HPrinter, nil) and (HPrinter <> 0) then + try + dwNeeded := 0; {3.03} + if GetPrinter(HPrinter, 2, nil, 0, @dwNeeded) or (dwNeeded <> 0) then + begin + PI2 := GlobalAllocPtr(GPTR, dwNeeded); + if PI2 <> nil then + try + if GetPrinter(HPrinter, 2, PI2, dwNeeded, @dwNeeded) then + if IsWin95Or98 then // Win9x + begin + PI2^.Attributes := PI2^.Attributes or PRINTER_ATTRIBUTE_DEFAULT; + SetPrinter(HPrinter, 2, PI2, 0); + SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, LPARAM(PChar('windows')), SMTO_NORMAL, 1000, dwNeeded); + end + else // WinNT or earlier + if (PI2^.pDriverName <> nil) and (PI2^.pPortName <> nil) then + begin + S := PI2^.pPrinterName + ',' + PI2^.pDriverName + ',' + PI2^.pDriverName; + if WriteProfileString('windows', 'device', PChar(S)) then + begin + dwNeeded := Length(S); + SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0, SMTO_NORMAL, 1000, dwNeeded); + end; + end; + finally + GlobalFreePtr(PI2); + end; + end; + finally + ClosePrinter(hPrinter); + end; +end; + +procedure dxDrawPrinter(ACanvas: TCanvas; ARect: TRect; const AText: string; + AImageList: TCustomImageList; AImageIndex: Integer); +var + Offset: Integer; +begin + with ACanvas, ARect do + begin + FillRect(ARect); + // Image + InflateRect(ARect, -1, -1); + Offset := (Bottom - Top - AImageList.Height) div 2; + Inc(Left, Offset); + Inc(Top, Offset); + AImageList.Draw(ACanvas, Left, Top, AImageIndex); + // Text + Inc(Offset); + Inc(Left, Offset + AImageList.Width + Offset); + Brush.Style := bsClear; + TextRect(ARect, Left + Offset, Top + Offset, AText); + Brush.Style := bsSolid; + end; +end; + +procedure dxGetPrinterList(AStrings: TStrings); +begin + with AStrings do + begin + BeginUpdate; + try + Clear; + if dxPrintDevice.Printers <> nil then + Assign(dxPrintDevice.Printers); + finally + EndUpdate; + end; + end; +end; + +{ TdxPrintDeviceInfo } + +constructor TdxPrintDeviceInfo.Create(ADriver, ADevice, APort: PChar ; + AnIsDefault, AnIsNetwork: Boolean); +begin + inherited Create; + FDriver := StrNew(ADriver); + FDevice := StrNew(ADevice); + FPort := StrNew(APort); + FIsDefault := AnIsDefault; + FIsNetwork := AnIsNetwork; +end; + +destructor TdxPrintDeviceInfo.Destroy; +begin + StrDispose(FPort); + StrDispose(FDevice); + StrDispose(FDriver); + inherited; +end; + +function TdxPrintDeviceInfo.IsEqual(ADriver, ADevice, APort: PChar ): Boolean; +begin + Result := (StrIComp(Device, ADevice) = 0) and ((Port = nil) or (APort = nil) or (StrIComp(Port, APort) = 0)); +end; + +{ TdxPrintDeviceCanvas } + +type + TdxPrintDeviceCanvas = class(TCanvas) + private + FPrintDevice: TdxPrintDevice; + protected + procedure CreateHandle; override; + procedure Changing; override; + procedure UpdateFont; + public + constructor Create(APrintDevice: TdxPrintDevice); + end; + +constructor TdxPrintDeviceCanvas.Create(APrintDevice: TdxPrintDevice); +begin + inherited Create; + FPrintDevice := APrintDevice; +end; + +procedure TdxPrintDeviceCanvas.CreateHandle; +begin + FPrintDevice.SetState(psHandleIC); + UpdateFont; + Handle := FPrintDevice.FDC; +end; + +procedure TdxPrintDeviceCanvas.Changing; +begin + FPrintDevice.CheckPrinting(True); + inherited Changing; + UpdateFont; +end; + +procedure TdxPrintDeviceCanvas.UpdateFont; +var + FontSize: Integer; +begin + if GetDeviceCaps(FPrintDevice.FDC, LOGPIXELSY) <> Font.PixelsPerInch then + begin + FontSize := Font.Size; + Font.PixelsPerInch := GetDeviceCaps(FPrintDevice.FDC, LOGPIXELSY); + Font.Size := FontSize; + end; +end; + +{ TdxPaperInfo } + +constructor TdxPaperInfo.Create(APrintDevice: TdxPrintDevice); +begin + inherited Create; + FPrintDevice := APrintDevice; +end; + +function TdxPaperInfo.IsEqual(Source: TdxPaperInfo): Boolean; +begin + Result := (DMPaper = Source.DMPaper) and (FName = Source.Name) and + dxPSUtl.ArePointsEqual(Size, Source.Size); +end; + +procedure TdxPaperInfo.Assign(Source: TdxPaperInfo); +begin + FDMPaper := Source.FDMPaper; + FName := Source.FName; + FSize := Source.FSize; +end; + +function TdxPaperInfo.GetSize(Index: Integer): Integer; +begin + with Size do + if Index = 0 then + Result := X + else + Result := Y; +end; + +procedure TdxPaperInfo.SetSize(Index: Integer; Value: Integer); +begin + if DMPaper < DMPAPER_USER then Exit; + if Index = 0 then + begin + FSize.X := Value; + if (FPrintDevice <> nil) and (FPrintDevice.FDeviceMode <> nil) then + FPrintDevice.DeviceMode^.dmPaperWidth := FSize.X; + end + else + begin + FSize.Y := Value; + if (FPrintDevice <> nil) and (FPrintDevice.FDeviceMode <> nil) then + FPrintDevice.DeviceMode^.dmPaperLength := FSize.Y; + end; +end; + +{ TdxPrintDevice } + +constructor TdxPrintDevice.Create; +begin + inherited Create; + FAutoRefresh := {True; //}False; + FIsDeviceModePersistent := True; + FPrinterIndex := -MaxInt; + FWindowHandle := dxPSUtl.dxAllocateHWnd(WndProc); +end; + +destructor TdxPrintDevice.Destroy; +begin + if Printing then EndDoc; + DeselectHandles; + SetState(psNoHandle); + dxPSUtl.dxDeallocatehWnd(FWindowHandle); + FWindowHandle := 0; + ClosePrintDevice; + + FreeAndNilPrinters; + inherited; +end; + +procedure TdxPrintDevice.Abort; +begin + CheckPrinting(True); + AbortDoc(Canvas.Handle); + FAborted := True; + EndDoc; +end; + +function TdxPrintDevice.BeginDoc: Integer; +var + DocInfo: TDocInfo; +begin + Application.ProcessMessages; + {$IFDEF DEBUG_PRINTDEVICE} + RewriteLog; + WriteLog('BeginDoc'); + {$ENDIF} + CheckPrinting(False); + SetState(psNoHandle); + SetState(psHandleDC); + Canvas.Refresh; + TdxPrintDeviceCanvas(Canvas).UpdateFont; + FPrinting := True; + FAborted := False; + FPageNumber := 1; + + FillChar(DocInfo, SizeOf(DocInfo), 0); + with DocInfo do + begin + cbSize := SizeOf(DocInfo); + lpszDocName := PChar(Title); + if FileName <> '' then lpszOutput := PChar(FileName); + end; + SetAbortProc(FDC, AbortProc); + + Result := StartDoc(FDC, DocInfo); + if Result > 0 then + StartPage(FDC) + else + begin + FPrinting := False; + FAborted := False; + SetState(psNoHandle); + FPageNumber := 0; + end; +end; + +procedure TdxPrintDevice.EndDoc; +begin +{$IFDEF DEBUG_PRINTDEVICE} + WriteLog('EndDoc'); +{$ENDIF} + CheckPrinting(True); + EndPage(FDC); + if not Aborted then Windows.EndDoc(FDC); + FPrinting := False; + FAborted := False; + SetState(psNoHandle); + FPageNumber := 0; +end; + +procedure TdxPrintDevice.NewPage; +begin +{$IFDEF DEBUG_PRINTDEVICE} + WriteLog('NewPage'); +{$ENDIF} + CheckPrinting(True); + EndPage(FDC); + Inc(FPageNumber); + Application.ProcessMessages; + DoNewPage; + ResetDC(False); + StartPage(FDC); + Canvas.Refresh; +end; + +function TdxPrintDevice.FindPrintDevice(ADevice, APort: PChar ): Integer; +begin + for Result := 0 to Printers.Count - 1 do + if PrinterInfos[Result].IsEqual(nil, ADevice, APort) then Exit; + Result := -1; +end; + +function TdxPrintDevice.IsDeviceModeChanged: Boolean; +begin + Result := FDeviceModeChanged; +end; + +procedure TdxPrintDevice.Refresh; +var + ADevice, APort: PChar ; + APrinterIndex: Integer; + AHDeviceMode: THandle; +begin + ADevice := StrNew(FCurrentDevice); + try + APort := StrNew(FCurrentPort); + try + AHDeviceMode := 0; + if FHDeviceMode <> 0 then AHDeviceMode := CopyDeviceMode(FHDeviceMode); + try + ClosePrintDevice; + FreeAndNilPrinters; + GetPrinters; + if AHDeviceMode <> 0 then + begin + APrinterIndex := FindPrintDevice(ADevice, APort); + if APrinterIndex <> -1 then + begin + OpenPrintDevice(APrinterIndex); + if FHDeviceMode <> 0 then + begin + while GlobalUnLock(FHDeviceMode) do; + GlobalFree(FHDeviceMode); + FDeviceMode := nil; + FHDeviceMode := CopyDeviceMode(AHDeviceMode); + FDeviceMode := GlobalLock(FHDeviceMode); + end; + end + else + if Printers.Count > 0 then GetPrinterIndex; + end; + finally + if AHDeviceMode <> 0 then GlobalFree(AHDeviceMode); + end; + finally + StrDispose(APort); + end; + finally + StrDispose(ADevice); + end; + DoRefresh; +end; + +procedure TdxPrintDevice.ResetDC(IsForced: Boolean); +var + ACanvas: TCanvas; + ABrushBitmap: TBitmap; + + procedure SaveCanvas; + begin + ACanvas := TdxPrintDeviceCanvas.Create(Self); + with ACanvas do + begin + OnChanging := Canvas.OnChanging; + OnChange := Canvas.OnChange; + Canvas.OnChanging := nil; + Canvas.OnChange := nil; + + Brush := Canvas.Brush; + ABrushBitmap := nil; + if Brush.Bitmap <> nil then ABrushBitmap := Brush.Bitmap; + Font := Canvas.Font; + Pen := Canvas.Pen; + PenPos := Canvas.PenPos; + CopyMode := Canvas.CopyMode; + end; + end; + + procedure RestoreCanvas; + begin + with Canvas do + begin + Brush := ACanvas.Brush; + if ABrushBitmap <> nil then Brush.Bitmap := ABrushBitmap; + Font := ACanvas.Font; + Pen := ACanvas.Pen; + PenPos := ACanvas.PenPos; + CopyMode := ACanvas.CopyMode; + OnChanging := ACanvas.OnChanging; + OnChange := ACanvas.OnChange; + end; + ACanvas.Free; + end; + +begin + if IsDeviceModeChanged or IsForced then + begin + FDeviceModeChanged := False; + SaveCanvas; + try + if FDeviceMode <> nil then + Windows.ResetDC(FDC, FDeviceMode^); + finally + RestoreCanvas; + end; + end; +end; + +procedure TdxPrintDevice.ResetPrintDevice; +var + Index: Integer; +begin + Index := PrinterIndex; + ClosePrintDevice; + OpenPrintDevice(Index); +end; + +function TdxPrintDevice.FindBin(ABin: Integer): Integer; +begin + if Bins <> nil then + Result := Bins.IndexOfObject(TObject(ABin)) + else + Result := -1; +end; + +function TdxPrintDevice.FindBin(const AName: string): Integer; +begin + if Bins <> nil then + Result := Bins.IndexOf(AName) + else + Result := -1; +end; + +function TdxPrintDevice.IsAutoSelectBin(AIndex: Integer): Boolean; +begin + Result := (Bins <> nil) and (AIndex > -1) and (AIndex < Bins.Count) and + dxIsAutoSelectBin(Bins[AIndex]); +end; + +function TdxPrintDevice.IsUserPaperSource(AIndex: Integer): Boolean; +begin + Result := (Bins <> nil) and (AIndex > -1) and (AIndex < Bins.Count) and + (Integer(Papers.Objects[AIndex]) >= DMBIN_USER); +end; + +function TdxPrintDevice.SelectBin(Value: Integer): Boolean; +var + Index: Integer; +begin + Index := FindBin(Value); + Result := Index > -1; + if Result then BinIndex := Index; +end; + +function TdxPrintDevice.SelectBin(const AName: string): Boolean; +var + Index: Integer; +begin + Index := FindBin(AName); + Result := Index > -1; + if Result then BinIndex := Index; +end; + +function TdxPrintDevice.FindPaper(ADMPaper: Integer): Integer; +begin + if Papers <> nil then + for Result := 0 to Papers.Count - 1 do + if TdxPaperInfo(Papers.Objects[Result]).DMPaper = ADMPaper then + Exit; + Result := -1; +end; + +function TdxPrintDevice.FindPaper(const AName: string): Integer; +begin + if Papers <> nil then + Result := Papers.IndexOf(AName) + else + Result := -1; +end; + +function TdxPrintDevice.FindPaper(const ASize: TPoint): Integer; +begin + if Papers <> nil then + begin + for Result := 0 to Papers.Count - 1 do + if dxPSUtl.ArePointsEqual(TdxPaperInfo(Papers.Objects[Result]).Size, ASize) then + Exit; + Result := Papers.Count - 1; + end + else + Result := -1; +end; + +function TdxPrintDevice.FindPaper(AWidth, AHeight: Integer): Integer; +begin + Result := FindPaper(MakePoint(AWidth, AHeight)); +end; + +function TdxPrintDevice.IsEnvelopePaper(AIndex: Integer): Boolean; +begin + Result := (Papers <> nil) and (AIndex > -1) and (AIndex < Papers.Count) and + dxIsEnvelopePaper(Papers[AIndex]); +end; + +function TdxPrintDevice.IsUserPaperSize(AIndex: Integer): Boolean; +var + PaperInfo: TdxPaperInfo; +begin + Result := (Papers <> nil) and (AIndex > -1) and (AIndex < Papers.Count); + if Result then + begin + PaperInfo := TdxPaperInfo(Papers.Objects[AIndex]); + Result := (PaperInfo.DMPaper >= DMPAPER_USER) or + (Pos(cxGetResourceString(@sdxCustom), PaperInfo.Name) > 0); + end; +end; + +function TdxPrintDevice.SelectPaper(ADMPaper: Integer): Boolean; +var + Index: Integer; +begin + Index := FindPaper(ADMPaper); + Result := Index > -1; + if Result then PaperIndex := Index; +end; + +function TdxPrintDevice.SelectPaper(const AName: string): Boolean; +var + Index: Integer; +begin + Index := FindPaper(AName); + Result := Index > -1; + if Result then PaperIndex := Index; +end; + +function TdxPrintDevice.SelectPaper(var AWidth, AHeight: Integer): Boolean; +var + Index: Integer; +begin + Index := FindPaper(AWidth, AHeight); + Result := Index > -1; + if Result then + begin + PaperIndex := Index; // setting FDeviceModeChanged := True; + if FDeviceMode <> nil then + if PaperIndex <> Papers.Count - 1 then + begin + DeviceMode^.dmPaperWidth := 0; + DeviceMode^.dmPaperLength := 0; + end + else + InternalSelectPaperBySize(AWidth, AHeight) + end; +end; + +function TdxPrintDevice.IsSupportColoration: Boolean; +begin + Result := 1 = WinSpool.DeviceCapabilities(CurrentDevice, CurrentPort, DC_COLORDEVICE, nil, nil); +end; + +function TdxPrintDevice.IsSupportDuplex: Boolean; +begin + Result := 1 = WinSpool.DeviceCapabilities(CurrentDevice, CurrentPort, DC_DUPLEX, nil, nil); +end; + +procedure TdxPrintDevice.DoNewPage; +begin + if Assigned(FOnNewPage) then FOnNewPage(Self) +end; + +procedure TdxPrintDevice.DoPrinterChanged; +begin + if Assigned(FOnPrinterChange) then FOnPrinterChange(Self); +end; + +procedure TdxPrintDevice.DoRefresh; +begin + if Assigned(FOnRefresh) then FOnRefresh(Self); +end; + +function TdxPrintDevice.GetBinIndex: Integer; +begin + if FDeviceMode <> nil then + begin + Result := FindBin(FDeviceMode^.dmDefaultSource); + if (Result = -1) and (FBins <> nil) and (FBins.Count <> 0) then + Result := 0; + end + else + Result := 0; +end; + +function TdxPrintDevice.GetBins: TStrings; +const + BinSize = SizeOf(Word); + BinNameSize = 24; +type + TdxBin = Word; + TdxBins = array[0..0] of TdxBin; + PdxBins = ^TdxBins; + TdxBinName = array[0..BinNameSize - 1] of Char; + TdxBinNames = array[0..0] of TdxBinName; + PdxBinNames = ^TdxBinNames; +var + BinCount: Integer; + BinValues: PdxBins ; + BinNames: PdxBinNames ; + I: Integer; + BinName: string; +begin + if FBins = nil then + try + if Printers.Count > 0 then + begin + GetPrinterIndex; + if FDeviceMode = nil then + begin + Result := nil; + Exit; + end; + BinCount := DeviceCapabilities(CurrentDevice, CurrentPort, DC_BINS, nil, nil); + if BinCount > 0 then + begin + BinValues := AllocMem(BinSize * BinCount); + try + if DeviceCapabilities(CurrentDevice, CurrentPort, DC_BINS, PChar(BinValues), nil) <> -1 then + begin + BinNames := AllocMem(BinNameSize * BinCount); + try + if DeviceCapabilities(CurrentDevice, CurrentPort, DC_BINNAMES, PChar(BinNames), nil) <> -1 then + begin + FBins := TStringList.Create; + for I := 0 to BinCount - 1 do + begin + BinName := BinNames^[I]; + FBins.AddObject(BinName, TObject(BinValues^[I])); + end; + end; + finally + FreeMem(BinNames, BinNameSize * BinCount); + end; + end; + finally + FreeMem(BinValues, BinSize * BinCount); + end; + end; + end + else + begin + FBins := TStringList.Create; + FBins.AddObject(cxGetResourceString(@sdxDefaultTray), TObject(DMBIN_USER)); + end; + except + FreeAndNil(FBins); + raise; + end; + Result := FBins; +end; + +function TdxPrintDevice.GetCanvas: TCanvas; +begin + if FCanvas = nil then FCanvas := TdxPrintDeviceCanvas.Create(Self); + Result := FCanvas; +end; + +function TdxPrintDevice.GetCollate: Boolean; +const + CollationMap: array[DMCOLLATE_FALSE..DMCOLLATE_TRUE] of Boolean = (False, True); +begin + Result := False; + if Printers.Count > 0 then + begin + GetPrinterIndex; + if FDeviceMode <> nil then + Result := CollationMap[FDeviceMode^.dmCollate]; + end; +end; + +function TdxPrintDevice.GetColorMode: Boolean; +begin + Result := False; + if Printers.Count > 0 then + begin + GetPrinterIndex; + if FDeviceMode <> nil then + Result := FDeviceMode^.dmColor = DMCOLOR_COLOR; + end; +end; + +function TdxPrintDevice.GetCurrentDevice: PChar ; +begin + Result := nil; + if Printers.Count > 0 then + begin + GetPrinterIndex; + if FHDeviceMode <> 0 then + Result := FCurrentDevice; + end; +end; + +function TdxPrintDevice.GetCurrentDriver: PChar ; +begin + Result := nil; + if Printers.Count > 0 then + begin + GetPrinterIndex; + if FHDeviceMode <> 0 then + Result := FCurrentDriver; + end; +end; + +function TdxPrintDevice.GetCurrentPort: PChar ; +begin + Result := nil; + if Printers.Count > 0 then + begin + GetPrinterIndex; + if FHDeviceMode <> 0 then + Result := FCurrentPort; + end; +end; + +function TdxPrintDevice.GetDefaultDMPaper: Integer; +begin + if Printers.Count > 0 then + begin + GetPrinterIndex; + if FDeviceMode <> nil then + Result := DeviceMode^.dmPaperSize + else + Result := Windows.DMPAPER_FIRST; + end + else + Result := Windows.DMPAPER_FIRST; +end; + +function TdxPrintDevice.GetDeviceMode: PDeviceMode; +begin + if Printers.Count > 0 then + begin + GetPrinterIndex; + Result := FDeviceMode; + end + else + Result := nil; +end; + +function TdxPrintDevice.GetDuplex: TdxDuplexMode; +begin + Result := dmSimplex; + if Printers.Count > 0 then + begin + GetPrinterIndex; + if FDeviceMode <> nil then + Result := DuplexModeMap[DeviceMode^.dmDuplex]; + end; +end; + +function EnumFontsProc(var LogFont: TLogFont; var TextMetric: TTextMetric; + FontType: DWORD; Data: LPARAM): Integer; stdcall; +begin + TStrings(Data).Add(LogFont.lfFaceName); + Result := 1; +end; + +function TdxPrintDevice.GetFonts: TStrings; +begin + if FFonts = nil then + try + SetState(psHandleIC); + FFonts := TStringList.Create; + EnumFonts(FDC, nil, @EnumFontsProc, Pointer(FFonts)); + except + FreeAndNil(FFonts); + raise; + end; + Result := FFonts; +end; + +function TdxPrintDevice.GetHandle: HDC; +begin + SetState(psHandleIC); + Result := FDC; +end; + +function TdxPrintDevice.GetHDeviceMode: THandle; +begin + if Printers.Count > 0 then + begin + GetPrinterIndex; + Result := FHDeviceMode; + end + else + Result := 0; +end; + +function TdxPrintDevice.GetIsDefault: Boolean; +begin + if PrinterIndex <> -1 then + Result := PrinterInfos[PrinterIndex].IsDefault + else + Result := False; +end; + +function TdxPrintDevice.GetIsInitialized: Boolean; +begin + Result := FPrinters <> nil; +end; + +function TdxPrintDevice.GetIsNetwork: Boolean; +begin + if PrinterIndex <> -1 then + Result := PrinterInfos[PrinterIndex].IsNetwork + else + Result := False; +end; + +function TdxPrintDevice.GetMaxExtents(Index: Integer): Integer; +begin + if Printers.Count > 0 then + begin + GetPrinterIndex; + if Index = 0 then + Result := LOWORD(FMaxExtents) + else + Result := HIWORD(FMaxExtents); + end + else + Result := dxDefaultMaxPaperExtents; +end; + +function TdxPrintDevice.GetMinExtents(Index: Integer): Integer; +begin + if Printers.Count > 0 then + begin + GetPrinterIndex; + if Index = 0 then + Result := LOWORD(FMinExtents) + else + Result := HIWORD(FMinExtents); + end + else + Result := dxDefaultMinPaperExtents; +end; + +function TdxPrintDevice.GetNumCopies: Integer; +begin + Result := 0; + if Printers.Count > 0 then + begin + GetPrinterIndex; + if FDeviceMode <> nil then + Result := FDeviceMode^.dmCopies; + end; +end; + +function TdxPrintDevice.GetOrientation: TdxPrinterOrientation; +begin + Result := poPortrait; + if Printers.Count > 0 then + begin + GetPrinterIndex; + if FDeviceMode <> nil then + if FDeviceMode^.dmOrientation = DMORIENT_LANDSCAPE then + Result := poLandscape; + end; +end; + +function TdxPrintDevice.GetPageHeight: Integer; +begin + SetState(psHandleIC); + Result := GetDeviceCaps(FDC, VertRes); +end; + +function TdxPrintDevice.GetPageHeightLoMetric: Integer; +begin + SetState(psHandleIC); + Result := 10 * GetDeviceCaps(FDC, VertSize); +end; + +function TdxPrintDevice.GetPageWidth: Integer; +begin + SetState(psHandleIC); + Result := GetDeviceCaps(FDC, HorzRes); +end; + +function TdxPrintDevice.GetPageWidthLoMetric: Integer; +begin + SetState(psHandleIC); + Result := 10 * GetDeviceCaps(FDC, HorzSize); +end; + +function TdxPrintDevice.GetPaperCount: Integer; +begin + if FPapers <> nil then + Result := FPapers.Count + else + Result := 0; +end; + +function TdxPrintDevice.GetPaperIndex: Integer; +begin + if FDeviceMode <> nil then + begin + Result := FindPaper(FDeviceMode^.dmPaperSize); + if (Result = -1) and (FPapers <> nil) and (FPapers.Count > 0) then + Result := 0; + end + else + Result := 0; +end; + +function TdxPrintDevice.GetPapers: TStrings; +const + PaperNameSize = 64; + PaperValueSize = SizeOf(Word); + PaperSizeSize = SizeOf(TPoint); +type + TdxPaperSize = TPoint; + TdxPaperSizes = array[0..0] of TdxPaperSize; + PdxPaperSizes = ^TdxPaperSizes; + TdxPaperValue = Word; + TdxPaperValues = array[0..0] of TdxPaperValue; + PdxPaperValues = ^TdxPaperValues; + TdxPaperName = array[0..PaperNameSize - 1] of Char; + TdxPaperNames = array[0..0] of TdxPaperName; + PdxPaperNames = ^TdxPaperNames; +var + HasStandardPapers: Boolean; + PaperCount: Integer; + PaperNames: PdxPaperNames ; + PaperValues: PdxPaperValues ; + PaperSizes: PdxPaperSizes ; + I: Integer; + Paper: TdxPaperInfo; +begin + if FPapers = nil then + try + HasStandardPapers := False; + if Printers.Count > 0 then + begin + GetPrinterIndex; + if DeviceMode = nil then + begin + Result := nil; + Exit; + end; + PaperCount := DeviceCapabilities(CurrentDevice, CurrentPort, DC_PAPERNAMES, nil, nil); + if PaperCount > 0 then + begin + PaperNames := AllocMem(PaperNameSize * PaperCount); + try + if DeviceCapabilities(CurrentDevice, CurrentPort, DC_PAPERNAMES, PChar(PaperNames), nil) <> -1 then + begin + PaperValues := AllocMem(PaperValueSize * PaperCount); + try + if DeviceCapabilities(CurrentDevice, CurrentPort, DC_PAPERS, PChar(PaperValues), nil) <> -1 then + begin + PaperSizes := AllocMem(PaperSizeSize * PaperCount); + try + if DeviceCapabilities(CurrentDevice, CurrentPort, DC_PAPERSIZE, PChar(PaperSizes), nil) <> -1 then + begin + HasStandardPapers := True; + FPapers := TStringList.Create; + for I := 0 to PaperCount - 1 do + begin + Paper := TdxPaperInfo.Create(Self); + with Paper do + begin + FSize := PaperSizes^[I]; + FDMPaper := PaperValues^[I]; + FName := PaperNames^[I]; + end; + FPapers.AddObject(Paper.Name, Paper); + end; + if Pos(cxGetResourceString(@sdxCustom), FPapers[PaperCount - 1]) = 0 then + begin + Paper := TdxPaperInfo.Create(Self); + with Paper do + begin + FSize := TdxPaperInfo(FPapers.Objects[0]).Size; + FDMPaper := DMPAPER_USER; + FName := cxGetResourceString(@sdxCustomSize); + end; + FPapers.AddObject(Paper.Name, Paper); + end; + end; + finally + FreeMem(PaperSizes, PaperSizeSize * PaperCount); + end; + end; + finally + FreeMem(PaperValues, PaperValueSize * PaperCount); + end; + end; + finally + FreeMem(PaperNames, PaperNameSize * PaperCount); + end; + end; + end; + + if not HasStandardPapers then + begin + FPapers := TStringList.Create; + Paper := TdxPaperInfo.Create(Self); + with Paper do + begin + FSize := Point(2100, 2970); {A4} // TODO: use default locale paper + FDMPaper := DMPAPER_USER; + FName := cxGetResourceString(@sdxCustomSize); + end; + FPapers.AddObject(Paper.Name, Paper); + end; + except + FreeAndNil(FPapers); + raise; + end; + Result := FPapers; +end; + +function TdxPrintDevice.GetPhysOffset(Index: Integer): Integer; +const + PhysicalOffsets: array[0..1] of Integer = (PHYSICALOFFSETX, PHYSICALOFFSETY); +begin + if Printers.Count > 0 then + begin + GetPrinterIndex; + try + Result := GetDeviceCaps(Handle, PhysicalOffsets[Index]); + except + Result := 0; + end; + end + else + Result := 0; +end; + +function TdxPrintDevice.GetPrinterCount: Integer; +begin + if FPrinters <> nil then + Result := FPrinters.Count + else + Result := 0; +end; + +function TdxPrintDevice.GetPrinterIndex: Integer; +begin + if FPrinterIndex = -MaxInt then SetToDefaultPrintDevice; + Result := FPrinterIndex; +end; + +function TdxPrintDevice.GetPrinterInfo(Index: Integer): TdxPrintDeviceInfo; +begin + if (FPrinters <> nil) and (Index >= 0) and (Index < FPrinters.Count) then + Result := TdxPrintDeviceInfo(FPrinters.Objects[Index]) + else + Result := nil; +end; + +function TdxPrintDevice.GetPrinters: TStrings; + + function IsDefaultDevice(AnAttributes: DWORD): Boolean; + begin + Result := AnAttributes and PRINTER_ATTRIBUTE_DEFAULT = PRINTER_ATTRIBUTE_DEFAULT; + end; + + function IsNetworkDevice(AnAttributes: DWORD): Boolean; + begin + Result := AnAttributes and PRINTER_ATTRIBUTE_NETWORK = PRINTER_ATTRIBUTE_NETWORK; + end; + + + procedure GetAsPrinterInfo4(var AnOffset: Integer; ABuffer: PChar); + var + PrintDeviceInfo: TdxPrintDeviceInfo; + begin + Inc(ABuffer, AnOffset); + with PPrinterInfo4(ABuffer)^ do + begin + PrintDeviceInfo := TdxPrintDeviceInfo.Create('', pPrinterName, '', dxIsDefaultPrinter(pPrinterName), IsNetworkDevice(Attributes)); + FPrinters.AddObject(pPrinterName, PrintDeviceInfo); + end; + Inc(AnOffset, SizeOf(TPrinterInfo4)); + end; + + procedure GetAsPrinterInfo5(var AnOffset: Integer; ABuffer: PChar); + var + LineCur, PortName: PChar; + PrintDeviceTitle: string; + PrintDeviceInfo: TdxPrintDeviceInfo; + begin + Inc(ABuffer, AnOffset); + with PPrinterInfo5(ABuffer)^ do + begin + LineCur := pPortName; + PortName := FetchStr(LineCur); + while PortName^ <> #0 do + begin + PrintDeviceTitle := Format(cxGetResourceString(@sdxDeviceOnPort), [pPrinterName, PortName]); + PrintDeviceInfo := TdxPrintDeviceInfo.Create(nil, pPrinterName, PortName, dxIsDefaultPrinter(pPrinterName), IsNetworkDevice(Attributes)); + FPrinters.AddObject(PrintDeviceTitle, PrintDeviceInfo); + PortName := FetchStr(LineCur); + end; + end; + Inc(AnOffset, SizeOf(TPrinterInfo5)); + end; + +const + Levels: array[Boolean] of DWORD = (5, 4); + Flags: array[Boolean] of DWORD = (PRINTER_ENUM_LOCAL, PRINTER_ENUM_CONNECTIONS or PRINTER_ENUM_LOCAL); +var + Level, Flag, Count, NumInfo: DWORD; + Buffer: Pointer; + Offset, I: Integer; +begin + if FPrinters = nil then + begin + FPrinters := TStringList.Create; + try + Level := Levels[dxPSGlbl.IsWinNT]; + Flag := Flags[dxPSGlbl.IsWinNT]; + Count := 0; + EnumPrinters(Flag, nil, Level, nil, 0, Count, NumInfo); + if Count <> 0 then + begin + Buffer := dxAllocMem(Count); + try + if EnumPrinters(Flag, nil, Level, Buffer, Count, Count, NumInfo) then + begin + Offset := 0; + for I := 0 to NumInfo - 1 do + if Level = 4 then + GetAsPrinterInfo4(Offset, Buffer) + else + GetAsPrinterInfo5(Offset, Buffer); + end; + finally + dxFreeMem(Buffer, Count); + end; + end; + except + FreeAndNil(FPrinters); + raise; + end; + end; + Result := FPrinters; +end; + +procedure TdxPrintDevice.SetBinIndex(Value: Integer); +begin + if (FDeviceMode <> nil) and (Bins <> nil) and (Value > -1) and (Value < Bins.Count) then + begin + if FDeviceMode^.dmDefaultSource <> Value then + begin + FDeviceMode^.dmDefaultSource := Integer(Bins.Objects[Value]); + FDeviceMode^.dmFields := FDeviceMode^.dmFields or DM_DEFAULTSOURCE; + FDeviceModeChanged := True; + end; + end; +end; + +procedure TdxPrintDevice.SetCollate(Value: Boolean); +const + Collations: array[Boolean] of ShortInt = (DMCOLLATE_FALSE, DMCOLLATE_TRUE); +begin + //CheckPrinting(False); + if Printers.Count > 0 then + begin + GetPrinterIndex; + if FDeviceMode <> nil then + begin + FDeviceMode^.dmCollate := Collations[Value]; + FDeviceMode^.dmFields := FDeviceMode^.dmFields or DM_COLLATE; + FDeviceModeChanged := True; + end; + end; +end; + +procedure TdxPrintDevice.SetColorMode(Value: Boolean); +const + ColorModes: array[Boolean] of ShortInt = (DMCOLOR_MONOCHROME, DMCOLOR_COLOR); +begin + //CheckPrinting(False); + if Printers.Count > 0 then + begin + GetPrinterIndex; + if FDeviceMode <> nil then + begin + FDeviceMode^.dmColor := ColorModes[Value]; + FDeviceMode^.dmFields := FDeviceMode^.dmFields or DM_COLOR; + FDeviceModeChanged := True; + end; + end; +end; + +procedure TdxPrintDevice.SetDuplex(Value: TdxDuplexMode); +const + DuplexModeMap: array[TdxDuplexMode] of UINT = (DMDUP_SIMPLEX, DMDUP_VERTICAL, DMDUP_HORIZONTAL); +begin + //CheckPrinting(False); + if Printers.Count > 0 then + begin + GetPrinterIndex; + if (FDeviceMode <> nil) and IsSupportDuplex then + begin + FDeviceMode^.dmDuplex := DuplexModeMap[Value]; + FDeviceMode^.dmFields := FDeviceMode^.dmFields or DM_DUPLEX; + FDeviceModeChanged := True; + end; + end; +end; + +procedure TdxPrintDevice.SetIsDefault(Value: Boolean); +var + I: Integer; +begin + if (PrinterIndex <> -1) and (IsDefault <> Value) then + begin + for I := 0 to Printers.Count - 1 do + PrinterInfos[I].IsDefault := False; + dxSetDefaultPrinter(CurrentDevice); + end +end; + +procedure TdxPrintDevice.SetNumCopies(Value: Integer); +begin + CheckPrinting(False); + if Printers.Count > 0 then + begin + GetPrinterIndex; + if FDeviceMode <> nil then + begin + FDeviceMode^.dmCopies := Value; + FDeviceMode^.dmFields := FDeviceMode^.dmFields or DM_COPIES; + FDeviceModeChanged := True; + end; + end; +end; + +procedure TdxPrintDevice.SetOrientation(Value: TdxPrinterOrientation); +begin + //CheckPrinting(False); + if Printers.Count > 0 then + begin + GetPrinterIndex; + if FDeviceMode <> nil then + begin + FDeviceMode^.dmOrientation := PrinterOrientationMap[Value]; + FDeviceMode^.dmFields := FDeviceMode^.dmFields or DM_ORIENTATION; + FDeviceModeChanged := True; + end; + end; +end; + +procedure TdxPrintDevice.SetPaperIndex(Value: Integer); +begin + if (FDeviceMode <> nil) and (Papers <> nil) and (Value > -1) and (Value < Papers.Count) then + begin + FDeviceMode^.dmPaperSize := TdxPaperInfo(Papers.Objects[Value]).DMPaper; + FDeviceMode^.dmFields := FDeviceMode^.dmFields or DM_PAPERSIZE; + if Value = Papers.Count - 1 then + FDeviceMode^.dmFields := FDeviceMode^.dmFields or DM_PAPERWIDTH or DM_PAPERLENGTH; + FDeviceModeChanged := True; + end; +end; + +procedure TdxPrintDevice.SetPrinterCapabilities(Value: Integer); +begin + FCapabilities := []; + if Value and DM_ORIENTATION <> 0 then Include(FCapabilities, pcOrientation); + if Value and DM_COPIES <> 0 then Include(FCapabilities, pcCopies); + if Value and DM_COLLATE <> 0 then Include(FCapabilities, pcCollation); +// if Value and DM_DUPLEX <> 0 then Include(FCapabilities, pcDuplex); +// if Value and DM_COLLATE <> 0 then Include(FCapabilities, pcColor); +end; + +procedure TdxPrintDevice.SetPrinterIndex(Value: Integer); +begin + CheckPrinting(False); + if (Value < -1) or (Value >= Printers.Count) then + RaiseError(cxGetResourceString(@sdxPrinterIndexError)) + else + if Value = -1 then + begin + FPrinterIndex := -MaxInt; + GetPrinterIndex; + end + else + OpenPrintDevice(Value); + SetState(psNoHandle); +end; + +procedure TdxPrintDevice.CheckPrinting(Value: Boolean); +begin + if Printing <> Value then + if Value then + RaiseError(cxGetResourceString(@sdxNotPrinting)) + else + RaiseError(cxGetResourceString(@sdxPrinting)); +end; + +procedure TdxPrintDevice.ClosePrintDevice; +begin + StrDispose(FCurrentDevice); + FCurrentDevice := nil; + StrDispose(FCurrentDriver); + FCurrentDriver := nil; + StrDispose(FCurrentPort); + FCurrentPort := nil; + + FreeAndNilBins; + FreeAndNilFonts; + FreeAndNilPapers; + + if FHDeviceMode <> 0 then + begin + while GlobalUnlock(FHDeviceMode) do; + GlobalFree(FHDeviceMode); + //Marshal.DestroyStructure(DeviceMode, TypeOf(TDeviceMode)); + FHDeviceMode := 0; + FDeviceMode := nil; + end; + + if FDeviceHandle <> 0 then + begin + ClosePrinter(FDeviceHandle); + FDeviceHandle := 0; + end; + + SetState(psNoHandle); + FreeAndNilCanvas; + + FPrinterIndex := -MaxInt; +end; + +procedure TdxPrintDevice.DeselectHandles; +begin + if FDC <> 0 then + begin + SelectObject(FDC, GetStockObject(BLACK_PEN)); + SelectObject(FDC, GetStockObject(HOLLOW_BRUSH)); + SelectObject(FDC, GetStockObject(SYSTEM_FONT)); + end; +end; + +procedure TdxPrintDevice.FixMinMaxExtents; +var + I: Integer; + MaxSize, MinSize, PaperSize: TPoint; +begin + if (FMaxExtents = -1) or (FMaxExtents = 0) then + FMaxExtents := SetLoHiWords(FMaxExtents, cMaxPaperExtent, cMaxPaperExtent); + if (FMinExtents = -1) or (FMinExtents = 0) then + FMinExtents := SetLoHiWords(FMinExtents, cMinPaperExtent, cMinPaperExtent); + + if Papers <> nil then + begin + MaxSize := Point(LoWord(FMaxExtents), HiWord(FMaxExtents)); + MinSize := Point(LoWord(FMinExtents), HiWord(FMinExtents)); + + for I := 0 to Papers.Count - 1 do + begin + PaperSize := TdxPaperInfo(Papers.Objects[I]).Size; + if PaperSize.X < MinSize.X then MinSize.X := PaperSize.X; + if PaperSize.X > MaxSize.X then MaxSize.X := PaperSize.X; + if PaperSize.Y < MinSize.Y then MinSize.Y := PaperSize.Y; + if PaperSize.Y > MaxSize.Y then MaxSize.Y := PaperSize.Y; + end; + + if MinSize.X <> LoWord(FMinExtents) then + FMinExtents := SetLoWord(FMinExtents, MinSize.X); + if MinSize.Y <> HiWord(FMinExtents) then + FMinExtents := SetHiWord(FMinExtents, MinSize.Y); + if MaxSize.X <> LoWord(FMaxExtents) then + FMaxExtents := SetLoWord(FMaxExtents, MaxSize.X); + if MaxSize.Y <> HiWord(FMaxExtents) then + FMaxExtents := SetHiWord(FMaxExtents, MaxSize.Y); + end; + + if LoWord(FMinExtents) < 500 then + FMinExtents := SetLoWord(FMinExtents, 500); + if HiWord(FMinExtents) < 500 then + FMinExtents := SetHiWord(FMinExtents, 500); + if LoWord(FMaxExtents) < LoWord(FMinExtents) then + FMaxExtents := SetLoWord(FMaxExtents, LoWord(FMinExtents)); + if HiWord(FMaxExtents) < HiWord(FMinExtents) then + FMaxExtents := SetHiWord(FMaxExtents, HiWord(FMinExtents)); +end; + +procedure TdxPrintDevice.FreeAndNilBins; +begin + FreeAndNil(FBins); +end; + +procedure TdxPrintDevice.FreeAndNilFonts; +begin + FreeAndNil(FFonts); +end; + +procedure TdxPrintDevice.FreeAndNilCanvas; +begin + FreeAndNil(FCanvas); +end; + +procedure TdxPrintDevice.FreeAndNilPapers; +var + I: Integer; +begin + for I := 0 to PaperCount - 1 do + FPapers.Objects[I].Free; + FreeAndNil(FPapers); +end; + +procedure TdxPrintDevice.FreeAndNilPrinters; +var + I: Integer; +begin + for I := 0 to PrinterCount - 1 do + PrinterInfos[I].Free; + FreeAndNil(FPrinters); +end; + +procedure TdxPrintDevice.InternalSelectPaperBySize(var AWidth, AHeight: Integer); +var + DeviceMode: TDeviceMode; +begin + if AWidth > MaxExtentX then AWidth := MaxExtentX; + if AWidth < MinExtentX then AWidth := MinExtentX; + if AHeight > MaxExtentY then AHeight := MaxExtentY; + if AHeight < MinExtentY then AHeight := MinExtentY; + + if FDeviceMode <> nil then + begin + DeviceMode := FDeviceMode^; + if DeviceMode.dmPaperWidth <> AWidth then + TdxPaperInfo(Papers.Objects[Papers.Count - 1]).Width := AWidth; + if DeviceMode.dmPaperLength <> AHeight then + TdxPaperInfo(Papers.Objects[Papers.Count - 1]).Height := AHeight; + end; +end; + +procedure TdxPrintDevice.OpenPrintDevice(AIndex: Integer); +const + dmFields: UINT = DM_ORIENTATION or DM_PAPERSIZE or DM_PAPERLENGTH or + DM_PAPERWIDTH or DM_SCALE or DM_COPIES or DM_DEFAULTSOURCE or DM_PRINTQUALITY or + DM_COLOR or DM_DUPLEX or DM_YRESOLUTION or DM_TTOPTION or DM_COLLATE or + DM_FORMNAME or DM_LOGPIXELS or DM_BITSPERPEL or DM_PELSWIDTH or DM_PELSHEIGHT; +var + DeviceMode: TDeviceMode; + MemSize: Integer; + SaveHDeviceMode: THandle; + SavePaperWidth, SavePaperHeight: Integer; + + procedure RestoreDeviceMode(ASaveHDeviceMode: THandle); + var + PDevMode: Pointer ; + DevMode: TDeviceMode; + begin + PDevMode := GlobalLock(ASaveHDeviceMode); + try + DevMode := PDeviceMode(PDevMode)^; + Copies := DevMode.dmCopies; + Duplex := DuplexModeMap[DevMode.dmDuplex]; + Orientation := OrientationMap[DevMode.dmOrientation]; + if not SelectPaper(DevMode.dmPaperSize) then + SelectPaper(SavePaperWidth, SavePaperHeight); + SelectBin(DevMode.dmDefaultSource); + finally + GlobalUnlock(ASaveHDeviceMode); + end; + end; + +begin + if FPrinterIndex = AIndex then Exit; + SaveHDeviceMode := 0; + if IsDeviceModePersistent and (FHDeviceMode <> 0) then + begin + SaveHDeviceMode := CopyDeviceMode(FHDeviceMode); + if (Papers <> nil) and (PaperIndex > -1) and (PaperIndex < Papers.Count) then + with TdxPaperInfo(Papers.Objects[PaperIndex]) do + begin + SavePaperWidth := Width; + SavePaperHeight := Height; + end; + end; + + try + ClosePrintDevice; + with PrinterInfos[AIndex] do + begin + FCurrentDevice := StrNew(FDevice); + FCurrentDriver := StrNew(FDriver); + FCurrentPort := StrNew(FPort); + end; + + if OpenPrinter(FCurrentDevice, FDeviceHandle, nil) then + begin + MemSize := DocumentProperties(0, FDeviceHandle, FCurrentDevice, nil, nil, 0); + if MemSize <= 0 then + begin + ClosePrintDevice; + Exit; + end; + + FHDeviceMode := GlobalAlloc(GHND, MemSize); + if FHDeviceMode = 0 then + begin + ClosePrintDevice; + Exit; + end; + + FDeviceMode := GlobalLock(FHDeviceMode); + FDeviceMode^.dmFields := dmFields; + if IDOK <> DocumentProperties(0, FDeviceHandle, FCurrentDevice, FDeviceMode, nil, DM_OUT_BUFFER) then + begin + ClosePrintDevice; + Exit; + end; + FPrinterIndex := AIndex; + + SetPrinterCapabilities(DeviceMode.dmFields); + + FMaxCopies := DeviceCapabilities(FCurrentDevice, FCurrentPort, DC_COPIES, nil, nil); + FMaxExtents := DeviceCapabilities(FCurrentDevice, FCurrentPort, DC_MAXEXTENT, nil, nil); + FMinExtents := DeviceCapabilities(FCurrentDevice, FCurrentPort, DC_MINEXTENT, nil, nil); + FixMinMaxExtents; + + if IsDeviceModePersistent and (SaveHDeviceMode <> 0) then + RestoreDeviceMode(SaveHDeviceMode); + DoPrinterChanged; + end; + finally + if SaveHDeviceMode <> 0 then GlobalFree(SaveHDeviceMode); + end; +end; + +procedure TdxPrintDevice.SetState(Value: TdxPrinterState); +type + TCreateHandleFunc = function(DriverName, DeviceName, Output: PChar; + InitData: PDeviceMode): HDC stdcall; +var + CreateHandleFunc: TCreateHandleFunc; +begin + if Value <> FState then + begin + CreateHandleFunc := nil; + case Value of + psNoHandle: + begin + CheckPrinting(False); + if FCanvas <> nil then + FCanvas.Handle := 0; + DeleteDC(FDC); + FDC := 0; + end; + psHandleIC: + if FState <> psHandleDC then + CreateHandleFunc := CreateIC + else + Exit; + psHandleDC: + begin + if FCanvas <> nil then FCanvas.Handle := 0; + if FDC <> 0 then DeleteDC(FDC); + CreateHandleFunc := CreateDC; + end; + end; + if Assigned(CreateHandleFunc) and (PrinterIndex >= 0) and (PrinterIndex < PrinterCount) then + with PrinterInfos[PrinterIndex] do + begin + FDC := CreateHandleFunc(Driver, Device, Port, FDeviceMode); + if FDC = 0 then + RaiseError(cxGetResourceString(@sdxInvalidPrintDevice)); + if FCanvas <> nil then + FCanvas.Handle := FDC; + end; + FState := Value; + end; +end; + +procedure TdxPrintDevice.SetToDefaultPrintDevice; +var + Device: string; + Index: Integer; +begin + Device := dxGetDefaultPrinter; + if Device <> '' then + begin + Index := FindPrintDevice(PChar(Device), nil); + if Index <> -1 then + begin + OpenPrintDevice(Index); + Exit; + end; + end; + RaiseError(cxGetResourceString(@sdxNoDefaultPrintDevice)); +end; + +procedure TdxPrintDevice.WndProc(var Message: TMessage); + + procedure PostPrnMessage; + begin + PostMessage(FWindowHandle, WMPS_PRINTERLISTCHANGED, 0, 0); + end; + + function PeekPrnMessage(ARemove: Boolean): Boolean; + const + RemoveMap: array[Boolean] of UINT = (PM_NOREMOVE, PM_REMOVE); + var + Msg: TMsg; + begin + Result := PeekMessage(Msg, FWindowHandle, WMPS_PRINTERLISTCHANGED, WMPS_PRINTERLISTCHANGED, RemoveMap[ARemove]); + end; + +begin + with Message do + begin + case Msg of + WM_SETTINGCHANGE: + if AutoRefresh then PostPrnMessage; + + WMPS_PRINTERLISTCHANGED: + if AutoRefresh then + if not FPrinting then + begin + while PeekPrnMessage(True) do ; + Refresh; + end + else + if not PeekPrnMessage(False) then PostPrnMessage; + end; + Result := DefWindowProc(FWindowHandle, Msg, wParam, lParam); + end; +end; + +var + LibHandle: THandle = 0; + +procedure InitializeProcs; +begin + LibHandle := LoadLibrary(winspl); + if LibHandle > HINSTANCE_ERROR then + begin + @FConnectToPrinterDlg := GetProcAddress(LibHandle, 'ConnectToPrinterDlg'); + @FGetDefaultPrinter := GetProcAddress(LibHandle, 'GetDefaultPrinterA'); + @FSetDefaultPrinter := GetProcAddress(LibHandle, 'SetDefaultPrinterA'); + end + else + LibHandle := 0; +end; + +procedure DeinitializeProcs; +begin + if LibHandle <> 0 then + begin + @FConnectToPrinterDlg := nil; + @FGetDefaultPrinter := nil; + @FSetDefaultPrinter := nil; + FreeLibrary(LibHandle); + LibHandle := 0; + end; +end; + +initialization + InitializeProcs; + + {$IFDEF DEBUG_PRINTDEVICE} + AssignFile(LogFile, 'PrinterLog.txt'); + Rewrite(LogFile); + {$ENDIF} + +finalization + {$IFDEF DEBUG_PRINTDEVICE} + CloseFile(LogFile); + {$ENDIF} + + FreeAndNil(FPrintDevice); + DeinitializeProcs; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPrnDlg.dfm b/official/x.35/ExpressPrinting System/Sources/dxPrnDlg.dfm new file mode 100644 index 00000000..9f13c063 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPrnDlg.dfm @@ -0,0 +1,862 @@ +object dxfmPrintDialog: TdxfmPrintDialog + Left = 384 + Top = 200 + BorderStyle = bsDialog + Caption = 'Print' + ClientHeight = 458 + ClientWidth = 484 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 0 + Top = 427 + Width = 484 + Height = 31 + Align = alBottom + BevelOuter = bvNone + TabOrder = 3 + object btnPreview: TBitBtn + Left = 113 + Top = 2 + Width = 105 + Height = 23 + Caption = 'Print Pre&view' + TabOrder = 1 + OnClick = btnPreviewClick + end + object btnOK: TButton + Left = 234 + Top = 2 + Width = 79 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 2 + end + object btnCancel: TButton + Left = 318 + Top = 2 + Width = 79 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 3 + end + object btnHelp: TButton + Left = 402 + Top = 2 + Width = 79 + Height = 23 + Caption = '&Help' + TabOrder = 4 + end + object btnPageSetup: TBitBtn + Left = 3 + Top = 2 + Width = 105 + Height = 23 + Caption = 'Page Set&up...' + TabOrder = 0 + OnClick = btnPageSetupClick + Layout = blGlyphRight + end + end + object pnlPrintStyles: TPanel + Left = 0 + Top = 317 + Width = 484 + Height = 105 + Align = alTop + BevelOuter = bvNone + BorderWidth = 3 + TabOrder = 2 + object gbxPrintStyles: TGroupBox + Left = 3 + Top = 3 + Width = 478 + Height = 99 + Align = alClient + Caption = ' Print Styles ' + TabOrder = 0 + object lbxPrintStyles: TListBox + Left = 7 + Top = 15 + Width = 322 + Height = 78 + Style = lbOwnerDrawFixed + ItemHeight = 34 + PopupMenu = pmPrintStyles + TabOrder = 0 + OnClick = lbxPrintStylesClick + OnDblClick = PageSetup2Click + OnDrawItem = lbxPrintStylesDrawItem + end + object btnPageSetup2: TButton + Left = 335 + Top = 15 + Width = 136 + Height = 23 + Caption = 'Page Set&up...' + Default = True + TabOrder = 1 + OnClick = PageSetup2Click + end + object btnDefineStyles: TButton + Left = 335 + Top = 42 + Width = 136 + Height = 23 + Caption = 'Define S&tyles...' + TabOrder = 2 + OnClick = DefineStylesClick + end + end + end + object pnlMiddle: TPanel + Left = 0 + Top = 164 + Width = 484 + Height = 153 + Align = alTop + BevelOuter = bvNone + BorderWidth = 3 + TabOrder = 1 + object gbxPageRange: TGroupBox + Left = 3 + Top = 3 + Width = 244 + Height = 147 + Align = alLeft + Caption = ' Page ra&nge ' + TabOrder = 0 + object lblDescription: TLabel + Left = 6 + Top = 98 + Width = 232 + Height = 41 + AutoSize = False + Caption = + 'Enter page number and/or page ranges'#13#10'separated by commes. For e' + + 'xample : 1,3,5-12' + Transparent = True + WordWrap = True + end + object bvlPRWarningHolder: TBevel + Left = 80 + Top = 12 + Width = 157 + Height = 30 + Visible = False + end + object rbtnAllPages: TRadioButton + Left = 9 + Top = 23 + Width = 58 + Height = 17 + Caption = '&All' + Checked = True + TabOrder = 0 + TabStop = True + OnClick = rbtnPagesClick + end + object rbtnCurrentPage: TRadioButton + Tag = 1 + Left = 9 + Top = 48 + Width = 104 + Height = 17 + Caption = 'Curr&ent page' + TabOrder = 1 + OnClick = rbtnPagesClick + end + object rbtnPageRanges: TRadioButton + Tag = 2 + Left = 9 + Top = 72 + Width = 67 + Height = 17 + Caption = 'Pa&ges: ' + TabOrder = 2 + OnClick = rbtnPagesClick + end + object edPageRanges: TEdit + Left = 80 + Top = 70 + Width = 157 + Height = 21 + AutoSelect = False + TabOrder = 3 + OnChange = edPageRangesChange + OnExit = edPageRangesExit + OnKeyPress = edPageRangesKeyPress + end + object rbtnSelection: TRadioButton + Tag = 3 + Left = 116 + Top = 48 + Width = 113 + Height = 17 + Caption = '&Selection' + TabOrder = 4 + OnClick = rbtnPagesClick + end + end + object gbxCopies: TGroupBox + Left = 251 + Top = 3 + Width = 230 + Height = 147 + Align = alRight + Caption = ' C&opies ' + TabOrder = 1 + object lblNumberOfCopies: TLabel + Left = 11 + Top = 48 + Width = 90 + Height = 13 + Caption = 'Number of &copies :' + OnClick = lblNumberOfCopiesClick + end + object bvlCopiesHolder: TBevel + Left = 122 + Top = 43 + Width = 101 + Height = 22 + Visible = False + end + object lblNumberOfPages: TLabel + Left = 11 + Top = 21 + Width = 89 + Height = 13 + Caption = 'Number of pa&ges :' + FocusControl = cbxNumberOfPages + OnClick = lblNumberOfPagesClick + end + object pbxCollate: TPaintBox + Left = 62 + Top = 96 + Width = 118 + Height = 44 + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -9 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + OnDblClick = pbxCollateDblClick + OnPaint = pbxCollatePaint + end + object chbxCollate: TCheckBox + Left = 9 + Top = 74 + Width = 171 + Height = 17 + Caption = 'Co&llate copies' + TabOrder = 1 + OnClick = chbxCollateClick + end + object cbxNumberOfPages: TComboBox + Left = 122 + Top = 17 + Width = 101 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + OnChange = cbxNumberOfPagesChange + Items.Strings = ( + 'All' + 'Even' + 'Odd') + end + end + end + object pnlTop: TPanel + Left = 0 + Top = 0 + Width = 484 + Height = 164 + Align = alTop + BevelOuter = bvNone + BorderWidth = 3 + TabOrder = 0 + object gbxPrinter: TGroupBox + Left = 3 + Top = 3 + Width = 478 + Height = 158 + Align = alClient + Caption = ' &Printer ' + TabOrder = 0 + object lblName: TLabel + Left = 8 + Top = 20 + Width = 31 + Height = 13 + Caption = '&Name:' + FocusControl = cbxPrinters + OnClick = lblNameClick + end + object lblStatus: TLabel + Left = 8 + Top = 48 + Width = 35 + Height = 13 + Caption = 'Status:' + end + object lblType: TLabel + Left = 8 + Top = 67 + Width = 28 + Height = 13 + Caption = 'Type:' + end + object lblWhere: TLabel + Left = 8 + Top = 86 + Width = 36 + Height = 13 + Caption = 'Where:' + end + object lblComment: TLabel + Left = 8 + Top = 105 + Width = 49 + Height = 13 + Caption = 'Comment:' + end + object lStatus: TLabel + Left = 90 + Top = 49 + Width = 31 + Height = 13 + Caption = 'Status' + end + object lType: TLabel + Left = 90 + Top = 68 + Width = 24 + Height = 13 + Caption = 'Type' + end + object lWhere: TLabel + Left = 90 + Top = 87 + Width = 32 + Height = 13 + Caption = 'Where' + end + object lComment: TLabel + Left = 90 + Top = 106 + Width = 45 + Height = 13 + Caption = 'Comment' + end + object cbxPrinters: TComboBox + Left = 90 + Top = 15 + Width = 280 + Height = 26 + Style = csOwnerDrawFixed + ItemHeight = 20 + TabOrder = 0 + OnChange = cbxPrintersChange + OnDrawItem = cbxPrintersDrawItem + end + object btnPrinterProperties: TButton + Left = 376 + Top = 15 + Width = 95 + Height = 26 + Caption = 'P&roperties...' + TabOrder = 1 + OnClick = btnPrinterPropertiesClick + end + object btnNetwork: TButton + Left = 376 + Top = 45 + Width = 95 + Height = 26 + Caption = 'Net&work...' + TabOrder = 2 + OnClick = btnNetworkClick + end + object pnlPrintToFile: TPanel + Left = 2 + Top = 120 + Width = 474 + Height = 36 + Align = alBottom + BevelOuter = bvNone + TabOrder = 3 + object chbxPrintToFile: TCheckBox + Left = 8 + Top = 10 + Width = 136 + Height = 15 + Caption = 'Print to &file' + TabOrder = 0 + OnClick = chbxPrintToFileClick + end + object cbxFileName: TComboBox + Left = 150 + Top = 7 + Width = 216 + Height = 21 + ItemHeight = 13 + TabOrder = 1 + Text = 'cbxFileName' + OnExit = cbxFileNameExit + end + object btnBrowse: TButton + Left = 374 + Top = 6 + Width = 95 + Height = 23 + Caption = '&Browse...' + TabOrder = 2 + OnClick = btnBrowseClick + end + end + end + end + object ilPrinters: TImageList + AllocBy = 7 + Left = 85 + Top = 357 + Bitmap = { + 494C010107000C000C0010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008400 + 0000840000008400000084000000840000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000840000008400 + 0000840000008484840084000000FFFFFF008400000084000000840000008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008400000084000000840000008400000084000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 8400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 0000840000000000000000000000000000000000000000000000848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000840000008400 + 0000840000008400000084000000840000008400000084000000840000008400 + 0000840000008400000084000000000000008400000084000000848484008484 + 8400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 000084000000000000000000000000000000000000008484840000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000840000008400 + 000084000000840000008484840084000000FFFFFF0084000000840000008400 + 0000840000008400000084000000000000008400000084000000848484008484 + 8400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 000084000000000000000000000000000000000000008484840000FFFF0000FF + FF0000FFFF0000FFFF00C6C6C600000000000084840000FFFF0000FFFF0000FF + FF0000FFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000008400000084000000848484008484 + 8400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 000084000000000000000000000000000000000000008484840000FFFF0000FF + FF0000FFFF0000FFFF000084840000000000C6C6C60000FFFF0000FFFF0000FF + FF0000FFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000008400000084000000848484008484 + 8400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 00008400000084000000840000008400000000000000000000008484840000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000008400000084000000848484008484 + 8400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 000084000000FFFFFF00840000008400000000000000000000008484840000FF + FF0000FFFF0000FFFF0000FFFF000000000000FFFF0000FFFF0000FFFF0000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000008400000084000000848484008484 + 840084848400840000008484840084000000FFFFFF00FFFFFF00FFFFFF008400 + 000084000000FFFFFF0084000000840000000000000000000000000000008484 + 840000FFFF0000FFFF0000FFFF000000000000FFFF0000FFFF0000FFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000084000000840000008400 + 0000840000008484840084848400848484008400000084000000840000008400 + 0000FFFFFF00FFFFFF0084000000840000000000000000000000000000008484 + 840000FFFF0000FFFF0000848400000000000084840000FFFF0000FFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000008400 + 0000840000008484840084848400848484008484840084000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000840000000000000000000000000000000000 + 00008484840000FFFF0000848400000000000084840000FFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000008400 + 0000840000008484840084848400848484008484840084000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000840000000000000000000000000000000000 + 00008484840000FFFF0000848400000000000084840000FFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 84008484840084848400840000000000000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000008400 + 0000840000008484840084848400848484008484840084000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000840000000000000000000000000000000000 + 0000000000008484840000FFFF000000000000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084000000840000008400 + 0000840000008400000000000000000000000000000084000000840000008400 + 0000840000008400000000000000000000000000000000000000000000008400 + 000084000000848484008484840084848400840000000000000084000000FFFF + FF00FFFFFF00FFFFFF0084000000840000000000000000000000000000000000 + 0000000000008484840000FFFF0000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000840000008400000084000000840000000000000000000000000000008400 + 0000840000008400000084000000000000000000000000000000000000000000 + 000000000000000000008484840000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000C6C6C600848484008484840000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000084840000FFFF00C6C6C600008484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000C0C0C000808080008080800000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000080800000FFFF00C0C0C000008080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400C6C6C600C6C6C60084848400000000000000000084848400848484000000 + 000000000000000000000000000000000000C6C6C600C6C6C600C6C6C600C6C6 + C600C6C6C60084848400000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C6000000000000000000000000008080 + 8000C0C0C000C0C0C00080808000000000000000000080808000808080000000 + 000000000000000000000000000000000000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C00080808000000000000000000000000000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C0000000000084848400C6C6C6008484 + 84008484840084848400C6C6C600848484008484840000000000000000008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000008484840084848400848484008484840000000000000000000000 + 0000000000000000000000000000000000000000000080808000C0C0C0008080 + 80008080800080808000C0C0C000808080008080800000000000000000008080 + 8000808080000000000000000000000000000000000000000000000000000000 + 0000000000008080800080808000808080008080800000000000000000000000 + 0000000000000000000000000000000000000000000084848400848484008484 + 8400C6C6C600C6C6C600C6C6C600848484008484840084848400848484000000 + 0000000000008484840000000000000000000000000000000000000000000000 + 0000C6C6C600C6C6C600C6C6C600848484008484840084848400848484000000 + 0000000000000000000000000000000000000000000080808000808080008080 + 8000C0C0C000C0C0C000C0C0C000808080008080800080808000808080000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000C0C0C000C0C0C000C0C0C000808080008080800080808000808080000000 + 0000000000000000000000000000000000008484840084848400C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084848400848484008484 + 840084848400000000000000000000000000000000008484840084848400C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084848400848484008484 + 8400848484000000000000000000000000008080800080808000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000808080008080800080808000808080008080 + 800080808000000000000000000000000000000000008080800080808000C0C0 + C000C0C0C000C0C0C000C0C0C000808080008080800080808000808080008080 + 800080808000000000000000000000000000C6C6C600C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084848400848484008484 + 840084848400848484008484840000000000C6C6C600C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084848400848484008484 + 840084848400848484008484840000000000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000808080008080800080808000808080008080 + 800080808000808080008080800000000000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000808080008080800080808000808080008080 + 800080808000808080008080800000000000C6C6C600FFFFFF00C6C6C600C6C6 + C600FFFFFF00FFFFFF00C6C6C600C6C6C600C6C6C60084848400848484008484 + 840084848400848484008484840000000000C6C6C600FFFFFF00C6C6C600C6C6 + C600FFFFFF00FFFFFF00C6C6C600C6C6C600C6C6C60084848400848484008484 + 840084848400848484008484840000000000C0C0C000FFFFFF00C0C0C000C0C0 + C000FFFFFF00FFFFFF00C0C0C000C0C0C000C0C0C00080808000808080008080 + 800080808000808080008080800000000000C0C0C000FFFFFF00C0C0C000C0C0 + C000FFFFFF00FFFFFF00C0C0C000C0C0C000C0C0C00080808000808080008080 + 800080808000808080008080800000000000C6C6C600FFFFFF00FFFFFF00FFFF + FF00C6C6C600C6C6C6000000FF0084848400C6C6C600C6C6C600C6C6C6008484 + 840084848400848484008484840000000000C6C6C600FFFFFF00FFFFFF00FFFF + FF00C6C6C600C6C6C6000000FF0084848400C6C6C600C6C6C600C6C6C6008484 + 840084848400848484008484840000000000C0C0C000FFFFFF00FFFFFF00FFFF + FF00C0C0C000C0C0C0000000FF0080808000C0C0C000C0C0C000C0C0C0008080 + 800080808000808080008080800000000000C0C0C000FFFFFF00FFFFFF00FFFF + FF00C0C0C000C0C0C0000000FF0080808000C0C0C000C0C0C000C0C0C0008080 + 800080808000808080008080800000000000C6C6C600FFFFFF00C6C6C600C6C6 + C60000FF00008484840084848400C6C6C600C6C6C60084848400848484000000 + 0000C6C6C600848484008484840000000000C6C6C600FFFFFF00C6C6C600C6C6 + C60000FF00008484840084848400C6C6C600C6C6C60084848400848484000000 + 0000C6C6C600848484008484840000000000C0C0C000FFFFFF00C0C0C000C0C0 + C00000FF00008080800080808000C0C0C000C0C0C00080808000808080000000 + 0000C0C0C000808080008080800000000000C0C0C000FFFFFF00C0C0C000C0C0 + C00000FF00008080800080808000C0C0C000C0C0C00080808000808080000000 + 0000C0C0C0008080800080808000000000000000000084848400C6C6C600C6C6 + C60084848400C6C6C600C6C6C60084848400C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C6000000000000000000000000000000000084848400C6C6C600C6C6 + C60084848400C6C6C600C6C6C6008484840084848400C6C6C600C6C6C6000000 + 0000C6C6C6008484840084848400000000000000000080808000C0C0C000C0C0 + C00080808000C0C0C000C0C0C00080808000C0C0C000C0C0C000C0C0C0000000 + 0000C0C0C0000000000000000000000000000000000080808000C0C0C000C0C0 + C00080808000C0C0C000C0C0C0008080800080808000C0C0C000C0C0C0000000 + 0000C0C0C000808080008080800000000000000000000000000000000000C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600FFFFFF00FFFFFF008484 + 840000000000000000000000000000000000000000000000000000000000C6C6 + C600C6C6C600C6C6C60084848400C6C6C600C6C6C600FFFFFF00FFFFFF008484 + 8400848484000000000000000000000000008080800000000000000000000000 + 000080808000C0C0C000C0C0C000C0C0C000C0C0C000FFFFFF00FFFFFF008080 + 8000000000000000000000000000000000008080800000000000000000000000 + 000080808000C0C0C00080808000C0C0C000C0C0C000FFFFFF00FFFFFF008080 + 8000808080000000000000000000000000000000000000000000000000000000 + 00000000000084848400C6C6C600FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00848484000000000000000000000000000000000000000000000000000000 + 0000000000008484840084848400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00848484000000000000000000000000000000000000000000FFFFFF000000 + 00000000000080808000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00808080000000000000000000000000000000000000000000FFFFFF000000 + 0000000000008080800080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000C6C6C600FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000C6C6C600FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0084848400000000000000000000000000C0C0C00000000000FFFF + FF0000000000FFFFFF0000000000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000000000000000000000000000C0C0C00000000000FFFF + FF0000000000FFFFFF0000000000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008080800000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000C6C6C600FFFFFF00FFFFFF00FFFF + FF00C6C6C600C6C6C60000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000C6C6C600FFFFFF00FFFFFF00FFFF + FF00C6C6C600C6C6C60000000000000000000000000000000000000000000000 + 000000000000FFFFFF000000000000000000C0C0C000FFFFFF00FFFFFF00FFFF + FF00C0C0C000C0C0C00000000000000000000000000000000000000000000000 + 000000000000FFFFFF000000000000000000C0C0C000FFFFFF00FFFFFF00FFFF + FF00C0C0C000C0C0C00000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000C6C6C600C6C6C600C6C6 + C600000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000C6C6C600C6C6C600C6C6 + C600000000000000000000000000000000008080800000000000000000000000 + 00008080800000000000000000000000000000000000C0C0C000C0C0C000C0C0 + C000000000000000000000000000000000008080800000000000000000000000 + 00008080800000000000000000000000000000000000C0C0C000C0C0C000C0C0 + C00000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFE0FFFFFF0000FFFF0007E0030000 + F83F0007C0010000000100078001000000010007800300000001000780030000 + 00010000C007000000010000C007000000010000E00F000000018000E00F0000 + 0001E000F01F00000001E000F01F00000101E000F83F00008383E040F83F0000 + FFFFF0E1FC7F0000FFFFFFFFFE7F0000FC7FF87FFC7FF87FF01F0000F01F0000 + C0070000C00700008001F01F8001F01F8001C0078001C0070001000100010001 + 0000000000000000000000000000000000000000000000000000000000000000 + 8001800180018001E007E00700070007F803F80300030003FE00FE0002000200 + FF03FF0303030303FF8FFF8F078F078F00000000000000000000000000000000 + 000000000000} + end + object pmPrintStyles: TPopupMenu + OnPopup = pmPrintStylesPopup + Left = 27 + Top = 357 + object miPageSetup: TMenuItem + Caption = 'Page Set&up...' + Default = True + ShortCut = 16397 + OnClick = PageSetup2Click + end + object miLine1: TMenuItem + Caption = '-' + end + object miDefineStyles: TMenuItem + Caption = 'Define Styles...' + OnClick = DefineStylesClick + end + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxPrnDlg.pas b/official/x.35/ExpressPrinting System/Sources/dxPrnDlg.pas new file mode 100644 index 00000000..13a501a7 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPrnDlg.pas @@ -0,0 +1,1843 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPrnDlg; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + Registry, ExtCtrls, StdCtrls, Menus, Buttons, ImgList, dxPSForm, dxPSESys, + dxPSGlbl, dxPgsDlg, dxPrnDev, dxExtCtrls; + +type + TdxPageNumbers = (pnAll, pnEven, pnOdd); + TdxPageRanges = (prAll, prCurrent, prRange, prSelection); + TdxPrintDlgButtonKind = (pdbPrinterProperties, pdbNetwork, pdbPreview, + pdbPageSetup, pdbDefineStyles, pdbStyleOptions, pdbHelp); + TdxPrintDlgButtons = set of TdxPrintDlgButtonKind; + TdxPrintDlgOption = (pdoPrintToFile, pdoAllPages, pdoCurrentPage, pdoSelection, + pdoPageRange, pdoPrintStyles); + TdxPrintDlgOptions = set of TdxPrintDlgOption; + +const + pdbAll = [Low(TdxPrintDlgButtonKind)..High(TdxPrintDlgButtonKind)]; + pdbDefault = [pdbPrinterProperties, pdbNetwork, pdbPreview, pdbPageSetup, pdbDefineStyles, pdbStyleOptions]; + + pdoAll = [Low(TdxPrintDlgOption)..High(TdxPrintDlgOption)]; + pdoDefaultOptionsEnabled = [pdoPrintToFile, pdoAllPages, pdoPageRange]; + pdoDefaultOptionsVisible = [pdoPrintToFile, pdoAllPages, pdoCurrentPage, pdoPageRange]; + +type + TdxPageSetupEvent = procedure(Sender: TObject; var ADone: Boolean; + APreviewBtnClicked, APrintBtnClicked: PBoolean) of object; + + PdxPrintDlgEvents = ^TdxPrintDlgEvents; + TdxPrintDlgEvents = record + OnClose: TNotifyEvent; {called on the OnHide event} + OnPageSetup: TdxPageSetupEvent; + OnShow: TNotifyEvent; + end; + + PdxPrintDialogData = ^TdxPrintDialogData; + TdxPrintDialogData = record + Copies: Integer; + Collate: Boolean; + FileList: TStrings; + FileName: string; + MaxRange: Integer; + MinRange: Integer; + PageCount: Integer; + PageNums: TdxPageNumbers; + PageRanges: TdxPageRanges; + Pages: string; + PrintToFile: Boolean; + StyleManager: TdxPrintStyleManager; + end; + + PdxPrintDlgData = ^TdxPrintDlgData; + TdxPrintDlgData = record + DialogData: TdxPrintDialogData; + Title: string; + HelpContext: THelpContext; + ButtonsEnabled: TdxPrintDlgButtons; + ButtonsVisible: TdxPrintDlgButtons; + OptionsEnabled: TdxPrintDlgOptions; + OptionsVisible: TdxPrintDlgOptions; + Events: TdxPrintDlgEvents; + IsCheckUserInput: Boolean; + PreviewBtnClicked: Boolean; + end; + + TdxPrintDialog = class(TComponent) + private + FButtonsEnabled: TdxPrintDlgButtons; + FButtonsVisible: TdxPrintDlgButtons; + FDialogData: TdxPrintDialogData; + FHelpContext: THelpContext; + FIsTitleAssigned: Boolean; + FOptionsEnabled: TdxPrintDlgOptions; + FOptionsVisible: TdxPrintDlgOptions; + FPreviewBtnClicked: Boolean; + FPrintBtnClicked: Boolean; + FTitle: string; + FUseFileList: Boolean; + FOnClose: TNotifyEvent; + FOnPageSetup: TdxPageSetupEvent; + FOnShow: TNotifyEvent; + function GetCollate: Boolean; + function GetCopies: Integer; + function GetFileList: TStrings; + function GetFileName: string; + function GetMaxRange: Integer; + function GetMinRange: Integer; + function GetPageCount: Integer; + function GetPageNums: TdxPageNumbers; + function GetPageRanges: TdxPageRanges; + function GetPages: string; + function GetPrintToFile: Boolean; + function GetStyleManager: TdxPrintStyleManager; + function GetTitle: string; + function IsTitleStored: Boolean; + procedure SetCollate(Value: Boolean); + procedure SetCopies(Value: Integer); + procedure SetFileList(Value: TStrings); + procedure SetFileName(const Value: string); + procedure SetMaxRange(Value: Integer); + procedure SetMinRange(Value: Integer); + procedure SetPageCount(Value: Integer); + procedure SetPageNums(Value: TdxPageNumbers); + procedure SetPageRanges(Value: TdxPageRanges); + procedure SetPages(const Value: string); + procedure SetPrintToFile(Value: Boolean); + procedure SetStyleManager(Value: TdxPrintStyleManager); + procedure SetTitle(const Value: string); + + procedure ReadIsTitleAssigned(Reader: TReader); + procedure WriteIsTitleAssigned(Writer: TWriter); + protected + procedure AssignTo(Dest: TPersistent); override; + procedure DefineProperties(Filer: TFiler); override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + function DefaultTitle: string; virtual; + function Execute: Boolean; + procedure RestoreDefaults; virtual; + procedure SetMinMaxRanges(AMinRange, AMaxRange: Integer); + + property DialogData: TdxPrintDialogData read FDialogData; + property FileList: TStrings read GetFileList write SetFileList; + property PageCount: Integer read GetPageCount write SetPageCount; + property PreviewBtnClicked: Boolean read FPreviewBtnClicked; + property PrintBtnClicked: Boolean read FPrintBtnClicked; + published + property ButtonsEnabled: TdxPrintDlgButtons read FButtonsEnabled write FButtonsEnabled + default [pdbPrinterProperties, pdbNetwork, pdbPreview, pdbPageSetup, pdbDefineStyles, pdbStyleOptions]; + property ButtonsVisible: TdxPrintDlgButtons read FButtonsVisible write FButtonsVisible + default [pdbPrinterProperties, pdbNetwork, pdbPreview, pdbPageSetup, pdbDefineStyles, pdbStyleOptions]; + property Collate: Boolean read GetCollate write SetCollate default False; + property Copies: Integer read GetCopies write SetCopies default 1; + property FileName: string read GetFileName write SetFileName; + property HelpContext: THelpContext read FHelpContext write FHelpContext default 0; + property MaxRange: Integer read GetMaxRange write SetMaxRange default 1; + property MinRange: Integer read GetMinRange write SetMinRange default 1; + property OptionsEnabled: TdxPrintDlgOptions read FOptionsEnabled write FOptionsEnabled + default [pdoPrintToFile, pdoAllPages, pdoPageRange]; + property OptionsVisible: TdxPrintDlgOptions read FOptionsVisible write FOptionsVisible + default [pdoPrintToFile, pdoAllPages, pdoCurrentPage, pdoPageRange]; + property PageNums: TdxPageNumbers read GetPageNums write SetPageNums default pnAll; + property PageRanges: TdxPageRanges read GetPageRanges write SetPageRanges default prAll; + property Pages: string read GetPages write SetPages; + property PrintToFile: Boolean read GetPrintToFile write SetPrintToFile default False; + property StyleManager: TdxPrintStyleManager read GetStyleManager write SetStyleManager; + property Title: string read GetTitle write SetTitle stored IsTitleStored; + property UseFileList: Boolean read FUseFileList write FUseFileList default False; + + property OnClose: TNotifyEvent read FOnClose write FOnClose; + property OnPageSetup: TdxPageSetupEvent read FOnPageSetup write FOnPageSetup; + property OnShow: TNotifyEvent read FOnShow write FOnShow; + end; + + TdxfmPrintDialog = class(TCustomdxPSForm) + ilPrinters: TImageList; + Panel1: TPanel; + btnPreview: TBitBtn; + btnOK: TButton; + btnCancel: TButton; + btnHelp: TButton; + pnlPrintStyles: TPanel; + gbxPrintStyles: TGroupBox; + lbxPrintStyles: TListBox; + btnPageSetup2: TButton; + btnDefineStyles: TButton; + pmPrintStyles: TPopupMenu; + miPageSetup: TMenuItem; + miDefineStyles: TMenuItem; + miLine1: TMenuItem; + pnlMiddle: TPanel; + gbxPageRange: TGroupBox; + lblDescription: TLabel; + rbtnAllPages: TRadioButton; + rbtnCurrentPage: TRadioButton; + rbtnPageRanges: TRadioButton; + edPageRanges: TEdit; + rbtnSelection: TRadioButton; + gbxCopies: TGroupBox; + chbxCollate: TCheckBox; + pnlTop: TPanel; + gbxPrinter: TGroupBox; + lblName: TLabel; + lblStatus: TLabel; + lblType: TLabel; + lblWhere: TLabel; + lblComment: TLabel; + lStatus: TLabel; + lType: TLabel; + lWhere: TLabel; + lComment: TLabel; + cbxPrinters: TComboBox; + btnPrinterProperties: TButton; + btnNetwork: TButton; + pnlPrintToFile: TPanel; + chbxPrintToFile: TCheckBox; + cbxFileName: TComboBox; + btnBrowse: TButton; + btnPageSetup: TBitBtn; + lblNumberOfCopies: TLabel; + bvlCopiesHolder: TBevel; + lblNumberOfPages: TLabel; + cbxNumberOfPages: TComboBox; + bvlPRWarningHolder: TBevel; + pbxCollate: TPaintBox; + procedure chbxCollateClick(Sender: TObject); + procedure btnPrinterPropertiesClick(Sender: TObject); + procedure cbxPrintersChange(Sender: TObject); + procedure chbxPrintToFileClick(Sender: TObject); + procedure edPageRangesChange(Sender: TObject); + procedure cbxNumberOfPagesChange(Sender: TObject); + procedure rbtnPagesClick(Sender: TObject); + procedure btnBrowseClick(Sender: TObject); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + procedure edPageRangesExit(Sender: TObject); + procedure btnPreviewClick(Sender: TObject); + procedure btnPageSetupClick(Sender: TObject); + procedure edPageRangesKeyPress(Sender: TObject; var KEY: Char); + procedure lblNumberOfPagesClick(Sender: TObject); + procedure lblNumberOfCopiesClick(Sender: TObject); + procedure lblNameClick(Sender: TObject); + procedure btnNetworkClick(Sender: TObject); + procedure cbxPrintersDrawItem(Control: TWinControl; index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure seCopiesChange(Sender: TObject); + procedure seCopiesExit(Sender: TObject); + procedure PageSetup2Click(Sender: TObject); + procedure lbxPrintStylesDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure lbxPrintStylesClick(Sender: TObject); + procedure DefineStylesClick(Sender: TObject); + procedure pmPrintStylesPopup(Sender: TObject); + procedure cbxFileNameExit(Sender: TObject); + procedure pbxCollatePaint(Sender: TObject); + procedure pbxCollateDblClick(Sender: TObject); + private + FControlsUpdating: Boolean; + FDialogData: TdxPrintDialogData; + FGlyphs: array[Boolean] of TBitmap; + FIsCheckUserInput: Boolean; + FModified: Boolean; + FSubscriber: TdxEventSubscriber; + FPreviewBtnClicked: Boolean; + FPrintBtnClicked: Boolean; + FSaveDialogData: TdxPrintDialogData; + FseCopies: TdxPSSpinEdit; + FPrintStylesVisibled: Boolean; + FwpPageRanges: TdxPSWarningPane; + FOnClose: TNotifyEvent; + FOnPageSetup: TdxPageSetupEvent; + FOnShow: TNotifyEvent; + function CheckFileName(const FileName: string): Boolean; + procedure CheckModified; + function CheckPageRanges: Boolean; + function CheckUserInput: Boolean; + procedure ConnectToPrinterDlg; + procedure CreateControls; + procedure DocumentPropertiesDlg; + procedure DrawCollatedPages(DC: HDC; const ADrawRect: TRect; ACollate: Boolean); + function GetFileName(const S: string): string; + procedure LoadStrings; + procedure RefreshPrinterList; + procedure RefreshStyleList; + procedure SavePrintDialogData; + procedure SetActiveControl; + procedure SetupDialog(const APrintDlgData: TdxPrintDlgData); + procedure StartSettings; + procedure StyleListChanged(Sender: TObject); + procedure UpdateControlsState; + procedure UpdatePrinterInfos; + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + protected + procedure CreateWnd; override; + procedure DoHide; override; + procedure DoShow; override; + + procedure DoPageSetup; dynamic; + procedure UpdatePrinters; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + procedure LoadFromRegistry(const APath: string); override; + procedure SaveToRegistry(const APath: string); override; + + function Execute: Boolean; + procedure ShowPrintStyles(AShow: Boolean); + + property PreviewBtnClicked: Boolean read FPreviewBtnClicked; + property OnPageSetup: TdxPageSetupEvent read FOnPageSetup write FOnPageSetup; + end; + +function dxPrintDialog(var AData: TdxPrintDlgData): Boolean; overload; + +implementation + +{$R *.DFM} + +uses + {$IFDEF DELPHI6} + Variants, + {$ENDIF} + WinSpool, Math, cxClasses, dxPSPopupMan, dxPSRes, dxPSEngn, dxPSEvnt, dxPSUtl, + dxPSImgs; + +const + sdxMaximized = 'Maximized'; // Don't Localize + +function dxPrintDialog(var AData: TdxPrintDlgData): Boolean; +var + Dialog: TdxfmPrintDialog; +begin + Dialog := TdxfmPrintDialog.Create(nil); + try + Dialog.SetupDialog(AData); + Result := Dialog.Execute; + if Result then + AData.DialogData := Dialog.FDialogData + else + AData.DialogData := Dialog.FSaveDialogData; + AData.PreviewBtnClicked := Dialog.PreviewBtnClicked; + finally + Dialog.Free; + end; +end; + +{ Memory Management Routines } + +function dxAllocMem(ASize: Integer): Pointer; +begin + Result := AllocMem(ASize); +end; + +procedure dxFreeMem(var P: Pointer; ASize: Integer); +begin + FreeMem(P, ASize); + P := nil; +end; + +{ TdxPrintDialog } + +constructor TdxPrintDialog.Create(AOwner: TComponent); +begin + inherited; + FillChar(FDialogData, SizeOf(TdxPrintDialogData), 0); + FDialogData.Copies := 1; + FDialogData.Collate := False; + FDialogData.FileList := TStringList.Create; + FDialogData.FileName := ''; + FDialogData.MaxRange := 1; + FDialogData.MinRange := 1; + FDialogData.PageCount := 0; + FDialogData.PageNums := pnAll; + FDialogData.PageRanges := prAll; + FDialogData.Pages := ''; + FDialogData.PrintToFile := False; + FDialogData.StyleManager := nil; + + FButtonsEnabled := pdbDefault; + FOptionsEnabled := pdoDefaultOptionsEnabled; + + FButtonsVisible := pdbDefault; + FOptionsVisible := pdoDefaultOptionsVisible; +end; + +destructor TdxPrintDialog.Destroy; +begin + FreeAndNil(FDialogData.FileList); + inherited; +end; + +function TdxPrintDialog.DefaultTitle: string; +begin + Result := cxGetResourceString(@sdxPrintDialogCaption); +end; + +function TdxPrintDialog.Execute: Boolean; +var + APrintDlgData: TdxPrintDlgData; + AEvents: TdxPrintDlgEvents; + ADialogData: TdxPrintDialogData; + ASaveStrings: TStrings; +begin + if dxPrintDevice.Printers.Count = 0 then + begin + MessageWarning(cxGetResourceString(@sdxPrintDialogNoPrinters)); + Result := False; + Exit; + end; + + FillChar(APrintDlgData, SizeOf(TdxPrintDlgData), 0); + FillChar(AEvents, SizeOf(TdxPrintDlgEvents), 0); + FillChar(ADialogData, SizeOf(TdxPrintDialogData), 0); + try + ADialogData.Copies := Copies; + ADialogData.Collate := Collate; + if UseFileList then + begin + ADialogData.FileList := TStringList.Create; + ADialogData.FileList.Assign(FileList); + end; + ADialogData.FileName := FileName; + ADialogData.MaxRange := MaxRange; + ADialogData.MinRange := MinRange; + ADialogData.PageCount := PageCount; + ADialogData.PageNums := PageNums; + ADialogData.PageRanges := PageRanges; + ADialogData.Pages := Pages; + ADialogData.PrintToFile := PrintToFile; + ADialogData.StyleManager := StyleManager; + + APrintDlgData.DialogData := ADialogData; + if APrintDlgData.HelpContext <> 0 then + APrintDlgData.HelpContext := HelpContext; + APrintDlgData.Title := Title; + APrintDlgData.IsCheckUserInput := not (csDesigning in ComponentState); + APrintDlgData.OptionsEnabled := OptionsEnabled; + APrintDlgData.OptionsVisible := OptionsVisible; + APrintDlgData.ButtonsEnabled := ButtonsEnabled; + APrintDlgData.ButtonsVisible := ButtonsVisible; + + AEvents.OnClose := OnClose; + AEvents.OnPageSetup := OnPageSetup; + AEvents.OnShow := OnShow; + + APrintDlgData.Events := AEvents; + + Result := dxPrintDialog(APrintDlgData); + if Result then + begin + ASaveStrings := FileList; + if UseFileList then + FileList := APrintDlgData.DialogData.FileList; + FDialogData := APrintDlgData.DialogData; + FDialogData.FileList := ASaveStrings; + end; + FPreviewBtnClicked := APrintDlgData.PreviewBtnClicked; + finally + if ADialogData.FileList <> nil then ADialogData.FileList.Free; + end; +end; + +procedure TdxPrintDialog.RestoreDefaults; +begin + ButtonsEnabled := pdbDefault; + ButtonsVisible := pdbDefault; + Collate := False; + Copies := 1; + MaxRange := 1; + MinRange := 1; + OptionsEnabled := pdoDefaultOptionsEnabled; + OptionsVisible := pdoDefaultOptionsVisible; + PageNums := pnAll; + PageRanges := prAll; + PrintToFile := False; + UseFileList := False; + FIsTitleAssigned := False; +end; + +procedure TdxPrintDialog.SetMinMaxRanges(AMinRange, AMaxRange: Integer); +begin + if AMinRange < 1 then AMinRange := 1; + if AMaxRange <> -1 then + if AMaxRange < AMinRange then AMaxRange := AMinRange; + FDialogData.MinRange := AMinRange; + FDialogData.MaxRange := AMaxRange; +end; + +procedure TdxPrintDialog.AssignTo(Dest: TPersistent); + + procedure XorOption(var AOptions: TPrintDialogOptions; AItem: TPrintDialogOption; AValue: Boolean); + begin + if AValue then + AOptions := AOptions + [AItem] + else + AOptions := AOptions - [AItem]; + end; + +var + PageIndexes: TIntegers; + SrcOptions: TPrintDialogOptions; +begin + if Dest is Dialogs.TPrintDialog then + with Dialogs.TPrintDialog(Dest) do + begin + Collate := Self.Collate; + Copies := Self.Copies; + MinPage := Self.MinRange; + MaxPage := Self.MaxRange; + if MakePageIndexes(Self.Pages, PageIndexes) then + try + FromPage := MinIntValue(PageIndexes); + ToPage := MaxIntValue(PageIndexes); + finally + SetLength(PageIndexes, 0); + end + else + begin + FromPage := 1; + ToPage := 1; + end; + + SrcOptions := Options; + XorOption(SrcOptions, poPrintToFile, pdoPrintToFile in Self.OptionsVisible); + XorOption(SrcOptions, poDisablePrintToFile, pdoPrintToFile in Self.OptionsEnabled); + XorOption(SrcOptions, poPageNums, + (pdoPageRange in Self.OptionsVisible) and (pdoPageRange in Self.OptionsEnabled)); + XorOption(SrcOptions, poSelection, + (pdoSelection in Self.OptionsVisible) and (pdoSelection in Self.OptionsEnabled)); + XorOption(SrcOptions, poHelp, + (pdbHelp in Self.ButtonsVisible) and (pdbHelp in Self.ButtonsEnabled)); + Options := SrcOptions; + + PrintToFile := Self.PrintToFile; + + if Self.PageRanges = prSelection then + PrintRange := Dialogs.prAllPages + else + PrintRange := TPrintRange(PageRanges); + end; +end; + +procedure TdxPrintDialog.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('IsTitleAssigned', ReadIsTitleAssigned, WriteIsTitleAssigned, + FIsTitleAssigned and (Title = '')); +end; + +procedure TdxPrintDialog.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if (AComponent = StyleManager) and (Operation = opRemove) then + StyleManager := nil; +end; + +function TdxPrintDialog.GetPageCount: Integer; +begin + Result := FDialogData.PageCount; +end; + +function TdxPrintDialog.GetCollate: Boolean; +begin + Result := FDialogData.Collate; +end; + +function TdxPrintDialog.GetCopies: Integer; +begin + Result := FDialogData.Copies; +end; + +function TdxPrintDialog.GetFileList: TStrings; +begin + Result := FDialogData.FileList; +end; + +function TdxPrintDialog.GetFileName: string; +begin + Result := FDialogData.FileName; +end; + +function TdxPrintDialog.GetMaxRange: Integer; +begin + Result := FDialogData.MaxRange; +end; + +function TdxPrintDialog.GetMinRange: Integer; +begin + Result := FDialogData.MinRange; +end; + +function TdxPrintDialog.GetPageNums: TdxPageNumbers; +begin + Result := FDialogData.PageNums; +end; + +function TdxPrintDialog.GetPageRanges: TdxPageRanges; +begin + Result := FDialogData.PageRanges; +end; + +function TdxPrintDialog.GetPages: string; +begin + Result := FDialogData.Pages; +end; + +function TdxPrintDialog.GetPrintToFile: Boolean; +begin + Result := FDialogData.PrintToFile; +end; + +function TdxPrintDialog.GetStyleManager: TdxPrintStyleManager; +begin + Result := FDialogData.StyleManager; +end; + +function TdxPrintDialog.GetTitle: string; +begin + if FIsTitleAssigned then + Result := FTitle + else + Result := DefaultTitle; +end; + +function TdxPrintDialog.IsTitleStored: Boolean; +begin + Result := FIsTitleAssigned and (Title <> DefaultTitle); +end; + +procedure TdxPrintDialog.SetCollate(Value: Boolean); +begin + FDialogData.Collate := Value; +end; + +procedure TdxPrintDialog.SetCopies(Value: Integer); +begin + FDialogData.Copies := Value; +end; + +procedure TdxPrintDialog.SetFileList(Value: TStrings); +begin + FDialogData.FileList.Assign(Value); +end; + +procedure TdxPrintDialog.SetFileName(const Value: string); +begin + FDialogData.FileName := Value; +end; + +procedure TdxPrintDialog.SetMaxRange(Value: Integer); +begin + SetMinMaxRanges(MinRange, Value); +end; + +procedure TdxPrintDialog.SetMinRange(Value: Integer); +begin + SetMinMaxRanges(Value, MaxRange); +end; + +procedure TdxPrintDialog.SetPageCount(Value: Integer); +begin + if Value < 1 then Value := 1; + FDialogData.PageCount := Value; +end; + +procedure TdxPrintDialog.SetPageNums(Value: TdxPageNumbers); +begin + FDialogData.PageNums := Value; +end; + +procedure TdxPrintDialog.SetPageRanges(Value: TdxPageRanges); +begin + if FDialogData.PageRanges <> Value then + begin + case Value of + prAll: + begin + OptionsVisible := OptionsVisible + [pdoAllPages]; + OptionsEnabled := OptionsEnabled + [pdoAllPages]; + end; + prCurrent: + begin + OptionsVisible := OptionsVisible + [pdoCurrentPage]; + OptionsEnabled := OptionsEnabled + [pdoCurrentPage]; + end; + prRange: + begin + OptionsVisible := OptionsVisible + [pdoPageRange]; + OptionsEnabled := OptionsEnabled + [pdoPageRange]; + end; + prSelection: + begin + OptionsVisible := OptionsVisible + [pdoSelection]; + OptionsEnabled := OptionsEnabled + [pdoSelection]; + end; + end; + FDialogData.PageRanges := Value; + end; +end; + +procedure TdxPrintDialog.SetPages(const Value: string); +begin + FDialogData.Pages := Value; +end; + +procedure TdxPrintDialog.SetPrintToFile(Value: Boolean); +begin + FDialogData.PrintToFile := Value; +end; + +procedure TdxPrintDialog.SetStyleManager(Value: TdxPrintStyleManager); +begin + if FDialogData.StyleManager <> Value then + begin + FDialogData.StyleManager := Value; + if StyleManager <> nil then + StyleManager.FreeNotification(Self); + end; +end; + +procedure TdxPrintDialog.SetTitle(const Value: string); +begin + if Title <> Value then + begin + FTitle := Value; + FIsTitleAssigned := True; + end; +end; + +procedure TdxPrintDialog.ReadIsTitleAssigned(Reader: TReader); +begin + FIsTitleAssigned := Reader.ReadBoolean; +end; + +procedure TdxPrintDialog.WriteIsTitleAssigned(Writer: TWriter); +begin + Writer.WriteBoolean(FIsTitleAssigned); +end; + +{ utilities } + +function GetStatusString(Status: DWORD): string; +begin + case Status of + 0: + Result := cxGetResourceString(@sdxPrintDialogPSReady); + PRINTER_STATUS_PAUSED: + Result := cxGetResourceString(@sdxPrintDialogPSPaused); + PRINTER_STATUS_PENDING_DELETION: + Result := cxGetResourceString(@sdxPrintDialogPSPendingDeletion); + PRINTER_STATUS_BUSY: + Result := cxGetResourceString(@sdxPrintDialogPSBusy); + PRINTER_STATUS_DOOR_OPEN: + Result := cxGetResourceString(@sdxPrintDialogPSDoorOpen); + PRINTER_STATUS_ERROR: + Result := cxGetResourceString(@sdxPrintDialogPSError); + PRINTER_STATUS_INITIALIZING: + Result := cxGetResourceString(@sdxPrintDialogPSInitializing); + PRINTER_STATUS_IO_ACTIVE: + Result := cxGetResourceString(@sdxPrintDialogPSIOActive); + PRINTER_STATUS_MANUAL_FEED: + Result := cxGetResourceString(@sdxPrintDialogPSManualFeed); + PRINTER_STATUS_NO_TONER: + Result := cxGetResourceString(@sdxPrintDialogPSNoToner); + PRINTER_STATUS_NOT_AVAILABLE: + Result := cxGetResourceString(@sdxPrintDialogPSNotAvailable); + PRINTER_STATUS_OFFLINE: + Result := cxGetResourceString(@sdxPrintDialogPSOFFLine); + PRINTER_STATUS_OUT_OF_MEMORY: + Result := cxGetResourceString(@sdxPrintDialogPSOutOfMemory); + PRINTER_STATUS_OUTPUT_BIN_FULL: + Result := cxGetResourceString(@sdxPrintDialogPSOutBinFull); + PRINTER_STATUS_PAGE_PUNT: + Result := cxGetResourceString(@sdxPrintDialogPSPagePunt); + PRINTER_STATUS_PAPER_JAM: + Result := cxGetResourceString(@sdxPrintDialogPSPaperJam); + PRINTER_STATUS_PAPER_OUT: + Result := cxGetResourceString(@sdxPrintDialogPSPaperOut); + PRINTER_STATUS_PAPER_PROBLEM: + Result := cxGetResourceString(@sdxPrintDialogPSPaperProblem); + PRINTER_STATUS_PRINTING: + Result := cxGetResourceString(@sdxPrintDialogPSPrinting); + PRINTER_STATUS_PROCESSING: + Result := cxGetResourceString(@sdxPrintDialogPSProcessing); + PRINTER_STATUS_TONER_LOW: + Result := cxGetResourceString(@sdxPrintDialogPSTonerLow); + PRINTER_STATUS_USER_INTERVENTION: + Result := cxGetResourceString(@sdxPrintDialogPSUserIntervention); + PRINTER_STATUS_WAITING: + Result := cxGetResourceString(@sdxPrintDialogPSWaiting); + PRINTER_STATUS_WARMING_UP: + Result := cxGetResourceString(@sdxPrintDialogPSWarningUp); + else + Result := ''; + end; +end; + +{ TfmdxPrintDialog } + +constructor TdxfmPrintDialog.Create(AOwner: TComponent); +begin + inherited; + HelpContext := dxPSGlbl.dxhcPrintDlg; + FillChar(FDialogData, SizeOf(TdxPrintDialogData), 0); + FillChar(FSaveDialogData, SizeOf(TdxPrintDialogData), 0); + CreateControls; + FGlyphs[False] := CreateDoubleArrowBitmap(udgUp, 8); + FGlyphs[True] := CreateDoubleArrowBitmap(udgDown, 8); + + pmPrintStyles.Images := ilPrinters; + miPageSetup.ImageIndex := 4; + miDefineStyles.ImageIndex := 5; + + FSubscriber := TdxStyleListChangedSubscriber.Create([TdxSMStyleListChangedEvent]); + TdxStyleListChangedSubscriber(FSubscriber).OnStyleListChanged := StyleListChanged; + dxPSPopupMenuController.RegisterControl(lbxPrintStyles); +end; + +destructor TdxfmPrintDialog.Destroy; +begin + dxPSPopupMenuController.UnregisterControl(lbxPrintStyles); + FreeAndNil(FSubscriber); + FreeAndNil(FGlyphs[True]); + FreeAndNil(FGlyphs[False]); + inherited; +end; + +function TdxfmPrintDialog.Execute: Boolean; +begin + if dxPrintDevice.Printers.Count = 0 then + begin + MessageWarning(cxGetResourceString(@sdxPrintDialogNoPrinters)); + Result := False; + Exit; + end; + + StartSettings; + ShowPrintStyles(FPrintStylesVisibled and (FDialogData.StyleManager <> nil)); + if FDialogData.StyleManager <> nil then + TdxStyleListChangedSubscriber(FSubscriber).StyleListChanged(FDialogData.StyleManager); + SetActiveControl; + + Result := ShowModal = mrOk; +end; + +procedure TdxfmPrintDialog.CreateWnd; +begin + inherited; + if Icon.Handle = 0 then + Icon_LoadFromResourceName(Icon, IDB_DXPSPRINT); + SendMessage(Handle, WM_SETICON, 1, Icon.Handle); +end; + +procedure TdxfmPrintDialog.DoHide; +begin + if Assigned(FOnClose) then FOnClose(Self); + inherited; +end; + +procedure TdxfmPrintDialog.DoShow; +begin + inherited; + if Assigned(FOnShow) then FOnShow(Self); +end; + +procedure TdxfmPrintDialog.DoPageSetup; +var + Done: Boolean; +begin + if Assigned(FOnPageSetup) then + begin + Done := True; + try + FOnPageSetup(Self, Done, @FPreviewBtnClicked, nil);//@FPrintBtnClicked); + except + Application.HandleException(Self); + end; + if Done then + begin + UpdatePrinterInfos; + CheckModified; + btnCancel.Caption := cxGetResourceString(@sdxBtnClose); + end; + if FPreviewBtnClicked then ModalResult := mrOK; + end; +end; + +procedure TdxfmPrintDialog.UpdatePrinters; +begin + RefreshPrinterList; + UpdatePrinterInfos; + if dxPrintDevice.Printers.Count > 0 then + dxPrintDevice.PrinterIndex := -1 + else + cbxPrinters.Enabled := False; + Invalidate; +end; + +procedure TdxfmPrintDialog.cbxPrintersDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +begin + with TComboBox(Control), TdxPrintDeviceInfo(Items.Objects[Index]) do + dxDrawPrinter(Canvas, Rect, Items[Index], ilPrinters, Ord(IsNetwork) + 2 * Ord(IsDefault)); +end; + +procedure TdxfmPrintDialog.chbxCollateClick(Sender: TObject); +begin + if FControlsUpdating then Exit; + FDialogData.Collate := TCheckBox(Sender).Checked; + pbxCollate.Invalidate; + CheckModified; +end; + +procedure TdxfmPrintDialog.btnPrinterPropertiesClick(Sender: TObject); +begin + if dxPrintDevice.Printing then + MessageWarning(cxGetResourceString(@sdxPrintDialogInPrintingState)) + else + DocumentPropertiesDlg; +end; + +procedure TdxfmPrintDialog.cbxPrintersChange(Sender: TObject); +var + PrevCursor: TCursor; +begin + if FControlsUpdating then Exit; + PrevCursor := Screen.Cursor; + Screen.Cursor := crHourGlass; + try + dxPrintDevice.PrinterIndex := TComboBox(Sender).ItemIndex; + finally + Screen.Cursor := PrevCursor; + end; + btnCancel.Caption := cxGetResourceString(@sdxBtnClose); + UpdatePrinterInfos; + CheckModified; +end; + +procedure TdxfmPrintDialog.chbxPrintToFileClick(Sender: TObject); +begin + if FControlsUpdating then Exit; + FDialogData.PrintToFile := TCheckBox(Sender).Checked; + if TCheckBox(Sender).Checked and (cbxFileName.Items.Count > 0) then + cbxFileName.ItemIndex := 0; + CheckModified; + if TCheckBox(Sender).Checked then ActiveControl := btnBrowse; +end; + +procedure TdxfmPrintDialog.edPageRangesChange(Sender: TObject); +begin + if FControlsUpdating then Exit; + if ActiveControl = Sender then rBtnPageRanges.Checked := True; + CheckModified; +end; + +procedure TdxfmPrintDialog.cbxNumberOfPagesChange(Sender: TObject); +begin + if FControlsUpdating then Exit; + FDialogData.PageNums := TdxPageNumbers(TComboBox(Sender).ItemIndex); + CheckModified; +end; + +procedure TdxfmPrintDialog.seCopiesChange(Sender: TObject); +begin + if FControlsUpdating then Exit; + CheckModified; +end; + +procedure TdxfmPrintDialog.seCopiesExit(Sender: TObject); +begin + FDialogData.Copies := TdxPSSpinEdit(Sender).AsInteger; +end; + +procedure TdxfmPrintDialog.rbtnPagesClick(Sender: TObject); +begin + if FControlsUpdating then Exit; + FDialogData.PageRanges := TdxPageRanges(TTagToInt(TRadioButton(Sender).Tag)); + CheckModified; + if Sender = rbtnPageRanges then + begin + if ActiveControl <> edPageRanges then + begin + ActiveControl := edPageRanges; + edPageRanges.SelectAll; + end; + end + else + begin + edPageRanges.Text := ''; + FwpPageRanges.State := False; + end; +end; + +procedure TdxfmPrintDialog.btnBrowseClick(Sender: TObject); +var + OpenDialog: TOpenDialog; +begin + OpenDialog := TOpenDialog.Create(nil); + try + with OpenDialog do + begin + Title := cxGetResourceString(@sdxPrintDialogOpenDlgTitle); + Filter := Format('%s (*.*)|*.*|%s (*.prn)|*.PRN', + [cxGetResourceString(@sdxPrintDialogOpenDlgAllFiles), + cxGetResourceString(@sdxPrintDialogOpenDlgPrinterFiles)]); + FilterIndex := 2; + DefaultExt := 'prn'; + FileName := cbxFileName.Text; + if Execute then + cbxFileName.Text := FileName; + end; + finally + OpenDialog.Free; + end; +end; + +procedure TdxfmPrintDialog.FormCloseQuery(Sender: TObject; var CanClose: Boolean); +begin + if ModalResult = mrOk then + begin + if FIsCheckUserInput then CanClose := CheckUserInput; + if CanClose then SavePrintDialogData; + end; +end; + +procedure TdxfmPrintDialog.cbxFileNameExit(Sender: TObject); +var + S: string; +begin + S := StringReplace(TComboBox(Sender).Text, ' ', '', [rfReplaceAll, rfIgnoreCase]); + FDialogData.FileName := GetFileName(S); +end; + +procedure TdxfmPrintDialog.edPageRangesExit(Sender: TObject); +var + b: Boolean; +begin + with TEdit(Sender) do + Text := StringReplace(Text, ' ', '', [rfReplaceAll, rfIgnoreCase]); + FDialogData.Pages := TEdit(Sender).Text; + if rbtnAllPages.Checked or rbtnCurrentPage.Checked or rbtnSelection.Checked or + (rbtnAllPages = ActiveControl) or (rbtnCurrentPage = ActiveControl) or + (rbtnSelection = ActiveControl) then + FwpPageRanges.State := False + else + begin + try + // order is very important because there is a possibility of rising exception in CheckPageRanges + b := CheckPageRanges or (FDialogData.MaxRange = -1); + if not b then + FwpPageRanges.Hint := Format(cxGetResourceString(@sdxPrintDialogPageNumbersOutOfRange), + [FDialogData.MinRange, FDialogData.MaxRange]); + except + b := False; + FwpPageRanges.Hint := Format(cxGetResourceString(@sdxPrintDialogInvalidPageRanges), [edPageRanges.Text]); + end; + if not b and not FwpPageRanges.State and (ActiveControl <> btnOK) and (ActiveControl <> btnCancel) then + Beep; + FwpPageRanges.State := not b; + end; +end; + +procedure TdxfmPrintDialog.edPageRangesKeyPress(Sender: TObject; var Key: Char); + + function IsValidKey(AKey: Char): Boolean; + begin + Result := AKey in ['0'..'9']; + if not Result and (Text <> '') then + Result := (AKey = cPageSeparator) or (AKey = cPageRangeSeparator) or (AKey = Char(VK_BACK)); + end; + +begin + if not IsValidKey(Key) then + begin + MessageBeep(MB_ICONHAND); + Key := #0; + end; +end; + +procedure TdxfmPrintDialog.btnPreviewClick(Sender: TObject); +begin + FPreviewBtnClicked := True; + ModalResult := mrCancel; // mrOK ??? +end; + +procedure TdxfmPrintDialog.ShowPrintStyles(AShow: Boolean); +begin + if pnlPrintStyles.Visible <> AShow then + begin + pnlPrintStyles.Visible := AShow; + btnPageSetup.Glyph := FGlyphs[not pnlPrintStyles.Visible]; + Height := Height + (-1 + 2 * Byte(pnlPrintStyles.Visible)) * pnlPrintStyles.Height; + end; +end; + +procedure TdxfmPrintDialog.btnPageSetupClick(Sender: TObject); +begin + if FDialogData.StyleManager <> nil then + ShowPrintStyles(not pnlPrintStyles.Visible) + else + DoPageSetup; +end; + +procedure TdxfmPrintDialog.lblNumberOfPagesClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; + TComboBox(ActiveControl).DroppedDown := True; +end; + +procedure TdxfmPrintDialog.lblNumberOfCopiesClick(Sender: TObject); +begin + TLabel(Sender).FocusControl.SetFocus; +end; + +procedure TdxfmPrintDialog.lblNameClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; + TComboBox(ActiveControl).DroppedDown := True; +end; + +procedure TdxfmPrintDialog.btnNetworkClick(Sender: TObject); +begin + Self.ConnectToPrinterDlg; + UpdateControlsState; +end; + +procedure TdxfmPrintDialog.lbxPrintStylesDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +begin + with TListBox(Control) do + dxPSDrawStyleItem(TBasedxPrintStyle(Items.Objects[Index]), TListBox(Control), + Index, State, Rect, True, False); +end; + +procedure TdxfmPrintDialog.lbxPrintStylesClick(Sender: TObject); +begin + with lbxPrintStyles do + FDialogData.StyleManager.CurrentStyle := TBasedxPrintStyle(Items.Objects[ItemIndex]); + btnCancel.Caption := cxGetResourceString(@sdxBtnClose); +end; + +procedure TdxfmPrintDialog.DefineStylesClick(Sender: TObject); +var + PrintBtnClicked: Boolean; +begin + FDialogData.StyleManager.DefinePrintStylesDlg(FPreviewBtnClicked, PrintBtnClicked); + btnCancel.Caption := cxGetResourceString(@sdxBtnClose); + if FPreviewBtnClicked then ModalResult := mrOK; +end; + +procedure TdxfmPrintDialog.PageSetup2Click(Sender: TObject); +var + Index: Integer; + Style: TBasedxPrintStyle; +begin + Index := lbxPrintStyles.ItemIndex; + if Index <> -1 then + begin + Style := TBasedxPrintStyle(lbxPrintStyles.Items.Objects[Index]); + if Style.PageSetup(0, True, True, FPreviewBtnClicked, FPrintBtnClicked) then + btnCancel.Caption := cxGetResourceString(@sdxBtnClose); + if FPreviewBtnClicked then ModalResult := mrOK; + end; +end; + +procedure TdxfmPrintDialog.pmPrintStylesPopup(Sender: TObject); +begin + miPageSetup.Enabled := btnPageSetup2.Enabled; +end; + +procedure TdxfmPrintDialog.SaveToRegistry(const APath: string); +begin + inherited; + if FDialogData.StyleManager <> nil then + with TRegistry.Create do + try + if OpenKey(APath, True) then + try + WriteBool(sdxMaximized, pnlPrintStyles.Visible); + except + on ERegistryException do + { ignore } + else + raise; + end; + finally + Free; + end; +end; + +procedure TdxfmPrintDialog.LoadFromRegistry(const APath: string); +begin + inherited; + with TRegistry.Create do + try + if OpenKey(APath, False) and ValueExists(sdxMaximized) then + try + FPrintStylesVisibled := ReadBool(sdxMaximized); + except + on ERegistryException do + { ignore } + else + raise; + end; + finally + Free; + end; +end; + +procedure TdxfmPrintDialog.pbxCollateDblClick(Sender: TObject); +begin + chbxCollate.Checked := not chbxCollate.Checked; +end; + +procedure TdxfmPrintDialog.pbxCollatePaint(Sender: TObject); +var + DC: HDC; + R: TRect; +begin + with TPaintBox(Sender) do + begin + DC := Canvas.Handle; + SelectObject(DC, Font.Handle); + SetTextColor(DC, GetSysColor(COLOR_WINDOWTEXT)); + R := ClientRect; + end; + SetBkMode(DC, TRANSPARENT); + DrawCollatedPages(DC, R, FDialogData.Collate); + SelectClipRgn(DC, 0); +end; + +function TdxfmPrintDialog.CheckFileName(const FileName: string): Boolean; +begin + Result := ValidateFileName(FileName) +end; + +procedure TdxfmPrintDialog.CheckModified; +begin + if not FModified then FModified := True; + UpdateControlsState; +end; + +function TdxfmPrintDialog.CheckPageRanges: Boolean; +var + PageIndexes: TIntegers; +begin + Result := MakePageIndexes(edPageRanges.Text, PageIndexes) and + (MinIntValue(PageIndexes) >= FDialogData.MinRange) and + (MaxIntValue(PageIndexes) <= FDialogData.MaxRange); +end; + +function TdxfmPrintDialog.CheckUserInput: Boolean; +var + FileName: string; + RealFileName: string; +begin + Result := True; + if chbxPrintToFile.Checked then + begin + FileName := cbxFileName.Text; + Result := Length(Filename) > 0; + if Result then + begin + if (Length(FileName) > 2) and (FileName[1] = '"') and (FileName[Length(FileName)] = '"') then + FileName := Copy(FileName, 2, Length(FileName) - 2); + Result := CheckFileName(Filename); + if Result then + begin + RealFileName := GetFileName(cbxFileName.Text); + Result := not FileExists(RealFileName); + if not Result then + Result := MessageQuestion(Format(cxGetResourceString(@sdxConfirmOverWrite), [RealFileName])) + end + else + MessageWarning(Format(cxGetResourceString(@sdxInvalidFileName), [FileName])); + end + else + MessageWarning(cxGetResourceString(@sdxRequiredFileName)); + if not Result then ActiveControl := cbxFileName; + Exit; + end; + if rBtnPageRanges.Checked then + begin + Result := Length(edPageRanges.Text) > 0; + if Result then + try + // Because there is possibility of exception raising in CheckPageRanges that order is very important + Result := CheckPageRanges or (FDialogData.MaxRange = -1); + if not Result then + MessageWarning(Format(cxGetResourceString(@sdxPrintDialogPageNumbersOutOfRange), + [FDialogData.MinRange, FDialogData.MaxRange])); + except + MessageWarning(Format(cxGetResourceString(@sdxPrintDialogInvalidPageRanges), [edPageRanges.Text])); + Result := False; + end + else + MessageWarning(cxGetResourceString(@sdxPrintDialogRequiredPageNumbers)); + if not Result then ActiveControl := edPageRanges; + end; +end; + +procedure TdxfmPrintDialog.ConnectToPrinterDlg; +begin + if dxConnectToNetPrinter(Self.Handle) then + begin + RefreshPrinterList; + cbxPrintersChange(cbxPrinters); + btnCancel.Caption := cxGetResourceString(@sdxBtnClose); + end; +end; + +procedure TdxfmPrintDialog.CreateControls; +begin + FseCopies := TdxPSSpinEdit.Create(Self); + with FseCopies do + begin + Parent := gbxCopies; + BoundsRect := bvlCopiesHolder.BoundsRect; + MinValue := 0; + MaxValue := MaxInt; + OnChange := seCopiesChange; + OnExit := seCopiesExit; + Flat := False; + TabOrder := cbxNumberOfPages.TabOrder + 1; + end; + lblNumberOfCopies.FocusControl := FseCopies; + + FwpPageRanges := TdxPSWarningPane.Create(Self); + FwpPageRanges.Parent := gbxPageRange; + FwpPageRanges.BoundsRect := bvlPRWarningHolder.BoundsRect; +end; + +procedure TdxfmPrintDialog.DocumentPropertiesDlg; +begin + dxPrintDevice.Copies := FseCopies.AsInteger; + dxPrintDevice.Collate := chbxCollate.Checked; + if dxDocumentProperties(Handle) then + begin + FseCopies.AsInteger := dxPrintDevice.Copies; + chbxCollate.Checked := dxPrintDevice.Collate; + UpdatePrinterInfos; + CheckModified; + btnCancel.Caption := cxGetResourceString(@sdxBtnClose); + end; +end; + +procedure TdxfmPrintDialog.DrawCollatedPages(DC: HDC; const ADrawRect: TRect; ACollate: Boolean); + + procedure DrawPages(const APageRect: TRect; const AOffsets: TPoint; + ADistance: Integer; ACollate: Boolean); + + procedure DrawPage(var R: TRect; const S: string); + var + Size: TSize; + begin + DrawEdge(DC, R, BDR_RAISEDOUTER, BF_LEFT or BF_TOP or BF_FLAT); + DrawEdge(DC, R, BDR_RAISEDOUTER, BF_RIGHT or BF_BOTTOM); + InflateRect(R, -1, -1); + + DrawEdge(DC, R, BDR_SUNKENINNER, BF_RIGHT or BF_BOTTOM); + Dec(R.Right); + Dec(R.Bottom); + FillRect(DC, R, GetSysColorBrush(COLOR_WINDOW)); + + Inc(R.Right); + Inc(R.Bottom); + InflateRect(R, 1, 1); + GetTextExtentPoint32(DC, PChar(S), Length(S), Size); + TextOut(DC, R.Right - Size.cX - 2, R.Bottom - Size.cY - 1, PChar(S), Length(S)); + with R do + ExcludeClipRect(DC, Left, Top, Right, Bottom); + end; + + procedure DrawPageColumn(var R: TRect; Index, Count: Integer); + var + I: Integer; + S: string; + begin + if not ACollate then + S := IntToStr(Index + 1); + for I := 0 to Count - 1 do + begin + if ACollate then + S := IntToStr(I + 1); + DrawPage(R, S); + OffsetRect(R, AOffsets.X, -AOffsets.Y); + end; + end; + + var + I, C: Integer; + R: TRect; + begin + C := 2 + Byte(ACollate); + for I := 0 to 2 - Byte(ACollate) do + begin + R := APageRect; + OffsetRect(R, I * ADistance, 0); + DrawPageColumn(R, I, C); + end; + end; + +const + PageWidth = 19; + PageHeight = 24; + Offsets: TPoint = (X: 10; Y: 8); +var + R: TRect; + W, H, Distance, ShiftX, ShiftY: Integer; +begin + R := Rect(0, 0, PageWidth, PageHeight); + W := ADrawRect.Right - ADrawRect.Left; + H := ADrawRect.Bottom - ADrawRect.Top; + ShiftX := ((W div (3 - Byte(ACollate))) - (PageWidth + Offsets.X * (1 + Byte(ACollate)))) div 2; + ShiftY := ((H - PageHeight + Offsets.Y * (1 + Byte(ACollate))) div 2); + OffsetRect(R, ShiftX, ShiftY); + Distance := W div (3 - Byte(ACollate)); + DrawPages(R, Offsets, Distance, ACollate); +end; + +function TdxfmPrintDialog.GetFileName(const S: string): string; +begin + if S <> '' then + if (S[1] = '"') and (S[Length(S)] = '"') then + Result := Copy(S, 2, Length(S) - 2) + else + Result := ChangeFileExt(S, '.prn') + else + Result := ''; +end; + +procedure TdxfmPrintDialog.LoadStrings; + + procedure AdjustControls; + + function CalculateLeftBound: Integer; + begin + Result := lblName.Width; + if Result < lblStatus.Width then + Result := lblStatus.Width; + if Result < lblType.Width then + Result := lblType.Width; + if Result < lblWhere.Width then + Result := lblWhere.Width; + if Result < lblComment.Width then + Result := lblComment.Width; + + Inc(Result, lblStatus.Left + 10); + end; + + var + LeftBound, RightBound: Integer; + begin + LeftBound := CalculateLeftBound; + + RightBound := cbxPrinters.Left + cbxPrinters.Width; + cbxPrinters.Left := LeftBound; + cbxPrinters.Width := RightBound - LeftBound; + + lStatus.Left := LeftBound; + lType.Left := LeftBound; + lWhere.Left := LeftBound; + lComment.Left := LeftBound; + end; + +var + Index: Integer; +begin + Caption := cxGetResourceString(@sdxPrintDialogCaption); + gbxPrinter.Caption := cxGetResourceString(@sdxPrintDialogPrinter); + + lblName.Caption := cxGetResourceString(@sdxPrintDialogName); + lblStatus.Caption := cxGetResourceString(@sdxPrintDialogStatus); + lblType.Caption := cxGetResourceString(@sdxPrintDialogType); + lblWhere.Caption := cxGetResourceString(@sdxPrintDialogWhere); + lblComment.Caption := cxGetResourceString(@sdxPrintDialogComment); + AdjustControls; + chbxPrintToFile.Caption := cxGetResourceString(@sdxPrintDialogPrintToFile); + + gbxPageRange.Caption := cxGetResourceString(@sdxPrintDialogPageRange); + rbtnAllPages.Caption := cxGetResourceString(@sdxPrintDialogAll); + rbtnCurrentPage.Caption := cxGetResourceString(@sdxPrintDialogCurrentPage); + rbtnSelection.Caption := cxGetResourceString(@sdxPrintDialogSelection); + rBtnPageRanges.Caption := cxGetResourceString(@sdxPrintDialogPages); + lblDescription.Caption := cxGetResourceString(@sdxPrintDialogRangeLegend); + gbxCopies.Caption := cxGetResourceString(@sdxPrintDialogCopies); + + lblNumberOfPages.Caption := cxGetResourceString(@sdxPrintDialogNumberOfPages); + Index := cbxNumberOfPages.ItemIndex; + with cbxNumberOfPages.Items do + begin + BeginUpdate; + try + Clear; + Add(cxGetResourceString(@sdxPrintDialogAllPages)); + Add(cxGetResourceString(@sdxPrintDialogEvenPages)); + Add(cxGetResourceString(@sdxPrintDialogOddPages)); + finally + EndUpdate; + end; + end; + cbxNumberOfPages.ItemIndex := Index; + + lblNumberOfCopies.Caption := cxGetResourceString(@sdxPrintDialogNumberOfCopies); + chbxCollate.Caption := cxGetResourceString(@sdxPrintDialogCollateCopies); + + btnPrinterProperties.Caption := cxGetResourceString(@sdxBtnProperties); + btnNetwork.Caption := cxGetResourceString(@sdxBtnNetwork); + btnBrowse.Caption := cxGetResourceString(@sdxBtnBrowse); + btnPageSetup.Caption := cxGetResourceString(@sdxBtnPageSetup); + btnPreview.Caption := cxGetResourceString(@sdxBtnPreview); + btnOK.Caption := DropEndEllipsis(cxGetResourceString(@sdxBtnPrint)); + btnCancel.Caption := cxGetResourceString(@sdxBtnCancel); + btnHelp.Caption := cxGetResourceString(@sdxBtnHelp); + + gbxPrintStyles.Caption := cxGetResourceString(@sdxPrintDialogPrintStyles); + btnPageSetup2.Caption := cxGetResourceString(@sdxBtnPageSetup); + btnDefineStyles.Caption := cxGetResourceString(@sdxBtnDefinePrintStyles); + miPageSetup.Caption := cxGetResourceString(@sdxBtnPageSetup); + miDefineStyles.Caption := cxGetResourceString(@sdxBtnDefinePrintStyles); +end; + +procedure TdxfmPrintDialog.RefreshPrinterList; +begin + with cbxPrinters do + begin + dxGetPrinterList(Items); + if Items.Count > 0 then + ItemIndex := dxPrintDevice.PrinterIndex; + end; +end; + +procedure TdxfmPrintDialog.RefreshStyleList; +var + I: Integer; + AStyle: TBasedxPrintStyle; +begin + with lbxPrintStyles do + begin + Items.BeginUpdate; + try + Items.Clear; + for I := 0 to FDialogData.StyleManager.Count - 1 do + begin + AStyle := FDialogData.StyleManager[I]; + Items.AddObject(AStyle.StyleCaption, AStyle); + end; + ItemIndex := Items.IndexOfObject(FDialogData.StyleManager.CurrentStyle); + finally + Items.EndUpdate; + end; + end; +end; + +procedure TdxfmPrintDialog.SavePrintDialogData; +var + Index: Integer; +begin + with FDialogData do + begin + Pages := StringReplace(edPageRanges.Text, ' ', '', [rfReplaceAll, rfIgnoreCase]); + FileName := GetFileName(Trim(cbxFileName.Text)); + if FileList <> nil then + begin + Index := FileList.IndexOf(FileName); + if Index = -1 then + FileList.Insert(0, FDialogData.FileName) + else + FileList.Exchange(0, Index); + end; + end; +end; + +procedure TdxfmPrintDialog.SetActiveControl; +begin + if FseCopies.CanFocus then + ActiveControl := FseCopies + else + if cbxNumberOfPages.CanFocus then + ActiveControl := cbxNumberOfPages + else + if btnOK.CanFocus then + ActiveControl := btnOK; +end; + +procedure TdxfmPrintDialog.SetupDialog(const APrintDlgData: TdxPrintDlgData); +begin +// FModified := False; + FControlsUpdating := True; + try + FSaveDialogData := APrintDlgData.DialogData; + FDialogData := FSaveDialogData; + + FIsCheckUserInput := APrintDlgData.IsCheckUserInput; + + with APrintDlgData do + begin + { visible } + btnPrinterProperties.Visible := pdbPrinterProperties in ButtonsVisible; + btnNetwork.Visible := (pdbNetwork in ButtonsVisible) and not IsWin95or98; + chbxPrintToFile.Visible := pdoPrintToFile in OptionsVisible; + cbxFileName.Visible := pdoPrintToFile in OptionsVisible; + btnBrowse.Visible := pdoPrintToFile in OptionsVisible; + + rbtnAllPages.Visible := pdoAllPages in OptionsVisible; + rbtnCurrentPage.Visible := pdoCurrentPage in OptionsVisible; + rbtnSelection.Visible := pdoSelection in OptionsVisible; + rbtnPageRanges.Visible := pdoPageRange in OptionsVisible; + lblDescription.Visible := rBtnPageRanges.Visible; + edPageRanges.Visible := pdoPageRange in OptionsVisible; + gbxPageRange.Visible := rbtnAllPages.Visible or rbtnCurrentPage.Visible or + rbtnSelection.Visible or rbtnPageRanges.Visible; + + btnPageSetup2.Visible := pdbPageSetup in ButtonsVisible; + btnDefineStyles.Visible := pdbDefineStyles in ButtonsVisible; + + btnPageSetup.Visible := pdbPageSetup in ButtonsVisible; + btnPreview.Visible := pdbPreview in ButtonsVisible; + btnHelp.Visible := pdbHelp in ButtonsVisible; + if btnPreview.Visible and not btnPageSetup.Visible then + btnPreview.BoundsRect := btnPageSetup.BoundsRect; + + if not (pdoPrintToFile in OptionsVisible) then + begin + pnlPrintToFile.Visible := False; + pnlTop.Height := pnlTop.Height - pnlPrintToFile.Height; + Height := Height - pnlPrintToFile.Height; + end; + if (DialogData.StyleManager = nil) or not (pdoPrintStyles in OptionsVisible) then + begin + pnlPrintStyles.Visible := False; + Height := Height - pnlPrintStyles.Height; + end; + + {enable} + if btnPrinterProperties.Visible then + btnPrinterProperties.Enabled := pdbPrinterProperties in ButtonsEnabled; + if btnNetwork.Visible then + btnNetwork.Enabled := dxPSUtl.IsNetworkPresent and (pdbNetwork in ButtonsEnabled); + if chbxPrintToFile.Visible then + chbxPrintToFile.Enabled := pdoPrintToFile in OptionsEnabled; + if cbxFileName.Visible then + begin + cbxFileName.Enabled := pdoPrintToFile in OptionsEnabled; + if DialogData.FileList <> nil then + cbxFileName.Items := DialogData.FileList; + cbxFileName.ItemIndex := 0; +// cbxFileName.Text := DialogData.FileName; + end; + if btnBrowse.Visible then + btnBrowse.Enabled := pdoPrintToFile in OptionsEnabled; + if rbtnAllPages.Visible then + rbtnAllPages.Enabled := pdoAllPages in OptionsEnabled; + if rbtnCurrentPage.Visible then + rbtnCurrentPage.Enabled := pdoCurrentPage in OptionsEnabled; + if rbtnSelection.Visible then + rbtnSelection.Enabled := pdoSelection in OptionsEnabled; + if rBtnPageRanges.Visible then + rBtnPageRanges.Enabled := pdoPageRange in OptionsEnabled; + if edPageRanges.Visible then + edPageRanges.Enabled := pdoPageRange in OptionsEnabled; + if lblDescription.Visible then + lblDescription.Enabled := rBtnPageRanges.Enabled; + if edPageRanges.Enabled and edPageRanges.Visible then + edPageRanges.Text := DialogData.Pages; + + if btnPageSetup.Visible then + btnPageSetup.Enabled := pdbPageSetup in ButtonsEnabled; + if btnPreview.Visible then + btnPreview.Enabled := pdbPreview in ButtonsEnabled; + if btnHelp.Visible then + btnHelp.Enabled := pdbHelp in ButtonsEnabled; + + Caption := Title; + + FOnClose := Events.OnClose; + FOnShow := Events.OnShow; + FOnPageSetup := Events.OnPageSetup; + end; + finally + UpdateControlsState; + FControlsUpdating := False; + end; +end; + +procedure TdxfmPrintDialog.StartSettings; +begin + FModified := False; + FControlsUpdating := True; + try + LoadStrings; + RefreshPrinterList; + + chbxPrintToFile.Checked := FDialogData.PrintToFile; + rbtnAllPages.Checked := FDialogData.PageRanges = prAll; + rbtnCurrentPage.Checked := FDialogData.PageRanges = prCurrent; + rbtnPageRanges.Checked := FDialogData.PageRanges = prRange; + rbtnSelection.Checked := FDialogData.PageRanges = prSelection; + edPageRanges.Text := FDialogData.Pages; + cbxNumberOfPages.ItemIndex := Integer(FDialogData.PageNums); + FseCopies.AsInteger := FDialogData.Copies; + chbxCollate.Checked := FDialogData.Collate; + if FDialogData.StyleManager <> nil then + begin + btnPageSetup.Caption := cxGetResourceString(@sdxBtnPrintStyles); + btnPageSetup.Glyph := FGlyphs[not pnlPrintStyles.Visible]; + end + else + if Assigned(FOnPageSetup) then + begin + btnPageSetup.Caption := cxGetResourceString(@sdxBtnPageSetup); + btnPageSetup.Glyph := nil; + end; + cbxPrinters.Enabled := cbxPrinters.Items.Count > 0; +// if cbxPrinters.Enabled then cbxPrinters.ItemIndex := 0; + if btnPrinterProperties.Visible and btnPrinterProperties.Enabled then + btnPrinterProperties.Enabled := cbxPrinters.Items.Count > 0; + + btnHelp.Visible := HelpContext <> 0; + if HelpContext = 0 then + begin + btnOK.BoundsRect := btnCancel.BoundsRect; + btnCancel.BoundsRect := btnHelp.BoundsRect; + end; + finally + UpdatePrinterInfos; + UpdateControlsState; + FControlsUpdating := False; + end; +end; + +procedure TdxfmPrintDialog.StyleListChanged(Sender: TObject); +begin + if Sender = FDialogData.StyleManager then + begin + RefreshStyleList; + UpdateControlsState; + end; +end; + +procedure TdxfmPrintDialog.UpdateControlsState; +begin + cbxFileName.Enabled := chbxPrintToFile.Enabled and chbxPrintToFile.Visible and chbxPrintToFile.Checked; + if chbxPrintToFile.Checked then + cbxFileName.Color := clWindow + else + cbxFileName.Color := clBtnFace; + btnBrowse.Enabled := cbxFileName.Enabled; + btnPageSetup2.Enabled := lbxPrintStyles.ItemIndex <> -1; + cbxPrinters.Enabled := dxPrintDevice.Printers.Count > 0; // 2.2 + if cbxPrinters.Items.Count > 0 then // 2.2 + cbxPrinters.ItemIndex := dxPrintDevice.PrinterIndex; // 2.2 + btnOK.Enabled := (dxPrintDevice.Printers.Count > 0) or chbxPrintToFile.Checked; +end; + +procedure TdxfmPrintDialog.UpdatePrinterInfos; +const + SizeReserved = 1000; +var + PBuffer: Pointer; {PPrinterInfo2} + PrinterInfo2: TPrinterInfo2; + Size: DWORD; + PrinterHandle: THandle; +begin + try + if WinSpool.OpenPrinter(dxPrintDevice.CurrentDevice, PrinterHandle, nil) then + try + WinSpool.GetPrinter(PrinterHandle, 2, nil, 0, @Size); + if Size > 0 then + begin + Inc(Size, SizeReserved); + PBuffer := dxAllocMem(Size); + if PBuffer <> nil then + try + if WinSpool.GetPrinter(PrinterHandle, 2, PBuffer, Size, @Size) then + begin + PrinterInfo2 := PPrinterInfo2(PBuffer)^; + + if PrinterInfo2.cJobs > 0 then + lStatus.Caption := Format(cxGetResourceString(@sdxPrintDialogPSPrintingAndWaiting), [PrinterInfo2.cJobs]) + else + lStatus.Caption := GetStatusString(PrinterInfo2.Status); + + if (dxPrintDevice.DeviceMode <> nil) and (PrinterInfo2.pDevMode <> nil) then + PrinterInfo2.pDevMode^ := dxPrintDevice.DeviceMode^; + + if PrinterInfo2.Status = 0 then + lStatus.Font.Color := Font.Color + else + lStatus.Font.Color := clHighlight; + + lType.Caption := StrPas(PrinterInfo2.pDriverName); + lWhere.Caption := StrPas(PrinterInfo2.pPortName); + lComment.Caption := StrPas(PrinterInfo2.pComment); + end; + finally + dxFreeMem(PBuffer, Size); + end; + end; + finally + ClosePrinter(PrinterHandle); + end; + FseCopies.MaxValue := dxPrintDevice.MaxCopies; + FseCopies.MinValue := 1; + except + Application.HandleException(Self); + end; +end; + +procedure TdxfmPrintDialog.CMDialogChar(var Message: TCMDialogChar); +begin + inherited; + if IsAccel(Message.CharCode, gbxPrintStyles.Caption) then + begin + ActiveControl := lbxPrintStyles; + Message.Result := 1; + end; +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxPrnPg.pas b/official/x.35/ExpressPrinting System/Sources/dxPrnPg.pas new file mode 100644 index 00000000..4d09bc20 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxPrnPg.pas @@ -0,0 +1,1687 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPrnPg; + +interface + +{$I cxVer.inc} + +uses + Classes, SysUtils, Windows, Controls, Graphics, Dialogs, CommDlg, Messages, + dxBase, dxPSGlbl, dxPSUtl, dxWrap, dxPrnDev, dxBkgnd; + +type + TdxHFPageType = (ptHeader, ptFooter); + TdxMeasurementUnits = (muDefault, muInches, muMillimeters); + TdxPageTitlePart = (tpLeft, tpCenter, tpRight); + TdxPageTitleParts = set of TdxPageTitlePart; + TdxScaleMode = (smAdjust, smFit); + TdxMarginType = (mtLeft, mtTop, mtRight, mtBottom, mtHeader, mtFooter); + TdxMarginTypes = set of TdxMarginType; + TdxPrinterPageUpdateCode = (ucMarginLeft, ucMarginTop, ucMarginRight, ucMarginBottom, + ucMarginHeader, ucMarginFooter, ucScale); + TdxPrinterPageUpdateCodes = set of TdxPrinterPageUpdateCode; + +const + mtAll: TdxMarginTypes = + [mtLeft, mtTop, mtRight, mtBottom, mtHeader, mtFooter]; + ucAll = [ucMarginLeft, ucMarginTop, ucMarginRight, ucMarginBottom, ucMarginHeader, ucMarginFooter, ucScale]; + ucMargins = [ucMarginLeft, ucMarginTop, ucMarginRight, ucMarginBottom, ucMarginHeader, ucMarginFooter]; + uaMarginsVert = [ucMarginLeft, ucMarginRight]; + uaMarginsHorz = [ucMarginTop, ucMarginBottom]; + + dxDefaultDMPaper = Windows.DMPAPER_FIRST; + dxDefaultPaperSource = Windows.DMBIN_AUTO; + +type + TdxPrinterPage = class; + + TdxPrinterPageObjectClass = class of TdxPrinterPageObject; + + TdxPrinterPageObject = class(TdxBaseObject) + private + FBackground: TdxBackground; + FPage: TdxPrinterPage; + procedure SetBackground(Value: TdxBackground); + protected + procedure DoAssign(Source: TdxBaseObject); override; + procedure LockUpdate(ALockState: TdxLockState); override; + + procedure Changed; dynamic; + + function CreateBackground: TdxBackground; virtual; + function GetBackgroundClass: TdxBackgroundClass; virtual; + procedure InitializeBackground(ABackground: TdxBackground); virtual; + + property Background: TdxBackground read FBackground write SetBackground; + property Page: TdxPrinterPage read FPage; + public + constructor Create; override; + destructor Destroy; override; + end; + + TCustomdxPageObjectClass = class of TCustomdxPageObject; + + TCustomdxPageObject = class(TdxPrinterPageObject) + private + FDefaultFont: TFont; + FFont: TFont; + FTextAlignY: array[TdxPageTitlePart] of TdxTextAlignY; + FTitles: array[TdxPageTitlePart] of TStrings; + function GetPartialTextAlignY(Index: Integer): TdxTextAlignY; + function GetPartialTitle(Index: Integer): TStrings; + function GetTextAlignY(Index: TdxPageTitlePart): TdxTextAlignY; + function GetTitle(Index: TdxPageTitlePart): TStrings; + function IsFontStored: Boolean; + procedure SetPartialTextAlignY(Index: Integer; Value: TdxTextAlignY); + procedure SetPartialTitle(Index: Integer; Value: TStrings); + procedure SetFont(Value: TFont); + procedure SetTextAlignY(Index: TdxPageTitlePart; Value: TdxTextAlignY); + procedure SetTitle(Index: TdxPageTitlePart; Value: TStrings); + + procedure FontChanged(Sender: TObject); + procedure TitleChanged(Sender: TObject); + + procedure FreeAndNilTitles; + protected + procedure DoAssign(Source: TdxBaseObject); override; + procedure InitializeDefaultFont(AFont: TFont); virtual; + function IsTitleStored(Index: Integer): Boolean; virtual; + public + constructor Create; override; + destructor Destroy; override; + + function DefaultFont: TFont; virtual; + + property CenterTextAlignY: TdxTextAlignY Index 1 read GetPartialTextAlignY write SetPartialTextAlignY default taCenterY; + property CenterTitle: TStrings Index 1 read GetPartialTitle write SetPartialTitle stored IsTitleStored; + property Font: TFont read FFont write SetFont stored IsFontStored; + property LeftTextAlignY: TdxTextAlignY Index 0 read GetPartialTextAlignY write SetPartialTextAlignY default taCenterY; + property LeftTitle: TStrings Index 0 read GetPartialTitle write SetPartialTitle stored IsTitleStored; + property Page; + property RightTextAlignY: TdxTextAlignY Index 2 read GetPartialTextAlignY write SetPartialTextAlignY default taCenterY; + property RightTitle: TStrings Index 2 read GetPartialTitle write SetPartialTitle stored IsTitleStored; + property TextAlignY[Index: TdxPageTitlePart]: TdxTextAlignY read GetTextAlignY write SetTextAlignY; + property Titles[Index: TdxPageTitlePart]: TStrings read GetTitle write SetTitle; default; + published + property Background; + end; + + TdxPageFooterClass = class of TdxPageFooter; + + TdxPageFooter = class(TCustomdxPageObject) + protected + function IsTitleStored(Index: Integer): Boolean; override; + published + property CenterTextAlignY; + property CenterTitle; + property Font; + property LeftTextAlignY; + property LeftTitle; + property RightTextAlignY; + property RightTitle; + end; + + TdxPageHeaderClass = class of TdxPageHeader; + + TdxPageHeader = class(TCustomdxPageObject) + protected + function IsTitleStored(Index: Integer): Boolean; override; + published + property CenterTextAlignY; + property CenterTitle; + property Font; + property LeftTextAlignY; + property LeftTitle; + property RightTextAlignY; + property RightTitle; + end; + + TdxPrinterPageClass = class of TdxPrinterPage; + + TdxPrinterPage = class(TdxPrinterPageObject) + private + FAssigning: Boolean; + FAutoSwapMargins: Boolean; + FCenterOnPageH: Boolean; + FCenterOnPageV: Boolean; + FDMPaper: Integer; + FFitToPagesByTall: Integer; + FFitToPagesByWide: Integer; + FGrayShading: Boolean; + FHFG: TdxRectWrapper; + FLastMU: TdxMeasurementUnits; + FMargins: TdxRectWrapper; + FMeasurementUnits: TdxMeasurementUnits; + FMinMargins: TdxRectWrapper; + FOrientation: TdxPrinterOrientation; + FPageFooter: TdxPageFooter; + FPageHeader: TdxPageHeader; + FPageOrder: TdxPageOrder; + FPageSize: TdxPointWrapper; + FPageSizeLocked: Boolean; + FPaperSource: Integer; + FReverseTitlesOnEvenPages: Boolean; + FScaleFactor: Integer; + FScaleMode: TdxScaleMode; + FOnChange: TNotifyEvent; + FOnMarginChange: TNotifyEvent; + function GetCanSwapMargins: Boolean; + function GetHFG(index: Integer): Integer; + function GetRealMeasurementUnits: TdxMeasurementUnits; + function GetRealPageSize: TPoint; + function GetRestPageSizeX: Integer; + function GetRestPageSizeY: Integer; + function IsMinMarginsStored: Boolean; + function IsPageSizeStored: Boolean; + procedure SetDMPaper(Value: Integer); + procedure SetFitToPagesByTall(Value: Integer); + procedure SetFitToPagesByWide(Value: Integer); + procedure SetHFG(index: Integer; Value: Integer); + procedure SetMargins(Value: TdxRectWrapper); + procedure SetMeasurementUnits(Value: TdxMeasurementUnits); + procedure SetMinMargins(Value: TdxRectWrapper); + procedure SetOrientation(Value: TdxPrinterOrientation); + procedure SetPageFooter(Value: TdxPageFooter); + procedure SetPageHeader(Value: TdxPageHeader); + procedure SetPageSize(Value: TdxPointWrapper); + procedure SetPaperSource(Value: Integer); + procedure SetRealPageSize(const Value: TPoint); + procedure SetScaleFactor(Value: Integer); + + procedure HFGChanged(Sender: TObject; ASides: TdxRectSides); + procedure HFGChanging(Sender: TObject; ASides: TdxRectSides; var Values: array of Integer); + procedure LockUpdated(Sender: TdxBaseObject; ALockState: TdxLockState); + procedure MarginsChanged(Sender: TObject; ASides: TdxRectSides); + procedure MarginsChanging(Sender: TObject; ASides: TdxRectSides; var Values: array of Integer); + procedure MinMarginsChanged(Sender: TObject; ASides: TdxRectSides); + procedure MinMarginsChanging(Sender: TObject; ASides: TdxRectSides; var Values: array of Integer); + procedure PageSizeChanged(Sender: TObject; ACoords: TdxPointCoords); + procedure PageSizeChanging(Sender: TObject; ACoords: TdxPointCoords; var Values: array of Integer); + + procedure ReadLastMU(Reader: TReader); + procedure ReadMU(Reader: TReader); + procedure WriteLastMU(Writer: TWriter); + procedure WriteMU(Writer: TWriter); + + procedure DoSwapMargins; + procedure FindDMPaperByPageSize; + procedure FixMargins; + procedure FixMinMargins; + function IsLoading: Boolean; + procedure SetPaperSizeByDMPaper; + protected + constructor CreateInstance(Dummy: Integer = 0); + procedure DefineProperties(Filer: TFiler); override; + + procedure Changed; override; + procedure DoAssign(Source: TdxBaseObject); override; + function GetSupportsScaling: Boolean; virtual; + function IsDefaultDMPaperSelected: Boolean; + function IsPageFooterTitleStored(Index: Integer): Boolean; virtual; + function IsPageHeaderTitleStored(Index: Integer): Boolean; virtual; + procedure MarginChanged; dynamic; + procedure PageParamsChanged(AUpdateCodes: TdxPrinterPageUpdateCodes); virtual; + + function CreatePageFooter: TdxPageFooter; virtual; + function GetPageFooterClass: TdxPageFooterClass; virtual; + procedure InitializePageFooter(APageFooter: TdxPageFooter); virtual; + + function CreatePageHeader: TdxPageHeader; virtual; + function GetPageHeaderClass: TdxPageHeaderClass; virtual; + procedure InitializePageHeader(APageHeader: TdxPageHeader); virtual; + + procedure DoUpdateMeasurementUnits; + procedure ReadPrinterInfos; + procedure SynchronizeMeasurementUnits; + + property CanSwapMargins: Boolean read GetCanSwapMargins; + property RestPageSizeX: Integer read GetRestPageSizeX; + property RestPageSizeY: Integer read GetRestPageSizeY; + property SupportsScaling: Boolean read GetSupportsScaling; + public + constructor Create; override; + destructor Destroy; override; + function GetNamePath: string; override; + + procedure ApplyToPrintDevice; + procedure InitFromPrintDevice; + procedure FixMarginsOutside; + function GetInnerMeasurementUnits: TdxMeasurementUnits; + procedure GetRealMinMargins(var AMinLeft, AMinRight, AMinTop, AMinBottom: Integer); + function IsEqual(ABaseObject: TdxBaseObject): Boolean; override; + procedure RestoreDefaults; + + procedure MapRect2LoMetric(var R: TRect); + function FooterLoMetric: Integer; + function FooterRect: TRect; + function FooterRectLoMetric: TRect; + function HeaderLoMetric: Integer; + function HeaderRect: TRect; + function HeaderRectLoMetric: TRect; + function MarginsLoMetric: TRect; + function MinMarginsLoMetric: TRect; + function MinPrintableArea: Integer; + function MinPrintableAreaLoMetric: Integer; + function PageSizeLoMetric: TPoint; + function PageSizePixels: TPoint; + function PaintRectLoMetric: TRect; + function PaintRectPixels: TRect; + function RealPageSizeLoMetric: TPoint; + function RealPageSizePixels: TPoint; + function ValidateMargins: Boolean; + + property RealMeasurementUnits: TdxMeasurementUnits read GetRealMeasurementUnits; + property RealPageSize: TPoint read GetRealPageSize write SetRealPageSize; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + property OnMarginChange: TNotifyEvent read FOnMarginChange write FOnMarginChange; + published + property AutoSwapMargins: Boolean read FAutoSwapMargins write FAutoSwapMargins default True; + property Background; + property CenterOnPageH: Boolean read FCenterOnPageH write FCenterOnPageH default False; + property CenterOnPageV: Boolean read FCenterOnPageV write FCenterOnPageV default False; + property DMPaper: Integer read FDMPaper write SetDMPaper{ default dxDefaultDMPaper}; { DMPAPER_FIRST = DMPAPER_LETTER } + property FitToPagesByTall: Integer read FFitToPagesByTall write SetFitToPagesByTall default 1; + property FitToPagesByWide: Integer read FFitToPagesByWide write SetFitToPagesByWide default 1; + property Footer: Integer index 3 read GetHFG write SetHFG default 0; + property GrayShading: Boolean read FGrayShading write FGrayShading default False; + property Header: Integer index 1 read GetHFG write SetHFG default 0; + property Margins: TdxRectWrapper read FMargins write SetMargins; + property MeasurementUnits: TdxMeasurementUnits read FMeasurementUnits write SetMeasurementUnits stored False default muDefault; + property MinMargins: TdxRectWrapper read FMinMargins write SetMinMargins stored IsMinMarginsStored; + property Orientation: TdxPrinterOrientation read FOrientation write SetOrientation default poPortrait; + property PageFooter: TdxPageFooter read FPageFooter write SetPageFooter; + property PageHeader: TdxPageHeader read FPageHeader write SetPageHeader; + property PageOrder: TdxPageOrder read FPageOrder write FPageOrder default poOverThenDown; + property PageSize: TdxPointWrapper read FPageSize write SetPageSize stored IsPageSizeStored; + property PaperSource: Integer read FPaperSource write SetPaperSource default dxDefaultPaperSource; { DMBIN_AUTO = 7 } + property ReverseTitlesOnEvenPages: Boolean read FReverseTitlesOnEvenPages write FReverseTitlesOnEvenPages default False; + property ScaleFactor: Integer read FScaleFactor write SetScaleFactor default 100; + property ScaleMode: TdxScaleMode read FScaleMode write FScaleMode default smAdjust; + end; + +function DefaultPrinterPage: TdxPrinterPage; +function GetDefaultMeasurementUnits: TdxMeasurementUnits; +procedure RereadDefaultPrinterPage; + +const + dxPSPageTitlePartMap: array[0..2] of TdxPageTitlePart = (tpLeft, tpCenter, tpRight); + dxPSDefaltHFFontColor = clBlack; + dxPSDefaltHFFontName = 'Tahoma'; + dxPSDefaltHFFontSize = 8; + dxPSDefaltHFFontStyle = []; + + dxDefaultHFFont = dxPSDefaltHFFontName; // for backward compatibility + +implementation + +uses + Forms, dxPPAttr; + +const + dxMinScaleFactor = 10; + dxMaxScaleFactor = 500; + +var + FDefaultPrinterPage: TdxPrinterPage = nil; + +function DefaultPrinterPage: TdxPrinterPage; +begin + if FDefaultPrinterPage = nil then + FDefaultPrinterPage := TdxPrinterPage.CreateInstance(0); + Result := FDefaultPrinterPage; +end; + +procedure RereadDefaultPrinterPage; +begin + DefaultPrinterPage.ReadPrinterInfos; +end; + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} +{$ENDIF} + +function GetDefaultMeasurementUnits: TdxMeasurementUnits; +const + MeasurementUintsMap: array[Boolean] of TdxMeasurementUnits = (muInches, muMillimeters); +begin + Result := MeasurementUintsMap[GetLocaleChar(LOCALE_USER_DEFAULT, LOCALE_IMEASURE, '0') = '0']; +end; + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM ON} +{$ENDIF} + +function MMToInch(Value: Integer): Integer; +begin + Result := MulDiv(Value, 10, 254); + Result := 100 * Round(Result / 100); // PS 3.01 +end; + +function InchToMM(Value: Integer): Integer; +begin + Result := MulDiv(Value, 254, 10); + Result := 10 * Round(Result / 10); // PS 3.01 +end; + +function Pt_MMToInch(const Value: TPoint): TPoint; +begin + Result.X := MMToInch(Value.X); + Result.Y := MMToInch(Value.Y); +end; + +function Pt_InchToMM(const Value: TPoint): TPoint; +begin + Result.X := InchToMM(Value.X); + Result.Y := InchToMM(Value.Y); +end; + +function Rect_MMToInch(const Value: TRect): TRect; +begin + Result.Left := MMToInch(Value.Left); + Result.Right := MMToInch(Value.Right); + Result.Bottom := MMToInch(Value.Bottom); + Result.Top := MMToInch(Value.Top); +end; + +function Rect_InchToMM(const Value: TRect): TRect; +begin + Result.Left := InchToMM(Value.Left); + Result.Top := InchToMM(Value.Top); + Result.Right := InchToMM(Value.Right); + Result.Bottom := InchToMM(Value.Bottom); +end; + +procedure GetDefaultPageInfo(out AMargins: TRect; out AHeader, AFooter: Integer; + out APageSize: TPoint; out ADMPaper: Integer; out AOrientation: TdxPrinterOrientation); +var + Index: Integer; +begin + AOrientation := poPortrait; + + ADMPaper := dxPrnDev.dxGetDefaultDMPaper; + Index := dxPPAttr.Papers.FindByDMPaper(ADMPaper); + if Index = -1 then + begin + ADMPaper := dxDefaultDMPaper; + Index := dxPPAttr.Papers.FindByDMPaper(ADMPaper); + end; + + AMargins := dxDefaultInitialMargins; + AHeader := dxDefaultInitialHeader; + AFooter := dxDefaultInitialFooter; + APageSize.X := 100 * dxPPAttr.Papers[Index].Size.X; + APageSize.Y := 100 * dxPPAttr.Papers[Index].Size.Y; + + if GetDefaultMeasurementUnits = muInches then + begin + AMargins := Rect_MMToInch(AMargins); + AHeader := MMToInch(AHeader); + AFooter := MMToInch(AFooter); + APageSize.X := MulDiv(APageSize.X, 10, 254); + APageSize.Y := MulDiv(APageSize.Y, 10, 254); + end; +end; + +type + TdxPageBackground = class(TdxBackground) + private + FPageObject: TdxPrinterPageObject; + protected + procedure DoChange(AChangeWhats: TdxBackgroundParams); override; + public + property PageObject: TdxPrinterPageObject read FPageObject; + end; + +procedure TdxPageBackground.DoChange(AChangeWhats: TdxBackgroundParams); +begin + inherited; + if PageObject <> nil then PageObject.Changed; +end; + +{ TdxPrinterPageObject } + +constructor TdxPrinterPageObject.Create; +begin + inherited; + FBackground := CreateBackground; +end; + +destructor TdxPrinterPageObject.Destroy; +begin + FreeAndNil(FBackground); + inherited; +end; + +procedure TdxPrinterPageObject.DoAssign(Source: TdxBaseObject); +begin + inherited; + Background := TdxPrinterPageObject(Source).Background; +end; + +procedure TdxPrinterPageObject.LockUpdate(ALockState: TdxLockState); +begin + inherited; + if ALockState = lsUnLock then Changed; +end; + +procedure TdxPrinterPageObject.Changed; +begin + if (UpdateCount = 0) and (Page <> nil) then Page.Changed; +end; + +function TdxPrinterPageObject.CreateBackground: TdxBackground; +begin + Result := GetBackgroundClass.Create; + InitializeBackground(Result); +end; + +function TdxPrinterPageObject.GetBackgroundClass: TdxBackgroundClass; +begin + Result := TdxPageBackground; +end; + +procedure TdxPrinterPageObject.InitializeBackground(ABackground: TdxBackground); +begin + TdxPageBackground(ABackground).FPageObject := Self; +end; + +procedure TdxPrinterPageObject.SetBackground(Value: TdxBackground); +begin + Background.Assign(Value); +end; + +{ TCustomdxPageObject } + +constructor TCustomdxPageObject.Create; +var + I: TdxPageTitlePart; +begin + inherited; + for I := Low(TdxPageTitlePart) to High(TdxPageTitlePart) do + begin + FTitles[I] := TStringList.Create; + TStringList(FTitles[I]).OnChange := TitleChanged; + FTextAlignY[I] := taCenterY; + end; + FFont := TFont.Create; + FFont.Assign(DefaultFont); + FFont.OnChange := FontChanged; +end; + +destructor TCustomdxPageObject.Destroy; +begin + FreeAndNilTitles; + FreeAndNil(FFont); + FreeAndNil(FDefaultFont); + inherited; +end; + +function TCustomdxPageObject.DefaultFont: TFont; +begin + if FDefaultFont = nil then + begin + FDefaultFont := TFont.Create; + InitializeDefaultFont(FDefaultFont); + end; + Result := FDefaultFont; +end; + +procedure TCustomdxPageObject.DoAssign(Source: TdxBaseObject); +var + I: TdxPageTitlePart; +begin + inherited; + with TCustomdxPageObject(Source) do + begin + for I := Low(TdxPageTitlePart) to High(TdxPageTitlePart) do + begin + Self.Titles[I] := Titles[I]; + Self.FTextAlignY[I] := FTextAlignY[I]; + end; + Self.Font := Font; + end; +end; + +procedure TCustomdxPageObject.InitializeDefaultFont(AFont: TFont); +begin + AFont.Color := dxPSDefaltHFFontColor; + AFont.Name := dxPSDefaltHFFontName; + AFont.Size := dxPSDefaltHFFontSize; + AFont.Style := dxPSDefaltHFFontStyle; +end; + +function TCustomdxPageObject.IsTitleStored(Index: Integer): Boolean; +begin + Result := True; +end; + +function TCustomdxPageObject.GetPartialTextAlignY(Index: Integer): TdxTextAlignY; +begin + Result := TextAlignY[TdxPageTitlePart(Index)]; +end; + +function TCustomdxPageObject.GetPartialTitle(Index: Integer): TStrings; +begin + Result := Titles[TdxPageTitlePart(Index)]; +end; + +function TCustomdxPageObject.GetTextAlignY(Index: TdxPageTitlePart): TdxTextAlignY; +begin + Result := FTextAlignY[Index]; +end; + +function TCustomdxPageObject.GetTitle(Index: TdxPageTitlePart): TStrings; +begin + Result := FTitles[Index]; +end; + +function TCustomdxPageObject.IsFontStored: Boolean; +begin + Result := not dxPSUtl.dxAreFontsEqual(Font, DefaultFont); +end; + +procedure TCustomdxPageObject.SetFont(Value: TFont); +begin + Font.Assign(Value); +end; + +procedure TCustomdxPageObject.SetPartialTextAlignY(Index: Integer; Value: TdxTextAlignY); +begin + TextAlignY[TdxPageTitlePart(Index)] := Value; +end; + +procedure TCustomdxPageObject.SetPartialTitle(Index: Integer; Value: TStrings); +begin + Titles[TdxPageTitlePart(Index)] := Value; +end; + +procedure TCustomdxPageObject.SetTextAlignY(Index: TdxPageTitlePart; Value: TdxTextAlignY); +begin + if FTextAlignY[Index] <> Value then + begin + FTextAlignY[Index] := Value; + Changed; + end; +end; + +procedure TCustomdxPageObject.SetTitle(Index: TdxPageTitlePart; Value: TStrings); +begin + Titles[Index].Assign(Value); +end; + +procedure TCustomdxPageObject.FontChanged(Sender: TObject); +begin + Changed; +end; + +procedure TCustomdxPageObject.TitleChanged(Sender: TObject); +begin + Changed; +end; + +procedure TCustomdxPageObject.FreeAndNilTitles; +var + I: TdxPageTitlePart; +begin + for I := Low(TdxPageTitlePart) to High(TdxPageTitlePart) do + FreeAndNil(FTitles[I]); +end; + +{ TdxPageFooter } + +function TdxPageFooter.IsTitleStored(Index: Integer): Boolean; +begin + if Page <> nil then + Result := Page.IsPageFooterTitleStored(Index) + else + Result := inherited IsTitleStored(Index); +end; + +{ TdxPageHooter } + +function TdxPageHeader.IsTitleStored(Index: Integer): Boolean; +begin + if Page <> nil then + Result := Page.IsPageHeaderTitleStored(Index) + else + Result := inherited IsTitleStored(Index); +end; + +{ TdxPrinterPage } + +constructor TdxPrinterPage.Create; +begin + CreateInstance(0); + if FDefaultPrinterPage = nil then RereadDefaultPrinterPage; + RestoreDefaults; + + OnLockUpdate := LockUpdated; + FMargins.OnChanged := MarginsChanged; + FMargins.OnChanging := MarginsChanging; + FHFG.OnChanging := HFGChanging; + FHFG.OnChanged := HFGChanged; + FMinMargins.OnChanging := MinMarginsChanging; + FMinMargins.OnChanged := MinMarginsChanged; + FPageSize.OnChanging := PageSizeChanging; + FPageSize.OnChanged := PageSizeChanged; +end; + +destructor TdxPrinterPage.Destroy; +begin + FreeAndNil(FMargins); + FreeAndNil(FMinMargins); + FreeAndNil(FHFG); + FreeAndNil(FPageSize); + FreeAndNil(FPageHeader); + FreeAndNil(FPageFooter); + inherited; +end; + +function TdxPrinterPage.GetNamePath: string; +begin + Result := ClassName; +end; + +procedure TdxPrinterPage.ApplyToPrintDevice; +begin + if dxPrnDev.dxInitPrintDevice(False) then + begin + dxPrnDev.dxPrintDevice.ColorMode := not GrayShading; + dxPrnDev.dxPrintDevice.Orientation := Orientation; + dxPrnDev.dxPrintDevice.SelectPaper(DMPaper); + if DMPaper >= DMPAPER_USER then + with TdxPaperInfo(dxPrnDev.dxPrintDevice.Papers.Objects[dxPrnDev.dxPrintDevice.PaperIndex]) do + begin + Width := PageSizeLoMetric.X; + Height := PageSizeLoMetric.Y; + end; + dxPrnDev.dxPrintDevice.SelectBin(PaperSource); + end; +end; + +procedure TdxPrinterPage.InitFromPrintDevice; +begin + GrayShading := not Boolean(dxPrnDev.dxPrintDevice.ColorMode); + Orientation := dxPrnDev.dxPrintDevice.Orientation; +end; + +procedure TdxPrinterPage.FixMarginsOutside; +var + AMinLeft, AMinRight, AMinTop, AMinBottom: Integer; +begin + GetRealMinMargins(AMinLeft, AMinRight, AMinTop, AMinBottom); + BeginUpdate; + try + if Header < AMinTop then + Header := AMinTop; + if Footer < AMinBottom then + Footer := AMinBottom; + if Margins.Left < AMinLeft then + Margins.Left := AMinLeft; + if Margins.Right < AMinRight then + Margins.Right := AMinRight; + FixMargins; + finally + EndUpdate; + end; +end; + +function TdxPrinterPage.GetInnerMeasurementUnits: TdxMeasurementUnits; +begin + if MeasurementUnits = muDefault then + Result := GetDefaultMeasurementUnits + else + Result := MeasurementUnits; +end; + +procedure TdxPrinterPage.GetRealMinMargins(var AMinLeft, AMinRight, AMinTop, AMinBottom: Integer); +begin + AMinLeft := 0; + AMinRight := 0; + AMinTop := 0; + AMinBottom := 0; + if dxInitPrintDevice(False) then + begin + AMinLeft := + MulDiv(dxPrintDevice.PhysOffsetX, 1000, GetDeviceCaps(dxPrintDevice.Handle, LOGPIXELSX)); + AMinTop := + MulDiv(dxPrintDevice.PhysOffsetY, 1000, GetDeviceCaps(dxPrintDevice.Handle, LOGPIXELSY)); + case Page.GetInnerMeasurementUnits of + muInches:; + muMillimeters: + begin + AMinLeft := MulDiv(AMinLeft, 254, 10); + AMinTop := MulDiv(AMinTop, 254, 10); + end; + end; + AMinRight := AMinLeft; + AMinBottom := AMinTop; + end; + if MinMargins.Left > AMinLeft then + AMinLeft := MinMargins.Left; + if MinMargins.Right > AMinRight then + AMinRight := MinMargins.Right; + if MinMargins.Top > AMinTop then + AMinTop := MinMargins.Top; + if MinMargins.Bottom > AMinBottom then + AMinBottom := MinMargins.Bottom; +end; + +function TdxPrinterPage.IsEqual(ABaseObject: TdxBaseObject): Boolean; +begin + Result := inherited IsEqual(ABaseObject) and + FBackground.IsEqual(TdxPrinterPage(ABaseObject).Background) and + (CenterOnPageH = TdxPrinterPage(ABaseObject).CenterOnPageH) and + (CenterOnPageV = TdxPrinterPage(ABaseObject).CenterOnPageV) and + (PageOrder = TdxPrinterPage(ABaseObject).PageOrder) and + (GrayShading = TdxPrinterPage(ABaseObject).GrayShading) and + (ScaleFactor = TdxPrinterPage(ABaseObject).ScaleFactor) and + (ReverseTitlesOnEvenPages = TdxPrinterPage(ABaseObject).ReverseTitlesOnEvenPages) and + FMargins.IsEqual(TdxPrinterPage(ABaseObject).Margins.Rect) and + FMinMargins.IsEqual(TdxPrinterPage(ABaseObject).MinMargins.Rect) and + PageSize.IsEqual(TdxPrinterPage(ABaseObject).PageSize.Point) and + (MeasurementUnits = TdxPrinterPage(ABaseObject).MeasurementUnits) and + (Orientation = TdxPrinterPage(ABaseObject).Orientation) and + (DMPaper = TdxPrinterPage(ABaseObject).DMPaper) and + (PaperSource = TdxPrinterPage(ABaseObject).PaperSource) and + PageHeader.IsEqual(TdxPrinterPage(ABaseObject).PageHeader) and + PageFooter.IsEqual(TdxPrinterPage(ABaseObject).PageFooter) and + FHFG.IsEqual(TdxPrinterPage(ABaseObject).FHFG.Rect); +end; + +procedure TdxPrinterPage.RestoreDefaults; +begin + if (Self <> FDefaultPrinterPage) and (FDefaultPrinterPage <> nil) then + Assign(DefaultPrinterPage); +end; + +procedure TdxPrinterPage.MapRect2LoMetric(var R: TRect); +begin + case GetInnerMeasurementUnits of + muInches: + R := dxPSUtl.ScaleRect(Rect_InchToMM(R), 1, 100, 1, 100); + muMillimeters: + R := dxPSUtl.ScaleRect(R, 1, 100, 1, 100); + end; +end; + +function TdxPrinterPage.FooterLoMetric: Integer; +begin + case GetInnerMeasurementUnits of + muInches: + Result := MulDiv(InchToMM(Footer), 1, 100); + else {muMillimeters} + Result := MulDiv(Footer, 1, 100); + end; +end; + +function TdxPrinterPage.FooterRect: TRect; +begin + Result := Rect(Margins.Left, RealPageSize.Y - Margins.Bottom, + RealPageSize.X - Margins.Right, RealPageSize.Y - Footer); +end; + +function TdxPrinterPage.FooterRectLoMetric: TRect; +begin + Result := FooterRect; + MapRect2LoMetric(Result); +end; + +function TdxPrinterPage.HeaderLoMetric: Integer; +begin + case GetInnerMeasurementUnits of + muInches: + Result := MulDiv(InchToMM(Header), 1, 100); + else {muMillimeters} + Result := MulDiv(Header, 1, 100); + end; +end; + +function TdxPrinterPage.HeaderRect: TRect; +begin + Result := Rect(Margins.Left, Header, RealPageSize.X - Margins.Right, Margins.Top); +end; + +function TdxPrinterPage.HeaderRectLoMetric: TRect; +begin + Result := HeaderRect; + MapRect2LoMetric(Result); +end; + +function TdxPrinterPage.MarginsLoMetric: TRect; +begin + case GetInnerMeasurementUnits of + muInches: + Result := ScaleRect(Rect_InchToMM(Margins.Rect), 1, 100, 1, 100); + else {muMillimeters} + Result := ScaleRect(Margins.Rect, 1, 100, 1, 100); + end; +end; + +function TdxPrinterPage.MinMarginsLoMetric: TRect; +begin + case GetInnerMeasurementUnits of + muInches: + Result := ScaleRect(Rect_InchToMM(MinMargins.Rect), 1, 100, 1, 100); + else {muMillimeters} + Result := ScaleRect(MinMargins.Rect, 1, 100, 1, 100); + end; +end; + +function TdxPrinterPage.MinPrintableArea: Integer; +begin + Result := dxDefaultMinPrintableArea; + case GetInnerMeasurementUnits of + muInches: + Result := MMToInch(Result); + end; +end; + +function TdxPrinterPage.MinPrintableAreaLoMetric: Integer; +begin + Result := MulDiv(dxDefaultMinPrintableArea, 1, 100); +end; + +function TdxPrinterPage.PageSizeLoMetric: TPoint; +begin + case GetInnerMeasurementUnits of + muInches: + Result := ScalePoint(Pt_InchToMM(PageSize.Point), 1, 100); + else {muMillimeters} + Result := ScalePoint(PageSize.Point, 1, 100); + end; +end; + +function TdxPrinterPage.PageSizePixels: TPoint; +begin + Result := ScalePoint(RealPageSizeLoMetric, Screen.PixelsPerInch, 254); +end; + +function TdxPrinterPage.PaintRectLoMetric: TRect; +var + Margins: TRect; + PageSize: TPoint; +begin + Margins := MarginsLoMetric; + PageSize := RealPageSizeLoMetric; + with Result do + begin + Left := Margins.Left; + Top := Margins.Top; + Right := PageSize.X - Margins.Right; + Bottom := PageSize.Y - Margins.Bottom; + if (Right < Left) or (Bottom < Top) then + begin + Self.Margins.Empty; + Result := Rect(0, 0, PageSize.X, PageSize.Y); + end; + end; +end; + +function TdxPrinterPage.PaintRectPixels: TRect; +begin + Result := ScaleRect(PaintRectLoMetric, Screen.PixelsPerInch, 254, Screen.PixelsPerInch, 254); +end; + +function TdxPrinterPage.RealPageSizeLoMetric: TPoint; +var + V: Integer; +begin + Result := PageSizeLoMetric; + if Orientation = poLandscape then + with Result do + begin + V := X; + X := Y; + Y := V; + end; +end; + +function TdxPrinterPage.RealPageSizePixels: TPoint; +var + V: Integer; +begin + Result := PageSizePixels; + if Orientation = poLandscape then + with Result do + begin + V := X; + X := Y; + Y := V; + end; +end; + +function TdxPrinterPage.ValidateMargins: Boolean; +var + OffsetX, OffsetY: Integer; +begin + // PS v3.01: Don't ask a Printer until it's not initialized outside, for instance, first printout from PS + + if dxPrnDev.dxIsPrintDeviceInitialized and (dxPrintDevice.PrinterCount > 0) then + with dxPrintDevice do + begin + OffsetX := MulDiv(PhysOffsetX, 254, GetDeviceCaps(Handle, LOGPIXELSX)); + OffsetY := MulDiv(PhysOffsetY, 254, GetDeviceCaps(Handle, LOGPIXELSY)); + end + else + with dxDefaultPhysicalPaperOffsets do + begin + OffsetX := X div 100; + OffsetY := Y div 100; + end; + + with MarginsLoMetric do + Result := (Left >= OffsetX) and (Right >= OffsetX) and + (HeaderLoMetric >= OffsetY) and (FooterLoMetric >= OffsetY); +end; + +constructor TdxPrinterPage.CreateInstance(Dummy: Integer = 0); +begin + inherited Create; + FPage := Self; + + FAutoSwapMargins := True; + FCenterOnPageH := False; + FCenterOnPageV := False; + FMeasurementUnits := muDefault; + FLastMU := GetInnerMeasurementUnits; + FMargins := TdxRectWrapper.CreateEmpty; + FMinMargins := TdxRectWrapper.CreateEmpty; + FOrientation := poPortrait; + FPageSize := TdxPointWrapper.CreateEmpty; + FHFG := TdxRectWrapper.CreateEmpty; + FDMPaper := dxPrnDev.dxGetDefaultDMPaper; + FFitToPagesByTall := 1; + FFitToPagesByWide := 1; + FGrayShading := False; + FPageFooter := CreatePageFooter; + FPageHeader := CreatePageHeader; + FPageOrder := poOverThenDown; + FPaperSource := dxDefaultPaperSource;{Windows.DMBIN_AUTO} + FReverseTitlesOnEvenPages := False; + FScaleFactor := 100; + FScaleMode := smAdjust; +end; + +procedure TdxPrinterPage.DefineProperties(Filer: TFiler); + + function HasData: Boolean; + begin + Result := Filer.Ancestor = nil; + end; + +begin + inherited; + Filer.DefineProperty('_dxMeasurementUnits_', ReadMU, WriteMU, HasData); + Filer.DefineProperty('_dxLastMU_', ReadLastMU, WriteLastMU, HasData); + + if Filer is TReader then + SynchronizeMeasurementUnits; +end; + +procedure TdxPrinterPage.Changed; +begin + if (UpdateCount = 0) and Assigned(FOnChange) then + FOnChange(Self); +end; + +procedure TdxPrinterPage.DoAssign(Source: TdxBaseObject); +begin + FAssigning := True; + try + inherited; + with TdxPrinterPage(Source) do + begin + Self.AutoSwapMargins := AutoSwapMargins; + Self.Background := Background; + Self.CenterOnPageH := CenterOnPageH; + Self.CenterOnPageV := CenterOnPageV; + Self.DMPaper := DMPaper; + Self.GrayShading := GrayShading; + Self.MeasurementUnits := MeasurementUnits; + Self.MinMargins.Rect := MinMargins.Rect; + Self.Margins := Margins; + Self.Header := Header; + Self.Footer := Footer; + //if Self.DMPaper >= DMPAPER_USER then + Self.PageSize := PageSize; + Self.Orientation := Orientation; + Self.PageHeader := PageHeader; + Self.PageFooter := PageFooter; + Self.PageOrder := PageOrder; + Self.PaperSource := PaperSource; + Self.ReverseTitlesOnEvenPages := ReverseTitlesOnEvenPages; + Self.ScaleMode := ScaleMode; + + if Self.ScaleMode = smAdjust then + begin + Self.FitToPagesByWide := FitToPagesByWide; + Self.FitToPagesByTall := FitToPagesByTall; + Self.ScaleFactor := ScaleFactor; + end + else + begin + Self.ScaleFactor := ScaleFactor; + Self.FitToPagesByWide := FitToPagesByWide; + Self.FitToPagesByTall := FitToPagesByTall; + end; + end; + finally + FAssigning := False; + end; +end; + +function TdxPrinterPage.GetSupportsScaling: Boolean; +begin + Result := True; +end; + +function TdxPrinterPage.IsDefaultDMPaperSelected: Boolean; +begin + Result := FDMPaper = dxPrnDev.dxGetDefaultDMPaper; +end; + +function TdxPrinterPage.IsPageFooterTitleStored(Index: Integer): Boolean; +begin + Result := True; +end; + +function TdxPrinterPage.IsPageHeaderTitleStored(Index: Integer): Boolean; +begin + Result := True; +end; + +procedure TdxPrinterPage.MarginChanged; +begin + if Assigned(FOnMarginChange) then FOnMarginChange(Self); +end; + +procedure TdxPrinterPage.PageParamsChanged(AUpdateCodes: TdxPrinterPageUpdateCodes); +begin + if (UpdateCount = 0) and (ucMargins * AUpdateCodes <> []) then + MarginChanged; +end; + +function TdxPrinterPage.CreatePageFooter: TdxPageFooter; +begin + Result := GetPageFooterClass.Create; + InitializePageFooter(Result); +end; + +function TdxPrinterPage.GetPageFooterClass: TdxPageFooterClass; +begin + Result := TdxPageFooter; +end; + +procedure TdxPrinterPage.InitializePageFooter(APageFooter: TdxPageFooter); +begin + APageFooter.FPage := Self; +end; + +function TdxPrinterPage.CreatePageHeader: TdxPageHeader; +begin + Result := GetPageHeaderClass.Create; + InitializePageHeader(Result); +end; + +function TdxPrinterPage.GetPageHeaderClass: TdxPageHeaderClass; +begin + Result := TdxPageHeader; +end; + +procedure TdxPrinterPage.InitializePageHeader(APageHeader: TdxPageHeader); +begin + APageHeader.FPage := Self; +end; + +procedure TdxPrinterPage.DoUpdateMeasurementUnits; +begin + BeginUpdate; + try + case FLastMU of + muMillimeters: + begin + PageSize.Point := Pt_InchToMM(PageSize.Point); + MinMargins.Rect := Rect_InchToMM(MinMargins.Rect); + Header := InchToMM(Header); + Footer := InchToMM(Footer); + Margins.Rect := Rect_InchToMM(Margins.Rect); + end; + + muInches: + begin + PageSize.Point := Pt_MMToInch(PageSize.Point); + MinMargins.Rect := Rect_MMToInch(MinMargins.Rect); + Header := MMToInch(Header); + Footer := MMToInch(Footer); + Margins.Rect := Rect_MMToInch(Margins.Rect); + end; + end; + finally + EndUpdate; + end; +end; + +procedure TdxPrinterPage.ReadPrinterInfos; +var + AMargins: TRect; + APageSize: TPoint; + AHeader, AFooter: Integer; + ADMPaper: Integer; + AOrientation: TdxPrinterOrientation; +begin + GetDefaultPageInfo(AMargins, AHeader, AFooter, APageSize, ADMPaper, AOrientation); + FMinMargins.Rect := dxPSGlbl.NullRect; + FMargins.Rect := AMargins; + FHFG.Top := AHeader; + FHFG.Bottom := AFooter; + FPageSize.Point := APageSize; + FDMPaper := ADMPaper; + FOrientation := AOrientation; +end; + +procedure TdxPrinterPage.SynchronizeMeasurementUnits; +var + MU: TdxMeasurementUnits; +begin + if MeasurementUnits = muDefault then + begin + MU := GetDefaultMeasurementUnits; + if FLastMU <> MU then + begin + FLastMU := MU; + DoUpdateMeasurementUnits; + end; + end; +end; + +function TdxPrinterPage.GetCanSwapMargins: Boolean; +begin + Result := not IsLoading and not FAssigning and AutoSwapMargins; +end; + +function TdxPrinterPage.GetHFG(Index: Integer): Integer; +begin + Result := FHFG[TdxRectSide(Index)]; +end; + +function TdxPrinterPage.GetRealMeasurementUnits: TdxMeasurementUnits; +begin + if MeasurementUnits = muDefault then + Result := GetDefaultMeasurementUnits + else + Result := MeasurementUnits; +end; + +function TdxPrinterPage.GetRealPageSize: TPoint; +var + V: Integer; +begin + Result := PageSize.Point; + if Orientation = poLandscape then + with Result do + begin + V := X; + X := Y; + Y := V; + end; +end; + +function TdxPrinterPage.GetRestPageSizeX: Integer; +begin + Result := RealPageSize.X - MinPrintableArea; +end; + +function TdxPrinterPage.GetRestPageSizeY: Integer; +begin + Result := RealPageSize.Y - MinPrintableArea; +end; + +function TdxPrinterPage.IsMinMarginsStored: Boolean; +begin + Result := not MinMargins.IsEmpty(True); +end; + +function TdxPrinterPage.IsPageSizeStored: Boolean; +begin + Result := True;//dxPPAttr.Papers.FindByDMPaper(DMPaper) = -1; +end; + +procedure TdxPrinterPage.SetDMPaper(Value: Integer); +begin + if FDMPaper <> Value then + begin + FDMPaper := Value; + SetPaperSizeByDMPaper; + end; +end; + +procedure TdxPrinterPage.SetFitToPagesByTall(Value: Integer); +var + ScaleChanged: Boolean; +begin + ScaleChanged := FFitToPagesByTall <> Value; + FFitToPagesByTall := Value; + ScaleMode := smFit; + if ScaleChanged then PageParamsChanged([ucScale]); +end; + +procedure TdxPrinterPage.SetFitToPagesByWide(Value: Integer); +var + ScaleChanged: Boolean; +begin + ScaleChanged := FFitToPagesByWide <> Value; + FFitToPagesByWide := Value; + ScaleMode := smFit; + if ScaleChanged then PageParamsChanged([ucScale]); +end; + +procedure TdxPrinterPage.SetHFG(Index: Integer; Value: Integer); +begin + if Value < 0 then Value := 0; + FHFG[TdxRectSide(Index)] := Value; +end; + +procedure TdxPrinterPage.SetMargins(Value: TdxRectWrapper); +begin + FMargins.Assign(Value); +end; + +procedure TdxPrinterPage.SetMeasurementUnits(Value: TdxMeasurementUnits); + + function HasMUChanged: Boolean; + var + DMU: TdxMeasurementUnits; + begin + DMU := GetDefaultMeasurementUnits; + Result := ((Value = muDefault) and (FMeasurementUnits <> DMU)) or + ((FMeasurementUnits = muDefault) and (Value <> DMU)) or + ((Value <> muDefault) and (FMeasurementUnits <> muDefault)); + end; + +begin + if FMeasurementUnits <> Value then + if HasMUChanged then + begin + FMeasurementUnits := Value; + FLastMU := GetInnerMeasurementUnits; + DoUpdateMeasurementUnits; + end + else + FMeasurementUnits := Value; +end; + +procedure TdxPrinterPage.SetMinMargins(Value: TdxRectWrapper); +begin + MinMargins.Assign(Value); +end; + +procedure TdxPrinterPage.SetOrientation(Value: TdxPrinterOrientation); +begin + if FOrientation <> Value then + begin + FOrientation := Value; + if CanSwapMargins then DoSwapMargins; + end; +end; + +procedure TdxPrinterPage.SetPageFooter(Value: TdxPageFooter); +begin + PageFooter.Assign(Value); +end; + +procedure TdxPrinterPage.SetPageHeader(Value: TdxPageHeader); +begin + PageHeader.Assign(Value); +end; + +procedure TdxPrinterPage.SetPageSize(Value: TdxPointWrapper); +begin + PageSize.Assign(Value); +end; + +procedure TdxPrinterPage.SetPaperSource(Value: Integer); +begin + if Value < Windows.DMBIN_FIRST then + Value := Windows.DMBIN_FIRST; + if (Value > Windows.DMBIN_LAST) and (Value < Windows.DMBIN_USER) then + Value := Windows.DMBIN_LAST; + if FPaperSource <> Value then + FPaperSource := Value; +end; + +procedure TdxPrinterPage.SetRealPageSize(const Value: TPoint); +begin + if Orientation = poPortrait then + PageSize.Point := Value + else + PageSize.Point := Point(Value.Y, Value.X); +end; + +procedure TdxPrinterPage.SetScaleFactor(Value: Integer); +var + ScaleChanged: Boolean; +begin + if Value < dxMinScaleFactor then Value := dxMinScaleFactor; + if Value > dxMaxScaleFactor then Value := dxMaxScaleFactor; + ScaleChanged := ScaleFactor <> Value; + FScaleFactor := Value; + ScaleMode := smAdjust; + if ScaleChanged then PageParamsChanged([ucScale]); +end; + +procedure TdxPrinterPage.HFGChanged(Sender: TObject; ASides: TdxRectSides); +begin + if UpdateCount <> 0 then Exit; + BeginUpdate; + try + FixMargins; + finally + EndUpdate; + end; +end; + +procedure TdxPrinterPage.HFGChanging(Sender: TObject; ASides: TdxRectSides; + var Values: array of Integer); +begin + if UpdateCount <> 0 then Exit; + if rsTop in ASides then + Values[1] := MinMax(Values[1], FMinMargins.Top, RestPageSizeY - Margins.Bottom); + if rsBottom in ASides then + Values[3] := MinMax(Values[3], FMinMargins.Bottom, RestPageSizeY - Margins.Top); +end; + +procedure TdxPrinterPage.LockUpdated(Sender: TdxBaseObject; ALockState: TdxLockState); +begin + if ALockState = lsUnlock then PageParamsChanged(ucAll); +end; + +procedure TdxPrinterPage.MarginsChanged(Sender: TObject; ASides: TdxRectSides); + + function GetUpdateCode: TdxPrinterPageUpdateCodes; + begin + Result := []; + if rsLeft in ASides then Include(Result, ucMarginLeft); + if rsTop in ASides then Include(Result, ucMarginTop); + if rsRight in ASides then Include(Result, ucMarginRight); + if rsBottom in ASides then Include(Result, ucMarginBottom); + end; + +begin + if not IsLoading and (UpdateCount = 0) then + PageParamsChanged(GetUpdateCode); +end; + +procedure TdxPrinterPage.MarginsChanging(Sender: TObject; ASides: TdxRectSides; + var Values: array of Integer); +begin + if IsLoading or (UpdateCount <> 0) then Exit; + if rsLeft in ASides then + Values[0] := MinMax(Values[0], FMinMargins.Left, RestPageSizeX - Margins.Right); + if rsTop in ASides then + Values[1] := MinMax(Values[1], Header, RestPageSizeY - Margins.Bottom); + if rsRight in ASides then + Values[2] := MinMax(Values[2], FMinMargins.Right, RestPageSizeX - Margins.Left); + if rsBottom in ASides then + Values[3] := MinMax(Values[3], Footer, RestPageSizeY - Margins.Top); +end; + +procedure TdxPrinterPage.MinMarginsChanged(Sender: TObject; ASides: TdxRectSides); +begin + if IsLoading or (UpdateCount <> 0) then Exit; + + if rsLeft in ASides then + begin + FMargins.Left := MinMax(FMargins.Left, FMinMargins.Left, RestPageSizeX); + FMargins.Right := MinMax(FMargins.Right, FMinMargins.Right, RestPageSizeX - FMargins.Left); + end; + + if rsTop in ASides then + begin + Header := MinMax(Header, FMinMargins.Top, RestPageSizeY); + Footer := MinMax(Footer, FMinMargins.Bottom, RestPageSizeY - Header); + FMargins.Top := MinMax(FMargins.Top, Header, RestPageSizeY - Footer); + FMargins.Bottom := MinMax(FMargins.Bottom, Footer, RestPageSizeY - Header); + end; + + if rsRight in ASides then + begin + FMargins.Right := MinMax(FMargins.Right, FMinMargins.Right, RestPageSizeX); + FMargins.Left := MinMax(FMargins.Left, FMinMargins.Left, RestPageSizeX - FMargins.Right); + end; + + if rsBottom in ASides then + begin + Footer := MinMax(Footer, FMinMargins.Bottom, RestPageSizeY); + Header := MinMax(Header, FMinMargins.Top, RestPageSizeY - Footer); + FMargins.Bottom := MinMax(FMargins.Bottom, Footer, RestPageSizeY - Header); + FMargins.Top := MinMax(FMargins.Bottom, Header, RestPageSizeY - Footer); + end; +end; + +procedure TdxPrinterPage.MinMarginsChanging(Sender: TObject; ASides: TdxRectSides; + var Values: array of Integer); +begin + if IsLoading or (UpdateCount <> 0) then Exit; + if rsLeft in ASides then + Values[0] := MinMax(Values[0], 0, RestPageSizeX - MinMargins.Right); + if rsTop in ASides then + Values[1] := MinMax(Values[1], 0, RestPageSizeY - MinMargins.Bottom); + if rsRight in ASides then + Values[2] := MinMax(Values[2], 0, RestPageSizeX - MinMargins.Left); + if rsBottom in ASides then + Values[3] := MinMax(Values[3], 0, RestPageSizeY - MinMargins.Top); +end; + +procedure TdxPrinterPage.PageSizeChanged(Sender: TObject; ACoords: TdxPointCoords); +begin + if IsLoading or (UpdateCount <> 0) then Exit; + + BeginUpdate; + try + FixMinMargins; + FixMargins; + if not FPageSizeLocked then FindDMPaperByPageSize; + finally + EndUpdate; + end; +end; + +procedure TdxPrinterPage.PageSizeChanging(Sender: TObject; ACoords: TdxPointCoords; + var Values: array of Integer); +begin + if IsLoading then Exit; + + if pcX in ACoords then + Values[0] := Max(Values[0], MinPrintableArea); + if pcY in ACoords then + Values[1] := Max(Values[1], MinPrintableArea); +end; + +procedure TdxPrinterPage.ReadLastMU(Reader: TReader); +begin + FLastMU := TdxMeasurementUnits(Reader.ReadInteger); +end; + +procedure TdxPrinterPage.ReadMU(Reader: TReader); +begin + FMeasurementUnits := TdxMeasurementUnits(Reader.ReadInteger); +end; + +procedure TdxPrinterPage.WriteLastMU(Writer: TWriter); +begin + Writer.WriteInteger(Integer(FLastMU)); +end; + +procedure TdxPrinterPage.WriteMU(Writer: TWriter); +begin + Writer.WriteInteger(Integer(FMeasurementUnits)); +end; + +procedure TdxPrinterPage.DoSwapMargins; +var + V, V2: Integer; +begin + BeginUpdate; + try + if Orientation = poLandscape then + begin + V := MinMargins.Left; + MinMargins.Left := MinMargins.Bottom; + V2 := MinMargins.Top; + MinMargins.Top := V; + V := MinMargins.Right; + MinMargins.Right := V2; + MinMargins.Bottom := V; + + V := Margins.Left; + Margins.Left := Margins.Bottom; + V2 := Margins.Top; + Margins.Top := V; + V := Margins.Right; + Margins.Right := V2; + Margins.Bottom := V; + end + else + begin + V := MinMargins.Bottom; + MinMargins.Bottom := MinMargins.Left; + V2 := MinMargins.Right; + MinMargins.Right := V; + V := MinMargins.Top; + MinMargins.Top := V2; + MinMargins.Left := V; + + V := Margins.Bottom; + Margins.Bottom := Margins.Left; + V2 := Margins.Right; + Margins.Right := V; + V := Margins.Top; + Margins.Top := V2; + Margins.Left := V; + end; + FixMargins; + finally + EndUpdate; + end; +end; + +procedure TdxPrinterPage.FindDMPaperByPageSize; +var + Index: Integer; +begin + with PageSizeLoMetric do + Index := dxPPAttr.Papers.FindBySize(X, Y); + + if Index <> -1 then + FDMPaper := dxPPAttr.Papers[Index].DMPaper + else + FDMPaper := DMPAPER_USER; +end; + +procedure TdxPrinterPage.FixMargins; +begin + Header := MinMax(Header, FMinMargins.Top, RestPageSizeY - FMinMargins.Bottom); + Footer := MinMax(Footer, FMinMargins.Bottom, RestPageSizeY - Header); + FMargins.Left := MinMax(FMargins.Left, FMinMargins.Left, RestPageSizeX - FMinMargins.Right); + FMargins.Right := MinMax(FMargins.Right, FMinMargins.Right, RestPageSizeX - FMargins.Left); + FMargins.Top := MinMax(FMargins.Top, Header, RestPageSizeY - Footer); + FMargins.Bottom := MinMax(FMargins.Bottom, Footer, RestPageSizeY - Header); +end; + +procedure TdxPrinterPage.FixMinMargins; +begin + FMinMargins.Left := MinMax(FMinMargins.Left, 0, RestPageSizeX); + if RestPageSizeX = 0 then + FMinMargins.Right := 0 + else + FMinMargins.Right := MinMax(FMinMargins.Right, 0, RestPageSizeX - FMinMargins.Left); + + FMinMargins.Top := MinMax(FMinMargins.Top, 0, RestPageSizeY); + if RestPageSizeY = 0 then + FMinMargins.Bottom := 0 + else + FMinMargins.Bottom := MinMax(FMinMargins.Bottom, 0, RestPageSizeY - FMinMargins.Top); +end; + +function TdxPrinterPage.IsLoading: Boolean; +var + AOwner: TPersistent; +begin + AOwner := GetOwner; + Result := (AOwner is TComponent) and (csLoading in TComponent(AOwner).ComponentState); +end; + +procedure TdxPrinterPage.SetPaperSizeByDMPaper; +var + PaperSize: TPoint; + PaperIndex: Integer; +begin + PaperSize := dxPSGlbl.NullPoint; + PaperIndex := dxPPAttr.Papers.FindByDMPaper(DMPaper); + if PaperIndex = -1 then + begin + PaperIndex := dxPrintDevice.FindPaper(DMPaper); + if PaperIndex <> -1 then + PaperSize := ScalePoint(TdxPaperInfo(dxPrintDevice.Papers.Objects[PaperIndex]).Size, 100, 1) + end + else + PaperSize := ScalePoint(TPoint(dxPPAttr.Papers[PaperIndex].Size), 100, 1); + + if (PaperSize.X <> 0) and (PaperSize.Y <> 0) then + begin + FPageSizeLocked := True; + try + case GetInnerMeasurementUnits of + muInches: + PageSize.Point := Pt_MMToInch(PaperSize); + muMillimeters: + PageSize.Point := PaperSize; + end; + finally + FPageSizeLocked := False; + end; + end +end; + +initialization + +finalization + FreeAndNil(FDefaultPrinterPage); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxWrap.pas b/official/x.35/ExpressPrinting System/Sources/dxWrap.pas new file mode 100644 index 00000000..7108fbff --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxWrap.pas @@ -0,0 +1,526 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxWrap; + +interface + +{$I cxVer.inc} + +uses + Windows, Classes, dxPSGlbl; + +type + TdxPointCoord = (pcX, pcY); + TdxPointCoords = set of TdxPointCoord; + + TdxPointChangingEvent = procedure(Sender: TObject; Coords: TdxPointCoords; + var Values: array of Integer) of object; + + TdxPointChangeEvent = procedure(Sender: TObject; Coords: TdxPointCoords) of object; + + TdxPointWrapper = class(TPersistent) + private + FPoint: TPoint; + FOnChanged: TdxPointChangeEvent; + FOnChanging: TdxPointChangingEvent; + function GetPartPoint(Index: Integer): Integer; + procedure SetPartPoint(Index: Integer; Value: Integer); + procedure SetPoint(const Value: TPoint); + protected + procedure DoChanged(ACoords: TdxPointCoords); dynamic; + procedure DoChanging(ACoords: TdxPointCoords; var AValues: array of Integer); dynamic; + public + constructor Create(AX, AY: Integer); + constructor CreateEmpty; + procedure Assign(Source: TPersistent); override; + + function Clone: TPersistent; + procedure Empty; + function IsEqual(const APoint: TPoint): Boolean; + class function ArePointsEqual(const Pt1, Pt2: TPoint): Boolean; + + property Point: TPoint read FPoint write SetPoint; + property OnChanging: TdxPointChangingEvent read FOnChanging write FOnChanging; + property OnChanged: TdxPointChangeEvent read FOnChanged write FOnChanged; + published + property X: Integer index 0 read GetPartPoint write SetPartPoint default 0; + property Y: Integer index 1 read GetPartPoint write SetPartPoint default 0; + end; + + TdxRectSide = (rsLeft, rsTop, rsRight, rsBottom); + TdxRectSides = set of TdxRectSide; + + TdxRectChangingEvent = procedure(Sender: TObject; Sides: TdxRectSides; + var Values: array of Integer) of object; + + TdxRectChangeEvent = procedure(Sender: TObject; Sides: TdxRectSides) of object; + + TdxRectWrapper = class(TPersistent) + private + FRect: TRect; + FOnChanged: TdxRectChangeEvent; + FOnChanging: TdxRectChangingEvent; + function GetHeight: Integer; + function GetPartRect(Index: Integer): Integer; + function GetRectPoint(Index: Integer): TPoint; + function GetSide(ASide: TdxRectSide): Integer; + function GetWidth: Integer; + procedure SetHeight(Value: Integer); + procedure SetPartRect(Index: Integer; Value: Integer); + procedure SetRect(const Value: TRect); + procedure SetRectPoint(Index: Integer; const Value: TPoint); + procedure SetSide(ASide: TdxRectSide; Value: Integer); + procedure SetWidth(Value: Integer); + protected + procedure DoChanged(ASides: TdxRectSides); dynamic; + procedure DoChanging(ASides: TdxRectSides; var AValues: array of Integer); dynamic; + public + constructor Create(ALeft, ATop, ARight, ABottom: Integer); + constructor CreateEmpty; + procedure Assign(Source: TPersistent); override; + + function Clone: TPersistent; + procedure Empty; + function IsEqual(const ARect: TRect): Boolean; + function IsEmpty(AnExact: Boolean = False): Boolean; + + property BottomRight: TPoint Index 1 read GetRectPoint write SetRectPoint; + property Height: Integer read GetHeight write SetHeight; + property Rect: TRect read FRect write SetRect; + property Side[ASide: TdxRectSide]: Integer read GetSide write SetSide; default; + property TopLeft: TPoint Index 0 read GetRectPoint write SetRectPoint; + property Width: Integer read GetWidth write SetWidth; + + property OnChanging: TdxRectChangingEvent read FOnChanging write FOnChanging; + property OnChanged: TdxRectChangeEvent read FOnChanged write FOnChanged; + published + property Bottom: Integer index 3 read GetPartRect write SetPartRect default 0; + property Left: Integer index 0 read GetPartRect write SetPartRect default 0; + property Right: Integer index 2 read GetPartRect write SetPartRect default 0; + property Top: Integer index 1 read GetPartRect write SetPartRect default 0; + end; + +implementation + +uses + dxPSUtl; + +type + TPoints = array[0..1] of Integer; + TRects = array[0..3] of Integer; + +function MakePoints(X, Y: Integer): TPoints; overload; +begin + Result[0] := X; + Result[1] := Y; +end; + +function MakePoints(const Pt: TPoint): TPoints; overload; +begin + Result := MakePoints(Pt.X, Pt.Y); +end; + +function MakeRects(ALeft, ATop, ARight, ABottom: Integer): TRects; overload; +begin + Result[0] := ALeft; + Result[1] := ATop; + Result[2] := ARight; + Result[3] := ABottom; +end; + +function MakeRects(const R: TRect): TRects; overload; +begin + with R do + Result := MakeRects(Left, Top, Right, Bottom); +end; + +{ TdxPointWrapper } + +constructor TdxPointWrapper.Create(AX, AY: Integer); +begin + inherited Create; + FPoint.X := AX; + FPoint.Y := AY; +end; + +constructor TdxPointWrapper.CreateEmpty; +begin + Create(0, 0); +end; + +procedure TdxPointWrapper.Assign(Source: TPersistent); +begin + if Source = nil then + Empty + else + if Source is TdxPointWrapper then + Point := TdxPointWrapper(Source).Point + else + inherited Assign(Source) +end; + +function TdxPointWrapper.Clone: TPersistent; +begin + Result := TdxPointWrapper.Create(0, 0); + try + Result.Assign(Self); + except + Result.Free; + raise; + end; +end; + +procedure TdxPointWrapper.DoChanged(ACoords: TdxPointCoords); +begin + if Assigned(FOnChanged) then FOnChanged(Self, ACoords); +end; + +procedure TdxPointWrapper.DoChanging(ACoords: TdxPointCoords; + var AValues: array of Integer); +begin + if Assigned(FOnChanging) then FOnChanging(Self, ACoords, AValues); +end; + +procedure TdxPointWrapper.SetPoint(const Value: TPoint); +var + Points: TPoints; +begin + if not IsEqual(Value) then + begin + Points := MakePoints(Value); + DoChanging([pcX, pcY], Points); + FPoint.X := Points[0]; + FPoint.Y := Points[1]; + DoChanged([pcX, pcY]); + end; +end; + +function TdxPointWrapper.GetPartPoint(Index: Integer): Integer; +begin + if Index = 0 then + Result := FPoint.X + else + Result := FPoint.Y; +end; + +procedure TdxPointWrapper.SetPartPoint(Index: Integer; Value: Integer); +var + Points: TPoints; +begin + if Index = 0 then + begin + if FPoint.X <> Value then + begin + Points := MakePoints(Value, 0); + DoChanging([pcX], Points); + FPoint.X := Points[0]; + DoChanged([pcX]); + end + end + else + if FPoint.Y <> Value then + begin + Points := MakePoints(0, Value); + DoChanging([pcY], Points); + FPoint.Y := Points[1]; + DoChanged([pcY]); + end; +end; + +function TdxPointWrapper.IsEqual(const APoint: TPoint): Boolean; +begin + Result := (FPoint.X = APoint.X) and (FPoint.Y = APoint.Y); +end; + +class function TdxPointWrapper.ArePointsEqual(const Pt1, Pt2: TPoint): Boolean; +begin + Result := (Pt1.X = Pt2.X) and (Pt1.Y = Pt2.Y); +end; + +procedure TdxPointWrapper.Empty; +var + Points: TPoints; +begin + if not IsEqual(NullPoint) then + begin + Points := MakePoints(0, 0); + DoChanging([pcX, pcY], Points); + FPoint.X := Points[0]; + FPoint.Y := Points[1]; + DoChanged([pcX, pcY]); + end; +end; + +{ TdxRectWrapper } + +constructor TdxRectWrapper.Create(ALeft, ATop, ARight, ABottom: Integer); +begin + inherited Create; + FRect.Left := ALeft; + FRect.Top := ATop; + FRect.Right := ARight; + FRect.Bottom := ABottom; +end; + +constructor TdxRectWrapper.CreateEmpty; +begin + Create(0, 0, 0, 0); +end; + +procedure TdxRectWrapper.Assign(Source: TPersistent); +begin + if Source = nil then + Empty + else + if Source is TdxRectWrapper then + Rect := TdxRectWrapper(Source).Rect + else + inherited Assign(Source) +end; + +function TdxRectWrapper.Clone: TPersistent; +begin + Result := TdxRectWrapper.Create(0, 0, 0, 0); + try + Result.Assign(Self); + except + Result.Free; + raise; + end; +end; + +procedure TdxRectWrapper.Empty; +var + Rects: TRects; +begin + if not IsEqual(NullRect) then + begin + Rects := MakeRects(0, 0, 0, 0); + DoChanging([rsLeft, rsTop, rsRight, rsBottom], Rects); + FRect.Left := Rects[0]; + FRect.Top := Rects[1]; + FRect.Right := Rects[2]; + FRect.Bottom := Rects[3]; + DoChanged([rsLeft, rsTop, rsRight, rsBottom]); + end; +end; + +function TdxRectWrapper.IsEqual(const ARect: TRect): Boolean; +begin + Result := EqualRect(FRect, ARect); +end; + +function TdxRectWrapper.IsEmpty(AnExact: Boolean = False): Boolean; +begin + if AnExact then + Result := IsEqual(dxPSGlbl.NullRect) + else + Result := IsRectEmpty(Rect); +end; + +procedure TdxRectWrapper.DoChanged(ASides: TdxRectSides); +begin + if Assigned(FOnChanged) then FOnChanged(Self, ASides); +end; + +procedure TdxRectWrapper.DoChanging(ASides: TdxRectSides; var AValues: array of Integer); +begin + if Assigned(FOnChanging) then FOnChanging(Self, ASides, AValues); +end; + +procedure TdxRectWrapper.SetRect(const Value: TRect); +var + Rects: TRects; +begin + if not EqualRect(FRect, Value) then + begin + Rects := MakeRects(Value); + DoChanging([rsLeft, rsTop, rsRight, rsBottom], Rects); + FRect.Left := Rects[0]; + FRect.Top := Rects[1]; + FRect.Right := Rects[2]; + FRect.Bottom := Rects[3]; + DoChanged([rsLeft, rsTop, rsRight, rsBottom]); + end; +end; + +function TdxRectWrapper.GetWidth: Integer; +begin + Result := FRect.Right - FRect.Left; +end; + +procedure TdxRectWrapper.SetWidth(Value: Integer); +var + Rects: TRects; +begin + if Width <> Value then + begin + Rects := MakeRects(0, 0, Value, 0); + DoChanging([rsRight], Rects); + FRect.Right := Rects[2]; + DoChanged([rsRight]); + end; +end; + +function TdxRectWrapper.GetHeight: Integer; +begin + Result := FRect.Bottom - FRect.Top +end; + +procedure TdxRectWrapper.SetHeight(Value: Integer); +var + Rects: TRects; +begin + if Height <> Value then + begin + Rects := MakeRects(0, 0, 0, Value); + DoChanging([rsBottom], Rects); + FRect.Bottom := Rects[3]; + DoChanged([rsBottom]); + end; +end; + +function TdxRectWrapper.GetPartRect(Index: Integer): Integer; +begin + case Index of + 0: Result := FRect.Left; + 1: Result := FRect.Top; + 2: Result := FRect.Right; + else + Result := FRect.Bottom; + end; +end; + +procedure TdxRectWrapper.SetPartRect(Index: Integer; Value: Integer); +var + Rects: TRects; +begin + case Index of + 0: + if FRect.Left <> Value then + begin + Rects := MakeRects(Value, 0, 0, 0); + DoChanging([rsLeft], Rects); + FRect.Left := Rects[0]; + DoChanged([rsLeft]); + end; + 1: + if FRect.Top <> Value then + begin + Rects := MakeRects(0, Value, 0, 0); + DoChanging([rsTop], Rects); + FRect.Top := Rects[1]; + DoChanged([rsTop]); + end; + 2: + if FRect.Right <> Value then + begin + Rects := MakeRects(0, 0, Value, 0); + DoChanging([rsRight], Rects); + FRect.Right := Rects[2]; + DoChanged([rsRight]); + end; + 3: + if FRect.Bottom <> Value then + begin + Rects := MakeRects(0, 0, 0, Value); + DoChanging([rsBottom], Rects); + FRect.Bottom := Rects[3]; + DoChanged([rsBottom]); + end; + end; +end; + +function TdxRectWrapper.GetRectPoint(Index: Integer): TPoint; +begin + if Index = 0 then + Result := FRect.TopLeft + else + Result := FRect.BottomRight; +end; + +procedure TdxRectWrapper.SetRectPoint(Index: Integer; const Value: TPoint); +var + Rects: TRects; +begin + if Index = 0 then + if not TdxPointWrapper.ArePointsEqual(FRect.TopLeft, Value) then + begin + Rects := MakeRects(Value.X, Value.Y, 0, 0); + DoChanging([rsLeft, rsTop], Rects); + FRect.Left := Rects[0]; + FRect.Top := Rects[1]; + DoChanged([rsLeft, rsTop]); + end + else + else + if not TdxPointWrapper.ArePointsEqual(FRect.BottomRight, Value) then + begin + Rects := MakeRects(0, 0, Value.X, Value.Y); + DoChanging([rsRight, rsBottom], Rects); + FRect.Right := Rects[2]; + FRect.Bottom := Rects[3]; + DoChanged([rsRight, rsBottom]); + end; +end; + +function TdxRectWrapper.GetSide(ASide: TdxRectSide): Integer; +begin + case ASide of + rsLeft: + Result := FRect.Left; + rsTop: + Result := FRect.Top; + rsRight: + Result := FRect.Right; + else //rsBottom + Result := FRect.Bottom; + end; +end; + +procedure TdxRectWrapper.SetSide(ASide: TdxRectSide; Value: Integer); +begin + SetPartRect(Integer(ASide), Value); +end; + +initialization + RegisterClasses([TdxPointWrapper, TdxRectWrapper]); + +finalization + UnregisterClasses([TdxPointWrapper, TdxRectWrapper]); + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxfmChFn.dfm b/official/x.35/ExpressPrinting System/Sources/dxfmChFn.dfm new file mode 100644 index 00000000..31722106 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxfmChFn.dfm @@ -0,0 +1,73 @@ +object fmdxChangeFileName: TfmdxChangeFileName + Left = 368 + Top = 184 + ActiveControl = edFileName + BorderStyle = bsDialog + Caption = 'Choose New File Name' + ClientHeight = 104 + ClientWidth = 350 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object btnOK: TButton + Left = 109 + Top = 75 + Width = 75 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 190 + Top = 75 + Width = 75 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object btnHelp: TButton + Left = 271 + Top = 75 + Width = 75 + Height = 23 + Caption = '&Help' + TabOrder = 3 + end + object GroupBox1: TGroupBox + Left = 4 + Top = 2 + Width = 342 + Height = 65 + TabOrder = 0 + object lblEnterNewFileName: TLabel + Left = 9 + Top = 17 + Width = 103 + Height = 13 + Caption = '&Enter New File Name:' + FocusControl = edFileName + end + object edFileName: TEdit + Left = 9 + Top = 33 + Width = 324 + Height = 21 + MaxLength = 260 + TabOrder = 0 + OnChange = edFileNameChange + end + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxfmChFn.pas b/official/x.35/ExpressPrinting System/Sources/dxfmChFn.pas new file mode 100644 index 00000000..19ca642f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxfmChFn.pas @@ -0,0 +1,141 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxfmChFN; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, dxPSForm; + +type + TfmdxChangeFileName = class(TCustomdxPSForm) + btnOK: TButton; + btnCancel: TButton; + btnHelp: TButton; + GroupBox1: TGroupBox; + edFileName: TEdit; + lblEnterNewFileName: TLabel; + procedure FormCreate(Sender: TObject); + procedure edFileNameChange(Sender: TObject); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + private + FFileName: string; + FModified: Boolean; + procedure LoadStrings; + function ValidateFileName: Boolean; + public + function Execute: Boolean; + property FileName: string read FFileName write FFileName; + end; + +function dxShowChooseFileNameDlg(var AFileName: string): Boolean; + +implementation + +{$R *.DFM} + +uses + cxClasses, dxPSRes, dxPSUtl; + +function dxShowChooseFileNameDlg(var AFileName: string): Boolean; +begin + with TfmdxChangeFileName.Create(nil) do + try + FileName := AFileName; + Result := Execute; + if Result then AFileName := FileName; + finally + Free; + end; +end; + +procedure TfmdxChangeFileName.FormCreate(Sender: TObject); +begin + edFileName.MaxLength := MAX_PATH; + LoadStrings; +end; + +procedure TfmdxChangeFileName.LoadStrings; +begin + btnOK.Caption := cxGetResourceString(@sdxBtnOK); + btnCancel.Caption := cxGetResourceString(@sdxBtnCancel); + btnHelp.Caption := cxGetResourceString(@sdxBtnHelp); + Caption := cxGetResourceString(@sdxENFNCaption); + lblEnterNewFileName.Caption := cxGetResourceString(@sdxEnterNewFileName); +end; + +function TfmdxChangeFileName.Execute: Boolean; +begin + FModified := False; + edFileName.Text := FileName; + btnOK.Enabled := False; + Result := (ShowModal = mrOK) and FModified; +end; + +procedure TfmdxChangeFileName.edFileNameChange(Sender: TObject); +begin + FModified := True; + btnOK.Enabled := True; + FileName := TEdit(Sender).Text; +end; + +function TfmdxChangeFileName.ValidateFileName: Boolean; +begin + Result := dxPSUtl.ValidateFileName(FileName); + if not Result then + MessageWarning(Format(cxGetResourceString(@sdxInvalidFileName), [FileName])) + else + begin + Result := not FileExists(FileName); + if not Result then + MessageWarning(Format(cxGetResourceString(@sdxFileAlreadyExists), [FileName])); + end; +end; + +procedure TfmdxChangeFileName.FormCloseQuery(Sender: TObject; + var CanClose: Boolean); +begin + if ModalResult = mrOK then + begin + CanClose := ValidateFileName; + ActiveControl := edFileName; + end; +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxfmClr.dfm b/official/x.35/ExpressPrinting System/Sources/dxfmClr.dfm new file mode 100644 index 00000000..35bec57f --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxfmClr.dfm @@ -0,0 +1,573 @@ +object dxfmColorPalette: TdxfmColorPalette + Left = 410 + Top = 280 + BorderStyle = bsDialog + ClientHeight = 182 + ClientWidth = 148 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + KeyPreview = True + OldCreateOrder = True + ShowHint = True + PixelsPerInch = 96 + TextHeight = 13 + object pnlTop: TPanel + Left = 0 + Top = 0 + Width = 148 + Height = 121 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object SpeedButton1: TSpeedButton + Left = 2 + Top = 28 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton2: TSpeedButton + Left = 20 + Top = 28 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton3: TSpeedButton + Left = 38 + Top = 28 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton4: TSpeedButton + Left = 56 + Top = 28 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton5: TSpeedButton + Left = 74 + Top = 28 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton6: TSpeedButton + Left = 92 + Top = 28 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton7: TSpeedButton + Left = 110 + Top = 28 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton8: TSpeedButton + Left = 128 + Top = 28 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton9: TSpeedButton + Left = 2 + Top = 46 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton10: TSpeedButton + Left = 20 + Top = 46 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton11: TSpeedButton + Left = 38 + Top = 46 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton12: TSpeedButton + Left = 56 + Top = 46 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton13: TSpeedButton + Left = 74 + Top = 46 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton14: TSpeedButton + Left = 92 + Top = 46 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton15: TSpeedButton + Left = 110 + Top = 46 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton16: TSpeedButton + Left = 128 + Top = 46 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton17: TSpeedButton + Left = 2 + Top = 64 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton18: TSpeedButton + Left = 20 + Top = 64 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton19: TSpeedButton + Left = 38 + Top = 64 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton20: TSpeedButton + Left = 56 + Top = 64 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton21: TSpeedButton + Left = 74 + Top = 64 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton22: TSpeedButton + Left = 92 + Top = 64 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton23: TSpeedButton + Left = 110 + Top = 64 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton24: TSpeedButton + Left = 128 + Top = 64 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton25: TSpeedButton + Left = 2 + Top = 82 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton26: TSpeedButton + Left = 20 + Top = 82 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton27: TSpeedButton + Left = 38 + Top = 82 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton28: TSpeedButton + Left = 56 + Top = 82 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton29: TSpeedButton + Left = 74 + Top = 82 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton30: TSpeedButton + Left = 92 + Top = 82 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton31: TSpeedButton + Left = 110 + Top = 82 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton32: TSpeedButton + Left = 128 + Top = 82 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton33: TSpeedButton + Left = 2 + Top = 100 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton34: TSpeedButton + Left = 20 + Top = 100 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton35: TSpeedButton + Left = 38 + Top = 100 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton36: TSpeedButton + Left = 56 + Top = 100 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton37: TSpeedButton + Left = 74 + Top = 100 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton38: TSpeedButton + Left = 92 + Top = 100 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton39: TSpeedButton + Left = 110 + Top = 100 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton40: TSpeedButton + Left = 128 + Top = 100 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object bvlNoFillHolder: TBevel + Left = 2 + Top = 3 + Width = 144 + Height = 22 + Visible = False + end + end + object pnlBottom: TPanel + Left = 0 + Top = 126 + Width = 148 + Height = 56 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + object sBtnMoreColors: TSpeedButton + Left = 2 + Top = 4 + Width = 144 + Height = 26 + Caption = '&More Colors ...' + Flat = True + Glyph.Data = { + F6000000424DF600000000000000760000002800000010000000100000000100 + 0400000000008000000000000000000000001000000010000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00551199BBAAEE + CC44551199BBAAEECC44551199BBAAEECC44551199BBAAEECC44551199BBAAEE + CC44551199BBAAEECC44551199BBAAEECC44551199BBAAEECC44551199BBAAEE + CC44551199BBAAEECC44551199BBAAEECC44551199BBAAEECC44551199BBAAEE + CC44551199BBAAEECC44551199BBAAEECC44551199BBAAEECC44} + Margin = 3 + Spacing = 10 + OnClick = sBtnMoreColorsClick + end + object sBtnFillEffects: TSpeedButton + Left = 2 + Top = 30 + Width = 144 + Height = 26 + Caption = '&Fill Effects ...' + Flat = True + Glyph.Data = { + 36050000424D3605000000000000360400002800000010000000100000000100 + 0800000000000001000000000000000000000001000000010000000000000000 + 80000080000000808000800000008000800080800000C0C0C000C0DCC000F0CA + A600D3F0FF00B1E2FF008ED3FF006BC6FF0048B8FF0024AAFF0000AAFF000092 + DC000079B900006196000049730000325000D3E3FF00B1C7FF008EABFF006B8F + FF004873FF002457FF000055FF000049DC00003CB90000309600002473000019 + 5000D3D3FF00B1B1FF008E8EFF006B6BFF004848FF002424FF000000FE000000 + DC000000B900000096000000730000005000E3D3FF00C7B1FF00AB8EFF008F6B + FF007348FF005724FF005500FF004900DC003C00B90030009600240073001900 + 5000F0D3FF00E2B1FF00D38EFF00C66BFF00B848FF00AA24FF00AA00FF009200 + DC007900B900610096004900730032005000FFD3FF00FFB1FF00FF8EFF00FF6B + FF00FF48FF00FF24FF00FE00FE00DC00DC00B900B90096009600730073005000 + 5000FFD3F000FFB1E200FF8ED300FF6BC600FF48B800FF24AA00FF00AA00DC00 + 9200B9007900960061007300490050003200FFD3E300FFB1C700FF8EAB00FF6B + 8F00FF487300FF245700FF005500DC004900B9003C0096003000730024005000 + 1900FFD3D300FFB1B100FF8E8E00FF6B6B00FF484800FF242400FE000000DC00 + 0000B9000000960000007300000050000000FFE3D300FFC7B100FFAB8E00FF8F + 6B00FF734800FF572400FF550000DC490000B93C000096300000732400005019 + 0000FFF0D300FFE2B100FFD38E00FFC66B00FFB84800FFAA2400FFAA0000DC92 + 0000B9790000966100007349000050320000FFFFD300FFFFB100FFFF8E00FFFF + 6B00FFFF4800FFFF2400FEFE0000DCDC0000B9B9000096960000737300005050 + 0000F0FFD300E2FFB100D3FF8E00C6FF6B00B8FF4800AAFF2400AAFF000092DC + 000079B90000619600004973000032500000E3FFD300C7FFB100ABFF8E008FFF + 6B0073FF480057FF240055FF000049DC00003CB9000030960000247300001950 + 0000D3FFD300B1FFB1008EFF8E006BFF6B0048FF480024FF240000FE000000DC + 000000B90000009600000073000000500000D3FFE300B1FFC7008EFFAB006BFF + 8F0048FF730024FF570000FF550000DC490000B93C0000963000007324000050 + 1900D3FFF000B1FFE2008EFFD3006BFFC60048FFB80024FFAA0000FFAA0000DC + 920000B97900009661000073490000503200D3FFFF00B1FFFF008EFFFF006BFF + FF0048FFFF0024FFFF0000FEFE0000DCDC0000B9B90000969600007373000050 + 5000F2F2F200E6E6E600DADADA00CECECE00C2C2C200B6B6B600AAAAAA009E9E + 9E009292920086868600797979006E6E6E006161610056565600494949003E3E + 3E0032323200262626001A1A1A000E0E0E00F0FBFF00A3A0A000808080000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00686868686868 + 686868686868686868686873737373737373737373737373736868737E7E7E7E + 7E7E7E7E7E7E7E7E736868737E7C7C7C7C7C7C7C7C7C7C7E736868737E7C8787 + 8787878787877C7E736868737E7C87858585858585877C7E736868737E7C8785 + 8484848485877C7E736868737E7C87858483838485877C7E736868737E7C8785 + 8483838485877C7E736868737E7C87858484848485877C7E736868737E7C8785 + 8585858585877C7E736868737E7C87878787878787877C7E736868737E7C7C7C + 7C7C7C7C7C7C7C7E736868737E7E7E7E7E7E7E7E7E7E7E7E7368687373737373 + 7373737373737373736868686868686868686868686868686868} + Margin = 4 + Spacing = 10 + OnClick = sBtnFillEffectsClick + end + end + object pnlMiddle: TPanel + Left = 0 + Top = 121 + Width = 148 + Height = 5 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Bevel1: TBevel + Left = 25 + Top = -2 + Width = 97 + Height = 6 + Shape = bsBottomLine + end + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxfmClr.pas b/official/x.35/ExpressPrinting System/Sources/dxfmClr.pas new file mode 100644 index 00000000..c2a167ea --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxfmClr.pas @@ -0,0 +1,723 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxfmClr; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + ExtCtrls, Buttons, dxBkgnd; + +const + dxPaletteColCount = 8; + dxPaletteRowCount = 5; + dxPaletteColors: array[0..dxPaletteColCount - 1, 0..dxPaletteRowCount - 1] of TColor = + (($00000000, $00000484, $000004FF, $00FF04FF, $00CE9EFF), + ($00003498, $00006AFF, $00009AFF, $0000CBFF, $0098CFFF), + ($00003C39, $00007D7B, $0000CF9C, $0000FFFF, $0098FFFF), + ($00003400, $00008200, $0084A242, $0000FF00, $00CEFFCE), + ($00633400, $00848600, $00CECF39, $00FFFF00, $00FFFFCE), + ($00840400, $00FF0400, $00FF6531, $00FFCF00, $00FFCF9C), + ($00943431, $009C6563, $00840484, $006B349C, $00FF9ECE), + ($00313431, $007B7D7B, $00949694, $00C6C6C7, $00FFFFFF)); + +type + PdxBackgroundDlgData = ^TdxBackgroundDlgData; + TdxBackgroundDlgData = record + BorderStyle: TFormBorderStyle; + FormCaption: string; + NoBtnCaption: string; + AutoColor: TColor; + ShowFillEffects: Boolean; + ShowMoreColors: Boolean; + end; + + TdxfmColorPalette = class(TForm) + pnlTop: TPanel; + SpeedButton1: TSpeedButton; + SpeedButton2: TSpeedButton; + SpeedButton3: TSpeedButton; + SpeedButton4: TSpeedButton; + SpeedButton5: TSpeedButton; + SpeedButton6: TSpeedButton; + SpeedButton7: TSpeedButton; + SpeedButton8: TSpeedButton; + SpeedButton9: TSpeedButton; + SpeedButton10: TSpeedButton; + SpeedButton11: TSpeedButton; + SpeedButton12: TSpeedButton; + SpeedButton13: TSpeedButton; + SpeedButton14: TSpeedButton; + SpeedButton15: TSpeedButton; + SpeedButton16: TSpeedButton; + SpeedButton17: TSpeedButton; + SpeedButton18: TSpeedButton; + SpeedButton19: TSpeedButton; + SpeedButton20: TSpeedButton; + SpeedButton21: TSpeedButton; + SpeedButton22: TSpeedButton; + SpeedButton23: TSpeedButton; + SpeedButton24: TSpeedButton; + SpeedButton25: TSpeedButton; + SpeedButton26: TSpeedButton; + SpeedButton27: TSpeedButton; + SpeedButton28: TSpeedButton; + SpeedButton29: TSpeedButton; + SpeedButton30: TSpeedButton; + SpeedButton31: TSpeedButton; + SpeedButton32: TSpeedButton; + SpeedButton33: TSpeedButton; + SpeedButton34: TSpeedButton; + SpeedButton35: TSpeedButton; + SpeedButton36: TSpeedButton; + SpeedButton37: TSpeedButton; + SpeedButton38: TSpeedButton; + SpeedButton39: TSpeedButton; + SpeedButton40: TSpeedButton; + pnlBottom: TPanel; + sBtnMoreColors: TSpeedButton; + sBtnFillEffects: TSpeedButton; + bvlNoFillHolder: TBevel; + pnlMiddle: TPanel; + Bevel1: TBevel; + procedure sBtnMoreColorsClick(Sender: TObject); + procedure sBtnFillEffectsClick(Sender: TObject); + procedure ButtonClick(Sender: TObject); + private + FAutoColor: TColor; + FBackground: TdxBackground; + FButtons: array[0..dxPaletteColCount - 1, 0..dxPaletteRowCount - 1] of TSpeedButton; + FColor: TColor; + FNoBtnCaption: string; + FResult: TModalResult; + FShowFillEffects: Boolean; + FShowMoreColors: Boolean; + sbtnNoFill: TSpeedButton; + procedure AdjustHeight; + function GetBorderStyle: TFormBorderStyle; + procedure FindButtonColor; + procedure InitControls; + procedure LoadStrings; + procedure SetAutoColor(Value: TColor); + procedure SetBackground(Value: TdxBackground); + procedure SetBackgroundColor(AColor: TColor); + procedure SetBorderStyle(Value: TFormBorderStyle); + procedure SetColor(Value: TColor); + procedure SetNoBtnCaption(const Value: string); + procedure SetShowFillEffects(Value: Boolean); + procedure SetShowMoreColors(Value: Boolean); + procedure SetupButtons; + function TagToColor(ATag: Integer): TColor; + procedure UpButtons; + procedure WMKillFocus(var message: TWMKillFocus); message WM_KILLFOCUS; + procedure WMNCCalcSize(var message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCCreate(var message: TWMNCCreate); message WM_NCCREATE; + procedure WMNCDestroy(var message: TWMNCDestroy); message WM_NCDESTROY; + procedure WMNCPaint(var message: TWMNCPaint); message WM_NCPAINT; + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + + procedure Initialize(ABackground: TdxBackground; const APosition: TPoint; AData: TdxBackgroundDlgData); virtual; + property Color: TColor read FColor write SetColor; + public + constructor Create(AOwner: TComponent); override; + function Execute: Boolean; + + property AutoColor: TColor read FAutoColor write SetAutoColor; + property Background: TdxBackground read FBackground write SetBackground; + property BorderStyle: TFormBorderStyle read GetBorderStyle write SetBorderStyle; + property NoBtnCaption: string read FNoBtnCaption write SetNoBtnCaption; + property ShowFillEffects: Boolean read FShowFillEffects write SetShowFillEffects; + property ShowMoreColors: Boolean read FShowMoreColors write SetShowMoreColors; + end; + +function dxChooseBackgroundDlg(ABackground: TdxBackground; APosition: TPoint; + const AParams: PdxBackgroundDlgData): Boolean; overload; {$IFDEF DELPHI6} deprecated; {$ENDIF} +function dxChooseBackgroundDlg(ABackground: TdxBackground; APosition: TPoint; + const AParams: TdxBackgroundDlgData): Boolean; overload; +function dxDefaultBackgroundDlgData: TdxBackgroundDlgData; + +implementation + +{$R *.DFM} + +uses + cxClasses, dxPSRes, dxPSUtl, dxPSEngn, dxPSImgs, dxPSGlbl; + +function dxChooseBackgroundDlg(ABackground: TdxBackground; APosition: TPoint; + const AParams: PdxBackgroundDlgData): Boolean; +var + Params: TdxBackgroundDlgData; +begin + if AParams = nil then + Params := dxDefaultBackgroundDlgData + else + Params := AParams^; + Result := dxChooseBackgroundDlg(ABackground, APosition, Params); +end; + +function dxChooseBackgroundDlg(ABackground: TdxBackground; APosition: TPoint; + const AParams: TdxBackgroundDlgData): Boolean; +begin + with TdxfmColorPalette.Create(nil) do + try + Initialize(ABackground, APosition, AParams); + Result := Execute; + finally + Free; + end; +end; + +function dxDefaultBackgroundDlgData: TdxBackgroundDlgData; +//const +// BorderStyleMap: array[TdxPSLookAndFeel] of TBorderStyle = +begin + with Result do + begin + BorderStyle := Forms.bsNone; + FormCaption := cxGetResourceString(@sdxPageBackground); + NoBtnCaption := cxGetResourceString(@sdxBtnNoFill); + AutoColor := clBlack; + ShowFillEffects := True; + ShowMoreColors := True; + end; +end; + +{ TdxNoFillButton } + +type + TdxNoFillButton = class(TSpeedButton) + private + FColorGlyph: TBitmap; + FColorValue: TColor; + FShowColorValue: Boolean; + procedure SetColorValue(Value: TColor); + procedure SetShowColorValue(Value: Boolean); + procedure ChangeColorGlyph; + procedure CreateColorGlyph; + procedure DestroyColorGlyph; + protected + procedure Paint; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + property ColorValue: TColor read FColorValue write SetColorValue; + property ShowColorValue: Boolean read FShowColorValue write SetShowColorValue; + end; + +constructor TdxNoFillButton.Create(AOwner: TComponent); +begin + inherited; + FColorValue := clBlack; + ShowColorValue := False; +end; + +destructor TdxNoFillButton.Destroy; +begin + DestroyColorGlyph; + inherited; +end; + +procedure TdxNoFillButton.Paint; +var + R: TRect; +begin + inherited; + R := ClientRect; + InflateRect(R, -2, -2); + if Screen.PixelsPerInch > 96 then + InflateRect(R, -2, -2); + DrawEdge(Canvas.Handle, R, BDR_SUNKENOUTER, BF_RECT or BF_FLAT); +end; + +procedure TdxNoFillButton.CreateColorGlyph; +var + R: TRect; +begin + FColorGlyph := TBitmap.Create; + R := ClientRect; + InflateRect(R, -2, -2); + OffsetRect(R, -R.Left, -R.Top); + R.Right := R.Bottom - R.Top; + FColorGlyph.Width := R.Right - R.Left; + FColorGlyph.Height := R.Bottom - R.Top; + FrameRect(FColorGlyph.Canvas.Handle, R, GetSysColorBrush(COLOR_BTNSHADOW)); + ChangeColorGlyph; +end; + +procedure TdxNoFillButton.DestroyColorGlyph; +begin + Glyph := nil; + FreeAndNil(FColorGlyph); +end; + +procedure TdxNoFillButton.ChangeColorGlyph; +var + R: TRect; +begin + R := MakeRect(0, 0, FColorGlyph.Width, FColorGlyph.Height); + InflateRect(R, -1, -1); + FColorGlyph.Canvas.Brush.Color := ColorToRGB(ColorValue); + FColorGlyph.Canvas.FillRect(R); + Glyph := FColorGlyph; +end; + +procedure TdxNoFillButton.SetColorValue(Value: TColor); +begin + if FColorValue <> Value then + begin + FColorValue := Value; + if ShowColorValue then + begin + ChangeColorGlyph; + Invalidate; + end; + end; +end; + +procedure TdxNoFillButton.SetShowColorValue(Value: Boolean); +begin + if FShowColorValue <> Value then + begin + FShowColorValue := Value; + if FShowColorValue then + CreateColorGlyph + else + DestroyColorGlyph; + Invalidate; + end; +end; + +{ TdxfmColorPalette } + +constructor TdxfmColorPalette.Create(AOwner: TComponent); +begin + inherited; + ControlStyle := ControlStyle - [csCaptureMouse]; + FShowFillEffects := True; + FShowMoreColors := True; + InitControls; + LoadStrings; + + sbtnNoFill := TdxNoFillButton.Create(Self); + with sbtnNoFill do + begin + BoundsRect := bvlNoFillHolder.BoundsRect; + Parent := pnlTop; + Down := True; + AllowAllUp := False; + GroupIndex := 1; + Tag := MakeTTag(-1); + Flat := True; + Caption := FNoBtnCaption; + OnClick := ButtonClick; + end; + FormStyle := fsStayOnTop; +end; + +function TdxfmColorPalette.Execute: Boolean; +begin + FResult := mrNone; + Show; + while FResult = mrNone do Application.HandleMessage; + Result := FResult = mrOK; +end; + +procedure TdxfmColorPalette.CreateParams(var Params: TCreateParams); +begin + inherited; + Params.WindowClass.Style := Params.WindowClass.Style or CS_SAVEBITS; +end; + +procedure TdxfmColorPalette.KeyDown(var Key: Word; Shift: TShiftState); +begin + if (Key = VK_ESCAPE) or (ssAlt in Shift) then + Close + else + if Key = Ord('f') then + sBtnFillEffects.Click + else + if Key = Ord('b') then + sBtnMoreColors.Click + else + inherited; +end; + +procedure TdxfmColorPalette.Initialize(ABackground: TdxBackground; + const APosition: TPoint; AData: TdxBackgroundDlgData); +var + R: TRect; +begin + Background := ABackground; + + BorderStyle := AData.BorderStyle; + Caption := AData.FormCaption; + NoBtnCaption := AData.NoBtnCaption; + AutoColor := AData.AutoColor; + ShowFillEffects := AData.ShowFillEffects; + ShowMoreColors := AData.ShowMoreColors; + + Left := APosition.X; + Top := APosition.Y; + R := GetDesktopWorkArea; + + if Left + Width > R.Right then + Left := R.Right - Width; + if Left < R.Left then + Left := R.Left; + if Top + Height > R.Bottom then + Top := R.Bottom - Height; +end; + +procedure TdxfmColorPalette.WMKillFocus(var Message: TWMKillFocus); +begin + inherited; + FResult := mrCancel; + Hide; +end; + +procedure TdxfmColorPalette.WMNCCreate(var Message: TWMNCCreate); +var + SysMenu: HMENU; +begin + inherited; + SysMenu := GetSystemMenu(Handle, False); + DeleteMenu(SysMenu, SC_RESTORE, MF_BYCOMMAND); + DeleteMenu(SysMenu, SC_MINIMIZE, MF_BYCOMMAND); + DeleteMenu(SysMenu, SC_MAXIMIZE, MF_BYCOMMAND); + DeleteMenu(SysMenu, SC_SIZE, MF_BYCOMMAND); +end; + +procedure TdxfmColorPalette.WMNCDestroy(var Message: TWMNCDestroy); +begin + GetSystemMenu(Handle, True); + inherited; +end; + +procedure TdxfmColorPalette.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + if BorderStyle = bsNone then + InflateRect(TWMNCCalcSize(Message).CalcSize_Params^.rgrc[0], -2, -2) + else + inherited; +end; + +procedure TdxfmColorPalette.WMNCPaint(var message: TWMNCPaint); +var + R: TRect; + DC: HDC; +begin + if BorderStyle = bsNone then + begin + GetWindowRect(Handle, R); + OffsetRect(R, -R.Left, -R.Top); + DC := GetWindowDC(Handle); + try + DrawEdge(DC, R, EDGE_RAISED, BF_ADJUST or BF_RECT); + finally + ReleaseDC(Handle, DC); + end; + end + else + inherited; +end; + +procedure TdxfmColorPalette.SetNoBtnCaption(const Value: string); +begin + if FNoBtnCaption <> Value then + begin + FNoBtnCaption := Value; + sbtnNoFill.Caption := FNoBtnCaption; + end; +end; + +procedure TdxfmColorPalette.SetShowFillEffects(Value: Boolean); +begin + if FShowFillEffects <> Value then + begin + FShowFillEffects := Value; + pnlBottom.Visible := FShowMoreColors or FShowFillEffects; + pnlMiddle.Visible := pnlBottom.Visible; + AdjustHeight; + end; +end; + +procedure TdxfmColorPalette.SetShowMoreColors(Value: Boolean); +begin + if FShowMoreColors <> Value then + begin + FShowMoreColors := Value; + pnlBottom.Visible := FShowMoreColors or FShowFillEffects; + pnlMiddle.Visible := pnlBottom.Visible; + AdjustHeight; + end; +end; + +function TdxfmColorPalette.GetBorderStyle: TFormBorderStyle; +begin + Result := inherited BorderStyle; +end; + +procedure TdxfmColorPalette.SetBorderStyle(Value: TFormBorderStyle); +begin + inherited BorderStyle := Value; + AdjustHeight; +end; + +procedure TdxfmColorPalette.AdjustHeight; +var + H: Integer; +begin + H := pnlTop.Height; + if pnlMiddle.Visible then Inc(H, pnlMiddle.Height); + if pnlBottom.Visible then Inc(H, pnlBottom.Height); + ClientHeight := H; +end; + +procedure TdxfmColorPalette.InitControls; + + procedure PrepareButtonGlyph(AGlyph: TBitmap; I, J: Integer); + const + W = 16; + H = 16; + var + R: TRect; + begin + R := MakeRect(0, 0, W, H); + AGlyph.Width := W; + AGlyph.Height := H; + with AGlyph.Canvas do + begin + Brush.Color := clBtnFace; + FrameRect(R); + InflateRect(R, -1, -1); + FrameRect(R); + InflateRect(R, -1, -1); + + Brush.Color := clBtnShadow; + FrameRect(R); + InflateRect(R, -1, -1); + + Brush.Color := ColorToRGB(dxPaletteColors[I, J]); + FillRect(R); + end; + end; + + +var + I, J, Index: Integer; + ButtonName: string; +begin + for J := 0 to dxPaletteRowCount - 1 do + for I := 0 to dxPaletteColCount - 1 do + begin + Index := J * dxPaletteColCount + I; + ButtonName := 'SpeedButton' + Trim(IntToStr(Index + 1)); + FButtons[I, J] := TSpeedButton(Self.FindComponent(ButtonName)); + FButtons[I, J].Tag := MakeTTag(Index); + PrepareButtonGlyph(FButtons[I, J].Glyph, I, J); + end; +end; + +procedure TdxfmColorPalette.LoadStrings; +begin + sBtnMoreColors.Caption := cxGetResourceString(@sdxBtnMoreColors); + sBtnFillEffects.Caption := cxGetResourceString(@sdxBtnFillEffects); + + SpeedButton1.Hint := cxGetResourceString(@sdxColorBlack); + SpeedButton9.Hint := cxGetResourceString(@sdxColorDarkRed); + SpeedButton17.Hint := cxGetResourceString(@sdxColorRed); + SpeedButton25.Hint := cxGetResourceString(@sdxColorPink); + SpeedButton33.Hint := cxGetResourceString(@sdxColorRose); + SpeedButton2.Hint := cxGetResourceString(@sdxColorBrown); + SpeedButton10.Hint := cxGetResourceString(@sdxColorOrange); + SpeedButton18.Hint := cxGetResourceString(@sdxColorLightOrange); + SpeedButton26.Hint := cxGetResourceString(@sdxColorGold); + SpeedButton34.Hint := cxGetResourceString(@sdxColorTan); + SpeedButton3.Hint := cxGetResourceString(@sdxColorOliveGreen); + SpeedButton11.Hint := cxGetResourceString(@sdxColorDrakYellow); + SpeedButton19.Hint := cxGetResourceString(@sdxColorLime); + SpeedButton27.Hint := cxGetResourceString(@sdxColorYellow); + SpeedButton35.Hint := cxGetResourceString(@sdxColorLightYellow); + SpeedButton4.Hint := cxGetResourceString(@sdxColorDarkGreen); + SpeedButton12.Hint := cxGetResourceString(@sdxColorGreen); + SpeedButton20.Hint := cxGetResourceString(@sdxColorSeaGreen); + SpeedButton28.Hint := cxGetResourceString(@sdxColorBrighthGreen); + SpeedButton36.Hint := cxGetResourceString(@sdxColorLightGreen); + SpeedButton5.Hint := cxGetResourceString(@sdxColorDarkTeal); + SpeedButton13.Hint := cxGetResourceString(@sdxColorTeal); + SpeedButton21.Hint := cxGetResourceString(@sdxColorAqua); + SpeedButton29.Hint := cxGetResourceString(@sdxColorTurquoise); + SpeedButton37.Hint := cxGetResourceString(@sdxColorLightTurquoise); + SpeedButton6.Hint := cxGetResourceString(@sdxColorDarkBlue); + SpeedButton14.Hint := cxGetResourceString(@sdxColorBlue); + SpeedButton22.Hint := cxGetResourceString(@sdxColorLightBlue); + SpeedButton30.Hint := cxGetResourceString(@sdxColorSkyBlue); + SpeedButton38.Hint := cxGetResourceString(@sdxColorPaleBlue); + SpeedButton7.Hint := cxGetResourceString(@sdxColorIndigo); + SpeedButton15.Hint := cxGetResourceString(@sdxColorBlueGray); + SpeedButton23.Hint := cxGetResourceString(@sdxColorViolet); + SpeedButton31.Hint := cxGetResourceString(@sdxColorPlum); + SpeedButton39.Hint := cxGetResourceString(@sdxColorLavender); + SpeedButton8.Hint := cxGetResourceString(@sdxColorGray80); + SpeedButton16.Hint := cxGetResourceString(@sdxColorGray50); + SpeedButton24.Hint := cxGetResourceString(@sdxColorGray40); + SpeedButton32.Hint := cxGetResourceString(@sdxColorGray25); + SpeedButton40.Hint := cxGetResourceString(@sdxColorWhite); +end; + +procedure TdxfmColorPalette.SetColor(Value: TColor); +begin + FColor := Value; + FindButtonColor; +end; + +procedure TdxfmColorPalette.FindButtonColor; +var + I, J: Integer; +begin + for I := 0 to dxPaletteColCount - 1 do + for J := 0 to dxPaletteRowCount - 1 do + if FColor = dxPaletteColors[I, J] then + begin + FButtons[I, J].Down := True; + Exit; + end; + UpButtons; +end; + +procedure TdxfmColorPalette.UpButtons; +var + I, J: Integer; +begin + for I := 0 to dxPaletteColCount - 1 do + for J := 0 to dxPaletteRowCount - 1 do + begin + FButtons[I, J].AllowAllUp := True; + FButtons[I, J].Down := False; + end; + sbtnNoFill.AllowAllUp := True; + sbtnNoFill.Down := False; +end; + +procedure TdxfmColorPalette.sBtnMoreColorsClick(Sender: TObject); +begin + Hide; + dxPSGlbl.ColorDialog.Color := FColor; + if dxPSGlbl.ColorDialog.Execute then + begin + SetBackgroundColor(dxPSGlbl.ColorDialog.Color); + FResult := mrOK; + end + else + FResult := mrCancel; +end; + +procedure TdxfmColorPalette.sBtnFillEffectsClick(Sender: TObject); +const + ModalResults: array[Boolean] of TModalResult = (mrCancel, mrOK); +begin + Hide; + Application.ProcessMessages; + FResult := ModalResults[Background.SetupEffects]; +end; + +procedure TdxfmColorPalette.SetupButtons; +begin + if FBackground <> nil then + case FBackground.Mode of + bmNone: + sbtnNoFill.Down := True; + bmBrush: + Color := FBackground.Brush.Color + else // bmBrushBitmap, bmPicture + UpButtons; + end; +end; + +procedure TdxfmColorPalette.SetAutoColor(Value: TColor); +begin + if FAutoColor <> Value then + begin + FAutoColor := Value; + TdxNoFillButton(sbtnNoFill).ColorValue := FAutoColor; + end; +end; + +procedure TdxfmColorPalette.SetBackground(Value: TdxBackground); +begin + FBackground := Value; + SetupButtons; +end; + +function TdxfmColorPalette.TagToColor(ATag: Integer): TColor; +var + T: Integer; +begin + T := TTagToInt(ATag); + Result := dxPaletteColors[T - (T div dxPaletteColCount) * dxPaletteColCount, T div dxPaletteColCount]; +end; + +procedure TdxfmColorPalette.SetBackgroundColor(AColor: TColor); +begin + with Background do + begin + BeginUpdate; + try + Mode := bmBrush; + Brush.Style := bsSolid; + Brush.Color := AColor; + finally + EndUpdate; + end; + end; +end; + +procedure TdxfmColorPalette.ButtonClick(Sender: TObject); +begin + if TTagToInt(TSpeedButton(Sender).Tag) = -1 then // No Fill + Background.Clear + else + SetBackgroundColor(TagToColor(TSpeedButton(Sender).Tag)); + FResult := mrOk; +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxfmDTFmt.dfm b/official/x.35/ExpressPrinting System/Sources/dxfmDTFmt.dfm new file mode 100644 index 00000000..e1c293f9 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxfmDTFmt.dfm @@ -0,0 +1,110 @@ +object dxfmDateTimeFormats: TdxfmDateTimeFormats + Left = 350 + Top = 153 + ActiveControl = lbxDateFormats + BorderStyle = bsDialog + Caption = 'Change Date and Time Formats' + ClientHeight = 342 + ClientWidth = 282 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object btnOK: TButton + Left = 41 + Top = 313 + Width = 75 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 122 + Top = 313 + Width = 75 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object btnHelp: TButton + Left = 203 + Top = 313 + Width = 75 + Height = 23 + Caption = '&Help' + TabOrder = 3 + end + object GroupBox1: TGroupBox + Left = 4 + Top = 4 + Width = 274 + Height = 301 + TabOrder = 0 + object lblAvailableDateFormats: TLabel + Left = 10 + Top = 13 + Width = 115 + Height = 13 + Caption = 'Available &Date Formats:' + FocusControl = lbxDateFormats + OnClick = lblAvailableDateFormatsClick + end + object lblAvailableTimeFormats: TLabel + Left = 10 + Top = 187 + Width = 114 + Height = 13 + Caption = 'Available Time &Formats:' + FocusControl = lbxTimeFormats + OnClick = lblAvailableDateFormatsClick + end + object lbxDateFormats: TListBox + Left = 8 + Top = 28 + Width = 257 + Height = 150 + ItemHeight = 13 + TabOrder = 0 + OnClick = lbxDateFormatsClick + OnDblClick = lbxDTFormatsDblClick + end + object lbxTimeFormats: TListBox + Left = 8 + Top = 203 + Width = 257 + Height = 59 + ItemHeight = 13 + TabOrder = 1 + OnClick = TimeFormatsChanged + OnDblClick = lbxDTFormatsDblClick + end + object chbxAutoUpdate: TCheckBox + Left = 8 + Top = 274 + Width = 160 + Height = 17 + Caption = '&Update Automatically ' + TabOrder = 2 + OnClick = chbxAutoUpdateClick + end + object btnDefault: TButton + Left = 175 + Top = 270 + Width = 90 + Height = 23 + Caption = '&Default ...' + TabOrder = 3 + OnClick = btnDefaultClick + end + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxfmDTFmt.pas b/official/x.35/ExpressPrinting System/Sources/dxfmDTFmt.pas new file mode 100644 index 00000000..44d11c15 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxfmDTFmt.pas @@ -0,0 +1,301 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxfmDTFmt; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + ComCtrls, StdCtrls, ExtCtrls, dxPSForm; + +type + TdxfmDateTimeFormats = class(TCustomdxPSForm) + btnOK: TButton; + btnCancel: TButton; + btnHelp: TButton; + GroupBox1: TGroupBox; + lblAvailableDateFormats: TLabel; + lbxDateFormats: TListBox; + lblAvailableTimeFormats: TLabel; + lbxTimeFormats: TListBox; + chbxAutoUpdate: TCheckBox; + btnDefault: TButton; + procedure btnDefaultClick(Sender: TObject); + procedure TimeFormatsChanged(Sender: TObject); + procedure lblAvailableDateFormatsClick(Sender: TObject); + procedure lbxDateFormatsClick(Sender: TObject); + procedure chbxAutoUpdateClick(Sender: TObject); + procedure lbxDTFormatsDblClick(Sender: TObject); + private + FAutoUpdateDateTime: Boolean; + FControlsUpdating: Boolean; + FDateFormatIndex: Integer; + FDateFormats: TStrings; + FDTFormatIndexChanged: Boolean; + FModified: Boolean; + FSetDateTimeFormatAsDefault: Boolean; + FTimeFormatIndex: Integer; + FTimeFormats: TStrings; + + procedure CheckModified; + procedure LoadStrings; + procedure SetDateFormats(Value: TStrings); + procedure SetTimeFormats(Value: TStrings); + procedure StartSettings; + procedure UpdateControlsState; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function Execute: Boolean; + + property AutoUpdateDateTime: Boolean read FAutoUpdateDateTime write FAutoUpdateDateTime; + property DateFormatIndex: Integer read FDateFormatIndex write FDateFormatIndex; + property DateFormats: TStrings read FDateFormats write SetDateFormats; + property SetDateTimeFormatAsDefault: Boolean read FSetDateTimeFormatAsDefault + write FSetDateTimeFormatAsDefault; + property TimeFormatIndex: Integer read FTimeFormatIndex write FTimeFormatIndex; + property TimeFormats: TStrings read FTimeFormats write SetTimeFormats; + end; + + PdxDateTimeFormatDlgData = ^TdxDateTimeFormatDlgData; + TdxDateTimeFormatDlgData = record + AutoUpdateDateTime: Boolean; + DateFormatIndex: Integer; + DateFormats: TStrings; + ShowAsDefaultButton: Boolean; + SetDateTimeFormatAsDefault: Boolean; + TimeFormatIndex: Integer; + TimeFormats: TStrings; + HelpContext: THelpContext; + end; + +function dxShowDateTimeFormatDlg(var AFormatsDlgData: TdxDateTimeFormatDlgData): Boolean; + +implementation + +{$R *.DFM} + +uses + Registry, cxClasses, dxExtCtrls, dxPSRes, dxPSGlbl, dxPSUtl, dxPgsDlg; + +function dxShowDateTimeFormatDlg(var AFormatsDlgData: TdxDateTimeFormatDlgData): Boolean; + + function CheckFormats: Boolean; + begin + with AFormatsDlgData do + Result := (DateFormats <> nil) and (TimeFormats <> nil) and + (DateFormatIndex > -1) and (DateFormatIndex < DateFormats.Count) and + (TimeFormatIndex > -1) and (TimeFormatIndex < TimeFormats.Count - 1); + end; + +var + Dialog: TdxfmDateTimeFormats; +begin + Result := False; + if not CheckFormats then Exit; + + Dialog := TdxfmDateTimeFormats.Create(nil); + try + with AFormatsDlgData do + begin + Dialog.AutoUpdateDateTime := AutoUpdateDateTime; + Dialog.DateFormats := DateFormats; + Dialog.FDateFormatIndex := DateFormatIndex; + Dialog.TimeFormats := TimeFormats; + Dialog.FTimeFormatIndex := TimeFormatIndex; + Dialog.AutoUpdateDateTime := AutoUpdateDateTime; + Dialog.btnDefault.Visible := ShowAsDefaultButton; + if HelpContext <> 0 then + Dialog.HelpContext := HelpContext; + end; + Result := Dialog.Execute; + if Result then + with AFormatsDlgData do + begin + DateFormatIndex := Dialog.DateFormatIndex; + TimeFormatIndex := Dialog.TimeFormatIndex; + AutoUpdateDateTime := Dialog.AutoUpdateDateTime; + SetDateTimeFormatAsDefault := Dialog.SetDateTimeFormatAsDefault; + end; + finally + Dialog.Free; + end; +end; + +{ TdxfmDateTimeFormats } + +constructor TdxfmDateTimeFormats.Create(AOwner: TComponent); +begin + inherited; + HelpContext := dxhcDateTimeFormatDlg; + btnHelp.Visible := HelpContext <> 0; + if HelpContext <> 0 then + BorderIcons := BorderIcons + [biHelp] + else + begin + btnOK.BoundsRect := btnCancel.BoundsRect; + btnCancel.BoundsRect := btnHelp.BoundsRect; + end; + FDateFormats := TStringList.Create; + FTimeFormats := TStringList.Create; + LoadStrings; +end; + +destructor TdxfmDateTimeFormats.Destroy; +begin + FTimeFormats.Free; + FDateFormats.Free; + inherited; +end; + +procedure TdxfmDateTimeFormats.SetDateFormats(Value: TStrings); +begin + DateFormats.Assign(Value); +end; + +procedure TdxfmDateTimeFormats.SetTimeFormats(Value: TStrings); +begin + TimeFormats.Assign(Value); +end; + +procedure TdxfmDateTimeFormats.UpdateControlsState; +begin + btnDefault.Enabled := (lbxDateFormats.ItemIndex > -1) and (lbxTimeFormats.ItemIndex > -1); + // btnOK.Enabled := FModified; +end; + +procedure TdxfmDateTimeFormats.CheckModified; +begin + FModified := True; + UpdateControlsState; +end; + +procedure TdxfmDateTimeFormats.StartSettings; +begin + FControlsUpdating := True; + try + with lbxDateFormats do + begin + Items.Clear; + GetFormatedDateStrings(Date, DateFormats, Items); + if Items.Count > 0 then ItemIndex := FDateFormatIndex; + end; + with lbxTimeFormats do + begin + Items.Clear; + GetFormatedTimeStrings(Time, TimeFormats, Items); + if (Items.Count > 0) then ItemIndex := FTimeFormatIndex; + end; + chbxAutoUpdate.Checked := AutoUpdateDateTime; + finally + FControlsUpdating := false; + end; + UpdateControlsState; +end; + +procedure TdxfmDateTimeFormats.LoadStrings; +begin + Caption := cxGetResourceString(@sdxDTFormatsCaption); + btnOK.Caption := cxGetResourceString(@sdxBtnOK); + btnCancel.Caption := cxGetResourceString(@sdxBtnCancel); + btnHelp.Caption := cxGetResourceString(@sdxBtnHelp); + btnDefault.Caption := cxGetResourceString(@sdxBtnDefault); + lblAvailableDateFormats.Caption := cxGetResourceString(@sdxDTFormatsAvailableDateFormats); + lblAvailableTimeFormats.Caption := cxGetResourceString(@sdxDTFormatsAvailableTimeFormats); + chbxAutoUpdate.Caption := cxGetResourceString(@sdxDTFormatsAutoUpdate); +end; + +function TdxfmDateTimeFormats.Execute: Boolean; +begin + StartSettings; + FModified := False; + Result := (ShowModal = mrOK) and FModified; +end; + +procedure TdxfmDateTimeFormats.btnDefaultClick(Sender: TObject); +var + S: string; +begin + try + S := Format(cxGetResourceString(@sdxDTFormatsChangeDefaultFormat), + [lbxDateFormats.Items[lbxDateFormats.ItemIndex], + lbxTimeFormats.Items[lbxTimeFormats.ItemIndex]]); + if MessageQuestion(S) then + begin + FSetDateTimeFormatAsDefault := True; + CheckModified; + end; + except + Application.HandleException(Self); + end; +end; + +procedure TdxfmDateTimeFormats.lbxDateFormatsClick(Sender: TObject); +begin + if FControlsUpdating then Exit; + DateFormatIndex := TListBox(Sender).ItemIndex; + FDTFormatIndexChanged := True; + CheckModified; +end; + +procedure TdxfmDateTimeFormats.TimeFormatsChanged(Sender: TObject); +begin + if FControlsUpdating then Exit; + TimeFormatIndex := TListBox(Sender).ItemIndex; + FDTFormatIndexChanged := True; + CheckModified; +end; + +procedure TdxfmDateTimeFormats.chbxAutoUpdateClick(Sender: TObject); +begin + if FControlsUpdating then Exit; + AutoUpdateDateTime := TCheckBox(Sender).Checked; + CheckModified; +end; + +procedure TdxfmDateTimeFormats.lblAvailableDateFormatsClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; +end; + +procedure TdxfmDateTimeFormats.lbxDTFormatsDblClick(Sender: TObject); +begin + ModalResult := mrOk; +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxfmDfnStl.dfm b/official/x.35/ExpressPrinting System/Sources/dxfmDfnStl.dfm new file mode 100644 index 00000000..51fb4289 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxfmDfnStl.dfm @@ -0,0 +1,413 @@ +object dxfmDefinePrintStyles: TdxfmDefinePrintStyles + Left = 414 + Top = 232 + ActiveControl = lbxPrintStyles + BorderStyle = bsDialog + Caption = 'Define Print Styles' + ClientHeight = 193 + ClientWidth = 282 + Color = clBtnFace + Constraints.MinHeight = 220 + Constraints.MinWidth = 290 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Icon.Data = { + 0000010001001010100000000000280100001600000028000000100000002000 + 00000100040000000000C0000000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000004 + 4444000000004444474F444440004477774FFFF440004477774FFFF440004477 + 774FFFF440004477774FFFF440004477774FFFF444444477774FFFF44F444477 + 7474FFF44F44044447774444FF440004477774FFFF440004477774FFFF440004 + 477774FFFF4400044777404FFF4400004444000444400000000000000000E0FF + 0000000700000007000000070000000700000007000000000000000000000000 + 000080000000E0000000E0000000E0000000E0400000F0E10000FFFF0000} + KeyPreview = True + OldCreateOrder = True + Position = poScreenCenter + OnResize = FormResize + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object lblPrintStyles: TLabel + Left = 3 + Top = 5 + Width = 58 + Height = 13 + Caption = 'Print &Styles:' + FocusControl = lbxPrintStyles + end + object btnEdit: TButton + Left = 196 + Top = 24 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Edit...' + TabOrder = 0 + OnClick = EditClick + end + object btnCopy: TButton + Left = 196 + Top = 53 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Copy...' + TabOrder = 1 + OnClick = CopyClick + end + object btnReset: TButton + Left = 196 + Top = 82 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Reset...' + TabOrder = 2 + OnClick = ResetClick + end + object btnClose: TButton + Left = 196 + Top = 133 + Width = 80 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Close' + Default = True + ModalResult = 1 + TabOrder = 3 + end + object btnHelp: TButton + Left = 196 + Top = 162 + Width = 80 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = '&Help' + ModalResult = 1 + TabOrder = 4 + end + object lbxPrintStyles: TListBox + Left = 0 + Top = 24 + Width = 189 + Height = 169 + Anchors = [akLeft, akTop, akRight, akBottom] + ItemHeight = 34 + PopupMenu = pmPrintStyles + Style = lbOwnerDrawFixed + TabOrder = 5 + OnClick = lbxPrintStylesClick + OnDblClick = EditClick + OnDrawItem = lbxPrintStylesDrawItem + end + object pmPrintStyles: TPopupMenu + OnPopup = pmPrintStylesPopup + Left = 26 + Top = 120 + object miEdit: TMenuItem + Caption = '&Edit ...' + Default = True + ShortCut = 16397 + OnClick = EditClick + end + object miLine1: TMenuItem + Caption = '-' + end + object miCopy: TMenuItem + Caption = '&Copy ...' + ShortCut = 45 + OnClick = CopyClick + end + object miReset: TMenuItem + Caption = '&Reset ...' + OnClick = ResetClick + end + object miClear: TMenuItem + Caption = 'C&lear ...' + OnClick = ClearClick + end + end + object ilPrintStyles: TImageList + AllocBy = 2 + Left = 54 + Top = 120 + Bitmap = { + 494C010104000800040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000002000000001002000000000000020 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008400000084000000840000008400000084000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000840000008400000084000000840000008400 + 0000840000008400000084000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000840000008400 + 0000840000008400000084000000840000008400000084000000840000008400 + 0000840000008400000084000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000008400000084000000840000008400 + 000084000000840000008484840084000000FFFFFF0084000000840000008400 + 0000840000008400000084000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF000000000000000000000000000000 + 000000000000FFFFFF0084000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0084000000840000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF000000000000000000000000000000 + 000000000000FFFFFF0084000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0084000000840000000000000000000000FFFFFF00000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF0000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0084000000840000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF000000000000000000FFFFFF008400 + 0000840000008400000084000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0084000000840000000000000000000000FFFFFF00000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 0000FFFFFF008400000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0084000000840000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0084000000840000000000000000000000FFFFFF00000000000000 + 0000FFFFFF000000000084000000840000008400000084000000840000008400 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 84008484840084848400840000000000000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0084000000840000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF000000 + 0000000000000000000000000000000000000000000084000000840000008400 + 0000840000008400000000000000000000000000000084000000840000008400 + 00008400000084000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + F83FFC01FFF9C0070001FC01E7FFC0070001FC01C3F3C00700010001C3E7C007 + 00010001E1C7C00700010001F08FC00700010001F81FC00700010003FC3FC007 + 00010007F81FC0070001000FF09FC007010100FFC1C7C00F838301FF83E3C01F + FFFF03FF8FF1C03FFFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxfmDfnStl.pas b/official/x.35/ExpressPrinting System/Sources/dxfmDfnStl.pas new file mode 100644 index 00000000..ae51be1a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxfmDfnStl.pas @@ -0,0 +1,482 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxfmDfnStl; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ComCtrls, ExtCtrls, Menus, ImgList, dxPSESys, dxPSForm, dxPgsDlg; + +type + TdxfmDefinePrintStyles = class(TCustomdxPSForm) + pmPrintStyles: TPopupMenu; + miEdit: TMenuItem; + miLine1: TMenuItem; + miCopy: TMenuItem; + miReset: TMenuItem; + ilPrintStyles: TImageList; + miClear: TMenuItem; + btnEdit: TButton; + btnCopy: TButton; + btnReset: TButton; + btnClose: TButton; + btnHelp: TButton; + lbxPrintStyles: TListBox; + lblPrintStyles: TLabel; + procedure EditClick(Sender: TObject); + procedure CopyClick(Sender: TObject); + procedure ResetClick(Sender: TObject); + procedure pmPrintStylesPopup(Sender: TObject); + procedure lbxPrintStylesClick(Sender: TObject); + procedure lbxPrintStylesDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure ClearClick(Sender: TObject); + procedure FormResize(Sender: TObject); + procedure FormShow(Sender: TObject); + private + FPrevClassStyle: DWORD; + FPrevWindowProc: TWndMethod; + FSubscriber: TdxEventSubscriber; + FBtnDelCaptions: array[Boolean] of string; + FBtnCopyCaptions: array[Boolean] of string; + FPreviewBtnClicked: Boolean; + FPrintBtnClicked: Boolean; + FStyleManager: TdxPrintStyleManager; + procedure SetStyleManager(Value: TdxPrintStyleManager); + + procedure AddPrintStyle(AClonedIndex: Integer); + procedure FillRestSpace(DC: hDC); + procedure Initialize; + procedure LoadStrings; + procedure RefreshStyleList; + procedure StyleListChanged(Sender: TObject); + procedure UpdateControlsState; + + procedure ListBoxWndProc(var Message: TMessage); + procedure RestoreWndProc; + procedure SubstWindowProc; + protected + procedure CreateWnd; override; + procedure BeforeConstruction; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function Execute: Boolean; + + property PreviewBtnClicked: Boolean read FPreviewBtnClicked; + property PrintBtnClicked: Boolean read FPrintBtnClicked; + property StyleManager: TdxPrintStyleManager read FStyleManager write SetStyleManager; + end; + + PdxDefinePrintStylesDlgData = ^TdxDefinePrintStylesDlgData; + TdxDefinePrintStylesDlgData = record + StyleManager: TdxPrintStyleManager; + Title: string; + PreviewBtnClicked: Boolean; + PrintBtnClicked: Boolean; + end; + +procedure dxDefinePrintStylesDlg(var AData: TdxDefinePrintStylesDlgData); + +implementation + +{$R *.DFM} + +uses + Registry, cxClasses, dxPSRes, dxPSEngn, dxPSEvnt, dxPSPopupMan, dxPSGlbl, + dxPSUtl; + +procedure dxDefinePrintStylesDlg(var AData: TdxDefinePrintStylesDlgData); +var + Dialog: TdxfmDefinePrintStyles; +begin + if AData.StyleManager = nil then + begin + AData.PreviewBtnClicked := False; + AData.PrintBtnClicked := False; + Exit; + end; + Dialog := TdxfmDefinePrintStyles.Create(nil); + try + Dialog.StyleManager := AData.StyleManager; + Dialog.Caption := AData.Title; + Dialog.Execute; + Dialog.StyleManager := nil; + AData.PreviewBtnClicked := Dialog.PreviewBtnClicked; + AData.PrintBtnClicked := Dialog.PrintBtnClicked; + finally + Dialog.Free; + end; +end; + +function MessageWarning(const Message: string): Boolean; +begin + MessageBeep(MB_ICONEXCLAMATION); + Result := IDOK = Application.MessageBox(PChar(Message), + PChar(Application.Title), MB_OKCANCEL or MB_ICONEXCLAMATION); +end; + +{ TfmdxDefinePrintStyles } + +constructor TdxfmDefinePrintStyles.Create(AOwner: TComponent); +begin + HelpContext := dxhcDefinePrintStyleDlg; + inherited; + + pmPrintStyles.Images := ilPrintStyles; + miEdit.ImageIndex := 0; + miCopy.ImageIndex := 1; + + FSubscriber := TdxStyleListChangedSubscriber.Create([TdxSMStyleListChangedEvent]); + TdxStyleListChangedSubscriber(FSubscriber).OnStyleListChanged := StyleListChanged; + SubstWindowProc; + dxPSPopupMenuController.RegisterControl(lbxPrintStyles); + LoadStrings; +end; + +destructor TdxfmDefinePrintStyles.Destroy; +begin + dxPSPopupMenuController.UnregisterControl(lbxPrintStyles); + RestoreWndProc; + FreeAndNil(FSubscriber); + inherited; +end; + +function TdxfmDefinePrintStyles.Execute: Boolean; +begin + Initialize; + ShowModal; + Result := True; + if (StyleManager <> nil) and (lbxPrintStyles.ItemIndex <> -1) then + StyleManager.CurrentStyleIndex := lbxPrintStyles.ItemIndex; +end; + +procedure TdxfmDefinePrintStyles.CreateWnd; +begin + inherited; + SendMessage(Handle, WM_SETICON, 1, Icon.Handle); +end; + +procedure TdxfmDefinePrintStyles.BeforeConstruction; +begin + inherited; + Options := Options + [foSizeableDialog]; +end; + +procedure TdxfmDefinePrintStyles.SetStyleManager(Value: TdxPrintStyleManager); +begin + if FStyleManager <> Value then + begin + FStyleManager := Value; + if FStyleManager <> nil then + begin + Caption := Value.Title; + if Value.HelpContext <> 0 then HelpContext := Value.HelpContext; + end; + end; +end; + +procedure TdxfmDefinePrintStyles.AddPrintStyle(AClonedIndex: Integer); +var + Style: TBasedxPrintStyle; + Result: Boolean; +begin + Result := False; + Style := StyleManager.BeginClone(AClonedIndex); + if Style = nil then Exit; + try + Result := Style.PageSetup(0, True, True, FPreviewBtnClicked, FPrintBtnClicked); + if Result or FPreviewBtnClicked or FPrintBtnClicked then + begin + lbxPrintStyles.Items.AddObject(Style.StyleCaption, Style); + lbxPrintStyles.ItemIndex := lbxPrintStyles.Items.IndexOfObject(Style); + end; + finally + StyleManager.EndClone(Style); + if not Result then Style.Free; + end; + + if PreviewBtnClicked or PrintBtnClicked then + ModalResult := mrOK + else + if lbxPrintStyles.ItemIndex <> -1 then + lbxPrintStylesClick(lbxPrintStyles); +end; + +procedure TdxfmDefinePrintStyles.FillRestSpace(DC: hDC); +var + R: TRect; +begin + with lbxPrintStyles do + begin + SendMessage(Handle, LB_GETITEMRECT, Items.Count - 1, LPARAM(@R)); + if R.Bottom < ClientHeight then + begin + R := MakeRect(0, R.Bottom, ClientWidth, ClientHeight); + FillRect(DC, R, GetSysColorBrush(COLOR_WINDOW)); + end; + end; +end; + +procedure TdxfmDefinePrintStyles.Initialize; +begin + TdxStyleListChangedSubscriber(FSubscriber).StyleListChanged(StyleManager); + btnHelp.Visible := HelpContext <> 0; + if btnHelp.Visible then + BorderIcons := BorderIcons + [biHelp]; + if not btnHelp.Visible then + btnClose.BoundsRect := btnHelp.BoundsRect; + ActiveControl := lbxPrintStyles; + UpdateControlsState; +end; + +procedure TdxfmDefinePrintStyles.LoadStrings; +begin + Caption := cxGetResourceString(@sdxDefinePrintStylesCaption); + lblPrintStyles.Caption := cxGetResourceString(@sdxDefinePrintStylesTitle); + btnEdit.Caption := cxGetResourceString(@sdxBtnEdit); + btnCopy.Caption := cxGetResourceString(@sdxBtnCopy); + FBtnDelCaptions[False] := cxGetResourceString(@sdxBtnDelete); + FBtnDelCaptions[True] := cxGetResourceString(@sdxBtnReset); + FBtnCopyCaptions[False] := cxGetResourceString(@sdxBtnNew); + FBtnCopyCaptions[True] := cxGetResourceString(@sdxBtnCopy); + btnClose.Caption := cxGetResourceString(@sdxBtnClose); + btnHelp.Caption := cxGetResourceString(@sdxBtnHelp); + miEdit.Caption := cxGetResourceString(@sdxBtnEdit); + miCopy.Caption := cxGetResourceString(@sdxBtnCopy); + miClear.Caption := cxGetResourceString(@sdxClear); +end; + +procedure TdxfmDefinePrintStyles.RefreshStyleList; +var + SavedStyle, Style: TBasedxPrintStyle; + I, Index: Integer; +begin + if FStyleManager <> nil then + begin + if lbxPrintStyles.ItemIndex <> -1 then + SavedStyle := TBasedxPrintStyle(lbxPrintStyles.Items.Objects[lbxPrintStyles.ItemIndex]) + else + SavedStyle := FStyleManager.CurrentStyle; + + with lbxPrintStyles.Items do + begin + BeginUpdate; + try + Clear; + for I := 0 to FStyleManager.Count - 1 do + begin + Style := FStyleManager[I]; + AddObject(Style.StyleCaption, Style); + end; + finally + EndUpdate; + end; + end; + + if lbxPrintStyles.Items.Count > 0 then + begin + Index := lbxPrintStyles.Items.IndexOfObject(SavedStyle); + if Index = -1 then + Index := FStyleManager.CurrentStyleIndex; + lbxPrintStyles.ItemIndex := Index; + lbxPrintStylesClick(lbxPrintStyles); + end; + end; +end; + +procedure TdxfmDefinePrintStyles.StyleListChanged(Sender: TObject); +begin + if Sender = StyleManager then + begin + RefreshStyleList; + UpdateControlsState; + end; +end; + +procedure TdxfmDefinePrintStyles.UpdateControlsState; +begin + btnEdit.Enabled := lbxPrintStyles.ItemIndex > -1; + btnReset.Enabled := lbxPrintStyles.ItemIndex > -1; + btnCopy.Caption := FBtnCopyCaptions[lbxPrintStyles.Items.Count > 0]; + if lbxPrintStyles.Items.Count > 0 then + miCopy.ImageIndex := 1 + else + miCopy.ImageIndex := 3; +end; + +procedure TdxfmDefinePrintStyles.ListBoxWndProc(var Message: TMessage); +begin + if Message.Msg = WM_ERASEBKGND then + begin + with TWMEraseBkgnd(Message) do + FillRestSpace(DC); + Message.Result := 1; + end + else + FPrevWindowProc(Message); +end; + +procedure TdxfmDefinePrintStyles.RestoreWndProc; +begin + lbxPrintStyles.WindowProc := FPrevWindowProc; + SetClassLong(lbxPrintStyles.Handle, GCL_STYLE, FPrevClassStyle); +end; + +procedure TdxfmDefinePrintStyles.SubstWindowProc; +begin + lbxPrintStyles.HandleNeeded; + FPrevClassStyle := GetClassLong(lbxPrintStyles.Handle, GCL_STYLE); + SetClassLong(lbxPrintStyles.Handle, GCL_STYLE, FPrevClassStyle or CS_HREDRAW); + FPrevWindowProc := lbxPrintStyles.WindowProc; + lbxPrintStyles.WindowProc := ListBoxWndProc; +end; + +procedure TdxfmDefinePrintStyles.FormResize(Sender: TObject); +var + Rgn, Rgn2: HRGN; + I: Integer; +begin + Rgn := CreateRectRgnIndirect(ClientRect); + for I := 0 to ControlCount - 1 do + begin + Rgn2 := CreateRectRgnIndirect(Controls[I].ClientRect); + CombineRgn(Rgn, Rgn, Rgn2, RGN_DIFF); + DeleteObject(Rgn2); + end; + InvalidateRgn(Handle, Rgn, True); + DeleteObject(Rgn); +end; + +procedure TdxfmDefinePrintStyles.FormShow(Sender: TObject); +begin + FormResize(nil); +end; + +procedure TdxfmDefinePrintStyles.EditClick(Sender: TObject); +var + AStyle: TBasedxPrintStyle; +begin + with lbxPrintStyles do + AStyle := TBasedxPrintStyle(Items.Objects[ItemIndex]); + if AStyle.PageSetup(0, True, True, FPreviewBtnClicked, FPrintBtnClicked) then + StyleListChanged(StyleManager); + if PreviewBtnClicked or PrintBtnClicked then + ModalResult := mrOK; +end; + +procedure TdxfmDefinePrintStyles.CopyClick(Sender: TObject); +begin + AddPrintStyle(lbxPrintStyles.ItemIndex); +end; + +procedure TdxfmDefinePrintStyles.ResetClick(Sender: TObject); +var + Style: TBasedxPrintStyle; + S: string; +begin + Style := TBasedxPrintStyle(lbxPrintStyles.Items.Objects[lbxPrintStyles.ItemIndex]); + + if not Style.BuiltIn then + begin + S := Format(cxGetResourceString(@sdxDefinePrintStylesWarningDelete), [Style.StyleCaption]); + if MessageWarning(S) then Style.Free; + end + else + Style.RestoreDefaults; + UpdateControlsState; +end; + +procedure TdxfmDefinePrintStyles.pmPrintStylesPopup(Sender: TObject); +begin + with lbxPrintStyles do + begin + miEdit.Enabled := ItemIndex > -1; + miReset.Enabled := ItemIndex > -1; + miClear.Enabled := StyleManager.NonBuiltInsExists; + + if ItemIndex > -1 then + miReset.Caption := FBtnDelCaptions[TBasedxPrintStyle(Items.Objects[ItemIndex]).BuiltIn]; + + miCopy.Caption := FBtnCopyCaptions[Items.Count > 0]; + end; +end; + +procedure TdxfmDefinePrintStyles.lbxPrintStylesClick(Sender: TObject); +var + PrintStyle: TBasedxPrintStyle; +begin + with TListBox(Sender) do + begin + PrintStyle := nil; + if ItemIndex <> -1 then + PrintStyle := StyleManager[ItemIndex]; + btnReset.Caption := FBtnDelCaptions[(PrintStyle <> nil) and PrintStyle.BuiltIn]; + miReset.Caption := btnReset.Caption; + if (PrintStyle <> nil) and PrintStyle.BuiltIn then + begin + miReset.ShortCut := TShortCut(0); + miReset.ImageIndex := -1; + end + else + begin + miReset.ShortCut := ShortCut(VK_DELETE, []); + miReset.ImageIndex := 2; + end; + UpdateControlsState; + end; +end; + +procedure TdxfmDefinePrintStyles.lbxPrintStylesDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +begin + dxPSDrawStyleItem(TBasedxPrintStyle(lbxPrintStyles.Items.Objects[Index]), + TListBox(Control), Index, State, Rect, True, False); + + if Index = lbxPrintStyles.Items.Count - 1 then + FillRestSpace(lbxPrintStyles.Canvas.Handle); +end; + +procedure TdxfmDefinePrintStyles.ClearClick(Sender: TObject); +begin + if MessageWarning(cxGetResourceString(@sdxDefinePrintStylesWarningClear)) then + StyleManager.DeleteNonBuiltIns; +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxfmMnPg.pas b/official/x.35/ExpressPrinting System/Sources/dxfmMnPg.pas new file mode 100644 index 00000000..f8f155a4 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxfmMnPg.pas @@ -0,0 +1,760 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxfmMnPg; + +interface + +{$I cxVer.inc} + +uses + Windows, Classes, Controls, ImgList, Graphics; + +function dxChooseMultiplePages(AImageList: TCustomImageList; AImageIndex: Integer; + AOrigin: TPoint; AYShift: Integer; AMaxColCount, AMaxRowCount: Integer; + var AColCount, ARowCount: Integer): Boolean; + +implementation + +uses + Messages, SysUtils, Forms, CommCtrl, Math, cxClasses, dxPSGlbl, dxPSEngn, + dxPSRes, dxPSUtl; + +const + CellSize = 26; + +type + TdxGrowDirection = (gdTopLeft, gdTopRight, gdBottomRight, gdBottomLeft); + + TfmPageChooser = class(TCustomForm) + private + FColCount: Integer; + FDesktop: TRect; + FGrowDirection: TdxGrowDirection; + FilCell: TCustomImageList; + FImageIndex: Integer; + FIsMousePressed: Boolean; + FIsTextAtBottom: Boolean; + FLastMousePos: TPoint; + FMaxColCount: Integer; + FMaxRowCount: Integer; + FResult: TModalResult; + FRowCount: Integer; + FSelectedColCount: Integer; + FSelectedRowCount: Integer; + function GetBottomBounds: TRect; + function GetBottomHeight: Integer; + function GetCellBounds(ACol, ARow: Integer): TRect; + function GetCellHeight: Integer; + function GetCellWidth: Integer; + function GetSelectedBounds: TRect; + function IsSelectedCell(ACol, ARow: Integer): Boolean; + procedure SetColCount(Value: Integer); + procedure SetRowCount(Value: Integer); + procedure SetSelectedCells(ACol, ARow: Integer); + procedure SetSelectedColCount(Value: Integer); + procedure SetSelectedRowCount(Value: Integer); + + procedure DoSelectCells(X, Y: Integer); + procedure ProcessKey(var Key: Word); + procedure ProcessSelect(AColCount, ARowCount: Integer; GrowFlag: Boolean); + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND; + procedure WMKillFocus(var Message: TWMKillFocus); message WM_KILLFOCUS; + procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCLButtonDown(var Message: TWMNCLButtonDown); message WM_NCLBUTTONDOWN; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure Paint; override; + + property BottomBounds: TRect read GetBottomBounds; + property BottomHeight: Integer read GetBottomHeight; + property CellHeight: Integer read GetCellHeight; + property CellWidth: Integer read GetCellWidth; + property ColCount: Integer read FColCount write SetColCount; + property MaxColCount: Integer read FMaxColCount; + property MaxRowCount: Integer read FMaxRowCount; + property RowCount: Integer read FRowCount write SetRowCount; + property SelectedBounds: TRect read GetSelectedBounds; + property SelectedColCount: Integer read FSelectedColCount write SetSelectedColCount; + property SelectedRowCount: Integer read FSelectedRowCount write SetSelectedRowCount; + public + constructor CreateNew(AOwner: TComponent; Dummy: Integer = 0); override; + property Height; + property MouseCapture; + property Width; + end; + +function dxChooseMultiplePages(AImageList: TCustomImageList; AImageIndex: Integer; + AOrigin: TPoint; AYShift: Integer; AMaxColCount, AMaxRowCount: Integer; + var AColCount, ARowCount: Integer): Boolean; +var + AForm: TfmPageChooser; +begin + AForm := TfmPageChooser.CreateNew(nil, 0); + try + with AForm do + begin + FilCell := AImageList; + FImageIndex := AImageIndex; + FMaxColCount := AMaxColCount; + FMaxRowCount := AMaxRowCount; + Left := AOrigin.X; + Top := AOrigin.Y; + + if (AOrigin.Y + AColCount * CellWidth + 4 {non client} + 2 {frame} > FDesktop.Bottom) then + if (AOrigin.X + AColCount * CellWidth + 4 {non client} + 2 {frame} > FDesktop.Right) then + FGrowDirection := gdTopLeft + else + FGrowDirection := gdTopRight + else + if (AOrigin.X + AColCount * CellWidth + 4 {non client} + 2 {frame} > FDesktop.Right) then + FGrowDirection := gdBottomLeft + else + FGrowDirection := gdBottomRight; + + if (FGrowDirection in [gdTopLeft, gdBottomLeft]) then + Left := FDesktop.Right - Width; + + if (FGrowDirection in [gdTopLeft, gdTopRight]) then + Top := Top - Height - AYShift; + FIsTextAtBottom := FGrowDirection in [gdBottomRight, gdBottomLeft]; + ColCount := AColCount; + RowCount := ARowCount; + + Show; + MouseCapture := True; + try + while FResult = mrNone do Application.ProcessMessages; + finally + MouseCapture := False; + end; + Result := (FResult = mrOK) and (SelectedColCount > 0) and (SelectedRowCount > 0); + if Result then + begin + AColCount := SelectedColCount; + ARowCount := SelectedRowCount; + end; + end + finally + AForm.Free; + end; +end; + +{ TfmPageChooser } + +constructor TfmPageChooser.CreateNew(AOwner: TComponent; Dummy: Integer = 0); +begin + inherited CreateNew(AOwner, Dummy); +{$IFDEF DELPHI9} + Position := poDesigned; + PopupMode := pmAuto; +{$ENDIF} + BorderStyle := bsNone; + BorderIcons := []; + FIsMousePressed := False; + FIsTextAtBottom := True; + FDesktop := GetDesktopWorkArea; +end; + +procedure TfmPageChooser.CreateParams(var Params: TCreateParams); +begin + inherited; + Params.WindowClass.Style := Params.WindowClass.Style or CS_SAVEBITS; +end; + +procedure TfmPageChooser.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited; + if (ssAlt in Shift) or (Key = VK_ESCAPE) then + FResult := mrCancel + else + if Key = VK_RETURN then + FResult := mrOk + else + if Key in [VK_LEFT, VK_UP, VK_RIGHT, VK_DOWN] then + ProcessKey(Key); +end; + +procedure TfmPageChooser.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + inherited; + if PtInRect(ClientRect, MakePoint(X, Y)) then + FIsMousePressed := True + else + FResult := mrCancel; +end; + +procedure TfmPageChooser.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited; + if (FLastMousePos.X <> X) or (FLastMousePos.Y <> Y) then + begin + DoSelectCells(X, Y); + FLastMousePos := MakePoint(X, Y); + end; +end; + +procedure TfmPageChooser.Paint; + + function GetCellColor(AnIsSelected: Boolean): TColor; + begin + if AnIsSelected then + Result := clHighlight + else + Result := clWindow; + end; + + function GetFillColor: TColor; + begin + if dxPSEngine.LookAndFeel = pslfStandard then + Result := clHighLight + else + Result := clWindow; + end; + + function GetFrameColor: TColor; + begin + if dxPSEngine.LookAndFeel = pslfStandard then + Result := clBtnFace + else + Result := clWindow; + end; + + procedure DrawCell(ACol, ARow: Integer); + var + R: TRect; + begin + R := GetCellBounds(ACol, ARow); + if RectVisible(Canvas.Handle, R) then + begin + Canvas.Brush.Color := GetFrameColor; + Canvas.FrameRect(R); + InflateRect(R, -1, -1); + + Canvas.Brush.Color := clBtnShadow; + Canvas.FrameRect(R); + InflateRect(R, -1, -1); + + Canvas.Brush.Color := GetCellColor(IsSelectedCell(ACol, ARow)); + Canvas.FillRect(R); + InflateRect(R, -3, -3); + if (FilCell <> nil) and (FImageIndex > -1) and (FImageIndex < FilCell.Count) then + FilCell.Draw(Canvas, R.Left, R.Top, FImageIndex); + end; + end; + + procedure DrawBottomPart; + + function GetText: string; + begin + if (SelectedRowCount > 0) and (SelectedColCount > 0) then + Result := Format('%d x %d %s', [SelectedRowCount, SelectedColCount, cxGetResourceString(@sdxPages)]) + else + Result := cxGetResourceString(@sdxCancel); + end; + + var + R: TRect; + S: string; + X, Y: Integer; + begin + R := BottomBounds; + if RectVisible(Canvas.Handle, R) then + begin + Canvas.Brush.Color := GetFrameColor; + if FIsTextAtBottom then + begin + Canvas.FillRect(MakeRect(R.Left, R.Top, R.Right, R.Top + 1)); + Inc(R.Top); + end + else + begin + Dec(R.Bottom); + Canvas.FillRect(MakeRect(R.Left, R.Bottom, R.Right, R.Bottom + 1)); + end; + + Canvas.Brush.Color := GetFrameColor; + Canvas.FrameRect(R); + InflateRect(R, -1, -1); + + if dxPSEngine.LookAndFeel = pslfStandard then + DrawEdge(Canvas.Handle, R, BDR_SUNKENOUTER, BF_RECT or BF_MIDDLE) + else + begin + Canvas.Brush.Color := clWindow; + Canvas.FillRect(R); + end; + InflateRect(R, -1, -1); + + Canvas.Brush.Style := bsClear; + S := GetText; + with R do + begin + X := Left + (Right - Left - Canvas.TextWidth(S)) div 2; + Y := Top + (Bottom - Top - Canvas.TextHeight(S)) div 2; + end; + Canvas.TextOut(X, Y, S); + Canvas.Brush.Style := bsSolid; + end; + end; + +var + Col, Row: Integer; +begin + Canvas.Brush.Color := GetFrameColor; + Canvas.FrameRect(ClientRect); + + for Col := 0 to ColCount - 1 do + for Row := 0 to RowCount - 1 do + DrawCell(Col, Row); + + DrawBottomPart; +end; + +function TfmPageChooser.GetBottomBounds: TRect; +begin + Result := ClientRect; + InflateRect(Result, -1, -1); + with Result do + if FIsTextAtBottom then + Top := Bottom - BottomHeight + else + Bottom := Top + BottomHeight; +end; + +function TfmPageChooser.GetBottomHeight: Integer; +begin + Result := MulDiv(-Font.Height, PixelsPerInch, 72) + 6; +end; + +function TfmPageChooser.GetCellBounds(ACol, ARow: Integer): TRect; +var + CR: TRect; + ATop, ALeft: Integer; +begin + Windows.GetClientRect(Handle, CR); + case FGrowDirection of + gdTopLeft: + begin + ALeft := CR.Right - (ACol + 1) * CellWidth - 1; + ATop := CR.Bottom - (ARow + 1) * CellHeight - 1; + if FIsTextAtBottom then Dec(ATop, BottomHeight); + end; + + gdTopRight: + begin + ALeft := 1 + ACol * CellWidth; + ATop := CR.Bottom - (ARow + 1) * CellHeight - 1; + if FIsTextAtBottom then Dec(ATop, BottomHeight); + end; + + gdBottomRight: + begin + ALeft := 1 + ACol * CellWidth; + ATop := 1 + ARow * CellHeight; + if not FIsTextAtBottom then Inc(ATop, BottomHeight); + end; + + else {gdBottomLeft} + begin + ALeft := CR.Right - (ACol + 1) * CellWidth - 1; + ATop := 1 + ARow * CellHeight; + if not FIsTextAtBottom then Inc(ATop, BottomHeight); + end; + end; + Result := MakeBounds(ALeft, ATop, CellWidth, CellHeight); +end; + +function TfmPageChooser.GetCellHeight: Integer; +begin + if FilCell <> nil then + Result := MulDiv(FilCell.Height, 3, 2) + 2 + else + Result := CellSize; +end; + +function TfmPageChooser.GetCellWidth: Integer; +begin + if FilCell <> nil then + Result := MulDiv(FilCell.Width, 3, 2) + 2 + else + Result := CellSize; +end; + +function TfmPageChooser.GetSelectedBounds: TRect; +var + ALeft, ATop, ARight, ABottom: Integer; +begin + Result := NullRect; + if (SelectedColCount > 0) or (SelectedRowCount > 0) then + begin + case FGrowDirection of + gdTopLeft: + begin + with GetCellBounds(SelectedColCount - 1, SelectedRowCount - 1) do + begin + ALeft := Left; + ATop := Top; + end; + with GetCellBounds(0, 0) do + begin + ARight := Right; + ABottom := Bottom; + end; + end; + + gdTopRight: + begin + with GetCellBounds(0, 0) do + begin + ALeft := Left; + ABottom := Bottom; + end; + with GetCellBounds(SelectedColCount - 1, SelectedRowCount - 1) do + begin + ARight := Right; + ATop := Top; + end; + end; + + gdBottomRight: + begin + with GetCellBounds(0, 0) do + begin + ALeft := Left; + ATop := Top; + end; + with GetCellBounds(SelectedColCount - 1, SelectedRowCount - 1) do + begin + ARight := Right; + ABottom := Bottom; + end; + end; + + else {gdBottomLeft} + begin + with GetCellBounds(SelectedColCount - 1, SelectedRowCount - 1) do + begin + ALeft := Left; + ABottom := Bottom; + end; + with GetCellBounds(0, 0) do + begin + ARight := Right; + ATop := Top; + end; + end; + end; + Result := MakeRect(ALeft, ATop, ARight, ABottom); + end; +end; + +function TfmPageChooser.IsSelectedCell(ACol, ARow: Integer): Boolean; +begin + Result := (ACol < SelectedColCount) and (ARow < SelectedRowCount); +end; + +procedure TfmPageChooser.SetColCount(Value: Integer); +var + NewWidth, OldLeft: Integer; +begin + if (FColCount = 0) or ((Value > FColCount) and (Value <= MaxColCount)) then + begin + FColCount := Value; + NewWidth := Value * CellWidth + 2 {frame}; + if FGrowDirection in [gdTopLeft, gdBottomLeft] then + begin + Inc(NewWidth, 4 {non client}); + SetBounds(Left - (NewWidth - Width), Top, NewWidth, Height); + Inc(FLastMousePos.X, CellWidth); + end + else + begin + OldLeft := Left; // Bug in Delphi 8 :-))) + ClientWidth := NewWidth; + Left := OldLeft; + end; + SelectedColCount := FColCount - 1; + UpdateWindow(Handle); + end; +end; + +procedure TfmPageChooser.SetRowCount(Value: Integer); +var + NewHeight, OldTop: Integer; + R1, R2: TRect; +begin + if (FRowCount = 0) or ((Value > FRowCount) and (Value <= MaxRowCount)) then + begin + FRowCount := Value; + NewHeight := Value * CellHeight + BottomHeight + 2; + if (FGrowDirection in [gdTopLeft, gdTopRight]) then + begin + Inc(NewHeight, 4 {not client}); + SetBounds(Left, Top - (NewHeight - Height), Width, NewHeight); + Inc(FLastMousePos.Y, CellWidth); + end + else + begin + OldTop := Top; // Bug in Delphi 8 :-))) + ClientHeight := NewHeight; + Top := OldTop; + end; + + if SelectedColCount < ColCount then + begin + R1 := GetCellBounds(SelectedColCount - 1, SelectedRowCount - 1); + if not (FGrowDirection in [gdTopLeft, gdBottomLeft]) then + OffsetRect(R1, CellWidth, CellHeight); + R2 := GetCellBounds(ColCount - 1, RowCount - 1); + if not (FGrowDirection in [gdTopLeft, gdBottomLeft]) then + OffsetRect(R2, CellWidth, CellHeight); + UnionRect(R1, R1, R2); + InvalidateRect(Handle, @R1, False); + end; + SelectedRowCount := FRowCount - 1; + end; +end; + +procedure TfmPageChooser.SetSelectedCells(ACol, ARow: Integer); +var + Rgn1, Rgn2: HRGN; +begin + Rgn1 := CreateRectRgnIndirect(SelectedBounds); + Rgn2 := CreateRectRgnIndirect(BottomBounds); + CombineRgn(Rgn1, Rgn1, Rgn2, RGN_OR); + DeleteObject(Rgn2); + FSelectedColCount := ACol; + FSelectedRowCount := ARow; + Rgn2 := CreateRectRgnIndirect(SelectedBounds); + CombineRgn(Rgn1, Rgn1, Rgn2, RGN_XOR); + DeleteObject(Rgn2); + InvalidateRgn(Handle, Rgn1, False); + Rgn2 := CreateRectRgnIndirect(BottomBounds); + CombineRgn(Rgn1, Rgn1, Rgn2, RGN_OR); + DeleteObject(Rgn2); + InvalidateRgn(Handle, Rgn1, False); + DeleteObject(Rgn1); +end; + +procedure TfmPageChooser.SetSelectedColCount(Value: Integer); +begin + SetSelectedCells(Value, SelectedRowCount); +end; + +procedure TfmPageChooser.SetSelectedRowCount(Value: Integer); +begin + SetSelectedCells(SelectedColCount, Value); +end; + +procedure TfmPageChooser.DoSelectCells(X, Y: Integer); +var + AColCount, ARowCount: Integer; +begin + if FGrowDirection in [gdTopLeft, gdBottomLeft] then + AColCount := Ceil((Width - X - 2 {frame} - 4 {non client}) / CellWidth) + else + AColCount := Ceil(X / CellWidth); + + if FIsTextAtBottom then + ARowCount := Ceil(Y / CellHeight) + else + ARowCount := Ceil((Height - Y - 2 {frame} - 4 {non client}) / CellHeight); + + if (FGrowDirection in [gdTopRight, gdBottomRight]) and + (Left + (AColCount * CellWidth + 2 {frame}) + 4 {non client} > FDesktop.Right) then + Dec(AColCount); + if (FGrowDirection in [gdTopLeft, gdTopRight]) and + (Top + (ARowCount * CellHeight + BottomHeight + 2 {frame}) + 4 {non client} > FDesktop.Bottom) then + Dec(ARowCount); + ProcessSelect(AColCount, ARowCount, FIsMousePressed); +end; + +procedure TfmPageChooser.ProcessKey(var Key: Word); +var + AColCount, ARowCount: Integer; +begin + AColCount := 0; + ARowCount := 0; + case Key of + VK_LEFT: + if FGrowDirection in [gdTopLeft, gdBottomLeft] then + begin + AColCount := SelectedColCount + 1; + ARowCount := SelectedRowCount; + if ARowCount = 0 then ARowCount := 1; + end + else + begin + AColCount := SelectedColCount - 1; + if AColCount < 1 then AColCount := 1; + ARowCount := SelectedRowCount; + end; + VK_UP: + if FGrowDirection in [gdTopRight, gdTopLeft] then + begin + ARowCount := SelectedRowCount + 1; + AColCount := SelectedColCount; + if AColCount = 0 then AColCount := 1; + end + else + begin + ARowCount := SelectedRowCount - 1; + if ARowCount < 1 then ARowCount := 1; + AColCount := SelectedColCount; + end; + VK_RIGHT: + if FGrowDirection in [gdTopLeft, gdBottomLeft] then + begin + AColCount := SelectedColCount - 1; + if AColCount < 1 then AColCount := 1; + ARowCount := SelectedRowCount; + end + else + begin + AColCount := SelectedColCount + 1; + ARowCount := SelectedRowCount; + if ARowCount = 0 then ARowCount := 1; + end; + VK_DOWN: + if FGrowDirection in [gdTopRight, gdTopLeft] then + begin + ARowCount := SelectedRowCount - 1; + if ARowCount < 1 then ARowCount := 1; + AColCount := SelectedColCount; + end + else + begin + ARowCount := SelectedRowCount + 1; + AColCount := SelectedColCount; + if AColCount = 0 then AColCount := 1; + end; + end; + ProcessSelect(AColCount, ARowCount, True); + Key := 0; +end; + +procedure TfmPageChooser.ProcessSelect(AColCount, ARowCount: Integer; GrowFlag: Boolean); +begin + if GrowFlag then + begin + if (SelectedRowCount <> 0) and (SelectedColCount <> 0) then + begin + RowCount := ARowCount; + ColCount := AColCount; + end + end + else + begin + if AColCount > ColCount then AColCount := 0; + if ARowCount > RowCount then ARowCount := 0; + end; + + if AColCount < 0 then + AColCount := 0 + else + if AColCount > ColCount then + AColCount := ColCount; + + if ARowCount < 0 then + ARowCount := 0 + else + if ARowCount > RowCount then + ARowCount := RowCount; + + SetSelectedCells(AColCount, ARowCount); +end; + +procedure TfmPageChooser.WMEraseBkgnd(var Message: TWMEraseBkgnd); +begin + Message.Result := 1; +end; + +procedure TfmPageChooser.WMKillFocus(var Message: TWMKillFocus); +begin + inherited; + FResult := mrCancel; +end; + +procedure TfmPageChooser.WMLButtonUp(var Message: TWMLButtonUp); +begin + inherited; + if SelectedRowCount * SelectedColCount > 0 then + FResult := mrOk + else + FResult := mrCancel; +end; + +procedure TfmPageChooser.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + InflateRect(Message.CalcSize_Params^.rgrc[0], -2, -2); +end; + +procedure TfmPageChooser.WMNCLButtonDown(var Message: TWMNCLButtonDown); +begin + inherited; + FResult := mrCancel; +end; + +procedure TfmPageChooser.WMNCPaint(var Message: TWMNCPaint); +var + R: TRect; + DC: HDC; +begin + GetWindowRect(Handle, R); + OffsetRect(R, -R.Left, -R.Top); + DC := GetWindowDC(Handle); + try + if dxPSEngine.LookAndFeel = pslfStandard then + DrawEdge(DC, R, EDGE_RAISED, BF_RECT) + else + begin + FrameRect(DC, R, GetSysColorBrush(COLOR_BTNSHADOW)); + InflateRect(R, -1, -1); + FrameRect(DC, R, GetSysColorBrush(COLOR_WINDOW)); + end; + finally + ReleaseDC(Handle, DC); + end; + inherited; +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxfmPNFmt.dfm b/official/x.35/ExpressPrinting System/Sources/dxfmPNFmt.dfm new file mode 100644 index 00000000..a740ce3b --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxfmPNFmt.dfm @@ -0,0 +1,144 @@ +object dxfmPageNumberFormat: TdxfmPageNumberFormat + Left = 434 + Top = 210 + BorderStyle = bsDialog + Caption = 'Change Page Number Format' + ClientHeight = 209 + ClientWidth = 247 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object lblPageNumberFormat: TLabel + Left = 6 + Top = 15 + Width = 78 + Height = 13 + Caption = 'Number &Format:' + FocusControl = cbxPageNumberingFormat + OnClick = lblPageNumberFormatClick + end + object bvlStartAtHolder: TBevel + Left = 113 + Top = 93 + Width = 129 + Height = 22 + Visible = False + end + object bvlPageNumbering: TBevel + Left = 111 + Top = 49 + Width = 132 + Height = 5 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object Bevel2: TBevel + Left = 6 + Top = 119 + Width = 237 + Height = 5 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object lblPageNumbering: TLabel + Left = 7 + Top = 45 + Width = 78 + Height = 13 + Caption = 'Page Numbering' + end + object Bevel3: TBevel + Left = 6 + Top = 166 + Width = 237 + Height = 4 + Anchors = [akLeft, akRight, akBottom] + Shape = bsBottomLine + end + object btnOK: TButton + Left = 6 + Top = 180 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object btnCancel: TButton + Left = 87 + Top = 180 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + object btnHelp: TButton + Left = 168 + Top = 180 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Caption = '&Help' + TabOrder = 2 + end + object cbxPageNumberingFormat: TComboBox + Left = 113 + Top = 12 + Width = 130 + Height = 21 + Style = csDropDownList + Anchors = [akLeft, akTop, akRight] + ItemHeight = 13 + TabOrder = 3 + OnChange = cbxPageNumberingFormatChange + Items.Strings = ( + '1, 2, 3, 3, 4, ...' + 'a, b, c, d, e, ...' + 'A, B, C, D, E, ...' + 'i, ii, iii, iv, v, ...' + 'I, II, III, IV, V, ...') + end + object btnDefault: TButton + Left = 154 + Top = 135 + Width = 89 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Default...' + TabOrder = 4 + OnClick = btnDefaultClick + end + object rbtnContinueFromPrevSection: TRadioButton + Left = 13 + Top = 69 + Width = 228 + Height = 17 + Anchors = [akLeft, akTop, akRight] + Caption = 'Continue from Previous Section' + Checked = True + TabOrder = 5 + TabStop = True + OnClick = rbtnContinueFromPrevSectionClick + end + object rbtnStartAt: TRadioButton + Left = 13 + Top = 96 + Width = 92 + Height = 17 + Caption = 'Start &at:' + TabOrder = 6 + OnClick = rbtnStartAtClick + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxfmPNFmt.pas b/official/x.35/ExpressPrinting System/Sources/dxfmPNFmt.pas new file mode 100644 index 00000000..2800d4d0 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxfmPNFmt.pas @@ -0,0 +1,442 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxfmPNFmt; + +interface + +{$I cxVer.inc} + +uses + Windows, SysUtils, Classes, Graphics, Controls, Forms, StdCtrls, ExtCtrls, + dxPSForm, dxPSGlbl; + +type + TdxfmPageNumberFormat = class(TCustomdxPSForm) + btnOK: TButton; + btnCancel: TButton; + btnHelp: TButton; + lblPageNumberFormat: TLabel; + bvlStartAtHolder: TBevel; + bvlPageNumbering: TBevel; + Bevel2: TBevel; + cbxPageNumberingFormat: TComboBox; + btnDefault: TButton; + rbtnContinueFromPrevSection: TRadioButton; + rbtnStartAt: TRadioButton; + lblPageNumbering: TLabel; + Bevel3: TBevel; + procedure cbxPageNumberingFormatChange(Sender: TObject); + procedure btnDefaultClick(Sender: TObject); + procedure lblPageNumberFormatClick(Sender: TObject); + procedure rbtnStartAtClick(Sender: TObject); + procedure rbtnContinueFromPrevSectionClick(Sender: TObject); + private + FseStartAt: TCustomEdit; + FAllowContinueFromPrevSection: Boolean; + FControlsUpdating: Boolean; + FContinueFromPrevSection: Boolean; + FModified: Boolean; + FPageNumberFormats: TStrings; + FPageNumberFormat: TdxPageNumberFormat; + FStartPageIndex: Integer; + FSetPageNumberingFormatAsDefault: Boolean; + procedure CheckModified; + procedure CreateControls; + procedure Initialize; + procedure LoadStrings; + procedure SetContinueFromPrevSection(Value: Boolean); + procedure SetPageNumberFormats(Value: TStrings); + procedure StartAtChanged(Sender: TObject); + procedure StartatExit(Sender: TObject); + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function Execute: Boolean; + property AllowContinueFromPrevSection: Boolean read FAllowContinueFromPrevSection write FAllowContinueFromPrevSection; + property ContinueFromPrevSection: Boolean read FContinueFromPrevSection write SetContinueFromPrevSection; + property PageNumberFormats: TStrings read FPageNumberFormats write SetPageNumberFormats; + property PageNumberFormat: TdxPageNumberFormat read FPageNumberFormat write FPageNumberFormat; + property SetPageNumberingFormatAsDefault: Boolean read FSetPageNumberingFormatAsDefault write FSetPageNumberingFormatAsDefault; + property StartPageIndex: Integer read FStartPageIndex write FStartPageIndex; + end; + + PdxPageNumberFormatDlgData = ^TdxPageNumberFormatDlgData; + TdxPageNumberFormatDlgData = record + PageNumberFormats: TStrings; + PageNumberFormat: TdxPageNumberFormat; + ContinueFromPrevSection: Boolean; + StartPageIndex: Integer; + AllowContinueFromPrevSection: Boolean; + ShowAsDefaultButton: Boolean; + SetPageNumberFormatAsDefault: Boolean; + HelpContext: THelpContext; + end; + +function dxShowPageNumberFormatDlg(var AFormatsDlgData: TdxPageNumberFormatDlgData): Boolean; + +implementation + +{$R *.DFM} + +uses + Registry, cxClasses, dxExtCtrls, dxPSRes, dxPSUtl; + +function dxShowPageNumberFormatDlg(var AFormatsDlgData: TdxPageNumberFormatDlgData): Boolean; +var + Dialog: TdxfmPageNumberFormat; +begin + Result := False; + if AFormatsDlgData.PageNumberFormats = nil then Exit; + + Dialog := TdxfmPageNumberFormat.Create(nil); + try + with AFormatsDlgData do + begin + Dialog.AllowContinueFromPrevSection := AllowContinueFromPrevSection; + Dialog.FContinueFromPrevSection := ContinueFromPrevSection; + Dialog.PageNumberFormats := PageNumberFormats; + Dialog.FPageNumberFormat := PageNumberFormat; + Dialog.FStartPageIndex := StartPageIndex; + Dialog.btnDefault.Visible := ShowAsDefaultButton; + if HelpContext <> 0 then + Dialog.HelpContext := HelpContext; + end; + Result := Dialog.Execute; + if Result then + with AFormatsDlgData do + begin + PageNumberFormat := TdxPageNumberFormat(Dialog.PageNumberFormat); + ContinueFromPrevSection := Dialog.ContinueFromPrevSection; + StartPageIndex := Dialog.StartPageIndex; + SetPageNumberFormatAsDefault := Dialog.SetPageNumberingFormatAsDefault; + end; + finally + Dialog.Free; + end; +end; + +procedure PlaceBavel(ABevel: TBevel; AControl: TControl); +var + RightBound: Integer; +begin + RightBound := ABevel.BoundsRect.Right; + ABevel.Left := AControl.Left + AControl.Width + 10; + ABevel.Width := RightBound - ABevel.Left; +end; + +type + TdxIntValueType = (ivtDecimal, ivtLiteral, ivtCapitalLiteral, ivtRoman, ivtCapitalRoman); + + TdxPSValueEdit = class(TdxPSSpinEdit) + private + FIntValueType: TdxIntValueType; + procedure SetIntValueType(Value: TdxIntValueType); + protected + function IsValidChar(Key: Char): Boolean; override; + function GetValue: Extended; override; + procedure SetValue(NewValue: Extended); override; + public + constructor Create(AOwner: TComponent); override; + published + property IntValueType: TdxIntValueType read FIntValueType write SetIntValueType default ivtDecimal; + end; + +constructor TdxPSValueEdit.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FIntValueType := ivtDecimal; + MinValue := 1; + DefaultValue := 1; +end; + +procedure TdxPSValueEdit.SetIntValueType(Value: TdxIntValueType); +var + V: Integer; +begin + if FIntValueType <> Value then + begin + V := AsInteger; + FIntValueType := Value; + AsInteger := V; + end; +end; + +function TdxPSValueEdit.IsValidChar(Key: Char): Boolean; +const + RomanChars: string = 'cdilmxv'; + CapitalRomanChars: string = 'CDILMXV'; +begin + if ValueType = svtFloat then + Result := inherited IsValidChar(Key) + else + case IntValueType of + ivtDecimal: + Result := (Key <> '-') and inherited IsValidChar(Key); + ivtLiteral: + Result := Key in ['a'..'z']; + ivtCapitalLiteral: + Result := Key in ['A'..'Z']; + ivtRoman: + Result := Pos(Key, RomanChars) <> 0; + else //ivtCapitalRoman + Result := Pos(Key, CapitalRomanChars) <> 0; + end; +end; + +function TdxPSValueEdit.GetValue: Extended; +var + S: string; +begin + if (ValueType = svtFloat) or (IntValueType = ivtDecimal) then + Result := inherited GetValue + else + try + S := Trim(GetValueText); + if S <> '' then + case IntValueType of + ivtLiteral: + Result := Chars2Int(S, False); + ivtCapitalLiteral: + Result := Chars2Int(S, True); + ivtRoman: + Result := Roman2Int(S, False); + else //ivtCapitalRomans + Result := Roman2Int(S, True); + end + else + Result := 1; + Result := CheckValue(Result); + except + Result := Trunc(DefaultValue); + end; +end; + +procedure TdxPSValueEdit.SetValue(NewValue: Extended); +begin + if (ValueType = svtFloat) or (IntValueType = ivtDecimal) then + inherited SetValue(NewValue) + else + case IntValueType of + ivtLiteral: + Text := Int2Chars(Round(CheckValue(NewValue)), False); + ivtCapitalLiteral: + Text := Int2Chars(Round(CheckValue(NewValue)), True); + ivtRoman: + Text := Int2Roman(Round(CheckValue(NewValue)), False); + else //ivtCapitalRoman + Text := Int2Roman(Round(CheckValue(NewValue)), True); + end; +end; + +{ TdxfmPageNumberFormat } + +constructor TdxfmPageNumberFormat.Create(AOwner: TComponent); +begin + inherited; + + HelpContext := dxhcPageNumberFormatDlg; + btnHelp.Visible := HelpContext <> 0; + if HelpContext = 0 then + begin + btnOK.BoundsRect := btnCancel.BoundsRect; + btnCancel.BoundsRect := btnHelp.BoundsRect; + end + else + BorderIcons := BorderIcons + [biHelp]; + + FPageNumberFormats := TStringList.Create; + CreateControls; + LoadStrings; +end; + +destructor TdxfmPageNumberFormat.Destroy; +begin + FreeAndNil(FPageNumberFormats); + inherited; +end; + +function TdxfmPageNumberFormat.Execute: Boolean; +begin + Initialize; + FModified := False; + Result := (ShowModal = mrOK) and FModified; +end; + +procedure TdxfmPageNumberFormat.CheckModified; +begin + FModified := True; +end; + +procedure TdxfmPageNumberFormat.CreateControls; +begin + FseStartAt := TdxPSValueEdit.Create(Self); + with TdxPSValueEdit(FseStartAt) do + begin + Parent := Self; + TabOrder := rbtnStartAt.TabOrder + 1; + BoundsRect := bvlStartAtHolder.BoundsRect; + ValueType := svtInteger; + MinValue := 1; + MaxValue := 10000; + Value := 1; + OnChange := StartAtChanged; + OnExit := StartAtExit; + end; +end; + +procedure TdxfmPageNumberFormat.Initialize; +begin + FControlsUpdating := True; + try + with cbxPageNumberingFormat do + begin + Items.BeginUpdate; + try + Items.Clear; + Items := FPageNumberFormats; + ItemIndex := Integer(PageNumberFormat); + finally + Items.EndUpdate; + end; + end; + rbtnContinueFromPrevSection.Enabled := AllowContinueFromPrevSection; + //rbtnStartAt.Enabled := AllowContinueFromPrevSection; + rbtnContinueFromPrevSection.Checked := ContinueFromPrevSection; + rbtnStartAt.Checked := not ContinueFromPrevSection; + + TdxPSValueEdit(FseStartAt).IntValueType := TdxIntValueType(PageNumberFormat); + if AllowContinueFromPrevSection and ContinueFromPrevSection then + TdxPSValueEdit(FseStartAt).Text := '' + else + TdxPSValueEdit(FseStartAt).AsInteger := StartPageIndex; + finally + FControlsUpdating := False; + end; +end; + +procedure TdxfmPageNumberFormat.SetContinueFromPrevSection(Value: Boolean); +begin + if FContinueFromPrevSection <> Value then + begin + FContinueFromPrevSection := Value; + FControlsUpdating := True; + try + rbtnContinueFromPrevSection.Checked := FContinueFromPrevSection; + rbtnStartAt.Checked := not FContinueFromPrevSection; + if FContinueFromPrevSection then + TdxPSValueEdit(FseStartAt).Text := '' + else + TdxPSValueEdit(FseStartAt).AsInteger := 1; + finally + FControlsUpdating := False; + end; + end; +end; + +procedure TdxfmPageNumberFormat.SetPageNumberFormats(Value: TStrings); +begin + FPageNumberFormats.Assign(Value); +end; + +procedure TdxfmPageNumberFormat.LoadStrings; +begin + Caption := cxGetResourceString(@sdxPNFormatsCaption); + btnOK.Caption := cxGetResourceString(@sdxBtnOK); + btnCancel.Caption := cxGetResourceString(@sdxBtnCancel); + btnHelp.Caption := cxGetResourceString(@sdxBtnHelp); + btnDefault.Caption := cxGetResourceString(@sdxBtnDefault); + lblPageNumberFormat.Caption := cxGetResourceString(@sdxPNFormatsNumberFormat); + lblPageNumbering.Caption := cxGetResourceString(@sdxPageNumbering); + PlaceBavel(bvlPageNumbering, lblPageNumbering); + rbtnContinueFromPrevSection.Caption := cxGetResourceString(@sdxPNFormatsContinueFromPrevious); + rbtnStartAt.Caption := cxGetResourceString(@sdxPNFormatsStartAt); +end; + +procedure TdxfmPageNumberFormat.cbxPageNumberingFormatChange(Sender: TObject); +begin + if FControlsUpdating then Exit; + TdxPSValueEdit(FseStartAt).IntValueType := TdxIntValueType(TComboBox(Sender).ItemIndex); + FPageNumberFormat := TdxPageNumberFormat(TComboBox(Sender).ItemIndex); + CheckModified; +end; + +procedure TdxfmPageNumberFormat.StartAtChanged(Sender: TObject); +begin + if FControlsUpdating then Exit; + rbtnStartAt.Checked := True; + CheckModified; +end; + +procedure TdxfmPageNumberFormat.StartAtExit(Sender: TObject); +begin + FStartPageIndex := TdxPSSpinEdit(Sender).AsInteger; +end; + +procedure TdxfmPageNumberFormat.btnDefaultClick(Sender: TObject); +var + S : string; +begin + S := Format(cxGetResourceString(@sdxPNFormatsChangeDefaultFormat), + [cbxPageNumberingFormat.Items[cbxPageNumberingFormat.ItemIndex]]); + if MessageQuestion(S) then + begin + FSetPageNumberingFormatAsDefault := True; + CheckModified; + end; +end; + +procedure TdxfmPageNumberFormat.lblPageNumberFormatClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; + TComboBox(ActiveControl).DroppedDown := True; +end; + +procedure TdxfmPageNumberFormat.rbtnStartAtClick(Sender: TObject); +begin + if FControlsUpdating then Exit; + ContinueFromPrevSection := False; + ActiveControl := FseStartAt; + CheckModified; +end; + +procedure TdxfmPageNumberFormat.rbtnContinueFromPrevSectionClick(Sender: TObject); +begin + if FControlsUpdating then Exit; + ContinueFromPrevSection := True; + CheckModified; +end; + +end. diff --git a/official/x.35/ExpressPrinting System/Sources/dxfmZoom.dfm b/official/x.35/ExpressPrinting System/Sources/dxfmZoom.dfm new file mode 100644 index 00000000..84da5f34 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxfmZoom.dfm @@ -0,0 +1,548 @@ +object fmZoom: TfmZoom + Left = 422 + Top = 239 + BorderStyle = bsDialog + Caption = 'Zoom' + ClientHeight = 280 + ClientWidth = 428 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object btnOK: TButton + Left = 186 + Top = 251 + Width = 75 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 2 + end + object btnCancel: TButton + Left = 267 + Top = 251 + Width = 75 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 3 + end + object gbxPreview: TGroupBox + Left = 193 + Top = 4 + Width = 230 + Height = 238 + Caption = ' Preview ' + TabOrder = 1 + object bvlFontPreviewHolder: TBevel + Left = 8 + Top = 176 + Width = 214 + Height = 54 + Visible = False + end + object bvlPreviewHolder: TBevel + Left = 24 + Top = 23 + Width = 183 + Height = 123 + Visible = False + end + object Panel1: TPanel + Left = 2 + Top = 162 + Width = 226 + Height = 2 + BevelOuter = bvLowered + TabOrder = 0 + end + object stxtFontPreview: TStaticText + Left = 9 + Top = 157 + Width = 125 + Height = 17 + Caption = ' 12 pt Times New Roman ' + TabOrder = 1 + end + end + object btnHelp: TButton + Left = 348 + Top = 251 + Width = 75 + Height = 23 + Caption = '&Help' + TabOrder = 4 + end + object gbxZoomTo: TGroupBox + Left = 5 + Top = 4 + Width = 185 + Height = 238 + Caption = ' &Zoom To ' + TabOrder = 0 + object lblPercent: TLabel + Left = 9 + Top = 205 + Width = 44 + Height = 13 + Caption = 'P&ercent: ' + OnClick = lblPercentClick + end + object bvlPercentHolder: TBevel + Left = 80 + Top = 201 + Width = 87 + Height = 21 + Visible = False + end + object rbtn500: TRadioButton + Left = 8 + Top = 21 + Width = 55 + Height = 17 + Caption = '500 %' + TabOrder = 0 + OnClick = rbtnClick + end + object rbtn200: TRadioButton + Tag = 1 + Left = 8 + Top = 41 + Width = 55 + Height = 17 + Caption = '&200 %' + TabOrder = 1 + OnClick = rbtnClick + end + object rbtn150: TRadioButton + Tag = 2 + Left = 8 + Top = 61 + Width = 55 + Height = 17 + Caption = '150 %' + TabOrder = 2 + OnClick = rbtnClick + end + object rbtn100: TRadioButton + Tag = 3 + Left = 8 + Top = 81 + Width = 55 + Height = 17 + Caption = '&100 %' + TabOrder = 3 + OnClick = rbtnClick + end + object rbtn75: TRadioButton + Tag = 4 + Left = 8 + Top = 101 + Width = 55 + Height = 17 + Caption = '&75 %' + TabOrder = 4 + OnClick = rbtnClick + end + object rbtn50: TRadioButton + Tag = 5 + Left = 8 + Top = 121 + Width = 55 + Height = 17 + Caption = '&50 %' + TabOrder = 5 + OnClick = rbtnClick + end + object rbtn10: TRadioButton + Tag = 7 + Left = 8 + Top = 161 + Width = 55 + Height = 17 + Caption = '10 %' + TabOrder = 7 + OnClick = rbtnClick + end + object rbtn25: TRadioButton + Tag = 6 + Left = 8 + Top = 141 + Width = 55 + Height = 17 + Caption = '25 %' + TabOrder = 6 + OnClick = rbtnClick + end + object rbtnTwoPages: TRadioButton + Tag = 10 + Left = 76 + Top = 61 + Width = 105 + Height = 17 + Caption = '&Two Pages' + TabOrder = 10 + OnClick = rbtnClick + end + object rbtnWholePage: TRadioButton + Tag = 9 + Left = 76 + Top = 41 + Width = 105 + Height = 17 + Caption = 'W&hole Page' + TabOrder = 9 + OnClick = rbtnClick + end + object rbtnPageWidth: TRadioButton + Tag = 8 + Left = 76 + Top = 21 + Width = 105 + Height = 17 + Caption = 'Page &Width' + TabOrder = 8 + OnClick = rbtnClick + end + object rbtnFourPages: TRadioButton + Tag = 11 + Left = 76 + Top = 81 + Width = 105 + Height = 17 + Caption = '&Four Pages' + TabOrder = 11 + OnClick = rbtnClick + end + object rbtnManyPages: TRadioButton + Tag = 12 + Left = 76 + Top = 101 + Width = 105 + Height = 17 + Caption = '&Many Pages:' + TabOrder = 12 + OnClick = rbtnClick + end + object btnManyPages: TBitBtn + Left = 122 + Top = 126 + Width = 45 + Height = 44 + TabOrder = 13 + OnClick = btnManyPagesClick + Glyph.Data = { + 1E030000424D1E03000000000000760000002800000024000000220000000100 + 040000000000A802000000000000000000001000000010000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888 + 8888888888888888888888880000888888888888888888888888888888880888 + 0000888888888888888888888888888888800088000088888888888888888888 + 8888888888000008000088000000000000000000000000008888888800008877 + 7777777777777777777777778888888800008888888808888888888880888888 + 8888888800008888888000000000000000088888888888880000888888077777 + 7777777777708888888888880000888880F8888888888AA88877088888888888 + 000080000000000000000000000000000888888800000F777777777777777777 + 777777777088888800000F888888888888888888888888887088888800000F87 + FFFFFFFFFFFFFFFFFFFFFFF87088888800000F870888888888888888888888F8 + 7088888800000F870770F0000F00F0000F0778F87088888800000F870770FFFF + FF00FFFFFF0778F87088888800000F870770FFFFFF00FFFFFF0778F870888888 + 00000F870770000000000000000778F87088888800000F870770000000000000 + 000778F87088888800000F870770FFFFFF00FFFFFF0778F87088888800000F87 + 0770F0000F00F0000F0778F87088888800000F870770FFFFFF00FFFFFF0778F8 + 7088888800000F870770F0000F00F0000F0778F87088888800000F870770FFFF + FF00FFFFFF0778F87088888800000F870770F0000F00F0000F0778F870888888 + 00000F870770FFFFFF00FFFFFF0778F87088888800000F870770FFFFFF00FFFF + FF0778F87088888800000F870770000000000000000778F87088888800000F87 + 0000000000000000000000F87088888800000F87777777777777777777777778 + 7088888800000F888888888888888888888888887088888800000FFFFFFFFFFF + FFFFFFFFFFFFFFFF878888880000800000000000000000000000000008888888 + 0000} + Layout = blGlyphBottom + Spacing = 0 + end + end + object ilStub: TImageList + Left = 6 + Top = 248 + Bitmap = { + 494C010101000500040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000002000000001002000000000000020 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840084848400848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 000000000000FFFFFF00000000000000000000000000FFFFFF00000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF000000 + 0000C6C6C600FFFFFF00C6C6C60000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00C6C6 + C600000000000000000000000000C6C6C600FFFFFF00FFFFFF00000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00848484008484840084848400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000100000000000000000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxfmZoom.pas b/official/x.35/ExpressPrinting System/Sources/dxfmZoom.pas new file mode 100644 index 00000000..32e0db4a --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxfmZoom.pas @@ -0,0 +1,664 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxfmZoom; + +interface + +{$I cxVer.inc} + +uses + Windows, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls, StdCtrls, + ComCtrls, Commctrl, Buttons, ImgList, dxExtCtrls, dxPreVw, dxPSForm; + +type + TfmZoom = class(TCustomdxPSForm) + btnOK: TButton; + btnCancel: TButton; + gbxPreview: TGroupBox; + btnHelp: TButton; + Panel1: TPanel; + stxtFontPreview: TStaticText; + gbxZoomTo: TGroupBox; + rbtn500: TRadioButton; + rbtn200: TRadioButton; + rbtn150: TRadioButton; + rbtn100: TRadioButton; + rbtn75: TRadioButton; + rbtn50: TRadioButton; + rbtn10: TRadioButton; + rbtn25: TRadioButton; + rbtnTwoPages: TRadioButton; + rbtnWholePage: TRadioButton; + rbtnPageWidth: TRadioButton; + rbtnFourPages: TRadioButton; + rbtnManyPages: TRadioButton; + lblPercent: TLabel; + bvlPercentHolder: TBevel; + bvlFontPreviewHolder: TBevel; + bvlPreviewHolder: TBevel; + btnManyPages: TBitBtn; + ilStub: TImageList; + procedure lblPercentClick(Sender: TObject); + procedure rbtnClick(Sender: TObject); + procedure btnManyPagesClick(Sender: TObject); + private + FModified: Boolean; + FpnlFontPreview: TCustomControl; + FpnlPreview: TCustomControl; + FPreview: TdxPreview; + FPreviewOwnerSize: TPoint; + FsePercent: TCustomEdit; + FUpdateCount: Integer; + procedure FontPreviewPaint(Sender: TObject); + procedure PercentButtonClick(Sender: TObject; ButtonType: TdxButtonType; Button: TUDBtnType); + procedure PercentChange(Sender: TObject); + procedure PercentExit(Sender: TObject); + procedure PreviewPaint(Sender: TObject); + procedure SetZoomFactor(Value: Integer); + procedure ZoomKeyPress(Sender: TObject; var Key: Char); + protected + procedure BeginUpdate; + procedure EndUpdate; + + procedure CreateControls; virtual; + procedure InitControls; virtual; + procedure InitPreview(APreview: TdxPreview); + procedure LoadStrings; virtual; + procedure UpdateControlsState; + public + constructor Create(AOwner: TComponent); override; + function Execute: Boolean; + end; + +function dxZoomDlg(APreview: TdxPreview): Boolean; + +implementation + +{$R *.DFM} + +uses + //Variants, + Math, cxClasses, dxPSGlbl, dxPSImgs, dxPSRes, dxPSUtl, dxfmMnPg, dxPSTextOut; + +type + TdxPreviewAccess = class(TdxPreview); + +function dxZoomDlg(APreview: TdxPreview): Boolean; +var + Form: TfmZoom; +begin + Form := TfmZoom.Create(nil); + try + with Form do + begin + CreateControls; + InitPreview(APreview); + if (APreview.Owner <> nil) and (APreview.Owner is TControl) then + FPreviewOwnerSize := MakePoint(TControl(APreview.Owner).Width, TControl(APreview.Owner).Height) + else + FPreviewOwnerSize := MakePoint(APreview.Width, APreview.Height); + Result := Execute; + if Result then + begin + APreview.ZoomMode := FPreview.ZoomMode; + APreview.SetPageXYCount(FPreview.ColCount, FPreview.RowCount); + APreview.ZoomFactor := FPreview.ZoomFactor; + end; + end; + finally + Form.Free; + end; +end; + +{ TfmZoom } + +constructor TfmZoom.Create(AOwner: TComponent); +begin + inherited; + HelpContext := dxhcZoomDlg; + if HelpContext <> 0 then + BorderIcons := BorderIcons + [biHelp]; + btnHelp.Visible := HelpContext <> 0; + if not btnHelp.Visible then + begin + btnOK.BoundsRect := btnCancel.BoundsRect; + btnCancel.BoundsRect := btnHelp.BoundsRect; + end; + FPreview := TdxPreview.Create(Self); + FPreview.Visible := False; + FPreview.MinZoomFactor := 10; + FPreview.Parent := Self; +end; + +function TfmZoom.Execute: Boolean; +begin + LoadStrings; + InitControls; + FModified := False; + UpdateControlsState; + Result := (ShowModal = mrOK) and FModified; +end; + +procedure TfmZoom.BeginUpdate; +begin + Inc(FUpdateCount); +end; + +procedure TfmZoom.EndUpdate; +begin + Dec(FUpdateCount); + if FUpdateCount = 0 then + begin + FpnlFontPreview.Invalidate; + FpnlPreview.Invalidate; + end; +end; + +procedure TfmZoom.CreateControls; +begin + FsePercent := TdxPSSpinEdit.Create(Self); + with TdxPSSpinEdit(FsePercent) do + begin + Parent := gbxZoomTo; + BoundsRect := bvlPercentHolder.BoundsRect; + MinValue := FPreview.MinZoomFactor; + MaxValue := FPreview.MaxZoomFactor; + Value := FPreview.ZoomFactor; + LegendText := PercentSymbol; + OnKeyPress := ZoomKeyPress; + OnButtonClick := PercentButtonClick; + OnExit := PercentExit; + OnChange := PercentChange; + end; + lblPercent.FocusControl := FsePercent; + + FpnlPreview := TdxPSPaintPanel.Create(Self); + with TdxPSPaintPanel(FpnlPreview) do + begin + Parent := gbxPreview; + BoundsRect := bvlPreviewHolder.BoundsRect; + OnPaint := PreviewPaint; + EdgeInner := esNone; + EdgeOuter := esNone; + end; + + FpnlFontPreview := TdxPSPaintPanel.Create(Self); + with TdxPSPaintPanel(FpnlFontPreview) do + begin + Parent := gbxPreview; + BoundsRect := bvlFontPreviewHolder.BoundsRect; + OnPaint := FontPreviewPaint; + EdgeInner := esNone; + EdgeOuter := esNone; + end; +end; + +procedure TfmZoom.InitControls; +var + I: Integer; + Control: TControl; +begin + case FPreview.ZoomMode of + pzmNone: + begin + rbtn500.Checked := FPreview.ZoomFactor = 500; + rbtn200.Checked := FPreview.ZoomFactor = 200; + rbtn150.Checked := FPreview.ZoomFactor = 150; + rbtn100.Checked := FPreview.ZoomFactor = 100; + rbtn75.Checked := FPreview.ZoomFactor = 75; + rbtn50.Checked := FPreview.ZoomFactor = 50; + rbtn25.Checked := FPreview.ZoomFactor = 25; + rbtn10.Checked := FPreview.ZoomFactor = 10; + for I := 0 to gbxZoomTo.ControlCount - 1 do + begin + Control := gbxZoomTo.Controls[I]; + if (Control is TRadioButton) and TRadioButton(Control).Checked then + begin + ActiveControl := TWinControl(Control); + Break; + end; + end; + TdxPSSpinEdit(FsePercent).Value := FPreview.ZoomFactor; + end; + + pzmPageWidth: + rbtnPageWidth.Checked := True; + + pzmPages: + begin + rbtnWholePage.Checked := FPreview.ColCount = 1; + rbtnTwoPages.Checked := FPreview.ColCount = 2; + rbtnFourPages.Checked := FPreview.ColCount = 4; + rbtnManyPages.Checked := not (FPreview.ColCount in [1, 2, 4]); + end; + end; + rbtnTwoPages.Enabled := FPreview.PageCount > 1; + rbtnFourPages.Enabled := FPreview.PageCount > 3; +end; + +procedure TfmZoom.InitPreview(APreview: TdxPreview); +var + I: Integer; +begin + FPreview.MeasurementUnits := APreview.MeasurementUnits; + FPreview.Orientation := APreview.Orientation; + FPreview.OriginalPageSize := APreview.OriginalPageSize; + for I := 0 to APreview.PageCount - 1 do + TdxPreviewAccess(FPreview).CreatePage; + FPreview.PageXCount := APreview.PageXCount; + FPreview.PageYCount := APreview.PageYCount; + FPreview.Width := APreview.Width; + FPreview.Height := APreview.Height; + FPreview.ZoomFactor := APreview.ZoomFactor; + FPreview.ZoomMode := APreview.ZoomMode; +end; + +procedure TfmZoom.LoadStrings; +begin + btnOK.Caption := cxGetResourceString(@sdxBtnOK); + btnCancel.Caption := cxGetResourceString(@sdxBtnCancel); + btnHelp.Caption := cxGetResourceString(@sdxBtnHelp); + + Caption := cxGetResourceString(@sdxZoomDlgCaption); + gbxZoomTo.Caption := cxGetResourceString(@sdxZoomDlgZoomTo); + rbtnPageWidth.Caption := cxGetResourceString(@sdxZoomDlgPageWidth); + rbtnWholePage.Caption := cxGetResourceString(@sdxZoomDlgWholePage); + rbtnTwoPages.Caption := cxGetResourceString(@sdxZoomDlgTwoPages); + rbtnFourPages.Caption := cxGetResourceString(@sdxZoomDlgFourPages); + rbtnManyPages.Caption := cxGetResourceString(@sdxZoomDlgManyPages); + lblPercent.Caption := cxGetResourceString(@sdxZoomDlgPercent); + gbxPreview.Caption := cxGetResourceString(@sdxZoomDlgPreview); + stxtFontPreview.Caption := cxGetResourceString(@sdxZoomDlgFontPreview); +end; + +procedure TfmZoom.UpdateControlsState; +begin + //btnOK.Enabled := FModified; +end; + +procedure TfmZoom.SetZoomFactor(Value: Integer); +begin + TdxPSSpinEdit(FsePercent).AsInteger := Value; + FPreview.ZoomFactor := Value; + FpnlFontPreview.Invalidate; + FpnlPreview.Invalidate; +end; + +procedure TfmZoom.lblPercentClick(Sender: TObject); +begin + ActiveControl := TLabel(Sender).FocusControl; +end; + +procedure TfmZoom.rbtnClick(Sender: TObject); +const + cZoomFactors: array[0..7] of Integer = (500, 200, 150, 100, 75, 50, 25, 10); +var + T: Longint; +begin + T := TTagToInt(TComponent(Sender).Tag); + if T < 8 then + begin + TdxPSSpinEdit(FsePercent).AsInteger := cZoomFactors[T]; + FPreview.ZoomMode := pzmNone; + SetZoomFactor(cZoomFactors[T]); + end + else + if T < 12 then + begin + SetZoomFactor(FPreview.ZoomFactor); + if T = 8 then + FPreview.ZoomMode := pzmPageWidth + else + begin + FPreview.ZoomMode := pzmPages; + case T of + 9: FPreview.SetPageXYCount(1, 1); + 10: FPreview.SetPageXYCount(2, 1); + 11: FPreview.SetPageXYCount(2, 2); + end; + end; + SetZoomFactor(FPreview.ZoomFactor); + end + else + SetZoomFactor(FPreview.ZoomFactor); + FModified := True; + UpdateControlsState; +end; + +procedure TfmZoom.PercentChange(Sender: TObject); +begin + FModified := True; + UpdateControlsState; +end; + +procedure TfmZoom.PercentExit(Sender: TObject); +begin + SetZoomFactor(TdxPSSpinEdit(Sender).AsInteger); +end; + +procedure TfmZoom.ZoomKeyPress(Sender: TObject; var Key: Char); +begin + if Key = Char(VK_RETURN) then + begin + SetZoomFactor(TdxPSSpinEdit(Sender).AsInteger); + UpdateControlsState; + end; +end; + +procedure TfmZoom.PercentButtonClick(Sender: TObject; ButtonType: TdxButtonType; Button: TUDBtnType); +begin + BeginUpdate; + try + with TdxPSSpinEdit(Sender) do + begin + SetZoomFactor(AsInteger); + rbtn500.Checked := AsInteger = 500; + rbtn200.Checked := AsInteger = 200; + rbtn150.Checked := AsInteger = 150; + rbtn100.Checked := AsInteger = 100; + rbtn75.Checked := AsInteger = 75; + rbtn50.Checked := AsInteger = 50; + rbtn25.Checked := AsInteger = 25; + rbtn10.Checked := AsInteger = 10; + end; + finally + EndUpdate; + end; +end; + +procedure TfmZoom.btnManyPagesClick(Sender: TObject); +var + AOrigin: TPoint; + AYShift: Integer; + AMaxColCount, AMaxRowCount: Integer; + ARowCount, AColCount: Integer; +begin + AOrigin := TButton(Sender).ClientOrigin; + AYShift := TButton(Sender).Height; + Inc(AOrigin.Y, AYShift); + { + AMaxColCount := Floor((FPreview.Width - 2 * FPreview.Indent) / + (FPreview.Indent + MulDiv(FPreview.PageSize.X, FPreview.MinZoomFactor, 100))); + AMaxRowCount := Floor((FPreview.Height - 2 * FPreview.Indent) / + (FPreview.Indent + MulDiv(FPreview.PageSize.Y, FPreview.MinZoomFactor, 100))); + } + AMaxColCount := FPreview.Width div MulDiv(FPreview.PageSize.X, FPreview.MinZoomFactor, 100); + AMaxRowCount := FPreview.Height div MulDiv(FPreview.PageSize.Y, 2 * FPreview.MinZoomFactor, 100); + if AMaxColCount = 0 then + AMaxColCount := 1; + if AMaxRowCount = 0 then + AMaxRowCount := 1; + + if AMaxColCount > 3 then + AColCount := 3 + else + AColCount := AMaxColCount; + + if AMaxRowCount > 3 then + ARowCount := 2 + else + ARowCount := AMaxRowCount; + + if dxChooseMultiplePages(ilStub, 0, AOrigin, AYShift, AMaxColCount, + AMaxRowCount, AColCount, ARowCount) then + begin + FPreview.ZoomMode := pzmPages; + FPreview.SetPageXYCount(AColCount, ARowCount); + if rbtnManyPages.Checked then + begin + SetZoomFactor(FPreview.ZoomFactor); + FModified := True; + UpdateControlsState; + end + else + rbtnManyPages.Checked := True; + end; +end; + +procedure TfmZoom.PreviewPaint(Sender: TObject); +const + ScreenRect: TRect = (Left: 12; Top: 10; Right: 170; Bottom: 93); + Offset: TPoint = (X: 10; Y: 2); +var + ADesktop, DestR, R, R2: TRect; + I, AWidth, AHeight, W, H, V: Integer; + DC: HDC; + Rgn: HRGN; + + function MapRect(const ARect: TRect): TRect; + begin + Result := ScaleRect(ARect, DestR.Right - DestR.Left, FPreview.Width, + DestR.Right - DestR.Left, FPreview.Width); + end; + + procedure DrawBorder; + var + R2: TRect; + begin + R2 := R; + FrameRect(DC, R2, GetSysColorBrush(COLOR_3DDKSHADOW)); + InflateRect(R2, -1, -1); + FrameRect(DC, R2, GetSysColorBrush(COLOR_3DDKSHADOW)); + InflateRect(R2, -1, -1); + FillRect(DC, R2, HBRUSH(COLOR_BTNSHADOW + 1)); + end; + + procedure DrawMonitor; + var + R2, R3: TRect; + L: Integer; + Pen: HPEN; + Brush: HBRUSH; + begin + { Monitor } + R2 := R; + R2.Bottom := MulDiv(R2.Bottom, 104, 122); + DrawEdge(DC, R2, EDGE_RAISED, BF_RECT); + InflateRect(R2, -11, -10); + Dec(R2.Bottom); + DrawEdge(DC, R2, BDR_SUNKENOUTER, BF_RECT or BF_MONO); + Inc(R2.Bottom); + InflateRect(R2, 11, 10); + { Under Screen Side Borders } + L := R.Left + MulDiv(R.Right - R.Left, 35, R.Right - R.Left); + FillRect(DC, MakeBounds(L + 1, R2.Bottom, 1, 4), GetSysColorBrush(COLOR_3DDKSHADOW)); + FillRect(DC, MakeBounds(R.Right - L - 1, R2.Bottom, 1, 4), GetSysColorBrush(COLOR_3DDKSHADOW)); + R2 := MakeRect(L, R2.Bottom, R.Right - L, MulDiv(R.Bottom, 108, 122)); + { Interior } + R3 := R2; + InflateRect(R2, -3, 0); + Inc(R2.Left); + Dec(R2.Bottom); + FillRect(DC, MakeRect(R2.Left, R2.Top, R2.Right, R2.Top + 2), GetSysColorBrush(COLOR_BTNSHADOW)); + FillRect(DC, MakeBounds(R2.Right, R2.Top, 2, 4), GetSysColorBrush(COLOR_BTNSHADOW)); + FillRect(DC, MakeBounds(R2.Left - 2, R2.Bottom - 1, 2, 2), GetSysColorBrush(COLOR_BTNHIGHLIGHT)); + Dec(R2.Left); + InflateRect(R2, -3, 0); + OffsetRect(R2, 0, 6); + Dec(R2.Bottom); + { Right Side } + MoveToEx(DC, R3.Right - 1, R3.Bottom - 1, nil); + LineTo(DC, R2.Right - 1, R2.Bottom + 1); + Pen := SelectObject(DC, CreatePen(PS_SOLID, 0, GetSysColor(COLOR_BTNSHADOW))); + MoveToEx(DC, R3.Right - 2, R3.Bottom - 1, nil); + LineTo(DC, R2.Right - 2, R2.Bottom + 1); + MoveToEx(DC, R3.Right - 2, R3.Bottom - 2, nil); + LineTo(DC, R2.Right - 2, R2.Bottom); + MoveToEx(DC, R3.Right - 2, R3.Bottom - 3, nil); + LineTo(DC, R2.Right - 2, R2.Bottom - 1); + DeleteObject(SelectObject(DC, Pen)); + { Left Side } + MoveToEx(DC, R3.Left + 1, R3.Bottom - 1, nil); + LineTo(DC, R2.Left + 1, R2.Bottom + 1); + Pen := SelectObject(DC, CreatePen(PS_SOLID, 0, GetSysColor(COLOR_BTNHIGHLIGHT))); + MoveToEx(DC, R3.Left + 2, R3.Bottom - 1, nil); + LineTo(DC, R2.Left + 2, R2.Bottom + 1); + MoveToEx(DC, R3.Left + 2, R3.Bottom - 2, nil); + LineTo(DC, R2.Left + 2, R2.Bottom); + DeleteObject(SelectObject(DC, Pen)); + R3 := R2; + { Button } + R2 := MakeBounds(R2.Right - 19, R2.Top - 5, 10, 4); + DrawEdge(DC, R2, BDR_RAISEDINNER, BF_LEFT or BF_RIGHT or BF_BOTTOM); + FillRect(DC, MakeBounds(R2.Left, R2.Top, 10, 1), HBRUSH(COLOR_BTNFACE + 1)); + { Spot } + InflateRect(R2, -3, 0); + OffsetRect(R2, -11, 0); + DrawEdge(DC, R2, BDR_SUNKENOUTER, BF_RECT or BF_SOFT); + InflateRect(R2, -1, -1); + Brush := CreateSolidBrush(clLime); + FillRect(DC, R2, Brush); + DeleteObject(Brush); + R2 := R3; + + FillRect(DC, R2, GetSysColorBrush(COLOR_BTNSHADOW)); + OffsetRect(R2, 0, 2); + Dec(R2.Bottom); + FillRect(DC, R2, GetSysColorBrush(COLOR_3DDKSHADOW)); + InflateRect(R2, -4, 0); + Inc(R2.Top, 1); + Inc(R2.Bottom, 4); + DrawEdge(DC, R2, BDR_SUNKENOUTER, BF_FLAT or BF_MONO or BF_LEFT or BF_RIGHT); + R3 := R2; + { Interior } + InflateRect(R2, -1, -1); + OffsetRect(R2, 0, -1); + Inc(R2.Left, 2); + FillRect(DC, R2, HBRUSH(COLOR_BTNSHADOW + 1)); + FillRect(DC, MakeBounds(R2.Right - 2, R2.Bottom, 2, 2), GetSysColorBrush(COLOR_BTNSHADOW)); + FillRect(DC, MakeBounds(R2.Left - 2, R2.Bottom, 2, 2), GetSysColorBrush(COLOR_BTNHIGHLIGHT)); + { Bottom } + R2 := R3; + InflateRect(R2, (R2.Left - R.Left) div 2, 0); + OffsetRect(R2, 0, 4); + Inc(R2.Bottom, 1); + DrawButtonFace(TdxPSPaintPanel(Sender).Canvas, R2, 0, bsWin31, True, False, False); + Inc(R2.Left); + Inc(R2.Top); + DrawEdge(DC, R2, EDGE_RAISED, BF_SOFT or BF_RECT); + SetPixel(DC, R2.Right - 1, R2.Bottom - 1, GetSysColor(COLOR_BTNFACE)); + end; + +begin + if FUpdateCount <> 0 then Exit; + ADesktop := GetDesktopWorkArea; + with TdxPSPaintPanel(Sender) do + begin + Windows.GetClientRect(Handle, R); + DC := Canvas.Handle; + end; + FillRect(DC, R, GetSysColorBrush(COLOR_BTNFACE)); + DrawMonitor; + AWidth := MulDiv(ScreenRect.Right - ScreenRect.Left - 2 * Offset.X, + FPreviewOwnerSize.X, ADesktop.Right - ADesktop.Left); + AHeight := MulDiv(ScreenRect.Bottom - ScreenRect.Top - 2 * Offset.Y, + FPreviewOwnerSize.Y, ADesktop.Bottom - ADesktop.Top); + + with ScreenRect do + begin + W := Right - Left; + H := Bottom - Top; + if AWidth / AHeight > W / H then + begin + V := MulDiv(AHeight, W, AWidth); + R := Bounds(Left, Top + (H - V) div 2, W, V); + end + else + begin + V := MulDiv(AWidth, H, AHeight); + R := Bounds(Left + (W - V) div 2, Top, V, H); + end; + end; + DestR := R; + DrawBorder; + + InflateRect(R, -1, -1); + Dec(R.Top); + + Rgn := dxPSUtl.IntersectCliprect(DC, R); + + FPreview.CalcPagesBounds(FPreview.TopPos, FPreview.VirtualWidth, FPreview.VirtualHeight); + for I := 0 to FPreview.PageCount - 1 do + begin + R := MapRect(FPreview.Pages[I].Bounds); + OffsetRect(R, 0, 4); + if (R.Right - R.Left) < (DestR.Right - DestR.Left) then + OffsetRect(R, 1, 0); + OffsetRect(R, DestR.Left, DestR.Top); + if IntersectRect(R2, R, DestR) then + DrawEdge(DC, R, BDR_SUNKENOUTER, BF_RECT or BF_MIDDLE or BF_MONO); + end; + + dxPSUtl.RestoreClipRgn(DC, Rgn); +end; + +procedure TfmZoom.FontPreviewPaint(Sender: TObject); +const + Format = DXTO_PATTERNEDTEXT or DXTO_CENTER_HORIZONTALLY or DXTO_WORDBREAK or DXTO_CHARBREAK; +var + Template, S: string; + I: Integer; + R: TRect; +begin + if FUpdateCount <> 0 then Exit; + + Template := cxGetResourceString(@sdxZoomDlgFontPreviewString); + S := ''; + for I := 0 to 6 do + begin + S := S + Template; + if I <> 6 then S := S + #13#10; + end; + + with TdxPSPaintPanel(Sender), Canvas do + begin + R := ClientRect; + Inc(R.Top, 2); + + Brush.Color := clWindowText; + FrameRect(R); + InflateRect(R, -1, -1); + Brush.Color := clWindow; + FillRect(R); + + Font.Size := Round(12 * FPreview.ZoomFactor / 100); + Font.Name := 'Times New Roman'; + dxTextOut(Handle, S, R, Format, nil, 0, 0); + end; +end; + +end. + diff --git a/official/x.35/ExpressPrinting System/Sources/dxpsfmEditDesc.dfm b/official/x.35/ExpressPrinting System/Sources/dxpsfmEditDesc.dfm new file mode 100644 index 00000000..46884e4c --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxpsfmEditDesc.dfm @@ -0,0 +1,63 @@ +object dxfmEditDescription: TdxfmEditDescription + Left = 383 + Top = 205 + BorderStyle = bsDialog + Caption = 'Edit Description' + ClientHeight = 294 + ClientWidth = 333 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + KeyPreview = True + OldCreateOrder = True + Position = poScreenCenter + OnKeyDown = FormKeyDown + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object btnOK: TButton + Left = 90 + Top = 265 + Width = 75 + Height = 23 + Caption = '&OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 171 + Top = 265 + Width = 75 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object btnHelp: TButton + Left = 252 + Top = 265 + Width = 75 + Height = 23 + Caption = '&Help' + TabOrder = 3 + end + object gbxMemoHost: TGroupBox + Left = 5 + Top = 6 + Width = 322 + Height = 249 + TabOrder = 0 + object memDescription: TMemo + Left = 8 + Top = 18 + Width = 305 + Height = 218 + TabOrder = 0 + end + end +end diff --git a/official/x.35/ExpressPrinting System/Sources/dxpsfmEditDesc.pas b/official/x.35/ExpressPrinting System/Sources/dxpsfmEditDesc.pas new file mode 100644 index 00000000..f70040f4 --- /dev/null +++ b/official/x.35/ExpressPrinting System/Sources/dxpsfmEditDesc.pas @@ -0,0 +1,180 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressPrinting System(tm) COMPONENT SUITE } +{ } +{ Copyright (C) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND } +{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN } +{ EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxPSfmEditDesc; + +interface + +{$I cxVer.inc} + +uses + Windows, Messages, Classes, Controls, Forms, StdCtrls, dxPSForm; + +type + TdxfmEditDescription = class(TCustomdxPSForm) + btnOK: TButton; + btnCancel: TButton; + btnHelp: TButton; + gbxMemoHost: TGroupBox; + memDescription: TMemo; + procedure FormResize(Sender: TObject); + procedure FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + private + function GetDescription: string; + procedure SetDescription(const Value: string); + procedure WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); message WM_GETMINMAXINFO; + protected + procedure BeforeConstruction; override; + procedure Initialize; + procedure LoadStrings; + public + constructor Create(AOwner: TComponent); override; + function Execute: Boolean; + property Description: string read GetDescription write SetDescription; + end; + +function dxEditDescriptionDlg(var ADescription: string): Boolean; + +implementation + +{$R *.DFM} + +uses + cxClasses, dxPSRes, dxPSUtl, dxPSGlbl; + +function dxEditDescriptionDlg(var ADescription: string): Boolean; +var + Dialog: TdxfmEditDescription; +begin + Dialog := TdxfmEditDescription.Create(nil); + try + Dialog.Description := ADescription; + Result := Dialog.Execute; + if Result then + ADescription := Dialog.Description; + finally + Dialog.Free; + end; +end; + +{ TdxfmEditDescription } + +constructor TdxfmEditDescription.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + HelpContext := dxhcEditDescriptionDlg; +end; + +function TdxfmEditDescription.Execute: Boolean; +begin + Initialize; + Result := ShowModal = mrOK; +end; + +procedure TdxfmEditDescription.FormResize(Sender: TObject); +const + BtnOffsetY = 6; +var + BtnOffsetX, RightOrigin, TopOrigin: Integer; +begin + BtnOffsetX := gbxMemoHost.Left; + with gbxMemoHost do + SetBounds(Left, Top, Self.ClientWidth - 2 * Left, + Self.ClientHeight - Top - btnOK.Height - 2 * BtnOffsetY); + + with memDescription do + SetBounds(Left, Top, Parent.ClientWidth - 2 * Left, Parent.ClientHeight - 2 * Top); + + RightOrigin := gbxMemoHost.Left + gbxMemoHost.Width; + TopOrigin := gbxMemoHost.Top + gbxMemoHost.Height + BtnOffsetY; + + PlaceButtons([btnHelp, btnCancel, btnOK], BtnOffsetX, RightOrigin, TopOrigin); +end; + +procedure TdxfmEditDescription.FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if (Key = VK_ESCAPE) and (Shift = []) and (ActiveControl is TCustomMemo) then + ModalResult := mrCancel; +end; + +procedure TdxfmEditDescription.BeforeConstruction; +begin + inherited BeforeConstruction; + Options := Options + [foSizeableDialog]; +end; + +procedure TdxfmEditDescription.Initialize; +begin + btnHelp.Visible := HelpContext <> 0; + if HelpContext <> 0 then + BorderIcons := BorderIcons + [biHelp]; + + if not btnHelp.Visible then + begin + btnOK.BoundsRect := btnCancel.BoundsRect; + btnCancel.BoundsRect := btnHelp.BoundsRect; + end; + LoadStrings; + FormResize(nil); +end; + +procedure TdxfmEditDescription.LoadStrings; +begin + Caption := cxGetResourceString(@sdxEditDescription); + btnOK.Caption := cxGetResourceString(@sdxBtnOKAccelerated); + btnCancel.Caption := cxGetResourceString(@sdxBtnCancel); + btnHelp.Caption := cxGetResourceString(@sdxBtnHelp); +end; + +function TdxfmEditDescription.GetDescription: string; +begin + Result := memDescription.Lines.Text; +end; + +procedure TdxfmEditDescription.SetDescription(const Value: string); +begin + memDescription.Lines.Text := Value; +end; + +procedure TdxfmEditDescription.WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); +begin + inherited; + Message.MinMaxInfo^.ptMinTrackSize := Point(300, 300); +end; + +end. + diff --git a/official/x.35/ExpressQuantumGrid 6/EULA.txt b/official/x.35/ExpressQuantumGrid 6/EULA.txt new file mode 100644 index 00000000..8a1f0289 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/EULA.txt @@ -0,0 +1,119 @@ +DEVELOPER EXPRESS INC +ExpressQuantumGrid 6(tm) COMPONENT SUITE +Copyright (C) 1999-2008 Developer Express Inc. + +END-USER LICENSE AGREEMENT +FOR ALL SOFTWARE COMPONENT PRODUCT(S) + +IMPORTANT- READ CAREFULLY: This DEVELOPER EXPRESS INC ("DEVEXPRESS") End-User License Agreement ("EULA") is a legal agreement between you, a developer of software applications, ("Developer End User") and DEVEXPRESS for all DEVEXPRESS products, controls, source code, demos, intermediate files, media, printed materials, and "online" or electronic documentation ("SOFTWARE COMPONENT PRODUCT(S)") contained in this installation file. + +DEVEXPRESS grants to you as an individual, a personal, nonexclusive license to install and use the SOFTWARE COMPONENT PRODUCT(S) for the sole purposes of designing, developing, testing, and deploying application programs which you create. By installing, copying, or otherwise using the SOFTWARE COMPONENT PRODUCT(S), you agree to be bound by the terms of this EULA. If you do not agree to any part of the terms of this EULA, DO NOT INSTALL, USE, EVALUATE, OR REPLICATE IN ANY MANNER, ANY PART, FILE OR PORTION OF THE SOFTWARE COMPONENT PRODUCT(S). + +All SOFTWARE COMPONENT PRODUCT(S) is licensed, not sold. If you are an individual, you must acquire an individual license for the SOFTWARE COMPONENT PRODUCT(S) from DEVEXPRESS or its authorized resellers. If you are an entity, you must acquire and assign an individual license for each Developer End User within your organization using and or developing with the SOFTWARE COMPONENT PRODUCT(S) from DEVEXPRESS or its authorized resellers. + +If the SOFTWARE COMPONENT PRODUCT(S) you have obtained is marked as a "TRIAL" or "EVALUATION," you may install one copy of the SOFTWARE COMPONENT PRODUCT(S) for testing purposes for a period of 30 calendar days from the date of installation ("Evaluation Period"). Upon expiration of the Evaluation Period, the SOFTWARE COMPONENT PRODUCT(S) must be uninstalled and all copies destroyed. + +RIGOROUS ENFORCEMENT OF INTELLECTUAL PROPERTY RIGHTS. If the licensed right of use for this SOFTWARE COMPONENT PRODUCT(S) is purchased by you with any intent to reverse engineer, decompile, create derivative works, and the exploitation or unauthorized transfer of, any DEVEXPRESS intellectual property and trade secrets, to include any exposed methods or source code where provided, no licensed right of use shall exist, and any PRODUCT(s) created as a result shall be judged illegal by definition of all applicable law. Any sale or resale of intellectual property or created derivatives so obtained will be prosecuted to the fullest extent of all local, federal and international law. + +1. GRANT OF LICENSE. + +This EULA, if legally executed as defined herein, licenses and so grants the single individual Developer End User the following rights: + +SOFTWARE COMPONENT PRODUCT(S) - Developer End User may install and use the SOFTWARE COMPONENT PRODUCT(S) on a single computer. Developer End User may also install and use the SOFTWARE COMPONENT PRODUCT(S) on a portable computer. + +2. LIMITATIONS ON REVERSE ENGINEERING, DECOMPILATION, AND DISASSEMBLY. + +You may not reverse engineer, decompile, create derivative works, translate, or disassemble the SOFTWARE COMPONENT PRODUCT(S), and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation. You agree to take all reasonable, legal and appropriate measures to prohibit the illegal dissemination of the SOFTWARE COMPONENT PRODUCT(S) or any of its constituent parts and redistributables to the fullest extent of all applicable local, US Codes and International Laws and Treaties regarding anti-circumvention, including but not limited to, the Geneva and Berne World Intellectual Property Organization (WIPO) Diplomatic Conferences. + +3. SEPARATION OF COMPONENTS. + +The SOFTWARE COMPONENT PRODUCT(S) is licensed as a single PRODUCT(s). The SOFTWARE COMPONENT PRODUCT(S) and its constituent parts and any provided redistributables may not be reverse engineered, decompiled, disassembled or separated for use on more than one computer, nor placed for distribution, sale, or resale as individual creations by Developer End User. The provision of source code, if included with the SOFTWARE COMPONENT PRODUCT(S), does not constitute transfer of any legal rights to such code, and resale or distribution of all or any portion of all source code and intellectual property will be prosecuted to the fullest extent of all applicable local, federal and international laws. All DEVEXPRESS libraries, source code, redistributables and other files remain DEVEXPRESS's exclusive property. You may not distribute any files, except those that DEVEXPRESS has expressly designated as Redistributable. + +4. RENTAL. + +You may not rent, lease, or lend the SOFTWARE COMPONENT PRODUCT(S). + +5. TRANSFER. + +You may NOT permanently or temporarily transfer ANY of your rights under this EULA to any individual or entity without prior written approval from DEVEXPRESS. Regardless of any modifications which you make and regardless of how you might compile, link, and/or package your programs, under no circumstances may the libraries, Redistributables, and/or other files of the SOFTWARE COMPONENT PRODUCT(S) (including any portions thereof) be used for developing programs by anyone other than you. Only you as the licensed Developer End User have the right to use the libraries, redistributables, or other files of the SOFTWARE COMPONENT PRODUCT(S) (or any portions thereof) for developing programs created with the SOFTWARE COMPONENT PRODUCT(S). In particular, you may not share copies of the Redistributables with other co-developers. You may not reproduce or distribute any DEVEXPRESS documentation without DEVEXPRESS's explicit permission. + +If you are an entity (Company), you must acquire and assign a license to each Developer End User within your organization using and or developing with the SOFTWARE COMPONENT PRODUCT(S). With written notification to DEVEXPRESS, Company may transfer the license obtained for a Developer End User to another Developer End User employed or otherwise engaged by Company if the initial Developer End User is no longer employed or engaged by Company or is reassigned to another function within Company and no longer develops software applications using the SOFTWARE COMPONENT PRODUCT(S). In addition, with written notification to DEVEXPRESS, Company may transfer its license of the SOFTWARE COMPONENT PRODUCT(S) to a successor Company. + +6. ROYALTY FREE REDISTRIBUTION. + +DEVEXPRESS PRODUCT(s) may include certain files ("Redistributable(s)") intended for distribution by you to the users of software applications which you create. Redistributables include, for example, those files identified in printed or on-line documentation as redistributable files, or those files preselected for deployment by an install utility provided with the SOFTWARE COMPONENT PRODUCT(S) (if any). In all circumstances, the Redistributables for the SOFTWARE COMPONENT PRODUCT(S) are only those files specifically designated as such by DEVEXPRESS. + +Subject to all of the terms and conditions in this EULA, you may reproduce and distribute copies of the Redistributables, provided that such copies are made from the original copy of the Redistributables included with the SOFTWARE COMPONENT PRODUCT(S) or modified versions of the Redistributables which are provided to you by DEVEXPRESS or those which you create. Copies of Redistributables may only be distributed with and for the sole purpose of executing application programs permitted under this EULA that you have created using the SOFTWARE COMPONENT PRODUCT(S). + +REDISTRIBUTABLES. To obtain a list of redistributables that apply under this EULA, contact support@devexpress.com + +AT NO TIME MAY DEVELOPER END USER CREATE ANY TOOL, REDISTRIBUTABLE, OR SOFTWARE COMPONENT PRODUCT(S) THAT DIRECTLY OR INDIRECTLY COMPETES WITH DEVEXPRESS SOFTWARE COMPONENT PRODUCT(S) WHICH UTILIZES ALL OR ANY PORTION OF THE SOFTWARE COMPONENT PRODUCT(S) contained within this installation. + +Distribution by the Developer End User of any design-time tools (EXE's OCX's or DLL's), executables, and source code distributed to Developer End User by DEVEXPRESS as part of this SOFTWARE COMPONENT PRODUCT(S) and not explicitly identified as a redistributable file is strictly prohibited. The Developer End User shall not develop software applications that provide an application programming interface to the SOFTWARE COMPONENT PRODUCT(S) or the SOFTWARE COMPONENT PRODUCT(S) as modified. + +The Developer End User may NOT distribute the SOFTWARE COMPONENT PRODUCT(S), in any format, to other users for development or application compilation purposes. Specifically, if Developer End User creates a control using the SOFTWARE COMPONENT PRODUCT(S) as a constituent control, Developer End User may NOT distribute the control created with the SOFTWARE COMPONENT PRODUCT(S) (in any format) to users to be used used at design time and or for ANY development purposes. + +Developer End User MAY NOT REDISTRIBUTE any SOFTWARE COMPONENT PRODUCT(s) files if using an evaluation, trial, Not for Resale, or demo version of the SOFTWARE COMPONENT PRODUCT(s). + +7. UPGRADES. + +If the SOFTWARE COMPONENT PRODUCT(S) is labeled as an upgrade, you must be properly licensed to use the SOFTWARE COMPONENT PRODUCT(S) identified by DEVEXPRESS as being eligible for the upgrade in order to use the SOFTWARE COMPONENT PRODUCT(S). A SOFTWARE COMPONENT PRODUCT(S) labeled as an upgrade replaces and/or supplements the SOFTWARE COMPONENT PRODUCT(S) that formed the basis for your eligibility for the upgrade, and together constitutes a single PRODUCT(S). You may use the resulting upgraded PRODUCT(S) only in accordance with all the terms of this EULA. + +8. COPYRIGHT. + +All title and copyrights in and to the SOFTWARE COMPONENT PRODUCT(S) (including but not limited to any copywritten images, demos, source code, intermediate files, packages, photographs, redistributables, animations, video, audio, music, text, and "applets" incorporated into the SOFTWARE COMPONENT PRODUCT(S) the accompanying printed materials, and any copies of the SOFTWARE COMPONENT PRODUCT(S)) are owned by DEVEXPRESS or its subsidiaries. The SOFTWARE COMPONENT PRODUCT(S) is protected by copyright laws and international treaty provisions and therefore, you must treat the SOFTWARE COMPONENT PRODUCT(S) like any other copyrighted material except that you may install the SOFTWARE COMPONENT PRODUCT(S) as described in this EULA. + +9. DUAL-MEDIA SOFTWARE COMPONENT PRODUCT(S). + +You may receive the SOFTWARE COMPONENT PRODUCT(S) in more than one medium. Regardless of the medium, you may use only one medium that is appropriate for your single computer. You may not loan, sell, rent, lease, or otherwise transfer in any manner the other medium to another user or entity. + +10. U.S. GOVERNMENT RESTRICTED RIGHTS. + +The Licensed Software is Commercial Computer Software provided with RESTRICTED RIGHTS under Federal Acquisition Regulations and agency supplements to them. Use, duplication or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFAR 255.227-7013 et. seq. or 252.211-7015, or subparagraphs (a) through (d) of the Commercial Computer Software Restricted Rights at FAR 52.227-19, as applicable, or similar clauses in the NASA FAR Supplement. Contractor-manufacturer is Developer Express Inc. / 6375 S. Pecos Rd Suite 118, Las Vegas NV 89120. + +11. EXPORT RESTRICTIONS. + +DEVEXPRESS expressly complies with all export restrictions imposed by the government of the United States of America. You, as Developer End User, must agree not to export or re-export the SOFTWARE COMPONENT PRODUCT(S) within any created application to any country, person, entity or end user subject to U.S.A. export restrictions. Restricted countries currently include, but are not necessarily limited to Cuba, Iran, Iraq, Libya, North Korea, Sudan, and Syria. You warrant and represent that neither the U.S.A. Bureau of Export Administration nor any other federal agency has suspended, revoked or denied your export privileges. + +12. NOTE ON JAVA SUPPORT. + +Certain SOFTWARE COMPONENT PRODUCT(S) may contain support for programs written in Java. Java technology is not fault tolerant and is not designed, manufactured, or intended for use or resale as on-line control equipment in hazardous environments requiring fail-safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines, or weapons systems, in which the failure of Java technology could lead directly to death, personal injury, or severe physical or environmental damage. + +13. DISCLAIMER OF WARRANTY. + +DEVEXPRESS expressly disclaims any warranty for the SOFTWARE COMPONENT PRODUCT(S). THE SOFTWARE COMPONENT PRODUCT(S) AND ANY RELATED DOCUMENTATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. DEVEXPRESS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY REPRESENTATIONS REGARDING THE USE, OR THE RESULTS OF THE USE, OF THE SOFTWARE COMPONENT PRODUCT(S) IN TERMS OF CORRECTNESS, ACCURACY, RELIABILITY, OR OTHERWISE. THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE COMPONENT PRODUCT(S) REMAINS WITH YOU. No oral or written information or advice given by DEVEXPRESS or its employees shall create a warranty or in any way increase the scope of this warranty. + +14. LIMITATIONS ON LIABILITY. + +To the maximum extent permitted by applicable law, in no event shall DEVEXPRESS be liable for any special, incidental, indirect, or consequential damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use the SOFTWARE COMPONENT PRODUCT(S) or the provision of or failure to provide Support Services, even if DEVEXPRESS has been advised of the possibility of such damages. + +Developer End User understands that the SOFTWARE COMPONENT PRODUCT(S) may produce inaccurate results because of a failure or fault within the SOFTWARE COMPONENT PRODUCT(S) or failure by Developer End User to properly use and or deploy the SOFTWARE COMPONENT PRODUCT(S). Developer End User assumes full and sole responsibility for any use of the SOFTWARE COMPONENT PRODUCT(S), and bears the entire risk for failures or faults within the SOFTWARE COMPONENT PRODUCT(S). You agree that regardless of the cause of failure or fault or the form of any claim, YOUR SOLE REMEDY AND DEVEXPRESS'S SOLE OBLIGATION SHALL BE GOVERNED BY THIS AGREEMENT AND IN NO EVENT SHALL DEVEXPRESS'S LIABILITY EXCEED THE PRICE PAID TO DEVEXPRESS FOR THE SOFTWARE COMPONENT PRODUCT(S). This Limited Warranty is void if failure of the SOFTWARE COMPONENT PRODUCT(S) has resulted from accident, abuse, alteration, unauthorized use or misapplication of the SOFTWARE COMPONENT PRODUCT(S). + +15. INDEMNIFICATION. + +You hereby agree to indemnify DEVEXPRESS and its officers, directors, employees, agents, and representatives from each and every demand, claim, loss, liability, or damage of any kind, including actual attorneys fees, whether in tort or contract, that it or any of them may incur by reason of, or arising out of, any claim which is made by any third party with respect to any breach or violation of this Agreement by you or any claims based on the Applications and the SOFTWARE COMPONENT PRODUCT(S) included herein. + +16. SUPPORT SERVICES. + +DEVEXPRESS may provide you with support services related to the SOFTWARE COMPONENT PRODUCT(S) ("Support Services"). Use of Support Services is governed by DEVEXPRESS policies and programs described in the user manual, in "on line" documentation and/or other DEVEXPRESS provided materials. Any supplemental SOFTWARE COMPONENT PRODUCT(S) provided to you as part of the Support Services shall be considered part of the SOFTWARE COMPONENT PRODUCT(S) and subject to the terms and conditions of this EULA. With respect to technical information you provide to DEVEXPRESS as part of the Support Services, DEVEXPRESS may use such information for its business purposes, including for SOFTWARE COMPONENT PRODUCT(s) support and development. DEVEXPRESS will not utilize such technical information in a form that personally identifies you. + +17. TERMINATION. + +Without prejudice to any other rights or remedies, DEVEXPRESS will terminate this EULA upon your failure to comply with all the terms and conditions of this EULA. In such events, you must destroy all copies of the SOFTWARE COMPONENT PRODUCT(S) and all of its component parts including any related documentation, and must remove ANY and ALL use of such technology immediately from any applications using technology contained in the SOFTWARE COMPONENT PRODUCT(S) developed by you, whether in native, altered or compiled state. + +18. TAX. + +DEVEXPRESS delivers its software electronically and does not collect sales or use tax for residents of US states in which it operates. You should confirm that your local, state, or federal government does not impose any sales or use tax on electronically delivered software. You are entirely liable for any such sales or use tax. + +19. MISCELLANEOUS. + +This EULA shall be construed, interpreted and governed by the laws of the State of Nevada, U.S.A. This EULA gives you specific legal rights; you may have others that vary from state to state and from country to country. + +This EULA may only be modified in writing signed by you and an authorized officer of DEVELOPER EXPRESS INC. If any provision of this EULA is found void or unenforceable, the remainder will remain valid and enforceable according to its terms. If any remedy provided is determined to have failed for its essential purpose, all limitations of liability and exclusions of damages set forth in the Limited Warranty shall remain in effect. + +DEVEXPRESS reserves all rights not specifically granted in this EULA. + +ACKNOWLEDGEMENTS. Developer End User acknowledges that he or she has read this Agreement, understands it, and agrees to be bound by its terms and conditions. + +Should you have any questions concerning this EULA, or if you desire to contact DEVEXPRESS for any reason, please contact us directly at us in the United States of America at 702-262-0609, or write: Developer Express Inc. Legal department / 6330 McLeod Dr Suite 1, Las Vegas NV 89120. + diff --git a/official/x.35/ExpressQuantumGrid 6/Help/ExpressQuantumGrid6.cnt b/official/x.35/ExpressQuantumGrid 6/Help/ExpressQuantumGrid6.cnt new file mode 100644 index 00000000..c4c10d8f --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Help/ExpressQuantumGrid6.cnt @@ -0,0 +1,430 @@ +:Base ExpressQuantumGrid6.hlp +:Title ExpressQuantumGrid Suite 6 +:Index ExpressQuantumGrid Suite 6=ExpressQuantumGrid6.hlp +1 ExpressQuantumGrid 6 +2 Overview=Overview +2 What's New in v6=CD_Whats_New_in_v6 +2 Known Issues and Important Changes List=CD_Known_Issues_and_Important_Changes_List +2 Grid3 and Grid4 Equivalents (Alphabetically)=IDH_bc_Grid3_and_Grid4_Equivalents_Alph +2 Grid3 and Grid4 Equivalents (By objects)=IDH_bc_Grid3_and_Grid4_Equivalents +2 Fundamentals +3 Grid Control is just a Container for Grid Views=IDH_Custom_GridContainerForViews +3 Grid Control Settings=IDH_Custom_GridControlSettings +3 Grid Levels=IDH_Custom_GridLevels +3 Grid Structure=IDH_Fundamentals_Grid_Structure +3 View Types and Inheritance=IDH_Custom_ViewTypesInheritance +3 View Structure=IDH_Custom_ViewStructure +3 Visual Elements List=IDH_UI_List +3 Pattern and Clone Views=IDH_Fundamentals_PatternCloneViews +3 ViewInfo Reference Charts=IDH_Fundamentals_ViewInfo_Reference_Charts +2 Base Concepts +3 Bands=IDH_cd_Bands +3 Custom Draw=IDH_cd_Custom_Draw +3 Data Editing Using Inplace Editors=IDH_cd_Data_Editing_Using_Inplace_Editors +3 Data Export=IDH_cd_Data_Export +3 Data Loading Modes=IDH_cd_Data_Loading_Modes +3 Data Printing=IDH_bc_Data_Printing +3 Data Representation=IDH_cd_Data_Representation +3 Data Representation Capabilities=IDH_cd_Data_Representation_Capabilities +3 Filtering=IDH_cd_Filtering +3 Filter Row=CD_Filter_Row +3 Focused/Selected Records=IDH_bc_Focused_Selected_Records +3 Grid Mode=IDH_bc_Grid_Mode +3 Grid Mode: Master-Detail=IDH_cd_Grid_Mode_Master_detail +3 Grid View Elements=IDH_bc_Grid_View_Elements +3 HitTests=Understanding_HitTests +3 Incremental Search=IDH_cd_Incremental_Search +3 Items=IDH_cd_Items +3 Look and Feel=IDH_cd_Look_Feel_Painters +3 Lookup Column=IDH_bc_Lookup_Column +3 New Item Row=IDH_cd_NewItemRow +3 Options=IDH_cd_Options +3 Preview Section=IDH_UI_PreviewSection +3 Records=IDH_cd_Records +3 Record Navigation=CD_Record_Navigation +3 Resource Strings=IDH_CD_list_of_resource_strings +3 Runtime Filtering=IDH_cd_Runtime_Filtering +3 Styles=IDH_cd_Styles +3 Style Repository=IDH_cd_Style_Repository +3 Summaries=IDH_cd_Summaries +3 Views=IDH_cd_Views +3 Working With Details At Runtime=IDH_bc_Working_With_Details_At_Runtime +2 Task Based Help +3 Adding Custom Filter and Grouping Date Ranges=CD_Adding_Custom_Filter_and_Grouping_Date_Ranges +3 Banded Table View=IDH_tbh_Banded_Table_View +3 Card View=CD_Card_View +3 Connecting to Data=IDH_tbh_Connecting_to_Data +3 Converting to ExpressQuantumGrid=IDH_TBH_Converting_to_ExpressQuantumGrid +3 Create and Delete Columns=IDH_tbh_Create_And_Delete_Columns +3 Create and Delete Series=IDH_tbh_Create_And_Delete_Series +3 Create Custom Summaries=IDH_Create_Custom_Summaries +3 Creating Data Groups in Chart Views=CD_Creating_Data_Groups_in_Chart_Views +3 Creating Summaries=IDH_tbh_Create_Summaries +3 Data Editing=IDH_Custom_DataEditing +3 Deleting Records=IDH_tbh_Deleting_records +3 Expand and Collapse Rows=IDH_Custom_ExpandCollapseRows +3 Filtering Data=IDH_tbh_Filter_Implementation +3 How To Custom Paint the Grid Control Using Custom Painters=IDH_How_to_custom_paint_the_grid_control_using_custom_painters +3 Implementing Drag-And-Drop Functionality=IDH_cd_Implementing_Drag_And_Drop_Functionality +3 Importing ExpressQuantumGrid3=IDH_tbh_Importing_ExpressQuantumGrid3 +3 Importing TDBGrid=IDH_tbh_Importing_TDBGrid +3 Importing TwwDBGrid=IDH_tbh_Importing_TwwDBGrid +3 Managing Grid Menus=Managing_Grid_Menus +3 Master-Detail=IDH_tbh_Master_Detail +3 Obtain and Set Cell Values=IDH_tbh_Obtain_And_Set_Cell_Values +3 Obtain and Set Summary Values=IDH_tbh_Obtain_And_Set_Summary_Values +3 Obtain and Set Values in Chart Views=IDH_tbh_Obtain_And_Set_Values_in_Chart_Views +3 Process Master Rows=IDH_Custom_ProcessMasterRows +3 Provider Mode=IDH_tbh_Provider_Mode +3 Provider Mode: Master-Detail=IDH_cd_Provider_Mode_Master_Detail +3 Selecting Records=IDH_tbh_Selecting_Records +3 Selecting Cells=IDH_tbh_Selecting_Cells +3 Setting the Grid's Appearance=IDH_tbh_Setting_the_Grid_s_Appearance +3 Sorting Data=IDH_tbh_Implement_Data_Sorting +3 Sorting Data by Group Summaries=IDH_tbh_Implement_Data_Sorting_Group_Summaries +3 Working With Levels=IDH_tbh_Working_With_Levels +3 Unbound Mode=IDH_tbh_Unbound_Mode +3 Unbound Mode: Master Detail=IDH_cd_Unbound_Mode_Master_Detail +3 Using Filter Builder Dialog=IDH_tbh_Using_Filter_Builder_Dialog +3 Using Lookup Columns=IDH_tbh_Using_Lookup_Column +2 Tutorials +3 Banded Table View Tutorial +4 Overview=IDH_cd_Banded_View_Tutorial_Overview +4 Step 1: View Creation=IDH_cd_Banded_View_Tutorial._Step_1 +4 Step 2: Bands And Columns=IDH_cd_Banded_View_Tutorial_Step_2 +4 Step 3: Editors And Repository=IDH_cd_Banded_View_Tutorial_Step_3 +4 Step 4: Setting Up The View Look And Feel=IDH_cd_Banded_View_Tutorial_Step_4 +4 Step 5: Styles And Style Sheets=IDH_cd_Banded_View_Tutorial_Step_5 +3 Card View Tutorial +4 Overview=IDH_cd_Card_View_Tutorial_Overview +4 Step 1: View Creation=IDH_cd_Card_View_Tutorial_Step_1 +4 Step 2: Card View Rows=IDH_cd_Card_View_Tutorial_Step_2 +4 Step 3: Seeting Up The View Look And Feel=IDH_cd_Card_View_Tutorial_Step_3 +4 Step 4: Editors And Repository=IDH_cd_Card_View_Tutorial_Step_4 +4 Step 5: Styles And Style Sheets=IDH_cd_Card_View_Tutorial_Step_5 +3 Chart View Tutorial +4 Chart View Tutorial. Overview.=IDH_cd_Chart_View_Tutorial_Overview +4 Chart View Tutorial. Step 1: View Creation=IDH_cd_ChartView_Creation +4 Chart View Tutorial. Step 2: Categories and Series=IDH_cd_ChartView_Tutorial_Step_2 +4 Chart View Tutorial. Step 3: Customizing The View=IDH_cd_Chart_View_Tutorial_Step_3 +4 Chart View Tutorial. Step 4: Customizing The Diagram=IDH_cd_Chart_View_Tutorial_Step_4 +4 Chart View Tutorial. Step 5: Applying Styles=IDH_cd_Chart_View_Tutorial_Step_5 +3 Master-Detail Tutorial +4 Overview=IDH_Tutorial_MasterDetail_Overview +4 Step 1: Connecting to Data=IDH_Tutorial_MasterDetail_Step2ConnectingToData +4 Step 2: Level Structure=IDH_Tutorial_MasterDetail_Step3Level_Structure +4 Step 3: Connecting Views to Data=IDH_Tutorial_MasterDetail_Step4ConnectingViewsToData +4 Step 4: Setting Up Master-Detail Relationships=IDH_Tutorial_MasterDetail_Step5SettingUpMasterDetail +4 Step 5: Specifying Editors for Items=IDH_Tutorial_MasterDetail_Step6SpecifyingEditorsForItems +4 Step 6: Customizing Views=IDH_Tutorial_MasterDetail_Step7CustomizingViews +3 Table View Tutorial +4 Overview=IDH_cd_Table_View_Tutorial_Overview +4 Step 1: View Creation=IDH_cd_View_Creation +4 Step 2: Columns Creation=IDH_cd_Columns_Creation +4 Step 3: Setting Up The View Look & Feel=IDH_cd_Setting_Up_The_View_Look_Feel +4 Step 4: Editors And Repository=IDH_cd_Editors_And_Repository +4 Step 5: Styles And Style Sheets=IDH_cd_Styles_And_Style_Sheets +4 Step 6: Preview Creation=IDH_cd_Preview_Creation +4 Step 7: Footer Summary Creation=IDH_cd_Footer_Summary_Creation +4 Step 8: Group Summary Creation=IDH_cd_Group_Summary_Creation +4 Step 9: Summary Group Creation=IDH_cd_Summary_Group_Creation +2 Design-time Features +3 Component Editor=IDH_cd_Component_Editor +3 Default Values for View Options=IDH_CD_Default_Values_for_View_Options +3 View Layout=IDH_CD_View_Layout +2 Resource Strings +3 cxGridPopupMenu: Resource Strings=IDH_CD_cxGridPopupMenu_Resource_Strings +3 ExpressQuantumGrid: Resource Strings=IDH_CD_Express_Quantum_Grid_Resource_Strings +2 Reference +3 TcxCustomGrid=IDH_Class_TcxCustomGrid +3 TcxGrid=IDH_Class_TcxGrid +3 Units +4 cxDBExtLookupComboBox Unit Overview=IDH_Unit_cxDBExtLookupComboBox +4 cxGrid Unit Overview=IDH_Unit_cxGrid +4 cxGridBandedTableView Unit Overview=IDH_Unit_cxGridBandedTableView +4 cxGridCardView Unit Overview=IDH_Unit_cxGridCardView +4 cxGridChartView Unit Overview=IDH_Unit_cxGridChartView +4 cxGridCustomPopupMenu Unit Overview=IDH_Unit_cxGridCustomPopupMenu +4 cxGridCustomTableView Unit Overview=IDH_Unit_cxGridCustomTableView +4 cxGridCustomView Unit Overview=IDH_Unit_cxGridCustomView +4 cxGridDBBandedTableView Unit Overview=IDH_Unit_cxGridDBBandedTableView +4 cxGridDBCardView Unit Overview=IDH_Unit_cxGridDBCardView +4 cxGridDBChartView Unit Overview=IDH_Unit_cxGridDBChartView +4 cxGridDBDataDefinitions Unit Overview=IDH_Unit_cxGridDBDataDefinitions +4 cxGridDBTableView Unit Overview=IDH_Unit_cxGridDBTableView +4 cxGridDetailsSite Unit Overview=IDH_Unit_cxGridDetailsSite +4 cxGridExportLink Unit Overview=IDH_Unit_cxGridExportLink +4 cxGridLevel Unit Overview=IDH_Unit_cxGridLevel +4 cxGridPopupMenu Unit Overview=IDH_Unit_cxGridPopupMenu +4 cxGridRows Unit Overview=IDH_Unit_cxGridRows +4 cxGridTableView Unit Overview=IDH_Unit_cxGridTableView +3 Level +4 TcxGridLevel=IDH_Class_TcxGridLevel +4 TcxGridLevelTabs=IDH_Class_TcxGridLevelTabs +3 Views +4 TcxGridViewRepository=IDH_Class_TcxGridViewRepository +4 BandedTableView +5 TcxGridBandedTableView=IDH_Class_TcxGridBandedTableView +5 Band +6 TcxGridBand=IDH_Class_TcxGridBand +6 TcxGridBandRow=IDH_Class_TcxGridBandRow +6 TcxGridBandRows=IDH_Class_TcxGridBandRows +6 TcxGridBands=IDH_Class_TcxGridBands +4 CardView +5 TcxGridCardView=IDH_Class_TcxGridCardView +5 Layers +6 TcxCustomGridCardRowLayoutObject=IDH_Class_TcxCustomGridCardRowLayoutObject +6 TcxGridCardRowLayoutObject=IDH_Class_TcxGridCardRowLayoutObject +6 TcxGridCardViewRowLayoutObject=IDH_Class_TcxGridCardViewRowLayoutObject +6 TcxGridCardViewVisibleRowLayoutObject=IDH_Class_TcxGridCardViewVisibleRowLayoutObject +6 TcxGridCardVisibleRowLayoutObject=IDH_Class_TcxGridCardVisibleRowLayoutObject +4 ChartView +5 TcxGridChartView=IDH_Class_TcxGridChartView +5 Legend +6 TcxGridChartLegend=IDH_Class_TcxGridChartLegend +5 Diagrams +6 TcxGridChartAreaDiagram=IDH_Class_TcxGridChartAreaDiagram +6 TcxGridChartBarDiagram=IDH_Class_TcxGridChartBarDiagram +6 TcxGridChartColumnDiagram=IDH_Class_TcxGridChartColumnDiagram +6 TcxGridChartDiagram=IDH_Class_TcxGridChartDiagram +6 TcxGridChartHistogram=IDH_Class_TcxGridChartHistogram +6 TcxGridChartLineDiagram=IDH_Class_TcxGridChartLineDiagram +6 TcxGridChartPieDiagram=IDH_Class_TcxGridChartPieDiagram +6 Axes +7 TcxGridChartHistogramAxis=IDH_Class_TcxGridChartHistogramAxis +7 TcxGridChartHistogramAxisCategory=IDH_Class_TcxGridChartHistogramAxisCategory +7 TcxGridChartHistogramAxisTitle=IDH_Class_TcxGridChartHistogramAxisTitle +7 TcxGridChartHistogramAxisValue=pme_cm_TcxGridChartHistogramAxisValue +7 TcxGridChartLineDiagramAxisCategory=IDH_Class_TcxGridChartLineDiagramAxisCategory +5 Title +6 TcxGridChartTitle=IDH_Class_TcxGridChartTitle +5 Toolbox +6 TcxGridChartDataLevelActiveValuePopup=IDH_Class_TcxGridChartDataLevelActiveValuePopup +6 TcxGridChartDiagramSelectorPopup=IDH_Class_TcxGridChartDiagramSelectorPopup +6 TcxGridChartToolBox=IDH_Class_TcxGridChartToolBox +5 Values +6 TcxGridChartColumnDiagramValues=IDH_Class_TcxGridChartColumnDiagramValues +6 TcxGridChartHistogramValues=IDH_Class_TcxGridChartHistogramValues +6 TcxGridChartLineDiagramValues=IDH_Class_TcxGridChartLineDiagramValues +6 TcxGridChartPieDiagramValues=IDH_Class_TcxGridChartPieDiagramValues +4 Custom View Classes +5 TcxCustomGridView=IDH_Class_TcxCustomGridView +5 TcxCustomGridTableView=IDH_Class_TcxCustomGridTableView +4 Data-aware Views +5 TcxGridDBBandedTableView=IDH_Class_TcxGridDBBandedTableView +5 TcxGridDBCardView=IDH_Class_TcxGridDBCardView +5 TcxGridDBChartView=IDH_Class_TcxGridDBChartView +5 TcxGridDBTableView=IDH_Class_TcxGridDBTableView +4 TableView +5 TcxGridTableView=IDH_Class_TcxGridTableView +3 Controllers +4 Data Controllers +5 TcxGridChartDataController=IDH_Class_TcxGridChartDataController +5 TcxGridDataController=IDH_Class_TcxGridDataController +5 TcxGridDBChartDataController=IDH_Class_TcxGridDBChartDataController +5 TcxGridDBDataController=IDH_Class_TcxGridDBDataController +5 SummaryItem +6 TcxGridDBTableSummaryItem=IDH_Class_TcxGridDBTableSummaryItem +6 TcxGridTableSummaryGroupItemLink=IDH_Class_TcxGridTableSummaryGroupItemLink +6 TcxGridTableSummaryItem=IDH_Class_TcxGridTableSummaryItem +4 Editing Controllers +5 TcxGridEditingController=IDH_Class_TcxGridEditingController +5 TcxGridTableEditingController=IDH_Class_TcxGridTableEditingController +4 Layout Controllers +5 TcxGridCardViewRowLayoutController=IDH_Class_TcxGridCardViewRowLayoutController +4 View Controllers +5 TcxCustomGridController=IDH_Class_TcxCustomGridController +5 TcxCustomGridTableController=IDH_Class_TcxCustomGridTableController +5 TcxGridBandedTableController=IDH_Class_TcxGridBandedTableController +5 TcxGridCardViewController=IDH_Class_TcxGridCardViewController +5 TcxGridChartController=IDH_Class_TcxGridChartController +5 TcxGridTableController=IDH_Class_TcxGridTableController +5 TcxGridViewHandler=IDH_Class_TcxGridViewHandler +3 Items +4 TcxCustomGridTableItem=IDH_Class_TcxCustomGridTableItem +4 TcxGridBandedColumn=IDH_Class_TcxGridBandedColumn +4 TcxGridCardViewRow=IDH_Class_TcxGridCardViewRow +4 TcxGridChartCategories=IDH_Class_TcxGridChartCategories +4 TcxGridChartDataGroup=IDH_Class_TcxGridChartDataGroup +4 TcxGridChartItem=IDH_Class_TcxGridChartItem +4 TcxGridChartSeries=IDH_Class_TcxGridChartSeries +4 TcxGridColumn=IDH_Class_TcxGridColumn +4 Data-aware Items +5 TcxGridDBBandedColumn=IDH_Class_TcxGridDBBandedColumn +5 TcxGridDBCardViewRow=IDH_Class_TcxGridDBCardViewRow +5 TcxGridDBChartCategories=IDH_Class_TcxGridDBChartCategories +5 TcxGridDBChartDataGroup=IDH_Class_TcxGridDBChartDataGroup +5 TcxGridDBChartSeries=IDH_Class_TcxGridDBChartSeries +5 TcxGridDBColumn=IDH_Class_TcxGridDBColumn +4 DataBinding +5 TcxGridChartItemDataBinding=IDH_Class_TcxGridChartItemDataBinding +5 TcxGridDBChartItemDataBinding=IDH_Class_TcxGridDBChartItemDataBinding +5 TcxGridItemDataBinding=IDH_Class_TcxGridItemDataBinding +5 TcxGridItemDBDataBinding=IDH_Class_TcxGridItemDBDataBinding +3 Date Ranges +4 TcxCustomGridDateRange=IDH_Class_TcxCustomGridDateRange +4 Absolute Date Ranges +5 TcxGridDayRange=IDH_Class_TcxGridDayRange +5 TcxGridHourRange=IDH_Class_TcxGridHourRange +5 TcxGridMonthRange=IDH_Class_TcxGridMonthRange +5 TcxGridYearRange=IDH_Class_TcxGridYearRange +4 Collections +5 TcxGridDateRanges=IDH_Class_TcxGridDateRanges +5 TcxGridFilteringDateRanges=IDH_Class_TcxGridFilteringDateRanges +5 TcxGridGroupingDateRanges=IDH_Class_TcxGridGroupingDateRanges +4 Relative Date Ranges +5 TcxGridLastMonthRange=IDH_Class_TcxGridLastMonthRange +5 TcxGridLastWeekRange=IDH_Class_TcxGridLastWeekRange +5 TcxGridLastYearRange=IDH_Class_TcxGridLastYearRange +5 TcxGridNextMonthRange=IDH_Class_TcxGridNextMonthRange +5 TcxGridNextWeekRange=IDH_Class_TcxGridNextWeekRange +5 TcxGridNextYearRange=IDH_Class_TcxGridNextYearRange +5 TcxGridThisMonthRange=IDH_Class_TcxGridThisMonthRange +5 TcxGridThisWeekRange=IDH_Class_TcxGridThisWeekRange +5 TcxGridThisYearRange=IDH_Class_TcxGridThisYearRange +5 TcxGridTodayRange=IDH_Class_TcxGridTodayRange +5 TcxGridTomorrowRange=IDH_Class_TcxGridTomorrowRange +5 TcxGridYesterdayRange=IDH_Class_TcxGridYesterdayRange +3 Records +4 TcxCustomGridRecord=IDH_Class_TcxCustomGridRecord +4 TcxCustomGridRow=IDH_Class_TcxCustomGridRow +4 TcxGridCard=IDH_Class_TcxGridCard +4 TcxGridDataRow=IDH_Class_TcxGridDataRow +4 TcxGridFilterRow=IDH_Class_TcxGridFilterRow +4 TcxGridGroupRow=IDH_Class_TcxGridGroupRow +4 TcxGridMasterDataRow=IDH_Class_TcxGridMasterDataRow +4 TcxGridNewItemRow=IDH_Class_TcxGridNewItemRow +3 Options +4 TcxGridItemFilterPopupOptions=IDH_Class_TcxGridItemFilterPopupOptions +4 Band Options +5 TcxGridBandOptions=IDH_Class_TcxGridBandOptions +4 BandedTableView Options +5 TcxGridBandedTableOptionsCustomize=IDH_Class_TcxGridBandedTableOptionsCustomize +5 TcxGridBandedTableOptionsView=IDH_Class_TcxGridBandedTableOptionsView +4 CardView Options +5 TcxGridCardViewDateTimeHandling=IDH_Class_TcxGridCardViewDateTimeHandling +5 TcxGridCardViewFiltering=IDH_Class_TcxGridCardViewFiltering +5 TcxGridCardViewOptionsBehavior=IDH_Class_TcxGridCardViewOptionsBehavior +5 TcxGridCardViewOptionsCustomize=IDH_Class_TcxGridCardViewOptionsCustomize +5 TcxGridCardViewOptionsData=IDH_Class_TcxGridCardViewOptionsData +5 TcxGridCardViewOptionsSelection=IDH_Class_TcxGridCardViewOptionsSelection +5 TcxGridCardViewOptionsView=IDH_Class_TcxGridCardViewOptionsView +4 ChartView Options +5 TcxGridChartOptionsBehavior=IDH_Class_TcxGridChartOptionsBehavior +5 TcxGridChartOptionsCustomize=IDH_Class_TcxGridChartOptionsCustomize +5 TcxGridChartOptionsView=IDH_Class_TcxGridChartOptionsView +4 Custom Options Classes +5 TcxCustomGridChartDiagramOptions=IDH_Class_TcxCustomGridChartDiagramOptions +5 TcxCustomGridOptions=IDH_Class_TcxCustomGridOptions +5 TcxCustomGridOptionsBehavior=IDH_Class_TcxCustomGridOptionsBehavior +5 TcxCustomGridOptionsSelection=IDH_Class_TcxCustomGridOptionsSelection +5 TcxCustomGridOptionsView=IDH_Class_TcxCustomGridOptionsView +5 TcxCustomGridTableDateTimeHandling=IDH_Class_TcxCustomGridTableDateTimeHandling +5 TcxCustomGridTableFiltering=IDH_Class_TcxCustomGridTableFiltering +5 TcxCustomGridTableItemCustomOptions=IDH_Class_TcxCustomGridTableItemCustomOptions +5 TcxCustomGridTableItemOptions=IDH_Class_TcxCustomGridTableItemOptions +5 TcxCustomGridTableOptionsBehavior=IDH_Class_TcxCustomGridTableOptionsBehavior +5 TcxCustomGridTableOptionsCustomize=IDH_Class_TcxCustomGridTableOptionsCustomize +5 TcxCustomGridTableOptionsData=IDH_Class_TcxCustomGridTableOptionsData +5 TcxCustomGridTableOptionsSelection=IDH_Class_TcxCustomGridTableOptionsSelection +5 TcxCustomGridTableOptionsView=IDH_Class_TcxCustomGridTableOptionsView +5 TcxGridBandCustomOptions=IDH_Class_TcxGridBandCustomOptions +4 Item Options +5 TcxGridBandedColumnOptions=IDH_Class_TcxGridBandedColumnOptions +5 TcxGridCardViewRowOptions=IDH_Class_TcxGridCardViewRowOptions +5 TcxGridCardViewRowPosition=IDH_Class_TcxGridCardViewRowPosition +5 TcxGridColumnOptions=IDH_Class_TcxGridColumnOptions +4 Level Options +5 TcxGridLevelOptions=IDH_Class_TcxGridLevelOptions +4 TableView Options +5 TcxGridFilterRowOptions=IDH_Class_TcxGridFilterRowOptions +5 TcxGridNewItemRowOptions=IDH_Class_TcxGridNewItemRowOptions +5 TcxGridPreview=IDH_Class_TcxGridPreview +5 TcxGridSpecialRowOptions=IDH_Class_TcxGridSpecialRowOptions +5 TcxGridTableDateTimeHandling=IDH_Class_TcxGridTableDateTimeHandling +5 TcxGridTableFiltering=IDH_Class_TcxGridTableFiltering +5 TcxGridTableOptionsBehavior=IDH_Class_TcxGridTableOptionsBehavior +5 TcxGridTableOptionsCustomize=IDH_Class_TcxGridTableOptionsCustomize +5 TcxGridTableOptionsData=IDH_Class_TcxGridTableOptionsData +5 TcxGridTableOptionsSelection=IDH_Class_TcxGridTableOptionsSelection +5 TcxGridTableOptionsView=IDH_Class_TcxGridTableOptionsView +3 Styles +4 Band Styles +5 TcxGridBandStyles=IDH_Class_TcxGridBandStyles +4 Custom Styles +5 TcxCustomGridStyles=IDH_Class_TcxCustomGridStyles +5 TcxCustomGridTableItemStyles=IDH_Class_TcxCustomGridTableItemStyles +5 TcxCustomGridTableViewStyles=IDH_Class_TcxCustomGridTableViewStyles +5 TcxCustomGridViewStyles=IDH_Class_TcxCustomGridViewStyles +4 Item Styles +5 TcxGridBandedColumnStyles=IDH_Class_TcxGridBandedColumnStyles +5 TcxGridCardViewRowStyles=IDH_Class_TcxGridCardViewRowStyles +5 TcxGridChartSeriesStyles=IDH_Class_TcxGridChartSeriesStyles +5 TcxGridColumnStyles=IDH_Class_TcxGridColumnStyles +4 Diagram Styles +5 TcxGridChartAreaDiagramStyles=IDH_Class_TcxGridChartAreaDiagramStyles +5 TcxGridChartDiagramStyles=IDH_Class_TcxGridChartDiagramStyles +5 TcxGridChartHistogramStyles=IDH_Class_TcxGridChartHistogramStyles +5 TcxGridChartLineDiagramStyles=IDH_Class_TcxGridChartLineDiagramStyles +5 TcxGridChartPieDiagramStyles=IDH_Class_TcxGridChartPieDiagramStyles +4 Level Styles +5 TcxGridLevelStyles=IDH_Class_TcxGridLevelStyles +4 StyleSheets +5 TcxGridBandedTableViewStyleSheet=IDH_Class_TcxGridBandedTableViewStyleSheet +5 TcxGridCardViewStyleSheet=IDH_Class_TcxGridCardViewStyleSheet +5 TcxGridTableViewStyleSheet=IDH_Class_TcxGridTableViewStyleSheet +4 View Styles +5 TcxGridBandedTableViewStyles=IDH_Class_TcxGridBandedTableViewStyles +5 TcxGridCardViewStyles=IDH_Class_TcxGridCardViewStyles +5 TcxGridChartViewStyles=IDH_Class_TcxGridChartViewStyles +5 TcxGridTableViewStyles=IDH_Class_TcxGridTableViewStyles +3 ViewData +4 TcxCustomGridTableViewData=IDH_Class_TcxCustomGridTableViewData +4 TcxCustomGridViewData=IDH_Class_TcxCustomGridViewData +4 TcxGridCardViewViewData=IDH_Class_TcxGridCardViewViewData +4 TcxGridChartViewData=IDH_Class_TcxGridChartViewData +4 TcxGridViewData=IDH_Class_TcxGridViewData +3 Miscellaneous Classes And Types +4 TcxCustomGridChartTitle=IDH_Class_TcxCustomGridChartTitle +4 TcxCustomGridPopupMenu=IDH_Class_TcxCustomGridPopupMenu +4 TcxGridBandedColumnPosition=IDH_Class_TcxGridBandedColumnPosition +4 TcxGridCardRowCoordinates=IDH_Type_TcxGridCardRowCoordinates +4 TcxGridCardRowInsertionPos=IDH_Type_TcxGridCardRowInsertionPos +4 TcxGridCardRowPosition=IDH_Type_TcxGridCardRowPosition +4 TcxGridCardViewRowKind=IDH_TcxGridCardViewRow_Kind +4 TcxGridCardViewRowLayout=IDH_Type_TcxGridCardViewRowLayout +4 TcxGridChartAxisPosition=IDH_Type_TcxGridChartAxisPosition +4 TcxGridChartColumnDiagramValuesCaptionPosition=IDH_TcxGridChartColumnDiagramValues_CaptionPosition +4 TcxGridChartDataDrillUpMethod=IDH_TcxGridChartOptionsCustomize_DataDrillUpMethod +4 TcxGridChartDataLevelsInfoVisible=IDH_TcxGridChartToolBox_DataLevelsInfoVisible +4 TcxGridChartHistogramMinMaxValues=IDH_TcxGridChartHistogramAxisValue_MinMaxValues +4 TcxGridChartHistogramTickMarkKind=IDH_TcxGridChartHistogramAxis_TickMarkKind +4 TcxGridChartLegendBorder=IDH_Type_TcxGridChartLegendBorder +4 TcxGridChartLineStyle=IDH_Type_TcxGridChartLineStyle +4 TcxGridChartMarkerStyle=IDH_Type_TcxGridChartMarkerStyle +4 TcxGridChartPartAlignment=IDH_Type_TcxGridChartPartAlignment +4 TcxGridChartPartOrientation=IDH_Type_TcxGridChartPartOrientation +4 TcxGridChartPartPosition=IDH_Type_TcxGridChartPartPosition +4 TcxGridChartPieDiagramValueCaptionPosition=IDH_Type_TcxGridChartPieDiagramValueCaptionPosition +4 TcxGridChartToolBoxBorder=IDH_TcxGridChartToolBox_Border +4 TcxGridChartToolBoxPosition=IDH_TcxGridChartToolBox_Position +4 TcxGridChartToolBoxVisible=IDH_TcxGridChartToolBox_Visible +4 TcxGridChartValueHotTrack=IDH_TcxGridChartOptionsBehavior_ValueHotTrack +4 TcxGridDateTimeFilter=IDH_Type_TcxGridDateTimeFilter +4 TcxGridDateTimeGrouping=IDH_Type_TcxGridDateTimeGrouping +4 TcxGridDetailTabsPosition=IDH_Type_TcxGridDetailTabsPosition +4 TcxGridFilterRowApplyChangesMode=IDH_Type_TcxGridFilterRowApplyChangesMode +4 TcxGridFilterValueList=IDH_Class_TcxGridFilterValueList +4 TcxGridGroupSummaryLayout=IDH_Type_TcxGridGroupSummaryLayout +4 TcxGridItemFilterPopupApplyChangesMode=IDH_Type_TcxGridItemFilterPopupApplyChangesMode +4 TcxGridPopupMenu=IDH_Class_TcxGridPopupMenu +4 TcxGridQuickCustomizationReordering=IDH_Type_TcxGridQuickCustomizationReordering +4 TcxGridShowItemFilterButtons=IDH_Type_TcxGridShowItemFilterButtons +4 TcxGridSortOrder=IDH_Type_TcxGridSortOrder +4 TcxPopupMenuInfo=IDH_Class_TcxPopupMenuInfo +4 TcxPopupMenuInfos=IDH_Class_TcxPopupMenuInfos +3 Routines +4 ExportGridToExcel=IDH_cxGridExport_ExportGridToExcel +4 ExportGridToHTML=IDH_cxGridExport_ExportGridToHTML +4 ExportGridToText=IDH_cxGridExport_ExportGridToText +4 ExportGridToXML=IDH_cxGridExport_ExportGridToXML diff --git a/official/x.35/ExpressQuantumGrid 6/Help/ExpressQuantumGrid6.hlp b/official/x.35/ExpressQuantumGrid 6/Help/ExpressQuantumGrid6.hlp new file mode 100644 index 00000000..f68b60ab Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Help/ExpressQuantumGrid6.hlp differ diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC10.bpk b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC10.bpk new file mode 100644 index 00000000..25f59509 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC10.bpk @@ -0,0 +1,221 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = cxGridC10.bpl +OBJFILES = cxGridLevel.obj \ + cxGridStrs.obj cxFilterDialog.obj cxGrid.obj \ + cxGridChartView.obj cxGridBandedTableView.obj cxGridCardView.obj \ + cxGridCommon.obj cxGridCustomView.obj cxGridCustomTableView.obj \ + cxGridDBChartView.obj cxGridDBBandedTableView.obj \ + cxGridDBCardView.obj cxGridDBDataDefinitions.obj \ + cxGridDBTableView.obj cxGridDetailsSite.obj \ + cxGridRows.obj cxGridFilterHelpers.obj \ + cxGridExportLink.obj cxGridTableView.obj \ + cxDBExtLookupComboBox.obj \ + cxGridCustomPopUpMenu.obj \ + cxGridFooterPopupMenuItems.obj \ + cxGridHeaderPopupMenuItems.obj \ + cxGridGroupRowPopupMenuItems.obj \ + cxGridMenuOperations.obj \ + cxGridPopUpMenu.obj \ + cxGridStdPopUpMenu.obj \ + cxGridUIBandedTableHelper.obj \ + cxGridUICardHelper.obj \ + cxGridUICustomTableHelper.obj \ + cxGridUIHelper.obj \ + cxGridUITableHelper.obj\ + cxGridPopupMenuConsts.obj \ + cxGridStyleSheetsPreview.obj \ + cxGridC10.obj +RESFILES = cxGridC10.res +MAINSOURCE = cxGridC10.cpp +RESDEPEN = $(RESFILES) cxFilterDialog.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = dxThemeC10.bpi cxEditorsC10.bpi cxExportC10.bpi cxLibraryC10.bpi \ + cxDataC10.bpi rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi cxExtEditorsC10.bpi \ + cxPageControlC10.bpi +SPARELIBS = rtl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) \ + -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressQuantumGrid 6 by Developer Express Inc." -aa \ + -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC10.cpp b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC10.cpp new file mode 100644 index 00000000..936cbaa0 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC10.cpp @@ -0,0 +1,64 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxGridC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEPACKAGE("cxExportC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEPACKAGE("cxExtEditorsC10.bpi"); +USEPACKAGE("cxPageControlC10.bpi"); +USEUNIT("cxGridStrs.pas"); +USEFORMNS("cxFilterDialog.pas", Cxfilterdialog, cxFilterDialog); +USEUNIT("cxDBExtLookupComboBox.pas"); +USEUNIT("cxGrid.pas"); +USEUNIT("cxGridChartView.pas"); +USEUNIT("cxGridBandedTableView.pas"); +USEUNIT("cxGridCardView.pas"); +USEUNIT("cxGridCommon.pas"); +USEUNIT("cxGridCustomTableView.pas"); +USEUNIT("cxGridCustomView.pas"); +USEUNIT("cxGridDBChartView.pas"); +USEUNIT("cxGridDBBandedTableView.pas"); +USEUNIT("cxGridDBCardView.pas"); +USEUNIT("cxGridDBDataDefinitions.pas"); +USEUNIT("cxGridRows.pas"); +USEUNIT("cxGridDBTableView.pas"); +USEUNIT("cxGridDetailsSite.pas"); +USEUNIT("cxGridLevel.pas"); +USEUNIT("cxGridExportLink.pas"); +USEUNIT("cxGridTableView.pas"); +USEUNIT("cxGridFilterHelpers.pas"); +USEUNIT("cxGridCustomPopUpMenu.pas"); +USEUNIT("cxGridFooterPopupMenuItems.pas"); +USEUNIT("cxGridHeaderPopupMenuItems.pas"); +USEUNIT("cxGridGroupRowPopupMenuItems.pas"); +USEUNIT("cxGridMenuOperations.pas"); +USEUNIT("cxGridPopUpMenu.pas"); +USEUNIT("cxGridStdPopUpMenu.pas"); +USEUNIT("cxGridUIBandedTableHelper.pas"); +USEUNIT("cxGridUICardHelper.pas"); +USEUNIT("cxGridUICustomTableHelper.pas"); +USEUNIT("cxGridUIHelper.pas"); +USEUNIT("cxGridUITableHelper.pas"); +USEUNIT("cxGridPopupMenuConsts.pas"); +USEUNIT("cxGridStyleSheetsPreview.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC10.res b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC10.res new file mode 100644 index 00000000..b837ff66 Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC10.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC11.bpk b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC11.bpk new file mode 100644 index 00000000..8ec15318 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC11.bpk @@ -0,0 +1,221 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = cxGridC11.bpl +OBJFILES = cxGridLevel.obj \ + cxGridStrs.obj cxFilterDialog.obj cxGrid.obj \ + cxGridChartView.obj cxGridBandedTableView.obj cxGridCardView.obj \ + cxGridCommon.obj cxGridCustomView.obj cxGridCustomTableView.obj \ + cxGridDBChartView.obj cxGridDBBandedTableView.obj \ + cxGridDBCardView.obj cxGridDBDataDefinitions.obj \ + cxGridDBTableView.obj cxGridDetailsSite.obj \ + cxGridRows.obj cxGridFilterHelpers.obj \ + cxGridExportLink.obj cxGridTableView.obj \ + cxDBExtLookupComboBox.obj \ + cxGridCustomPopUpMenu.obj \ + cxGridFooterPopupMenuItems.obj \ + cxGridHeaderPopupMenuItems.obj \ + cxGridGroupRowPopupMenuItems.obj \ + cxGridMenuOperations.obj \ + cxGridPopUpMenu.obj \ + cxGridStdPopUpMenu.obj \ + cxGridUIBandedTableHelper.obj \ + cxGridUICardHelper.obj \ + cxGridUICustomTableHelper.obj \ + cxGridUIHelper.obj \ + cxGridUITableHelper.obj\ + cxGridPopupMenuConsts.obj \ + cxGridStyleSheetsPreview.obj \ + cxGridC11.obj +RESFILES = cxGridC11.res +MAINSOURCE = cxGridC11.cpp +RESDEPEN = $(RESFILES) cxFilterDialog.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = dxThemeC11.bpi cxEditorsC11.bpi cxExportC11.bpi cxLibraryC11.bpi \ + cxDataC11.bpi rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi cxExtEditorsC11.bpi \ + cxPageControlC11.bpi +SPARELIBS = rtl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) \ + -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressQuantumGrid 6 by Developer Express Inc." -aa \ + -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC11.cpp b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC11.cpp new file mode 100644 index 00000000..99d8a3a4 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC11.cpp @@ -0,0 +1,64 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxGridC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("cxExportC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("cxExtEditorsC11.bpi"); +USEPACKAGE("cxPageControlC11.bpi"); +USEUNIT("cxGridStrs.pas"); +USEFORMNS("cxFilterDialog.pas", Cxfilterdialog, cxFilterDialog); +USEUNIT("cxDBExtLookupComboBox.pas"); +USEUNIT("cxGrid.pas"); +USEUNIT("cxGridChartView.pas"); +USEUNIT("cxGridBandedTableView.pas"); +USEUNIT("cxGridCardView.pas"); +USEUNIT("cxGridCommon.pas"); +USEUNIT("cxGridCustomTableView.pas"); +USEUNIT("cxGridCustomView.pas"); +USEUNIT("cxGridDBChartView.pas"); +USEUNIT("cxGridDBBandedTableView.pas"); +USEUNIT("cxGridDBCardView.pas"); +USEUNIT("cxGridDBDataDefinitions.pas"); +USEUNIT("cxGridRows.pas"); +USEUNIT("cxGridDBTableView.pas"); +USEUNIT("cxGridDetailsSite.pas"); +USEUNIT("cxGridLevel.pas"); +USEUNIT("cxGridExportLink.pas"); +USEUNIT("cxGridTableView.pas"); +USEUNIT("cxGridFilterHelpers.pas"); +USEUNIT("cxGridCustomPopUpMenu.pas"); +USEUNIT("cxGridFooterPopupMenuItems.pas"); +USEUNIT("cxGridHeaderPopupMenuItems.pas"); +USEUNIT("cxGridGroupRowPopupMenuItems.pas"); +USEUNIT("cxGridMenuOperations.pas"); +USEUNIT("cxGridPopUpMenu.pas"); +USEUNIT("cxGridStdPopUpMenu.pas"); +USEUNIT("cxGridUIBandedTableHelper.pas"); +USEUNIT("cxGridUICardHelper.pas"); +USEUNIT("cxGridUICustomTableHelper.pas"); +USEUNIT("cxGridUIHelper.pas"); +USEUNIT("cxGridUITableHelper.pas"); +USEUNIT("cxGridPopupMenuConsts.pas"); +USEUNIT("cxGridStyleSheetsPreview.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC11.res b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC11.res new file mode 100644 index 00000000..3a39e264 Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC11.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC5.bpk b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC5.bpk new file mode 100644 index 00000000..6f7dbb20 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC5.bpk @@ -0,0 +1,219 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = cxGridC5.bpl +OBJFILES = cxGridStrs.obj cxFilterDialog.obj \ + cxDBExtLookupComboBox.obj cxGrid.obj \ + cxGridChartView.obj cxGridBandedTableView.obj cxGridCardView.obj \ + cxGridCommon.obj cxGridCustomView.obj cxGridCustomTableView.obj \ + cxGridDBChartView.obj cxGridDBBandedTableView.obj \ + cxGridDBCardView.obj cxGridDBDataDefinitions.obj \ + cxGridDBTableView.obj cxGridDetailsSite.obj \ + cxGridLevel.obj cxGridRows.obj cxGridFilterHelpers.obj \ + cxGridExportLink.obj cxGridTableView.obj \ + cxGridCustomPopUpMenu.obj \ + cxGridFooterPopupMenuItems.obj \ + cxGridHeaderPopupMenuItems.obj \ + cxGridGroupRowPopupMenuItems.obj \ + cxGridMenuOperations.obj \ + cxGridPopUpMenu.obj \ + cxGridStdPopUpMenu.obj \ + cxGridUIBandedTableHelper.obj \ + cxGridUICardHelper.obj \ + cxGridUICustomTableHelper.obj \ + cxGridUIHelper.obj \ + cxGridUITableHelper.obj\ + cxGridPopupMenuConsts.obj \ + cxGridStyleSheetsPreview.obj \ + cxGridC5.obj +RESFILES = cxGridC5.res +MAINSOURCE = cxGridC5.cpp +RESDEPEN = $(RESFILES) cxFilterDialog.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = dxThemeC5.bpi cxEditorsC5.bpi cxExportC5.bpi cxLibraryVCLC5.bpi \ + cxDataC5.bpi vcl50.bpi vcldb50.bpi cxExtEditorsC5.bpi cxPageControlC5.bpi +SPARELIBS = vcl50.lib vcldb50.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) \ + -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$C- -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressQuantumGrid 6 by Developer Express Inc." -aa \ + -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC5.cpp b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC5.cpp new file mode 100644 index 00000000..7c432782 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC5.cpp @@ -0,0 +1,62 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxGridC5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEPACKAGE("cxExportC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("cxExtEditorsC5.bpi"); +USEPACKAGE("cxPageControlC5.bpi"); +USEUNIT("cxGridStrs.pas"); +USEFORMNS("cxFilterDialog.pas", Cxfilterdialog, cxFilterDialog); +USEUNIT("cxDBExtLookupComboBox.pas"); +USEUNIT("cxGrid.pas"); +USEUNIT("cxGridChartView.pas"); +USEUNIT("cxGridBandedTableView.pas"); +USEUNIT("cxGridCardView.pas"); +USEUNIT("cxGridCommon.pas"); +USEUNIT("cxGridCustomTableView.pas"); +USEUNIT("cxGridCustomView.pas"); +USEUNIT("cxGridDBChartView.pas"); +USEUNIT("cxGridDBBandedTableView.pas"); +USEUNIT("cxGridDBCardView.pas"); +USEUNIT("cxGridDBDataDefinitions.pas"); +USEUNIT("cxGridRows.pas"); +USEUNIT("cxGridDBTableView.pas"); +USEUNIT("cxGridDetailsSite.pas"); +USEUNIT("cxGridLevel.pas"); +USEUNIT("cxGridExportLink.pas"); +USEUNIT("cxGridTableView.pas"); +USEUNIT("cxGridFilterHelpers.pas"); +USEUNIT("cxGridCustomPopUpMenu.pas"); +USEUNIT("cxGridFooterPopupMenuItems.pas"); +USEUNIT("cxGridHeaderPopupMenuItems.pas"); +USEUNIT("cxGridGroupRowPopupMenuItems.pas"); +USEUNIT("cxGridMenuOperations.pas"); +USEUNIT("cxGridPopUpMenu.pas"); +USEUNIT("cxGridStdPopUpMenu.pas"); +USEUNIT("cxGridUIBandedTableHelper.pas"); +USEUNIT("cxGridUICardHelper.pas"); +USEUNIT("cxGridUICustomTableHelper.pas"); +USEUNIT("cxGridUIHelper.pas"); +USEUNIT("cxGridUITableHelper.pas"); +USEUNIT("cxGridPopupMenuConsts.pas"); +USEUNIT("cxGridStyleSheetsPreview.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC5.res b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC5.res new file mode 100644 index 00000000..b3bce40c Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC5.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC6.bpk b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC6.bpk new file mode 100644 index 00000000..c357d2ce --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC6.bpk @@ -0,0 +1,221 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = cxGridC6.bpl +OBJFILES = cxGridLevel.obj \ + cxGridStrs.obj cxFilterDialog.obj cxGrid.obj \ + cxGridChartView.obj cxGridBandedTableView.obj cxGridCardView.obj \ + cxGridCommon.obj cxGridCustomView.obj cxGridCustomTableView.obj \ + cxGridDBChartView.obj cxGridDBBandedTableView.obj \ + cxGridDBCardView.obj cxGridDBDataDefinitions.obj \ + cxGridDBTableView.obj cxGridDetailsSite.obj \ + cxGridRows.obj cxGridFilterHelpers.obj \ + cxGridExportLink.obj cxGridTableView.obj \ + cxDBExtLookupComboBox.obj \ + cxGridCustomPopUpMenu.obj \ + cxGridFooterPopupMenuItems.obj \ + cxGridHeaderPopupMenuItems.obj \ + cxGridGroupRowPopupMenuItems.obj \ + cxGridMenuOperations.obj \ + cxGridPopUpMenu.obj \ + cxGridStdPopUpMenu.obj \ + cxGridUIBandedTableHelper.obj \ + cxGridUICardHelper.obj \ + cxGridUICustomTableHelper.obj \ + cxGridUIHelper.obj \ + cxGridUITableHelper.obj\ + cxGridPopupMenuConsts.obj \ + cxGridStyleSheetsPreview.obj \ + cxGridC6.obj +RESFILES = cxGridC6.res +MAINSOURCE = cxGridC6.cpp +RESDEPEN = $(RESFILES) cxFilterDialog.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = dxThemeC6.bpi cxEditorsVCLC6.bpi cxExportVCLC6.bpi cxLibraryVCLC6.bpi \ + cxDataC6.bpi rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi cxExtEditorsVCLC6.bpi \ + cxPageControlVCLC6.bpi +SPARELIBS = rtl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) \ + -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressQuantumGrid 6 by Developer Express Inc." -aa \ + -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC6.cpp b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC6.cpp new file mode 100644 index 00000000..17745096 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC6.cpp @@ -0,0 +1,64 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxGridC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEPACKAGE("cxExportVCLC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("cxExtEditorsVCLC6.bpi"); +USEPACKAGE("cxPageControlVCLC6.bpi"); +USEUNIT("cxGridStrs.pas"); +USEFORMNS("cxFilterDialog.pas", Cxfilterdialog, cxFilterDialog); +USEUNIT("cxDBExtLookupComboBox.pas"); +USEUNIT("cxGrid.pas"); +USEUNIT("cxGridChartView.pas"); +USEUNIT("cxGridBandedTableView.pas"); +USEUNIT("cxGridCardView.pas"); +USEUNIT("cxGridCommon.pas"); +USEUNIT("cxGridCustomTableView.pas"); +USEUNIT("cxGridCustomView.pas"); +USEUNIT("cxGridDBChartView.pas"); +USEUNIT("cxGridDBBandedTableView.pas"); +USEUNIT("cxGridDBCardView.pas"); +USEUNIT("cxGridDBDataDefinitions.pas"); +USEUNIT("cxGridRows.pas"); +USEUNIT("cxGridDBTableView.pas"); +USEUNIT("cxGridDetailsSite.pas"); +USEUNIT("cxGridLevel.pas"); +USEUNIT("cxGridExportLink.pas"); +USEUNIT("cxGridTableView.pas"); +USEUNIT("cxGridFilterHelpers.pas"); +USEUNIT("cxGridCustomPopUpMenu.pas"); +USEUNIT("cxGridFooterPopupMenuItems.pas"); +USEUNIT("cxGridHeaderPopupMenuItems.pas"); +USEUNIT("cxGridGroupRowPopupMenuItems.pas"); +USEUNIT("cxGridMenuOperations.pas"); +USEUNIT("cxGridPopUpMenu.pas"); +USEUNIT("cxGridStdPopUpMenu.pas"); +USEUNIT("cxGridUIBandedTableHelper.pas"); +USEUNIT("cxGridUICardHelper.pas"); +USEUNIT("cxGridUICustomTableHelper.pas"); +USEUNIT("cxGridUIHelper.pas"); +USEUNIT("cxGridUITableHelper.pas"); +USEUNIT("cxGridPopupMenuConsts.pas"); +USEUNIT("cxGridStyleSheetsPreview.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC6.res b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC6.res new file mode 100644 index 00000000..8c6c4838 Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridC6.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD10.dpk b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD10.dpk new file mode 100644 index 00000000..d68ffe53 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD10.dpk @@ -0,0 +1,72 @@ +package cxGridD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumGrid 6 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxEditorsD10, + cxExportD10, + cxExtEditorsD10, + cxPageControlD10; + +contains + cxDBExtLookupComboBox, + cxGridExportLink, + cxFilterDialog, + cxGrid, + cxGridBandedTableView, + cxGridCardView, + cxGridChartView, + cxGridCommon, + cxGridCustomPopupMenu, + cxGridCustomTableView, + cxGridCustomView, + cxGridDBBandedTableView, + cxGridDBCardView, + cxGridDBChartView, + cxGridDBDataDefinitions, + cxGridDBTableView, + cxGridDetailsSite, + cxGridFilterHelpers, + cxGridFooterPopupMenuItems, + cxGridHeaderPopupMenuItems, + cxGridGroupRowPopupMenuItems, + cxGridLevel, + cxGridMenuOperations, + cxGridPopupMenu, + cxGridPopupMenuConsts, + cxGridRows, + cxGridStdPopupMenu, + cxGridStrs, + cxGridTableView, + cxGridUIBandedTableHelper, + cxGridUICardHelper, + cxGridUICustomTableHelper, + cxGridUIHelper, + cxGridUITableHelper; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD10.res b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD10.res new file mode 100644 index 00000000..fd6d55fe Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD10.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD11.dpk b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD11.dpk new file mode 100644 index 00000000..1510d009 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD11.dpk @@ -0,0 +1,72 @@ +package cxGridD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumGrid 6 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxEditorsD11, + cxExportD11, + cxExtEditorsD11, + cxPageControlD11; + +contains + cxDBExtLookupComboBox, + cxGridExportLink, + cxFilterDialog, + cxGrid, + cxGridBandedTableView, + cxGridCardView, + cxGridChartView, + cxGridCommon, + cxGridCustomPopupMenu, + cxGridCustomTableView, + cxGridCustomView, + cxGridDBBandedTableView, + cxGridDBCardView, + cxGridDBChartView, + cxGridDBDataDefinitions, + cxGridDBTableView, + cxGridDetailsSite, + cxGridFilterHelpers, + cxGridFooterPopupMenuItems, + cxGridHeaderPopupMenuItems, + cxGridGroupRowPopupMenuItems, + cxGridLevel, + cxGridMenuOperations, + cxGridPopupMenu, + cxGridPopupMenuConsts, + cxGridRows, + cxGridStdPopupMenu, + cxGridStrs, + cxGridTableView, + cxGridUIBandedTableHelper, + cxGridUICardHelper, + cxGridUICustomTableHelper, + cxGridUIHelper, + cxGridUITableHelper; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD11.res b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD11.res new file mode 100644 index 00000000..51af73f9 Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD11.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD5.dpk b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD5.dpk new file mode 100644 index 00000000..394fab82 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD5.dpk @@ -0,0 +1,71 @@ +package cxGridD5; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumGrid 6 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + cxEditorsD5, + cxExportD5, + cxExtEditorsD5, + cxPageControlD5; + +contains + cxDBExtLookupComboBox, + cxGridExportLink, + cxFilterDialog, + cxGrid, + cxGridBandedTableView, + cxGridCardView, + cxGridChartView, + cxGridCommon, + cxGridCustomPopupMenu, + cxGridCustomTableView, + cxGridCustomView, + cxGridDBBandedTableView, + cxGridDBCardView, + cxGridDBChartView, + cxGridDBDataDefinitions, + cxGridDBTableView, + cxGridDetailsSite, + cxGridFilterHelpers, + cxGridFooterPopupMenuItems, + cxGridHeaderPopupMenuItems, + cxGridGroupRowPopupMenuItems, + cxGridLevel, + cxGridMenuOperations, + cxGridPopupMenu, + cxGridPopupMenuConsts, + cxGridRows, + cxGridStdPopupMenu, + cxGridStrs, + cxGridTableView, + cxGridUIBandedTableHelper, + cxGridUICardHelper, + cxGridUICustomTableHelper, + cxGridUIHelper, + cxGridUITableHelper; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD5.res b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD5.res new file mode 100644 index 00000000..8ab9c9b8 Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD5.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD6.dpk b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD6.dpk new file mode 100644 index 00000000..2c99f3a3 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD6.dpk @@ -0,0 +1,72 @@ +package cxGridD6; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumGrid 6 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxEditorsVCLD6, + cxExportVCLD6, + cxExtEditorsVCLD6, + cxPageControlVCLD6; + +contains + cxDBExtLookupComboBox, + cxGridExportLink, + cxFilterDialog, + cxGrid, + cxGridBandedTableView, + cxGridCardView, + cxGridChartView, + cxGridCommon, + cxGridCustomPopupMenu, + cxGridCustomTableView, + cxGridCustomView, + cxGridDBBandedTableView, + cxGridDBCardView, + cxGridDBChartView, + cxGridDBDataDefinitions, + cxGridDBTableView, + cxGridDetailsSite, + cxGridFilterHelpers, + cxGridFooterPopupMenuItems, + cxGridHeaderPopupMenuItems, + cxGridGroupRowPopupMenuItems, + cxGridLevel, + cxGridMenuOperations, + cxGridPopupMenu, + cxGridPopupMenuConsts, + cxGridRows, + cxGridStdPopupMenu, + cxGridStrs, + cxGridTableView, + cxGridUIBandedTableHelper, + cxGridUICardHelper, + cxGridUICustomTableHelper, + cxGridUIHelper, + cxGridUITableHelper; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD6.res b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD6.res new file mode 100644 index 00000000..34f3ff7c Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD6.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD7.dpk b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD7.dpk new file mode 100644 index 00000000..9129d3b7 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD7.dpk @@ -0,0 +1,72 @@ +package cxGridD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumGrid 6 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxEditorsVCLD7, + cxExportVCLD7, + cxExtEditorsVCLD7, + cxPageControlVCLD7; + +contains + cxDBExtLookupComboBox, + cxGridExportLink, + cxFilterDialog, + cxGrid, + cxGridBandedTableView, + cxGridCardView, + cxGridChartView, + cxGridCommon, + cxGridCustomPopupMenu, + cxGridCustomTableView, + cxGridCustomView, + cxGridDBBandedTableView, + cxGridDBCardView, + cxGridDBChartView, + cxGridDBDataDefinitions, + cxGridDBTableView, + cxGridDetailsSite, + cxGridFilterHelpers, + cxGridFooterPopupMenuItems, + cxGridHeaderPopupMenuItems, + cxGridGroupRowPopupMenuItems, + cxGridLevel, + cxGridMenuOperations, + cxGridPopupMenu, + cxGridPopupMenuConsts, + cxGridRows, + cxGridStdPopupMenu, + cxGridStrs, + cxGridTableView, + cxGridUIBandedTableHelper, + cxGridUICardHelper, + cxGridUICustomTableHelper, + cxGridUIHelper, + cxGridUITableHelper; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD7.res b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD7.res new file mode 100644 index 00000000..53655639 Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD7.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD9.dpk b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD9.dpk new file mode 100644 index 00000000..410eb250 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD9.dpk @@ -0,0 +1,72 @@ +package cxGridD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumGrid 6 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxEditorsD9, + cxExportD9, + cxExtEditorsD9, + cxPageControlD9; + +contains + cxDBExtLookupComboBox, + cxGridExportLink, + cxFilterDialog, + cxGrid, + cxGridBandedTableView, + cxGridCardView, + cxGridChartView, + cxGridCommon, + cxGridCustomPopupMenu, + cxGridCustomTableView, + cxGridCustomView, + cxGridDBBandedTableView, + cxGridDBCardView, + cxGridDBChartView, + cxGridDBDataDefinitions, + cxGridDBTableView, + cxGridDetailsSite, + cxGridFilterHelpers, + cxGridFooterPopupMenuItems, + cxGridHeaderPopupMenuItems, + cxGridGroupRowPopupMenuItems, + cxGridLevel, + cxGridMenuOperations, + cxGridPopupMenu, + cxGridPopupMenuConsts, + cxGridRows, + cxGridStdPopupMenu, + cxGridStrs, + cxGridTableView, + cxGridUIBandedTableHelper, + cxGridUICardHelper, + cxGridUICustomTableHelper, + cxGridUIHelper, + cxGridUITableHelper; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD9.res b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD9.res new file mode 100644 index 00000000..a9efcb56 Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Packages/cxGridD9.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC10.bpk b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC10.bpk new file mode 100644 index 00000000..99275a2a --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC10.bpk @@ -0,0 +1,208 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxGridC10.bpl +OBJFILES = dclcxGridC10.obj cxGridViewLayoutEditor.obj \ + cxChartViewEditor.obj cxCardViewEditor.obj cxCustomTableViewEditor.obj \ + cxDBGridConverter.obj cxDXGridConverter.obj \ + cxGridImportDialog.obj \ + cxGridPredefinedStyles.obj cxGridReg.obj \ + cxGridStructureNavigator.obj \ + cxGridConverter.obj cxGridEditor.obj \ + cxBandedTableViewEditor.obj \ + cxTableViewEditor.obj cxViewEditor.obj \ + cxWWGridConverter.obj cxGridPopupMenuReg.obj \ + cxImageComboBoxItemsEditor.obj +RESFILES = dclcxGridC10.res cxGridReg.dcr cxGridPopupMenuReg.dcr +MAINSOURCE = dclcxGridC10.cpp +RESDEPEN = $(RESFILES) cxGridViewLayoutEditor.dfm \ + cxGridEditor.dfm cxGridImportDialog.dfm \ + cxGridPredefinedStyles.dfm cxViewEditor.dfm \ + cxImageComboBoxItemsEditor.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = cxDataC10.bpi cxEditorsC10.bpi cxGridC10.bpi dclcxLibraryC10.bpi designide.bpi rtl.bpi vcl.bpi \ + dbrtl.bpi vcldb.bpi cxLibraryC10.bpi dclcxEditorsC10.bpi cxPageControlC10.bpi dxThemeC10.bpi +SPARELIBS = rtl.lib vcl.lib dclcxLibraryC10.lib CXLIBRARYC10.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressQuantumGrid 6 by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC10.cpp b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC10.cpp new file mode 100644 index 00000000..dceb7e6e --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC10.cpp @@ -0,0 +1,51 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxGridC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEPACKAGE("cxGridC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("dclcxEditorsC10.bpi"); +USEPACKAGE("dclcxLibraryC10.bpi"); +USEPACKAGE("cxPageControlC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEFORMNS("cxGridViewLayoutEditor.pas", Cxgridviewlayouteditor, cxGridViewLayoutEditor); +USEUNIT("cxCardViewEditor.pas"); +USEUNIT("cxCustomTableViewEditor.pas"); +USEUNIT("cxDBGridConverter.pas"); +USEUNIT("cxDXGridConverter.pas"); +USEFORMNS("cxGridEditor.pas", Cxgrideditor, cxGridEditor); +USEFORMNS("cxGridImportDialog.pas", Cxgridimportdialog, ImportDialog); +USEFORMNS("cxGridPredefinedStyles.pas", Cxgridpredefinedstyles, cxdmGridPredefinedStyles); /* TDataModule: File Type */ +USEFORMNS("cxImageComboBoxItemsEditor.pas", Cximagecomboboxitemseditor, fmImageComboBoxItemsEditor); +USEUNIT("cxGridReg.pas"); +USERES("cxGridReg.dcr"); +USEUNIT("cxGridStructureNavigator.pas"); +USEUNIT("cxChartViewEditor.pas"); +USEUNIT("cxBandedTableViewEditor.pas"); +USEUNIT("cxTableViewEditor.pas"); +USEFORMNS("cxViewEditor.pas", Cxvieweditor, cxViewEditor); +USEUNIT("cxWWGridConverter.pas"); +USEUNIT("cxGridConverter.pas"); +USEUNIT("cxGridPopupMenuReg.pas"); +USERES("cxGridPopupMenuReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC10.res b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC10.res new file mode 100644 index 00000000..98ee6393 Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC10.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC11.bpk b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC11.bpk new file mode 100644 index 00000000..e29617a8 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC11.bpk @@ -0,0 +1,208 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxGridC11.bpl +OBJFILES = dclcxGridC11.obj cxGridViewLayoutEditor.obj \ + cxChartViewEditor.obj cxCardViewEditor.obj cxCustomTableViewEditor.obj \ + cxDBGridConverter.obj cxDXGridConverter.obj \ + cxGridImportDialog.obj \ + cxGridPredefinedStyles.obj cxGridReg.obj \ + cxGridStructureNavigator.obj \ + cxGridConverter.obj cxGridEditor.obj \ + cxBandedTableViewEditor.obj \ + cxTableViewEditor.obj cxViewEditor.obj \ + cxWWGridConverter.obj cxGridPopupMenuReg.obj \ + cxImageComboBoxItemsEditor.obj +RESFILES = dclcxGridC11.res cxGridReg.dcr cxGridPopupMenuReg.dcr +MAINSOURCE = dclcxGridC11.cpp +RESDEPEN = $(RESFILES) cxGridViewLayoutEditor.dfm \ + cxGridEditor.dfm cxGridImportDialog.dfm \ + cxGridPredefinedStyles.dfm cxViewEditor.dfm \ + cxImageComboBoxItemsEditor.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = cxDataC11.bpi cxEditorsC11.bpi cxGridC11.bpi dclcxLibraryC11.bpi designide.bpi rtl.bpi vcl.bpi \ + dbrtl.bpi vcldb.bpi cxLibraryC11.bpi dclcxEditorsC11.bpi cxPageControlC11.bpi dxThemeC11.bpi +SPARELIBS = rtl.lib vcl.lib dclcxLibraryC11.lib CXLIBRARYC11.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressQuantumGrid 6 by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC11.cpp b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC11.cpp new file mode 100644 index 00000000..f43811b2 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC11.cpp @@ -0,0 +1,51 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxGridC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("cxGridC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dclcxEditorsC11.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEPACKAGE("cxPageControlC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEFORMNS("cxGridViewLayoutEditor.pas", Cxgridviewlayouteditor, cxGridViewLayoutEditor); +USEUNIT("cxCardViewEditor.pas"); +USEUNIT("cxCustomTableViewEditor.pas"); +USEUNIT("cxDBGridConverter.pas"); +USEUNIT("cxDXGridConverter.pas"); +USEFORMNS("cxGridEditor.pas", Cxgrideditor, cxGridEditor); +USEFORMNS("cxGridImportDialog.pas", Cxgridimportdialog, ImportDialog); +USEFORMNS("cxGridPredefinedStyles.pas", Cxgridpredefinedstyles, cxdmGridPredefinedStyles); /* TDataModule: File Type */ +USEFORMNS("cxImageComboBoxItemsEditor.pas", Cximagecomboboxitemseditor, fmImageComboBoxItemsEditor); +USEUNIT("cxGridReg.pas"); +USERES("cxGridReg.dcr"); +USEUNIT("cxGridStructureNavigator.pas"); +USEUNIT("cxChartViewEditor.pas"); +USEUNIT("cxBandedTableViewEditor.pas"); +USEUNIT("cxTableViewEditor.pas"); +USEFORMNS("cxViewEditor.pas", Cxvieweditor, cxViewEditor); +USEUNIT("cxWWGridConverter.pas"); +USEUNIT("cxGridConverter.pas"); +USEUNIT("cxGridPopupMenuReg.pas"); +USERES("cxGridPopupMenuReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC11.res b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC11.res new file mode 100644 index 00000000..f400c51a Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC11.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC5.bpk b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC5.bpk new file mode 100644 index 00000000..b12f9fec --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC5.bpk @@ -0,0 +1,208 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dclcxGridC5.bpl +OBJFILES = dclcxGridC5.obj cxGridViewLayoutEditor.obj \ + cxChartViewEditor.obj cxCardViewEditor.obj cxCustomTableViewEditor.obj \ + cxDBGridConverter.obj cxDXGridConverter.obj \ + cxGridImportDialog.obj \ + cxGridPredefinedStyles.obj cxGridReg.obj \ + cxGridStructureNavigator.obj \ + cxGridConverter.obj cxGridEditor.obj \ + cxBandedTableViewEditor.obj \ + cxTableViewEditor.obj cxViewEditor.obj \ + cxWWGridConverter.obj cxGridPopupMenuReg.obj \ + cxImageComboBoxItemsEditor.obj +RESFILES = dclcxGridC5.res cxGridReg.dcr cxGridPopupMenuReg.dcr +MAINSOURCE = dclcxGridC5.cpp +RESDEPEN = $(RESFILES) cxGridViewLayoutEditor.dfm \ + cxGridEditor.dfm cxGridImportDialog.dfm \ + cxGridPredefinedStyles.dfm cxViewEditor.dfm \ + cxImageComboBoxItemsEditor.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = cxDataC5.bpi cxEditorsC5.bpi cxGridC5.bpi dclcxLibraryVCLC5.bpi dsnide50.bpi vcl50.bpi \ + vcldb50.bpi cxLibraryVCLC5.bpi dclcxEditorsC5.bpi vclx50.bpi cxPageControlC5.bpi dxThemeC5.bpi +SPARELIBS = vcl50.lib vcldb50.lib vclx50.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd50 -LUdcldb50 +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressQuantumGrid 6 by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC5.cpp b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC5.cpp new file mode 100644 index 00000000..1c17fb9e --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC5.cpp @@ -0,0 +1,50 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxGridC5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vclx50.bpi"); +USEPACKAGE("dsnide50.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("cxGridC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("dclcxLibraryVCLC5.bpi"); +USEPACKAGE("dclcxEditorsC5.bpi"); +USEPACKAGE("cxPageControlC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEFORMNS("cxGridViewLayoutEditor.pas", Cxgridviewlayouteditor, cxGridViewLayoutEditor); +USEUNIT("cxCardViewEditor.pas"); +USEUNIT("cxCustomTableViewEditor.pas"); +USEUNIT("cxDBGridConverter.pas"); +USEUNIT("cxDXGridConverter.pas"); +USEFORMNS("cxGridEditor.pas", Cxgrideditor, cxGridEditor); +USEFORMNS("cxGridImportDialog.pas", Cxgridimportdialog, ImportDialog); +USEFORMNS("cxGridPredefinedStyles.pas", Cxgridpredefinedstyles, cxdmGridPredefinedStyles); /* TDataModule: File Type */ +USEFORMNS("cxImageComboBoxItemsEditor.pas", Cximagecomboboxitemseditor, fmImageComboBoxItemsEditor); +USEUNIT("cxGridReg.pas"); +USERES("cxGridReg.dcr"); +USEUNIT("cxGridStructureNavigator.pas"); +USEUNIT("cxChartViewEditor.pas"); +USEUNIT("cxBandedTableViewEditor.pas"); +USEUNIT("cxTableViewEditor.pas"); +USEFORMNS("cxViewEditor.pas", Cxvieweditor, cxViewEditor); +USEUNIT("cxWWGridConverter.pas"); +USEUNIT("cxGridConverter.pas"); +USEUNIT("cxGridPopupMenuReg.pas"); +USERES("cxGridPopupMenuReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC5.res b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC5.res new file mode 100644 index 00000000..2edc3a2d Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC5.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC6.bpk b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC6.bpk new file mode 100644 index 00000000..93bb78e7 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC6.bpk @@ -0,0 +1,208 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxGridC6.bpl +OBJFILES = dclcxGridC6.obj cxGridViewLayoutEditor.obj \ + cxChartViewEditor.obj cxCardViewEditor.obj cxCustomTableViewEditor.obj \ + cxDBGridConverter.obj cxDXGridConverter.obj \ + cxGridImportDialog.obj \ + cxGridPredefinedStyles.obj cxGridReg.obj \ + cxGridStructureNavigator.obj \ + cxGridConverter.obj cxGridEditor.obj \ + cxBandedTableViewEditor.obj \ + cxTableViewEditor.obj cxViewEditor.obj \ + cxWWGridConverter.obj cxGridPopupMenuReg.obj \ + cxImageComboBoxItemsEditor.obj +RESFILES = dclcxGridC6.res cxGridReg.dcr cxGridPopupMenuReg.dcr +MAINSOURCE = dclcxGridC6.cpp +RESDEPEN = $(RESFILES) cxGridViewLayoutEditor.dfm \ + cxGridEditor.dfm cxGridImportDialog.dfm \ + cxGridPredefinedStyles.dfm cxViewEditor.dfm \ + cxImageComboBoxItemsEditor.dfm +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = cxDataC6.bpi cxEditorsVCLC6.bpi cxGridC6.bpi dclcxLibraryVCLC6.bpi designide.bpi rtl.bpi vcl.bpi \ + dbrtl.bpi vcldb.bpi cxLibraryVCLC6.bpi dclcxEditorsVCLC6.bpi cxPageControlVCLC6.bpi dxThemeC6.bpi +SPARELIBS = rtl.lib vcl.lib dclcxLibraryVCLC6.lib CXLIBRARYVCLC6.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressQuantumGrid 6 by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC6.cpp b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC6.cpp new file mode 100644 index 00000000..45006bfc --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC6.cpp @@ -0,0 +1,51 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxGridC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("cxGridC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("dclcxEditorsVCLC6.bpi"); +USEPACKAGE("dclcxLibraryVCLC6.bpi"); +USEPACKAGE("cxPageControlVCLC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEFORMNS("cxGridViewLayoutEditor.pas", Cxgridviewlayouteditor, cxGridViewLayoutEditor); +USEUNIT("cxCardViewEditor.pas"); +USEUNIT("cxCustomTableViewEditor.pas"); +USEUNIT("cxDBGridConverter.pas"); +USEUNIT("cxDXGridConverter.pas"); +USEFORMNS("cxGridEditor.pas", Cxgrideditor, cxGridEditor); +USEFORMNS("cxGridImportDialog.pas", Cxgridimportdialog, ImportDialog); +USEFORMNS("cxGridPredefinedStyles.pas", Cxgridpredefinedstyles, cxdmGridPredefinedStyles); /* TDataModule: File Type */ +USEFORMNS("cxImageComboBoxItemsEditor.pas", Cximagecomboboxitemseditor, fmImageComboBoxItemsEditor); +USEUNIT("cxGridReg.pas"); +USERES("cxGridReg.dcr"); +USEUNIT("cxGridStructureNavigator.pas"); +USEUNIT("cxChartViewEditor.pas"); +USEUNIT("cxBandedTableViewEditor.pas"); +USEUNIT("cxTableViewEditor.pas"); +USEFORMNS("cxViewEditor.pas", Cxvieweditor, cxViewEditor); +USEUNIT("cxWWGridConverter.pas"); +USEUNIT("cxGridConverter.pas"); +USEUNIT("cxGridPopupMenuReg.pas"); +USERES("cxGridPopupMenuReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC6.res b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC6.res new file mode 100644 index 00000000..de797c85 Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridC6.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD10.dpk b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD10.dpk new file mode 100644 index 00000000..88a5e8cd --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD10.dpk @@ -0,0 +1,62 @@ +package dclcxGridD10; + +{$R *.res} +{$R cxGridReg.dcr} +{$R cxGridPopupMenuReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumGrid 6 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxGridD10, + dxThemeD10, + designide, + dclcxLibraryD10, + dclcxEditorsD10, + dclcxExtEditorsD10, + dclcxPageControlD10; + +contains + cxBandedTableViewEditor, + cxCardViewEditor, + cxChartViewEditor, + cxCustomTableViewEditor, + cxDBGridConverter, + cxDXGridConverter, + cxGridConverter, + cxGridEditor, + cxGridImportDialog, + cxGridPopupMenuReg, + cxGridPredefinedStyles, + cxGridReg, + cxGridStructureNavigator, + cxGridStyleSheetsPreview, + cxGridViewLayoutEditor, + cxImageComboBoxItemsEditor, + cxTableViewEditor, + cxViewEditor, + cxWWGridConverter; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD10.res b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD10.res new file mode 100644 index 00000000..9b169fc4 Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD10.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD11.dpk b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD11.dpk new file mode 100644 index 00000000..e1242db9 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD11.dpk @@ -0,0 +1,62 @@ +package dclcxGridD11; + +{$R *.res} +{$R cxGridReg.dcr} +{$R cxGridPopupMenuReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumGrid 6 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxGridD11, + dxThemeD11, + designide, + dclcxLibraryD11, + dclcxEditorsD11, + dclcxExtEditorsD11, + dclcxPageControlD11; + +contains + cxBandedTableViewEditor, + cxCardViewEditor, + cxChartViewEditor, + cxCustomTableViewEditor, + cxDBGridConverter, + cxDXGridConverter, + cxGridConverter, + cxGridEditor, + cxGridImportDialog, + cxGridPopupMenuReg, + cxGridPredefinedStyles, + cxGridReg, + cxGridStructureNavigator, + cxGridStyleSheetsPreview, + cxGridViewLayoutEditor, + cxImageComboBoxItemsEditor, + cxTableViewEditor, + cxViewEditor, + cxWWGridConverter; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD11.res b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD11.res new file mode 100644 index 00000000..4d8b33ef Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD11.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD5.dpk b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD5.dpk new file mode 100644 index 00000000..0e513372 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD5.dpk @@ -0,0 +1,62 @@ +package dclcxGridD5; + +{$R *.RES} +{$R cxGridReg.dcr} +{$R cxGridPopupMenuReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumGrid 6 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + cxGridD5, + dxThemeD5, + dsnide50, + dclcxLibraryVCLD5, + dclcxEditorsD5, + dclcxExtEditorsD5, + dclcxPageControlD5; + +contains + cxBandedTableViewEditor, + cxCardViewEditor, + cxChartViewEditor, + cxCustomTableViewEditor, + cxDBGridConverter, + cxDXGridConverter, + cxGridConverter, + cxGridEditor, + cxGridImportDialog, + cxGridPopupMenuReg, + cxGridPredefinedStyles, + cxGridReg, + cxGridStructureNavigator, + cxGridStyleSheetsPreview, + cxGridViewLayoutEditor, + cxImageComboBoxItemsEditor, + cxTableViewEditor, + cxViewEditor, + cxWWGridConverter; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD5.res b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD5.res new file mode 100644 index 00000000..d51fa61b Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD5.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD6.dpk b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD6.dpk new file mode 100644 index 00000000..0cfa554a --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD6.dpk @@ -0,0 +1,62 @@ +package dclcxGridD6; + +{$R *.res} +{$R cxGridReg.dcr} +{$R cxGridPopupMenuReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumGrid 6 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxGridD6, + dxThemeD6, + designide, + dclcxLibraryVCLD6, + dclcxEditorsVCLD6, + dclcxExtEditorsVCLD6, + dclcxPageControlVCLD6; + +contains + cxBandedTableViewEditor, + cxCardViewEditor, + cxChartViewEditor, + cxCustomTableViewEditor, + cxDBGridConverter, + cxDXGridConverter, + cxGridConverter, + cxGridEditor, + cxGridImportDialog, + cxGridPopupMenuReg, + cxGridPredefinedStyles, + cxGridReg, + cxGridStructureNavigator, + cxGridStyleSheetsPreview, + cxGridViewLayoutEditor, + cxImageComboBoxItemsEditor, + cxTableViewEditor, + cxViewEditor, + cxWWGridConverter; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD6.res b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD6.res new file mode 100644 index 00000000..3271e47b Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD6.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD7.dpk b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD7.dpk new file mode 100644 index 00000000..ce22f168 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD7.dpk @@ -0,0 +1,62 @@ +package dclcxGridD7; + +{$R *.res} +{$R cxGridReg.dcr} +{$R cxGridPopupMenuReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumGrid 6 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxGridD7, + dxThemeD7, + designide, + dclcxLibraryVCLD7, + dclcxEditorsVCLD7, + dclcxExtEditorsVCLD7, + dclcxPageControlVCLD7; + +contains + cxBandedTableViewEditor, + cxCardViewEditor, + cxChartViewEditor, + cxCustomTableViewEditor, + cxDBGridConverter, + cxDXGridConverter, + cxGridConverter, + cxGridEditor, + cxGridImportDialog, + cxGridPopupMenuReg, + cxGridPredefinedStyles, + cxGridReg, + cxGridStructureNavigator, + cxGridStyleSheetsPreview, + cxGridViewLayoutEditor, + cxImageComboBoxItemsEditor, + cxTableViewEditor, + cxViewEditor, + cxWWGridConverter; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD7.res b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD7.res new file mode 100644 index 00000000..96e65ede Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD7.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD9.dpk b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD9.dpk new file mode 100644 index 00000000..c275761b --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD9.dpk @@ -0,0 +1,62 @@ +package dclcxGridD9; + +{$R *.res} +{$R cxGridReg.dcr} +{$R cxGridPopupMenuReg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumGrid 6 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxGridD9, + dxThemeD9, + designide, + dclcxLibraryD9, + dclcxEditorsD9, + dclcxExtEditorsD9, + dclcxPageControlD9; + +contains + cxBandedTableViewEditor, + cxCardViewEditor, + cxChartViewEditor, + cxCustomTableViewEditor, + cxDBGridConverter, + cxDXGridConverter, + cxGridConverter, + cxGridEditor, + cxGridImportDialog, + cxGridPopupMenuReg, + cxGridPredefinedStyles, + cxGridReg, + cxGridStructureNavigator, + cxGridStyleSheetsPreview, + cxGridViewLayoutEditor, + cxImageComboBoxItemsEditor, + cxTableViewEditor, + cxViewEditor, + cxWWGridConverter; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD9.res b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD9.res new file mode 100644 index 00000000..aba6a300 Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Packages/dclcxGridD9.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxBandedTableViewEditor.dfm b/official/x.35/ExpressQuantumGrid 6/Sources/cxBandedTableViewEditor.dfm new file mode 100644 index 00000000..4e144072 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxBandedTableViewEditor.dfm @@ -0,0 +1,127 @@ +inherited cxBandedTableViewEditor: TcxBandedTableViewEditor + Left = 477 + Caption = 'cxBandedTableViewEditor' + PixelsPerInch = 96 + TextHeight = 13 + inherited PViewEditor: TPanel + inherited PageControl1: TcxPageControl + ActivePage = TSBands + object TSBands: TcxTabSheet [0] + BorderWidth = 8 + Caption = ' Bands ' + object Panel22: TPanel + Left = 209 + Top = 0 + Width = 118 + Height = 273 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object BAddBand: TcxButton + Left = 8 + Top = 0 + Width = 110 + Height = 24 + Caption = '&Add' + TabOrder = 0 + OnClick = BAddBandClick + end + object BDeleteBand: TcxButton + Left = 8 + Top = 32 + Width = 110 + Height = 24 + Caption = 'Delete' + TabOrder = 1 + OnClick = BDeleteBandClick + end + object BBandMoveDown: TcxButton + Left = 8 + Top = 104 + Width = 110 + Height = 24 + Caption = 'Move &Down' + TabOrder = 2 + OnClick = BBandMoveDownClick + end + object BBandMoveUp: TcxButton + Left = 8 + Top = 72 + Width = 110 + Height = 24 + Caption = 'Move &Up' + TabOrder = 3 + OnClick = BBandMoveUpClick + end + end + object Panel20: TPanel + Left = 0 + Top = 0 + Width = 209 + Height = 273 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object LBBands: TListBox + Left = 1 + Top = 1 + Width = 207 + Height = 271 + Style = lbOwnerDrawFixed + Align = alClient + BorderStyle = bsNone + DragMode = dmAutomatic + ItemHeight = 16 + MultiSelect = True + PopupMenu = PMBands + TabOrder = 0 + OnClick = LBBandsClick + OnDragDrop = LBBandsDragDrop + OnDragOver = LBBandsDragOver + OnDrawItem = LBBandsDrawItem + OnEndDrag = LBBandsEndDrag + OnKeyPress = FormKeyPress + OnStartDrag = LBBandsStartDrag + end + end + end + end + end + object PMBands: TPopupMenu + Left = 230 + Top = 90 + object MIBandsAdd: TMenuItem + Caption = '&Add' + ShortCut = 45 + OnClick = BAddBandClick + end + object MIBandsDelete: TMenuItem + Caption = '&Delete' + ShortCut = 46 + OnClick = BDeleteBandClick + end + object MenuItem4: TMenuItem + Caption = '-' + end + object MIBandsMoveUp: TMenuItem + Caption = 'Move Up' + ShortCut = 16422 + OnClick = BBandMoveUpClick + end + object MIBandsMoveDown: TMenuItem + Caption = 'Move Down' + ShortCut = 16424 + OnClick = BBandMoveDownClick + end + object MenuItem7: TMenuItem + Caption = '-' + end + object MIBandsSelectAll: TMenuItem + Caption = '&Select All' + ShortCut = 16449 + OnClick = MIBandsSelectAllClick + end + end +end diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxBandedTableViewEditor.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxBandedTableViewEditor.pas new file mode 100644 index 00000000..bdd951d5 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxBandedTableViewEditor.pas @@ -0,0 +1,360 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxBandedTableViewEditor; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, Variants, +{$ELSE} + Windows, +{$ENDIF} + SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, Menus, ExtCtrls, StdCtrls, ComCtrls, + cxGridCustomView, cxGridBandedTableView, + cxViewEditor, cxCustomTableViewEditor, cxTableViewEditor, + cxLookAndFeelPainters, cxButtons, cxPC, cxControls; + +type + TcxBandedTableViewEditor = class(TcxTableViewEditor) + TSBands: TcxTabSheet; + LBBands: TListBox; + Panel22: TPanel; + BAddBand: TcxButton; + BDeleteBand: TcxButton; + PMBands: TPopupMenu; + MIBandsAdd: TMenuItem; + MIBandsDelete: TMenuItem; + MenuItem4: TMenuItem; + MIBandsMoveUp: TMenuItem; + MenuItem7: TMenuItem; + MIBandsSelectAll: TMenuItem; + MIBandsMoveDown: TMenuItem; + BBandMoveDown: TcxButton; + BBandMoveUp: TcxButton; + Panel20: TPanel; + procedure BAddBandClick(Sender: TObject); + procedure BDeleteBandClick(Sender: TObject); + procedure LBBandsClick(Sender: TObject); + procedure LBBandsStartDrag(Sender: TObject; + var DragObject: TDragObject); + procedure LBBandsDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure LBBandsEndDrag(Sender, Target: TObject; X, Y: Integer); + procedure LBBandsDragDrop(Sender, Source: TObject; X, Y: Integer); + procedure BBandMoveUpClick(Sender: TObject); + procedure BBandMoveDownClick(Sender: TObject); + procedure MIBandsSelectAllClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure LBBandsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure LBColumnsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + private + FBandsPrevDragIndex: Integer; + function GetBands: TcxGridBands; + procedure ReindexBandsProc(AList: TList; ANewIndex: Integer); + procedure UpdateBandList; + protected + procedure DrawListBoxItem(AListBox: TWinControl; AIndex: Integer; R: TRect; + AParentBand: TcxGridBand); + procedure SelectAllBands; + procedure UpdateButtons; override; + procedure UpdateEditor; override; + procedure UpdateSelection; override; + public + class function GetViewByObject(APersistent: TPersistent): TcxCustomGridView; override; + property Bands: TcxGridBands read GetBands; + end; + + { TcxGridBandedTableViewStorage } + + TcxGridBandedTableViewStorage = class(TcxCustomGridTableViewStorage) + private + function GetOptionsCustomize: TcxGridBandedTableOptionsCustomize; + function GetOptionsView: TcxGridBandedTableOptionsView; + protected + function BandedTableView: TcxGridBandedTableView; + public + class function GetViewClass: TcxCustomGridViewClass; override; + published + property OptionsCustomize: TcxGridBandedTableOptionsCustomize read GetOptionsCustomize; + property OptionsView: TcxGridBandedTableOptionsView read GetOptionsView; + end; + + { TcxGridBandedTableViewMenuProvider } + + TcxGridBandedTableViewMenuProvider = class(TcxCustomGridTableViewMenuProvider) + private + function GetGridView: TcxGridBandedTableView; + protected + procedure CreateBand(Sender: TcxGridViewMenuItem); + procedure InitStructureCreationItems; override; + public + property GridView: TcxGridBandedTableView read GetGridView; + end; + +implementation + +uses + cxDesignWindows; + +{$R *.dfm} + +{ TcxGridBandedTableViewStorage } + +function TcxGridBandedTableViewStorage.GetOptionsCustomize: TcxGridBandedTableOptionsCustomize; +begin + Result := BandedTableView.OptionsCustomize; +end; + +function TcxGridBandedTableViewStorage.GetOptionsView: TcxGridBandedTableOptionsView; +begin + Result := BandedTableView.OptionsView; +end; + +function TcxGridBandedTableViewStorage.BandedTableView: TcxGridBandedTableView; +begin + Result := inherited View as TcxGridBandedTableView; +end; + +class function TcxGridBandedTableViewStorage.GetViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridBandedTableView; +end; + +{ TcxBandedTableViewEditor } + +class function TcxBandedTableViewEditor.GetViewByObject(APersistent: TPersistent): TcxCustomGridView; +begin + if APersistent is TcxGridBand then + Result := (APersistent as TcxGridBand).Bands.GridView + else + if APersistent is TcxGridBands then + Result := (APersistent as TcxGridBands).GridView + else + Result := inherited GetViewByObject(APersistent); +end; + +procedure TcxBandedTableViewEditor.DrawListBoxItem(AListBox: TWinControl; + AIndex: Integer; R: TRect; AParentBand: TcxGridBand); + + function GetParentBandInfoOffset: Integer; + var + I, W: Integer; + begin + Result := 0; + with AListBox as TListBox, Items do + for I := 0 to Count - 1 do + begin + W := Canvas.TextWidth(Items[I]); + if W > Result then Result := W; + end; + Inc(Result, 30); + end; + + function GetParentBandInfoText: string; + begin + Result := '[ParentBand: ' + IntToStr(AParentBand.Index); + if AParentBand.Caption <> '' then + Result := Result + ' - ' + AParentBand.Caption; + Result := Result + ']'; + end; + +begin + inherited DrawListBoxItem(AListBox, AIndex, R); + with AListBox as TListBox, Canvas do + if AParentBand <> nil then + begin + Inc(R.Left, GetParentBandInfoOffset); + TextOut(R.Left, R.Top, GetParentBandInfoText); + end; +end; + +procedure TcxBandedTableViewEditor.SelectAllBands; +begin + ListBoxSelectAll(LBBands); +end; + +procedure TcxBandedTableViewEditor.UpdateButtons; +begin + inherited; + BDeleteBand.Enabled := CanDeleteComponent(nil) and (LBBands.SelCount > 0); + BBandMoveUp.Enabled := LBBands.SelCount > 0; + BBandMoveDown.Enabled := LBBands.SelCount > 0; + + MIBandsMoveUp.Enabled := BBandMoveUp.Enabled; + MIBandsMoveDown.Enabled := BBandMoveDown.Enabled; + MIBandsSelectAll.Enabled := LBBands.SelCount < LBBands.Items.Count; +end; + +procedure TcxBandedTableViewEditor.UpdateEditor; +begin + inherited; + UpdateBandList; +end; + +procedure TcxBandedTableViewEditor.UpdateSelection; +begin + FormEditor.ListBoxSynchronizeSelection(LBBands); + inherited; +end; + +function TcxBandedTableViewEditor.GetBands: TcxGridBands; +begin + Result := (View as TcxGridBandedTableView).Bands; +end; + +procedure TcxBandedTableViewEditor.ReindexBandsProc(AList: TList; ANewIndex: Integer); +var + I: Integer; +begin + for I := 0 to AList.Count - 1 do + TcxGridBand(AList[I]).Index := ANewIndex; + UpdateDesigner; +end; + +procedure TcxBandedTableViewEditor.UpdateBandList; +begin + ListBoxLoadCollection(LBBands, Bands); +end; + +procedure TcxBandedTableViewEditor.BAddBandClick(Sender: TObject); +begin + CollectionItemsAdd(LBBands, Bands); +end; + +procedure TcxBandedTableViewEditor.BDeleteBandClick(Sender: TObject); +begin + CollectionItemsDelete(LBBands, Bands); +end; + +procedure TcxBandedTableViewEditor.LBBandsClick(Sender: TObject); +begin + FormEditor.ListBoxApplySelection(LBBands, Bands); +end; + +procedure TcxBandedTableViewEditor.BBandMoveUpClick(Sender: TObject); +begin + ListBoxMoveUpItems(LBBands, FBandsPrevDragIndex, ReindexBandsProc); +end; + +procedure TcxBandedTableViewEditor.BBandMoveDownClick(Sender: TObject); +begin + ListBoxMoveDownItems(LBBands, FBandsPrevDragIndex, ReindexBandsProc); +end; + +procedure TcxBandedTableViewEditor.MIBandsSelectAllClick(Sender: TObject); +begin + SelectAllBands; + LBBandsClick(nil); +end; + +// Drag Drop Bands + +procedure TcxBandedTableViewEditor.LBBandsStartDrag(Sender: TObject; + var DragObject: TDragObject); +begin + FBandsPrevDragIndex := -1; +end; + +procedure TcxBandedTableViewEditor.LBBandsDragOver(Sender, Source: TObject; + X, Y: Integer; State: TDragState; var Accept: Boolean); +begin + ListBoxDragOver(LBBands, Sender, Source, X, Y, State, Accept, FBandsPrevDragIndex); +end; + +procedure TcxBandedTableViewEditor.LBBandsEndDrag(Sender, Target: TObject; + X, Y: Integer); +begin + ListBoxEndDrag(LBBands, Sender, Target, X, Y, FBandsPrevDragIndex); +end; + +procedure TcxBandedTableViewEditor.LBBandsDragDrop(Sender, Source: TObject; + X, Y: Integer); +begin + ListBoxDragDrop(LBBands, Sender, Source, X, Y, FBandsPrevDragIndex, ReindexBandsProc); +end; + +procedure TcxBandedTableViewEditor.FormCreate(Sender: TObject); +begin + inherited; + CalculateListBoxItemHeight(LBBands); +end; + +procedure TcxBandedTableViewEditor.LBBandsDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +begin + DrawListBoxItem(Control, Index, Rect, Bands[Index].ParentBand); +end; + +procedure TcxBandedTableViewEditor.LBColumnsDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +begin + DrawListBoxItem(Control, Index, Rect, TcxGridBandedColumn(View.Items[Index]).Position.Band); +end; + +{ TcxGridBandedTableViewMenuProvider } + +function TcxGridBandedTableViewMenuProvider.GetGridView: TcxGridBandedTableView; +begin + Result := TcxGridBandedTableView(inherited GridView); +end; + +procedure TcxGridBandedTableViewMenuProvider.CreateBand(Sender: TcxGridViewMenuItem); +begin + ObjectCreated(GridView.Bands.Add); +end; + +procedure TcxGridBandedTableViewMenuProvider.InitStructureCreationItems; +begin + inherited; + Items.AddItem('Create Band', CreateBand); +end; + +initialization + RegisterViewEditorClass(TcxGridBandedTableView, TcxBandedTableViewEditor); + RegisterDefaultViewStorage(TcxGridBandedTableViewStorage); + RegisterViewMenuProviderClass(TcxGridBandedTableView, TcxGridBandedTableViewMenuProvider); + +finalization + UnregisterViewMenuProviderClass(TcxGridBandedTableView, TcxGridBandedTableViewMenuProvider); + UnregisterDefaultViewStorage(TcxGridBandedTableViewStorage); + UnregisterViewEditorClass(TcxGridBandedTableView, TcxBandedTableViewEditor); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxCardViewEditor.dfm b/official/x.35/ExpressQuantumGrid 6/Sources/cxCardViewEditor.dfm new file mode 100644 index 00000000..8c648579 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxCardViewEditor.dfm @@ -0,0 +1,15 @@ +inherited cxCardViewEditor: TcxCardViewEditor + Caption = 'cxCardViewEditor' + PixelsPerInch = 96 + TextHeight = 13 + inherited PViewEditor: TPanel + inherited PageControl1: TcxPageControl + inherited TSItems: TcxTabSheet + Caption = ' Rows ' + end + inherited TSSummary: TcxTabSheet + TabVisible = False + end + end + end +end diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxCardViewEditor.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxCardViewEditor.pas new file mode 100644 index 00000000..c4368de0 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxCardViewEditor.pas @@ -0,0 +1,127 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxCardViewEditor; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, ComCtrls, ExtCtrls, Menus, StdCtrls, + cxViewEditor, cxCustomTableViewEditor, cxGridCustomView, cxGridCardView, + cxLookAndFeelPainters, cxButtons, cxPC, cxControls; + +type + TcxCardViewEditor = class(TcxCustomTableViewEditor); + + TcxGridCardViewStorage = class(TcxCustomGridViewStorage) + private + function GetLayoutDirection: TcxGridCardViewLayoutDirection; + function GetOptionsBehavior: TcxGridCardViewOptionsBehavior; + function GetOptionsData: TcxGridCardViewOptionsData; + function GetOptionsSelection: TcxGridCardViewOptionsSelection; + function GetOptionsView: TcxGridCardViewOptionsView; + procedure SetLayoutDirection(Value: TcxGridCardViewLayoutDirection); + protected + function CardView: TcxGridCardView; + public + class function GetViewClass: TcxCustomGridViewClass; override; + published + property LayoutDirection: TcxGridCardViewLayoutDirection read GetLayoutDirection write SetLayoutDirection; + property OptionsBehavior: TcxGridCardViewOptionsBehavior read GetOptionsBehavior; + property OptionsData: TcxGridCardViewOptionsData read GetOptionsData; + property OptionsSelection: TcxGridCardViewOptionsSelection read GetOptionsSelection; + property OptionsView: TcxGridCardViewOptionsView read GetOptionsView; + end; + +implementation + +{$R *.dfm} + +{ TcxGridCardViewStorage } + +function TcxGridCardViewStorage.GetLayoutDirection: TcxGridCardViewLayoutDirection; +begin + Result := CardView.LayoutDirection; +end; + +function TcxGridCardViewStorage.GetOptionsBehavior: TcxGridCardViewOptionsBehavior; +begin + Result := CardView.OptionsBehavior; +end; + +function TcxGridCardViewStorage.GetOptionsData: TcxGridCardViewOptionsData; +begin + Result := CardView.OptionsData; +end; + +function TcxGridCardViewStorage.GetOptionsSelection: TcxGridCardViewOptionsSelection; +begin + Result := CardView.OptionsSelection; +end; + +function TcxGridCardViewStorage.GetOptionsView: TcxGridCardViewOptionsView; +begin + Result := CardView.OptionsView; +end; + +procedure TcxGridCardViewStorage.SetLayoutDirection(Value: TcxGridCardViewLayoutDirection); +begin + CardView.LayoutDirection := Value; +end; + +function TcxGridCardViewStorage.CardView: TcxGridCardView; +begin + Result := inherited View as TcxGridCardView; +end; + +class function TcxGridCardViewStorage.GetViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridCardView; +end; + +initialization + RegisterViewEditorClass(TcxGridCardView, TcxCardViewEditor); + RegisterDefaultViewStorage(TcxGridCardViewStorage); + +finalization + UnregisterDefaultViewStorage(TcxGridCardViewStorage); + UnregisterViewEditorClass(TcxGridCardView, TcxCardViewEditor); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxChartViewEditor.dfm b/official/x.35/ExpressQuantumGrid 6/Sources/cxChartViewEditor.dfm new file mode 100644 index 00000000..dccf7e97 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxChartViewEditor.dfm @@ -0,0 +1,165 @@ +inherited cxChartViewEditor: TcxChartViewEditor + Left = 543 + Top = 157 + Caption = 'cxChartViewEditor' + ClientHeight = 291 + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + inherited PViewEditor: TPanel + Height = 291 + Constraints.MinHeight = 210 + Constraints.MinWidth = 200 + object tcMain: TcxTabControl + Left = 0 + Top = 0 + Width = 343 + Height = 291 + Align = alClient + TabOrder = 0 + Tabs.Strings = ( + ' Series ' + ' DataGroups ') + OnChange = tcMainChange + OnChanging = tcMainChanging + ClientRectBottom = 291 + ClientRectRight = 343 + ClientRectTop = 24 + object Panel1: TPanel + Left = 0 + Top = 24 + Width = 343 + Height = 267 + Align = alClient + BevelOuter = bvNone + BorderWidth = 8 + TabOrder = 0 + object Panel2: TPanel + Left = 217 + Top = 8 + Width = 118 + Height = 251 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object btnItemAdd: TcxButton + Left = 8 + Top = 0 + Width = 110 + Height = 24 + Caption = '&Add' + TabOrder = 0 + OnClick = btnItemAddClick + end + object btnItemDelete: TcxButton + Left = 8 + Top = 32 + Width = 110 + Height = 24 + Caption = 'Delete' + TabOrder = 1 + OnClick = btnItemDeleteClick + end + object btnItemMoveUp: TcxButton + Left = 8 + Top = 72 + Width = 110 + Height = 24 + Caption = 'Move &Up' + TabOrder = 2 + OnClick = btnItemMoveUpClick + end + object btnItemMoveDown: TcxButton + Left = 8 + Top = 104 + Width = 110 + Height = 24 + Caption = 'Move &Down' + TabOrder = 3 + OnClick = btnItemMoveDownClick + end + object btnItemSelectAll: TcxButton + Left = 8 + Top = 144 + Width = 110 + Height = 24 + Caption = 'Select All' + TabOrder = 4 + OnClick = btnItemSelectAllClick + end + end + object Panel9: TPanel + Left = 8 + Top = 8 + Width = 209 + Height = 251 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object lbItems: TListBox + Left = 1 + Top = 1 + Width = 207 + Height = 249 + Style = lbOwnerDrawFixed + Align = alClient + BorderStyle = bsNone + DragMode = dmAutomatic + ItemHeight = 13 + MultiSelect = True + PopupMenu = pmItems + TabOrder = 0 + OnClick = lbItemsClick + OnDragDrop = lbItemsDragDrop + OnDragOver = lbItemsDragOver + OnDrawItem = lbItemsDrawItem + OnEndDrag = lbItemsEndDrag + OnKeyPress = FormKeyPress + OnStartDrag = lbItemsStartDrag + end + end + end + end + end + object pmItems: TPopupMenu + Left = 140 + Top = 74 + object miItemAdd: TMenuItem + Caption = '&Add' + ShortCut = 45 + OnClick = btnItemAddClick + end + object miItemDelete: TMenuItem + Caption = '&Delete' + ShortCut = 46 + OnClick = btnItemDeleteClick + end + object N2: TMenuItem + Caption = '-' + end + object miItemMoveUp: TMenuItem + Caption = 'Move Up' + ShortCut = 16422 + OnClick = btnItemMoveUpClick + end + object miItemMoveDown: TMenuItem + Caption = 'Move Down' + ShortCut = 16424 + OnClick = btnItemMoveDownClick + end + object N1: TMenuItem + Caption = '-' + end + object miItemSelectAll: TMenuItem + Caption = '&Select All' + ShortCut = 16449 + OnClick = btnItemSelectAllClick + end + end + object pmItemsAdd: TPopupMenu + Left = 140 + Top = 112 + end +end diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxChartViewEditor.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxChartViewEditor.pas new file mode 100644 index 00000000..54ef60b7 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxChartViewEditor.pas @@ -0,0 +1,724 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxChartViewEditor; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, ExtCtrls, cxViewEditor, cxGridCustomView, cxGridChartView, ComCtrls, StdCtrls, + Menus, cxControls, cxPC, cxLookAndFeelPainters, cxButtons; + +type + TcxGridChartItemKind = (ciSeries, ciDataGroup); + TcxGridChartItemListBoxParams = array[TcxGridChartItemKind] of Integer; + + TcxChartViewEditor = class(TcxViewEditor) + pmItems: TPopupMenu; + miItemAdd: TMenuItem; + miItemDelete: TMenuItem; + N2: TMenuItem; + miItemMoveUp: TMenuItem; + miItemMoveDown: TMenuItem; + N1: TMenuItem; + miItemSelectAll: TMenuItem; + pmItemsAdd: TPopupMenu; + tcMain: TcxTabControl; + Panel1: TPanel; + lbItems: TListBox; + Panel2: TPanel; + btnItemAdd: TcxButton; + btnItemDelete: TcxButton; + btnItemMoveUp: TcxButton; + btnItemMoveDown: TcxButton; + btnItemSelectAll: TcxButton; + Panel9: TPanel; + procedure tcMainChanging(Sender: TObject; var AllowChange: Boolean); + procedure tcMainChange(Sender: TObject); + procedure lbItemsClick(Sender: TObject); + procedure btnItemAddClick(Sender: TObject); + procedure btnItemAddExClick(Sender: TObject); + procedure miItemAddExClick(Sender: TObject); + procedure btnItemDeleteClick(Sender: TObject); + procedure btnItemMoveUpClick(Sender: TObject); + procedure btnItemMoveDownClick(Sender: TObject); + procedure btnItemSelectAllClick(Sender: TObject); + procedure lbItemsStartDrag(Sender: TObject; var DragObject: TDragObject); + procedure lbItemsDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure lbItemsDragDrop(Sender, Source: TObject; X, Y: Integer); + procedure lbItemsEndDrag(Sender, Target: TObject; X, Y: Integer); + procedure lbItemsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure FormCreate(Sender: TObject); + private + FItemPrevDragIndex: Integer; + FListBoxItemIndex: TcxGridChartItemListBoxParams; + FListBoxTopIndex: TcxGridChartItemListBoxParams; + function GetItemClassValue: TcxGridChartItemClass; + function GetView: TcxGridChartView; + procedure ReindexItemsProc(AList: TList; ANewIndex: Integer); + protected + IsActiveTabChanging: Boolean; + + procedure Loaded; override; + + function GetItem(Index: Integer): TcxGridChartItem; virtual; + function GetItemClass(AItemKind: TcxGridChartItemKind): TcxGridChartItemClass; virtual; + function GetItemCount: Integer; virtual; + function GetItemKind: TcxGridChartItemKind; virtual; + function GetItemName: string; virtual; + procedure SetItemKind(Value: TcxGridChartItemKind); virtual; + + function AddItem: TcxGridChartItem; + procedure UpdateActiveTab; virtual; + procedure UpdateButtons; virtual; + procedure UpdateEditor; override; + procedure UpdateSelection; override; + procedure UpdateItemList; virtual; + + procedure RestoreListBoxParams; + procedure SaveListBoxParams; + + property ItemClass: TcxGridChartItemClass read GetItemClassValue; + property ItemCount: Integer read GetItemCount; + property ItemKind: TcxGridChartItemKind read GetItemKind write SetItemKind; + property ItemName: string read GetItemName; + property Items[Index: Integer]: TcxGridChartItem read GetItem; + public + class function GetViewByObject(APersistent: TPersistent): TcxCustomGridView; override; + property View: TcxGridChartView read GetView; + end; + + TcxGridChartViewStorage = class(TcxCustomGridViewStorage) + private + function GetDiagramArea: TcxGridChartAreaDiagram; + function GetDiagramBar: TcxGridChartBarDiagram; + function GetDiagramColumn: TcxGridChartColumnDiagram; + function GetDiagramLine: TcxGridChartLineDiagram; + function GetDiagramPie: TcxGridChartPieDiagram; + function GetLegend: TcxGridChartLegend; + function GetOptionsBehavior: TcxGridChartOptionsBehavior; + function GetOptionsCustomize: TcxGridChartOptionsCustomize; + function GetOptionsView: TcxGridChartOptionsView; + function GetTitle: TcxGridChartTitle; + function GetToolBox: TcxGridChartToolBox; + function GetView: TcxGridChartView; + protected + property View: TcxGridChartView read GetView; + public + class function GetViewClass: TcxCustomGridViewClass; override; + published + property DiagramArea: TcxGridChartAreaDiagram read GetDiagramArea; + property DiagramBar: TcxGridChartBarDiagram read GetDiagramBar; + property DiagramColumn: TcxGridChartColumnDiagram read GetDiagramColumn; + property DiagramLine: TcxGridChartLineDiagram read GetDiagramLine; + property DiagramPie: TcxGridChartPieDiagram read GetDiagramPie; + property Legend: TcxGridChartLegend read GetLegend; + property OptionsBehavior: TcxGridChartOptionsBehavior read GetOptionsBehavior; + property OptionsCustomize: TcxGridChartOptionsCustomize read GetOptionsCustomize; + property OptionsView: TcxGridChartOptionsView read GetOptionsView; + property Title: TcxGridChartTitle read GetTitle; + property ToolBox: TcxGridChartToolBox read GetToolBox; + end; + + TcxGridChartViewMenuProvider = class(TcxCustomGridViewMenuProvider) + private + function GetGridView: TcxGridChartView; + protected + procedure ActivateDiagram(Sender: TcxGridViewMenuItem); + procedure CreateDataGroup(Sender: TcxGridViewMenuItem); + procedure CreateSeries(Sender: TcxGridViewMenuItem); + procedure InitLayoutItems; override; + procedure InitStructureItems; override; + public + property GridView: TcxGridChartView read GetGridView; + end; + +implementation + +{$R *.dfm} + +uses + Math, cxClasses, cxCustomData, cxDesignWindows; + +const + AddButtonCaption = '&Add'; + AddExButtonCaption = '&Add...'; + +function GetChartItemName(AItemKind: TcxGridChartItemKind): string; +begin + case AItemKind of + ciSeries: + Result := 'Series'; + ciDataGroup: + Result := 'DataGroup'; + else + Result := ''; + end; +end; + +function CreateChartItem(AView: TcxGridChartView; AItemKind: TcxGridChartItemKind): TcxGridChartItem; +begin + AView.BeginUpdate; + try + case AItemKind of + ciSeries: + Result := AView.CreateSeries; + ciDataGroup: + Result := AView.CreateDataGroup; + else + Result := nil; + end; + Result.Name := GetViewItemUniqueName(AView, Result, GetChartItemName(AItemKind)); + finally + AView.EndUpdate; + end; +end; + +{ TcxChartViewEditor } + +function TcxChartViewEditor.GetItemClassValue: TcxGridChartItemClass; +begin + Result := GetItemClass(ItemKind); +end; + +function TcxChartViewEditor.GetView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited View); +end; + +procedure TcxChartViewEditor.ReindexItemsProc(AList: TList; ANewIndex: Integer); +var + I: Integer; +begin + if AList.Count = 0 then Exit; + for I := AList.Count - 1 downto 0 do + begin + if TcxGridChartItem(AList[I]).Index < ANewIndex then + Dec(ANewIndex); + TcxGridChartItem(AList[I]).Index := ANewIndex; + end; + UpdateDesigner; +end; + +procedure TcxChartViewEditor.Loaded; +begin + inherited; + tcMain.TabIndex := 0; // because it is deleted from DFM by SetupBuilder +end; + +function TcxChartViewEditor.GetItem(Index: Integer): TcxGridChartItem; +begin + case ItemKind of + ciSeries: + Result := View.Series[Index]; + ciDataGroup: + Result := View.DataGroups[Index]; + else + Result := nil; + end; +end; + +function TcxChartViewEditor.GetItemClass(AItemKind: TcxGridChartItemKind): TcxGridChartItemClass; +begin + case AItemKind of + ciSeries: + Result := View.GetSeriesClass; + ciDataGroup: + Result := View.GetDataGroupClass; + else + Result := nil; + end; +end; + +function TcxChartViewEditor.GetItemCount: Integer; +begin + case ItemKind of + ciSeries: + Result := View.SeriesCount; + ciDataGroup: + Result := View.DataGroupCount; + else + Result := 0; + end; +end; + +function TcxChartViewEditor.GetItemKind: TcxGridChartItemKind; +begin + Result := TcxGridChartItemKind(tcMain.TabIndex); +end; + +function TcxChartViewEditor.GetItemName: string; +begin + Result := GetChartItemName(ItemKind); +end; + +procedure TcxChartViewEditor.SetItemKind(Value: TcxGridChartItemKind); +begin + if IsActiveTabChanging then Exit; + if ItemKind <> Value then + begin + SaveListBoxParams; + tcMain.TabIndex := Ord(Value); + tcMainChange(nil); + end; +end; + +function TcxChartViewEditor.AddItem: TcxGridChartItem; +begin + Result := CreateChartItem(View, ItemKind); + SelectComponent(Result); + UpdateDesigner; +end; + +procedure TcxChartViewEditor.UpdateActiveTab; +var + AIsItemFoundInSelection: Boolean; + AItemKind, ASelectedItemKind: TcxGridChartItemKind; + AList: TList; + I: Integer; + AObject: TObject; +begin + AIsItemFoundInSelection := False; + ASelectedItemKind := Low(ASelectedItemKind); + AList := TList.Create; + try + GetSelectionList(AList); + for I := 0 to AList.Count - 1 do + begin + AObject := TObject(AList[I]); + if (AObject is TcxGridChartItem) and (TcxGridChartItem(AObject).GridView = View) then + for AItemKind := Low(AItemKind) to High(AItemKind) do + if AObject.ClassType = GetItemClass(AItemKind) then + if AIsItemFoundInSelection and (ASelectedItemKind <> AItemKind) then + Exit + else + begin + AIsItemFoundInSelection := True; + ASelectedItemKind := AItemKind; + Break; + end; + end; + finally + AList.Free; + end; + if AIsItemFoundInSelection then + ItemKind := ASelectedItemKind; +end; + +procedure TcxChartViewEditor.UpdateButtons; +begin + btnItemAdd.Enabled := CanAddComponent; + btnItemDelete.Enabled := CanDeleteComponent(nil) and (lbItems.SelCount > 0); + btnItemMoveUp.Enabled := lbItems.SelCount > 0; + btnItemMoveDown.Enabled := lbItems.SelCount > 0; + btnItemSelectAll.Enabled := lbItems.SelCount < lbItems.Items.Count; + + miItemAdd.Enabled := btnItemAdd.Enabled; + miItemDelete.Enabled := btnItemDelete.Enabled; + miItemMoveUp.Enabled := btnItemMoveUp.Enabled; + miItemMoveDown.Enabled := btnItemMoveDown.Enabled; + miItemSelectAll.Enabled := btnItemSelectAll.Enabled; + + if Supports(DataController, IcxGridChartViewItemsProvider) then + begin + btnItemAdd.Caption := AddExButtonCaption; + btnItemAdd.OnClick := btnItemAddExClick; + end + else + begin + btnItemAdd.Caption := AddButtonCaption; + btnItemAdd.OnClick := btnItemAddClick; + end; +end; + +procedure TcxChartViewEditor.UpdateEditor; +begin + inherited; + UpdateItemList; +end; + +procedure TcxChartViewEditor.UpdateSelection; +begin + inherited; + UpdateActiveTab; + FormEditor.ListBoxSynchronizeSelection(lbItems); + UpdateButtons; +end; + +procedure TcxChartViewEditor.UpdateItemList; +var + ASelection: TStringList; + AItemIndex, ATopIndex, I: Integer; + AItem: TcxGridChartItem; + S: string; +begin + ListBoxSaveSelection(lbItems, ASelection, AItemIndex, ATopIndex); + try + lbItems.Items.Clear; + for I := 0 to ItemCount - 1 do + begin + AItem := Items[I]; + S := AItem.Name + ' - "' + AItem.GetDisplayText + '"'; + lbItems.Items.AddObject(S, AItem); + end; + finally + ListBoxRestoreSelection(lbItems, ASelection, AItemIndex, ATopIndex); + end; +end; + +procedure TcxChartViewEditor.RestoreListBoxParams; +begin + lbItems.Items.BeginUpdate; + try + ListBoxRestorePos(lbItems, FListBoxItemIndex[ItemKind], FListBoxTopIndex[ItemKind]); + finally + lbItems.Items.EndUpdate; + RedrawWindow(lbItems.Handle, nil, 0, RDW_FRAME or RDW_INVALIDATE or RDW_UPDATENOW); // to fix the bug with scrollbar updating + end; +end; + +procedure TcxChartViewEditor.SaveListBoxParams; +begin + ListBoxSavePos(lbItems, FListBoxItemIndex[ItemKind], FListBoxTopIndex[ItemKind]); +end; + +class function TcxChartViewEditor.GetViewByObject(APersistent: TPersistent): TcxCustomGridView; +begin + if APersistent is TcxGridChartItem then + Result := TcxGridChartItem(APersistent).GridView + else + if APersistent is TcxGridChartDiagram then + Result := TcxGridChartDiagram(APersistent).GridView + else + Result := inherited GetViewByObject(APersistent); +end; + +procedure TcxChartViewEditor.lbItemsClick(Sender: TObject); +begin + FormEditor.ListBoxApplySelection(lbItems, View); +end; + +procedure TcxChartViewEditor.btnItemAddClick(Sender: TObject); +begin + AddItem; +end; + +procedure TcxChartViewEditor.btnItemAddExClick(Sender: TObject); + + procedure InitPopupMenu(APopupMenu: TPopupMenu; const AProvider: IcxGridChartViewItemsProvider); + var + I: Integer; + ACaptions: TStringList; + begin + APopupMenu.Items.Clear; + APopupMenu.Items.Add(CreateMenuItem(pmItems, 'Blank', miItemAddExClick)); + APopupMenu.Items.Add(CreateMenuItem(pmItems, '-')); + + ACaptions := TStringList.Create; + try + AProvider.GetItemCaptions(ItemClass, ACaptions); + for I := 0 to ACaptions.Count - 1 do + APopupMenu.Items.Add(CreateMenuItem(pmItems, ACaptions[I], miItemAddExClick, + True, I, AProvider.GetItem(ItemClass, I) <> nil)); + finally + ACaptions.Free; + end; + end; + + function GetPopupMenuPosition(AButton: TButton): TPoint; + begin + with AButton.BoundsRect do + Result := Point(Left, Bottom); + Result := AButton.Parent.ClientToScreen(Result); + end; + +begin + InitPopupMenu(pmItemsAdd, DataController as IcxGridChartViewItemsProvider); + with GetPopupMenuPosition(btnItemAdd) do + pmItemsAdd.Popup(X, Y); +end; + +procedure TcxChartViewEditor.miItemAddExClick(Sender: TObject); +var + AIndex: Integer; + AItem: TcxGridChartItem; +begin + AIndex := (Sender as TMenuItem).Tag; + if (AIndex = -1) or not (Sender as TMenuItem).Checked then + begin + View.BeginUpdate; + try + AItem := AddItem; + if AIndex <> -1 then + begin + (DataController as IcxGridChartViewItemsProvider).InitItem(AItem, AIndex); + UpdateDesigner; + end; + finally + View.EndUpdate; + end; + end + else + begin + SelectComponent(View); + (DataController as IcxGridChartViewItemsProvider).GetItem(ItemClass, AIndex).Free; + UpdateDesigner; + end; +end; + +procedure TcxChartViewEditor.btnItemDeleteClick(Sender: TObject); +begin + if lbItems.SelCount > 0 then + begin + BeginUpdate; + try + ListBoxDeleteSelection(lbItems, True); + FormEditor.ListBoxApplySelection(lbItems, View); + UpdateDesigner; + finally + EndUpdate; + end; + end; +end; + +procedure TcxChartViewEditor.btnItemMoveUpClick(Sender: TObject); +begin + FItemPrevDragIndex := -1; + ListBoxMoveItems(lbItems, Max(0, ListBoxGetFirstSelectedIndex(lbItems) - 1), + FItemPrevDragIndex, ReindexItemsProc); +end; + +procedure TcxChartViewEditor.btnItemMoveDownClick(Sender: TObject); +begin + FItemPrevDragIndex := -1; + ListBoxMoveItems(lbItems, Min(lbItems.Items.Count, ListBoxGetLastSelectedIndex(lbItems) + 2), + FItemPrevDragIndex, ReindexItemsProc); +end; + +procedure TcxChartViewEditor.btnItemSelectAllClick(Sender: TObject); +begin + ListBoxSelectAll(lbItems); + FormEditor.ListBoxApplySelection(lbItems, View); +end; + +procedure TcxChartViewEditor.lbItemsStartDrag(Sender: TObject; + var DragObject: TDragObject); +begin + FItemPrevDragIndex := -1; +end; + +procedure TcxChartViewEditor.lbItemsDragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); +begin + ListBoxDragOver(lbItems, Sender, Source, X, Y, State, Accept, FItemPrevDragIndex); +end; + +procedure TcxChartViewEditor.lbItemsDragDrop(Sender, Source: TObject; X, + Y: Integer); +begin + ListBoxDragDrop(lbItems, Sender, Source, X, Y, FItemPrevDragIndex, ReindexItemsProc); +end; + +procedure TcxChartViewEditor.lbItemsEndDrag(Sender, Target: TObject; X, + Y: Integer); +begin + ListBoxEndDrag(lbItems, Sender, Target, X, Y, FItemPrevDragIndex); +end; + +procedure TcxChartViewEditor.lbItemsDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +begin + with Control as TListBox, Canvas do + begin + FillRect(Rect); + TextOut(Rect.Left + 3, Rect.Top + 3, Items[Index]); + end; +end; + +procedure TcxChartViewEditor.FormCreate(Sender: TObject); +begin + inherited; + with lbItems do + begin + Canvas.Font := Font; + ItemHeight := 2 * 3 + Canvas.TextHeight('Qq'); + end; +end; + +procedure TcxChartViewEditor.tcMainChanging(Sender: TObject; var AllowChange: Boolean); +begin + SaveListBoxParams; +end; + +procedure TcxChartViewEditor.tcMainChange(Sender: TObject); +begin + IsActiveTabChanging := True; + try + UpdateItemList; + RestoreListBoxParams; + UpdateSelection; + finally + IsActiveTabChanging := False; + end; +end; + +{ TcxGridChartViewStorage } + +function TcxGridChartViewStorage.GetDiagramArea: TcxGridChartAreaDiagram; +begin + Result := View.DiagramArea; +end; + +function TcxGridChartViewStorage.GetDiagramBar: TcxGridChartBarDiagram; +begin + Result := View.DiagramBar; +end; + +function TcxGridChartViewStorage.GetDiagramColumn: TcxGridChartColumnDiagram; +begin + Result := View.DiagramColumn; +end; + +function TcxGridChartViewStorage.GetDiagramLine: TcxGridChartLineDiagram; +begin + Result := View.DiagramLine; +end; + +function TcxGridChartViewStorage.GetDiagramPie: TcxGridChartPieDiagram; +begin + Result := View.DiagramPie; +end; + +function TcxGridChartViewStorage.GetLegend: TcxGridChartLegend; +begin + Result := View.Legend; +end; + +function TcxGridChartViewStorage.GetOptionsBehavior: TcxGridChartOptionsBehavior; +begin + Result := View.OptionsBehavior; +end; + +function TcxGridChartViewStorage.GetOptionsCustomize: TcxGridChartOptionsCustomize; +begin + Result := View.OptionsCustomize; +end; + +function TcxGridChartViewStorage.GetOptionsView: TcxGridChartOptionsView; +begin + Result := View.OptionsView; +end; + +function TcxGridChartViewStorage.GetTitle: TcxGridChartTitle; +begin + Result := View.Title; +end; + +function TcxGridChartViewStorage.GetToolBox: TcxGridChartToolBox; +begin + Result := View.ToolBox; +end; + +function TcxGridChartViewStorage.GetView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited View); +end; + +class function TcxGridChartViewStorage.GetViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridChartView; +end; + +{ TcxGridChartViewMenuProvider } + +function TcxGridChartViewMenuProvider.GetGridView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +procedure TcxGridChartViewMenuProvider.ActivateDiagram(Sender: TcxGridViewMenuItem); +var + ADiagram: TcxGridChartDiagram; +begin + ADiagram := GridView.FindDiagramByDisplayText(Sender.Caption); + if not ADiagram.Active then + begin + ADiagram.Active := True; + DesignerModified; + end; + SelectObject(ADiagram); +end; + +procedure TcxGridChartViewMenuProvider.CreateDataGroup(Sender: TcxGridViewMenuItem); +begin + ObjectCreated(CreateChartItem(GridView, ciDataGroup)); +end; + +procedure TcxGridChartViewMenuProvider.CreateSeries(Sender: TcxGridViewMenuItem); +begin + ObjectCreated(CreateChartItem(GridView, ciSeries)); +end; + +procedure TcxGridChartViewMenuProvider.InitLayoutItems; +var + I: Integer; +begin + inherited; + for I := 0 to GridView.DiagramCount - 1 do + Items.AddItem(GridView.Diagrams[I].DisplayText, ActivateDiagram, True, + GridView.Diagrams[I].Active); +end; + +procedure TcxGridChartViewMenuProvider.InitStructureItems; +begin + Items.AddItem('Create Series', CreateSeries, CanAddComponent(GridView.Owner)); + Items.AddItem('Create DataGroup', CreateDataGroup, CanAddComponent(GridView.Owner)); + Items.AddSeparator; + inherited; +end; + +initialization + RegisterViewEditorClass(TcxGridChartView, TcxChartViewEditor); + RegisterDefaultViewStorage(TcxGridChartViewStorage); + RegisterViewMenuProviderClass(TcxGridChartView, TcxGridChartViewMenuProvider); + +finalization + UnregisterViewMenuProviderClass(TcxGridChartView, TcxGridChartViewMenuProvider); + UnregisterDefaultViewStorage(TcxGridChartViewStorage); + UnregisterViewEditorClass(TcxGridChartView, TcxChartViewEditor); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxCustomTableViewEditor.dfm b/official/x.35/ExpressQuantumGrid 6/Sources/cxCustomTableViewEditor.dfm new file mode 100644 index 00000000..fc545584 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxCustomTableViewEditor.dfm @@ -0,0 +1,766 @@ +inherited cxCustomTableViewEditor: TcxCustomTableViewEditor + Left = 556 + Top = 316 + ActiveControl = PageControl1 + Caption = 'cxCustomTableViewEditor' + ClientHeight = 319 + ClientWidth = 344 + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + inherited PViewEditor: TPanel + Width = 344 + Height = 319 + Constraints.MinHeight = 282 + Constraints.MinWidth = 344 + object PageControl1: TcxPageControl + Left = 0 + Top = 0 + Width = 344 + Height = 319 + ActivePage = TSItems + Align = alClient + TabOrder = 0 + ClientRectBottom = 319 + ClientRectRight = 344 + ClientRectTop = 24 + object TSItems: TcxTabSheet + BorderWidth = 8 + object Panel1: TPanel + Left = 200 + Top = 0 + Width = 128 + Height = 279 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object BColumnAdd: TcxButton + Left = 8 + Top = 0 + Width = 120 + Height = 24 + Caption = '&Add' + TabOrder = 0 + OnClick = BColumnAddClick + end + object BColumnDelete: TcxButton + Left = 8 + Top = 32 + Width = 120 + Height = 24 + Caption = 'Delete' + TabOrder = 1 + OnClick = BColumnDeleteClick + end + object BColumnAddAll: TcxButton + Left = 8 + Top = 176 + Width = 120 + Height = 24 + Caption = 'Retrieve &Fields' + TabOrder = 5 + Visible = False + OnClick = BColumnAddAllClick + end + object BColumnRestore: TcxButton + Left = 8 + Top = 64 + Width = 120 + Height = 24 + Caption = '&Restore Defaults' + TabOrder = 2 + OnClick = BColumnRestoreClick + end + object BColumnMoveUp: TcxButton + Left = 8 + Top = 104 + Width = 120 + Height = 24 + Caption = 'Move &Up' + TabOrder = 3 + OnClick = BColumnMoveUpClick + end + object BColumnMoveDown: TcxButton + Left = 8 + Top = 136 + Width = 120 + Height = 24 + Caption = 'Move &Down' + TabOrder = 4 + OnClick = BColumnMoveDownClick + end + object BColumnAddMissing: TcxButton + Left = 8 + Top = 208 + Width = 120 + Height = 24 + Caption = 'Retrieve &Missing Fields' + TabOrder = 6 + Visible = False + OnClick = BColumnAddMissingClick + end + end + object Panel8: TPanel + Left = 0 + Top = 0 + Width = 200 + Height = 279 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object LBColumns: TListBox + Left = 1 + Top = 1 + Width = 198 + Height = 277 + Style = lbOwnerDrawFixed + Align = alClient + BorderStyle = bsNone + DragMode = dmAutomatic + ItemHeight = 13 + MultiSelect = True + PopupMenu = PMColumns + TabOrder = 0 + OnClick = LBColumnsClick + OnDragDrop = LBColumnsDragDrop + OnDragOver = LBColumnsDragOver + OnDrawItem = LBColumnsDrawItem + OnEndDrag = LBColumnsEndDrag + OnKeyPress = FormKeyPress + OnStartDrag = LBColumnsStartDrag + end + end + end + object TSSummary: TcxTabSheet + BorderWidth = 8 + Caption = ' Summary ' + ImageIndex = 1 + object PageControl2: TcxPageControl + Left = 0 + Top = 0 + Width = 328 + Height = 279 + ActivePage = TSFooterSummaryItems + Align = alClient + TabOrder = 0 + ClientRectBottom = 279 + ClientRectRight = 328 + ClientRectTop = 24 + object TSFooterSummaryItems: TcxTabSheet + Caption = ' Footer ' + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 185 + Height = 255 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object Panel3: TPanel + Left = 0 + Top = 220 + Width = 185 + Height = 35 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object BAddFooterSummaryItem: TcxButton + Left = 13 + Top = 8 + Width = 75 + Height = 24 + Caption = '&Add' + TabOrder = 0 + OnClick = BAddFooterSummaryItemClick + end + object BDeleteFooterSummaryItem: TcxButton + Left = 97 + Top = 8 + Width = 75 + Height = 24 + Caption = '&Delete' + TabOrder = 1 + OnClick = BDeleteFooterSummaryItemClick + end + end + object Panel4: TPanel + Left = 0 + Top = 0 + Width = 185 + Height = 20 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Label1: TLabel + Left = 4 + Top = 4 + Width = 28 + Height = 13 + Caption = 'Items:' + end + end + object Panel9: TPanel + Left = 0 + Top = 20 + Width = 185 + Height = 200 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object LBFooterSummary: TListBox + Left = 1 + Top = 1 + Width = 183 + Height = 198 + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + PopupMenu = PMFooterSummary + TabOrder = 0 + OnClick = LBFooterSummaryClick + OnKeyPress = FormKeyPress + end + end + end + end + object TSDefaultGroupSummaryItems: TcxTabSheet + Caption = ' Default For Groups ' + ImageIndex = 1 + object Panel5: TPanel + Left = 0 + Top = 0 + Width = 185 + Height = 255 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object Panel6: TPanel + Left = 0 + Top = 220 + Width = 185 + Height = 35 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object BDefaultGroupSummaryAdd: TcxButton + Left = 13 + Top = 8 + Width = 75 + Height = 24 + Caption = '&Add' + TabOrder = 0 + OnClick = BDefaultGroupSummaryAddClick + end + object BDefaultGroupSummaryDelete: TcxButton + Left = 97 + Top = 8 + Width = 75 + Height = 24 + Caption = '&Delete' + TabOrder = 1 + OnClick = BDefaultGroupSummaryDeleteClick + end + end + object Panel7: TPanel + Left = 0 + Top = 0 + Width = 185 + Height = 20 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Label2: TLabel + Left = 4 + Top = 4 + Width = 28 + Height = 13 + Caption = 'Items:' + end + end + object Panel10: TPanel + Left = 0 + Top = 20 + Width = 185 + Height = 200 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object LBDefaultGroupsSummary: TListBox + Left = 1 + Top = 1 + Width = 183 + Height = 198 + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + PopupMenu = PMDefaultGroupsSummary + TabOrder = 0 + OnClick = LBDefaultGroupsSummaryClick + OnKeyPress = FormKeyPress + end + end + end + end + object TabSheet3: TcxTabSheet + Caption = ' Groups ' + ImageIndex = 2 + object Splitter2: TSplitter + Left = 0 + Top = 137 + Width = 328 + Height = 5 + Cursor = crVSplit + Align = alBottom + Beveled = True + end + object PSummaryGroups: TPanel + Left = 0 + Top = 0 + Width = 328 + Height = 137 + Align = alClient + BevelOuter = bvNone + Constraints.MinHeight = 100 + TabOrder = 0 + OnResize = PSummaryGroupsResize + object PGroupItems: TPanel + Left = 166 + Top = 0 + Width = 162 + Height = 137 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + object Panel11: TPanel + Left = 0 + Top = 103 + Width = 162 + Height = 34 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object BGroupSummaryItemAdd: TcxButton + Left = 4 + Top = 6 + Width = 75 + Height = 24 + Caption = '&Add' + TabOrder = 0 + OnClick = BGroupSummaryItemAddClick + end + object BGroupSummaryItemDelete: TcxButton + Left = 83 + Top = 6 + Width = 75 + Height = 24 + Caption = '&Delete' + TabOrder = 1 + OnClick = BGroupSummaryItemDeleteClick + end + end + object Panel12: TPanel + Left = 0 + Top = 0 + Width = 162 + Height = 20 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Label4: TLabel + Left = 4 + Top = 4 + Width = 28 + Height = 13 + Caption = 'Items:' + end + end + object Panel16: TPanel + Left = 0 + Top = 20 + Width = 162 + Height = 83 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object LBGroupSummaryItems: TListBox + Left = 1 + Top = 1 + Width = 160 + Height = 81 + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + PopupMenu = PMGroupSummaryItems + TabOrder = 0 + OnClick = LBGroupSummaryItemsClick + OnKeyPress = FormKeyPress + end + end + end + object PGroups: TPanel + Left = 0 + Top = 0 + Width = 162 + Height = 137 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object Panel14: TPanel + Left = 0 + Top = 103 + Width = 162 + Height = 34 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object BSummaryGroupAdd: TcxButton + Left = 4 + Top = 6 + Width = 75 + Height = 24 + Caption = '&Add' + TabOrder = 0 + OnClick = BSummaryGroupAddClick + end + object BSummaryGroupDelete: TcxButton + Left = 83 + Top = 6 + Width = 75 + Height = 24 + Caption = '&Delete' + TabOrder = 1 + OnClick = BSummaryGroupDeleteClick + end + end + object Panel15: TPanel + Left = 0 + Top = 0 + Width = 162 + Height = 20 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Label5: TLabel + Left = 4 + Top = 4 + Width = 37 + Height = 13 + Caption = 'Groups:' + end + end + object Panel13: TPanel + Left = 0 + Top = 20 + Width = 162 + Height = 83 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object LBSummaryGroups: TListBox + Left = 1 + Top = 1 + Width = 160 + Height = 81 + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + PopupMenu = PMSummaryGroups + TabOrder = 0 + OnClick = LBSummaryGroupsClick + OnKeyPress = FormKeyPress + end + end + end + object PGSeparator: TPanel + Left = 162 + Top = 0 + Width = 4 + Height = 137 + Align = alLeft + BevelOuter = bvNone + TabOrder = 2 + end + end + object PLinks: TPanel + Left = 0 + Top = 142 + Width = 328 + Height = 113 + Align = alBottom + BevelOuter = bvNone + Constraints.MinHeight = 100 + TabOrder = 1 + OnResize = PLinksResize + object PUnlinkedColumns: TPanel + Left = 0 + Top = 0 + Width = 147 + Height = 113 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object Panel19: TPanel + Left = 0 + Top = 0 + Width = 147 + Height = 20 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Label6: TLabel + Left = 4 + Top = 4 + Width = 88 + Height = 13 + Caption = 'Unlinked Columns:' + end + end + object Panel17: TPanel + Left = 0 + Top = 20 + Width = 147 + Height = 93 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 1 + object LBUnlinkedColumns: TListBox + Left = 1 + Top = 1 + Width = 145 + Height = 91 + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + TabOrder = 0 + OnClick = LBUnlinkedColumnsClick + OnKeyPress = FormKeyPress + end + end + end + object PLinkUnlink: TPanel + Left = 147 + Top = 0 + Width = 35 + Height = 113 + Align = alLeft + BevelOuter = bvNone + TabOrder = 1 + object BColumnLink: TcxButton + Left = 5 + Top = 34 + Width = 25 + Height = 25 + Caption = '>' + TabOrder = 0 + OnClick = BColumnLinkClick + end + object BColumnUnlink: TcxButton + Left = 5 + Top = 68 + Width = 25 + Height = 25 + Caption = '<' + TabOrder = 1 + OnClick = BColumnUnlinkClick + end + end + object PLinkedColumns: TPanel + Left = 182 + Top = 0 + Width = 146 + Height = 113 + Align = alClient + BevelOuter = bvNone + TabOrder = 2 + object Panel23: TPanel + Left = 0 + Top = 0 + Width = 146 + Height = 20 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Label7: TLabel + Left = 4 + Top = 4 + Width = 78 + Height = 13 + Caption = 'Linked Columns:' + end + end + object Panel18: TPanel + Left = 0 + Top = 20 + Width = 146 + Height = 93 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 1 + object LBLinkedColumns: TListBox + Left = 1 + Top = 1 + Width = 144 + Height = 91 + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + TabOrder = 0 + OnClick = LBUnlinkedColumnsClick + OnKeyPress = FormKeyPress + end + end + end + end + end + end + end + end + end + object PMColumns: TPopupMenu + Left = 228 + Top = 6 + object MIColumnAdd: TMenuItem + Caption = '&Add' + ShortCut = 45 + OnClick = BColumnAddClick + end + object MIColumnDelete: TMenuItem + Caption = '&Delete' + ShortCut = 46 + OnClick = BColumnDeleteClick + end + object MIColumnRestore: TMenuItem + Caption = 'Rest&ore Defaults' + OnClick = BColumnRestoreClick + end + object N2: TMenuItem + Caption = '-' + end + object MIColumnMoveUp: TMenuItem + Caption = 'Move Up' + ShortCut = 16422 + OnClick = BColumnMoveUpClick + end + object MIColumnMoveDown: TMenuItem + Caption = 'Move Down' + ShortCut = 16424 + OnClick = BColumnMoveDownClick + end + object N1: TMenuItem + Caption = '-' + end + object MIColumnSelectAll: TMenuItem + Caption = '&Select All' + ShortCut = 16449 + OnClick = MIColumnSelectAllClick + end + end + object PMFooterSummary: TPopupMenu + Left = 230 + Top = 90 + object MIFooterSummaryAdd: TMenuItem + Caption = '&Add' + ShortCut = 45 + OnClick = BAddFooterSummaryItemClick + end + object MIFooterSummaryDelete: TMenuItem + Caption = '&Delete' + ShortCut = 46 + OnClick = BDeleteFooterSummaryItemClick + end + object MenuItem4a: TMenuItem + Caption = '-' + end + object MIFooterSummarySelectAll: TMenuItem + Caption = '&Select All' + ShortCut = 16449 + OnClick = MIFooterSummarySelectAllClick + end + end + object PMDefaultGroupsSummary: TPopupMenu + Left = 230 + Top = 130 + object MIDefaultGroupSummaryAdd: TMenuItem + Caption = '&Add' + ShortCut = 45 + OnClick = BDefaultGroupSummaryAddClick + end + object MIDefaultGroupSummaryDelete: TMenuItem + Caption = '&Delete' + ShortCut = 46 + OnClick = BDefaultGroupSummaryDeleteClick + end + object MenuItem3b: TMenuItem + Caption = '-' + end + object MIDefaultGroupSummarySelectAll: TMenuItem + Caption = '&Select All' + ShortCut = 16449 + OnClick = MIDefaultGroupSummarySelectAllClick + end + end + object PMSummaryGroups: TPopupMenu + Left = 230 + Top = 170 + object MISummaryGroupAdd: TMenuItem + Caption = '&Add' + ShortCut = 45 + OnClick = BSummaryGroupAddClick + end + object MISummaryGroupDelete: TMenuItem + Caption = '&Delete' + ShortCut = 46 + OnClick = BSummaryGroupDeleteClick + end + object MenuItem5d: TMenuItem + Caption = '-' + end + object MISummaryGroupSelectAll: TMenuItem + Caption = '&Select All' + ShortCut = 16449 + OnClick = MISummaryGroupSelectAllClick + end + end + object PMGroupSummaryItems: TPopupMenu + Left = 230 + Top = 210 + object MIGroupSummaryItemsAdd: TMenuItem + Caption = '&Add' + ShortCut = 45 + OnClick = BGroupSummaryItemAddClick + end + object MIGroupSummaryItemsDelete: TMenuItem + Caption = '&Delete' + ShortCut = 46 + OnClick = BGroupSummaryItemDeleteClick + end + object MenuItem6c: TMenuItem + Caption = '-' + end + object MIGroupSummaryItemsSelectAll: TMenuItem + Caption = '&Select All' + ShortCut = 16449 + OnClick = MIGroupSummaryItemsSelectAllClick + end + end +end diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxCustomTableViewEditor.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxCustomTableViewEditor.pas new file mode 100644 index 00000000..f1b6d448 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxCustomTableViewEditor.pas @@ -0,0 +1,1117 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxCustomTableViewEditor; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, ExtCtrls, StdCtrls, ComCtrls, Menus, + cxClasses, cxCustomData, cxDBData, cxNavigator, cxGridCustomView, cxGridCustomTableView, + cxGridStructureNavigator, cxViewEditor, cxLookAndFeelPainters, cxButtons, + cxPC, cxControls; + +type + TcxCustomTableViewEditor = class(TcxViewEditor) + PageControl1: TcxPageControl; + TSItems: TcxTabSheet; + TSSummary: TcxTabSheet; + Panel1: TPanel; + BColumnAdd: TcxButton; + BColumnDelete: TcxButton; + BColumnAddAll: TcxButton; + BColumnRestore: TcxButton; + PMColumns: TPopupMenu; + MIColumnAdd: TMenuItem; + MIColumnDelete: TMenuItem; + MIColumnRestore: TMenuItem; + MIColumnSelectAll: TMenuItem; + PageControl2: TcxPageControl; + TSFooterSummaryItems: TcxTabSheet; + TSDefaultGroupSummaryItems: TcxTabSheet; + TabSheet3: TcxTabSheet; + Panel2: TPanel; + Panel3: TPanel; + BAddFooterSummaryItem: TcxButton; + BDeleteFooterSummaryItem: TcxButton; + LBFooterSummary: TListBox; + Panel4: TPanel; + Label1: TLabel; + Panel5: TPanel; + Panel6: TPanel; + BDefaultGroupSummaryAdd: TcxButton; + BDefaultGroupSummaryDelete: TcxButton; + LBDefaultGroupsSummary: TListBox; + Panel7: TPanel; + Label2: TLabel; + PSummaryGroups: TPanel; + PLinks: TPanel; + PGroupItems: TPanel; + Panel11: TPanel; + BGroupSummaryItemAdd: TcxButton; + BGroupSummaryItemDelete: TcxButton; + LBGroupSummaryItems: TListBox; + Panel12: TPanel; + Label4: TLabel; + PGroups: TPanel; + Panel14: TPanel; + BSummaryGroupAdd: TcxButton; + BSummaryGroupDelete: TcxButton; + LBSummaryGroups: TListBox; + Panel15: TPanel; + Label5: TLabel; + PUnlinkedColumns: TPanel; + LBUnlinkedColumns: TListBox; + Panel19: TPanel; + Label6: TLabel; + PLinkUnlink: TPanel; + PLinkedColumns: TPanel; + LBLinkedColumns: TListBox; + Panel23: TPanel; + Label7: TLabel; + BColumnLink: TcxButton; + BColumnUnlink: TcxButton; + Splitter2: TSplitter; + PGSeparator: TPanel; + N1: TMenuItem; + BColumnMoveUp: TcxButton; + BColumnMoveDown: TcxButton; + N2: TMenuItem; + MIColumnMoveUp: TMenuItem; + MIColumnMoveDown: TMenuItem; + PMFooterSummary: TPopupMenu; + MIFooterSummaryAdd: TMenuItem; + MIFooterSummaryDelete: TMenuItem; + MenuItem4a: TMenuItem; + MIFooterSummarySelectAll: TMenuItem; + PMDefaultGroupsSummary: TPopupMenu; + MIDefaultGroupSummaryAdd: TMenuItem; + MIDefaultGroupSummaryDelete: TMenuItem; + MenuItem3b: TMenuItem; + MIDefaultGroupSummarySelectAll: TMenuItem; + PMSummaryGroups: TPopupMenu; + MISummaryGroupAdd: TMenuItem; + MISummaryGroupDelete: TMenuItem; + MenuItem5d: TMenuItem; + MISummaryGroupSelectAll: TMenuItem; + PMGroupSummaryItems: TPopupMenu; + MIGroupSummaryItemsAdd: TMenuItem; + MIGroupSummaryItemsDelete: TMenuItem; + MenuItem6c: TMenuItem; + MIGroupSummaryItemsSelectAll: TMenuItem; + Panel8: TPanel; + LBColumns: TListBox; + Panel9: TPanel; + Panel10: TPanel; + Panel13: TPanel; + Panel16: TPanel; + Panel17: TPanel; + Panel18: TPanel; + BColumnAddMissing: TcxButton; + procedure LBColumnsClick(Sender: TObject); + procedure BColumnAddClick(Sender: TObject); + procedure BColumnDeleteClick(Sender: TObject); + procedure BColumnRestoreClick(Sender: TObject); + procedure MIColumnSelectAllClick(Sender: TObject); + procedure LBFooterSummaryClick(Sender: TObject); + procedure BAddFooterSummaryItemClick(Sender: TObject); + procedure BDeleteFooterSummaryItemClick(Sender: TObject); + procedure LBDefaultGroupsSummaryClick(Sender: TObject); + procedure BDefaultGroupSummaryAddClick(Sender: TObject); + procedure BDefaultGroupSummaryDeleteClick(Sender: TObject); + procedure LBSummaryGroupsClick(Sender: TObject); + procedure BSummaryGroupAddClick(Sender: TObject); + procedure BSummaryGroupDeleteClick(Sender: TObject); + procedure LBGroupSummaryItemsClick(Sender: TObject); + procedure BGroupSummaryItemAddClick(Sender: TObject); + procedure BGroupSummaryItemDeleteClick(Sender: TObject); + procedure LBUnlinkedColumnsClick(Sender: TObject); + procedure BColumnLinkClick(Sender: TObject); + procedure BColumnUnlinkClick(Sender: TObject); + procedure BColumnAddAllClick(Sender: TObject); + procedure PLinksResize(Sender: TObject); + procedure PSummaryGroupsResize(Sender: TObject); + procedure LBColumnsDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure LBColumnsEndDrag(Sender, Target: TObject; X, Y: Integer); + procedure LBColumnsStartDrag(Sender: TObject; + var DragObject: TDragObject); + procedure LBColumnsDragDrop(Sender, Source: TObject; X, Y: Integer); + procedure BColumnMoveUpClick(Sender: TObject); + procedure BColumnMoveDownClick(Sender: TObject); + procedure MIFooterSummarySelectAllClick(Sender: TObject); + procedure MIDefaultGroupSummarySelectAllClick(Sender: TObject); + procedure MISummaryGroupSelectAllClick(Sender: TObject); + procedure MIGroupSummaryItemsSelectAllClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure LBColumnsDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure BColumnAddMissingClick(Sender: TObject); + private + FColumnsPrevDragIndex: Integer; + FSummaryGroup: TcxDataSummaryGroup; + function GetDefaultGroupSummaryItems: TcxDataGroupSummaryItems; + function GetFooterSummaryItems: TcxDataFooterSummaryItems; + function GetSummaryGroups: TcxDataSummaryGroups; + function GetView: TcxCustomGridTableView; + procedure SetSummaryGroup(Value: TcxDataSummaryGroup); + + procedure ReindexColumnsProc(AList: TList; ANewIndex: Integer); + procedure UpdateSummaryGroupLinks; + procedure UpdateSummaryGroups; + protected + procedure CalculateListBoxItemHeight(AListBox: TListBox); + procedure CollectionItemsAdd(AListBox: TListBox; ACollection: TCollection); + procedure CollectionItemsDelete(AListBox: TListBox; ACollection: TCollection); + procedure DoCreateViewItems(AMissingItemsOnly: Boolean); + procedure DrawListBoxItem(AListBox: TWinControl; AIndex: Integer; R: TRect); + function GetCurrentGroup: TcxDataSummaryGroup; + function GetDeleteItemsCaption: string; virtual; + procedure SelectAllColumns; + procedure UpdateButtons; virtual; + procedure UpdateColumnList; virtual; + procedure UpdateEditor; override; + procedure UpdateSelection; override; + procedure UpdateSummary; + procedure UpdateSummarySelection; + property SummaryGroup: TcxDataSummaryGroup read FSummaryGroup write SetSummaryGroup; + public + class function GetViewByObject(APersistent: TPersistent): TcxCustomGridView; override; + property DefaultGroupSummaryItems: TcxDataGroupSummaryItems read GetDefaultGroupSummaryItems; + property FooterSummaryItems: TcxDataFooterSummaryItems read GetFooterSummaryItems; + property SummaryGroups: TcxDataSummaryGroups read GetSummaryGroups; + property View: TcxCustomGridTableView read GetView; + end; + + { TcxCustomGridTableViewStorage } + + TcxCustomGridTableViewStorage = class(TcxCustomGridViewStorage) + private + function GetNavigatorButtons: TcxNavigatorControlButtons; + protected + function CustomTableView: TcxCustomGridTableView; + public + class function GetViewClass: TcxCustomGridViewClass; override; + published + property NavigatorButtons: TcxNavigatorControlButtons read GetNavigatorButtons; + end; + + { TcxCustomGridViewMenuProvider } + + TcxCustomGridTableViewMenuProvider = class(TcxCustomGridViewMenuProvider) + private + function GetGridView: TcxCustomGridTableView; + function GetViewItemNameValue: string; + protected + function CanDeleteItems: Boolean; + procedure CreateAllItems(Sender: TcxGridViewMenuItem); + procedure CreateItem(Sender: TcxGridViewMenuItem); + procedure CreateMissingItems(Sender: TcxGridViewMenuItem); + procedure DeleteAllItems(Sender: TcxGridViewMenuItem); + procedure InitStructureCreationItems; virtual; + procedure InitStructureItems; override; + property ViewItemName: string read GetViewItemNameValue; + public + property GridView: TcxCustomGridTableView read GetGridView; + end; + +implementation + +uses + cxDesignWindows; + +{$R *.dfm} + +function CheckInDataController(APersistent: TPersistent): TcxCustomGridView; +var + ADataController: TcxCustomDataController; + AIDataController: IcxCustomGridDataController; +begin + ADataController := nil; + if APersistent is TcxCustomDataSummaryItem then + ADataController := (APersistent as TcxCustomDataSummaryItem).DataController + else + if APersistent is TcxDataSummaryItems then + ADataController := (APersistent as TcxDataSummaryItems).DataController + else + if APersistent is TcxDataSummaryGroups then + ADataController := (APersistent as TcxDataSummaryGroups).Summary.DataController + else + if APersistent is TcxDataSummaryGroup then + ADataController := (APersistent as TcxDataSummaryGroup).SummaryGroups.Summary.DataController + else + if APersistent is TcxDataSummaryGroupItemLinks then + ADataController := + (APersistent as TcxDataSummaryGroupItemLinks).SummaryGroup.SummaryGroups.Summary.DataController; + if (ADataController <> nil) and Supports(ADataController, IcxCustomGridDataController) then + begin + Supports(TObject(ADataController), IcxCustomGridDataController, AIDataController); + Result := AIDataController.GridView; + end + else + Result := nil; +end; + +function GetViewItemName(AView: TcxCustomGridTableView): string; +var + I: Integer; +begin + Result := TcxCustomGridTableViewAccess.GetItemClass(AView).ClassName; + for I := Length(Result) downto 1 do + if Result[I] in ['A'..'Z'] then + begin + Delete(Result, 1, I - 1); + Break; + end; +end; + +function CreateViewItem(AView: TcxCustomGridTableView): TcxCustomGridTableItem; +begin + Result := AView.CreateItem; + Result.Name := GetViewItemUniqueName(AView, Result, GetViewItemName(AView)); +end; + +procedure CreateViewItems(AView: TcxCustomGridView; AMissingItemsOnly: Boolean); +begin + (AView.DataController as IcxCustomGridDataController).CreateAllItems(AMissingItemsOnly); +end; + +{ TcxCustomGridTableViewStorage } + +function TcxCustomGridTableViewStorage.GetNavigatorButtons: TcxNavigatorControlButtons; +begin + Result := CustomTableView.NavigatorButtons; +end; + +function TcxCustomGridTableViewStorage.CustomTableView: TcxCustomGridTableView; +begin + Result := inherited View as TcxCustomGridTableView; +end; + +class function TcxCustomGridTableViewStorage.GetViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridTableView; +end; + +{ TcxCustomTableViewEditor } + +class function TcxCustomTableViewEditor.GetViewByObject(APersistent: TPersistent): TcxCustomGridView; +begin + // Items + if APersistent is TcxCustomGridTableItem then + Result := (APersistent as TcxCustomGridTableItem).GridView + else + // DataController + Result := CheckInDataController(APersistent); +end; + +procedure TcxCustomTableViewEditor.CalculateListBoxItemHeight(AListBox: TListBox); +begin + with AListBox do + begin + Canvas.Font := Font; + ItemHeight := 2 + Canvas.TextHeight('Qq'); + end; +end; + +procedure TcxCustomTableViewEditor.CollectionItemsAdd(AListBox: TListBox; + ACollection: TCollection); +var + AItem: TCollectionItem; +begin + ListBoxClearSelection(AListBox); + AItem := ACollection.Add; + ListBoxLoadCollection(AListBox, ACollection); + ListBoxSelectByObject(AListBox, AItem); + FormEditor.ListBoxApplySelection(AListBox, nil); + UpdateDesigner; +end; + +procedure TcxCustomTableViewEditor.CollectionItemsDelete(AListBox: TListBox; + ACollection: TCollection); +begin + if AListBox.SelCount > 0 then + begin + BeginUpdate; + try + View.BeginUpdate; + try + ListBoxDeleteSelection(AListBox, True); + ListBoxLoadCollection(AListBox, ACollection); + finally + View.EndUpdate; + end; + FormEditor.ListBoxApplySelection(AListBox, ACollection); + UpdateDesigner; + finally + EndUpdate; + end; + end; +end; + +procedure TcxCustomTableViewEditor.DoCreateViewItems(AMissingItemsOnly: Boolean); + + procedure GetViewItems(AItems: TList); + var + I: Integer; + begin + for I := 0 to View.ItemCount - 1 do + AItems.Add(View.Items[I]); + end; + + procedure GetViewNewItems(AOldItems, ANewItems: TList); + var + I, J: Integer; + begin + for I := 0 to View.ItemCount - 1 do + begin + J := AOldItems.IndexOf(View.Items[I]); + if J = -1 then + ANewItems.Add(View.Items[I]) + else + AOldItems.Delete(J); + end; + end; + +var + AItems: TList; +begin + AItems := TList.Create; + try + GetViewItems(AItems); + CreateViewItems(View, AMissingItemsOnly); + GetViewNewItems(AItems, AItems); + UpdateColumnList; + ListBoxSyncSelection(LBColumns, AItems); + LBColumnsClick(nil); + UpdateDesigner; + finally + AItems.Free; + end; +end; + +procedure TcxCustomTableViewEditor.DrawListBoxItem(AListBox: TWinControl; + AIndex: Integer; R: TRect); +begin + with AListBox as TListBox, Canvas do + begin + FillRect(R); + TextOut(R.Left + 2, R.Top, Items[AIndex]); + end; +end; + +function TcxCustomTableViewEditor.GetCurrentGroup: TcxDataSummaryGroup; + + function GetGroupByItems(ASummaryItems: TcxDataSummaryItems): TcxDataSummaryGroup; + var + I: Integer; + begin + Result := nil; + for I := 0 to SummaryGroups.Count - 1 do + if SummaryGroups[I].SummaryItems = ASummaryItems then + begin + Result := SummaryGroups[I]; + Break; + end; + end; + + function GetGroupByItemLinks(ASummaryGroupItemLinks: TcxDataSummaryGroupItemLinks): TcxDataSummaryGroup; + var + I: Integer; + begin + Result := nil; + for I := 0 to SummaryGroups.Count - 1 do + if SummaryGroups[I].Links = ASummaryGroupItemLinks then + begin + Result := SummaryGroups[I]; + Break; + end; + end; + + function GetSummaryGroup(APersistent: TPersistent): TcxDataSummaryGroup; + begin + if APersistent is TcxDataSummaryGroup then + Result := TcxDataSummaryGroup(APersistent) + else + if APersistent is TcxDataSummaryItem then + Result := GetGroupByItems(TcxDataSummaryItem(APersistent).SummaryItems) + else + if APersistent is TcxDataSummaryItems then + Result := GetGroupByItems(TcxDataSummaryItems(APersistent)) + else + if APersistent is TcxDataSummaryGroupItemLink then + Result := GetGroupByItemLinks(TcxDataSummaryGroupItemLink(APersistent).SummaryGroupItemLinks) + else + if APersistent is TcxDataSummaryGroupItemLinks then + Result := GetGroupByItemLinks(TcxDataSummaryGroupItemLinks(APersistent)) + else + Result := nil; + end; + +var + AList: TList; + I: Integer; + ASummaryGroup: TcxDataSummaryGroup; +begin + Result := nil; + AList := TList.Create; + try + GetSelectionList(AList); + for I := 0 to AList.Count - 1 do + begin + ASummaryGroup := GetSummaryGroup(TPersistent(AList[I])); + if (ASummaryGroup <> nil) and (GetViewByObject(ASummaryGroup) = View) then + if Result = nil then + Result := ASummaryGroup + else + if Result <> ASummaryGroup then + begin + Result := nil; + Break; + end; + end; + finally + AList.Free; + end; +end; + +function TcxCustomTableViewEditor.GetDeleteItemsCaption: string; +begin + Result := Format('Delete existing %ss?', [LowerCase(GetViewItemName(View))]); +end; + +procedure TcxCustomTableViewEditor.SelectAllColumns; +begin + ListBoxSelectAll(LBColumns); +end; + +procedure TcxCustomTableViewEditor.UpdateButtons; +begin + // Columns + BColumnAdd.Enabled := CanAddComponent; + BColumnDelete.Enabled := CanDeleteComponent(nil) and (LBColumns.SelCount > 0); + BColumnRestore.Enabled := LBColumns.SelCount > 0; + BColumnMoveUp.Enabled := LBColumns.SelCount > 0; + BColumnMoveDown.Enabled := LBColumns.SelCount > 0; + BColumnAddAll.Enabled := CanAddComponent and + (View.DataController as IcxCustomGridDataController).IsDataLinked; + BColumnAddMissing.Enabled := BColumnAddAll.Enabled and + not (View.DataController as IcxCustomGridDataController).HasAllItems; + + MIColumnAdd.Enabled := BColumnAdd.Enabled; + MIColumnDelete.Enabled := BColumnDelete.Enabled; + MIColumnRestore.Enabled := BColumnRestore.Enabled; + MIColumnMoveUp.Enabled := BColumnMoveUp.Enabled; + MIColumnMoveDown.Enabled := BColumnMoveDown.Enabled; + MIColumnSelectAll.Enabled := LBColumns.SelCount < LBColumns.Items.Count; + + // Summary + BAddFooterSummaryItem.Enabled := CanAddComponent; + BDeleteFooterSummaryItem.Enabled := CanDeleteComponent(nil) and (LBFooterSummary.SelCount > 0); + + BDefaultGroupSummaryAdd.Enabled := CanAddComponent; + BDefaultGroupSummaryDelete.Enabled := CanDeleteComponent(nil) and (LBDefaultGroupsSummary.SelCount > 0); + + BSummaryGroupAdd.Enabled := CanAddComponent; + BSummaryGroupDelete.Enabled := CanDeleteComponent(nil) and (LBSummaryGroups.SelCount > 0); + BGroupSummaryItemAdd.Enabled := CanAddComponent and (GetCurrentGroup <> nil); + BGroupSummaryItemDelete.Enabled := CanDeleteComponent(nil) and (LBGroupSummaryItems.SelCount > 0); + BColumnLink.Enabled := CanAddComponent and (LBUnlinkedColumns.SelCount > 0); + BColumnUnlink.Enabled := CanDeleteComponent(nil) and (LBLinkedColumns.SelCount > 0); + + MIFooterSummaryAdd.Enabled := BAddFooterSummaryItem.Enabled; + MIFooterSummaryDelete.Enabled := BDeleteFooterSummaryItem.Enabled; + MIFooterSummarySelectAll.Enabled := LBFooterSummary.SelCount < LBFooterSummary.Items.Count; + + MIDefaultGroupSummaryAdd.Enabled := BDefaultGroupSummaryAdd.Enabled; + MIDefaultGroupSummaryDelete.Enabled := BDefaultGroupSummaryDelete.Enabled; + MIDefaultGroupSummarySelectAll.Enabled := LBDefaultGroupsSummary.SelCount < LBDefaultGroupsSummary.Items.Count; + + MISummaryGroupAdd.Enabled := BSummaryGroupAdd.Enabled; + MISummaryGroupDelete.Enabled := BSummaryGroupDelete.Enabled; + MISummaryGroupSelectAll.Enabled := LBSummaryGroups.SelCount < LBSummaryGroups.Items.Count; + + MIGroupSummaryItemsAdd.Enabled := BGroupSummaryItemAdd.Enabled; + MIGroupSummaryItemsDelete.Enabled := BGroupSummaryItemDelete.Enabled; + MIGroupSummaryItemsSelectAll.Enabled := LBGroupSummaryItems.SelCount < LBGroupSummaryItems.Items.Count; +end; + +procedure TcxCustomTableViewEditor.UpdateColumnList; +var + I, AItemIndex, ATopIndex: Integer; + ASelection: TStringList; + S: string; +begin + ListBoxSaveSelection(LBColumns, ASelection, AItemIndex, ATopIndex); + try + LBColumns.Items.Clear; + for I := 0 to View.ItemCount - 1 do + begin + S := View.Items[I].Name; + if View.Items[I].RepositoryItem <> nil then + S := S + ' (' + View.Items[I].RepositoryItem.Name + ')'; // TODO: description + LBColumns.Items.AddObject(S, View.Items[I]); + end; + finally + ListBoxRestoreSelection(LBColumns, ASelection, AItemIndex, ATopIndex); + end; +end; + +procedure TcxCustomTableViewEditor.UpdateEditor; +begin + BColumnAddAll.Visible := + (View.DataController as IcxCustomGridDataController).SupportsCreateAllItems; + BColumnAddMissing.Visible := BColumnAddAll.Visible; + UpdateColumnList; + UpdateSummary; +end; + +procedure TcxCustomTableViewEditor.UpdateSelection; +begin + FormEditor.ListBoxSynchronizeSelection(LBColumns); + UpdateSummarySelection; + UpdateButtons; +end; + +procedure TcxCustomTableViewEditor.UpdateSummary; +begin + ListBoxLoadCollection(LBFooterSummary, FooterSummaryItems); + ListBoxLoadCollection(LBDefaultGroupsSummary, DefaultGroupSummaryItems); + ListBoxLoadCollection(LBSummaryGroups, SummaryGroups); + UpdateSummaryGroups; +end; + +procedure TcxCustomTableViewEditor.UpdateSummarySelection; +var + AList: TList; +begin + AList := TList.Create; + try + FormEditor.GetSelectionList(AList); + ListBoxSyncSelection(LBFooterSummary, AList); + ListBoxSyncSelection(LBDefaultGroupsSummary, AList); + ListBoxSyncSelection(LBSummaryGroups, AList); + ListBoxSelectByObject(LBSummaryGroups, GetCurrentGroup); + SummaryGroup := GetCurrentGroup; + ListBoxSyncSelection(LBGroupSummaryItems, AList); + finally + AList.Free; + end; +end; + +function TcxCustomTableViewEditor.GetDefaultGroupSummaryItems: TcxDataGroupSummaryItems; +begin + Result := View.DataController.Summary.DefaultGroupSummaryItems; +end; + +function TcxCustomTableViewEditor.GetFooterSummaryItems: TcxDataFooterSummaryItems; +begin + Result := View.DataController.Summary.FooterSummaryItems; +end; + +function TcxCustomTableViewEditor.GetSummaryGroups: TcxDataSummaryGroups; +begin + Result := View.DataController.Summary.SummaryGroups; +end; + +function TcxCustomTableViewEditor.GetView: TcxCustomGridTableView; +begin + Result := inherited View as TcxCustomGridTableView; +end; + +procedure TcxCustomTableViewEditor.SetSummaryGroup(Value: TcxDataSummaryGroup); +begin + if FSummaryGroup <> Value then + begin + FSummaryGroup := Value; + UpdateSummaryGroups; + end; +end; + +procedure TcxCustomTableViewEditor.ReindexColumnsProc(AList: TList; ANewIndex: Integer); +var + I: Integer; +begin + if AList.Count = 0 then Exit; + if TcxCustomGridTableItem(AList[0]).Index < ANewIndex then + begin + for I := 0 to AList.Count - 1 do + TcxCustomGridTableItem(AList[I]).Index := ANewIndex; + end + else + begin + for I := AList.Count - 1 downto 0 do + TcxCustomGridTableItem(AList[I]).Index := ANewIndex; + end; + UpdateDesigner; +end; + +procedure TcxCustomTableViewEditor.UpdateSummaryGroupLinks; +var + ACurrentGroup: TcxDataSummaryGroup; + I: Integer; + AItemLink: TObject; + ADataController: TcxCustomDataController; + AItemIndex1, ATopIndex1, AItemIndex2, ATopIndex2: Integer; + ASelection1, ASelection2: TStringList; +begin + ACurrentGroup := GetCurrentGroup; + ListBoxSaveSelection(LBUnlinkedColumns, ASelection1, AItemIndex1, ATopIndex1); + ListBoxSaveSelection(LBLinkedColumns, ASelection2, AItemIndex2, ATopIndex2); + try + LBUnlinkedColumns.Items.Clear; + LBLinkedColumns.Items.Clear; + if ACurrentGroup <> nil then + begin + for I := 0 to ACurrentGroup.Links.Count - 1 do + begin + AItemLink := ACurrentGroup.Links[I].ItemLink; + if AItemLink is TComponent then + LBLinkedColumns.Items.AddObject((AItemLink as TComponent).Name, AItemLink); + end; + ADataController := ACurrentGroup.SummaryGroups.Summary.DataController; + for I := 0 to ADataController.ItemCount - 1 do + begin + AItemLink := ADataController.GetItem(I); + if LBLinkedColumns.Items.IndexOfObject(AItemLink) = -1 then + LBUnlinkedColumns.Items.AddObject((AItemLink as TComponent).Name, AItemLink); + end; + end; + finally + ListBoxRestoreSelection(LBUnlinkedColumns, ASelection1, AItemIndex1, ATopIndex1); + ListBoxRestoreSelection(LBLinkedColumns, ASelection2, AItemIndex2, ATopIndex2); + end; +end; + +procedure TcxCustomTableViewEditor.UpdateSummaryGroups; +var + ACurrentGroup: TcxDataSummaryGroup; +begin + ACurrentGroup := GetCurrentGroup; + if ACurrentGroup <> nil then + ListBoxLoadCollection(LBGroupSummaryItems, ACurrentGroup.SummaryItems) + else + LBGroupSummaryItems.Items.Clear; + UpdateSummaryGroupLinks; +end; + +// Columns + +procedure TcxCustomTableViewEditor.LBColumnsClick(Sender: TObject); +begin + FormEditor.ListBoxApplySelection(LBColumns, View); +end; + +procedure TcxCustomTableViewEditor.BColumnAddClick(Sender: TObject); +var + AItem: TcxCustomGridTableItem; +begin + ListBoxClearSelection(LBColumns); + AItem := CreateViewItem(View); + UpdateColumnList; + ListBoxSelectByObject(LBColumns, AItem); + LBColumnsClick(nil); + UpdateDesigner; +end; + +procedure TcxCustomTableViewEditor.BColumnAddMissingClick(Sender: TObject); +begin + DoCreateViewItems(True); +end; + +procedure TcxCustomTableViewEditor.BColumnDeleteClick(Sender: TObject); +begin + if LBColumns.SelCount > 0 then + begin + BeginUpdate; + try + ListBoxDeleteSelection(LBColumns, True); + UpdateColumnList; + LBColumnsClick(nil); + UpdateDesigner; + finally + EndUpdate; + end; + end; +end; + +procedure TcxCustomTableViewEditor.BColumnRestoreClick(Sender: TObject); +var + I: Integer; +begin + if LBColumns.SelCount > 0 then + try + for I := 0 to LBColumns.Items.Count - 1 do + if LBColumns.Selected[I] then + TcxCustomGridTableItem(LBColumns.Items.Objects[I]).RestoreDefaults; + finally + UpdateColumnList; + LBColumnsClick(nil); + UpdateDesigner; + end; +end; + +procedure TcxCustomTableViewEditor.BColumnMoveUpClick(Sender: TObject); +begin + FColumnsPrevDragIndex := -1; + ListBoxMoveUpItems(LBColumns, FColumnsPrevDragIndex, ReindexColumnsProc); +end; + +procedure TcxCustomTableViewEditor.BColumnMoveDownClick(Sender: TObject); +begin + FColumnsPrevDragIndex := -1; + ListBoxMoveDownItems(LBColumns, FColumnsPrevDragIndex, ReindexColumnsProc); +end; + +procedure TcxCustomTableViewEditor.BColumnAddAllClick(Sender: TObject); +begin + if View.ItemCount > 0 then + case Application.MessageBox(PChar(GetDeleteItemsCaption), + 'Confirm', MB_YESNOCANCEL) of + IDYES: + View.ClearItems; + IDCANCEL: + Exit; + end; + DoCreateViewItems(False); +end; + +procedure TcxCustomTableViewEditor.MIColumnSelectAllClick(Sender: TObject); +begin + SelectAllColumns; + LBColumnsClick(nil); +end; + +// Summary - Footer + +procedure TcxCustomTableViewEditor.LBFooterSummaryClick(Sender: TObject); +begin + FormEditor.ListBoxApplySelection(LBFooterSummary, FooterSummaryItems); +end; + +procedure TcxCustomTableViewEditor.BAddFooterSummaryItemClick( + Sender: TObject); +begin + CollectionItemsAdd(LBFooterSummary, FooterSummaryItems); +end; + +procedure TcxCustomTableViewEditor.BDeleteFooterSummaryItemClick( + Sender: TObject); +begin + CollectionItemsDelete(LBFooterSummary, FooterSummaryItems); +end; + +// Summary - Default Group + +procedure TcxCustomTableViewEditor.LBDefaultGroupsSummaryClick( + Sender: TObject); +begin + FormEditor.ListBoxApplySelection(LBDefaultGroupsSummary, DefaultGroupSummaryItems); +end; + +procedure TcxCustomTableViewEditor.BDefaultGroupSummaryAddClick(Sender: TObject); +begin + CollectionItemsAdd(LBDefaultGroupsSummary, DefaultGroupSummaryItems); +end; + +procedure TcxCustomTableViewEditor.BDefaultGroupSummaryDeleteClick( + Sender: TObject); +begin + CollectionItemsDelete(LBDefaultGroupsSummary, DefaultGroupSummaryItems); +end; + +// Summary - Groups + +procedure TcxCustomTableViewEditor.LBSummaryGroupsClick(Sender: TObject); +begin + FormEditor.ListBoxApplySelection(LBSummaryGroups, SummaryGroups); +end; + +procedure TcxCustomTableViewEditor.BSummaryGroupAddClick(Sender: TObject); +begin + CollectionItemsAdd(LBSummaryGroups, SummaryGroups); +end; + +procedure TcxCustomTableViewEditor.BSummaryGroupDeleteClick( + Sender: TObject); +begin + CollectionItemsDelete(LBSummaryGroups, SummaryGroups); +end; + +// Summary - Selected Group + +procedure TcxCustomTableViewEditor.LBGroupSummaryItemsClick( + Sender: TObject); +begin + if GetCurrentGroup <> nil then + FormEditor.ListBoxApplySelection(LBGroupSummaryItems, GetCurrentGroup.SummaryItems); +end; + +procedure TcxCustomTableViewEditor.BGroupSummaryItemAddClick( + Sender: TObject); +begin + if GetCurrentGroup <> nil then + CollectionItemsAdd(LBGroupSummaryItems, GetCurrentGroup.SummaryItems); +end; + +procedure TcxCustomTableViewEditor.BGroupSummaryItemDeleteClick( + Sender: TObject); +begin + if GetCurrentGroup <> nil then + CollectionItemsDelete(LBGroupSummaryItems, GetCurrentGroup.SummaryItems); +end; + +procedure TcxCustomTableViewEditor.LBUnlinkedColumnsClick(Sender: TObject); +begin + UpdateButtons; +end; + +procedure TcxCustomTableViewEditor.BColumnLinkClick(Sender: TObject); +var + ACurrentGroup: TcxDataSummaryGroup; + I: Integer; + AGroupItemLink: TcxDataSummaryGroupItemLink; +begin + BeginUpdate; + try + ACurrentGroup := GetCurrentGroup; + for I := 0 to LBUnlinkedColumns.Items.Count - 1 do + if LBUnlinkedColumns.Selected[I] then + begin + AGroupItemLink := ACurrentGroup.Links.Add; + AGroupItemLink.ItemLink := LBUnlinkedColumns.Items.Objects[I]; + end; + UpdateSummaryGroupLinks; + UpdateDesigner; + finally + EndUpdate; + end; +end; + +procedure TcxCustomTableViewEditor.BColumnUnlinkClick(Sender: TObject); +var + ACurrentGroup: TcxDataSummaryGroup; + I: Integer; + AGroupItemLink: TcxDataSummaryGroupItemLink; +begin + BeginUpdate; + try + ACurrentGroup := GetCurrentGroup; + for I := LBLinkedColumns.Items.Count - 1 downto 0 do + if LBLinkedColumns.Selected[I] then + begin + AGroupItemLink := ACurrentGroup.Links.ItemOfItemLink(LBLinkedColumns.Items.Objects[I]); + AGroupItemLink.Free; + end; + UpdateSummaryGroupLinks; + UpdateDesigner; + finally + EndUpdate; + end; +end; + +procedure TcxCustomTableViewEditor.PLinksResize(Sender: TObject); +var + W: Integer; +begin + W := (PLinks.Width - PLinkUnlink.Width) div 2; + PUnlinkedColumns.Width := W; + PLinkedColumns.Width := W; +end; + +procedure TcxCustomTableViewEditor.PSummaryGroupsResize(Sender: TObject); +var + W: Integer; +begin + // Groups + W := (PSummaryGroups.Width - PGSeparator.Width) div 2; + PGroups.Width := W; + PGroupItems.Width := W; +end; + +// Drag Drop Columns + +procedure TcxCustomTableViewEditor.LBColumnsStartDrag(Sender: TObject; + var DragObject: TDragObject); +begin + FColumnsPrevDragIndex := -1; +end; + +procedure TcxCustomTableViewEditor.LBColumnsDragOver(Sender, + Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); +begin + ListBoxDragOver(LBColumns, Sender, Source, X, Y, State, Accept, FColumnsPrevDragIndex); +end; + +procedure TcxCustomTableViewEditor.LBColumnsEndDrag(Sender, + Target: TObject; X, Y: Integer); +begin + ListBoxEndDrag(LBColumns, Sender, Target, X, Y, FColumnsPrevDragIndex); +end; + +procedure TcxCustomTableViewEditor.LBColumnsDragDrop(Sender, + Source: TObject; X, Y: Integer); +begin + ListBoxDragDrop(LBColumns, Sender, Source, X, Y, FColumnsPrevDragIndex, ReindexColumnsProc); +end; + +// Summary: Select All + +procedure TcxCustomTableViewEditor.MIFooterSummarySelectAllClick( + Sender: TObject); +begin + ListBoxSelectAll(LBFooterSummary); + LBFooterSummaryClick(nil); +end; + +procedure TcxCustomTableViewEditor.MIDefaultGroupSummarySelectAllClick( + Sender: TObject); +begin + ListBoxSelectAll(LBDefaultGroupsSummary); + LBDefaultGroupsSummaryClick(nil); +end; + +procedure TcxCustomTableViewEditor.MISummaryGroupSelectAllClick( + Sender: TObject); +begin + ListBoxSelectAll(LBSummaryGroups); + LBSummaryGroupsClick(nil); +end; + +procedure TcxCustomTableViewEditor.MIGroupSummaryItemsSelectAllClick( + Sender: TObject); +begin + ListBoxSelectAll(LBGroupSummaryItems); + LBGroupSummaryItemsClick(nil); +end; + +procedure TcxCustomTableViewEditor.FormCreate(Sender: TObject); +begin + inherited; + CalculateListBoxItemHeight(LBColumns); +end; + +procedure TcxCustomTableViewEditor.LBColumnsDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +begin + DrawListBoxItem(Control, Index, Rect); +end; + +{ TcxCustomGridTableViewMenuProvider } + +function TcxCustomGridTableViewMenuProvider.GetGridView: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited GridView); +end; + +function TcxCustomGridTableViewMenuProvider.GetViewItemNameValue: string; +begin + Result := GetViewItemName(GridView); +end; + +function TcxCustomGridTableViewMenuProvider.CanDeleteItems: Boolean; +var + I: Integer; +begin + Result := GridView.ItemCount <> 0; + if Result then + for I := 0 to GridView.ItemCount - 1 do + begin + Result := CanDeleteComponent(GridView.Items[I].Owner, GridView.Items[I]); + if not Result then Break; + end; +end; + +procedure TcxCustomGridTableViewMenuProvider.CreateAllItems(Sender: TcxGridViewMenuItem); +begin + CreateViewItems(GridView, False); + DesignerModified; +end; + +procedure TcxCustomGridTableViewMenuProvider.CreateItem(Sender: TcxGridViewMenuItem); +begin + ObjectCreated(CreateViewItem(GridView)); +end; + +procedure TcxCustomGridTableViewMenuProvider.CreateMissingItems(Sender: TcxGridViewMenuItem); +begin + CreateViewItems(GridView, True); + DesignerModified; +end; + +procedure TcxCustomGridTableViewMenuProvider.DeleteAllItems(Sender: TcxGridViewMenuItem); +begin + (GridView.DataController as IcxCustomGridDataController).DeleteAllItems; + DesignerModified; +end; + +procedure TcxCustomGridTableViewMenuProvider.InitStructureCreationItems; +begin + if (GridView.DataController as IcxCustomGridDataController).SupportsCreateAllItems then + if (GridView.DataController as IcxCustomGridDataController).IsDataLinked then + begin + Items.AddItem(Format('Create All %ss', [ViewItemName]), CreateAllItems, + CanAddComponent(GridView.Owner)); + Items.AddItem(Format('Create Missing %ss', [ViewItemName]), CreateMissingItems, + CanAddComponent(GridView.Owner) and not (GridView.DataController as IcxCustomGridDataController).HasAllItems); + end + else + Items.AddItem('(no data linked)', nil, False); + Items.AddItem(Format('Create %s', [ViewItemName]), CreateItem, CanAddComponent(GridView.Owner)); +end; + +procedure TcxCustomGridTableViewMenuProvider.InitStructureItems; +begin + InitStructureCreationItems; + Items.AddSeparator; + if (GridView.DataController as IcxCustomGridDataController).SupportsCreateAllItems then + Items.AddItem(Format('Delete All %ss', [ViewItemName]), DeleteAllItems, CanDeleteItems); + inherited; +end; + +initialization + RegisterViewEditorClass(TcxCustomGridTableView, TcxCustomTableViewEditor); + RegisterViewMenuProviderClass(TcxCustomGridTableView, TcxCustomGridTableViewMenuProvider); + +finalization + UnregisterViewMenuProviderClass(TcxCustomGridTableView, TcxCustomGridTableViewMenuProvider); + UnregisterViewEditorClass(TcxCustomGridTableView, TcxCustomTableViewEditor); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxDBExtLookupComboBox.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxDBExtLookupComboBox.pas new file mode 100644 index 00000000..348bc20a --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxDBExtLookupComboBox.pas @@ -0,0 +1,968 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDBExtLookupComboBox; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Classes, Controls, DB, Graphics, Messages, SysUtils, cxClasses, + cxContainer, cxControls, cxCustomData, cxDB, cxDBData, cxDBEdit, + cxDBLookupEdit, cxEditConsts, cxGrid, cxGridCustomTableView, cxEdit, + cxGridCustomView, cxGridStrs, cxGridTableView, cxLookAndFeels, cxLookupEdit; + +type + { TcxExtLookupGrid } + + TcxExtLookupGrid = class(TcxGrid) + private + FEditable: Boolean; + FMousePos: TPoint; + FPopupMouseMoveLocked: Boolean; + FPrevOnKeyDown: TKeyEvent; + FPrevOnMouseDown: TMouseEvent; + FPrevOnMouseMove: TMouseMoveEvent; + FPrevOnMouseUp: TMouseEvent; + FRowPressed: Boolean; + FOnCloseUp: TcxLookupGridCloseUpEvent; + function GetView: TcxCustomGridTableView; + procedure ViewKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure ViewMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure ViewMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); + procedure ViewMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + protected + procedure DoCancelMode; override; + procedure DoCloseUp(AAccept: Boolean); virtual; + function IsDataRow(AHitTest: TcxCustomGridHitTest): Boolean; + property Editable: Boolean read FEditable write FEditable; + property PopupMouseMoveLocked: Boolean read FPopupMouseMoveLocked write FPopupMouseMoveLocked; + property OnCloseUp: TcxLookupGridCloseUpEvent read FOnCloseUp write FOnCloseUp; + public + property View: TcxCustomGridTableView read GetView; + end; + + { TcxCustomExtLookupComboBoxProperties } + + TcxCustomExtLookupComboBoxProperties = class(TcxCustomDBLookupEditProperties); + + { TcxExtLookupComboBoxProperties } + + TcxExtLookupComboBoxProperties = class(TcxCustomExtLookupComboBoxProperties) + private + FAutoSearchOnPopup: Boolean; + FDestroying: Boolean; + FFocusPopup: Boolean; + FGrid: TcxExtLookupGrid; + FInCheckListFieldItem: Boolean; + FListFieldItem: TcxCustomGridTableItem; + FPrevColumnFiltering: Boolean; + FPrevPullFocusing: Boolean; + FPrevImmediateEditor: Boolean; + FPrevIncSearch: Boolean; + FPrevMultiSelect: Boolean; + FView: TcxCustomGridTableView; + function GetGrid: TcxExtLookupGrid; + function GetGridMode: Boolean; + function GetListFieldIndex: Integer; + function GetListFieldItem: TcxCustomGridTableItem; + procedure SetGridMode(Value: Boolean); + procedure SetListFieldItem(Value: TcxCustomGridTableItem); + procedure SetView(Value: TcxCustomGridTableView); + protected + procedure CheckListFieldItem; + procedure DeinitializeDataController; override; + procedure FreeNotification(Sender: TComponent); override; + function GetIncrementalFiltering: Boolean; override; + function GetListIndex: Integer; override; + procedure InitializeDataController; override; + procedure LinkView(AView: TcxCustomGridTableView); + function PopupWindowCapturesFocus: Boolean; override; + procedure UnlinkView(AView: TcxCustomGridTableView); + // LookupGrid methods + function GetLookupGridActiveControl: TWinControl; override; + function GetLookupGridCanResize: Boolean; override; + function GetLookupGridColumnCount: Integer; override; + function GetLookupGridControl: TWinControl; override; + function GetLookupGridDataController: TcxCustomDataController; override; + function GetLookupGridVisualAreaPreferredWidth: Integer; override; + function GetLookupGridNearestPopupHeight(AHeight: Integer): Integer; override; + function GetLookupGridPopupHeight(ADropDownRowCount: Integer): Integer; override; + function IsLookupGridMouseOverList(const P: TPoint): Boolean; override; + procedure LookupGridDeinitialize; override; + procedure LookupGridDroppedDown(const AFindStr: string); override; + procedure LookupGridInitEvents(AOnClick, AOnFocusedRowChanged: TNotifyEvent; + AOnCloseUp: TcxLookupGridCloseUpEvent); override; + procedure LookupGridInitialize; override; + procedure LookupGridInitLookAndFeel(ALookAndFeel: TcxLookAndFeel; + AColor: TColor; AFont: TFont); override; + procedure LookupGridLockMouseMove; override; + procedure LookupGridMakeFocusedRowVisible; override; + procedure LookupGridUnlockMouseMove; override; + // DBLookupGrid methods + procedure DBLookupGridBeginUpdate; override; + procedure DBLookupGridCheckColumnByFieldName(const AFieldName: string); override; + procedure DBLookupGridCreateColumnsByFieldNames(const AFieldNames: string); override; + procedure DBLookupGridEndUpdate; override; + function GetDBLookupGridColumnField(AIndex: Integer): TField; override; + function GetDBLookupGridColumnFieldName(AIndex: Integer): string; override; + function GetDBLookupGridColumnIndexByFieldName(const AFieldName: string): Integer; override; + function GetDBLookupGridDataController: TcxDBDataController; override; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + class function GetContainerClass: TcxContainerClass; override; + class function IsViewSupported(Value: TcxCustomGridTableView): Boolean; + property Grid: TcxExtLookupGrid read GetGrid; + property ListFieldIndex: Integer read GetListFieldIndex; + published + property Alignment; + property AssignedValues; + property AutoSearchOnPopup: Boolean read FAutoSearchOnPopup write FAutoSearchOnPopup default True; + property AutoSelect; + property ButtonGlyph; + property CaseSensitiveSearch; + property CharCase; + property ClearKey; + property DropDownAutoSize; + property DropDownHeight; + property DropDownListStyle; + property DropDownRows; + property DropDownSizeable; + property DropDownWidth; + property FocusPopup: Boolean read FFocusPopup write FFocusPopup default False; + property GridMode: Boolean read GetGridMode write SetGridMode default False; + property HideSelection; + property ImeMode; + property ImeName; + property ImmediateDropDown; + property ImmediatePost; + property IncrementalFiltering; + property View: TcxCustomGridTableView read FView write SetView; // before + property KeyFieldNames; + property ListFieldItem: TcxCustomGridTableItem read GetListFieldItem write SetListFieldItem; + property MaxLength; + property OEMConvert; + property PopupAlignment; + property PostPopupValueOnTab; + property ReadOnly; + property Revertable; + property UseLeftAlignmentOnEditing; + property ValidateOnEnter; + property OnChange; + property OnCloseUp; + property OnEditValueChanged; + property OnInitPopup; + property OnNewLookupDisplayText; + property OnPopup; + property OnValidate; + end; + + { TcxCustomExtLookupComboBox } + + TcxCustomExtLookupComboBox = class(TcxCustomDBLookupEdit) + private + function GetActiveProperties: TcxExtLookupComboBoxProperties; + function GetProperties: TcxExtLookupComboBoxProperties; + procedure SetProperties(Value: TcxExtLookupComboBoxProperties); + protected + function CanDropDown: Boolean; override; + public + class function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + property ActiveProperties: TcxExtLookupComboBoxProperties + read GetActiveProperties; + property EditValue; + property Properties: TcxExtLookupComboBoxProperties read GetProperties + write SetProperties; + property Text; + end; + + { TcxExtLookupComboBox } + + TcxExtLookupComboBox = class(TcxCustomExtLookupComboBox) + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties; + property EditValue; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnEditing; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + end; + + { TcxDBExtLookupComboBox } + + TcxDBExtLookupComboBox = class(TcxCustomExtLookupComboBox) + private + function GetDataBinding: TcxDBTextEditDataBinding; + procedure SetDataBinding(Value: TcxDBTextEditDataBinding); + procedure CMGetDataLink(var Message: TMessage); message CM_GETDATALINK; + protected + class function GetDataBindingClass: TcxEditDataBindingClass; override; + published + property Anchors; + property AutoSize; + property BeepOnEnter; + property Constraints; + property DragCursor; + property DragKind; + property DataBinding: TcxDBTextEditDataBinding read GetDataBinding + write SetDataBinding; + property DragMode; + property Enabled; + property ImeMode; + property ImeName; + property ParentColor; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Properties; + property ShowHint; + property Style; + property StyleDisabled; + property StyleFocused; + property StyleHot; + property TabOrder; + property TabStop; + property Visible; + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnEditing; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + end; + + { TcxEditRepositoryExtLookupComboBoxItem } + + TcxEditRepositoryExtLookupComboBoxItem = class(TcxEditRepositoryItem) + private + function GetProperties: TcxExtLookupComboBoxProperties; + procedure SetProperties(Value: TcxExtLookupComboBoxProperties); + public + class function GetEditPropertiesClass: TcxCustomEditPropertiesClass; override; + published + property Properties: TcxExtLookupComboBoxProperties read GetProperties write SetProperties; + end; + +implementation + +uses + cxGridFilterHelpers; + +type + TcxCustomGridTableOptionsBehaviorAccess = class(TcxCustomGridTableOptionsBehavior); + TcxCustomGridTableOptionsViewAccess = class(TcxCustomGridTableOptionsView); + +{ TcxExtLookupGrid } + +procedure TcxExtLookupGrid.DoCancelMode; +begin + FRowPressed := False; + inherited; +end; + +procedure TcxExtLookupGrid.DoCloseUp(AAccept: Boolean); +begin + if AAccept then + View.DataController.SyncSelected(True); + if Assigned(FOnCloseUp) then FOnCloseUp(Self, AAccept); +end; + +function TcxExtLookupGrid.IsDataRow(AHitTest: TcxCustomGridHitTest): Boolean; +begin + Result := (AHitTest is TcxGridRecordHitTest) and + TcxGridRecordHitTest(AHitTest).GridRecord.IsData; +end; + +function TcxExtLookupGrid.GetView: TcxCustomGridTableView; +begin + Result := Levels[0].GridView as TcxCustomGridTableView; +end; + +procedure TcxExtLookupGrid.ViewKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); +begin + if Assigned(FPrevOnKeyDown) then + FPrevOnKeyDown(Self, Key, Shift); + if (View = nil) then Exit; + case Key of + VK_RETURN: + if not Editable or not View.OptionsData.Editing or (ssCtrl in Shift) then + begin + if View.DataController.IsEditing then + View.DataController.Post; + DoCloseUp(View.DataController.FocusedRowIndex <> -1); + end; + VK_ESCAPE: + if Editable and not View.DataController.IsEditing then + DoCloseUp(False); + end; +end; + +procedure TcxExtLookupGrid.ViewMouseDown(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +var + AHitTest: TcxCustomGridHitTest; +begin + if Assigned(FPrevOnMouseDown) then + FPrevOnMouseDown(Sender, Button, Shift, X, Y); + AHitTest := View.ViewInfo.GetHitTest(X, Y); + if (Button = mbLeft) and IsDataRow(AHitTest) then + begin + if Editable then + begin + if ssDouble in Shift then + DoCloseUp(True); + end + else + FRowPressed := True; + end; +end; + +procedure TcxExtLookupGrid.ViewMouseMove(Sender: TObject; Shift: TShiftState; + X, Y: Integer); +var + AHitTest: TcxCustomGridHitTest; +begin + if Assigned(FPrevOnMouseMove) then + FPrevOnMouseMove(Sender, Shift, X, Y); + if not MouseCapture and PopupMouseMoveLocked then + begin + PopupMouseMoveLocked := False; + Exit; + end; + // Hot Track + if (View = nil) or Editable then Exit; + AHitTest := View.ViewInfo.GetHitTest(X, Y); + if IsDataRow(AHitTest) and ((FMousePos.X <> X) or (FMousePos.Y <> Y)) then + begin + FMousePos.X := X; + FMousePos.Y := Y; + TcxGridRecordHitTest(AHitTest).GridRecord.Focused := True; + end; +end; + +procedure TcxExtLookupGrid.ViewMouseUp(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +var + AHitTest: TcxCustomGridHitTest; +begin + if Assigned(FPrevOnMouseUp) then + FPrevOnMouseUp(Sender, Button, Shift, X, Y); + AHitTest := View.ViewInfo.GetHitTest(X, Y); + if (Button = mbLeft) and FRowPressed then + DoCloseUp(IsDataRow(AHitTest)); + FRowPressed := False; +end; + +{ TcxExtLookupComboBoxProperties } + +constructor TcxExtLookupComboBoxProperties.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FAutoSearchOnPopup := True; +end; + +destructor TcxExtLookupComboBoxProperties.Destroy; +begin + FDestroying := True; + ListFieldItem := nil; + View := nil; + FreeAndNil(FGrid); + inherited Destroy; +end; + +procedure TcxExtLookupComboBoxProperties.Assign(Source: TPersistent); +begin + if Source is TcxExtLookupComboBoxProperties then + begin + BeginUpdate; + try + AutoSearchOnPopup := TcxExtLookupComboBoxProperties(Source).AutoSearchOnPopup; + FocusPopup := TcxExtLookupComboBoxProperties(Source).FocusPopup; + View := nil; //? + GridMode := TcxExtLookupComboBoxProperties(Source).GridMode; + View := TcxExtLookupComboBoxProperties(Source).View; + inherited Assign(Source); + ListFieldItem := TcxExtLookupComboBoxProperties(Source).ListFieldItem; + finally + EndUpdate; + end + end + else + inherited Assign(Source); +end; + +class function TcxExtLookupComboBoxProperties.GetContainerClass: TcxContainerClass; +begin + Result := TcxExtLookupComboBox; +end; + +class function TcxExtLookupComboBoxProperties.IsViewSupported(Value: TcxCustomGridTableView): Boolean; +begin + Result := Value.CanBeLookupList and + (TcxCustomGridView(Value).DataController is TcxDBDataController); +end; + +procedure TcxExtLookupComboBoxProperties.CheckListFieldItem; +begin + FInCheckListFieldItem := True; + try + if (View <> nil) and (ListFieldItem <> nil) and + (View.IndexOfItem(ListFieldItem) = -1) then + ListFieldItem := nil; + finally + FInCheckListFieldItem := False; + end; +end; + +procedure TcxExtLookupComboBoxProperties.DeinitializeDataController; +begin + inherited DeinitializeDataController; + if DataController <> nil then + DataController.RemoveDataChangeRefCount; +end; + +procedure TcxExtLookupComboBoxProperties.FreeNotification(Sender: TComponent); +begin + inherited FreeNotification(Sender); + if Sender = ListFieldItem then + ListFieldItem := nil; + if Sender = View then + View := nil; +end; + +function TcxExtLookupComboBoxProperties.GetIncrementalFiltering: Boolean; +begin + if FocusPopup then + Result := False + else + Result := inherited GetIncrementalFiltering; +end; + +function TcxExtLookupComboBoxProperties.GetListIndex: Integer; +begin + Result := Self.ListFieldIndex; +end; + +procedure TcxExtLookupComboBoxProperties.InitializeDataController; +begin + inherited InitializeDataController; + if DataController <> nil then + DataController.AddDataChangeRefCount; +end; + +procedure TcxExtLookupComboBoxProperties.LinkView(AView: TcxCustomGridTableView); +begin + CheckListFieldItem; + FreeNotificator.AddSender(AView); + InitializeDataController; +end; + +function TcxExtLookupComboBoxProperties.PopupWindowCapturesFocus: Boolean; +begin + Result := FocusPopup; +end; + +procedure TcxExtLookupComboBoxProperties.UnlinkView(AView: TcxCustomGridTableView); +begin + DeinitializeDataController; + FreeNotificator.RemoveSender(AView); +end; + +// LookupGrid methods + +function TcxExtLookupComboBoxProperties.GetLookupGridActiveControl: TWinControl; +begin + if View <> nil then + Result := View.Site + else + Result := inherited GetLookupGridActiveControl; +end; + +function TcxExtLookupComboBoxProperties.GetLookupGridCanResize: Boolean; +begin + if View <> nil then + Result := not TcxCustomGridTableOptionsViewAccess(View.OptionsView).CellAutoHeight + else + Result := False; +end; + +function TcxExtLookupComboBoxProperties.GetLookupGridColumnCount: Integer; +begin + if View <> nil then + Result := View.ItemCount + else + Result := 0; +end; + +function TcxExtLookupComboBoxProperties.GetLookupGridControl: TWinControl; +begin + Result := Grid; +end; + +function TcxExtLookupComboBoxProperties.GetLookupGridDataController: TcxCustomDataController; +begin + if View <> nil then + Result := View.DataController + else + Result := nil; +end; + +function TcxExtLookupComboBoxProperties.GetLookupGridVisualAreaPreferredWidth: Integer; +begin + Result := 0; + if View <> nil then + View.ViewInfo.GetWidth(Point(MaxInt, MaxInt), Result); +end; + +function TcxExtLookupComboBoxProperties.GetLookupGridNearestPopupHeight(AHeight: Integer): Integer; +begin + if View <> nil then + Result := View.ViewInfo.GetNearestPopupHeight(AHeight, FocusPopup) + else + Result := AHeight; +end; + +function TcxExtLookupComboBoxProperties.GetLookupGridPopupHeight(ADropDownRowCount: Integer): Integer; +begin + if View <> nil then + begin + if FocusPopup and (ADropDownRowCount < 2) then // TODO: Check New Item Row + ADropDownRowCount := 2; + Result := View.ViewInfo.GetPopupHeight(ADropDownRowCount); + end + else + Result := 0; +end; + +function TcxExtLookupComboBoxProperties.IsLookupGridMouseOverList(const P: TPoint): Boolean; +var + AHitTest: TcxCustomGridHitTest; +begin + Result := False; + if View <> nil then + begin + AHitTest := View.ViewInfo.GetHitTest(P); + Result := AHitTest is TcxGridRecordHitTest; + end; +end; + +procedure TcxExtLookupComboBoxProperties.LookupGridDeinitialize; +begin + Grid.Levels[0].GridView := nil; + // restore options + if (View <> nil) and not (csDestroying in View.ComponentState) then + begin + TcxCustomGridTableOptionsBehaviorAccess(View.OptionsBehavior).PullFocusing := FPrevPullFocusing; + View.OptionsSelection.MultiSelect := FPrevMultiSelect; + View.OptionsBehavior.ImmediateEditor := FPrevImmediateEditor; + if View is TcxGridTableView then + TcxGridTableView(View).OptionsCustomize.ColumnFiltering := FPrevColumnFiltering; + View.OptionsBehavior.IncSearch := FPrevIncSearch; + View.OnKeyDown := Grid.FPrevOnKeyDown; + View.OnMouseDown := Grid.FPrevOnMouseDown; + View.OnMouseMove := Grid.FPrevOnMouseMove; + View.OnMouseUp := Grid.FPrevOnMouseUp; + end; +end; + +procedure TcxExtLookupComboBoxProperties.LookupGridDroppedDown(const AFindStr: string); +begin + // Init Inc Search + // TODO: !!! + if FocusPopup and AutoSearchOnPopup and (ListFieldItem <> nil) then + begin + ListFieldItem.Focused := True; + View.DataController.Search.Locate(ListFieldItem.Index, AFindStr); + end; +end; + +procedure TcxExtLookupComboBoxProperties.LookupGridInitEvents(AOnClick, AOnFocusedRowChanged: TNotifyEvent; + AOnCloseUp: cxLookupEdit.TcxLookupGridCloseUpEvent); +begin + Grid.OnClick := AOnClick; // not impl + if View <> nil then + begin +// View.OnFocusedRecordChanged := AOnFocusedRowChanged; + Grid.OnCloseUp := AOnCloseUp; + end; +end; + +procedure TcxExtLookupComboBoxProperties.LookupGridInitialize; +begin + if View = nil then + Exit; + // save options + FPrevPullFocusing := TcxCustomGridTableOptionsBehaviorAccess(View.OptionsBehavior).PullFocusing; + TcxCustomGridTableOptionsBehaviorAccess(View.OptionsBehavior).PullFocusing := True; + FPrevMultiSelect := View.OptionsSelection.MultiSelect; + View.OptionsSelection.MultiSelect := False; + FPrevImmediateEditor := View.OptionsBehavior.ImmediateEditor; + View.OptionsBehavior.ImmediateEditor := False; + if View is TcxGridTableView then + begin + FPrevColumnFiltering := TcxGridTableView(View).OptionsCustomize.ColumnFiltering; + if not FocusPopup then + TcxGridTableView(View).OptionsCustomize.ColumnFiltering := False; + end; + + Grid.FPrevOnKeyDown := View.OnKeyDown; + View.OnKeyDown := Grid.ViewKeyDown; + + Grid.FPrevOnMouseDown := View.OnMouseDown; + View.OnMouseDown := Grid.ViewMouseDown; + + Grid.FMousePos := Point(-1, -1); + Grid.FPrevOnMouseMove := View.OnMouseMove; + View.OnMouseMove := Grid.ViewMouseMove; + + Grid.FPrevOnMouseUp := View.OnMouseUp; + View.OnMouseUp := Grid.ViewMouseUp; + + Grid.Editable := FocusPopup; + Grid.Levels[0].GridView := View; + + FPrevIncSearch := View.OptionsBehavior.IncSearch; + if FocusPopup and AutoSearchOnPopup then + View.OptionsBehavior.IncSearch := True; + View.DataController.Search.Cancel; +end; + +procedure TcxExtLookupComboBoxProperties.LookupGridInitLookAndFeel(ALookAndFeel: TcxLookAndFeel; + AColor: TColor; AFont: TFont); +begin + Grid.LookAndFeel.MasterLookAndFeel := ALookAndFeel; + Grid.Color := AColor; + Grid.Font := AFont; +end; + +procedure TcxExtLookupComboBoxProperties.LookupGridLockMouseMove; +begin + Grid.PopupMouseMoveLocked := True; +end; + +procedure TcxExtLookupComboBoxProperties.LookupGridMakeFocusedRowVisible; +begin + if View <> nil then + View.Controller.MakeFocusedRecordVisible; +end; + +procedure TcxExtLookupComboBoxProperties.LookupGridUnlockMouseMove; +begin + Grid.MouseCapture := False; + Grid.PopupMouseMoveLocked := False; +end; + +// DBLookupGrid methods + +procedure TcxExtLookupComboBoxProperties.DBLookupGridBeginUpdate; +begin + if View <> nil then View.BeginUpdate; +end; + +procedure TcxExtLookupComboBoxProperties.DBLookupGridCheckColumnByFieldName(const AFieldName: string); +begin + if (View <> nil) and (DataController <> nil) then + begin + if (AFieldName <> '') and (DataController.GetItemByFieldName(AFieldName) = nil) then + with View.CreateItem do + begin + Index := 0; + DataController.ChangeFieldName(Index, AFieldName); + end; + end; +end; + +procedure TcxExtLookupComboBoxProperties.DBLookupGridCreateColumnsByFieldNames(const AFieldNames: string); +var + I: Integer; + AFieldNamesList: TStrings; +begin + if View <> nil then + begin + View.ClearItems; + AFieldNamesList := TStringList.Create; + try + GetFieldNames(AFieldNames, AFieldNamesList); + View.BeginUpdate; + try + for I := 0 to AFieldNamesList.Count - 1 do + DataController.ChangeFieldName(View.CreateItem.Index, AFieldNamesList[I]); + finally + View.EndUpdate; + end; + finally + AFieldNamesList.Free; + end; + end; +end; + +procedure TcxExtLookupComboBoxProperties.DBLookupGridEndUpdate; +begin + if View <> nil then View.EndUpdate; +end; + +function TcxExtLookupComboBoxProperties.GetDBLookupGridColumnField(AIndex: Integer): TField; +begin + if DataController <> nil then + Result := DataController.GetItemField(AIndex) + else + Result := nil; +end; + +function TcxExtLookupComboBoxProperties.GetDBLookupGridColumnFieldName(AIndex: Integer): string; +begin + if DataController <> nil then + Result := DataController.GetItemFieldName(AIndex) + else + Result := ''; +end; + +function TcxExtLookupComboBoxProperties.GetDBLookupGridColumnIndexByFieldName(const AFieldName: string): Integer; +var + AItem: TcxCustomGridTableItem; +begin + if DataController <> nil then + begin + AItem := TcxCustomGridTableItem(DataController.GetItemByFieldName(AFieldName)); + Result := AItem.Index; + end + else + Result := -1; +end; + +function TcxExtLookupComboBoxProperties.GetDBLookupGridDataController: TcxDBDataController; +begin + Result := TcxDBDataController(GetLookupGridDataController); +end; + +function TcxExtLookupComboBoxProperties.GetGrid: TcxExtLookupGrid; + + procedure CreateGrid; + begin + FGrid := TcxExtLookupGrid.Create(nil); + FGrid.IsPopupControl := True; + FGrid.BorderStyle := cxcbsNone; + FGrid.Levels.Add; + end; + +begin + if (FGrid = nil) and not FDestroying then + CreateGrid; + Result := FGrid; +end; + +function TcxExtLookupComboBoxProperties.GetGridMode: Boolean; +begin + Result := inherited IsUseLookupList; +end; + +function TcxExtLookupComboBoxProperties.GetListFieldIndex: Integer; +var + AItem: TcxCustomGridTableItem; +begin + if IsDefinedByLookup then + Result := GetDisplayColumnIndex + else + begin + AItem := ListFieldItem; + if AItem <> nil then + Result := AItem.Index + else + Result := -1; + end; +end; + +function TcxExtLookupComboBoxProperties.GetListFieldItem: TcxCustomGridTableItem; +begin + if IsDefinedByLookup then + Result := nil + else + Result := FListFieldItem; +end; + +procedure TcxExtLookupComboBoxProperties.SetGridMode(Value: Boolean); +begin + inherited IsUseLookupList := Value; +end; + +procedure TcxExtLookupComboBoxProperties.SetListFieldItem(Value: TcxCustomGridTableItem); +begin + if (View <> nil) and (View.IndexOfItem(Value) = -1) then + Value := nil; + if FListFieldItem <> Value then + begin + if FListFieldItem <> nil then + FreeNotificator.RemoveSender(FListFieldItem); + FListFieldItem := Value; + if FListFieldItem <> nil then + FreeNotificator.AddSender(FListFieldItem); + if not FInCheckListFieldItem then + Changed; + end; +end; + +procedure TcxExtLookupComboBoxProperties.SetView(Value: TcxCustomGridTableView); +begin + if (Value <> nil) and not IsViewSupported(Value) then Exit; + if FView <> Value then + begin + if FView <> nil then + UnlinkView(FView); + FView := Value; + if FView <> nil then + LinkView(FView); + Changed; + end; +end; + +{ TcxCustomExtLookupComboBox } + +class function TcxCustomExtLookupComboBox.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxExtLookupComboBoxProperties; +end; + +function TcxCustomExtLookupComboBox.CanDropDown: Boolean; +begin + if ActiveProperties.FocusPopup then + Result := True + else + Result := inherited CanDropDown; +end; + +function TcxCustomExtLookupComboBox.GetActiveProperties: TcxExtLookupComboBoxProperties; +begin + Result := TcxExtLookupComboBoxProperties(InternalGetActiveProperties); +end; + +function TcxCustomExtLookupComboBox.GetProperties: TcxExtLookupComboBoxProperties; +begin + Result := TcxExtLookupComboBoxProperties(FProperties); +end; + +procedure TcxCustomExtLookupComboBox.SetProperties(Value: TcxExtLookupComboBoxProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxDBExtLookupComboBox } + +class function TcxDBExtLookupComboBox.GetDataBindingClass: TcxEditDataBindingClass; +begin + Result := TcxDBLookupEditDataBinding; +end; + +function TcxDBExtLookupComboBox.GetDataBinding: TcxDBTextEditDataBinding; +begin + Result := TcxDBTextEditDataBinding(FDataBinding); +end; + +procedure TcxDBExtLookupComboBox.SetDataBinding(Value: TcxDBTextEditDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxDBExtLookupComboBox.CMGetDataLink(var Message: TMessage); +begin + Message.Result := Integer(GetcxDBEditDataLink(Self)); +end; + +{ TcxEditRepositoryExtLookupComboBoxItem } + +class function TcxEditRepositoryExtLookupComboBoxItem.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxExtLookupComboBoxProperties; +end; + +function TcxEditRepositoryExtLookupComboBoxItem.GetProperties: TcxExtLookupComboBoxProperties; +begin + Result := inherited Properties as TcxExtLookupComboBoxProperties; +end; + +procedure TcxEditRepositoryExtLookupComboBoxItem.SetProperties(Value: TcxExtLookupComboBoxProperties); +begin + inherited Properties := Value; +end; + +initialization + RegisterClasses([TcxEditRepositoryExtLookupComboBoxItem]); + GetRegisteredEditProperties.Register(TcxExtLookupComboBoxProperties, + cxSEditRepositoryExtLookupComboBoxItem); + +finalization + GetRegisteredEditProperties.Unregister(TcxExtLookupComboBoxProperties); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxDBGridConverter.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxDBGridConverter.pas new file mode 100644 index 00000000..1ef30372 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxDBGridConverter.pas @@ -0,0 +1,390 @@ +{*******************************************************************} +{ } +{ Developer Express Cross Platform Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL AND CLX CONTROLS AS PART OF AN EXECUTABLE } +{ PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} +unit cxDBGridConverter; + +interface + +{$I cxVer.inc} + +uses + Classes, SysUtils, cxConverterFactory, cxGridConverter, cxConverterUtils, + cxGridDBTableView, cxGridCustomView, DB, cxEdit, cxGraphics, cxButtonEdit, + cxDropDownEdit, cxTextEdit, cxDBLookupComboBox, cxStyles, Graphics, cxCustomConverter; + +type + + { TcxDBGridConverter } + TcxDBGridConverter = class(TcxCustomGridConverter) + private + FColor: Integer; + FFixedColor: Integer; + FFont: TFont; + FTitleFont: TFont; + function FindcxColumn(const AFieldName: string): TcxGridDBColumn; + function GetcxGridView: TcxGridDBTableView; + function GetFieldName(AColumn: TCollectionItem): string; + procedure ImportColumns; + procedure ImportColumnsStyles; + procedure ImportGrid; + procedure ImportGridStyles; + protected + procedure DoRealImport; override; + procedure DoImportStyles; override; + function GetGridViewClass: TcxCustomGridViewClass; override; + property cxGridView: TcxGridDBTableView read GetcxGridView; + public + class function GetSourceClassName: string; override; + end; + +implementation + +uses cxGridTableView, Windows; + +type + TcxCustomEditPropertiesAccessor = class(TcxCustomEditProperties); + +{ TcxDBGridConverter } + +class function TcxDBGridConverter.GetSourceClassName: string; +begin + Result := 'TDBGrid'; +end; + +procedure TcxDBGridConverter.DoRealImport; +begin + cxGridView.DataController.DataSource := GetClassProperty(nil, 'DataSource') as TDataSource; + ImportColumns; + ImportGrid; +end; + +procedure TcxDBGridConverter.DoImportStyles; +begin + ImportGridStyles; + ImportColumnsStyles; +end; + +function TcxDBGridConverter.GetGridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridDBTableView; +end; + +function TcxDBGridConverter.FindcxColumn(const AFieldName: string): TcxGridDBColumn; +var + I: Integer; +begin + Result := nil; + with cxGridView do + begin + for I := 0 to ColumnCount do + if Columns[I].DataBinding.FieldName = AFieldName then + begin + Result := Columns[I]; + Exit; + end; + end; +end; + +function TcxDBGridConverter.GetcxGridView: TcxGridDBTableView; +begin + Result := inherited cxGridView as TcxGridDBTableView; +end; + +function TcxDBGridConverter.GetFieldName(AColumn: TCollectionItem): string; +begin +{$IFDEF DELPHI10} + Result := GetWideStringProperty(AColumn, 'FieldName', 'Field' + IntToStr(AColumn.Index)); +{$ELSE} + Result := GetStringProperty(AColumn, 'FieldName', 'Field' + IntToStr(AColumn.Index)); +{$ENDIF} +end; + +{function TcxDBGridConverter.GetDefaultColumnName: string; +begin + Result := 'DBColumn'; +end;} + +procedure TcxDBGridConverter.ImportColumns; +var + AColumns: TObject; + AObject: TObject; + ATitle: TObject; + AcxColumn: TcxGridDBColumn; + AButtonStyle: string; + AReadOnly: Boolean; + AAlignment: TAlignment; + AFieldName: string; + I, J: Integer; + ADataSource: TDataSource; + AField: TField; + AButtonEditProperties: TcxButtonEditProperties; + AComboBoxProperties: TcxComboBoxProperties; + ALookupComboBoxProperties: TcxLookupComboBoxProperties; +begin + AColumns := GetClassProperty(nil, 'Columns'); + if AColumns <> nil then + begin + if AColumns is TCollection then + with TCollection(AColumns) do + begin + for I := 0 to Count - 1 do + begin + AcxColumn := cxGridView.CreateColumn; + AFieldName := GetFieldName(Items[I]); + AButtonStyle := GetEnumProperty(Items[I], 'ButtonStyle'); + if AButtonStyle = 'cbsAuto' then + begin + ADataSource := GetClassProperty(nil, 'DataSource') as TDataSource; + AField := nil; + if ADataSource <> nil then + begin + if ADataSource.DataSet <> nil then + with ADataSource.DataSet.Fields do + begin + for J := 0 to Count - 1 do + if Fields[J].FieldName = AFieldName then + begin + AField := Fields[J]; + Break; + end; + end; + end; + if (AField <> nil) and (AField.FieldKind = fkLookup) then + begin + AcxColumn.PropertiesClass := TcxLookupComboBoxProperties; + ALookupComboBoxProperties := TcxLookupComboBoxProperties(AcxColumn.Properties); + ALookupComboBoxProperties.DropDownRows := GetIntegerProperty(Items[I], + 'DropDownRows', ALookupComboBoxProperties.DropDownRows); + ALookupComboBoxProperties.ReadOnly := GetBooleanProperty(Items[I], + 'ReadOnly', ALookupComboBoxProperties.ReadOnly); + end + else + begin + AObject := GetClassProperty(Items[I], 'PickList'); + if AObject <> nil then + begin + if (AObject as TStrings).Count > 0 then + begin + AcxColumn.PropertiesClass := TcxComboBoxProperties; + AComboBoxProperties := TcxComboBoxProperties(AcxColumn.Properties); + for J := 0 to (AObject as TStrings).Count - 1 do + AComboBoxProperties.Items.Add((AObject as TStrings)[J]); + AComboBoxProperties.ReadOnly := GetBooleanProperty( + TCollection(AColumns).Items[I], 'ReadOnly', AComboBoxProperties.ReadOnly); + AComboBoxProperties.Alignment.Horz := + ConvertAlignment(GetEnumProperty(TCollection(AColumns).Items[I], 'Alignment')); + AComboBoxProperties.DropDownRows := + GetIntegerProperty(TCollection(AColumns).Items[I], 'DropDownRows', AComboBoxProperties.DropDownRows); + end + else + begin + AReadOnly := GetBooleanProperty(Items[I], 'ReadOnly', False); + AAlignment := ConvertAlignment(GetEnumProperty(Items[I], 'Alignment')); + if AReadOnly or (AAlignment <> taLeftJustify) then + begin + AcxColumn.PropertiesClass := TcxTextEditProperties; + TcxTextEditProperties(AcxColumn.Properties).ReadOnly := AReadOnly; + TcxTextEditProperties(AcxColumn.Properties).Alignment.Horz := AAlignment; + end; + end; + end; + end; + end + else if AButtonStyle = 'cbsEllipsis' then + begin + AcxColumn.PropertiesClass := TcxButtonEditProperties; + AButtonEditProperties := TcxButtonEditProperties(AcxColumn.Properties); + AButtonEditProperties.ReadOnly := GetBooleanProperty(Items[I], + 'ReadOnly', AButtonEditProperties.ReadOnly); + AButtonEditProperties.Alignment.Horz := + ConvertAlignment(GetEnumProperty(Items[I], 'Alignment')); + end + else + begin + AReadOnly := GetBooleanProperty(Items[I], 'ReadOnly', False); + AAlignment := ConvertAlignment(GetEnumProperty(Items[I], 'Alignment')); + if AReadOnly or (AAlignment <> taLeftJustify) then + begin + AcxColumn.PropertiesClass := TcxTextEditProperties; + TcxTextEditProperties(AcxColumn.Properties).ReadOnly := AReadOnly; + TcxTextEditProperties(AcxColumn.Properties).Alignment.Horz := AAlignment; + end; + end; + AcxColumn.DataBinding.FieldName := AFieldName; + AcxColumn.Name := UniqueColumnName(AcxColumn, AcxColumn.DataBinding.FieldName); + ATitle := GetClassProperty(Items[I], 'Title'); + if ATitle <> nil then + begin + AcxColumn.Caption := GetStringProperty(ATitle, 'Caption', AcxColumn.Caption); + AcxColumn.HeaderAlignmentHorz := ConvertAlignment(GetEnumProperty(ATitle, 'Alignment')); + end; + AcxColumn.Visible := GetBooleanProperty(Items[I], 'Visible', AcxColumn.Visible); + AcxColumn.Width := GetIntegerProperty(Items[I], 'Width', AcxColumn.Width); + end; + end; + end; +end; + +procedure TcxDBGridConverter.ImportColumnsStyles; +var + AColumns: TObject; + AColumnTitle: TObject; + AcxColumn: TcxGridDBColumn; + I: Integer; + AStyle: TcxCustomStyle; + AColor: Integer; + AFont: TFont; +begin + AColumns := GetClassProperty(nil, 'Columns'); + if AColumns <> nil then + begin + if AColumns is TCollection then + with TCollection(AColumns) do + begin + for I := 0 to Count - 1 do + begin + AcxColumn := FindcxColumn(GetFieldName(Items[I])); + if AcxColumn <> nil then + begin + AColor := GetIntegerProperty(Items[I], 'Color'); + AFont := GetClassProperty(Items[I], 'Font') as TFont; + if ((AColor <> clWindow) and (AColor <> FColor)) or + (not DefaultFont(AFont) and not CompareFonts(AFont, FFont)) then + begin + AStyle := CreateStyleItem; + (AStyle as TcxStyle).Color := AColor; + (AStyle as TcxStyle).Font.Assign(AFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + AcxColumn.Styles.Content := AStyle as TcxStyle; + end; + AColumnTitle := GetClassProperty(Items[I], 'Title'); + if AColumnTitle <> nil then + begin + AColor := GetIntegerProperty(AColumnTitle, 'Color'); + AFont := GetClassProperty(AColumnTitle, 'Font') as TFont; + if ((AColor <> clBtnFace) and (AColor <> FFixedColor)) or + (not DefaultFont(AFont) and not CompareFonts(AFont, FTitleFont)) then + begin + AStyle := CreateStyleItem; + (AStyle as TcxStyle).Color := AColor; + (AStyle as TcxStyle).Font.Assign(AFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + AcxColumn.Styles.Header := AStyle as TcxStyle; + end; + end; + end; + end; + end; + end; +end; + +procedure TcxDBGridConverter.ImportGrid; +var + AOptions: TStringList; + I: Integer; +begin + AOptions := TStringList.Create; + try + EnablePropertyException; + try + GetSetProperty(nil, 'Options', AOptions); + AOptions.Sort; + with cxGridView do + begin + OptionsData.Editing := AOptions.Find('dgEditing', I); + OptionsBehavior.AlwaysShowEditor := AOptions.Find('dgAlwaysShowEditor', I); + OptionsView.Indicator := AOptions.Find('dgIndicator', I); + OptionsCustomize.ColumnHorzSizing := AOptions.Find('dgColumnResize', I); + if AOptions.Find('dgColLines', I) then + begin + if AOptions.Find('dgRowLines', I) then + OptionsView.GridLines := glBoth + else + OptionsView.GridLines := glVertical; + end + else + begin + if AOptions.Find('dgRowLines', I) then + OptionsView.GridLines := glHorizontal + else + OptionsView.GridLines := glNone; + end; + OptionsData.DeletingConfirmation := AOptions.Find('dgConfirmDelete', I); + OptionsData.CancelOnExit := AOptions.Find('dgCancelOnExit', I); + OptionsSelection.MultiSelect := AOptions.Find('dgMultiSelect', I); + OptionsSelection.CellSelect := not AOptions.Find('dgRowSelect', I); + OptionsView.Header := AOptions.Find('dgTitles', I); + OptionsBehavior.FocusCellOnTab := AOptions.Find('dgTabs', I); + OptionsSelection.HideSelection := not AOptions.Find('dgAlwaysShowSelection', I); + end; + except + on EcxUnknownProperty do; + end; + finally + AOptions.Free; + DisablePropertyException; + end; +end; + +procedure TcxDBGridConverter.ImportGridStyles; +var + AStyle: TcxCustomStyle; +begin + FColor := GetIntegerProperty(nil, 'Color'); + FFont := GetClassProperty(nil, 'Font') as TFont; + if (FColor <> clWindow) or not DefaultFont(FFont) then + begin + AStyle := CreateStyleItem; + (AStyle as TcxStyle).Color := FColor; + (AStyle as TcxStyle).Font.Assign(FFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + cxGridView.Styles.Content := AStyle as TcxStyle; + end; + FFixedColor := GetIntegerProperty(nil, 'FixedColor'); + FTitleFont := GetClassProperty(nil, 'TitleFont') as TFont; + if (FFixedColor <> clBtnFace) or not DefaultFont(FTitleFont) then + begin + AStyle := CreateStyleItem; + (AStyle as TcxStyle).Color := FFixedColor; + (AStyle as TcxStyle).Font.Assign(FTitleFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + cxGridView.Styles.Header := AStyle as TcxStyle; + cxGridView.Styles.Indicator := AStyle as TcxStyle; + end; +end; + +initialization + ConverterFactory(cxGridGroupConverterName).RegisterConverter('DB Grid Converter', TcxDBGridConverter); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxDXGridConverter.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxDXGridConverter.pas new file mode 100644 index 00000000..6c9c47c9 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxDXGridConverter.pas @@ -0,0 +1,1810 @@ +{*******************************************************************} +{ } +{ Developer Express Cross Platform Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL AND CLX CONTROLS AS PART OF AN EXECUTABLE } +{ PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} +unit cxDXGridConverter; + +interface + +{$I cxVer.inc} + +uses + Forms, Classes, SysUtils, cxConverterFactory, cxGridConverter, cxGridCustomView, + cxGridDBTableView, cxGridDBBandedTableView, cxGridBandedTableView, DB, Controls, + cxCustomData, cxGraphics, cxGridCustomTableView, cxFilter, cxGrid, cxLookAndFeels, + cxEdit, cxBlobEdit, cxButtonEdit, cxCalc, cxCalendar, cxCheckBox, cxCurrencyEdit, + cxDropDownEdit, cxHyperLinkEdit, cxImage, cxImageComboBox, cxDBLookupComboBox, + cxMaskEdit, cxMemo, cxMRUEdit, cxSpinEdit, cxTimeEdit, cxTextEdit, StdCtrls, Graphics, + cxGridTableView, cxDBData, cxStyles, cxConverterUtils, cxCustomConverter, + cxPropertiesConverters; + +type + { TcxDXGridConverter } + TcxDXGridConverter = class(TcxCustomGridConverter) + protected + procedure DoRealImport; override; + procedure DoImportStyles; override; + function GetGridViewClass: TcxCustomGridViewClass; override; + public + class function GetSourceClassName: string; override; + end; + + { TcxDXGridLayoutConverter } + TcxDXGridLayoutConverter = class(TcxDXGridConverter) + private + FdxDBGrid: TComponent; + FComponent: TComponent; + protected + procedure DoRealImport; override; + function GetGridViewClass: TcxCustomGridViewClass; override; + procedure PostImport; override; + procedure PreImport; override; + function TestIntermediary: Boolean; override; + public + class function GetIntermediaryClassName: string; override; + class function GetSourceClassName: string; override; + end; + +implementation + +type + { TcxRealConverterToTableView } + TcxRealConverterToTableView = class + private + FColor: Integer; + FFont: TFont; + FHeaderColor: Integer; + FHeaderFont: TFont; + FcxSummaryGroups: TStringList; + function DefaultPreviewFont(AFont: TFont): Boolean; + function GetColumn(const AName: string): TComponent; + procedure GetColumns(AColumns: TList); + function GetCXColumnByFieldName(const AFieldName: string): TcxGridDBColumn; + function GetcxGrid: TcxCustomGrid; + function GetcxGridView: TcxGridTableView; + protected + Converter: TcxDXGridConverter; + procedure AssignColumn(AColumn: TcxGridColumn; ADXColumn: TObject; AIndex: Integer); virtual; + procedure AssignDXOptionsView(AList: TStringList); virtual; + procedure AssignGrid; virtual; + procedure AssignSummaryItem(AColumn: TcxGridColumn; ADXColumn: TObject); virtual; + function CreateColumn: TcxGridColumn; virtual; + function ConvertColumnShowEditButtons(const AStyle: string): TcxGridItemShowEditButtons; + function GetSummaryKind(const AType: string): TcxSummaryKind; + procedure ImportAutoDataSetFilter(const AValue: Boolean); virtual; + procedure ImportColumn(AdxColumn: TObject; AcxColumn: TcxGridColumn); + procedure ImportColumns; + procedure ImportColumnsStyles; + procedure ImportColumnSummaryGroups; virtual; + procedure ImportDXFilter; + procedure ImportDXOptionsBehavior; + procedure ImportDXOptionsCustomize; virtual; + procedure ImportDXOptionsDB; + procedure ImportDXOptionsView; + procedure ImportGrid; + procedure ImportGridStyles; + procedure ImportPreview; + procedure ImportPropertiesBlobEdit(AdxColumn: TObject; AcxColumn: TcxGridColumn); + procedure ImportPropertiesButtonEdit(AdxColumn: TObject; AcxColumn: TcxGridColumn); + procedure ImportPropertiesCalcEdit(AdxColumn: TObject; AcxColumn: TcxGridColumn); + procedure ImportPropertiesCheckBox(AdxColumn: TObject; AcxColumn: TcxGridColumn); + procedure ImportPropertiesComboBox(AdxColumn: TObject; AcxColumn: TcxGridColumn); + procedure ImportPropertiesCurencyEdit(AdxColumn: TObject; AcxColumn: TcxGridColumn); + procedure ImportPropertiesDateEdit(AdxColumn: TObject; AcxColumn: TcxGridColumn); + procedure ImportPropertiesHyperLinkEdit(AdxColumn: TObject; AcxColumn: TcxGridColumn); + procedure ImportPropertiesImage(AdxColumn: TObject; AcxColumn: TcxGridColumn); + procedure ImportPropertiesImageComboBox(AdxColumn: TObject; AcxColumn: TcxGridColumn); + procedure ImportPropertiesLookupComboBox(AdxColumn: TObject; AcxColumn: TcxGridColumn); + procedure ImportPropertiesExLookupComboBox(AdxColumn: TObject; AcxColumn: TcxGridColumn); + procedure ImportPropertiesMaskEdit(AdxColumn: TObject; AcxColumn: TcxGridColumn); + procedure ImportPropertiesMemo(AdxColumn: TObject; AcxColumn: TcxGridColumn); + procedure ImportPropertiesMRUEdit(AdxColumn: TObject; AcxColumn: TcxGridColumn); + procedure ImportPropertiesPopupEdit(AdxColumn: TObject; AcxColumn: TcxGridColumn); + procedure ImportPropertiesSpinEdit(AdxColumn: TObject; AcxColumn: TcxGridColumn); + procedure ImportPropertiesTextEdit(AdxColumn: TObject; AcxColumn: TcxGridColumn); + procedure ImportPropertiesTimeEdit(AdxColumn: TObject; AcxColumn: TcxGridColumn); + procedure ImportSummaryGroups; virtual; + procedure ImportSyncMode(const AValue: Boolean); virtual; + function TestPreviewFieldName(AIndex: Integer; const APreview: string): Boolean; virtual; + property cxGrid: TcxCustomGrid read GetcxGrid; + property cxGridView: TcxGridTableView read GetcxGridView; + public + constructor Create(AConverter: TcxDXGridConverter); + destructor Destroy; override; + procedure DoImport; virtual; + procedure DoImportStyles; virtual; + end; + + { TcxRealConverterToBandedTableView } + TcxRealConverterToBandedTableView = class(TcxRealConverterToTableView) + private + FBandHeaderWidth: Boolean; + function GetCXColumnByFieldName(const AFieldName: string): TcxGridDBBandedColumn; + function GetcxGridView: TcxGridBandedTableView; + protected + procedure AssignColumn(AColumn: TcxGridColumn; ADXColumn: TObject; AIndex: Integer); override; + procedure ImportAutoDataSetFilter(const AValue: Boolean); override; + procedure ImportColumnSummaryGroups; override; + procedure ImportDXOptionsCustomize; override; + procedure AssignDXOptionsView(AList: TStringList); override; + procedure AssignGrid; override; + procedure AssignSummaryItem(AColumn: TcxGridColumn; ADXColumn: TObject); override; + function CreateColumn: TcxGridColumn; override; + procedure ImportColumnsStyles; + procedure ImportBands; + procedure ImportBandsStyles; + procedure ImportSummaryGroups; override; + procedure ImportSyncMode(const AValue: Boolean); override; + function TestPreviewFieldName(AIndex: Integer; const APreview: string): Boolean; override; + property cxGridView: TcxGridBandedTableView read GetcxGridView; + public + procedure DoImport; override; + procedure DoImportStyles; override; + end; + + { TcxDXGridLayoutDataReader } + TcxDXGridLayoutDataReader = class(TReader) + protected + procedure SetName(Component: TComponent; var Name: string); override; + end; + + { TcxDXGridLayoutDummy } + TcxDXGridLayoutDummy = class(TComponent) + private + FComponent: TComponent; + FdxDBGrid: TComponent; + FIntermediary: TComponent; + procedure ReadData(Stream: TStream); + protected + procedure DefineProperties(Filer: TFiler); override; + public + constructor Create(AOwner: TComponent); override; + property Component: TComponent read FComponent write FComponent; + property dxDBGrid: TComponent read FdxDBGrid write FdxDbGrid; + property Intermediary: TComponent read FIntermediary write FIntermediary; + end; + +{ TcxRealConverterToTableView } + +constructor TcxRealConverterToTableView.Create(AConverter: TcxDXGridConverter); +begin + FcxSummaryGroups := TStringList.Create; + Converter := AConverter; +end; + +destructor TcxRealConverterToTableView.Destroy; +begin + FcxSummaryGroups.Free; + inherited Destroy; +end; + +procedure TcxRealConverterToTableView.DoImport; +begin + TcxGridDBTableView(cxGridView).DataController.DataSource := + Converter.GetClassProperty(nil, 'DataSource') as TDataSource; + ImportDXOptionsView; + ImportDXFilter; + ImportColumns; + TcxGridDBTableView(cxGridView).DataController.KeyFieldNames := + Converter.GetStringProperty(nil, 'KeyField', ''); + ImportGrid; +end; + +procedure TcxRealConverterToTableView.DoImportStyles; +begin + ImportGridStyles; + ImportColumnsStyles; +end; + +procedure TcxRealConverterToTableView.AssignColumn(AColumn: TcxGridColumn; ADXColumn: TObject; + AIndex: Integer); +var + ASortOrder: string; +begin + with TcxGridDBColumn(AColumn) do + begin + DataBinding.FieldName := Converter.GetStringProperty(ADXColumn, 'FieldName', 'Field' + IntToStr(AIndex)); + Name := Converter.UniqueColumnName(AColumn, DataBinding.FieldName); + Caption := Converter.GetStringProperty(ADXColumn, 'Caption', Caption); + Visible := Converter.GetBooleanProperty(ADXColumn, 'Visible', Visible); + GroupIndex := Converter.GetIntegerProperty(ADXColumn, 'GroupIndex', GroupIndex); + Width := Converter.GetIntegerProperty(ADXColumn, 'Width', Width); + ASortOrder := Converter.GetEnumProperty(ADXColumn, 'Sorted'); + if ASortOrder = 'csDown' then + SortOrder := soDescending + else if ASortOrder = 'csNone' then + SortOrder := soNone + else if ASortOrder = 'csUp' then + SortOrder := soAscending; + Options.Moving := not Converter.GetBooleanProperty(ADXColumn, 'DisableDragging', Options.Moving); + Options.Editing := not Converter.GetBooleanProperty(ADXColumn, 'DisableEditor', Options.Editing); + Options.Grouping := not Converter.GetBooleanProperty(ADXColumn, 'DisableGrouping', Options.Grouping); + Options.Focusing := True; + Options.Filtering := cxGridView.DataController.Filter.Active; + Options.HorzSizing := Converter.GetBooleanProperty(ADXColumn, 'Sizing', Options.HorzSizing); + HeaderAlignmentHorz := ConvertAlignment(Converter.GetEnumProperty(ADXColumn, 'HeaderAlignment')); + MinWidth := Converter.GetIntegerProperty(ADXColumn, 'MinWidth', MinWidth); + Tag := Converter.GetIntegerProperty(ADXColumn, 'Tag', Tag); + AssignSummaryItem(AColumn, ADXColumn); + ImportColumn(ADXColumn, AColumn); + end; +end; + +procedure TcxRealConverterToTableView.AssignDXOptionsView(AList: TStringList); +var + I: Integer; +begin + with cxGridView do + begin + OptionsView.Indicator := AList.Find('edgoIndicator', I); + OptionsView.CellAutoHeight := AList.Find('edgoRowAutoHeight', I); + OptionsView.HeaderAutoHeight := AList.Find('edgoAutoHeaderPanelHeight', I); + OptionsView.ColumnAutoWidth := AList.Find('edgoAutoWidth', I); + OptionsSelection.HideFocusRect := AList.Find('edgoHideFocusRect', I); + OptionsSelection.CellSelect := not AList.Find('edgoRowSelect', I); + OptionsSelection.InvertSelect := AList.Find('edgoInvertSelect', I); + OptionsView.GroupFooters := gfVisibleWhenExpanded; + Preview.Visible := AList.Find('edgoPreview', I); + if AList.Find('edgoShowButtonAlways', I) then + OptionsView.ShowEditButtons := gsebForFocusedRecord + else + OptionsView.ShowEditButtons := gsebNever; + end; +end; + +procedure TcxRealConverterToTableView.AssignGrid; +var + ALookAndFeel: string; +begin + with cxGridView do + begin + if Converter.GetBooleanProperty(nil, 'ShowGrid', False) then + OptionsView.GridLines := glBoth + else + OptionsView.GridLines := glNone; + OptionsView.Header := Converter.GetBooleanProperty(nil, 'ShowHeader', OptionsView.Header); + OptionsView.NewItemRow := Converter.GetBooleanProperty(nil, 'ShowNewItemRow', OptionsView.NewItemRow); + OptionsView.Footer := Converter.GetBooleanProperty(nil, 'ShowSummaryFooter', OptionsView.Footer); + OptionsView.IndicatorWidth := Converter.GetIntegerProperty(nil, 'GrIndicatorWidth', OptionsView.IndicatorWidth); + OptionsSelection.HideSelection := Converter.GetBooleanProperty(nil, 'HideSelection', OptionsSelection.HideSelection); + Preview.LeftIndent := Converter.GetIntegerProperty(nil, 'IndentDesc', Preview.LeftIndent); + ALookAndFeel := Converter.GetEnumProperty(nil, 'LookAndFeel'); + if ALookAndFeel = 'lfFlat' then + cxGrid.LookAndFeel.Kind := lfFlat + else if ALookAndFeel = 'lfStandard' then + cxGrid.LookAndFeel.Kind := lfStandard + else if ALookAndFeel = 'lfUltraFlat' then + cxGrid.LookAndFeel.Kind := lfUltraFlat; + OptionsView.GroupByBox := Converter.GetBooleanProperty(nil, 'ShowGroupPanel', OptionsView.GroupByBox); + end; +end; + +procedure TcxRealConverterToTableView.AssignSummaryItem(AColumn: TcxGridColumn; ADXColumn: TObject); +var + ASummaryFooterType: string; + AcxSummaryFooterItem: TcxGridDBTableSummaryItem; +begin + ASummaryFooterType := Converter.GetEnumProperty(ADXColumn, 'SummaryFooterType', 'cstNone'); + if ASummaryFooterType <> 'cstNone' then + begin + AcxSummaryFooterItem := TcxGridDBTableSummaryItem( + TcxGridDBTableView(cxGridView).DataController.Summary.FooterSummaryItems.Add); + AcxSummaryFooterItem.FieldName := Converter.GetStringProperty(ADXColumn, 'SummaryFooterField', ''); + AcxSummaryFooterItem.Format := Converter.GetStringProperty(ADXColumn, 'SummaryFooterFormat', AcxSummaryFooterItem.Format); + AcxSummaryFooterItem.Kind := GetSummaryKind(ASummaryFooterType); + AcxSummaryFooterItem.Column := TcxGridDBColumn(AColumn); + end; +end; + +function TcxRealConverterToTableView.CreateColumn: TcxGridColumn; +begin + Result := TcxGridDBTableView(cxGridView).CreateColumn; +end; + +procedure TcxRealConverterToTableView.ImportAutoDataSetFilter(const AValue: Boolean); +begin + TcxGridDBTableView(cxGridView).DataController.Filter.AutoDataSetFilter := AValue; +end; + +procedure TcxRealConverterToTableView.ImportColumn(AdxColumn: TObject; AcxColumn: TcxGridColumn); +begin + if AdxColumn.ClassName = 'TdxDBGridColumn' then + ImportPropertiesTextEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBGridMaskColumn' then + ImportPropertiesMaskEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBGridButtonColumn' then + ImportPropertiesButtonEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBGridDateColumn' then + ImportPropertiesDateEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBGridCheckColumn' then + ImportPropertiesCheckBox(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBGridImageColumn' then + ImportPropertiesImageComboBox(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBGridSpinColumn' then + ImportPropertiesSpinEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBGridLookupColumn' then + ImportPropertiesLookupComboBox(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBGridPickColumn' then + ImportPropertiesComboBox(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBGridCalcColumn' then + ImportPropertiesCalcEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBGridBlobColumn' then + ImportPropertiesBlobEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBGridHyperLinkColumn' then + ImportPropertiesHyperLinkEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBGridTimeColumn' then + ImportPropertiesTimeEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBGridCurrencyColumn' then + ImportPropertiesCurencyEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBGridMemoColumn' then + ImportPropertiesMemo(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBGridGraphicColumn' then + ImportPropertiesImage(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBGridMRUColumn' then + ImportPropertiesMRUEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBGridPopupColumn' then + ImportPropertiesPopupEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBGridExtLookupColumn' then + ImportPropertiesExLookupComboBox(AdxColumn, AcxColumn); +end; + +procedure TcxRealConverterToTableView.ImportColumns; +var + AColumns: TList; + I: Integer; +begin + AColumns := TList.Create; + try + GetColumns(AColumns); + for I := 0 to AColumns.Count - 1 do + AssignColumn(CreateColumn, AColumns[I], I); + finally + AColumns.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportColumnsStyles; +var + AColumns: TList; + AColumn: TcxGridDBColumn; + I: Integer; + AColor: Integer; + AFont: TFont; + AStyle: TcxCustomStyle; +begin + AColumns := TList.Create; + try + GetColumns(AColumns); + for I := 0 to AColumns.Count - 1 do + begin + AColumn := GetCXColumnByFieldName(Converter.GetStringProperty(AColumns[I], 'FieldName', '')); + AColor := Converter.GetIntegerProperty(TComponent(AColumns[I]), 'Color'); + AFont := Converter.GetClassProperty(TComponent(AColumns[I]), 'Font') as TFont; + if ((AColor <> clWindow) and (AColor <> FColor)) or + (not DefaultFont(AFont) and not CompareFonts(AFont, FFont)) then + begin + AStyle := Converter.CreateStyleItem; + (AStyle as TcxStyle).Color := AColor; + (AStyle as TcxStyle).Font.Assign(AFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + AColumn.Styles.Content := AStyle as TcxStyle; + end; + end; + finally + AColumns.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportColumnSummaryGroups; +var + AColumns: TList; + AColumn: TcxGridDBColumn; + ASummaryField: string; + ASummaryFormat: string; + ASummaryGroupName: string; + ASummaryType: string; + ASummaryGroup: TcxDataSummaryGroup; + ASummaryItem: TcxGridDBTableSummaryItem; + ALink: TcxGridTableSummaryGroupItemLink; + AIndex: Integer; + I: Integer; +begin + AColumns := TList.Create; + try + GetColumns(AColumns); + for I := 0 to AColumns.Count - 1 do + begin + AColumn := GetCXColumnByFieldName(Converter.GetStringProperty(AColumns[I], 'FieldName', '')); + if AColumn = nil then + Continue; + ASummaryField := Converter.GetStringProperty(TComponent(AColumns[I]), 'SummaryField', ''); + ASummaryFormat := Converter.GetStringProperty(TComponent(AColumns[I]), 'SummaryFormat', ''); + ASummaryType := Converter.GetEnumProperty(TComponent(AColumns[I]), 'SummaryType'); + ASummaryGroupName := Converter.GetStringProperty(TComponent(AColumns[I]), 'SummaryGroupName', ''); + if ASummaryGroupName <> '' then + begin + if FcxSummaryGroups.Find(ASummaryGroupName, AIndex) then + begin + ASummaryGroup := TcxDataSummaryGroup(FcxSummaryGroups.Objects[AIndex]); + ALink := TcxGridTableSummaryGroupItemLink(ASummaryGroup.Links.Add); + ALink.Column := AColumn; + end; + end; + if (ASummaryField <> '') and (ASummaryType <> 'cstNone') then + begin + ASummaryGroup := cxGridView.DataController.Summary.SummaryGroups.Add; + ASummaryItem := TcxGridDBTableSummaryItem(ASummaryGroup.SummaryItems.Add); + ASummaryItem.FieldName := ASummaryField; + ASummaryItem.Format := ASummaryFormat; + ASummaryItem.Kind := GetSummaryKind(ASummaryType); + ALink := TcxGridTableSummaryGroupItemLink(ASummaryGroup.Links.Add); + ALink.Column := AColumn; + end; + end; + finally + AColumns.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportDXFilter; +var + AFilter: TObject; + AStatus: string; + AFilterOptions: TcxFilterCriteriaOptions; +begin + AFilter := Converter.GetClassProperty(nil, 'Filter'); + if AFilter <> nil then + begin + cxGridView.Filtering.DropDownWidth := + Converter.GetIntegerProperty(AFilter, 'DropDownWidth', cxGridView.Filtering.DropDownWidth); + cxGridView.DataController.Filter.MaxValueListCount := + Converter.GetIntegerProperty(AFilter, 'MaxDropDownCount', cxGridView.DataController.Filter.MaxValueListCount); + cxGridView.Filtering.MaxDropDownCount := Converter.GetIntegerProperty(AFilter, 'DropDownCount', + cxGridView.Filtering.MaxDropDownCount); + AStatus := Converter.GetEnumProperty(AFilter, 'FilterStatus'); + if AStatus = 'fsAlways' then + cxGridView.Filtering.Visible := fvAlways + else if AStatus = 'fsAuto' then + cxGridView.Filtering.Visible := fvNonEmpty + else if AStatus = 'fsNone' then + cxGridView.Filtering.Visible := fvNever; + cxGridView.DataController.Filter.Active := Converter.GetBooleanProperty(AFilter, 'Active', cxGridView.DataController.Filter.Active); + ImportAutoDatasetFilter(Converter.GetBooleanProperty(AFilter, 'AutoDataSetFilter', False)); + AFilterOptions := cxGridView.DataController.Filter.Options; + if Converter.GetBooleanProperty(AFilter, 'CaseInsensitive', False) then + Include(AFilterOptions, fcoCaseInsensitive); + cxGridView.DataController.Filter.Options := AFilterOptions; + end; +end; + +procedure TcxRealConverterToTableView.ImportDXOptionsBehavior; +var + AList: TStringList; + I: Integer; + AOptions: TcxDataControllerOptions; +begin + AList := TStringList.Create; + try + Converter.EnablePropertyException; + try + Converter.GetSetProperty(nil, 'OptionsBehavior', AList); + AList.Sort; + with cxGridView do + begin + OptionsData.Editing := AList.Find('edgoEditing', I); + OptionsBehavior.ImmediateEditor := AList.Find('edgoImmediateEditor', I); + OptionsSelection.MultiSelect := AList.Find('edgoMultiSelect', I); + OptionsBehavior.GoToNextCellOnEnter := AList.Find('edgoEnterThrough', I); + OptionsBehavior.FocusCellOnTab := AList.Find('edgoTabs', I); + OptionsBehavior.FocusCellOnCycle := not Alist.Find('edgoTabThrough', I); + AOptions := DataController.Options; + if AList.Find('edgoAnsiSort', I) then + Include(AOptions, dcoAnsiSort); + if AList.Find('edgoCaseInsensitive', I) then + Include(AOptions, dcoCaseInsensitive); + DataController.Options := AOptions; + OptionsBehavior.IncSearch := AList.Find('edgoAutoSearch', I); + end; + except + on EcxUnknownProperty do; + end; + finally + AList.Free; + Converter.DisablePropertyException; + end; +end; + +procedure TcxRealConverterToTableView.ImportDXOptionsCustomize; +var + AList: TStringList; + I: Integer; +begin + AList := TStringList.Create; + try + Converter.EnablePropertyException; + try + Converter.GetSetProperty(nil, 'OptionsCustomize', AList); + AList.Sort; + with cxGridView do + begin + OptionsCustomize.ColumnMoving := AList.Find('edgoColumnMoving', I); + OptionsCustomize.ColumnHorzSizing := AList.Find('edgoColumnSizing', I); + OptionsCustomize.ColumnHiding := AList.Find('edgoExtCustomizing', I); + end; + except + on EcxUnknownProperty do; + end; + finally + AList.Free; + Converter.DisablePropertyException; + end; +end; + +procedure TcxRealConverterToTableView.ImportDXOptionsDB; +var + AList: TStringList; + I: Integer; +begin + AList := TStringList.Create; + try + Converter.EnablePropertyException; + try + Converter.GetSetProperty(nil, 'OptionsDB', AList); + AList.Sort; + with cxGridView do + begin + OptionsData.Appending := AList.Find('edgoCanAppend', I); + OptionsData.CancelOnExit := AList.Find('edgoCancelOnExit', I); + OptionsData.Deleting := AList.Find('edgoCanDelete', I); + OptionsData.Inserting := AList.Find('edgoCanInsert', I); + OptionsData.DeletingConfirmation := AList.Find('edgoConfirmDelete', I); + OptionsBehavior.FocusFirstCellOnNewRecord := AList.Find('edgoResetColumnFocus', I); + ImportSyncMode(AList.Find('edgoCanNavigation', I)); + end; + except + on EcxUnknownProperty do; + end; + finally + AList.Free; + Converter.DisablePropertyException; + end; +end; + +procedure TcxRealConverterToTableView.ImportDXOptionsView; +var + AList: TStringList; +begin + AList := TStringList.Create; + try + Converter.EnablePropertyException; + try + Converter.GetSetProperty(nil, 'OptionsView', AList); + AList.Sort; + AssignDXOptionsView(AList); + except + on EcxUnknownProperty do; + end; + finally + AList.Free; + Converter.DisablePropertyException; + end; +end; + +procedure TcxRealConverterToTableView.ImportGrid; +begin + AssignGrid; + ImportPreview; + ImportDXOptionsDB; + ImportDXOptionsCustomize; + ImportDXOptionsBehavior; + ImportSummaryGroups; + ImportColumnSummaryGroups; +end; + +procedure TcxRealConverterToTableView.ImportGridStyles; +var + AStyle: TcxCustomStyle; + AGroupNodeColor: Integer; + AGroupNodeTextColor: Integer; + AGroupPanelColor: Integer; + AGroupPanelFontColor: Integer; + AAutoSearchColor: Integer; + AAutoSearchTextColor: Integer; + APreviewFont: TFont; + AHighlightColor: Integer; + AHighlightTextColor: Integer; + AHideSelectionColor: Integer; + AHideSelectionTextColor: Integer; + AGridLineColor: Integer; +begin + FColor := Converter.GetIntegerProperty(nil, 'Color'); + FFont := Converter.GetClassProperty(nil, 'Font') as TFont; + if (FColor <> clWindow) or not DefaultFont(FFont) then + begin + AStyle := Converter.CreateStyleItem; + (AStyle as TcxStyle).Color := FColor; + (AStyle as TcxStyle).Font.Assign(FFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + cxGridView.Styles.Content := AStyle as TcxStyle; + end; + AGroupNodeColor := Converter.GetIntegerProperty(nil, 'GroupNodeColor'); + AGroupNodeTextColor := Converter.GetIntegerProperty(nil, 'GroupNodeTextColor'); + if (AGroupNodeColor <> clBtnFace) or (AGroupNodeTextColor <> clNone) then + begin + if (AGroupNodeColor = FColor) and ((AGroupNodeTextColor = FFont.Color) or + (AGroupNodeTextColor = clNone)) then + cxGridView.Styles.Group := cxGridView.Styles.Content + else + begin + AStyle := Converter.CreateStyleItem; + (AStyle as TcxStyle).Color := AGroupNodeColor; + (AStyle as TcxStyle).Font.Assign(FFont); + if AGroupNodeTextColor = clNone then + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color + else + (AStyle as TcxStyle).TextColor := AGroupNodeTextColor; + cxGridView.Styles.Group := AStyle as TcxStyle; + end; + end; + AGroupPanelColor := Converter.GetIntegerProperty(nil, 'GroupPanelColor'); + AGroupPanelFontColor := Converter.GetIntegerProperty(nil, 'GroupPanelFontColor'); + if (AGroupPanelColor <> clBtnShadow) or (AGroupPanelFontColor <> clBtnFace) then + begin + AStyle := Converter.CreateStyleItem; + (AStyle as TcxStyle).Color := AGroupPanelColor; + (AStyle as TcxStyle).TextColor := AGroupPanelFontColor; + cxGridView.Styles.GroupByBox := AStyle as TcxStyle; + end; + FHeaderColor := Converter.GetIntegerProperty(nil, 'HeaderColor'); + FHeaderFont := Converter.GetClassProperty(nil, 'HeaderFont') as TFont; + if (FHeaderColor <> clBtnFace) or not DefaultFont(FHeaderFont) then + begin + AStyle := Converter.CreateStyleItem; + (AStyle as TcxStyle).Color := FHeaderColor; + (AStyle as TcxStyle).Font.Assign(FHeaderFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + cxGridView.Styles.Header := AStyle as TcxStyle; + cxGridView.Styles.Indicator := AStyle as TcxStyle; + end; + if (FHeaderColor <> clBtnface) or not DefaultFont(FFont) then + begin + AStyle := Converter.CreateStyleItem; + (AStyle as TcxStyle).Color := FHeaderColor; + (AStyle as TcxStyle).Font.Assign(FFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + cxGridView.Styles.Footer := AStyle as TcxStyle; + end; + AAutoSearchColor := Converter.GetIntegerProperty(nil, 'AutoSearchColor'); + AAutoSearchTextColor := Converter.GetIntegerProperty(nil, 'AutoSearchTextColor'); + if (AAutoSearchColor <> clNone) or (AAutoSearchTextColor <> clNone) then + begin + AStyle := Converter.CreateStyleItem; + (AStyle as TcxStyle).Color := AAutoSearchColor; + (AStyle as TcxStyle).TextColor := AAutoSearchTextColor; + cxGridView.Styles.IncSearch := AStyle as TcxStyle; + end; + APreviewFont := Converter.GetClassProperty(nil, 'PreviewFont') as TFont; + if not DefaultPreviewFont(APreviewFont) then + begin + AStyle := Converter.CreateStyleItem; + (AStyle as TcxStyle).Color := FColor; + (AStyle as TcxStyle).Font.Assign(APreviewFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + cxGridView.Styles.Preview := AStyle as TcxStyle; + end; + AGridLineColor := Converter.GetIntegerProperty(nil, 'GridLineColor'); + if AGridLineColor <> clNone then + cxGridView.OptionsView.GridLineColor := Converter.GetIntegerProperty(nil, 'GridLineColor'); + AHighlightColor := Converter.GetIntegerProperty(nil, 'HighlightColor'); + AHighlightTextColor := Converter.GetIntegerProperty(nil, 'HighlightTextColor'); + if (AHighlightColor <> clHighlight) or (AHighlightTextColor <> clHighlightText) then + begin + AStyle := Converter.CreateStyleItem; + (AStyle as TcxStyle).Color := AHighlightColor; + (AStyle as TcxStyle).TextColor := AHighlightTextColor; + cxGridView.Styles.Selection := AStyle as TcxStyle; + end; + AHideSelectionColor := Converter.GetIntegerProperty(nil, 'HideSelectionColor'); + AHideSelectionTextColor := Converter.GetIntegerProperty(nil, 'HideSelectionTextColor'); + if (AHideSelectionColor <> clHighlight) or (AHideSelectionTextColor <> clHighlightText) then + begin + AStyle := Converter.CreateStyleItem; + (AStyle as TcxStyle).Color := AHideSelectionColor; + (AStyle as TcxStyle).TextColor := AHideSelectionTextColor; + cxGridView.Styles.Inactive := AStyle as TcxStyle; + end; +end; + +procedure TcxRealConverterToTableView.ImportPreview; +var + APreview: string; + I: Integer; +begin + APreview := Converter.GetStringProperty(nil, 'PreviewFieldName', ''); + if APreview <> '' then + begin + for I := 0 to cxGridView.ColumnCount - 1 do + if TestPreviewFieldName(I, APreview) then + begin + cxGridView.Preview.Column := cxGridView.Columns[I]; + Break; + end; + end; + cxGridView.Preview.Place := ppBottom; + cxGridView.Preview.AutoHeight := False; + cxGridView.Preview.MaxLineCount := Converter.GetIntegerProperty(nil, 'PreviewLines', + cxGridView.Preview.MaxLineCount); +end; + +procedure TcxRealConverterToTableView.ImportPropertiesBlobEdit( + AdxColumn: TObject; AcxColumn: TcxGridColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxBlobEditProperties; + AConverter := TcxBlobEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + AcxColumn.Options.ShowEditButtons := ConvertColumnShowEditButtons( + Converter.GetEnumProperty(AdxColumn, 'ShowButtonStyle')); + finally + AConverter.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportPropertiesButtonEdit( + AdxColumn: TObject; AcxColumn: TcxGridColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxButtonEditProperties; + AConverter := TcxButtonEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + AcxColumn.Options.ShowEditButtons := ConvertColumnShowEditButtons( + Converter.GetEnumProperty(AdxColumn, 'ShowButtonStyle')); + finally + AConverter.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportPropertiesCalcEdit( + AdxColumn: TObject; AcxColumn: TcxGridColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxCalcEditProperties; + AConverter := TcxCalcEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + AcxColumn.Options.ShowEditButtons := ConvertColumnShowEditButtons( + Converter.GetEnumProperty(AdxColumn, 'ShowButtonStyle')); + finally + AConverter.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportPropertiesCheckBox( + AdxColumn: TObject; AcxColumn: TcxGridColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxCheckBoxProperties; + AConverter := TcxCheckBoxPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + finally + AConverter.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportPropertiesComboBox( + AdxColumn: TObject; AcxColumn: TcxGridColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxComboBoxProperties; + AConverter := TcxComboBoxPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + AcxColumn.Options.ShowEditButtons := ConvertColumnShowEditButtons( + Converter.GetEnumProperty(AdxColumn, 'ShowButtonStyle')); + finally + AConverter.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportPropertiesCurencyEdit( + AdxColumn: TObject; AcxColumn: TcxGridColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxCurrencyEditProperties; + AConverter := TcxCurrencyEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + finally + AConverter.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportPropertiesDateEdit( + AdxColumn: TObject; AcxColumn: TcxGridColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxDateEditProperties; + AConverter := TcxDateEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + AcxColumn.Options.ShowEditButtons := ConvertColumnShowEditButtons( + Converter.GetEnumProperty(AdxColumn, 'ShowButtonStyle')); + finally + AConverter.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportPropertiesExLookupComboBox( + AdxColumn: TObject; AcxColumn: TcxGridColumn); +begin + +end; + +procedure TcxRealConverterToTableView.ImportPropertiesHyperLinkEdit( + AdxColumn: TObject; AcxColumn: TcxGridColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxHyperLinkEditProperties; + AConverter := TcxHyperLinkEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + finally + AConverter.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportPropertiesImage( + AdxColumn: TObject; AcxColumn: TcxGridColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxImageProperties; + AConverter := TcxImagePropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + finally + AConverter.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportPropertiesImageComboBox( + AdxColumn: TObject; AcxColumn: TcxGridColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxImageComboBoxProperties; + AConverter := TcxImageComboBoxPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + AcxColumn.Options.ShowEditButtons := ConvertColumnShowEditButtons( + Converter.GetEnumProperty(AdxColumn, 'ShowButtonStyle')); + finally + AConverter.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportPropertiesLookupComboBox( + AdxColumn: TObject; AcxColumn: TcxGridColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxLookupComboBoxProperties; + AConverter := TcxLookupComboBoxPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + AcxColumn.Options.ShowEditButtons := ConvertColumnShowEditButtons( + Converter.GetEnumProperty(AdxColumn, 'ShowButtonStyle')); + finally + AConverter.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportPropertiesMaskEdit( + AdxColumn: TObject; AcxColumn: TcxGridColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxMaskEditProperties; + AConverter := TcxMaskEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + finally + AConverter.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportPropertiesMemo( + AdxColumn: TObject; AcxColumn: TcxGridColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxMemoProperties; + AConverter := TcxMemoPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + finally + AConverter.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportPropertiesMRUEdit( + AdxColumn: TObject; AcxColumn: TcxGridColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxMRUEditProperties; + AConverter := TcxMRUEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + AcxColumn.Options.ShowEditButtons := ConvertColumnShowEditButtons( + Converter.GetEnumProperty(AdxColumn, 'ShowButtonStyle')); + finally + AConverter.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportPropertiesPopupEdit( + AdxColumn: TObject; AcxColumn: TcxGridColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxPopupEditProperties; + AConverter := TcxPopupEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + finally + AConverter.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportPropertiesSpinEdit( + AdxColumn: TObject; AcxColumn: TcxGridColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxSpinEditProperties; + AConverter := TcxSpinEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + AcxColumn.Options.ShowEditButtons := ConvertColumnShowEditButtons( + Converter.GetEnumProperty(AdxColumn, 'ShowButtonStyle')); + finally + AConverter.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportPropertiesTextEdit( + AdxColumn: TObject; AcxColumn: TcxGridColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxTextEditProperties; + AConverter := TcxTextEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + finally + AConverter.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportPropertiesTimeEdit( + AdxColumn: TObject; AcxColumn: TcxGridColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxTimeEditProperties; + AConverter := TcxTimeEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + finally + AConverter.Free; + end; +end; + +procedure TcxRealConverterToTableView.ImportSummaryGroups; +var + ASummaryGroups: TObject; + ASummaryItems: TObject; + AcxSummaryGroup: TcxDataSummaryGroup; + AcxSummaryItem: TcxGridDBTableSummaryItem; + I, J, K: Integer; + ASeparator: string; + AFieldName: string; + AIsDefaultGroup: Boolean; + AdxColumn: TComponent; + ABeginText, AEndText: string; +begin + ASeparator := Converter.GetStringProperty(nil, 'SummarySeparator', ''); + ASummaryGroups := Converter.GetClassProperty(nil, 'SummaryGroups'); + if ASummaryGroups <> nil then + begin + if ASummaryGroups is TCollection then + with TCollection(ASummaryGroups) do + begin + for I := 0 to Count - 1 do + begin + ABeginText := Converter.GetStringProperty(Items[I], 'BeginSummaryText', ''); + AEndText := Converter.GetStringProperty(Items[I], 'EndSummaryText', ''); + AIsDefaultGroup := Converter.GetBooleanProperty(Items[I], 'DefaultGroup', True); + if AIsDefaultGroup then + begin + cxGridView.DataController.Summary.DefaultGroupSummaryItems.BeginText := ABeginText; + cxGridView.DataController.Summary.DefaultGroupSummaryItems.EndText := AEndText; + cxGridView.DataController.Summary.DefaultGroupSummaryItems.Separator := ASeparator; + AcxSummaryGroup := nil; + end + else + begin + AcxSummaryGroup := cxGridView.DataController.Summary.SummaryGroups.Add; + AcxSummaryGroup.SummaryItems.BeginText := ABeginText; + AcxSummaryGroup.SummaryItems.EndText := AEndText; + AcxSummaryGroup.SummaryItems.Separator := ASeparator; + end; + if AcxSummaryGroup <> nil then + FcxSummaryGroups.AddObject(Converter.GetStringProperty(Items[I], 'Name', ''), AcxSummaryGroup); + ASummaryItems := Converter.GetClassProperty(Items[I], 'SummaryItems'); + if ASummaryItems <> nil then + begin + if ASummaryItems is TCollection then + with TCollection(ASummaryItems) do + begin + for J := 0 to Count - 1 do + begin + if AIsDefaultGroup then + AcxSummaryItem := TcxGridDBTableSummaryItem(cxGridView.DataController.Summary.DefaultGroupSummaryItems.Add) + else + AcxSummaryItem := TcxGridDBTableSummaryItem(AcxSummaryGroup.SummaryItems.Add); + AcxSummaryItem.Column := nil; + AdxColumn := GetColumn(Converter.GetStringProperty(Items[J], 'ColumnName', '')); + if AdxColumn <> nil then + begin + AFieldName := Converter.GetStringProperty(AdxColumn, 'FieldName', ''); + for K := 0 to cxGridView.ColumnCount - 1 do + if TcxGridDbTableView(cxGridView).Columns[K].DataBinding.FieldName = AFieldName then + begin + AcxSummaryItem.Column := TcxGridDBTableView(cxGridView).Columns[K]; + AcxSummaryItem.Position := spFooter; + Break; + end; + end; + AcxSummaryItem.FieldName := Converter.GetStringProperty(Items[J], 'SummaryField', ''); + AcxSummaryItem.Format := Converter.GetStringProperty(Items[J], 'SummaryFormat', AcxSummaryItem.Format); + AcxSummaryItem.Kind := GetSummaryKind(Converter.GetEnumProperty(Items[J], 'SummaryType')); + end; + end; + end; + end; + end; + end; +end; + +procedure TcxRealConverterToTableView.ImportSyncMode(const AValue: Boolean); +begin + TcxGridDBTableView(cxGridView).DataController.DataModeController.SyncMode := AValue; +end; + +function TcxRealConverterToTableView.TestPreviewFieldName(AIndex: Integer; + const APreview: string): Boolean; +begin + Result := TcxGridDBTableView(cxGridView).Columns[AIndex].DataBinding.FieldName = APreview; +end; + +function TcxRealConverterToTableView.DefaultPreviewFont(AFont: TFont): Boolean; +begin + if AFont = nil then + begin + Result := True; + Exit; + end; + with AFont do + Result := + (Pitch = DefFontData.Pitch) and + (Style = DefFontData.Style) and + (Charset = DefFontData.Charset) and + (Name = DefFontData.Name) and + (Color = clBlue) and + (Size = 8); +end; + +function TcxRealConverterToTableView.GetColumn(const AName: string): TComponent; +var + AColumns: TList; + I: Integer; +begin + Result := nil; + AColumns := TList.Create; + try + GetColumns(AColumns); + for I := 0 to AColumns.Count - 1 do + if Converter.GetStringProperty(TComponent(AColumns[I]), 'Name', '') = AName then + begin + Result := TComponent(AColumns[I]); + Break; + end; + finally + AColumns.Free; + end; +end; + +procedure TcxRealConverterToTableView.GetColumns(AColumns: TList); +var + AForm: TComponent; + I: Integer; +begin + AForm := Converter.Source.Owner; + for I := 0 to AForm.ComponentCount - 1 do + begin + if AForm.Components[I].GetParentComponent = Converter.Source then + AColumns.Add(AForm.Components[I]); + end; + if AColumns.Count = 0 then + begin + for I := 0 to Converter.Source.ComponentCount - 1 do + begin + if Converter.Source.Components[I].GetParentComponent = Converter.Source then + AColumns.Add(Converter.Source.Components[I]); + end; + end; +end; + +function TcxRealConverterToTableView.GetCXColumnByFieldName(const AFieldName: string): TcxGridDBColumn; +var + I: Integer; +begin + Result := nil; + for I := 0 to cxGridView.ColumnCount - 1 do + begin + if TcxGridDBTableView(cxGridView).Columns[I].DataBinding.FieldName = AFieldName then + begin + Result := TcxGridDBTableView(cxGridView).Columns[I]; + Break; + end; + end; +end; + +function TcxRealConverterToTableView.GetcxGrid: TcxCustomGrid; +begin + Result := Converter.Destination; +end; + +function TcxRealConverterToTableView.GetcxGridView: TcxGridTableView; +begin + Result := Converter.cxGridView as TcxGridTableView; +end; + +function TcxRealConverterToTableView.ConvertColumnShowEditButtons( + const AStyle: string): TcxGridItemShowEditButtons; +begin + if AStyle = 'sbDefault' then + Result := isebDefault + else if AStyle = 'sbAlways' then + Result := isebAlways + else if AStyle = 'sbNone' then + Result := isebNever + else + Result := isebDefault; +end; + +function TcxRealConverterToTableView.GetSummaryKind( + const AType: string): TcxSummaryKind; +begin + if AType = 'cstNone' then + Result := skNone + else if AType = 'cstAvg' then + Result := skAverage + else if AType = 'cstCount' then + Result := skCount + else if AType = 'cstMax' then + Result := skMax + else if AType = 'cstMin' then + Result := skMin + else if AType = 'cstSum' then + Result := skSum + else + Result := skNone; +end; + +{ TcxRealConverterToBandedTableView } + +procedure TcxRealConverterToBandedTableView.DoImport; +begin + TcxGridDBBandedTableView(cxGridView).DataController.DataSource := + Converter.GetClassProperty(nil, 'DataSource') as TDataSource; + ImportDXOptionsView; + ImportDXFilter; + ImportBands; + ImportColumns; + TcxGridDBBandedTableView(cxGridView).DataController.KeyFieldNames := + Converter.GetStringProperty(nil, 'KeyField', ''); + ImportGrid; +end; + +procedure TcxRealConverterToBandedTableView.DoImportStyles; +begin + ImportGridStyles; + ImportBandsStyles; + ImportColumnsStyles; +end; + +procedure TcxRealConverterToBandedTableView.AssignColumn(AColumn: TcxGridColumn; + ADXColumn: TObject; AIndex: Integer); +begin + with TcxGridDBBandedColumn(AColumn) do + begin + Position.BandIndex := Converter.GetIntegerProperty(ADXColumn, 'BandIndex', Position.BandIndex); + Position.ColIndex := Converter.GetIntegerProperty(ADXColumn, 'ColIndex', Position.ColIndex); + Options.VertSizing := Converter.GetBooleanProperty(ADXColumn, 'Sizing', Options.VertSizing); + Position.RowIndex := Converter.GetIntegerProperty(ADXColumn, 'RowIndex', Position.RowIndex); + end; + inherited AssignColumn(AColumn, ADXColumn, AIndex); +end; + +procedure TcxRealConverterToBandedTableView.ImportAutoDataSetFilter(const AValue: Boolean); +begin + TcxGridDBBandedTableView(cxGridView).DataController.Filter.AutoDataSetFilter := AValue; +end; + +procedure TcxRealConverterToBandedTableView.ImportColumnSummaryGroups; + function GetCXColumnByFieldName(const AFieldName: string): TcxGridDBBandedColumn; + var + I: Integer; + begin + Result := nil; + for I := 0 to cxGridView.ColumnCount - 1 do + begin + if TcxGridDbBandedTableView(cxGridView).Columns[I].DataBinding.FieldName = AFieldName then + begin + Result := TcxGridDbBandedTableView(cxGridView).Columns[I]; + Break; + end; + end; + end; +var + AColumns: TList; + AColumn: TcxGridDBBandedColumn; + ASummaryField: string; + ASummaryFormat: string; + ASummaryGroupName: string; + ASummaryType: string; + ASummaryGroup: TcxDataSummaryGroup; + ASummaryItem: TcxGridDBTableSummaryItem; + ALink: TcxGridTableSummaryGroupItemLink; + AIndex: Integer; + I: Integer; +begin + AColumns := TList.Create; + try + GetColumns(AColumns); + for I := 0 to AColumns.Count - 1 do + begin + AColumn := GetCXColumnByFieldName(Converter.GetStringProperty(AColumns[I], 'FieldName', '')); + if AColumn = nil then + Continue; + ASummaryField := Converter.GetStringProperty(TComponent(AColumns[I]), 'SummaryField', ''); + ASummaryFormat := Converter.GetStringProperty(TComponent(AColumns[I]), 'SummaryFormat', ''); + ASummaryType := Converter.GetEnumProperty(TComponent(AColumns[I]), 'SummaryType'); + ASummaryGroupName := Converter.GetStringProperty(TComponent(AColumns[I]), 'SummaryGroupName', ''); + if ASummaryGroupName <> '' then + begin + if FcxSummaryGroups.Find(ASummaryGroupName, AIndex) then + begin + ASummaryGroup := TcxDataSummaryGroup(FcxSummaryGroups.Objects[AIndex]); + ALink := TcxGridTableSummaryGroupItemLink(ASummaryGroup.Links.Add); + ALink.Column := AColumn; + end; + end; + if (ASummaryField <> '') and (ASummaryType <> 'cstNone') then + begin + ASummaryGroup := cxGridView.DataController.Summary.SummaryGroups.Add; + ASummaryItem := TcxGridDBTableSummaryItem(ASummaryGroup.SummaryItems.Add); + ASummaryItem.FieldName := ASummaryField; + ASummaryItem.Format := ASummaryFormat; + ASummaryItem.Kind := GetSummaryKind(ASummaryType); + ALink := TcxGridTableSummaryGroupItemLink(ASummaryGroup.Links.Add); + ALink.Column := AColumn; + end; + end; + finally + AColumns.Free; + end; +end; + +procedure TcxRealConverterToBandedTableView.AssignDXOptionsView(AList: TStringList); +var + I: Integer; +begin + with cxGridView do + FBandHeaderWidth := AList.Find('edgoBandHeaderWidth', I); + inherited AssignDXOptionsView(AList); +end; + +procedure TcxRealConverterToBandedTableView.AssignGrid; +begin + with cxGridView do + begin + OptionsView.BandHeaders := Converter.GetBooleanProperty(nil, 'ShowBands', OptionsView.BandHeaders); + OptionsView.FixedBandSeparatorWidth := Converter.GetIntegerProperty(nil, 'FixedBandLineWidth', + OptionsView.FixedBandSeparatorWidth); + end; + inherited AssignGrid; +end; + +procedure TcxRealConverterToBandedTableView.AssignSummaryItem(AColumn: TcxGridColumn; ADXColumn: TObject); +var + ASummaryFooterType: string; + AcxSummaryFooterItem: TcxGridDBTableSummaryItem; +begin + ASummaryFooterType := Converter.GetEnumProperty(ADXColumn, 'SummaryFooterType'); + if ASummaryFooterType <> 'cstNone' then + begin + AcxSummaryFooterItem := TcxGridDBTableSummaryItem( + TcxGridDBBandedTableView(cxGridView).DataController.Summary.FooterSummaryItems.Add); + AcxSummaryFooterItem.FieldName := Converter.GetStringProperty(ADXColumn, 'SummaryFooterField', ''); + AcxSummaryFooterItem.Format := Converter.GetStringProperty(ADXColumn, 'SummaryFooterFormat', + AcxSummaryFooterItem.Format); + AcxSummaryFooterItem.Kind := GetSummaryKind(ASummaryFooterType); + AcxSummaryFooterItem.Column := AColumn; + end; +end; + +function TcxRealConverterToBandedTableView.CreateColumn: TcxGridColumn; +begin + Result := TcxGridDBBandedTableView(cxGridView).CreateColumn; +end; + +procedure TcxRealConverterToBandedTableView.ImportColumnsStyles; +var + AColumns: TList; + AColumn: TcxGridDBBandedColumn; + I: Integer; + AColor: Integer; + AFont: TFont; + AStyle: TcxCustomStyle; +begin + AColumns := TList.Create; + try + GetColumns(AColumns); + for I := 0 to AColumns.Count - 1 do + begin + AColumn := GetCXColumnByFieldName(Converter.GetStringProperty(AColumns[I], 'FieldName', '')); + AColor := Converter.GetIntegerProperty(TComponent(AColumns[I]), 'Color'); + AFont := Converter.GetClassProperty(TComponent(AColumns[I]), 'Font') as TFont; + if ((AColor <> clWindow) and (AColor <> FColor)) or + (not DefaultFont(AFont) and not CompareFonts(AFont, FFont)) then + begin + AStyle := Converter.CreateStyleItem; + (AStyle as TcxStyle).Color := AColor; + (AStyle as TcxStyle).Font.Assign(AFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + AColumn.Styles.Content := AStyle as TcxStyle; + end; + end; + finally + AColumns.Free; + end; +end; + +procedure TcxRealConverterToBandedTableView.ImportBands; +var + ABands: TObject; + AcxGridBand: TcxGridBand; + I: Integer; + AFixed: string; +begin + cxGridView.Bands.Clear; + ABands := Converter.GetClassProperty(nil, 'Bands'); + if ABands <> nil then + begin + if ABands is TCollection then + with TCollection(ABands) do + begin + for I := 0 to Count - 1 do + begin + AcxGridBand := cxGridView.Bands.Add; + if FBandHeaderWidth then + AcxGridBand.Width := 0 + else + AcxGridBand.Width := Converter.GetIntegerProperty(Items[I], 'Width', AcxGridBand.Width); + AcxGridBand.Caption := Converter.GetStringProperty(Items[I], 'Caption', AcxGridBand.Caption); + AcxGridBand.Alignment := ConvertAlignment(Converter.GetEnumProperty(Items[I], 'Alignment')); + AcxGridBand.Visible := Converter.GetBooleanProperty(Items[I], 'Visible', AcxGridBand.Visible); + AcxGridBand.Options.Sizing := Converter.GetBooleanProperty(Items[I], 'Sizing', AcxGridBand.Options.Sizing); + AcxGridBand.Options.Moving := not Converter.GetBooleanProperty(Items[I], 'DisableDragging', AcxGridBand.Options.Moving); + AFixed := Converter.GetEnumProperty(Items[I], 'Fixed'); + if AFixed = 'bfLeft' then + AcxGridBand.FixedKind := fkLeft + else if AFixed = 'bfNone' then + AcxGridBand.FixedKind := fkNone + else if AFixed = 'bfRight' then + AcxGridBand.FixedKind := fkRight; + end; + end; + end; + cxGridView.OptionsView.BandHeaders := Converter.GetBooleanProperty(nil, 'ShowBands', cxGridView.OptionsView.BandHeaders); +end; + +procedure TcxRealConverterToBandedTableView.ImportBandsStyles; +var + ABandColor: Integer; + ABandFont: TFont; + AStyle: TcxCustomStyle; +begin + ABandColor := Converter.GetIntegerProperty(nil, 'BandColor'); + ABandFont := Converter.GetClassProperty(nil, 'BandFont') as TFont; + if (ABandColor <> clBtnFace) or not DefaultFont(ABandFont) then + begin + AStyle := Converter.CreateStyleItem; + (AStyle as TcxStyle).Color := ABandColor; + (AStyle as TcxStyle).Font.Assign(ABandFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + cxGridView.Styles.BandHeader := AStyle as TcxStyle; + end; +end; + +procedure TcxRealConverterToBandedTableView.ImportSummaryGroups; +var + ASummaryGroups: TObject; + ASummaryItems: TObject; + AcxSummaryGroup: TcxDataSummaryGroup; + AcxSummaryItem: TcxGridDBTableSummaryItem; + I, J, K: Integer; + ASeparator: string; + AFieldName: string; + AIsDefaultGroup: Boolean; + AdxColumn: TComponent; + ABeginText, AEndText: string; +begin + ASeparator := Converter.GetStringProperty(nil, 'SummarySeparator', ''); + ASummaryGroups := Converter.GetClassProperty(nil, 'SummaryGroups'); + if ASummaryGroups <> nil then + begin + if ASummaryGroups is TCollection then + with TCollection(ASummaryGroups) do + begin + for I := 0 to Count - 1 do + begin + ABeginText := Converter.GetStringProperty(Items[I], 'BeginSummaryText', ''); + AEndText := Converter.GetStringProperty(Items[I], 'EndSummaryText', ''); + AIsDefaultGroup := Converter.GetBooleanProperty(Items[I], 'DefaultGroup', false); + if AIsDefaultGroup then + begin + cxGridView.DataController.Summary.DefaultGroupSummaryItems.BeginText := ABeginText; + cxGridView.DataController.Summary.DefaultGroupSummaryItems.EndText := AEndText; + cxGridView.DataController.Summary.DefaultGroupSummaryItems.Separator := ASeparator; + AcxSummaryGroup := nil; + end + else + begin + AcxSummaryGroup := cxGridView.DataController.Summary.SummaryGroups.Add; + AcxSummaryGroup.SummaryItems.BeginText := ABeginText; + AcxSummaryGroup.SummaryItems.EndText := AEndText; + AcxSummaryGroup.SummaryItems.Separator := ASeparator; + end; + if AcxSummaryGroup <> nil then + FcxSummaryGroups.AddObject(Converter.GetStringProperty(Items[I], 'Name', ''), AcxSummaryGroup); + ASummaryItems := Converter.GetClassProperty(Items[I], 'SummaryItems'); + if ASummaryItems <> nil then + begin + if ASummaryItems is TCollection then + with TCollection(ASummaryItems) do + begin + for J := 0 to Count - 1 do + begin + if AIsDefaultGroup then + AcxSummaryItem := TcxGridDBTableSummaryItem(cxGridView.DataController.Summary.DefaultGroupSummaryItems.Add) + else + AcxSummaryItem := TcxGridDBTableSummaryItem(AcxSummaryGroup.SummaryItems.Add); + AcxSummaryItem.Column := nil; + AdxColumn := GetColumn(Converter.GetStringProperty(Items[J], 'ColumnName', '')); + if AdxColumn <> nil then + begin + AFieldName := Converter.GetStringProperty(AdxColumn, 'FieldName', ''); + for K := 0 to cxGridView.ColumnCount - 1 do + if TcxGridDBBandedTableView(cxGridView).Columns[K].DataBinding.FieldName = AFieldName then + begin + AcxSummaryItem.Column := TcxGridDBBandedTableView(cxGridView).Columns[K]; + AcxSummaryItem.Position := spFooter; + Break; + end; + end; + AcxSummaryItem.FieldName := Converter.GetStringProperty(Items[J], 'SummaryField', ''); + AcxSummaryItem.Format := Converter.GetStringProperty(Items[J], 'SummaryFormat', AcxSummaryItem.Format); + AcxSummaryItem.Kind := GetSummaryKind(Converter.GetEnumProperty(Items[J], 'SummaryType')); + end; + end; + end; + end; + end; + end; +end; + +procedure TcxRealConverterToBandedTableView.ImportSyncMode(const AValue: Boolean); +begin + TcxGridDBBandedTableView(cxGridView).DataController.DataModeController.SyncMode := AValue; +end; + +function TcxRealConverterToBandedTableView.TestPreviewFieldName( + AIndex: Integer; const APreview: string): Boolean; +begin + Result := TcxGridDBBandedTableView(cxGridView).Columns[AIndex].DataBinding.FieldName = APreview; +end; + +function TcxRealConverterToBandedTableView.GetCXColumnByFieldName( + const AFieldName: string): TcxGridDBBandedColumn; +var + I: Integer; +begin + Result := nil; + for I := 0 to cxGridView.ColumnCount - 1 do + begin + if TcxGridDBBandedTableView(cxGridView).Columns[I].DataBinding.FieldName = AFieldName then + begin + Result := TcxGridDBBandedTableView(cxGridView).Columns[I]; + Break; + end; + end; +end; + +function TcxRealConverterToBandedTableView.GetcxGridView: TcxGridBandedTableView; +begin + Result := Converter.cxGridView as TcxGridBandedTableView; +end; + +procedure TcxRealConverterToBandedTableView.ImportDXOptionsCustomize; +var + AList: TStringList; + I: Integer; +begin + AList := TStringList.Create; + try + Converter.EnablePropertyException; + try + Converter.GetSetProperty(nil, 'OptionsCustomize', AList); + AList.Sort; + with cxGridView do + begin + OptionsCustomize.BandMoving := AList.Find('edgoBandMoving', I); + OptionsCustomize.BandSizing := AList.Find('edgoBandSizing', I); + OptionsCustomize.ColumnVertSizing := AList.Find('edgoColumnSizing', I); + OptionsCustomize.BandHiding := AList.Find('edgoExtCustomizing', I); + end; + except + on EcxUnknownProperty do; + end; + finally + AList.Free; + Converter.DisablePropertyException; + end; + inherited ImportDXOptionsCustomize; +end; + +{ TcxDXGridConverter } + +class function TcxDXGridConverter.GetSourceClassName: string; +begin + Result := 'TdxDBGrid'; +end; + +procedure TcxDXGridConverter.DoRealImport; +var + ARealConverter: TcxRealConverterToTableView; +begin + if GetGridViewClass = TcxGridDBTableView then + ARealConverter := TcxRealConverterToTableView.Create(Self) + else + ARealConverter := TcxRealConverterToBandedTableView.Create(Self); + try + ARealConverter.DoImport; + finally + ARealConverter.Free; + end; +end; + +procedure TcxDXGridConverter.DoImportStyles; +var + ARealConverter: TcxRealConverterToTableView; +begin + if GetGridViewClass = TcxGridDBTableView then + ARealConverter := TcxRealConverterToTableView.Create(Self) + else + ARealConverter := TcxRealConverterToBandedTableView.Create(Self); + try + ARealConverter.DoImportStyles; + finally + ARealConverter.Free; + end; +end; + +function TcxDXGridConverter.GetGridViewClass: TcxCustomGridViewClass; +var + ADXBands: TCollection; +begin + Result := TcxGridDBBandedTableView; + EnablePropertyException; + try + if not GetBooleanProperty(nil, 'ShowBands', False) then + begin + ADXBands := GetClassProperty(nil, 'Bands') as TCollection; + if ADXBands <> nil then + if ADXBands.Count = 1 then + begin + if GetStringProperty(ADXBands.Items[0], 'Caption', '') = '' then + Result := TcxGridDBTableView; + end; + end; + except + on EcxUnknownProperty do + Result := TcxGridDBTableView; + end; + DisablePropertyException; +end; + +{ TcxDXGridLayoutConverter } + +procedure TcxDXGridLayoutConverter.DoRealImport; +begin + if FdxDBGrid <> nil then + inherited DoRealImport; +end; + +function TcxDXGridLayoutConverter.GetGridViewClass: TcxCustomGridViewClass; +begin + if FdxDBGrid <> nil then + Result := inherited GetGridViewClass + else + Result := TcxGridDBTableView; +end; + +class function TcxDXGridLayoutConverter.GetSourceClassName: string; +begin + Result := 'TdxDBGridLayout'; +end; + +procedure TcxDXGridLayoutConverter.PostImport; +begin + FdxDBGrid.Free; + FdxDBGrid := nil; + if FComponent <> nil then + Source := FComponent; +end; + +procedure TcxDXGridLayoutConverter.PreImport; +var + AReader: TcxDXGridLayoutDataReader; + AWriter: TWriter; + AStream: TStringStream; + ADummy: TcxDXGridLayoutDummy; +begin + FdxDBGrid := nil; + FComponent := nil; + if Intermediary = nil then + Exit; + + ADummy := TcxDXGridLayoutDummy.Create(nil); + ADummy.Component := Source; + ADummy.Intermediary := Intermediary; + AStream := TStringStream.Create(''); + try + AWriter := TWriter.Create(AStream, 65536); + try + AWriter.Root := Source.Owner; + AWriter.WriteComponent(Source); + finally + AWriter.Free; + end; + AReader := TcxDXGridLayoutDataReader.Create(AStream, 65536); + AStream.Position := 0; + try + AReader.BeginReferences; + AReader.ReadComponent(ADummy); + FdxDBGrid := ADummy.dxDBGrid; + FComponent := Source; + Source := FdxDBGrid; + finally + AReader.EndReferences; + AReader.Free; + end; + finally + AStream.Free; + ADummy.Free; + end; +end; + +function TcxDXGridLayoutConverter.TestIntermediary: Boolean; +begin + Result := Intermediary <> nil; +end; + +class function TcxDXGridLayoutConverter.GetIntermediaryClassName: string; +begin + Result := 'TdxDBGrid'; +end; + +{ TcxDXGridLayoutDataReader } + +procedure TcxDXGridLayoutDataReader.SetName(Component: TComponent; var Name: string); +begin + Name := ''; +end; + +{ TcxDXGridLayoutDummy } + +constructor TcxDXGridLayoutDummy.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FComponent := nil; + FdxDBGrid := nil; + FIntermediary := nil; +end; + +procedure TcxDXGridLayoutDummy.DefineProperties(Filer: TFiler); +begin + Filer.DefineBinaryProperty('Data', ReadData, nil, False); +end; + +procedure TcxDXGridLayoutDummy.ReadData(Stream: TStream); +var + AClass: TFormClass; + ASize: Integer; +begin + if FIntermediary = nil then + Exit; + try + AClass := TFormClass(FIntermediary.ClassType); + Stream.ReadBuffer(ASize, SizeOf(ASize)); + FdxDBGrid := AClass.Create(Component.Owner); + FdxDBGrid := Stream.ReadComponent(FdxDBGrid); + (FdxDBGrid as TControl).Parent := Component.Owner as TWinControl; + except + FdxDBGrid.Free; + FdxDBGrid := nil; + raise; + end; +end; + +initialization + ConverterFactory(cxGridGroupConverterName).RegisterConverter('DX Grid Converter', TcxDXGridConverter); + ConverterFactory(cxGridGroupConverterName).RegisterConverter('DX Grid Layout Converter', TcxDXGridLayoutConverter); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxFilterDialog.dfm b/official/x.35/ExpressQuantumGrid 6/Sources/cxFilterDialog.dfm new file mode 100644 index 00000000..be0a7601 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxFilterDialog.dfm @@ -0,0 +1,140 @@ +object cxFilterDialog: TcxFilterDialog + Left = 421 + Top = 148 + HorzScrollBar.Visible = False + VertScrollBar.Visible = False + ActiveControl = cbOperator1 + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'Custom Filter' + ClientHeight = 175 + ClientWidth = 414 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + PixelsPerInch = 96 + TextHeight = 13 + object lblTitle: TLabel + Left = 8 + Top = 8 + Width = 87 + Height = 13 + Caption = 'Show rows where:' + Transparent = True + end + object bvlLine: TBevel + Left = 8 + Top = 34 + Width = 396 + Height = 4 + Shape = bsTopLine + end + object lblColumnCaption: TLabel + Left = 8 + Top = 27 + Width = 71 + Height = 13 + Caption = 'ColumnCaption' + Transparent = True + end + object lblSingle: TLabel + Left = 8 + Top = 134 + Width = 185 + Height = 13 + Caption = 'Use ? to represent any single character' + Transparent = True + end + object lblSeries: TLabel + Left = 8 + Top = 153 + Width = 200 + Height = 13 + Caption = 'Use * to represent any series of characters' + Transparent = True + end + object lblEdit1PlaceHolder: TLabel + Left = 208 + Top = 46 + Width = 193 + Height = 21 + AutoSize = False + Color = clGreen + ParentColor = False + Visible = False + end + object lblEdit2PlaceHolder: TLabel + Left = 208 + Top = 96 + Width = 193 + Height = 21 + AutoSize = False + Color = clGreen + ParentColor = False + Visible = False + end + object cbOperator1: TcxComboBox + Left = 8 + Top = 46 + Properties.DropDownListStyle = lsFixedList + TabOrder = 0 + OnClick = cbOperator1Click + Width = 193 + end + object cbOperator2: TcxComboBox + Left = 8 + Top = 96 + Properties.DropDownListStyle = lsFixedList + Properties.OnChange = cbOperator2PropertiesChange + TabOrder = 3 + Width = 193 + end + object btnOK: TcxButton + Left = 248 + Top = 144 + Width = 75 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 4 + end + object btnCancel: TcxButton + Left = 330 + Top = 144 + Width = 75 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 5 + end + object rbAnd: TcxRadioButton + Tag = 1 + Left = 56 + Top = 74 + Width = 60 + Height = 17 + Caption = '&And' + Checked = True + TabOrder = 1 + TabStop = True + Transparent = True + end + object rbOr: TcxRadioButton + Tag = 1 + Left = 120 + Top = 74 + Width = 65 + Height = 17 + Caption = '&Or' + TabOrder = 2 + Transparent = True + end +end diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxFilterDialog.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxFilterDialog.pas new file mode 100644 index 00000000..5353d05b --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxFilterDialog.pas @@ -0,0 +1,513 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxFilterDialog; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Classes, Controls, Graphics, ExtCtrls, Forms, StdCtrls, SysUtils, cxButtonEdit, + cxButtons, cxContainer, cxControls, cxDataStorage, cxDropDownEdit, cxEdit, + cxFilter, cxFilterConsts, cxFilterControlUtils, cxLookAndFeels, cxMaskEdit, + cxTextEdit, cxLookAndFeelPainters, cxRadioGroup, cxGraphics, Menus; + +type + TcxFilterDialogClass = class of TcxFilterDialog; + + TcxFilterDialog = class(TForm) + lblTitle: TLabel; + lblColumnCaption: TLabel; + bvlLine: TBevel; + lblSingle: TLabel; + lblSeries: TLabel; + btnOK: TcxButton; + btnCancel: TcxButton; + lblEdit1PlaceHolder: TLabel; + lblEdit2PlaceHolder: TLabel; + cbOperator1: TcxComboBox; + cbOperator2: TcxComboBox; + rbAnd: TcxRadioButton; + rbOr: TcxRadioButton; + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + procedure cbOperator1Click(Sender: TObject); + procedure cbOperator2PropertiesChange(Sender: TObject); + private + FCriteria: TcxFilterCriteria; + FDisplayValue1: TCaption; + FDisplayValue2: TCaption; + FEdit1: TcxCustomEdit; + FEdit2: TcxCustomEdit; + FEditProperties: TcxCustomEditProperties; + FFilterEditHelper: TcxCustomFilterEditHelperClass; + FItemLink: TObject; + FValue1: Variant; + FValue2: Variant; + FValueTypeClass: TcxValueTypeClass; + protected + procedure AddFilterItem(AParent: TcxFilterCriteriaItemList; AComboBox: TcxComboBox; + AValue: Variant; ADisplayValue: string); + procedure CheckWildcardDescriptionVisibility; + procedure CreateParams(var Params: TCreateParams); override; + procedure GetFilterValues(AEdit: TcxCustomEdit; var AValue: Variant; + var ADisplayValue: TCaption); + function GetOperatorComboBox(AEdit: TcxCustomEdit): TcxComboBox; virtual; + function GetSupportedOperators: TcxFilterControlOperators; virtual; + procedure InitControls(const ACriteriaItemCaption: string); virtual; + procedure InitControlValues; virtual; + procedure InitEdits(AComboBox: TcxComboBox; AEdit: TcxCustomEdit; + AItem: TcxFilterCriteriaItem); + procedure InitLookAndFeel(ALookAndFeel: TcxLookAndFeel); virtual; + procedure SetEditValidChars(AEdit: TcxCustomEdit); + procedure ValidateValue(AEdit: TcxCustomEdit; var AValue: Variant); + + property FilterEditHelper: TcxCustomFilterEditHelperClass read FFilterEditHelper; + property SupportedOperators: TcxFilterControlOperators read GetSupportedOperators; + public + constructor Create(ACriteria: TcxFilterCriteria; AItemLink: TObject; + AEditProperties: TcxCustomEditProperties; const ACriteriaItemCaption: string; + AValueTypeClass: TcxValueTypeClass; ALookAndFeel: TcxLookAndFeel; AFont: TFont); reintroduce; virtual; + procedure ApplyChanges; virtual; + class function GetFilterEditHelper(AEditProperties: TcxCustomEditProperties): TcxCustomFilterEditHelperClass; + + property Criteria: TcxFilterCriteria read FCriteria; + property EditProperties: TcxCustomEditProperties read FEditProperties; + property ItemLink: TObject read FItemLink; + property ValueTypeClass: TcxValueTypeClass read FValueTypeClass; + end; + +var + cxFilterDialogClass: TcxFilterDialogClass = TcxFilterDialog; + +function IsFilterControlDialogNeeded(ACriteria: TcxFilterCriteria): Boolean; +function ShowFilterDialog(ACriteria: TcxFilterCriteria; + AItemLink: TObject; AEditProperties: TcxCustomEditProperties; + const ACriteriaItemCaption: string; AValueTypeClass: TcxValueTypeClass; + ALookAndFeel: TcxLookAndFeel = nil; AFont: TFont = nil): Boolean; + +implementation + +{$R *.dfm} + +uses +{$IFNDEF DELPHI6} + cxVariants, +{$ENDIF} + cxClasses, cxFilterControlStrs; + +function IsFilterControlDialogNeeded(ACriteria: TcxFilterCriteria): Boolean; +const + SupportedKinds: TcxFilterOperatorKinds = [foEqual..foNotLike]; +var + AItemLinks: TList; + + function SimpleList(AList: TcxFilterCriteriaItemList): Boolean; + var + I: Integer; + AItem: TcxCustomFilterCriteriaItem; + AItemLink: TObject; + begin + Result := False; + with AList do + begin + if (Count <> 2) or not (BoolOperatorKind in [fboAnd, fboOr]) then + Exit; + for I := 0 to Count - 1 do + begin + AItem := Items[I]; + if AItem.IsItemList or not (TcxFilterCriteriaItem(AItem).OperatorKind in SupportedKinds) then + Exit; + end; + AItemLink := TcxFilterCriteriaItem(Items[0]).ItemLink; + Result := (AItemLink = TcxFilterCriteriaItem(Items[1]).ItemLink) and + (AItemLinks.IndexOf(AItemLink) = -1); + if Result then + AItemLinks.Add(AItemLink); + end; + end; + + function SimpleItem(AItem: TcxCustomFilterCriteriaItem): Boolean; + begin + if AItem.IsItemList then + Result := SimpleList(TcxFilterCriteriaItemList(AItem)) + else + with TcxFilterCriteriaItem(AItem) do + begin + Result := (OperatorKind in SupportedKinds) and (AItemLinks.IndexOf(ItemLink) = -1); + if Result then + AItemLinks.Add(ItemLink); + end; + end; + +var + I: Integer; +begin + AItemLinks := TList.Create; + try + Result := ACriteria.Root.BoolOperatorKind <> fboAnd; + if not Result then + for I := 0 to ACriteria.Root.Count - 1 do + begin + Result := not SimpleItem(ACriteria.Root.Items[I]); + if Result then Break; + end; + finally + AItemLinks.Free; + end; +end; + +function ShowFilterDialog(ACriteria: TcxFilterCriteria; + AItemLink: TObject; AEditProperties: TcxCustomEditProperties; + const ACriteriaItemCaption: string; AValueTypeClass: TcxValueTypeClass; + ALookAndFeel: TcxLookAndFeel = nil; AFont: TFont = nil): Boolean; +var + ADialog: TcxFilterDialog; +begin + Result := False; + if cxFilterDialogClass.GetFilterEditHelper(AEditProperties) = nil then + Exit; + ADialog := cxFilterDialogClass.Create(ACriteria, AItemLink, AEditProperties, + ACriteriaItemCaption, AValueTypeClass, ALookAndFeel, AFont); + try + Result := ADialog.ShowModal = mrOK; + if Result then ADialog.ApplyChanges; + finally + ADialog.Free; + end; +end; + +procedure FillOperatorComboBox(AComboBox: TcxComboBox; AOperators: TcxFilterControlOperators); +var + AOperator: TcxFilterControlOperator; +begin + for AOperator := Low(TcxFilterControlOperator) to High(TcxFilterControlOperator) do + if AOperator in AOperators then + AComboBox.Properties.Items.AddObject(GetFilterControlOperatorText(AOperator), TObject(AOperator)); +end; + +function GetOperatorIndex(AComboBox: TcxComboBox; AOperator: TcxFilterControlOperator): Integer; +begin + Result := AComboBox.Properties.Items.IndexOfObject(TObject(AOperator)); +end; + +function GetOperator(AComboBox: TcxComboBox): TcxFilterControlOperator; + + function GetStartItemIndex(AComboBox: TcxComboBox): Integer; + begin + if AComboBox.Properties.Items[0] = '' then + Result := 0 + else + Result := -1; + end; + +begin + with AComboBox do + if (ItemIndex = -1) or (ItemIndex = GetStartItemIndex(AComboBox)) then + Result := fcoNone + else + Result := TcxFilterControlOperator(Properties.Items.Objects[ItemIndex]) +end; + +{ TcxFilterDialog } + +constructor TcxFilterDialog.Create(ACriteria: TcxFilterCriteria; AItemLink: TObject; + AEditProperties: TcxCustomEditProperties; const ACriteriaItemCaption: string; + AValueTypeClass: TcxValueTypeClass; ALookAndFeel: TcxLookAndFeel; AFont: TFont); +begin + inherited Create(Application); + FCriteria := ACriteria; + FItemLink := AItemLink; + FEditProperties := AEditProperties; + FValueTypeClass := AValueTypeClass; + FFilterEditHelper := GetFilterEditHelper(FEditProperties); + + Caption := cxGetResourceString(@cxSFilterDialogCaption); + InitControls(ACriteriaItemCaption); + if ALookAndFeel <> nil then + InitLookAndFeel(ALookAndFeel); + if AFont <> nil then + DialogApplyFont(Self, AFont); + InitControlValues; +end; + +procedure TcxFilterDialog.AddFilterItem(AParent: TcxFilterCriteriaItemList; + AComboBox: TcxComboBox; AValue: Variant; ADisplayValue: string); +const + AOperatorKinds: array[fcoEqual .. fcoNotLike] of TcxFilterOperatorKind = + (foEqual, foNotEqual, foLess, foLessEqual, foGreater, foGreaterEqual, + foLike, foNotLike); +var + AOperator: TcxFilterControlOperator; +begin + AOperator := GetOperator(AComboBox); + if AOperator = fcoNone then Exit; + + if AOperator in [fcoBlanks, fcoNonBlanks] then + begin + if AOperator = fcoBlanks then + AOperator := fcoEqual + else + AOperator := fcoNotEqual; + AValue := Null; + ADisplayValue := cxGetResourceString(@cxSFilterBlankCaption); + end; + if VarIsNull(AValue) or (VarIsStr(AValue) and (AValue = '')) then + ADisplayValue := cxGetResourceString(@cxSFilterBlankCaption); + + Criteria.AddItem(AParent, ItemLink, AOperatorKinds[AOperator], AValue, ADisplayValue); +end; + +procedure TcxFilterDialog.CheckWildcardDescriptionVisibility; + + function CheckCombo(AComboBox: TcxComboBox): Boolean; + begin + Result := GetOperator(AComboBox) in [fcoLike, fcoNotLike]; + end; + +begin + lblSingle.Visible := CheckCombo(cbOperator1) or CheckCombo(cbOperator2); + lblSeries.Visible := lblSingle.Visible; +end; + +procedure TcxFilterDialog.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); +// rollback CorrectDlgParams(Params); +end; + +procedure TcxFilterDialog.GetFilterValues(AEdit: TcxCustomEdit; var AValue: Variant; + var ADisplayValue: TCaption); +begin + AValue := Null; + ADisplayValue := ''; + if GetOperatorComboBox(AEdit).ItemIndex <> -1 then + FilterEditHelper.GetFilterValue(AEdit, EditProperties, AValue, ADisplayValue); + ValidateValue(AEdit, AValue); +end; + +function TcxFilterDialog.GetOperatorComboBox(AEdit: TcxCustomEdit): TcxComboBox; +begin + if AEdit = FEdit1 then + Result := cbOperator1 + else + Result := cbOperator2; +end; + +function TcxFilterDialog.GetSupportedOperators: TcxFilterControlOperators; +begin + Result := FilterEditHelper.GetSupportedFilterOperators(EditProperties, ValueTypeClass); + if not Criteria.SupportedLike then + Result := Result - [fcoLike, fcoNotLike]; +end; + +procedure TcxFilterDialog.InitControls(const ACriteriaItemCaption: string); + + function CreateValueEdit(APlaceHolder: TControl; AOperatorComboBox: TcxComboBox): TcxCustomEdit; + begin + Result := FilterEditHelper.GetFilterEdit(EditProperties); + with Result do + begin + BoundsRect := APlaceHolder.BoundsRect; + Parent := Self; + TabOrder := AOperatorComboBox.TabOrder + 1; + end; + end; + +begin + lblTitle.Caption := cxGetResourceString(@cxSFilterDialogRows); + lblColumnCaption.Caption := ACriteriaItemCaption + ' '; + bvlLine.SetBounds(lblColumnCaption.Left + lblColumnCaption.Width, bvlLine.Top, + bvlLine.Width - lblColumnCaption.Width + bvlLine.Left - lblColumnCaption.Left, + bvlLine.Height); + + rbAnd.Caption := cxGetResourceString(@cxSFilterDialogOperationAnd); + rbOr.Caption := cxGetResourceString(@cxSFilterDialogOperationOr); + lblSingle.Caption := cxGetResourceString(@cxSFilterDialogUse) + ' ' + + Criteria.UnderscoreWildcard + ' ' + cxGetResourceString(@cxSFilterDialogSingleCharacter); + lblSeries.Caption := cxGetResourceString(@cxSFilterDialogUse) + ' ' + + Criteria.PercentWildcard + ' ' + cxGetResourceString(@cxSFilterDialogCharactersSeries); + btnOK.Caption := cxGetResourceString(@cxSFilterControlDialogActionOkCaption); + btnCancel.Caption := cxGetResourceString(@cxSFilterControlDialogActionCancelCaption); + + // Operator ComboBoxes + FillOperatorComboBox(cbOperator1, SupportedOperators); + with cbOperator1.Properties do + DropDownRows := Items.Count; + with cbOperator2.Properties do + begin + Items.Assign(cbOperator1.Properties.Items); + Items.Insert(0, ''); + DropDownRows := Items.Count; + end; + + // Value Edits + FEdit1 := CreateValueEdit(lblEdit1PlaceHolder, cbOperator1); + rbAnd.TabOrder := FEdit1.TabOrder + 1; + FEdit2 := CreateValueEdit(lblEdit2PlaceHolder, cbOperator2); +end; + +procedure TcxFilterDialog.InitControlValues; +var + AItem: TcxFilterCriteriaItem; +begin + // default values + if (fcoLike in SupportedOperators) and (ValueTypeClass <> nil) and ValueTypeClass.IsString then + cbOperator1.ItemIndex := GetOperatorIndex(cbOperator1, fcoLike) + else + if fcoEqual in SupportedOperators then + cbOperator1.ItemIndex := GetOperatorIndex(cbOperator1, fcoEqual) + else + cbOperator1.ItemIndex := 0; + cbOperator2.ItemIndex := 0; + + // current values + AItem := Criteria.FindItemByItemLink(ItemLink); + if AItem <> nil then + begin + InitEdits(cbOperator1, FEdit1, AItem); + if (AItem.Parent <> Criteria.Root) and (AItem.Parent.Items[1] <> nil) then + begin + rbAnd.Checked := AItem.Parent.BoolOperatorKind = fboAnd; + rbOr.Checked := not rbAnd.Checked; + AItem := TcxFilterCriteriaItem(AItem.Parent.Items[1]); + InitEdits(cbOperator2, FEdit2, AItem); + end; + end; + + SetEditValidChars(FEdit1); + SetEditValidChars(FEdit2); + CheckWildcardDescriptionVisibility; +end; + +procedure TcxFilterDialog.InitEdits(AComboBox: TcxComboBox; AEdit: TcxCustomEdit; + AItem: TcxFilterCriteriaItem); +var + AOperator: TcxFilterControlOperator; +begin + AOperator := GetFilterControlOperator(AItem.OperatorKind, AItem.ValueIsNull(AItem.Value)); + AComboBox.ItemIndex := GetOperatorIndex(AComboBox, AOperator); + FilterEditHelper.SetFilterValue(AEdit, EditProperties, AItem.Value); +end; + +procedure TcxFilterDialog.InitLookAndFeel(ALookAndFeel: TcxLookAndFeel); +begin + cbOperator1.Style.LookAndFeel.MasterLookAndFeel := ALookAndFeel; + FEdit1.Style.LookAndFeel.MasterLookAndFeel := ALookAndFeel; + rbAnd.LookAndFeel.MasterLookAndFeel := ALookAndFeel; + rbOr.LookAndFeel.MasterLookAndFeel := ALookAndFeel; + cbOperator2.Style.LookAndFeel.MasterLookAndFeel := ALookAndFeel; + FEdit2.Style.LookAndFeel.MasterLookAndFeel := ALookAndFeel; + btnOK.LookAndFeel.MasterLookAndFeel := ALookAndFeel; + btnCancel.LookAndFeel.MasterLookAndFeel := ALookAndFeel; +end; + +procedure TcxFilterDialog.SetEditValidChars(AEdit: TcxCustomEdit); +var + AWildcardChars: set of AnsiChar; +begin + AWildcardChars := [AnsiChar(Criteria.UnderscoreWildcard), AnsiChar(Criteria.PercentWildcard)]; + if AEdit is TcxCustomTextEdit then + with TcxCustomTextEdit(AEdit) do + if GetOperator(GetOperatorComboBox(AEdit)) in [fcoLike, fcoNotLike] then + ActiveProperties.ValidChars := ActiveProperties.ValidChars + AWildcardChars + else + ActiveProperties.ValidChars := ActiveProperties.ValidChars - AWildcardChars; +end; + +procedure TcxFilterDialog.ValidateValue(AEdit: TcxCustomEdit; var AValue: Variant); +begin + FilterControlValidateValue(AEdit, AValue, GetOperator(GetOperatorComboBox(AEdit)), + ValueTypeClass, FilterEditHelper); +end; + +procedure TcxFilterDialog.ApplyChanges; +var + AItemList: TcxFilterCriteriaItemList; +begin + Criteria.BeginUpdate; + try + Criteria.Root.BoolOperatorKind := fboAnd; + Criteria.RemoveItemByItemLink(ItemLink); + if cbOperator2.ItemIndex <> 0 then + begin + AItemList := Criteria.Root.AddItemList(TcxFilterBoolOperatorKind(rbOr.Checked)); + AddFilterItem(AItemList, cbOperator1, FValue1, FDisplayValue1); + AddFilterItem(AItemList, cbOperator2, FValue2, FDisplayValue2); + end + else + AddFilterItem(nil, cbOperator1, FValue1, FDisplayValue1); + finally + Criteria.EndUpdate; + end; +end; + +class function TcxFilterDialog.GetFilterEditHelper(AEditProperties: TcxCustomEditProperties): TcxCustomFilterEditHelperClass; +begin + Result := FilterEditsController.FindHelper(AEditProperties.ClassType); +end; + +procedure TcxFilterDialog.FormCloseQuery(Sender: TObject; var CanClose: Boolean); +begin + if ModalResult <> mrOK then Exit; + + CanClose := False; + + FEdit1.ValidateEdit(True); + FEdit2.ValidateEdit(True); + btnOK.SetFocus; + + GetFilterValues(FEdit1, FValue1, FDisplayValue1); + GetFilterValues(FEdit2, FValue2, FDisplayValue2); + + CanClose := True; +end; + +procedure TcxFilterDialog.cbOperator1Click(Sender: TObject); +begin + SetEditValidChars(FEdit1); + CheckWildcardDescriptionVisibility; +end; + +procedure TcxFilterDialog.cbOperator2PropertiesChange(Sender: TObject); //!!! +begin + SetEditValidChars(FEdit2); + CheckWildcardDescriptionVisibility; +end; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGrid.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGrid.pas new file mode 100644 index 00000000..bc6eb2ba --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGrid.pas @@ -0,0 +1,2428 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGrid; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Windows, Messages, + Classes, Controls, Graphics, ImgList, Forms, StdCtrls, + cxClasses, cxGraphics, cxLookAndFeels, cxLookAndFeelPainters, cxControls, cxPC, + cxNavigator, cxCustomData, + cxGridCommon, cxGridLevel, cxGridDetailsSite, cxGridCustomView; + +const +(* + CM_DEFERUPDATES = WM_USER + 333; +*) + + cxGridLevelTabsDefaultCaptionAlignment = taCenter; + cxGridLevelTabsDefaultImageBorder = 0; + cxGridRootLevelDefaultDetailFrameWidth = 0; + cxGridDefaultDragOpeningWaitTime = 800;//500; + +type + TcxGridViewInfo = class; + TcxCustomGrid = class; + + { changes } + + TcxGridLayoutChange = class(TcxCustomGridViewChange) + public + procedure Execute; override; + function IsCompatibleWith(AChange: TcxCustomGridChange): Boolean; override; + end; + + TcxGridSizeChange = class(TcxCustomGridViewChange) + private + FKeepMaster: Boolean; + FUpdateGridViewOnly: Boolean; + public + constructor Create(AGridView: TcxCustomGridView; + AUpdateGridViewOnly: Boolean = False; AKeepMaster: Boolean = False); reintroduce; virtual; + procedure Execute; override; + function IsCompatibleWith(AChange: TcxCustomGridChange): Boolean; override; + function IsEqual(AChange: TcxCustomGridChange): Boolean; override; + property KeepMaster: Boolean read FKeepMaster; + property UpdateGridViewOnly: Boolean read FUpdateGridViewOnly + write FUpdateGridViewOnly; + end; + + TcxGridViewChange = class(TcxCustomGridViewChange) + private + FUpdateBounds: TRect; + FUpdateRegion: TcxRegion; + public + constructor Create(AGridView: TcxCustomGridView; + const AUpdateBounds: TRect); reintroduce; overload; virtual; + constructor Create(AGridView: TcxCustomGridView; + const AUpdateRegion: TcxRegion); reintroduce; overload; virtual; + constructor Create(AGridView: TcxCustomGridView); reintroduce; overload; + destructor Destroy; override; + procedure Execute; override; + function IsCompatibleWith(AChange: TcxCustomGridChange): Boolean; override; + function IsEqual(AChange: TcxCustomGridChange): Boolean; override; + property UpdateBounds: TRect read FUpdateBounds; + property UpdateRegion: TcxRegion read FUpdateRegion; + end; + + { notification } + + TcxGridNotificationKind = (gnkFocusedViewChanged, gnkFocusedRecordChanged, + gnkRecordCountChanged, gnkContextMenu, gnkCustomization, gnkKeyDown); + TcxGridNotificationKinds = set of TcxGridNotificationKind; + + TcxCustomGridNotification = class + protected + function NotificationKinds: TcxGridNotificationKinds; virtual; abstract; + procedure Notify(AKind: TcxGridNotificationKind; AData: TObject; + var AHandled: Boolean); virtual; abstract; + end; + + { structure navigator } + + TcxCustomGridStructureNavigatorClass = class of TcxCustomGridStructureNavigator; + + TcxCustomGridStructureNavigator = class(TcxControl) + private + FGrid: TcxCustomGrid; + protected + procedure Changed; virtual; + procedure FontChanged; override; + function MayFocus: Boolean; override; + + function CalculateBoundsRect: TRect; virtual; abstract; + public + constructor Create(AGrid: TcxCustomGrid); reintroduce; virtual; + procedure BeforeGridLoading; virtual; + function IsObjectSelected(AObject: TPersistent): Boolean; virtual; abstract; + procedure SelectionChanged(ASelection: TList); virtual; abstract; + procedure SelectObject(AObject: TPersistent; AClearSelection: Boolean); virtual; abstract; + procedure SelectObjects(AObjects: TList); virtual; abstract; + procedure UnselectObject(AObject: TPersistent); virtual; abstract; + property Grid: TcxCustomGrid read FGrid; + end; + + { handlers } + + TcxCustomGridHandler = class + private + FControl: TcxCustomGrid; + function GetActiveController: TcxCustomGridController; + function GetActiveGridView: TcxCustomGridView; + function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; + function GetViewInfo: TcxGridViewInfo; + protected + property ActiveController: TcxCustomGridController read GetActiveController; + property ActiveGridView: TcxCustomGridView read GetActiveGridView; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter; + property ViewInfo: TcxGridViewInfo read GetViewInfo; + public + constructor Create(AControl: TcxCustomGrid); virtual; + property Control: TcxCustomGrid read FControl; + end; + + TcxGridDesignControllerClass = class of TcxGridDesignController; + + TcxGridDesignController = class(TcxCustomGridDesignController) + private + FControl: TcxCustomGrid; + protected + function GetControl: TcxControl; override; + public + constructor Create(AControl: TcxCustomGrid); virtual; + end; + + TcxGridDragOpenInfoTab = class(TcxCustomGridDragOpenInfo) + public + Level: TcxGridLevel; + constructor Create(ALevel: TcxGridLevel); virtual; + function Equals(AInfo: TcxCustomGridDragOpenInfo): Boolean; override; + procedure Run; override; + end; + + TcxGridControllerClass = class of TcxGridController; + + TcxGridController = class(TcxCustomGridHandler) + private + FDesignController: TcxGridDesignController; + FDragOpenInfo: TcxCustomGridDragOpenInfo; + FDragOpenTimer: TcxTimer; + function GetDesignController: TcxGridDesignController; + procedure DragOpenTimerHandler(Sender: TObject); + protected + function GetDesignControllerClass: TcxGridDesignControllerClass; virtual; + public + destructor Destroy; override; + + procedure DoCancelMode; virtual; + procedure FocusChanged; virtual; + + function GetCursor(X, Y: Integer): TCursor; virtual; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); dynamic; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); dynamic; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); dynamic; + + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); virtual; + procedure EndDrag(Target: TObject; X, Y: Integer); virtual; + procedure StartDrag(var DragObject: TDragObject); virtual; + + function GetDragOpenInfo(AHitTest: TcxCustomGridHitTest): TcxCustomGridDragOpenInfo; virtual; + function IsDragOpenHitTest(AHitTest: TcxCustomGridHitTest; + out ADragOpenInfo: TcxCustomGridDragOpenInfo): Boolean; + procedure StartDragOpen(ADragOpenInfo: TcxCustomGridDragOpenInfo); + procedure StopDragOpen; + property DragOpenInfo: TcxCustomGridDragOpenInfo read FDragOpenInfo; + + property DesignController: TcxGridDesignController read GetDesignController; + end; + + TcxGridPainterClass = class of TcxGridPainter; + + TcxGridPainter = class(TcxCustomGridHandler) + private + function GetCanvas: TcxCanvas; + protected + procedure DrawDetailsSite; virtual; + //procedure DrawEmptyArea; virtual; + public + procedure Invalidate(AInvalidateDetails: Boolean); overload; virtual; + procedure Invalidate(const R: TRect); overload; virtual; + procedure Paint; virtual; + property Canvas: TcxCanvas read GetCanvas; + end; + + TcxGridTopDetailsSiteViewInfoClass = class of TcxGridTopDetailsSiteViewInfo; + + TcxGridTopDetailsSiteViewInfo = class(TcxCustomGridDetailsSiteViewInfo) + private + function GetControl: TcxCustomGrid; + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetActiveGridView: TcxCustomGridView; override; + function GetActiveLevel: TcxGridLevel; override; + function GetCanvas: TcxCanvas; override; + function GetContainer: TcxControl; override; + function GetDesignController: TcxCustomGridDesignController; override; + function GetMasterRecord: TObject; override; + function GetMaxHeight: Integer; override; + function GetMaxWidth: Integer; override; + procedure InitTabHitTest(AHitTest: TcxGridDetailsSiteTabHitTest); override; + property Control: TcxCustomGrid read GetControl; + public + procedure ChangeActiveTab(ALevel: TcxGridLevel; AFocusView: Boolean = False); override; + function DetailHasData(ALevel: TcxGridLevel): Boolean; override; + function SupportsTabAccelerators: Boolean; override; + procedure VisibilityChanged(AVisible: Boolean); override; + end; + + TcxGridViewInfoClass = class of TcxGridViewInfo; + + TcxGridViewInfo = class(TcxCustomGridHandler) + private + FDetailsSiteViewInfo: TcxGridTopDetailsSiteViewInfo; + FDetailsSiteViewInfoCachedInfo: TcxCustomGridDetailsSiteViewInfoCachedInfo; + function GetBounds: TRect; + function GetClientBounds: TRect; + function GetEmptyAreaColor: TColor; + protected + procedure CreateViewInfos; virtual; + procedure DestroyViewInfos; virtual; + function GetDetailsSiteViewInfoClass: TcxGridTopDetailsSiteViewInfoClass; virtual; + procedure RecreateViewInfos; + public + constructor Create(AControl: TcxCustomGrid); override; + destructor Destroy; override; + procedure Calculate; virtual; + function GetHitTest(X, Y: Integer): TcxCustomGridHitTest; virtual; + property Bounds: TRect read GetBounds; + property ClientBounds: TRect read GetClientBounds; + property DetailsSiteViewInfo: TcxGridTopDetailsSiteViewInfo read FDetailsSiteViewInfo; + property EmptyAreaColor: TColor read GetEmptyAreaColor; + end; + + { controls } + + TcxGridLevelTabsClass = class of TcxGridLevelTabs; + + TcxGridLevelTabs = class(TPersistent) + private + FCaptionAlignment: TAlignment; + FFreeNotificator: TcxFreeNotificator; + FImageBorder: Integer; + FImages: TCustomImageList; + FImagesChangeLink: TChangeLink; + FOwner: TcxCustomGrid; + FSlants: TcxTabSlants; + FStyle: TcxPCStyleID; + procedure SetCaptionAlignment(Value: TAlignment); + procedure SetImageBorder(Value: Integer); + procedure SetImages(Value: TCustomImageList); + procedure SetSlants(Value: TcxTabSlants); + procedure SetStyle(Value: TcxPCStyleID); + procedure FreeNotification(Sender: TComponent); + procedure ImagesChanged(Sender: TObject); + procedure SlantsChanged(Sender: TObject); + protected + procedure Changed; + public + constructor Create(AOwner: TcxCustomGrid); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + property Owner: TcxCustomGrid read FOwner; + published + property CaptionAlignment: TAlignment read FCaptionAlignment write SetCaptionAlignment default cxGridLevelTabsDefaultCaptionAlignment; + property ImageBorder: Integer read FImageBorder write SetImageBorder default cxGridLevelTabsDefaultImageBorder; + property Images: TCustomImageList read FImages write SetImages; + property Slants: TcxTabSlants read FSlants write SetSlants; + property Style: TcxPCStyleID read FStyle write SetStyle default cxPCDefaultStyle; + end; + + TcxGridRootLevelOptions = class(TcxGridLevelOptions) + public + constructor Create(ALevel: TcxGridLevel); override; + published + property DetailFrameWidth default cxGridRootLevelDefaultDetailFrameWidth; + end; + + TcxGridRootLevel = class(TcxGridLevel) + protected + function GetOptionsClass: TcxGridLevelOptionsClass; override; + end; + + TcxGridActiveTabChangedEvent = procedure(Sender: TcxCustomGrid; ALevel: TcxGridLevel) of object; + TcxGridFocusedViewChangedEvent = procedure(Sender: TcxCustomGrid; + APrevFocusedView, AFocusedView: TcxCustomGridView) of object; + TcxGridLayoutChangedEvent = procedure(Sender: TcxCustomGrid; AGridView: TcxCustomGridView) of object; + + TcxCustomGrid = class(TcxControl, IcxNavigator, IdxSkinSupport) + private + FActiveLevel: TcxGridLevel; + FChanges: TList; + FChangesStack: TList; + FController: TcxGridController; + FCreatingStructureNavigator: Boolean; + FDragOpening: Boolean; + FDragOpeningWaitTime: Integer; + FFocusedView: TcxCustomGridView; + FIsPopupControl: Boolean; + FLastFocused: Boolean; + FLevels: TcxGridLevel; + FLevelTabs: TcxGridLevelTabs; + FNavigatorNotifier: TcxNavigatorControlNotifier; + FNotifications: TList; + FPainter: TcxGridPainter; + FProcessingChangesStack: Boolean; + FStructureNavigator: TcxCustomGridStructureNavigator; + FTabStop: Boolean; + FTag: TObject; + FUpdateLockCount: Integer; + FViewInfo: TcxGridViewInfo; + FViews: TList; + FOnActiveTabChanged: TcxGridActiveTabChangedEvent; + FOnFocusedViewChanged: TcxGridFocusedViewChangedEvent; + FOnLayoutChanged: TcxGridLayoutChangedEvent; + FSubClassEvents: TNotifyEvent; + + function GetActiveView: TcxCustomGridView; + function GetFocusedViewNavigator: IcxNavigator; + function GetView(Index: Integer): TcxCustomGridView; + function GetViewCount: Integer; + function GetRootLevelOptions: TcxGridLevelOptions; + function GetRootLevelStyles: TcxGridLevelStyles; + function GetStructureNavigator: TcxCustomGridStructureNavigator; + function GetUpdateLocked: Boolean; + procedure SetActiveLevel(Value: TcxGridLevel); + procedure SetDragOpeningWaitTime(Value: Integer); + procedure SetFocusedView(Value: TcxCustomGridView); + procedure SetLevels(Value: TcxGridLevel); + procedure SetLevelTabs(Value: TcxGridLevelTabs); + procedure SetRootLevelOptions(Value: TcxGridLevelOptions); + procedure SetRootLevelStyles(Value: TcxGridLevelStyles); + procedure SetTabStop(Value: Boolean); + + procedure AddView(AView: TcxCustomGridView); + procedure RemoveView(AView: TcxCustomGridView); + procedure DestroyViews; + + procedure DestroyChanges(AChanges: TList); + procedure DestroyViewChanges(AView: TcxCustomGridView); + + procedure CreateStructureNavigator; + + //procedure CMDeferUpdates(var Message: TMessage); message CM_DEFERUPDATES; + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + protected + // IcxNavigator + function IcxNavigator.IsActive = NavigatorIsActive; + function IcxNavigator.IsBof = NavigatorIsBof; + function IcxNavigator.IsEof = NavigatorIsEof; + function IcxNavigator.CanAppend = NavigatorCanAppend; + function IcxNavigator.CanEdit = NavigatorCanEdit; + function IcxNavigator.CanDelete = NavigatorCanDelete; + function IcxNavigator.CanInsert = NavigatorCanInsert; + procedure IcxNavigator.ClearBookmark = NavigatorClearBookmark; + function IcxNavigator.IsEditing = NavigatorIsEditing; + function IcxNavigator.IsBookmarkAvailable = NavigatorIsBookmarkAvailable; + procedure IcxNavigator.DoAction = NavigatorDoAction; + function IcxNavigator.GetNotifier = NavigatorGetNotifier; + function IcxNavigator.IsActionSupported = NavigatorIsActionSupported; + function NavigatorIsActive: Boolean; + function NavigatorIsBof: Boolean; + function NavigatorIsEof: Boolean; + function NavigatorCanAppend: Boolean; + function NavigatorCanEdit: Boolean; + function NavigatorCanDelete: Boolean; + function NavigatorCanInsert: Boolean; + function NavigatorIsEditing: Boolean; + procedure NavigatorClearBookmark; + function NavigatorIsBookmarkAvailable: Boolean; + procedure NavigatorDoAction(AButtonIndex: Integer); + function NavigatorGetNotifier: TcxNavigatorControlNotifier; + function NavigatorIsActionSupported(AButtonIndex: Integer): Boolean; + + procedure AddChildComponent(AComponent: TcxControlChildComponent); override; + procedure RemoveChildComponent(AComponent: TcxControlChildComponent); override; + + procedure BoundsChanged; override; + procedure DoCancelMode; override; + procedure DoContextPopup(MousePos: TPoint; var Handled: Boolean); override; + procedure FocusChanged; override; + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + function GetCursor(X, Y: Integer): TCursor; override; + function GetDesignHitTest(X, Y: Integer; Shift: TShiftState): Boolean; override; + function GetIsFocused: Boolean; override; + procedure Loaded; override; + function MayFocus: Boolean; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); override; + procedure Paint; override; + procedure ReadState(Reader: TReader); override; + procedure SetChildOrder(Child: TComponent; Order: Integer); override; + procedure SetName(const NewName: TComponentName); override; + procedure WndProc(var Message: TMessage); override; + + procedure DoEndDrag(Target: TObject; X, Y: Integer); override; + procedure DoStartDrag(var DragObject: TDragObject); override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); override; + + procedure CreateHandlers; virtual; + procedure DestroyHandlers; virtual; + + procedure DoActiveTabChanged(ALevel: TcxGridLevel); virtual; + procedure DoChange(AGridChange: TcxCustomGridChange); + procedure DoLayoutChanged(AGridView: TcxCustomGridView); virtual; + procedure DoProcessChangesStack; + procedure DoUpdate(AChanges: TList); + procedure FocusedViewChanged(APrevFocusedView, AFocusedView: TcxCustomGridView); virtual; + function GetControllerClass: TcxGridControllerClass; virtual; + function GetDefaultViewClass: TcxCustomGridViewClass; virtual; + function GetLevelsClass: TcxGridLevelClass; virtual; + function GetLevelTabsClass: TcxGridLevelTabsClass; virtual; + function GetPainterClass: TcxGridPainterClass; virtual; + function GetViewInfoClass: TcxGridViewInfoClass; virtual; + procedure LevelChanged(ALevel: TcxGridLevel; AChangeKind: TcxGridLevelChangeKind); + procedure RefreshNavigators; + procedure StructureNavigatorChanged; + function UpdateOnRootViewDataChange: Boolean; virtual; + procedure ViewChanged(AView: TcxCustomGridView; AChangeKind: TcxGridViewChangeNotificationKind); + + procedure UpdateFocusing(AChildFocused: Boolean); + property LastFocused: Boolean read FLastFocused; + + property FocusedViewNavigator: IcxNavigator read GetFocusedViewNavigator; + property IsPopupControl: Boolean read FIsPopupControl write FIsPopupControl; + property NavigatorNotifier: TcxNavigatorControlNotifier read FNavigatorNotifier; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Invalidate(AHardUpdate: Boolean = False); reintroduce; + procedure RemoveFocus(AGoForward: Boolean); + + procedure BeginUpdate; + procedure CancelUpdate; + procedure Changed(AGridChange: TcxCustomGridChange); + procedure CheckFocusedView; + procedure EndUpdate; + procedure LayoutChanged; virtual; + procedure SizeChanged; virtual; + property UpdateLocked: Boolean read GetUpdateLocked; + + function CreateView(AViewClass: TcxCustomGridViewClass): TcxCustomGridView; + function ViewExists(AView: TcxCustomGridView): Boolean; + + procedure RegisterNotification(ANotification: TcxCustomGridNotification); + procedure UnregisterNotification(ANotification: TcxCustomGridNotification); + function SendNotifications(AKind: TcxGridNotificationKind; AData: TObject = nil): Boolean; + + procedure RootViewDataChanged(AView: TcxCustomGridView); virtual; + + property ActiveView: TcxCustomGridView read GetActiveView; + property ActiveLevel: TcxGridLevel read FActiveLevel write SetActiveLevel; + property BorderStyle default cxcbsDefault; + property Color; + property Controller: TcxGridController read FController; + property DragOpening: Boolean read FDragOpening write FDragOpening default True; + property DragOpeningWaitTime: Integer read FDragOpeningWaitTime write SetDragOpeningWaitTime + default cxGridDefaultDragOpeningWaitTime; + property FocusedView: TcxCustomGridView read FFocusedView write SetFocusedView; + property Font; + property Levels: TcxGridLevel read FLevels write SetLevels; + property LevelTabs: TcxGridLevelTabs read FLevelTabs write SetLevelTabs; + property LookAndFeel; + property LookAndFeelPainter; + property Painter: TcxGridPainter read FPainter; + property RootLevelOptions: TcxGridLevelOptions read GetRootLevelOptions write SetRootLevelOptions; + property RootLevelStyles: TcxGridLevelStyles read GetRootLevelStyles write SetRootLevelStyles; + property StructureNavigator: TcxCustomGridStructureNavigator read GetStructureNavigator; + property TabStop: Boolean read FTabStop write SetTabStop default True; + property ViewCount: Integer read GetViewCount; + property ViewInfo: TcxGridViewInfo read FViewInfo; + property Views[Index: Integer]: TcxCustomGridView read GetView; + property OnActiveTabChanged: TcxGridActiveTabChangedEvent read FOnActiveTabChanged write FOnActiveTabChanged; + property OnFocusedViewChanged: TcxGridFocusedViewChangedEvent read FOnFocusedViewChanged write FOnFocusedViewChanged; + property OnLayoutChanged: TcxGridLayoutChangedEvent read FOnLayoutChanged write FOnLayoutChanged; + published + property RootLevelStylesEvents: TNotifyEvent read FSubClassEvents write FSubClassEvents; + end; + + TcxGrid = class(TcxCustomGrid) + published + property Align; + property Anchors; + {$IFDEF DELPHI6} + property BevelEdges; + property BevelInner; + property BevelOuter; + property BevelKind; + property BevelWidth; + property BorderWidth; + {$ENDIF} + property BorderStyle; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property Font; + //property ParentColor; + property ParentFont; + property PopupMenu; + property TabOrder; + property TabStop; + property Visible; + + //property OnClick; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + //property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + {property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnMouseWheel; + property OnMouseWheelDown; + property OnMouseWheelUp;} + property OnResize; + property OnStartDock; + property OnStartDrag; + + property DragOpening; + property DragOpeningWaitTime; + property LevelTabs; + property LookAndFeel; + property RootLevelOptions; + property RootLevelStyles; + + property OnActiveTabChanged; + property OnFocusedViewChanged; + property OnLayoutChanged; + property OnMouseEnter; + property OnMouseLeave; + end; + + { TcxGridViewRepository } + + TcxGridViewRepository = class(TComponent) {5} + private + FItems: TList; + function GetCount: Integer; + function GetItem(Index: Integer): TcxCustomGridView; + procedure DestroyItems; + protected + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + + procedure AddItem(AItem: TcxCustomGridView); + procedure RemoveItem(AItem: TcxCustomGridView); + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function CreateItem(AItemClass: TcxCustomGridViewClass): TcxCustomGridView; + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxCustomGridView read GetItem; default; + end; + +var + cxGridStructureNavigatorClass: TcxCustomGridStructureNavigatorClass; + +function GetParentGrid(AControl: TControl): TcxCustomGrid; + +implementation + +uses + SysUtils, Math, cxGridCustomTableView; + +function GetLevel(ACaller: TComponent; Index: Integer): TComponent; +begin + Result := TComponent(TList(TcxCustomGrid(ACaller).FTag)[Index]); +end; + +function GetView(ACaller: TComponent; Index: Integer): TComponent; +begin + Result := TcxCustomGrid(ACaller).Views[Index]; +end; + +{ TcxGridLayoutChange } + +procedure TcxGridLayoutChange.Execute; +begin + if GridView <> nil then + with GridView do + if TcxCustomGridViewAccess.GetChangeable(GridView) and + not IsRectEmpty(Site.BoundsRect) then + begin + ViewInfo.MainCalculate(Site.BoundsRect); + Painter.Invalidate; + end + else + else + with TcxCustomGrid(Control) do + if ViewInfo <> nil then + begin + ViewInfo.Calculate; + Painter.Invalidate(True); + end; + if Control <> nil then {7} + TcxCustomGrid(Control).DoLayoutChanged(GridView); +end; + +function TcxGridLayoutChange.IsCompatibleWith(AChange: TcxCustomGridChange): Boolean; +begin + Result := inherited IsCompatibleWith(AChange) or + (AChange is TcxGridLayoutChange) and + ((TcxGridLayoutChange(AChange).GridView = nil) or + (GridView <> nil) and GridView.HasAsMaster(TcxGridLayoutChange(AChange).GridView)) or + (AChange is TcxGridSizeChange) and + ((TcxGridSizeChange(AChange).GridView = nil) or + (GridView <> nil) and + ((GridView = TcxGridSizeChange(AChange).GridView) or + GridView.HasAsMaster(TcxGridSizeChange(AChange).GridView))); +end; + +{ TcxGridSizeChange } + +constructor TcxGridSizeChange.Create(AGridView: TcxCustomGridView; + AUpdateGridViewOnly: Boolean = False; AKeepMaster: Boolean = False); +begin + inherited Create(AGridView); + FUpdateGridViewOnly := AUpdateGridViewOnly; + FKeepMaster := AKeepMaster; +end; + +procedure TcxGridSizeChange.Execute; +begin + if GridView = nil then + with TcxCustomGrid(Control) do + if ActiveView <> nil then + ActiveView.SizeChanged(False, FKeepMaster) + else + LayoutChanged + else + with GridView do + if TcxCustomGridViewAccess.GetChangeable(GridView) then + begin + if ViewInfoCache <> nil then + ViewInfoCache.UnassignValues(FKeepMaster); + if FUpdateGridViewOnly and FKeepMaster then + LayoutChanged + else + if MasterGridView = nil then + if {(Control = nil) or }IsPattern then + {//}LayoutChanged + else + TcxCustomGrid(Control).LayoutChanged + else + if not IsPattern and not MasterGridView.SizeChanged(False, FKeepMaster) then + LayoutChanged; + end; +end; + +function TcxGridSizeChange.IsCompatibleWith(AChange: TcxCustomGridChange): Boolean; +begin + Result := inherited IsCompatibleWith(AChange) or + (AChange is TcxGridSizeChange) and (TcxGridSizeChange(AChange).GridView = GridView) and + (TcxGridSizeChange(AChange).KeepMaster = FKeepMaster) and FUpdateGridViewOnly or + (AChange is TcxGridDataChange) and (TcxGridDataChange(AChange).GridView = GridView); +end; + +function TcxGridSizeChange.IsEqual(AChange: TcxCustomGridChange): Boolean; +begin + Result := inherited IsEqual(AChange) and + (FKeepMaster = TcxGridSizeChange(AChange).KeepMaster) and + (FUpdateGridViewOnly = TcxGridSizeChange(AChange).UpdateGridViewOnly); +end; + +{ TcxGridViewChange } + +constructor TcxGridViewChange.Create(AGridView: TcxCustomGridView; + const AUpdateBounds: TRect); +begin + inherited Create(AGridView); + FUpdateBounds := AUpdateBounds; +end; + +constructor TcxGridViewChange.Create(AGridView: TcxCustomGridView; + const AUpdateRegion: TcxRegion); +begin + inherited Create(AGridView); + FUpdateRegion := TcxRegion.Create; + FUpdateRegion.Combine(AUpdateRegion, roSet, False); +end; + +constructor TcxGridViewChange.Create(AGridView: TcxCustomGridView); +begin + Create(AGridView, Rect(0, 0, 0, 0)); +end; + +destructor TcxGridViewChange.Destroy; +begin + FUpdateRegion.Free; + inherited; +end; + +procedure TcxGridViewChange.Execute; +begin + if not IsRectEmpty(FUpdateBounds) then + GridView.Painter.Invalidate(FUpdateBounds) + else + if FUpdateRegion <> nil then + GridView.Painter.Invalidate(FUpdateRegion) + else + GridView.Painter.Invalidate; +end; + +function TcxGridViewChange.IsCompatibleWith(AChange: TcxCustomGridChange): Boolean; +begin + Result := inherited IsCompatibleWith(AChange) or + (AChange is TcxGridLayoutChange) and (TcxGridLayoutChange(AChange).GridView = GridView) or + (AChange is TcxGridSizeChange) and (TcxGridSizeChange(AChange).GridView = GridView); +end; + +function TcxGridViewChange.IsEqual(AChange: TcxCustomGridChange): Boolean; +begin + Result := inherited IsEqual(AChange) and + ((FUpdateRegion = nil) and (TcxGridViewChange(AChange).UpdateRegion = nil) and + EqualRect(FUpdateBounds, TcxGridViewChange(AChange).UpdateBounds) or + (FUpdateRegion <> nil) and (TcxGridViewChange(AChange).UpdateRegion <> nil) and + FUpdateRegion.IsEqual(TcxGridViewChange(AChange).UpdateRegion)); +end; + +{ TcxCustomGridStructureNavigator } + +constructor TcxCustomGridStructureNavigator.Create(AGrid: TcxCustomGrid); +begin + inherited Create(nil); + FGrid := AGrid; + Parent := FGrid; +end; + +procedure TcxCustomGridStructureNavigator.Changed; +begin + BoundsRect := CalculateBoundsRect; + BringToFront; + Invalidate; +end; + +procedure TcxCustomGridStructureNavigator.FontChanged; +begin + inherited; + Changed; +end; + +function TcxCustomGridStructureNavigator.MayFocus: Boolean; +begin + Result := False; +end; + +procedure TcxCustomGridStructureNavigator.BeforeGridLoading; +begin +end; + +{ TcxCustomGridHandler } + +constructor TcxCustomGridHandler.Create(AControl: TcxCustomGrid); +begin + inherited Create; + FControl := AControl; +end; + +function TcxCustomGridHandler.GetActiveController: TcxCustomGridController; +begin + if ActiveGridView <> nil then + Result := ActiveGridView.Controller + else + Result := nil; +end; + +function TcxCustomGridHandler.GetActiveGridView: TcxCustomGridView; +begin + Result := FControl.ActiveView; +end; + +function TcxCustomGridHandler.GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := FControl.LookAndFeelPainter; +end; + +function TcxCustomGridHandler.GetViewInfo: TcxGridViewInfo; +begin + Result := FControl.ViewInfo; +end; + +{ TcxGridDesignController } + +constructor TcxGridDesignController.Create(AControl: TcxCustomGrid); +begin + inherited Create; + FControl := AControl; +end; + +function TcxGridDesignController.GetControl: TcxControl; +begin + Result := FControl; +end; + +{ TcxGridDragOpenInfoTab } + +constructor TcxGridDragOpenInfoTab.Create(ALevel: TcxGridLevel); +begin + inherited Create; + Level := ALevel; +end; + +function TcxGridDragOpenInfoTab.Equals(AInfo: TcxCustomGridDragOpenInfo): Boolean; +begin + Result := inherited Equals(AInfo) and + (Level = TcxGridDragOpenInfoTab(AInfo).Level); +end; + +procedure TcxGridDragOpenInfoTab.Run; +begin + Level.Active := True; +end; + +{ TcxGridController } + +destructor TcxGridController.Destroy; +begin + FreeAndNil(FDesignController); + inherited; +end; + +function TcxGridController.GetDesignController: TcxGridDesignController; +begin + if (FDesignController = nil) and Control.IsDesigning then + FDesignController := GetDesignControllerClass.Create(Control); + Result := FDesignController; +end; + +procedure TcxGridController.DragOpenTimerHandler(Sender: TObject); +begin + FDragOpenTimer.Enabled := False; + try + FDragOpenInfo.Run; + finally + StopDragOpen; + end; +end; + +function TcxGridController.GetDesignControllerClass: TcxGridDesignControllerClass; +begin + Result := TcxGridDesignController; +end; + +procedure TcxGridController.DoCancelMode; +begin + if ActiveController <> nil then + ActiveController.DoCancelMode; +end; + +procedure TcxGridController.FocusChanged; +begin + if ActiveController <> nil then + ActiveController.DoControlFocusChanged; +end; + +function TcxGridController.GetCursor(X, Y: Integer): TCursor; +begin + Result := crDefault; +end; + +procedure TcxGridController.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + AHitTest: TcxCustomGridHitTest; +begin + AHitTest := ViewInfo.GetHitTest(X, Y); + if AHitTest.ViewInfo <> nil then + AHitTest.ViewInfo.MouseDown(AHitTest, Button, Shift); +end; + +procedure TcxGridController.MouseMove(Shift: TShiftState; X, Y: Integer); +var + AHitTest: TcxCustomGridHitTest; +begin + AHitTest := ViewInfo.GetHitTest(X, Y); + if AHitTest.ViewInfo <> nil then + AHitTest.ViewInfo.MouseMove(AHitTest, Shift); +end; + +procedure TcxGridController.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin +end; + +procedure TcxGridController.DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); + + procedure ProcessOpening; + var + AHitTest: TcxCustomGridHitTest; + ADragOpenInfo: TcxCustomGridDragOpenInfo; + begin + AHitTest := ViewInfo.GetHitTest(X, Y); + if (State <> dsDragLeave) and IsDragOpenHitTest(AHitTest, ADragOpenInfo) then + StartDragOpen(ADragOpenInfo) + else + StopDragOpen; + end; + +begin + if Control.DragOpening then + ProcessOpening; +end; + +procedure TcxGridController.EndDrag(Target: TObject; X, Y: Integer); +begin + StopDragOpen; +end; + +procedure TcxGridController.StartDrag(var DragObject: TDragObject); +begin +end; + +function TcxGridController.GetDragOpenInfo(AHitTest: TcxCustomGridHitTest): TcxCustomGridDragOpenInfo; +begin + if AHitTest.HitTestCode = htTab then + with TcxGridDetailsSiteTabHitTest(AHitTest) do + Result := TcxGridDragOpenInfoTab.Create(Level) + else + Result := nil; +end; + +function TcxGridController.IsDragOpenHitTest(AHitTest: TcxCustomGridHitTest; + out ADragOpenInfo: TcxCustomGridDragOpenInfo): Boolean; +begin + ADragOpenInfo := GetDragOpenInfo(AHitTest); + Result := ADragOpenInfo <> nil; +end; + +procedure TcxGridController.StartDragOpen(ADragOpenInfo: TcxCustomGridDragOpenInfo); +begin + if (FDragOpenInfo <> nil) and FDragOpenInfo.Equals(ADragOpenInfo) then + begin + ADragOpenInfo.Free; + Exit; + end; + FDragOpenInfo.Free; + FDragOpenInfo := ADragOpenInfo; + if FDragOpenTimer = nil then + begin + FDragOpenTimer := TcxTimer.Create(nil); + with FDragOpenTimer do + begin + Interval := Control.DragOpeningWaitTime; + OnTimer := DragOpenTimerHandler; + end; + end + else + with FDragOpenTimer do + begin + Enabled := False; + Enabled := True; + end; +end; + +procedure TcxGridController.StopDragOpen; +begin + FreeAndNil(FDragOpenTimer); + FreeAndNil(FDragOpenInfo); +end; + +{ TcxGridPainter } + +function TcxGridPainter.GetCanvas: TcxCanvas; +begin + Result := Control.ActiveCanvas; +end; + +procedure TcxGridPainter.DrawDetailsSite; +begin + with TcxGridTopDetailsSiteViewInfo(ViewInfo.DetailsSiteViewInfo) do + if Visible then Paint(Self.Canvas); +end; + +{procedure TcxGridPainter.DrawEmptyArea; +begin + Canvas.Brush.Color := ViewInfo.EmptyAreaColor; + Canvas.FillRect(ViewInfo.ClientBounds); +end;} + +procedure TcxGridPainter.Invalidate(AInvalidateDetails: Boolean); +var + I: Integer; + AControl: TControl; +begin + Control.Invalidate; + if AInvalidateDetails then + for I := 0 to Control.ControlCount - 1 do + begin + AControl := Control.Controls[I]; + if AControl is TcxGridSite then + AControl.Invalidate; + end; +end; + +procedure TcxGridPainter.Invalidate(const R: TRect); +begin + Control.InvalidateRect(R, False); +end; + +procedure TcxGridPainter.Paint; +begin + DrawDetailsSite; + //DrawEmptyArea; +end; + +{ TcxGridTopDetailsSiteViewInfo } + +function TcxGridTopDetailsSiteViewInfo.GetControl: TcxCustomGrid; +begin + Result := TcxCustomGrid(Level.Control); +end; + +function TcxGridTopDetailsSiteViewInfo.CalculateHeight: Integer; +begin + Result := MaxHeight; +end; + +function TcxGridTopDetailsSiteViewInfo.CalculateWidth: Integer; +begin + Result := MaxWidth; +end; + +function TcxGridTopDetailsSiteViewInfo.GetActiveGridView: TcxCustomGridView; +begin + Result := Control.ActiveView; +end; + +function TcxGridTopDetailsSiteViewInfo.GetActiveLevel: TcxGridLevel; +begin + Result := Control.ActiveLevel; +end; + +function TcxGridTopDetailsSiteViewInfo.GetCanvas: TcxCanvas; +begin + Result := Control.Painter.Canvas; +end; + +function TcxGridTopDetailsSiteViewInfo.GetContainer: TcxControl; +begin + Result := Control; +end; + +function TcxGridTopDetailsSiteViewInfo.GetDesignController: TcxCustomGridDesignController; +begin + Result := Control.Controller.DesignController; +end; + +function TcxGridTopDetailsSiteViewInfo.GetMasterRecord: TObject; +begin + Result := nil; +end; + +function TcxGridTopDetailsSiteViewInfo.GetMaxHeight: Integer; +begin + with Control.ViewInfo.ClientBounds do + Result := Bottom - Top; +end; + +function TcxGridTopDetailsSiteViewInfo.GetMaxWidth: Integer; +begin + with Control.ViewInfo.ClientBounds do + Result := Right - Left; +end; + +procedure TcxGridTopDetailsSiteViewInfo.InitTabHitTest(AHitTest: TcxGridDetailsSiteTabHitTest); +begin + AHitTest.Owner := Control; +end; + +procedure TcxGridTopDetailsSiteViewInfo.ChangeActiveTab(ALevel: TcxGridLevel; + AFocusView: Boolean = False); +begin + Control.ActiveLevel := ALevel; +end; + +function TcxGridTopDetailsSiteViewInfo.DetailHasData(ALevel: TcxGridLevel): Boolean; +begin + Result := (ALevel.GridView <> nil) and not ALevel.GridView.ViewData.IsEmpty; +end; + +function TcxGridTopDetailsSiteViewInfo.SupportsTabAccelerators: Boolean; +begin + Result := True; +end; + +procedure TcxGridTopDetailsSiteViewInfo.VisibilityChanged(AVisible: Boolean); +begin + if not Control.IsDestroying then inherited; +end; + +{ TcxGridViewInfo } + +constructor TcxGridViewInfo.Create(AControl: TcxCustomGrid); +begin + inherited; + CreateViewInfos; +end; + +destructor TcxGridViewInfo.Destroy; +begin + DestroyViewInfos; + FDetailsSiteViewInfoCachedInfo.Free; + inherited; +end; + +function TcxGridViewInfo.GetBounds: TRect; +begin + Result := Control.Bounds; +end; + +function TcxGridViewInfo.GetClientBounds: TRect; +begin + Result := Control.ClientBounds; +end; + +function TcxGridViewInfo.GetEmptyAreaColor: TColor; +begin + Result := Control.Color; +end; + +procedure TcxGridViewInfo.CreateViewInfos; +begin + FDetailsSiteViewInfo := + TcxGridTopDetailsSiteViewInfoClass(GetDetailsSiteViewInfoClass).Create(Control.Levels); + if FDetailsSiteViewInfoCachedInfo <> nil then + FDetailsSiteViewInfo.SetCachedInfo(FDetailsSiteViewInfoCachedInfo); +end; + +procedure TcxGridViewInfo.DestroyViewInfos; +begin + FDetailsSiteViewInfo.GetCachedInfo(FDetailsSiteViewInfoCachedInfo); + FDetailsSiteViewInfo.Free; +end; + +function TcxGridViewInfo.GetDetailsSiteViewInfoClass: TcxGridTopDetailsSiteViewInfoClass; +begin + Result := TcxGridTopDetailsSiteViewInfo; +end; + +procedure TcxGridViewInfo.RecreateViewInfos; +begin + DestroyViewInfos; + CreateViewInfos; +end; + +procedure TcxGridViewInfo.Calculate; +begin + RecreateViewInfos; + with ClientBounds, TcxGridTopDetailsSiteViewInfo(FDetailsSiteViewInfo) do + if Visible then Calculate(Left, Top); +end; + +function TcxGridViewInfo.GetHitTest(X, Y: Integer): TcxCustomGridHitTest; +begin + Result := TcxGridTopDetailsSiteViewInfo(FDetailsSiteViewInfo).GetHitTest(Point(X, Y)); + if Result = nil then + Result := TcxGridNoneHitTest.Instance(Point(X, Y)); +end; + +{ TcxGridLevelTabs } + +constructor TcxGridLevelTabs.Create(AOwner: TcxCustomGrid); +begin + inherited Create; + FOwner := AOwner; + FCaptionAlignment := cxGridLevelTabsDefaultCaptionAlignment; + FFreeNotificator := TcxFreeNotificator.Create(nil); + FFreeNotificator.OnFreeNotification := FreeNotification; + FImageBorder := cxGridLevelTabsDefaultImageBorder; + FImagesChangeLink := TChangeLink.Create; + FImagesChangeLink.OnChange := ImagesChanged; + FSlants := TcxTabSlants.Create(Self); + FSlants.OnChange := SlantsChanged; + FStyle := cxPCDefaultStyle; +end; + +destructor TcxGridLevelTabs.Destroy; +begin + FSlants.Free; + FImagesChangeLink.Free; + FFreeNotificator.Free; + inherited; +end; + +procedure TcxGridLevelTabs.SetCaptionAlignment(Value: TAlignment); +begin + if FCaptionAlignment <> Value then + begin + FCaptionAlignment := Value; + Changed; + end; +end; + +procedure TcxGridLevelTabs.SetImageBorder(Value: Integer); +begin + if Value < 0 then Value := 0; + if FImageBorder <> Value then + begin + FImageBorder := Value; + Changed; + end; +end; + +procedure TcxGridLevelTabs.SetImages(Value: TCustomImageList); +begin + cxSetImageList(Value, FImages, FImagesChangeLink, FFreeNotificator); +end; + +procedure TcxGridLevelTabs.SetSlants(Value: TcxTabSlants); +begin + FSlants.Assign(Value); +end; + +procedure TcxGridLevelTabs.SetStyle(Value: TcxPCStyleID); +begin + if FStyle <> Value then + begin + FStyle := Value; + Changed; + end; +end; + +procedure TcxGridLevelTabs.FreeNotification(Sender: TComponent); +begin + if Sender = Images then Images := nil; +end; + +procedure TcxGridLevelTabs.ImagesChanged(Sender: TObject); +begin + Changed; +end; + +procedure TcxGridLevelTabs.SlantsChanged(Sender: TObject); +begin + Changed; +end; + +procedure TcxGridLevelTabs.Changed; +begin + FOwner.SizeChanged; +end; + +procedure TcxGridLevelTabs.Assign(Source: TPersistent); +begin + if Source is TcxGridLevelTabs then + with TcxGridLevelTabs(Source) do + begin + Self.CaptionAlignment := CaptionAlignment; + Self.ImageBorder := ImageBorder; + Self.Images := Images; + Self.Slants := Slants; + Self.Style := Style; + end + else + inherited; +end; + +{ TcxGridRootLevelOptions } + +constructor TcxGridRootLevelOptions.Create(ALevel: TcxGridLevel); +begin + inherited; + DetailFrameWidth := cxGridRootLevelDefaultDetailFrameWidth; +end; + +{ TcxGridRootLevel } + +function TcxGridRootLevel.GetOptionsClass: TcxGridLevelOptionsClass; +begin + Result := TcxGridRootLevelOptions; +end; + +{ TcxCustomGrid } + +constructor TcxCustomGrid.Create(AOwner: TComponent); +begin + inherited; + BorderStyle := cxcbsDefault; + ControlStyle := ControlStyle + [csDisplayDragImage]; + FDragOpening := True; + FDragOpeningWaitTime := cxGridDefaultDragOpeningWaitTime; + FLevelTabs := GetLevelTabsClass.Create(Self); + FNotifications := TList.Create; + FViews := TList.Create; + FChanges := TList.Create; + FChangesStack := TList.Create; + FTabStop := True; + Levels := GetLevelsClass.Create(nil); + CreateHandlers; + Width := 250; + Height := 200; +end; + +destructor TcxCustomGrid.Destroy; + + procedure HideRootViews; + var + I: Integer; + begin + for I := 0 to Levels.VisibleCount - 1 do + with Levels.VisibleItems[I] do + if GridView <> nil then GridView.ViewInfo.DoVisibilityChanged(False); + end; + +begin + HideRootViews; + //Levels := nil; + DestroyHandlers; + Levels := nil; + DestroyViews; + FViews.Free; + FreeAndNil(FNotifications); + FreeAndNil(FLevelTabs); + DestroyChanges(FChangesStack); + FreeAndNil(FChangesStack); + FreeAndNil(FChanges); + inherited; +end; + +function TcxCustomGrid.GetActiveView: TcxCustomGridView; +begin + if FActiveLevel = nil then + Result := nil + else + Result := FActiveLevel.GridView; +end; + +function TcxCustomGrid.GetFocusedViewNavigator: IcxNavigator; +begin + if (FocusedView = nil) or not Supports(FocusedView, IcxNavigator) then + Result := nil + else + Result := FocusedView as IcxNavigator; +end; + +function TcxCustomGrid.GetView(Index: Integer): TcxCustomGridView; +begin + Result := TcxCustomGridView(FViews[Index]); +end; + +function TcxCustomGrid.GetViewCount: Integer; +begin + Result := FViews.Count; +end; + +function TcxCustomGrid.GetRootLevelOptions: TcxGridLevelOptions; +begin + Result := FLevels.Options; +end; + +function TcxCustomGrid.GetRootLevelStyles: TcxGridLevelStyles; +begin + Result := FLevels.Styles; +end; + +function TcxCustomGrid.GetStructureNavigator: TcxCustomGridStructureNavigator; +begin + CreateStructureNavigator; + Result := FStructureNavigator; +end; + +function TcxCustomGrid.GetUpdateLocked: Boolean; +{ + function DataControllerLocked: Boolean; //!!!!!!!!!!!!!!!!!!!! + var + I, J: Integer; + + function CheckDataController(AView: TcxCustomGridView; out ALocked: Boolean): Boolean; + begin + ALocked := AView.DataController.LockCount <> 0; + Result := ALocked; + end; + + begin + for I := 0 to ViewCount - 1 do + begin + if CheckDataController(Views[I], Result) then Exit; + for J := 0 to Views[I].CloneCount - 1 do + if CheckDataController(Views[I].Clones[J], Result) then Exit; + end; + Result := False; + end; +} +begin + Result := (FUpdateLockCount <> 0) {or DataControllerLocked}; +end; + +procedure TcxCustomGrid.SetActiveLevel(Value: TcxGridLevel); +begin + if FActiveLevel <> Value then + begin + if Value = nil then + Value := FLevels.GetAvailableItem + else + if not Value.Visible then + Exit; + FActiveLevel := Value; + SizeChanged; + if not IsLoading and (FActiveLevel <> nil) then + DoActiveTabChanged(FActiveLevel); + if FActiveLevel <> nil then + FocusedView := FActiveLevel.GridView + else + FocusedView := nil; + end; +end; + +procedure TcxCustomGrid.SetDragOpeningWaitTime(Value: Integer); +begin + if Value < 0 then Value := 0; + FDragOpeningWaitTime := Value; +end; + +procedure TcxCustomGrid.SetFocusedView(Value: TcxCustomGridView); +var + APrevFocusedView: TcxCustomGridView; + APrevFocused: Boolean; + + function GetAvailableView: TcxCustomGridView; + var + I: Integer; + + function CheckMasterView(AView: TcxCustomGridView): TcxCustomGridView; + begin + Result := AView; + repeat + Result := Result.MasterGridView; + until (Result = nil) or not Result.IsDestroying; + end; + + begin + Result := CheckMasterView(FFocusedView); + if Result = nil then + begin + for I := 0 to Levels.Count - 1 do + begin + Result := Levels[I].GridView; + if (Result <> nil) and not Result.IsDestroying then Exit; + end; + Result := nil; + end; + end; + +begin + if (Value <> nil) and not TcxCustomGridViewAccess.CanFocus(Value) then Exit; + if FFocusedView <> Value then + begin + APrevFocusedView := FFocusedView; + if not IsDestroying and not IsDesigning and + ((Value = nil) and (ActiveLevel <> nil) and (ActiveLevel.GridView <> nil) or + (Value <> nil) and Value.IsDestroying) then + Value := GetAvailableView; + FFocusedView := Value; + if APrevFocusedView <> nil then + begin + APrevFocused := IsFocused; + try + TcxCustomGridViewAccess.FocusChanged(APrevFocusedView, False); + except + FocusedView := APrevFocusedView; + raise; + end; + if APrevFocused and not IsFocused then + SetFocus; + end; + if FFocusedView <> nil then + begin + TcxCustomGridViewAccess.FocusChanged(FFocusedView, True); + TcxGridLevel(FFocusedView.Level).Active := True; + end + else + if IsFocused and CanFocusEx then + SetFocus; + FocusedViewChanged(APrevFocusedView, FFocusedView); + end; +end; + +procedure TcxCustomGrid.SetLevels(Value: TcxGridLevel); +begin + FLevels.Free; + FLevels := Value; + if FLevels <> nil then + FLevels.Control := Self; +end; + +procedure TcxCustomGrid.SetLevelTabs(Value: TcxGridLevelTabs); +begin + FLevelTabs.Assign(Value); +end; + +procedure TcxCustomGrid.SetRootLevelOptions(Value: TcxGridLevelOptions); +begin +end; + +procedure TcxCustomGrid.SetRootLevelStyles(Value: TcxGridLevelStyles); +begin +end; + +procedure TcxCustomGrid.SetTabStop(Value: Boolean); +begin + if FTabStop <> Value then + begin + FTabStop := Value; + if FocusedView <> nil then + FocusedView.TabStop := FTabStop; + end; +end; + +procedure TcxCustomGrid.AddView(AView: TcxCustomGridView); +begin + FViews.Add(AView); + AView.DataController.SetMasterMode(nil, True); +end; + +procedure TcxCustomGrid.RemoveView(AView: TcxCustomGridView); +begin + FViews.Remove(AView); + DestroyViewChanges(AView); + //ViewChanged(AView, vsRemoved); +end; + +procedure TcxCustomGrid.DestroyViews; +var + I: Integer; +begin + for I := ViewCount - 1 downto 0 do + Views[I].Free; +end; + +procedure TcxCustomGrid.DestroyChanges(AChanges: TList); +var + I: Integer; +begin + for I := 0 to AChanges.Count - 1 do + TObject(AChanges[I]).Free; + AChanges.Clear; +end; + +procedure TcxCustomGrid.DestroyViewChanges(AView: TcxCustomGridView); + + procedure ClearViewChanges(AChanges: TList); + var + I: Integer; + begin + for I := AChanges.Count - 1 downto 0 do + if (TcxCustomGridChange(AChanges[I]) is TcxCustomGridViewChange) and + (TcxCustomGridViewChange(AChanges[I]).GridView = AView) then + begin + TObject(AChanges[I]).Free; + AChanges.Delete(I); + end; + end; + +begin + ClearViewChanges(FChanges); + ClearViewChanges(FChangesStack); +end; + +procedure TcxCustomGrid.CreateStructureNavigator; +begin + if (FStructureNavigator = nil) and + IsDesigning and (cxGridStructureNavigatorClass <> nil) and + (FController <> nil) and not FCreatingStructureNavigator then + begin + FCreatingStructureNavigator := True; + try + FStructureNavigator := cxGridStructureNavigatorClass.Create(Self); + finally + FCreatingStructureNavigator := False; + end; + end; +end; + +{procedure TcxCustomGrid.CMDeferUpdates(var Message: TMessage); +begin + DoProcessChangesStack; +end;} + +procedure TcxCustomGrid.CMDialogChar(var Message: TCMDialogChar); +begin + if TcxGridTopDetailsSiteViewInfo(ViewInfo.DetailsSiteViewInfo).ProcessDialogChar(Message.CharCode) then + Message.Result := 1 + else + inherited; +end; + +function TcxCustomGrid.NavigatorIsActive: Boolean; +begin + if FocusedViewNavigator = nil then + Result := False + else + Result := FocusedViewNavigator.IsActive; +end; + +function TcxCustomGrid.NavigatorIsBof: Boolean; +begin + if FocusedViewNavigator = nil then + Result := False + else + Result := FocusedViewNavigator.IsBof; +end; + +function TcxCustomGrid.NavigatorIsEof: Boolean; +begin + if FocusedViewNavigator = nil then + Result := False + else + Result := FocusedViewNavigator.IsEof; +end; + +function TcxCustomGrid.NavigatorCanAppend: Boolean; +begin + if FocusedViewNavigator = nil then + Result := False + else + Result := FocusedViewNavigator.CanAppend; +end; + +function TcxCustomGrid.NavigatorCanEdit: Boolean; +begin + if FocusedViewNavigator = nil then + Result := False + else + Result := FocusedViewNavigator.CanEdit; +end; + +function TcxCustomGrid.NavigatorCanDelete: Boolean; +begin + if FocusedViewNavigator = nil then + Result := False + else + Result := FocusedViewNavigator.CanDelete; +end; + +function TcxCustomGrid.NavigatorCanInsert: Boolean; +begin + if FocusedViewNavigator = nil then + Result := False + else + Result := FocusedViewNavigator.CanInsert; +end; + +function TcxCustomGrid.NavigatorIsEditing: Boolean; +begin + if FocusedViewNavigator = nil then + Result := False + else + Result := FocusedViewNavigator.IsEditing; +end; + +procedure TcxCustomGrid.NavigatorClearBookmark; +begin + if FocusedViewNavigator <> nil then + FocusedViewNavigator.ClearBookmark; +end; + +function TcxCustomGrid.NavigatorIsBookmarkAvailable: Boolean; +begin + if FocusedViewNavigator = nil then + Result := False + else + Result := FocusedViewNavigator.IsBookmarkAvailable; +end; + +procedure TcxCustomGrid.NavigatorDoAction(AButtonIndex: Integer); +begin + if FocusedViewNavigator <> nil then + FocusedViewNavigator.DoAction(AButtonIndex); +end; + +function TcxCustomGrid.NavigatorGetNotifier: TcxNavigatorControlNotifier; +begin + Result := FNavigatorNotifier; +end; + +function TcxCustomGrid.NavigatorIsActionSupported(AButtonIndex: Integer): Boolean; +begin + Result := True; +end; + +procedure TcxCustomGrid.AddChildComponent(AComponent: TcxControlChildComponent); +begin + inherited; + if AComponent is TcxCustomGridView then + AddView(TcxCustomGridView(AComponent)); +end; + +procedure TcxCustomGrid.RemoveChildComponent(AComponent: TcxControlChildComponent); +begin + inherited; + if AComponent is TcxCustomGridView then + RemoveView(TcxCustomGridView(AComponent)); +end; + +procedure TcxCustomGrid.BoundsChanged; +begin + SizeChanged; + inherited; + StructureNavigatorChanged; +end; + +procedure TcxCustomGrid.DoCancelMode; +begin + inherited; + FController.DoCancelMode; +end; + +procedure TcxCustomGrid.DoContextPopup(MousePos: TPoint; var Handled: Boolean); +begin + inherited; + if not Handled then + Handled := SendNotifications(gnkContextMenu, TObject((MousePos.X = -1) and (MousePos.Y = -1))); +end; + +procedure TcxCustomGrid.FocusChanged; +begin + inherited; + if not IsDestroying and Focused and (FocusedView <> nil) then + TcxCustomGridViewAccess.FocusChanged(FocusedView, True); +end; + +procedure TcxCustomGrid.GetChildren(Proc: TGetChildProc; Root: TComponent); +var + I: Integer; +begin + inherited; + for I := 0 to ViewCount - 1 do + if Views[I].Owner = Root then + Proc(Views[I]); + for I := 0 to FLevels.Count - 1 do + if FLevels[I].Owner = Root then + Proc(FLevels[I]); +end; + +function TcxCustomGrid.GetCursor(X, Y: Integer): TCursor; +begin + Result := FController.GetCursor(X, Y); + if Result = crDefault then + Result := inherited GetCursor(X, Y); +end; + +function TcxCustomGrid.GetDesignHitTest(X, Y: Integer; Shift: TShiftState): Boolean; +var + AHitTest: TcxCustomGridHitTest; +begin + Result := inherited GetDesignHitTest(X, Y, Shift); + if not Result and (ssLeft in Shift) then + begin + AHitTest := ViewInfo.GetHitTest(X, Y); + Result := AHitTest.HitTestCode = htTab; + end; +end; + +function TcxCustomGrid.GetIsFocused: Boolean; +var + AForm: TCustomForm; +begin + Result := FIsPopupControl{8} or inherited GetIsFocused; + if not Result then + begin + AForm := GetParentForm(Self); + Result := (AForm <> nil) and (AForm.ActiveControl <> Self) and + ContainsControl(AForm.ActiveControl) and AForm.ActiveControl.Focused and + (not (AForm.ActiveControl is TcxControl) or TcxControl(AForm.ActiveControl).IsFocused); + end; +end; + +procedure TcxCustomGrid.Loaded; +begin + inherited; + BeginUpdate; + try + LayoutChanged; + finally + EndUpdate; + end; + StructureNavigatorChanged; +end; + +function TcxCustomGrid.MayFocus: Boolean; +begin + Result := False; +end; + +procedure TcxCustomGrid.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + inherited; + FController.MouseDown(Button, Shift, X, Y); +end; + +procedure TcxCustomGrid.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited; + FController.MouseMove(Shift, X, Y); +end; + +procedure TcxCustomGrid.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + inherited; + FController.MouseUp(Button, Shift, X, Y); +end; + +procedure TcxCustomGrid.LookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); +var + I: Integer; +begin + inherited; + //SizeChanged; + for I := 0 to ViewCount - 1 do + TcxCustomGridViewAccess.LookAndFeelChanged(Views[I]); + SizeChanged; +end; + +procedure TcxCustomGrid.Paint; +begin + inherited; + FPainter.Paint; +end; + +procedure TcxCustomGrid.ReadState(Reader: TReader); +begin + if StructureNavigator <> nil then StructureNavigator.BeforeGridLoading; + inherited; +end; + +procedure TcxCustomGrid.SetChildOrder(Child: TComponent; Order: Integer); +begin + inherited; + if Child is TcxGridLevel then + TcxGridLevel(Child).Index := Order - ViewCount; +end; + +procedure TcxCustomGrid.SetName(const NewName: TComponentName); +var + AOldName: TComponentName; + ALevels: TList; + + procedure RetriveLevels; + + procedure AddLevel(ALevel: TcxGridLevel); + var + I: Integer; + begin + if ALevel.Name <> '' then ALevels.Add(ALevel); + for I := 0 to ALevel.Count - 1 do + AddLevel(ALevel[I]); + end; + + begin + AddLevel(Levels); + end; + +begin + AOldName := Name; + inherited; + if Name <> AOldName then + begin + RenameComponents(Self, Owner, Name, AOldName, ViewCount, @cxGrid.GetView); + ALevels := TList.Create; + try + RetriveLevels; + FTag := ALevels; + RenameComponents(Self, Owner, Name, AOldName, ALevels.Count, @cxGrid.GetLevel); + finally + ALevels.Free; + end; + StructureNavigatorChanged; + end; +end; + +procedure TcxCustomGrid.WndProc(var Message: TMessage); +begin + {if (Message.Msg = WM_MOUSEACTIVATE) and IsDesigning then + Exit;} + inherited WndProc(Message); +end; + +procedure TcxCustomGrid.DoEndDrag(Target: TObject; X, Y: Integer); +begin + FController.EndDrag(Target, X, Y); + inherited; +end; + +procedure TcxCustomGrid.DoStartDrag(var DragObject: TDragObject); +begin + inherited; + FController.StartDrag(DragObject); +end; + +procedure TcxCustomGrid.DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); +begin + inherited; + FController.DragOver(Source, X, Y, State, Accept); +end; + +procedure TcxCustomGrid.CreateHandlers; +begin + FController := GetControllerClass.Create(Self); + FPainter := GetPainterClass.Create(Self); + FViewInfo := GetViewInfoClass.Create(Self); + FNavigatorNotifier := TcxNavigatorControlNotifier.Create; + CreateStructureNavigator; +end; + +procedure TcxCustomGrid.DestroyHandlers; +begin + FreeAndNil(FStructureNavigator); + FreeAndNil(FNavigatorNotifier); + FreeAndNil(FViewInfo); + FreeAndNil(FPainter); + FreeAndNil(FController); +end; + +procedure TcxCustomGrid.DoActiveTabChanged(ALevel: TcxGridLevel); +begin + if StructureNavigator <> nil then StructureNavigator.BringToFront; + if Assigned(FOnActiveTabChanged) then FOnActiveTabChanged(Self, ALevel); +end; + +procedure TcxCustomGrid.DoChange(AGridChange: TcxCustomGridChange); +begin + try + if {IsLoading or - because of details} IsDestroying then Exit; + with AGridChange do + begin + Control := Self; + Execute; + end; + finally + AGridChange.Free; + end; +end; + +procedure TcxCustomGrid.DoLayoutChanged(AGridView: TcxCustomGridView); +begin + if Assigned(FOnLayoutChanged) then FOnLayoutChanged(Self, AGridView); +end; + +procedure TcxCustomGrid.DoProcessChangesStack; +begin + FProcessingChangesStack := True; + try + DoUpdate(FChangesStack); + finally + FProcessingChangesStack := False; + end; +end; + +procedure TcxCustomGrid.DoUpdate(AChanges: TList); +var + AFinalChanges: TList; + + procedure BuildFinalChangesList; + var + I, J: Integer; + AChange: TcxCustomGridChange; + + function FinalChangesContainClass(AChange: TcxCustomGridChange): Boolean; + var + I: Integer; + begin + for I := 0 to AFinalChanges.Count - 1 do + begin + Result := TcxCustomGridChange(AFinalChanges[I]).IsEqual(AChange); + if Result then Exit; + end; + Result := False; + end; + + begin + for I := 0 to AChanges.Count - 1 do + begin + AChange := TcxCustomGridChange(AChanges[I]); + if not AChange.IsCumulative or not FinalChangesContainClass(AChange) then + AFinalChanges.Add(AChange) + else + AChange.Free; + end; + AChanges.Clear; + + I := 0; + while I < AFinalChanges.Count do + begin + AChange := TcxCustomGridChange(AFinalChanges[I]); + for J := I + 1 to AFinalChanges.Count - 1 do + if AChange.IsCompatibleWith(TcxCustomGridChange(AFinalChanges[J])) then + begin + AChange.Free; + AFinalChanges.Delete(I); + Dec(I); + Break; + end; + Inc(I); + end; + + //!!! + for I := AFinalChanges.Count - 1 downto 0 do + begin + AChange := TcxCustomGridChange(AFinalChanges[I]); + for J := I - 1 downto 0 do + if AChange.IsCompatibleWith(TcxCustomGridChange(AFinalChanges[J])) then + begin + AChange.Free; + AFinalChanges.Delete(I); + Break; + end; + end; + end; + + procedure DoFinalChanges; + var + ALockChanges: Boolean; + I: Integer; + AChange: TcxCustomGridChange; + +// T: Integer; + + begin + +// T := GetTickCount; + + if AFinalChanges.Count = 0 then Exit; + ALockChanges := AFinalChanges.Count > 1; + if ALockChanges then + BeginUpdate; + try + for I := 0 to AFinalChanges.Count - 1 do + begin + AChange := TcxCustomGridChange(AFinalChanges[I]); + if ALockChanges and not AChange.CanExecuteWhenLocked then + EndUpdate; + DoChange(AChange); + if ALockChanges and not UpdateLocked then + BeginUpdate; + end; + finally + if ALockChanges then + EndUpdate; + end; + +// Application.MainForm.Caption := IntToStr(GetTickCount - T); + + end; + +begin + AFinalChanges := TList.Create; + try + BuildFinalChangesList; + DoFinalChanges; + finally + AFinalChanges.Free; + end; +end; + +procedure TcxCustomGrid.FocusedViewChanged(APrevFocusedView, AFocusedView: TcxCustomGridView); +begin + if IsDestroying then Exit; + RefreshNavigators; + SendNotifications(gnkFocusedViewChanged); + if Assigned(FOnFocusedViewChanged) then + FOnFocusedViewChanged(Self, APrevFocusedView, AFocusedView); +end; + +function TcxCustomGrid.GetControllerClass: TcxGridControllerClass; +begin + Result := TcxGridController; +end; + +function TcxCustomGrid.GetDefaultViewClass: TcxCustomGridViewClass; +begin + Result := nil; +end; + +function TcxCustomGrid.GetLevelsClass: TcxGridLevelClass; +begin + Result := TcxGridRootLevel; +end; + +function TcxCustomGrid.GetLevelTabsClass: TcxGridLevelTabsClass; +begin + Result := TcxGridLevelTabs; +end; + +function TcxCustomGrid.GetPainterClass: TcxGridPainterClass; +begin + Result := TcxGridPainter; +end; + +function TcxCustomGrid.GetViewInfoClass: TcxGridViewInfoClass; +begin + Result := TcxGridViewInfo; +end; + +procedure TcxCustomGrid.StructureNavigatorChanged; +begin + if StructureNavigator <> nil then StructureNavigator.Changed; +end; + +function TcxCustomGrid.UpdateOnRootViewDataChange: Boolean; +begin + Result := (RootLevelOptions.DetailTabsPosition <> dtpNone) and + not RootLevelOptions.TabsForEmptyDetails; +end; + +procedure TcxCustomGrid.Invalidate(AHardUpdate: Boolean = False); + + procedure InvalidateView(AView: TcxCustomGridView); + var + I: Integer; + begin + if AView = nil then Exit; + AView.Invalidate(AHardUpdate); + for I := 0 to TcxGridLevel(AView.Level).VisibleCount - 1 do + InvalidateView(TcxGridLevel(AView.Level).VisibleItems[I].GridView); + end; + +begin + if IsDestroying then Exit; + if AHardUpdate then + LayoutChanged + else + inherited Invalidate; + InvalidateView(ActiveView); +end; + +procedure TcxCustomGrid.RemoveFocus(AGoForward: Boolean); +begin + if IsFocused then + PostMessage(GetParentForm(Self).Handle, WM_NEXTDLGCTL, WPARAM(not AGoForward), LPARAM(False)); +end; + +procedure TcxCustomGrid.BeginUpdate; +begin + Inc(FUpdateLockCount); +end; + +procedure TcxCustomGrid.CancelUpdate; +begin + if FUpdateLockCount > 0 then + begin + Dec(FUpdateLockCount); + if FUpdateLockCount = 0 then + DestroyChanges(FChanges); + end; +end; + +procedure TcxCustomGrid.Changed(AGridChange: TcxCustomGridChange); +begin + if AGridChange.IsLockable then + if UpdateLocked then + FChanges.Add(AGridChange) + else +(* if HandleAllocated and not FProcessingChangesStack then + begin + if FChangesStack.Count = 0 then + PostMessage(Handle, CM_DEFERUPDATES, 0, 0); + FChangesStack.Add(AGridChange); + end + else *) + DoChange(AGridChange) + else + DoChange(AGridChange); +end; + +procedure TcxCustomGrid.CheckFocusedView; +begin + if (FFocusedView <> nil) and not TcxCustomGridViewAccess.CanFocus(FFocusedView) then + if (ActiveView <> nil) and TcxCustomGridViewAccess.CanFocus(ActiveView) then + ActiveView.Focused := True + else + FocusedView := nil; +end; + +procedure TcxCustomGrid.EndUpdate; +begin + if FUpdateLockCount > 0 then + begin + Dec(FUpdateLockCount); + if FUpdateLockCount = 0 then DoUpdate(FChanges); + end; +end; + +procedure TcxCustomGrid.LayoutChanged; +begin + if not IsLoading then + Changed(TcxGridLayoutChange.Create(nil)); +end; + +procedure TcxCustomGrid.LevelChanged(ALevel: TcxGridLevel; AChangeKind: TcxGridLevelChangeKind); +begin + StructureNavigatorChanged; +end; + +procedure TcxCustomGrid.RefreshNavigators; +begin + if FNavigatorNotifier <> nil then + FNavigatorNotifier.RefreshNavigatorButtons; +end; + +procedure TcxCustomGrid.SizeChanged; +begin + if not IsLoading then + Changed(TcxGridSizeChange.Create(nil)); +end; + +procedure TcxCustomGrid.UpdateFocusing(AChildFocused: Boolean); + + function NeedFocusingUpdate: Boolean; + begin + Result := + AChildFocused and not FLastFocused or + not AChildFocused and not IsFocused; + end; + +begin + if IsDestroying then Exit; + if NeedFocusingUpdate then + begin + FLastFocused := AChildFocused; + FController.FocusChanged; + end; +end; + +procedure TcxCustomGrid.ViewChanged(AView: TcxCustomGridView; + AChangeKind: TcxGridViewChangeNotificationKind); +begin + StructureNavigatorChanged; +end; + +function TcxCustomGrid.CreateView(AViewClass: TcxCustomGridViewClass): TcxCustomGridView; +begin + Result := AViewClass.Create(Owner); + Result.Control := Self; +// Result := AViewClass.CreateEx(Self); + AddView(Result); +end; + +function TcxCustomGrid.ViewExists(AView: TcxCustomGridView): Boolean; +var + I: Integer; +begin + for I := 0 to ViewCount - 1 do + begin + Result := (Views[I] = AView) or Views[I].HasAsClone(AView); + if Result then Exit; + end; + Result := False; +end; + +procedure TcxCustomGrid.RegisterNotification(ANotification: TcxCustomGridNotification); +begin + if FNotifications.IndexOf(ANotification) = -1 then + FNotifications.Add(ANotification); +end; + +procedure TcxCustomGrid.UnregisterNotification(ANotification: TcxCustomGridNotification); +begin + FNotifications.Remove(ANotification); +end; + +function TcxCustomGrid.SendNotifications(AKind: TcxGridNotificationKind; + AData: TObject = nil): Boolean; +var + I: Integer; + ANotification: TcxCustomGridNotification; +begin + Result := False; + if (AKind = gnkContextMenu) and IsDesigning then Exit; + for I := 0 to FNotifications.Count - 1 do + begin + ANotification := TcxCustomGridNotification(FNotifications[I]); + if AKind in ANotification.NotificationKinds then + begin + ANotification.Notify(AKind, AData, Result); + if Result then Break; + end; + end; +end; + +procedure TcxCustomGrid.RootViewDataChanged(AView: TcxCustomGridView); +begin + if UpdateOnRootViewDataChange then + LayoutChanged; +end; + +{ TcxGridViewRepository } + +constructor TcxGridViewRepository.Create(AOwner: TComponent); +begin + inherited; + FItems := TList.Create; +end; + +destructor TcxGridViewRepository.Destroy; +begin + DestroyItems; + FItems.Free; + inherited; +end; + +function TcxGridViewRepository.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxGridViewRepository.GetItem(Index: Integer): TcxCustomGridView; +begin + Result := TcxCustomGridView(FItems[Index]); +end; + +procedure TcxGridViewRepository.DestroyItems; +var + I: Integer; +begin + for I := Count - 1 downto 0 do + Items[I].Free; +end; + +procedure TcxGridViewRepository.GetChildren(Proc: TGetChildProc; Root: TComponent); +var + I: Integer; +begin + inherited; + for I := 0 to Count - 1 do + if Items[I].Owner = Root then + Proc(Items[I]); +end; + +procedure TcxGridViewRepository.AddItem(AItem: TcxCustomGridView); +begin + FItems.Add(AItem); + AItem.Repository := Self; + AItem.DataController.SetMasterMode(nil, True); +end; + +function TcxGridViewRepository.CreateItem(AItemClass: TcxCustomGridViewClass): TcxCustomGridView; +begin + Result := AItemClass.Create(Owner); + AddItem(Result); +end; + +procedure TcxGridViewRepository.RemoveItem(AItem: TcxCustomGridView); +begin + FItems.Remove(AItem); + AItem.Repository := nil; + if AItem.Control <> nil then + TcxCustomGrid(AItem.Control).DestroyViewChanges(AItem); +end; + +{ functions } + +function GetParentGrid(AControl: TControl): TcxCustomGrid; +var + AGridView: TcxCustomGridView; +begin + AGridView := GetParentGridView(AControl); + if AGridView = nil then + Result := nil + else + Result := TcxCustomGrid(AGridView.Control); +end; + +initialization + RegisterClass(TcxGridLevel); + PageControlDependsControls.Add(Pointer(TcxCustomGrid)); + +finalization + PageControlDependsControls.Remove(Pointer(TcxCustomGrid)); + + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGrid.res b/official/x.35/ExpressQuantumGrid 6/Sources/cxGrid.res new file mode 100644 index 00000000..04b9d5d7 Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Sources/cxGrid.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridBandedTableView.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridBandedTableView.pas new file mode 100644 index 00000000..6ba87a35 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridBandedTableView.pas @@ -0,0 +1,9438 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridBandedTableView; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Classes, Graphics, Controls, ComCtrls, cxClasses, cxControls, + cxGraphics, cxLookAndFeelPainters, cxStyles, cxStorage, cxPC, cxGridCommon, + cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridRows; + +const + cxGridBandedTableViewAlternateCaptionSeparator: string = '-'; + + cxGridDefaultFixedBandSeparatorWidth = 2; + cxGridDefaultEmptyBandWidth = 50; + + htBandedGridBase = htGridBase + 50; + htColumnHeaderVertSizingEdge = htBandedGridBase + 1; + htBand = htBandedGridBase + 2; + htBandHeader = htBandedGridBase + 3; + htBandHeaderSizingEdge = htBandedGridBase + 4; + htIndicatorBandHeader = htBandedGridBase + 5; + + bbBandedTableFirst = bbTableLast + 1; + bbBandBackground = bbBandedTableFirst; + bbBandHeader = bbBandedTableFirst + 1; + bbBandedTableLast = bbBandHeader; + + bsFirst = 0; + bsBackground = bsFirst; + bsContent = bsFirst + 1; + bsHeader = bsFirst + 2; + bsLast = bsHeader; + + vsBandedTableFirst = vsTableLast + 1; + vsBandBackground = vsBandedTableFirst; + vsBandHeader = vsBandedTableFirst + 1; + vsBandedTableLast = vsBandHeader; + +type + TcxGridBandedTableCustomizationForm = class; + TcxGridBandedTableController = class; + TcxGridBandedColumnContainerZone = class; + TcxGridBandHeaderViewInfo = class; + TcxGridIndicatorBandHeaderItemViewInfo = class; + TcxGridBandRowViewInfo = class; + TcxGridBandRowsViewInfo = class; + TcxGridBandViewInfo = class; + TcxGridBandsViewInfo = class; + TcxGridBandedHeaderViewInfo = class; + TcxGridBandedDataRowCellsAreaItemViewInfo = class; + TcxGridBandedDataRowCellsAreaViewInfo = class; + TcxGridBandedRowsViewInfo = class; + TcxGridBandedTableViewInfo = class; + TcxGridBandedColumnPosition = class; + TcxGridBandedColumn = class; + TcxGridBandRow = class; + TcxGridBandRows = class; + TcxGridBand = class; + TcxGridBands = class; + TcxGridBandedTableView = class; + + TcxGridBandFixedKind = (fkNone, fkLeft, fkRight); + + { hit tests } + + TcxGridColumnHeaderVertSizingEdgeHitTest = class(TcxCustomGridColumnHitTest) + protected + class function GetHitTestCode: Integer; override; + public + function Cursor: TCursor; override; + function DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; override; + end; + + TcxGridBandContainerKind = (bcHeader, bcCustomizationForm); + + TcxGridBandHitTest = class(TcxCustomGridViewHitTest) + private + FBand: TcxGridBand; + FBandContainerKind: TcxGridBandContainerKind; + FVisibleRowIndex: Integer; + protected + class function GetHitTestCode: Integer; override; + public + property Band: TcxGridBand read FBand write FBand; + property BandContainerKind: TcxGridBandContainerKind read FBandContainerKind + write FBandContainerKind; + property VisibleRowIndex: Integer read FVisibleRowIndex write FVisibleRowIndex; + end; + + TcxGridBandHeaderHitTest = class(TcxGridBandHitTest) + protected + class function GetHitTestCode: Integer; override; + public + function DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; override; + end; + + TcxGridBandHeaderSizingEdgeHitTest = class(TcxGridBandHitTest) + protected + class function GetHitTestCode: Integer; override; + public + function Cursor: TCursor; override; + function DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; override; + end; + + TcxGridIndicatorBandHeaderHitTest = class(TcxGridIndicatorHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + { controller } + + // drag&drop objects + + TcxGridBandedColumnContainerZone = class(TcxGridItemContainerZone) + public + Band: TcxGridBand; + ColIndex: Integer; + RowIndex: Integer; + constructor Create(AColumnIndex: Integer; + ABand: TcxGridBand; AColIndex, ARowIndex: Integer); + function IsEqual(Value: TcxGridItemContainerZone): Boolean; override; + function IsInsertion: Boolean; + end; + + TcxGridBandedColumnHeaderMovingObject = class(TcxGridColumnHeaderMovingObject) + private + function GetDestZone: TcxGridBandedColumnContainerZone; + function GetSourceItem: TcxGridBandedColumn; + function GetSourcePosition: TcxGridBandedColumnPosition; + function GetViewInfo: TcxGridBandedTableViewInfo; + procedure SetSourceItem(Value: TcxGridBandedColumn); + protected + function AreArrowsVertical: Boolean; override; + procedure CheckDestItemContainerKind(var AValue: TcxGridItemContainerKind); override; + procedure DoColumnMoving; override; + function GetArrowAreaBoundsForHeader(APlace: TcxGridArrowPlace): TRect; override; + function GetArrowsClientRect: TRect; override; + function IsValidDestinationForVisibleSource: Boolean; override; + property DestZone: TcxGridBandedColumnContainerZone read GetDestZone; + property SourceItem: TcxGridBandedColumn read GetSourceItem write SetSourceItem; + property SourcePosition: TcxGridBandedColumnPosition read GetSourcePosition; + property ViewInfo: TcxGridBandedTableViewInfo read GetViewInfo; + end; + + TcxGridBandHeaderMovingObject = class(TcxCustomGridTableMovingObject) + private + FDestBand: TcxGridBand; + FDestBandContainerKind: TcxGridBandContainerKind; + FDestInsertPosition: TcxPosition; + FIsEmptyViewInsert: Boolean; + FSourceBandContainerKind: TcxGridBandContainerKind; + function GetController: TcxGridBandedTableController; + function GetCustomizationForm: TcxGridBandedTableCustomizationForm; + function GetGridView: TcxGridBandedTableView; + function GetSourceBand: TcxGridBand; + function GetViewInfo: TcxGridBandedTableViewInfo; + procedure SetDestBand(Value: TcxGridBand); + procedure SetDestBandContainerKind(Value: TcxGridBandContainerKind); + procedure SetDestInsertPosition(Value: TcxPosition); + procedure SetIsEmptyViewInsert(Value: Boolean); + procedure SetSourceBand(Value: TcxGridBand); + protected + function AreArrowsVertical: Boolean; override; + function CalculateIsEmptyViewInsert(ACheckMousePos: Boolean): Boolean; + function CanRemove: Boolean; override; + procedure CheckDestParams; virtual; + function GetArrowAreaBounds(APlace: TcxGridArrowPlace): TRect; override; + function GetArrowsClientRect: TRect; override; + function GetCustomizationFormListBox: TcxCustomGridItemsListBox; override; + function GetSourceItemViewInfo: TcxCustomGridCellViewInfo; override; + function IsSourceCustomizationForm: Boolean; override; + function IsValidDestination: Boolean; override; + + procedure BeginDragAndDrop; override; + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); override; + procedure EndDragAndDrop(Accepted: Boolean); override; + + property Controller: TcxGridBandedTableController read GetController; + property CustomizationForm: TcxGridBandedTableCustomizationForm read GetCustomizationForm; + property DestBand: TcxGridBand read FDestBand write SetDestBand; + property DestBandContainerKind: TcxGridBandContainerKind read FDestBandContainerKind + write SetDestBandContainerKind; + property DestInsertPosition: TcxPosition read FDestInsertPosition + write SetDestInsertPosition; + property GridView: TcxGridBandedTableView read GetGridView; + property IsEmptyViewInsert: Boolean read FIsEmptyViewInsert write SetIsEmptyViewInsert; + property SourceBand: TcxGridBand read GetSourceBand write SetSourceBand; + property SourceBandContainerKind: TcxGridBandContainerKind read FSourceBandContainerKind + write FSourceBandContainerKind; + property ViewInfo: TcxGridBandedTableViewInfo read GetViewInfo; + public + procedure Init(const P: TPoint; AParams: TcxCustomGridHitTest); override; + end; + + TcxGridColumnVertSizingObject = class(TcxCustomGridColumnSizingObject) + private + function GetColumn: TcxGridBandedColumn; + function GetController: TcxGridBandedTableController; + function GetLineHeight: Integer; + protected + procedure BeginDragAndDrop; override; + procedure EndDragAndDrop(Accepted: Boolean); override; + function GetCurrentSize: Integer; override; + function GetIsHorizontalSizing: Boolean; override; + property Column: TcxGridBandedColumn read GetColumn; + property Controller: TcxGridBandedTableController read GetController; + property LineHeight: Integer read GetLineHeight; + end; + + TcxGridBandSizingObject = class(TcxCustomGridSizingObject) + private + FBand: TcxGridBand; + function GetBandViewInfo: TcxGridBandViewInfo; + function GetController: TcxGridBandedTableController; + function GetGridView: TcxGridBandedTableView; + protected + procedure BeginDragAndDrop; override; + procedure EndDragAndDrop(Accepted: Boolean); override; + + function GetCurrentSize: Integer; override; + function GetSizingItemBounds: TRect; override; + function GetSizingMarkWidth: Integer; override; + + property Band: TcxGridBand read FBand write FBand; + property BandViewInfo: TcxGridBandViewInfo read GetBandViewInfo; + property Controller: TcxGridBandedTableController read GetController; + property GridView: TcxGridBandedTableView read GetGridView; + public + procedure Init(const P: TPoint; AParams: TcxCustomGridHitTest); override; + end; + + // customization form + + TcxGridBandedTableBandsListBoxClass = class of TcxGridBandedTableBandsListBox; + + TcxGridBandedTableBandsListBox = class(TcxGridTableItemsListBox) + private + function GetGridView: TcxGridBandedTableView; + protected + function DrawItemDrawBackgroundHandler(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; override; + function GetDragAndDropParams: TcxCustomGridHitTest; override; + function GetItemEndEllipsis: Boolean; override; + property GridView: TcxGridBandedTableView read GetGridView; + public + procedure RefreshItems; override; + end; + + TcxGridBandedTableCustomizationForm = class(TcxGridTableCustomizationForm) + private + FBandsListBox: TcxGridBandedTableBandsListBox; + FBandsPage: TcxTabSheet; + function GetGridView: TcxGridBandedTableView; + protected + procedure CreateControls; override; + procedure InitPageControl; override; + + function GetBandsListBoxClass: TcxGridBandedTableBandsListBoxClass; virtual; + + property BandsListBox: TcxGridBandedTableBandsListBox read FBandsListBox; + property GridView: TcxGridBandedTableView read GetGridView; + public + procedure RefreshData; override; + property BandsPage: TcxTabSheet read FBandsPage; + end; + + // popup + + TcxGridBandsCustomizationPopupClass = class of TcxGridBandsCustomizationPopup; + + TcxGridBandsCustomizationPopup = class(TcxCustomGridCustomizationPopup) + private + function GetGridView: TcxGridBandedTableView; + protected + procedure AddCheckListBoxItems; override; + function GetDropDownCount: Integer; override; + function SupportsItemMoving: Boolean; override; + + procedure ItemClicked(AItem: TObject; AChecked: Boolean); override; + function GetItemIndex(AItem: TObject): Integer; override; + procedure SetItemIndex(AItem: TObject; AIndex: Integer); override; + public + property GridView: TcxGridBandedTableView read GetGridView; + end; + + // controller + + TcxGridBandedTableController = class(TcxGridTableController) + private + FBandsCustomizationPopup: TcxGridBandsCustomizationPopup; + FForcingWidthBand: TcxGridBand; + FMovingBand: TcxGridBand; + FPressedBand: TcxGridBand; + FSizingBand: TcxGridBand; + FVertSizingColumn: TcxGridBandedColumn; + function GetBandsCustomizationPopup: TcxGridBandsCustomizationPopup; + function GetGridView: TcxGridBandedTableView; + function GetIsBandMoving: Boolean; + function GetIsBandSizing: Boolean; + function GetIsColumnVertSizing: Boolean; + function GetViewInfo: TcxGridBandedTableViewInfo; + procedure SetPressedBand(Value: TcxGridBand); + protected + function GetBandsCustomizationPopupClass: TcxGridBandsCustomizationPopupClass; virtual; + function GetColumnHeaderDragAndDropObjectClass: TcxGridColumnHeaderMovingObjectClass; override; + procedure GetColumnNeighbors(AColumn: TcxGridBandedColumn; AGoForward: Boolean; + AList: TList); virtual; + function GetCustomizationFormClass: TcxCustomGridCustomizationFormClass; override; + function GetDesignHitTest(AHitTest: TcxCustomGridHitTest): Boolean; override; + function GetPatternObject(AObject: TPersistent): TPersistent; override; + function IsBandFixedDuringSizing(ABand: TcxGridBand): Boolean; virtual; + function IsColumnFixedDuringHorzSizing(AColumn: TcxGridColumn): Boolean; override; + procedure LeftPosChanged; override; + + // cells selection + function GetCellMultiSelect: Boolean; override; + + property ForcingWidthBand: TcxGridBand read FForcingWidthBand write FForcingWidthBand; + property ViewInfo: TcxGridBandedTableViewInfo read GetViewInfo; + public + destructor Destroy; override; + procedure DoCancelMode; override; + procedure EndDragAndDrop(Accepted: Boolean); override; + function HasBandsCustomizationPopup: Boolean; + + function FindNextColumnVertically(AFocusedItemIndex: Integer; + AGoForward, AGoOnCycle: Boolean): Integer; virtual; + function FindNextItem(AFocusedItemIndex: Integer; + AGoForward, AGoOnCycle: Boolean; out ACycleChanged: Boolean; + ARecord: TcxCustomGridRecord): Integer; override; + function FocusNextColumnVertically(AFocusedColumnIndex: Integer; + AGoForward, AGoOnCycle: Boolean): Boolean; + + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + + property BandsCustomizationPopup: TcxGridBandsCustomizationPopup read GetBandsCustomizationPopup; + property GridView: TcxGridBandedTableView read GetGridView; + property IsBandMoving: Boolean read GetIsBandMoving; + property IsBandSizing: Boolean read GetIsBandSizing; + property IsColumnVertSizing: Boolean read GetIsColumnVertSizing; + property MovingBand: TcxGridBand read FMovingBand; + property PressedBand: TcxGridBand read FPressedBand write SetPressedBand; + property SizingBand: TcxGridBand read FSizingBand; + property VertSizingColumn: TcxGridBandedColumn read FVertSizingColumn; + end; + + { painters } + + TcxGridBandHeaderPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridBandHeaderViewInfo; + protected + procedure DrawBorders; override; + procedure DrawContent; override; + procedure DrawPressed; virtual; + function ExcludeFromClipRect: Boolean; override; + procedure Paint; override; + property ViewInfo: TcxGridBandHeaderViewInfo read GetViewInfo; + end; + + TcxGridBandPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridBandViewInfo; + protected + procedure DrawChildBands; virtual; + procedure DrawColumnHeaders; virtual; + procedure DrawContent; override; + procedure DrawHeader; virtual; + function ExcludeFromClipRect: Boolean; override; + property ViewInfo: TcxGridBandViewInfo read GetViewInfo; + end; + + TcxGridBandedHeaderPainter = class(TcxGridHeaderPainter) + private + function GetViewInfo: TcxGridBandedHeaderViewInfo; + protected + procedure DrawBands; virtual; + procedure DrawItems; override; + property ViewInfo: TcxGridBandedHeaderViewInfo read GetViewInfo; + end; + + TcxGridBandedFooterPainter = class(TcxGridFooterPainter) + protected + procedure DrawItems; override; + end; + + TcxGridIndicatorBandHeaderItemPainter = class(TcxGridIndicatorHeaderItemPainter) + private + function GetViewInfo: TcxGridIndicatorBandHeaderItemViewInfo; + protected + function DrawBackgroundHandler(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; override; + property ViewInfo: TcxGridIndicatorBandHeaderItemViewInfo read GetViewInfo; + end; + + TcxGridBandedDataRowCellsAreaItemPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridBandedDataRowCellsAreaItemViewInfo; + protected + procedure DrawFixedBandsSeparator; virtual; + procedure DrawContent; override; + procedure DrawLines; virtual; + function ExcludeFromClipRect: Boolean; override; + procedure Paint; override; + property ViewInfo: TcxGridBandedDataRowCellsAreaItemViewInfo read GetViewInfo; + end; + + TcxGridBandedRowsPainter = class(TcxGridRowsPainter) + public + class procedure DrawDataRowCells(ARowViewInfo: TcxCustomGridRowViewInfo); override; + end; + + TcxGridBandedTablePainter = class(TcxGridTablePainter) + private + function GetViewInfo: TcxGridBandedTableViewInfo; + protected + function CanOffset(AItemsOffset, DX, DY: Integer): Boolean; override; + public + property ViewInfo: TcxGridBandedTableViewInfo read GetViewInfo; + end; + + { view infos } + + // column container + + // column header + + TcxGridBandedColumnHeaderVertSizingEdgeViewInfo = class(TcxGridColumnHeaderAreaViewInfo) + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetAlignmentVert: TcxAlignmentVert; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function OccupiesSpace: Boolean; override; + function ResidesInContent: Boolean; override; + public + procedure Calculate(const ABounds: TRect; var ATextAreaBounds: TRect); override; + end; + + TcxGridBandedColumnHeaderViewInfo = class(TcxGridColumnHeaderViewInfo) + private + function GetBandViewInfo: TcxGridBandViewInfo; + function GetColumn: TcxGridBandedColumn; + function GetContainer: TcxGridBandedHeaderViewInfo; + function GetRowViewInfo: TcxGridBandRowViewInfo; + protected + function CanVertSize: Boolean; virtual; + procedure GetAreaViewInfoClasses(AProc: TcxGridClassEnumeratorProc); override; + function GetMaxWidth: Integer; override; + property BandViewInfo: TcxGridBandViewInfo read GetBandViewInfo; + property Container: TcxGridBandedHeaderViewInfo read GetContainer; + property RowViewInfo: TcxGridBandRowViewInfo read GetRowViewInfo; + public + property Column: TcxGridBandedColumn read GetColumn; + end; + + // bands + + TcxGridBandHeaderViewInfoClass = class of TcxGridBandHeaderViewInfo; + + TcxGridBandHeaderViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FBandViewInfo: TcxGridBandViewInfo; + function GetBand: TcxGridBand; + function GetGridView: TcxGridBandedTableView; + function GetGridViewInfo: TcxGridBandedTableViewInfo; + function GetRowCount: Integer; + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function CanShowHint: Boolean; override; + function CustomDraw(ACanvas: TcxCanvas): Boolean; override; + function GetAlignmentHorz: TAlignment; override; + function GetAlignmentVert: TcxAlignmentVert; override; + function GetAreaBounds: TRect; override; + function GetBackgroundBitmap: TBitmap; override; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + function GetCanvas: TcxCanvas; override; + class function GetCellHeight(ATextHeight: Integer; + ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; override; + function GetHeight: Integer; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetHotTrack: Boolean; override; + function GetIsDesignSelected: Boolean; override; + function GetIsPressed: Boolean; virtual; + function GetMultiLinePainting: Boolean; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetShowEndEllipsis: Boolean; override; + function GetSizingEdgeBounds: TRect; virtual; + function GetText: string; override; + function GetVisible: Boolean; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function HasCustomDraw: Boolean; override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + property SizingEdgeBounds: TRect read GetSizingEdgeBounds; + public + constructor Create(ABandViewInfo: TcxGridBandViewInfo); reintroduce; virtual; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + property Band: TcxGridBand read GetBand; + property BandViewInfo: TcxGridBandViewInfo read FBandViewInfo; + property GridView: TcxGridBandedTableView read GetGridView; + property GridViewInfo: TcxGridBandedTableViewInfo read GetGridViewInfo; + property IsPressed: Boolean read GetIsPressed; + property RowCount: Integer read GetRowCount; + end; + + TcxGridBandRowViewInfoClass = class of TcxGridBandRowViewInfo; + + TcxGridBandRowViewInfo = class + private + FColumnViewInfos: TList; + FHeight: Integer; + FIndex: Integer; + FRowsViewInfo: TcxGridBandRowsViewInfo; + function GetBandRow: TcxGridBandRow; + function GetBandViewInfo: TcxGridBandViewInfo; + function GetColumnViewInfo(Index: Integer): TcxGridBandedColumnHeaderViewInfo; + function GetColumnViewInfoCount: Integer; + function GetGridView: TcxGridBandedTableView; + function GetHeight: Integer; + function GetLineHeight: Integer; + function GetMinWidth: Integer; + function GetWidth: Integer; + protected + procedure AddColumnViewInfos; virtual; + procedure Calculate(const ABounds: TRect); virtual; + procedure CalculateColumnWidths; virtual; + function CalculateHeight: Integer; virtual; + function CalculateLineHeight: Integer; virtual; + function CalculateWidth: Integer; virtual; + property GridView: TcxGridBandedTableView read GetGridView; + property LineHeight: Integer read GetLineHeight; + public + Bounds: TRect; + constructor Create(ARowsViewInfo: TcxGridBandRowsViewInfo; AIndex: Integer); virtual; + destructor Destroy; override; + procedure AssignColumnWidths; + procedure Offset(DX, DY: Integer); virtual; + property BandRow: TcxGridBandRow read GetBandRow; + property BandViewInfo: TcxGridBandViewInfo read GetBandViewInfo; + property ColumnViewInfoCount: Integer read GetColumnViewInfoCount; + property ColumnViewInfos[Index: Integer]: TcxGridBandedColumnHeaderViewInfo read GetColumnViewInfo; default; + property Index: Integer read FIndex; + property MinWidth: Integer read GetMinWidth; + property RowsViewInfo: TcxGridBandRowsViewInfo read FRowsViewInfo; + property Height: Integer read GetHeight; + property Width: Integer read GetWidth; + end; + + TcxGridBandRowsViewInfoClass = class of TcxGridBandRowsViewInfo; + + TcxGridBandRowsViewInfo = class + private + FBandViewInfo: TcxGridBandViewInfo; + FItems: TList; + FWidth: Integer; + function GetBandRows: TcxGridBandRows; + function GetCount: Integer; + function GetItem(Index: Integer): TcxGridBandRowViewInfo; + function GetMinWidth: Integer; + function GetWidth: Integer; + procedure CreateItems; + procedure DestroyItems; + protected + procedure AssignColumnWidths; + procedure Calculate(const ABounds: TRect); virtual; + procedure CalculateColumnWidths; virtual; + function CalculateWidth: Integer; virtual; + function GetBandRowViewInfoClass: TcxGridBandRowViewInfoClass; virtual; + public + Bounds: TRect; + constructor Create(ABandViewInfo: TcxGridBandViewInfo); virtual; + destructor Destroy; override; + //function GetColumnsHitTest(const P: TPoint): TcxCustomGridHitTest; virtual; + function IndexAtPos(const P: TPoint): Integer; + procedure Offset(DX, DY: Integer); virtual; + property BandRows: TcxGridBandRows read GetBandRows; + property BandViewInfo: TcxGridBandViewInfo read FBandViewInfo; + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxGridBandRowViewInfo read GetItem; default; + property MinWidth: Integer read GetMinWidth; + property Width: Integer read GetWidth; + end; + + TcxGridBandViewInfoClass = class of TcxGridBandViewInfo; + + TcxGridBandViewInfo = class(TcxCustomGridCellViewInfo) + private + FBandsViewInfo: TcxGridBandsViewInfo; + FBottomIndex: Integer; + FColumnViewInfos: TList; + FHeaderViewInfo: TcxGridBandHeaderViewInfo; + FIndex: Integer; + FRowsViewInfo: TcxGridBandRowsViewInfo; + FWidth: Integer; + function GetBand: TcxGridBand; + function GetBoundsForBandInsert: TRect; + function GetChildBandViewInfo(Index: Integer): TcxGridBandViewInfo; + function GetChildBandViewInfoCount: Integer; + function GetColumnViewInfo(Index: Integer): TcxGridBandedColumnHeaderViewInfo; + function GetColumnViewInfoCount: Integer; + function GetContainerViewInfo: TcxGridBandedHeaderViewInfo; + function GetFixedKind: TcxGridBandFixedKind; + function GetGridView: TcxGridBandedTableView; + function GetGridViewInfo: TcxGridBandedTableViewInfo; + function GetIsBottom: Boolean; + function GetIsFixed: Boolean; + function GetIsRight: Boolean; + function GetIsRoot: Boolean; + function GetParentBandViewInfo: TcxGridBandViewInfo; + function GetRowCount: Integer; + function GetSameLevelAutoWidth: Integer; + function GetSameLevelItem(Index: Integer): TcxGridBandViewInfo; + function GetSameLevelItemCount: Integer; + protected + procedure AddColumnViewInfos; virtual; + procedure AssignChildBandWidths; + procedure AssignColumnWidths; + procedure CalculateChildBandWidths; virtual; + procedure CalculateChildBands(R: TRect); virtual; + function CalculateChildBandsBounds: TRect; virtual; + function CalculateColumnsBounds: TRect; virtual; + procedure CalculateColumnWidths; virtual; + function CalculateHeaderBounds: TRect; virtual; + //function CalculateHeaderHeightWithChildren: Integer; + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function CanSize: Boolean; virtual; + procedure CheckWidth(var Value: Integer); virtual; + function CustomDrawBackground(ACanvas: TcxCanvas): Boolean; override; + function GetAreAllColumnsFixed: Boolean; virtual; + function GetBackgroundBitmap: TBitmap; override; + function GetBorderColor(AIndex: TcxBorder): TColor; override; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + function GetCanvas: TcxCanvas; override; + function GetContentWidth: Integer; override; + class function GetHeaderViewInfoClass: TcxGridBandHeaderViewInfoClass; virtual; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetMaxContentWidth: Integer; virtual; + function GetMaxWidth: Integer; virtual; + function GetMinContentWidth: Integer; virtual; + function GetMinWidth: Integer; virtual; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetRowsViewInfoClass: TcxGridBandRowsViewInfoClass; virtual; + procedure GetViewParams(var AParams: TcxViewParams); override; + function GetWidth: Integer; override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + procedure Offset(DX, DY: Integer); override; + procedure SetWidth(Value: Integer); override; + property BoundsForBandInsert: TRect read GetBoundsForBandInsert; + public + constructor Create(ABandsViewInfo: TcxGridBandsViewInfo; AIndex: Integer); virtual; + destructor Destroy; override; + procedure Calculate(const ABounds: TRect); override; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + procedure InitAutoWidthItem(AAutoWidthItem: TcxAutoWidthItem); + function InsertPositionAtPos(const P: TPoint; out ABand: TcxGridBand; + out AInsertPosition: TcxPosition): Boolean; + + property AreAllColumnsFixed: Boolean read GetAreAllColumnsFixed; + property Band: TcxGridBand read GetBand; + property BandsViewInfo: TcxGridBandsViewInfo read FBandsViewInfo; + property BottomIndex: Integer read FBottomIndex; + property ChildBandViewInfoCount: Integer read GetChildBandViewInfoCount; + property ChildBandViewInfos[Index: Integer]: TcxGridBandViewInfo read GetChildBandViewInfo; + property ColumnViewInfoCount: Integer read GetColumnViewInfoCount; + property ColumnViewInfos[Index: Integer]: TcxGridBandedColumnHeaderViewInfo read GetColumnViewInfo; default; + property ContainerViewInfo: TcxGridBandedHeaderViewInfo read GetContainerViewInfo; + property FixedKind: TcxGridBandFixedKind read GetFixedKind; + property GridView: TcxGridBandedTableView read GetGridView; + property GridViewInfo: TcxGridBandedTableViewInfo read GetGridViewInfo; + property HeaderViewInfo: TcxGridBandHeaderViewInfo read FHeaderViewInfo; + property Index: Integer read FIndex; + property IsBottom: Boolean read GetIsBottom; + property IsFixed: Boolean read GetIsFixed; + property IsRight: Boolean read GetIsRight; + property IsRoot: Boolean read GetIsRoot; + property MaxContentWidth: Integer read GetMaxContentWidth; + property MaxWidth: Integer read GetMaxWidth; + property MinContentWidth: Integer read GetMinContentWidth; + property MinWidth: Integer read GetMinWidth; + property ParentBandViewInfo: TcxGridBandViewInfo read GetParentBandViewInfo; + property RowCount: Integer read GetRowCount; + property RowsViewInfo: TcxGridBandRowsViewInfo read FRowsViewInfo; + property SameLevelItemCount: Integer read GetSameLevelItemCount; + property SameLevelItems[Index: Integer]: TcxGridBandViewInfo read GetSameLevelItem; + property SameLevelAutoWidth: Integer read GetSameLevelAutoWidth; + end; + + TcxGridBandsViewInfoClass = class of TcxGridBandsViewInfo; + + TcxGridBandsViewInfo = class + private + FContainerViewInfo: TcxGridBandedHeaderViewInfo; + FBandHeaderRowHeights: TList; + FBandHeadersAreaHeight: Integer; + FItems: TList; + FLineCount: Integer; + FRowCount: Integer; + function GetBandHeaderRowCount: Integer; + function GetBandHeaderRowHeight(Index: Integer): Integer; + function GetBandHeadersAreaHeight: Integer; + function GetBands: TcxGridBands; + function GetBottomItem(Index: Integer): TcxGridBandViewInfo; + function GetBottomItemCount: Integer; + function GetColumnHeadersAreaHeight: Integer; + function GetCount: Integer; + function GetGridView: TcxGridBandedTableView; + function GetGridViewInfo: TcxGridBandedTableViewInfo; + function GetInternalItem(Index: Integer): TcxGridBandViewInfo; + function GetItem(Index: Integer): TcxGridBandViewInfo; + function GetLastFixedItem(AFixedKind: TcxGridBandFixedKind; ALevelIndex: Integer): TcxGridBandViewInfo; + function GetLineCount: Integer; + function GetRootItem(Index: Integer): TcxGridBandViewInfo; + function GetRootItemCount: Integer; + function GetRowCount: Integer; + procedure SetBandHeaderRowHeight(Index: Integer; Value: Integer); + procedure CreateItems; + procedure DestroyItems; + protected + function AddIndicatorItems(AIndicatorViewInfo: TcxGridIndicatorViewInfo; ATopBound: Integer): Boolean; virtual; + procedure Calculate; virtual; + function CalculateBandHeaderHeight(ABandHeaderViewInfo: TcxGridBandHeaderViewInfo): Integer; virtual; + procedure CalculateBandHeaderRowHeights; virtual; + function CalculateBandHeadersAreaHeight: Integer; virtual; + procedure CalculateColumnWidths; virtual; + function CalculateHeight: Integer; virtual; + function CalculateWidth: Integer; virtual; + function DrawBandHeaderBackgroundHandler(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; virtual; + function GetBandBackgroundBitmap: TBitmap; virtual; + function GetBandHeaderBackgroundBitmap: TBitmap; virtual; + function GetItemClass: TcxGridBandViewInfoClass; virtual; + function IsBandHeaderHeightAssigned: Boolean; virtual; + function ShowBandHeaders: Boolean; virtual; + function ShowColumnHeaders: Boolean; virtual; + + property BandHeadersAreaHeight: Integer read GetBandHeadersAreaHeight; + property ColumnHeadersAreaHeight: Integer read GetColumnHeadersAreaHeight; + property GridViewInfo: TcxGridBandedTableViewInfo read GetGridViewInfo; + property InternalItems[Index: Integer]: TcxGridBandViewInfo read GetInternalItem; + public + constructor Create(AContainerViewInfo: TcxGridBandedHeaderViewInfo); virtual; + destructor Destroy; override; + procedure AssignRootItemWidths; + //function GetColumnsHitTest(const P: TPoint): TcxCustomGridHitTest; virtual; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; virtual; + function GetItemAreaBounds(ABand: TcxGridBand): TRect; virtual; + procedure InsertPositionAtPos(const P: TPoint; out ABand: TcxGridBand; + out AInsertPosition: TcxPosition); + procedure Offset(DX, DY: Integer); virtual; + property BandBackgroundBitmap: TBitmap read GetBandBackgroundBitmap; + property BandHeaderBackgroundBitmap: TBitmap read GetBandHeaderBackgroundBitmap; + property BandHeaderRowCount: Integer read GetBandHeaderRowCount; + property BandHeaderRowHeights[Index: Integer]: Integer read GetBandHeaderRowHeight write SetBandHeaderRowHeight; + property Bands: TcxGridBands read GetBands; + property BottomItemCount: Integer read GetBottomItemCount; + property BottomItems[Index: Integer]: TcxGridBandViewInfo read GetBottomItem; + property ContainerViewInfo: TcxGridBandedHeaderViewInfo read FContainerViewInfo; + property Count: Integer read GetCount; + property GridView: TcxGridBandedTableView read GetGridView; + property Items[Index: Integer]: TcxGridBandViewInfo read GetItem; default; + property LastFixedItems[AFixedKind: TcxGridBandFixedKind; ALevelIndex: Integer]: TcxGridBandViewInfo read GetLastFixedItem; + property LineCount: Integer read GetLineCount; + property RootItemCount: Integer read GetRootItemCount; + property RootItems[Index: Integer]: TcxGridBandViewInfo read GetRootItem; + property RowCount: Integer read GetRowCount; + end; + + // header + + TcxGridBandedHeaderViewInfoSpecific = class(TcxGridHeaderViewInfoSpecific) + private + function GetGridViewInfo: TcxGridBandedTableViewInfo; + protected + function CalculateHeight: Integer; override; + public + property GridViewInfo: TcxGridBandedTableViewInfo read GetGridViewInfo; + end; + + TcxGridBandedHeaderViewInfo = class(TcxGridHeaderViewInfo) + private + FBandsViewInfo: TcxGridBandsViewInfo; + function GetGridView: TcxGridBandedTableView; + function GetGridViewInfo: TcxGridBandedTableViewInfo; + function GetItem(Index: Integer): TcxGridBandedColumnHeaderViewInfo; + function GetLineCount: Integer; + function GetRowCount: Integer; + function GetSpecific: TcxGridBandedHeaderViewInfoSpecific; + protected + procedure AddIndicatorItems(AIndicatorViewInfo: TcxGridIndicatorViewInfo; ATopBound: Integer); override; + procedure CalculateColumnAutoWidths; override; + procedure CalculateColumnWidths; override; + function CalculateHeight: Integer; override; + procedure CalculateItems; override; + function GetBandsViewInfoClass: TcxGridBandsViewInfoClass; virtual; + function GetColumnNeighbors(AColumn: TcxGridColumn): TcxNeighbors; override; + function GetIsScrollable: Boolean; override; + function GetItemAreaBounds(AItem: TcxGridColumnHeaderViewInfo): TRect; override; + function GetItemClass: TcxGridColumnHeaderViewInfoClass; override; + function GetItemMultiLinePainting(AItem: TcxGridColumnHeaderViewInfo): Boolean; override; + function GetItemsAreaBounds: TRect; override; + function GetItemsHitTest(const P: TPoint): TcxCustomGridHitTest; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetVisible: Boolean; override; + function GetWidth: Integer; override; + function IsHeightAssigned: Boolean; override; + procedure Offset(DX, DY: Integer); override; + public + constructor Create(AGridViewInfo: TcxCustomGridTableViewInfo); override; + destructor Destroy; override; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + function GetZone(const P: TPoint): TcxGridItemContainerZone; override; + property BandsViewInfo: TcxGridBandsViewInfo read FBandsViewInfo; + property GridView: TcxGridBandedTableView read GetGridView; + property GridViewInfo: TcxGridBandedTableViewInfo read GetGridViewInfo; + property Items[Index: Integer]: TcxGridBandedColumnHeaderViewInfo read GetItem; default; + property LineCount: Integer read GetLineCount; + property RowCount: Integer read GetRowCount; + property Specific: TcxGridBandedHeaderViewInfoSpecific read GetSpecific; + end; + + // footer + + TcxGridBandedFooterViewInfo = class(TcxGridFooterViewInfo) + protected + function GetItemMultiLinePainting(AItem: TcxGridColumnHeaderViewInfo): Boolean; override; + procedure PrepareSummaryItems(ASummaryItems: TList); override; + end; + + // indicator + + TcxGridIndicatorBandHeaderItemViewInfo = class(TcxGridIndicatorHeaderItemViewInfo) + private + function GetGridView: TcxGridBandedTableView; + protected + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetText: string; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function SupportsQuickCustomization: Boolean; override; + + function DropDownWindowExists: Boolean; override; + function GetDropDownWindow: TcxCustomGridPopup; override; + public + property GridView: TcxGridBandedTableView read GetGridView; + end; + + TcxGridBandedIndicatorViewInfo = class(TcxGridIndicatorViewInfo) + protected + function GetAlwaysVisible: Boolean; override; + end; + + // rows + + TcxGridFixedBandsSeparatorLocation = (slNone, slLeft, slRight); + + TcxGridBandedDataRowCellsAreaItemViewInfoClass = class of TcxGridBandedDataRowCellsAreaItemViewInfo; + + TcxGridBandedDataRowCellsAreaItemViewInfo = class(TcxGridCellViewInfo) + private + FBandViewInfo: TcxGridBandViewInfo; + FCellsAreaViewInfo: TcxGridBandedDataRowCellsAreaViewInfo; + FLineBounds: TList; + function GetFixedBandsSeparatorLocation: TcxGridFixedBandsSeparatorLocation; + function GetGridViewInfo: TcxGridBandedTableViewInfo; + function GetLineBounds(Index: Integer): TRect; + function GetLineCount: Integer; + function GetRecordsViewInfo: TcxGridBandedRowsViewInfo; + function GetRecordViewInfo: TcxGridDataRowViewInfo; + procedure ClearLines; + procedure CreateLineBounds; + procedure DestroyLineBounds; + protected + procedure AddLine(const ABounds: TRect); + procedure AddLines; virtual; + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetBorders: TcxBorders; override; + function GetFixedBandsSeparatorBounds: TRect; virtual; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + procedure Offset(DX, DY: Integer); override; + + property BandViewInfo: TcxGridBandViewInfo read FBandViewInfo; + property CellsAreaViewInfo: TcxGridBandedDataRowCellsAreaViewInfo read FCellsAreaViewInfo; + property GridViewInfo: TcxGridBandedTableViewInfo read GetGridViewInfo; + property RecordViewInfo: TcxGridDataRowViewInfo read GetRecordViewInfo; + property RecordsViewInfo: TcxGridBandedRowsViewInfo read GetRecordsViewInfo; + public + constructor Create(ACellsAreaViewInfo: TcxGridBandedDataRowCellsAreaViewInfo; + ABandViewInfo: TcxGridBandViewInfo); reintroduce; virtual; + destructor Destroy; override; + procedure BeforeRecalculation; override; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + function CanDrawSelected: Boolean; override; + property FixedBandsSeparatorBounds: TRect read GetFixedBandsSeparatorBounds; + property FixedBandsSeparatorLocation: TcxGridFixedBandsSeparatorLocation read + GetFixedBandsSeparatorLocation; + property LineBounds[Index: Integer]: TRect read GetLineBounds; + property LineCount: Integer read GetLineCount; + end; + + TcxGridBandedDataRowCellsAreaViewInfo = class(TcxGridDataRowCellsAreaViewInfo) + private + FItems: TList; + function GetBandsViewInfo: TcxGridBandsViewInfo; + function GetCount: Integer; + function GetGridViewInfo: TcxGridBandedTableViewInfo; + function GetItem(Index: Integer): TcxGridBandedDataRowCellsAreaItemViewInfo; + procedure CreateItems; + procedure DestroyItems; + protected + function CalculateVisible: Boolean; override; + function GetItemClass: TcxGridBandedDataRowCellsAreaItemViewInfoClass; virtual; + procedure Offset(DX, DY: Integer); override; + property BandsViewInfo: TcxGridBandsViewInfo read GetBandsViewInfo; + property GridViewInfo: TcxGridBandedTableViewInfo read GetGridViewInfo; + public + constructor Create(ARecordViewInfo: TcxCustomGridRecordViewInfo); override; + destructor Destroy; override; + procedure BeforeRecalculation; override; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + function DrawMergedCells: Boolean; override; + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxGridBandedDataRowCellsAreaItemViewInfo read GetItem; default; + end; + + TcxGridBandedRowsViewInfo = class(TcxGridRowsViewInfo) + private + FRowCellsAreaVisible: Boolean; + function GetHeaderViewInfo: TcxGridBandedHeaderViewInfo; + protected + function CalculateDataRowHeight: Integer; override; + function CalculateRowCellsAreaVisible: Boolean; virtual; + function GetAreaBoundsForCell(ACellViewInfo: TcxGridTableDataCellViewInfo): TRect; override; + function GetPainterClass: TcxCustomGridRecordsPainterClass; override; + function GetRowWidth: Integer; override; + function GetShowBandSeparators: Boolean; virtual; + function GetShowCellLeftLines: Boolean; virtual; + function GetShowCellTopLines: Boolean; virtual; + + property HeaderViewInfo: TcxGridBandedHeaderViewInfo read GetHeaderViewInfo; + property ShowBandSeparators: Boolean read GetShowBandSeparators; + property ShowCellLeftLines: Boolean read GetShowCellLeftLines; + property ShowCellTopLines: Boolean read GetShowCellTopLines; + public + procedure AfterConstruction; override; + function GetDataRowCellsAreaViewInfoClass: TClass; override; + function IsCellMultiLine(AItem: TcxCustomGridTableItem): Boolean; override; + property RowCellsAreaVisible: Boolean read FRowCellsAreaVisible; + end; + + // table + + TcxGridBandedTableViewInfo = class(TcxGridTableViewInfo) + private + function GetController: TcxGridBandedTableController; + function GetFixedBandSeparatorColor: TColor; + function GetFixedBandSeparatorWidth: Integer; + function GetGridView: TcxGridBandedTableView; + function GetHeaderViewInfo: TcxGridBandedHeaderViewInfo; + protected + function GetScrollableAreaBoundsForEdit: TRect; override; + function GetScrollableAreaBoundsHorz: TRect; override; + function SupportsAutoHeight: Boolean; override; + function SupportsGroupSummariesAlignedWithColumns: Boolean; override; + function SupportsMultipleFooterSummaries: Boolean; override; + + function GetFooterPainterClass: TcxGridFooterPainterClass; override; + function GetFooterViewInfoClass: TcxGridFooterViewInfoClass; override; + function GetHeaderViewInfoClass: TcxGridHeaderViewInfoClass; override; + function GetHeaderViewInfoSpecificClass: TcxGridHeaderViewInfoSpecificClass; override; + function GetIndicatorViewInfoClass: TcxGridIndicatorViewInfoClass; override; + function GetRecordsViewInfoClass: TcxCustomGridRecordsViewInfoClass; override; + + property Controller: TcxGridBandedTableController read GetController; + public + function CanOffset(ARecordCountDelta, DX, DY: Integer): Boolean; override; + function GetCellHeight(AIndex, ACellHeight: Integer): Integer; override; + function GetCellTopOffset(AIndex, ACellHeight: Integer): Integer; override; + property FixedBandSeparatorColor: TColor read GetFixedBandSeparatorColor; + property FixedBandSeparatorWidth: Integer read GetFixedBandSeparatorWidth; + property GridView: TcxGridBandedTableView read GetGridView; + property HeaderViewInfo: TcxGridBandedHeaderViewInfo read GetHeaderViewInfo; + end; + + { column } + + TcxGridBandedColumnOptions = class(TcxGridColumnOptions) + private + FVertSizing: Boolean; + procedure SetVertSizing(Value: Boolean); + public + procedure Assign(Source: TPersistent); override; + constructor Create(AItem: TcxCustomGridTableItem); override; + published + property VertSizing: Boolean read FVertSizing write SetVertSizing default True; + end; + + TcxGridBandedColumnStyles = class(TcxGridColumnStyles) + private + function GetItem: TcxGridBandedColumn; + protected + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + public + property Item: TcxGridBandedColumn read GetItem; + end; + + TcxGridBandedColumnPosition = class(TcxCustomGridTableItemCustomOptions) + private + FBand: TcxGridBand; + FBandIndex: Integer; + FColIndex: Integer; + FLineCount: Integer; + FRow: TcxGridBandRow; + FRowIndex: Integer; + FVisibleColIndex: Integer; + function GetBandIndex: Integer; + function GetColIndex: Integer; + function GetGridView: TcxGridBandedTableView; + function GetItem: TcxGridBandedColumn; + function GetRowIndex: Integer; + function GetVisibleBandIndex: Integer; + function GetVisibleRowIndex: Integer; + procedure SetBand(Value: TcxGridBand); + procedure SetBandIndex(Value: Integer); + procedure SetColIndex(Value: Integer); + procedure SetLineCount(Value: Integer); + procedure SetRowIndex(Value: Integer); + protected + procedure CheckLineCount(var Value: Integer); + procedure SaveParams(ABandIndexOnly: Boolean = False); + public + constructor Create(AItem: TcxCustomGridTableItem); override; + procedure Assign(Source: TPersistent); override; + property Band: TcxGridBand read FBand; + property GridView: TcxGridBandedTableView read GetGridView; + property Item: TcxGridBandedColumn read GetItem; + property Row: TcxGridBandRow read FRow; + property VisibleBandIndex: Integer read GetVisibleBandIndex; + property VisibleColIndex: Integer read FVisibleColIndex; + property VisibleRowIndex: Integer read GetVisibleRowIndex; + published + property BandIndex: Integer read GetBandIndex write SetBandIndex; + property ColIndex: Integer read GetColIndex write SetColIndex; + property LineCount: Integer read FLineCount write SetLineCount default 1; + property RowIndex: Integer read GetRowIndex write SetRowIndex; + end; + + TcxGridBandedColumn = class(TcxGridColumn) + private + FPosition: TcxGridBandedColumnPosition; + function GetGridView: TcxGridBandedTableView; + function GetOptions: TcxGridBandedColumnOptions; + function GetStyles: TcxGridBandedColumnStyles; + procedure SetOptions(Value: TcxGridBandedColumnOptions); + procedure SetPosition(Value: TcxGridBandedColumnPosition); + procedure SetStyles(Value: TcxGridBandedColumnStyles); + protected + // IcxStoredObject + function GetStoredProperties(AProperties: TStrings): Boolean; override; + procedure GetPropertyValue(const AName: string; var AValue: Variant); override; + procedure SetPropertyValue(const AName: string; const AValue: Variant); override; + + procedure CreateSubClasses; override; + procedure DestroySubClasses; override; + function GetOptionsClass: TcxCustomGridTableItemOptionsClass; override; + function GetStylesClass: TcxCustomGridTableItemStylesClass; override; + + procedure AssignColumnWidths; override; + function CanCellMerging: Boolean; override; + function CanScroll: Boolean; override; + function CanVertSize: Boolean; virtual; + function DefaultAlternateCaption: string; override; + function GetActuallyVisible: Boolean; override; + function GetEditPartVisible: Boolean; override; + function GetIsBottom: Boolean; override; + function GetIsLeft: Boolean; override; + function GetIsMostBottom: Boolean; override; + function GetIsMostLeft: Boolean; override; + function GetIsMostRight: Boolean; override; + function GetIsRight: Boolean; override; + function GetIsTop: Boolean; override; + function GetVisibleInQuickCustomizationPopup: Boolean; override; + procedure VisibleChanged; override; + public + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + property GridView: TcxGridBandedTableView read GetGridView; + published + property Options: TcxGridBandedColumnOptions read GetOptions write SetOptions; + property Position: TcxGridBandedColumnPosition read FPosition write SetPosition; + property Styles: TcxGridBandedColumnStyles read GetStyles write SetStyles; + end; + + { view } + + // row, rows, band, bands + + TcxGridBandRow = class + private + FBandRows: TcxGridBandRows; + FItems: TList; + FVisibleItems: TList; + function GetCount: Integer; + function GetIndex: Integer; + function GetIsFirst: Boolean; + function GetIsLast: Boolean; + function GetItem(Index: Integer): TcxGridBandedColumn; + function GetLineCount: Integer; + function GetLineOffset: Integer; + function GetVisible: Boolean; + function GetVisibleCount: Integer; + function GetVisibleIndex: Integer; + function GetVisibleItem(Index: Integer): TcxGridBandedColumn; + function GetWidth: Integer; + protected + procedure CheckIndexForInsert(var AIndex: Integer; AExistingItem: Boolean); + procedure RefreshVisibleItemsList; + property VisibleItemsList: TList read FVisibleItems; + property Width: Integer read GetWidth; + public + constructor Create(ABandRows: TcxGridBandRows); + destructor Destroy; override; + procedure ApplyBestFit(ACheckSizingAbility: Boolean = False; AFireEvents: Boolean = False); + procedure Delete(AIndex: Integer); + function IndexOf(AColumn: TcxGridBandedColumn): Integer; + procedure Insert(AIndex: Integer; AColumn: TcxGridBandedColumn); + procedure Move(ACurIndex, ANewIndex: Integer); + + property BandRows: TcxGridBandRows read FBandRows; + property Count: Integer read GetCount; + property Index: Integer read GetIndex; + property IsFirst: Boolean read GetIsFirst; + property IsLast: Boolean read GetIsLast; + property Items[Index: Integer]: TcxGridBandedColumn read GetItem; default; + property LineCount: Integer read GetLineCount; + property LineOffset: Integer read GetLineOffset; + property Visible: Boolean read GetVisible; + property VisibleCount: Integer read GetVisibleCount; + property VisibleIndex: Integer read GetVisibleIndex; + property VisibleItems[Index: Integer]: TcxGridBandedColumn read GetVisibleItem; + end; + + TcxGridBandRows = class + private + FBand: TcxGridBand; + FItems: TList; + FVisibleItems: TList; + function GetCount: Integer; + function GetFirstVisible: TcxGridBandRow; + function GetGridView: TcxGridBandedTableView; + function GetItem(Index: Integer): TcxGridBandRow; + function GetLastVisible: TcxGridBandRow; + function GetLineCount: Integer; + function GetVisibleCount: Integer; + function GetVisibleItem(Index: Integer): TcxGridBandRow; + function GetWidth: Integer; + procedure SetCount(Value: Integer); + procedure RemoveItem(ARow: TcxGridBandRow); + protected + procedure RefreshVisibleItemsList; + property GridView: TcxGridBandedTableView read GetGridView; + property Width: Integer read GetWidth; + public + constructor Create(ABand: TcxGridBand); virtual; + destructor Destroy; override; + procedure ApplyBestFit(ACheckSizingAbility: Boolean = False; AFireEvents: Boolean = False); + function GetLineIndex(ARowIndex: Integer): Integer; + function GetRowIndex(ALineIndex: Integer): Integer; + function Insert(AIndex: Integer): TcxGridBandRow; + procedure MoveColumn(AColumn: TcxGridBandedColumn; ARowIndex, AColIndex: Integer); + + property Band: TcxGridBand read FBand; + property Count: Integer read GetCount write SetCount; + property FirstVisible: TcxGridBandRow read GetFirstVisible; + property Items[Index: Integer]: TcxGridBandRow read GetItem; default; + property LastVisible: TcxGridBandRow read GetLastVisible; + property LineCount: Integer read GetLineCount; + property VisibleCount: Integer read GetVisibleCount; + property VisibleItems[Index: Integer]: TcxGridBandRow read GetVisibleItem; + end; + + TcxGridBandChange = (bcProperty, bcLayout, bcSize); + + TcxGridBandCustomOptions = class(TPersistent) + private + FBand: TcxGridBand; + protected + procedure Changed(AChange: TcxGridBandChange); virtual; + public + constructor Create(ABand: TcxGridBand); virtual; + procedure Assign(Source: TPersistent); override; + property Band: TcxGridBand read FBand; + end; + + TcxGridBandOptionsClass = class of TcxGridBandOptions; + + TcxGridBandOptions = class(TcxGridBandCustomOptions) + private + FHoldOwnColumnsOnly: Boolean; + FMoving: Boolean; + FSizing: Boolean; + procedure SetHoldOwnColumnsOnly(Value: Boolean); + procedure SetMoving(Value: Boolean); + procedure SetSizing(Value: Boolean); + public + constructor Create(ABand: TcxGridBand); override; + procedure Assign(Source: TPersistent); override; + published + property HoldOwnColumnsOnly: Boolean read FHoldOwnColumnsOnly write SetHoldOwnColumnsOnly default False; + property Moving: Boolean read FMoving write SetMoving default True; + property Sizing: Boolean read FSizing write SetSizing default True; + end; + + TcxGridBandPosition = class(TcxGridBandCustomOptions) + private + FBandIndex: Integer; + FColIndex: Integer; + function GetBandIndex: Integer; + function GetColIndex: Integer; + function GetGridView: TcxGridBandedTableView; + function GetParentBand: TcxGridBand; + function GetVisibleColIndex: Integer; + procedure SetBandIndex(Value: Integer); + procedure SetColIndex(Value: Integer); + function IsColIndexStored: Boolean; + protected + function CheckBandIndex(var Value: Integer): Boolean; + procedure SaveParams; + public + constructor Create(ABand: TcxGridBand); override; + procedure Assign(Source: TPersistent); override; + property GridView: TcxGridBandedTableView read GetGridView; + property ParentBand: TcxGridBand read GetParentBand; + property VisibleColIndex: Integer read GetVisibleColIndex; + published + property BandIndex: Integer read GetBandIndex write SetBandIndex default -1; + property ColIndex: Integer read GetColIndex write SetColIndex stored IsColIndexStored; + end; + + TcxGridBandGetHeaderStyle = procedure(Sender: TcxGridBandedTableView; ABand: TcxGridBand; + {$IFDEF BCB}var{$ELSE}out{$ENDIF} AStyle: TcxStyle) of object; + + TcxGridBandStylesClass = class of TcxGridBandStyles; + + TcxGridBandStyles = class(TcxCustomGridStyles) + private + FOnGetHeaderStyle: TcxGridBandGetHeaderStyle; + function GetBand: TcxGridBand; + function GetGridViewValue: TcxGridBandedTableView; + procedure SetOnGetHeaderStyle(Value: TcxGridBandGetHeaderStyle); + protected + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + function GetGridView: TcxCustomGridView; override; + public + procedure Assign(Source: TPersistent); override; + procedure GetHeaderParams(out AParams: TcxViewParams); virtual; + property Band: TcxGridBand read GetBand; + property GridView: TcxGridBandedTableView read GetGridViewValue; + published + property Background: TcxStyle index bsBackground read GetValue write SetValue; + property Content: TcxStyle index bsContent read GetValue write SetValue; + property Header: TcxStyle index bsHeader read GetValue write SetValue; + property OnGetHeaderStyle: TcxGridBandGetHeaderStyle read FOnGetHeaderStyle + write SetOnGetHeaderStyle; + end; + + TcxGridBandGetStoredPropertiesEvent = procedure(Sender: TcxGridBand; + AProperties: TStrings) of object; + TcxGridBandGetStoredPropertyValueEvent = procedure(Sender: TcxGridBand; + const AName: string; var AValue: Variant) of object; + TcxGridBandSetStoredPropertyValueEvent = procedure(Sender: TcxGridBand; + const AName: string; const AValue: Variant) of object; + + TcxGridBandClass = class of TcxGridBand; + + TcxGridBand = class(TCollectionItem, {$IFNDEF DELPHI6}IUnknown,{$ENDIF} IcxStoredObject) + private + FCaption: string; + FChildBands: TList; + FColumns: TList; + FFixedKind: TcxGridBandFixedKind; + FHeaderAlignmentHorz: TAlignment; + FHeaderAlignmentVert: TcxAlignmentVert; + FID: Integer; + FIgnoreLoadingStatus: Boolean; + FIsDestroying: Boolean; + FOptions: TcxGridBandOptions; + FParentBand: TcxGridBand; + FPosition: TcxGridBandPosition; + FRows: TcxGridBandRows; + FSavedVisible: Boolean; + FStyles: TcxGridBandStyles; + FTag: TcxTag; + FVisible: Boolean; + FVisibleChildBands: TList; + FVisibleForCustomization: Boolean; + FWidth: Integer; + FSubClassEvents: TNotifyEvent; + FOnHeaderClick: TNotifyEvent; + FOnGetStoredProperties: TcxGridBandGetStoredPropertiesEvent; + FOnGetStoredPropertyValue: TcxGridBandGetStoredPropertyValueEvent; + FOnSetStoredPropertyValue: TcxGridBandSetStoredPropertyValueEvent; + function GetBandLevelIndex: Integer; + function GetBands: TcxGridBands; + function GetChildBand(Index: Integer): TcxGridBand; + function GetChildBandCount: Integer; + function GetChildItem(Index: Integer): TObject; + function GetChildItemCount: Integer; + function GetChildItemVisible(Index: Integer): Boolean; + function GetColumnCount: Integer; + function GetColumn(Index: Integer): TcxGridBandedColumn; + function GetFirstChildBottomBand: TcxGridBand; + function GetFirstVisibleChildBottomBand: TcxGridBand; + function GetGridView: TcxGridBandedTableView; + function GetHidden: Boolean; + function GetIsBottom: Boolean; + function GetIsEmpty: Boolean; + function GetIsFirst: Boolean; + function GetIsFirstNonEmpty: Boolean; + function GetIsLast: Boolean; + function GetIsLastAsChild: Boolean; + function GetIsLastNonEmpty: Boolean; + function GetIsLoading: Boolean; + function GetIsMostRight: Boolean; + function GetIsRoot: Boolean; + function GetIsUpdating: Boolean; + function GetIsVisibleBottom: Boolean; + function GetMinWidth: Integer; + function GetParentBandWithAssignedWidth: TcxGridBand; + function GetRootIndex: Integer; + function GetRootParentBand: TcxGridBand; + function GetVisibleBandLevelCount: Integer; + function GetVisibleBottomIndex: Integer; + function GetVisibleChildBand(Index: Integer): TcxGridBand; + function GetVisibleChildBandCount: Integer; + function GetVisibleIndex: Integer; + function GetVisibleRootIndex: Integer; + function IsTagStored: Boolean; + procedure SetCaption(const Value: string); + procedure SetFixedKind(Value: TcxGridBandFixedKind); + procedure SetHeaderAlignmentHorz(Value: TAlignment); + procedure SetHeaderAlignmentVert(Value: TcxAlignmentVert); + procedure SetHidden(Value: Boolean); + procedure SetOnHeaderClick(Value: TNotifyEvent); + procedure SetOnGetStoredProperties(Value: TcxGridBandGetStoredPropertiesEvent); + procedure SetOnGetStoredPropertyValue(Value: TcxGridBandGetStoredPropertyValueEvent); + procedure SetOnSetStoredPropertyValue(Value: TcxGridBandSetStoredPropertyValueEvent); + procedure SetOptions(Value: TcxGridBandOptions); + procedure SetPosition(Value: TcxGridBandPosition); + procedure SetRootIndex(Value: Integer); + procedure SetStyles(Value: TcxGridBandStyles); + procedure SetTag(Value: TcxTag); + procedure SetVisible(Value: Boolean); + procedure SetVisibleForCustomization(Value: Boolean); + procedure SetWidth(Value: Integer); + + procedure ReadHidden(Reader: TReader); + + procedure AddBand(ABand: TcxGridBand); + procedure RemoveBand(ABand: TcxGridBand); + procedure RefreshVisibleChildBandsList; + + procedure AddColumn(AColumn: TcxGridBandedColumn); + procedure RemoveColumn(AColumn: TcxGridBandedColumn); + protected + procedure DefineProperties(Filer: TFiler); override; + + // IInterface + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + // IcxStoredObject + function GetObjectName: string; virtual; + function GetProperties(AProperties: TStrings): Boolean; virtual; + procedure GetPropertyValue(const AName: string; var AValue: Variant); virtual; + procedure SetPropertyValue(const AName: string; const AValue: Variant); virtual; + + procedure AssignChildBandWidths; + procedure AssignColumnWidths; + function CanHide: Boolean; virtual; + function CanMove: Boolean; virtual; + function CanSize: Boolean; virtual; + procedure Changed(AChange: TcxGridBandChange); virtual; + procedure ForceWidth(Value: Integer); virtual; + function GetActuallyVisible: Boolean; virtual; + function GetDisplayName: string; override; + function GetFixed: Boolean; virtual; + function GetParentInParent(ABand: TcxGridBand): TcxGridBand; + function HasFixedWidth: Boolean; virtual; + function HasParentWithAssignedWidth: Boolean; + function ColIndexOf(ABand: TcxGridBand): Integer; overload; + procedure MoveBandsToRoot; + procedure SetIndex(Value: Integer); override; + function VisibleColIndexOf(ABand: TcxGridBand): Integer; overload; + procedure VisibleForCustomizationChanged; virtual; + + procedure CheckChildrenVisibles; + procedure CheckVisible; + procedure SaveChildrenVisibles; + procedure SaveColumnsVisibles; + procedure SaveVisible; + property ChildItemCount: Integer read GetChildItemCount; + property ChildItems[Index: Integer]: TObject read GetChildItem; + property ChildItemVisibles[Index: Integer]: Boolean read GetChildItemVisible; + property SavedVisible: Boolean read FSavedVisible; + + function GetOptionsClass: TcxGridBandOptionsClass; virtual; + function GetStylesClass: TcxGridBandStylesClass; virtual; + + procedure DoHeaderClick; virtual; + + property Fixed: Boolean read GetFixed; + property IgnoreLoadingStatus: Boolean read FIgnoreLoadingStatus write FIgnoreLoadingStatus; + property IsDestroying: Boolean read FIsDestroying; + property IsLoading: Boolean read GetIsLoading; + property IsUpdating: Boolean read GetIsUpdating; + property ParentBandWithAssignedWidth: TcxGridBand read GetParentBandWithAssignedWidth; + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + procedure ApplyBestFit(ACheckSizingAbility: Boolean = False; AFireEvents: Boolean = False); virtual; + function HasAsParent(ABand: TcxGridBand): Boolean; + procedure MoveBand(ABand: TcxGridBand; AColIndex: Integer); + procedure MoveColumn(AColumn: TcxGridBandedColumn; ARowIndex, AColIndex: Integer); + procedure MoveColumns(ABand: TcxGridBand); + + property ActuallyVisible: Boolean read GetActuallyVisible; + property BandLevelIndex: Integer read GetBandLevelIndex; + property Bands: TcxGridBands read GetBands; + property ChildBandCount: Integer read GetChildBandCount; + property ChildBands[Index: Integer]: TcxGridBand read GetChildBand; + property ColumnCount: Integer read GetColumnCount; + property Columns[Index: Integer]: TcxGridBandedColumn read GetColumn; + property FirstChildBottomBand: TcxGridBand read GetFirstChildBottomBand; + property FirstVisibleChildBottomBand: TcxGridBand read GetFirstVisibleChildBottomBand; + property GridView: TcxGridBandedTableView read GetGridView; + property Hidden: Boolean read GetHidden write SetHidden; // obsolete, use VisibleForCustomization + property ID: Integer read FID; + property IsBottom: Boolean read GetIsBottom; + property IsEmpty: Boolean read GetIsEmpty; + property IsFirst: Boolean read GetIsFirst; + property IsFirstNonEmpty: Boolean read GetIsFirstNonEmpty; + property IsLast: Boolean read GetIsLast; + property IsLastAsChild: Boolean read GetIsLastAsChild; + property IsLastNonEmpty: Boolean read GetIsLastNonEmpty; + property IsMostRight: Boolean read GetIsMostRight; + property IsRoot: Boolean read GetIsRoot; + property IsVisibleBottom: Boolean read GetIsVisibleBottom; + property MinWidth: Integer read GetMinWidth; + property ParentBand: TcxGridBand read FParentBand; + property RootIndex: Integer read GetRootIndex write SetRootIndex; + property RootParentBand: TcxGridBand read GetRootParentBand; + property Rows: TcxGridBandRows read FRows; + property VisibleBandLevelCount: Integer read GetVisibleBandLevelCount; + property VisibleBottomIndex: Integer read GetVisibleBottomIndex; + property VisibleChildBandCount: Integer read GetVisibleChildBandCount; + property VisibleChildBands[Index: Integer]: TcxGridBand read GetVisibleChildBand; + property VisibleIndex: Integer read GetVisibleIndex; + property VisibleRootIndex: Integer read GetVisibleRootIndex; + published + property Alignment: TAlignment read FHeaderAlignmentHorz write SetHeaderAlignmentHorz stored False; // for compatibility + property Caption: string read FCaption write SetCaption; + property FixedKind: TcxGridBandFixedKind read FFixedKind write SetFixedKind default fkNone; + property HeaderAlignmentHorz: TAlignment read FHeaderAlignmentHorz write SetHeaderAlignmentHorz default taCenter; + property HeaderAlignmentVert: TcxAlignmentVert read FHeaderAlignmentVert write SetHeaderAlignmentVert default vaCenter; + property Options: TcxGridBandOptions read FOptions write SetOptions; + property Position: TcxGridBandPosition read FPosition write SetPosition; + property Styles: TcxGridBandStyles read FStyles write SetStyles; + property Tag: TcxTag read FTag write SetTag stored IsTagStored; + property Visible: Boolean read FVisible write SetVisible default True; + property VisibleForCustomization: Boolean read FVisibleForCustomization + write SetVisibleForCustomization default True; + property Width: Integer read FWidth write SetWidth default 0; + property StylesEvents: TNotifyEvent read FSubClassEvents write FSubClassEvents; + property OnHeaderClick: TNotifyEvent read FOnHeaderClick write SetOnHeaderClick; + property OnGetStoredProperties: TcxGridBandGetStoredPropertiesEvent + read FOnGetStoredProperties write SetOnGetStoredProperties; + property OnGetStoredPropertyValue: TcxGridBandGetStoredPropertyValueEvent + read FOnGetStoredPropertyValue write SetOnGetStoredPropertyValue; + property OnSetStoredPropertyValue: TcxGridBandSetStoredPropertyValueEvent + read FOnSetStoredPropertyValue write SetOnSetStoredPropertyValue; + end; + + TcxGridBandsLayout = (blNonFixed, blLeftFixed, blRightFixed, blLeftRightFixed); + + TcxGridBandsClass = class of TcxGridBands; + + TcxGridBands = class(TOwnedCollection, {$IFNDEF DELPHI6}IUnknown,{$ENDIF} + IcxStoredObject, IcxStoredParent) + private + FBottomItems: TList; + FGridView: TcxGridBandedTableView; + FNextID: Integer; + FRootItems: TList; + FVisibleBottomItems: TList; + FVisibleItems: TList; + FVisibleLeftFixedCount: Integer; + FVisibleRightFixedCount: Integer; + FVisibleRootItems: TList; + FVisibleRootLeftFixedCount: Integer; + FVisibleRootRightFixedCount: Integer; + function GetBottomItem(Index: Integer): TcxGridBand; + function GetBottomItemCount: Integer; + function GetFirstVisibleNonEmpty: TcxGridBand; + function GetItem(Index: Integer): TcxGridBand; + function GetLastVisibleNonEmpty: TcxGridBand; + function GetLayout: TcxGridBandsLayout; + function GetLineCount: Integer; + function GetRootItem(Index: Integer): TcxGridBand; + function GetRootItemCount: Integer; + function GetVisibleBottomItem(Index: Integer): TcxGridBand; + function GetVisibleBottomItemCount: Integer; + function GetVisibleCount: Integer; + function GetVisibleItem(Index: Integer): TcxGridBand; + function GetVisibleRootItem(Index: Integer): TcxGridBand; + function GetVisibleRootItemCount: Integer; + function GetVisibleRowCount: Integer; + procedure SetItem(Index: Integer; Value: TcxGridBand); + + procedure AddItem(AItem: TcxGridBand); + procedure RemoveItem(AItem: TcxGridBand); + + procedure RefreshBottomItemsList; + procedure RefreshRootItemsList; + procedure RefreshVisibleBottomItemsList; + procedure RefreshVisibleItemsList; + procedure RefreshVisibleRootItemsList; + protected + // IInterface + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + // IcxStoredObject + function GetObjectName: string; virtual; + function GetProperties(AProperties: TStrings): Boolean; virtual; + procedure GetPropertyValue(const AName: string; var AValue: Variant); virtual; + procedure SetPropertyValue(const AName: string; const AValue: Variant); virtual; + // IcxStoredParent + function CreateChild(const AObjectName, AClassName: string): TObject; virtual; + procedure DeleteChild(const AObjectName: string; AObject: TObject); virtual; + procedure GetChildren(AChildren: TStringList); virtual; + + procedure BandVisibilityChanged(ABand: TcxGridBand; Value: Boolean); virtual; + function GetBandClass: TcxGridBandClass; virtual; + function GetNextID: Integer; + procedure ReleaseID(AID: Integer); + property NextID: Integer read FNextID; + public + constructor Create(AGridView: TcxGridBandedTableView); virtual; + destructor Destroy; override; + function Add: TcxGridBand; + function AreNested: Boolean; + procedure Assign(Source: TPersistent); override; + procedure Clear; + function FindItemID(AID: Integer): TcxGridBand; + function GetFirstVisibleIndex(AFixedKind: TcxGridBandFixedKind): Integer; + function GetFirstVisibleRootIndex(AFixedKind: TcxGridBandFixedKind): Integer; + function GetLastVisibleIndex(AFixedKind: TcxGridBandFixedKind): Integer; + function GetLastVisibleRootIndex(AFixedKind: TcxGridBandFixedKind): Integer; + function HaveFixedItems: Boolean; + + property BottomItemCount: Integer read GetBottomItemCount; + property BottomItems[Index: Integer]: TcxGridBand read GetBottomItem; + property FirstVisibleNonEmpty: TcxGridBand read GetFirstVisibleNonEmpty; + property GridView: TcxGridBandedTableView read FGridView; + property Items[Index: Integer]: TcxGridBand read GetItem write SetItem; default; + property Layout: TcxGridBandsLayout read GetLayout; + property LastVisibleNonEmpty: TcxGridBand read GetLastVisibleNonEmpty; + property LineCount: Integer read GetLineCount; + property RootItemCount: Integer read GetRootItemCount; + property RootItems[Index: Integer]: TcxGridBand read GetRootItem; + property VisibleBottomItemCount: Integer read GetVisibleBottomItemCount; + property VisibleBottomItems[Index: Integer]: TcxGridBand read GetVisibleBottomItem; + property VisibleCount: Integer read GetVisibleCount; + property VisibleItems[Index: Integer]: TcxGridBand read GetVisibleItem; + property VisibleLeftFixedCount: Integer read FVisibleLeftFixedCount; + property VisibleRightFixedCount: Integer read FVisibleRightFixedCount; + property VisibleRootItemCount: Integer read GetVisibleRootItemCount; + property VisibleRootItems[Index: Integer]: TcxGridBand read GetVisibleRootItem; + property VisibleRootLeftFixedCount: Integer read FVisibleRootLeftFixedCount; + property VisibleRootRightFixedCount: Integer read FVisibleRootRightFixedCount; + property VisibleRowCount: Integer read GetVisibleRowCount; + end; + + // options + + TcxGridBandedTableBackgroundBitmaps = class(TcxGridTableBackgroundBitmaps) + protected + function GetBitmapStyleIndex(Index: Integer): Integer; override; + public + procedure Assign(Source: TPersistent); override; + published + property BandBackground: TBitmap index bbBandBackground read GetValue write SetValue; + property BandHeader: TBitmap index bbBandHeader read GetValue write SetValue; + end; + + TcxGridBandedTableOptionsBehavior = class(TcxGridTableOptionsBehavior) + private + FBandHeaderHints: Boolean; + procedure SetBandHeaderHints(Value: Boolean); + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + published + property BandHeaderHints: Boolean read FBandHeaderHints write SetBandHeaderHints default True; + end; + + TcxGridBandedTableOptionsCustomize = class(TcxGridTableOptionsCustomize) + private + FBandHiding: Boolean; + FBandMoving: Boolean; + FBandSizing: Boolean; + FBandsQuickCustomization: Boolean; + FBandsQuickCustomizationMaxDropDownCount: Integer; + FBandsQuickCustomizationReordering: TcxGridQuickCustomizationReordering; + FColumnVertSizing: Boolean; + FNestedBands: Boolean; + function GetGridView: TcxGridBandedTableView; + procedure SetBandHiding(Value: Boolean); + procedure SetBandMoving(Value: Boolean); + procedure SetBandSizing(Value: Boolean); + procedure SetBandsQuickCustomization(Value: Boolean); + procedure SetBandsQuickCustomizationMaxDropDownCount(Value: Integer); + procedure SetBandsQuickCustomizationReordering(Value: TcxGridQuickCustomizationReordering); + procedure SetColumnVertSizing(Value: Boolean); + procedure SetNestedBands(Value: Boolean); + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + function SupportsBandsQuickCustomizationReordering: Boolean; virtual; + function SupportsItemsQuickCustomizationReordering: Boolean; override; + property GridView: TcxGridBandedTableView read GetGridView; + published + property BandHiding: Boolean read FBandHiding write SetBandHiding default False; + property BandMoving: Boolean read FBandMoving write SetBandMoving default True; + property BandSizing: Boolean read FBandSizing write SetBandSizing default True; + property BandsQuickCustomization: Boolean read FBandsQuickCustomization + write SetBandsQuickCustomization default False; + property BandsQuickCustomizationMaxDropDownCount: Integer read FBandsQuickCustomizationMaxDropDownCount + write SetBandsQuickCustomizationMaxDropDownCount default 0; + property BandsQuickCustomizationReordering: TcxGridQuickCustomizationReordering + read FBandsQuickCustomizationReordering write SetBandsQuickCustomizationReordering default qcrDefault; + property ColumnVertSizing: Boolean read FColumnVertSizing write SetColumnVertSizing default True; + property NestedBands: Boolean read FNestedBands write SetNestedBands default True; + end; + + TcxGridBandedTableOptionsView = class(TcxGridTableOptionsView) + private + FBandCaptionsInColumnAlternateCaption: Boolean; + FBandHeaderEndEllipsis: Boolean; + FBandHeaderHeight: Integer; + FBandHeaderLineCount: Integer; + FBandHeaders: Boolean; + FFixedBandSeparatorColor: TColor; + FFixedBandSeparatorWidth: Integer; + function GetGridView: TcxGridBandedTableView; + procedure SetBandCaptionsInColumnAlternateCaption(Value: Boolean); + procedure SetBandHeaderEndEllipsis(Value: Boolean); + procedure SetBandHeaderHeight(Value: Integer); + procedure SetBandHeaderLineCount(Value: Integer); + procedure SetBandHeaders(Value: Boolean); + procedure SetFixedBandSeparatorColor(Value: TColor); + procedure SetFixedBandSeparatorWidth(Value: Integer); + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + function GetFixedBandSeparatorColor: TColor; + property GridView: TcxGridBandedTableView read GetGridView; + published + property BandCaptionsInColumnAlternateCaption: Boolean read FBandCaptionsInColumnAlternateCaption + write SetBandCaptionsInColumnAlternateCaption default False; + property BandHeaderEndEllipsis: Boolean read FBandHeaderEndEllipsis + write SetBandHeaderEndEllipsis default False; + property BandHeaderHeight: Integer read FBandHeaderHeight write SetBandHeaderHeight default 0; + property BandHeaderLineCount: Integer read FBandHeaderLineCount write SetBandHeaderLineCount default 1; + property BandHeaders: Boolean read FBandHeaders write SetBandHeaders default True; + property FixedBandSeparatorColor: TColor read FFixedBandSeparatorColor + write SetFixedBandSeparatorColor default clDefault; + property FixedBandSeparatorWidth: Integer read FFixedBandSeparatorWidth + write SetFixedBandSeparatorWidth default cxGridDefaultFixedBandSeparatorWidth; + end; + + // styles + + TcxGridBandedTableViewStyles = class(TcxGridTableViewStyles) + private + FOnGetBandHeaderStyle: TcxGridBandGetHeaderStyle; + function GetGridViewValue: TcxGridBandedTableView; + procedure SetOnGetBandHeaderStyle(Value: TcxGridBandGetHeaderStyle); + protected + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + public + procedure Assign(Source: TPersistent); override; + procedure GetBandHeaderParams(ABand: TcxGridBand; out AParams: TcxViewParams); virtual; + property GridView: TcxGridBandedTableView read GetGridViewValue; + published + property BandBackground: TcxStyle index vsBandBackground read GetValue write SetValue; + property BandHeader: TcxStyle index vsBandHeader read GetValue write SetValue; + property StyleSheet; + property OnGetBandHeaderStyle: TcxGridBandGetHeaderStyle read FOnGetBandHeaderStyle + write SetOnGetBandHeaderStyle; + end; + + TcxGridBandedTableViewStyleSheet = class(TcxCustomStyleSheet) + private + function GetStylesValue: TcxGridBandedTableViewStyles; + procedure SetStylesValue(Value: TcxGridBandedTableViewStyles); + public + class function GetStylesClass: TcxCustomStylesClass; override; + published + property Styles: TcxGridBandedTableViewStyles read GetStylesValue write SetStylesValue; + end; + + // grid view + + TcxGridBandCustomDrawHeaderEvent = procedure(Sender: TcxGridBandedTableView; + ACanvas: TcxCanvas; AViewInfo: TcxGridBandHeaderViewInfo; var ADone: Boolean) of object; + TcxGridBandEvent = procedure(Sender: TcxGridBandedTableView; ABand: TcxGridBand) of object; + + TcxGridBandedTableView = class(TcxGridTableView) + private + FBands: TcxGridBands; + FIsAssigningBands: Boolean; + FOnBandPosChanged: TcxGridBandEvent; + FOnBandSizeChanged: TcxGridBandEvent; + FOnCustomDrawBandHeader: TcxGridBandCustomDrawHeaderEvent; + function GetBackgroundBitmaps: TcxGridBandedTableBackgroundBitmaps; + function GetColumn(Index: Integer): TcxGridBandedColumn; + function GetController: TcxGridBandedTableController; + function GetGroupedColumn(Index: Integer): TcxGridBandedColumn; + function GetOptionsBehavior: TcxGridBandedTableOptionsBehavior; + function GetOptionsCustomize: TcxGridBandedTableOptionsCustomize; + function GetOptionsView: TcxGridBandedTableOptionsView; + function GetStyles: TcxGridBandedTableViewStyles; + function GetViewInfo: TcxGridBandedTableViewInfo; + function GetVisibleColumn(Index: Integer): TcxGridBandedColumn; + procedure SetBackgroundBitmaps(Value: TcxGridBandedTableBackgroundBitmaps); + procedure SetBands(Value: TcxGridBands); + procedure SetColumn(Index: Integer; Value: TcxGridBandedColumn); + procedure SetOnBandPosChanged(Value: TcxGridBandEvent); + procedure SetOnBandSizeChanged(Value: TcxGridBandEvent); + procedure SetOnCustomDrawBandHeader(Value: TcxGridBandCustomDrawHeaderEvent); + procedure SetOptionsBehavior(Value: TcxGridBandedTableOptionsBehavior); + procedure SetOptionsCustomize(Value: TcxGridBandedTableOptionsCustomize); + procedure SetOptionsView(Value: TcxGridBandedTableOptionsView); + procedure SetStyles(Value: TcxGridBandedTableViewStyles); + protected + // IcxStoredParent + procedure DeleteChild(const AObjectName: string; AObject: TObject); override; + procedure GetStoredChildren(AChildren: TStringList); override; + // IcxGridViewLayoutEditorSupport - for design-time layout editor + procedure AssignLayout(ALayoutView: TcxCustomGridView); override; + + procedure ReadState(Reader: TReader); override; + procedure Updated; override; + procedure Updating; override; + + procedure BeginAssignBands; + procedure DoAssign(ASource: TcxCustomGridView); override; + procedure DoItemsAssigned; override; + procedure EndAssignBands; + procedure GetFakeComponentLinks(AList: TList); override; + function GetIsControlFocused: Boolean; override; + function HasCustomDrawBandHeader: Boolean; + + procedure CreateOptions; override; + procedure DestroyOptions; override; + + procedure AddItem(AItem: TcxCustomGridTableItem); override; + procedure AssignBandsParams; + procedure AssignColumnsParams(AAssignBandIndexes, AAssignOtherIndexes: Boolean); + procedure GetVisibleItemsList(AItems: TList); override; + procedure LoadingComplete; override; + procedure RefreshVisibleItemsList; override; + procedure RestoringComplete; override; + procedure SaveBandsParams; + procedure SaveColumnsParams(ABandIndexOnly: Boolean = False); + + function GetBackgroundBitmapsClass: TcxCustomGridBackgroundBitmapsClass; override; + function GetBandsClass: TcxGridBandsClass; virtual; + function GetControllerClass: TcxCustomGridControllerClass; override; + function GetItemClass: TcxCustomGridTableItemClass; override; + function GetOptionsBehaviorClass: TcxCustomGridOptionsBehaviorClass; override; + function GetOptionsCustomizeClass: TcxCustomGridTableOptionsCustomizeClass; override; + function GetOptionsViewClass: TcxCustomGridOptionsViewClass; override; + function GetPainterClass: TcxCustomGridPainterClass; override; + function GetStylesClass: TcxCustomGridViewStylesClass; override; + function GetViewInfoClass: TcxCustomGridViewInfoClass; override; + + procedure DoBandPosChanged(ABand: TcxGridBand); virtual; + procedure DoBandSizeChanged(ABand: TcxGridBand); virtual; + procedure DoCustomDrawBandHeader(ACanvas: TcxCanvas; AViewInfo: TcxGridBandHeaderViewInfo; + var ADone: Boolean); virtual; + + procedure Initialize; override; + + property IsAssigningBands: Boolean read FIsAssigningBands; + public + procedure ApplyBestFit(AItem: TcxCustomGridTableItem = nil; ACheckSizingAbility: Boolean = False; + AFireEvents: Boolean = False); override; + function CreateColumn: TcxGridBandedColumn; + + property Columns[Index: Integer]: TcxGridBandedColumn read GetColumn write SetColumn; + property Controller: TcxGridBandedTableController read GetController; + property GroupedColumns[Index: Integer]: TcxGridBandedColumn read GetGroupedColumn; + property ViewInfo: TcxGridBandedTableViewInfo read GetViewInfo; + property VisibleColumns[Index: Integer]: TcxGridBandedColumn read GetVisibleColumn; + published + property BackgroundBitmaps: TcxGridBandedTableBackgroundBitmaps read GetBackgroundBitmaps + write SetBackgroundBitmaps; + property Bands: TcxGridBands read FBands write SetBands; + property OptionsBehavior: TcxGridBandedTableOptionsBehavior read GetOptionsBehavior write SetOptionsBehavior; + property OptionsCustomize: TcxGridBandedTableOptionsCustomize read GetOptionsCustomize write SetOptionsCustomize; + property OptionsView: TcxGridBandedTableOptionsView read GetOptionsView write SetOptionsView; + property Styles: TcxGridBandedTableViewStyles read GetStyles write SetStyles; + property OnBandPosChanged: TcxGridBandEvent read FOnBandPosChanged write SetOnBandPosChanged; + property OnBandSizeChanged: TcxGridBandEvent read FOnBandSizeChanged write SetOnBandSizeChanged; + property OnCustomDrawBandHeader: TcxGridBandCustomDrawHeaderEvent read FOnCustomDrawBandHeader write SetOnCustomDrawBandHeader; + end; + +implementation + +uses + SysUtils, Math, cxGridStrs, cxCustomData, cxCheckListBox, cxLibraryConsts; + +const + ColumnHeaderInsertZoneSize = 20; + BandHeaderMovingZoneSize = 20; + BandSizingMarkWidth = 2; + EmptyBandMinWidth = 20; + + BandHeaderHitTests = [htBandHeader, htBandHeaderSizingEdge]; + +type + TData = class + Columns: TList; + GridRecord: TcxCustomGridRecord; + end; + +procedure CheckItemIndexForInsert(var AIndex: Integer; ACount: Integer; AExistingItem: Boolean); +begin + if AIndex < 0 then AIndex := 0; + if AIndex > ACount - Ord(AExistingItem) then AIndex := ACount - Ord(AExistingItem); +end; + +function CompareVisibleColumnPositions(APosition1, APosition2: TcxGridBandedColumnPosition): Integer; +begin + Result := APosition1.Band.VisibleIndex - APosition2.Band.VisibleIndex; + if Result = 0 then + begin + Result := APosition1.VisibleRowIndex - APosition2.VisibleRowIndex; + if Result = 0 then + begin + Result := APosition1.VisibleColIndex - APosition2.VisibleColIndex; + if Result = 0 then + Result := APosition1.Item.VisibleIndex - APosition2.Item.VisibleIndex; + end; + end; +end; + +{ TcxGridColumnHeaderVertSizingEdgeHitTest } + +class function TcxGridColumnHeaderVertSizingEdgeHitTest.GetHitTestCode: Integer; +begin + Result := htColumnHeaderVertSizingEdge; +end; + +function TcxGridColumnHeaderVertSizingEdgeHitTest.Cursor: TCursor; +begin + Result := crcxGridVertSize; +end; + +function TcxGridColumnHeaderVertSizingEdgeHitTest.DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; +begin + Result := TcxGridColumnVertSizingObject; +end; + +{ TcxGridBandHitTest } + +class function TcxGridBandHitTest.GetHitTestCode: Integer; +begin + Result := htBand; +end; + +{ TcxGridBandHeaderHitTest } + +class function TcxGridBandHeaderHitTest.GetHitTestCode: Integer; +begin + Result := htBandHeader; +end; + +function TcxGridBandHeaderHitTest.DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; +begin + if Band.CanMove then + Result := TcxGridBandHeaderMovingObject + else + Result := nil; +end; + +{ TcxGridBandHeaderSizingEdgeHitTest } + +class function TcxGridBandHeaderSizingEdgeHitTest.GetHitTestCode: Integer; +begin + Result := htBandHeaderSizingEdge; +end; + +function TcxGridBandHeaderSizingEdgeHitTest.Cursor: TCursor; +begin + Result := crcxGridHorzSize; +end; + +function TcxGridBandHeaderSizingEdgeHitTest.DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; +begin + Result := TcxGridBandSizingObject; +end; + +{ TcxGridIndicatorBandHeaderHitTest } + +class function TcxGridIndicatorBandHeaderHitTest.GetHitTestCode: Integer; +begin + Result := htIndicatorBandHeader; +end; + +{ TcxGridBandedColumnContainerZone } + +constructor TcxGridBandedColumnContainerZone.Create(AColumnIndex: Integer; + ABand: TcxGridBand; AColIndex, ARowIndex: Integer); +begin + inherited Create(AColumnIndex); + Band := ABand; + ColIndex := AColIndex; + RowIndex := ARowIndex; +end; + +function TcxGridBandedColumnContainerZone.IsEqual(Value: TcxGridItemContainerZone): Boolean; +var + AValue: TcxGridBandedColumnContainerZone; +begin + AValue := TcxGridBandedColumnContainerZone(Value); + Result := inherited IsEqual(Value) and (ClassType = Value.ClassType) and + (Band = AValue.Band) and (ColIndex = AValue.ColIndex) and (RowIndex = AValue.RowIndex); +end; + +function TcxGridBandedColumnContainerZone.IsInsertion: Boolean; +begin + Result := ItemIndex = -1; +end; + +{ TcxGridBandedColumnHeaderMovingObject } + +function TcxGridBandedColumnHeaderMovingObject.GetDestZone: TcxGridBandedColumnContainerZone; +begin + Result := TcxGridBandedColumnContainerZone(inherited DestZone); +end; + +function TcxGridBandedColumnHeaderMovingObject.GetSourceItem: TcxGridBandedColumn; +begin + Result := TcxGridBandedColumn(inherited SourceItem); +end; + +function TcxGridBandedColumnHeaderMovingObject.GetSourcePosition: TcxGridBandedColumnPosition; +begin + Result := TcxGridBandedColumn(SourceItem).Position; +end; + +function TcxGridBandedColumnHeaderMovingObject.GetViewInfo: TcxGridBandedTableViewInfo; +begin + Result := TcxGridBandedTableViewInfo(inherited ViewInfo); +end; + +procedure TcxGridBandedColumnHeaderMovingObject.SetSourceItem(Value: TcxGridBandedColumn); +begin + inherited SourceItem := Value; +end; + +function TcxGridBandedColumnHeaderMovingObject.AreArrowsVertical: Boolean; +begin + if (DestItemContainerKind = ckHeader) and (DestZone.ItemIndex = -1) then + Result := False + else + Result := inherited AreArrowsVertical; +end; + +procedure TcxGridBandedColumnHeaderMovingObject.CheckDestItemContainerKind(var AValue: TcxGridItemContainerKind); +begin + inherited; + if (AValue = ckHeader) and + (DestZone.Band.Options.HoldOwnColumnsOnly or + (SourceItem.Position.Band <> nil) and SourceItem.Position.Band.Options.HoldOwnColumnsOnly) and + (SourceItem.Position.Band <> DestZone.Band) then + AValue := ckNone; +end; + +procedure TcxGridBandedColumnHeaderMovingObject.DoColumnMoving; + + function GetRowIndex: Integer; + var + ABand: TcxGridBand; + begin + ABand := DestZone.Band; + if DestZone.RowIndex = ABand.Rows.VisibleCount then + Result := ABand.Rows.Count + else + Result := ABand.Rows.VisibleItems[DestZone.RowIndex].Index; + end; + + function GetColIndex: Integer; + var + ARow: TcxGridBandRow; + begin + ARow := SourcePosition.Row; + if DestZone.ColIndex = ARow.VisibleCount then + Result := ARow.Count + else + begin + Result := ARow.VisibleItems[DestZone.ColIndex].Position.ColIndex; + if SourcePosition.ColIndex < Result then Dec(Result); + end; + end; + +begin + with SourceItem do + begin + Position.BandIndex := DestZone.Band.Index; + if DestZone.IsInsertion then + Position.Band.Rows.Insert(GetRowIndex); + Position.RowIndex := GetRowIndex; + Position.ColIndex := GetColIndex; + end; +end; + +function TcxGridBandedColumnHeaderMovingObject.GetArrowAreaBoundsForHeader(APlace: TcxGridArrowPlace): TRect; +var + ARowsViewInfo: TcxGridBandRowsViewInfo; + AColumn: TcxGridBandedColumn; +begin + if DestZone.IsInsertion then + begin + ARowsViewInfo := ViewInfo.HeaderViewInfo.BandsViewInfo[DestZone.Band.VisibleIndex].RowsViewInfo; + Result := ARowsViewInfo.Bounds; + if DestZone.RowIndex > 0 then + Result.Top := ARowsViewInfo[DestZone.RowIndex - 1].Bounds.Bottom; + end + else + begin + Result := inherited GetArrowAreaBoundsForHeader(APlace); + AColumn := TcxGridBandedColumn(GridView.VisibleColumns[DestZone.ItemIndex]); + if DestZone.ColIndex <> AColumn.Position.VisibleColIndex then + Result.Left := Result.Right; + end; +end; + +function TcxGridBandedColumnHeaderMovingObject.GetArrowsClientRect: TRect; +begin + Result := inherited GetArrowsClientRect; + if (DestItemContainerKind = ckHeader) and (DestZone.Band.FixedKind = fkNone) then + Result := ViewInfo.ScrollableAreaBoundsHorz; +end; + +function TcxGridBandedColumnHeaderMovingObject.IsValidDestinationForVisibleSource: Boolean; + + function IsValidForInsertion: Boolean; + begin + Result := + (SourcePosition.Row.VisibleCount <> 1) or + (DestZone.RowIndex < SourcePosition.VisibleRowIndex) or + (SourcePosition.VisibleRowIndex + 1 < DestZone.RowIndex); + end; + + function IsValidForMoving: Boolean; + begin + Result := + (DestZone.RowIndex <> SourcePosition.VisibleRowIndex) or + (DestZone.ColIndex < SourcePosition.VisibleColIndex) or + (SourcePosition.VisibleColIndex + 1 < DestZone.ColIndex); + end; + +begin + if DestItemContainerKind = ckHeader then + Result := + (SourceItemContainerKind = ckGroupByBox) or + (DestZone.Band <> SourcePosition.Band) or + DestZone.IsInsertion and IsValidForInsertion or + not DestZone.IsInsertion and IsValidForMoving + else + Result := inherited IsValidDestinationForVisibleSource; +end; + +{ TcxGridBandHeaderMovingObject } + +function TcxGridBandHeaderMovingObject.GetController: TcxGridBandedTableController; +begin + Result := TcxGridBandedTableController(inherited Controller); +end; + +function TcxGridBandHeaderMovingObject.GetCustomizationForm: TcxGridBandedTableCustomizationForm; +begin + Result := TcxGridBandedTableCustomizationForm(inherited CustomizationForm); +end; + +function TcxGridBandHeaderMovingObject.GetGridView: TcxGridBandedTableView; +begin + Result := TcxGridBandedTableView(inherited GridView); +end; + +function TcxGridBandHeaderMovingObject.GetSourceBand: TcxGridBand; +begin + Result := SourceItem as TcxGridBand; +end; + +function TcxGridBandHeaderMovingObject.GetViewInfo: TcxGridBandedTableViewInfo; +begin + Result := TcxGridBandedTableViewInfo(inherited ViewInfo); +end; + +procedure TcxGridBandHeaderMovingObject.SetDestBand(Value: TcxGridBand); +begin + if FDestBand <> Value then + begin + Dirty := True; + FDestBand := Value; + end; +end; + +procedure TcxGridBandHeaderMovingObject.SetDestBandContainerKind(Value: TcxGridBandContainerKind); +begin + if FDestBandContainerKind <> Value then + begin + Dirty := True; + FDestBandContainerKind := Value; + end; +end; + +procedure TcxGridBandHeaderMovingObject.SetDestInsertPosition(Value: TcxPosition); +begin + if FDestInsertPosition <> Value then + begin + Dirty := True; + FDestInsertPosition := Value; + end; +end; + +procedure TcxGridBandHeaderMovingObject.SetIsEmptyViewInsert(Value: Boolean); +begin + if FIsEmptyViewInsert <> Value then + begin + Dirty := True; + FIsEmptyViewInsert := Value; + end; +end; + +procedure TcxGridBandHeaderMovingObject.SetSourceBand(Value: TcxGridBand); +begin + SourceItem := Value; +end; + +function TcxGridBandHeaderMovingObject.AreArrowsVertical: Boolean; +begin + Result := FDestInsertPosition in [posLeft, posRight]; +end; + +function TcxGridBandHeaderMovingObject.CalculateIsEmptyViewInsert(ACheckMousePos: Boolean): Boolean; +begin + Result := (DestBandContainerKind = bcHeader) and + (GridView.Bands.VisibleRootItemCount = 0) and + (not ACheckMousePos or PtInRect(GridView.ViewInfo.ScrollableAreaBoundsHorz, CurMousePos)); +end; + +function TcxGridBandHeaderMovingObject.CanRemove: Boolean; +begin + Result := (SourceBandContainerKind = bcHeader) and SourceBand.CanHide and + (GridView.OptionsCustomize.BandHiding or GridView.Controller.Customization); +end; + +procedure TcxGridBandHeaderMovingObject.CheckDestParams; +var + AColumnsSource, AColumnsDestination: TcxGridBand; +begin + if (DestBand <> nil) and (DestInsertPosition in [posTop, posBottom]) then + begin + AColumnsSource := nil; + AColumnsDestination := nil; + if (DestInsertPosition = posBottom) and DestBand.IsBottom then + if DestBand.ColumnCount <> 0 then + begin + AColumnsSource := DestBand; + AColumnsDestination := SourceBand.FirstVisibleChildBottomBand; + end + else + else + if SourceBand.IsBottom and (SourceBand.ColumnCount <> 0) then + begin + AColumnsSource := SourceBand; + AColumnsDestination := DestBand.FirstVisibleChildBottomBand; + end; + if (AColumnsSource <> nil) and AColumnsSource.Options.HoldOwnColumnsOnly or + (AColumnsDestination <> nil) and AColumnsDestination.Options.HoldOwnColumnsOnly then + DestBand := nil; + end; +end; + +function TcxGridBandHeaderMovingObject.GetArrowAreaBounds(APlace: TcxGridArrowPlace): TRect; +begin + if IsEmptyViewInsert then + Result := ViewInfo.HeaderViewInfo.Bounds + else + begin + Result := ViewInfo.HeaderViewInfo.BandsViewInfo[DestBand.VisibleIndex].HeaderViewInfo.Bounds; + case DestInsertPosition of + posRight: + Result.Left := Result.Right; + posBottom: + Result.Top := Result.Bottom; + end; + end; +end; + +function TcxGridBandHeaderMovingObject.GetArrowsClientRect: TRect; +begin + Result := inherited GetArrowsClientRect; + if (DestBandContainerKind = bcHeader) and (SourceBand.FixedKind = fkNone) then + Result := ViewInfo.ScrollableAreaBoundsHorz; +end; + +function TcxGridBandHeaderMovingObject.GetCustomizationFormListBox: TcxCustomGridItemsListBox; +begin + Result := CustomizationForm.BandsListBox; +end; + +function TcxGridBandHeaderMovingObject.GetSourceItemViewInfo: TcxCustomGridCellViewInfo; +begin + if SourceBandContainerKind = bcHeader then + Result := ViewInfo.HeaderViewInfo.BandsViewInfo[SourceBand.VisibleIndex].HeaderViewInfo + else + Result := inherited GetSourceItemViewInfo; +end; + +function TcxGridBandHeaderMovingObject.IsSourceCustomizationForm: Boolean; +begin + Result := SourceBandContainerKind = bcCustomizationForm; +end; + +function TcxGridBandHeaderMovingObject.IsValidDestination: Boolean; + + function GetNearestColIndex(AForward: Boolean): Integer; + begin + Result := SourceBand.Position.VisibleColIndex; + if AForward then + Inc(Result) + else + Dec(Result); + end; + + function GetVisibleBandCount(AFixedKind: TcxGridBandFixedKind): Integer; + begin + with GridView.Bands do + Result := GetLastVisibleIndex(AFixedKind) - GetFirstVisibleIndex(AFixedKind) + 1; + end; + +begin + if IsEmptyViewInsert then + begin + Result := True; + Exit; + end; + Result := (DestBand <> nil) and (DestBand <> SourceBand); + if Result then + begin + Result := DestBand.FixedKind = SourceBand.FixedKind; + + if not Result and not SourceBand.Visible and + (GetVisibleBandCount(SourceBand.FixedKind) = 0) and DestBand.IsRoot then + case SourceBand.FixedKind of + fkLeft: + Result := (DestInsertPosition = posLeft) and + (DestBand.VisibleRootIndex = GridView.Bands.GetFirstVisibleRootIndex(fkNone)); + fkNone: + Result := + (DestInsertPosition = posRight) and + (DestBand.VisibleRootIndex = GridView.Bands.GetLastVisibleRootIndex(fkLeft)) or + (DestInsertPosition = posLeft) and + (DestBand.VisibleRootIndex = GridView.Bands.GetFirstVisibleRootIndex(fkRight)); + fkRight: + Result := (DestInsertPosition = posRight) and + (DestBand.VisibleRootIndex = GridView.Bands.GetLastVisibleRootIndex(fkNone)); + end; + + if Result and SourceBand.Visible then + case DestInsertPosition of + posLeft, posRight: + Result := (DestBand.ParentBand <> SourceBand.ParentBand) or + (DestBand.Position.VisibleColIndex <> GetNearestColIndex(DestInsertPosition = posLeft)); + posTop: + Result := (DestBand.ParentBand <> SourceBand) or (SourceBand.VisibleChildBandCount > 1); + posBottom: + Result := (SourceBand.ParentBand <> DestBand) or (DestBand.VisibleChildBandCount > 1); + end; + end; +end; + +procedure TcxGridBandHeaderMovingObject.BeginDragAndDrop; +begin + if CustomizationForm <> nil then + with CustomizationForm do + ActivatePage(BandsPage); + Controller.FMovingBand := SourceBand; + inherited; +end; + +procedure TcxGridBandHeaderMovingObject.DragAndDrop(const P: TPoint; var Accepted: Boolean); +var + AHitTest: TcxCustomGridHitTest; + ABand: TcxGridBand; + AInsertPosition: TcxPosition; +begin + AHitTest := ViewInfo.GetHitTest(P); + if AHitTest.HitTestCode = htCustomizationForm then + begin + DestBandContainerKind := bcCustomizationForm; + DestBand := nil; + end + else + begin + DestBandContainerKind := bcHeader; + ViewInfo.HeaderViewInfo.BandsViewInfo.InsertPositionAtPos(P, ABand, AInsertPosition); + DestBand := ABand; + DestInsertPosition := AInsertPosition; + end; + IsEmptyViewInsert := CalculateIsEmptyViewInsert(True); + CheckDestParams; + Accepted := (DestBandContainerKind = bcCustomizationForm) or + (DestBand <> nil) or IsEmptyViewInsert; + inherited; +end; + +procedure TcxGridBandHeaderMovingObject.EndDragAndDrop(Accepted: Boolean); +var + ABandPosChanged: Boolean; + + function GetParentBandIndex: Integer; + begin + if FDestInsertPosition = posBottom then + Result := FDestBand.Index + else + Result := FDestBand.Position.BandIndex; + end; + + function GetColIndex: Integer; + begin + if FDestInsertPosition = posBottom then + Result := 0 + else + begin + Result := FDestBand.Position.ColIndex; + if FDestInsertPosition = posRight then Inc(Result); + if SourceBand.Position.ColIndex < Result then Dec(Result); + end; + end; + + procedure BeforePositionChange; + var + AColIndex, I: Integer; + begin + if (DestInsertPosition <> posBottom) and (GetParentBandIndex = SourceBand.Index) then + begin + AColIndex := SourceBand.Position.ColIndex; + for I := SourceBand.ChildBandCount - 1 downto 0 do + with SourceBand.ChildBands[I].Position do + begin + BandIndex := SourceBand.Position.BandIndex; + ColIndex := AColIndex; + end; + end; + end; + + procedure AfterPositionChange; + var + I: Integer; + begin + case DestInsertPosition of + posTop: + begin + DestBand.Position.BandIndex := SourceBand.Index; + DestBand.Position.ColIndex := 0; + end; + posBottom: + begin + I := 0; + while I < DestBand.VisibleChildBandCount do + if DestBand.VisibleChildBands[I] <> SourceBand then + DestBand.VisibleChildBands[I].Position.BandIndex := SourceBand.Index + else + Inc(I); + end; + end; + end; + +begin + inherited; + Controller.FMovingBand := nil; + if Accepted then + begin + ABandPosChanged := False; + GridView.BeginUpdate; + try + if DestBand = nil then + if CanRemove then + begin + SourceBand.Visible := False; + ABandPosChanged := True; + end + else + if IsEmptyViewInsert then + begin + SourceBand.Position.BandIndex := -1; + SourceBand.Visible := True; + ABandPosChanged := True; + end + else + else + if IsValidDestination then + begin + BeforePositionChange; + SourceBand.Position.BandIndex := GetParentBandIndex; + SourceBand.Position.ColIndex := GetColIndex; + AfterPositionChange; + SourceBand.Visible := True; + ABandPosChanged := True; + end; + finally + GridView.EndUpdate; + end; + if ABandPosChanged then + GridView.DoBandPosChanged(SourceBand); + end; +end; + +procedure TcxGridBandHeaderMovingObject.Init(const P: TPoint; AParams: TcxCustomGridHitTest); +begin + inherited; + with AParams as TcxGridBandHeaderHitTest do + begin + SourceBand := Band; + SourceBandContainerKind := BandContainerKind; + end; +end; + +{ TcxGridColumnVertSizingObject } + +function TcxGridColumnVertSizingObject.GetColumn: TcxGridBandedColumn; +begin + Result := TcxGridBandedColumn(inherited Column); +end; + +function TcxGridColumnVertSizingObject.GetController: TcxGridBandedTableController; +begin + Result := TcxGridBandedTableController(inherited Controller); +end; + +function TcxGridColumnVertSizingObject.GetLineHeight: Integer; +begin + Result := ViewInfo.HeaderViewInfo.ItemHeight; +end; + +procedure TcxGridColumnVertSizingObject.BeginDragAndDrop; +begin + OriginalSize := ColumnHeaderViewInfo.Height; + Controller.FVertSizingColumn := Column; + inherited; +end; + +procedure TcxGridColumnVertSizingObject.EndDragAndDrop(Accepted: Boolean); +begin + inherited; + if Accepted then + begin + Column.Position.LineCount := CurrentSize div LineHeight; + TcxGridBandedTableView(GridView).DoColumnSizeChanged(Column); + end; + Controller.FVertSizingColumn := nil; +end; + +function TcxGridColumnVertSizingObject.GetCurrentSize: Integer; +begin + Result := MulDiv(inherited GetCurrentSize, 1, LineHeight); + Column.Position.CheckLineCount(Result); + Result := Result * LineHeight; +end; + +function TcxGridColumnVertSizingObject.GetIsHorizontalSizing: Boolean; +begin + Result := False; +end; + +{ TcxGridBandSizingObject } + +function TcxGridBandSizingObject.GetBandViewInfo: TcxGridBandViewInfo; +begin + Result := TcxGridBandedTableViewInfo(ViewInfo).HeaderViewInfo.BandsViewInfo[Band.VisibleIndex]; +end; + +function TcxGridBandSizingObject.GetController: TcxGridBandedTableController; +begin + Result := TcxGridBandedTableController(inherited Controller); +end; + +function TcxGridBandSizingObject.GetGridView: TcxGridBandedTableView; +begin + Result := TcxGridBandedTableView(inherited GridView); +end; + +procedure TcxGridBandSizingObject.BeginDragAndDrop; +begin + OriginalSize := BandViewInfo.ContentWidth; + Controller.FSizingBand := Band; + inherited; +end; + +procedure TcxGridBandSizingObject.EndDragAndDrop(Accepted: Boolean); +begin + inherited; + Controller.FSizingBand := nil; + if Accepted and (CurrentSize <> OriginalSize) then + begin + Band.ForceWidth(CurrentSize); + GridView.DoBandSizeChanged(Band); + end; +end; + +function TcxGridBandSizingObject.GetCurrentSize: Integer; +begin + Result := inherited GetCurrentSize; + BandViewInfo.CheckWidth(Result); +end; + +function TcxGridBandSizingObject.GetSizingItemBounds: TRect; +begin + Result := BandViewInfo.ContentBounds; +end; + +function TcxGridBandSizingObject.GetSizingMarkWidth: Integer; +begin + Result := BandSizingMarkWidth; +end; + +procedure TcxGridBandSizingObject.Init(const P: TPoint; AParams: TcxCustomGridHitTest); +begin + inherited; + Band := (AParams as TcxGridBandHeaderSizingEdgeHitTest).Band; +end; + +{ TcxGridBandedTableBandsListBox } + +function TcxGridBandedTableBandsListBox.GetGridView: TcxGridBandedTableView; +begin + Result := TcxGridBandedTableView(inherited GridView); +end; + +function TcxGridBandedTableBandsListBox.DrawItemDrawBackgroundHandler(ACanvas: TcxCanvas; + const ABounds: TRect): Boolean; +begin + Result := GridView.ViewInfo.HeaderViewInfo.BandsViewInfo.DrawBandHeaderBackgroundHandler(ACanvas, ABounds); +end; + +function TcxGridBandedTableBandsListBox.GetDragAndDropParams: TcxCustomGridHitTest; +begin + Result := TcxGridBandHeaderHitTest.Instance(Point(-1, -1)); + with TcxGridBandHeaderHitTest(Result) do + begin + GridView := Self.GridView; + Band := TcxGridBand(DragAndDropItem); + BandContainerKind := bcCustomizationForm; + end; +end; + +function TcxGridBandedTableBandsListBox.GetItemEndEllipsis: Boolean; +begin + Result := GridView.OptionsView.BandHeaderEndEllipsis; +end; + +procedure TcxGridBandedTableBandsListBox.RefreshItems; +var + I: Integer; + ABand: TcxGridBand; +begin + with Items do + begin + BeginUpdate; + try + Clear; + for I := 0 to GridView.Bands.Count - 1 do + begin + ABand := GridView.Bands[I]; + if ABand.CanMove and ABand.VisibleForCustomization and not ABand.Visible then + AddObject(ABand.Caption, ABand); + end; + finally + EndUpdate; + end; + end; +end; + +{ TcxGridBandedTableCustomizationForm } + +function TcxGridBandedTableCustomizationForm.GetGridView: TcxGridBandedTableView; +begin + Result := TcxGridBandedTableView(inherited GridView); +end; + +procedure TcxGridBandedTableCustomizationForm.CreateControls; + + procedure CreateBandsListBox; + begin + FBandsListBox := GetBandsListBoxClass.Create(Self); + with FBandsListBox do + begin + Align := alClient; + Parent := FBandsPage; + RefreshItems; + end; + end; + +begin + inherited; + CreateBandsListBox; +end; + +procedure TcxGridBandedTableCustomizationForm.InitPageControl; +begin + inherited; + FBandsPage := CreatePage(cxGetResourceString(@scxGridCustomizationFormBandsPageCaption), + GridView.OptionsCustomize.BandMoving); + FBandsPage.PageIndex := 0; + ActivatePage(FBandsPage); +end; + +function TcxGridBandedTableCustomizationForm.GetBandsListBoxClass: TcxGridBandedTableBandsListBoxClass; +begin + Result := TcxGridBandedTableBandsListBox; +end; + +procedure TcxGridBandedTableCustomizationForm.RefreshData; +begin + inherited; + FBandsListBox.RefreshItems; +end; + +{ TcxGridBandsCustomizationPopup } + +function TcxGridBandsCustomizationPopup.GetGridView: TcxGridBandedTableView; +begin + Result := TcxGridBandedTableView(inherited GridView); +end; + +procedure TcxGridBandsCustomizationPopup.AddCheckListBoxItems; +var + I: Integer; + + procedure AddBandToItems(AItems: TcxCheckListBoxItems; ABand: TcxGridBand); + var + I: Integer; + begin + if ABand.VisibleForCustomization then + with AItems.Add do + begin + Checked := ABand.Visible; + ItemObject := ABand; + Text := ABand.Caption; + end; + if ABand.Visible then + for I := 0 to ABand.ChildBandCount - 1 do + AddBandToItems(AItems, ABand.ChildBands[I]); + end; + +begin + CheckListBox.Items.BeginUpdate; + try + for I := 0 to GridView.Bands.RootItemCount - 1 do + AddBandToItems(CheckListBox.Items, GridView.Bands.RootItems[I]); + finally + CheckListBox.Items.EndUpdate; + end; +end; + +function TcxGridBandsCustomizationPopup.GetDropDownCount: Integer; +begin + Result := GridView.OptionsCustomize.BandsQuickCustomizationMaxDropDownCount; +end; + +function TcxGridBandsCustomizationPopup.SupportsItemMoving: Boolean; +begin + Result := GridView.OptionsCustomize.SupportsBandsQuickCustomizationReordering; +end; + +procedure TcxGridBandsCustomizationPopup.ItemClicked(AItem: TObject; AChecked: Boolean); +var + AItems: TList; +begin + TcxGridBand(AItem).Visible := AChecked; + + AItems := TList.Create; + try + GetCheckListBoxSelectedItems(AItems); + RefreshCheckListBoxItems; + SetCheckListBoxSelectedItems(AItems); + finally + AItems.Free; + end; + AdjustCheckListBoxSize; + RestoreControlsBounds; + CalculateSize; + + GridView.Controller.DesignerModified; + + GridView.DoBandPosChanged(TcxGridBand(AItem)); +end; + +function TcxGridBandsCustomizationPopup.GetItemIndex(AItem: TObject): Integer; +begin + Result := TcxGridBand(AItem).Index; +end; + +procedure TcxGridBandsCustomizationPopup.SetItemIndex(AItem: TObject; AIndex: Integer); +begin + if TcxGridBand(AItem).Index < AIndex then + Dec(AIndex); + TcxGridBand(AItem).Index := AIndex; + GridView.Controller.DesignerModified; + GridView.DoBandPosChanged(TcxGridBand(AItem)); +end; + +{ TcxGridBandedTableController } + +destructor TcxGridBandedTableController.Destroy; +begin + FBandsCustomizationPopup.Free; + inherited; +end; + +function TcxGridBandedTableController.GetBandsCustomizationPopup: TcxGridBandsCustomizationPopup; +begin + if FBandsCustomizationPopup = nil then + FBandsCustomizationPopup := GetBandsCustomizationPopupClass.Create(GridView); + Result := FBandsCustomizationPopup; +end; + +function TcxGridBandedTableController.GetGridView: TcxGridBandedTableView; +begin + Result := TcxGridBandedTableView(inherited GridView); +end; + +function TcxGridBandedTableController.GetIsBandMoving: Boolean; +begin + Result := FMovingBand <> nil; +end; + +function TcxGridBandedTableController.GetIsBandSizing: Boolean; +begin + Result := FSizingBand <> nil; +end; + +function TcxGridBandedTableController.GetIsColumnVertSizing: Boolean; +begin + Result := FVertSizingColumn <> nil; +end; + +function TcxGridBandedTableController.GetViewInfo: TcxGridBandedTableViewInfo; +begin + Result := TcxGridBandedTableViewInfo(inherited ViewInfo); +end; + +procedure TcxGridBandedTableController.SetPressedBand(Value: TcxGridBand); +var + R: TRect; + + function GetUpdateRect: TRect; + begin + if FPressedBand.VisibleIndex = -1 then + SetRectEmpty(Result) + else + Result := ViewInfo.HeaderViewInfo.BandsViewInfo[FPressedBand.VisibleIndex].HeaderViewInfo.Bounds; + end; + +begin + if FPressedBand <> Value then + begin + if Value = nil then + R := GetUpdateRect; + FPressedBand := Value; + if Value <> nil then + R := GetUpdateRect; + GridView.ViewChanged(R); + end; +end; + +function TcxGridBandedTableController.GetBandsCustomizationPopupClass: TcxGridBandsCustomizationPopupClass; +begin + Result := TcxGridBandsCustomizationPopup; +end; + +function TcxGridBandedTableController.GetColumnHeaderDragAndDropObjectClass: TcxGridColumnHeaderMovingObjectClass; +begin + Result := TcxGridBandedColumnHeaderMovingObject; +end; + +procedure TcxGridBandedTableController.GetColumnNeighbors(AColumn: TcxGridBandedColumn; + AGoForward: Boolean; AList: TList); +var + ABands: TcxGridBands; + ANeighborColumn: TcxGridBandedColumn; + + function GetNextColumn(AColumn: TcxGridBandedColumn): TcxGridBandedColumn; + var + ABand: TcxGridBand; + ARow: TcxGridBandRow; + ARowIndex, AColIndex: Integer; + + function InitializeValues: Boolean; + begin + Result := False; + if AColumn = nil then + if AGoForward then + begin + ABand := ABands.FirstVisibleNonEmpty; + if ABand = nil then Exit; + ARow := ABand.Rows.FirstVisible; + AColIndex := -1; + end + else + begin + ABand := ABands.LastVisibleNonEmpty; + if ABand = nil then Exit; + ARow := ABand.Rows.LastVisible; + AColIndex := ARow.VisibleCount; + end + else + with AColumn.Position do + begin + ABand := Band; + ARow := Row; + ARowIndex := VisibleRowIndex; + AColIndex := VisibleColIndex; + end; + Result := ARow <> nil; + end; + + function ProcessRow: Boolean; + begin + Result := + (AColumn <> nil) and (AGoForward and not AColumn.IsRight or not AGoForward and not AColumn.IsLeft) or + (AColumn = nil) and (ARow.VisibleCount <> 0); + if Result then + GetNextColumn := ARow.VisibleItems[AColIndex + 2 * Ord(AGoForward) - 1]; + end; + + function ProcessBand: Boolean; + var + ALineIndex, AOriginalRowIndex: Integer; + ARowChanged: Boolean; + + procedure FindNextBand; + begin + if AGoForward and ABand.IsLast then + begin + ABand := ABands.FirstVisibleNonEmpty; + ARowIndex := AOriginalRowIndex + 1; + ARowChanged := True; + end + else + if not AGoForward and ABand.IsFirst then + begin + ABand := ABands.LastVisibleNonEmpty; + ARowIndex := AOriginalRowIndex - 1; + ARowChanged := True; + end + else + begin + ABand := ABands.VisibleBottomItems[ABand.VisibleBottomIndex + 2 * Ord(AGoForward) - 1]; + if not ARowChanged then + ARowIndex := ABand.Rows.GetRowIndex(ALineIndex); + end; + end; + + begin + if ARowIndex = -1 then + ALineIndex := 0 + else + ALineIndex := ABand.Rows.GetLineIndex(ARowIndex); + AOriginalRowIndex := ARowIndex; + ARowChanged := False; + repeat + FindNextBand; + Result := (0 <= ARowIndex) and (ARowIndex < ABand.Rows.VisibleCount); + until Result or + AGoForward and ABand.IsFirstNonEmpty and (ARowIndex = ABands.VisibleRowCount) or + not AGoForward and ABand.IsLastNonEmpty and (ARowIndex = -1); + if Result then + begin + AColumn := nil; + ARow := ABand.Rows.VisibleItems[ARowIndex]; + if AGoForward then + AColIndex := -1 + else + AColIndex := ARow.VisibleCount; + end; + end; + + begin + Result := nil; + if not InitializeValues then Exit; + while not ProcessRow do + if not ProcessBand then Break; + end; + +begin + AList.Clear; + if (AColumn <> nil) and not AColumn.ActuallyVisible then Exit; + ABands := GridView.Bands; + ANeighborColumn := AColumn; + repeat + ANeighborColumn := GetNextColumn(ANeighborColumn); + if (ANeighborColumn = nil) or (AList.IndexOf(ANeighborColumn) <> -1) then + Break + else + AList.Add(ANeighborColumn); + until False; +end; + +function TcxGridBandedTableController.GetCustomizationFormClass: TcxCustomGridCustomizationFormClass; +begin + Result := TcxGridBandedTableCustomizationForm; +end; + +function TcxGridBandedTableController.GetDesignHitTest(AHitTest: TcxCustomGridHitTest): Boolean; +begin + Result := inherited GetDesignHitTest(AHitTest); + if not Result then + Result := AHitTest.HitTestCode in [htBandHeader, htIndicatorBandHeader]; +end; + +function TcxGridBandedTableController.GetPatternObject(AObject: TPersistent): TPersistent; +begin + if AObject is TcxGridBand then + Result := TcxGridBandedTableView(GridView.PatternGridView).Bands.FindItemID(TcxGridBand(AObject).ID) + else + Result := inherited GetPatternObject(AObject); +end; + +function TcxGridBandedTableController.IsBandFixedDuringSizing(ABand: TcxGridBand): Boolean; +begin + Result := (ABand = ForcingWidthBand) or + not ForcingWidthBand.IsLastAsChild and (ABand.ParentBand = ForcingWidthBand.ParentBand) and + (ABand.Position.VisibleColIndex < ForcingWidthBand.Position.VisibleColIndex); +end; + +function TcxGridBandedTableController.IsColumnFixedDuringHorzSizing(AColumn: TcxGridColumn): Boolean; +var + APosition1, APosition2: TcxGridBandedColumnPosition; +begin + APosition1 := TcxGridBandedColumn(AColumn).Position; + APosition2 := TcxGridBandedColumn(ForcingWidthItem).Position; + Result := + (APosition1 = APosition2) or + not APosition2.Item.IsRight and (APosition1.Row = APosition2.Row) and + (APosition1.VisibleColIndex < APosition2.VisibleColIndex); +end; + +procedure TcxGridBandedTableController.LeftPosChanged; +begin + with GridView do + if Preview.Active and Preview.AutoHeight and (Bands.Layout <> blNonFixed) then + SizeChanged + else + inherited; +end; + +function TcxGridBandedTableController.GetCellMultiSelect: Boolean; +begin + Result := inherited GetCellMultiSelect and (ViewInfo.HeaderViewInfo.RowCount = 1); +end; + +procedure TcxGridBandedTableController.DoCancelMode; +begin + inherited; + PressedBand := nil; +end; + +procedure TcxGridBandedTableController.EndDragAndDrop(Accepted: Boolean); +begin + PressedBand := nil; + inherited; +end; + +function TcxGridBandedTableController.HasBandsCustomizationPopup: Boolean; +begin + Result := FBandsCustomizationPopup <> nil; +end; + +function CanFocusColumnVertically(AOwner: TcxCustomGridTableView; + AItemIndex: Integer; AData: TObject): Boolean; +begin + Result := TcxGridBandedColumn(TList(AData)[AItemIndex]).CanFocus(nil); +end; + +function TcxGridBandedTableController.FindNextColumnVertically(AFocusedItemIndex: Integer; + AGoForward, AGoOnCycle: Boolean): Integer; +var + AColumn: TcxGridBandedColumn; + AColumns: TList; + ACycleChanged: Boolean; + + procedure InitializeColumns; + var + AColIndex, I, AIndex: Integer; + begin + AColIndex := AColumn.Position.VisibleColIndex; + with AColumn.Position.Band.Rows do + for I := 0 to VisibleCount - 1 do + with VisibleItems[I] do + begin + AIndex := AColIndex; + if AIndex > VisibleCount - 1 then + AIndex := VisibleCount - 1; + AColumns.Add(VisibleItems[AIndex]); + end; + end; + +begin + if AFocusedItemIndex = -1 then + Result := -1 + else + begin + AColumn := GridView.VisibleColumns[AFocusedItemIndex]; + AColumns := TList.Create; + try + InitializeColumns; + if FindNextCustomItem(AColumns.IndexOf(AColumn), AColumns.Count, + AGoForward, AGoOnCycle, @CanFocusColumnVertically, AColumns, Result, + ACycleChanged) then + Result := TcxGridBandedColumn(AColumns[Result]).VisibleIndex + else + Result := -1; + finally + AColumns.Free; + end; + end; +end; + +function CanFocusColumn(AOwner: TcxCustomGridTableView; AItemIndex: Integer; + AData: TObject): Boolean; +begin + Result := TcxGridBandedColumn(TData(AData).Columns[AItemIndex]).CanFocus(TData(AData).GridRecord); +end; + +function TcxGridBandedTableController.FindNextItem(AFocusedItemIndex: Integer; + AGoForward, AGoOnCycle: Boolean; out ACycleChanged: Boolean; + ARecord: TcxCustomGridRecord): Integer; +var + AColumns: TList; + AColumn: TcxGridBandedColumn; + AData: TData; +begin + ACycleChanged := False; + AColumns := TList.Create; + try + if AFocusedItemIndex = -1 then + AColumn := nil + else + AColumn := GridView.VisibleColumns[AFocusedItemIndex]; + GetColumnNeighbors(AColumn, AGoForward, AColumns); + + AData := TData.Create; + try + AData.Columns := AColumns; + AData.GridRecord := ARecord; + if FindNextCustomItem(-1, AColumns.Count, True, False, + @CanFocusColumn, AData, Result, ACycleChanged) then + Result := TcxGridBandedColumn(AColumns[Result]).VisibleIndex + else + if AGoOnCycle then + begin + Result := FindNextItem(-1, AGoForward, False, ACycleChanged, ARecord); + ACycleChanged := True; + end + else + Result := -1; + finally + AData.Free; + end; + finally + AColumns.Free; + end; +end; + +function TcxGridBandedTableController.FocusNextColumnVertically(AFocusedColumnIndex: Integer; + AGoForward, AGoOnCycle: Boolean): Boolean; +var + ANextItemIndex: Integer; +begin + ANextItemIndex := FindNextColumnVertically(AFocusedColumnIndex, AGoForward, AGoOnCycle); + Result := ANextItemIndex <> -1; + if Result then + GridView.VisibleItems[ANextItemIndex].Focused := True; +end; + +procedure TcxGridBandedTableController.KeyDown(var Key: Word; Shift: TShiftState); +var + APrevFocusedRowIndex: Integer; + APrevFocusedRowHasColumns: Boolean; + + function IsFocusedRecordChanged: Boolean; + begin + Result := (FocusedRowIndex <> APrevFocusedRowIndex) or + DataController.IsGridMode and + ((Key = VK_UP) and not DataController.IsBOF or (Key = VK_DOWN) and not DataController.IsEOF); + end; + +begin + APrevFocusedRowIndex := FocusedRowIndex; + APrevFocusedRowHasColumns := (FocusedRow <> nil) and + FocusedRow.HasCells and GridView.OptionsSelection.CellSelect; + if APrevFocusedRowHasColumns then + case Key of + VK_UP: + if FocusNextColumnVertically(FocusedColumnIndex, False, False) then + Key := 0; + VK_DOWN: + if FocusNextColumnVertically(FocusedColumnIndex, True, False) then + Key := 0; + end; + inherited; + if APrevFocusedRowHasColumns and IsFocusedRecordChanged and + (FocusedRow <> nil) and FocusedRow.HasCells then + case Key of + VK_UP: + FocusNextColumnVertically(FocusedColumnIndex, False, True); + VK_DOWN: + FocusNextColumnVertically(FocusedColumnIndex, True, True); + end; +end; + +procedure TcxGridBandedTableController.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited; + PressedBand := nil; +end; + +{ TcxGridBandHeaderPainter } + +function TcxGridBandHeaderPainter.GetViewInfo: TcxGridBandHeaderViewInfo; +begin + Result := TcxGridBandHeaderViewInfo(inherited ViewInfo); +end; + +procedure TcxGridBandHeaderPainter.DrawBorders; +begin + // inherited; +end; + +procedure TcxGridBandHeaderPainter.DrawContent; +const + States: array[TcxGridCellState] of TcxButtonState = (cxbsNormal, cxbsHot, cxbsPressed); +var + AState: TcxButtonState; +begin + with ViewInfo do + begin + if IsMainCanvasInUse then + begin + AState := States[State]; + if IsPressed then AState := cxbsPressed; + end + else + AState := cxbsNormal; + LookAndFeelPainter.DrawHeader(Self.Canvas, Bounds, TextAreaBounds, [], + Borders, AState, AlignmentHorz, AlignmentVert, MultiLinePainting, ShowEndEllipsis, + Text, Params.Font, Params.TextColor, Params.Color, + BandViewInfo.BandsViewInfo.DrawBandHeaderBackgroundHandler, Band.IsMostRight); + end; +end; + +procedure TcxGridBandHeaderPainter.DrawPressed; +begin + with ViewInfo do + LookAndFeelPainter.DrawHeaderPressed(Self.Canvas, Bounds); +end; + +function TcxGridBandHeaderPainter.ExcludeFromClipRect: Boolean; +begin + Result := True; +end; + +procedure TcxGridBandHeaderPainter.Paint; +begin + inherited; + if ViewInfo.IsPressed and IsMainCanvasInUse then DrawPressed; +end; + +{ TcxGridBandPainter } + +function TcxGridBandPainter.GetViewInfo: TcxGridBandViewInfo; +begin + Result := TcxGridBandViewInfo(inherited ViewInfo); +end; + +procedure TcxGridBandPainter.DrawChildBands; +var + I: Integer; +begin + with ViewInfo do + for I := 0 to ChildBandViewInfoCount - 1 do + ChildBandViewInfos[I].Paint; +end; + +procedure TcxGridBandPainter.DrawColumnHeaders; +var + I, J: Integer; +begin + with ViewInfo do + for I := 0 to RowCount - 1 do + with RowsViewInfo[I] do + for J := 0 to ColumnViewInfoCount - 1 do + ColumnViewInfos[J].Paint; +end; + +procedure TcxGridBandPainter.DrawContent; +begin + DrawHeader; + if ViewInfo.IsBottom then + DrawColumnHeaders + else + DrawChildBands; + inherited; +end; + +procedure TcxGridBandPainter.DrawHeader; +begin + ViewInfo.HeaderViewInfo.Paint; +end; + +function TcxGridBandPainter.ExcludeFromClipRect: Boolean; +begin + Result := True; +end; + +{ TcxGridBandedHeaderPainter } + +function TcxGridBandedHeaderPainter.GetViewInfo: TcxGridBandedHeaderViewInfo; +begin + Result := TcxGridBandedHeaderViewInfo(inherited ViewInfo); +end; + +procedure TcxGridBandedHeaderPainter.DrawBands; + + procedure ProcessItems(AFixedKind: TcxGridBandFixedKind); + var + I: Integer; + AItem: TcxGridBandViewInfo; + begin + with ViewInfo.BandsViewInfo do + for I := 0 to RootItemCount - 1 do + begin + AItem := RootItems[I]; + if AItem.FixedKind = AFixedKind then + AItem.Paint; + end; + end; + +begin + ProcessItems(fkLeft); + ProcessItems(fkRight); + ProcessItems(fkNone); +end; + +procedure TcxGridBandedHeaderPainter.DrawItems; +begin + DrawBands; +end; + +{ TcxGridBandedFooterPainter } + +procedure TcxGridBandedFooterPainter.DrawItems; +var + AClipRegion: TcxRegion; + AFixedPartExcluded: array[TcxGridBandFixedKind] of Boolean; + AFixedKind: TcxGridBandFixedKind; + I: Integer; + AViewInfo: TcxGridColumnHeaderViewInfo; + ABand: TcxGridBand; + + function GetFixedPartBounds(AFixedKind: TcxGridBandFixedKind): TRect; + var + ABandViewInfo: TcxGridBandViewInfo; + begin + Result := ViewInfo.Bounds; + with TcxGridBandedHeaderViewInfo(ViewInfo.GridViewInfo.HeaderViewInfo).BandsViewInfo do + begin + ABandViewInfo := LastFixedItems[AFixedKind, 0]; + if ABandViewInfo <> nil then + case AFixedKind of + fkLeft: + Result.Right := ABandViewInfo.Bounds.Right; + fkRight: + Result.Left := ABandViewInfo.Bounds.Left; + end + else + Result := Rect(0, 0, 0, 0); + end; + end; + + procedure ExcludeFixedPart(AFixedKind: TcxGridBandFixedKind); + begin + Canvas.ExcludeClipRect(GetFixedPartBounds(AFixedKind)); + AFixedPartExcluded[AFixedKind] := True; + end; + + procedure IncludeFixedPart(AFixedKind: TcxGridBandFixedKind); + var + ARegion: TcxRegion; + begin + if not AFixedPartExcluded[AFixedKind] then Exit; + ARegion := TcxRegion.Create(GetFixedPartBounds(AFixedKind)); + Canvas.SetClipRegion(ARegion, roAdd); + AFixedPartExcluded[AFixedKind] := False; + end; + + procedure ChangeFixedKind(Value: TcxGridBandFixedKind); + begin + case AFixedKind of + fkLeft: + begin + AClipRegion := Canvas.GetClipRegion; + ExcludeFixedPart(fkLeft); + end; + fkRight: + begin + IncludeFixedPart(fkLeft); + Canvas.SetClipRegion(AClipRegion, roIntersect); + AClipRegion := Canvas.GetClipRegion; + ExcludeFixedPart(fkLeft); + ExcludeFixedPart(fkRight); + end; + end; + AFixedKind := Value; + end; + + procedure RestoreClipRegion; + begin + if AClipRegion <> nil then + begin + IncludeFixedPart(fkLeft); + IncludeFixedPart(fkRight); + Canvas.SetClipRegion(AClipRegion, roIntersect); + AClipRegion := nil; + end; + end; + +begin + AClipRegion := nil; + for AFixedKind := Low(AFixedKind) to High(AFixedKind) do + AFixedPartExcluded[AFixedKind] := False; + + AFixedKind := fkLeft; + for I := 0 to ViewInfo.Count - 1 do + begin + AViewInfo := ViewInfo.InternalItems[I]; + if AViewInfo <> nil then + begin + ABand := TcxGridBandedColumn(AViewInfo.Column).Position.Band; + if ABand.FixedKind <> AFixedKind then + ChangeFixedKind(ABand.FixedKind); + AViewInfo.Paint; + end; + end; + + RestoreClipRegion; +end; + +{ TcxGridIndicatorBandHeaderItemPainter } + +function TcxGridIndicatorBandHeaderItemPainter.GetViewInfo: TcxGridIndicatorBandHeaderItemViewInfo; +begin + Result := TcxGridIndicatorBandHeaderItemViewInfo(inherited ViewInfo); +end; + +function TcxGridIndicatorBandHeaderItemPainter.DrawBackgroundHandler(ACanvas: TcxCanvas; + const ABounds: TRect): Boolean; +begin + Result := ViewInfo.GridView.ViewInfo.HeaderViewInfo.BandsViewInfo.DrawBandHeaderBackgroundHandler(ACanvas, ABounds); +end; + +{ TcxGridBandedDataRowCellsAreaItemPainter } + +function TcxGridBandedDataRowCellsAreaItemPainter.GetViewInfo: TcxGridBandedDataRowCellsAreaItemViewInfo; +begin + Result := TcxGridBandedDataRowCellsAreaItemViewInfo(inherited ViewInfo); +end; + +procedure TcxGridBandedDataRowCellsAreaItemPainter.DrawFixedBandsSeparator; +var + R: TRect; +begin + with Canvas do + begin + R := ViewInfo.FixedBandsSeparatorBounds; + Brush.Color := ViewInfo.GridViewInfo.FixedBandSeparatorColor; + FillRect(R); + ExcludeClipRect(R); + end; +end; + +procedure TcxGridBandedDataRowCellsAreaItemPainter.DrawContent; +begin + DrawLines; + inherited; +end; + +procedure TcxGridBandedDataRowCellsAreaItemPainter.DrawLines; +var + I: Integer; + R: TRect; +begin + Canvas.Brush.Color := ViewInfo.GridViewInfo.GridLineColor; + for I := 0 to ViewInfo.LineCount - 1 do + begin + R := ViewInfo.LineBounds[I]; + Canvas.FillRect(R); + Canvas.ExcludeClipRect(R); + end; +end; + +function TcxGridBandedDataRowCellsAreaItemPainter.ExcludeFromClipRect: Boolean; +begin + Result := True; +end; + +procedure TcxGridBandedDataRowCellsAreaItemPainter.Paint; +begin + if ViewInfo.FixedBandsSeparatorLocation <> slNone then + DrawFixedBandsSeparator; + inherited; +end; + +{ TcxGridBandedRowsPainter } + +class procedure TcxGridBandedRowsPainter.DrawDataRowCells(ARowViewInfo: TcxCustomGridRowViewInfo); +var + ADataRowViewInfo: TcxGridDataRowViewInfo; + ACellsAreaViewInfo: TcxGridBandedDataRowCellsAreaViewInfo; + ACanvas: TcxCanvas; + AClipRegion: TcxRegion; + + procedure DrawBandCells(ABandViewInfo: TcxGridBandViewInfo); + var + I: Integer; + ACellViewInfo: TcxGridDataCellViewInfo; + begin + for I := 0 to ABandViewInfo.ColumnViewInfoCount - 1 do + begin + ACellViewInfo := ADataRowViewInfo.InternalCellViewInfos[ABandViewInfo[I].Index]; + if ACellViewInfo <> nil then ACellViewInfo.Paint; + end; + if ACellsAreaViewInfo.Visible then + ACellsAreaViewInfo[ABandViewInfo.BottomIndex].Paint; + end; + + procedure DrawBands(AFixedKind: TcxGridBandFixedKind); + var + I: Integer; + ABandViewInfo: TcxGridBandViewInfo; + begin + with TcxGridBandedTableViewInfo(ARowViewInfo.GridViewInfo).HeaderViewInfo.BandsViewInfo do + for I := 0 to BottomItemCount - 1 do + begin + ABandViewInfo := BottomItems[I]; + if ABandViewInfo.FixedKind = AFixedKind then + DrawBandCells(ABandViewInfo); + end; + end; + +begin + ADataRowViewInfo := TcxGridDataRowViewInfo(ARowViewInfo); + ACellsAreaViewInfo := TcxGridBandedDataRowCellsAreaViewInfo(ADataRowViewInfo.CellsAreaViewInfo); + ACanvas := ARowViewInfo.GridViewInfo.Canvas; + if ACellsAreaViewInfo.Visible then + begin + AClipRegion := ACanvas.GetClipRegion; + ACanvas.IntersectClipRect(ACellsAreaViewInfo.Bounds); // for layout with the fixed bands + end + else + AClipRegion := nil; + try + {if ACellsAreaViewInfo.Count = 0 then + ACellsAreaViewInfo.Paint;} + DrawBands(fkLeft); + DrawBands(fkRight); + DrawBands(fkNone); + ACellsAreaViewInfo.Paint; + finally + if AClipRegion <> nil then + begin + ACanvas.SetClipRegion(AClipRegion, roSet); + ACanvas.ExcludeClipRect(ACellsAreaViewInfo.Bounds); + end; + end; +end; + +{ TcxGridBandedTablePainter } + +function TcxGridBandedTablePainter.GetViewInfo: TcxGridBandedTableViewInfo; +begin + Result := TcxGridBandedTableViewInfo(inherited ViewInfo); +end; + +function TcxGridBandedTablePainter.CanOffset(AItemsOffset, DX, DY: Integer): Boolean; +begin + with ViewInfo.HeaderViewInfo.BandsViewInfo do + Result := inherited CanOffset(AItemsOffset, DX, DY) and + ((AItemsOffset <> 0) or (BandBackgroundBitmap = nil) and (BandHeaderBackgroundBitmap = nil) and + ((GridView.Bands.Layout = blNonFixed) or + (GridView.GroupedColumnCount = 0) and not GridView.Preview.Active)); +end; + +{ TcxGridBandedColumnHeaderVertSizingEdgeViewInfo } + +function TcxGridBandedColumnHeaderVertSizingEdgeViewInfo.CalculateHeight: Integer; +begin + Result := cxGridHeaderSizingEdgeSize; +end; + +function TcxGridBandedColumnHeaderVertSizingEdgeViewInfo.CalculateWidth: Integer; +begin + Result := 0; +end; + +function TcxGridBandedColumnHeaderVertSizingEdgeViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + Result := vaBottom; +end; + +function TcxGridBandedColumnHeaderVertSizingEdgeViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridColumnHeaderVertSizingEdgeHitTest; +end; + +function TcxGridBandedColumnHeaderVertSizingEdgeViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := nil; +end; + +function TcxGridBandedColumnHeaderVertSizingEdgeViewInfo.OccupiesSpace: Boolean; +begin + Result := False; +end; + +function TcxGridBandedColumnHeaderVertSizingEdgeViewInfo.ResidesInContent: Boolean; +begin + Result := False; +end; + +procedure TcxGridBandedColumnHeaderVertSizingEdgeViewInfo.Calculate(const ABounds: TRect; + var ATextAreaBounds: TRect); +begin + inherited; + OffsetRect(Bounds, 0, Height div 2); +end; + +{ TcxGridBandedColumnHeaderViewInfo } + +function TcxGridBandedColumnHeaderViewInfo.GetBandViewInfo: TcxGridBandViewInfo; +begin + Result := Container.BandsViewInfo[Column.Position.VisibleBandIndex]; +end; + +function TcxGridBandedColumnHeaderViewInfo.GetColumn: TcxGridBandedColumn; +begin + Result := TcxGridBandedColumn(inherited Column); +end; + +function TcxGridBandedColumnHeaderViewInfo.GetContainer: TcxGridBandedHeaderViewInfo; +begin + Result := TcxGridBandedHeaderViewInfo(inherited Container); +end; + +function TcxGridBandedColumnHeaderViewInfo.GetRowViewInfo: TcxGridBandRowViewInfo; +begin + Result := BandViewInfo.RowsViewInfo[Column.Position.VisibleRowIndex]; +end; + +function TcxGridBandedColumnHeaderViewInfo.CanVertSize: Boolean; +begin + Result := Column.CanVertSize and (Container.Kind = ckHeader); +end; + +procedure TcxGridBandedColumnHeaderViewInfo.GetAreaViewInfoClasses(AProc: TcxGridClassEnumeratorProc); +begin + inherited; + if CanVertSize then AProc(TcxGridBandedColumnHeaderVertSizingEdgeViewInfo); +end; + +function TcxGridBandedColumnHeaderViewInfo.GetMaxWidth: Integer; +var + AColIndex, I: Integer; +begin + if (BandViewInfo.Band.Width <> 0) or BandViewInfo.Band.HasParentWithAssignedWidth then + begin + if BandViewInfo.Band.Width = 0 then + Result := BandViewInfo.MaxContentWidth + else + Result := RowViewInfo.Width; + AColIndex := Column.Position.VisibleColIndex; + if AColIndex = RowViewInfo.ColumnViewInfoCount - 1 then + for I := 0 to AColIndex - 1 do + Dec(Result, RowViewInfo[I].MinWidth) + else + for I := 0 to RowViewInfo.ColumnViewInfoCount - 1 do + begin + if I < AColIndex then + Dec(Result, RowViewInfo[I].Width); + if I > AColIndex then + Dec(Result, RowViewInfo[I].MinWidth); + end; + if Result < MinWidth then Result := MinWidth; + end + else + Result := MaxInt; +end; + +{ TcxGridBandHeaderViewInfo } + +constructor TcxGridBandHeaderViewInfo.Create(ABandViewInfo: TcxGridBandViewInfo); +begin + inherited Create(ABandViewInfo.GridViewInfo); + FBandViewInfo := ABandViewInfo; +end; + +function TcxGridBandHeaderViewInfo.GetBand: TcxGridBand; +begin + Result := FBandViewInfo.Band; +end; + +function TcxGridBandHeaderViewInfo.GetGridView: TcxGridBandedTableView; +begin + Result := TcxGridBandedTableView(inherited GridView); +end; + +function TcxGridBandHeaderViewInfo.GetGridViewInfo: TcxGridBandedTableViewInfo; +begin + Result := FBandViewInfo.GridViewInfo; +end; + +function TcxGridBandHeaderViewInfo.GetRowCount: Integer; +begin + if FBandViewInfo.IsBottom then + Result := FBandViewInfo.BandsViewInfo.BandHeaderRowCount - Band.BandLevelIndex + else + Result := 1; +end; + +function TcxGridBandHeaderViewInfo.CalculateHeight: Integer; +begin + Result := FBandViewInfo.BandsViewInfo.CalculateBandHeaderHeight(Self); +end; + +function TcxGridBandHeaderViewInfo.CalculateWidth: Integer; +begin + with Bounds do + Result := Right - Left; +end; + +function TcxGridBandHeaderViewInfo.CanShowHint: Boolean; +begin + Result := GridView.OptionsBehavior.BandHeaderHints; +end; + +function TcxGridBandHeaderViewInfo.CustomDraw(ACanvas: TcxCanvas): Boolean; +begin + Result := inherited CustomDraw(ACanvas); + GridViewInfo.GridView.DoCustomDrawBandHeader(ACanvas, Self, Result); +end; + +function TcxGridBandHeaderViewInfo.GetAlignmentHorz: TAlignment; +begin + Result := Band.HeaderAlignmentHorz; +end; + +function TcxGridBandHeaderViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + Result := Band.HeaderAlignmentVert; +end; + +function TcxGridBandHeaderViewInfo.GetAreaBounds: TRect; +begin + Result := BandViewInfo.BandsViewInfo.GetItemAreaBounds(Band); +end; + +function TcxGridBandHeaderViewInfo.GetBackgroundBitmap: TBitmap; +begin + Result := BandViewInfo.BandsViewInfo.BandHeaderBackgroundBitmap; +end; + +function TcxGridBandHeaderViewInfo.GetBorders: TcxBorders; +begin + Result := cxBordersAll; +end; + +function TcxGridBandHeaderViewInfo.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := LookAndFeelPainter.HeaderBorderSize; +end; + +function TcxGridBandHeaderViewInfo.GetCanvas: TcxCanvas; +begin + Result := FBandViewInfo.Canvas; +end; + +class function TcxGridBandHeaderViewInfo.GetCellHeight(ATextHeight: Integer; + ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; +begin + Result := inherited GetCellHeight(ATextHeight, ALookAndFeelPainter) + + 2 * ALookAndFeelPainter.HeaderBorderSize; +end; + +function TcxGridBandHeaderViewInfo.GetHeight: Integer; +var + I: Integer; +begin + if FBandViewInfo.IsBottom then + begin + Result := 0; + for I := Band.BandLevelIndex to FBandViewInfo.BandsViewInfo.BandHeaderRowCount - 1 do + Inc(Result, FBandViewInfo.BandsViewInfo.BandHeaderRowHeights[I]); + end + else + Result := FBandViewInfo.BandsViewInfo.BandHeaderRowHeights[Band.BandLevelIndex]; +end; + +function TcxGridBandHeaderViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridBandHeaderHitTest; +end; + +function TcxGridBandHeaderViewInfo.GetHotTrack: Boolean; +begin + Result := LookAndFeelPainter.IsHeaderHotTrack; +end; + +function TcxGridBandHeaderViewInfo.GetIsDesignSelected: Boolean; +begin + Result := GridView.IsDesigning and + GridView.Controller.DesignController.IsObjectSelected(Band); +end; + +function TcxGridBandHeaderViewInfo.GetIsPressed: Boolean; +begin + Result := (State = gcsPressed) or (GridViewInfo.Controller.PressedBand = Band); +end; + +function TcxGridBandHeaderViewInfo.GetMultiLinePainting: Boolean; +begin + Result := inherited GetMultiLinePainting or + FBandViewInfo.BandsViewInfo.IsBandHeaderHeightAssigned; +end; + +function TcxGridBandHeaderViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridBandHeaderPainter; +end; + +function TcxGridBandHeaderViewInfo.GetShowEndEllipsis: Boolean; +begin + Result := GridView.OptionsView.BandHeaderEndEllipsis; +end; + +function TcxGridBandHeaderViewInfo.GetSizingEdgeBounds: TRect; +begin + Result := Bounds; + with Result do + begin + Left := Right - cxGridHeaderSizingEdgeSize div 2; + Right := Left + cxGridHeaderSizingEdgeSize; + end; +end; + +function TcxGridBandHeaderViewInfo.GetText: string; +begin + Result := Band.Caption; +end; + +function TcxGridBandHeaderViewInfo.GetVisible: Boolean; +begin + Result := FBandViewInfo.BandsViewInfo.ShowBandHeaders; +end; + +procedure TcxGridBandHeaderViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + Band.Styles.GetHeaderParams(AParams); +end; + +function TcxGridBandHeaderViewInfo.HasCustomDraw: Boolean; +begin + Result := GridView.HasCustomDrawBandHeader; +end; + +procedure TcxGridBandHeaderViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + FBandViewInfo.InitHitTest(AHitTest); + inherited; +end; + +function TcxGridBandHeaderViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + if FBandViewInfo.CanSize and PtInRect(SizingEdgeBounds, P) then + begin + Result := TcxGridBandHeaderSizingEdgeHitTest.Instance(P); + InitHitTest(Result); + end + else + Result := inherited GetHitTest(P); +end; + +function TcxGridBandHeaderViewInfo.MouseDown(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +var + ABand: TcxGridBand; +begin + Result := inherited MouseDown(AHitTest, AButton, AShift); + if AButton = mbLeft then + case AHitTest.HitTestCode of + htBandHeader: + if not (ssDouble in AShift) then + begin + if GridView.IsDesigning then + GridView.Controller.DesignController.SelectObject(Band, not (ssShift in AShift)) + else + begin + GridView.Controller.PressedBand := Band; + Band.DoHeaderClick; + end; + Result := True; + end; + htBandHeaderSizingEdge: + if ssDouble in AShift then + begin + ABand := Band; + ABand.ApplyBestFit(True); + ABand.GridView.DoBandSizeChanged(ABand); + Result := True; + end; + end; +end; + +{ TcxGridBandRowViewInfo } + +constructor TcxGridBandRowViewInfo.Create(ARowsViewInfo: TcxGridBandRowsViewInfo; + AIndex: Integer); +begin + inherited Create; + FRowsViewInfo := ARowsViewInfo; + FIndex := AIndex; + FColumnViewInfos := TList.Create; + FHeight := -1; + AddColumnViewInfos; +end; + +destructor TcxGridBandRowViewInfo.Destroy; +begin + FColumnViewInfos.Free; + inherited; +end; + +function TcxGridBandRowViewInfo.GetBandRow: TcxGridBandRow; +begin + Result := FRowsViewInfo.BandRows.VisibleItems[FIndex]; +end; + +function TcxGridBandRowViewInfo.GetBandViewInfo: TcxGridBandViewInfo; +begin + Result := FRowsViewInfo.BandViewInfo; +end; + +function TcxGridBandRowViewInfo.GetColumnViewInfo(Index: Integer): TcxGridBandedColumnHeaderViewInfo; +begin + Result := TcxGridBandedColumnHeaderViewInfo(FColumnViewInfos[Index]); +end; + +function TcxGridBandRowViewInfo.GetColumnViewInfoCount: Integer; +begin + Result := FColumnViewInfos.Count; +end; + +function TcxGridBandRowViewInfo.GetGridView: TcxGridBandedTableView; +begin + Result := FRowsViewInfo.BandViewInfo.GridView; +end; + +function TcxGridBandRowViewInfo.GetHeight: Integer; +begin + if FHeight = -1 then + FHeight := CalculateHeight; + Result := FHeight; +end; + +function TcxGridBandRowViewInfo.GetLineHeight: Integer; +begin + Result := BandViewInfo.ContainerViewInfo.ItemHeight; +end; + +function TcxGridBandRowViewInfo.GetMinWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to ColumnViewInfoCount - 1 do + Inc(Result, ColumnViewInfos[I].MinWidth); +end; + +function TcxGridBandRowViewInfo.GetWidth: Integer; +begin + with Bounds do + Result := Right - Left; +end; + +procedure TcxGridBandRowViewInfo.AddColumnViewInfos; +var + AHeaderViewInfo: TcxGridBandedHeaderViewInfo; + I: Integer; + AColumnViewInfo: TcxGridBandedColumnHeaderViewInfo; +begin + AHeaderViewInfo := BandViewInfo.GridViewInfo.HeaderViewInfo; + for I := 0 to BandRow.VisibleCount - 1 do + begin + AColumnViewInfo := AHeaderViewInfo[BandRow.VisibleItems[I].VisibleIndex]; + FColumnViewInfos.Add(AColumnViewInfo); + end; +end; + +procedure TcxGridBandRowViewInfo.Calculate(const ABounds: TRect); +var + ALeftBound, ATopBound, ALineHeight, I, AWidth: Integer; + AColumnViewInfo: TcxGridBandedColumnHeaderViewInfo; +begin + Bounds := ABounds; + CalculateColumnWidths; + ALeftBound := Bounds.Left; + ATopBound := Bounds.Top; + ALineHeight := LineHeight; + for I := 0 to ColumnViewInfoCount - 1 do + begin + AColumnViewInfo := ColumnViewInfos[I]; + AWidth := AColumnViewInfo.CalculateWidth; + AColumnViewInfo.Calculate(ALeftBound, ATopBound, AWidth, + AColumnViewInfo.Column.Position.LineCount * ALineHeight); + Inc(ALeftBound, AWidth); + end; +end; + +procedure TcxGridBandRowViewInfo.CalculateColumnWidths; +var + AAutoWidthObject: TcxAutoWidthObject; + I: Integer; +begin + AAutoWidthObject := TcxAutoWidthObject.Create(ColumnViewInfoCount); + try + for I := 0 to ColumnViewInfoCount - 1 do + ColumnViewInfos[I].InitAutoWidthItem(AAutoWidthObject.AddItem); + AAutoWidthObject.AvailableWidth := FRowsViewInfo.Width; + AAutoWidthObject.Calculate; + for I := 0 to ColumnViewInfoCount - 1 do + ColumnViewInfos[I].Width := AAutoWidthObject[I].AutoWidth; + finally + AAutoWidthObject.Free; + end; +end; + +function TcxGridBandRowViewInfo.CalculateHeight: Integer; +begin + Result := BandRow.LineCount * LineHeight; +end; + +function TcxGridBandRowViewInfo.CalculateLineHeight: Integer; +var + I, AColumnHeaderHeight: Integer; +begin + Result := 0; + for I := 0 to ColumnViewInfoCount - 1 do + begin + AColumnHeaderHeight := ColumnViewInfos[I].CalculateHeight; + if AColumnHeaderHeight > Result then + Result := AColumnHeaderHeight; + end; +end; + +function TcxGridBandRowViewInfo.CalculateWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to ColumnViewInfoCount - 1 do + Inc(Result, ColumnViewInfos[I].CalculateWidth); +end; + +procedure TcxGridBandRowViewInfo.AssignColumnWidths; +var + I: Integer; +begin + GridView.BeginUpdate; + try + for I := 0 to ColumnViewInfoCount - 1 do + with ColumnViewInfos[I] do + Column.Width := RealWidth; + finally + GridView.EndUpdate; + end; +end; + +procedure TcxGridBandRowViewInfo.Offset(DX, DY: Integer); +begin + OffsetRect(Bounds, DX, DY); +end; + +{ TcxGridBandRowsViewInfo } + +constructor TcxGridBandRowsViewInfo.Create(ABandViewInfo: TcxGridBandViewInfo); +begin + inherited Create; + FBandViewInfo := ABandViewInfo; + FWidth := -1; + CreateItems; +end; + +destructor TcxGridBandRowsViewInfo.Destroy; +begin + DestroyItems; + inherited; +end; + +function TcxGridBandRowsViewInfo.GetBandRows: TcxGridBandRows; +begin + Result := FBandViewInfo.Band.Rows; +end; + +function TcxGridBandRowsViewInfo.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxGridBandRowsViewInfo.GetItem(Index: Integer): TcxGridBandRowViewInfo; +begin + Result := TcxGridBandRowViewInfo(FItems[Index]); +end; + +function TcxGridBandRowsViewInfo.GetMinWidth: Integer; +var + I, AMinWidth: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + begin + AMinWidth := Items[I].MinWidth; + if AMinWidth > Result then Result := AMinWidth; + end; +end; + +function TcxGridBandRowsViewInfo.GetWidth: Integer; +begin + {with Bounds do + Result := Right - Left;} + Result := FBandViewInfo.ContentWidth; +end; + +procedure TcxGridBandRowsViewInfo.CreateItems; +var + I: Integer; +begin + FItems := TList.Create; + for I := 0 to BandRows.VisibleCount - 1 do + FItems.Add(GetBandRowViewInfoClass.Create(Self, I)); +end; + +procedure TcxGridBandRowsViewInfo.DestroyItems; +var + I: Integer; +begin + for I := 0 to Count - 1 do Items[I].Free; + FItems.Free; +end; + +procedure TcxGridBandRowsViewInfo.AssignColumnWidths; +var + I: Integer; +begin + BandViewInfo.GridView.BeginUpdate; + try + for I := 0 to Count - 1 do + Items[I].AssignColumnWidths; + finally + BandViewInfo.GridView.EndUpdate; + end; +end; + +procedure TcxGridBandRowsViewInfo.Calculate(const ABounds: TRect); +var + ARowBounds: TRect; + I: Integer; +begin + Bounds := ABounds; + ARowBounds := Bounds; + for I := 0 to Count - 1 do + begin + ARowBounds.Bottom := ARowBounds.Top + Items[I].Height; + Items[I].Calculate(ARowBounds); + ARowBounds.Top := ARowBounds.Bottom; + end; +end; + +procedure TcxGridBandRowsViewInfo.CalculateColumnWidths; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].CalculateColumnWidths; +end; + +function TcxGridBandRowsViewInfo.CalculateWidth: Integer; +var + I, ARowWidth: Integer; +begin + if Count = 0 then + Result := cxGridDefaultEmptyBandWidth + else + begin + Result := 0; + for I := 0 to Count - 1 do + begin + ARowWidth := Items[I].CalculateWidth; + if ARowWidth > Result then Result := ARowWidth; + end; + end; +end; + +function TcxGridBandRowsViewInfo.GetBandRowViewInfoClass: TcxGridBandRowViewInfoClass; +begin + Result := TcxGridBandRowViewInfo; +end; + +{function TcxGridBandRowsViewInfo.GetColumnsHitTest(const P: TPoint): TcxCustomGridHitTest; +var + I, J: Integer; +begin + for I := 0 to Count - 1 do + for J := 0 to Items[I].ColumnViewInfoCount - 1 do + begin + Result := Items[I][J].GetHitTest(P); + if Result <> nil then Exit; + end; + Result := nil; +end;} + +function TcxGridBandRowsViewInfo.IndexAtPos(const P: TPoint): Integer; +var + R: TRect; +begin + R := Bounds; + if FBandViewInfo.GridView.Controller.IsItemMoving then + Inc(R.Bottom, ColumnHeaderInsertZoneSize); + if PtInRect(R, P) then + begin + for Result := 0 to Count - 1 do + if PtInRect(Items[Result].Bounds, P) then Exit; + Result := Count; + end + else + Result := -1; +end; + +procedure TcxGridBandRowsViewInfo.Offset(DX, DY: Integer); +var + I: Integer; +begin + OffsetRect(Bounds, DX, 0); + for I := 0 to Count - 1 do + Items[I].Offset(DX, DY); +end; + +{ TcxGridBandViewInfo } + +constructor TcxGridBandViewInfo.Create(ABandsViewInfo: TcxGridBandsViewInfo; AIndex: Integer); +begin + inherited Create; + FBandsViewInfo := ABandsViewInfo; + FColumnViewInfos := TList.Create; + FIndex := AIndex; + FBottomIndex := Band.VisibleBottomIndex; + FHeaderViewInfo := GetHeaderViewInfoClass.Create(Self); + if IsBottom then + begin + AddColumnViewInfos; + FRowsViewInfo := GetRowsViewInfoClass.Create(Self); + end; + FWidth := -1; +end; + +destructor TcxGridBandViewInfo.Destroy; +begin + FHeaderViewInfo.Free; + FRowsViewInfo.Free; + FColumnViewInfos.Free; + inherited; +end; + +function TcxGridBandViewInfo.GetBand: TcxGridBand; +begin + Result := GridView.Bands.VisibleItems[FIndex]; +end; + +function TcxGridBandViewInfo.GetBoundsForBandInsert: TRect; +begin + Result := FHeaderViewInfo.Bounds; + if Band.IsMostRight then + Result.Right := GridViewInfo.ClientBounds.Right; + if IsRoot then + Dec(Result.Top, BandHeaderMovingZoneSize); + if IsBottom then + Inc(Result.Bottom, BandHeaderMovingZoneSize); +end; + +function TcxGridBandViewInfo.GetChildBandViewInfo(Index: Integer): TcxGridBandViewInfo; +begin + Result := FBandsViewInfo[Band.VisibleChildBands[Index].VisibleIndex]; +end; + +function TcxGridBandViewInfo.GetChildBandViewInfoCount: Integer; +begin + Result := Band.VisibleChildBandCount; +end; + +function TcxGridBandViewInfo.GetColumnViewInfo(Index: Integer): TcxGridBandedColumnHeaderViewInfo; +begin + Result := TcxGridBandedColumnHeaderViewInfo(FColumnViewInfos[Index]); +end; + +function TcxGridBandViewInfo.GetColumnViewInfoCount: Integer; +begin + Result := FColumnViewInfos.Count; +end; + +function TcxGridBandViewInfo.GetContainerViewInfo: TcxGridBandedHeaderViewInfo; +begin + Result := FBandsViewInfo.ContainerViewInfo; +end; + +function TcxGridBandViewInfo.GetFixedKind: TcxGridBandFixedKind; +begin + Result := Band.FixedKind; +end; + +function TcxGridBandViewInfo.GetGridView: TcxGridBandedTableView; +begin + Result := FBandsViewInfo.GridView; +end; + +function TcxGridBandViewInfo.GetGridViewInfo: TcxGridBandedTableViewInfo; +begin + Result := ContainerViewInfo.GridViewInfo; +end; + +function TcxGridBandViewInfo.GetIsBottom: Boolean; +begin + Result := Band.IsVisibleBottom; +end; + +function TcxGridBandViewInfo.GetIsFixed: Boolean; +begin + Result := Band.Fixed; +end; + +function TcxGridBandViewInfo.GetIsRight: Boolean; +begin + Result := FBottomIndex = FBandsViewInfo.BottomItemCount - 1; +end; + +function TcxGridBandViewInfo.GetIsRoot: Boolean; +begin + Result := Band.IsRoot; +end; + +function TcxGridBandViewInfo.GetParentBandViewInfo: TcxGridBandViewInfo; +begin + Result := BandsViewInfo[Band.ParentBand.VisibleIndex]; +end; + +function TcxGridBandViewInfo.GetRowCount: Integer; +begin + Result := FRowsViewInfo.Count; +end; + +function TcxGridBandViewInfo.GetSameLevelAutoWidth: Integer; +begin + if IsRoot then + Result := GridViewInfo.ClientWidth + else + if ParentBandViewInfo.Band.Width = 0 then + Result := ParentBandViewInfo.MaxWidth + else + Result := ParentBandViewInfo.Width; +end; + +function TcxGridBandViewInfo.GetSameLevelItem(Index: Integer): TcxGridBandViewInfo; +begin + if IsRoot then + Result := BandsViewInfo.RootItems[Index] + else + Result := ParentBandViewInfo.ChildBandViewInfos[Index]; +end; + +function TcxGridBandViewInfo.GetSameLevelItemCount: Integer; +begin + if IsRoot then + Result := BandsViewInfo.RootItemCount + else + Result := ParentBandViewInfo.ChildBandViewInfoCount; +end; + +function CompareColumnViewInfos( + Item1, Item2: Pointer): Integer; +begin + Result := CompareVisibleColumnPositions( + TcxGridBandedColumnHeaderViewInfo(Item1).Column.Position, + TcxGridBandedColumnHeaderViewInfo(Item2).Column.Position); +end; + +procedure TcxGridBandViewInfo.AddColumnViewInfos; +var + I: Integer; + AColumnHeaderViewInfo: TcxGridBandedColumnHeaderViewInfo; +begin + for I := 0 to ContainerViewInfo.Count - 1 do + begin + AColumnHeaderViewInfo := ContainerViewInfo[I]; + if AColumnHeaderViewInfo.Column.Position.Band = Band then + FColumnViewInfos.Add(AColumnHeaderViewInfo); + end; + FColumnViewInfos.Sort(CompareColumnViewInfos); +end; + +procedure TcxGridBandViewInfo.AssignChildBandWidths; +var + I: Integer; +begin + GridView.BeginUpdate; + try + for I := 0 to ChildBandViewInfoCount - 1 do + with ChildBandViewInfos[I] do + Band.Width := ContentWidth; + finally + GridView.EndUpdate; + end; +end; + +procedure TcxGridBandViewInfo.AssignColumnWidths; +var + I: Integer; +begin + if IsBottom then + FRowsViewInfo.AssignColumnWidths + else + begin + GridView.BeginUpdate; + try + for I := 0 to ChildBandViewInfoCount - 1 do + ChildBandViewInfos[I].AssignColumnWidths; + finally + GridView.EndUpdate; + end; + end; +end; + +procedure TcxGridBandViewInfo.CalculateChildBandWidths; +var + AAutoWidthObject: TcxAutoWidthObject; + I: Integer; +begin + AAutoWidthObject := TcxAutoWidthObject.Create(ChildBandViewInfoCount); + try + for I := 0 to ChildBandViewInfoCount - 1 do + ChildBandViewInfos[I].InitAutoWidthItem(AAutoWidthObject.AddItem); + AAutoWidthObject.AvailableWidth := Width; + AAutoWidthObject.Calculate; + for I := 0 to ChildBandViewInfoCount - 1 do + ChildBandViewInfos[I].Width := AAutoWidthObject[I].AutoWidth; + finally + AAutoWidthObject.Free; + end; +end; + +procedure TcxGridBandViewInfo.CalculateChildBands(R: TRect); +var + I: Integer; + AChildBandViewInfo: TcxGridBandViewInfo; +begin + CalculateChildBandWidths; + for I := 0 to ChildBandViewInfoCount - 1 do + begin + AChildBandViewInfo := ChildBandViewInfos[I]; + R.Right := R.Left + AChildBandViewInfo.Width; + AChildBandViewInfo.Calculate(R); + R.Left := R.Right; + end; +end; + +function TcxGridBandViewInfo.CalculateChildBandsBounds: TRect; +begin + Result := Bounds; + Result.Top := CalculateHeaderBounds.Bottom; +end; + +function TcxGridBandViewInfo.CalculateColumnsBounds: TRect; +begin + Result := ContentBounds; + Result.Top := CalculateHeaderBounds.Bottom; +end; + +procedure TcxGridBandViewInfo.CalculateColumnWidths; +begin + FRowsViewInfo.CalculateColumnWidths; +end; + +function TcxGridBandViewInfo.CalculateHeaderBounds: TRect; +begin + Result := ContentBounds; + Result.Bottom := Result.Top + HeaderViewInfo.Height; +end; + +function TcxGridBandViewInfo.CalculateHeight: Integer; +begin + Result := 0; +end; + +function TcxGridBandViewInfo.CalculateWidth: Integer; +var + AMinWidth: Integer; + + function CalculateChildBandsWidth: Integer; + var + I: Integer; + begin + Result := 0; + for I := 0 to ChildBandViewInfoCount - 1 do + Inc(Result, ChildBandViewInfos[I].CalculateWidth); + end; + +begin + if FWidth = -1 then + begin + FWidth := Band.Width; + CalculateParams; + if FWidth = 0 then + if IsBottom then + FWidth := BorderSize[bLeft] + FRowsViewInfo.CalculateWidth + BorderSize[bRight] + else + FWidth := CalculateChildBandsWidth + else + Inc(FWidth, BorderSize[bLeft] + BorderSize[bRight]); + AMinWidth := MinWidth; + if FWidth < AMinWidth then FWidth := AMinWidth; + end; + Result := FWidth; +end; + +function TcxGridBandViewInfo.CanSize: Boolean; +begin + Result := Band.CanSize; +end; + +procedure TcxGridBandViewInfo.CheckWidth(var Value: Integer); +begin + if Value < MinContentWidth then Value := MinContentWidth; + if Value > MaxContentWidth then Value := MaxContentWidth; +end; + +function TcxGridBandViewInfo.CustomDrawBackground(ACanvas: TcxCanvas): Boolean; +begin + Result := inherited CustomDrawBackground(ACanvas); + GridView.DoCustomDrawPartBackground(ACanvas, Self, Result); +end; + +function TcxGridBandViewInfo.GetAreAllColumnsFixed: Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to ColumnViewInfoCount - 1 do + begin + Result := ColumnViewInfos[I].IsFixed; + if not Result then Exit; + end; +end; + +function TcxGridBandViewInfo.GetBackgroundBitmap: TBitmap; +begin + Result := BandsViewInfo.BandBackgroundBitmap; +end; + +function TcxGridBandViewInfo.GetBorderColor(AIndex: TcxBorder): TColor; +begin + Result := GridViewInfo.FixedBandSeparatorColor; +end; + +function TcxGridBandViewInfo.GetBorders: TcxBorders; +begin + Result := []; + if (FixedKind <> fkNone) and + (BandsViewInfo.LastFixedItems[FixedKind, Band.BandLevelIndex] = Self) then + case FixedKind of + fkLeft: + Include(Result, bRight); + fkRight: + Include(Result, bLeft); + end; +end; + +function TcxGridBandViewInfo.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := GridViewInfo.FixedBandSeparatorWidth; +end; + +function TcxGridBandViewInfo.GetCanvas: TcxCanvas; +begin + Result := ContainerViewInfo.Canvas; +end; + +function TcxGridBandViewInfo.GetContentWidth: Integer; +begin + //CalculateParams; + Result := Width - (BorderSize[bLeft] + BorderSize[bRight]); +end; + +class function TcxGridBandViewInfo.GetHeaderViewInfoClass: TcxGridBandHeaderViewInfoClass; +begin + Result := TcxGridBandHeaderViewInfo; +end; + +function TcxGridBandViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridBandHitTest; +end; + +function TcxGridBandViewInfo.GetMaxContentWidth: Integer; +begin + CalculateParams; + Result := MaxWidth - (BorderSize[bLeft] + BorderSize[bRight]); +end; + +function TcxGridBandViewInfo.GetMaxWidth: Integer; +var + AIndex, I: Integer; +begin + if GridView.OptionsView.ColumnAutoWidth or Band.HasParentWithAssignedWidth then + begin + Result := SameLevelAutoWidth; + AIndex := Band.Position.VisibleColIndex; + if Band.IsLastAsChild then + for I := 0 to AIndex - 1 do + Dec(Result, SameLevelItems[I].MinWidth) + else + for I := 0 to SameLevelItemCount - 1 do + begin + if I < AIndex then + Dec(Result, SameLevelItems[I].Width); + if I > AIndex then + Dec(Result, SameLevelItems[I].MinWidth); + end; + if Result < MinWidth then Result := MinWidth; + end + else + Result := MaxInt; +end; + +function TcxGridBandViewInfo.GetMinContentWidth: Integer; +var + I: Integer; +begin + if IsBottom then + begin + CalculateParams; + Result := FRowsViewInfo.MinWidth; + if Band.IsFirst then + Result := Max(Result, GridViewInfo.FirstItemAdditionalWidth); + end + else + begin + Result := 0; + for I := 0 to ChildBandViewInfoCount - 1 do + Inc(Result, ChildBandViewInfos[I].MinContentWidth); + end; + if Result < Band.MinWidth then Result := Band.MinWidth; +end; + +function TcxGridBandViewInfo.GetMinWidth: Integer; +begin + CalculateParams; + Result := MinContentWidth + (BorderSize[bLeft] + BorderSize[bRight]); +end; + +function TcxGridBandViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridBandPainter; +end; + +function TcxGridBandViewInfo.GetRowsViewInfoClass: TcxGridBandRowsViewInfoClass; +begin + Result := TcxGridBandRowsViewInfo; +end; + +procedure TcxGridBandViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + Band.Styles.GetViewParams(bsBackground, Band, nil, AParams); +end; + +function TcxGridBandViewInfo.GetWidth: Integer; +begin + if FWidth = -1 then + Result := CalculateWidth + else + Result := FWidth; +end; + +procedure TcxGridBandViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + inherited; + with AHitTest as TcxGridBandHitTest do + begin + GridView := Self.GridView; + Band := Self.Band; + BandContainerKind := bcHeader; + VisibleRowIndex := -1; + end; +end; + +procedure TcxGridBandViewInfo.Offset(DX, DY: Integer); +begin + inherited; + FHeaderViewInfo.DoOffset(DX, DY); + if IsBottom then + FRowsViewInfo.Offset(DX, DY); +end; + +procedure TcxGridBandViewInfo.SetWidth(Value: Integer); +begin + inherited; + FWidth := Value; +end; + +procedure TcxGridBandViewInfo.Calculate(const ABounds: TRect); +begin + inherited; + FHeaderViewInfo.Calculate(CalculateHeaderBounds); + if IsBottom then + FRowsViewInfo.Calculate(CalculateColumnsBounds) + else + CalculateChildBands(CalculateChildBandsBounds); +end; + +function TcxGridBandViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +var + I, ARowIndex: Integer; +begin + Result := FHeaderViewInfo.GetHitTest(P); + if Result = nil then + if IsBottom then + begin + if BandsViewInfo.ShowColumnHeaders then + for I := 0 to ColumnViewInfoCount - 1 do + begin + Result := ColumnViewInfos[I].GetHitTest(P); + if Result <> nil then Exit; + end; + Result := inherited GetHitTest(P); + ARowIndex := FRowsViewInfo.IndexAtPos(P); + if ARowIndex <> -1 then + begin + if Result = nil then + begin + Result := GetHitTestClass.Instance(P); + InitHitTest(Result); + end; + TcxGridBandHitTest(Result).VisibleRowIndex := ARowIndex; + end; + end + else + for I := 0 to ChildBandViewInfoCount - 1 do + begin + Result := ChildBandViewInfos[I].GetHitTest(P); + if Result <> nil then Break; + end; +end; + +procedure TcxGridBandViewInfo.InitAutoWidthItem(AAutoWidthItem: TcxAutoWidthItem); +begin + AAutoWidthItem.MinWidth := MinWidth; + AAutoWidthItem.Width := CalculateWidth; + AAutoWidthItem.Fixed := IsFixed; +end; + +function TcxGridBandViewInfo.InsertPositionAtPos(const P: TPoint; + out ABand: TcxGridBand; out AInsertPosition: TcxPosition): Boolean; +var + I: Integer; +begin + Result := PtInRect(BoundsForBandInsert, P); + if Result then + begin + ABand := Band; + AInsertPosition := GetPointPosition(FHeaderViewInfo.Bounds, P, + True, GridView.OptionsCustomize.NestedBands); + end + else + if GridView.OptionsCustomize.NestedBands and not IsBottom then + for I := 0 to ChildBandViewInfoCount - 1 do + begin + Result := ChildBandViewInfos[I].InsertPositionAtPos(P, ABand, AInsertPosition); + if Result then Break; + end; +end; + +{ TcxGridBandsViewInfo } + +constructor TcxGridBandsViewInfo.Create(AContainerViewInfo: TcxGridBandedHeaderViewInfo); +begin + inherited Create; + FContainerViewInfo := AContainerViewInfo; + FBandHeadersAreaHeight := -1; + FLineCount := -1; + FRowCount := -1; + FBandHeaderRowHeights := TList.Create; + CreateItems; +end; + +destructor TcxGridBandsViewInfo.Destroy; +begin + DestroyItems; + FBandHeaderRowHeights.Free; + inherited; +end; + +function TcxGridBandsViewInfo.GetBandHeaderRowCount: Integer; +begin + Result := FBandHeaderRowHeights.Count; +end; + +function TcxGridBandsViewInfo.GetBandHeaderRowHeight(Index: Integer): Integer; +var + APrevCount, I: Integer; +begin + if Index >= FBandHeaderRowHeights.Count then + begin + APrevCount := FBandHeaderRowHeights.Count; + FBandHeaderRowHeights.Count := Index + 1; + for I := APrevCount to Index do + BandHeaderRowHeights[I] := 0; + end; + Result := Integer(FBandHeaderRowHeights[Index]); +end; + +function TcxGridBandsViewInfo.GetBandHeadersAreaHeight: Integer; +begin + if FBandHeadersAreaHeight = -1 then + if ShowBandHeaders then + FBandHeadersAreaHeight := CalculateBandHeadersAreaHeight + else + FBandHeadersAreaHeight := 0; + Result := FBandHeadersAreaHeight; +end; + +function TcxGridBandsViewInfo.GetBands: TcxGridBands; +begin + Result := GridView.Bands; +end; + +function TcxGridBandsViewInfo.GetBottomItem(Index: Integer): TcxGridBandViewInfo; +begin + Result := Items[GridView.Bands.VisibleBottomItems[Index].VisibleIndex]; +end; + +function TcxGridBandsViewInfo.GetBottomItemCount: Integer; +begin + Result := GridView.Bands.VisibleBottomItemCount; +end; + +function TcxGridBandsViewInfo.GetColumnHeadersAreaHeight: Integer; +begin + if ShowColumnHeaders then + Result := FContainerViewInfo.Specific.Height + else + Result := 0; +end; + +function TcxGridBandsViewInfo.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxGridBandsViewInfo.GetGridView: TcxGridBandedTableView; +begin + Result := FContainerViewInfo.GridView; +end; + +function TcxGridBandsViewInfo.GetGridViewInfo: TcxGridBandedTableViewInfo; +begin + Result := FContainerViewInfo.GridViewInfo; +end; + +function TcxGridBandsViewInfo.GetInternalItem(Index: Integer): TcxGridBandViewInfo; +begin + Result := TcxGridBandViewInfo(FItems[Index]); +end; + +function TcxGridBandsViewInfo.GetItem(Index: Integer): TcxGridBandViewInfo; +begin + Result := InternalItems[Index]; + if Result = nil then + begin + Result := GetItemClass.Create(Self, Index); + FItems[Index] := Result; + end; +end; + +function TcxGridBandsViewInfo.GetLastFixedItem(AFixedKind: TcxGridBandFixedKind; + ALevelIndex: Integer): TcxGridBandViewInfo; + + function GetLastLeftFixedItem: TcxGridBandViewInfo; + begin + Result := RootItems[Bands.VisibleRootLeftFixedCount - 1]; + while Result.Band.BandLevelIndex <> ALevelIndex do + if Result.IsBottom then + begin + Result := nil; + Break; + end + else + Result := Result.ChildBandViewInfos[Result.ChildBandViewInfoCount - 1]; + end; + + function GetFirstRightFixedItem: TcxGridBandViewInfo; + begin + Result := RootItems[RootItemCount - Bands.VisibleRootRightFixedCount]; + while Result.Band.BandLevelIndex <> ALevelIndex do + if Result.IsBottom then + begin + Result := nil; + Break; + end + else + Result := Result.ChildBandViewInfos[0]; + end; + +begin + Result := nil; + case AFixedKind of + fkLeft: + if Bands.VisibleLeftFixedCount <> 0 then + Result := GetLastLeftFixedItem; + fkRight: + if Bands.VisibleRightFixedCount <> 0 then + Result := GetFirstRightFixedItem; + end; +end; + +function TcxGridBandsViewInfo.GetLineCount: Integer; +begin + if FLineCount = -1 then + FLineCount := Bands.LineCount; + Result := FLineCount; +end; + +function TcxGridBandsViewInfo.GetRootItem(Index: Integer): TcxGridBandViewInfo; +begin + Result := Items[GridView.Bands.VisibleRootItems[Index].VisibleIndex]; +end; + +function TcxGridBandsViewInfo.GetRootItemCount: Integer; +begin + Result := GridView.Bands.VisibleRootItemCount; +end; + +function TcxGridBandsViewInfo.GetRowCount: Integer; +begin + if FRowCount = -1 then + FRowCount := Bands.VisibleRowCount; + Result := FRowCount; +end; + +procedure TcxGridBandsViewInfo.SetBandHeaderRowHeight(Index: Integer; Value: Integer); +begin + FBandHeaderRowHeights[Index] := Pointer(Value); +end; + +procedure TcxGridBandsViewInfo.CreateItems; +begin + FItems := TList.Create; + FItems.Count := GridView.Bands.VisibleCount; +end; + +procedure TcxGridBandsViewInfo.DestroyItems; +var + I: Integer; +begin + for I := 0 to Count - 1 do + InternalItems[I].Free; + FItems.Free; +end; + +function TcxGridBandsViewInfo.AddIndicatorItems(AIndicatorViewInfo: TcxGridIndicatorViewInfo; + ATopBound: Integer): Boolean; +begin + Result := AIndicatorViewInfo.AlwaysVisible; + if not Result then Exit; + if ShowBandHeaders then + begin + AIndicatorViewInfo.AddItem(ATopBound, BandHeadersAreaHeight, TcxGridIndicatorBandHeaderItemViewInfo); + Inc(ATopBound, BandHeadersAreaHeight); + end; + if ShowColumnHeaders then + AIndicatorViewInfo.AddItem(ATopBound, ColumnHeadersAreaHeight, TcxGridIndicatorHeaderItemViewInfo); +end; + +procedure TcxGridBandsViewInfo.Calculate; +var + AScrollableAreaBounds, ABounds: TRect; + + procedure ProcessLeftFixedItems; + var + I: Integer; + AItem: TcxGridBandViewInfo; + begin + ABounds := ContainerViewInfo.Bounds; + for I := 0 to RootItemCount - 1 do + begin + AItem := RootItems[I]; + if AItem.FixedKind = fkLeft then + begin + ABounds.Right := ABounds.Left + AItem.Width; + AItem.Calculate(ABounds); + ABounds.Left := ABounds.Right; + end; + end; + AScrollableAreaBounds.Left := ABounds.Left; + end; + + procedure ProcessRightFixedItems; + var + I: Integer; + AItem: TcxGridBandViewInfo; + begin + ABounds := ContainerViewInfo.Bounds; + for I := RootItemCount - 1 downto 0 do + begin + AItem := RootItems[I]; + if AItem.FixedKind = fkRight then + begin + ABounds.Left := ABounds.Right - AItem.Width; + AItem.Calculate(ABounds); + ABounds.Right := ABounds.Left; + end; + end; + AScrollableAreaBounds.Right := ABounds.Right; + end; + + procedure ProcessNonFixedItems; + var + I: Integer; + AItem: TcxGridBandViewInfo; + begin + ABounds := AScrollableAreaBounds; + if not FContainerViewInfo.IsScrollable then + Dec(ABounds.Left, GridViewInfo.LeftPos); + for I := 0 to RootItemCount - 1 do + begin + AItem := RootItems[I]; + if AItem.FixedKind = fkNone then + begin + ABounds.Right := ABounds.Left + AItem.Width; + AItem.Calculate(ABounds); + ABounds.Left := ABounds.Right; + end; + end; + end; + +begin + AScrollableAreaBounds := ContainerViewInfo.Bounds; + ProcessLeftFixedItems; + ProcessRightFixedItems; + ProcessNonFixedItems; +end; + +function TcxGridBandsViewInfo.CalculateBandHeaderHeight(ABandHeaderViewInfo: TcxGridBandHeaderViewInfo): Integer; + + function GetBaseBandHeaderHeight: Integer; + var + AParams: TcxViewParams; + begin + if ABandHeaderViewInfo = nil then + begin + GridView.Styles.GetBandHeaderParams(nil, AParams); + Result := GetItemClass.GetHeaderViewInfoClass.GetCellHeight( + GridViewInfo.GetFontHeight(AParams.Font), FContainerViewInfo.LookAndFeelPainter); + end + else + Result := ABandHeaderViewInfo.GetTextCellHeight(GridViewInfo, + FContainerViewInfo.LookAndFeelPainter); + end; + +begin + if IsBandHeaderHeightAssigned then + Result := GridView.OptionsView.BandHeaderHeight + else + Result := GetBaseBandHeaderHeight * GridView.OptionsView.BandHeaderLineCount; +end; + +procedure TcxGridBandsViewInfo.CalculateBandHeaderRowHeights; +var + I, ABandHeaderHeight, ABandLevelIndex: Integer; +begin + if BandHeaderRowCount <> 0 then Exit; + for I := 0 to Count - 1 do + begin + ABandHeaderHeight := Items[I].HeaderViewInfo.CalculateHeight; + ABandLevelIndex := Items[I].Band.BandLevelIndex; + if BandHeaderRowHeights[ABandLevelIndex] < ABandHeaderHeight then + BandHeaderRowHeights[ABandLevelIndex] := ABandHeaderHeight; + end; +end; + +function TcxGridBandsViewInfo.CalculateBandHeadersAreaHeight: Integer; +var + I: Integer; +begin + CalculateBandHeaderRowHeights; + Result := 0; + for I := 0 to BandHeaderRowCount - 1 do + Inc(Result, BandHeaderRowHeights[I]); + if Result = 0 then + Result := CalculateBandHeaderHeight(nil); +end; + +procedure TcxGridBandsViewInfo.CalculateColumnWidths; +var + I: Integer; +begin + for I := 0 to BottomItemCount - 1 do + BottomItems[I].CalculateColumnWidths; +end; + +function TcxGridBandsViewInfo.CalculateHeight: Integer; +begin + Result := BandHeadersAreaHeight + ColumnHeadersAreaHeight; +end; + +function TcxGridBandsViewInfo.CalculateWidth: Integer; +var + I: Integer; +begin + Result := 0; + if not GridView.IsLoading {Count <> 0} then + for I := 0 to RootItemCount - 1 do + Inc(Result, RootItems[I].CalculateWidth); +end; + +function TcxGridBandsViewInfo.DrawBandHeaderBackgroundHandler(ACanvas: TcxCanvas; + const ABounds: TRect): Boolean; +begin + Result := BandHeaderBackgroundBitmap <> nil; + if Result then + ACanvas.FillRect(ABounds, BandHeaderBackgroundBitmap); +end; + +function TcxGridBandsViewInfo.GetBandBackgroundBitmap: TBitmap; +begin + Result := GridView.BackgroundBitmaps.GetBitmap(bbBandBackground); +end; + +function TcxGridBandsViewInfo.GetBandHeaderBackgroundBitmap: TBitmap; +begin + Result := GridView.BackgroundBitmaps.GetBitmap(bbBandHeader); +end; + +function TcxGridBandsViewInfo.GetItemClass: TcxGridBandViewInfoClass; +begin + Result := TcxGridBandViewInfo; +end; + +function TcxGridBandsViewInfo.IsBandHeaderHeightAssigned: Boolean; +begin + Result := GridView.OptionsView.BandHeaderHeight <> 0; +end; + +function TcxGridBandsViewInfo.ShowBandHeaders: Boolean; +begin + Result := GridView.OptionsView.BandHeaders; +end; + +function TcxGridBandsViewInfo.ShowColumnHeaders: Boolean; +begin + Result := GridView.OptionsView.Header; +end; + +procedure TcxGridBandsViewInfo.AssignRootItemWidths; +var + I: Integer; +begin + GridView.BeginUpdate; + try + for I := 0 to RootItemCount - 1 do + with RootItems[I] do + Band.Width := ContentWidth; + finally + GridView.EndUpdate; + end; +end; + +{function TcxGridBandsViewInfo.GetColumnsHitTest(const P: TPoint): TcxCustomGridHitTest; +var + I: Integer; +begin + for I := 0 to BottomItemCount - 1 do + begin + Result := BottomItems[I].RowsViewInfo.GetColumnsHitTest(P); + if Result <> nil then Exit; + end; + Result := nil; +end;} + +function TcxGridBandsViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; + + procedure ProcessItems(AFixedKind: TcxGridBandFixedKind); + var + I: Integer; + begin + if Result = nil then + for I := 0 to RootItemCount - 1 do + if RootItems[I].FixedKind = AFixedKind then + begin + Result := RootItems[I].GetHitTest(P); + if Result <> nil then Break; + end; + end; + +begin + Result := nil; + ProcessItems(fkLeft); + ProcessItems(fkRight); + ProcessItems(fkNone); +end; + +function TcxGridBandsViewInfo.GetItemAreaBounds(ABand: TcxGridBand): TRect; +begin + Result := GridViewInfo.ScrollableAreaBoundsHorz; + if ABand.FixedKind <> fkNone then + with Items[ABand.VisibleIndex].Bounds do + begin + Result.Left := Left; + Result.Right := Right; + end; +end; + +procedure TcxGridBandsViewInfo.InsertPositionAtPos(const P: TPoint; + out ABand: TcxGridBand; out AInsertPosition: TcxPosition); +var + I: Integer; +begin + ABand := nil; + AInsertPosition := posLeft; + for I := 0 to RootItemCount - 1 do + if RootItems[I].InsertPositionAtPos(P, ABand, AInsertPosition) then Break; +end; + +procedure TcxGridBandsViewInfo.Offset(DX, DY: Integer); +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].DoOffset(DX, DY); +end; + +{ TcxGridBandedHeaderViewInfoSpecific } + +function TcxGridBandedHeaderViewInfoSpecific.GetGridViewInfo: TcxGridBandedTableViewInfo; +begin + Result := TcxGridBandedTableViewInfo(inherited GridViewInfo); +end; + +function TcxGridBandedHeaderViewInfoSpecific.CalculateHeight: Integer; +begin + Result := Max(1, GridViewInfo.HeaderViewInfo.LineCount) * ItemHeight; +end; + +{ TcxGridBandedHeaderViewInfo } + +constructor TcxGridBandedHeaderViewInfo.Create(AGridViewInfo: TcxCustomGridTableViewInfo); +begin + inherited; + FBandsViewInfo := GetBandsViewInfoClass.Create(Self); +end; + +destructor TcxGridBandedHeaderViewInfo.Destroy; +begin + FBandsViewInfo.Free; + inherited; +end; + +function TcxGridBandedHeaderViewInfo.GetGridView: TcxGridBandedTableView; +begin + Result := TcxGridBandedTableView(inherited GridView); +end; + +function TcxGridBandedHeaderViewInfo.GetGridViewInfo: TcxGridBandedTableViewInfo; +begin + Result := TcxGridBandedTableViewInfo(inherited GridViewInfo); +end; + +function TcxGridBandedHeaderViewInfo.GetItem(Index: Integer): TcxGridBandedColumnHeaderViewInfo; +begin + Result := TcxGridBandedColumnHeaderViewInfo(inherited Items[Index]); +end; + +function TcxGridBandedHeaderViewInfo.GetLineCount: Integer; +begin + Result := FBandsViewInfo.LineCount; +end; + +function TcxGridBandedHeaderViewInfo.GetRowCount: Integer; +begin + Result := FBandsViewInfo.RowCount; +end; + +function TcxGridBandedHeaderViewInfo.GetSpecific: TcxGridBandedHeaderViewInfoSpecific; +begin + Result := TcxGridBandedHeaderViewInfoSpecific(inherited Specific); +end; + +procedure TcxGridBandedHeaderViewInfo.AddIndicatorItems(AIndicatorViewInfo: TcxGridIndicatorViewInfo; + ATopBound: Integer); +begin + if not FBandsViewInfo.AddIndicatorItems(AIndicatorViewInfo, ATopBound) then + inherited; +end; + +procedure TcxGridBandedHeaderViewInfo.CalculateColumnAutoWidths; +var + AAutoWidthObject: TcxAutoWidthObject; + I: Integer; +begin + AAutoWidthObject := TcxAutoWidthObject.Create(FBandsViewInfo.Count); + try + for I := 0 to FBandsViewInfo.RootItemCount - 1 do + FBandsViewInfo.RootItems[I].InitAutoWidthItem(AAutoWidthObject.AddItem); + AAutoWidthObject.AvailableWidth := GridViewInfo.ClientWidth; + AAutoWidthObject.Calculate; + for I := 0 to FBandsViewInfo.RootItemCount - 1 do + FBandsViewInfo.RootItems[I].Width := AAutoWidthObject[I].AutoWidth; + finally + AAutoWidthObject.Free; + end; +end; + +procedure TcxGridBandedHeaderViewInfo.CalculateColumnWidths; +begin + inherited; + FBandsViewInfo.CalculateColumnWidths; +end; + +function TcxGridBandedHeaderViewInfo.CalculateHeight: Integer; +begin + Result := FBandsViewInfo.CalculateHeight; +end; + +procedure TcxGridBandedHeaderViewInfo.CalculateItems; +begin + FBandsViewInfo.Calculate; +end; + +function TcxGridBandedHeaderViewInfo.GetBandsViewInfoClass: TcxGridBandsViewInfoClass; +begin + Result := TcxGridBandsViewInfo; +end; + +function TcxGridBandedHeaderViewInfo.GetColumnNeighbors(AColumn: TcxGridColumn): TcxNeighbors; +begin + Result := inherited GetColumnNeighbors(AColumn); + if not AColumn.IsTop then Include(Result, nTop); + if not AColumn.IsBottom then Include(Result, nBottom); +end; + +function TcxGridBandedHeaderViewInfo.GetIsScrollable: Boolean; +begin + Result := FBandsViewInfo.Bands.Layout in [blNonFixed, blRightFixed]; +end; + +function TcxGridBandedHeaderViewInfo.GetItemAreaBounds(AItem: TcxGridColumnHeaderViewInfo): TRect; +begin + Result := FBandsViewInfo.GetItemAreaBounds(TcxGridBandedColumn(AItem.Column).Position.Band); +end; + +function TcxGridBandedHeaderViewInfo.GetItemClass: TcxGridColumnHeaderViewInfoClass; +begin + Result := TcxGridBandedColumnHeaderViewInfo; +end; + +function TcxGridBandedHeaderViewInfo.GetItemMultiLinePainting(AItem: TcxGridColumnHeaderViewInfo): Boolean; +begin + Result := inherited GetItemMultiLinePainting(AItem) or + (TcxGridBandedColumn(AItem.Column).Position.LineCount > 1); +end; + +function TcxGridBandedHeaderViewInfo.GetItemsAreaBounds: TRect; +begin + Result := inherited GetItemsAreaBounds; + Inc(Result.Top, FBandsViewInfo.BandHeadersAreaHeight); +end; + +function TcxGridBandedHeaderViewInfo.GetItemsHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + Result := nil; +end; + +function TcxGridBandedHeaderViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridBandedHeaderPainter; +end; + +function TcxGridBandedHeaderViewInfo.GetVisible: Boolean; +begin + with FBandsViewInfo do + Result := ShowBandHeaders or ShowColumnHeaders; +end; + +function TcxGridBandedHeaderViewInfo.GetWidth: Integer; +begin + Result := FBandsViewInfo.CalculateWidth; +end; + +function TcxGridBandedHeaderViewInfo.IsHeightAssigned: Boolean; +begin + Result := inherited IsHeightAssigned and (LineCount <= 1); +end; + +procedure TcxGridBandedHeaderViewInfo.Offset(DX, DY: Integer); +begin + inherited; + FBandsViewInfo.Offset(DX, 0); +end; + +function TcxGridBandedHeaderViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + Result := FBandsViewInfo.GetHitTest(P); + if Result = nil then + Result := inherited GetHitTest(P); +end; + +function TcxGridBandedHeaderViewInfo.GetZone(const P: TPoint): TcxGridItemContainerZone; +var + AHitTest: TcxCustomGridHitTest; + AColumn: TcxGridBandedColumn; + ABounds: TRect; + ABand: TcxGridBand; + ARowIndex: Integer; +begin + Result := nil; + AHitTest := GridViewInfo.GetHitTest(P); + if GridViewInfo.Controller.CanHandleHitTest(AHitTest) then + if AHitTest is TcxCustomGridColumnHitTest then + begin + AColumn := TcxGridBandedColumn(TcxCustomGridColumnHitTest(AHitTest).Column); + ABounds := Items[AColumn.VisibleIndex].Bounds; + with AColumn.Position do + Result := TcxGridBandedColumnContainerZone.Create(AColumn.VisibleIndex, Band, + VisibleColIndex + Ord(P.X >= (ABounds.Left + ABounds.Right) div 2), VisibleRowIndex); + end + else + if AHitTest is TcxGridBandHitTest then + begin + with TcxGridBandHitTest(AHitTest) do + begin + ABand := Band; + ARowIndex := VisibleRowIndex; + end; + if ARowIndex <> -1 then + begin + if ARowIndex <> ABand.Rows.VisibleCount then + Inc(ARowIndex); + Result := TcxGridBandedColumnContainerZone.Create(-1, ABand, 0, ARowIndex); + end; + end; +end; + +{ TcxGridBandedFooterViewInfo } + +function TcxGridBandedFooterViewInfo.GetItemMultiLinePainting(AItem: TcxGridColumnHeaderViewInfo): Boolean; +begin + Result := inherited GetItemMultiLinePainting(AItem) or + (TcxGridBandedColumn(AItem.Column).Position.LineCount > 1); +end; + +function CompareSummaryItems(Item1, Item2: Pointer): Integer; +var + ASummaryItem1, ASummaryItem2: TcxDataSummaryItem; +begin + ASummaryItem1 := TcxDataSummaryItem(Item1); + ASummaryItem2 := TcxDataSummaryItem(Item2); + Result := TcxGridColumn(ASummaryItem1.ItemLink).VisibleIndex - + TcxGridColumn(ASummaryItem2.ItemLink).VisibleIndex; + if Result = 0 then + Result := ASummaryItem1.Index - ASummaryItem2.Index; +end; + +procedure TcxGridBandedFooterViewInfo.PrepareSummaryItems(ASummaryItems: TList); +begin + inherited; + ASummaryItems.Sort(CompareSummaryItems); +end; + +{ TcxGridIndicatorBandHeaderItemViewInfo } + +function TcxGridIndicatorBandHeaderItemViewInfo.GetGridView: TcxGridBandedTableView; +begin + Result := TcxGridBandedTableView(inherited GridView); +end; + +function TcxGridIndicatorBandHeaderItemViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridIndicatorBandHeaderHitTest; +end; + +function TcxGridIndicatorBandHeaderItemViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridIndicatorBandHeaderItemPainter; +end; + +function TcxGridIndicatorBandHeaderItemViewInfo.GetText: string; +begin + Result := cxGetResourceString(@scxGridBandsQuickCustomizationHint); +end; + +procedure TcxGridIndicatorBandHeaderItemViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetBandHeaderParams(nil, AParams); +end; + +function TcxGridIndicatorBandHeaderItemViewInfo.SupportsQuickCustomization: Boolean; +begin + Result := GridView.OptionsCustomize.BandsQuickCustomization; +end; + +function TcxGridIndicatorBandHeaderItemViewInfo.DropDownWindowExists: Boolean; +begin + Result := GridView.Controller.HasBandsCustomizationPopup; +end; + +function TcxGridIndicatorBandHeaderItemViewInfo.GetDropDownWindow: TcxCustomGridPopup; +begin + Result := GridView.Controller.BandsCustomizationPopup; +end; + +{ TcxGridBandedIndicatorViewInfo } + +function TcxGridBandedIndicatorViewInfo.GetAlwaysVisible: Boolean; +begin + Result := inherited GetAlwaysVisible or + TcxGridBandedTableView(GridView).OptionsCustomize.BandsQuickCustomization; +end; + +{ TcxGridBandedDataRowCellsAreaItemViewInfo } + +constructor TcxGridBandedDataRowCellsAreaItemViewInfo.Create(ACellsAreaViewInfo: TcxGridBandedDataRowCellsAreaViewInfo; + ABandViewInfo: TcxGridBandViewInfo); +begin + inherited Create(ACellsAreaViewInfo.RecordViewInfo); + FCellsAreaViewInfo := ACellsAreaViewInfo; + FBandViewInfo := ABandViewInfo; + CreateLineBounds; +end; + +destructor TcxGridBandedDataRowCellsAreaItemViewInfo.Destroy; +begin + DestroyLineBounds; + inherited; +end; + +function TcxGridBandedDataRowCellsAreaItemViewInfo.GetFixedBandsSeparatorLocation: TcxGridFixedBandsSeparatorLocation; +begin + if bLeft in FBandViewInfo.Borders then + Result := slLeft + else + if bRight in FBandViewInfo.Borders then + Result := slRight + else + Result := slNone; +end; + +function TcxGridBandedDataRowCellsAreaItemViewInfo.GetGridViewInfo: TcxGridBandedTableViewInfo; +begin + Result := TcxGridBandedTableViewInfo(inherited GridViewInfo); +end; + +function TcxGridBandedDataRowCellsAreaItemViewInfo.GetLineBounds(Index: Integer): TRect; +begin + Result := PRect(FLineBounds[Index])^; +end; + +function TcxGridBandedDataRowCellsAreaItemViewInfo.GetLineCount: Integer; +begin + Result := FLineBounds.Count; +end; + +function TcxGridBandedDataRowCellsAreaItemViewInfo.GetRecordsViewInfo: TcxGridBandedRowsViewInfo; +begin + Result := TcxGridBandedRowsViewInfo(RecordViewInfo.RecordsViewInfo); +end; + +function TcxGridBandedDataRowCellsAreaItemViewInfo.GetRecordViewInfo: TcxGridDataRowViewInfo; +begin + Result := TcxGridDataRowViewInfo(inherited RecordViewInfo); +end; + +procedure TcxGridBandedDataRowCellsAreaItemViewInfo.ClearLines; +var + I: Integer; +begin + for I := 0 to LineCount - 1 do + Dispose(PRect(FLineBounds[I])); + FLineBounds.Clear; +end; + +procedure TcxGridBandedDataRowCellsAreaItemViewInfo.CreateLineBounds; +begin + FLineBounds := TList.Create; +end; + +procedure TcxGridBandedDataRowCellsAreaItemViewInfo.DestroyLineBounds; +begin + ClearLines; + FLineBounds.Free; +end; + +procedure TcxGridBandedDataRowCellsAreaItemViewInfo.AddLine(const ABounds: TRect); +var + ALineBounds: PRect; +begin + New(ALineBounds); + ALineBounds^ := ABounds; + FLineBounds.Add(ALineBounds); +end; + +procedure TcxGridBandedDataRowCellsAreaItemViewInfo.AddLines; + + procedure AddCellsLines(AShowLeftLines, AShowTopLines: Boolean); + var + I: Integer; + ACellViewInfo: TcxGridDataCellViewInfo; + APosition: TcxGridBandedColumnPosition; + R: TRect; + + procedure AddLeftLine; + begin + R := ACellViewInfo.Bounds; + R.Right := R.Left; + Dec(R.Left, GridViewInfo.GridLineWidth); + AddLine(R); + end; + + procedure AddTopLine; + begin + R := ACellViewInfo.Bounds; + R.Bottom := R.Top; + Dec(R.Top, GridViewInfo.GridLineWidth); + AddLine(R); + end; + + begin + if not (AShowLeftLines or AShowTopLines) then Exit; + for I := 0 to FBandViewInfo.ColumnViewInfoCount - 1 do + begin + ACellViewInfo := RecordViewInfo.InternalCellViewInfos[FBandViewInfo[I].Index]; + if ACellViewInfo <> nil then + begin + APosition := TcxGridBandedColumn(ACellViewInfo.Item).Position; + if AShowLeftLines and (APosition.VisibleColIndex > 0) then + AddLeftLine; + if AShowTopLines and (APosition.VisibleRowIndex > 0) then + AddTopLine; + end; + end; + end; + +begin + if Borders <> [] then + AddCellsLines(RecordsViewInfo.ShowCellLeftLines, RecordsViewInfo.ShowCellTopLines); +end; + +function TcxGridBandedDataRowCellsAreaItemViewInfo.CalculateHeight: Integer; +begin + Result := 0; +end; + +function TcxGridBandedDataRowCellsAreaItemViewInfo.CalculateWidth: Integer; +begin + Result := 0; +end; + +function TcxGridBandedDataRowCellsAreaItemViewInfo.GetBorders: TcxBorders; +begin + Result := RecordViewInfo.GetCellBorders(FBandViewInfo.IsRight, CellsAreaViewInfo.IsBottom); + if GridViewInfo.FixedBandSeparatorWidth <> 0 then + Result := Result - FBandViewInfo.Borders; +end; + +function TcxGridBandedDataRowCellsAreaItemViewInfo.GetFixedBandsSeparatorBounds: TRect; +begin + Result := ContentBounds; + with Result do + case FixedBandsSeparatorLocation of + slLeft: + Right := Left + GridViewInfo.FixedBandSeparatorWidth; + slRight: + Left := Right - GridViewInfo.FixedBandSeparatorWidth; + end; +end; + +function TcxGridBandedDataRowCellsAreaItemViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridBandedDataRowCellsAreaItemPainter; +end; + +procedure TcxGridBandedDataRowCellsAreaItemViewInfo.GetViewParams(var AParams: TcxViewParams); +var + ACellPos: TcxGridDataCellPos; +begin + if RecordViewInfo.Selected then + inherited + else + begin + ACellPos := TcxGridDataCellPos.Create(RecordViewInfo.GridRecord, nil); + try + FBandViewInfo.Band.Styles.GetViewParams(bsContent, ACellPos, nil, AParams); + finally + ACellPos.Free; + end; + end; +end; + +procedure TcxGridBandedDataRowCellsAreaItemViewInfo.Offset(DX, DY: Integer); +begin + inherited; + ClearLines; + AddLines; +end; + +procedure TcxGridBandedDataRowCellsAreaItemViewInfo.BeforeRecalculation; +begin + inherited; + ClearLines; + RecordViewInfo.BeforeCellRecalculation(Self); +end; + +procedure TcxGridBandedDataRowCellsAreaItemViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + inherited; + AddLines; +end; + +function TcxGridBandedDataRowCellsAreaItemViewInfo.CanDrawSelected: Boolean; +begin + Result := True; +end; + +{ TcxGridBandedDataRowCellsAreaViewInfo } + +constructor TcxGridBandedDataRowCellsAreaViewInfo.Create(ARecordViewInfo: TcxCustomGridRecordViewInfo); +begin + inherited; + CreateItems; +end; + +destructor TcxGridBandedDataRowCellsAreaViewInfo.Destroy; +begin + DestroyItems; + inherited; +end; + +function TcxGridBandedDataRowCellsAreaViewInfo.GetBandsViewInfo: TcxGridBandsViewInfo; +begin + Result := GridViewInfo.HeaderViewInfo.BandsViewInfo; +end; + +function TcxGridBandedDataRowCellsAreaViewInfo.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxGridBandedDataRowCellsAreaViewInfo.GetGridViewInfo: TcxGridBandedTableViewInfo; +begin + Result := TcxGridBandedTableViewInfo(inherited GridViewInfo); +end; + +function TcxGridBandedDataRowCellsAreaViewInfo.GetItem(Index: Integer): TcxGridBandedDataRowCellsAreaItemViewInfo; +begin + Result := TcxGridBandedDataRowCellsAreaItemViewInfo(FItems[Index]); +end; + +procedure TcxGridBandedDataRowCellsAreaViewInfo.CreateItems; +var + I: Integer; +begin + FItems := TList.Create; + for I := 0 to BandsViewInfo.BottomItemCount - 1 do + FItems.Add(GetItemClass.Create(Self, BandsViewInfo.BottomItems[I])); +end; + +procedure TcxGridBandedDataRowCellsAreaViewInfo.DestroyItems; +var + I: Integer; +begin + for I := 0 to Count - 1 do Items[I].Free; + FItems.Free; +end; + +function TcxGridBandedDataRowCellsAreaViewInfo.CalculateVisible: Boolean; +begin + Result := TcxGridBandedRowsViewInfo(RecordViewInfo.RecordsViewInfo).RowCellsAreaVisible; +end; + +function TcxGridBandedDataRowCellsAreaViewInfo.GetItemClass: TcxGridBandedDataRowCellsAreaItemViewInfoClass; +begin + Result := TcxGridBandedDataRowCellsAreaItemViewInfo; +end; + +procedure TcxGridBandedDataRowCellsAreaViewInfo.Offset(DX, DY: Integer); +var + I: Integer; +begin + inherited; + for I := 0 to Count - 1 do + Items[I].DoOffset(DX, DY); +end; + +procedure TcxGridBandedDataRowCellsAreaViewInfo.BeforeRecalculation; +var + I: Integer; +begin + inherited; + for I := 0 to Count - 1 do + Items[I].BeforeRecalculation; +end; + +procedure TcxGridBandedDataRowCellsAreaViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +var + R: TRect; + I: Integer; +begin + inherited; + R := Bounds; + for I := 0 to Count - 1 do + begin + with Items[I].BandViewInfo.Bounds do + begin + if I <> 0 then R.Left := Left; + R.Right := Right; + end; + Items[I].Calculate(R); + end; +end; + +function TcxGridBandedDataRowCellsAreaViewInfo.DrawMergedCells: Boolean; +begin + Result := True; +end; + +{ TcxGridBandedRowsViewInfo } + +function TcxGridBandedRowsViewInfo.GetHeaderViewInfo: TcxGridBandedHeaderViewInfo; +begin + Result := TcxGridBandedHeaderViewInfo(inherited HeaderViewInfo); +end; + +function TcxGridBandedRowsViewInfo.CalculateDataRowHeight: Integer; +begin + Result := inherited CalculateDataRowHeight; + if HeaderViewInfo.LineCount <> 0 then + Result := Result * HeaderViewInfo.LineCount; +end; + +function TcxGridBandedRowsViewInfo.CalculateRowCellsAreaVisible: Boolean; +var + I: Integer; +begin + with HeaderViewInfo.BandsViewInfo do + begin + Result := LineCount > 1; + if not Result then + if Count = 0 then + Result := True + else + for I := 0 to Count - 1 do + with Items[I] do + if (ColumnViewInfoCount = 0) or (FixedKind <> fkNone) or AreAllColumnsFixed then + begin + Result := True; + Break; + end; + end; +end; + +function TcxGridBandedRowsViewInfo.GetAreaBoundsForCell(ACellViewInfo: TcxGridTableDataCellViewInfo): TRect; +var + ABand: TcxGridBand; +begin + ABand := TcxGridBandedColumn(ACellViewInfo.Item).Position.Band; + if (ABand <> nil) and (ABand.FixedKind = fkNone) then + Result := GridViewInfo.ScrollableAreaBoundsHorz + else + Result := inherited GetAreaBoundsForCell(ACellViewInfo); +end; + +function TcxGridBandedRowsViewInfo.GetPainterClass: TcxCustomGridRecordsPainterClass; +begin + Result := TcxGridBandedRowsPainter; +end; + +function TcxGridBandedRowsViewInfo.GetRowWidth: Integer; +var + AClientWidth: Integer; +begin + Result := inherited GetRowWidth; + AClientWidth := GridViewInfo.ClientWidth; + if Result > AClientWidth then + case HeaderViewInfo.BandsViewInfo.Bands.Layout of + blLeftFixed: + Dec(Result, GridViewInfo.LeftPos); + blRightFixed: + Result := AClientWidth + GridViewInfo.LeftPos; + blLeftRightFixed: + Result := AClientWidth; + end; +end; + +function TcxGridBandedRowsViewInfo.GetShowBandSeparators: Boolean; +begin + Result := (HeaderViewInfo.LineCount > 1) and (GridLines in [glBoth, glVertical]); +end; + +function TcxGridBandedRowsViewInfo.GetShowCellLeftLines: Boolean; +begin + Result := (HeaderViewInfo.LineCount > 1) and (GridLines in [glBoth, glVertical]); +end; + +function TcxGridBandedRowsViewInfo.GetShowCellTopLines: Boolean; +begin + Result := (HeaderViewInfo.RowCount > 1) and (GridLines = glBoth); +end; + +procedure TcxGridBandedRowsViewInfo.AfterConstruction; +begin + FRowCellsAreaVisible := CalculateRowCellsAreaVisible; + inherited; +end; + +function TcxGridBandedRowsViewInfo.GetDataRowCellsAreaViewInfoClass: TClass; +begin + Result := TcxGridBandedDataRowCellsAreaViewInfo; +end; + +function TcxGridBandedRowsViewInfo.IsCellMultiLine(AItem: TcxCustomGridTableItem): Boolean; +begin + Result := inherited IsCellMultiLine(AItem) or + (TcxGridBandedColumn(AItem).Position.LineCount > 1); +end; + +{ TcxGridBandedTableViewInfo } + +function TcxGridBandedTableViewInfo.GetController: TcxGridBandedTableController; +begin + Result := TcxGridBandedTableController(inherited Controller); +end; + +function TcxGridBandedTableViewInfo.GetFixedBandSeparatorColor: TColor; +begin + Result := GridView.OptionsView.GetFixedBandSeparatorColor; +end; + +function TcxGridBandedTableViewInfo.GetFixedBandSeparatorWidth: Integer; +begin + Result := GridView.OptionsView.FixedBandSeparatorWidth; +end; + +function TcxGridBandedTableViewInfo.GetGridView: TcxGridBandedTableView; +begin + Result := TcxGridBandedTableView(inherited GridView); +end; + +function TcxGridBandedTableViewInfo.GetHeaderViewInfo: TcxGridBandedHeaderViewInfo; +begin + Result := TcxGridBandedHeaderViewInfo(inherited HeaderViewInfo); +end; + +function TcxGridBandedTableViewInfo.GetScrollableAreaBoundsForEdit: TRect; +begin + Result := inherited GetScrollableAreaBoundsForEdit; + with ScrollableAreaBoundsHorz do + begin + Result.Left := Left; + Result.Right := Right; + end; +end; + +function TcxGridBandedTableViewInfo.GetScrollableAreaBoundsHorz: TRect; +begin + Result := inherited GetScrollableAreaBoundsHorz; + with GridView.Bands do + begin + if VisibleLeftFixedCount <> 0 then + Result.Left := HeaderViewInfo.BandsViewInfo.LastFixedItems[fkLeft, 0].Bounds.Right; + if VisibleRightFixedCount <> 0 then + Result.Right := HeaderViewInfo.BandsViewInfo.LastFixedItems[fkRight, 0].Bounds.Left; + end; +end; + +function TcxGridBandedTableViewInfo.SupportsAutoHeight: Boolean; +begin + Result := inherited SupportsAutoHeight and (HeaderViewInfo.LineCount = 1); +end; + +function TcxGridBandedTableViewInfo.SupportsGroupSummariesAlignedWithColumns: Boolean; +begin + Result := inherited SupportsGroupSummariesAlignedWithColumns and + (HeaderViewInfo.RowCount = 1) and (GridView.Bands.Layout = blNonFixed); +end; + +function TcxGridBandedTableViewInfo.SupportsMultipleFooterSummaries: Boolean; +begin + Result := inherited SupportsMultipleFooterSummaries and (HeaderViewInfo.RowCount = 1); +end; + +function TcxGridBandedTableViewInfo.GetFooterPainterClass: TcxGridFooterPainterClass; +begin + Result := TcxGridBandedFooterPainter; +end; + +function TcxGridBandedTableViewInfo.GetFooterViewInfoClass: TcxGridFooterViewInfoClass; +begin + Result := TcxGridBandedFooterViewInfo; +end; + +function TcxGridBandedTableViewInfo.GetHeaderViewInfoClass: TcxGridHeaderViewInfoClass; +begin + Result := TcxGridBandedHeaderViewInfo; +end; + +function TcxGridBandedTableViewInfo.GetHeaderViewInfoSpecificClass: TcxGridHeaderViewInfoSpecificClass; +begin + Result := TcxGridBandedHeaderViewInfoSpecific; +end; + +function TcxGridBandedTableViewInfo.GetIndicatorViewInfoClass: TcxGridIndicatorViewInfoClass; +begin + Result := TcxGridBandedIndicatorViewInfo; +end; + +function TcxGridBandedTableViewInfo.GetRecordsViewInfoClass: TcxCustomGridRecordsViewInfoClass; +begin + Result := TcxGridBandedRowsViewInfo; +end; + +function TcxGridBandedTableViewInfo.CanOffset(ARecordCountDelta, DX, DY: Integer): Boolean; +begin + Result := inherited CanOffset(ARecordCountDelta, DX, DY) and + ((ARecordCountDelta <> 0) or (GridView.Bands.Layout = blNonFixed)); +end; + +function TcxGridBandedTableViewInfo.GetCellHeight(AIndex, ACellHeight: Integer): Integer; +begin + Result := HeaderViewInfo[AIndex].Column.Position.LineCount * ACellHeight; +end; + +function TcxGridBandedTableViewInfo.GetCellTopOffset(AIndex, ACellHeight: Integer): Integer; +begin + Result := HeaderViewInfo[AIndex].Column.Position.Row.LineOffset * ACellHeight; +end; + +{ TcxGridBandedColumnOptions } + +constructor TcxGridBandedColumnOptions.Create(AItem: TcxCustomGridTableItem); +begin + inherited; + FVertSizing := True; +end; + +procedure TcxGridBandedColumnOptions.SetVertSizing(Value: Boolean); +begin + if FVertSizing <> Value then + begin + FVertSizing := Value; + Changed; + end; +end; + +procedure TcxGridBandedColumnOptions.Assign(Source: TPersistent); +begin + if Source is TcxGridBandedColumnOptions then + with TcxGridBandedColumnOptions(Source) do + Self.VertSizing := VertSizing; + inherited; +end; + +{ TcxGridBandedColumnStyles } + +function TcxGridBandedColumnStyles.GetItem: TcxGridBandedColumn; +begin + Result := TcxGridBandedColumn(inherited Item); +end; + +procedure TcxGridBandedColumnStyles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +var + ADataCellPos: TcxGridDataCellPos; +begin + if (Index = isContent) and (Item.Position.Band <> nil) then + begin + ADataCellPos := TcxGridDataCellPos.Create(TcxCustomGridRecord(AData), Item); + try + Item.Position.Band.Styles.GetViewParams(bsContent, ADataCellPos, nil, AParams); + finally + ADataCellPos.Free; + end; + end + else + inherited; +end; + +{ TcxGridBandedColumnPosition } + +constructor TcxGridBandedColumnPosition.Create(AItem: TcxCustomGridTableItem); +begin + inherited; + FBandIndex := -1; + FColIndex := -1; + FLineCount := 1; + FRowIndex := -1; + FVisibleColIndex := -1; +end; + +function TcxGridBandedColumnPosition.GetBandIndex: Integer; +begin + if FBand = nil then + Result := -1 + else + Result := FBand.Index; +end; + +function TcxGridBandedColumnPosition.GetColIndex: Integer; +begin + if Row = nil then + Result := -1 + else + Result := Row.IndexOf(Item); +end; + +function TcxGridBandedColumnPosition.GetGridView: TcxGridBandedTableView; +begin + Result := TcxGridBandedTableView(inherited GridView); +end; + +function TcxGridBandedColumnPosition.GetItem: TcxGridBandedColumn; +begin + Result := TcxGridBandedColumn(inherited Item); +end; + +function TcxGridBandedColumnPosition.GetRowIndex: Integer; +begin + if Row = nil then + Result := -1 + else + Result := Row.Index; +end; + +function TcxGridBandedColumnPosition.GetVisibleBandIndex: Integer; +begin + if FBand = nil then + Result := -1 + else + Result := FBand.VisibleIndex; +end; + +function TcxGridBandedColumnPosition.GetVisibleRowIndex: Integer; +begin + if Row = nil then + Result := -1 + else + Result := Row.VisibleIndex; +end; + +procedure TcxGridBandedColumnPosition.SetBand(Value: TcxGridBand); +begin + FBand := Value; + if FBand = nil then + FVisibleColIndex := -1; +end; + +procedure TcxGridBandedColumnPosition.SetBandIndex(Value: Integer); +var + ANewBand: TcxGridBand; + APrevVisible: Boolean; +begin + if BandIndex <> Value then + begin + if (0 <= Value) and (Value < GridView.Bands.Count) then + ANewBand := GridView.Bands[Value] + else + ANewBand := nil; + if (ANewBand <> nil) and not ANewBand.IsBottom then + ANewBand.MoveBandsToRoot; + APrevVisible := Item.ActuallyVisible; + GridView.BeginUpdate; + try + if FBand <> nil{BandIndex <> -1} then + FBand.RemoveColumn(Item); + if ANewBand <> nil then + ANewBand.AddColumn(Item); + if Item.IsReading or Item.IsUpdating then + FBandIndex := BandIndex; + if Item.ActuallyVisible <> APrevVisible then + GridView.ItemVisibilityChanged(Item, Item.ActuallyVisible) + else + GridView.RefreshVisibleItemsList; + Changed(ticSize); + finally + GridView.EndUpdate; + end; + end; +end; + +procedure TcxGridBandedColumnPosition.SetColIndex(Value: Integer); +begin + if FBand <> nil then + if Item.IsLoading or Item.IsUpdating or GridView.IsAssigningItems then + FColIndex := Value + else + if Value >= 0 then + begin + FBand.MoveColumn(Item, RowIndex, Value); + Changed(ticSize); + end; +end; + +procedure TcxGridBandedColumnPosition.SetLineCount(Value: Integer); +begin + CheckLineCount(Value); + if FLineCount <> Value then + begin + FLineCount := Value; + Changed(ticSize); + end; +end; + +procedure TcxGridBandedColumnPosition.SetRowIndex(Value: Integer); +begin + if (FBand <> nil) and (RowIndex <> Value) then + if Item.IsLoading or Item.IsUpdating or GridView.IsAssigningItems then + FRowIndex := Value + else + if Value >= 0 then + begin + FBand.MoveColumn(Item, Value, -1); + Changed(ticSize); + end; +end; + +procedure TcxGridBandedColumnPosition.CheckLineCount(var Value: Integer); +begin + if Value < 1 then Value := 1; +end; + +procedure TcxGridBandedColumnPosition.SaveParams(ABandIndexOnly: Boolean = False); +begin + FBandIndex := BandIndex; + if not ABandIndexOnly then + begin + FColIndex := ColIndex; + FRowIndex := RowIndex; + end; +end; + +procedure TcxGridBandedColumnPosition.Assign(Source: TPersistent); +begin + if Source is TcxGridBandedColumnPosition then + with TcxGridBandedColumnPosition(Source) do + begin + Self.BandIndex := BandIndex; + Self.RowIndex := RowIndex; + Self.ColIndex := ColIndex; + Self.LineCount := LineCount; + end; + inherited; +end; + +{ TcxGridBandedColumn } + +destructor TcxGridBandedColumn.Destroy; +begin + FPosition.BandIndex := -1; + inherited; +end; + +function TcxGridBandedColumn.GetGridView: TcxGridBandedTableView; +begin + Result := TcxGridBandedTableView(inherited GridView); +end; + +function TcxGridBandedColumn.GetOptions: TcxGridBandedColumnOptions; +begin + Result := TcxGridBandedColumnOptions(inherited Options); +end; + +function TcxGridBandedColumn.GetStyles: TcxGridBandedColumnStyles; +begin + Result := TcxGridBandedColumnStyles(inherited Styles); +end; + +procedure TcxGridBandedColumn.SetOptions(Value: TcxGridBandedColumnOptions); +begin + inherited Options := Value; +end; + +procedure TcxGridBandedColumn.SetPosition(Value: TcxGridBandedColumnPosition); +begin + FPosition.Assign(Value); +end; + +procedure TcxGridBandedColumn.SetStyles(Value: TcxGridBandedColumnStyles); +begin + inherited Styles := Value; +end; + +function TcxGridBandedColumn.GetStoredProperties(AProperties: TStrings): Boolean; +begin + with AProperties do + begin + Add('BandIndex'); + Add('ColIndex'); + Add('RowIndex'); + Add('LineCount'); + end; + Result := inherited GetStoredProperties(AProperties); +end; + +procedure TcxGridBandedColumn.GetPropertyValue(const AName: string; var AValue: Variant); +begin + if AName = 'BandIndex' then + AValue := Position.BandIndex + else + if AName = 'ColIndex' then + AValue := Position.ColIndex + else + if AName = 'RowIndex' then + AValue := Position.RowIndex + else + if AName = 'LineCount' then + AValue := Position.LineCount + else + inherited; +end; + +procedure TcxGridBandedColumn.SetPropertyValue(const AName: string; const AValue: Variant); +begin + if AName = 'BandIndex' then + Position.BandIndex := AValue + else + if AName = 'ColIndex' then + Position.FColIndex := AValue + else + if AName = 'RowIndex' then + Position.FRowIndex := AValue + else + if AName = 'LineCount' then + Position.LineCount := AValue + else + inherited; +end; + +procedure TcxGridBandedColumn.CreateSubClasses; +begin + inherited; + FPosition := TcxGridBandedColumnPosition.Create(Self); +end; + +procedure TcxGridBandedColumn.DestroySubClasses; +begin + FreeAndNil(FPosition); + inherited; +end; + +function TcxGridBandedColumn.GetOptionsClass: TcxCustomGridTableItemOptionsClass; +begin + Result := TcxGridBandedColumnOptions; +end; + +function TcxGridBandedColumn.GetStylesClass: TcxCustomGridTableItemStylesClass; +begin + Result := TcxGridBandedColumnStyles; +end; + +function TcxGridBandedColumn.CanCellMerging: Boolean; +begin + Result := inherited CanCellMerging and + (FPosition.LineCount = GridView.ViewInfo.HeaderViewInfo.LineCount); +end; + +procedure TcxGridBandedColumn.AssignColumnWidths; + + function GetRowViewInfo: TcxGridBandRowViewInfo; + begin + Result := GridView.ViewInfo.HeaderViewInfo.BandsViewInfo[Position.VisibleBandIndex].RowsViewInfo[Position.VisibleRowIndex]; + end; + +begin + if Position.Band.Width <> 0 then + GetRowViewInfo.AssignColumnWidths + else + if Position.Band.HasParentWithAssignedWidth then + Position.Band.ParentBandWithAssignedWidth.AssignColumnWidths + else + if (Position.Band.Rows.VisibleCount > 1) and + (Position.Row.Width < Position.Band.Rows.Width) then + GetRowViewInfo.AssignColumnWidths + else + inherited; +end; + +function TcxGridBandedColumn.CanScroll: Boolean; +begin + Result := inherited CanScroll and + (Position.Band <> nil) and (Position.Band.FixedKind = fkNone); +end; + +function TcxGridBandedColumn.CanVertSize: Boolean; +begin + Result := GridView.OptionsCustomize.ColumnVertSizing and Options.VertSizing; +end; + +function TcxGridBandedColumn.DefaultAlternateCaption: string; +var + ABand: TcxGridBand; +begin + Result := inherited DefaultAlternateCaption; + if GridView.OptionsView.BandCaptionsInColumnAlternateCaption then + begin + ABand := Position.Band; + while ABand <> nil do + begin + Result := ABand.Caption + cxGridBandedTableViewAlternateCaptionSeparator + Result; + ABand := ABand.ParentBand; + end; + end; +end; + +function TcxGridBandedColumn.GetActuallyVisible: Boolean; +begin + Result := inherited GetActuallyVisible and + (Position.Band <> nil) and Position.Band.ActuallyVisible; +end; + +function TcxGridBandedColumn.GetEditPartVisible: Boolean; +var + R: TRect; + + function HasPoint(X, Y: Integer): Boolean; + var + AHitTest: TcxCustomGridHitTest; + begin + AHitTest := GridView.ViewInfo.GetHitTest(X, Y); + Result := (AHitTest is TcxGridRecordCellHitTest) and + (TcxGridRecordCellHitTest(AHitTest).Item = Self); + end; + +begin + if CanScroll then + Result := inherited GetEditPartVisible + else + with GridView.ViewInfo.ScrollableAreaBoundsForEdit do + begin + Result := Right < Left; // left fixed and right fixed bands overlap + if Result then + begin + R := FocusedCellViewInfo.EditBounds; + // R.Top is ignored because it is always visible if R.Bottom - 1 is visible + // Also R.Top might intersect with the header sizing hittest area + Result := not HasPoint(R.Left, R.Bottom - 1) or not HasPoint(R.Right - 1, R.Bottom - 1); + end + else + Result := FocusedCellViewInfo.EditBounds.Bottom > Bottom; + end; +end; + +function TcxGridBandedColumn.GetIsBottom: Boolean; +begin + Result := (Position.Row <> nil) and Position.Row.IsLast; +end; + +function TcxGridBandedColumn.GetIsLeft: Boolean; +begin + Result := Position.VisibleColIndex = 0; +end; + +function TcxGridBandedColumn.GetIsMostBottom: Boolean; +begin + Result := IsBottom and + (Position.VisibleRowIndex = GridView.Bands.VisibleRowCount - 1); +end; + +function TcxGridBandedColumn.GetIsMostLeft: Boolean; +begin + Result := IsLeft and Position.Band.IsFirst; +end; + +function TcxGridBandedColumn.GetIsMostRight: Boolean; +begin + Result := IsRight and Position.Band.IsLast; +end; + +function TcxGridBandedColumn.GetIsRight: Boolean; +begin + Result := (Position.Row <> nil) and + (Position.VisibleColIndex = Position.Row.VisibleCount - 1); +end; + +function TcxGridBandedColumn.GetIsTop: Boolean; +begin + Result := (Position.Row <> nil) and Position.Row.IsFirst; +end; + +function TcxGridBandedColumn.GetVisibleInQuickCustomizationPopup: Boolean; +begin + Result := inherited GetVisibleInQuickCustomizationPopup and + (FPosition.Band <> nil) and FPosition.Band.ActuallyVisible; +end; + +procedure TcxGridBandedColumn.VisibleChanged; +begin + inherited; + if Position.Row <> nil then + Position.Row.RefreshVisibleItemsList; +end; + +procedure TcxGridBandedColumn.Assign(Source: TPersistent); +begin + if Source is TcxGridBandedColumn then + with TcxGridBandedColumn(Source) do + begin + Self.Position := Position; + end; + inherited; +end; + +{ TcxGridBandRow } + +constructor TcxGridBandRow.Create(ABandRows: TcxGridBandRows); +begin + inherited Create; + FBandRows := ABandRows; + FItems := TList.Create; + FVisibleItems := TList.Create; +end; + +destructor TcxGridBandRow.Destroy; +begin + FBandRows.RemoveItem(Self); + FVisibleItems.Free; + FItems.Free; + inherited; +end; + +function TcxGridBandRow.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxGridBandRow.GetIndex: Integer; +begin + Result := FBandRows.FItems.IndexOf(Self); +end; + +function TcxGridBandRow.GetIsFirst: Boolean; +begin + Result := VisibleIndex = 0; +end; + +function TcxGridBandRow.GetIsLast: Boolean; +begin + Result := VisibleIndex = FBandRows.VisibleCount - 1; +end; + +function TcxGridBandRow.GetItem(Index: Integer): TcxGridBandedColumn; +begin + Result := TcxGridBandedColumn(FItems[Index]); +end; + +function TcxGridBandRow.GetLineCount: Integer; +var + I, ALineCount: Integer; +begin + Result := 1; + for I := 0 to VisibleCount - 1 do + begin + ALineCount := VisibleItems[I].Position.LineCount; + if ALineCount > Result then Result := ALineCount; + end; +end; + +function TcxGridBandRow.GetLineOffset: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to VisibleIndex - 1 do + Inc(Result, FBandRows.VisibleItems[I].LineCount); +end; + +function TcxGridBandRow.GetVisible: Boolean; +begin + Result := (VisibleCount <> 0) or (Count = 0); // for new just inserted empty rows +end; + +function TcxGridBandRow.GetVisibleCount: Integer; +begin + Result := FVisibleItems.Count; +end; + +function TcxGridBandRow.GetVisibleIndex: Integer; +begin + Result := FBandRows.FVisibleItems.IndexOf(Self); +end; + +function TcxGridBandRow.GetVisibleItem(Index: Integer): TcxGridBandedColumn; +begin + Result := TcxGridBandedColumn(FVisibleItems[Index]); +end; + +function TcxGridBandRow.GetWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to VisibleCount - 1 do + Inc(Result, VisibleItems[I].Width); +end; + +procedure TcxGridBandRow.CheckIndexForInsert(var AIndex: Integer; AExistingItem: Boolean); +begin + CheckItemIndexForInsert(AIndex, Count, AExistingItem); +end; + +procedure TcxGridBandRow.RefreshVisibleItemsList; +var + I: Integer; +begin + FVisibleItems.Clear; + for I := 0 to Count - 1 do + if Items[I].Visible then + Items[I].Position.FVisibleColIndex := FVisibleItems.Add(Items[I]) + else + Items[I].Position.FVisibleColIndex := -1; + FBandRows.RefreshVisibleItemsList; +end; + +procedure TcxGridBandRow.ApplyBestFit(ACheckSizingAbility: Boolean = False; + AFireEvents: Boolean = False); +var + I: Integer; +begin + for I := 0 to VisibleCount - 1 do + VisibleItems[I].ApplyBestFit(ACheckSizingAbility, AFireEvents); +end; + +procedure TcxGridBandRow.Delete(AIndex: Integer); +begin + Items[AIndex].Position.FRow := nil; + FItems.Delete(AIndex); + if Count = 0 then + Free + else + RefreshVisibleItemsList; +end; + +function TcxGridBandRow.IndexOf(AColumn: TcxGridBandedColumn): Integer; +begin + Result := FItems.IndexOf(AColumn); +end; + +procedure TcxGridBandRow.Insert(AIndex: Integer; AColumn: TcxGridBandedColumn); +begin + CheckIndexForInsert(AIndex, False); + FItems.Insert(AIndex, AColumn); + AColumn.Position.FRow := Self; + RefreshVisibleItemsList; +end; + +procedure TcxGridBandRow.Move(ACurIndex, ANewIndex: Integer); +begin + CheckIndexForInsert(ANewIndex, True); + FItems.Move(ACurIndex, ANewIndex); + RefreshVisibleItemsList; +end; + +{ TcxGridBandRows } + +constructor TcxGridBandRows.Create(ABand: TcxGridBand); +begin + inherited Create; + FBand := ABand; + FItems := TList.Create; + FVisibleItems := TList.Create; +end; + +destructor TcxGridBandRows.Destroy; +begin + Count := 0; + FVisibleItems.Free; + FItems.Free; + inherited; +end; + +function TcxGridBandRows.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxGridBandRows.GetFirstVisible: TcxGridBandRow; +begin + Result := VisibleItems[0]; +end; + +function TcxGridBandRows.GetGridView: TcxGridBandedTableView; +begin + Result := FBand.GridView; +end; + +function TcxGridBandRows.GetItem(Index: Integer): TcxGridBandRow; +begin + Result := TcxGridBandRow(FItems[Index]); +end; + +function TcxGridBandRows.GetLastVisible: TcxGridBandRow; +begin + Result := VisibleItems[VisibleCount - 1]; +end; + +function TcxGridBandRows.GetLineCount: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to VisibleCount - 1 do + Inc(Result, VisibleItems[I].LineCount); +end; + +function TcxGridBandRows.GetVisibleCount: Integer; +begin + Result := FVisibleItems.Count; +end; + +function TcxGridBandRows.GetVisibleItem(Index: Integer): TcxGridBandRow; +begin + Result := TcxGridBandRow(FVisibleItems[Index]); +end; + +function TcxGridBandRows.GetWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to VisibleCount - 1 do + Inc(Result, VisibleItems[I].Width); +end; + +procedure TcxGridBandRows.SetCount(Value: Integer); +var + APrevCount, I: Integer; +begin + if Value < 0 then Value := 0; + if Count <> Value then + begin + if Value > Count then + begin + APrevCount := Count; + FItems.Count := Value; + for I := APrevCount to Count - 1 do + FItems[I] := TcxGridBandRow.Create(Self); + end + else + begin + for I := Value to Count - 1 do Items[I].Free; + FItems.Count := Value; + end; + RefreshVisibleItemsList; + end; +end; + +procedure TcxGridBandRows.RemoveItem(ARow: TcxGridBandRow); +begin + FItems.Remove(ARow); + RefreshVisibleItemsList; +end; + +procedure TcxGridBandRows.RefreshVisibleItemsList; +var + I: Integer; +begin + FVisibleItems.Clear; + for I := 0 to Count - 1 do + if Items[I].Visible then + FVisibleItems.Add(Items[I]); +end; + +procedure TcxGridBandRows.ApplyBestFit(ACheckSizingAbility: Boolean = False; + AFireEvents: Boolean = False); +var + I: Integer; +begin + for I := 0 to VisibleCount - 1 do + VisibleItems[I].ApplyBestFit(ACheckSizingAbility, AFireEvents); +end; + +function TcxGridBandRows.GetLineIndex(ARowIndex: Integer): Integer; +begin + Result := VisibleItems[ARowIndex].LineOffset; +end; + +function TcxGridBandRows.GetRowIndex(ALineIndex: Integer): Integer; +begin + for Result := 0 to VisibleCount - 1 do + with VisibleItems[Result] do + if (LineOffset <= ALineIndex) and (ALineIndex < LineOffset + LineCount) then + Exit; + Result := -1; +end; + +function TcxGridBandRows.Insert(AIndex: Integer): TcxGridBandRow; +begin + if AIndex > Count then AIndex := Count; + Result := TcxGridBandRow.Create(Self); + FItems.Insert(AIndex, Result); + RefreshVisibleItemsList; +end; + +procedure TcxGridBandRows.MoveColumn(AColumn: TcxGridBandedColumn; ARowIndex, AColIndex: Integer); +var + AColumnColIndex, AColumnRowIndex, APrevCount: Integer; +begin + AColumnRowIndex := AColumn.Position.RowIndex; + AColumnColIndex := AColumn.Position.ColIndex; + + if AColumnRowIndex <> ARowIndex then + begin + if AColumnRowIndex <> -1 then + begin + APrevCount := Count; + Items[AColumnRowIndex].Delete(AColumnColIndex); + if (Count <> APrevCount) and (AColumnRowIndex < ARowIndex) then + Dec(ARowIndex); + end; + if ARowIndex <> -1 then + begin + if ARowIndex > Count then ARowIndex := Count; + if ARowIndex = Count then Count := ARowIndex + 1; + if AColIndex = -1 then + AColIndex := Items[ARowIndex].Count; + Items[ARowIndex].Insert(AColIndex, AColumn); + end; + end + else + if (ARowIndex <> -1) and (AColumnColIndex <> AColIndex) then + if AColumnColIndex = -1 then + Items[ARowIndex].Insert(AColIndex, AColumn) + else + if AColIndex = -1 then + Items[ARowIndex].Delete(AColumnColIndex) + else + Items[ARowIndex].Move(AColumnColIndex, AColIndex); +end; + +{ TcxGridBandCustomOptions } + +constructor TcxGridBandCustomOptions.Create(ABand: TcxGridBand); +begin + inherited Create; + FBand := ABand; +end; + +procedure TcxGridBandCustomOptions.Changed(AChange: TcxGridBandChange); +begin + FBand.Changed(AChange); +end; + +procedure TcxGridBandCustomOptions.Assign(Source: TPersistent); +begin + if not (Source is TcxGridBandCustomOptions) then + inherited; +end; + +{ TcxGridBandOptions } + +constructor TcxGridBandOptions.Create(ABand: TcxGridBand); +begin + inherited; + FMoving := True; + FSizing := True; +end; + +procedure TcxGridBandOptions.SetHoldOwnColumnsOnly(Value: Boolean); +begin + if FHoldOwnColumnsOnly <> Value then + begin + FHoldOwnColumnsOnly := Value; + Changed(bcProperty); + end; +end; + +procedure TcxGridBandOptions.SetMoving(Value: Boolean); +begin + if FMoving <> Value then + begin + FMoving := Value; + Changed(bcProperty); + end; +end; + +procedure TcxGridBandOptions.SetSizing(Value: Boolean); +begin + if FSizing <> Value then + begin + FSizing := Value; + Changed(bcProperty); + end; +end; + +procedure TcxGridBandOptions.Assign(Source: TPersistent); +begin + if Source is TcxGridBandOptions then + with TcxGridBandOptions(Source) do + begin + Self.HoldOwnColumnsOnly := HoldOwnColumnsOnly; + Self.Moving := Moving; + Self.Sizing := Sizing; + end; + inherited; +end; + +{ TcxGridBandPosition } + +constructor TcxGridBandPosition.Create(ABand: TcxGridBand); +begin + inherited; + FBandIndex := -1; + FColIndex := -1; +end; + +function TcxGridBandPosition.GetBandIndex: Integer; +begin + if ParentBand = nil then + Result := -1 + else + Result := ParentBand.Index; +end; + +function TcxGridBandPosition.GetColIndex: Integer; +begin + if ParentBand = nil then + Result := FBand.RootIndex + else + Result := ParentBand.ColIndexOf(FBand); +end; + +function TcxGridBandPosition.GetGridView: TcxGridBandedTableView; +begin + Result := FBand.GridView; +end; + +function TcxGridBandPosition.GetParentBand: TcxGridBand; +begin + Result := FBand.ParentBand; +end; + +function TcxGridBandPosition.GetVisibleColIndex: Integer; +begin + if ParentBand = nil then + Result := FBand.VisibleRootIndex + else + Result := ParentBand.VisibleColIndexOf(FBand); +end; + +procedure TcxGridBandPosition.SetBandIndex(Value: Integer); +begin + if not FBand.IsDestroying and ((ParentBand = nil) or not ParentBand.IsDestroying) and + (FBand.IsLoading or FBand.IsUpdating or GridView.IsAssigningBands) then + begin + FBandIndex := Value; + if FBand.IsLoading or GridView.IsAssigningBands then Exit; + end; + if not CheckBandIndex(Value) then Exit; + if BandIndex <> Value then + begin + FBand.SaveVisible; + if not GridView.IsDestroying then + GridView.BeginUpdate; + try + if ParentBand <> nil then + ParentBand.RemoveBand(FBand); + if not GridView.IsDestroying and + (0 <= Value) and (Value < GridView.Bands.Count) then + GridView.Bands[Value].AddBand(FBand); + if not GridView.IsDestroying then + begin + GridView.Bands.RefreshRootItemsList; + GridView.Bands.RefreshVisibleItemsList; + end; + finally + if not GridView.IsDestroying then + GridView.EndUpdate; + FBand.CheckVisible; + Changed(bcProperty); + end; + end; +end; + +procedure TcxGridBandPosition.SetColIndex(Value: Integer); +begin + if FBand.IsLoading or FBand.IsUpdating or GridView.IsAssigningBands then + FColIndex := Value + else + if ColIndex <> Value then + if ParentBand = nil then + FBand.RootIndex := Value + else + begin + ParentBand.MoveBand(FBand, Value); + if FBand.ActuallyVisible then + GridView.Bands.RefreshVisibleBottomItemsList; + Changed(bcSize); + end; +end; + +function TcxGridBandPosition.IsColIndexStored: Boolean; +begin + Result := not Band.IsRoot; +end; + +function TcxGridBandPosition.CheckBandIndex(var Value: Integer): Boolean; +var + ABand: TcxGridBand; + AColIndex, I: Integer; +begin + Result := GridView.IsDestroying; + if Result then Exit; + Result := (Value = -1) or + (0 <= Value) and (Value < GridView.Bands.Count) and (FBand.Index <> Value); + if Result and (Value <> -1) then + begin + ABand := GridView.Bands[Value]; + Result := not ABand.HasAsParent(FBand); + if not Result then + begin + AColIndex := ColIndex; + GridView.BeginUpdate; + try + for I := FBand.ChildBandCount - 1 downto 0 do + with FBand.ChildBands[I].Position do + begin + BandIndex := Self.BandIndex; + ColIndex := AColIndex; + end; + Value := ABand.Index; + Result := True; + finally + GridView.EndUpdate; + end; + end; + end; +end; + +procedure TcxGridBandPosition.SaveParams; +begin + FBandIndex := BandIndex; + FColIndex := ColIndex; +end; + +procedure TcxGridBandPosition.Assign(Source: TPersistent); +begin + if Source is TcxGridBandPosition then + with TcxGridBandPosition(Source) do + begin + Self.BandIndex := BandIndex; + Self.ColIndex := ColIndex; + end; + inherited; +end; + +{ TcxGridBandStyles } + +function TcxGridBandStyles.GetBand: TcxGridBand; +begin + Result := TcxGridBand(GetOwner); +end; + +function TcxGridBandStyles.GetGridViewValue: TcxGridBandedTableView; +begin + Result := TcxGridBandedTableView(inherited GridView); +end; + +procedure TcxGridBandStyles.SetOnGetHeaderStyle(Value: TcxGridBandGetHeaderStyle); +begin + if @FOnGetHeaderStyle <> @Value then + begin + FOnGetHeaderStyle := Value; + Band.Changed(bcProperty); + end; +end; + +procedure TcxGridBandStyles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +begin + case Index of + bsBackground: + GridView.Styles.GetViewParams(vsBandBackground, AData, nil, AParams); + bsContent: + with TcxGridDataCellPos(AData) do + GridView.Styles.GetRecordContentParams(GridRecord, Item, AParams); + bsHeader: + GridView.Styles.GetBandHeaderParams(TcxGridBand(AData), AParams); + else + inherited; + end; +end; + +function TcxGridBandStyles.GetGridView: TcxCustomGridView; +begin + Result := Band.GridView; +end; + +procedure TcxGridBandStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridBandStyles then + with TcxGridBandStyles(Source) do + begin + Self.Background := Background; + Self.Content := Content; + Self.Header := Header; + Self.OnGetHeaderStyle := OnGetHeaderStyle; + end; +end; + +procedure TcxGridBandStyles.GetHeaderParams(out AParams: TcxViewParams); +var + AStyle: TcxStyle; +begin + AStyle := nil; + if Assigned(FOnGetHeaderStyle) then + FOnGetHeaderStyle(GridView, Band, AStyle); + GetViewParams(bsHeader, Band, AStyle, AParams); +end; + +{ TcxGridBand } + +constructor TcxGridBand.Create(Collection: TCollection); +begin + inherited; + FChildBands := TList.Create; + FColumns := TList.Create; + FHeaderAlignmentHorz := taCenter; + FHeaderAlignmentVert := vaCenter; + FOptions := GetOptionsClass.Create(Self); + FPosition := TcxGridBandPosition.Create(Self); + FRows := TcxGridBandRows.Create(Self); + FStyles := GetStylesClass.Create(Self); + FVisible := True; + FVisibleChildBands := TList.Create; + FVisibleForCustomization := True; + Bands.AddItem(Self); +end; + +destructor TcxGridBand.Destroy; +var + ABands: TcxGridBands; + + procedure RemoveBands; + var + AColIndex, I: Integer; + begin + AColIndex := FPosition.ColIndex; + for I := ChildBandCount - 1 downto 0 do + with ChildBands[I].Position do + begin + BandIndex := FPosition.BandIndex; + ColIndex := AColIndex; + end; + end; + + procedure RemoveColumns; + var + I: Integer; + begin + for I := ColumnCount - 1 downto 0 do + Columns[I].Position.BandIndex := -1; + end; + +begin + if not (GridView.IsLoading or GridView.IsDestroying) and GridView.IsDesigning then + GridView.Controller.DesignController.UnselectObject(Self); + FIsDestroying := True; + ABands := Bands; + if not GridView.IsDestroying then + GridView.BeginUpdate; + try + RemoveBands; + RemoveColumns; + FPosition.BandIndex := -1; + finally + if not GridView.IsDestroying then + GridView.CancelUpdate; + end; + FVisibleChildBands.Free; + FStyles.Free; + FRows.Free; + FPosition.Free; + FOptions.Free; + FColumns.Free; + FChildBands.Free; + inherited; + ABands.RemoveItem(Self); +end; + +function TcxGridBand.GetBandLevelIndex: Integer; +var + ABand: TcxGridBand; +begin + Result := 0; + ABand := Self; + while ABand.ParentBand <> nil do + begin + Inc(Result); + ABand := ABand.ParentBand; + end; +end; + +function TcxGridBand.GetBands: TcxGridBands; +begin + Result := TcxGridBands(Collection); +end; + +function TcxGridBand.GetChildBand(Index: Integer): TcxGridBand; +begin + Result := TcxGridBand(FChildBands[Index]); +end; + +function TcxGridBand.GetChildBandCount: Integer; +begin + Result := FChildBands.Count; +end; + +function TcxGridBand.GetChildItem(Index: Integer): TObject; +begin + if IsBottom then + Result := Columns[Index] + else + Result := ChildBands[Index]; +end; + +function TcxGridBand.GetChildItemCount: Integer; +begin + if IsBottom then + Result := ColumnCount + else + Result := ChildBandCount; +end; + +function TcxGridBand.GetChildItemVisible(Index: Integer): Boolean; +var + AChildItem: TObject; +begin + AChildItem := ChildItems[Index]; + if AChildItem is TcxGridBand then + Result := TcxGridBand(AChildItem).SavedVisible + else + Result := TcxGridBandedColumn(AChildItem).SavedVisible; +end; + +function TcxGridBand.GetColumnCount: Integer; +begin + Result := FColumns.Count; +end; + +function TcxGridBand.GetColumn(Index: Integer): TcxGridBandedColumn; +begin + Result := TcxGridBandedColumn(FColumns[Index]); +end; + +function TcxGridBand.GetFirstChildBottomBand: TcxGridBand; +begin + if ChildBandCount = 0 then + Result := Self + else + begin + Result := ChildBands[0]; + while not Result.IsBottom do + Result := Result.ChildBands[0]; + end; +end; + +function TcxGridBand.GetFirstVisibleChildBottomBand: TcxGridBand; +begin + if VisibleChildBandCount = 0 then + Result := Self + else + begin + Result := VisibleChildBands[0]; + while not Result.IsVisibleBottom do + Result := Result.VisibleChildBands[0]; + end; +end; + +function TcxGridBand.GetGridView: TcxGridBandedTableView; +begin + if Bands = nil then + Result := nil + else + Result := Bands.GridView; +end; + +function TcxGridBand.GetHidden: Boolean; +begin + Result := not VisibleForCustomization; +end; + +function TcxGridBand.GetIsBottom: Boolean; +begin + Result := ChildBandCount = 0; +end; + +function TcxGridBand.GetIsEmpty: Boolean; +begin + if IsVisibleBottom then + Result := FRows.VisibleCount = 0 + else + Result := VisibleChildBandCount = 0; +end; + +function TcxGridBand.GetIsFirst: Boolean; +begin + Result := VisibleBottomIndex = 0; +end; + +function TcxGridBand.GetIsFirstNonEmpty: Boolean; +begin + Result := Bands.FirstVisibleNonEmpty = Self; +end; + +function TcxGridBand.GetIsLast: Boolean; +begin + Result := VisibleBottomIndex = Bands.VisibleBottomItemCount - 1; +end; + +function TcxGridBand.GetIsLastAsChild: Boolean; + + function GetVisibleBandCount: Integer; + begin + if FParentBand = nil then + Result := Bands.VisibleRootItemCount + else + Result := FParentBand.VisibleChildBandCount; + end; + +begin + Result := FPosition.VisibleColIndex = GetVisibleBandCount - 1; +end; + +function TcxGridBand.GetIsLastNonEmpty: Boolean; +begin + Result := Bands.LastVisibleNonEmpty = Self; +end; + +function TcxGridBand.GetIsLoading: Boolean; +begin + Result := not FIgnoreLoadingStatus and (GridView <> nil) and GridView.IsLoading; +end; + +function TcxGridBand.GetIsMostRight: Boolean; +begin + if IsRoot then + Result := IsLastAsChild + else + Result := FParentBand.IsMostRight and IsLastAsChild; +end; + +function TcxGridBand.GetIsRoot: Boolean; +begin + Result := FPosition.BandIndex = -1; +end; + +function TcxGridBand.GetIsUpdating: Boolean; +begin + Result := (GridView <> nil) and GridView.IsUpdating; +end; + +function TcxGridBand.GetIsVisibleBottom: Boolean; +begin + Result := VisibleChildBandCount = 0; +end; + +function TcxGridBand.GetMinWidth: Integer; +begin + if HasFixedWidth then + Result := FWidth + else + if IsEmpty then + Result := EmptyBandMinWidth + else + Result := 0; +end; + +function TcxGridBand.GetParentBandWithAssignedWidth: TcxGridBand; +begin + Result := FParentBand; + while Result <> nil do + begin + if Result.Width <> 0 then Break; + Result := Result.ParentBand; + end; +end; + +function TcxGridBand.GetRootIndex: Integer; +begin + if Bands.FRootItems = nil{GridView.IsDestroying} then + Result := -1 + else + Result := Bands.FRootItems.IndexOf(Self); {!!! optimize} +end; + +function TcxGridBand.GetRootParentBand: TcxGridBand; +begin + if IsRoot then + Result := nil + else + Result := GetParentInParent(nil); +end; + +function TcxGridBand.GetVisibleBandLevelCount: Integer; +var + I, AChildLevelCount: Integer; +begin + Result := 0; + for I := 0 to VisibleChildBandCount - 1 do + begin + AChildLevelCount := VisibleChildBands[I].VisibleBandLevelCount; + if Result < AChildLevelCount then Result := AChildLevelCount; + end; + Inc(Result); +end; + +function TcxGridBand.GetVisibleBottomIndex: Integer; +begin + Result := Bands.FVisibleBottomItems.IndexOf(Self); {!!!optimize} +end; + +function TcxGridBand.GetVisibleChildBand(Index: Integer): TcxGridBand; +begin + Result := TcxGridBand(FVisibleChildBands[Index]); +end; + +function TcxGridBand.GetVisibleChildBandCount: Integer; +begin + Result := FVisibleChildBands.Count; +end; + +function TcxGridBand.GetVisibleIndex: Integer; +begin + Result := Bands.FVisibleItems.IndexOf(Self); {!!!optimize} +end; + +function TcxGridBand.GetVisibleRootIndex: Integer; +begin + Result := Bands.FVisibleRootItems.IndexOf(Self); {!!!optimize} +end; + +function TcxGridBand.IsTagStored: Boolean; +begin + Result := Tag <> 0; +end; + +procedure TcxGridBand.SetCaption(const Value: string); +begin + if FCaption <> Value then + begin + FCaption := Value; + Changed(bcLayout); + end; +end; + +procedure TcxGridBand.SetFixedKind(Value: TcxGridBandFixedKind); +var + I: Integer; +begin + if FFixedKind <> Value then + begin + FFixedKind := Value; + GridView.BeginUpdate; + try + for I := 0 to ChildBandCount - 1 do + ChildBands[I].FixedKind := Value; + GridView.RefreshVisibleItemsList; + Bands.RefreshVisibleItemsList; + if not IsRoot and (FFixedKind <> FParentBand.FixedKind) then + FPosition.BandIndex := -1; + Changed(bcProperty); + finally + GridView.EndUpdate; + end; + end; +end; + +procedure TcxGridBand.SetHeaderAlignmentHorz(Value: TAlignment); +begin + if FHeaderAlignmentHorz <> Value then + begin + FHeaderAlignmentHorz := Value; + Changed(bcLayout); + end; +end; + +procedure TcxGridBand.SetHeaderAlignmentVert(Value: TcxAlignmentVert); +begin + if FHeaderAlignmentVert <> Value then + begin + FHeaderAlignmentVert := Value; + Changed(bcLayout); + end; +end; + +procedure TcxGridBand.SetHidden(Value: Boolean); +begin + VisibleForCustomization := not Value; +end; + +procedure TcxGridBand.SetOnHeaderClick(Value: TNotifyEvent); +begin + if @FOnHeaderClick <> @Value then + begin + FOnHeaderClick := Value; + Changed(bcProperty); + end; +end; + +procedure TcxGridBand.SetOnGetStoredProperties(Value: TcxGridBandGetStoredPropertiesEvent); +begin + if @FOnGetStoredProperties <> @Value then + begin + FOnGetStoredProperties := Value; + Changed(bcProperty); + end; +end; + +procedure TcxGridBand.SetOnGetStoredPropertyValue(Value: TcxGridBandGetStoredPropertyValueEvent); +begin + if @FOnGetStoredPropertyValue <> @Value then + begin + FOnGetStoredPropertyValue := Value; + Changed(bcProperty); + end; +end; + +procedure TcxGridBand.SetOnSetStoredPropertyValue(Value: TcxGridBandSetStoredPropertyValueEvent); +begin + if @FOnSetStoredPropertyValue <> @Value then + begin + FOnSetStoredPropertyValue := Value; + Changed(bcProperty); + end; +end; + +procedure TcxGridBand.SetOptions(Value: TcxGridBandOptions); +begin + FOptions.Assign(Value); +end; + +procedure TcxGridBand.SetPosition(Value: TcxGridBandPosition); +begin + FPosition.Assign(Value); +end; + +procedure TcxGridBand.SetRootIndex(Value: Integer); +begin + if not IsRoot or GridView.IsDestroying then Exit; + CheckItemIndexForInsert(Value, Bands.RootItemCount, True); + if RootIndex <> Value then + Index := Bands.RootItems[Value].Index; +end; + +procedure TcxGridBand.SetStyles(Value: TcxGridBandStyles); +begin + FStyles.Assign(Value); +end; + +procedure TcxGridBand.SetTag(Value: TcxTag); +begin + if FTag <> Value then + begin + FTag := Value; + Changed(bcProperty); + end; +end; + +procedure TcxGridBand.SetVisible(Value: Boolean); +{var + APrevParentIsVisibleBottom: Boolean;} +begin + if FVisible <> Value then + begin + GridView.BeginUpdate; + try + // APrevParentIsVisibleBottom := (FParentBand <> nil) and FParentBand.IsVisibleBottom; + SaveVisible; + FVisible := Value; + if FParentBand <> nil then + FParentBand.RefreshVisibleChildBandsList; + GridView.RefreshVisibleItemsList; + Bands.RefreshVisibleItemsList; + {if APrevParentIsVisibleBottom then + FParentBand.MoveColumns(Self);} + CheckVisible; + GridView.RefreshCustomizationForm; + Changed(bcProperty); + finally + GridView.EndUpdate; + end; + end; +end; + +procedure TcxGridBand.SetVisibleForCustomization(Value: Boolean); +begin + if FVisibleForCustomization <> Value then + begin + FVisibleForCustomization := Value; + VisibleForCustomizationChanged; + end; +end; + +procedure TcxGridBand.SetWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FWidth <> Value then + begin + FWidth := Value; + Changed(bcSize); + end; +end; + +procedure TcxGridBand.ReadHidden(Reader: TReader); +begin + Hidden := Reader.ReadBoolean; +end; + +procedure TcxGridBand.AddBand(ABand: TcxGridBand); +var + APrevIsBottom{, APrevIsVisibleBottom}: Boolean; +begin + APrevIsBottom := IsBottom; + //APrevIsVisibleBottom := IsVisibleBottom; + SaveColumnsVisibles; + ABand.FParentBand := Self; + FChildBands.Add(ABand); + RefreshVisibleChildBandsList; + if APrevIsBottom then + begin + Bands.RefreshBottomItemsList; + MoveColumns(FirstChildBottomBand); + end + {else + if APrevIsVisibleBottom and not IsVisibleBottom then + MoveColumns(FirstVisibleChildBottomBand)}; + ABand.FixedKind := FFixedKind; +end; + +procedure TcxGridBand.RemoveBand(ABand: TcxGridBand); +begin + ABand.FParentBand := nil; + FChildBands.Remove(ABand); + RefreshVisibleChildBandsList; + if IsBottom then + Bands.RefreshBottomItemsList; +end; + +procedure TcxGridBand.RefreshVisibleChildBandsList; +var + I: Integer; + ABand: TcxGridBand; +begin + FVisibleChildBands.Clear; + for I := 0 to ChildBandCount - 1 do + begin + ABand := ChildBands[I]; + if ABand.Visible then FVisibleChildBands.Add(ABand); + end; +end; + +procedure TcxGridBand.AddColumn(AColumn: TcxGridBandedColumn); +begin + FColumns.Add(AColumn); + AColumn.Position.SetBand(Self); + AColumn.Position.RowIndex := 0; +end; + +procedure TcxGridBand.RemoveColumn(AColumn: TcxGridBandedColumn); +begin + MoveColumn(AColumn, -1, -1); + AColumn.Position.SetBand(nil); + FColumns.Remove(AColumn); +end; + +procedure TcxGridBand.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('Hidden', ReadHidden, nil, True); +end; + +function TcxGridBand.QueryInterface(const IID: TGUID; out Obj): HResult; +const + E_NOINTERFACE = HResult($80004002); +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +function TcxGridBand._AddRef: Integer; +begin + Result := -1; +end; + +function TcxGridBand._Release: Integer; +begin + Result := -1; +end; + +function TcxGridBand.GetObjectName: string; +begin + Result := 'Band' + IntToStr(ID{Index}); +end; + +function TcxGridBand.GetProperties(AProperties: TStrings): Boolean; +begin + with AProperties do + begin + Add('Width'); + Add('Visible'); + Add('Index'); + Add('BandIndex'); + Add('ColIndex'); + end; + if Assigned(FOnGetStoredProperties) then + FOnGetStoredProperties(Self, AProperties); + Result := True; +end; + +procedure TcxGridBand.GetPropertyValue(const AName: string; var AValue: Variant); +begin + if AName = 'Width' then + AValue := Width + else + if AName = 'Visible' then + AValue := Visible + else + if AName = 'Index' then + AValue := Index + else + if AName = 'BandIndex' then + AValue := FPosition.BandIndex + else + if AName = 'ColIndex' then + AValue := FPosition.ColIndex + else + if Assigned(FOnGetStoredPropertyValue) then + FOnGetStoredPropertyValue(Self, AName, AValue); +end; + +procedure TcxGridBand.SetPropertyValue(const AName: string; const AValue: Variant); +begin + if AName = 'Width' then + Width := AValue + else + if AName = 'Visible' then + Visible := AValue + else + if AName = 'Index' then + Index := AValue + else + if AName = 'BandIndex' then + FPosition.FBandIndex := AValue + else + if AName = 'ColIndex' then + FPosition.FColIndex := AValue + else + if Assigned(FOnSetStoredPropertyValue) then + FOnSetStoredPropertyValue(Self, AName, AValue); +end; + +procedure TcxGridBand.AssignChildBandWidths; +begin + GridView.ViewInfo.HeaderViewInfo.BandsViewInfo[VisibleIndex].AssignChildBandWidths; +end; + +procedure TcxGridBand.AssignColumnWidths; +begin + GridView.ViewInfo.HeaderViewInfo.BandsViewInfo[VisibleIndex].AssignColumnWidths; +end; + +function TcxGridBand.CanHide: Boolean; +begin + Result := (Bands.VisibleRootItemCount > 1) or not IsRoot; +end; + +function TcxGridBand.CanMove: Boolean; +begin + Result := GridView.IsDesigning or GridView.OptionsCustomize.BandMoving and FOptions.Moving; +end; + +function TcxGridBand.CanSize: Boolean; +begin + Result := not HasFixedWidth and GridView.OptionsCustomize.BandSizing; +end; + +procedure TcxGridBand.Changed(AChange: TcxGridBandChange); +begin + if GridView <> nil then + GridView.Changed(TcxGridViewChangeKind(AChange)); +end; + +procedure TcxGridBand.ForceWidth(Value: Integer); + + procedure AssignBandWidths; + + procedure AssignBandWidths; + var + ABand: TcxGridBand; + begin + ABand := FParentBand; + while ABand <> nil do + begin + ABand.AssignChildBandWidths; + ABand := ABand.ParentBand; + end; + GridView.ViewInfo.HeaderViewInfo.BandsViewInfo.AssignRootItemWidths; + end; + + begin + with GridView do + begin + BeginUpdate; + try + if HasParentWithAssignedWidth then + FParentBand.AssignChildBandWidths; + if OptionsView.ColumnAutoWidth then + AssignBandWidths; + finally + EndUpdate; + end; + end; + end; + +begin + AssignBandWidths; + GridView.Controller.ForcingWidthBand := Self; + try + Width := Value; + finally + GridView.Controller.ForcingWidthBand := nil; + end; + AssignBandWidths; + Changed(bcSize); +end; + +function TcxGridBand.GetActuallyVisible: Boolean; +begin + Result := FVisible and ((FParentBand = nil) or FParentBand.ActuallyVisible); +end; + +function TcxGridBand.GetDisplayName: string; +begin + Result := Caption; + if Result = '' then + Result := ''; +end; + +function TcxGridBand.GetFixed: Boolean; +begin + with GridView.Controller do + Result := HasFixedWidth or + (ForcingWidthBand <> nil) and IsBandFixedDuringSizing(Self) or + (ForcingWidthItem <> nil) and + (TcxGridBandedColumn(ForcingWidthItem).Position.Band.ParentBandWithAssignedWidth = Self); +end; + +function TcxGridBand.GetParentInParent(ABand: TcxGridBand): TcxGridBand; +var + AParentBand: TcxGridBand; + AFound: Boolean; +begin + AParentBand := Self; + repeat + Result := AParentBand; + AParentBand := AParentBand.ParentBand; + AFound := AParentBand = ABand; + until (AParentBand = nil) or AFound; + if not AFound then Result := nil; +end; + +function TcxGridBand.HasFixedWidth: Boolean; +begin + Result := not FOptions.Sizing; +end; + +function TcxGridBand.HasParentWithAssignedWidth: Boolean; +begin + Result := ParentBandWithAssignedWidth <> nil; +end; + +function TcxGridBand.ColIndexOf(ABand: TcxGridBand): Integer; +begin + Result := FChildBands.IndexOf(ABand); +end; + +procedure TcxGridBand.MoveBandsToRoot; +var + AColIndex, I: Integer; +begin + if RootParentBand = nil then + AColIndex := FPosition.ColIndex + 1 + else + AColIndex := RootParentBand.Position.ColIndex + 1; + GridView.BeginUpdate; + try + for I := ChildBandCount - 1 downto 0 do + with ChildBands[I].Position do + begin + BandIndex := -1; + ColIndex := AColIndex; + end; + finally + GridView.EndUpdate; + end; +end; + +procedure TcxGridBand.SetIndex(Value: Integer); +var + APrevIndex: Integer; +begin + APrevIndex := Index; + inherited; + if Index <> APrevIndex then + begin + if Visible then Bands.RefreshVisibleItemsList; + Bands.RefreshRootItemsList; + Bands.RefreshBottomItemsList; + Changed(bcProperty); + end; +end; + +function TcxGridBand.VisibleColIndexOf(ABand: TcxGridBand): Integer; +begin + Result := FVisibleChildBands.IndexOf(ABand); +end; + +procedure TcxGridBand.VisibleForCustomizationChanged; +begin + GridView.RefreshCustomizationForm; + Changed(bcProperty); +end; + +procedure TcxGridBand.CheckChildrenVisibles; +var + I: Integer; + AChildItem: TObject; +begin + for I := 0 to ChildItemCount - 1 do + begin + AChildItem := ChildItems[I]; + if AChildItem is TcxGridBand then + TcxGridBand(AChildItem).CheckVisible + else + TcxGridBandedColumn(AChildItem).CheckVisible; + end; +end; + +procedure TcxGridBand.CheckVisible; +begin + if ActuallyVisible <> FSavedVisible then + begin + Bands.BandVisibilityChanged(Self, ActuallyVisible); + CheckChildrenVisibles; + end; +end; + +procedure TcxGridBand.SaveChildrenVisibles; +var + I: Integer; + AChildItem: TObject; +begin + for I := 0 to ChildItemCount - 1 do + begin + AChildItem := ChildItems[I]; + if AChildItem is TcxGridBand then + TcxGridBand(AChildItem).SaveVisible + else + TcxGridBandedColumn(AChildItem).SaveVisible; + end; +end; + +procedure TcxGridBand.SaveColumnsVisibles; +var + I: Integer; +begin + for I := 0 to ColumnCount - 1 do + Columns[I].SaveVisible; +end; + +procedure TcxGridBand.SaveVisible; +begin + FSavedVisible := ActuallyVisible; + SaveChildrenVisibles; +end; + +function TcxGridBand.GetOptionsClass: TcxGridBandOptionsClass; +begin + Result := TcxGridBandOptions; +end; + +function TcxGridBand.GetStylesClass: TcxGridBandStylesClass; +begin + Result := TcxGridBandStyles; +end; + +procedure TcxGridBand.DoHeaderClick; +begin + if Assigned(FOnHeaderClick) then FOnHeaderClick(Self); +end; + +procedure TcxGridBand.Assign(Source: TPersistent); +begin + if Source is TcxGridBand then + with TcxGridBand(Source) do + begin + Self.HeaderAlignmentHorz := HeaderAlignmentHorz; + Self.HeaderAlignmentVert := HeaderAlignmentVert; + Self.Caption := Caption; + Self.FixedKind := FixedKind; + Self.Options := Options; + Self.Position := Position; + Self.Styles := Styles; + Self.Tag := Tag; + Self.Visible := Visible; + Self.VisibleForCustomization := VisibleForCustomization; + Self.Width := Width; + Self.OnHeaderClick := OnHeaderClick; + Self.OnGetStoredProperties := OnGetStoredProperties; + Self.OnGetStoredPropertyValue := OnGetStoredPropertyValue; + Self.OnSetStoredPropertyValue := OnSetStoredPropertyValue; + end + else + inherited; +end; + +procedure TcxGridBand.ApplyBestFit(ACheckSizingAbility: Boolean = False; + AFireEvents: Boolean = False); +var + I, ABestFitWidth: Integer; + AViewInfo: TcxGridBandViewInfo; +begin + if ACheckSizingAbility and not CanSize then Exit; + Width := 0; + if IsBottom then + FRows.ApplyBestFit(ACheckSizingAbility, AFireEvents) + else + for I := 0 to VisibleChildBandCount - 1 do + VisibleChildBands[I].ApplyBestFit(ACheckSizingAbility, AFireEvents); + if GridView.OptionsView.BandHeaders and ActuallyVisible then + begin + AViewInfo := GridView.ViewInfo.HeaderViewInfo.BandsViewInfo[VisibleIndex]; + ABestFitWidth := AViewInfo.HeaderViewInfo.GetBestFitWidth; + if ABestFitWidth > AViewInfo.ContentWidth then + ForceWidth(ABestFitWidth); + end; + GridView.Controller.DesignerModified; +end; + +function TcxGridBand.HasAsParent(ABand: TcxGridBand): Boolean; +begin + Result := GetParentInParent(ABand) <> nil; +end; + +procedure TcxGridBand.MoveBand(ABand: TcxGridBand; AColIndex: Integer); +begin + ABand.Position.BandIndex := Index; + CheckItemIndexForInsert(AColIndex, FChildBands.Count, True); + FChildBands.Move(ABand.Position.ColIndex, AColIndex); + RefreshVisibleChildBandsList; +end; + +procedure TcxGridBand.MoveColumn(AColumn: TcxGridBandedColumn; ARowIndex, AColIndex: Integer); +begin + AColumn.Position.BandIndex := Index; + FRows.MoveColumn(AColumn, ARowIndex, AColIndex); +end; + +procedure TcxGridBand.MoveColumns(ABand: TcxGridBand); +var + I, J: Integer; +begin + if ABand = nil then Exit; + for I := 0 to Rows.Count - 1 do + for J := 0 to Rows[0].Count - 1 do + ABand.MoveColumn(Rows[0][0], I, J); +end; + +{ TcxGridBands } + +constructor TcxGridBands.Create(AGridView: TcxGridBandedTableView); +begin + inherited Create(AGridView, GetBandClass); + FGridView := AGridView; + FBottomItems := TList.Create; + FRootItems := TList.Create; + FVisibleBottomItems := TList.Create; + FVisibleItems := TList.Create; + FVisibleRootItems := TList.Create; +end; + +destructor TcxGridBands.Destroy; +begin + FreeAndNil(FVisibleRootItems); + FreeAndNil(FVisibleItems); + FreeAndNil(FVisibleBottomItems); + FreeAndNil(FRootItems); + FreeAndNil(FBottomItems); + inherited; +end; + +function TcxGridBands.GetBottomItem(Index: Integer): TcxGridBand; +begin + Result := TcxGridBand(FBottomItems[Index]); +end; + +function TcxGridBands.GetBottomItemCount: Integer; +begin + Result := FBottomItems.Count; +end; + +function TcxGridBands.GetFirstVisibleNonEmpty: TcxGridBand; +var + I: Integer; +begin + for I := 0 to VisibleBottomItemCount - 1 do + begin + Result := VisibleBottomItems[I]; + if Result.Rows.VisibleCount <> 0 then Exit; + end; + Result := nil; +end; + +function TcxGridBands.GetItem(Index: Integer): TcxGridBand; +begin + Result := TcxGridBand(inherited GetItem(Index)); +end; + +function TcxGridBands.GetLastVisibleNonEmpty: TcxGridBand; +var + I: Integer; +begin + for I := VisibleBottomItemCount - 1 downto 0 do + begin + Result := VisibleBottomItems[I]; + if Result.Rows.VisibleCount <> 0 then Exit; + end; + Result := nil; +end; + +function TcxGridBands.GetLayout: TcxGridBandsLayout; +begin + if (VisibleLeftFixedCount <> 0) and (VisibleRightFixedCount <> 0) then + Result := blLeftRightFixed + else + if VisibleLeftFixedCount <> 0 then + Result := blLeftFixed + else + if VisibleRightFixedCount <> 0 then + Result := blRightFixed + else + Result := blNonFixed; +end; + +function TcxGridBands.GetLineCount: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to VisibleBottomItemCount - 1 do + Result := Max(Result, VisibleBottomItems[I].Rows.LineCount); +end; + +function TcxGridBands.GetRootItem(Index: Integer): TcxGridBand; +begin + Result := TcxGridBand(FRootItems[Index]); +end; + +function TcxGridBands.GetRootItemCount: Integer; +begin + Result := FRootItems.Count; +end; + +function TcxGridBands.GetVisibleBottomItem(Index: Integer): TcxGridBand; +begin + Result := TcxGridBand(FVisibleBottomItems[Index]); +end; + +function TcxGridBands.GetVisibleBottomItemCount: Integer; +begin + Result := FVisibleBottomItems.Count; +end; + +function TcxGridBands.GetVisibleCount: Integer; +begin + Result := FVisibleItems.Count; +end; + +function TcxGridBands.GetVisibleItem(Index: Integer): TcxGridBand; +begin + Result := TcxGridBand(FVisibleItems[Index]); +end; + +function TcxGridBands.GetVisibleRootItem(Index: Integer): TcxGridBand; +begin + Result := TcxGridBand(FVisibleRootItems[Index]); +end; + +function TcxGridBands.GetVisibleRootItemCount: Integer; +begin + Result := FVisibleRootItems.Count; +end; + +function TcxGridBands.GetVisibleRowCount: Integer; +var + I, ACount: Integer; +begin + Result := 0; + for I := 0 to VisibleBottomItemCount - 1 do + begin + ACount := VisibleBottomItems[I].Rows.VisibleCount; + if ACount > Result then Result := ACount; + end; +end; + +procedure TcxGridBands.SetItem(Index: Integer; Value: TcxGridBand); +begin + inherited SetItem(Index, Value); +end; + +procedure TcxGridBands.AddItem(AItem: TcxGridBand); +begin + AItem.FID := GetNextID; + RefreshVisibleItemsList; + RefreshRootItemsList; + RefreshBottomItemsList; + GridView.RefreshCustomizationForm; + GridView.Synchronize; +end; + +procedure TcxGridBands.RemoveItem(AItem: TcxGridBand); +begin + ReleaseID(AItem.ID); + RefreshVisibleItemsList; + RefreshRootItemsList; + RefreshBottomItemsList; + GridView.RefreshCustomizationForm; + GridView.Synchronize; +end; + +procedure TcxGridBands.RefreshBottomItemsList; +var + I: Integer; + AItem: TcxGridBand; +begin + if FBottomItems = nil then Exit; + FBottomItems.Clear; + for I := 0 to Count - 1 do + begin + AItem := Items[I]; + if AItem.IsBottom then FBottomItems.Add(AItem); + end; +end; + +procedure TcxGridBands.RefreshRootItemsList; +var + I: Integer; + AItem: TcxGridBand; +begin + if FRootItems = nil then Exit; + FRootItems.Clear; + for I := 0 to Count - 1 do + begin + AItem := Items[I]; + if AItem.IsRoot then FRootItems.Add(AItem); + end; +end; + +procedure TcxGridBands.RefreshVisibleBottomItemsList; +var + I: Integer; + + procedure AddBottomItems(ABand: TcxGridBand); + var + I: Integer; + begin + if ABand.IsVisibleBottom then + FVisibleBottomItems.Add(ABand) + else + for I := 0 to ABand.VisibleChildBandCount - 1 do + AddBottomItems(ABand.VisibleChildBands[I]); + end; + +begin + if FVisibleBottomItems = nil then Exit; + FVisibleBottomItems.Clear; + for I := 0 to VisibleRootItemCount - 1 do + AddBottomItems(VisibleRootItems[I]); +end; + +procedure TcxGridBands.RefreshVisibleItemsList; +var + I: Integer; +begin + if FVisibleItems = nil then Exit; + FVisibleItems.Clear; + FVisibleLeftFixedCount := 0; + FVisibleRightFixedCount := 0; + for I := 0 to Count - 1 do + if Items[I].ActuallyVisible then + begin + FVisibleItems.Add(Items[I]); + case Items[I].FixedKind of + fkNone: + FVisibleItems.Move(VisibleCount - 1, VisibleCount - 1 - FVisibleRightFixedCount); + fkLeft: + begin + FVisibleItems.Move(VisibleCount - 1, FVisibleLeftFixedCount); + Inc(FVisibleLeftFixedCount); + end; + fkRight: + Inc(FVisibleRightFixedCount); + end; + end; + RefreshVisibleRootItemsList; + RefreshVisibleBottomItemsList; + GridView.SizeChanged; +end; + +procedure TcxGridBands.RefreshVisibleRootItemsList; +var + I: Integer; + AItem: TcxGridBand; +begin + if FVisibleRootItems = nil then Exit; + FVisibleRootItems.Clear; + FVisibleRootLeftFixedCount := 0; + FVisibleRootRightFixedCount := 0; + for I := 0 to VisibleCount - 1 do + begin + AItem := VisibleItems[I]; + if AItem.IsRoot then + begin + FVisibleRootItems.Add(AItem); + case AItem.FixedKind of + fkLeft: + Inc(FVisibleRootLeftFixedCount); + fkRight: + Inc(FVisibleRootRightFixedCount); + end; + end; + end; +end; + +function TcxGridBands.QueryInterface(const IID: TGUID; out Obj): HResult; +const + E_NOINTERFACE = HResult($80004002); +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +function TcxGridBands._AddRef: Integer; +begin + Result := -1; +end; + +function TcxGridBands._Release: Integer; +begin + Result := -1; +end; + +function TcxGridBands.GetObjectName: string; +begin + Result := 'Bands'; +end; + +function TcxGridBands.GetProperties(AProperties: TStrings): Boolean; +begin + Result := True; +end; + +procedure TcxGridBands.GetPropertyValue(const AName: string; var AValue: Variant); +begin +end; + +procedure TcxGridBands.SetPropertyValue(const AName: string; const AValue: Variant); +begin +end; + +function TcxGridBands.CreateChild(const AObjectName, AClassName: string): TObject; +begin + if AClassName = 'TcxGridBand' then + Result := Add + else + Result := nil; +end; + +procedure TcxGridBands.DeleteChild(const AObjectName: string; AObject: TObject); +begin + AObject.Free; +end; + +procedure TcxGridBands.GetChildren(AChildren: TStringList); +var + I: Integer; +begin + for I := 0 to Count - 1 do + AChildren.AddObject('', Items[I]); +end; + +procedure TcxGridBands.BandVisibilityChanged(ABand: TcxGridBand; Value: Boolean); +begin +end; + +function TcxGridBands.GetBandClass: TcxGridBandClass; +begin + Result := TcxGridBand; +end; + +function TcxGridBands.GetNextID: Integer; +begin + Result := FNextID; + Inc(FNextID); +end; + +procedure TcxGridBands.ReleaseID(AID: Integer); +begin + if AID = FNextID - 1 then Dec(FNextID); +end; + +function TcxGridBands.Add: TcxGridBand; +begin + Result := TcxGridBand(inherited Add); +end; + +function TcxGridBands.AreNested: Boolean; +begin + Result := Count <> BottomItemCount; +end; + +procedure TcxGridBands.Assign(Source: TPersistent); +var + I: Integer; + ASource: TcxGridBands; + AItem: TcxGridBand; +begin + ASource := Source as TcxGridBands; + GridView.BeginAssignBands; + try + for I := 0 to ASource.Count - 1 do + begin + AItem := FindItemID(ASource[I].ID); + if AItem = nil then + begin + AItem := Add; + AItem.FID := ASource[I].ID; + end; + AItem.Index := I; + AItem.Assign(ASource[I]); + end; + for I := Count - 1 downto ASource.Count do + Delete(I); + finally + GridView.EndAssignBands; + end; + FNextID := ASource.NextID; +end; + +procedure TcxGridBands.Clear; +begin + inherited; + FNextID := 0; +end; + +function TcxGridBands.FindItemID(AID: Integer): TcxGridBand; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I]; + if Result.ID = AID then Exit; + end; + Result := nil; +end; + +function TcxGridBands.GetFirstVisibleIndex(AFixedKind: TcxGridBandFixedKind): Integer; +begin + case AFixedKind of + fkLeft: + Result := 0; + fkNone: + Result := VisibleLeftFixedCount; + fkRight: + Result := VisibleCount - VisibleRightFixedCount; + else + Result := -1; + end; +end; + +function TcxGridBands.GetFirstVisibleRootIndex(AFixedKind: TcxGridBandFixedKind): Integer; +begin + case AFixedKind of + fkLeft: + Result := 0; + fkNone: + Result := VisibleRootLeftFixedCount; + fkRight: + Result := VisibleRootItemCount - VisibleRootRightFixedCount; + else + Result := -1; + end; +end; + +function TcxGridBands.GetLastVisibleIndex(AFixedKind: TcxGridBandFixedKind): Integer; +begin + case AFixedKind of + fkLeft: + Result := GetFirstVisibleIndex(fkNone) - 1; + fkNone: + Result := GetFirstVisibleIndex(fkRight) - 1; + fkRight: + Result := VisibleCount - 1; + else + Result := -1; + end; +end; + +function TcxGridBands.GetLastVisibleRootIndex(AFixedKind: TcxGridBandFixedKind): Integer; +begin + case AFixedKind of + fkLeft: + Result := GetFirstVisibleRootIndex(fkNone) - 1; + fkNone: + Result := GetFirstVisibleRootIndex(fkRight) - 1; + fkRight: + Result := VisibleRootItemCount - 1; + else + Result := -1; + end; +end; + +function TcxGridBands.HaveFixedItems: Boolean; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I].FixedKind <> fkNone; + if Result then Exit; + end; + Result := False; +end; + +{ TcxGridBandedTableBackgroundBitmaps } + +function TcxGridBandedTableBackgroundBitmaps.GetBitmapStyleIndex(Index: Integer): Integer; +begin + case Index of + bbBandBackground: + Result := vsBandBackground; + bbBandHeader: + Result := vsBandHeader; + else + Result := inherited GetBitmapStyleIndex(Index); + end; +end; + +procedure TcxGridBandedTableBackgroundBitmaps.Assign(Source: TPersistent); +begin + if Source is TcxGridBandedTableBackgroundBitmaps then + with TcxGridBandedTableBackgroundBitmaps(Source) do + begin + Self.BandBackground := BandBackground; + Self.BandHeader := BandHeader; + end; + inherited; +end; + +{ TcxGridBandedTableOptionsBehavior } + +constructor TcxGridBandedTableOptionsBehavior.Create(AGridView: TcxCustomGridView); +begin + inherited; + FBandHeaderHints := True; +end; + +procedure TcxGridBandedTableOptionsBehavior.SetBandHeaderHints(Value: Boolean); +begin + if FBandHeaderHints <> Value then + begin + FBandHeaderHints := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridBandedTableOptionsBehavior.Assign(Source: TPersistent); +begin + if Source is TcxGridBandedTableOptionsBehavior then + with TcxGridBandedTableOptionsBehavior(Source) do + Self.BandHeaderHints := BandHeaderHints; + inherited; +end; + +{ TcxGridBandedTableOptionsCustomize } + +constructor TcxGridBandedTableOptionsCustomize.Create(AGridView: TcxCustomGridView); +begin + inherited; + FBandMoving := True; + FBandSizing := True; + FColumnVertSizing := True; + FNestedBands := True; +end; + +function TcxGridBandedTableOptionsCustomize.GetGridView: TcxGridBandedTableView; +begin + Result := TcxGridBandedTableView(inherited GridView); +end; + +procedure TcxGridBandedTableOptionsCustomize.SetBandHiding(Value: Boolean); +begin + if FBandHiding <> Value then + begin + FBandHiding := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridBandedTableOptionsCustomize.SetBandMoving(Value: Boolean); +begin + if FBandMoving <> Value then + begin + FBandMoving := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridBandedTableOptionsCustomize.SetBandSizing(Value: Boolean); +begin + if FBandSizing <> Value then + begin + FBandSizing := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridBandedTableOptionsCustomize.SetBandsQuickCustomization(Value: Boolean); +begin + if FBandsQuickCustomization <> Value then + begin + FBandsQuickCustomization := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridBandedTableOptionsCustomize.SetBandsQuickCustomizationMaxDropDownCount(Value: Integer); +begin + if Value < 0 then Value := 0; + if FBandsQuickCustomizationMaxDropDownCount <> Value then + begin + FBandsQuickCustomizationMaxDropDownCount := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridBandedTableOptionsCustomize.SetBandsQuickCustomizationReordering(Value: TcxGridQuickCustomizationReordering); +begin + if FBandsQuickCustomizationReordering <> Value then + begin + FBandsQuickCustomizationReordering := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridBandedTableOptionsCustomize.SetColumnVertSizing(Value: Boolean); +begin + if FColumnVertSizing <> Value then + begin + FColumnVertSizing := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridBandedTableOptionsCustomize.SetNestedBands(Value: Boolean); +begin + if FNestedBands <> Value then + begin + FNestedBands := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridBandedTableOptionsCustomize.Assign(Source: TPersistent); +begin + if Source is TcxGridBandedTableOptionsCustomize then + with TcxGridBandedTableOptionsCustomize(Source) do + begin + Self.BandHiding := BandHiding; + Self.BandMoving := BandMoving; + Self.BandSizing := BandSizing; + Self.BandsQuickCustomization := BandsQuickCustomization; + Self.BandsQuickCustomizationMaxDropDownCount := BandsQuickCustomizationMaxDropDownCount; + Self.BandsQuickCustomizationReordering := BandsQuickCustomizationReordering; + Self.ColumnVertSizing := ColumnVertSizing; + Self.NestedBands := NestedBands; + end; + inherited; +end; + +function TcxGridBandedTableOptionsCustomize.SupportsBandsQuickCustomizationReordering: Boolean; +begin + Result := not GridView.Bands.AreNested and not GridView.Bands.HaveFixedItems and + (GridView.IsDesigning or + (BandsQuickCustomizationReordering = qcrEnabled) or + (BandsQuickCustomizationReordering = qcrDefault) and BandMoving); +end; + +function TcxGridBandedTableOptionsCustomize.SupportsItemsQuickCustomizationReordering: Boolean; +begin + Result := False; +end; + +{ TcxGridBandedTableOptionsView } + +constructor TcxGridBandedTableOptionsView.Create(AGridView: TcxCustomGridView); +begin + inherited; + FBandHeaderLineCount := 1; + FBandHeaders := True; + FFixedBandSeparatorColor := clDefault; + FFixedBandSeparatorWidth := cxGridDefaultFixedBandSeparatorWidth; +end; + +function TcxGridBandedTableOptionsView.GetGridView: TcxGridBandedTableView; +begin + Result := TcxGridBandedTableView(inherited GridView); +end; + +procedure TcxGridBandedTableOptionsView.SetBandCaptionsInColumnAlternateCaption(Value: Boolean); +begin + if FBandCaptionsInColumnAlternateCaption <> Value then + begin + FBandCaptionsInColumnAlternateCaption := Value; + GridView.ItemCaptionChanged(nil); + end; +end; + +procedure TcxGridBandedTableOptionsView.SetBandHeaderEndEllipsis(Value: Boolean); +begin + if FBandHeaderEndEllipsis <> Value then + begin + FBandHeaderEndEllipsis := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridBandedTableOptionsView.SetBandHeaderHeight(Value: Integer); +begin + if Value < 0 then Value := 0; + if FBandHeaderHeight <> Value then + begin + FBandHeaderHeight := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridBandedTableOptionsView.SetBandHeaderLineCount(Value: Integer); +begin + if Value < 1 then Value := 1; + if FBandHeaderLineCount <> Value then + begin + FBandHeaderLineCount := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridBandedTableOptionsView.SetBandHeaders(Value: Boolean); +begin + if FBandHeaders <> Value then + begin + FBandHeaders := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridBandedTableOptionsView.SetFixedBandSeparatorColor(Value: TColor); +begin + if FFixedBandSeparatorColor <> Value then + begin + FFixedBandSeparatorColor := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridBandedTableOptionsView.SetFixedBandSeparatorWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FFixedBandSeparatorWidth <> Value then + begin + FFixedBandSeparatorWidth := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridBandedTableOptionsView.Assign(Source: TPersistent); +begin + if Source is TcxGridBandedTableOptionsView then + with TcxGridBandedTableOptionsView(Source) do + begin + Self.BandCaptionsInColumnAlternateCaption := BandCaptionsInColumnAlternateCaption; + Self.BandHeaderEndEllipsis := BandHeaderEndEllipsis; + Self.BandHeaderHeight := BandHeaderHeight; + Self.BandHeaderLineCount := BandHeaderLineCount; + Self.BandHeaders := BandHeaders; + Self.FixedBandSeparatorColor := FixedBandSeparatorColor; + Self.FixedBandSeparatorWidth := FixedBandSeparatorWidth; + end; + inherited; +end; + +function TcxGridBandedTableOptionsView.GetFixedBandSeparatorColor: TColor; +begin + Result := FFixedBandSeparatorColor; + if Result = clDefault then + Result := LookAndFeelPainter.DefaultFixedSeparatorColor; +end; + +{ TcxGridBandedTableViewStyles } + +function TcxGridBandedTableViewStyles.GetGridViewValue: TcxGridBandedTableView; +begin + Result := TcxGridBandedTableView(inherited GridView); +end; + +procedure TcxGridBandedTableViewStyles.SetOnGetBandHeaderStyle(Value: TcxGridBandGetHeaderStyle); +begin + if @FOnGetBandHeaderStyle <> @Value then + begin + FOnGetBandHeaderStyle := Value; + GridView.Changed(vcProperty); + end; +end; + +procedure TcxGridBandedTableViewStyles.GetDefaultViewParams(Index: Integer; + AData: TObject; out AParams: TcxViewParams); +begin + inherited; + with AParams, LookAndFeelPainter do + case Index of + vsBandBackground: + begin + Color := DefaultHeaderBackgroundColor; + TextColor := DefaultHeaderBackgroundTextColor; + end; + vsBandHeader: + begin + Color := DefaultHeaderColor; + TextColor := DefaultHeaderTextColor; + end; + end; +end; + +procedure TcxGridBandedTableViewStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridBandedTableViewStyles then + with TcxGridBandedTableViewStyles(Source) do + begin + Self.BandBackground := BandBackground; + Self.BandHeader := BandHeader; + Self.OnGetBandHeaderStyle := OnGetBandHeaderStyle; + end; +end; + +procedure TcxGridBandedTableViewStyles.GetBandHeaderParams(ABand: TcxGridBand; + out AParams: TcxViewParams); +var + AStyle: TcxStyle; +begin + AStyle := nil; + if Assigned(FOnGetBandHeaderStyle) then + FOnGetBandHeaderStyle(GridView, ABand, AStyle); + GetViewParams(vsBandHeader, ABand, AStyle, AParams); +end; + +{ TcxGridBandedTableViewStyleSheet } + +function TcxGridBandedTableViewStyleSheet.GetStylesValue: TcxGridBandedTableViewStyles; +begin + Result := TcxGridBandedTableViewStyles(GetStyles); +end; + +procedure TcxGridBandedTableViewStyleSheet.SetStylesValue(Value: TcxGridBandedTableViewStyles); +begin + SetStyles(Value); +end; + +class function TcxGridBandedTableViewStyleSheet.GetStylesClass: TcxCustomStylesClass; +begin + Result := TcxGridBandedTableViewStyles; +end; + +{ TcxGridBandedTableView } + +function TcxGridBandedTableView.GetBackgroundBitmaps: TcxGridBandedTableBackgroundBitmaps; +begin + Result := TcxGridBandedTableBackgroundBitmaps(inherited BackgroundBitmaps); +end; + +function TcxGridBandedTableView.GetColumn(Index: Integer): TcxGridBandedColumn; +begin + Result := TcxGridBandedColumn(inherited Columns[Index]); +end; + +function TcxGridBandedTableView.GetController: TcxGridBandedTableController; +begin + Result := TcxGridBandedTableController(inherited Controller); +end; + +function TcxGridBandedTableView.GetGroupedColumn(Index: Integer): TcxGridBandedColumn; +begin + Result := TcxGridBandedColumn(inherited GroupedColumns[Index]); +end; + +function TcxGridBandedTableView.GetOptionsBehavior: TcxGridBandedTableOptionsBehavior; +begin + Result := TcxGridBandedTableOptionsBehavior(inherited OptionsBehavior); +end; + +function TcxGridBandedTableView.GetOptionsCustomize: TcxGridBandedTableOptionsCustomize; +begin + Result := TcxGridBandedTableOptionsCustomize(inherited OptionsCustomize); +end; + +function TcxGridBandedTableView.GetOptionsView: TcxGridBandedTableOptionsView; +begin + Result := TcxGridBandedTableOptionsView(inherited OptionsView); +end; + +function TcxGridBandedTableView.GetStyles: TcxGridBandedTableViewStyles; +begin + Result := TcxGridBandedTableViewStyles(inherited Styles); +end; + +function TcxGridBandedTableView.GetViewInfo: TcxGridBandedTableViewInfo; +begin + Result := TcxGridBandedTableViewInfo(inherited ViewInfo); +end; + +function TcxGridBandedTableView.GetVisibleColumn(Index: Integer): TcxGridBandedColumn; +begin + Result := TcxGridBandedColumn(inherited VisibleColumns[Index]); +end; + +procedure TcxGridBandedTableView.SetBackgroundBitmaps(Value: TcxGridBandedTableBackgroundBitmaps); +begin + inherited BackgroundBitmaps := Value; +end; + +procedure TcxGridBandedTableView.SetBands(Value: TcxGridBands); +begin + FBands.Assign(Value); +end; + +procedure TcxGridBandedTableView.SetColumn(Index: Integer; + Value: TcxGridBandedColumn); +begin + inherited Columns[Index] := Value; +end; + +procedure TcxGridBandedTableView.SetOnBandPosChanged(Value: TcxGridBandEvent); +begin + if @FOnBandPosChanged <> @Value then + begin + FOnBandPosChanged := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridBandedTableView.SetOnBandSizeChanged(Value: TcxGridBandEvent); +begin + if @FOnBandSizeChanged <> @Value then + begin + FOnBandSizeChanged := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridBandedTableView.SetOnCustomDrawBandHeader(Value: TcxGridBandCustomDrawHeaderEvent); +begin + if @FOnCustomDrawBandHeader <> @Value then + begin + FOnCustomDrawBandHeader := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridBandedTableView.SetOptionsBehavior(Value: TcxGridBandedTableOptionsBehavior); +begin + inherited OptionsBehavior := Value; +end; + +procedure TcxGridBandedTableView.SetOptionsCustomize(Value: TcxGridBandedTableOptionsCustomize); +begin + inherited OptionsCustomize := Value; +end; + +procedure TcxGridBandedTableView.SetOptionsView(Value: TcxGridBandedTableOptionsView); +begin + inherited OptionsView := Value; +end; + +procedure TcxGridBandedTableView.SetStyles(Value: TcxGridBandedTableViewStyles); +begin + inherited Styles := Value; +end; + +procedure TcxGridBandedTableView.DeleteChild(const AObjectName: string; AObject: TObject); +begin + if AObject <> Bands then inherited; +end; + +procedure TcxGridBandedTableView.GetStoredChildren(AChildren: TStringList); +begin + AChildren.AddObject('', Bands); + inherited; +end; + +procedure TcxGridBandedTableView.AssignLayout(ALayoutView: TcxCustomGridView); +begin + Bands := (ALayoutView as TcxGridBandedTableView).Bands; + inherited; +end; + +procedure TcxGridBandedTableView.ReadState(Reader: TReader); +begin + //if csAncestor in ComponentState then - does not exist in run-time + SaveColumnsParams(True); + inherited; + //if csAncestor in ComponentState then + AssignColumnsParams(True, False); +end; + +procedure TcxGridBandedTableView.Updated; +begin + inherited; + BeginUpdate; + try + AssignBandsParams; + AssignColumnsParams(True, True); + finally + EndUpdate; + end; +end; + +procedure TcxGridBandedTableView.Updating; +begin + SaveBandsParams; + SaveColumnsParams; + inherited; +end; + +procedure TcxGridBandedTableView.BeginAssignBands; +begin + FIsAssigningBands := True; +end; + +procedure TcxGridBandedTableView.DoAssign(ASource: TcxCustomGridView); +begin + if ASource is TcxGridBandedTableView then + with TcxGridBandedTableView(ASource) do + begin + if not Self.AssigningSettings then + Self.Bands := Bands; + Self.OnBandPosChanged := OnBandPosChanged; + Self.OnBandSizeChanged := OnBandSizeChanged; + Self.OnCustomDrawBandHeader := OnCustomDrawBandHeader; + end; + inherited; +end; + +procedure TcxGridBandedTableView.DoItemsAssigned; +begin + inherited; + AssignColumnsParams(False, True); +end; + +procedure TcxGridBandedTableView.EndAssignBands; +begin + FIsAssigningBands := False; + AssignBandsParams; +end; + +procedure TcxGridBandedTableView.GetFakeComponentLinks(AList: TList); +var + I: Integer; +begin + inherited; + for I := 0 to FBands.Count - 1 do + FBands[I].Styles.GetFakeComponentLinks(AList); +end; + +function TcxGridBandedTableView.GetIsControlFocused: Boolean; +begin + Result := inherited GetIsControlFocused or + Controller.HasBandsCustomizationPopup and Controller.BandsCustomizationPopup.Visible; +end; + +function TcxGridBandedTableView.HasCustomDrawBandHeader: Boolean; +begin + Result := Assigned(FOnCustomDrawBandHeader); +end; + +procedure TcxGridBandedTableView.CreateOptions; +begin + inherited; + FBands := GetBandsClass.Create(Self); +end; + +procedure TcxGridBandedTableView.DestroyOptions; +begin + FreeAndNil(FBands); + inherited; +end; + +procedure TcxGridBandedTableView.AddItem(AItem: TcxCustomGridTableItem); +begin + inherited; + if not IsLoading and (FBands.VisibleBottomItemCount <> 0) then + TcxGridBandedColumn(AItem).Position.BandIndex := FBands.VisibleBottomItems[0].Index; +end; + +function CompareLoadedBandPositions( + Item1, Item2: Pointer): Integer; +var + APosition1, APosition2: TcxGridBandPosition; +begin + APosition1 := TcxGridBandPosition(Item1); + APosition2 := TcxGridBandPosition(Item2); + Result := APosition1.FBandIndex - APosition2.FBandIndex; + if Result = 0 then + Result := APosition1.FColIndex - APosition2.FColIndex; +end; + +procedure TcxGridBandedTableView.AssignBandsParams; +var + ABandPositions: TList; + I: Integer; + + procedure GetSortedBandPositionList(AList: TList); + var + I: Integer; + begin + AList.Count := FBands.Count; + for I := 0 to FBands.Count - 1 do + AList[I] := FBands[I].Position; + AList.Sort(CompareLoadedBandPositions); + end; + +begin + BeginUpdate; + try + ABandPositions := TList.Create; + try + GetSortedBandPositionList(ABandPositions); + for I := 0 to ABandPositions.Count - 1 do + with TcxGridBandPosition(ABandPositions[I]) do + begin + Band.IgnoreLoadingStatus := True; + try + BandIndex := FBandIndex; + if not Band.IsRoot then + ColIndex := FColIndex; + finally + Band.IgnoreLoadingStatus := False; + end; + end; + finally + ABandPositions.Free; + end; + finally + EndUpdate; + end; +end; + +function CompareLoadedColumnPositions(Item1, Item2: + Pointer): Integer; +var + APosition1, APosition2: TcxGridBandedColumnPosition; +begin + APosition1 := TcxGridBandedColumnPosition(Item1); + APosition2 := TcxGridBandedColumnPosition(Item2); + Result := APosition1.BandIndex - APosition2.BandIndex; + if Result = 0 then + begin + Result := APosition1.FRowIndex - APosition2.FRowIndex; + if Result = 0 then + Result := APosition1.FColIndex - APosition2.FColIndex; + end; +end; + +procedure TcxGridBandedTableView.AssignColumnsParams(AAssignBandIndexes, AAssignOtherIndexes: Boolean); +var + AColumnPositions: TList; + I: Integer; + + procedure GetSortedColumnPositionList(AList: TList); + var + I: Integer; + begin + AList.Count := ColumnCount; + for I := 0 to ColumnCount - 1 do + AList[I] := Columns[I].Position; + AList.Sort(CompareLoadedColumnPositions); + end; + +begin + BeginUpdate; + try + if AAssignBandIndexes then + for I := 0 to ColumnCount - 1 do + with Columns[I].Position do + BandIndex := FBandIndex; + if AAssignOtherIndexes then + begin + AColumnPositions := TList.Create; + try + GetSortedColumnPositionList(AColumnPositions); + for I := 0 to AColumnPositions.Count - 1 do + with TcxGridBandedColumnPosition(AColumnPositions[I]) do + begin + Item.IgnoreLoadingStatus := True; + try + RowIndex := FRowIndex; + ColIndex := FColIndex; + finally + Item.IgnoreLoadingStatus := False; + end; + end; + finally + AColumnPositions.Free; + end; + end; + RefreshVisibleItemsList; + finally + EndUpdate; + end; +end; + +procedure TcxGridBandedTableView.GetVisibleItemsList(AItems: TList); +var + I: Integer; + + procedure ProcessBand(ABand: TcxGridBand); + var + I: Integer; + begin + if ABand.Rows.VisibleCount <> 0 then + with ABand.Rows.VisibleItems[0].VisibleItemsList do + for I := 0 to Count - 1 do + AItems.Add(Items[I]); + end; + +begin + for I := 0 to FBands.VisibleBottomItemCount - 1 do + ProcessBand(FBands.VisibleBottomItems[I]); +end; + +procedure TcxGridBandedTableView.LoadingComplete; +begin + inherited; + BeginUpdate; + try + AssignBandsParams; + AssignColumnsParams(False, True); + finally + EndUpdate; + end; +end; + +function CompareColumns(Item1, Item2: + Pointer): Integer; +var + AColumn1, AColumn2: TcxGridBandedColumn; + AFixedKind1, AFixedKind2: TcxGridBandFixedKind; +begin + AColumn1 := TcxGridBandedColumn(Item1); + AColumn2 := TcxGridBandedColumn(Item2); + AFixedKind1 := AColumn1.Position.Band.FixedKind; + AFixedKind2 := AColumn2.Position.Band.FixedKind; + + if AFixedKind1 = AFixedKind2 then + Result := CompareVisibleColumnPositions(AColumn1.Position, AColumn2.Position) + else + if AFixedKind1 = fkNone then + Result := 1 + else + if AFixedKind2 = fkNone then + Result := -1 + else + Result := Ord(AFixedKind1) - Ord(AFixedKind2); +end; + +procedure TcxGridBandedTableView.RefreshVisibleItemsList; +begin + inherited; + VisibleItemsList.Sort(CompareColumns); + AssignVisibleItemsIndexes; +end; + +procedure TcxGridBandedTableView.RestoringComplete; +begin + inherited; + BeginUpdate; + try + AssignBandsParams; + AssignColumnsParams(False, True); + finally + EndUpdate; + end; +end; + +procedure TcxGridBandedTableView.SaveBandsParams; +var + I: Integer; +begin + for I := 0 to FBands.Count - 1 do + FBands[I].Position.SaveParams; +end; + +procedure TcxGridBandedTableView.SaveColumnsParams(ABandIndexOnly: Boolean = False); +var + I: Integer; +begin + for I := 0 to ColumnCount - 1 do + Columns[I].Position.SaveParams(ABandIndexOnly); +end; + +function TcxGridBandedTableView.GetBackgroundBitmapsClass: TcxCustomGridBackgroundBitmapsClass; +begin + Result := TcxGridBandedTableBackgroundBitmaps; +end; + +function TcxGridBandedTableView.GetBandsClass: TcxGridBandsClass; +begin + Result := TcxGridBands; +end; + +function TcxGridBandedTableView.GetControllerClass: TcxCustomGridControllerClass; +begin + Result := TcxGridBandedTableController; +end; + +function TcxGridBandedTableView.GetItemClass: TcxCustomGridTableItemClass; +begin + Result := TcxGridBandedColumn; +end; + +function TcxGridBandedTableView.GetOptionsBehaviorClass: TcxCustomGridOptionsBehaviorClass; +begin + Result := TcxGridBandedTableOptionsBehavior; +end; + +function TcxGridBandedTableView.GetOptionsCustomizeClass: TcxCustomGridTableOptionsCustomizeClass; +begin + Result := TcxGridBandedTableOptionsCustomize; +end; + +function TcxGridBandedTableView.GetOptionsViewClass: TcxCustomGridOptionsViewClass; +begin + Result := TcxGridBandedTableOptionsView; +end; + +function TcxGridBandedTableView.GetPainterClass: TcxCustomGridPainterClass; +begin + Result := TcxGridBandedTablePainter; +end; + +function TcxGridBandedTableView.GetStylesClass: TcxCustomGridViewStylesClass; +begin + Result := TcxGridBandedTableViewStyles; +end; + +function TcxGridBandedTableView.GetViewInfoClass: TcxCustomGridViewInfoClass; +begin + Result := TcxGridBandedTableViewInfo; +end; + +procedure TcxGridBandedTableView.DoBandPosChanged(ABand: TcxGridBand); +begin + if Assigned(FOnBandPosChanged) then FOnBandPosChanged(Self, ABand); +end; + +procedure TcxGridBandedTableView.DoBandSizeChanged(ABand: TcxGridBand); +begin + if Assigned(FOnBandSizeChanged) then FOnBandSizeChanged(Self, ABand); +end; + +procedure TcxGridBandedTableView.DoCustomDrawBandHeader(ACanvas: TcxCanvas; + AViewInfo: TcxGridBandHeaderViewInfo; var ADone: Boolean); +begin + if HasCustomDrawBandHeader then + FOnCustomDrawBandHeader(Self, ACanvas, AViewInfo, ADone); +end; + +procedure TcxGridBandedTableView.Initialize; +begin + inherited Initialize; + if (Owner <> nil) and (csDesigning in Owner.ComponentState) then + Bands.Add; +end; + +procedure TcxGridBandedTableView.ApplyBestFit(AItem: TcxCustomGridTableItem = nil; + ACheckSizingAbility: Boolean = False; AFireEvents: Boolean = False); +var + I: Integer; +begin + if AItem = nil then + for I := 0 to FBands.VisibleRootItemCount - 1 do + FBands.VisibleRootItems[I].ApplyBestFit(ACheckSizingAbility, AFireEvents) + else + inherited; +end; + +function TcxGridBandedTableView.CreateColumn: TcxGridBandedColumn; +begin + Result := TcxGridBandedColumn(inherited CreateColumn); +end; + +initialization + cxGridRegisteredViews.Register(TcxGridBandedTableView, 'Banded Table'); + Classes.RegisterClasses([TcxGridBandedColumn, TcxGridBandedTableViewStyleSheet]); + +finalization + cxGridRegisteredViews.Unregister(TcxGridBandedTableView); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridCardView.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridCardView.pas new file mode 100644 index 00000000..5e81a63c --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridCardView.pas @@ -0,0 +1,9978 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridCardView; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Classes, Graphics, Controls, Forms, StdCtrls, + cxClasses, cxGraphics, cxControls, cxStyles, cxLookAndFeelPainters, + cxGridCommon, cxGrid, cxGridCustomView, cxGridCustomTableView, + cxDataStorage, cxCustomData; + +const + cxGridCardViewAlternateCaptionSeparator: string = '-'; + + cxGridDefaultCardBorderWidth = 3; + cxGridDefaultCardViewCaptionSeparator = ':'; + cxGridDefaultCardViewSeparatorWidth = 2; + cxGridCardDefaultCategoryIndent = 17; + cxGridCardDefaultCategorySeparatorWidth = 2; + cxGridCardDefaultLayerSeparatorWidth = 0; + cxGridCardDefaultWidth = 200; + cxGridCardBorderMinWidth = 1; + cxGridCardDefaultIndent = 7; + cxGridCardMinWidth = 40; + + htCardViewBase = htCustomGridTableBase + 50; + htCardRowIndent = htCardViewBase + 1; + htCardRowExpandButton = htCardViewBase + 2; + htRowCaption = htCardViewBase + 3; + htRowFilterButton = htCardViewBase + 4; + htCardScrollButtonUp = htCardViewBase + 5; + htCardScrollButtonDown = htCardViewBase + 6; + htSeparator = htCardViewBase + 7; + + ckRows = 2; + + bbCardViewFirst = bbCustomTableLast + 1; + bbCaptionRow = bbCardViewFirst; + bbCardBorder = bbCardViewFirst + 1; + bbRowCaption = bbCardViewFirst + 2; + bbCardViewLast = bbRowCaption; + + isRowFirst = isCustomItemLast + 1; + isCaptionRow = isRowFirst; + isCategoryRow = isRowFirst + 1; + isRowCaption = isRowFirst + 2; + isRowLast = isRowCaption; + + vsCardViewFirst = vsCustomTableLast + 1; + vsCaptionRow = vsCardViewFirst; + vsCardBorder = vsCardViewFirst + 1; + vsCategoryRow = vsCardViewFirst + 2; + vsCategorySeparator = vsCardViewFirst + 3; + vsLayerSeparator = vsCardViewFirst + 4; + vsRowCaption = vsCardViewFirst + 5; + vsCardViewLast = vsRowCaption; + +type + TcxGridCardViewController = class; + TcxGridCard = class; + TcxGridCardViewViewData = class; + TcxGridCardRowFilterButtonViewInfo = class; + TcxGridCardRowCaptionViewInfo = class; + TcxGridCardRowViewInfo = class; + TcxCustomGridCardScrollButtonViewInfo = class; + TcxGridCardExpandButtonViewInfo = class; + TcxGridCardRowLayer = class; + TcxGridCardRowLayoutClass = class of TcxGridCardRowLayout; + TcxGridCardRowLayout = class; + TcxGridCardRowHorizontalLayout = class; + TcxGridCardViewInfoClass = class of TcxGridCardViewInfo; + TcxGridCardViewInfo = class; + TcxGridCardViewColumns = class; + TcxGridCardsViewInfo = class; + TcxGridCardViewSeparatorsViewInfo = class; + TcxGridCardViewViewInfo = class; + TcxGridCardViewInfoCacheItem = class; + TcxGridCardViewRow = class; + TcxGridCardVisibleRowLayoutObject = class; + TcxGridCardViewRowLayoutObject = class; + TcxGridCardViewVisibleRowLayoutObject = class; + TcxGridCardViewRowLayoutController = class; + TcxGridCardView = class; + + TcxGridCardExpandButtonAlignment = (cebaLeft, cebaRight); + TcxGridCardViewLayoutDirection = (ldHorizontal, ldVertical); + + { hit tests } + + TcxGridCardRowFilterButtonHitTest = class(TcxGridRecordCellHitTest) + protected + class function GetHitTestCode: Integer; override; + public + class function CanClick: Boolean; override; + end; + + TcxGridCardRowIndentHitTest = class(TcxGridRecordCellHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + TcxGridCardRowExpandButtonHitTest = class(TcxGridRecordCellHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + TcxGridCardRowCellHitTest = class(TcxGridRecordCellHitTest) + public + function DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; override; + end; + + TcxGridCardRowCaptionHitTest = class(TcxGridCardRowCellHitTest) + protected + class function GetHitTestCode: Integer; override; + public + RowContainerKind: TcxGridItemContainerKind; + end; + + TcxGridCardScrollButtonDownHitTest = class(TcxGridRecordHitTest) + protected + class function GetHitTestCode: Integer; override; + public + class function CanClick: Boolean; override; + end; + + TcxGridCardScrollButtonUpHitTest = class(TcxGridRecordHitTest) + protected + class function GetHitTestCode: Integer; override; + public + class function CanClick: Boolean; override; + end; + + TcxGridCardViewSeparatorHitTest = class(TcxCustomGridHitTest) + protected + class function GetHitTestCode: Integer; override; + public + Index: Integer; + Separators: TcxGridCardViewSeparatorsViewInfo; + function Cursor: TCursor; override; + function DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; override; + end; + + { view data } + + TcxGridCard = class(TcxCustomGridRecord) + private + FExpanded: Boolean; + function GetGridView: TcxGridCardView; + protected + procedure DoCollapse(ARecurse: Boolean); override; + procedure DoExpand(ARecurse: Boolean); override; + function GetExpandable: Boolean; override; + function GetExpanded: Boolean; override; + function GetHasCells: Boolean; override; + function GetViewInfoCacheItemClass: TcxCustomGridViewInfoCacheItemClass; override; + function GetViewInfoClass: TcxCustomGridRecordViewInfoClass; override; + public + constructor Create(AViewData: TcxCustomGridTableViewData; AIndex: Integer; + const ARecordInfo: TcxRowInfo); override; + procedure GetVisibleRows(ARows: TList); + property GridView: TcxGridCardView read GetGridView; + end; + + TcxGridCardViewViewData = class(TcxCustomGridTableViewData) + private + function GetCard(Index: Integer): TcxGridCard; + function GetCardCount: Integer; + protected + function GetRecordClass(ARecordInfo: TcxRowInfo): TcxCustomGridRecordClass; override; + public + property CardCount: Integer read GetCardCount; + property Cards[Index: Integer]: TcxGridCard read GetCard; + end; + + { controller } + + // drag&drop objects + + TcxGridCardRowInsertionPos = (ripPrevLayer, ripNewLayer, ripSameLayer); + + TcxGridCardRowContainerZone = class(TcxGridItemContainerZone) + private + function GetItem: TcxGridCardViewRow; + function GetRecordViewInfo: TcxGridCardViewInfo; + public + GridRecord: TcxCustomGridRecord; + InsertionPos: TcxGridCardRowInsertionPos; + constructor Create(AGridRecord: TcxCustomGridRecord; AItemIndex: Integer; + AInsertionPos: TcxGridCardRowInsertionPos); reintroduce; + function IsEqual(Value: TcxGridItemContainerZone): Boolean; override; + property RecordViewInfo: TcxGridCardViewInfo read GetRecordViewInfo; + property Item: TcxGridCardViewRow read GetItem; + end; + + TcxGridCardRowMovingObjectClass = class of TcxGridCardRowMovingObject; + + TcxGridCardRowMovingObject = class(TcxCustomGridTableItemMovingObject) + private + FExpandingRow: TcxGridCardViewRow; + FRowExpandingTimer: TcxTimer; + FSourceGridRecord: TcxCustomGridRecord; + function GetDestZone: TcxGridCardRowContainerZone; + function GetGridView: TcxGridCardView; + function GetRowLayout: TcxGridCardViewRowLayoutObject; + function GetSourceItem: TcxGridCardViewRow; + function GetViewInfo: TcxGridCardViewViewInfo; + function GetVisibleRowLayout: TcxGridCardViewVisibleRowLayoutObject; + procedure SetDestZone(Value: TcxGridCardRowContainerZone); + procedure SetSourceItem(Value: TcxGridCardViewRow); + procedure RowExpandingHandler(Sender: TObject); + protected + function AreArrowsVertical: Boolean; override; + procedure CalculateDestParams(AHitTest: TcxCustomGridHitTest; + out AContainerKind: TcxGridItemContainerKind; out AZone: TcxGridItemContainerZone); override; + function CanRemove: Boolean; override; + procedure ChangeSourceItemPosition; virtual; + function GetArrowAreaBounds(APlace: TcxGridArrowPlace): TRect; override; + function GetArrowsClientRect: TRect; override; + function GetSourceItemViewInfo: TcxCustomGridCellViewInfo; override; + function IsValidDestination: Boolean; override; + + procedure BeginDragAndDrop; override; + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); override; + procedure EndDragAndDrop(Accepted: Boolean); override; + + procedure StartRowExpanding(ARow: TcxGridCardViewRow); + procedure StopRowExpanding; + property ExpandingRow: TcxGridCardViewRow read FExpandingRow; + + property DestZone: TcxGridCardRowContainerZone read GetDestZone write SetDestZone; + property GridView: TcxGridCardView read GetGridView; + property RowLayout: TcxGridCardViewRowLayoutObject read GetRowLayout; + property SourceGridRecord: TcxCustomGridRecord read FSourceGridRecord write FSourceGridRecord; + property SourceItem: TcxGridCardViewRow read GetSourceItem write SetSourceItem; + property ViewInfo: TcxGridCardViewViewInfo read GetViewInfo; + property VisibleRowLayout: TcxGridCardViewVisibleRowLayoutObject read GetVisibleRowLayout; + public + procedure Init(const P: TPoint; AParams: TcxCustomGridHitTest); override; + end; + + TcxGridCardSizingObject = class(TcxCustomGridDragAndDropObject) + private + FCardColumnIndex: Integer; + FCardOriginalWidth: Integer; + FDestPointX: Integer; + FSeparators: TList; + function GetGridView: TcxGridCardView; + function GetSeparator(Index: Integer): TRect; + function GetSeparatorCount: Integer; + function GetViewInfo: TcxGridCardViewViewInfo; + procedure SetDestPointX(Value: Integer); + protected + procedure DirtyChanged; override; + function GetCurrentWidth: Integer; virtual; + function GetDeltaWidth: Integer; virtual; + function GetDragAndDropCursor(Accepted: Boolean): TCursor; override; + function GetImmediateStart: Boolean; override; + function GetOriginalWidth: Integer; virtual; + + procedure BeginDragAndDrop; override; + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); override; + procedure EndDragAndDrop(Accepted: Boolean); override; + + procedure AddSeparator(const R: TRect); + procedure CalculateSeparators; + procedure ClearSeparators; + procedure DrawSeparators; + property SeparatorCount: Integer read GetSeparatorCount; + property Separators[Index: Integer]: TRect read GetSeparator; + + property CardColumnIndex: Integer read FCardColumnIndex; + property CardOriginalWidth: Integer read FCardOriginalWidth + write FCardOriginalWidth; + property CurrentWidth: Integer read GetCurrentWidth; + property DeltaWidth: Integer read GetDeltaWidth; + property DestPointX: Integer read FDestPointX write SetDestPointX; + property GridView: TcxGridCardView read GetGridView; + property OriginalWidth: Integer read GetOriginalWidth; + property ViewInfo: TcxGridCardViewViewInfo read GetViewInfo; + public + constructor Create(AControl: TcxControl); override; + destructor Destroy; override; + procedure Init(const P: TPoint; AParams: TcxCustomGridHitTest); override; + end; + + // customization form + + TcxGridCardRowsListBox = class(TcxCustomGridTableItemsListBox) + private + function GetGridView: TcxGridCardView; + protected + function CalculateItemHeight: Integer; override; + function GetDragAndDropParams: TcxCustomGridHitTest; override; + property GridView: TcxGridCardView read GetGridView; + public + procedure PaintItem(ACanvas: TcxCanvas; R: TRect; AIndex: Integer; AFocused: Boolean); override; + procedure RefreshItems; override; + end; + + TcxGridCardViewCustomizationForm = class(TcxCustomGridTableCustomizationForm) + protected + function GetItemsListBoxClass: TcxCustomGridTableItemsListBoxClass; override; + function GetItemsPageCaption: string; override; + end; + + // controllers + + TcxGridCardViewControllerImplClass = class of TcxGridCardViewControllerImpl; + + TcxGridCardViewControllerImpl = class + private + FController: TcxGridCardViewController; + function GetControl: TcxControl; + function GetDataController: TcxCustomDataController; + function GetScrollBarOffsetBegin: Integer; + function GetScrollBarOffsetEnd: Integer; + function GetViewData: TcxGridCardViewViewData; + function GetViewInfo: TcxGridCardViewViewInfo; + protected + property Control: TcxControl read GetControl; + property Controller: TcxGridCardViewController read FController; + property DataController: TcxCustomDataController read GetDataController; + property ScrollBarOffsetBegin: Integer read GetScrollBarOffsetBegin; + property ScrollBarOffsetEnd: Integer read GetScrollBarOffsetEnd; + property ViewData: TcxGridCardViewViewData read GetViewData; + property ViewInfo: TcxGridCardViewViewInfo read GetViewInfo; + public + constructor Create(AController: TcxGridCardViewController); virtual; + function GetIsRecordsScrollHorizontal: Boolean; virtual; abstract; + function GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; virtual; abstract; + function GetScrollDelta: Integer; virtual; abstract; + procedure InitScrollBarsParameters; virtual; abstract; + procedure KeyDown(var Key: Word; Shift: TShiftState); dynamic; + end; + + TcxGridCardViewControllerHorizontalImpl = class(TcxGridCardViewControllerImpl) + public + procedure FocusRecordInNextColumn(ADirection: TcxDirection; AIsSelecting: Boolean); + function GetIsRecordsScrollHorizontal: Boolean; override; + function GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; override; + function GetScrollDelta: Integer; override; + procedure InitScrollBarsParameters; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + end; + + TcxGridCardViewControllerVerticalImpl = class(TcxGridCardViewControllerImpl) + public + procedure FocusRecordInNextRow(ADirection: TcxDirection; AIsSelecting: Boolean); + function GetIsRecordsScrollHorizontal: Boolean; override; + function GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; override; + function GetScrollDelta: Integer; override; + procedure InitScrollBarsParameters; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + end; + + TcxGridCardViewController = class(TcxCustomGridTableController) + private + FImplementationObject: TcxGridCardViewControllerImpl; + FScrollCardViewInfo: TcxGridCardViewInfo; + + function GetCustomizationForm: TcxGridCardViewCustomizationForm; + function GetFocusedCard: TcxGridCard; + function GetFocusedCardViewInfo: TcxGridCardViewInfo; + function GetFocusedRow: TcxGridCardViewRow; + function GetGridView: TcxGridCardView; + function GetScrollDelta: Integer; + function GetTopCardIndex: Integer; + function GetViewData: TcxGridCardViewViewData; + function GetViewInfo: TcxGridCardViewViewInfo; + procedure SetFocusedCard(Value: TcxGridCard); + procedure SetFocusedRow(Value: TcxGridCardViewRow); + procedure SetScrollCardViewInfo(Value: TcxGridCardViewInfo); + procedure SetTopCardIndex(Value: Integer); + procedure CreateImplementationObject; + procedure DestroyImplementationObject; + function GetImplementationObjectClass: TcxGridCardViewControllerImplClass; + protected + function CanFocusNextItem(AFocusedItemIndex, ANextItemIndex: Integer; + AGoForward, AGoOnCycle, AGoToNextRecordOnCycle: Boolean): Boolean; override; + function FindNextRow(ACard: TcxGridCard; ARows: TList; ARow: TcxGridCardViewRow; + AGoForward, AGoOnCycle: Boolean; out ACycleChanged: Boolean): TcxGridCardViewRow; + function GetDesignHitTest(AHitTest: TcxCustomGridHitTest): Boolean; override; + function GetDragScrollInterval: Integer; override; + function GetIsRecordsScrollHorizontal: Boolean; override; + function GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; override; + function IsKeyForMultiSelect(AKey: Word; AShift: TShiftState; + AFocusedRecordChanged: Boolean): Boolean; override; + function ProcessFocusedRowKeys(var AKey: Word; AShift: TShiftState; + ARowGoOnCycle: Boolean): Boolean; virtual; + procedure RowExpandedChanged(ARow: TcxGridCardViewRow); virtual; + procedure RowExpandedChanging(ARow: TcxGridCardViewRow; AValue: Boolean); virtual; + procedure ScrollData(ADirection: TcxDirection); override; + + // internal draganddrop data scrolling + function CanScrollData(ADirection: TcxDirection): Boolean; override; + function GetScrollDataTimeInterval(ADirection: TcxDirection): Integer; override; + property ScrollCardViewInfo: TcxGridCardViewInfo read FScrollCardViewInfo write SetScrollCardViewInfo; + + // customization + function GetCustomizationFormClass: TcxCustomGridCustomizationFormClass; override; + function GetRowDragAndDropObjectClass: TcxGridCardRowMovingObjectClass; virtual; + + property FocusedCardViewInfo: TcxGridCardViewInfo read GetFocusedCardViewInfo; + property ImplementationObject: TcxGridCardViewControllerImpl read FImplementationObject; + property ScrollDelta: Integer read GetScrollDelta; + property ViewData: TcxGridCardViewViewData read GetViewData; + property ViewInfo: TcxGridCardViewViewInfo read GetViewInfo; + public + constructor Create(AGridView: TcxCustomGridView); override; + destructor Destroy; override; + procedure CheckScrolling(const P: TPoint); override; + function IsDataFullyVisible(AIsCallFromMaster: Boolean = False): Boolean; override; + procedure MakeItemVisible(AItem: TcxCustomGridTableItem); override; + + function CanScrollFocusedCard(ADown: Boolean): Boolean; + function ScrollFocusedCard(ADown: Boolean): Boolean; + + procedure InitScrollBarsParameters; override; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); override; + + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + + procedure LayoutDirectionChanged; + + function FocusNextRowHorizontally(AGoForward, AGoOnCycle: Boolean): Boolean; virtual; + function FocusNextRowVertically(AGoForward, AGoOnCycle: Boolean): Boolean; virtual; + + property CustomizationForm: TcxGridCardViewCustomizationForm read GetCustomizationForm; + property FocusedCard: TcxGridCard read GetFocusedCard write SetFocusedCard; + property FocusedItem: TcxGridCardViewRow read GetFocusedRow write SetFocusedRow; + property FocusedRow: TcxGridCardViewRow read GetFocusedRow write SetFocusedRow; + property GridView: TcxGridCardView read GetGridView; + property TopCardIndex: Integer read GetTopCardIndex write SetTopCardIndex; + end; + + // row layout controller + + TcxGridCardViewRowLayout = (rlHorizontal, rlVertical); + TcxGridCardViewRowLayerPosition = (rlpBeforeRow, rlpAfterRow, rlpBeforeLayer, rlpAfterLayer); + + TcxGridCardRowPosition = record + LayerIndex: Integer; + IndexInLayer: Integer; + end; + + TcxGridCardRowCoordinates = record + ColIndex: Integer; + RowIndex: Integer; + end; + + TcxGridCardRowCoordinatesArray = array of TcxGridCardRowCoordinates; + + TcxCustomGridCardRowLayoutObject = class + private + FLayerRowCounts: TList; + function GetLayerCount: Integer; + function GetLayerFirstRow(ALayerIndex: Integer): TcxGridCardViewRow; + function GetLayerFirstRowIndex(ALayerIndex: Integer): Integer; + function GetLayerRow(ALayerIndex, AIndex: Integer): TcxGridCardViewRow; + function GetLayerRowCount(ALayerIndex: Integer): Integer; + procedure SetLayerRowCount(ALayerIndex, Value: Integer); + protected + function GetLayout: TcxGridCardViewRowLayout; virtual; abstract; + function GetRow(AIndex: Integer): TcxGridCardViewRow; virtual; abstract; + function GetRowCount: Integer; virtual; abstract; + function GetRowIndex(ARow: TcxGridCardViewRow): Integer; virtual; abstract; + + function GetCoordinates(const APosition: TcxGridCardRowPosition): TcxGridCardRowCoordinates; overload; + function GetPosition(const ACoordinates: TcxGridCardRowCoordinates): TcxGridCardRowPosition; overload; + + function GetLayerIndex(ARowIndex: Integer): Integer; overload; + function GetLayerPosition(APosition: TcxPosition): TcxGridCardViewRowLayerPosition; + function GetLength(ARow: TcxGridCardViewRow): Integer; + function GetOffsetInLayer(ALayerIndex, AIndexInLayer: Integer): Integer; overload; + function GetPosition(ARowIndex: Integer): TcxGridCardRowPosition; overload; + + property LayerRowCounts: TList read FLayerRowCounts; + property RowCount: Integer read GetRowCount; + property Rows[AIndex: Integer]: TcxGridCardViewRow read GetRow; + public + constructor Create; + destructor Destroy; override; + + function GetCoordinates(ARow: TcxGridCardViewRow): TcxGridCardRowCoordinates; overload; + function GetIndexInLayer(ARow: TcxGridCardViewRow): Integer; + function GetLayerIndex(ARow: TcxGridCardViewRow): Integer; overload; + function GetOffsetInLayer(ARow: TcxGridCardViewRow): Integer; overload; + function GetPosition(ARow: TcxGridCardViewRow): TcxGridCardRowPosition; overload; + function GetRowAtOffset(ALayerIndex, AOffset: Integer): TcxGridCardViewRow; + function IsFirstInLayer(ARow: TcxGridCardViewRow): Boolean; + function IsLastInLayer(ARow: TcxGridCardViewRow): Boolean; + function IsWholeLine(ARow: TcxGridCardViewRow): Boolean; + + property LayerCount: Integer read GetLayerCount; + property LayerFirstRow[ALayerIndex: Integer]: TcxGridCardViewRow read GetLayerFirstRow; + property LayerFirstRowIndex[ALayerIndex: Integer]: Integer read GetLayerFirstRowIndex; + property LayerRowCount[ALayerIndex: Integer]: Integer read GetLayerRowCount write SetLayerRowCount; + property LayerRows[ALayerIndex, AIndex: Integer]: TcxGridCardViewRow read GetLayerRow; + property Layout: TcxGridCardViewRowLayout read GetLayout; + end; + + TcxGridCardRowLayoutObject = class(TcxCustomGridCardRowLayoutObject) + private + FLayout: TcxGridCardViewRowLayout; + FRows: TList; + protected + function GetLayout: TcxGridCardViewRowLayout; override; + function GetRow(AIndex: Integer): TcxGridCardViewRow; override; + function GetRowCount: Integer; override; + function GetRowIndex(ARow: TcxGridCardViewRow): Integer; override; + property RowsList: TList read FRows; + public + constructor Create; + destructor Destroy; override; + procedure Fill(ARows: TList); + property Layout: TcxGridCardViewRowLayout read GetLayout write FLayout; + end; + + TcxGridCardVisibleRowLayoutObject = class(TcxGridCardRowLayoutObject) + private + FCard: TcxGridCard; + public + constructor Create(ACard: TcxGridCard); + procedure GetInsertionParams(ARow: TcxGridCardViewRow; APosition: TcxPosition; + out AInsertionIndex: Integer; out AInsertionPos: TcxGridCardRowInsertionPos); + procedure GetLayerRows(ARowInLayer: TcxGridCardViewRow; ARows: TList); + procedure GetRowsAtOffset(ARowAtOffset: TcxGridCardViewRow; ARows: TList); + property Card: TcxGridCard read FCard; + end; + + TcxGridCardViewRowLayoutObject = class(TcxCustomGridCardRowLayoutObject) + private + FGridView: TcxGridCardView; + FOnLayerIndexChanged: TNotifyEvent; + function GetBeginsLayer(ARow: TcxGridCardViewRow): Boolean; + procedure SetBeginsLayer(ARow: TcxGridCardViewRow; Value: Boolean); + protected + function GetLayout: TcxGridCardViewRowLayout; override; + function GetRow(AIndex: Integer): TcxGridCardViewRow; override; + function GetRowCount: Integer; override; + function GetRowIndex(ARow: TcxGridCardViewRow): Integer; override; + + procedure AddLayer; + procedure InsertLayer(AIndex: Integer); + procedure RemoveLayer(AIndex: Integer); + + procedure AddRowToLayer(ALayerIndex: Integer); + procedure RemoveRowFromLayer(ALayerIndex: Integer); + + procedure AddRow(ARow: TcxGridCardViewRow); + procedure RemoveRow(ARowIndex: Integer); + procedure MoveRow(ARow: TcxGridCardViewRow; AOldIndex: Integer); + procedure MoveRows(ARows: TList; AIndex: Integer); overload; + procedure MoveRows(ARows: TList; AIndex: Integer; ARowLayout: TcxGridCardRowLayoutObject); overload; + + procedure LayerIndexChanged; + property OnLayerIndexChanged: TNotifyEvent read FOnLayerIndexChanged write FOnLayerIndexChanged; + public + constructor Create(AGridView: TcxGridCardView); + + procedure BreakLayer(ALayerIndex, AIndexInLayer: Integer); + function IsSimpleLayout: Boolean; + procedure MergeLayer(ALayerIndex: Integer); + + procedure SetCoordinates(ARow: TcxGridCardViewRow; const ACoordinates: TcxGridCardRowCoordinates); + procedure SetIndexInLayer(ARow: TcxGridCardViewRow; AValue: Integer; + AMoveSubItems: Boolean = False); + procedure SetLayerIndex(ARow: TcxGridCardViewRow; AValue: Integer; + ANewLayer: Boolean = False; AMoveSubItems: Boolean = False); + procedure SetPosition(ARow: TcxGridCardViewRow; const APosition: TcxGridCardRowPosition); + + property BeginsLayer[ARow: TcxGridCardViewRow]: Boolean read GetBeginsLayer write SetBeginsLayer; + property GridView: TcxGridCardView read FGridView; + end; + + TcxGridCardViewVisibleRowLayoutObject = class(TcxGridCardRowLayoutObject) + private + FGridView: TcxGridCardView; + protected + function GetLayout: TcxGridCardViewRowLayout; override; + public + constructor Create(AGridView: TcxGridCardView); + function GetLastVisibleSubItem(ARow: TcxGridCardViewRow): TcxGridCardViewRow; + function GetLayerCount(ARow: TcxGridCardViewRow): Integer; + function IsWholeLayer(ARow: TcxGridCardViewRow): Boolean; + property GridView: TcxGridCardView read FGridView; + end; + + TcxGridCardViewRowLayoutControllerClass = class of TcxGridCardViewRowLayoutController; + + TcxGridCardViewRowLayoutController = class + private + FGridView: TcxGridCardView; + FLayoutObject: TcxGridCardViewRowLayoutObject; + FVisibleLayoutObject: TcxGridCardViewVisibleRowLayoutObject; + function GetBeginsLayer(ARow: TcxGridCardViewRow): Boolean; + function GetLayout: TcxGridCardViewRowLayout; + procedure SetBeginsLayer(ARow: TcxGridCardViewRow; Value: Boolean); + procedure LayerIndexChanged(Sender: TObject); + protected + procedure RefreshVisibleLayoutObject; + procedure RowIndexChanged(ARow: TcxGridCardViewRow; AOldIndex: Integer); + procedure VisibleRowsListChanged; + + function CreateCardRowLayout(ACardViewInfo: TcxGridCardViewInfo): TcxGridCardRowLayout; + function GetCardRowLayoutClass: TcxGridCardRowLayoutClass; virtual; + public + constructor Create(AGridView: TcxGridCardView); virtual; + destructor Destroy; override; + function IsHorizontalLayout: Boolean; + function IsSimpleLayout: Boolean; + function IsWholeLine(ARow: TcxGridCardViewRow): Boolean; + + // indexes handling + + function GetCoordinates(ARow: TcxGridCardViewRow): TcxGridCardRowCoordinates; + procedure SetCoordinates(ARow: TcxGridCardViewRow; AColIndex, ARowIndex: Integer); overload; + procedure SetCoordinates(ARow: TcxGridCardViewRow; ACoordinates: TcxGridCardRowCoordinates); overload; + function GetVisibleCoordinates(ARow: TcxGridCardViewRow): TcxGridCardRowCoordinates; + + function GetPosition(ARow: TcxGridCardViewRow): TcxGridCardRowPosition; + procedure SetPosition(ARow: TcxGridCardViewRow; ALayerIndex, AIndexInLayer: Integer); + function GetVisiblePosition(ARow: TcxGridCardViewRow): TcxGridCardRowPosition; + + // navigation + + function FindNextRow(ACard: TcxGridCard; ARow: TcxGridCardViewRow; + ASameLayer, AGoForward, AGoOnCycle: Boolean; out ACycleChanged: Boolean): TcxGridCardViewRow; + + function FindNextRowHorizontally(ACard: TcxGridCard; ARow: TcxGridCardViewRow; + AGoForward, AGoOnCycle: Boolean; out ACycleChanged: Boolean): TcxGridCardViewRow; + function FindNextRowVertically(ACard: TcxGridCard; ARow: TcxGridCardViewRow; + AGoForward, AGoOnCycle: Boolean; out ACycleChanged: Boolean): TcxGridCardViewRow; + + property BeginsLayer[ARow: TcxGridCardViewRow]: Boolean read GetBeginsLayer write SetBeginsLayer; + property GridView: TcxGridCardView read FGridView; + property Layout: TcxGridCardViewRowLayout read GetLayout; + property LayoutObject: TcxGridCardViewRowLayoutObject read FLayoutObject; + property VisibleLayoutObject: TcxGridCardViewVisibleRowLayoutObject read FVisibleLayoutObject; + end; + + { painters } + + TcxGridCardRowFilterButtonPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridCardRowFilterButtonViewInfo; + protected + procedure Paint; override; + property ViewInfo: TcxGridCardRowFilterButtonViewInfo read GetViewInfo; + end; + + TcxGridCardRowCaptionPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridCardRowCaptionViewInfo; + protected + procedure DrawContent; override; + property ViewInfo: TcxGridCardRowCaptionViewInfo read GetViewInfo; + end; + + TcxGridCardRowPainterClass = class of TcxGridCardRowPainter; + + TcxGridCardRowPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridCardRowViewInfo; + protected + procedure DrawExpandButton; virtual; + procedure DrawFocusRect; virtual; + procedure DrawIndent; virtual; + procedure Paint; override; + property ViewInfo: TcxGridCardRowViewInfo read GetViewInfo; + end; + + TcxGridCardScrollButtonPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxCustomGridCardScrollButtonViewInfo; + protected + procedure DrawContent; override; + function ExcludeFromClipRect: Boolean; override; + property ViewInfo: TcxCustomGridCardScrollButtonViewInfo read GetViewInfo; + end; + + TcxGridCardExpandButtonPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridCardExpandButtonViewInfo; + protected + procedure Paint; override; + property ViewInfo: TcxGridCardExpandButtonViewInfo read GetViewInfo; + end; + + TcxGridCardPainter = class(TcxCustomGridRecordPainter) + private + FClipRegion: TcxRegion; + function GetViewInfo: TcxGridCardViewInfo; + protected + procedure AfterPaint; override; + procedure BeforePaint; override; + procedure DrawBackground; override; + procedure DrawCardBorder; virtual; + procedure DrawExpandButton; override; + function DrawExpandButtonBeforePaint: Boolean; override; + procedure DrawLayerSeparators; virtual; + procedure DrawRows; virtual; + procedure DrawScrollButtons; virtual; + procedure Paint; override; + property ViewInfo: TcxGridCardViewInfo read GetViewInfo; + end; + + TcxGridCardViewPainter = class(TcxCustomGridTablePainter) + protected + procedure DrawBackground; override; + procedure DrawSeparators; virtual; + procedure PaintContent; override; + function ViewInfo: TcxGridCardViewViewInfo; reintroduce; + end; + + { view infos } + + // column and columns + + TcxGridCardViewColumn = class + private + FColumns: TcxGridCardViewColumns; + FIndex: Integer; + FRows: TList; + function GetLastRow: TcxGridCardViewInfo; + function GetRow(Index: Integer): TcxGridCardViewInfo; + function GetRowCount: Integer; + function GetVisibleRowCount: Integer; + procedure SetRow(Index: Integer; Value: TcxGridCardViewInfo); + public + constructor Create(AColumns: TcxGridCardViewColumns; AIndex: Integer); + destructor Destroy; override; + function GetNearestRow(APos: Integer): TcxGridCardViewInfo; + property Index: Integer read FIndex; + property LastRow: TcxGridCardViewInfo read GetLastRow; + property RowCount: Integer read GetRowCount; + property Rows[Index: Integer]: TcxGridCardViewInfo read GetRow write SetRow; default; + property VisibleRowCount: Integer read GetVisibleRowCount; + end; + + TcxGridCardViewColumnsClass = class of TcxGridCardViewColumns; + + TcxGridCardViewColumns = class + private + FCardsViewInfo: TcxGridCardsViewInfo; + FItems: TList; + function GetCount: Integer; + function GetItem(Index: Integer): TcxGridCardViewColumn; + function GetLast: TcxGridCardViewColumn; + function GetVisibleCount: Integer; + procedure CreateItems; + procedure DestroyItems; + protected + property CardsViewInfo: TcxGridCardsViewInfo read FCardsViewInfo; + public + constructor Create(ACardsViewInfo: TcxGridCardsViewInfo); + destructor Destroy; override; + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxGridCardViewColumn read GetItem; default; + property Last: TcxGridCardViewColumn read GetLast; + property VisibleCount: Integer read GetVisibleCount; + end; + + // card row + + TcxGridCardRowCellViewInfo = class(TcxGridTableDataCellViewInfo) + private + FRowViewInfo: TcxGridCardRowViewInfo; + function GetCardViewInfo: TcxGridCardViewInfo; + function GetGridView: TcxGridCardView; + function GetGridRecord: TcxGridCard; + function GetRow: TcxGridCardViewRow; + protected + function GetAreaBounds: TRect; override; + function GetMultiLine: Boolean; override; + function GetMultiLinePainting: Boolean; override; + function GetTransparent: Boolean; override; + function HasFocusRect: Boolean; override; + public + constructor Create(ARowViewInfo: TcxGridCardRowViewInfo); reintroduce; virtual; + function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + property CardViewInfo: TcxGridCardViewInfo read GetCardViewInfo; + property GridRecord: TcxGridCard read GetGridRecord; + property GridView: TcxGridCardView read GetGridView; + property Row: TcxGridCardViewRow read GetRow; + property RowViewInfo: TcxGridCardRowViewInfo read FRowViewInfo; + end; + + TcxGridCardRowFilterButtonViewInfoClass = class of TcxGridCardRowFilterButtonViewInfo; + + TcxGridCardRowFilterButtonViewInfo = class(TcxCustomGridViewCellViewInfo, + IcxGridFilterPopupOwner) + private + FRowCaptionViewInfo: TcxGridCardRowCaptionViewInfo; + function GetActive: Boolean; + function GetDropDownWindowValue: TcxGridFilterPopup; + function GetRow: TcxGridCardViewRow; + protected + { IcxGridFilterPopupOwner } + function GetItem: TcxCustomGridTableItem; + + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetVisible: Boolean; override; + function GetWidth: Integer; override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + function NeedsContainerHotTrack: Boolean; virtual; + function OccupiesSpace: Boolean; virtual; + + function CloseDropDownWindowOnDestruction: Boolean; override; + function DropDownWindowExists: Boolean; override; + function GetDropDownWindow: TcxCustomGridPopup; override; + function GetDropDownWindowOwnerBounds: TRect; override; + function IsDropDownWindowOwner: Boolean; override; + property DropDownWindow: TcxGridFilterPopup read GetDropDownWindowValue; + public + constructor Create(ARowCaptionViewInfo: TcxGridCardRowCaptionViewInfo); reintroduce; virtual; + property Active: Boolean read GetActive; + property Row: TcxGridCardViewRow read GetRow; + property RowCaptionViewInfo: TcxGridCardRowCaptionViewInfo read FRowCaptionViewInfo; + end; + + TcxGridCardRowCaptionViewInfoClass = class of TcxGridCardRowCaptionViewInfo; + + TcxGridCardRowCaptionViewInfo = class(TcxGridCardRowCellViewInfo) + private + FFilterButtonViewInfo: TcxGridCardRowFilterButtonViewInfo; + protected + function CalculateHeight: Integer; override; + class function CalculateSimpleHeight(ARow: TcxGridCardViewRow; + ACanvas: TcxCanvas; AFont: TFont): Integer; virtual; + function CalculateRealWidth: Integer; virtual; + function CalculateWidth: Integer; override; + function CanFilter: Boolean; virtual; + function CanShowAutoHint: Boolean; override; + function CanShowCustomHint: Boolean; override; + function CanShowEdit: Boolean; override; + function GetAlignmentHorz: TAlignment; override; + function GetAlignmentVert: TcxAlignmentVert; override; + function GetAutoHeight: Boolean; override; + function GetFilterButtonBounds: TRect; virtual; + function GetFilterButtonViewInfoClass: TcxGridCardRowFilterButtonViewInfoClass; virtual; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetHotTrack: Boolean; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetShowEndEllipsis: Boolean; override; + function GetText: string; override; + function GetTextAreaBounds: TRect; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function GetVisible: Boolean; override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + function UseStandardNeedShowHint: Boolean; override; + property FilterButtonBounds: TRect read GetFilterButtonBounds; + public + constructor Create(ARowViewInfo: TcxGridCardRowViewInfo); override; + destructor Destroy; override; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + property FilterButtonViewInfo: TcxGridCardRowFilterButtonViewInfo read FFilterButtonViewInfo; + end; + + TcxGridCardRowDataViewInfoClass = class of TcxGridCardRowDataViewInfo; + + TcxGridCardRowDataViewInfo = class(TcxGridCardRowCellViewInfo) + protected + function CalculateHeight: Integer; override; + class function CalculateSimpleHeight(ARow: TcxGridCardViewRow; + ACanvas: TcxCanvas; AFont: TFont): Integer; virtual; + function CalculateWidth: Integer; override; + function GetAutoHeight: Boolean; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetText: string; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function GetVisible: Boolean; override; + end; + + TcxGridCardRowViewInfoClass = class of TcxGridCardRowViewInfo; + + TcxGridCardRowViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FCaptionViewInfo: TcxGridCardRowCaptionViewInfo; + FCardViewInfo: TcxGridCardViewInfo; + FDataViewInfo: TcxGridCardRowDataViewInfo; + FHeight: Integer; + FIndex: Integer; + FPartVisible: Boolean; + function GetExpandButtonAreaSizeValue: Integer; + function GetExpandButtonSizeValue: Integer; + function GetExpanded: Boolean; + function GetGridView: TcxGridCardView; + function GetGridRecord: TcxGridCard; + function GetGridViewInfo: TcxGridCardViewViewInfo; + //function GetMaxHeight: Integer; + function GetRow: TcxGridCardViewRow; + procedure SetExpanded(Value: Boolean); + function CalculatePartVisible: Boolean; + function CalculateVisible: Boolean; + procedure CreateViewInfos; + procedure DestroyViewInfos; + protected + function CalculateContentBounds: TRect; override; + function CalculateHeaderWidth: Integer; virtual; + function CalculateHeight: Integer; override; + class function CalculateSimpleHeight(ARow: TcxGridCardViewRow; ACanvas: TcxCanvas): Integer; virtual; + function CalculateWidth: Integer; override; + class procedure CheckHeight(ACardViewInfoClass: TcxGridCardViewInfoClass; + ARow: TcxGridCardViewRow; ARowViewInfo: TcxGridCardRowViewInfo; + ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass; var AHeight: Integer); virtual; + class function GetCaptionViewInfoClass: TcxGridCardRowCaptionViewInfoClass; virtual; + function GetCaptionWidth: Integer; virtual; + class function GetDataViewInfoClass: TcxGridCardRowDataViewInfoClass; virtual; + function GetDataWidth: Integer; virtual; + function GetDesignSelectionBounds: TRect; override; + function GetExpandButtonAreaBounds: TRect; virtual; + class function GetExpandButtonAreaSize(ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; virtual; + function GetExpandButtonBounds: TRect; virtual; + class function GetExpandButtonSize(ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; virtual; + function GetHeaderWidth: Integer; virtual; + function GetHeight: Integer; override; + function GetHidden: Boolean; virtual; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetIndent: Integer; virtual; + function GetIndentBounds: TRect; virtual; + function GetIndentViewParams: TcxViewParams; virtual; + function GetIsDesignSelected: Boolean; override; + function GetIsVisibleForPainting: Boolean; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + class function GetSimpleViewParams(ARow: TcxGridCardViewRow; AIsCaption: Boolean): TcxViewParams; virtual; + function GetWidth: Integer; override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + + procedure GetCaptionViewParams(var AParams: TcxViewParams); virtual; abstract; + procedure GetDataViewParams(var AParams: TcxViewParams); virtual; abstract; + + property CaptionWidth: Integer read GetCaptionWidth; + property DataWidth: Integer read GetDataWidth; + property ExpandButtonAreaSize: Integer read GetExpandButtonAreaSizeValue; + property ExpandButtonSize: Integer read GetExpandButtonSizeValue; + property Indent: Integer read GetIndent; + //!!!property MaxHeight: Integer read GetMaxHeight; + public + constructor Create(ACardViewInfo: TcxGridCardViewInfo; AIndex: Integer); reintroduce; virtual; + destructor Destroy; override; + procedure BeforeRecalculation; override; + procedure Calculate(const ABounds: TRect); override; + function CalculateVisibleCounts(var AVisibleRowCount, APartVisibleRowCount: Integer): Boolean; + procedure CalculateVisibles; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + function HasExpandButton: Boolean; virtual; + function HasIndent: Boolean; virtual; + function HasLimitedHeaderSpace: Boolean; virtual; + function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + + property CaptionViewInfo: TcxGridCardRowCaptionViewInfo read FCaptionViewInfo; + property CardViewInfo: TcxGridCardViewInfo read FCardViewInfo; + property DataViewInfo: TcxGridCardRowDataViewInfo read FDataViewInfo; + property ExpandButtonAreaBounds: TRect read GetExpandButtonAreaBounds; + property ExpandButtonBounds: TRect read GetExpandButtonBounds; + property Expanded: Boolean read GetExpanded write SetExpanded; + property GridRecord: TcxGridCard read GetGridRecord; + property GridView: TcxGridCardView read GetGridView; + property GridViewInfo: TcxGridCardViewViewInfo read GetGridViewInfo; + property HeaderWidth: Integer read GetHeaderWidth; + property Height: Integer read GetHeight write FHeight; + property Hidden: Boolean read GetHidden; + property IndentBounds: TRect read GetIndentBounds; + property Index: Integer read FIndex; + property PartVisible: Boolean read FPartVisible; + property Row: TcxGridCardViewRow read GetRow; + end; + + // data row + + TcxGridCardDataRowDataViewInfo = class(TcxGridCardRowDataViewInfo) + protected + function CalculateSelected: Boolean; override; + end; + + TcxGridCardDataRowViewInfo = class(TcxGridCardRowViewInfo) + protected + procedure GetCaptionViewParams(var AParams: TcxViewParams); override; + class function GetDataViewInfoClass: TcxGridCardRowDataViewInfoClass; override; + procedure GetDataViewParams(var AParams: TcxViewParams); override; + class function GetSimpleViewParams(ARow: TcxGridCardViewRow; AIsCaption: Boolean): TcxViewParams; override; + end; + + // caption row + + TcxGridCardCaptionRowCaptionViewInfo = class(TcxGridCardRowCaptionViewInfo) + protected + function GetTextAreaBounds: TRect; override; + end; + + TcxGridCardCaptionRowDataViewInfo = class(TcxGridCardRowDataViewInfo) + protected + procedure GetEditViewDataContentOffsets(var R: TRect); override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetTextAreaBounds: TRect; override; + end; + + TcxGridCardCaptionRowViewInfo = class(TcxGridCardRowViewInfo) + protected + class function GetCaptionViewInfoClass: TcxGridCardRowCaptionViewInfoClass; override; + procedure GetCaptionViewParams(var AParams: TcxViewParams); override; + class function GetDataViewInfoClass: TcxGridCardRowDataViewInfoClass; override; + procedure GetDataViewParams(var AParams: TcxViewParams); override; + procedure GetViewParams(var AParams: TcxViewParams); override; + end; + + // category row + + TcxGridCardCategoryRowViewInfo = class(TcxGridCardCaptionRowViewInfo) + protected + class procedure CheckHeight(ACardViewInfoClass: TcxGridCardViewInfoClass; + ARow: TcxGridCardViewRow; ARowViewInfo: TcxGridCardRowViewInfo; + ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass; var AHeight: Integer); override; + function GetBorderColor(AIndex: TcxBorder): TColor; override; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + procedure GetDataViewParams(var AParams: TcxViewParams); override; + function GetSeparatorColor: TColor; virtual; + function HasSeparator: Boolean; overload; + class function HasSeparator(ACardViewInfoClass: TcxGridCardViewInfoClass; + ARow: TcxGridCardViewRow): Boolean; overload; + property SeparatorColor: TColor read GetSeparatorColor; + public + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + end; + + // card scroll buttons + + TcxCustomGridCardScrollButtonViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FCardViewInfo: TcxGridCardViewInfo; + FScrollTimer: TcxTimer; + procedure ScrollTimerHandler(Sender: TObject); + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function CaptureMouseOnPress: Boolean; override; + function GetHotTrack: Boolean; override; + function GetIsDownButton: Boolean; virtual; abstract; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + procedure Scroll; virtual; abstract; + procedure StateChanged(APrevState: TcxGridCellState); override; + + procedure StartAutoScrolling; + procedure StopAutoScrolling; + property ScrollTimer: TcxTimer read FScrollTimer; + public + constructor Create(ACardViewInfo: TcxGridCardViewInfo); reintroduce; virtual; + property IsDownButton: Boolean read GetIsDownButton; + property CardViewInfo: TcxGridCardViewInfo read FCardViewInfo; + end; + + TcxGridCardScrollButtonDownViewInfoClass = class of TcxGridCardScrollButtonDownViewInfo; + + TcxGridCardScrollButtonDownViewInfo = class(TcxCustomGridCardScrollButtonViewInfo) + protected + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetIsDownButton: Boolean; override; + function GetVisible: Boolean; override; + procedure Scroll; override; + end; + + TcxGridCardScrollButtonUpViewInfoClass = class of TcxGridCardScrollButtonUpViewInfo; + + TcxGridCardScrollButtonUpViewInfo = class(TcxCustomGridCardScrollButtonViewInfo) + protected + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetIsDownButton: Boolean; override; + function GetVisible: Boolean; override; + procedure Scroll; override; + end; + + // card expand button + + TcxGridCardExpandButtonViewInfoClass = class of TcxGridCardExpandButtonViewInfo; + + TcxGridCardExpandButtonViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FCardViewInfo: TcxGridCardViewInfo; + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function CaptureMouseOnPress: Boolean; override; + procedure Click; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetHotTrack: Boolean; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetVisible: Boolean; override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + public + constructor Create(ACardViewInfo: TcxGridCardViewInfo); reintroduce; virtual; + function HasPoint(const P: TPoint): Boolean; override; + property CardViewInfo: TcxGridCardViewInfo read FCardViewInfo; + end; + + // card row layout + + TcxGridCardRowLayerClass = class of TcxGridCardRowLayer; + + TcxGridCardRowLayer = class + private + FIndex: Integer; + FLength: Integer; + FOwner: TcxGridCardRowLayout; + FThickness: Integer; + function GetBounds: TRect; + function GetLength: Integer; + function GetRow(AIndex: Integer): TcxGridCardRowViewInfo; + function GetRowCount: Integer; + function GetThickness: Integer; + protected + procedure BeforeCalculation; virtual; + function CalculateLength: Integer; virtual; abstract; + function CalculateThickness: Integer; virtual; abstract; + procedure SetThickness(Value: Integer); virtual; + public + constructor Create(AOwner: TcxGridCardRowLayout; AIndex: Integer); virtual; + procedure Calculate(AOwnerWidth: Integer); virtual; + procedure CalculateRows(const ABounds: TRect; ATopRowIndex: Integer; + var AVisibleRowCount, APartVisibleRowCount: Integer); virtual; abstract; + function HasPoint(const P: TPoint): Boolean; virtual; abstract; + + property Bounds: TRect read GetBounds; + property Index: Integer read FIndex; + property Length: Integer read GetLength; + property Owner: TcxGridCardRowLayout read FOwner; + property RowCount: Integer read GetRowCount; + property Rows[Index: Integer]: TcxGridCardRowViewInfo read GetRow; + property Thickness: Integer read GetThickness write SetThickness; + end; + + TcxGridCardRowLayout = class(TcxGridCardVisibleRowLayoutObject) + private + FCardViewInfo: TcxGridCardViewInfo; + FLayers: array of TcxGridCardRowLayer; + FSeparatorWidth: Integer; + FSimple: Boolean; + function GetLayer(Index: Integer): TcxGridCardRowLayer; + function GetLayerRowViewInfo(ALayerIndex, AIndex: Integer): TcxGridCardRowViewInfo; + function GetSeparatorCount: Integer; + procedure CreateLayers; + procedure DestroyLayers; + protected + procedure BeforeCalculation; virtual; + procedure CalculateLayerBounds(ALayer: TcxGridCardRowLayer; AMaxRowHeight: Integer; + var ABounds: TRect); virtual; abstract; + procedure CalculateLayers(AWidth: Integer); virtual; + function CalculateRowsHeaderWidth(ARows: TList; AWidth: Integer): Integer; virtual; + function GetLayerClass: TcxGridCardRowLayerClass; virtual; + function GetLayersHeight: Integer; virtual; abstract; + function GetLayersLength: Integer; virtual; + function GetLayersThickness: Integer; virtual; + function GetNonContentThickness: Integer; virtual; + function HasSeparator(ALayer: TcxGridCardRowLayer): Boolean; + function IsLayerVisible(ALayer: TcxGridCardRowLayer; ATopRowIndex: Integer): Boolean; overload; virtual; + function IsLayerVisible(const ABounds, ALayerBounds: TRect): Boolean; overload; virtual; + + property LayersLength: Integer read GetLayersLength; + property LayersThickness: Integer read GetLayersThickness; + property NonContentThickness: Integer read GetNonContentThickness; + public + constructor Create(ACardViewInfo: TcxGridCardViewInfo; ASimple: Boolean); virtual; + destructor Destroy; override; + procedure Calculate(AWidth: Integer); virtual; + procedure CalculateRows(const ABounds: TRect; ATopRowIndex, AMaxRowHeight: Integer; + var AVisibleRowCount, APartVisibleRowCount: Integer); virtual; + function GetHeaderWidth(ARowViewInfo: TcxGridCardRowViewInfo): Integer; virtual; abstract; + function GetIndexInLayer(ARowViewInfo: TcxGridCardRowViewInfo): Integer; overload; + function GetLayerIndex(ARowViewInfo: TcxGridCardRowViewInfo): Integer; overload; + function GetLayerIndex(const P: TPoint): Integer; overload; + function GetSeparatorBounds(AIndex: Integer): TRect; virtual; abstract; + function IsLeft(ARowViewInfo: TcxGridCardRowViewInfo): Boolean; virtual; abstract; + function IsTop(ARowViewInfo: TcxGridCardRowViewInfo): Boolean; virtual; abstract; + function IsZoneVertical(AZone: TcxGridCardRowContainerZone): Boolean; virtual; abstract; + + property CardViewInfo: TcxGridCardViewInfo read FCardViewInfo; + property LayerRowViewInfos[ALayerIndex, AIndex: Integer]: TcxGridCardRowViewInfo read GetLayerRowViewInfo; + property LayersHeight: Integer read GetLayersHeight; + property Layers[Index: Integer]: TcxGridCardRowLayer read GetLayer; + property SeparatorCount: Integer read GetSeparatorCount; + property SeparatorWidth: Integer read FSeparatorWidth write FSeparatorWidth; + property Simple: Boolean read FSimple; + end; + + // - horizontal + + TcxGridCardRowHorizontalLayer = class(TcxGridCardRowLayer) + private + function GetOwner: TcxGridCardRowHorizontalLayout; + protected + function CalculateLength: Integer; override; + procedure CalculateRowWidths(AAvailableWidth: Integer); virtual; + function CalculateThickness: Integer; override; + public + procedure Calculate(AOwnerWidth: Integer); override; + procedure CalculateRows(const ABounds: TRect; ATopRowIndex: Integer; + var AVisibleRowCount, APartVisibleRowCount: Integer); override; + function HasPoint(const P: TPoint): Boolean; override; + property Owner: TcxGridCardRowHorizontalLayout read GetOwner; + end; + + TcxGridCardRowHorizontalLayout = class(TcxGridCardRowLayout) + private + FFirstColumnRowsHeaderWidth: Integer; + protected + function CalculateFirstColumnRowsHeaderWidth(AWidth: Integer): Integer; virtual; + procedure CalculateLayerBounds(ALayer: TcxGridCardRowLayer; AMaxRowHeight: Integer; + var ABounds: TRect); override; + function GetLayerClass: TcxGridCardRowLayerClass; override; + function GetLayersHeight: Integer; override; + function IsLayerVisible(ALayer: TcxGridCardRowLayer; ATopRowIndex: Integer): Boolean; override; + function IsLayerVisible(const ABounds, ALayerBounds: TRect): Boolean; override; + public + constructor Create(ACardViewInfo: TcxGridCardViewInfo; ASimple: Boolean); override; + procedure Calculate(AWidth: Integer); override; + function GetHeaderWidth(ARowViewInfo: TcxGridCardRowViewInfo): Integer; override; + function GetSeparatorBounds(AIndex: Integer): TRect; override; + function IsLeft(ARowViewInfo: TcxGridCardRowViewInfo): Boolean; override; + function IsTop(ARowViewInfo: TcxGridCardRowViewInfo): Boolean; override; + function IsZoneVertical(AZone: TcxGridCardRowContainerZone): Boolean; override; + property FirstColumnRowsHeaderWidth: Integer read FFirstColumnRowsHeaderWidth; + end; + + // - vertical + + TcxGridCardRowVerticalLayer = class(TcxGridCardRowLayer) + private + FRowsHeaderWidth: Integer; + protected + function CalculateLength: Integer; override; + function CalculateRowsHeaderWidth: Integer; virtual; + function CalculateThickness: Integer; override; + procedure SetThickness(Value: Integer); override; + public + constructor Create(AOwner: TcxGridCardRowLayout; AIndex: Integer); override; + procedure Calculate(AOwnerWidth: Integer); override; + procedure CalculateRows(const ABounds: TRect; ATopRowIndex: Integer; + var AVisibleRowCount, APartVisibleRowCount: Integer); override; + function HasPoint(const P: TPoint): Boolean; override; + property RowsHeaderWidth: Integer read FRowsHeaderWidth; + end; + + TcxGridCardRowVerticalLayout = class(TcxGridCardRowLayout) + protected + procedure CalculateLayerBounds(ALayer: TcxGridCardRowLayer; AMaxRowHeight: Integer; + var ABounds: TRect); override; + procedure CalculateLayers(AWidth: Integer); override; + procedure CalculateLayerWidths(AAvailableWidth: Integer); virtual; + function GetLayerClass: TcxGridCardRowLayerClass; override; + function GetLayersHeight: Integer; override; + public + function GetHeaderWidth(ARowViewInfo: TcxGridCardRowViewInfo): Integer; override; + function GetSeparatorBounds(AIndex: Integer): TRect; override; + function IsLeft(ARowViewInfo: TcxGridCardRowViewInfo): Boolean; override; + function IsTop(ARowViewInfo: TcxGridCardRowViewInfo): Boolean; override; + function IsZoneVertical(AZone: TcxGridCardRowContainerZone): Boolean; override; + end; + + // card + + TcxGridCardViewInfo = class(TcxCustomGridRecordViewInfo) + private + FCol: Integer; + FExpandButtonViewInfo: TcxGridCardExpandButtonViewInfo; + FLayout: TcxGridCardRowLayout; + FLayoutCalculated: Boolean; + FPartVisibleRowCount: Integer; + FRow: Integer; + FRowViewInfos: TList; + FScrollButtonDown: TcxGridCardScrollButtonDownViewInfo; + FScrollButtonUp: TcxGridCardScrollButtonUpViewInfo; + FVisibleRowCount: Integer; + function GetCacheItem: TcxGridCardViewInfoCacheItem; + function GetCardBorderWidth: Integer; + function GetExpandButtonSizeValue: Integer; + function GetFirstCaptionRowViewInfo: TcxGridCardRowViewInfo; + function GetGridView: TcxGridCardView; + function GetGridRecord: TcxGridCard; + function GetRecordsViewInfo: TcxGridCardsViewInfo; + function GetRowViewInfo(Index: Integer): TcxGridCardRowViewInfo; + function GetRowViewInfoCount: Integer; + function GetTopRowIndex: Integer; + function GetVisibleRowViewInfo(Index: Integer): TcxGridCardRowViewInfo; + function GetVisibleRowViewInfoCount: Integer; + procedure SetTopRowIndex(Value: Integer); + procedure CreateRowViewInfos; + procedure DestroyRowViewInfos; + procedure CreateScrollButtons; + procedure DestroyScrollButtons; + protected + procedure CalculateExpandButtonBounds(var ABounds: TRect); override; + function CalculateHeight: Integer; override; + procedure CalculateLayout; virtual; + procedure DoCalculateLayout; + procedure CalculateRows; virtual; + procedure CalculateRowVisibles; virtual; + function CalculateWidth: Integer; override; + function CanGenerateExpandButtonHitTest: Boolean; override; + function GetAutoHeight: Boolean; override; + function GetBackgroundBitmapBounds: TRect; override; + function GetContentBounds: TRect; override; + function GetContentHeight: Integer; override; + function GetContentWidth: Integer; override; + function GetExpandButtonAlignment: TcxGridCardExpandButtonAlignment; virtual; + function GetExpandButtonAreaBounds: TRect; override; + function GetExpandButtonAreaWidth: Integer; virtual; + class function GetExpandButtonSize(ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; virtual; + function GetHeight: Integer; override; + function GetLayerSeparatorAreaBounds: TRect; virtual; + function GetLayerSeparatorColor: TColor; virtual; + function GetLayerSeparatorWidth: Integer; virtual; + function GetMaxRowViewInfoHeight: Integer; virtual; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetRestSpaceBounds: TRect; virtual; + function GetScrollableAreaBounds: TRect; virtual; + function GetScrollButtonDownBounds: TRect; virtual; + function GetScrollButtonDownViewInfoClass: TcxGridCardScrollButtonDownViewInfoClass; virtual; + function GetScrollButtonUpViewInfoClass: TcxGridCardScrollButtonUpViewInfoClass; virtual; + function GetScrollButtonHeight: Integer; virtual; + function GetScrollButtonUpBounds: TRect; virtual; + procedure GetViewParams(var AParams: TcxViewParams); override; + function GetVisible: Boolean; override; + function GetWidth: Integer; override; + function HasCategorySeparator(ARowViewInfo: TcxGridCardCategoryRowViewInfo): Boolean; overload; virtual; + class function HasCategorySeparator(ARow: TcxGridCardViewRow): Boolean; overload; virtual; + function HasIndent(ARowViewInfo: TcxGridCardRowViewInfo): Boolean; virtual; + function HasLayerSeparators: Boolean; virtual; + function IsRowPartiallyVisible(ARowViewInfo: TcxGridCardRowViewInfo): Boolean; virtual; + function IsRowVisible(ARowViewInfo: TcxGridCardRowViewInfo): Boolean; virtual; + function SupportsScrolling: Boolean; virtual; + + function GetZone(AHitTest: TcxCustomGridHitTest): TcxGridItemContainerZone; virtual; + function GetZoneBounds(AZone: TcxGridCardRowContainerZone): TRect; virtual; + function IsZoneVertical(AZone: TcxGridCardRowContainerZone): Boolean; virtual; + + function GetExpandButtonViewInfoClass: TcxGridCardExpandButtonViewInfoClass; virtual; + class function GetRowViewInfoClass(ARow: TcxGridCardViewRow): TcxGridCardRowViewInfoClass; virtual; + + property CacheItem: TcxGridCardViewInfoCacheItem read GetCacheItem; + property ExpandButtonAreaWidth: Integer read GetExpandButtonAreaWidth; + property ExpandButtonSize: Integer read GetExpandButtonSizeValue; + property FirstCaptionRowViewInfo: TcxGridCardRowViewInfo read GetFirstCaptionRowViewInfo; + property LayerSeparatorWidth: Integer read GetLayerSeparatorWidth; + property MaxRowViewInfoHeight: Integer read GetMaxRowViewInfoHeight; + property ScrollButtonDownBounds: TRect read GetScrollButtonDownBounds; + property ScrollButtonHeight: Integer read GetScrollButtonHeight; + property ScrollButtonUpBounds: TRect read GetScrollButtonUpBounds; + public + constructor Create(ARecordsViewInfo: TcxCustomGridRecordsViewInfo; + ARecord: TcxCustomGridRecord); override; + destructor Destroy; override; + procedure BeforeRecalculation; override; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + function GetBoundsForItem(AItem: TcxCustomGridTableItem): TRect; override; + procedure GetCardBorderViewParams(var AParams: TcxViewParams); virtual; + function GetCellViewInfoByItem(AItem: TcxCustomGridTableItem): TcxGridTableDataCellViewInfo; override; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + function IsFullyVisible: Boolean; + procedure MainCalculate(ALeftBound, ATopBound: Integer); override; + procedure MakeRowVisible(ARow: TcxGridCardViewRow); virtual; + function NeedsScrollingDown: Boolean; virtual; + function NeedsScrollingUp: Boolean; virtual; + function VisibleRowViewInfoIndexOf(ARow: TcxGridCardViewRow): Integer; overload; + function VisibleRowViewInfoIndexOf(ARowViewInfo: TcxGridCardRowViewInfo): Integer; overload; + + property CardBorderWidth: Integer read GetCardBorderWidth; + property Col: Integer read FCol; + //property DataWidth: Integer read GetDataWidth; + property ExpandButtonAlignment: TcxGridCardExpandButtonAlignment read GetExpandButtonAlignment; + property ExpandButtonViewInfo: TcxGridCardExpandButtonViewInfo read FExpandButtonViewInfo; + property GridView: TcxGridCardView read GetGridView; + property GridRecord: TcxGridCard read GetGridRecord; + property LayerSeparatorAreaBounds: TRect read GetLayerSeparatorAreaBounds; + property LayerSeparatorColor: TColor read GetLayerSeparatorColor; + property Layout: TcxGridCardRowLayout read FLayout; + property PartVisibleRowCount: Integer read FPartVisibleRowCount; + property RecordsViewInfo: TcxGridCardsViewInfo read GetRecordsViewInfo; + property RestSpaceBounds: TRect read GetRestSpaceBounds; + property Row: Integer read FRow; + property RowViewInfoCount: Integer read GetRowViewInfoCount; + property RowViewInfos[Index: Integer]: TcxGridCardRowViewInfo read GetRowViewInfo; + property ScrollableAreaBounds: TRect read GetScrollableAreaBounds; + property ScrollButtonDown: TcxGridCardScrollButtonDownViewInfo read FScrollButtonDown; + property ScrollButtonUp: TcxGridCardScrollButtonUpViewInfo read FScrollButtonUp; + property TopRowIndex: Integer read GetTopRowIndex write SetTopRowIndex; + property VisibleRowCount: Integer read FVisibleRowCount; + property VisibleRowViewInfoCount: Integer read GetVisibleRowViewInfoCount; + property VisibleRowViewInfos[Index: Integer]: TcxGridCardRowViewInfo read GetVisibleRowViewInfo; + end; + + // cards + + TcxGridCardsViewInfo = class(TcxCustomGridRecordsViewInfo) + private + FCardHeight: Integer; + FCardWidth: Integer; + FColumns: TcxGridCardViewColumns; + FMaxCardHeight: Integer; + function GetCardBorderWidth: Integer; + function GetCardContentWidth: Integer; + function GetCardIndent: Integer; + function GetColumnWidth: Integer; + function GetGridView: TcxGridCardView; + function GetGridViewInfo: TcxGridCardViewViewInfo; + function GetItem(Index: Integer): TcxGridCardViewInfo; + function GetRowHeight: Integer; + function GetViewData: TcxGridCardViewViewData; + protected + FPartVisibleCount: Integer; + procedure Calculate; override; + function CalculateCardHeight: Integer; virtual; + function CalculateCardRowHeight(ARow: TcxGridCardViewRow): Integer; virtual; + function CalculateCardWidth: Integer; virtual; + function CalculateContentBounds: TRect; override; + function CalculateHeight(var AFullyVisible: Boolean): Integer; virtual; + function CalculateMaxCardHeight: Integer; virtual; + function CalculateWidth(AMaxWidth: Integer): Integer; virtual; + function GetAutoCellHeight: Boolean; virtual; + function GetAutoDataRecordHeight: Boolean; override; + function GetCardSpaceHorz: Integer; virtual; abstract; + function GetCardSpaceVert: Integer; virtual; abstract; + //procedure GetDataCellDefaultViewParams(ARecord: TcxCustomGridRecord; + // AItem: TcxCustomGridTableItem; var AParams: TcxViewParams); override; + function GetItemLeftBound(AIndex: Integer): Integer; override; + function GetItemsOffset(AItemCountDelta: Integer): Integer; override; + function GetItemTopBound(AIndex: Integer): Integer; override; + function GetItemViewInfoClass: TcxGridCardViewInfoClass; virtual; + procedure OffsetItem(AIndex, AOffset: Integer); override; + + property CardIndent: Integer read GetCardIndent; + property CardSpaceHorz: Integer read GetCardSpaceHorz; + property CardSpaceVert: Integer read GetCardSpaceVert; + property GridView: TcxGridCardView read GetGridView; + property GridViewInfo: TcxGridCardViewViewInfo read GetGridViewInfo; + property ViewData: TcxGridCardViewViewData read GetViewData; + public + CardRowHeights: array of Integer; + constructor Create(AGridViewInfo: TcxCustomGridTableViewInfo); override; + destructor Destroy; override; + function GetRealItem(ARecord: TcxCustomGridRecord): TcxGridCardViewInfo; reintroduce; virtual; + function GetZone(AHitTest: TcxCustomGridHitTest): TcxGridItemContainerZone; virtual; + function UseCardHeight: Boolean; virtual; + function UseCardRowHeights: Boolean; virtual; + + property AutoCellHeight: Boolean read GetAutoCellHeight; + property CardBorderWidth: Integer read GetCardBorderWidth; + property CardContentWidth: Integer read GetCardContentWidth; + property CardHeight: Integer read FCardHeight; + property CardWidth: Integer read FCardWidth; + property Columns: TcxGridCardViewColumns read FColumns; + property ColumnWidth: Integer read GetColumnWidth; + property Items[Index: Integer]: TcxGridCardViewInfo read GetItem; default; + property MaxCardHeight: Integer read FMaxCardHeight; + property PartVisibleCount: Integer read FPartVisibleCount; + property RowHeight: Integer read GetRowHeight; + end; + + TcxGridCardsHorizontalViewInfo = class(TcxGridCardsViewInfo) + protected + procedure Calculate; override; + function GetCardSpaceHorz: Integer; override; + function GetCardSpaceVert: Integer; override; + end; + + TcxGridCardsVerticalViewInfo = class(TcxGridCardsViewInfo) + protected + procedure Calculate; override; + function GetCardSpaceHorz: Integer; override; + function GetCardSpaceVert: Integer; override; + end; + + // separators + + TcxGridCardViewSeparatorsViewInfoClass = class of TcxGridCardViewSeparatorsViewInfo; + + TcxGridCardViewSeparatorsViewInfo = class + private + FGridViewInfo: TcxGridCardViewViewInfo; + FItems: TList; + function GetColor: TColor; + function GetCount: Integer; + function GetGridView: TcxGridCardView; + function GetItem(Index: Integer): TRect; + function GetRecordsViewInfo: TcxGridCardsViewInfo; + function GetWidth: Integer; + procedure SetItem(Index: Integer; const Value: TRect); + procedure CreateItems; + procedure DestroyItems; + protected + function GetBounds: TRect; virtual; + function GetHitTestItem(Index: Integer): TRect; virtual; abstract; + function GetHitTestItemCount: Integer; virtual; abstract; + + property Bounds: TRect read GetBounds; + property GridView: TcxGridCardView read GetGridView; + property GridViewInfo: TcxGridCardViewViewInfo read FGridViewInfo; + property HitTestItemCount: Integer read GetHitTestItemCount; + property HitTestItems[Index: Integer]: TRect read GetHitTestItem; + property RecordsViewInfo: TcxGridCardsViewInfo read GetRecordsViewInfo; + public + constructor Create(AGridViewInfo: TcxGridCardViewViewInfo); virtual; + destructor Destroy; override; + procedure Calculate; virtual; abstract; + function GetHitTest(const P: TPoint): TcxGridCardViewSeparatorHitTest; virtual; + + property Color: TColor read GetColor; + property Count: Integer read GetCount; + property Items[Index: Integer]: TRect read GetItem write SetItem; default; + property Width: Integer read GetWidth; + end; + + TcxGridCardViewSeparatorsHorizontalViewInfo = class(TcxGridCardViewSeparatorsViewInfo) + protected + function GetHitTestItem(Index: Integer): TRect; override; + function GetHitTestItemCount: Integer; override; + public + procedure Calculate; override; + end; + + TcxGridCardViewSeparatorsVerticalViewInfo = class(TcxGridCardViewSeparatorsViewInfo) + protected + function GetHitTestItem(Index: Integer): TRect; override; + function GetHitTestItemCount: Integer; override; + public + procedure Calculate; override; + end; + + // card view + + TcxGridCardViewViewInfo = class(TcxCustomGridTableViewInfo) + private + FPrevCardHeight: Integer; + FSeparatorsViewInfo: TcxGridCardViewSeparatorsViewInfo; + function GetController: TcxGridCardViewController; + function GetGridView: TcxGridCardView; + function GetRecordsViewInfo: TcxGridCardsViewInfo; + function GetViewData: TcxGridCardViewViewData; + protected + procedure CreateViewInfos; override; + procedure DestroyViewInfos(AIsRecreating: Boolean); override; + + procedure AfterCalculating; override; + procedure BeforeCalculating; override; + procedure Calculate; override; + procedure CalculateHeight(const AMaxSize: TPoint; var AHeight: Integer; + var AFullyVisible: Boolean); override; + procedure CalculateWidth(const AMaxSize: TPoint; var AWidth: Integer); override; + function DoGetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + function GetDefaultGridModeBufferCount: Integer; override; + function GetScrollableAreaBoundsForEdit: TRect; override; + + function GetRecordsViewInfoClass: TcxCustomGridRecordsViewInfoClass; override; + function GetSeparatorsViewInfoClass: TcxGridCardViewSeparatorsViewInfoClass; virtual; + + property Controller: TcxGridCardViewController read GetController; + property GridView: TcxGridCardView read GetGridView; + property ViewData: TcxGridCardViewViewData read GetViewData; + public + function CanOffsetView(ARecordCountDelta: Integer): Boolean; override; + property RecordsViewInfo: TcxGridCardsViewInfo read GetRecordsViewInfo; + property SeparatorsViewInfo: TcxGridCardViewSeparatorsViewInfo read FSeparatorsViewInfo; + end; + + // cache + + TcxGridCardViewInfoCacheItem = class(TcxCustomGridTableViewInfoCacheItem) + private + FTopRowIndex: Integer; + FIsTopRowIndexAssigned: Boolean; + procedure SetTopRowIndex(Value: Integer); + public + procedure UnassignValues(AKeepMaster: Boolean); override; + property TopRowIndex: Integer read FTopRowIndex write SetTopRowIndex; + property IsTopRowIndexAssigned: Boolean read FIsTopRowIndexAssigned write FIsTopRowIndexAssigned; + end; + + { view } + + TcxGridCardViewRowOptions = class(TcxCustomGridTableItemOptions) + private + FExpanding: Boolean; + FShowData: Boolean; + procedure SetExpanding(Value: Boolean); + procedure SetShowData(Value: Boolean); + protected + procedure BeforeShowCaptionChange; override; + public + constructor Create(AItem: TcxCustomGridTableItem); override; + procedure Assign(Source: TPersistent); override; + published + property Expanding: Boolean read FExpanding write SetExpanding default True; + property Moving; + property ShowCaption; + property ShowData: Boolean read FShowData write SetShowData default True; + end; + + TcxGridCardViewRowPositionClass = class of TcxGridCardViewRowPosition; + + TcxGridCardViewRowPosition = class(TcxCustomGridTableItemCustomOptions) + private + FBeginsLayer: Boolean; + FLineCount: Integer; + FWidth: Integer; + function GetBeginsLayer: Boolean; + function GetColIndex: Integer; + function GetGridView: TcxGridCardView; + function GetIndexInLayer: Integer; + function GetItem: TcxGridCardViewRow; + function GetLayerIndex: Integer; + function GetLayerVisibleIndex: Integer; + function GetRowIndex: Integer; + function GetVisibleColIndex: Integer; + function GetVisibleIndexInLayer: Integer; + function GetVisibleRowIndex: Integer; + procedure SetBeginsLayer(Value: Boolean); + procedure SetColIndex(Value: Integer); + procedure SetIndexInLayer(Value: Integer); + procedure SetLayerIndex(Value: Integer); + procedure SetLineCount(Value: Integer); + procedure SetRowIndex(Value: Integer); + procedure SetWidth(Value: Integer); + protected + procedure AssignParams; + procedure SaveParams; + public + constructor Create(AItem: TcxCustomGridTableItem); override; + procedure Assign(Source: TPersistent); override; + function IsWholeLine: Boolean; + + property GridView: TcxGridCardView read GetGridView; + property Item: TcxGridCardViewRow read GetItem; + + property ColIndex: Integer read GetColIndex write SetColIndex; + property RowIndex: Integer read GetRowIndex write SetRowIndex; + + property VisibleColIndex: Integer read GetVisibleColIndex; + property VisibleRowIndex: Integer read GetVisibleRowIndex; + + property LayerVisibleIndex: Integer read GetLayerVisibleIndex; + property VisibleIndexInLayer: Integer read GetVisibleIndexInLayer; + published + property BeginsLayer: Boolean read GetBeginsLayer write SetBeginsLayer; + property IndexInLayer: Integer read GetIndexInLayer write SetIndexInLayer stored False; + property LayerIndex: Integer read GetLayerIndex write SetLayerIndex stored False; + property LineCount: Integer read FLineCount write SetLineCount default 1; + property Width: Integer read FWidth write SetWidth default 0; + end; + + TcxGridCardViewRowStyles = class(TcxCustomGridTableItemStyles) + private + FOnGetCaptionRowStyle: TcxGridGetCellStyleEvent; + FOnGetCaptionStyle: TcxGridGetCellStyleEvent; + FOnGetCategoryRowStyle: TcxGridGetCellStyleEvent; + function GetGridViewValue: TcxGridCardView; + function GetItem: TcxGridCardViewRow; + procedure SetOnGetCaptionRowStyle(Value: TcxGridGetCellStyleEvent); + procedure SetOnGetCaptionStyle(Value: TcxGridGetCellStyleEvent); + procedure SetOnGetCategoryRowStyle(Value: TcxGridGetCellStyleEvent); + protected + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + procedure GetCaptionParams(ARecord: TcxCustomGridRecord; out AParams: TcxViewParams); virtual; + procedure GetCaptionRowParams(ARecord: TcxCustomGridRecord; out AParams: TcxViewParams); virtual; + procedure GetCategoryRowParams(ARecord: TcxCustomGridRecord; out AParams: TcxViewParams); virtual; + property GridView: TcxGridCardView read GetGridViewValue; + property Item: TcxGridCardViewRow read GetItem; + published + property Caption: TcxStyle index isRowCaption read GetValue write SetValue; + property CaptionRow: TcxStyle index isCaptionRow read GetValue write SetValue; + property CategoryRow: TcxStyle index isCategoryRow read GetValue write SetValue; + property OnGetCaptionRowStyle: TcxGridGetCellStyleEvent read FOnGetCaptionRowStyle + write SetOnGetCaptionRowStyle; + property OnGetCaptionStyle: TcxGridGetCellStyleEvent read FOnGetCaptionStyle + write SetOnGetCaptionStyle; + property OnGetCategoryRowStyle: TcxGridGetCellStyleEvent read FOnGetCategoryRowStyle + write SetOnGetCategoryRowStyle; + end; + + TcxGridCardViewRowKind = (rkData, rkCaption, rkCategory); + + TcxGridCardViewRow = class(TcxCustomGridTableItem) + private + FCategoryItems: TList; + FCategoryRow: TcxGridCardViewRow; + FExpanded: Boolean; + FKind: TcxGridCardViewRowKind; + FLockPositionSync: Boolean; + FPosition: TcxGridCardViewRowPosition; + function GetCaptionAlignmentHorz: TAlignment; + function GetCaptionAlignmentVert: TcxAlignmentVert; + function GetCategoryItem(AIndex: Integer): TcxGridCardViewRow; + function GetCategoryItemCount: Integer; + function GetExpanded: Boolean; + function GetGridView: TcxGridCardView; + function GetOptions: TcxGridCardViewRowOptions; + function GetStyles: TcxGridCardViewRowStyles; + procedure SetCaptionAlignmentHorz(Value: TAlignment); + procedure SetCaptionAlignmentVert(Value: TcxAlignmentVert); + procedure SetCategoryRow(Value: TcxGridCardViewRow); + procedure SetCategoryRowValue(Value: TcxGridCardViewRow); + procedure SetExpanded(Value: Boolean); + procedure SetKind(Value: TcxGridCardViewRowKind); + procedure SetOptions(Value: TcxGridCardViewRowOptions); + procedure SetPosition(Value: TcxGridCardViewRowPosition); + procedure SetStyles(Value: TcxGridCardViewRowStyles); + function IsCaptionAlignmentHorzStored: Boolean; + function IsCaptionAlignmentVertStored: Boolean; + protected + // IcxStoredObject + function GetStoredProperties(AProperties: TStrings): Boolean; override; + procedure GetPropertyValue(const AName: string; var AValue: Variant); override; + procedure SetPropertyValue(const AName: string; const AValue: Variant); override; + + procedure CreateSubClasses; override; + procedure DestroySubClasses; override; + function GetOptionsClass: TcxCustomGridTableItemOptionsClass; override; + function GetPositionClass: TcxGridCardViewRowPositionClass; virtual; + function GetStylesClass: TcxCustomGridTableItemStylesClass; override; + + function CanEdit: Boolean; override; + function CanExpand: Boolean; virtual; + function CanFilter(AVisually: Boolean): Boolean; override; + function CanFocus(ARecord: TcxCustomGridRecord): Boolean; override; + function DefaultAlternateCaption: string; override; + function DefaultWidth: Integer; override; + function GetActuallyVisible: Boolean; override; + function GetExpandable: Boolean; virtual; + procedure GetItems(ARows: TList; AIncludeSubItems: Boolean); virtual; + function GetVisibleCaption: string; override; + function HasExpandableItems: Boolean; virtual; + + property CategoryItemsList: TList read FCategoryItems; + property GridView: TcxGridCardView read GetGridView; + property LockPositionSync: Boolean read FLockPositionSync write FLockPositionSync; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function HasCardExpandButton: Boolean; virtual; + function HasExpandButton: Boolean; virtual; + function IsVisibleInCard(ACard: TcxGridCard): Boolean; virtual; + procedure MoveTo(AIndex: Integer; AMoveSubItems: Boolean); + + property CategoryItemCount: Integer read GetCategoryItemCount; + property CategoryItems[AIndex: Integer]: TcxGridCardViewRow read GetCategoryItem; + property CategoryRow: TcxGridCardViewRow read FCategoryRow write SetCategoryRow; + property Expandable: Boolean read GetExpandable; + property Hidden; // obsolete, use VisibleForCustomization + published + property CaptionAlignmentHorz: TAlignment read GetCaptionAlignmentHorz write SetCaptionAlignmentHorz stored IsCaptionAlignmentHorzStored; + property CaptionAlignmentVert: TcxAlignmentVert read GetCaptionAlignmentVert write SetCaptionAlignmentVert stored IsCaptionAlignmentVertStored; + property Expanded: Boolean read GetExpanded write SetExpanded default False; + property Kind: TcxGridCardViewRowKind read FKind write SetKind default rkData; + property Options: TcxGridCardViewRowOptions read GetOptions write SetOptions; + property Position: TcxGridCardViewRowPosition read FPosition write SetPosition; + property SortIndex; + property SortOrder; + property Styles: TcxGridCardViewRowStyles read GetStyles write SetStyles; + property VisibleForCustomization; + end; + + // options + + TcxGridCardViewBackgroundBitmaps = class(TcxCustomGridTableBackgroundBitmaps) + protected + function GetBitmapStyleIndex(Index: Integer): Integer; override; + public + procedure Assign(Source: TPersistent); override; + function GetBitmap(Index: Integer): TBitmap; override; + published + property CaptionRow: TBitmap index bbCaptionRow read GetValue write SetValue; + property CardBorder: TBitmap index bbCardBorder read GetValue write SetValue; + property RowCaption: TBitmap index bbRowCaption read GetValue write SetValue; + end; + + TcxGridCardViewDateTimeHandling = class(TcxCustomGridTableDateTimeHandling); + + TcxGridCardViewFiltering = class(TcxCustomGridTableFiltering) + private + function GetRowFilteredItemsList: Boolean; + function GetRowMRUItemsList: Boolean; + function GetRowMRUItemsListCount: Integer; + function GetRowPopup: TcxGridItemFilterPopupOptions; + procedure SetRowFilteredItemsList(Value: Boolean); + procedure SetRowMRUItemsList(Value: Boolean); + procedure SetRowMRUItemsListCount(Value: Integer); + procedure SetRowPopup(Value: TcxGridItemFilterPopupOptions); + protected + procedure DefineProperties(Filer: TFiler); override; + public + // obsolete - use RowPopup.DropDownWidth + property DropDownWidth; + property RowPopupDropDownWidth: Integer read GetItemPopupDropDownWidth write SetItemPopupDropDownWidth; + // obsolete - use RowPopup.MaxDropDownItemCount + property MaxDropDownCount; + property RowPopupMaxDropDownItemCount: Integer read GetItemPopupMaxDropDownItemCount write SetItemPopupMaxDropDownItemCount; + published + property RowFilteredItemsList: Boolean read GetRowFilteredItemsList write SetRowFilteredItemsList default False; + property RowMRUItemsList: Boolean read GetRowMRUItemsList write SetRowMRUItemsList default True; + property RowMRUItemsListCount: Integer read GetRowMRUItemsListCount + write SetRowMRUItemsListCount default cxGridFilterDefaultItemMRUItemsListCount; + property RowPopup: TcxGridItemFilterPopupOptions read GetRowPopup write SetRowPopup; + end; + + TcxGridCardViewOptionsBehavior = class(TcxCustomGridTableOptionsBehavior) + private + FExpandRowOnDblClick: Boolean; + FRowCaptionHints: Boolean; + procedure SetExpandRowOnDblClick(Value: Boolean); + procedure SetRowCaptionHints(Value: Boolean); + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + published + property ExpandRowOnDblClick: Boolean read FExpandRowOnDblClick write SetExpandRowOnDblClick default True; + property PullFocusing; + property RowCaptionHints: Boolean read FRowCaptionHints write SetRowCaptionHints default True; + end; + + TcxGridCardViewOptionsCustomize = class(TcxCustomGridTableOptionsCustomize) + private + FCardExpanding: Boolean; + FCardSizing: Boolean; + FLayeredRows: Boolean; + FRowExpanding: Boolean; + function GetGridView: TcxGridCardView; + function GetRowFiltering: Boolean; + function GetRowHiding: Boolean; + function GetRowMoving: Boolean; + procedure SetCardExpanding(Value: Boolean); + procedure SetCardSizing(Value: Boolean); + procedure SetLayeredRows(Value: Boolean); + procedure SetRowExpanding(Value: Boolean); + procedure SetRowFiltering(Value: Boolean); + procedure SetRowHiding(Value: Boolean); + procedure SetRowMoving(Value: Boolean); + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + property GridView: TcxGridCardView read GetGridView; + published + property CardExpanding: Boolean read FCardExpanding write SetCardExpanding default False; + property CardSizing: Boolean read FCardSizing write SetCardSizing default True; + property LayeredRows: Boolean read FLayeredRows write SetLayeredRows default False; + property RowExpanding: Boolean read FRowExpanding write SetRowExpanding default True; + property RowFiltering: Boolean read GetRowFiltering write SetRowFiltering default True; + property RowHiding: Boolean read GetRowHiding write SetRowHiding default False; + property RowMoving: Boolean read GetRowMoving write SetRowMoving default False; + end; + + TcxGridCardViewOptionsData = class(TcxCustomGridTableOptionsData); + + TcxGridCardViewOptionsSelection = class(TcxCustomGridTableOptionsSelection) + private + FCardBorderSelection: Boolean; + procedure SetCardBorderSelection(Value: Boolean); + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + published + property CardBorderSelection: Boolean read FCardBorderSelection write SetCardBorderSelection default True; + end; + + TcxGridCardViewOptionsView = class(TcxCustomGridTableOptionsView) + private + FCaptionSeparator: Char; + FCaptionWidth: Integer; + FCardAutoWidth: Boolean; + FCardBorderWidth: Integer; + FCardExpandButtonAlignment: TcxGridCardExpandButtonAlignment; + FCardIndent: Integer; + FCardWidth: Integer; + FCategoryIndent: Integer; + FCategoryRowCaptionInRowAlternateCaption: Boolean; + FCategorySeparatorWidth: Integer; + FEmptyRows: Boolean; + FLayerSeparatorWidth: Integer; + FSeparatorColor: TColor; + FSeparatorWidth: Integer; + function GetGridView: TcxGridCardView; + function GetRowCaptionAutoHeight: Boolean; + function GetRowCaptionEndEllipsis: Boolean; + function GetShowRowFilterButtons: TcxGridShowItemFilterButtons; + procedure SetCaptionSeparator(Value: Char); + procedure SetCaptionWidth(Value: Integer); + procedure SetCardAutoWidth(Value: Boolean); + procedure SetCardBorderWidth(Value: Integer); + procedure SetCardExpandButtonAlignment(Value: TcxGridCardExpandButtonAlignment); + procedure SetCardIndent(Value: Integer); + procedure SetCardWidth(Value: Integer); + procedure SetCategoryIndent(Value: Integer); + procedure SetCategoryRowCaptionInRowAlternateCaption(Value: Boolean); + procedure SetCategorySeparatorWidth(Value: Integer); + procedure SetEmptyRows(Value: Boolean); + procedure SetLayerSeparatorWidth(Value: Integer); + procedure SetRowCaptionAutoHeight(Value: Boolean); + procedure SetRowCaptionEndEllipsis(Value: Boolean); + procedure SetSeparatorColor(Value: TColor); + procedure SetSeparatorWidth(Value: Integer); + procedure SetShowRowFilterButtons(Value: TcxGridShowItemFilterButtons); + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + function GetSeparatorColor: TColor; + property GridView: TcxGridCardView read GetGridView; + published + property CaptionSeparator: Char read FCaptionSeparator write SetCaptionSeparator default cxGridDefaultCardViewCaptionSeparator; + property CaptionWidth: Integer read FCaptionWidth write SetCaptionWidth default 0; + property CardAutoWidth: Boolean read FCardAutoWidth write SetCardAutoWidth default False; + property CardBorderWidth: Integer read FCardBorderWidth write SetCardBorderWidth + default cxGridDefaultCardBorderWidth; + property CardExpandButtonAlignment: TcxGridCardExpandButtonAlignment read FCardExpandButtonAlignment + write SetCardExpandButtonAlignment default cebaRight; + property CardIndent: Integer read FCardIndent write SetCardIndent default cxGridCardDefaultIndent; + property CardWidth: Integer read FCardWidth write SetCardWidth default cxGridCardDefaultWidth; + property CategoryIndent: Integer read FCategoryIndent write SetCategoryIndent default cxGridCardDefaultCategoryIndent; + property CategoryRowCaptionInRowAlternateCaption: Boolean read FCategoryRowCaptionInRowAlternateCaption + write SetCategoryRowCaptionInRowAlternateCaption default False; + property CategorySeparatorWidth: Integer read FCategorySeparatorWidth + write SetCategorySeparatorWidth default cxGridCardDefaultCategorySeparatorWidth; + property CellAutoHeight; + property CellTextMaxLineCount; + property EmptyRows: Boolean read FEmptyRows write SetEmptyRows default True; + property LayerSeparatorWidth: Integer read FLayerSeparatorWidth write SetLayerSeparatorWidth + default cxGridCardDefaultLayerSeparatorWidth; + property RowCaptionAutoHeight: Boolean read GetRowCaptionAutoHeight write SetRowCaptionAutoHeight default False; + property RowCaptionEndEllipsis: Boolean read GetRowCaptionEndEllipsis write SetRowCaptionEndEllipsis default False; + property SeparatorColor: TColor read FSeparatorColor write SetSeparatorColor default clDefault; + property SeparatorWidth: Integer read FSeparatorWidth write SetSeparatorWidth default cxGridDefaultCardViewSeparatorWidth; + property ShowRowFilterButtons: TcxGridShowItemFilterButtons read GetShowRowFilterButtons + write SetShowRowFilterButtons default sfbWhenSelected; + end; + + // styles + + TcxGridCardViewStyles = class(TcxCustomGridTableViewStyles) + private + FOnGetCaptionRowStyle: TcxGridGetCellStyleEvent; + FOnGetCardBorderStyle: TcxGridGetRecordStyleEvent; + FOnGetCategoryRowStyle: TcxGridGetCellStyleEvent; + FOnGetRowCaptionStyle: TcxGridGetCellStyleEvent; + function GetGridViewValue: TcxGridCardView; + procedure SetOnGetCaptionRowStyle(Value: TcxGridGetCellStyleEvent); + procedure SetOnGetCardBorderStyle(Value: TcxGridGetRecordStyleEvent); + procedure SetOnGetCategoryRowStyle(Value: TcxGridGetCellStyleEvent); + procedure SetOnGetRowCaptionStyle(Value: TcxGridGetCellStyleEvent); + protected + function GetBackgroundBitmapIndex(Index: Integer): Integer; virtual; + function GetDefaultBitmap(Index: Integer): TBitmap; virtual; + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + procedure GetCaptionRowParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); virtual; + procedure GetCardBorderParams(ARecord: TcxCustomGridRecord; out AParams: TcxViewParams); virtual; + procedure GetCardBorderVisualParams(ARecord: TcxCustomGridRecord; out AParams: TcxViewParams); virtual; + procedure GetCategoryRowParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); virtual; + procedure GetDataCellContentParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); override; + procedure GetRowCaptionParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); virtual; + property GridView: TcxGridCardView read GetGridViewValue; + published + property CaptionRow: TcxStyle index vsCaptionRow read GetValue write SetValue; + property CardBorder: TcxStyle index vsCardBorder read GetValue write SetValue; + property CategoryRow: TcxStyle index vsCategoryRow read GetValue write SetValue; + property CategorySeparator: TcxStyle index vsCategorySeparator read GetValue write SetValue; + property LayerSeparator: TcxStyle index vsLayerSeparator read GetValue write SetValue; + property RowCaption: TcxStyle index vsRowCaption read GetValue write SetValue; + property StyleSheet; + property OnGetCaptionRowStyle: TcxGridGetCellStyleEvent read FOnGetCaptionRowStyle write SetOnGetCaptionRowStyle; + property OnGetCardBorderStyle: TcxGridGetRecordStyleEvent read FOnGetCardBorderStyle write SetOnGetCardBorderStyle; + property OnGetCategoryRowStyle: TcxGridGetCellStyleEvent read FOnGetCategoryRowStyle write SetOnGetCategoryRowStyle; + property OnGetRowCaptionStyle: TcxGridGetCellStyleEvent read FOnGetRowCaptionStyle write SetOnGetRowCaptionStyle; + end; + + TcxGridCardViewStyleSheet = class(TcxCustomStyleSheet) + private + function GetStylesValue: TcxGridCardViewStyles; + procedure SetStylesValue(Value: TcxGridCardViewStyles); + public + class function GetStylesClass: TcxCustomStylesClass; override; + published + property Styles: TcxGridCardViewStyles read GetStylesValue write SetStylesValue; + end; + + // view + + TcxGridCardRowEvent = procedure(Sender: TcxGridCardView; ARow: TcxGridCardViewRow) of object; + TcxGridCardRowChangingEvent = procedure(Sender: TcxGridCardView; ARow: TcxGridCardViewRow; + var AAllow: Boolean) of object; + + TcxGridCardView = class(TcxCustomGridTableView) + private + FLayoutDirection: TcxGridCardViewLayoutDirection; + FOnRowCollapsing: TcxGridCardRowChangingEvent; + FOnRowCollapsed: TcxGridCardRowEvent; + FOnRowExpanding: TcxGridCardRowChangingEvent; + FOnRowExpanded: TcxGridCardRowEvent; + FOnRowPosChanged: TcxGridCardRowEvent; + FRowLayout: TcxGridCardViewRowLayout; + FRowLayoutController: TcxGridCardViewRowLayoutController; + function GetBackgroundBitmaps: TcxGridCardViewBackgroundBitmaps; + function GetControl: TcxCustomGrid; + function GetController: TcxGridCardViewController; + function GetDataController: TcxGridDataController; + function GetDateTimeHandling: TcxGridCardViewDateTimeHandling; + function GetFiltering: TcxGridCardViewFiltering; + function GetFirstCaptionRow: TcxGridCardViewRow; + function GetFirstCategoryRow: TcxGridCardViewRow; + function GetOptionsBehavior: TcxGridCardViewOptionsBehavior; + function GetOptionsCustomize: TcxGridCardViewOptionsCustomize; + function GetOptionsData: TcxGridCardViewOptionsData; + function GetOptionsSelection: TcxGridCardViewOptionsSelection; + function GetOptionsView: TcxGridCardViewOptionsView; + function GetPainter: TcxGridCardViewPainter; + function GetRow(Index: Integer): TcxGridCardViewRow; + function GetRowCount: Integer; + function GetStyles: TcxGridCardViewStyles; + function GetViewData: TcxGridCardViewViewData; + function GetViewInfo: TcxGridCardViewViewInfo; + function GetVisibleRow(Index: Integer): TcxGridCardViewRow; + function GetVisibleRowCount: Integer; + procedure SetBackgroundBitmaps(Value: TcxGridCardViewBackgroundBitmaps); + procedure SetDataController(Value: TcxGridDataController); + procedure SetDateTimeHandling(Value: TcxGridCardViewDateTimeHandling); + procedure SetFiltering(Value: TcxGridCardViewFiltering); + procedure SetLayoutDirection(Value: TcxGridCardViewLayoutDirection); + procedure SetOnRowCollapsed(Value: TcxGridCardRowEvent); + procedure SetOnRowCollapsing(Value: TcxGridCardRowChangingEvent); + procedure SetOnRowExpanded(Value: TcxGridCardRowEvent); + procedure SetOnRowExpanding(Value: TcxGridCardRowChangingEvent); + procedure SetOnRowPosChanged(Value: TcxGridCardRowEvent); + procedure SetOptionsBehavior(Value: TcxGridCardViewOptionsBehavior); + procedure SetOptionsCustomize(Value: TcxGridCardViewOptionsCustomize); + procedure SetOptionsData(Value: TcxGridCardViewOptionsData); + procedure SetOptionsSelection(Value: TcxGridCardViewOptionsSelection); + procedure SetOptionsView(Value: TcxGridCardViewOptionsView); + procedure SetRow(Index: Integer; Value: TcxGridCardViewRow); + procedure SetRowLayout(Value: TcxGridCardViewRowLayout); + procedure SetStyles(Value: TcxGridCardViewStyles); + procedure RefreshCategoryRowLinks; + protected + // IcxStoredObject + function GetProperties(AProperties: TStrings): Boolean; override; + procedure GetPropertyValue(const AName: string; var AValue: Variant); override; + procedure SetPropertyValue(const AName: string; const AValue: Variant); override; + // IcxGridViewLayoutEditorSupport - for design-time layout editor + procedure AssignLayout(ALayoutView: TcxCustomGridView); override; + function GetLayoutCustomizationFormButtonCaption: string; override; + + procedure CreateHandlers; override; + procedure DestroyHandlers; override; + + function GetControllerClass: TcxCustomGridControllerClass; override; + function GetDataControllerClass: TcxCustomDataControllerClass; override; + function GetPainterClass: TcxCustomGridPainterClass; override; + function GetRowLayoutControllerClass: TcxGridCardViewRowLayoutControllerClass; virtual; + function GetViewDataClass: TcxCustomGridViewDataClass; override; + function GetViewInfoClass: TcxCustomGridViewInfoClass; override; + + procedure SaveRowParams; + procedure AssignRowParams; + + function GetRowCoordinates: TcxGridCardRowCoordinatesArray; + procedure SetRowCoordinates(const ACoordinates: TcxGridCardRowCoordinatesArray); + + procedure Updating; override; + procedure Updated; override; + + procedure BeforeRestoring; override; + procedure AfterRestoring; override; + + procedure ChangeItemIndex(AItem: TcxCustomGridTableItem; Value: Integer); override; + procedure DoAssign(ASource: TcxCustomGridView); override; + function GetResizeOnBoundsChange: Boolean; override; + procedure ItemIndexChanged(AItem: TcxCustomGridTableItem; AOldIndex: Integer); override; + procedure ItemVisibilityChanged(AItem: TcxCustomGridTableItem; Value: Boolean); override; + procedure RefreshVisibleItemsList; override; + procedure RowExpandedChanged(ARow: TcxGridCardViewRow); virtual; + function RowExpandedChanging(ARow: TcxGridCardViewRow; AValue: Boolean): Boolean; virtual; + + function CalculateDataCellSelected(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; AUseViewInfo: Boolean; + ACellViewInfo: TcxGridTableCellViewInfo): Boolean; override; + function DrawCardBorderSelected(ARecord: TcxCustomGridRecord): Boolean; virtual; + + function GetBackgroundBitmapsClass: TcxCustomGridBackgroundBitmapsClass; override; + function GetDateTimeHandlingClass: TcxCustomGridTableDateTimeHandlingClass; override; + function GetFilteringClass: TcxCustomGridTableFilteringClass; override; + function GetItemClass: TcxCustomGridTableItemClass; override; + function GetOptionsBehaviorClass: TcxCustomGridOptionsBehaviorClass; override; + function GetOptionsCustomizeClass: TcxCustomGridTableOptionsCustomizeClass; override; + function GetOptionsDataClass: TcxCustomGridOptionsDataClass; override; + function GetOptionsSelectionClass: TcxCustomGridOptionsSelectionClass; override; + function GetOptionsViewClass: TcxCustomGridOptionsViewClass; override; + function GetStylesClass: TcxCustomGridViewStylesClass; override; + + function SupportsCardSizing: Boolean; virtual; + function SupportsLayeredRows: Boolean; virtual; + + procedure DoRowCollapsed(ARow: TcxGridCardViewRow); virtual; + function DoRowCollapsing(ARow: TcxGridCardViewRow): Boolean; virtual; + procedure DoRowExpanded(ARow: TcxGridCardViewRow); virtual; + function DoRowExpanding(ARow: TcxGridCardViewRow): Boolean; virtual; + procedure DoRowPositionChanged(ARow: TcxGridCardViewRow); virtual; + + property FirstCaptionRow: TcxGridCardViewRow read GetFirstCaptionRow; + property FirstCategoryRow: TcxGridCardViewRow read GetFirstCategoryRow; + public + function CreateRow: TcxGridCardViewRow; + + property Control: TcxCustomGrid read GetControl; + property Controller: TcxGridCardViewController read GetController; + property Painter: TcxGridCardViewPainter read GetPainter; + property RowCount: Integer read GetRowCount; + property Rows[Index: Integer]: TcxGridCardViewRow read GetRow write SetRow; + property RowLayoutController: TcxGridCardViewRowLayoutController read FRowLayoutController; + property ViewData: TcxGridCardViewViewData read GetViewData; + property ViewInfo: TcxGridCardViewViewInfo read GetViewInfo; + property VisibleRowCount: Integer read GetVisibleRowCount; + property VisibleRows[Index: Integer]: TcxGridCardViewRow read GetVisibleRow; + published + property BackgroundBitmaps: TcxGridCardViewBackgroundBitmaps read GetBackgroundBitmaps write + SetBackgroundBitmaps; + property DataController: TcxGridDataController read GetDataController + write SetDataController; + property DateTimeHandling: TcxGridCardViewDateTimeHandling read GetDateTimeHandling write SetDateTimeHandling; + property Filtering: TcxGridCardViewFiltering read GetFiltering write SetFiltering; + property LayoutDirection: TcxGridCardViewLayoutDirection read FLayoutDirection + write SetLayoutDirection default ldHorizontal; + property OptionsBehavior: TcxGridCardViewOptionsBehavior read GetOptionsBehavior + write SetOptionsBehavior; + property OptionsCustomize: TcxGridCardViewOptionsCustomize read GetOptionsCustomize + write SetOptionsCustomize; + property OptionsData: TcxGridCardViewOptionsData read GetOptionsData write SetOptionsData; + property OptionsSelection: TcxGridCardViewOptionsSelection read GetOptionsSelection + write SetOptionsSelection; + property OptionsView: TcxGridCardViewOptionsView read GetOptionsView write SetOptionsView; + property RowLayout: TcxGridCardViewRowLayout read FRowLayout write SetRowLayout default rlHorizontal; + property Styles: TcxGridCardViewStyles read GetStyles write SetStyles; + property OnCustomization; + property OnRowCollapsed: TcxGridCardRowEvent read FOnRowCollapsed write SetOnRowCollapsed; + property OnRowCollapsing: TcxGridCardRowChangingEvent read FOnRowCollapsing write SetOnRowCollapsing; + property OnRowExpanded: TcxGridCardRowEvent read FOnRowExpanded write SetOnRowExpanded; + property OnRowExpanding: TcxGridCardRowChangingEvent read FOnRowExpanding write SetOnRowExpanding; + property OnRowPosChanged: TcxGridCardRowEvent read FOnRowPosChanged write SetOnRowPosChanged; + end; + +implementation + +uses + SysUtils, Math, cxGeometry, cxScrollBar, cxGridStrs; + +const + CardDataIndent = 2; + CardExpandButtonOffset = 5; + CardRowDefaultWidth = 20; + CardRowExpandButtonOffset = 3; + SeparatorSizingZone = 7; + SeparatorSizingAddZone = 3; + EmptyCardHeight = 30; + + CardScrollingInterval = 300; + RowExpandingPauseTime = 800; + +procedure CalculateCardRowWidths(var AWidths: array of Integer; AAvailableWidth: Integer); +var + AAutoWidths: TcxAutoWidthObject; + AAllFixed: Boolean; + I: Integer; +begin + AAutoWidths := TcxAutoWidthObject.Create(Length(AWidths)); + try + AAllFixed := True; + for I := 0 to Length(AWidths) - 1 do + with AAutoWidths.AddItem do + begin + Width := AWidths[I]; + Fixed := Width <> 0; + AAllFixed := AAllFixed and Fixed; + if Width = 0 then Width := CardRowDefaultWidth; + end; + if AAllFixed or (AAutoWidths.Width > AAvailableWidth) then + for I := 0 to AAutoWidths.Count - 1 do + AAutoWidths[I].Fixed := False; + AAutoWidths.AvailableWidth := AAvailableWidth; + AAutoWidths.Calculate; + for I := 0 to Length(AWidths) - 1 do + AWidths[I] := AAutoWidths[I].AutoWidth; + finally + AAutoWidths.Free; + end; +end; + +{ TcxGridCardRowFilterButtonHitTest } + +class function TcxGridCardRowFilterButtonHitTest.GetHitTestCode: Integer; +begin + Result := htRowFilterButton; +end; + +class function TcxGridCardRowFilterButtonHitTest.CanClick: Boolean; +begin + Result := False; +end; + +{ TcxGridCardRowIndentHitTest } + +class function TcxGridCardRowIndentHitTest.GetHitTestCode: Integer; +begin + Result := htCardRowIndent; +end; + +{ TcxGridCardRowExpandButtonHitTest } + +class function TcxGridCardRowExpandButtonHitTest.GetHitTestCode: Integer; +begin + Result := htCardRowExpandButton; +end; + +{ TcxGridCardRowCellHitTest } + +function TcxGridCardRowCellHitTest.DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; +begin + if TcxGridCardViewRow(Item).CanMove then + Result := TcxGridCardView(GridView).Controller.GetRowDragAndDropObjectClass + else + Result := nil; +end; + +{ TcxGridCardRowCaptionHitTest } + +class function TcxGridCardRowCaptionHitTest.GetHitTestCode: Integer; +begin + Result := htRowCaption; +end; + +{ TcxGridCardScrollButtonDownHitTest } + +class function TcxGridCardScrollButtonDownHitTest.GetHitTestCode: Integer; +begin + Result := htCardScrollButtonDown; +end; + +class function TcxGridCardScrollButtonDownHitTest.CanClick: Boolean; +begin + Result := False; +end; + +{ TcxGridCardScrollButtonUpHitTest } + +class function TcxGridCardScrollButtonUpHitTest.GetHitTestCode: Integer; +begin + Result := htCardScrollButtonUp; +end; + +class function TcxGridCardScrollButtonUpHitTest.CanClick: Boolean; +begin + Result := False; +end; + +{ TcxGridCardViewSeparatorHitTest } + +class function TcxGridCardViewSeparatorHitTest.GetHitTestCode: Integer; +begin + Result := htSeparator; +end; + +function TcxGridCardViewSeparatorHitTest.Cursor: TCursor; +begin + Result := crSizeWE; +end; + +function TcxGridCardViewSeparatorHitTest.DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; +begin + Result := TcxGridCardSizingObject; +end; + +{ TcxGridCard } + +constructor TcxGridCard.Create(AViewData: TcxCustomGridTableViewData; AIndex: Integer; + const ARecordInfo: TcxRowInfo); +begin + inherited; + FExpanded := True; +end; + +function TcxGridCard.GetGridView: TcxGridCardView; +begin + Result := TcxGridCardView(inherited GridView); +end; + +procedure TcxGridCard.DoCollapse(ARecurse: Boolean); +begin + if FExpanded then + begin + if Focused then + GridView.Controller.FocusedItem := nil; + FExpanded := False; + GridView.SizeChanged; + end; +end; + +procedure TcxGridCard.DoExpand(ARecurse: Boolean); +begin + if not FExpanded then + begin + FExpanded := True; + GridView.SizeChanged; + end; +end; + +function TcxGridCard.GetExpandable: Boolean; +begin + Result := GridView.OptionsCustomize.CardExpanding; +end; + +function TcxGridCard.GetExpanded: Boolean; +begin + Result := not Expandable or FExpanded; +end; + +function TcxGridCard.GetHasCells: Boolean; +begin + Result := True; +end; + +function TcxGridCard.GetViewInfoCacheItemClass: TcxCustomGridViewInfoCacheItemClass; +begin + Result := TcxGridCardViewInfoCacheItem; +end; + +function TcxGridCard.GetViewInfoClass: TcxCustomGridRecordViewInfoClass; +begin + Result := GridView.ViewInfo.RecordsViewInfo.GetItemViewInfoClass; +end; + +procedure TcxGridCard.GetVisibleRows(ARows: TList); +var + I: Integer; + ARow: TcxGridCardViewRow; +begin + ARows.Clear; + for I := 0 to GridView.VisibleRowCount - 1 do + begin + ARow := GridView.VisibleRows[I]; + if ARow.IsVisibleInCard(Self) then ARows.Add(ARow); + end; +end; + +{ TcxGridCardViewViewData } + +function TcxGridCardViewViewData.GetCard(Index: Integer): TcxGridCard; +begin + Result := TcxGridCard(Records[Index]); +end; + +function TcxGridCardViewViewData.GetCardCount: Integer; +begin + Result := RecordCount; +end; + +function TcxGridCardViewViewData.GetRecordClass(ARecordInfo: TcxRowInfo): TcxCustomGridRecordClass; +begin + Result := TcxGridCard; +end; + +{ TcxGridCardRowContainerZone } + +constructor TcxGridCardRowContainerZone.Create(AGridRecord: TcxCustomGridRecord; + AItemIndex: Integer; AInsertionPos: TcxGridCardRowInsertionPos); +begin + inherited Create(AItemIndex); + GridRecord := AGridRecord; + InsertionPos := AInsertionPos; +end; + +function TcxGridCardRowContainerZone.GetItem: TcxGridCardViewRow; +var + AGridView: TcxGridCardView; +begin + AGridView := TcxGridCardView(GridRecord.GridView); + if (0 <= ItemIndex) and (ItemIndex < AGridView.VisibleRowCount) then + Result := AGridView.VisibleRows[ItemIndex] + else + Result := nil; +end; + +function TcxGridCardRowContainerZone.GetRecordViewInfo: TcxGridCardViewInfo; +begin + Result := TcxGridCardViewInfo(GridRecord.ViewInfo); +end; + +function TcxGridCardRowContainerZone.IsEqual(Value: TcxGridItemContainerZone): Boolean; +var + AValue: TcxGridCardRowContainerZone; +begin + AValue := Value as TcxGridCardRowContainerZone; + Result := inherited IsEqual(Value) and (GridRecord = AValue.GridRecord) and + (InsertionPos = AValue.InsertionPos); +end; + +{ TcxGridCardRowMovingObject } + +function TcxGridCardRowMovingObject.GetDestZone: TcxGridCardRowContainerZone; +begin + Result := TcxGridCardRowContainerZone(inherited DestZone); +end; + +function TcxGridCardRowMovingObject.GetGridView: TcxGridCardView; +begin + Result := TcxGridCardView(inherited GridView); +end; + +function TcxGridCardRowMovingObject.GetRowLayout: TcxGridCardViewRowLayoutObject; +begin + Result := GridView.RowLayoutController.LayoutObject; +end; + +function TcxGridCardRowMovingObject.GetSourceItem: TcxGridCardViewRow; +begin + Result := TcxGridCardViewRow(inherited SourceItem); +end; + +function TcxGridCardRowMovingObject.GetViewInfo: TcxGridCardViewViewInfo; +begin + Result := TcxGridCardViewViewInfo(inherited ViewInfo); +end; + +function TcxGridCardRowMovingObject.GetVisibleRowLayout: TcxGridCardViewVisibleRowLayoutObject; +begin + Result := GridView.RowLayoutController.VisibleLayoutObject; +end; + +procedure TcxGridCardRowMovingObject.SetDestZone(Value: TcxGridCardRowContainerZone); +begin + inherited DestZone := Value; +end; + +procedure TcxGridCardRowMovingObject.SetSourceItem(Value: TcxGridCardViewRow); +begin + inherited SourceItem := Value; +end; + +procedure TcxGridCardRowMovingObject.RowExpandingHandler(Sender: TObject); +begin + StopRowExpanding; + ExpandingRow.Expanded := True; + if ExpandingRow.Expanded then + begin + DestZone.GridRecord.MakeVisible; + Controller.DesignerModified; + AfterViewChange; + end; +end; + +function TcxGridCardRowMovingObject.AreArrowsVertical: Boolean; +begin + Result := DestZone.RecordViewInfo.IsZoneVertical(DestZone); +end; + +procedure TcxGridCardRowMovingObject.CalculateDestParams(AHitTest: TcxCustomGridHitTest; + out AContainerKind: TcxGridItemContainerKind; out AZone: TcxGridItemContainerZone); +var + ADestRow: TcxGridCardViewRow; + ALayerIndex, ALayerCount, AFirstIndexInLayer, ALastIndexInLayer: Integer; + ALastVisibleSubItem: TcxGridCardViewRow; +begin + inherited; + if AContainerKind = ckNone then + begin + AZone := ViewInfo.RecordsViewInfo.GetZone(AHitTest); + if AZone <> nil then + begin + AContainerKind := ckRows; + ADestRow := TcxGridCardRowContainerZone(AZone).Item; + if (SourceItem.Kind = rkCategory) and + (ADestRow <> nil) and (ADestRow.CategoryRow <> nil) then + begin + AZone.ItemIndex := ADestRow.CategoryRow.VisibleIndex; + ALayerIndex := ADestRow.CategoryRow.Position.LayerVisibleIndex; + ALayerCount := VisibleRowLayout.GetLayerCount(ADestRow.CategoryRow); + if ALayerCount = 1 then + begin + AFirstIndexInLayer := ADestRow.CategoryRow.Position.VisibleIndexInLayer; + ALastVisibleSubItem := VisibleRowLayout.GetLastVisibleSubItem(ADestRow.CategoryRow); + ALastIndexInLayer := ALastVisibleSubItem.Position.VisibleIndexInLayer; + if ADestRow.Position.VisibleIndexInLayer > (AFirstIndexInLayer + ALastIndexInLayer) div 2 then + begin + AZone.ItemIndex := ALastVisibleSubItem.VisibleIndex + 1; + if (TcxGridCardRowContainerZone(AZone).Item = nil) or + (TcxGridCardRowContainerZone(AZone).Item.Position.LayerVisibleIndex <> ALayerIndex) then + TcxGridCardRowContainerZone(AZone).InsertionPos := ripPrevLayer + else + TcxGridCardRowContainerZone(AZone).InsertionPos := ripSameLayer; + end + else + TcxGridCardRowContainerZone(AZone).InsertionPos := ripSameLayer; + end + else + begin + if ADestRow.Position.LayerVisibleIndex - ALayerIndex >= MulDiv(ALayerCount, 1, 2) then + AZone.ItemIndex := VisibleRowLayout.LayerFirstRowIndex[ALayerIndex + ALayerCount]; + TcxGridCardRowContainerZone(AZone).InsertionPos := ripNewLayer; + end; + end; + end; + end; +end; + +function TcxGridCardRowMovingObject.CanRemove: Boolean; +begin + Result := + (SourceItemContainerKind = ckRows) and SourceItem.CanHide and + (GridView.Controller.Customization or GridView.OptionsCustomize.RowHiding); +end; + +procedure TcxGridCardRowMovingObject.ChangeSourceItemPosition; + + function GetInsertionRowIndex: Integer; + begin + if DestZone.InsertionPos = ripPrevLayer then + Result := DestZone.ItemIndex - 1 + else + Result := DestZone.ItemIndex; + end; + + function GetLayerIndex(AInsertionRow: TcxGridCardViewRow): Integer; + begin + if DestZone.InsertionPos = ripNewLayer then + if SourceItem.Kind = rkCategory then + if AInsertionRow = nil then + Result := RowLayout.LayerCount + else + Result := AInsertionRow.Position.LayerIndex + else + begin + if AInsertionRow = nil then + Result := VisibleRowLayout.LayerCount + else + Result := AInsertionRow.Position.LayerVisibleIndex; + if Result > 0 then + Result := VisibleRowLayout.LayerFirstRow[Result - 1].Position.LayerIndex + 1; + end + else + Result := AInsertionRow.Position.LayerIndex; + end; + + function GetIndexInLayer(AInsertionRow: TcxGridCardViewRow): Integer; + var + ALayerIndex: Integer; + begin + case DestZone.InsertionPos of + ripPrevLayer: + if SourceItem.Kind = rkCategory then + Result := RowLayout.LayerRowCount[SourceItem.Position.LayerIndex] - 1 + else + begin + Result := AInsertionRow.Position.IndexInLayer + 1; + if SourceItem.Position.IndexInLayer < Result then + Dec(Result); + end; + ripSameLayer: + begin + if SourceItem.Kind = rkCategory then + Result := AInsertionRow.Position.IndexInLayer + else + if AInsertionRow.Position.VisibleIndexInLayer = 0 then + Result := 0 + else + begin + ALayerIndex := SourceItem.Position.LayerVisibleIndex; + Result := AInsertionRow.Position.VisibleIndexInLayer - 1; + Result := VisibleRowLayout.LayerRows[ALayerIndex, Result].Position.IndexInLayer + 1; + end; + if SourceItem.Position.IndexInLayer < Result then Dec(Result); + end; + else + Result := -1; + end; + end; + + function IsNewLayer: Boolean; + begin + Result := DestZone.InsertionPos = ripNewLayer; + end; + +var + AInsertionRow: TcxGridCardViewRow; +begin + if GetInsertionRowIndex = GridView.VisibleRowCount then + AInsertionRow := nil + else + AInsertionRow := GridView.VisibleRows[GetInsertionRowIndex]; + RowLayout.SetLayerIndex(SourceItem, GetLayerIndex(AInsertionRow), IsNewLayer, True); + if GetIndexInLayer(AInsertionRow) <> -1 then + RowLayout.SetIndexInLayer(SourceItem, GetIndexInLayer(AInsertionRow), True); +end; + +function TcxGridCardRowMovingObject.GetArrowAreaBounds(APlace: TcxGridArrowPlace): TRect; +begin + Result := DestZone.RecordViewInfo.GetZoneBounds(DestZone); +end; + +function TcxGridCardRowMovingObject.GetArrowsClientRect: TRect; +begin + Result := DestZone.RecordViewInfo.ContentBounds; +end; + +function TcxGridCardRowMovingObject.GetSourceItemViewInfo: TcxCustomGridCellViewInfo; +begin + if SourceItemContainerKind = ckRows then + Result := ViewInfo.RecordsViewInfo.GetRealItem(FSourceGridRecord).RowViewInfos[SourceItem.VisibleIndex] + else + Result := inherited GetSourceItemViewInfo; +end; + +function TcxGridCardRowMovingObject.IsValidDestination: Boolean; +begin + Result := DestItemContainerKind = ckRows; + if Result then + begin + Result := not SourceItem.Visible; + if not Result then + if DestZone.InsertionPos = ripPrevLayer then + Result := SourceItem.VisibleIndex <> DestZone.ItemIndex - 1 + else + begin + Result := (DestZone.ItemIndex < SourceItem.VisibleIndex) or + (SourceItem.VisibleIndex + 1 < DestZone.ItemIndex); + if not Result then + case DestZone.InsertionPos of + ripNewLayer: + Result := not VisibleRowLayout.IsWholeLayer(SourceItem); + ripSameLayer: + Result := DestZone.Item.Position.LayerIndex <> SourceItem.Position.LayerIndex; + end; + end; + // do not allow to insert category row just after its items + if Result and (SourceItem.Kind = rkCategory) and SourceItem.Visible and SourceItem.Expanded and + ((DestZone.InsertionPos <> ripNewLayer) or VisibleRowLayout.IsWholeLayer(SourceItem)) and + ((DestZone.Item = nil) or + (DestZone.Item.Kind = rkCategory) and (SourceItem.VisibleIndex < DestZone.ItemIndex)) and + (GridView.VisibleRows[DestZone.ItemIndex - 1].CategoryRow = SourceItem) then + Result := False; + end; +end; + +procedure TcxGridCardRowMovingObject.BeginDragAndDrop; +begin + TcxGridCardViewController(Controller).IsReadyForImmediateEditing := False; + inherited; +end; + +procedure TcxGridCardRowMovingObject.DragAndDrop(const P: TPoint; var Accepted: Boolean); +var + AKeepRowExpanding: Boolean; + AHitTest: TcxCustomGridHitTest; +begin + inherited; + AKeepRowExpanding := False; + if DestItemContainerKind = ckRows then + begin + AHitTest := ViewInfo.GetHitTest(P); + if AHitTest.HitTestCode = htCardRowExpandButton then + begin + StartRowExpanding(TcxGridCardViewRow(TcxGridCardRowExpandButtonHitTest(AHitTest).Item)); + AKeepRowExpanding := True; + end + end; + if not AKeepRowExpanding then StopRowExpanding; +end; + +procedure TcxGridCardRowMovingObject.EndDragAndDrop(Accepted: Boolean); +var + ARowPositionChanged: Boolean; +begin + StopRowExpanding; + inherited; + if Accepted then + begin + ARowPositionChanged := False; + GridView.BeginUpdate; + try + if DestItemContainerKind = ckRows then + if IsValidDestination then + begin + ChangeSourceItemPosition; + SourceItem.Visible := True; + SourceItem.MakeVisible; + ARowPositionChanged := True; + end + else + else + if CanRemove then + begin + SourceItem.Visible := False; + ARowPositionChanged := True; + end; + finally + GridView.EndUpdate; + end; + if ARowPositionChanged then + GridView.DoRowPositionChanged(SourceItem); + end; +end; + +procedure TcxGridCardRowMovingObject.StartRowExpanding(ARow: TcxGridCardViewRow); +begin + if (FRowExpandingTimer <> nil) and (FExpandingRow = ARow) then Exit; + StopRowExpanding; + FExpandingRow := ARow; + FRowExpandingTimer := TcxTimer.Create(nil); + FRowExpandingTimer.Interval := RowExpandingPauseTime; + FRowExpandingTimer.OnTimer := RowExpandingHandler; +end; + +procedure TcxGridCardRowMovingObject.StopRowExpanding; +begin + FreeAndNil(FRowExpandingTimer); +end; + +procedure TcxGridCardRowMovingObject.Init(const P: TPoint; AParams: TcxCustomGridHitTest); +begin + inherited; + with AParams as TcxGridCardRowCellHitTest do + begin + SourceGridRecord := GridRecord; + SourceItem := TcxGridCardViewRow(Item); + end; + if AParams is TcxGridCardRowCaptionHitTest then + SourceItemContainerKind := TcxGridCardRowCaptionHitTest(AParams).RowContainerKind + else + SourceItemContainerKind := ckRows; +end; + +{ TcxGridCardSizingObject } + +constructor TcxGridCardSizingObject.Create(AControl: TcxControl); +begin + inherited; + FSeparators := TList.Create; +end; + +destructor TcxGridCardSizingObject.Destroy; +begin + ClearSeparators; + FSeparators.Free; + inherited; +end; + +function TcxGridCardSizingObject.GetGridView: TcxGridCardView; +begin + Result := TcxGridCardView(inherited GridView); +end; + +function TcxGridCardSizingObject.GetSeparator(Index: Integer): TRect; +begin + Result := PRect(FSeparators[Index])^; +end; + +function TcxGridCardSizingObject.GetSeparatorCount: Integer; +begin + Result := FSeparators.Count; +end; + +function TcxGridCardSizingObject.GetViewInfo: TcxGridCardViewViewInfo; +begin + Result := TcxGridCardViewViewInfo(inherited ViewInfo); +end; + +procedure TcxGridCardSizingObject.SetDestPointX(Value: Integer); +var + APrevWidth: Integer; +begin + if FDestPointX <> Value then + begin + APrevWidth := CurrentWidth; + FDestPointX := Value; + if CurrentWidth <> APrevWidth then + Dirty := True; + end; +end; + +procedure TcxGridCardSizingObject.DirtyChanged; +begin + if not Dirty then + begin + ClearSeparators; + CalculateSeparators; + end; + DrawSeparators; +end; + +function TcxGridCardSizingObject.GetCurrentWidth: Integer; +begin + Result := OriginalWidth + DeltaWidth; + if Result < cxGridCardMinWidth then Result := cxGridCardMinWidth; +end; + +function TcxGridCardSizingObject.GetDeltaWidth: Integer; +begin + Result := (DestPointX - SourcePoint.X) div (FCardColumnIndex + 1); +end; + +function TcxGridCardSizingObject.GetDragAndDropCursor(Accepted: Boolean): TCursor; +begin + if Accepted then + Result := crSizeWE + else + Result := inherited GetDragAndDropCursor(Accepted); +end; + +function TcxGridCardSizingObject.GetImmediateStart: Boolean; +begin + Result := True; +end; + +function TcxGridCardSizingObject.GetOriginalWidth: Integer; +begin + Result := GridView.ViewInfo.RecordsViewInfo.CardWidth; +end; + +procedure TcxGridCardSizingObject.BeginDragAndDrop; +begin + FDestPointX := CurMousePos.X; + inherited; +end; + +procedure TcxGridCardSizingObject.DragAndDrop(const P: TPoint; + var Accepted: Boolean); +begin + DestPointX := P.X; + Accepted := True; + inherited; +end; + +procedure TcxGridCardSizingObject.EndDragAndDrop(Accepted: Boolean); +begin + inherited; + if Accepted then + GridView.OptionsView.CardWidth := CurrentWidth; +end; + +procedure TcxGridCardSizingObject.AddSeparator(const R: TRect); +var + ANewSeparator: PRect; +begin + New(ANewSeparator); + ANewSeparator^ := R; + FSeparators.Add(ANewSeparator); +end; + +procedure TcxGridCardSizingObject.CalculateSeparators; +var + ACardIndent, ACardWidth, APrevCardRight: Integer; + R: TRect; +begin + ACardIndent := GridView.OptionsView.CardIndent; + ACardWidth := CurrentWidth; + with ViewInfo.ClientBounds do + begin + R.Right := Left; + R.Top := Top + ACardIndent; + R.Bottom := Bottom - ACardIndent; + end; + repeat + R.Left := R.Right + ACardIndent + ACardWidth; + APrevCardRight := R.Left; + if GridView.LayoutDirection = ldHorizontal then + Inc(R.Left, ACardIndent) + else + Inc(R.Left, (ACardIndent - ViewInfo.SeparatorsViewInfo.Width) div 2); + if R.Left >= ViewInfo.ClientBounds.Right then Exit; + R.Right := R.Left + ViewInfo.SeparatorsViewInfo.Width; + AddSeparator(R); + if GridView.LayoutDirection = ldVertical then + R.Right := APrevCardRight; + until False; +end; + +procedure TcxGridCardSizingObject.ClearSeparators; +var + I: Integer; +begin + for I := 0 to SeparatorCount - 1 do + Dispose(PRect(FSeparators[I])); + FSeparators.Clear; +end; + +procedure TcxGridCardSizingObject.DrawSeparators; +var + I: Integer; +begin + for I := 0 to SeparatorCount - 1 do + Canvas.InvertRect(Separators[I]); +end; + +procedure TcxGridCardSizingObject.Init(const P: TPoint; AParams: TcxCustomGridHitTest); +begin + inherited; + FCardColumnIndex := (AParams as TcxGridCardViewSeparatorHitTest).Index; +end; + +{ TcxGridCardRowsListBox } + +function TcxGridCardRowsListBox.GetGridView: TcxGridCardView; +begin + Result := TcxGridCardView(inherited GridView); +end; + +function TcxGridCardRowsListBox.CalculateItemHeight: Integer; +begin + Result := TcxGridCardRowCaptionViewInfo.GetCellHeight(Canvas.TextHeight('Qq'), + LookAndFeelPainter); +end; + +function TcxGridCardRowsListBox.GetDragAndDropParams: TcxCustomGridHitTest; +begin + Result := TcxGridCardRowCaptionHitTest.Instance(Point(-1, -1)); + with TcxGridCardRowCaptionHitTest(Result) do + begin + GridView := Self.GridView; + GridRecord := nil; + Item := TcxCustomGridTableItem(DragAndDropItem); + RowContainerKind := ckCustomizationForm; + end; +end; + +procedure TcxGridCardRowsListBox.PaintItem(ACanvas: TcxCanvas; R: TRect; + AIndex: Integer; AFocused: Boolean); +begin + with ACanvas do + begin + FillRect(R); + Inc(R.Left, cxGridCellTextOffset); + DrawText(Items[AIndex], R, cxAlignLeft or cxAlignVCenter or cxSingleLine or + Ord(GridView.OptionsView.RowCaptionEndEllipsis) * cxShowEndEllipsis); + end; +end; + +procedure TcxGridCardRowsListBox.RefreshItems; +begin + inherited; + RefreshItemsAsTableItems; +end; + +{ TcxGridCardViewCustomizationForm } + +function TcxGridCardViewCustomizationForm.GetItemsListBoxClass: TcxCustomGridTableItemsListBoxClass; +begin + Result := TcxGridCardRowsListBox; +end; + +function TcxGridCardViewCustomizationForm.GetItemsPageCaption: string; +begin + Result := cxGetResourceString(@scxGridCustomizationFormRowsPageCaption); +end; + +{ TcxGridCardViewControllerImpl } + +constructor TcxGridCardViewControllerImpl.Create(AController: TcxGridCardViewController); +begin + inherited Create; + FController := AController; +end; + +function TcxGridCardViewControllerImpl.GetControl: TcxControl; +begin + Result := FController.Control; +end; + +function TcxGridCardViewControllerImpl.GetDataController: TcxCustomDataController; +begin + Result := FController.DataController; +end; + +function TcxGridCardViewControllerImpl.GetScrollBarOffsetBegin: Integer; +begin + Result := FController.ScrollBarOffsetBegin; +end; + +function TcxGridCardViewControllerImpl.GetScrollBarOffsetEnd: Integer; +begin + Result := FController.ScrollBarOffsetEnd; +end; + +function TcxGridCardViewControllerImpl.GetViewData: TcxGridCardViewViewData; +begin + Result := FController.ViewData; +end; + +function TcxGridCardViewControllerImpl.GetViewInfo: TcxGridCardViewViewInfo; +begin + Result := FController.ViewInfo; +end; + +procedure TcxGridCardViewControllerImpl.KeyDown(var Key: Word; Shift: TShiftState); +begin +end; + +{ TcxGridCardViewControllerHorizontalImpl } + +procedure TcxGridCardViewControllerHorizontalImpl.FocusRecordInNextColumn(ADirection: TcxDirection; + AIsSelecting: Boolean); +var + ARecordViewInfo: TcxGridCardViewInfo; + ACheckPos: Integer; + + function MarginCol(AIsLeftDirection: Boolean): Integer; + begin + if AIsLeftDirection then + Result := 0 + else + Result := ViewInfo.RecordsViewInfo.Columns.VisibleCount - 1; + end; + + function NextCol: Integer; + begin + if ARecordViewInfo = nil then + Result := MarginCol(ADirection = dirRight) + else + if ADirection = dirLeft then + Result := ARecordViewInfo.Col - 1 + else + Result := ARecordViewInfo.Col + 1; + end; + + function MarginRecordIndex: Integer; + begin + if ADirection = dirLeft then + Result := 0 + else + Result := ViewData.RecordCount - 1; + end; + +begin + with Controller do + try + if FocusedRecordIndex = -1 then + begin + if ADirection = dirLeft then + GoToFirst + else + GoToLast(False); + Exit; + end; + MakeFocusedRecordVisible; + ARecordViewInfo := ViewInfo.RecordsViewInfo.GetRealItem(FocusedRecord); + ACheckPos := ARecordViewInfo.Bounds.Top; + if ARecordViewInfo.Col = MarginCol(ADirection = dirLeft) then + begin + ScrollData(ADirection); + ARecordViewInfo := ViewInfo.RecordsViewInfo.GetRealItem(FocusedRecord); + if (ARecordViewInfo <> nil) and + (ARecordViewInfo.Col = MarginCol(ADirection = dirLeft)) then + begin + if ARecordViewInfo.Bounds.Top <> ACheckPos then + GoToPrev(False) + else + if GridView.IsDetail then + FocusNextRecord(MarginRecordIndex, ADirection = dirRight, False, + not AIsSelecting, not AIsSelecting); + Exit; + end; + end; + ARecordViewInfo := ViewInfo.RecordsViewInfo.Columns[NextCol].GetNearestRow(ACheckPos); + FocusedRecord := ARecordViewInfo.GridRecord; + finally + MakeFocusedItemVisible; + end; +end; + +function TcxGridCardViewControllerHorizontalImpl.GetIsRecordsScrollHorizontal: Boolean; +begin + Result := True; +end; + +function TcxGridCardViewControllerHorizontalImpl.GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; +begin + Result := mwskHorizontal; +end; + +function TcxGridCardViewControllerHorizontalImpl.GetScrollDelta: Integer; +begin + if ViewInfo.RecordsViewInfo.Columns.Count = 0 then + Result := 0 + else + Result := ViewInfo.RecordsViewInfo.Columns[0].RowCount +end; + +procedure TcxGridCardViewControllerHorizontalImpl.InitScrollBarsParameters; +begin + with Controller do + begin + SetScrollBarInfo(sbHorizontal, 0, ScrollBarRecordCount - 1, + ScrollDelta, ViewInfo.VisibleRecordCount, ScrollBarPos, True, CanHScrollBarHide); + SetScrollBarInfo(sbVertical, 0, -1, 0, 0, 0, True, True); + end; +end; + +procedure TcxGridCardViewControllerHorizontalImpl.KeyDown(var Key: Word; + Shift: TShiftState); +begin + inherited; + case Key of + VK_LEFT: + FocusRecordInNextColumn(dirLeft, ssShift in Shift); + VK_RIGHT: + FocusRecordInNextColumn(dirRight, ssShift in Shift); + VK_UP: + Controller.GoToPrev(not (ssShift in Shift), False); + VK_DOWN: + Controller.GoToNext(not (ssShift in Shift), False); + end; +end; + +{ TcxGridCardViewControllerVerticalImpl } + +procedure TcxGridCardViewControllerVerticalImpl.FocusRecordInNextRow(ADirection: TcxDirection; + AIsSelecting: Boolean); +var + ANewFocusedRecordIndex: Integer; + AIsNewFocusedRecordOutOfRange: Boolean; + + function NextRecordIndex: Integer; + begin + with Controller do + if ADirection = dirUp then + Result := FocusedRecordIndex - ScrollDelta + else + Result := FocusedRecordIndex + ScrollDelta; + end; + + function IsOnBound: Boolean; + begin + Result := + DataController.IsGridMode and + (DataController.IsBOF and (ADirection = dirUp) or + DataController.IsEOF and (ADirection = dirDown)) or + not DataController.IsGridMode and AIsNewFocusedRecordOutOfRange; + end; + + function MarginRecordIndex: Integer; + begin + if ADirection = dirUp then + Result := 0 + else + Result := ViewData.RecordCount - 1; + end; + +begin + with Controller do + begin + if FocusedRecordIndex = -1 then + begin + if ADirection = dirUp then + GoToFirst + else + GoToLast(False); + Exit; + end; + MakeFocusedRecordVisible; + ANewFocusedRecordIndex := NextRecordIndex; + AIsNewFocusedRecordOutOfRange := (ANewFocusedRecordIndex < 0) or + (ANewFocusedRecordIndex > ViewData.RecordCount - 1); + if IsOnBound then + begin + if GridView.IsDetail then + FocusNextRecord(MarginRecordIndex, ADirection = dirDown, False, + not AIsSelecting, not AIsSelecting); + Exit; + end; + if DataController.IsGridMode and AIsNewFocusedRecordOutOfRange or + not ViewData.Records[ANewFocusedRecordIndex].Visible then + begin + ScrollData(ADirection); + if AIsNewFocusedRecordOutOfRange then + begin + if ANewFocusedRecordIndex < 0 then ANewFocusedRecordIndex := 0; + if ANewFocusedRecordIndex > ViewData.RecordCount - 1 then + ANewFocusedRecordIndex := ViewData.RecordCount - 1; + end; + end; + FocusedRecordIndex := ANewFocusedRecordIndex; + end; +end; + +function TcxGridCardViewControllerVerticalImpl.GetIsRecordsScrollHorizontal: Boolean; +begin + Result := False; +end; + +function TcxGridCardViewControllerVerticalImpl.GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; +begin + Result := mwskVertical; +end; + +function TcxGridCardViewControllerVerticalImpl.GetScrollDelta: Integer; +begin + Result := ViewInfo.RecordsViewInfo.Columns.Count; +end; + +procedure TcxGridCardViewControllerVerticalImpl.InitScrollBarsParameters; +begin + with Controller do + begin + SetScrollBarInfo(sbHorizontal, 0, -1, 0, 0, 0, True, CanHScrollBarHide); + SetScrollBarInfo(sbVertical, 0, ScrollBarRecordCount - 1, + ScrollDelta, ViewInfo.VisibleRecordCount, ScrollBarPos, True, True); + end; +end; + +procedure TcxGridCardViewControllerVerticalImpl.KeyDown(var Key: Word; + Shift: TShiftState); +begin + inherited; + case Key of + VK_LEFT: + begin + Controller.GoToPrev(not (ssShift in Shift), False); + Controller.MakeFocusedItemVisible; + end; + VK_RIGHT: + begin + Controller.GoToNext(not (ssShift in Shift), False); + Controller.MakeFocusedItemVisible; + end; + VK_UP: + FocusRecordInNextRow(dirUp, ssShift in Shift); + VK_DOWN: + FocusRecordInNextRow(dirDown, ssShift in Shift); + end; +end; + +{ TcxGridCardViewController } + +constructor TcxGridCardViewController.Create(AGridView: TcxCustomGridView); +begin + inherited; + CreateImplementationObject; +end; + +destructor TcxGridCardViewController.Destroy; +begin + DestroyImplementationObject; + inherited; +end; + +function TcxGridCardViewController.GetCustomizationForm: TcxGridCardViewCustomizationForm; +begin + Result := TcxGridCardViewCustomizationForm(inherited CustomizationForm); +end; + +function TcxGridCardViewController.GetFocusedCard: TcxGridCard; +begin + Result := TcxGridCard(FocusedRecord); +end; + +function TcxGridCardViewController.GetFocusedCardViewInfo: TcxGridCardViewInfo; +begin + if FocusedRecord = nil then + Result := nil + else + Result := TcxGridCardViewInfo(FocusedRecord.ViewInfo); +end; + +function TcxGridCardViewController.GetFocusedRow: TcxGridCardViewRow; +begin + Result := TcxGridCardViewRow(inherited FocusedItem); +end; + +function TcxGridCardViewController.GetGridView: TcxGridCardView; +begin + Result := TcxGridCardView(inherited GridView); +end; + +function TcxGridCardViewController.GetScrollDelta: Integer; +begin + Result := ImplementationObject.GetScrollDelta; +end; + +function TcxGridCardViewController.GetTopCardIndex: Integer; +begin + Result := TopRecordIndex; +end; + +function TcxGridCardViewController.GetViewData: TcxGridCardViewViewData; +begin + Result := TcxGridCardViewViewData(inherited ViewData); +end; + +function TcxGridCardViewController.GetViewInfo: TcxGridCardViewViewInfo; +begin + Result := TcxGridCardViewViewInfo(inherited ViewInfo); +end; + +procedure TcxGridCardViewController.SetFocusedCard(Value: TcxGridCard); +begin + FocusedRecord := Value; +end; + +procedure TcxGridCardViewController.SetFocusedRow(Value: TcxGridCardViewRow); +begin + inherited FocusedItem := Value; +end; + +procedure TcxGridCardViewController.SetScrollCardViewInfo(Value: TcxGridCardViewInfo); +var + AScrollDirection: TcxDirection; +begin + if FScrollCardViewInfo <> Value then + begin + AScrollDirection := ScrollDirection; + ScrollDirection := dirNone; + FScrollCardViewInfo := Value; + if FScrollCardViewInfo <> nil then + ScrollDirection := AScrollDirection; + end; +end; + +procedure TcxGridCardViewController.SetTopCardIndex(Value: Integer); +begin + TopRecordIndex := Value; +end; + +procedure TcxGridCardViewController.CreateImplementationObject; +begin + FImplementationObject := GetImplementationObjectClass.Create(Self); +end; + +procedure TcxGridCardViewController.DestroyImplementationObject; +begin + FreeAndNil(FImplementationObject); +end; + +function TcxGridCardViewController.GetImplementationObjectClass: TcxGridCardViewControllerImplClass; +begin + case GridView.LayoutDirection of + ldHorizontal: + Result := TcxGridCardViewControllerHorizontalImpl; + ldVertical: + Result := TcxGridCardViewControllerVerticalImpl; + else + Result := nil; + end; +end; + +function TcxGridCardViewController.CanFocusNextItem(AFocusedItemIndex, ANextItemIndex: Integer; + AGoForward, AGoOnCycle, AGoToNextRecordOnCycle: Boolean): Boolean; +begin + Result := inherited CanFocusNextItem(AFocusedItemIndex, ANextItemIndex, AGoForward, AGoOnCycle, AGoToNextRecordOnCycle) and + (not AGoToNextRecordOnCycle or + (not AGoForward and (not CanScrollFocusedCard(False) or (ANextItemIndex < AFocusedItemIndex)) or + AGoForward and (not CanScrollFocusedCard(True) or (ANextItemIndex > AFocusedItemIndex)))); +end; + +type + TCanFocusRowData = class + Card: TcxGridCard; + Rows: TList; + end; + +function CanFocusRow(AOwner: TcxCustomGridTableView; AItemIndex: Integer; AData: TObject): Boolean; +begin + Result := TcxGridCardViewRow(TCanFocusRowData(AData).Rows[AItemIndex]).CanFocus(TCanFocusRowData(AData).Card); +end; + +function TcxGridCardViewController.FindNextRow(ACard: TcxGridCard; ARows: TList; + ARow: TcxGridCardViewRow; AGoForward, AGoOnCycle: Boolean; out ACycleChanged: Boolean): TcxGridCardViewRow; +var + AData: TCanFocusRowData; + ARowIndex: Integer; +begin + AData := TCanFocusRowData.Create; + try + AData.Card := ACard; + AData.Rows := ARows; + if FindNextCustomItem(ARows.IndexOf(ARow), ARows.Count, + AGoForward, AGoOnCycle, @CanFocusRow, AData, ARowIndex, ACycleChanged) then + Result := TcxGridCardViewRow(ARows[ARowIndex]) + else + Result := nil; + finally + AData.Free; + end; +end; + +function TcxGridCardViewController.GetDesignHitTest(AHitTest: TcxCustomGridHitTest): Boolean; +begin + Result := inherited GetDesignHitTest(AHitTest); + if not Result then + Result := AHitTest.HitTestCode in [htExpandButton, htCardRowExpandButton, htRowCaption, htCell]; +end; + +function TcxGridCardViewController.GetDragScrollInterval: Integer; +begin + Result := 300; +end; + +function TcxGridCardViewController.GetIsRecordsScrollHorizontal: Boolean; +begin + Result := FImplementationObject.GetIsRecordsScrollHorizontal; +end; + +function TcxGridCardViewController.GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; +begin + Result := FImplementationObject.GetMouseWheelScrollingKind; +end; + +function TcxGridCardViewController.IsKeyForMultiSelect(AKey: Word; + AShift: TShiftState; AFocusedRecordChanged: Boolean): Boolean; +begin + Result := inherited IsKeyForMultiSelect(AKey, AShift, AFocusedRecordChanged) or + (AKey = VK_LEFT) or (AKey = VK_RIGHT) or + ((AKey = VK_UP) or (AKey = VK_DOWN) or (AKey = VK_HOME) or (AKey = VK_END)) and + (not GridView.OptionsSelection.CellSelect or (FocusedItem = nil) or + AFocusedRecordChanged); +end; + +function TcxGridCardViewController.ProcessFocusedRowKeys(var AKey: Word; + AShift: TShiftState; ARowGoOnCycle: Boolean): Boolean; +begin + Result := False; + if FocusedRow <> nil then + case AKey of + VK_LEFT, VK_RIGHT: + Result := FocusNextRowHorizontally(AKey = VK_RIGHT, ARowGoOnCycle); + VK_UP, VK_DOWN: + Result := FocusNextRowVertically(AKey = VK_DOWN, ARowGoOnCycle); + VK_HOME: + if AShift = [] then + begin + FocusNextItem(-1, True, False, False); + Result := True; + end; + VK_END: + if AShift = [] then + begin + FocusNextItem(-1, False, True, False); + Result := True; + end; + VK_ESCAPE: + if GridView.OptionsSelection.InvertSelect and (FocusedRow <> nil) then + begin + FocusedRow := nil; + Result := True; + end; + end + else + if AKey = VK_F2 then + Result := FocusNextItem(-1, True, False, False); +end; + +procedure TcxGridCardViewController.RowExpandedChanged(ARow: TcxGridCardViewRow); +begin +end; + +procedure TcxGridCardViewController.RowExpandedChanging(ARow: TcxGridCardViewRow; + AValue: Boolean); +begin + if IsDragging then + DragAndDropObject.BeforeViewChange; +end; + +procedure TcxGridCardViewController.ScrollData(ADirection: TcxDirection); +begin + if Site.DragAndDropState = ddsNone then + ScrollRecords(ADirection in [dirRight, dirDown], ScrollDelta) + else + with FScrollCardViewInfo do + case ADirection of + dirUp: + TopRowIndex := TopRowIndex - 1; + dirDown: + TopRowIndex := TopRowIndex + 1; + end; +end; + +function TcxGridCardViewController.CanScrollData(ADirection: TcxDirection): Boolean; +begin + with FScrollCardViewInfo do + case ADirection of + dirUp: + Result := NeedsScrollingUp; + dirDown: + Result := NeedsScrollingDown; + else + Result := inherited CanScrollData(ADirection); + end; +end; + +function TcxGridCardViewController.GetScrollDataTimeInterval(ADirection: TcxDirection): Integer; +begin + if ADirection in [dirUp, dirDown] then + Result := CardScrollingInterval + else + Result := inherited GetScrollDataTimeInterval(ADirection); +end; + +function TcxGridCardViewController.GetCustomizationFormClass: TcxCustomGridCustomizationFormClass; +begin + Result := TcxGridCardViewCustomizationForm; +end; + +function TcxGridCardViewController.GetRowDragAndDropObjectClass: TcxGridCardRowMovingObjectClass; +begin + Result := TcxGridCardRowMovingObject; +end; + +procedure TcxGridCardViewController.CheckScrolling(const P: TPoint); +var + AHitTest: TcxCustomGridHitTest; +begin + AHitTest := ViewInfo.GetHitTest(P); + case AHitTest.HitTestCode of + htCardScrollButtonUp, htCardScrollButtonDown: + begin + ScrollCardViewInfo := + TcxCustomGridCardScrollButtonViewInfo(AHitTest.ViewInfo).CardViewInfo; + if AHitTest.HitTestCode = htCardScrollButtonUp then + ScrollDirection := dirUp + else + ScrollDirection := dirDown; + end + else + ScrollDirection := dirNone; + end; +end; + +function TcxGridCardViewController.IsDataFullyVisible(AIsCallFromMaster: Boolean = False): Boolean; +var + I: Integer; +begin + Result := True; + for I := 0 to ViewInfo.RecordsViewInfo.PartVisibleCount - 1 do + begin + Result := ViewInfo.RecordsViewInfo[I].IsFullyVisible; + if not Result then Break; + end; + if Result then + Result := inherited IsDataFullyVisible(AIsCallFromMaster); +end; + +procedure TcxGridCardViewController.MakeItemVisible(AItem: TcxCustomGridTableItem); +var + ARow: TcxGridCardViewRow; +begin + ARow := TcxGridCardViewRow(AItem); + if (ARow <> nil) and (ARow.CategoryRow <> nil) then + ARow.CategoryRow.Expanded := True; + MakeFocusedRecordVisible; + if (ARow <> nil) and (FocusedCardViewInfo <> nil) and + not TcxCustomGrid(Control).UpdateLocked then + FocusedCardViewInfo.MakeRowVisible(ARow); +end; + +function TcxGridCardViewController.CanScrollFocusedCard(ADown: Boolean): Boolean; +begin + Result := (FocusedCardViewInfo <> nil) and + (not ADown and FocusedCardViewInfo.NeedsScrollingUp or + ADown and FocusedCardViewInfo.NeedsScrollingDown); +end; + +function TcxGridCardViewController.ScrollFocusedCard(ADown: Boolean): Boolean; +var + APrevTopRowIndex: Integer; +begin + Result := (FocusedCardViewInfo <> nil) and CanScrollFocusedCard(ADown); + if Result then + with FocusedCardViewInfo do + begin + APrevTopRowIndex := TopRowIndex; + TopRowIndex := TopRowIndex + 2 * Ord(ADown) - 1; + Result := TopRowIndex <> APrevTopRowIndex; + end; +end; + +procedure TcxGridCardViewController.InitScrollBarsParameters; +begin + ImplementationObject.InitScrollBarsParameters; +end; + +procedure TcxGridCardViewController.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +begin + case AScrollCode of + scLineUp: + ScrollData(dirLeft); + scLineDown: + ScrollData(dirRight); + scPageUp: + ScrollPage(False); + scPageDown: + ScrollPage(True); + scTrack: + if not DataController.IsGridMode then + //TopCardIndex := AScrollPos; + ScrollBarPos := AScrollPos; + scPosition: + if DataController.IsGridMode then + ScrollBarPos := AScrollPos; + end; + AScrollPos := ScrollBarPos; +end; + +procedure TcxGridCardViewController.KeyDown(var Key: Word; Shift: TShiftState); +var + APrevFocusedRecordIndex: Integer; +begin + if (FocusedRecordIndex <> -1) and (FocusedRow <> nil) and FocusedRow.CanExpand then + case Key of + VK_ADD: + if not FocusedRow.Expanded then + begin + EatKeyPress := True; + FocusedRow.Expanded := True; + MakeFocusedRecordVisible; + Key := 0; + end; + VK_SUBTRACT: + if FocusedRow.Expanded then + begin + EatKeyPress := True; + FocusedRow.Expanded := False; + MakeFocusedRecordVisible; + Key := 0; + end; + end; + inherited; + if FocusedRecordIndex <> -1 then + begin + if GridView.OptionsSelection.CellSelect and ProcessFocusedRowKeys(Key, Shift, False) then + Exit; + if ((Key = VK_UP) or (Key = VK_DOWN)) and ScrollFocusedCard(Key = VK_DOWN) then + Exit; + end; + APrevFocusedRecordIndex := FocusedRecordIndex; + case Key of + VK_HOME: + GoToFirst(False); + VK_END: + GoToLast(False, False); + end; + ImplementationObject.KeyDown(Key, Shift); + if (FocusedRecordIndex <> APrevFocusedRecordIndex) and + (FocusedRecordIndex <> -1) and GridView.OptionsSelection.CellSelect then + ProcessFocusedRowKeys(Key, Shift, True); +end; + +procedure TcxGridCardViewController.LayoutDirectionChanged; +begin + DestroyImplementationObject; + CreateImplementationObject; +end; + +function TcxGridCardViewController.FocusNextRowHorizontally(AGoForward, AGoOnCycle: Boolean): Boolean; +var + ARow: TcxGridCardViewRow; + ACycleChanged: Boolean; +begin + Result := FocusedRecordHasCells(True); + if Result then + begin + ARow := GridView.RowLayoutController.FindNextRowHorizontally(FocusedCard, + FocusedRow, AGoForward, AGoOnCycle, ACycleChanged); + Result := ARow <> nil; + if Result then + ARow.Focused := True; + end; +end; + +function TcxGridCardViewController.FocusNextRowVertically(AGoForward, AGoOnCycle: Boolean): Boolean; +var + ARow: TcxGridCardViewRow; + ACycleChanged: Boolean; +begin + Result := FocusedRecordHasCells(True); + if Result then + begin + ARow := GridView.RowLayoutController.FindNextRowVertically(FocusedCard, + FocusedRow, AGoForward, AGoOnCycle, ACycleChanged); + Result := ARow <> nil; + if Result then + ARow.Focused := True; + end; +end; + +{ TcxCustomGridCardRowLayoutObject } + +constructor TcxCustomGridCardRowLayoutObject.Create; +begin + inherited; + FLayerRowCounts := TList.Create; +end; + +destructor TcxCustomGridCardRowLayoutObject.Destroy; +begin + FLayerRowCounts.Free; + inherited; +end; + +function TcxCustomGridCardRowLayoutObject.GetLayerCount: Integer; +begin + Result := FLayerRowCounts.Count; +end; + +function TcxCustomGridCardRowLayoutObject.GetLayerFirstRow(ALayerIndex: Integer): TcxGridCardViewRow; +begin + Result := Rows[LayerFirstRowIndex[ALayerIndex]]; +end; + +function TcxCustomGridCardRowLayoutObject.GetLayerFirstRowIndex(ALayerIndex: Integer): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to ALayerIndex - 1 do + Inc(Result, LayerRowCount[I]); +end; + +function TcxCustomGridCardRowLayoutObject.GetLayerRow(ALayerIndex, AIndex: Integer): TcxGridCardViewRow; +begin + Result := Rows[LayerFirstRowIndex[ALayerIndex] + AIndex]; +end; + +function TcxCustomGridCardRowLayoutObject.GetLayerRowCount(ALayerIndex: Integer): Integer; +begin + Result := Integer(FLayerRowCounts[ALayerIndex]); +end; + +procedure TcxCustomGridCardRowLayoutObject.SetLayerRowCount(ALayerIndex, Value: Integer); +begin + FLayerRowCounts[ALayerIndex] := TObject(Value); +end; + +function TcxCustomGridCardRowLayoutObject.GetCoordinates(const APosition: TcxGridCardRowPosition): TcxGridCardRowCoordinates; +begin + case Layout of + rlHorizontal: + begin + Result.ColIndex := APosition.IndexInLayer; + Result.RowIndex := APosition.LayerIndex; + end; + rlVertical: + begin + Result.ColIndex := APosition.LayerIndex; + Result.RowIndex := APosition.IndexInLayer; + end + else + Result.ColIndex := -1; + Result.RowIndex := -1; + end; +end; + +function TcxCustomGridCardRowLayoutObject.GetPosition(const ACoordinates: TcxGridCardRowCoordinates): TcxGridCardRowPosition; +begin + case Layout of + rlHorizontal: + begin + Result.LayerIndex := ACoordinates.RowIndex; + Result.IndexInLayer := ACoordinates.ColIndex; + end; + rlVertical: + begin + Result.LayerIndex := ACoordinates.ColIndex; + Result.IndexInLayer := ACoordinates.RowIndex; + end + else + Result.LayerIndex := -1; + Result.IndexInLayer := -1; + end; +end; + +function TcxCustomGridCardRowLayoutObject.GetLayerIndex(ARowIndex: Integer): Integer; +begin + Result := GetPosition(ARowIndex).LayerIndex; +end; + +function TcxCustomGridCardRowLayoutObject.GetLayerPosition(APosition: TcxPosition): TcxGridCardViewRowLayerPosition; +begin + Result := rlpBeforeRow; + case Layout of + rlHorizontal: + case APosition of + posLeft: + Result := rlpBeforeRow; + posRight: + Result := rlpAfterRow; + posTop: + Result := rlpBeforeLayer; + posBottom: + Result := rlpAfterLayer; + end; + rlVertical: + case APosition of + posLeft: + Result := rlpBeforeLayer; + posRight: + Result := rlpAfterLayer; + posTop: + Result := rlpBeforeRow; + posBottom: + Result := rlpAfterRow; + end; + end; +end; + +function TcxCustomGridCardRowLayoutObject.GetLength(ARow: TcxGridCardViewRow): Integer; +begin + case Layout of + rlHorizontal: + Result := 1; + rlVertical: + Result := ARow.Position.LineCount; + else + Result := 0; + end; +end; + +function TcxCustomGridCardRowLayoutObject.GetOffsetInLayer(ALayerIndex, AIndexInLayer: Integer): Integer; +var + I: Integer; +begin + case Layout of + rlHorizontal: + Result := AIndexInLayer; + rlVertical: + begin + Result := 0; + for I := 0 to AIndexInLayer - 1 do + Inc(Result, GetLength(LayerRows[ALayerIndex, I])); + end; + else + Result := -1; + end; +end; + +function TcxCustomGridCardRowLayoutObject.GetPosition(ARowIndex: Integer): TcxGridCardRowPosition; +var + I: Integer; +begin + if ARowIndex <> -1 then + for I := 0 to LayerCount - 1 do + begin + if ARowIndex < LayerRowCount[I] then + begin + Result.LayerIndex := I; + Result.IndexInLayer := ARowIndex; + Exit; + end; + Dec(ARowIndex, LayerRowCount[I]); + end; + Result.LayerIndex := -1; + Result.IndexInLayer := -1; +end; + +function TcxCustomGridCardRowLayoutObject.GetCoordinates(ARow: TcxGridCardViewRow): TcxGridCardRowCoordinates; +begin + Result := GetCoordinates(GetPosition(ARow)); +end; + +function TcxCustomGridCardRowLayoutObject.GetIndexInLayer(ARow: TcxGridCardViewRow): Integer; +begin + Result := GetPosition(ARow).IndexInLayer; +end; + +function TcxCustomGridCardRowLayoutObject.GetLayerIndex(ARow: TcxGridCardViewRow): Integer; +begin + Result := GetLayerIndex(GetRowIndex(ARow)); +end; + +function TcxCustomGridCardRowLayoutObject.GetOffsetInLayer(ARow: TcxGridCardViewRow): Integer; +begin + with GetPosition(ARow) do + Result := GetOffsetInLayer(LayerIndex, IndexInLayer); +end; + +function TcxCustomGridCardRowLayoutObject.GetPosition(ARow: TcxGridCardViewRow): TcxGridCardRowPosition; +begin + Result := GetPosition(GetRowIndex(ARow)); +end; + +function TcxCustomGridCardRowLayoutObject.GetRowAtOffset(ALayerIndex, AOffset: Integer): TcxGridCardViewRow; +var + I, ARowOffset: Integer; +begin + Result := nil; + for I := 0 to LayerRowCount[ALayerIndex] - 1 do + begin + Result := LayerRows[ALayerIndex, I]; + ARowOffset := GetOffsetInLayer(ALayerIndex, I); + if ARowOffset + GetLength(Result) > AOffset then + Exit; + end; +end; + +function TcxCustomGridCardRowLayoutObject.IsFirstInLayer(ARow: TcxGridCardViewRow): Boolean; +begin + Result := GetIndexInLayer(ARow) = 0; +end; + +function TcxCustomGridCardRowLayoutObject.IsLastInLayer(ARow: TcxGridCardViewRow): Boolean; +begin + Result := GetIndexInLayer(ARow) = LayerRowCount[GetLayerIndex(ARow)] - 1; +end; + +function TcxCustomGridCardRowLayoutObject.IsWholeLine(ARow: TcxGridCardViewRow): Boolean; +begin + case Layout of + rlHorizontal: + Result := LayerRowCount[GetLayerIndex(ARow)] = 1; + rlVertical: + Result := True; + else + Result := True; + end; +end; + +{ TcxGridCardRowLayoutObject } + +constructor TcxGridCardRowLayoutObject.Create; +begin + inherited; + FRows := TList.Create; +end; + +destructor TcxGridCardRowLayoutObject.Destroy; +begin + FRows.Free; + inherited; +end; + +function TcxGridCardRowLayoutObject.GetLayout: TcxGridCardViewRowLayout; +begin + Result := FLayout; +end; + +function TcxGridCardRowLayoutObject.GetRow(AIndex: Integer): TcxGridCardViewRow; +begin + Result := TcxGridCardViewRow(FRows[AIndex]); +end; + +function TcxGridCardRowLayoutObject.GetRowCount: Integer; +begin + Result := FRows.Count; +end; + +function TcxGridCardRowLayoutObject.GetRowIndex(ARow: TcxGridCardViewRow): Integer; +begin + Result := FRows.IndexOf(ARow); +end; + +procedure TcxGridCardRowLayoutObject.Fill(ARows: TList); +var + ALayerIndex, I: Integer; + ARow: TcxGridCardViewRow; +begin + CopyList(ARows, FRows); + FLayerRowCounts.Clear; + ALayerIndex := -1; + for I := 0 to RowCount - 1 do + begin + ARow := Rows[I]; + if ARow.Position.LayerIndex <> ALayerIndex then + begin + ALayerIndex := ARow.Position.LayerIndex; + FLayerRowCounts.Add(nil); + end; + LayerRowCount[LayerCount - 1] := LayerRowCount[LayerCount - 1] + 1; + end; +end; + +{ TcxGridCardVisibleRowLayoutObject } + +constructor TcxGridCardVisibleRowLayoutObject.Create(ACard: TcxGridCard); +begin + inherited Create; + FCard := ACard; + Layout := ACard.GridView.RowLayout; + FCard.GetVisibleRows(RowsList); + Fill(RowsList); +end; + +procedure TcxGridCardVisibleRowLayoutObject.GetInsertionParams(ARow: TcxGridCardViewRow; + APosition: TcxPosition; out AInsertionIndex: Integer; out AInsertionPos: TcxGridCardRowInsertionPos); + + function GetNextLayerFirstRowVisibleIndex: Integer; + begin + if GetLayerIndex(ARow) = LayerCount - 1 then + Result := Card.GridView.VisibleRowCount + else + Result := LayerFirstRow[GetLayerIndex(ARow) + 1].VisibleIndex; + end; + +begin + case GetLayerPosition(APosition) of + rlpBeforeRow: + begin + AInsertionIndex := ARow.VisibleIndex; + AInsertionPos := ripSameLayer; + end; + rlpAfterRow: + if IsLastInLayer(ARow) then + begin + AInsertionIndex := GetNextLayerFirstRowVisibleIndex; + AInsertionPos := ripPrevLayer; + end + else + begin + AInsertionIndex := LayerRows[GetLayerIndex(ARow), GetIndexInLayer(ARow) + 1].VisibleIndex; + AInsertionPos := ripSameLayer; + end; + rlpBeforeLayer: + begin + AInsertionIndex := LayerFirstRow[GetLayerIndex(ARow)].VisibleIndex; + AInsertionPos := ripNewLayer; + end; + rlpAfterLayer: + begin + AInsertionIndex := GetNextLayerFirstRowVisibleIndex; + AInsertionPos := ripNewLayer; + end; + end; +end; + +procedure TcxGridCardVisibleRowLayoutObject.GetLayerRows(ARowInLayer: TcxGridCardViewRow; + ARows: TList); +var + ALayerIndex, I: Integer; +begin + ALayerIndex := GetLayerIndex(ARowInLayer); + ARows.Clear; + if ALayerIndex <> -1 then + for I := 0 to LayerRowCount[ALayerIndex] - 1 do + ARows.Add(LayerRows[ALayerIndex, I]); +end; + +procedure TcxGridCardVisibleRowLayoutObject.GetRowsAtOffset(ARowAtOffset: TcxGridCardViewRow; + ARows: TList); +var + ARowOffset, I: Integer; +begin + ARowOffset := GetOffsetInLayer(ARowAtOffset); + ARows.Clear; + for I := 0 to LayerCount - 1 do + ARows.Add(GetRowAtOffset(I, ARowOffset)); +end; + +{ TcxGridCardViewRowLayoutObject } + +constructor TcxGridCardViewRowLayoutObject.Create(AGridView: TcxGridCardView); +begin + inherited Create; + FGridView := AGridView; +end; + +function TcxGridCardViewRowLayoutObject.GetBeginsLayer(ARow: TcxGridCardViewRow): Boolean; +begin + Result := IsFirstInLayer(ARow); +end; + +procedure TcxGridCardViewRowLayoutObject.SetBeginsLayer(ARow: TcxGridCardViewRow; + Value: Boolean); +var + APosition: TcxGridCardRowPosition; +begin + if BeginsLayer[ARow] <> Value then + begin + APosition := GetPosition(ARow); + if Value then + BreakLayer(APosition.LayerIndex, APosition.IndexInLayer) + else + MergeLayer(APosition.LayerIndex); + end; +end; + +function TcxGridCardViewRowLayoutObject.GetLayout: TcxGridCardViewRowLayout; +begin + Result := FGridView.RowLayout; +end; + +function TcxGridCardViewRowLayoutObject.GetRow(AIndex: Integer): TcxGridCardViewRow; +begin + Result := GridView.Rows[AIndex]; +end; + +function TcxGridCardViewRowLayoutObject.GetRowCount: Integer; +begin + Result := GridView.RowCount; +end; + +function TcxGridCardViewRowLayoutObject.GetRowIndex(ARow: TcxGridCardViewRow): Integer; +begin + Result := ARow.Index; +end; + +procedure TcxGridCardViewRowLayoutObject.AddLayer; +begin + LayerRowCounts.Add(TObject(0)); +end; + +procedure TcxGridCardViewRowLayoutObject.InsertLayer(AIndex: Integer); +begin + LayerRowCounts.Insert(AIndex, TObject(0)); +end; + +procedure TcxGridCardViewRowLayoutObject.RemoveLayer(AIndex: Integer); +begin + LayerRowCounts.Delete(AIndex); +end; + +procedure TcxGridCardViewRowLayoutObject.AddRowToLayer(ALayerIndex: Integer); +begin + LayerRowCount[ALayerIndex] := LayerRowCount[ALayerIndex] + 1; +end; + +procedure TcxGridCardViewRowLayoutObject.RemoveRowFromLayer(ALayerIndex: Integer); +begin + LayerRowCount[ALayerIndex] := LayerRowCount[ALayerIndex] - 1; + if LayerRowCount[ALayerIndex] = 0 then + RemoveLayer(ALayerIndex); +end; + +procedure TcxGridCardViewRowLayoutObject.AddRow(ARow: TcxGridCardViewRow); +begin + case Layout of + rlHorizontal: + SetLayerIndex(ARow, LayerCount); + rlVertical: + SetLayerIndex(ARow, Max(0, LayerCount - 1)); + end; +end; + +procedure TcxGridCardViewRowLayoutObject.RemoveRow(ARowIndex: Integer); +begin + RemoveRowFromLayer(GetLayerIndex(ARowIndex)); +end; + +procedure TcxGridCardViewRowLayoutObject.MoveRow(ARow: TcxGridCardViewRow; + AOldIndex: Integer); +var + AOldLayerIndex, ANewLayerIndex: Integer; +begin + if ARow.LockPositionSync then Exit; + AOldLayerIndex := GetLayerIndex(AOldIndex); + ANewLayerIndex := GetLayerIndex(ARow); + AddRowToLayer(ANewLayerIndex); + RemoveRowFromLayer(AOldLayerIndex); +end; + +procedure TcxGridCardViewRowLayoutObject.MoveRows(ARows: TList; AIndex: Integer); +var + ARowLayout: TcxGridCardRowLayoutObject; +begin + ARowLayout := TcxGridCardRowLayoutObject.Create; + try + ARowLayout.Fill(ARows); + MoveRows(ARows, AIndex, ARowLayout); + finally + ARowLayout.Free; + end; +end; + +procedure TcxGridCardViewRowLayoutObject.MoveRows(ARows: TList; AIndex: Integer; + ARowLayout: TcxGridCardRowLayoutObject); +var + I, ALayerIndex: Integer; + ARow, APrevRow: TcxGridCardViewRow; + ANewLayer: Boolean; +begin + GridView.BeginUpdate; + try + APrevRow := nil; + for I := 0 to ARows.Count - 1 do + begin + ARow := TcxGridCardViewRow(ARows[I]); + ARow.Index := AIndex + I; + if I <> 0 then + begin + ALayerIndex := GetLayerIndex(TcxGridCardViewRow(ARows[0])) + + ARowLayout.GetLayerIndex(ARow); + ANewLayer := ARowLayout.IsFirstInLayer(ARow); + if ANewLayer and not IsLastInLayer(APrevRow) then + BreakLayer(ALayerIndex - 1, GetIndexInLayer(ARow) + 1); + SetLayerIndex(ARow, ALayerIndex, ANewLayer); + end; + APrevRow := ARow; + end; + finally + GridView.EndUpdate; + end; +end; + +procedure TcxGridCardViewRowLayoutObject.LayerIndexChanged; +begin + if Assigned(FOnLayerIndexChanged) then FOnLayerIndexChanged(Self); +end; + +procedure TcxGridCardViewRowLayoutObject.BreakLayer(ALayerIndex, AIndexInLayer: Integer); +{var + I: Integer;} +begin + if AIndexInLayer = 0 then Exit; + InsertLayer(ALayerIndex + 1); + LayerRowCount[ALayerIndex + 1] := LayerRowCount[ALayerIndex] - AIndexInLayer; + LayerRowCount[ALayerIndex] := AIndexInLayer; + LayerIndexChanged; + GridView.Changed(vcSize); +{ + GridView.BeginUpdate; + try + for I := AIndexInLayer to LayerRowCount[ALayerIndex] - 1 do + SetLayerIndex(LayerRows[ALayerIndex, AIndexInLayer], ALayerIndex + 1, + I = AIndexInLayer); + finally + GridView.EndUpdate; + end;} +end; + +function TcxGridCardViewRowLayoutObject.IsSimpleLayout: Boolean; +var + I: Integer; +begin + case Layout of + rlHorizontal: + begin + Result := True; + for I := 0 to LayerCount - 1 do + begin + Result := LayerRowCount[I] = 1; + if not Result then Break; + end; + end; + rlVertical: + Result := LayerCount <= 1; + else + Result := True; + end; +end; + +procedure TcxGridCardViewRowLayoutObject.MergeLayer(ALayerIndex: Integer); +begin + if ALayerIndex = 0 then Exit; + LayerRowCount[ALayerIndex - 1] := LayerRowCount[ALayerIndex - 1] + LayerRowCount[ALayerIndex]; + RemoveLayer(ALayerIndex); + LayerIndexChanged; + GridView.Changed(vcSize); +end; + +procedure TcxGridCardViewRowLayoutObject.SetCoordinates(ARow: TcxGridCardViewRow; + const ACoordinates: TcxGridCardRowCoordinates); +begin + SetPosition(ARow, GetPosition(ACoordinates)); +end; + +procedure TcxGridCardViewRowLayoutObject.SetIndexInLayer(ARow: TcxGridCardViewRow; + AValue: Integer; AMoveSubItems: Boolean = False); +var + ALayerIndex: Integer; +begin + ALayerIndex := GetLayerIndex(ARow); + AValue := Max(AValue, 0); + AValue := Min(AValue, LayerRowCount[ALayerIndex] - 1); + ARow.MoveTo(LayerFirstRowIndex[ALayerIndex] + AValue, AMoveSubItems); +end; + +procedure TcxGridCardViewRowLayoutObject.SetLayerIndex(ARow: TcxGridCardViewRow; + AValue: Integer; ANewLayer: Boolean = False; AMoveSubItems: Boolean = False); + + function GetRowNewIndex: Integer; + begin + Result := LayerFirstRowIndex[AValue] + LayerRowCount[AValue]; + // do not allow category row to break another category row, + // but layer index cannot be changed + if AMoveSubItems and (ARow.Kind = rkCategory) and + (Result < RowCount) and (Rows[Result].CategoryRow <> nil) then + for Result := Result - 1 downto 0 do + if (Rows[Result].Kind = rkCategory) or IsFirstInLayer(Rows[Result]) then + Break; + if ARow.Index < Result then Dec(Result); + end; + +var + ALayerIndex, ARowNewIndex: Integer; + ARows: TList; + ARowLayout: TcxGridCardRowLayoutObject; +begin + AValue := Max(AValue, 0); + AValue := Min(AValue, LayerCount); + ALayerIndex := GetLayerIndex(ARow); + if (ALayerIndex <> AValue) or ANewLayer and (LayerRowCount[ALayerIndex] > 1) then + begin + GridView.BeginUpdate; + ARow.LockPositionSync := True; + ARows := TList.Create; + ARowLayout := TcxGridCardRowLayoutObject.Create; + try + if ARow.GridView <> nil then // not from AddItem + begin + ARow.GetItems(ARows, AMoveSubItems); + ARowLayout.Fill(ARows); + end; + if AValue = LayerCount then + AddLayer + else + if ANewLayer then + begin + InsertLayer(AValue); + if (ALayerIndex <> -1) and (AValue <= ALayerIndex) then + Inc(ALayerIndex); + end; + ARowNewIndex := GetRowNewIndex; + AddRowToLayer(AValue); + if ALayerIndex <> -1 then + RemoveRowFromLayer(ALayerIndex); + if ARows.Count <> 0 then + MoveRows(ARows, ARowNewIndex, ARowLayout); + LayerIndexChanged; + if ARow.GridView <> nil then // not from AddItem + GridView.Changed(vcSize); + finally + ARowLayout.Free; + ARows.Free; + ARow.LockPositionSync := False; + GridView.EndUpdate; + end; + end; +end; + +procedure TcxGridCardViewRowLayoutObject.SetPosition(ARow: TcxGridCardViewRow; + const APosition: TcxGridCardRowPosition); +begin + if APosition.LayerIndex <> -1 then + SetLayerIndex(ARow, APosition.LayerIndex); + if APosition.IndexInLayer <> -1 then + SetIndexInLayer(ARow, APosition.IndexInLayer); +end; + +{ TcxGridCardViewVisibleRowLayoutObject } + +constructor TcxGridCardViewVisibleRowLayoutObject.Create(AGridView: TcxGridCardView); +begin + inherited Create; + FGridView := AGridView; +end; + +function TcxGridCardViewVisibleRowLayoutObject.GetLayout: TcxGridCardViewRowLayout; +begin + Result := FGridView.RowLayout; +end; + +function TcxGridCardViewVisibleRowLayoutObject.GetLastVisibleSubItem(ARow: TcxGridCardViewRow): TcxGridCardViewRow; +var + ARows: TList; + I: Integer; +begin +{$IFDEF DELPHI7} +{$IFNDEF DELPHI8} + Result := nil; // to remove wrong warning +{$ENDIF} +{$ENDIF} + ARows := TList.Create; + try + ARow.GetItems(ARows, True); + for I := ARows.Count - 1 downto 0 do + begin + Result := TcxGridCardViewRow(ARows[I]); + if GetRowIndex(Result) <> -1 then Exit; + end; + finally + ARows.Free; + end; + Result := nil; +end; + +function TcxGridCardViewVisibleRowLayoutObject.GetLayerCount(ARow: TcxGridCardViewRow): Integer; +var + ALastVisibleSubItem: TcxGridCardViewRow; +begin + ALastVisibleSubItem := GetLastVisibleSubItem(ARow); + if ALastVisibleSubItem = nil then + Result := 0 + else + Result := GetLayerIndex(ALastVisibleSubItem) - GetLayerIndex(ARow) + 1; +end; + +function TcxGridCardViewVisibleRowLayoutObject.IsWholeLayer(ARow: TcxGridCardViewRow): Boolean; +var + ALastVisibleSubItem: TcxGridCardViewRow; +begin + Result := IsFirstInLayer(ARow); + if Result then + begin + ALastVisibleSubItem := GetLastVisibleSubItem(ARow); + Result := (GetLayerIndex(ALastVisibleSubItem) > GetLayerIndex(ARow)) or + IsLastInLayer(ALastVisibleSubItem); + end; +end; + +{ TcxGridCardViewRowLayoutController } + +constructor TcxGridCardViewRowLayoutController.Create(AGridView: TcxGridCardView); +begin + inherited Create; + FGridView := AGridView; + FLayoutObject := TcxGridCardViewRowLayoutObject.Create(FGridView); + FLayoutObject.OnLayerIndexChanged := LayerIndexChanged; + FVisibleLayoutObject := TcxGridCardViewVisibleRowLayoutObject.Create(FGridView); +end; + +destructor TcxGridCardViewRowLayoutController.Destroy; +begin + FVisibleLayoutObject.Free; + FLayoutObject.Free; + inherited; +end; + +function TcxGridCardViewRowLayoutController.GetBeginsLayer(ARow: TcxGridCardViewRow): Boolean; +begin + Result := LayoutObject.BeginsLayer[ARow]; +end; + +function TcxGridCardViewRowLayoutController.GetLayout: TcxGridCardViewRowLayout; +begin + Result := GridView.RowLayout; +end; + +procedure TcxGridCardViewRowLayoutController.SetBeginsLayer(ARow: TcxGridCardViewRow; + Value: Boolean); +begin + LayoutObject.BeginsLayer[ARow] := Value; +end; + +procedure TcxGridCardViewRowLayoutController.LayerIndexChanged(Sender: TObject); +begin + RefreshVisibleLayoutObject; +end; + +procedure TcxGridCardViewRowLayoutController.RefreshVisibleLayoutObject; +begin + VisibleLayoutObject.Fill(GridView.VisibleItemsList); +end; + +procedure TcxGridCardViewRowLayoutController.RowIndexChanged(ARow: TcxGridCardViewRow; + AOldIndex: Integer); +begin + if AOldIndex = -1 then + LayoutObject.AddRow(ARow) + else + if ARow.Index = -1 then + LayoutObject.RemoveRow(AOldIndex) + else + LayoutObject.MoveRow(ARow, AOldIndex); +end; + +procedure TcxGridCardViewRowLayoutController.VisibleRowsListChanged; +begin + RefreshVisibleLayoutObject; +end; + +function TcxGridCardViewRowLayoutController.CreateCardRowLayout(ACardViewInfo: TcxGridCardViewInfo): TcxGridCardRowLayout; +begin + Result := GetCardRowLayoutClass.Create(ACardViewInfo, IsSimpleLayout); +end; + +function TcxGridCardViewRowLayoutController.GetCardRowLayoutClass: TcxGridCardRowLayoutClass; +begin + case Layout of + rlHorizontal: + Result := TcxGridCardRowHorizontalLayout; + rlVertical: + Result := TcxGridCardRowVerticalLayout; + else + Result := nil; + end; +end; + +function TcxGridCardViewRowLayoutController.IsHorizontalLayout: Boolean; +begin + Result := Layout = rlHorizontal; +end; + +function TcxGridCardViewRowLayoutController.IsSimpleLayout: Boolean; +begin + Result := LayoutObject.IsSimpleLayout; +end; + +function TcxGridCardViewRowLayoutController.IsWholeLine(ARow: TcxGridCardViewRow): Boolean; +begin + Result := VisibleLayoutObject.IsWholeLine(ARow); +end; + +function TcxGridCardViewRowLayoutController.GetCoordinates(ARow: TcxGridCardViewRow): TcxGridCardRowCoordinates; +begin + Result := LayoutObject.GetCoordinates(ARow); +end; + +procedure TcxGridCardViewRowLayoutController.SetCoordinates(ARow: TcxGridCardViewRow; + AColIndex, ARowIndex: Integer); +var + ACoordinates: TcxGridCardRowCoordinates; +begin + ACoordinates.ColIndex := AColIndex; + ACoordinates.RowIndex := ARowIndex; + SetCoordinates(ARow, ACoordinates); +end; + +procedure TcxGridCardViewRowLayoutController.SetCoordinates(ARow: TcxGridCardViewRow; + ACoordinates: TcxGridCardRowCoordinates); +begin + LayoutObject.SetCoordinates(ARow, ACoordinates); +end; + +function TcxGridCardViewRowLayoutController.GetVisibleCoordinates(ARow: TcxGridCardViewRow): TcxGridCardRowCoordinates; +begin + Result := VisibleLayoutObject.GetCoordinates(ARow); +end; + +function TcxGridCardViewRowLayoutController.GetPosition(ARow: TcxGridCardViewRow): TcxGridCardRowPosition; +begin + Result := LayoutObject.GetPosition(ARow); +end; + +procedure TcxGridCardViewRowLayoutController.SetPosition(ARow: TcxGridCardViewRow; + ALayerIndex, AIndexInLayer: Integer); +var + APosition: TcxGridCardRowPosition; +begin + APosition.LayerIndex := ALayerIndex; + APosition.IndexInLayer := AIndexInLayer; + LayoutObject.SetPosition(ARow, APosition); +end; + +function TcxGridCardViewRowLayoutController.GetVisiblePosition(ARow: TcxGridCardViewRow): TcxGridCardRowPosition; +begin + Result := VisibleLayoutObject.GetPosition(ARow); +end; + +function TcxGridCardViewRowLayoutController.FindNextRow(ACard: TcxGridCard; + ARow: TcxGridCardViewRow; ASameLayer, AGoForward, AGoOnCycle: Boolean; + out ACycleChanged: Boolean): TcxGridCardViewRow; +var + ARows: TList; + ALayout: TcxGridCardVisibleRowLayoutObject; +begin + ARows := TList.Create; + try + ALayout := TcxGridCardVisibleRowLayoutObject.Create(ACard); + try + if ASameLayer then + ALayout.GetLayerRows(ARow, ARows) + else + ALayout.GetRowsAtOffset(ARow, ARows); + finally + ALayout.Free; + end; + Result := GridView.Controller.FindNextRow(ACard, ARows, ARow, AGoForward, + AGoOnCycle, ACycleChanged); + finally + ARows.Free; + end; +end; + +function TcxGridCardViewRowLayoutController.FindNextRowHorizontally(ACard: TcxGridCard; + ARow: TcxGridCardViewRow; AGoForward, AGoOnCycle: Boolean; out ACycleChanged: Boolean): TcxGridCardViewRow; +begin + Result := FindNextRow(ACard, ARow, IsHorizontalLayout, AGoForward, AGoOnCycle, ACycleChanged); +end; + +function TcxGridCardViewRowLayoutController.FindNextRowVertically(ACard: TcxGridCard; + ARow: TcxGridCardViewRow; AGoForward, AGoOnCycle: Boolean; out ACycleChanged: Boolean): TcxGridCardViewRow; +begin + Result := FindNextRow(ACard, ARow, not IsHorizontalLayout, AGoForward, AGoOnCycle, ACycleChanged); +end; + +{ TcxGridCardRowFilterButtonPainter } + +function TcxGridCardRowFilterButtonPainter.GetViewInfo: TcxGridCardRowFilterButtonViewInfo; +begin + Result := TcxGridCardRowFilterButtonViewInfo(inherited ViewInfo); +end; + +procedure TcxGridCardRowFilterButtonPainter.Paint; +begin + with ViewInfo do + GridViewInfo.LookAndFeelPainter.DrawFilterDropDownButton(Self.Canvas, + Bounds, ButtonState, Active); +end; + +{ TcxGridCardRowCaptionPainter } + +function TcxGridCardRowCaptionPainter.GetViewInfo: TcxGridCardRowCaptionViewInfo; +begin + Result := TcxGridCardRowCaptionViewInfo(inherited ViewInfo); +end; + +procedure TcxGridCardRowCaptionPainter.DrawContent; +begin + inherited; + if ViewInfo.FilterButtonViewInfo <> nil then + ViewInfo.FilterButtonViewInfo.Paint(Canvas); +end; + +{ TcxGridCardRowPainter } + +function TcxGridCardRowPainter.GetViewInfo: TcxGridCardRowViewInfo; +begin + Result := TcxGridCardRowViewInfo(inherited ViewInfo); +end; + +procedure TcxGridCardRowPainter.DrawExpandButton; +begin + Canvas.FillRect(ViewInfo.ExpandButtonAreaBounds, ViewInfo.Params); + ViewInfo.LookAndFeelPainter.DrawExpandButton(Canvas, ViewInfo.ExpandButtonBounds, + ViewInfo.Expanded); +end; + +procedure TcxGridCardRowPainter.DrawFocusRect; +begin + with ViewInfo do + if DataViewInfo.Focused then + GridViewInfo.Painter.DrawFocusRect(ContentBounds, CardViewInfo.HideFocusRectOnExit); +end; + +procedure TcxGridCardRowPainter.DrawIndent; +begin + Canvas.FillRect(ViewInfo.IndentBounds, ViewInfo.GetIndentViewParams); +end; + +procedure TcxGridCardRowPainter.Paint; +begin + if ViewInfo.HasIndent then DrawIndent; + if ViewInfo.HasExpandButton then DrawExpandButton; + ViewInfo.CaptionViewInfo.Paint(Canvas); + ViewInfo.DataViewInfo.Paint(Canvas); + DrawBorders; + DrawFocusRect; +end; + +{ TcxGridCardScrollButtonPainter } + +function TcxGridCardScrollButtonPainter.GetViewInfo: TcxCustomGridCardScrollButtonViewInfo; +begin + Result := TcxCustomGridCardScrollButtonViewInfo(inherited ViewInfo); +end; + +procedure TcxGridCardScrollButtonPainter.DrawContent; +const + ScrollBarParts: array[Boolean] of TcxScrollBarPart = (sbpLineUp, sbpLineDown); +begin + ViewInfo.GridViewInfo.LookAndFeelPainter.DrawScrollBarPart(Canvas, False, + ViewInfo.Bounds, ScrollBarParts[ViewInfo.IsDownButton], ViewInfo.ButtonState); +end; + +function TcxGridCardScrollButtonPainter.ExcludeFromClipRect: Boolean; +begin + Result := True; +end; + +{ TcxGridCardExpandButtonPainter } + +function TcxGridCardExpandButtonPainter.GetViewInfo: TcxGridCardExpandButtonViewInfo; +begin + Result := TcxGridCardExpandButtonViewInfo(inherited ViewInfo); +end; + +procedure TcxGridCardExpandButtonPainter.Paint; +begin + ViewInfo.LookAndFeelPainter.DrawGroupExpandButton(Canvas, + ViewInfo.Bounds, ViewInfo.CardViewInfo.Expanded, ViewInfo.ButtonState); +end; + +{ TcxGridCardPainter } + +function TcxGridCardPainter.GetViewInfo: TcxGridCardViewInfo; +begin + Result := TcxGridCardViewInfo(inherited ViewInfo); +end; + +procedure TcxGridCardPainter.AfterPaint; +begin + inherited; + Canvas.SetClipRegion(FClipRegion, roSet); +end; + +procedure TcxGridCardPainter.BeforePaint; +begin + FClipRegion := Canvas.GetClipRegion; + Canvas.IntersectClipRect(ViewInfo.Bounds); + inherited; +end; + +procedure TcxGridCardPainter.DrawBackground; +begin + with ViewInfo do + if Transparent then + inherited + else + begin + Self.Canvas.Brush.Color := Params.Color; + Self.Canvas.FillRect(BackgroundBitmapBounds); + end; +end; + +procedure TcxGridCardPainter.DrawCardBorder; +var + ABounds: TRect; + AParams: TcxViewParams; +begin + ABounds := ViewInfo.Bounds; + ViewInfo.GetCardBorderViewParams(AParams); + if AParams.Bitmap = nil then + Canvas.FrameRect(ABounds, AParams.Color, ViewInfo.CardBorderWidth) + else + with ViewInfo.ContentBounds do + begin + Canvas.FillRect(Rect(ABounds.Left, ABounds.Top, ABounds.Right, Top), AParams.Bitmap); + Canvas.FillRect(Rect(ABounds.Left, Top, Left, Bottom), AParams.Bitmap); + Canvas.FillRect(Rect(Right, Top, ABounds.Right, Bottom), AParams.Bitmap); + Canvas.FillRect(Rect(ABounds.Left, Bottom, ABounds.Right, ABounds.Bottom), AParams.Bitmap); + end; +end; + +procedure TcxGridCardPainter.DrawExpandButton; +begin + ViewInfo.ExpandButtonViewInfo.Paint(Canvas); +end; + +function TcxGridCardPainter.DrawExpandButtonBeforePaint: Boolean; +begin + Result := False; +end; + +procedure TcxGridCardPainter.DrawLayerSeparators; +var + I: Integer; +begin + Canvas.Brush.Color := ViewInfo.LayerSeparatorColor; + for I := 0 to ViewInfo.Layout.SeparatorCount - 1 do + Canvas.FillRect(ViewInfo.Layout.GetSeparatorBounds(I), nil, True); +end; + +procedure TcxGridCardPainter.DrawRows; +var + APrevClipRegion, ARestSpace: TcxRegion; + I: Integer; + ARow: TcxGridCardRowViewInfo; +begin + APrevClipRegion := Canvas.GetClipRegion; + try + ARestSpace := TcxRegion.Create(ViewInfo.ContentBounds); + try + Canvas.IntersectClipRect(ViewInfo.ContentBounds); + for I := ViewInfo.TopRowIndex to ViewInfo.TopRowIndex + ViewInfo.PartVisibleRowCount - 1 do + begin + ARow := ViewInfo.VisibleRowViewInfos[I]; + ARow.Paint(Canvas); + ARestSpace.Combine(TcxRegion.Create(ARow.Bounds), roSubtract); + end; + Canvas.SetClipRegion(ARestSpace, roIntersect, False); + Canvas.FillRect(ViewInfo.ContentBounds, ViewInfo.Params); + finally + ARestSpace.Free; + end; + finally + Canvas.SetClipRegion(APrevClipRegion, roSet); + end; +end; + +procedure TcxGridCardPainter.DrawScrollButtons; +begin + ViewInfo.ScrollButtonUp.Paint(Canvas); + ViewInfo.ScrollButtonDown.Paint(Canvas); +end; + +procedure TcxGridCardPainter.Paint; +begin + DrawCardBorder; + DrawScrollButtons; + if ViewInfo.HasLayerSeparators then DrawLayerSeparators; + DrawRows; + inherited; +end; + +{ TcxGridCardViewPainter } + +procedure TcxGridCardViewPainter.DrawBackground; +begin + DrawSeparators; + inherited; +end; + +procedure TcxGridCardViewPainter.DrawSeparators; +var + I: Integer; + R: TRect; +begin + Canvas.Brush.Color := ViewInfo.SeparatorsViewInfo.Color; + for I := 0 to ViewInfo.SeparatorsViewInfo.Count - 1 do + begin + R := ViewInfo.SeparatorsViewInfo[I]; + Canvas.FillRect(R); + Canvas.ExcludeClipRect(R); + end; +end; + +procedure TcxGridCardViewPainter.PaintContent; +begin + DrawFilterBar; + inherited; +end; + +function TcxGridCardViewPainter.ViewInfo: TcxGridCardViewViewInfo; +begin + Result := TcxGridCardViewViewInfo(inherited ViewInfo); +end; + +{ TcxGridCardViewColumn } + +constructor TcxGridCardViewColumn.Create(AColumns: TcxGridCardViewColumns; AIndex: Integer); +begin + inherited Create; + FColumns := AColumns; + FIndex := AIndex; + FRows := TList.Create; +end; + +destructor TcxGridCardViewColumn.Destroy; +begin + FRows.Free; + inherited; +end; + +function TcxGridCardViewColumn.GetLastRow: TcxGridCardViewInfo; +begin + Result := Rows[VisibleRowCount - 1]; +end; + +function TcxGridCardViewColumn.GetRow(Index: Integer): TcxGridCardViewInfo; +begin + Result := TcxGridCardViewInfo(FRows[Index]); +end; + +function TcxGridCardViewColumn.GetRowCount: Integer; +begin + Result := FRows.Count; +end; + +function TcxGridCardViewColumn.GetVisibleRowCount: Integer; +begin + if RowCount = 0 then + Result := 0 + else + begin + for Result := RowCount - 1 downto 0 do + if Rows[Result].Visible then Break; + Inc(Result); + end; +end; + +procedure TcxGridCardViewColumn.SetRow(Index: Integer; Value: TcxGridCardViewInfo); +begin + if Index < RowCount then + FRows[Index] := Value + else + FRows.Add(Value); + Value.FCol := Self.Index; + Value.FRow := Index; +end; + +function TcxGridCardViewColumn.GetNearestRow(APos: Integer): TcxGridCardViewInfo; +var + I: Integer; +begin + Result := nil; + for I := 0 to RowCount - 1 do + begin + Result := Rows[I]; + if APos < Result.Bounds.Bottom then Break; + end; +end; + +{ TcxGridCardViewColumns } + +constructor TcxGridCardViewColumns.Create(ACardsViewInfo: TcxGridCardsViewInfo); +begin + inherited Create; + FCardsViewInfo := ACardsViewInfo; + CreateItems; +end; + +destructor TcxGridCardViewColumns.Destroy; +begin + DestroyItems; + inherited; +end; + +function TcxGridCardViewColumns.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxGridCardViewColumns.GetItem(Index: Integer): TcxGridCardViewColumn; +begin + if Index < Count then + Result := TcxGridCardViewColumn(FItems[Index]) + else + begin + Result := TcxGridCardViewColumn.Create(Self, Index); + FItems.Add(Result); + end; +end; + +function TcxGridCardViewColumns.GetLast: TcxGridCardViewColumn; +begin + if Count = 0 then + Result := nil + else + Result := Items[Count - 1]; +end; + +function TcxGridCardViewColumns.GetVisibleCount: Integer; +begin + if Count = 0 then + Result := 0 + else + begin + for Result := Count - 1 downto 0 do + if Items[Result][0].Visible then Break; + Inc(Result); + end; +end; + +procedure TcxGridCardViewColumns.CreateItems; +begin + FItems := TList.Create; +end; + +procedure TcxGridCardViewColumns.DestroyItems; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].Free; + FItems.Free; +end; + +{ TcxGridCardRowCellViewInfo } + +constructor TcxGridCardRowCellViewInfo.Create(ARowViewInfo: TcxGridCardRowViewInfo); +begin + FRowViewInfo := ARowViewInfo; + inherited Create(FRowViewInfo.CardViewInfo, FRowViewInfo.Row); +end; + +function TcxGridCardRowCellViewInfo.GetCardViewInfo: TcxGridCardViewInfo; +begin + Result := TcxGridCardViewInfo(RecordViewInfo); +end; + +function TcxGridCardRowCellViewInfo.GetGridRecord: TcxGridCard; +begin + Result := TcxGridCard(inherited GridRecord); +end; + +function TcxGridCardRowCellViewInfo.GetGridView: TcxGridCardView; +begin + Result := TcxGridCardView(inherited GridView); +end; + +function TcxGridCardRowCellViewInfo.GetRow: TcxGridCardViewRow; +begin + Result := FRowViewInfo.Row; +end; + +function TcxGridCardRowCellViewInfo.GetAreaBounds: TRect; +begin + Result := inherited GetAreaBounds; + IntersectRect(Result, Result, CardViewInfo.ScrollableAreaBounds); +end; + +function TcxGridCardRowCellViewInfo.GetMultiLine: Boolean; +begin + Result := (Row.Position.LineCount = 1) and AutoHeight; +end; + +function TcxGridCardRowCellViewInfo.GetMultiLinePainting: Boolean; +begin + Result := inherited GetMultiLinePainting or (Row.Position.LineCount > 1); +end; + +function TcxGridCardRowCellViewInfo.GetTransparent: Boolean; +begin + Result := BackgroundBitmap <> nil; +end; + +function TcxGridCardRowCellViewInfo.HasFocusRect: Boolean; +begin + Result := False; +end; + +function TcxGridCardRowCellViewInfo.MouseDown(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +var + AGridViewInfo: TcxGridCardViewViewInfo; +begin + AGridViewInfo := GridView.ViewInfo; + AGridViewInfo.AddActiveViewInfo(Self); + try + Result := inherited MouseDown(AHitTest, AButton, AShift); + if AGridViewInfo.IsViewInfoActive(Self) and (AButton = mbLeft) then + if ssDouble in AShift then + if Result and Row.CanExpand and GridView.OptionsBehavior.ExpandRowOnDblClick then + begin + Row.Expanded := not Row.Expanded; + AGridViewInfo.Controller.MakeFocusedRecordVisible; + end + else + else + if GridView.IsDesigning then + begin + GridView.Controller.DesignController.SelectObject(Row, not (ssShift in AShift)); + Result := True; + end; + finally + AGridViewInfo.RemoveActiveViewInfo(Self); + end; +end; + +{ TcxGridCardRowFilterButtonViewInfo } + +constructor TcxGridCardRowFilterButtonViewInfo.Create(ARowCaptionViewInfo: TcxGridCardRowCaptionViewInfo); +begin + inherited Create(ARowCaptionViewInfo.GridViewInfo); + FRowCaptionViewInfo := ARowCaptionViewInfo; +end; + +function TcxGridCardRowFilterButtonViewInfo.GetActive: Boolean; +begin + Result := Row.Filtered; +end; + +function TcxGridCardRowFilterButtonViewInfo.GetDropDownWindowValue: TcxGridFilterPopup; +begin + Result := TcxGridFilterPopup(inherited DropDownWindow); +end; + +function TcxGridCardRowFilterButtonViewInfo.GetRow: TcxGridCardViewRow; +begin + Result := FRowCaptionViewInfo.Row; +end; + +function TcxGridCardRowFilterButtonViewInfo.GetItem: TcxCustomGridTableItem; +begin + Result := Row; +end; + +function TcxGridCardRowFilterButtonViewInfo.CalculateHeight: Integer; +begin + Result := 0; +end; + +function TcxGridCardRowFilterButtonViewInfo.CalculateWidth: Integer; +begin + Result := 0; +end; + +function TcxGridCardRowFilterButtonViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + if GridView.IsDesigning then + Result := nil + else + Result := TcxGridCardRowFilterButtonHitTest; +end; + +function TcxGridCardRowFilterButtonViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridCardRowFilterButtonPainter; +end; + +function TcxGridCardRowFilterButtonViewInfo.GetVisible: Boolean; +begin + Result := OccupiesSpace or + (RowCaptionViewInfo.State = gcsSelected) or (State = gcsPressed); +end; + +function TcxGridCardRowFilterButtonViewInfo.GetWidth: Integer; +begin + Result := GridViewInfo.LookAndFeelPainter.FilterDropDownButtonSize.X; +end; + +procedure TcxGridCardRowFilterButtonViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + inherited; + with TcxGridCardRowFilterButtonHitTest(AHitTest) do + begin + GridRecord := FRowCaptionViewInfo.GridRecord; + Item := Row; + end; +end; + +function TcxGridCardRowFilterButtonViewInfo.NeedsContainerHotTrack: Boolean; +begin + Result := not OccupiesSpace; +end; + +function TcxGridCardRowFilterButtonViewInfo.OccupiesSpace: Boolean; +begin + Result := TcxGridCardView(GridView).OptionsView.ShowRowFilterButtons = sfbAlways; +end; + +function TcxGridCardRowFilterButtonViewInfo.CloseDropDownWindowOnDestruction: Boolean; +begin + Result := False; +end; + +function TcxGridCardRowFilterButtonViewInfo.DropDownWindowExists: Boolean; +begin + Result := TcxGridCardView(GridView).Controller.HasFilterPopup; +end; + +function TcxGridCardRowFilterButtonViewInfo.GetDropDownWindow: TcxCustomGridPopup; +begin + Result := TcxGridCardView(GridView).Controller.FilterPopup; +end; + +function TcxGridCardRowFilterButtonViewInfo.GetDropDownWindowOwnerBounds: TRect; +begin + Result := Bounds; + with FRowCaptionViewInfo.Bounds do + begin + Result.Left := Left; + Result.Right := Right; + end; +end; + +function TcxGridCardRowFilterButtonViewInfo.IsDropDownWindowOwner: Boolean; +begin + Result := inherited IsDropDownWindowOwner and (DropDownWindow.Item = Row); +end; + +{ TcxGridCardRowCaptionViewInfo } + +constructor TcxGridCardRowCaptionViewInfo.Create(ARowViewInfo: TcxGridCardRowViewInfo); +begin + inherited; + if CanFilter then + FFilterButtonViewInfo := GetFilterButtonViewInfoClass.Create(Self); +end; + +destructor TcxGridCardRowCaptionViewInfo.Destroy; +begin + FFilterButtonViewInfo.Free; + inherited; +end; + +function TcxGridCardRowCaptionViewInfo.CalculateHeight: Integer; +begin + CalculateParams; + if MultiLine then + Result := GetTextCellHeight(GridViewInfo, LookAndFeelPainter) + else + Result := CalculateSimpleHeight(Row, Canvas, Params.Font); +end; + +class function TcxGridCardRowCaptionViewInfo.CalculateSimpleHeight(ARow: TcxGridCardViewRow; + ACanvas: TcxCanvas; AFont: TFont): Integer; +begin + Result := GetCellHeight(ACanvas.FontHeight(AFont), ARow.GridView.LookAndFeelPainter) * + ARow.Position.LineCount; +end; + +function TcxGridCardRowCaptionViewInfo.CalculateRealWidth: Integer; +begin + CalculateParams; + Result := TextWidthWithOffset; + if Row.HasCardExpandButton and + ((CardViewInfo.ExpandButtonAlignment = cebaLeft) or + (CardViewInfo.ExpandButtonAlignment = cebaRight) and not RowViewInfo.DataViewInfo.Visible) then + Inc(Result, CardViewInfo.ExpandButtonAreaWidth); + if (FilterButtonViewInfo <> nil) and FilterButtonViewInfo.OccupiesSpace then + Inc(Result, cxGridCellTextOffset + FilterButtonViewInfo.Width); + CalculateParamsNeeded; // to recalculate Width +end; + +function TcxGridCardRowCaptionViewInfo.CalculateWidth: Integer; +begin + Result := FRowViewInfo.CaptionWidth; +end; + +function TcxGridCardRowCaptionViewInfo.CanFilter: Boolean; +begin + Result := Row.CanFilter(True); +end; + +function TcxGridCardRowCaptionViewInfo.CanShowAutoHint: Boolean; +begin + Result := GridView.OptionsBehavior.RowCaptionHints; +end; + +function TcxGridCardRowCaptionViewInfo.CanShowCustomHint: Boolean; +begin + Result := False; +end; + +function TcxGridCardRowCaptionViewInfo.CanShowEdit: Boolean; +begin + Result := False; +end; + +function TcxGridCardRowCaptionViewInfo.GetAlignmentHorz: TAlignment; +begin + Result := Row.CaptionAlignmentHorz; +end; + +function TcxGridCardRowCaptionViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + Result := Row.CaptionAlignmentVert; +end; + +function TcxGridCardRowCaptionViewInfo.GetAutoHeight: Boolean; +begin + Result := GridView.OptionsView.RowCaptionAutoHeight; +end; + +function TcxGridCardRowCaptionViewInfo.GetFilterButtonBounds: TRect; +begin + Result := TextAreaBounds; + with Result do + begin + if FilterButtonViewInfo.OccupiesSpace then + Left := Max(Left, Right + cxGridCellTextOffset) + else + Left := Max(Left, Right - FilterButtonViewInfo.Width); + Right := Left + FilterButtonViewInfo.Width; + end; +end; + +function TcxGridCardRowCaptionViewInfo.GetFilterButtonViewInfoClass: TcxGridCardRowFilterButtonViewInfoClass; +begin + Result := TcxGridCardRowFilterButtonViewInfo; +end; + +function TcxGridCardRowCaptionViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridCardRowCaptionHitTest; +end; + +function TcxGridCardRowCaptionViewInfo.GetHotTrack: Boolean; +begin + Result := (FilterButtonViewInfo <> nil) and FilterButtonViewInfo.NeedsContainerHotTrack; +end; + +function TcxGridCardRowCaptionViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridCardRowCaptionPainter; +end; + +function TcxGridCardRowCaptionViewInfo.GetShowEndEllipsis: Boolean; +begin + Result := GridView.OptionsView.RowCaptionEndEllipsis; +end; + +function TcxGridCardRowCaptionViewInfo.GetText: string; +begin + Result := Row.VisibleCaption; +end; + +function TcxGridCardRowCaptionViewInfo.GetTextAreaBounds: TRect; +begin + Result := inherited GetTextAreaBounds; + if (FilterButtonViewInfo <> nil) and FilterButtonViewInfo.OccupiesSpace then + Dec(Result.Right, cxGridCellTextOffset + FilterButtonViewInfo.Width); +end; + +procedure TcxGridCardRowCaptionViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + FRowViewInfo.GetCaptionViewParams(AParams); +end; + +function TcxGridCardRowCaptionViewInfo.GetVisible: Boolean; +begin + Result := Row.Options.ShowCaption; +end; + +procedure TcxGridCardRowCaptionViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + inherited; + TcxGridCardRowCaptionHitTest(AHitTest).RowContainerKind := ckRows; +end; + +function TcxGridCardRowCaptionViewInfo.UseStandardNeedShowHint: Boolean; +begin + Result := True; +end; + +procedure TcxGridCardRowCaptionViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + inherited; + if (FilterButtonViewInfo <> nil) and FilterButtonViewInfo.Visible then + FilterButtonViewInfo.Calculate(FilterButtonBounds); +end; + +function TcxGridCardRowCaptionViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + if (FilterButtonViewInfo <> nil) and FilterButtonViewInfo.Visible then + begin + Result := FilterButtonViewInfo.GetHitTest(P); + if Result <> nil then Exit; + end; + Result := inherited GetHitTest(P); +end; + +{ TcxGridCardRowDataViewInfo } + +function TcxGridCardRowDataViewInfo.CalculateHeight: Integer; +begin + CalculateParams; + if MultiLine then + Result := CardViewInfo.RecordsViewInfo.GetCellHeight(inherited CalculateHeight) + else + Result := CalculateSimpleHeight(Row, Canvas, Params.Font); +end; + +class function TcxGridCardRowDataViewInfo.CalculateSimpleHeight(ARow: TcxGridCardViewRow; + ACanvas: TcxCanvas; AFont: TFont): Integer; +begin + Result := ARow.CalculateDefaultCellHeight(ACanvas, AFont) * ARow.Position.LineCount; + Result := ARow.GridView.ViewInfo.RecordsViewInfo.GetCellHeight(Result); +end; + +function TcxGridCardRowDataViewInfo.CalculateWidth: Integer; +begin + Result := FRowViewInfo.DataWidth; +end; + +function TcxGridCardRowDataViewInfo.GetAutoHeight: Boolean; +begin + Result := CardViewInfo.RecordsViewInfo.AutoDataCellHeight; +end; + +function TcxGridCardRowDataViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + if GridView.IsDesigning or GridView.Controller.Customization then + Result := TcxGridCardRowCellHitTest + else + Result := inherited GetHitTestClass; +end; + +function TcxGridCardRowDataViewInfo.GetText: string; +begin + Result := inherited GetText; + if (Result = '') and not RowViewInfo.CaptionViewInfo.Visible then + Result := '<' + Row.Caption + '>'; +end; + +procedure TcxGridCardRowDataViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + FRowViewInfo.GetDataViewParams(AParams); +end; + +function TcxGridCardRowDataViewInfo.GetVisible: Boolean; +begin + Result := Row.Options.ShowData; +end; + +{ TcxGridCardRowViewInfo } + +constructor TcxGridCardRowViewInfo.Create(ACardViewInfo: TcxGridCardViewInfo; + AIndex: Integer); +begin + inherited Create(ACardViewInfo.GridViewInfo); + FCardViewInfo := ACardViewInfo; + FIndex := AIndex; + CreateViewInfos; +end; + +destructor TcxGridCardRowViewInfo.Destroy; +begin + DestroyViewInfos; + inherited; +end; + +function TcxGridCardRowViewInfo.GetExpandButtonAreaSizeValue: Integer; +begin + Result := GetExpandButtonAreaSize(LookAndFeelPainter); +end; + +function TcxGridCardRowViewInfo.GetExpandButtonSizeValue: Integer; +begin + Result := GetExpandButtonSize(LookAndFeelPainter); +end; + +function TcxGridCardRowViewInfo.GetExpanded: Boolean; +begin + Result := Row.Expanded; +end; + +function TcxGridCardRowViewInfo.GetGridView: TcxGridCardView; +begin + Result := TcxGridCardView(inherited GridView); +end; + +function TcxGridCardRowViewInfo.GetGridRecord: TcxGridCard; +begin + Result := FCardViewInfo.GridRecord; +end; + +function TcxGridCardRowViewInfo.GetGridViewInfo: TcxGridCardViewViewInfo; +begin + Result := TcxGridCardViewViewInfo(inherited GridViewInfo); +end; + +{function TcxGridCardRowViewInfo.GetMaxHeight: Integer; +begin //!!! + Result := FCardViewInfo.MaxRowViewInfoHeight; +end;} + +function TcxGridCardRowViewInfo.GetRow: TcxGridCardViewRow; +begin + Result := GridView.VisibleRows[FIndex]; +end; + +procedure TcxGridCardRowViewInfo.SetExpanded(Value: Boolean); +begin + Row.Expanded := Value; +end; + +function TcxGridCardRowViewInfo.CalculatePartVisible: Boolean; +begin + Result := CardViewInfo.IsRowPartiallyVisible(Self); +end; + +function TcxGridCardRowViewInfo.CalculateVisible: Boolean; +begin + Result := CardViewInfo.IsRowVisible(Self); +end; + +procedure TcxGridCardRowViewInfo.CreateViewInfos; +begin + FCaptionViewInfo := GetCaptionViewInfoClass.Create(Self); + FDataViewInfo := GetDataViewInfoClass.Create(Self); +end; + +procedure TcxGridCardRowViewInfo.DestroyViewInfos; +begin + FreeAndNil(FDataViewInfo); + FreeAndNil(FCaptionViewInfo); +end; + +function TcxGridCardRowViewInfo.CalculateContentBounds: TRect; +begin + Result := inherited CalculateContentBounds; + if HasIndent then + Inc(Result.Left, Indent); + if HasExpandButton then + Inc(Result.Left, ExpandButtonAreaSize); +end; + +function TcxGridCardRowViewInfo.CalculateHeaderWidth: Integer; +begin + CalculateParams; + Result := Width - ContentWidth + CaptionViewInfo.CalculateRealWidth + CardDataIndent; +end; + +function TcxGridCardRowViewInfo.CalculateHeight: Integer; +var + ACaptionHeight, ADataHeight: Integer; +begin + if CardViewInfo.RecordsViewInfo.UseCardRowHeights then + Result := CardViewInfo.RecordsViewInfo.CardRowHeights[Index] + else + begin + CalculateParams; + if FCaptionViewInfo.Visible then + ACaptionHeight := FCaptionViewInfo.CalculateHeight + else + ACaptionHeight := 0; + if FDataViewInfo.Visible then + ADataHeight := FDataViewInfo.CalculateHeight + else + ADataHeight := 0; + Result := Max(ACaptionHeight, ADataHeight); + CheckHeight(TcxGridCardViewInfoClass(CardViewInfo.ClassType), Row, Self, + LookAndFeelPainter, Result); + end; +end; + +class function TcxGridCardRowViewInfo.CalculateSimpleHeight(ARow: TcxGridCardViewRow; + ACanvas: TcxCanvas): Integer; + + function CalculateCaptionHeight: Integer; + begin + if ARow.Options.ShowCaption then + Result := GetCaptionViewInfoClass.CalculateSimpleHeight(ARow, ACanvas, + GetSimpleViewParams(ARow, True).Font) + else + Result := 0; + end; + + function CalculateDataHeight: Integer; + begin + if ARow.Options.ShowData then + Result := GetDataViewInfoClass.CalculateSimpleHeight(ARow, ACanvas, + GetSimpleViewParams(ARow, False).Font) + else + Result := 0; + end; + +begin + Result := Max(CalculateCaptionHeight, CalculateDataHeight); + CheckHeight(ARow.GridView.ViewInfo.RecordsViewInfo.GetItemViewInfoClass, ARow, + nil, ARow.GridView.LookAndFeelPainter, Result); +end; + +function TcxGridCardRowViewInfo.CalculateWidth: Integer; +begin + if CardViewInfo.Layout.Simple then + Result := CardViewInfo.ContentWidth + else + Result := Row.Position.Width; +end; + +class procedure TcxGridCardRowViewInfo.CheckHeight(ACardViewInfoClass: TcxGridCardViewInfoClass; + ARow: TcxGridCardViewRow; ARowViewInfo: TcxGridCardRowViewInfo; + ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass; var AHeight: Integer); +begin + if ARow.HasCardExpandButton then + AHeight := Max(AHeight, ACardViewInfoClass.GetExpandButtonSize(ALookAndFeelPainter)); + if ARow.HasExpandButton then + AHeight := Max(AHeight, GetExpandButtonAreaSize(ALookAndFeelPainter)); +end; + +class function TcxGridCardRowViewInfo.GetCaptionViewInfoClass: TcxGridCardRowCaptionViewInfoClass; +begin + Result := TcxGridCardRowCaptionViewInfo; +end; + +function TcxGridCardRowViewInfo.GetCaptionWidth: Integer; +begin + Result := ContentWidth - DataWidth; +end; + +class function TcxGridCardRowViewInfo.GetDataViewInfoClass: TcxGridCardRowDataViewInfoClass; +begin + Result := TcxGridCardRowDataViewInfo; +end; + +function TcxGridCardRowViewInfo.GetDataWidth: Integer; +begin + if FDataViewInfo.Visible then + if FCaptionViewInfo.Visible then + begin + Result := CardViewInfo.Layout.GetHeaderWidth(Self); + if Result = -1 then + Result := HeaderWidth; + Result := Max(0, Width - Result); + end + else + Result := ContentWidth + else + Result := 0; +end; + +function TcxGridCardRowViewInfo.GetDesignSelectionBounds: TRect; +begin + Result := ContentBounds; +end; + +function TcxGridCardRowViewInfo.GetExpandButtonAreaBounds: TRect; +begin + Result := ContentBounds; + Result.Right := Result.Left; + Result.Left := Result.Right - ExpandButtonAreaSize; +end; + +class function TcxGridCardRowViewInfo.GetExpandButtonAreaSize(ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; +begin + Result := CardRowExpandButtonOffset + GetExpandButtonSize(ALookAndFeelPainter) + CardRowExpandButtonOffset; +end; + +function TcxGridCardRowViewInfo.GetExpandButtonBounds: TRect; +begin + Result := cxRectCenter(ExpandButtonAreaBounds, ExpandButtonSize, ExpandButtonSize); +end; + +class function TcxGridCardRowViewInfo.GetExpandButtonSize(ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; +begin + Result := ALookAndFeelPainter.ExpandButtonSize; +end; + +function TcxGridCardRowViewInfo.GetHeaderWidth: Integer; +begin + Result := GridView.OptionsView.CaptionWidth; + if Result = 0 then + Result := CalculateHeaderWidth; +end; + +function TcxGridCardRowViewInfo.GetHeight: Integer; +begin + if FHeight = 0 then + FHeight := CalculateHeight; + Result := FHeight; +end; + +function TcxGridCardRowViewInfo.GetHidden: Boolean; +begin + Result := FCardViewInfo.VisibleRowViewInfoIndexOf(Self) = -1; +end; + +function TcxGridCardRowViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := nil; +end; + +function TcxGridCardRowViewInfo.GetIndent: Integer; +begin + Result := GridView.OptionsView.CategoryIndent; +end; + +function TcxGridCardRowViewInfo.GetIndentBounds: TRect; +begin + Result := Bounds; + Result.Right := Result.Left + Indent; +end; + +function TcxGridCardRowViewInfo.GetIndentViewParams: TcxViewParams; +begin + GridView.Styles.GetDataCellContentParams(GridRecord, Row.CategoryRow, Result); +end; + +function TcxGridCardRowViewInfo.GetIsDesignSelected: Boolean; +begin + Result := GridView.IsDesigning and + GridView.Controller.DesignController.IsObjectSelected(Row); +end; + +function TcxGridCardRowViewInfo.GetIsVisibleForPainting: Boolean; +begin + Result := FPartVisible; +end; + +function TcxGridCardRowViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridCardRowPainter; +end; + +class function TcxGridCardRowViewInfo.GetSimpleViewParams(ARow: TcxGridCardViewRow; + AIsCaption: Boolean): TcxViewParams; +begin + ARow.GridView.Styles.GetDataCellContentParams(nil, ARow, Result); +end; + +function TcxGridCardRowViewInfo.GetWidth: Integer; +begin + CalculateParams; + Result := inherited GetWidth; +end; + +procedure TcxGridCardRowViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + inherited; + if AHitTest is TcxGridRecordCellHitTest then + with TcxGridRecordCellHitTest(AHitTest) do + begin + GridRecord := Self.GridRecord; + Item := Self.Row; + end; +end; + +procedure TcxGridCardRowViewInfo.BeforeRecalculation; +begin + inherited; + FCaptionViewInfo.BeforeRecalculation; + FDataViewInfo.BeforeRecalculation; + Visible := False; + FPartVisible := False; +end; + +procedure TcxGridCardRowViewInfo.Calculate(const ABounds: TRect); +begin + Height := ABounds.Bottom - ABounds.Top; + inherited; + CalculateVisibles; + FCaptionViewInfo.Calculate(ContentBounds.Left, ContentBounds.Top, -1, ContentHeight); + FDataViewInfo.Calculate(ContentBounds.Left + FCaptionViewInfo.Width, + ContentBounds.Top, -1, ContentHeight); +end; + +function TcxGridCardRowViewInfo.CalculateVisibleCounts(var AVisibleRowCount, APartVisibleRowCount: Integer): Boolean; +begin + if PartVisible then + Inc(APartVisibleRowCount); + if Visible then + Inc(AVisibleRowCount); + Result := Visible; +end; + +procedure TcxGridCardRowViewInfo.CalculateVisibles; +begin + FPartVisible := CalculatePartVisible; + Visible := CalculateVisible; +end; + +function TcxGridCardRowViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + if HasIndent and PtInRect(IndentBounds, P) then + begin + Result := TcxGridCardRowIndentHitTest.Instance(P); + InitHitTest(Result); + Result.ViewInfo := CardViewInfo; + end + else + if HasExpandButton and PtInRect(ExpandButtonAreaBounds, P) then + begin + Result := TcxGridCardRowExpandButtonHitTest.Instance(P); + InitHitTest(Result); + end + else + begin + Result := CaptionViewInfo.GetHitTest(P); + if Result = nil then + Result := DataViewInfo.GetHitTest(P); + end; +end; + +function TcxGridCardRowViewInfo.HasExpandButton: Boolean; +begin + Result := Row.HasExpandButton; +end; + +function TcxGridCardRowViewInfo.HasIndent: Boolean; +begin + Result := CardViewInfo.HasIndent(Self); +end; + +function TcxGridCardRowViewInfo.HasLimitedHeaderSpace: Boolean; +begin + Result := CaptionViewInfo.Visible and DataViewInfo.Visible; +end; + +function TcxGridCardRowViewInfo.MouseDown(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +var + ARow: TcxGridCardViewRow; +begin + Result := inherited MouseDown(AHitTest, AButton, AShift); + if not Result and (AButton = mbLeft) and + (AHitTest.HitTestCode = htCardRowExpandButton) then + begin + ARow := Row; + Result := CardViewInfo.MouseDown(AHitTest, AButton, AShift); + if Result or ARow.IsDesigning then + begin + ARow.Expanded := not ARow.Expanded; + ARow.Controller.MakeFocusedRecordVisible; + ARow.Controller.DesignerModified; + end; + end; +end; + +{ TcxGridCardDataRowDataViewInfo } + +function TcxGridCardDataRowDataViewInfo.CalculateSelected: Boolean; +begin + Result := False; +end; + +{ TcxGridCardDataRowViewInfo } + +procedure TcxGridCardDataRowViewInfo.GetCaptionViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetDataCellParams(GridRecord, Row, AParams); +end; + +class function TcxGridCardDataRowViewInfo.GetDataViewInfoClass: TcxGridCardRowDataViewInfoClass; +begin + Result := TcxGridCardDataRowDataViewInfo; +end; + +procedure TcxGridCardDataRowViewInfo.GetDataViewParams(var AParams: TcxViewParams); +begin + Row.Styles.GetContentParams(GridRecord, AParams); +end; + +class function TcxGridCardDataRowViewInfo.GetSimpleViewParams(ARow: TcxGridCardViewRow; + AIsCaption: Boolean): TcxViewParams; +begin + if AIsCaption then + Result := inherited GetSimpleViewParams(ARow, AIsCaption) + else + ARow.Styles.GetContentParams(nil, Result); +end; + +{ TcxGridCardCaptionRowCaptionViewInfo } + +function TcxGridCardCaptionRowCaptionViewInfo.GetTextAreaBounds: TRect; +begin + Result := inherited GetTextAreaBounds; + if Row.HasCardExpandButton then + case CardViewInfo.ExpandButtonAlignment of + cebaLeft: + Inc(Result.Left, CardViewInfo.ExpandButtonAreaWidth); + cebaRight: + if not RowViewInfo.DataViewInfo.Visible then + Dec(Result.Right, CardViewInfo.ExpandButtonAreaWidth); + end; +end; + +{ TcxGridCardCaptionRowDataViewInfo } + +procedure TcxGridCardCaptionRowDataViewInfo.GetEditViewDataContentOffsets(var R: TRect); +var + R1, R2: TRect; +begin + inherited; + R1 := inherited GetTextAreaBounds; + R2 := TextAreaBounds; + Inc(R.Left, R2.Left - R1.Left); + Inc(R.Right, R1.Right - R2.Right); +end; + +function TcxGridCardCaptionRowDataViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridCardRowCellHitTest; +end; + +function TcxGridCardCaptionRowDataViewInfo.GetTextAreaBounds: TRect; +begin + Result := inherited GetTextAreaBounds; + if Row.HasCardExpandButton then + case CardViewInfo.ExpandButtonAlignment of + cebaLeft: + if not RowViewInfo.CaptionViewInfo.Visible then + Inc(Result.Left, CardViewInfo.ExpandButtonAreaWidth); + cebaRight: + Dec(Result.Right, CardViewInfo.ExpandButtonAreaWidth); + end; +end; + +{ TcxGridCardCaptionRowViewInfo } + +class function TcxGridCardCaptionRowViewInfo.GetCaptionViewInfoClass: TcxGridCardRowCaptionViewInfoClass; +begin + Result := TcxGridCardCaptionRowCaptionViewInfo; +end; + +procedure TcxGridCardCaptionRowViewInfo.GetCaptionViewParams(var AParams: TcxViewParams); +begin + GetViewParams(AParams); +end; + +class function TcxGridCardCaptionRowViewInfo.GetDataViewInfoClass: TcxGridCardRowDataViewInfoClass; +begin + Result := TcxGridCardCaptionRowDataViewInfo; +end; + +procedure TcxGridCardCaptionRowViewInfo.GetDataViewParams(var AParams: TcxViewParams); +begin + GetViewParams(AParams); +end; + +procedure TcxGridCardCaptionRowViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetDataCellParams(GridRecord, Row, AParams); +end; + +{ TcxGridCardCategoryRowViewInfo } + +class procedure TcxGridCardCategoryRowViewInfo.CheckHeight(ACardViewInfoClass: TcxGridCardViewInfoClass; + ARow: TcxGridCardViewRow; ARowViewInfo: TcxGridCardRowViewInfo; + ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass; var AHeight: Integer); +begin + inherited; + if (ARowViewInfo = nil) and HasSeparator(ACardViewInfoClass, ARow) or + (ARowViewInfo <> nil) and TcxGridCardCategoryRowViewInfo(ARowViewInfo).HasSeparator then + Inc(AHeight, ARow.GridView.OptionsView.CategorySeparatorWidth); +end; + +function TcxGridCardCategoryRowViewInfo.GetBorderColor(AIndex: TcxBorder): TColor; +begin + if AIndex = bTop then + Result := SeparatorColor + else + Result := inherited GetBorderColor(AIndex); +end; + +function TcxGridCardCategoryRowViewInfo.GetBorders: TcxBorders; +begin + Result := inherited GetBorders; + if HasSeparator then Include(Result, bTop); +end; + +function TcxGridCardCategoryRowViewInfo.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + if AIndex = bTop then + Result := GridView.OptionsView.CategorySeparatorWidth + else + Result := inherited GetBorderWidth(AIndex); +end; + +procedure TcxGridCardCategoryRowViewInfo.GetDataViewParams(var AParams: TcxViewParams); +begin + if Row.Editable then + Row.Styles.GetContentParams(GridRecord, AParams) + else + inherited; +end; + +function TcxGridCardCategoryRowViewInfo.GetSeparatorColor: TColor; +var + AParams: TcxViewParams; +begin + GridView.Styles.GetViewParams(vsCategorySeparator, nil, nil, AParams); + Result := AParams.Color; +end; + +function TcxGridCardCategoryRowViewInfo.HasSeparator: Boolean; +begin + Result := CardViewInfo.HasCategorySeparator(Self); +end; + +class function TcxGridCardCategoryRowViewInfo.HasSeparator(ACardViewInfoClass: TcxGridCardViewInfoClass; + ARow: TcxGridCardViewRow): Boolean; +begin + Result := ACardViewInfoClass.HasCategorySeparator(ARow); +end; + +function TcxGridCardCategoryRowViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + if HasSeparator and PtInRect(BorderBounds[bTop], P) then + begin + Result := TcxGridCardRowCellHitTest.Instance(P); + InitHitTest(Result); + end + else + Result := inherited GetHitTest(P); +end; + +{ TcxCustomGridCardScrollButtonViewInfo } + +constructor TcxCustomGridCardScrollButtonViewInfo.Create(ACardViewInfo: TcxGridCardViewInfo); +begin + inherited Create(ACardViewInfo.GridViewInfo); + FCardViewInfo := ACardViewInfo; +end; + +procedure TcxCustomGridCardScrollButtonViewInfo.ScrollTimerHandler(Sender: TObject); +begin + if Visible then + Scroll + else + StopAutoScrolling; +end; + +function TcxCustomGridCardScrollButtonViewInfo.CalculateHeight: Integer; +begin + Result := 0; +end; + +function TcxCustomGridCardScrollButtonViewInfo.CalculateWidth: Integer; +begin + Result := Width; +end; + +function TcxCustomGridCardScrollButtonViewInfo.CaptureMouseOnPress: Boolean; +begin + Result := True; +end; + +function TcxCustomGridCardScrollButtonViewInfo.GetHotTrack: Boolean; +begin + Result := True; +end; + +function TcxCustomGridCardScrollButtonViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridCardScrollButtonPainter; +end; + +procedure TcxCustomGridCardScrollButtonViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + FCardViewInfo.InitHitTest(AHitTest); + inherited; +end; + +procedure TcxCustomGridCardScrollButtonViewInfo.StateChanged(APrevState: TcxGridCellState); +begin + inherited; + case State of + gcsSelected: + StopAutoScrolling; + gcsPressed: + begin + Scroll; + StartAutoScrolling; + end; + gcsNone: + StopAutoScrolling; + end; +end; + +procedure TcxCustomGridCardScrollButtonViewInfo.StartAutoScrolling; +begin + FScrollTimer := TcxTimer.Create(nil); + with FScrollTimer do + begin + Interval := CardScrollingInterval; + OnTimer := ScrollTimerHandler; + end; +end; + +procedure TcxCustomGridCardScrollButtonViewInfo.StopAutoScrolling; +begin + FreeAndNil(FScrollTimer); +end; + +{ TcxGridCardScrollButtonDownViewInfo } + +function TcxGridCardScrollButtonDownViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridCardScrollButtonDownHitTest; +end; + +function TcxGridCardScrollButtonDownViewInfo.GetIsDownButton: Boolean; +begin + Result := True; +end; + +function TcxGridCardScrollButtonDownViewInfo.GetVisible: Boolean; +begin + Result := CardViewInfo.NeedsScrollingDown; +end; + +procedure TcxGridCardScrollButtonDownViewInfo.Scroll; +begin + with CardViewInfo do + TopRowIndex := TopRowIndex + 1; +end; + +{ TcxGridCardScrollButtonUpViewInfo } + +function TcxGridCardScrollButtonUpViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridCardScrollButtonUpHitTest; +end; + +function TcxGridCardScrollButtonUpViewInfo.GetIsDownButton: Boolean; +begin + Result := False; +end; + +function TcxGridCardScrollButtonUpViewInfo.GetVisible: Boolean; +begin + Result := CardViewInfo.NeedsScrollingUp; +end; + +procedure TcxGridCardScrollButtonUpViewInfo.Scroll; +begin + with CardViewInfo do + TopRowIndex := TopRowIndex - 1; +end; + +{ TcxGridCardExpandButtonViewInfo } + +constructor TcxGridCardExpandButtonViewInfo.Create(ACardViewInfo: TcxGridCardViewInfo); +begin + inherited Create(ACardViewInfo.GridViewInfo); + FCardViewInfo := ACardViewInfo; +end; + +function TcxGridCardExpandButtonViewInfo.CalculateHeight: Integer; +begin + Result := 0; +end; + +function TcxGridCardExpandButtonViewInfo.CalculateWidth: Integer; +begin + Result := 0; +end; + +function TcxGridCardExpandButtonViewInfo.CaptureMouseOnPress: Boolean; +begin + Result := True; +end; + +procedure TcxGridCardExpandButtonViewInfo.Click; +begin + inherited; + FCardViewInfo.GridRecord.ToggleExpanded; +end; + +function TcxGridCardExpandButtonViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridExpandButtonHitTest; +end; + +function TcxGridCardExpandButtonViewInfo.GetHotTrack: Boolean; +begin + Result := True; +end; + +function TcxGridCardExpandButtonViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridCardExpandButtonPainter; +end; + +function TcxGridCardExpandButtonViewInfo.GetVisible: Boolean; +begin + Result := FCardViewInfo.GridRecord.Expandable; +end; + +procedure TcxGridCardExpandButtonViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + inherited; + TcxGridExpandButtonHitTest(AHitTest).GridRecord := FCardViewInfo.GridRecord; +end; + +function TcxGridCardExpandButtonViewInfo.HasPoint(const P: TPoint): Boolean; +begin + Result := inherited HasPoint(P) and + LookAndFeelPainter.IsPointOverGroupExpandButton(Bounds, P); +end; + +{ TcxGridCardRowLayer } + +constructor TcxGridCardRowLayer.Create(AOwner: TcxGridCardRowLayout; AIndex: Integer); +begin + inherited Create; + FOwner := AOwner; + FIndex := AIndex; + BeforeCalculation; +end; + +function TcxGridCardRowLayer.GetBounds: TRect; +begin + Result.TopLeft := Rows[0].Bounds.TopLeft; + Result.BottomRight := Rows[RowCount - 1].Bounds.BottomRight; +end; + +function TcxGridCardRowLayer.GetLength: Integer; +begin + if FLength = -1 then + FLength := CalculateLength; + Result := FLength; +end; + +function TcxGridCardRowLayer.GetRow(AIndex: Integer): TcxGridCardRowViewInfo; +begin + Result := Owner.LayerRowViewInfos[Index, AIndex]; +end; + +function TcxGridCardRowLayer.GetRowCount: Integer; +begin + Result := Owner.LayerRowCount[Index]; +end; + +function TcxGridCardRowLayer.GetThickness: Integer; +begin + if FThickness = -1 then + FThickness := CalculateThickness; + Result := FThickness; +end; + +procedure TcxGridCardRowLayer.BeforeCalculation; +begin + FLength := -1; + FThickness := -1; +end; + +procedure TcxGridCardRowLayer.SetThickness(Value: Integer); +begin + FThickness := Value; +end; + +procedure TcxGridCardRowLayer.Calculate(AOwnerWidth: Integer); +begin +end; + +{ TcxGridCardRowLayout } + +constructor TcxGridCardRowLayout.Create(ACardViewInfo: TcxGridCardViewInfo; + ASimple: Boolean); +begin + inherited Create(ACardViewInfo.GridRecord); + FCardViewInfo := ACardViewInfo; + FSimple := ASimple; + CreateLayers; +end; + +destructor TcxGridCardRowLayout.Destroy; +begin + DestroyLayers; + inherited; +end; + +function TcxGridCardRowLayout.GetLayer(Index: Integer): TcxGridCardRowLayer; +begin + Result := FLayers[Index]; +end; + +function TcxGridCardRowLayout.GetLayerRowViewInfo(ALayerIndex, AIndex: Integer): TcxGridCardRowViewInfo; +begin + Result := CardViewInfo.RowViewInfos[LayerRows[ALayerIndex, AIndex].VisibleIndex]; +end; + +function TcxGridCardRowLayout.GetSeparatorCount: Integer; +begin + Result := LayerCount - 1; +end; + +procedure TcxGridCardRowLayout.CreateLayers; +var + I: Integer; +begin + SetLength(FLayers, LayerCount); + for I := 0 to LayerCount - 1 do + FLayers[I] := GetLayerClass.Create(Self, I); +end; + +procedure TcxGridCardRowLayout.DestroyLayers; +var + I: Integer; +begin + for I := 0 to LayerCount - 1 do + Layers[I].Free; + FLayers := nil; +end; + +procedure TcxGridCardRowLayout.BeforeCalculation; +var + I: Integer; +begin + for I := 0 to LayerCount - 1 do + Layers[I].BeforeCalculation; +end; + +procedure TcxGridCardRowLayout.CalculateLayers(AWidth: Integer); +var + I: Integer; +begin + for I := 0 to LayerCount - 1 do + Layers[I].Calculate(AWidth); +end; + +function TcxGridCardRowLayout.CalculateRowsHeaderWidth(ARows: TList; AWidth: Integer): Integer; +var + I: Integer; + ARowViewInfo: TcxGridCardRowViewInfo; +begin + Result := 0; + for I := 0 to ARows.Count - 1 do + begin + ARowViewInfo := TcxGridCardRowViewInfo(ARows[I]); + if ARowViewInfo.HasLimitedHeaderSpace then + Result := Max(Result, ARowViewInfo.HeaderWidth); + end; + Result := Max(0, Min(Result, AWidth)); +end; + +function TcxGridCardRowLayout.GetLayerClass: TcxGridCardRowLayerClass; +begin + Result := TcxGridCardRowLayer; +end; + +function TcxGridCardRowLayout.GetLayersLength: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to LayerCount - 1 do + Result := Max(Result, Layers[I].Length); +end; + +function TcxGridCardRowLayout.GetLayersThickness: Integer; +var + I: Integer; +begin + Result := NonContentThickness; + for I := 0 to LayerCount - 1 do + Inc(Result, Layers[I].Thickness); +end; + +function TcxGridCardRowLayout.GetNonContentThickness: Integer; +begin + Result := SeparatorCount * SeparatorWidth; +end; + +function TcxGridCardRowLayout.HasSeparator(ALayer: TcxGridCardRowLayer): Boolean; +begin + Result := ALayer.Index > 0; +end; + +function TcxGridCardRowLayout.IsLayerVisible(ALayer: TcxGridCardRowLayer; + ATopRowIndex: Integer): Boolean; +begin + Result := True; +end; + +function TcxGridCardRowLayout.IsLayerVisible(const ABounds, ALayerBounds: TRect): Boolean; +begin + Result := True; +end; + +procedure TcxGridCardRowLayout.Calculate(AWidth: Integer); +begin + BeforeCalculation; + CalculateLayers(AWidth); +end; + +procedure TcxGridCardRowLayout.CalculateRows(const ABounds: TRect; + ATopRowIndex, AMaxRowHeight: Integer; var AVisibleRowCount, APartVisibleRowCount: Integer); +var + R: TRect; + I: Integer; +begin + AVisibleRowCount := 0; + APartVisibleRowCount := 0; + + R := ABounds; + R.BottomRight := R.TopLeft; + + for I := 0 to LayerCount - 1 do + if IsLayerVisible(Layers[I], ATopRowIndex) then + begin + CalculateLayerBounds(Layers[I], AMaxRowHeight, R); + if IsLayerVisible(ABounds, R) then + Layers[I].CalculateRows(R, ATopRowIndex, AVisibleRowCount, APartVisibleRowCount); + end; +end; + +function TcxGridCardRowLayout.GetIndexInLayer(ARowViewInfo: TcxGridCardRowViewInfo): Integer; +begin + Result := GetIndexInLayer(ARowViewInfo.Row); +end; + +function TcxGridCardRowLayout.GetLayerIndex(ARowViewInfo: TcxGridCardRowViewInfo): Integer; +begin + Result := GetLayerIndex(ARowViewInfo.Row); +end; + +function TcxGridCardRowLayout.GetLayerIndex(const P: TPoint): Integer; +begin + for Result := 0 to LayerCount - 1 do + if Layers[Result].HasPoint(P) then Exit; + Result := -1; +end; + +{ TcxGridCardRowHorizontalLayer } + +function TcxGridCardRowHorizontalLayer.GetOwner: TcxGridCardRowHorizontalLayout; +begin + Result := TcxGridCardRowHorizontalLayout(inherited Owner); +end; + +function TcxGridCardRowHorizontalLayer.CalculateLength: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to RowCount - 1 do + Inc(Result, Rows[I].Width); +end; + +procedure TcxGridCardRowHorizontalLayer.CalculateRowWidths(AAvailableWidth: Integer); +var + AWidths: array of Integer; + I: Integer; +begin + SetLength(AWidths, RowCount); + for I := 0 to RowCount - 1 do + AWidths[I] := Rows[I].Width; + CalculateCardRowWidths(AWidths, AAvailableWidth); + for I := 0 to RowCount - 1 do + Rows[I].Width := AWidths[I]; +end; + +function TcxGridCardRowHorizontalLayer.CalculateThickness: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to RowCount - 1 do + Result := Max(Result, Rows[I].Height); +end; + +procedure TcxGridCardRowHorizontalLayer.Calculate(AOwnerWidth: Integer); +begin + inherited; + CalculateRowWidths(AOwnerWidth); +end; + +procedure TcxGridCardRowHorizontalLayer.CalculateRows(const ABounds: TRect; + ATopRowIndex: Integer; var AVisibleRowCount, APartVisibleRowCount: Integer); +var + R: TRect; + I: Integer; + ARowViewInfo: TcxGridCardRowViewInfo; +begin + R := ABounds; + for I := 0 to RowCount - 1 do + begin + ARowViewInfo := Rows[I]; + R.Right := R.Left + ARowViewInfo.Width; + ARowViewInfo.Calculate(R); + R.Left := R.Right; + ARowViewInfo.CalculateVisibleCounts(AVisibleRowCount, APartVisibleRowCount); + end +end; + +function TcxGridCardRowHorizontalLayer.HasPoint(const P: TPoint): Boolean; +begin + with Rows[0].Bounds do + Result := (Top <= P.Y) and (P.Y < Bottom); +end; + +{ TcxGridCardRowHorizontalLayout } + +constructor TcxGridCardRowHorizontalLayout.Create(ACardViewInfo: TcxGridCardViewInfo; + ASimple: Boolean); +begin + inherited; + FFirstColumnRowsHeaderWidth := -1; +end; + +function TcxGridCardRowHorizontalLayout.CalculateFirstColumnRowsHeaderWidth(AWidth: Integer): Integer; +var + ARows: TList; + I: Integer; +begin + ARows := TList.Create; + try + for I := 0 to LayerCount - 1 do + ARows.Add(Layers[I].Rows[0]); + Result := CalculateRowsHeaderWidth(ARows, AWidth); + finally + ARows.Free; + end; +end; + +procedure TcxGridCardRowHorizontalLayout.CalculateLayerBounds(ALayer: TcxGridCardRowLayer; + AMaxRowHeight: Integer; var ABounds: TRect); +begin + ABounds.Top := ABounds.Bottom; + if HasSeparator(ALayer) then + Inc(ABounds.Top, SeparatorWidth); + ABounds.Bottom := ABounds.Top + Min(ALayer.Thickness, AMaxRowHeight); +end; + +function TcxGridCardRowHorizontalLayout.GetLayerClass: TcxGridCardRowLayerClass; +begin + Result := TcxGridCardRowHorizontalLayer; +end; + +function TcxGridCardRowHorizontalLayout.GetLayersHeight: Integer; +begin + Result := LayersThickness; +end; + +function TcxGridCardRowHorizontalLayout.IsLayerVisible(ALayer: TcxGridCardRowLayer; + ATopRowIndex: Integer): Boolean; +begin + Result := inherited IsLayerVisible(ALayer, ATopRowIndex) and + (not Simple or (ALayer.Index >= ATopRowIndex)); +end; + +function TcxGridCardRowHorizontalLayout.IsLayerVisible(const ABounds, ALayerBounds: TRect): Boolean; +begin + Result := inherited IsLayerVisible(ABounds, ALayerBounds) and + (not Simple or (ABounds.Top <= ALayerBounds.Top) and (ALayerBounds.Top < ABounds.Bottom)); +end; + +procedure TcxGridCardRowHorizontalLayout.Calculate(AWidth: Integer); +begin + inherited; + FFirstColumnRowsHeaderWidth := CalculateFirstColumnRowsHeaderWidth(AWidth); +end; + +function TcxGridCardRowHorizontalLayout.GetHeaderWidth(ARowViewInfo: TcxGridCardRowViewInfo): Integer; +begin + if IsLeft(ARowViewInfo) then + Result := FirstColumnRowsHeaderWidth + else + Result := -1; +end; + +function TcxGridCardRowHorizontalLayout.GetSeparatorBounds(AIndex: Integer): TRect; +begin + Result := CardViewInfo.LayerSeparatorAreaBounds; + Result.Bottom := Layers[1 + AIndex].Bounds.Top; + Result.Top := Result.Bottom - SeparatorWidth; +end; + +function TcxGridCardRowHorizontalLayout.IsLeft(ARowViewInfo: TcxGridCardRowViewInfo): Boolean; +begin + Result := GetIndexInLayer(ARowViewInfo) = 0; +end; + +function TcxGridCardRowHorizontalLayout.IsTop(ARowViewInfo: TcxGridCardRowViewInfo): Boolean; +begin + Result := GetLayerIndex(ARowViewInfo) = 0; +end; + +function TcxGridCardRowHorizontalLayout.IsZoneVertical(AZone: TcxGridCardRowContainerZone): Boolean; +begin + Result := AZone.InsertionPos <> ripNewLayer; +end; + +{ TcxGridCardRowVerticalLayer } + +constructor TcxGridCardRowVerticalLayer.Create(AOwner: TcxGridCardRowLayout; + AIndex: Integer); +begin + inherited; + FRowsHeaderWidth := -1; +end; + +function TcxGridCardRowVerticalLayer.CalculateLength: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to RowCount - 1 do + Inc(Result, Rows[I].Height); +end; + +function TcxGridCardRowVerticalLayer.CalculateRowsHeaderWidth: Integer; +var + ARows: TList; + I: Integer; +begin + ARows := TList.Create; + try + for I := 0 to RowCount - 1 do + ARows.Add(Rows[I]); + Result := Owner.CalculateRowsHeaderWidth(ARows, Thickness); + finally + ARows.Free; + end; +end; + +function TcxGridCardRowVerticalLayer.CalculateThickness: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to RowCount - 1 do + Result := Max(Result, Rows[I].Width); +end; + +procedure TcxGridCardRowVerticalLayer.SetThickness(Value: Integer); +var + I: Integer; +begin + inherited; + for I := 0 to RowCount - 1 do + Rows[I].Width := Thickness; +end; + +procedure TcxGridCardRowVerticalLayer.Calculate(AOwnerWidth: Integer); +begin + inherited; + FRowsHeaderWidth := CalculateRowsHeaderWidth; +end; + +procedure TcxGridCardRowVerticalLayer.CalculateRows(const ABounds: TRect; + ATopRowIndex: Integer; var AVisibleRowCount, APartVisibleRowCount: Integer); +var + R: TRect; + I: Integer; + ARowViewInfo: TcxGridCardRowViewInfo; +begin + R := ABounds; + for I := ATopRowIndex to RowCount - 1 do + begin + ARowViewInfo := Rows[I]; + R.Bottom := R.Top + ARowViewInfo.Height; + ARowViewInfo.Calculate(R); + R.Top := R.Bottom; + if not ARowViewInfo.CalculateVisibleCounts(AVisibleRowCount, APartVisibleRowCount) then + Break; + end; +end; + +function TcxGridCardRowVerticalLayer.HasPoint(const P: TPoint): Boolean; +begin + with Rows[0].Bounds do + Result := (Left <= P.X) and (P.X < Right); +end; + +{ TcxGridCardRowVerticalLayout } + +procedure TcxGridCardRowVerticalLayout.CalculateLayerBounds(ALayer: TcxGridCardRowLayer; + AMaxRowHeight: Integer; var ABounds: TRect); +begin + ABounds.Left := ABounds.Right; + if HasSeparator(ALayer) then + Inc(ABounds.Left, SeparatorWidth); + ABounds.Right := ABounds.Left + ALayer.Thickness; +end; + +procedure TcxGridCardRowVerticalLayout.CalculateLayers(AWidth: Integer); +begin + CalculateLayerWidths(AWidth - NonContentThickness); + inherited; +end; + +procedure TcxGridCardRowVerticalLayout.CalculateLayerWidths(AAvailableWidth: Integer); +var + AWidths: array of Integer; + I: Integer; +begin + SetLength(AWidths, LayerCount); + for I := 0 to LayerCount - 1 do + AWidths[I] := Layers[I].Thickness; + CalculateCardRowWidths(AWidths, AAvailableWidth); + for I := 0 to LayerCount - 1 do + Layers[I].Thickness := AWidths[I]; +end; + +function TcxGridCardRowVerticalLayout.GetLayerClass: TcxGridCardRowLayerClass; +begin + Result := TcxGridCardRowVerticalLayer; +end; + +function TcxGridCardRowVerticalLayout.GetLayersHeight: Integer; +begin + Result := LayersLength; +end; + +function TcxGridCardRowVerticalLayout.GetHeaderWidth(ARowViewInfo: TcxGridCardRowViewInfo): Integer; +begin + Result := TcxGridCardRowVerticalLayer(Layers[GetLayerIndex(ARowViewInfo)]).RowsHeaderWidth; +end; + +function TcxGridCardRowVerticalLayout.GetSeparatorBounds(AIndex: Integer): TRect; +begin + Result := CardViewInfo.LayerSeparatorAreaBounds; + Result.Right := Layers[1 + AIndex].Bounds.Left; + Result.Left := Result.Right - SeparatorWidth; +end; + +function TcxGridCardRowVerticalLayout.IsLeft(ARowViewInfo: TcxGridCardRowViewInfo): Boolean; +begin + Result := True; +end; + +function TcxGridCardRowVerticalLayout.IsTop(ARowViewInfo: TcxGridCardRowViewInfo): Boolean; +begin + Result := GetIndexInLayer(ARowViewInfo) = 0; +end; + +function TcxGridCardRowVerticalLayout.IsZoneVertical(AZone: TcxGridCardRowContainerZone): Boolean; +begin + Result := AZone.InsertionPos = ripNewLayer; +end; + +{ TcxGridCardViewInfo } + +constructor TcxGridCardViewInfo.Create(ARecordsViewInfo: TcxCustomGridRecordsViewInfo; + ARecord: TcxCustomGridRecord); +begin + inherited; + CreateRowViewInfos; + FLayout := GridView.RowLayoutController.CreateCardRowLayout(Self); + if HasLayerSeparators then + FLayout.SeparatorWidth := LayerSeparatorWidth; + CreateScrollButtons; + FExpandButtonViewInfo := GetExpandButtonViewInfoClass.Create(Self); +end; + +destructor TcxGridCardViewInfo.Destroy; +begin + FreeAndNil(FExpandButtonViewInfo); + DestroyScrollButtons; + FreeAndNil(FLayout); + DestroyRowViewInfos; + inherited; +end; + +function TcxGridCardViewInfo.GetCacheItem: TcxGridCardViewInfoCacheItem; +begin + Result := TcxGridCardViewInfoCacheItem(inherited CacheItem); +end; + +function TcxGridCardViewInfo.GetCardBorderWidth: Integer; +begin + Result := RecordsViewInfo.CardBorderWidth; +end; + +function TcxGridCardViewInfo.GetExpandButtonSizeValue: Integer; +begin + Result := GetExpandButtonSize(LookAndFeelPainter); +end; + +function TcxGridCardViewInfo.GetFirstCaptionRowViewInfo: TcxGridCardRowViewInfo; +var + ARow: TcxGridCardViewRow; +begin + ARow := GridView.FirstCaptionRow; + if ARow = nil then + Result := nil + else + Result := RowViewInfos[ARow.VisibleIndex]; +end; + +function TcxGridCardViewInfo.GetGridView: TcxGridCardView; +begin + Result := TcxGridCardView(inherited GridView); +end; + +function TcxGridCardViewInfo.GetGridRecord: TcxGridCard; +begin + Result := TcxGridCard(inherited GridRecord); +end; + +function TcxGridCardViewInfo.GetRecordsViewInfo: TcxGridCardsViewInfo; +begin + Result := TcxGridCardsViewInfo(inherited RecordsViewInfo); +end; + +function TcxGridCardViewInfo.GetRowViewInfo(Index: Integer): TcxGridCardRowViewInfo; +begin + Result := TcxGridCardRowViewInfo(FRowViewInfos[Index]); +end; + +function TcxGridCardViewInfo.GetRowViewInfoCount: Integer; +begin + Result := FRowViewInfos.Count; +end; + +function TcxGridCardViewInfo.GetTopRowIndex: Integer; +begin + if CacheItem.IsTopRowIndexAssigned then + Result := CacheItem.TopRowIndex + else + begin + Result := 0; + CacheItem.TopRowIndex := Result; + end; +end; + +function TcxGridCardViewInfo.GetVisibleRowViewInfo(Index: Integer): TcxGridCardRowViewInfo; +begin + Result := RowViewInfos[Layout.Rows[Index].VisibleIndex]; +end; + +function TcxGridCardViewInfo.GetVisibleRowViewInfoCount: Integer; +begin + Result := Layout.RowCount; +end; + +procedure TcxGridCardViewInfo.SetTopRowIndex(Value: Integer); +begin + if Value < 0 then Value := 0; + if TopRowIndex <> Value then + begin + CacheItem.TopRowIndex := Value; + Recalculate; + Invalidate; + end; +end; + +procedure TcxGridCardViewInfo.CreateRowViewInfos; +var + I: Integer; + ARow: TcxGridCardViewRow; +begin + FRowViewInfos := TList.Create; + for I := 0 to GridView.VisibleRowCount - 1 do + begin + ARow := GridView.VisibleRows[I]; + FRowViewInfos.Add(GetRowViewInfoClass(ARow).Create(Self, I)); + end; +end; + +procedure TcxGridCardViewInfo.DestroyRowViewInfos; +var + I: Integer; +begin + for I := 0 to RowViewInfoCount - 1 do RowViewInfos[I].Free; + FreeAndNil(FRowViewInfos); +end; + +procedure TcxGridCardViewInfo.CreateScrollButtons; +begin + FScrollButtonDown := GetScrollButtonDownViewInfoClass.Create(Self); + FScrollButtonUp := GetScrollButtonUpViewInfoClass.Create(Self); +end; + +procedure TcxGridCardViewInfo.DestroyScrollButtons; +begin + FreeAndNil(FScrollButtonUp); + FreeAndNil(FScrollButtonDown); +end; + +procedure TcxGridCardViewInfo.CalculateExpandButtonBounds(var ABounds: TRect); +var + ASize: Integer; +begin + ABounds := ExpandButtonAreaBounds; + if IsRectEmpty(ABounds) then Exit; + ASize := ExpandButtonSize; + with ABounds do + begin + Left := (Left + Right - ASize) div 2; + Right := Left + ASize; + Top := (Top + Bottom - ASize) div 2; + Bottom := Top + ASize; + end; +end; + +function TcxGridCardViewInfo.CalculateHeight: Integer; +begin + if RecordsViewInfo.UseCardHeight then + Result := RecordsViewInfo.CardHeight + else + begin + CalculateParams; + DoCalculateLayout; + Result := 2 * CardBorderWidth; + Inc(Result, Layout.LayersHeight); + end; +{ if Result > RecordsViewInfo.MaxCardHeight then + Result := RecordsViewInfo.MaxCardHeight;} +end; + +procedure TcxGridCardViewInfo.CalculateLayout; +begin + Layout.Calculate(ContentWidth); +end; + +procedure TcxGridCardViewInfo.DoCalculateLayout; +begin + if not FLayoutCalculated then + begin + CalculateLayout; + FLayoutCalculated := True; + end; +end; + +procedure TcxGridCardViewInfo.CalculateRows; +var + R: TRect; +begin + R := ContentBounds; + if NeedsScrollingUp then + Inc(R.Top, ScrollButtonHeight); + Layout.CalculateRows(R, TopRowIndex, MaxRowViewInfoHeight, + FVisibleRowCount, FPartVisibleRowCount); +end; + +procedure TcxGridCardViewInfo.CalculateRowVisibles; +var + I: Integer; + ARowViewInfo: TcxGridCardRowViewInfo; +begin + FVisibleRowCount := 0; + FPartVisibleRowCount := 0; + for I := TopRowIndex to VisibleRowViewInfoCount - 1 do + begin + ARowViewInfo := VisibleRowViewInfos[I]; + ARowViewInfo.CalculateVisibles; + if not ARowViewInfo.CalculateVisibleCounts(FVisibleRowCount, FPartVisibleRowCount) then + Break; + end; +end; + +function TcxGridCardViewInfo.CalculateWidth: Integer; +begin + Result := Width; +end; + +function TcxGridCardViewInfo.CanGenerateExpandButtonHitTest: Boolean; +begin + Result := False; +end; + +function TcxGridCardViewInfo.GetAutoHeight: Boolean; +begin + Result := RecordsViewInfo.AutoDataRecordHeight; +end; + +function TcxGridCardViewInfo.GetBackgroundBitmapBounds: TRect; +begin + Result := RestSpaceBounds; +end; + +function TcxGridCardViewInfo.GetContentBounds: TRect; +begin + Result := inherited GetContentBounds; + InflateRect(Result, -CardBorderWidth, -CardBorderWidth); + Inc(Result.Top, FScrollButtonUp.Height); + Dec(Result.Bottom, FScrollButtonDown.Height); +end; + +function TcxGridCardViewInfo.GetContentHeight: Integer; +begin + with ContentBounds do + Result := Bottom - Top; +end; + +function TcxGridCardViewInfo.GetContentWidth: Integer; +begin + with ContentBounds do + Result := Right - Left; +end; + +function TcxGridCardViewInfo.GetExpandButtonAlignment: TcxGridCardExpandButtonAlignment; +begin + Result := GridView.OptionsView.CardExpandButtonAlignment; +end; + +function TcxGridCardViewInfo.GetExpandButtonAreaBounds: TRect; +var + ARowViewInfo: TcxGridCardRowViewInfo; + AOwnerViewInfo: TcxGridCardRowCellViewInfo; +begin + ARowViewInfo := FirstCaptionRowViewInfo; + if (ARowViewInfo = nil) or not ARowViewInfo.PartVisible then + SetRectEmpty(Result) + else + begin + Result := ARowViewInfo.Bounds; + case ExpandButtonAlignment of + cebaLeft: + begin + Result.Right := Result.Left + ExpandButtonAreaWidth; + if ARowViewInfo.CaptionViewInfo.Visible then + AOwnerViewInfo := ARowViewInfo.CaptionViewInfo + else + AOwnerViewInfo := ARowViewInfo.DataViewInfo; + end; + cebaRight: + begin + Result.Left := Result.Right - ExpandButtonAreaWidth; + if ARowViewInfo.DataViewInfo.Visible then + AOwnerViewInfo := ARowViewInfo.DataViewInfo + else + AOwnerViewInfo := ARowViewInfo.CaptionViewInfo; + end; + else + AOwnerViewInfo := nil; + end; + if IsRectEmpty(AOwnerViewInfo.TextAreaBounds) then + SetRectEmpty(Result); + end; +end; + +function TcxGridCardViewInfo.GetExpandButtonAreaWidth: Integer; +begin + Result := CardExpandButtonOffset + ExpandButtonSize + CardExpandButtonOffset; +end; + +class function TcxGridCardViewInfo.GetExpandButtonSize(ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; +begin + Result := ALookAndFeelPainter.GroupExpandButtonSize; +end; + +function TcxGridCardViewInfo.GetHeight: Integer; +begin + Result := Min(inherited GetHeight, RecordsViewInfo.MaxCardHeight); +end; + +function TcxGridCardViewInfo.GetLayerSeparatorAreaBounds: TRect; +begin + Result := ContentBounds; +end; + +function TcxGridCardViewInfo.GetLayerSeparatorColor: TColor; +var + AParams: TcxViewParams; +begin + GridView.Styles.GetViewParams(vsLayerSeparator, nil, nil, AParams); + Result := AParams.Color; +end; + +function TcxGridCardViewInfo.GetLayerSeparatorWidth: Integer; +begin + Result := GridView.OptionsView.LayerSeparatorWidth; +end; + +function TcxGridCardViewInfo.GetMaxRowViewInfoHeight: Integer; +begin + Result := ContentHeight; + if NeedsScrollingUp then + Dec(Result, ScrollButtonHeight); +end; + +function TcxGridCardViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridCardPainter; +end; + +function TcxGridCardViewInfo.GetRestSpaceBounds: TRect; +begin + if (VisibleRowCount = 0) or not NeedsScrollingUp or NeedsScrollingDown then + SetRectEmpty(Result) + else + begin + Result := ContentBounds; + Result.Top := RowViewInfos[TopRowIndex + VisibleRowCount - 1].Bounds.Bottom; + end; +end; + +function TcxGridCardViewInfo.GetScrollableAreaBounds: TRect; +begin + Result := ContentBounds; + if FScrollButtonUp.Visible then + Result.Top := FScrollButtonUp.Bounds.Bottom; + if FScrollButtonDown.Visible then + Result.Bottom := FScrollButtonDown.Bounds.Top; +end; + +function TcxGridCardViewInfo.GetScrollButtonDownBounds: TRect; +begin + Result := ContentBounds; + with Result do + Top := Bottom - ScrollButtonHeight; +end; + +function TcxGridCardViewInfo.GetScrollButtonDownViewInfoClass: TcxGridCardScrollButtonDownViewInfoClass; +begin + Result := TcxGridCardScrollButtonDownViewInfo; +end; + +function TcxGridCardViewInfo.GetScrollButtonUpViewInfoClass: TcxGridCardScrollButtonUpViewInfoClass; +begin + Result := TcxGridCardScrollButtonUpViewInfo; +end; + +function TcxGridCardViewInfo.GetScrollButtonHeight: Integer; +begin + Result := MulDiv(GetScrollBarSize.cy, 3, 4); +end; + +function TcxGridCardViewInfo.GetScrollButtonUpBounds: TRect; +begin + Result := ContentBounds; + with Result do + Bottom := Top + ScrollButtonHeight; +end; + +procedure TcxGridCardViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetRecordContentParams(GridRecord, nil, AParams); +end; + +function TcxGridCardViewInfo.GetVisible: Boolean; +begin + Result := Index < RecordsViewInfo.PartVisibleCount; +end; + +function TcxGridCardViewInfo.GetWidth: Integer; +begin + Result := RecordsViewInfo.CardWidth; +end; + +function TcxGridCardViewInfo.HasCategorySeparator(ARowViewInfo: TcxGridCardCategoryRowViewInfo): Boolean; +begin + Result := not Layout.IsTop(ARowViewInfo) and Layout.IsWholeLine(ARowViewInfo.Row); +end; + +class function TcxGridCardViewInfo.HasCategorySeparator(ARow: TcxGridCardViewRow): Boolean; +begin + Result := (ARow.Position.VisibleRowIndex <> 0) and ARow.Position.IsWholeLine; +end; + +function TcxGridCardViewInfo.HasIndent(ARowViewInfo: TcxGridCardRowViewInfo): Boolean; +begin + Result := (ARowViewInfo.Row.CategoryRow <> nil) and Layout.IsLeft(ARowViewInfo); +end; + +function TcxGridCardViewInfo.HasLayerSeparators: Boolean; +begin + Result := not Layout.Simple and (LayerSeparatorWidth <> 0); +end; + +function TcxGridCardViewInfo.IsRowPartiallyVisible(ARowViewInfo: TcxGridCardRowViewInfo): Boolean; +begin + Result := not Layout.Simple or (ARowViewInfo.Bounds.Top < ContentBounds.Bottom); +end; + +function TcxGridCardViewInfo.IsRowVisible(ARowViewInfo: TcxGridCardRowViewInfo): Boolean; +begin + Result := not Layout.Simple or (ARowViewInfo.Bounds.Bottom <= ContentBounds.Bottom); +end; + +function TcxGridCardViewInfo.SupportsScrolling: Boolean; +begin + Result := Layout.Simple; +end; + +function TcxGridCardViewInfo.GetZone(AHitTest: TcxCustomGridHitTest): TcxGridItemContainerZone; + + function GetPointPosition(const ARect: TRect; const P: TPoint; + AHorzSeparation: Boolean): TcxPosition; + const + HorzAreaMaxWidth = 30; + var + AHorzAreaWidth: Integer; + begin + if P.Y < GetRangeCenter(ARect.Top, ARect.Bottom) then + Result := posTop + else + Result := posBottom; + if AHorzSeparation then + begin + AHorzAreaWidth := Min(HorzAreaMaxWidth, (ARect.Right - ARect.Left) div 4); + if P.X < ARect.Left + AHorzAreaWidth then + Result := posLeft + else + if P.X >= ARect.Right - AHorzAreaWidth then + Result := posRight; + end; + end; + +var + AInsertionIndex: Integer; + AInsertionPos: TcxGridCardRowInsertionPos; + ARow: TcxGridCardViewRow; + APosition: TcxPosition; +begin + if VisibleRowCount = 0 then + begin + AInsertionIndex := 0; + AInsertionPos := ripNewLayer; + end + else + begin + if AHitTest is TcxGridRecordCellHitTest then + begin + ARow := TcxGridCardViewRow(TcxGridRecordCellHitTest(AHitTest).Item); + APosition := GetPointPosition(RowViewInfos[ARow.VisibleIndex].ContentBounds, + AHitTest.Pos, GridView.SupportsLayeredRows); + end + else + if AHitTest.HitTestCode = htCardScrollButtonUp then + begin + ARow := VisibleRowViewInfos[TopRowIndex].Row; + APosition := posTop; + end + else + if (AHitTest.HitTestCode = htCardScrollButtonDown) or PtInRect(RestSpaceBounds, AHitTest.Pos) then + begin + ARow := VisibleRowViewInfos[TopRowIndex + PartVisibleRowCount - 1].Row; + APosition := posBottom; + end + else + begin + ARow := nil; + APosition := posNone; + end; + if ARow <> nil then + Layout.GetInsertionParams(ARow, APosition, AInsertionIndex, AInsertionPos) + else + if PtInRect(ContentBounds, AHitTest.Pos) then + begin + AInsertionIndex := Layout.GetLayerIndex(AHitTest.Pos); + if AInsertionIndex <> -1 then + begin + AInsertionIndex := Layout.LayerFirstRowIndex[AInsertionIndex + 1]; + AInsertionPos := ripPrevLayer; + end; + end + else + AInsertionIndex := -1; + end; + if AInsertionIndex <> -1 then + Result := TcxGridCardRowContainerZone.Create(GridRecord, AInsertionIndex, AInsertionPos) + else + Result := nil; +end; + +function TcxGridCardViewInfo.GetZoneBounds(AZone: TcxGridCardRowContainerZone): TRect; +var + AUseFirstPart: Boolean; +begin + if VisibleRowCount = 0 then + Result := ContentBounds + else + begin + AUseFirstPart := False; + if AZone.ItemIndex > VisibleRowViewInfos[TopRowIndex + PartVisibleRowCount - 1].Row.VisibleIndex then + Result := VisibleRowViewInfos[TopRowIndex + PartVisibleRowCount - 1].Bounds + else + if AZone.InsertionPos = ripPrevLayer then + Result := VisibleRowViewInfos[VisibleRowViewInfoIndexOf(RowViewInfos[AZone.ItemIndex]) - 1].Bounds + else + begin + Result := RowViewInfos[AZone.ItemIndex].Bounds; + AUseFirstPart := True; + end; + if not AUseFirstPart then + if IsZoneVertical(AZone) then + Result.Left := Result.Right + else + Result.Top := Result.Bottom; + + if AZone.InsertionPos = ripNewLayer then + if IsZoneVertical(AZone) then + begin + Result.Top := ContentBounds.Top; + Result.Bottom := ContentBounds.Bottom; + end + else + begin + Result.Left := ContentBounds.Left; + Result.Right := ContentBounds.Right; + end; + end; +end; + +function TcxGridCardViewInfo.IsZoneVertical(AZone: TcxGridCardRowContainerZone): Boolean; +begin + Result := Layout.IsZoneVertical(AZone); +end; + +function TcxGridCardViewInfo.GetExpandButtonViewInfoClass: TcxGridCardExpandButtonViewInfoClass; +begin + Result := TcxGridCardExpandButtonViewInfo; +end; + +class function TcxGridCardViewInfo.GetRowViewInfoClass(ARow: TcxGridCardViewRow): TcxGridCardRowViewInfoClass; +const + RowViewInfoClasses: array[TcxGridCardViewRowKind] of TcxGridCardRowViewInfoClass = + (TcxGridCardDataRowViewInfo, TcxGridCardCaptionRowViewInfo, TcxGridCardCategoryRowViewInfo); +begin + Result := RowViewInfoClasses[ARow.Kind]; +end; + +procedure TcxGridCardViewInfo.BeforeRecalculation; +var + I: Integer; +begin + FVisibleRowCount := 0; + FPartVisibleRowCount := 0; + FLayoutCalculated := False; + inherited; + for I := 0 to RowViewInfoCount - 1 do + RowViewInfos[I].BeforeRecalculation; + FExpandButtonViewInfo.BeforeRecalculation; +end; + +procedure TcxGridCardViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + inherited; + DoCalculateLayout; + SetRectEmpty(FScrollButtonDown.Bounds); + SetRectEmpty(FScrollButtonUp.Bounds); + CalculateRows; + if SupportsScrolling then + begin + if FScrollButtonDown.Visible then + FScrollButtonDown.Calculate(ScrollButtonDownBounds); + if FScrollButtonUp.Visible then + FScrollButtonUp.Calculate(ScrollButtonUpBounds); + CalculateRowVisibles; + end; +end; + +function TcxGridCardViewInfo.GetBoundsForItem(AItem: TcxCustomGridTableItem): TRect; +begin + with RowViewInfos[AItem.VisibleIndex] do + if Hidden then + Result := inherited GetBoundsForItem(AItem) + else + Result := Bounds; +end; + +procedure TcxGridCardViewInfo.GetCardBorderViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetCardBorderVisualParams(GridRecord, AParams); +end; + +function TcxGridCardViewInfo.GetCellViewInfoByItem(AItem: TcxCustomGridTableItem): TcxGridTableDataCellViewInfo; +begin + if AItem.VisibleIndex = -1 then + Result := nil + else + Result := RowViewInfos[AItem.VisibleIndex].DataViewInfo; +end; + +function TcxGridCardViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +var + I: Integer; + AHitTest: TcxCustomGridHitTest; +begin + Result := FScrollButtonUp.GetHitTest(P); + if Result = nil then + begin + Result := FScrollButtonDown.GetHitTest(P); + if Result = nil then + begin + Result := FExpandButtonViewInfo.GetHitTest(P); + if Result = nil then + begin + Result := inherited GetHitTest(P); + if Result <> nil then + for I := TopRowIndex to TopRowIndex + PartVisibleRowCount - 1 do + begin + AHitTest := VisibleRowViewInfos[I].GetHitTest(P); + if AHitTest <> nil then + begin + Result := AHitTest; + Exit; + end; + end; + end; + end; + end; +end; + +function TcxGridCardViewInfo.IsFullyVisible: Boolean; +begin + Result := (inherited GetHeight <= RecordsViewInfo.MaxCardHeight){ and + not (NeedsScrollingUp or NeedsScrollingDown)}; +end; + +procedure TcxGridCardViewInfo.MainCalculate(ALeftBound, ATopBound: Integer); +begin + inherited; + if FExpandButtonViewInfo.Visible then + FExpandButtonViewInfo.Calculate(ExpandButtonBounds); +end; + +procedure TcxGridCardViewInfo.MakeRowVisible(ARow: TcxGridCardViewRow); +var + AVisibleRowIndex: Integer; +begin + AVisibleRowIndex := VisibleRowViewInfoIndexOf(ARow); + if AVisibleRowIndex = -1 then Exit; + if AVisibleRowIndex < TopRowIndex then + TopRowIndex := AVisibleRowIndex + else + if AVisibleRowIndex >= TopRowIndex + VisibleRowCount then + while not VisibleRowViewInfos[AVisibleRowIndex].Visible and (AVisibleRowIndex <> TopRowIndex) do + TopRowIndex := TopRowIndex + 1; +end; + +function TcxGridCardViewInfo.NeedsScrollingDown: Boolean; +begin + Result := (TopRowIndex + VisibleRowCount < VisibleRowViewInfoCount) and + ((VisibleRowCount > 0) or (TopRowIndex <> VisibleRowViewInfoCount - 1)); +end; + +function TcxGridCardViewInfo.NeedsScrollingUp: Boolean; +begin + Result := TopRowIndex > 0; +end; + +function TcxGridCardViewInfo.VisibleRowViewInfoIndexOf(ARow: TcxGridCardViewRow): Integer; +begin + if ARow.VisibleIndex = -1 then + Result := -1 + else + Result := VisibleRowViewInfoIndexOf(RowViewInfos[ARow.VisibleIndex]); +end; + +function TcxGridCardViewInfo.VisibleRowViewInfoIndexOf(ARowViewInfo: TcxGridCardRowViewInfo): Integer; +begin + Result := Layout.GetRowIndex(ARowViewInfo.Row); +end; + +{ TcxGridCardsViewInfo } + +constructor TcxGridCardsViewInfo.Create(AGridViewInfo: TcxCustomGridTableViewInfo); +begin + inherited; + FCardHeight := -1; + FColumns := TcxGridCardViewColumns.Create(Self); +end; + +destructor TcxGridCardsViewInfo.Destroy; +begin + FColumns.Free; + inherited; +end; + +function TcxGridCardsViewInfo.GetCardBorderWidth: Integer; +begin + Result := GridView.OptionsView.CardBorderWidth; +end; + +function TcxGridCardsViewInfo.GetCardContentWidth: Integer; +begin + Result := CardWidth - 2 * CardBorderWidth; +end; + +function TcxGridCardsViewInfo.GetCardIndent: Integer; +begin + Result := GridView.OptionsView.CardIndent; +end; + +function TcxGridCardsViewInfo.GetColumnWidth: Integer; +begin + Result := CardWidth + CardSpaceHorz; +end; + +function TcxGridCardsViewInfo.GetGridView: TcxGridCardView; +begin + Result := TcxGridCardView(inherited GridView); +end; + +function TcxGridCardsViewInfo.GetGridViewInfo: TcxGridCardViewViewInfo; +begin + Result := TcxGridCardViewViewInfo(inherited GridViewInfo); +end; + +function TcxGridCardsViewInfo.GetItem(Index: Integer): TcxGridCardViewInfo; +begin + Result := TcxGridCardViewInfo(inherited Items[Index]); +end; + +function TcxGridCardsViewInfo.GetRowHeight: Integer; +begin + Result := CardHeight + CardSpaceVert; +end; + +function TcxGridCardsViewInfo.GetViewData: TcxGridCardViewViewData; +begin + Result := TcxGridCardViewViewData(inherited ViewData); +end; + +procedure TcxGridCardsViewInfo.Calculate; +begin + inherited; + FCardWidth := CalculateCardWidth; + FCardHeight := CalculateCardHeight; + FMaxCardHeight := CalculateMaxCardHeight; +end; + +function TcxGridCardsViewInfo.CalculateCardHeight: Integer; +var + I: Integer; +begin + if GridView.VisibleRowCount = 0 then + Result := EmptyCardHeight + else + begin + Result := 2 * CardBorderWidth; + SetLength(CardRowHeights, GridView.VisibleRowCount); + for I := 0 to GridView.VisibleRowCount - 1 do + begin + CardRowHeights[I] := CalculateCardRowHeight(GridView.VisibleRows[I]); + Inc(Result, CardRowHeights[I]); + end; + end; +end; + +function TcxGridCardsViewInfo.CalculateCardRowHeight(ARow: TcxGridCardViewRow): Integer; +begin + Result := GetItemViewInfoClass.GetRowViewInfoClass(ARow).CalculateSimpleHeight(ARow, Canvas); +end; + +function TcxGridCardsViewInfo.CalculateCardWidth: Integer; +var + ASpace, ACardColCount: Integer; +begin + Result := GridView.OptionsView.CardWidth; + if GridView.OptionsView.CardAutoWidth then + begin + ASpace := ContentBounds.Right - ContentBounds.Left + CardSpaceHorz; + ACardColCount := ASpace div (Result + CardSpaceHorz); + if ACardColCount < 1 then ACardColCount := 1; + Result := ASpace div ACardColCount - CardSpaceHorz; + if Result < cxGridCardMinWidth then Result := cxGridCardMinWidth; + end; +end; + +function TcxGridCardsViewInfo.CalculateContentBounds: TRect; +begin + Result := inherited CalculateContentBounds; + InflateRect(Result, -CardIndent, -CardIndent); +end; + +function TcxGridCardsViewInfo.CalculateHeight(var AFullyVisible: Boolean): Integer; +var + AIsParentViewInfoCalculatedDown: Boolean; + I, AColumnHeight: Integer; + ALastRow: TcxGridCardViewInfo; +begin + if Columns.Count = 0 then + Result := 2 * CardIndent + CardHeight + else + begin + Result := 0; + AIsParentViewInfoCalculatedDown := + (GridView.MasterGridView.ViewInfo as TcxCustomGridTableViewInfo).CalculateDown; + {if AIsParentViewInfoCalculatedDown then + AFullyVisible := True;} + for I := 0 to Columns.Count - 1 do + begin + ALastRow := Columns[I].LastRow; + AColumnHeight := ALastRow.Bounds.Bottom + CardIndent; + if Result < AColumnHeight then Result := AColumnHeight; + if AIsParentViewInfoCalculatedDown and AFullyVisible then + AFullyVisible := ALastRow.IsFullyVisible; + end; + end; +end; + +function TcxGridCardsViewInfo.CalculateMaxCardHeight: Integer; +begin + with ContentBounds do + Result := Bottom - Top; + if Result < 0 then Result := 0; +end; + +function TcxGridCardsViewInfo.CalculateWidth(AMaxWidth: Integer): Integer; +begin + if Columns.Count = 0 then + Result := 0 + else + if Columns.Count = Columns.VisibleCount then + Result := Columns.Last[0].Bounds.Right + CardIndent + else + Result := AMaxWidth; +end; + +function TcxGridCardsViewInfo.GetAutoCellHeight: Boolean; +begin + Result := AutoDataCellHeight or GridView.OptionsView.RowCaptionAutoHeight; +end; + +function TcxGridCardsViewInfo.GetAutoDataRecordHeight: Boolean; +begin + Result := AutoCellHeight or not GridView.OptionsView.EmptyRows or + GridView.OptionsCustomize.CardExpanding; +end; + +{procedure TcxGridCardsViewInfo.GetDataCellDefaultViewParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; var AParams: TcxViewParams); +begin + inherited; + RealItems[ARecord.Index].RowViewInfos[AItem.VisibleIndex].GetDefaultViewParams(AParams); +end;} + +function TcxGridCardsViewInfo.GetItemLeftBound(AIndex: Integer): Integer; +begin + Result := 0; +end; + +function TcxGridCardsViewInfo.GetItemsOffset(AItemCountDelta: Integer): Integer; +begin + Result := 0; +end; + +function TcxGridCardsViewInfo.GetItemTopBound(AIndex: Integer): Integer; +begin + Result := 0; +end; + +function TcxGridCardsViewInfo.GetItemViewInfoClass: TcxGridCardViewInfoClass; +begin + Result := TcxGridCardViewInfo; +end; + +procedure TcxGridCardsViewInfo.OffsetItem(AIndex, AOffset: Integer); +begin +end; + +function TcxGridCardsViewInfo.GetRealItem(ARecord: TcxCustomGridRecord): TcxGridCardViewInfo; +begin + Result := TcxGridCardViewInfo(inherited GetRealItem(ARecord)); +end; + +function TcxGridCardsViewInfo.GetZone(AHitTest: TcxCustomGridHitTest): TcxGridItemContainerZone; +begin + if (AHitTest is TcxGridRecordHitTest) and + TcxGridCardViewController(Controller).CanHandleHitTest(AHitTest) then + Result := GetRealItem(TcxGridRecordHitTest(AHitTest).GridRecord).GetZone(AHitTest) + else + Result := nil; +end; + +function TcxGridCardsViewInfo.UseCardHeight: Boolean; +begin + Result := UseCardRowHeights and not AutoDataRecordHeight and + GridView.RowLayoutController.IsSimpleLayout; +end; + +function TcxGridCardsViewInfo.UseCardRowHeights: Boolean; +begin + Result := (CardRowHeights <> nil) and not AutoCellHeight and + (not AutoDataRecordHeight or (GridView.OptionsView.CategorySeparatorWidth = 0) {or (no category rows)}); +end; + +{ TcxGridCardsHorizontalViewInfo } + +procedure TcxGridCardsHorizontalViewInfo.Calculate; +var + ALeftBound, ATopBound, ACol, ARow, I: Integer; +begin + inherited; + ACol := 0; + ARow := 0; + ALeftBound := ContentBounds.Left; + ATopBound := ContentBounds.Top; + + for I := 0 to MaxCount - 1 do + begin + if I <> 0 then + if ATopBound + Items[I].Height > ContentBounds.Bottom then + begin + Inc(ACol); + ARow := 0; + Inc(ALeftBound, Items[I - 1].Width + CardSpaceHorz); + if ALeftBound >= Bounds.Right then Break; + ATopBound := ContentBounds.Top; + end; + + if GridViewInfo.CalculateDown then + begin + Columns[ACol][ARow] := Items[I]; + Items[I].MainCalculate(ALeftBound, ATopBound); + end; + + if ((ALeftBound + Items[I].Width <= Bounds.Right) or (ACol = 0)) then + Inc(FVisibleCount); + Inc(FPartVisibleCount); + Inc(ARow); + Inc(ATopBound, Items[I].Height + CardSpaceVert); + end; +end; + +function TcxGridCardsHorizontalViewInfo.GetCardSpaceHorz: Integer; +begin + Result := CardIndent + GridViewInfo.SeparatorsViewInfo.Width + CardIndent; +end; + +function TcxGridCardsHorizontalViewInfo.GetCardSpaceVert: Integer; +begin + Result := CardIndent; +end; + +{ TcxGridCardsVerticalViewInfo } + +procedure TcxGridCardsVerticalViewInfo.Calculate; +var + ALeftBound, ATopBound, ARowHeight, ACol, ARow, I: Integer; + AIsVisibleCountCalculated: Boolean; + + procedure CalcVisibleCount; + begin + Inc(FPartVisibleCount); + if not AIsVisibleCountCalculated then + if (ARow = 0) or (ATopBound + Items[I].Height <= Bounds.Bottom) then + Inc(FVisibleCount) + else + begin + Dec(FVisibleCount, ACol); + AIsVisibleCountCalculated := True; + end; + end; + +begin + inherited; + ACol := 0; + ARow := 0; + ALeftBound := ContentBounds.Left; + ATopBound := ContentBounds.Top; + ARowHeight := 0; + AIsVisibleCountCalculated := False; + + for I := 0 to MaxCount - 1 do + begin + if I <> 0 then + if ALeftBound + Items[I].Width > ContentBounds.Right then + begin + ACol := 0; + Inc(ARow); + ALeftBound := ContentBounds.Left; + Inc(ATopBound, ARowHeight + CardSpaceVert); + if ATopBound >= Bounds.Bottom then Break; + ARowHeight := 0; + end; + + if GridViewInfo.CalculateDown then + begin + Columns[ACol][ARow] := Items[I]; + Items[I].MainCalculate(ALeftBound, ATopBound); + end; + + CalcVisibleCount; + + Inc(ACol); + if ARowHeight < Items[I].Height then + ARowHeight := Items[I].Height; + Inc(ALeftBound, Items[I].Width + CardSpaceHorz); + end; +end; + +function TcxGridCardsVerticalViewInfo.GetCardSpaceHorz: Integer; +begin + Result := CardIndent; +end; + +function TcxGridCardsVerticalViewInfo.GetCardSpaceVert: Integer; +begin + Result := CardIndent + GridViewInfo.SeparatorsViewInfo.Width + CardIndent; +end; + +{ TcxGridCardViewSeparatorsViewInfo } + +constructor TcxGridCardViewSeparatorsViewInfo.Create(AGridViewInfo: TcxGridCardViewViewInfo); +begin + inherited Create; + FGridViewInfo := AGridViewInfo; + CreateItems; +end; + +destructor TcxGridCardViewSeparatorsViewInfo.Destroy; +begin + DestroyItems; + inherited; +end; + +function TcxGridCardViewSeparatorsViewInfo.GetColor: TColor; +begin + Result := GridView.OptionsView.GetSeparatorColor; +end; + +function TcxGridCardViewSeparatorsViewInfo.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxGridCardViewSeparatorsViewInfo.GetGridView: TcxGridCardView; +begin + Result := FGridViewInfo.GridView; +end; + +function TcxGridCardViewSeparatorsViewInfo.GetItem(Index: Integer): TRect; +begin + Result := PRect(FItems[Index])^; +end; + +function TcxGridCardViewSeparatorsViewInfo.GetRecordsViewInfo: TcxGridCardsViewInfo; +begin + Result := FGridViewInfo.RecordsViewInfo; +end; + +function TcxGridCardViewSeparatorsViewInfo.GetWidth: Integer; +begin + Result := GridView.OptionsView.SeparatorWidth; +end; + +procedure TcxGridCardViewSeparatorsViewInfo.SetItem(Index: Integer; const Value: TRect); +var + ARect: PRect; +begin + if Index >= Count then + begin + New(ARect); + FItems.Add(ARect); + end; + PRect(FItems[Index])^ := Value; +end; + +procedure TcxGridCardViewSeparatorsViewInfo.CreateItems; +begin + FItems := TList.Create; +end; + +procedure TcxGridCardViewSeparatorsViewInfo.DestroyItems; +var + I: Integer; +begin + for I := 0 to FItems.Count - 1 do Dispose(PRect(FItems[I])); + FreeAndNil(FItems); +end; + +function TcxGridCardViewSeparatorsViewInfo.GetBounds: TRect; +begin + Result := GridViewInfo.ClientBounds; + InflateRect(Result, -RecordsViewInfo.CardIndent, -RecordsViewInfo.CardIndent); +end; + +function TcxGridCardViewSeparatorsViewInfo.GetHitTest(const P: TPoint): TcxGridCardViewSeparatorHitTest; +var + I: Integer; +begin + if GridView.SupportsCardSizing and PtInRect(GridViewInfo.ClientBounds, P) then + for I := 0 to HitTestItemCount - 1 do + if PtInRect(HitTestItems[I], P) then + begin + Result := TcxGridCardViewSeparatorHitTest(TcxGridCardViewSeparatorHitTest.Instance(P)); + Result.Separators := Self; + Result.Index := I; + Exit; + end; + Result := nil; +end; + +{ TcxGridCardViewSeparatorsHorizontalViewInfo } + +function TcxGridCardViewSeparatorsHorizontalViewInfo.GetHitTestItem(Index: Integer): TRect; +begin + Result := Items[Index]; + InflateRect(Result, SeparatorSizingAddZone, 0); +end; + +function TcxGridCardViewSeparatorsHorizontalViewInfo.GetHitTestItemCount: Integer; +begin + Result := Count; +end; + +procedure TcxGridCardViewSeparatorsHorizontalViewInfo.Calculate; +var + R: TRect; + I: Integer; +begin + R := Bounds; + for I := 0 to RecordsViewInfo.Columns.Count - 1 do + begin + R.Left := RecordsViewInfo.Columns[I][0].Bounds.Right + RecordsViewInfo.CardIndent; + R.Right := R.Left + Width; + Items[I] := R; + end; +end; + +{ TcxGridCardViewSeparatorsVerticalViewInfo } + +function TcxGridCardViewSeparatorsVerticalViewInfo.GetHitTestItem(Index: Integer): TRect; +begin + Result := Bounds; + Result.Left := RecordsViewInfo.Columns[Index][0].Bounds.Right + + (RecordsViewInfo.CardSpaceHorz - SeparatorSizingZone) div 2; + Result.Right := Result.Left + SeparatorSizingZone; +end; + +function TcxGridCardViewSeparatorsVerticalViewInfo.GetHitTestItemCount: Integer; +begin + Result := RecordsViewInfo.Columns.Count; +end; + +procedure TcxGridCardViewSeparatorsVerticalViewInfo.Calculate; + + function GetRowBottom(ARowIndex: Integer): Integer; + var + I: Integer; + begin + Result := 0; + for I := 0 to RecordsViewInfo.Columns.Count - 1 do + with RecordsViewInfo.Columns[I] do + if ARowIndex < RowCount then + with Rows[ARowIndex] do + if Result < Bounds.Bottom then Result := Bounds.Bottom; + end; + +var + R: TRect; + I: Integer; +begin + if RecordsViewInfo.Columns.Count = 0 then Exit; + R := Bounds; + R.Right := Max(R.Right, RecordsViewInfo.Columns[0][0].Bounds.Right); + for I := 0 to RecordsViewInfo.Columns[0].RowCount - 1 do + begin + R.Top := GetRowBottom(I) + RecordsViewInfo.CardIndent; + R.Bottom := R.Top + Width; + Items[I] := R; + end; +end; + +{ TcxGridCardViewViewInfo } + +function TcxGridCardViewViewInfo.GetController: TcxGridCardViewController; +begin + Result := TcxGridCardViewController(inherited Controller); +end; + +function TcxGridCardViewViewInfo.GetGridView: TcxGridCardView; +begin + Result := TcxGridCardView(inherited GridView); +end; + +function TcxGridCardViewViewInfo.GetRecordsViewInfo: TcxGridCardsViewInfo; +begin + Result := TcxGridCardsViewInfo(inherited RecordsViewInfo); +end; + +function TcxGridCardViewViewInfo.GetViewData: TcxGridCardViewViewData; +begin + Result := TcxGridCardViewViewData(inherited ViewData); +end; + +procedure TcxGridCardViewViewInfo.CreateViewInfos; +begin + inherited; + FSeparatorsViewInfo := GetSeparatorsViewInfoClass.Create(Self); +end; + +procedure TcxGridCardViewViewInfo.DestroyViewInfos(AIsRecreating: Boolean); +begin + FreeAndNil(FSeparatorsViewInfo); + inherited; +end; + +procedure TcxGridCardViewViewInfo.AfterCalculating; +begin + if Visible and (RecordsViewInfo.CardHeight <> FPrevCardHeight) then + Controller.PostGridModeBufferCountUpdate; + inherited; +end; + +procedure TcxGridCardViewViewInfo.BeforeCalculating; +begin + inherited; + if Visible then + FPrevCardHeight := RecordsViewInfo.CardHeight; +end; + +procedure TcxGridCardViewViewInfo.Calculate; +begin + RecreateViewInfos; + FilterViewInfo.MainCalculate; + inherited; + SeparatorsViewInfo.Calculate; +end; + +procedure TcxGridCardViewViewInfo.CalculateHeight(const AMaxSize: TPoint; + var AHeight: Integer; var AFullyVisible: Boolean); +begin + MainCalculate(Classes.Bounds( + cxGridInvisibleCoordinate, 0, AMaxSize.X, AMaxSize.Y)); + AFullyVisible := Controller.IsDataFullyVisible; + AHeight := RecordsViewInfo.CalculateHeight(AFullyVisible); + Inc(AHeight, GetNonRecordsAreaHeight(False)); + inherited; +end; + +procedure TcxGridCardViewViewInfo.CalculateWidth(const AMaxSize: TPoint; var AWidth: Integer); +begin +// AWidth := AMaxSize.X; + //MainCalculate(Bounds(cxGridInvisibleCoordinate, 0, AMaxSize.X, AMaxSize.Y)); it is supposed that calculation was called from GetHeight + AWidth := RecordsViewInfo.CalculateWidth(AMaxSize.X); + inherited; +end; + +function TcxGridCardViewViewInfo.DoGetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + Result := SeparatorsViewInfo.GetHitTest(P); + if Result = nil then + Result := inherited DoGetHitTest(P); +end; + +function TcxGridCardViewViewInfo.GetDefaultGridModeBufferCount: Integer; +begin + if (RecordsViewInfo.CardWidth = 0) or (RecordsViewInfo.CardHeight = 0) then + begin + Controller.PostGridModeBufferCountUpdate; + Result := 0; + end + else + Result := RoundDiv(Screen.Width, RecordsViewInfo.ColumnWidth) * + RoundDiv(Screen.Height, RecordsViewInfo.RowHeight) + 2; +end; + +function TcxGridCardViewViewInfo.GetScrollableAreaBoundsForEdit: TRect; +begin + Result := inherited GetScrollableAreaBoundsForEdit; + IntersectRect(Result, Result, Controller.FocusedCardViewInfo.ScrollableAreaBounds); +end; + +function TcxGridCardViewViewInfo.GetRecordsViewInfoClass: TcxCustomGridRecordsViewInfoClass; +begin + case GridView.LayoutDirection of + ldHorizontal: + Result := TcxGridCardsHorizontalViewInfo; + ldVertical: + Result := TcxGridCardsVerticalViewInfo; + else + Result := nil; + end; +end; + +function TcxGridCardViewViewInfo.GetSeparatorsViewInfoClass: TcxGridCardViewSeparatorsViewInfoClass; +begin + case GridView.LayoutDirection of + ldHorizontal: + Result := TcxGridCardViewSeparatorsHorizontalViewInfo; + ldVertical: + Result := TcxGridCardViewSeparatorsVerticalViewInfo; + else + Result := nil; + end; +end; + +function TcxGridCardViewViewInfo.CanOffsetView(ARecordCountDelta: Integer): Boolean; +begin + Result := False; +end; + +{ TcxGridCardViewInfoCacheItem } + +procedure TcxGridCardViewInfoCacheItem.SetTopRowIndex(Value: Integer); +begin + FTopRowIndex := Value; + FIsTopRowIndexAssigned := True; +end; + +procedure TcxGridCardViewInfoCacheItem.UnassignValues(AKeepMaster: Boolean); +begin + inherited; + FIsTopRowIndexAssigned := False; +end; + +{ TcxGridCardViewRowOptions } + +constructor TcxGridCardViewRowOptions.Create(AItem: TcxCustomGridTableItem); +begin + inherited; + FExpanding := True; + FShowData := True; +end; + +procedure TcxGridCardViewRowOptions.SetExpanding(Value: Boolean); +begin + if FExpanding <> Value then + begin + FExpanding := Value; + Changed(ticSize); + end; +end; + +procedure TcxGridCardViewRowOptions.SetShowData(Value: Boolean); +begin + if FShowData <> Value then + begin + if not Value then + ShowCaption := True; + FShowData := Value; + Changed(ticSize); + end; +end; + +procedure TcxGridCardViewRowOptions.BeforeShowCaptionChange; +begin + inherited; + if ShowCaption then ShowData := True; +end; + +procedure TcxGridCardViewRowOptions.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridCardViewRowOptions then + with TcxGridCardViewRowOptions(Source) do + begin + Self.Expanding := Expanding; + Self.ShowData := ShowData; + end; +end; + +{ TcxGridCardViewRowPosition } + +constructor TcxGridCardViewRowPosition.Create(AItem: TcxCustomGridTableItem); +begin + inherited; + FLineCount := 1; +end; + +function TcxGridCardViewRowPosition.GetBeginsLayer: Boolean; +begin + Result := GridView.RowLayoutController.BeginsLayer[Item]; +end; + +function TcxGridCardViewRowPosition.GetColIndex: Integer; +begin + Result := GridView.RowLayoutController.GetCoordinates(Item).ColIndex; +end; + +function TcxGridCardViewRowPosition.GetGridView: TcxGridCardView; +begin + Result := TcxGridCardView(inherited GridView); +end; + +function TcxGridCardViewRowPosition.GetIndexInLayer: Integer; +begin + Result := GridView.RowLayoutController.GetPosition(Item).IndexInLayer; +end; + +function TcxGridCardViewRowPosition.GetItem: TcxGridCardViewRow; +begin + Result := TcxGridCardViewRow(inherited Item); +end; + +function TcxGridCardViewRowPosition.GetLayerIndex: Integer; +begin + Result := GridView.RowLayoutController.GetPosition(Item).LayerIndex; +end; + +function TcxGridCardViewRowPosition.GetLayerVisibleIndex: Integer; +begin + Result := GridView.RowLayoutController.GetVisiblePosition(Item).LayerIndex; +end; + +function TcxGridCardViewRowPosition.GetRowIndex: Integer; +begin + Result := GridView.RowLayoutController.GetCoordinates(Item).RowIndex; +end; + +function TcxGridCardViewRowPosition.GetVisibleColIndex: Integer; +begin + Result := GridView.RowLayoutController.GetVisibleCoordinates(Item).ColIndex; +end; + +function TcxGridCardViewRowPosition.GetVisibleIndexInLayer: Integer; +begin + Result := GridView.RowLayoutController.GetVisiblePosition(Item).IndexInLayer; +end; + +function TcxGridCardViewRowPosition.GetVisibleRowIndex: Integer; +begin + Result := GridView.RowLayoutController.GetVisibleCoordinates(Item).RowIndex; +end; + +procedure TcxGridCardViewRowPosition.SetBeginsLayer(Value: Boolean); +begin + if GridView.IsUpdating or GridView.IsRestoring then + FBeginsLayer := Value + else + GridView.RowLayoutController.BeginsLayer[Item] := Value; +end; + +procedure TcxGridCardViewRowPosition.SetColIndex(Value: Integer); +begin + GridView.RowLayoutController.SetCoordinates(Item, Value, -1); +end; + +procedure TcxGridCardViewRowPosition.SetIndexInLayer(Value: Integer); +begin + GridView.RowLayoutController.SetPosition(Item, -1, Value); +end; + +procedure TcxGridCardViewRowPosition.SetLayerIndex(Value: Integer); +begin + GridView.RowLayoutController.SetPosition(Item, Value, -1); +end; + +procedure TcxGridCardViewRowPosition.SetLineCount(Value: Integer); +begin + if Value < 1 then Value := 1; + if FLineCount <> Value then + begin + FLineCount := Value; + Changed(ticSize); + end; +end; + +procedure TcxGridCardViewRowPosition.SetRowIndex(Value: Integer); +begin + GridView.RowLayoutController.SetCoordinates(Item, -1, Value); +end; + +procedure TcxGridCardViewRowPosition.SetWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FWidth <> Value then + begin + FWidth := Value; + Changed(ticSize); + end; +end; + +procedure TcxGridCardViewRowPosition.AssignParams; +begin + BeginsLayer := FBeginsLayer; +end; + +procedure TcxGridCardViewRowPosition.SaveParams; +begin + FBeginsLayer := BeginsLayer; +end; + +procedure TcxGridCardViewRowPosition.Assign(Source: TPersistent); +begin + inherited; + with TcxGridCardViewRowPosition(Source) do + begin + Self.BeginsLayer := BeginsLayer; + {Self.IndexInLayer := IndexInLayer; + Self.LayerIndex := LayerIndex;} + Self.LineCount := LineCount; + Self.Width := Width; + end; +end; + +function TcxGridCardViewRowPosition.IsWholeLine: Boolean; +begin + Result := GridView.RowLayoutController.IsWholeLine(Item); +end; + +{ TcxGridCardViewRowStyles } + +constructor TcxGridCardViewRowStyles.Create(AOwner: TPersistent); +begin + inherited; + BitmapInViewParams := True; +end; + +function TcxGridCardViewRowStyles.GetGridViewValue: TcxGridCardView; +begin + Result := TcxGridCardView(inherited GridView); +end; + +function TcxGridCardViewRowStyles.GetItem: TcxGridCardViewRow; +begin + Result := TcxGridCardViewRow(inherited Item); +end; + +procedure TcxGridCardViewRowStyles.SetOnGetCaptionRowStyle(Value: TcxGridGetCellStyleEvent); +begin + if @FOnGetCaptionRowStyle <> @Value then + begin + FOnGetCaptionRowStyle := Value; + Item.Changed(ticProperty); + end; +end; + +procedure TcxGridCardViewRowStyles.SetOnGetCaptionStyle(Value: TcxGridGetCellStyleEvent); +begin + if @FOnGetCaptionStyle <> @Value then + begin + FOnGetCaptionStyle := Value; + Item.Changed(ticProperty); + end; +end; + +procedure TcxGridCardViewRowStyles.SetOnGetCategoryRowStyle(Value: TcxGridGetCellStyleEvent); +begin + if @FOnGetCategoryRowStyle <> @Value then + begin + FOnGetCategoryRowStyle := Value; + Item.Changed(ticProperty); + end; +end; + +procedure TcxGridCardViewRowStyles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +begin + case Index of + isCaptionRow: + GridView.Styles.GetCaptionRowParams(TcxCustomGridRecord(AData), Item, AParams); + isCategoryRow: + GridView.Styles.GetCategoryRowParams(TcxCustomGridRecord(AData), Item, AParams); + isRowCaption: + GridView.Styles.GetRowCaptionParams(TcxCustomGridRecord(AData), Item, AParams); + else + inherited; + end; +end; + +procedure TcxGridCardViewRowStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridCardViewRowStyles then + with TcxGridCardViewRowStyles(Source) do + begin + Self.Caption := Caption; + Self.CaptionRow := CaptionRow; + Self.CategoryRow := CategoryRow; + Self.OnGetCaptionRowStyle := OnGetCaptionRowStyle; + Self.OnGetCaptionStyle := OnGetCaptionStyle; + Self.OnGetCategoryRowStyle := OnGetCategoryRowStyle; + end; +end; + +procedure TcxGridCardViewRowStyles.GetCaptionParams(ARecord: TcxCustomGridRecord; + out AParams: TcxViewParams); +var + AStyle: TcxStyle; +begin + AStyle := nil; + if (ARecord <> nil) and Assigned(FOnGetCaptionStyle) then + FOnGetCaptionStyle(GridView, ARecord, Item, AStyle); + GetViewParams(isRowCaption, ARecord, AStyle, AParams); +end; + +procedure TcxGridCardViewRowStyles.GetCaptionRowParams(ARecord: TcxCustomGridRecord; + out AParams: TcxViewParams); +var + AStyle: TcxStyle; +begin + AStyle := nil; + if (ARecord <> nil) and Assigned(FOnGetCaptionRowStyle) then + FOnGetCaptionRowStyle(GridView, ARecord, Item, AStyle); + GetViewParams(isCaptionRow, ARecord, AStyle, AParams); +end; + +procedure TcxGridCardViewRowStyles.GetCategoryRowParams(ARecord: TcxCustomGridRecord; + out AParams: TcxViewParams); +var + AStyle: TcxStyle; +begin + AStyle := nil; + if (ARecord <> nil) and Assigned(FOnGetCategoryRowStyle) then + FOnGetCategoryRowStyle(GridView, ARecord, Item, AStyle); + GetViewParams(isCategoryRow, ARecord, AStyle, AParams); +end; + +{ TcxGridCardViewRow } + +constructor TcxGridCardViewRow.Create(AOwner: TComponent); +begin + inherited; + FCategoryItems := TList.Create; +end; + +destructor TcxGridCardViewRow.Destroy; +begin + FCategoryItems.Free; + inherited; +end; + +function TcxGridCardViewRow.GetCaptionAlignmentHorz: TAlignment; +begin + Result := HeaderAlignmentHorz; +end; + +function TcxGridCardViewRow.GetCaptionAlignmentVert: TcxAlignmentVert; +begin + Result := HeaderAlignmentVert; +end; + +function TcxGridCardViewRow.GetCategoryItem(AIndex: Integer): TcxGridCardViewRow; +begin + Result := TcxGridCardViewRow(FCategoryItems[AIndex]); +end; + +function TcxGridCardViewRow.GetCategoryItemCount: Integer; +begin + Result := FCategoryItems.Count; +end; + +function TcxGridCardViewRow.GetExpanded: Boolean; +begin + Result := HasExpandableItems and FExpanded; +end; + +function TcxGridCardViewRow.GetGridView: TcxGridCardView; +begin + Result := TcxGridCardView(inherited GridView); +end; + +function TcxGridCardViewRow.GetOptions: TcxGridCardViewRowOptions; +begin + Result := TcxGridCardViewRowOptions(inherited Options); +end; + +function TcxGridCardViewRow.GetStyles: TcxGridCardViewRowStyles; +begin + Result := TcxGridCardViewRowStyles(inherited Styles); +end; + +procedure TcxGridCardViewRow.SetCaptionAlignmentHorz(Value: TAlignment); +begin + HeaderAlignmentHorz := Value; +end; + +procedure TcxGridCardViewRow.SetCaptionAlignmentVert(Value: TcxAlignmentVert); +begin + HeaderAlignmentVert := Value; +end; + +procedure TcxGridCardViewRow.SetCategoryRow(Value: TcxGridCardViewRow); +begin + if (FKind <> rkCategory) and (CategoryRow <> Value) then + if Value = nil then + Index := GridView.FirstCategoryRow.Index + else + if Value.Kind = rkCategory then + Index := Value.Index + Value.CategoryItemCount + 1 - Ord(Index < Value.Index); +end; + +procedure TcxGridCardViewRow.SetCategoryRowValue(Value: TcxGridCardViewRow); +begin + FCategoryRow := Value; + FCategoryItems.Clear; + if FCategoryRow <> nil then + FCategoryRow.FCategoryItems.Add(Self); +end; + +procedure TcxGridCardViewRow.SetExpanded(Value: Boolean); +begin + if (Expanded <> Value) and (IsLoading or HasExpandableItems) then + begin + if not GridView.RowExpandedChanging(Self, Value) then Exit; + GridView.BeginUpdate; + try + GridView.SaveItemVisibles; + FExpanded := Value; + Changed(ticLayout); + GridView.CheckItemVisibles; + finally + GridView.EndUpdate; + end; + GridView.RowExpandedChanged(Self); + end; +end; + +procedure TcxGridCardViewRow.SetKind(Value: TcxGridCardViewRowKind); +begin + if FKind <> Value then + begin + GridView.BeginUpdate; + try + GridView.SaveItemVisibles; + FKind := Value; + GridView.RefreshCategoryRowLinks; + if Visible then + begin + if not CanFocus(nil) then Focused := False; + Changed(ticSize); + end + else + Changed(ticProperty); + GridView.CheckItemVisibles; + finally + GridView.EndUpdate; + end; + end; +end; + +procedure TcxGridCardViewRow.SetOptions(Value: TcxGridCardViewRowOptions); +begin + inherited Options := Value; +end; + +procedure TcxGridCardViewRow.SetPosition(Value: TcxGridCardViewRowPosition); +begin + FPosition.Assign(Value); +end; + +procedure TcxGridCardViewRow.SetStyles(Value: TcxGridCardViewRowStyles); +begin + inherited Styles := Value; +end; + +function TcxGridCardViewRow.IsCaptionAlignmentHorzStored: Boolean; +begin + Result := IsHeaderAlignmentHorzStored; +end; + +function TcxGridCardViewRow.IsCaptionAlignmentVertStored: Boolean; +begin + Result := IsHeaderAlignmentVertStored; +end; + +function TcxGridCardViewRow.GetStoredProperties(AProperties: TStrings): Boolean; +begin + AProperties.Add('BeginsLayer'); + if Expandable then + AProperties.Add('Expanded'); + Result := inherited GetStoredProperties(AProperties); +end; + +procedure TcxGridCardViewRow.GetPropertyValue(const AName: string; var AValue: Variant); +begin + if AName = 'BeginsLayer' then + AValue := Position.BeginsLayer + else + if AName = 'Expanded' then + AValue := Expanded + else + inherited; +end; + +procedure TcxGridCardViewRow.SetPropertyValue(const AName: string; const AValue: Variant); +begin + if AName = 'BeginsLayer' then + Position.BeginsLayer := AValue + else + if AName = 'Expanded' then + Expanded := AValue + else + inherited; +end; + +procedure TcxGridCardViewRow.CreateSubClasses; +begin + inherited; + FPosition := GetPositionClass.Create(Self); +end; + +procedure TcxGridCardViewRow.DestroySubClasses; +begin + FreeAndNil(FPosition); + inherited; +end; + +function TcxGridCardViewRow.GetOptionsClass: TcxCustomGridTableItemOptionsClass; +begin + Result := TcxGridCardViewRowOptions; +end; + +function TcxGridCardViewRow.GetPositionClass: TcxGridCardViewRowPositionClass; +begin + Result := TcxGridCardViewRowPosition; +end; + +function TcxGridCardViewRow.GetStylesClass: TcxCustomGridTableItemStylesClass; +begin + Result := TcxGridCardViewRowStyles; +end; + +function TcxGridCardViewRow.CanEdit: Boolean; +begin + Result := inherited CanEdit and Options.ShowData; +end; + +function TcxGridCardViewRow.CanExpand: Boolean; +begin + Result := Expandable and GridView.OptionsCustomize.RowExpanding and Options.Expanding; +end; + +function TcxGridCardViewRow.CanFilter(AVisually: Boolean): Boolean; +begin + Result := inherited CanFilter(AVisually); + if Result and AVisually then + Result := Options.ShowData; +end; + +function TcxGridCardViewRow.CanFocus(ARecord: TcxCustomGridRecord): Boolean; +begin + Result := inherited CanFocus(ARecord) and (FKind <> rkCaption) and + ((ARecord = nil) or IsVisibleInCard(TcxGridCard(ARecord))); +end; + +function TcxGridCardViewRow.DefaultAlternateCaption: string; +begin + Result := inherited DefaultAlternateCaption; + if GridView.OptionsView.CategoryRowCaptionInRowAlternateCaption and (CategoryRow <> nil) then + Result := CategoryRow.GetAlternateCaption + cxGridCardViewAlternateCaptionSeparator + Result; +end; + +function TcxGridCardViewRow.DefaultWidth: Integer; +begin + Result := DataBinding.DefaultWidth(False); +end; + +function TcxGridCardViewRow.GetActuallyVisible: Boolean; +begin + Result := inherited GetActuallyVisible; + if Result and (CategoryRow <> nil) then + Result := CategoryRow.ActuallyVisible and CategoryRow.Expanded; +end; + +function TcxGridCardViewRow.GetExpandable: Boolean; +begin + Result := FKind = rkCategory; +end; + +procedure TcxGridCardViewRow.GetItems(ARows: TList; AIncludeSubItems: Boolean); +begin + if AIncludeSubItems and (FKind = rkCategory) then + CopyList(CategoryItemsList, ARows) + else + ARows.Clear; + ARows.Insert(0, Self); +end; + +function TcxGridCardViewRow.GetVisibleCaption: string; +begin + Result := inherited GetVisibleCaption; + if Options.ShowData and (GridView.OptionsView.CaptionSeparator <> #0) then + Result := Result + GridView.OptionsView.CaptionSeparator; +end; + +function TcxGridCardViewRow.HasExpandableItems: Boolean; +begin + Result := Expandable and (CategoryItemCount <> 0); +end; + +procedure TcxGridCardViewRow.Assign(Source: TPersistent); +begin + if Source is TcxGridCardViewRow then + with TcxGridCardViewRow(Source) do + begin + Self.Expanded := Expanded; + Self.Kind := Kind; + Self.Position := Position; + end; + inherited; +end; + +function TcxGridCardViewRow.HasCardExpandButton: Boolean; +begin + Result := GridView.OptionsCustomize.CardExpanding and + (FKind = rkCaption) and (GridView.FirstCaptionRow = Self); +end; + +function TcxGridCardViewRow.HasExpandButton: Boolean; +begin + Result := CanExpand; +end; + +function TcxGridCardViewRow.IsVisibleInCard(ACard: TcxGridCard): Boolean; +begin + Result := ActuallyVisible; + if Result and (FKind <> rkCaption) then + Result := ACard.Expanded and + ((FKind <> rkData) or GridView.OptionsView.EmptyRows or + ACard.IsEditing or not VarIsNull(ACard.Values[Index])); +end; + +procedure TcxGridCardViewRow.MoveTo(AIndex: Integer; AMoveSubItems: Boolean); +var + ARows: TList; +begin + if AMoveSubItems then + begin + ARows := TList.Create; + try + GetItems(ARows, True); + GridView.RowLayoutController.LayoutObject.MoveRows(ARows, AIndex); + finally + ARows.Free; + end; + end + else + Index := AIndex; +end; + +{ TcxGridCardViewBackgroundBitmaps } + +function TcxGridCardViewBackgroundBitmaps.GetBitmapStyleIndex(Index: Integer): Integer; +begin + case Index of + bbCaptionRow: + Result := vsCaptionRow; + bbCardBorder: + Result := vsCardBorder; + bbRowCaption: + Result := vsRowCaption; + else + Result := inherited GetBitmapStyleIndex(Index); + end; +end; + +procedure TcxGridCardViewBackgroundBitmaps.Assign(Source: TPersistent); +begin + if Source is TcxGridCardViewBackgroundBitmaps then + with TcxGridCardViewBackgroundBitmaps(Source) do + begin + Self.CaptionRow := CaptionRow; + Self.CardBorder := CardBorder; + Self.RowCaption := RowCaption; + end; + inherited; +end; + +function TcxGridCardViewBackgroundBitmaps.GetBitmap(Index: Integer): TBitmap; +begin + Result := inherited GetBitmap(Index); + if Result = nil then + case Index of + bbRowCaption: + Result := GetBitmap(bbContent); + end; +end; + +{ TcxGridCardViewFiltering } + +function TcxGridCardViewFiltering.GetRowFilteredItemsList: Boolean; +begin + Result := ItemFilteredItemsList; +end; + +function TcxGridCardViewFiltering.GetRowMRUItemsList: Boolean; +begin + Result := ItemMRUItemsList; +end; + +function TcxGridCardViewFiltering.GetRowMRUItemsListCount: Integer; +begin + Result := ItemMRUItemsListCount; +end; + +function TcxGridCardViewFiltering.GetRowPopup: TcxGridItemFilterPopupOptions; +begin + Result := ItemPopup; +end; + +procedure TcxGridCardViewFiltering.SetRowFilteredItemsList(Value: Boolean); +begin + ItemFilteredItemsList := Value; +end; + +procedure TcxGridCardViewFiltering.SetRowMRUItemsList(Value: Boolean); +begin + ItemMRUItemsList := Value; +end; + +procedure TcxGridCardViewFiltering.SetRowMRUItemsListCount(Value: Integer); +begin + ItemMRUItemsListCount := Value; +end; + +procedure TcxGridCardViewFiltering.SetRowPopup(Value: TcxGridItemFilterPopupOptions); +begin + ItemPopup := Value; +end; + +procedure TcxGridCardViewFiltering.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('RowPopupDropDownWidth', ReadItemPopupDropDownWidth, nil, True); + Filer.DefineProperty('RowPopupMaxDropDownItemCount', ReadItemPopupMaxDropDownCount, nil, True); +end; + +{ TcxGridCardViewOptionsBehavior } + +constructor TcxGridCardViewOptionsBehavior.Create(AGridView: TcxCustomGridView); +begin + inherited; + FExpandRowOnDblClick := True; + FocusCellOnCycle := True; + FRowCaptionHints := True; +end; + +procedure TcxGridCardViewOptionsBehavior.SetExpandRowOnDblClick(Value: Boolean); +begin + if FExpandRowOnDblClick <> Value then + begin + FExpandRowOnDblClick := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridCardViewOptionsBehavior.SetRowCaptionHints(Value: Boolean); +begin + if FRowCaptionHints <> Value then + begin + FRowCaptionHints := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridCardViewOptionsBehavior.Assign(Source: TPersistent); +begin + if Source is TcxGridCardViewOptionsBehavior then + with TcxGridCardViewOptionsBehavior(Source) do + begin + Self.ExpandRowOnDblClick := ExpandRowOnDblClick; + Self.RowCaptionHints := RowCaptionHints; + end; + inherited; +end; + +{ TcxGridCardViewOptionsCustomize } + +constructor TcxGridCardViewOptionsCustomize.Create(AGridView: TcxCustomGridView); +begin + inherited; + RowMoving := False; + FCardSizing := True; + FRowExpanding := True; +end; + +function TcxGridCardViewOptionsCustomize.GetGridView: TcxGridCardView; +begin + Result := TcxGridCardView(inherited GridView); +end; + +function TcxGridCardViewOptionsCustomize.GetRowFiltering: Boolean; +begin + Result := ItemFiltering; +end; + +function TcxGridCardViewOptionsCustomize.GetRowHiding: Boolean; +begin + Result := ItemHiding; +end; + +function TcxGridCardViewOptionsCustomize.GetRowMoving: Boolean; +begin + Result := ItemMoving; +end; + +procedure TcxGridCardViewOptionsCustomize.SetCardExpanding(Value: Boolean); +begin + if FCardExpanding <> Value then + begin + if Value then + GridView.Controller.FocusedItem := nil; + FCardExpanding := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridCardViewOptionsCustomize.SetCardSizing(Value: Boolean); +begin + if FCardSizing <> Value then + begin + FCardSizing := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridCardViewOptionsCustomize.SetLayeredRows(Value: Boolean); +begin + if FLayeredRows <> Value then + begin + FLayeredRows := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridCardViewOptionsCustomize.SetRowExpanding(Value: Boolean); +begin + if FRowExpanding <> Value then + begin + FRowExpanding := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridCardViewOptionsCustomize.SetRowFiltering(Value: Boolean); +begin + ItemFiltering := Value; +end; + +procedure TcxGridCardViewOptionsCustomize.SetRowHiding(Value: Boolean); +begin + ItemHiding := Value; +end; + +procedure TcxGridCardViewOptionsCustomize.SetRowMoving(Value: Boolean); +begin + ItemMoving := Value; +end; + +procedure TcxGridCardViewOptionsCustomize.Assign(Source: TPersistent); +begin + if Source is TcxGridCardViewOptionsCustomize then + with TcxGridCardViewOptionsCustomize(Source) do + begin + Self.CardExpanding := CardExpanding; + Self.CardSizing := CardSizing; + Self.LayeredRows := LayeredRows; + Self.RowExpanding := RowExpanding; + end; + inherited; +end; + +{ TcxGridCardViewOptionsSelection } + +constructor TcxGridCardViewOptionsSelection.Create(AGridView: TcxCustomGridView); +begin + inherited; + FCardBorderSelection := True; +end; + +procedure TcxGridCardViewOptionsSelection.SetCardBorderSelection(Value: Boolean); +begin + if FCardBorderSelection <> Value then + begin + FCardBorderSelection := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridCardViewOptionsSelection.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridCardViewOptionsSelection then + CardBorderSelection := TcxGridCardViewOptionsSelection(Source).CardBorderSelection; +end; + +{ TcxGridCardViewOptionsView } + +constructor TcxGridCardViewOptionsView.Create(AGridView: TcxCustomGridView); +begin + inherited; + FCardBorderWidth := cxGridDefaultCardBorderWidth; + FCardExpandButtonAlignment := cebaRight; + FCardIndent := cxGridCardDefaultIndent; + FCardWidth := cxGridCardDefaultWidth; + FCaptionSeparator := cxGridDefaultCardViewCaptionSeparator; + FCategoryIndent := cxGridCardDefaultCategoryIndent; + FCategorySeparatorWidth := cxGridCardDefaultCategorySeparatorWidth; + FEmptyRows := True; + FLayerSeparatorWidth := cxGridCardDefaultLayerSeparatorWidth; + FSeparatorColor := clDefault; + FSeparatorWidth := cxGridDefaultCardViewSeparatorWidth; +end; + +function TcxGridCardViewOptionsView.GetGridView: TcxGridCardView; +begin + Result := TcxGridCardView(inherited GridView); +end; + +function TcxGridCardViewOptionsView.GetRowCaptionAutoHeight: Boolean; +begin + Result := ItemCaptionAutoHeight; +end; + +function TcxGridCardViewOptionsView.GetRowCaptionEndEllipsis: Boolean; +begin + Result := ItemCaptionEndEllipsis; +end; + +function TcxGridCardViewOptionsView.GetShowRowFilterButtons: TcxGridShowItemFilterButtons; +begin + Result := ShowItemFilterButtons; +end; + +procedure TcxGridCardViewOptionsView.SetCaptionSeparator(Value: Char); +begin + if FCaptionSeparator <> Value then + begin + FCaptionSeparator := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridCardViewOptionsView.SetCaptionWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FCaptionWidth <> Value then + begin + FCaptionWidth := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridCardViewOptionsView.SetCardAutoWidth(Value: Boolean); +begin + if FCardAutoWidth <> Value then + begin + FCardAutoWidth := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridCardViewOptionsView.SetCardBorderWidth(Value: Integer); +begin + if Value < cxGridCardBorderMinWidth then Value := cxGridCardBorderMinWidth; + if FCardBorderWidth <> Value then + begin + FCardBorderWidth := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridCardViewOptionsView.SetCardExpandButtonAlignment(Value: TcxGridCardExpandButtonAlignment); +begin + if FCardExpandButtonAlignment <> Value then + begin + FCardExpandButtonAlignment := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridCardViewOptionsView.SetCardIndent(Value: Integer); +begin + if Value < 0 then Value := 0; + if FCardIndent <> Value then + begin + FCardIndent := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridCardViewOptionsView.SetCardWidth(Value: Integer); +begin + if Value < cxGridCardMinWidth then Value := cxGridCardMinWidth; + if FCardWidth <> Value then + begin + FCardWidth := Value; + Changed(vcSize); + TcxGridCardView(GridView).Controller.PostGridModeBufferCountUpdate; + end; +end; + +procedure TcxGridCardViewOptionsView.SetCategoryIndent(Value: Integer); +begin + if Value < 0 then Value := 0; + if FCategoryIndent <> Value then + begin + FCategoryIndent := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridCardViewOptionsView.SetCategoryRowCaptionInRowAlternateCaption(Value: Boolean); +begin + if FCategoryRowCaptionInRowAlternateCaption <> Value then + begin + FCategoryRowCaptionInRowAlternateCaption := Value; + GridView.ItemCaptionChanged(nil); + end; +end; + +procedure TcxGridCardViewOptionsView.SetCategorySeparatorWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FCategorySeparatorWidth <> Value then + begin + FCategorySeparatorWidth := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridCardViewOptionsView.SetEmptyRows(Value: Boolean); +begin + if FEmptyRows <> Value then + begin + if not Value then + GridView.Controller.FocusedItem := nil; + FEmptyRows := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridCardViewOptionsView.SetLayerSeparatorWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FLayerSeparatorWidth <> Value then + begin + FLayerSeparatorWidth := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridCardViewOptionsView.SetRowCaptionAutoHeight(Value: Boolean); +begin + ItemCaptionAutoHeight := Value; +end; + +procedure TcxGridCardViewOptionsView.SetRowCaptionEndEllipsis(Value: Boolean); +begin + ItemCaptionEndEllipsis := Value; +end; + +procedure TcxGridCardViewOptionsView.SetSeparatorColor(Value: TColor); +begin + if FSeparatorColor <> Value then + begin + FSeparatorColor := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridCardViewOptionsView.SetSeparatorWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FSeparatorWidth <> Value then + begin + FSeparatorWidth := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridCardViewOptionsView.SetShowRowFilterButtons(Value: TcxGridShowItemFilterButtons); +begin + ShowItemFilterButtons := Value; +end; + +procedure TcxGridCardViewOptionsView.Assign(Source: TPersistent); +begin + if Source is TcxGridCardViewOptionsView then + with TcxGridCardViewOptionsView(Source) do + begin + Self.CaptionSeparator := CaptionSeparator; + Self.CaptionWidth := CaptionWidth; + Self.CardAutoWidth := CardAutoWidth; + Self.CardBorderWidth := CardBorderWidth; + Self.CardExpandButtonAlignment := CardExpandButtonAlignment; + Self.CardIndent := CardIndent; + Self.CardWidth := CardWidth; + Self.CategoryIndent := CategoryIndent; + Self.CategoryRowCaptionInRowAlternateCaption := CategoryRowCaptionInRowAlternateCaption; + Self.CategorySeparatorWidth := CategorySeparatorWidth; + Self.EmptyRows := EmptyRows; + Self.LayerSeparatorWidth := LayerSeparatorWidth; + Self.SeparatorColor := SeparatorColor; + Self.SeparatorWidth := SeparatorWidth; + end; + inherited; +end; + +function TcxGridCardViewOptionsView.GetSeparatorColor: TColor; +begin + Result := FSeparatorColor; + if Result = clDefault then + Result := LookAndFeelPainter.DefaultSeparatorColor; +end; + +{ TcxGridCardViewStyles } + +constructor TcxGridCardViewStyles.Create(AOwner: TPersistent); +begin + inherited; + BitmapInViewParams := True; +end; + +function TcxGridCardViewStyles.GetGridViewValue: TcxGridCardView; +begin + Result := TcxGridCardView(inherited GridView); +end; + +procedure TcxGridCardViewStyles.SetOnGetCaptionRowStyle(Value: TcxGridGetCellStyleEvent); +begin + if @FOnGetCaptionRowStyle <> @Value then + begin + FOnGetCaptionRowStyle := Value; + GridView.Changed(vcProperty); + end; +end; + +procedure TcxGridCardViewStyles.SetOnGetCardBorderStyle(Value: TcxGridGetRecordStyleEvent); +begin + if @FOnGetCardBorderStyle <> @Value then + begin + FOnGetCardBorderStyle := Value; + GridView.Changed(vcProperty); + end; +end; + +procedure TcxGridCardViewStyles.SetOnGetCategoryRowStyle(Value: TcxGridGetCellStyleEvent); +begin + if @FOnGetCategoryRowStyle <> @Value then + begin + FOnGetCategoryRowStyle := Value; + GridView.Changed(vcProperty); + end; +end; + +procedure TcxGridCardViewStyles.SetOnGetRowCaptionStyle(Value: TcxGridGetCellStyleEvent); +begin + if @FOnGetRowCaptionStyle <> @Value then + begin + FOnGetRowCaptionStyle := Value; + GridView.Changed(vcProperty); + end; +end; + +function TcxGridCardViewStyles.GetBackgroundBitmapIndex(Index: Integer): Integer; +begin + case Index of + vsCardBorder: + Result := bbCardBorder; + vsContent: + Result := bbContent; + vsCaptionRow: + Result := bbCaptionRow; + vsRowCaption: + Result := bbRowCaption; + else + Result := -1; + end; +end; + +function TcxGridCardViewStyles.GetDefaultBitmap(Index: Integer): TBitmap; +begin + Index := GetBackgroundBitmapIndex(Index); + if Index = -1 then + Result := nil + else + Result := GridView.BackgroundBitmaps.GetBitmap(Index); +end; + +procedure TcxGridCardViewStyles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +begin + if Index = vsCardBorder then + GetRecordContentParams(TcxCustomGridRecord(AData), nil, AParams) + else + begin + inherited; + with AParams, LookAndFeelPainter do + case Index of + vsCaptionRow, vsCategoryRow, vsRowCaption: + begin + if AData <> nil then + with TcxGridDataCellPos(AData) do + Item.Styles.GetContentParams(GridRecord, AParams); + case Index of + vsCaptionRow: + begin + Color := DefaultHeaderColor; + TextColor := DefaultHeaderTextColor; + end; + vsCategoryRow: + begin + Color := DefaultGroupColor; + TextColor := DefaultGroupTextColor; + end; + end; + end; + vsCategorySeparator: + Color := DefaultRecordSeparatorColor; + vsLayerSeparator: + Color := DefaultSeparatorColor; + end; + end; + AParams.Bitmap := GetDefaultBitmap(Index); +end; + +procedure TcxGridCardViewStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridCardViewStyles then + with TcxGridCardViewStyles(Source) do + begin + Self.CaptionRow := CaptionRow; + Self.CardBorder := CardBorder; + Self.CategoryRow := CategoryRow; + Self.CategorySeparator := CategorySeparator; + Self.LayerSeparator := LayerSeparator; + Self.RowCaption := RowCaption; + Self.OnGetCaptionRowStyle := OnGetCaptionRowStyle; + Self.OnGetCardBorderStyle := OnGetCardBorderStyle; + Self.OnGetCategoryRowStyle := OnGetCategoryRowStyle; + Self.OnGetRowCaptionStyle := OnGetRowCaptionStyle; + end; +end; + +procedure TcxGridCardViewStyles.GetCaptionRowParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +var + AStyle: TcxStyle; + ADataCellPos: TcxGridDataCellPos; +begin + AStyle := nil; + if (ARecord <> nil) and Assigned(FOnGetCaptionRowStyle) then + FOnGetCaptionRowStyle(GridView, ARecord, AItem, AStyle); + ADataCellPos := TcxGridDataCellPos.Create(ARecord, AItem); + try + GetViewParams(vsCaptionRow, ADataCellPos, AStyle, AParams); + finally + ADataCellPos.Free; + end; +end; + +procedure TcxGridCardViewStyles.GetCardBorderParams(ARecord: TcxCustomGridRecord; + out AParams: TcxViewParams); +var + AStyle: TcxStyle; +begin + AStyle := nil; + if (ARecord <> nil) and Assigned(FOnGetCardBorderStyle) then + FOnGetCardBorderStyle(GridView, ARecord, AStyle); + GetViewParams(vsCardBorder, ARecord, AStyle, AParams); +end; + +procedure TcxGridCardViewStyles.GetCardBorderVisualParams(ARecord: TcxCustomGridRecord; + out AParams: TcxViewParams); +begin + if GridView.OptionsSelection.CardBorderSelection and + GridView.DrawCardBorderSelected(ARecord) then + GetSelectionParams(ARecord, nil, AParams) + else + GetCardBorderParams(ARecord, AParams); +end; + +procedure TcxGridCardViewStyles.GetCategoryRowParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +var + AStyle: TcxStyle; + ADataCellPos: TcxGridDataCellPos; +begin + AStyle := nil; + if (ARecord <> nil) and Assigned(FOnGetCategoryRowStyle) then + FOnGetCategoryRowStyle(GridView, ARecord, AItem, AStyle); + ADataCellPos := TcxGridDataCellPos.Create(ARecord, AItem); + try + GetViewParams(vsCategoryRow, ADataCellPos, AStyle, AParams); + finally + ADataCellPos.Free; + end; +end; + +procedure TcxGridCardViewStyles.GetDataCellContentParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +begin + if AItem = nil then + inherited + else + case TcxGridCardViewRow(AItem).Kind of + rkData: + TcxGridCardViewRow(AItem).Styles.GetCaptionParams(ARecord, AParams); + rkCaption: + TcxGridCardViewRow(AItem).Styles.GetCaptionRowParams(ARecord, AParams); + rkCategory: + TcxGridCardViewRow(AItem).Styles.GetCategoryRowParams(ARecord, AParams); + end; +end; + +procedure TcxGridCardViewStyles.GetRowCaptionParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +var + AStyle: TcxStyle; + ADataCellPos: TcxGridDataCellPos; +begin + AStyle := nil; + if (ARecord <> nil) and Assigned(FOnGetRowCaptionStyle) then + FOnGetRowCaptionStyle(GridView, ARecord, AItem, AStyle); + ADataCellPos := TcxGridDataCellPos.Create(ARecord, AItem); + try + GetViewParams(vsRowCaption, ADataCellPos, AStyle, AParams); + finally + ADataCellPos.Free; + end; +end; + +{ TcxGridCardViewStyleSheet } + +function TcxGridCardViewStyleSheet.GetStylesValue: TcxGridCardViewStyles; +begin + Result := TcxGridCardViewStyles(GetStyles); +end; + +procedure TcxGridCardViewStyleSheet.SetStylesValue(Value: TcxGridCardViewStyles); +begin + SetStyles(Value); +end; + +class function TcxGridCardViewStyleSheet.GetStylesClass: TcxCustomStylesClass; +begin + Result := TcxGridCardViewStyles; +end; + +{ TcxGridCardView } + +function TcxGridCardView.GetBackgroundBitmaps: TcxGridCardViewBackgroundBitmaps; +begin + Result := TcxGridCardViewBackgroundBitmaps(inherited BackgroundBitmaps); +end; + +function TcxGridCardView.GetControl: TcxCustomGrid; +begin + Result := TcxCustomGrid(inherited Control); +end; + +function TcxGridCardView.GetController: TcxGridCardViewController; +begin + Result := TcxGridCardViewController(inherited Controller); +end; + +function TcxGridCardView.GetDataController: TcxGridDataController; +begin + Result := TcxGridDataController(FDataController); +end; + +function TcxGridCardView.GetDateTimeHandling: TcxGridCardViewDateTimeHandling; +begin + Result := TcxGridCardViewDateTimeHandling(inherited DateTimeHandling); +end; + +function TcxGridCardView.GetFiltering: TcxGridCardViewFiltering; +begin + Result := TcxGridCardViewFiltering(inherited Filtering); +end; + +function TcxGridCardView.GetFirstCaptionRow: TcxGridCardViewRow; +var + I: Integer; +begin + for I := 0 to VisibleRowCount - 1 do + begin + Result := VisibleRows[I]; + if Result.Kind = rkCaption then Exit; + end; + Result := nil; +end; + +function TcxGridCardView.GetFirstCategoryRow: TcxGridCardViewRow; +var + I: Integer; +begin + for I := 0 to RowCount - 1 do + begin + Result := Rows[I]; + if Result.Kind = rkCategory then Exit; + end; + Result := nil; +end; + +function TcxGridCardView.GetOptionsBehavior: TcxGridCardViewOptionsBehavior; +begin + Result := TcxGridCardViewOptionsBehavior(inherited OptionsBehavior); +end; + +function TcxGridCardView.GetOptionsCustomize: TcxGridCardViewOptionsCustomize; +begin + Result := TcxGridCardViewOptionsCustomize(inherited OptionsCustomize); +end; + +function TcxGridCardView.GetOptionsData: TcxGridCardViewOptionsData; +begin + Result := TcxGridCardViewOptionsData(inherited OptionsData); +end; + +function TcxGridCardView.GetOptionsSelection: TcxGridCardViewOptionsSelection; +begin + Result := TcxGridCardViewOptionsSelection(inherited OptionsSelection); +end; + +function TcxGridCardView.GetOptionsView: TcxGridCardViewOptionsView; +begin + Result := TcxGridCardViewOptionsView(inherited OptionsView); +end; + +function TcxGridCardView.GetPainter: TcxGridCardViewPainter; +begin + Result := TcxGridCardViewPainter(inherited Painter); +end; + +function TcxGridCardView.GetRow(Index: Integer): TcxGridCardViewRow; +begin + Result := TcxGridCardViewRow(Items[Index]); +end; + +function TcxGridCardView.GetRowCount: Integer; +begin + Result := ItemCount; +end; + +function TcxGridCardView.GetStyles: TcxGridCardViewStyles; +begin + Result := TcxGridCardViewStyles(inherited Styles); +end; + +function TcxGridCardView.GetViewData: TcxGridCardViewViewData; +begin + Result := TcxGridCardViewViewData(inherited ViewData); +end; + +function TcxGridCardView.GetViewInfo: TcxGridCardViewViewInfo; +begin + Result := TcxGridCardViewViewInfo(inherited ViewInfo); +end; + +function TcxGridCardView.GetVisibleRow(Index: Integer): TcxGridCardViewRow; +begin + Result := TcxGridCardViewRow(VisibleItems[Index]); +end; + +function TcxGridCardView.GetVisibleRowCount: Integer; +begin + Result := VisibleItemCount; +end; + +procedure TcxGridCardView.SetBackgroundBitmaps(Value: TcxGridCardViewBackgroundBitmaps); +begin + inherited BackgroundBitmaps := Value; +end; + +procedure TcxGridCardView.SetDataController(Value: TcxGridDataController); +begin + FDataController.Assign(Value); +end; + +procedure TcxGridCardView.SetDateTimeHandling(Value: TcxGridCardViewDateTimeHandling); +begin + inherited DateTimeHandling := Value; +end; + +procedure TcxGridCardView.SetFiltering(Value: TcxGridCardViewFiltering); +begin + inherited Filtering := Value; +end; + +procedure TcxGridCardView.SetLayoutDirection(Value: TcxGridCardViewLayoutDirection); +begin + if FLayoutDirection <> Value then + begin + FLayoutDirection := Value; + Controller.LayoutDirectionChanged; + Changed(vcSize); + end; +end; + +procedure TcxGridCardView.SetOnRowCollapsed(Value: TcxGridCardRowEvent); +begin + if @FOnRowCollapsed <> @Value then + begin + FOnRowCollapsed := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridCardView.SetOnRowCollapsing(Value: TcxGridCardRowChangingEvent); +begin + if @FOnRowCollapsing <> @Value then + begin + FOnRowCollapsing := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridCardView.SetOnRowExpanded(Value: TcxGridCardRowEvent); +begin + if @FOnRowExpanded <> @Value then + begin + FOnRowExpanded := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridCardView.SetOnRowExpanding(Value: TcxGridCardRowChangingEvent); +begin + if @FOnRowExpanding <> @Value then + begin + FOnRowExpanding := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridCardView.SetOnRowPosChanged(Value: TcxGridCardRowEvent); +begin + if @FOnRowPosChanged <> @Value then + begin + FOnRowPosChanged := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridCardView.SetOptionsBehavior(Value: TcxGridCardViewOptionsBehavior); +begin + inherited OptionsBehavior := Value; +end; + +procedure TcxGridCardView.SetOptionsCustomize(Value: TcxGridCardViewOptionsCustomize); +begin + inherited OptionsCustomize := Value; +end; + +procedure TcxGridCardView.SetOptionsData(Value: TcxGridCardViewOptionsData); +begin + inherited OptionsData := Value; +end; + +procedure TcxGridCardView.SetOptionsSelection(Value: TcxGridCardViewOptionsSelection); +begin + inherited OptionsSelection := Value; +end; + +procedure TcxGridCardView.SetOptionsView(Value: TcxGridCardViewOptionsView); +begin + inherited OptionsView := Value; +end; + +procedure TcxGridCardView.SetRow(Index: Integer; Value: TcxGridCardViewRow); +begin + Items[Index] := Value; +end; + +procedure TcxGridCardView.SetRowLayout(Value: TcxGridCardViewRowLayout); +var + ACoordinates: TcxGridCardRowCoordinatesArray; +begin +{$IFNDEF DELPHI7} + ACoordinates := nil; // to remove wrong warning +{$ENDIF} + if FRowLayout <> Value then + begin + ACoordinates := GetRowCoordinates; + FRowLayout := Value; + SetRowCoordinates(ACoordinates); + end; +end; + +procedure TcxGridCardView.SetStyles(Value: TcxGridCardViewStyles); +begin + inherited Styles := Value; +end; + +procedure TcxGridCardView.RefreshCategoryRowLinks; +var + ACategoryRow, ARow: TcxGridCardViewRow; + I: Integer; +begin + ACategoryRow := nil; + for I := 0 to RowCount - 1 do + begin + ARow := Rows[I]; + if ARow.Kind = rkCategory then + begin + ACategoryRow := ARow; + ARow.SetCategoryRowValue(nil); + end + else + ARow.SetCategoryRowValue(ACategoryRow); + end; +end; + +function TcxGridCardView.GetProperties(AProperties: TStrings): Boolean; +begin + AProperties.Add('CardWidth'); + Result := inherited GetProperties(AProperties); +end; + +procedure TcxGridCardView.GetPropertyValue(const AName: string; var AValue: Variant); +begin + if AName = 'CardWidth' then + AValue := OptionsView.CardWidth + else + inherited; +end; + +procedure TcxGridCardView.SetPropertyValue(const AName: string; const AValue: Variant); +begin + if AName = 'CardWidth' then + OptionsView.CardWidth := AValue + else + inherited; +end; + +procedure TcxGridCardView.AssignLayout(ALayoutView: TcxCustomGridView); +begin + inherited; + OptionsView.CardWidth := (ALayoutView as TcxGridCardView).OptionsView.CardWidth; +end; + +function TcxGridCardView.GetLayoutCustomizationFormButtonCaption: string; +begin + Result := 'Rows customization'; +end; + +procedure TcxGridCardView.CreateHandlers; +begin + FRowLayoutController := GetRowLayoutControllerClass.Create(Self); + inherited; +end; + +procedure TcxGridCardView.DestroyHandlers; +begin + inherited; + FreeAndNil(FRowLayoutController); +end; + +function TcxGridCardView.GetControllerClass: TcxCustomGridControllerClass; +begin + Result := TcxGridCardViewController; +end; + +function TcxGridCardView.GetDataControllerClass: TcxCustomDataControllerClass; +begin + Result := TcxGridDataController; +end; + +function TcxGridCardView.GetPainterClass: TcxCustomGridPainterClass; +begin + Result := TcxGridCardViewPainter; +end; + +function TcxGridCardView.GetRowLayoutControllerClass: TcxGridCardViewRowLayoutControllerClass; +begin + Result := TcxGridCardViewRowLayoutController; +end; + +function TcxGridCardView.GetViewDataClass: TcxCustomGridViewDataClass; +begin + Result := TcxGridCardViewViewData; +end; + +function TcxGridCardView.GetViewInfoClass: TcxCustomGridViewInfoClass; +begin + Result := TcxGridCardViewViewInfo; +end; + +procedure TcxGridCardView.SaveRowParams; +var + I: Integer; +begin + for I := 0 to RowCount - 1 do + Rows[I].Position.SaveParams; +end; + +procedure TcxGridCardView.AssignRowParams; +var + I: Integer; +begin + BeginUpdate; + try + for I := 0 to RowCount - 1 do + Rows[I].Position.AssignParams; + finally + EndUpdate; + end; +end; + +function TcxGridCardView.GetRowCoordinates: TcxGridCardRowCoordinatesArray; +var + I: Integer; +begin + SetLength(Result, RowCount); + for I := 0 to RowCount - 1 do + Result[I] := RowLayoutController.GetCoordinates(Rows[I]); +end; + +procedure TcxGridCardView.SetRowCoordinates(const ACoordinates: TcxGridCardRowCoordinatesArray); +var + ARows: TList; + I: Integer; +begin + ARows := TList.Create; + BeginUpdate; + try + CopyList(ItemsList, ARows); + for I := 0 to ARows.Count - 1 do + RowLayoutController.SetCoordinates(TcxGridCardViewRow(ARows[I]), ACoordinates[I]); + finally + EndUpdate; + ARows.Free; + end; +end; + +procedure TcxGridCardView.Updating; +begin + SaveRowParams; + inherited; +end; + +procedure TcxGridCardView.Updated; +begin + inherited; + AssignRowParams; +end; + +procedure TcxGridCardView.BeforeRestoring; +begin + SaveRowParams; + inherited; +end; + +procedure TcxGridCardView.AfterRestoring; +begin + inherited; + AssignRowParams; +end; + +procedure TcxGridCardView.ChangeItemIndex(AItem: TcxCustomGridTableItem; + Value: Integer); +begin + SaveItemVisibles; + inherited; + CheckItemVisibles; +end; + +procedure TcxGridCardView.DoAssign(ASource: TcxCustomGridView); +begin + if ASource is TcxGridCardView then + with TcxGridCardView(ASource) do + begin + Self.LayoutDirection := LayoutDirection; + Self.RowLayout := RowLayout; + Self.OnRowExpanded := OnRowExpanded; + Self.OnRowExpanding := OnRowExpanding; + Self.OnRowCollapsed := OnRowCollapsed; + Self.OnRowCollapsing := OnRowCollapsing; + Self.OnRowPosChanged := OnRowPosChanged; + end; + inherited; +end; + +function TcxGridCardView.GetResizeOnBoundsChange: Boolean; +begin + Result := True; +end; + +procedure TcxGridCardView.ItemIndexChanged(AItem: TcxCustomGridTableItem; + AOldIndex: Integer); +begin + inherited; + RefreshCategoryRowLinks; + RowLayoutController.RowIndexChanged(TcxGridCardViewRow(AItem), AOldIndex); +end; + +procedure TcxGridCardView.ItemVisibilityChanged(AItem: TcxCustomGridTableItem; + Value: Boolean); +begin + if not Value and AItem.Focused and (TcxGridCardViewRow(AItem).CategoryRow <> nil) then + TcxGridCardViewRow(AItem).CategoryRow.Focused := True; + inherited; +end; + +procedure TcxGridCardView.RefreshVisibleItemsList; +begin + inherited; + RowLayoutController.VisibleRowsListChanged; +end; + +procedure TcxGridCardView.RowExpandedChanged(ARow: TcxGridCardViewRow); +begin + Controller.RowExpandedChanged(ARow); + if ARow.Expanded then + DoRowExpanded(ARow) + else + DoRowCollapsed(ARow); +end; + +function TcxGridCardView.RowExpandedChanging(ARow: TcxGridCardViewRow; AValue: Boolean): Boolean; +begin + if AValue then + Result := DoRowExpanding(ARow) + else + Result := DoRowCollapsing(ARow); + if Result then + Controller.RowExpandedChanging(ARow, AValue); +end; + +function TcxGridCardView.CalculateDataCellSelected(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; AUseViewInfo: Boolean; ACellViewInfo: TcxGridTableCellViewInfo): Boolean; +begin + if TcxGridCardViewRow(AItem).Kind = rkCaption then + Result := inherited CalculateDataCellSelected(ARecord, AItem, AUseViewInfo, ACellViewInfo) + else + Result := DrawRecordFocused(ARecord) and AItem.Focused; +end; + +function TcxGridCardView.DrawCardBorderSelected(ARecord: TcxCustomGridRecord): Boolean; +begin + Result := DrawRecordSelected(ARecord) and DrawSelection; +end; + +function TcxGridCardView.GetBackgroundBitmapsClass: TcxCustomGridBackgroundBitmapsClass; +begin + Result := TcxGridCardViewBackgroundBitmaps; +end; + +function TcxGridCardView.GetDateTimeHandlingClass: TcxCustomGridTableDateTimeHandlingClass; +begin + Result := TcxGridCardViewDateTimeHandling; +end; + +function TcxGridCardView.GetFilteringClass: TcxCustomGridTableFilteringClass; +begin + Result := TcxGridCardViewFiltering; +end; + +function TcxGridCardView.GetItemClass: TcxCustomGridTableItemClass; +begin + Result := TcxGridCardViewRow; +end; + +function TcxGridCardView.GetOptionsBehaviorClass: TcxCustomGridOptionsBehaviorClass; +begin + Result := TcxGridCardViewOptionsBehavior; +end; + +function TcxGridCardView.GetOptionsCustomizeClass: TcxCustomGridTableOptionsCustomizeClass; +begin + Result := TcxGridCardViewOptionsCustomize; +end; + +function TcxGridCardView.GetOptionsDataClass: TcxCustomGridOptionsDataClass; +begin + Result := TcxGridCardViewOptionsData; +end; + +function TcxGridCardView.GetOptionsSelectionClass: TcxCustomGridOptionsSelectionClass; +begin + Result := TcxGridCardViewOptionsSelection; +end; + +function TcxGridCardView.GetOptionsViewClass: TcxCustomGridOptionsViewClass; +begin + Result := TcxGridCardViewOptionsView; +end; + +function TcxGridCardView.GetStylesClass: TcxCustomGridViewStylesClass; +begin + Result := TcxGridCardViewStyles; +end; + +function TcxGridCardView.SupportsCardSizing: Boolean; +begin + Result := OptionsCustomize.CardSizing; +end; + +function TcxGridCardView.SupportsLayeredRows: Boolean; +begin + Result := IsDesigning or OptionsCustomize.LayeredRows; +end; + +procedure TcxGridCardView.DoRowCollapsed(ARow: TcxGridCardViewRow); +begin + if Assigned(FOnRowCollapsed) then FOnRowCollapsed(Self, ARow); +end; + +function TcxGridCardView.DoRowCollapsing(ARow: TcxGridCardViewRow): Boolean; +begin + Result := True; + if Assigned(FOnRowCollapsing) then FOnRowCollapsing(Self, ARow, Result); +end; + +procedure TcxGridCardView.DoRowExpanded(ARow: TcxGridCardViewRow); +begin + if Assigned(FOnRowExpanded) then FOnRowExpanded(Self, ARow); +end; + +function TcxGridCardView.DoRowExpanding(ARow: TcxGridCardViewRow): Boolean; +begin + Result := True; + if Assigned(FOnRowExpanding) then FOnRowExpanding(Self, ARow, Result); +end; + +procedure TcxGridCardView.DoRowPositionChanged(ARow: TcxGridCardViewRow); +begin + if Assigned(FOnRowPosChanged) then FOnRowPosChanged(Self, ARow); +end; + +function TcxGridCardView.CreateRow: TcxGridCardViewRow; +begin + Result := TcxGridCardViewRow(CreateItem); +end; + +initialization + cxGridRegisteredViews.Register(TcxGridCardView, 'Cards'); + Classes.RegisterClasses([TcxGridCardViewRow, TcxGridCardViewStyleSheet]); + +finalization + cxGridRegisteredViews.Unregister(TcxGridCardView); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridChartView.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridChartView.pas new file mode 100644 index 00000000..519eb67e --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridChartView.pas @@ -0,0 +1,16803 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridChartView; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Messages, Classes, Graphics, Controls, Forms, Menus, StdCtrls, + cxClasses, cxGraphics, cxLookAndFeels, cxLookAndFeelPainters, cxStyles, cxControls, cxStorage, + cxEdit, cxCheckBox, cxCheckListBox, cxDropDownEdit, cxLabel, cxPC, + cxVariants, cxCustomData, cxData, cxDataStorage, + cxGridCommon, cxGridCustomView; + +const + cxGridChartCustomizationFormDefaultWidth = 200; + + htChartBase = 50; + htChartTitle = htChartBase + 1; + htLegend = htChartBase + 2; + htLegendItem = htChartBase + 3; + htChartToolBox = htChartBase + 4; + htDataLevelInfo = htChartBase + 5; + htDataLevelActiveValueInfo = htChartBase + 6; + htChartCustomizeButton = htChartBase + 7; + htDiagramSelector = htChartBase + 8; + htChartValue = htChartBase + 9; + // histogram + htPlot = htChartBase + 10; + htCategoryAxisTitle = htChartBase + 11; + htValueAxisTitle = htChartBase + 12; + // line diagram + htChartValueLine = htChartBase + 13; + // area diagram + htChartValueArea = htChartBase + 14; + // pie diagram + htSeriesSite = htChartBase + 15; + htSeriesSiteCaption = htChartBase + 16; + + ckToolBox = 2; + + dsDiagramFirst = 0; + dsLegend = dsDiagramFirst; + dsValueCaptions = dsDiagramFirst + 1; + dsValues = dsDiagramFirst + 2; + dsAxis = dsDiagramFirst + 3; + dsCategoryAxis = dsDiagramFirst + 4; + dsValueAxis = dsDiagramFirst + 5; + dsAxisTitle = dsDiagramFirst + 6; + dsCategoryAxisTitle = dsDiagramFirst + 7; + dsValueAxisTitle = dsDiagramFirst + 8; + dsGridLines = dsDiagramFirst + 9; + dsCategoryGridLines = dsDiagramFirst + 10; + dsValueGridLines = dsDiagramFirst + 11; + dsPlot = dsDiagramFirst + 12; + dsValueMarkers = dsDiagramFirst + 13; + dsSeriesSiteCaptions = dsDiagramFirst + 14; + dsSeriesSites = dsDiagramFirst + 15; + dsDiagramLast = dsSeriesSites; + + ssSeriesFirst = 0; + ssValues = ssSeriesFirst; + ssSeriesLast = ssValues; + + vsChartFirst = vsCustomLast + 1; + vsTitle = vsChartFirst; + vsLegend = vsChartFirst + 1; + vsToolBox = vsChartFirst + 2; + vsDiagramSelector = vsChartFirst + 3; + vsDataLevelsInfo = vsChartFirst + 4; + vsDataLevelActiveValueInfo = vsChartFirst + 5; + vsActiveDataLevelInfo = vsChartFirst + 6; + vsChartLast = vsActiveDataLevelInfo; + + cxGridChartColumnDiagramDefaultBorderWidth = 1; + cxGridChartLineDiagramDefaultHotSpotSize = 15; + cxGridChartLineDiagramDefaultLineWidth = 1; + cxGridChartLineDiagramDefaultMarkerSize = 7; + cxGridChartDefaultDataLevelActiveValueDropDownCount = 15; + + cxGridChartItemDefaultSummaryKind = skSum; + +type + TcxGridChartCustomizationForm = class; + TcxGridChartController = class; + TcxCustomGridChartTitleViewInfo = class; + TcxGridChartLegendItemViewInfo = class; + TcxGridChartLegendViewInfo = class; + TcxGridChartDiagramValueViewInfo = class; + TcxGridChartDiagramViewInfo = class; + TcxGridChartHistogramTickMarkLabelsViewInfo = class; + TcxGridChartHistogramViewInfo = class; + TcxGridChartColumnDiagramViewInfo = class; + TcxGridChartLineDiagramLegendItemViewInfo = class; + TcxGridChartLineDiagramValueViewInfoClass = class of TcxGridChartLineDiagramValueViewInfo; + TcxGridChartLineDiagramValueViewInfo = class; + TcxGridChartLineDiagramViewInfo = class; + TcxGridChartAreaDiagramValueViewInfo = class; + TcxGridChartPieDiagramValueViewInfo = class; + TcxGridChartPieSeriesSiteViewInfo = class; + TcxGridChartPieDiagramViewInfo = class; + TcxGridChartToolBoxItemViewInfo = class; + TcxGridChartToolBoxDataLevelActiveValueViewInfo = class; + TcxGridChartToolBoxDataLevelInfoViewInfo = class; + TcxGridChartToolBoxCustomizeButtonViewInfo = class; + TcxGridChartToolBoxDiagramSelectorViewInfo = class; + TcxGridChartToolBoxViewInfo = class; + TcxGridChartViewInfo = class; + TcxCustomGridChartTitle = class; + TcxGridChartDiagram = class; + TcxGridChartHistogramAxisTitle = class; + TcxGridChartHistogramAxis = class; + TcxGridChartHistogramAxisValue = class; + TcxGridChartHistogram = class; + TcxGridChartColumnDiagram = class; + TcxGridChartLineDiagram = class; + TcxGridChartAreaDiagram = class; + TcxGridChartPieDiagram = class; + TcxGridChartItemDataBinding = class; + TcxGridChartItemClass = class of TcxGridChartItem; + TcxGridChartItem = class; + TcxGridChartDataGroup = class; + TcxGridChartSeries = class; + TcxGridChartView = class; + + TcxGridChartDataGroupContainerKind = Integer; + + TcxGridChartPartAlignment = (cpaDefault, cpaStart, cpaCenter, cpaEnd); + TcxGridChartPartOrientation = (cpoDefault, cpoHorizontal, cpoVertical); + TcxGridChartPartPosition = (cppDefault, cppNone, cppLeft, cppTop, cppRight, cppBottom); + + TcxGridChartColumnDiagramValueCaptionPosition = (cdvcpNone, cdvcpInsideBase, + cdvcpCenter, cdvcpInsideEnd, cdvcpOutsideEnd); + + TcxGridChartLineDiagramValueCaptionPosition = (ldvcpNone, ldvcpLeft, ldvcpAbove, + ldvcpRight, ldvcpBelow, ldvcpCenter); + TcxGridChartLineStyle = (clsNone, clsSolid, clsDash, clsDot, clsDashDot, clsDashDotDot); + TcxGridChartMarkerStyle = (cmsNone, cmsSquare, cmsTriangle, cmsDiamond, cmsCircle); + + TcxGridChartPieDiagramValueCaptionPosition = (pdvcpNone, pdvcpCenter, + pdvcpInsideEnd, pdvcpOutsideEnd, pdvcpOutsideEndWithLeaderLines); + + { hit tests } + + TcxGridChartTitleHitTest = class(TcxCustomGridViewHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + TcxGridChartLegendHitTest = class(TcxCustomGridViewHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + TcxGridChartLegendItemHitTest = class(TcxCustomGridViewHitTest) + protected + class function GetHitTestCode: Integer; override; + public + Index: Integer; + Series: TcxGridChartSeries; + ValueIndex: Integer; + end; + + TcxGridChartToolBoxHitTest = class(TcxCustomGridViewHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + TcxGridChartDataLevelInfoHitTest = class(TcxCustomGridViewHitTest) + private + FDataLevel: Integer; + FDataLevelObject: TcxGridChartDataGroup; + procedure SetDataLevel(Value: Integer); + procedure SetDataLevelObject(Value: TcxGridChartDataGroup); + protected + class function GetHitTestCode: Integer; override; + public + DataLevelObjectContainerKind: TcxGridChartDataGroupContainerKind; + function DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; override; + property DataLevel: Integer read FDataLevel write SetDataLevel; + property DataLevelObject: TcxGridChartDataGroup read FDataLevelObject write SetDataLevelObject; + end; + + TcxGridChartDataLevelActiveValueInfoHitTest = class(TcxGridChartDataLevelInfoHitTest) + protected + class function GetHitTestCode: Integer; override; + public + CanDropDown: Boolean; + function Cursor: TCursor; override; + function DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; override; + end; + + TcxGridChartCustomizeButtonHitTest = class(TcxCustomGridViewHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + TcxGridChartDiagramSelectorHitTest = class(TcxCustomGridViewHitTest) + protected + class function GetHitTestCode: Integer; override; + public + CanDropDown: Boolean; + function Cursor: TCursor; override; + end; + + TcxGridChartValueHitTest = class(TcxCustomGridViewHitTest) + protected + class function GetHitTestCode: Integer; override; + public + CanDrillDown: Boolean; + Series: TcxGridChartSeries; + ValueIndex: Integer; + function Cursor: TCursor; override; + end; + + TcxCustomGridChartDiagramHitTest = class(TcxCustomGridViewHitTest) + public + Diagram: TcxGridChartDiagram; + end; + + // histogram + + TcxGridChartHistogramPlotHitTest = class(TcxCustomGridChartDiagramHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + TcxCustomGridChartHistogramAxisHitTest = class(TcxCustomGridChartDiagramHitTest); + + TcxGridChartHistogramCategoryAxisTitleHitTest = class(TcxCustomGridChartHistogramAxisHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + TcxGridChartHistogramValueAxisTitleHitTest = class(TcxCustomGridChartHistogramAxisHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + // line diagram + + TcxGridChartValueLineHitTest = class(TcxGridChartValueHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + // area diagram + + TcxGridChartValueAreaHitTest = class(TcxGridChartValueHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + // pie diagram + + TcxGridChartPieSeriesSiteHitTest = class(TcxCustomGridChartDiagramHitTest) + protected + class function GetHitTestCode: Integer; override; + public + Series: TcxGridChartSeries; + end; + + TcxGridChartPieSeriesSiteCaptionHitTest = class(TcxGridChartPieSeriesSiteHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + { controller } + + // drag&drop objects + + TcxCustomGridChartMovingObject = class(TcxCustomGridMovingObject) + private + function GetController: TcxGridChartController; + function GetCustomizationForm: TcxGridChartCustomizationForm; + function GetGridView: TcxGridChartView; + function GetViewInfo: TcxGridChartViewInfo; + protected + property Controller: TcxGridChartController read GetController; + property CustomizationForm: TcxGridChartCustomizationForm read GetCustomizationForm; + property GridView: TcxGridChartView read GetGridView; + property ViewInfo: TcxGridChartViewInfo read GetViewInfo; + end; + + TcxGridChartDataGroupMovingObjectClass = class of TcxGridChartDataGroupMovingObject; + + TcxGridChartDataGroupMovingObject = class(TcxCustomGridChartMovingObject) + private + FDestDataLevel: Integer; + FSourceItemContainerKind: TcxGridChartDataGroupContainerKind; + function GetSourceItem: TcxGridChartDataGroup; + procedure SetDestDataLevel(Value: Integer); + procedure SetSourceItem(Value: TcxGridChartDataGroup); + protected + function CanRemove: Boolean; override; + function GetArrowAreaBounds(APlace: TcxGridArrowPlace): TRect; override; + function GetCustomizationFormListBox: TcxCustomGridItemsListBox; override; + function GetSourceItemViewInfo: TcxCustomGridCellViewInfo; override; + function IsSourceCustomizationForm: Boolean; override; + function IsValidDestination: Boolean; override; + + procedure BeginDragAndDrop; override; + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); override; + procedure EndDragAndDrop(Accepted: Boolean); override; + + property DestDataLevel: Integer read FDestDataLevel write SetDestDataLevel; + property SourceItem: TcxGridChartDataGroup read GetSourceItem write SetSourceItem; + property SourceItemContainerKind: TcxGridChartDataGroupContainerKind + read FSourceItemContainerKind write FSourceItemContainerKind; + public + constructor Create(AControl: TcxControl); override; + procedure Init(const P: TPoint; AParams: TcxCustomGridHitTest); override; + end; + + // customization form + + TcxGridChartSeriesInnerCheckListBox = class(TcxCustomInnerCheckListBox) + protected + function GetMetrics: TcxCheckListBoxMetrics; override; + public + function GetSeriesImageSize: Integer; virtual; + end; + + TcxGridChartSeriesCheckListBoxClass = class of TcxGridChartSeriesCheckListBox; + + TcxGridChartSeriesCheckListBox = class(TcxCheckListBox) + private + FDraggingSeries: TcxGridChartSeries; + FGridView: TcxGridChartView; + FLockRefreshItems: Boolean; + FSeriesImages: TImageList; + function GetSeries(AIndex: Integer): TcxGridChartSeries; + protected + procedure CheckClicked(Sender: TObject; AIndex: Integer; + APrevState, ANewState: TcxCheckBoxState); virtual; + procedure CreateWnd; override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); override; + procedure DrawSeriesImage(ACanvas: TcxCanvas; const R: TRect; ASeries: TcxGridChartSeries); virtual; + function GetInnerCheckListBoxClass: TcxCustomInnerCheckListBoxClass; override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); override; + procedure RefreshImages; + procedure RefreshSeriesImages; virtual; + + property DraggingSeries: TcxGridChartSeries read FDraggingSeries write FDraggingSeries; + property GridView: TcxGridChartView read FGridView; + property LockRefreshItems: Boolean read FLockRefreshItems write FLockRefreshItems; + property Series[AIndex: Integer]: TcxGridChartSeries read GetSeries; + property SeriesImages: TImageList read FSeriesImages; + public + constructor Create(AOwner: TComponent; AGridView: TcxGridChartView); reintroduce; virtual; + destructor Destroy; override; + procedure RefreshItems; virtual; + function StartDrag(DragObject: TDragObject): Boolean; override; + end; + + TcxGridChartSortBySeriesComboBoxClass = class of TcxGridChartSortBySeriesComboBox; + + TcxGridChartSortBySeriesComboBox = class(TcxComboBox) + private + FDirectionButton: TcxEditButton; + FGridView: TcxGridChartView; + protected + procedure Click; override; + procedure DirectionButtonClick; virtual; + procedure DoButtonClick(AButtonVisibleIndex: Integer); override; + procedure DrawItem(AControl: TcxCustomComboBox; ACanvas: TcxCanvas; + AIndex: Integer; const ARect: TRect; AState: TOwnerDrawState); virtual; + procedure MeasureItem(AControl: TcxCustomComboBox; AIndex: Integer; + ACanvas: TcxCanvas; var AHeight: Integer); virtual; + procedure RefreshDirectionButton; virtual; + + property DirectionButton: TcxEditButton read FDirectionButton; + property GridView: TcxGridChartView read FGridView; + public + constructor Create(AOwner: TComponent; AGridView: TcxGridChartView); reintroduce; virtual; + procedure RefreshItems; virtual; + end; + + TcxGridChartDataGroupsListBoxClass = class of TcxGridChartDataGroupsListBox; + + TcxGridChartDataGroupsListBox = class(TcxCustomGridItemsListBox) + private + function GetGridView: TcxGridChartView; + protected + function CalculateItemHeight: Integer; override; + function GetDragAndDropParams: TcxCustomGridHitTest; override; + property GridView: TcxGridChartView read GetGridView; + public + procedure PaintItem(ACanvas: TcxCanvas; R: TRect; AIndex: Integer; AFocused: Boolean); override; + procedure RefreshItems; override; + end; + + TcxGridChartOptionsTreeViewClass = class of TcxGridChartOptionsTreeView; + + TcxGridChartOptionsTreeView = class(TcxGridOptionsTreeView) + private + FGridView: TcxGridChartView; + protected + LegendID: Integer; + LegendAlignmentID: Integer; + LegendBorderID: Integer; + LegendKeyBorderID: Integer; + LegendOrientationID: Integer; + LegendPositionID: Integer; + TitleID: Integer; + TitleAlignmentID: Integer; + TitlePositionID: Integer; + ToolBoxID: Integer; + ToolBoxBorderID: Integer; + ToolBoxDiagramSelectorID: Integer; + ToolBoxPositionID: Integer; + OtherID: Integer; + OtherValueHintsID: Integer; + + procedure AddItems; override; + function IsItemChecked(AParentID, AID: Integer): Boolean; override; + procedure ItemClicked(AParentID, AID: Integer); override; + + property GridView: TcxGridChartView read FGridView; + public + constructor Create(AOwner: TComponent; AGridView: TcxGridChartView); reintroduce; virtual; + end; + + TcxGridChartCustomizationForm = class(TcxCustomGridCustomizationForm) + private + FDataGroupsListBox: TcxGridChartDataGroupsListBox; + FDataGroupsPage: TcxTabSheet; + FOptionsPage: TcxTabSheet; + FOptionsTreeView: TcxGridChartOptionsTreeView; + FSeriesCheckListBox: TcxGridChartSeriesCheckListBox; + FSortBySeriesComboBox: TcxGridChartSortBySeriesComboBox; + FSortBySeriesLabel: TcxLabel; + FSeriesPage: TcxTabSheet; + function GetGridView: TcxGridChartView; + protected + function CanChangeSortedSeries: Boolean; virtual; + procedure CreateControls; override; + function GetDataGroupsListBoxClass: TcxGridChartDataGroupsListBoxClass; virtual; + function GetDataGroupsPageVisible: Boolean; virtual; + function GetOptionsPageVisible: Boolean; virtual; + function GetOptionsTreeViewClass: TcxGridChartOptionsTreeViewClass; virtual; + function GetSeriesCheckListBoxClass: TcxGridChartSeriesCheckListBoxClass; virtual; + function GetSeriesPageVisible: Boolean; virtual; + function GetSortBySeriesComboBoxClass: TcxGridChartSortBySeriesComboBoxClass; virtual; + procedure GridViewChanged; override; + procedure InitPageControl; override; + + property GridView: TcxGridChartView read GetGridView; + public + procedure PrepareForDataGroupDragAndDrop; virtual; + procedure RefreshData; override; + + property DataGroupsListBox: TcxGridChartDataGroupsListBox read FDataGroupsListBox; + property DataGroupsPage: TcxTabSheet read FDataGroupsPage; + property OptionsPage: TcxTabSheet read FOptionsPage; + property OptionsTreeView: TcxGridChartOptionsTreeView read FOptionsTreeView; + property SeriesCheckListBox: TcxGridChartSeriesCheckListBox read FSeriesCheckListBox; + property SeriesPage: TcxTabSheet read FSeriesPage; + property SortBySeriesComboBox: TcxGridChartSortBySeriesComboBox read FSortBySeriesComboBox; + property SortBySeriesLabel: TcxLabel read FSortBySeriesLabel; + end; + + // popups + + IcxGridChartDataLevelActiveValuePopupOwner = interface(IcxCustomGridPopupOwner) + ['{94AE5C9F-9A81-401D-8B76-E3278CDD0CEB}'] + function GetDataGroup: TcxGridChartDataGroup; + end; + + TcxGridChartDataLevelActiveValuePopupClass = class of TcxGridChartDataLevelActiveValuePopup; + + TcxGridChartDataLevelActiveValuePopup = class(TcxCustomGridPopup) + private + FDataGroup: TcxGridChartDataGroup; + FListBox: TcxGridPopupListBox; + function GetGridView: TcxGridChartView; + procedure ListBoxAction(Sender: TcxGridPopupListBox; AItemIndex: Integer); + protected + Values: TVariantArray; + procedure AddValueItems(AStrings: TStrings; out AValues: TVariantArray); virtual; + procedure AdjustListBoxSize; virtual; + procedure InitPopup; override; + procedure SetDataGroupActiveValue(AItemIndex: Integer); virtual; + property ListBox: TcxGridPopupListBox read FListBox; + public + constructor Create(AGridView: TcxCustomGridView); override; + property DataGroup: TcxGridChartDataGroup read FDataGroup; + property GridView: TcxGridChartView read GetGridView; + end; + + TcxGridChartDiagramSelectorPopupListBox = class(TcxGridPopupListBox) + protected + function CalculateItemHeight: Integer; override; + procedure DrawItemContent(ACanvas: TcxCanvas; AIndex: Integer; ARect: TRect; + AState: TOwnerDrawState); override; + end; + + TcxGridChartDiagramSelectorPopupClass = class of TcxGridChartDiagramSelectorPopup; + + TcxGridChartDiagramSelectorPopup = class(TcxCustomGridPopup) + private + FListBox: TcxGridChartDiagramSelectorPopupListBox; + function GetGridView: TcxGridChartView; + procedure ListBoxAction(Sender: TcxGridPopupListBox; AItemIndex: Integer); + protected + procedure AddDiagramItems(AStrings: TStrings); virtual; + function GetImageOffset: Integer; virtual; + procedure InitPopup; override; + procedure SelectDiagram(AItemIndex: Integer); virtual; + property ListBox: TcxGridChartDiagramSelectorPopupListBox read FListBox; + public + constructor Create(AGridView: TcxCustomGridView); override; + property GridView: TcxGridChartView read GetGridView; + property ImageOffset: Integer read GetImageOffset; + end; + + // controller + + TcxGridChartController = class(TcxCustomGridController) + private + FDataLevelActiveValuePopup: TcxGridChartDataLevelActiveValuePopup; + FDiagramSelectorPopup: TcxGridChartDiagramSelectorPopup; + FFirstVisibleCategoryIndex: Integer; + FFirstVisibleCategoryIndexes: array of Integer; + FMovingDataGroup: TcxGridChartDataGroup; + FStoredFirstVisibleCategoryIndex: Integer; + function GetCustomizationForm: TcxGridChartCustomizationForm; + function GetDataLevelActiveValuePopup: TcxGridChartDataLevelActiveValuePopup; + function GetDiagramSelectorPopup: TcxGridChartDiagramSelectorPopup; + function GetGridView: TcxGridChartView; + function GetIsDataGroupMoving: Boolean; + function GetViewInfo: TcxGridChartViewInfo; + function GetVisibleCategoryCountValue: Integer; + procedure SetFirstVisibleCategoryIndex(Value: Integer); + protected + procedure ActiveDataLevelChanged(APrevActiveDataLevel, AActiveDataLevel: Integer); virtual; + procedure ActiveDiagramChanged(ADiagram: TcxGridChartDiagram); virtual; + procedure CheckCoordinates; override; + procedure DataLevelsChanged; virtual; + procedure FirstVisibleCategoryIndexChanged; virtual; + function GetDataLevelActiveValuePopupClass: TcxGridChartDataLevelActiveValuePopupClass; virtual; + function GetDesignHitTest(AHitTest: TcxCustomGridHitTest): Boolean; override; + function GetDiagramSelectorPopupClass: TcxGridChartDiagramSelectorPopupClass; virtual; + function GetPatternObject(AObject: TPersistent): TPersistent; override; + + function GetFirstVisibleCategoryIndex: Integer; virtual; + function GetVisibleCategoryCount(ACheckCount: Boolean): Integer; virtual; + + function CanDataDrillDown(AValueIndex: Integer): Boolean; virtual; + function CanDataDrillUp: Boolean; virtual; + function DoDataDrillDown(AValueIndex: Integer): Boolean; virtual; + function DoDataDrillUp: Boolean; virtual; + function MayDataDrillDown(ACheckDesignTime: Boolean = True): Boolean; virtual; + + // scrollbar + function CanShowScrollBar: Boolean; virtual; + function GetScrollBarKind: TScrollBarKind; virtual; + function GetScrollBarPageSize: Integer; virtual; + function GetScrollBarPos: Integer; virtual; + function GetScrollBarSize: Integer; virtual; + function ScrollPosToCategoryIndex(AScrollPos: Integer): Integer; virtual; + + function CanShowDataLevelActiveValuePopup(ACheckDesignTime: Boolean = True): Boolean; virtual; + + // customization + procedure CustomizationChanged; override; + function GetCustomizationFormClass: TcxCustomGridCustomizationFormClass; override; + function GetCustomizationFormDefaultWidth: Integer; override; + function GetDataLevelInfoDragAndDropObjectClass: TcxGridChartDataGroupMovingObjectClass; virtual; + + property ViewInfo: TcxGridChartViewInfo read GetViewInfo; + public + constructor Create(AGridView: TcxCustomGridView); override; + destructor Destroy; override; + function HasDataLevelActiveValuePopup: Boolean; + function HasDiagramSelectorPopup: Boolean; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + + procedure InitScrollBarsParameters; override; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); override; + + function GetValueHintText(ASeries: TcxGridChartSeries; AValueIndex: Integer): string; virtual; + + // data drill down + function DataDrillDown(AValueIndex: Integer): Boolean; virtual; + function DataDrillUp: Boolean; virtual; + function IsDataDrillDownPossible(AValueIndex: Integer): Boolean; + + // paging + function ActiveDiagramSupportsPaging: Boolean; + property FirstVisibleCategoryIndex: Integer read GetFirstVisibleCategoryIndex write SetFirstVisibleCategoryIndex; + property VisibleCategoryCount: Integer read GetVisibleCategoryCountValue; + + property CustomizationForm: TcxGridChartCustomizationForm read GetCustomizationForm; + property DataLevelActiveValuePopup: TcxGridChartDataLevelActiveValuePopup read GetDataLevelActiveValuePopup; + property DiagramSelectorPopup: TcxGridChartDiagramSelectorPopup read GetDiagramSelectorPopup; + property GridView: TcxGridChartView read GetGridView; + property IsDataGroupMoving: Boolean read GetIsDataGroupMoving; + property MovingDataGroup: TcxGridChartDataGroup read FMovingDataGroup; + end; + + { datacontroller } + + {$HPPEMIT '__interface IcxGridChartItem;'} + + IcxGridChartItem = interface + ['{CDDAE712-6292-4814-A69E-7D871B299EB2}'] + procedure DataChanged; + function GetDataBinding: TcxGridChartItemDataBinding; + function GetID: Integer; + procedure ValueTypeClassChanged; + end; + + IcxGridChartViewItemsProvider = interface + ['{852B466D-5068-4600-BBC6-0061BF69A0B0}'] + function GetItem(AItemClass: TcxGridChartItemClass; AIndex: Integer): TcxGridChartItem; + procedure GetItemCaptions(AItemClass: TcxGridChartItemClass; ACaptions: TStringList); + procedure InitItem(AItem: TcxGridChartItem; AIndex: Integer); + end; + + TcxGridChartDataController = class(TcxDataController, IcxCustomGridDataController) + private + function GetGridViewValue: TcxGridChartView; + protected + { IcxCustomGridDataController } + procedure AssignData(ADataController: TcxCustomDataController); + procedure CreateAllItems(AMissingItemsOnly: Boolean); + procedure DeleteAllItems; + procedure GetFakeComponentLinks(AList: TList); + function GetGridView: TcxCustomGridView; + function HasAllItems: Boolean; + function IsDataChangeable: Boolean; + function IsDataLinked: Boolean; + function SupportsCreateAllItems: Boolean; + + procedure DoValueTypeClassChanged(AItemIndex: Integer); override; + //function GetChartViewItemIndex: Integer; override; + function GetItemID(AItem: TObject): Integer; override; + function GetSortingBySummaryEngineClass: TcxSortingBySummaryEngineClass; override; + procedure Unlocked; override; + public + procedure BeginFullUpdate; override; + procedure EndFullUpdate; override; + function GetItem(Index: Integer): TObject; override; + property GridView: TcxGridChartView read GetGridViewValue; + published + property Options; + property OnCompare; + property OnDataChanged; + property OnFilterRecord; + property OnRecordChanged; + end; + + { painter } + + // title + + TcxGridChartTitlePainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxCustomGridChartTitleViewInfo; + protected + procedure PrepareCanvasForDrawText; override; + procedure UnprepareCanvasForDrawText; override; + public + property ViewInfo: TcxCustomGridChartTitleViewInfo read GetViewInfo; + end; + + // legend + + TcxGridChartLegendItemPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridChartLegendItemViewInfo; + protected + procedure DrawContent; override; + procedure DrawLegendKey; virtual; + property ViewInfo: TcxGridChartLegendItemViewInfo read GetViewInfo; + end; + + TcxGridChartLegendPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridChartLegendViewInfo; + protected + procedure DrawContent; override; + function ExcludeFromClipRect: Boolean; override; + property ViewInfo: TcxGridChartLegendViewInfo read GetViewInfo; + end; + + // custom diagram + + TcxGridChartDiagramPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridChartDiagramViewInfo; + protected + procedure DrawValueCaptions; virtual; + procedure DrawValues; virtual; + procedure FillAndExcludeRect(const R: TRect); + function NeedsPainting: Boolean; override; + procedure Paint; override; + procedure PrepareClipRegionForValueDrawing(AValueViewInfo: TcxGridChartDiagramValueViewInfo; + AOriginalClipRegion: TcxRegion); virtual; + property ViewInfo: TcxGridChartDiagramViewInfo read GetViewInfo; + end; + + // histogram + + TcxGridChartHistogramTickMarkLabelsPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridChartHistogramTickMarkLabelsViewInfo; + protected + procedure DrawCaptions; virtual; + procedure DrawContent; override; + public + property ViewInfo: TcxGridChartHistogramTickMarkLabelsViewInfo read GetViewInfo; + end; + + TcxGridChartHistogramPainter = class(TcxGridChartDiagramPainter) + private + function GetViewInfo: TcxGridChartHistogramViewInfo; + protected + procedure DrawCategoryAxis; virtual; + procedure DrawCategoryGridLines; virtual; + procedure DrawContent; override; + procedure DrawPlotBackground; virtual; + procedure DrawValueAxis; virtual; + procedure DrawValueGridLines; virtual; + procedure DrawValuesBackground; virtual; + function GetTransparentValues: Boolean; virtual; abstract; + function GetValuesClipRect: TRect; virtual; + procedure SetValuesClipRegion; virtual; + + property TransparentValues: Boolean read GetTransparentValues; + property ViewInfo: TcxGridChartHistogramViewInfo read GetViewInfo; + end; + + // column diagram + + TcxGridChartColumnDiagramValuePainter = class(TcxCustomGridCellPainter) + protected + function ExcludeFromClipRect: Boolean; override; + end; + + TcxGridChartColumnDiagramPainter = class(TcxGridChartHistogramPainter) + protected + function GetTransparentValues: Boolean; override; + end; + + // line diagram + + TcxGridChartLineDiagramLegendItemPainter = class(TcxGridChartLegendItemPainter) + private + function GetViewInfo: TcxGridChartLineDiagramLegendItemViewInfo; + protected + procedure DrawLegendKey; override; + procedure DrawLine; virtual; + procedure DrawMarker; virtual; + property ViewInfo: TcxGridChartLineDiagramLegendItemViewInfo read GetViewInfo; + end; + + TcxGridChartLineDiagramValuePainterClass = class of TcxGridChartLineDiagramValuePainter; + + TcxGridChartLineDiagramValuePainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridChartLineDiagramValueViewInfo; + protected + function CanDrawDesignSelection: Boolean; override; + procedure DrawContent; override; + procedure DrawLine; virtual; + procedure DrawMarker; virtual; + property ViewInfo: TcxGridChartLineDiagramValueViewInfo read GetViewInfo; + public + class procedure DrawLineEx(ACanvas: TcxCanvas; const AStart, AFinish: TPoint; + AStyle: TcxGridChartLineStyle; AWidth: Integer; AColor: TColor); virtual; + class procedure DrawLines(ACanvas: TcxCanvas; const APoints: TPointArray; + AStyle: TcxGridChartLineStyle; AWidth: Integer; AColor: TColor); virtual; + class procedure DrawMarkerEx(ACanvas: TcxCanvas; const ABounds: TRect; + const APoints: TPointArray; AStyle: TcxGridChartMarkerStyle; + const AParams: TcxViewParams); virtual; + end; + + TcxGridChartLineDiagramPainter = class(TcxGridChartHistogramPainter) + protected + procedure DrawContent; override; + procedure DrawValuesDesignSelection; virtual; + function GetTransparentValues: Boolean; override; + end; + + // area diagram + + TcxGridChartAreaDiagramLegendItemPainter = class(TcxGridChartLineDiagramLegendItemPainter) + protected + procedure DrawAreaBackground; virtual; + procedure DrawAreaBorder; virtual; + procedure DrawLegendKey; override; + end; + + TcxGridChartAreaDiagramValuePainter = class(TcxGridChartLineDiagramValuePainter) + private + function GetViewInfo: TcxGridChartAreaDiagramValueViewInfo; + protected + procedure DoDrawArea; virtual; + procedure DrawArea; virtual; + property ViewInfo: TcxGridChartAreaDiagramValueViewInfo read GetViewInfo; + end; + + TcxGridChartAreaDiagramPainter = class(TcxGridChartLineDiagramPainter) + protected + procedure DrawValuesBackground; override; + end; + + // pie diagram + + TcxGridChartPieDiagramValuePainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridChartPieDiagramValueViewInfo; + protected + procedure DrawContent; override; + procedure DrawLeaderLine; virtual; + procedure DrawSlice; virtual; + property ViewInfo: TcxGridChartPieDiagramValueViewInfo read GetViewInfo; + public + procedure MainPaint; override; + end; + + TcxGridChartPieSeriesSiteCaptionPainter = class(TcxCustomGridCellPainter) + protected + function ExcludeFromClipRect: Boolean; override; + end; + + TcxGridChartPieSeriesSitePainter = class(TcxCustomGridCellPainter) + protected + function CanDrawDesignSelection: Boolean; override; + function ExcludeFromClipRect: Boolean; override; + end; + + TcxGridChartPieDiagramPainter = class(TcxGridChartDiagramPainter) + private + function GetViewInfo: TcxGridChartPieDiagramViewInfo; + protected + procedure DrawContent; override; + procedure DrawSeriesDesignSelection; virtual; + procedure DrawSeriesSites; virtual; + procedure DrawValues; override; + procedure ExcludeSeriesPieAreasFromClipRegion; virtual; + procedure PrepareClipRegionForValueDrawing(AValueViewInfo: TcxGridChartDiagramValueViewInfo; + AOriginalClipRegion: TcxRegion); override; + property ViewInfo: TcxGridChartPieDiagramViewInfo read GetViewInfo; + end; + + // ToolBox + + TcxGridChartToolBoxItemSeparatorPainter = class(TcxCustomGridCellPainter) + protected + procedure DrawContent; override; + end; + + TcxGridChartToolBoxDataLevelActiveValuePainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridChartToolBoxDataLevelActiveValueViewInfo; + protected + procedure PrepareCanvasForDrawText; override; + property ViewInfo: TcxGridChartToolBoxDataLevelActiveValueViewInfo read GetViewInfo; + end; + + TcxGridChartToolBoxDataLevelInfoPainter = class(TcxCustomGridCellPainter) + protected + procedure DrawBackground; override; + function ExcludeFromClipRect: Boolean; override; + end; + + TcxGridChartToolBoxCustomizeButtonPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridChartToolBoxCustomizeButtonViewInfo; + protected + procedure Paint; override; + property ViewInfo: TcxGridChartToolBoxCustomizeButtonViewInfo read GetViewInfo; + end; + + TcxGridChartToolBoxDiagramSelectorPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridChartToolBoxDiagramSelectorViewInfo; + protected + procedure DrawContent; override; + procedure DrawImage; virtual; + procedure PrepareCanvasForDrawText; override; + property ViewInfo: TcxGridChartToolBoxDiagramSelectorViewInfo read GetViewInfo; + end; + + TcxGridChartToolBoxPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridChartToolBoxViewInfo; + protected + procedure DrawContent; override; + procedure DrawDataLevelInfoConnectors; virtual; + procedure DrawItems(AOpaqueItems: Boolean); virtual; + function ExcludeFromClipRect: Boolean; override; + property ViewInfo: TcxGridChartToolBoxViewInfo read GetViewInfo; + end; + + // view + + TcxGridChartPainter = class(TcxCustomGridPainter) + private + function GetViewInfo: TcxGridChartViewInfo; + protected + procedure PaintAfter; override; + procedure PaintContent; override; + public + property ViewInfo: TcxGridChartViewInfo read GetViewInfo; + end; + + { view data } + + TcxGridChartViewData = class(TcxCustomGridViewData) + private + FDataGroupIndex: Integer; + FSumOfValues: TVariantArray; + function GetCategory(AIndex: Integer): Variant; + function GetCategoryCount: Integer; + function GetChildCount: Integer; + function GetChildDataGroupIndex(Index: Integer): Integer; + function GetChildLevel: Integer; + function GetChildRecordIndex(Index: Integer): Integer; + function GetDataGroupIndex: Integer; + function GetGridView: TcxGridChartView; + function GetGroupValue(ADataGroupIndex, AIndex: Integer): Variant; + function GetSumOfValues(ASeriesIndex: Integer): Variant; + function GetValue(ASeriesIndex, AIndex: Integer): Variant; + function GetVisibleCategory(AIndex: Integer): Variant; + function GetVisibleCategoryCount: Integer; + function GetVisibleGroupValue(AVisibleDataGroupIndex, AIndex: Integer): Variant; + function GetVisibleGroupValueCount(AVisibleDataGroupIndex: Integer): Integer; + function GetVisibleValue(ASeriesIndex, AIndex: Integer): Variant; + procedure SetCategory(AIndex: Integer; const Value: Variant); + procedure SetCategoryCount(Value: Integer); + procedure SetGroupValue(ADataGroupIndex, AIndex: Integer; const Value: Variant); + procedure SetValue(ASeriesIndex, AIndex: Integer; const Value: Variant); + protected + function CalculateDataGroupIndex: Integer; virtual; + function CalculateSumOfValues(ASeriesIndex: Integer): Variant; virtual; + procedure CheckValueAtLevel(ALevel: Integer; var AValue: Variant); + function GetDataGroupIndexByLevel(ALevel: Integer): Integer; + function GetRecordIndexByValueIndex(AValueIndex: Integer): Integer; + procedure DataLevelsChanged; virtual; + function IsDataGrouped: Boolean; + function IsSummaryLevel: Boolean; + procedure CalculateSumsOfValues; + procedure SeriesPosChanged(ASeries: TcxGridChartSeries); virtual; + procedure Update(AInfo: TcxUpdateControlInfo); virtual; + procedure UpdateDataGroupIndex; + procedure UpdateSumsOfValues; + + property ChildCount: Integer read GetChildCount; + property ChildDataGroupIndex[Index: Integer]: Integer read GetChildDataGroupIndex; + property ChildLevel: Integer read GetChildLevel; + property ChildRecordIndex[Index: Integer]: Integer read GetChildRecordIndex; + property DataGroupIndex: Integer read GetDataGroupIndex; + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure GetVisibleGroupValues(ADataGroup: TcxGridChartDataGroup; AStrings: TStrings; + out AValues: TVariantArray); + + property GridView: TcxGridChartView read GetGridView; + property SumOfValues[ASeriesIndex: Integer]: Variant read GetSumOfValues; + + // all values + property Categories[AIndex: Integer]: Variant read GetCategory write SetCategory; + property CategoryCount: Integer read GetCategoryCount write SetCategoryCount; + property GroupValues[ADataGroupIndex, AIndex: Integer]: Variant read GetGroupValue write SetGroupValue; + property Values[ASeriesIndex, AIndex: Integer]: Variant read GetValue write SetValue; + + // visible values + property VisibleCategories[AIndex: Integer]: Variant read GetVisibleCategory; + property VisibleCategoryCount: Integer read GetVisibleCategoryCount; + property VisibleValues[ASeriesIndex, AIndex: Integer]: Variant read GetVisibleValue; + + property VisibleGroupValueCount[AVisibleDataGroupIndex: Integer]: Integer read GetVisibleGroupValueCount; + property VisibleGroupValues[AVisibleDataGroupIndex, AIndex: Integer]: Variant read GetVisibleGroupValue; + end; + + { view info } + + // part + + TcxCustomGridChartPartViewInfo = class(TcxCustomGridViewCellViewInfo) + private + function GetGridView: TcxGridChartView; + function GetGridViewInfo: TcxGridChartViewInfo; + protected + function GetAlignment: TcxGridChartPartAlignment; virtual; abstract; + function GetHeight: Integer; override; + function GetOrientation: TcxGridChartPartOrientation; virtual; abstract; + function GetPosition: TcxGridChartPartPosition; virtual; abstract; + function GetVisible: Boolean; override; + function GetWidth: Integer; override; + public + property Alignment: TcxGridChartPartAlignment read GetAlignment; + property GridView: TcxGridChartView read GetGridView; + property GridViewInfo: TcxGridChartViewInfo read GetGridViewInfo; + property Orientation: TcxGridChartPartOrientation read GetOrientation; + property Position: TcxGridChartPartPosition read GetPosition; + end; + + // custom title + + TcxCustomGridChartTitleViewInfo = class(TcxCustomGridChartPartViewInfo) + private + FTitle: TcxCustomGridChartTitle; + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetAlignment: TcxGridChartPartAlignment; override; + function GetOrientation: TcxGridChartPartOrientation; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetPosition: TcxGridChartPartPosition; override; + function GetText: string; override; + function GetTextAreaBounds: TRect; override; + function HasBackground: Boolean; override; + public + constructor Create(AGridViewInfo: TcxCustomGridViewInfo; ATitle: TcxCustomGridChartTitle); reintroduce; virtual; + property Title: TcxCustomGridChartTitle read FTitle; + end; + + // custom legend + + TcxGridChartLegendItemViewInfoClass = class of TcxGridChartLegendItemViewInfo; + + TcxGridChartLegendItemViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FContainer: TcxGridChartLegendViewInfo; + FIndex: Integer; + function GetDiagram: TcxGridChartDiagram; + function GetGridView: TcxGridChartView; + function GetLegendKeyHeight: Integer; + function GetLegendKeyWidth: Integer; + function GetSeries: TcxGridChartSeries; + protected + function CalculateContentBounds: TRect; override; + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function CalculateLegendKeyHeight: Integer; virtual; + function CalculateLegendKeySize: Integer; virtual; + function CalculateLegendKeyWidth: Integer; virtual; + function CustomDraw(ACanvas: TcxCanvas): Boolean; override; + procedure DoCalculateParams; override; + function GetDesignSelectionBounds: TRect; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetIsDesignSelected: Boolean; override; + function GetLegendKeyBorders: TcxBorders; virtual; + function GetLegendKeyBounds: TRect; virtual; + function GetLegendKeyOffset: Integer; virtual; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetText: string; override; + function GetTextAreaBounds: TRect; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function HasBackground: Boolean; override; + function HasCustomDraw: Boolean; override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + + property LegendKeyHeight: Integer read GetLegendKeyHeight; + property LegendKeyOffset: Integer read GetLegendKeyOffset; + property LegendKeyWidth: Integer read GetLegendKeyWidth; + public + LegendKeyParams: TcxViewParams; + constructor Create(AContainer: TcxGridChartLegendViewInfo; AIndex: Integer); reintroduce; virtual; + function GetAreaBoundsForPainting: TRect; override; + function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + property Container: TcxGridChartLegendViewInfo read FContainer; + property Diagram: TcxGridChartDiagram read GetDiagram; + property GridView: TcxGridChartView read GetGridView; + property Index: Integer read FIndex; + property LegendKeyBorders: TcxBorders read GetLegendKeyBorders; + property LegendKeyBounds: TRect read GetLegendKeyBounds; + property Series: TcxGridChartSeries read GetSeries; + end; + + TcxGridChartLegendKind = (lkSeries, lkCategories); + + TcxGridChartLegendViewInfoClass = class of TcxGridChartLegendViewInfo; + + TcxGridChartLegendViewInfo = class(TcxCustomGridChartPartViewInfo) + private + FDiagram: TcxGridChartDiagram; + FItemLegendKeyWidth: Integer; + FItemLegendKeyHeight: Integer; + FItemOffset: Integer; + FItems: TList; + function GetCount: Integer; + function GetItem(Index: Integer): TcxGridChartLegendItemViewInfo; + function GetItemLegendKeyWidth: Integer; + function GetItemLegendKeyHeight: Integer; + function GetItemOffset: Integer; + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function CalculateItemLegendKeyWidth: Integer; virtual; + function CalculateItemLegendKeyHeight: Integer; virtual; + function CalculateItemOffset: Integer; virtual; + function CustomDraw(ACanvas: TcxCanvas): Boolean; override; + function GetAlignment: TcxGridChartPartAlignment; override; + function GetBorderColor(AIndex: TcxBorder): TColor; override; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetOrientation: TcxGridChartPartOrientation; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetPosition: TcxGridChartPartPosition; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function GetVisible: Boolean; override; + function HasCustomDraw: Boolean; override; + + function AddItem: TcxGridChartLegendItemViewInfo; + procedure CalculateItems; virtual; + function GetItemCaption(AIndex: Integer): string; virtual; + function GetItemClass: TcxGridChartLegendItemViewInfoClass; virtual; + function GetItemCount: Integer; virtual; + function GetItemObjectIndex(AIndex: Integer): Integer; virtual; abstract; + function GetItemSeriesIndex(AIndex: Integer): Integer; virtual; + function GetItemValueIndex(AIndex: Integer): Integer; virtual; + function GetKind: TcxGridChartLegendKind; virtual; abstract; + //function ItemLegendKeyBorderIsValueBorder: Boolean; virtual; + + property ItemLegendKeyWidth: Integer read GetItemLegendKeyWidth; + property ItemLegendKeyHeight: Integer read GetItemLegendKeyHeight; + property ItemOffset: Integer read GetItemOffset; + public + constructor Create(AGridViewInfo: TcxCustomGridViewInfo; ADiagram: TcxGridChartDiagram); reintroduce; virtual; + destructor Destroy; override; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + procedure GetItemLegendKeyParams(AIndex: Integer; out AParams: TcxViewParams); virtual; + property Diagram: TcxGridChartDiagram read FDiagram; + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxGridChartLegendItemViewInfo read GetItem; + property Kind: TcxGridChartLegendKind read GetKind; + end; + + // custom diagram + + TcxGridChartDiagramValueCaptionViewInfoClass = class of TcxGridChartDiagramValueCaptionViewInfo; + + TcxGridChartDiagramValueCaptionViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FValueViewInfo: TcxGridChartDiagramValueViewInfo; + protected + function GetAlignmentHorz: TAlignment; override; + function GetAlignmentVert: TcxAlignmentVert; override; + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetText: string; override; + function GetTextAreaBounds: TRect; override; + function GetTextAttributes(AForPainting: Boolean): Integer; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function GetVisible: Boolean; override; + function HasBackground: Boolean; override; + function HasVisualCompensation: Boolean; virtual; + public + constructor Create(AValueViewInfo: TcxGridChartDiagramValueViewInfo); reintroduce; virtual; + property ValueViewInfo: TcxGridChartDiagramValueViewInfo read FValueViewInfo; + end; + + TcxGridChartDiagramValueViewInfoClass = class of TcxGridChartDiagramValueViewInfo; + + TcxGridChartDiagramValueViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FCaptionViewInfo: TcxGridChartDiagramValueCaptionViewInfo; + FDiagramViewInfo: TcxGridChartDiagramViewInfo; + FSeriesIndex: Integer; + FVisibleValueIndex: Integer; + function GetController: TcxGridChartController; + function GetDiagram: TcxGridChartDiagram; + function GetGridView: TcxGridChartView; + function GetSeries: TcxGridChartSeries; + function GetValueIndex: Integer; + protected + function CalculateCaptionBounds: TRect; virtual; abstract; + function CanShowHint: Boolean; override; + function CustomDraw(ACanvas: TcxCanvas): Boolean; override; + function GetCaptionViewInfoClass: TcxGridChartDiagramValueCaptionViewInfoClass; virtual; + function GetCaptionText: string; virtual; + procedure GetCaptionViewParams(var AParams: TcxViewParams); virtual; + function GetCellBoundsForHint: TRect; override; + function GetHintText: string; override; + function GetHintTextRect(const AMousePos: TPoint): TRect; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetHotTrack: Boolean; override; + function GetIsDesignSelected: Boolean; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function HasCaption: Boolean; virtual; + function HasCaptionVisualCompensation: Boolean; virtual; + function HasCustomDraw: Boolean; override; + function HasHintPoint(const P: TPoint): Boolean; override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + function IsHintForText: Boolean; override; + function IsHintMultiLine: Boolean; override; + procedure StateChanged(APrevState: TcxGridCellState); override; + + property Controller: TcxGridChartController read GetController; + property Diagram: TcxGridChartDiagram read GetDiagram; + public + constructor Create(ADiagramViewInfo: TcxGridChartDiagramViewInfo; + ASeriesIndex, AVisibleValueIndex: Integer); reintroduce; virtual; + destructor Destroy; override; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + property CaptionViewInfo: TcxGridChartDiagramValueCaptionViewInfo read FCaptionViewInfo; + property DiagramViewInfo: TcxGridChartDiagramViewInfo read FDiagramViewInfo; + property GridView: TcxGridChartView read GetGridView; + property Series: TcxGridChartSeries read GetSeries; + property SeriesIndex: Integer read FSeriesIndex; + property ValueIndex: Integer read GetValueIndex; + property VisibleValueIndex: Integer read FVisibleValueIndex; + end; + + TcxGridChartDiagramViewInfoClass = class of TcxGridChartDiagramViewInfo; + + TcxGridChartDiagramViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FDiagram: TcxGridChartDiagram; + FValueViewInfos: TList; + function GetCategory(AIndex: Integer): string; + function GetGridView: TcxGridChartView; + function GetSeries(AIndex: Integer): TcxGridChartSeries; + function GetSeriesCount: Integer; + function GetValueCount: Integer; + function GetValueViewInfoValue(Index: Integer): TcxGridChartDiagramValueViewInfo; + function GetValueViewInfoCount: Integer; + function GetViewData: TcxGridChartViewData; + protected + procedure GetViewParams(var AParams: TcxViewParams); override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + + function CreateValueViewInfo(ASeriesIndex, AVisibleValueIndex: Integer): TcxGridChartDiagramValueViewInfo; + function GetValue(ASeriesIndex, AIndex: Integer): Variant; virtual; + function GetValueCaption(ASeriesIndex, AVisibleValueIndex: Integer): string; virtual; + function GetValueIndex(AVisibleValueIndex: Integer): Integer; virtual; + class function GetValueViewInfoClass: TcxGridChartDiagramValueViewInfoClass; virtual; // abstract; - because of CLR, BCB + function GetValueViewInfoIndex(ASeriesIndex, AVisibleIndex: Integer): Integer; virtual; abstract; + function GetVisibleCategory(AIndex: Integer): string; virtual; + function GetVisibleValue(ASeriesIndex, AIndex: Integer): Variant; virtual; + function GetVisibleValueCount: Integer; virtual; + + property Categories[AIndex: Integer]: string read GetCategory; + property Values[ASeriesIndex, AIndex: Integer]: Variant read GetValue; + property Series[AIndex: Integer]: TcxGridChartSeries read GetSeries; + public + constructor Create(AGridViewInfo: TcxCustomGridViewInfo; ADiagram: TcxGridChartDiagram); reintroduce; virtual; + destructor Destroy; override; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + function GetValueViewInfo(ASeriesIndex, AVisibleIndex: Integer): TcxGridChartDiagramValueViewInfo; + property Diagram: TcxGridChartDiagram read FDiagram; + property GridView: TcxGridChartView read GetGridView; + property SeriesCount: Integer read GetSeriesCount; + property ValueCount: Integer read GetValueCount; + property ValueViewInfoCount: Integer read GetValueViewInfoCount; + property ValueViewInfos[Index: Integer]: TcxGridChartDiagramValueViewInfo read GetValueViewInfoValue; + property ViewData: TcxGridChartViewData read GetViewData; + property VisibleCategories[AIndex: Integer]: string read GetVisibleCategory; + property VisibleValueCount: Integer read GetVisibleValueCount; + property VisibleValues[ASeriesIndex, AIndex: Integer]: Variant read GetVisibleValue; + end; + + // histogram legend + + TcxGridChartHistogramLegendViewInfo = class(TcxGridChartLegendViewInfo) + private + function GetDiagram: TcxGridChartHistogram; + protected + function GetItemObjectIndex(AIndex: Integer): Integer; override; + function GetItemsInReverseOrder: Boolean; virtual; + function GetKind: TcxGridChartLegendKind; override; + property ItemsInReverseOrder: Boolean read GetItemsInReverseOrder; + public + property Diagram: TcxGridChartHistogram read GetDiagram; + end; + + // histogram + + TcxGridChartHistogramValueViewInfo = class(TcxGridChartDiagramValueViewInfo) + private + function GetCategoryDirection: TcxDirection; + function GetDiagramViewInfo: TcxGridChartHistogramViewInfo; + function GetValueDirection: TcxDirection; + public + property CategoryDirection: TcxDirection read GetCategoryDirection; + property DiagramViewInfo: TcxGridChartHistogramViewInfo read GetDiagramViewInfo; + property ValueDirection: TcxDirection read GetValueDirection; + end; + + TcxGridChartHistogramAxisTitleViewInfoClass = class of TcxGridChartHistogramAxisTitleViewInfo; + + TcxGridChartHistogramAxisTitleViewInfo = class(TcxCustomGridChartTitleViewInfo) + private + FContainer: TcxGridChartHistogramTickMarkLabelsViewInfo; + function GetTitle: TcxGridChartHistogramAxisTitle; + protected + procedure GetViewParams(var AParams: TcxViewParams); override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + public + constructor Create(AContainer: TcxGridChartHistogramTickMarkLabelsViewInfo; + ATitle: TcxCustomGridChartTitle); reintroduce; virtual; + property Container: TcxGridChartHistogramTickMarkLabelsViewInfo read FContainer; + property Title: TcxGridChartHistogramAxisTitle read GetTitle; + end; + + TcxGridChartAxisPosition = cppLeft..cppBottom; + + TcxGridChartHistogramTickMarkLabelsViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FCaptionBounds: TRectArray; + FCaptionHeight: Integer; + FCaptionWidths: array of Integer; + FDiagramViewInfo: TcxGridChartHistogramViewInfo; + FIsTwoRowLayout: Boolean; + FTitleViewInfo: TcxGridChartHistogramAxisTitleViewInfo; + function GetCaptionBounds(Index: Integer): TRect; + function GetCaptionHeight: Integer; + function GetCaptionWidth(Index: Integer): Integer; + function GetDiagram: TcxGridChartHistogram; + function GetIsVertical: Boolean; + procedure SetCaptionBounds(Index: Integer; const Value: TRect); + protected + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetTitleViewInfoClass: TcxGridChartHistogramAxisTitleViewInfoClass; virtual; + + function GetCaption(Index: Integer): string; virtual; + function GetCount: Integer; virtual; abstract; + function GetIsReverseOrder: Boolean; virtual; abstract; + function GetValue(Index: Integer): Variant; virtual; abstract; + + function CalculateCaptionBounds(AIndex: Integer): TRect; virtual; + procedure CalculateCaptionsBounds; virtual; + function CalculateHeight(AWidth, ALeftReduction, ARightReduction: Integer): Integer; {overload;}reintroduce; virtual; + function CalculateWidth: Integer; override; + function CalculateIsTwoRowLayout(AWidth, ALeftReduction, ARightReduction: Integer): Boolean; virtual; + procedure CalculateTitleBounds(out ATitleBounds, AContentBounds: TRect); virtual; + function GetAlignmentHorz: TAlignment; override; + function GetAxis: TcxGridChartHistogramAxis; virtual; abstract; + function GetCaptionPosition(AIndex: Integer): Integer; virtual; abstract; + function GetCaptionsVisible: Boolean; virtual; + procedure GetEdgeCaptionsReductions(var ALeftReduction, ARightReduction: Integer); virtual; + function GetIsEdgeCaptions: Boolean; virtual; abstract; + function GetPosition: TcxGridChartAxisPosition; virtual; abstract; + function GetTextAttributes(AForPainting: Boolean): Integer; override; + procedure GetTitleViewParams(var AParams: TcxViewParams); virtual; abstract; + function GetVisible: Boolean; override; + + property Axis: TcxGridChartHistogramAxis read GetAxis; + property CaptionHeight: Integer read GetCaptionHeight; + property CaptionWidths[Index: Integer]: Integer read GetCaptionWidth; + property Diagram: TcxGridChartHistogram read GetDiagram; + property IsEdgeCaptions: Boolean read GetIsEdgeCaptions; + property IsReverseOrder: Boolean read GetIsReverseOrder; + property IsTwoRowLayout: Boolean read FIsTwoRowLayout write FIsTwoRowLayout; + property IsVertical: Boolean read GetIsVertical; + public + constructor Create(ADiagramViewInfo: TcxGridChartHistogramViewInfo); reintroduce; virtual; + destructor Destroy; override; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + procedure FitCaptionsHorz(AWidth: Integer; var ALeftReduction, ARightReduction: Integer); virtual; + procedure FitCaptionsVert(var ATopReduction, ABottomReduction: Integer); virtual; + function GetCaptionSpace(AWidth, ALeftReduction, ARightReduction: Integer): Integer; virtual; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + + property CaptionBounds[Index: Integer]: TRect read GetCaptionBounds write SetCaptionBounds; + property Captions[Index: Integer]: string read GetCaption; + property CaptionsVisible: Boolean read GetCaptionsVisible; + property Count: Integer read GetCount; + property DiagramViewInfo: TcxGridChartHistogramViewInfo read FDiagramViewInfo; + property Position: TcxGridChartAxisPosition read GetPosition; + property TitleViewInfo: TcxGridChartHistogramAxisTitleViewInfo read FTitleViewInfo; + property Values[Index: Integer]: Variant read GetValue; + end; + + TcxGridChartHistogramCategoryAxisTitleViewInfo = class(TcxGridChartHistogramAxisTitleViewInfo) + protected + function GetHitTestClass: TcxCustomGridHitTestClass; override; + end; + + TcxGridChartHistogramCategoryTickMarkLabelsViewInfoClass = class of TcxGridChartHistogramCategoryTickMarkLabelsViewInfo; + + TcxGridChartHistogramCategoryTickMarkLabelsViewInfo = class(TcxGridChartHistogramTickMarkLabelsViewInfo) + protected + function GetTitleViewInfoClass: TcxGridChartHistogramAxisTitleViewInfoClass; override; + + function GetCount: Integer; override; + function GetIsReverseOrder: Boolean; override; + function GetValue(Index: Integer): Variant; override; + + function GetAxis: TcxGridChartHistogramAxis; override; + function GetCaptionPosition(AIndex: Integer): Integer; override; + function GetIsEdgeCaptions: Boolean; override; + function GetPosition: TcxGridChartAxisPosition; override; + procedure GetTitleViewParams(var AParams: TcxViewParams); override; + procedure GetViewParams(var AParams: TcxViewParams); override; + end; + + TcxGridChartHistogramValueAxisTitleViewInfo = class(TcxGridChartHistogramAxisTitleViewInfo) + protected + function GetHitTestClass: TcxCustomGridHitTestClass; override; + end; + + TcxGridChartHistogramValueTickMarkLabelsViewInfoClass = class of TcxGridChartHistogramValueTickMarkLabelsViewInfo; + + TcxGridChartHistogramValueTickMarkLabelsViewInfo = class(TcxGridChartHistogramTickMarkLabelsViewInfo) + private + function GetAxisValue: TcxGridChartHistogramAxisValue; + protected + function GetTitleViewInfoClass: TcxGridChartHistogramAxisTitleViewInfoClass; override; + + function GetCaption(Index: Integer): string; override; + function GetCount: Integer; override; + function GetIsReverseOrder: Boolean; override; + function GetValue(Index: Integer): Variant; override; + + function GetAxis: TcxGridChartHistogramAxis; override; + function GetCaptionPosition(AIndex: Integer): Integer; override; + function GetIsEdgeCaptions: Boolean; override; + function GetPosition: TcxGridChartAxisPosition; override; + procedure GetTitleViewParams(var AParams: TcxViewParams); override; + procedure GetViewParams(var AParams: TcxViewParams); override; + + property Axis: TcxGridChartHistogramAxisValue read GetAxisValue; + end; + + TcxGridChartHistogramMark = record + Value: Variant; + Position: Integer; + end; + TcxGridChartHistogramMarks = array of TcxGridChartHistogramMark; + + TcxGridChartHistogramViewInfo = class(TcxGridChartDiagramViewInfo) + private + FCategoryTickMarkLabelsViewInfo: TcxGridChartHistogramCategoryTickMarkLabelsViewInfo; + FCategoryMarkHeight: Integer; + FCategoryMarks: TcxGridChartHistogramMarks; + FHasValuesOutOfRange: Boolean; + FIsPlotBoundsCalculated: Boolean; + FMinValue: Extended; + FMaxValue: Extended; + FMinVisualValue: Extended; + FMaxVisualValue: Extended; + FPlotBounds: TRect; + FSumOfValues: TVariantArray; + FValueTickMarkLabelsViewInfo: TcxGridChartHistogramValueTickMarkLabelsViewInfo; + FValueMarkHeight: Integer; + FValueMarks: TcxGridChartHistogramMarks; + FValueStep: Extended; + function GetCategoryAxisColor: TColor; + function GetCategoryGridLineColor: TColor; + function GetCategoryMarkCount: Integer; + function GetCategoryMarkPosition(Index: Integer): Integer; + function GetCategoryMarkValue(Index: Integer): Integer; + function GetDiagram: TcxGridChartHistogram; + function GetHasCategoryAxis: Boolean; + function GetHasCategoryGridLines: Boolean; + function GetHasValueAxis: Boolean; + function GetHasValueGridLines: Boolean; + function GetIsCategoriesInReverseOrder: Boolean; + function GetIsCategoryAxisHorz: Boolean; + function GetIsValueAxisVert: Boolean; + function GetPlotBounds: TRect; + function GetSumOfValues(AValueIndex: Integer): Variant; + function GetValueAxisColor: TColor; + function GetValueGridLineColor: TColor; + function GetValueMarkCount: Integer; + function GetValueMarkPosition(Index: Integer): Integer; + function GetValueMarkValue(Index: Integer): Extended; + function GetZeroValueOffset: Integer; + procedure SetCategoryMarkPosition(Index: Integer; Value: Integer); + procedure SetValueMarkPosition(Index: Integer; Value: Integer); + protected + function GetCategoryTickMarkLabelsViewInfoClass: TcxGridChartHistogramCategoryTickMarkLabelsViewInfoClass; virtual; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetValueTickMarkLabelsViewInfoClass: TcxGridChartHistogramValueTickMarkLabelsViewInfoClass; virtual; + + procedure DoCalculateParams; override; + procedure GetPlotBackgroundParams(out AParams: TcxViewParams); virtual; + + function GetCategoryDirection: TcxDirection; virtual; + function GetCategoryTickMarkLabelOffsetUnits(AIndex: Integer): Integer; virtual; abstract; + function GetCategoryTickMarkOffsetUnits(AIndex: Integer; AValueAxisBetweenCategories: Boolean): Integer; virtual; abstract; + function GetUnitAdjustedOffset(AIndex: Integer): Integer; virtual; + function GetUnitCount: Integer; virtual; abstract; + function GetUnitOffset(AIndex: Integer): Integer; virtual; + function IsEdgeCategoryTickMarkLabels: Boolean; virtual; abstract; + + procedure CalculateMinMaxValues(out AMinValue, AMaxValue: Extended; + out AHasValuesOutOfRange: Boolean); virtual; + procedure CalculateMinMaxVisualValues(out AMinVisualValue, AMaxVisualValue: Extended); virtual; + function CalculateSumOfValues(AValueIndex: Integer): Variant; virtual; + function CalculateValueStep: Extended; virtual; + function GetValue(ASeriesIndex, AIndex: Integer): Variant; override; + function GetValueDirection(ASeriesIndex, AVisibleValueIndex: Integer): TcxDirection; virtual; + function GetValueOffset(const AValue: Variant): Integer; virtual; + function GetZeroValue: Extended; virtual; + function IsDataInteger: Boolean; + function IsValuePositive(ASeriesIndex, AVisibleValueIndex: Integer): Boolean; virtual; + function NeedsMinMaxValuesOffset: Boolean; virtual; + + procedure AddMark(var AMarks: TcxGridChartHistogramMarks; const AValue: Variant); + + procedure AddCategoryMark(AValue: Integer); + procedure CalculateCategoryMarkPositions; + procedure CalculateCategoryMarkValues; virtual; + + procedure AddValueMark(const AValue: Extended); + procedure CalculateValueMarkPositions; + procedure CalculateValueMarkValues; virtual; + + function CalculateCategoryMarkHeight: Integer; virtual; + function CalculateValueMarkHeight: Integer; virtual; + function CalculatePlotBounds: TRect; virtual; + procedure CalculatePlotOffsets(APlotAreaWidth: Integer; var AOffsets: TRect); virtual; + procedure CalculateValues; virtual; abstract; + function GetCategoryAxisBounds: TRect; virtual; + function GetCategoryAxisPosition: TcxGridChartAxisPosition; virtual; + function GetCategoryGridLineBounds(AIndex: Integer): TRect; virtual; + function GetCategoryMarkBounds(Index: Integer): TRect; virtual; + function GetCategoryTickMarkLabelsBounds: TRect; virtual; + function GetTickMarkLabelsBounds(APosition: TcxGridChartAxisPosition): TRect; virtual; + function GetValueAxisBounds: TRect; virtual; + function GetValueAxisPosition: TcxGridChartAxisPosition; virtual; + //function GetValueBounds(AValueIndex, ASeriesIndex: Integer): TRect; virtual; abstract; + function GetValueGridLineBounds(AIndex: Integer): TRect; virtual; + function GetValueMarkBounds(Index: Integer): TRect; virtual; + function GetValueTickMarkLabelsBounds: TRect; virtual; + + function CustomDrawPlot(ACanvas: TcxCanvas): Boolean; virtual; + function DoCustomDrawPlot(ACanvas: TcxCanvas): Boolean; virtual; + function HasCustomDrawPlot: Boolean; virtual; + + property CategoryMarkHeight: Integer read FCategoryMarkHeight; + property CategoryMarkValues[Index: Integer]: Integer read GetCategoryMarkValue; + property HasValuesOutOfRange: Boolean read FHasValuesOutOfRange; + property IsCategoriesInReverseOrder: Boolean read GetIsCategoriesInReverseOrder; + property IsCategoryAxisHorz: Boolean read GetIsCategoryAxisHorz; + property IsValueAxisVert: Boolean read GetIsValueAxisVert; + property MinValue: Extended read FMinValue; + property MaxValue: Extended read FMaxValue; + property MinVisualValue: Extended read FMinVisualValue; + property MaxVisualValue: Extended read FMaxVisualValue; + property SumOfValues[AValueIndex: Integer]: Variant read GetSumOfValues; + property UnitCount: Integer read GetUnitCount; + property ValueMarkHeight: Integer read FValueMarkHeight; + property ValueMarkValues[Index: Integer]: Extended read GetValueMarkValue; + property ValueStep: Extended read FValueStep; + property ZeroValue: Extended read GetZeroValue; + property ZeroValueOffset: Integer read GetZeroValueOffset; + public + PlotParams: TcxViewParams; + constructor Create(AGridViewInfo: TcxCustomGridViewInfo; ADiagram: TcxGridChartDiagram); override; + destructor Destroy; override; + procedure Calculate(const ABounds: TRect); override; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + + property CategoryAxisColor: TColor read GetCategoryAxisColor; + property CategoryAxisBounds: TRect read GetCategoryAxisBounds; + property CategoryAxisPosition: TcxGridChartAxisPosition read GetCategoryAxisPosition; + property CategoryGridLineBounds[AIndex: Integer]: TRect read GetCategoryGridLineBounds; + property CategoryGridLineColor: TColor read GetCategoryGridLineColor; + property CategoryMarkBounds[Index: Integer]: TRect read GetCategoryMarkBounds; + property CategoryTickMarkLabelsViewInfo: TcxGridChartHistogramCategoryTickMarkLabelsViewInfo read FCategoryTickMarkLabelsViewInfo; + property CategoryMarkCount: Integer read GetCategoryMarkCount; + property CategoryMarkPositions[Index: Integer]: Integer read GetCategoryMarkPosition write SetCategoryMarkPosition; + property Diagram: TcxGridChartHistogram read GetDiagram; + property HasCategoryAxis: Boolean read GetHasCategoryAxis; + property HasCategoryGridLines: Boolean read GetHasCategoryGridLines; + property HasValueAxis: Boolean read GetHasValueAxis; + property HasValueGridLines: Boolean read GetHasValueGridLines; + property PlotBounds: TRect read GetPlotBounds; + property ValueAxisBounds: TRect read GetValueAxisBounds; + property ValueAxisColor: TColor read GetValueAxisColor; + property ValueAxisPosition: TcxGridChartAxisPosition read GetValueAxisPosition; + property ValueGridLineBounds[AIndex: Integer]: TRect read GetValueGridLineBounds; + property ValueGridLineColor: TColor read GetValueGridLineColor; + property ValueMarkBounds[Index: Integer]: TRect read GetValueMarkBounds; + property ValueTickMarkLabelsViewInfo: TcxGridChartHistogramValueTickMarkLabelsViewInfo read FValueTickMarkLabelsViewInfo; + property ValueMarkCount: Integer read GetValueMarkCount; + property ValueMarkPositions[Index: Integer]: Integer read GetValueMarkPosition write SetValueMarkPosition; + end; + + // column diagram legend + + TcxGridChartColumnDiagramLegendViewInfo = class(TcxGridChartHistogramLegendViewInfo) + protected + function GetItemsInReverseOrder: Boolean; override; + end; + + // column diagram + + TcxGridChartColumnDiagramValueViewInfo = class(TcxGridChartHistogramValueViewInfo) + private + function GetCaptionPosition: TcxGridChartColumnDiagramValueCaptionPosition; + function GetDiagramViewInfo: TcxGridChartColumnDiagramViewInfo; + protected + function CalculateCaptionBounds: TRect; override; + function GetBorderColor(AIndex: TcxBorder): TColor; override; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function HasCaption: Boolean; override; + function HasCaptionVisualCompensation: Boolean; override; + public + property CaptionPosition: TcxGridChartColumnDiagramValueCaptionPosition read GetCaptionPosition; + property DiagramViewInfo: TcxGridChartColumnDiagramViewInfo read GetDiagramViewInfo; + end; + + TcxGridChartColumnDiagramViewInfo = class(TcxGridChartHistogramViewInfo) + private + function GetDiagram: TcxGridChartColumnDiagram; + protected + function GetPainterClass: TcxCustomGridCellPainterClass; override; + + class function GetValueViewInfoClass: TcxGridChartDiagramValueViewInfoClass; override; + function GetValueViewInfoIndex(ASeriesIndex, AVisibleIndex: Integer): Integer; override; + + function GetCategoryTickMarkLabelOffsetUnits(AIndex: Integer): Integer; override; + function GetCategoryTickMarkOffsetUnits(AIndex: Integer; AValueAxisBetweenCategories: Boolean): Integer; override; + function GetUnitCount: Integer; override; + function GetValueGroupAreaSizeUnits: Integer; virtual; + function GetValueOffsetUnits(AVisibleValueIndex, ASeriesIndex: Integer): Integer; virtual; + function IsEdgeCategoryTickMarkLabels: Boolean; override; + + procedure CalculateValues; override; + function GetValueBounds(AVisibleValueIndex, ASeriesIndex: Integer): TRect; virtual; + public + property Diagram: TcxGridChartColumnDiagram read GetDiagram; + end; + + // line diagram legend + + TcxGridChartLineDiagramLegendItemViewInfo = class(TcxGridChartLegendItemViewInfo) + private + function GetDiagram: TcxGridChartLineDiagram; + function GetLineStyle: TcxGridChartLineStyle; + function GetLineWidth: Integer; + function GetMarkerSize: Integer; + function GetMarkerStyle: TcxGridChartMarkerStyle; + protected + function CalculateHeight: Integer; override; + function CalculateLegendKeyWidth: Integer; override; + procedure CalculateMarkerPoints; virtual; + procedure DoCalculateParams; override; + function GetAlignmentVert: TcxAlignmentVert; override; + function GetDiagramValueViewInfoClass: TcxGridChartLineDiagramValueViewInfoClass; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetLineColor: TColor; virtual; + function GetLineStart: TPoint; virtual; + function GetLineFinish: TPoint; virtual; + function GetMarkerBounds: TRect; virtual; + property MarkerSize: Integer read GetMarkerSize; + public + MarkerParams: TcxViewParams; + MarkerPoints: TPointArray; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + property Diagram: TcxGridChartLineDiagram read GetDiagram; + property LineColor: TColor read GetLineColor; + property LineStart: TPoint read GetLineStart; + property LineFinish: TPoint read GetLineFinish; + property LineStyle: TcxGridChartLineStyle read GetLineStyle; + property LineWidth: Integer read GetLineWidth; + property MarkerBounds: TRect read GetMarkerBounds; + property MarkerStyle: TcxGridChartMarkerStyle read GetMarkerStyle; + end; + + TcxGridChartLineDiagramLegendViewInfo = class(TcxGridChartHistogramLegendViewInfo) + protected + function GetItemClass: TcxGridChartLegendItemViewInfoClass; override; + public + procedure GetItemLegendKeyMarkerParams(AIndex: Integer; out AParams: TcxViewParams); virtual; + end; + + // line diagram + + TcxGridChartLineDiagramValueViewInfo = class(TcxGridChartHistogramValueViewInfo) + private + FLineStartY: Integer; + FLineFinishY: Integer; + function GetCaptionPosition: TcxGridChartLineDiagramValueCaptionPosition; + function GetDiagram: TcxGridChartLineDiagram; + function GetDiagramViewInfo: TcxGridChartLineDiagramViewInfo; + function GetLineStyle: TcxGridChartLineStyle; + function GetLineWidth: Integer; + function GetMarkerStyle: TcxGridChartMarkerStyle; + protected + function CalculateCaptionBounds: TRect; override; + procedure CalculateMarkerParams(var AParams: TcxViewParams); virtual; + procedure CalculateMarkerPoints; virtual; + procedure DoCalculateParams; override; + function GetCellBoundsForHint: TRect; override; + function GetDesignSelectionBounds: TRect; override; + function GetHotSpotBounds: TRect; virtual; + function GetLineColor: TColor; virtual; + function GetLineHotZoneMinWidth: Integer; virtual; + function GetLineStart: TPoint; virtual; + function GetLineFinish: TPoint; virtual; + function GetMarkerBounds: TRect; virtual; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + class function GetPainterClassEx: TcxGridChartLineDiagramValuePainterClass; virtual; + function GetPosition: TPoint; virtual; + procedure MakeRealBounds(var ABounds: TRect); + function HasBackground: Boolean; override; + function HasCaption: Boolean; override; + + property Diagram: TcxGridChartLineDiagram read GetDiagram; + property HotSpotBounds: TRect read GetHotSpotBounds; + property LineHotZoneMinWidth: Integer read GetLineHotZoneMinWidth; + public + MarkerParams: TcxViewParams; + MarkerPoints: TPointArray; + procedure Calculate(const ABounds: TRect; ALineStartY, ALineFinishY: Integer); virtual; + class procedure CalculateMarkerPointsEx(const ABounds: TRect; + AStyle: TcxGridChartMarkerStyle; var APoints: TPointArray); virtual; + function GetAreaBoundsForPainting: TRect; override; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + function GetRealBounds: TRect; + function HasPoint(const P: TPoint): Boolean; override; + + property CaptionPosition: TcxGridChartLineDiagramValueCaptionPosition read GetCaptionPosition; + property DiagramViewInfo: TcxGridChartLineDiagramViewInfo read GetDiagramViewInfo; + property LineColor: TColor read GetLineColor; + property LineStart: TPoint read GetLineStart; + property LineFinish: TPoint read GetLineFinish; + property LineStartY: Integer read FLineStartY; + property LineFinishY: Integer read FLineFinishY; + property LineStyle: TcxGridChartLineStyle read GetLineStyle; + property LineWidth: Integer read GetLineWidth; + property MarkerBounds: TRect read GetMarkerBounds; + property MarkerStyle: TcxGridChartMarkerStyle read GetMarkerStyle; + property Position: TPoint read GetPosition; + end; + + TcxGridChartLineDiagramViewInfo = class(TcxGridChartHistogramViewInfo) + private + function GetDiagram: TcxGridChartLineDiagram; + protected + function GetPainterClass: TcxCustomGridCellPainterClass; override; + + class function GetValueViewInfoClass: TcxGridChartDiagramValueViewInfoClass; override; + function GetValueViewInfoIndex(ASeriesIndex, AVisibleIndex: Integer): Integer; override; + + function GetCategoryTickMarkLabelOffsetUnits(AIndex: Integer): Integer; override; + function GetCategoryTickMarkOffsetUnits(AIndex: Integer; AValueAxisBetweenCategories: Boolean): Integer; override; + function GetUnitCount: Integer; override; + function GetValueOffsetUnits(AVisibleValueIndex, ASeriesIndex: Integer): Integer; virtual; + function IsEdgeCategoryTickMarkLabels: Boolean; override; + + function GetValueY(AVisibleValueIndex, ASeriesIndex: Integer): Integer; virtual; + + procedure CalculatePlotOffsets(APlotAreaWidth: Integer; var AOffsets: TRect); override; + procedure CalculateValues; override; + function GetValueBounds(AVisibleValueIndex, ASeriesIndex: Integer): TRect; virtual; + public + property Diagram: TcxGridChartLineDiagram read GetDiagram; + end; + + // area diagram legend + + TcxGridChartAreaDiagramLegendItemViewInfo = class(TcxGridChartLineDiagramLegendItemViewInfo) + protected + function CalculateHeight: Integer; override; + function CalculateLegendKeyHeight: Integer; override; + function CalculateLegendKeyWidth: Integer; override; + function GetLineColor: TColor; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + end; + + TcxGridChartAreaDiagramLegendViewInfo = class(TcxGridChartLineDiagramLegendViewInfo) + protected + function GetItemClass: TcxGridChartLegendItemViewInfoClass; override; + function GetItemsInReverseOrder: Boolean; override; + //function ItemLegendKeyBorderIsValueBorder: Boolean; override; + end; + + // area diagram + + TcxGridChartAreaDiagramValueViewInfo = class(TcxGridChartLineDiagramValueViewInfo) + private + function GetDiagram: TcxGridChartAreaDiagram; + protected + procedure CalculateAreaPoints; virtual; + function CustomDrawBackground(ACanvas: TcxCanvas): Boolean; override; + function GetAreaColor: TColor; virtual; + function GetHotSpotBounds: TRect; override; + function GetLineColor: TColor; override; + function GetLineHotZoneMinWidth: Integer; override; + class function GetPainterClassEx: TcxGridChartLineDiagramValuePainterClass; override; + function GetZeroValueOffset: Integer; virtual; + function HasCustomDrawBackground: Boolean; override; + + property Diagram: TcxGridChartAreaDiagram read GetDiagram; + property ZeroValueOffset: Integer read GetZeroValueOffset; + public + AreaPoints: TPointArray; + procedure Calculate(const ABounds: TRect; ALineStartY, ALineFinishY: Integer); override; + function CreateAreaRegion: TcxRegion; virtual; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + property AreaColor: TColor read GetAreaColor; + end; + + TcxGridChartAreaDiagramViewInfo = class(TcxGridChartLineDiagramViewInfo) + protected + function GetPainterClass: TcxCustomGridCellPainterClass; override; + class function GetValueViewInfoClass: TcxGridChartDiagramValueViewInfoClass; override; + end; + + // pie diagram legend + + TcxGridChartPieDiagramLegendViewInfo = class(TcxGridChartLegendViewInfo) + private + function GetDiagram: TcxGridChartPieDiagram; + protected + function GetItemObjectIndex(AIndex: Integer): Integer; override; + function GetKind: TcxGridChartLegendKind; override; + public + property Diagram: TcxGridChartPieDiagram read GetDiagram; + end; + + // pie diagram + + TcxGridChartPieDiagramValueViewInfo = class(TcxGridChartDiagramValueViewInfo) + private + FStartAngle: Integer; + FFinishAngle: Integer; + function GetCaptionPosition: TcxGridChartPieDiagramValueCaptionPosition; + function GetCenter: TPoint; + function GetDiagramViewInfo: TcxGridChartPieDiagramViewInfo; + function GetRadius: Integer; + protected + function CalculateCaptionBounds: TRect; override; + function CalculateCaptionCenter(AAngle, ACaptionWidth, ACaptionHeight: Integer): TPoint; virtual; + procedure CalculateLeaderLinePoints(AAngle: Integer); virtual; + function GetIsDesignSelected: Boolean; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function HasBackground: Boolean; override; + function HasCaption: Boolean; override; + procedure MakeCaptionVisible(var ACaptionBounds: TRect; AAngle: Integer); virtual; + public + LeaderLinePoints: TPointArray; + procedure Calculate(const R: TRect; AStartAngle, AFinishAngle: Integer); virtual; + function HasPoint(const P: TPoint): Boolean; override; + + property CaptionPosition: TcxGridChartPieDiagramValueCaptionPosition read GetCaptionPosition; + property Center: TPoint read GetCenter; + property DiagramViewInfo: TcxGridChartPieDiagramViewInfo read GetDiagramViewInfo; + property Radius: Integer read GetRadius; + property StartAngle: Integer read FStartAngle; + property FinishAngle: Integer read FFinishAngle; + end; + + TcxGridChartPieSeriesSiteCaptionViewInfoClass = class of TcxGridChartPieSeriesSiteCaptionViewInfo; + + TcxGridChartPieSeriesSiteCaptionViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FSiteViewInfo: TcxGridChartPieSeriesSiteViewInfo; + protected + function CalculateHeight: Integer; override; + function CustomDraw(ACanvas: TcxCanvas): Boolean; override; + function GetAlignmentHorz: TAlignment; override; + function GetBorderColor(AIndex: TcxBorder): TColor; override; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetText: string; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function GetVisible: Boolean; override; + function HasCustomDraw: Boolean; override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + public + constructor Create(ASiteViewInfo: TcxGridChartPieSeriesSiteViewInfo); reintroduce; virtual; + function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + property SiteViewInfo: TcxGridChartPieSeriesSiteViewInfo read FSiteViewInfo; + end; + + TcxGridChartPieSeriesSiteViewInfoClass = class of TcxGridChartPieSeriesSiteViewInfo; + + TcxGridChartPieSeriesSiteViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FCaptionBounds: TRect; + FCaptionViewInfo: TcxGridChartPieSeriesSiteCaptionViewInfo; + FDiagramViewInfo: TcxGridChartPieDiagramViewInfo; + FPieAreaBounds: TRect; + FSeries: TcxGridChartSeries; + function GetDiagram: TcxGridChartPieDiagram; + protected + Angles: array of Integer; + procedure CalculateAngles; virtual; + procedure CalculateCaptionAndPieAreaBounds(var ACaptionBounds, APieAreaBounds: TRect); virtual; + function CalculateContentBounds: TRect; override; + function CustomDraw(ACanvas: TcxCanvas): Boolean; override; + function GetBorderColor(AIndex: TcxBorder): TColor; override; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + function GetCaptionViewInfoClass: TcxGridChartPieSeriesSiteCaptionViewInfoClass; virtual; + function GetDesignSelectionBounds: TRect; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetIsDesignSelected: Boolean; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetValueViewInfo(AVisibleValueIndex: Integer): TcxGridChartPieDiagramValueViewInfo; + procedure GetViewParams(var AParams: TcxViewParams); override; + function GetVisible: Boolean; override; + function HasCustomDraw: Boolean; override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + + property CaptionBounds: TRect read FCaptionBounds; + property Diagram: TcxGridChartPieDiagram read GetDiagram; + public + constructor Create(ADiagramViewInfo: TcxGridChartPieDiagramViewInfo; ASeries: TcxGridChartSeries); reintroduce; virtual; + destructor Destroy; override; + procedure Calculate(const ABounds: TRect); override; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + function IsPieEmpty: Boolean; virtual; + function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + procedure Paint(ACanvas: TcxCanvas = nil); override; + property CaptionViewInfo: TcxGridChartPieSeriesSiteCaptionViewInfo read FCaptionViewInfo; + property DiagramViewInfo: TcxGridChartPieDiagramViewInfo read FDiagramViewInfo; + property PieAreaBounds: TRect read FPieAreaBounds; + property Series: TcxGridChartSeries read FSeries; + end; + + TcxGridChartPieDiagramViewInfo = class(TcxGridChartDiagramViewInfo) + private + FPieAreaValueCaptionCompensation: Integer; + FSeriesSiteViewInfos: TList; + function GetCaptionPosition: TcxGridChartPieDiagramValueCaptionPosition; + function GetDiagram: TcxGridChartPieDiagram; + function GetSeriesSiteViewInfo(Index: Integer): TcxGridChartPieSeriesSiteViewInfo; + function GetSeriesSiteViewInfoCount: Integer; + protected + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetSeriesSiteViewInfoClass: TcxGridChartPieSeriesSiteViewInfoClass; virtual; + class function GetValueViewInfoClass: TcxGridChartDiagramValueViewInfoClass; override; + function GetValueViewInfoIndex(ASeriesIndex, AVisibleIndex: Integer): Integer; override; + + function CalculatePieAreaValueCaptionCompensation: Integer; virtual; + function CalculateSeriesSiteViewInfoBounds(AIndex: Integer): TRect; virtual; + function CalculateValueCaptionMaxWidth: Integer; + function CalculateValueCaptionMaxHeight: Integer; + + property CaptionPosition: TcxGridChartPieDiagramValueCaptionPosition read GetCaptionPosition; + property PieAreaValueCaptionCompensation: Integer read FPieAreaValueCaptionCompensation; + public + constructor Create(AGridViewInfo: TcxCustomGridViewInfo; ADiagram: TcxGridChartDiagram); override; + destructor Destroy; override; + procedure Calculate(const ABounds: TRect); override; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + property Diagram: TcxGridChartPieDiagram read GetDiagram; + property SeriesSiteViewInfoCount: Integer read GetSeriesSiteViewInfoCount; + property SeriesSiteViewInfos[Index: Integer]: TcxGridChartPieSeriesSiteViewInfo read GetSeriesSiteViewInfo; + end; + + // toolbox + + TcxGridChartToolBoxItemAlignment = TcxGridChartPartPosition; // cppLeft, cppRight only + + TcxGridChartToolBoxItemViewInfoClass = class of TcxGridChartToolBoxItemViewInfo; + + TcxGridChartToolBoxItemViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FAlignment: TcxGridChartToolBoxItemAlignment; + FContainer: TcxGridChartToolBoxViewInfo; + function GetGridView: TcxGridChartView; + protected + procedure GetViewParams(var AParams: TcxViewParams); override; + public + constructor Create(AContainer: TcxGridChartToolBoxViewInfo; + AAlignment: TcxGridChartToolBoxItemAlignment); reintroduce; virtual; + property Alignment: TcxGridChartToolBoxItemAlignment read FAlignment write FAlignment; + property Container: TcxGridChartToolBoxViewInfo read FContainer; + property GridView: TcxGridChartView read GetGridView; + end; + + TcxGridChartToolBoxItemSeparatorViewInfoClass = class of TcxGridChartToolBoxItemSeparatorViewInfo; + + TcxGridChartToolBoxItemSeparatorViewInfo = class(TcxGridChartToolBoxItemViewInfo) + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function HasBackground: Boolean; override; + end; + + TcxGridChartToolBoxDataLevelActiveValueViewInfoClass = class of TcxGridChartToolBoxDataLevelActiveValueViewInfo; + + TcxGridChartToolBoxDataLevelActiveValueViewInfo = class(TcxCustomGridViewCellViewInfo, + IcxGridChartDataLevelActiveValuePopupOwner) + private + FCanShowDropDownWindow: Boolean; + FContainer: TcxGridChartToolBoxDataLevelInfoViewInfo; + function GetGridView: TcxGridChartView; + protected + { IcxGridChartDataLevelActiveValuePopupOwner } + function GetDataGroup: TcxGridChartDataGroup; + + function CalculateContentBounds: TRect; override; + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetAlignmentVert: TcxAlignmentVert; override; + function GetBorderColor(AIndex: TcxBorder): TColor; override; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetText: string; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + + function DropDownWindowExists: Boolean; override; + function GetDropDownWindow: TcxCustomGridPopup; override; + function GetDropDownWindowOwnerBounds: TRect; override; + public + constructor Create(AContainer: TcxGridChartToolBoxDataLevelInfoViewInfo); reintroduce; virtual; + property CanShowDropDownWindow: Boolean read FCanShowDropDownWindow; + property Container: TcxGridChartToolBoxDataLevelInfoViewInfo read FContainer; + property GridView: TcxGridChartView read GetGridView; + end; + + TcxGridChartToolBoxDataLevelInfoViewInfoClass = class of TcxGridChartToolBoxDataLevelInfoViewInfo; + + TcxGridChartToolBoxDataLevelInfoViewInfo = class(TcxGridChartToolBoxItemViewInfo) + private + FActiveValueViewInfo: TcxGridChartToolBoxDataLevelActiveValueViewInfo; + FDataLevel: Integer; + function GetActive: Boolean; + function GetDataLevelObject: TcxGridChartDataGroup; + protected + function CalculateActiveValueViewInfoBounds: TRect; virtual; + function CalculateContentBounds: TRect; override; + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetActiveValueViewInfoClass: TcxGridChartToolBoxDataLevelActiveValueViewInfoClass; virtual; + function GetAlignmentHorz: TAlignment; override; + function GetAlignmentVert: TcxAlignmentVert; override; + function GetBorderColor(AIndex: TcxBorder): TColor; override; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + function GetDesignObject: TPersistent; virtual; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetIsDesignSelected: Boolean; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetText: string; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function HasActiveValue: Boolean; virtual; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + public + constructor Create(AContainer: TcxGridChartToolBoxViewInfo; + AAlignment: TcxGridChartToolBoxItemAlignment; ADataLevel: Integer); reintroduce; virtual; + destructor Destroy; override; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + procedure Paint(ACanvas: TcxCanvas = nil); override; + property Active: Boolean read GetActive; + property ActiveValueViewInfo: TcxGridChartToolBoxDataLevelActiveValueViewInfo read FActiveValueViewInfo; + property DataLevel: Integer read FDataLevel; + property DataLevelObject: TcxGridChartDataGroup read GetDataLevelObject; + end; + + TcxGridChartToolBoxCustomizeButtonViewInfoClass = class of TcxGridChartToolBoxCustomizeButtonViewInfo; + + TcxGridChartToolBoxCustomizeButtonViewInfo = class(TcxGridChartToolBoxItemViewInfo) + private + function GetChecked: Boolean; + procedure SetChecked(Value: Boolean); + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function CaptureMouseOnPress: Boolean; override; + procedure Click; override; + function GetActualState: TcxGridCellState; override; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetHotTrack: Boolean; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetText: string; override; + function HasBackground: Boolean; override; + property Checked: Boolean read GetChecked write SetChecked; + end; + + TcxGridChartToolBoxDiagramSelectorViewInfoClass = class of TcxGridChartToolBoxDiagramSelectorViewInfo; + + TcxGridChartToolBoxDiagramSelectorViewInfo = class(TcxGridChartToolBoxItemViewInfo) + private + FCanShowDropDownWindow: Boolean; + function GetDropDownWindowValue: TcxGridChartDiagramSelectorPopup; + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetAlignmentVert: TcxAlignmentVert; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetImageBounds: TRect; virtual; + function GetImageHeight: Integer; virtual; + function GetImageIndex: Integer; virtual; + function GetImageWidth: Integer; virtual; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetText: string; override; + function GetTextAreaBounds: TRect; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function HasBackground: Boolean; override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + + function CalculateCanShowDropDownWindow: Boolean; virtual; + function DropDownWindowExists: Boolean; override; + function GetDropDownWindow: TcxCustomGridPopup; override; + function GetDropDownWindowOwnerBounds: TRect; override; + property DropDownWindow: TcxGridChartDiagramSelectorPopup read GetDropDownWindowValue; + + property ImageWidth: Integer read GetImageWidth; + property ImageHeight: Integer read GetImageHeight; + public + constructor Create(AContainer: TcxGridChartToolBoxViewInfo; + AAlignment: TcxGridChartToolBoxItemAlignment); override; + property CanShowDropDownWindow: Boolean read FCanShowDropDownWindow; + property ImageBounds: TRect read GetImageBounds; + property ImageIndex: Integer read GetImageIndex; + end; + + TcxGridChartToolBoxViewInfoClass = class of TcxGridChartToolBoxViewInfo; + + TcxGridChartToolBoxViewInfo = class(TcxCustomGridChartPartViewInfo) + private + FCustomizeButton: TcxGridChartToolBoxCustomizeButtonViewInfo; + FDataLevelInfos: TList; + FDiagramSelector: TcxGridChartToolBoxDiagramSelectorViewInfo; + FItems: TList; + function GetCount: Integer; + function GetDataLevelInfoConnectorCount: Integer; + function GetDataLevelInfo(AIndex: Integer): TcxGridChartToolBoxDataLevelInfoViewInfo; + function GetDataLevelInfoCount: Integer; + function GetItem(AIndex: Integer): TcxGridChartToolBoxItemViewInfo; + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function CalculateContentBounds: TRect; override; + procedure CalculateItems; virtual; + function GetAlignment: TcxGridChartPartAlignment; override; + function GetAlignmentVert: TcxAlignmentVert; override; + function GetBorders: TcxBorders; override; + function GetBorderColor(AIndex: TcxBorder): TColor; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + function GetDataGroupInsertionAreaBounds: TRect; virtual; + function GetDataLevelInfoConnector(AIndex: Integer): TRect; virtual; + function GetDataLevelInfoConnectorColor: TColor; virtual; + function GetFirstSeparator: TcxGridChartToolBoxItemViewInfo; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetItemsAreaBounds: TRect; virtual; + function GetOrientation: TcxGridChartPartOrientation; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetPosition: TcxGridChartPartPosition; override; + function GetText: string; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function GetVisible: Boolean; override; + + function AddItem(AItem: TcxGridChartToolBoxItemViewInfo): TcxGridChartToolBoxItemViewInfo; + procedure AddSeparator(AAlignment: TcxGridChartToolBoxItemAlignment); + procedure CreateItems; virtual; + function GetCustomizeButtonClass: TcxGridChartToolBoxCustomizeButtonViewInfoClass; virtual; + function GetDataLevelInfoClass: TcxGridChartToolBoxDataLevelInfoViewInfoClass; virtual; + function GetDiagramSelectorClass: TcxGridChartToolBoxDiagramSelectorViewInfoClass; virtual; + function GetItemSeparatorClass: TcxGridChartToolBoxItemSeparatorViewInfoClass; virtual; + function IsCustomizeButtonVisible: Boolean; virtual; + function IsDataLevelsInfoVisible: Boolean; virtual; + function IsDiagramSelectorVisible: Boolean; virtual; + function IsSeparator(AItem: TcxGridChartToolBoxItemViewInfo): Boolean; + + property ItemsAreaBounds: TRect read GetItemsAreaBounds; + public + constructor Create(AGridViewInfo: TcxCustomGridViewInfo); override; + destructor Destroy; override; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + function GetDataGroupInsertionBounds(AIndex: Integer): TRect; virtual; + function GetDataGroupInsertionIndex(const P: TPoint): Integer; virtual; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + procedure InvalidateCustomizeButton; + property Count: Integer read GetCount; + property CustomizeButton: TcxGridChartToolBoxCustomizeButtonViewInfo read FCustomizeButton; + property DataLevelInfoConnectorColor: TColor read GetDataLevelInfoConnectorColor; + property DataLevelInfoConnectorCount: Integer read GetDataLevelInfoConnectorCount; + property DataLevelInfoConnectors[AIndex: Integer]: TRect read GetDataLevelInfoConnector; + property DataLevelInfoCount: Integer read GetDataLevelInfoCount; + property DataLevelInfos[AIndex: Integer]: TcxGridChartToolBoxDataLevelInfoViewInfo read GetDataLevelInfo; + property DiagramSelector: TcxGridChartToolBoxDiagramSelectorViewInfo read FDiagramSelector; + property Items[AIndex: Integer]: TcxGridChartToolBoxItemViewInfo read GetItem; + end; + + // view + + TcxGridChartTitleViewInfoClass = class of TcxGridChartTitleViewInfo; + + TcxGridChartTitleViewInfo = class(TcxCustomGridChartTitleViewInfo) + protected + function GetHitTestClass: TcxCustomGridHitTestClass; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + end; + + TcxGridChartViewInfo = class(TcxCustomGridViewInfo) + private + FDiagramViewInfo: TcxGridChartDiagramViewInfo; + FIsImage: Boolean; + FLegendViewInfo: TcxGridChartLegendViewInfo; + FTitleViewInfo: TcxGridChartTitleViewInfo; + FToolBoxViewInfo: TcxGridChartToolBoxViewInfo; + function GetGridView: TcxGridChartView; + protected + procedure CreateViewInfos; override; + procedure DestroyViewInfos(AIsRecreating: Boolean); override; + + function GetTitleViewInfoClass: TcxGridChartTitleViewInfoClass; virtual; + function GetToolBoxViewInfoClass: TcxGridChartToolBoxViewInfoClass; virtual; + + procedure Calculate; override; + function CalculateClientBounds: TRect; override; + procedure CalculateHeight(const AMaxSize: TPoint; var AHeight: Integer; + var AFullyVisible: Boolean); override; + procedure CalculatePartBounds(APart: TcxCustomGridChartPartViewInfo; + var ABounds, APartBounds: TRect); virtual; + procedure CalculatePartsBounds(out ADiagramBounds, ALegendBounds, ATitleBounds, + AToolBoxBounds: TRect); virtual; + function DoGetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + + property IsImage: Boolean read FIsImage write FIsImage; + public + property DiagramViewInfo: TcxGridChartDiagramViewInfo read FDiagramViewInfo; + property GridView: TcxGridChartView read GetGridView; + property LegendViewInfo: TcxGridChartLegendViewInfo read FLegendViewInfo; + property TitleViewInfo: TcxGridChartTitleViewInfo read FTitleViewInfo; + property ToolBoxViewInfo: TcxGridChartToolBoxViewInfo read FToolBoxViewInfo; + end; + + { view } + + // custom title + + TcxCustomGridChartTitle = class(TcxCustomGridOptions) + private + FAlignment: TcxGridChartPartAlignment; + FPosition: TcxGridChartPartPosition; + FText: string; + procedure SetAlignment(Value: TcxGridChartPartAlignment); + procedure SetPosition(Value: TcxGridChartPartPosition); + procedure SetText(Value: string); + protected + procedure GetStoredProperties(AProperties: TStrings); override; + procedure GetStoredPropertyValue(const AName: string; var AValue: Variant); override; + procedure SetStoredPropertyValue(const AName: string; const AValue: Variant); override; + + function GetDefaultAlignment: TcxGridChartPartAlignment; virtual; + function GetDefaultOrientation: TcxGridChartPartOrientation; virtual; + function GetDefaultPosition: TcxGridChartPartPosition; virtual; abstract; + function GetDefaultText: string; virtual; + + property Position: TcxGridChartPartPosition read FPosition write SetPosition default cppDefault; + public + procedure Assign(Source: TPersistent); override; + function GetAlignment: TcxGridChartPartAlignment; + function GetOrientation: TcxGridChartPartOrientation; + function GetPosition: TcxGridChartPartPosition; + function GetText: string; + published + property Alignment: TcxGridChartPartAlignment read FAlignment write SetAlignment default cpaDefault; + property Text: string read FText write SetText; + end; + + // legend + + TcxGridChartLegendBorder = (lbDefault, lbNone, lbSingle); + + TcxGridChartLegendClass = class of TcxGridChartLegend; + + TcxGridChartLegend = class(TcxCustomGridOptions) + private + FAlignment: TcxGridChartPartAlignment; + FBorder: TcxGridChartLegendBorder; + FKeyBorder: TcxGridChartLegendBorder; + FOrientation: TcxGridChartPartOrientation; + FParent: TcxGridChartLegend; + FPosition: TcxGridChartPartPosition; + procedure SetAlignment(Value: TcxGridChartPartAlignment); + procedure SetBorder(Value: TcxGridChartLegendBorder); + procedure SetKeyBorder(Value: TcxGridChartLegendBorder); + procedure SetOrientation(Value: TcxGridChartPartOrientation); + procedure SetPosition(Value: TcxGridChartPartPosition); + protected + procedure GetStoredProperties(AProperties: TStrings); override; + procedure GetStoredPropertyValue(const AName: string; var AValue: Variant); override; + procedure SetStoredPropertyValue(const AName: string; const AValue: Variant); override; + + function GetDefaultAlignment: TcxGridChartPartAlignment; virtual; + function GetDefaultBorder: TcxGridChartLegendBorder; virtual; + function GetDefaultKeyBorder: TcxGridChartLegendBorder; virtual; + function GetDefaultOrientation(APosition: TcxGridChartPartPosition): TcxGridChartPartOrientation; virtual; + function GetDefaultPosition: TcxGridChartPartPosition; virtual; + property Parent: TcxGridChartLegend read FParent write FParent; + public + procedure Assign(Source: TPersistent); override; + function GetAlignment: TcxGridChartPartAlignment; + function GetBorder: TcxGridChartLegendBorder; + function GetKeyBorder: TcxGridChartLegendBorder; + function GetOrientation(APosition: TcxGridChartPartPosition = cppDefault): TcxGridChartPartOrientation; + function GetPosition: TcxGridChartPartPosition; + published + property Alignment: TcxGridChartPartAlignment read FAlignment write SetAlignment default cpaDefault; + property Border: TcxGridChartLegendBorder read FBorder write SetBorder default lbDefault; + property KeyBorder: TcxGridChartLegendBorder read FKeyBorder write SetKeyBorder default lbDefault; + property Orientation: TcxGridChartPartOrientation read FOrientation + write SetOrientation default cpoDefault; + property Position: TcxGridChartPartPosition read FPosition write SetPosition default cppDefault; + end; + + // diagram + + TcxGridDiagramChange = (dcProperty, dcLayout, dcSize); + + TcxCustomGridChartDiagramOptions = class(TPersistent) + private + FDiagram: TcxGridChartDiagram; + function GetGridView: TcxGridChartView; + function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; + protected + procedure Changed(AChange: TcxGridDiagramChange = dcLayout); virtual; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter; + public + constructor Create(ADiagram: TcxGridChartDiagram); virtual; + procedure Assign(Source: TPersistent); override; + property Diagram: TcxGridChartDiagram read FDiagram; + property GridView: TcxGridChartView read GetGridView; + end; + + TcxGridChartDiagramStylesClass = class of TcxGridChartDiagramStyles; + + TcxGridChartDiagramStyles = class(TcxCustomGridStyles) + private + function GetDiagram: TcxGridChartDiagram; + function GetGridViewValue: TcxGridChartView; + protected + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + function GetGridView: TcxCustomGridView; override; + function GetVaryColorsByCategory: Boolean; virtual; abstract; + public + constructor Create(AOwner: TPersistent); override; + procedure GetBackgroundParams(out AParams: TcxViewParams); virtual; + procedure GetValueParams(AVisibleSeriesIndex, AValueIndex: Integer; + out AParams: TcxViewParams); virtual; + procedure Assign(Source: TPersistent); override; + property Diagram: TcxGridChartDiagram read GetDiagram; + property GridView: TcxGridChartView read GetGridViewValue; + published + property Legend: TcxStyle index dsLegend read GetValue write SetValue; + property ValueCaptions: TcxStyle index dsValueCaptions read GetValue write SetValue; + property Values: TcxStyle index dsValues read GetValue write SetValue; + end; + + TcxGridChartDiagramLegendCustomDrawEvent = procedure(Sender: TcxGridChartDiagram; + ACanvas: TcxCanvas; AViewInfo: TcxGridChartLegendViewInfo; var ADone: Boolean) of object; + TcxGridChartDiagramLegendItemCustomDrawEvent = procedure(Sender: TcxGridChartDiagram; + ACanvas: TcxCanvas; AViewInfo: TcxGridChartLegendItemViewInfo; var ADone: Boolean) of object; + TcxGridChartDiagramValueCustomDrawEvent = procedure(Sender: TcxGridChartDiagram; + ACanvas: TcxCanvas; AViewInfo: TcxGridChartDiagramValueViewInfo; var ADone: Boolean) of object; + + TcxGridChartDiagramClass = class of TcxGridChartDiagram; + + TcxGridChartDiagram = class(TPersistent) + private + FEnabled: Boolean; + FGridView: TcxGridChartView; + FLegend: TcxGridChartLegend; + FStyles: TcxGridChartDiagramStyles; + FOnCustomDrawLegend: TcxGridChartDiagramLegendCustomDrawEvent; + FOnCustomDrawLegendItem: TcxGridChartDiagramLegendItemCustomDrawEvent; + FOnCustomDrawValue: TcxGridChartDiagramValueCustomDrawEvent; + function GetActive: Boolean; + function GetID: string; + procedure SetActive(Value: Boolean); + procedure SetEnabled(Value: Boolean); + procedure SetLegend(Value: TcxGridChartLegend); + procedure SetStyles(Value: TcxGridChartDiagramStyles); + procedure SetOnCustomDrawLegend(Value: TcxGridChartDiagramLegendCustomDrawEvent); + procedure SetOnCustomDrawLegendItem(Value: TcxGridChartDiagramLegendItemCustomDrawEvent); + procedure SetOnCustomDrawValue(Value: TcxGridChartDiagramValueCustomDrawEvent); + protected + FSubClassEvents: TNotifyEvent; + function GetOwner: TPersistent; override; + + procedure CreateSubObjects(AGridView: TcxGridChartView); virtual; + procedure DestroySubObjects; virtual; + procedure SetGridView(Value: TcxGridChartView); + + function GetStylesClass: TcxGridChartDiagramStylesClass; virtual; + + function GetLegendViewInfoClass: TcxGridChartLegendViewInfoClass; virtual; abstract; + function GetViewInfoClass: TcxGridChartDiagramViewInfoClass; virtual; abstract; + + procedure Changed(AChange: TcxGridDiagramChange = dcLayout); virtual; + function GetDisplayText: string; virtual; + function GetImageIndex: Integer; virtual; + function HorizontalPaging: Boolean; virtual; + function PagingInOppositeDirection: Boolean; virtual; + function SupportsPaging: Boolean; virtual; + function SupportsValueHotTrack: Boolean; virtual; + + procedure DoCustomDrawLegend(ACanvas: TcxCanvas; AViewInfo: TcxGridChartLegendViewInfo; + var ADone: Boolean); virtual; + procedure DoCustomDrawLegendItem(ACanvas: TcxCanvas; AViewInfo: TcxGridChartLegendItemViewInfo; + var ADone: Boolean); virtual; + procedure DoCustomDrawValue(ACanvas: TcxCanvas; AViewInfo: TcxGridChartDiagramValueViewInfo; + var ADone: Boolean); virtual; + function HasCustomDrawLegend: Boolean; virtual; + function HasCustomDrawLegendItem: Boolean; virtual; + function HasCustomDrawValue: Boolean; virtual; + + property ImageIndex: Integer read GetImageIndex; + property Styles: TcxGridChartDiagramStyles read FStyles write SetStyles; + public + constructor Create(AGridView: TcxGridChartView); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function GetNamePath: string; override; + function GetValueCaption(ASeries: TcxGridChartSeries; AValueIndex: Integer): string; virtual; + function IsAvailable: Boolean; virtual; + property DisplayText: string read GetDisplayText; + property GridView: TcxGridChartView read FGridView; + property ID: string read GetID; + published + property Active: Boolean read GetActive write SetActive default False; + property Enabled: Boolean read FEnabled write SetEnabled default True; + property Legend: TcxGridChartLegend read FLegend write SetLegend; + property OnCustomDrawLegend: TcxGridChartDiagramLegendCustomDrawEvent read FOnCustomDrawLegend + write SetOnCustomDrawLegend; + property OnCustomDrawLegendItem: TcxGridChartDiagramLegendItemCustomDrawEvent + read FOnCustomDrawLegendItem write SetOnCustomDrawLegendItem; + property OnCustomDrawValue: TcxGridChartDiagramValueCustomDrawEvent read FOnCustomDrawValue + write SetOnCustomDrawValue; + end; + + // histogram + + TcxGridChartHistogramAxisTitleClass = class of TcxGridChartHistogramAxisTitle; + + TcxGridChartHistogramAxisTitle = class(TcxCustomGridChartTitle) + private + FAxis: TcxGridChartHistogramAxis; + protected + function GetDefaultPosition: TcxGridChartPartPosition; override; + function GetDefaultText: string; override; + function GetGridViewValue: TcxCustomGridView; override; + public + constructor Create(AAxis: TcxGridChartHistogramAxis); reintroduce; virtual; + property Axis: TcxGridChartHistogramAxis read FAxis; + end; + + TcxGridChartHistogramTickMarkKind = (tmkNone, tmkCross, tmkInside, tmkOutside); + + TcxGridChartHistogramAxis = class(TcxCustomGridChartDiagramOptions) + private + FGridLines: Boolean; + FTickMarkKind: TcxGridChartHistogramTickMarkKind; + FTickMarkLabels: Boolean; + FTitle: TcxGridChartHistogramAxisTitle; + FVisible: Boolean; + function GetDiagram: TcxGridChartHistogram; + procedure SetGridLines(Value: Boolean); + procedure SetTickMarkKind(Value: TcxGridChartHistogramTickMarkKind); + procedure SetTickMarkLabels(Value: Boolean); + procedure SetTitle(Value: TcxGridChartHistogramAxisTitle); + procedure SetVisible(Value: Boolean); + protected + function GetTitleClass: TcxGridChartHistogramAxisTitleClass; virtual; + function GetTitleDefaultText: string; virtual; + public + constructor Create(ADiagram: TcxGridChartDiagram); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function GetPosition: TcxGridChartAxisPosition; virtual; abstract; + property Diagram: TcxGridChartHistogram read GetDiagram; + published + property GridLines: Boolean read FGridLines write SetGridLines default True; + property TickMarkKind: TcxGridChartHistogramTickMarkKind read FTickMarkKind + write SetTickMarkKind default tmkOutside; + property TickMarkLabels: Boolean read FTickMarkLabels write SetTickMarkLabels default True; + property Title: TcxGridChartHistogramAxisTitle read FTitle write SetTitle; + property Visible: Boolean read FVisible write SetVisible default True; + end; + + TcxGridChartHistogramAxisCategoryClass = class of TcxGridChartHistogramAxisCategory; + + TcxGridChartHistogramAxisCategory = class(TcxGridChartHistogramAxis) + private + FCategoriesInReverseOrder: Boolean; + FValueAxisAtMaxCategory: Boolean; + FValueAxisBetweenCategories: Boolean; + procedure SetCategoriesInReverseOrder(Value: Boolean); + procedure SetValueAxisAtMaxCategory(Value: Boolean); + procedure SetValueAxisBetweenCategories(Value: Boolean); + protected + function GetDefaultValueAxisBetweenCategories: Boolean; virtual; + function GetTitleDefaultText: string; override; + public + constructor Create(ADiagram: TcxGridChartDiagram); override; + procedure Assign(Source: TPersistent); override; + function GetPosition: TcxGridChartAxisPosition; override; + published + property CategoriesInReverseOrder: Boolean read FCategoriesInReverseOrder + write SetCategoriesInReverseOrder default False; + property ValueAxisAtMaxCategory: Boolean read FValueAxisAtMaxCategory + write SetValueAxisAtMaxCategory default False; + property ValueAxisBetweenCategories: Boolean read FValueAxisBetweenCategories + write SetValueAxisBetweenCategories default True; + end; + + TcxGridChartHistogramMinMaxValues = (mmvZeroBasedAuto, mmvAuto, mmvCustom); + + TcxGridChartHistogramAxisValueClass = class of TcxGridChartHistogramAxisValue; + + TcxGridChartHistogramAxisValue = class(TcxGridChartHistogramAxis) + private + FMaxValue: Extended; + FMinMaxValues: TcxGridChartHistogramMinMaxValues; + FMinValue: Extended; + FTickMarkLabelFormat: string; + procedure SetMaxValue(const Value: Extended); + procedure SetMinMaxValues(Value: TcxGridChartHistogramMinMaxValues); + procedure SetMinValue(const Value: Extended); + procedure SetTickMarkLabelFormat(const Value: string); + protected + function GetTitleDefaultText: string; override; + public + procedure Assign(Source: TPersistent); override; + function GetPosition: TcxGridChartAxisPosition; override; + function GetTickMarkLabel(const ATickMarkValue: Variant): string; virtual; + function GetTickMarkLabelFormat(AConsiderSeriesFormat: Boolean): string; virtual; + published + property MinMaxValues: TcxGridChartHistogramMinMaxValues read FMinMaxValues + write SetMinMaxValues default mmvZeroBasedAuto; + property MinValue: Extended read FMinValue write SetMinValue; + property MaxValue: Extended read FMaxValue write SetMaxValue; + property TickMarkLabelFormat: string read FTickMarkLabelFormat write SetTickMarkLabelFormat; + end; + + TcxGridChartHistogramStyles = class(TcxGridChartDiagramStyles) + protected + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + function GetVaryColorsByCategory: Boolean; override; + public + procedure Assign(Source: TPersistent); override; + published + property Axis: TcxStyle index dsAxis read GetValue write SetValue; + property AxisTitle: TcxStyle index dsAxisTitle read GetValue write SetValue; + property CategoryAxis: TcxStyle index dsCategoryAxis read GetValue write SetValue; + property CategoryAxisTitle: TcxStyle index dsCategoryAxisTitle read GetValue write SetValue; + property CategoryGridLines: TcxStyle index dsCategoryGridLines read GetValue write SetValue; + property GridLines: TcxStyle index dsGridLines read GetValue write SetValue; + property Plot: TcxStyle index dsPlot read GetValue write SetValue; + property ValueAxis: TcxStyle index dsValueAxis read GetValue write SetValue; + property ValueAxisTitle: TcxStyle index dsValueAxisTitle read GetValue write SetValue; + property ValueGridLines: TcxStyle index dsValueGridLines read GetValue write SetValue; + end; + + TcxGridChartValuesStacking = (vsNone, vsNormal, vs100Percent); + + TcxGridChartHistogramValuesClass = class of TcxGridChartHistogramValues; + + TcxGridChartHistogramValues = class(TcxCustomGridChartDiagramOptions) + private + FStacking: TcxGridChartValuesStacking; + FVaryColorsByCategory: Boolean; + procedure SetStacking(Value: TcxGridChartValuesStacking); + procedure SetVaryColorsByCategory(Value: Boolean); + protected + property Stacking: TcxGridChartValuesStacking read FStacking write SetStacking default vsNone; + public + procedure Assign(Source: TPersistent); override; + function GetVaryColorsByCategory: Boolean; virtual; + published + property VaryColorsByCategory: Boolean read FVaryColorsByCategory write SetVaryColorsByCategory default False; + end; + + TcxGridChartHistogramPlotCustomDrawEvent = procedure(Sender: TcxGridChartHistogram; + ACanvas: TcxCanvas; AViewInfo: TcxGridChartHistogramViewInfo; + const ABounds: TRect; var ADone: Boolean) of object; + + TcxGridChartHistogram = class(TcxGridChartDiagram) + private + FAxisCategory: TcxGridChartHistogramAxisCategory; + FAxisValue: TcxGridChartHistogramAxisValue; + FValues: TcxGridChartHistogramValues; + FOnCustomDrawPlot: TcxGridChartHistogramPlotCustomDrawEvent; + function GetStyles: TcxGridChartHistogramStyles; + procedure SetAxisCategory(Value: TcxGridChartHistogramAxisCategory); + procedure SetAxisValue(Value: TcxGridChartHistogramAxisValue); + procedure SetStyles(Value: TcxGridChartHistogramStyles); + procedure SetValues(Value: TcxGridChartHistogramValues); + procedure SetOnCustomDrawPlot(Value: TcxGridChartHistogramPlotCustomDrawEvent); + protected + procedure CreateSubObjects(AGridView: TcxGridChartView); override; + procedure DestroySubObjects; override; + + function GetAxisCategoryClass: TcxGridChartHistogramAxisCategoryClass; virtual; + function GetAxisValueClass: TcxGridChartHistogramAxisValueClass; virtual; + function GetStylesClass: TcxGridChartDiagramStylesClass; override; + function GetValuesClass: TcxGridChartHistogramValuesClass; virtual; + + function GetLegendViewInfoClass: TcxGridChartLegendViewInfoClass; override; + + function PagingInOppositeDirection: Boolean; override; + function SupportsPaging: Boolean; override; + + procedure DoCustomDrawPlot(ACanvas: TcxCanvas; AViewInfo: TcxGridChartHistogramViewInfo; + const ABounds: TRect; var ADone: Boolean); virtual; + function HasCustomDrawPlot: Boolean; virtual; + public + procedure Assign(Source: TPersistent); override; + function GetCategoryAxisPosition: TcxGridChartAxisPosition; virtual; + function GetValueAxisPosition: TcxGridChartAxisPosition; virtual; + + property AxisCategory: TcxGridChartHistogramAxisCategory read FAxisCategory write SetAxisCategory; + property AxisValue: TcxGridChartHistogramAxisValue read FAxisValue write SetAxisValue; + property Styles: TcxGridChartHistogramStyles read GetStyles write SetStyles; + property Values: TcxGridChartHistogramValues read FValues write SetValues; + property ValuesEvents: TNotifyEvent read FSubClassEvents write FSubClassEvents; + published + property OnCustomDrawPlot: TcxGridChartHistogramPlotCustomDrawEvent read FOnCustomDrawPlot + write SetOnCustomDrawPlot; + end; + + // column diagram + + TcxGridChartColumnDiagramValues = class(TcxGridChartHistogramValues) + private + FBorderWidth: Integer; + FCaptionPosition: TcxGridChartColumnDiagramValueCaptionPosition; + procedure SetBorderWidth(Value: Integer); + procedure SetCaptionPosition(Value: TcxGridChartColumnDiagramValueCaptionPosition); + public + constructor Create(ADiagram: TcxGridChartDiagram); override; + procedure Assign(Source: TPersistent); override; + published + property BorderWidth: Integer read FBorderWidth write SetBorderWidth default cxGridChartColumnDiagramDefaultBorderWidth; + property CaptionPosition: TcxGridChartColumnDiagramValueCaptionPosition read FCaptionPosition + write SetCaptionPosition default cdvcpNone; + end; + + TcxGridChartColumnDiagramClass = class of TcxGridChartColumnDiagram; + + TcxGridChartColumnDiagram = class(TcxGridChartHistogram) + private + function GetValues: TcxGridChartColumnDiagramValues; + procedure SetValues(Value: TcxGridChartColumnDiagramValues); + protected + function GetLegendViewInfoClass: TcxGridChartLegendViewInfoClass; override; + function GetValuesClass: TcxGridChartHistogramValuesClass; override; + function GetViewInfoClass: TcxGridChartDiagramViewInfoClass; override; + + function GetDisplayText: string; override; + function GetImageIndex: Integer; override; + published + property AxisCategory; + property AxisValue; + property Styles; + property Values: TcxGridChartColumnDiagramValues read GetValues write SetValues; + end; + + // bar diagram + + TcxGridChartBarDiagramClass = class of TcxGridChartBarDiagram; + + TcxGridChartBarDiagram = class(TcxGridChartColumnDiagram) + protected + function GetDisplayText: string; override; + function GetImageIndex: Integer; override; + + function HorizontalPaging: Boolean; override; + function PagingInOppositeDirection: Boolean; override; + public + function GetCategoryAxisPosition: TcxGridChartAxisPosition; override; + function GetValueAxisPosition: TcxGridChartAxisPosition; override; + end; + + // line diagram + + TcxGridChartLineDiagramAxisCategory = class(TcxGridChartHistogramAxisCategory) + protected + function GetDefaultValueAxisBetweenCategories: Boolean; override; + published + property ValueAxisBetweenCategories default False; + end; + + TcxGridChartLineDiagramStyles = class(TcxGridChartHistogramStyles) + protected + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + function ValueMarkerHasBorderByDefault: Boolean; virtual; + public + procedure Assign(Source: TPersistent); override; + procedure GetValueMarkerParams(AVisibleSeriesIndex, AValueIndex: Integer; + out AParams: TcxViewParams); virtual; + published + property ValueMarkers: TcxStyle index dsValueMarkers read GetValue write SetValue; + end; + + TcxGridChartLineDiagramGetLineStyleEvent = procedure(Sender: TcxGridChartLineDiagram; + ASeries: TcxGridChartSeries; var AStyle: TcxGridChartLineStyle) of object; + TcxGridChartLineDiagramGetMarkerStyleEvent = procedure(Sender: TcxGridChartLineDiagram; + ASeries: TcxGridChartSeries; var AStyle: TcxGridChartMarkerStyle) of object; + + TcxGridChartLineDiagramValues = class(TcxGridChartHistogramValues) + private + FCaptionPosition: TcxGridChartLineDiagramValueCaptionPosition; + FHotSpotSize: Integer; + FLineStyle: TcxGridChartLineStyle; + FLineWidth: Integer; + FMarkerSize: Integer; + FMarkerStyle: TcxGridChartMarkerStyle; + FOnGetLineStyle: TcxGridChartLineDiagramGetLineStyleEvent; + FOnGetMarkerStyle: TcxGridChartLineDiagramGetMarkerStyleEvent; + function GetDiagram: TcxGridChartLineDiagram; + procedure SetCaptionPosition(Value: TcxGridChartLineDiagramValueCaptionPosition); + procedure SetHotSpotSize(Value: Integer); + procedure SetLineStyle(Value: TcxGridChartLineStyle); + procedure SetLineWidth(Value: Integer); + procedure SetMarkerSize(Value: Integer); + procedure SetMarkerStyle(Value: TcxGridChartMarkerStyle); + procedure SetOnGetLineStyle(Value: TcxGridChartLineDiagramGetLineStyleEvent); + procedure SetOnGetMarkerStyle(Value: TcxGridChartLineDiagramGetMarkerStyleEvent); + protected + procedure DoGetLineStyle(ASeries: TcxGridChartSeries; var AStyle: TcxGridChartLineStyle); virtual; + procedure DoGetMarkerStyle(ASeries: TcxGridChartSeries; var AStyle: TcxGridChartMarkerStyle); virtual; + public + constructor Create(ADiagram: TcxGridChartDiagram); override; + procedure Assign(Source: TPersistent); override; + function GetHotSpotSize: Integer; virtual; + function GetLineStyle(ASeries: TcxGridChartSeries): TcxGridChartLineStyle; virtual; + function GetMarkerStyle(ASeries: TcxGridChartSeries): TcxGridChartMarkerStyle; virtual; + property Diagram: TcxGridChartLineDiagram read GetDiagram; + published + property CaptionPosition: TcxGridChartLineDiagramValueCaptionPosition read FCaptionPosition + write SetCaptionPosition default ldvcpNone; + property HotSpotSize: Integer read FHotSpotSize write SetHotSpotSize default cxGridChartLineDiagramDefaultHotSpotSize; + property LineStyle: TcxGridChartLineStyle read FLineStyle write SetLineStyle default clsSolid; + property LineWidth: Integer read FLineWidth write SetLineWidth default cxGridChartLineDiagramDefaultLineWidth; + property MarkerSize: Integer read FMarkerSize write SetMarkerSize default cxGridChartLineDiagramDefaultMarkerSize; + property MarkerStyle: TcxGridChartMarkerStyle read FMarkerStyle write SetMarkerStyle default cmsNone; + property Stacking; + property OnGetLineStyle: TcxGridChartLineDiagramGetLineStyleEvent read FOnGetLineStyle write SetOnGetLineStyle; + property OnGetMarkerStyle: TcxGridChartLineDiagramGetMarkerStyleEvent read FOnGetMarkerStyle write SetOnGetMarkerStyle; + end; + + TcxGridChartLineDiagramClass = class of TcxGridChartLineDiagram; + + TcxGridChartLineDiagram = class(TcxGridChartHistogram) + private + function GetAxisCategory: TcxGridChartLineDiagramAxisCategory; + function GetStyles: TcxGridChartLineDiagramStyles; + function GetValues: TcxGridChartLineDiagramValues; + procedure SetAxisCategory(Value: TcxGridChartLineDiagramAxisCategory); + procedure SetStyles(Value: TcxGridChartLineDiagramStyles); + procedure SetValues(Value: TcxGridChartLineDiagramValues); + protected + function GetAxisCategoryClass: TcxGridChartHistogramAxisCategoryClass; override; + function GetLegendViewInfoClass: TcxGridChartLegendViewInfoClass; override; + function GetStylesClass: TcxGridChartDiagramStylesClass; override; + function GetValuesClass: TcxGridChartHistogramValuesClass; override; + function GetViewInfoClass: TcxGridChartDiagramViewInfoClass; override; + + function GetDisplayText: string; override; + function GetImageIndex: Integer; override; + function SupportsValueHotTrack: Boolean; override; + published + property AxisCategory: TcxGridChartLineDiagramAxisCategory read GetAxisCategory write SetAxisCategory; + property AxisValue; + property Styles: TcxGridChartLineDiagramStyles read GetStyles write SetStyles; + property Values: TcxGridChartLineDiagramValues read GetValues write SetValues; + property ValuesEvents; + end; + + // area diagram + + TcxGridChartAreaDiagramStyles = class(TcxGridChartLineDiagramStyles) + protected + function ValueMarkerHasBorderByDefault: Boolean; override; + end; + + TcxGridChartAreaDiagramValueAreaCustomDrawEvent = procedure(Sender: TcxGridChartAreaDiagram; + ACanvas: TcxCanvas; AViewInfo: TcxGridChartAreaDiagramValueViewInfo; var ADone: Boolean) of object; + + TcxGridChartAreaDiagramClass = class of TcxGridChartAreaDiagram; + + TcxGridChartAreaDiagram = class(TcxGridChartLineDiagram) + private + FOnCustomDrawValueArea: TcxGridChartAreaDiagramValueAreaCustomDrawEvent; + function GetStyles: TcxGridChartAreaDiagramStyles; + procedure SetStyles(Value: TcxGridChartAreaDiagramStyles); + procedure SetOnCustomDrawValueArea(Value: TcxGridChartAreaDiagramValueAreaCustomDrawEvent); + protected + function GetLegendViewInfoClass: TcxGridChartLegendViewInfoClass; override; + function GetStylesClass: TcxGridChartDiagramStylesClass; override; + function GetViewInfoClass: TcxGridChartDiagramViewInfoClass; override; + + function GetDisplayText: string; override; + function GetImageIndex: Integer; override; + + procedure DoCustomDrawValueArea(ACanvas: TcxCanvas; + AViewInfo: TcxGridChartAreaDiagramValueViewInfo; var ADone: Boolean); virtual; + function HasCustomDrawValueArea: Boolean; virtual; + public + procedure Assign(Source: TPersistent); override; + published + property Styles: TcxGridChartAreaDiagramStyles read GetStyles write SetStyles; + property OnCustomDrawValueArea: TcxGridChartAreaDiagramValueAreaCustomDrawEvent + read FOnCustomDrawValueArea write SetOnCustomDrawValueArea; + end; + + // pie diagram + + TcxGridChartPieDiagramStyles = class(TcxGridChartDiagramStyles) + protected + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + function GetVaryColorsByCategory: Boolean; override; + public + procedure Assign(Source: TPersistent); override; + published + property SeriesSiteCaptions: TcxStyle index dsSeriesSiteCaptions read GetValue write SetValue; + property SeriesSites: TcxStyle index dsSeriesSites read GetValue write SetValue; + end; + + TcxGridChartPieDiagramValueCaptionItem = (pdvciCategory, pdvciValue, pdvciPercentage); + TcxGridChartPieDiagramValueCaptionItems = set of TcxGridChartPieDiagramValueCaptionItem; + + TcxGridChartPieDiagramValuesClass = class of TcxGridChartPieDiagramValues; + + TcxGridChartPieDiagramValues = class(TcxCustomGridChartDiagramOptions) + private + FAngleOfFirstSlice: Integer; + FCaptionItems: TcxGridChartPieDiagramValueCaptionItems; + FCaptionItemSeparator: string; + FCaptionPosition: TcxGridChartPieDiagramValueCaptionPosition; + FPercentageCaptionFormat: string; + procedure SetAngleOfFirstSlice(Value: Integer); + procedure SetCaptionItems(Value: TcxGridChartPieDiagramValueCaptionItems); + procedure SetCaptionItemSeparator(const Value: string); + procedure SetCaptionPosition(Value: TcxGridChartPieDiagramValueCaptionPosition); + procedure SetPercentageCaptionFormat(const Value: string); + protected + function GetDefaultCaptionItemSeparator: string; virtual; + function GetDefaultPercentageCaptionFormat: string; virtual; + public + constructor Create(ADiagram: TcxGridChartDiagram); override; + procedure Assign(Source: TPersistent); override; + function GetCaptionItemSeparator: string; + function GetCaptionPosition: TcxGridChartPieDiagramValueCaptionPosition; virtual; + function GetPercentageCaptionFormat: string; + published + property AngleOfFirstSlice: Integer read FAngleOfFirstSlice write SetAngleOfFirstSlice default 0; + property CaptionPosition: TcxGridChartPieDiagramValueCaptionPosition read FCaptionPosition + write SetCaptionPosition default pdvcpNone; + property CaptionItems: TcxGridChartPieDiagramValueCaptionItems read FCaptionItems + write SetCaptionItems default [pdvciValue]; + property CaptionItemSeparator: string read FCaptionItemSeparator write SetCaptionItemSeparator; + property PercentageCaptionFormat: string read FPercentageCaptionFormat + write SetPercentageCaptionFormat; + end; + + TcxGridChartPieDiagramSeriesSiteCaptionCustomDrawEvent = procedure(Sender: TcxGridChartPieDiagram; + ACanvas: TcxCanvas; AViewInfo: TcxGridChartPieSeriesSiteCaptionViewInfo; var ADone: Boolean) of object; + TcxGridChartPieDiagramSeriesSiteCustomDrawEvent = procedure(Sender: TcxGridChartPieDiagram; + ACanvas: TcxCanvas; AViewInfo: TcxGridChartPieSeriesSiteViewInfo; var ADone: Boolean) of object; + + TcxGridChartPieDiagramClass = class of TcxGridChartPieDiagram; + + TcxGridChartPieDiagram = class(TcxGridChartDiagram) + private + FSeriesCaptions: Boolean; + FSeriesColumnCount: Integer; + FSeriesSites: Boolean; + FValues: TcxGridChartPieDiagramValues; + FOnCustomDrawSeriesSite: TcxGridChartPieDiagramSeriesSiteCustomDrawEvent; + FOnCustomDrawSeriesSiteCaption: TcxGridChartPieDiagramSeriesSiteCaptionCustomDrawEvent; + function GetStyles: TcxGridChartPieDiagramStyles; + procedure SetSeriesCaptions(Value: Boolean); + procedure SetSeriesColumnCount(Value: Integer); + procedure SetSeriesSites(Value: Boolean); + procedure SetStyles(Value: TcxGridChartPieDiagramStyles); + procedure SetValues(Value: TcxGridChartPieDiagramValues); + procedure SetOnCustomDrawSeriesSite(Value: TcxGridChartPieDiagramSeriesSiteCustomDrawEvent); + procedure SetOnCustomDrawSeriesSiteCaption(Value: TcxGridChartPieDiagramSeriesSiteCaptionCustomDrawEvent); + protected + procedure CreateSubObjects(AGridView: TcxGridChartView); override; + procedure DestroySubObjects; override; + + function GetStylesClass: TcxGridChartDiagramStylesClass; override; + function GetValuesClass: TcxGridChartPieDiagramValuesClass; virtual; + + function GetLegendViewInfoClass: TcxGridChartLegendViewInfoClass; override; + function GetViewInfoClass: TcxGridChartDiagramViewInfoClass; override; + + function GetDisplayText: string; override; + function GetImageIndex: Integer; override; + + procedure DoCustomDrawSeriesSite(ACanvas: TcxCanvas; + AViewInfo: TcxGridChartPieSeriesSiteViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawSeriesSiteCaption(ACanvas: TcxCanvas; + AViewInfo: TcxGridChartPieSeriesSiteCaptionViewInfo; var ADone: Boolean); virtual; + function HasCustomDrawSeriesSite: Boolean; virtual; + function HasCustomDrawSeriesSiteCaption: Boolean; virtual; + public + constructor Create(AGridView: TcxGridChartView); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function GetSeriesColumnCount: Integer; virtual; + function GetValueCaption(ASeries: TcxGridChartSeries; AValueIndex: Integer): string; override; + published + property SeriesCaptions: Boolean read FSeriesCaptions write SetSeriesCaptions default True; + property SeriesColumnCount: Integer read FSeriesColumnCount write SetSeriesColumnCount default 0; + property SeriesSites: Boolean read FSeriesSites write SetSeriesSites default False; + property Styles: TcxGridChartPieDiagramStyles read GetStyles write SetStyles; + property Values: TcxGridChartPieDiagramValues read FValues write SetValues; + property OnCustomDrawSeriesSite: TcxGridChartPieDiagramSeriesSiteCustomDrawEvent + read FOnCustomDrawSeriesSite write SetOnCustomDrawSeriesSite; + property OnCustomDrawSeriesSiteCaption: TcxGridChartPieDiagramSeriesSiteCaptionCustomDrawEvent + read FOnCustomDrawSeriesSiteCaption write SetOnCustomDrawSeriesSiteCaption; + end; + + // chart item data binding + + TcxGridChartItemDataBindingClass = class of TcxGridChartItemDataBinding; + + TcxGridChartItemDataBinding = class(TcxInterfacedPersistent, IcxEditRepositoryItemListener) + private + FData: TObject; + FDataField: TcxCustomDataField; + FDefaultRepositoryItem: TcxEditRepositoryItem; + FDefaultValuesProvider: TcxCustomEditDefaultValuesProvider; + FDefaultValueTypeClass: TcxValueTypeClass; + FGridView: TcxGridChartView; + FID: Integer; + FIsValue: Boolean; + FSummaryItem: TcxDataSummaryItem; + function GetDataController: TcxCustomDataController; + function GetDataIndex: Integer; + function GetDataItem: TObject; + function GetDefaultProperties: TcxCustomEditProperties; + function GetDefaultValuesProvider: TcxCustomEditDefaultValuesProvider; + function GetGroupIndex: Integer; + function GetSortIndex: Integer; + function GetSortOrder: TcxDataSortOrder; + function GetSummaryIndex: Integer; + function GetSummaryKind: TcxSummaryKind; + function GetValueType: string; + function GetValueTypeClass: TcxValueTypeClass; + procedure SetData(Value: TObject); + procedure SetDataField(Value: TcxCustomDataField); + procedure SetGroupIndex(Value: Integer); + procedure SetSortIndex(Value: Integer); + procedure SetSortOrder(Value: TcxDataSortOrder); + procedure SetSummaryKind(Value: TcxSummaryKind); + procedure SetValueType(const Value: string); + procedure SetValueTypeClass(Value: TcxValueTypeClass); + protected + // IcxEditRepositoryItemListener + procedure ItemRemoved(Sender: TcxEditRepositoryItem); + procedure PropertiesChanged(Sender: TcxEditRepositoryItem); + + procedure CreateSummaryItem(var ASummaryItem: TcxDataSummaryItem); virtual; + function GetDefaultDisplayText: string; virtual; + function GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; virtual; + function GetDefaultValueTypeClass: TcxValueTypeClass; virtual; + function GetSummaryItem: TcxDataSummaryItem; virtual; + procedure InitDefaultValuesProvider(ADefaultValuesProvider: TcxCustomEditDefaultValuesProvider); virtual; + function IsValueTypeInteger: Boolean; + function IsValueTypeStored: Boolean; virtual; + procedure UpdateSummaryItemValue; + procedure ValueTypeClassChanged; virtual; + + function GetDefaultRepositoryItem: TcxEditRepositoryItem; virtual; + procedure UpdateDefaultRepositoryItemValue; + + property DataField: TcxCustomDataField read FDataField write SetDataField; + property DefaultProperties: TcxCustomEditProperties read GetDefaultProperties; + property DefaultRepositoryItem: TcxEditRepositoryItem read FDefaultRepositoryItem; + property DefaultValuesProvider: TcxCustomEditDefaultValuesProvider read GetDefaultValuesProvider; + property DataItem: TObject read GetDataItem; + property GroupIndex: Integer read GetGroupIndex write SetGroupIndex; + property ID: Integer read FID write FID; + property IsValue: Boolean read FIsValue; + property SortIndex: Integer read GetSortIndex write SetSortIndex; + property SortOrder: TcxDataSortOrder read GetSortOrder write SetSortOrder; + property SummaryKind: TcxSummaryKind read GetSummaryKind write SetSummaryKind; + public + constructor Create(AGridView: TcxGridChartView; AIsValue: Boolean; + ADefaultValueTypeClass: TcxValueTypeClass); reintroduce; virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function GetValueDisplayText(const AValue: Variant): string; virtual; + function IsValueTypeClassValid(AValueTypeClass: TcxValueTypeClass): Boolean; virtual; + property Data: TObject read FData write SetData; + property DataIndex: Integer read GetDataIndex; + property DataController: TcxCustomDataController read GetDataController; + property GridView: TcxGridChartView read FGridView; + property SummaryIndex: Integer read GetSummaryIndex; + property SummaryItem: TcxDataSummaryItem read FSummaryItem; + property ValueTypeClass: TcxValueTypeClass read GetValueTypeClass write SetValueTypeClass; + published + property ValueType: string read GetValueType write SetValueType stored IsValueTypeStored; + end; + + TcxGridChartGetValueDisplayTextEvent = procedure(Sender: TObject; + const AValue: Variant; var ADisplayText: string) of object; + TcxGridChartItemGetStoredPropertiesEvent = procedure(Sender: TcxGridChartItem; + AProperties: TStrings) of object; + TcxGridChartItemGetStoredPropertyValueEvent = procedure(Sender: TcxGridChartItem; + const AName: string; var AValue: Variant) of object; + TcxGridChartItemSetStoredPropertyValueEvent = procedure(Sender: TcxGridChartItem; + const AName: string; const AValue: Variant) of object; + + TcxGridChartItem = class(TcxComponent, IcxStoredObject, IcxGridChartItem) + private + FDataBinding: TcxGridChartItemDataBinding; + FDisplayText: string; + FGridView: TcxGridChartView; + FLastDataBindingDefaultDisplayText: string; + FOrder: Integer; + FVisible: Boolean; + FVisibleForCustomization: Boolean; + FVisibleIndex: Integer; + FOnGetStoredProperties: TcxGridChartItemGetStoredPropertiesEvent; + FOnGetStoredPropertyValue: TcxGridChartItemGetStoredPropertyValueEvent; + FOnGetValueDisplayText: TcxGridChartGetValueDisplayTextEvent; + FOnSetStoredPropertyValue: TcxGridChartItemSetStoredPropertyValueEvent; + function GetID: Integer; + function GetIndex: Integer; + function GetSortOrder: TcxDataSortOrder; + function GetTag: TcxTag; + function GetVisibleDisplayText(AIndex: Integer): string; + procedure SetDataBinding(Value: TcxGridChartItemDataBinding); + procedure SetDisplayText(const Value: string); + procedure SetIndex(Value: Integer); + procedure SetOnGetStoredProperties(Value: TcxGridChartItemGetStoredPropertiesEvent); + procedure SetOnGetStoredPropertyValue(Value: TcxGridChartItemGetStoredPropertyValueEvent); + procedure SetOnGetValueDisplayText(Value: TcxGridChartGetValueDisplayTextEvent); + procedure SetOnSetStoredPropertyValue(Value: TcxGridChartItemSetStoredPropertyValueEvent); + procedure SetSortOrder(Value: TcxDataSortOrder); + procedure SetTag(Value: TcxTag); + procedure SetVisible(Value: Boolean); + procedure SetVisibleForCustomization(Value: Boolean); + function IsTagStored: Boolean; + protected + FSubObjectEvents: TNotifyEvent; + + // IcxStoredObject + function GetObjectName: string; virtual; + function IcxStoredObject.GetProperties = GetStoredProperties; + function GetStoredProperties(AProperties: TStrings): Boolean; virtual; + procedure GetPropertyValue(const AName: string; var AValue: Variant); virtual; + procedure SetPropertyValue(const AName: string; const AValue: Variant); virtual; + procedure SetRestoredIndex(AValue: Integer); virtual; abstract; + // IcxGridChartItem + procedure DataChanged; virtual; + function GetDataBinding: TcxGridChartItemDataBinding; + procedure ValueTypeClassChanged; + + procedure SetParentComponent(AParent: TComponent); override; + + procedure Changed(AChange: TcxGridViewChangeKind = vcLayout); virtual; + procedure DisplayTextChanged; virtual; + procedure DoGetValueDisplayText(const AValue: Variant; var ADisplayText: string); virtual; + function GetDefaultDisplayText: string; virtual; + function GetDefaultValueTypeClass: TcxValueTypeClass; virtual; abstract; + procedure SetGridView(Value: TcxGridChartView); + procedure SetName(const NewName: TComponentName); override; + + function GetValue(AIndex: Integer): Variant; virtual; abstract; + function GetValueCount: Integer; virtual; abstract; + function GetVisibleValue(AIndex: Integer): Variant; virtual; abstract; + function GetVisibleValueCount: Integer; virtual; abstract; + procedure SetValue(AIndex: Integer; const Value: Variant); virtual; abstract; + procedure SetValueCount(Value: Integer); virtual; abstract; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function GetParentComponent: TComponent; override; + function HasParent: Boolean; override; + + function GetDisplayText: string; + function GetValueDisplayText(const AValue: Variant): string; + class function IsValue: Boolean; virtual; // abstract; - because of CLR, BCB + + property GridView: TcxGridChartView read FGridView; + property ID: Integer read GetID; + property Index: Integer read GetIndex write SetIndex; + property Order: Integer read FOrder; + property ValueCount: Integer read GetValueCount write SetValueCount; + property Values[AIndex: Integer]: Variant read GetValue write SetValue; default; + property VisibleDisplayTexts[AIndex: Integer]: string read GetVisibleDisplayText; + property VisibleIndex: Integer read FVisibleIndex; + property VisibleValueCount: Integer read GetVisibleValueCount; + property VisibleValues[AIndex: Integer]: Variant read GetVisibleValue; + published + property DataBinding: TcxGridChartItemDataBinding read FDataBinding + write SetDataBinding; + property DisplayText: string read FDisplayText write SetDisplayText; + property SortOrder: TcxDataSortOrder read GetSortOrder write SetSortOrder default soNone; + property Tag: TcxTag read GetTag write SetTag stored IsTagStored; + property Visible: Boolean read FVisible write SetVisible default True; + property VisibleForCustomization: Boolean read FVisibleForCustomization + write SetVisibleForCustomization default True; + property OnGetStoredProperties: TcxGridChartItemGetStoredPropertiesEvent read FOnGetStoredProperties write SetOnGetStoredProperties; + property OnGetStoredPropertyValue: TcxGridChartItemGetStoredPropertyValueEvent read FOnGetStoredPropertyValue write SetOnGetStoredPropertyValue; + property OnGetValueDisplayText: TcxGridChartGetValueDisplayTextEvent read FOnGetValueDisplayText write SetOnGetValueDisplayText; + property OnSetStoredPropertyValue: TcxGridChartItemSetStoredPropertyValueEvent read FOnSetStoredPropertyValue write SetOnSetStoredPropertyValue; + end; + + // categories + + TcxGridChartCategoriesClass = class of TcxGridChartCategories; + + TcxGridChartCategories = class(TcxCustomGridOptions, IcxGridChartItem) + private + FDataBinding: TcxGridChartItemDataBinding; + FDisplayText: string; + FOnGetValueDisplayText: TcxGridChartGetValueDisplayTextEvent; + function GetGridView: TcxGridChartView; + function GetID: Integer; + function GetSortOrder: TcxDataSortOrder; + function GetValue(Index: Integer): Variant; + function GetValueCount: Integer; + function GetVisibleDisplayText(Index: Integer): string; + function GetVisibleValue(Index: Integer): Variant; + function GetVisibleValueCount: Integer; + procedure SetDataBinding(Value: TcxGridChartItemDataBinding); + procedure SetDisplayText(const Value: string); + procedure SetOnGetValueDisplayText(Value: TcxGridChartGetValueDisplayTextEvent); + procedure SetSortOrder(Value: TcxDataSortOrder); + procedure SetValue(Index: Integer; const Value: Variant); + procedure SetValueCount(Value: Integer); + protected + // IcxGridChartItem + procedure DataChanged; virtual; + function GetDataBinding: TcxGridChartItemDataBinding; + procedure ValueTypeClassChanged; + + procedure DoGetValueDisplayText(const AValue: Variant; var ADisplayText: string); virtual; + function GetDefaultDisplayText: string; virtual; + function GetDefaultValueTypeClass: TcxValueTypeClass; virtual; + public + constructor Create(AGridView: TcxCustomGridView); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function GetDisplayText: string; + function GetNamePath: string; override; + function GetValueDisplayText(const AValue: Variant): string; + + property GridView: TcxGridChartView read GetGridView; + property ID: Integer read GetID; + property ValueCount: Integer read GetValueCount write SetValueCount; + property Values[Index: Integer]: Variant read GetValue write SetValue; default; + property VisibleDisplayTexts[Index: Integer]: string read GetVisibleDisplayText; + property VisibleValueCount: Integer read GetVisibleValueCount; + property VisibleValues[Index: Integer]: Variant read GetVisibleValue; + published + property DataBinding: TcxGridChartItemDataBinding read FDataBinding + write SetDataBinding; + property DisplayText: string read FDisplayText write SetDisplayText; + property SortOrder: TcxDataSortOrder read GetSortOrder write SetSortOrder default soNone; + property OnGetValueDisplayText: TcxGridChartGetValueDisplayTextEvent read FOnGetValueDisplayText + write SetOnGetValueDisplayText; + end; + + // data groups + + TcxGridChartDataGroupClass = class of TcxGridChartDataGroup; + + TcxGridChartDataGroup = class(TcxGridChartItem) + private + FActiveValue: Variant; + function GetActive: Boolean; + function GetActiveValueDisplayText: string; + function GetDataLevel: Integer; + function GetGroupIndex: Integer; + procedure SetActive(Value: Boolean); + procedure SetActiveValue(const Value: Variant); + procedure SetDataLevel(Value: Integer); + procedure SetGroupIndex(Value: Integer); + protected + // IcxStoredObject + function GetStoredProperties(AProperties: TStrings): Boolean; override; + procedure GetPropertyValue(const AName: string; var AValue: Variant); override; + procedure SetPropertyValue(const AName: string; const AValue: Variant); override; + procedure SetRestoredIndex(AValue: Integer); override; + + procedure CheckActiveValue; + function GetDefaultValueTypeClass: TcxValueTypeClass; override; + + function GetValue(AIndex: Integer): Variant; override; + function GetValueCount: Integer; override; + function GetVisibleValue(AIndex: Integer): Variant; override; + function GetVisibleValueCount: Integer; override; + procedure SetValue(AIndex: Integer; const Value: Variant); override; + procedure SetValueCount(Value: Integer); override; + + function CanMove: Boolean; virtual; + + property GroupIndex: Integer read GetGroupIndex write SetGroupIndex; + public + function HasActiveValue: Boolean; + class function IsValue: Boolean; override; + property Active: Boolean read GetActive write SetActive; + property ActiveValue: Variant read FActiveValue write SetActiveValue; + property ActiveValueDisplayText: string read GetActiveValueDisplayText; + property DataLevel: Integer read GetDataLevel write SetDataLevel; + published + property SortOrder default soAscending; + end; + + // series + + TcxGridChartSeriesGetValueStyleEvent = procedure(Sender: TcxGridChartSeries; + AValueIndex: Integer; var AStyle: TcxStyle) of object; + + TcxGridChartSeriesStylesClass = class of TcxGridChartSeriesStyles; + + TcxGridChartSeriesStyles = class(TcxCustomGridStyles) + private + FOnGetValueStyle: TcxGridChartSeriesGetValueStyleEvent; + function GetSeries: TcxGridChartSeries; + procedure SetOnGetValueStyle(Value: TcxGridChartSeriesGetValueStyleEvent); + protected + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + function GetGridView: TcxCustomGridView; override; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + procedure GetValueParams(AValueIndex: Integer; AVaryColorsByCategory: Boolean; + out AParams: TcxViewParams); virtual; + property Series: TcxGridChartSeries read GetSeries; + published + property Values: TcxStyle index ssValues read GetValue write SetValue; + property OnGetValueStyle: TcxGridChartSeriesGetValueStyleEvent read FOnGetValueStyle + write SetOnGetValueStyle; + end; + + TcxGridChartSeriesValueCustomDrawEvent = procedure(Sender: TcxGridChartSeries; + ACanvas: TcxCanvas; AViewInfo: TcxGridChartDiagramValueViewInfo; var ADone: Boolean) of object; + TcxGridChartValueClickEvent = procedure(Sender: TcxGridChartView; ASeries: TcxGridChartSeries; + AValueIndex: Integer; var AHandled: Boolean) of object; + + TcxGridChartSeriesClass = class of TcxGridChartSeries; + + TcxGridChartSeries = class(TcxGridChartItem) + private + FStyles: TcxGridChartSeriesStyles; + FValueCaptionFormat: string; + FOnCustomDrawValue: TcxGridChartSeriesValueCustomDrawEvent; + FOnValueClick: TcxGridChartValueClickEvent; + function GetGroupSummaryKind: TcxSummaryKind; + function GetSumOfValues: Variant; + procedure SetGroupSummaryKind(Value: TcxSummaryKind); + procedure SetStyles(Value: TcxGridChartSeriesStyles); + procedure SetValueCaptionFormat(const Value: string); + procedure SetOnCustomDrawValue(Value: TcxGridChartSeriesValueCustomDrawEvent); + procedure SetOnValueClick(Value: TcxGridChartValueClickEvent); + protected + // IcxStoredObject + function GetStoredProperties(AProperties: TStrings): Boolean; override; + procedure GetPropertyValue(const AName: string; var AValue: Variant); override; + procedure SetPropertyValue(const AName: string; const AValue: Variant); override; + procedure SetRestoredIndex(AValue: Integer); override; + + procedure DoGetValueDisplayText(const AValue: Variant; var ADisplayText: string); override; + function GetDefaultValueTypeClass: TcxValueTypeClass; override; + function GetStylesClass: TcxGridChartSeriesStylesClass; virtual; + function IsGroupSummaryKindValid(AValue: TcxSummaryKind): Boolean; virtual; + + function GetValue(AIndex: Integer): Variant; override; + function GetValueCount: Integer; override; + function GetVisibleValue(AIndex: Integer): Variant; override; + function GetVisibleValueCount: Integer; override; + procedure SetValue(AIndex: Integer; const Value: Variant); override; + procedure SetValueCount(Value: Integer); override; + + procedure DoCustomDrawValue(ACanvas: TcxCanvas; AViewInfo: TcxGridChartDiagramValueViewInfo; + var ADone: Boolean); virtual; + function DoValueClick(AValueIndex: Integer): Boolean; virtual; + function HasCustomDrawValue: Boolean; virtual; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function AddValue(const AValue: Variant): Integer; + class function IsValue: Boolean; override; + + property SumOfValues: Variant read GetSumOfValues; + published + property GroupSummaryKind: TcxSummaryKind read GetGroupSummaryKind write SetGroupSummaryKind + default cxGridChartItemDefaultSummaryKind; + property Styles: TcxGridChartSeriesStyles read FStyles write SetStyles; + property ValueCaptionFormat: string read FValueCaptionFormat write SetValueCaptionFormat; + + property StylesEvents: TNotifyEvent read FSubObjectEvents write FSubObjectEvents; + + property OnCustomDrawValue: TcxGridChartSeriesValueCustomDrawEvent read FOnCustomDrawValue + write SetOnCustomDrawValue; + property OnValueClick: TcxGridChartValueClickEvent read FOnValueClick write SetOnValueClick; + end; + + // view title + + TcxGridChartTitleClass = class of TcxGridChartTitle; + + TcxGridChartTitle = class(TcxCustomGridChartTitle) + protected + function GetDefaultPosition: TcxGridChartPartPosition; override; + published + property Position; + end; + + // view + + TcxGridChartDataLevelsInfoVisible = (dlivNever, dlivNonEmpty, dlivAlways); + TcxGridChartToolBoxBorder = (tbNone, tbSingle); + TcxGridChartToolBoxPosition = (tpTop, tpBottom); + TcxGridChartToolBoxVisible = (tvNever, tvNonEmpty, tvAlways); + + TcxGridChartToolBoxClass = class of TcxGridChartToolBox; + + TcxGridChartToolBox = class(TcxCustomGridOptions) + private + FBorder: TcxGridChartToolBoxBorder; + FCustomizeButton: Boolean; + FDataLevelActiveValueDropDownCount: Integer; + FDataLevelActiveValueDropDownWidth: Integer; + FDataLevelsInfoVisible: TcxGridChartDataLevelsInfoVisible; + FDiagramSelector: Boolean; + FPosition: TcxGridChartToolBoxPosition; + FVisible: TcxGridChartToolBoxVisible; + function GetGridView: TcxGridChartView; + procedure SetBorder(Value: TcxGridChartToolBoxBorder); + procedure SetCustomizeButton(Value: Boolean); + procedure SetDataLevelActiveValueDropDownCount(Value: Integer); + procedure SetDataLevelActiveValueDropDownWidth(Value: Integer); + procedure SetDataLevelsInfoVisible(Value: TcxGridChartDataLevelsInfoVisible); + procedure SetDiagramSelector(Value: Boolean); + procedure SetPosition(Value: TcxGridChartToolBoxPosition); + procedure SetVisible(Value: TcxGridChartToolBoxVisible); + protected + procedure GetStoredProperties(AProperties: TStrings); override; + procedure GetStoredPropertyValue(const AName: string; var AValue: Variant); override; + procedure SetStoredPropertyValue(const AName: string; const AValue: Variant); override; + + function IsDataLevelsInfoNonEmpty: Boolean; virtual; + function IsNonEmpty: Boolean; virtual; + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + function GetDataLevelsInfoVisible: Boolean; + function GetVisible: Boolean; + property GridView: TcxGridChartView read GetGridView; + published + property Border: TcxGridChartToolBoxBorder read FBorder write SetBorder default tbSingle; + property CustomizeButton: Boolean read FCustomizeButton write SetCustomizeButton default False; + property DataLevelActiveValueDropDownCount: Integer read FDataLevelActiveValueDropDownCount + write SetDataLevelActiveValueDropDownCount default cxGridChartDefaultDataLevelActiveValueDropDownCount; + property DataLevelActiveValueDropDownWidth: Integer read FDataLevelActiveValueDropDownWidth + write SetDataLevelActiveValueDropDownWidth default 0; + property DataLevelsInfoVisible: TcxGridChartDataLevelsInfoVisible read FDataLevelsInfoVisible + write SetDataLevelsInfoVisible default dlivNonEmpty; + property DiagramSelector: Boolean read FDiagramSelector write SetDiagramSelector default False; + property Position: TcxGridChartToolBoxPosition read FPosition write SetPosition default tpTop; + property Visible: TcxGridChartToolBoxVisible read FVisible write SetVisible default tvNonEmpty; + end; + + TcxGridChartValueHotTrack = (vhDefault, vhNever, vhAlways); + + TcxGridChartOptionsBehavior = class(TcxCustomGridOptionsBehavior) + private + FValueHints: Boolean; + FValueHotTrack: TcxGridChartValueHotTrack; + function GetGridView: TcxGridChartView; + procedure SetValueHints(Value: Boolean); + procedure SetValueHotTrack(Value: TcxGridChartValueHotTrack); + protected + procedure GetStoredProperties(AProperties: TStrings); override; + procedure GetStoredPropertyValue(const AName: string; var AValue: Variant); override; + procedure SetStoredPropertyValue(const AName: string; const AValue: Variant); override; + + function GetDefaultValueHotTrack(AValueIndex: Integer): Boolean; virtual; + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + function GetValueHotTrack(AValueIndex: Integer): Boolean; virtual; + property GridView: TcxGridChartView read GetGridView; + published + property ValueHints: Boolean read FValueHints write SetValueHints default True; + property ValueHotTrack: TcxGridChartValueHotTrack read FValueHotTrack write SetValueHotTrack default vhDefault; + end; + + TcxGridChartDataDrillUpMethod = (ddumNone, ddumValueMouseRightButtonClick, ddumMouseRightButtonClick); + + TcxGridChartOptionsCustomizeClass = class of TcxGridChartOptionsCustomize; + + TcxGridChartOptionsCustomize = class(TcxCustomGridOptions) + private + FDataDrillDown: Boolean; + FDataDrillUpMethod: TcxGridChartDataDrillUpMethod; + FDataGroupHiding: Boolean; + FDataGroupMoving: Boolean; + FOptionsCustomization: Boolean; + FSeriesCustomization: Boolean; + procedure SetDataDrillDown(Value: Boolean); + procedure SetDataDrillUpMethod(Value: TcxGridChartDataDrillUpMethod); + procedure SetDataGroupHiding(Value: Boolean); + procedure SetDataGroupMoving(Value: Boolean); + procedure SetOptionsCustomization(Value: Boolean); + procedure SetSeriesCustomization(Value: Boolean); + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + published + property DataDrillDown: Boolean read FDataDrillDown write SetDataDrillDown default True; + property DataDrillUpMethod: TcxGridChartDataDrillUpMethod read FDataDrillUpMethod + write SetDataDrillUpMethod default ddumMouseRightButtonClick; + property DataGroupHiding: Boolean read FDataGroupHiding write SetDataGroupHiding default False; + property DataGroupMoving: Boolean read FDataGroupMoving write SetDataGroupMoving default True; + property OptionsCustomization: Boolean read FOptionsCustomization write SetOptionsCustomization default True; + property SeriesCustomization: Boolean read FSeriesCustomization write SetSeriesCustomization default True; + end; + + TcxGridChartOptionsViewClass = class of TcxGridChartOptionsView; + + TcxGridChartOptionsView = class(TcxCustomGridOptionsView) + private + FCategoriesPerPage: Integer; + function GetGridView: TcxGridChartView; + procedure SetCategoriesPerPage(Value: Integer); + public + //constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + property GridView: TcxGridChartView read GetGridView; + published + property CategoriesPerPage: Integer read FCategoriesPerPage write SetCategoriesPerPage default 0; + end; + + TcxGridChartViewStyles = class(TcxCustomGridViewStyles) + private + function GetGridViewValue: TcxGridChartView; + protected + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + procedure GetDataLevelInfoParams(ADataLevel: Integer; out AParams: TcxViewParams); virtual; + property GridView: TcxGridChartView read GetGridViewValue; + published + property ActiveDataLevelInfo: TcxStyle index vsActiveDataLevelInfo read GetValue write SetValue; + property DataLevelActiveValueInfo: TcxStyle index vsDataLevelActiveValueInfo read GetValue write SetValue; + property DataLevelsInfo: TcxStyle index vsDataLevelsInfo read GetValue write SetValue; + property DiagramSelector: TcxStyle index vsDiagramSelector read GetValue write SetValue; + property Legend: TcxStyle index vsLegend read GetValue write SetValue; + property Title: TcxStyle index vsTitle read GetValue write SetValue; + property ToolBox: TcxStyle index vsToolBox read GetValue write SetValue; + end; + + TcxGridOpenChartItemList = class(TcxOpenList) + private + function GetItem(Index: Integer): TcxGridChartItem; + procedure SetItem(Index: Integer; Value: TcxGridChartItem); + public + property Items[Index: Integer]: TcxGridChartItem read GetItem write SetItem; default; + end; + + TcxGridChartDataGroupEvent = procedure(Sender: TcxGridChartView; ADataGroup: TcxGridChartDataGroup) of object; + TcxGridChartDiagramEvent = procedure(Sender: TcxGridChartView; ADiagram: TcxGridChartDiagram) of object; + TcxGridChartGetValueHintEvent = procedure(Sender: TcxGridChartView; + ASeries: TcxGridChartSeries; AValueIndex: Integer; var AHint: string) of object; + TcxGridChartLegendCustomDrawEvent = procedure(Sender: TcxGridChartView; + ACanvas: TcxCanvas; AViewInfo: TcxGridChartLegendViewInfo; var ADone: Boolean) of object; + TcxGridChartLegendItemCustomDrawEvent = procedure(Sender: TcxGridChartView; + ACanvas: TcxCanvas; AViewInfo: TcxGridChartLegendItemViewInfo; var ADone: Boolean) of object; + TcxGridChartSeriesEvent = procedure(Sender: TcxGridChartView; ASeries: TcxGridChartSeries) of object; + +(* + +User can customize: + ToolBox: + ActiveDiagram + ActiveDataLevel + DataGroups: + ActiveValue + Index + Visible + CustomizationForm: + Series: + Index + Visible + SortOrder + DataGroups: + Visible + Options: + Legend: + Position + Alignment + Orientation + Border + KeyBorder + Title: + Position + Alignment + ToolBox: + Position + Border + DiagramSelector + Other: + ValueHints + DataDrilling: + ActiveDataLevel + DataGroups: + ActiveValue + +Store/Restore: + View: + ActiveDiagram + ActiveDataLevel + Options: + Legend: + Position + Alignment + Orientation + Border + KeyBorder + Title: + Position + Alignment + ToolBox: + Position + Border + DiagramSelector + Other: + ValueHints + DataGroup: + ActiveValue + Index + Visible + Series: + Index + Visible + SortOrder + +*) + + TcxGridChartView = class(TcxCustomGridView) + private + FActiveDataLevel: Integer; + FActiveDiagram: TcxGridChartDiagram; + FAvailableDiagrams: TList; + FCategories: TcxGridChartCategories; + FDataGroupActiveValuesUpdateNeeded: Boolean; + FDataGroups: TList; + FDiagramArea: TcxGridChartAreaDiagram; + FDiagramBar: TcxGridChartBarDiagram; + FDiagramColumn: TcxGridChartColumnDiagram; + FDiagramLine: TcxGridChartLineDiagram; + FDiagramPie: TcxGridChartPieDiagram; + FDiagrams: TList; + FLegend: TcxGridChartLegend; + FNextID: Integer; + FOptionsCustomize: TcxGridChartOptionsCustomize; + FRestoredActiveDataLevel: Integer; + FRestoringDataGroups: TcxGridOpenChartItemList; + FRestoringSeries: TcxGridOpenChartItemList; + FSeries: TList; + FTitle: TcxGridChartTitle; + FToolBox: TcxGridChartToolBox; + FVisibleDataGroups: TList; + FVisibleSeries: TList; + FOnActiveDataLevelChanged: TNotifyEvent; + FOnActiveDiagramChanged: TcxGridChartDiagramEvent; + FOnCustomDrawLegend: TcxGridChartLegendCustomDrawEvent; + FOnCustomDrawLegendItem: TcxGridChartLegendItemCustomDrawEvent; + FOnDataGroupPosChanged: TcxGridChartDataGroupEvent; + FOnFirstVisibleCategoryIndexChanged: TNotifyEvent; + FOnGetValueHint: TcxGridChartGetValueHintEvent; + FOnSeriesPosChanged: TcxGridChartSeriesEvent; + FOnValueClick: TcxGridChartValueClickEvent; + FSubClassEvents: TNotifyEvent; + + function GetActiveDataGroup: TcxGridChartDataGroup; + function GetAvailableDiagram(Index: Integer): TcxGridChartDiagram; + function GetAvailableDiagramCount: Integer; + function GetController: TcxGridChartController; + function GetDataController: TcxGridChartDataController; + function GetDataGroup(Index: Integer): TcxGridChartDataGroup; + function GetDataGroupCount: Integer; + function GetDiagram(Index: Integer): TcxGridChartDiagram; + function GetDiagramCount: Integer; + function GetItem(Index: Integer): IcxGridChartItem; + function GetItemCount: Integer; + function GetOptionsBehavior: TcxGridChartOptionsBehavior; + function GetOptionsView: TcxGridChartOptionsView; + function GetSeries(Index: Integer): TcxGridChartSeries; + function GetSeriesCount: Integer; + function GetSortedSeries: TcxGridChartSeries; + function GetStyles: TcxGridChartViewStyles; + function GetViewData: TcxGridChartViewData; + function GetViewInfo: TcxGridChartViewInfo; + function GetVisibleDataGroup(Index: Integer): TcxGridChartDataGroup; + function GetVisibleDataGroupCount: Integer; + function GetVisibleSeries(Index: Integer): TcxGridChartSeries; + function GetVisibleSeriesCount: Integer; + procedure SetActiveDataGroup(Value: TcxGridChartDataGroup); + procedure SetActiveDataLevel(Value: Integer); + procedure SetActiveDiagram(Value: TcxGridChartDiagram); + procedure SetCategories(Value: TcxGridChartCategories); + procedure SetDataController(Value: TcxGridChartDataController); + procedure SetDataGroup(Index: Integer; Value: TcxGridChartDataGroup); + procedure SetDiagramArea(Value: TcxGridChartAreaDiagram); + procedure SetDiagramBar(Value: TcxGridChartBarDiagram); + procedure SetDiagramColumn(Value: TcxGridChartColumnDiagram); + procedure SetDiagramLine(Value: TcxGridChartLineDiagram); + procedure SetDiagramPie(Value: TcxGridChartPieDiagram); + procedure SetLegend(Value: TcxGridChartLegend); + procedure SetOptionsBehavior(Value: TcxGridChartOptionsBehavior); + procedure SetOptionsCustomize(Value: TcxGridChartOptionsCustomize); + procedure SetOptionsView(Value: TcxGridChartOptionsView); + procedure SetSeries(Index: Integer; Value: TcxGridChartSeries); + procedure SetSortedSeries(Value: TcxGridChartSeries); + procedure SetStyles(Value: TcxGridChartViewStyles); + procedure SetTitle(Value: TcxGridChartTitle); + procedure SetToolBox(Value: TcxGridChartToolBox); + procedure SetOnActiveDataLevelChanged(Value: TNotifyEvent); + procedure SetOnActiveDiagramChanged(Value: TcxGridChartDiagramEvent); + procedure SetOnCustomDrawLegend(Value: TcxGridChartLegendCustomDrawEvent); + procedure SetOnCustomDrawLegendItem(Value: TcxGridChartLegendItemCustomDrawEvent); + procedure SetOnDataGroupPosChanged(Value: TcxGridChartDataGroupEvent); + procedure SetOnFirstVisibleCategoryIndexChanged(Value: TNotifyEvent); + procedure SetOnGetValueHint(Value: TcxGridChartGetValueHintEvent); + procedure SetOnSeriesPosChanged(Value: TcxGridChartSeriesEvent); + procedure SetOnValueClick(Value: TcxGridChartValueClickEvent); + + protected + // IcxStoredObject + function GetProperties(AProperties: TStrings): Boolean; override; + procedure GetPropertyValue(const AName: string; var AValue: Variant); override; + procedure SetPropertyValue(const AName: string; const AValue: Variant); override; + // IcxStoredParent + function CreateStoredObject(const AObjectName, AClassName: string): TObject; override; + procedure GetStoredChildren(AChildren: TStringList); override; + // IcxGridViewLayoutEditorSupport - for design-time layout editor + procedure AssignLayout(ALayoutView: TcxCustomGridView); override; + function GetLayoutCustomizationFormButtonCaption: string; override; + function HasLayoutCustomizationForm: Boolean; override; + + procedure CreateHandlers; override; + procedure DestroyHandlers; override; + procedure CreateOptions; override; + procedure DestroyOptions; override; + + procedure ActiveDataLevelChanged(APrevActiveDataLevel: Integer); virtual; + procedure ActiveDiagramChanged(ADiagram: TcxGridChartDiagram); virtual; + procedure BeforeAssign(ASource: TcxCustomGridView); override; + procedure AfterAssign(ASource: TcxCustomGridView); override; + procedure DoAssign(ASource: TcxCustomGridView); override; + procedure BeforeRestoring; override; + procedure AfterRestoring; override; + procedure DataControllerUnlocked; virtual; + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + procedure GetFakeComponentLinks(AList: TList); override; + procedure RestoringComplete; override; + procedure SetChildOrder(Child: TComponent; Order: Integer); override; + procedure SetName(const NewName: TComponentName); override; + procedure UpdateControl(AInfo: TcxUpdateControlInfo); override; + + function GetControllerClass: TcxCustomGridControllerClass; override; + function GetDataControllerClass: TcxCustomDataControllerClass; override; + function GetItemDataBindingClass: TcxGridChartItemDataBindingClass; virtual; + function GetPainterClass: TcxCustomGridPainterClass; override; + function GetViewDataClass: TcxCustomGridViewDataClass; override; + function GetViewInfoClass: TcxCustomGridViewInfoClass; override; + + function GetLegendClass: TcxGridChartLegendClass; virtual; + function GetOptionsBehaviorClass: TcxCustomGridOptionsBehaviorClass; override; + function GetOptionsCustomizeClass: TcxGridChartOptionsCustomizeClass; virtual; + function GetOptionsViewClass: TcxCustomGridOptionsViewClass; override; + function GetStylesClass: TcxCustomGridViewStylesClass; override; + function GetTitleClass: TcxGridChartTitleClass; virtual; + function GetToolBoxClass: TcxGridChartToolBoxClass; virtual; + + function GetAreaDiagramClass: TcxGridChartAreaDiagramClass; virtual; + function GetBarDiagramClass: TcxGridChartBarDiagramClass; virtual; + function GetCategoriesClass: TcxGridChartCategoriesClass; virtual; + function GetColumnDiagramClass: TcxGridChartColumnDiagramClass; virtual; + function GetLineDiagramClass: TcxGridChartLineDiagramClass; virtual; + function GetPieDiagramClass: TcxGridChartPieDiagramClass; virtual; + + function GetCategoriesNamePath: string; virtual; + + procedure AddDiagram(ADiagram: TcxGridChartDiagram); + procedure RemoveDiagram(ADiagram: TcxGridChartDiagram); + procedure ClearDiagrams; + function CreateDiagram(ADiagramClass: TcxGridChartDiagramClass): TcxGridChartDiagram; + procedure CreateDiagrams; virtual; + procedure DiagramRemoved(ADiagram: TcxGridChartDiagram); virtual; + function GetDiagramNamePath(ADiagram: TcxGridChartDiagram): string; virtual; + function GetFirstAvailableDiagram: TcxGridChartDiagram; + procedure RefreshAvailableDiagramList; + + function GetNextID: Integer; + procedure ReleaseID(AID: Integer); + property NextID: Integer read FNextID; + + procedure DataSortingChanged(AItem: TObject); virtual; + procedure DataSortingChanging(AItem: TObject); virtual; + procedure UpdateDataController(AItem: TObject; ADataBinding: TcxGridChartItemDataBinding; + AAdd: Boolean); + procedure UpdateSummaryItemValues; + + function GetItemList(AItemClass: TcxGridChartItemClass): TList; overload; virtual; + function GetItemList(AItem: TcxGridChartItem): TList; overload; + function GetVisibleItemList(AItem: TcxGridChartItem): TList; virtual; + procedure AddItem(AItem: TcxGridChartItem); + procedure RemoveItem(AItem: TcxGridChartItem); + function GetItemIndex(AItem: TcxGridChartItem): Integer; + procedure SetItemIndex(AItem: TcxGridChartItem; AIndex: Integer); + procedure DataGroupVisibilityChanged(ADataGroup: TcxGridChartDataGroup); virtual; + procedure ItemDisplayTextChanged(AItem: TcxGridChartItem); virtual; + procedure ItemIndexChanged(AItem: TcxGridChartItem); virtual; + procedure ItemPosChanged(AItem: TcxGridChartItem); virtual; + procedure ItemVisibilityChanged(AItem: TcxGridChartItem); virtual; + procedure ItemVisibilityForCustomizationChanged(AItem: TcxGridChartItem); virtual; + procedure SeriesVisibilityChanged(ASeries: TcxGridChartSeries); virtual; + procedure RefreshVisibleItemsList(AItems, AVisibleItems: TList); + procedure UpdateItemsOrder(AItemClass: TcxGridChartItemClass); + + procedure ClearItems(AItemClass: TcxGridChartItemClass); + function CreateItem(AItemClass: TcxGridChartItemClass): TcxGridChartItem; + function FindItemByID(AItemClass: TcxGridChartItemClass; AID: Integer): TcxGridChartItem; + function FindItemByName(AItemClass: TcxGridChartItemClass; const AName: string): TcxGridChartItem; + function FindItemByTag(AItemClass: TcxGridChartItemClass; ATag: TcxTag): TcxGridChartItem; + + function GetAvailableDataLevel(ALevel: Integer): Integer; + function GetDataLevelCount: Integer; virtual; + function GetDataLevelObject(Index: Integer): TcxGridChartDataGroup; virtual; + function GetDataObjectLevel(AObject: TcxGridChartDataGroup): Integer; virtual; + procedure SetDataObjectLevel(AObject: TcxGridChartDataGroup; ALevel: Integer); virtual; + function GetIsDataGrouped: Boolean; virtual; + procedure UpdateDataGroupActiveValues; + procedure UpdateDataLevels; + procedure UpdateDataSortingBySummary; + + procedure CalculateImageWidth(var AWidth: Integer); virtual; + procedure CalculateImageHeight(var AHeight: Integer); virtual; + + procedure DoActiveDataLevelChanged; virtual; + procedure DoActiveDiagramChanged(ADiagram: TcxGridChartDiagram); virtual; + procedure DoCustomDrawLegend(ACanvas: TcxCanvas; AViewInfo: TcxGridChartLegendViewInfo; + var ADone: Boolean); virtual; + procedure DoCustomDrawLegendItem(ACanvas: TcxCanvas; AViewInfo: TcxGridChartLegendItemViewInfo; + var ADone: Boolean); virtual; + procedure DoDataGroupPosChanged(ADataGroup: TcxGridChartDataGroup); virtual; + procedure DoFirstVisibleCategoryIndexChanged; virtual; + procedure DoGetValueHint(ASeries: TcxGridChartSeries; AValueIndex: Integer; + var AHint: string); virtual; + procedure DoSeriesPosChanged(ASeries: TcxGridChartSeries); virtual; + function DoValueClick(ASeries: TcxGridChartSeries; AValueIndex: Integer): Boolean; virtual; + function HasCustomDrawLegend: Boolean; virtual; + function HasCustomDrawLegendItem: Boolean; virtual; + + property DataGroupActiveValuesUpdateNeeded: Boolean read FDataGroupActiveValuesUpdateNeeded; + property ItemCount: Integer read GetItemCount; + property Items[Index: Integer]: IcxGridChartItem read GetItem; + property RestoringDataGroups: TcxGridOpenChartItemList read FRestoringDataGroups; + property RestoringSeries: TcxGridOpenChartItemList read FRestoringSeries; + public + // base + function CreateImage(AGraphicClass: TGraphicClass; AWidth: Integer = 0; AHeight: Integer = 0): TGraphic; + property Controller: TcxGridChartController read GetController; + property ViewData: TcxGridChartViewData read GetViewData; + property ViewInfo: TcxGridChartViewInfo read GetViewInfo; + + // diagrams + function FindDiagramByDisplayText(const ADisplayText: string): TcxGridChartDiagram; + function FindDiagramByID(const AID: string): TcxGridChartDiagram; + property AvailableDiagramCount: Integer read GetAvailableDiagramCount; + property AvailableDiagrams[Index: Integer]: TcxGridChartDiagram read GetAvailableDiagram; + property DiagramCount: Integer read GetDiagramCount; + property Diagrams[Index: Integer]: TcxGridChartDiagram read GetDiagram; + + // series + procedure ClearSeries; + function CreateSeries: TcxGridChartSeries; + function FindSeriesByID(AID: Integer): TcxGridChartSeries; + function FindSeriesByName(const AName: string): TcxGridChartSeries; + function FindSeriesByTag(ATag: TcxTag): TcxGridChartSeries; + function GetSeriesClass: TcxGridChartSeriesClass; virtual; + + property Series[Index: Integer]: TcxGridChartSeries read GetSeries write SetSeries; + property SeriesCount: Integer read GetSeriesCount; + property SortedSeries: TcxGridChartSeries read GetSortedSeries write SetSortedSeries; + property VisibleSeries[Index: Integer]: TcxGridChartSeries read GetVisibleSeries; + property VisibleSeriesCount: Integer read GetVisibleSeriesCount; + + // data groups + procedure ClearDataGroups; + function CreateDataGroup: TcxGridChartDataGroup; + function FindDataGroupByID(AID: Integer): TcxGridChartDataGroup; + function FindDataGroupByName(const AName: string): TcxGridChartDataGroup; + function FindDataGroupByTag(ATag: TcxTag): TcxGridChartDataGroup; + function GetDataGroupClass: TcxGridChartDataGroupClass; virtual; + + function CanActivateDataLevel(ALevel: Integer): Boolean; + + property ActiveDataGroup: TcxGridChartDataGroup read GetActiveDataGroup write SetActiveDataGroup; + property ActiveDataLevel: Integer read FActiveDataLevel write SetActiveDataLevel; + property DataLevelCount: Integer read GetDataLevelCount; + property DataLevelObjects[Index: Integer]: TcxGridChartDataGroup read GetDataLevelObject; + property DataGroupCount: Integer read GetDataGroupCount; + property DataGroups[Index: Integer]: TcxGridChartDataGroup read GetDataGroup write SetDataGroup; + property IsDataGrouped: Boolean read GetIsDataGrouped; + property VisibleDataGroupCount: Integer read GetVisibleDataGroupCount; + property VisibleDataGroups[Index: Integer]: TcxGridChartDataGroup read GetVisibleDataGroup; + published + property ActiveDiagram: TcxGridChartDiagram read FActiveDiagram write SetActiveDiagram stored False; + property Categories: TcxGridChartCategories read FCategories write SetCategories + ; + property DataController: TcxGridChartDataController read GetDataController write SetDataController; + property DiagramArea: TcxGridChartAreaDiagram read FDiagramArea write SetDiagramArea; + property DiagramBar: TcxGridChartBarDiagram read FDiagramBar write SetDiagramBar; + property DiagramColumn: TcxGridChartColumnDiagram read FDiagramColumn write SetDiagramColumn; + property DiagramLine: TcxGridChartLineDiagram read FDiagramLine write SetDiagramLine; + property DiagramPie: TcxGridChartPieDiagram read FDiagramPie write SetDiagramPie; + property Legend: TcxGridChartLegend read FLegend write SetLegend; + property OptionsBehavior: TcxGridChartOptionsBehavior read GetOptionsBehavior write SetOptionsBehavior; + property OptionsCustomize: TcxGridChartOptionsCustomize read FOptionsCustomize write SetOptionsCustomize; + property OptionsView: TcxGridChartOptionsView read GetOptionsView write SetOptionsView; + property Styles: TcxGridChartViewStyles read GetStyles write SetStyles; + property Title: TcxGridChartTitle read FTitle write SetTitle; + property ToolBox: TcxGridChartToolBox read FToolBox write SetToolBox; + + property CategoriesEvents: TNotifyEvent read FSubClassEvents write FSubClassEvents; + property DiagramAreaEvents: TNotifyEvent read FSubClassEvents write FSubClassEvents; + property DiagramBarEvents: TNotifyEvent read FSubClassEvents write FSubClassEvents; + property DiagramColumnEvents: TNotifyEvent read FSubClassEvents write FSubClassEvents; + property DiagramLineEvents: TNotifyEvent read FSubClassEvents write FSubClassEvents; + property DiagramPieEvents: TNotifyEvent read FSubClassEvents write FSubClassEvents; + + property OnActiveDataLevelChanged: TNotifyEvent read FOnActiveDataLevelChanged write SetOnActiveDataLevelChanged; + property OnActiveDiagramChanged: TcxGridChartDiagramEvent read FOnActiveDiagramChanged write SetOnActiveDiagramChanged; + property OnCustomDrawLegend: TcxGridChartLegendCustomDrawEvent read FOnCustomDrawLegend write SetOnCustomDrawLegend; + property OnCustomDrawLegendItem: TcxGridChartLegendItemCustomDrawEvent read FOnCustomDrawLegendItem write SetOnCustomDrawLegendItem; + property OnCustomization; + property OnDataGroupPosChanged: TcxGridChartDataGroupEvent read FOnDataGroupPosChanged write SetOnDataGroupPosChanged; + property OnFirstVisibleCategoryIndexChanged: TNotifyEvent read FOnFirstVisibleCategoryIndexChanged write SetOnFirstVisibleCategoryIndexChanged; + property OnGetValueHint: TcxGridChartGetValueHintEvent read FOnGetValueHint write SetOnGetValueHint; + property OnInitStoredObject; + property OnSeriesPosChanged: TcxGridChartSeriesEvent read FOnSeriesPosChanged write SetOnSeriesPosChanged; + property OnValueClick: TcxGridChartValueClickEvent read FOnValueClick write SetOnValueClick; + end; + +var + cxGridChartDiagramImages: TImageList; + +procedure cxGridChartDiagramImages_Add(const AResourceName: string); + +function IsValueTypeClassValid(AValueTypeClass: TcxValueTypeClass): Boolean; + +implementation + +{$R cxGridChartView.res} + +uses +{$IFDEF DELPHI6} + Types, StrUtils, +{$IFNDEF NONDB} + FMTBcd, +{$ENDIF} +{$ENDIF} + SysUtils, Math, ImgList, + cxEditDataRegisteredRepositoryItems, cxGrid, cxGridLevel, cxGridStrs, cxListBox, + cxTextEdit, cxLibraryConsts; + +const + ChartPartOffset = 10; + + MarkWidth = 1; + CategoryGridLineWidth = 1; + ValueGridLineWidth = 1; + ValueAxisWidth = CategoryGridLineWidth; + CategoryAxisWidth = ValueGridLineWidth; + + TickMarkLabelsOffset = 10; + + ColumnDiagramValueOffsetUnits = 3; + ColumnDiagramValueSizeUnits = 4; + + LineDiagramCaptionOffset = 2; + LineDiagramValueSizeUnits = 2; + LineDiagramLineHotZoneMinWidth = 5; + + AreaDiagramLegendKeyOffset = 2; + AreaDiagramLegendKeySpace = 3; + + PieMinSize = 100; + PieSeriesSiteOffset = 10; + PieAreaOffset = 20; + PieValueCaptionOffset = 4; + PieLeaderLineSegment1 = 12; + PieLeaderLineSegment2 = 9; + + ToolBoxItemOffset = 5; + ToolBoxItemSeparatorWidth = 1; + ToolBoxDataLevelInfoConnectorWidth = 1; + ToolBoxDiagramImageOffset = 2; + + DefaultItemDisplayText = ''; + + ValueHintOffset = 27; + +procedure cxGridChartDiagramImages_Add(const AResourceName: string); +var + B: TBitmap; +begin + B := TBitmap.Create; + try + B.LoadFromResourceName(HInstance, AResourceName); + cxGridChartDiagramImages.AddMasked(B, B.TransparentColor); + finally + B.Free; + end; +end; + +function GetDefaultValueColor(AIndex: Integer): TColor; +const + ColorCount = 24; + Colors: array[0..ColorCount - 1] of TColor = + ($60C1FF, $B4835C, $7C58A5, $657C6C, $6379E6, $9AA05B, $605DCF, $6A8846, + $61A3F5, $58999E, $5A8CFF, $AD977A, $808E54, $95C9B9, $6763A5, $AC8C4D, + $80E4FB, $956349, $4D50C0, $67B48B, $D6A584, $73D8DD, $89674D, $9CB5A5); +begin + Result := Colors[AIndex mod ColorCount]; +end; + +function GetHotColor(AColor: TColor): TColor; +const + Alpha = 80; + //Delta = 25; +var + R, G, B: Byte; +begin + Result := ColorToRGB(AColor); + R := GetRValue(Result); + G := GetGValue(Result); + B := GetBValue(Result); +{ // MS Money style - does not give good results on light colors (clRed, clLime, ...) + Result := RGB( + Min(R + Delta, 255), + Min(G + Delta, 255), + Min(B + Delta, 255) + );} + // alpha blending with white color + Result := RGB( + MulDiv(R, Alpha, 100) + MulDiv(255, 100 - Alpha, 100), + MulDiv(G, Alpha, 100) + MulDiv(255, 100 - Alpha, 100), + MulDiv(B, Alpha, 100) + MulDiv(255, 100 - Alpha, 100) + ); +end; + +procedure PositionRect(out R: TRect; var AClientR: TRect; AWidth, AHeight, AOffset: Integer; + APosition: TcxGridChartPartPosition); +begin + R := AClientR; + case APosition of + cppLeft: + begin + R.Right := R.Left + AWidth; + AClientR.Left := R.Right + AOffset; + end; + cppTop: + begin + R.Bottom := R.Top + AHeight; + AClientR.Top := R.Bottom + AOffset; + end; + cppRight: + begin + R.Left := R.Right - AWidth; + AClientR.Right := R.Left - AOffset; + end; + cppBottom: + begin + R.Top := R.Bottom - AHeight; + AClientR.Bottom := R.Top - AOffset; + end; + end; +end; + +procedure AlignRect(var R: TRect; AWidth, AHeight: Integer; AIsHorizontal: Boolean; + AAlignment: TcxGridChartPartAlignment); +var + AOriginalR: TRect; +begin + AOriginalR := R; + case AAlignment of + cpaStart: + if AIsHorizontal then + R.Right := R.Left + AWidth + else + R.Bottom := R.Top + AHeight; + cpaCenter: + if AIsHorizontal then + begin + R.Left := (R.Left + R.Right - AWidth) div 2; + R.Right := R.Left + AWidth; + end + else + begin + R.Top := (R.Top + R.Bottom - AHeight) div 2; + R.Bottom := R.Top + AHeight; + end; + cpaEnd: + if AIsHorizontal then + R.Left := R.Right - AWidth + else + R.Top := R.Bottom - AHeight; + end; +// IntersectRect(R, R, AOriginalR); +end; + +procedure CheckRectBounds(var R: TRect); +begin + with R do + begin + if Left > Right then + SwapIntegers(Left, Right); + if Top > Bottom then + SwapIntegers(Top, Bottom); + end; +end; + +procedure GetCenteredRect(const ACenter: TPoint; AWidth, AHeight: Integer; out R: TRect); +begin + R.Left := ACenter.X - AWidth div 2; + R.Right := R.Left + AWidth; + R.Top := ACenter.Y - AHeight div 2; + R.Bottom := R.Top + AHeight; +end; + +{$IFNDEF DELPHI6} + +type + TValueSign = -1..1; + +function Sign(const AValue: Double): TValueSign; +const + NegativeValue = Low(TValueSign); + ZeroValue = 0; + PositiveValue = High(TValueSign); +begin + if (PInt64(@AValue)^ and $7FFFFFFFFFFFFFFF) = $0000000000000000 then + Result := ZeroValue + else + if (PInt64(@AValue)^ and $8000000000000000) = $8000000000000000 then + Result := NegativeValue + else + Result := PositiveValue; +end; + +{$ENDIF} + +const + ErrorValue = 1e-15; + +function Fraction(const AValue: Extended): Extended; +begin + Result := Frac(AValue); + if Result <> 0 then // to fix the bug in standard implementation + begin + Result := Frac(AValue + Sign(AValue) * ErrorValue); + if Abs(Result) < ErrorValue then + Result := 0 + else + begin + Result := Frac(AValue - Sign(AValue) * ErrorValue); + if 1 - Abs(Result) < ErrorValue then + Result := 0; + end; + end; +end; + +function Ceiling(const X: Extended): Integer; +begin + Result := Integer(Trunc(X)); + if Fraction(X) > 0 then Inc(Result); +end; + +procedure CheckZero(var AValue: Extended); +begin + if Abs(AValue) < ErrorValue then AValue := 0; +end; + +function IsPositive(const AValue: Extended): Boolean; +begin + Result := AValue >= 0; +end; + +function IsValueTypeValid(AValueType: {$IFDEF DELPHI6}TVarType{$ELSE}Integer{$ENDIF}; + AOnlyIntegerTypes: Boolean): Boolean; +const + ValidIntegerValueTypes = [varSmallint, varInteger, varByte + {$IFDEF DELPHI6}, varShortInt, varWord, varLongWord, varInt64{$ENDIF}]; + ValidFloatValueTypes = [varSingle, varDouble, varCurrency]; +begin + Result := (AValueType in ValidIntegerValueTypes) or not AOnlyIntegerTypes and + ((AValueType in ValidFloatValueTypes){$IFDEF DELPHI6}{$IFNDEF NONDB} or (AValueType = VarFMTBcd){$ENDIF}{$ENDIF}); +end; + +function IsValueTypeClassValid(AValueTypeClass: TcxValueTypeClass): Boolean; +begin + Result := IsValueTypeValid(AValueTypeClass.GetVarType, False); +end; + +function IsValueValid(const AValue: Variant): Boolean; +begin + Result := IsValueTypeValid(VarType(AValue), False); +end; + +function GetPointOnCircle(const ACenter: TPoint; ARadius, AAngle: Integer): TPoint; +var + ASin, ACos: Extended; +begin + SinCos(DegToRad(AAngle - 90), ASin, ACos); + Result.X := ACenter.X + Round(ARadius * ACos); + Result.Y := ACenter.Y + Round(ARadius * ASin); +end; + +function LineHasPoint(const ALineStart, ALineFinish: TPoint; ALineWidth: Integer; + const P: TPoint; AHotZoneMinWidth: Integer): Boolean; +var + ALineIntersectionY, AHotZoneSizeY: Integer; +begin + Result := (ALineStart.X <= P.X) and (P.X < ALineFinish.X); + if Result then + begin + ALineIntersectionY := ALineStart.Y + MulDiv(ALineFinish.Y - ALineStart.Y, + P.X - ALineStart.X, ALineFinish.X - ALineStart.X); + AHotZoneSizeY := Abs(Round(Max(AHotZoneMinWidth, ALineWidth div 2) * + Sqrt(1 + Sqr((ALineFinish.Y - ALineStart.Y) / (ALineFinish.X - ALineStart.X))))); + Result := + (ALineIntersectionY - AHotZoneSizeY <= P.Y) and + (P.Y <= ALineIntersectionY + AHotZoneSizeY); + end; +end; + +{ TcxGridChartTitleHitTest } + +class function TcxGridChartTitleHitTest.GetHitTestCode: Integer; +begin + Result := htChartTitle; +end; + +{ TcxGridChartLegendHitTest } + +class function TcxGridChartLegendHitTest.GetHitTestCode: Integer; +begin + Result := htLegend; +end; + +{ TcxGridChartLegendItemHitTest } + +class function TcxGridChartLegendItemHitTest.GetHitTestCode: Integer; +begin + Result := htLegendItem; +end; + +{ TcxGridChartToolBoxHitTest } + +class function TcxGridChartToolBoxHitTest.GetHitTestCode: Integer; +begin + Result := htChartToolBox; +end; + +{ TcxGridChartDataLevelInfoHitTest } + +procedure TcxGridChartDataLevelInfoHitTest.SetDataLevel(Value: Integer); +begin + FDataLevel := Value; + if FDataLevel = -1 then + FDataLevelObject := nil + else + FDataLevelObject := TcxGridChartView(GridView).DataLevelObjects[FDataLevel]; +end; + +procedure TcxGridChartDataLevelInfoHitTest.SetDataLevelObject(Value: TcxGridChartDataGroup); +begin + FDataLevelObject := Value; + if FDataLevelObject = nil then + FDataLevel := -1 + else + FDataLevel := FDataLevelObject.DataLevel; +end; + +class function TcxGridChartDataLevelInfoHitTest.GetHitTestCode: Integer; +begin + Result := htDataLevelInfo; +end; + +function TcxGridChartDataLevelInfoHitTest.DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; +begin + if (DataLevelObject <> nil) and DataLevelObject.CanMove then + Result := TcxGridChartView(GridView).Controller.GetDataLevelInfoDragAndDropObjectClass + else + Result := nil; +end; + +{ TcxGridChartDataLevelActiveValueInfoHitTest } + +class function TcxGridChartDataLevelActiveValueInfoHitTest.GetHitTestCode: Integer; +begin + Result := htDataLevelActiveValueInfo; +end; + +function TcxGridChartDataLevelActiveValueInfoHitTest.Cursor: TCursor; +begin + if CanDropDown then + Result := crcxHandPoint + else + Result := inherited Cursor; +end; + +function TcxGridChartDataLevelActiveValueInfoHitTest.DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; +begin + if CanDropDown then + Result := nil + else + Result := inherited DragAndDropObjectClass; +end; + +{ TcxGridChartCustomizeButtonHitTest } + +class function TcxGridChartCustomizeButtonHitTest.GetHitTestCode: Integer; +begin + Result := htChartCustomizeButton; +end; + +{ TcxGridChartDiagramSelectorHitTest } + +class function TcxGridChartDiagramSelectorHitTest.GetHitTestCode: Integer; +begin + Result := htDiagramSelector; +end; + +function TcxGridChartDiagramSelectorHitTest.Cursor: TCursor; +begin + if CanDropDown then + Result := crcxHandPoint + else + Result := inherited Cursor; +end; + +{ TcxGridChartValueHitTest } + +class function TcxGridChartValueHitTest.GetHitTestCode: Integer; +begin + Result := htChartValue; +end; + +function TcxGridChartValueHitTest.Cursor: TCursor; +begin + if CanDrillDown then + Result := crcxGridMagnifier + else + Result := inherited Cursor; +end; + +{ TcxGridChartHistogramPlotHitTest } + +class function TcxGridChartHistogramPlotHitTest.GetHitTestCode: Integer; +begin + Result := htPlot; +end; + +{ TcxGridChartHistogramCategoryAxisTitleHitTest } + +class function TcxGridChartHistogramCategoryAxisTitleHitTest.GetHitTestCode: Integer; +begin + Result := htCategoryAxisTitle; +end; + +{ TcxGridChartHistogramValueAxisTitleHitTest } + +class function TcxGridChartHistogramValueAxisTitleHitTest.GetHitTestCode: Integer; +begin + Result := htValueAxisTitle; +end; + +{ TcxGridChartValueLineHitTest } + +class function TcxGridChartValueLineHitTest.GetHitTestCode: Integer; +begin + Result := htChartValueLine; +end; + +{ TcxGridChartValueAreaHitTest } + +class function TcxGridChartValueAreaHitTest.GetHitTestCode: Integer; +begin + Result := htChartValueArea; +end; + +{ TcxGridChartPieSeriesSiteHitTest } + +class function TcxGridChartPieSeriesSiteHitTest.GetHitTestCode: Integer; +begin + Result := htSeriesSite; +end; + +{ TcxGridChartPieSeriesSiteCaptionHitTest } + +class function TcxGridChartPieSeriesSiteCaptionHitTest.GetHitTestCode: Integer; +begin + Result := htSeriesSiteCaption; +end; + +{ TcxCustomGridChartMovingObject } + +function TcxCustomGridChartMovingObject.GetController: TcxGridChartController; +begin + Result := TcxGridChartController(inherited Controller); +end; + +function TcxCustomGridChartMovingObject.GetCustomizationForm: TcxGridChartCustomizationForm; +begin + Result := TcxGridChartCustomizationForm(inherited CustomizationForm); +end; + +function TcxCustomGridChartMovingObject.GetGridView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +function TcxCustomGridChartMovingObject.GetViewInfo: TcxGridChartViewInfo; +begin + Result := TcxGridChartViewInfo(inherited ViewInfo); +end; + +{ TcxGridChartDataGroupMovingObject } + +constructor TcxGridChartDataGroupMovingObject.Create(AControl: TcxControl); +begin + inherited; + FDestDataLevel := -1; +end; + +function TcxGridChartDataGroupMovingObject.GetSourceItem: TcxGridChartDataGroup; +begin + Result := TcxGridChartDataGroup(inherited SourceItem); +end; + +procedure TcxGridChartDataGroupMovingObject.SetDestDataLevel(Value: Integer); +begin + if FDestDataLevel <> Value then + begin + Dirty := True; + FDestDataLevel := Value; + end; +end; + +procedure TcxGridChartDataGroupMovingObject.SetSourceItem(Value: TcxGridChartDataGroup); +begin + inherited SourceItem := Value; +end; + +function TcxGridChartDataGroupMovingObject.CanRemove: Boolean; +begin + Result := SourceItem.Visible and + (GridView.OptionsCustomize.DataGroupHiding or Controller.Customization); +end; + +function TcxGridChartDataGroupMovingObject.GetArrowAreaBounds(APlace: TcxGridArrowPlace): TRect; +begin + Result := ViewInfo.ToolBoxViewInfo.GetDataGroupInsertionBounds(DestDataLevel); +end; + +function TcxGridChartDataGroupMovingObject.GetCustomizationFormListBox: TcxCustomGridItemsListBox; +begin + Result := CustomizationForm.DataGroupsListBox; +end; + +function TcxGridChartDataGroupMovingObject.GetSourceItemViewInfo: TcxCustomGridCellViewInfo; +begin + if SourceItemContainerKind = ckToolBox then + Result := ViewInfo.ToolBoxViewInfo.DataLevelInfos[SourceItem.DataLevel] + else + Result := inherited GetSourceItemViewInfo; +end; + +function TcxGridChartDataGroupMovingObject.IsSourceCustomizationForm: Boolean; +begin + Result := SourceItemContainerKind = ckCustomizationForm; +end; + +function TcxGridChartDataGroupMovingObject.IsValidDestination: Boolean; +begin + Result := (DestDataLevel <> -1) and (not SourceItem.Visible or + (DestDataLevel < SourceItem.DataLevel) or (DestDataLevel > SourceItem.DataLevel + 1)); +end; + +procedure TcxGridChartDataGroupMovingObject.BeginDragAndDrop; +begin + if CustomizationForm <> nil then + CustomizationForm.PrepareForDataGroupDragAndDrop; + Controller.FMovingDataGroup := SourceItem; + inherited; +end; + +procedure TcxGridChartDataGroupMovingObject.DragAndDrop(const P: TPoint; var Accepted: Boolean); +begin + DestDataLevel := ViewInfo.ToolBoxViewInfo.GetDataGroupInsertionIndex(P); + Accepted := (ViewInfo.GetHitTest(P).HitTestCode = htCustomizationForm) or + (DestDataLevel <> -1); + inherited; +end; + +procedure TcxGridChartDataGroupMovingObject.EndDragAndDrop(Accepted: Boolean); + + function GetNewDataLevel: Integer; + begin + Result := DestDataLevel; + if SourceItem.Visible and (SourceItem.DataLevel < Result) then + Dec(Result); + end; + +var + ADataGroupPositionChanged: Boolean; +begin + inherited; + Controller.FMovingDataGroup := nil; + if not Accepted then Exit; + ADataGroupPositionChanged := False; + if DestDataLevel = -1 then + if CanRemove then + begin + SourceItem.Visible := False; + ADataGroupPositionChanged := True; + end + else + else + if IsValidDestination then + begin + SourceItem.DataLevel := GetNewDataLevel; + ADataGroupPositionChanged := True; + end; + if ADataGroupPositionChanged then + GridView.DoDataGroupPosChanged(SourceItem); +end; + +procedure TcxGridChartDataGroupMovingObject.Init(const P: TPoint; AParams: TcxCustomGridHitTest); +begin + inherited; + with AParams as TcxGridChartDataLevelInfoHitTest do + begin + SourceItem := DataLevelObject; + SourceItemContainerKind := DataLevelObjectContainerKind; + end; +end; + +{ TcxGridChartSeriesInnerCheckListBox } + +function TcxGridChartSeriesInnerCheckListBox.GetMetrics: TcxCheckListBoxMetrics; +begin + Result := inherited GetMetrics; + Inc(Result.CheckFrameWidth, cxTextOffset); + Inc(Result.ContentOffset, cxTextOffset); + Inc(Result.ImageFrameWidth, 1); + Result.TextAreaOffset := 0; + Inc(Result.TextOffset, 1); +end; + +function TcxGridChartSeriesInnerCheckListBox.GetSeriesImageSize: Integer; +begin + Result := GetStandardItemHeight - 2 * (Metrics.ImageFrameWidth + 1); +end; + +{ TcxGridChartSeriesCheckListBox } + +constructor TcxGridChartSeriesCheckListBox.Create(AOwner: TComponent; + AGridView: TcxGridChartView); +begin + inherited Create(AOwner); + FGridView := AGridView; + DragCursor := crcxGridDrag; + DragMode := dmAutomatic; + ImageLayout := ilAfterChecks; + Style.LookAndFeel.MasterLookAndFeel := GridView.LookAndFeel; + Style.HotTrack := False; + OnClickCheck := CheckClicked; + FSeriesImages := TImageList.Create(nil); +end; + +destructor TcxGridChartSeriesCheckListBox.Destroy; +begin + FreeAndNil(FSeriesImages); + inherited; +end; + +function TcxGridChartSeriesCheckListBox.GetSeries(AIndex: Integer): TcxGridChartSeries; +begin + Result := TcxGridChartSeries(Items[AIndex].ItemObject); +end; + +procedure TcxGridChartSeriesCheckListBox.CheckClicked(Sender: TObject; AIndex: Integer; + APrevState, ANewState: TcxCheckBoxState); +begin + LockRefreshItems := True; + try + Series[AIndex].Visible := ANewState = cbsChecked; + finally + LockRefreshItems := False; + end; + GridView.DoSeriesPosChanged(Series[AIndex]); +end; + +procedure TcxGridChartSeriesCheckListBox.CreateWnd; +begin + inherited; + RefreshItems; +end; + +procedure TcxGridChartSeriesCheckListBox.DragOver(Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); +var + AItemIndex: Integer; +begin + inherited; + AItemIndex := ItemAtPos(Point(X, Y), True); + Accept := AItemIndex <> -1; + if Accept and (Series[AItemIndex] <> FDraggingSeries) then + begin + FDraggingSeries.Index := Series[AItemIndex].Index; + ItemIndex := AItemIndex; + GridView.DoSeriesPosChanged(FDraggingSeries); + end; +end; + +procedure TcxGridChartSeriesCheckListBox.DrawSeriesImage(ACanvas: TcxCanvas; + const R: TRect; ASeries: TcxGridChartSeries); +var + AParams: TcxViewParams; +begin + ASeries.Styles.GetValueParams(-1, False, AParams); + ACanvas.FillRect(R, AParams, cxBordersAll, clWindowText); +end; + +function TcxGridChartSeriesCheckListBox.GetInnerCheckListBoxClass: TcxCustomInnerCheckListBoxClass; +begin + Result := TcxGridChartSeriesInnerCheckListBox; +end; + +procedure TcxGridChartSeriesCheckListBox.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + inherited; + RefreshImages; +end; + +procedure TcxGridChartSeriesCheckListBox.RefreshImages; +begin + if SeriesImages = nil then Exit; + Images := nil; + RefreshSeriesImages; + Images := SeriesImages; +end; + +procedure TcxGridChartSeriesCheckListBox.RefreshSeriesImages; +var + AImage: TBitmap; + AImageCanvas: TcxCanvas; + I: Integer; +begin + SeriesImages.Clear; + SeriesImages.Masked := False; + SeriesImages.Width := TcxGridChartSeriesInnerCheckListBox(InnerCheckListBox).GetSeriesImageSize; + SeriesImages.Height := SeriesImages.Width; + + AImage := TBitmap.Create; + AImageCanvas := TcxCanvas.Create(AImage.Canvas); + try + AImage.Width := SeriesImages.Width; + AImage.Height := SeriesImages.Height; + for I := 0 to Items.Count - 1 do + begin + DrawSeriesImage(AImageCanvas, Rect(0, 0, AImage.Width, AImage.Height), Series[I]); + SeriesImages.Add(AImage, nil); + end; + finally + AImageCanvas.Free; + AImage.Free; + end; +end; + +procedure TcxGridChartSeriesCheckListBox.RefreshItems; +var + I: Integer; + ASeries: TcxGridChartSeries; +begin + if LockRefreshItems then + Exit; + with Items do + begin + BeginUpdate; + try + Clear; + for I := 0 to GridView.SeriesCount - 1 do + begin + ASeries := GridView.Series[I]; + if ASeries.VisibleForCustomization then + with Add do + begin + ItemObject := ASeries; + Text := ASeries.GetDisplayText; + Checked := ASeries.Visible; + ImageIndex := Index; + end; + end; + RefreshImages; + finally + EndUpdate; + end; + end; +end; + +function TcxGridChartSeriesCheckListBox.StartDrag(DragObject: TDragObject): Boolean; +var + AItemIndex: Integer; +begin + Result := inherited StartDrag(DragObject); + if Result then + begin + AItemIndex := ItemAtPos(ScreenToClient(GetMouseCursorPos), True); + Result := AItemIndex <> -1; + if Result then + FDraggingSeries := Series[AItemIndex]; + end; +end; + +{ TcxGridChartSortBySeriesComboBox } + +constructor TcxGridChartSortBySeriesComboBox.Create(AOwner: TComponent; + AGridView: TcxGridChartView); +begin + inherited Create(AOwner); + FGridView := AGridView; + Properties.DropDownListStyle := lsFixedList; + FDirectionButton := Properties.Buttons.Add; + FDirectionButton.Kind := bkGlyph; + Properties.OnDrawItem := DrawItem; + Properties.OnMeasureItem := MeasureItem; + Style.LookAndFeel.MasterLookAndFeel := GridView.LookAndFeel; + Style.HotTrack := False; + RefreshItems; +end; + +procedure TcxGridChartSortBySeriesComboBox.Click; +begin + GridView.SortedSeries := TcxGridChartSeries(ItemObject); + inherited; +end; + +procedure TcxGridChartSortBySeriesComboBox.DirectionButtonClick; +begin + with GridView.SortedSeries do + if SortOrder = soAscending then + SortOrder := soDescending + else + SortOrder := soAscending; +end; + +procedure TcxGridChartSortBySeriesComboBox.DoButtonClick(AButtonVisibleIndex: Integer); +begin + if AButtonVisibleIndex = DirectionButton.Index then + DirectionButtonClick; + inherited; +end; + +procedure TcxGridChartSortBySeriesComboBox.DrawItem(AControl: TcxCustomComboBox; + ACanvas: TcxCanvas; AIndex: Integer; const ARect: TRect; AState: TOwnerDrawState); + + function GetKeyBounds: TRect; + const + KeyOffset = 1; + var + AKeySize: Integer; + begin + Result := ARect; + AKeySize := ACanvas.TextHeight('Qq') - 2 * KeyOffset; + with Result do + begin + InflateRect(Result, -(cxTextOffset + KeyOffset), -(Bottom - Top - AKeySize) div 2); + Right := Left + AKeySize; + end; + end; + +var + ASeries: TcxGridChartSeries; + AParams: TcxViewParams; + ABrushColor: TColor; + ATextRect: TRect; +begin + ASeries := TcxGridChartSeries(Properties.Items.Objects[AIndex]); + if ASeries <> nil then + begin + ASeries.Styles.GetValueParams(-1, False, AParams); + ABrushColor := ACanvas.Brush.Color; + ACanvas.FillRect(GetKeyBounds, AParams, cxBordersAll, clWindowText, 1, True); + ACanvas.Brush.Color := ABrushColor; + end; + + ACanvas.FillRect(ARect); + + ATextRect := ARect; + ATextRect.Left := GetKeyBounds.Right + 2 * cxTextOffset; + ACanvas.DrawText(Properties.Items[AIndex], ATextRect, + cxSingleLine or cxAlignVCenter or cxShowEndEllipsis); +end; + +procedure TcxGridChartSortBySeriesComboBox.MeasureItem(AControl: TcxCustomComboBox; + AIndex: Integer; ACanvas: TcxCanvas; var AHeight: Integer); +begin + Inc(AHeight, 2 * cxTextOffset); +end; + +procedure TcxGridChartSortBySeriesComboBox.RefreshDirectionButton; +const + GlyphWidth = 13; + GlyphHeight = 13; + LineSize = 1; + LineOffset = 1; + LineChange = LineSize + LineOffset; +var + ASortOrder: TcxDataSortOrder; + R: TRect; + I: Integer; +begin + if GridView.SortedSeries = nil then + ASortOrder := soNone + else + ASortOrder := GridView.SortedSeries.SortOrder; + DirectionButton.Visible := ASortOrder <> soNone; + if not DirectionButton.Visible then Exit; + + with DirectionButton.Glyph do + begin + Width := GlyphWidth; + Height := GlyphHeight; + + Canvas.Brush.Color := clRed; + Canvas.FillRect(Rect(0, 0, GlyphWidth, GlyphHeight)); + + R := Rect(0, LineOffset, 0, LineOffset + LineSize); + if ASortOrder = soAscending then + R.Right := LineOffset + LineChange + else + R.Right := GlyphWidth; + Canvas.Brush.Color := clBtnText; + for I := 0 to GlyphHeight div LineChange - 1 do + begin + Canvas.FillRect(R); + if ASortOrder = soAscending then + Inc(R.Right, LineChange) + else + Dec(R.Right, LineChange); + OffsetRect(R, 0, LineChange); + end; + end; +end; + +procedure TcxGridChartSortBySeriesComboBox.RefreshItems; +var + I: Integer; + ASeries: TcxGridChartSeries; +begin + with Properties.Items do + begin + BeginUpdate; + try + Clear; + Add(cxGetResourceString(@scxGridChartCustomizationFormNoSortedSeries)); + for I := 0 to GridView.SeriesCount - 1 do + begin + ASeries := GridView.Series[I]; + if ASeries.VisibleForCustomization then + AddObject(ASeries.GetDisplayText, ASeries); + end; + ItemObject := GridView.SortedSeries; + RefreshDirectionButton; + Properties.DropDownRows := Count; + finally + EndUpdate; + end; + end; +end; + +{ TcxGridChartDataGroupsListBox } + +function TcxGridChartDataGroupsListBox.GetGridView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +function TcxGridChartDataGroupsListBox.CalculateItemHeight: Integer; +begin + Result := + 2 * (LookAndFeelPainter.ChartToolBoxDataLevelInfoBorderSize + cxTextOffset) + + Canvas.TextHeight('Qq'); +end; + +function TcxGridChartDataGroupsListBox.GetDragAndDropParams: TcxCustomGridHitTest; +begin + Result := TcxGridChartDataLevelInfoHitTest.Instance(Point(-1, -1)); + with TcxGridChartDataLevelInfoHitTest(Result) do + begin + GridView := Self.GridView; + DataLevelObject := TcxGridChartDataGroup(DragAndDropItem); + DataLevelObjectContainerKind := ckCustomizationForm; + end; +end; + +procedure TcxGridChartDataGroupsListBox.PaintItem(ACanvas: TcxCanvas; R: TRect; + AIndex: Integer; AFocused: Boolean); +var + ABorderSize: Integer; + AParams: TcxViewParams; +begin + ABorderSize := LookAndFeelPainter.ChartToolBoxDataLevelInfoBorderSize; + if AFocused then + GridView.Styles.GetViewParams(vsActiveDataLevelInfo, nil, nil, AParams) + else + GridView.Styles.GetViewParams(vsDataLevelsInfo, nil, nil, AParams); + with ACanvas do + begin + FillRect(R, AParams, cxBordersAll, + LookAndFeelPainter.DefaultChartToolBoxDataLevelInfoBorderColor, + ABorderSize); + InflateRect(R, -(ABorderSize + cxTextOffset), -(ABorderSize + cxTextOffset)); + Brush.Style := bsClear; + Font.Color := AParams.TextColor; + DrawText(Items[AIndex], R, cxSingleLine or cxShowEndEllipsis); + Brush.Style := bsSolid; + end; +end; + +procedure TcxGridChartDataGroupsListBox.RefreshItems; +var + I: Integer; + AItem: TcxGridChartDataGroup; +begin + inherited; + with Items do + begin + BeginUpdate; + try + Clear; + for I := 0 to GridView.DataGroupCount - 1 do + begin + AItem := GridView.DataGroups[I]; + if AItem.VisibleForCustomization and not AItem.Visible then + AddObject(AItem.GetDisplayText, AItem); + end; + finally + EndUpdate; + end; + end; +end; + +{ TcxGridChartOptionsTreeView } + +constructor TcxGridChartOptionsTreeView.Create(AOwner: TComponent; AGridView: TcxGridChartView); +begin + inherited Create(AOwner); + FGridView := AGridView; + Style.LookAndFeel.MasterLookAndFeel := GridView.LookAndFeel; + Style.HotTrack := False; +end; + +function GetChartPartPositionItemCaption(ATypeItem: Integer): string; +begin + Result := ''; + case TcxGridChartPartPosition(ATypeItem) of + cppDefault: + Result := cxGetResourceString(@scxGridChartPositionDefault); + cppNone: + Result := cxGetResourceString(@scxGridChartPositionNone); + cppLeft: + Result := cxGetResourceString(@scxGridChartPositionLeft); + cppTop: + Result := cxGetResourceString(@scxGridChartPositionTop); + cppRight: + Result := cxGetResourceString(@scxGridChartPositionRight); + cppBottom: + Result := cxGetResourceString(@scxGridChartPositionBottom); + end; +end; + +function GetChartPartAlignmentItemCaption(ATypeItem: Integer): string; +begin + Result := ''; + case TcxGridChartPartAlignment(ATypeItem) of + cpaDefault: + Result := cxGetResourceString(@scxGridChartAlignmentDefault); + cpaStart: + Result := cxGetResourceString(@scxGridChartAlignmentStart); + cpaCenter: + Result := cxGetResourceString(@scxGridChartAlignmentCenter); + cpaEnd: + Result := cxGetResourceString(@scxGridChartAlignmentEnd); + end; +end; + +function GetChartPartOrientationItemCaption(ATypeItem: Integer): string; +begin + Result := ''; + case TcxGridChartPartOrientation(ATypeItem) of + cpoDefault: + Result := cxGetResourceString(@scxGridChartOrientationDefault); + cpoHorizontal: + Result := cxGetResourceString(@scxGridChartOrientationHorizontal); + cpoVertical: + Result := cxGetResourceString(@scxGridChartOrientationVertical); + end; +end; + +function GetChartToolBoxPositionItemCaption(ATypeItem: Integer): string; +begin + Result := ''; + case TcxGridChartToolBoxPosition(ATypeItem) of + tpTop: + Result := cxGetResourceString(@scxGridChartPositionTop); + tpBottom: + Result := cxGetResourceString(@scxGridChartPositionBottom); + end; +end; + +procedure TcxGridChartOptionsTreeView.AddItems; +begin + // Legend + LegendID := AddCategory(-1, -1, cxGetResourceString(@scxGridChartLegend)); + LegendPositionID := AddCategory(LegendID, -1, cxGetResourceString(@scxGridChartPosition)); + AddRadioButtons(LegendPositionID, TypeInfo(TcxGridChartPartPosition), @GetChartPartPositionItemCaption); + LegendAlignmentID := AddCategory(LegendID, -1, cxGetResourceString(@scxGridChartAlignment)); + AddRadioButtons(LegendAlignmentID, TypeInfo(TcxGridChartPartAlignment), @GetChartPartAlignmentItemCaption); + LegendOrientationID := AddCategory(LegendID, -1, cxGetResourceString(@scxGridChartOrientation)); + AddRadioButtons(LegendOrientationID, TypeInfo(TcxGridChartPartOrientation), @GetChartPartOrientationItemCaption); + LegendBorderID := AddCheckBox(LegendID, -1, cxGetResourceString(@scxGridChartBorder)); + LegendKeyBorderID := AddCheckBox(LegendID, -1, cxGetResourceString(@scxGridChartLegendKeyBorder)); + // Title + TitleID := AddCategory(-1, -1, cxGetResourceString(@scxGridChartTitle)); + TitlePositionID := AddCategory(TitleID, -1, cxGetResourceString(@scxGridChartPosition)); + AddRadioButtons(TitlePositionID, TypeInfo(TcxGridChartPartPosition), @GetChartPartPositionItemCaption); + TitleAlignmentID := AddCategory(TitleID, -1, cxGetResourceString(@scxGridChartAlignment)); + AddRadioButtons(TitleAlignmentID, TypeInfo(TcxGridChartPartAlignment), @GetChartPartAlignmentItemCaption); + // ToolBox + ToolBoxID := AddCategory(-1, -1, cxGetResourceString(@scxGridChartToolBox)); + ToolBoxPositionID := AddCategory(ToolBoxID, -1, cxGetResourceString(@scxGridChartPosition)); + AddRadioButtons(ToolBoxPositionID, TypeInfo(TcxGridChartToolBoxPosition), @GetChartToolBoxPositionItemCaption); + ToolBoxBorderID := AddCheckBox(ToolBoxID, -1, cxGetResourceString(@scxGridChartBorder)); + ToolBoxDiagramSelectorID := AddCheckBox(ToolBoxID, -1, cxGetResourceString(@scxGridChartDiagramSelector)); + // Other + OtherID := AddCategory(-1, -1, cxGetResourceString(@scxGridChartOther)); + OtherValueHintsID := AddCheckBox(OtherID, -1, cxGetResourceString(@scxGridChartValueHints)); +end; + +function TcxGridChartOptionsTreeView.IsItemChecked(AParentID, AID: Integer): Boolean; +begin + Result := False; + // Legend + if AParentID = LegendAlignmentID then + Result := Ord(GridView.ActiveDiagram.Legend.Alignment) = AID; + if AID = LegendBorderID then + Result := GridView.ActiveDiagram.Legend.GetBorder = lbSingle; + if AID = LegendKeyBorderID then + Result := GridView.ActiveDiagram.Legend.GetKeyBorder = lbSingle; + if AParentID = LegendOrientationID then + Result := Ord(GridView.ActiveDiagram.Legend.Orientation) = AID; + if AParentID = LegendPositionID then + Result := Ord(GridView.ActiveDiagram.Legend.Position) = AID; + // Title + if AParentID = TitleAlignmentID then + Result := Ord(GridView.Title.Alignment) = AID; + if AParentID = TitlePositionID then + Result := Ord(GridView.Title.Position) = AID; + // ToolBox + if AID = ToolBoxBorderID then + Result := GridView.ToolBox.Border = tbSingle; + if AID = ToolBoxDiagramSelectorID then + Result := GridView.ToolBox.DiagramSelector; + if AParentID = ToolBoxPositionID then + Result := Ord(GridView.ToolBox.Position) = AID; + // Other + if AID = OtherValueHintsID then + Result := GridView.OptionsBehavior.ValueHints; +end; + +procedure TcxGridChartOptionsTreeView.ItemClicked(AParentID, AID: Integer); +begin + // Legend + if AParentID = LegendAlignmentID then + GridView.ActiveDiagram.Legend.Alignment := TcxGridChartPartAlignment(AID); + if AID = LegendBorderID then + with GridView.ActiveDiagram.Legend do + if GetBorder = lbNone then + Border := lbSingle + else + Border := lbNone; + if AID = LegendKeyBorderID then + with GridView.ActiveDiagram.Legend do + if GetKeyBorder = lbNone then + KeyBorder := lbSingle + else + KeyBorder := lbNone; + if AParentID = LegendOrientationID then + GridView.ActiveDiagram.Legend.Orientation := TcxGridChartPartOrientation(AID); + if AParentID = LegendPositionID then + GridView.ActiveDiagram.Legend.Position := TcxGridChartPartPosition(AID); + // Title + if AParentID = TitleAlignmentID then + GridView.Title.Alignment := TcxGridChartPartAlignment(AID); + if AParentID = TitlePositionID then + GridView.Title.Position := TcxGridChartPartPosition(AID); + // ToolBox + if AID = ToolBoxBorderID then + with GridView.ToolBox do + if Border = tbNone then + Border := tbSingle + else + Border := tbNone; + if AID = ToolBoxDiagramSelectorID then + with GridView.ToolBox do + DiagramSelector := not DiagramSelector; + if AParentID = ToolBoxPositionID then + GridView.ToolBox.Position := TcxGridChartToolBoxPosition(AID); + // Other + if AID = OtherValueHintsID then + with GridView.OptionsBehavior do + ValueHints := not ValueHints; +end; + +{ TcxGridChartCustomizationForm } + +function TcxGridChartCustomizationForm.GetGridView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +function TcxGridChartCustomizationForm.CanChangeSortedSeries: Boolean; +begin + Result := (GridView.SortedSeries = nil) or GridView.SortedSeries.VisibleForCustomization; +end; + +procedure TcxGridChartCustomizationForm.CreateControls; +begin + inherited; + // Series + FSeriesCheckListBox := GetSeriesCheckListBoxClass.Create(Self, GridView); + with FSeriesCheckListBox do + begin + Align := alClient; + Parent := FSeriesPage; + end; + FSortBySeriesLabel := TcxLabel.Create(Self); + with FSortBySeriesLabel do + begin + Align := alBottom; + Caption := cxGetResourceString(@scxGridChartCustomizationFormSortBySeries); + Style.LookAndFeel.MasterLookAndFeel := GridView.LookAndFeel; + Transparent := True; + Visible := CanChangeSortedSeries; + Parent := FSeriesPage; + end; + FSortBySeriesComboBox := GetSortBySeriesComboBoxClass.Create(Self, GridView); + with FSortBySeriesComboBox do + begin + Align := alBottom; + Visible := CanChangeSortedSeries; + Parent := FSeriesPage; + end; + // Data Groups + FDataGroupsListBox := GetDataGroupsListBoxClass.Create(Self); + with FDataGroupsListBox do + begin + Align := alClient; + Parent := FDataGroupsPage; + RefreshItems; + end; + // Options + FOptionsTreeView := GetOptionsTreeViewClass.Create(Self, GridView); + with FOptionsTreeView do + begin + Align := alClient; + Parent := FOptionsPage; + end; +end; + +function TcxGridChartCustomizationForm.GetDataGroupsListBoxClass: TcxGridChartDataGroupsListBoxClass; +begin + Result := TcxGridChartDataGroupsListBox; +end; + +function TcxGridChartCustomizationForm.GetDataGroupsPageVisible: Boolean; +begin + Result := GridView.OptionsCustomize.DataGroupMoving and + (GridView.ToolBox.DataLevelsInfoVisible <> dlivNever); +end; + +function TcxGridChartCustomizationForm.GetOptionsPageVisible: Boolean; +begin + Result := GridView.OptionsCustomize.OptionsCustomization; +end; + +function TcxGridChartCustomizationForm.GetOptionsTreeViewClass: TcxGridChartOptionsTreeViewClass; +begin + Result := TcxGridChartOptionsTreeView; +end; + +function TcxGridChartCustomizationForm.GetSeriesCheckListBoxClass: TcxGridChartSeriesCheckListBoxClass; +begin + Result := TcxGridChartSeriesCheckListBox; +end; + +function TcxGridChartCustomizationForm.GetSeriesPageVisible: Boolean; +begin + Result := GridView.OptionsCustomize.SeriesCustomization; +end; + +function TcxGridChartCustomizationForm.GetSortBySeriesComboBoxClass: TcxGridChartSortBySeriesComboBoxClass; +begin + Result := TcxGridChartSortBySeriesComboBox; +end; + +procedure TcxGridChartCustomizationForm.GridViewChanged; +begin + inherited; + OptionsTreeView.RefreshItemValues; +end; + +procedure TcxGridChartCustomizationForm.InitPageControl; +begin + inherited; + FSeriesPage := CreatePage( + cxGetResourceString(@scxGridChartCustomizationFormSeriesPageCaption), + GetSeriesPageVisible); + FDataGroupsPage := CreatePage( + cxGetResourceString(@scxGridChartCustomizationFormDataGroupsPageCaption), + GetDataGroupsPageVisible); + FOptionsPage := CreatePage( + cxGetResourceString(@scxGridChartCustomizationFormOptionsPageCaption), + GetOptionsPageVisible); +end; + +procedure TcxGridChartCustomizationForm.PrepareForDataGroupDragAndDrop; +begin + ActivatePage(DataGroupsPage); +end; + +procedure TcxGridChartCustomizationForm.RefreshData; +begin + inherited; + SeriesCheckListBox.RefreshItems; + SortBySeriesComboBox.RefreshItems; + DataGroupsListBox.RefreshItems; +end; + +{ TcxGridChartDataLevelActiveValuePopup } + +constructor TcxGridChartDataLevelActiveValuePopup.Create(AGridView: TcxCustomGridView); +begin + inherited; + FListBox := TcxGridPopupListBox.Create(Self); + FListBox.OnAction := ListBoxAction; +end; + +function TcxGridChartDataLevelActiveValuePopup.GetGridView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +procedure TcxGridChartDataLevelActiveValuePopup.ListBoxAction(Sender: TcxGridPopupListBox; + AItemIndex: Integer); +begin + SetDataGroupActiveValue(AItemIndex); +end; + +procedure TcxGridChartDataLevelActiveValuePopup.AddValueItems(AStrings: TStrings; + out AValues: TVariantArray); +begin + GridView.ViewData.GetVisibleGroupValues(FDataGroup, AStrings, AValues); +end; + +procedure TcxGridChartDataLevelActiveValuePopup.AdjustListBoxSize; +begin + FListBox.VisibleItemCount := GridView.ToolBox.DataLevelActiveValueDropDownCount; + FListBox.VisibleWidth := GridView.ToolBox.DataLevelActiveValueDropDownWidth; + FListBox.AdjustBounds; +end; + +procedure TcxGridChartDataLevelActiveValuePopup.InitPopup; +begin + FDataGroup := (Owner as IcxGridChartDataLevelActiveValuePopupOwner).GetDataGroup; + inherited; + AddValueItems(FListBox.Items, Values); + AdjustListBoxSize; + FListBox.ItemIndex := VarIndex(Values, FDataGroup.ActiveValue); +end; + +procedure TcxGridChartDataLevelActiveValuePopup.SetDataGroupActiveValue(AItemIndex: Integer); +begin + GridView.BeginUpdate; + try + FDataGroup.ActiveValue := Values[AItemIndex]; + if FDataGroup.DataLevel >= GridView.ActiveDataLevel then + GridView.ActiveDataLevel := FDataGroup.DataLevel + 1; + finally + GridView.EndUpdate; + end; +end; + +{ TcxGridChartDiagramSelectorPopupListBox } + +function TcxGridChartDiagramSelectorPopupListBox.CalculateItemHeight: Integer; +begin + Result := Max(inherited CalculateItemHeight, + cxGridChartDiagramImages.Height + 2 * cxTextOffset); +end; + +procedure TcxGridChartDiagramSelectorPopupListBox.DrawItemContent(ACanvas: TcxCanvas; + AIndex: Integer; ARect: TRect; AState: TOwnerDrawState); +begin + inherited; + cxGridChartDiagramImages.Draw(ACanvas.Canvas, + ARect.Left + TcxGridChartDiagramSelectorPopup(Popup).ImageOffset, + (ARect.Top + ARect.Bottom - cxGridChartDiagramImages.Height) div 2, + TcxGridChartDiagram(Items.Objects[AIndex]).ImageIndex); +end; + +{ TcxGridChartDiagramSelectorPopup } + +constructor TcxGridChartDiagramSelectorPopup.Create(AGridView: TcxCustomGridView); +begin + inherited; + FListBox := TcxGridChartDiagramSelectorPopupListBox.Create(Self); + FListBox.OnAction := ListBoxAction; +end; + +function TcxGridChartDiagramSelectorPopup.GetGridView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +procedure TcxGridChartDiagramSelectorPopup.ListBoxAction(Sender: TcxGridPopupListBox; + AItemIndex: Integer); +begin + SelectDiagram(AItemIndex); +end; + +procedure TcxGridChartDiagramSelectorPopup.AddDiagramItems(AStrings: TStrings); +var + I: Integer; +begin + AStrings.BeginUpdate; + try + AStrings.Clear; + for I := 0 to GridView.AvailableDiagramCount - 1 do + AStrings.AddObject(GridView.AvailableDiagrams[I].DisplayText, + GridView.AvailableDiagrams[I]); + finally + AStrings.EndUpdate; + end; +end; + +function TcxGridChartDiagramSelectorPopup.GetImageOffset: Integer; +begin + Result := cxTextOffset; +end; + +procedure TcxGridChartDiagramSelectorPopup.InitPopup; +begin + inherited; + FListBox.ItemTextOffsetLeft := ImageOffset + cxGridChartDiagramImages.Width + + ToolBoxDiagramImageOffset + cxTextOffset; + FListBox.ItemTextOffsetVert := cxTextOffset; + AddDiagramItems(FListBox.Items); + FListBox.AdjustBounds; + FListBox.ItemObject := GridView.ActiveDiagram; +end; + +procedure TcxGridChartDiagramSelectorPopup.SelectDiagram(AItemIndex: Integer); +var + ADiagram: TcxGridChartDiagram; +begin + ADiagram := TcxGridChartDiagram(FListBox.Items.Objects[AItemIndex]); + ADiagram.Active := True; + if GridView.IsDesigning then + begin + GridView.Controller.DesignController.SelectObject(ADiagram, True); + GridView.Controller.DesignerModified; + end; +end; + +{ TcxGridChartController } + +constructor TcxGridChartController.Create(AGridView: TcxCustomGridView); +begin + inherited; + DataLevelsChanged; +end; + +destructor TcxGridChartController.Destroy; +begin + FDataLevelActiveValuePopup.Free; + FDiagramSelectorPopup.Free; + inherited; +end; + +function TcxGridChartController.GetCustomizationForm: TcxGridChartCustomizationForm; +begin + Result := TcxGridChartCustomizationForm(inherited CustomizationForm); +end; + +function TcxGridChartController.GetDataLevelActiveValuePopup: TcxGridChartDataLevelActiveValuePopup; +begin + if FDataLevelActiveValuePopup = nil then + FDataLevelActiveValuePopup := GetDataLevelActiveValuePopupClass.Create(GridView); + Result := FDataLevelActiveValuePopup; +end; + +function TcxGridChartController.GetDiagramSelectorPopup: TcxGridChartDiagramSelectorPopup; +begin + if FDiagramSelectorPopup = nil then + FDiagramSelectorPopup := GetDiagramSelectorPopupClass.Create(GridView); + Result := FDiagramSelectorPopup; +end; + +function TcxGridChartController.GetGridView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +function TcxGridChartController.GetIsDataGroupMoving: Boolean; +begin + Result := FMovingDataGroup <> nil; +end; + +function TcxGridChartController.GetViewInfo: TcxGridChartViewInfo; +begin + Result := TcxGridChartViewInfo(inherited ViewInfo); +end; + +function TcxGridChartController.GetVisibleCategoryCountValue: Integer; +begin + Result := GetVisibleCategoryCount(False); +end; + +procedure TcxGridChartController.SetFirstVisibleCategoryIndex(Value: Integer); +begin + Value := Max(Value, 0); + Value := Min(Value, GridView.ViewData.VisibleCategoryCount - VisibleCategoryCount); + if FFirstVisibleCategoryIndex <> Value then + begin + FFirstVisibleCategoryIndex := Value; + GridView.LayoutChanged; + FirstVisibleCategoryIndexChanged; + end; +end; + +procedure TcxGridChartController.ActiveDataLevelChanged(APrevActiveDataLevel, AActiveDataLevel: Integer); +begin + if (0 <= APrevActiveDataLevel) and (APrevActiveDataLevel < GridView.DataLevelCount) then + FFirstVisibleCategoryIndexes[APrevActiveDataLevel] := FFirstVisibleCategoryIndex; + if AActiveDataLevel <> -1 then + if ActiveDiagramSupportsPaging then + FirstVisibleCategoryIndex := FFirstVisibleCategoryIndexes[AActiveDataLevel] + else + FFirstVisibleCategoryIndex := FFirstVisibleCategoryIndexes[AActiveDataLevel]; +end; + +procedure TcxGridChartController.ActiveDiagramChanged(ADiagram: TcxGridChartDiagram); +begin + FirstVisibleCategoryIndexChanged; +end; + +procedure TcxGridChartController.CheckCoordinates; +begin + inherited; + if ActiveDiagramSupportsPaging then + FirstVisibleCategoryIndex := FirstVisibleCategoryIndex; +end; + +procedure TcxGridChartController.DataLevelsChanged; +begin + FFirstVisibleCategoryIndexes := nil; + SetLength(FFirstVisibleCategoryIndexes, GridView.DataLevelCount); +end; + +procedure TcxGridChartController.FirstVisibleCategoryIndexChanged; +begin + if FStoredFirstVisibleCategoryIndex <> FirstVisibleCategoryIndex then + begin + FStoredFirstVisibleCategoryIndex := FirstVisibleCategoryIndex; + GridView.DoFirstVisibleCategoryIndexChanged; + end; +end; + +function TcxGridChartController.GetDataLevelActiveValuePopupClass: TcxGridChartDataLevelActiveValuePopupClass; +begin + Result := TcxGridChartDataLevelActiveValuePopup; +end; + +function TcxGridChartController.GetDesignHitTest(AHitTest: TcxCustomGridHitTest): Boolean; +begin + Result := inherited GetDesignHitTest(AHitTest); + if not Result then + Result := AHitTest.HitTestCode in [htLegendItem, htDataLevelInfo, htDiagramSelector, + htChartValue, htChartValueLine, htChartValueArea, htSeriesSite, htSeriesSiteCaption]; +end; + +function TcxGridChartController.GetDiagramSelectorPopupClass: TcxGridChartDiagramSelectorPopupClass; +begin + Result := TcxGridChartDiagramSelectorPopup; +end; + +function TcxGridChartController.GetPatternObject(AObject: TPersistent): TPersistent; +begin + if AObject is GridView.GetCategoriesClass then + Result := TcxGridChartView(GridView.PatternGridView).Categories + else + if AObject is GridView.GetDataGroupClass then + Result := TcxGridChartView(GridView.PatternGridView).FindDataGroupByID(TcxGridChartDataGroup(AObject).ID) + else + if AObject is GridView.GetSeriesClass then + Result := TcxGridChartView(GridView.PatternGridView).FindSeriesByID(TcxGridChartSeries(AObject).ID) + else + Result := inherited GetPatternObject(AObject); +end; + +function TcxGridChartController.GetFirstVisibleCategoryIndex: Integer; +begin + if ActiveDiagramSupportsPaging then + Result := FFirstVisibleCategoryIndex + else + Result := 0; +end; + +function TcxGridChartController.GetVisibleCategoryCount(ACheckCount: Boolean): Integer; +begin + Result := GridView.ViewData.VisibleCategoryCount; + if ActiveDiagramSupportsPaging and (GridView.OptionsView.CategoriesPerPage <> 0) then + begin + Result := Min(Result, GridView.OptionsView.CategoriesPerPage); + if ACheckCount then + Result := Min(Result, Max(0, GridView.ViewData.VisibleCategoryCount - FirstVisibleCategoryIndex)); + end; +end; + +function TcxGridChartController.CanDataDrillDown(AValueIndex: Integer): Boolean; +begin + Result := GridView.ActiveDataLevel < GridView.DataLevelCount - 1; +end; + +function TcxGridChartController.CanDataDrillUp: Boolean; +begin + Result := GridView.ActiveDataLevel > 0; +end; + +function TcxGridChartController.DoDataDrillDown(AValueIndex: Integer): Boolean; +begin + Result := MayDataDrillDown and DataDrillDown(AValueIndex); +end; + +function TcxGridChartController.DoDataDrillUp: Boolean; +begin + Result := MayDataDrillDown and DataDrillUp; +end; + +function TcxGridChartController.MayDataDrillDown(ACheckDesignTime: Boolean = True): Boolean; +begin + Result := (not ACheckDesignTime or not GridView.IsDesigning) and + GridView.OptionsCustomize.DataDrillDown; +end; + +function TcxGridChartController.CanShowScrollBar: Boolean; +begin + Result := ActiveDiagramSupportsPaging; +end; + +function TcxGridChartController.GetScrollBarKind: TScrollBarKind; +begin + if GridView.ActiveDiagram.HorizontalPaging then + Result := sbHorizontal + else + Result := sbVertical; +end; + +function TcxGridChartController.GetScrollBarPageSize: Integer; +begin + Result := VisibleCategoryCount; +end; + +function TcxGridChartController.GetScrollBarPos: Integer; +begin + Result := ScrollPosToCategoryIndex(FirstVisibleCategoryIndex); +end; + +function TcxGridChartController.GetScrollBarSize: Integer; +begin + Result := GridView.ViewData.VisibleCategoryCount; +end; + +function TcxGridChartController.ScrollPosToCategoryIndex(AScrollPos: Integer): Integer; +begin + if GridView.ActiveDiagram.PagingInOppositeDirection then + Result := GetScrollBarSize - GetScrollBarPageSize - AScrollPos + else + Result := AScrollPos; +end; + +function TcxGridChartController.CanShowDataLevelActiveValuePopup(ACheckDesignTime: Boolean = True): Boolean; +begin + Result := MayDataDrillDown(ACheckDesignTime); +end; + +procedure TcxGridChartController.CustomizationChanged; +begin + GridView.ViewInfo.ToolBoxViewInfo.InvalidateCustomizeButton; + inherited; +end; + +function TcxGridChartController.GetCustomizationFormClass: TcxCustomGridCustomizationFormClass; +begin + Result := TcxGridChartCustomizationForm; +end; + +function TcxGridChartController.GetCustomizationFormDefaultWidth: Integer; +begin + Result := cxGridChartCustomizationFormDefaultWidth; +end; + +function TcxGridChartController.GetDataLevelInfoDragAndDropObjectClass: TcxGridChartDataGroupMovingObjectClass; +begin + Result := TcxGridChartDataGroupMovingObject; +end; + +function TcxGridChartController.HasDataLevelActiveValuePopup: Boolean; +begin + Result := FDataLevelActiveValuePopup <> nil; +end; + +function TcxGridChartController.HasDiagramSelectorPopup: Boolean; +begin + Result := FDiagramSelectorPopup <> nil; +end; + +procedure TcxGridChartController.MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + inherited; + if (Button = mbRight) and not (ssDouble in Shift) and + (GridView.OptionsCustomize.DataDrillUpMethod = ddumMouseRightButtonClick) then + DoDataDrillUp; +end; + +procedure TcxGridChartController.InitScrollBarsParameters; +begin + if CanShowScrollBar then + SetScrollBarInfo(GetScrollBarKind, 0, GetScrollBarSize - 1, 1, + GetScrollBarPageSize, GetScrollBarPos, True, True); +end; + +procedure TcxGridChartController.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +var + ADelta: Integer; +begin + if AScrollBarKind <> GetScrollBarKind then Exit; + ADelta := 0; + case AScrollCode of + scLineUp: + ADelta := -1; + scLineDown: + ADelta := 1; + scPageUp: + ADelta := -GetScrollBarPageSize; + scPageDown: + ADelta := GetScrollBarPageSize; + scTrack: + FirstVisibleCategoryIndex := ScrollPosToCategoryIndex(AScrollPos); + end; + if ADelta <> 0 then + begin + if GridView.ActiveDiagram.PagingInOppositeDirection then + ADelta := -ADelta; + FirstVisibleCategoryIndex := FirstVisibleCategoryIndex + ADelta; + end; + AScrollPos := GetScrollBarPos; +end; + +function TcxGridChartController.GetValueHintText(ASeries: TcxGridChartSeries; AValueIndex: Integer): string; +begin + Result := Format(cxGetResourceString(@scxGridChartValueHintFormat), + [ASeries.GetDisplayText, GridView.Categories.VisibleDisplayTexts[AValueIndex], + ASeries.VisibleDisplayTexts[AValueIndex]]); + GridView.DoGetValueHint(ASeries, AValueIndex, Result); +end; + +function TcxGridChartController.DataDrillDown(AValueIndex: Integer): Boolean; +begin + Result := CanDataDrillDown(AValueIndex); + if not Result then Exit; + GridView.BeginUpdate; + try + GridView.ActiveDataGroup.ActiveValue := GridView.ActiveDataGroup.VisibleValues[AValueIndex]; + GridView.ActiveDataLevel := GridView.ActiveDataLevel + 1; + finally + GridView.EndUpdate; + end; +end; + +function TcxGridChartController.DataDrillUp: Boolean; +begin + Result := CanDataDrillUp; + if Result then + GridView.ActiveDataLevel := GridView.ActiveDataLevel - 1; +end; + +function TcxGridChartController.IsDataDrillDownPossible(AValueIndex: Integer): Boolean; +begin + Result := MayDataDrillDown and CanDataDrillDown(AValueIndex); +end; + +function TcxGridChartController.ActiveDiagramSupportsPaging: Boolean; +begin + Result := (GridView.ActiveDiagram <> nil) and GridView.ActiveDiagram.SupportsPaging; +end; + +{ TcxGridChartDataController } + +function TcxGridChartDataController.GetGridViewValue: TcxGridChartView; +begin + Result := TcxGridChartView(GetOwner); +end; + +procedure TcxGridChartDataController.AssignData(ADataController: TcxCustomDataController); +begin +end; + +procedure TcxGridChartDataController.CreateAllItems(AMissingItemsOnly: Boolean); +begin +end; + +procedure TcxGridChartDataController.DeleteAllItems; +begin +end; + +procedure TcxGridChartDataController.GetFakeComponentLinks(AList: TList); +begin +end; + +function TcxGridChartDataController.GetGridView: TcxCustomGridView; +begin + Result := GridView; +end; + +function TcxGridChartDataController.HasAllItems: Boolean; +begin + Result := True; +end; + +function TcxGridChartDataController.IsDataChangeable: Boolean; +begin + Result := False; +end; + +function TcxGridChartDataController.IsDataLinked: Boolean; +begin + Result := True; +end; + +function TcxGridChartDataController.SupportsCreateAllItems: Boolean; +begin + Result := False; +end; + +procedure TcxGridChartDataController.DoValueTypeClassChanged(AItemIndex: Integer); +var + AChartItem: IcxGridChartItem; +begin + inherited; + if Supports(GetItem(AItemIndex), IcxGridChartItem, AChartItem) then + AChartItem.ValueTypeClassChanged; +end; + +{function TcxGridChartDataController.GetChartViewItemIndex: Integer; +begin + if GridView.SortedSeries = nil then + Result := -1 + else + Result := GridView.SortedSeries.DataBinding.DataIndex; +end;} + +function TcxGridChartDataController.GetItemID(AItem: TObject): Integer; +var + AChartItem: IcxGridChartItem; +begin + if Supports(AItem, IcxGridChartItem, AChartItem) then + Result := AChartItem.GetID + else + Result := -1; +end; + +function TcxGridChartDataController.GetSortingBySummaryEngineClass: TcxSortingBySummaryEngineClass; +begin + Result := GridView.ViewData.GetSortingBySummaryEngineClass; +end; + +procedure TcxGridChartDataController.Unlocked; +begin + inherited; + GridView.DataControllerUnlocked; +end; + +procedure TcxGridChartDataController.BeginFullUpdate; +begin + GridView.BeginUpdate; + inherited; +end; + +procedure TcxGridChartDataController.EndFullUpdate; +begin + inherited; + GridView.EndUpdate; +end; + +function TcxGridChartDataController.GetItem(Index: Integer): TObject; +begin + Result := Fields[Index].Item; +end; + +{ TcxGridChartTitlePainter } + +function TcxGridChartTitlePainter.GetViewInfo: TcxCustomGridChartTitleViewInfo; +begin + Result := TcxCustomGridChartTitleViewInfo(inherited ViewInfo); +end; + +procedure TcxGridChartTitlePainter.PrepareCanvasForDrawText; +begin + inherited; + if ViewInfo.Orientation = cpoVertical then + Canvas.SetFontAngle(90); +end; + +procedure TcxGridChartTitlePainter.UnprepareCanvasForDrawText; +begin + if ViewInfo.Orientation = cpoVertical then + Canvas.SetFontAngle(0); + inherited; +end; + +{ TcxGridChartLegendItemPainter } + +function TcxGridChartLegendItemPainter.GetViewInfo: TcxGridChartLegendItemViewInfo; +begin + Result := TcxGridChartLegendItemViewInfo(inherited ViewInfo); +end; + +procedure TcxGridChartLegendItemPainter.DrawContent; +begin + inherited; + DrawLegendKey; +end; + +procedure TcxGridChartLegendItemPainter.DrawLegendKey; +begin + Canvas.FillRect(ViewInfo.LegendKeyBounds, ViewInfo.LegendKeyParams, + ViewInfo.LegendKeyBorders, ViewInfo.LegendKeyParams.TextColor); +end; + +{ TcxGridChartLegendPainter } + +function TcxGridChartLegendPainter.GetViewInfo: TcxGridChartLegendViewInfo; +begin + Result := TcxGridChartLegendViewInfo(inherited ViewInfo); +end; + +procedure TcxGridChartLegendPainter.DrawContent; +var + I: Integer; +begin + inherited; + for I := 0 to ViewInfo.Count - 1 do + ViewInfo.Items[I].Paint(Canvas); +end; + +function TcxGridChartLegendPainter.ExcludeFromClipRect: Boolean; +begin + Result := True; +end; + +{ TcxGridChartDiagramPainter } + +function TcxGridChartDiagramPainter.GetViewInfo: TcxGridChartDiagramViewInfo; +begin + Result := TcxGridChartDiagramViewInfo(inherited ViewInfo); +end; + +procedure TcxGridChartDiagramPainter.DrawValueCaptions; +var + AClipRegion, AUsedSpaceRegion, ARegion: TcxRegion; + I: Integer; + AValueCaptionViewInfo: TcxGridChartDiagramValueCaptionViewInfo; + ABounds: TRect; +begin + AClipRegion := Canvas.GetClipRegion; + AUsedSpaceRegion := TcxRegion.Create; + try + for I := 0 to ViewInfo.ValueViewInfoCount - 1 do + begin + PrepareClipRegionForValueDrawing(ViewInfo.ValueViewInfos[I], AClipRegion); + AValueCaptionViewInfo := ViewInfo.ValueViewInfos[I].CaptionViewInfo; + if AValueCaptionViewInfo.Visible then + begin + ABounds := AValueCaptionViewInfo.Bounds; + ARegion := TcxRegion.Create(ABounds); + try + ARegion.Combine(AUsedSpaceRegion, roIntersect, False); + if ARegion.IsEmpty then + begin + AValueCaptionViewInfo.Paint(Canvas); + AUsedSpaceRegion.Combine(TcxRegion.Create(ABounds), roAdd); + end; + finally + ARegion.Free; + end; + end; + end; + finally + AUsedSpaceRegion.Free; + AClipRegion.Free; + end; +end; + +procedure TcxGridChartDiagramPainter.DrawValues; +var + AClipRegion: TcxRegion; + I: Integer; +begin + AClipRegion := Canvas.GetClipRegion; + try + for I := 0 to ViewInfo.ValueViewInfoCount - 1 do + begin + PrepareClipRegionForValueDrawing(ViewInfo.ValueViewInfos[I], AClipRegion); + ViewInfo.ValueViewInfos[I].Paint(Canvas); + end; + finally + AClipRegion.Free; + end; +end; + +procedure TcxGridChartDiagramPainter.FillAndExcludeRect(const R: TRect); +begin + Canvas.FillRect(R); + Canvas.ExcludeClipRect(R); +end; + +function TcxGridChartDiagramPainter.NeedsPainting: Boolean; +var + I: Integer; + AValueCaptionViewInfo: TcxGridChartDiagramValueCaptionViewInfo; +begin + Result := inherited NeedsPainting; + if not Result then + for I := 0 to ViewInfo.ValueViewInfoCount - 1 do + begin + AValueCaptionViewInfo := ViewInfo.ValueViewInfos[I].CaptionViewInfo; + Result := AValueCaptionViewInfo.Visible and + Canvas.RectVisible(AValueCaptionViewInfo.GetAreaBoundsForPainting); + if Result then Break; + end; +end; + +procedure TcxGridChartDiagramPainter.Paint; +begin + inherited; + DrawValueCaptions; +end; + +procedure TcxGridChartDiagramPainter.PrepareClipRegionForValueDrawing( + AValueViewInfo: TcxGridChartDiagramValueViewInfo; AOriginalClipRegion: TcxRegion); +begin +end; + +{ TcxGridChartHistogramTickMarkLabelsPainter } + +function TcxGridChartHistogramTickMarkLabelsPainter.GetViewInfo: TcxGridChartHistogramTickMarkLabelsViewInfo; +begin + Result := TcxGridChartHistogramTickMarkLabelsViewInfo(inherited ViewInfo); +end; + +procedure TcxGridChartHistogramTickMarkLabelsPainter.DrawCaptions; +var + I: Integer; + ABounds: TRect; +begin + Canvas.SetParams(ViewInfo.Params); + Canvas.Brush.Style := bsClear; + for I := 0 to ViewInfo.Count - 1 do + begin + ABounds := ViewInfo.CaptionBounds[I]; + if not ViewInfo.IsVertical or Canvas.RectFullyVisible(ABounds) then + begin + Canvas.DrawText(ViewInfo.Captions[I], ABounds, ViewInfo.GetTextAttributes(True)); + if ViewInfo.IsVertical then + Canvas.ExcludeClipRect(ABounds); + end; + end; + Canvas.Brush.Style := bsSolid; +end; + +procedure TcxGridChartHistogramTickMarkLabelsPainter.DrawContent; +begin + if ViewInfo.CaptionsVisible then + DrawCaptions; + ViewInfo.TitleViewInfo.Paint(Canvas); +end; + +{ TcxGridChartHistogramPainter } + +function TcxGridChartHistogramPainter.GetViewInfo: TcxGridChartHistogramViewInfo; +begin + Result := TcxGridChartHistogramViewInfo(inherited ViewInfo); +end; + +procedure TcxGridChartHistogramPainter.DrawCategoryAxis; +var + R: TRect; + I: Integer; +begin + Canvas.Brush.Color := ViewInfo.CategoryAxisColor; + + R := ViewInfo.CategoryAxisBounds; + FillAndExcludeRect(R); + + for I := 0 to ViewInfo.CategoryMarkCount - 1 do + begin + R := ViewInfo.CategoryMarkBounds[I]; + FillAndExcludeRect(R); + end; +end; + +procedure TcxGridChartHistogramPainter.DrawCategoryGridLines; +var + I: Integer; + R: TRect; +begin + Canvas.Brush.Color := ViewInfo.CategoryGridLineColor; + for I := 0 to ViewInfo.CategoryMarkCount - 1 do + begin + R := ViewInfo.CategoryGridLineBounds[I]; + FillAndExcludeRect(R); + end; +end; + +procedure TcxGridChartHistogramPainter.DrawContent; +var + AClipRegion, APlotClipRegion: TcxRegion; +begin + AClipRegion := Canvas.GetClipRegion; + try + if ViewInfo.HasCategoryAxis then DrawCategoryAxis; + if ViewInfo.HasValueAxis then DrawValueAxis; + APlotClipRegion := Canvas.GetClipRegion; + try + APlotClipRegion.Combine(TcxRegion.Create(ViewInfo.PlotBounds), roSubtract); + SetValuesClipRegion; + DrawValuesBackground; + if not TransparentValues then DrawValues; + if ViewInfo.HasCategoryGridLines then DrawCategoryGridLines; + if ViewInfo.HasValueGridLines then DrawValueGridLines; + if not ViewInfo.DoCustomDrawPlot(Canvas) then + DrawPlotBackground; + finally + Canvas.SetClipRegion(APlotClipRegion, roSet); + end; + inherited; + finally + Canvas.SetClipRegion(AClipRegion, roSet); + end; + ViewInfo.CategoryTickMarkLabelsViewInfo.Paint(Canvas); + ViewInfo.ValueTickMarkLabelsViewInfo.Paint(Canvas); + if TransparentValues then + begin + AClipRegion := Canvas.GetClipRegion; + try + SetValuesClipRegion; + DrawValues; + finally + Canvas.SetClipRegion(AClipRegion, roSet); + end; + end; +end; + +procedure TcxGridChartHistogramPainter.DrawPlotBackground; +begin + Canvas.FillRect(ViewInfo.PlotBounds, ViewInfo.PlotParams); + Canvas.ExcludeClipRect(ViewInfo.PlotBounds); +end; + +procedure TcxGridChartHistogramPainter.DrawValueAxis; +var + R: TRect; + I: Integer; +begin + Canvas.Brush.Color := ViewInfo.ValueAxisColor; + + R := ViewInfo.ValueAxisBounds; + FillAndExcludeRect(R); + + for I := 0 to ViewInfo.ValueMarkCount - 1 do + begin + R := ViewInfo.ValueMarkBounds[I]; + FillAndExcludeRect(R); + end; +end; + +procedure TcxGridChartHistogramPainter.DrawValueGridLines; +var + I: Integer; + R: TRect; +begin + Canvas.Brush.Color := ViewInfo.ValueGridLineColor; + for I := 0 to ViewInfo.ValueMarkCount - 1 do + begin + R := ViewInfo.ValueGridLineBounds[I]; + FillAndExcludeRect(R); + end; +end; + +procedure TcxGridChartHistogramPainter.DrawValuesBackground; +begin +end; + +function TcxGridChartHistogramPainter.GetValuesClipRect: TRect; +begin + Result := ViewInfo.Bounds; + if ViewInfo.IsValueAxisVert then + begin + Result.Top := ViewInfo.PlotBounds.Top; + Result.Bottom := ViewInfo.PlotBounds.Bottom; + end + else + begin + Result.Left := ViewInfo.PlotBounds.Left; + Result.Right := ViewInfo.PlotBounds.Right; + end; +end; + +procedure TcxGridChartHistogramPainter.SetValuesClipRegion; +begin + if ViewInfo.HasValuesOutOfRange then + Canvas.SetClipRegion(TcxRegion.Create(GetValuesClipRect), roIntersect); +end; + +{ TcxGridChartColumnDiagramValuePainter } + +function TcxGridChartColumnDiagramValuePainter.ExcludeFromClipRect: Boolean; +begin + Result := True; +end; + +{ TcxGridChartColumnDiagramPainter } + +function TcxGridChartColumnDiagramPainter.GetTransparentValues: Boolean; +begin + Result := False; +end; + +{ TcxGridChartLineDiagramLegendItemPainter } + +function TcxGridChartLineDiagramLegendItemPainter.GetViewInfo: TcxGridChartLineDiagramLegendItemViewInfo; +begin + Result := TcxGridChartLineDiagramLegendItemViewInfo(inherited ViewInfo); +end; + +procedure TcxGridChartLineDiagramLegendItemPainter.DrawLegendKey; +begin + DrawMarker; + DrawLine; +end; + +procedure TcxGridChartLineDiagramLegendItemPainter.DrawLine; +begin + ViewInfo.GetDiagramValueViewInfoClass.GetPainterClassEx.DrawLineEx(Canvas, + ViewInfo.LineStart, ViewInfo.LineFinish, ViewInfo.LineStyle, ViewInfo.LineWidth, + ViewInfo.LineColor); +end; + +procedure TcxGridChartLineDiagramLegendItemPainter.DrawMarker; +begin + ViewInfo.GetDiagramValueViewInfoClass.GetPainterClassEx.DrawMarkerEx( + Canvas, ViewInfo.MarkerBounds, ViewInfo.MarkerPoints, ViewInfo.MarkerStyle, + ViewInfo.MarkerParams); +end; + +{ TcxGridChartLineDiagramValuePainter } + +function TcxGridChartLineDiagramValuePainter.GetViewInfo: TcxGridChartLineDiagramValueViewInfo; +begin + Result := TcxGridChartLineDiagramValueViewInfo(inherited ViewInfo); +end; + +function TcxGridChartLineDiagramValuePainter.CanDrawDesignSelection: Boolean; +begin + Result := False; +end; + +procedure TcxGridChartLineDiagramValuePainter.DrawContent; +begin + inherited; + DrawMarker; + DrawLine; +end; + +procedure TcxGridChartLineDiagramValuePainter.DrawLine; +begin + DrawLineEx(Canvas, ViewInfo.LineStart, ViewInfo.LineFinish, ViewInfo.LineStyle, + ViewInfo.LineWidth, ViewInfo.LineColor); +end; + +procedure TcxGridChartLineDiagramValuePainter.DrawMarker; +begin + DrawMarkerEx(Canvas, ViewInfo.MarkerBounds, ViewInfo.MarkerPoints, + ViewInfo.MarkerStyle, ViewInfo.MarkerParams); +end; + +class procedure TcxGridChartLineDiagramValuePainter.DrawLineEx(ACanvas: TcxCanvas; + const AStart, AFinish: TPoint; AStyle: TcxGridChartLineStyle; + AWidth: Integer; AColor: TColor); +var + APoints: TPointArray; +begin + SetLength(APoints, 2); + APoints[0] := AStart; + APoints[1] := AFinish; + DrawLines(ACanvas, APoints, AStyle, AWidth, AColor); +end; + +class procedure TcxGridChartLineDiagramValuePainter.DrawLines(ACanvas: TcxCanvas; + const APoints: TPointArray; AStyle: TcxGridChartLineStyle; AWidth: Integer; AColor: TColor); +const + PenTypes: array[Boolean] of Integer = (PS_COSMETIC, PS_GEOMETRIC); + PenStyles: array[TcxGridChartLineStyle] of Integer = + (0, PS_SOLID, PS_DASH, PS_DOT, PS_DASHDOT, PS_DASHDOTDOT); +var + APen: HPEN; + APenParams: TLogBrush; +begin + if AStyle = clsNone then Exit; + + APenParams.lbStyle := BS_SOLID; + APenParams.lbColor := AColor; + APenParams.lbHatch := 0; + APen := ExtCreatePen(PenTypes[AWidth <> 1] or PenStyles[AStyle], AWidth, + APenParams, 0, nil); + APen := SelectObject(ACanvas.Handle, APen); + + Polyline(ACanvas.Handle, APoints[0], Length(APoints)); + + DeleteObject(SelectObject(ACanvas.Handle, APen)); +end; + +class procedure TcxGridChartLineDiagramValuePainter.DrawMarkerEx(ACanvas: TcxCanvas; + const ABounds: TRect; const APoints: TPointArray; AStyle: TcxGridChartMarkerStyle; + const AParams: TcxViewParams); +var + ARegion, AInternalRegion: TcxRegion; + ARgn: HRGN; + R: TRect; +begin + case AStyle of + cmsSquare, cmsTriangle, cmsDiamond: + begin + if AStyle = cmsSquare then + ARgn := CreateRectRgnIndirect(ABounds) + else + ARgn := CreatePolygonRgn(APoints[0], Length(APoints), WINDING); + ARegion := TcxRegion.Create(ARgn); + try + ACanvas.DrawRegion(ARegion, AParams.Color, AParams.TextColor); + finally + ACanvas.SetClipRegion(ARegion, roSubtract); + end; + end; + cmsCircle: + begin + R := ABounds; + Inc(R.Right); + Inc(R.Bottom); + ARegion := TcxRegion.Create(CreateEllipticRgnIndirect(R)); + try + ACanvas.FillRegion(ARegion, AParams.TextColor); + if ABounds.Right - ABounds.Left = 4 then + InflateRect(R, 0, -1) + else + InflateRect(R, -1, -1); + AInternalRegion := TcxRegion.Create(CreateEllipticRgnIndirect(R)); + try + ACanvas.FillRegion(AInternalRegion, AParams.Color); + finally + AInternalRegion.Free; + end; + finally + ACanvas.SetClipRegion(ARegion, roSubtract); + end; + end; + end; +end; + +{ TcxGridChartLineDiagramPainter } + +procedure TcxGridChartLineDiagramPainter.DrawContent; +begin + inherited; + DrawValuesDesignSelection; +end; + +procedure TcxGridChartLineDiagramPainter.DrawValuesDesignSelection; +var + I: Integer; + AViewInfo: TcxGridChartDiagramValueViewInfo; +begin + for I := 0 to ViewInfo.ValueViewInfoCount - 1 do + begin + AViewInfo := ViewInfo.ValueViewInfos[I]; + AViewInfo.GetPainterClass.DoDrawDesignSelection(Canvas, AViewInfo); + end; +end; + +function TcxGridChartLineDiagramPainter.GetTransparentValues: Boolean; +begin + Result := True; +end; + +{ TcxGridChartAreaDiagramLegendItemPainter } + +procedure TcxGridChartAreaDiagramLegendItemPainter.DrawAreaBackground; +begin + Canvas.FillRect(ViewInfo.LegendKeyBounds, ViewInfo.LegendKeyParams); +end; + +procedure TcxGridChartAreaDiagramLegendItemPainter.DrawAreaBorder; + + function GetPointsRect: TRect; + begin + Result := ViewInfo.LegendKeyBounds; + InflateRect(Result, -ViewInfo.LineWidth div 2, -ViewInfo.LineWidth div 2); + if Odd(ViewInfo.LineWidth) then + begin + Dec(Result.Right); + Dec(Result.Bottom); + end; + end; + + procedure CalculatePointsForRect(const ARect: TRect; var APoints: TPointArray); + begin + SetLength(APoints, 5); + APoints[0] := ARect.TopLeft; + APoints[1] := Point(ARect.Right, ARect.Top); + APoints[2] := ARect.BottomRight; + APoints[3] := Point(ARect.Left, ARect.Bottom); + APoints[4] := APoints[0]; + end; + +var + APoints: TPointArray; +begin + if ViewInfo.LineStyle = clsNone then Exit; + CalculatePointsForRect(GetPointsRect, APoints); + ViewInfo.GetDiagramValueViewInfoClass.GetPainterClassEx.DrawLines(Canvas, + APoints, ViewInfo.LineStyle, ViewInfo.LineWidth, ViewInfo.LineColor); +end; + +procedure TcxGridChartAreaDiagramLegendItemPainter.DrawLegendKey; +begin + DrawMarker; + DrawAreaBackground; + DrawAreaBorder; +end; + +{ TcxGridChartAreaDiagramValuePainter } + +function TcxGridChartAreaDiagramValuePainter.GetViewInfo: TcxGridChartAreaDiagramValueViewInfo; +begin + Result := TcxGridChartAreaDiagramValueViewInfo(inherited ViewInfo); +end; + +procedure TcxGridChartAreaDiagramValuePainter.DoDrawArea; +begin + if not ViewInfo.DoCustomDrawBackground(Canvas) then + DrawArea; +end; + +procedure TcxGridChartAreaDiagramValuePainter.DrawArea; +begin + Canvas.Pen.Color := ViewInfo.AreaColor; + Canvas.Brush.Color := ViewInfo.AreaColor; + Canvas.Polygon(ViewInfo.AreaPoints); +end; + +{ TcxGridChartAreaDiagramPainter } + +procedure TcxGridChartAreaDiagramPainter.DrawValuesBackground; +var + ABackgroundRegion: TcxRegion; + I: Integer; + AValueViewInfo: TcxGridChartAreaDiagramValueViewInfo; +begin + inherited; + ABackgroundRegion := nil; + for I := 0 to ViewInfo.ValueViewInfoCount - 1 do + begin + AValueViewInfo := TcxGridChartAreaDiagramValueViewInfo(ViewInfo.ValueViewInfos[I]); + + with TcxGridChartAreaDiagramValuePainter(AValueViewInfo.GetPainterClass.Create(Canvas, AValueViewInfo)) do + try + DoDrawArea; + finally + Free; + end; + + if ABackgroundRegion = nil then + ABackgroundRegion := TcxRegion.Create; + ABackgroundRegion.Combine(AValueViewInfo.CreateAreaRegion, roAdd); + if (I = ViewInfo.ValueViewInfoCount - 1) or + (ViewInfo.ValueViewInfos[I + 1].SeriesIndex <> AValueViewInfo.SeriesIndex) then + begin + Canvas.SetClipRegion(ABackgroundRegion, roSubtract); + ABackgroundRegion := nil; + end; + end; +end; + +{ TcxGridChartPieDiagramValuePainter } + +function TcxGridChartPieDiagramValuePainter.GetViewInfo: TcxGridChartPieDiagramValueViewInfo; +begin + Result := TcxGridChartPieDiagramValueViewInfo(inherited ViewInfo); +end; + +procedure TcxGridChartPieDiagramValuePainter.DrawContent; +begin + inherited; + DrawSlice; +end; + +procedure TcxGridChartPieDiagramValuePainter.DrawLeaderLine; +begin + Canvas.Pen.Color := ViewInfo.Params.TextColor; + Canvas.Polyline(ViewInfo.LeaderLinePoints); +end; + +procedure TcxGridChartPieDiagramValuePainter.DrawSlice; +begin + Canvas.SetParams(ViewInfo.Params); + Canvas.Pen.Color := ViewInfo.Params.TextColor; + Canvas.Pie(ViewInfo.Bounds, 90 - ViewInfo.FinishAngle, + ViewInfo.FinishAngle - ViewInfo.StartAngle); +end; + +procedure TcxGridChartPieDiagramValuePainter.MainPaint; +begin + inherited; + if ViewInfo.CaptionPosition = pdvcpOutsideEndWithLeaderLines then + DrawLeaderLine; +end; + +{ TcxGridChartPieSeriesSiteCaptionPainter } + +function TcxGridChartPieSeriesSiteCaptionPainter.ExcludeFromClipRect: Boolean; +begin + Result := True; +end; + +{ TcxGridChartPieSeriesSitePainter } + +function TcxGridChartPieSeriesSitePainter.CanDrawDesignSelection: Boolean; +begin + Result := False; +end; + +function TcxGridChartPieSeriesSitePainter.ExcludeFromClipRect: Boolean; +begin + Result := True; +end; + +{ TcxGridChartPieDiagramPainter } + +function TcxGridChartPieDiagramPainter.GetViewInfo: TcxGridChartPieDiagramViewInfo; +begin + Result := TcxGridChartPieDiagramViewInfo(inherited ViewInfo); +end; + +procedure TcxGridChartPieDiagramPainter.DrawContent; +var + AClipRegion: TcxRegion; +begin + AClipRegion := Canvas.GetClipRegion; + try + ExcludeSeriesPieAreasFromClipRegion; + DrawSeriesSites; + inherited; + finally + Canvas.SetClipRegion(AClipRegion, roSet); + end; + DrawValues; + DrawSeriesDesignSelection; +end; + +procedure TcxGridChartPieDiagramPainter.DrawSeriesDesignSelection; +var + I: Integer; + ASeriesSiteViewInfo: TcxGridChartPieSeriesSiteViewInfo; +begin + for I := 0 to ViewInfo.SeriesSiteViewInfoCount - 1 do + begin + ASeriesSiteViewInfo := ViewInfo.SeriesSiteViewInfos[I]; + ASeriesSiteViewInfo.GetPainterClass.DoDrawDesignSelection(Canvas, ASeriesSiteViewInfo); + end; +end; + +procedure TcxGridChartPieDiagramPainter.DrawSeriesSites; +var + I: Integer; +begin + for I := 0 to ViewInfo.SeriesSiteViewInfoCount - 1 do + ViewInfo.SeriesSiteViewInfos[I].Paint(Canvas); +end; + +procedure TcxGridChartPieDiagramPainter.DrawValues; +var + AClipRegion: TcxRegion; +begin + AClipRegion := Canvas.GetClipRegion; + try + inherited; + finally + Canvas.SetClipRegion(AClipRegion, roSet); + end; +end; + +procedure TcxGridChartPieDiagramPainter.ExcludeSeriesPieAreasFromClipRegion; +var + I: Integer; + R: TRect; +begin + for I := 0 to ViewInfo.SeriesSiteViewInfoCount - 1 do + if not ViewInfo.SeriesSiteViewInfos[I].IsPieEmpty then + begin + R := ViewInfo.SeriesSiteViewInfos[I].PieAreaBounds; + InflateRect(R, -1, -1); // to fill the gap between drawn pie and elliptic region + if not IsRectEmpty(R) then + Canvas.SetClipRegion(TcxRegion.Create(CreateEllipticRgnIndirect(R)), roSubtract); + end; +end; + +procedure TcxGridChartPieDiagramPainter.PrepareClipRegionForValueDrawing( + AValueViewInfo: TcxGridChartDiagramValueViewInfo; AOriginalClipRegion: TcxRegion); +var + ARegion: TcxRegion; +begin + if AValueViewInfo.VisibleValueIndex <> 0 then Exit; + ARegion := TcxRegion.Create(ViewInfo.SeriesSiteViewInfos[AValueViewInfo.SeriesIndex].ContentBounds); + ARegion.Combine(AOriginalClipRegion, roIntersect, False); + Canvas.SetClipRegion(ARegion, roSet); +end; + +{ TcxGridChartToolBoxItemSeparatorPainter } + +procedure TcxGridChartToolBoxItemSeparatorPainter.DrawContent; +begin + Canvas.Pen.Color := ViewInfo.Params.Color; + Canvas.Pen.Style := psDot; + with ViewInfo.Bounds do + begin + Canvas.MoveTo(Left, Top); + Canvas.LineTo(Left, Bottom); + end; + Canvas.Pen.Style := psSolid; +{ Canvas.Brush.Color := ViewInfo.ItemSeparatorColor; + Canvas.FillRect(ViewInfo.Bounds);} +end; + +{ TcxGridChartToolBoxDataLevelActiveValuePainter } + +function TcxGridChartToolBoxDataLevelActiveValuePainter.GetViewInfo: TcxGridChartToolBoxDataLevelActiveValueViewInfo; +begin + Result := TcxGridChartToolBoxDataLevelActiveValueViewInfo(inherited ViewInfo); +end; + +procedure TcxGridChartToolBoxDataLevelActiveValuePainter.PrepareCanvasForDrawText; +begin + inherited; + if ViewInfo.GridView.Controller.CanShowDataLevelActiveValuePopup(False) then + with Canvas.Font do + Style := Style + [fsUnderline]; +end; + +{ TcxGridChartToolBoxDataLevelInfoPainter } + +procedure TcxGridChartToolBoxDataLevelInfoPainter.DrawBackground; +begin + DrawBackground(ViewInfo.ContentBounds); +end; + +function TcxGridChartToolBoxDataLevelInfoPainter.ExcludeFromClipRect: Boolean; +begin + Result := True; +end; + +{ TcxGridChartToolBoxCustomizeButtonPainter } + +function TcxGridChartToolBoxCustomizeButtonPainter.GetViewInfo: TcxGridChartToolBoxCustomizeButtonViewInfo; +begin + Result := TcxGridChartToolBoxCustomizeButtonViewInfo(inherited ViewInfo); +end; + +procedure TcxGridChartToolBoxCustomizeButtonPainter.Paint; +begin + Canvas.Font := ViewInfo.Params.Font; + ViewInfo.LookAndFeelPainter.DrawButton(Canvas, ViewInfo.Bounds, ViewInfo.Text, + ViewInfo.ButtonState); +end; + +{ TcxGridChartToolBoxDiagramSelectorPainter } + +function TcxGridChartToolBoxDiagramSelectorPainter.GetViewInfo: TcxGridChartToolBoxDiagramSelectorViewInfo; +begin + Result := TcxGridChartToolBoxDiagramSelectorViewInfo(inherited ViewInfo); +end; + +procedure TcxGridChartToolBoxDiagramSelectorPainter.DrawContent; +begin + inherited; + DrawImage; +end; + +procedure TcxGridChartToolBoxDiagramSelectorPainter.DrawImage; +begin + if ViewInfo.ImageIndex <> -1 then + with ViewInfo.ImageBounds do + cxGridChartDiagramImages.Draw(Canvas.Canvas, Left, Top, ViewInfo.ImageIndex); +end; + +procedure TcxGridChartToolBoxDiagramSelectorPainter.PrepareCanvasForDrawText; +begin + inherited; + if ViewInfo.CanShowDropDownWindow then + with Canvas.Font do + Style := Style + [fsUnderline]; +end; + +{ TcxGridChartToolBoxPainter } + +function TcxGridChartToolBoxPainter.GetViewInfo: TcxGridChartToolBoxViewInfo; +begin + Result := TcxGridChartToolBoxViewInfo(inherited ViewInfo); +end; + +procedure TcxGridChartToolBoxPainter.DrawContent; +var + AClipRegion: TcxRegion; +begin + AClipRegion := Canvas.GetClipRegion; + try + Canvas.IntersectClipRect(ViewInfo.ClientBounds); + DrawItems(True); + DrawDataLevelInfoConnectors; + inherited; + DrawItems(False); + finally + Canvas.SetClipRegion(AClipRegion, roSet); + end; +end; + +procedure TcxGridChartToolBoxPainter.DrawDataLevelInfoConnectors; +var + I: Integer; +begin + Canvas.Brush.Color := ViewInfo.DataLevelInfoConnectorColor; + for I := 0 to ViewInfo.DataLevelInfoConnectorCount - 1 do + Canvas.FillRect(ViewInfo.DataLevelInfoConnectors[I], nil, True); +end; + +procedure TcxGridChartToolBoxPainter.DrawItems(AOpaqueItems: Boolean); +var + I: Integer; +begin + for I := 0 to ViewInfo.Count - 1 do + if ViewInfo.Items[I].HasBackground = AOpaqueItems then + ViewInfo.Items[I].Paint(Canvas); +end; + +function TcxGridChartToolBoxPainter.ExcludeFromClipRect: Boolean; +begin + Result := True; +end; + +{ TcxGridChartPainter } + +function TcxGridChartPainter.GetViewInfo: TcxGridChartViewInfo; +begin + Result := TcxGridChartViewInfo(inherited ViewInfo); +end; + +procedure TcxGridChartPainter.PaintAfter; +begin + inherited; + ViewInfo.TitleViewInfo.Paint(Canvas); + if ViewInfo.DiagramViewInfo <> nil then + ViewInfo.DiagramViewInfo.Paint(Canvas); +end; + +procedure TcxGridChartPainter.PaintContent; +begin + inherited; + if ViewInfo.DiagramViewInfo <> nil then + ExcludeFromBackground(ViewInfo.DiagramViewInfo.Bounds); + ViewInfo.ToolBoxViewInfo.Paint(Canvas); + if ViewInfo.LegendViewInfo <> nil then + ViewInfo.LegendViewInfo.Paint(Canvas); +end; + +{ TcxGridChartViewData } + +constructor TcxGridChartViewData.Create(AGridView: TcxCustomGridView); +begin + inherited; + UpdateDataGroupIndex; +end; + +function TcxGridChartViewData.GetCategory(AIndex: Integer): Variant; +begin + Result := DataController.Values[AIndex, GridView.Categories.DataBinding.DataIndex]; +end; + +function TcxGridChartViewData.GetCategoryCount: Integer; +begin + Result := DataController.RecordCount; +end; + +function TcxGridChartViewData.GetChildCount: Integer; +begin + Result := DataController.Groups.ChildCount[DataGroupIndex]; +end; + +function TcxGridChartViewData.GetChildDataGroupIndex(Index: Integer): Integer; +begin + Result := DataController.Groups.ChildDataGroupIndex[DataGroupIndex, Index]; +end; + +function TcxGridChartViewData.GetChildLevel: Integer; +begin + Result := GridView.ActiveDataLevel; +end; + +function TcxGridChartViewData.GetChildRecordIndex(Index: Integer): Integer; +begin + Result := DataController.Groups.ChildRecordIndex[DataGroupIndex, Index]; +end; + +function TcxGridChartViewData.GetDataGroupIndex: Integer; +begin + if FDataGroupIndex = -2 then + FDataGroupIndex := CalculateDataGroupIndex; + Result := FDataGroupIndex; +end; + +function TcxGridChartViewData.GetGridView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +function TcxGridChartViewData.GetGroupValue(ADataGroupIndex, AIndex: Integer): Variant; +begin + Result := DataController.Values[AIndex, + GridView.DataGroups[ADataGroupIndex].DataBinding.DataIndex]; +end; + +function TcxGridChartViewData.GetSumOfValues(ASeriesIndex: Integer): Variant; +begin + if FSumOfValues = nil then CalculateSumsOfValues; + Result := FSumOfValues[ASeriesIndex]; +end; + +function TcxGridChartViewData.GetValue(ASeriesIndex, AIndex: Integer): Variant; +begin + Result := DataController.Values[AIndex, + GridView.Series[ASeriesIndex].DataBinding.DataIndex]; + if not IsValueValid(Result) then + Result := 0; +end; + +function TcxGridChartViewData.GetVisibleCategory(AIndex: Integer): Variant; +begin + if IsDataGrouped then + if IsSummaryLevel then + Result := DataController.Groups.GroupValues[ChildDataGroupIndex[AIndex]] + else + Result := Categories[ChildRecordIndex[AIndex]] + else + Result := Categories[GetRecordIndexByValueIndex(AIndex)]; +end; + +function TcxGridChartViewData.GetVisibleCategoryCount: Integer; +begin + if IsDataGrouped then + Result := ChildCount + else + Result := DataController.RowCount; +end; + +function TcxGridChartViewData.GetVisibleGroupValue(AVisibleDataGroupIndex, AIndex: Integer): Variant; +begin + Result := DataController.Groups.GroupValues[ + DataController.Groups.ChildDataGroupIndex[GetDataGroupIndexByLevel(AVisibleDataGroupIndex), AIndex]]; +end; + +function TcxGridChartViewData.GetVisibleGroupValueCount(AVisibleDataGroupIndex: Integer): Integer; +begin + Result := DataController.Groups.ChildCount[GetDataGroupIndexByLevel(AVisibleDataGroupIndex)]; +end; + +function TcxGridChartViewData.GetVisibleValue(ASeriesIndex, AIndex: Integer): Variant; +begin + if IsDataGrouped then + if IsSummaryLevel then + begin + Result := DataController.Summary.GroupSummaryValues[ + ChildDataGroupIndex[AIndex], + GridView.Series[ASeriesIndex].DataBinding.SummaryIndex]; + if not IsValueValid(Result) then + Result := 0; + end + else + Result := Values[ASeriesIndex, ChildRecordIndex[AIndex]] + else + Result := Values[ASeriesIndex, GetRecordIndexByValueIndex(AIndex)]; +end; + +procedure TcxGridChartViewData.SetCategory(AIndex: Integer; const Value: Variant); +begin + DataController.Values[AIndex, GridView.Categories.DataBinding.DataIndex] := Value; +end; + +procedure TcxGridChartViewData.SetCategoryCount(Value: Integer); +begin + DataController.RecordCount := Value; +end; + +procedure TcxGridChartViewData.SetGroupValue(ADataGroupIndex, AIndex: Integer; + const Value: Variant); +begin + DataController.Values[AIndex, + GridView.DataGroups[ADataGroupIndex].DataBinding.DataIndex] := Value; +end; + +procedure TcxGridChartViewData.SetValue(ASeriesIndex, AIndex: Integer; + const Value: Variant); +begin + DataController.Values[AIndex, + GridView.Series[ASeriesIndex].DataBinding.DataIndex] := Value; +end; + +function TcxGridChartViewData.CalculateDataGroupIndex: Integer; +begin + Result := GetDataGroupIndexByLevel(ChildLevel); +end; + +function TcxGridChartViewData.CalculateSumOfValues(ASeriesIndex: Integer): Variant; +var + I: Integer; +begin + Result := 0; + for I := 0 to VisibleCategoryCount - 1 do + Result := Result + Abs(VisibleValues[ASeriesIndex, I]); +end; + +procedure TcxGridChartViewData.CheckValueAtLevel(ALevel: Integer; var AValue: Variant); +var + ADataGroupIndex: Integer; +begin + ADataGroupIndex := GetDataGroupIndexByLevel(ALevel); + if (ADataGroupIndex = -2) or + (DataController.Groups.GetDataGroupIndexByGroupValue(ADataGroupIndex, AValue) = -1) then + AValue := Null; +end; + +function TcxGridChartViewData.GetDataGroupIndexByLevel(ALevel: Integer): Integer; +var + I, ADataGroupIndex: Integer; +begin + Result := -1; + for I := 0 to ALevel - 1 do + begin + ADataGroupIndex := DataController.Groups.GetDataGroupIndexByGroupValue(Result, + (DataController.GetItem(DataController.Groups.GroupingItemIndex[I]) as TcxGridChartDataGroup).ActiveValue); + if ADataGroupIndex = -1 then + begin + Result := -2; + Break; + end; +{ if ADataGroupIndex = -1 then + ADataGroupIndex := DataController.Groups.ChildDataGroupIndex[Result, 0];} + Result := ADataGroupIndex; + end; +end; + +function TcxGridChartViewData.GetRecordIndexByValueIndex(AValueIndex: Integer): Integer; +begin + Result := DataController.GetRowInfo(AValueIndex).RecordIndex; +end; + +procedure TcxGridChartViewData.DataLevelsChanged; +begin + UpdateDataGroupIndex; + UpdateSumsOfValues; +end; + +function TcxGridChartViewData.IsDataGrouped: Boolean; +begin + Result := DataController.Groups.GroupingItemCount <> 0; +end; + +function TcxGridChartViewData.IsSummaryLevel: Boolean; +begin + Result := ChildLevel < DataController.Groups.GroupingItemCount; +end; + +procedure TcxGridChartViewData.CalculateSumsOfValues; +var + I: Integer; +begin + SetLength(FSumOfValues, GridView.SeriesCount); + for I := 0 to GridView.SeriesCount - 1 do + FSumOfValues[I] := CalculateSumOfValues(I); +end; + +procedure TcxGridChartViewData.SeriesPosChanged(ASeries: TcxGridChartSeries); +begin + UpdateSumsOfValues; +end; + +procedure TcxGridChartViewData.Update(AInfo: TcxUpdateControlInfo); +begin + if (AInfo is TcxDataChangedInfo) or (AInfo is TcxLayoutChangedInfo) then + begin + DataLevelsChanged; + GridView.UpdateDataGroupActiveValues; + end; +end; + +procedure TcxGridChartViewData.UpdateDataGroupIndex; +begin + FDataGroupIndex := -2; +end; + +procedure TcxGridChartViewData.UpdateSumsOfValues; +begin + FSumOfValues := nil; +end; + +procedure TcxGridChartViewData.GetVisibleGroupValues(ADataGroup: TcxGridChartDataGroup; + AStrings: TStrings; out AValues: TVariantArray); +var + ADataGroupIndex, I: Integer; + AValue: Variant; +begin + ADataGroupIndex := GetDataGroupIndexByLevel(ADataGroup.VisibleIndex); + I := DataController.Groups.ChildCount[ADataGroupIndex]; + SetLength(AValues, I); + AStrings.BeginUpdate; + try + AStrings.Clear; + for I := 0 to I - 1 do + begin + AValue := DataController.Groups.GroupValues[ + DataController.Groups.ChildDataGroupIndex[ADataGroupIndex, I]]; + AStrings.Add(ADataGroup.GetValueDisplayText(AValue)); + AValues[I] := AValue; + end; + finally + AStrings.EndUpdate; + end; +end; + +{ TcxCustomGridChartPartViewInfo } + +function TcxCustomGridChartPartViewInfo.GetGridView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +function TcxCustomGridChartPartViewInfo.GetGridViewInfo: TcxGridChartViewInfo; +begin + Result := TcxGridChartViewInfo(inherited GridViewInfo); +end; + +function TcxCustomGridChartPartViewInfo.GetHeight: Integer; +begin + if inherited GetHeight = 0 then + Height := CalculateHeight; + Result := inherited GetHeight; +end; + +function TcxCustomGridChartPartViewInfo.GetVisible: Boolean; +begin + Result := Position <> cppNone; +end; + +function TcxCustomGridChartPartViewInfo.GetWidth: Integer; +begin + if inherited GetWidth = 0 then + Width := CalculateWidth; + Result := inherited GetWidth; +end; + +{ TcxCustomGridChartTitleViewInfo } + +constructor TcxCustomGridChartTitleViewInfo.Create(AGridViewInfo: TcxCustomGridViewInfo; + ATitle: TcxCustomGridChartTitle); +begin + inherited Create(AGridViewInfo); + FTitle := ATitle; +end; + +function TcxCustomGridChartTitleViewInfo.CalculateHeight: Integer; +begin + if Orientation = cpoHorizontal then + Result := TextHeight + else + Result := CalculateTextWidth(90); +end; + +function TcxCustomGridChartTitleViewInfo.CalculateWidth: Integer; +begin + if Orientation = cpoHorizontal then + Result := TextWidth + else + Result := CalculateTextHeight(False, 90); +end; + +function TcxCustomGridChartTitleViewInfo.GetAlignment: TcxGridChartPartAlignment; +begin + Result := FTitle.GetAlignment; +end; + +function TcxCustomGridChartTitleViewInfo.GetOrientation: TcxGridChartPartOrientation; +begin + Result := FTitle.GetOrientation; +end; + +function TcxCustomGridChartTitleViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartTitlePainter; +end; + +function TcxCustomGridChartTitleViewInfo.GetPosition: TcxGridChartPartPosition; +begin + Result := FTitle.GetPosition; +end; + +function TcxCustomGridChartTitleViewInfo.GetText: string; +begin + Result := FTitle.GetText; +end; + +function TcxCustomGridChartTitleViewInfo.GetTextAreaBounds: TRect; +begin + Result := ContentBounds; + if Orientation = cpoVertical then + SwapIntegers(Result.Top, Result.Bottom); +end; + +function TcxCustomGridChartTitleViewInfo.HasBackground: Boolean; +begin + Result := False; +end; + +{ TcxGridChartLegendItemViewInfo } + +constructor TcxGridChartLegendItemViewInfo.Create(AContainer: TcxGridChartLegendViewInfo; + AIndex: Integer); +begin + inherited Create(AContainer.GridViewInfo); + FContainer := AContainer; + FIndex := AIndex; +end; + +function TcxGridChartLegendItemViewInfo.GetDiagram: TcxGridChartDiagram; +begin + Result := FContainer.Diagram; +end; + +function TcxGridChartLegendItemViewInfo.GetGridView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +function TcxGridChartLegendItemViewInfo.GetLegendKeyHeight: Integer; +begin + Result := FContainer.ItemLegendKeyHeight; +end; + +function TcxGridChartLegendItemViewInfo.GetLegendKeyWidth: Integer; +begin + Result := FContainer.ItemLegendKeyWidth; +end; + +function TcxGridChartLegendItemViewInfo.GetSeries: TcxGridChartSeries; +begin + if Container.GetItemSeriesIndex(Index) = -1 then + Result := nil + else + Result := GridView.VisibleSeries[Container.GetItemSeriesIndex(Index)]; +end; + +function TcxGridChartLegendItemViewInfo.CalculateContentBounds: TRect; +begin + Result := inherited CalculateContentBounds; + InflateRect(Result, -LegendKeyOffset div 2, 0); +end; + +function TcxGridChartLegendItemViewInfo.CalculateHeight: Integer; +begin + Result := TextHeight; +end; + +function TcxGridChartLegendItemViewInfo.CalculateWidth: Integer; +begin + Result := TextWidth; + Inc(Result, LegendKeyOffset div 2 * 2 + LegendKeyWidth + LegendKeyOffset); +end; + +function TcxGridChartLegendItemViewInfo.CalculateLegendKeyHeight: Integer; +begin + Result := CalculateLegendKeySize; +end; + +function TcxGridChartLegendItemViewInfo.CalculateLegendKeySize: Integer; +begin + Result := 2 * LegendKeyOffset; +end; + +function TcxGridChartLegendItemViewInfo.CalculateLegendKeyWidth: Integer; +begin + Result := CalculateLegendKeySize; +end; + +function TcxGridChartLegendItemViewInfo.CustomDraw(ACanvas: TcxCanvas): Boolean; +begin + Result := inherited CustomDraw(ACanvas); + if not Result then + begin + Diagram.DoCustomDrawLegendItem(ACanvas, Self, Result); + if not Result then + GridView.DoCustomDrawLegendItem(ACanvas, Self, Result); + end; +end; + +procedure TcxGridChartLegendItemViewInfo.DoCalculateParams; +begin + inherited; + Container.GetItemLegendKeyParams(Index, LegendKeyParams); +end; + +function TcxGridChartLegendItemViewInfo.GetDesignSelectionBounds: TRect; +begin + Result := Bounds; + InflateRect(Result, DesignSelectionWidth, DesignSelectionWidth); +end; + +function TcxGridChartLegendItemViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridChartLegendItemHitTest; +end; + +function TcxGridChartLegendItemViewInfo.GetIsDesignSelected: Boolean; +begin + Result := (Container.Kind = lkSeries) and GridView.IsDesigning and + GridView.Controller.DesignController.IsObjectSelected(Series); +end; + +function TcxGridChartLegendItemViewInfo.GetLegendKeyBorders: TcxBorders; +begin + if Diagram.Legend.GetKeyBorder = lbSingle then + Result := cxBordersAll + else + Result := []; +end; + +function TcxGridChartLegendItemViewInfo.GetLegendKeyBounds: TRect; +begin + CalculateParams; + Result := ContentBounds; + with Result do + begin + Right := Left + LegendKeyWidth; + Top := MulDiv(Top + Bottom - LegendKeyHeight, 1, 2); + Bottom := Top + LegendKeyHeight; + end; +end; + +function TcxGridChartLegendItemViewInfo.GetLegendKeyOffset: Integer; +begin + CalculateParams; + Result := MulDiv(Canvas.FontHeight(Params.Font), 3, 8); +end; + +function TcxGridChartLegendItemViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartLegendItemPainter; +end; + +function TcxGridChartLegendItemViewInfo.GetText: string; +begin + Result := FContainer.GetItemCaption(FIndex); +end; + +function TcxGridChartLegendItemViewInfo.GetTextAreaBounds: TRect; +begin + Result := ContentBounds; + Inc(Result.Left, LegendKeyWidth + LegendKeyOffset); +end; + +procedure TcxGridChartLegendItemViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + FContainer.GetViewParams(AParams); +end; + +function TcxGridChartLegendItemViewInfo.HasBackground: Boolean; +begin + Result := False; +end; + +function TcxGridChartLegendItemViewInfo.HasCustomDraw: Boolean; +begin + Result := Diagram.HasCustomDrawLegendItem or GridView.HasCustomDrawLegendItem; +end; + +procedure TcxGridChartLegendItemViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + inherited; + with AHitTest as TcxGridChartLegendItemHitTest do + begin + Index := Self.Index; + Series := Self.Series; + ValueIndex := Container.GetItemValueIndex(Self.Index); + end; +end; + +function TcxGridChartLegendItemViewInfo.GetAreaBoundsForPainting: TRect; +begin + Result := DesignSelectionBounds; +end; + +function TcxGridChartLegendItemViewInfo.MouseDown(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +begin + Result := inherited MouseDown(AHitTest, AButton, AShift); + if (Container.Kind = lkSeries) and + (AButton = mbLeft) and not (ssDouble in AShift) and GridView.IsDesigning then + begin + GridView.Controller.DesignController.SelectObject(Series, not (ssShift in AShift)); + Result := True; + end; +end; + +{ TcxGridChartLegendViewInfo } + +constructor TcxGridChartLegendViewInfo.Create(AGridViewInfo: TcxCustomGridViewInfo; + ADiagram: TcxGridChartDiagram); +var + I: Integer; +begin + inherited Create(AGridViewInfo); + FDiagram := ADiagram; + FItems := TList.Create; + for I := 0 to GetItemCount - 1 do + AddItem; +end; + +destructor TcxGridChartLegendViewInfo.Destroy; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].Free; + FItems.Free; + inherited; +end; + +function TcxGridChartLegendViewInfo.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxGridChartLegendViewInfo.GetItem(Index: Integer): TcxGridChartLegendItemViewInfo; +begin + Result := TcxGridChartLegendItemViewInfo(FItems[Index]); +end; + +function TcxGridChartLegendViewInfo.GetItemLegendKeyWidth: Integer; +begin + if FItemLegendKeyWidth = 0 then + FItemLegendKeyWidth := CalculateItemLegendKeyWidth; + Result := FItemLegendKeyWidth; +end; + +function TcxGridChartLegendViewInfo.GetItemLegendKeyHeight: Integer; +begin + if FItemLegendKeyHeight = 0 then + FItemLegendKeyHeight := CalculateItemLegendKeyHeight; + Result := FItemLegendKeyHeight; +end; + +function TcxGridChartLegendViewInfo.GetItemOffset: Integer; +begin + if FItemOffset = 0 then + FItemOffset := CalculateItemOffset; + Result := FItemOffset; +end; + +function TcxGridChartLegendViewInfo.CalculateHeight: Integer; +var + I: Integer; +begin + CalculateParams; + if Orientation = cpoHorizontal then + begin + Result := 0; + for I := 0 to Count - 1 do + Result := Max(Result, Items[I].CalculateHeight); + end + else + begin + Result := ItemOffset * (Count - 1); + for I := 0 to Count - 1 do + Inc(Result, Items[I].CalculateHeight); + end; + Inc(Result, BorderSize[bTop] + BorderSize[bBottom] + 2 * ItemOffset); +end; + +function TcxGridChartLegendViewInfo.CalculateWidth: Integer; +var + I: Integer; +begin + CalculateParams; + if Orientation = cpoHorizontal then + begin + Result := ItemOffset * (Count - 1); + for I := 0 to Count - 1 do + Inc(Result, Items[I].CalculateWidth); + end + else + begin + Result := 0; + for I := 0 to Count - 1 do + Result := Max(Result, Items[I].CalculateWidth); + end; + Inc(Result, BorderSize[bLeft] + BorderSize[bRight] + 2 * ItemOffset); +end; + +function TcxGridChartLegendViewInfo.CalculateItemLegendKeyWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + Result := Max(Result, Items[I].CalculateLegendKeyWidth); +end; + +function TcxGridChartLegendViewInfo.CalculateItemLegendKeyHeight: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + Result := Max(Result, Items[I].CalculateLegendKeyHeight); +end; + +function TcxGridChartLegendViewInfo.CalculateItemOffset: Integer; +begin + CalculateParams; + Result := MulDiv(Canvas.FontHeight(Params.Font), 1, 4); +end; + +function TcxGridChartLegendViewInfo.CustomDraw(ACanvas: TcxCanvas): Boolean; +begin + Result := inherited CustomDraw(ACanvas); + if not Result then + begin + Diagram.DoCustomDrawLegend(ACanvas, Self, Result); + if not Result then + GridView.DoCustomDrawLegend(ACanvas, Self, Result); + end; +end; + +function TcxGridChartLegendViewInfo.GetAlignment: TcxGridChartPartAlignment; +begin + Result := Diagram.Legend.GetAlignment; +end; + +function TcxGridChartLegendViewInfo.GetBorderColor(AIndex: TcxBorder): TColor; +begin + Result := Params.TextColor; +end; + +function TcxGridChartLegendViewInfo.GetBorders: TcxBorders; +begin + if Diagram.Legend.GetBorder = lbSingle then + Result := cxBordersAll + else + Result := []; +end; + +function TcxGridChartLegendViewInfo.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := 1; +end; + +function TcxGridChartLegendViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridChartLegendHitTest; +end; + +function TcxGridChartLegendViewInfo.GetOrientation: TcxGridChartPartOrientation; +begin + Result := Diagram.Legend.GetOrientation; +end; + +function TcxGridChartLegendViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartLegendPainter; +end; + +function TcxGridChartLegendViewInfo.GetPosition: TcxGridChartPartPosition; +begin + Result := Diagram.Legend.GetPosition; +end; + +procedure TcxGridChartLegendViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + Diagram.Styles.GetViewParams(dsLegend, nil, nil, AParams); +end; + +function TcxGridChartLegendViewInfo.GetVisible: Boolean; +begin + Result := inherited GetVisible and (Count <> 0); +end; + +function TcxGridChartLegendViewInfo.HasCustomDraw: Boolean; +begin + Result := Diagram.HasCustomDrawLegend or GridView.HasCustomDrawLegend; +end; + +function TcxGridChartLegendViewInfo.AddItem: TcxGridChartLegendItemViewInfo; +begin + Result := GetItemClass.Create(Self, Count); + FItems.Add(Result); +end; + +procedure TcxGridChartLegendViewInfo.CalculateItems; +var + AItemLeftOffset, AItemTopOffset, I: Integer; +begin + AItemLeftOffset := ContentBounds.Left + ItemOffset; + AItemTopOffset := ContentBounds.Top + ItemOffset; + for I := 0 to Count - 1 do + begin + Items[I].Calculate(AItemLeftOffset, AItemTopOffset); + if Orientation = cpoHorizontal then + AItemLeftOffset := Items[I].Bounds.Right + ItemOffset + else + AItemTopOffset := Items[I].Bounds.Bottom + ItemOffset; + end; +end; + +function TcxGridChartLegendViewInfo.GetItemCaption(AIndex: Integer): string; +begin + if Kind = lkSeries then + Result := GridView.VisibleSeries[GetItemSeriesIndex(AIndex)].GetDisplayText + else + begin + Result := GridView.Categories.VisibleDisplayTexts[GetItemValueIndex(AIndex)]; + if Result = '' then + Result := '<' + IntToStr(1 + AIndex) + '>'; + end; +end; + +function TcxGridChartLegendViewInfo.GetItemClass: TcxGridChartLegendItemViewInfoClass; +begin + Result := TcxGridChartLegendItemViewInfo; +end; + +function TcxGridChartLegendViewInfo.GetItemCount: Integer; +begin + if Kind = lkSeries then + Result := GridView.VisibleSeriesCount + else + Result := GridView.Categories.VisibleValueCount; +end; + +function TcxGridChartLegendViewInfo.GetItemSeriesIndex(AIndex: Integer): Integer; +begin + if Kind = lkSeries then + Result := GetItemObjectIndex(AIndex) + else + if GridView.VisibleSeriesCount = 1 then + Result := 0 + else + Result := -1; +end; + +function TcxGridChartLegendViewInfo.GetItemValueIndex(AIndex: Integer): Integer; +begin + if Kind = lkSeries then + Result := -1 + else + Result := GetItemObjectIndex(AIndex); +end; + +{function TcxGridChartLegendViewInfo.ItemLegendKeyBorderIsValueBorder: Boolean; +begin + Result := False; +end;} + +procedure TcxGridChartLegendViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + inherited; + CalculateItems; +end; + +function TcxGridChartLegendViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +var + I: Integer; + AHitTest: TcxCustomGridHitTest; +begin + Result := inherited GetHitTest(P); + if Result <> nil then + for I := 0 to Count - 1 do + begin + AHitTest := Items[I].GetHitTest(P); + if AHitTest <> nil then + begin + Result := AHitTest; + Break; + end; + end; +end; + +procedure TcxGridChartLegendViewInfo.GetItemLegendKeyParams(AIndex: Integer; + out AParams: TcxViewParams); +begin + Diagram.Styles.GetValueParams(GetItemSeriesIndex(AIndex), GetItemValueIndex(AIndex), AParams); +{ if not ItemLegendKeyBorderIsValueBorder then + AParams.TextColor := Params.TextColor;} +end; + +{ TcxGridChartDiagramValueCaptionViewInfo } + +constructor TcxGridChartDiagramValueCaptionViewInfo.Create(AValueViewInfo: TcxGridChartDiagramValueViewInfo); +begin + inherited Create(AValueViewInfo.GridViewInfo); + FValueViewInfo := AValueViewInfo; +end; + +function TcxGridChartDiagramValueCaptionViewInfo.GetAlignmentHorz: TAlignment; +begin + Result := taCenter; +end; + +function TcxGridChartDiagramValueCaptionViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + Result := vaCenter; +end; + +function TcxGridChartDiagramValueCaptionViewInfo.CalculateHeight: Integer; +begin + Result := TextHeight; + if HasVisualCompensation then Inc(Result, 2 * cxTextOffset); +end; + +function TcxGridChartDiagramValueCaptionViewInfo.CalculateWidth: Integer; +begin + Result := TextWidthWithOffset; + if HasVisualCompensation then Inc(Result, 2 * cxTextOffset); +end; + +function TcxGridChartDiagramValueCaptionViewInfo.GetText: string; +begin + Result := FValueViewInfo.GetCaptionText; +end; + +function TcxGridChartDiagramValueCaptionViewInfo.GetTextAreaBounds: TRect; +begin + Result := ContentBounds; +end; + +function TcxGridChartDiagramValueCaptionViewInfo.GetTextAttributes(AForPainting: Boolean): Integer; +begin + Result := inherited GetTextAttributes(AForPainting) or cxDontClip; +end; + +procedure TcxGridChartDiagramValueCaptionViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + FValueViewInfo.GetCaptionViewParams(AParams); +end; + +function TcxGridChartDiagramValueCaptionViewInfo.GetVisible: Boolean; +begin + Result := FValueViewInfo.HasCaption; +end; + +function TcxGridChartDiagramValueCaptionViewInfo.HasBackground: Boolean; +begin + Result := False; +end; + +function TcxGridChartDiagramValueCaptionViewInfo.HasVisualCompensation: Boolean; +begin + Result := FValueViewInfo.HasCaptionVisualCompensation; +end; + +{ TcxGridChartDiagramValueViewInfo } + +constructor TcxGridChartDiagramValueViewInfo.Create(ADiagramViewInfo: TcxGridChartDiagramViewInfo; + ASeriesIndex, AVisibleValueIndex: Integer); +begin + inherited Create(ADiagramViewInfo.GridViewInfo); + FDiagramViewInfo := ADiagramViewInfo; + FSeriesIndex := ASeriesIndex; + FVisibleValueIndex := AVisibleValueIndex; + FCaptionViewInfo := GetCaptionViewInfoClass.Create(Self); +end; + +destructor TcxGridChartDiagramValueViewInfo.Destroy; +begin + FCaptionViewInfo.Free; + inherited; +end; + +function TcxGridChartDiagramValueViewInfo.GetController: TcxGridChartController; +begin + Result := TcxGridChartController(inherited Controller); +end; + +function TcxGridChartDiagramValueViewInfo.GetDiagram: TcxGridChartDiagram; +begin + Result := FDiagramViewInfo.Diagram; +end; + +function TcxGridChartDiagramValueViewInfo.GetGridView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +function TcxGridChartDiagramValueViewInfo.GetSeries: TcxGridChartSeries; +begin + Result := GridView.VisibleSeries[FSeriesIndex]; +end; + +function TcxGridChartDiagramValueViewInfo.GetValueIndex: Integer; +begin + Result := DiagramViewInfo.GetValueIndex(VisibleValueIndex); +end; + +function TcxGridChartDiagramValueViewInfo.CanShowHint: Boolean; +begin + Result := GridView.OptionsBehavior.ValueHints; +end; + +function TcxGridChartDiagramValueViewInfo.CustomDraw(ACanvas: TcxCanvas): Boolean; +begin + Result := inherited CustomDraw(ACanvas); + if not Result then + begin + Series.DoCustomDrawValue(ACanvas, Self, Result); + if not Result then + Diagram.DoCustomDrawValue(ACanvas, Self, Result); + end; +end; + +function TcxGridChartDiagramValueViewInfo.GetCaptionViewInfoClass: TcxGridChartDiagramValueCaptionViewInfoClass; +begin + Result := TcxGridChartDiagramValueCaptionViewInfo; +end; + +function TcxGridChartDiagramValueViewInfo.GetCaptionText: string; +begin + Result := DiagramViewInfo.GetValueCaption(SeriesIndex, VisibleValueIndex); +end; + +procedure TcxGridChartDiagramValueViewInfo.GetCaptionViewParams(var AParams: TcxViewParams); +begin + Diagram.Styles.GetViewParams(dsValueCaptions, nil, nil, AParams); +end; + +function TcxGridChartDiagramValueViewInfo.GetCellBoundsForHint: TRect; +begin + Result := Bounds; +end; + +function TcxGridChartDiagramValueViewInfo.GetHintText: string; +begin + Result := Controller.GetValueHintText(Series, ValueIndex); +end; + +function TcxGridChartDiagramValueViewInfo.GetHintTextRect(const AMousePos: TPoint): TRect; +begin + Result.TopLeft := AMousePos; + Inc(Result.Top, ValueHintOffset); + Result.BottomRight := Result.TopLeft; +end; + +function TcxGridChartDiagramValueViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridChartValueHitTest; +end; + +function TcxGridChartDiagramValueViewInfo.GetHotTrack: Boolean; +begin + Result := GridView.OptionsBehavior.GetValueHotTrack(ValueIndex); +end; + +function TcxGridChartDiagramValueViewInfo.GetIsDesignSelected: Boolean; +begin + Result := GridView.IsDesigning and + Controller.DesignController.IsObjectSelected(Series); +end; + +procedure TcxGridChartDiagramValueViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + Diagram.Styles.GetValueParams(SeriesIndex, ValueIndex, AParams); + if State <> gcsNone then + AParams.Color := GetHotColor(AParams.Color); +end; + +function TcxGridChartDiagramValueViewInfo.HasCaption: Boolean; +begin + Result := False; +end; + +function TcxGridChartDiagramValueViewInfo.HasCaptionVisualCompensation: Boolean; +begin + Result := False; +end; + +function TcxGridChartDiagramValueViewInfo.HasCustomDraw: Boolean; +begin + Result := Series.HasCustomDrawValue or Diagram.HasCustomDrawValue; +end; + +function TcxGridChartDiagramValueViewInfo.HasHintPoint(const P: TPoint): Boolean; +begin + Result := HasPoint(P); +end; + +procedure TcxGridChartDiagramValueViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + inherited; + TcxGridChartValueHitTest(AHitTest).CanDrillDown := Controller.IsDataDrillDownPossible(ValueIndex); + TcxGridChartValueHitTest(AHitTest).Series := Series; + TcxGridChartValueHitTest(AHitTest).ValueIndex := ValueIndex; +end; + +function TcxGridChartDiagramValueViewInfo.IsHintForText: Boolean; +begin + Result := False; +end; + +function TcxGridChartDiagramValueViewInfo.IsHintMultiLine: Boolean; +begin + Result := False; +end; + +procedure TcxGridChartDiagramValueViewInfo.StateChanged(APrevState: TcxGridCellState); +begin + CalculateParamsNeeded; + inherited; +end; + +procedure TcxGridChartDiagramValueViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + inherited; + if HasCaption then + CaptionViewInfo.Calculate(CalculateCaptionBounds); +end; + +function TcxGridChartDiagramValueViewInfo.MouseDown(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +begin + Result := inherited MouseDown(AHitTest, AButton, AShift); + if not (ssDouble in AShift) then + if GridView.IsDesigning then + if AButton = mbLeft then + begin + Controller.DesignController.SelectObject(Series, not (ssShift in AShift)); + Result := True; + end + else + else + begin + if AButton = mbLeft then + Result := Series.DoValueClick(ValueIndex); + if (AHitTest as TcxGridChartValueHitTest).CanDrillDown then + case AButton of + mbLeft: + if not Result then + Result := Controller.DoDataDrillDown(ValueIndex); + mbRight: + if GridView.OptionsCustomize.DataDrillUpMethod = ddumValueMouseRightButtonClick then + Result := Controller.DoDataDrillUp; + end; + end; +end; + +{ TcxGridChartDiagramViewInfo } + +constructor TcxGridChartDiagramViewInfo.Create(AGridViewInfo: TcxCustomGridViewInfo; + ADiagram: TcxGridChartDiagram); +begin + inherited Create(AGridViewInfo); + FDiagram := ADiagram; + FValueViewInfos := TList.Create; +end; + +destructor TcxGridChartDiagramViewInfo.Destroy; +var + I: Integer; +begin + for I := 0 to ValueViewInfoCount - 1 do + ValueViewInfos[I].Free; + FValueViewInfos.Free; + inherited; +end; + +function TcxGridChartDiagramViewInfo.GetCategory(AIndex: Integer): string; +begin + Result := GridView.Categories.VisibleDisplayTexts[AIndex]; +end; + +function TcxGridChartDiagramViewInfo.GetGridView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +function TcxGridChartDiagramViewInfo.GetSeries(AIndex: Integer): TcxGridChartSeries; +begin + Result := GridView.VisibleSeries[AIndex]; +end; + +function TcxGridChartDiagramViewInfo.GetSeriesCount: Integer; +begin + Result := GridView.VisibleSeriesCount; +end; + +function TcxGridChartDiagramViewInfo.GetValueCount: Integer; +begin + Result := ViewData.VisibleCategoryCount; +end; + +function TcxGridChartDiagramViewInfo.GetValueViewInfoValue(Index: Integer): TcxGridChartDiagramValueViewInfo; +begin + Result := TcxGridChartDiagramValueViewInfo(FValueViewInfos[Index]); +end; + +function TcxGridChartDiagramViewInfo.GetValueViewInfoCount: Integer; +begin + Result := FValueViewInfos.Count; +end; + +function TcxGridChartDiagramViewInfo.GetViewData: TcxGridChartViewData; +begin + Result := GridView.ViewData; +end; + +procedure TcxGridChartDiagramViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + Diagram.Styles.GetBackgroundParams(AParams); +end; + +procedure TcxGridChartDiagramViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + inherited; + (AHitTest as TcxCustomGridChartDiagramHitTest).Diagram := Diagram; +end; + +function TcxGridChartDiagramViewInfo.CreateValueViewInfo(ASeriesIndex, AVisibleValueIndex: Integer): TcxGridChartDiagramValueViewInfo; +begin + Result := GetValueViewInfoClass.Create(Self, ASeriesIndex, AVisibleValueIndex); + FValueViewInfos.Add(Result); +end; + +function TcxGridChartDiagramViewInfo.GetValue(ASeriesIndex, AIndex: Integer): Variant; +begin + Result := GridView.VisibleSeries[ASeriesIndex].VisibleValues[AIndex]; +end; + +function TcxGridChartDiagramViewInfo.GetValueCaption(ASeriesIndex, AVisibleValueIndex: Integer): string; +begin + Result := Diagram.GetValueCaption(GridView.VisibleSeries[ASeriesIndex], + GetValueIndex(AVisibleValueIndex)); +end; + +function TcxGridChartDiagramViewInfo.GetValueIndex(AVisibleValueIndex: Integer): Integer; +begin + Result := GridView.Controller.FirstVisibleCategoryIndex + AVisibleValueIndex; +end; + +class function TcxGridChartDiagramViewInfo.GetValueViewInfoClass: TcxGridChartDiagramValueViewInfoClass; +begin + Result := nil; +end; + +function TcxGridChartDiagramViewInfo.GetVisibleCategory(AIndex: Integer): string; +begin + Result := Categories[GetValueIndex(AIndex)]; +end; + +function TcxGridChartDiagramViewInfo.GetVisibleValue(ASeriesIndex, AIndex: Integer): Variant; +begin + Result := Values[ASeriesIndex, GetValueIndex(AIndex)]; +end; + +function TcxGridChartDiagramViewInfo.GetVisibleValueCount: Integer; +begin + Result := GridView.Controller.GetVisibleCategoryCount(True); +end; + +function TcxGridChartDiagramViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +var + I: Integer; +begin + Result := nil; + for I := 0 to ValueViewInfoCount - 1 do + begin + Result := ValueViewInfos[I].GetHitTest(P); + if Result <> nil then Break; + end; +end; + +function TcxGridChartDiagramViewInfo.GetValueViewInfo(ASeriesIndex, AVisibleIndex: Integer): TcxGridChartDiagramValueViewInfo; +begin + Result := ValueViewInfos[GetValueViewInfoIndex(ASeriesIndex, AVisibleIndex)]; +end; + +{ TcxGridChartHistogramLegendViewInfo } + +function TcxGridChartHistogramLegendViewInfo.GetDiagram: TcxGridChartHistogram; +begin + Result := TcxGridChartHistogram(inherited Diagram); +end; + +function TcxGridChartHistogramLegendViewInfo.GetItemObjectIndex(AIndex: Integer): Integer; +begin + if ItemsInReverseOrder then + Result := Count - 1 - AIndex + else + Result := AIndex; +end; + +function TcxGridChartHistogramLegendViewInfo.GetItemsInReverseOrder: Boolean; +begin + Result := False; +end; + +function TcxGridChartHistogramLegendViewInfo.GetKind: TcxGridChartLegendKind; +begin + if Diagram.Values.GetVaryColorsByCategory then + Result := lkCategories + else + Result := lkSeries; +end; + +{ TcxGridChartHistogramValueViewInfo } + +function TcxGridChartHistogramValueViewInfo.GetCategoryDirection: TcxDirection; +begin + Result := DiagramViewInfo.GetCategoryDirection; +end; + +function TcxGridChartHistogramValueViewInfo.GetDiagramViewInfo: TcxGridChartHistogramViewInfo; +begin + Result := TcxGridChartHistogramViewInfo(inherited DiagramViewInfo); +end; + +function TcxGridChartHistogramValueViewInfo.GetValueDirection: TcxDirection; +begin + Result := DiagramViewInfo.GetValueDirection(SeriesIndex, VisibleValueIndex); +end; + +{ TcxGridChartHistogramAxisTitleViewInfo } + +constructor TcxGridChartHistogramAxisTitleViewInfo.Create(AContainer: TcxGridChartHistogramTickMarkLabelsViewInfo; + ATitle: TcxCustomGridChartTitle); +begin + inherited Create(AContainer.GridViewInfo, ATitle); + FContainer := AContainer; +end; + +function TcxGridChartHistogramAxisTitleViewInfo.GetTitle: TcxGridChartHistogramAxisTitle; +begin + Result := TcxGridChartHistogramAxisTitle(inherited Title); +end; + +procedure TcxGridChartHistogramAxisTitleViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + FContainer.GetTitleViewParams(AParams); +end; + +procedure TcxGridChartHistogramAxisTitleViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + FContainer.DiagramViewInfo.InitHitTest(AHitTest); + inherited; +end; + +{ TcxGridChartHistogramTickMarkLabelsViewInfo } + +constructor TcxGridChartHistogramTickMarkLabelsViewInfo.Create(ADiagramViewInfo: TcxGridChartHistogramViewInfo); +begin + inherited Create(ADiagramViewInfo.GridViewInfo); + FDiagramViewInfo := ADiagramViewInfo; + FTitleViewInfo := GetTitleViewInfoClass.Create(Self, Axis.Title); +end; + +destructor TcxGridChartHistogramTickMarkLabelsViewInfo.Destroy; +begin + FreeAndNil(FTitleViewInfo); + inherited; +end; + +function TcxGridChartHistogramTickMarkLabelsViewInfo.GetCaptionBounds(Index: Integer): TRect; +begin + Result := FCaptionBounds[Index]; +end; + +function TcxGridChartHistogramTickMarkLabelsViewInfo.GetCaptionHeight: Integer; +begin + if FCaptionHeight = 0 then + begin + CalculateParams; + Canvas.Font := Params.Font; + FCaptionHeight := Canvas.TextHeight('Qq'); + end; + Result := FCaptionHeight; +end; + +function TcxGridChartHistogramTickMarkLabelsViewInfo.GetCaptionWidth(Index: Integer): Integer; +begin + if Index >= Length(FCaptionWidths) then + SetLength(FCaptionWidths, Index + 1); + if FCaptionWidths[Index] = 0 then + begin + CalculateParams; + Canvas.Font := Params.Font; + FCaptionWidths[Index] := Canvas.TextWidth(Captions[Index]); + end; + Result := FCaptionWidths[Index]; +end; + +function TcxGridChartHistogramTickMarkLabelsViewInfo.GetDiagram: TcxGridChartHistogram; +begin + Result := FDiagramViewInfo.Diagram; +end; + +function TcxGridChartHistogramTickMarkLabelsViewInfo.GetIsVertical: Boolean; +begin + Result := Position in [cppLeft, cppRight]; +end; + +procedure TcxGridChartHistogramTickMarkLabelsViewInfo.SetCaptionBounds(Index: Integer; + const Value: TRect); +begin + FCaptionBounds[Index] := Value; +end; + +function TcxGridChartHistogramTickMarkLabelsViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartHistogramTickMarkLabelsPainter; +end; + +function TcxGridChartHistogramTickMarkLabelsViewInfo.GetTitleViewInfoClass: TcxGridChartHistogramAxisTitleViewInfoClass; +begin + Result := TcxGridChartHistogramAxisTitleViewInfo; +end; + +function TcxGridChartHistogramTickMarkLabelsViewInfo.GetCaption(Index: Integer): string; +begin + Result := Values[Index]; +end; + +function TcxGridChartHistogramTickMarkLabelsViewInfo.CalculateCaptionBounds(AIndex: Integer): TRect; +var + ACaptionWidth, ADirection: Integer; +begin + Result := ContentBounds; + if IsVertical then + begin + Result.Top := GetCaptionPosition(AIndex) - CaptionHeight div 2; + Result.Bottom := Result.Top + CaptionHeight; + end + else + begin + ACaptionWidth := CaptionWidths[AIndex]; + Result.Left := GetCaptionPosition(AIndex) - ACaptionWidth div 2; + Result.Right := Result.Left + ACaptionWidth; + if IsTwoRowLayout then + begin + if IsReverseOrder then + ADirection := -1 + else + ADirection := 1; + if AIndex > 0 then + Result.Left := Max(Result.Left, GetCaptionPosition(AIndex - ADirection) + cxTextOffset); + if AIndex < Count - 1 then + Result.Right := Min(Result.Right, GetCaptionPosition(AIndex + ADirection) - cxTextOffset); + if Odd(AIndex) then + Result.Top := Result.Bottom - CaptionHeight; + end; + end; +end; + +procedure TcxGridChartHistogramTickMarkLabelsViewInfo.CalculateCaptionsBounds; +var + I: Integer; +begin + SetLength(FCaptionBounds, Count); + for I := 0 to Count - 1 do + CaptionBounds[I] := CalculateCaptionBounds(I); +end; + +function TcxGridChartHistogramTickMarkLabelsViewInfo.CalculateHeight( + AWidth, ALeftReduction, ARightReduction: Integer): Integer; +begin + IsTwoRowLayout := CalculateIsTwoRowLayout(AWidth, ALeftReduction, ARightReduction); + if IsVertical then + Result := 0 + else + begin + if CaptionsVisible then + begin + Result := CaptionHeight; + if IsTwoRowLayout then + Inc(Result, 2 * cxTextOffset + CaptionHeight); + end + else + Result := 0; + if TitleViewInfo.Visible then + begin + if CaptionsVisible then + Inc(Result, ChartPartOffset); + Inc(Result, TitleViewInfo.Height); + end; + end; +end; + +function TcxGridChartHistogramTickMarkLabelsViewInfo.CalculateWidth: Integer; +var + I: Integer; +begin + if IsVertical then + begin + Result := 0; + if CaptionsVisible then + for I := 0 to Count - 1 do + Result := Max(Result, CaptionWidths[I]); + if TitleViewInfo.Visible then + begin + if CaptionsVisible then + Inc(Result, ChartPartOffset); + Inc(Result, TitleViewInfo.Width); + end; + end + else + Result := 0; +end; + +function TcxGridChartHistogramTickMarkLabelsViewInfo.CalculateIsTwoRowLayout( + AWidth, ALeftReduction, ARightReduction: Integer): Boolean; +var + I: Integer; +begin + Result := False; + if IsVertical or (Count <= 1) then Exit; + AWidth := GetCaptionSpace(AWidth, ALeftReduction, ARightReduction); + for I := 0 to Count - 1 do + begin + Result := CaptionWidths[I] > AWidth; + if Result then Exit; + end; +end; + +procedure TcxGridChartHistogramTickMarkLabelsViewInfo.CalculateTitleBounds(out ATitleBounds, AContentBounds: TRect); +begin + AContentBounds := CalculateContentBounds; + if TitleViewInfo.Visible then + begin + PositionRect(ATitleBounds, AContentBounds, TitleViewInfo.Width, TitleViewInfo.Height, + ChartPartOffset, Position); + with DiagramViewInfo.PlotBounds do + if IsVertical then + begin + ATitleBounds.Top := Top; + ATitleBounds.Bottom := Bottom; + end + else + begin + ATitleBounds.Left := Left; + ATitleBounds.Right := Right; + end; + AlignRect(ATitleBounds, TitleViewInfo.Width, TitleViewInfo.Height, not IsVertical, + TitleViewInfo.Alignment); + end + else + SetRectEmpty(ATitleBounds); +end; + +function TcxGridChartHistogramTickMarkLabelsViewInfo.GetAlignmentHorz: TAlignment; +begin + if IsVertical then + if Position = cppLeft then + Result := taRightJustify + else + Result := taLeftJustify + else + Result := taCenter; +end; + +function TcxGridChartHistogramTickMarkLabelsViewInfo.GetCaptionsVisible: Boolean; +begin + Result := Axis.TickMarkLabels; +end; + +procedure TcxGridChartHistogramTickMarkLabelsViewInfo.GetEdgeCaptionsReductions( + var ALeftReduction, ARightReduction: Integer); +begin + ALeftReduction := Max(ALeftReduction, CaptionWidths[0] div 2); + ARightReduction := Max(ARightReduction, CaptionWidths[Count - 1] div 2); +end; + +function TcxGridChartHistogramTickMarkLabelsViewInfo.GetTextAttributes(AForPainting: Boolean): Integer; +begin + Result := inherited GetTextAttributes(AForPainting) or cxDontClip or cxShowEndEllipsis; +end; + +function TcxGridChartHistogramTickMarkLabelsViewInfo.GetVisible: Boolean; +begin + Result := CaptionsVisible or TitleViewInfo.Visible; +end; + +procedure TcxGridChartHistogramTickMarkLabelsViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +var + ATitleBounds: TRect; +begin + inherited; + CalculateTitleBounds(ATitleBounds, FContentBounds); + CalculateCaptionsBounds; + if TitleViewInfo.Visible then + TitleViewInfo.Calculate(ATitleBounds); +end; + +procedure TcxGridChartHistogramTickMarkLabelsViewInfo.FitCaptionsHorz(AWidth: Integer; + var ALeftReduction, ARightReduction: Integer); +var + ACaptionSpace, ALeftOffset, ARightOffset: Integer; +begin + if not CaptionsVisible then Exit; + if IsTwoRowLayout and not IsEdgeCaptions then + begin + ACaptionSpace := GetCaptionSpace(AWidth, ALeftReduction, ARightReduction); + ALeftOffset := Max(0, (CaptionWidths[0] - ACaptionSpace) div 2 - ALeftReduction); + ARightOffset := Max(0, (CaptionWidths[Count - 1] - ACaptionSpace) div 2 - ARightReduction); + + Inc(ALeftReduction, MulDiv((2 * ARightOffset + (4 * Count - 2) * ALeftOffset), 1, 4 * Count - 4)); + Inc(ARightReduction, MulDiv((2 * ALeftOffset + (4 * Count - 2) * ARightOffset), 1, 4 * Count - 4)); + end + else + if IsEdgeCaptions and (Count <> 0) then + GetEdgeCaptionsReductions(ALeftReduction, ARightReduction); +end; + +procedure TcxGridChartHistogramTickMarkLabelsViewInfo.FitCaptionsVert( + var ATopReduction, ABottomReduction: Integer); +begin + if not CaptionsVisible then Exit; + if IsEdgeCaptions then + begin + ATopReduction := Max(ATopReduction, CaptionHeight div 2); + ABottomReduction := Max(ABottomReduction, CaptionHeight div 2); + end; +end; + +function TcxGridChartHistogramTickMarkLabelsViewInfo.GetCaptionSpace( + AWidth, ALeftReduction, ARightReduction: Integer): Integer; +var + ACount: Integer; +begin + ACount := Count; + if IsEdgeCaptions then + begin + Dec(ACount); + GetEdgeCaptionsReductions(ALeftReduction, ARightReduction); + end; + Dec(AWidth, ALeftReduction + ARightReduction); + Result := AWidth div ACount - 4 * cxTextOffset; +end; + +function TcxGridChartHistogramTickMarkLabelsViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + Result := FTitleViewInfo.GetHitTest(P); +end; + +{ TcxGridChartHistogramCategoryAxisTitleViewInfo } + +function TcxGridChartHistogramCategoryAxisTitleViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridChartHistogramCategoryAxisTitleHitTest; +end; + +{ TcxGridChartHistogramCategoryTickMarkLabelsViewInfo } + +function TcxGridChartHistogramCategoryTickMarkLabelsViewInfo.GetTitleViewInfoClass: TcxGridChartHistogramAxisTitleViewInfoClass; +begin + Result := TcxGridChartHistogramCategoryAxisTitleViewInfo; +end; + +function TcxGridChartHistogramCategoryTickMarkLabelsViewInfo.GetCount: Integer; +begin + Result := DiagramViewInfo.VisibleValueCount; +end; + +function TcxGridChartHistogramCategoryTickMarkLabelsViewInfo.GetIsReverseOrder: Boolean; +begin + Result := DiagramViewInfo.IsCategoriesInReverseOrder; +end; + +function TcxGridChartHistogramCategoryTickMarkLabelsViewInfo.GetValue(Index: Integer): Variant; +begin + Result := DiagramViewInfo.VisibleCategories[Index]; +end; + +function TcxGridChartHistogramCategoryTickMarkLabelsViewInfo.GetAxis: TcxGridChartHistogramAxis; +begin + Result := Diagram.AxisCategory; +end; + +function TcxGridChartHistogramCategoryTickMarkLabelsViewInfo.GetCaptionPosition(AIndex: Integer): Integer; +begin + Result := DiagramViewInfo.GetUnitOffset(DiagramViewInfo.GetCategoryTickMarkLabelOffsetUnits(AIndex)); +end; + +function TcxGridChartHistogramCategoryTickMarkLabelsViewInfo.GetIsEdgeCaptions: Boolean; +begin + Result := DiagramViewInfo.IsEdgeCategoryTickMarkLabels; +end; + +function TcxGridChartHistogramCategoryTickMarkLabelsViewInfo.GetPosition: TcxGridChartAxisPosition; +begin + Result := DiagramViewInfo.CategoryAxisPosition; +end; + +procedure TcxGridChartHistogramCategoryTickMarkLabelsViewInfo.GetTitleViewParams(var AParams: TcxViewParams); +begin + Diagram.Styles.GetViewParams(dsCategoryAxisTitle, nil, nil, AParams); +end; + +procedure TcxGridChartHistogramCategoryTickMarkLabelsViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + Diagram.Styles.GetViewParams(dsCategoryAxis, nil, nil, AParams); +end; + +{ TcxGridChartHistogramValueAxisTitleViewInfo } + +function TcxGridChartHistogramValueAxisTitleViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridChartHistogramValueAxisTitleHitTest; +end; + +{ TcxGridChartHistogramValueTickMarkLabelsViewInfo } + +function TcxGridChartHistogramValueTickMarkLabelsViewInfo.GetAxisValue: TcxGridChartHistogramAxisValue; +begin + Result := TcxGridChartHistogramAxisValue(inherited Axis); +end; + +function TcxGridChartHistogramValueTickMarkLabelsViewInfo.GetTitleViewInfoClass: TcxGridChartHistogramAxisTitleViewInfoClass; +begin + Result := TcxGridChartHistogramValueAxisTitleViewInfo; +end; + +function TcxGridChartHistogramValueTickMarkLabelsViewInfo.GetCaption(Index: Integer): string; +begin + Result := Axis.GetTickMarkLabel(Values[Index]); +end; + +function TcxGridChartHistogramValueTickMarkLabelsViewInfo.GetCount: Integer; +begin + Result := DiagramViewInfo.ValueMarkCount; +end; + +function TcxGridChartHistogramValueTickMarkLabelsViewInfo.GetIsReverseOrder: Boolean; +begin + Result := False; +end; + +function TcxGridChartHistogramValueTickMarkLabelsViewInfo.GetValue(Index: Integer): Variant; +begin + Result := DiagramViewInfo.ValueMarkValues[Index]; +end; + +function TcxGridChartHistogramValueTickMarkLabelsViewInfo.GetAxis: TcxGridChartHistogramAxis; +begin + Result := Diagram.AxisValue; +end; + +function TcxGridChartHistogramValueTickMarkLabelsViewInfo.GetCaptionPosition(AIndex: Integer): Integer; +begin + Result := DiagramViewInfo.ValueMarkPositions[AIndex]; +end; + +function TcxGridChartHistogramValueTickMarkLabelsViewInfo.GetIsEdgeCaptions: Boolean; +begin + Result := True; +end; + +function TcxGridChartHistogramValueTickMarkLabelsViewInfo.GetPosition: TcxGridChartAxisPosition; +begin + Result := DiagramViewInfo.ValueAxisPosition; +end; + +procedure TcxGridChartHistogramValueTickMarkLabelsViewInfo.GetTitleViewParams(var AParams: TcxViewParams); +begin + Diagram.Styles.GetViewParams(dsValueAxisTitle, nil, nil, AParams); +end; + +procedure TcxGridChartHistogramValueTickMarkLabelsViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + Diagram.Styles.GetViewParams(dsValueAxis, nil, nil, AParams); +end; + +{ TcxGridChartHistogramViewInfo } + +constructor TcxGridChartHistogramViewInfo.Create(AGridViewInfo: TcxCustomGridViewInfo; + ADiagram: TcxGridChartDiagram); +begin + inherited; + FCategoryTickMarkLabelsViewInfo := GetCategoryTickMarkLabelsViewInfoClass.Create(Self); + FValueTickMarkLabelsViewInfo := GetValueTickMarkLabelsViewInfoClass.Create(Self); +end; + +destructor TcxGridChartHistogramViewInfo.Destroy; +begin + FValueTickMarkLabelsViewInfo.Free; + FCategoryTickMarkLabelsViewInfo.Free; + inherited; +end; + +function TcxGridChartHistogramViewInfo.GetCategoryAxisColor: TColor; +var + AParams: TcxViewParams; +begin + Diagram.Styles.GetViewParams(dsCategoryAxis, nil, nil, AParams); + Result := AParams.Color; +end; + +function TcxGridChartHistogramViewInfo.GetCategoryGridLineColor: TColor; +var + AParams: TcxViewParams; +begin + Diagram.Styles.GetViewParams(dsCategoryGridLines, nil, nil, AParams); + Result := AParams.Color; +end; + +function TcxGridChartHistogramViewInfo.GetCategoryMarkCount: Integer; +begin + Result := Length(FCategoryMarks); +end; + +function TcxGridChartHistogramViewInfo.GetCategoryMarkPosition(Index: Integer): Integer; +begin + Result := FCategoryMarks[Index].Position; +end; + +function TcxGridChartHistogramViewInfo.GetCategoryMarkValue(Index: Integer): Integer; +begin + Result := FCategoryMarks[Index].Value; +end; + +function TcxGridChartHistogramViewInfo.GetDiagram: TcxGridChartHistogram; +begin + Result := TcxGridChartHistogram(inherited Diagram); +end; + +function TcxGridChartHistogramViewInfo.GetHasCategoryAxis: Boolean; +begin + Result := Diagram.AxisCategory.Visible and (VisibleValueCount <> 0); +end; + +function TcxGridChartHistogramViewInfo.GetHasCategoryGridLines: Boolean; +begin + Result := Diagram.AxisCategory.GridLines; +end; + +function TcxGridChartHistogramViewInfo.GetHasValueAxis: Boolean; +begin + Result := Diagram.AxisValue.Visible and (VisibleValueCount <> 0); +end; + +function TcxGridChartHistogramViewInfo.GetHasValueGridLines: Boolean; +begin + Result := Diagram.AxisValue.GridLines; +end; + +function TcxGridChartHistogramViewInfo.GetIsCategoriesInReverseOrder: Boolean; +begin + Result := Diagram.AxisCategory.CategoriesInReverseOrder; +end; + +function TcxGridChartHistogramViewInfo.GetIsCategoryAxisHorz: Boolean; +begin + Result := CategoryAxisPosition in [cppTop, cppBottom]; +end; + +function TcxGridChartHistogramViewInfo.GetIsValueAxisVert: Boolean; +begin + Result := ValueAxisPosition in [cppLeft, cppRight]; +end; + +function TcxGridChartHistogramViewInfo.GetPlotBounds: TRect; +begin + if not FIsPlotBoundsCalculated then + begin + FPlotBounds := CalculatePlotBounds; + FIsPlotBoundsCalculated := True; + end; + Result := FPlotBounds; +end; + +function TcxGridChartHistogramViewInfo.GetSumOfValues(AValueIndex: Integer): Variant; +begin + if FSumOfValues = nil then + SetLength(FSumOfValues, ValueCount); + if VarIsEmpty(FSumOfValues[AValueIndex]) then + FSumOfValues[AValueIndex] := CalculateSumOfValues(AValueIndex); + Result := FSumOfValues[AValueIndex]; +end; + +function TcxGridChartHistogramViewInfo.GetValueAxisColor: TColor; +var + AParams: TcxViewParams; +begin + Diagram.Styles.GetViewParams(dsValueAxis, nil, nil, AParams); + Result := AParams.Color; +end; + +function TcxGridChartHistogramViewInfo.GetValueGridLineColor: TColor; +var + AParams: TcxViewParams; +begin + Diagram.Styles.GetViewParams(dsValueGridLines, nil, nil, AParams); + Result := AParams.Color; +end; + +function TcxGridChartHistogramViewInfo.GetValueMarkCount: Integer; +begin + Result := Length(FValueMarks); +end; + +function TcxGridChartHistogramViewInfo.GetValueMarkPosition(Index: Integer): Integer; +begin + Result := FValueMarks[Index].Position; +end; + +function TcxGridChartHistogramViewInfo.GetValueMarkValue(Index: Integer): Extended; +begin + Result := FValueMarks[Index].Value; +end; + +function TcxGridChartHistogramViewInfo.GetZeroValueOffset: Integer; +begin + Result := GetValueOffset(ZeroValue); +end; + +procedure TcxGridChartHistogramViewInfo.SetCategoryMarkPosition(Index: Integer; Value: Integer); +begin + FCategoryMarks[Index].Position := Value; +end; + +procedure TcxGridChartHistogramViewInfo.SetValueMarkPosition(Index: Integer; Value: Integer); +begin + FValueMarks[Index].Position := Value; +end; + +function TcxGridChartHistogramViewInfo.GetCategoryTickMarkLabelsViewInfoClass: TcxGridChartHistogramCategoryTickMarkLabelsViewInfoClass; +begin + Result := TcxGridChartHistogramCategoryTickMarkLabelsViewInfo; +end; + +function TcxGridChartHistogramViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartHistogramPainter; +end; + +function TcxGridChartHistogramViewInfo.GetValueTickMarkLabelsViewInfoClass: TcxGridChartHistogramValueTickMarkLabelsViewInfoClass; +begin + Result := TcxGridChartHistogramValueTickMarkLabelsViewInfo; +end; + +procedure TcxGridChartHistogramViewInfo.DoCalculateParams; +begin + inherited; + GetPlotBackgroundParams(PlotParams); +end; + +procedure TcxGridChartHistogramViewInfo.GetPlotBackgroundParams(out AParams: TcxViewParams); +begin + Diagram.Styles.GetViewParams(dsPlot, nil, nil, AParams); +end; + +function TcxGridChartHistogramViewInfo.GetCategoryDirection: TcxDirection; +begin + if IsCategoryAxisHorz then + if IsCategoriesInReverseOrder then + Result := dirLeft + else + Result := dirRight + else + if IsCategoriesInReverseOrder then + Result := dirDown + else + Result := dirUp; +end; + +function TcxGridChartHistogramViewInfo.GetUnitAdjustedOffset(AIndex: Integer): Integer; +begin + Result := GetUnitOffset(AIndex); + if IsCategoryAxisHorz and (AIndex = UnitCount) or + not IsCategoryAxisHorz and (AIndex = 0) then + Dec(Result, CategoryGridLineWidth); +end; + +function TcxGridChartHistogramViewInfo.GetUnitOffset(AIndex: Integer): Integer; +var + AOffset: Integer; +begin + with PlotBounds do + if IsCategoryAxisHorz then + begin + AOffset := MulDiv(Right - Left, AIndex, UnitCount); + if IsCategoriesInReverseOrder then + Result := Right - AOffset + else + Result := Left + AOffset; + end + else + begin + AOffset := MulDiv(Bottom - Top, AIndex, UnitCount); + if IsCategoriesInReverseOrder then + Result := Top + AOffset + else + Result := Bottom - AOffset; + end; +end; + +procedure TcxGridChartHistogramViewInfo.CalculateMinMaxValues(out AMinValue, AMaxValue: Extended; + out AHasValuesOutOfRange: Boolean); +var + I, J: Integer; + AValue: Extended; +begin + if Diagram.AxisValue.MinMaxValues = mmvCustom then + begin + AMinValue := Diagram.AxisValue.MinValue; + AMaxValue := Diagram.AxisValue.MaxValue; + if AMinValue > AMaxValue then + begin + AValue := AMinValue; + AMinValue := AMaxValue; + AMaxValue := AValue; + end; + end + else + begin + AMinValue := 0; + AMaxValue := 0; + end; + AHasValuesOutOfRange := False; + + for I := 0 to ValueCount - 1 do + for J := 0 to SeriesCount - 1 do + begin + AValue := Values[J, I]; + if Diagram.AxisValue.MinMaxValues = mmvCustom then + begin + AHasValuesOutOfRange := (AValue < AMinValue) or (AValue > AMaxValue); + if AHasValuesOutOfRange then Exit; + end + else + if (Diagram.AxisValue.MinMaxValues = mmvAuto) and (I = 0) and (J = 0) then + begin + AMinValue := AValue; + AMaxValue := AValue; + end + else + begin + AMinValue := Min(AMinValue, AValue); + AMaxValue := Max(AMaxValue, AValue); + end; + end; +end; + +procedure TcxGridChartHistogramViewInfo.CalculateMinMaxVisualValues(out AMinVisualValue, AMaxVisualValue: Extended); +begin + if (ValueStep = 0) or (Diagram.AxisValue.MinMaxValues = mmvCustom) then + begin + AMinVisualValue := MinValue; + AMaxVisualValue := MaxValue; + end + else + begin + AMinVisualValue := Floor(MinValue / ValueStep); + if NeedsMinMaxValuesOffset and + (MinValue <> 0) and (Fraction(MinValue / ValueStep) = 0) then + AMinVisualValue := AMinVisualValue - 1; + AMinVisualValue := AMinVisualValue * ValueStep; + + AMaxVisualValue := Ceiling(MaxValue / ValueStep); + if NeedsMinMaxValuesOffset and + (MaxValue <> 0) and (Fraction(MaxValue / ValueStep) = 0) then + AMaxVisualValue := AMaxVisualValue + 1; + AMaxVisualValue := AMaxVisualValue * ValueStep; + end; + if AMaxVisualValue - AMinVisualValue = 0 then + AMaxVisualValue := AMinVisualValue + 1; +end; + +function TcxGridChartHistogramViewInfo.CalculateSumOfValues(AValueIndex: Integer): Variant; +var + I: Integer; +begin + Result := 0; + for I := 0 to SeriesCount - 1 do + Result := Result + Abs(inherited GetValue(I, AValueIndex)); +end; + +function TcxGridChartHistogramViewInfo.CalculateValueStep: Extended; +const + MaxStepCount = 10; + BaseStepCount = 3; + BaseSteps: array[0..BaseStepCount - 1] of Integer = (1, 2, 5); +var + AStep: Extended; + AIntMultiple10, ABaseStepIndex: Integer; +begin + AStep := (FMaxValue - FMinValue) / MaxStepCount; + if AStep = 0 then + begin + Result := 0; + Exit; + end; + AIntMultiple10 := Floor(Log10(AStep)); + if (AIntMultiple10 < 0) and IsDataInteger then + AIntMultiple10 := 0; + ABaseStepIndex := 0; + repeat + Result := BaseSteps[ABaseStepIndex] * IntPower(10, AIntMultiple10); + if Result >= AStep then Break; + Inc(ABaseStepIndex); + if ABaseStepIndex = BaseStepCount then + begin + ABaseStepIndex := 0; + Inc(AIntMultiple10); + end; + until False; +end; + +function TcxGridChartHistogramViewInfo.GetValue(ASeriesIndex, AIndex: Integer): Variant; +var + I: Integer; + AIsPositive: Boolean; + AValue, ASum: Variant; +begin + Result := inherited GetValue(ASeriesIndex, AIndex); + case Diagram.Values.Stacking of + vsNormal: + for I := 0 to ASeriesIndex - 1 do + Result := Result + inherited GetValue(I, AIndex); + vs100Percent: + begin + AIsPositive := IsPositive(Result); + for I := 0 to ASeriesIndex - 1 do + begin + AValue := inherited GetValue(I, AIndex); + if IsPositive(AValue) = AIsPositive then + Result := Result + AValue; + end; + ASum := SumOfValues[AIndex]; + if ASum = 0 then + Result := 0 + else + Result := 100 * Result / ASum; + end; + end; +end; + +function TcxGridChartHistogramViewInfo.GetValueDirection(ASeriesIndex, AVisibleValueIndex: Integer): TcxDirection; +begin + if IsValueAxisVert then + if IsValuePositive(ASeriesIndex, AVisibleValueIndex) then + Result := dirUp + else + Result := dirDown + else + if IsValuePositive(ASeriesIndex, AVisibleValueIndex) then + Result := dirRight + else + Result := dirLeft; +end; + +function TcxGridChartHistogramViewInfo.GetValueOffset(const AValue: Variant): Integer; +var + AIsVertical: Boolean; + AAreaSize, AOffset: Integer; +begin + AIsVertical := IsValueAxisVert; + with PlotBounds do + begin + if AIsVertical then + AAreaSize := Bottom - Top - ValueGridLineWidth + else + AAreaSize := Right - Left - ValueGridLineWidth; + AOffset := AAreaSize * (AValue - MinVisualValue) / (MaxVisualValue - MinVisualValue); + if AIsVertical then + Result := Bottom - ValueGridLineWidth - AOffset + else + Result := Left + AOffset; + end; +end; + +function TcxGridChartHistogramViewInfo.GetZeroValue: Extended; +begin + Result := 0; + if Diagram.AxisValue.MinMaxValues <> mmvZeroBasedAuto then + begin + if Result < MinVisualValue then + Result := MinVisualValue; + if Result > MaxVisualValue then + Result := MaxVisualValue; + end; +end; + +function TcxGridChartHistogramViewInfo.IsDataInteger: Boolean; +var + I: Integer; +begin + for I := 0 to SeriesCount - 1 do + begin + Result := Series[I].DataBinding.IsValueTypeInteger; + if not Result then Exit; + end; + Result := True; +end; + +function TcxGridChartHistogramViewInfo.IsValuePositive(ASeriesIndex, AVisibleValueIndex: Integer): Boolean; +begin + Result := IsPositive(VisibleValues[ASeriesIndex, AVisibleValueIndex] - ZeroValue); +end; + +function TcxGridChartHistogramViewInfo.NeedsMinMaxValuesOffset: Boolean; +begin + Result := Diagram.Values.Stacking <> vs100Percent; +end; + +procedure TcxGridChartHistogramViewInfo.AddMark(var AMarks: TcxGridChartHistogramMarks; + const AValue: Variant); +begin + SetLength(AMarks, Length(AMarks) + 1); + AMarks[Length(AMarks) - 1].Value := AValue; +end; + +procedure TcxGridChartHistogramViewInfo.AddCategoryMark(AValue: Integer); +begin + AddMark(FCategoryMarks, AValue); +end; + +procedure TcxGridChartHistogramViewInfo.CalculateCategoryMarkPositions; +var + I: Integer; +begin + for I := 0 to CategoryMarkCount - 1 do + CategoryMarkPositions[I] := GetUnitAdjustedOffset(CategoryMarkValues[I]); +end; + +procedure TcxGridChartHistogramViewInfo.CalculateCategoryMarkValues; +var + ACount, I: Integer; +begin + if VisibleValueCount = 0 then Exit; + ACount := VisibleValueCount; + if Diagram.AxisCategory.ValueAxisBetweenCategories then + Inc(ACount); + for I := 0 to ACount - 1 do + AddCategoryMark(GetCategoryTickMarkOffsetUnits(I, Diagram.AxisCategory.ValueAxisBetweenCategories)); +end; + +procedure TcxGridChartHistogramViewInfo.AddValueMark(const AValue: Extended); +begin + AddMark(FValueMarks, AValue); +end; + +procedure TcxGridChartHistogramViewInfo.CalculateValueMarkPositions; +var + I: Integer; +begin + for I := 0 to ValueMarkCount - 1 do + ValueMarkPositions[I] := GetValueOffset(ValueMarkValues[I]); +end; + +procedure TcxGridChartHistogramViewInfo.CalculateValueMarkValues; +var + AValue: Extended; +begin + if ValueStep = 0 then Exit; + AValue := MinVisualValue; + repeat + CheckZero(AValue); + AddValueMark(AValue); + AValue := AValue + ValueStep; + until AValue > MaxVisualValue; +end; + +function TcxGridChartHistogramViewInfo.CalculateCategoryMarkHeight: Integer; +begin + Result := MulDiv(CategoryTickMarkLabelsViewInfo.CaptionHeight, 1, 4); +end; + +function TcxGridChartHistogramViewInfo.CalculateValueMarkHeight: Integer; +begin + Result := MulDiv(ValueTickMarkLabelsViewInfo.CaptionHeight, 1, 4); +end; + +function TcxGridChartHistogramViewInfo.CalculatePlotBounds: TRect; +var + AOffsets: TRect; +begin + Result := Bounds; + SetRectEmpty(AOffsets); + CalculatePlotOffsets(Result.Right - Result.Left, AOffsets); + Inc(Result.Left, AOffsets.Left); + Dec(Result.Right, AOffsets.Right); + Inc(Result.Top, AOffsets.Top); + Dec(Result.Bottom, AOffsets.Bottom); + with Result do + begin + if Left > Right then Left := Right; + if Top > Bottom then Top := Bottom; + end; +end; + +procedure TcxGridChartHistogramViewInfo.CalculatePlotOffsets(APlotAreaWidth: Integer; + var AOffsets: TRect); + + procedure ProcessVerticalAxisCaptions(ACaptionsViewInfo: TcxGridChartHistogramTickMarkLabelsViewInfo; + var AOffsets: TRect); + var + AOffset: Integer; + begin + if not ACaptionsViewInfo.Visible then Exit; + AOffset := TickMarkLabelsOffset + ACaptionsViewInfo.CalculateWidth; + if ACaptionsViewInfo.Position = cppLeft then + AOffsets.Left := Max(AOffsets.Left, AOffset) + else + AOffsets.Right := Max(AOffsets.Right, AOffset); + ACaptionsViewInfo.FitCaptionsVert(AOffsets.Top, AOffsets.Bottom); + end; + + procedure ProcessHorizontalAxisCaptions(ACaptionsViewInfo: TcxGridChartHistogramTickMarkLabelsViewInfo; + var AOffsets: TRect; APlotAreaWidth: Integer); + var + AOffset: Integer; + begin + if not ACaptionsViewInfo.Visible then Exit; + AOffset := TickMarkLabelsOffset + + ACaptionsViewInfo.CalculateHeight(APlotAreaWidth, AOffsets.Left, AOffsets.Right); + if ACaptionsViewInfo.Position = cppTop then + AOffsets.Top := Max(AOffsets.Top, AOffset) + else + AOffsets.Bottom := Max(AOffsets.Bottom, AOffset); + ACaptionsViewInfo.FitCaptionsHorz(APlotAreaWidth, AOffsets.Left, AOffsets.Right); + end; + +var + ACaptionsViewInfoHorz, ACaptionsViewInfoVert: TcxGridChartHistogramTickMarkLabelsViewInfo; +begin + if ValueTickMarkLabelsViewInfo.IsVertical then + begin + ACaptionsViewInfoHorz := CategoryTickMarkLabelsViewInfo; + ACaptionsViewInfoVert := ValueTickMarkLabelsViewInfo; + end + else + begin + ACaptionsViewInfoHorz := ValueTickMarkLabelsViewInfo; + ACaptionsViewInfoVert := CategoryTickMarkLabelsViewInfo; + end; + + ProcessVerticalAxisCaptions(ACaptionsViewInfoVert, AOffsets); + ProcessHorizontalAxisCaptions(ACaptionsViewInfoHorz, AOffsets, APlotAreaWidth); +end; + +function TcxGridChartHistogramViewInfo.GetCategoryAxisBounds: TRect; +begin + Result := PlotBounds; + if IsCategoryAxisHorz then + begin + Result.Top := ZeroValueOffset; + Result.Bottom := Result.Top + CategoryAxisWidth; + end + else + begin + Result.Left := ZeroValueOffset; + Result.Right := Result.Left + CategoryAxisWidth; + end; +end; + +function TcxGridChartHistogramViewInfo.GetCategoryAxisPosition: TcxGridChartAxisPosition; +begin + Result := Diagram.GetCategoryAxisPosition; +end; + +function TcxGridChartHistogramViewInfo.GetCategoryGridLineBounds(AIndex: Integer): TRect; +begin + Result := PlotBounds; + if IsCategoryAxisHorz then + begin + Result.Left := CategoryMarkPositions[AIndex]; + Result.Right := Result.Left + CategoryGridLineWidth; + end + else + begin + Result.Top := CategoryMarkPositions[AIndex]; + Result.Bottom := Result.Top + CategoryGridLineWidth; + end; +end; + +function TcxGridChartHistogramViewInfo.GetCategoryMarkBounds(Index: Integer): TRect; +var + AIsHorizontal: Boolean; +begin + AIsHorizontal := IsCategoryAxisHorz; + + Result := CategoryAxisBounds; + if AIsHorizontal then + begin + Result.Left := CategoryMarkPositions[Index]; + Result.Right := Result.Left + MarkWidth; + end + else + begin + Result.Top := CategoryMarkPositions[Index]; + Result.Bottom := Result.Top + MarkWidth; + end; + + if Diagram.AxisCategory.TickMarkKind in [tmkCross, tmkInside] then + if AIsHorizontal then + Dec(Result.Top, CategoryMarkHeight) + else + Inc(Result.Right, CategoryMarkHeight); + if Diagram.AxisCategory.TickMarkKind in [tmkCross, tmkOutside] then + if AIsHorizontal then + Inc(Result.Bottom, CategoryMarkHeight) + else + Dec(Result.Left, CategoryMarkHeight); +end; + +function TcxGridChartHistogramViewInfo.GetCategoryTickMarkLabelsBounds: TRect; +begin + Result := GetTickMarkLabelsBounds(CategoryAxisPosition); +end; + +function TcxGridChartHistogramViewInfo.GetTickMarkLabelsBounds(APosition: TcxGridChartAxisPosition): TRect; +begin + Result := Bounds; + case APosition of + cppLeft: + Result.Right := PlotBounds.Left - TickMarkLabelsOffset; + cppRight: + Result.Left := PlotBounds.Right + TickMarkLabelsOffset; + cppTop: + Result.Bottom := PlotBounds.Top - TickMarkLabelsOffset; + cppBottom: + Result.Top := PlotBounds.Bottom + TickMarkLabelsOffset; + end; +end; + +function TcxGridChartHistogramViewInfo.GetValueAxisBounds: TRect; +begin + Result := PlotBounds; + if IsValueAxisVert then + begin + if (ValueAxisPosition = cppLeft) xor IsCategoriesInReverseOrder then + Result.Left := CategoryMarkPositions[0] + else + Result.Left := CategoryMarkPositions[CategoryMarkCount - 1]; + Result.Right := Result.Left + ValueAxisWidth; + end + else + begin + if (ValueAxisPosition = cppBottom) xor IsCategoriesInReverseOrder then + Result.Top := CategoryMarkPositions[0] + else + Result.Top := CategoryMarkPositions[CategoryMarkCount - 1]; + Result.Bottom := Result.Top + ValueAxisWidth; + end; +end; + +function TcxGridChartHistogramViewInfo.GetValueAxisPosition: TcxGridChartAxisPosition; +begin + Result := Diagram.GetValueAxisPosition; +end; + +{function TcxGridChartHistogramViewInfo.GetValueBounds(AValueIndex, ASeriesIndex: Integer): TRect; +var + ACategoryOffset, ACategoryOffsetStart, ACategoryOffsetFinish, AValueOffsetStart, AValueOffsetFinish: Integer; +begin + ACategoryOffset := GetValueOffsetUnits(AValueIndex, ASeriesIndex); + ACategoryOffsetStart := GetUnitOffset(ACategoryOffset); + ACategoryOffsetFinish := GetUnitOffset(ACategoryOffset + ValueSizeUnits); + AValueOffsetStart := ZeroValueOffset; + AValueOffsetFinish := GetValueOffset(Values[ASeriesIndex, AValueIndex]); + + if IsValueAxisVert then + begin + Result.Left := ACategoryOffsetStart; + Result.Right := ACategoryOffsetFinish; + Result.Bottom := AValueOffsetStart; + Result.Top := AValueOffsetFinish; + CheckRectBounds(Result); + Inc(Result.Bottom, ValueGridLineWidth); + end + else + begin + Result.Bottom := ACategoryOffsetStart; + Result.Top := ACategoryOffsetFinish; + Result.Left := AValueOffsetStart; + Result.Right := AValueOffsetFinish; + CheckRectBounds(Result); + Inc(Result.Right, ValueGridLineWidth); + end; +end;} + +function TcxGridChartHistogramViewInfo.GetValueGridLineBounds(AIndex: Integer): TRect; +begin + Result := PlotBounds; + if IsValueAxisVert then + begin + Result.Top := ValueMarkPositions[AIndex]; + Result.Bottom := Result.Top + ValueGridLineWidth; + end + else + begin + Result.Left := ValueMarkPositions[AIndex]; + Result.Right := Result.Left + ValueGridLineWidth; + end; +end; + +function TcxGridChartHistogramViewInfo.GetValueMarkBounds(Index: Integer): TRect; +var + AIsVertical: Boolean; + AMarkKind: TcxGridChartHistogramTickMarkKind; +begin + Result := ValueAxisBounds; + AIsVertical := IsValueAxisVert; + if AIsVertical then + begin + Result.Top := ValueMarkPositions[Index]; + Result.Bottom := Result.Top + MarkWidth; + end + else + begin + Result.Left := ValueMarkPositions[Index]; + Result.Right := Result.Left + MarkWidth; + end; + AMarkKind := Diagram.AxisValue.TickMarkKind; + if (AMarkKind = tmkCross) or + (ValueAxisPosition in [cppRight, cppTop]) and (AMarkKind = tmkInside) or + (ValueAxisPosition in [cppLeft, cppBottom]) and (AMarkKind = tmkOutside) then + if AIsVertical then + Dec(Result.Left, ValueMarkHeight) + else + Inc(Result.Bottom, ValueMarkHeight); + if (AMarkKind = tmkCross) or + (ValueAxisPosition in [cppRight, cppTop]) and (AMarkKind = tmkOutside) or + (ValueAxisPosition in [cppLeft, cppBottom]) and (AMarkKind = tmkInside) then + if AIsVertical then + Inc(Result.Right, ValueMarkHeight) + else + Dec(Result.Top, ValueMarkHeight); +end; + +function TcxGridChartHistogramViewInfo.GetValueTickMarkLabelsBounds: TRect; +begin + Result := GetTickMarkLabelsBounds(ValueAxisPosition); +end; + +function TcxGridChartHistogramViewInfo.CustomDrawPlot(ACanvas: TcxCanvas): Boolean; +begin + Result := False; + Diagram.DoCustomDrawPlot(ACanvas, Self, PlotBounds, Result); +end; + +function TcxGridChartHistogramViewInfo.DoCustomDrawPlot(ACanvas: TcxCanvas): Boolean; +begin + Result := HasCustomDrawPlot; + if Result then + begin + ACanvas.SetParams(PlotParams); + Result := CustomDrawPlot(ACanvas); + if not Result then + ACanvas.GetParams(PlotParams); + end; +end; + +function TcxGridChartHistogramViewInfo.HasCustomDrawPlot: Boolean; +begin + Result := Diagram.HasCustomDrawPlot; +end; + +procedure TcxGridChartHistogramViewInfo.Calculate(const ABounds: TRect); +begin + inherited; + CalculateMinMaxValues(FMinValue, FMaxValue, FHasValuesOutOfRange); + FValueStep := CalculateValueStep; + CalculateMinMaxVisualValues(FMinVisualValue, FMaxVisualValue); + CalculateCategoryMarkValues; + CalculateValueMarkValues; + + FCategoryMarkHeight := CalculateCategoryMarkHeight; + FValueMarkHeight := CalculateValueMarkHeight; + CalculateCategoryMarkPositions; + CalculateValueMarkPositions; + if CategoryTickMarkLabelsViewInfo.Visible then + CategoryTickMarkLabelsViewInfo.Calculate(GetCategoryTickMarkLabelsBounds); + if ValueTickMarkLabelsViewInfo.Visible then + ValueTickMarkLabelsViewInfo.Calculate(GetValueTickMarkLabelsBounds); + + CalculateValues; +end; + +function TcxGridChartHistogramViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + Result := inherited GetHitTest(P); + if Result = nil then + if PtInRect(PlotBounds, P) then + begin + Result := TcxGridChartHistogramPlotHitTest.Instance(P); + InitHitTest(Result); + end + else + begin + Result := CategoryTickMarkLabelsViewInfo.GetHitTest(P); + if Result = nil then + Result := ValueTickMarkLabelsViewInfo.GetHitTest(P); + end; +end; + +{ TcxGridChartColumnDiagramLegendViewInfo } + +function TcxGridChartColumnDiagramLegendViewInfo.GetItemsInReverseOrder: Boolean; +begin + Result := + (Diagram.GetCategoryAxisPosition in [cppTop, cppBottom]) and + Diagram.AxisCategory.CategoriesInReverseOrder or + not (Diagram.GetCategoryAxisPosition in [cppTop, cppBottom]) and + not Diagram.AxisCategory.CategoriesInReverseOrder; +end; + +{ TcxGridChartColumnDiagramValueViewInfo } + +function TcxGridChartColumnDiagramValueViewInfo.GetCaptionPosition: TcxGridChartColumnDiagramValueCaptionPosition; +begin + Result := DiagramViewInfo.Diagram.Values.CaptionPosition; +end; + +function TcxGridChartColumnDiagramValueViewInfo.GetDiagramViewInfo: TcxGridChartColumnDiagramViewInfo; +begin + Result := TcxGridChartColumnDiagramViewInfo(inherited DiagramViewInfo); +end; + +function TcxGridChartColumnDiagramValueViewInfo.CalculateCaptionBounds: TRect; + + function GetVerticalValueCaptionBounds(ACaptionWidth, ACaptionHeight: Integer; + AIsUpDirection: Boolean): TRect; + begin + Result := ContentBounds; + with Result do + begin + Left := GetRangeCenter(Left, Right) - ACaptionWidth div 2; + Right := Left + ACaptionWidth; + case CaptionPosition of + cdvcpInsideBase: + if AIsUpDirection then + Top := Bottom - ACaptionHeight + else + Bottom := Top + ACaptionHeight; + cdvcpInsideEnd: + if AIsUpDirection then + Bottom := Top + ACaptionHeight + else + Top := Bottom - ACaptionHeight; + cdvcpOutsideEnd: + if AIsUpDirection then + begin + Bottom := Self.Bounds.Top; + Top := Bottom - ACaptionHeight; + end + else + begin + Top := Self.Bounds.Bottom; + Bottom := Top + ACaptionHeight; + end; + end; + end; + end; + + function GetHorizontalValueCaptionBounds(ACaptionWidth, ACaptionHeight: Integer; + AIsRightDirection: Boolean): TRect; + begin + Result := ContentBounds; + with Result do + begin + Top := GetRangeCenter(Top, Bottom) - ACaptionHeight div 2; + Bottom := Top + ACaptionHeight; + case CaptionPosition of + cdvcpInsideBase: + if AIsRightDirection then + Right := Left + ACaptionWidth + else + Left := Right - ACaptionWidth; + cdvcpInsideEnd: + if AIsRightDirection then + Left := Right - ACaptionWidth + else + Right := Left + ACaptionWidth; + cdvcpOutsideEnd: + if AIsRightDirection then + begin + Left := Self.Bounds.Right; + Right := Left + ACaptionWidth; + end + else + begin + Right := Self.Bounds.Left; + Left := Right - ACaptionWidth; + end; + end; + end; + end; + +var + AIsPositive: Boolean; +begin + AIsPositive := DiagramViewInfo.IsValuePositive(SeriesIndex, VisibleValueIndex); + if DiagramViewInfo.IsValueAxisVert then + Result := GetVerticalValueCaptionBounds(CaptionViewInfo.CalculateWidth, + CaptionViewInfo.CalculateHeight, AIsPositive) + else + Result := GetHorizontalValueCaptionBounds(CaptionViewInfo.CalculateWidth, + CaptionViewInfo.CalculateHeight, AIsPositive); +end; + +function TcxGridChartColumnDiagramValueViewInfo.GetBorderColor(AIndex: TcxBorder): TColor; +begin + Result := Params.TextColor; +end; + +function TcxGridChartColumnDiagramValueViewInfo.GetBorders: TcxBorders; +begin + Result := cxBordersAll; +end; + +function TcxGridChartColumnDiagramValueViewInfo.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := DiagramViewInfo.Diagram.Values.BorderWidth; +end; + +function TcxGridChartColumnDiagramValueViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartColumnDiagramValuePainter; +end; + +function TcxGridChartColumnDiagramValueViewInfo.HasCaption: Boolean; +begin + Result := CaptionPosition <> cdvcpNone; +end; + +function TcxGridChartColumnDiagramValueViewInfo.HasCaptionVisualCompensation: Boolean; +begin + Result := True; +end; + +{ TcxGridChartColumnDiagramViewInfo } + +function TcxGridChartColumnDiagramViewInfo.GetDiagram: TcxGridChartColumnDiagram; +begin + Result := TcxGridChartColumnDiagram(inherited Diagram); +end; + +function TcxGridChartColumnDiagramViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartColumnDiagramPainter; +end; + +class function TcxGridChartColumnDiagramViewInfo.GetValueViewInfoClass: TcxGridChartDiagramValueViewInfoClass; +begin + Result := TcxGridChartColumnDiagramValueViewInfo; +end; + +function TcxGridChartColumnDiagramViewInfo.GetValueViewInfoIndex(ASeriesIndex, AVisibleIndex: Integer): Integer; +begin + Result := AVisibleIndex * SeriesCount + ASeriesIndex; +end; + +function TcxGridChartColumnDiagramViewInfo.GetCategoryTickMarkLabelOffsetUnits(AIndex: Integer): Integer; +begin + Result := GetCategoryTickMarkOffsetUnits(AIndex, False); +end; + +function TcxGridChartColumnDiagramViewInfo.GetCategoryTickMarkOffsetUnits(AIndex: Integer; + AValueAxisBetweenCategories: Boolean): Integer; +begin + if AValueAxisBetweenCategories then + Result := 0 + else + Result := 1; + Result := GetValueGroupAreaSizeUnits * (Result + 2 * AIndex) div 2; +end; + +function TcxGridChartColumnDiagramViewInfo.GetUnitCount: Integer; +begin + Result := VisibleValueCount * GetValueGroupAreaSizeUnits; +end; + +function TcxGridChartColumnDiagramViewInfo.GetValueGroupAreaSizeUnits: Integer; +begin + Result := SeriesCount * ColumnDiagramValueSizeUnits + 2 * ColumnDiagramValueOffsetUnits; +end; + +function TcxGridChartColumnDiagramViewInfo.GetValueOffsetUnits(AVisibleValueIndex, ASeriesIndex: Integer): Integer; +begin + Result := AVisibleValueIndex * GetValueGroupAreaSizeUnits + ColumnDiagramValueOffsetUnits + + ASeriesIndex * ColumnDiagramValueSizeUnits; +end; + +function TcxGridChartColumnDiagramViewInfo.IsEdgeCategoryTickMarkLabels: Boolean; +begin + Result := False; +end; + +procedure TcxGridChartColumnDiagramViewInfo.CalculateValues; +var + AValueIndex, ASeriesIndex: Integer; +begin + for AValueIndex := 0 to VisibleValueCount - 1 do + for ASeriesIndex := 0 to SeriesCount - 1 do + CreateValueViewInfo(ASeriesIndex, AValueIndex).Calculate(GetValueBounds(AValueIndex, ASeriesIndex)); +end; + +function TcxGridChartColumnDiagramViewInfo.GetValueBounds(AVisibleValueIndex, ASeriesIndex: Integer): TRect; +var + ACategoryOffset, ACategoryOffsetStart, ACategoryOffsetFinish, AValueOffsetStart, AValueOffsetFinish: Integer; +begin + ACategoryOffset := GetValueOffsetUnits(AVisibleValueIndex, ASeriesIndex); + ACategoryOffsetStart := GetUnitOffset(ACategoryOffset); + ACategoryOffsetFinish := GetUnitOffset(ACategoryOffset + ColumnDiagramValueSizeUnits); + AValueOffsetStart := ZeroValueOffset; + AValueOffsetFinish := GetValueOffset(VisibleValues[ASeriesIndex, AVisibleValueIndex]); + + if IsValueAxisVert then + begin + Result.Left := ACategoryOffsetStart; + Result.Right := ACategoryOffsetFinish; + Result.Bottom := AValueOffsetStart; + Result.Top := AValueOffsetFinish; + CheckRectBounds(Result); + Inc(Result.Bottom, ValueGridLineWidth); + end + else + begin + Result.Bottom := ACategoryOffsetStart; + Result.Top := ACategoryOffsetFinish; + Result.Left := AValueOffsetStart; + Result.Right := AValueOffsetFinish; + CheckRectBounds(Result); + Inc(Result.Right, ValueGridLineWidth); + end; +end; + +{ TcxGridChartLineDiagramLegendItemViewInfo } + +function TcxGridChartLineDiagramLegendItemViewInfo.GetDiagram: TcxGridChartLineDiagram; +begin + Result := TcxGridChartLineDiagram(inherited Diagram); +end; + +function TcxGridChartLineDiagramLegendItemViewInfo.GetLineStyle: TcxGridChartLineStyle; +begin + Result := Diagram.Values.GetLineStyle(Series); +end; + +function TcxGridChartLineDiagramLegendItemViewInfo.GetLineWidth: Integer; +begin + Result := Diagram.Values.LineWidth; +end; + +function TcxGridChartLineDiagramLegendItemViewInfo.GetMarkerSize: Integer; +begin + Result := Diagram.Values.MarkerSize; +end; + +function TcxGridChartLineDiagramLegendItemViewInfo.GetMarkerStyle: TcxGridChartMarkerStyle; +begin + Result := Diagram.Values.GetMarkerStyle(Series); +end; + +function TcxGridChartLineDiagramLegendItemViewInfo.CalculateHeight: Integer; +begin + Result := inherited CalculateHeight; + if LineStyle <> clsNone then + Result := Max(Result, LineWidth); + if MarkerStyle <> cmsNone then + Result := Max(Result, MarkerSize); +end; + +function TcxGridChartLineDiagramLegendItemViewInfo.CalculateLegendKeyWidth: Integer; +begin + Result := 0; + if LineStyle <> clsNone then + Result := Max(Result, 20 + 10 * LineWidth); + if MarkerStyle <> cmsNone then + if LineStyle = clsNone then + Result := Max(Result, MarkerSize) + else + Result := Max(Result, 3 * MarkerSize); +end; + +procedure TcxGridChartLineDiagramLegendItemViewInfo.CalculateMarkerPoints; +begin + GetDiagramValueViewInfoClass.CalculateMarkerPointsEx(MarkerBounds, MarkerStyle, + MarkerPoints); +end; + +procedure TcxGridChartLineDiagramLegendItemViewInfo.DoCalculateParams; +begin + inherited; + TcxGridChartLineDiagramLegendViewInfo(Container).GetItemLegendKeyMarkerParams(Index, MarkerParams); +end; + +function TcxGridChartLineDiagramLegendItemViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + Result := vaCenter; +end; + +function TcxGridChartLineDiagramLegendItemViewInfo.GetDiagramValueViewInfoClass: TcxGridChartLineDiagramValueViewInfoClass; +begin + Result := TcxGridChartLineDiagramValueViewInfoClass(Diagram.GetViewInfoClass.GetValueViewInfoClass); +end; + +function TcxGridChartLineDiagramLegendItemViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartLineDiagramLegendItemPainter; +end; + +function TcxGridChartLineDiagramLegendItemViewInfo.GetLineColor: TColor; +begin + Result := LegendKeyParams.Color; +end; + +function TcxGridChartLineDiagramLegendItemViewInfo.GetLineStart: TPoint; +begin + with LegendKeyBounds do + begin + Result.X := Left + RoundDiv(LineWidth, 2); + Result.Y := GetRangeCenter(Top, Bottom); + end; +end; + +function TcxGridChartLineDiagramLegendItemViewInfo.GetLineFinish: TPoint; +begin + with LegendKeyBounds do + begin + Result.X := Right - RoundDiv(LineWidth, 2); + Result.Y := GetRangeCenter(Top, Bottom); + end; +end; + +function TcxGridChartLineDiagramLegendItemViewInfo.GetMarkerBounds: TRect; +begin + with LegendKeyBounds do + GetCenteredRect(Point(GetRangeCenter(Left, Right), GetRangeCenter(Top, Bottom)), + MarkerSize, MarkerSize, Result); +end; + +procedure TcxGridChartLineDiagramLegendItemViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + inherited; + CalculateMarkerPoints; +end; + +{ TcxGridChartLineDiagramLegendViewInfo } + +function TcxGridChartLineDiagramLegendViewInfo.GetItemClass: TcxGridChartLegendItemViewInfoClass; +begin + Result := TcxGridChartLineDiagramLegendItemViewInfo; +end; + +procedure TcxGridChartLineDiagramLegendViewInfo.GetItemLegendKeyMarkerParams(AIndex: Integer; + out AParams: TcxViewParams); +begin + TcxGridChartLineDiagram(Diagram).Styles.GetValueMarkerParams(GetItemSeriesIndex(AIndex), + GetItemValueIndex(AIndex), AParams); +end; + +{ TcxGridChartLineDiagramValueViewInfo } + +function TcxGridChartLineDiagramValueViewInfo.GetCaptionPosition: TcxGridChartLineDiagramValueCaptionPosition; +begin + Result := Diagram.Values.CaptionPosition; +end; + +function TcxGridChartLineDiagramValueViewInfo.GetDiagram: TcxGridChartLineDiagram; +begin + Result := TcxGridChartLineDiagram(inherited Diagram); +end; + +function TcxGridChartLineDiagramValueViewInfo.GetDiagramViewInfo: TcxGridChartLineDiagramViewInfo; +begin + Result := TcxGridChartLineDiagramViewInfo(inherited DiagramViewInfo); +end; + +function TcxGridChartLineDiagramValueViewInfo.GetLineStyle: TcxGridChartLineStyle; +begin + Result := Diagram.Values.GetLineStyle(Series); +end; + +function TcxGridChartLineDiagramValueViewInfo.GetLineWidth: Integer; +begin + Result := Diagram.Values.LineWidth; +end; + +function TcxGridChartLineDiagramValueViewInfo.GetMarkerStyle: TcxGridChartMarkerStyle; +begin + Result := Diagram.Values.GetMarkerStyle(Series); +end; + +function TcxGridChartLineDiagramValueViewInfo.CalculateCaptionBounds: TRect; +var + ACaptionWidth, ACaptionHeight: Integer; +begin + Result := MarkerBounds; + InflateRect(Result, LineDiagramCaptionOffset, LineDiagramCaptionOffset); + ACaptionWidth := CaptionViewInfo.CalculateWidth; + ACaptionHeight := CaptionViewInfo.CalculateHeight; + + case CaptionPosition of + ldvcpLeft: + begin + Result.Right := Result.Left; + Dec(Result.Left, ACaptionWidth); + end; + ldvcpRight: + begin + Result.Left := Result.Right; + Inc(Result.Right, ACaptionWidth); + end; + else + Result.Left := GetRangeCenter(Result.Left, Result.Right) - ACaptionWidth div 2; + Result.Right := Result.Left + ACaptionWidth; + end; + case CaptionPosition of + ldvcpAbove: + begin + Result.Bottom := Result.Top; + Dec(Result.Top, ACaptionHeight); + end; + ldvcpBelow: + begin + Result.Top := Result.Bottom; + Inc(Result.Bottom, ACaptionHeight); + end; + else + Result.Top := GetRangeCenter(Result.Top, Result.Bottom) - ACaptionHeight div 2; + Result.Bottom := Result.Top + ACaptionHeight; + end; +end; + +procedure TcxGridChartLineDiagramValueViewInfo.CalculateMarkerParams(var AParams: TcxViewParams); +begin + Diagram.Styles.GetValueMarkerParams(SeriesIndex, ValueIndex, AParams); +end; + +procedure TcxGridChartLineDiagramValueViewInfo.CalculateMarkerPoints; +begin + CalculateMarkerPointsEx(MarkerBounds, MarkerStyle, MarkerPoints); +end; + +procedure TcxGridChartLineDiagramValueViewInfo.DoCalculateParams; +begin + inherited; + CalculateMarkerParams(MarkerParams); +end; + +function TcxGridChartLineDiagramValueViewInfo.GetCellBoundsForHint: TRect; +begin + Result := HotSpotBounds; +end; + +function TcxGridChartLineDiagramValueViewInfo.GetDesignSelectionBounds: TRect; +begin + Result := HotSpotBounds; +end; + +function TcxGridChartLineDiagramValueViewInfo.GetHotSpotBounds: TRect; +var + ASize: Integer; +begin + ASize := Diagram.Values.GetHotSpotSize; + GetCenteredRect(Position, ASize, ASize, Result); +end; + +function TcxGridChartLineDiagramValueViewInfo.GetLineColor: TColor; +begin + Result := Params.Color; +end; + +function TcxGridChartLineDiagramValueViewInfo.GetLineHotZoneMinWidth: Integer; +begin + Result := LineDiagramLineHotZoneMinWidth; +end; + +function TcxGridChartLineDiagramValueViewInfo.GetLineStart: TPoint; +begin + Result.X := Bounds.Left; + Result.Y := LineStartY; +end; + +function TcxGridChartLineDiagramValueViewInfo.GetLineFinish: TPoint; +begin + Result.X := Bounds.Right; + Result.Y := LineFinishY; +end; + +function TcxGridChartLineDiagramValueViewInfo.GetMarkerBounds: TRect; +var + ASize: Integer; +begin + ASize := Diagram.Values.MarkerSize; + GetCenteredRect(Position, ASize, ASize, Result); +end; + +function TcxGridChartLineDiagramValueViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := GetPainterClassEx; +end; + +class function TcxGridChartLineDiagramValueViewInfo.GetPainterClassEx: TcxGridChartLineDiagramValuePainterClass; +begin + Result := TcxGridChartLineDiagramValuePainter; +end; + +function TcxGridChartLineDiagramValueViewInfo.GetPosition: TPoint; +begin + if CategoryDirection = dirRight then + Result.X := Bounds.Right + else + Result.X := Bounds.Left; + if ValueDirection = dirUp then + Result.Y := Bounds.Top + else + Result.Y := Bounds.Bottom; +end; + +procedure TcxGridChartLineDiagramValueViewInfo.MakeRealBounds(var ABounds: TRect); +begin + ABounds.Top := Min(ABounds.Top, Min(LineStartY, LineFinishY)); + ABounds.Bottom := Max(ABounds.Bottom, Max(LineStartY, LineFinishY)); +end; + +function TcxGridChartLineDiagramValueViewInfo.HasBackground: Boolean; +begin + Result := False; +end; + +function TcxGridChartLineDiagramValueViewInfo.HasCaption: Boolean; +begin + Result := CaptionPosition <> ldvcpNone; +end; + +procedure TcxGridChartLineDiagramValueViewInfo.Calculate(const ABounds: TRect; + ALineStartY, ALineFinishY: Integer); +begin + inherited Calculate(ABounds); + FLineStartY := ALineStartY; + FLineFinishY := ALineFinishY; + CalculateMarkerPoints; +end; + +class procedure TcxGridChartLineDiagramValueViewInfo.CalculateMarkerPointsEx(const ABounds: TRect; + AStyle: TcxGridChartMarkerStyle; var APoints: TPointArray); +var + AOrigin: TPoint; + ASize: Integer; +begin + if not (AStyle in [cmsTriangle, cmsDiamond]) then Exit; + with ABounds do + begin + AOrigin := TopLeft; + ASize := Right - Left; + end; + if not Odd(ASize) then + begin + Dec(ASize); + Inc(AOrigin.X); + Inc(AOrigin.Y); + end; + if AStyle = cmsTriangle then + begin + SetLength(APoints, 3); + APoints[0] := Point(AOrigin.X, AOrigin.Y + ASize - 1 - 1); + APoints[1] := Point(AOrigin.X + ASize div 2, AOrigin.Y - 1); + APoints[2] := Point(AOrigin.X + ASize, AOrigin.Y + ASize - 1); + end + else + begin + SetLength(APoints, 4); + APoints[0] := Point(AOrigin.X, AOrigin.Y + ASize div 2); + APoints[1] := Point(AOrigin.X + ASize div 2, AOrigin.Y - 1); + APoints[2] := Point(AOrigin.X + ASize, AOrigin.Y + ASize div 2); + APoints[3] := Point(AOrigin.X + ASize div 2, AOrigin.Y + ASize); + end; +end; + +function TcxGridChartLineDiagramValueViewInfo.GetAreaBoundsForPainting: TRect; +begin + Result := inherited GetAreaBoundsForPainting; + if LineStyle <> clsNone then + begin + MakeRealBounds(Result); + InflateRect(Result, RoundDiv(LineWidth, 2), RoundDiv(LineWidth, 2)); + end; + if MarkerStyle <> cmsNone then + UnionRect(Result, Result, MarkerBounds); +end; + +function TcxGridChartLineDiagramValueViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + Result := inherited GetHitTest(P); + if (Result = nil) and (LineStyle <> clsNone) and + LineHasPoint(LineStart, LineFinish, LineWidth, P, LineHotZoneMinWidth) then + begin + Result := TcxGridChartValueLineHitTest.Instance(P); + InitHitTest(Result); + TcxGridChartValueLineHitTest(Result).CanDrillDown := False; + end; +end; + +function TcxGridChartLineDiagramValueViewInfo.GetRealBounds: TRect; +begin + Result := Bounds; + MakeRealBounds(Result); +end; + +function TcxGridChartLineDiagramValueViewInfo.HasPoint(const P: TPoint): Boolean; +begin + Result := PtInRect(HotSpotBounds, P); +end; + +{ TcxGridChartLineDiagramViewInfo } + +function TcxGridChartLineDiagramViewInfo.GetDiagram: TcxGridChartLineDiagram; +begin + Result := TcxGridChartLineDiagram(inherited Diagram); +end; + +function TcxGridChartLineDiagramViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartLineDiagramPainter; +end; + +class function TcxGridChartLineDiagramViewInfo.GetValueViewInfoClass: TcxGridChartDiagramValueViewInfoClass; +begin + Result := TcxGridChartLineDiagramValueViewInfo; +end; + +function TcxGridChartLineDiagramViewInfo.GetValueViewInfoIndex(ASeriesIndex, AVisibleIndex: Integer): Integer; +begin + Result := ASeriesIndex * VisibleValueCount + AVisibleIndex; +end; + +function TcxGridChartLineDiagramViewInfo.GetCategoryTickMarkLabelOffsetUnits(AIndex: Integer): Integer; +begin + Result := GetValueOffsetUnits(AIndex, -1); +end; + +function TcxGridChartLineDiagramViewInfo.GetCategoryTickMarkOffsetUnits(AIndex: Integer; + AValueAxisBetweenCategories: Boolean): Integer; +begin + Result := LineDiagramValueSizeUnits * AIndex; +end; + +function TcxGridChartLineDiagramViewInfo.GetUnitCount: Integer; +begin + Result := LineDiagramValueSizeUnits * VisibleValueCount; + if not Diagram.AxisCategory.ValueAxisBetweenCategories then + Dec(Result, LineDiagramValueSizeUnits); +end; + +function TcxGridChartLineDiagramViewInfo.GetValueOffsetUnits(AVisibleValueIndex, ASeriesIndex: Integer): Integer; +begin + if Diagram.AxisCategory.ValueAxisBetweenCategories then + Result := LineDiagramValueSizeUnits div 2 + else + Result := 0; + Inc(Result, LineDiagramValueSizeUnits * AVisibleValueIndex); +end; + +function TcxGridChartLineDiagramViewInfo.IsEdgeCategoryTickMarkLabels: Boolean; +begin + Result := not Diagram.AxisCategory.ValueAxisBetweenCategories; +end; + +function TcxGridChartLineDiagramViewInfo.GetValueY(AVisibleValueIndex, ASeriesIndex: Integer): Integer; +begin + Result := GetValueOffset(VisibleValues[ASeriesIndex, AVisibleValueIndex]); +end; + +procedure TcxGridChartLineDiagramViewInfo.CalculatePlotOffsets(APlotAreaWidth: Integer; + var AOffsets: TRect); +var + ACompensation: Integer; +begin + inherited; + if Diagram.Values.LineStyle = clsNone then + ACompensation := 0 + else + ACompensation := RoundDiv(Diagram.Values.LineWidth, 2); + if Diagram.Values.MarkerStyle <> cmsNone then + ACompensation := Max(ACompensation, RoundDiv(Diagram.Values.MarkerSize, 2)); + if ACompensation <> 0 then + begin + AOffsets.Left := Max(AOffsets.Left, ACompensation); + AOffsets.Top := Max(AOffsets.Top, ACompensation); + AOffsets.Right := Max(AOffsets.Right, ACompensation); + AOffsets.Bottom := Max(AOffsets.Bottom, ACompensation); + end; +end; + +procedure TcxGridChartLineDiagramViewInfo.CalculateValues; +var + AValueIndex, ASeriesIndex, ALineStartY, ALineFinishY: Integer; +begin + ALineStartY := 0; // to avoid warning + for ASeriesIndex := 0 to SeriesCount - 1 do + for AValueIndex := 0 to VisibleValueCount - 1 do + begin + ALineFinishY := GetValueY(AValueIndex, ASeriesIndex); + if AValueIndex = 0 then + ALineStartY := ALineFinishY; + if IsCategoriesInReverseOrder then + SwapIntegers(ALineStartY, ALineFinishY); + TcxGridChartLineDiagramValueViewInfo(CreateValueViewInfo(ASeriesIndex, AValueIndex)).Calculate( + GetValueBounds(AValueIndex, ASeriesIndex), ALineStartY, ALineFinishY); + if not IsCategoriesInReverseOrder then + ALineStartY := ALineFinishY; + end; +end; + +function TcxGridChartLineDiagramViewInfo.GetValueBounds(AVisibleValueIndex, ASeriesIndex: Integer): TRect; +var + ACategoryOffsetStart, ACategoryOffsetFinish, AValueOffsetStart, AValueOffsetFinish: Integer; +begin + ACategoryOffsetFinish := GetUnitAdjustedOffset(GetValueOffsetUnits(AVisibleValueIndex, ASeriesIndex)); + if AVisibleValueIndex = 0 then + ACategoryOffsetStart := ACategoryOffsetFinish + else + ACategoryOffsetStart := GetUnitAdjustedOffset(GetValueOffsetUnits(AVisibleValueIndex - 1, ASeriesIndex)); + AValueOffsetStart := ZeroValueOffset; + AValueOffsetFinish := GetValueY(AVisibleValueIndex, ASeriesIndex); + + Result.Left := ACategoryOffsetStart; + Result.Right := ACategoryOffsetFinish; + Result.Bottom := AValueOffsetStart; + Result.Top := AValueOffsetFinish; + CheckRectBounds(Result); +end; + +{ TcxGridChartAreaDiagramLegendItemViewInfo } + +function TcxGridChartAreaDiagramLegendItemViewInfo.CalculateHeight: Integer; +begin + Result := Max(inherited CalculateHeight, 2 * AreaDiagramLegendKeyOffset + LegendKeyHeight); +end; + +function TcxGridChartAreaDiagramLegendItemViewInfo.CalculateLegendKeyHeight: Integer; +begin + Result := 2 * AreaDiagramLegendKeySpace; + if LineStyle <> clsNone then + Inc(Result, 2 * LineWidth); + if MarkerStyle <> cmsNone then + Inc(Result, MarkerSize); + Result := Max(Result, inherited CalculateLegendKeyHeight); +end; + +function TcxGridChartAreaDiagramLegendItemViewInfo.CalculateLegendKeyWidth: Integer; +begin + Result := inherited CalculateLegendKeyWidth; + if Result = 0 then + Result := LegendKeyHeight; +end; + +function TcxGridChartAreaDiagramLegendItemViewInfo.GetLineColor: TColor; +begin + Result := LegendKeyParams.TextColor; +end; + +function TcxGridChartAreaDiagramLegendItemViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartAreaDiagramLegendItemPainter; +end; + +{ TcxGridChartAreaDiagramLegendViewInfo } + +function TcxGridChartAreaDiagramLegendViewInfo.GetItemClass: TcxGridChartLegendItemViewInfoClass; +begin + Result := TcxGridChartAreaDiagramLegendItemViewInfo; +end; + +function TcxGridChartAreaDiagramLegendViewInfo.GetItemsInReverseOrder: Boolean; +begin + Result := (Orientation = cpoVertical) and (Diagram.Values.Stacking <> vsNone); +end; + +{function TcxGridChartAreaDiagramLegendViewInfo.ItemLegendKeyBorderIsValueBorder: Boolean; +begin + Result := True; +end;} + +{ TcxGridChartAreaDiagramValueViewInfo } + +function TcxGridChartAreaDiagramValueViewInfo.GetDiagram: TcxGridChartAreaDiagram; +begin + Result := TcxGridChartAreaDiagram(inherited Diagram); +end; + +procedure TcxGridChartAreaDiagramValueViewInfo.CalculateAreaPoints; +var + APrevSeriesValuePoints: TPointArray; +begin + SetLength(AreaPoints, 4); + AreaPoints[1] := LineStart; + AreaPoints[2] := LineFinish; +{$IFNDEF DELPHI7} + APrevSeriesValuePoints := nil; // to remove wrong warning +{$ENDIF} + if (Diagram.Values.Stacking <> vsNone) and (SeriesIndex > 0) then + begin + APrevSeriesValuePoints := TcxGridChartAreaDiagramValueViewInfo( + DiagramViewInfo.GetValueViewInfo(SeriesIndex - 1, VisibleValueIndex)).AreaPoints; + AreaPoints[0] := APrevSeriesValuePoints[1]; + AreaPoints[3] := APrevSeriesValuePoints[2]; + end + else + begin + AreaPoints[0] := Point(Bounds.Left, ZeroValueOffset); + AreaPoints[3] := Point(Bounds.Right, ZeroValueOffset); + end; +end; + +function TcxGridChartAreaDiagramValueViewInfo.CustomDrawBackground(ACanvas: TcxCanvas): Boolean; +begin + Result := inherited CustomDrawBackground(ACanvas); + if not Result then + Diagram.DoCustomDrawValueArea(ACanvas, Self, Result); +end; + +function TcxGridChartAreaDiagramValueViewInfo.GetAreaColor: TColor; +begin + Result := Params.Color; +end; + +function TcxGridChartAreaDiagramValueViewInfo.GetHotSpotBounds: TRect; +var + ASize: TPoint; + APrevSeriesValuePosition: Integer; +begin + ASize.X := Diagram.Values.GetHotSpotSize; + if MarkerStyle = cmsNone then + ASize.Y := 0 + else + ASize.Y := ASize.X; + GetCenteredRect(Position, ASize.X, ASize.Y, Result); + + if (Diagram.Values.Stacking <> vsNone) and (SeriesIndex > 0) then + begin + APrevSeriesValuePosition := TcxGridChartAreaDiagramValueViewInfo( + DiagramViewInfo.GetValueViewInfo(SeriesIndex - 1, VisibleValueIndex)).Position.Y; + if Result.Top < APrevSeriesValuePosition then + Result.Bottom := APrevSeriesValuePosition + else + Result.Top := APrevSeriesValuePosition; + end + else + begin + Result.Top := Min(Result.Top, ZeroValueOffset); + Result.Bottom := Max(Result.Bottom, ZeroValueOffset); + end; +end; + +function TcxGridChartAreaDiagramValueViewInfo.GetLineColor: TColor; +begin + Result := Params.TextColor; +end; + +function TcxGridChartAreaDiagramValueViewInfo.GetLineHotZoneMinWidth: Integer; +begin + Result := 0; +end; + +class function TcxGridChartAreaDiagramValueViewInfo.GetPainterClassEx: TcxGridChartLineDiagramValuePainterClass; +begin + Result := TcxGridChartAreaDiagramValuePainter; +end; + +function TcxGridChartAreaDiagramValueViewInfo.GetZeroValueOffset: Integer; +begin + if ValueDirection = dirUp then + Result := Bounds.Bottom + else + Result := Bounds.Top; +end; + +function TcxGridChartAreaDiagramValueViewInfo.HasCustomDrawBackground: Boolean; +begin + Result := Diagram.HasCustomDrawValueArea; +end; + +procedure TcxGridChartAreaDiagramValueViewInfo.Calculate(const ABounds: TRect; + ALineStartY, ALineFinishY: Integer); +begin + inherited; + CalculateAreaPoints; +end; + +function TcxGridChartAreaDiagramValueViewInfo.CreateAreaRegion: TcxRegion; +begin + Result := TcxRegion.Create(CreatePolygonRgn(AreaPoints[0], Length(AreaPoints), WINDING)); +end; + +function TcxGridChartAreaDiagramValueViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +var + ARegion: TcxRegion; +begin + Result := inherited GetHitTest(P); + if Result = nil then + begin + ARegion := CreateAreaRegion; + try + if ARegion.PtInRegion(P) then + begin + Result := TcxGridChartValueAreaHitTest.Instance(P); + InitHitTest(Result); + TcxGridChartValueAreaHitTest(Result).CanDrillDown := False; + end; + finally + ARegion.Free; + end; + end; +end; + +{ TcxGridChartAreaDiagramViewInfo } + +function TcxGridChartAreaDiagramViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartAreaDiagramPainter; +end; + +class function TcxGridChartAreaDiagramViewInfo.GetValueViewInfoClass: TcxGridChartDiagramValueViewInfoClass; +begin + Result := TcxGridChartAreaDiagramValueViewInfo; +end; + +{ TcxGridChartPieDiagramLegendViewInfo } + +function TcxGridChartPieDiagramLegendViewInfo.GetDiagram: TcxGridChartPieDiagram; +begin + Result := TcxGridChartPieDiagram(inherited Diagram); +end; + +function TcxGridChartPieDiagramLegendViewInfo.GetItemObjectIndex(AIndex: Integer): Integer; +begin + Result := AIndex; +end; + +function TcxGridChartPieDiagramLegendViewInfo.GetKind: TcxGridChartLegendKind; +begin + if GridView.VisibleSeriesCount = 0 then + Result := lkSeries + else + Result := lkCategories; +end; + +{ TcxGridChartPieDiagramValueViewInfo } + +function TcxGridChartPieDiagramValueViewInfo.GetCaptionPosition: TcxGridChartPieDiagramValueCaptionPosition; +begin + Result := DiagramViewInfo.CaptionPosition; +end; + +function TcxGridChartPieDiagramValueViewInfo.GetCenter: TPoint; +begin + with Bounds do + begin + Result.X := GetRangeCenter(Left, Right); + Result.Y := GetRangeCenter(Top, Bottom); + end; +end; + +function TcxGridChartPieDiagramValueViewInfo.GetDiagramViewInfo: TcxGridChartPieDiagramViewInfo; +begin + Result := TcxGridChartPieDiagramViewInfo(inherited DiagramViewInfo); +end; + +function TcxGridChartPieDiagramValueViewInfo.GetRadius: Integer; +begin + with Bounds do + Result := (Right - Left) div 2; +end; + +function TcxGridChartPieDiagramValueViewInfo.CalculateCaptionBounds: TRect; +var + ACaptionWidth, ACaptionHeight, AAngle: Integer; +begin + ACaptionWidth := CaptionViewInfo.CalculateWidth; + ACaptionHeight := CaptionViewInfo.CalculateHeight; + AAngle := GetRangeCenter(StartAngle, FinishAngle) mod 360; + GetCenteredRect(CalculateCaptionCenter(AAngle, ACaptionWidth, ACaptionHeight), + ACaptionWidth, ACaptionHeight, Result); + OffsetRect(Result, 0, -1); // to center text inside text rect + if CaptionPosition = pdvcpOutsideEndWithLeaderLines then + MakeCaptionVisible(Result, AAngle); +end; + +function TcxGridChartPieDiagramValueViewInfo.CalculateCaptionCenter(AAngle, ACaptionWidth, ACaptionHeight: Integer): TPoint; +const + SpecialCaseAngleDelta = 25; +var + ARadius: Integer; + AIsSpecialCase: Boolean; + ASin, ACos: Extended; +begin + if CaptionPosition = pdvcpOutsideEndWithLeaderLines then + begin + CalculateLeaderLinePoints(AAngle); + Result := LeaderLinePoints[Length(LeaderLinePoints) - 1]; + if AAngle < 180 then + Inc(Result.X, RoundDiv(ACaptionWidth, 2)) + else + Dec(Result.X, RoundDiv(ACaptionWidth, 2) - 1); + end + else + begin + ARadius := Radius; + AIsSpecialCase := False; + case CaptionPosition of + pdvcpCenter: + ARadius := ARadius div 2; + pdvcpInsideEnd: + Dec(ARadius, PieValueCaptionOffset + Max(ACaptionWidth div 2, ACaptionHeight div 2)); + pdvcpOutsideEnd: + begin + Inc(ARadius, PieValueCaptionOffset + ACaptionHeight div 2); + AIsSpecialCase := not (AAngle mod 180 in [SpecialCaseAngleDelta..180 - SpecialCaseAngleDelta]); + if AIsSpecialCase then + begin + SinCos(DegToRad(AAngle mod 180), ASin, ACos); + if ACaptionWidth div 2 >= Abs(ASin / ACos * ARadius) then + ARadius := Round(Abs(ARadius / ACos)) + else + ARadius := Round(ACaptionWidth div 2 * ASin + Sqrt(Sqr(ARadius) - Sqr(ACaptionWidth div 2 * ACos))); + end; + end; + end; + Result := GetPointOnCircle(Center, ARadius, AAngle); + if CaptionPosition = pdvcpOutsideEnd then + if AIsSpecialCase then + if AAngle in [180 - SpecialCaseAngleDelta..180 + SpecialCaseAngleDelta] then + Inc(Result.Y, ACaptionHeight div 2) + else + Dec(Result.Y, ACaptionHeight div 2) + else + if AAngle < 180 then + Inc(Result.X, ACaptionWidth div 2) + else + Dec(Result.X, ACaptionWidth div 2); + end; +end; + +procedure TcxGridChartPieDiagramValueViewInfo.CalculateLeaderLinePoints(AAngle: Integer); +begin + SetLength(LeaderLinePoints, 3); + LeaderLinePoints[0] := GetPointOnCircle(Center, Radius, AAngle); + LeaderLinePoints[1] := + GetPointOnCircle(Center, Radius + PieLeaderLineSegment1, AAngle); + LeaderLinePoints[2] := LeaderLinePoints[1]; + if AAngle < 180 then + Inc(LeaderLinePoints[2].X, PieLeaderLineSegment2) + else + Dec(LeaderLinePoints[2].X, PieLeaderLineSegment2); +end; + +function TcxGridChartPieDiagramValueViewInfo.GetIsDesignSelected: Boolean; +begin + Result := False; +end; + +function TcxGridChartPieDiagramValueViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartPieDiagramValuePainter; +end; + +function TcxGridChartPieDiagramValueViewInfo.HasBackground: Boolean; +begin + Result := False; +end; + +function TcxGridChartPieDiagramValueViewInfo.HasCaption: Boolean; +begin + Result := (Radius <> 0) and (CaptionPosition <> pdvcpNone); +end; + +procedure TcxGridChartPieDiagramValueViewInfo.MakeCaptionVisible(var ACaptionBounds: TRect; + AAngle: Integer); +var + APrevValueIndex, ACaptionOffset: Integer; + APrevCaptionBounds, AIntersection: TRect; +begin + if VisibleValueIndex = 0 then Exit; + APrevValueIndex := VisibleValueIndex; + repeat + Dec(APrevValueIndex); + APrevCaptionBounds := + DiagramViewInfo.GetValueViewInfo(SeriesIndex, APrevValueIndex).CaptionViewInfo.Bounds; + if not EqualRect(ACaptionBounds, APrevCaptionBounds) and + IntersectRect(AIntersection, ACaptionBounds, APrevCaptionBounds) then + begin + if AAngle < 180 then + ACaptionOffset := APrevCaptionBounds.Right - ACaptionBounds.Left + else + ACaptionOffset := APrevCaptionBounds.Left - ACaptionBounds.Right; + OffsetRect(ACaptionBounds, ACaptionOffset, 0); + if LeaderLinePoints <> nil then + Inc(LeaderLinePoints[Length(LeaderLinePoints) - 1].X, ACaptionOffset); + APrevValueIndex := VisibleValueIndex; + end; + until APrevValueIndex = 0; +end; + +procedure TcxGridChartPieDiagramValueViewInfo.Calculate(const R: TRect; + AStartAngle, AFinishAngle: Integer); +begin + FStartAngle := AStartAngle; + FFinishAngle := AFinishAngle; + inherited Calculate(R); +end; + +function TcxGridChartPieDiagramValueViewInfo.HasPoint(const P: TPoint): Boolean; +var + APointRadius, APointAngle: Integer; +begin + Result := inherited HasPoint(P); + if Result then + begin + APointRadius := Round(Sqrt(Sqr(P.X - Center.X) + Sqr(P.Y - Center.Y))); + Result := APointRadius <= Radius; + if Result then + begin + APointAngle := 90 + Round(RadToDeg(ArcTan2(P.Y - Center.Y, P.X - Center.X))); + if APointAngle < 0 then Inc(APointAngle, 360); + Result := (StartAngle <= APointAngle) and (APointAngle < FinishAngle); + end; + end; +end; + +{ TcxGridChartPieSeriesSiteCaptionViewInfo } + +constructor TcxGridChartPieSeriesSiteCaptionViewInfo.Create(ASiteViewInfo: TcxGridChartPieSeriesSiteViewInfo); +begin + inherited Create(ASiteViewInfo.GridViewInfo); + FSiteViewInfo := ASiteViewInfo; +end; + +function TcxGridChartPieSeriesSiteCaptionViewInfo.CalculateHeight: Integer; +begin + Result := BorderSize[bTop] + TextHeightWithOffset + BorderSize[bBottom]; +end; + +function TcxGridChartPieSeriesSiteCaptionViewInfo.CustomDraw(ACanvas: TcxCanvas): Boolean; +begin + Result := inherited CustomDraw(ACanvas); + if not Result then + FSiteViewInfo.Diagram.DoCustomDrawSeriesSiteCaption(ACanvas, Self, Result); +end; + +function TcxGridChartPieSeriesSiteCaptionViewInfo.GetAlignmentHorz: TAlignment; +begin + Result := taCenter; +end; + +function TcxGridChartPieSeriesSiteCaptionViewInfo.GetBorderColor(AIndex: TcxBorder): TColor; +begin + Result := FSiteViewInfo.BorderColor[AIndex]; +end; + +function TcxGridChartPieSeriesSiteCaptionViewInfo.GetBorders: TcxBorders; +begin + if FSiteViewInfo.Visible then + Result := [bBottom] + else + Result := []; +end; + +function TcxGridChartPieSeriesSiteCaptionViewInfo.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := FSiteViewInfo.BorderWidth[AIndex]; +end; + +function TcxGridChartPieSeriesSiteCaptionViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridChartPieSeriesSiteCaptionHitTest; +end; + +function TcxGridChartPieSeriesSiteCaptionViewInfo.GetText: string; +begin + Result := FSiteViewInfo.Series.GetDisplayText; +end; + +function TcxGridChartPieSeriesSiteCaptionViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartPieSeriesSiteCaptionPainter; +end; + +procedure TcxGridChartPieSeriesSiteCaptionViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + FSiteViewInfo.Diagram.Styles.GetViewParams(dsSeriesSiteCaptions, nil, nil, AParams); +end; + +function TcxGridChartPieSeriesSiteCaptionViewInfo.GetVisible: Boolean; +begin + Result := FSiteViewInfo.Diagram.SeriesCaptions; +end; + +function TcxGridChartPieSeriesSiteCaptionViewInfo.HasCustomDraw: Boolean; +begin + Result := FSiteViewInfo.Diagram.HasCustomDrawSeriesSiteCaption; +end; + +procedure TcxGridChartPieSeriesSiteCaptionViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + FSiteViewInfo.InitHitTest(AHitTest); + inherited; +end; + +function TcxGridChartPieSeriesSiteCaptionViewInfo.MouseDown(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +begin + Result := inherited MouseDown(AHitTest, AButton, AShift); + if (AButton = mbLeft) and not (ssDouble in AShift) and GridView.IsDesigning then + begin + GridView.Controller.DesignController.SelectObject(FSiteViewInfo.Series, not (ssShift in AShift)); + Result := True; + end; +end; + +{ TcxGridChartPieSeriesSiteViewInfo } + +constructor TcxGridChartPieSeriesSiteViewInfo.Create(ADiagramViewInfo: TcxGridChartPieDiagramViewInfo; + ASeries: TcxGridChartSeries); +begin + inherited Create(ADiagramViewInfo.GridViewInfo); + FDiagramViewInfo := ADiagramViewInfo; + FSeries := ASeries; + FCaptionViewInfo := GetCaptionViewInfoClass.Create(Self); +end; + +destructor TcxGridChartPieSeriesSiteViewInfo.Destroy; +begin + FCaptionViewInfo.Free; + inherited; +end; + +function TcxGridChartPieSeriesSiteViewInfo.GetDiagram: TcxGridChartPieDiagram; +begin + Result := FDiagramViewInfo.Diagram; +end; + +procedure TcxGridChartPieSeriesSiteViewInfo.CalculateAngles; +var + ASumOfValues, AValue: Variant; + AAngleOffset, I: Integer; +begin + ASumOfValues := Series.SumOfValues; + AAngleOffset := Diagram.Values.AngleOfFirstSlice; + SetLength(Angles, Series.VisibleValueCount + 1); + if ASumOfValues <> 0 then + begin + AValue := 0; + for I := 0 to Series.VisibleValueCount - 1 do + begin + Angles[I] := AAngleOffset + Min(Round(360 * AValue / ASumOfValues), 360); + AValue := AValue + Abs(Series.VisibleValues[I]); + end; + Angles[Series.VisibleValueCount] := AAngleOffset + 360; + end; +end; + +procedure TcxGridChartPieSeriesSiteViewInfo.CalculateCaptionAndPieAreaBounds(var ACaptionBounds, APieAreaBounds: TRect); +var + ASize: Integer; +begin + ACaptionBounds := ContentBounds; + if FCaptionViewInfo.Visible and not IsRectEmpty(ACaptionBounds) then + begin + ACaptionBounds.Bottom := ACaptionBounds.Top; + Dec(ACaptionBounds.Top, FCaptionViewInfo.CalculateHeight); + end; + + APieAreaBounds := ContentBounds; + InflateRect(APieAreaBounds, -PieAreaOffset, -PieAreaOffset); + with APieAreaBounds do + begin + ASize := Max(PieMinSize, Min(Right - Left, Bottom - Top) - + 2 * DiagramViewInfo.PieAreaValueCaptionCompensation); + if ASize > Min(ContentWidth, ContentHeight) then + SetRectEmpty(APieAreaBounds) + else + begin + Left := (Left + Right - ASize) div 2; + Right := Left + ASize; + Top := (Top + Bottom - ASize) div 2; + Bottom := Top + ASize; + end; + end; +end; + +function TcxGridChartPieSeriesSiteViewInfo.CalculateContentBounds: TRect; +begin + Result := inherited CalculateContentBounds; + if FCaptionViewInfo.Visible then + Inc(Result.Top, FCaptionViewInfo.CalculateHeight); + if IsRectEmpty(Result) then SetRectEmpty(Result); // for negative values +end; + +function TcxGridChartPieSeriesSiteViewInfo.CustomDraw(ACanvas: TcxCanvas): Boolean; +begin + Result := inherited CustomDraw(ACanvas); + if not Result then + Diagram.DoCustomDrawSeriesSite(ACanvas, Self, Result); +end; + +function TcxGridChartPieSeriesSiteViewInfo.GetBorderColor(AIndex: TcxBorder): TColor; +begin + Result := Params.TextColor; +end; + +function TcxGridChartPieSeriesSiteViewInfo.GetBorders: TcxBorders; +begin + Result := cxBordersAll; +end; + +function TcxGridChartPieSeriesSiteViewInfo.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := 1; +end; + +function TcxGridChartPieSeriesSiteViewInfo.GetCaptionViewInfoClass: TcxGridChartPieSeriesSiteCaptionViewInfoClass; +begin + Result := TcxGridChartPieSeriesSiteCaptionViewInfo; +end; + +function TcxGridChartPieSeriesSiteViewInfo.GetDesignSelectionBounds: TRect; +begin + Result := ClientBounds; +end; + +function TcxGridChartPieSeriesSiteViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridChartPieSeriesSiteHitTest; +end; + +function TcxGridChartPieSeriesSiteViewInfo.GetIsDesignSelected: Boolean; +begin + Result := GridView.IsDesigning and + GridView.Controller.DesignController.IsObjectSelected(Series); +end; + +function TcxGridChartPieSeriesSiteViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartPieSeriesSitePainter; +end; + +function TcxGridChartPieSeriesSiteViewInfo.GetValueViewInfo(AVisibleValueIndex: Integer): TcxGridChartPieDiagramValueViewInfo; +begin + Result := FDiagramViewInfo.GetValueViewInfo(FSeries.VisibleIndex, AVisibleValueIndex) as TcxGridChartPieDiagramValueViewInfo; +end; + +procedure TcxGridChartPieSeriesSiteViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + Diagram.Styles.GetViewParams(dsSeriesSites, nil, nil, AParams); +end; + +function TcxGridChartPieSeriesSiteViewInfo.GetVisible: Boolean; +begin + Result := Diagram.SeriesSites; +end; + +function TcxGridChartPieSeriesSiteViewInfo.HasCustomDraw: Boolean; +begin + Result := Diagram.HasCustomDrawSeriesSite; +end; + +procedure TcxGridChartPieSeriesSiteViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + FDiagramViewInfo.InitHitTest(AHitTest); + inherited; + (AHitTest as TcxGridChartPieSeriesSiteHitTest).Series := Series; +end; + +procedure TcxGridChartPieSeriesSiteViewInfo.Calculate(const ABounds: TRect); +var + I: Integer; +begin + inherited; + CalculateCaptionAndPieAreaBounds(FCaptionBounds, FPieAreaBounds); + if FCaptionViewInfo.Visible then + FCaptionViewInfo.Calculate(CaptionBounds); + CalculateAngles; + for I := 0 to DiagramViewInfo.VisibleValueCount - 1 do + GetValueViewInfo(I).Calculate(PieAreaBounds, Angles[I], Angles[I + 1]); +end; + +function TcxGridChartPieSeriesSiteViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + Result := FCaptionViewInfo.GetHitTest(P); + if Result = nil then + Result := inherited GetHitTest(P); +end; + +function TcxGridChartPieSeriesSiteViewInfo.IsPieEmpty: Boolean; +begin + Result := (Angles = nil) or (Angles[Length(Angles) - 1] = 0); +end; + +function TcxGridChartPieSeriesSiteViewInfo.MouseDown(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +begin + Result := inherited MouseDown(AHitTest, AButton, AShift); + if (AButton = mbLeft) and not (ssDouble in AShift) and GridView.IsDesigning then + begin + GridView.Controller.DesignController.SelectObject(Series, not (ssShift in AShift)); + Result := True; + end; +end; + +procedure TcxGridChartPieSeriesSiteViewInfo.Paint(ACanvas: TcxCanvas = nil); +begin + FCaptionViewInfo.Paint(ACanvas); + inherited; +end; + +{ TcxGridChartPieDiagramViewInfo } + +constructor TcxGridChartPieDiagramViewInfo.Create(AGridViewInfo: TcxCustomGridViewInfo; + ADiagram: TcxGridChartDiagram); +var + I: Integer; +begin + inherited; + FSeriesSiteViewInfos := TList.Create; + for I := 0 to SeriesCount - 1 do + FSeriesSiteViewInfos.Add(GetSeriesSiteViewInfoClass.Create(Self, Series[I])); +end; + +destructor TcxGridChartPieDiagramViewInfo.Destroy; +var + I: Integer; +begin + for I := 0 to SeriesSiteViewInfoCount - 1 do + SeriesSiteViewInfos[I].Free; + FSeriesSiteViewInfos.Free; + inherited; +end; + +function TcxGridChartPieDiagramViewInfo.GetCaptionPosition: TcxGridChartPieDiagramValueCaptionPosition; +begin + Result := Diagram.Values.GetCaptionPosition; +end; + +function TcxGridChartPieDiagramViewInfo.GetDiagram: TcxGridChartPieDiagram; +begin + Result := TcxGridChartPieDiagram(inherited Diagram); +end; + +function TcxGridChartPieDiagramViewInfo.GetSeriesSiteViewInfo(Index: Integer): TcxGridChartPieSeriesSiteViewInfo; +begin + Result := TcxGridChartPieSeriesSiteViewInfo(FSeriesSiteViewInfos[Index]); +end; + +function TcxGridChartPieDiagramViewInfo.GetSeriesSiteViewInfoCount: Integer; +begin + Result := FSeriesSiteViewInfos.Count; +end; + +function TcxGridChartPieDiagramViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartPieDiagramPainter; +end; + +function TcxGridChartPieDiagramViewInfo.GetSeriesSiteViewInfoClass: TcxGridChartPieSeriesSiteViewInfoClass; +begin + Result := TcxGridChartPieSeriesSiteViewInfo; +end; + +class function TcxGridChartPieDiagramViewInfo.GetValueViewInfoClass: TcxGridChartDiagramValueViewInfoClass; +begin + Result := TcxGridChartPieDiagramValueViewInfo; +end; + +function TcxGridChartPieDiagramViewInfo.GetValueViewInfoIndex(ASeriesIndex, AVisibleIndex: Integer): Integer; +begin + Result := ASeriesIndex * VisibleValueCount + AVisibleIndex; +end; + +function TcxGridChartPieDiagramViewInfo.CalculatePieAreaValueCaptionCompensation: Integer; +begin + case CaptionPosition of + pdvcpOutsideEnd: + Result := PieValueCaptionOffset + CalculateValueCaptionMaxHeight div 2 + + CalculateValueCaptionMaxWidth; + pdvcpOutsideEndWithLeaderLines: + Result := PieLeaderLineSegment1 + PieLeaderLineSegment2 + CalculateValueCaptionMaxWidth; + else + Result := 0; + end; +end; + +function TcxGridChartPieDiagramViewInfo.CalculateSeriesSiteViewInfoBounds(AIndex: Integer): TRect; +var + AColumnCount, ARowCount, ASiteWidth, ASiteHeight: Integer; +begin + AColumnCount := Diagram.GetSeriesColumnCount; + ARowCount := RoundDiv(SeriesSiteViewInfoCount, AColumnCount); + + ASiteWidth := (Bounds.Right - Bounds.Left - (AColumnCount - 1) * PieSeriesSiteOffset) div AColumnCount; + ASiteHeight := (Bounds.Bottom - Bounds.Top - (ARowCount - 1) * PieSeriesSiteOffset) div ARowCount; + + Result := Bounds; + Inc(Result.Left, AIndex mod AColumnCount * (ASiteWidth + PieSeriesSiteOffset)); + Result.Right := Result.Left + ASiteWidth; + Inc(Result.Top, AIndex div AColumnCount * (ASiteHeight + PieSeriesSiteOffset)); + Result.Bottom := Result.Top + ASiteHeight; +end; + +function TcxGridChartPieDiagramViewInfo.CalculateValueCaptionMaxWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to ValueViewInfoCount - 1 do + Result := Max(Result, ValueViewInfos[I].CaptionViewInfo.CalculateWidth); +end; + +function TcxGridChartPieDiagramViewInfo.CalculateValueCaptionMaxHeight: Integer; +begin + if ValueViewInfoCount = 0 then + Result := 0 + else + Result := ValueViewInfos[0].CaptionViewInfo.CalculateHeight; +end; + +procedure TcxGridChartPieDiagramViewInfo.Calculate(const ABounds: TRect); +var + I, J: Integer; +begin + inherited; + for I := 0 to SeriesCount - 1 do + for J := 0 to VisibleValueCount - 1 do + CreateValueViewInfo(I, J); + FPieAreaValueCaptionCompensation := CalculatePieAreaValueCaptionCompensation; + for I := 0 to SeriesSiteViewInfoCount - 1 do + SeriesSiteViewInfos[I].Calculate(CalculateSeriesSiteViewInfoBounds(I)); +end; + +function TcxGridChartPieDiagramViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +var + I: Integer; +begin + Result := inherited GetHitTest(P); + if Result = nil then + for I := 0 to SeriesSiteViewInfoCount - 1 do + begin + Result := SeriesSiteViewInfos[I].GetHitTest(P); + if Result <> nil then Break; + end; +end; + +{ TcxGridChartToolBoxItemViewInfo } + +constructor TcxGridChartToolBoxItemViewInfo.Create(AContainer: TcxGridChartToolBoxViewInfo; + AAlignment: TcxGridChartToolBoxItemAlignment); +begin + inherited Create(AContainer.GridViewInfo); + FContainer := AContainer; + FAlignment := AAlignment; +end; + +function TcxGridChartToolBoxItemViewInfo.GetGridView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +procedure TcxGridChartToolBoxItemViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + FContainer.GetViewParams(AParams); +end; + +{ TcxGridChartToolBoxItemSeparatorViewInfo } + +function TcxGridChartToolBoxItemSeparatorViewInfo.CalculateHeight: Integer; +begin + Result := 0; +end; + +function TcxGridChartToolBoxItemSeparatorViewInfo.CalculateWidth: Integer; +begin + Result := ToolBoxItemSeparatorWidth; +end; + +function TcxGridChartToolBoxItemSeparatorViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := nil; +end; + +function TcxGridChartToolBoxItemSeparatorViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartToolBoxItemSeparatorPainter; +end; + +procedure TcxGridChartToolBoxItemSeparatorViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + AParams.Color := LookAndFeelPainter.DefaultChartToolBoxItemSeparatorColor; +end; + +function TcxGridChartToolBoxItemSeparatorViewInfo.HasBackground: Boolean; +begin + Result := False; +end; + +{ TcxGridChartToolBoxDataLevelActiveValueViewInfo } + +constructor TcxGridChartToolBoxDataLevelActiveValueViewInfo.Create(AContainer: TcxGridChartToolBoxDataLevelInfoViewInfo); +begin + inherited Create(AContainer.GridViewInfo); + FContainer := AContainer; + FCanShowDropDownWindow := GridView.Controller.CanShowDataLevelActiveValuePopup; +end; + +function TcxGridChartToolBoxDataLevelActiveValueViewInfo.GetGridView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +function TcxGridChartToolBoxDataLevelActiveValueViewInfo.GetDataGroup: TcxGridChartDataGroup; +begin + Result := FContainer.DataLevelObject; +end; + +function TcxGridChartToolBoxDataLevelActiveValueViewInfo.CalculateContentBounds: TRect; +begin + Result := inherited CalculateContentBounds; + InflateRect(Result, -cxTextOffset, 0); +end; + +function TcxGridChartToolBoxDataLevelActiveValueViewInfo.CalculateHeight: Integer; +begin + Result := TextHeightWithOffset; +end; + +function TcxGridChartToolBoxDataLevelActiveValueViewInfo.CalculateWidth: Integer; +begin + Result := BorderSize[bLeft] + 2 * cxTextOffset + TextWidthWithOffset; +end; + +function TcxGridChartToolBoxDataLevelActiveValueViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + Result := vaCenter; +end; + +function TcxGridChartToolBoxDataLevelActiveValueViewInfo.GetBorderColor(AIndex: TcxBorder): TColor; +begin + Result := FContainer.BorderColor[AIndex]; +end; + +function TcxGridChartToolBoxDataLevelActiveValueViewInfo.GetBorders: TcxBorders; +begin + Result := [bLeft]; +end; + +function TcxGridChartToolBoxDataLevelActiveValueViewInfo.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := FContainer.BorderWidth[AIndex]; +end; + +function TcxGridChartToolBoxDataLevelActiveValueViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridChartDataLevelActiveValueInfoHitTest; +end; + +function TcxGridChartToolBoxDataLevelActiveValueViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartToolBoxDataLevelActiveValuePainter; +end; + +function TcxGridChartToolBoxDataLevelActiveValueViewInfo.GetText: string; +begin + if FContainer.DataLevelObject.HasActiveValue then + Result := FContainer.DataLevelObject.ActiveValueDisplayText + else + Result := cxGetResourceString(@scxGridChartToolBoxDataLevelSelectValue); +end; + +procedure TcxGridChartToolBoxDataLevelActiveValueViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetViewParams(vsDataLevelActiveValueInfo, nil, nil, AParams); +end; + +procedure TcxGridChartToolBoxDataLevelActiveValueViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + FContainer.InitHitTest(AHitTest); + inherited; + TcxGridChartDataLevelActiveValueInfoHitTest(AHitTest).CanDropDown := CanShowDropDownWindow; +end; + +function TcxGridChartToolBoxDataLevelActiveValueViewInfo.DropDownWindowExists: Boolean; +begin + Result := CanShowDropDownWindow and GridView.Controller.HasDataLevelActiveValuePopup; +end; + +function TcxGridChartToolBoxDataLevelActiveValueViewInfo.GetDropDownWindow: TcxCustomGridPopup; +begin + if CanShowDropDownWindow then + Result := GridView.Controller.DataLevelActiveValuePopup + else + Result := nil; +end; + +function TcxGridChartToolBoxDataLevelActiveValueViewInfo.GetDropDownWindowOwnerBounds: TRect; +begin + Result := FContainer.Bounds; + Result.Left := Bounds.Left; +end; + +{ TcxGridChartToolBoxDataLevelInfoViewInfo } + +constructor TcxGridChartToolBoxDataLevelInfoViewInfo.Create(AContainer: TcxGridChartToolBoxViewInfo; + AAlignment: TcxGridChartToolBoxItemAlignment; ADataLevel: Integer); +begin + inherited Create(AContainer, AAlignment); + FDataLevel := ADataLevel; + if HasActiveValue then + FActiveValueViewInfo := GetActiveValueViewInfoClass.Create(Self); +end; + +destructor TcxGridChartToolBoxDataLevelInfoViewInfo.Destroy; +begin + FActiveValueViewInfo.Free; + inherited; +end; + +function TcxGridChartToolBoxDataLevelInfoViewInfo.GetActive: Boolean; +begin + Result := GridView.ActiveDataLevel = FDataLevel; +end; + +function TcxGridChartToolBoxDataLevelInfoViewInfo.GetDataLevelObject: TcxGridChartDataGroup; +begin + Result := GridView.DataLevelObjects[FDataLevel]; +end; + +function TcxGridChartToolBoxDataLevelInfoViewInfo.CalculateActiveValueViewInfoBounds: TRect; +begin + Result := ClientBounds; + Result.Left := Result.Right - FActiveValueViewInfo.CalculateWidth; +end; + +function TcxGridChartToolBoxDataLevelInfoViewInfo.CalculateContentBounds: TRect; +begin + Result := inherited CalculateContentBounds; + if FActiveValueViewInfo <> nil then + Dec(Result.Right, FActiveValueViewInfo.CalculateWidth); +end; + +function TcxGridChartToolBoxDataLevelInfoViewInfo.CalculateHeight: Integer; +begin + Result := TextHeightWithOffset; + if FActiveValueViewInfo <> nil then + Result := Max(Result, FActiveValueViewInfo.CalculateHeight); + Inc(Result, BorderSize[bTop] + BorderSize[bBottom]); +end; + +function TcxGridChartToolBoxDataLevelInfoViewInfo.CalculateWidth: Integer; +begin + Result := BorderSize[bLeft] + 2 * cxTextOffset + TextWidthWithOffset + BorderSize[bRight]; + if FActiveValueViewInfo <> nil then + Inc(Result, FActiveValueViewInfo.CalculateWidth); +end; + +function TcxGridChartToolBoxDataLevelInfoViewInfo.GetActiveValueViewInfoClass: TcxGridChartToolBoxDataLevelActiveValueViewInfoClass; +begin + Result := TcxGridChartToolBoxDataLevelActiveValueViewInfo; +end; + +function TcxGridChartToolBoxDataLevelInfoViewInfo.GetAlignmentHorz: TAlignment; +begin + Result := taCenter; +end; + +function TcxGridChartToolBoxDataLevelInfoViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + Result := vaCenter; +end; + +function TcxGridChartToolBoxDataLevelInfoViewInfo.GetBorderColor(AIndex: TcxBorder): TColor; +begin + Result := LookAndFeelPainter.DefaultChartToolBoxDataLevelInfoBorderColor; +end; + +function TcxGridChartToolBoxDataLevelInfoViewInfo.GetBorders: TcxBorders; +begin + Result := cxBordersAll; +end; + +function TcxGridChartToolBoxDataLevelInfoViewInfo.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := LookAndFeelPainter.ChartToolBoxDataLevelInfoBorderSize; +end; + +function TcxGridChartToolBoxDataLevelInfoViewInfo.GetDesignObject: TPersistent; +begin + if DataLevelObject = nil then + Result := GridView.Categories + else + Result := DataLevelObject; +end; + +function TcxGridChartToolBoxDataLevelInfoViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridChartDataLevelInfoHitTest; +end; + +function TcxGridChartToolBoxDataLevelInfoViewInfo.GetIsDesignSelected: Boolean; +begin + Result := GridView.IsDesigning and + GridView.Controller.DesignController.IsObjectSelected(GetDesignObject); +end; + +function TcxGridChartToolBoxDataLevelInfoViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartToolBoxDataLevelInfoPainter; +end; + +function TcxGridChartToolBoxDataLevelInfoViewInfo.GetText: string; +begin + if DataLevelObject = nil then + Result := GridView.Categories.GetDisplayText + else + Result := DataLevelObject.GetDisplayText; +end; + +procedure TcxGridChartToolBoxDataLevelInfoViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetDataLevelInfoParams(DataLevel, AParams); +end; + +function TcxGridChartToolBoxDataLevelInfoViewInfo.HasActiveValue: Boolean; +begin + Result := DataLevelObject <> nil; + if Result then + if GridView.Controller.MayDataDrillDown(False) then + Result := GridView.CanActivateDataLevel(DataLevel) + else + Result := DataLevelObject.HasActiveValue; +end; + +procedure TcxGridChartToolBoxDataLevelInfoViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + inherited; + with TcxGridChartDataLevelInfoHitTest(AHitTest) do + begin + DataLevel := Self.DataLevel; + DataLevelObjectContainerKind := ckToolBox; + end; +end; + +procedure TcxGridChartToolBoxDataLevelInfoViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + inherited; + if FActiveValueViewInfo <> nil then + FActiveValueViewInfo.Calculate(CalculateActiveValueViewInfoBounds); +end; + +function TcxGridChartToolBoxDataLevelInfoViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +var + AHitTest: TcxCustomGridHitTest; +begin + Result := inherited GetHitTest(P); + if (Result <> nil) and not GridView.IsDesigning and (FActiveValueViewInfo <> nil) then + begin + AHitTest := FActiveValueViewInfo.GetHitTest(P); + if AHitTest <> nil then Result := AHitTest; + end; +end; + +function TcxGridChartToolBoxDataLevelInfoViewInfo.MouseDown(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +begin + Result := inherited MouseDown(AHitTest, AButton, AShift); + if (AButton = mbLeft) and not (ssDouble in AShift) then + if GridView.IsDesigning then + begin + GridView.Controller.DesignController.SelectObject(GetDesignObject, not (ssShift in AShift)); + Result := True; + end + else + if GridView.Controller.MayDataDrillDown then + GridView.ActiveDataLevel := DataLevel; +end; + +procedure TcxGridChartToolBoxDataLevelInfoViewInfo.Paint(ACanvas: TcxCanvas); +begin + if FActiveValueViewInfo <> nil then + FActiveValueViewInfo.Paint(ACanvas); + inherited; +end; + +{ TcxGridChartToolBoxCustomizeButtonViewInfo } + +function TcxGridChartToolBoxCustomizeButtonViewInfo.GetChecked: Boolean; +begin + Result := GridView.Controller.Customization; +end; + +procedure TcxGridChartToolBoxCustomizeButtonViewInfo.SetChecked(Value: Boolean); +begin + GridView.Controller.Customization := Value; +end; + +function TcxGridChartToolBoxCustomizeButtonViewInfo.CalculateHeight: Integer; +begin + Result := BorderWidth[bTop] + 2 * LookAndFeelPainter.ButtonTextOffset + + TextHeightWithOffset + BorderWidth[bBottom]; +end; + +function TcxGridChartToolBoxCustomizeButtonViewInfo.CalculateWidth: Integer; +begin + Result := BorderWidth[bLeft] + 2 * LookAndFeelPainter.ButtonTextOffset + + TextWidthWithOffset + BorderWidth[bRight]; +end; + +function TcxGridChartToolBoxCustomizeButtonViewInfo.CaptureMouseOnPress: Boolean; +begin + Result := True; +end; + +procedure TcxGridChartToolBoxCustomizeButtonViewInfo.Click; +begin + inherited; + Checked := not Checked; +end; + +function TcxGridChartToolBoxCustomizeButtonViewInfo.GetActualState: TcxGridCellState; +begin + if Checked then + Result := gcsPressed + else + Result := inherited GetActualState; +end; + +function TcxGridChartToolBoxCustomizeButtonViewInfo.GetBorders: TcxBorders; +begin + Result := cxBordersAll; +end; + +function TcxGridChartToolBoxCustomizeButtonViewInfo.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := LookAndFeelPainter.ButtonBorderSize; +end; + +function TcxGridChartToolBoxCustomizeButtonViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridChartCustomizeButtonHitTest; +end; + +function TcxGridChartToolBoxCustomizeButtonViewInfo.GetHotTrack: Boolean; +begin + Result := True; +end; + +function TcxGridChartToolBoxCustomizeButtonViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartToolBoxCustomizeButtonPainter; +end; + +function TcxGridChartToolBoxCustomizeButtonViewInfo.GetText: string; +begin + Result := cxGetResourceString(@scxGridChartToolBoxCustomizeButtonCaption); +end; + +function TcxGridChartToolBoxCustomizeButtonViewInfo.HasBackground: Boolean; +begin + Result := False; +end; + +{ TcxGridChartToolBoxDiagramSelectorViewInfo } + +constructor TcxGridChartToolBoxDiagramSelectorViewInfo.Create(AContainer: TcxGridChartToolBoxViewInfo; + AAlignment: TcxGridChartToolBoxItemAlignment); +begin + inherited; + FCanShowDropDownWindow := CalculateCanShowDropDownWindow; +end; + +function TcxGridChartToolBoxDiagramSelectorViewInfo.GetDropDownWindowValue: TcxGridChartDiagramSelectorPopup; +begin + Result := TcxGridChartDiagramSelectorPopup(inherited DropDownWindow); +end; + +function TcxGridChartToolBoxDiagramSelectorViewInfo.CalculateHeight: Integer; +begin + Result := Max(ImageHeight, TextHeightWithOffset); +end; + +function TcxGridChartToolBoxDiagramSelectorViewInfo.CalculateWidth: Integer; +begin + Result := ImageWidth + ToolBoxDiagramImageOffset + TextWidthWithOffset; +end; + +function TcxGridChartToolBoxDiagramSelectorViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + Result := vaCenter; +end; + +function TcxGridChartToolBoxDiagramSelectorViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridChartDiagramSelectorHitTest; +end; + +function TcxGridChartToolBoxDiagramSelectorViewInfo.GetImageBounds: TRect; +begin + Result := ContentBounds; + Result.Right := Result.Left + ImageWidth; + AlignRect(Result, 0, ImageHeight, False, cpaCenter); +end; + +function TcxGridChartToolBoxDiagramSelectorViewInfo.GetImageHeight: Integer; +begin + Result := cxGridChartDiagramImages.Height; +end; + +function TcxGridChartToolBoxDiagramSelectorViewInfo.GetImageIndex: Integer; +begin + if GridView.ActiveDiagram = nil then + Result := -1 + else + Result := GridView.ActiveDiagram.ImageIndex; +end; + +function TcxGridChartToolBoxDiagramSelectorViewInfo.GetImageWidth: Integer; +begin + Result := cxGridChartDiagramImages.Width; +end; + +function TcxGridChartToolBoxDiagramSelectorViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartToolBoxDiagramSelectorPainter; +end; + +function TcxGridChartToolBoxDiagramSelectorViewInfo.GetText: string; +begin + if GridView.ActiveDiagram = nil then + Result := cxGetResourceString(@scxGridChartNoneDiagramDisplayText) + else + Result := GridView.ActiveDiagram.DisplayText; +end; + +function TcxGridChartToolBoxDiagramSelectorViewInfo.GetTextAreaBounds: TRect; +begin + Result := inherited GetTextAreaBounds; + Inc(Result.Left, ImageWidth + ToolBoxDiagramImageOffset); +end; + +procedure TcxGridChartToolBoxDiagramSelectorViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetViewParams(vsDiagramSelector, nil, nil, AParams); +end; + +function TcxGridChartToolBoxDiagramSelectorViewInfo.HasBackground: Boolean; +begin + Result := False; +end; + +procedure TcxGridChartToolBoxDiagramSelectorViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + inherited; + TcxGridChartDiagramSelectorHitTest(AHitTest).CanDropDown := CanShowDropDownWindow; +end; + +function TcxGridChartToolBoxDiagramSelectorViewInfo.CalculateCanShowDropDownWindow: Boolean; +begin + Result := GridView.AvailableDiagramCount > 1; +end; + +function TcxGridChartToolBoxDiagramSelectorViewInfo.DropDownWindowExists: Boolean; +begin + Result := CanShowDropDownWindow and GridView.Controller.HasDiagramSelectorPopup; +end; + +function TcxGridChartToolBoxDiagramSelectorViewInfo.GetDropDownWindow: TcxCustomGridPopup; +begin + if CanShowDropDownWindow then + Result := GridView.Controller.DiagramSelectorPopup + else + Result := nil; +end; + +function TcxGridChartToolBoxDiagramSelectorViewInfo.GetDropDownWindowOwnerBounds: TRect; +begin + Result := Bounds; + Dec(Result.Left, DropDownWindow.BorderWidths[bLeft] + DropDownWindow.ImageOffset); +end; + +{ TcxGridChartToolBoxViewInfo } + +constructor TcxGridChartToolBoxViewInfo.Create(AGridViewInfo: TcxCustomGridViewInfo); +begin + inherited; + FDataLevelInfos := TList.Create; + FItems := TList.Create; + CreateItems; +end; + +destructor TcxGridChartToolBoxViewInfo.Destroy; +var + I: Integer; +begin + for I := 0 to Count - 1 do Items[I].Free; + FItems.Free; + FDataLevelInfos.Free; + inherited; +end; + +function TcxGridChartToolBoxViewInfo.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxGridChartToolBoxViewInfo.GetDataLevelInfoConnectorCount: Integer; +begin + Result := DataLevelInfoCount - 1; +end; + +function TcxGridChartToolBoxViewInfo.GetDataLevelInfo(AIndex: Integer): TcxGridChartToolBoxDataLevelInfoViewInfo; +begin + Result := TcxGridChartToolBoxDataLevelInfoViewInfo(FDataLevelInfos[AIndex]); +end; + +function TcxGridChartToolBoxViewInfo.GetDataLevelInfoCount: Integer; +begin + Result := FDataLevelInfos.Count; +end; + +function TcxGridChartToolBoxViewInfo.GetItem(AIndex: Integer): TcxGridChartToolBoxItemViewInfo; +begin + Result := TcxGridChartToolBoxItemViewInfo(FItems[AIndex]); +end; + +function TcxGridChartToolBoxViewInfo.CalculateHeight: Integer; +var + I: Integer; +begin + CalculateParams; + Result := 0; + for I := 0 to Count - 1 do + Result := Max(Result, Items[I].CalculateHeight); + Inc(Result, BorderSize[bTop] + 2 * ToolBoxItemOffset + BorderSize[bBottom]); +end; + +function TcxGridChartToolBoxViewInfo.CalculateWidth: Integer; +begin + Result := 0; +end; + +function TcxGridChartToolBoxViewInfo.CalculateContentBounds: TRect; +begin + Result := inherited CalculateContentBounds; + InflateRect(Result, -ToolBoxItemOffset, -ToolBoxItemOffset); +end; + +procedure TcxGridChartToolBoxViewInfo.CalculateItems; + + function GetItemBounds(AItem: TcxGridChartToolBoxItemViewInfo; var ARestSpace: TRect): TRect; + begin + PositionRect(Result, ARestSpace, AItem.CalculateWidth, 0, ToolBoxItemOffset, + AItem.Alignment); + if IsSeparator(AItem) then + begin + Result.Top := ClientBounds.Top; + Result.Bottom := ClientBounds.Bottom; + end + else + AlignRect(Result, 0, AItem.CalculateHeight, False, cpaCenter); + end; + +var + ARestSpace, R: TRect; + I, J, ARestWidth, AOffset: Integer; + AItem: TcxGridChartToolBoxItemViewInfo; +begin + ARestSpace := ItemsAreaBounds; + for I := 0 to Count - 1 do + begin + AItem := Items[I]; + if AItem.Alignment = cppLeft then + AItem.Calculate(GetItemBounds(AItem, ARestSpace)); + end; + for I := Count - 1 downto 0 do + begin + AItem := Items[I]; + if AItem.Alignment = cppRight then + begin + R := GetItemBounds(AItem, ARestSpace); + ARestWidth := ARestSpace.Right - ARestSpace.Left + ToolBoxItemOffset; + if ARestWidth < 0 then + begin + AOffset := -ARestWidth; + Inc(ARestSpace.Right, AOffset); + OffsetRect(R, AOffset, 0); + for J := I + 1 to Count - 1 do + if Items[J].Alignment = cppRight then + Items[J].Offset(AOffset, 0); + end; + AItem.Calculate(R); + end; + end; +end; + +function TcxGridChartToolBoxViewInfo.GetAlignment: TcxGridChartPartAlignment; +begin + Result := cpaDefault; +end; + +function TcxGridChartToolBoxViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + Result := vaCenter; +end; + +function TcxGridChartToolBoxViewInfo.GetBorderColor(AIndex: TcxBorder): TColor; +begin + Result := Params.TextColor; +end; + +function TcxGridChartToolBoxViewInfo.GetBorders: TcxBorders; +begin + if GridView.ToolBox.Border = tbSingle then + Result := cxBordersAll + else + Result := []; +end; + +function TcxGridChartToolBoxViewInfo.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := 1; +end; + +function TcxGridChartToolBoxViewInfo.GetDataGroupInsertionAreaBounds: TRect; +begin + Result := ClientBounds; + if GetFirstSeparator <> nil then + Result.Right := GetFirstSeparator.Bounds.Left; +end; + +function TcxGridChartToolBoxViewInfo.GetDataLevelInfoConnector(AIndex: Integer): TRect; +begin + Result := DataLevelInfos[AIndex].Bounds; + Result.Left := Result.Right; + Result.Right := DataLevelInfos[AIndex + 1].Bounds.Left; + Result.Top := (Result.Top + Result.Bottom - ToolBoxDataLevelInfoConnectorWidth) div 2; + Result.Bottom := Result.Top + ToolBoxDataLevelInfoConnectorWidth; +end; + +function TcxGridChartToolBoxViewInfo.GetDataLevelInfoConnectorColor: TColor; +begin + Result := LookAndFeelPainter.DefaultChartToolBoxDataLevelInfoBorderColor; +end; + +function TcxGridChartToolBoxViewInfo.GetFirstSeparator: TcxGridChartToolBoxItemViewInfo; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I]; + if IsSeparator(Result) then Exit; + end; + Result := nil; +end; + +function TcxGridChartToolBoxViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridChartToolBoxHitTest; +end; + +function TcxGridChartToolBoxViewInfo.GetItemsAreaBounds: TRect; +begin + Result := ContentBounds; + if Text <> '' then + Inc(Result.Left, TextWidthWithOffset + ToolBoxItemOffset); +end; + +function TcxGridChartToolBoxViewInfo.GetOrientation: TcxGridChartPartOrientation; +begin + Result := cpoHorizontal; +end; + +function TcxGridChartToolBoxViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridChartToolBoxPainter; +end; + +function TcxGridChartToolBoxViewInfo.GetPosition: TcxGridChartPartPosition; +begin + if GridView.ToolBox.Position = tpTop then + Result := cppTop + else + Result := cppBottom; +end; + +function TcxGridChartToolBoxViewInfo.GetText: string; +begin + if IsDataLevelsInfoVisible then + Result := cxGetResourceString(@scxGridChartToolBoxDataLevels) + else + Result := ''; +end; + +procedure TcxGridChartToolBoxViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetViewParams(vsToolBox, nil, nil, AParams); +end; + +function TcxGridChartToolBoxViewInfo.GetVisible: Boolean; +begin + Result := GridView.ToolBox.GetVisible; +end; + +function TcxGridChartToolBoxViewInfo.AddItem(AItem: TcxGridChartToolBoxItemViewInfo): TcxGridChartToolBoxItemViewInfo; +begin + Result := AItem; + FItems.Add(AItem); +end; + +procedure TcxGridChartToolBoxViewInfo.AddSeparator(AAlignment: TcxGridChartToolBoxItemAlignment); +begin + if Count <> 0 then + AddItem(GetItemSeparatorClass.Create(Self, AAlignment)); +end; + +procedure TcxGridChartToolBoxViewInfo.CreateItems; +var + I: Integer; +begin + if IsDataLevelsInfoVisible then + for I := 0 to GridView.DataLevelCount - 1 do + FDataLevelInfos.Add(AddItem(GetDataLevelInfoClass.Create(Self, cppLeft, I))); + if IsCustomizeButtonVisible then + begin + AddSeparator(cppRight); + FCustomizeButton := GetCustomizeButtonClass.Create(Self, cppRight); + AddItem(FCustomizeButton); + end; + if IsDiagramSelectorVisible then + begin + AddSeparator(cppRight); + FDiagramSelector := GetDiagramSelectorClass.Create(Self, cppRight); + AddItem(FDiagramSelector); + end; +end; + +function TcxGridChartToolBoxViewInfo.GetCustomizeButtonClass: TcxGridChartToolBoxCustomizeButtonViewInfoClass; +begin + Result := TcxGridChartToolBoxCustomizeButtonViewInfo; +end; + +function TcxGridChartToolBoxViewInfo.GetDataLevelInfoClass: TcxGridChartToolBoxDataLevelInfoViewInfoClass; +begin + Result := TcxGridChartToolBoxDataLevelInfoViewInfo; +end; + +function TcxGridChartToolBoxViewInfo.GetDiagramSelectorClass: TcxGridChartToolBoxDiagramSelectorViewInfoClass; +begin + Result := TcxGridChartToolBoxDiagramSelectorViewInfo; +end; + +function TcxGridChartToolBoxViewInfo.GetItemSeparatorClass: TcxGridChartToolBoxItemSeparatorViewInfoClass; +begin + Result := TcxGridChartToolBoxItemSeparatorViewInfo; +end; + +function TcxGridChartToolBoxViewInfo.IsCustomizeButtonVisible: Boolean; +begin + Result := not GridViewInfo.IsImage and GridView.ToolBox.CustomizeButton; +end; + +function TcxGridChartToolBoxViewInfo.IsDataLevelsInfoVisible: Boolean; +begin + Result := GridView.ToolBox.GetDataLevelsInfoVisible; +end; + +function TcxGridChartToolBoxViewInfo.IsDiagramSelectorVisible: Boolean; +begin + Result := not GridViewInfo.IsImage and GridView.ToolBox.DiagramSelector; +end; + +function TcxGridChartToolBoxViewInfo.IsSeparator(AItem: TcxGridChartToolBoxItemViewInfo): Boolean; +begin + Result := AItem is GetItemSeparatorClass; +end; + +procedure TcxGridChartToolBoxViewInfo.Calculate(ALeftBound, ATopBound, AWidth, + AHeight: Integer); +begin + inherited; + CalculateItems; +end; + +function TcxGridChartToolBoxViewInfo.GetDataGroupInsertionBounds(AIndex: Integer): TRect; +begin + if DataLevelInfoCount = 0 then + Result := ItemsAreaBounds + else + begin + Result := DataLevelInfos[AIndex].Bounds; + Dec(Result.Left, MulDiv(ToolBoxItemOffset, 1, 2)); + end; +end; + +function TcxGridChartToolBoxViewInfo.GetDataGroupInsertionIndex(const P: TPoint): Integer; +var + R: TRect; +begin + Result := -1; + if not PtInRect(GetDataGroupInsertionAreaBounds, P) then Exit; + for Result := 0 to DataLevelInfoCount - 1 do + if DataLevelInfos[Result].DataLevelObject <> nil then + begin + R := DataLevelInfos[Result].Bounds; + if P.X < GetRangeCenter(R.Left, R.Right) then Exit; + end; + Result := GridView.VisibleDataGroupCount; +end; + +function TcxGridChartToolBoxViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +var + I: Integer; + AHitTest: TcxCustomGridHitTest; +begin + Result := inherited GetHitTest(P); + if Result <> nil then + for I := 0 to Count - 1 do + begin + AHitTest := Items[I].GetHitTest(P); + if AHitTest <> nil then + begin + Result := AHitTest; + Break; + end; + end; +end; + +procedure TcxGridChartToolBoxViewInfo.InvalidateCustomizeButton; +begin + if CustomizeButton <> nil then + CustomizeButton.Invalidate; +end; + +{ TcxGridChartTitleViewInfo } + +function TcxGridChartTitleViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridChartTitleHitTest; +end; + +procedure TcxGridChartTitleViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetViewParams(vsTitle, nil, nil, AParams); +end; + +{ TcxGridChartViewInfo } + +function TcxGridChartViewInfo.GetGridView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +procedure TcxGridChartViewInfo.CreateViewInfos; +var + ADiagram: TcxGridChartDiagram; +begin + inherited; + ADiagram := GridView.ActiveDiagram; + if ADiagram <> nil then + begin + FDiagramViewInfo := ADiagram.GetViewInfoClass.Create(Self, ADiagram); + FLegendViewInfo := ADiagram.GetLegendViewInfoClass.Create(Self, ADiagram); + end; + FTitleViewInfo := GetTitleViewInfoClass.Create(Self, GridView.Title); + FToolBoxViewInfo := GetToolBoxViewInfoClass.Create(Self); +end; + +procedure TcxGridChartViewInfo.DestroyViewInfos(AIsRecreating: Boolean); +begin + FreeAndNil(FToolBoxViewInfo); + FreeAndNil(FTitleViewInfo); + FreeAndNil(FLegendViewInfo); + FreeAndNil(FDiagramViewInfo); + inherited; +end; + +function TcxGridChartViewInfo.GetTitleViewInfoClass: TcxGridChartTitleViewInfoClass; +begin + Result := TcxGridChartTitleViewInfo; +end; + +function TcxGridChartViewInfo.GetToolBoxViewInfoClass: TcxGridChartToolBoxViewInfoClass; +begin + Result := TcxGridChartToolBoxViewInfo; +end; + +procedure TcxGridChartViewInfo.Calculate; +var + ADiagramBounds, ALegendBounds, ATitleBounds, AToolBoxBounds: TRect; +begin + RecreateViewInfos; + inherited; + CalculatePartsBounds(ADiagramBounds, ALegendBounds, ATitleBounds, AToolBoxBounds); + if FDiagramViewInfo <> nil then + FDiagramViewInfo.Calculate(ADiagramBounds); + if FLegendViewInfo <> nil then + FLegendViewInfo.Calculate(ALegendBounds); + FTitleViewInfo.Calculate(ATitleBounds); + if FToolBoxViewInfo.Visible then + FToolBoxViewInfo.Calculate(AToolBoxBounds); +end; + +function TcxGridChartViewInfo.CalculateClientBounds: TRect; +begin + Result := inherited CalculateClientBounds; + InflateRect(Result, -ChartPartOffset, -ChartPartOffset); +end; + +procedure TcxGridChartViewInfo.CalculateHeight(const AMaxSize: TPoint; + var AHeight: Integer; var AFullyVisible: Boolean); +begin + AHeight := MaxInt div 2; + AFullyVisible := False; + inherited; +end; + +procedure TcxGridChartViewInfo.CalculatePartBounds(APart: TcxCustomGridChartPartViewInfo; + var ABounds, APartBounds: TRect); +begin + if APart.Visible then + begin + PositionRect(APartBounds, ABounds, APart.Width, APart.Height, ChartPartOffset, APart.Position); + AlignRect(APartBounds, APart.Width, APart.Height, + APart.Position in [cppTop, cppBottom], APart.Alignment); + end + else + SetRectEmpty(APartBounds); +end; + +procedure TcxGridChartViewInfo.CalculatePartsBounds(out ADiagramBounds, ALegendBounds, + ATitleBounds, AToolBoxBounds: TRect); +begin + ADiagramBounds := ClientBounds; + CalculatePartBounds(FToolBoxViewInfo, ADiagramBounds, AToolBoxBounds); + CalculatePartBounds(FTitleViewInfo, ADiagramBounds, ATitleBounds); + if FLegendViewInfo <> nil then + CalculatePartBounds(FLegendViewInfo, ADiagramBounds, ALegendBounds); +end; + +function TcxGridChartViewInfo.DoGetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + if FDiagramViewInfo <> nil then + Result := FDiagramViewInfo.GetHitTest(P) + else + Result := nil; + if Result = nil then + begin + Result := FToolBoxViewInfo.GetHitTest(P); + if Result = nil then + begin + if FLegendViewInfo <> nil then + Result := FLegendViewInfo.GetHitTest(P); + if Result = nil then + begin + Result := FTitleViewInfo.GetHitTest(P); + if Result = nil then + Result := inherited DoGetHitTest(P); + end; + end; + end; +end; + +{ TcxCustomGridChartTitle } + +procedure TcxCustomGridChartTitle.SetAlignment(Value: TcxGridChartPartAlignment); +begin + if FAlignment <> Value then + begin + FAlignment := Value; + Changed(vcLayout); + end; +end; + +procedure TcxCustomGridChartTitle.SetPosition(Value: TcxGridChartPartPosition); +begin + if FPosition <> Value then + begin + FPosition := Value; + Changed(vcLayout); + end; +end; + +procedure TcxCustomGridChartTitle.SetText(Value: string); +begin + if FText <> Value then + begin + FText := Value; + Changed(vcLayout); + end; +end; + +procedure TcxCustomGridChartTitle.GetStoredProperties(AProperties: TStrings); +begin + AProperties.Add('Title.Alignment'); + AProperties.Add('Title.Position'); + inherited; +end; + +procedure TcxCustomGridChartTitle.GetStoredPropertyValue(const AName: string; + var AValue: Variant); +begin + if AName = 'Title.Alignment' then + AValue := Variant(Alignment) + else + if AName = 'Title.Position' then + AValue := Variant(Position); + inherited; +end; + +procedure TcxCustomGridChartTitle.SetStoredPropertyValue(const AName: string; + const AValue: Variant); +begin + if AName = 'Title.Alignment' then + Alignment := TcxGridChartPartAlignment((AValue)) + else + if AName = 'Title.Position' then + Position := TcxGridChartPartPosition((AValue)); + inherited; +end; + +function TcxCustomGridChartTitle.GetDefaultAlignment: TcxGridChartPartAlignment; +begin + Result := cpaCenter; +end; + +function TcxCustomGridChartTitle.GetDefaultOrientation: TcxGridChartPartOrientation; +begin + if GetPosition in [cppTop, cppBottom] then + Result := cpoHorizontal + else + Result := cpoVertical; +end; + +function TcxCustomGridChartTitle.GetDefaultText: string; +begin + Result := ''; +end; + +procedure TcxCustomGridChartTitle.Assign(Source: TPersistent); +begin + if Source is TcxCustomGridChartTitle then + with TcxCustomGridChartTitle(Source) do + begin + Self.Alignment := Alignment; + Self.Position := Position; + Self.Text := Text; + end; + inherited; +end; + +function TcxCustomGridChartTitle.GetAlignment: TcxGridChartPartAlignment; +begin + Result := FAlignment; + if Result = cpaDefault then + Result := GetDefaultAlignment; +end; + +function TcxCustomGridChartTitle.GetOrientation: TcxGridChartPartOrientation; +begin + Result := GetDefaultOrientation; +end; + +function TcxCustomGridChartTitle.GetPosition: TcxGridChartPartPosition; +begin + if GetText = '' then + Result := cppNone + else + begin + Result := FPosition; + if Result = cppDefault then + Result := GetDefaultPosition; + end; +end; + +function TcxCustomGridChartTitle.GetText: string; +begin + Result := FText; + if Result = '' then + Result := GetDefaultText; +end; + +{ TcxGridChartLegend } + +procedure TcxGridChartLegend.SetAlignment(Value: TcxGridChartPartAlignment); +begin + if FAlignment <> Value then + begin + FAlignment := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridChartLegend.SetBorder(Value: TcxGridChartLegendBorder); +begin + if FBorder <> Value then + begin + FBorder := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridChartLegend.SetKeyBorder(Value: TcxGridChartLegendBorder); +begin + if FKeyBorder <> Value then + begin + FKeyBorder := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridChartLegend.SetOrientation(Value: TcxGridChartPartOrientation); +begin + if FOrientation <> Value then + begin + FOrientation := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridChartLegend.SetPosition(Value: TcxGridChartPartPosition); +begin + if FPosition <> Value then + begin + FPosition := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridChartLegend.GetStoredProperties(AProperties: TStrings); +begin + AProperties.Add('Legend.Alignment'); + AProperties.Add('Legend.Border'); + AProperties.Add('Legend.KeyBorder'); + AProperties.Add('Legend.Orientation'); + AProperties.Add('Legend.Position'); + inherited; +end; + +procedure TcxGridChartLegend.GetStoredPropertyValue(const AName: string; + var AValue: Variant); +begin + if AName = 'Legend.Alignment' then + AValue := Variant(Alignment) + else + if AName = 'Legend.Border' then + AValue := Variant(Border) + else + if AName = 'Legend.KeyBorder' then + AValue := Variant(KeyBorder) + else + if AName = 'Legend.Orientation' then + AValue := Variant(Orientation) + else + if AName = 'Legend.Position' then + AValue := Variant(Position); + inherited; +end; + +procedure TcxGridChartLegend.SetStoredPropertyValue(const AName: string; + const AValue: Variant); +begin + if AName = 'Legend.Alignment' then + Alignment := TcxGridChartPartAlignment((AValue)) + else + if AName = 'Legend.Border' then + Border := TcxGridChartLegendBorder((AValue)) + else + if AName = 'Legend.KeyBorder' then + KeyBorder := TcxGridChartLegendBorder((AValue)) + else + if AName = 'Legend.Orientation' then + Orientation := TcxGridChartPartOrientation((AValue)) + else + if AName = 'Legend.Position' then + Position := TcxGridChartPartPosition((AValue)); + inherited; +end; + +function TcxGridChartLegend.GetDefaultAlignment: TcxGridChartPartAlignment; +begin + Result := cpaCenter; +end; + +function TcxGridChartLegend.GetDefaultBorder: TcxGridChartLegendBorder; +begin + Result := lbNone; +end; + +function TcxGridChartLegend.GetDefaultKeyBorder: TcxGridChartLegendBorder; +begin + Result := lbSingle; +end; + +function TcxGridChartLegend.GetDefaultOrientation(APosition: TcxGridChartPartPosition): TcxGridChartPartOrientation; +begin + if APosition in [cppTop, cppBottom] then + Result := cpoHorizontal + else + Result := cpoVertical; +end; + +function TcxGridChartLegend.GetDefaultPosition: TcxGridChartPartPosition; +begin + Result := cppRight; +end; + +procedure TcxGridChartLegend.Assign(Source: TPersistent); +begin + if Source is TcxGridChartLegend then + with TcxGridChartLegend(Source) do + begin + Self.Alignment := Alignment; + Self.Border := Border; + Self.KeyBorder := KeyBorder; + Self.Orientation := Orientation; + Self.Position := Position; + end; + inherited; +end; + +function TcxGridChartLegend.GetAlignment: TcxGridChartPartAlignment; +begin + Result := FAlignment; + if Result = cpaDefault then + if Parent = nil then + Result := GetDefaultAlignment + else + Result := Parent.GetAlignment; +end; + +function TcxGridChartLegend.GetBorder: TcxGridChartLegendBorder; +begin + Result := FBorder; + if Result = lbDefault then + if Parent = nil then + Result := GetDefaultBorder + else + Result := Parent.GetBorder; +end; + +function TcxGridChartLegend.GetKeyBorder: TcxGridChartLegendBorder; +begin + Result := FKeyBorder; + if Result = lbDefault then + if Parent = nil then + Result := GetDefaultKeyBorder + else + Result := Parent.GetKeyBorder; +end; + +function TcxGridChartLegend.GetOrientation(APosition: TcxGridChartPartPosition = cppDefault): TcxGridChartPartOrientation; +begin + Result := FOrientation; + if Result = cpoDefault then + if Parent = nil then + Result := GetDefaultOrientation(APosition) + else + begin + if APosition = cppDefault then + APosition := GetPosition; + Result := Parent.GetOrientation(APosition); + end; +end; + +function TcxGridChartLegend.GetPosition: TcxGridChartPartPosition; +begin + Result := FPosition; + if Result = cppDefault then + if Parent = nil then + Result := GetDefaultPosition + else + Result := Parent.GetPosition; +end; + +{ TcxCustomGridChartDiagramOptions } + +constructor TcxCustomGridChartDiagramOptions.Create(ADiagram: TcxGridChartDiagram); +begin + inherited Create; + FDiagram := ADiagram; +end; + +function TcxCustomGridChartDiagramOptions.GetGridView: TcxGridChartView; +begin + Result := FDiagram.GridView; +end; + +function TcxCustomGridChartDiagramOptions.GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := FDiagram.GridView.LookAndFeelPainter; +end; + +procedure TcxCustomGridChartDiagramOptions.Changed(AChange: TcxGridDiagramChange = dcLayout); +begin + FDiagram.Changed(AChange); +end; + +procedure TcxCustomGridChartDiagramOptions.Assign(Source: TPersistent); +begin + if not (Source is TcxCustomGridChartDiagramOptions) then + inherited; +end; + +{ TcxGridChartDiagramValueData } + +type + TcxGridChartDiagramValueData = class + ValueIndex: Integer; + VisibleSeriesIndex: Integer; + end; + +{ TcxGridChartDiagramStyles } + +constructor TcxGridChartDiagramStyles.Create(AOwner: TPersistent); +begin + inherited; + BitmapInViewParams := True; +end; + +function TcxGridChartDiagramStyles.GetDiagram: TcxGridChartDiagram; +begin + Result := TcxGridChartDiagram(Owner); +end; + +function TcxGridChartDiagramStyles.GetGridViewValue: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +procedure TcxGridChartDiagramStyles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +begin + inherited; + with AParams, LookAndFeelPainter do + case Index of + dsLegend: + GridView.Styles.GetViewParams(vsLegend, AData, nil, AParams); + dsValueCaptions: + TextColor := DefaultChartDiagramValueCaptionTextColor; + dsValues: + with TcxGridChartDiagramValueData(AData) do + if VisibleSeriesIndex <> -1 then + GridView.VisibleSeries[VisibleSeriesIndex].Styles.GetValueParams(ValueIndex, + GetVaryColorsByCategory, AParams) + else + begin + Color := GetDefaultValueColor(ValueIndex); + TextColor := DefaultChartDiagramValueBorderColor; + end; + end; +end; + +function TcxGridChartDiagramStyles.GetGridView: TcxCustomGridView; +begin + Result := Diagram.GridView; +end; + +procedure TcxGridChartDiagramStyles.GetBackgroundParams(out AParams: TcxViewParams); +begin + GridView.Styles.GetViewParams(vsBackground, nil, nil, AParams); +end; + +procedure TcxGridChartDiagramStyles.GetValueParams(AVisibleSeriesIndex, AValueIndex: Integer; + out AParams: TcxViewParams); +var + AData: TcxGridChartDiagramValueData; +begin + AData := TcxGridChartDiagramValueData.Create; + try + AData.VisibleSeriesIndex := AVisibleSeriesIndex; + AData.ValueIndex := AValueIndex; + GetViewParams(dsValues, AData, nil, AParams); + finally + AData.Free; + end; +end; + +procedure TcxGridChartDiagramStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridChartDiagramStyles then + with TcxGridChartDiagramStyles(Source) do + begin + Self.Legend := Legend; + Self.ValueCaptions := ValueCaptions; + Self.Values := Values; + end; +end; + +{ TcxGridChartDiagram } + +constructor TcxGridChartDiagram.Create(AGridView: TcxGridChartView); +begin + inherited Create; + FEnabled := True; + CreateSubObjects(AGridView); + AGridView.AddDiagram(Self); +end; + +destructor TcxGridChartDiagram.Destroy; +begin + FGridView.RemoveDiagram(Self); + DestroySubObjects; + inherited; +end; + +function TcxGridChartDiagram.GetActive: Boolean; +begin + Result := FGridView.ActiveDiagram = Self; +end; + +function TcxGridChartDiagram.GetID: string; +begin + Result := ClassName; + Delete(Result, 1, Length('TcxGridChart')); + Insert(' ', Result, Pos('Diagram', Result)); +end; + +procedure TcxGridChartDiagram.SetActive(Value: Boolean); +begin + if Value then + FGridView.ActiveDiagram := Self; +end; + +procedure TcxGridChartDiagram.SetEnabled(Value: Boolean); +begin + if FEnabled <> Value then + begin + FEnabled := Value; + FGridView.RefreshAvailableDiagramList; + if IsAvailable then + if FGridView.ActiveDiagram = nil then + Active := True + else + else + if Active then + FGridView.ActiveDiagram := nil; + Changed(dcLayout); + end; +end; + +procedure TcxGridChartDiagram.SetLegend(Value: TcxGridChartLegend); +begin + FLegend.Assign(Value); +end; + +procedure TcxGridChartDiagram.SetStyles(Value: TcxGridChartDiagramStyles); +begin + FStyles.Assign(Value); +end; + +procedure TcxGridChartDiagram.SetOnCustomDrawLegend(Value: TcxGridChartDiagramLegendCustomDrawEvent); +begin + if @FOnCustomDrawLegend <> @Value then + begin + FOnCustomDrawLegend := Value; + Changed(dcProperty); + end; +end; + +procedure TcxGridChartDiagram.SetOnCustomDrawLegendItem(Value: TcxGridChartDiagramLegendItemCustomDrawEvent); +begin + if @FOnCustomDrawLegendItem <> @Value then + begin + FOnCustomDrawLegendItem := Value; + Changed(dcProperty); + end; +end; + +procedure TcxGridChartDiagram.SetOnCustomDrawValue(Value: TcxGridChartDiagramValueCustomDrawEvent); +begin + if @FOnCustomDrawValue <> @Value then + begin + FOnCustomDrawValue := Value; + Changed(dcProperty); + end; +end; + +function TcxGridChartDiagram.GetOwner: TPersistent; +begin + Result := FGridView; +end; + +procedure TcxGridChartDiagram.CreateSubObjects(AGridView: TcxGridChartView); +begin + FLegend := AGridView.GetLegendClass.Create(AGridView); + FLegend.Parent := AGridView.Legend; + FStyles := GetStylesClass.Create(Self); +end; + +procedure TcxGridChartDiagram.DestroySubObjects; +begin + FreeAndNil(FStyles); + FreeAndNil(FLegend); +end; + +procedure TcxGridChartDiagram.SetGridView(Value: TcxGridChartView); +begin + FGridView := Value; +end; + +function TcxGridChartDiagram.GetStylesClass: TcxGridChartDiagramStylesClass; +begin + Result := TcxGridChartDiagramStyles; +end; + +procedure TcxGridChartDiagram.Changed(AChange: TcxGridDiagramChange = dcLayout); +begin + //if FGridView <> nil then + FGridView.Changed(TcxGridViewChangeKind(AChange)); +end; + +function TcxGridChartDiagram.GetDisplayText: string; +begin + Result := ID; +end; + +function TcxGridChartDiagram.GetImageIndex: Integer; +begin + Result := -1; +end; + +function TcxGridChartDiagram.HorizontalPaging: Boolean; +begin + Result := True; +end; + +function TcxGridChartDiagram.PagingInOppositeDirection: Boolean; +begin + Result := False; +end; + +function TcxGridChartDiagram.SupportsPaging: Boolean; +begin + Result := False; +end; + +function TcxGridChartDiagram.SupportsValueHotTrack: Boolean; +begin + Result := True; +end; + +procedure TcxGridChartDiagram.DoCustomDrawLegend(ACanvas: TcxCanvas; + AViewInfo: TcxGridChartLegendViewInfo; var ADone: Boolean); +begin + if HasCustomDrawLegend then + FOnCustomDrawLegend(Self, ACanvas, AViewInfo, ADone); +end; + +procedure TcxGridChartDiagram.DoCustomDrawLegendItem(ACanvas: TcxCanvas; + AViewInfo: TcxGridChartLegendItemViewInfo; var ADone: Boolean); +begin + if HasCustomDrawLegendItem then + FOnCustomDrawLegendItem(Self, ACanvas, AViewInfo, ADone); +end; + +procedure TcxGridChartDiagram.DoCustomDrawValue(ACanvas: TcxCanvas; + AViewInfo: TcxGridChartDiagramValueViewInfo; var ADone: Boolean); +begin + if HasCustomDrawValue then + FOnCustomDrawValue(Self, ACanvas, AViewInfo, ADone); +end; + +function TcxGridChartDiagram.HasCustomDrawLegend: Boolean; +begin + Result := Assigned(FOnCustomDrawLegend); +end; + +function TcxGridChartDiagram.HasCustomDrawLegendItem: Boolean; +begin + Result := Assigned(FOnCustomDrawLegendItem); +end; + +function TcxGridChartDiagram.HasCustomDrawValue: Boolean; +begin + Result := Assigned(FOnCustomDrawValue); +end; + +procedure TcxGridChartDiagram.Assign(Source: TPersistent); +begin + if Source is TcxGridChartDiagram then + with TcxGridChartDiagram(Source) do + begin + Self.Enabled := Enabled; // must be assigned before Active + Self.Active := Active; + Self.Legend := Legend; + Self.Styles := Styles; + Self.OnCustomDrawLegend := OnCustomDrawLegend; + Self.OnCustomDrawLegendItem := OnCustomDrawLegendItem; + Self.OnCustomDrawValue := OnCustomDrawValue; + end + else + inherited; +end; + +function TcxGridChartDiagram.GetNamePath: string; +begin + Result := FGridView.GetDiagramNamePath(Self); +end; + +function TcxGridChartDiagram.GetValueCaption(ASeries: TcxGridChartSeries; + AValueIndex: Integer): string; +begin + Result := ASeries.VisibleDisplayTexts[AValueIndex]; +end; + +function TcxGridChartDiagram.IsAvailable: Boolean; +begin + Result := FEnabled; +end; + +{ TcxGridChartHistogramAxisTitle } + +constructor TcxGridChartHistogramAxisTitle.Create(AAxis: TcxGridChartHistogramAxis); +begin + FAxis := AAxis; + inherited Create(nil); +end; + +function TcxGridChartHistogramAxisTitle.GetDefaultPosition: TcxGridChartPartPosition; +begin + Result := FAxis.GetPosition; +end; + +function TcxGridChartHistogramAxisTitle.GetDefaultText: string; +begin + Result := inherited GetDefaultText; + if Result = '' then + Result := FAxis.GetTitleDefaultText; +end; + +function TcxGridChartHistogramAxisTitle.GetGridViewValue: TcxCustomGridView; +begin + Result := FAxis.GridView; +end; + +{ TcxGridChartHistogramAxis } + +constructor TcxGridChartHistogramAxis.Create(ADiagram: TcxGridChartDiagram); +begin + inherited; + FGridLines := True; + FTickMarkKind := tmkOutside; + FTickMarkLabels := True; + FTitle := GetTitleClass.Create(Self); + FVisible := True; +end; + +destructor TcxGridChartHistogramAxis.Destroy; +begin + FreeAndNil(FTitle); + inherited; +end; + +function TcxGridChartHistogramAxis.GetDiagram: TcxGridChartHistogram; +begin + Result := TcxGridChartHistogram(inherited Diagram); +end; + +procedure TcxGridChartHistogramAxis.SetGridLines(Value: Boolean); +begin + if FGridLines <> Value then + begin + FGridLines := Value; + Changed; + end; +end; + +procedure TcxGridChartHistogramAxis.SetTickMarkKind(Value: TcxGridChartHistogramTickMarkKind); +begin + if FTickMarkKind <> Value then + begin + FTickMarkKind := Value; + Changed; + end; +end; + +procedure TcxGridChartHistogramAxis.SetTickMarkLabels(Value: Boolean); +begin + if FTickMarkLabels <> Value then + begin + FTickMarkLabels := Value; + Changed; + end; +end; + +procedure TcxGridChartHistogramAxis.SetTitle(Value: TcxGridChartHistogramAxisTitle); +begin + FTitle.Assign(Value); +end; + +procedure TcxGridChartHistogramAxis.SetVisible(Value: Boolean); +begin + if FVisible <> Value then + begin + FVisible := Value; + Changed; + end; +end; + +function TcxGridChartHistogramAxis.GetTitleClass: TcxGridChartHistogramAxisTitleClass; +begin + Result := TcxGridChartHistogramAxisTitle; +end; + +function TcxGridChartHistogramAxis.GetTitleDefaultText: string; +begin + Result := ''; +end; + +procedure TcxGridChartHistogramAxis.Assign(Source: TPersistent); +begin + if Source is TcxGridChartHistogramAxis then + with TcxGridChartHistogramAxis(Source) do + begin + Self.GridLines := GridLines; + Self.TickMarkKind := TickMarkKind; + Self.TickMarkLabels := TickMarkLabels; + Self.Title := Title; + Self.Visible := Visible; + end; + inherited; +end; + +{ TcxGridChartHistogramAxisCategory } + +constructor TcxGridChartHistogramAxisCategory.Create(ADiagram: TcxGridChartDiagram); +begin + inherited; + FValueAxisBetweenCategories := GetDefaultValueAxisBetweenCategories; +end; + +procedure TcxGridChartHistogramAxisCategory.SetCategoriesInReverseOrder(Value: Boolean); +begin + if FCategoriesInReverseOrder <> Value then + begin + FCategoriesInReverseOrder := Value; + Changed; + end; +end; + +procedure TcxGridChartHistogramAxisCategory.SetValueAxisAtMaxCategory(Value: Boolean); +begin + if FValueAxisAtMaxCategory <> Value then + begin + FValueAxisAtMaxCategory := Value; + Changed; + end; +end; + +procedure TcxGridChartHistogramAxisCategory.SetValueAxisBetweenCategories(Value: Boolean); +begin + if FValueAxisBetweenCategories <> Value then + begin + FValueAxisBetweenCategories := Value; + Changed; + end; +end; + +function TcxGridChartHistogramAxisCategory.GetDefaultValueAxisBetweenCategories: Boolean; +begin + Result := True; +end; + +function TcxGridChartHistogramAxisCategory.GetTitleDefaultText: string; +begin + Result := inherited GetTitleDefaultText; + if Result = '' then + if GridView.ViewData.IsSummaryLevel then + Result := GridView.ActiveDataGroup.DisplayText + else + Result := GridView.Categories.DisplayText; +end; + +procedure TcxGridChartHistogramAxisCategory.Assign(Source: TPersistent); +begin + if Source is TcxGridChartHistogramAxisCategory then + with TcxGridChartHistogramAxisCategory(Source) do + begin + Self.CategoriesInReverseOrder := CategoriesInReverseOrder; + Self.ValueAxisAtMaxCategory := ValueAxisAtMaxCategory; + Self.ValueAxisBetweenCategories := ValueAxisBetweenCategories; + end; + inherited; +end; + +function TcxGridChartHistogramAxisCategory.GetPosition: TcxGridChartAxisPosition; +begin + Result := Diagram.GetCategoryAxisPosition; +end; + +{ TcxGridChartHistogramAxisValue } + +procedure TcxGridChartHistogramAxisValue.SetMaxValue(const Value: Extended); +begin + if FMaxValue <> Value then + begin + FMaxValue := Value; + if not GridView.IsLoading and (FMaxValue <> 0) then + MinMaxValues := mmvCustom; + Changed; + end; +end; + +procedure TcxGridChartHistogramAxisValue.SetMinMaxValues(Value: TcxGridChartHistogramMinMaxValues); +begin + if FMinMaxValues <> Value then + begin + FMinMaxValues := Value; + Changed; + end; +end; + +procedure TcxGridChartHistogramAxisValue.SetMinValue(const Value: Extended); +begin + if FMinValue <> Value then + begin + FMinValue := Value; + if not GridView.IsLoading and (FMinValue <> 0) then + MinMaxValues := mmvCustom; + Changed; + end; +end; + +procedure TcxGridChartHistogramAxisValue.SetTickMarkLabelFormat(const Value: string); +begin + if FTickMarkLabelFormat <> Value then + begin + FTickMarkLabelFormat := Value; + Changed; + end; +end; + +function TcxGridChartHistogramAxisValue.GetTitleDefaultText: string; +begin + Result := inherited GetTitleDefaultText; + if (Result = '') and (GridView.VisibleSeriesCount = 1) then + Result := GridView.VisibleSeries[0].DisplayText; +end; + +procedure TcxGridChartHistogramAxisValue.Assign(Source: TPersistent); +begin + if Source is TcxGridChartHistogramAxisValue then + with TcxGridChartHistogramAxisValue(Source) do + begin + Self.MinValue := MinValue; + Self.MaxValue := MaxValue; + Self.MinMaxValues := MinMaxValues; // should be after Min/MaxValue + Self.TickMarkLabelFormat := TickMarkLabelFormat; + end; + inherited; +end; + +function TcxGridChartHistogramAxisValue.GetPosition: TcxGridChartAxisPosition; +begin + Result := Diagram.GetValueAxisPosition; +end; + +function TcxGridChartHistogramAxisValue.GetTickMarkLabel(const ATickMarkValue: Variant): string; +var + ATickMarkLabelFormat: string; +begin + ATickMarkLabelFormat := GetTickMarkLabelFormat(False); + if ATickMarkLabelFormat = '' then + case GridView.VisibleSeriesCount of + 0: Result := ATickMarkValue; + 1: Result := GridView.VisibleSeries[0].GetValueDisplayText(ATickMarkValue); + else + ATickMarkLabelFormat := GetTickMarkLabelFormat(True); + if ATickMarkLabelFormat = '' then + Result := GridView.VisibleSeries[0].DataBinding.GetValueDisplayText(ATickMarkValue) + else + Result := FormatFloat(ATickMarkLabelFormat, ATickMarkValue); + end + else + Result := FormatFloat(ATickMarkLabelFormat, ATickMarkValue); +end; + +function TcxGridChartHistogramAxisValue.GetTickMarkLabelFormat(AConsiderSeriesFormat: Boolean): string; +var + I: Integer; + AValueCaptionFormat: string; +begin + if Diagram.Values.Stacking = vs100Percent then + Result := cxGetResourceString(@scxGridChartPercentValueTickMarkLabelFormat) + else + begin + Result := TickMarkLabelFormat; + if (Result = '') and AConsiderSeriesFormat then + for I := 0 to GridView.VisibleSeriesCount - 1 do + begin + AValueCaptionFormat := GridView.VisibleSeries[I].ValueCaptionFormat; + if (I <> 0) and (AValueCaptionFormat <> Result) then + begin + Result := ''; + Break; + end; + Result := AValueCaptionFormat; + end; + end; +end; + +{ TcxGridChartHistogramStyles } + +procedure TcxGridChartHistogramStyles.GetDefaultViewParams(Index: Integer; + AData: TObject; out AParams: TcxViewParams); +begin + inherited; + with AParams, LookAndFeelPainter do + case Index of + dsAxis: + begin + Color := DefaultChartHistogramAxisColor; + TextColor := DefaultContentTextColor; + end; + dsCategoryAxis, dsValueAxis: + GetViewParams(dsAxis, nil, nil, AParams); + dsAxisTitle: + TextColor := DefaultContentTextColor; + dsCategoryAxisTitle, dsValueAxisTitle: + GetViewParams(dsAxisTitle, nil, nil, AParams); + dsGridLines: + Color := DefaultChartHistogramGridLineColor; + dsCategoryGridLines, dsValueGridLines: + GetViewParams(dsGridLines, nil, nil, AParams); + dsPlot: + Color := DefaultChartHistogramPlotColor; + end; +end; + +function TcxGridChartHistogramStyles.GetVaryColorsByCategory: Boolean; +begin + Result := TcxGridChartColumnDiagram(Diagram).Values.GetVaryColorsByCategory; +end; + +procedure TcxGridChartHistogramStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridChartHistogramStyles then + with TcxGridChartHistogramStyles(Source) do + begin + Self.Axis := Axis; + Self.AxisTitle := AxisTitle; + Self.CategoryAxis := CategoryAxis; + Self.CategoryAxisTitle := CategoryAxisTitle; + Self.CategoryGridLines := CategoryGridLines; + Self.GridLines := GridLines; + Self.Plot := Plot; + Self.ValueAxis := ValueAxis; + Self.ValueAxisTitle := ValueAxisTitle; + Self.ValueGridLines := ValueGridLines; + end; +end; + +{ TcxGridChartHistogramValues } + +procedure TcxGridChartHistogramValues.SetStacking(Value: TcxGridChartValuesStacking); +begin + if FStacking <> Value then + begin + FStacking := Value; + Changed; + end; +end; + +procedure TcxGridChartHistogramValues.SetVaryColorsByCategory(Value: Boolean); +begin + if FVaryColorsByCategory <> Value then + begin + FVaryColorsByCategory := Value; + Changed; + end; +end; + +procedure TcxGridChartHistogramValues.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridChartHistogramValues then + with TcxGridChartHistogramValues(Source) do + begin + Self.Stacking := Stacking; + Self.VaryColorsByCategory := VaryColorsByCategory; + end; +end; + +function TcxGridChartHistogramValues.GetVaryColorsByCategory: Boolean; +begin + Result := (GridView.VisibleSeriesCount = 1) and FVaryColorsByCategory; +end; + +{ TcxGridChartHistogram } + +function TcxGridChartHistogram.GetStyles: TcxGridChartHistogramStyles; +begin + Result := TcxGridChartHistogramStyles(inherited Styles); +end; + +procedure TcxGridChartHistogram.SetAxisCategory(Value: TcxGridChartHistogramAxisCategory); +begin + FAxisCategory.Assign(Value); +end; + +procedure TcxGridChartHistogram.SetAxisValue(Value: TcxGridChartHistogramAxisValue); +begin + FAxisValue.Assign(Value); +end; + +procedure TcxGridChartHistogram.SetStyles(Value: TcxGridChartHistogramStyles); +begin + inherited Styles := Value; +end; + +procedure TcxGridChartHistogram.SetValues(Value: TcxGridChartHistogramValues); +begin + FValues.Assign(Value); +end; + +procedure TcxGridChartHistogram.SetOnCustomDrawPlot(Value: TcxGridChartHistogramPlotCustomDrawEvent); +begin + if @FOnCustomDrawPlot <> @Value then + begin + FOnCustomDrawPlot := Value; + Changed(dcProperty); + end; +end; + +procedure TcxGridChartHistogram.CreateSubObjects(AGridView: TcxGridChartView); +begin + inherited; + FAxisCategory := GetAxisCategoryClass.Create(Self); + FAxisValue := GetAxisValueClass.Create(Self); + FValues := GetValuesClass.Create(Self); +end; + +procedure TcxGridChartHistogram.DestroySubObjects; +begin + FreeAndNil(FValues); + FreeAndNil(FAxisValue); + FreeAndNil(FAxisCategory); + inherited; +end; + +function TcxGridChartHistogram.GetAxisCategoryClass: TcxGridChartHistogramAxisCategoryClass; +begin + Result := TcxGridChartHistogramAxisCategory; +end; + +function TcxGridChartHistogram.GetAxisValueClass: TcxGridChartHistogramAxisValueClass; +begin + Result := TcxGridChartHistogramAxisValue; +end; + +function TcxGridChartHistogram.GetStylesClass: TcxGridChartDiagramStylesClass; +begin + Result := TcxGridChartHistogramStyles; +end; + +function TcxGridChartHistogram.GetValuesClass: TcxGridChartHistogramValuesClass; +begin + Result := TcxGridChartHistogramValues; +end; + +function TcxGridChartHistogram.GetLegendViewInfoClass: TcxGridChartLegendViewInfoClass; +begin + Result := TcxGridChartHistogramLegendViewInfo; +end; + +function TcxGridChartHistogram.PagingInOppositeDirection: Boolean; +begin + Result := AxisCategory.CategoriesInReverseOrder; +end; + +function TcxGridChartHistogram.SupportsPaging: Boolean; +begin + Result := True; +end; + +procedure TcxGridChartHistogram.DoCustomDrawPlot(ACanvas: TcxCanvas; + AViewInfo: TcxGridChartHistogramViewInfo; const ABounds: TRect; var ADone: Boolean); +begin + if HasCustomDrawPlot then + FOnCustomDrawPlot(Self, ACanvas, AViewInfo, ABounds, ADone); +end; + +function TcxGridChartHistogram.HasCustomDrawPlot: Boolean; +begin + Result := Assigned(FOnCustomDrawPlot); +end; + +procedure TcxGridChartHistogram.Assign(Source: TPersistent); +begin + if Source is TcxGridChartHistogram then + with TcxGridChartHistogram(Source) do + begin + Self.AxisCategory := AxisCategory; + Self.AxisValue := AxisValue; + Self.Values := Values; + Self.OnCustomDrawPlot := OnCustomDrawPlot; + end; + inherited; +end; + +function TcxGridChartHistogram.GetCategoryAxisPosition: TcxGridChartAxisPosition; +begin + Result := cppBottom; +end; + +function TcxGridChartHistogram.GetValueAxisPosition: TcxGridChartAxisPosition; +begin + if AxisCategory.ValueAxisAtMaxCategory xor AxisCategory.CategoriesInReverseOrder then + Result := cppRight + else + Result := cppLeft; +end; + +{ TcxGridChartColumnDiagramValues } + +constructor TcxGridChartColumnDiagramValues.Create(ADiagram: TcxGridChartDiagram); +begin + inherited; + FBorderWidth := cxGridChartColumnDiagramDefaultBorderWidth; +end; + +procedure TcxGridChartColumnDiagramValues.SetBorderWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FBorderWidth <> Value then + begin + FBorderWidth := Value; + Changed; + end +end; + +procedure TcxGridChartColumnDiagramValues.SetCaptionPosition(Value: TcxGridChartColumnDiagramValueCaptionPosition); +begin + if FCaptionPosition <> Value then + begin + FCaptionPosition := Value; + Changed; + end; +end; + +procedure TcxGridChartColumnDiagramValues.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridChartColumnDiagramValues then + with TcxGridChartColumnDiagramValues(Source) do + begin + Self.BorderWidth := BorderWidth; + Self.CaptionPosition := CaptionPosition; + end; +end; + +{ TcxGridChartColumnDiagram } + +function TcxGridChartColumnDiagram.GetValues: TcxGridChartColumnDiagramValues; +begin + Result := TcxGridChartColumnDiagramValues(inherited Values); +end; + +procedure TcxGridChartColumnDiagram.SetValues(Value: TcxGridChartColumnDiagramValues); +begin + inherited Values := Value; +end; + +function TcxGridChartColumnDiagram.GetLegendViewInfoClass: TcxGridChartLegendViewInfoClass; +begin + Result := TcxGridChartColumnDiagramLegendViewInfo; +end; + +function TcxGridChartColumnDiagram.GetValuesClass: TcxGridChartHistogramValuesClass; +begin + Result := TcxGridChartColumnDiagramValues; +end; + +function TcxGridChartColumnDiagram.GetViewInfoClass: TcxGridChartDiagramViewInfoClass; +begin + Result := TcxGridChartColumnDiagramViewInfo; +end; + +function TcxGridChartColumnDiagram.GetDisplayText: string; +begin + Result := cxGetResourceString(@scxGridChartColumnDiagramDisplayText); +end; + +function TcxGridChartColumnDiagram.GetImageIndex: Integer; +begin + Result := 2; +end; + +{ TcxGridChartBarDiagram } + +function TcxGridChartBarDiagram.GetDisplayText: string; +begin + Result := cxGetResourceString(@scxGridChartBarDiagramDisplayText); +end; + +function TcxGridChartBarDiagram.GetImageIndex: Integer; +begin + Result := 1; +end; + +function TcxGridChartBarDiagram.HorizontalPaging: Boolean; +begin + Result := False; +end; + +function TcxGridChartBarDiagram.PagingInOppositeDirection: Boolean; +begin + Result := not inherited PagingInOppositeDirection; +end; + +function TcxGridChartBarDiagram.GetCategoryAxisPosition: TcxGridChartAxisPosition; +begin + Result := cppLeft; +end; + +function TcxGridChartBarDiagram.GetValueAxisPosition: TcxGridChartAxisPosition; +begin + if AxisCategory.ValueAxisAtMaxCategory xor AxisCategory.CategoriesInReverseOrder then + Result := cppTop + else + Result := cppBottom; +end; + +{ TcxGridChartLineDiagramAxisCategory } + +function TcxGridChartLineDiagramAxisCategory.GetDefaultValueAxisBetweenCategories: Boolean; +begin + Result := False; +end; + +{ TcxGridChartLineDiagramStyles } + +procedure TcxGridChartLineDiagramStyles.GetDefaultViewParams(Index: Integer; + AData: TObject; out AParams: TcxViewParams); +begin + inherited; + if Index = dsValueMarkers then + begin + with TcxGridChartDiagramValueData(AData) do + GetValueParams(VisibleSeriesIndex, ValueIndex, AParams); + if not ValueMarkerHasBorderByDefault then + AParams.TextColor := AParams.Color; + end; +end; + +function TcxGridChartLineDiagramStyles.ValueMarkerHasBorderByDefault: Boolean; +begin + Result := False; +end; + +procedure TcxGridChartLineDiagramStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridChartLineDiagramStyles then + ValueMarkers := TcxGridChartLineDiagramStyles(Source).ValueMarkers; +end; + +procedure TcxGridChartLineDiagramStyles.GetValueMarkerParams(AVisibleSeriesIndex, AValueIndex: Integer; + out AParams: TcxViewParams); +var + AData: TcxGridChartDiagramValueData; +begin + AData := TcxGridChartDiagramValueData.Create; + try + AData.VisibleSeriesIndex := AVisibleSeriesIndex; + AData.ValueIndex := AValueIndex; + GetViewParams(dsValueMarkers, AData, nil, AParams); + finally + AData.Free; + end; +end; + +{ TcxGridChartLineDiagramValues } + +constructor TcxGridChartLineDiagramValues.Create(ADiagram: TcxGridChartDiagram); +begin + inherited; + FHotSpotSize := cxGridChartLineDiagramDefaultHotSpotSize; + FLineStyle := clsSolid; + FLineWidth := cxGridChartLineDiagramDefaultLineWidth; + FMarkerSize := cxGridChartLineDiagramDefaultMarkerSize; +end; + +function TcxGridChartLineDiagramValues.GetDiagram: TcxGridChartLineDiagram; +begin + Result := TcxGridChartLineDiagram(inherited Diagram); +end; + +procedure TcxGridChartLineDiagramValues.SetCaptionPosition(Value: TcxGridChartLineDiagramValueCaptionPosition); +begin + if FCaptionPosition <> Value then + begin + FCaptionPosition := Value; + Changed; + end; +end; + +procedure TcxGridChartLineDiagramValues.SetHotSpotSize(Value: Integer); +begin + if Value < 0 then Value := 0; + if FHotSpotSize <> Value then + begin + FHotSpotSize := Value; + Changed; + end; +end; + +procedure TcxGridChartLineDiagramValues.SetLineStyle(Value: TcxGridChartLineStyle); +begin + if FLineStyle <> Value then + begin + FLineStyle := Value; + Changed; + end; +end; + +procedure TcxGridChartLineDiagramValues.SetLineWidth(Value: Integer); +begin + if Value < 1 then Value := 1; + if FLineWidth <> Value then + begin + FLineWidth := Value; + Changed; + end; +end; + +procedure TcxGridChartLineDiagramValues.SetMarkerSize(Value: Integer); +begin + if Value < 3 then Value := 3; + if FMarkerSize <> Value then + begin + FMarkerSize := Value; + Changed; + end; +end; + +procedure TcxGridChartLineDiagramValues.SetMarkerStyle(Value: TcxGridChartMarkerStyle); +begin + if FMarkerStyle <> Value then + begin + FMarkerStyle := Value; + Changed; + end; +end; + +procedure TcxGridChartLineDiagramValues.SetOnGetLineStyle(Value: TcxGridChartLineDiagramGetLineStyleEvent); +begin + if @FOnGetLineStyle <> @Value then + begin + FOnGetLineStyle := Value; + Changed(dcProperty); + end; +end; + +procedure TcxGridChartLineDiagramValues.SetOnGetMarkerStyle(Value: TcxGridChartLineDiagramGetMarkerStyleEvent); +begin + if @FOnGetMarkerStyle <> @Value then + begin + FOnGetMarkerStyle := Value; + Changed(dcProperty); + end; +end; + +procedure TcxGridChartLineDiagramValues.DoGetLineStyle(ASeries: TcxGridChartSeries; + var AStyle: TcxGridChartLineStyle); +begin + if Assigned(FOnGetLineStyle) then FOnGetLineStyle(Diagram, ASeries, AStyle); +end; + +procedure TcxGridChartLineDiagramValues.DoGetMarkerStyle(ASeries: TcxGridChartSeries; + var AStyle: TcxGridChartMarkerStyle); +begin + if Assigned(FOnGetMarkerStyle) then FOnGetMarkerStyle(Diagram, ASeries, AStyle); +end; + +procedure TcxGridChartLineDiagramValues.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridChartLineDiagramValues then + with TcxGridChartLineDiagramValues(Source) do + begin + Self.CaptionPosition := CaptionPosition; + Self.HotSpotSize := HotSpotSize; + Self.LineStyle := LineStyle; + Self.LineWidth := LineWidth; + Self.MarkerSize := MarkerSize; + Self.MarkerStyle := MarkerStyle; + Self.OnGetLineStyle := OnGetLineStyle; + Self.OnGetMarkerStyle := OnGetMarkerStyle; + end; +end; + +function TcxGridChartLineDiagramValues.GetHotSpotSize: Integer; +begin + Result := FHotSpotSize; + if MarkerStyle <> cmsNone then + Result := Max(Result, MarkerSize); +end; + +function TcxGridChartLineDiagramValues.GetLineStyle(ASeries: TcxGridChartSeries): TcxGridChartLineStyle; +begin + Result := FLineStyle; + DoGetLineStyle(ASeries, Result); +end; + +function TcxGridChartLineDiagramValues.GetMarkerStyle(ASeries: TcxGridChartSeries): TcxGridChartMarkerStyle; +begin + Result := FMarkerStyle; + DoGetMarkerStyle(ASeries, Result); +end; + +{ TcxGridChartLineDiagram } + +function TcxGridChartLineDiagram.GetAxisCategory: TcxGridChartLineDiagramAxisCategory; +begin + Result := TcxGridChartLineDiagramAxisCategory(inherited AxisCategory); +end; + +function TcxGridChartLineDiagram.GetStyles: TcxGridChartLineDiagramStyles; +begin + Result := TcxGridChartLineDiagramStyles(inherited Styles); +end; + +function TcxGridChartLineDiagram.GetValues: TcxGridChartLineDiagramValues; +begin + Result := TcxGridChartLineDiagramValues(inherited Values); +end; + +procedure TcxGridChartLineDiagram.SetAxisCategory(Value: TcxGridChartLineDiagramAxisCategory); +begin + inherited AxisCategory := Value; +end; + +procedure TcxGridChartLineDiagram.SetStyles(Value: TcxGridChartLineDiagramStyles); +begin + inherited Styles := Value; +end; + +procedure TcxGridChartLineDiagram.SetValues(Value: TcxGridChartLineDiagramValues); +begin + inherited Values := Value; +end; + +function TcxGridChartLineDiagram.GetAxisCategoryClass: TcxGridChartHistogramAxisCategoryClass; +begin + Result := TcxGridChartLineDiagramAxisCategory; +end; + +function TcxGridChartLineDiagram.GetLegendViewInfoClass: TcxGridChartLegendViewInfoClass; +begin + Result := TcxGridChartLineDiagramLegendViewInfo; +end; + +function TcxGridChartLineDiagram.GetStylesClass: TcxGridChartDiagramStylesClass; +begin + Result := TcxGridChartLineDiagramStyles; +end; + +function TcxGridChartLineDiagram.GetValuesClass: TcxGridChartHistogramValuesClass; +begin + Result := TcxGridChartLineDiagramValues; +end; + +function TcxGridChartLineDiagram.GetViewInfoClass: TcxGridChartDiagramViewInfoClass; +begin + Result := TcxGridChartLineDiagramViewInfo; +end; + +function TcxGridChartLineDiagram.GetDisplayText: string; +begin + Result := cxGetResourceString(@scxGridChartLineDiagramDisplayText); +end; + +function TcxGridChartLineDiagram.GetImageIndex: Integer; +begin + Result := 3; +end; + +function TcxGridChartLineDiagram.SupportsValueHotTrack: Boolean; +begin + Result := False; +end; + +{ TcxGridChartAreaDiagramStyles } + +function TcxGridChartAreaDiagramStyles.ValueMarkerHasBorderByDefault: Boolean; +begin + Result := True; +end; + +{ TcxGridChartAreaDiagram } + +function TcxGridChartAreaDiagram.GetStyles: TcxGridChartAreaDiagramStyles; +begin + Result := TcxGridChartAreaDiagramStyles(inherited Styles); +end; + +procedure TcxGridChartAreaDiagram.SetStyles(Value: TcxGridChartAreaDiagramStyles); +begin + inherited Styles := Value; +end; + +procedure TcxGridChartAreaDiagram.SetOnCustomDrawValueArea(Value: TcxGridChartAreaDiagramValueAreaCustomDrawEvent); +begin + if @FOnCustomDrawValueArea <> @Value then + begin + FOnCustomDrawValueArea := Value; + Changed(dcProperty); + end; +end; + +function TcxGridChartAreaDiagram.GetLegendViewInfoClass: TcxGridChartLegendViewInfoClass; +begin + Result := TcxGridChartAreaDiagramLegendViewInfo; +end; + +function TcxGridChartAreaDiagram.GetStylesClass: TcxGridChartDiagramStylesClass; +begin + Result := TcxGridChartAreaDiagramStyles; +end; + +function TcxGridChartAreaDiagram.GetViewInfoClass: TcxGridChartDiagramViewInfoClass; +begin + Result := TcxGridChartAreaDiagramViewInfo; +end; + +function TcxGridChartAreaDiagram.GetDisplayText: string; +begin + Result := cxGetResourceString(@scxGridChartAreaDiagramDisplayText); +end; + +function TcxGridChartAreaDiagram.GetImageIndex: Integer; +begin + Result := 0; +end; + +procedure TcxGridChartAreaDiagram.DoCustomDrawValueArea(ACanvas: TcxCanvas; + AViewInfo: TcxGridChartAreaDiagramValueViewInfo; var ADone: Boolean); +begin + if HasCustomDrawValueArea then + FOnCustomDrawValueArea(Self, ACanvas, AViewInfo, ADone); +end; + +function TcxGridChartAreaDiagram.HasCustomDrawValueArea: Boolean; +begin + Result := Assigned(FOnCustomDrawValueArea); +end; + +procedure TcxGridChartAreaDiagram.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridChartAreaDiagram then + OnCustomDrawValueArea := TcxGridChartAreaDiagram(Source).OnCustomDrawValueArea; +end; + +{ TcxGridChartPieDiagramStyles } + +procedure TcxGridChartPieDiagramStyles.GetDefaultViewParams(Index: Integer; + AData: TObject; out AParams: TcxViewParams); +begin + inherited; + with AParams, LookAndFeelPainter do + case Index of + dsSeriesSiteCaptions: + begin + Color := DefaultChartPieDiagramSeriesSiteCaptionColor; + TextColor := DefaultChartPieDiagramSeriesSiteCaptionTextColor; + end; + dsSeriesSites: + begin + Color := DefaultContentColor; + TextColor := DefaultChartPieDiagramSeriesSiteBorderColor; + end; + end; +end; + +function TcxGridChartPieDiagramStyles.GetVaryColorsByCategory: Boolean; +begin + Result := True; +end; + +procedure TcxGridChartPieDiagramStyles.Assign(Source: TPersistent); +begin + if Source is TcxGridChartPieDiagramStyles then + with TcxGridChartPieDiagramStyles(Source) do + begin + Self.SeriesSiteCaptions := SeriesSiteCaptions; + Self.SeriesSites := SeriesSites; + end; + inherited; +end; + +{ TcxGridChartPieDiagramValues } + +constructor TcxGridChartPieDiagramValues.Create(ADiagram: TcxGridChartDiagram); +begin + inherited; + FCaptionItems := [pdvciValue]; +end; + +procedure TcxGridChartPieDiagramValues.SetAngleOfFirstSlice(Value: Integer); +begin + if Value < 0 then Value := 0; + if Value > 360 then Value := 360; + if FAngleOfFirstSlice <> Value then + begin + FAngleOfFirstSlice := Value; + Changed; + end; +end; + +procedure TcxGridChartPieDiagramValues.SetCaptionItems(Value: TcxGridChartPieDiagramValueCaptionItems); +begin + if FCaptionItems <> Value then + begin + FCaptionItems := Value; + Changed; + end; +end; + +procedure TcxGridChartPieDiagramValues.SetCaptionItemSeparator(const Value: string); +begin + if FCaptionItemSeparator <> Value then + begin + FCaptionItemSeparator := Value; + Changed; + end; +end; + +procedure TcxGridChartPieDiagramValues.SetCaptionPosition(Value: TcxGridChartPieDiagramValueCaptionPosition); +begin + if FCaptionPosition <> Value then + begin + FCaptionPosition := Value; + Changed; + end; +end; + +procedure TcxGridChartPieDiagramValues.SetPercentageCaptionFormat(const Value: string); +begin + if FPercentageCaptionFormat <> Value then + begin + FPercentageCaptionFormat := Value; + Changed; + end; +end; + +function TcxGridChartPieDiagramValues.GetDefaultCaptionItemSeparator: string; +begin + Result := '; '; +end; + +function TcxGridChartPieDiagramValues.GetDefaultPercentageCaptionFormat: string; +begin + Result := '0%'; +end; + +procedure TcxGridChartPieDiagramValues.Assign(Source: TPersistent); +begin + if Source is TcxGridChartPieDiagramValues then + with TcxGridChartPieDiagramValues(Source) do + begin + Self.AngleOfFirstSlice := AngleOfFirstSlice; + Self.CaptionItems := CaptionItems; + Self.CaptionItemSeparator := CaptionItemSeparator; + Self.CaptionPosition := CaptionPosition; + Self.PercentageCaptionFormat := PercentageCaptionFormat; + end; + inherited; +end; + +function TcxGridChartPieDiagramValues.GetCaptionItemSeparator: string; +begin + Result := FCaptionItemSeparator; + if Result = '' then + Result := GetDefaultCaptionItemSeparator; +end; + +function TcxGridChartPieDiagramValues.GetCaptionPosition: TcxGridChartPieDiagramValueCaptionPosition; +begin + if FCaptionItems = [] then + Result := pdvcpNone + else + Result := FCaptionPosition; +end; + +function TcxGridChartPieDiagramValues.GetPercentageCaptionFormat: string; +begin + Result := FPercentageCaptionFormat; + if Result = '' then + Result := GetDefaultPercentageCaptionFormat; +end; + +{ TcxGridChartPieDiagram } + +constructor TcxGridChartPieDiagram.Create(AGridView: TcxGridChartView); +begin + inherited; + FSeriesCaptions := True; +end; + +destructor TcxGridChartPieDiagram.Destroy; +begin + inherited; +end; + +function TcxGridChartPieDiagram.GetStyles: TcxGridChartPieDiagramStyles; +begin + Result := TcxGridChartPieDiagramStyles(inherited Styles); +end; + +procedure TcxGridChartPieDiagram.SetSeriesCaptions(Value: Boolean); +begin + if FSeriesCaptions <> Value then + begin + FSeriesCaptions := Value; + Changed; + end; +end; + +procedure TcxGridChartPieDiagram.SetSeriesColumnCount(Value: Integer); +begin + if Value < 0 then Value := 0; + if FSeriesColumnCount <> Value then + begin + FSeriesColumnCount := Value; + Changed; + end; +end; + +procedure TcxGridChartPieDiagram.SetSeriesSites(Value: Boolean); +begin + if FSeriesSites <> Value then + begin + FSeriesSites := Value; + Changed; + end; +end; + +procedure TcxGridChartPieDiagram.SetStyles(Value: TcxGridChartPieDiagramStyles); +begin + inherited Styles := Value; +end; + +procedure TcxGridChartPieDiagram.SetValues(Value: TcxGridChartPieDiagramValues); +begin + FValues.Assign(Value); +end; + +procedure TcxGridChartPieDiagram.SetOnCustomDrawSeriesSite(Value: TcxGridChartPieDiagramSeriesSiteCustomDrawEvent); +begin + if @FOnCustomDrawSeriesSite <> @Value then + begin + FOnCustomDrawSeriesSite := Value; + Changed(dcProperty); + end; +end; + +procedure TcxGridChartPieDiagram.SetOnCustomDrawSeriesSiteCaption(Value: TcxGridChartPieDiagramSeriesSiteCaptionCustomDrawEvent); +begin + if @FOnCustomDrawSeriesSiteCaption <> @Value then + begin + FOnCustomDrawSeriesSiteCaption := Value; + Changed(dcProperty); + end; +end; + +procedure TcxGridChartPieDiagram.CreateSubObjects(AGridView: TcxGridChartView); +begin + inherited; + FValues := GetValuesClass.Create(Self); +end; + +procedure TcxGridChartPieDiagram.DestroySubObjects; +begin + FreeAndNil(FValues); + inherited; +end; + +function TcxGridChartPieDiagram.GetStylesClass: TcxGridChartDiagramStylesClass; +begin + Result := TcxGridChartPieDiagramStyles; +end; + +function TcxGridChartPieDiagram.GetValuesClass: TcxGridChartPieDiagramValuesClass; +begin + Result := TcxGridChartPieDiagramValues; +end; + +function TcxGridChartPieDiagram.GetLegendViewInfoClass: TcxGridChartLegendViewInfoClass; +begin + Result := TcxGridChartPieDiagramLegendViewInfo; +end; + +function TcxGridChartPieDiagram.GetViewInfoClass: TcxGridChartDiagramViewInfoClass; +begin + Result := TcxGridChartPieDiagramViewInfo; +end; + +function TcxGridChartPieDiagram.GetDisplayText: string; +begin + Result := cxGetResourceString(@scxGridChartPieDiagramDisplayText); +end; + +function TcxGridChartPieDiagram.GetImageIndex: Integer; +begin + Result := 4; +end; + +procedure TcxGridChartPieDiagram.DoCustomDrawSeriesSite(ACanvas: TcxCanvas; + AViewInfo: TcxGridChartPieSeriesSiteViewInfo; var ADone: Boolean); +begin + if HasCustomDrawSeriesSite then + FOnCustomDrawSeriesSite(Self, ACanvas, AViewInfo, ADone); +end; + +procedure TcxGridChartPieDiagram.DoCustomDrawSeriesSiteCaption(ACanvas: TcxCanvas; + AViewInfo: TcxGridChartPieSeriesSiteCaptionViewInfo; var ADone: Boolean); +begin + if HasCustomDrawSeriesSiteCaption then + FOnCustomDrawSeriesSiteCaption(Self, ACanvas, AViewInfo, ADone); +end; + +function TcxGridChartPieDiagram.HasCustomDrawSeriesSite: Boolean; +begin + Result := Assigned(FOnCustomDrawSeriesSite); +end; + +function TcxGridChartPieDiagram.HasCustomDrawSeriesSiteCaption: Boolean; +begin + Result := Assigned(FOnCustomDrawSeriesSiteCaption); +end; + +procedure TcxGridChartPieDiagram.Assign(Source: TPersistent); +begin + if Source is TcxGridChartPieDiagram then + with TcxGridChartPieDiagram(Source) do + begin + Self.SeriesCaptions := SeriesCaptions; + Self.SeriesColumnCount := SeriesColumnCount; + Self.SeriesSites := SeriesSites; + Self.Values := Values; + Self.OnCustomDrawSeriesSite := OnCustomDrawSeriesSite; + Self.OnCustomDrawSeriesSiteCaption := OnCustomDrawSeriesSiteCaption; + end; + inherited; +end; + +function TcxGridChartPieDiagram.GetSeriesColumnCount: Integer; +begin + Result := SeriesColumnCount; + if (Result = 0) or (Result > GridView.VisibleSeriesCount) then + Result := GridView.VisibleSeriesCount; +end; + +function TcxGridChartPieDiagram.GetValueCaption(ASeries: TcxGridChartSeries; + AValueIndex: Integer): string; + + function GetItemText(AItem: TcxGridChartPieDiagramValueCaptionItem): string; + var + AValue: Variant; + begin + case AItem of + pdvciCategory: + Result := GridView.Categories.VisibleDisplayTexts[AValueIndex]; + pdvciValue: + Result := ASeries.VisibleDisplayTexts[AValueIndex]; + pdvciPercentage: + begin + if ASeries.SumOfValues = 0 then + AValue := 100 + else + AValue := Abs(100 * ASeries.VisibleValues[AValueIndex] / ASeries.SumOfValues); + Result := FormatFloat(Values.GetPercentageCaptionFormat, AValue); + end; + end; + end; + +var + ACaptionItem: TcxGridChartPieDiagramValueCaptionItem; +begin + Result := ''; + for ACaptionItem := Low(ACaptionItem) to High(ACaptionItem) do + if ACaptionItem in Values.CaptionItems then + if Result = '' then + Result := GetItemText(ACaptionItem) + else + Result := Result + Values.GetCaptionItemSeparator + GetItemText(ACaptionItem); +end; + +{ TcxGridChartItemDataBinding } + +constructor TcxGridChartItemDataBinding.Create(AGridView: TcxGridChartView; + AIsValue: Boolean; ADefaultValueTypeClass: TcxValueTypeClass); +begin + inherited Create(nil); + FGridView := AGridView; + FIsValue := AIsValue; + FDefaultValueTypeClass := ADefaultValueTypeClass; + FDefaultValuesProvider := GetDefaultValuesProviderClass.Create(Self); +end; + +destructor TcxGridChartItemDataBinding.Destroy; +begin + FDefaultValuesProvider.Free; + inherited; +end; + +function TcxGridChartItemDataBinding.GetDataController: TcxCustomDataController; +begin + Result := FDataField.DataController; +end; + +function TcxGridChartItemDataBinding.GetDataIndex: Integer; +begin + Result := FDataField.Index; +end; + +function TcxGridChartItemDataBinding.GetDataItem: TObject; +begin + Result := FDataField.Item; +end; + +function TcxGridChartItemDataBinding.GetDefaultProperties: TcxCustomEditProperties; +begin + Result := FDefaultRepositoryItem.Properties; + with Result do + begin + LockUpdate(True); + IDefaultValuesProvider := Self.DefaultValuesProvider; + LockUpdate(False); + end; +end; + +function TcxGridChartItemDataBinding.GetDefaultValuesProvider: TcxCustomEditDefaultValuesProvider; +begin + Result := FDefaultValuesProvider; + InitDefaultValuesProvider(Result); +end; + +function TcxGridChartItemDataBinding.GetGroupIndex: Integer; +begin + Result := DataController.Groups.ItemGroupIndex[DataIndex]; +end; + +function TcxGridChartItemDataBinding.GetSortIndex: Integer; +begin + Result := DataController.GetItemSortingIndex(DataIndex); +end; + +function TcxGridChartItemDataBinding.GetSortOrder: TcxDataSortOrder; +begin + Result := DataController.GetItemSortOrder(DataIndex); +end; + +function TcxGridChartItemDataBinding.GetSummaryIndex: Integer; +begin + Result := FSummaryItem.Index; +end; + +function TcxGridChartItemDataBinding.GetSummaryKind: TcxSummaryKind; +begin + Result := FSummaryItem.Kind; +end; + +function TcxGridChartItemDataBinding.GetValueType: string; +begin + if ValueTypeClass = nil then + Result := '' + else + Result := ValueTypeClass.Caption; +end; + +function TcxGridChartItemDataBinding.GetValueTypeClass: TcxValueTypeClass; +begin + Result := DataController.GetItemValueTypeClass(DataIndex); +end; + +procedure TcxGridChartItemDataBinding.SetData(Value: TObject); +begin + if FData <> Value then + begin + FData := Value; + FGridView.Changed(vcProperty); + end; +end; + +procedure TcxGridChartItemDataBinding.SetDataField(Value: TcxCustomDataField); +begin + if FDataField <> Value then + begin + FDataField := Value; + if FDataField <> nil then + begin + ValueTypeClass := GetDefaultValueTypeClass; + if IsValue then + CreateSummaryItem(FSummaryItem); + end + else + FreeAndNil(FSummaryItem); + UpdateDefaultRepositoryItemValue; + end; +end; + +procedure TcxGridChartItemDataBinding.SetGroupIndex(Value: Integer); +begin + DataController.Groups.ChangeGrouping(DataIndex, Value); +end; + +procedure TcxGridChartItemDataBinding.SetSortIndex(Value: Integer); +begin + DataController.ChangeItemSortingIndex(DataIndex, Value); +end; + +procedure TcxGridChartItemDataBinding.SetSortOrder(Value: TcxDataSortOrder); +begin + if SortOrder <> Value then + begin + GridView.BeginUpdate; + try + GridView.DataSortingChanging(DataItem); + DataController.ChangeSorting(DataIndex, Value); + GridView.DataSortingChanged(DataItem); + finally + GridView.EndUpdate; + end; + end; +end; + +procedure TcxGridChartItemDataBinding.SetSummaryKind(Value: TcxSummaryKind); +begin + FSummaryItem.Kind := Value; +end; + +procedure TcxGridChartItemDataBinding.SetValueType(const Value: string); +begin + if ValueType <> Value then + ValueTypeClass := cxValueTypeClassList.ItemByCaption(Value); +end; + +procedure TcxGridChartItemDataBinding.SetValueTypeClass(Value: TcxValueTypeClass); +begin + DataController.ChangeValueTypeClass(DataIndex, Value); +end; + +procedure TcxGridChartItemDataBinding.ItemRemoved(Sender: TcxEditRepositoryItem); +begin + UpdateDefaultRepositoryItemValue; +end; + +procedure TcxGridChartItemDataBinding.PropertiesChanged(Sender: TcxEditRepositoryItem); +begin + if not GridView.IsPattern then GridView.Changed(vcLayout); +end; + +procedure TcxGridChartItemDataBinding.CreateSummaryItem(var ASummaryItem: TcxDataSummaryItem); +begin + DataController.Summary.DefaultGroupSummaryItems.BeginUpdate; + try + ASummaryItem := DataController.Summary.DefaultGroupSummaryItems.Add; + ASummaryItem.Kind := cxGridChartItemDefaultSummaryKind; + ASummaryItem.Position := spGroup; + ASummaryItem.ItemLink := DataItem; + finally + DataController.Summary.DefaultGroupSummaryItems.EndUpdate; + end; +end; + +function TcxGridChartItemDataBinding.GetDefaultDisplayText: string; +begin + Result := ''; +end; + +function TcxGridChartItemDataBinding.GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; +begin + Result := TcxCustomEditDefaultValuesProvider; +end; + +function TcxGridChartItemDataBinding.GetDefaultValueTypeClass: TcxValueTypeClass; +begin + Result := FDefaultValueTypeClass; +end; + +function TcxGridChartItemDataBinding.GetSummaryItem: TcxDataSummaryItem; +begin + Result := DataController.Summary.DefaultGroupSummaryItems.ItemOfItemLink(DataItem); +end; + +procedure TcxGridChartItemDataBinding.InitDefaultValuesProvider(ADefaultValuesProvider: TcxCustomEditDefaultValuesProvider); +begin +end; + +function TcxGridChartItemDataBinding.IsValueTypeInteger: Boolean; +begin + Result := (ValueTypeClass = nil) or IsValueTypeValid(ValueTypeClass.GetVarType, True); +end; + +function TcxGridChartItemDataBinding.IsValueTypeStored: Boolean; +begin + Result := ValueTypeClass <> GetDefaultValueTypeClass; +end; + +procedure TcxGridChartItemDataBinding.UpdateSummaryItemValue; +begin + if IsValue then + FSummaryItem := GetSummaryItem; +end; + +procedure TcxGridChartItemDataBinding.ValueTypeClassChanged; +begin + UpdateDefaultRepositoryItemValue; + GridView.Changed(vcLayout); +end; + +function TcxGridChartItemDataBinding.GetDefaultRepositoryItem: TcxEditRepositoryItem; +begin + Result := GetDefaultEditDataRepositoryItems.GetItem(ValueTypeClass); +end; + +procedure TcxGridChartItemDataBinding.UpdateDefaultRepositoryItemValue; +begin + if FDefaultRepositoryItem <> nil then + FDefaultRepositoryItem.RemoveListener(Self); + if FDataField = nil then + FDefaultRepositoryItem := nil + else + FDefaultRepositoryItem := GetDefaultRepositoryItem; + if FDefaultRepositoryItem <> nil then + FDefaultRepositoryItem.AddListener(Self); +end; + +procedure TcxGridChartItemDataBinding.Assign(Source: TPersistent); +begin + if Source is TcxGridChartItemDataBinding then + with TcxGridChartItemDataBinding(Source) do + begin + Self.Data := Data; + Self.ValueTypeClass := ValueTypeClass; + end + else + inherited; +end; + +function TcxGridChartItemDataBinding.GetValueDisplayText(const AValue: Variant): string; +begin + Result := DefaultProperties.GetDisplayText(AValue); +end; + +function TcxGridChartItemDataBinding.IsValueTypeClassValid(AValueTypeClass: TcxValueTypeClass): Boolean; +begin + if IsValue then + Result := cxGridChartView.IsValueTypeClassValid(AValueTypeClass) + else + Result := True; +end; + +{ TcxGridChartItem } + +constructor TcxGridChartItem.Create(AOwner: TComponent); +begin + inherited; + FVisible := True; + FVisibleForCustomization := True; + FVisibleIndex := -1; +end; + +destructor TcxGridChartItem.Destroy; +begin + if not GridView.IsDestroying and GridView.IsDesigning then + GridView.Controller.DesignController.UnselectObject(Self); + FGridView.RemoveItem(Self); + FDataBinding.Free; + inherited; +end; + +function TcxGridChartItem.GetID: Integer; +begin + Result := FDataBinding.ID; +end; + +function TcxGridChartItem.GetIndex: Integer; +begin + Result := FGridView.GetItemIndex(Self); +end; + +function TcxGridChartItem.GetSortOrder: TcxDataSortOrder; +begin + Result := FDataBinding.SortOrder; +end; + +function TcxGridChartItem.GetTag: TcxTag; +begin + Result := inherited Tag; +end; + +function TcxGridChartItem.GetVisibleDisplayText(AIndex: Integer): string; +begin + Result := GetValueDisplayText(VisibleValues[AIndex]); +end; + +procedure TcxGridChartItem.SetDataBinding(Value: TcxGridChartItemDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxGridChartItem.SetDisplayText(const Value: string); +begin + if FDisplayText <> Value then + begin + FDisplayText := Value; + DisplayTextChanged; + end; +end; + +procedure TcxGridChartItem.SetIndex(Value: Integer); +begin + FGridView.SetItemIndex(Self, Value); +end; + +procedure TcxGridChartItem.SetOnGetStoredProperties(Value: TcxGridChartItemGetStoredPropertiesEvent); +begin + if @FOnGetStoredProperties <> @Value then + begin + FOnGetStoredProperties := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartItem.SetOnGetStoredPropertyValue(Value: TcxGridChartItemGetStoredPropertyValueEvent); +begin + if @FOnGetStoredPropertyValue <> @Value then + begin + FOnGetStoredPropertyValue := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartItem.SetOnGetValueDisplayText(Value: TcxGridChartGetValueDisplayTextEvent); +begin + if @FOnGetValueDisplayText <> @Value then + begin + FOnGetValueDisplayText := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartItem.SetOnSetStoredPropertyValue(Value: TcxGridChartItemSetStoredPropertyValueEvent); +begin + if @FOnSetStoredPropertyValue <> @Value then + begin + FOnSetStoredPropertyValue := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartItem.SetSortOrder(Value: TcxDataSortOrder); +begin + FDataBinding.SortOrder := Value; +end; + +procedure TcxGridChartItem.SetTag(Value: TcxTag); +begin + if Tag <> Value then + begin + inherited Tag := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartItem.SetVisible(Value: Boolean); +begin + if FVisible <> Value then + begin + FVisible := Value; + FGridView.ItemVisibilityChanged(Self); + Changed; + end; +end; + +procedure TcxGridChartItem.SetVisibleForCustomization(Value: Boolean); +begin + if FVisibleForCustomization <> Value then + begin + FVisibleForCustomization := Value; + GridView.ItemVisibilityForCustomizationChanged(Self); + Changed(vcProperty); + end; +end; + +function TcxGridChartItem.IsTagStored: Boolean; +begin + Result := Tag <> 0; +end; + +function TcxGridChartItem.GetObjectName: string; +begin + if GridView.IsStoringNameMode then + Result := IntToStr(ID) + else + Result := Name; +end; + +function TcxGridChartItem.GetStoredProperties(AProperties: TStrings): Boolean; +begin + AProperties.Add('Index'); + AProperties.Add('Visible'); + if Assigned(FOnGetStoredProperties) then + FOnGetStoredProperties(Self, AProperties); + Result := True; +end; + +procedure TcxGridChartItem.GetPropertyValue(const AName: string; var AValue: Variant); +begin + if AName = 'Index' then + AValue := Index + else + if AName = 'Visible' then + AValue := Visible + else + if Assigned(FOnGetStoredPropertyValue) then + FOnGetStoredPropertyValue(Self, AName, AValue); +end; + +procedure TcxGridChartItem.SetPropertyValue(const AName: string; const AValue: Variant); +begin + if AName = 'Index' then + SetRestoredIndex(AValue) + else + if AName = 'Visible' then + Visible := AValue + else + if Assigned(FOnSetStoredPropertyValue) then + FOnSetStoredPropertyValue(Self, AName, AValue); +end; + +procedure TcxGridChartItem.DataChanged; +begin + if DataBinding.GetDefaultDisplayText <> FLastDataBindingDefaultDisplayText then + begin + FLastDataBindingDefaultDisplayText := DataBinding.GetDefaultDisplayText; + DisplayTextChanged; + end; +end; + +function TcxGridChartItem.GetDataBinding: TcxGridChartItemDataBinding; +begin + Result := FDataBinding; +end; + +procedure TcxGridChartItem.ValueTypeClassChanged; +begin + FDataBinding.ValueTypeClassChanged; +end; + +procedure TcxGridChartItem.Changed(AChange: TcxGridViewChangeKind = vcLayout); +begin + FGridView.Changed(AChange); +end; + +procedure TcxGridChartItem.DisplayTextChanged; +begin + Changed; + GridView.ItemDisplayTextChanged(Self); +end; + +procedure TcxGridChartItem.DoGetValueDisplayText(const AValue: Variant; + var ADisplayText: string); +begin + if Assigned(FOnGetValueDisplayText) then + FOnGetValueDisplayText(Self, AValue, ADisplayText); +end; + +function TcxGridChartItem.GetDefaultDisplayText: string; +begin + Result := DataBinding.GetDefaultDisplayText; + if Result = '' then + Result := Name; + if Result = '' then + Result := DefaultItemDisplayText; +end; + +procedure TcxGridChartItem.SetGridView(Value: TcxGridChartView); +begin + FGridView := Value; + if FDataBinding = nil then + FDataBinding := GridView.GetItemDataBindingClass.Create(GridView, IsValue, + GetDefaultValueTypeClass); +end; + +procedure TcxGridChartItem.SetName(const NewName: TComponentName); +begin + inherited; + DisplayTextChanged; +end; + +procedure TcxGridChartItem.Assign(Source: TPersistent); +begin + if Source is TcxGridChartItem then + with TcxGridChartItem(Source) do + begin + Self.DataBinding := DataBinding; + Self.DisplayText := DisplayText; + Self.SortOrder := SortOrder; + Self.Tag := Tag; + Self.Visible := Visible; + Self.VisibleForCustomization := VisibleForCustomization; + Self.OnGetStoredProperties := OnGetStoredProperties; + Self.OnGetStoredPropertyValue := OnGetStoredPropertyValue; + Self.OnGetValueDisplayText := OnGetValueDisplayText; + Self.OnSetStoredPropertyValue := OnSetStoredPropertyValue; + end + else + inherited; +end; + +function TcxGridChartItem.GetParentComponent: TComponent; +begin + Result := FGridView; +end; + +function TcxGridChartItem.HasParent: Boolean; +begin + Result := FGridView <> nil; +end; + +procedure TcxGridChartItem.SetParentComponent(AParent: TComponent); +begin + if AParent is TcxGridChartView then + TcxGridChartView(AParent).AddItem(Self); +end; + +function TcxGridChartItem.GetDisplayText: string; +begin + Result := DisplayText; + if Result = '' then + Result := GetDefaultDisplayText; +end; + +function TcxGridChartItem.GetValueDisplayText(const AValue: Variant): string; +begin + Result := DataBinding.GetValueDisplayText(AValue); + DoGetValueDisplayText(AValue, Result); +end; + +class function TcxGridChartItem.IsValue: Boolean; +begin + Result := True; +end; + +{ TcxGridChartCategories } + +constructor TcxGridChartCategories.Create(AGridView: TcxCustomGridView); +begin + inherited; + FDataBinding := GridView.GetItemDataBindingClass.Create(GridView, False, + GetDefaultValueTypeClass); +end; + +destructor TcxGridChartCategories.Destroy; +begin + FDataBinding.Free; + inherited; +end; + +function TcxGridChartCategories.GetGridView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +function TcxGridChartCategories.GetID: Integer; +begin + Result := FDataBinding.ID; +end; + +function TcxGridChartCategories.GetSortOrder: TcxDataSortOrder; +begin + Result := FDataBinding.SortOrder; +end; + +function TcxGridChartCategories.GetValue(Index: Integer): Variant; +begin + Result := GridView.ViewData.Categories[Index]; +end; + +function TcxGridChartCategories.GetValueCount: Integer; +begin + Result := GridView.ViewData.CategoryCount; +end; + +function TcxGridChartCategories.GetVisibleDisplayText(Index: Integer): string; +begin + Result := GetValueDisplayText(VisibleValues[Index]); +end; + +function TcxGridChartCategories.GetVisibleValue(Index: Integer): Variant; +begin + Result := GridView.ViewData.VisibleCategories[Index]; +end; + +function TcxGridChartCategories.GetVisibleValueCount: Integer; +begin + Result := GridView.ViewData.VisibleCategoryCount; +end; + +procedure TcxGridChartCategories.SetDataBinding(Value: TcxGridChartItemDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxGridChartCategories.SetDisplayText(const Value: string); +begin + if FDisplayText <> Value then + begin + FDisplayText := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridChartCategories.SetOnGetValueDisplayText(Value: TcxGridChartGetValueDisplayTextEvent); +begin + if @FOnGetValueDisplayText <> @Value then + begin + FOnGetValueDisplayText := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartCategories.SetSortOrder(Value: TcxDataSortOrder); +begin + FDataBinding.SortOrder := Value; +end; + +procedure TcxGridChartCategories.SetValue(Index: Integer; const Value: Variant); +begin + GridView.ViewData.Categories[Index] := Value; +end; + +procedure TcxGridChartCategories.SetValueCount(Value: Integer); +begin + GridView.ViewData.CategoryCount := Value; +end; + +procedure TcxGridChartCategories.DataChanged; +begin +end; + +function TcxGridChartCategories.GetDataBinding: TcxGridChartItemDataBinding; +begin + Result := FDataBinding; +end; + +procedure TcxGridChartCategories.ValueTypeClassChanged; +begin + FDataBinding.ValueTypeClassChanged; +end; + +procedure TcxGridChartCategories.DoGetValueDisplayText(const AValue: Variant; + var ADisplayText: string); +begin + if Assigned(FOnGetValueDisplayText) then + FOnGetValueDisplayText(Self, AValue, ADisplayText); +end; + +function TcxGridChartCategories.GetDefaultDisplayText: string; +begin + Result := cxGetResourceString(@scxGridChartCategoriesDisplayText); +end; + +function TcxGridChartCategories.GetDefaultValueTypeClass: TcxValueTypeClass; +begin + Result := TcxStringValueType; +end; + +procedure TcxGridChartCategories.Assign(Source: TPersistent); +begin + if Source is TcxGridChartCategories then + with TcxGridChartCategories(Source) do + begin + Self.DataBinding := DataBinding; + Self.DisplayText := DisplayText; + Self.SortOrder := SortOrder; + Self.OnGetValueDisplayText := OnGetValueDisplayText; + end; + inherited; +end; + +function TcxGridChartCategories.GetDisplayText: string; +begin + Result := FDisplayText; + if Result = '' then + Result := GetDefaultDisplayText; +end; + +function TcxGridChartCategories.GetNamePath: string; +begin + Result := GridView.GetCategoriesNamePath; +end; + +function TcxGridChartCategories.GetValueDisplayText(const AValue: Variant): string; +begin + if GridView.ActiveDataGroup = nil then + Result := DataBinding.GetValueDisplayText(AValue) + else + Result := GridView.ActiveDataGroup.GetValueDisplayText(AValue); + DoGetValueDisplayText(AValue, Result); +end; + +{ TcxGridChartDataGroup } + +function TcxGridChartDataGroup.GetActive: Boolean; +begin + Result := GridView.ActiveDataGroup = Self; +end; + +function TcxGridChartDataGroup.GetActiveValueDisplayText: string; +begin + Result := GetValueDisplayText(FActiveValue); +end; + +function TcxGridChartDataGroup.GetDataLevel: Integer; +begin + Result := GridView.GetDataObjectLevel(Self); +end; + +function TcxGridChartDataGroup.GetGroupIndex: Integer; +begin + Result := DataBinding.GroupIndex; +end; + +procedure TcxGridChartDataGroup.SetActive(Value: Boolean); +begin + GridView.ActiveDataGroup := Self; +end; + +procedure TcxGridChartDataGroup.SetActiveValue(const Value: Variant); +begin + if not VarSameValue(FActiveValue, Value) then + begin + FActiveValue := Value; + GridView.ViewData.DataLevelsChanged; + GridView.UpdateDataGroupActiveValues; + Changed; + end; +end; + +procedure TcxGridChartDataGroup.SetDataLevel(Value: Integer); +begin + GridView.SetDataObjectLevel(Self, Value); +end; + +procedure TcxGridChartDataGroup.SetGroupIndex(Value: Integer); +begin + DataBinding.GroupIndex := Value; +end; + +function TcxGridChartDataGroup.GetStoredProperties(AProperties: TStrings): Boolean; +begin + AProperties.Add('ActiveValue'); + Result := inherited GetStoredProperties(AProperties); +end; + +procedure TcxGridChartDataGroup.GetPropertyValue(const AName: string; var AValue: Variant); +begin + if AName = 'ActiveValue' then + AValue := ActiveValue + else + inherited; +end; + +procedure TcxGridChartDataGroup.SetPropertyValue(const AName: string; const AValue: Variant); +begin + if AName = 'ActiveValue' then + ActiveValue := AValue + else + inherited; +end; + +procedure TcxGridChartDataGroup.SetRestoredIndex(AValue: Integer); +begin + GridView.RestoringDataGroups[AValue] := Self; +end; + +procedure TcxGridChartDataGroup.CheckActiveValue; +begin + if HasActiveValue then + if Visible then + GridView.ViewData.CheckValueAtLevel(VisibleIndex, FActiveValue) + else + FActiveValue := Null; +end; + +function TcxGridChartDataGroup.GetDefaultValueTypeClass: TcxValueTypeClass; +begin + Result := TcxVariantValueType; +end; + +function TcxGridChartDataGroup.GetValue(AIndex: Integer): Variant; +begin + Result := GridView.ViewData.GroupValues[Index, AIndex]; +end; + +function TcxGridChartDataGroup.GetValueCount: Integer; +begin + Result := GridView.ViewData.CategoryCount; +end; + +function TcxGridChartDataGroup.GetVisibleValue(AIndex: Integer): Variant; +begin + Result := GridView.ViewData.VisibleGroupValues[VisibleIndex, AIndex]; +end; + +function TcxGridChartDataGroup.GetVisibleValueCount: Integer; +begin + Result := GridView.ViewData.VisibleGroupValueCount[VisibleIndex]; +end; + +procedure TcxGridChartDataGroup.SetValue(AIndex: Integer; const Value: Variant); +begin + GridView.ViewData.GroupValues[Index, AIndex] := Value; +end; + +procedure TcxGridChartDataGroup.SetValueCount(Value: Integer); +begin + GridView.ViewData.CategoryCount := Value; +end; + +function TcxGridChartDataGroup.CanMove: Boolean; +begin + Result := IsDesigning or GridView.OptionsCustomize.DataGroupMoving; +end; + +function TcxGridChartDataGroup.HasActiveValue: Boolean; +begin + Result := not VarIsEmpty(FActiveValue) and not VarIsNull(FActiveValue); +end; + +class function TcxGridChartDataGroup.IsValue: Boolean; +begin + Result := False; +end; + +{ TcxGridChartSeriesStyles } + +constructor TcxGridChartSeriesStyles.Create(AOwner: TPersistent); +begin + inherited; + BitmapInViewParams := True; +end; + +function TcxGridChartSeriesStyles.GetSeries: TcxGridChartSeries; +begin + Result := TcxGridChartSeries(Owner); +end; + +procedure TcxGridChartSeriesStyles.SetOnGetValueStyle(Value: TcxGridChartSeriesGetValueStyleEvent); +begin + if @FOnGetValueStyle <> @Value then + begin + FOnGetValueStyle := Value; + Series.Changed(vcProperty); + end; +end; + +procedure TcxGridChartSeriesStyles.GetDefaultViewParams(Index: Integer; + AData: TObject; out AParams: TcxViewParams); +begin + inherited; + if Index = ssValues then + begin + if Integer(AData) = -1 then + AParams.Color := GetDefaultValueColor(Series.Order) + else + AParams.Color := GetDefaultValueColor(Integer(AData)); + AParams.TextColor := LookAndFeelPainter.DefaultChartDiagramValueBorderColor; + end; +end; + +function TcxGridChartSeriesStyles.GetGridView: TcxCustomGridView; +begin + Result := Series.GridView; +end; + +procedure TcxGridChartSeriesStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridChartSeriesStyles then + with TcxGridChartSeriesStyles(Source) do + begin + Self.Values := Values; + Self.OnGetValueStyle := OnGetValueStyle; + end; +end; + +procedure TcxGridChartSeriesStyles.GetValueParams(AValueIndex: Integer; + AVaryColorsByCategory: Boolean; out AParams: TcxViewParams); +var + AStyle: TcxStyle; +begin + AStyle := nil; + if (AValueIndex <> -1) and Assigned(FOnGetValueStyle) then + FOnGetValueStyle(Series, AValueIndex, AStyle); + if not AVaryColorsByCategory then AValueIndex := -1; + GetViewParams(ssValues, TObject(AValueIndex), AStyle, AParams); +end; + +{ TcxGridChartSeries } + +constructor TcxGridChartSeries.Create(AOwner: TComponent); +begin + inherited; + FStyles := GetStylesClass.Create(Self); +end; + +destructor TcxGridChartSeries.Destroy; +begin + FStyles.Free; + inherited; +end; + +function TcxGridChartSeries.GetGroupSummaryKind: TcxSummaryKind; +begin + Result := DataBinding.SummaryKind; +end; + +function TcxGridChartSeries.GetSumOfValues: Variant; +begin + Result := GridView.ViewData.SumOfValues[Index]; +end; + +procedure TcxGridChartSeries.SetGroupSummaryKind(Value: TcxSummaryKind); +begin + if IsGroupSummaryKindValid(Value) then + DataBinding.SummaryKind := Value; +end; + +procedure TcxGridChartSeries.SetStyles(Value: TcxGridChartSeriesStyles); +begin + FStyles.Assign(Value); +end; + +procedure TcxGridChartSeries.SetValueCaptionFormat(const Value: string); +begin + if FValueCaptionFormat <> Value then + begin + FValueCaptionFormat := Value; + Changed; + end; +end; + +procedure TcxGridChartSeries.SetOnCustomDrawValue(Value: TcxGridChartSeriesValueCustomDrawEvent); +begin + if @FOnCustomDrawValue <> @Value then + begin + FOnCustomDrawValue := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartSeries.SetOnValueClick(Value: TcxGridChartValueClickEvent); +begin + if @FOnValueClick <> @Value then + begin + FOnValueClick := Value; + Changed(vcProperty); + end; +end; + +function TcxGridChartSeries.GetStoredProperties(AProperties: TStrings): Boolean; +begin + AProperties.Add('SortOrder'); + Result := inherited GetStoredProperties(AProperties); +end; + +procedure TcxGridChartSeries.GetPropertyValue(const AName: string; var AValue: Variant); +begin + if AName = 'SortOrder' then + AValue := Variant(SortOrder) + else + inherited; +end; + +procedure TcxGridChartSeries.SetPropertyValue(const AName: string; const AValue: Variant); +begin + if AName = 'SortOrder' then + SortOrder := TcxDataSortOrder((AValue)) + else + inherited; +end; + +procedure TcxGridChartSeries.SetRestoredIndex(AValue: Integer); +begin + GridView.RestoringSeries[AValue] := Self; +end; + +procedure TcxGridChartSeries.DoGetValueDisplayText(const AValue: Variant; + var ADisplayText: string); +begin + if (ValueCaptionFormat <> '') and not VarIsNull(AValue) then + ADisplayText := FormatFloat(ValueCaptionFormat, AValue); + inherited; +end; + +function TcxGridChartSeries.GetDefaultValueTypeClass: TcxValueTypeClass; +begin + Result := TcxFloatValueType; +end; + +function TcxGridChartSeries.GetStylesClass: TcxGridChartSeriesStylesClass; +begin + Result := TcxGridChartSeriesStyles; +end; + +function TcxGridChartSeries.IsGroupSummaryKindValid(AValue: TcxSummaryKind): Boolean; +begin + Result := AValue <> skNone; +end; + +function TcxGridChartSeries.GetValue(AIndex: Integer): Variant; +begin + Result := GridView.ViewData.Values[Index, AIndex]; +end; + +function TcxGridChartSeries.GetValueCount: Integer; +begin + Result := GridView.ViewData.CategoryCount; +end; + +function TcxGridChartSeries.GetVisibleValue(AIndex: Integer): Variant; +begin + Result := GridView.ViewData.VisibleValues[Index, AIndex]; +end; + +function TcxGridChartSeries.GetVisibleValueCount: Integer; +begin + Result := GridView.ViewData.VisibleCategoryCount; +end; + +procedure TcxGridChartSeries.SetValue(AIndex: Integer; const Value: Variant); +begin + GridView.ViewData.Values[Index, AIndex] := Value; +end; + +procedure TcxGridChartSeries.SetValueCount(Value: Integer); +begin + GridView.ViewData.CategoryCount := Value; +end; + +procedure TcxGridChartSeries.DoCustomDrawValue(ACanvas: TcxCanvas; + AViewInfo: TcxGridChartDiagramValueViewInfo; var ADone: Boolean); +begin + if HasCustomDrawValue then + FOnCustomDrawValue(Self, ACanvas, AViewInfo, ADone); +end; + +function TcxGridChartSeries.DoValueClick(AValueIndex: Integer): Boolean; +begin + Result := False; + if Assigned(FOnValueClick) then + FOnValueClick(GridView, Self, AValueIndex, Result); + if not Result then + Result := GridView.DoValueClick(Self, AValueIndex); +end; + +function TcxGridChartSeries.HasCustomDrawValue: Boolean; +begin + Result := Assigned(FOnCustomDrawValue); +end; + +procedure TcxGridChartSeries.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridChartSeries then + with TcxGridChartSeries(Source) do + begin + Self.GroupSummaryKind := GroupSummaryKind; + Self.Styles := Styles; + Self.ValueCaptionFormat := ValueCaptionFormat; + Self.OnCustomDrawValue := OnCustomDrawValue; + Self.OnValueClick := OnValueClick; + end +end; + +function TcxGridChartSeries.AddValue(const AValue: Variant): Integer; +begin + ValueCount := ValueCount + 1; + Result := ValueCount - 1; + Values[Result] := AValue; +end; + +class function TcxGridChartSeries.IsValue: Boolean; +begin + Result := True; +end; + +{ TcxGridChartTitle } + +function TcxGridChartTitle.GetDefaultPosition: TcxGridChartPartPosition; +begin + Result := cppTop; +end; + +{ TcxGridChartToolBox } + +constructor TcxGridChartToolBox.Create(AGridView: TcxCustomGridView); +begin + inherited; + FBorder := tbSingle; + FDataLevelActiveValueDropDownCount := cxGridChartDefaultDataLevelActiveValueDropDownCount; + FDataLevelsInfoVisible := dlivNonEmpty; + FVisible := tvNonEmpty; +end; + +function TcxGridChartToolBox.GetGridView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +procedure TcxGridChartToolBox.SetBorder(Value: TcxGridChartToolBoxBorder); +begin + if FBorder <> Value then + begin + FBorder := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridChartToolBox.SetCustomizeButton(Value: Boolean); +begin + if FCustomizeButton <> Value then + begin + FCustomizeButton := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridChartToolBox.SetDataLevelActiveValueDropDownCount(Value: Integer); +begin + if Value < 0 then Value := 0; + if FDataLevelActiveValueDropDownCount <> Value then + begin + FDataLevelActiveValueDropDownCount := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartToolBox.SetDataLevelActiveValueDropDownWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FDataLevelActiveValueDropDownWidth <> Value then + begin + FDataLevelActiveValueDropDownWidth := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartToolBox.SetDataLevelsInfoVisible(Value: TcxGridChartDataLevelsInfoVisible); +begin + if FDataLevelsInfoVisible <> Value then + begin + FDataLevelsInfoVisible := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridChartToolBox.SetDiagramSelector(Value: Boolean); +begin + if FDiagramSelector <> Value then + begin + FDiagramSelector := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridChartToolBox.SetPosition(Value: TcxGridChartToolBoxPosition); +begin + if FPosition <> Value then + begin + FPosition := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridChartToolBox.SetVisible(Value: TcxGridChartToolBoxVisible); +begin + if FVisible <> Value then + begin + FVisible := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridChartToolBox.GetStoredProperties(AProperties: TStrings); +begin + AProperties.Add('ToolBox.Border'); + AProperties.Add('ToolBox.DiagramSelector'); + AProperties.Add('ToolBox.Position'); + inherited; +end; + +procedure TcxGridChartToolBox.GetStoredPropertyValue(const AName: string; + var AValue: Variant); +begin + if AName = 'ToolBox.Border' then + AValue := Variant(Border) + else + if AName = 'ToolBox.DiagramSelector' then + AValue := DiagramSelector + else + if AName = 'ToolBox.Position' then + AValue := Variant(Position); + inherited; +end; + +procedure TcxGridChartToolBox.SetStoredPropertyValue(const AName: string; + const AValue: Variant); +begin + if AName = 'ToolBox.Border' then + Border := TcxGridChartToolBoxBorder((AValue)) + else + if AName = 'ToolBox.DiagramSelector' then + DiagramSelector := AValue + else + if AName = 'ToolBox.Position' then + Position := TcxGridChartToolBoxPosition((AValue)); + inherited; +end; + +function TcxGridChartToolBox.IsDataLevelsInfoNonEmpty: Boolean; +begin + Result := GridView.IsDataGrouped; +end; + +function TcxGridChartToolBox.IsNonEmpty: Boolean; +begin + Result := GetDataLevelsInfoVisible or CustomizeButton or DiagramSelector; +end; + +procedure TcxGridChartToolBox.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridChartToolBox then + with TcxGridChartToolBox(Source) do + begin + Self.Border := Border; + Self.CustomizeButton := CustomizeButton; + Self.DataLevelActiveValueDropDownCount := DataLevelActiveValueDropDownCount; + Self.DataLevelActiveValueDropDownWidth := DataLevelActiveValueDropDownWidth; + Self.DataLevelsInfoVisible := DataLevelsInfoVisible; + Self.DiagramSelector := DiagramSelector; + Self.Position := Position; + Self.Visible := Visible; + end; +end; + +function TcxGridChartToolBox.GetDataLevelsInfoVisible: Boolean; +begin + Result := (FDataLevelsInfoVisible = dlivAlways) or + (FDataLevelsInfoVisible = dlivNonEmpty) and IsDataLevelsInfoNonEmpty; +end; + +function TcxGridChartToolBox.GetVisible: Boolean; +begin + Result := (FVisible = tvAlways) or (FVisible = tvNonEmpty) and IsNonEmpty; +end; + +{ TcxGridChartOptionsBehavior } + +constructor TcxGridChartOptionsBehavior.Create(AGridView: TcxCustomGridView); +begin + inherited; + FValueHints := True; +end; + +function TcxGridChartOptionsBehavior.GetGridView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +procedure TcxGridChartOptionsBehavior.SetValueHints(Value: Boolean); +begin + if FValueHints <> Value then + begin + FValueHints := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartOptionsBehavior.SetValueHotTrack(Value: TcxGridChartValueHotTrack); +begin + if FValueHotTrack <> Value then + begin + FValueHotTrack := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridChartOptionsBehavior.GetStoredProperties(AProperties: TStrings); +begin + AProperties.Add('OptionsBehavior.ValueHints'); + inherited; +end; + +procedure TcxGridChartOptionsBehavior.GetStoredPropertyValue(const AName: string; + var AValue: Variant); +begin + if AName = 'OptionsBehavior.ValueHints' then + AValue := ValueHints; + inherited; +end; + +procedure TcxGridChartOptionsBehavior.SetStoredPropertyValue(const AName: string; + const AValue: Variant); +begin + if AName = 'OptionsBehavior.ValueHints' then + ValueHints := AValue; + inherited; +end; + +function TcxGridChartOptionsBehavior.GetDefaultValueHotTrack(AValueIndex: Integer): Boolean; +begin + Result := GridView.Controller.IsDataDrillDownPossible(AValueIndex); +end; + +procedure TcxGridChartOptionsBehavior.Assign(Source: TPersistent); +begin + if Source is TcxGridChartOptionsBehavior then + with TcxGridChartOptionsBehavior(Source) do + begin + Self.ValueHints := ValueHints; + Self.ValueHotTrack := ValueHotTrack; + end; + inherited; +end; + +function TcxGridChartOptionsBehavior.GetValueHotTrack(AValueIndex: Integer): Boolean; +begin + Result := GridView.ActiveDiagram.SupportsValueHotTrack and + ((FValueHotTrack = vhAlways) or + (FValueHotTrack = vhDefault) and GetDefaultValueHotTrack(AValueIndex)); +end; + +{ TcxGridChartOptionsCustomize } + +constructor TcxGridChartOptionsCustomize.Create(AGridView: TcxCustomGridView); +begin + inherited; + FDataDrillDown := True; + FDataDrillUpMethod := ddumMouseRightButtonClick; + FDataGroupMoving := True; + FOptionsCustomization := True; + FSeriesCustomization := True; +end; + +procedure TcxGridChartOptionsCustomize.SetDataDrillDown(Value: Boolean); +begin + if FDataDrillDown <> Value then + begin + FDataDrillDown := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridChartOptionsCustomize.SetDataDrillUpMethod(Value: TcxGridChartDataDrillUpMethod); +begin + if FDataDrillUpMethod <> Value then + begin + FDataDrillUpMethod := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartOptionsCustomize.SetDataGroupHiding(Value: Boolean); +begin + if FDataGroupHiding <> Value then + begin + FDataGroupHiding := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartOptionsCustomize.SetDataGroupMoving(Value: Boolean); +begin + if FDataGroupMoving <> Value then + begin + FDataGroupMoving := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartOptionsCustomize.SetOptionsCustomization(Value: Boolean); +begin + if FOptionsCustomization <> Value then + begin + FOptionsCustomization := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartOptionsCustomize.SetSeriesCustomization(Value: Boolean); +begin + if FSeriesCustomization <> Value then + begin + FSeriesCustomization := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartOptionsCustomize.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridChartOptionsCustomize then + with TcxGridChartOptionsCustomize(Source) do + begin + Self.DataDrillDown := DataDrillDown; + Self.DataDrillUpMethod := DataDrillUpMethod; + Self.DataGroupHiding := DataGroupHiding; + Self.DataGroupMoving := DataGroupMoving; + Self.OptionsCustomization := OptionsCustomization; + Self.SeriesCustomization := SeriesCustomization; + end; +end; + +{ TcxGridChartOptionsView } + +{constructor TcxGridChartOptionsView.Create(AGridView: TcxCustomGridView); +begin + inherited; +end;} + +function TcxGridChartOptionsView.GetGridView: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +procedure TcxGridChartOptionsView.SetCategoriesPerPage(Value: Integer); +begin + if Value < 0 then Value := 0; + if FCategoriesPerPage <> Value then + begin + FCategoriesPerPage := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridChartOptionsView.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridChartOptionsView then + with TcxGridChartOptionsView(Source) do + begin + Self.CategoriesPerPage := CategoriesPerPage; + end; +end; + +{ TcxGridChartViewStyles } + +constructor TcxGridChartViewStyles.Create(AOwner: TPersistent); +begin + inherited; + BitmapInViewParams := True; +end; + +procedure TcxGridChartViewStyles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +begin + inherited; + with AParams, LookAndFeelPainter do + case Index of + vsActiveDataLevelInfo: + begin + GetViewParams(vsDataLevelsInfo, nil, nil, AParams); + Bitmap := nil; + Color := DefaultSelectionColor; + TextColor := DefaultSelectionTextColor; + end; + vsDataLevelActiveValueInfo: + begin + GetViewParams(vsDataLevelsInfo, nil, nil, AParams); + if GridView.Controller.CanShowDataLevelActiveValuePopup(False) then + TextColor := DefaultHyperlinkTextColor; + end; + vsDataLevelsInfo: + GetViewParams(vsToolBox, nil, nil, AParams); + vsDiagramSelector: + begin + GetViewParams(vsToolBox, nil, nil, AParams); + TextColor := DefaultHyperlinkTextColor; + end; + vsLegend, vsToolBox: + begin + Color := DefaultContentColor; + TextColor := DefaultContentTextColor; + end; + vsTitle: + TextColor := DefaultContentTextColor; + end; +end; + +function TcxGridChartViewStyles.GetGridViewValue: TcxGridChartView; +begin + Result := TcxGridChartView(inherited GridView); +end; + +procedure TcxGridChartViewStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridChartViewStyles then + with TcxGridChartViewStyles(Source) do + begin + Self.ActiveDataLevelInfo := ActiveDataLevelInfo; + Self.DataLevelActiveValueInfo := DataLevelActiveValueInfo; + Self.DataLevelsInfo := DataLevelsInfo; + Self.DiagramSelector := DiagramSelector; + Self.Legend := Legend; + Self.Title := Title; + Self.ToolBox := ToolBox; + end; +end; + +procedure TcxGridChartViewStyles.GetDataLevelInfoParams(ADataLevel: Integer; + out AParams: TcxViewParams); +begin + if GridView.ActiveDataLevel = ADataLevel then + GetViewParams(vsActiveDataLevelInfo, nil, nil, AParams) + else + GetViewParams(vsDataLevelsInfo, nil, nil, AParams); +end; + +{ TcxGridOpenChartItemList } + +function TcxGridOpenChartItemList.GetItem(Index: Integer): TcxGridChartItem; +begin + Result := TcxGridChartItem(inherited Items[Index]); +end; + +procedure TcxGridOpenChartItemList.SetItem(Index: Integer; Value: TcxGridChartItem); +begin + inherited Items[Index] := Value; +end; + +{ TcxGridChartView } + +function TcxGridChartView.GetActiveDataGroup: TcxGridChartDataGroup; +begin + if ActiveDataLevel < DataLevelCount - 1 then + Result := VisibleDataGroups[ActiveDataLevel] + else + Result := nil; +end; + +function TcxGridChartView.GetAvailableDiagramCount: Integer; +begin + Result := FAvailableDiagrams.Count; +end; + +function TcxGridChartView.GetAvailableDiagram(Index: Integer): TcxGridChartDiagram; +begin + Result := TcxGridChartDiagram(FAvailableDiagrams[Index]); +end; + +function TcxGridChartView.GetController: TcxGridChartController; +begin + Result := TcxGridChartController(inherited Controller); +end; + +function TcxGridChartView.GetDataController: TcxGridChartDataController; +begin + Result := TcxGridChartDataController(FDataController); +end; + +function TcxGridChartView.GetDataGroup(Index: Integer): TcxGridChartDataGroup; +begin + Result := TcxGridChartDataGroup(FDataGroups[Index]); +end; + +function TcxGridChartView.GetDataGroupCount: Integer; +begin + Result := FDataGroups.Count; +end; + +function TcxGridChartView.GetDiagram(Index: Integer): TcxGridChartDiagram; +begin + Result := TcxGridChartDiagram(FDiagrams[Index]); +end; + +function TcxGridChartView.GetDiagramCount: Integer; +begin + Result := FDiagrams.Count; +end; + +function TcxGridChartView.GetItem(Index: Integer): IcxGridChartItem; +begin + FDataController.GetItem(Index).GetInterface(IcxGridChartItem, Result); +end; + +function TcxGridChartView.GetItemCount: Integer; +begin + Result := FDataController.ItemCount; +end; + +function TcxGridChartView.GetOptionsBehavior: TcxGridChartOptionsBehavior; +begin + Result := TcxGridChartOptionsBehavior(inherited OptionsBehavior); +end; + +function TcxGridChartView.GetOptionsView: TcxGridChartOptionsView; +begin + Result := TcxGridChartOptionsView(inherited OptionsView); +end; + +function TcxGridChartView.GetSeries(Index: Integer): TcxGridChartSeries; +begin + Result := TcxGridChartSeries(FSeries[Index]); +end; + +function TcxGridChartView.GetSeriesCount: Integer; +begin + Result := FSeries.Count; +end; + +function TcxGridChartView.GetSortedSeries: TcxGridChartSeries; +var + I: Integer; +begin + for I := 0 to SeriesCount - 1 do + begin + Result := Series[I]; + if Result.SortOrder <> soNone then Exit; + end; + Result := nil; +end; + +function TcxGridChartView.GetStyles: TcxGridChartViewStyles; +begin + Result := TcxGridChartViewStyles(inherited Styles); +end; + +function TcxGridChartView.GetViewData: TcxGridChartViewData; +begin + Result := TcxGridChartViewData(inherited ViewData); +end; + +function TcxGridChartView.GetViewInfo: TcxGridChartViewInfo; +begin + Result := TcxGridChartViewInfo(inherited ViewInfo); +end; + +function TcxGridChartView.GetVisibleDataGroup(Index: Integer): TcxGridChartDataGroup; +begin + Result := TcxGridChartDataGroup(FVisibleDataGroups[Index]); +end; + +function TcxGridChartView.GetVisibleDataGroupCount: Integer; +begin + Result := FVisibleDataGroups.Count; +end; + +function TcxGridChartView.GetVisibleSeries(Index: Integer): TcxGridChartSeries; +begin + Result := TcxGridChartSeries(FVisibleSeries[Index]); +end; + +function TcxGridChartView.GetVisibleSeriesCount: Integer; +begin + Result := FVisibleSeries.Count; +end; + +procedure TcxGridChartView.SetActiveDataGroup(Value: TcxGridChartDataGroup); +begin + if Value = nil then + ActiveDataLevel := DataLevelCount - 1 + else + if Value.Visible then + ActiveDataLevel := Value.VisibleIndex; +end; + +procedure TcxGridChartView.SetActiveDataLevel(Value: Integer); +var + APrevActiveDataLevel: Integer; +begin + if Value < 0 then Value := 0; + if Value > DataLevelCount - 1 then Value := DataLevelCount - 1; + Value := GetAvailableDataLevel(Value); + if FActiveDataLevel <> Value then + begin + APrevActiveDataLevel := FActiveDataLevel; + FActiveDataLevel := Value; + ViewData.DataLevelsChanged; + Changed(vcLayout); + ActiveDataLevelChanged(APrevActiveDataLevel); + end; +end; + +procedure TcxGridChartView.SetActiveDiagram(Value: TcxGridChartDiagram); +begin + if Value = nil then + Value := GetFirstAvailableDiagram; + if (FActiveDiagram <> Value) and ((Value = nil) or Value.IsAvailable) then + begin + FActiveDiagram := Value; + Changed(vcLayout); + ActiveDiagramChanged(FActiveDiagram); + end; +end; + +procedure TcxGridChartView.SetCategories(Value: TcxGridChartCategories); +begin + FCategories.Assign(Value); +end; + +procedure TcxGridChartView.SetDataController(Value: TcxGridChartDataController); +begin + FDataController.Assign(Value); +end; + +procedure TcxGridChartView.SetDataGroup(Index: Integer; Value: TcxGridChartDataGroup); +begin + DataGroups[Index].Assign(Value); +end; + +procedure TcxGridChartView.SetDiagramArea(Value: TcxGridChartAreaDiagram); +begin + FDiagramArea.Assign(Value); +end; + +procedure TcxGridChartView.SetDiagramBar(Value: TcxGridChartBarDiagram); +begin + FDiagramBar.Assign(Value); +end; + +procedure TcxGridChartView.SetDiagramColumn(Value: TcxGridChartColumnDiagram); +begin + FDiagramColumn.Assign(Value); +end; + +procedure TcxGridChartView.SetDiagramLine(Value: TcxGridChartLineDiagram); +begin + FDiagramLine.Assign(Value); +end; + +procedure TcxGridChartView.SetDiagramPie(Value: TcxGridChartPieDiagram); +begin + FDiagramPie.Assign(Value); +end; + +procedure TcxGridChartView.SetLegend(Value: TcxGridChartLegend); +begin + FLegend.Assign(Value); +end; + +procedure TcxGridChartView.SetOptionsBehavior(Value: TcxGridChartOptionsBehavior); +begin + inherited OptionsBehavior := Value; +end; + +procedure TcxGridChartView.SetOptionsCustomize(Value: TcxGridChartOptionsCustomize); +begin + FOptionsCustomize.Assign(Value); +end; + +procedure TcxGridChartView.SetOptionsView(Value: TcxGridChartOptionsView); +begin + inherited OptionsView := Value; +end; + +procedure TcxGridChartView.SetSeries(Index: Integer; Value: TcxGridChartSeries); +begin + Series[Index].Assign(Value); +end; + +procedure TcxGridChartView.SetSortedSeries(Value: TcxGridChartSeries); +begin + if SortedSeries <> Value then + if Value = nil then + SortedSeries.SortOrder := soNone + else + Value.SortOrder := soAscending; +end; + +procedure TcxGridChartView.SetStyles(Value: TcxGridChartViewStyles); +begin + inherited Styles := Value; +end; + +procedure TcxGridChartView.SetTitle(Value: TcxGridChartTitle); +begin + FTitle.Assign(Value); +end; + +procedure TcxGridChartView.SetToolBox(Value: TcxGridChartToolBox); +begin + FToolBox.Assign(Value); +end; + +procedure TcxGridChartView.SetOnActiveDataLevelChanged(Value: TNotifyEvent); +begin + if @FOnActiveDataLevelChanged <> @Value then + begin + FOnActiveDataLevelChanged := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartView.SetOnActiveDiagramChanged(Value: TcxGridChartDiagramEvent); +begin + if @FOnActiveDiagramChanged <> @Value then + begin + FOnActiveDiagramChanged := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartView.SetOnCustomDrawLegend(Value: TcxGridChartLegendCustomDrawEvent); +begin + if @FOnCustomDrawLegend <> @Value then + begin + FOnCustomDrawLegend := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartView.SetOnCustomDrawLegendItem(Value: TcxGridChartLegendItemCustomDrawEvent); +begin + if @FOnCustomDrawLegendItem <> @Value then + begin + FOnCustomDrawLegendItem := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartView.SetOnDataGroupPosChanged(Value: TcxGridChartDataGroupEvent); +begin + if @FOnDataGroupPosChanged <> @Value then + begin + FOnDataGroupPosChanged := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartView.SetOnFirstVisibleCategoryIndexChanged(Value: TNotifyEvent); +begin + if @FOnFirstVisibleCategoryIndexChanged <> @Value then + begin + FOnFirstVisibleCategoryIndexChanged := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartView.SetOnGetValueHint(Value: TcxGridChartGetValueHintEvent); +begin + if @FOnGetValueHint <> @Value then + begin + FOnGetValueHint := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartView.SetOnSeriesPosChanged(Value: TcxGridChartSeriesEvent); +begin + if @FOnSeriesPosChanged <> @Value then + begin + FOnSeriesPosChanged := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridChartView.SetOnValueClick(Value: TcxGridChartValueClickEvent); +begin + if @FOnValueClick <> @Value then + begin + FOnValueClick := Value; + Changed(vcProperty); + end; +end; + +function TcxGridChartView.GetProperties(AProperties: TStrings): Boolean; +begin + AProperties.Add('ActiveDataLevel'); + AProperties.Add('ActiveDiagram'); + Legend.GetStoredProperties(AProperties); + OptionsBehavior.GetStoredProperties(AProperties); + Title.GetStoredProperties(AProperties); + ToolBox.GetStoredProperties(AProperties); + Result := inherited GetProperties(AProperties); +end; + +procedure TcxGridChartView.GetPropertyValue(const AName: string; var AValue: Variant); +begin + if AName = 'ActiveDataLevel' then + AValue := ActiveDataLevel + else + if AName = 'ActiveDiagram' then + if ActiveDiagram = nil then + AValue := '' + else + AValue := ActiveDiagram.ID + else + begin + Legend.GetStoredPropertyValue(AName, AValue); + OptionsBehavior.GetStoredPropertyValue(AName, AValue); + Title.GetStoredPropertyValue(AName, AValue); + ToolBox.GetStoredPropertyValue(AName, AValue); + end; + inherited; +end; + +procedure TcxGridChartView.SetPropertyValue(const AName: string; const AValue: Variant); +var + ADiagram: TcxGridChartDiagram; +begin + if AName = 'ActiveDataLevel' then + FRestoredActiveDataLevel := AValue + else + if AName = 'ActiveDiagram' then + begin + ADiagram := FindDiagramByID(AValue); + if ADiagram <> nil then + ADiagram.Active := True; + end + else + begin + Legend.SetStoredPropertyValue(AName, AValue); + OptionsBehavior.SetStoredPropertyValue(AName, AValue); + Title.SetStoredPropertyValue(AName, AValue); + ToolBox.SetStoredPropertyValue(AName, AValue); + end; + inherited; +end; + +function TcxGridChartView.CreateStoredObject(const AObjectName, AClassName: string): TObject; +begin + if AClassName = GetDataGroupClass.ClassName then + Result := CreateDataGroup + else + if AClassName = GetSeriesClass.ClassName then + Result := CreateSeries + else + Result := inherited CreateStoredObject(AObjectName, AClassName); +end; + +procedure TcxGridChartView.GetStoredChildren(AChildren: TStringList); +var + I: Integer; +begin + for I := 0 to DataGroupCount - 1 do + AChildren.AddObject('', DataGroups[I]); + for I := 0 to SeriesCount - 1 do + AChildren.AddObject('', Series[I]); + inherited; +end; + +procedure TcxGridChartView.AssignLayout(ALayoutView: TcxCustomGridView); +begin + inherited; + Assign(ALayoutView); +end; + +function TcxGridChartView.GetLayoutCustomizationFormButtonCaption: string; +begin + Result := 'Chart customization'; +end; + +function TcxGridChartView.HasLayoutCustomizationForm: Boolean; +begin + Result := True; +end; + +procedure TcxGridChartView.CreateHandlers; +begin + FCategories := GetCategoriesClass.Create(Self); + FDiagrams := TList.Create; + FAvailableDiagrams := TList.Create; + FDataGroups := TList.Create; + FSeries := TList.Create; + FVisibleDataGroups := TList.Create; + FVisibleSeries := TList.Create; + CreateDiagrams; + inherited; + UpdateDataController(FCategories, FCategories.DataBinding, True); +end; + +procedure TcxGridChartView.DestroyHandlers; +begin + ClearDiagrams; + ClearDataGroups; + ClearSeries; + UpdateDataController(FCategories, FCategories.DataBinding, False); + inherited; + FreeAndNil(FVisibleSeries); + FreeAndNil(FVisibleDataGroups); + FreeAndNil(FSeries); + FreeAndNil(FDataGroups); + FreeAndNil(FAvailableDiagrams); + FreeAndNil(FDiagrams); + FreeAndNil(FCategories); +end; + +procedure TcxGridChartView.CreateOptions; +begin + inherited; + FLegend := GetLegendClass.Create(Self); + FOptionsCustomize := GetOptionsCustomizeClass.Create(Self); + FTitle := GetTitleClass.Create(Self); + FToolBox := GetToolBoxClass.Create(Self); +end; + +procedure TcxGridChartView.DestroyOptions; +begin + FreeAndNil(FToolBox); + FreeAndNil(FTitle); + FreeAndNil(FOptionsCustomize); + FreeAndNil(FLegend); + inherited; +end; + +procedure TcxGridChartView.ActiveDataLevelChanged(APrevActiveDataLevel: Integer); +begin + if IsDestroying then Exit; + DoActiveDataLevelChanged; + Controller.ActiveDataLevelChanged(APrevActiveDataLevel, ActiveDataLevel); +end; + +procedure TcxGridChartView.ActiveDiagramChanged(ADiagram: TcxGridChartDiagram); +begin + if IsDestroying then Exit; + DoActiveDiagramChanged(ADiagram); + if Controller <> nil then + Controller.ActiveDiagramChanged(ADiagram); +end; + +procedure TcxGridChartView.BeforeAssign(ASource: TcxCustomGridView); +begin + inherited; + UpdateSummaryItemValues; +end; + +procedure TcxGridChartView.AfterAssign(ASource: TcxCustomGridView); +begin + inherited; + UpdateSummaryItemValues; +end; + +procedure TcxGridChartView.DoAssign(ASource: TcxCustomGridView); + + procedure AssignItems(ASource: TcxGridChartView; AItemClass: TcxGridChartItemClass); + var + ASourceItems, AItems: TList; + I: Integer; + ASourceItem, AItem: TcxGridChartItem; + begin + ASourceItems := ASource.GetItemList(AItemClass); + for I := 0 to ASourceItems.Count - 1 do + begin + ASourceItem := TcxGridChartItem(ASourceItems[I]); + AItem := FindItemByID(AItemClass, ASourceItem.ID); + if AItem = nil then + begin + AItem := CreateItem(AItemClass); + AItem.DataBinding.ID := ASourceItem.ID; + end; + AItem.FOrder := ASourceItem.Order; + AItem.Index := I; + AItem.Assign(ASourceItem); + end; + AItems := GetItemList(AItemClass); + for I := AItems.Count - 1 downto ASourceItems.Count do + TcxGridChartItem(AItems[I]).Free; + end; + +begin + if ASource is TcxGridChartView then + begin + if not AssigningSettings then + begin + Categories := TcxGridChartView(ASource).Categories; + Categories.DataBinding.ID := TcxGridChartView(ASource).Categories.ID; + AssignItems(TcxGridChartView(ASource), GetDataGroupClass); + AssignItems(TcxGridChartView(ASource), GetSeriesClass); + FNextID := TcxGridChartView(ASource).FNextID; + end; + with TcxGridChartView(ASource) do + begin + Self.DiagramArea := DiagramArea; + Self.DiagramBar := DiagramBar; + Self.DiagramColumn := DiagramColumn; + Self.DiagramLine := DiagramLine; + Self.DiagramPie := DiagramPie; + Self.Legend := Legend; + Self.OptionsCustomize := OptionsCustomize; + Self.Title := Title; + Self.ToolBox := ToolBox; + Self.OnActiveDataLevelChanged := OnActiveDataLevelChanged; + Self.OnActiveDiagramChanged := OnActiveDiagramChanged; + Self.OnCustomDrawLegend := OnCustomDrawLegend; + Self.OnCustomDrawLegendItem := OnCustomDrawLegendItem; + Self.OnDataGroupPosChanged := OnDataGroupPosChanged; + Self.OnFirstVisibleCategoryIndexChanged := OnFirstVisibleCategoryIndexChanged; + Self.OnGetValueHint := OnGetValueHint; + Self.OnSeriesPosChanged := OnSeriesPosChanged; + Self.OnValueClick := OnValueClick; + end; + end; + inherited; +end; + +procedure TcxGridChartView.BeforeRestoring; +begin + inherited; + FRestoringDataGroups := TcxGridOpenChartItemList.Create; + FRestoringSeries := TcxGridOpenChartItemList.Create; +end; + +procedure TcxGridChartView.AfterRestoring; + + procedure AssignItemIndexes(AItems: TcxGridOpenChartItemList); + var + I: Integer; + begin + for I := 0 to AItems.Count - 1 do + if AItems[I] <> nil then + AItems[I].Index := I; + end; + +begin + try + AssignItemIndexes(RestoringDataGroups); + AssignItemIndexes(RestoringSeries); + finally + FRestoringSeries.Free; + FRestoringDataGroups.Free; + inherited; + end; +end; + +procedure TcxGridChartView.DataControllerUnlocked; +begin + if DataGroupActiveValuesUpdateNeeded then + UpdateDataGroupActiveValues; +end; + +procedure TcxGridChartView.GetChildren(Proc: TGetChildProc; Root: TComponent); +var + I: Integer; +begin + inherited; + for I := 0 to DataGroupCount - 1 do + if DataGroups[I].Owner = Root then Proc(DataGroups[I]); + for I := 0 to SeriesCount - 1 do + if Series[I].Owner = Root then Proc(Series[I]); +end; + +procedure TcxGridChartView.GetFakeComponentLinks(AList: TList); +var + I: Integer; +begin + inherited; + for I := 0 to DiagramCount - 1 do + Diagrams[I].Styles.GetFakeComponentLinks(AList); + for I := 0 to SeriesCount - 1 do + Series[I].Styles.GetFakeComponentLinks(AList); +end; + +procedure TcxGridChartView.RestoringComplete; +begin + inherited; + ActiveDataLevel := FRestoredActiveDataLevel; +end; + +procedure TcxGridChartView.SetChildOrder(Child: TComponent; Order: Integer); +begin + inherited; + if Child is GetDataGroupClass then + TcxGridChartDataGroup(Child).Index := Order; + if Child is GetSeriesClass then + TcxGridChartSeries(Child).Index := Order - DataGroupCount; +end; + +function ChartViewGetDataGroup(ACaller: TComponent; Index: Integer): TComponent; +begin + Result := TcxGridChartView(ACaller).DataGroups[Index]; +end; + +function ChartViewGetSeries(ACaller: TComponent; Index: Integer): TComponent; +begin + Result := TcxGridChartView(ACaller).Series[Index]; +end; + +procedure TcxGridChartView.SetName(const NewName: TComponentName); +var + AOldName: TComponentName; +begin + AOldName := Name; + inherited; + if Name <> AOldName then + begin + RenameComponents(Self, Owner, Name, AOldName, DataGroupCount, @ChartViewGetDataGroup); + RenameComponents(Self, Owner, Name, AOldName, SeriesCount, @ChartViewGetSeries); + end; +end; + +procedure TcxGridChartView.UpdateControl(AInfo: TcxUpdateControlInfo); +var + I: Integer; +begin + ViewData.Update(AInfo); + if not (IsLoading or IsDestroying) and + not (AInfo is TcxFocusedRecordChangedInfo) and not (AInfo is TcxFocusedRowChangedInfo) then + begin + LayoutChanged; + if (AInfo is TcxDataChangedInfo) or (AInfo is TcxLayoutChangedInfo) then + begin + Synchronize; + if AInfo is TcxDataChangedInfo then + for I := 0 to ItemCount - 1 do + Items[I].DataChanged; + end; + end; + inherited; +end; + +function TcxGridChartView.GetControllerClass: TcxCustomGridControllerClass; +begin + Result := TcxGridChartController; +end; + +function TcxGridChartView.GetDataControllerClass: TcxCustomDataControllerClass; +begin + Result := TcxGridChartDataController; +end; + +function TcxGridChartView.GetItemDataBindingClass: TcxGridChartItemDataBindingClass; +begin + Result := TcxGridChartItemDataBinding; +end; + +function TcxGridChartView.GetPainterClass: TcxCustomGridPainterClass; +begin + Result := TcxGridChartPainter; +end; + +function TcxGridChartView.GetViewDataClass: TcxCustomGridViewDataClass; +begin + Result := TcxGridChartViewData; +end; + +function TcxGridChartView.GetViewInfoClass: TcxCustomGridViewInfoClass; +begin + Result := TcxGridChartViewInfo; +end; + +function TcxGridChartView.GetLegendClass: TcxGridChartLegendClass; +begin + Result := TcxGridChartLegend; +end; + +function TcxGridChartView.GetOptionsBehaviorClass: TcxCustomGridOptionsBehaviorClass; +begin + Result := TcxGridChartOptionsBehavior; +end; + +function TcxGridChartView.GetOptionsCustomizeClass: TcxGridChartOptionsCustomizeClass; +begin + Result := TcxGridChartOptionsCustomize; +end; + +function TcxGridChartView.GetOptionsViewClass: TcxCustomGridOptionsViewClass; +begin + Result := TcxGridChartOptionsView; +end; + +function TcxGridChartView.GetStylesClass: TcxCustomGridViewStylesClass; +begin + Result := TcxGridChartViewStyles; +end; + +function TcxGridChartView.GetTitleClass: TcxGridChartTitleClass; +begin + Result := TcxGridChartTitle; +end; + +function TcxGridChartView.GetToolBoxClass: TcxGridChartToolBoxClass; +begin + Result := TcxGridChartToolBox; +end; + +function TcxGridChartView.GetAreaDiagramClass: TcxGridChartAreaDiagramClass; +begin + Result := TcxGridChartAreaDiagram; +end; + +function TcxGridChartView.GetBarDiagramClass: TcxGridChartBarDiagramClass; +begin + Result := TcxGridChartBarDiagram; +end; + +function TcxGridChartView.GetCategoriesClass: TcxGridChartCategoriesClass; +begin + Result := TcxGridChartCategories; +end; + +function TcxGridChartView.GetColumnDiagramClass: TcxGridChartColumnDiagramClass; +begin + Result := TcxGridChartColumnDiagram; +end; + +function TcxGridChartView.GetLineDiagramClass: TcxGridChartLineDiagramClass; +begin + Result := TcxGridChartLineDiagram; +end; + +function TcxGridChartView.GetPieDiagramClass: TcxGridChartPieDiagramClass; +begin + Result := TcxGridChartPieDiagram; +end; + +function TcxGridChartView.GetCategoriesNamePath: string; +begin + Result := Name; + if Result <> '' then + Result := Result + '.'; + Result := Result + GetSubobjectName(Self, Categories); +end; + +procedure TcxGridChartView.AddDiagram(ADiagram: TcxGridChartDiagram); +begin + FDiagrams.Add(ADiagram); + if ADiagram.IsAvailable then + FAvailableDiagrams.Add(ADiagram); + ADiagram.SetGridView(Self); + if ActiveDiagram = nil then + ActiveDiagram := GetFirstAvailableDiagram; +end; + +procedure TcxGridChartView.RemoveDiagram(ADiagram: TcxGridChartDiagram); +begin + ADiagram.SetGridView(nil); + FAvailableDiagrams.Remove(ADiagram); + FDiagrams.Remove(ADiagram); + DiagramRemoved(ADiagram); + if ActiveDiagram = ADiagram then + ActiveDiagram := nil; +end; + +procedure TcxGridChartView.ClearDiagrams; +var + I: Integer; +begin + for I := DiagramCount - 1 downto 0 do + Diagrams[I].Free; +end; + +function TcxGridChartView.CreateDiagram(ADiagramClass: TcxGridChartDiagramClass): TcxGridChartDiagram; +begin + Result := ADiagramClass.Create(Self); +end; + +procedure TcxGridChartView.CreateDiagrams; +begin + FDiagramColumn := TcxGridChartColumnDiagram(CreateDiagram(GetColumnDiagramClass)); // should first to be default + FDiagramBar := TcxGridChartBarDiagram(CreateDiagram(GetBarDiagramClass)); + FDiagramLine := TcxGridChartLineDiagram(CreateDiagram(GetLineDiagramClass)); + FDiagramArea := TcxGridChartAreaDiagram(CreateDiagram(GetAreaDiagramClass)); + FDiagramPie := TcxGridChartPieDiagram(CreateDiagram(GetPieDiagramClass)); +end; + +procedure TcxGridChartView.DiagramRemoved(ADiagram: TcxGridChartDiagram); +begin + if ADiagram = FDiagramArea then + FDiagramArea := nil; + if ADiagram = FDiagramBar then + FDiagramBar := nil; + if ADiagram = FDiagramColumn then + FDiagramColumn := nil; + if ADiagram = FDiagramLine then + FDiagramLine := nil; + if ADiagram = FDiagramPie then + FDiagramPie := nil; +end; + +function TcxGridChartView.GetDiagramNamePath(ADiagram: TcxGridChartDiagram): string; +begin + Result := Name; + if Result <> '' then + Result := Result + '.'; + Result := Result + GetSubobjectName(Self, ADiagram); +end; + +function TcxGridChartView.GetFirstAvailableDiagram: TcxGridChartDiagram; +begin + if AvailableDiagramCount = 0 then + Result := nil + else + Result := AvailableDiagrams[0]; +end; + +procedure TcxGridChartView.RefreshAvailableDiagramList; +var + I: Integer; +begin + FAvailableDiagrams.Clear; + for I := 0 to DiagramCount - 1 do + if Diagrams[I].IsAvailable then + FAvailableDiagrams.Add(Diagrams[I]); +end; + +function TcxGridChartView.GetNextID: Integer; +begin + Result := FNextID; + Inc(FNextID); +end; + +procedure TcxGridChartView.ReleaseID(AID: Integer); +begin + if AID = FNextID - 1 then Dec(FNextID); +end; + +procedure TcxGridChartView.DataSortingChanged(AItem: TObject); +begin + if AItem is GetSeriesClass then + begin + if TcxGridChartSeries(AItem).SortOrder <> soNone then + TcxGridChartSeries(AItem).DataBinding.SortIndex := 0; + UpdateDataSortingBySummary; + RefreshCustomizationForm; + end; +end; + +procedure TcxGridChartView.DataSortingChanging(AItem: TObject); + + procedure ClearSeriesSorting; + var + I: Integer; + ASortedItem: TObject; + begin + for I := FDataController.GetSortingItemCount - 1 downto 0 do + begin + ASortedItem := FDataController.GetItem(FDataController.GetSortingItemIndex(I)); + if ASortedItem is GetSeriesClass then + TcxGridChartSeries(ASortedItem).SortOrder := soNone; + end; + end; + +begin + if (AItem is GetSeriesClass) and (TcxGridChartSeries(AItem).SortOrder = soNone) then + ClearSeriesSorting; +end; + +procedure TcxGridChartView.UpdateDataController(AItem: TObject; + ADataBinding: TcxGridChartItemDataBinding; AAdd: Boolean); +begin + BeginUpdate; + try + if AAdd then + begin + ADataBinding.ID := GetNextID; + ADataBinding.DataField := FDataController.AddItem(AItem); + end + else + begin + ReleaseID(ADataBinding.ID); + ADataBinding.DataField := nil; + FDataController.RemoveItem(AItem); + end; + finally + EndUpdate; + end; +end; + +procedure TcxGridChartView.UpdateSummaryItemValues; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + Items[I].GetDataBinding.UpdateSummaryItemValue; + UpdateDataSortingBySummary; +end; + +function TcxGridChartView.GetItemList(AItemClass: TcxGridChartItemClass): TList; +begin + if AItemClass = GetSeriesClass then + Result := FSeries + else + if AItemClass = GetDataGroupClass then + Result := FDataGroups + else + Result := nil; +end; + +function TcxGridChartView.GetItemList(AItem: TcxGridChartItem): TList; +begin + Result := GetItemList(TcxGridChartItemClass(AItem.ClassType)); +end; + +function TcxGridChartView.GetVisibleItemList(AItem: TcxGridChartItem): TList; +begin + if AItem is GetSeriesClass then + Result := FVisibleSeries + else + if AItem is GetDataGroupClass then + Result := FVisibleDataGroups + else + Result := nil; +end; + +procedure TcxGridChartView.AddItem(AItem: TcxGridChartItem); +begin +{$IFDEF DELPHI6} + if csTransient in ComponentStyle then + AItem.FComponentStyle := AItem.FComponentStyle + [csTransient]; +{$ENDIF} + BeginUpdate; + try + GetItemList(AItem).Add(AItem); + AItem.SetGridView(Self); + UpdateDataController(AItem, AItem.DataBinding, True); + ItemPosChanged(AItem); + if AItem.Visible then + ItemVisibilityChanged(AItem); + Changed(vcLayout); + finally + EndUpdate; + end; + RefreshCustomizationForm; +end; + +procedure TcxGridChartView.RemoveItem(AItem: TcxGridChartItem); +begin + BeginUpdate; + try + AItem.SetGridView(nil); + GetItemList(AItem).Remove(AItem); + if AItem.Visible then + ItemVisibilityChanged(AItem); + ItemPosChanged(AItem); + UpdateDataController(AItem, AItem.DataBinding, False); + Changed(vcLayout); + finally + EndUpdate; + end; + RefreshCustomizationForm; +end; + +function TcxGridChartView.GetItemIndex(AItem: TcxGridChartItem): Integer; +begin + Result := GetItemList(AItem).IndexOf(AItem); +end; + +procedure TcxGridChartView.SetItemIndex(AItem: TcxGridChartItem; AIndex: Integer); +begin + if GetItemIndex(AItem) <> AIndex then + begin + GetItemList(AItem).Move(GetItemIndex(AItem), AIndex); + ItemIndexChanged(AItem); + Changed(vcLayout); + RefreshCustomizationForm; + end; +end; + +procedure TcxGridChartView.DataGroupVisibilityChanged(ADataGroup: TcxGridChartDataGroup); +begin + UpdateDataLevels; +end; + +procedure TcxGridChartView.ItemDisplayTextChanged(AItem: TcxGridChartItem); +begin + RefreshCustomizationForm; +end; + +procedure TcxGridChartView.ItemIndexChanged(AItem: TcxGridChartItem); +begin + ItemPosChanged(AItem); + if AItem.Visible then + ItemVisibilityChanged(AItem); +end; + +procedure TcxGridChartView.ItemPosChanged(AItem: TcxGridChartItem); +begin + UpdateItemsOrder(TcxGridChartItemClass(AItem.ClassType)); + if AItem is GetSeriesClass then + begin + UpdateDataSortingBySummary; + ViewData.SeriesPosChanged(TcxGridChartSeries(AItem)); + end; +end; + +procedure TcxGridChartView.ItemVisibilityChanged(AItem: TcxGridChartItem); +begin + RefreshVisibleItemsList(GetItemList(AItem), GetVisibleItemList(AItem)); + if AItem is GetDataGroupClass then + DataGroupVisibilityChanged(TcxGridChartDataGroup(AItem)); + if AItem is GetSeriesClass then + SeriesVisibilityChanged(TcxGridChartSeries(AItem)); + RefreshCustomizationForm; +end; + +procedure TcxGridChartView.ItemVisibilityForCustomizationChanged(AItem: TcxGridChartItem); +begin + RefreshCustomizationForm; +end; + +procedure TcxGridChartView.SeriesVisibilityChanged(ASeries: TcxGridChartSeries); +begin +end; + +procedure TcxGridChartView.RefreshVisibleItemsList(AItems, AVisibleItems: TList); +var + I: Integer; + AItem: TcxGridChartItem; +begin + AVisibleItems.Clear; + for I := 0 to AItems.Count - 1 do + begin + AItem := TcxGridChartItem(AItems[I]); + if AItem.Visible then + AItem.FVisibleIndex := AVisibleItems.Add(AItem) + else + AItem.FVisibleIndex := -1; + end; +end; + +function CompareItemsByID(Item1, Item2: Pointer): Integer; +begin + Result := TcxGridChartItem(Item1).ID - TcxGridChartItem(Item2).ID; +end; + +procedure TcxGridChartView.UpdateItemsOrder(AItemClass: TcxGridChartItemClass); +var + AItems: TList; + I: Integer; +begin + AItems := TList.Create; + try + CopyList(GetItemList(AItemClass), AItems); + AItems.Sort(CompareItemsByID); + for I := 0 to AItems.Count - 1 do + TcxGridChartItem(AItems[I]).FOrder := I; + finally + AItems.Free; + end; +end; + +procedure TcxGridChartView.ClearItems(AItemClass: TcxGridChartItemClass); +var + AItems: TList; + I: Integer; +begin + AItems := GetItemList(AItemClass); + BeginUpdate; + try + for I := AItems.Count - 1 downto 0 do + TcxGridChartItem(AItems[I]).Free; + finally + EndUpdate; + end; +end; + +function TcxGridChartView.CreateItem(AItemClass: TcxGridChartItemClass): TcxGridChartItem; +begin + Result := AItemClass.Create(Owner); + AddItem(Result); +end; + +function TcxGridChartView.FindItemByID(AItemClass: TcxGridChartItemClass; + AID: Integer): TcxGridChartItem; +var + AItems: TList; + I: Integer; +begin + AItems := GetItemList(AItemClass); + for I := 0 to AItems.Count - 1 do + begin + Result := TcxGridChartItem(AItems[I]); + if Result.ID = AID then Exit; + end; + Result := nil; +end; + +function TcxGridChartView.FindItemByName(AItemClass: TcxGridChartItemClass; + const AName: string): TcxGridChartItem; +var + AItems: TList; + I: Integer; +begin + AItems := GetItemList(AItemClass); + for I := 0 to AItems.Count - 1 do + begin + Result := TcxGridChartItem(AItems[I]); + if Result.Name = AName then Exit; + end; + Result := nil; +end; + +function TcxGridChartView.FindItemByTag(AItemClass: TcxGridChartItemClass; + ATag: TcxTag): TcxGridChartItem; +var + AItems: TList; + I: Integer; +begin + AItems := GetItemList(AItemClass); + for I := 0 to AItems.Count - 1 do + begin + Result := TcxGridChartItem(AItems[I]); + if Result.Tag = ATag then Exit; + end; + Result := nil; +end; + +function TcxGridChartView.GetAvailableDataLevel(ALevel: Integer): Integer; +begin + for Result := 0 to ALevel - 1 do + if not DataLevelObjects[Result].HasActiveValue then Exit; + Result := ALevel; +end; + +function TcxGridChartView.GetDataLevelCount: Integer; +begin + Result := VisibleDataGroupCount + 1; +end; + +function TcxGridChartView.GetDataLevelObject(Index: Integer): TcxGridChartDataGroup; +begin + if Index < VisibleDataGroupCount then + Result := VisibleDataGroups[Index] + else + Result := nil; +end; + +function TcxGridChartView.GetDataObjectLevel(AObject: TcxGridChartDataGroup): Integer; +begin + Result := AObject.VisibleIndex; +end; + +procedure TcxGridChartView.SetDataObjectLevel(AObject: TcxGridChartDataGroup; ALevel: Integer); +begin + if ALevel = -1 then + AObject.Visible := False + else + if (0 <= ALevel) and (ALevel < VisibleDataGroupCount + Ord(not AObject.Visible)) then + begin + BeginUpdate; + try + AObject.Visible := True; + AObject.Index := DataLevelObjects[ALevel].Index; + finally + EndUpdate; + end; + end; +end; + +function TcxGridChartView.GetIsDataGrouped: Boolean; +begin + Result := VisibleDataGroupCount <> 0; +end; + +procedure TcxGridChartView.UpdateDataGroupActiveValues; +var + I: Integer; +begin + if FDataController.LockCount <> 0 then + begin + FDataGroupActiveValuesUpdateNeeded := True; + Exit; + end; + FDataGroupActiveValuesUpdateNeeded := False; + + for I := 0 to DataGroupCount - 1 do + DataGroups[I].CheckActiveValue; + ActiveDataLevel := ActiveDataLevel; +end; + +procedure TcxGridChartView.UpdateDataLevels; +var + I: Integer; +begin + BeginUpdate; + try +// ActiveDataLevel := ActiveDataLevel; + FDataController.Groups.ClearGrouping; + for I := 0 to VisibleDataGroupCount - 1 do + VisibleDataGroups[I].GroupIndex := I; + UpdateDataGroupActiveValues; + Controller.DataLevelsChanged; + finally + EndUpdate; + end; +end; + +procedure TcxGridChartView.UpdateDataSortingBySummary; +var + ASeries: TcxGridChartSeries; +begin + ASeries := SortedSeries; + if ASeries = nil then + FDataController.SortingBySummaryDataItemIndex := -1 + else + FDataController.SortingBySummaryDataItemIndex := ASeries.DataBinding.DataIndex; +end; + +procedure TcxGridChartView.CalculateImageWidth(var AWidth: Integer); +const + DefaultWidth = 700; +begin + if AWidth = 0 then + begin + if Control <> nil then + AWidth := Control.Width; + if AWidth = 0 then + AWidth := DefaultWidth; + end; +end; + +procedure TcxGridChartView.CalculateImageHeight(var AHeight: Integer); +const + DefaultHeight = 500; +begin + if AHeight = 0 then + begin + AHeight := TcxGridLevel(Level).Parent.MaxDetailHeight; + if AHeight = 0 then + begin + if Control <> nil then + AHeight := Control.Height; + if AHeight = 0 then + AHeight := DefaultHeight; + end; + end; +end; + +procedure TcxGridChartView.DoActiveDataLevelChanged; +begin + if Assigned(FOnActiveDataLevelChanged) then FOnActiveDataLevelChanged(Self); +end; + +procedure TcxGridChartView.DoActiveDiagramChanged(ADiagram: TcxGridChartDiagram); +begin + if Assigned(FOnActiveDiagramChanged) then FOnActiveDiagramChanged(Self, ADiagram); +end; + +procedure TcxGridChartView.DoCustomDrawLegend(ACanvas: TcxCanvas; + AViewInfo: TcxGridChartLegendViewInfo; var ADone: Boolean); +begin + if HasCustomDrawLegend then + FOnCustomDrawLegend(Self, ACanvas, AViewInfo, ADone); +end; + +procedure TcxGridChartView.DoCustomDrawLegendItem(ACanvas: TcxCanvas; + AViewInfo: TcxGridChartLegendItemViewInfo; var ADone: Boolean); +begin + if HasCustomDrawLegendItem then + FOnCustomDrawLegendItem(Self, ACanvas, AViewInfo, ADone); +end; + +procedure TcxGridChartView.DoDataGroupPosChanged(ADataGroup: TcxGridChartDataGroup); +begin + if Assigned(FOnDataGroupPosChanged) then FOnDataGroupPosChanged(Self, ADataGroup); +end; + +procedure TcxGridChartView.DoFirstVisibleCategoryIndexChanged; +begin + if Assigned(FOnFirstVisibleCategoryIndexChanged) then + FOnFirstVisibleCategoryIndexChanged(Self); +end; + +procedure TcxGridChartView.DoGetValueHint(ASeries: TcxGridChartSeries; AValueIndex: Integer; + var AHint: string); +begin + if Assigned(FOnGetValueHint) then + FOnGetValueHint(Self, ASeries, AValueIndex, AHint); +end; + +procedure TcxGridChartView.DoSeriesPosChanged(ASeries: TcxGridChartSeries); +begin + if Assigned(FOnSeriesPosChanged) then FOnSeriesPosChanged(Self, ASeries); +end; + +function TcxGridChartView.DoValueClick(ASeries: TcxGridChartSeries; AValueIndex: Integer): Boolean; +begin + Result := False; + if Assigned(FOnValueClick) then + FOnValueClick(Self, ASeries, AValueIndex, Result); +end; + +function TcxGridChartView.HasCustomDrawLegend: Boolean; +begin + Result := Assigned(FOnCustomDrawLegend); +end; + +function TcxGridChartView.HasCustomDrawLegendItem: Boolean; +begin + Result := Assigned(FOnCustomDrawLegendItem); +end; + +{$IFNDEF DELPHI6} + +type + TGraphicAccess = class(TGraphic); + TGraphicAccessClass = class of TGraphicAccess; + +{$ENDIF} + +function TcxGridChartView.CreateImage(AGraphicClass: TGraphicClass; + AWidth: Integer = 0; AHeight: Integer = 0): TGraphic; + + procedure DrawImage(AImageCanvas: TCanvas); + var + AViewInfo: TcxCustomGridViewInfo; + ACanvas: TcxCanvas; + begin + AViewInfo := CreateViewInfo; + try + AViewInfo.IsInternalUse := True; + (AViewInfo as TcxGridChartViewInfo).IsImage := True; + AViewInfo.MainCalculate(Rect(0, 0, AWidth, AHeight)); + ACanvas := TcxCanvas.Create(AImageCanvas); + try + Painter.Paint(ACanvas, AViewInfo); + finally + ACanvas.Free; + end; + finally + AViewInfo.Free; + end; + end; + +var + AMetaFileCanvas: TMetaFileCanvas; +begin + if IsPattern or + not (AGraphicClass.InheritsFrom(TMetafile) or AGraphicClass.InheritsFrom(TBitmap)) then + begin + Result := nil; + Exit; + end; + CalculateImageWidth(AWidth); + CalculateImageHeight(AHeight); + Result := {$IFNDEF DELPHI6}TGraphicAccessClass{$ENDIF}(AGraphicClass).Create; + Result.Width := AWidth; + Result.Height := AHeight; + if Result is TMetaFile then + begin + Result.Transparent := True; + AMetaFileCanvas := TMetaFileCanvas.Create(TMetaFile(Result), 0); + try + DrawImage(AMetaFileCanvas); + finally + AMetaFileCanvas.Free; + end; + end + else + DrawImage(TBitmap(Result).Canvas); +end; + +function TcxGridChartView.FindDiagramByDisplayText(const ADisplayText: string): TcxGridChartDiagram; +var + I: Integer; +begin + for I := 0 to DiagramCount - 1 do + begin + Result := Diagrams[I]; + if Result.DisplayText = ADisplayText then Exit; + end; + Result := nil; +end; + +function TcxGridChartView.FindDiagramByID(const AID: string): TcxGridChartDiagram; +var + I: Integer; +begin + for I := 0 to DiagramCount - 1 do + begin + Result := Diagrams[I]; + if Result.ID = AID then Exit; + end; + Result := nil; +end; + +procedure TcxGridChartView.ClearSeries; +begin + ClearItems(GetSeriesClass); +end; + +function TcxGridChartView.CreateSeries: TcxGridChartSeries; +begin + Result := TcxGridChartSeries(CreateItem(GetSeriesClass)); +end; + +function TcxGridChartView.FindSeriesByID(AID: Integer): TcxGridChartSeries; +begin + Result := TcxGridChartSeries(FindItemByID(GetSeriesClass, AID)); +end; + +function TcxGridChartView.FindSeriesByName(const AName: string): TcxGridChartSeries; +begin + Result := TcxGridChartSeries(FindItemByName(GetSeriesClass, AName)); +end; + +function TcxGridChartView.FindSeriesByTag(ATag: TcxTag): TcxGridChartSeries; +begin + Result := TcxGridChartSeries(FindItemByTag(GetSeriesClass, ATag)); +end; + +function TcxGridChartView.GetSeriesClass: TcxGridChartSeriesClass; +begin + Result := TcxGridChartSeries; +end; + +procedure TcxGridChartView.ClearDataGroups; +begin + ClearItems(GetDataGroupClass); +end; + +function TcxGridChartView.CreateDataGroup: TcxGridChartDataGroup; +begin + Result := TcxGridChartDataGroup(CreateItem(GetDataGroupClass)); +end; + +function TcxGridChartView.FindDataGroupByID(AID: Integer): TcxGridChartDataGroup; +begin + Result := TcxGridChartDataGroup(FindItemByID(GetDataGroupClass, AID)); +end; + +function TcxGridChartView.FindDataGroupByName(const AName: string): TcxGridChartDataGroup; +begin + Result := TcxGridChartDataGroup(FindItemByName(GetDataGroupClass, AName)); +end; + +function TcxGridChartView.FindDataGroupByTag(ATag: TcxTag): TcxGridChartDataGroup; +begin + Result := TcxGridChartDataGroup(FindItemByTag(GetDataGroupClass, ATag)); +end; + +function TcxGridChartView.GetDataGroupClass: TcxGridChartDataGroupClass; +begin + Result := TcxGridChartDataGroup; +end; + +function TcxGridChartView.CanActivateDataLevel(ALevel: Integer): Boolean; +begin + Result := GetAvailableDataLevel(ALevel) = ALevel; +end; + +initialization + cxGridRegisteredViews.Register(TcxGridChartView, 'Chart'); + Classes.RegisterClasses([TcxGridChartDataGroup, TcxGridChartSeries]); + + cxGridChartDiagramImages := TImageList.Create(nil); + cxGridChartDiagramImages_Add('CXGRIDCHARTAREADIAGRAMBITMAP'); + cxGridChartDiagramImages_Add('CXGRIDCHARTBARDIAGRAMBITMAP'); + cxGridChartDiagramImages_Add('CXGRIDCHARTCOLUMNDIAGRAMBITMAP'); + cxGridChartDiagramImages_Add('CXGRIDCHARTLINEDIAGRAMBITMAP'); + cxGridChartDiagramImages_Add('CXGRIDCHARTPIEDIAGRAMBITMAP'); + + Screen.Cursors[crcxGridMagnifier] := LoadCursor(HInstance, 'CXGRIDCHARTMAGNIFIERCURSOR'); + Screen.Cursors[crcxGridDrag] := LoadCursor(HInstance, 'CXGRIDCHARTDRAGCURSOR'); + +finalization + FreeAndNil(cxGridChartDiagramImages); + + cxGridRegisteredViews.Unregister(TcxGridChartView); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridChartView.res b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridChartView.res new file mode 100644 index 00000000..6c0eb144 Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridChartView.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridCommon.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridCommon.pas new file mode 100644 index 00000000..b47702a8 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridCommon.pas @@ -0,0 +1,613 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridCommon; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, TypInfo, Classes, Graphics, Controls, ComCtrls, + cxClasses, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters, + cxTreeView; + +const + ScxGridPrefixName = 'TcxGrid'; + + cxGridInvisibleCoordinate = 30000{100000}; + + cxGridCellTextOffset = 2; + cxGridEditOffset = 1; + cxGridHeaderTextOffset = 2; + + cxGridDesignViewBorderColor = 3577330; + cxGridDesignViewColor = 9295359; + cxGridDesignViewHotColor = 6862841;//6078705; + cxGridDesignSelectedBorderColor = 11504744;//clWhite; + cxGridDesignSelectedColor = 14991773; + cxGridDesignSelectedHotBorderColor = clDkGray;//12033927; + cxGridDesignSelectedHotColor = 14065255;//13747387; + +type + TcxGridCellState = (gcsNone, gcsSelected, gcsPressed); + + TcxGridClassEnumeratorProc = procedure(AClass: TClass) of object; + + { custom change } + + TcxCustomGridChange = class + private + FControl: TcxControl; + public + function CanExecuteWhenLocked: Boolean; virtual; + procedure Execute; virtual; abstract; + function IsCompatibleWith(AChange: TcxCustomGridChange): Boolean; virtual; + function IsCumulative: Boolean; virtual; + function IsEqual(AChange: TcxCustomGridChange): Boolean; virtual; + function IsLockable: Boolean; virtual; + property Control: TcxControl read FControl write FControl; // TcxCustomGrid + end; + + { custom drag open info } + + TcxCustomGridDragOpenInfo = class + public + function Equals(AInfo: TcxCustomGridDragOpenInfo): Boolean; virtual; + procedure Run; virtual; abstract; + end; + + { options tree view } + + TcxGridOptionsTreeViewGetTypeItemCaptionFunction = function(ATypeItem: Integer): string; + TcxGridOptionsTreeViewItemKind = (otikCategory, otikCheckBox, otikRadioButton); + + TcxGridOptionsTreeView = class(TcxTreeView) + private + FItemValuesUpdateLocked: Boolean; + FMaxID: Integer; + procedure WMDestroy(var Message: TWMDestroy); message WM_DESTROY; + procedure CustomDrawItem(Sender: TCustomTreeView; Node: TTreeNode; + State: TCustomDrawState; var DefaultDraw: Boolean); + procedure GetNodeImageIndex(Sender: TObject; Node: TTreeNode); + procedure GetNodeSelectedImageIndex(Sender: TObject; Node: TTreeNode); + protected + procedure CreateWnd; override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); override; + + function AddItem(AParentID, AID: Integer; const ACaption: string; + AKind: TcxGridOptionsTreeViewItemKind): Integer; virtual; + procedure ClearItems; + function FindNodeByID(AID: Integer): TTreeNode; + function GetItemImageIndex(AKind: TcxGridOptionsTreeViewItemKind; AChecked: Boolean): Integer; + function GetNodeID(ANode: TTreeNode): Integer; + function GetNodeKind(ANode: TTreeNode): TcxGridOptionsTreeViewItemKind; + function GetNodeParentID(ANode: TTreeNode): Integer; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure NodeClicked(ANode: TTreeNode); virtual; + procedure RefreshImages; + procedure RefreshItemImageIndexes; + procedure ResetMaxID; + + function CalculateImagesSize: TSize; virtual; + procedure DrawImage(ACanvas: TcxCanvas; const ARect: TRect; + AItemKind: TcxGridOptionsTreeViewItemKind; AChecked: Boolean); virtual; + function GetCategoryBitmap: TBitmap; + function GetCategorySize: TSize; virtual; + function GetCheckBoxSize: TSize; virtual; + function GetRadioButtonSize: TSize; virtual; + + procedure AddItems; virtual; abstract; + function IsItemChecked(AParentID, AID: Integer): Boolean; virtual; abstract; + procedure ItemClicked(AParentID, AID: Integer); virtual; abstract; + + property ItemValuesUpdateLocked: Boolean read FItemValuesUpdateLocked + write FItemValuesUpdateLocked; + property MaxID: Integer read FMaxID; + public + constructor Create(AOwner: TComponent); override; + + function AddCategory(AParentID, AID: Integer; const ACaption: string): Integer; + function AddCheckBox(AParentID, AID: Integer; const ACaption: string): Integer; + function AddRadioButton(AParentID, AID: Integer; const ACaption: string): Integer; + procedure AddRadioButtons(AParentID: Integer; ATypeInfo: PTypeInfo; + AGetTypeItemCaption: TcxGridOptionsTreeViewGetTypeItemCaptionFunction); + + procedure RefreshItems; + procedure RefreshItemValues; + end; + +function GetValidName(AComponent: TComponent; const AName: string; + AIsBaseName: Boolean = False): string; + +procedure GetCellTextAreaSize(var ATextSize: Integer); +function GridCellStateToButtonState(ACellState: TcxGridCellState): TcxButtonState; + +implementation + +{$R cxGrid.res} + +uses + cxGeometry, Math, Forms, SysUtils, cxLibraryConsts; + +{ TcxCustomGridChange } + +function TcxCustomGridChange.CanExecuteWhenLocked: Boolean; +begin + Result:= True; +end; + +function TcxCustomGridChange.IsCompatibleWith(AChange: TcxCustomGridChange): Boolean; +begin + Result := False; +end; + +function TcxCustomGridChange.IsCumulative: Boolean; +begin + Result := True; +end; + +function TcxCustomGridChange.IsEqual(AChange: TcxCustomGridChange): Boolean; +begin + Result := ClassType = AChange.ClassType; +end; + +function TcxCustomGridChange.IsLockable: Boolean; +begin + Result := True; +end; + +{ TcxCustomGridDragOpenInfo } + +function TcxCustomGridDragOpenInfo.Equals(AInfo: TcxCustomGridDragOpenInfo): Boolean; +begin + Result := ClassType = AInfo.ClassType; +end; + +{ TcxGridOptionsTreeView } + +const + OptionsTreeViewMaxInternalID = 99; + +type + TOptionTreeNodeData = class + ID: Integer; + Kind: TcxGridOptionsTreeViewItemKind; + constructor Create(AID: Integer; AKind: TcxGridOptionsTreeViewItemKind); + end; + +constructor TOptionTreeNodeData.Create(AID: Integer; AKind: TcxGridOptionsTreeViewItemKind); +begin + inherited Create; + ID := AID; + Kind := AKind; +end; + +constructor TcxGridOptionsTreeView.Create(AOwner: TComponent); +begin + inherited; + ReadOnly := True; + ShowButtons := False; + ShowRoot := False; + Images := TImageList.Create(Self); + OnCustomDrawItem := CustomDrawItem; + OnGetImageIndex := GetNodeImageIndex; + OnGetSelectedIndex := GetNodeSelectedImageIndex; + ResetMaxID; +end; + +procedure TcxGridOptionsTreeView.WMDestroy(var Message: TWMDestroy); +begin + ClearItems; + inherited; +end; + +procedure TcxGridOptionsTreeView.CustomDrawItem(Sender: TCustomTreeView; Node: TTreeNode; + State: TCustomDrawState; var DefaultDraw: Boolean); +var + R: TRect; +begin + // to fix the bug in VCL tree view + Sender.Canvas.Font.Name := 'System'; + Sender.Canvas.Font.Name := Font.Name; + + if GetNodeKind(Node) = otikCategory then + begin + if Node.Level = 0 then + begin + R := Node.DisplayRect(False); + R.Left := Node.DisplayRect(True).Left; + if not (cdsSelected in State) then + Sender.Canvas.Brush.Color := clBtnShadow; + Sender.Canvas.FillRect(R); + end; + Sender.Canvas.Font.Style := [fsBold]; + end; +end; + +procedure TcxGridOptionsTreeView.GetNodeImageIndex(Sender: TObject; Node: TTreeNode); +begin + if GetNodeKind(Node) = otikCategory then + Node.ImageIndex := GetItemImageIndex(otikCategory, Node.Expanded); +end; + +procedure TcxGridOptionsTreeView.GetNodeSelectedImageIndex(Sender: TObject; Node: TTreeNode); +begin + if GetNodeKind(Node) = otikCategory then + Node.SelectedIndex := GetItemImageIndex(otikCategory, Node.Expanded); +end; + +procedure TcxGridOptionsTreeView.CreateWnd; +begin + inherited; + RefreshImages; + RefreshItems; +end; + +procedure TcxGridOptionsTreeView.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + inherited; + if not FIsCreating then + RefreshImages; +end; + +function TcxGridOptionsTreeView.AddItem(AParentID, AID: Integer; + const ACaption: string; AKind: TcxGridOptionsTreeViewItemKind): Integer; +var + AParent: TTreeNode; +begin + if AParentID = -1 then + AParent := nil + else + AParent := FindNodeByID(AParentID); + if AID = -1 then + begin + Inc(FMaxID); + AID := FMaxID; + end + else + FMaxID := Max(FMaxID, AID); + Result := AID; + Items.AddChildObject(AParent, ACaption, TOptionTreeNodeData.Create(AID, AKind)); +end; + +procedure TcxGridOptionsTreeView.ClearItems; +var + I: Integer; +begin + for I := 0 to Items.Count - 1 do + TOptionTreeNodeData(Items[I].Data).Free; + Items.Clear; +end; + +function TcxGridOptionsTreeView.FindNodeByID(AID: Integer): TTreeNode; +var + I: Integer; +begin + for I := 0 to Items.Count - 1 do + begin + Result := Items[I]; + if GetNodeID(Result) = AID then Exit; + end; + Result := nil; +end; + +function TcxGridOptionsTreeView.GetItemImageIndex(AKind: TcxGridOptionsTreeViewItemKind; + AChecked: Boolean): Integer; +begin + Result := 2 * Ord(AKind) + Ord(AChecked); +end; + +function TcxGridOptionsTreeView.GetNodeID(ANode: TTreeNode): Integer; +begin + Result := TOptionTreeNodeData(ANode.Data).ID; +end; + +function TcxGridOptionsTreeView.GetNodeKind(ANode: TTreeNode): TcxGridOptionsTreeViewItemKind; +begin + Result := TOptionTreeNodeData(ANode.Data).Kind; +end; + +function TcxGridOptionsTreeView.GetNodeParentID(ANode: TTreeNode): Integer; +begin + if ANode.Parent = nil then + Result := -1 + else + Result := GetNodeID(ANode.Parent); +end; + +procedure TcxGridOptionsTreeView.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited; + if (Key = VK_SPACE) and (Selected <> nil) then + NodeClicked(Selected); +end; + +procedure TcxGridOptionsTreeView.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +var + ANode: TTreeNode; +begin + if Button = mbLeft then + begin + ANode := GetNodeAt(X, Y); + if (ANode <> nil) and (htOnItem in GetHitTestInfoAt(X, Y)) then + NodeClicked(ANode); + end; + inherited; +end; + +procedure TcxGridOptionsTreeView.NodeClicked(ANode: TTreeNode); +begin + ItemValuesUpdateLocked := True; + try + ItemClicked(GetNodeParentID(ANode), GetNodeID(ANode)); + finally + ItemValuesUpdateLocked := False; + end; + RefreshItemValues; +end; + +procedure TcxGridOptionsTreeView.RefreshImages; +var + AImage: TBitmap; + AImageCanvas: TcxCanvas; + AImageRect: TRect; + AItemKind: TcxGridOptionsTreeViewItemKind; + AChecked: Boolean; +begin + if IsDestroying then Exit; + + Images.Clear; + with CalculateImagesSize do + begin + Images.Width := cx; + Images.Height := cy; + end; + + AImage := TBitmap.Create; + try + AImage.Width := Images.Width; + AImage.Height := Images.Height; + AImageCanvas := TcxCanvas.Create(AImage.Canvas); + try + AImageRect := Rect(0, 0, AImage.Width, AImage.Height); + for AItemKind := Low(AItemKind) to High(AItemKind) do + for AChecked := Low(AChecked) to High(AChecked) do + begin + AImage.Canvas.Brush.Color := Color; + AImage.Canvas.FillRect(AImageRect); + DrawImage(AImageCanvas, AImageRect, AItemKind, AChecked); + Images.Add(AImage, nil); + end; + finally + AImageCanvas.Free; + end; + finally + AImage.Free; + end; +end; + +procedure TcxGridOptionsTreeView.RefreshItemImageIndexes; +var + I: Integer; + ANode: TTreeNode; +begin + Items.BeginUpdate; + try + for I := 0 to Items.Count - 1 do + begin + ANode := Items[I]; + ANode.ImageIndex := GetItemImageIndex(GetNodeKind(ANode), + IsItemChecked(GetNodeParentID(ANode), GetNodeID(ANode))); + ANode.SelectedIndex := ANode.ImageIndex; + end; + finally + Items.EndUpdate; + end; +end; + +procedure TcxGridOptionsTreeView.ResetMaxID; +begin + FMaxID := OptionsTreeViewMaxInternalID; +end; + +function TcxGridOptionsTreeView.CalculateImagesSize: TSize; +begin + Result := GetCategorySize; + Result.cx := Max(Result.cx, Max(GetCheckBoxSize.cx, GetRadioButtonSize.cx)); + Result.cy := Max(Result.cy, Max(GetCheckBoxSize.cy, GetRadioButtonSize.cy)); +end; + +procedure TcxGridOptionsTreeView.DrawImage(ACanvas: TcxCanvas; const ARect: TRect; + AItemKind: TcxGridOptionsTreeViewItemKind; AChecked: Boolean); +var + R: TRect; + B: TBitmap; +begin + R := ARect; + case AItemKind of + otikCategory: + begin + R := cxRectCenter(R, GetCategorySize); + B := GetCategoryBitmap; + try + if AChecked then + ACanvas.RotateBitmap(B, raMinus90); + ACanvas.DrawGlyph(R.Left, R.Top, B); + finally + B.Free; + end; + end; + otikCheckBox: + begin + R := cxRectCenter(R, GetCheckBoxSize); + LookAndFeelPainter.DrawCheckButton(ACanvas, R, cxbsNormal, AChecked); + end; + otikRadioButton: + begin + R := cxRectCenter(R, GetRadioButtonSize); + LookAndFeelPainter.DrawRadioButton(ACanvas, R.Left, R.Top, cxbsNormal, + AChecked, False, ACanvas.Brush.Color); + end; + end; +end; + +function TcxGridOptionsTreeView.GetCategoryBitmap: TBitmap; +begin + Result := TBitmap.Create; + Result.LoadFromResourceName(HInstance, 'CXGRIDOPTIONSTREEVIEWCATEGORYBITMAP'); +end; + +function TcxGridOptionsTreeView.GetCategorySize: TSize; +begin + with GetCategoryBitmap do + try + Result.cx := Width; + Result.cy := Height; + finally + Free; + end; +end; + +function TcxGridOptionsTreeView.GetCheckBoxSize: TSize; +begin + Result := LookAndFeelPainter.CheckButtonSize; +end; + +function TcxGridOptionsTreeView.GetRadioButtonSize: TSize; +begin + Result := LookAndFeelPainter.RadioButtonSize; +end; + +function TcxGridOptionsTreeView.AddCategory(AParentID, AID: Integer; + const ACaption: string): Integer; +begin + Result := AddItem(AParentID, AID, ACaption, otikCategory); +end; + +function TcxGridOptionsTreeView.AddCheckBox(AParentID, AID: Integer; + const ACaption: string): Integer; +begin + Result := AddItem(AParentID, AID, ACaption, otikCheckBox); +end; + +function TcxGridOptionsTreeView.AddRadioButton(AParentID, AID: Integer; + const ACaption: string): Integer; +begin + Result := AddItem(AParentID, AID, ACaption, otikRadioButton); +end; + +procedure TcxGridOptionsTreeView.AddRadioButtons(AParentID: Integer; + ATypeInfo: PTypeInfo; AGetTypeItemCaption: TcxGridOptionsTreeViewGetTypeItemCaptionFunction); +var + ATypeData: PTypeData; + I: Integer; +begin + if ATypeInfo.Kind <> tkEnumeration then Exit; + ATypeData := GetTypeData(ATypeInfo); + for I := ATypeData.MinValue to ATypeData.MaxValue do + AddRadioButton(AParentID, I, AGetTypeItemCaption(I)); +end; + +procedure TcxGridOptionsTreeView.RefreshItems; +begin + Items.BeginUpdate; + try + ClearItems; + ResetMaxID; + AddItems; + RefreshItemValues; + FullExpand; + TopItem := Items.GetFirstNode; + finally + Items.EndUpdate; + end; +end; + +procedure TcxGridOptionsTreeView.RefreshItemValues; +begin + if not ItemValuesUpdateLocked then + RefreshItemImageIndexes; +end; + +{ functions } + +function GetValidName(AComponent: TComponent; const AName: string; + AIsBaseName: Boolean = False): string; +var + AOwner: TComponent; + I: Integer; + + function GetNextName: string; + begin + Result := AName + IntToStr(I); + Inc(I); + end; + +begin + Result := AName; + AOwner := AComponent.Owner; + if AOwner = nil then Exit; + I := 1; + if AIsBaseName then Result := GetNextName; + while AOwner.FindComponent(Result) <> nil do + Result := GetNextName; +end; + +procedure GetCellTextAreaSize(var ATextSize: Integer); +begin + Inc(ATextSize, 2 * cxGridCellTextOffset); +end; + +function GridCellStateToButtonState(ACellState: TcxGridCellState): TcxButtonState; +const + ButtonStates: array[TcxGridCellState] of TcxButtonState = + (cxbsNormal, cxbsHot, cxbsPressed); +begin + Result := ButtonStates[ACellState]; +end; + +initialization + crcxGridHorzSize := crcxHorzSize; + crcxGridVertSize := crcxVertSize; + crcxGridRemove := crcxRemove; + crcxGridNoDrop := crcxNoDrop; + crcxGridDrag := crcxDrag; + crcxGridMultiDrag := crcxDragMulti; + Screen.Cursors[crcxGridSelectRow] := LoadCursor(HInstance, 'CX_GRIDSELECTROWCURSOR'); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridConverter.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridConverter.pas new file mode 100644 index 00000000..2053d678 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridConverter.pas @@ -0,0 +1,230 @@ +{*******************************************************************} +{ } +{ Developer Express Cross Platform Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL AND CLX CONTROLS AS PART OF AN EXECUTABLE } +{ PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} +unit cxGridConverter; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + DesignIntf, +{$ELSE} + DsgnIntf, +{$ENDIF} + Windows, + SysUtils, Classes, + cxConverterFactory, cxGrid, cxGridCustomView, cxGridLevel, cxGridDBBandedTableView, + cxStyles, cxClasses, cxGridStrs, cxGridStructureNavigator, cxDesignWindows; + +type + TcxCustomGridConverterClass = class of TcxCustomGridConverter; + + { TcxCustomGridConverter } + TcxCustomGridConverter = class(TcxCustomConverterWithStyles) + private + FDeleteAllSublevels: Boolean; + FDestinationLevel: TcxGridLevel; + FIntermediary: TComponent; + procedure ClearAllSublevels(ALevel: TcxGridLevel); + procedure ClearGrid; + procedure ClearSublevels(ALevel: TcxGridLevel); + function GetDestination: TcxCustomGrid; + function GetDestinationLevel: TcxGridLevel; + function GetcxGridView: TcxCustomGridView; + function GetSource: TComponent; + procedure SetIntermediary(AIntermediary: TComponent); + procedure SetSource(ASource: TComponent); + protected + function CanConvert: Boolean; override; + procedure DoImport; override; + procedure DoRealImport; virtual; + function GetGridViewClass: TcxCustomGridViewClass; virtual; + function TestIntermediary: Boolean; virtual; + function UniqueColumnName(AColumn: TComponent; const AFieldName: string = ''): string; + property cxGridView: TcxCustomGridView read GetcxGridView; + public + constructor Create(ADestination: TObject); override; + class function GetIntermediaryClassName: string; virtual; + property DeleteAllSublevels: Boolean read FDeleteAllSublevels write FDeleteAllSublevels; + property Destination: TcxCustomGrid read GetDestination; + property DestinationLevel: TcxGridLevel read FDestinationLevel write FDestinationLevel; + property Intermediary: TComponent read FIntermediary write SetIntermediary; + property Source: TComponent read GetSource write SetSource; + end; + +const + cxGridGroupConverterName = 'Grid Converters'; + +implementation + +uses + cxGridCommon; + +{ TcxCustomGridConverter } + +constructor TcxCustomGridConverter.Create(ADestination: TObject); +begin + inherited Create(ADestination); + FDeleteAllSublevels := True; +end; + +class function TcxCustomGridConverter.GetIntermediaryClassName: string; +begin + Result := ''; +end; + +function TcxCustomGridConverter.CanConvert: Boolean; +begin + Result := TestIntermediary; + if not Result then + MessageBox(0, PChar(Format(cxGetResourceString(@scxGridConverterIntermediaryMissing), + [GetIntermediaryClassName])), PChar(cxGetResourceString(@scxImportErrorCaption)), + MB_OK or MB_ICONINFORMATION); +end; + +procedure TcxCustomGridConverter.DoImport; +begin + Destination.BeginUpdate; + try + ClearGrid; + DoRealImport; + inherited DoImport; + finally + Destination.EndUpdate; + end; +end; + +procedure TcxCustomGridConverter.DoRealImport; +begin +end; + +function TcxCustomGridConverter.GetGridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridDBBandedTableView; +end; + +function TcxCustomGridConverter.TestIntermediary: Boolean; +begin + Result := True; +end; + +//var +// NCount: Integer = 0; + +function TcxCustomGridConverter.UniqueColumnName(AColumn: TComponent; const AFieldName: string): string; +begin +// Result := 'Column' + IntToStr(NCount); +// Inc(NCount); + Result := CreateUniqueName(AColumn.Owner, cxGridView, AColumn, ScxGridPrefixName, AFieldName); +end; + +procedure TcxCustomGridConverter.ClearAllSublevels(ALevel: TcxGridLevel); +var + I: Integer; +begin + for I := ALevel.Count - 1 downto 0 do + ClearSublevels(ALevel[I]); +end; + +procedure TcxCustomGridConverter.ClearGrid; +var + AOldView: TcxCustomGridView; +begin + FDestinationLevel := GetDestinationLevel; + AOldView := FDestinationLevel.GridView; + if FDestinationLevel.Name = '' then +// FDestinationLevel.Name := 'L1'; + FDestinationLevel.Name := GenLevelName(Destination, FDestinationLevel); + FDestinationLevel.GridView := Destination.CreateView(GetGridViewClass); +// FDestinationLevel.GridView.Name := 'V1'; + FDestinationLevel.GridView.Name := GenViewName(Destination, FDestinationLevel.GridView); + AOldView.Free; +end; + +procedure TcxCustomGridConverter.ClearSublevels(ALevel: TcxGridLevel); +var + I: Integer; +begin + for I := ALevel.Count - 1 downto 0 do + ClearSublevels(ALevel[I]); + ALevel.GridView.Free; + ALevel.Free; +end; + +function TcxCustomGridConverter.GetDestination: TcxCustomGrid; +begin + Result := inherited Destination as TcxCustomGrid; +end; + +function TcxCustomGridConverter.GetDestinationLevel: TcxGridLevel; +begin + Result := FDestinationLevel; + if Result = nil then + begin + if FDeleteAllSublevels then + ClearAllSublevels(Destination.Levels); + Result := Destination.Levels.Add; + end + else + begin + if FDeleteAllSublevels then + ClearAllSublevels(Result); + end; +end; + +function TcxCustomGridConverter.GetcxGridView: TcxCustomGridView; +begin + Result := FDestinationLevel.GridView; +end; + +function TcxCustomGridConverter.GetSource: TComponent; +begin + Result := inherited Source as TComponent; +end; + +procedure TcxCustomGridConverter.SetIntermediary(AIntermediary: TComponent); +begin + if AIntermediary <> nil then + if AIntermediary.ClassName = GetIntermediaryClassName then + FIntermediary := AIntermediary; +end; + +procedure TcxCustomGridConverter.SetSource(ASource: TComponent); +begin + inherited Source := ASource; +end; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridCustomPopupMenu.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridCustomPopupMenu.pas new file mode 100644 index 00000000..19946b53 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridCustomPopupMenu.pas @@ -0,0 +1,776 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid Utils } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridCustomPopupMenu; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, Classes, SysUtils, Controls, cxGridCustomView, Menus; + +const + cxhtGridBase = 1000; + +type + EcxGridPopupMenu = class(Exception); + + TcxGridViewHitType = (gvhtGridNone, gvhtGridTab, gvhtNone, gvhtTab, gvhtCell, + gvhtExpandButton, gvhtRecord, gvhtNavigator, gvhtPreview, gvhtColumnHeader, + gvhtColumnHeaderFilterButton, gvhtFilter, gvhtFooter, gvhtFooterCell, + gvhtGroupFooter, gvhtGroupFooterCell, gvhtGroupByBox, gvhtIndicator, + gvhtRowIndicator, gvhtRowLevelIndent, gvhtBand, gvhtBandHeader, + gvhtRowCaption, gvhtSeparator, gvhtGroupSummary); + + TcxGridViewHitTypes = set of TcxGridViewHitType; + + TcxGridBeforePopupProc = procedure(ASenderMenu: TComponent; + AHitTest: TcxCustomGridHitTest; X,Y: Integer; var AllowPopup: Boolean) of object; + + TcxGridOnPopupProc = procedure(ASenderMenu: TComponent; + AHitTest: TcxCustomGridHitTest; X,Y: Integer) of object; + + TcxGridPopupMenuItemClickProc = procedure(ASender: TObject; + AHitTest: TcxCustomGridHitTest; var AHandler: TNotifyEvent; + AParams: TList; var AHandled: Boolean) of object; + + IDoPopup = interface + ['{41999EDE-B9D9-4808-9D01-61B09DF700FA}'] + function GetPopupHandler: TcxGridOnPopupProc; + end; + + IcxGridPopupMenu = interface + ['{302C3B32-D753-43A6-BAE2-F513EB4F9399}'] + function CanPopup(AHitTest: TcxCustomGridHitTest): Boolean; + end; + + TcxPopupMenuInfo = Class(TCollectionItem) + private + FPopupMenu: TComponent; + FPopupProc: TcxGridOnPopupProc; + FHitTypes: TcxGridViewHitTypes; + FLocked: Boolean; + FView: TcxCustomGridView; + FViewClass: TcxCustomGridViewClass; + function FindCorrectComponent(const AComponent: TComponent): TComponent; + procedure SetPopupMenu(const AValue: TComponent); + procedure SetView(const AValue: TcxCustomGridView); + procedure SetViewClass(const Value: TcxCustomGridViewClass); + protected + FIsBuiltIn: Boolean; + procedure BeginUpdate; virtual; + procedure EndUpdate; virtual; + function CanPopup(AHitTest: TcxCustomGridHitTest): Boolean; + procedure DoChanged(const APopupMenu: TComponent; const AView: TcxCustomGridView; + AViewClass: TcxCustomGridViewClass); virtual; + property GridViewClass: TcxCustomGridViewClass read FViewClass write SetViewClass; + public + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + property IsBuiltIn: Boolean read FIsBuiltIn; + published + property GridView: TcxCustomGridView read FView write SetView; + property HitTypes: TcxGridViewHitTypes read FHitTypes write FHitTypes; + property Index; + property OnPopup: TcxGridOnPopupProc read FPopupProc write FPopupProc; + property PopupMenu: TComponent read FPopupMenu write SetPopupMenu; + end; + + TcxPopupMenuInfos = class(TCollection) + private + FOwner: TComponent; + function GetItem(AIndex: Integer): TcxPopupMenuInfo; + procedure SetItem(AIndex: Integer; const AValue: TcxPopupMenuInfo); + protected + function GetOwner: TPersistent; override; + function IsMenuInfoShortCut(AMenuInfo: TcxPopupMenuInfo; + var Message: TWMKey): Boolean; virtual; + function IsShortCut(var Message: TWMKey): Boolean; virtual; + {$IFDEF DELPHI6} + procedure Notify(Item: TCollectionItem; Action: TCollectionNotification); override; + {$ENDIF} + public + constructor Create(AOwner: TComponent); virtual; + function GetSameMenuCount(const AMenu: TComponent): Integer; + property Items[AIndex: Integer]: TcxPopupMenuInfo read GetItem write SetItem; default; + end; + + TcxCustomGridPopupMenu = class(TComponent) + private + FPopupMenuInfos: TcxPopupMenuInfos; + function GetMenuInfo(AIndex: Integer): TcxPopupMenuInfo; + function GetMenuInfoCount: Integer; + procedure SetPopupMenuInfos(const AValue: TcxPopupMenuInfos); + protected + procedure AddMenuInfo(const AMenu: TComponent; AHitTypes: TcxGridViewHitTypes; + ADoPopupProc: TcxGridOnPopupProc; AViewClass: TcxCustomGridViewClass = nil; + const AView: TcxCustomGridView = nil; AIsBuiltIn: Boolean = False); + procedure AdjustMenuInfo(AMenuInfo: TcxPopupMenuInfo; + const AMenu: TComponent; AHitTypes: TcxGridViewHitTypes; + ADoPopupProc: TcxGridOnPopupProc; AViewClass: TcxCustomGridViewClass = nil; + const AView: TcxCustomGridView = nil; AIsBuiltIn: Boolean = False); + procedure ClearMenuInfosGridView(const AView: TcxCustomGridView = nil); + function GetPopupMenuInfo(const AMenu: TComponent; const AView: TcxCustomGridView; + ASearchDefault: Boolean = True): TcxPopupMenuInfo; overload; virtual; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + property PopupMenuInfos: TcxPopupMenuInfos read FPopupMenuInfos write SetPopupMenuInfos; + property MenuInfos[AIndex: Integer]: TcxPopupMenuInfo read GetMenuInfo; default; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function CheckShortCuts(var Message: TWMKeyDown): Boolean; virtual; + function FindPopupMenuInfo(const AView: TcxCustomGridView; + AHitType: TcxGridViewHitType; AHitTest: TcxCustomGridHitTest): TcxPopupMenuInfo; virtual; + function GetPopupMenuInfo(const AMenu: TComponent; AViewClass: TcxCustomGridViewClass; + ASearchDefault: Boolean = True): TcxPopupMenuInfo; overload; virtual; + property Count: Integer read GetMenuInfoCount; + end; + + TcxGridDefaultPopupMenu = class(TcxCustomGridPopupMenu) + protected + function GetPopupMenuInfo(const AMenu: TComponent; const AView: TcxCustomGridView; + ASearchDefault: Boolean = True): TcxPopupMenuInfo; overload; override; + procedure InternalRegisterPopupMenu(const AMenu: TComponent; + AHitTypes: TcxGridViewHitTypes; ADoPopupProc: TcxGridOnPopupProc; + AViewClass: TcxCustomGridViewClass; AIsBuiltIn: Boolean = False); virtual; + public + function GetPopupMenuInfo(const AMenu: TComponent; AViewClass: TcxCustomGridViewClass; + ASearchDefault: Boolean = True): TcxPopupMenuInfo; overload; override; + procedure RegisterPopupMenu(const AMenu: TComponent; AHitTypes: TcxGridViewHitTypes; + ADoPopupProc: TcxGridOnPopupProc; AViewClass: TcxCustomGridViewClass); virtual; + procedure UnRegisterPopupMenu(const AMenu: TComponent; AViewClass: TcxCustomGridViewClass; + AHitTypes: TcxGridViewHitTypes = []); virtual; + property MenuInfos; + end; + + TcxPopupMenuClass = class of TComponent; + + TcxPopupMenuClassInfoRec = class + public + MenuClass: TcxPopupMenuClass; + HitTypes: TcxGridViewHitTypes; + ViewClass: TcxCustomGridViewClass; + constructor Create(AMenuClass: TcxPopupMenuClass; AHitTypes: TcxGridViewHitTypes; + AViewClass: TcxCustomGridViewClass); + end; + + TcxBuiltInPopupMenus = class + private + FInfoRecs: TList; + function GetCount: Integer; + function GetItem(AIndex: Integer): TcxPopupMenuClassInfoRec; + protected + function Add(AMenuClass: TcxPopupMenuClass; AHitTypes: TcxGridViewHitTypes; + AViewClass: TcxCustomGridViewClass): TcxPopupMenuClassInfoRec; + procedure Clear; + procedure Delete(AIndex: Integer); + procedure RegisterItemTo(ADefaultPopupMenu: TcxGridDefaultPopupMenu; + AItemIndex: Integer); + procedure Remove(APopupMenuClass: TcxPopupMenuClass); + + property Count: Integer read GetCount; + property Items[AIndex: Integer]: TcxPopupMenuClassInfoRec read GetItem; default; + public + constructor Create; + destructor Destroy; override; + procedure RegisterItemsTo(ADefaultPopupMenu: TcxGridDefaultPopupMenu); + end; + + function GetHitTypeByHitCode(AHitCode: Integer): TcxGridViewHitType; + + procedure RegisterPopupMenuClass(APopupMenuClass: TcxPopupMenuClass; + AHitTypes: TcxGridViewHitTypes; AViewClass: TcxCustomGridViewClass); + procedure UnregisterPopupMenuClass(APopupMenuClass: TcxPopupMenuClass); + +var + BuiltInPopupMenuList: TcxBuiltInPopupMenus; + +implementation + +uses + cxGridCustomTableView, cxGridTableView, Graphics, cxGridDetailsSite, + cxGridRows, cxGridBandedTableView, cxGridCardView, cxControls; + +function GetHitTypeByHitCode(AHitCode: Integer): TcxGridViewHitType; +const + cxGridViewHitCodes: array[TcxGridViewHitType] of Integer = (htNone + cxhtGridBase, + htTab + cxhtGridBase, htNone, htTab, htCell, htExpandButton, htRecord, htNavigator, + htPreview, htColumnHeader, htColumnHeaderFilterButton, htFilter, htFooter, htFooterCell, + htGroupFooter, htGroupFooterCell, htGroupByBox, htIndicator, htRowIndicator, + htRowLevelIndent, htBand, htBandHeader, htRowCaption, htSeparator, htGroupSummary); +begin + for Result := Low(Result) to High(Result) do + if cxGridViewHitCodes[Result] = AHitCode then + Exit; + Result := TcxGridViewHitType(-1); +end; + +{ TcxPopupMenuInfo } + +procedure TcxPopupMenuInfo.BeginUpdate; +begin + FLocked := True; +end; + +procedure TcxPopupMenuInfo.EndUpdate; +begin + FLocked := False; +end; + +function TcxPopupMenuInfo.CanPopup(AHitTest: TcxCustomGridHitTest): Boolean; +var + APopupMenuIntf: IcxGridPopupMenu; +begin + if (PopupMenu <> nil) and Supports(PopupMenu, IcxGridPopupMenu, APopupMenuIntf) then + Result := APopupMenuIntf.CanPopup(AHitTest) + else + Result := True; +end; + +procedure TcxPopupMenuInfo.DoChanged(const APopupMenu: TComponent; + const AView: TcxCustomGridView; AViewClass: TcxCustomGridViewClass); +var + AMenuInfo: TcxPopupMenuInfo; + MenuInfos: TcxPopupMenuInfos; +begin + AMenuInfo := nil; + if FLocked then exit; + MenuInfos := TcxPopupMenuInfos(Collection); + if Assigned(AView) then + AMenuInfo := + TcxCustomGridPopupMenu(MenuInfos.GetOwner).GetPopupMenuInfo(APopupMenu, AView) + else + begin + if Assigned(AViewClass) and (MenuInfos.GetOwner is TcxGridDefaultPopupMenu) then + AMenuInfo := + TcxGridDefaultPopupMenu(MenuInfos.GetOwner).GetPopupMenuInfo(APopupMenu, AViewClass); + end; + if (AMenuInfo <> nil) and (MenuInfos.GetOwner <> nil) and + not (csLoading in (MenuInfos.GetOwner as TComponent).ComponentState) then + Raise EcxGridPopupMenu.Create( + Format('This PopupMenuInfo is already registered. Index: %d',[AMenuInfo.Index])); +end; + +function TcxPopupMenuInfo.FindCorrectComponent(const AComponent: TComponent): TComponent; +var + AOwner: TComponent; +begin + Result := AComponent; + if not Assigned(AComponent) then + Exit; + AOwner := TComponent(TcxPopupMenuInfos(Collection).GetOwner); + while AOwner.InheritsFrom(TcxCustomGridPopupMenu) do + AOwner := TcxCustomGridPopupMenu(AOwner).Owner; + with AOwner do + if (csUpdating in ComponentState) then + begin + Result := FindComponent(AComponent.Name); + if not Assigned(Result) or (Result.ClassType <> AComponent.ClassType) then + Result := AComponent; + end; +end; + +procedure TcxPopupMenuInfo.SetPopupMenu(const AValue: TComponent); +begin + if FPopupMenu <> AValue then + begin + if (TcxPopupMenuInfos(Collection).GetSameMenuCount(FPopupMenu) = 1) and + (FPopupMenu <> nil) and not (csDestroying in FPopupMenu.ComponentState) then + FPopupMenu.RemoveFreeNotification(TComponent(TcxPopupMenuInfos(Collection).GetOwner)); + DoChanged(AValue, FView, FViewClass); + if FIsBuiltIn then + begin + FIsBuiltIn := False; + FreeAndNil(FPopupMenu); + end; + FPopupMenu := AValue; + if FPopupMenu <> nil then + FPopupMenu.FreeNotification(TComponent(TcxPopupMenuInfos(Collection).GetOwner)); + end; +end; + +procedure TcxPopupMenuInfo.SetView(const AValue: TcxCustomGridView); +begin + if FView <> AValue then + begin + if Assigned(FView) and not (csDestroying in FView.ComponentState) then + FView.RemoveFreeNotification(TComponent(TcxPopupMenuInfos(Collection).GetOwner)); + DoChanged(FPopupMenu, AValue, FViewClass); + FView := AValue; + if Assigned(FView) then + FView.FreeNotification(TComponent(TcxPopupMenuInfos(Collection).GetOwner)); + end; +end; + +procedure TcxPopupMenuInfo.SetViewClass( + const Value: TcxCustomGridViewClass); +begin + DoChanged(FPopupMenu, FView, Value); + FViewClass := Value; +end; + +destructor TcxPopupMenuInfo.Destroy; +begin + if FIsBuiltIn then + FreeAndNil(FPopupMenu); + inherited Destroy; +end; + +procedure TcxPopupMenuInfo.Assign(Source: TPersistent); +var + AMenuInfo: TcxPopupMenuInfo; +begin + if Source is TcxPopupMenuInfo then + begin + if Collection <> nil then + Collection.BeginUpdate; + try + BeginUpdate; + try + AMenuInfo := TcxPopupMenuInfo(Source); + Index := AMenuInfo.Index; + PopupMenu := FindCorrectComponent(AMenuInfo.PopupMenu); + OnPopup := AMenuInfo.OnPopup; + HitTypes := AMenuInfo.HitTypes; + GridView := TcxCustomGridView(FindCorrectComponent(AMenuInfo.GridView)); + GridViewClass := AMenuInfo.GridViewClass; + finally + EndUpdate; + end; + finally + if Collection <> nil then + Collection.EndUpdate; + end; + end + else + inherited; +end; + +{ TcxCustomGridPopupMenu } + +constructor TcxCustomGridPopupMenu.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FPopupMenuInfos := TcxPopupMenuInfos.Create(Self); +end; + +destructor TcxCustomGridPopupMenu.Destroy; +begin + FreeAndNil(FPopupMenuInfos); + inherited Destroy; +end; + +function TcxCustomGridPopupMenu.CheckShortCuts(var Message: TWMKeyDown): Boolean; +begin + Result := not (csDesigning in ComponentState) and + FPopupMenuInfos.IsShortCut(Message); + Message.Result := Message.Result or Integer(Result); +end; + +function TcxCustomGridPopupMenu.FindPopupMenuInfo(const AView: TcxCustomGridView; + AHitType: TcxGridViewHitType; AHitTest: TcxCustomGridHitTest): TcxPopupMenuInfo; +var + I: Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + if AHitType in MenuInfos[I].HitTypes then + if ((AHitType in [gvhtGridNone, gvhtGridTab]) or (MenuInfos[I].GridView = AView)) and + MenuInfos[I].CanPopup(AHitTest) then + begin + Result := MenuInfos[I]; + Break; + end + else + if AView.InheritsFrom(MenuInfos[I].GridViewClass) and + ((Result = nil) or MenuInfos[I].GridViewClass.InheritsFrom(Result.GridViewClass)) and + MenuInfos[I].CanPopup(AHitTest) then + Result := MenuInfos[I]; +end; + +function TcxCustomGridPopupMenu.GetPopupMenuInfo(const AMenu: TComponent; + const AView: TcxCustomGridView; ASearchDefault: Boolean): TcxPopupMenuInfo; +begin + Result := Nil; +end; + +function TcxCustomGridPopupMenu.GetPopupMenuInfo(const AMenu: TComponent; + AViewClass: TcxCustomGridViewClass; ASearchDefault: Boolean = True): TcxPopupMenuInfo; +begin + Result := nil; +end; + +procedure TcxCustomGridPopupMenu.Notification(AComponent: TComponent; + Operation: TOperation); +var + i: Integer; +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) then + begin + if AComponent.InheritsFrom(TcxCustomGridView) then + ClearMenuInfosGridView(TcxCustomGridView(AComponent)) + else + if Assigned(FPopupMenuInfos) then + begin + i := FPopupMenuInfos.Count - 1; + while i >= 0 do + with FPopupMenuInfos[i] do + begin + if PopupMenu = AComponent then + FPopupMenu := nil; + i := i - 1; + end; + end; + end; +end; + +procedure TcxCustomGridPopupMenu.AddMenuInfo(const AMenu: TComponent; + AHitTypes: TcxGridViewHitTypes; ADoPopupProc: TcxGridOnPopupProc; + AViewClass: TcxCustomGridViewClass; const AView: TcxCustomGridView; + AIsBuiltIn: Boolean); +begin + with TcxPopupMenuInfo(FPopupMenuInfos.Add) do + begin + BeginUpdate; + try + PopupMenu := AMenu; + OnPopup := ADoPopupProc; + GridView := AView; + GridViewClass := AViewClass; + HitTypes := AHitTypes; + FIsBuiltIn := AIsBuiltIn; + finally + EndUpdate; + end; + end; +end; + +procedure TcxCustomGridPopupMenu.AdjustMenuInfo(AMenuInfo: TcxPopupMenuInfo; + const AMenu: TComponent; AHitTypes: TcxGridViewHitTypes; + ADoPopupProc: TcxGridOnPopupProc; AViewClass: TcxCustomGridViewClass = nil; + const AView: TcxCustomGridView = nil; AIsBuiltIn: Boolean = False); +begin + if AMenuInfo <> nil then + AMenuInfo.HitTypes := AMenuInfo.HitTypes + AHitTypes + else + AddMenuInfo(AMenu, AHitTypes, ADoPopupProc, AViewClass, AView, AIsBuiltIn); +end; + +procedure TcxCustomGridPopupMenu.ClearMenuInfosGridView( + const AView: TcxCustomGridView = nil); +var + I: Integer; +begin + for I := 0 to PopupMenuInfos.Count - 1 do + with PopupMenuInfos[I] do + begin + if Assigned(AView) and (GridView <> AView) then + Continue; + BeginUpdate; + try + GridView := nil; + finally + EndUpdate; + end; + end; +end; + +function TcxCustomGridPopupMenu.GetMenuInfo(AIndex: Integer): TcxPopupMenuInfo; +begin + Result := FPopupMenuInfos[AIndex]; +end; + +function TcxCustomGridPopupMenu.GetMenuInfoCount: Integer; +begin + Result := FPopupMenuInfos.Count; +end; + +procedure TcxCustomGridPopupMenu.SetPopupMenuInfos(const AValue: TcxPopupMenuInfos); +begin + FPopupMenuInfos := AValue; +end; + +{ TcxGridDefaultPopupMenu } + +function TcxGridDefaultPopupMenu.GetPopupMenuInfo(const AMenu: TComponent; + AViewClass: TcxCustomGridViewClass; ASearchDefault: Boolean): TcxPopupMenuInfo; +var + I : Integer; + AClass: TcxCustomGridViewClass; +begin + Result := nil; + for I := 0 to Count - 1 do + if AMenu = MenuInfos[I].PopupMenu then + begin + AClass := MenuInfos[I].GridViewClass; + if (AViewClass = AClass) then + begin + Result := MenuInfos[I]; + exit; + end; + if AViewClass.InheritsFrom(AClass) and ASearchDefault then + if (Result = nil) or AClass.InheritsFrom(Result.GridViewClass) then + begin + Result := MenuInfos[I]; + end; + end; +end; + +procedure TcxGridDefaultPopupMenu.RegisterPopupMenu(const AMenu: TComponent; + AHitTypes: TcxGridViewHitTypes; ADoPopupProc: TcxGridOnPopupProc; + AViewClass: TcxCustomGridViewClass); +begin + InternalRegisterPopupMenu(AMenu, AHitTypes, ADoPopupProc, AViewClass); +end; + +procedure TcxGridDefaultPopupMenu.UnRegisterPopupMenu(const AMenu: TComponent; + AViewClass: TcxCustomGridViewClass; AHitTypes: TcxGridViewHitTypes); +var + AMenuInfo: TcxPopupMenuInfo; +begin + AMenuInfo := GetPopupMenuInfo(AMenu, AViewClass, false); + If AMenuInfo <> nil then + If AMenuInfo.HitTypes = AHitTypes then + AMenuInfo.Free + else + AMenuInfo.HitTypes := AMenuInfo.HitTypes - AHitTypes; +end; + +function TcxGridDefaultPopupMenu.GetPopupMenuInfo(const AMenu: TComponent; + const AView: TcxCustomGridView; ASearchDefault: Boolean): TcxPopupMenuInfo; +begin + Result := GetPopupMenuInfo(AMenu,TcxCustomGridViewClass(AView.ClassType), + ASearchDefault); +end; + +procedure TcxGridDefaultPopupMenu.InternalRegisterPopupMenu( + const AMenu: TComponent; AHitTypes: TcxGridViewHitTypes; + ADoPopupProc: TcxGridOnPopupProc; AViewClass: TcxCustomGridViewClass; + AIsBuiltIn: Boolean); +begin + if not Assigned(AViewClass) then exit; + AdjustMenuInfo(GetPopupMenuInfo(AMenu, AViewClass), AMenu, AHitTypes, + ADoPopupProc, AViewClass, nil ,AIsBuiltIn); +end; + +{ TcxPopupMenuInfos } + +constructor TcxPopupMenuInfos.Create(AOwner: TComponent); +begin + FOwner := AOwner; + inherited Create(TcxPopupMenuInfo); +end; + +function TcxPopupMenuInfos.GetSameMenuCount( + const AMenu: TComponent): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + if Items[I].PopupMenu = AMenu then + Inc(Result); +end; + +function TcxPopupMenuInfos.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +function TcxPopupMenuInfos.IsMenuInfoShortCut(AMenuInfo: TcxPopupMenuInfo; + var Message: TWMKey): Boolean; +var + AIcxPopupMenu: IcxPopupMenu; +begin + Result := Assigned(AMenuInfo.PopupMenu); + if not Result then + Exit; + Result := (AMenuInfo.PopupMenu is TPopupMenu); + if Result then + Result := (AMenuInfo.PopupMenu as TPopupMenu).IsShortCut(Message) + else + begin + Result := Supports(AMenuInfo.PopupMenu, IcxPopupMenu, AIcxPopupMenu) and + (AIcxPopupMenu <> nil); + if Result then + Result := AIcxPopupMenu.IsShortCutKey(Message); + end; +end; + +function TcxPopupMenuInfos.IsShortCut(var Message: TWMKey): Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to Count - 1 do + begin + Result := IsMenuInfoShortCut(Items[I], Message); + if Result then + Break; + end; +end; + +{$IFDEF DELPHI6} +procedure TcxPopupMenuInfos.Notify(Item: TCollectionItem; + Action: TCollectionNotification); +begin + If Action = cnDeleting then TcxPopupMenuInfo(Item).PopupMenu := nil; + inherited; +end; +{$ENDIF} + +function TcxPopupMenuInfos.GetItem(AIndex: Integer): TcxPopupMenuInfo; +begin + Result := TcxPopupMenuInfo(inherited GetItem(AIndex)); +end; + +procedure TcxPopupMenuInfos.SetItem(AIndex: Integer; + const AValue: TcxPopupMenuInfo); +begin + inherited SetItem(AIndex , AValue); +end; + +{ TcxPopupMenuClassInfoRec } + +constructor TcxPopupMenuClassInfoRec.Create(AMenuClass: TcxPopupMenuClass; + AHitTypes: TcxGridViewHitTypes; AViewClass: TcxCustomGridViewClass); +begin + inherited Create; + MenuClass := AMenuClass; + HitTypes := AHitTypes; + ViewClass := AViewClass; +end; + +{ TcxBuiltInPopupMenus } + +constructor TcxBuiltInPopupMenus.Create; +begin + inherited; + FInfoRecs := TList.Create; +end; + +destructor TcxBuiltInPopupMenus.Destroy; +begin + Clear; + FreeAndNil(FInfoRecs); + inherited; +end; + +function TcxBuiltInPopupMenus.GetCount: Integer; +begin + Result := FInfoRecs.Count; +end; + +function TcxBuiltInPopupMenus.GetItem(AIndex: Integer): TcxPopupMenuClassInfoRec; +begin + Result := TcxPopupMenuClassInfoRec(FInfoRecs[AIndex]); +end; + +function TcxBuiltInPopupMenus.Add(AMenuClass: TcxPopupMenuClass; + AHitTypes: TcxGridViewHitTypes; AViewClass: TcxCustomGridViewClass): TcxPopupMenuClassInfoRec; +begin + Result := TcxPopupMenuClassInfoRec.Create(AMenuClass, AHitTypes, AViewClass); + FInfoRecs.Add(Result); +end; + +procedure TcxBuiltInPopupMenus.Clear; +begin + while Count <> 0 do + Delete(Count - 1); +end; + +procedure TcxBuiltInPopupMenus.Delete(AIndex: Integer); +begin + Items[AIndex].Free; + FInfoRecs.Delete(AIndex); +end; + +procedure TcxBuiltInPopupMenus.RegisterItemTo(ADefaultPopupMenu: TcxGridDefaultPopupMenu; + AItemIndex: Integer); +var + AMenu: TComponent; + AIDoPopup: IDoPopup; + ADoPopupProc: TcxGridOnPopupProc; +begin + AMenu := Items[AItemIndex].MenuClass.Create(nil); + if Supports(AMenu, IDoPopup, AIDoPopup) then + ADoPopupProc := AIDoPopup.GetPopupHandler + else + ADoPopupProc := nil; + ADefaultPopupMenu.InternalRegisterPopupMenu(AMenu, Items[AItemIndex].HitTypes, + ADoPopupProc, Items[AItemIndex].ViewClass, True); +end; + +procedure TcxBuiltInPopupMenus.Remove(APopupMenuClass: TcxPopupMenuClass); +var + I: Integer; +begin + for I := Count - 1 downto 0 do + if Items[I].MenuClass = APopupMenuClass then + Delete(I); +end; + +procedure TcxBuiltInPopupMenus.RegisterItemsTo(ADefaultPopupMenu: TcxGridDefaultPopupMenu); +var + I: Integer; +begin + for I := 0 to Count - 1 do + RegisterItemTo(ADefaultPopupMenu, I); +end; + +procedure RegisterPopupMenuClass(APopupMenuClass: TcxPopupMenuClass; + AHitTypes: TcxGridViewHitTypes; AViewClass: TcxCustomGridViewClass); +begin + BuiltInPopupMenuList.Add(APopupMenuClass, AHitTypes, AViewClass); +end; + +procedure UnregisterPopupMenuClass(APopupMenuClass: TcxPopupMenuClass); +begin + BuiltInPopupMenuList.Remove(APopupMenuClass); +end; + +initialization + BuiltInPopupMenuList := TcxBuiltInPopupMenus.Create; +{$IFDEF DELPHI6} + StartClassGroup(TControl); + GroupDescendentsWith(TcxCustomGridPopupMenu, TControl); +{$ENDIF} + +finalization + FreeAndNil(BuiltInPopupMenuList); + +end. + diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridCustomTableView.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridCustomTableView.pas new file mode 100644 index 00000000..e60e2081 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridCustomTableView.pas @@ -0,0 +1,18800 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridCustomTableView; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Messages, Classes, Graphics, Controls, Forms, StdCtrls, Dialogs, + cxClasses, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters, + cxStorage, cxPC, cxFilterControl, cxNavigator, cxListBox, cxEdit, cxButtons, + cxDataStorage, cxCustomData, cxData, cxFilter, cxDataUtils, cxContainer, + cxCheckBox, cxCheckListBox, cxStyles, cxGridCommon, cxGridCustomView; + +const + cxGridFilterDefaultItemMRUItemsListCount = 5; + cxGridFilterDefaultItemPopupMaxDropDownItemCount = 15; + cxGridFilterDefaultMRUItemsListCount = 10; + cxGridItemDefaultMinWidth = 20; + cxGridNavigatorDefaultOffset = 50; + + htCustomGridTableBase = 100; + htFilter = htCustomGridTableBase + 1; + htFilterActivateButton = htCustomGridTableBase + 2; + htFilterCloseButton = htCustomGridTableBase + 3; + htFilterDropDownButton = htCustomGridTableBase + 4; + htFilterCustomizeButton = htCustomGridTableBase + 5; + htRecord = htCustomGridTableBase + 6; + htCell = htCustomGridTableBase + 7; + htExpandButton = htCustomGridTableBase + 8; + + // record kind + rkNone = -1; + rkNormal = 0; + rkNewItem = 1; + + isCustomItemFirst = 0; + isContent = isCustomItemFirst; + isCustomItemLast = isContent; + + bbCustomTableFirst = bbCustomLast + 1; + bbContent = bbCustomTableFirst; + bbFilterBox = bbCustomTableFirst + 1; + bbCustomTableLast = bbFilterBox; + + vsCustomTableFirst = vsCustomLast + 1; + vsContent = vsCustomTableFirst; + vsContentEven = vsCustomTableFirst + 1; + vsContentOdd = vsCustomTableFirst + 2; + vsFilterBox = vsCustomTableFirst + 3; + vsInactive = vsCustomTableFirst + 4; + vsIncSearch = vsCustomTableFirst + 5; + vsSelection = vsCustomTableFirst + 6; + vsCustomTableLast = vsSelection; + +type + TcxGridItemDataBindingClass = class of TcxGridItemDataBinding; + TcxCustomGridDateRange = class; + TcxGridDateRanges = class; + TcxCustomGridRecord = class; + TcxCustomGridTableViewData = class; + TcxCustomGridTableItemsListBox = class; + TcxCustomGridTableCustomizationForm = class; + TcxGridFilterPopup = class; + TcxCustomGridTableController = class; + TcxCustomGridFilterButtonViewInfo = class; + TcxGridFilterActivateButtonViewInfo = class; + TcxGridFilterButtonsViewInfo = class; + TcxGridFilterViewInfo = class; + TcxGridTableDataCellViewInfo = class; + TcxCustomGridRecordViewInfoClass = class of TcxCustomGridRecordViewInfo; + TcxCustomGridRecordViewInfo = class; + TcxCustomGridRecordsViewInfo = class; + TcxCustomGridTableViewInfo = class; + TcxCustomGridTableViewInfoCacheItem = class; + TcxCustomGridTableItem = class; + TcxCustomGridTableDateTimeHandling = class; + TcxCustomGridTableFiltering = class; + TcxCustomGridTableView = class; + + { changes } + + TcxGridDataChange = class(TcxCustomGridViewChange) + public + procedure Execute; override; + function IsLockable: Boolean; override; + end; + + TcxGridRecordChange = class(TcxCustomGridViewChange) + private + FItem: TcxCustomGridTableItem; + FRecord: TcxCustomGridRecord; + FRecordIndex: Integer; + function GetGridView: TcxCustomGridTableView; + function GetRecordViewInfo: TcxCustomGridRecordViewInfo; + public + constructor Create(AGridView: TcxCustomGridView; ARecord: TcxCustomGridRecord; + ARecordIndex: Integer; AItem: TcxCustomGridTableItem = nil); reintroduce; virtual; + procedure Execute; override; + function IsCompatibleWith(AChange: TcxCustomGridChange): Boolean; override; + function IsEqual(AChange: TcxCustomGridChange): Boolean; override; + function IsItemVisible: Boolean; + property GridRecord: TcxCustomGridRecord read FRecord; + property GridView: TcxCustomGridTableView read GetGridView; + property Item: TcxCustomGridTableItem read FItem; + property RecordIndex: Integer read FRecordIndex; + property RecordViewInfo: TcxCustomGridRecordViewInfo read GetRecordViewInfo; + end; + + TcxGridFocusedRecordChange = class(TcxCustomGridViewChange) + private + FFocusedRecordIndex: Integer; + FNewItemRecordFocusingChanged: Boolean; + FPrevFocusedRecordIndex: Integer; + public + constructor Create(AGridView: TcxCustomGridView; + APrevFocusedRecordIndex, AFocusedRecordIndex: Integer; + ANewItemRecordFocusingChanged: Boolean); reintroduce; virtual; + function CanExecuteWhenLocked: Boolean; override; + procedure Execute; override; + property FocusedRecordIndex: Integer read FFocusedRecordIndex; + property NewItemRecordFocusingChanged: Boolean read FNewItemRecordFocusingChanged; + property PrevFocusedRecordIndex: Integer read FPrevFocusedRecordIndex; + end; + + { hit tests } + + TcxGridFilterHitTest = class(TcxCustomGridViewHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + TcxGridFilterCloseButtonHitTest = class(TcxCustomGridViewHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + TcxGridFilterActivateButtonHitTest = class(TcxCustomGridViewHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + TcxGridFilterDropDownButtonHitTest = class(TcxCustomGridViewHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + TcxGridFilterCustomizeButtonHitTest = class(TcxCustomGridViewHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + TcxGridRecordHitTest = class(TcxCustomGridViewHitTest) + private + FGridRecordIndex: Integer; + FGridRecordKind: Integer; + FViewData: TcxCustomGridTableViewData; + function GetGridRecord: TcxCustomGridRecord; + procedure SetGridRecord(Value: TcxCustomGridRecord); + protected + class function GetHitTestCode: Integer; override; + public + class function CanClick: Boolean; virtual; + property GridRecord: TcxCustomGridRecord read GetGridRecord write SetGridRecord; + end; + + TcxGridRecordCellHitTest = class(TcxGridRecordHitTest) + protected + class function GetHitTestCode: Integer; override; + public + Item: TcxCustomGridTableItem; + end; + + TcxGridExpandButtonHitTest = class(TcxGridRecordHitTest) + protected + class function GetHitTestCode: Integer; override; + public + class function CanClick: Boolean; override; + end; + + { data definitions } + + TcxGridDefaultValuesProvider = class(TcxCustomEditDefaultValuesProvider) + public + function IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean; override; + end; + + IcxGridDataController = interface + ['{FEEE7E69-BD54-4B5D-BA0B-B6116B69C0CC}'] + procedure CheckGridModeBufferCount; + function DoScroll(AForward: Boolean): Boolean; + function DoScrollPage(AForward: Boolean): Boolean; + function GetItemDataBindingClass: TcxGridItemDataBindingClass; + function GetItemDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; + function GetNavigatorIsBof: Boolean; + function GetNavigatorIsEof: Boolean; + //function GetFilterPropertyValue(const AName: string; var AValue: Variant): Boolean; + function GetScrollBarPos: Integer; + function GetScrollBarRecordCount: Integer; + //function SetFilterPropertyValue(const AName: string; const AValue: Variant): Boolean; + function SetScrollBarPos(Value: Integer): Boolean; + end; + + TcxGridDataController = class(TcxDataController, + IcxCustomGridDataController, IcxGridDataController) + private + FLoadedData: TMemoryStream; + function GetGridViewValue: TcxCustomGridTableView; + procedure ReadData(Stream: TStream); + procedure WriteData(Stream: TStream); + protected + { IcxCustomGridDataController } + procedure AssignData(ADataController: TcxCustomDataController); + procedure CreateAllItems(AMissingItemsOnly: Boolean); + procedure DeleteAllItems; + procedure GetFakeComponentLinks(AList: TList); + function GetGridView: TcxCustomGridView; + function HasAllItems: Boolean; + function IsDataChangeable: Boolean; + function IsDataLinked: Boolean; + function SupportsCreateAllItems: Boolean; + { IcxGridDataController } + procedure CheckGridModeBufferCount; + function DoScroll(AForward: Boolean): Boolean; + function DoScrollPage(AForward: Boolean): Boolean; + //function GetFilterPropertyValue(const AName: string; var AValue: Variant): Boolean; + function GetItemDataBindingClass: TcxGridItemDataBindingClass; + function GetItemDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; + function GetNavigatorIsBof: Boolean; + function GetNavigatorIsEof: Boolean; + function GetScrollBarPos: Integer; + function GetScrollBarRecordCount: Integer; + //function SetFilterPropertyValue(const AName: string; const AValue: Variant): Boolean; + function SetScrollBarPos(Value: Integer): Boolean; + + function CanSelectRow(ARowIndex: Integer): Boolean; override; + function CompareByField(ARecordIndex1, ARecordIndex2: Integer; + AField: TcxCustomDataField; AMode: TcxDataControllerComparisonMode): Integer; override; + procedure DefineProperties(Filer: TFiler); override; + procedure DoValueTypeClassChanged(AItemIndex: Integer); override; + procedure FilterChanged; override; + function GetDefaultActiveRelationIndex: Integer; override; + function GetFilterDisplayText(ARecordIndex, AItemIndex: Integer): string; override; + //function GetIncrementalSearchText(ARecordIndex, AItemIndex: Integer): string; override; + function GetItemID(AItem: TObject): Integer; override; + function GetSortingBySummaryEngineClass: TcxSortingBySummaryEngineClass; override; + function GetSummaryGroupItemLinkClass: TcxDataSummaryGroupItemLinkClass; override; + function GetSummaryItemClass: TcxDataSummaryItemClass; override; + public + procedure BeginFullUpdate; override; + procedure EndFullUpdate; override; + function CreateDetailLinkObject(ARelation: TcxCustomDataRelation; + ARecordIndex: Integer): TObject; override; + procedure FocusControl(AItemIndex: Integer; var Done: Boolean); override; + function GetDetailDataControllerByLinkObject(ALinkObject: TObject): TcxCustomDataController; override; + function GetDisplayText(ARecordIndex, AItemIndex: Integer): string; override; + function GetFilterDataValue(ARecordIndex: Integer; AField: TcxCustomDataField): Variant; override; + function GetFilterItemFieldCaption(AItem: TObject): string; override; + function GetItem(Index: Integer): TObject; override; + function GetItemSortByDisplayText(AItemIndex: Integer; ASortByDisplayText: Boolean): Boolean; override; + function GetItemValueSource(AItemIndex: Integer): TcxDataEditValueSource; override; + procedure Loaded; override; + procedure UpdateData; override; + + property GridView: TcxCustomGridTableView read GetGridViewValue; + published + property Filter; + property Options; + property Summary; + property OnAfterCancel; + property OnAfterDelete; + property OnAfterInsert; + property OnAfterPost; + property OnBeforeCancel; + property OnBeforeDelete; + property OnBeforeInsert; + property OnBeforePost; + property OnNewRecord; + property OnCompare; + property OnDataChanged; + property OnDetailCollapsing; + property OnDetailCollapsed; + property OnDetailExpanding; + property OnDetailExpanded; + property OnFilterRecord; + property OnGroupingChanged; + property OnRecordChanged; + property OnSortingChanged; + end; + + TcxGridFilterValueListClass = class of TcxGridFilterValueList; + + TcxGridFilterValueList = class(TcxDataFilterValueList) + protected + procedure AddDateTimeAbsoluteFilters(ADateRange: TcxCustomGridDateRange; + AIgnoreTime: Boolean); overload; virtual; + procedure AddDateTimeAbsoluteFilters(AItem: TcxCustomGridTableItem); overload; virtual; + procedure AddDateTimeRelativeFilters(AItem: TcxCustomGridTableItem); virtual; + function SupportedSpecialOperatorKinds: TcxFilterOperatorKinds; virtual; + public + procedure ApplyFilter(AItem: TcxCustomGridTableItem; AIndex: Integer; + AFilterList: TcxFilterCriteriaItemList; AReplaceExistent, AAddToMRUItemsList: Boolean); + function GetIndexByCriteriaItem(ACriteriaItem: TcxFilterCriteriaItem): Integer; override; + procedure Load(AItem: TcxCustomGridTableItem; AInitSortByDisplayText: Boolean = True; + AUseFilteredValues: Boolean = False); reintroduce; virtual; + end; + + TcxGridFilterMRUValueItem = class(TcxMRUItem) + public + Value: Variant; + DisplayText: string; + constructor Create(const AValue: Variant; const ADisplayText: string); + function Equals(AItem: TcxMRUItem): Boolean; override; + end; + + TcxGridFilterMRUValueItemsClass = class of TcxGridFilterMRUValueItems; + + TcxGridFilterMRUValueItems = class(TcxMRUItems) + private + function GetItem(Index: Integer): TcxGridFilterMRUValueItem; + public + procedure Add(const AValue: Variant; const ADisplayText: string); + procedure AddItemsTo(AValueList: TcxGridFilterValueList); + property Items[Index: Integer]: TcxGridFilterMRUValueItem read GetItem; default; + end; + + TcxGridItemDataBinding = class(TPersistent) + private + FData: TObject; + FDefaultValuesProvider: TcxCustomEditDefaultValuesProvider; + FItem: TcxCustomGridTableItem; + FFilterMRUValueItems: TcxGridFilterMRUValueItems; + function GetDataController: TcxCustomDataController; + function GetFilter: TcxDataFilterCriteria; + function GetFilterCriteriaItem: TcxFilterCriteriaItem; + function GetFiltered: Boolean; + function GetGridView: TcxCustomGridTableView; + function GetValueType: string; + function GetValueTypeClass: TcxValueTypeClass; + procedure SetData(Value: TObject); + procedure SetFiltered(Value: Boolean); + procedure SetValueType(const Value: string); + procedure SetValueTypeClass(Value: TcxValueTypeClass); + protected + function GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; + function GetDefaultValueTypeClass: TcxValueTypeClass; virtual; + function GetFilterFieldName: string; virtual; + function GetFilterMRUValueItemsClass: TcxGridFilterMRUValueItemsClass; virtual; + procedure Init; virtual; + function IsValueTypeStored: Boolean; virtual; + property DefaultValuesProvider: TcxCustomEditDefaultValuesProvider read FDefaultValuesProvider; + public + constructor Create(AItem: TcxCustomGridTableItem); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + function DefaultCaption: string; virtual; + function DefaultRepositoryItem: TcxEditRepositoryItem; virtual; + function DefaultWidth(ATakeHeaderIntoAccount: Boolean = True): Integer; virtual; + function GetDefaultValuesProvider(AProperties: TcxCustomEditProperties = nil): IcxEditDefaultValuesProvider; + function IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean; + + function AddToFilter(AParent: TcxFilterCriteriaItemList; AOperatorKind: TcxFilterOperatorKind; + const AValue: Variant; const ADisplayText: string = ''; + AReplaceExistent: Boolean = True): TcxFilterCriteriaItem; + procedure GetFilterDisplayText(const AValue: Variant; var ADisplayText: string); + procedure GetFilterStrings(AStrings: TStrings; AValueList: TcxGridFilterValueList); + procedure GetFilterValues(AValueList: TcxGridFilterValueList; AValuesOnly: Boolean = True; + AInitSortByDisplayText: Boolean = False; ACanUseFilteredValues: Boolean = False); + procedure GetFilterActiveValueIndexes(AValueList: TcxGridFilterValueList; + var AIndexes: TcxGridIndexes); + procedure SetFilterActiveValueIndexes(AValueList: TcxGridFilterValueList; + const AIndexes: TcxGridIndexes); + + property Data: TObject read FData write SetData; + property DataController: TcxCustomDataController read GetDataController; + property Filter: TcxDataFilterCriteria read GetFilter; + property FilterCriteriaItem: TcxFilterCriteriaItem read GetFilterCriteriaItem; + property Filtered: Boolean read GetFiltered write SetFiltered; + property FilterFieldName: string read GetFilterFieldName; + property FilterMRUValueItems: TcxGridFilterMRUValueItems read FFilterMRUValueItems; + property GridView: TcxCustomGridTableView read GetGridView; + property Item: TcxCustomGridTableItem read FItem; + property ValueTypeClass: TcxValueTypeClass read GetValueTypeClass write SetValueTypeClass; + published + property ValueType: string read GetValueType write SetValueType stored IsValueTypeStored; + end; + + { view data } + + // date ranges + + TcxCustomGridDateRangeClass = class of TcxCustomGridDateRange; + + TcxCustomGridDateRange = class + private + FContainer: TcxGridDateRanges; + function GetIndex: Integer; + procedure SetIndex(Value: Integer); + public + destructor Destroy; override; + + function Contains(const ADate: TDateTime): Boolean; virtual; abstract; + function GetDisplayText(const ADate: TDateTime): string; virtual; abstract; + function GetRangeValue(const ADate: TDateTime; AIgnoreTime: Boolean): Variant; virtual; + function GetSortingValue(const ADate: TDateTime): Variant; virtual; + function GetValue(const ADate: TDateTime): Variant; virtual; abstract; + function NeedsSortingByTime: Boolean; virtual; + function NeedsTime: Boolean; virtual; + + property Container: TcxGridDateRanges read FContainer; + property Index: Integer read GetIndex write SetIndex; + end; + + TcxGridHourRange = class(TcxCustomGridDateRange) + public + function Contains(const ADate: TDateTime): Boolean; override; + function GetDisplayText(const ADate: TDateTime): string; override; + function GetValue(const ADate: TDateTime): Variant; override; + function NeedsSortingByTime: Boolean; override; + end; + + TcxGridDayRange = class(TcxCustomGridDateRange) + public + function Contains(const ADate: TDateTime): Boolean; override; + function GetDisplayText(const ADate: TDateTime): string; override; + function GetValue(const ADate: TDateTime): Variant; override; + end; + + TcxGridMonthRange = class(TcxCustomGridDateRange) + public + function Contains(const ADate: TDateTime): Boolean; override; + function GetDisplayText(const ADate: TDateTime): string; override; + function GetRangeValue(const ADate: TDateTime; AIgnoreTime: Boolean): Variant; override; + function GetValue(const ADate: TDateTime): Variant; override; + end; + + TcxGridYearRange = class(TcxCustomGridDateRange) + public + function Contains(const ADate: TDateTime): Boolean; override; + function GetDisplayText(const ADate: TDateTime): string; override; + function GetRangeValue(const ADate: TDateTime; AIgnoreTime: Boolean): Variant; override; + function GetValue(const ADate: TDateTime): Variant; override; + end; + + TcxGridYesterdayRange = class(TcxCustomGridDateRange) + public + function Contains(const ADate: TDateTime): Boolean; override; + function GetDisplayText(const ADate: TDateTime): string; override; + function GetValue(const ADate: TDateTime): Variant; override; + end; + + TcxGridTodayRange = class(TcxCustomGridDateRange) + public + function Contains(const ADate: TDateTime): Boolean; override; + function GetDisplayText(const ADate: TDateTime): string; override; + function GetValue(const ADate: TDateTime): Variant; override; + end; + + TcxGridTomorrowRange = class(TcxCustomGridDateRange) + public + function Contains(const ADate: TDateTime): Boolean; override; + function GetDisplayText(const ADate: TDateTime): string; override; + function GetValue(const ADate: TDateTime): Variant; override; + end; + + TcxGridLastWeekRange = class(TcxCustomGridDateRange) + public + function Contains(const ADate: TDateTime): Boolean; override; + function GetDisplayText(const ADate: TDateTime): string; override; + function GetValue(const ADate: TDateTime): Variant; override; + end; + + TcxGridThisWeekRange = class(TcxCustomGridDateRange) + public + function Contains(const ADate: TDateTime): Boolean; override; + function GetDisplayText(const ADate: TDateTime): string; override; + function GetValue(const ADate: TDateTime): Variant; override; + end; + + TcxGridNextWeekRange = class(TcxCustomGridDateRange) + public + function Contains(const ADate: TDateTime): Boolean; override; + function GetDisplayText(const ADate: TDateTime): string; override; + function GetValue(const ADate: TDateTime): Variant; override; + end; + + TcxGridLastMonthRange = class(TcxCustomGridDateRange) + public + function Contains(const ADate: TDateTime): Boolean; override; + function GetDisplayText(const ADate: TDateTime): string; override; + function GetValue(const ADate: TDateTime): Variant; override; + end; + + TcxGridThisMonthRange = class(TcxCustomGridDateRange) + public + function Contains(const ADate: TDateTime): Boolean; override; + function GetDisplayText(const ADate: TDateTime): string; override; + function GetValue(const ADate: TDateTime): Variant; override; + end; + + TcxGridNextMonthRange = class(TcxCustomGridDateRange) + public + function Contains(const ADate: TDateTime): Boolean; override; + function GetDisplayText(const ADate: TDateTime): string; override; + function GetValue(const ADate: TDateTime): Variant; override; + end; + + TcxGridLastYearRange = class(TcxCustomGridDateRange) + public + function Contains(const ADate: TDateTime): Boolean; override; + function GetDisplayText(const ADate: TDateTime): string; override; + function GetValue(const ADate: TDateTime): Variant; override; + end; + + TcxGridThisYearRange = class(TcxCustomGridDateRange) + public + function Contains(const ADate: TDateTime): Boolean; override; + function GetDisplayText(const ADate: TDateTime): string; override; + function GetValue(const ADate: TDateTime): Variant; override; + end; + + TcxGridNextYearRange = class(TcxCustomGridDateRange) + public + function Contains(const ADate: TDateTime): Boolean; override; + function GetDisplayText(const ADate: TDateTime): string; override; + function GetValue(const ADate: TDateTime): Variant; override; + end; + + TcxGridDateTimeFilter = (dtfRelativeDays, dtfRelativeDayPeriods, dtfRelativeWeeks, + dtfRelativeMonths, dtfRelativeYears, dtfPastFuture, dtfMonths, dtfYears); + TcxGridDateTimeFilters = set of TcxGridDateTimeFilter; + TcxGridDateTimeGrouping = (dtgDefault, dtgByDateAndTime, dtgRelativeToToday, + dtgByHour, dtgByDate, dtgByMonth, dtgByYear); + + TcxGridDateRangesClass = class of TcxGridDateRanges; + + TcxGridDateRanges = class + private + FDateTimeHandling: TcxCustomGridTableDateTimeHandling; + FItems: TList; + FStartOfThisWeek: TDateTime; + FThisDay: Word; + FThisMonth: Word; + FThisMonthNumber: Integer; + FThisYear: Word; + FToday: TDateTime; + function GetCount: Integer; + function GetItem(Index: Integer): TcxCustomGridDateRange; + protected + procedure AddItem(AItem: TcxCustomGridDateRange); + procedure RemoveItem(AItem: TcxCustomGridDateRange); + function GetItemIndex(AItem: TcxCustomGridDateRange): Integer; + procedure SetItemIndex(AItem: TcxCustomGridDateRange; AValue: Integer); + + procedure InitConsts; virtual; + public + constructor Create; virtual; + destructor Destroy; override; + procedure Add(ARange: TcxCustomGridDateRange); overload; + procedure Add(ARangeClass: TcxCustomGridDateRangeClass); overload; + procedure Clear; + function GetRange(const ADate: TDateTime): TcxCustomGridDateRange; overload; + function GetRange(ARangeClass: TcxCustomGridDateRangeClass): TcxCustomGridDateRange; overload; + procedure Init(ADateTimeHandling: TcxCustomGridTableDateTimeHandling); virtual; + function IsEmpty: Boolean; + function NeedSortingByTime: Boolean; + function NeedTime: Boolean; + + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxCustomGridDateRange read GetItem; default; + + property DateTimeHandling: TcxCustomGridTableDateTimeHandling read FDateTimeHandling; + property StartOfThisWeek: TDateTime read FStartOfThisWeek; + property ThisDay: Word read FThisDay; + property ThisMonth: Word read FThisMonth; + property ThisMonthNumber: Integer read FThisMonthNumber; + property ThisYear: Word read FThisYear; + property Today: TDateTime read FToday; + end; + + TcxGridFilteringDateRangesClass = class of TcxGridFilteringDateRanges; + + TcxGridFilteringDateRanges = class(TcxGridDateRanges) + public + procedure Init(ADateTimeHandling: TcxCustomGridTableDateTimeHandling; + ADateTimeFilters: TcxGridDateTimeFilters); reintroduce; virtual; + end; + + TcxGridGroupingDateRangesClass = class of TcxGridGroupingDateRanges; + + TcxGridGroupingDateRanges = class(TcxGridDateRanges) + public + procedure Init(ADateTimeHandling: TcxCustomGridTableDateTimeHandling; + ADateTimeGrouping: TcxGridDateTimeGrouping); reintroduce; virtual; + end; + + // record + + TcxCustomGridRecordClass = class of TcxCustomGridRecord; + + TcxCustomGridRecord = class + private + //FData: Pointer; + FIndex: Integer; + FViewData: TcxCustomGridTableViewData; + FViewInfo: TcxCustomGridRecordViewInfo; + function GetController: TcxCustomGridTableController; + function GetDataController: TcxCustomDataController; + function GetDragHighlighted: Boolean; + function GetFocused: Boolean; + function GetGridView: TcxCustomGridTableView; + function GetIsEditing: Boolean; + function GetIsNewItemRecord: Boolean; + function GetIsValid: Boolean; + function GetLastParentRecordCount: Integer; + function GetLevel: Integer; + function GetPartVisible: Boolean; + function GetRecordIndex: Integer; + procedure SetExpanded(Value: Boolean); + procedure SetFocused(Value: Boolean); + protected + RecordInfo: TcxRowInfo; + procedure RefreshRecordInfo; virtual; + + procedure DoCollapse(ARecurse: Boolean); virtual; + procedure DoExpand(ARecurse: Boolean); virtual; + //function GetDestroyingOnExpanding: Boolean; virtual; + function GetExpandable: Boolean; virtual; + function GetExpanded: Boolean; virtual; + procedure ToggleExpanded; virtual; + + function GetHasCells: Boolean; virtual; + function GetIsData: Boolean; virtual; + function GetIsFirst: Boolean; virtual; + function GetIsLast: Boolean; virtual; + function GetIsParent: Boolean; virtual; + function GetIsParentRecordLast(AIndex: Integer): Boolean; + function GetParentRecord: TcxCustomGridRecord; virtual; + function GetSelected: Boolean; virtual; + function GetVisible: Boolean; virtual; + procedure SetSelected(Value: Boolean); virtual; + + function GetDisplayText(Index: Integer): string; virtual; + function GetValueCount: Integer; virtual; + function GetValue(Index: Integer): Variant; virtual; + procedure SetDisplayText(Index: Integer; const Value: string); virtual; + procedure SetValue(Index: Integer; const Value: Variant); virtual; + + procedure KeyDown(var Key: Word; Shift: TShiftState); virtual; + + function GetViewInfoCacheItemClass: TcxCustomGridViewInfoCacheItemClass; virtual; abstract; + function GetViewInfoClass: TcxCustomGridRecordViewInfoClass; virtual; abstract; + + property IsParent: Boolean read GetIsParent; + property IsParentRecordLast[AIndex: Integer]: Boolean read GetIsParentRecordLast; + property IsValid: Boolean read GetIsValid; + property LastParentRecordCount: Integer read GetLastParentRecordCount; + + property Controller: TcxCustomGridTableController read GetController; + property DataController: TcxCustomDataController read GetDataController; + //property DestroyingOnExpanding: Boolean read GetDestroyingOnExpanding; + public + constructor Create(AViewData: TcxCustomGridTableViewData; AIndex: Integer; + const ARecordInfo: TcxRowInfo); virtual; + destructor Destroy; override; + function CanFocus: Boolean; virtual; + function CanFocusCells: Boolean; virtual; + procedure Collapse(ARecurse: Boolean); + procedure Expand(ARecurse: Boolean); + function GetFirstFocusableChild: TcxCustomGridRecord; virtual; + function GetLastFocusableChild(ARecursive: Boolean): TcxCustomGridRecord; virtual; + procedure Invalidate(AItem: TcxCustomGridTableItem = nil); virtual; + procedure MakeVisible; + + //property Data: Pointer read FData write FData; + property DragHighlighted: Boolean read GetDragHighlighted; + property DisplayTexts[Index: Integer]: string read GetDisplayText write SetDisplayText; + property Expandable: Boolean read GetExpandable; + property Expanded: Boolean read GetExpanded write SetExpanded; + property Focused: Boolean read GetFocused write SetFocused; + property GridView: TcxCustomGridTableView read GetGridView; + property HasCells: Boolean read GetHasCells; + property Index: Integer read FIndex; + property IsData: Boolean read GetIsData; + property IsEditing: Boolean read GetIsEditing; + property IsFirst: Boolean read GetIsFirst; + property IsLast: Boolean read GetIsLast; + property IsNewItemRecord: Boolean read GetIsNewItemRecord; + property Level: Integer read GetLevel; + property ParentRecord: TcxCustomGridRecord read GetParentRecord; + property PartVisible: Boolean read GetPartVisible; + property RecordIndex: Integer read GetRecordIndex; + property Selected: Boolean read GetSelected write SetSelected; + property ValueCount: Integer read GetValueCount; + property Values[Index: Integer]: Variant read GetValue write SetValue; + property ViewData: TcxCustomGridTableViewData read FViewData; + property ViewInfo: TcxCustomGridRecordViewInfo read FViewInfo; + property Visible: Boolean read GetVisible; + end; + + // view data + + TcxGridDataOperation = (doSorting, doGrouping, doFiltering); + + TcxCustomGridTableViewData = class(TcxCustomGridViewData) + private + FEditingRecord: TcxCustomGridRecord; + FNewItemRecord: TcxCustomGridRecord; + FRecords: TList; + function GetController: TcxCustomGridTableController; + function GetEditingRecord: TcxCustomGridRecord; + function GetGridView: TcxCustomGridTableView; + function GetInternalRecord(Index: Integer): TcxCustomGridRecord; + function GetRecord(Index: Integer): TcxCustomGridRecord; + function GetRecordCount: Integer; + function GetViewInfo: TcxCustomGridTableViewInfo; + function CreateRecord(AIndex: Integer): TcxCustomGridRecord; + protected + function GetFilterValueListClass: TcxGridFilterValueListClass; virtual; + function GetRecordByKind(AKind, AIndex: Integer): TcxCustomGridRecord; virtual; + function GetRecordClass(ARecordInfo: TcxRowInfo): TcxCustomGridRecordClass; virtual; abstract; + function GetRecordKind(ARecord: TcxCustomGridRecord): Integer; virtual; + + procedure AssignEditingRecord; + + procedure CreateNewItemRecord; + procedure DestroyNewItemRecord; + function GetNewItemRecordClass: TcxCustomGridRecordClass; virtual; + procedure RecreateNewItemRecord; + + property Controller: TcxCustomGridTableController read GetController; + property InternalRecords[Index: Integer]: TcxCustomGridRecord read GetInternalRecord; + property ViewInfo: TcxCustomGridTableViewInfo read GetViewInfo; + public + constructor Create(AGridView: TcxCustomGridView); override; + destructor Destroy; override; + + procedure Collapse(ARecurse: Boolean); virtual; + procedure DestroyRecords; + procedure Expand(ARecurse: Boolean); virtual; + function GetRecordByIndex(AIndex: Integer): TcxCustomGridRecord; + function GetRecordByRecordIndex(ARecordIndex: Integer): TcxCustomGridRecord; + function GetRecordIndexByRecord(ARecord: TcxCustomGridRecord): Integer; + function IsRecordIndexValid(AIndex: Integer): Boolean; + procedure Refresh(ARecordCount: Integer); virtual; + procedure RefreshRecords; + + procedure CheckNewItemRecord; + function HasNewItemRecord: Boolean; virtual; + + function AddItemToFilter(AParent: TcxFilterCriteriaItemList; AItem: TcxCustomGridTableItem; + AOperatorKind: TcxFilterOperatorKind; const AValue: Variant; ADisplayText: string = ''; + AReplaceExistent: Boolean = True): TcxFilterCriteriaItem; + function CreateFilterValueList: TcxGridFilterValueList; + function GetDisplayText(ARecordIndex, AItemIndex: Integer; out AText: string; + AUseCustomValue: Boolean = False; ACustomValueOperation: TcxGridDataOperation = doGrouping): Boolean; virtual; + + // custom data handling + function CustomCompareDataValues(AField: TcxCustomDataField; const AValue1, AValue2: Variant; + AMode: TcxDataControllerComparisonMode): Integer; virtual; + function GetCustomDataDisplayText(ARecordIndex, AItemIndex: Integer; + AOperation: TcxGridDataOperation): string; virtual; + function GetCustomDataValue(AField: TcxCustomDataField; const AValue: Variant; + AOperation: TcxGridDataOperation): Variant; overload; + function GetCustomDataValue(AItem: TcxCustomGridTableItem; const AValue: Variant; + AOperation: TcxGridDataOperation): Variant; overload; virtual; + function HasCustomDataHandling(AField: TcxCustomDataField; AOperation: TcxGridDataOperation): Boolean; overload; + function HasCustomDataHandling(AItem: TcxCustomGridTableItem; AOperation: TcxGridDataOperation): Boolean; overload; virtual; + function NeedsCustomDataComparison(AField: TcxCustomDataField; AMode: TcxDataControllerComparisonMode): Boolean; virtual; + + property EditingRecord: TcxCustomGridRecord read FEditingRecord; + property GridView: TcxCustomGridTableView read GetGridView; + property NewItemRecord: TcxCustomGridRecord read FNewItemRecord; + property RecordCount: Integer read GetRecordCount; + property Records[Index: Integer]: TcxCustomGridRecord read GetRecord; + end; + + { controller } + + // drag&drop objects + + TcxCustomGridTableMovingObject = class(TcxCustomGridMovingObject) + private + function GetController: TcxCustomGridTableController; + function GetCustomizationForm: TcxCustomGridTableCustomizationForm; + protected + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); override; + property Controller: TcxCustomGridTableController read GetController; + property CustomizationForm: TcxCustomGridTableCustomizationForm read GetCustomizationForm; + end; + + TcxGridItemContainerKind = Integer; + + TcxGridItemContainerZone = class + public + ItemIndex: Integer; + constructor Create(AItemIndex: Integer); + function IsEqual(Value: TcxGridItemContainerZone): Boolean; virtual; + end; + + TcxCustomGridTableItemMovingObject = class(TcxCustomGridTableMovingObject) + private + FDestItemContainerKind: TcxGridItemContainerKind; + FDestZone: TcxGridItemContainerZone; + FSourceItemContainerKind: TcxGridItemContainerKind; + + procedure SetDestItemContainerKind(Value: TcxGridItemContainerKind); + procedure SetDestZone(Value: TcxGridItemContainerZone); + protected + procedure CalculateDestParams(AHitTest: TcxCustomGridHitTest; + out AContainerKind: TcxGridItemContainerKind; out AZone: TcxGridItemContainerZone); virtual; + procedure CheckDestItemContainerKind(var AValue: TcxGridItemContainerKind); virtual; + function GetCustomizationFormListBox: TcxCustomGridItemsListBox; override; + function IsSourceCustomizationForm: Boolean; override; + + procedure BeginDragAndDrop; override; + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); override; + procedure EndDragAndDrop(Accepted: Boolean); override; + + property DestItemContainerKind: TcxGridItemContainerKind read FDestItemContainerKind + write SetDestItemContainerKind; + property DestZone: TcxGridItemContainerZone read FDestZone write SetDestZone; + property SourceItemContainerKind: TcxGridItemContainerKind read FSourceItemContainerKind + write FSourceItemContainerKind; + public + constructor Create(AControl: TcxControl); override; + destructor Destroy; override; + end; + + // customization form + + TcxCustomGridTableItemsListBoxClass = class of TcxCustomGridTableItemsListBox; + + TcxCustomGridTableItemsListBox = class(TcxCustomGridItemsListBox) + private + function GetGridView: TcxCustomGridTableView; + protected + procedure RefreshItemsAsTableItems; + property GridView: TcxCustomGridTableView read GetGridView; + end; + + TcxCustomGridTableCustomizationForm = class(TcxCustomGridCustomizationForm) + private + FItemsListBox: TcxCustomGridTableItemsListBox; + FItemsPage: TcxTabSheet; + protected + procedure CreateControls; override; + function GetItemsListBoxClass: TcxCustomGridTableItemsListBoxClass; virtual; + function GetItemsPageCaption: string; virtual; abstract; + function GetItemsPageVisible: Boolean; virtual; + procedure InitPageControl; override; + + property ItemsListBox: TcxCustomGridTableItemsListBox read FItemsListBox; + public + procedure RefreshData; override; + property ItemsPage: TcxTabSheet read FItemsPage; + end; + + // popups + + IcxGridFilterPopupOwner = interface(IcxCustomGridPopupOwner) + ['{1FC070B2-36E5-4388-B22D-1FF5D240E95F}'] + function GetItem: TcxCustomGridTableItem; + end; + + TcxGridFilterPopupListBox = class(TcxGridPopupListBox) + private + function GetPopup: TcxGridFilterPopup; + protected + function CanHaveCheck(AItemIndex: Integer): Boolean; override; + procedure DrawItemContent(ACanvas: TcxCanvas; AIndex: Integer; ARect: TRect; + AState: TOwnerDrawState); override; + function HasCheck(AItemIndex: Integer): Boolean; override; + public + property Popup: TcxGridFilterPopup read GetPopup; + end; + + TcxGridFilterPopupClass = class of TcxGridFilterPopup; + + TcxGridFilterPopup = class(TcxCustomGridPopup) + private + FButton: TcxButton; + FFilterChangedByCheck: Boolean; + FItem: TcxCustomGridTableItem; + FListBox: TcxGridFilterPopupListBox; + FListBoxItems: TStringList; + FValueList: TcxGridFilterValueList; + function GetFilter: TcxDataFilterCriteria; + function GetGridView: TcxCustomGridTableView; + //function GetOwnerValue: IcxGridFilterPopupOwner; + //procedure SetOwnerValue(Value: IcxGridFilterPopupOwner); + procedure SetFilterChangedByCheck(Value: Boolean); + procedure ButtonClicked(Sender: TObject); + procedure ListBoxAction(Sender: TcxGridPopupListBox; AItemIndex: Integer); + protected + procedure AddListBoxItems; virtual; + procedure AdjustListBoxSize; virtual; + procedure ApplyFilterUsingCheckedItems(const AItemIndexes: TcxGridIndexes); virtual; + procedure ApplyFilterUsingClickedItem(AItemIndex: Integer); virtual; + function GetImmediateFilterUsingChecks: Boolean; virtual; + function GetListBoxCheckedItemIndexes: TcxGridIndexes; virtual; + function GetSelectedItemIndex: Integer; virtual; + procedure InitButton; virtual; + procedure InitListBox; virtual; + procedure InitPopup; override; + function IsButtonVisible: Boolean; virtual; + function IsCheck(AItemIndex: Integer): Boolean; virtual; + function IsMRUItemsListSeparator(AItemIndex: Integer): Boolean; + function SupportsChecks: Boolean; virtual; + procedure UpdateButtonEnabled; virtual; + + property Button: TcxButton read FButton; + property Filter: TcxDataFilterCriteria read GetFilter; + property FilterChangedByCheck: Boolean read FFilterChangedByCheck write SetFilterChangedByCheck; + property ImmediateFilterUsingChecks: Boolean read GetImmediateFilterUsingChecks; + property ListBox: TcxGridFilterPopupListBox read FListBox; + property ListBoxItems: TStringList read FListBoxItems; + property SelectedItemIndex: Integer read GetSelectedItemIndex; + property ValueList: TcxGridFilterValueList read FValueList; + public + constructor Create(AGridView: TcxCustomGridView); override; + destructor Destroy; override; + procedure CloseUp; override; + property GridView: TcxCustomGridTableView read GetGridView; + property Item: TcxCustomGridTableItem read FItem; +// property Owner: IcxGridFilterPopupOwner read GetOwnerValue write SetOwnerValue; + end; + + TcxGridFilterMRUItemsPopupClass = class of TcxGridFilterMRUItemsPopup; + + TcxGridFilterMRUItemsPopup = class(TcxCustomGridPopup) + private + FListBox: TcxGridPopupListBox; + function GetFiltering: TcxCustomGridTableFiltering; + function GetGridView: TcxCustomGridTableView; + procedure ListBoxAction(Sender: TcxGridPopupListBox; AItemIndex: Integer); + protected + procedure AddFilterMRUItems(AStrings: TStrings); virtual; + procedure ApplyFilterMRUItem(AItemIndex: Integer); virtual; + function GetTextOffsetHorz: Integer; virtual; + procedure InitPopup; override; + + property Filtering: TcxCustomGridTableFiltering read GetFiltering; + property ListBox: TcxGridPopupListBox read FListBox; + public + constructor Create(AGridView: TcxCustomGridView); override; + property GridView: TcxCustomGridTableView read GetGridView; + property TextOffsetHorz: Integer read GetTextOffsetHorz; + end; + + TcxCustomGridCustomizationPopup = class(TcxCustomGridPopup) + private + FCheckListBox: TcxCheckListBox; + FDragItemIndex: Integer; + FScrollDirection: TcxDirection; + FScrollTimer: TcxTimer; + function GetGridView: TcxCustomGridTableView; + procedure SetScrollDirection(Value: TcxDirection); + procedure CheckListBoxClick(Sender: TObject); + procedure CheckListBoxCheckClick(Sender: TObject; AIndex: Integer; + APrevState, ANewState: TcxCheckBoxState); + procedure CheckListBoxEndDrag(Sender, Target: TObject; X, Y: Integer); + procedure CheckListBoxKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure CheckListBoxMouseDown(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + procedure CheckListBoxStartDrag(Sender: TObject; var DragObject: TDragObject); + procedure CheckListBoxDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure CheckListBoxDragDrop(Sender, Source: TObject; X, Y: Integer); + procedure ScrollTimerHandler(Sender: TObject); + protected + procedure AddCheckListBoxItems; virtual; abstract; + procedure AdjustCheckListBoxSize(AFixedHeight: Boolean = False); virtual; + procedure CheckClicked(AIndex: Integer; AChecked: Boolean); virtual; + procedure CreateCheckListBox; virtual; + function GetCheckListBoxColumnWidth: Integer; virtual; + function GetDropDownCount: Integer; virtual; abstract; + function GetItemInsertionIndex(X, Y: Integer): Integer; + procedure InitPopup; override; + procedure RefreshCheckListBoxItems; + function SupportsItemMoving: Boolean; virtual; abstract; + + procedure GetCheckListBoxSelectedItems(AItems: TList); + procedure SetCheckListBoxSelectedItems(AItems: TList); + + procedure ItemClicked(AItem: TObject; AChecked: Boolean); virtual; abstract; + function GetItemIndex(AItem: TObject): Integer; virtual; abstract; + procedure SetItemIndex(AItem: TObject; AIndex: Integer); virtual; abstract; + + property CheckListBoxColumnWidth: Integer read GetCheckListBoxColumnWidth; + property DragItemIndex: Integer read FDragItemIndex write FDragItemIndex; + property ScrollDirection: TcxDirection read FScrollDirection write SetScrollDirection; + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure CloseUp; override; + procedure CorrectBoundsWithDesktopWorkArea(var APosition: TPoint); override; + procedure Popup; override; + property CheckListBox: TcxCheckListBox read FCheckListBox; + property GridView: TcxCustomGridTableView read GetGridView; + end; + + TcxCustomGridItemsCustomizationPopupClass = class of TcxCustomGridItemsCustomizationPopup; + + TcxCustomGridItemsCustomizationPopup = class(TcxCustomGridCustomizationPopup) + protected + procedure AddCheckListBoxItems; override; + function GetDropDownCount: Integer; override; + function SupportsItemMoving: Boolean; override; + + procedure ItemClicked(AItem: TObject; AChecked: Boolean); override; + function GetItemIndex(AItem: TObject): Integer; override; + procedure SetItemIndex(AItem: TObject; AIndex: Integer); override; + end; + + // controllers + + TcxGridEditingControllerClass = class of TcxGridEditingController; + + TcxGridEditingController = class + private + FController: TcxCustomGridTableController; + FEdit: TcxCustomEdit; + FEditHiding: Boolean; + FEditingItem: TcxCustomGridTableItem; + FEditingItemSetting: Boolean; + FEditList: TcxInplaceEditList; + FEditPreparing: Boolean; + FEditShowingTimer: TcxTimer; + FEditShowingTimerItem: TcxCustomGridTableItem; + FEditUpdateNeeded: Boolean; + FInitiatingEditing: Boolean; + FIsEditPlaced: Boolean; + FIsErrorOnEditExit: Boolean; + FPrevEditOnChange: TNotifyEvent; + FPrevEditOnEditValueChanged: TNotifyEvent; + function GetEditingProperties: TcxCustomEditProperties; + function GetGridView: TcxCustomGridTableView; + function GetIsEditing: Boolean; + procedure SetEditingItem(Value: TcxCustomGridTableItem); + procedure EditShowingTimerHandler(Sender: TObject); + protected + procedure AfterViewInfoCalculate; virtual; + procedure BeforeViewInfoCalculate; virtual; + procedure CancelEditUpdatePost; + function CanInitEditing: Boolean; virtual; + function CanRemoveEditFocus: Boolean; virtual; + function CanUpdateEditValue: Boolean; virtual; + procedure CheckEdit; + procedure CheckEditUpdatePost; + procedure DoEditChanged; virtual; + procedure DoEditKeyDown(var Key: Word; Shift: TShiftState); virtual; + procedure DoUpdateEdit; + function GetHideEditOnExit: Boolean; virtual; + function GetHideEditOnFocusedRecordChange: Boolean; virtual; + procedure InitEdit; virtual; + procedure UninitEdit; virtual; + procedure PostEditingData; virtual; + procedure PostEditUpdate; + function PrepareEdit(AItem: TcxCustomGridTableItem; AOnMouseEvent: Boolean): Boolean; virtual; + procedure UpdateEditValue; + procedure UpdateValue; + + procedure AssignEditEvents; virtual; + procedure UnassignEditEvents; virtual; + procedure EditAfterKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); virtual; + procedure EditChanged(Sender: TObject); virtual; + procedure EditEditing(Sender: TObject; var CanEdit: Boolean); virtual; + procedure EditExit(Sender: TObject); virtual; + procedure EditFocusChanged(Sender: TObject); virtual; + procedure EditKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); virtual; + procedure EditKeyPress(Sender: TObject; var Key: Char); virtual; + procedure EditKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); virtual; + procedure EditPostEditValue(Sender: TObject); virtual; + procedure EditValueChanged(Sender: TObject); virtual; + + property EditHiding: Boolean read FEditHiding; + property EditingProperties: TcxCustomEditProperties read GetEditingProperties; + property EditList: TcxInplaceEditList read FEditList; + property EditPreparing: Boolean read FEditPreparing; + property EditUpdateNeeded: Boolean read FEditUpdateNeeded; + property HideEditOnExit: Boolean read GetHideEditOnExit; + property HideEditOnFocusedRecordChange: Boolean read GetHideEditOnFocusedRecordChange; + property InitiatingEditing: Boolean read FInitiatingEditing; + property IsEditPlaced: Boolean read FIsEditPlaced; + property IsErrorOnEditExit: Boolean read FIsErrorOnEditExit; + public + constructor Create(AController: TcxCustomGridTableController); virtual; + destructor Destroy; override; + + procedure HideEdit(Accept: Boolean); virtual; + procedure RemoveEdit(AProperties: TcxCustomEditProperties); virtual; + procedure ShowEdit(AItem: TcxCustomGridTableItem = nil); overload; + procedure ShowEdit(AItem: TcxCustomGridTableItem; Key: Char); overload; + procedure ShowEdit(AItem: TcxCustomGridTableItem; Shift: TShiftState; X, Y: Integer); overload; + procedure UpdateEdit; + + procedure StartEditShowingTimer(AItem: TcxCustomGridTableItem); + procedure StopEditShowingTimer; + + property Controller: TcxCustomGridTableController read FController; + property Edit: TcxCustomEdit read FEdit; + property EditingItem: TcxCustomGridTableItem read FEditingItem write SetEditingItem; + property GridView: TcxCustomGridTableView read GetGridView; + property IsEditing: Boolean read GetIsEditing; + end; + + TcxGridDragOpenInfoExpand = class(TcxCustomGridDragOpenInfo) + public + GridRecord: TcxCustomGridRecord; + constructor Create(AGridRecord: TcxCustomGridRecord); virtual; + function Equals(AInfo: TcxCustomGridDragOpenInfo): Boolean; override; + procedure Run; override; + end; + + TcxCustomGridTableCanItemFocus = function(AOwner: TcxCustomGridTableView; + AItemIndex: Integer; AData: TObject): Boolean; + + TcxCustomGridTableController = class(TcxCustomGridController) + private + FAllowAppendRecord: Boolean; + FAllowCheckEdit: Boolean; + FBlockRecordKeyboardHandling: Boolean; + FCheckEditNeeded: Boolean; + FCheckingCoordinate: Boolean; + FClickedCellViewInfo: TcxGridTableDataCellViewInfo; + FDragDropText: string; + FDragScrollDirection: TcxDirection; + FDragScrollTimer: TcxTimer; + FDragHighlightedRecord: TcxCustomGridRecord; + FEatKeyPress: Boolean; + FEditingController: TcxGridEditingController; + FFilterMRUItemsPopup: TcxGridFilterMRUItemsPopup; + FFilterPopup: TcxGridFilterPopup; + FFocusedItem: TcxCustomGridTableItem; + FFocusOnRecordFocusing: Boolean; + FForcingWidthItem: TcxCustomGridTableItem; + FGridModeBufferCountUpdateNeeded: Boolean; + FGridModeBufferCountUpdateTimer: TcxTimer; + FIsPullFocusing: Boolean; + FIsReadyForImmediateEditing: Boolean; + FIsRecordUnselecting: Boolean; + FItemsCustomizationPopup: TcxCustomGridItemsCustomizationPopup; + FMovingItem: TcxCustomGridTableItem; + FPullFocusingItem: TcxCustomGridTableItem; + FPullFocusingMousePos: TPoint; + FPullFocusingOriginHitTest: TcxCustomGridHitTest; + FPullFocusingRecordId: Variant; + FPullFocusingScrollingDirection: TcxDirection; + FPullFocusingScrollingTimer: TcxTimer; + FScrollDirection: TcxDirection; + FScrollTimer: TcxTimer; + FTopRecordIndex: Integer; + FUnselectingRecordIndex: Integer; + + function GetEditingItem: TcxCustomGridTableItem; + function GetFilterMRUItemsPopup: TcxGridFilterMRUItemsPopup; + function GetFilterPopup: TcxGridFilterPopup; + function GetFocusedItemIndex: Integer; + function GetFocusedRecordIndex: Integer; + function GetGridView: TcxCustomGridTableView; + function GetIncSearchingItem: TcxCustomGridTableItem; + function GetIncSearchingText: string; + function GetIsEditing: Boolean; + function GetIsIncSearching: Boolean; + function GetIsItemMoving: Boolean; + function GetItemsCustomizationPopup: TcxCustomGridItemsCustomizationPopup; + function GetMasterController: TcxCustomGridTableController; + function GetMultiSelect: Boolean; + function GetNewItemRecordFocused: Boolean; + function GetSelectedRecord(Index: Integer): TcxCustomGridRecord; + function GetSelectedRecordCount: Integer; + function GetViewData: TcxCustomGridTableViewData; + function GetViewInfo: TcxCustomGridTableViewInfo; + procedure SetDragHighlightedRecord(Value: TcxCustomGridRecord); + procedure SetEditingItem(Value: TcxCustomGridTableItem); + procedure SetFocusedItem(Value: TcxCustomGridTableItem); + procedure SetFocusedItemIndex(Value: Integer); + procedure SetFocusedRecordIndex(Value: Integer); + procedure SetIncSearchingText(const Value: string); + procedure SetInternalTopRecordIndex(Value: Integer); + procedure SetNewItemRecordFocused(Value: Boolean); + procedure SetScrollDirection(Value: TcxDirection); + procedure SetTopRecordIndex(Value: Integer); + + procedure DragScrollTimerHandler(Sender: TObject); + procedure GridModeBufferCountUpdateTimerHandler(Sender: TObject); + procedure PullFocusingScrollingTimerHandler(Sender: TObject); + + procedure CreateScrollTimer; + procedure DestroyScrollTimer; + procedure ScrollTimerHandler(Sender: TObject); + protected + procedure AfterPaint; override; + procedure BeforePaint; override; + function CanFocusOnClick(X, Y: Integer): Boolean; override; + procedure DetailFocused(ADetail: TcxCustomGridView); override; + procedure DoEnter; override; + procedure DoExit; override; + function MayFocus: Boolean; override; + procedure RemoveFocus; override; + procedure SetFocus(ANotifyMaster: Boolean); override; + + procedure AfterOffset; virtual; + procedure BeforeKillFocus; override; + procedure BeforeOffset; virtual; + function CanAppend(ACheckOptions: Boolean): Boolean; virtual; + procedure CancelCheckEditPost; + function CanDelete(ACheckOptions: Boolean): Boolean; virtual; + function CanEdit: Boolean; virtual; + procedure CheckCoordinates; override; + function CanHScrollBarHide: Boolean; virtual; + function CanInsert(ACheckOptions: Boolean): Boolean; virtual; + procedure CheckEdit; virtual; + procedure CheckTopRecordIndex(var Value: Integer); virtual; + function FindNextCustomItem(AFocusedItemIndex, AItemCount: Integer; + AGoForward, AGoOnCycle: Boolean; ACanFocus: TcxCustomGridTableCanItemFocus; + AData: TObject; var AItemIndex: Integer; out ACycleChanged: Boolean): Boolean; + procedure FocusedItemChanged(APrevFocusedItem: TcxCustomGridTableItem); virtual; + procedure FocusedRecordChanged(APrevFocusedRecordIndex, AFocusedRecordIndex: Integer; + ANewItemRecordFocusingChanged: Boolean); virtual; + function GetCancelEditingOnExit: Boolean; virtual; + function GetFilterMRUItemsPopupClass: TcxGridFilterMRUItemsPopupClass; virtual; + function GetFilterPopupClass: TcxGridFilterPopupClass; virtual; + function GetFocusedRecord: TcxCustomGridRecord; virtual; + function GetIsRecordsScrollHorizontal: Boolean; virtual; abstract; + function GetItemsCustomizationPopupClass: TcxCustomGridItemsCustomizationPopupClass; virtual; + function GetMaxTopRecordIndexValue: Integer; virtual; + function GetPatternObject(AObject: TPersistent): TPersistent; override; + function GetScrollBarOffsetBegin: Integer; virtual; + function GetScrollBarOffsetEnd: Integer; virtual; + function GetScrollBarPos: Integer; virtual; + function GetScrollBarRecordCount: Integer; virtual; + function GetVisibleRecordCount(AFirstRecordIndex: Integer; + ACalculateDown: Boolean = True): Integer; virtual; + procedure PostCheckEdit; + procedure ProcessCheckEditPost; + procedure ScrollData(ADirection: TcxDirection); virtual; + procedure SetFocusedRecord(Value: TcxCustomGridRecord); virtual; + procedure SetScrollBarPos(Value: Integer); virtual; + + procedure CancelGridModeBufferCountUpdate; + procedure CheckGridModeBufferCountUpdatePost; + procedure PostGridModeBufferCountUpdate; + property GridModeBufferCountUpdateNeeded: Boolean read FGridModeBufferCountUpdateNeeded; + + // internal draganddrop data scrolling + function CanScrollData(ADirection: TcxDirection): Boolean; virtual; + function GetScrollDataTimeInterval(ADirection: TcxDirection): Integer; virtual; + property ScrollDirection: TcxDirection read FScrollDirection write SetScrollDirection; + + // selection + function CanPostponeRecordSelection: Boolean; virtual; + function CanProcessMultiSelect(AIsKeyboard: Boolean): Boolean; overload; virtual; + function CanProcessMultiSelect(AHitTest: TcxCustomGridHitTest; + AShift: TShiftState): Boolean; overload; virtual; + function CanProcessMultiSelect(AKey: Word; AShift: TShiftState; + AFocusedRecordChanged: Boolean): Boolean; overload; virtual; + procedure ChangeRecordSelection(ARecord: TcxCustomGridRecord; Value: Boolean); + procedure CheckFocusedRecordSelectionWhenExit(ARecord: TcxCustomGridRecord); + procedure DoMouseNormalSelection(AHitTest: TcxCustomGridHitTest); virtual; + procedure DoMouseRangeSelection(AClearSelection: Boolean = True; AData: TObject = nil); virtual; + procedure DoNormalSelection; virtual; + procedure DoNormalSelectionWithAnchor(ASelect: Boolean = True); + procedure DoRangeSelection(AClearSelection: Boolean = True); + procedure DoToggleRecordSelection; + procedure FinishSelection; virtual; + procedure InvalidateFocusedRecord; virtual; + procedure InvalidateSelection; virtual; + function IsKeyForMultiSelect(AKey: Word; AShift: TShiftState; + AFocusedRecordChanged: Boolean): Boolean; virtual; + function IsRecordSelected(ARecord: TcxCustomGridRecord): Boolean; + procedure MultiSelectKeyDown(var Key: Word; Shift: TShiftState); virtual; + procedure MultiSelectMouseDown(AHitTest: TcxCustomGridHitTest; AShift: TShiftState); virtual; + procedure MultiSelectMouseUp(AHitTest: TcxCustomGridHitTest; AShift: TShiftState); virtual; + procedure SelectFocusedRecord; + procedure SetSelectionAnchor(AGridRecordIndex: Integer); + function SupportsAdditiveSelection: Boolean; virtual; + function SupportsRecordSelectionToggling: Boolean; virtual; + + // navigation + function CanFocusNextItem(AFocusedItemIndex, ANextItemIndex: Integer; + AGoForward, AGoOnCycle, AGoToNextRecordOnCycle: Boolean): Boolean; virtual; + function FocusedRecordHasCells(ACheckCellSelectionAbility: Boolean): Boolean; + procedure FocusNextPage(ASyncSelection: Boolean); virtual; + procedure FocusPrevPage(ASyncSelection: Boolean); virtual; + function IsKeyForController(AKey: Word; AShift: TShiftState): Boolean; virtual; + procedure ScrollPage(AForward: Boolean); virtual; + procedure ScrollRecords(AForward: Boolean; ACount: Integer); virtual; + procedure ShowNextPage; virtual; + procedure ShowPrevPage; virtual; + + // pull focusing + procedure DoPullFocusing(AHitTest: TcxGridRecordHitTest); virtual; + procedure DoPullFocusingScrolling(ADirection: TcxDirection); virtual; + function GetPullFocusingScrollingDirection(X, Y: Integer; out ADirection: TcxDirection): Boolean; virtual; + function IsPullFocusingPosChanged: Boolean; + procedure SavePullFocusingPos; + procedure StartPullFocusing(AHitTest: TcxCustomGridHitTest); virtual; + procedure StopPullFocusing; + procedure StartPullFocusingScrolling(ADirection: TcxDirection); + procedure StopPullFocusingScrolling; + function SupportsPullFocusing: Boolean; virtual; + property PullFocusingOriginHitTest: TcxCustomGridHitTest read FPullFocusingOriginHitTest; + + // delphi drag and drop + function GetDragScrollDirection(X, Y: Integer): TcxDirection; virtual; + function GetDragScrollInterval: Integer; virtual; + function IsFirstRecordForDragScroll(ARecord: TcxCustomGridRecord): Boolean; virtual; + function IsLastRecordForDragScroll(ARecord: TcxCustomGridRecord): Boolean; virtual; + procedure ProcessDragFocusing(X, Y: Integer); + procedure StartDragScroll(ADirection: TcxDirection); + procedure StopDragScroll; + function IsDragScroll: Boolean; + //--- + function GetDragOpenInfo(AHitTest: TcxCustomGridHitTest): TcxCustomGridDragOpenInfo; virtual; + function IsDragOpenHitTest(AHitTest: TcxCustomGridHitTest; + out ADragOpenInfo: TcxCustomGridDragOpenInfo): Boolean; + //--- + property DragHighlightedRecord: TcxCustomGridRecord read FDragHighlightedRecord write SetDragHighlightedRecord; + + // incsearching + function GetItemForIncSearching: TcxCustomGridTableItem; virtual; + procedure IncSearchKeyDown(var Key: Word; Shift: TShiftState); virtual; + property ItemForIncSearching: TcxCustomGridTableItem read GetItemForIncSearching; + + function GetEditingControllerClass: TcxGridEditingControllerClass; virtual; + + property AllowAppendRecord: Boolean read FAllowAppendRecord write FAllowAppendRecord; + property AllowCheckEdit: Boolean read FAllowCheckEdit write FAllowCheckEdit; + property BlockRecordKeyboardHandling: Boolean read FBlockRecordKeyboardHandling + write FBlockRecordKeyboardHandling; + property CancelEditingOnExit: Boolean read GetCancelEditingOnExit; + property EatKeyPress: Boolean read FEatKeyPress write FEatKeyPress; + property FocusOnRecordFocusing: Boolean read FFocusOnRecordFocusing write FFocusOnRecordFocusing; + property ForcingWidthItem: TcxCustomGridTableItem read FForcingWidthItem write FForcingWidthItem; + property InternalTopRecordIndex: Integer read FTopRecordIndex write SetInternalTopRecordIndex; + property IsReadyForImmediateEditing: Boolean read FIsReadyForImmediateEditing + write FIsReadyForImmediateEditing; + property IsRecordsScrollHorizontal: Boolean read GetIsRecordsScrollHorizontal; + property MultiSelect: Boolean read GetMultiSelect; + property ScrollBarOffsetBegin: Integer read GetScrollBarOffsetBegin; + property ScrollBarOffsetEnd: Integer read GetScrollBarOffsetEnd; + property ScrollBarRecordCount: Integer read GetScrollBarRecordCount; + property ScrollBarPos: Integer read GetScrollBarPos write SetScrollBarPos; + property ViewData: TcxCustomGridTableViewData read GetViewData; + property ViewInfo: TcxCustomGridTableViewInfo read GetViewInfo; + public + constructor Create(AGridView: TcxCustomGridView); override; + destructor Destroy; override; + procedure BeginDragAndDrop; override; + procedure ControlFocusChanged; override; + procedure DoCancelMode; override; + procedure DoKeyDown(var Key: Word; Shift: TShiftState); override; + procedure EndDragAndDrop(Accepted: Boolean); override; + function FindNextItem(AFocusedItemIndex: Integer; + AGoForward, AGoOnCycle: Boolean; out ACycleChanged: Boolean; + ARecord: TcxCustomGridRecord): Integer; virtual; + function FindNextRecord(AFocusedRecordIndex: Integer; + AGoForward, AGoOnCycle: Boolean; out ACycleChanged: Boolean): Integer; + function HasFilterMRUItemsPopup: Boolean; + function HasFilterPopup: Boolean; + function HasFocusedControls: Boolean; override; + function HasItemsCustomizationPopup: Boolean; + function IsClickableRecordHitTest(AHitTest: TcxCustomGridHitTest): Boolean; + function IsDataFullyVisible(AIsCallFromMaster: Boolean = False): Boolean; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + function ProcessDetailDialogChar(ADetail: TcxCustomGridView; ACharCode: Word): Boolean; override; + function ProcessDialogChar(ACharCode: Word): Boolean; override; + function SupportsTabAccelerators(AGridRecord: TcxCustomGridRecord): Boolean; virtual; + + procedure BeforeStartDrag; override; + function CanDrag(X, Y: Integer): Boolean; override; + procedure DragDrop(Source: TObject; X, Y: Integer); override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); override; + procedure DrawDragImage(ACanvas: TcxCanvas; R: TRect); override; + procedure EndDrag(Target: TObject; X, Y: Integer); override; + function GetDragDropText(ADragObject: TDragObject): string; virtual; + procedure GetDragDropTextViewParams(out AParams: TcxViewParams); virtual; + function GetDragImagesSize: TPoint; override; + function HasDragImages: Boolean; override; + procedure StartDrag(var DragObject: TDragObject); override; + property DragDropText: string read FDragDropText; + + procedure CancelIncSearching; + function CheckEditing(var AFocusedRecordIndex: Integer; AGoForward: Boolean): Boolean; + procedure CheckScrolling(const P: TPoint); virtual; + procedure ClearSelection; virtual; + procedure CreateNewRecord(AtEnd: Boolean); virtual; + procedure DeleteSelection; virtual; + function FocusFirstAvailableItem: Boolean; + function FocusNextCell(AGoForward: Boolean; AProcessCellsOnly: Boolean = True; + AAllowCellsCycle: Boolean = True): Boolean; + function FocusNextItem(AFocusedItemIndex: Integer; + AGoForward, AGoOnCycle, AGoToNextRecordOnCycle: Boolean): Boolean; + function FocusNextRecord(AFocusedRecordIndex: Integer; + AGoForward, AGoOnCycle, AGoIntoDetail, AGoOutOfDetail: Boolean): Boolean; + function FocusNextRecordWithSelection(AFocusedRecordIndex: Integer; + AGoForward, AGoOnCycle, AGoIntoDetail: Boolean; ASyncSelection: Boolean = True): Boolean; + function FocusRecord(AFocusedRecordIndex: Integer; ASyncSelection: Boolean): Boolean; + procedure MakeFocusedItemVisible; + procedure MakeFocusedRecordVisible; + procedure MakeItemVisible(AItem: TcxCustomGridTableItem); virtual; abstract; + procedure MakeRecordVisible(ARecord: TcxCustomGridRecord); virtual; + procedure SelectAll; virtual; + procedure SelectAllRecords; + + function GoToFirst(ASyncSelection: Boolean = True): Boolean; + function GoToLast(AGoIntoDetail: Boolean; ASyncSelection: Boolean = True): Boolean; + function GoToNext(AGoIntoDetail: Boolean; ASyncSelection: Boolean = True): Boolean; + function GoToPrev(AGoIntoDetail: Boolean; ASyncSelection: Boolean = True): Boolean; + function IsFinish: Boolean; + function IsStart: Boolean; + + property ClickedCellViewInfo: TcxGridTableDataCellViewInfo read FClickedCellViewInfo write FClickedCellViewInfo; + property EditingController: TcxGridEditingController read FEditingController; + property EditingItem: TcxCustomGridTableItem read GetEditingItem write SetEditingItem; + property FilterMRUItemsPopup: TcxGridFilterMRUItemsPopup read GetFilterMRUItemsPopup; + property FilterPopup: TcxGridFilterPopup read GetFilterPopup; + property FocusedItem: TcxCustomGridTableItem read FFocusedItem write SetFocusedItem; + property FocusedItemIndex: Integer read GetFocusedItemIndex write SetFocusedItemIndex; + property FocusedRecord: TcxCustomGridRecord read GetFocusedRecord write SetFocusedRecord; + property FocusedRecordIndex: Integer read GetFocusedRecordIndex write SetFocusedRecordIndex; + property GridView: TcxCustomGridTableView read GetGridView; + property IncSearchingItem: TcxCustomGridTableItem read GetIncSearchingItem; + property IncSearchingText: string read GetIncSearchingText write SetIncSearchingText; + property IsPullFocusing: Boolean read FIsPullFocusing; + property IsEditing: Boolean read GetIsEditing; + property IsIncSearching: Boolean read GetIsIncSearching; + property IsItemMoving: Boolean read GetIsItemMoving; + property ItemsCustomizationPopup: TcxCustomGridItemsCustomizationPopup read GetItemsCustomizationPopup; + property MasterController: TcxCustomGridTableController read GetMasterController; + property MovingItem: TcxCustomGridTableItem read FMovingItem; + property NewItemRecordFocused: Boolean read GetNewItemRecordFocused write SetNewItemRecordFocused; + property SelectedRecordCount: Integer read GetSelectedRecordCount; + property SelectedRecords[Index: Integer]: TcxCustomGridRecord read GetSelectedRecord; + property TopRecordIndex: Integer read FTopRecordIndex write SetTopRecordIndex; + end; + + { painters } + + TcxCustomGridPartPainter = class(TcxCustomGridCellPainter); + + // filter + + TcxCustomGridFilterButtonPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxCustomGridFilterButtonViewInfo; + protected + function ExcludeFromClipRect: Boolean; override; + property ViewInfo: TcxCustomGridFilterButtonViewInfo read GetViewInfo; + end; + + TcxGridFilterCloseButtonPainter = class(TcxCustomGridFilterButtonPainter) + protected + procedure DrawContent; override; + end; + + TcxGridFilterActivateButtonPainter = class(TcxCustomGridFilterButtonPainter) + private + function GetViewInfo: TcxGridFilterActivateButtonViewInfo; + protected + procedure DrawContent; override; + property ViewInfo: TcxGridFilterActivateButtonViewInfo read GetViewInfo; + end; + + TcxGridFilterDropDownButtonPainter = class(TcxCustomGridFilterButtonPainter) + protected + procedure DrawContent; override; + end; + + TcxGridFilterCustomizeButtonPainter = class(TcxCustomGridFilterButtonPainter) + protected + procedure Paint; override; + end; + + TcxGridFilterPainterClass = class of TcxGridFilterPainter; + + TcxGridFilterPainter = class(TcxCustomGridPartPainter) + private + FTextWasUnderlined: Boolean; + function GetViewInfo: TcxGridFilterViewInfo; + protected + procedure DrawBackground(const R: TRect); override; + procedure DrawButtons; virtual; + function ExcludeFromClipRect: Boolean; override; + procedure Paint; override; + procedure PrepareCanvasForDrawText; override; + procedure UnprepareCanvasForDrawText; override; + property ViewInfo: TcxGridFilterViewInfo read GetViewInfo; + end; + + // records + + TcxGridTableDataCellPainterClass = class of TcxGridTableDataCellPainter; + + TcxGridTableDataCellPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridTableDataCellViewInfo; + protected + procedure DrawContent; override; + procedure DrawFocusRect; virtual; + procedure Paint; override; + property ViewInfo: TcxGridTableDataCellViewInfo read GetViewInfo; + end; + + TcxCustomGridRecordPainterClass = class of TcxCustomGridRecordPainter; + + TcxCustomGridRecordPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxCustomGridRecordViewInfo; + protected + procedure AfterPaint; override; + procedure BeforePaint; override; + procedure DrawBackground; override; + procedure DrawExpandButton; virtual; + function DrawExpandButtonBeforePaint: Boolean; virtual; + procedure DrawFocusRect; virtual; + procedure Paint; override; + property ViewInfo: TcxCustomGridRecordViewInfo read GetViewInfo; + end; + + TcxCustomGridRecordsPainterClass = class of TcxCustomGridRecordsPainter; + + TcxCustomGridRecordsPainter = class + private + FCanvas: TcxCanvas; + FViewInfo: TcxCustomGridRecordsViewInfo; + protected + //procedure BeforePaint; virtual; + procedure Paint; virtual; + property Canvas: TcxCanvas read FCanvas; + property ViewInfo: TcxCustomGridRecordsViewInfo read FViewInfo; + public + constructor Create(ACanvas: TcxCanvas; AViewInfo: TcxCustomGridRecordsViewInfo); virtual; + procedure MainPaint; + end; + + // view + + TcxNavigatorSitePainter = class(TcxCustomGridCellPainter) + protected + function ExcludeFromClipRect: Boolean; override; + end; + + TcxCustomGridTablePainter = class(TcxCustomGridPainter) + private + function GetController: TcxCustomGridTableController; + function GetViewInfo: TcxCustomGridTableViewInfo; + protected + function CanOffset(AItemsOffset, DX, DY: Integer): Boolean; virtual; + procedure DrawBackground; override; + procedure DrawFilterBar; virtual; + procedure DrawInfoText; virtual; + procedure DrawNavigator; virtual; + procedure DrawRecords; virtual; + procedure Offset(AItemsOffset: Integer); overload; virtual; + procedure Offset(DX, DY: Integer); overload; virtual; + procedure PaintBefore; override; + procedure PaintContent; override; + public + procedure DoOffset(AItemsOffset, DX, DY: Integer); + procedure DrawFocusRect(const R: TRect; AHideFocusRect: Boolean); override; + property Controller: TcxCustomGridTableController read GetController; + property ViewInfo: TcxCustomGridTableViewInfo read GetViewInfo; + end; + + { view infos } + + // part + + TcxGridPartAlignment = (gpaTop, gpaBottom); + + TcxCustomGridPartViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FHeight: Integer; + function GetGridView: TcxCustomGridTableView; + function GetGridViewInfo: TcxCustomGridTableViewInfo; + function GetIndex: Integer; + procedure SetIndex(Value: Integer); + protected + function CalculateBounds: TRect; virtual; + procedure CalculateInvisible; virtual; + procedure CalculateVisible; virtual; + function CustomDrawBackground(ACanvas: TcxCanvas): Boolean; override; + function GetAlignment: TcxGridPartAlignment; virtual; abstract; + //function GetHeight: Integer; override; + function GetIsAutoWidth: Boolean; virtual; abstract; + function GetIsPart: Boolean; virtual; + function GetIsScrollable: Boolean; virtual; abstract; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function HasCustomDrawBackground: Boolean; override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + + property Height: Integer read FHeight write FHeight; + property IsPart: Boolean read GetIsPart; + public + constructor Create(AGridViewInfo: TcxCustomGridTableViewInfo); reintroduce; virtual; + destructor Destroy; override; + procedure MainCalculate; + property Alignment: TcxGridPartAlignment read GetAlignment; + property GridView: TcxCustomGridTableView read GetGridView; + property GridViewInfo: TcxCustomGridTableViewInfo read GetGridViewInfo; + property Index: Integer read GetIndex write SetIndex; + property IsAutoWidth: Boolean read GetIsAutoWidth; + property IsScrollable: Boolean read GetIsScrollable; + end; + + // filter + + TcxGridFilterButtonAlignment = (fbaLeft, fbaRight); + + TcxCustomGridFilterButtonViewInfoClass = class of TcxCustomGridFilterButtonViewInfo; + + TcxCustomGridFilterButtonViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FContainer: TcxGridFilterButtonsViewInfo; + function GetFilter: TcxDataFilterCriteria; + function GetGridView: TcxCustomGridTableView; + protected + function CaptureMouseOnPress: Boolean; override; + function GetAlignment: TcxGridFilterButtonAlignment; virtual; + function GetCanvas: TcxCanvas; override; + function GetHotTrack: Boolean; override; + function GetVisible: Boolean; override; + + property Container: TcxGridFilterButtonsViewInfo read FContainer; + property Filter: TcxDataFilterCriteria read GetFilter; + public + constructor Create(AContainer: TcxGridFilterButtonsViewInfo); reintroduce; virtual; + property Alignment: TcxGridFilterButtonAlignment read GetAlignment; + property GridView: TcxCustomGridTableView read GetGridView; + end; + + TcxGridFilterCloseButtonViewInfo = class(TcxCustomGridFilterButtonViewInfo) + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + procedure Click; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + end; + + TcxGridFilterActivateButtonViewInfo = class(TcxCustomGridFilterButtonViewInfo) + private + function GetChecked: Boolean; + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + procedure Click; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + public + property Checked: Boolean read GetChecked; + end; + + TcxGridFilterDropDownButtonViewInfo = class(TcxCustomGridFilterButtonViewInfo) + private + function GetDropDownWindowValue: TcxGridFilterMRUItemsPopup; + protected + procedure BeforeStateChange; override; + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function CaptureMouseOnPress: Boolean; override; + function GetAlignment: TcxGridFilterButtonAlignment; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetVisible: Boolean; override; + + function DropDownWindowExists: Boolean; override; + function GetDropDownWindow: TcxCustomGridPopup; override; + function GetDropDownWindowOwnerBounds: TRect; override; + property DropDownWindow: TcxGridFilterMRUItemsPopup read GetDropDownWindowValue; + public + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + end; + + TcxGridFilterCustomizeButtonViewInfo = class(TcxCustomGridFilterButtonViewInfo) + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + procedure Click; override; + function GetAlignment: TcxGridFilterButtonAlignment; override; + function GetAlignmentHorz: TAlignment; override; + function GetAlignmentVert: TcxAlignmentVert; override; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetText: string; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function GetVisible: Boolean; override; + end; + + TcxGridFilterButtonsViewInfoClass = class of TcxGridFilterButtonsViewInfo; + + TcxGridFilterButtonsViewInfo = class + private + FFilterViewInfo: TcxGridFilterViewInfo; + FItems: TList; + function GetCount: Integer; + function GetGridView: TcxCustomGridTableView; + function GetHeight: Integer; + function GetItem(Index: Integer): TcxCustomGridFilterButtonViewInfo; + function GetWidth(AAlignment: TcxGridFilterButtonAlignment): Integer; + function GetWidthLeftPart: Integer; + function GetWidthRightPart: Integer; + protected + FDropDownButtonViewInfo: TcxGridFilterDropDownButtonViewInfo; + procedure AddItems; virtual; + procedure DestroyItems; virtual; + property FilterViewInfo: TcxGridFilterViewInfo read FFilterViewInfo; + property GridView: TcxCustomGridTableView read GetGridView; + public + constructor Create(AFilterViewInfo: TcxGridFilterViewInfo); virtual; + destructor Destroy; override; + function AddItem(AItemClass: TcxCustomGridFilterButtonViewInfoClass): TcxCustomGridFilterButtonViewInfo; + procedure Calculate(const ABounds: TRect); virtual; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; virtual; + + property Count: Integer read GetCount; + property DropDownButtonViewInfo: TcxGridFilterDropDownButtonViewInfo read FDropDownButtonViewInfo; + property Height: Integer read GetHeight; + property Items[Index: Integer]: TcxCustomGridFilterButtonViewInfo read GetItem; default; + property WidthLeftPart: Integer read GetWidthLeftPart; + property WidthRightPart: Integer read GetWidthRightPart; + end; + + TcxGridFilterViewInfoClass = class of TcxGridFilterViewInfo; + + TcxGridFilterViewInfo = class(TcxCustomGridPartViewInfo) + private + FButtonsViewInfo: TcxGridFilterButtonsViewInfo; + function GetFilter: TcxDataFilterCriteria; + function GetFiltering: TcxCustomGridTableFiltering; + procedure CreateButtonsViewInfo; + procedure DestroyButtonsViewInfo; + protected + function CalculateButtonsViewInfoBounds: TRect; virtual; + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetAlignment: TcxGridPartAlignment; override; + function GetAlignmentVert: TcxAlignmentVert; override; + function GetBackgroundBitmap: TBitmap; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetHotTrack: Boolean; override; + function GetIsAutoWidth: Boolean; override; + function GetIsCheck: Boolean; override; + function GetIsScrollable: Boolean; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetText: string; override; + function GetTextAreaBounds: TRect; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function GetVisible: Boolean; override; + function HasMouse(AHitTest: TcxCustomGridHitTest): Boolean; override; + function InvalidateOnStateChange: Boolean; override; + procedure StateChanged(APrevState: TcxGridCellState); override; + + function GetButtonsViewInfoClass: TcxGridFilterButtonsViewInfoClass; virtual; + + property Filter: TcxDataFilterCriteria read GetFilter; + property Filtering: TcxCustomGridTableFiltering read GetFiltering; + public + constructor Create(AGridViewInfo: TcxCustomGridTableViewInfo); override; + destructor Destroy; override; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + property ButtonsViewInfo: TcxGridFilterButtonsViewInfo read FButtonsViewInfo; + end; + + // cells + + TcxGridTableCellViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FRecordViewInfo: TcxCustomGridRecordViewInfo; + FSelected: Boolean; + FSelectedCalculated: Boolean; + function GetCacheItem: TcxCustomGridTableViewInfoCacheItem; + function GetController: TcxCustomGridTableController; + function GetGridView: TcxCustomGridTableView; + function GetGridRecord: TcxCustomGridRecord; + function GetSelected: Boolean; + protected + function CalculateSelected: Boolean; virtual; + function GetAlwaysSelected: Boolean; virtual; + function GetCanvas: TcxCanvas; override; + function GetGridViewInfo: TcxCustomGridTableViewInfo; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetTransparent: Boolean; override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + + property AlwaysSelected: Boolean read GetAlwaysSelected; + property CacheItem: TcxCustomGridTableViewInfoCacheItem read GetCacheItem; + property Controller: TcxCustomGridTableController read GetController; + public + constructor Create(ARecordViewInfo: TcxCustomGridRecordViewInfo); reintroduce; virtual; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + function CanDrawSelected: Boolean; virtual; + function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + property GridRecord: TcxCustomGridRecord read GetGridRecord; + property GridView: TcxCustomGridTableView read GetGridView; + property GridViewInfo: TcxCustomGridTableViewInfo read GetGridViewInfo; + property RecordViewInfo: TcxCustomGridRecordViewInfo read FRecordViewInfo; + property Selected: Boolean read GetSelected; + end; + + TcxGridTableDataCellViewInfo = class(TcxGridTableCellViewInfo) + private + FEditViewData: TcxCustomEditViewData; + FEditViewInfo: TcxCustomEditViewInfo; + FIsLocalCopyOfEditViewData: Boolean; + FItem: TcxCustomGridTableItem; + FProperties: TcxCustomEditProperties; + FStyle: TcxEditStyle; + FWasFocusedBeforeClick: Boolean; + function GetEditing: Boolean; + function GetMousePos: TPoint; + function GetProperties: TcxCustomEditProperties; + function GetShowButtons: Boolean; + protected + procedure AfterCustomDraw(ACanvas: TcxCanvas); override; + procedure BeforeCustomDraw(ACanvas: TcxCanvas); override; + procedure CalculateEditViewInfo(AEditViewInfo: TcxCustomEditViewInfo; + const AMousePos: TPoint); virtual; + function CalculateHeight: Integer; override; + function CalculateSelected: Boolean; override; + function CanActivateEditOnMouseDown(AButton: TMouseButton): Boolean; virtual; + function CanShowEdit: Boolean; virtual; + procedure CheckEditHotTrack(const AMousePos: TPoint); + function CustomDraw(ACanvas: TcxCanvas): Boolean; override; + procedure DoCalculateParams; override; + procedure EditHotTrackChanged; + function GetAreaBounds: TRect; override; + function GetAutoHeight: Boolean; virtual; + function GetDisplayValue: TcxEditValue; virtual; + function GetEditBounds: TRect; virtual; + function GetEditViewDataBounds: TRect; virtual; + procedure GetEditViewDataContentOffsets(var R: TRect); virtual; + function GetFocused: Boolean; virtual; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetHotTrack: Boolean; override; + function GetMaxLineCount: Integer; virtual; + function GetMultiLine: Boolean; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetShowEndEllipsis: Boolean; override; + function GetText: string; override; + function GetValue: Variant; virtual; + procedure GetViewParams(var AParams: TcxViewParams); override; + function HasCustomDraw: Boolean; override; + function HasFocusRect: Boolean; virtual; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + procedure InitTextSelection; virtual; + function InvalidateOnStateChange: Boolean; override; + function IsTextSelected: Boolean; virtual; + procedure MouseLeave; override; + procedure Offset(DX, DY: Integer); override; + procedure RestoreParams(const AParams: TcxViewParams); override; + procedure SaveParams(out AParams: TcxViewParams); override; + procedure StateChanged(APrevState: TcxGridCellState); override; + function SupportsZeroHeight: Boolean; virtual; + + function CanShowAutoHint: Boolean; virtual; + function CanShowCustomHint: Boolean; virtual; + function CanShowHint: Boolean; override; + function GetCellBoundsForHint: TRect; override; + function NeedShowHint(const AMousePos: TPoint; out AHintText: TCaption; + out AIsHintMultiLine: Boolean; out ATextRect: TRect): Boolean; override; + function UseStandardNeedShowHint: Boolean; virtual; + + procedure InitStyle; virtual; + + function CreateEditViewInfo: TcxCustomEditViewInfo; + + procedure CreateEditViewData; + procedure DestroyEditViewData; + property EditViewData: TcxCustomEditViewData read FEditViewData; + + procedure UpdateEdit; + + property AutoHeight: Boolean read GetAutoHeight; + property EditViewDataBounds: TRect read GetEditViewDataBounds; + property MaxLineCount: Integer read GetMaxLineCount; + property MousePos: TPoint read GetMousePos; + property ShowButtons: Boolean read GetShowButtons; + property WasFocusedBeforeClick: Boolean read FWasFocusedBeforeClick; + public + constructor Create(ARecordViewInfo: TcxCustomGridRecordViewInfo; + AItem: TcxCustomGridTableItem); reintroduce; virtual; + destructor Destroy; override; + procedure BeforeRecalculation; override; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + function CanDrawSelected: Boolean; override; + function GetInplaceEditPosition: TcxInplaceEditPosition; + procedure Invalidate(ARecalculate: Boolean); reintroduce; virtual; + function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + function MouseMove(AHitTest: TcxCustomGridHitTest; AShift: TShiftState): Boolean; override; + function MouseUp(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + + property DisplayValue: TcxEditValue read GetDisplayValue; + //property Edit: TcxCustomEdit read GetEdit; + property EditBounds: TRect read GetEditBounds; + property Editing: Boolean read GetEditing; + property EditViewInfo: TcxCustomEditViewInfo read FEditViewInfo; + property Focused: Boolean read GetFocused; + property Item: TcxCustomGridTableItem read FItem; + property Properties: TcxCustomEditProperties read GetProperties; + property Style: TcxEditStyle read FStyle; + property Value: Variant read GetValue; + end; + + // records + + TcxCustomGridRecordViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FExpandButtonBounds: TRect; + FExpanded: Boolean; + FExpandedCalculated: Boolean; + FIsRecordViewInfoAssigned: Boolean; + FRecordsViewInfo: TcxCustomGridRecordsViewInfo; + FSelected: Boolean; + FSelectedCalculated: Boolean; + function GetCacheItem: TcxCustomGridTableViewInfoCacheItem; + function GetExpanded: Boolean; + function GetFocused: Boolean; + function GetGridView: TcxCustomGridTableView; + function GetGridViewInfo: TcxCustomGridTableViewInfo; + function GetIndex: Integer; + function GetSelected: Boolean; + protected + FRecord: TcxCustomGridRecord; + procedure CalculateExpandButtonBounds(var ABounds: TRect); virtual; abstract; + function CalculateSelected: Boolean; virtual; + function CanGenerateExpandButtonHitTest: Boolean; virtual; + procedure ControlFocusChanged; virtual; + function GetAutoHeight: Boolean; virtual; + function GetBackgroundBitmap: TBitmap; override; + function GetBackgroundBitmapBounds: TRect; virtual; + function GetCanvas: TcxCanvas; override; + function GetCellTransparent(ACell: TcxGridTableCellViewInfo): Boolean; virtual; + function GetContentBounds: TRect; virtual; + function GetExpandButtonAreaBounds: TRect; virtual; + function GetFocusRectBounds: TRect; virtual; + function GetHeight: Integer; override; + function GetHideFocusRectOnExit: Boolean; virtual; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetVisible: Boolean; override; + function HasFocusRect: Boolean; virtual; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + function IsClickHitTest(AHitTest: TcxCustomGridHitTest): Boolean; virtual; + function IsDetailVisible(ADetail: TcxCustomGridView): Boolean; virtual; + procedure Offset(DX, DY: Integer); override; + procedure VisibilityChanged(AVisible: Boolean); virtual; + + property AutoHeight: Boolean read GetAutoHeight; + property BackgroundBitmapBounds: TRect read GetBackgroundBitmapBounds; + property CacheItem: TcxCustomGridTableViewInfoCacheItem read GetCacheItem; + property ExpandButtonAreaBounds: TRect read GetExpandButtonAreaBounds; + property Expanded: Boolean read GetExpanded; + public + constructor Create(ARecordsViewInfo: TcxCustomGridRecordsViewInfo; + ARecord: TcxCustomGridRecord); reintroduce; virtual; + destructor Destroy; override; + procedure BeforeRecalculation; override; + function Click(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; reintroduce; virtual; + function GetBoundsForInvalidate(AItem: TcxCustomGridTableItem): TRect; virtual; + function GetBoundsForItem(AItem: TcxCustomGridTableItem): TRect; virtual; + function GetCellViewInfoByItem(AItem: TcxCustomGridTableItem): TcxGridTableDataCellViewInfo; virtual; + {procedure GetDataCellViewParams(AItem: TcxCustomGridTableItem; + ACellViewInfo: TcxGridTableCellViewInfo; var AParams: TcxViewParams); virtual;} + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + procedure MainCalculate(ALeftBound, ATopBound: Integer); virtual; + function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + function ProcessDialogChar(ACharCode: Word): Boolean; virtual; + procedure Recalculate; + + property ContentBounds: TRect read GetContentBounds; + property ExpandButtonBounds: TRect read FExpandButtonBounds; + property Focused: Boolean read GetFocused; + property FocusRectBounds: TRect read GetFocusRectBounds; + property GridView: TcxCustomGridTableView read GetGridView; + property GridRecord: TcxCustomGridRecord read FRecord; + property GridViewInfo: TcxCustomGridTableViewInfo read GetGridViewInfo; + property Index: Integer read GetIndex; + property HideFocusRectOnExit: Boolean read GetHideFocusRectOnExit; + property RecordsViewInfo: TcxCustomGridRecordsViewInfo read FRecordsViewInfo; + property Selected: Boolean read GetSelected; + end; + + TcxCustomGridRecordsViewInfoClass = class of TcxCustomGridRecordsViewInfo; + + TcxCustomGridRecordsViewInfo = class + private + FBackgroundBitmap: TBitmap; + FBounds: TRect; + FContentBounds: TRect; + FGridViewInfo: TcxCustomGridTableViewInfo; + FIncSearchingCellViewInfo: TcxGridTableDataCellViewInfo; + FIsIncSearchingCellViewInfoCalculated: Boolean; + FItems: TList; + FItemsOffset: Integer; + + function GetCanvas: TcxCanvas; + function GetController: TcxCustomGridTableController; + function GetCount: Integer; + function GetFirstRecordIndex: Integer; + function GetGridView: TcxCustomGridTableView; + function GetIncSearchingCellViewInfo: TcxGridTableDataCellViewInfo; + function GetItem(Index: Integer): TcxCustomGridRecordViewInfo; + function GetMaxCount: Integer; + function GetTopRecordIndex: Integer; + function GetViewData: TcxCustomGridTableViewData; + + procedure CreateItems; + procedure DestroyItems; + function CreateRecordViewInfo(AIndex: Integer): TcxCustomGridRecordViewInfo; + protected + FVisibleCount: Integer; + procedure AfterCalculate; virtual; + procedure BeforeCalculate; virtual; + procedure BeforeItemRecalculation; virtual; + procedure AfterOffset; virtual; + procedure BeforeOffset; virtual; + procedure Calculate; virtual; + function CalculateBounds: TRect; virtual; + function CalculateContentBounds: TRect; virtual; + function CalculateIncSearchingCellViewInfo: TcxGridTableDataCellViewInfo; virtual; + procedure CalculateVisibleCount; virtual; + procedure CreateEditViewDatas; + procedure DestroyEditViewDatas; + function GetAreaBoundsForCell(ACellViewInfo: TcxGridTableDataCellViewInfo): TRect; virtual; + function GetAutoDataCellHeight: Boolean; virtual; + function GetAutoDataRecordHeight: Boolean; virtual; + function GetAutoRecordHeight: Boolean; virtual; + function GetBackgroundBitmap: TBitmap; virtual; + function GetItemLeftBound(AIndex: Integer): Integer; virtual; abstract; + function GetItemsOffset(AItemCountDelta: Integer): Integer; virtual; abstract; + function GetItemTopBound(AIndex: Integer): Integer; virtual; abstract; + function GetRecordIndex(AViewInfoIndex: Integer): Integer; + function GetViewInfoIndex(ARecordIndex: Integer): Integer; + function IsEmpty: Boolean; virtual; + procedure OffsetItem(AIndex, AOffset: Integer); virtual; abstract; + + procedure ControlFocusChanged; virtual; + procedure VisibilityChanged(AVisible: Boolean); virtual; + + function GetPainterClass: TcxCustomGridRecordsPainterClass; virtual; + + property Canvas: TcxCanvas read GetCanvas; + property Controller: TcxCustomGridTableController read GetController; + property FirstRecordIndex: Integer read GetFirstRecordIndex; + property GridViewInfo: TcxCustomGridTableViewInfo read FGridViewInfo; + property IncSearchingCellViewInfo: TcxGridTableDataCellViewInfo read GetIncSearchingCellViewInfo; + property MaxCount: Integer read GetMaxCount; + property TopRecordIndex: Integer read GetTopRecordIndex; + property ViewData: TcxCustomGridTableViewData read GetViewData; + public + constructor Create(AGridViewInfo: TcxCustomGridTableViewInfo); virtual; + destructor Destroy; override; + function CanOffset(AItemCountDelta: Integer): Boolean; virtual; + function GetCellHeight(ACellContentHeight: Integer): Integer; virtual; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; virtual; + function GetRealItem(ARecord: TcxCustomGridRecord): TcxCustomGridRecordViewInfo; virtual; + function IsCellMultiLine(AItem: TcxCustomGridTableItem): Boolean; virtual; + procedure MainCalculate; virtual; + procedure Offset(AItemCountDelta: Integer); overload; virtual; + procedure Offset(DX, DY: Integer); overload; virtual; + procedure Paint; + + property AutoDataCellHeight: Boolean read GetAutoDataCellHeight; + property AutoDataRecordHeight: Boolean read GetAutoDataRecordHeight; + property AutoRecordHeight: Boolean read GetAutoRecordHeight; + property BackgroundBitmap: TBitmap read FBackgroundBitmap write FBackgroundBitmap; + property Bounds: TRect read FBounds; + property ContentBounds: TRect read FContentBounds; + property Count: Integer read GetCount; + property GridView: TcxCustomGridTableView read GetGridView; + property Items[Index: Integer]: TcxCustomGridRecordViewInfo read GetItem; default; + property ItemsOffset: Integer read FItemsOffset; + property VisibleCount: Integer read FVisibleCount; + end; + + // view + + TcxNavigatorSiteViewInfoClass = class of TcxNavigatorSiteViewInfo; + + TcxNavigatorSiteViewInfo = class(TcxCustomGridViewCellViewInfo) + private + function GetGridViewInfo: TcxCustomGridTableViewInfo; + function GetNavigatorViewInfo: TcxNavigatorViewInfo; + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetHeight: Integer; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetHotTrack: Boolean; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetVisible: Boolean; override; + procedure MouseLeave; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function GetWidth: Integer; override; + public + destructor Destroy; override; + function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + function MouseMove(AHitTest: TcxCustomGridHitTest; AShift: TShiftState): Boolean; override; + function MouseUp(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + property GridViewInfo: TcxCustomGridTableViewInfo read GetGridViewInfo; + property NavigatorViewInfo: TcxNavigatorViewInfo read GetNavigatorViewInfo; + end; + + TcxCustomGridTableViewInfo = class(TcxCustomGridViewInfo, IcxNavigatorOwner) + private + FCalculateDown: Boolean; + FFilterViewInfo: TcxGridFilterViewInfo; + FFirstRecordIndex: Integer; + FNavigatorSize: TPoint; + FNavigatorSiteViewInfo: TcxNavigatorSiteViewInfo; + FNavigatorViewInfo: TcxNavigatorViewInfo; + FParts: TList; + FRecordsViewInfo: TcxCustomGridRecordsViewInfo; + + function GetController: TcxCustomGridTableController; + function GetExpandButtonSize: Integer; + function GetFirstRecordIndex: Integer; + function GetGridView: TcxCustomGridTableView; + function GetPart(Index: Integer): TcxCustomGridPartViewInfo; + function GetPartCount: Integer; + function GetPartsBottomHeight: Integer; + function GetPartsCustomHeight(AAlignment: TcxGridPartAlignment): Integer; + function GetPartsTopHeight: Integer; + function GetScrollableAreaWidth: Integer; + function GetViewData: TcxCustomGridTableViewData; + function GetVisibleRecordCount: Integer; + + procedure AddPart(AItem: TcxCustomGridPartViewInfo); + procedure RemovePart(AItem: TcxCustomGridPartViewInfo); + protected + // IcxNavigatorOwner + function GetNavigatorBounds: TRect; virtual; + function GetNavigatorButtons: TcxCustomNavigatorButtons; + function GetNavigatorCanvas: TCanvas; + function GetNavigatorControl: TWinControl; + function GetNavigatorFocused: Boolean; + function GetNavigatorLookAndFeel: TcxLookAndFeel; + function GetNavigatorOwner: TComponent; + function GetNavigatorShowHint: Boolean; + function GetNavigatorTabStop: Boolean; + procedure NavigatorButtonsStateChanged; + procedure NavigatorChanged(AChangeType: TcxNavigatorChangeType); + procedure RefreshNavigator; + + procedure CreateViewInfos; override; + procedure DestroyViewInfos(AIsRecreating: Boolean); override; + + procedure AdjustClientBounds(var ABounds: TRect); override; + procedure AfterCalculating; override; + procedure AfterOffset; virtual; + procedure BeforeOffset; virtual; + procedure Calculate; override; + function CalculateClientBounds: TRect; override; + function CalculatePartBounds(APart: TcxCustomGridPartViewInfo): TRect; virtual; + function CalculateVisibleEqualHeightRecordCount: Integer; virtual; + procedure ControlFocusChanged; override; + function DoGetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + function GetDefaultGridModeBufferCount: Integer; virtual; + procedure GetHScrollBarBounds(var ABounds: TRect); override; + function GetFilterViewInfoClass: TcxGridFilterViewInfoClass; virtual; + function GetIsInternalUse: Boolean; override; + function GetNavigatorOffset: Integer; virtual; + function GetNavigatorSiteBounds: TRect; virtual; + function GetNavigatorSiteViewInfoClass: TcxNavigatorSiteViewInfoClass; virtual; + function GetNavigatorViewInfoClass: TcxNavigatorViewInfoClass; virtual; + function GetNoDataInfoText: string; virtual; + function GetNoDataInfoTextAreaBounds: TRect; virtual; + procedure GetNoDataInfoTextParams(out AParams: TcxViewParams); virtual; + function GetNoDataInfoTextAreaVisible: Boolean; virtual; + function GetNonRecordsAreaHeight(ACheckScrollBar: Boolean): Integer; virtual; + function GetRecordsViewInfoClass: TcxCustomGridRecordsViewInfoClass; virtual; abstract; + function GetScrollableAreaBounds: TRect; virtual; + function GetScrollableAreaBoundsForEdit: TRect; virtual; + function GetScrollableAreaBoundsHorz: TRect; virtual; + function GetScrollableAreaBoundsVert: TRect; virtual; + function FirstRecordIndexAssigned: Boolean; + procedure Offset(ARecordCountDelta: Integer); overload; virtual; + procedure Offset(DX, DY: Integer); overload; virtual; + procedure VisibilityChanged(AVisible: Boolean); override; + + property Controller: TcxCustomGridTableController read GetController; + property PartCount: Integer read GetPartCount; + property Parts[Index: Integer]: TcxCustomGridPartViewInfo read GetPart; + property ViewData: TcxCustomGridTableViewData read GetViewData; + public + constructor Create(AGridView: TcxCustomGridView); override; + destructor Destroy; override; + function CanOffset(ARecordCountDelta, DX, DY: Integer): Boolean; virtual; + function CanOffsetView(ARecordCountDelta: Integer): Boolean; virtual; + procedure DoOffset(ARecordCountDelta, DX, DY: Integer); virtual; + + // for extended lookup edit + function GetNearestPopupHeight(AHeight: Integer; AAdditionalRecord: Boolean = False): Integer; virtual; + function GetPopupHeight(ADropDownRecordCount: Integer): Integer; virtual; + + property CalculateDown: Boolean read FCalculateDown write FCalculateDown; + property ExpandButtonSize: Integer read GetExpandButtonSize; + property FilterViewInfo: TcxGridFilterViewInfo read FFilterViewInfo; + property FirstRecordIndex: Integer read GetFirstRecordIndex write FFirstRecordIndex; + property GridView: TcxCustomGridTableView read GetGridView; + property NavigatorBounds: TRect read GetNavigatorBounds; + property NavigatorOffset: Integer read GetNavigatorOffset; + property NavigatorSize: TPoint read FNavigatorSize; + property NavigatorSiteViewInfo: TcxNavigatorSiteViewInfo read FNavigatorSiteViewInfo; + property NavigatorViewInfo: TcxNavigatorViewInfo read FNavigatorViewInfo; + property NoDataInfoText: string read GetNoDataInfoText; + property NoDataInfoTextAreaBounds: TRect read GetNoDataInfoTextAreaBounds; + property NoDataInfoTextAreaVisible: Boolean read GetNoDataInfoTextAreaVisible; + property PartsBottomHeight: Integer read GetPartsBottomHeight; + property PartsTopHeight: Integer read GetPartsTopHeight; + property RecordsViewInfo: TcxCustomGridRecordsViewInfo read FRecordsViewInfo; + property ScrollableAreaBounds: TRect read GetScrollableAreaBounds; + property ScrollableAreaBoundsForEdit: TRect read GetScrollableAreaBoundsForEdit; + property ScrollableAreaBoundsHorz: TRect read GetScrollableAreaBoundsHorz; + property ScrollableAreaBoundsVert: TRect read GetScrollableAreaBoundsVert; + property ScrollableAreaWidth: Integer read GetScrollableAreaWidth; + property VisibleRecordCount: Integer read GetVisibleRecordCount; + end; + + // cache + + TcxCustomGridTableViewInfoCacheItem = class(TcxCustomGridViewInfoCacheItem) + private + FHeight: Integer; + FIsHeightAssigned: Boolean; + function GetGridRecord: TcxCustomGridRecord; + procedure SetHeight(Value: Integer); + protected + property GridRecord: TcxCustomGridRecord read GetGridRecord; + public + procedure UnassignValues(AKeepMaster: Boolean); override; + property Height: Integer read FHeight write SetHeight; + property IsHeightAssigned: Boolean read FIsHeightAssigned write FIsHeightAssigned; + end; + + TcxCustomGridTableViewInfoCache = class(TcxCustomGridViewInfoCache) + private + function GetViewData: TcxCustomGridTableViewData; + protected + function GetItemClass(Index: Integer): TcxCustomGridViewInfoCacheItemClass; override; + property ViewData: TcxCustomGridTableViewData read GetViewData; + end; + + { view } + + // custom item + + TcxGridTableItemChange = (ticProperty, ticLayout, ticSize); + + TcxCustomGridTableItemCustomOptions = class(TPersistent) + private + FItem: TcxCustomGridTableItem; + function GetGridView: TcxCustomGridTableView; + protected + procedure Changed(AChange: TcxGridTableItemChange = ticLayout); virtual; + public + constructor Create(AItem: TcxCustomGridTableItem); virtual; + procedure Assign(Source: TPersistent); override; + property GridView: TcxCustomGridTableView read GetGridView; + property Item: TcxCustomGridTableItem read FItem; + end; + + TcxGridItemShowEditButtons = (isebDefault, isebNever, isebAlways); + TcxGridItemSortByDisplayText = (isbtDefault, isbtOn, isbtOff); + + TcxCustomGridTableItemOptionsClass = class of TcxCustomGridTableItemOptions; + + TcxCustomGridTableItemOptions = class(TcxCustomGridTableItemCustomOptions) + private + FEditing: Boolean; + FFiltering: Boolean; + FFilteringFilteredItemsList: Boolean; + FFilteringMRUItemsList: Boolean; + FFilteringPopup: Boolean; + FFilteringPopupMultiSelect: Boolean; + FFocusing: Boolean; + FGrouping: Boolean; + FIgnoreTimeForFiltering: Boolean; + FIncSearch: Boolean; + FMoving: Boolean; + FShowCaption: Boolean; + FShowEditButtons: TcxGridItemShowEditButtons; + FSortByDisplayText: TcxGridItemSortByDisplayText; + FSorting: Boolean; + procedure SetEditing(Value: Boolean); + procedure SetFiltering(Value: Boolean); + procedure SetFilteringFilteredItemsList(Value: Boolean); + procedure SetFilteringMRUItemsList(Value: Boolean); + procedure SetFilteringPopup(Value: Boolean); + procedure SetFilteringPopupMultiSelect(Value: Boolean); + procedure SetFocusing(Value: Boolean); + procedure SetGrouping(Value: Boolean); + procedure SetIgnoreTimeForFiltering(Value: Boolean); + procedure SetIncSearch(Value: Boolean); + procedure SetMoving(Value: Boolean); + procedure SetShowCaption(Value: Boolean); + procedure SetShowEditButtons(Value: TcxGridItemShowEditButtons); + procedure SetSortByDisplayText(Value: TcxGridItemSortByDisplayText); + procedure SetSorting(Value: Boolean); + protected + procedure BeforeShowCaptionChange; virtual; + property Grouping: Boolean read FGrouping write SetGrouping default True; + property Moving: Boolean read FMoving write SetMoving default True; + property ShowCaption: Boolean read FShowCaption write SetShowCaption default True; + property SortByDisplayText: TcxGridItemSortByDisplayText read FSortByDisplayText + write SetSortByDisplayText default isbtDefault; + property Sorting: Boolean read FSorting write SetSorting default True; + public + constructor Create(AItem: TcxCustomGridTableItem); override; + procedure Assign(Source: TPersistent); override; + published + property Editing: Boolean read FEditing write SetEditing default True; + property Filtering: Boolean read FFiltering write SetFiltering default True; + property FilteringFilteredItemsList: Boolean read FFilteringFilteredItemsList + write SetFilteringFilteredItemsList default True; + property FilteringMRUItemsList: Boolean read FFilteringMRUItemsList write SetFilteringMRUItemsList default True; + property FilteringPopup: Boolean read FFilteringPopup write SetFilteringPopup default True; + property FilteringPopupMultiSelect: Boolean read FFilteringPopupMultiSelect + write SetFilteringPopupMultiSelect default True; + property Focusing: Boolean read FFocusing write SetFocusing default True; + property IgnoreTimeForFiltering: Boolean read FIgnoreTimeForFiltering write SetIgnoreTimeForFiltering default True; + property IncSearch: Boolean read FIncSearch write SetIncSearch default True; + property ShowEditButtons: TcxGridItemShowEditButtons read FShowEditButtons + write SetShowEditButtons default isebDefault; + end; + + TcxGridGetCellStyleEvent = procedure(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; {$IFDEF BCB}var{$ELSE}out{$ENDIF} AStyle: TcxStyle) of object; + + TcxGridGetRecordStyleEvent = procedure(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; + {$IFDEF BCB}var{$ELSE}out{$ENDIF} AStyle: TcxStyle) of object; + + TcxCustomGridTableItemStylesClass = class of TcxCustomGridTableItemStyles; + + TcxCustomGridTableItemStyles = class(TcxCustomGridStyles) + private + FOnGetContentStyle: TcxGridGetCellStyleEvent; + function GetGridViewValue: TcxCustomGridTableView; + function GetItem: TcxCustomGridTableItem; + procedure SetOnGetContentStyle(Value: TcxGridGetCellStyleEvent); + protected + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + function GetGridView: TcxCustomGridView; override; + public + procedure Assign(Source: TPersistent); override; + procedure GetContentParams(ARecord: TcxCustomGridRecord; out AParams: TcxViewParams); virtual; + property GridView: TcxCustomGridTableView read GetGridViewValue; + property Item: TcxCustomGridTableItem read GetItem; + published + property Content: TcxStyle index isContent read GetValue write SetValue; + property OnGetContentStyle: TcxGridGetCellStyleEvent read FOnGetContentStyle write SetOnGetContentStyle; + end; + + TcxGridSortOrder = TcxDataSortOrder; + + TcxGridTableDataCellCustomDrawEvent = procedure(Sender: TcxCustomGridTableView; + ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean) of object; + + TcxGridGetCellHintEvent = procedure(Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord; + ACellViewInfo: TcxGridTableDataCellViewInfo; const AMousePos: TPoint; + var AHintText: TCaption; var AIsHintMultiLine: Boolean; var AHintTextRect: TRect) of object; + TcxGridGetDataTextEvent = procedure(Sender: TcxCustomGridTableItem; + ARecordIndex: Integer; var AText: string) of object; + TcxGridGetDisplayTextEvent = procedure(Sender: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; var AText: string) of object; + TcxGridGetFilterDisplayTextEvent = procedure(Sender: TcxCustomGridTableItem; + const AValue: Variant; var ADisplayText: string) of object; + TcxGridGetFilterValuesEvent = procedure(Sender: TcxCustomGridTableItem; + AValueList: TcxDataFilterValueList) of object; + TcxGridGetPropertiesEvent = procedure(Sender: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; var AProperties: TcxCustomEditProperties) of object; + TcxGridInitDateRangesEvent = procedure(Sender: TcxCustomGridTableItem; ADateRanges: TcxGridDateRanges) of object; + TcxGridTableItemGetStoredPropertiesEvent = procedure(Sender: TcxCustomGridTableItem; + AProperties: TStrings) of object; + TcxGridTableItemGetStoredPropertyValueEvent = procedure(Sender: TcxCustomGridTableItem; + const AName: string; var AValue: Variant) of object; + TcxGridTableItemSetStoredPropertyValueEvent = procedure(Sender: TcxCustomGridTableItem; + const AName: string; const AValue: Variant) of object; + TcxGridUserFilteringEvent = procedure(Sender: TcxCustomGridTableItem; + const AValue: Variant; const ADisplayText: string) of object; + + TcxCustomGridTableItemClass = class of TcxCustomGridTableItem; + + TcxCustomGridTableItem = class(TcxComponent, IcxEditRepositoryItemListener, IcxStoredObject) + private + FAlternateCaption: string; + FBestFitMaxWidth: Integer; + FCaption: string; + FCells: TList; + FCellStyle: TcxEditStyle; + FCellStyleUseCounter: Integer; + FDataBinding: TcxGridItemDataBinding; + FDateTimeGrouping: TcxGridDateTimeGrouping; + FEditData: TcxCustomEditData; + FEditViewData: TcxCustomEditViewData; + FFilteringDateRanges: TcxGridFilteringDateRanges; + FGridView: TcxCustomGridTableView; + FGroupingDateRanges: TcxGridGroupingDateRanges; + FHeaderAlignmentHorz: TAlignment; + FHeaderAlignmentVert: TcxAlignmentVert; + FID: Integer; + FIgnoreLoadingStatus: Boolean; + FIndex: Integer; + FIsCaptionAssigned: Boolean; + FIsHeaderAlignmentHorzAssigned: Boolean; + FIsHeaderAlignmentVertAssigned: Boolean; + FIsWidthAssigned: Boolean; + FLastUsedDefaultRepositoryItem: TcxEditRepositoryItem; + FMinWidth: Integer; + FOptions: TcxCustomGridTableItemOptions; + FProperties: TcxCustomEditProperties; + FPropertiesClass: TcxCustomEditPropertiesClass; + FPropertiesValue: TcxCustomEditProperties; + FRepositoryItem: TcxEditRepositoryItem; + FSavedVisible: Boolean; + FStyles: TcxCustomGridTableItemStyles; + FVisible: Boolean; + FVisibleForCustomization: Boolean; + FVisibleIndex: Integer; + FWasVisibleBeforeGrouping: Boolean; + FWidth: Integer; + + FOnCustomDrawCell: TcxGridTableDataCellCustomDrawEvent; + FOnGetCellHint: TcxGridGetCellHintEvent; + FOnGetDataText: TcxGridGetDataTextEvent; + FOnGetDisplayText: TcxGridGetDisplayTextEvent; + FOnGetFilterDisplayText: TcxGridGetFilterDisplayTextEvent; + FOnGetFilterValues: TcxGridGetFilterValuesEvent; + FOnGetProperties: TcxGridGetPropertiesEvent; + FOnGetPropertiesForEdit: TcxGridGetPropertiesEvent; + FOnGetStoredProperties: TcxGridTableItemGetStoredPropertiesEvent; + FOnGetStoredPropertyValue: TcxGridTableItemGetStoredPropertyValueEvent; + FOnInitFilteringDateRanges: TcxGridInitDateRangesEvent; + FOnInitGroupingDateRanges: TcxGridInitDateRangesEvent; + FOnSetStoredPropertyValue: TcxGridTableItemSetStoredPropertyValueEvent; + FOnUserFiltering: TcxGridUserFilteringEvent; + FSubClassEvents: TNotifyEvent; + + function GetActualMinWidth: Integer; + function GetCaption: string; + function GetCell(Index: Integer): TcxGridTableDataCellViewInfo; + function GetCellCount: Integer; + function GetController: TcxCustomGridTableController; + function GetDataController: TcxCustomDataController; + function GetEditing: Boolean; + function GetEditingProperties: TcxCustomEditProperties; + function GetFilterCaption: string; + function GetFiltered: Boolean; + function GetFocused: Boolean; + function GetGroupIndex: Integer; + function GetHeaderAlignmentHorz: TAlignment; + function GetHeaderAlignmentVert: TcxAlignmentVert; + function GetHidden: Boolean; + function GetIsLoading: Boolean; + function GetIncSearching: Boolean; + function GetIsDestroying: Boolean; + function GetIsFirst: Boolean; + function GetIsLast: Boolean; + function GetIsReading: Boolean; + function GetIsUpdating: Boolean; + function GetMinWidth: Integer; + function GetPropertiesClassName: string; + function GetSortIndex: Integer; + function GetSortOrder: TcxGridSortOrder; + function GetTag: TcxTag; + function GetViewData: TcxCustomGridTableViewData; + function GetWidth: Integer; + procedure SetAlternateCaption(const Value: string); + procedure SetBestFitMaxWidth(Value: Integer); + procedure SetCaption(const Value: string); + procedure SetDataBinding(Value: TcxGridItemDataBinding); + procedure SetDateTimeGrouping(Value: TcxGridDateTimeGrouping); + procedure SetEditing(Value: Boolean); + procedure SetFiltered(Value: Boolean); + procedure SetFocused(Value: Boolean); + procedure SetGroupIndex(Value: Integer); + procedure SetHeaderAlignmentHorz(Value: TAlignment); + procedure SetHeaderAlignmentVert(Value: TcxAlignmentVert); + procedure SetHidden(Value: Boolean); + procedure SetIndex(Value: Integer); + procedure SetMinWidth(Value: Integer); + procedure SetOnCustomDrawCell(Value: TcxGridTableDataCellCustomDrawEvent); + procedure SetOnGetCellHint(Value: TcxGridGetCellHintEvent); + procedure SetOnGetDataText(Value: TcxGridGetDataTextEvent); + procedure SetOnGetDisplayText(Value: TcxGridGetDisplayTextEvent); + procedure SetOnGetFilterDisplayText(Value: TcxGridGetFilterDisplayTextEvent); + procedure SetOnGetFilterValues(Value: TcxGridGetFilterValuesEvent); + procedure SetOnGetProperties(Value: TcxGridGetPropertiesEvent); + procedure SetOnGetPropertiesForEdit(Value: TcxGridGetPropertiesEvent); + procedure SetOnGetStoredProperties(Value: TcxGridTableItemGetStoredPropertiesEvent); + procedure SetOnGetStoredPropertyValue(Value: TcxGridTableItemGetStoredPropertyValueEvent); + procedure SetOnInitFilteringDateRanges(Value: TcxGridInitDateRangesEvent); + procedure SetOnInitGroupingDateRanges(Value: TcxGridInitDateRangesEvent); + procedure SetOnSetStoredPropertyValue(Value: TcxGridTableItemSetStoredPropertyValueEvent); + procedure SetOnUserFiltering(Value: TcxGridUserFilteringEvent); + procedure SetOptions(Value: TcxCustomGridTableItemOptions); + procedure SetProperties(Value: TcxCustomEditProperties); + procedure SetPropertiesClass(Value: TcxCustomEditPropertiesClass); + procedure SetPropertiesClassName(const Value: string); + procedure SetRepositoryItem(Value: TcxEditRepositoryItem); + procedure SetSortIndex(Value: Integer); + procedure SetSortOrder(Value: TcxGridSortOrder); + procedure SetStyles(Value: TcxCustomGridTableItemStyles); + procedure SetTag(Value: TcxTag); + procedure SetVisible(Value: Boolean); + procedure SetVisibleForCustomization(Value: Boolean); + procedure SetWidth(Value: Integer); + + procedure ReadHidden(Reader: TReader); + procedure ReadIsCaptionAssigned(Reader: TReader); + procedure WriteIsCaptionAssigned(Writer: TWriter); + + function IsCaptionStored: Boolean; + function IsSortOrderStored: Boolean; + function IsTagStored: Boolean; + function IsWidthStored: Boolean; + + function GetDataBindingClass: TcxGridItemDataBindingClass; + + procedure CreateProperties; + procedure DestroyProperties; + procedure RecreateProperties; + protected + procedure DefineProperties(Filer: TFiler); override; + procedure SetParentComponent(AParent: TComponent); override; + + // IcxEditRepositoryItemListener + procedure ItemRemoved(Sender: TcxEditRepositoryItem); + procedure IcxEditRepositoryItemListener.PropertiesChanged = RepositoryItemPropertiesChanged; + procedure RepositoryItemPropertiesChanged(Sender: TcxEditRepositoryItem); + // IcxStoredObject + function GetObjectName: string; virtual; + function IcxStoredObject.GetProperties = GetStoredProperties; + function GetStoredProperties(AProperties: TStrings): Boolean; virtual; + procedure GetPropertyValue(const AName: string; var AValue: Variant); virtual; + procedure SetPropertyValue(const AName: string; const AValue: Variant); virtual; + + procedure CreateDataBinding; virtual; + procedure DestroyDataBinding; virtual; + + procedure CreateSubClasses; virtual; + procedure DestroySubClasses; virtual; + function GetFilteringDateRangesClass: TcxGridFilteringDateRangesClass; virtual; + function GetGroupingDateRangesClass: TcxGridGroupingDateRangesClass; virtual; + function GetOptionsClass: TcxCustomGridTableItemOptionsClass; virtual; + function GetStylesClass: TcxCustomGridTableItemStylesClass; virtual; + + function IsHeaderAlignmentHorzStored: Boolean; + function IsHeaderAlignmentVertStored: Boolean; + + procedure BestFitApplied(AFireEvents: Boolean); virtual; + function CalculateBestFitWidth: Integer; virtual; + function CanAutoHeight: Boolean; virtual; + function CanEdit: Boolean; virtual; + function CanFilter(AVisually: Boolean): Boolean; virtual; + function CanFilterUsingChecks: Boolean; virtual; + function CanFilterMRUValueItems: Boolean; virtual; + function CanFocus(ARecord: TcxCustomGridRecord): Boolean; virtual; + function CanGroup: Boolean; virtual; + function CanHide: Boolean; virtual; + function CanHorzSize: Boolean; virtual; + function CanIgnoreTimeForFiltering: Boolean; virtual; + function CanIncSearch: Boolean; virtual; + function CanInitEditing: Boolean; virtual; + function CanMove: Boolean; virtual; + function CanScroll: Boolean; virtual; + function CanSort: Boolean; virtual; + procedure CaptionChanged; virtual; + procedure Changed(AChange: TcxGridTableItemChange); virtual; + procedure ChangeGroupIndex(Value: Integer); + procedure ChangeSortIndex(Value: Integer); + procedure CheckWidthValue(var Value: Integer); + procedure DataChanged; virtual; + procedure DateTimeGroupingChanged; virtual; + procedure ForceWidth(Value: Integer); virtual; + function GetActuallyVisible: Boolean; virtual; + function GetBestFitWidth: Integer; virtual; + function GetDateTimeFilters: TcxGridDateTimeFilters; virtual; + function GetDateTimeGrouping: TcxGridDateTimeGrouping; + function GetEditable: Boolean; virtual; + function GetEditPartVisible: Boolean; virtual; + function GetEditValue: Variant; virtual; + function GetFilterable: Boolean; virtual; + procedure GetFilterDisplayText(const AValue: Variant; var ADisplayText: string); virtual; + function GetFixed: Boolean; virtual; + function GetFocusedCellViewInfo: TcxGridTableDataCellViewInfo; virtual; + function GetPropertiesForEdit: TcxCustomEditProperties; virtual; + function GetPropertiesValue: TcxCustomEditProperties; + function GetVisible: Boolean; virtual; + function GetVisibleCaption: string; virtual; + function GetVisibleForCustomization: Boolean; virtual; + function GetVisibleIndex: Integer; + function GetVisibleInQuickCustomizationPopup: Boolean; virtual; + procedure GroupingChanging; virtual; + function HasCustomDrawCell: Boolean; + function HasFixedWidth: Boolean; virtual; + procedure InitFilteringDateRanges; virtual; + procedure InitGroupingDateRanges; virtual; + procedure InitProperties(AProperties: TcxCustomEditProperties); virtual; + function IsSortingByDisplayText(ASortByDisplayText: Boolean): Boolean; + function IsVisibleStored: Boolean; virtual; + function IsVisibleForCustomizationStored: Boolean; virtual; + procedure PropertiesChanged; + procedure PropertiesChangedHandler(Sender: TObject); + procedure PropertiesValueChanged; + procedure RecalculateDefaultWidth; + procedure SetEditValue(const Value: Variant); virtual; + procedure SetGridView(Value: TcxCustomGridTableView); virtual; + function ShowButtons(AFocused: Boolean): Boolean; virtual; + function ShowOnUngrouping: Boolean; virtual; + function SupportsDateTimeFilters(ARelativeFilters: Boolean): Boolean; virtual; + function SupportsGroupingDateRanges(ACheckCustomHandlers: Boolean): Boolean; virtual; + function UseFilteredValuesForFilterValueList: Boolean; virtual; + function UseOwnProperties: Boolean; + procedure ValueTypeClassChanged; virtual; + procedure VisibleChanged; virtual; + procedure VisibleForCustomizationChanged; virtual; + + function DefaultAlternateCaption: string; virtual; + function DefaultCaption: string; virtual; + function DefaultHeaderAlignmentHorz: TAlignment; + function DefaultHeaderAlignmentVert: TcxAlignmentVert; + function DefaultRepositoryItem: TcxEditRepositoryItem; + function DefaultWidth: Integer; virtual; + + function GetCellStyle: TcxEditStyle; + procedure InitStyle(AStyle: TcxCustomEditStyle; const AParams: TcxViewParams; + AFocused: Boolean); virtual; + procedure ReleaseCellStyle; + + procedure AddCell(ACell: TcxGridTableDataCellViewInfo); + procedure RemoveCell(ACell: TcxGridTableDataCellViewInfo); + property CellCount: Integer read GetCellCount; + property Cells[Index: Integer]: TcxGridTableDataCellViewInfo read GetCell; + + function CreateEditViewData(AProperties: TcxCustomEditProperties): TcxCustomEditViewData; + procedure DestroyEditViewData(var AEditViewData: TcxCustomEditViewData); + procedure DoCreateEditViewData; + procedure DoDestroyEditViewData; + procedure EditViewDataGetDisplayTextHandler(Sender: TcxCustomEditViewData; var AText: string); + function GetEditViewData(AProperties: TcxCustomEditProperties; + out AIsLocalCopy: Boolean): TcxCustomEditViewData; + procedure ReleaseEditViewData(var AEditViewData: TcxCustomEditViewData; AIsLocalCopy: Boolean); + property EditViewData: TcxCustomEditViewData read FEditViewData; + + procedure CheckVisible; + procedure SaveVisible; + property SavedVisible: Boolean read FSavedVisible; + + procedure DoCustomDrawCell(ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; + var ADone: Boolean); virtual; + procedure DoGetCellHint(ARecord: TcxCustomGridRecord; ACellViewInfo: TcxGridTableDataCellViewInfo; + const AMousePos: TPoint; var AHintText: TCaption; var AIsHintMultiLine: Boolean; + var AHintTextRect: TRect); virtual; + procedure DoGetDataText(ARecordIndex: Integer; var AText: string); virtual; + procedure DoGetDisplayText(ARecord: TcxCustomGridRecord; var AText: string); virtual; + procedure DoGetFilterValues(AValueList: TcxDataFilterValueList); virtual; + function DoGetProperties(ARecord: TcxCustomGridRecord): TcxCustomEditProperties; virtual; + procedure DoGetPropertiesForEdit(ARecord: TcxCustomGridRecord; var AProperties: TcxCustomEditProperties); virtual; + procedure DoInitFilteringDateRanges; virtual; + procedure DoInitGroupingDateRanges; virtual; + procedure DoUserFiltering(const AValue: Variant; const ADisplayText: string); virtual; + function HasCellHintHandler: Boolean; + function HasCustomPropertiesForEditHandler: Boolean; + function HasCustomPropertiesHandler: Boolean; + function HasDataTextHandler: Boolean; + function HasInitFilteringDateRangesHandler: Boolean; + function HasInitFilteringDateRangesHandlers: Boolean; + function HasInitGroupingDateRangesHandler: Boolean; + function HasInitGroupingDateRangesHandlers: Boolean; + + property IsDestroying: Boolean read GetIsDestroying; + property IsLoading: Boolean read GetIsLoading; + property IsReading: Boolean read GetIsReading; + property IsUpdating: Boolean read GetIsUpdating; + + property ActualMinWidth: Integer read GetActualMinWidth; + property Controller: TcxCustomGridTableController read GetController; + property DataController: TcxCustomDataController read GetDataController; + property DateTimeGrouping: TcxGridDateTimeGrouping read FDateTimeGrouping write SetDateTimeGrouping default dtgDefault; + property EditingProperties: TcxCustomEditProperties read GetEditingProperties; + property EditPartVisible: Boolean read GetEditPartVisible; + property Filterable: Boolean read GetFilterable; + property FilterCaption: string read GetFilterCaption; + property Fixed: Boolean read GetFixed; + property GroupIndex: Integer read GetGroupIndex write SetGroupIndex default -1; + property GroupingDateRanges: TcxGridGroupingDateRanges read FGroupingDateRanges; + property HeaderAlignmentHorz: TAlignment read GetHeaderAlignmentHorz write SetHeaderAlignmentHorz + stored IsHeaderAlignmentHorzStored; + property HeaderAlignmentVert: TcxAlignmentVert read GetHeaderAlignmentVert + write SetHeaderAlignmentVert stored IsHeaderAlignmentVertStored; + property Hidden: Boolean read GetHidden write SetHidden; // obsolete, use VisibleForCustomization + property IgnoreLoadingStatus: Boolean read FIgnoreLoadingStatus write FIgnoreLoadingStatus; + property InternalVisible: Boolean read FVisible; + property MinWidth: Integer read GetMinWidth write SetMinWidth + default cxGridItemDefaultMinWidth; + property ViewData: TcxCustomGridTableViewData read GetViewData; + property VisibleForCustomization: Boolean read GetVisibleForCustomization + write SetVisibleForCustomization stored IsVisibleForCustomizationStored; + property VisibleInQuickCustomizationPopup: Boolean read GetVisibleInQuickCustomizationPopup; + property WasVisibleBeforeGrouping: Boolean read FWasVisibleBeforeGrouping; + property Width: Integer read GetWidth write SetWidth stored IsWidthStored; + + property OnInitGroupingDateRanges: TcxGridInitDateRangesEvent read FOnInitGroupingDateRanges write SetOnInitGroupingDateRanges; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function GetParentComponent: TComponent; override; + function HasParent: Boolean; override; + + procedure ApplyBestFit(ACheckSizingAbility: Boolean = False; AFireEvents: Boolean = False); virtual; + function CalculateDefaultCellHeight(ACanvas: TcxCanvas; AFont: TFont): Integer; virtual; + function CreateEditStyle: TcxEditStyle; virtual; + procedure FocusWithSelection; virtual; + function GetAlternateCaption: string; + function GetDefaultValuesProvider(AProperties: TcxCustomEditProperties = nil): IcxEditDefaultValuesProvider; + function GetProperties: TcxCustomEditProperties; overload; + function GetProperties(ARecord: TcxCustomGridRecord): TcxCustomEditProperties; overload; + function GetProperties(ARecordIndex: Integer): TcxCustomEditProperties; overload; + function GetRepositoryItem: TcxEditRepositoryItem; + procedure MakeVisible; + procedure RestoreDefaults; virtual; + + property ActuallyVisible: Boolean read GetActuallyVisible; + property BestFitMaxWidth: Integer read FBestFitMaxWidth write SetBestFitMaxWidth default 0; + property Editable: Boolean read GetEditable; + property Editing: Boolean read GetEditing write SetEditing; + property EditValue: Variant read GetEditValue write SetEditValue; + property Filtered: Boolean read GetFiltered write SetFiltered; + property FilteringDateRanges: TcxGridFilteringDateRanges read FFilteringDateRanges; + property Focused: Boolean read GetFocused write SetFocused; + property FocusedCellViewInfo: TcxGridTableDataCellViewInfo read GetFocusedCellViewInfo; + property GridView: TcxCustomGridTableView read FGridView; + property Hideable: Boolean read CanHide; + property ID: Integer read FID; + property IncSearching: Boolean read GetIncSearching; + property Index: Integer read FIndex write SetIndex; + property IsFirst: Boolean read GetIsFirst; + property IsLast: Boolean read GetIsLast; + property Options: TcxCustomGridTableItemOptions read FOptions write SetOptions; + property PropertiesClass: TcxCustomEditPropertiesClass read FPropertiesClass write SetPropertiesClass; + property SortIndex: Integer read GetSortIndex write SetSortIndex default -1; + property SortOrder: TcxGridSortOrder read GetSortOrder write SetSortOrder stored IsSortOrderStored; + property Styles: TcxCustomGridTableItemStyles read FStyles write SetStyles; + property VisibleCaption: string read GetVisibleCaption; + property VisibleIndex: Integer read FVisibleIndex; + published + property AlternateCaption: string read FAlternateCaption write SetAlternateCaption; + property Caption: string read GetCaption write SetCaption stored IsCaptionStored; + property DataBinding: TcxGridItemDataBinding read FDataBinding write SetDataBinding; + property PropertiesClassName: string read GetPropertiesClassName write SetPropertiesClassName; + property Properties: TcxCustomEditProperties read FProperties write SetProperties; + property RepositoryItem: TcxEditRepositoryItem read FRepositoryItem write SetRepositoryItem; + property Visible: Boolean read GetVisible write SetVisible stored IsVisibleStored default True; + property PropertiesEvents: TNotifyEvent read FSubClassEvents write FSubClassEvents; + property StylesEvents: TNotifyEvent read FSubClassEvents write FSubClassEvents; + property Tag: TcxTag read GetTag write SetTag stored IsTagStored; + property OnCustomDrawCell: TcxGridTableDataCellCustomDrawEvent read FOnCustomDrawCell write SetOnCustomDrawCell; + property OnGetCellHint: TcxGridGetCellHintEvent read FOnGetCellHint write SetOnGetCellHint; + property OnGetDataText: TcxGridGetDataTextEvent read FOnGetDataText write SetOnGetDataText; + property OnGetDisplayText: TcxGridGetDisplayTextEvent read FOnGetDisplayText write SetOnGetDisplayText; + property OnGetFilterDisplayText: TcxGridGetFilterDisplayTextEvent read FOnGetFilterDisplayText write SetOnGetFilterDisplayText; + property OnGetFilterValues: TcxGridGetFilterValuesEvent read FOnGetFilterValues write SetOnGetFilterValues; + property OnGetProperties: TcxGridGetPropertiesEvent read FOnGetProperties write SetOnGetProperties; + property OnGetPropertiesForEdit: TcxGridGetPropertiesEvent read FOnGetPropertiesForEdit write SetOnGetPropertiesForEdit; + property OnGetStoredProperties: TcxGridTableItemGetStoredPropertiesEvent read FOnGetStoredProperties write SetOnGetStoredProperties; + property OnGetStoredPropertyValue: TcxGridTableItemGetStoredPropertyValueEvent read FOnGetStoredPropertyValue write SetOnGetStoredPropertyValue; + property OnInitFilteringDateRanges: TcxGridInitDateRangesEvent read FOnInitFilteringDateRanges write SetOnInitFilteringDateRanges; + property OnSetStoredPropertyValue: TcxGridTableItemSetStoredPropertyValueEvent read FOnSetStoredPropertyValue write SetOnSetStoredPropertyValue; + property OnUserFiltering: TcxGridUserFilteringEvent read FOnUserFiltering write SetOnUserFiltering; + end; + + // grid view options + + TcxCustomGridTableBackgroundBitmaps = class(TcxCustomGridBackgroundBitmaps) + protected + function GetBitmapStyleIndex(Index: Integer): Integer; override; + public + procedure Assign(Source: TPersistent); override; + published + property Content: TBitmap index bbContent read GetValue write SetValue; + property FilterBox: TBitmap index bbFilterBox read GetValue write SetValue; + end; + + TcxCustomGridTableDateTimeHandlingClass = class of TcxCustomGridTableDateTimeHandling; + + TcxCustomGridTableDateTimeHandling = class(TcxCustomGridOptions) + private + FDateFormat: string; + FFilters: TcxGridDateTimeFilters; + FGrouping: TcxGridDateTimeGrouping; + FHourFormat: string; + FIgnoreTimeForFiltering: Boolean; + FMonthFormat: string; + FUseLongDateFormat: Boolean; + FUseShortTimeFormat: Boolean; + FYearFormat: string; + function GetGridView: TcxCustomGridTableView; + procedure SetDateFormat(const Value: string); + procedure SetFilters(Value: TcxGridDateTimeFilters); + procedure SetGrouping(Value: TcxGridDateTimeGrouping); + procedure SetHourFormat(const Value: string); + procedure SetIgnoreTimeForFiltering(Value: Boolean); + procedure SetMonthFormat(const Value: string); + procedure SetUseLongDateFormat(Value: Boolean); + procedure SetUseShortTimeFormat(Value: Boolean); + procedure SetYearFormat(const Value: string); + protected + property DateFormat: string read FDateFormat write SetDateFormat; + property Grouping: TcxGridDateTimeGrouping read FGrouping write SetGrouping default dtgByDateAndTime; + property HourFormat: string read FHourFormat write SetHourFormat; + property UseLongDateFormat: Boolean read FUseLongDateFormat write SetUseLongDateFormat default True; + property UseShortTimeFormat: Boolean read FUseShortTimeFormat write SetUseShortTimeFormat default True; + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + function GetDateFormat: string; + function GetHourFormat: string; + function GetMonthFormat: string; + function GetYearFormat: string; + procedure GroupingChanged; + property GridView: TcxCustomGridTableView read GetGridView; + published + property Filters: TcxGridDateTimeFilters read FFilters write SetFilters default []; + property IgnoreTimeForFiltering: Boolean read FIgnoreTimeForFiltering write SetIgnoreTimeForFiltering default False; + property MonthFormat: string read FMonthFormat write SetMonthFormat; + property YearFormat: string read FYearFormat write SetYearFormat; + end; + + TcxGridFilterMRUItem = class(TcxMRUItem) + private + function GetCaption: string; + protected + function StreamEquals(AStream: TMemoryStream): Boolean; + public + Filter: TcxDataFilterCriteria; + constructor Create(AFilter: TcxDataFilterCriteria); + destructor Destroy; override; + procedure AssignTo(AFilter: TcxDataFilterCriteria); + function Equals(AItem: TcxMRUItem): Boolean; override; + function FilterEquals(AFilter: TcxDataFilterCriteria): Boolean; + function GetStream: TMemoryStream; + property Caption: string read GetCaption; + end; + + TcxGridFilterMRUItemsClass = class of TcxGridFilterMRUItems; + + TcxGridFilterMRUItems = class(TcxMRUItems) + private + FFiltering: TcxCustomGridTableFiltering; + FVisibleItems: TList; + function GetItem(Index: Integer): TcxGridFilterMRUItem; + function GetVisibleCount: Integer; + function GetVisibleItem(Index: Integer): TcxGridFilterMRUItem; + protected + procedure DeleteEmptyItems; + procedure FilterChanged; + procedure RefreshVisibleItemsList; + public + constructor Create(AFiltering: TcxCustomGridTableFiltering); reintroduce; virtual; + destructor Destroy; override; + procedure Add(AFilter: TcxDataFilterCriteria); + property Filtering: TcxCustomGridTableFiltering read FFiltering; + property Items[Index: Integer]: TcxGridFilterMRUItem read GetItem; default; + property VisibleCount: Integer read GetVisibleCount; + property VisibleItems[Index: Integer]: TcxGridFilterMRUItem read GetVisibleItem; + end; + + TcxGridFilterPosition = (fpTop, fpBottom); + TcxGridFilterVisible = (fvNever, fvNonEmpty, fvAlways); + + TcxGridFilterBoxClass = class of TcxGridFilterBox; + + TcxGridFilterBox = class(TcxCustomGridOptions) + private + FCustomizeDialog: Boolean; + FMRUItemsListDropDownCount: Integer; + FPosition: TcxGridFilterPosition; + FVisible: TcxGridFilterVisible; + procedure SetCustomizeDialog(Value: Boolean); + procedure SetMRUItemsListDropDownCount(Value: Integer); + procedure SetPosition(Value: TcxGridFilterPosition); + procedure SetVisible(Value: TcxGridFilterVisible); + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + published + property CustomizeDialog: Boolean read FCustomizeDialog write SetCustomizeDialog default True; + property MRUItemsListDropDownCount: Integer read FMRUItemsListDropDownCount + write SetMRUItemsListDropDownCount default 0; + property Position: TcxGridFilterPosition read FPosition write SetPosition default fpBottom; + property Visible: TcxGridFilterVisible read FVisible write SetVisible default fvNonEmpty; + end; + + TcxGridItemFilterPopupApplyChangesMode = (fpacImmediately, fpacOnButtonClick); + + TcxGridItemFilterPopupOptionsClass = class of TcxGridItemFilterPopupOptions; + + TcxGridItemFilterPopupOptions = class(TcxCustomGridOptions) + private + FApplyMultiSelectChanges: TcxGridItemFilterPopupApplyChangesMode; + FDropDownWidth: Integer; + FMaxDropDownItemCount: Integer; + FMultiSelect: Boolean; + procedure SetApplyMultiSelectChanges(Value: TcxGridItemFilterPopupApplyChangesMode); + procedure SetDropDownWidth(Value: Integer); + procedure SetMaxDropDownItemCount(Value: Integer); + procedure SetMultiSelect(Value: Boolean); + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + published + property ApplyMultiSelectChanges: TcxGridItemFilterPopupApplyChangesMode read FApplyMultiSelectChanges + write SetApplyMultiSelectChanges default fpacImmediately; + property DropDownWidth: Integer read FDropDownWidth write SetDropDownWidth default 0; + property MaxDropDownItemCount: Integer read FMaxDropDownItemCount + write SetMaxDropDownItemCount default cxGridFilterDefaultItemPopupMaxDropDownItemCount; + property MultiSelect: Boolean read FMultiSelect write SetMultiSelect default True; + end; + + TcxCustomGridTableFilteringClass = class of TcxCustomGridTableFiltering; + + TcxCustomGridTableFiltering = class(TcxCustomGridOptions) + private + FItemFilteredItemsList: Boolean; + FItemMRUItemsList: Boolean; + FItemMRUItemsListCount: Integer; + FItemPopup: TcxGridItemFilterPopupOptions; + FMRUItems: TcxGridFilterMRUItems; + FMRUItemsList: Boolean; + FMRUItemsListCount: Integer; + function GetCustomizeDialog: Boolean; + function GetGridView: TcxCustomGridTableView; + function GetMRUItemsListDropDownCount: Integer; + function GetPosition: TcxGridFilterPosition; + function GetVisible: TcxGridFilterVisible; + procedure SetCustomizeDialog(Value: Boolean); + procedure SetItemFilteredItemsList(Value: Boolean); + procedure SetItemMRUItemsList(Value: Boolean); + procedure SetItemMRUItemsListCount(Value: Integer); + procedure SetItemPopup(Value: TcxGridItemFilterPopupOptions); + procedure SetMRUItemsList(Value: Boolean); + procedure SetMRUItemsListCount(Value: Integer); + procedure SetMRUItemsListDropDownCount(Value: Integer); + procedure SetPosition(Value: TcxGridFilterPosition); + procedure SetVisible(Value: TcxGridFilterVisible); + procedure FilterControlDialogApply(Sender: TObject); + procedure ReadCustomizeDialog(Reader: TReader); + procedure ReadMRUItemsListDropDownCount(Reader: TReader); + procedure ReadPosition(Reader: TReader); + procedure ReadVisible(Reader: TReader); + protected + procedure DefineProperties(Filer: TFiler); override; + procedure FilterChanged; virtual; + function GetItemPopupClass: TcxGridItemFilterPopupOptionsClass; virtual; + function GetMRUItemsClass: TcxGridFilterMRUItemsClass; virtual; + function IsMRUItemsListAvailable: Boolean; virtual; + procedure MRUItemsVisibleCountChanged(AOldCount, ANewCount: Integer); virtual; + + property ItemFilteredItemsList: Boolean read FItemFilteredItemsList write SetItemFilteredItemsList default False; + property ItemMRUItemsList: Boolean read FItemMRUItemsList write SetItemMRUItemsList default True; + property ItemMRUItemsListCount: Integer read FItemMRUItemsListCount write SetItemMRUItemsListCount + default cxGridFilterDefaultItemMRUItemsListCount; + property ItemPopup: TcxGridItemFilterPopupOptions read FItemPopup write SetItemPopup; + + function GetItemPopupDropDownWidth: Integer; + function GetItemPopupMaxDropDownItemCount: Integer; + procedure SetItemPopupDropDownWidth(Value: Integer); + procedure SetItemPopupMaxDropDownItemCount(Value: Integer); + procedure ReadItemPopupDropDownWidth(Reader: TReader); + procedure ReadItemPopupMaxDropDownCount(Reader: TReader); + // obsolete - use ItemPopup.DropDownWidth + property DropDownWidth: Integer read GetItemPopupDropDownWidth write SetItemPopupDropDownWidth; + // obsolete - use ItemPopup.MaxDropDownItemCount + property MaxDropDownCount: Integer read GetItemPopupMaxDropDownItemCount write SetItemPopupMaxDropDownItemCount; + public + constructor Create(AGridView: TcxCustomGridView); override; + destructor Destroy; override; + procedure AddFilterToMRUItems(AFilter: TcxDataFilterCriteria = nil); + procedure Assign(Source: TPersistent); override; + procedure RunCustomizeDialog(AItem: TcxCustomGridTableItem = nil); + + property GridView: TcxCustomGridTableView read GetGridView; + property MRUItems: TcxGridFilterMRUItems read FMRUItems; + // obsolete - use GridView.FilterBox + property CustomizeDialog: Boolean read GetCustomizeDialog write SetCustomizeDialog; + property MRUItemsListDropDownCount: Integer read GetMRUItemsListDropDownCount write SetMRUItemsListDropDownCount; + property Position: TcxGridFilterPosition read GetPosition write SetPosition; + property Visible: TcxGridFilterVisible read GetVisible write SetVisible; + published + property MRUItemsList: Boolean read FMRUItemsList write SetMRUItemsList default True; + property MRUItemsListCount: Integer read FMRUItemsListCount write SetMRUItemsListCount + default cxGridFilterDefaultMRUItemsListCount; + end; + + TcxGridDragFocusing = (dfNone, dfDragOver, dfDragDrop); + + TcxCustomGridTableOptionsBehavior = class(TcxCustomGridOptionsBehavior) + private + FAlwaysShowEditor: Boolean; + FBestFitMaxRecordCount: Integer; + FCellHints: Boolean; + FCopyCaptionsToClipboard: Boolean; + FDragDropText: Boolean; + FDragFocusing: TcxGridDragFocusing; + FDragHighlighting: Boolean; + FDragOpening: Boolean; + FDragScrolling: Boolean; + FFocusCellOnCycle: Boolean; + FFocusCellOnTab: Boolean; + FFocusFirstCellOnNewRecord: Boolean; + FGoToNextCellOnEnter: Boolean; + FImmediateEditor: Boolean; + FIncSearch: Boolean; + FIncSearchItem: TcxCustomGridTableItem; + FNavigatorHints: Boolean; + FPullFocusing: Boolean; + function GetGridView: TcxCustomGridTableView; + procedure SetAlwaysShowEditor(Value: Boolean); + procedure SetBestFitMaxRecordCount(Value: Integer); + procedure SetCellHints(Value: Boolean); + procedure SetCopyCaptionsToClipboard(Value: Boolean); + procedure SetDragDropText(Value: Boolean); + procedure SetDragFocusing(Value: TcxGridDragFocusing); + procedure SetDragHighlighting(Value: Boolean); + procedure SetDragOpening(Value: Boolean); + procedure SetDragScrolling(Value: Boolean); + procedure SetFocusCellOnCycle(Value: Boolean); + procedure SetFocusCellOnTab(Value: Boolean); + procedure SetFocusFirstCellOnNewRecord(Value: Boolean); + procedure SetGoToNextCellOnEnter(Value: Boolean); + procedure SetImmediateEditor(Value: Boolean); + procedure SetIncSearch(Value: Boolean); + procedure SetIncSearchItem(Value: TcxCustomGridTableItem); + procedure SetNavigatorHints(Value: Boolean); + procedure SetPullFocusing(Value: Boolean); + protected + property FocusCellOnCycle: Boolean read FFocusCellOnCycle write SetFocusCellOnCycle default False; + property PullFocusing: Boolean read FPullFocusing write SetPullFocusing default False; + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + property BestFitMaxRecordCount: Integer read FBestFitMaxRecordCount write SetBestFitMaxRecordCount default 0; + property GridView: TcxCustomGridTableView read GetGridView; + published + property AlwaysShowEditor: Boolean read FAlwaysShowEditor write SetAlwaysShowEditor default False; + property CellHints: Boolean read FCellHints write SetCellHints default False; + property CopyCaptionsToClipboard: Boolean read FCopyCaptionsToClipboard write SetCopyCaptionsToClipboard default True; + property DragDropText: Boolean read FDragDropText write SetDragDropText default False; + property DragFocusing: TcxGridDragFocusing read FDragFocusing write SetDragFocusing default dfNone; + property DragHighlighting: Boolean read FDragHighlighting write SetDragHighlighting default True; + property DragOpening: Boolean read FDragOpening write SetDragOpening default True; + property DragScrolling: Boolean read FDragScrolling write SetDragScrolling default True; + property FocusCellOnTab: Boolean read FFocusCellOnTab write SetFocusCellOnTab default False; + property FocusFirstCellOnNewRecord: Boolean read FFocusFirstCellOnNewRecord + write SetFocusFirstCellOnNewRecord default False; + property GoToNextCellOnEnter: Boolean read FGoToNextCellOnEnter write SetGoToNextCellOnEnter default False; + property ImmediateEditor: Boolean read FImmediateEditor write SetImmediateEditor default True; + property IncSearch: Boolean read FIncSearch write SetIncSearch default False; + property IncSearchItem: TcxCustomGridTableItem read FIncSearchItem write SetIncSearchItem; + property NavigatorHints: Boolean read FNavigatorHints write SetNavigatorHints default False; + end; + + TcxGridQuickCustomizationReordering = (qcrDefault, qcrEnabled, qcrDisabled); + + TcxCustomGridTableOptionsCustomizeClass = class of TcxCustomGridTableOptionsCustomize; + + TcxCustomGridTableOptionsCustomize = class(TcxCustomGridOptions) + private + FItemFiltering: Boolean; + FItemGrouping: Boolean; + FItemHiding: Boolean; + FItemMoving: Boolean; + FItemSorting: Boolean; + FItemsQuickCustomization: Boolean; + FItemsQuickCustomizationMaxDropDownCount: Integer; + FItemsQuickCustomizationReordering: TcxGridQuickCustomizationReordering; + procedure SetItemFiltering(Value: Boolean); + procedure SetItemGrouping(Value: Boolean); + procedure SetItemHiding(Value: Boolean); + procedure SetItemMoving(Value: Boolean); + procedure SetItemSorting(Value: Boolean); + procedure SetItemsQuickCustomization(Value: Boolean); + procedure SetItemsQuickCustomizationMaxDropDownCount(Value: Integer); + procedure SetItemsQuickCustomizationReordering(Value: TcxGridQuickCustomizationReordering); + protected + property ItemFiltering: Boolean read FItemFiltering write SetItemFiltering default True; + property ItemGrouping: Boolean read FItemGrouping write SetItemGrouping default True; + property ItemHiding: Boolean read FItemHiding write SetItemHiding default False; + property ItemMoving: Boolean read FItemMoving write SetItemMoving default True; + property ItemSorting: Boolean read FItemSorting write SetItemSorting default True; + property ItemsQuickCustomization: Boolean read FItemsQuickCustomization + write SetItemsQuickCustomization default False; + property ItemsQuickCustomizationMaxDropDownCount: Integer read FItemsQuickCustomizationMaxDropDownCount + write SetItemsQuickCustomizationMaxDropDownCount default 0; + property ItemsQuickCustomizationReordering: TcxGridQuickCustomizationReordering + read FItemsQuickCustomizationReordering write SetItemsQuickCustomizationReordering default qcrDefault; + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + function SupportsItemsQuickCustomizationReordering: Boolean; virtual; + end; + + TcxCustomGridTableOptionsData = class(TcxCustomGridOptionsData) + private + FAppending: Boolean; + FCancelOnExit: Boolean; + FDeleting: Boolean; + FDeletingConfirmation: Boolean; + FEditing: Boolean; + FInserting: Boolean; + function GetGridView: TcxCustomGridTableView; + procedure SetAppending(Value: Boolean); + procedure SetCancelOnExit(Value: Boolean); + procedure SetDeleting(Value: Boolean); + procedure SetDeletingConfirmation(Value: Boolean); + procedure SetEditing(Value: Boolean); + procedure SetInserting(Value: Boolean); + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + property GridView: TcxCustomGridTableView read GetGridView; + published + property Appending: Boolean read FAppending write SetAppending default False; + property CancelOnExit: Boolean read FCancelOnExit write SetCancelOnExit default True; + property Deleting: Boolean read FDeleting write SetDeleting default True; + property DeletingConfirmation: Boolean read FDeletingConfirmation + write SetDeletingConfirmation default True; + property Editing: Boolean read FEditing write SetEditing default True; + property Inserting: Boolean read FInserting write SetInserting default True; + end; + + TcxCustomGridTableOptionsSelection = class(TcxCustomGridOptionsSelection) + private + FCellSelect: Boolean; + FHideFocusRectOnExit: Boolean; + FHideSelection: Boolean; + FInvertSelect: Boolean; + FUnselectFocusedRecordOnExit: Boolean; + function GetGridView: TcxCustomGridTableView; + function GetMultiSelect: Boolean; + procedure SetHideFocusRectOnExit(Value: Boolean); + procedure SetHideSelection(Value: Boolean); + procedure SetUnselectFocusedRecordOnExit(Value: Boolean); + protected + function IsInvertSelectStored: Boolean; virtual; + function IsMultiSelectStored: Boolean; virtual; + procedure SetCellSelect(Value: Boolean); virtual; + procedure SetInvertSelect(Value: Boolean); virtual; + procedure SetMultiSelect(Value: Boolean); virtual; + property GridView: TcxCustomGridTableView read GetGridView; + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + published + property CellSelect: Boolean read FCellSelect write SetCellSelect default True; + property HideFocusRect: Boolean read FHideFocusRectOnExit write SetHideFocusRectOnExit stored False; // for compatibility + property HideFocusRectOnExit: Boolean read FHideFocusRectOnExit write SetHideFocusRectOnExit default True; + property HideSelection: Boolean read FHideSelection write SetHideSelection default False; + property InvertSelect: Boolean read FInvertSelect write SetInvertSelect stored IsInvertSelectStored; + property MultiSelect: Boolean read GetMultiSelect write SetMultiSelect stored IsMultiSelectStored; + property UnselectFocusedRecordOnExit: Boolean read FUnselectFocusedRecordOnExit + write SetUnselectFocusedRecordOnExit default True; + end; + + TcxGridShowEditButtons = (gsebNever, gsebForFocusedRecord, gsebAlways); + TcxGridShowItemFilterButtons = (sfbAlways, sfbWhenSelected); + + TcxCustomGridTableOptionsView = class(TcxCustomGridOptionsView) + private + FCellAutoHeight: Boolean; + FCellEndEllipsis: Boolean; + FCellTextMaxLineCount: Integer; + FFocusRect: Boolean; + FItemCaptionAutoHeight: Boolean; + FItemCaptionEndEllipsis: Boolean; + FNavigator: Boolean; + FNavigatorOffset: Integer; + FNoDataToDisplayInfoText: string; + FShowEditButtons: TcxGridShowEditButtons; + FShowItemFilterButtons: TcxGridShowItemFilterButtons; + function GetGridView: TcxCustomGridTableView; + procedure SetCellAutoHeight(Value: Boolean); + procedure SetCellEndEllipsis(Value: Boolean); + procedure SetCellTextMaxLineCount(Value: Integer); + procedure SetFocusRect(Value: Boolean); + procedure SetItemCaptionAutoHeight(Value: Boolean); + procedure SetItemCaptionEndEllipsis(Value: Boolean); + procedure SetNavigator(Value: Boolean); + procedure SetNavigatorOffset(Value: Integer); + procedure SetNoDataToDisplayInfoText(const Value: string); + procedure SetShowEditButtons(Value: TcxGridShowEditButtons); + procedure SetShowItemFilterButtons(Value: TcxGridShowItemFilterButtons); + function IsNoDataToDisplayInfoTextAssigned: Boolean; + protected + procedure ItemCaptionAutoHeightChanged; dynamic; + + property CellAutoHeight: Boolean read FCellAutoHeight write SetCellAutoHeight default False; + property CellTextMaxLineCount: Integer read FCellTextMaxLineCount write SetCellTextMaxLineCount default 0; + property ItemCaptionAutoHeight: Boolean read FItemCaptionAutoHeight + write SetItemCaptionAutoHeight default False; + property ItemCaptionEndEllipsis: Boolean read FItemCaptionEndEllipsis + write SetItemCaptionEndEllipsis default False; + property ShowItemFilterButtons: TcxGridShowItemFilterButtons read FShowItemFilterButtons + write SetShowItemFilterButtons default sfbWhenSelected; + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + function GetNoDataToDisplayInfoText: string; + property GridView: TcxCustomGridTableView read GetGridView; + published + property CellEndEllipsis: Boolean read FCellEndEllipsis write SetCellEndEllipsis default False; + property FocusRect: Boolean read FFocusRect write SetFocusRect default True; + property Navigator: Boolean read FNavigator write SetNavigator default False; + property NavigatorOffset: Integer read FNavigatorOffset write SetNavigatorOffset default cxGridNavigatorDefaultOffset; + property NoDataToDisplayInfoText: string read FNoDataToDisplayInfoText + write SetNoDataToDisplayInfoText stored IsNoDataToDisplayInfoTextAssigned; + property ScrollBars; + property ShowEditButtons: TcxGridShowEditButtons read FShowEditButtons + write SetShowEditButtons default gsebNever; + end; + + TcxGridCellPos = class + GridRecord: TcxCustomGridRecord; + Item: TObject; + constructor Create(AGridRecord: TcxCustomGridRecord; AItem: TObject); + end; + + TcxGridDataCellPos = class + GridRecord: TcxCustomGridRecord; + Item: TcxCustomGridTableItem; + constructor Create(AGridRecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem); overload; + end; + + TcxCustomGridTableViewStyles = class(TcxCustomGridViewStyles) + private + FOnGetContentStyle: TcxGridGetCellStyleEvent; + function GetGridViewValue: TcxCustomGridTableView; + procedure SetOnGetContentStyle(Value: TcxGridGetCellStyleEvent); + protected + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + procedure GetSelectionParams(ARecord: TcxCustomGridRecord; AItem: TObject; + out AParams: TcxViewParams); + public + procedure Assign(Source: TPersistent); override; + procedure GetCellContentParams(ARecord: TcxCustomGridRecord; AItem: TObject; + out AParams: TcxViewParams); virtual; + procedure GetContentParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); virtual; + procedure GetDataCellContentParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); virtual; + procedure GetDataCellParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams; AUseViewInfo: Boolean = False; ACellViewInfo: TcxGridTableCellViewInfo = nil); virtual; + procedure GetRecordContentParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); virtual; + property GridView: TcxCustomGridTableView read GetGridViewValue; + published + property Content: TcxStyle index vsContent read GetValue write SetValue; + property ContentEven: TcxStyle index vsContentEven read GetValue write SetValue; + property ContentOdd: TcxStyle index vsContentOdd read GetValue write SetValue; + property FilterBox: TcxStyle index vsFilterBox read GetValue write SetValue; + property Inactive: TcxStyle index vsInactive read GetValue write SetValue; + property IncSearch: TcxStyle index vsIncSearch read GetValue write SetValue; + property Selection: TcxStyle index vsSelection read GetValue write SetValue; + property OnGetContentStyle: TcxGridGetCellStyleEvent read FOnGetContentStyle write SetOnGetContentStyle; + end; + + // grid view + + TcxGridOpenTableItemList = class(TcxOpenList) + private + function GetItem(Index: Integer): TcxCustomGridTableItem; + procedure SetItem(Index: Integer; Value: TcxCustomGridTableItem); + public + property Items[Index: Integer]: TcxCustomGridTableItem read GetItem write SetItem; default; + end; + + TcxGridTableCellCustomDrawEvent = procedure(Sender: TcxCustomGridTableView; + ACanvas: TcxCanvas; AViewInfo: TcxGridTableCellViewInfo; var ADone: Boolean) of object; + + TcxGridAllowRecordOperationEvent = procedure(Sender: TcxCustomGridTableView; + ARecord: TcxCustomGridRecord; var AAllow: Boolean) of object; + TcxGridCellClickEvent = procedure(Sender: TcxCustomGridTableView; + ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; + AShift: TShiftState; var AHandled: Boolean) of object; + TcxGridCustomTableViewEvent = procedure(Sender: TcxCustomGridTableView) of object; + TcxGridEditingEvent = procedure(Sender: TcxCustomGridTableView; + AItem: TcxCustomGridTableItem; var AAllow: Boolean) of object; + TcxGridEditKeyEvent = procedure(Sender: TcxCustomGridTableView; AItem: TcxCustomGridTableItem; + AEdit: TcxCustomEdit; var Key: Word; Shift: TShiftState) of object; + TcxGridEditKeyPressEvent = procedure(Sender: TcxCustomGridTableView; + AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit; var Key: Char) of object; + TcxGridCustomTableItemEvent = procedure(Sender: TcxCustomGridTableView; + AItem: TcxCustomGridTableItem) of object; + TcxGridFilterCustomizationEvent = procedure(Sender: TcxCustomGridTableView; + var ADone: Boolean) of object; + TcxGridFilterDialogShowEvent = procedure(Sender: TcxCustomGridTableView; + AItem: TcxCustomGridTableItem; var ADone: Boolean) of object; + TcxGridFocusedItemChangedEvent = procedure(Sender: TcxCustomGridTableView; + APrevFocusedItem, AFocusedItem: TcxCustomGridTableItem) of object; + TcxGridFocusedRecordChangedEvent = procedure(Sender: TcxCustomGridTableView; + APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean) of object; + TcxGridGetCellHeightEvent = procedure(Sender: TcxCustomGridTableView; + ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + ACellViewInfo: TcxGridTableDataCellViewInfo; var AHeight: Integer) of object; + TcxGridGetDragDropTextEvent = procedure(Sender: TcxCustomGridTableView; + ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; var AText: string) of object; + TcxGridInitEditEvent = procedure(Sender: TcxCustomGridTableView; + AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit) of object; + TcxGridInitEditValueEvent = procedure(Sender: TcxCustomGridTableView; + AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit; var AValue: TcxEditValue) of object; + TcxGridPartCustomDrawBackgroundEvent = procedure(Sender: TcxCustomGridTableView; + ACanvas: TcxCanvas; AViewInfo: TcxCustomGridCellViewInfo; var ADone: Boolean) of object; + TcxGridRecordEvent = procedure(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord) of object; + + TcxGridDataControllerChange = (dccItemAdded, dccItemRemoved, dccIndexesChanged); + + TcxCustomGridTableView = class(TcxCustomGridView, IcxFilterControl, IcxNavigator) + private + FAssigningGroupedItems: TcxGridOpenTableItemList; + FAssigningSortedItems: TcxGridOpenTableItemList; + FCopyToClipboardItems: TList; + FCopyToClipboardStr: string; + FDateTimeHandling: TcxCustomGridTableDateTimeHandling; + FDontMakeMasterRecordVisible: Boolean; + FFilterableItems: TList; + FFilterBox: TcxGridFilterBox; + FFiltering: TcxCustomGridTableFiltering; + FIgnorePropertiesChanges: Boolean; + FIsAfterAssigningItems: Boolean; + FIsAssigningItems: Boolean; + FItems: TList; + FNavigatorButtons: TcxNavigatorControlButtons; + FNavigatorNotifier: TcxNavigatorControlNotifier; + FNextID: Integer; + FOptionsCustomize: TcxCustomGridTableOptionsCustomize; + FRestoringItems: TcxGridOpenTableItemList; + FVisibleItems: TList; + FOnCanFocusRecord: TcxGridAllowRecordOperationEvent; + FOnCanSelectRecord: TcxGridAllowRecordOperationEvent; + FOnCellClick: TcxGridCellClickEvent; + FOnCellDblClick: TcxGridCellClickEvent; + FOnCustomDrawCell: TcxGridTableDataCellCustomDrawEvent; + FOnCustomDrawPartBackground: TcxGridPartCustomDrawBackgroundEvent; + FOnEditing: TcxGridEditingEvent; + FOnEditChanged: TcxGridCustomTableItemEvent; + FOnEditKeyDown: TcxGridEditKeyEvent; + FOnEditKeyPress: TcxGridEditKeyPressEvent; + FOnEditKeyUp: TcxGridEditKeyEvent; + FOnEditValueChanged: TcxGridCustomTableItemEvent; + FOnFilterControlDialogShow: TNotifyEvent; + FOnFilterCustomization: TcxGridFilterCustomizationEvent; + FOnFilterDialogShow: TcxGridFilterDialogShowEvent; + FOnFocusedItemChanged: TcxGridFocusedItemChangedEvent; + FOnFocusedRecordChanged: TcxGridFocusedRecordChangedEvent; + FOnGetCellHeight: TcxGridGetCellHeightEvent; + FOnGetDragDropText: TcxGridGetDragDropTextEvent; + FOnInitFilteringDateRanges: TcxGridInitDateRangesEvent; + FOnInitGroupingDateRanges: TcxGridInitDateRangesEvent; + FOnInitEdit: TcxGridInitEditEvent; + FOnInitEditValue: TcxGridInitEditValueEvent; + //FOnRecordCreated: TcxGridRecordEvent; + //FOnRecordDestroying: TcxGridRecordEvent; + FOnSelectionChanged: TcxGridCustomTableViewEvent; + FOnTopRecordIndexChanged: TNotifyEvent; + + function GetBackgroundBitmaps: TcxCustomGridTableBackgroundBitmaps; + function GetController: TcxCustomGridTableController; + function GetFilterableItem(Index: Integer): TcxCustomGridTableItem; + function GetFilterableItemCount: Integer; + function GetGroupedItem(Index: Integer): TcxCustomGridTableItem; + function GetGroupedItemCount: Integer; + function GetItem(Index: Integer): TcxCustomGridTableItem; + function GetItemCount: Integer; + function GetMasterGridRecord: TcxCustomGridRecord; + function GetOptionsBehavior: TcxCustomGridTableOptionsBehavior; + function GetOptionsData: TcxCustomGridTableOptionsData; + function GetOptionsSelection: TcxCustomGridTableOptionsSelection; + function GetOptionsView: TcxCustomGridTableOptionsView; + function GetPainter: TcxCustomGridTablePainter; + function GetPatternGridView: TcxCustomGridTableView; + function GetNavigatorButtonsControl: IcxNavigator; + function GetSortedItem(Index: Integer): TcxCustomGridTableItem; + function GetSortedItemCount: Integer; + function GetStyles: TcxCustomGridTableViewStyles; + function GetViewData: TcxCustomGridTableViewData; + function GetViewInfo: TcxCustomGridTableViewInfo; + function GetVisibleItem(Index: Integer): TcxCustomGridTableItem; + function GetVisibleItemCount: Integer; + procedure SetBackgroundBitmaps(Value: TcxCustomGridTableBackgroundBitmaps); + procedure SetDateTimeHandling(Value: TcxCustomGridTableDateTimeHandling); + procedure SetFilterBox(Value: TcxGridFilterBox); + procedure SetFiltering(Value: TcxCustomGridTableFiltering); + procedure SetItem(Index: Integer; Value: TcxCustomGridTableItem); + procedure SetNavigatorButtons(Value: TcxNavigatorControlButtons); + procedure SetOnCanFocusRecord(Value: TcxGridAllowRecordOperationEvent); + procedure SetOnCanSelectRecord(Value: TcxGridAllowRecordOperationEvent); + procedure SetOnCellClick(Value: TcxGridCellClickEvent); + procedure SetOnCellDblClick(Value: TcxGridCellClickEvent); + procedure SetOnCustomDrawCell(Value: TcxGridTableDataCellCustomDrawEvent); + procedure SetOnCustomDrawPartBackground(Value: TcxGridPartCustomDrawBackgroundEvent); + procedure SetOnEditChanged(Value: TcxGridCustomTableItemEvent); + procedure SetOnEditing(Value: TcxGridEditingEvent); + procedure SetOnEditKeyDown(Value: TcxGridEditKeyEvent); + procedure SetOnEditKeyPress(Value: TcxGridEditKeyPressEvent); + procedure SetOnEditKeyUp(Value: TcxGridEditKeyEvent); + procedure SetOnEditValueChanged(Value: TcxGridCustomTableItemEvent); + procedure SetOnFilterControlDialogShow(Value: TNotifyEvent); + procedure SetOnFilterCustomization(Value: TcxGridFilterCustomizationEvent); + procedure SetOnFilterDialogShow(Value: TcxGridFilterDialogShowEvent); + procedure SetOnFocusedItemChanged(Value: TcxGridFocusedItemChangedEvent); + procedure SetOnFocusedRecordChanged(Value: TcxGridFocusedRecordChangedEvent); + procedure SetOnGetCellHeight(Value: TcxGridGetCellHeightEvent); + procedure SetOnGetDragDropText(Value: TcxGridGetDragDropTextEvent); + procedure SetOnInitFilteringDateRanges(Value: TcxGridInitDateRangesEvent); + procedure SetOnInitGroupingDateRanges(Value: TcxGridInitDateRangesEvent); + procedure SetOnInitEdit(Value: TcxGridInitEditEvent); + procedure SetOnInitEditValue(Value: TcxGridInitEditValueEvent); + procedure SetOnSelectionChanged(Value: TcxGridCustomTableViewEvent); + procedure SetOnTopRecordIndexChanged(Value: TNotifyEvent); + procedure SetOptionsBehavior(Value: TcxCustomGridTableOptionsBehavior); + procedure SetOptionsCustomize(Value: TcxCustomGridTableOptionsCustomize); + procedure SetOptionsData(Value: TcxCustomGridTableOptionsData); + procedure SetOptionsSelection(Value: TcxCustomGridTableOptionsSelection); + procedure SetOptionsView(Value: TcxCustomGridTableOptionsView); + procedure SetStyles(Value: TcxCustomGridTableViewStyles); + + procedure CopyForEachRowProc(ARowIndex: Integer; ARowInfo: TcxRowInfo); + procedure RefreshItemIndexes; + protected + // IcxFilterControl + function IcxFilterControl.GetCaption = GetFilterCaption; + function IcxFilterControl.GetCount = GetFilterCount; + function IcxFilterControl.GetCriteria = GetFilterCriteria; + function IcxFilterControl.GetFieldName = GetFilterFieldName; + function IcxFilterControl.GetItemLink = GetFilterItemLink; + function IcxFilterControl.GetItemLinkID = GetFilterItemLinkID; + function IcxFilterControl.GetItemLinkName = GetFilterItemLinkName; + function IcxFilterControl.GetProperties = GetFilterProperties; + function IcxFilterControl.GetValueType = GetFilterValueType; + function GetFilterCaption(Index: Integer): string; + function GetFilterCount: Integer; + function GetFilterCriteria: TcxFilterCriteria; + function GetFilterFieldName(Index: Integer): string; + function GetFilterItemLink(Index: Integer): TObject; + function GetFilterItemLinkID(Index: Integer): Integer; + function GetFilterItemLinkName(Index: Integer): string; + function GetFilterProperties(Index: Integer): TcxCustomEditProperties; + function GetFilterValueType(Index: Integer): cxDataStorage.TcxValueTypeClass; + // IcxNavigator + function IcxNavigator.IsActive = NavigatorIsActive; + function IcxNavigator.IsBof = NavigatorIsBof; + function IcxNavigator.IsEof = NavigatorIsEof; + function IcxNavigator.CanAppend = NavigatorCanAppend; + function IcxNavigator.CanEdit = NavigatorCanEdit; + function IcxNavigator.CanDelete = NavigatorCanDelete; + function IcxNavigator.CanInsert = NavigatorCanInsert; + function IcxNavigator.IsEditing = NavigatorIsEditing; + procedure IcxNavigator.ClearBookmark = NavigatorClearBookmark; + function IcxNavigator.IsBookmarkAvailable = NavigatorIsBookmarkAvailable; + procedure IcxNavigator.DoAction = NavigatorDoAction; + function IcxNavigator.GetNotifier = NavigatorGetNotifier; + function IcxNavigator.IsActionSupported = NavigatorIsActionSupported; + function NavigatorIsActive: Boolean; + function NavigatorIsBof: Boolean; + function NavigatorIsEof: Boolean; + function NavigatorCanAppend: Boolean; + function NavigatorCanEdit: Boolean; + function NavigatorCanDelete: Boolean; + function NavigatorCanInsert: Boolean; + function NavigatorIsEditing: Boolean; + procedure NavigatorClearBookmark; + function NavigatorIsBookmarkAvailable: Boolean; + procedure NavigatorDoAction(AButtonIndex: Integer); + function NavigatorGetNotifier: TcxNavigatorControlNotifier; + function NavigatorIsActionSupported(AButtonIndex: Integer): Boolean; + // IcxStoredObject + function GetProperties(AProperties: TStrings): Boolean; override; + procedure GetPropertyValue(const AName: string; var AValue: Variant); override; + procedure SetPropertyValue(const AName: string; const AValue: Variant); override; + // IcxStoredParent + function CreateStoredObject(const AObjectName, AClassName: string): TObject; override; + procedure GetStoredChildren(AChildren: TStringList); override; + // IcxGridViewLayoutEditorSupport - for design-time layout editor + procedure AssignLayout(ALayoutView: TcxCustomGridView); override; + procedure BeforeEditLayout(ALayoutView: TcxCustomGridView); override; + function HasLayoutCustomizationForm: Boolean; override; + + procedure BeforeRestoring; override; + procedure AfterRestoring; override; + procedure ReadState(Reader: TReader); override; + property RestoringItems: TcxGridOpenTableItemList read FRestoringItems; + + procedure BeginAssignItems; + procedure DoBeforeAssignItems; virtual; + procedure DoItemsAssigned; virtual; + procedure EndAssignItems; + property AssigningGroupedItems: TcxGridOpenTableItemList read FAssigningGroupedItems; + property AssigningSortedItems: TcxGridOpenTableItemList read FAssigningSortedItems; + property IsAssigningItems: Boolean read FIsAssigningItems; + property IsAfterAssigningItems: Boolean read FIsAfterAssigningItems; + + function CanOffset(ARecordCountDelta: Integer): Boolean; virtual; + function CanSelectRecord(ARecordIndex: Integer): Boolean; virtual; + function CanTabStop: Boolean; override; + procedure DetailVisibleChanged(ADetailLevel: TComponent; + APrevVisibleDetailCount, AVisibleDetailCount: Integer); override; + procedure DoAssign(ASource: TcxCustomGridView); override; + function FindItemByObjectName(const AObjectName: string): TcxCustomGridTableItem; + procedure FocusEdit(AItemIndex: Integer; var ADone: Boolean); virtual; + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + function GetDefaultActiveDetailIndex: Integer; virtual; + procedure GetFakeComponentLinks(AList: TList); override; + function GetIsControlFocused: Boolean; override; + procedure GetItemsListForClipboard(AItems: TList; ACopyAll: Boolean); virtual; + function GetItemSortByDisplayText(AItemIndex: Integer; ASortByDisplayText: Boolean): Boolean; + function GetItemValueSource(AItemIndex: Integer): TcxDataEditValueSource; + procedure GetVisibleItemsList(AItems: TList); virtual; + function HasCustomDrawCell: Boolean; + function HasCustomDrawPartBackground: Boolean; + procedure Init; override; + function IsDetailVisible(AGridView: TcxCustomGridView): Boolean; override; + function IsEqualHeightRecords: Boolean; virtual; + function IsRecordHeightDependsOnData: Boolean; virtual; + function IsRecordHeightDependsOnFocus: Boolean; virtual; + procedure LoadingComplete; override; + procedure Offset(ARecordCountDelta, DX, DY: Integer); virtual; + procedure SetChildOrder(Child: TComponent; Order: Integer); override; + procedure SetName(const NewName: TComponentName); override; + procedure UpdateControl(AInfo: TcxUpdateControlInfo); override; + procedure UpdateDataController(AChange: TcxGridDataControllerChange; + AItem: TcxCustomGridTableItem = nil); + procedure UpdateRecord; virtual; + + procedure CreateHandlers; override; + procedure DestroyHandlers; override; + procedure CreateOptions; override; + procedure DestroyOptions; override; + + procedure AddItem(AItem: TcxCustomGridTableItem); virtual; + procedure RemoveItem(AItem: TcxCustomGridTableItem); virtual; + procedure AssignVisibleItemsIndexes; + procedure ChangeItemIndex(AItem: TcxCustomGridTableItem; Value: Integer); virtual; + procedure CheckItemVisibles; + procedure SaveItemVisibles; + procedure ItemIndexChanged(AItem: TcxCustomGridTableItem; AOldIndex: Integer); virtual; + procedure ItemVisibilityChanged(AItem: TcxCustomGridTableItem; Value: Boolean); virtual; + procedure RefreshVisibleItemsList; virtual; + + function GetItemClass: TcxCustomGridTableItemClass; virtual; abstract; + function GetItemDataBindingClass: TcxGridItemDataBindingClass; virtual; + function GetNextID: Integer; + procedure ReleaseID(AID: Integer); + + procedure DataChanged; virtual; + procedure DataLayoutChanged; virtual; + function DoCellClick(ACellViewInfo: TcxGridTableDataCellViewInfo; + AButton: TMouseButton; AShift: TShiftState): Boolean; virtual; + function DoCellDblClick(ACellViewInfo: TcxGridTableDataCellViewInfo; + AButton: TMouseButton; AShift: TShiftState): Boolean; virtual; + function DoEditing(AItem: TcxCustomGridTableItem): Boolean; virtual; + procedure DoTopRecordIndexChanged; virtual; + procedure FilterChanged; virtual; + procedure FocusedItemChanged(APrevFocusedItem, AFocusedItem: TcxCustomGridTableItem); virtual; + procedure FocusedRecordChanged(APrevFocusedRecordIndex, AFocusedRecordIndex: Integer; + ANewItemRecordFocusingChanged: Boolean); virtual; + procedure GroupingChanging; virtual; + procedure ItemCaptionChanged(AItem: TcxCustomGridTableItem); virtual; + procedure ItemValueTypeClassChanged(AItemIndex: Integer); virtual; + procedure RecalculateDefaultWidths; + procedure RecordChanged(ARecordIndex: Integer); virtual; + procedure RecordCountChanged; virtual; + procedure RefreshFilterableItemsList; + procedure RefreshNavigators; + procedure SearchChanged; virtual; + procedure SelectionChanged(AInfo: TcxSelectionChangedInfo); virtual; + + function CalculateDataCellSelected(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; AUseViewInfo: Boolean; + ACellViewInfo: TcxGridTableCellViewInfo): Boolean; virtual; + function DrawDataCellSelected(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + AUseViewInfo: Boolean = False; ACellViewInfo: TcxGridTableCellViewInfo = nil): Boolean; virtual; + function DrawRecordActive(ARecord: TcxCustomGridRecord): Boolean; virtual; + function DrawRecordFocused(ARecord: TcxCustomGridRecord): Boolean; virtual; + function DrawRecordSelected(ARecord: TcxCustomGridRecord): Boolean; virtual; + function DrawSelection: Boolean; virtual; + + function DoCanFocusRecord(ARecord: TcxCustomGridRecord): Boolean; virtual; + procedure DoCustomDrawCell(ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; + var ADone: Boolean); virtual; + procedure DoCustomDrawPartBackground(ACanvas: TcxCanvas; AViewInfo: TcxCustomGridCellViewInfo; + var ADone: Boolean); virtual; + procedure DoEditChanged(AItem: TcxCustomGridTableItem); virtual; + procedure DoEditKeyDown(AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit; + var Key: Word; Shift: TShiftState); virtual; + procedure DoEditKeyPress(AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit; + var Key: Char); virtual; + procedure DoEditKeyUp(AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit; + var Key: Word; Shift: TShiftState); virtual; + procedure DoEditValueChanged(AItem: TcxCustomGridTableItem); virtual; + function DoFilterCustomization: Boolean; virtual; + function DoFilterDialogShow(AItem: TcxCustomGridTableItem): Boolean; virtual; + procedure DoFocusedRecordChanged(APrevFocusedRecordIndex, AFocusedRecordIndex: Integer; + ANewItemRecordFocusingChanged: Boolean); virtual; + procedure DoGetCellHeight(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + ACellViewInfo: TcxGridTableDataCellViewInfo; var AHeight: Integer); virtual; + function DoGetDragDropText(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem): string; virtual; + procedure DoInitEdit(AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit); virtual; + procedure DoInitEditValue(AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit; + var AValue: TcxEditValue); virtual; + procedure DoInitFilteringDateRanges(AItem: TcxCustomGridTableItem); virtual; + procedure DoInitGroupingDateRanges(AItem: TcxCustomGridTableItem); virtual; + //procedure DoRecordCreated(ARecord: TcxCustomGridRecord); virtual; + //procedure DoRecordDestroying(ARecord: TcxCustomGridRecord); virtual; + procedure DoSelectionChanged; virtual; + function HasCustomProperties: Boolean; + function HasInitFilteringDateRangesHandler: Boolean; + function HasInitGroupingDateRangesHandler: Boolean; + function IsGetCellHeightAssigned: Boolean; + + function GetControllerClass: TcxCustomGridControllerClass; override; + function GetPainterClass: TcxCustomGridPainterClass; override; + function GetViewDataClass: TcxCustomGridViewDataClass; override; + function GetViewInfoCacheClass: TcxCustomGridViewInfoCacheClass; override; + function GetViewInfoClass: TcxCustomGridViewInfoClass; override; + + function GetBackgroundBitmapsClass: TcxCustomGridBackgroundBitmapsClass; override; + function GetDateTimeHandlingClass: TcxCustomGridTableDateTimeHandlingClass; virtual; + function GetFilterBoxClass: TcxGridFilterBoxClass; virtual; + function GetFilteringClass: TcxCustomGridTableFilteringClass; virtual; + function GetNavigatorButtonsClass: TcxNavigatorControlButtonsClass; virtual; + function GetOptionsBehaviorClass: TcxCustomGridOptionsBehaviorClass; override; + function GetOptionsCustomizeClass: TcxCustomGridTableOptionsCustomizeClass; virtual; + function GetOptionsDataClass: TcxCustomGridOptionsDataClass; override; + function GetOptionsSelectionClass: TcxCustomGridOptionsSelectionClass; override; + function GetOptionsViewClass: TcxCustomGridOptionsViewClass; override; + function GetStylesClass: TcxCustomGridViewStylesClass; override; + + function GetSummaryGroupItemLinkClass: TcxDataSummaryGroupItemLinkClass; virtual; + function GetSummaryItemClass: TcxDataSummaryItemClass; virtual; + + property BackgroundBitmaps: TcxCustomGridTableBackgroundBitmaps read GetBackgroundBitmaps + write SetBackgroundBitmaps; + property DontMakeMasterRecordVisible: Boolean read FDontMakeMasterRecordVisible + write FDontMakeMasterRecordVisible; + property FilterableItemCount: Integer read GetFilterableItemCount; + property FilterableItems[Index: Integer]: TcxCustomGridTableItem read GetFilterableItem; + property IgnorePropertiesChanges: Boolean read FIgnorePropertiesChanges write FIgnorePropertiesChanges; + property ItemsList: TList read FItems; + property NavigatorNotifier: TcxNavigatorControlNotifier read FNavigatorNotifier; + property NextID: Integer read FNextID; + property VisibleItemsList: TList read FVisibleItems; + + property OnInitGroupingDateRanges: TcxGridInitDateRangesEvent read FOnInitGroupingDateRanges write SetOnInitGroupingDateRanges; + public + destructor Destroy; override; + + procedure ApplyBestFit(AItem: TcxCustomGridTableItem = nil; ACheckSizingAbility: Boolean = False; + AFireEvents: Boolean = False); virtual; + procedure ClearItems; + procedure CopyToClipboard(ACopyAll: Boolean); + function CreateItem: TcxCustomGridTableItem; + function FindItemByID(AID: Integer): TcxCustomGridTableItem; + function FindItemByName(const AName: string): TcxCustomGridTableItem; + function FindItemByTag(ATag: TcxTag): TcxCustomGridTableItem; + function IndexOfItem(AItem: TcxCustomGridTableItem): Integer; + procedure MakeMasterGridRecordVisible; + procedure RestoreDefaults; override; + + // for extended lookup edit + class function CanBeLookupList: Boolean; virtual; + + property Controller: TcxCustomGridTableController read GetController; + property DateTimeHandling: TcxCustomGridTableDateTimeHandling read FDateTimeHandling write SetDateTimeHandling; + property Filtering: TcxCustomGridTableFiltering read FFiltering write SetFiltering; + property GroupedItemCount: Integer read GetGroupedItemCount; + property GroupedItems[Index: Integer]: TcxCustomGridTableItem read GetGroupedItem; + property ItemCount: Integer read GetItemCount; + property Items[Index: Integer]: TcxCustomGridTableItem read GetItem write SetItem; + property MasterGridRecord: TcxCustomGridRecord read GetMasterGridRecord; + property OptionsBehavior: TcxCustomGridTableOptionsBehavior read GetOptionsBehavior + write SetOptionsBehavior; + property OptionsCustomize: TcxCustomGridTableOptionsCustomize read FOptionsCustomize + write SetOptionsCustomize; + property OptionsData: TcxCustomGridTableOptionsData read GetOptionsData write SetOptionsData; + property OptionsSelection: TcxCustomGridTableOptionsSelection read GetOptionsSelection + write SetOptionsSelection; + property OptionsView: TcxCustomGridTableOptionsView read GetOptionsView write SetOptionsView; + property Painter: TcxCustomGridTablePainter read GetPainter; + property PatternGridView: TcxCustomGridTableView read GetPatternGridView; + property SortedItemCount: Integer read GetSortedItemCount; + property SortedItems[Index: Integer]: TcxCustomGridTableItem read GetSortedItem; + property Styles: TcxCustomGridTableViewStyles read GetStyles write SetStyles; + property ViewData: TcxCustomGridTableViewData read GetViewData; + property ViewInfo: TcxCustomGridTableViewInfo read GetViewInfo; + property VisibleItemCount: Integer read GetVisibleItemCount; + property VisibleItems[Index: Integer]: TcxCustomGridTableItem read GetVisibleItem; + published + property NavigatorButtons: TcxNavigatorControlButtons read FNavigatorButtons write SetNavigatorButtons; + property FilterBox: TcxGridFilterBox read FFilterBox write SetFilterBox; + + property NavigatorButtonsEvents: TNotifyEvent read FSubClassEvents write FSubClassEvents; + property OnCanFocusRecord: TcxGridAllowRecordOperationEvent read FOnCanFocusRecord write SetOnCanFocusRecord; + property OnCanSelectRecord: TcxGridAllowRecordOperationEvent read FOnCanSelectRecord write SetOnCanSelectRecord; + property OnCellClick: TcxGridCellClickEvent read FOnCellClick write SetOnCellClick; + property OnCellDblClick: TcxGridCellClickEvent read FOnCellDblClick write SetOnCellDblClick; + property OnCustomDrawCell: TcxGridTableDataCellCustomDrawEvent read FOnCustomDrawCell write SetOnCustomDrawCell; + property OnCustomDrawPartBackground: TcxGridPartCustomDrawBackgroundEvent + read FOnCustomDrawPartBackground write SetOnCustomDrawPartBackground; + property OnEditing: TcxGridEditingEvent read FOnEditing write SetOnEditing; + property OnEditChanged: TcxGridCustomTableItemEvent read FOnEditChanged write SetOnEditChanged; + property OnEditKeyDown: TcxGridEditKeyEvent read FOnEditKeyDown write SetOnEditKeyDown; + property OnEditKeyPress: TcxGridEditKeyPressEvent read FOnEditKeyPress write SetOnEditKeyPress; + property OnEditKeyUp: TcxGridEditKeyEvent read FOnEditKeyUp write SetOnEditKeyUp; + property OnEditValueChanged: TcxGridCustomTableItemEvent read FOnEditValueChanged write SetOnEditValueChanged; + property OnFilterControlDialogShow: TNotifyEvent read FOnFilterControlDialogShow + write SetOnFilterControlDialogShow; + property OnFilterCustomization: TcxGridFilterCustomizationEvent read FOnFilterCustomization + write SetOnFilterCustomization; + property OnFilterDialogShow: TcxGridFilterDialogShowEvent read FOnFilterDialogShow + write SetOnFilterDialogShow; + property OnFocusedItemChanged: TcxGridFocusedItemChangedEvent read FOnFocusedItemChanged + write SetOnFocusedItemChanged; + property OnFocusedRecordChanged: TcxGridFocusedRecordChangedEvent read FOnFocusedRecordChanged + write SetOnFocusedRecordChanged; + property OnGetCellHeight: TcxGridGetCellHeightEvent read FOnGetCellHeight write SetOnGetCellHeight; + property OnGetDragDropText: TcxGridGetDragDropTextEvent read FOnGetDragDropText write SetOnGetDragDropText; + property OnInitEdit: TcxGridInitEditEvent read FOnInitEdit write SetOnInitEdit; + property OnInitEditValue: TcxGridInitEditValueEvent read FOnInitEditValue write SetOnInitEditValue; + property OnInitFilteringDateRanges: TcxGridInitDateRangesEvent read FOnInitFilteringDateRanges write SetOnInitFilteringDateRanges; + property OnInitStoredObject; + //property OnRecordCreated: TcxGridRecordEvent read FOnRecordCreated write FOnRecordCreated; + //property OnRecordDestroying: TcxGridRecordEvent read FOnRecordDestroying write FOnRecordDestroying; + property OnSelectionChanged: TcxGridCustomTableViewEvent read FOnSelectionChanged write SetOnSelectionChanged; + property OnTopRecordIndexChanged: TNotifyEvent read FOnTopRecordIndexChanged write SetOnTopRecordIndexChanged; + end; + + { TcxCustomGridTableControllerAccess } + + TcxCustomGridTableControllerAccess = class + public + class procedure FocusNextPage(AInstance: TcxCustomGridTableController; + ASyncSelection: Boolean); + class procedure FocusPrevPage(AInstance: TcxCustomGridTableController; + ASyncSelection: Boolean); + end; + + { TcxCustomGridTableItemAccess } + + TcxCustomGridTableItemAccess = class + public + class function CanGroup(AInstance: TcxCustomGridTableItem): Boolean; + class function CanHide(AInstance: TcxCustomGridTableItem): Boolean; + class function CanHorzSize(AInstance: TcxCustomGridTableItem): Boolean; + class function CanSort(AInstance: TcxCustomGridTableItem): Boolean; + class procedure CheckWidthValue(AInstance: TcxCustomGridTableItem; + var Value: Integer); + class procedure DoGetDataText(AInstance: TcxCustomGridTableItem; + ARecordIndex: Integer; var AText: string); + class procedure DoGetDisplayText(AInstance: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; var AText: string); + class function GetGroupIndex(AInstance: TcxCustomGridTableItem): Integer; + + class function GetFilterCaption(AInstance: TcxCustomGridTableItem): string; + end; + + { TcxCustomGridTableOptionsBehaviorAccess } + + TcxCustomGridTableOptionsBehaviorAccess = class + public + class function GetPullFocusing( + AInstance: TcxCustomGridTableOptionsBehavior): Boolean; + class procedure SetPullFocusing( + AInstance: TcxCustomGridTableOptionsBehavior; Value: Boolean); + end; + + { TcxCustomGridTableOptionsViewAccess } + + TcxCustomGridTableOptionsViewAccess = class + public + class function GetCellAutoHeight(AInstance: TcxCustomGridTableOptionsView): Boolean; + end; + + { TcxCustomGridTableViewAccess } + + TcxCustomGridTableViewAccess = class + public + class function CanSelectRecord(AInstance: TcxCustomGridTableView; + ARecordIndex: Integer): Boolean; + class procedure FilterChanged(AInstance: TcxCustomGridTableView); + class function FindItemByObjectName(AInstance: TcxCustomGridTableView; + const AObjectName: string): TcxCustomGridTableItem; + class procedure FocusEdit(AInstance: TcxCustomGridTableView; + AItemIndex: Integer; var ADone: Boolean); + class function GetDefaultActiveDetailIndex( + AInstance: TcxCustomGridTableView): Integer; + class function GetItemClass(AInstance: TcxCustomGridTableView): TcxCustomGridTableItemClass; + class function GetItemSortByDisplayText(AInstance: TcxCustomGridTableView; + AItemIndex: Integer; ASortByDisplayText: Boolean): Boolean; + class function GetItemValueSource(AInstance: TcxCustomGridTableView; + AItemIndex: Integer): TcxDataEditValueSource; + class function GetSummaryGroupItemLinkClass( + AInstance: TcxCustomGridTableView): TcxDataSummaryGroupItemLinkClass; + class function GetSummaryItemClass( + AInstance: TcxCustomGridTableView): TcxDataSummaryItemClass; + class function IsEqualHeightRecords( + AInstance: TcxCustomGridTableView): Boolean; + class function IsGetCellHeightAssigned( + AInstance: TcxCustomGridTableView): Boolean; + class procedure ItemValueTypeClassChanged(AInstance: TcxCustomGridTableView; + AItemIndex: Integer); + class procedure RefreshNavigators(AInstance: TcxCustomGridTableView); + class procedure UpdateRecord(AInstance: TcxCustomGridTableView); + end; + + { TcxCustomGridTableViewInfoAccess } + + TcxCustomGridTableViewInfoAccess = class + public + class function GetDefaultGridModeBufferCount(AInstance: TcxCustomGridTableViewInfo): Integer; + end; + +implementation + +uses +{$IFDEF DELPHI6} + DateUtils, +{$ENDIF} + Math, SysUtils, TypInfo, + Clipbrd, cxScrollBar, cxVariants, cxDateUtils, + cxTextEdit, cxEditUtils, cxFilterDialog, cxFilterControlDialog, + cxEditDataRegisteredRepositoryItems, cxFilterConsts, + cxGrid, cxGridStrs, cxGridLevel, cxLibraryConsts; + +const + RecordIndexNone = -1; + EditStartChars = [#8, ^V, ^X, #32..#255]; + IncSearchStartChars = [#8, #32..#255]; + PullFocusingScrollingTimeInterval = 50; + // Copy to text format + EndOfLine = #13#10; + ColumnSeparator = #9; + + FilterButtonsFirstOffset = 4; + FilterButtonsOffset = 4; + FilterTextOffset = 3; + + DragDropTextAreaOffset = 25; + DragDropTextBorderSize = 3; + DragDropTextIndent = DragDropTextBorderSize + cxGridCellTextOffset; + + ScrollTimeInterval = 35; + + FilterMRUItemBaseName = 'FilterMRUItem'; + + DateTimeRelativeFilters = [dtfRelativeDays..dtfPastFuture]; + DateTimeAbsoluteFilters = [dtfMonths, dtfYears]; + + CustomizationPopupCheckListBoxColumnOffset = 10; + CustomizationPopupCheckListBoxScrollZoneWidth = 15; + CustomizationPopupCheckListBoxScrollTimeInterval = 400; + +type + TControlAccess = class(TControl); + TcxControlAccess = class(TcxControl); + TcxCustomGridAccess = class(TcxCustomGrid); + TcxCustomGridViewAccess = class(TcxCustomGridView); + TcxGridLevelAccess = class(TcxGridLevel); + +function cxCustomGridTableControllerCanFocusItem(AOwner: TcxCustomGridTableView; + AItemIndex: Integer; AData: TObject): Boolean; +begin + Result := AOwner.VisibleItems[AItemIndex].CanFocus(TcxCustomGridRecord(AData)); +end; + +function cxCustomGridTableControllerCanFocusRecord( + AOwner: TcxCustomGridTableView; AItemIndex: Integer; + AData: TObject): Boolean; +begin + Result := AOwner.ViewData.Records[AItemIndex].CanFocus; +end; + +function cxCustomGridTableViewGetItem(ACaller: TComponent; + Index: Integer): TComponent; +begin + Result := TcxCustomGridTableView(ACaller).Items[Index]; +end; + +{ TcxGridDataChange } + +procedure TcxGridDataChange.Execute; +begin + with GridView as TcxCustomGridTableView do + begin + RecordCountChanged; + //Controller.MakeFocusedRecordVisible; removed because of group nodes expanding + end; +end; + +function TcxGridDataChange.IsLockable: Boolean; +begin + Result := False; +end; + +{ TcxGridRecordChange } + +constructor TcxGridRecordChange.Create(AGridView: TcxCustomGridView; + ARecord: TcxCustomGridRecord; ARecordIndex: Integer; AItem: TcxCustomGridTableItem = nil); +begin + inherited Create(AGridView); + FRecord := ARecord; + FRecordIndex := ARecordIndex; + FItem := AItem; +end; + +function TcxGridRecordChange.GetGridView: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited GridView); +end; + +function TcxGridRecordChange.GetRecordViewInfo: TcxCustomGridRecordViewInfo; +begin + Result := GridView.ViewInfo.RecordsViewInfo.GetRealItem(FRecord); +end; + +procedure TcxGridRecordChange.Execute; +begin + if (RecordViewInfo = nil) or (FItem <> nil) and not IsItemVisible or + not GridView.Changeable then Exit; + RecordViewInfo.Recalculate; + GridView.ViewChanged(RecordViewInfo.GetBoundsForInvalidate(FItem)); +end; + +function TcxGridRecordChange.IsCompatibleWith(AChange: TcxCustomGridChange): Boolean; +begin + Result := inherited IsCompatibleWith(AChange) or + ((AChange is TcxGridLayoutChange) or (AChange is TcxGridSizeChange) or (AChange is TcxGridDataChange)) and + (TcxCustomGridViewChange(AChange).GridView <> nil) and (TcxCustomGridViewChange(AChange).GridView = GridView); +end; + +function TcxGridRecordChange.IsEqual(AChange: TcxCustomGridChange): Boolean; +begin + Result := inherited IsEqual(AChange) and + (GridRecord = TcxGridRecordChange(AChange).GridRecord) and + (RecordIndex = TcxGridRecordChange(AChange).RecordIndex) and + (Item = TcxGridRecordChange(AChange).Item); +end; + +function TcxGridRecordChange.IsItemVisible: Boolean; +begin + Result := (GridView.IndexOfItem(FItem) <> -1) and FItem.ActuallyVisible; +end; + +{ TcxGridFocusedRecordChange } + +constructor TcxGridFocusedRecordChange.Create(AGridView: TcxCustomGridView; + APrevFocusedRecordIndex, AFocusedRecordIndex: Integer; ANewItemRecordFocusingChanged: Boolean); +begin + inherited Create(AGridView); + FPrevFocusedRecordIndex := APrevFocusedRecordIndex; + FFocusedRecordIndex := AFocusedRecordIndex; + FNewItemRecordFocusingChanged := ANewItemRecordFocusingChanged; +end; + +function TcxGridFocusedRecordChange.CanExecuteWhenLocked: Boolean; +begin + Result := False; +end; + +procedure TcxGridFocusedRecordChange.Execute; +begin + with GridView as TcxCustomGridTableView do + //if Changeable then - should work with Visible = False (to show details) + begin + if DataController.IsGridMode then Controller.UpdateScrollBars; + if (FFocusedRecordIndex <> FPrevFocusedRecordIndex) or FNewItemRecordFocusingChanged then + Controller.MakeFocusedRecordVisible; + if IsRecordHeightDependsOnFocus then + SizeChanged + else + with ViewData do + begin + if IsRecordIndexValid(FPrevFocusedRecordIndex) then + Records[FPrevFocusedRecordIndex].Invalidate; + if IsRecordIndexValid(FFocusedRecordIndex) then + Records[FFocusedRecordIndex].Invalidate; + if FNewItemRecordFocusingChanged and HasNewItemRecord then + NewItemRecord.Invalidate; + end; + Controller.CheckEdit; + Controller.EditingController.UpdateEditValue; + DoFocusedRecordChanged(FPrevFocusedRecordIndex, FFocusedRecordIndex, + FNewItemRecordFocusingChanged); // see 23172 + end; +end; + +{ TcxGridFilterHitTest } + +class function TcxGridFilterHitTest.GetHitTestCode: Integer; +begin + Result := htFilter; +end; + +{ TcxGridFilterCloseButtonHitTest } + +class function TcxGridFilterCloseButtonHitTest.GetHitTestCode: Integer; +begin + Result := htFilterCloseButton; +end; + +{ TcxGridFilterActivateButtonHitTest } + +class function TcxGridFilterActivateButtonHitTest.GetHitTestCode: Integer; +begin + Result := htFilterActivateButton; +end; + +{ TcxGridFilterDropDownButtonHitTest } + +class function TcxGridFilterDropDownButtonHitTest.GetHitTestCode: Integer; +begin + Result := htFilterDropDownButton; +end; + +{ TcxGridFilterCustomizeButtonHitTest } + +class function TcxGridFilterCustomizeButtonHitTest.GetHitTestCode: Integer; +begin + Result := htFilterCustomizeButton; +end; + +{ TcxGridRecordHitTest } + +function TcxGridRecordHitTest.GetGridRecord: TcxCustomGridRecord; +begin + if FViewData = nil then + Result := nil + else + Result := FViewData.GetRecordByKind(FGridRecordKind, FGridRecordIndex); +end; + +procedure TcxGridRecordHitTest.SetGridRecord(Value: TcxCustomGridRecord); +begin + if Value <> nil then + begin + FViewData := Value.ViewData; + FGridRecordIndex := Value.Index; + FGridRecordKind := FViewData.GetRecordKind(Value); + end + else + begin + FViewData := nil; + FGridRecordIndex := -1; + FGridRecordKind := rkNone; + end; +end; + +class function TcxGridRecordHitTest.GetHitTestCode: Integer; +begin + Result := htRecord; +end; + +class function TcxGridRecordHitTest.CanClick: Boolean; +begin + Result := True; +end; + +{ TcxGridRecordCellHitTest } + +class function TcxGridRecordCellHitTest.GetHitTestCode: Integer; +begin + Result := htCell; +end; + +{ TcxGridExpandButtonHitTest } + +class function TcxGridExpandButtonHitTest.GetHitTestCode: Integer; +begin + Result := htExpandButton; +end; + +class function TcxGridExpandButtonHitTest.CanClick: Boolean; +begin + Result := False; +end; + +{ TcxGridDefaultValuesProvider } + +function TcxGridDefaultValuesProvider.IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean; +begin + Result := TcxGridItemDataBinding(Owner).IsDisplayFormatDefined(AIsCurrencyValueAccepted); +end; + +{ TcxGridDataController } + +function TcxGridDataController.GetGridViewValue: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(GetGridView); +end; + +procedure TcxGridDataController.ReadData(Stream: TStream); +var + ASize: Integer; +begin + Stream.Read(ASize, SizeOf(ASize)); + FLoadedData := TMemoryStream.Create; + FLoadedData.CopyFrom(Stream, ASize); + FLoadedData.Position := 0; +end; + +procedure TcxGridDataController.WriteData(Stream: TStream); +var + AStream: TMemoryStream; + ASize: Integer; +begin + AStream := TMemoryStream.Create; + try + SaveToStream(AStream); + ASize := AStream.Size; + Stream.Write(ASize, SizeOf(ASize)); + AStream.SaveToStream(Stream); + finally + AStream.Free; + end; +end; + +procedure TcxGridDataController.AssignData(ADataController: TcxCustomDataController); +var + AStream: TMemoryStream; +begin + AStream := TMemoryStream.Create; + try + ADataController.SaveToStream(AStream); + AStream.Position := 0; + LoadFromStream(AStream); + finally + AStream.Free; + end; +end; + +procedure TcxGridDataController.CreateAllItems(AMissingItemsOnly: Boolean); +begin +end; + +procedure TcxGridDataController.DeleteAllItems; +begin +end; + +procedure TcxGridDataController.GetFakeComponentLinks(AList: TList); +begin +end; + +function TcxGridDataController.GetGridView: TcxCustomGridView; +begin + Result := TcxCustomGridView(GetOwner); +end; + +function TcxGridDataController.HasAllItems: Boolean; +begin + Result := True; +end; + +function TcxGridDataController.IsDataChangeable: Boolean; +begin + Result := True; +end; + +function TcxGridDataController.IsDataLinked: Boolean; +begin + Result := True; +end; + +function TcxGridDataController.SupportsCreateAllItems: Boolean; +begin + Result := False; +end; + +procedure TcxGridDataController.CheckGridModeBufferCount; +begin +end; + +function TcxGridDataController.DoScroll(AForward: Boolean): Boolean; +begin + Result := False; +end; + +function TcxGridDataController.DoScrollPage(AForward: Boolean): Boolean; +begin + Result := False; +end; + +{function TcxGridDataController.GetFilterPropertyValue(const AName: string; + var AValue: Variant): Boolean; +begin + Result := False; +end;} + +function TcxGridDataController.GetItemDataBindingClass: TcxGridItemDataBindingClass; +begin + Result := TcxGridItemDataBinding; +end; + +function TcxGridDataController.GetItemDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; +begin + Result := TcxGridDefaultValuesProvider; +end; + +function TcxGridDataController.GetNavigatorIsBof: Boolean; +begin + Result := GridView.Controller.IsStart; +end; + +function TcxGridDataController.GetNavigatorIsEof: Boolean; +begin + Result := GridView.Controller.IsFinish; +end; + +function TcxGridDataController.GetScrollBarPos: Integer; +begin + Result := -1; +end; + +function TcxGridDataController.GetScrollBarRecordCount: Integer; +begin + Result := -1; +end; + +{function TcxGridDataController.SetFilterPropertyValue(const AName: string; + const AValue: Variant): Boolean; +begin + Result := False; +end;} + +function TcxGridDataController.SetScrollBarPos(Value: Integer): Boolean; +begin + Result := False; +end; + +function TcxGridDataController.CanSelectRow(ARowIndex: Integer): Boolean; +begin + Result := GridView.CanSelectRecord(ARowIndex); +end; + +function TcxGridDataController.CompareByField(ARecordIndex1, ARecordIndex2: Integer; + AField: TcxCustomDataField; AMode: TcxDataControllerComparisonMode): Integer; +begin + if GridView.ViewData.NeedsCustomDataComparison(AField, AMode) then + Result := GridView.ViewData.CustomCompareDataValues(AField, + GetComparedValue(ARecordIndex1, AField), GetComparedValue(ARecordIndex2, AField), AMode) + else + Result := inherited CompareByField(ARecordIndex1, ARecordIndex2, AField, AMode); +end; + +procedure TcxGridDataController.DefineProperties(Filer: TFiler); +begin + inherited; + if not IsProviderMode then + Filer.DefineBinaryProperty('Data', ReadData, WriteData, RecordCount <> 0); +end; + +procedure TcxGridDataController.DoValueTypeClassChanged(AItemIndex: Integer); +begin + inherited; + GridView.ItemValueTypeClassChanged(AItemIndex); +end; + +procedure TcxGridDataController.FilterChanged; +begin + inherited; + GridView.FilterChanged; +end; + +function TcxGridDataController.GetDefaultActiveRelationIndex: Integer; +begin + Result := GridView.GetDefaultActiveDetailIndex; +end; + +function TcxGridDataController.GetFilterDisplayText(ARecordIndex, AItemIndex: Integer): string; +begin + if GridView.ViewData.HasCustomDataHandling(Fields[AItemIndex], doFiltering) then + Result := GridView.ViewData.GetCustomDataDisplayText(ARecordIndex, AItemIndex, doFiltering) + else + Result := inherited GetFilterDisplayText(ARecordIndex, AItemIndex); +end; + +{function TcxGridDataController.GetIncrementalSearchText(ARecordIndex, AItemIndex: Integer): string; +begin + if not GridView.GetDisplayText(ARecordIndex, AItemIndex, Result) then + Result := inherited GetIncrementalSearchText(ARecordIndex, AItemIndex); +end;} + +function TcxGridDataController.GetItemID(AItem: TObject): Integer; +begin + if AItem is TcxCustomGridTableItem then + Result := TcxCustomGridTableItem(AItem).ID + else + Result := -1; +end; + +function TcxGridDataController.GetSortingBySummaryEngineClass: TcxSortingBySummaryEngineClass; +begin + Result := GridView.ViewData.GetSortingBySummaryEngineClass; +end; + +function TcxGridDataController.GetSummaryGroupItemLinkClass: TcxDataSummaryGroupItemLinkClass; +begin + Result := GridView.GetSummaryGroupItemLinkClass; + if Result = nil then + Result := inherited GetSummaryGroupItemLinkClass; +end; + +function TcxGridDataController.GetSummaryItemClass: TcxDataSummaryItemClass; +begin + Result := GridView.GetSummaryItemClass; + if Result = nil then + Result := inherited GetSummaryItemClass; +end; + +procedure TcxGridDataController.BeginFullUpdate; +begin + GridView.BeginUpdate; + inherited; +end; + +procedure TcxGridDataController.EndFullUpdate; +begin + inherited; + GridView.EndUpdate; +end; + +function TcxGridDataController.CreateDetailLinkObject(ARelation: TcxCustomDataRelation; + ARecordIndex: Integer): TObject; +begin + Result := TcxGridLevelAccess(ARelation.Item).CreateLinkObject(ARelation, ARecordIndex); +end; + +procedure TcxGridDataController.FocusControl(AItemIndex: Integer; var Done: Boolean); +begin + inherited; + GridView.FocusEdit(AItemIndex, Done); +end; + +function TcxGridDataController.GetDetailDataControllerByLinkObject(ALinkObject: TObject): TcxCustomDataController; +begin + Result := TcxCustomGridView(ALinkObject).DataController; +end; + +function TcxGridDataController.GetDisplayText(ARecordIndex, AItemIndex: Integer): string; +begin + if not GridView.ViewData.GetDisplayText(ARecordIndex, AItemIndex, Result) then + Result := inherited GetDisplayText(ARecordIndex, AItemIndex); + GridView.Items[AItemIndex].DoGetDataText(ARecordIndex, Result); +end; + +function TcxGridDataController.GetFilterDataValue(ARecordIndex: Integer; AField: TcxCustomDataField): Variant; +begin + Result := inherited GetFilterDataValue(ARecordIndex, AField); + if GridView.ViewData.HasCustomDataHandling(AField, doFiltering) then + Result := GridView.ViewData.GetCustomDataValue(AField, Result, doFiltering); +end; + +function TcxGridDataController.GetFilterItemFieldCaption(AItem: TObject): string; +begin + Result := TcxCustomGridTableItem(AItem).FilterCaption; +end; + +function TcxGridDataController.GetItem(Index: Integer): TObject; +begin + Result := GridView.Items[Index]; +end; + +function TcxGridDataController.GetItemSortByDisplayText(AItemIndex: Integer; + ASortByDisplayText: Boolean): Boolean; +begin + Result := GridView.GetItemSortByDisplayText(AItemIndex, ASortByDisplayText); +end; + +function TcxGridDataController.GetItemValueSource(AItemIndex: Integer): TcxDataEditValueSource; +begin + Result := GridView.GetItemValueSource(AItemIndex); +end; + +procedure TcxGridDataController.Loaded; +begin + inherited; + if FLoadedData <> nil then + try + LoadFromStream(FLoadedData); + finally + FLoadedData.Free; + end; +end; + +procedure TcxGridDataController.UpdateData; +begin + inherited; + GridView.UpdateRecord; +end; + +{ TcxGridFilterValueList } + +procedure TcxGridFilterValueList.AddDateTimeAbsoluteFilters(ADateRange: TcxCustomGridDateRange; + AIgnoreTime: Boolean); +var + I: Integer; + ADateTime: TDateTime; + ADateRangeValue: Variant; +begin + I := GetStartValueIndex; + while I < Count do + begin + ADateTime := Items[I].Value; + if ADateRange.Contains(ADateTime) then + begin + ADateRangeValue := ADateRange.GetRangeValue(ADateTime, AIgnoreTime); + if FindItemByKind(fviSpecial, ADateRangeValue) = -1 then + begin + Add(fviSpecial, ADateRangeValue, ADateRange.GetDisplayText(ADateTime), True); + Inc(I); + end; + end; + Inc(I); + end; +end; + +procedure TcxGridFilterValueList.AddDateTimeAbsoluteFilters(AItem: TcxCustomGridTableItem); +var + I: Integer; +begin + AItem.InitFilteringDateRanges; + for I := 0 to AItem.FilteringDateRanges.Count - 1 do + AddDateTimeAbsoluteFilters(AItem.FilteringDateRanges[I], AItem.CanIgnoreTimeForFiltering); +end; + +procedure TcxGridFilterValueList.AddDateTimeRelativeFilters(AItem: TcxCustomGridTableItem); +var + AFilters: TcxGridDateTimeFilters; + AFilter: TcxGridDateTimeFilter; +begin + AFilters := AItem.GetDateTimeFilters; + for AFilter := Low(AFilter) to High(AFilter) do + if AFilter in AFilters then + case AFilter of + dtfRelativeDays: + begin + Add(fviSpecial, foYesterday, cxGetResourceString(@scxGridYesterday), True); + Add(fviSpecial, foToday, cxGetResourceString(@scxGridToday), True); + Add(fviSpecial, foTomorrow, cxGetResourceString(@scxGridTomorrow), True); + end; + dtfRelativeDayPeriods: + begin + Add(fviSpecial, foLast30Days, cxGetResourceString(@scxGridLast30Days), True); + Add(fviSpecial, foLast14Days, cxGetResourceString(@scxGridLast14Days), True); + Add(fviSpecial, foLast7Days, cxGetResourceString(@scxGridLast7Days), True); + Add(fviSpecial, foNext7Days, cxGetResourceString(@scxGridNext7Days), True); + Add(fviSpecial, foNext14Days, cxGetResourceString(@scxGridNext14Days), True); + Add(fviSpecial, foNext30Days, cxGetResourceString(@scxGridNext30Days), True); + end; + dtfRelativeWeeks: + begin + Add(fviSpecial, foLastTwoWeeks, cxGetResourceString(@scxGridLastTwoWeeks), True); + Add(fviSpecial, foLastWeek, cxGetResourceString(@scxGridLastWeek), True); + Add(fviSpecial, foThisWeek, cxGetResourceString(@scxGridThisWeek), True); + Add(fviSpecial, foNextWeek, cxGetResourceString(@scxGridNextWeek), True); + Add(fviSpecial, foNextTwoWeeks, cxGetResourceString(@scxGridNextTwoWeeks), True); + end; + dtfRelativeMonths: + begin + Add(fviSpecial, foLastMonth, cxGetResourceString(@scxGridLastMonth), True); + Add(fviSpecial, foThisMonth, cxGetResourceString(@scxGridThisMonth), True); + Add(fviSpecial, foNextMonth, cxGetResourceString(@scxGridNextMonth), True); + end; + dtfRelativeYears: + begin + Add(fviSpecial, foLastYear, cxGetResourceString(@scxGridLastYear), True); + Add(fviSpecial, foThisYear, cxGetResourceString(@scxGridThisYear), True); + Add(fviSpecial, foNextYear, cxGetResourceString(@scxGridNextYear), True); + end; + dtfPastFuture: + begin + Add(fviSpecial, foInPast, cxGetResourceString(@scxGridPast), True); + Add(fviSpecial, foInFuture, cxGetResourceString(@scxGridFuture), True); + end; + end; + (* !!! + if dtfRelativeDay in AFilterItems then + begin + Add(fviSpecial, foYesterday, cxGetResourceString(@scxGridYesterday), True); + Add(fviSpecial, foToday, cxGetResourceString(@scxGridToday), True); + Add(fviSpecial, foTomorrow, cxGetResourceString(@scxGridTomorrow), True); + end; + if dtfRelativeWeek in AFilterItems then + Add(fviSpecial, foLastWeek, cxGetResourceString(@scxGridLastWeek), True); + if dtfRelativeMonth in AFilterItems then + Add(fviSpecial, foLastMonth, cxGetResourceString(@scxGridLastMonth), True); + if dtfRelativeYear in AFilterItems then + Add(fviSpecial, foLastYear, cxGetResourceString(@scxGridLastYear), True); + if dtfRelativeWeek in AFilterItems then + Add(fviSpecial, foThisWeek, cxGetResourceString(@scxGridThisWeek), True); + if dtfRelativeMonth in AFilterItems then + Add(fviSpecial, foThisMonth, cxGetResourceString(@scxGridThisMonth), True); + if dtfRelativeYear in AFilterItems then + Add(fviSpecial, foThisYear, cxGetResourceString(@scxGridThisYear), True); + if dtfRelativeWeek in AFilterItems then + Add(fviSpecial, foNextWeek, cxGetResourceString(@scxGridNextWeek), True); + if dtfRelativeMonth in AFilterItems then + Add(fviSpecial, foNextMonth, cxGetResourceString(@scxGridNextMonth), True); + if dtfRelativeYear in AFilterItems then + Add(fviSpecial, foNextYear, cxGetResourceString(@scxGridNextYear), True); + *) + Add(fviMRUSeparator, Null, '', True); +end; + +function TcxGridFilterValueList.SupportedSpecialOperatorKinds: TcxFilterOperatorKinds; +begin + Result := [foYesterday..foInFuture]; +end; + +procedure TcxGridFilterValueList.ApplyFilter(AItem: TcxCustomGridTableItem; AIndex: Integer; + AFilterList: TcxFilterCriteriaItemList; AReplaceExistent, AAddToMRUItemsList: Boolean); + + function GetVarArrayDisplayText(const AValue: Variant): string; + begin + Result := + AItem.GetProperties.GetDisplayText(AValue[0], True, False) + ';' + + AItem.GetProperties.GetDisplayText(AValue[1], True, False); + end; + +var + AListItem: PcxFilterValueItem; +begin + AItem.DataBinding.Filter.BeginUpdate; + try + AListItem := Items[AIndex]; + case AListItem.Kind of + fviAll: + AItem.Filtered := False; + fviCustom: + AItem.GridView.Filtering.RunCustomizeDialog(AItem); + fviBlanks: + AItem.DataBinding.AddToFilter(AFilterList, foEqual, AListItem.Value, + cxGetResourceString(@cxSFilterBlankCaption), AReplaceExistent); + fviNonBlanks: + AItem.DataBinding.AddToFilter(AFilterList, foNotEqual, AListItem.Value, + cxGetResourceString(@cxSFilterBlankCaption), AReplaceExistent); + fviUser: + AItem.DoUserFiltering(AListItem.Value, AListItem.DisplayText); + fviValue, fviMRU: + begin + AItem.DataBinding.AddToFilter(AFilterList, foEqual, AListItem.Value, + AListItem.DisplayText, AReplaceExistent); + if AAddToMRUItemsList then + AItem.DataBinding.FilterMRUValueItems.Add(AListItem.Value, AListItem.DisplayText); + end; + fviSpecial: + if VarIsArray(AListItem.Value) then + AItem.DataBinding.AddToFilter(AFilterList, foBetween, AListItem.Value, + GetVarArrayDisplayText(AListItem.Value), AReplaceExistent) + else + if TcxFilterOperatorKind(AListItem.Value) in SupportedSpecialOperatorKinds then + AItem.DataBinding.AddToFilter(AFilterList, TcxFilterOperatorKind(AListItem.Value), + Null, '', AReplaceExistent); + end; + if not (AListItem.Kind in [fviAll, fviCustom]) then + AItem.DataBinding.Filter.Active := True; + finally + AItem.DataBinding.Filter.EndUpdate; + end; +end; + +function TcxGridFilterValueList.GetIndexByCriteriaItem(ACriteriaItem: TcxFilterCriteriaItem): Integer; +begin + Result := -1; + if ACriteriaItem <> nil then + if ACriteriaItem.OperatorKind in SupportedSpecialOperatorKinds then + Result := FindItemByKind(fviSpecial, ACriteriaItem.OperatorKind) + else + if ACriteriaItem.OperatorKind = foBetween then + Result := FindItemByKind(fviSpecial, ACriteriaItem.Value); + if Result = -1 then + Result := inherited GetIndexByCriteriaItem(ACriteriaItem); +end; + +procedure TcxGridFilterValueList.Load(AItem: TcxCustomGridTableItem; + AInitSortByDisplayText, AUseFilteredValues: Boolean); +begin + inherited Load(AItem.Index, AInitSortByDisplayText, AUseFilteredValues); + if AItem.SupportsDateTimeFilters(True) then + AddDateTimeRelativeFilters(AItem); + if AItem.SupportsDateTimeFilters(False) then + AddDateTimeAbsoluteFilters(AItem); +end; + +{ TcxGridFilterMRUValueItem } + +constructor TcxGridFilterMRUValueItem.Create(const AValue: Variant; const ADisplayText: string); +begin + inherited Create; + Value := AValue; + DisplayText := ADisplayText; +end; + +function TcxGridFilterMRUValueItem.Equals(AItem: TcxMRUItem): Boolean; +begin + Result := VarCompare(Value, TcxGridFilterMRUValueItem(AItem).Value) = 0; +end; + +{ TcxGridFilterMRUValueItems } + +function TcxGridFilterMRUValueItems.GetItem(Index: Integer): TcxGridFilterMRUValueItem; +begin + Result := TcxGridFilterMRUValueItem(inherited Items[Index]); +end; + +procedure TcxGridFilterMRUValueItems.Add(const AValue: Variant; const ADisplayText: string); +begin + inherited Add(TcxGridFilterMRUValueItem.Create(AValue, ADisplayText)); +end; + +procedure TcxGridFilterMRUValueItems.AddItemsTo(AValueList: TcxGridFilterValueList); +var + I: Integer; +begin + for I := 0 to Count - 1 do + with Items[I] do + AValueList.Add(fviMRU, Value, DisplayText, True); +end; + +{ TcxGridItemDataBinding } + +constructor TcxGridItemDataBinding.Create(AItem: TcxCustomGridTableItem); +begin + inherited Create; + FItem := AItem; + FDefaultValuesProvider := GetDefaultValuesProviderClass.Create(Self); + FFilterMRUValueItems := GetFilterMRUValueItemsClass.Create; + FFilterMRUValueItems.MaxCount := GridView.Filtering.ItemMRUItemsListCount; +end; + +destructor TcxGridItemDataBinding.Destroy; +begin + FFilterMRUValueItems.Free; + FDefaultValuesProvider.Free; + inherited; +end; + +function TcxGridItemDataBinding.GetDataController: TcxCustomDataController; +begin + Result := GridView.DataController; +end; + +function TcxGridItemDataBinding.GetFilter: TcxDataFilterCriteria; +begin + Result := DataController.Filter; +end; + +function TcxGridItemDataBinding.GetFilterCriteriaItem: TcxFilterCriteriaItem; +begin + Result := Filter.FindItemByItemLink(FItem); +end; + +function TcxGridItemDataBinding.GetFiltered: Boolean; +begin + Result := FilterCriteriaItem <> nil; +end; + +function TcxGridItemDataBinding.GetGridView: TcxCustomGridTableView; +begin + Result := FItem.GridView; +end; + +function TcxGridItemDataBinding.GetValueType: string; +begin + if ValueTypeClass = nil then + Result := '' + else + Result := ValueTypeClass.Caption; +end; + +function TcxGridItemDataBinding.GetValueTypeClass: TcxValueTypeClass; +begin + Result := DataController.GetItemValueTypeClass(FItem.Index); +end; + +procedure TcxGridItemDataBinding.SetData(Value: TObject); +begin + if FData <> Value then + begin + FData := Value; + FItem.Changed(ticProperty); + end; +end; + +procedure TcxGridItemDataBinding.SetFiltered(Value: Boolean); +begin + if Filtered <> Value then + if not Value then + Filter.RemoveItemByItemLink(FItem); +end; + +procedure TcxGridItemDataBinding.SetValueType(const Value: string); +begin + if ValueType <> Value then + ValueTypeClass := cxValueTypeClassList.ItemByCaption(Value); +end; + +procedure TcxGridItemDataBinding.SetValueTypeClass(Value: TcxValueTypeClass); +begin + DataController.ChangeValueTypeClass(FItem.Index, Value); +end; + +function TcxGridItemDataBinding.GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; +var + AIcxGridDataController: IcxGridDataController; +begin + if Supports(TObject(DataController), IcxGridDataController, AIcxGridDataController) then + Result := AIcxGridDataController.GetItemDefaultValuesProviderClass + else + Result := nil; +end; + +function TcxGridItemDataBinding.GetDefaultValueTypeClass: TcxValueTypeClass; +begin + Result := TcxStringValueType; +end; + +function TcxGridItemDataBinding.GetFilterFieldName: string; +begin + Result := ''; +end; + +function TcxGridItemDataBinding.GetFilterMRUValueItemsClass: TcxGridFilterMRUValueItemsClass; +begin + Result := TcxGridFilterMRUValueItems; +end; + +procedure TcxGridItemDataBinding.Init; +begin +end; + +function TcxGridItemDataBinding.IsValueTypeStored: Boolean; +begin + Result := ValueTypeClass <> GetDefaultValueTypeClass; +end; + +procedure TcxGridItemDataBinding.Assign(Source: TPersistent); +begin + if Source is TcxGridItemDataBinding then + with TcxGridItemDataBinding(Source) do + begin + Self.Data := Data; + Self.ValueTypeClass := ValueTypeClass; + end + else + inherited; +end; + +function TcxGridItemDataBinding.DefaultCaption: string; +begin + Result := ''{Item.Name}; +end; + +function TcxGridItemDataBinding.DefaultRepositoryItem: TcxEditRepositoryItem; +begin + Result := GetDefaultEditDataRepositoryItems.GetItem(ValueTypeClass); +end; + +function TcxGridItemDataBinding.DefaultWidth(ATakeHeaderIntoAccount: Boolean = True): Integer; +begin + Result := 64; +end; + +function TcxGridItemDataBinding.GetDefaultValuesProvider(AProperties: TcxCustomEditProperties = nil): IcxEditDefaultValuesProvider; +begin + Result := FDefaultValuesProvider; +end; + +function TcxGridItemDataBinding.IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean; +begin + Result := + DataController.IsDisplayFormatDefined(FItem.Index, not AIsCurrencyValueAccepted) or + FItem.HasDataTextHandler; +end; + +function TcxGridItemDataBinding.AddToFilter(AParent: TcxFilterCriteriaItemList; + AOperatorKind: TcxFilterOperatorKind; const AValue: Variant; const ADisplayText: string; + AReplaceExistent: Boolean): TcxFilterCriteriaItem; +begin + Result := GridView.ViewData.AddItemToFilter(AParent, FItem, AOperatorKind, + AValue, ADisplayText, AReplaceExistent); +end; + +procedure TcxGridItemDataBinding.GetFilterDisplayText(const AValue: Variant; + var ADisplayText: string); +begin + FItem.GetFilterDisplayText(AValue, ADisplayText); +end; + +procedure TcxGridItemDataBinding.GetFilterStrings(AStrings: TStrings; + AValueList: TcxGridFilterValueList); +var + I: Integer; + S: string; +begin + GetFilterValues(AValueList, False, True, True); + AStrings.BeginUpdate; + try + AStrings.Clear; + for I := 0 to AValueList.Count - 1 do + begin + S := AValueList[I].DisplayText; + GetFilterDisplayText(AValueList[I].Value, S); + AStrings.AddObject(S, TObject(AValueList[I])); + end; + finally + AStrings.EndUpdate; + end; +end; + +procedure TcxGridItemDataBinding.GetFilterValues(AValueList: TcxGridFilterValueList; + AValuesOnly: Boolean = True; AInitSortByDisplayText: Boolean = False; + ACanUseFilteredValues: Boolean = False); +var + I: Integer; +begin + AValueList.Load(FItem, AInitSortByDisplayText, + ACanUseFilteredValues and FItem.UseFilteredValuesForFilterValueList); + FItem.DoGetFilterValues(AValueList); + if AValuesOnly then + for I := AValueList.Count - 1 downto 0 do + if AValueList[I].Kind <> fviValue then + AValueList.Delete(I) + else + else + if FItem.CanFilterMRUValueItems then + FFilterMRUValueItems.AddItemsTo(AValueList); +end; + +procedure TcxGridItemDataBinding.GetFilterActiveValueIndexes(AValueList: TcxGridFilterValueList; + var AIndexes: TcxGridIndexes); + + procedure CheckFilterItem(AFilterItem: TcxFilterCriteriaItem); + var + AValueIndex: Integer; + begin + if AFilterItem.ItemLink <> FItem then Exit; + AValueIndex := AValueList.GetIndexByCriteriaItem(AFilterItem); + if (AValueIndex <> -1) and (AValueList[AValueIndex].Kind <> fviCustom) then + begin + SetLength(AIndexes, Length(AIndexes) + 1); + AIndexes[Length(AIndexes) - 1] := AValueIndex; + end; + end; + +var + AFilterItem: TcxFilterCriteriaItem; + AFilterList: TcxFilterCriteriaItemList; + I: Integer; +begin + AIndexes := nil; + AFilterItem := FilterCriteriaItem; + if AFilterItem = nil then Exit; + AFilterList := AFilterItem.Parent; + case AFilterList.BoolOperatorKind of + fboOr: + for I := 0 to AFilterList.Count - 1 do + if AFilterList[I] is TcxFilterCriteriaItem then + CheckFilterItem(TcxFilterCriteriaItem(AFilterList[I])); + fboAnd: + CheckFilterItem(AFilterItem); + end; +end; + +procedure TcxGridItemDataBinding.SetFilterActiveValueIndexes(AValueList: TcxGridFilterValueList; + const AIndexes: TcxGridIndexes); + + function GetFilterList: TcxFilterCriteriaItemList; + begin + if (Filter.Root.BoolOperatorKind = fboOr) or + (Filter.Root.BoolOperatorKind = fboAnd) and (Length(AIndexes) = 1) then + Result := Filter.Root + else + Result := Filter.Root.AddItemList(fboOr); + end; + +var + AFilterList: TcxFilterCriteriaItemList; + I: Integer; +begin + Filter.BeginUpdate; + try + Filter.RemoveItemByItemLink(FItem); + if Length(AIndexes) <> 0 then + begin + AFilterList := GetFilterList; + for I := 0 to Length(AIndexes) - 1 do + AValueList.ApplyFilter(Item, AIndexes[I], AFilterList, False, False); + end; + finally + Filter.EndUpdate; + end; +end; + +{ TcxCustomGridDateRange } + +destructor TcxCustomGridDateRange.Destroy; +begin + if FContainer <> nil then + FContainer.RemoveItem(Self); + inherited; +end; + +function TcxCustomGridDateRange.GetIndex: Integer; +begin + if FContainer = nil then + Result := -1 + else + Result := FContainer.GetItemIndex(Self); +end; + +procedure TcxCustomGridDateRange.SetIndex(Value: Integer); +begin + if FContainer <> nil then + FContainer.SetItemIndex(Self, Value); +end; + +function TcxCustomGridDateRange.GetRangeValue(const ADate: TDateTime; AIgnoreTime: Boolean): Variant; +begin + Result := GetValue(ADate); +end; + +function TcxCustomGridDateRange.GetSortingValue(const ADate: TDateTime): Variant; +begin + if NeedsSortingByTime then + Result := TimeOf(ADate) + else + Result := GetValue(ADate); +end; + +function TcxCustomGridDateRange.NeedsSortingByTime: Boolean; +begin + Result := False; +end; + +function TcxCustomGridDateRange.NeedsTime: Boolean; +begin + Result := NeedsSortingByTime; +end; + +{ TcxGridHourRange } + +function TcxGridHourRange.Contains(const ADate: TDateTime): Boolean; +begin + Result := True; +end; + +function TcxGridHourRange.GetDisplayText(const ADate: TDateTime): string; +begin + if Container.DateTimeHandling.GetHourFormat = '' then + Result := '' + else + Result := FormatDateTime(Container.DateTimeHandling.GetHourFormat, GetValue(ADate)); +end; + +function TcxGridHourRange.GetValue(const ADate: TDateTime): Variant; +begin + Result := EncodeTime(HourOf(ADate), 0, 0, 0); +end; + +function TcxGridHourRange.NeedsSortingByTime: Boolean; +begin + Result := True; +end; + +{ TcxGridDayRange } + +function TcxGridDayRange.Contains(const ADate: TDateTime): Boolean; +begin + Result := True; +end; + +function TcxGridDayRange.GetDisplayText(const ADate: TDateTime): string; +begin + if Container.DateTimeHandling.GetDateFormat = '' then + Result := '' + else + Result := FormatDateTime(Container.DateTimeHandling.GetDateFormat, ADate); +end; + +function TcxGridDayRange.GetValue(const ADate: TDateTime): Variant; +begin + Result := ADate; +end; + +{ TcxGridMonthRange } + +function TcxGridMonthRange.Contains(const ADate: TDateTime): Boolean; +begin + Result := True; +end; + +function TcxGridMonthRange.GetDisplayText(const ADate: TDateTime): string; +begin + Result := FormatDateTime(Container.DateTimeHandling.GetMonthFormat, ADate); +end; + +function TcxGridMonthRange.GetRangeValue(const ADate: TDateTime; AIgnoreTime: Boolean): Variant; +begin + Result := VarBetweenArrayCreate(GetStartDateOfMonth(ADate), GetEndDateOfMonth(ADate, AIgnoreTime)); +end; + +function TcxGridMonthRange.GetValue(const ADate: TDateTime): Variant; +begin + Result := GetStartDateOfMonth(ADate); +end; + +{ TcxGridYearRange } + +function TcxGridYearRange.Contains(const ADate: TDateTime): Boolean; +begin + Result := True; +end; + +function TcxGridYearRange.GetDisplayText(const ADate: TDateTime): string; +begin + Result := FormatDateTime(Container.DateTimeHandling.GetYearFormat, ADate); +end; + +function TcxGridYearRange.GetRangeValue(const ADate: TDateTime; AIgnoreTime: Boolean): Variant; +begin + Result := VarBetweenArrayCreate(GetStartDateOfYear(ADate), GetEndDateOfYear(ADate, AIgnoreTime)); +end; + +function TcxGridYearRange.GetValue(const ADate: TDateTime): Variant; +begin + Result := GetStartDateOfYear(ADate); +end; + +{ TcxGridYesterdayRange } + +function TcxGridYesterdayRange.Contains(const ADate: TDateTime): Boolean; +begin + Result := ADate = Container.Today - 1; +end; + +function TcxGridYesterdayRange.GetDisplayText(const ADate: TDateTime): string; +begin + Result := cxGetResourceString(@scxGridYesterday); +end; + +function TcxGridYesterdayRange.GetValue(const ADate: TDateTime): Variant; +begin + Result := ADate; +end; + +{ TcxGridTodayRange } + +function TcxGridTodayRange.Contains(const ADate: TDateTime): Boolean; +begin + Result := ADate = Container.Today; +end; + +function TcxGridTodayRange.GetDisplayText(const ADate: TDateTime): string; +begin + Result := cxGetResourceString(@scxGridToday); +end; + +function TcxGridTodayRange.GetValue(const ADate: TDateTime): Variant; +begin + Result := ADate; +end; + +{ TcxGridTomorrowRange } + +function TcxGridTomorrowRange.Contains(const ADate: TDateTime): Boolean; +begin + Result := ADate = Container.Today + 1; +end; + +function TcxGridTomorrowRange.GetDisplayText(const ADate: TDateTime): string; +begin + Result := cxGetResourceString(@scxGridTomorrow); +end; + +function TcxGridTomorrowRange.GetValue(const ADate: TDateTime): Variant; +begin + Result := ADate; +end; + +{ TcxGridLastWeekRange } + +function TcxGridLastWeekRange.Contains(const ADate: TDateTime): Boolean; +begin + Result := GetStartDateOfWeek(ADate) = Container.StartOfThisWeek - 7; +end; + +function TcxGridLastWeekRange.GetDisplayText(const ADate: TDateTime): string; +begin + Result := cxGetResourceString(@scxGridLastWeek); +end; + +function TcxGridLastWeekRange.GetValue(const ADate: TDateTime): Variant; +begin + Result := GetStartDateOfWeek(ADate) + 0.1; +end; + +{ TcxGridThisWeekRange } + +function TcxGridThisWeekRange.Contains(const ADate: TDateTime): Boolean; +begin + Result := GetStartDateOfWeek(ADate) = Container.StartOfThisWeek; +end; + +function TcxGridThisWeekRange.GetDisplayText(const ADate: TDateTime): string; +begin + Result := cxGetResourceString(@scxGridThisWeek); +end; + +function TcxGridThisWeekRange.GetValue(const ADate: TDateTime): Variant; +begin + Result := GetStartDateOfWeek(ADate) + 0.1; +end; + +{ TcxGridNextWeekRange } + +function TcxGridNextWeekRange.Contains(const ADate: TDateTime): Boolean; +begin + Result := GetStartDateOfWeek(ADate) = Container.StartOfThisWeek + 7; +end; + +function TcxGridNextWeekRange.GetDisplayText(const ADate: TDateTime): string; +begin + Result := cxGetResourceString(@scxGridNextWeek); +end; + +function TcxGridNextWeekRange.GetValue(const ADate: TDateTime): Variant; +begin + Result := GetStartDateOfWeek(ADate) + 0.1; +end; + +{ TcxGridLastMonthRange } + +function TcxGridLastMonthRange.Contains(const ADate: TDateTime): Boolean; +begin + Result := GetMonthNumber(ADate) = Container.ThisMonthNumber - 1; +end; + +function TcxGridLastMonthRange.GetDisplayText(const ADate: TDateTime): string; +begin + Result := cxGetResourceString(@scxGridLastMonth); +end; + +function TcxGridLastMonthRange.GetValue(const ADate: TDateTime): Variant; +begin + Result := GetStartDateOfMonth(ADate) + 0.2; +end; + +{ TcxGridThisMonthRange } + +function TcxGridThisMonthRange.Contains(const ADate: TDateTime): Boolean; +begin + Result := GetMonthNumber(ADate) = Container.ThisMonthNumber; +end; + +function TcxGridThisMonthRange.GetDisplayText(const ADate: TDateTime): string; +begin + Result := cxGetResourceString(@scxGridThisMonth); +end; + +function TcxGridThisMonthRange.GetValue(const ADate: TDateTime): Variant; +begin + Result := GetStartDateOfMonth(ADate) + 0.2; +end; + +{ TcxGridNextMonthRange } + +function TcxGridNextMonthRange.Contains(const ADate: TDateTime): Boolean; +begin + Result := GetMonthNumber(ADate) = Container.ThisMonthNumber + 1; +end; + +function TcxGridNextMonthRange.GetDisplayText(const ADate: TDateTime): string; +begin + Result := cxGetResourceString(@scxGridNextMonth); +end; + +function TcxGridNextMonthRange.GetValue(const ADate: TDateTime): Variant; +begin + Result := GetStartDateOfMonth(ADate) + 0.2; +end; + +{ TcxGridLastYearRange } + +function TcxGridLastYearRange.Contains(const ADate: TDateTime): Boolean; +begin + Result := GetDateElement(ADate, deYear) = Container.ThisYear - 1; +end; + +function TcxGridLastYearRange.GetDisplayText(const ADate: TDateTime): string; +begin + Result := cxGetResourceString(@scxGridLastYear); +end; + +function TcxGridLastYearRange.GetValue(const ADate: TDateTime): Variant; +begin + Result := GetStartDateOfYear(ADate) + 0.3; +end; + +{ TcxGridThisYearRange } + +function TcxGridThisYearRange.Contains(const ADate: TDateTime): Boolean; +begin + Result := GetDateElement(ADate, deYear) = Container.ThisYear; +end; + +function TcxGridThisYearRange.GetDisplayText(const ADate: TDateTime): string; +begin + Result := cxGetResourceString(@scxGridThisYear); +end; + +function TcxGridThisYearRange.GetValue(const ADate: TDateTime): Variant; +begin + Result := GetStartDateOfYear(ADate) + 0.3; +end; + +{ TcxGridNextYearRange } + +function TcxGridNextYearRange.Contains(const ADate: TDateTime): Boolean; +begin + Result := GetDateElement(ADate, deYear) = Container.ThisYear + 1; +end; + +function TcxGridNextYearRange.GetDisplayText(const ADate: TDateTime): string; +begin + Result := cxGetResourceString(@scxGridNextYear); +end; + +function TcxGridNextYearRange.GetValue(const ADate: TDateTime): Variant; +begin + Result := GetStartDateOfYear(ADate) + 0.3; +end; + +{ TcxGridDateRanges } + +constructor TcxGridDateRanges.Create; +begin + inherited Create; + FItems := TList.Create; +end; + +destructor TcxGridDateRanges.Destroy; +begin + Clear; + FItems.Free; + inherited; +end; + +function TcxGridDateRanges.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxGridDateRanges.GetItem(Index: Integer): TcxCustomGridDateRange; +begin + Result := TcxCustomGridDateRange(FItems[Index]); +end; + +procedure TcxGridDateRanges.AddItem(AItem: TcxCustomGridDateRange); +begin + AItem.FContainer := Self; + FItems.Add(AItem); +end; + +procedure TcxGridDateRanges.RemoveItem(AItem: TcxCustomGridDateRange); +begin + FItems.Remove(AItem); + AItem.FContainer := nil; +end; + +function TcxGridDateRanges.GetItemIndex(AItem: TcxCustomGridDateRange): Integer; +begin + Result := FItems.IndexOf(AItem); +end; + +procedure TcxGridDateRanges.SetItemIndex(AItem: TcxCustomGridDateRange; AValue: Integer); +begin + FItems.Move(GetItemIndex(AItem), AValue); +end; + +procedure TcxGridDateRanges.InitConsts; +begin + FToday := Date; + FStartOfThisWeek := GetStartDateOfWeek(Today); + DecodeDate(Today, FThisYear, FThisMonth, FThisDay); + FThisMonthNumber := GetMonthNumber(Today); +end; + +procedure TcxGridDateRanges.Add(ARange: TcxCustomGridDateRange); +begin + AddItem(ARange); +end; + +procedure TcxGridDateRanges.Add(ARangeClass: TcxCustomGridDateRangeClass); +begin + Add(ARangeClass.Create); +end; + +procedure TcxGridDateRanges.Clear; +var + I: Integer; +begin + for I := Count - 1 downto 0 do + Items[I].Free; +end; + +function TcxGridDateRanges.GetRange(const ADate: TDateTime): TcxCustomGridDateRange; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I]; + if Result.Contains(ADate) then Exit; + end; + Result := nil; +end; + +function TcxGridDateRanges.GetRange(ARangeClass: TcxCustomGridDateRangeClass): TcxCustomGridDateRange; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I]; + if Result is ARangeClass then Exit; + end; + Result := nil; +end; + +procedure TcxGridDateRanges.Init(ADateTimeHandling: TcxCustomGridTableDateTimeHandling); +begin + FDateTimeHandling := ADateTimeHandling; + InitConsts; + Clear; +end; + +function TcxGridDateRanges.IsEmpty: Boolean; +begin + Result := Count = 0; +end; + +function TcxGridDateRanges.NeedSortingByTime: Boolean; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I].NeedsSortingByTime; + if Result then Exit; + end; + Result := False; +end; + +function TcxGridDateRanges.NeedTime: Boolean; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I].NeedsTime; + if Result then Exit; + end; + Result := False; +end; + +{ TcxGridFilteringDateRanges } + +procedure TcxGridFilteringDateRanges.Init(ADateTimeHandling: TcxCustomGridTableDateTimeHandling; + ADateTimeFilters: TcxGridDateTimeFilters); +begin + inherited Init(ADateTimeHandling); + if dtfYears in ADateTimeFilters then + Add(TcxGridYearRange); + if dtfMonths in ADateTimeFilters then + Add(TcxGridMonthRange); +end; + +{ TcxGridGroupingDateRanges } + +procedure TcxGridGroupingDateRanges.Init(ADateTimeHandling: TcxCustomGridTableDateTimeHandling; + ADateTimeGrouping: TcxGridDateTimeGrouping); +begin + inherited Init(ADateTimeHandling); + case ADateTimeGrouping of + dtgRelativeToToday: + begin + Add(TcxGridYesterdayRange); + Add(TcxGridTodayRange); + Add(TcxGridTomorrowRange); + + Add(TcxGridLastWeekRange); + Add(TcxGridThisWeekRange); + Add(TcxGridNextWeekRange); + + Add(TcxGridLastMonthRange); + Add(TcxGridThisMonthRange); + Add(TcxGridNextMonthRange); + + Add(TcxGridLastYearRange); + Add(TcxGridThisYearRange); + Add(TcxGridNextYearRange); + end; + dtgByHour: + Add(TcxGridHourRange); + dtgByDate: + Add(TcxGridDayRange); + dtgByMonth: + Add(TcxGridMonthRange); + dtgByYear: + Add(TcxGridYearRange); + end; +end; + +{ TcxCustomGridRecord } + +constructor TcxCustomGridRecord.Create(AViewData: TcxCustomGridTableViewData; + AIndex: Integer; const ARecordInfo: TcxRowInfo); +begin + inherited Create; + FViewData := AViewData; + FIndex := AIndex; + RecordInfo := ARecordInfo; +end; + +destructor TcxCustomGridRecord.Destroy; +begin + //GridView.DoRecordDestroying(Self); + if FViewInfo <> nil then + FViewInfo.FRecord := nil; + inherited; +end; + +function TcxCustomGridRecord.GetController: TcxCustomGridTableController; +begin + Result := GridView.Controller; +end; + +function TcxCustomGridRecord.GetDataController: TcxCustomDataController; +begin + Result := FViewData.DataController; +end; + +function TcxCustomGridRecord.GetDragHighlighted: Boolean; +begin + Result := FViewData.Controller.DragHighlightedRecord = Self; +end; + +function TcxCustomGridRecord.GetFocused: Boolean; +begin + Result := FViewData.Controller.FocusedRecord = Self; +end; + +function TcxCustomGridRecord.GetGridView: TcxCustomGridTableView; +begin + Result := FViewData.GridView; +end; + +function TcxCustomGridRecord.GetIsEditing: Boolean; +begin + Result := FViewData.EditingRecord = Self; +end; + +function TcxCustomGridRecord.GetIsNewItemRecord: Boolean; +begin + Result := FViewData.NewItemRecord = Self; +end; + +function TcxCustomGridRecord.GetIsValid: Boolean; +begin + Result := (0 <= RecordIndex) and (RecordIndex < ViewData.DataController.RecordCount); +end; + +function TcxCustomGridRecord.GetLastParentRecordCount: Integer; +begin + if Level = 0 then + Result := 0 + else + for Result := 0 to Level - 1 do + if not IsParentRecordLast[Result] then Break; +end; + +function TcxCustomGridRecord.GetLevel: Integer; +begin + Result := RecordInfo.Level; +end; + +function TcxCustomGridRecord.GetPartVisible: Boolean; +begin + Result := FViewInfo <> nil; +end; + +function TcxCustomGridRecord.GetRecordIndex: Integer; +begin + Result := RecordInfo.RecordIndex; +end; + +procedure TcxCustomGridRecord.SetExpanded(Value: Boolean); +begin + if Expanded <> Value then + if Value then + Expand(False) + else + Collapse(False); +end; + +procedure TcxCustomGridRecord.SetFocused(Value: Boolean); +begin + if Value then + FViewData.Controller.FocusedRecord := Self + else + if Focused then + FViewData.Controller.FocusedRecord := nil; +end; + +procedure TcxCustomGridRecord.RefreshRecordInfo; +begin + if IsNewItemRecord then + with RecordInfo do + begin + Expanded := False; + Level := 0; + RecordIndex := DataController.NewItemRecordIndex; + end + else + RecordInfo := DataController.GetRowInfo(FIndex); +end; + +procedure TcxCustomGridRecord.DoCollapse(ARecurse: Boolean); +begin +end; + +procedure TcxCustomGridRecord.DoExpand(ARecurse: Boolean); +begin +end; + +{function TcxCustomGridRecord.GetDestroyingOnExpanding: Boolean; +begin + Result := False; +end;} + +function TcxCustomGridRecord.GetExpandable: Boolean; +begin + Result := False; +end; + +function TcxCustomGridRecord.GetExpanded: Boolean; +begin + Result := False; +end; + +procedure TcxCustomGridRecord.ToggleExpanded; +begin + Expanded := not Expanded; +end; + +function TcxCustomGridRecord.GetHasCells: Boolean; +begin + Result := False; +end; + +function TcxCustomGridRecord.GetIsData: Boolean; +begin + Result := True; +end; + +function TcxCustomGridRecord.GetIsFirst: Boolean; +begin + Result := Index = 0; +end; + +function TcxCustomGridRecord.GetIsLast: Boolean; +begin + Result := Index = FViewData.RecordCount - 1; +end; + +function TcxCustomGridRecord.GetIsParent: Boolean; +begin + Result := False; +end; + +function TcxCustomGridRecord.GetIsParentRecordLast(AIndex: Integer): Boolean; +begin + Result := IsLast or (ViewData.Records[Index + 1].Level < Level - AIndex); +end; + +function TcxCustomGridRecord.GetParentRecord: TcxCustomGridRecord; +begin + if Level <> 0 then + begin + Result := Self; + repeat + Result := ViewData.Records[Result.Index - 1]; + until Result.Level < Level; + end + else + if GridView.IsDetail then + Result := GridView.MasterGridRecord + else + Result := nil; +end; + +function TcxCustomGridRecord.GetSelected: Boolean; +begin + if IsNewItemRecord then + Result := Controller.NewItemRecordFocused + else + Result := Controller.IsRecordSelected(Self); +end; + +function TcxCustomGridRecord.GetVisible: Boolean; +begin + Result := IsNewItemRecord or PartVisible and + FViewData.ViewInfo.RecordsViewInfo.GetRealItem(Self).Visible; +end; + +procedure TcxCustomGridRecord.SetSelected(Value: Boolean); +begin + if IsNewItemRecord then + Controller.NewItemRecordFocused := Value + else + Controller.ChangeRecordSelection(Self, Value); +end; + +function TcxCustomGridRecord.GetDisplayText(Index: Integer): string; +begin + Result := DataController.GetRowDisplayText(RecordInfo, Index); +end; + +function TcxCustomGridRecord.GetValueCount: Integer; +begin + Result := DataController.GetItemCount; +end; + +function TcxCustomGridRecord.GetValue(Index: Integer): Variant; +begin + Result := DataController.GetRowValue(RecordInfo, Index); +end; + +procedure TcxCustomGridRecord.SetDisplayText(Index: Integer; const Value: string); +begin + DataController.SetDisplayText(RecordIndex, Index, Value); +end; + +procedure TcxCustomGridRecord.SetValue(Index: Integer; const Value: Variant); +begin + DataController.SetValue(RecordIndex, Index, Value); +end; + +procedure TcxCustomGridRecord.KeyDown(var Key: Word; Shift: TShiftState); +begin + case Key of + VK_ADD: + if Expandable then + begin + Controller.EatKeyPress := True; + Expanded := True; + Key := 0; + end; + VK_SUBTRACT: + if Expandable then + begin + Controller.EatKeyPress := True; + Expanded := False; + Key := 0; + end; + VK_RETURN, VK_F2, VK_PROCESSKEY: + if HasCells and (Controller.FocusedItem <> nil) and + ((Shift = []) or (Key = VK_RETURN) and (Shift = [ssShift])) then + begin + Controller.FocusedItem.Editing := True; + if Controller.FocusedItem.Editing and (Key <> VK_PROCESSKEY) then + Key := 0; + end; + end; +end; + +function TcxCustomGridRecord.CanFocus: Boolean; +begin + Result := GridView.DoCanFocusRecord(Self); //!!! +end; + +function TcxCustomGridRecord.CanFocusCells: Boolean; +begin + Result := GridView.OptionsSelection.CellSelect; +end; + +procedure TcxCustomGridRecord.Collapse(ARecurse: Boolean); +begin + if Expandable then DoCollapse(ARecurse); +end; + +procedure TcxCustomGridRecord.Expand(ARecurse: Boolean); +begin + if Expandable then DoExpand(ARecurse); +end; + +function TcxCustomGridRecord.GetFirstFocusableChild: TcxCustomGridRecord; +begin + Result := nil; +end; + +function TcxCustomGridRecord.GetLastFocusableChild(ARecursive: Boolean): TcxCustomGridRecord; +begin + Result := nil; +end; + +procedure TcxCustomGridRecord.Invalidate(AItem: TcxCustomGridTableItem = nil); +begin + if PartVisible then + GridView.Changed(TcxGridRecordChange.Create(GridView, Self, Index, AItem)); +end; + +procedure TcxCustomGridRecord.MakeVisible; +begin + Controller.MakeRecordVisible(Self); +end; + +{ TcxCustomGridTableViewData } + +constructor TcxCustomGridTableViewData.Create(AGridView: TcxCustomGridView); +begin + inherited; + FRecords := TList.Create; +end; + +destructor TcxCustomGridTableViewData.Destroy; +begin + DestroyNewItemRecord; + DestroyRecords; + FRecords.Free; + inherited; +end; + +function TcxCustomGridTableViewData.GetController: TcxCustomGridTableController; +begin + Result := TcxCustomGridTableController(inherited Controller); +end; + +function TcxCustomGridTableViewData.GetEditingRecord: TcxCustomGridRecord; +begin + if DataController.IsEditing then + Result := GetRecordByRecordIndex(DataController.EditingRecordIndex) + else + Result := nil; +end; + +function TcxCustomGridTableViewData.GetGridView: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited GridView); +end; + +function TcxCustomGridTableViewData.GetInternalRecord(Index: Integer): TcxCustomGridRecord; +begin + Result := TcxCustomGridRecord(FRecords[Index]); +end; + +function TcxCustomGridTableViewData.GetRecord(Index: Integer): TcxCustomGridRecord; +begin + Result := InternalRecords[Index]; + if Result = nil then + begin + Result := CreateRecord(Index); + FRecords[Index] := Result; + //GridView.DoRecordCreated(Result); + end; +end; + +function TcxCustomGridTableViewData.GetRecordCount: Integer; +begin + Result := FRecords.Count; +end; + +function TcxCustomGridTableViewData.GetViewInfo: TcxCustomGridTableViewInfo; +begin + Result := TcxCustomGridTableViewInfo(inherited ViewInfo); +end; + +function TcxCustomGridTableViewData.CreateRecord(AIndex: Integer): TcxCustomGridRecord; +var + ARecordInfo: TcxRowInfo; +begin + ARecordInfo := DataController.GetRowInfo(AIndex); + Result := GetRecordClass(ARecordInfo).Create(Self, AIndex, ARecordInfo); +end; + +function TcxCustomGridTableViewData.GetFilterValueListClass: TcxGridFilterValueListClass; +begin + Result := TcxGridFilterValueList; +end; + +function TcxCustomGridTableViewData.GetRecordByKind(AKind, AIndex: Integer): TcxCustomGridRecord; +begin + case AKind of + rkNormal: + if (0 <= AIndex) and (AIndex < RecordCount) then + Result := Records[AIndex] + else + Result := nil; + rkNewItem: + Result := NewItemRecord; + else + Result := nil; + end; +end; + +function TcxCustomGridTableViewData.GetRecordKind(ARecord: TcxCustomGridRecord): Integer; +begin + if ARecord.IsNewItemRecord then + Result := rkNewItem + else + Result := rkNormal; +end; + +procedure TcxCustomGridTableViewData.AssignEditingRecord; +begin + FEditingRecord := GetEditingRecord; +end; + +procedure TcxCustomGridTableViewData.CreateNewItemRecord; +var + ARowInfo: TcxRowInfo; +begin + FNewItemRecord := GetNewItemRecordClass.Create(Self, -1, ARowInfo); + FNewItemRecord.RefreshRecordInfo; + //GridView.DoRecordCreated(FNewItemRecord); +end; + +procedure TcxCustomGridTableViewData.DestroyNewItemRecord; +begin + FreeAndNil(FNewItemRecord); +end; + +function TcxCustomGridTableViewData.GetNewItemRecordClass: TcxCustomGridRecordClass; +begin + Result := nil; +end; + +procedure TcxCustomGridTableViewData.RecreateNewItemRecord; +begin + if HasNewItemRecord then + begin + DestroyNewItemRecord; + CreateNewItemRecord; + end; +end; + +procedure TcxCustomGridTableViewData.Collapse(ARecurse: Boolean); +var + I: Integer; +begin + BeginUpdate; + try + for I := RecordCount - 1 downto 0 do + Records[I].Collapse(ARecurse); + finally + EndUpdate; + end; +end; + +procedure TcxCustomGridTableViewData.DestroyRecords; +var + I: Integer; + ARecord: TcxCustomGridRecord; +begin + for I := 0 to RecordCount - 1 do + begin + ARecord := InternalRecords[I]; + if ARecord <> nil then + begin + ARecord.Free; + FRecords[I] := nil; + end; + end; +end; + +procedure TcxCustomGridTableViewData.Expand(ARecurse: Boolean); +var + I: Integer; +begin + BeginUpdate; + try + for I := 0 to RecordCount - 1 do + Records[I].Expand(ARecurse); + finally + EndUpdate; + end; +end; + +function TcxCustomGridTableViewData.GetRecordByIndex(AIndex: Integer): TcxCustomGridRecord; +begin + if (0 <= AIndex) and (AIndex < RecordCount) then + Result := Records[AIndex] + else + Result := nil; +end; + +function TcxCustomGridTableViewData.GetRecordByRecordIndex(ARecordIndex: Integer): TcxCustomGridRecord; +var + I: Integer; +begin + if HasNewItemRecord and (ARecordIndex = DataController.NewItemRecordIndex) then + Result := FNewItemRecord + else + if (0 <= ARecordIndex) and (ARecordIndex < DataController.RecordCount) then + begin + // following loop was created because during sorting + // row order in data controller is new already, but it is old in view data + // (used in TcxCustomGridTableItem.GetProperties(ARecordIndex)) + if GridView.IsUpdateLocked or not DataController.IsRowInfoValid then + for I := 0 to RecordCount - 1 do + begin + Result := InternalRecords[I]; + if (Result <> nil) and Result.IsData and (Result.RecordIndex = ARecordIndex) then + Exit; + end; + Result := GetRecordByIndex(DataController.GetRowIndexByRecordIndex(ARecordIndex, False)); + end + else + Result := nil; +end; + +function TcxCustomGridTableViewData.GetRecordIndexByRecord(ARecord: TcxCustomGridRecord): Integer; +begin + if ARecord = nil then + Result := -1 //!!! can be internal record index + else + Result := ARecord.RecordIndex; +end; + +function TcxCustomGridTableViewData.IsRecordIndexValid(AIndex: Integer): Boolean; +begin + Result := (0 <= AIndex) and (AIndex < RecordCount); +end; + +procedure TcxCustomGridTableViewData.Refresh(ARecordCount: Integer); +begin + RecreateNewItemRecord; + DestroyRecords; + FRecords.Clear; + FRecords.Count := ARecordCount; + AssignEditingRecord; + GridView.SizeChanged(GridView.IsPattern); +end; + +procedure TcxCustomGridTableViewData.RefreshRecords; +var + I: Integer; + ARecord: TcxCustomGridRecord; +begin + if HasNewItemRecord then FNewItemRecord.RefreshRecordInfo; + for I := 0 to RecordCount - 1 do + begin + ARecord := InternalRecords[I]; + if ARecord <> nil then ARecord.RefreshRecordInfo; + end; + AssignEditingRecord; +end; + +procedure TcxCustomGridTableViewData.CheckNewItemRecord; +begin + if HasNewItemRecord then + CreateNewItemRecord + else + DestroyNewItemRecord; +end; + +function TcxCustomGridTableViewData.HasNewItemRecord: Boolean; +begin + Result := False; +end; + +function TcxCustomGridTableViewData.AddItemToFilter(AParent: TcxFilterCriteriaItemList; + AItem: TcxCustomGridTableItem; AOperatorKind: TcxFilterOperatorKind; + const AValue: Variant; ADisplayText: string; AReplaceExistent: Boolean): TcxFilterCriteriaItem; +begin + if (ADisplayText = '') and not (VarIsNull(AValue) or VarIsArray(AValue)) then + ADisplayText := AValue; + AItem.DataBinding.GetFilterDisplayText(AValue, ADisplayText); + if AReplaceExistent then + DataController.Filter.RemoveItemByItemLink(AItem); + Result := DataController.Filter.AddItem(AParent, AItem, AOperatorKind, AValue, ADisplayText); +end; + +function TcxCustomGridTableViewData.CreateFilterValueList: TcxGridFilterValueList; +begin + Result := GetFilterValueListClass.Create(DataController.Filter); +end; + +function TcxCustomGridTableViewData.GetDisplayText(ARecordIndex, AItemIndex: Integer; + out AText: string; AUseCustomValue: Boolean = False; ACustomValueOperation: TcxGridDataOperation = doGrouping): Boolean; +var + AItem: TcxCustomGridTableItem; + AProperties: TcxCustomEditProperties; + AValue: Variant; +begin + AItem := GridView.Items[AItemIndex]; + AProperties := AItem.GetProperties(ARecordIndex); + Result := AUseCustomValue or (AProperties.GetEditValueSource(False) = evsValue); + if Result then + begin + AValue := DataController.Values[ARecordIndex, AItemIndex]; + if AUseCustomValue then + AValue := GetCustomDataValue(AItem, AValue, ACustomValueOperation); + AText := AProperties.GetDisplayText(AValue, True); + end; +end; + +function TcxCustomGridTableViewData.CustomCompareDataValues(AField: TcxCustomDataField; + const AValue1, AValue2: Variant; AMode: TcxDataControllerComparisonMode): Integer; +var + AOperation: TcxGridDataOperation; + ACustomValue1, ACustomValue2: Variant; +begin + if AMode = dccmSorting then + AOperation := doSorting + else + AOperation := doGrouping; + ACustomValue1 := GetCustomDataValue(AField, AValue1, AOperation); + ACustomValue2 := GetCustomDataValue(AField, AValue2, AOperation); + Result := VarCompare(ACustomValue1, ACustomValue2); +end; + +function TcxCustomGridTableViewData.GetCustomDataDisplayText(ARecordIndex, AItemIndex: Integer; + AOperation: TcxGridDataOperation): string; +var + AValue: Variant; + ADate: TDateTime; + ADateRange: TcxCustomGridDateRange; +begin + Result := ''; + if AOperation = doGrouping then + begin + AValue := DataController.Values[ARecordIndex, AItemIndex]; + if not VarIsNull(AValue) then + begin + if GridView.Items[AItemIndex].GroupingDateRanges.NeedTime then + ADate := AValue + else + ADate := DateOf(AValue); + ADateRange := GridView.Items[AItemIndex].GroupingDateRanges.GetRange(ADate); + if ADateRange <> nil then + Result := ADateRange.GetDisplayText(ADate); + end; + end; + if Result = '' then + GetDisplayText(ARecordIndex, AItemIndex, Result, True, AOperation); +end; + +function TcxCustomGridTableViewData.GetCustomDataValue(AField: TcxCustomDataField; + const AValue: Variant; AOperation: TcxGridDataOperation): Variant; +begin + Result := GetCustomDataValue(TcxCustomGridTableItem(AField.Item), AValue, AOperation); +end; + +function TcxCustomGridTableViewData.GetCustomDataValue(AItem: TcxCustomGridTableItem; + const AValue: Variant; AOperation: TcxGridDataOperation): Variant; +var + ADate: TDateTime; + ADateRange: TcxCustomGridDateRange; +begin + if VarIsNull(AValue) then + Result := AValue + else + if AOperation in [doSorting, doGrouping] then + begin + if AItem.GroupingDateRanges.NeedTime then + ADate := AValue + else + ADate := DateOf(AValue); + ADateRange := AItem.GroupingDateRanges.GetRange(ADate); + if ADateRange = nil then + Result := ADate + else + if AOperation = doGrouping then + Result := ADateRange.GetValue(ADate) + else + Result := ADateRange.GetSortingValue(ADate); + end + else + Result := DateOf(AValue); +end; + +function TcxCustomGridTableViewData.HasCustomDataHandling(AField: TcxCustomDataField; + AOperation: TcxGridDataOperation): Boolean; +begin + Result := (AField.Item <> nil) and + HasCustomDataHandling(TcxCustomGridTableItem(AField.Item), AOperation); +end; + +function TcxCustomGridTableViewData.HasCustomDataHandling(AItem: TcxCustomGridTableItem; + AOperation: TcxGridDataOperation): Boolean; +begin + Result := + (AOperation = doGrouping) and AItem.SupportsGroupingDateRanges(False) or + (AOperation = doFiltering) and AItem.CanIgnoreTimeForFiltering; +end; + +function TcxCustomGridTableViewData.NeedsCustomDataComparison(AField: TcxCustomDataField; + AMode: TcxDataControllerComparisonMode): Boolean; +var + AItem: TcxCustomGridTableItem; + AItemGroupIndex: Integer; +begin + AItem := TcxCustomGridTableItem(AField.Item); + Result := (AItem <> nil) and ((AMode = dccmGrouping) or (AMode = dccmSorting)) and + HasCustomDataHandling(AField, doGrouping); + if Result and (AMode = dccmSorting) then + begin + AItemGroupIndex := AItem.GroupIndex; + Result := (AItemGroupIndex <> -1) and + ((AItemGroupIndex < GridView.GroupedItemCount - 1) or AItem.GroupingDateRanges.NeedSortingByTime); + end; +end; + +{ TcxCustomGridTableMovingObject } + +function TcxCustomGridTableMovingObject.GetController: TcxCustomGridTableController; +begin + Result := TcxCustomGridTableController(inherited Controller); +end; + +function TcxCustomGridTableMovingObject.GetCustomizationForm: TcxCustomGridTableCustomizationForm; +begin + Result := TcxCustomGridTableCustomizationForm(inherited CustomizationForm); +end; + +procedure TcxCustomGridTableMovingObject.DragAndDrop(const P: TPoint; var Accepted: Boolean); +begin + inherited; + Controller.CheckScrolling(P); +end; + +{ TcxGridItemContainerZone } + +constructor TcxGridItemContainerZone.Create(AItemIndex: Integer); +begin + inherited Create; + ItemIndex := AItemIndex; +end; + +function TcxGridItemContainerZone.IsEqual(Value: TcxGridItemContainerZone): Boolean; +begin + Result := (Value <> nil) and (ItemIndex = Value.ItemIndex); +end; + +{ TcxCustomGridTableItemMovingObject } + +constructor TcxCustomGridTableItemMovingObject.Create(AControl: TcxControl); +begin + inherited; + FDestItemContainerKind := ckNone; +end; + +destructor TcxCustomGridTableItemMovingObject.Destroy; +begin + DestZone := nil; + inherited; +end; + +procedure TcxCustomGridTableItemMovingObject.SetDestItemContainerKind(Value: TcxGridItemContainerKind); +begin + CheckDestItemContainerKind(Value); + if FDestItemContainerKind <> Value then + begin + Dirty := True; + FDestItemContainerKind := Value; + end; +end; + +procedure TcxCustomGridTableItemMovingObject.SetDestZone(Value: TcxGridItemContainerZone); +begin + if (FDestZone <> Value) and + ((FDestZone = nil) or not FDestZone.IsEqual(Value) or + (Value = nil) or not Value.IsEqual(FDestZone)) then + begin + Dirty := True; + FDestZone.Free; + FDestZone := Value; + end + else + Value.Free; +end; + +procedure TcxCustomGridTableItemMovingObject.CalculateDestParams(AHitTest: TcxCustomGridHitTest; + out AContainerKind: TcxGridItemContainerKind; out AZone: TcxGridItemContainerZone); +begin + if AHitTest.HitTestCode = htCustomizationForm then + AContainerKind := ckCustomizationForm + else + AContainerKind := ckNone; + AZone := nil; +end; + +procedure TcxCustomGridTableItemMovingObject.CheckDestItemContainerKind(var AValue: TcxGridItemContainerKind); +begin + if (SourceItemContainerKind <> ckCustomizationForm) and + (AValue = ckCustomizationForm) and not CanRemove then + AValue := ckNone; +end; + +function TcxCustomGridTableItemMovingObject.GetCustomizationFormListBox: TcxCustomGridItemsListBox; +begin + Result := CustomizationForm.ItemsListBox; +end; + +function TcxCustomGridTableItemMovingObject.IsSourceCustomizationForm: Boolean; +begin + Result := FSourceItemContainerKind = ckCustomizationForm; +end; + +procedure TcxCustomGridTableItemMovingObject.BeginDragAndDrop; +begin + if CustomizationForm <> nil then + with CustomizationForm do + ActivatePage(ItemsPage); + Controller.FMovingItem := SourceItem as TcxCustomGridTableItem; + inherited; +end; + +procedure TcxCustomGridTableItemMovingObject.DragAndDrop(const P: TPoint; var Accepted: Boolean); +var + AHitTest: TcxCustomGridHitTest; + ADestContainerKind: TcxGridItemContainerKind; + ADestZone: TcxGridItemContainerZone; +begin + AHitTest := ViewInfo.GetHitTest(P); + CalculateDestParams(AHitTest, ADestContainerKind, ADestZone); + DestZone := ADestZone; + DestItemContainerKind := ADestContainerKind; + Accepted := FDestItemContainerKind <> ckNone; + inherited; +end; + +procedure TcxCustomGridTableItemMovingObject.EndDragAndDrop(Accepted: Boolean); +begin + inherited; + Controller.FMovingItem := nil; +end; + +{ TcxCustomGridTableItemsListBox } + +function TcxCustomGridTableItemsListBox.GetGridView: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited GridView); +end; + +procedure TcxCustomGridTableItemsListBox.RefreshItemsAsTableItems; +var + I: Integer; + AItem: TcxCustomGridTableItem; +begin + inherited; + with Items do + begin + BeginUpdate; + try + Clear; + for I := 0 to GridView.ItemCount - 1 do + begin + AItem := GridView.Items[I]; + if AItem.CanMove and AItem.VisibleForCustomization and not AItem.Visible then + AddObject(AItem.GetAlternateCaption, AItem); + end; + finally + EndUpdate; + end; + end; +end; + +{ TcxCustomGridTableCustomizationForm } + +procedure TcxCustomGridTableCustomizationForm.CreateControls; +begin + inherited; + FItemsListBox := GetItemsListBoxClass.Create(Self); + with FItemsListBox do + begin + Align := alClient; + Parent := FItemsPage; + RefreshItems; + end; +end; + +function TcxCustomGridTableCustomizationForm.GetItemsListBoxClass: TcxCustomGridTableItemsListBoxClass; +begin + Result := TcxCustomGridTableItemsListBox; +end; + +function TcxCustomGridTableCustomizationForm.GetItemsPageVisible: Boolean; +begin + Result := TcxCustomGridTableView(GridView).OptionsCustomize.ItemMoving; +end; + +procedure TcxCustomGridTableCustomizationForm.InitPageControl; +begin + inherited; + FItemsPage := CreatePage(GetItemsPageCaption, GetItemsPageVisible); +end; + +procedure TcxCustomGridTableCustomizationForm.RefreshData; +begin + inherited; + FItemsListBox.RefreshItems; +end; + +{ TcxGridFilterPopupListBox } + +function TcxGridFilterPopupListBox.GetPopup: TcxGridFilterPopup; +begin + Result := TcxGridFilterPopup(inherited Popup); +end; + +function TcxGridFilterPopupListBox.CanHaveCheck(AItemIndex: Integer): Boolean; +begin + Result := inherited CanHaveCheck(AItemIndex) and + not Popup.IsMRUItemsListSeparator(AItemIndex); +end; + +procedure TcxGridFilterPopupListBox.DrawItemContent(ACanvas: TcxCanvas; + AIndex: Integer; ARect: TRect; AState: TOwnerDrawState); + + procedure DrawMRUItemsListSeparator; + var + Y: Integer; + begin + with ACanvas do + begin + Pen.Color := clBtnShadow; + with ARect do + begin + Y := (Top + Bottom - 3) div 2; + MoveTo(Left, Y); + LineTo(Right, Y); + MoveTo(Left, Y + 2); + LineTo(Right, Y + 2); + end; + end; + end; + +begin + if Popup.IsMRUItemsListSeparator(AIndex) then + DrawMRUItemsListSeparator + else + inherited; +end; + +function TcxGridFilterPopupListBox.HasCheck(AItemIndex: Integer): Boolean; +begin + Result := Popup.IsCheck(AItemIndex); +end; + +{ TcxGridFilterPopup } + +constructor TcxGridFilterPopup.Create(AGridView: TcxCustomGridView); +begin + inherited; + AlignHorz := pahRight; + FListBoxItems := TStringList.Create; + FValueList := GridView.ViewData.CreateFilterValueList; + + FListBox := TcxGridFilterPopupListBox.Create(Self); + FListBox.OnAction := ListBoxAction; + + FButton := TcxButton.Create(Self); + FButton.Caption := cxGetResourceString(@scxGridFilterApplyButtonCaption); + FButton.LookAndFeel.MasterLookAndFeel := GridView.LookAndFeel; + FButton.ParentFont := True; + UpdateButtonEnabled; + FButton.OnClick := ButtonClicked; +end; + +destructor TcxGridFilterPopup.Destroy; +begin + FValueList.Free; + FListBoxItems.Free; + inherited; +end; + +function TcxGridFilterPopup.GetFilter: TcxDataFilterCriteria; +begin + Result := GridView.DataController.Filter; +end; + +function TcxGridFilterPopup.GetGridView: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited GridView); +end; + +{function TcxGridFilterPopup.GetOwnerValue: IcxGridFilterPopupOwner; +begin + Result := IcxGridFilterPopupOwner(inherited Owner); +end; + +procedure TcxGridFilterPopup.SetOwnerValue(Value: IcxGridFilterPopupOwner); +begin + inherited Owner := Value; +end;} + +procedure TcxGridFilterPopup.SetFilterChangedByCheck(Value: Boolean); +begin + if FFilterChangedByCheck <> Value then + begin + FFilterChangedByCheck := Value; + UpdateButtonEnabled; + end; +end; + +procedure TcxGridFilterPopup.ButtonClicked(Sender: TObject); +begin + CloseUp; + ApplyFilterUsingCheckedItems(FListBox.CheckedIndexes); + GridView.Filtering.AddFilterToMRUItems; +end; + +procedure TcxGridFilterPopup.ListBoxAction(Sender: TcxGridPopupListBox; AItemIndex: Integer); +begin + if FListBox.IsCheck(AItemIndex) then + begin + if ImmediateFilterUsingChecks then + ApplyFilterUsingCheckedItems(FListBox.CheckedIndexes); + FilterChangedByCheck := True; + end + else + ApplyFilterUsingClickedItem(AItemIndex); +end; + +procedure TcxGridFilterPopup.AddListBoxItems; +begin + Item.DataBinding.GetFilterStrings(FListBoxItems, FValueList); +end; + +procedure TcxGridFilterPopup.AdjustListBoxSize; +begin + FListBox.VisibleItemCount := GridView.Filtering.ItemPopup.MaxDropDownItemCount; + FListBox.VisibleWidth := GridView.Filtering.ItemPopup.DropDownWidth; + FListBox.ShowChecks := SupportsChecks; + FListBox.AdjustBounds(FListBoxItems); +end; + +procedure TcxGridFilterPopup.ApplyFilterUsingCheckedItems(const AItemIndexes: TcxGridIndexes); +begin + Item.DataBinding.SetFilterActiveValueIndexes(FValueList, AItemIndexes); +end; + +procedure TcxGridFilterPopup.ApplyFilterUsingClickedItem(AItemIndex: Integer); +begin + FValueList.ApplyFilter(Item, AItemIndex, nil, True, True); + if not (FValueList[AItemIndex].Kind in [fviCustom, fviUser]) then + GridView.Filtering.AddFilterToMRUItems; +end; + +function TcxGridFilterPopup.GetImmediateFilterUsingChecks: Boolean; +begin + Result := GridView.Filtering.ItemPopup.ApplyMultiSelectChanges = fpacImmediately; +end; + +function TcxGridFilterPopup.GetListBoxCheckedItemIndexes: TcxGridIndexes; +var + AActiveValueIndexes: TcxGridIndexes; + I: Integer; +begin + Item.DataBinding.GetFilterActiveValueIndexes(FValueList, AActiveValueIndexes); + Result := nil; + for I := 0 to Length(AActiveValueIndexes) - 1 do + if IsCheck(AActiveValueIndexes[I]) then + begin + SetLength(Result, Length(Result) + 1); + Result[Length(Result) - 1] := AActiveValueIndexes[I]; + end; +end; + +function TcxGridFilterPopup.GetSelectedItemIndex: Integer; +begin + Result := FValueList.GetIndexByCriteriaItem(Item.DataBinding.FilterCriteriaItem); +end; + +procedure TcxGridFilterPopup.InitButton; +begin + if IsButtonVisible then + begin + FButton.Width := FListBox.Width; + FButton.Top := FListBox.BoundsRect.Bottom; + FButton.Parent := Self; + FButton.Height := FButton.GetOptimalSize.cy; + {with GetButtonPainterClass(FButton.LookAndFeel) do + FButton.Height := 2 * (ButtonBorderSize + ButtonTextOffset) + Canvas.FontHeight(FButton.Font);} + end + else + FButton.Parent := nil; +end; + +procedure TcxGridFilterPopup.InitListBox; +var + ACheckedIndexes: TcxGridIndexes; +begin + AddListBoxItems; + AdjustListBoxSize; + FListBox.Items := FListBoxItems; + if FListBox.ShowChecks then + ACheckedIndexes := GetListBoxCheckedItemIndexes + else + ACheckedIndexes := nil; + if ACheckedIndexes = nil then + FListBox.ItemIndex := SelectedItemIndex + else + FListBox.ItemIndex := -1; + FListBox.CheckedIndexes := ACheckedIndexes; +end; + +procedure TcxGridFilterPopup.InitPopup; +begin + FItem := (Owner as IcxGridFilterPopupOwner).GetItem; + ShowHourglassCursor; + try + inherited; + InitListBox; + InitButton; + FilterChangedByCheck := False; + finally + HideHourglassCursor; + end; +end; + +function TcxGridFilterPopup.IsButtonVisible: Boolean; +begin + Result := SupportsChecks and not ImmediateFilterUsingChecks; +end; + +function TcxGridFilterPopup.IsCheck(AItemIndex: Integer): Boolean; +begin + Result := FValueList[AItemIndex].Kind in [fviBlanks, fviValue, fviSpecial]; +end; + +function TcxGridFilterPopup.IsMRUItemsListSeparator(AItemIndex: Integer): Boolean; +begin + Result := FValueList[AItemIndex].Kind = fviMRUSeparator; +end; + +function TcxGridFilterPopup.SupportsChecks: Boolean; +begin + Result := Item.CanFilterUsingChecks; +end; + +procedure TcxGridFilterPopup.UpdateButtonEnabled; +begin + FButton.Enabled := FFilterChangedByCheck; +end; + +procedure TcxGridFilterPopup.CloseUp; +begin + inherited; + FListBox.Clear; + if FFilterChangedByCheck and ImmediateFilterUsingChecks then + GridView.Filtering.AddFilterToMRUItems; +end; + +{ TcxGridFilterMRUItemsPopup } + +constructor TcxGridFilterMRUItemsPopup.Create(AGridView: TcxCustomGridView); +begin + inherited; + FListBox := TcxGridPopupListBox.Create(Self); + FListBox.OnAction := ListBoxAction; +end; + +function TcxGridFilterMRUItemsPopup.GetFiltering: TcxCustomGridTableFiltering; +begin + Result := GridView.Filtering; +end; + +function TcxGridFilterMRUItemsPopup.GetGridView: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited GridView); +end; + +procedure TcxGridFilterMRUItemsPopup.ListBoxAction(Sender: TcxGridPopupListBox; + AItemIndex: Integer); +begin + ApplyFilterMRUItem(AItemIndex); +end; + +procedure TcxGridFilterMRUItemsPopup.AddFilterMRUItems(AStrings: TStrings); +var + I: Integer; + AItem: TcxGridFilterMRUItem; +begin + AStrings.BeginUpdate; + try + AStrings.Clear; + for I := 0 to Filtering.MRUItems.VisibleCount - 1 do + begin + AItem := Filtering.MRUItems.VisibleItems[I]; + AStrings.AddObject(AItem.Caption, AItem); + end; + finally + AStrings.EndUpdate; + end; +end; + +procedure TcxGridFilterMRUItemsPopup.ApplyFilterMRUItem(AItemIndex: Integer); +begin + TcxGridFilterMRUItem(FListBox.Items.Objects[AItemIndex]).AssignTo(GridView.DataController.Filter); + Filtering.AddFilterToMRUItems; +end; + +function TcxGridFilterMRUItemsPopup.GetTextOffsetHorz: Integer; +begin + Result := FListBox.ItemTextOffsetLeft; +end; + +procedure TcxGridFilterMRUItemsPopup.InitPopup; +begin + inherited; + FListBox.ItemTextOffsetVert := 2; + FListBox.VisibleItemCount := GridView.FilterBox.MRUItemsListDropDownCount; + AddFilterMRUItems(FListBox.Items); + FListBox.AdjustBounds; +end; + +{ TcxCustomGridCustomizationPopup } + +constructor TcxCustomGridCustomizationPopup.Create(AGridView: TcxCustomGridView); +begin + inherited; + CreateCheckListBox; +end; + +function TcxCustomGridCustomizationPopup.GetGridView: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited GridView); +end; + +procedure TcxCustomGridCustomizationPopup.SetScrollDirection(Value: TcxDirection); +begin + if FScrollDirection <> Value then + begin + FreeAndNil(FScrollTimer); + FScrollDirection := Value; + if FScrollDirection <> dirNone then + begin + FScrollTimer := TcxTimer.Create(nil); + FScrollTimer.Interval := CustomizationPopupCheckListBoxScrollTimeInterval; + FScrollTimer.OnTimer := ScrollTimerHandler; + end; + end; +end; + +procedure TcxCustomGridCustomizationPopup.CheckListBoxClick(Sender: TObject); +var + AItems: TList; +begin + if not GridView.IsDesigning then Exit; + AItems := TList.Create; + try + GetCheckListBoxSelectedItems(AItems); + GridView.Controller.DesignController.SelectObjects(AItems); + finally + AItems.Free; + end; +end; + +procedure TcxCustomGridCustomizationPopup.CheckListBoxCheckClick(Sender: TObject; + AIndex: Integer; APrevState, ANewState: TcxCheckBoxState); +begin + CheckClicked(AIndex, ANewState = cbsChecked); +end; + +procedure TcxCustomGridCustomizationPopup.CheckListBoxEndDrag(Sender, Target: TObject; + X, Y: Integer); +begin + ScrollDirection := dirNone; +end; + +procedure TcxCustomGridCustomizationPopup.CheckListBoxKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + case Key of + VK_ESCAPE: + CloseUp; + end; +end; + +procedure TcxCustomGridCustomizationPopup.CheckListBoxMouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + if Button = mbLeft then + CheckListBoxClick(Sender); +end; + +procedure TcxCustomGridCustomizationPopup.CheckListBoxStartDrag(Sender: TObject; + var DragObject: TDragObject); +begin + if CheckListBox.ItemAtPos(CheckListBox.ScreenToClient(GetMouseCursorPos), True) = -1 then + begin + DragObject := TDragObject(1); // to avoid DragObject creation in TcxControl.DoStartDrag + CancelDrag; + end + else + DragItemIndex := -1; +end; + +procedure TcxCustomGridCustomizationPopup.CheckListBoxDragOver(Sender, Source: TObject; + X, Y: Integer; State: TDragState; var Accept: Boolean); + + function GetArrowBounds(APlace: TcxGridArrowPlace): TRect; + const + ArrowOffset = 1; + begin + Result := CheckListBox.InnerCheckListBox.ItemRect(DragItemIndex); + Result.Bottom := Result.Top; + Result := GetDragAndDropArrowBounds(Result, cxEmptyRect, APlace); + if APlace = apLeft then + OffsetRect(Result, Result.Right - Result.Left + ArrowOffset, 0) + else + OffsetRect(Result, -(Result.Right - Result.Left + ArrowOffset), 0); + end; + + procedure HideInsertionMark; + var + R: TRect; + begin + if DragItemIndex = -1 then Exit; + R := GetArrowBounds(apLeft); + InvalidateRect(CheckListBox.InnerCheckListBox.Handle, @R, True); + R := GetArrowBounds(apRight); + InvalidateRect(CheckListBox.InnerCheckListBox.Handle, @R, True); + CheckListBox.InnerCheckListBox.Update; + end; + + procedure ShowInsertionMark; + begin + if DragItemIndex = -1 then Exit; + DrawDragAndDropArrow(CheckListBox.InnerCheckListBox.Canvas, + GetArrowBounds(apLeft), apLeft); + DrawDragAndDropArrow(CheckListBox.InnerCheckListBox.Canvas, + GetArrowBounds(apRight), apRight); + end; + + procedure CheckScrolling; + begin + if (DragItemIndex <> -1) and (CheckListBox.Columns > 1) then + if X < CustomizationPopupCheckListBoxScrollZoneWidth then + ScrollDirection := dirLeft + else + if X >= CheckListBox.ClientWidth - CustomizationPopupCheckListBoxScrollZoneWidth then + ScrollDirection := dirRight + else + ScrollDirection := dirNone + else + ScrollDirection := dirNone; + end; + +var + AItemIndex: Integer; +begin + AItemIndex := GetItemInsertionIndex(X, Y); + Accept := AItemIndex <> -1; + if State = dsDragLeave then + AItemIndex := -1; + if DragItemIndex <> AItemIndex then + begin + HideInsertionMark; + DragItemIndex := AItemIndex; + ShowInsertionMark; + end; + CheckScrolling; +end; + +procedure TcxCustomGridCustomizationPopup.CheckListBoxDragDrop(Sender, Source: TObject; + X, Y: Integer); + + procedure MoveItems(AItems: TList; AIndex: Integer); + var + I: Integer; + begin + GridView.BeginUpdate; + try + for I := 0 to AItems.Count - 1 do + begin + SetItemIndex(AItems[I], AIndex); + AIndex := GetItemIndex(AItems[I]) + 1; + end; + finally + GridView.EndUpdate; + end; + end; + +var + AIndex: Integer; + AItems: TList; +begin + AIndex := GetItemInsertionIndex(X, Y); + if AIndex = -1 then Exit; + if AIndex = CheckListBox.Count then + AIndex := GetItemIndex(CheckListBox.Items[AIndex - 1].ItemObject) + 1 + else + AIndex := GetItemIndex(CheckListBox.Items[AIndex].ItemObject); + + AItems := TList.Create; + try + GetCheckListBoxSelectedItems(AItems); + MoveItems(AItems, AIndex); + CheckListBox.ItemIndex := AIndex; + RefreshCheckListBoxItems; + SetCheckListBoxSelectedItems(AItems); + finally + AItems.Free; + end; +end; + +procedure TcxCustomGridCustomizationPopup.ScrollTimerHandler(Sender: TObject); +var + ATopIndex: Integer; + AAccept: Boolean; +begin + // cannot use WM_HSCROLL here - it does not scroll by one column + if ScrollDirection = dirLeft then + CheckListBox.TopIndex := CheckListBox.TopIndex - 1 + else + begin + ATopIndex := CheckListBox.TopIndex; + repeat + Inc(ATopIndex); + CheckListBox.TopIndex := ATopIndex; + until (CheckListBox.TopIndex = ATopIndex) or (ATopIndex >= CheckListBox.Items.Count); + end; + + AAccept := True; + with CheckListBox.ScreenToClient(GetMouseCursorPos) do + CheckListBoxDragOver(nil, nil, X, Y, dsDragMove, AAccept); +end; + +procedure TcxCustomGridCustomizationPopup.AdjustCheckListBoxSize(AFixedHeight: Boolean = False); +var + ADropDownCount: Integer; + + function CalculateClientWidth: Integer; + begin + if FCheckListBox.Columns > 1 then + Result := CheckListBoxColumnWidth * FCheckListBox.Columns + else + begin + Result := FCheckListBox.GetBestFitWidth; + if (ADropDownCount <> -1) and (FCheckListBox.Items.Count > ADropDownCount) then + Inc(Result, GetScrollBarSize.cx); + end; + end; + + function CalculateClientHeight: Integer; + begin + if ADropDownCount = -1 then + Result := FCheckListBox.ClientHeight + GetScrollBarSize.cy + else + Result := FCheckListBox.GetHeight(ADropDownCount); + end; + +begin + if AFixedHeight then + ADropDownCount := -1 + else + if FCheckListBox.Columns > 1 then + ADropDownCount := RoundDiv(FCheckListBox.Items.Count, FCheckListBox.Columns) + else + begin + ADropDownCount := GetDropDownCount; + if (ADropDownCount = 0) or (FCheckListBox.Items.Count < ADropDownCount) then + ADropDownCount := FCheckListBox.Items.Count; + end; + FCheckListBox.ClientWidth := CalculateClientWidth; + FCheckListBox.ClientHeight := CalculateClientHeight; +end; + +procedure TcxCustomGridCustomizationPopup.CheckClicked(AIndex: Integer; AChecked: Boolean); +begin + ItemClicked(CheckListBox.Items[AIndex].ItemObject, AChecked); +end; + +procedure TcxCustomGridCustomizationPopup.CreateCheckListBox; +begin + FCheckListBox := TcxCheckListBox.Create(Self); + with FCheckListBox do + begin + with Style do + begin + LookAndFeel.MasterLookAndFeel := GridView.LookAndFeel; + BorderStyle := cbsNone; + HotTrack := False; + TransparentBorder := False; + end; + StyleFocused.BorderStyle := cbsNone; + StyleHot.BorderStyle := cbsNone; + ParentFont := True; + Parent := Self; + OnClick := CheckListBoxClick; + OnClickCheck := CheckListBoxCheckClick; + OnDragDrop := CheckListBoxDragDrop; + OnDragOver := CheckListBoxDragOver; + OnEndDrag := CheckListBoxEndDrag; + OnKeyDown := CheckListBoxKeyDown; + OnMouseDown := CheckListBoxMouseDown; + OnStartDrag := CheckListBoxStartDrag; + end; +end; + +function TcxCustomGridCustomizationPopup.GetCheckListBoxColumnWidth: Integer; +begin + Result := CheckListBox.GetBestFitWidth + CustomizationPopupCheckListBoxColumnOffset; +end; + +function TcxCustomGridCustomizationPopup.GetItemInsertionIndex(X, Y: Integer): Integer; +var + R: TRect; +begin + Result := CheckListBox.ItemAtPos(Point(X, Y), True); + if Result = -1 then + begin + R := CheckListBox.ItemRect(CheckListBox.Count - 1); + R.Bottom := CheckListBox.ClientBounds.Bottom; + if PtInRect(R, Point(X, Y)) then + Result := CheckListBox.Count; + end + else + begin + R := CheckListBox.ItemRect(Result); + if Y > GetRangeCenter(R.Top, R.Bottom) then + Inc(Result); + end; +end; + +procedure TcxCustomGridCustomizationPopup.InitPopup; +begin + inherited; + with FCheckListBox do + begin + Canvas.Font := Font; + if SupportsItemMoving then + DragMode := dmAutomatic + else + DragMode := dmManual; + InnerCheckListBox.MultiSelect := DragMode = dmAutomatic; + end; + AddCheckListBoxItems; + AdjustCheckListBoxSize; +end; + +procedure TcxCustomGridCustomizationPopup.RefreshCheckListBoxItems; +begin + CheckListBox.Items.BeginUpdate; + try + CheckListBox.Clear; + AddCheckListBoxItems; + finally + CheckListBox.Items.EndUpdate; + end; +end; + +procedure TcxCustomGridCustomizationPopup.GetCheckListBoxSelectedItems(AItems: TList); +var + I: Integer; +begin + for I := 0 to CheckListBox.Count - 1 do + if CheckListBox.Selected[I] then + AItems.Add(CheckListBox.Items[I].ItemObject); +end; + +procedure TcxCustomGridCustomizationPopup.SetCheckListBoxSelectedItems(AItems: TList); +var + I, AIndex: Integer; +begin + for I := 0 to AItems.Count - 1 do + begin + AIndex := CheckListBox.Items.IndexOfObject(AItems[I]); + if AIndex <> -1 then + CheckListBox.Selected[AIndex] := True; + end; +end; + +procedure TcxCustomGridCustomizationPopup.CloseUp; +begin + inherited; + FCheckListBox.Clear; + FCheckListBox.Columns := 0; +end; + +procedure TcxCustomGridCustomizationPopup.CorrectBoundsWithDesktopWorkArea(var APosition: TPoint); +var + ADesktopWorkArea: TRect; + ADesktopSpace, AColumnCount: Integer; +begin + ADesktopWorkArea := GetDesktopWorkArea(OwnerScreenBounds.TopLeft); + + if APosition.Y < ADesktopWorkArea.Top then + ADesktopSpace := APosition.Y + Height - ADesktopWorkArea.Top + else + if APosition.Y + Height > ADesktopWorkArea.Bottom then + ADesktopSpace := ADesktopWorkArea.Bottom - APosition.Y + else + ADesktopSpace := 0; + + if ADesktopSpace <> 0 then + begin + AColumnCount := RoundDiv(CheckListBox.Height, ADesktopSpace - NCHeight); + repeat + RestoreControlsBounds; + CheckListBox.Columns := AColumnCount; + AdjustCheckListBoxSize; + CalculateSize; + APosition := CalculatePosition; + Inc(AColumnCount); + until (ADesktopWorkArea.Top <= APosition.Y - GetScrollBarSize.cy) and + (APosition.Y + Height + GetScrollBarSize.cy <= ADesktopWorkArea.Bottom); + + if APosition.X + Width > ADesktopWorkArea.Right then + begin + RestoreControlsBounds; + CheckListBox.Columns := + (ADesktopWorkArea.Right - APosition.X - NCWidth) div CheckListBoxColumnWidth; + AdjustCheckListBoxSize(True); + CalculateSize; + APosition := CalculatePosition; + end; + end; +end; + +procedure TcxCustomGridCustomizationPopup.Popup; +begin + GridView.Focused := True; // to prevent popup from closing because of viewinfo recalculation + inherited; +end; + +{ TcxCustomGridItemsCustomizationPopup } + +procedure TcxCustomGridItemsCustomizationPopup.AddCheckListBoxItems; +var + I: Integer; + AItem: TcxCustomGridTableItem; +begin + with CheckListBox.Items do + begin + BeginUpdate; + try + for I := 0 to GridView.ItemCount - 1 do + begin + AItem := GridView.Items[I]; + if AItem.VisibleInQuickCustomizationPopup then + with Add do + begin + Checked := AItem.Visible; + ItemObject := AItem; + Text := AItem.GetAlternateCaption; + end; + end; + finally + EndUpdate; + end; + end; +end; + +function TcxCustomGridItemsCustomizationPopup.GetDropDownCount: Integer; +begin + Result := GridView.OptionsCustomize.ItemsQuickCustomizationMaxDropDownCount; +end; + +function TcxCustomGridItemsCustomizationPopup.SupportsItemMoving: Boolean; +begin + Result := GridView.OptionsCustomize.SupportsItemsQuickCustomizationReordering; +end; + +procedure TcxCustomGridItemsCustomizationPopup.ItemClicked(AItem: TObject; AChecked: Boolean); +begin + TcxCustomGridTableItem(AItem).Visible := AChecked; + GridView.Controller.DesignerModified; +end; + +function TcxCustomGridItemsCustomizationPopup.GetItemIndex(AItem: TObject): Integer; +begin + Result := TcxCustomGridTableItem(AItem).Index; +end; + +procedure TcxCustomGridItemsCustomizationPopup.SetItemIndex(AItem: TObject; + AIndex: Integer); +begin + if TcxCustomGridTableItem(AItem).Index < AIndex then + Dec(AIndex); + TcxCustomGridTableItem(AItem).Index := AIndex; + GridView.Controller.DesignerModified; +end; + +{ TcxGridEditingController } + +constructor TcxGridEditingController.Create(AController: TcxCustomGridTableController); +begin + inherited Create; + FController := AController; + FEditList := TcxInplaceEditList.Create; +end; + +destructor TcxGridEditingController.Destroy; +begin + StopEditShowingTimer; + FEditList.Free; + inherited; +end; + +function TcxGridEditingController.GetEditingProperties: TcxCustomEditProperties; +begin + if FEditingItem = nil then + Result := nil + else + Result := FEditingItem.GetPropertiesForEdit; +end; + +function TcxGridEditingController.GetGridView: TcxCustomGridTableView; +begin + Result := FController.GridView; +end; + +function TcxGridEditingController.GetIsEditing: Boolean; +begin + Result := FEditingItem <> nil; +end; + +procedure TcxGridEditingController.SetEditingItem(Value: TcxCustomGridTableItem); +begin + if FEditingItem <> Value then + begin + if FEditingItemSetting then Exit; + FEditingItemSetting := True; + try + if Value <> nil then + begin + if not Value.CanEdit or not GridView.DoEditing(Value) then Exit; + Value.FocusWithSelection; + end; + HideEdit(False); + FEditingItem := Value; + if IsEditing then + try + ShowEdit(Value); + if not FEditPreparing and (FEdit = nil) then + FEditingItem := nil; + except + FEditingItem := nil; + raise; + end; + finally + FEditingItemSetting := False; + end; + end; +end; + +procedure TcxGridEditingController.EditShowingTimerHandler(Sender: TObject); +begin + StopEditShowingTimer; + FEditShowingTimerItem.Editing := True; +end; + +procedure TcxGridEditingController.AfterViewInfoCalculate; +begin + if IsEditing and (not FIsEditPlaced or FEditingItem.EditPartVisible) then + begin + CancelEditUpdatePost; + if not FEditPreparing then + FEdit.Left := cxGridInvisibleCoordinate; + end; +end; + +procedure TcxGridEditingController.BeforeViewInfoCalculate; +begin + FIsEditPlaced := False; +end; + +procedure TcxGridEditingController.CancelEditUpdatePost; +begin + FEditUpdateNeeded := False; +end; + +function TcxGridEditingController.CanInitEditing: Boolean; +begin + Result := EditingItem.CanInitEditing; +end; + +function TcxGridEditingController.CanRemoveEditFocus: Boolean; +begin + Result := not (IsEditing and FEdit.IsFocused and not FEditHiding); +end; + +function TcxGridEditingController.CanUpdateEditValue: Boolean; +begin + Result := not GridView.IsPattern and + IsEditing and not FEditHiding and not FInitiatingEditing and not FEdit.IsPosting; +end; + +procedure TcxGridEditingController.CheckEdit; +begin + if IsEditing and (FEditingItem.FocusedCellViewInfo = nil) then + HideEdit(False) + else + ShowEdit; +end; + +procedure TcxGridEditingController.CheckEditUpdatePost; +begin + if FEditUpdateNeeded then DoUpdateEdit; +end; + +procedure TcxGridEditingController.DoEditChanged; +begin +end; + +procedure TcxGridEditingController.DoEditKeyDown(var Key: Word; Shift: TShiftState); +var + AModified: Boolean; +begin + GridView.DoEditKeyDown(FEditingItem, FEdit, Key, Shift); + case Key of + VK_RETURN: + begin + HideEdit(True); + if GridView.OptionsBehavior.GoToNextCellOnEnter then + begin + FController.BlockRecordKeyboardHandling := True; + try + FController.DoKeyDown(Key, Shift); + finally + FController.BlockRecordKeyboardHandling := False; + end; + ShowEdit; + end + else + Controller.CheckEdit; + Key := 0; + end; + VK_ESCAPE: + begin + AModified := FEdit.EditModified; + HideEdit(False); + Controller.CheckEdit; + if AModified then Key := 0; + end; + VK_DELETE: + if Shift = [ssCtrl] then + Controller.DoKeyDown(Key, Shift); + end; +end; + +procedure TcxGridEditingController.DoUpdateEdit; +begin + CancelEditUpdatePost; + if (FEditingItem <> nil) and (FEditingItem.FocusedCellViewInfo <> nil) and + not FEditingItem.EditPartVisible then + begin + with FEditingItem.FocusedCellViewInfo do + begin + if IsRectEmpty(Bounds) then Exit; + FEdit.BoundsRect := EditBounds; + InitStyle; + FEdit.Style := Style; + end; + GridView.DoInitEdit(FEditingItem, FEdit); + end; +end; + +function TcxGridEditingController.GetHideEditOnExit: Boolean; +begin + Result := True{ + not GridView.OptionsBehavior.AlwaysShowEditor or + GridView.Control.IsFocused}; +end; + +function TcxGridEditingController.GetHideEditOnFocusedRecordChange: Boolean; +begin + Result := not GridView.OptionsBehavior.AlwaysShowEditor or + (FEditingItem <> nil) and + (FEditingItem.HasCustomPropertiesHandler or FEditingItem.HasCustomPropertiesForEditHandler or + FEditingItem.ShowButtons(False) or + (esoAlwaysHotTrack in FEditingItem.GetProperties.GetSupportedOperations)) or + Assigned(GridView.OnEditing) or Assigned(GridView.OnInitEdit); +end; + +procedure TcxGridEditingController.InitEdit; +begin + with FEdit.InternalProperties do + begin + FPrevEditOnChange := OnChange; + FPrevEditOnEditValueChanged := OnEditValueChanged; + OnChange := nil; + OnEditValueChanged := nil; + end; + FEdit.InplaceParams.Position := FEditingItem.FocusedCellViewInfo.GetInplaceEditPosition; + FEdit.Parent := FController.Site; + UpdateEdit; + UpdateEditValue; + AssignEditEvents; + //GridView.DoInitEdit(FEditingItem, FEdit); +end; + +procedure TcxGridEditingController.UninitEdit; +begin + UnassignEditEvents; +end; + +procedure TcxGridEditingController.PostEditingData; +begin + GridView.DataController.PostEditingData; +end; + +procedure TcxGridEditingController.PostEditUpdate; +begin + FEditUpdateNeeded := True; +end; + +function TcxGridEditingController.PrepareEdit(AItem: TcxCustomGridTableItem; + AOnMouseEvent: Boolean): Boolean; +var + AProperties: TcxCustomEditProperties; + AAssignRepositoryItem: Boolean; +begin + Result := False; + try + FController.CancelCheckEditPost; + if FEditPreparing or FEditHiding or + (AItem = nil) or (Controller.FocusedRecord = nil) then Exit; + FEditPreparing := True; + try + if AItem.Editing and not FEditingItemSetting then + begin + Result := (FEdit <> nil) and + (FController.Site.Focused and not FEdit.IsFocused or AOnMouseEvent); + if Result then + FEditingItem.FocusedCellViewInfo.Invalidate(True); + Exit; + end; + Result := FController.Site.Focused; + if not Result then Exit; + + AItem.Editing := True; + Result := AItem.Editing; + if not Result then Exit; + + Result := not AItem.EditPartVisible; + if not Result then + begin + AItem.Editing := False; + Exit; + end; + + try + AProperties := EditingProperties; + if (AItem.Properties <> nil) and (AItem.RepositoryItem <> nil) and + (AProperties = AItem.RepositoryItem.Properties) then + begin + AProperties := AItem.Properties; + AAssignRepositoryItem := True; + end + else + AAssignRepositoryItem := False; + + GridView.PatternGridView.IgnorePropertiesChanges := True; + try + FEdit := FEditList.GetEdit(AProperties); + if AAssignRepositoryItem then + FEdit.RepositoryItem := AItem.RepositoryItem; + finally + GridView.PatternGridView.IgnorePropertiesChanges := False; + end; + except + AItem.Editing := False; + Result := False; + raise; + end; + + FEditingItem.FocusedCellViewInfo.Invalidate(True); + InitEdit; + finally + FEditPreparing := False; + end; + finally + if Result then GridView.TabStop := False; + end; +end; + +procedure TcxGridEditingController.UpdateEditValue; +var + AValue: TcxEditValue; +begin + if CanUpdateEditValue then + begin + FEdit.LockChangeEvents(True); + try + AValue := EditingItem.EditValue; + GridView.DoInitEditValue(EditingItem, Edit, AValue); + FEdit.EditValue := AValue; + finally + FEdit.LockChangeEvents(False, False); + end; + FEdit.SelectAll; + end; +end; + +procedure TcxGridEditingController.UpdateValue; +begin + if IsEditing and FEdit.EditModified then + begin + FEdit.ValidateEdit(True); + FEditingItem.EditValue := FEdit.EditValue; + if FEdit <> nil then + FEdit.ModifiedAfterEnter := False; + end; +end; + +procedure TcxGridEditingController.AssignEditEvents; +begin + with FEdit do + begin + OnAfterKeyDown := EditAfterKeyDown; + OnEditing := EditEditing; + OnPostEditValue := EditPostEditValue; + OnExit := EditExit; + OnFocusChanged := EditFocusChanged; + OnKeyDown := EditKeyDown; + OnKeyPress := EditKeyPress; + OnKeyUp := EditKeyUp; + InternalProperties.OnChange := EditChanged; + InternalProperties.OnEditValueChanged := EditValueChanged; + end; +end; + +procedure TcxGridEditingController.UnassignEditEvents; +begin + with FEdit do + begin + OnAfterKeyDown := nil; + OnEditing := nil; + OnPostEditValue := nil; + OnExit := nil; + OnFocusChanged := nil; + OnKeyDown := nil; + OnKeyPress := nil; + OnKeyUp := nil; + InternalProperties.OnChange := FPrevEditOnChange; + InternalProperties.OnEditValueChanged := FPrevEditOnEditValueChanged; + end; +end; + +procedure TcxGridEditingController.EditAfterKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if FController.IsKeyForController(Key, Shift) then + FController.DoKeyDown(Key, Shift); +end; + +procedure TcxGridEditingController.EditChanged(Sender: TObject); +begin + DoEditChanged; + if Assigned(FPrevEditOnChange) then FPrevEditOnChange(Sender); + GridView.DoEditChanged(FEditingItem); +end; + +procedure TcxGridEditingController.EditEditing(Sender: TObject; var CanEdit: Boolean); +begin + FInitiatingEditing := True; + try + CanEdit := CanInitEditing; + finally + FInitiatingEditing := False; + end; +end; + +procedure TcxGridEditingController.EditExit(Sender: TObject); +begin + if HideEditOnExit then + try + HideEdit(not FController.CancelEditingOnExit); + except + if IsEditing then + begin + FEdit.SetFocus; + FIsErrorOnEditExit := True; + end; + raise; + end; +end; + +procedure TcxGridEditingController.EditFocusChanged(Sender: TObject); +begin + TcxControlAccess(FController.Site).FocusChanged; +end; + +procedure TcxGridEditingController.EditKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if not (Key in [VK_CONTROL, VK_SHIFT, VK_MENU]) then + FController.MakeFocusedItemVisible; + DoEditKeyDown(Key, Shift); +end; + +procedure TcxGridEditingController.EditKeyPress(Sender: TObject; var Key: Char); +begin + GridView.DoEditKeyPress(FEditingItem, FEdit, Key); +end; + +procedure TcxGridEditingController.EditKeyUp(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + GridView.DoEditKeyUp(FEditingItem, FEdit, Key, Shift); +end; + +procedure TcxGridEditingController.EditPostEditValue(Sender: TObject); +begin + UpdateValue; +end; + +procedure TcxGridEditingController.EditValueChanged(Sender: TObject); +begin + if Assigned(FPrevEditOnEditValueChanged) then FPrevEditOnEditValueChanged(Sender); + GridView.DoEditValueChanged(FEditingItem); +end; + +procedure TcxGridEditingController.HideEdit(Accept: Boolean); +var + APrevAllowCheckEdit: Boolean; +begin + FController.CancelCheckEditPost; + CancelEditUpdatePost; + StopEditShowingTimer; + if FEditHiding or not IsEditing then Exit; + FEditHiding := True; + try + if Accept then + begin + if not FEdit.Deactivate then raise EAbort.Create(''); + PostEditingData; + FEdit.ActiveProperties.Update(FEditingItem.GetProperties(Controller.FocusedRecord)); + end; + EditingItem := nil; + if GridView.Focused then GridView.TabStop := True; + if FEdit <> nil then + begin + UninitEdit; + if FEdit.Focused and GridView.Focused then + begin + FEdit.EditModified := False; + if not GridView.IsDestroying then + begin + APrevAllowCheckEdit := FController.AllowCheckEdit; + FController.AllowCheckEdit := False; + try + FController.DoSetFocus(False); + finally + FController.AllowCheckEdit := APrevAllowCheckEdit; + end; + end; + end + else + Controller.InvalidateFocusedRecord; + FEdit.Parent := nil; + FEdit.RepositoryItem := nil; + FEdit := nil; + end; + FIsErrorOnEditExit := False; + finally + FEditHiding := False; + end; +end; + +procedure TcxGridEditingController.RemoveEdit(AProperties: TcxCustomEditProperties); +begin + //if EditingProperties = AProperties then + if IsEditing and (Edit = FEditList.FindEdit(AProperties)) then + EditingItem := nil; + FEditList.RemoveItem(AProperties); +end; + +procedure TcxGridEditingController.ShowEdit(AItem: TcxCustomGridTableItem = nil); +begin + if AItem = nil then AItem := FController.FocusedItem; + if PrepareEdit(AItem, False) then FEdit.Activate(AItem.FEditData); +end; + +procedure TcxGridEditingController.ShowEdit(AItem: TcxCustomGridTableItem; Key: Char); +begin + if PrepareEdit(AItem, False) then FEdit.ActivateByKey(Key, AItem.FEditData); +end; + +procedure TcxGridEditingController.ShowEdit(AItem: TcxCustomGridTableItem; + Shift: TShiftState; X, Y: Integer); +begin + if PrepareEdit(AItem, True) then FEdit.ActivateByMouse(Shift, X, Y, AItem.FEditData); +end; + +procedure TcxGridEditingController.UpdateEdit; +var + ACellViewInfo: TcxGridTableDataCellViewInfo; +begin + if FEdit = nil then Exit; + ACellViewInfo := FEditingItem.FocusedCellViewInfo; + if ACellViewInfo = nil then Exit; + with ACellViewInfo do + begin + if IsRectEmpty(Bounds) then Exit; + if not FInitiatingEditing and FEditPreparing then + DoUpdateEdit + else + PostEditUpdate; + end; + FIsEditPlaced := True; +end; + +procedure TcxGridEditingController.StartEditShowingTimer(AItem: TcxCustomGridTableItem); +begin + StopEditShowingTimer; + FEditShowingTimerItem := AItem; + FEditShowingTimer := TcxTimer.Create(nil); + with FEditShowingTimer do + begin + Interval := GetDblClickInterval; + OnTimer := EditShowingTimerHandler; + end; +end; + +procedure TcxGridEditingController.StopEditShowingTimer; +begin + FreeAndNil(FEditShowingTimer); +end; + +(*{ TcxCustomGridDragOpenInfo } + +function TcxCustomGridDragOpenInfo.Equals(AInfo: TcxCustomGridDragOpenInfo): Boolean; +begin + Result := ClassType = AInfo.ClassType; +end; +*) +{ TcxGridDragOpenInfoExpand } + +constructor TcxGridDragOpenInfoExpand.Create(AGridRecord: TcxCustomGridRecord); +begin + inherited Create; + GridRecord := AGridRecord; +end; + +function TcxGridDragOpenInfoExpand.Equals(AInfo: TcxCustomGridDragOpenInfo): Boolean; +begin + Result := inherited Equals(AInfo) and + (GridRecord = TcxGridDragOpenInfoExpand(AInfo).GridRecord); +end; + +procedure TcxGridDragOpenInfoExpand.Run; +begin + GridRecord.Expand(False); +end; + +{ TcxCustomGridTableController } + +constructor TcxCustomGridTableController.Create(AGridView: TcxCustomGridView); +begin + inherited; + FAllowAppendRecord := True; + FAllowCheckEdit := True; + FEditingController := GetEditingControllerClass.Create(Self); + FFocusOnRecordFocusing := True; +end; + +destructor TcxCustomGridTableController.Destroy; +begin + FFilterPopup.Free; + FFilterMRUItemsPopup.Free; + FItemsCustomizationPopup.Free; + CancelGridModeBufferCountUpdate; + FreeAndNil(FEditingController); + inherited; +end; + +function TcxCustomGridTableController.GetEditingItem: TcxCustomGridTableItem; +begin + Result := FEditingController.EditingItem; +end; + +function TcxCustomGridTableController.GetFilterMRUItemsPopup: TcxGridFilterMRUItemsPopup; +begin + if FFilterMRUItemsPopup = nil then + FFilterMRUItemsPopup := GetFilterMRUItemsPopupClass.Create(GridView); + Result := FFilterMRUItemsPopup; +end; + +function TcxCustomGridTableController.GetFilterPopup: TcxGridFilterPopup; +begin + if FFilterPopup = nil then + FFilterPopup := GetFilterPopupClass.Create(GridView); + Result := FFilterPopup; +end; + +function TcxCustomGridTableController.GetFocusedItemIndex: Integer; +begin + if FFocusedItem = nil then + Result := -1 + else + Result := FFocusedItem.VisibleIndex; +end; + +function TcxCustomGridTableController.GetFocusedRecordIndex: Integer; +begin + Result := DataController.GetFocusedRowIndex; +end; + +function TcxCustomGridTableController.GetGridView: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited GridView); +end; + +function TcxCustomGridTableController.GetIncSearchingItem: TcxCustomGridTableItem; +begin + if IsIncSearching then + Result := GridView.Items[DataController.Search.ItemIndex] + else + Result := nil; +end; + +function TcxCustomGridTableController.GetIncSearchingText: string; +begin + Result := DataController.Search.SearchText; +end; + +function TcxCustomGridTableController.GetIsEditing: Boolean; +begin + Result := FEditingController.IsEditing; +end; + +function TcxCustomGridTableController.GetIsIncSearching: Boolean; +begin + Result := DataController.Search.Searching; +end; + +function TcxCustomGridTableController.GetIsItemMoving: Boolean; +begin + Result := FMovingItem <> nil; +end; + +function TcxCustomGridTableController.GetItemsCustomizationPopup: TcxCustomGridItemsCustomizationPopup; +begin + if FItemsCustomizationPopup = nil then + FItemsCustomizationPopup := GetItemsCustomizationPopupClass.Create(GridView); + Result := FItemsCustomizationPopup; +end; + +function TcxCustomGridTableController.GetMasterController: TcxCustomGridTableController; +begin + if GridView.IsDetail then + Result := GridView.MasterGridView.Controller as TcxCustomGridTableController + else + Result := nil; +end; + +function TcxCustomGridTableController.GetMultiSelect: Boolean; +begin + Result := GridView.OptionsSelection.MultiSelect; +end; + +function TcxCustomGridTableController.GetNewItemRecordFocused: Boolean; +begin + Result := DataController.NewItemRowFocused; +end; + +function TcxCustomGridTableController.GetSelectedRecord(Index: Integer): TcxCustomGridRecord; +begin + Index := DataController.GetSelectedRowIndex(Index); + if Index = -1 then + Result := nil + else + Result := ViewData.Records[Index]; +end; + +function TcxCustomGridTableController.GetSelectedRecordCount: Integer; +begin + Result := DataController.GetSelectedCount; +end; + +function TcxCustomGridTableController.GetViewData: TcxCustomGridTableViewData; +begin + Result := TcxCustomGridTableViewData(inherited ViewData); +end; + +function TcxCustomGridTableController.GetViewInfo: TcxCustomGridTableViewInfo; +begin + Result := TcxCustomGridTableViewInfo(inherited ViewInfo); +end; + +procedure TcxCustomGridTableController.SetDragHighlightedRecord(Value: TcxCustomGridRecord); +var + APrevDragHighlightedRecord: TcxCustomGridRecord; +begin + if FDragHighlightedRecord <> Value then + begin + APrevDragHighlightedRecord := FDragHighlightedRecord; + FDragHighlightedRecord := Value; + if APrevDragHighlightedRecord <> nil then + APrevDragHighlightedRecord.Invalidate; + if FDragHighlightedRecord <> nil then + FDragHighlightedRecord.Invalidate; + end; +end; + +procedure TcxCustomGridTableController.SetEditingItem(Value: TcxCustomGridTableItem); +begin + FEditingController.EditingItem := Value; +end; + +procedure TcxCustomGridTableController.SetFocusedItem(Value: TcxCustomGridTableItem); +var + APrevFocusedItem: TcxCustomGridTableItem; +begin + if (Value <> nil) and not Value.CanFocus(FocusedRecord) then Exit; + if FFocusedItem <> Value then + begin + APrevFocusedItem := FFocusedItem; + if (FFocusedItem <> nil) and not FEditingController.FEditingItemSetting then + FEditingController.HideEdit(True); + FFocusedItem := Value; + FocusedItemChanged(APrevFocusedItem); + CheckEdit; + end + else + MakeFocusedItemVisible; +end; + +procedure TcxCustomGridTableController.SetFocusedItemIndex(Value: Integer); +begin + if (Value < -1) or (Value >= GridView.VisibleItemCount) then Exit; + if Value = -1 then + FocusedItem := nil + else + FocusedItem := GridView.VisibleItems[Value]; +end; + +procedure TcxCustomGridTableController.SetFocusedRecordIndex(Value: Integer); +var + AIndexesAreEqual: Boolean; +begin + if (0 <= Value) and (Value < ViewData.RecordCount) and + not ViewData.Records[Value].CanFocus then Exit; + AIndexesAreEqual := FocusedRecordIndex = Value; + if not DataController.ChangeFocusedRowIndex(Value) then Exit; + if FFocusOnRecordFocusing then + begin + if AIndexesAreEqual then MakeFocusedRecordVisible; + if FocusedRecord <> nil then GridView.Focused := True; + end; +end; + +procedure TcxCustomGridTableController.SetIncSearchingText(const Value: string); + + function GetItemIndex: Integer; + begin + if IsIncSearching then + Result := IncSearchingItem.Index + else + if ItemForIncSearching = nil then + Result := -1 + else + Result := ItemForIncSearching.Index; + end; + +begin + if (IncSearchingText <> Value) and (GetItemIndex <> -1) then + if Value = '' then + CancelIncSearching + else + DataController.Search.Locate(GetItemIndex, Value) +end; + +procedure TcxCustomGridTableController.SetInternalTopRecordIndex(Value: Integer); +var + ARecordCountDelta: Integer; + + //ft,lt: integer; + +begin + if FTopRecordIndex <> Value then + begin + + //ft:=gettickcount; + + ARecordCountDelta := Value - FTopRecordIndex; + FTopRecordIndex := Value; + ViewInfo.AllowCheckCoordinates := False; + try + if Value <> -1 then + if GridView.CanOffset(ARecordCountDelta) then + GridView.Offset(ARecordCountDelta, 0, 0) + else + if GridView.IsMaster then + GridView.SizeChanged(not GridView.IsDetail) + {begin + GridView.SizeChanged(True); + if GridView.IsDetail and (GridView.MasterGridRecord <> nil) and + (GridView.MasterGridRecord.ViewInfo <> nil) then + GridView.MasterGridRecord.ViewInfo.Recalculate; + end} + else + GridView.LayoutChanged; + finally + ViewInfo.AllowCheckCoordinates := True; + end; + GridView.DoTopRecordIndexChanged; + + {site.Update; + lt:=gettickcount; + application.MainForm.Caption := inttostr(lt-ft);} + + end; +end; + +procedure TcxCustomGridTableController.SetNewItemRecordFocused(Value: Boolean); +begin + DataController.NewItemRowFocused := Value; +end; + +procedure TcxCustomGridTableController.SetScrollDirection(Value: TcxDirection); +begin + if FScrollDirection <> Value then + begin + DestroyScrollTimer; + FScrollDirection := Value; + if FScrollDirection <> dirNone then + CreateScrollTimer; + end; +end; + +procedure TcxCustomGridTableController.SetTopRecordIndex(Value: Integer); +begin + CheckTopRecordIndex(Value); + InternalTopRecordIndex := Value; +end; + +procedure TcxCustomGridTableController.DragScrollTimerHandler(Sender: TObject); +begin + Site.ScrollContent(FDragScrollDirection); + Site.Update; +end; + +procedure TcxCustomGridTableController.GridModeBufferCountUpdateTimerHandler(Sender: TObject); +begin + CheckGridModeBufferCountUpdatePost; +end; + +procedure TcxCustomGridTableController.PullFocusingScrollingTimerHandler(Sender: TObject); +begin + DoPullFocusingScrolling(FPullFocusingScrollingDirection); + Site.Update; + SavePullFocusingPos; +end; + +procedure TcxCustomGridTableController.CreateScrollTimer; +begin + FScrollTimer := TcxTimer.Create(nil); + with FScrollTimer do + begin + Interval := GetScrollDataTimeInterval(FScrollDirection); + OnTimer := ScrollTimerHandler; + end; +end; + +procedure TcxCustomGridTableController.DestroyScrollTimer; +begin + FreeAndNil(FScrollTimer); +end; + +procedure TcxCustomGridTableController.ScrollTimerHandler(Sender: TObject); +var + AAccepted: Boolean; +begin + if CanScrollData(FScrollDirection) then + begin + if DragAndDropObject <> nil then + DragAndDropObject.BeforeScrolling; + ScrollData(FScrollDirection); + if DragAndDropObject <> nil then + begin + Site.Update; + DragAndDropObject.AfterScrolling; + TcxControlAccess(Site).DragAndDrop( + Site.ScreenToClient(Mouse.CursorPos), AAccepted); + end; + end; +end; + +procedure TcxCustomGridTableController.DoEnter; +begin + inherited; + PostCheckEdit; +end; + +procedure TcxCustomGridTableController.DoExit; +begin + if CancelEditingOnExit then + DataController.Cancel + else + DataController.PostEditingData; + inherited; +end; + +procedure TcxCustomGridTableController.AfterPaint; +begin + inherited; + ProcessCheckEditPost; +end; + +procedure TcxCustomGridTableController.BeforePaint; +begin + inherited; + FEditingController.CheckEditUpdatePost; +end; + +function TcxCustomGridTableController.CanFocusOnClick(X, Y: Integer): Boolean; +begin + Result := inherited CanFocusOnClick(X, Y); + if Result and Site.IsFocused and IsEditing and + (ViewInfo.GetHitTest(X, Y).HitTestCode = htNavigator) then + Result := False; +end; + +procedure TcxCustomGridTableController.DetailFocused(ADetail: TcxCustomGridView); +var + APrevFocusOnRecordFocusing: Boolean; +begin + APrevFocusOnRecordFocusing := FFocusOnRecordFocusing; + FFocusOnRecordFocusing := False; + try + inherited; + FocusedRecordIndex := ADetail.MasterGridRecordIndex; + finally + FFocusOnRecordFocusing := APrevFocusOnRecordFocusing; + end; +end; + +function TcxCustomGridTableController.MayFocus: Boolean; +begin + Result := inherited MayFocus and + ((Site <> nil) and not Site.IsFocused or not IsEditing or + not GridView.OptionsBehavior.AlwaysShowEditor and FEditingController.Edit.ValidateEdit(True)); +end; + +procedure TcxCustomGridTableController.RemoveFocus; +begin + inherited; + CheckFocusedRecordSelectionWhenExit(FocusedRecord); + InvalidateFocusedRecord; +end; + +procedure TcxCustomGridTableController.SetFocus(ANotifyMaster: Boolean); +begin + if not FEditingController.CanRemoveEditFocus then Exit; + inherited; + InvalidateFocusedRecord; + PostCheckEdit; +end; + +procedure TcxCustomGridTableController.AfterOffset; +begin + Site.PostMouseMove; + FEditingController.UpdateEdit; + FEditingController.AfterViewInfoCalculate; + UpdateScrollBars; +end; + +procedure TcxCustomGridTableController.BeforeKillFocus; +begin + FEditingController.HideEdit(not GridView.IsDestroying); + if not GridView.IsDestroying and DataController.IsEditing then + begin + GridView.DontMakeMasterRecordVisible := True; + try + DataController.CheckBrowseMode; + //DataController.Post; + finally + GridView.DontMakeMasterRecordVisible := False; + end; + end; + inherited; +end; + +procedure TcxCustomGridTableController.BeforeOffset; +begin + FEditingController.BeforeViewInfoCalculate; +end; + +function TcxCustomGridTableController.CanAppend(ACheckOptions: Boolean): Boolean; +begin + Result := AllowAppendRecord and (dceoAppend in DataController.EditOperations) and + (not ACheckOptions or GridView.OptionsData.Appending); +end; + +procedure TcxCustomGridTableController.CancelCheckEditPost; +begin + FCheckEditNeeded := False; +end; + +function TcxCustomGridTableController.CanDelete(ACheckOptions: Boolean): Boolean; +begin + Result := (dceoDelete in DataController.EditOperations) and + (not ACheckOptions or GridView.OptionsData.Deleting); +end; + +function TcxCustomGridTableController.CanEdit: Boolean; +begin + Result := (FocusedItem <> nil) and GridView.OptionsData.Editing and + ([dceoEdit, dceoShowEdit] * DataController.EditOperations = [dceoEdit, dceoShowEdit]); +end; + +function TcxCustomGridTableController.CanHScrollBarHide: Boolean; +begin + Result := not ViewInfo.NavigatorSiteViewInfo.Visible; +end; + +function TcxCustomGridTableController.CanInsert(ACheckOptions: Boolean): Boolean; +begin + Result := (dceoInsert in DataController.EditOperations) and + (not ACheckOptions or GridView.OptionsData.Inserting); +end; + +procedure TcxCustomGridTableController.CheckEdit; +begin + CancelCheckEditPost; + if FAllowCheckEdit and GridView.OptionsBehavior.AlwaysShowEditor then + if (GridView.Control <> nil) and TcxCustomGrid(GridView.Control).UpdateLocked then + PostCheckEdit + else + FEditingController.CheckEdit; +end; + +procedure TcxCustomGridTableController.CheckCoordinates; +begin + inherited; + TopRecordIndex := TopRecordIndex; +end; + +procedure TcxCustomGridTableController.CheckTopRecordIndex(var Value: Integer); + + function IsGridModeAndScrollable: Boolean; + begin + Result := DataController.IsGridMode and not (dceInsert in DataController.EditState) and + not IsCheckingCoordinates; + end; + +var + APrevAllowHideSite: Boolean; + AMaxValue: Integer; +begin + if FCheckingCoordinate then Exit; + FCheckingCoordinate := True; + APrevAllowHideSite := ViewInfo.AllowHideSite; + ViewInfo.AllowHideSite := False; + try + if Value < 0 then + begin + if IsGridModeAndScrollable and not DataController.IsBOF then + DataController.Scroll(Value); + Value := 0; + end; + if Value > ViewData.RecordCount - 1 then + begin + if DataController.IsGridMode and not DataController.IsEOF then + DataController.Scroll(Value - (ViewData.RecordCount - 1)); + Value := ViewData.RecordCount - 1; + end; + if (Value <= 0) or not DataController.IsGridMode and (Value = TopRecordIndex) and + (ViewInfo.VisibleRecordCount < ViewData.RecordCount - Value) then Exit; + AMaxValue := GetMaxTopRecordIndexValue; + if Value > AMaxValue then + begin + if IsGridModeAndScrollable and not DataController.IsEOF then + begin + DataController.Scroll(Value - AMaxValue); + AMaxValue := GetMaxTopRecordIndexValue; + end; + Value := AMaxValue; + end; + finally + ViewInfo.AllowHideSite := APrevAllowHideSite; + FCheckingCoordinate := False; + end; +end; + +function TcxCustomGridTableController.FindNextCustomItem(AFocusedItemIndex, AItemCount: Integer; + AGoForward, AGoOnCycle: Boolean; ACanFocus: TcxCustomGridTableCanItemFocus; + AData: TObject; var AItemIndex: Integer; out ACycleChanged: Boolean): Boolean; +var + AFromIndex: Integer; + + function GetFromIndex: Integer; + begin + if AFocusedItemIndex = -1 then + if AGoForward then + Result := 0 + else + if AGoOnCycle then + Result := AItemCount - 1 + else + Result := -1 + else + if AGoForward then + Result := AFocusedItemIndex + 1 + else + Result := AFocusedItemIndex - 1; + end; + + function CheckIndex(var AIndex: Integer): Boolean; + begin + Result := True; + if AGoForward then + if AIndex > AItemCount - 1 then + if AGoOnCycle then + begin + AIndex := 0; + ACycleChanged := True; + end + else + Result := False + else + else + if AIndex < 0 then + if AGoOnCycle then + begin + AIndex := AItemCount - 1; + ACycleChanged := True; + end + else + Result := False; + end; + + procedure GetNextIndex(var AIndex: Integer); + begin + if AGoForward then + Inc(AIndex) + else + Dec(AIndex); + end; + +begin + Result := False; + ACycleChanged := False; + if AItemCount = 0 then Exit; + AFromIndex := GetFromIndex; + AItemIndex := AFromIndex; + repeat + if not CheckIndex(AItemIndex) then Exit; + if (AItemIndex = AFocusedItemIndex) and not ACycleChanged then Exit; + Result := ACanFocus(GridView, AItemIndex, AData); + if Result or + ACycleChanged and ((AItemIndex = AFocusedItemIndex) or (AFocusedItemIndex = -1)) then Exit; + GetNextIndex(AItemIndex); + until (AItemIndex = AFromIndex) or (AItemIndex = -1) and (AFocusedItemIndex = -1); +end; + +procedure TcxCustomGridTableController.FocusedItemChanged(APrevFocusedItem: TcxCustomGridTableItem); +begin + if GridView.IsLoading or GridView.IsDestroying then Exit; + IsReadyForImmediateEditing := False; + CancelIncSearching; + MakeFocusedItemVisible; + if FocusedRecord <> nil then + begin + FocusedRecord.Invalidate(APrevFocusedItem); + FocusedRecord.Invalidate(FocusedItem); + end; + if (APrevFocusedItem = nil) or (FocusedItem = nil) then + GridView.RefreshNavigators; + GridView.FocusedItemChanged(APrevFocusedItem, FFocusedItem); +end; + +procedure TcxCustomGridTableController.FocusedRecordChanged(APrevFocusedRecordIndex, + AFocusedRecordIndex: Integer; ANewItemRecordFocusingChanged: Boolean); +begin + IsReadyForImmediateEditing := False; + with EditingController do + if HideEditOnFocusedRecordChange then HideEdit(True); + if not DataController.IsSelectionAnchorExist then + SetSelectionAnchor(AFocusedRecordIndex); + GridView.FocusedRecordChanged(APrevFocusedRecordIndex, AFocusedRecordIndex, ANewItemRecordFocusingChanged); +end; + +function TcxCustomGridTableController.GetCancelEditingOnExit: Boolean; +begin + Result := + GridView.OptionsData.CancelOnExit and + (DataController.EditState * [dceInsert, dceChanging, dceModified] = [dceInsert]); +end; + +function TcxCustomGridTableController.GetFilterMRUItemsPopupClass: TcxGridFilterMRUItemsPopupClass; +begin + Result := TcxGridFilterMRUItemsPopup; +end; + +function TcxCustomGridTableController.GetFilterPopupClass: TcxGridFilterPopupClass; +begin + Result := TcxGridFilterPopup; +end; + +function TcxCustomGridTableController.GetFocusedRecord: TcxCustomGridRecord; +begin + if (0 <= FocusedRecordIndex) and (FocusedRecordIndex < ViewData.RecordCount) then + Result := ViewData.Records[FocusedRecordIndex] + else + Result := nil; +end; + +function TcxCustomGridTableController.GetItemsCustomizationPopupClass: TcxCustomGridItemsCustomizationPopupClass; +begin + Result := TcxCustomGridItemsCustomizationPopup; +end; + +function TcxCustomGridTableController.GetMaxTopRecordIndexValue: Integer; +begin + Result := ViewData.RecordCount - + GetVisibleRecordCount(ViewData.RecordCount - 1, False); +end; + +function TcxCustomGridTableController.GetPatternObject(AObject: TPersistent): TPersistent; +begin + if AObject is TcxCustomGridTableItem then + Result := TcxCustomGridTableView(GridView.PatternGridView).FindItemByID(TcxCustomGridTableItem(AObject).ID) + else + Result := inherited GetPatternObject(AObject); +end; + +function TcxCustomGridTableController.GetScrollBarOffsetBegin: Integer; +begin + if DataController.IsGridMode then + Result := Ord(not DataController.IsBOF) + else + Result := 0; +end; + +function TcxCustomGridTableController.GetScrollBarOffsetEnd: Integer; +begin + if DataController.IsGridMode then + Result := Ord(not DataController.IsEOF) + else + Result := 0; +end; + +function TcxCustomGridTableController.GetScrollBarPos: Integer; +var + AIcxGridDataController: IcxGridDataController; +begin + if Supports(TObject(DataController), IcxGridDataController, AIcxGridDataController) then + Result := AIcxGridDataController.GetScrollBarPos + else + Result := -1; + if Result = -1 then + Result := ScrollBarOffsetBegin + TopRecordIndex; +end; + +function TcxCustomGridTableController.GetScrollBarRecordCount: Integer; +var + AIcxGridDataController: IcxGridDataController; +begin + if Supports(TObject(DataController), IcxGridDataController, AIcxGridDataController) then + Result := AIcxGridDataController.GetScrollBarRecordCount + else + Result := -1; + if Result = -1 then + Result := ViewData.RecordCount + ScrollBarOffsetBegin + ScrollBarOffsetEnd; +end; + +function TcxCustomGridTableController.GetVisibleRecordCount(AFirstRecordIndex: Integer; + ACalculateDown: Boolean = True): Integer; +var + AVisibleEqualHeightRecordCount: Integer; + AViewInfo: TcxCustomGridTableViewInfo; + + function CanCalculateVisibleEqualHeightRecordCount: Boolean; + begin + AVisibleEqualHeightRecordCount := ViewInfo.CalculateVisibleEqualHeightRecordCount; + Result := AVisibleEqualHeightRecordCount <> -1; + end; + +begin + if IsRectEmpty(ViewInfo.Bounds) then + Result := 0 + else + if GridView.IsEqualHeightRecords and CanCalculateVisibleEqualHeightRecordCount then + begin // -2-4 ms + Result := AVisibleEqualHeightRecordCount; + if ACalculateDown then + if AFirstRecordIndex + Result > ViewData.RecordCount then + Result := ViewData.RecordCount - AFirstRecordIndex + else + else + if AFirstRecordIndex - Result + 1 < 0 then + Result := AFirstRecordIndex + 1; + end + else + begin + ViewInfo.CalculateDown := ACalculateDown; + AViewInfo := TcxCustomGridTableViewInfo(GridView.CreateViewInfo); + try + AViewInfo.CalculateDown := ACalculateDown; + AViewInfo.FirstRecordIndex := AFirstRecordIndex; + AViewInfo.MainCalculate(ViewInfo.Bounds); + Result := AViewInfo.VisibleRecordCount; + finally + AViewInfo.Free; + ViewInfo.CalculateDown := True; + end; + end; +end; + +procedure TcxCustomGridTableController.PostCheckEdit; +begin + if FAllowCheckEdit then FCheckEditNeeded := True; +end; + +procedure TcxCustomGridTableController.ProcessCheckEditPost; +begin + if FCheckEditNeeded then CheckEdit; +end; + +procedure TcxCustomGridTableController.ScrollData(ADirection: TcxDirection); +begin +end; + +procedure TcxCustomGridTableController.SetFocusedRecord(Value: TcxCustomGridRecord); +begin + if Value = nil then + FocusedRecordIndex := -1 + else + FocusedRecordIndex := Value.Index; +end; + +procedure TcxCustomGridTableController.SetScrollBarPos(Value: Integer); +var + AIcxGridDataController: IcxGridDataController; +begin + if not Supports(TObject(DataController), IcxGridDataController, AIcxGridDataController) or + not AIcxGridDataController.SetScrollBarPos(Value) then + if DataController.IsGridMode then + TopRecordIndex := Value - ScrollBarOffsetBegin + else + InternalTopRecordIndex := Value; +end; + +procedure TcxCustomGridTableController.CancelGridModeBufferCountUpdate; +begin + FGridModeBufferCountUpdateNeeded := False; + FreeAndNil(FGridModeBufferCountUpdateTimer); +end; + +procedure TcxCustomGridTableController.CheckGridModeBufferCountUpdatePost; +begin + if FGridModeBufferCountUpdateNeeded and ViewInfo.Calculated then + begin + CancelGridModeBufferCountUpdate; + (DataController as IcxGridDataController).CheckGridModeBufferCount; + end; +end; + +procedure TcxCustomGridTableController.PostGridModeBufferCountUpdate; +begin + if DataController.IsGridMode and not FGridModeBufferCountUpdateNeeded then + begin + FGridModeBufferCountUpdateNeeded := True; + FGridModeBufferCountUpdateTimer := TcxTimer.Create(nil); + with FGridModeBufferCountUpdateTimer do + begin + Interval := 1; + OnTimer := GridModeBufferCountUpdateTimerHandler; + end; + end; +end; + +function TcxCustomGridTableController.CanScrollData(ADirection: TcxDirection): Boolean; +begin + Result := False; +end; + +function TcxCustomGridTableController.GetScrollDataTimeInterval(ADirection: TcxDirection): Integer; +begin + Result := ScrollTimeInterval; +end; + +function TcxCustomGridTableController.CanPostponeRecordSelection: Boolean; +begin + Result := not IsEditing; +end; + +function TcxCustomGridTableController.CanProcessMultiSelect(AIsKeyboard: Boolean): Boolean; +begin + Result := MultiSelect and (not AIsKeyboard or GridView.Focused); +end; + +function TcxCustomGridTableController.CanProcessMultiSelect(AHitTest: TcxCustomGridHitTest; + AShift: TShiftState): Boolean; +begin + Result := //not (ssDouble in AShift) and + CanProcessMultiSelect(False) and IsClickableRecordHitTest(AHitTest) and + (TcxGridRecordHitTest(AHitTest).GridRecord <> nil) and + TcxGridRecordHitTest(AHitTest).GridRecord.Focused; +end; + +function TcxCustomGridTableController.CanProcessMultiSelect(AKey: Word; + AShift: TShiftState; AFocusedRecordChanged: Boolean): Boolean; +begin + Result := CanProcessMultiSelect(True) and + IsKeyForMultiSelect(AKey, AShift, AFocusedRecordChanged); +end; + +procedure TcxCustomGridTableController.ChangeRecordSelection(ARecord: TcxCustomGridRecord; + Value: Boolean); +begin + if MultiSelect then + DataController.ChangeRowSelection(ARecord.Index, Value); +end; + +procedure TcxCustomGridTableController.CheckFocusedRecordSelectionWhenExit(ARecord: TcxCustomGridRecord); +begin + if GridView.OptionsSelection.UnselectFocusedRecordOnExit and + MultiSelect and (ARecord <> nil) and (SelectedRecordCount = 1) and ARecord.Selected then + ARecord.Selected := False; +end; + +procedure TcxCustomGridTableController.DoMouseNormalSelection(AHitTest: TcxCustomGridHitTest); +begin + DoNormalSelection; +end; + +procedure TcxCustomGridTableController.DoMouseRangeSelection(AClearSelection: Boolean = True; + AData: TObject = nil); +begin + DoRangeSelection(AClearSelection); +end; + +procedure TcxCustomGridTableController.DoNormalSelection; +begin + if (SelectedRecordCount = 1) and (SelectedRecords[0] = FocusedRecord) then + Exit; + BeginUpdate; + try + ClearSelection; + if FocusedRecord <> nil then + FocusedRecord.Selected := True; + finally + EndUpdate; + end; +end; + +procedure TcxCustomGridTableController.DoNormalSelectionWithAnchor(ASelect: Boolean = True); +begin + SetSelectionAnchor(FocusedRecordIndex); + if ASelect then DoNormalSelection; +end; + +procedure TcxCustomGridTableController.DoRangeSelection(AClearSelection: Boolean = True); +begin //!!! + if (FocusedRecordIndex <> -1) {and not (dceInsert in DataController.EditState) }then + DataController.SelectFromAnchor(FocusedRecordIndex, not AClearSelection); +end; + +procedure TcxCustomGridTableController.DoToggleRecordSelection; +begin + if FocusedRecord <> nil then + with FocusedRecord do + Selected := not Selected; +end; + +procedure TcxCustomGridTableController.FinishSelection; +begin + FIsRecordUnselecting := False; +end; + +procedure TcxCustomGridTableController.InvalidateFocusedRecord; +begin + if FocusedRecord <> nil then FocusedRecord.Invalidate; +end; + +procedure TcxCustomGridTableController.InvalidateSelection; +var + I: Integer; + ARecord: TcxCustomGridRecord; +begin + for I := 0 to SelectedRecordCount - 1 do + begin + ARecord := SelectedRecords[I]; + if ARecord <> nil then ARecord.Invalidate; + end; + InvalidateFocusedRecord; +end; + +function TcxCustomGridTableController.IsKeyForMultiSelect(AKey: Word; + AShift: TShiftState; AFocusedRecordChanged: Boolean): Boolean; +begin + Result := (AKey = VK_SPACE) or (AKey = VK_PRIOR) or (AKey = VK_NEXT) or + AFocusedRecordChanged and not (((AKey = VK_INSERT) or (AKey = Ord('C'))) and (AShift = [ssCtrl])); // for grid mode +end; + +function TcxCustomGridTableController.IsRecordSelected(ARecord: TcxCustomGridRecord): Boolean; +begin + Result := DataController.IsRowSelected(ARecord.Index); +end; + +procedure TcxCustomGridTableController.MultiSelectKeyDown(var Key: Word; Shift: TShiftState); +begin + if (Shift = [ssCtrl]) and (Key = VK_SPACE) then + begin + DoToggleRecordSelection; + FEatKeyPress := True; + end + else + if (ssShift in Shift) and (Key <> 0) then + DoRangeSelection + else + DoNormalSelectionWithAnchor(Shift <> [ssCtrl]); +end; + +procedure TcxCustomGridTableController.MultiSelectMouseDown(AHitTest: TcxCustomGridHitTest; + AShift: TShiftState); +var + APressedRecord: TcxCustomGridRecord; + ASelectionShift: TShiftState; + + procedure AssignSelectionAnchor; + begin + if (ASelectionShift = []) or (ASelectionShift = [ssCtrl]) then + SetSelectionAnchor(APressedRecord.Index); + end; + + function MustPostponeDoing: Boolean; + begin + Result := CanPostponeRecordSelection and + APressedRecord.Selected and not (ssDouble in AShift); + end; + + procedure PostponeDoing; + begin + FIsRecordUnselecting := True; + FUnselectingRecordIndex := APressedRecord.Index; + end; + + procedure ProcessRecordSelectionToggling; + begin + if MustPostponeDoing then + PostponeDoing + else + DoToggleRecordSelection; + end; + + procedure ProcessNormalSelection; + begin + if MustPostponeDoing then + PostponeDoing + else + DoMouseNormalSelection(AHitTest); + end; + +begin + APressedRecord := TcxGridRecordHitTest(AHitTest).GridRecord; + ASelectionShift := AShift - [ssLeft, ssRight, ssMiddle, ssDouble]; + AssignSelectionAnchor; + if (ASelectionShift = [ssCtrl]) and SupportsRecordSelectionToggling then + ProcessRecordSelectionToggling + else + if (ASelectionShift = [ssShift]) or (ASelectionShift = [ssCtrl, ssShift]) then + DoMouseRangeSelection(not (ssCtrl in AShift) or not SupportsAdditiveSelection, AHitTest) + else + ProcessNormalSelection; +end; + +procedure TcxCustomGridTableController.MultiSelectMouseUp(AHitTest: TcxCustomGridHitTest; + AShift: TShiftState); +var + ASelectionShift: TShiftState; +begin + if FIsRecordUnselecting and (FUnselectingRecordIndex <> -1) and + (FUnselectingRecordIndex = TcxGridRecordHitTest(AHitTest).GridRecord.Index) then + begin + ASelectionShift := AShift - [ssLeft, ssRight, ssMiddle, ssDouble]; + if (ASelectionShift = [ssCtrl]) and SupportsRecordSelectionToggling then + DoToggleRecordSelection + else + DoNormalSelection; + end; +end; + +procedure TcxCustomGridTableController.SelectFocusedRecord; +begin + if CanProcessMultiSelect(True) then + DoNormalSelectionWithAnchor; +end; + +procedure TcxCustomGridTableController.SetSelectionAnchor(AGridRecordIndex: Integer); +begin + if AGridRecordIndex <> -1 then + DataController.SetSelectionAnchor(AGridRecordIndex); +end; + +function TcxCustomGridTableController.SupportsAdditiveSelection: Boolean; +begin + Result := True; +end; + +function TcxCustomGridTableController.SupportsRecordSelectionToggling: Boolean; +begin + Result := True; +end; + +function TcxCustomGridTableController.CanFocusNextItem(AFocusedItemIndex, ANextItemIndex: Integer; + AGoForward, AGoOnCycle, AGoToNextRecordOnCycle: Boolean): Boolean; +begin + Result := ANextItemIndex <> -1; +end; + +function TcxCustomGridTableController.FocusedRecordHasCells(ACheckCellSelectionAbility: Boolean): Boolean; +begin + Result := (FocusedRecord <> nil) and FocusedRecord.HasCells and + (not ACheckCellSelectionAbility or FocusedRecord.CanFocusCells); +end; + +procedure TcxCustomGridTableController.FocusNextPage(ASyncSelection: Boolean); +begin + MakeFocusedRecordVisible; + if FocusedRecordIndex = TopRecordIndex + ViewInfo.VisibleRecordCount - 1 then + ShowNextPage; + FocusRecord(TopRecordIndex + ViewInfo.VisibleRecordCount - 1, ASyncSelection); + Site.Update; +end; + +procedure TcxCustomGridTableController.FocusPrevPage(ASyncSelection: Boolean); +begin + MakeFocusedRecordVisible; + if FocusedRecordIndex = TopRecordIndex then + ShowPrevPage; + FocusRecord(TopRecordIndex, ASyncSelection); + Site.Update; +end; + +function TcxCustomGridTableController.IsKeyForController(AKey: Word; AShift: TShiftState): Boolean; +begin + Result := + (AKey = VK_TAB) or (AKey = VK_UP) or (AKey = VK_DOWN) or (AKey = VK_PRIOR) or + (AKey = VK_NEXT) or (AKey = VK_INSERT) or (AKey = VK_ESCAPE); + if not Result and GridView.OptionsBehavior.AlwaysShowEditor then + Result := (AKey = VK_LEFT) or (AKey = VK_RIGHT); +end; + +procedure TcxCustomGridTableController.ScrollPage(AForward: Boolean); +var + AIcxGridDataController: IcxGridDataController; +begin + if not Supports(TObject(DataController), IcxGridDataController, AIcxGridDataController) or + not AIcxGridDataController.DoScrollPage(AForward) then + if AForward then + ShowNextPage + else + ShowPrevPage; +end; + +procedure TcxCustomGridTableController.ScrollRecords(AForward: Boolean; ACount: Integer); +var + APrevAllowAppendRecord: Boolean; + AIcxGridDataController: IcxGridDataController; +begin + APrevAllowAppendRecord := AllowAppendRecord; + AllowAppendRecord := False; + try + if not Supports(TObject(DataController), IcxGridDataController, AIcxGridDataController) or + not AIcxGridDataController.DoScroll(AForward) then + if AForward then + TopRecordIndex := TopRecordIndex + ACount + else + TopRecordIndex := TopRecordIndex - ACount; + finally + AllowAppendRecord := APrevAllowAppendRecord; + end; +end; + +procedure TcxCustomGridTableController.ShowNextPage; +begin + TopRecordIndex := TopRecordIndex + ViewInfo.VisibleRecordCount; +end; + +procedure TcxCustomGridTableController.ShowPrevPage; +begin + TopRecordIndex := TopRecordIndex - ViewInfo.VisibleRecordCount; +end; + +procedure TcxCustomGridTableController.DoPullFocusing(AHitTest: TcxGridRecordHitTest); +begin + AHitTest.GridRecord.Focused := True; + if AHitTest is TcxGridRecordCellHitTest then + TcxGridRecordCellHitTest(AHitTest).Item.Focused := True; + if MultiSelect and IsPullFocusingPosChanged then + DoMouseRangeSelection(True, FPullFocusingOriginHitTest); +end; + +procedure TcxCustomGridTableController.DoPullFocusingScrolling(ADirection: TcxDirection); +var + APrevAllowAppendRecord: Boolean; +begin + if ADirection in [dirUp, dirDown] then + begin + case ADirection of + dirUp: + FocusedRecordIndex := TopRecordIndex; + dirDown: + FocusedRecordIndex := TopRecordIndex + ViewInfo.VisibleRecordCount - 1; + end; + APrevAllowAppendRecord := AllowAppendRecord; + AllowAppendRecord := False; + try + FocusNextRecord(FocusedRecordIndex, ADirection = dirDown, False, False, False); + finally + AllowAppendRecord := APrevAllowAppendRecord; + end; + end; + if MultiSelect and IsPullFocusingPosChanged then + DoMouseRangeSelection(True, FPullFocusingOriginHitTest); +end; + +function TcxCustomGridTableController.GetPullFocusingScrollingDirection(X, Y: Integer; + out ADirection: TcxDirection): Boolean; +var + R: TRect; +begin + Result := False; + R := ViewInfo.RecordsViewInfo.Bounds; + if IsRecordsScrollHorizontal and (X < R.Left) or + not IsRecordsScrollHorizontal and (Y < R.Top) then + begin + ADirection := dirUp; + Result := True; + end; + if IsRecordsScrollHorizontal and (X >= R.Right) or + not IsRecordsScrollHorizontal and (Y >= R.Bottom) then + begin + ADirection := dirDown; + Result := True; + end; +end; + +function TcxCustomGridTableController.IsPullFocusingPosChanged: Boolean; +begin + Result := (FPullFocusingRecordId <> DataController.GetRowId(FocusedRecordIndex)) or + (FPullFocusingItem <> FocusedItem); +end; + +procedure TcxCustomGridTableController.SavePullFocusingPos; +begin + FPullFocusingRecordId := DataController.GetRowId(FocusedRecordIndex); + FPullFocusingItem := FocusedItem; +end; + +procedure TcxCustomGridTableController.StartPullFocusing(AHitTest: TcxCustomGridHitTest); +begin + FIsPullFocusing := True; + FPullFocusingMousePos := ViewInfo.MousePos;// Point(-1, -1); + FPullFocusingOriginHitTest := AHitTest; + FPullFocusingRecordId := Null; +end; + +procedure TcxCustomGridTableController.StopPullFocusing; +begin + StopPullFocusingScrolling; + FPullFocusingRecordId := Null; + FPullFocusingItem := nil; + FIsPullFocusing := False; +end; + +procedure TcxCustomGridTableController.StartPullFocusingScrolling(ADirection: TcxDirection); +begin + FPullFocusingScrollingDirection := ADirection; + if FPullFocusingScrollingTimer <> nil then Exit; + FPullFocusingScrollingTimer := TcxTimer.Create(nil); + with FPullFocusingScrollingTimer do + begin + Interval := PullFocusingScrollingTimeInterval; + OnTimer := PullFocusingScrollingTimerHandler; + end; +end; + +procedure TcxCustomGridTableController.StopPullFocusingScrolling; +begin + FreeAndNil(FPullFocusingScrollingTimer); +end; + +function TcxCustomGridTableController.SupportsPullFocusing: Boolean; +begin + Result := GridView.OptionsBehavior.PullFocusing; +end; + +function TcxCustomGridTableController.GetDragScrollDirection(X, Y: Integer): TcxDirection; +const + ADirections: array[Boolean, Boolean] of TcxDirection = ((dirUp, dirDown), (dirLeft, dirRight)); +var + AHitTest: TcxCustomGridHitTest; + ARecord: TcxCustomGridRecord; +begin + Result := dirNone; + AHitTest := ViewInfo.GetHitTest(X, Y); + if AHitTest is TcxGridRecordHitTest then + begin + ARecord := TcxGridRecordHitTest(AHitTest).GridRecord; + if IsFirstRecordForDragScroll(ARecord) then + Result := ADirections[IsRecordsScrollHorizontal, False] + else + if IsLastRecordForDragScroll(ARecord) then + Result := ADirections[IsRecordsScrollHorizontal, True]; + end; +end; + +function TcxCustomGridTableController.GetDragScrollInterval: Integer; +begin + Result := 20; +end; + +function TcxCustomGridTableController.IsFirstRecordForDragScroll(ARecord: TcxCustomGridRecord): Boolean; +begin + Result := ARecord.Index = TopRecordIndex; +end; + +function TcxCustomGridTableController.IsLastRecordForDragScroll(ARecord: TcxCustomGridRecord): Boolean; +begin + Result := ARecord.ViewInfo.Index >= ViewInfo.RecordsViewInfo.VisibleCount - 1; +end; + +procedure TcxCustomGridTableController.ProcessDragFocusing(X, Y: Integer); +var + AHitTest: TcxCustomGridHitTest; +begin + AHitTest := ViewInfo.GetHitTest(X, Y); + if AHitTest is TcxGridRecordHitTest then + TcxGridRecordHitTest(AHitTest).GridRecord.Focused := True + else + if AHitTest is TcxCustomGridViewHitTest then + TcxCustomGridViewHitTest(AHitTest).GridView.Focused := True; +end; + +procedure TcxCustomGridTableController.StartDragScroll(ADirection: TcxDirection); +begin + FDragScrollDirection := ADirection; + if FDragScrollTimer <> nil then Exit; + FDragScrollTimer := TcxTimer.Create(nil); + with FDragScrollTimer do + begin + Interval := GetDragScrollInterval; + OnTimer := DragScrollTimerHandler; + end; +end; + +procedure TcxCustomGridTableController.StopDragScroll; +begin + FreeAndNil(FDragScrollTimer); +end; + +function TcxCustomGridTableController.IsDragScroll: Boolean; +begin + Result := FDragScrollTimer <> nil; +end; + +function TcxCustomGridTableController.GetDragOpenInfo(AHitTest: TcxCustomGridHitTest): TcxCustomGridDragOpenInfo; +begin + if AHitTest.HitTestCode = htExpandButton then + Result := TcxGridDragOpenInfoExpand.Create(TcxGridExpandButtonHitTest(AHitTest).GridRecord) + else + Result := nil; +end; + +function TcxCustomGridTableController.IsDragOpenHitTest(AHitTest: TcxCustomGridHitTest; + out ADragOpenInfo: TcxCustomGridDragOpenInfo): Boolean; +begin + ADragOpenInfo := GetDragOpenInfo(AHitTest); + Result := ADragOpenInfo <> nil; +end; + +function TcxCustomGridTableController.GetItemForIncSearching: TcxCustomGridTableItem; +begin + if GridView.OptionsSelection.CellSelect then + Result := FocusedItem + else + begin + Result := GridView.OptionsBehavior.IncSearchItem; + if (Result = nil) and (GridView.VisibleItemCount <> 0) then + Result := GridView.VisibleItems[0]; + end; +end; + +procedure TcxCustomGridTableController.IncSearchKeyDown(var Key: Word; Shift: TShiftState); +begin + case Key of + VK_ESCAPE: + begin + CancelIncSearching; + Key := 0; + end; + VK_BACK: + begin + IncSearchingText := Copy(IncSearchingText, 1, Length(IncSearchingText) - 1); + Key := 0; + end; + VK_UP, VK_DOWN: + if Shift = [ssCtrl] then + begin + DataController.Search.LocateNext(Key = VK_DOWN); + Key := 0; + end; + end; +end; + +function TcxCustomGridTableController.GetEditingControllerClass: TcxGridEditingControllerClass; +begin + Result := TcxGridEditingController; +end; + +procedure TcxCustomGridTableController.BeginDragAndDrop; +begin + FEditingController.HideEdit(True); + inherited; +end; + +procedure TcxCustomGridTableController.ControlFocusChanged; +begin + inherited; + InvalidateSelection; +end; + +procedure TcxCustomGridTableController.DoCancelMode; +begin + inherited; + ClickedCellViewInfo := nil; + StopPullFocusing; + FinishSelection; +end; + +procedure TcxCustomGridTableController.DoKeyDown(var Key: Word; Shift: TShiftState); +var + APrevTopRecordIndex, APrevFocusedRecordIndex: Integer; + AGridViewLink: TcxGridListenerLink; +begin + APrevTopRecordIndex := TopRecordIndex; + AGridViewLink := GridView.AddListenerLink; + try + try + if IsIncSearching then + begin + IncSearchKeyDown(Key, Shift); + if AGridViewLink.GridView = nil then Exit; + end; + APrevFocusedRecordIndex := FocusedRecordIndex; + inherited; + if AGridViewLink.GridView <> nil then + if CanProcessMultiSelect(Key, Shift, FocusedRecordIndex <> APrevFocusedRecordIndex) then + MultiSelectKeyDown(Key, Shift); + finally + if AGridViewLink.GridView <> nil then + begin + if TopRecordIndex <> APrevTopRecordIndex then + Site.Update; + end + else + Key := 0; + end; + finally + AGridViewLink.Free; + end; +end; + +procedure TcxCustomGridTableController.EndDragAndDrop(Accepted: Boolean); +begin + ScrollDirection := dirNone; + inherited; + CheckEdit; +end; + +function TcxCustomGridTableController.FindNextItem(AFocusedItemIndex: Integer; + AGoForward, AGoOnCycle: Boolean; out ACycleChanged: Boolean; + ARecord: TcxCustomGridRecord): Integer; +begin + if not FindNextCustomItem(AFocusedItemIndex, GridView.VisibleItemCount, + AGoForward, AGoOnCycle, @cxCustomGridTableControllerCanFocusItem, ARecord, Result, ACycleChanged) then + Result := -1; +end; + +function TcxCustomGridTableController.FindNextRecord(AFocusedRecordIndex: Integer; + AGoForward, AGoOnCycle: Boolean; out ACycleChanged: Boolean): Integer; +begin + if DataController.IsGridMode then + if AGoForward then + if not DataController.IsEOF and (AFocusedRecordIndex = ViewData.RecordCount - 1) then + begin + DataController.Scroll(1); + if not DataController.IsEOF then + Dec(AFocusedRecordIndex); + end + else + else + if (AFocusedRecordIndex = 0) and not DataController.IsBOF then + begin + DataController.Scroll(-1); + if not DataController.IsBOF then + Inc(AFocusedRecordIndex); + end; + if not FindNextCustomItem(AFocusedRecordIndex, ViewData.RecordCount, AGoForward, + AGoOnCycle, @cxCustomGridTableControllerCanFocusRecord, nil, Result, ACycleChanged) then + Result := -1; +end; + +function TcxCustomGridTableController.HasFilterMRUItemsPopup: Boolean; +begin + Result := FFilterMRUItemsPopup <> nil; +end; + +function TcxCustomGridTableController.HasFilterPopup: Boolean; +begin + Result := FFilterPopup <> nil; +end; + +function TcxCustomGridTableController.HasFocusedControls: Boolean; +begin + Result := inherited HasFocusedControls or + {IsEditing}(FEditingController.Edit <> nil) and FEditingController.Edit.IsFocused; +end; + +function TcxCustomGridTableController.HasItemsCustomizationPopup: Boolean; +begin + Result := FItemsCustomizationPopup <> nil; +end; + +function TcxCustomGridTableController.IsClickableRecordHitTest(AHitTest: TcxCustomGridHitTest): Boolean; +begin + Result := (AHitTest is TcxGridRecordHitTest) and TcxGridRecordHitTest(AHitTest).CanClick; +end; + +function TcxCustomGridTableController.IsDataFullyVisible(AIsCallFromMaster: Boolean = False): Boolean; +begin + Result := ViewInfo.VisibleRecordCount = ViewData.RecordCount; +end; + +procedure TcxCustomGridTableController.KeyDown(var Key: Word; Shift: TShiftState); +var + ARemoveFocus: Boolean; +begin + inherited; + if not FBlockRecordKeyboardHandling and (FocusedRecord <> nil) then + FocusedRecord.KeyDown(Key, Shift); + case Key of + VK_INSERT: + if (Shift = []) and CanInsert(True) then + CreateNewRecord(False) + else + if (Shift = [ssCtrl]) and not IsEditing then + GridView.CopyToClipboard(False); + VK_DELETE: + if ((Shift = []) or (Shift = [ssCtrl])) and CanDelete(True) then + begin + DeleteSelection; + Key := 0; + end; + VK_ESCAPE: + if DataController.IsEditing then + begin + DataController.Cancel; + if not DataController.IsEditing and MultiSelect and (FocusedRecord <> nil) then + FocusedRecord.Selected := True; + Key := 0; + end; + VK_RETURN, VK_TAB: + if (Key = VK_RETURN) and GridView.OptionsBehavior.GoToNextCellOnEnter or + (Key = VK_TAB) and GridView.OptionsBehavior.FocusCellOnTab then + begin + ARemoveFocus := False; + if Shift + [ssShift] = [ssShift] then + if FocusNextCell(Shift = [], False) or (Key = VK_RETURN) then + Key := 0 + else + ARemoveFocus := not EditingController.IsEditing + else + ARemoveFocus := (Key = VK_TAB) and (Shift + [ssShift, ssCtrl] = [ssShift, ssCtrl]); + if ARemoveFocus then + TcxCustomGrid(GridView.Control).RemoveFocus(not (ssShift in Shift)); + end; + VK_PRIOR: + FocusPrevPage(False); + VK_NEXT: + FocusNextPage(False); + Ord('A'): + if Shift = [ssCtrl] then SelectAll; + Ord('C'): + if (Shift = [ssCtrl]) and not IsEditing then + GridView.CopyToClipboard(False); + end; +end; + +procedure TcxCustomGridTableController.KeyPress(var Key: Char); +begin + inherited; + if FEatKeyPress then + begin + FEatKeyPress := False; + Exit; + end; + // inc search + if ((Key) in IncSearchStartChars) and + (ItemForIncSearching <> nil) and ItemForIncSearching.CanIncSearch and + not DataController.IsEditing then + begin + if Key <> #8 then + IncSearchingText := IncSearchingText + Key; + Key := #0; + end; + // editing + if ((Key) in EditStartChars) and + (FocusedRecord <> nil) and FocusedRecord.HasCells and (FocusedItem <> nil) then + begin + EditingController.ShowEdit(FocusedItem, Key); + Key := #0; + end; +end; + +procedure TcxCustomGridTableController.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +var + AHitTest: TcxCustomGridHitTest; + AGridViewLink: TcxGridListenerLink; +begin + FEditingController.StopEditShowingTimer; + AHitTest := ViewInfo.GetHitTest(X, Y); + AGridViewLink := GridView.AddListenerLink; + try + try + inherited; + finally + //AHitTest := ViewInfo.GetHitTest(X, Y); + if AGridViewLink.GridView <> nil then + begin + if not (AHitTest is TcxCustomGridViewHitTest) or + (TcxCustomGridViewHitTest(AHitTest).GridView = AGridViewLink.GridView) then + begin + if CanProcessMultiSelect(AHitTest, Shift) then + MultiSelectMouseDown(AHitTest, Shift); + if (Shift = [ssLeft]) and IsClickableRecordHitTest(AHitTest) and + SupportsPullFocusing and Site.MouseCapture and (GridView.DragMode = dmManual) then + StartPullFocusing(AHitTest); + end; + end; + end; + finally + AGridViewLink.Free; + end; +end; + +procedure TcxCustomGridTableController.MouseMove(Shift: TShiftState; X, Y: Integer); +var + AHitTest: TcxCustomGridHitTest; + ADirection: TcxDirection; +begin + inherited; + if FIsPullFocusing then + begin + AHitTest := ViewInfo.GetHitTest(X, Y); + if (AHitTest is TcxGridRecordHitTest) and CanHandleHitTest(AHitTest) then + if (FPullFocusingMousePos.X <> X) or (FPullFocusingMousePos.Y <> Y) then + begin + StopPullFocusingScrolling; + DoPullFocusing(TcxGridRecordHitTest(AHitTest)); + SavePullFocusingPos; + Site.Update; + end + else + else + if GetPullFocusingScrollingDirection(X, Y, ADirection) then + StartPullFocusingScrolling(ADirection); + FPullFocusingMousePos := Point(X, Y); + end; +end; + +procedure TcxCustomGridTableController.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +var + AHitTest: TcxCustomGridHitTest; +begin + inherited; + ClickedCellViewInfo := nil; + StopPullFocusing; + AHitTest := ViewInfo.GetHitTest(X, Y); + if (Button = mbLeft) and CanProcessMultiSelect(AHitTest, Shift) then + MultiSelectMouseUp(AHitTest, Shift); + FinishSelection; +end; + +function TcxCustomGridTableController.ProcessDetailDialogChar(ADetail: TcxCustomGridView; + ACharCode: Word): Boolean; +var + ARecord: TcxCustomGridRecord; +begin + Result := inherited ProcessDetailDialogChar(ADetail, ACharCode); + if not Result then + begin + ARecord := ViewData.GetRecordByIndex(ADetail.MasterGridRecordIndex); + Result := (ARecord <> nil) and (ARecord.ViewInfo <> nil) and + ARecord.ViewInfo.ProcessDialogChar(ACharCode); + end; +end; + +function TcxCustomGridTableController.ProcessDialogChar(ACharCode: Word): Boolean; +begin + Result := + (FocusedRecord <> nil) and (FocusedRecord.ViewInfo <> nil) and + FocusedRecord.ViewInfo.ProcessDialogChar(ACharCode) or + inherited ProcessDialogChar(ACharCode); +end; + +function TcxCustomGridTableController.SupportsTabAccelerators(AGridRecord: TcxCustomGridRecord): Boolean; +begin + Result := AGridRecord.Focused; +end; + +procedure TcxCustomGridTableController.BeforeStartDrag; +begin + inherited; + if DataController.IsEditing then + if dceModified in DataController.EditState then + DataController.Post + else + DataController.Cancel; +end; + +function TcxCustomGridTableController.CanDrag(X, Y: Integer): Boolean; +var + AHitTest: TcxCustomGridHitTest; +begin + Result := inherited CanDrag(X, Y); + if Result then + begin + AHitTest := ViewInfo.GetHitTest(X, Y); + Result := IsClickableRecordHitTest(AHitTest); + end; +end; + +procedure TcxCustomGridTableController.DragDrop(Source: TObject; X, Y: Integer); +begin + if GridView.OptionsBehavior.DragFocusing = dfDragDrop then + ProcessDragFocusing(X, Y); + inherited; +end; + +procedure TcxCustomGridTableController.DragOver(Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + + procedure ProcessScrolling; + var + ADirection: TcxDirection; + begin + ADirection := GetDragScrollDirection(X, Y); + if (ADirection = dirNone) or (State = dsDragLeave) then + StopDragScroll + else + StartDragScroll(ADirection); + end; + + procedure ProcessOpening; + var + AHitTest: TcxCustomGridHitTest; + ADragOpenInfo: TcxCustomGridDragOpenInfo; + begin + AHitTest := ViewInfo.GetHitTest(X, Y); + if (State <> dsDragLeave) and IsDragOpenHitTest(AHitTest, ADragOpenInfo) then + TcxCustomGrid(Control).Controller.StartDragOpen(ADragOpenInfo) + else + TcxCustomGrid(Control).Controller.StopDragOpen; + end; + + procedure ProcessDragHighlighting; + var + AHitTest: TcxCustomGridHitTest; + begin + AHitTest := ViewInfo.GetHitTest(X, Y); + if (State <> dsDragLeave) and (AHitTest is TcxGridRecordHitTest) then + DragHighlightedRecord := TcxGridRecordHitTest(AHitTest).GridRecord + else + DragHighlightedRecord := nil; + end; + +begin + inherited; + if GridView.OptionsBehavior.DragScrolling then + ProcessScrolling; + if GridView.OptionsBehavior.DragOpening then + ProcessOpening; + if GridView.OptionsBehavior.DragHighlighting then + ProcessDragHighlighting; + if (State <> dsDragLeave) and (GridView.OptionsBehavior.DragFocusing = dfDragOver) then + ProcessDragFocusing(X, Y); +end; + +procedure TcxCustomGridTableController.DrawDragImage(ACanvas: TcxCanvas; R: TRect); +var + AParams: TcxViewParams; + + procedure DrawBorder(R: TRect); + var + I: Integer; + begin + for I := 1 to DragDropTextBorderSize do + begin + ACanvas.DrawFocusRect(R); + InflateRect(R, -1, -1); + end; + end; + + procedure DrawText(const R: TRect); + begin + with ACanvas do + begin + Font := AParams.Font; + Font.Color := AParams.TextColor; + Brush.Style := bsClear; + DrawText(FDragDropText, R, 0); + Brush.Style := bsSolid; + end; + end; + +begin + if FDragDropText = '' then Exit; + GetDragDropTextViewParams(AParams); + with ACanvas do + begin + Brush.Color := AParams.Color; + FillRect(R); + end; + Inc(R.Left, DragDropTextAreaOffset); + DrawBorder(R); + InflateRect(R, -DragDropTextIndent, -DragDropTextIndent); + DrawText(R); +end; + +procedure TcxCustomGridTableController.EndDrag(Target: TObject; X, Y: Integer); +begin + DragHighlightedRecord := nil; + TcxCustomGrid(Control).Controller.StopDragOpen; + StopDragScroll; + inherited; +end; + +function TcxCustomGridTableController.GetDragDropText(ADragObject: TDragObject): string; +begin + if GridView.OptionsBehavior.DragDropText then + Result := GridView.DoGetDragDropText(FocusedRecord, FocusedItem) + else + Result := ''; +end; + +procedure TcxCustomGridTableController.GetDragDropTextViewParams(out AParams: TcxViewParams); +begin + GridView.Styles.GetContentParams(nil, nil, AParams); +end; + +function TcxCustomGridTableController.GetDragImagesSize: TPoint; +var + AParams: TcxViewParams; + ACanvas: TcxCanvas; +begin + if FDragDropText = '' then + Result := Point(0, 0) + else + begin + GetDragDropTextViewParams(AParams); + ACanvas := ViewInfo.Canvas; + ACanvas.Font := AParams.Font; + Result := Point( + DragDropTextAreaOffset + DragDropTextIndent + ACanvas.TextWidth(FDragDropText) + DragDropTextIndent, + DragDropTextIndent + ACanvas.TextHeight(FDragDropText) + DragDropTextIndent); + end; +end; + +function TcxCustomGridTableController.HasDragImages: Boolean; +begin + Result := True; +end; + +procedure TcxCustomGridTableController.StartDrag(var DragObject: TDragObject); + + function GetCursor: TCursor; + begin + if SelectedRecordCount > 1 then + Result := crcxGridMultiDrag + else + Result := crcxGridDrag; + end; + +begin + inherited; + TControlAccess(Site).DragCursor := GetCursor; + FDragDropText := GetDragDropText(DragObject); +end; + +procedure TcxCustomGridTableController.CancelIncSearching; +begin + DataController.Search.Cancel; +end; + +function TcxCustomGridTableController.CheckEditing(var AFocusedRecordIndex: Integer; + AGoForward: Boolean): Boolean; +var + AGridViewLink: TcxGridListenerLink; +begin + Result := False; + //AGridView.BeginUpdate; - commented because of dialog calling in OnBeforePost + AGridViewLink := GridView.AddListenerLink; + try + try + if DataController.IsEditing then + begin + EditingController.UpdateValue; + if not (dceModified in DataController.EditState) then + begin + if DataController.EditState = [dceInsert] then + begin + Result := AGoForward xor DataController.IsEOF; + if Result then DataController.Cancel; + end; + Exit; + end; + DataController.Post; + if AGridViewLink.GridView = nil then Exit; + if AFocusedRecordIndex <> -1 then + AFocusedRecordIndex := FocusedRecordIndex; + end; + finally + if AGridViewLink.GridView = nil then + Result := True + else + begin + //AGridView.EndUpdate; + end; + end; + finally + AGridViewLink.Free; + end; +end; + +procedure TcxCustomGridTableController.CheckScrolling(const P: TPoint); +begin +end; + +procedure TcxCustomGridTableController.ClearSelection; +begin + DataController.ClearSelection; +end; + +procedure TcxCustomGridTableController.CreateNewRecord(AtEnd: Boolean); +var + AIsEditing: Boolean; +begin + GridView.Focused := True; + AIsEditing := IsEditing; + if AtEnd then + if CanAppend(False) then + DataController.Append + else + else + if CanInsert(False) then + begin + DataController.Insert; + if MultiSelect and (ViewData.EditingRecord <> nil) then + ViewData.EditingRecord.Selected := True; + end; + if (dceInsert in DataController.EditState) and + GridView.OptionsBehavior.FocusFirstCellOnNewRecord then + begin + FocusFirstAvailableItem; + if AIsEditing then + FEditingController.ShowEdit; + end; +end; + +procedure TcxCustomGridTableController.DeleteSelection; +var + AMultiSelect: Boolean; + + function GetConfirmationText: string; + begin + if AMultiSelect then + Result := cxGetResourceString(@scxGridDeletingSelectedConfirmationText) + else + Result := cxGetResourceString(@scxGridDeletingFocusedConfirmationText); + end; + +begin + if not CanDelete(False) then Exit; + AMultiSelect := MultiSelect and (SelectedRecordCount <> 0) and + ((SelectedRecordCount > 1) or (SelectedRecords[0] = nil) or + (FocusedRecordIndex <> SelectedRecords[0].Index)); + + if not GridView.OptionsData.DeletingConfirmation or + (MessageDlg(PChar(GetConfirmationText), mtConfirmation, + [mbOK, mbCancel], 0) = mrOk) + then + if AMultiSelect then + DataController.DeleteSelection + else + DataController.DeleteFocused; +end; + +function TcxCustomGridTableController.FocusFirstAvailableItem: Boolean; +begin + Result := FocusNextItem(-1, True, False, False); +end; + +function TcxCustomGridTableController.FocusNextCell(AGoForward: Boolean; + AProcessCellsOnly: Boolean = True; AAllowCellsCycle: Boolean = True): Boolean; +begin + if FocusedRecordHasCells(True) then + Result := FocusNextItem(FocusedItemIndex, AGoForward, False, + AAllowCellsCycle and GridView.OptionsBehavior.FocusCellOnCycle) + else + if AProcessCellsOnly or not GridView.OptionsBehavior.FocusCellOnCycle then + Result := False + else + begin + Result := FocusNextRecord(FocusedRecordIndex, AGoForward, False, False, False); + if FocusedRecordHasCells(True) then + FocusNextItem(-1, AGoForward, True, False); + end; +end; + +function TcxCustomGridTableController.FocusNextItem(AFocusedItemIndex: Integer; + AGoForward, AGoOnCycle, AGoToNextRecordOnCycle: Boolean): Boolean; +var + ANextItemIndex: Integer; + ACycleChanged: Boolean; +begin + ANextItemIndex := FindNextItem(AFocusedItemIndex, AGoForward, + AGoOnCycle or AGoToNextRecordOnCycle, ACycleChanged, FocusedRecord); + Result := CanFocusNextItem(AFocusedItemIndex, ANextItemIndex, AGoForward, + AGoOnCycle, AGoToNextRecordOnCycle); + if Result then + begin + if ACycleChanged and AGoToNextRecordOnCycle then + if FocusedRecord.IsNewItemRecord then + begin + DataController.Post; + if ViewData.NewItemRecord <> nil then + ViewData.NewItemRecord.Focused := True; + Result := True; + end + else + Result := FocusNextRecord(FocusedRecordIndex, AGoForward, False, False, False) and + FocusedRecordHasCells(True) + else + Result := True; + if Result then + GridView.VisibleItems[ANextItemIndex].Focused := True; + end; +end; + +function TcxCustomGridTableController.FocusNextRecord(AFocusedRecordIndex: Integer; + AGoForward, AGoOnCycle, AGoIntoDetail, AGoOutOfDetail: Boolean): Boolean; +var + AGridViewLink: TcxGridListenerLink; + APrevFocused, ACycleChanged: Boolean; + APrevFocusedRecord, ANextRecord, AChildRecord: TcxCustomGridRecord; + ANextRecordIndex: Integer; + + procedure CheckGridMode; + begin + if DataController.IsGridMode and (AFocusedRecordIndex = -1) then + if AGoForward then + DataController.GotoFirst + else + if AGoOnCycle then + DataController.GotoLast; + end; + + procedure ProcessMultiSelect; + var + AFocusedView: TcxCustomGridView; + begin + if GridView.Focused = APrevFocused then Exit; + CheckFocusedRecordSelectionWhenExit(APrevFocusedRecord); + AFocusedView := TcxCustomGrid(Control).FocusedView; + if AFocusedView is TcxCustomGridTableView then + TcxCustomGridTableView(AFocusedView).Controller.SelectFocusedRecord; + end; + +begin + Result := CheckEditing(AFocusedRecordIndex, AGoForward); + if Result then Exit; + AGridViewLink := GridView.AddListenerLink; + try + CheckGridMode; + APrevFocused := GridView.Focused; + APrevFocusedRecord := FocusedRecord; + try + if AGoForward and AGoIntoDetail and GridView.IsMaster and + (AFocusedRecordIndex <> -1) then + ANextRecord := ViewData.Records[AFocusedRecordIndex].GetFirstFocusableChild + else + ANextRecord := nil; + if ANextRecord = nil then + begin + ANextRecordIndex := FindNextRecord(AFocusedRecordIndex, AGoForward, + AGoOnCycle, ACycleChanged); + if ANextRecordIndex <> -1 then + begin + ANextRecord := ViewData.Records[ANextRecordIndex]; + if not AGoForward and AGoIntoDetail and GridView.IsMaster then + begin + AChildRecord := ANextRecord.GetLastFocusableChild(True); + if AChildRecord <> nil then + ANextRecord := AChildRecord; + end; + end + else + if AGoForward and CanAppend(True) and (DataController.EditState <> [dceInsert]) then + begin + CreateNewRecord(True); + Result := True; + Exit; + end + else + if GridView.IsDetail and AGoOutOfDetail then + if not AGoForward and GridView.MasterGridRecord.CanFocus then + ANextRecord := GridView.MasterGridRecord + else + begin + Result := not DataController.IsGridMode and + MasterController.FocusNextRecord(GridView.MasterGridRecordIndex, + AGoForward, AGoOnCycle, not AGoForward, True); + Exit; + end; + end; + Result := ANextRecord <> nil; + if Result then + ANextRecord.Focused := True; + finally + if (AGridViewLink.GridView <> nil) and Result then + begin + ProcessMultiSelect; + //Site.Update; + end; + end; + finally + AGridViewLink.Free; + end; +end; + +function TcxCustomGridTableController.FocusNextRecordWithSelection(AFocusedRecordIndex: Integer; + AGoForward, AGoOnCycle, AGoIntoDetail: Boolean; ASyncSelection: Boolean = True): Boolean; +begin + Result := FocusNextRecord(AFocusedRecordIndex, AGoForward, AGoOnCycle, + AGoIntoDetail, AGoIntoDetail); + if Result and ASyncSelection then + SelectFocusedRecord; +end; + +function TcxCustomGridTableController.FocusRecord(AFocusedRecordIndex: Integer; + ASyncSelection: Boolean): Boolean; +begin + FocusedRecordIndex := AFocusedRecordIndex; + Result := FocusedRecordIndex = AFocusedRecordIndex; + if Result and ASyncSelection then + SelectFocusedRecord; +end; + +procedure TcxCustomGridTableController.MakeFocusedItemVisible; +begin + MakeItemVisible(FocusedItem); +end; + +procedure TcxCustomGridTableController.MakeFocusedRecordVisible; +begin + if not IsFocusing then + MakeRecordVisible(FocusedRecord); +end; + +procedure TcxCustomGridTableController.MakeRecordVisible(ARecord: TcxCustomGridRecord); +var + AFocusedView: TcxCustomGridView; + AIndex, APrevTopRecordIndex: Integer; +begin + if (ARecord = nil) or (GridView.Control = nil) then Exit; + AFocusedView := TcxCustomGrid(GridView.Control).FocusedView; + if (AFocusedView is TcxCustomGridTableView) and + not GridView.Focused and AFocusedView.HasAsMaster(GridView) and + TcxCustomGridTableView(AFocusedView).DontMakeMasterRecordVisible then Exit; + AIndex := ARecord.Index; + if AIndex <> -1 then + begin + if AIndex < TopRecordIndex then InternalTopRecordIndex := AIndex; + if ViewInfo.VisibleRecordCount = 0 then + if AIndex > TopRecordIndex then + InternalTopRecordIndex := AIndex + else + else + begin + Site.LockScrollBars; + try + while AIndex >= TopRecordIndex + ViewInfo.VisibleRecordCount do + begin + APrevTopRecordIndex := TopRecordIndex; + InternalTopRecordIndex := AIndex - GetVisibleRecordCount(AIndex, False) + 1; + if TopRecordIndex = APrevTopRecordIndex then Break; + end; + finally + Site.UnlockScrollBars; + end; + end; + end; + GridView.MakeMasterGridRecordVisible; +end; + +procedure TcxCustomGridTableController.SelectAll; +begin + SelectAllRecords; +end; + +procedure TcxCustomGridTableController.SelectAllRecords; +begin + DataController.SelectAll; +end; + +function TcxCustomGridTableController.GoToFirst(ASyncSelection: Boolean = True): Boolean; +begin + Result := FocusNextRecordWithSelection(-1, True, False, False, ASyncSelection); +end; + +function TcxCustomGridTableController.GoToLast(AGoIntoDetail: Boolean; + ASyncSelection: Boolean = True): Boolean; +begin + Result := FocusNextRecordWithSelection(-1, False, True, AGoIntoDetail, ASyncSelection); +end; + +function TcxCustomGridTableController.GoToNext(AGoIntoDetail: Boolean; + ASyncSelection: Boolean = True): Boolean; +begin + Result := FocusNextRecordWithSelection(FocusedRecordIndex, True, False, + AGoIntoDetail, ASyncSelection); +end; + +function TcxCustomGridTableController.GoToPrev(AGoIntoDetail: Boolean; + ASyncSelection: Boolean = True): Boolean; +begin + Result := FocusNextRecordWithSelection(FocusedRecordIndex, False, False, + AGoIntoDetail, ASyncSelection); +end; + +function TcxCustomGridTableController.IsFinish: Boolean; +var + ACycleChanged: Boolean; +begin + if DataController.IsGridMode then + Result := DataController.IsEOF + else + Result := FindNextRecord(FocusedRecordIndex, True, False, ACycleChanged) = -1; +end; + +function TcxCustomGridTableController.IsStart: Boolean; +var + ACycleChanged: Boolean; +begin + if DataController.IsGridMode then + Result := DataController.IsBOF + else + Result := FindNextRecord(FocusedRecordIndex, False, False, ACycleChanged) = -1; +end; + +{ TcxCustomGridFilterButtonPainter } + +function TcxCustomGridFilterButtonPainter.GetViewInfo: TcxCustomGridFilterButtonViewInfo; +begin + Result := TcxCustomGridFilterButtonViewInfo(inherited ViewInfo); +end; + +function TcxCustomGridFilterButtonPainter.ExcludeFromClipRect: Boolean; +begin + Result := True; +end; + +{ TcxGridFilterCloseButtonPainter } + +procedure TcxGridFilterCloseButtonPainter.DrawContent; +begin + ViewInfo.LookAndFeelPainter.DrawFilterCloseButton(Canvas, ViewInfo.Bounds, + ViewInfo.ButtonState); +end; + +{ TcxGridFilterActivateButtonPainter } + +function TcxGridFilterActivateButtonPainter.GetViewInfo: TcxGridFilterActivateButtonViewInfo; +begin + Result := TcxGridFilterActivateButtonViewInfo(inherited ViewInfo); +end; + +procedure TcxGridFilterActivateButtonPainter.DrawContent; +begin + ViewInfo.LookAndFeelPainter.DrawFilterActivateButton(Canvas, ViewInfo.Bounds, + ViewInfo.ButtonState, ViewInfo.Checked); +end; + +{ TcxGridFilterDropDownButtonPainter } + +procedure TcxGridFilterDropDownButtonPainter.DrawContent; +begin + ViewInfo.LookAndFeelPainter.DrawFilterDropDownButton(Canvas, ViewInfo.Bounds, + ViewInfo.ButtonState, False); +end; + +{ TcxGridFilterCustomizeButtonPainter } + +procedure TcxGridFilterCustomizeButtonPainter.Paint; +begin + Canvas.Font := ViewInfo.Params.Font; + ViewInfo.LookAndFeelPainter.DrawButton(Canvas, ViewInfo.Bounds, ViewInfo.Text, + ViewInfo.ButtonState); +end; + +{ TcxGridFilterPainter } + +function TcxGridFilterPainter.GetViewInfo: TcxGridFilterViewInfo; +begin + Result := TcxGridFilterViewInfo(inherited ViewInfo); +end; + +procedure TcxGridFilterPainter.DrawBackground(const R: TRect); +begin + with ViewInfo do + LookAndFeelPainter.DrawFilterPanel(Canvas, R, Transparent, Params.Color, + BackgroundBitmap); +end; + +procedure TcxGridFilterPainter.DrawButtons; +var + I: Integer; +begin + with ViewInfo.ButtonsViewInfo do + for I := 0 to Count - 1 do + Items[I].Paint; +end; + +function TcxGridFilterPainter.ExcludeFromClipRect: Boolean; +begin + Result := True; +end; + +procedure TcxGridFilterPainter.Paint; +begin +// DrawButtons; - commented because of XP + inherited; + DrawButtons; +end; + +procedure TcxGridFilterPainter.PrepareCanvasForDrawText; +begin + inherited; + FTextWasUnderlined := False; + if ViewInfo.State in [gcsSelected, gcsPressed] then + with Canvas.Font do + if not (fsUnderline in Style) then + begin + Style := Style + [fsUnderline]; + FTextWasUnderlined := True; + end; +end; + +procedure TcxGridFilterPainter.UnprepareCanvasForDrawText; +begin + if FTextWasUnderlined then + with Canvas.Font do + Style := Style - [fsUnderline]; + inherited; +end; + +{ TcxGridTableDataCellPainter } + +function TcxGridTableDataCellPainter.GetViewInfo: TcxGridTableDataCellViewInfo; +begin + Result := TcxGridTableDataCellViewInfo(inherited ViewInfo); +end; + +procedure TcxGridTableDataCellPainter.DrawContent; +begin + if ViewInfo.Transparent and (ViewInfo.BackgroundBitmap <> nil) then + DrawBackground; + ViewInfo.EditViewInfo.Paint(Canvas); +end; + +procedure TcxGridTableDataCellPainter.DrawFocusRect; +begin + with ViewInfo do + if Focused and HasFocusRect then + GridViewInfo.Painter.DrawFocusRect(ContentBounds, GridView.OptionsSelection.HideFocusRectOnExit); +end; + +procedure TcxGridTableDataCellPainter.Paint; +begin + inherited; + DrawFocusRect; +end; + +{ TcxCustomGridRecordPainter } + +function TcxCustomGridRecordPainter.GetViewInfo: TcxCustomGridRecordViewInfo; +begin + Result := TcxCustomGridRecordViewInfo(inherited ViewInfo); +end; + +procedure TcxCustomGridRecordPainter.AfterPaint; +begin + DrawFocusRect; + if ViewInfo.GridRecord.Expandable and not DrawExpandButtonBeforePaint then + DrawExpandButton; + ViewInfo.GridViewInfo.Painter.ExcludeFromBackground(ViewInfo.Bounds); + inherited; +end; + +procedure TcxCustomGridRecordPainter.BeforePaint; +begin + inherited; + if ViewInfo.GridRecord.Expandable and DrawExpandButtonBeforePaint then + DrawExpandButton; + DrawBackground; +end; + +procedure TcxCustomGridRecordPainter.DrawBackground; +begin + if ViewInfo.Transparent then + DrawBackground(ViewInfo.BackgroundBitmapBounds); +end; + +procedure TcxCustomGridRecordPainter.DrawExpandButton; +var + AClipRegion: TcxRegion; +begin + AClipRegion := Canvas.GetClipRegion; + try + ViewInfo.GridViewInfo.LookAndFeelPainter.DrawExpandButton(Canvas, + ViewInfo.ExpandButtonBounds, ViewInfo.Expanded); + finally + Canvas.SetClipRegion(AClipRegion, roSet); // for speed + end; +end; + +function TcxCustomGridRecordPainter.DrawExpandButtonBeforePaint: Boolean; +begin + Result := False; // ViewInfo.GridViewInfo.LookAndFeelPainter.DrawExpandButtonFirst; - for speed +end; + +procedure TcxCustomGridRecordPainter.DrawFocusRect; +begin + with ViewInfo do + if Focused and HasFocusRect then + GridViewInfo.Painter.DrawFocusRect(FocusRectBounds, HideFocusRectOnExit); +end; + +procedure TcxCustomGridRecordPainter.Paint; +begin +end; + +{ TcxCustomGridRecordsPainter } + +constructor TcxCustomGridRecordsPainter.Create(ACanvas: TcxCanvas; + AViewInfo: TcxCustomGridRecordsViewInfo); +begin + inherited Create; + FCanvas := ACanvas; + FViewInfo := AViewInfo; +end; + +(*procedure TcxCustomGridRecordsPainter.BeforePaint; +begin {4} + with ViewInfo do //!!! cache bitmaps! + BackgroundBitmap := GetBackgroundBitmap; +end;*) + +procedure TcxCustomGridRecordsPainter.Paint; +var + I: Integer; +begin + with FViewInfo do + for I := 0 to Count - 1 do + with Items[I] do + if Calculated then Paint; +end; + +procedure TcxCustomGridRecordsPainter.MainPaint; +begin + //BeforePaint; + Paint; +end; + +{ TcxNavigatorSitePainter } + +function TcxNavigatorSitePainter.ExcludeFromClipRect: Boolean; +begin + Result := True; +end; + +{ TcxCustomGridTablePainter } + +function TcxCustomGridTablePainter.GetController: TcxCustomGridTableController; +begin + Result := TcxCustomGridTableController(inherited Controller); +end; + +function TcxCustomGridTablePainter.GetViewInfo: TcxCustomGridTableViewInfo; +begin + Result := TcxCustomGridTableViewInfo(inherited ViewInfo); +end; + +function TcxCustomGridTablePainter.CanOffset(AItemsOffset, DX, DY: Integer): Boolean; +begin + Result := not GridView.IsDesigning and // because of the DesignSelector + (ViewInfo.BackgroundBitmap = nil) and (ViewInfo.RecordsViewInfo.BackgroundBitmap = nil) and + not ViewInfo.NoDataInfoTextAreaVisible; +end; + +procedure TcxCustomGridTablePainter.DrawBackground; +begin + inherited; + if ViewInfo.NoDataInfoTextAreaVisible then + DrawInfoText; +end; + +procedure TcxCustomGridTablePainter.DrawFilterBar; +begin + ViewInfo.FilterViewInfo.Paint; +end; + +procedure TcxCustomGridTablePainter.DrawInfoText; +var + AParams: TcxViewParams; +begin + ViewInfo.GetNoDataInfoTextParams(AParams); + with Canvas do + begin + SetParams(AParams); + Brush.Style := bsClear; + DrawText(ViewInfo.NoDataInfoText, ViewInfo.NoDataInfoTextAreaBounds, + cxAlignCenter or cxWordBreak, True); + Brush.Style := bsSolid; + end; +end; + +procedure TcxCustomGridTablePainter.DrawNavigator; +begin + with ViewInfo do + if NavigatorSiteViewInfo.Visible then + begin + NavigatorViewInfo.Paint; + NavigatorSiteViewInfo.Paint; + end; +end; + +procedure TcxCustomGridTablePainter.DrawRecords; +begin + ViewInfo.RecordsViewInfo.Paint; +end; + +procedure TcxCustomGridTablePainter.Offset(AItemsOffset: Integer); +begin + GridView.ViewChanged; +end; + +procedure TcxCustomGridTablePainter.Offset(DX, DY: Integer); +begin + GridView.ViewChanged; +end; + +procedure TcxCustomGridTablePainter.PaintBefore; +begin + inherited; + DrawNavigator; +end; + +procedure TcxCustomGridTablePainter.PaintContent; +begin + inherited; + DrawRecords; +end; + +procedure TcxCustomGridTablePainter.DoOffset(AItemsOffset, DX, DY: Integer); +begin + if not Site.HandleAllocated then Exit; + if CanOffset(AItemsOffset, DX, DY) then + begin + Controller.BeforePaint; + try + if AItemsOffset = 0 then + Offset(DX, DY) + else + Offset(AItemsOffset); + finally + Controller.AfterPaint; + end; + end + else + GridView.ViewChanged; +end; + +procedure TcxCustomGridTablePainter.DrawFocusRect(const R: TRect; AHideFocusRect: Boolean); +begin + if ViewInfo.GridView.OptionsView.FocusRect then inherited; +end; + +{ TcxCustomGridPartViewInfo } + +constructor TcxCustomGridPartViewInfo.Create(AGridViewInfo: TcxCustomGridTableViewInfo); +begin + inherited Create(AGridViewInfo); + if IsPart then + GridViewInfo.AddPart(Self); +end; + +destructor TcxCustomGridPartViewInfo.Destroy; +begin + if IsPart then + GridViewInfo.RemovePart(Self); + inherited; +end; + +function TcxCustomGridPartViewInfo.GetGridView: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited GridView); +end; + +function TcxCustomGridPartViewInfo.GetGridViewInfo: TcxCustomGridTableViewInfo; +begin + Result := TcxCustomGridTableViewInfo(inherited GridViewInfo); +end; + +function TcxCustomGridPartViewInfo.GetIndex: Integer; +begin + Result := GridViewInfo.FParts.IndexOf(Self); +end; + +procedure TcxCustomGridPartViewInfo.SetIndex(Value: Integer); +begin + if Index <> Value then + GridViewInfo.FParts.Move(Index, Value); +end; + +function TcxCustomGridPartViewInfo.CalculateBounds: TRect; +begin + Result := GridViewInfo.CalculatePartBounds(Self); +end; + +procedure TcxCustomGridPartViewInfo.CalculateInvisible; +begin + FHeight := 0; + inherited Calculate(0, 0, 0, 0); +end; + +procedure TcxCustomGridPartViewInfo.CalculateVisible; +begin + FHeight := CalculateHeight; + with CalculateBounds do + Calculate(Left, Top, Right - Left, Bottom - Top); +end; + +function TcxCustomGridPartViewInfo.CustomDrawBackground(ACanvas: TcxCanvas): Boolean; +begin + Result := inherited CustomDrawBackground(ACanvas); + if not Result then + GridView.DoCustomDrawPartBackground(ACanvas, Self, Result); +end; + +{function TcxCustomGridPartViewInfo.GetHeight: Integer; +begin + Result := inherited GetHeight; + if Result = 0 then Result := FHeight; +end;} + +function TcxCustomGridPartViewInfo.GetIsPart: Boolean; +begin + Result := True; +end; + +function TcxCustomGridPartViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxCustomGridPartPainter; +end; + +function TcxCustomGridPartViewInfo.HasCustomDrawBackground: Boolean; +begin + Result := GridView.HasCustomDrawPartBackground; +end; + +procedure TcxCustomGridPartViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + inherited; + GridViewInfo.InitHitTest(AHitTest); +end; + +procedure TcxCustomGridPartViewInfo.MainCalculate; +begin + if Visible then + CalculateVisible + else + CalculateInvisible; +end; + +{ TcxCustomGridFilterButtonViewInfo } + +constructor TcxCustomGridFilterButtonViewInfo.Create(AContainer: TcxGridFilterButtonsViewInfo); +begin + inherited Create(AContainer.FilterViewInfo.GridViewInfo); + FContainer := AContainer; +end; + +function TcxCustomGridFilterButtonViewInfo.GetFilter: TcxDataFilterCriteria; +begin + Result := FContainer.FilterViewInfo.Filter; +end; + +function TcxCustomGridFilterButtonViewInfo.GetGridView: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited GridView); +end; + +function TcxCustomGridFilterButtonViewInfo.CaptureMouseOnPress: Boolean; +begin + Result := True; +end; + +function TcxCustomGridFilterButtonViewInfo.GetAlignment: TcxGridFilterButtonAlignment; +begin + Result := fbaLeft; +end; + +function TcxCustomGridFilterButtonViewInfo.GetCanvas: TcxCanvas; +begin + Result := FContainer.FilterViewInfo.Canvas; +end; + +function TcxCustomGridFilterButtonViewInfo.GetHotTrack: Boolean; +begin + Result := True; +end; + +function TcxCustomGridFilterButtonViewInfo.GetVisible: Boolean; +begin + Result := not Filter.IsEmpty; +end; + +{ TcxGridFilterCloseButtonViewInfo } + +function TcxGridFilterCloseButtonViewInfo.CalculateHeight: Integer; +begin + Result := LookAndFeelPainter.FilterCloseButtonSize.Y; +end; + +function TcxGridFilterCloseButtonViewInfo.CalculateWidth: Integer; +begin + Result := LookAndFeelPainter.FilterCloseButtonSize.X; +end; + +procedure TcxGridFilterCloseButtonViewInfo.Click; +begin + inherited; + Filter.Clear; +end; + +function TcxGridFilterCloseButtonViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridFilterCloseButtonHitTest; +end; + +function TcxGridFilterCloseButtonViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridFilterCloseButtonPainter; +end; + +{ TcxGridFilterActivateButtonViewInfo } + +function TcxGridFilterActivateButtonViewInfo.GetChecked: Boolean; +begin + Result := Filter.Active; +end; + +function TcxGridFilterActivateButtonViewInfo.CalculateHeight: Integer; +begin + Result := LookAndFeelPainter.FilterActivateButtonSize.Y; +end; + +function TcxGridFilterActivateButtonViewInfo.CalculateWidth: Integer; +begin + Result := LookAndFeelPainter.FilterActivateButtonSize.X; +end; + +procedure TcxGridFilterActivateButtonViewInfo.Click; +begin + inherited; + with Filter do + Active := not Active; +end; + +function TcxGridFilterActivateButtonViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridFilterActivateButtonHitTest; +end; + +function TcxGridFilterActivateButtonViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridFilterActivateButtonPainter; +end; + +{ TcxGridFilterDropDownButtonViewInfo } + +function TcxGridFilterDropDownButtonViewInfo.GetDropDownWindowValue: TcxGridFilterMRUItemsPopup; +begin + Result := TcxGridFilterMRUItemsPopup(inherited DropDownWindow); +end; + +procedure TcxGridFilterDropDownButtonViewInfo.BeforeStateChange; +begin + inherited; + if State = gcsPressed then + Container.FilterViewInfo.State := gcsNone; +end; + +function TcxGridFilterDropDownButtonViewInfo.CalculateHeight: Integer; +begin + Result := LookAndFeelPainter.FilterCloseButtonSize.Y; +end; + +function TcxGridFilterDropDownButtonViewInfo.CalculateWidth: Integer; +begin + Result := LookAndFeelPainter.FilterCloseButtonSize.X; +end; + +function TcxGridFilterDropDownButtonViewInfo.CaptureMouseOnPress: Boolean; +begin + Result := False; +end; + +function TcxGridFilterDropDownButtonViewInfo.GetAlignment: TcxGridFilterButtonAlignment; +begin + Result := fbaRight; +end; + +function TcxGridFilterDropDownButtonViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridFilterDropDownButtonHitTest; +end; + +function TcxGridFilterDropDownButtonViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridFilterDropDownButtonPainter; +end; + +function TcxGridFilterDropDownButtonViewInfo.GetVisible: Boolean; +begin + Result := GridView.Filtering.IsMRUItemsListAvailable; +end; + +function TcxGridFilterDropDownButtonViewInfo.DropDownWindowExists: Boolean; +begin + Result := GridView.Controller.HasFilterMRUItemsPopup; +end; + +function TcxGridFilterDropDownButtonViewInfo.GetDropDownWindow: TcxCustomGridPopup; +begin + Result := GridView.Controller.FilterMRUItemsPopup; +end; + +function TcxGridFilterDropDownButtonViewInfo.GetDropDownWindowOwnerBounds: TRect; +begin + Result := Bounds; + Result.Left := Container.FilterViewInfo.TextAreaBounds.Left - + (DropDownWindow.BorderWidths[bLeft] + DropDownWindow.TextOffsetHorz); +end; + +procedure TcxGridFilterDropDownButtonViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + ALeftBound := Min(ALeftBound, Container.FilterViewInfo.TextBounds.Right + + cxGridCellTextOffset + FilterTextOffset + FilterButtonsOffset); + inherited; +end; + +{ TcxGridFilterCustomizeButtonViewInfo } + +function TcxGridFilterCustomizeButtonViewInfo.CalculateHeight: Integer; +begin + Result := BorderWidth[bTop] + BorderWidth[bBottom] + TextHeightWithOffset + + 2 * LookAndFeelPainter.ButtonTextOffset; +end; + +function TcxGridFilterCustomizeButtonViewInfo.CalculateWidth: Integer; +begin + Result := BorderWidth[bLeft] + BorderWidth[bRight] + TextWidthWithOffset + + 2 * LookAndFeelPainter.ButtonTextOffset; +end; + +procedure TcxGridFilterCustomizeButtonViewInfo.Click; +begin + inherited; + GridView.Filtering.RunCustomizeDialog; +end; + +function TcxGridFilterCustomizeButtonViewInfo.GetAlignment: TcxGridFilterButtonAlignment; +begin + Result := fbaRight; +end; + +function TcxGridFilterCustomizeButtonViewInfo.GetAlignmentHorz: TAlignment; +begin + Result := taCenter; +end; + +function TcxGridFilterCustomizeButtonViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + Result := vaCenter; +end; + +function TcxGridFilterCustomizeButtonViewInfo.GetBorders: TcxBorders; +begin + Result := [bLeft, bTop, bRight, bBottom]; +end; + +function TcxGridFilterCustomizeButtonViewInfo.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := LookAndFeelPainter.ButtonBorderSize; +end; + +function TcxGridFilterCustomizeButtonViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridFilterCustomizeButtonHitTest; +end; + +function TcxGridFilterCustomizeButtonViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridFilterCustomizeButtonPainter; +end; + +function TcxGridFilterCustomizeButtonViewInfo.GetText: string; +begin + Result := cxGetResourceString(@scxGridFilterCustomizeButtonCaption); +end; + +procedure TcxGridFilterCustomizeButtonViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + AParams.Font := Container.FilterViewInfo.Params.Font; +end; + +function TcxGridFilterCustomizeButtonViewInfo.GetVisible: Boolean; +begin + Result := GridView.FilterBox.CustomizeDialog; +end; + +{ TcxGridFilterButtonsViewInfo } + +constructor TcxGridFilterButtonsViewInfo.Create(AFilterViewInfo: TcxGridFilterViewInfo); +begin + inherited Create; + FFilterViewInfo := AFilterViewInfo; + FItems := TList.Create; + AddItems; +end; + +destructor TcxGridFilterButtonsViewInfo.Destroy; +begin + DestroyItems; + FItems.Free; + inherited; +end; + +function TcxGridFilterButtonsViewInfo.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxGridFilterButtonsViewInfo.GetGridView: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(FFilterViewInfo.GridView); +end; + +function TcxGridFilterButtonsViewInfo.GetHeight: Integer; +var + I, AItemHeight: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + if Items[I].Visible then + begin + AItemHeight := Items[I].CalculateHeight; + if Result < AItemHeight then Result := AItemHeight; + end; + if Result <> 0 then Inc(Result, 2 * FilterButtonsFirstOffset); +end; + +function TcxGridFilterButtonsViewInfo.GetItem(Index: Integer): TcxCustomGridFilterButtonViewInfo; +begin + Result := TcxCustomGridFilterButtonViewInfo(FItems[Index]); +end; + +function TcxGridFilterButtonsViewInfo.GetWidth(AAlignment: TcxGridFilterButtonAlignment): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + with Items[I] do + if Visible and (Alignment = AAlignment) then + Inc(Result, CalculateWidth + FilterButtonsOffset); + if Result <> 0 then + Inc(Result, 2 * FilterButtonsFirstOffset - FilterButtonsOffset); +end; + +function TcxGridFilterButtonsViewInfo.GetWidthLeftPart: Integer; +begin + Result := GetWidth(fbaLeft); +end; + +function TcxGridFilterButtonsViewInfo.GetWidthRightPart: Integer; +begin + Result := GetWidth(fbaRight); +end; + +procedure TcxGridFilterButtonsViewInfo.AddItems; +begin + AddItem(TcxGridFilterCloseButtonViewInfo); + AddItem(TcxGridFilterActivateButtonViewInfo); + AddItem(TcxGridFilterCustomizeButtonViewInfo); + FDropDownButtonViewInfo := AddItem(TcxGridFilterDropDownButtonViewInfo) as TcxGridFilterDropDownButtonViewInfo; +end; + +procedure TcxGridFilterButtonsViewInfo.DestroyItems; +var + I: Integer; +begin + for I := 0 to Count - 1 do Items[I].Free; + FItems.Clear; + FDropDownButtonViewInfo := nil; +end; + +function TcxGridFilterButtonsViewInfo.AddItem(AItemClass: TcxCustomGridFilterButtonViewInfoClass): TcxCustomGridFilterButtonViewInfo; +begin + Result := AItemClass.Create(Self); + FItems.Add(Result); +end; + +procedure TcxGridFilterButtonsViewInfo.Calculate(const ABounds: TRect); +var + ALeftMargin, ARightMargin, ALeft, I: Integer; +begin + ALeftMargin := ABounds.Left + FilterButtonsFirstOffset; + ARightMargin := ABounds.Right - FilterButtonsFirstOffset; + for I := 0 to Count - 1 do + with Items[I], ABounds do + if Visible then + begin + if Alignment = fbaLeft then + ALeft := ALeftMargin + else + ALeft := ARightMargin - CalculateWidth; + Calculate(ALeft, MulDiv(Top + Bottom - CalculateHeight, 1, 2)); + if Alignment = fbaLeft then + ALeftMargin := Items[I].Bounds.Right + FilterButtonsOffset + else + ARightMargin := Items[I].Bounds.Left - FilterButtonsOffset; + end; +end; + +function TcxGridFilterButtonsViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +var + I: Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + begin + Result := Items[I].GetHitTest(P); + if Result <> nil then Break; + end; +end; + +{ TcxGridFilterViewInfo } + +constructor TcxGridFilterViewInfo.Create(AGridViewInfo: TcxCustomGridTableViewInfo); +begin + inherited; + CreateButtonsViewInfo; +end; + +destructor TcxGridFilterViewInfo.Destroy; +begin + DestroyButtonsViewInfo; + inherited; +end; + +function TcxGridFilterViewInfo.GetFilter: TcxDataFilterCriteria; +begin + Result := GridView.DataController.Filter; +end; + +function TcxGridFilterViewInfo.GetFiltering: TcxCustomGridTableFiltering; +begin + Result := TcxCustomGridTableView(GridView).Filtering; +end; + +procedure TcxGridFilterViewInfo.CreateButtonsViewInfo; +begin + FButtonsViewInfo := GetButtonsViewInfoClass.Create(Self); +end; + +procedure TcxGridFilterViewInfo.DestroyButtonsViewInfo; +begin + FreeAndNil(FButtonsViewInfo); +end; + +function TcxGridFilterViewInfo.CalculateButtonsViewInfoBounds: TRect; +begin + Result := Bounds; +end; + +function TcxGridFilterViewInfo.CalculateHeight: Integer; +var + AButtonsHeight: Integer; +begin + Result := FilterTextOffset + TextHeightWithOffset + FilterTextOffset; + AButtonsHeight := FButtonsViewInfo.Height; + if Result < AButtonsHeight then Result := AButtonsHeight; +end; + +function TcxGridFilterViewInfo.CalculateWidth: Integer; +begin + Result := GridViewInfo.ClientWidth; +end; + +function TcxGridFilterViewInfo.GetAlignment: TcxGridPartAlignment; +begin + Result := TcxGridPartAlignment(GridView.FilterBox.Position); +end; + +function TcxGridFilterViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + Result := vaCenter; +end; + +function TcxGridFilterViewInfo.GetBackgroundBitmap: TBitmap; +begin + Result := GridView.BackgroundBitmaps.GetBitmap(bbFilterBox); +end; + +function TcxGridFilterViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridFilterHitTest; +end; + +function TcxGridFilterViewInfo.GetHotTrack: Boolean; +begin + Result := Filtering.IsMRUItemsListAvailable; +end; + +function TcxGridFilterViewInfo.GetIsAutoWidth: Boolean; +begin + Result := True; +end; + +function TcxGridFilterViewInfo.GetIsCheck: Boolean; +begin + Result := True; +end; + +function TcxGridFilterViewInfo.GetIsScrollable: Boolean; +begin + Result := False; +end; + +function TcxGridFilterViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridFilterPainter; +end; + +function TcxGridFilterViewInfo.GetText: string; +begin + Result := Filter.FilterCaption; + if Result = '' then + Result := cxGetResourceString(@scxGridFilterIsEmpty); +end; + +function TcxGridFilterViewInfo.GetTextAreaBounds: TRect; +begin + Result := inherited GetTextAreaBounds; + Inc(Result.Left, FButtonsViewInfo.WidthLeftPart); + Dec(Result.Right, FButtonsViewInfo.WidthRightPart); + InflateRect(Result, -FilterTextOffset, 0); +end; + +procedure TcxGridFilterViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetViewParams(vsFilterBox, nil, nil, AParams); +end; + +function TcxGridFilterViewInfo.GetVisible: Boolean; +begin + Result := (GridView.FilterBox.Visible = fvAlways) or + (GridView.FilterBox.Visible = fvNonEmpty) and not Filter.IsEmpty; +end; + +function TcxGridFilterViewInfo.HasMouse(AHitTest: TcxCustomGridHitTest): Boolean; +begin + Result := inherited HasMouse(AHitTest) and PtInRect(TextBounds, AHitTest.Pos); +end; + +function TcxGridFilterViewInfo.InvalidateOnStateChange: Boolean; +begin + Result := False; +end; + +procedure TcxGridFilterViewInfo.StateChanged(APrevState: TcxGridCellState); +begin + if not IsDestroying then + GridView.ViewChanged(TextBounds); + inherited; + if State = gcsPressed then + FButtonsViewInfo.DropDownButtonViewInfo.State := gcsPressed; +end; + +function TcxGridFilterViewInfo.GetButtonsViewInfoClass: TcxGridFilterButtonsViewInfoClass; +begin + Result := TcxGridFilterButtonsViewInfo; +end; + +procedure TcxGridFilterViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + inherited; + FButtonsViewInfo.Calculate(CalculateButtonsViewInfoBounds); +end; + +function TcxGridFilterViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + Result := FButtonsViewInfo.GetHitTest(P); + if Result = nil then + Result := inherited GetHitTest(P); +end; + +{ TcxGridTableCellViewInfo } + +constructor TcxGridTableCellViewInfo.Create(ARecordViewInfo: TcxCustomGridRecordViewInfo); +begin + inherited Create(ARecordViewInfo.GridViewInfo); + FRecordViewInfo := ARecordViewInfo; +end; + +function TcxGridTableCellViewInfo.GetCacheItem: TcxCustomGridTableViewInfoCacheItem; +begin + Result := FRecordViewInfo.CacheItem; +end; + +function TcxGridTableCellViewInfo.GetController: TcxCustomGridTableController; +begin + Result := TcxCustomGridTableController(inherited Controller); +end; + +function TcxGridTableCellViewInfo.GetGridView: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited GridView); +end; + +function TcxGridTableCellViewInfo.GetGridRecord: TcxCustomGridRecord; +begin + Result := FRecordViewInfo.GridRecord; +end; + +function TcxGridTableCellViewInfo.GetSelected: Boolean; +begin + if not FSelectedCalculated then + begin + FSelected := CalculateSelected; + FSelectedCalculated := True; + end; + Result := FSelected; +end; + +function TcxGridTableCellViewInfo.GetGridViewInfo: TcxCustomGridTableViewInfo; +begin + Result := FRecordViewInfo.GridViewInfo; +end; + +function TcxGridTableCellViewInfo.CalculateSelected: Boolean; +begin + Result := GridView.DrawDataCellSelected(GridRecord, nil, True, Self); +end; + +function TcxGridTableCellViewInfo.GetAlwaysSelected: Boolean; +begin + Result := False; +end; + +function TcxGridTableCellViewInfo.GetCanvas: TcxCanvas; +begin + Result := GridViewInfo.Canvas; +end; + +function TcxGridTableCellViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridRecordHitTest; +end; + +function TcxGridTableCellViewInfo.GetTransparent: Boolean; +begin {4} + Result := FRecordViewInfo.GetCellTransparent(Self); +end; + +procedure TcxGridTableCellViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + inherited; + TcxGridRecordHitTest(AHitTest).GridRecord := GridRecord; +end; + +procedure TcxGridTableCellViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + FSelectedCalculated := False; + inherited; +end; + +function TcxGridTableCellViewInfo.CanDrawSelected: Boolean; +begin + Result := False; +end; + +function TcxGridTableCellViewInfo.MouseDown(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +var + AGridViewLink: TcxGridListenerLink; +begin + AGridViewLink := GridView.AddListenerLink; + try + GridViewInfo.AddActiveViewInfo(Self); + try + Result := FRecordViewInfo.MouseDown(AHitTest, AButton, AShift); + if Result and TcxCustomGridTableView(AGridViewLink.GridView).ViewInfo.IsViewInfoActive(Self) then + inherited MouseDown(AHitTest, AButton, AShift); + finally + if AGridViewLink.GridView <> nil then + TcxCustomGridTableView(AGridViewLink.GridView).ViewInfo.RemoveActiveViewInfo(Self) + else + Result := False; + end; + finally + AGridViewLink.Free; + end; +end; + +{ TcxGridTableDataCellViewInfo } + +constructor TcxGridTableDataCellViewInfo.Create(ARecordViewInfo: TcxCustomGridRecordViewInfo; + AItem: TcxCustomGridTableItem); +begin + inherited Create(ARecordViewInfo); + FItem := AItem; + FItem.AddCell(Self); + FProperties := FItem.GetProperties(GridRecord); + FEditViewInfo := CreateEditViewInfo; + FStyle := FItem.GetCellStyle; +end; + +destructor TcxGridTableDataCellViewInfo.Destroy; +begin + if FItem <> nil then + begin + if FItem.Controller.ClickedCellViewInfo = Self then + FItem.Controller.ClickedCellViewInfo := nil; + if not GridView.IsDestroying then + FItem.ReleaseCellStyle; + FItem.RemoveCell(Self); + end; + FEditViewInfo.Free; + inherited; +end; + +function TcxGridTableDataCellViewInfo.GetEditing: Boolean; +begin + Result := FItem.Editing and Focused; +end; + +function TcxGridTableDataCellViewInfo.GetMousePos: TPoint; +begin + Result := GridViewInfo.MousePos; +end; + +function TcxGridTableDataCellViewInfo.GetProperties: TcxCustomEditProperties; +begin + Result := FProperties; + FItem.InitProperties(Result); +end; + +function TcxGridTableDataCellViewInfo.GetShowButtons: Boolean; +begin + Result := FItem.ShowButtons(RecordViewInfo.Focused); +end; + +procedure TcxGridTableDataCellViewInfo.AfterCustomDraw(ACanvas: TcxCanvas); +begin + FEditViewInfo.BackgroundColor := ACanvas.Brush.Color; + if FEditViewInfo is TcxCustomTextEditViewInfo then + with TcxCustomTextEditViewInfo(FEditViewInfo) do + begin + Font := ACanvas.Font; + TextColor := ACanvas.Font.Color; + end; +end; + +procedure TcxGridTableDataCellViewInfo.BeforeCustomDraw(ACanvas: TcxCanvas); +begin + ACanvas.Brush.Color := FEditViewInfo.BackgroundColor; + if FEditViewInfo is TcxCustomTextEditViewInfo then + with TcxCustomTextEditViewInfo(FEditViewInfo) do + begin + ACanvas.Font := Font; + ACanvas.Font.Color := TextColor; + end; +end; + +procedure TcxGridTableDataCellViewInfo.CalculateEditViewInfo(AEditViewInfo: TcxCustomEditViewInfo; + const AMousePos: TPoint); +begin + InitStyle; + CreateEditViewData; + try + FEditViewData.PaintOptions := []; + GetEditViewDataContentOffsets(FEditViewData.ContentOffset); + if AutoHeight or MultiLine then + begin + Include(FEditViewData.PaintOptions, epoAutoHeight); + FEditViewData.MaxLineCount := MaxLineCount; + end; + if ShowEndEllipsis then + Include(FEditViewData.PaintOptions, epoShowEndEllipsis); + FEditViewData.IsSelected := Selected; + AEditViewInfo.Transparent := Transparent; {4} + InitTextSelection; + FEditViewData.InplaceEditParams.Position := GetInplaceEditPosition; + FEditViewData.EditValueToDrawValue(Canvas, DisplayValue, AEditViewInfo); + FEditViewData.Calculate(Canvas, EditViewDataBounds, AMousePos, cxmbNone, [], AEditViewInfo, True); + finally + DestroyEditViewData; + end; +end; + +function TcxGridTableDataCellViewInfo.CalculateHeight: Integer; +var + AEditSizeProperties: TcxEditSizeProperties; +begin + CalculateParams; + if FItem.CanAutoHeight then + begin + CreateEditViewData; + try + SetRectEmpty(FEditViewData.ContentOffset); + Include(FEditViewData.PaintOptions, epoAllowZeroHeight); + with AEditSizeProperties do + begin + Height := -1; + MaxLineCount := Self.MaxLineCount; + with TextAreaBounds do + Width := Right - Left; + Inc(Width, 2 * (cxGridCellTextOffset - cxGridEditOffset)); + end; + if AEditSizeProperties.Width > 0 then + begin + FEditViewData.InplaceEditParams.Position := GetInplaceEditPosition; + Result := FEditViewData.GetEditSize(Canvas, DisplayValue, AEditSizeProperties).cy; + end + else + Result := 0; + if Result <> 0 then + Inc(Result, 2 * cxGridEditOffset) + else + if not SupportsZeroHeight then + Result := FItem.CalculateDefaultCellHeight(Canvas, Params.Font); + finally + DestroyEditViewData; + end; + end + else + Result := FItem.CalculateDefaultCellHeight(Canvas, Params.Font); + GridView.DoGetCellHeight(GridRecord, FItem, Self, Result); +end; + +function TcxGridTableDataCellViewInfo.CalculateSelected: Boolean; +begin + Result := GridView.DrawDataCellSelected(GridRecord, FItem, True, Self); +end; + +function TcxGridTableDataCellViewInfo.CanActivateEditOnMouseDown(AButton: TMouseButton): Boolean; +begin + Result := CanShowEdit and + ((AButton = mbLeft) and HotTrack or GridView.OptionsBehavior.AlwaysShowEditor); +end; + +function TcxGridTableDataCellViewInfo.CanShowEdit: Boolean; +begin + Result := True; +end; + +procedure TcxGridTableDataCellViewInfo.CheckEditHotTrack(const AMousePos: TPoint); +var + AEditViewInfo: TcxCustomEditViewInfo; +begin + if not GridView.Visible then Exit; + AEditViewInfo := CreateEditViewInfo; + try + CalculateEditViewInfo(AEditViewInfo, AMousePos); + if FEditViewInfo.Repaint(Control, AEditViewInfo) then + EditHotTrackChanged; + finally + AEditViewInfo.Free; + end; +end; + +function TcxGridTableDataCellViewInfo.CustomDraw(ACanvas: TcxCanvas): Boolean; +begin + Result := inherited CustomDraw(ACanvas); + if not Result then + begin + FItem.DoCustomDrawCell(ACanvas, Self, Result); + if not Result then + GridView.DoCustomDrawCell(ACanvas, Self, Result); + end; +end; + +procedure TcxGridTableDataCellViewInfo.DoCalculateParams; +begin + inherited; + InitStyle; +end; + +procedure TcxGridTableDataCellViewInfo.EditHotTrackChanged; +var + AEditUpdateNeeded: Boolean; +begin + AEditUpdateNeeded := GridView.Controller.EditingController.EditUpdateNeeded; + Invalidate(True); + if not AEditUpdateNeeded then + GridView.Controller.EditingController.CancelEditUpdatePost; +end; + +function TcxGridTableDataCellViewInfo.GetAreaBounds: TRect; +begin + Result := RecordViewInfo.RecordsViewInfo.GetAreaBoundsForCell(Self); +end; + +function TcxGridTableDataCellViewInfo.GetAutoHeight: Boolean; +begin + Result := RecordViewInfo.AutoHeight; +end; + +function TcxGridTableDataCellViewInfo.GetDisplayValue: TcxEditValue; +begin + if Properties.GetEditValueSource(False) = evsValue then + Result := GridRecord.Values[FItem.Index] + else + Result := GridRecord.DisplayTexts[FItem.Index]; +end; + +function TcxGridTableDataCellViewInfo.GetEditBounds: TRect; +begin + Result := EditViewDataBounds; + InflateRect(Result, -cxGridEditOffset, -cxGridEditOffset); + if FItem.CanScroll then + with GridViewInfo.ScrollableAreaBoundsForEdit do + begin + //if Result.Left < Left then Result.Left := Left; + if Result.Right > Right then Result.Right := Right; + if Result.Bottom > Bottom then Result.Bottom := Bottom; + end; +end; + +function TcxGridTableDataCellViewInfo.GetEditViewDataBounds: TRect; +begin + Result := ContentBounds; +end; + +procedure TcxGridTableDataCellViewInfo.GetEditViewDataContentOffsets(var R: TRect); +begin + with R do + begin + Left := cxGridEditOffset; + Top := cxGridEditOffset; + Right := cxGridEditOffset; + Bottom := cxGridEditOffset; + end; +end; + +function TcxGridTableDataCellViewInfo.GetFocused: Boolean; +begin + Result := FItem.Focused and RecordViewInfo.Focused and (FItem.FocusedCellViewInfo = Self); +end; + +function TcxGridTableDataCellViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridRecordCellHitTest; +end; + +function TcxGridTableDataCellViewInfo.GetHotTrack: Boolean; +begin + Result := ShowButtons or (esoAlwaysHotTrack in Properties.GetSupportedOperations) and + (GridView.OptionsBehavior.ImmediateEditor or Focused); + //Result := ShowButtons or (esoAlwaysHotTrack in Properties.GetSupportedOperations); +end; + +function TcxGridTableDataCellViewInfo.GetMaxLineCount: Integer; +begin + Result := GridView.OptionsView.CellTextMaxLineCount; +end; + +function TcxGridTableDataCellViewInfo.GetMultiLine: Boolean; +begin + Result := RecordViewInfo.RecordsViewInfo.IsCellMultiLine(Item); +end; + +function TcxGridTableDataCellViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridTableDataCellPainter; +end; + +function TcxGridTableDataCellViewInfo.GetShowEndEllipsis: Boolean; +begin + Result := GridView.OptionsView.CellEndEllipsis; +end; + +function TcxGridTableDataCellViewInfo.GetText: string; +begin + if FEditViewInfo is TcxCustomTextEditViewInfo then + Result := TcxCustomTextEditViewInfo(FEditViewInfo).Text + else + Result := ''; +end; + +function TcxGridTableDataCellViewInfo.GetValue: Variant; +begin + Result := GridRecord.Values[FItem.Index]; +end; + +procedure TcxGridTableDataCellViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetDataCellParams(GridRecord, FItem, Params, True, Self); +end; + +function TcxGridTableDataCellViewInfo.HasCustomDraw: Boolean; +begin + Result := FItem.HasCustomDrawCell or GridView.HasCustomDrawCell; +end; + +function TcxGridTableDataCellViewInfo.HasFocusRect: Boolean; +begin + Result := not GridView.OptionsSelection.InvertSelect and not Editing; +end; + +procedure TcxGridTableDataCellViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + inherited; + TcxGridRecordCellHitTest(AHitTest).Item := Item; +end; + +procedure TcxGridTableDataCellViewInfo.InitTextSelection; +var + AIncSearchParams: TcxViewParams; +begin + with FEditViewData do + if IsTextSelected then + begin + SelStart := 0; + SelLength := Length(Controller.IncSearchingText); + GridView.Styles.GetViewParams(vsIncSearch, nil, nil, AIncSearchParams); + SelBackgroundColor := AIncSearchParams.Color; + SelTextColor := AIncSearchParams.TextColor; + end + else + SelLength := 0; +end; + +function TcxGridTableDataCellViewInfo.InvalidateOnStateChange: Boolean; +begin + Result := False; +end; + +function TcxGridTableDataCellViewInfo.IsTextSelected: Boolean; +begin + Result := RecordViewInfo.RecordsViewInfo.IncSearchingCellViewInfo = Self; +end; + +procedure TcxGridTableDataCellViewInfo.MouseLeave; +begin + inherited; + if HotTrack then + CheckEditHotTrack(Bounds.BottomRight); +end; + +procedure TcxGridTableDataCellViewInfo.Offset(DX, DY: Integer); +begin + inherited; + FEditViewInfo.Offset(DX, DY); +end; + +procedure TcxGridTableDataCellViewInfo.RestoreParams(const AParams: TcxViewParams); +begin + FEditViewInfo.BackgroundColor := AParams.Color; + if FEditViewInfo is TcxCustomTextEditViewInfo then + with TcxCustomTextEditViewInfo(FEditViewInfo) do + begin + Font := AParams.Font; + TextColor := AParams.TextColor; + end; +end; + +procedure TcxGridTableDataCellViewInfo.SaveParams(out AParams: TcxViewParams); +begin + AParams.Color := FEditViewInfo.BackgroundColor; + if FEditViewInfo is TcxCustomTextEditViewInfo then + with TcxCustomTextEditViewInfo(FEditViewInfo) do + begin + AParams.Font := Font; + AParams.TextColor := TextColor; + end; +end; + +procedure TcxGridTableDataCellViewInfo.StateChanged(APrevState: TcxGridCellState); +begin + inherited; + if State = gcsNone then EditHotTrackChanged; +end; + +function TcxGridTableDataCellViewInfo.SupportsZeroHeight: Boolean; +begin + Result := False; +end; + +function TcxGridTableDataCellViewInfo.CanShowAutoHint: Boolean; +begin + Result := GridView.OptionsBehavior.CellHints; +end; + +function TcxGridTableDataCellViewInfo.CanShowCustomHint: Boolean; +begin + Result := Item.HasCellHintHandler; +end; + +function TcxGridTableDataCellViewInfo.CanShowHint: Boolean; +begin + Result := (CanShowAutoHint or CanShowCustomHint) and not Editing; +end; + +function TcxGridTableDataCellViewInfo.GetCellBoundsForHint: TRect; +begin + Result := ContentBounds; +end; + +function TcxGridTableDataCellViewInfo.NeedShowHint(const AMousePos: TPoint; + out AHintText: TCaption; out AIsHintMultiLine: Boolean; out ATextRect: TRect): Boolean; +begin + if CanShowAutoHint then + if UseStandardNeedShowHint then + Result := inherited NeedShowHint(AMousePos, AHintText, AIsHintMultiLine, ATextRect) + else + Result := FEditViewInfo.NeedShowHint(Canvas, AMousePos, GetAreaBoundsForHint, + AHintText, AIsHintMultiLine, ATextRect) + else + Result := False; + + if CanShowCustomHint and (Result or HasHintPoint(AMousePos)) then + begin + if not Result then + begin + AHintText := ''; + AIsHintMultiLine := False; + ATextRect := GetHintTextRect(AMousePos); + end; + Item.DoGetCellHint(GridRecord, Self, AMousePos, AHintText, AIsHintMultiLine, ATextRect); + if not Result then + Result := AHintText <> ''; + end; +end; + +function TcxGridTableDataCellViewInfo.UseStandardNeedShowHint: Boolean; +begin + Result := False; +end; + +procedure TcxGridTableDataCellViewInfo.InitStyle; +begin + FItem.InitStyle(FStyle, Params, RecordViewInfo.Focused); +end; + +function TcxGridTableDataCellViewInfo.CreateEditViewInfo: TcxCustomEditViewInfo; +begin + Result := Properties.GetViewInfoClass.Create as TcxCustomEditViewInfo; +end; + +procedure TcxGridTableDataCellViewInfo.CreateEditViewData; +begin + FEditViewData := FItem.GetEditViewData(GetProperties, FIsLocalCopyOfEditViewData); + FEditViewData.Data := GridRecord; +end; + +procedure TcxGridTableDataCellViewInfo.DestroyEditViewData; +begin + FItem.ReleaseEditViewData(FEditViewData, FIsLocalCopyOfEditViewData); +end; + +procedure TcxGridTableDataCellViewInfo.UpdateEdit; +begin + if not Controller.EditingController.EditPreparing then + Controller.EditingController.UpdateEdit; +end; + +procedure TcxGridTableDataCellViewInfo.BeforeRecalculation; +begin + GridViewInfo.UpdateMousePos; + inherited; +end; + +procedure TcxGridTableDataCellViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + inherited; + CalculateEditViewInfo(FEditViewInfo, MousePos); + Text := GetText; + if not GridViewInfo.IsInternalUse and Editing then UpdateEdit; +end; + +function TcxGridTableDataCellViewInfo.CanDrawSelected: Boolean; +begin + Result := True; +end; + +function TcxGridTableDataCellViewInfo.GetInplaceEditPosition: TcxInplaceEditPosition; +begin + Result.Item := FItem; + Result.RecordIndex := RecordViewInfo.GridRecord.RecordIndex; +end; + +procedure TcxGridTableDataCellViewInfo.Invalidate(ARecalculate: Boolean); +begin + if IsDestroying then Exit; + if ARecalculate then Recalculate; + inherited Invalidate; + {if ARecalculate then + GridRecord.Invalidate(FItem) + else + inherited Invalidate;} +end; + +function TcxGridTableDataCellViewInfo.MouseDown(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +var + AGridViewLink: TcxGridListenerLink; + AItem: TcxCustomGridTableItem; + AActivateEdit, AHotTrack, APostCheckEdit: Boolean; +begin + FWasFocusedBeforeClick := Focused; + AGridViewLink := GridView.AddListenerLink; + try + AItem := FItem; + AActivateEdit := CanActivateEditOnMouseDown(AButton); + AHotTrack := HotTrack; + + APostCheckEdit := False; + Controller.AllowCheckEdit := False; + GridView.DontMakeMasterRecordVisible := True; + GridView.ViewInfo.AddActiveViewInfo(Self); + try + if ssDouble in AShift then + begin + Result := GridView.DoCellDblClick(Self, AButton, AShift); + if Result or not AItem.GridView.ViewInfo.IsViewInfoActive(Self) then + begin + Result := False; + Exit; + end; + end; + Result := inherited MouseDown(AHitTest, AButton, AShift); + if Result and not AItem.Controller.EditingController.IsErrorOnEditExit then + begin + AItem.Focused := True; + if AItem.Focused then + if (AButton <> mbMiddle) and (AShift * [ssCtrl, ssShift] = []) and AActivateEdit then + begin + AItem.GridView.Site.FinishDragAndDrop(False); + if AHotTrack then + AItem.Controller.EditingController.ShowEdit(AItem, AShift, AHitTest.Pos.X, AHitTest.Pos.Y) + else + AItem.Controller.EditingController.ShowEdit(AItem); + end + else + AItem.Controller.IsReadyForImmediateEditing := True + else + APostCheckEdit := True; + if AItem.GridView.ViewInfo.IsViewInfoActive(Self) and + (AItem.Controller.EditingItem <> AItem) then + AItem.Controller.ClickedCellViewInfo := Self; + end; + finally + if AGridViewLink.GridView <> nil then + begin + AItem.GridView.ViewInfo.RemoveActiveViewInfo(Self); + AItem.GridView.DontMakeMasterRecordVisible := False; + AItem.Controller.AllowCheckEdit := True; + if APostCheckEdit then + AItem.Controller.PostCheckEdit; + end; + end; + finally + AGridViewLink.Free; + end; +end; + +function TcxGridTableDataCellViewInfo.MouseMove(AHitTest: TcxCustomGridHitTest; + AShift: TShiftState): Boolean; +begin + Result := inherited MouseMove(AHitTest, AShift); + if HotTrack then + CheckEditHotTrack(AHitTest.Pos); +end; + +function TcxGridTableDataCellViewInfo.MouseUp(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; + + procedure ShowEdit; + var + AGridView: TcxCustomGridTableView; + begin + AGridView := GridView; + AGridView.DontMakeMasterRecordVisible := True; + try + Controller.EditingController.ShowEdit(FItem, AShift, AHitTest.Pos.X, AHitTest.Pos.Y); + finally + AGridView.DontMakeMasterRecordVisible := False; + end; + end; + +begin + inherited MouseUp(AHitTest, AButton, AShift); + if FItem.Controller.ClickedCellViewInfo = Self then + begin + FItem.Controller.ClickedCellViewInfo := nil; + Result := GridView.DoCellClick(Self, AButton, AShift); + if Result then Exit; + end + else + Result := False; + if (AButton = mbLeft) and (AShift * [ssCtrl, ssShift] = []) and + Focused and CanShowEdit then + begin + if not Editing then + if GridView.OptionsBehavior.ImmediateEditor then + if Controller.IsReadyForImmediateEditing then + ShowEdit + else + else + if FWasFocusedBeforeClick and not Controller.IsDblClick then + Controller.EditingController.StartEditShowingTimer(FItem); + Result := True; + end; +end; + +{ TcxCustomGridRecordViewInfo } + +constructor TcxCustomGridRecordViewInfo.Create(ARecordsViewInfo: TcxCustomGridRecordsViewInfo; + ARecord: TcxCustomGridRecord); +begin + inherited Create(ARecordsViewInfo.GridViewInfo); + FRecordsViewInfo := ARecordsViewInfo; + FRecord := ARecord; + if FRecord <> nil then + begin + FIsRecordViewInfoAssigned := FRecord.ViewInfo <> nil; + if not FIsRecordViewInfoAssigned then + FRecord.FViewInfo := Self; + end; +end; + +destructor TcxCustomGridRecordViewInfo.Destroy; +begin + if not FIsRecordViewInfoAssigned and (FRecord <> nil) then + FRecord.FViewInfo := nil; + inherited; +end; + +function TcxCustomGridRecordViewInfo.GetCacheItem: TcxCustomGridTableViewInfoCacheItem; +begin + if FRecord = nil then + Result := nil + else + Result := TcxCustomGridTableViewInfoCacheItem(GridView.ViewInfoCache[FRecord.Index]); +end; + +function TcxCustomGridRecordViewInfo.GetExpanded: Boolean; +begin + if not FExpandedCalculated then + begin + FExpanded := (FRecord <> nil) and FRecord.Expanded; + FExpandedCalculated := True; + end; + Result := FExpanded; +end; + +function TcxCustomGridRecordViewInfo.GetFocused: Boolean; +begin + Result := GridView.DrawRecordFocused(GridRecord); +end; + +function TcxCustomGridRecordViewInfo.GetGridView: TcxCustomGridTableView; +begin + Result := GridViewInfo.GridView; +end; + +function TcxCustomGridRecordViewInfo.GetGridViewInfo: TcxCustomGridTableViewInfo; +begin + Result := FRecordsViewInfo.GridViewInfo; +end; + +function TcxCustomGridRecordViewInfo.GetIndex: Integer; +begin + Result := FRecordsViewInfo.FItems.IndexOf(Self); +end; + +function TcxCustomGridRecordViewInfo.GetSelected: Boolean; +begin + if not FSelectedCalculated then + begin + FSelected := CalculateSelected; + FSelectedCalculated := True; + end; + Result := FSelected; +end; + +function TcxCustomGridRecordViewInfo.CalculateSelected: Boolean; +begin + Result := GridView.DrawRecordSelected(GridRecord); +end; + +function TcxCustomGridRecordViewInfo.CanGenerateExpandButtonHitTest: Boolean; +begin + Result := True; +end; + +procedure TcxCustomGridRecordViewInfo.ControlFocusChanged; +begin +end; + +function TcxCustomGridRecordViewInfo.GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TcxCustomGridRecordViewInfo.GetBackgroundBitmap: TBitmap; +begin + Result := FRecordsViewInfo.BackgroundBitmap; +end; + +function TcxCustomGridRecordViewInfo.GetBackgroundBitmapBounds: TRect; +begin + Result := ContentBounds; +end; + +function TcxCustomGridRecordViewInfo.GetCanvas: TcxCanvas; +begin + Result := FRecordsViewInfo.Canvas; +end; + +function TcxCustomGridRecordViewInfo.GetCellTransparent(ACell: TcxGridTableCellViewInfo): Boolean; +begin + Result := Transparent; +end; + +function TcxCustomGridRecordViewInfo.GetContentBounds: TRect; +begin + Result := Bounds; +end; + +function TcxCustomGridRecordViewInfo.GetExpandButtonAreaBounds: TRect; +begin + Result := cxEmptyRect; +end; + +function TcxCustomGridRecordViewInfo.GetFocusRectBounds: TRect; +begin + Result := Bounds; +end; + +function TcxCustomGridRecordViewInfo.GetHeight: Integer; +begin + if CacheItem.IsHeightAssigned then + Result := CacheItem.Height + else + begin + Result := CalculateHeight; + CacheItem.Height := Result; + end; +end; + +function TcxCustomGridRecordViewInfo.GetHideFocusRectOnExit: Boolean; +begin + Result := GridView.OptionsSelection.HideFocusRectOnExit; +end; + +function TcxCustomGridRecordViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridRecordHitTest; +end; + +function TcxCustomGridRecordViewInfo.GetVisible: Boolean; +begin + Result := Index < FRecordsViewInfo.VisibleCount; +end; + +function TcxCustomGridRecordViewInfo.HasFocusRect: Boolean; +begin + Result := not GridRecord.CanFocusCells or GridView.OptionsSelection.InvertSelect; +end; + +procedure TcxCustomGridRecordViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + inherited; + (AHitTest as TcxGridRecordHitTest).GridRecord := GridRecord; +end; + +function TcxCustomGridRecordViewInfo.IsClickHitTest(AHitTest: TcxCustomGridHitTest): Boolean; +begin + Result := TcxCustomGridTableController(Controller).IsClickableRecordHitTest(AHitTest); +end; + +function TcxCustomGridRecordViewInfo.IsDetailVisible(ADetail: TcxCustomGridView): Boolean; +begin + Result := False; +end; + +procedure TcxCustomGridRecordViewInfo.Offset(DX, DY: Integer); +begin + inherited; + OffsetRect(FExpandButtonBounds, DX, DY); +end; + +procedure TcxCustomGridRecordViewInfo.VisibilityChanged(AVisible: Boolean); +begin +end; + +procedure TcxCustomGridRecordViewInfo.BeforeRecalculation; +begin + inherited; + FRecordsViewInfo.BeforeItemRecalculation; +end; + +function TcxCustomGridRecordViewInfo.Click(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +var + AGridViewLink: TcxGridListenerLink; +begin + Result := ssDouble in AShift; + if not Result then + begin + AGridViewLink := GridView.AddListenerLink; + try + GridViewInfo.Controller.FocusedRecord := GridRecord; + finally + Result := AGridViewLink.GridView <> nil; {!!!} + AGridViewLink.Free; + end; + end; +end; + +function TcxCustomGridRecordViewInfo.GetBoundsForInvalidate(AItem: TcxCustomGridTableItem): TRect; +begin + if AItem = nil then + Result := Bounds + else + Result := GetBoundsForItem(AItem); +end; + +function TcxCustomGridRecordViewInfo.GetBoundsForItem(AItem: TcxCustomGridTableItem): TRect; +begin + Result := Rect(0, 0, 0, 0); +end; + +function TcxCustomGridRecordViewInfo.GetCellViewInfoByItem(AItem: TcxCustomGridTableItem): TcxGridTableDataCellViewInfo; +begin + Result := nil; +end; + +{procedure TcxCustomGridRecordViewInfo.GetDataCellViewParams(AItem: TcxCustomGridTableItem; + ACellViewInfo: TcxGridTableCellViewInfo; var AParams: TcxViewParams); +begin + RecordsViewInfo.GetDataCellViewParams(GridRecord, AItem, ACellViewInfo, AParams); +end;} + +function TcxCustomGridRecordViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + if CanGenerateExpandButtonHitTest and + GridRecord.Expandable and PtInRect(ExpandButtonAreaBounds, P) then + begin + Result := TcxGridExpandButtonHitTest.Instance(P); + InitHitTest(Result); + end + else + Result := inherited GetHitTest(P); +end; + +procedure TcxCustomGridRecordViewInfo.MainCalculate(ALeftBound, ATopBound: Integer); +begin + FSelectedCalculated := False; + Calculate(ALeftBound, ATopBound, Width, Height); + if GridRecord.Expandable then + CalculateExpandButtonBounds(FExpandButtonBounds); +end; + +function TcxCustomGridRecordViewInfo.MouseDown(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +begin + Result := inherited MouseDown(AHitTest, AButton, AShift); + if not Result and (AButton = mbLeft) and (AHitTest.HitTestCode = htExpandButton) then + begin + GridRecord.ToggleExpanded; + Result := True; + end; + if not Result and (AButton <> mbMiddle) and IsClickHitTest(AHitTest) and + GridView.Site.IsFocused then + Result := Click(AHitTest, AButton, AShift); +end; + +function TcxCustomGridRecordViewInfo.ProcessDialogChar(ACharCode: Word): Boolean; +begin + Result := False; +end; + +procedure TcxCustomGridRecordViewInfo.Recalculate; +begin + BeforeRecalculation; + MainCalculate(Bounds.Left, Bounds.Top); + AfterRecalculation; +end; + +{ TcxCustomGridRecordsViewInfo } + +constructor TcxCustomGridRecordsViewInfo.Create(AGridViewInfo: TcxCustomGridTableViewInfo); +begin + inherited Create; + FGridViewInfo := AGridViewInfo; + CreateItems; +end; + +destructor TcxCustomGridRecordsViewInfo.Destroy; +begin + DestroyItems; + inherited; +end; + +function TcxCustomGridRecordsViewInfo.GetCanvas: TcxCanvas; +begin + Result := FGridViewInfo.Canvas; +end; + +function TcxCustomGridRecordsViewInfo.GetController: TcxCustomGridTableController; +begin + Result := FGridViewInfo.Controller; +end; + +function TcxCustomGridRecordsViewInfo.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxCustomGridRecordsViewInfo.GetFirstRecordIndex: Integer; +begin + Result := FGridViewInfo.FirstRecordIndex; +end; + +function TcxCustomGridRecordsViewInfo.GetGridView: TcxCustomGridTableView; +begin + Result := FGridViewInfo.GridView; +end; + +function TcxCustomGridRecordsViewInfo.GetIncSearchingCellViewInfo: TcxGridTableDataCellViewInfo; +begin + if not FIsIncSearchingCellViewInfoCalculated then + FIncSearchingCellViewInfo := CalculateIncSearchingCellViewInfo; + Result := FIncSearchingCellViewInfo; +end; + +function TcxCustomGridRecordsViewInfo.GetItem(Index: Integer): TcxCustomGridRecordViewInfo; +begin + if Index < Count then + begin + Result := TcxCustomGridRecordViewInfo(FItems[Index]); + if Result.GridRecord = nil then + Result := nil; + end + else + begin + Result := CreateRecordViewInfo(Index); + FItems.Add(Result); + end; +end; + +function TcxCustomGridRecordsViewInfo.GetMaxCount: Integer; +begin + if (FirstRecordIndex = -1) or (ViewData.RecordCount = 0) then + Result := 0 + else + if GridViewInfo.CalculateDown then + Result := ViewData.RecordCount - FirstRecordIndex + else + Result := FirstRecordIndex + 1; + if Result < 0 then Result := 0; +end; + +function TcxCustomGridRecordsViewInfo.GetTopRecordIndex: Integer; +begin + Result := GridViewInfo.Controller.TopRecordIndex; +end; + +function TcxCustomGridRecordsViewInfo.GetViewData: TcxCustomGridTableViewData; +begin + Result := FGridViewInfo.ViewData; +end; + +procedure TcxCustomGridRecordsViewInfo.CreateItems; +begin + FItems := TList.Create; +end; + +procedure TcxCustomGridRecordsViewInfo.DestroyItems; +var + I: Integer; +begin + for I := 0 to Count - 1 do + TObject(FItems[I]).Free; + FItems.Free; +end; + +function TcxCustomGridRecordsViewInfo.CreateRecordViewInfo(AIndex: Integer): TcxCustomGridRecordViewInfo; +var + ARecord: TcxCustomGridRecord; +begin + ARecord := ViewData.Records[GetRecordIndex(AIndex)]; + Result := ARecord.GetViewInfoClass.Create(Self, ARecord); +end; + +procedure TcxCustomGridRecordsViewInfo.AfterCalculate; +begin + DestroyEditViewDatas; + if FGridViewInfo.Visible then + Controller.EditingController.AfterViewInfoCalculate; +end; + +procedure TcxCustomGridRecordsViewInfo.BeforeCalculate; +begin + FBackgroundBitmap := GetBackgroundBitmap; + if FGridViewInfo.Visible then + Controller.EditingController.BeforeViewInfoCalculate; + CreateEditViewDatas; +end; + +procedure TcxCustomGridRecordsViewInfo.BeforeItemRecalculation; +begin + GridViewInfo.UpdateMousePos; + FIsIncSearchingCellViewInfoCalculated := False; +end; + +procedure TcxCustomGridRecordsViewInfo.AfterOffset; +begin +end; + +procedure TcxCustomGridRecordsViewInfo.BeforeOffset; +begin + FIsIncSearchingCellViewInfoCalculated := False; +end; + +procedure TcxCustomGridRecordsViewInfo.Calculate; +begin + FBounds := CalculateBounds; + FContentBounds := CalculateContentBounds; +end; + +function TcxCustomGridRecordsViewInfo.CalculateBounds: TRect; +begin + Result := FGridViewInfo.ClientBounds; +end; + +function TcxCustomGridRecordsViewInfo.CalculateContentBounds: TRect; +begin + Result := Bounds; +end; + +function TcxCustomGridRecordsViewInfo.CalculateIncSearchingCellViewInfo: TcxGridTableDataCellViewInfo; +begin + if Controller.IsIncSearching then + begin + Result := Controller.IncSearchingItem.FocusedCellViewInfo; + FIsIncSearchingCellViewInfoCalculated := Result <> nil; + end + else + begin + Result := nil; + FIsIncSearchingCellViewInfoCalculated := True; + end; +end; + +procedure TcxCustomGridRecordsViewInfo.CalculateVisibleCount; +begin + FVisibleCount := 0; +end; + +procedure TcxCustomGridRecordsViewInfo.CreateEditViewDatas; +var + I: Integer; +begin + with GridView do + for I := 0 to ItemCount - 1 do + Items[I].DoCreateEditViewData; +end; + +procedure TcxCustomGridRecordsViewInfo.DestroyEditViewDatas; +var + I: Integer; +begin + with GridView do + for I := 0 to ItemCount - 1 do + Items[I].DoDestroyEditViewData; +end; + +function TcxCustomGridRecordsViewInfo.GetAreaBoundsForCell(ACellViewInfo: TcxGridTableDataCellViewInfo): TRect; +begin + Result := GridViewInfo.ScrollableAreaBounds; +end; + +function TcxCustomGridRecordsViewInfo.GetAutoDataCellHeight: Boolean; +begin + Result := AutoRecordHeight; +end; + +function TcxCustomGridRecordsViewInfo.GetAutoDataRecordHeight: Boolean; +begin + Result := AutoDataCellHeight; +end; + +function TcxCustomGridRecordsViewInfo.GetAutoRecordHeight: Boolean; +begin + Result := GridView.OptionsView.CellAutoHeight or GridView.IsGetCellHeightAssigned; +end; + +function TcxCustomGridRecordsViewInfo.GetBackgroundBitmap: TBitmap; +begin + Result := GridView.BackgroundBitmaps.GetBitmap(bbContent); +end; + +function TcxCustomGridRecordsViewInfo.GetRecordIndex(AViewInfoIndex: Integer): Integer; +begin + if FGridViewInfo.CalculateDown then + Result := FGridViewInfo.FirstRecordIndex + AViewInfoIndex + else + Result := FGridViewInfo.FirstRecordIndex - AViewInfoIndex; +end; + +function TcxCustomGridRecordsViewInfo.GetViewInfoIndex(ARecordIndex: Integer): Integer; +begin + if FGridViewInfo.CalculateDown then + Result := ARecordIndex - FGridViewInfo.FirstRecordIndex + else + Result := FGridViewInfo.FirstRecordIndex - ARecordIndex; + if (Result < -1) or (Result >= Count) then Result := -1 +end; + +function TcxCustomGridRecordsViewInfo.IsEmpty: Boolean; +begin + Result := Count = 0; +end; + +procedure TcxCustomGridRecordsViewInfo.ControlFocusChanged; +var + I: Integer; +begin + for I := 0 to Count - 1 do + if Items[I] <> nil then + Items[I].ControlFocusChanged; +end; + +procedure TcxCustomGridRecordsViewInfo.VisibilityChanged(AVisible: Boolean); +var + I: Integer; +begin + for I := 0 to Count - 1 do + if Items[I] <> nil then + Items[I].VisibilityChanged(AVisible); +end; + +function TcxCustomGridRecordsViewInfo.GetPainterClass: TcxCustomGridRecordsPainterClass; +begin + Result := TcxCustomGridRecordsPainter; +end; + +function TcxCustomGridRecordsViewInfo.CanOffset(AItemCountDelta: Integer): Boolean; +begin + Result := (Count <> 0) and (Abs(AItemCountDelta) < Count); +end; + +function TcxCustomGridRecordsViewInfo.GetCellHeight(ACellContentHeight: Integer): Integer; +begin + Result := ACellContentHeight; +end; + +function TcxCustomGridRecordsViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I].GetHitTest(P); + if Result <> nil then Exit; + end; + Result := nil; +end; + +function TcxCustomGridRecordsViewInfo.GetRealItem(ARecord: TcxCustomGridRecord): TcxCustomGridRecordViewInfo; +var + AIndex: Integer; +begin + AIndex := GetViewInfoIndex(ARecord.Index); + if AIndex = -1 then + Result := nil + else + Result := Items[AIndex]; +end; + +function TcxCustomGridRecordsViewInfo.IsCellMultiLine(AItem: TcxCustomGridTableItem): Boolean; +begin + Result := False; +end; + +procedure TcxCustomGridRecordsViewInfo.MainCalculate; +begin + BeforeCalculate; + Calculate; + AfterCalculate; +end; + +procedure TcxCustomGridRecordsViewInfo.Offset(AItemCountDelta: Integer); +var + AMoveCount: Integer; + + procedure DeleteItems; + var + I: Integer; + begin + if AItemCountDelta < 0 then + I := Count + AItemCountDelta + else + I := 0; + for I := I to I + Abs(AItemCountDelta) - 1 do + Items[I].Free; + end; + + procedure OffsetItemsList; + var + AIndexFrom: Integer; + begin + if AItemCountDelta < 0 then + AIndexFrom := 0 + else + AIndexFrom := AItemCountDelta; + with FItems do + System.Move(List[AIndexFrom], List[AIndexFrom - AItemCountDelta], SizeOf(Pointer) * AMoveCount); + end; + + procedure OffsetItems; + var + AIndexFrom, I: Integer; + begin + if AItemCountDelta < 0 then + AIndexFrom := Abs(AItemCountDelta) + else + AIndexFrom := 0; + for I := AIndexFrom to AIndexFrom + AMoveCount - 1 do + OffsetItem(I, FItemsOffset); + end; + + procedure CreateItems; + var + I: Integer; + begin + if AItemCountDelta < 0 then + I := 0 + else + I := Count - AItemCountDelta; + if Count > MaxCount then + FItems.Count := MaxCount; + for I := I to I + Abs(AItemCountDelta) - 1 do + if I < Count then + begin + FItems[I] := CreateRecordViewInfo(I); + Items[I].MainCalculate(GetItemLeftBound(I), GetItemTopBound(I)); + end; + end; + + procedure CheckForAppearedItems; + var + I: Integer; + begin + for I := 0 to Count - 1 do + if not Items[I].Calculated then + Items[I].MainCalculate(GetItemLeftBound(I), GetItemTopBound(I)); + end; + +begin + FItemsOffset := 0; + if AItemCountDelta = 0 then Exit; + AMoveCount := Count - Abs(AItemCountDelta); + if AItemCountDelta > 0 then + FItemsOffset := GetItemsOffset(AItemCountDelta); + DeleteItems; + OffsetItemsList; + if AItemCountDelta > 0 then OffsetItems; + CreateItems; + if AItemCountDelta < 0 then + begin + FItemsOffset := GetItemsOffset(AItemCountDelta); + OffsetItems; + end; + CalculateVisibleCount; + CheckForAppearedItems; +end; + +procedure TcxCustomGridRecordsViewInfo.Offset(DX, DY: Integer); +begin + OffsetRect(FBounds, DX, DY); + OffsetRect(FContentBounds, DX, DY); +end; + +procedure TcxCustomGridRecordsViewInfo.Paint; +begin + with GetPainterClass.Create(Canvas, Self) do + try + MainPaint; + finally + Free; + end; +end; + +{ TcxNavigatorSiteViewInfo } + +destructor TcxNavigatorSiteViewInfo.Destroy; +begin + if State <> gcsNone then + MouseLeave; + inherited; +end; + +function TcxNavigatorSiteViewInfo.GetGridViewInfo: TcxCustomGridTableViewInfo; +begin + Result := TcxCustomGridTableViewInfo(inherited GridViewInfo); +end; + +function TcxNavigatorSiteViewInfo.GetNavigatorViewInfo: TcxNavigatorViewInfo; +begin + Result := GridViewInfo.NavigatorViewInfo; +end; + +function TcxNavigatorSiteViewInfo.CalculateHeight: Integer; +begin + Result := GridViewInfo.Site.HScrollBar.Height; +end; + +function TcxNavigatorSiteViewInfo.CalculateWidth: Integer; +begin + with GridViewInfo do + Result := NavigatorSize.X + NavigatorOffset; +end; + +function TcxNavigatorSiteViewInfo.GetHeight: Integer; +begin + Result := CalculateHeight; +end; + +function TcxNavigatorSiteViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridNavigatorHitTest; +end; + +function TcxNavigatorSiteViewInfo.GetHotTrack: Boolean; +begin + Result := True; +end; + +function TcxNavigatorSiteViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxNavigatorSitePainter; +end; + +function TcxNavigatorSiteViewInfo.GetVisible: Boolean; +begin + Result := GridViewInfo.GridView.OptionsView.Navigator; +end; + +procedure TcxNavigatorSiteViewInfo.MouseLeave; +begin + inherited; + NavigatorViewInfo.MouseMove(-1, -1); +end; + +procedure TcxNavigatorSiteViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + AParams.Color := clBtnFace; +end; + +function TcxNavigatorSiteViewInfo.GetWidth: Integer; +begin + Result := CalculateWidth; +end; + +function TcxNavigatorSiteViewInfo.MouseDown(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +begin + with AHitTest.Pos do + NavigatorViewInfo.MouseDown(X, Y); + Result := True; +end; + +function TcxNavigatorSiteViewInfo.MouseMove(AHitTest: TcxCustomGridHitTest; + AShift: TShiftState): Boolean; +begin + inherited MouseMove(AHitTest, AShift); + with AHitTest.Pos do + NavigatorViewInfo.MouseMove(X, Y); + Result := True; +end; + +function TcxNavigatorSiteViewInfo.MouseUp(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +begin + with AHitTest.Pos do + NavigatorViewInfo.MouseUp(X, Y); + Result := True; +end; + +{ TcxCustomGridTableViewInfo } + +constructor TcxCustomGridTableViewInfo.Create(AGridView: TcxCustomGridView); +begin + FParts := TList.Create; + inherited; + FCalculateDown := True; + FFirstRecordIndex := RecordIndexNone; +end; + +destructor TcxCustomGridTableViewInfo.Destroy; +begin + FreeAndNil(FParts);//.Free; + inherited; +end; + +function TcxCustomGridTableViewInfo.GetController: TcxCustomGridTableController; +begin + Result := TcxCustomGridTableController(inherited Controller); +end; + +function TcxCustomGridTableViewInfo.GetExpandButtonSize: Integer; +begin + Result := LookAndFeelPainter.ExpandButtonSize; +end; + +function TcxCustomGridTableViewInfo.GetFirstRecordIndex: Integer; +begin + if FirstRecordIndexAssigned then + Result := FFirstRecordIndex + else + Result := Controller.TopRecordIndex; +end; + +function TcxCustomGridTableViewInfo.GetGridView: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited GridView); +end; + +function TcxCustomGridTableViewInfo.GetPart(Index: Integer): TcxCustomGridPartViewInfo; +begin + Result := TcxCustomGridPartViewInfo(FParts[Index]); +end; + +function TcxCustomGridTableViewInfo.GetPartCount: Integer; +begin + Result := FParts.Count; +end; + +function TcxCustomGridTableViewInfo.GetPartsBottomHeight: Integer; +begin + Result := GetPartsCustomHeight(gpaBottom); +end; + +function TcxCustomGridTableViewInfo.GetPartsCustomHeight(AAlignment: TcxGridPartAlignment): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to PartCount - 1 do + with Parts[I] do + if Alignment = AAlignment then Inc(Result, Height); +end; + +function TcxCustomGridTableViewInfo.GetPartsTopHeight: Integer; +begin + Result := GetPartsCustomHeight(gpaTop); +end; + +function TcxCustomGridTableViewInfo.GetScrollableAreaWidth: Integer; +begin + with ScrollableAreaBoundsHorz do + Result := Right - Left; +end; + +function TcxCustomGridTableViewInfo.GetViewData: TcxCustomGridTableViewData; +begin + Result := TcxCustomGridTableViewData(inherited ViewData); +end; + +function TcxCustomGridTableViewInfo.GetVisibleRecordCount: Integer; +begin + Result := FRecordsViewInfo.VisibleCount; +end; + +procedure TcxCustomGridTableViewInfo.AddPart(AItem: TcxCustomGridPartViewInfo); +begin + FParts.Add(AItem); +end; + +procedure TcxCustomGridTableViewInfo.RemovePart(AItem: TcxCustomGridPartViewInfo); +begin + FParts.Remove(AItem); +end; + +function TcxCustomGridTableViewInfo.GetNavigatorBounds: TRect; +begin + Result := GetNavigatorSiteBounds; + Result.Right := Result.Left + NavigatorSize.X; +end; + +function TcxCustomGridTableViewInfo.GetNavigatorButtons: TcxCustomNavigatorButtons; +begin + Result := GridView.NavigatorButtons; +end; + +function TcxCustomGridTableViewInfo.GetNavigatorCanvas: TCanvas; +begin + Result := Canvas.Canvas; +end; + +function TcxCustomGridTableViewInfo.GetNavigatorControl: TWinControl; +begin + Result := Site; +end; + +function TcxCustomGridTableViewInfo.GetNavigatorFocused: Boolean; +begin + Result := False; +end; + +function TcxCustomGridTableViewInfo.GetNavigatorLookAndFeel: TcxLookAndFeel; +begin + Result := GridView.LookAndFeel; +end; + +function TcxCustomGridTableViewInfo.GetNavigatorOwner: TComponent; +begin + Result := GridView; +end; + +function TcxCustomGridTableViewInfo.GetNavigatorShowHint: Boolean; +begin + Result := GridView.OptionsBehavior.NavigatorHints; +end; + +function TcxCustomGridTableViewInfo.GetNavigatorTabStop: Boolean; +begin + Result := False; +end; + +procedure TcxCustomGridTableViewInfo.NavigatorButtonsStateChanged; +begin + FNavigatorViewInfo.UpdateButtonsEnabled; +end; + +procedure TcxCustomGridTableViewInfo.NavigatorChanged(AChangeType: TcxNavigatorChangeType); +const + ChangeKinds: array[TcxNavigatorChangeType] of TcxGridViewChangeKind = (vcProperty, vcLayout, vcLayout); +begin + GridView.Changed(ChangeKinds[AChangeType]); +end; + +procedure TcxCustomGridTableViewInfo.RefreshNavigator; +var + AHeight, AWidth: Integer; +begin + if GridView.IsPattern or (GridView.Control = nil) then Exit; + FNavigatorViewInfo.MakeIsDirty; + AWidth := FNavigatorSize.X; + AHeight := FNavigatorSize.Y; + FNavigatorViewInfo.CheckSize(AWidth, AHeight); + if (FNavigatorSize.X <> AWidth) or (FNavigatorSize.Y <> AHeight) then + GridView.LayoutChanged + else + GridView.ViewChanged; +end; + +procedure TcxCustomGridTableViewInfo.CreateViewInfos; +begin + FFilterViewInfo := GetFilterViewInfoClass.Create(Self); + inherited; + FNavigatorSiteViewInfo := GetNavigatorSiteViewInfoClass.Create(Self); + if FNavigatorViewInfo = nil then + FNavigatorViewInfo := GetNavigatorViewInfoClass.Create(Self); + FRecordsViewInfo := GetRecordsViewInfoClass.Create(Self); +end; + +procedure TcxCustomGridTableViewInfo.DestroyViewInfos(AIsRecreating: Boolean); +begin + FreeAndNil(FRecordsViewInfo); + FNavigatorSiteViewInfo.Free; + FNavigatorSiteViewInfo := nil; + if not AIsRecreating then + FreeAndNil(FNavigatorViewInfo); + inherited; + FreeAndNil(FFilterViewInfo); +end; + +procedure TcxCustomGridTableViewInfo.AdjustClientBounds(var ABounds: TRect); +begin + inherited; + if CalculateDown and NavigatorSiteViewInfo.Visible and not Site.HScrollBarVisible then + Dec(ABounds.Bottom, NavigatorSiteViewInfo.Height); +end; + +procedure TcxCustomGridTableViewInfo.AfterCalculating; +begin + inherited; + if Visible then Controller.PostCheckEdit; +end; + +procedure TcxCustomGridTableViewInfo.AfterOffset; +begin + FRecordsViewInfo.AfterOffset; +end; + +procedure TcxCustomGridTableViewInfo.BeforeOffset; +begin + FRecordsViewInfo.BeforeOffset; +end; + +procedure TcxCustomGridTableViewInfo.Calculate; +var + ANavigatorHeight, ANavigatorWidth: Integer; +begin + FRecordsViewInfo.MainCalculate; + inherited; + if FNavigatorSiteViewInfo.Visible then + begin + ANavigatorWidth := 0; + with GetNavigatorSiteBounds do + ANavigatorHeight := Bottom - Top; + FNavigatorViewInfo.CheckSize(ANavigatorWidth, ANavigatorHeight); + FNavigatorSize := Point(ANavigatorWidth, ANavigatorHeight); + FNavigatorSiteViewInfo.Calculate(GetNavigatorSiteBounds); + FNavigatorViewInfo.Calculate; + end; +end; + +function TcxCustomGridTableViewInfo.CalculateClientBounds: TRect; +begin + Result := inherited CalculateClientBounds; + Inc(Result.Top, PartsTopHeight); + Dec(Result.Bottom, PartsBottomHeight); +end; + +function TcxCustomGridTableViewInfo.CalculatePartBounds(APart: TcxCustomGridPartViewInfo): TRect; +var + I: Integer; +begin + Result := ClientBounds; + if APart.IsAutoWidth then + begin + Result.Left := Bounds.Left; + Result.Right := Bounds.Right; + end + else + Result.Right := Result.Left + APart.CalculateWidth; + + for I := PartCount - 1 downto APart.Index do + case Parts[I].Alignment of + gpaTop: + Dec(Result.Top, Parts[I].Height); + gpaBottom: + Inc(Result.Bottom, Parts[I].Height); + end; + case APart.Alignment of + gpaTop: + Result.Bottom := Result.Top + APart.Height; + gpaBottom: + Result.Top := Result.Bottom - APart.Height; + end; +end; + +function TcxCustomGridTableViewInfo.CalculateVisibleEqualHeightRecordCount: Integer; +begin + Result := -1; +end; + +procedure TcxCustomGridTableViewInfo.ControlFocusChanged; +begin + inherited; + RecordsViewInfo.ControlFocusChanged; +end; + +function TcxCustomGridTableViewInfo.DoGetHitTest(const P: TPoint): TcxCustomGridHitTest; +var + I: Integer; +begin + if PtInRect(Site.ClientBounds, P) then + begin + for I := 0 to PartCount - 1 do + if Parts[I].Visible then + begin + Result := Parts[I].GetHitTest(P); + if Result <> nil then Exit; + end; + Result := RecordsViewInfo.GetHitTest(P); + end + else + Result := FNavigatorSiteViewInfo.GetHitTest(P); + if Result = nil then + Result := inherited DoGetHitTest(P); +end; + +function TcxCustomGridTableViewInfo.GetDefaultGridModeBufferCount: Integer; +begin + Result := 0; +end; + +procedure TcxCustomGridTableViewInfo.GetHScrollBarBounds(var ABounds: TRect); +begin + inherited; + if FNavigatorSiteViewInfo.Visible then + Inc(ABounds.Left, FNavigatorSiteViewInfo.Width); +end; + +function TcxCustomGridTableViewInfo.GetFilterViewInfoClass: TcxGridFilterViewInfoClass; +begin + Result := TcxGridFilterViewInfo; +end; + +function TcxCustomGridTableViewInfo.GetIsInternalUse: Boolean; +begin + Result := inherited GetIsInternalUse or FirstRecordIndexAssigned; +end; + +function TcxCustomGridTableViewInfo.GetNavigatorOffset: Integer; +begin + Result := GridView.OptionsView.NavigatorOffset; +end; + +function TcxCustomGridTableViewInfo.GetNavigatorSiteBounds: TRect; +begin + if Site.HScrollBarVisible then + begin + Result := TcxControlAccess(Site).GetHScrollBarBounds; + with Result do + begin + Right := Left; + Left := Right - FNavigatorSiteViewInfo.Width; + end; + end + else + begin + Result := Site.ClientBounds; + if Site.VScrollBarVisible then + Inc(Result.Right, Site.VScrollBar.Width); + Result.Top := Result.Bottom; + Inc(Result.Bottom, NavigatorSiteViewInfo.Height); + end; +end; + +function TcxCustomGridTableViewInfo.GetNavigatorSiteViewInfoClass: TcxNavigatorSiteViewInfoClass; +begin + Result := TcxNavigatorSiteViewInfo; +end; + +function TcxCustomGridTableViewInfo.GetNavigatorViewInfoClass: TcxNavigatorViewInfoClass; +begin + Result := TcxNavigatorViewInfo; +end; + +function TcxCustomGridTableViewInfo.GetNoDataInfoText: string; +begin + Result := GridView.OptionsView.GetNoDataToDisplayInfoText; +end; + +function TcxCustomGridTableViewInfo.GetNoDataInfoTextAreaBounds: TRect; +begin + if IsRectEmpty(RecordsViewInfo.ContentBounds) then + Result := ClientBounds + else + IntersectRect(Result, ClientBounds, RecordsViewInfo.ContentBounds); +end; + +procedure TcxCustomGridTableViewInfo.GetNoDataInfoTextParams(out AParams: TcxViewParams); +begin + GridView.Styles.GetViewParams(vsBackground, nil, nil, AParams); +end; + +function TcxCustomGridTableViewInfo.GetNoDataInfoTextAreaVisible: Boolean; +begin + Result := RecordsViewInfo.IsEmpty and (NoDataInfoText <> ''); +end; + +function TcxCustomGridTableViewInfo.GetNonRecordsAreaHeight(ACheckScrollBar: Boolean): Integer; +begin + Result := PartsTopHeight + PartsBottomHeight; + if ACheckScrollBar then AddScrollBarHeight(Result); +end; + +function TcxCustomGridTableViewInfo.GetScrollableAreaBounds: TRect; +begin + Result := ClientBounds; +end; + +function TcxCustomGridTableViewInfo.GetScrollableAreaBoundsForEdit: TRect; +begin + Result := ScrollableAreaBounds; +end; + +function TcxCustomGridTableViewInfo.GetScrollableAreaBoundsHorz: TRect; +begin + Result := ScrollableAreaBounds; +end; + +function TcxCustomGridTableViewInfo.GetScrollableAreaBoundsVert: TRect; +begin + Result := ScrollableAreaBounds; +end; + +function TcxCustomGridTableViewInfo.FirstRecordIndexAssigned: Boolean; +begin + Result := FFirstRecordIndex <> RecordIndexNone; +end; + +procedure TcxCustomGridTableViewInfo.Offset(ARecordCountDelta: Integer); +begin + RecordsViewInfo.Offset(ARecordCountDelta); +end; + +procedure TcxCustomGridTableViewInfo.Offset(DX, DY: Integer); +begin + RecordsViewInfo.Offset(DX, DY); +end; + +procedure TcxCustomGridTableViewInfo.VisibilityChanged(AVisible: Boolean); +begin + RecordsViewInfo.VisibilityChanged(AVisible); + inherited; // should be here for correct hiding (focus) +end; + +function TcxCustomGridTableViewInfo.CanOffset(ARecordCountDelta, DX, DY: Integer): Boolean; +begin + Result := True; +end; + +function TcxCustomGridTableViewInfo.CanOffsetView(ARecordCountDelta: Integer): Boolean; +begin + Result := RecordsViewInfo.CanOffset(ARecordCountDelta); +end; + +procedure TcxCustomGridTableViewInfo.DoOffset(ARecordCountDelta, DX, DY: Integer); +begin + if CanOffset(ARecordCountDelta, DX, DY) then + begin + Controller.BeforeOffset; + BeforeOffset; + if ARecordCountDelta <> 0 then + Offset(ARecordCountDelta) + else + Offset(DX, DY); + AfterOffset; + Controller.AfterOffset; + end + else + Recalculate; +end; + +function TcxCustomGridTableViewInfo.GetNearestPopupHeight(AHeight: Integer; + AAdditionalRecord: Boolean = False): Integer; +begin + Result := AHeight; +end; + +function TcxCustomGridTableViewInfo.GetPopupHeight(ADropDownRecordCount: Integer): Integer; +begin + Result := 0; +end; + +{ TcxCustomGridTableViewInfoCacheItem } + +function TcxCustomGridTableViewInfoCacheItem.GetGridRecord: TcxCustomGridRecord; +begin + Result := TcxCustomGridTableViewInfoCache(Owner).ViewData.Records[Index]; +end; + +procedure TcxCustomGridTableViewInfoCacheItem.SetHeight(Value: Integer); +begin + FHeight := Value; + FIsHeightAssigned := True; +end; + +procedure TcxCustomGridTableViewInfoCacheItem.UnassignValues(AKeepMaster: Boolean); +begin + inherited; + FIsHeightAssigned := False; +end; + +{ TcxCustomGridTableViewInfoCache } + +function TcxCustomGridTableViewInfoCache.GetViewData: TcxCustomGridTableViewData; +begin + Result := TcxCustomGridTableViewData(inherited ViewData); +end; + +function TcxCustomGridTableViewInfoCache.GetItemClass(Index: Integer): TcxCustomGridViewInfoCacheItemClass; +begin + Result := ViewData.Records[Index].GetViewInfoCacheItemClass; +end; + +{ TcxCustomGridTableItemCustomOptions } + +constructor TcxCustomGridTableItemCustomOptions.Create(AItem: TcxCustomGridTableItem); +begin + inherited Create; + FItem := AItem; +end; + +function TcxCustomGridTableItemCustomOptions.GetGridView: TcxCustomGridTableView; +begin + Result := FItem.GridView; +end; + +procedure TcxCustomGridTableItemCustomOptions.Changed(AChange: TcxGridTableItemChange = ticLayout); +begin + FItem.Changed(AChange); +end; + +procedure TcxCustomGridTableItemCustomOptions.Assign(Source: TPersistent); +begin + if not (Source is TcxCustomGridTableItemCustomOptions) then + inherited; +end; + +{ TcxCustomGridTableItemOptions } + +constructor TcxCustomGridTableItemOptions.Create(AItem: TcxCustomGridTableItem); +begin + inherited; + FEditing := True; + FFiltering := True; + FFilteringFilteredItemsList := True; + FFilteringMRUItemsList := True; + FFilteringPopup := True; + FFilteringPopupMultiSelect := True; + FFocusing := True; + FGrouping := True; + FIgnoreTimeForFiltering := True; + FIncSearch := True; + FMoving := True; + FShowCaption := True; + FSorting := True; +end; + +procedure TcxCustomGridTableItemOptions.SetEditing(Value: Boolean); +begin + if FEditing <> Value then + begin + FEditing := Value; + if not FEditing then FItem.Editing := False; + Changed(ticLayout); + end; +end; + +procedure TcxCustomGridTableItemOptions.SetFiltering(Value: Boolean); +begin + if FFiltering <> Value then + begin + FFiltering := Value; + GridView.RefreshFilterableItemsList; + Changed; + end; +end; + +procedure TcxCustomGridTableItemOptions.SetFilteringFilteredItemsList(Value: Boolean); +begin + if FFilteringFilteredItemsList <> Value then + begin + FFilteringFilteredItemsList := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItemOptions.SetFilteringMRUItemsList(Value: Boolean); +begin + if FFilteringMRUItemsList <> Value then + begin + FFilteringMRUItemsList := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItemOptions.SetFilteringPopup(Value: Boolean); +begin + if FFilteringPopup <> Value then + begin + FFilteringPopup := Value; + Changed(ticSize); + end; +end; + +procedure TcxCustomGridTableItemOptions.SetFilteringPopupMultiSelect(Value: Boolean); +begin + if FFilteringPopupMultiSelect <> Value then + begin + FFilteringPopupMultiSelect := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItemOptions.SetFocusing(Value: Boolean); +begin + if FFocusing <> Value then + begin + FFocusing := Value; + if not FFocusing then Item.Focused := False; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItemOptions.SetGrouping(Value: Boolean); +begin + if FGrouping <> Value then + begin + FGrouping := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItemOptions.SetIgnoreTimeForFiltering(Value: Boolean); +begin + if FIgnoreTimeForFiltering <> Value then + begin + FIgnoreTimeForFiltering := Value; + GridView.DataController.Refresh; + end; +end; + +procedure TcxCustomGridTableItemOptions.SetIncSearch(Value: Boolean); +begin + if FIncSearch <> Value then + begin + if not Value and Item.IncSearching then + GridView.Controller.CancelIncSearching; + FIncSearch := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItemOptions.SetMoving(Value: Boolean); +begin + if FMoving <> Value then + begin + FMoving := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItemOptions.SetShowCaption(Value: Boolean); +begin + if FShowCaption <> Value then + begin + BeforeShowCaptionChange; + FShowCaption := Value; + Changed(ticSize); + end; +end; + +procedure TcxCustomGridTableItemOptions.SetShowEditButtons(Value: TcxGridItemShowEditButtons); +begin + if FShowEditButtons <> Value then + begin + FShowEditButtons := Value; + Changed(ticSize); + end; +end; + +procedure TcxCustomGridTableItemOptions.SetSortByDisplayText(Value: TcxGridItemSortByDisplayText); +begin + if FSortByDisplayText <> Value then + begin + FSortByDisplayText := Value; + GridView.DataController.SortByDisplayTextChanged; + end; +end; + +procedure TcxCustomGridTableItemOptions.SetSorting(Value: Boolean); +begin + if FSorting <> Value then + begin + FSorting := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItemOptions.BeforeShowCaptionChange; +begin +end; + +procedure TcxCustomGridTableItemOptions.Assign(Source: TPersistent); +begin + if Source is TcxCustomGridTableItemOptions then + with TcxCustomGridTableItemOptions(Source) do + begin + Self.Editing := Editing; + Self.Filtering := Filtering; + Self.FilteringFilteredItemsList := FilteringFilteredItemsList; + Self.FilteringMRUItemsList := FilteringMRUItemsList; + Self.FilteringPopup := FilteringPopup; + Self.FilteringPopupMultiSelect := FilteringPopupMultiSelect; + Self.Focusing := Focusing; + Self.Grouping := Grouping; + Self.IgnoreTimeForFiltering := IgnoreTimeForFiltering; + Self.IncSearch := IncSearch; + Self.Moving := Moving; + Self.ShowCaption := ShowCaption; + Self.ShowEditButtons := ShowEditButtons; + Self.SortByDisplayText := SortByDisplayText; + Self.Sorting := Sorting; + end; + inherited; +end; + +{ TcxCustomGridTableItemStyles } + +function TcxCustomGridTableItemStyles.GetGridViewValue: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited GridView); +end; + +function TcxCustomGridTableItemStyles.GetItem: TcxCustomGridTableItem; +begin + Result := TcxCustomGridTableItem(GetOwner); +end; + +procedure TcxCustomGridTableItemStyles.SetOnGetContentStyle(Value: TcxGridGetCellStyleEvent); +begin + if @FOnGetContentStyle <> @Value then + begin + FOnGetContentStyle := Value; + Item.Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItemStyles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +begin + case Index of + isContent: + GridView.Styles.GetRecordContentParams(TcxCustomGridRecord(AData), Item, AParams); + else + inherited; + end; +end; + +function TcxCustomGridTableItemStyles.GetGridView: TcxCustomGridView; +begin + Result := Item.GridView; +end; + +procedure TcxCustomGridTableItemStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxCustomGridTableItemStyles then + with TcxCustomGridTableItemStyles(Source) do + begin + Self.Content := Content; + Self.OnGetContentStyle := OnGetContentStyle; + end; +end; + +procedure TcxCustomGridTableItemStyles.GetContentParams(ARecord: TcxCustomGridRecord; + out AParams: TcxViewParams); +var + AStyle: TcxStyle; +begin + AStyle := nil; + if (ARecord <> nil) and Assigned(FOnGetContentStyle) then + FOnGetContentStyle(GridView, ARecord, Item, AStyle); + GetViewParams(isContent, ARecord, AStyle, AParams); +end; + +{ TcxCustomGridTableItem } + +constructor TcxCustomGridTableItem.Create(AOwner: TComponent); +begin + inherited; + FCells := TList.Create; + FIndex := -1; + FMinWidth := cxGridItemDefaultMinWidth; + FVisibleIndex := -1; + FVisibleForCustomization := True; + CreateSubClasses; +end; + +destructor TcxCustomGridTableItem.Destroy; +var + I: Integer; +begin + if not GridView.IsDestroying and GridView.IsDesigning then + Controller.DesignController.UnselectObject(Self); + RepositoryItem := nil; + FGridView.RemoveItem(Self); + {if FLastUsedDefaultRepositoryItem <> nil then + ItemRemoved(FLastUsedDefaultRepositoryItem);} + DestroySubClasses; + FreeAndNil(FEditData); + FreeAndNil(FCellStyle); + for I := 0 to CellCount - 1 do Cells[I].FItem := nil; + FCells.Free; + inherited; +end; + +function TcxCustomGridTableItem.GetActualMinWidth: Integer; +begin + if HasFixedWidth then + Result := 0 + else + Result := FMinWidth; +end; + +function TcxCustomGridTableItem.GetCaption: string; +begin + if FIsCaptionAssigned then + Result := FCaption + else + Result := DefaultCaption; +end; + +function TcxCustomGridTableItem.GetCell(Index: Integer): TcxGridTableDataCellViewInfo; +begin + Result := TcxGridTableDataCellViewInfo(FCells[Index]); +end; + +function TcxCustomGridTableItem.GetCellCount: Integer; +begin + Result := FCells.Count; +end; + +function TcxCustomGridTableItem.GetController: TcxCustomGridTableController; +begin + Result := FGridView.Controller; +end; + +function TcxCustomGridTableItem.GetDataController: TcxCustomDataController; +begin + Result := FGridView.DataController; +end; + +function TcxCustomGridTableItem.GetEditing: Boolean; +begin + Result := Controller.EditingItem = Self; +end; + +function TcxCustomGridTableItem.GetEditingProperties: TcxCustomEditProperties; +begin + if Controller.EditingController.IsEditing then + Result := Controller.EditingController.Edit.ActiveProperties + else + Result := GetPropertiesForEdit; +end; + +function TcxCustomGridTableItem.GetFilterCaption: string; +begin + Result := GetAlternateCaption; +end; + +function TcxCustomGridTableItem.GetFiltered: Boolean; +begin + Result := FDataBinding.Filtered; +end; + +function TcxCustomGridTableItem.GetFocused: Boolean; +begin + Result := Controller.FocusedItem = Self; +end; + +function TcxCustomGridTableItem.GetGroupIndex: Integer; +begin + Result := DataController.Groups.ItemGroupIndex[Index]; +end; + +function TcxCustomGridTableItem.GetHeaderAlignmentHorz: TAlignment; +begin + if FIsHeaderAlignmentHorzAssigned then + Result := FHeaderAlignmentHorz + else + Result := DefaultHeaderAlignmentHorz; +end; + +function TcxCustomGridTableItem.GetHeaderAlignmentVert: TcxAlignmentVert; +begin + if FIsHeaderAlignmentVertAssigned then + Result := FHeaderAlignmentVert + else + Result := DefaultHeaderAlignmentVert; +end; + +function TcxCustomGridTableItem.GetHidden: Boolean; +begin + Result := not VisibleForCustomization; +end; + +function TcxCustomGridTableItem.GetIsLoading: Boolean; +begin + Result := not FIgnoreLoadingStatus and + ((csLoading in ComponentState) or FGridView.IsLoading); +end; + +function TcxCustomGridTableItem.GetIncSearching: Boolean; +begin + Result := Controller.IncSearchingItem = Self; +end; + +function TcxCustomGridTableItem.GetIsDestroying: Boolean; +begin + Result := csDestroying in ComponentState; +end; + +function TcxCustomGridTableItem.GetIsFirst: Boolean; +begin + Result := VisibleIndex = 0; +end; + +function TcxCustomGridTableItem.GetIsLast: Boolean; +begin + Result := VisibleIndex = FGridView.VisibleItemCount - 1; +end; + +function TcxCustomGridTableItem.GetIsReading: Boolean; +begin + Result := csReading in ComponentState; +end; + +function TcxCustomGridTableItem.GetIsUpdating: Boolean; +begin + Result := csUpdating in ComponentState; +end; + +function TcxCustomGridTableItem.GetMinWidth: Integer; +begin + if HasFixedWidth then + Result := Width + else + Result := FMinWidth; +end; + +function TcxCustomGridTableItem.GetPropertiesClassName: string; +begin + if FProperties = nil then + Result := '' + else + Result := FProperties.ClassName; +end; + +function TcxCustomGridTableItem.GetSortIndex: Integer; +begin + Result := DataController.GetItemSortingIndex(Index); +end; + +function TcxCustomGridTableItem.GetSortOrder: TcxGridSortOrder; +begin + Result := DataController.GetItemSortOrder(Index); +end; + +function TcxCustomGridTableItem.GetTag: TcxTag; +begin + Result := inherited Tag; +end; + +function TcxCustomGridTableItem.GetViewData: TcxCustomGridTableViewData; +begin + Result := FGridView.ViewData; +end; + +function TcxCustomGridTableItem.GetWidth: Integer; +begin + if FIsWidthAssigned then + Result := FWidth + else + Result := DefaultWidth; +end; + +procedure TcxCustomGridTableItem.SetAlternateCaption(const Value: string); +begin + if FAlternateCaption <> Value then + begin + FAlternateCaption := Value; + CaptionChanged; + end; +end; + +procedure TcxCustomGridTableItem.SetBestFitMaxWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FBestFitMaxWidth <> Value then + begin + FBestFitMaxWidth := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItem.SetCaption(const Value: string); +begin + if Caption <> Value then + begin + FCaption := Value; + FIsCaptionAssigned := True; + CaptionChanged; + end; +end; + +procedure TcxCustomGridTableItem.SetDataBinding(Value: TcxGridItemDataBinding); +begin + FDataBinding.Assign(Value); +end; + +procedure TcxCustomGridTableItem.SetDateTimeGrouping(Value: TcxGridDateTimeGrouping); +begin + if FDateTimeGrouping <> Value then + begin + FDateTimeGrouping := Value; + DateTimeGroupingChanged; + end; +end; + +procedure TcxCustomGridTableItem.SetEditing(Value: Boolean); +begin + if Value then + Controller.EditingItem := Self + else + if Editing then + Controller.EditingItem := nil; +end; + +procedure TcxCustomGridTableItem.SetFiltered(Value: Boolean); +begin + FDataBinding.Filtered := Value; +end; + +procedure TcxCustomGridTableItem.SetFocused(Value: Boolean); +begin + if Value then + Controller.FocusedItem := Self + else + if Focused then + if not Controller.FocusNextItem(VisibleIndex, True, True, False) then + Controller.FocusedItem := nil; +end; + +procedure TcxCustomGridTableItem.SetGroupIndex(Value: Integer); +begin + if FGridView.IsAssigningItems and (Value <> -1) then + FGridView.AssigningGroupedItems[Value] := Self + else + ChangeGroupIndex(Value); +end; + +procedure TcxCustomGridTableItem.SetHeaderAlignmentHorz(Value: TAlignment); +begin + if HeaderAlignmentHorz <> Value then + begin + FHeaderAlignmentHorz := Value; + FIsHeaderAlignmentHorzAssigned := True; + Changed(ticLayout); + end; +end; + +procedure TcxCustomGridTableItem.SetHeaderAlignmentVert(Value: TcxAlignmentVert); +begin + if HeaderAlignmentVert <> Value then + begin + FHeaderAlignmentVert := Value; + FIsHeaderAlignmentVertAssigned := True; + Changed(ticLayout); + end; +end; + +procedure TcxCustomGridTableItem.SetHidden(Value: Boolean); +begin + VisibleForCustomization := not Value; +end; + +procedure TcxCustomGridTableItem.SetIndex(Value: Integer); +begin + if FGridView.IsRestoring then + FGridView.RestoringItems[Value] := Self + else + FGridView.ChangeItemIndex(Self, Value); +end; + +procedure TcxCustomGridTableItem.SetMinWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FMinWidth <> Value then + begin + FMinWidth := Value; + if IsLoading then Exit; + if Width < FMinWidth then + Width := FMinWidth + else + Changed(ticSize); + end; +end; + +procedure TcxCustomGridTableItem.SetOnCustomDrawCell(Value: TcxGridTableDataCellCustomDrawEvent); +begin + if @FOnCustomDrawCell <> @Value then + begin + FOnCustomDrawCell := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItem.SetOnGetCellHint(Value: TcxGridGetCellHintEvent); +begin + if @FOnGetCellHint <> @Value then + begin + FOnGetCellHint := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItem.SetOnGetDataText(Value: TcxGridGetDataTextEvent); +begin + if @FOnGetDataText <> @Value then + begin + FOnGetDataText := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItem.SetOnGetDisplayText(Value: TcxGridGetDisplayTextEvent); +begin + if @FOnGetDisplayText <> @Value then + begin + FOnGetDisplayText := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItem.SetOnGetFilterDisplayText(Value: TcxGridGetFilterDisplayTextEvent); +begin + if @FOnGetFilterDisplayText <> @Value then + begin + FOnGetFilterDisplayText := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItem.SetOnGetFilterValues(Value: TcxGridGetFilterValuesEvent); +begin + if @FOnGetFilterValues <> @Value then + begin + FOnGetFilterValues := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItem.SetOnGetProperties(Value: TcxGridGetPropertiesEvent); +begin + if @FOnGetProperties <> @Value then + begin + FOnGetProperties := Value; + Changed(ticLayout); + end; +end; + +procedure TcxCustomGridTableItem.SetOnGetPropertiesForEdit(Value: TcxGridGetPropertiesEvent); +begin + if @FOnGetPropertiesForEdit <> @Value then + begin + FOnGetPropertiesForEdit := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItem.SetOnGetStoredProperties(Value: TcxGridTableItemGetStoredPropertiesEvent); +begin + if @FOnGetStoredProperties <> @Value then + begin + FOnGetStoredProperties := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItem.SetOnGetStoredPropertyValue(Value: TcxGridTableItemGetStoredPropertyValueEvent); +begin + if @FOnGetStoredPropertyValue <> @Value then + begin + FOnGetStoredPropertyValue := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItem.SetOnInitFilteringDateRanges(Value: TcxGridInitDateRangesEvent); +begin + if @FOnInitFilteringDateRanges <> @Value then + begin + FOnInitFilteringDateRanges := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItem.SetOnInitGroupingDateRanges(Value: TcxGridInitDateRangesEvent); +begin + if @FOnInitGroupingDateRanges <> @Value then + begin + FOnInitGroupingDateRanges := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItem.SetOnSetStoredPropertyValue(Value: TcxGridTableItemSetStoredPropertyValueEvent); +begin + if @FOnSetStoredPropertyValue <> @Value then + begin + FOnSetStoredPropertyValue := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItem.SetOnUserFiltering(Value: TcxGridUserFilteringEvent); +begin + if @FOnUserFiltering <> @Value then + begin + FOnUserFiltering := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItem.SetOptions(Value: TcxCustomGridTableItemOptions); +begin + FOptions.Assign(Value); +end; + +procedure TcxCustomGridTableItem.SetProperties(Value: TcxCustomEditProperties); +begin + if (FProperties <> nil) and (Value <> nil) then FProperties.Assign(Value); +end; + +procedure TcxCustomGridTableItem.SetPropertiesClass(Value: TcxCustomEditPropertiesClass); +begin + if FPropertiesClass <> Value then + begin + if FProperties <> nil then + Controller.EditingController.RemoveEdit(FProperties); + FPropertiesClass := Value; + RecreateProperties; + PropertiesValueChanged; + PropertiesChanged; + end; +end; + +procedure TcxCustomGridTableItem.SetPropertiesClassName(const Value: string); +begin + PropertiesClass := TcxCustomEditPropertiesClass(GetRegisteredEditProperties.FindByClassName(Value)); +end; + +procedure TcxCustomGridTableItem.SetRepositoryItem(Value: TcxEditRepositoryItem); +begin + if FRepositoryItem <> Value then + begin + if FRepositoryItem <> nil then + begin + FRepositoryItem.RemoveListener(Self); + Controller.EditingController.RemoveEdit(FRepositoryItem.Properties); + end; + FRepositoryItem := Value; + if FRepositoryItem <> nil then + FRepositoryItem.AddListener(Self); + PropertiesValueChanged; + PropertiesChanged; + end; +end; + +procedure TcxCustomGridTableItem.SetSortIndex(Value: Integer); +begin + if FGridView.IsAssigningItems and (Value <> -1) then + FGridView.AssigningSortedItems[Value] := Self + else + ChangeSortIndex(Value); +end; + +procedure TcxCustomGridTableItem.SetSortOrder(Value: TcxGridSortOrder); +begin + if SortOrder <> Value then + begin + ShowHourglassCursor; + try + DataController.ChangeSorting(Index, Value); + finally + HideHourglassCursor; + end; + end; +end; + +procedure TcxCustomGridTableItem.SetStyles(Value: TcxCustomGridTableItemStyles); +begin + FStyles.Assign(Value); +end; + +procedure TcxCustomGridTableItem.SetTag(Value: TcxTag); +begin + if Tag <> Value then + begin + inherited Tag := Value; + Changed(ticProperty); + end; +end; + +procedure TcxCustomGridTableItem.SetVisible(Value: Boolean); +begin + if Visible <> Value then + begin + GridView.SaveItemVisibles; + FVisible := Value; + VisibleChanged; + GridView.CheckItemVisibles; + GridView.RefreshCustomizationForm; + end; +end; + +procedure TcxCustomGridTableItem.SetVisibleForCustomization(Value: Boolean); +begin + if VisibleForCustomization <> Value then + begin + FVisibleForCustomization := Value; + VisibleForCustomizationChanged; + end; +end; + +procedure TcxCustomGridTableItem.SetWidth(Value: Integer); +begin + CheckWidthValue(Value); + if IsLoading or (Width <> Value) then + begin + FWidth := Value; + FIsWidthAssigned := True; + Changed(ticSize); + end; +end; + +procedure TcxCustomGridTableItem.ReadHidden(Reader: TReader); +begin + Hidden := Reader.ReadBoolean; +end; + +procedure TcxCustomGridTableItem.ReadIsCaptionAssigned(Reader: TReader); +begin + FIsCaptionAssigned := Reader.ReadBoolean; +end; + +procedure TcxCustomGridTableItem.WriteIsCaptionAssigned(Writer: TWriter); +begin + Writer.WriteBoolean(FIsCaptionAssigned); +end; + +function TcxCustomGridTableItem.IsCaptionStored: Boolean; +begin + Result := FIsCaptionAssigned and (FCaption <> DefaultCaption); +end; + +function TcxCustomGridTableItem.IsSortOrderStored: Boolean; +begin + Result := (SortOrder <> soNone) and (SortIndex <> -1); +end; + +function TcxCustomGridTableItem.IsTagStored: Boolean; +begin + Result := Tag <> 0; +end; + +function TcxCustomGridTableItem.IsWidthStored: Boolean; +begin + Result := FIsWidthAssigned //and (FWidth <> DefaultWidth); +end; + +function TcxCustomGridTableItem.GetDataBindingClass: TcxGridItemDataBindingClass; +begin + Result := FGridView.GetItemDataBindingClass; +end; + +procedure TcxCustomGridTableItem.CreateProperties; +begin + if FPropertiesClass <> nil then + begin + FProperties := FPropertiesClass.Create(Self); + FProperties.OnPropertiesChanged := PropertiesChangedHandler; + end; +end; + +procedure TcxCustomGridTableItem.DestroyProperties; +begin + FreeAndNil(FProperties); +end; + +procedure TcxCustomGridTableItem.RecreateProperties; +begin + DestroyProperties; + CreateProperties; +end; + +procedure TcxCustomGridTableItem.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('Hidden', ReadHidden, nil, True); + Filer.DefineProperty('IsCaptionAssigned', ReadIsCaptionAssigned, WriteIsCaptionAssigned, + FIsCaptionAssigned and (Caption = '')); +end; + +procedure TcxCustomGridTableItem.SetParentComponent(AParent: TComponent); +begin + if AParent is TcxCustomGridTableView then + TcxCustomGridTableView(AParent).AddItem(Self); +end; + +procedure TcxCustomGridTableItem.ItemRemoved(Sender: TcxEditRepositoryItem); +begin + if Sender = FLastUsedDefaultRepositoryItem then + PropertiesValueChanged + else + RepositoryItem := nil; +end; + +procedure TcxCustomGridTableItem.RepositoryItemPropertiesChanged(Sender: TcxEditRepositoryItem); +begin + if not GridView.IsPattern then PropertiesChanged; +end; + +function TcxCustomGridTableItem.GetObjectName: string; +begin + if GridView.IsStoringNameMode then + Result := IntToStr(ID) + else + Result := Name; +end; + +function TcxCustomGridTableItem.GetStoredProperties(AProperties: TStrings): Boolean; +begin + with AProperties do + begin + Add('AlignmentHorz'); + Add('Index'); + Add('Visible'); + Add('SortOrder'); + Add('SortIndex'); + Add('WasVisibleBeforeGrouping'); + end; + if Assigned(FOnGetStoredProperties) then + FOnGetStoredProperties(Self, AProperties); + Result := True; +end; + +procedure TcxCustomGridTableItem.GetPropertyValue(const AName: string; var AValue: Variant); +begin + if AName = 'AlignmentHorz' then + AValue := Variant(GetProperties.Alignment.Horz) + else + if AName = 'Index' then + AValue := Index + else + if AName = 'Visible' then + AValue := Visible + else + if AName = 'SortOrder' then + AValue := Variant(SortOrder) + else + if AName = 'SortIndex' then + AValue := SortIndex + else + if AName = 'WasVisibleBeforeGrouping' then + AValue := WasVisibleBeforeGrouping + else + if Assigned(FOnGetStoredPropertyValue) then + FOnGetStoredPropertyValue(Self, AName, AValue); +end; + +procedure TcxCustomGridTableItem.SetPropertyValue(const AName: string; const AValue: Variant); +begin + if AName = 'AlignmentHorz' then + if GetProperties.Alignment.Horz <> TAlignment((AValue)) then + begin + if (FRepositoryItem = nil) and (FProperties = nil) then + PropertiesClass := TcxCustomEditPropertiesClass(GetProperties.ClassType); + GetProperties.Alignment.Horz := TAlignment((AValue)); + end + else + else + if AName = 'Index' then + Index := AValue + else + if AName = 'Visible' then + Visible := AValue + else + if AName = 'SortOrder' then + SortOrder := TcxDataSortOrder((AValue)) + else + if AName = 'SortIndex' then + SortIndex := AValue + else + if AName = 'WasVisibleBeforeGrouping' then + FWasVisibleBeforeGrouping := AValue + else + if Assigned(FOnSetStoredPropertyValue) then + FOnSetStoredPropertyValue(Self, AName, AValue); +end; + +procedure TcxCustomGridTableItem.CreateDataBinding; +begin + FDataBinding := GetDataBindingClass.Create(Self); + with FDataBinding do + ValueTypeClass := GetDefaultValueTypeClass; +end; + +procedure TcxCustomGridTableItem.DestroyDataBinding; +begin + FreeAndNil(FDataBinding); +end; + +procedure TcxCustomGridTableItem.CreateSubClasses; +begin + FFilteringDateRanges := GetFilteringDateRangesClass.Create; + FGroupingDateRanges := GetGroupingDateRangesClass.Create; + FOptions := GetOptionsClass.Create(Self); + FStyles := GetStylesClass.Create(Self); +end; + +procedure TcxCustomGridTableItem.DestroySubClasses; +begin + DestroyProperties; + FreeAndNil(FStyles); + FreeAndNil(FOptions); + FreeAndNil(FGroupingDateRanges); + FreeAndNil(FFilteringDateRanges); +end; + +function TcxCustomGridTableItem.GetFilteringDateRangesClass: TcxGridFilteringDateRangesClass; +begin + Result := TcxGridFilteringDateRanges; +end; + +function TcxCustomGridTableItem.GetGroupingDateRangesClass: TcxGridGroupingDateRangesClass; +begin + Result := TcxGridGroupingDateRanges; +end; + +function TcxCustomGridTableItem.GetOptionsClass: TcxCustomGridTableItemOptionsClass; +begin + Result := TcxCustomGridTableItemOptions; +end; + +function TcxCustomGridTableItem.GetStylesClass: TcxCustomGridTableItemStylesClass; +begin + Result := TcxCustomGridTableItemStyles; +end; + +function TcxCustomGridTableItem.IsHeaderAlignmentHorzStored: Boolean; +begin + Result := FIsHeaderAlignmentHorzAssigned and + (FHeaderAlignmentHorz <> DefaultHeaderAlignmentHorz); +end; + +function TcxCustomGridTableItem.IsHeaderAlignmentVertStored: Boolean; +begin + Result := FIsHeaderAlignmentVertAssigned and + (FHeaderAlignmentVert <> DefaultHeaderAlignmentVert); +end; + +procedure TcxCustomGridTableItem.BestFitApplied(AFireEvents: Boolean); +begin + Controller.DesignerModified; +end; + +function TcxCustomGridTableItem.CalculateBestFitWidth: Integer; +var + ACanvas: TcxCanvas; + AIsCalcByValue: Boolean; + AEditSizeProperties: TcxEditSizeProperties; + AParams: TcxViewParams; + AEditViewData: TcxCustomEditViewData; + I, AWidth: Integer; + ARecord: TcxCustomGridRecord; + AValue: Variant; + AEditMinContentSize: TSize; + + function GetFirstRecordIndex: Integer; + begin + Result := GridView.OptionsBehavior.BestFitMaxRecordCount; + if Result <> 0 then + begin + Result := Controller.TopRecordIndex; + if Result < 0 then Result := 0; + end; + end; + + function GetLastRecordIndex: Integer; + begin + Result := GridView.OptionsBehavior.BestFitMaxRecordCount; + if Result = 0 then + Result := ViewData.RecordCount + else + begin + Result := GetFirstRecordIndex + Result; + if Result > ViewData.RecordCount then + Result := ViewData.RecordCount; + end; + Dec(Result); + end; + +begin + Result := 0; + ACanvas := FGridView.Painter.Canvas; + AIsCalcByValue := GetProperties.GetEditValueSource(False) = evsValue; + with AEditSizeProperties do + begin + Height := -1; + MaxLineCount := 0; + Width := -1; + end; + AEditViewData := CreateEditViewData(GetProperties); + try + if GridView.ViewInfo.RecordsViewInfo.AutoDataCellHeight or + GridView.ViewInfo.RecordsViewInfo.IsCellMultiLine(Self) then + begin + Include(AEditViewData.PaintOptions, epoAutoHeight); + AEditViewData.MaxLineCount := GridView.OptionsView.CellTextMaxLineCount; + end; + AEditViewData.InplaceEditParams.Position.Item := Self; + + for I := GetFirstRecordIndex to GetLastRecordIndex do + begin + ARecord := ViewData.Records[I]; + if ARecord.HasCells then + begin + FStyles.GetContentParams(ARecord, AParams); + InitStyle(AEditViewData.Style, AParams, True); + if AIsCalcByValue then + AValue := ARecord.Values[FIndex] + else + AValue := ARecord.DisplayTexts[FIndex]; + AEditViewData.InplaceEditParams.Position.RecordIndex := ARecord.RecordIndex; + AEditViewData.Data := ARecord; + AWidth := AEditViewData.GetEditContentSize(ACanvas, AValue, AEditSizeProperties).cx; + if AWidth > Result then Result := AWidth; + end; + end; + + FStyles.GetContentParams(nil, AParams); + InitStyle(AEditViewData.Style, AParams, True); + AWidth := AEditViewData.GetEditConstantPartSize(ACanvas, AEditSizeProperties, + AEditMinContentSize).cx; + if Result < AEditMinContentSize.cx then + Result := AEditMinContentSize.cx; + Inc(Result, AWidth); + finally + DestroyEditViewData(AEditViewData); + end; + if Result <> 0 then + Inc(Result, 2 * cxGridEditOffset); +end; + +function TcxCustomGridTableItem.CanAutoHeight: Boolean; +begin + Result := esoAutoHeight in GetProperties.GetSupportedOperations; +end; + +function TcxCustomGridTableItem.CanEdit: Boolean; +begin + Result := CanFocus(Controller.FocusedRecord) and Editable and + (FocusedCellViewInfo <> nil) and (dceoShowEdit in DataController.EditOperations); +end; + +function TcxCustomGridTableItem.CanFilter(AVisually: Boolean): Boolean; +begin + Result := + (esoFiltering in GetProperties.GetSupportedOperations) and FOptions.Filtering and + (not AVisually or GridView.OptionsCustomize.ItemFiltering and FOptions.FilteringPopup); +end; + +function TcxCustomGridTableItem.CanFilterUsingChecks: Boolean; +begin + Result := GridView.Filtering.ItemPopup.MultiSelect and FOptions.FilteringPopupMultiSelect; +end; + +function TcxCustomGridTableItem.CanFilterMRUValueItems: Boolean; +begin + Result := GridView.Filtering.ItemMRUItemsList and FOptions.FilteringMRUItemsList and + not CanFilterUsingChecks; +end; + +function TcxCustomGridTableItem.CanFocus(ARecord: TcxCustomGridRecord): Boolean; +begin + Result := ActuallyVisible and FOptions.Focusing and + ((ARecord = nil) and GridView.OptionsSelection.CellSelect or + (ARecord <> nil) and ARecord.CanFocusCells); +end; + +function TcxCustomGridTableItem.CanGroup: Boolean; +begin + Result := (esoSorting in GetProperties.GetSupportedOperations) and + GridView.OptionsCustomize.ItemGrouping and FOptions.Grouping; +end; + +function TcxCustomGridTableItem.CanHide: Boolean; +begin + Result := not (IsFirst and IsLast) and CanMove; +end; + +function TcxCustomGridTableItem.CanHorzSize: Boolean; +begin + Result := not HasFixedWidth; +end; + +function TcxCustomGridTableItem.CanIgnoreTimeForFiltering: Boolean; +begin + Result := IsDateTimeValueTypeClass(FDataBinding.ValueTypeClass) and + GridView.DateTimeHandling.IgnoreTimeForFiltering and FOptions.IgnoreTimeForFiltering; +end; + +function TcxCustomGridTableItem.CanIncSearch: Boolean; +begin + Result := (esoIncSearch in GetProperties.GetSupportedOperations) and + GridView.OptionsBehavior.IncSearch and FOptions.IncSearch; +end; + +function TcxCustomGridTableItem.CanInitEditing: Boolean; +begin + Result := DataController.CanInitEditing(Index); +end; + +function TcxCustomGridTableItem.CanMove: Boolean; +begin + Result := IsDesigning or GridView.OptionsCustomize.ItemMoving and Options.Moving; +end; + +function TcxCustomGridTableItem.CanScroll: Boolean; +begin + Result := True; +end; + +function TcxCustomGridTableItem.CanSort: Boolean; +begin + Result := (esoSorting in GetProperties.GetSupportedOperations) and + GridView.OptionsCustomize.ItemSorting and Options.Sorting; +end; + +procedure TcxCustomGridTableItem.CaptionChanged; +begin + GridView.ItemCaptionChanged(Self); +end; + +procedure TcxCustomGridTableItem.Changed(AChange: TcxGridTableItemChange); +begin + if GridView <> nil then + GridView.Changed(TcxGridViewChangeKind(AChange)); +end; + +procedure TcxCustomGridTableItem.ChangeGroupIndex(Value: Integer); +begin + if GroupIndex <> Value then + begin + ShowHourglassCursor; + try + if (GroupIndex = -1) and not GridView.IsAfterAssigningItems then + FWasVisibleBeforeGrouping := Visible; + DataController.Groups.ChangeGrouping(Index, Value); + finally + HideHourglassCursor; + end; + end; +end; + +procedure TcxCustomGridTableItem.ChangeSortIndex(Value: Integer); +begin + if SortIndex <> Value then + begin + ShowHourglassCursor; + try + DataController.ChangeItemSortingIndex(Index, Value); + finally + HideHourglassCursor; + end; + end; +end; + +procedure TcxCustomGridTableItem.CheckWidthValue(var Value: Integer); +begin + if Value < ActualMinWidth then Value := ActualMinWidth; +end; + +procedure TcxCustomGridTableItem.DataChanged; +begin + FDataBinding.Init; +end; + +procedure TcxCustomGridTableItem.DateTimeGroupingChanged; +begin + InitGroupingDateRanges; + DataController.Refresh; +end; + +procedure TcxCustomGridTableItem.ForceWidth(Value: Integer); +begin + Controller.ForcingWidthItem := Self; + try + Width := Value; + finally + Controller.ForcingWidthItem := nil; + end; +end; + +function TcxCustomGridTableItem.GetActuallyVisible: Boolean; +begin + Result := Visible; +end; + +function TcxCustomGridTableItem.GetBestFitWidth: Integer; +begin + Result := CalculateBestFitWidth; + if (FBestFitMaxWidth <> 0) and (Result > FBestFitMaxWidth) then + Result := FBestFitMaxWidth; +end; + +function TcxCustomGridTableItem.GetDateTimeFilters: TcxGridDateTimeFilters; +begin + Result := GridView.DateTimeHandling.Filters; +end; + +function TcxCustomGridTableItem.GetDateTimeGrouping: TcxGridDateTimeGrouping; +begin + Result := FDateTimeGrouping; + if Result = dtgDefault then + Result := GridView.DateTimeHandling.Grouping; +end; + +function TcxCustomGridTableItem.GetEditable: Boolean; +begin + Result := GridView.OptionsData.Editing and FOptions.Editing; +end; + +function TcxCustomGridTableItem.GetEditPartVisible: Boolean; +var + R: TRect; +begin + if CanScroll then + begin + R := GridView.ViewInfo.ScrollableAreaBoundsForEdit; + with FocusedCellViewInfo.EditBounds do + Result := + (Left < R.Left) or (Right > R.Right) or + (Top < R.Top) or (Bottom > R.Bottom); + end + else + Result := False; +end; + +function TcxCustomGridTableItem.GetEditValue: Variant; +begin + if Controller.FocusedRecord <> nil then + Result := DataController.GetEditValue(Index, EditingProperties.GetEditValueSource(True)) + else + Result := Unassigned; +end; + +function TcxCustomGridTableItem.GetFilterable: Boolean; +begin + Result := CanFilter(False); +end; + +procedure TcxCustomGridTableItem.GetFilterDisplayText(const AValue: Variant; + var ADisplayText: string); +begin + if Assigned(FOnGetFilterDisplayText) then + FOnGetFilterDisplayText(Self, AValue, ADisplayText); +end; + +function TcxCustomGridTableItem.GetFixed: Boolean; +begin + Result := (Controller.ForcingWidthItem = Self) or HasFixedWidth; +end; + +function TcxCustomGridTableItem.GetFocusedCellViewInfo: TcxGridTableDataCellViewInfo; +begin + with Controller do + if FocusedRecordHasCells(False) and (FocusedRecord.ViewInfo <> nil) then + Result := FocusedRecord.ViewInfo.GetCellViewInfoByItem(Self) + else + Result := nil; +end; + +function TcxCustomGridTableItem.GetPropertiesForEdit: TcxCustomEditProperties; +begin + Result := GetProperties(Controller.FocusedRecord); + DoGetPropertiesForEdit(Controller.FocusedRecord, Result); + InitProperties(Result); +end; + +function TcxCustomGridTableItem.GetPropertiesValue: TcxCustomEditProperties; +begin + if FLastUsedDefaultRepositoryItem <> nil then + begin + FLastUsedDefaultRepositoryItem.RemoveListener(Self); + FLastUsedDefaultRepositoryItem := nil; + end; + if FGridView = nil then // because of EditViewData - it needs Style which needs GridView + Result := nil + else + if UseOwnProperties then + Result := FProperties + else + if GetRepositoryItem = nil then + Result := nil + else + Result := GetRepositoryItem.Properties; +end; + +function TcxCustomGridTableItem.GetVisible: Boolean; +begin + Result := FVisible; +end; + +function TcxCustomGridTableItem.GetVisibleCaption: string; +begin + Result := Caption; +end; + +function TcxCustomGridTableItem.GetVisibleForCustomization: Boolean; +begin + Result := FVisibleForCustomization; +end; + +function TcxCustomGridTableItem.GetVisibleIndex: Integer; +begin + Result := FGridView.FVisibleItems.IndexOf(Self); +end; + +function TcxCustomGridTableItem.GetVisibleInQuickCustomizationPopup: Boolean; +begin + Result := VisibleForCustomization; +end; + +procedure TcxCustomGridTableItem.GroupingChanging; +begin + if SupportsGroupingDateRanges(True) then + InitGroupingDateRanges; +end; + +function TcxCustomGridTableItem.HasCustomDrawCell: Boolean; +begin + Result := Assigned(FOnCustomDrawCell); +end; + +function TcxCustomGridTableItem.HasFixedWidth: Boolean; +begin + Result := False; +end; + +procedure TcxCustomGridTableItem.InitFilteringDateRanges; +begin + FilteringDateRanges.Init(GridView.DateTimeHandling, GetDateTimeFilters); + DoInitFilteringDateRanges; +end; + +procedure TcxCustomGridTableItem.InitGroupingDateRanges; +begin + GroupingDateRanges.Init(GridView.DateTimeHandling, GetDateTimeGrouping); + DoInitGroupingDateRanges; +end; + +procedure TcxCustomGridTableItem.InitProperties(AProperties: TcxCustomEditProperties); +begin + if AProperties <> nil then + with AProperties do + begin + LockUpdate(True); + IDefaultValuesProvider := GetDefaultValuesProvider(AProperties); + LockUpdate(False); + end; +end; + +function TcxCustomGridTableItem.IsSortingByDisplayText(ASortByDisplayText: Boolean): Boolean; +begin + if FOptions.SortByDisplayText = isbtDefault then + Result := HasDataTextHandler or ASortByDisplayText and + (esoSortingByDisplayText in GetProperties.GetSupportedOperations) + else + Result := FOptions.SortByDisplayText = isbtOn; +end; + +function TcxCustomGridTableItem.IsVisibleStored: Boolean; +begin + Result := True; +end; + +function TcxCustomGridTableItem.IsVisibleForCustomizationStored: Boolean; +begin + Result := not VisibleForCustomization; +end; + +procedure TcxCustomGridTableItem.PropertiesChanged; +begin + if GridView.PatternGridView.IgnorePropertiesChanges then Exit; + if not IsDestroying then + GridView.RefreshFilterableItemsList; + if FEditData <> nil then FEditData.Clear; + if not IsDestroying and not DataController.ItemPropertiesChanged(Index) then + Changed(ticSize); +end; + +procedure TcxCustomGridTableItem.PropertiesChangedHandler(Sender: TObject); +begin + if not GridView.IsPattern then PropertiesChanged; +end; + +procedure TcxCustomGridTableItem.PropertiesValueChanged; +begin + FPropertiesValue := GetPropertiesValue; + if not IsDestroying and (FPropertiesValue <> nil) then + DataController.SortByDisplayTextChanged; // for Options.SortByDisplayText = isbtDefault +end; + +procedure TcxCustomGridTableItem.RecalculateDefaultWidth; +begin + if not FIsWidthAssigned then + FWidth := DefaultWidth; +end; + +procedure TcxCustomGridTableItem.SetEditValue(const Value: Variant); +begin + DataController.SetEditValue(Index, Value, EditingProperties.GetEditValueSource(True)); +end; + +procedure TcxCustomGridTableItem.SetGridView(Value: TcxCustomGridTableView); +begin + FGridView := Value; + if Value <> nil then + CreateDataBinding + else + DestroyDataBinding; + PropertiesValueChanged; + if GridView <> nil then InitGroupingDateRanges; +end; + +function TcxCustomGridTableItem.ShowButtons(AFocused: Boolean): Boolean; +var + AGridShowEditButtons: TcxGridShowEditButtons; +begin + AGridShowEditButtons := FGridView.OptionsView.ShowEditButtons; + Result := + (FOptions.ShowEditButtons = isebAlways) or + (FOptions.ShowEditButtons = isebDefault) and + ((AGridShowEditButtons = gsebAlways) or + (AGridShowEditButtons = gsebForFocusedRecord) and AFocused); +end; + +function TcxCustomGridTableItem.ShowOnUngrouping: Boolean; +begin + Result := True; //!!! +end; + +function TcxCustomGridTableItem.SupportsDateTimeFilters(ARelativeFilters: Boolean): Boolean; +begin + Result := IsDateTimeValueTypeClass(FDataBinding.ValueTypeClass) and + (ARelativeFilters and (GetDateTimeFilters * DateTimeRelativeFilters <> []) or + not ARelativeFilters and + ((GetDateTimeFilters * DateTimeAbsoluteFilters <> []) or HasInitFilteringDateRangesHandlers)); +end; + +function TcxCustomGridTableItem.SupportsGroupingDateRanges(ACheckCustomHandlers: Boolean): Boolean; +begin + Result := IsDateTimeValueTypeClass(FDataBinding.ValueTypeClass) and + (ACheckCustomHandlers and HasInitGroupingDateRangesHandlers or + not ACheckCustomHandlers and not GroupingDateRanges.IsEmpty); +end; + +function TcxCustomGridTableItem.UseFilteredValuesForFilterValueList: Boolean; +begin + Result := GridView.Filtering.ItemFilteredItemsList and FOptions.FilteringFilteredItemsList; +end; + +function TcxCustomGridTableItem.UseOwnProperties: Boolean; +begin + Result := (FRepositoryItem = nil) and (FProperties <> nil); +end; + +procedure TcxCustomGridTableItem.ValueTypeClassChanged; +begin + FDataBinding.FilterMRUValueItems.ClearItems; + FDataBinding.Init; + PropertiesValueChanged; + if FProperties <> nil then + FProperties.Changed; +end; + +procedure TcxCustomGridTableItem.VisibleChanged; +begin +end; + +procedure TcxCustomGridTableItem.VisibleForCustomizationChanged; +begin + with FGridView do + begin + //RefreshFilterableItemsList; + RefreshCustomizationForm; + end; + Changed(ticProperty); +end; + +function TcxCustomGridTableItem.DefaultAlternateCaption: string; +begin + Result := Caption; +end; + +function TcxCustomGridTableItem.DefaultCaption: string; +begin + Result := FDataBinding.DefaultCaption; +end; + +function TcxCustomGridTableItem.DefaultHeaderAlignmentHorz: TAlignment; +begin + Result := taLeftJustify; +end; + +function TcxCustomGridTableItem.DefaultHeaderAlignmentVert: TcxAlignmentVert; +begin + Result := vaTop; +end; + +function TcxCustomGridTableItem.DefaultRepositoryItem: TcxEditRepositoryItem; +begin + if FDataBinding = nil then + Result := nil + else + Result := FDataBinding.DefaultRepositoryItem; +end; + +function TcxCustomGridTableItem.DefaultWidth: Integer; +begin + Result := FDataBinding.DefaultWidth; +end; + +function TcxCustomGridTableItem.GetCellStyle: TcxEditStyle; +begin + if FCellStyle = nil then + FCellStyle := CreateEditStyle; + Result := FCellStyle; + Inc(FCellStyleUseCounter); +end; + +procedure TcxCustomGridTableItem.InitStyle(AStyle: TcxCustomEditStyle; + const AParams: TcxViewParams; AFocused: Boolean); +begin + with AParams do + begin + AStyle.Color := Color; + AStyle.Font := Font; + AStyle.StyleData.FontColor := TextColor; + end; + with AStyle do + begin + if Self.ShowButtons(AFocused) then + ButtonTransparency := ebtNone + else + ButtonTransparency := ebtHideInactive; + HotTrack := True; + end; +end; + +procedure TcxCustomGridTableItem.ReleaseCellStyle; +begin + Dec(FCellStyleUseCounter); + if FCellStyleUseCounter = 0 then FreeAndNil(FCellStyle); +end; + +procedure TcxCustomGridTableItem.AddCell(ACell: TcxGridTableDataCellViewInfo); +begin + FCells.Add(ACell); +end; + +procedure TcxCustomGridTableItem.RemoveCell(ACell: TcxGridTableDataCellViewInfo); +begin + FCells.Remove(ACell); +end; + +function TcxCustomGridTableItem.CreateEditViewData(AProperties: TcxCustomEditProperties): TcxCustomEditViewData; +begin + if AProperties <> nil then + begin + Result := AProperties.CreateViewData(GetCellStyle, True); + Result.OnGetDisplayText := EditViewDataGetDisplayTextHandler; + end + else + Result := nil; +end; + +procedure TcxCustomGridTableItem.DestroyEditViewData(var AEditViewData: TcxCustomEditViewData); +begin + if AEditViewData <> nil then + begin + FreeAndNil(AEditViewData); + ReleaseCellStyle; + end; +end; + +procedure TcxCustomGridTableItem.DoCreateEditViewData; +begin + FEditViewData := CreateEditViewData(GetProperties); +end; + +procedure TcxCustomGridTableItem.DoDestroyEditViewData; +begin + DestroyEditViewData(FEditViewData); +end; + +procedure TcxCustomGridTableItem.EditViewDataGetDisplayTextHandler(Sender: TcxCustomEditViewData; + var AText: string); +var + AGridRecord: TcxCustomGridRecord; +begin + if Sender.Data is TcxCustomGridRecord then + AGridRecord := TcxCustomGridRecord(Sender.Data) + else + AGridRecord := nil; + DoGetDisplayText(AGridRecord, AText); +end; + +function TcxCustomGridTableItem.GetEditViewData(AProperties: TcxCustomEditProperties; + out AIsLocalCopy: Boolean): TcxCustomEditViewData; +begin + AIsLocalCopy := HasCustomPropertiesHandler or (FEditViewData = nil); + if AIsLocalCopy then + Result := CreateEditViewData(AProperties) + else + Result := FEditViewData; +end; + +procedure TcxCustomGridTableItem.ReleaseEditViewData(var AEditViewData: TcxCustomEditViewData; + AIsLocalCopy: Boolean); +begin + if AIsLocalCopy then + DestroyEditViewData(AEditViewData) + else + AEditViewData := nil; +end; + +procedure TcxCustomGridTableItem.CheckVisible; +begin + if ActuallyVisible <> FSavedVisible then + GridView.ItemVisibilityChanged(Self, ActuallyVisible); +end; + +procedure TcxCustomGridTableItem.SaveVisible; +begin + FSavedVisible := ActuallyVisible; +end; + +procedure TcxCustomGridTableItem.DoCustomDrawCell(ACanvas: TcxCanvas; + AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); +begin + if HasCustomDrawCell then + FOnCustomDrawCell(GridView, ACanvas, AViewInfo, ADone); +end; + +procedure TcxCustomGridTableItem.DoGetCellHint(ARecord: TcxCustomGridRecord; + ACellViewInfo: TcxGridTableDataCellViewInfo; const AMousePos: TPoint; + var AHintText: TCaption; var AIsHintMultiLine: Boolean; var AHintTextRect: TRect); +begin + if HasCellHintHandler then + FOnGetCellHint(Self, ARecord, ACellViewInfo, AMousePos, AHintText, AIsHintMultiLine, AHintTextRect); +end; + +procedure TcxCustomGridTableItem.DoGetDataText(ARecordIndex: Integer; + var AText: string); +begin + if HasDataTextHandler then FOnGetDataText(Self, ARecordIndex, AText); +end; + +procedure TcxCustomGridTableItem.DoGetDisplayText(ARecord: TcxCustomGridRecord; + var AText: string); +begin + if Assigned(FOnGetDisplayText) then FOnGetDisplayText(Self, ARecord, AText); +end; + +procedure TcxCustomGridTableItem.DoGetFilterValues(AValueList: TcxDataFilterValueList); +begin + if Assigned(FOnGetFilterValues) then FOnGetFilterValues(Self, AValueList); +end; + +function TcxCustomGridTableItem.DoGetProperties(ARecord: TcxCustomGridRecord): TcxCustomEditProperties; +begin + Result := FPropertiesValue; + if HasCustomPropertiesHandler then FOnGetProperties(Self, ARecord, Result); +end; + +procedure TcxCustomGridTableItem.DoGetPropertiesForEdit(ARecord: TcxCustomGridRecord; + var AProperties: TcxCustomEditProperties); +begin + if HasCustomPropertiesForEditHandler then + FOnGetPropertiesForEdit(Self, ARecord, AProperties); +end; + +procedure TcxCustomGridTableItem.DoInitFilteringDateRanges; +begin + GridView.DoInitFilteringDateRanges(Self); + if HasInitFilteringDateRangesHandler then + FOnInitFilteringDateRanges(Self, FilteringDateRanges); +end; + +procedure TcxCustomGridTableItem.DoInitGroupingDateRanges; +begin + GridView.DoInitGroupingDateRanges(Self); + if HasInitGroupingDateRangesHandler then + FOnInitGroupingDateRanges(Self, GroupingDateRanges); +end; + +procedure TcxCustomGridTableItem.DoUserFiltering(const AValue: Variant; const ADisplayText: string); +begin + if Assigned(FOnUserFiltering) then FOnUserFiltering(Self, AValue, ADisplayText); +end; + +function TcxCustomGridTableItem.HasCellHintHandler: Boolean; +begin + Result := Assigned(FOnGetCellHint); +end; + +function TcxCustomGridTableItem.HasCustomPropertiesForEditHandler: Boolean; +begin + Result := Assigned(FOnGetPropertiesForEdit); +end; + +function TcxCustomGridTableItem.HasCustomPropertiesHandler: Boolean; +begin + Result := Assigned(FOnGetProperties); +end; + +function TcxCustomGridTableItem.HasDataTextHandler: Boolean; +begin + Result := Assigned(FOnGetDataText); +end; + +function TcxCustomGridTableItem.HasInitFilteringDateRangesHandler: Boolean; +begin + Result := Assigned(FOnInitFilteringDateRanges); +end; + +function TcxCustomGridTableItem.HasInitFilteringDateRangesHandlers: Boolean; +begin + Result := GridView.HasInitFilteringDateRangesHandler or HasInitFilteringDateRangesHandler; +end; + +function TcxCustomGridTableItem.HasInitGroupingDateRangesHandler: Boolean; +begin + Result := Assigned(FOnInitGroupingDateRanges); +end; + +function TcxCustomGridTableItem.HasInitGroupingDateRangesHandlers: Boolean; +begin + Result := GridView.HasInitGroupingDateRangesHandler or HasInitGroupingDateRangesHandler; +end; + +procedure TcxCustomGridTableItem.Assign(Source: TPersistent); +begin + if Source is TcxCustomGridTableItem then + with TcxCustomGridTableItem(Source) do + begin + Self.AlternateCaption := AlternateCaption; + Self.BestFitMaxWidth := BestFitMaxWidth; + Self.DataBinding := DataBinding; + Self.FIsCaptionAssigned := FIsCaptionAssigned; + Self.Caption := Caption; + Self.DateTimeGrouping := DateTimeGrouping; + Self.GroupIndex := GroupIndex; + Self.FIsHeaderAlignmentHorzAssigned := FIsHeaderAlignmentHorzAssigned; + Self.HeaderAlignmentHorz := HeaderAlignmentHorz; + Self.FIsHeaderAlignmentVertAssigned := FIsHeaderAlignmentVertAssigned; + Self.HeaderAlignmentVert := HeaderAlignmentVert; + Self.MinWidth := MinWidth; + Self.Options := Options; + Self.PropertiesClass := PropertiesClass; + Self.Properties := Properties; + Self.RepositoryItem := RepositoryItem; + Self.SortOrder := SortOrder; + Self.SortIndex := SortIndex; + Self.Styles := Styles; + Self.Tag := Tag; + Self.Visible := Visible; + Self.VisibleForCustomization := VisibleForCustomization; + Self.FIsWidthAssigned := FIsWidthAssigned; + Self.Width := Width; + Self.OnCustomDrawCell := OnCustomDrawCell; + Self.OnGetCellHint := OnGetCellHint; + Self.OnGetDataText := OnGetDataText; + Self.OnGetDisplayText := OnGetDisplayText; + Self.OnGetFilterDisplayText := OnGetFilterDisplayText; + Self.OnGetFilterValues := OnGetFilterValues; + Self.OnGetProperties := OnGetProperties; + Self.OnGetPropertiesForEdit := OnGetPropertiesForEdit; + Self.OnGetStoredProperties := OnGetStoredProperties; + Self.OnGetStoredPropertyValue := OnGetStoredPropertyValue; + Self.OnInitFilteringDateRanges := OnInitFilteringDateRanges; + Self.OnInitGroupingDateRanges := OnInitGroupingDateRanges; + Self.OnSetStoredPropertyValue := OnSetStoredPropertyValue; + Self.OnUserFiltering := OnUserFiltering; + end + else + inherited; +end; + +function TcxCustomGridTableItem.GetParentComponent: TComponent; +begin + Result := FGridView; +end; + +function TcxCustomGridTableItem.HasParent: Boolean; +begin + Result := FGridView <> nil; +end; + +procedure TcxCustomGridTableItem.ApplyBestFit(ACheckSizingAbility: Boolean = False; + AFireEvents: Boolean = False); +begin + if GridView.IsPattern or ACheckSizingAbility and not CanHorzSize then Exit; + ShowHourglassCursor; + try + ForceWidth(GetBestFitWidth); + Changed(ticSize); + finally + HideHourglassCursor; + BestFitApplied(AFireEvents); + end; +end; + +function TcxCustomGridTableItem.CalculateDefaultCellHeight(ACanvas: TcxCanvas; + AFont: TFont): Integer; +var + AEditStyle: TcxEditStyle; + AEditSizeProperties: TcxEditSizeProperties; +begin + AEditStyle := GetCellStyle; + try + AEditStyle.Font := AFont; + with AEditSizeProperties do + begin + Height := -1; + MaxLineCount := 0; + Width := -1; + end; + Result := GetProperties.GetEditSize(ACanvas, AEditStyle, True, Null, AEditSizeProperties).cy; + if Result <> 0 then + Inc(Result, 2 * cxGridEditOffset); + finally + ReleaseCellStyle; + end; +end; + +function TcxCustomGridTableItem.CreateEditStyle: TcxEditStyle; +begin + Result := GetProperties.GetStyleClass.Create(nil, True) as TcxEditStyle; + if GridView.Control <> nil then + Result.LookAndFeel.MasterLookAndFeel := GridView.LookAndFeel; +end; + +procedure TcxCustomGridTableItem.FocusWithSelection; +begin + Focused := True; +end; + +function TcxCustomGridTableItem.GetAlternateCaption: string; +begin + Result := FAlternateCaption; + if Result = '' then + Result := DefaultAlternateCaption; +end; + +function TcxCustomGridTableItem.GetDefaultValuesProvider(AProperties: TcxCustomEditProperties = nil): IcxEditDefaultValuesProvider; +begin + if FDataBinding = nil then + Result := nil + else + Result := FDataBinding.GetDefaultValuesProvider(AProperties); +end; + +function TcxCustomGridTableItem.GetProperties: TcxCustomEditProperties; +begin + Result := FPropertiesValue; + InitProperties(Result); +end; + +function TcxCustomGridTableItem.GetProperties(ARecord: TcxCustomGridRecord): TcxCustomEditProperties; +begin + Result := DoGetProperties(ARecord); + InitProperties(Result); +end; + +function TcxCustomGridTableItem.GetProperties(ARecordIndex: Integer): TcxCustomEditProperties; +var + ARecord: TcxCustomGridRecord; +begin + if HasCustomPropertiesHandler then + begin + ARecord := ViewData.GetRecordByRecordIndex(ARecordIndex); + if ARecord = nil then + Result := GetProperties + else + Result := GetProperties(ARecord); + end + else + Result := GetProperties; +end; + +function TcxCustomGridTableItem.GetRepositoryItem: TcxEditRepositoryItem; +begin + Result := FRepositoryItem; + if (Result = nil) and not IsDestroying then + begin + Result := DefaultRepositoryItem; + if Result <> nil then + begin + Result.AddListener(Self); + FLastUsedDefaultRepositoryItem := Result; + end; + end; +end; + +procedure TcxCustomGridTableItem.MakeVisible; +begin + Controller.MakeItemVisible(Self); +end; + +procedure TcxCustomGridTableItem.RestoreDefaults; +begin + FIsCaptionAssigned := False; + FIsHeaderAlignmentHorzAssigned := False; + FIsHeaderAlignmentVertAssigned := False; + FIsWidthAssigned := False; + Changed(ticSize); +end; + +{ TcxCustomGridTableBackgroundBitmaps } + +function TcxCustomGridTableBackgroundBitmaps.GetBitmapStyleIndex(Index: Integer): Integer; +begin + case Index of + bbContent: + Result := vsContent; + bbFilterBox: + Result := vsFilterBox; + else + Result := inherited GetBitmapStyleIndex(Index); + end; +end; + +procedure TcxCustomGridTableBackgroundBitmaps.Assign(Source: TPersistent); +begin + if Source is TcxCustomGridTableBackgroundBitmaps then + with TcxCustomGridTableBackgroundBitmaps(Source) do + begin + Self.Content := Content; + Self.FilterBox := FilterBox; + end; + inherited; +end; + +{ TcxCustomGridTableDateTimeHandling } + +constructor TcxCustomGridTableDateTimeHandling.Create(AGridView: TcxCustomGridView); +begin + inherited; + FGrouping := dtgByDateAndTime; + FUseLongDateFormat := True; + FUseShortTimeFormat := True; +end; + +function TcxCustomGridTableDateTimeHandling.GetGridView: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited GridView); +end; + +procedure TcxCustomGridTableDateTimeHandling.SetDateFormat(const Value: string); +begin + if FDateFormat <> Value then + begin + FDateFormat := Value; + Changed(vcSize); + end; +end; + +procedure TcxCustomGridTableDateTimeHandling.SetFilters(Value: TcxGridDateTimeFilters); +begin + if FFilters <> Value then + begin + FFilters := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableDateTimeHandling.SetGrouping(Value: TcxGridDateTimeGrouping); +begin + if Value = dtgDefault then Value := dtgByDateAndTime; + if FGrouping <> Value then + begin + FGrouping := Value; + GroupingChanged; + end; +end; + +procedure TcxCustomGridTableDateTimeHandling.SetHourFormat(const Value: string); +begin + if FHourFormat <> Value then + begin + FHourFormat := Value; + Changed(vcSize); + end; +end; + +procedure TcxCustomGridTableDateTimeHandling.SetIgnoreTimeForFiltering(Value: Boolean); +begin + if FIgnoreTimeForFiltering <> Value then + begin + FIgnoreTimeForFiltering := Value; + GridView.DataController.Refresh; + end; +end; + +procedure TcxCustomGridTableDateTimeHandling.SetMonthFormat(const Value: string); +begin + if FMonthFormat <> Value then + begin + FMonthFormat := Value; + Changed(vcSize); + end; +end; + +procedure TcxCustomGridTableDateTimeHandling.SetUseLongDateFormat(Value: Boolean); +begin + if FUseLongDateFormat <> Value then + begin + FUseLongDateFormat := Value; + Changed(vcSize); + end; +end; + +procedure TcxCustomGridTableDateTimeHandling.SetUseShortTimeFormat(Value: Boolean); +begin + if FUseShortTimeFormat <> Value then + begin + FUseShortTimeFormat := Value; + Changed(vcSize); + end; +end; + +procedure TcxCustomGridTableDateTimeHandling.SetYearFormat(const Value: string); +begin + if FYearFormat <> Value then + begin + FYearFormat := Value; + Changed(vcSize); + end; +end; + +procedure TcxCustomGridTableDateTimeHandling.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxCustomGridTableDateTimeHandling then + with TcxCustomGridTableDateTimeHandling(Source) do + begin + Self.DateFormat := DateFormat; + Self.Filters := Filters; + Self.Grouping := Grouping; + Self.HourFormat := HourFormat; + Self.IgnoreTimeForFiltering := IgnoreTimeForFiltering; + Self.MonthFormat := MonthFormat; + Self.UseLongDateFormat := UseLongDateFormat; + Self.UseShortTimeFormat := UseShortTimeFormat; + Self.YearFormat := YearFormat; + end; +end; + +function TcxCustomGridTableDateTimeHandling.GetDateFormat: string; +begin + Result := FDateFormat; + if Result = '' then + if UseLongDateFormat then + Result := LongDateFormat + else + Result := ''; +end; + +function TcxCustomGridTableDateTimeHandling.GetHourFormat: string; +begin + Result := FHourFormat; + if Result = '' then + if UseShortTimeFormat then + Result := ShortTimeFormat + else + Result := ''; +end; + +function TcxCustomGridTableDateTimeHandling.GetMonthFormat: string; +begin + Result := FMonthFormat; + if Result = '' then + Result := cxGetResourceString(@scxGridMonthFormat); +end; + +function TcxCustomGridTableDateTimeHandling.GetYearFormat: string; +begin + Result := FYearFormat; + if Result = '' then + Result := cxGetResourceString(@scxGridYearFormat); +end; + +procedure TcxCustomGridTableDateTimeHandling.GroupingChanged; +var + I: Integer; +begin + if GridView.ItemCount = 0 then + Changed(vcProperty) + else + begin + GridView.BeginUpdate; + try + for I := 0 to GridView.ItemCount - 1 do + GridView.Items[I].DateTimeGroupingChanged; + finally + GridView.EndUpdate; + end; + end; +end; + +{ TcxGridFilterMRUItem } + +function GetFilterStream(AFilter: TcxDataFilterCriteria): TMemoryStream; +begin + Result := TMemoryStream.Create; + AFilter.WriteData(Result); +end; + +constructor TcxGridFilterMRUItem.Create(AFilter: TcxDataFilterCriteria); +begin + inherited Create; + Filter := AFilter.DataController.CreateFilter; + Filter.Assign(AFilter); +end; + +destructor TcxGridFilterMRUItem.Destroy; +begin + Filter.Free; + inherited; +end; + +function TcxGridFilterMRUItem.GetCaption: string; +begin + Result := Filter.FilterCaption; +end; + +function TcxGridFilterMRUItem.StreamEquals(AStream: TMemoryStream): Boolean; +var + AOwnStream: TMemoryStream; +begin + AOwnStream := GetStream; + try + Result := StreamsEqual(AOwnStream, AStream); + finally + AStream.Free; + AOwnStream.Free; + end; +end; + +procedure TcxGridFilterMRUItem.AssignTo(AFilter: TcxDataFilterCriteria); +begin + AFilter.AssignItems(Filter); +end; + +function TcxGridFilterMRUItem.Equals(AItem: TcxMRUItem): Boolean; +begin + Result := StreamEquals(TcxGridFilterMRUItem(AItem).GetStream); +end; + +function TcxGridFilterMRUItem.FilterEquals(AFilter: TcxDataFilterCriteria): Boolean; +begin + Result := StreamEquals(GetFilterStream(AFilter)); +end; + +function TcxGridFilterMRUItem.GetStream: TMemoryStream; +begin + Result := GetFilterStream(Filter); +end; + +{ TcxGridFilterMRUItems } + +constructor TcxGridFilterMRUItems.Create(AFiltering: TcxCustomGridTableFiltering); +begin + inherited Create; + FFiltering := AFiltering; + FVisibleItems := TList.Create; +end; + +destructor TcxGridFilterMRUItems.Destroy; +begin + FVisibleItems.Free; + inherited; +end; + +function TcxGridFilterMRUItems.GetItem(Index: Integer): TcxGridFilterMRUItem; +begin + Result := TcxGridFilterMRUItem(inherited Items[Index]); +end; + +function TcxGridFilterMRUItems.GetVisibleCount: Integer; +begin + Result := FVisibleItems.Count; +end; + +function TcxGridFilterMRUItems.GetVisibleItem(Index: Integer): TcxGridFilterMRUItem; +begin + Result := TcxGridFilterMRUItem(FVisibleItems[Index]); +end; + +procedure TcxGridFilterMRUItems.DeleteEmptyItems; +var + APrevCount, I: Integer; +begin + APrevCount := Count; + for I := Count - 1 downto 0 do + if Items[I].Filter.IsEmpty then + Delete(I); + if Count <> APrevCount then + RefreshVisibleItemsList; +end; + +procedure TcxGridFilterMRUItems.FilterChanged; +begin + RefreshVisibleItemsList; +end; + +procedure TcxGridFilterMRUItems.RefreshVisibleItemsList; +var + APrevVisibleCount: Integer; + AFilter: TcxDataFilterCriteria; + I: Integer; + AItem: TcxGridFilterMRUItem; +begin + APrevVisibleCount := VisibleCount; + AFilter := FFiltering.GridView.DataController.Filter; + FVisibleItems.Clear; + for I := 0 to Count - 1 do + begin + AItem := Items[I]; + if not AItem.FilterEquals(AFilter) then FVisibleItems.Add(AItem); + end; + if VisibleCount <> APrevVisibleCount then + FFiltering.MRUItemsVisibleCountChanged(APrevVisibleCount, VisibleCount); +end; + +procedure TcxGridFilterMRUItems.Add(AFilter: TcxDataFilterCriteria); +begin + if not AFilter.IsEmpty then + begin + inherited Add(TcxGridFilterMRUItem.Create(AFilter)); + RefreshVisibleItemsList; + end; +end; + +{ TcxGridFilterBox } + +constructor TcxGridFilterBox.Create(AGridView: TcxCustomGridView); +begin + inherited; + FCustomizeDialog := True; + FPosition := fpBottom; + FVisible := fvNonEmpty; +end; + +procedure TcxGridFilterBox.SetCustomizeDialog(Value: Boolean); +begin + if FCustomizeDialog <> Value then + begin + FCustomizeDialog := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridFilterBox.SetMRUItemsListDropDownCount(Value: Integer); +begin + if Value < 0 then Value := 0; + if FMRUItemsListDropDownCount <> Value then + begin + FMRUItemsListDropDownCount := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridFilterBox.SetPosition(Value: TcxGridFilterPosition); +begin + if FPosition <> Value then + begin + FPosition := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridFilterBox.SetVisible(Value: TcxGridFilterVisible); +begin + if FVisible <> Value then + begin + FVisible := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridFilterBox.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridFilterBox then + with TcxGridFilterBox(Source) do + begin + Self.CustomizeDialog := CustomizeDialog; + Self.MRUItemsListDropDownCount := MRUItemsListDropDownCount; + Self.Position := Position; + Self.Visible := Visible; + end; +end; + +{ TcxGridItemFilterPopupOptions } + +constructor TcxGridItemFilterPopupOptions.Create(AGridView: TcxCustomGridView); +begin + inherited; + FMaxDropDownItemCount := cxGridFilterDefaultItemPopupMaxDropDownItemCount; + FMultiSelect := True; +end; + +procedure TcxGridItemFilterPopupOptions.SetApplyMultiSelectChanges(Value: TcxGridItemFilterPopupApplyChangesMode); +begin + if FApplyMultiSelectChanges <> Value then + begin + FApplyMultiSelectChanges := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridItemFilterPopupOptions.SetDropDownWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FDropDownWidth <> Value then + begin + FDropDownWidth := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridItemFilterPopupOptions.SetMaxDropDownItemCount(Value: Integer); +begin + if Value < 0 then Value := 0; + if FMaxDropDownItemCount <> Value then + begin + FMaxDropDownItemCount := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridItemFilterPopupOptions.SetMultiSelect(Value: Boolean); +begin + if FMultiSelect <> Value then + begin + FMultiSelect := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridItemFilterPopupOptions.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridItemFilterPopupOptions then + with TcxGridItemFilterPopupOptions(Source) do + begin + Self.ApplyMultiSelectChanges := ApplyMultiSelectChanges; + Self.DropDownWidth := DropDownWidth; + Self.MaxDropDownItemCount := MaxDropDownItemCount; + Self.MultiSelect := MultiSelect; + end; +end; + +{ TcxCustomGridTableFiltering } + +constructor TcxCustomGridTableFiltering.Create(AGridView: TcxCustomGridView); +begin + inherited; + FItemMRUItemsList := True; + FItemMRUItemsListCount := cxGridFilterDefaultItemMRUItemsListCount; + FItemPopup := GetItemPopupClass.Create(GridView); + FMRUItems := GetMRUItemsClass.Create(Self); + FMRUItemsList := True; + FMRUItemsListCount := cxGridFilterDefaultMRUItemsListCount; +end; + +destructor TcxCustomGridTableFiltering.Destroy; +begin + FMRUItems.Free; + FItemPopup.Free; + inherited; +end; + +function TcxCustomGridTableFiltering.GetCustomizeDialog: Boolean; +begin + Result := GridView.FilterBox.CustomizeDialog; +end; + +function TcxCustomGridTableFiltering.GetGridView: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited GridView); +end; + +function TcxCustomGridTableFiltering.GetMRUItemsListDropDownCount: Integer; +begin + Result := GridView.FilterBox.MRUItemsListDropDownCount; +end; + +function TcxCustomGridTableFiltering.GetPosition: TcxGridFilterPosition; +begin + Result := GridView.FilterBox.Position; +end; + +function TcxCustomGridTableFiltering.GetVisible: TcxGridFilterVisible; +begin + Result := GridView.FilterBox.Visible; +end; + +procedure TcxCustomGridTableFiltering.SetCustomizeDialog(Value: Boolean); +begin + GridView.FilterBox.CustomizeDialog := Value; +end; + +procedure TcxCustomGridTableFiltering.SetItemFilteredItemsList(Value: Boolean); +begin + if FItemFilteredItemsList <> Value then + begin + FItemFilteredItemsList := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableFiltering.SetItemMRUItemsList(Value: Boolean); +begin + if FItemMRUItemsList <> Value then + begin + FItemMRUItemsList := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableFiltering.SetItemMRUItemsListCount(Value: Integer); +var + I: Integer; +begin + if Value < 0 then Value := 0; + if FItemMRUItemsListCount <> Value then + begin + FItemMRUItemsListCount := Value; + for I := 0 to GridView.ItemCount - 1 do + GridView.Items[I].DataBinding.FilterMRUValueItems.MaxCount := FItemMRUItemsListCount; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableFiltering.SetItemPopup(Value: TcxGridItemFilterPopupOptions); +begin + FItemPopup.Assign(Value); +end; + +procedure TcxCustomGridTableFiltering.SetMRUItemsList(Value: Boolean); +begin + if FMRUItemsList <> Value then + begin + FMRUItemsList := Value; + Changed(vcSize); + end; +end; + +procedure TcxCustomGridTableFiltering.SetMRUItemsListCount(Value: Integer); + + function GetMRUItemsMaxCount: Integer; + begin + Result := FMRUItemsListCount; + if Result <> 0 then Inc(Result); // for current filter + end; + +begin + if Value < 0 then Value := 0; + if FMRUItemsListCount <> Value then + begin + FMRUItemsListCount := Value; + FMRUItems.MaxCount := GetMRUItemsMaxCount; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableFiltering.SetMRUItemsListDropDownCount(Value: Integer); +begin + GridView.FilterBox.MRUItemsListDropDownCount := Value; +end; + +procedure TcxCustomGridTableFiltering.SetPosition(Value: TcxGridFilterPosition); +begin + GridView.FilterBox.Position := Value; +end; + +procedure TcxCustomGridTableFiltering.SetVisible(Value: TcxGridFilterVisible); +begin + GridView.FilterBox.Visible := Value; +end; + +procedure TcxCustomGridTableFiltering.FilterControlDialogApply(Sender: TObject); +begin + with GridView.DataController.Filter do + if not IsEmpty then Active := True; + AddFilterToMRUItems; +end; + +procedure TcxCustomGridTableFiltering.ReadCustomizeDialog(Reader: TReader); +begin + CustomizeDialog := Reader.ReadBoolean; +end; + +procedure TcxCustomGridTableFiltering.ReadMRUItemsListDropDownCount(Reader: TReader); +begin + MRUItemsListDropDownCount := Reader.ReadInteger; +end; + +procedure TcxCustomGridTableFiltering.ReadPosition(Reader: TReader); +begin + Position := TcxGridFilterPosition(GetEnumValue(TypeInfo(TcxGridFilterPosition), Reader.ReadIdent)); +end; + +procedure TcxCustomGridTableFiltering.ReadVisible(Reader: TReader); +begin + Visible := TcxGridFilterVisible(GetEnumValue(TypeInfo(TcxGridFilterVisible), Reader.ReadIdent)); +end; + +procedure TcxCustomGridTableFiltering.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('CustomizeDialog', ReadCustomizeDialog, nil, True); + Filer.DefineProperty('DropDownWidth', ReadItemPopupDropDownWidth, nil, True); + Filer.DefineProperty('MaxDropDownCount', ReadItemPopupMaxDropDownCount, nil, True); + Filer.DefineProperty('MRUItemsListDropDownCount', ReadMRUItemsListDropDownCount, nil, True); + Filer.DefineProperty('Position', ReadPosition, nil, True); + Filer.DefineProperty('Visible', ReadVisible, nil, True); +end; + +procedure TcxCustomGridTableFiltering.FilterChanged; +begin + FMRUItems.FilterChanged; +end; + +function TcxCustomGridTableFiltering.GetItemPopupClass: TcxGridItemFilterPopupOptionsClass; +begin + Result := TcxGridItemFilterPopupOptions; +end; + +function TcxCustomGridTableFiltering.GetMRUItemsClass: TcxGridFilterMRUItemsClass; +begin + Result := TcxGridFilterMRUItems; +end; + +function TcxCustomGridTableFiltering.IsMRUItemsListAvailable: Boolean; +begin + Result := FMRUItemsList and (FMRUItems.VisibleCount <> 0); +end; + +procedure TcxCustomGridTableFiltering.MRUItemsVisibleCountChanged(AOldCount, ANewCount: Integer); +begin + if FMRUItemsList and ((AOldCount = 0) or (ANewCount = 0)) then + Changed(vcSize); +end; + +function TcxCustomGridTableFiltering.GetItemPopupDropDownWidth: Integer; +begin + Result := FItemPopup.DropDownWidth; +end; + +function TcxCustomGridTableFiltering.GetItemPopupMaxDropDownItemCount: Integer; +begin + Result := FItemPopup.MaxDropDownItemCount; +end; + +procedure TcxCustomGridTableFiltering.SetItemPopupDropDownWidth(Value: Integer); +begin + FItemPopup.DropDownWidth := Value; +end; + +procedure TcxCustomGridTableFiltering.SetItemPopupMaxDropDownItemCount(Value: Integer); +begin + FItemPopup.MaxDropDownItemCount := Value; +end; + +procedure TcxCustomGridTableFiltering.ReadItemPopupDropDownWidth(Reader: TReader); +begin + DropDownWidth := Reader.ReadInteger; +end; + +procedure TcxCustomGridTableFiltering.ReadItemPopupMaxDropDownCount(Reader: TReader); +begin + MaxDropDownCount := Reader.ReadInteger; +end; + +procedure TcxCustomGridTableFiltering.AddFilterToMRUItems(AFilter: TcxDataFilterCriteria = nil); +begin + if AFilter = nil then + AFilter := GridView.DataController.Filter; + FMRUItems.Add(AFilter); +end; + +procedure TcxCustomGridTableFiltering.Assign(Source: TPersistent); +begin + if Source is TcxCustomGridTableFiltering then + with TcxCustomGridTableFiltering(Source) do + begin + Self.ItemFilteredItemsList := ItemFilteredItemsList; + Self.ItemMRUItemsList := ItemMRUItemsList; + Self.ItemMRUItemsListCount := ItemMRUItemsListCount; + Self.ItemPopup := ItemPopup; + Self.MRUItemsList := MRUItemsList; + Self.MRUItemsListCount := MRUItemsListCount; + end + else + inherited; +end; + +procedure TcxCustomGridTableFiltering.RunCustomizeDialog(AItem: TcxCustomGridTableItem); +begin + if GridView.DoFilterDialogShow(AItem) then Exit; + if (AItem = nil) or IsFilterControlDialogNeeded(GridView.DataController.Filter) then + if not GridView.DoFilterCustomization then + ExecuteFilterControlDialog(GridView, GridView.LookAndFeel, + FilterControlDialogApply, GridView.OnFilterControlDialogShow, clDefault, + '', TcxCustomGrid(GridView.Control).Font) + else + else + if ShowFilterDialog(GridView.DataController.Filter, AItem, + AItem.GetProperties, AItem.FilterCaption, AItem.DataBinding.ValueTypeClass, + GridView.LookAndFeel, TcxCustomGrid(GridView.Control).Font) then + begin + GridView.DataController.Filter.Active := True; + AddFilterToMRUItems; + end; +end; + +{ TcxCustomGridTableOptionsBehavior } + +constructor TcxCustomGridTableOptionsBehavior.Create(AGridView: TcxCustomGridView); +begin + inherited; + FCopyCaptionsToClipboard := True; + FDragHighlighting := True; + FDragOpening := True; + FDragScrolling := True; + FImmediateEditor := True; +end; + +function TcxCustomGridTableOptionsBehavior.GetGridView: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited GridView); +end; + +procedure TcxCustomGridTableOptionsBehavior.SetAlwaysShowEditor(Value: Boolean); +begin + if FAlwaysShowEditor <> Value then + begin + FAlwaysShowEditor := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsBehavior.SetBestFitMaxRecordCount(Value: Integer); +begin + if Value < 0 then Value := 0; + if FBestFitMaxRecordCount <> Value then + begin + FBestFitMaxRecordCount := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsBehavior.SetCellHints(Value: Boolean); +begin + if FCellHints <> Value then + begin + FCellHints := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsBehavior.SetCopyCaptionsToClipboard(Value: Boolean); +begin + if FCopyCaptionsToClipboard <> Value then + begin + FCopyCaptionsToClipboard := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsBehavior.SetDragDropText(Value: Boolean); +begin + if FDragDropText <> Value then + begin + FDragDropText := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsBehavior.SetDragFocusing(Value: TcxGridDragFocusing); +begin + if FDragFocusing <> Value then + begin + FDragFocusing := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsBehavior.SetDragHighlighting(Value: Boolean); +begin + if FDragHighlighting <> Value then + begin + FDragHighlighting := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsBehavior.SetDragOpening(Value: Boolean); +begin + if FDragOpening <> Value then + begin + FDragOpening := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsBehavior.SetDragScrolling(Value: Boolean); +begin + if FDragScrolling <> Value then + begin + FDragScrolling := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsBehavior.SetFocusCellOnCycle(Value: Boolean); +begin + if FFocusCellOnCycle <> Value then + begin + FFocusCellOnCycle := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsBehavior.SetFocusCellOnTab(Value: Boolean); +begin + if FFocusCellOnTab <> Value then + begin + FFocusCellOnTab := Value; + with GridView.Site do + if FFocusCellOnTab then + Keys := Keys + [kTab] + else + Keys := Keys - [kTab]; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsBehavior.SetFocusFirstCellOnNewRecord(Value: Boolean); +begin + if FFocusFirstCellOnNewRecord <> Value then + begin + FFocusFirstCellOnNewRecord := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsBehavior.SetGoToNextCellOnEnter(Value: Boolean); +begin + if FGoToNextCellOnEnter <> Value then + begin + FGoToNextCellOnEnter := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsBehavior.SetImmediateEditor(Value: Boolean); +begin + if FImmediateEditor <> Value then + begin + FImmediateEditor := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsBehavior.SetIncSearch(Value: Boolean); +begin + if FIncSearch <> Value then + begin + if not Value then + GridView.Controller.CancelIncSearching; + FIncSearch := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsBehavior.SetIncSearchItem(Value: TcxCustomGridTableItem); +begin + if FIncSearchItem <> Value then + begin + FIncSearchItem := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsBehavior.SetNavigatorHints(Value: Boolean); +begin + if FNavigatorHints <> Value then + begin + FNavigatorHints := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsBehavior.SetPullFocusing(Value: Boolean); +begin + if FPullFocusing <> Value then + begin + FPullFocusing := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsBehavior.Assign(Source: TPersistent); +begin + if Source is TcxCustomGridTableOptionsBehavior then + with TcxCustomGridTableOptionsBehavior(Source) do + begin + Self.AlwaysShowEditor := AlwaysShowEditor; + Self.BestFitMaxRecordCount := BestFitMaxRecordCount; + Self.CellHints := CellHints; + Self.CopyCaptionsToClipboard := CopyCaptionsToClipboard; + Self.DragDropText := DragDropText; + Self.DragFocusing := DragFocusing; + Self.DragHighlighting := DragHighlighting; + Self.DragOpening := DragOpening; + Self.DragScrolling := DragScrolling; + Self.FocusCellOnCycle := FocusCellOnCycle; + Self.FocusCellOnTab := FocusCellOnTab; + Self.FocusFirstCellOnNewRecord := FocusFirstCellOnNewRecord; + Self.GoToNextCellOnEnter := GoToNextCellOnEnter; + Self.ImmediateEditor := ImmediateEditor; + Self.IncSearch := IncSearch; + Self.IncSearchItem := IncSearchItem; + Self.NavigatorHints := NavigatorHints; + Self.PullFocusing := PullFocusing; + end; + inherited; +end; + +{ TcxCustomGridTableOptionsCustomize } + +constructor TcxCustomGridTableOptionsCustomize.Create(AGridView: TcxCustomGridView); +begin + inherited; + FItemFiltering := True; + FItemGrouping := True; + FItemMoving := True; + FItemSorting := True; +end; + +procedure TcxCustomGridTableOptionsCustomize.SetItemFiltering(Value: Boolean); +begin + if FItemFiltering <> Value then + begin + FItemFiltering := Value; + Changed(vcSize); + end; +end; + +procedure TcxCustomGridTableOptionsCustomize.SetItemGrouping(Value: Boolean); +begin + if FItemGrouping <> Value then + begin + FItemGrouping := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsCustomize.SetItemHiding(Value: Boolean); +begin + if FItemHiding <> Value then + begin + FItemHiding := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsCustomize.SetItemMoving(Value: Boolean); +begin + if FItemMoving <> Value then + begin + FItemMoving := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsCustomize.SetItemSorting(Value: Boolean); +begin + if FItemSorting <> Value then + begin + FItemSorting := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsCustomize.SetItemsQuickCustomization(Value: Boolean); +begin + if FItemsQuickCustomization <> Value then + begin + FItemsQuickCustomization := Value; + Changed(vcSize); + end; +end; + +procedure TcxCustomGridTableOptionsCustomize.SetItemsQuickCustomizationMaxDropDownCount(Value: Integer); +begin + if Value < 0 then Value := 0; + if FItemsQuickCustomizationMaxDropDownCount <> Value then + begin + FItemsQuickCustomizationMaxDropDownCount := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsCustomize.SetItemsQuickCustomizationReordering(Value: TcxGridQuickCustomizationReordering); +begin + if FItemsQuickCustomizationReordering <> Value then + begin + FItemsQuickCustomizationReordering := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsCustomize.Assign(Source: TPersistent); +begin + if Source is TcxCustomGridTableOptionsCustomize then + with TcxCustomGridTableOptionsCustomize(Source) do + begin + Self.ItemFiltering := ItemFiltering; + Self.ItemGrouping := ItemGrouping; + Self.ItemHiding := ItemHiding; + Self.ItemMoving := ItemMoving; + Self.ItemSorting := ItemSorting; + Self.ItemsQuickCustomization := ItemsQuickCustomization; + Self.ItemsQuickCustomizationMaxDropDownCount := ItemsQuickCustomizationMaxDropDownCount; + Self.ItemsQuickCustomizationReordering := ItemsQuickCustomizationReordering; + end; + inherited; +end; + +function TcxCustomGridTableOptionsCustomize.SupportsItemsQuickCustomizationReordering: Boolean; +begin + Result := GridView.IsDesigning or + (ItemsQuickCustomizationReordering = qcrEnabled) or + (ItemsQuickCustomizationReordering = qcrDefault) and ItemMoving; +end; + +{ TcxCustomGridTableOptionsData } + +constructor TcxCustomGridTableOptionsData.Create(AGridView: TcxCustomGridView); +begin + inherited; + FCancelOnExit := True; + FDeleting := True; + FDeletingConfirmation := True; + FEditing := True; + FInserting := True; +end; + +function TcxCustomGridTableOptionsData.GetGridView: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited GridView); +end; + +procedure TcxCustomGridTableOptionsData.SetAppending(Value: Boolean); +begin + if FAppending <> Value then + begin + FAppending := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsData.SetCancelOnExit(Value: Boolean); +begin + if FCancelOnExit <> Value then + begin + FCancelOnExit := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsData.SetDeleting(Value: Boolean); +begin + if FDeleting <> Value then + begin + FDeleting := Value; + GridView.RefreshNavigators; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsData.SetDeletingConfirmation(Value: Boolean); +begin + if FDeletingConfirmation <> Value then + begin + FDeletingConfirmation := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsData.SetEditing(Value: Boolean); +begin + if FEditing <> Value then + begin + FEditing := Value; + if not FEditing then + GridView.Controller.EditingItem := nil; + GridView.RefreshNavigators; + Changed(vcLayout); + end; +end; + +procedure TcxCustomGridTableOptionsData.SetInserting(Value: Boolean); +begin + if FInserting <> Value then + begin + FInserting := Value; + GridView.RefreshNavigators; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsData.Assign(Source: TPersistent); +begin + if Source is TcxCustomGridTableOptionsData then + with TcxCustomGridTableOptionsData(Source) do + begin + Self.Appending := Appending; + Self.CancelOnExit := CancelOnExit; + Self.Deleting := Deleting; + Self.DeletingConfirmation := DeletingConfirmation; + Self.Editing := Editing; + Self.Inserting := Inserting; + end; + inherited; +end; + +{ TcxCustomGridTableOptionsSelection } + +constructor TcxCustomGridTableOptionsSelection.Create(AGridView: TcxCustomGridView); +begin + inherited; + FCellSelect := True; + FHideFocusRectOnExit := True; + FInvertSelect := True; + FUnselectFocusedRecordOnExit := True; +end; + +function TcxCustomGridTableOptionsSelection.GetGridView: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited GridView); +end; + +function TcxCustomGridTableOptionsSelection.GetMultiSelect: Boolean; +begin + Result := GridView.DataController.MultiSelect; +end; + +procedure TcxCustomGridTableOptionsSelection.SetHideFocusRectOnExit(Value: Boolean); +begin + if FHideFocusRectOnExit <> Value then + begin + FHideFocusRectOnExit := Value; + Changed(vcLayout); + end; +end; + +procedure TcxCustomGridTableOptionsSelection.SetHideSelection(Value: Boolean); +begin + if FHideSelection <> Value then + begin + FHideSelection := Value; + Changed(vcLayout); + end; +end; + +procedure TcxCustomGridTableOptionsSelection.SetUnselectFocusedRecordOnExit(Value: Boolean); +begin + if FUnselectFocusedRecordOnExit <> Value then + begin + FUnselectFocusedRecordOnExit := Value; + Changed(vcProperty); + end; +end; + +function TcxCustomGridTableOptionsSelection.IsInvertSelectStored: Boolean; +begin + Result := not FInvertSelect; +end; + +function TcxCustomGridTableOptionsSelection.IsMultiSelectStored: Boolean; +begin + Result := MultiSelect; +end; + +procedure TcxCustomGridTableOptionsSelection.SetCellSelect(Value: Boolean); +begin + if FCellSelect <> Value then + begin + FCellSelect := Value; + if FCellSelect then + GridView.Controller.FocusFirstAvailableItem + else + GridView.Controller.FocusedItem := nil; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsSelection.SetInvertSelect(Value: Boolean); +begin + if FInvertSelect <> Value then + begin + FInvertSelect := Value; + Changed(vcLayout); + end; +end; + +procedure TcxCustomGridTableOptionsSelection.SetMultiSelect(Value: Boolean); +begin + if MultiSelect <> Value then + begin + GridView.DataController.MultiSelect := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableOptionsSelection.Assign(Source: TPersistent); +begin + if Source is TcxCustomGridTableOptionsSelection then + with TcxCustomGridTableOptionsSelection(Source) do + begin + Self.CellSelect := CellSelect; + Self.HideFocusRectOnExit := HideFocusRectOnExit; + Self.HideSelection := HideSelection; + Self.InvertSelect := InvertSelect; + Self.MultiSelect := MultiSelect; + Self.UnselectFocusedRecordOnExit := UnselectFocusedRecordOnExit; + end; + inherited; +end; + +{ TcxCustomGridTableOptionsView } + +constructor TcxCustomGridTableOptionsView.Create(AGridView: TcxCustomGridView); +begin + inherited; + FFocusRect := True; + FNavigatorOffset := cxGridNavigatorDefaultOffset; + FNoDataToDisplayInfoText := scxGridNoDataInfoText; + FShowItemFilterButtons := sfbWhenSelected; +end; + +function TcxCustomGridTableOptionsView.GetGridView: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited GridView); +end; + +procedure TcxCustomGridTableOptionsView.SetCellAutoHeight(Value: Boolean); +begin + if FCellAutoHeight <> Value then + begin + FCellAutoHeight := Value; + Changed(vcSize); + end; +end; + +procedure TcxCustomGridTableOptionsView.SetCellEndEllipsis(Value: Boolean); +begin + if FCellEndEllipsis <> Value then + begin + FCellEndEllipsis := Value; + Changed(vcLayout); + end; +end; + +procedure TcxCustomGridTableOptionsView.SetCellTextMaxLineCount(Value: Integer); +begin + if Value < 0 then Value := 0; + if FCellTextMaxLineCount <> Value then + begin + FCellTextMaxLineCount := Value; + Changed(vcSize); + end; +end; + +procedure TcxCustomGridTableOptionsView.SetFocusRect(Value: Boolean); +begin + if FFocusRect <> Value then + begin + FFocusRect := Value; + Changed(vcLayout); + end; +end; + +procedure TcxCustomGridTableOptionsView.SetItemCaptionAutoHeight(Value: Boolean); +begin + if FItemCaptionAutoHeight <> Value then + begin + FItemCaptionAutoHeight := Value; + ItemCaptionAutoHeightChanged; + end; +end; + +procedure TcxCustomGridTableOptionsView.SetItemCaptionEndEllipsis(Value: Boolean); +begin + if FItemCaptionEndEllipsis <> Value then + begin + FItemCaptionEndEllipsis := Value; + Changed(vcLayout); + end; +end; + +procedure TcxCustomGridTableOptionsView.SetNavigator(Value: Boolean); +begin + if FNavigator <> Value then + begin + FNavigator := Value; + Changed(vcSize); + end; +end; + +procedure TcxCustomGridTableOptionsView.SetNavigatorOffset(Value: Integer); +begin + if Value < 0 then Value := 0; + if FNavigatorOffset <> Value then + begin + FNavigatorOffset := Value; + Changed(vcSize); + end; +end; + +procedure TcxCustomGridTableOptionsView.SetNoDataToDisplayInfoText(const Value: string); +begin + if FNoDataToDisplayInfoText <> Value then + begin + FNoDataToDisplayInfoText := Value; + Changed(vcLayout); + end; +end; + +procedure TcxCustomGridTableOptionsView.SetShowEditButtons(Value: TcxGridShowEditButtons); +begin + if FShowEditButtons <> Value then + begin + FShowEditButtons := Value; + Changed(vcSize); + end; +end; + +procedure TcxCustomGridTableOptionsView.SetShowItemFilterButtons(Value: TcxGridShowItemFilterButtons); +begin + if FShowItemFilterButtons <> Value then + begin + FShowItemFilterButtons := Value; + Changed(vcSize); + end; +end; + +function TcxCustomGridTableOptionsView.IsNoDataToDisplayInfoTextAssigned: Boolean; +begin + Result := FNoDataToDisplayInfoText <> scxGridNoDataInfoText; +end; + +procedure TcxCustomGridTableOptionsView.ItemCaptionAutoHeightChanged; +begin + Changed(vcSize); +end; + +procedure TcxCustomGridTableOptionsView.Assign(Source: TPersistent); +begin + if Source is TcxCustomGridTableOptionsView then + with TcxCustomGridTableOptionsView(Source) do + begin + Self.CellAutoHeight := CellAutoHeight; + Self.CellEndEllipsis := CellEndEllipsis; + Self.CellTextMaxLineCount := CellTextMaxLineCount; + Self.FocusRect := FocusRect; + Self.ItemCaptionAutoHeight := ItemCaptionAutoHeight; + Self.ItemCaptionEndEllipsis := ItemCaptionEndEllipsis; + Self.Navigator := Navigator; + Self.NavigatorOffset := NavigatorOffset; + Self.NoDataToDisplayInfoText := NoDataToDisplayInfoText; + Self.ShowEditButtons := ShowEditButtons; + Self.ShowItemFilterButtons := ShowItemFilterButtons; + end; + inherited; +end; + +function TcxCustomGridTableOptionsView.GetNoDataToDisplayInfoText: string; +begin + if IsNoDataToDisplayInfoTextAssigned then + Result := FNoDataToDisplayInfoText + else + Result := cxGetResourceString(@scxGridNoDataInfoText); +end; + +{ TcxGridCellPos } + +constructor TcxGridCellPos.Create(AGridRecord: TcxCustomGridRecord; AItem: TObject); +begin + inherited Create; + GridRecord := AGridRecord; + Item := AItem; +end; + +{ TcxGridDataCellPos } + +constructor TcxGridDataCellPos.Create(AGridRecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem); +begin + inherited Create; + GridRecord := AGridRecord; + Item := AItem; +end; + +{ TcxCustomGridTableViewStyles } + +function TcxCustomGridTableViewStyles.GetGridViewValue: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited GetGridView); +end; + +procedure TcxCustomGridTableViewStyles.SetOnGetContentStyle(Value: TcxGridGetCellStyleEvent); +begin + if @FOnGetContentStyle <> @Value then + begin + FOnGetContentStyle := Value; + GridView.Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableViewStyles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +const + StyleIndexes: array[Boolean] of Integer = (vsContentEven, vsContentOdd); +begin + inherited; + with AParams, LookAndFeelPainter do + case Index of + vsContent: + begin + if AData is TcxCustomGridRecord then + GetDefaultViewParams(StyleIndexes[Odd(TcxCustomGridRecord(AData).Index)], + AData, AParams) + else + begin + Color := DefaultContentColor; + TextColor := DefaultContentTextColor; + end; + end; + vsContentEven: + begin + Color := DefaultContentEvenColor; + TextColor := DefaultContentTextColor; + end; + vsContentOdd: + begin + Color := DefaultContentOddColor; + TextColor := DefaultContentTextColor; + end; + vsFilterBox: + begin + Color := DefaultFilterBoxColor; + TextColor := DefaultFilterBoxTextColor; + end; + vsInactive: + begin + if AData <> nil then + with TcxGridCellPos(AData) do + GetCellContentParams(GridRecord, Item, AParams); + Color := DefaultInactiveColor; + TextColor := DefaultInactiveTextColor; + end; + vsIncSearch: + begin + Color := clDefault; + TextColor := clDefault; + end; + vsSelection: + begin + if AData <> nil then + with TcxGridCellPos(AData) do + GetCellContentParams(GridRecord, Item, AParams); + Color := DefaultSelectionColor; + TextColor := DefaultSelectionTextColor; + end; + end; +end; + +procedure TcxCustomGridTableViewStyles.GetSelectionParams(ARecord: TcxCustomGridRecord; + AItem: TObject; out AParams: TcxViewParams); +var + ACellPos: TcxGridCellPos; +begin + if ARecord <> nil then + ACellPos := TcxGridCellPos.Create(ARecord, AItem) + else + ACellPos := nil; + try + if GridView.DrawRecordActive(ARecord) then + GetViewParams(vsSelection, ACellPos, nil, AParams) + else + GetViewParams(vsInactive, ACellPos, nil, AParams); + finally + ACellPos.Free; + end; + AParams.Bitmap := nil; // to use selection color even if [content] bitmap is assigned +end; + +procedure TcxCustomGridTableViewStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxCustomGridTableViewStyles then + with TcxCustomGridTableViewStyles(Source) do + begin + Self.Content := Content; + Self.ContentEven := ContentEven; + Self.ContentOdd := ContentOdd; + Self.FilterBox := FilterBox; + Self.Inactive := Inactive; + Self.IncSearch := IncSearch; + Self.Selection := Selection; + Self.OnGetContentStyle := OnGetContentStyle; + end; +end; + +procedure TcxCustomGridTableViewStyles.GetCellContentParams(ARecord: TcxCustomGridRecord; + AItem: TObject; out AParams: TcxViewParams); +begin + if (AItem = nil) or (AItem is TcxCustomGridTableItem) then + GetDataCellContentParams(ARecord, TcxCustomGridTableItem(AItem), AParams); +end; + +procedure TcxCustomGridTableViewStyles.GetContentParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +const + StyleIndexes: array[Boolean] of Integer = (vsContentEven, vsContentOdd); +var + AStyle: TcxStyle; + ADataCellPos: TcxGridDataCellPos; +begin + AStyle := nil; + if (ARecord <> nil) and Assigned(FOnGetContentStyle) then + FOnGetContentStyle(GridView, ARecord, AItem, AStyle); + if (ARecord <> nil) and (GetValue(StyleIndexes[Odd(ARecord.Index)]) <> nil) then + begin + ADataCellPos := TcxGridDataCellPos.Create(ARecord, AItem); + try + GetViewParams(StyleIndexes[Odd(ARecord.Index)], ADataCellPos, AStyle, AParams); + finally + ADataCellPos.Free; + end; + end + else + GetViewParams(vsContent, ARecord, AStyle, AParams); +end; + +procedure TcxCustomGridTableViewStyles.GetDataCellContentParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +begin + if AItem = nil then + GetRecordContentParams(ARecord, AItem, AParams) + else + AItem.Styles.GetContentParams(ARecord, AParams); +end; + +procedure TcxCustomGridTableViewStyles.GetDataCellParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams; + AUseViewInfo: Boolean = False; ACellViewInfo: TcxGridTableCellViewInfo = nil); +begin + if AUseViewInfo and ACellViewInfo.Selected or + not AUseViewInfo and GridView.DrawDataCellSelected(ARecord, AItem, False, nil) then + GetSelectionParams(ARecord, AItem, AParams) + else + GetDataCellContentParams(ARecord, AItem, AParams); +end; + +procedure TcxCustomGridTableViewStyles.GetRecordContentParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +begin + GetContentParams(ARecord, AItem, AParams); +end; + +{ TcxGridOpenTableItemList } + +function TcxGridOpenTableItemList.GetItem(Index: Integer): TcxCustomGridTableItem; +begin + Result := TcxCustomGridTableItem(inherited Items[Index]); +end; + +procedure TcxGridOpenTableItemList.SetItem(Index: Integer; Value: TcxCustomGridTableItem); +begin + inherited Items[Index] := Value; +end; + +{ TcxCustomGridTableView } + +destructor TcxCustomGridTableView.Destroy; +begin + Controller.EditingController.EditingItem := nil; + inherited; +end; + +function TcxCustomGridTableView.GetBackgroundBitmaps: TcxCustomGridTableBackgroundBitmaps; +begin + Result := TcxCustomGridTableBackgroundBitmaps(inherited BackgroundBitmaps); +end; + +function TcxCustomGridTableView.GetController: TcxCustomGridTableController; +begin + Result := TcxCustomGridTableController(inherited Controller); +end; + +function TcxCustomGridTableView.GetFilterableItem(Index: Integer): TcxCustomGridTableItem; +begin + Result := TcxCustomGridTableItem(FFilterableItems[Index]); +end; + +function TcxCustomGridTableView.GetFilterableItemCount: Integer; +begin + Result := FFilterableItems.Count; +end; + +function TcxCustomGridTableView.GetGroupedItem(Index: Integer): TcxCustomGridTableItem; +begin + Result := Items[DataController.Groups.GroupingItemIndex[Index]]; +end; + +function TcxCustomGridTableView.GetGroupedItemCount: Integer; +begin + Result := DataController.Groups.GroupingItemCount; +end; + +function TcxCustomGridTableView.GetItem(Index: Integer): TcxCustomGridTableItem; +begin + Result := TcxCustomGridTableItem(FItems[Index]); +end; + +function TcxCustomGridTableView.GetItemCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxCustomGridTableView.GetMasterGridRecord: TcxCustomGridRecord; +begin + if MasterGridRecordIndex = -1 then + Result := nil + else + if (MasterGridView as TcxCustomGridTableView).ViewData.IsRecordIndexValid(MasterGridRecordIndex) then + Result := TcxCustomGridTableView(MasterGridView).ViewData.Records[MasterGridRecordIndex] + else + Result := nil; +end; + +function TcxCustomGridTableView.GetOptionsBehavior: TcxCustomGridTableOptionsBehavior; +begin + Result := TcxCustomGridTableOptionsBehavior(inherited OptionsBehavior); +end; + +function TcxCustomGridTableView.GetOptionsData: TcxCustomGridTableOptionsData; +begin + Result := TcxCustomGridTableOptionsData(inherited OptionsData); +end; + +function TcxCustomGridTableView.GetOptionsSelection: TcxCustomGridTableOptionsSelection; +begin + Result := TcxCustomGridTableOptionsSelection(inherited OptionsSelection); +end; + +function TcxCustomGridTableView.GetOptionsView: TcxCustomGridTableOptionsView; +begin + Result := TcxCustomGridTableOptionsView(inherited OptionsView); +end; + +function TcxCustomGridTableView.GetPainter: TcxCustomGridTablePainter; +begin + Result := TcxCustomGridTablePainter(inherited Painter); +end; + +function TcxCustomGridTableView.GetPatternGridView: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(inherited PatternGridView); +end; + +function TcxCustomGridTableView.GetNavigatorButtonsControl: IcxNavigator; +begin + Result := Self; +end; + +function TcxCustomGridTableView.GetSortedItem(Index: Integer): TcxCustomGridTableItem; +begin + Result := Items[DataController.GetSortingItemIndex(Index)]; +end; + +function TcxCustomGridTableView.GetSortedItemCount: Integer; +begin + Result := DataController.GetSortingItemCount; +end; + +function TcxCustomGridTableView.GetStyles: TcxCustomGridTableViewStyles; +begin + Result := TcxCustomGridTableViewStyles(inherited Styles); +end; + +function TcxCustomGridTableView.GetViewData: TcxCustomGridTableViewData; +begin + Result := TcxCustomGridTableViewData(inherited ViewData); +end; + +function TcxCustomGridTableView.GetViewInfo: TcxCustomGridTableViewInfo; +begin + Result := TcxCustomGridTableViewInfo(inherited ViewInfo); +end; + +function TcxCustomGridTableView.GetVisibleItem(Index: Integer): TcxCustomGridTableItem; +begin + Result := TcxCustomGridTableItem(FVisibleItems[Index]); +end; + +function TcxCustomGridTableView.GetVisibleItemCount: Integer; +begin + Result := FVisibleItems.Count; +end; + +procedure TcxCustomGridTableView.SetBackgroundBitmaps(Value: TcxCustomGridTableBackgroundBitmaps); +begin + inherited BackgroundBitmaps := Value; +end; + +procedure TcxCustomGridTableView.SetDateTimeHandling(Value: TcxCustomGridTableDateTimeHandling); +begin + FDateTimeHandling.Assign(Value); +end; + +procedure TcxCustomGridTableView.SetFilterBox(Value: TcxGridFilterBox); +begin + FFilterBox.Assign(Value); +end; + +procedure TcxCustomGridTableView.SetFiltering(Value: TcxCustomGridTableFiltering); +begin + FFiltering.Assign(Value); +end; + +procedure TcxCustomGridTableView.SetItem(Index: Integer; Value: TcxCustomGridTableItem); +begin + Items[Index].Assign(Value); +end; + +procedure TcxCustomGridTableView.SetNavigatorButtons(Value: TcxNavigatorControlButtons); +begin + FNavigatorButtons.Assign(Value); +end; + +procedure TcxCustomGridTableView.SetOnCanFocusRecord(Value: TcxGridAllowRecordOperationEvent); +begin + if @FOnCanFocusRecord <> @Value then + begin + FOnCanFocusRecord := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnCanSelectRecord(Value: TcxGridAllowRecordOperationEvent); +begin + if @FOnCanSelectRecord <> @Value then + begin + FOnCanSelectRecord := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnCellClick(Value: TcxGridCellClickEvent); +begin + if @FOnCellClick <> @Value then + begin + FOnCellClick := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnCellDblClick(Value: TcxGridCellClickEvent); +begin + if @FOnCellDblClick <> @Value then + begin + FOnCellDblClick := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnCustomDrawCell(Value: TcxGridTableDataCellCustomDrawEvent); +begin + if @FOnCustomDrawCell <> @Value then + begin + FOnCustomDrawCell := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnCustomDrawPartBackground(Value: TcxGridPartCustomDrawBackgroundEvent); +begin + if @FOnCustomDrawPartBackground <> @Value then + begin + FOnCustomDrawPartBackground := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnEditChanged(Value: TcxGridCustomTableItemEvent); +begin + if @FOnEditChanged <> @Value then + begin + FOnEditChanged := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnEditing(Value: TcxGridEditingEvent); +begin + if @FOnEditing <> @Value then + begin + FOnEditing := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnEditKeyDown(Value: TcxGridEditKeyEvent); +begin + if @FOnEditKeyDown <> @Value then + begin + FOnEditKeyDown := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnEditKeyPress(Value: TcxGridEditKeyPressEvent); +begin + if @FOnEditKeyPress <> @Value then + begin + FOnEditKeyPress := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnEditKeyUp(Value: TcxGridEditKeyEvent); +begin + if @FOnEditKeyUp <> @Value then + begin + FOnEditKeyUp := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnEditValueChanged(Value: TcxGridCustomTableItemEvent); +begin + if @FOnEditValueChanged <> @Value then + begin + FOnEditValueChanged := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnFilterControlDialogShow(Value: TNotifyEvent); +begin + if @FOnFilterControlDialogShow <> @Value then + begin + FOnFilterControlDialogShow := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnFilterCustomization(Value: TcxGridFilterCustomizationEvent); +begin + if @FOnFilterCustomization <> @Value then + begin + FOnFilterCustomization := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnFilterDialogShow(Value: TcxGridFilterDialogShowEvent); +begin + if @FOnFilterDialogShow <> @Value then + begin + FOnFilterDialogShow := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnFocusedItemChanged(Value: TcxGridFocusedItemChangedEvent); +begin + if @FOnFocusedItemChanged <> @Value then + begin + FOnFocusedItemChanged := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnFocusedRecordChanged(Value: TcxGridFocusedRecordChangedEvent); +begin + if @FOnFocusedRecordChanged <> @Value then + begin + FOnFocusedRecordChanged := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnGetCellHeight(Value: TcxGridGetCellHeightEvent); +begin + if @FOnGetCellHeight <> @Value then + begin + FOnGetCellHeight := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnGetDragDropText(Value: TcxGridGetDragDropTextEvent); +begin + if @FOnGetDragDropText <> @Value then + begin + FOnGetDragDropText := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnInitFilteringDateRanges(Value: TcxGridInitDateRangesEvent); +begin + if @FOnInitFilteringDateRanges <> @Value then + begin + FOnInitFilteringDateRanges := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnInitGroupingDateRanges(Value: TcxGridInitDateRangesEvent); +begin + if @FOnInitGroupingDateRanges <> @Value then + begin + FOnInitGroupingDateRanges := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnInitEdit(Value: TcxGridInitEditEvent); +begin + if @FOnInitEdit <> @Value then + begin + FOnInitEdit := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnInitEditValue(Value: TcxGridInitEditValueEvent); +begin + if @FOnInitEditValue <> @Value then + begin + FOnInitEditValue := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnSelectionChanged(Value: TcxGridCustomTableViewEvent); +begin + if @FOnSelectionChanged <> @Value then + begin + FOnSelectionChanged := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOnTopRecordIndexChanged(Value: TNotifyEvent); +begin + if @FOnTopRecordIndexChanged <> @Value then + begin + FOnTopRecordIndexChanged := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridTableView.SetOptionsBehavior(Value: TcxCustomGridTableOptionsBehavior); +begin + inherited OptionsBehavior := Value; +end; + +procedure TcxCustomGridTableView.SetOptionsCustomize(Value: TcxCustomGridTableOptionsCustomize); +begin + FOptionsCustomize.Assign(Value); +end; + +procedure TcxCustomGridTableView.SetOptionsData(Value: TcxCustomGridTableOptionsData); +begin + inherited OptionsData := Value; +end; + +procedure TcxCustomGridTableView.SetOptionsSelection(Value: TcxCustomGridTableOptionsSelection); +begin + inherited OptionsSelection := Value; +end; + +procedure TcxCustomGridTableView.SetOptionsView(Value: TcxCustomGridTableOptionsView); +begin + inherited OptionsView := Value; +end; + +procedure TcxCustomGridTableView.SetStyles(Value: TcxCustomGridTableViewStyles); +begin + inherited Styles := Value; +end; + +procedure TcxCustomGridTableView.CopyForEachRowProc(ARowIndex: Integer; ARowInfo: TcxRowInfo); +var + I, AIndex: Integer; +begin + if (Length(FCopyToClipboardStr) >= Length(EndOfLine)) and + (Copy(FCopyToClipboardStr, Length(FCopyToClipboardStr) - Length(EndOfLine) + 1, Length(EndOfLine)) <> EndOfLine) then + FCopyToClipboardStr := FCopyToClipboardStr + EndOfLine; + + for I := 0 to FCopyToClipboardItems.Count - 1 do + begin + AIndex := TcxCustomGridTableItem(FCopyToClipboardItems[I]).Index; + FCopyToClipboardStr := FCopyToClipboardStr + + DataController.GetRowDisplayText(ARowInfo, AIndex) + ColumnSeparator; + if ARowInfo.Level < DataController.Groups.GroupingItemCount then // it's a group row + Break; + end; + if FCopyToClipboardItems.Count <> 0 then + FCopyToClipboardStr := Copy(FCopyToClipboardStr, 1, + Length(FCopyToClipboardStr) - Length(ColumnSeparator)); +end; + +procedure TcxCustomGridTableView.RefreshItemIndexes; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + Items[I].FIndex := I; +end; + +function TcxCustomGridTableView.GetFilterCaption(Index: Integer): string; +begin + Result := FilterableItems[Index].FilterCaption; +end; + +function TcxCustomGridTableView.GetFilterCount: Integer; +begin + Result := FilterableItemCount; +end; + +function TcxCustomGridTableView.GetFilterCriteria: TcxFilterCriteria; +begin + Result := DataController.Filter; +end; + +function TcxCustomGridTableView.GetFilterFieldName(Index: Integer): string; +begin + Result := FilterableItems[Index].DataBinding.FilterFieldName; +end; + +function TcxCustomGridTableView.GetFilterItemLink(Index: Integer): TObject; +begin + Result := FilterableItems[Index]; +end; + +function TcxCustomGridTableView.GetFilterItemLinkID(Index: Integer): Integer; +begin + Result := FilterableItems[Index].ID; +end; + +function TcxCustomGridTableView.GetFilterItemLinkName(Index: Integer): string; +begin + Result := FilterableItems[Index].Name; +end; + +function TcxCustomGridTableView.GetFilterProperties(Index: Integer): TcxCustomEditProperties; +begin + Result := FilterableItems[Index].GetProperties; +end; + +function TcxCustomGridTableView.GetFilterValueType(Index: Integer): cxDataStorage.TcxValueTypeClass; +begin + Result := FilterableItems[Index].DataBinding.ValueTypeClass; +end; + +function TcxCustomGridTableView.NavigatorIsActive: Boolean; +begin + Result := DataController.Active; +end; + +function TcxCustomGridTableView.NavigatorIsBof: Boolean; +var + AIcxGridDataController: IcxGridDataController; +begin + if Supports(TObject(DataController), IcxGridDataController, AIcxGridDataController) then + Result := AIcxGridDataController.GetNavigatorIsBof + else + Result := False; +end; + +function TcxCustomGridTableView.NavigatorIsEof: Boolean; +var + AIcxGridDataController: IcxGridDataController; +begin + if Supports(TObject(DataController), IcxGridDataController, AIcxGridDataController) then + Result := AIcxGridDataController.GetNavigatorIsEof + else + Result := False; +end; + +function TcxCustomGridTableView.NavigatorCanAppend: Boolean; +begin + Result := Controller.CanAppend(True); +end; + +function TcxCustomGridTableView.NavigatorCanEdit: Boolean; +begin + Result := Controller.CanEdit; +end; + +function TcxCustomGridTableView.NavigatorCanDelete: Boolean; +begin + Result := Controller.CanDelete(True); +end; + +function TcxCustomGridTableView.NavigatorCanInsert: Boolean; +begin + Result := Controller.CanInsert(True); +end; + +function TcxCustomGridTableView.NavigatorIsEditing: Boolean; +begin + Result := DataController.IsEditing; +end; + +procedure TcxCustomGridTableView.NavigatorClearBookmark; +begin + DataController.ClearBookmark; +end; + +function TcxCustomGridTableView.NavigatorIsBookmarkAvailable: Boolean; +begin + Result := DataController.IsBookmarkAvailable; +end; + +procedure TcxCustomGridTableView.NavigatorDoAction(AButtonIndex: Integer); +var + APrevAllowAppendRecord: Boolean; +begin + case AButtonIndex of + NBDI_FIRST: + Controller.GoToFirst; + NBDI_PRIORPAGE: + Controller.FocusPrevPage(True); + NBDI_PRIOR: + Controller.GoToPrev(False); + NBDI_NEXT: + begin + APrevAllowAppendRecord := Controller.AllowAppendRecord; + Controller.AllowAppendRecord := False; + try + Controller.GoToNext(False); + finally + Controller.AllowAppendRecord := APrevAllowAppendRecord; + end; + end; + NBDI_NEXTPAGE: + Controller.FocusNextPage(True); + NBDI_LAST: + Controller.GoToLast(False); + NBDI_INSERT, NBDI_APPEND: + Controller.CreateNewRecord(AButtonIndex = NBDI_APPEND); + NBDI_DELETE: + Controller.DeleteSelection; + NBDI_EDIT: + begin + DataController.Edit; + Controller.FocusedItem.Editing := True; + end; + NBDI_POST: + begin + Controller.EditingController.UpdateValue; + DataController.Post; + end; + NBDI_CANCEL: + DataController.Cancel; + NBDI_REFRESH: + DataController.RefreshExternalData; + NBDI_SAVEBOOKMARK: + DataController.SaveBookmark; + NBDI_GOTOBOOKMARK: + DataController.GotoBookmark; + NBDI_FILTER: + FFiltering.RunCustomizeDialog; + end; +end; + +function TcxCustomGridTableView.NavigatorGetNotifier: TcxNavigatorControlNotifier; +begin + Result := FNavigatorNotifier; +end; + +function TcxCustomGridTableView.NavigatorIsActionSupported(AButtonIndex: Integer): Boolean; +begin + Result := True; +end; + +function TcxCustomGridTableView.GetProperties(AProperties: TStrings): Boolean; + + procedure AddFilter; + var + I: Integer; + begin + with AProperties do + begin + Add('FilterActive'); + Add('Filter'); + if Filtering.MRUItemsList then + for I := Filtering.MRUItems.Count - 1 downto 0 do + Add(FilterMRUItemBaseName + IntToStr(I)); + end; + end; + +begin + if gsoUseFilter in StorageOptions then + AddFilter; + Result := inherited GetProperties(AProperties); +end; + +procedure TcxCustomGridTableView.GetPropertyValue(const AName: string; + var AValue: Variant); + + function GetFilter: Boolean; + var + AStream: TMemoryStream; + AIndex: Integer; + begin + Result := True; + if AName = 'FilterActive' then + AValue := DataController.Filter.Active + else + if AName = 'Filter' then + begin + AStream := TMemoryStream.Create; + try + DataController.Filter.WriteData(AStream); + AValue := StreamToString(AStream); + finally + AStream.Free; + end; + end + else + if Pos(FilterMRUItemBaseName, AName) = 1 then + begin + AIndex := StrToInt(Copy(AName, Length(FilterMRUItemBaseName) + 1, MaxInt)); + AStream := Filtering.MRUItems[AIndex].GetStream; + try + AValue := StreamToString(AStream); + finally + AStream.Free; + end; + end + else + Result := False; + end; + +begin + if (gsoUseFilter in StorageOptions) and GetFilter then Exit; + inherited; +end; + +procedure TcxCustomGridTableView.SetPropertyValue(const AName: string; + const AValue: Variant); + + function SetFilter: Boolean; + var + AStream: TMemoryStream; + AFilter: TcxDataFilterCriteria; + begin + Result := True; + if AName = 'FilterActive' then + DataController.Filter.Active := StringToBoolean(AValue) + else + if AName = 'Filter' then + begin + AStream := TMemoryStream.Create; + try + StringToStream(AValue, AStream); + AStream.Position := 0; + DataController.Filter.ReadData(AStream); + finally + AStream.Free; + end; + end + else + if Pos(FilterMRUItemBaseName, AName) = 1 then + begin + AFilter := DataController.CreateFilter; + try + AStream := TMemoryStream.Create; + try + StringToStream(AValue, AStream); + AStream.Position := 0; + AFilter.ReadData(AStream); + Filtering.MRUItems.Add(AFilter); + finally + AStream.Free; + end; + finally + AFilter.Free; + end; + end + else + Result := False; + end; + +begin + if (gsoUseFilter in StorageOptions) and SetFilter then Exit; + inherited; +end; + +function TcxCustomGridTableView.CreateStoredObject(const AObjectName, AClassName: string): TObject; + + function GetSummaryGroupIndex: Integer; + var + I: Integer; + AIndex: string; + begin + AIndex := ''; + I := Length('SummaryGroup') + 1; + while AObjectName[I] <> '_' do + begin + AIndex := AIndex + AObjectName[I]; + if I = Length(AObjectName) then + Break; + Inc(I); + end; + {$IFDEF DELPHI6} + if not TryStrToInt(AIndex, Result) then + Result := -1; + {$ELSE} + try + Result := StrToInt(AIndex); + except + on EConvertError do + Result := -1; + end; + {$ENDIF} + end; + + function CreateSummary: TObject; + var + ASummaryGroupIndex: Integer; + begin + Result := nil; + if Pos('FooterSummaryItem', AObjectName) = 1 then + Result := DataController.Summary.FooterSummaryItems.Add + else + if Pos('DefaultGroupSummaryItem', AObjectName) = 1 then + Result := DataController.Summary.DefaultGroupSummaryItems.Add + else + if Pos('SummaryGroup', AObjectName) = 1 then + begin + ASummaryGroupIndex := GetSummaryGroupIndex; + if ASummaryGroupIndex >= 0 then + if Pos('Item', AObjectName) <> 0 then + begin + if ASummaryGroupIndex < DataController.Summary.SummaryGroups.Count then + Result := DataController.Summary.SummaryGroups[ASummaryGroupIndex].SummaryItems.Add; + end + else + if Pos('Link', AObjectName) <> 0 then + begin + if ASummaryGroupIndex < DataController.Summary.SummaryGroups.Count then + Result := DataController.Summary.SummaryGroups[ASummaryGroupIndex].Links.Add; + end + else + Result := DataController.Summary.SummaryGroups.Add; + end; + end; + +begin + Result := nil; + if AClassName = GetItemClass.ClassName then + Result := CreateItem + else + if gsoUseSummary in StorageOptions then + Result := CreateSummary; + if Result = nil then + Result := inherited CreateStoredObject(AObjectName, AClassName); +end; + +procedure TcxCustomGridTableView.GetStoredChildren(AChildren: TStringList); +var + I: Integer; + + procedure AddSummary; + var + I, J: Integer; + begin + with DataController.Summary.FooterSummaryItems do + for I := 0 to Count - 1 do + AChildren.AddObject('FooterSummaryItem' + IntToStr(I), Items[I]); + with DataController.Summary.DefaultGroupSummaryItems do + for I := 0 to Count - 1 do + AChildren.AddObject('DefaultGroupSummaryItem' + IntToStr(I), Items[I]); + with DataController.Summary.SummaryGroups do + for I := 0 to Count - 1 do + begin + AChildren.AddObject('SummaryGroup' + IntToStr(I), Items[I]); + with Items[I].SummaryItems do + for J := 0 to Count - 1 do + AChildren.AddObject('SummaryGroup' + IntToStr(I) + '_Item' + IntToStr(J), Items[J]); + with Items[I].Links do + for J := 0 to Count - 1 do + AChildren.AddObject('SummaryGroup' + IntToStr(I) + '_Link' + IntToStr(J), Items[J]); + end; + end; + +begin + for I := 0 to ItemCount - 1 do + AChildren.AddObject('', Items[I]); + if gsoUseSummary in StorageOptions then + AddSummary; +end; + +procedure TcxCustomGridTableView.AssignLayout(ALayoutView: TcxCustomGridView); +var + I, ATag: Integer; + ALayoutItem, AItem: TcxCustomGridTableItem; +begin + inherited; + with ALayoutView as TcxCustomGridTableView do + begin + Self.BeginAssignItems; + try + for I := 0 to ItemCount - 1 do + begin + ALayoutItem := Items[I]; + AItem := TcxCustomGridTableItem(ALayoutItem.DataBinding.Data); + ATag := AItem.Tag; + AItem.Assign(ALayoutItem); + AItem.Tag := ATag; + AItem.Index := ALayoutItem.Index; + end; + finally + Self.EndAssignItems; + end; +{ + Self.DataController.Filter.AssignItems(DataController.Filter); + Self.DataController.Filter.Active := DataController.Filter.Active;} + end; +end; + +procedure TcxCustomGridTableView.BeforeEditLayout(ALayoutView: TcxCustomGridView); +var + I: Integer; +begin + inherited; + with ALayoutView as TcxCustomGridTableView do + begin + with OptionsData do + begin + Appending := True; + Deleting := True; + Editing := True; + Inserting := True; + end; + OptionsSelection.CellSelect := True; + OptionsView.Navigator := True; + + for I := 0 to ItemCount - 1 do + Items[I].DataBinding.Data := Self.Items[I]; + end; +end; + +function TcxCustomGridTableView.HasLayoutCustomizationForm: Boolean; +begin + Result := True; +end; + +procedure TcxCustomGridTableView.BeforeRestoring; +begin + inherited; + BeginAssignItems; + FRestoringItems := TcxGridOpenTableItemList.Create; +end; + +procedure TcxCustomGridTableView.AfterRestoring; +var + I: Integer; +begin + try + for I := 0 to FRestoringItems.Count - 1 do + if FRestoringItems[I] <> nil then + FRestoringItems[I].Index := I; + EndAssignItems; + finally + FRestoringItems.Free; + inherited; + end; +end; + +procedure TcxCustomGridTableView.ReadState(Reader: TReader); +begin + BeginAssignItems; + try + inherited; + finally + EndAssignItems; + end; +end; + +procedure TcxCustomGridTableView.BeginAssignItems; +begin + DoBeforeAssignItems; + FIsAssigningItems := True; +end; + +procedure TcxCustomGridTableView.DoBeforeAssignItems; +begin + FAssigningGroupedItems := TcxGridOpenTableItemList.Create; + FAssigningSortedItems := TcxGridOpenTableItemList.Create; +end; + +procedure TcxCustomGridTableView.DoItemsAssigned; +var + I: Integer; +begin + try + for I := 0 to FAssigningGroupedItems.Count - 1 do + if FAssigningGroupedItems[I] <> nil then // because of inherited forms + FAssigningGroupedItems[I].GroupIndex := I; + for I := 0 to FAssigningSortedItems.Count - 1 do + if FAssigningSortedItems[I] <> nil then // because of inherited forms + FAssigningSortedItems[I].SortIndex := I; + finally + FAssigningSortedItems.Free; + FAssigningGroupedItems.Free; + end; +end; + +procedure TcxCustomGridTableView.EndAssignItems; +begin + FIsAssigningItems := False; + FIsAfterAssigningItems := True; + try + DoItemsAssigned; + finally + FIsAfterAssigningItems := False; + end; +end; + +function TcxCustomGridTableView.CanOffset(ARecordCountDelta: Integer): Boolean; +begin + Result := not TcxCustomGrid(Control).UpdateLocked and Visible and + ViewInfo.CanOffsetView(ARecordCountDelta); +end; + +function TcxCustomGridTableView.CanSelectRecord(ARecordIndex: Integer): Boolean; +begin + Result := True; + if Assigned(FOnCanSelectRecord) then + FOnCanSelectRecord(Self, ViewData.GetRecordByIndex(ARecordIndex), Result); +end; + +function TcxCustomGridTableView.CanTabStop: Boolean; +begin + Result := inherited CanTabStop and not Controller.IsEditing; +end; + +procedure TcxCustomGridTableView.DetailVisibleChanged(ADetailLevel: TComponent; + APrevVisibleDetailCount, AVisibleDetailCount: Integer); +var + I: Integer; +begin + inherited; + if IsPattern then + begin + BeginUpdate; + try + for I := 0 to CloneCount - 1 do + TcxCustomGridViewAccess(Clones[I]).DetailVisibleChanged(ADetailLevel, + APrevVisibleDetailCount, AVisibleDetailCount); + finally + EndUpdate; + end; + end + else + if (APrevVisibleDetailCount = 0) or (AVisibleDetailCount = 0) then + DataChanged; +end; + +procedure TcxCustomGridTableView.DoAssign(ASource: TcxCustomGridView); + + procedure AssignItems; + var + I: Integer; + AItem: TcxCustomGridTableItem; + begin + with TcxCustomGridTableView(ASource) do + begin + Self.BeginAssignItems; + try + for I := 0 to ItemCount - 1 do + begin + AItem := Self.FindItemByID(Items[I].ID); + if AItem = nil then + begin + AItem := Self.CreateItem; + AItem.FID := Items[I].ID; + end; + AItem.Index := I; + AItem.Assign(Items[I]); + end; + for I := Self.ItemCount - 1 downto ItemCount do + Self.Items[I].Free; + finally + Self.EndAssignItems; + end; + Self.FNextID := FNextID; + end; + end; + +begin + if ASource is TcxCustomGridTableView then + begin + BeginUpdate; //!!! is it needed? + try + if not AssigningSettings then + AssignItems; + with TcxCustomGridTableView(ASource) do + begin + Self.DateTimeHandling := DateTimeHandling; + Self.FilterBox := FilterBox; + Self.Filtering := Filtering; + Self.NavigatorButtons := NavigatorButtons; + Self.OptionsCustomize := OptionsCustomize; + + Self.OnCanFocusRecord := OnCanFocusRecord; + Self.OnCanSelectRecord := OnCanSelectRecord; + Self.OnCellClick := OnCellClick; + Self.OnCellDblClick := OnCellDblClick; + Self.OnCustomDrawCell := OnCustomDrawCell; + Self.OnCustomDrawPartBackground := OnCustomDrawPartBackground; + Self.OnEditing := OnEditing; + Self.OnEditChanged := OnEditChanged; + Self.OnEditKeyDown := OnEditKeyDown; + Self.OnEditKeyPress := OnEditKeyPress; + Self.OnEditKeyUp := OnEditKeyUp; + Self.OnEditValueChanged := OnEditValueChanged; + Self.OnFilterControlDialogShow := OnFilterControlDialogShow; + Self.OnFilterCustomization := OnFilterCustomization; + Self.OnFilterDialogShow := OnFilterDialogShow; + Self.OnFocusedItemChanged := OnFocusedItemChanged; + Self.OnFocusedRecordChanged := OnFocusedRecordChanged; + Self.OnGetCellHeight := OnGetCellHeight; + Self.OnGetDragDropText := OnGetDragDropText; + Self.OnInitFilteringDateRanges := OnInitFilteringDateRanges; + Self.OnInitGroupingDateRanges := OnInitGroupingDateRanges; + Self.OnInitEdit := OnInitEdit; + Self.OnInitEditValue := OnInitEditValue; + //Self.OnRecordCreated := OnRecordCreated; + //Self.OnRecordDestroying := OnRecordDestroying; + Self.OnSelectionChanged := OnSelectionChanged; + Self.OnTopRecordIndexChanged := OnTopRecordIndexChanged; + end; + finally + EndUpdate; + end; + end; + inherited; +end; + +function TcxCustomGridTableView.FindItemByObjectName(const AObjectName: string): TcxCustomGridTableItem; +begin + if IsStoringNameMode then + if AObjectName = '' then + Result := nil + else + Result := FindItemByID(StrToInt(AObjectName)) + else + Result := FindItemByName(AObjectName); +end; + +procedure TcxCustomGridTableView.FocusEdit(AItemIndex: Integer; var ADone: Boolean); +begin + Items[AItemIndex].Editing := True; + ADone := Items[AItemIndex].Editing; +end; + +procedure TcxCustomGridTableView.GetChildren(Proc: TGetChildProc; Root: TComponent); +var + I: Integer; +begin + inherited; + for I := 0 to ItemCount - 1 do + if Items[I].Owner = Root then Proc(Items[I]); +end; + +function TcxCustomGridTableView.GetDefaultActiveDetailIndex: Integer; +var + AAvailableLevel: TcxGridLevel; +begin + AAvailableLevel := TcxGridLevel(Level).GetAvailableItem; + if AAvailableLevel = nil then + Result := -1 + else + Result := AAvailableLevel.Index; +end; + +procedure TcxCustomGridTableView.GetFakeComponentLinks(AList: TList); +var + I: Integer; +begin + inherited; + for I := 0 to ItemCount - 1 do + Items[I].Styles.GetFakeComponentLinks(AList); +end; + +function TcxCustomGridTableView.GetIsControlFocused: Boolean; +begin + Result := inherited GetIsControlFocused or + Controller.EditingController.IsEditing and Controller.EditingController.Edit.IsFocused or + Controller.HasFilterMRUItemsPopup and Controller.FilterMRUItemsPopup.Visible or + Controller.HasFilterPopup and Controller.FilterPopup.Visible or + Controller.HasItemsCustomizationPopup and Controller.ItemsCustomizationPopup.Visible; +end; + +procedure TcxCustomGridTableView.GetItemsListForClipboard(AItems: TList; ACopyAll: Boolean); +begin + GetVisibleItemsList(AItems); +end; + +function TcxCustomGridTableView.GetItemSortByDisplayText(AItemIndex: Integer; + ASortByDisplayText: Boolean): Boolean; +begin + Result := Items[AItemIndex].IsSortingByDisplayText(ASortByDisplayText); +end; + +function TcxCustomGridTableView.GetItemValueSource(AItemIndex: Integer): TcxDataEditValueSource; +var + AProperties: TcxCustomEditProperties; +begin + AProperties := Items[AItemIndex].GetProperties; + if AProperties = nil then + Result := evsText //!!! + else + Result := AProperties.GetEditValueSource(True); +end; + +procedure TcxCustomGridTableView.GetVisibleItemsList(AItems: TList); +begin + CopyList(FVisibleItems, AItems); +end; + +function TcxCustomGridTableView.HasCustomDrawCell: Boolean; +begin + Result := Assigned(FOnCustomDrawCell); +end; + +function TcxCustomGridTableView.HasCustomDrawPartBackground: Boolean; +begin + Result := Assigned(FOnCustomDrawPartBackground); +end; + +procedure TcxCustomGridTableView.Init; +begin + inherited; + if Controller.FocusedItem = nil then + Controller.FocusFirstAvailableItem; +end; + +function TcxCustomGridTableView.IsDetailVisible(AGridView: TcxCustomGridView): Boolean; +var + AViewInfo: TcxCustomGridRecordViewInfo; +begin + if AGridView.MasterGridRecordIndex = -1 then + Result := False + else + begin + Result := ViewData.IsRecordIndexValid(AGridView.MasterGridRecordIndex); + if Result then + begin + AViewInfo := ViewData.Records[AGridView.MasterGridRecordIndex].ViewInfo; + Result := (AViewInfo <> nil) and AViewInfo.IsDetailVisible(AGridView); + end; + end; +end; + +function TcxCustomGridTableView.IsEqualHeightRecords: Boolean; +begin + Result := not ViewInfo.RecordsViewInfo.AutoDataRecordHeight; +end; + +function TcxCustomGridTableView.IsRecordHeightDependsOnData: Boolean; +begin + Result := ViewInfo.RecordsViewInfo.AutoRecordHeight or + ViewInfo.RecordsViewInfo.AutoDataRecordHeight or HasCustomProperties; +end; + +function TcxCustomGridTableView.IsRecordHeightDependsOnFocus: Boolean; +begin + Result := ViewInfo.RecordsViewInfo.AutoDataRecordHeight and + (OptionsView.ShowEditButtons = gsebForFocusedRecord); +end; + +procedure TcxCustomGridTableView.LoadingComplete; +begin + BeginUpdate; + try + inherited; + DataChanged; + finally + EndUpdate; + end; +end; + +procedure TcxCustomGridTableView.Offset(ARecordCountDelta, DX, DY: Integer); +begin + ViewInfo.DoOffset(ARecordCountDelta, DX, DY); + if ARecordCountDelta <> 0 then + Painter.DoOffset(ViewInfo.RecordsViewInfo.ItemsOffset, 0, 0) + else + Painter.DoOffset(0, DX, DY); +end; + +procedure TcxCustomGridTableView.SetChildOrder(Child: TComponent; Order: Integer); +begin + inherited; + if Child is TcxCustomGridTableItem then + TcxCustomGridTableItem(Child).Index := Order; +end; + +procedure TcxCustomGridTableView.SetName(const NewName: TComponentName); +var + AOldName: TComponentName; +begin + AOldName := Name; + inherited; + if Name <> AOldName then + RenameComponents(Self, Owner, Name, AOldName, ItemCount, + @cxCustomGridTableViewGetItem); +end; + +procedure TcxCustomGridTableView.UpdateControl(AInfo: TcxUpdateControlInfo); +begin + if IsDestroying then Exit; + if AInfo is TcxDataChangedInfo then + DataChanged + else + if AInfo is TcxLayoutChangedInfo then + DataLayoutChanged + else + if AInfo is TcxFocusedRecordChangedInfo then + with TcxFocusedRecordChangedInfo(AInfo) do + Controller.FocusedRecordChanged(PrevFocusedRowIndex, FocusedRowIndex, NewItemRowFocusingChanged) + else + if AInfo is TcxSelectionChangedInfo then + SelectionChanged(TcxSelectionChangedInfo(AInfo)) + else + if AInfo is TcxSearchChangedInfo then + SearchChanged + else + if AInfo is TcxUpdateRecordInfo then + RecordChanged(TcxUpdateRecordInfo(AInfo).RecordIndex) + else + if AInfo is TcxGroupingChangingInfo then + GroupingChanging; + RefreshNavigators; + inherited; +end; + +procedure TcxCustomGridTableView.UpdateDataController(AChange: TcxGridDataControllerChange; + AItem: TcxCustomGridTableItem); +begin + if {not IsDestroying and }(DataController <> nil) then + with DataController do + case AChange of + dccItemAdded: + AddItem(AItem); + dccItemRemoved: + RemoveItem(AItem); + dccIndexesChanged: + UpdateItemIndexes; + end; +end; + +procedure TcxCustomGridTableView.UpdateRecord; +begin + Controller.EditingController.UpdateValue; +end; + +procedure TcxCustomGridTableView.CreateHandlers; +begin + FItems := TList.Create; + FVisibleItems := TList.Create; + FFilterableItems := TList.Create; + FNavigatorNotifier := TcxNavigatorControlNotifier.Create; + inherited; + FNavigatorButtons := GetNavigatorButtonsClass.Create(ViewInfo); + FNavigatorButtons.OnGetControl := GetNavigatorButtonsControl; + FNavigatorButtons.ConfirmDelete := False; +end; + +procedure TcxCustomGridTableView.DestroyHandlers; +begin + ClearItems; + FreeAndNil(FNavigatorButtons); + inherited; + FreeAndNil(FNavigatorNotifier); + FreeAndNil(FFilterableItems); + FreeAndNil(FVisibleItems); + FreeAndNil(FItems); +end; + +procedure TcxCustomGridTableView.CreateOptions; +begin + inherited; + FDateTimeHandling := GetDateTimeHandlingClass.Create(Self); + FFilterBox := GetFilterBoxClass.Create(Self); + FFiltering := GetFilteringClass.Create(Self); + FOptionsCustomize := GetOptionsCustomizeClass.Create(Self); +end; + +procedure TcxCustomGridTableView.DestroyOptions; +begin + FreeAndNil(FOptionsCustomize); + FreeAndNil(FFiltering); + FreeAndNil(FFilterBox); + FreeAndNil(FDateTimeHandling); + inherited; +end; + +procedure TcxCustomGridTableView.AddItem(AItem: TcxCustomGridTableItem); +begin +{$IFDEF DELPHI6} + if csTransient in ComponentStyle then + AItem.FComponentStyle := AItem.FComponentStyle + [csTransient]; +{$ENDIF} + FItems.Add(AItem); + ItemIndexChanged(AItem, -1); + AItem.FID := GetNextID; + UpdateDataController(dccItemAdded, AItem); + AItem.SetGridView(Self); // needs Field + AItem.Visible := True; + RefreshFilterableItemsList; +end; + +procedure TcxCustomGridTableView.RemoveItem(AItem: TcxCustomGridTableItem); +var + AOldItemIndex: Integer; +begin + BeginUpdate; + try + if AItem = OptionsBehavior.IncSearchItem then + OptionsBehavior.IncSearchItem := nil; + AItem.Visible := False; + AOldItemIndex := AItem.Index; + FItems.Remove(AItem); + AItem.FIndex := -1; + ItemIndexChanged(AItem, AOldItemIndex); + UpdateDataController(dccItemRemoved, AItem); + finally + EndUpdate; + end; + AItem.SetGridView(nil); + //UpdateDataController(dccItemRemoved, AItem); + FFiltering.MRUItems.DeleteEmptyItems; + ReleaseID(AItem.ID); + RefreshFilterableItemsList; + RefreshCustomizationForm; + Synchronize; +end; + +procedure TcxCustomGridTableView.AssignVisibleItemsIndexes; +var + I: Integer; +begin + for I := 0 to VisibleItemCount - 1 do + with VisibleItems[I] do + FVisibleIndex := GetVisibleIndex; +end; + +procedure TcxCustomGridTableView.ChangeItemIndex(AItem: TcxCustomGridTableItem; + Value: Integer); +var + AOldItemIndex: Integer; +begin + if Value < 0 then Value := 0; + if Value >= ItemCount then Value := ItemCount - 1; + if AItem.Index <> Value then + begin + AOldItemIndex := AItem.Index; + FItems.Move(AItem.Index, Value); + ItemIndexChanged(AItem, AOldItemIndex); + if AItem.Visible then RefreshVisibleItemsList; + UpdateDataController(dccIndexesChanged, AItem); + end; +end; + +procedure TcxCustomGridTableView.CheckItemVisibles; +var + I: Integer; +begin + BeginUpdate; + try + for I := 0 to ItemCount - 1 do + Items[I].CheckVisible; + finally + EndUpdate; + end; +end; + +procedure TcxCustomGridTableView.SaveItemVisibles; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + Items[I].SaveVisible; +end; + +procedure TcxCustomGridTableView.ItemIndexChanged(AItem: TcxCustomGridTableItem; + AOldIndex: Integer); +begin + RefreshItemIndexes; +end; + +procedure TcxCustomGridTableView.ItemVisibilityChanged(AItem: TcxCustomGridTableItem; + Value: Boolean); +begin + if Value then + begin + RefreshVisibleItemsList; + AItem.Changed(ticSize); + if Controller.FocusedItem = nil then + AItem.Focused := True; + end + else + begin + if AItem.IncSearching then Controller.CancelIncSearching; + //AItem.Focused := False; + RefreshVisibleItemsList; + AItem.Changed(ticSize); + AItem.Focused := False; + end; +end; + +procedure TcxCustomGridTableView.RefreshVisibleItemsList; +var + I: Integer; +begin + FVisibleItems.Clear; + for I := 0 to ItemCount - 1 do + if Items[I].ActuallyVisible then + Items[I].FVisibleIndex := FVisibleItems.Add(Items[I]) + else + Items[I].FVisibleIndex := -1; +end; + +function TcxCustomGridTableView.GetItemDataBindingClass: TcxGridItemDataBindingClass; +var + AIGridDataController: IcxGridDataController; +begin + if Supports(TObject(DataController), IcxGridDataController, AIGridDataController) then + Result := AIGridDataController.GetItemDataBindingClass + else + Result := nil; +end; + +function TcxCustomGridTableView.GetNextID: Integer; +begin + Result := FNextID; + Inc(FNextID); +end; + +procedure TcxCustomGridTableView.ReleaseID(AID: Integer); +begin + if AID = FNextID - 1 then Dec(FNextID); +end; + +procedure TcxCustomGridTableView.DataChanged; +var + I: Integer; +begin + Controller.DragHighlightedRecord := nil; + for I := 0 to ItemCount - 1 do + Items[I].DataChanged; + Changed(TcxGridDataChange.Create(Self)); + Controller.EditingController.UpdateEditValue; + //Controller.MakeFocusedRecordVisible; - because of expanding, but this code is needed for insert !!! + Synchronize; +end; + +procedure TcxCustomGridTableView.DataLayoutChanged; +begin + ViewData.RefreshRecords; + SizeChanged; + Controller.EditingController.UpdateEditValue; + Synchronize; +end; + +function TcxCustomGridTableView.DoCellClick(ACellViewInfo: TcxGridTableDataCellViewInfo; + AButton: TMouseButton; AShift: TShiftState): Boolean; +begin + Result := False; + if Assigned(FOnCellClick) then + FOnCellClick(Self, ACellViewInfo, AButton, AShift, Result); +end; + +function TcxCustomGridTableView.DoCellDblClick(ACellViewInfo: TcxGridTableDataCellViewInfo; + AButton: TMouseButton; AShift: TShiftState): Boolean; +begin + Result := False; + if Assigned(FOnCellDblClick) then + FOnCellDblClick(Self, ACellViewInfo, AButton, AShift, Result); +end; + +function TcxCustomGridTableView.DoEditing(AItem: TcxCustomGridTableItem): Boolean; +begin + Result := True; + if Assigned(FOnEditing) then FOnEditing(Self, AItem, Result); +end; + +procedure TcxCustomGridTableView.DoTopRecordIndexChanged; +begin + if Assigned(FOnTopRecordIndexChanged) then FOnTopRecordIndexChanged(Self); +end; + +procedure TcxCustomGridTableView.FilterChanged; +begin + FFiltering.FilterChanged; +end; + +procedure TcxCustomGridTableView.FocusedItemChanged(APrevFocusedItem, AFocusedItem: TcxCustomGridTableItem); +begin + if Assigned(OnFocusedItemChanged) then + FOnFocusedItemChanged(Self, APrevFocusedItem, AFocusedItem); +end; + +procedure TcxCustomGridTableView.FocusedRecordChanged(APrevFocusedRecordIndex, + AFocusedRecordIndex: Integer; ANewItemRecordFocusingChanged: Boolean); +begin + Changed(TcxGridFocusedRecordChange.Create(Self, APrevFocusedRecordIndex, + AFocusedRecordIndex, ANewItemRecordFocusingChanged)); +end; + +procedure TcxCustomGridTableView.GroupingChanging; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + Items[I].GroupingChanging; +end; + +procedure TcxCustomGridTableView.ItemCaptionChanged(AItem: TcxCustomGridTableItem); +begin + if (AItem = nil) or AItem.ActuallyVisible or (AItem.GroupIndex <> -1) or + AItem.DataBinding.Filtered then + Changed(vcSize) + else + Changed(vcProperty); + RefreshCustomizationForm; +end; + +procedure TcxCustomGridTableView.ItemValueTypeClassChanged(AItemIndex: Integer); +begin + Items[AItemIndex].ValueTypeClassChanged; +end; + +procedure TcxCustomGridTableView.RecalculateDefaultWidths; +var + I: Integer; +begin + BeginUpdate; + try + for I := 0 to ItemCount - 1 do + Items[I].RecalculateDefaultWidth; + finally + EndUpdate; + end; +end; + +procedure TcxCustomGridTableView.RecordChanged(ARecordIndex: Integer); +var + ARecord: TcxCustomGridRecord; +begin + ViewData.AssignEditingRecord; + if IsRecordHeightDependsOnData then + SizeChanged + else + begin + ARecord := ViewData.GetRecordByRecordIndex(ARecordIndex); + if ARecord = nil then + LayoutChanged + else + ARecord.Invalidate; + end; + Controller.EditingController.UpdateEditValue; +end; + +procedure TcxCustomGridTableView.RecordCountChanged; +begin + ViewInfoCache.Count := DataController.GetRowCount; + ViewData.Refresh(DataController.GetRowCount); + if Control <> nil then {7} + TcxCustomGrid(Control).SendNotifications(gnkRecordCountChanged); +end; + +procedure TcxCustomGridTableView.RefreshFilterableItemsList; +var + I: Integer; +begin + if IsDestroying then Exit; + FFilterableItems.Clear; + for I := 0 to ItemCount - 1 do + if Items[I].Filterable then + FFilterableItems.Add(Items[I]); +end; + +procedure TcxCustomGridTableView.RefreshNavigators; +begin + if ViewInfo.NavigatorSiteViewInfo.Visible then + ViewInfo.NavigatorButtonsStateChanged; + FNavigatorNotifier.RefreshNavigatorButtons; + if Focused then + TcxCustomGridAccess(Control).RefreshNavigators; +end; + +procedure TcxCustomGridTableView.SearchChanged; +begin + if Controller.FocusedRecord <> nil then + Controller.FocusedRecord.Invalidate(Controller.IncSearchingItem); +end; + +procedure TcxCustomGridTableView.SelectionChanged(AInfo: TcxSelectionChangedInfo); +var + I: Integer; + ARecord: TcxCustomGridRecord; +begin + if AInfo.Count = 0 then + LayoutChanged + else + for I := 0 to AInfo.Count - 1 do + begin + ARecord := ViewData.GetRecordByIndex(AInfo.RowIndexes[I]); + if ARecord <> nil then ARecord.Invalidate; + end; + if not IsLoading then DoSelectionChanged; +end; + +function TcxCustomGridTableView.CalculateDataCellSelected(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; AUseViewInfo: Boolean; ACellViewInfo: TcxGridTableCellViewInfo): Boolean; + + function GetRecordFocused: Boolean; + begin + if AUseViewInfo then + Result := ARecord.ViewInfo.Focused + else + Result := DrawRecordFocused(ARecord); + end; + +begin + if not (ARecord.HasCells and ARecord.CanFocusCells) then + Result := True + else + if OptionsSelection.InvertSelect then + Result := (AItem = nil) or not AItem.Focused or not GetRecordFocused + else + Result := (OptionsSelection.MultiSelect or + (AItem <> nil) and AItem.Focused and GetRecordFocused) and + (not (ACellViewInfo is TcxGridTableDataCellViewInfo) or + not TcxGridTableDataCellViewInfo(ACellViewInfo).Editing); +end; + +function TcxCustomGridTableView.DrawDataCellSelected(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; AUseViewInfo: Boolean = False; + ACellViewInfo: TcxGridTableCellViewInfo = nil): Boolean; + + function GetRecordSelected: Boolean; + begin + if AUseViewInfo then + Result := ARecord.ViewInfo.Selected + else + Result := DrawRecordSelected(ARecord); + end; + + function GetCellSelected: Boolean; + begin + if (ACellViewInfo <> nil) and ACellViewInfo.AlwaysSelected then + Result := True + else + Result := CalculateDataCellSelected(ARecord, AItem, AUseViewInfo, ACellViewInfo); + end; + +begin + Result := + ((ACellViewInfo = nil) or ACellViewInfo.CanDrawSelected) and + (ARecord <> nil) and GetRecordSelected and GetCellSelected and + DrawSelection; +end; + +function TcxCustomGridTableView.DrawRecordActive(ARecord: TcxCustomGridRecord): Boolean; +begin + Result := IsControlFocused or ARecord.DragHighlighted; +end; + +function TcxCustomGridTableView.DrawRecordFocused(ARecord: TcxCustomGridRecord): Boolean; +begin + Result := ARecord.Focused and Focused; +end; + +function TcxCustomGridTableView.DrawRecordSelected(ARecord: TcxCustomGridRecord): Boolean; +begin + Result := + ARecord.Selected and (Focused or OptionsSelection.MultiSelect) or + ARecord.DragHighlighted; +end; + +function TcxCustomGridTableView.DrawSelection: Boolean; +begin + Result := IsControlFocused or not OptionsSelection.HideSelection; +end; + +function TcxCustomGridTableView.DoCanFocusRecord(ARecord: TcxCustomGridRecord): Boolean; +begin + Result := True; + if Assigned(FOnCanFocusRecord) then FOnCanFocusRecord(Self, ARecord, Result); +end; + +procedure TcxCustomGridTableView.DoCustomDrawCell(ACanvas: TcxCanvas; + AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); +begin + if HasCustomDrawCell then + FOnCustomDrawCell(Self, ACanvas, AViewInfo, ADone); +end; + +procedure TcxCustomGridTableView.DoCustomDrawPartBackground(ACanvas: TcxCanvas; + AViewInfo: TcxCustomGridCellViewInfo; var ADone: Boolean); +begin + if HasCustomDrawPartBackground then + FOnCustomDrawPartBackground(Self, ACanvas, AViewInfo, ADone); +end; + +procedure TcxCustomGridTableView.DoEditChanged(AItem: TcxCustomGridTableItem); +begin + if Assigned(FOnEditChanged) then FOnEditChanged(Self, AItem); +end; + +procedure TcxCustomGridTableView.DoEditKeyDown(AItem: TcxCustomGridTableItem; + AEdit: TcxCustomEdit; var Key: Word; Shift: TShiftState); +begin + if Assigned(FOnEditKeyDown) then FOnEditKeyDown(Self, AItem, AEdit, Key, Shift); +end; + +procedure TcxCustomGridTableView.DoEditKeyPress(AItem: TcxCustomGridTableItem; + AEdit: TcxCustomEdit; var Key: Char); +begin + if Assigned(FOnEditKeyPress) then FOnEditKeyPress(Self, AItem, AEdit, Key); +end; + +procedure TcxCustomGridTableView.DoEditKeyUp(AItem: TcxCustomGridTableItem; + AEdit: TcxCustomEdit; var Key: Word; Shift: TShiftState); +begin + if Assigned(FOnEditKeyUp) then FOnEditKeyUp(Self, AItem, AEdit, Key, Shift); +end; + +procedure TcxCustomGridTableView.DoEditValueChanged(AItem: TcxCustomGridTableItem); +begin + if Assigned(FOnEditValueChanged) then FOnEditValueChanged(Self, AItem); +end; + +function TcxCustomGridTableView.DoFilterCustomization: Boolean; +begin + Result := False; + if Assigned(FOnFilterCustomization) then FOnFilterCustomization(Self, Result); +end; + +function TcxCustomGridTableView.DoFilterDialogShow(AItem: TcxCustomGridTableItem): Boolean; +begin + Result := False; + if Assigned(FOnFilterDialogShow) then FOnFilterDialogShow(Self, AItem, Result); +end; + +procedure TcxCustomGridTableView.DoFocusedRecordChanged(APrevFocusedRecordIndex, + AFocusedRecordIndex: Integer; ANewItemRecordFocusingChanged: Boolean); +begin + if Control <> nil then + TcxCustomGrid(Control).SendNotifications(gnkFocusedRecordChanged); + if Assigned(FOnFocusedRecordChanged) then + FOnFocusedRecordChanged(Self, ViewData.GetRecordByIndex(APrevFocusedRecordIndex), + ViewData.GetRecordByIndex(AFocusedRecordIndex), ANewItemRecordFocusingChanged); +end; + +procedure TcxCustomGridTableView.DoGetCellHeight(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; ACellViewInfo: TcxGridTableDataCellViewInfo; + var AHeight: Integer); +begin + if IsGetCellHeightAssigned then + FOnGetCellHeight(Self, ARecord, AItem, ACellViewInfo, AHeight); +end; + +function TcxCustomGridTableView.DoGetDragDropText(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem): string; +begin + if (ARecord <> nil) and (AItem <> nil) then + Result := ARecord.DisplayTexts[AItem.Index] + else + Result := ''; + if Assigned(FOnGetDragDropText) then + FOnGetDragDropText(Self, ARecord, AItem, Result); // for vic +end; + +procedure TcxCustomGridTableView.DoInitEdit(AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit); +begin + if Assigned(FOnInitEdit) then FOnInitEdit(Self, AItem, AEdit); +end; + +procedure TcxCustomGridTableView.DoInitEditValue(AItem: TcxCustomGridTableItem; + AEdit: TcxCustomEdit; var AValue: TcxEditValue); +begin + if Assigned(FOnInitEditValue) then FOnInitEditValue(Self, AItem, AEdit, AValue); +end; + +procedure TcxCustomGridTableView.DoInitFilteringDateRanges(AItem: TcxCustomGridTableItem); +begin + if HasInitFilteringDateRangesHandler then + FOnInitFilteringDateRanges(AItem, AItem.FilteringDateRanges); +end; + +procedure TcxCustomGridTableView.DoInitGroupingDateRanges(AItem: TcxCustomGridTableItem); +begin + if HasInitGroupingDateRangesHandler then + FOnInitGroupingDateRanges(AItem, AItem.GroupingDateRanges); +end; + +{procedure TcxCustomGridTableView.DoRecordCreated(ARecord: TcxCustomGridRecord); +begin + if Assigned(FOnRecordCreated) then FOnRecordCreated(Self, ARecord); +end; + +procedure TcxCustomGridTableView.DoRecordDestroying(ARecord: TcxCustomGridRecord); +begin + if Assigned(FOnRecordDestroying) then FOnRecordDestroying(Self, ARecord); +end;} + +procedure TcxCustomGridTableView.DoSelectionChanged; +begin + if Assigned(FOnSelectionChanged) then FOnSelectionChanged(Self); +end; + +function TcxCustomGridTableView.HasCustomProperties: Boolean; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + begin + Result := Items[I].HasCustomPropertiesHandler; + if Result then Exit; + end; + Result := False; +end; + +function TcxCustomGridTableView.HasInitFilteringDateRangesHandler: Boolean; +begin + Result := Assigned(FOnInitFilteringDateRanges); +end; + +function TcxCustomGridTableView.HasInitGroupingDateRangesHandler: Boolean; +begin + Result := Assigned(FOnInitGroupingDateRanges); +end; + +function TcxCustomGridTableView.IsGetCellHeightAssigned: Boolean; +begin + Result := Assigned(FOnGetCellHeight); +end; + +function TcxCustomGridTableView.GetControllerClass: TcxCustomGridControllerClass; +begin + Result := TcxCustomGridTableController; +end; + +function TcxCustomGridTableView.GetPainterClass: TcxCustomGridPainterClass; +begin + Result := TcxCustomGridTablePainter; +end; + +function TcxCustomGridTableView.GetViewDataClass: TcxCustomGridViewDataClass; +begin + Result := TcxCustomGridTableViewData; +end; + +function TcxCustomGridTableView.GetViewInfoCacheClass: TcxCustomGridViewInfoCacheClass; +begin + Result := TcxCustomGridTableViewInfoCache; +end; + +function TcxCustomGridTableView.GetViewInfoClass: TcxCustomGridViewInfoClass; +begin + Result := TcxCustomGridTableViewInfo; +end; + +function TcxCustomGridTableView.GetBackgroundBitmapsClass: TcxCustomGridBackgroundBitmapsClass; +begin + Result := TcxCustomGridTableBackgroundBitmaps; +end; + +function TcxCustomGridTableView.GetDateTimeHandlingClass: TcxCustomGridTableDateTimeHandlingClass; +begin + Result := TcxCustomGridTableDateTimeHandling; +end; + +function TcxCustomGridTableView.GetFilterBoxClass: TcxGridFilterBoxClass; +begin + Result := TcxGridFilterBox; +end; + +function TcxCustomGridTableView.GetFilteringClass: TcxCustomGridTableFilteringClass; +begin + Result := TcxCustomGridTableFiltering; +end; + +function TcxCustomGridTableView.GetNavigatorButtonsClass: TcxNavigatorControlButtonsClass; +begin + Result := TcxNavigatorControlButtons; +end; + +function TcxCustomGridTableView.GetOptionsBehaviorClass: TcxCustomGridOptionsBehaviorClass; +begin + Result := TcxCustomGridTableOptionsBehavior; +end; + +function TcxCustomGridTableView.GetOptionsCustomizeClass: TcxCustomGridTableOptionsCustomizeClass; +begin + Result := TcxCustomGridTableOptionsCustomize; +end; + +function TcxCustomGridTableView.GetOptionsDataClass: TcxCustomGridOptionsDataClass; +begin + Result := TcxCustomGridTableOptionsData; +end; + +function TcxCustomGridTableView.GetOptionsSelectionClass: TcxCustomGridOptionsSelectionClass; +begin + Result := TcxCustomGridTableOptionsSelection; +end; + +function TcxCustomGridTableView.GetOptionsViewClass: TcxCustomGridOptionsViewClass; +begin + Result := TcxCustomGridTableOptionsView; +end; + +function TcxCustomGridTableView.GetStylesClass: TcxCustomGridViewStylesClass; +begin + Result := TcxCustomGridTableViewStyles; +end; + +procedure TcxCustomGridTableView.ApplyBestFit(AItem: TcxCustomGridTableItem = nil; + ACheckSizingAbility: Boolean = False; AFireEvents: Boolean = False); +var + I: Integer; +begin + if AItem = nil then + for I := 0 to VisibleItemCount - 1 do + VisibleItems[I].ApplyBestFit(ACheckSizingAbility, AFireEvents) + else + AItem.ApplyBestFit(ACheckSizingAbility, AFireEvents); +end; + +procedure TcxCustomGridTableView.ClearItems; +var + I: Integer; +begin + BeginUpdate; + try + for I := ItemCount - 1 downto 0 do Items[I].Free; + FNextID := 0; + finally + EndUpdate; + end; +end; + +procedure TcxCustomGridTableView.CopyToClipboard(ACopyAll: Boolean); + + procedure AddHeaders; + var + I: Integer; + begin + for I := 0 to FCopyToClipboardItems.Count - 1 do + FCopyToClipboardStr := FCopyToClipboardStr + + TcxCustomGridTableItem(FCopyToClipboardItems[I]).GetAlternateCaption + ColumnSeparator; + if FCopyToClipboardItems.Count <> 0 then + FCopyToClipboardStr := Copy(FCopyToClipboardStr, 1, + Length(FCopyToClipboardStr) - Length(ColumnSeparator)); + FCopyToClipboardStr := FCopyToClipboardStr + EndOfLine; + end; + +begin + FCopyToClipboardItems := TList.Create; + try + GetItemsListForClipboard(FCopyToClipboardItems, ACopyAll); + FCopyToClipboardStr := ''; + if OptionsBehavior.CopyCaptionsToClipboard then + AddHeaders; + DataController.ForEachRow(not ACopyAll, CopyForEachRowProc); + Clipboard.AsText := FCopyToClipboardStr; + finally + FCopyToClipboardItems.Free; + end; +end; + +function TcxCustomGridTableView.CreateItem: TcxCustomGridTableItem; +begin + Result := GetItemClass.Create(Owner); + AddItem(Result); +end; + +function TcxCustomGridTableView.FindItemByID(AID: Integer): TcxCustomGridTableItem; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + begin + Result := Items[I]; + if Result.ID = AID then Exit; + end; + Result := nil; +end; + +function TcxCustomGridTableView.FindItemByName(const AName: string): TcxCustomGridTableItem; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + begin + Result := Items[I]; + if Result.Name = AName then Exit; + end; + Result := nil; +end; + +function TcxCustomGridTableView.FindItemByTag(ATag: TcxTag): TcxCustomGridTableItem; +var + I: Integer; +begin + for I := 0 to ItemCount - 1 do + begin + Result := Items[I]; + if Result.Tag = ATag then Exit; + end; + Result := nil; +end; + +function TcxCustomGridTableView.IndexOfItem(AItem: TcxCustomGridTableItem): Integer; +begin + Result := FItems.IndexOf(AItem); +end; + +procedure TcxCustomGridTableView.MakeMasterGridRecordVisible; +begin + if IsDetail and (MasterGridRecord <> nil) and not DontMakeMasterRecordVisible and + not MasterGridView.DataController.IsDetailExpanding then + MasterGridRecord.MakeVisible; +end; + +procedure TcxCustomGridTableView.RestoreDefaults; +var + I: Integer; +begin + inherited; + BeginUpdate; + try + for I := 0 to ItemCount - 1 do + Items[I].RestoreDefaults; + finally + EndUpdate; + end; +end; + +class function TcxCustomGridTableView.CanBeLookupList: Boolean; +begin + Result := False; +end; + +function TcxCustomGridTableView.GetSummaryGroupItemLinkClass: TcxDataSummaryGroupItemLinkClass; +begin + Result := nil; +end; + +function TcxCustomGridTableView.GetSummaryItemClass: TcxDataSummaryItemClass; +begin + Result := nil; +end; + +{ TcxCustomGridTableControllerAccess } + +class procedure TcxCustomGridTableControllerAccess.FocusNextPage(AInstance: TcxCustomGridTableController; + ASyncSelection: Boolean); +begin + AInstance.FocusNextPage(ASyncSelection); +end; + +class procedure TcxCustomGridTableControllerAccess.FocusPrevPage(AInstance: TcxCustomGridTableController; + ASyncSelection: Boolean); +begin + AInstance.FocusPrevPage(ASyncSelection); +end; + +{ TcxCustomGridTableItemAccess } + +class function TcxCustomGridTableItemAccess.CanGroup(AInstance: TcxCustomGridTableItem): Boolean; +begin + Result := AInstance.CanGroup; +end; + +class function TcxCustomGridTableItemAccess.CanHide(AInstance: TcxCustomGridTableItem): Boolean; +begin + Result := AInstance.CanHide; +end; + +class function TcxCustomGridTableItemAccess.CanHorzSize(AInstance: TcxCustomGridTableItem): Boolean; +begin + Result := AInstance.CanHorzSize; +end; + +class function TcxCustomGridTableItemAccess.CanSort(AInstance: TcxCustomGridTableItem): Boolean; +begin + Result := AInstance.CanSort; +end; + +class procedure TcxCustomGridTableItemAccess.CheckWidthValue( + AInstance: TcxCustomGridTableItem; var Value: Integer); +begin + AInstance.CheckWidthValue(Value); +end; + +class procedure TcxCustomGridTableItemAccess.DoGetDataText( + AInstance: TcxCustomGridTableItem; ARecordIndex: Integer; var AText: string); +begin + AInstance.DoGetDataText(ARecordIndex, AText); +end; + +class procedure TcxCustomGridTableItemAccess.DoGetDisplayText( + AInstance: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord; + var AText: string); +begin + AInstance.DoGetDisplayText(ARecord, AText); +end; + +class function TcxCustomGridTableItemAccess.GetGroupIndex( + AInstance: TcxCustomGridTableItem): Integer; +begin + Result := AInstance.GroupIndex; +end; + +class function TcxCustomGridTableItemAccess.GetFilterCaption( + AInstance: TcxCustomGridTableItem): string; +begin + Result := AInstance.FilterCaption; +end; + +{ TcxCustomGridTableOptionsBehaviorAccess } + +class function TcxCustomGridTableOptionsBehaviorAccess.GetPullFocusing( + AInstance: TcxCustomGridTableOptionsBehavior): Boolean; +begin + Result := AInstance.PullFocusing; +end; + +class procedure TcxCustomGridTableOptionsBehaviorAccess.SetPullFocusing( + AInstance: TcxCustomGridTableOptionsBehavior; Value: Boolean); +begin + AInstance.PullFocusing := Value; +end; + +{ TcxCustomGridTableOptionsViewAccess } + +class function TcxCustomGridTableOptionsViewAccess.GetCellAutoHeight( + AInstance: TcxCustomGridTableOptionsView): Boolean; +begin + Result := AInstance.CellAutoHeight; +end; + +{ TcxCustomGridTableViewAccess } + +class function TcxCustomGridTableViewAccess.CanSelectRecord( + AInstance: TcxCustomGridTableView; ARecordIndex: Integer): Boolean; +begin + Result := AInstance.CanSelectRecord(ARecordIndex); +end; + +class procedure TcxCustomGridTableViewAccess.FilterChanged( + AInstance: TcxCustomGridTableView); +begin + AInstance.FilterChanged; +end; + +class function TcxCustomGridTableViewAccess.FindItemByObjectName(AInstance: TcxCustomGridTableView; + const AObjectName: string): TcxCustomGridTableItem; +begin + Result := AInstance.FindItemByObjectName(AObjectName); +end; + +class procedure TcxCustomGridTableViewAccess.FocusEdit( + AInstance: TcxCustomGridTableView; AItemIndex: Integer; var ADone: Boolean); +begin + AInstance.FocusEdit(AItemIndex, ADone); +end; + +class function TcxCustomGridTableViewAccess.GetDefaultActiveDetailIndex( + AInstance: TcxCustomGridTableView): Integer; +begin + Result := AInstance.GetDefaultActiveDetailIndex; +end; + +class function TcxCustomGridTableViewAccess.GetItemClass(AInstance: TcxCustomGridTableView): TcxCustomGridTableItemClass; +begin + Result := AInstance.GetItemClass; +end; + +class function TcxCustomGridTableViewAccess.GetItemSortByDisplayText( + AInstance: TcxCustomGridTableView; AItemIndex: Integer; + ASortByDisplayText: Boolean): Boolean; +begin + Result := AInstance.GetItemSortByDisplayText(AItemIndex, ASortByDisplayText); +end; + +class function TcxCustomGridTableViewAccess.GetItemValueSource( + AInstance: TcxCustomGridTableView; AItemIndex: Integer): TcxDataEditValueSource; +begin + Result := AInstance.GetItemValueSource(AItemIndex); +end; + +class function TcxCustomGridTableViewAccess.GetSummaryGroupItemLinkClass( + AInstance: TcxCustomGridTableView): TcxDataSummaryGroupItemLinkClass; +begin + Result := AInstance.GetSummaryGroupItemLinkClass; +end; + +class function TcxCustomGridTableViewAccess.GetSummaryItemClass( + AInstance: TcxCustomGridTableView): TcxDataSummaryItemClass; +begin + Result := AInstance.GetSummaryItemClass; +end; + +class function TcxCustomGridTableViewAccess.IsEqualHeightRecords( + AInstance: TcxCustomGridTableView): Boolean; +begin + Result := AInstance.IsEqualHeightRecords; +end; + +class function TcxCustomGridTableViewAccess.IsGetCellHeightAssigned( + AInstance: TcxCustomGridTableView): Boolean; +begin + Result := AInstance.IsGetCellHeightAssigned; +end; + +class procedure TcxCustomGridTableViewAccess.ItemValueTypeClassChanged( + AInstance: TcxCustomGridTableView; AItemIndex: Integer); +begin + AInstance.ItemValueTypeClassChanged(AItemIndex); +end; + +class procedure TcxCustomGridTableViewAccess.RefreshNavigators( + AInstance: TcxCustomGridTableView); +begin + AInstance.RefreshNavigators; +end; + +class procedure TcxCustomGridTableViewAccess.UpdateRecord( + AInstance: TcxCustomGridTableView); +begin + AInstance.UpdateRecord; +end; + +{ TcxCustomGridTableViewInfoAccess } + +class function TcxCustomGridTableViewInfoAccess.GetDefaultGridModeBufferCount(AInstance: TcxCustomGridTableViewInfo): Integer; +begin + Result := AInstance.GetDefaultGridModeBufferCount; +end; + +initialization + RegisterClasses([TcxGridItemDataBinding]); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridCustomView.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridCustomView.pas new file mode 100644 index 00000000..765f234c --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridCustomView.pas @@ -0,0 +1,8387 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridCustomView; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, Classes, Graphics, Controls, Forms, StdCtrls, Menus, + cxClasses, cxControls, cxContainer, cxGraphics, cxLookAndFeels, cxLookAndFeelPainters, + cxStyles, cxStorage, cxGridCommon, cxCustomData, cxData, cxListBox, cxPC; + +const + cxGridCustomizationFormDefaultWidth = 180; + cxGridCustomizationFormDefaultHeight = 300; + + htError = -1; + htNone = 0; + htNavigator = 1; + htCustomizationForm = 2; + htDesignSelector = 3; + + ckNone = 0; + ckCustomizationForm = 1; + + bbCustomFirst = 0; + bbBackground = bbCustomFirst; + bbCustomLast = bbBackground; + + vsCustomFirst = 0; + vsBackground = vsCustomFirst; + vsCustomLast = vsBackground; + + StoringVersion = 1; + +type + TcxCustomGridDragAndDropObjectClass = class of TcxCustomGridDragAndDropObject; + TcxCustomGridItemsListBox = class; + TcxCustomGridCustomizationForm = class; + TcxGridPopupListBox = class; + TcxCustomGridController = class; + TcxCustomGridPainter = class; + TcxCustomGridViewData = class; + TcxCustomGridCellViewInfo = class; + TcxCustomGridViewCellViewInfo = class; + TcxGridDesignSelectorViewInfo = class; + TcxCustomGridViewInfo = class; + TcxCustomGridViewInfoCache = class; + TcxGridSite = class; + TcxCustomGridView = class; + + IcxGridViewLayoutEditorSupport = interface // it is here because of problem in CBuilder + ['{9C5EC9C0-A912-4822-BBD0-87AB45FDCC78}'] + procedure BeforeEditLayout(ALayoutView: TcxCustomGridView); + procedure DoAssignLayout(ALayoutView: TcxCustomGridView); + function GetLayoutCustomizationFormButtonCaption: string; + function HasLayoutCustomizationForm: Boolean; + function IsLayoutChangeable: Boolean; + procedure RunLayoutCustomizationForm; + end; + + { change } + + TcxCustomGridViewChange = class(TcxCustomGridChange) + private + FGridView: TcxCustomGridView; + public + constructor Create(AGridView: TcxCustomGridView); virtual; + property GridView: TcxCustomGridView read FGridView write FGridView; + function IsEqual(AChange: TcxCustomGridChange): Boolean; override; + end; + + TcxGridControlFocusChange = class(TcxCustomGridViewChange) + public + procedure Execute; override; + end; + + { hit tests } + + TcxCustomGridHitTestClass = class of TcxCustomGridHitTest; + + TcxCustomGridHitTest = class + private + FPos: TPoint; + FViewInfo: TcxCustomGridCellViewInfo; + procedure SetViewInfo(Value: TcxCustomGridCellViewInfo); + protected + class function GetHitTestCode: Integer; virtual; + procedure Init(const APos: TPoint); + public + destructor Destroy; override; + function Cursor: TCursor; virtual; + function DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; virtual; + class function HitTestCode: Integer; + class function Instance(const APos: TPoint): TcxCustomGridHitTest; + property Pos: TPoint read FPos; + property ViewInfo: TcxCustomGridCellViewInfo read FViewInfo write SetViewInfo; + end; + + TcxGridNoneHitTest = class(TcxCustomGridHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + TcxCustomGridViewHitTest = class(TcxCustomGridHitTest) + private + FGridView: TcxCustomGridView; + public + property GridView: TcxCustomGridView read FGridView write FGridView; + end; + + TcxGridViewNoneHitTest = class(TcxCustomGridViewHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + TcxGridNavigatorHitTest = class(TcxCustomGridViewHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + TcxGridCustomizationFormHitTest = class(TcxCustomGridViewHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + TcxGridDesignSelectorHitTest = class(TcxCustomGridViewHitTest) + protected + class function GetHitTestCode: Integer; override; + public + function Cursor: TCursor; override; + end; + + { custom handler } + + TcxGridViewHandler = class(TcxInterfacedPersistent) + private + FGridView: TcxCustomGridView; + function GetControl: TcxControl; + function GetController: TcxCustomGridController; + function GetDataController: TcxCustomDataController; + function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; + function GetPainter: TcxCustomGridPainter; + function GetSite: TcxGridSite; + function GetViewData: TcxCustomGridViewData; + function GetViewInfo: TcxCustomGridViewInfo; + protected + property Control: TcxControl read GetControl; + property Controller: TcxCustomGridController read GetController; + property DataController: TcxCustomDataController read GetDataController; + property ViewData: TcxCustomGridViewData read GetViewData; + public + constructor Create(AGridView: TcxCustomGridView); reintroduce; virtual; + procedure BeginUpdate; + procedure EndUpdate; + property GridView: TcxCustomGridView read FGridView; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter; + property Painter: TcxCustomGridPainter read GetPainter; + property Site: TcxGridSite read GetSite; + property ViewInfo: TcxCustomGridViewInfo read GetViewInfo; + end; + + { contoller } + + // drag&drop objects + + TcxCustomGridDragAndDropObject = class(TcxDragAndDropObject) + private + function GetController: TcxCustomGridController; + function GetGridView: TcxCustomGridView; + function GetViewInfo: TcxCustomGridViewInfo; + protected + procedure AfterDragAndDrop(Accepted: Boolean); override; + procedure AfterPaint; virtual; + procedure BeforePaint; virtual; + property Controller: TcxCustomGridController read GetController; + property ViewInfo: TcxCustomGridViewInfo read GetViewInfo; + public + SourcePoint: TPoint; + procedure AfterScrolling; virtual; + procedure BeforeScrolling; virtual; + procedure AfterViewChange; virtual; + procedure BeforeViewChange; virtual; + procedure Init(const P: TPoint; AParams: TcxCustomGridHitTest); virtual; + property GridView: TcxCustomGridView read GetGridView; + end; + + TcxGridArrowNumber = (anFirst, anLast); + TcxGridArrowPlace = TcxArrowPlace; + + TcxCustomGridMovingObject = class(TcxCustomGridDragAndDropObject) + private + FDragImage: TcxDragImage; + FSourceItem: TObject; + function GetArrowPlace(AArrowNumber: TcxGridArrowNumber): TcxGridArrowPlace; + function GetCustomizationForm: TcxCustomGridCustomizationForm; + protected + Arrows: array[TcxGridArrowNumber] of TcxDragAndDropArrow; + + procedure DirtyChanged; override; + function GetDragAndDropCursor(Accepted: Boolean): TCursor; override; + + procedure ChangeArrowsPosition(AVisible: Boolean = True); + procedure ChangeDragImagePosition(AVisible: Boolean = True); + + function AreArrowsVertical: Boolean; virtual; + function CanRemove: Boolean; virtual; abstract; + function GetArrowAreaBounds(APlace: TcxGridArrowPlace): TRect; virtual; abstract; + function GetArrowClass: TcxDragAndDropArrowClass; virtual; + function GetArrowsClientRect: TRect; virtual; + function GetCustomizationFormListBox: TcxCustomGridItemsListBox; virtual; abstract; + function GetDragImageClass: TcxDragImageClass; virtual; + function GetSourceItemBounds: TRect; virtual; + function GetSourceItemViewInfo: TcxCustomGridCellViewInfo; virtual; + procedure InitDragImage; virtual; + procedure InitDragImageUsingCustomizationForm(ACanvas: TcxCanvas; + const R: TRect; AItem: TObject); virtual; + function IsSourceCustomizationForm: Boolean; virtual; abstract; + function IsValidDestination: Boolean; virtual; abstract; + + procedure BeginDragAndDrop; override; + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); override; + procedure EndDragAndDrop(Accepted: Boolean); override; + + property ArrowPlaces[AArrowNumber: TcxGridArrowNumber]: TcxGridArrowPlace read GetArrowPlace; + property ArrowsClientRect: TRect read GetArrowsClientRect; + property CustomizationForm: TcxCustomGridCustomizationForm read GetCustomizationForm; + property CustomizationFormListBox: TcxCustomGridItemsListBox read GetCustomizationFormListBox; + property DragImage: TcxDragImage read FDragImage; + property SourceItem: TObject read FSourceItem write FSourceItem; + property SourceItemBounds: TRect read GetSourceItemBounds; + property SourceItemViewInfo: TcxCustomGridCellViewInfo read GetSourceItemViewInfo; + public + procedure AfterScrolling; override; + end; + + // customization form + + TcxCustomGridItemsInnerListBox = class(TcxInnerListBox) + private + FDragAndDropItemIndex: Integer; + FMouseDownPos: TPoint; + function GetContainer: TcxCustomGridItemsListBox; + function GetDragAndDropItem: TObject; + function GetGridView: TcxCustomGridView; + function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; + procedure WMCancelMode(var Message: TWMCancelMode); message WM_CANCELMODE; + procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT; + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + + procedure CalculateBorderStyle; + procedure CalculateItemHeight; + + property Container: TcxCustomGridItemsListBox read GetContainer; + property DragAndDropItem: TObject read GetDragAndDropItem; + property DragAndDropItemIndex: Integer read FDragAndDropItemIndex; + property GridView: TcxCustomGridView read GetGridView; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter; + public + constructor Create(AOwner: TComponent); override; + end; + + TcxCustomGridItemsListBoxClass = class of TcxCustomGridItemsListBox; + + TcxCustomGridItemsListBox = class(TcxListBox) + private + function GetDragAndDropItem: TObject; + function GetGridView: TcxCustomGridView; + function GetInnerListBox: TcxCustomGridItemsInnerListBox; + protected + function CalculateItemHeight: Integer; virtual; abstract; + function GetInnerListBoxClass: TcxInnerListBoxClass; override; + function GetDragAndDropParams: TcxCustomGridHitTest; virtual; abstract; + property DragAndDropItem: TObject read GetDragAndDropItem; + property GridView: TcxCustomGridView read GetGridView; + public + constructor Create(AOwner: TComponent); override; + function IndexOfItem(AItem: TObject): Integer; + procedure PaintDragAndDropItem(ACanvas: TcxCanvas; const R: TRect; AItem: TObject); + procedure PaintItem(ACanvas: TcxCanvas; R: TRect; AIndex: Integer; AFocused: Boolean); virtual; abstract; + procedure RefreshItems; virtual; + property InnerListBox: TcxCustomGridItemsInnerListBox read GetInnerListBox; + end; + + TcxCustomGridCustomizationFormClass = class of TcxCustomGridCustomizationForm; + + TcxCustomGridCustomizationForm = class(TForm) + private + FController: TcxCustomGridController; + FHookTimer: TcxTimer; + FOffset: Integer; + FPageControl: TcxPageControl; + function GetGridView: TcxCustomGridView; + function GetViewInfo: TcxCustomGridViewInfo; + procedure HookTimerHandler(Sender: TObject); + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure DoClose(var Action: TCloseAction); override; + procedure DoShow; override; + + procedure CalculateConsts; virtual; + procedure CreateControls; virtual; + function CreatePage(const ACaption: string; AVisible: Boolean): TcxTabSheet; + procedure GridViewChanged; virtual; + + function GetContentBounds: TRect; virtual; + function GetPageControlBounds: TRect; virtual; + procedure InitPageControl; virtual; + + property ContentBounds: TRect read GetContentBounds; + property GridView: TcxCustomGridView read GetGridView; + property Offset: Integer read FOffset write FOffset; + property PageControl: TcxPageControl read FPageControl; + property ViewInfo: TcxCustomGridViewInfo read GetViewInfo; + public + constructor Create(AController: TcxCustomGridController); reintroduce; virtual; + destructor Destroy; override; + property Controller: TcxCustomGridController read FController; + procedure ActivatePage(APage: TcxTabSheet); + procedure RefreshData; virtual; + end; + + // popup + + (*$HPPEMIT 'namespace Cxgridcustomview'}*) + (*$HPPEMIT '{'}*) + (*$HPPEMIT '__interface IcxCustomGridPopupOwner;'}*) + (*$HPPEMIT '}'*) + + IcxCustomGridPopupOwner = interface + ['{ACF62D23-6871-4735-A4CE-3B0888DB8FC3}'] + function ClosePopupWhenNilOwner: Boolean; + function GetOwnerBounds: TRect; + procedure PopupClosed; + end; + + TcxCustomGridPopup = class(TcxCustomPopupWindow) + private + FGridView: TcxCustomGridView; + FOwner: IcxCustomGridPopupOwner; + procedure SetOwner(Value: IcxCustomGridPopupOwner); + protected + function CalculateOwnerBounds: TRect; virtual; + function GetClientMinWidth: Integer; virtual; + procedure InitPopup; override; + procedure Paint; override; + procedure VisibleChanged; override; + public + constructor Create(AGridView: TcxCustomGridView); reintroduce; virtual; + procedure CloseUp; override; + procedure Popup; reintroduce; virtual; + property BorderWidths; + property GridView: TcxCustomGridView read FGridView; + property ClientMinWidth: Integer read GetClientMinWidth; + property Owner: IcxCustomGridPopupOwner read FOwner write SetOwner; + end; + + TcxGridIndexes = array of Integer; + + TcxGridPopupListBoxActionEvent = procedure(Sender: TcxGridPopupListBox; + AItemIndex: Integer) of object; + + TcxGridPopupListBox = class(TcxListBox) + private + FCheckedIndexes: TList; + FItemTextOffsetLeft: Integer; + FItemTextOffsetRight: Integer; + FItemTextOffsetVert: Integer; + FMinWidth: Integer; + FPopup: TcxCustomGridPopup; + FPressedItemIndex: Integer; + FShowChecks: Boolean; + FVisibleItemCount: Integer; + FVisibleWidth: Integer; + FOnAction: TcxGridPopupListBoxActionEvent; + function GetChecked(Index: Integer): Boolean; + function GetCheckedIndexes: TcxGridIndexes; + function GetGridView: TcxCustomGridView; + procedure SetChecked(Index: Integer; Value: Boolean); + procedure SetCheckedIndexes(const Value: TcxGridIndexes); + procedure SetPressedItemIndex(Value: Integer); + procedure SetShowChecks(Value: Boolean); + protected + function DrawItem(ACanvas: TcxCanvas; AIndex: Integer; const ARect: TRect; + AState: TOwnerDrawState): Boolean; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseLeave(AControl: TControl); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + + function CalculateItemHeight: Integer; virtual; + procedure DoAction(AItemIndex: Integer); virtual; + procedure DrawItemCheck(ACanvas: TcxCanvas; AIndex: Integer; + const ACheckAreaRect: TRect; AState: TOwnerDrawState); virtual; + procedure DrawItemContent(ACanvas: TcxCanvas; AIndex: Integer; ARect: TRect; + AState: TOwnerDrawState); virtual; + function GetVisibleItemCount(AItems: TStrings): Integer; virtual; + procedure Init; virtual; + procedure InvalidateItem(AIndex: Integer); + + function CanHaveCheck(AItemIndex: Integer): Boolean; virtual; + procedure ChangeChecked(AItemIndex: Integer); virtual; + function GetCheckAreaHeight: Integer; + function GetCheckAreaWidth: Integer; + function HasCheck(AItemIndex: Integer): Boolean; virtual; + function IsCheck(AItemIndex: Integer): Boolean; + property Checked[Index: Integer]: Boolean read GetChecked write SetChecked; + property CheckedIndexes: TcxGridIndexes read GetCheckedIndexes write SetCheckedIndexes; + property PressedItemIndex: Integer read FPressedItemIndex write SetPressedItemIndex; + property ShowChecks: Boolean read FShowChecks write SetShowChecks; + public + constructor Create(APopup: TcxCustomGridPopup); reintroduce; virtual; + destructor Destroy; override; + procedure AdjustBounds(AItems: TStrings = nil); virtual; + + property GridView: TcxCustomGridView read GetGridView; + property ItemTextOffsetLeft: Integer read FItemTextOffsetLeft write FItemTextOffsetLeft; + property ItemTextOffsetRight: Integer read FItemTextOffsetRight write FItemTextOffsetRight; + property ItemTextOffsetVert: Integer read FItemTextOffsetVert write FItemTextOffsetVert; + property MinWidth: Integer read FMinWidth write FMinWidth; + property Popup: TcxCustomGridPopup read FPopup; + property VisibleItemCount: Integer read FVisibleItemCount write FVisibleItemCount; + property VisibleWidth: Integer read FVisibleWidth write FVisibleWidth; + property OnAction: TcxGridPopupListBoxActionEvent read FOnAction write FOnAction; + end; + + // controllers + + TcxCustomGridDesignController = class + protected + function GetControl: TcxControl; virtual; abstract; + function GetDesignObject(AObject: TPersistent): TPersistent; virtual; + public + function IsObjectSelected(AObject: TPersistent): Boolean; + procedure SelectObject(AObject: TPersistent; AClearSelection: Boolean); + procedure SelectObjects(AObjects: TList); + procedure UnselectObject(AObject: TPersistent); + property Control: TcxControl read GetControl; // TcxCustomGrid + end; + + TcxGridViewDesignControllerClass = class of TcxGridViewDesignController; + + TcxGridViewDesignController = class(TcxCustomGridDesignController) + private + FController: TcxCustomGridController; + protected + function GetControl: TcxControl; override; + function GetDesignObject(AObject: TPersistent): TPersistent; override; + public + constructor Create(AController: TcxCustomGridController); virtual; + property Controller: TcxCustomGridController read FController; + end; + + TcxCustomGridControllerClass = class of TcxCustomGridController; + + TcxCustomGridController = class(TcxGridViewHandler, IcxMouseTrackingCaller, + IcxMouseTrackingCaller2) + private + FCustomization: Boolean; + FCustomizationForm: TcxCustomGridCustomizationForm; + FCustomizationFormBounds: TRect; + FDesignController: TcxGridViewDesignController; + FHintAreaBounds: TRect; + FHintCellViewInfo: TcxCustomGridViewCellViewInfo; + FHintCheckerTimer: TcxTimer; + FHintTextRect: TRect; + FHintWindow: THintWindow; + FIsCheckingCoordinates: Boolean; + FIsDblClick: Boolean; + FIsFocusing: Boolean; + function GetDesignController: TcxGridViewDesignController; + function GetDragAndDropObject: TcxCustomGridDragAndDropObject; + function GetDragAndDropObjectClass: TcxDragAndDropObjectClass; + function GetDragImages: TcxDragImageList; + function GetIsDragging: Boolean; + function GetMouseCaptureViewInfo: TcxCustomGridCellViewInfo; + procedure SetCustomization(Value: Boolean); + procedure SetDragAndDropObjectClass(Value: TcxDragAndDropObjectClass); + procedure SetMouseCaptureViewInfo(Value: TcxCustomGridCellViewInfo); + procedure HintCheckerTimerHandler(Sender: TObject); + protected + { IcxMouseTrackingCaller2 } + procedure MouseLeave; virtual; + function PtInCaller(const P: TPoint): Boolean; virtual; + + procedure AfterPaint; virtual; + procedure BeforeKillFocus; virtual; + procedure BeforePaint; virtual; + function CanFocusOnClick(X, Y: Integer): Boolean; virtual; + function CanHandleHitTest(AHitTest: TcxCustomGridHitTest): Boolean; virtual; + procedure CheckCoordinates; virtual; + procedure DetailFocused(ADetail: TcxCustomGridView); virtual; + procedure DoEnter; virtual; + procedure DoExit; virtual; + procedure DoSetFocus(ANotifyMaster: Boolean); virtual; + function GetDesignControllerClass: TcxGridViewDesignControllerClass; virtual; + function GetDesignHitTest(AHitTest: TcxCustomGridHitTest): Boolean; virtual; + function GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; virtual; + function GetPatternObject(AObject: TPersistent): TPersistent; virtual; + procedure GridViewChanged; virtual; + function IsPixelScrollBar(AKind: TScrollBarKind): Boolean; virtual; + function MayFocus: Boolean; virtual; + procedure RemoveFocus; virtual; + procedure SetFocus(ANotifyMaster: Boolean); virtual; + + // customization + procedure CheckCustomizationFormBounds(var R: TRect); virtual; + procedure CustomizationChanged; virtual; + function GetCustomizationFormBounds: TRect; + function GetCustomizationFormClass: TcxCustomGridCustomizationFormClass; virtual; + function GetCustomizationFormDefaultWidth: Integer; virtual; + function GetCustomizationFormDefaultHeight: Integer; virtual; + procedure HideCustomizationForm; + procedure ShowCustomizationForm; + + property DragAndDropObject: TcxCustomGridDragAndDropObject read GetDragAndDropObject; + property IsCheckingCoordinates: Boolean read FIsCheckingCoordinates; + property IsDragging: Boolean read GetIsDragging; + property IsFocusing: Boolean read FIsFocusing; + public + destructor Destroy; override; + procedure ControlFocusChanged; virtual; + procedure DesignerModified; + procedure DoCancelMode; virtual; + procedure DoCheckCoordinates; + procedure DoControlFocusChanged; + function GetCursor(X, Y: Integer): TCursor; virtual; + function HasFocusedControls: Boolean; virtual; + //function CanDrag(X, Y: Integer): Boolean; dynamic; + //function GetDragObjectClass: TDragControlObjectClass; dynamic; + + procedure InitScrollBarsParameters; virtual; + function IsDataFullyVisible(AIsCallFromMaster: Boolean = False): Boolean; virtual; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); virtual; + procedure SetScrollBarInfo(AScrollBarKind: TScrollBarKind; + AMin, AMax, AStep, APage, APos: Integer; AAllowShow, AAllowHide: Boolean); + procedure UpdateScrollBars(AIgnoreUpdateLock: Boolean = False); + + procedure BeginDragAndDrop; virtual; + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); virtual; + procedure EndDragAndDrop(Accepted: Boolean); virtual; + function StartDragAndDrop(const P: TPoint): Boolean; virtual; + + // delphi drag and drop + procedure BeforeStartDrag; virtual; + function CanDrag(X, Y: Integer): Boolean; virtual; + procedure DragDrop(Source: TObject; X, Y: Integer); virtual; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); virtual; + procedure DrawDragImage(ACanvas: TcxCanvas; R: TRect); virtual; + procedure EndDrag(Target: TObject; X, Y: Integer); virtual; + function GetDragImagesSize: TPoint; virtual; + function HasDragImages: Boolean; virtual; + procedure StartDrag(var DragObject: TDragObject); virtual; + property DragImages: TcxDragImageList read GetDragImages; + + // hints + function CanShowHint: Boolean; virtual; + procedure HideHint; + function GetHintWindowClass: THintWindowClass; virtual; + procedure ShowHint(const AHintAreaBounds, ATextRect: TRect; const AText: string; + AIsHintMultiLine: Boolean; AFont: TFont; AHintCellViewInfo: TcxCustomGridViewCellViewInfo); + procedure StartHintCheckerTimer; + procedure StopHintCheckerTimer; + property HintCellViewInfo: TcxCustomGridViewCellViewInfo read FHintCellViewInfo; + property HintWindow: THintWindow read FHintWindow; + + procedure DoKeyDown(var Key: Word; Shift: TShiftState); virtual; + procedure KeyDown(var Key: Word; Shift: TShiftState); virtual; + procedure KeyPress(var Key: Char); virtual; + procedure KeyUp(var Key: Word; Shift: TShiftState); virtual; + + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); virtual; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); virtual; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); virtual; + + function ProcessDetailDialogChar(ADetail: TcxCustomGridView; ACharCode: Word): Boolean; virtual; + function ProcessDialogChar(ACharCode: Word): Boolean; virtual; + + procedure WndProc(var Message: TMessage); virtual; + + procedure RefreshCustomizationForm; + + {procedure BeginCellMouseTracking(AViewInfo: TcxCustomGridCellViewInfo); + procedure EndCellMouseTracking(AViewInfo: TcxCustomGridCellViewInfo);} + + property Customization: Boolean read FCustomization write SetCustomization; + property CustomizationForm: TcxCustomGridCustomizationForm read FCustomizationForm; + property CustomizationFormBounds: TRect read FCustomizationFormBounds + write FCustomizationFormBounds; + property DesignController: TcxGridViewDesignController read GetDesignController; + property DragAndDropObjectClass: TcxDragAndDropObjectClass read GetDragAndDropObjectClass + write SetDragAndDropObjectClass; + property IsDblClick: Boolean read FIsDblClick; + property MouseCaptureViewInfo: TcxCustomGridCellViewInfo read GetMouseCaptureViewInfo + write SetMouseCaptureViewInfo; + end; + + { datacontroller } + + // sorting by summary + + TcxDataGroupNode = class + private + FChilds: TList; + FDataGroupInfo: TcxDataGroupInfo; + FParent: TcxDataGroupNode; + function GetChild(Index: Integer): TcxDataGroupNode; + function GetChildCount: Integer; + public + constructor Create(AParent: TcxDataGroupNode; ADataGroupInfo: TcxDataGroupInfo); + destructor Destroy; override; + function AddChild(ADataGroupInfo: TcxDataGroupInfo): TcxDataGroupNode; + + property ChildCount: Integer read GetChildCount; + property Childs[Index: Integer]: TcxDataGroupNode read GetChild; default; + property DataGroupInfo: TcxDataGroupInfo read FDataGroupInfo; + property Parent: TcxDataGroupNode read FParent; + end; + + TcxSortingBySummaryInfo = class + SortOrder: TcxDataSortOrder; + SummaryItemIndex: Integer; + end; + + TcxGridSortingBySummaryEngine = class(TcxSortingBySummaryEngine) + private + FInfos: TList; + FRootNode: TcxDataGroupNode; + function GetDataGroups: TcxDataGroups; + function GetInfo(Index: Integer): TcxSortingBySummaryInfo; + function GetInfoCount: Integer; + protected + procedure AddInfo(AInfo: TcxSortingBySummaryInfo); + procedure BuildNodes(AParentNode: TcxDataGroupNode; ALevel: Integer; var ACurIndex: Integer); + procedure ClearInfos; + function CompareGroupsBySummary(AInfo1, AInfo2: Pointer): Integer; + procedure RebuildDataGroupRecursive(AParentNode: TcxDataGroupNode; var ABeginRecordListIndex: Integer); + procedure RebuildDataGroups; + procedure SortNodeRecursive(ANode: TcxDataGroupNode; ALevel: Integer); + procedure SortNodes; + + property DataGroups: TcxDataGroups read GetDataGroups; + property InfoCount: Integer read GetInfoCount; + property Infos[Index: Integer]: TcxSortingBySummaryInfo read GetInfo; + public + constructor Create(ADataControllerInfo: TcxCustomDataControllerInfo); override; + destructor Destroy; override; + procedure Sort; override; + end; + + // interface to data controller + + IcxCustomGridDataController = interface + ['{B9ABDC6B-1A4A-4F11-A629-09B6FB9FB4BA}'] + procedure AssignData(ADataController: TcxCustomDataController); + procedure CreateAllItems(AMissingItemsOnly: Boolean); + procedure DeleteAllItems; + procedure GetFakeComponentLinks(AList: TList); + function GetGridView: TcxCustomGridView; + function HasAllItems: Boolean; + function IsDataChangeable: Boolean; + function IsDataLinked: Boolean; + function SupportsCreateAllItems: Boolean; + property GridView: TcxCustomGridView read GetGridView; + end; + + { painters } + + TcxCustomGridCellPainterClass = class of TcxCustomGridCellPainter; + + TcxCustomGridCellPainter = class + private + FCanvas: TcxCanvas; + FViewInfo: TcxCustomGridCellViewInfo; + function GetIsMainCanvasInUseValue: Boolean; + protected + procedure AfterPaint; virtual; + procedure BeforePaint; virtual; + function CanDrawDesignSelection: Boolean; virtual; + procedure DoExcludeFromClipRect; virtual; + procedure DrawBackground; overload; virtual; + procedure DrawBackground(const R: TRect); overload; virtual; + function DrawBackgroundHandler(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; virtual; + procedure DrawBorder(ABorder: TcxBorder); virtual; + procedure DrawBorders; virtual; + procedure DrawContent; virtual; + class procedure DrawDesignSelection(ACanvas: TcxCanvas; + AViewInfo: TcxCustomGridCellViewInfo); virtual; + procedure DrawText; virtual; + function ExcludeFromClipRect: Boolean; virtual; + class function GetIsMainCanvasInUse(ACanvas: TcxCanvas; AViewInfo: TcxCustomGridCellViewInfo): Boolean; + function NeedsPainting: Boolean; virtual; + procedure Paint; virtual; + procedure PrepareCanvasForDrawText; virtual; + procedure UnprepareCanvasForDrawText; virtual; + property Canvas: TcxCanvas read FCanvas; + property IsMainCanvasInUse: Boolean read GetIsMainCanvasInUseValue; + property ViewInfo: TcxCustomGridCellViewInfo read FViewInfo; + public + constructor Create(ACanvas: TcxCanvas; AViewInfo: TcxCustomGridCellViewInfo); virtual; + class procedure DoDrawDesignSelection(ACanvas: TcxCanvas; + AViewInfo: TcxCustomGridCellViewInfo); virtual; + procedure MainPaint; virtual; + end; + + TcxGridDesignSelectorPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridDesignSelectorViewInfo; + protected + procedure DoExcludeFromClipRect; override; + procedure DrawSign(AColor: TColor); virtual; + function ExcludeFromClipRect: Boolean; override; + procedure Paint; override; + property ViewInfo: TcxGridDesignSelectorViewInfo read GetViewInfo; + end; + + TcxCustomGridPainterClass = class of TcxCustomGridPainter; + + TcxCustomGridPainter = class(TcxGridViewHandler) + private + FBackgroundRegion: TcxRegion; + FBeforePaintClipRegion: TcxRegion; + FCanvas: TcxCanvas; + FViewInfo: TcxCustomGridViewInfo; + function GetCanvas: TcxCanvas; + function GetViewInfo: TcxCustomGridViewInfo; + protected + procedure DrawBackground; virtual; + procedure PaintAfter; virtual; + procedure PaintBefore; virtual; + procedure PaintContent; virtual; + property Canvas: TcxCanvas read GetCanvas write FCanvas; + property ViewInfo: TcxCustomGridViewInfo read GetViewInfo write FViewInfo; + public + procedure DrawFocusRect(const R: TRect; AHideFocusRect: Boolean); virtual; + procedure ExcludeFromBackground(const R: TRect); + procedure Paint(ACanvas: TcxCanvas = nil; AViewInfo: TcxCustomGridViewInfo = nil); + procedure Invalidate; overload; + procedure Invalidate(const R: TRect); overload; + procedure Invalidate(ARegion: TcxRegion); overload; + end; + + { viewdata } + + TcxCustomGridViewDataClass = class of TcxCustomGridViewData; + + TcxCustomGridViewData = class(TcxGridViewHandler) + public + function GetSortingBySummaryEngineClass: TcxSortingBySummaryEngineClass; virtual; + function IsEmpty: Boolean; virtual; + function MakeDetailVisible(ADetailLevel: TComponent{TcxGridLevel}): TcxCustomGridView; virtual; + property DataController; + end; + + { viewinfos } + + TcxGridSiteClass = class of TcxGridSite; + + TcxGridSite = class(TcxControl) + private + FBoundsChangedTimer: TcxTimer; + FIgnoreUpdateLock: Boolean; + FSize: TPoint; + FViewInfo: TcxCustomGridViewInfo; + function GetContainer: TcxControl; + function GetController: TcxCustomGridController; + function GetGridView: TcxCustomGridView; + function GetPainter: TcxCustomGridPainter; + procedure SendKeyDownNotification(var Message: TWMKeyDown); + procedure CNKeyDown(var Message: TWMKeyDown); message CN_KEYDOWN; + procedure CNSysKeyDown(var Message: TWMKeyDown); message CN_SYSKEYDOWN; + procedure BoundsChangedTimerHandler(Sender: TObject); + protected + function AllowAutoDragAndDropAtDesignTime(X, Y: Integer; + Shift: TShiftState): Boolean; override; + function AllowDragAndDropWithoutFocus: Boolean; override; + procedure BeforeMouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure BoundsChanged; override; + function CanDrag(X, Y: Integer): Boolean; override; + function CanFocusOnClick(X, Y: Integer): Boolean; override; + procedure DoCancelMode; override; + procedure DoContextPopup(MousePos: TPoint; var Handled: Boolean); override; + procedure DoEnter; override; + procedure DoExit; override; + procedure FocusChanged; override; + function FocusWhenChildIsClicked(AChild: TControl): Boolean; override; + function GetClientBounds: TRect; override; + function GetCursor(X, Y: Integer): TCursor; override; + function GetDesignHitTest(X, Y: Integer; Shift: TShiftState): Boolean; override; + function GetIsDesigning: Boolean; override; + function GetIsFocused: Boolean; override; + function GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; override; + function IsPixelScrollBar(AKind: TScrollBarKind): Boolean; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + function MayFocus: Boolean; override; + procedure MouseLeave(AControl: TControl); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure Paint; override; + procedure RequestAlign; override; + procedure SetParent(AParent: TWinControl); override; + procedure WndProc(var Message: TMessage); override; + + procedure DoEndDrag(Target: TObject; X, Y: Integer); override; + procedure DoStartDrag(var DragObject: TDragObject); override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); override; + procedure DrawDragImage(ACanvas: TcxCanvas; const R: TRect); override; + function GetDragImagesSize: TPoint; override; + function HasDragImages: Boolean; override; + + function GetHScrollBarBounds: TRect; override; + procedure InitScrollBarsParameters; override; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); override; + procedure UpdateScrollBars; override; + + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); override; + procedure EndDragAndDrop(Accepted: Boolean); override; + function StartDragAndDrop(const P: TPoint): Boolean; override; + + procedure CancelPostBoundsChanged; + procedure InitTabStop(AParent: TWinControl); + procedure PostBoundsChanged; + procedure UpdateSize; + + property Controller: TcxCustomGridController read GetController; + property IgnoreUpdateLock: Boolean read FIgnoreUpdateLock write FIgnoreUpdateLock; + property Painter: TcxCustomGridPainter read GetPainter; + public + constructor Create(AViewInfo: TcxCustomGridViewInfo); reintroduce; virtual; + destructor Destroy; override; + procedure BeginDragAndDrop; override; + procedure DragDrop(Source: TObject; X, Y: Integer); override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; + procedure SetFocus; override; + function UpdateAction(Action: TBasicAction): Boolean; override; + + property Container: TcxControl read GetContainer; + property GridView: TcxCustomGridView read GetGridView; + property HScrollBar; + property HScrollBarVisible; + property Keys; //!!! + property MouseCapture; + property ViewInfo: TcxCustomGridViewInfo read FViewInfo; + property VScrollBar; + property VScrollBarVisible; + end; + + TcxCustomGridCellViewInfoClass = class of TcxCustomGridCellViewInfo; + + TcxCustomGridCellViewInfo = class(TcxIUnknownObject, + IcxMouseCaptureObject, IcxMouseTrackingCaller, IcxMouseTrackingCaller2, + IcxCustomGridPopupOwner) + private + FCalculated: Boolean; + FCalculatingParams: Boolean; + FAlignmentHorz: TAlignment; + FAlignmentVert: TcxAlignmentVert; + FBorders: TcxBorders; + FIsDestroying: Boolean; + FLinkedHitTest: TcxCustomGridHitTest; + FParamsCalculated: Boolean; + FState: TcxGridCellState; + FText: string; + FVisible: Boolean; + function GetBorderSize(AIndex: TcxBorder): Integer; + function GetButtonState: TcxButtonState; + function GetClientBounds: TRect; + function GetContentBounds: TRect; + function GetTextBoundsValue: TRect; + function GetTextHeight: Integer; + function GetTextHeightWithOffset: Integer; + function GetTextWidth: Integer; + function GetTextWidthWithOffset: Integer; + procedure SetLinkedHitTest(Value: TcxCustomGridHitTest); + procedure SetState(Value: TcxGridCellState); + protected + FClientBounds: TRect; + FContentBounds: TRect; + + { IcxMouseCaptureObject } + procedure DoCancelMode; virtual; + { IcxMouseTrackingCaller2 } + procedure MouseLeave; virtual; + function PtInCaller(const P: TPoint): Boolean; virtual; + { IcxCustomGridPopupOwner } + function ClosePopupWhenNilOwner: Boolean; + function GetOwnerBounds: TRect; + procedure PopupClosed; + + procedure AfterCalculateBounds(var ABounds: TRect); virtual; + procedure AfterCustomDraw(ACanvas: TcxCanvas); virtual; + procedure BeforeCustomDraw(ACanvas: TcxCanvas); virtual; + procedure BeforeStateChange; virtual; + function CalculateClientBounds: TRect; virtual; + function CalculateContentBounds: TRect; virtual; + function CalculateTextWidth(AAngle: Integer = 0): Integer; + function CalculateTextHeight(AForPainting: Boolean; AAngle: Integer = 0): Integer; + procedure CalculateParams; + procedure CalculateParamsNeeded; + function CalculateHeight: Integer; virtual; + function CalculateWidth: Integer; virtual; + function CaptureMouseOnPress: Boolean; virtual; + procedure Click; virtual; + function CustomDraw(ACanvas: TcxCanvas): Boolean; virtual; + function CustomDrawBackground(ACanvas: TcxCanvas): Boolean; virtual; + procedure Destroying; + procedure DoCalculateParams; virtual; + procedure DoInvalidate; virtual; + function DoCustomDraw(ACanvas: TcxCanvas): Boolean; virtual; + function DoCustomDrawBackground(ACanvas: TcxCanvas): Boolean; virtual; + function GetActualState: TcxGridCellState; virtual; + function GetAlignmentHorz: TAlignment; virtual; + function GetAlignmentVert: TcxAlignmentVert; virtual; + function GetAreaBounds: TRect; virtual; + function GetBackgroundBitmap: TBitmap; virtual; + function GetBorderBounds(AIndex: TcxBorder): TRect; virtual; + function GetBorderColor(AIndex: TcxBorder): TColor; virtual; + function GetBorders: TcxBorders; virtual; + function GetBorderWidth(AIndex: TcxBorder): Integer; virtual; + function GetBounds: TRect; + function GetCanvas: TcxCanvas; virtual; abstract; + class function GetCellHeight(ATextHeight: Integer; + ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; virtual; + function GetContentHeight: Integer; virtual; + function GetContentWidth: Integer; virtual; + function GetControl: TcxControl; virtual; + function GetDesignSelectionBounds: TRect; virtual; + function GetDesignSelectionWidth: Integer; virtual; + function GetHeight: Integer; virtual; + function GetHitTestClass: TcxCustomGridHitTestClass; virtual; abstract; + function GetHotTrack: Boolean; virtual; + function GetIsCheck: Boolean; virtual; + function GetIsDesignSelected: Boolean; virtual; + function GetIsVisibleForPainting: Boolean; virtual; + function GetMouseCapture: Boolean; virtual; + function GetMultiLine: Boolean; virtual; + function GetMultiLinePainting: Boolean; virtual; + function GetPainterClass: TcxCustomGridCellPainterClass; virtual; + function GetShowEndEllipsis: Boolean; virtual; + function GetText: string; virtual; + function GetTextAreaBounds: TRect; virtual; + function GetTextAttributes(AForPainting: Boolean): Integer; virtual; + function GetTextBounds(AHorizontal, AVertical: Boolean): TRect; + function GetTextCellHeight(AGridViewInfo: TcxCustomGridViewInfo; + ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; virtual; + function GetTextForPainting: string; virtual; + function GetTransparent: Boolean; virtual; + procedure GetViewParams(var AParams: TcxViewParams); virtual; + function GetVisible: Boolean; virtual; + function GetVisibleForHitTest: Boolean; virtual; + function GetWidth: Integer; virtual; + function HasBackground: Boolean; virtual; + function HasCustomDraw: Boolean; virtual; + function HasCustomDrawBackground: Boolean; virtual; + function HasHitTestPoint(const P: TPoint): Boolean; virtual; + function HasMouse(AHitTest: TcxCustomGridHitTest): Boolean; virtual; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); virtual; + function InvalidateOnStateChange: Boolean; virtual; + procedure Offset(DX, DY: Integer); virtual; + procedure RestoreParams(const AParams: TcxViewParams); virtual; + procedure SaveParams(out AParams: TcxViewParams); virtual; + procedure SetHeight(Value: Integer); virtual; + procedure SetMouseCapture(Value: Boolean); virtual; + procedure SetWidth(Value: Integer); virtual; + procedure StateChanged(APrevState: TcxGridCellState); virtual; + + procedure DropDown; virtual; + procedure CloseUp; virtual; + function CloseDropDownWindowOnDestruction: Boolean; virtual; + function DropDownWindowExists: Boolean; virtual; + function GetDropDownWindow: TcxCustomGridPopup; virtual; + function GetDropDownWindowOwnerBounds: TRect; virtual; + function IsDropDownWindowOwner: Boolean; virtual; + property DropDownWindow: TcxCustomGridPopup read GetDropDownWindow; + + property BorderWidth[AIndex: TcxBorder]: Integer read GetBorderWidth; + property CalculatingParams: Boolean read FCalculatingParams; + property Canvas: TcxCanvas read GetCanvas; + property Control: TcxControl read GetControl; + property DesignSelectionBounds: TRect read GetDesignSelectionBounds; + property DesignSelectionWidth: Integer read GetDesignSelectionWidth; + property HotTrack: Boolean read GetHotTrack; + property IsCheck: Boolean read GetIsCheck; + property IsDesignSelected: Boolean read GetIsDesignSelected; + property IsDestroying: Boolean read FIsDestroying; + property IsVisibleForPainting: Boolean read GetIsVisibleForPainting; + property LinkedHitTest: TcxCustomGridHitTest read FLinkedHitTest write SetLinkedHitTest; + property ShowEndEllipsis: Boolean read GetShowEndEllipsis; + public + Bounds: TRect; + MultiLine: Boolean; + MultiLinePainting: Boolean; + Params: TcxViewParams; + + constructor Create; + destructor Destroy; override; + procedure AfterConstruction; override; + procedure AfterRecalculation; virtual; + procedure BeforeDestruction; override; + procedure BeforeRecalculation; virtual; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); overload; virtual; + procedure Calculate(const ABounds: TRect); overload; virtual; + function GetAreaBoundsForPainting: TRect; virtual; + function GetBestFitWidth: Integer; virtual; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; virtual; + function HasPoint(const P: TPoint): Boolean; virtual; + procedure Invalidate; virtual; + function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; virtual; + function MouseMove(AHitTest: TcxCustomGridHitTest; AShift: TShiftState): Boolean; virtual; + function MouseUp(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; virtual; + procedure DoOffset(DX, DY: Integer); + procedure Paint(ACanvas: TcxCanvas = nil); virtual; + procedure Recalculate; + procedure ResetContentBounds; + procedure Update; + + property ActualState: TcxGridCellState read GetActualState; + property AlignmentHorz: TAlignment read FAlignmentHorz write FAlignmentHorz; + property AlignmentVert: TcxAlignmentVert read FAlignmentVert write FAlignmentVert; + property BackgroundBitmap: TBitmap read GetBackgroundBitmap; + property BorderBounds[AIndex: TcxBorder]: TRect read GetBorderBounds; + property BorderColor[AIndex: TcxBorder]: TColor read GetBorderColor; + property BorderSize[AIndex: TcxBorder]: Integer read GetBorderSize; + property Borders: TcxBorders read FBorders write FBorders; + property ButtonState: TcxButtonState read GetButtonState; + property Calculated: Boolean read FCalculated write FCalculated; + property ClientBounds: TRect read GetClientBounds; + property ContentBounds: TRect read GetContentBounds; + property ContentHeight: Integer read GetContentHeight; + property ContentWidth: Integer read GetContentWidth; + property Height: Integer read GetHeight write SetHeight; + property MouseCapture: Boolean read GetMouseCapture write SetMouseCapture; + property State: TcxGridCellState read FState write SetState; + property Text: string read FText write FText; + property TextBounds: TRect read GetTextBoundsValue; + property TextForPainting: string read GetTextForPainting; + property TextHeightWithOffset: Integer read GetTextHeightWithOffset; + property TextWidthWithOffset: Integer read GetTextWidthWithOffset; + property TextHeight: Integer read GetTextHeight; + property TextWidth: Integer read GetTextWidth; + property TextAreaBounds: TRect read GetTextAreaBounds; + property Transparent: Boolean read GetTransparent; + property Visible: Boolean read GetVisible write FVisible; + property VisibleForHitTest: Boolean read GetVisibleForHitTest; + property Width: Integer read GetWidth write SetWidth; + end; + + TcxCustomGridViewCellViewInfo = class(TcxCustomGridCellViewInfo) + private + FGridViewInfo: TcxCustomGridViewInfo; + function GetController: TcxCustomGridController; + function GetGridView: TcxCustomGridView; + function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; + protected + procedure AfterCalculateBounds(var ABounds: TRect); override; + procedure DoInvalidate; override; + function EmulateMouseMoveAfterCalculate: Boolean; virtual; + function GetCanvas: TcxCanvas; override; + function GetControl: TcxControl; override; + function HasMouse(AHitTest: TcxCustomGridHitTest): Boolean; override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + + function CanShowHint: Boolean; virtual; + procedure CheckHint(AHitTest: TcxCustomGridHitTest); + function GetAreaBoundsForHint: TRect; virtual; + function GetBoundsForHint: TRect; + function GetCellBoundsForHint: TRect; virtual; + function GetHintText: string; virtual; + function GetHintTextRect(const AMousePos: TPoint): TRect; virtual; + function HasHintPoint(const P: TPoint): Boolean; virtual; + procedure InitHint(const AMousePos: TPoint; out AHintText: TCaption; + out AIsHintMultiLine: Boolean; out ATextRect: TRect); virtual; + function IsHintForText: Boolean; virtual; + function IsHintMultiLine: Boolean; virtual; + function NeedShowHint(const AMousePos: TPoint; out AHintText: TCaption; + out AIsHintMultiLine: Boolean; out ATextRect: TRect): Boolean; virtual; + + property Controller: TcxCustomGridController read GetController; + public + constructor Create(AGridViewInfo: TcxCustomGridViewInfo); virtual; + destructor Destroy; override; + procedure BeforeRecalculation; override; + procedure Invalidate; override; + function MouseMove(AHitTest: TcxCustomGridHitTest; AShift: TShiftState): Boolean; override; + property GridView: TcxCustomGridView read GetGridView; + property GridViewInfo: TcxCustomGridViewInfo read FGridViewInfo; + property HintText: string read GetHintText; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter; + end; + + TcxGridDesignSelectorViewInfoClass = class of TcxGridDesignSelectorViewInfo; + + TcxGridDesignSelectorViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FRegion: TcxRegion; + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetHotTrack: Boolean; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + + procedure CreateRegion; + procedure DestroyRegion; + property Region: TcxRegion read FRegion; + public + destructor Destroy; override; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + function HasPoint(const P: TPoint): Boolean; override; + function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + end; + + TcxCustomGridViewInfoClass = class of TcxCustomGridViewInfo; + + TcxCustomGridViewInfo = class(TcxGridViewHandler) + private + FActiveViewInfos: TList; + FAllowCheckCoordinates: Boolean; + FAllowHideSite: Boolean; + FBounds: TRect; + FClientBounds: TRect; + FClientBoundsAssigned: Boolean; + FDesignSelectorViewInfo: TcxGridDesignSelectorViewInfo; + FIsCalculating: Boolean; + FIsInternalUse: Boolean; + FLock: TRTLCriticalSection; + FMousePos: TPoint; + FSite: TcxGridSite; + FSizeCalculating: Boolean; + FVisibilityChanging: Boolean; + + function GetCalculated: Boolean; + function GetCanvas: TcxCanvas; + function GetClientBounds: TRect; + function GetClientHeight: Integer; + function GetClientWidth: Integer; + //function GetIsCalculating: Boolean; + function GetIsInternalUseValue: Boolean; + procedure SetClientBounds(const Value: TRect); + protected + procedure CreateViewInfos; virtual; + procedure DestroyViewInfos(AIsRecreating: Boolean); virtual; + procedure RecreateViewInfos; virtual; + function GetDesignSelectorViewInfoClass: TcxGridDesignSelectorViewInfoClass; virtual; + + function CanHideSite: Boolean; virtual; + procedure CreateSite; + procedure DestroySite; + function GetSiteClass: TcxGridSiteClass; virtual; + function GetSiteParent: TWinControl; + + procedure AddActiveViewInfo(AViewInfo: TObject); + function IsViewInfoActive(AViewInfo: TObject): Boolean; + procedure RemoveActiveViewInfo(AViewInfo: TObject; ARemoveAll: Boolean = False); + + procedure AddScrollBarHeight(var AHeight: Integer); + procedure AdjustClientBounds(var ABounds: TRect); virtual; + procedure AfterCalculating; virtual; + procedure BeforeCalculating; virtual; + procedure Calculate; virtual; + function CalculateClientBounds: TRect; virtual; + procedure CalculateHeight(const AMaxSize: TPoint; var AHeight: Integer; + var AFullyVisible: Boolean); virtual; + procedure CalculateWidth(const AMaxSize: TPoint; var AWidth: Integer); virtual; + function CanCheckCoordinates: Boolean; virtual; + procedure ControlFocusChanged; virtual; + function DoGetHitTest(const P: TPoint): TcxCustomGridHitTest; virtual; + function GetAllowBoundsChangedNotification: Boolean; virtual; + function GetBackgroundBitmap: TBitmap; virtual; + function GetBackgroundColor: TColor; virtual; + //function GetContentBounds: TRect; virtual; + function GetDesignSelectorPos: TPoint; virtual; + procedure GetHScrollBarBounds(var ABounds: TRect); virtual; + function GetIsInternalUse: Boolean; virtual; + function GetVisible: Boolean; virtual; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); virtual; + procedure UpdateMousePos; + procedure VisibilityChanged(AVisible: Boolean); virtual; + + property AllowBoundsChangedNotification: Boolean read GetAllowBoundsChangedNotification; + property AllowCheckCoordinates: Boolean read FAllowCheckCoordinates write FAllowCheckCoordinates; + property ClientBoundsAssigned: Boolean read FClientBoundsAssigned write FClientBoundsAssigned; + property SizeCalculating: Boolean read FSizeCalculating; + property VisibilityChanging: Boolean read FVisibilityChanging; + property Visible: Boolean read GetVisible; + public + constructor Create(AGridView: TcxCustomGridView); override; + destructor Destroy; override; + procedure BeforeDestruction; override; + procedure DoVisibilityChanged(AVisible: Boolean); + function GetFontHeight(AFont: TFont): Integer; + procedure GetFontMetrics(AFont: TFont; out AMetrics: TTextMetric); + procedure GetHeight(const AMaxSize: TPoint; var AHeight: Integer; + var AFullyVisible: Boolean); + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; overload; virtual; + function GetHitTest(X, Y: Integer): TcxCustomGridHitTest; overload; virtual; + procedure GetWidth(const AMaxSize: TPoint; var AWidth: Integer); + procedure MainCalculate(const ABounds: TRect); + procedure Recalculate; + + property AllowHideSite: Boolean read FAllowHideSite write FAllowHideSite; + property BackgroundColor: TColor read GetBackgroundColor; + property BackgroundBitmap: TBitmap read GetBackgroundBitmap; + property Bounds: TRect read FBounds; + property Calculated: Boolean read GetCalculated; + property Canvas: TcxCanvas read GetCanvas; + property ClientBounds: TRect read GetClientBounds write SetClientBounds; + property ClientHeight: Integer read GetClientHeight; + property ClientWidth: Integer read GetClientWidth; + //property ContentBounds: TRect read GetContentBounds; + property DesignSelectorViewInfo: TcxGridDesignSelectorViewInfo read FDesignSelectorViewInfo; + property IsCalculating: Boolean read FIsCalculating; + property IsInternalUse: Boolean read GetIsInternalUseValue write FIsInternalUse; + property MousePos: TPoint read FMousePos; + property Site: TcxGridSite read FSite; + end; + + TcxCustomGridViewInfoCacheItemClass = class of TcxCustomGridViewInfoCacheItem; + + TcxCustomGridViewInfoCacheItem = class + private + FIndex: Integer; + FOwner: TcxCustomGridViewInfoCache; + protected + property Index: Integer read FIndex; + property Owner: TcxCustomGridViewInfoCache read FOwner; + public + constructor Create(AOwner: TcxCustomGridViewInfoCache; AIndex: Integer); virtual; + procedure UnassignValues(AKeepMaster: Boolean); virtual; + end; + + TcxCustomGridViewInfoCacheClass = class of TcxCustomGridViewInfoCache; + + TcxCustomGridViewInfoCache = class(TcxGridViewHandler) + private + FItems: TList; + FUnassigningValues: Boolean; + function GetCount: Integer; + function GetInternalItem(Index: Integer): TcxCustomGridViewInfoCacheItem; + function GetItem(Index: Integer): TcxCustomGridViewInfoCacheItem; + procedure SetCount(Value: Integer); + procedure DestroyItems; + protected + function GetItemClass(Index: Integer): TcxCustomGridViewInfoCacheItemClass; virtual; abstract; + property InternalItems[Index: Integer]: TcxCustomGridViewInfoCacheItem read GetInternalItem; + public + constructor Create(AGridView: TcxCustomGridView); override; + destructor Destroy; override; + procedure UnassignValues(AKeepMaster: Boolean = False); virtual; + property Count: Integer read GetCount write SetCount; + property Items[Index: Integer]: TcxCustomGridViewInfoCacheItem read GetItem; default; + end; + + { custom view } + + TcxGridViewChangeKind = (vcProperty, vcLayout, vcSize); + + TcxCustomGridOptions = class(TcxInterfacedPersistent) + private + FGridView: TcxCustomGridView; + function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; + protected + procedure Changed(AChangeKind: TcxGridViewChangeKind); virtual; + function GetGridViewValue: TcxCustomGridView; virtual; + procedure Notification(AComponent: TComponent; AOperation: TOperation); virtual; + + procedure GetStoredProperties(AProperties: TStrings); virtual; + procedure GetStoredPropertyValue(const AName: string; var AValue: Variant); virtual; + procedure SetStoredPropertyValue(const AName: string; const AValue: Variant); virtual; + + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter; + public + constructor Create(AGridView: TcxCustomGridView); reintroduce; virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + property GridView: TcxCustomGridView read GetGridViewValue; + end; + + TcxCustomGridBackgroundBitmapsClass = class of TcxCustomGridBackgroundBitmaps; + + TcxCustomGridBackgroundBitmaps = class(TcxCustomGridOptions) + private + FItems: TList; + function GetCount: Integer; + procedure BitmapChanged(Sender: TObject); + protected + function GetBitmapStyleIndex(Index: Integer): Integer; virtual; + function GetDefaultBitmap(Index: Integer): TBitmap; virtual; + function GetValue(Index: Integer): TBitmap; + procedure SetValue(Index: Integer; Value: TBitmap); + property Count: Integer read GetCount; + public + constructor Create(AGridView: TcxCustomGridView); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function GetBitmap(Index: Integer): TBitmap; virtual; + property Values[Index: Integer]: TBitmap read GetValue write SetValue; default; + published + property Background: TBitmap index bbBackground read GetValue write SetValue; + end; + + TcxCustomGridOptionsBehaviorClass = class of TcxCustomGridOptionsBehavior; + + TcxCustomGridOptionsBehavior = class(TcxCustomGridOptions) + private + FPostponedSynchronization: Boolean; + function GetPostponedSynchronization: Boolean; + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + published + property PostponedSynchronization: Boolean read GetPostponedSynchronization + write FPostponedSynchronization default True; // should be published in all descendants + end; + + TcxCustomGridOptionsDataClass = class of TcxCustomGridOptionsData; + + TcxCustomGridOptionsData = class(TcxCustomGridOptions); + + TcxCustomGridOptionsSelectionClass = class of TcxCustomGridOptionsSelection; + + TcxCustomGridOptionsSelection = class(TcxCustomGridOptions); + + TcxCustomGridOptionsViewClass = class of TcxCustomGridOptionsView; + + TcxCustomGridOptionsView = class(TcxCustomGridOptions) + private + function GetScrollBars: TScrollStyle; + procedure SetScrollBars(Value: TScrollStyle); + protected + property ScrollBars: TScrollStyle read GetScrollBars write SetScrollBars default ssBoth; + public + procedure Assign(Source: TPersistent); override; + end; + + TcxCustomGridStyles = class(TcxStyles) + private + function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; + protected + procedure Changed(AIndex: Integer); override; + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + procedure GetFakeComponentLinks(AList: TList); virtual; + function GetGridView: TcxCustomGridView; virtual; abstract; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter; + public + property GridView: TcxCustomGridView read GetGridView; + end; + + TcxCustomGridViewStylesClass = class of TcxCustomGridViewStyles; + + TcxCustomGridViewStyles = class(TcxCustomGridStyles) + protected + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + function GetGridView: TcxCustomGridView; override; + public + procedure Assign(Source: TPersistent); override; + published + property Background: TcxStyle index vsBackground read GetValue write SetValue; + end; + + TcxGridListenerLink = class + private + FGridView: TcxCustomGridView; + public + constructor Create(AGridView: TcxCustomGridView); + destructor Destroy; override; + procedure Clear; + property GridView: TcxCustomGridView read FGridView; + end; + + TcxGridStorageOption = (gsoUseFilter, gsoUseSummary); + TcxGridStorageOptions = set of TcxGridStorageOption; + TcxGridViewChangeNotificationKind = (vcnName{, vsRemoved}); + + TcxGridInitStoredObjectEvent = procedure(Sender: TcxCustomGridView; AObject: TObject) of object; + TcxGridViewGetStoredPropertiesEvent = procedure(Sender: TcxCustomGridView; + AProperties: TStrings) of object; + TcxGridViewGetStoredPropertyValueEvent = procedure(Sender: TcxCustomGridView; + const AName: string; var AValue: Variant) of object; + TcxGridViewSetStoredPropertyValueEvent = procedure(Sender: TcxCustomGridView; + const AName: string; const AValue: Variant) of object; + + TcxCustomGridViewClass = class of TcxCustomGridView; + + TcxCustomGridView = class(TcxControlChildComponent, IcxStoredObject, IcxStoredParent, + IcxGridViewLayoutEditorSupport) + private + FAssigningPattern: Boolean; + FAssigningSettings: Boolean; + FBackgroundBitmaps: TcxCustomGridBackgroundBitmaps; + FClones: TList; + FController: TcxCustomGridController; + FIsRestoring: Boolean; + FIsSynchronizing: Boolean; + FLevel: TComponent; + FListenerLinks: TList; + FOptionsList: TList; + FOptionsBehavior: TcxCustomGridOptionsBehavior; + FOptionsData: TcxCustomGridOptionsData; + FOptionsSelection: TcxCustomGridOptionsSelection; + FOptionsView: TcxCustomGridOptionsView; + FPainter: TcxCustomGridPainter; + FPatternGridView: TcxCustomGridView; + FRepository: TComponent; + FStorageControl: TcxControl; + FStorageOptions: TcxGridStorageOptions; + FStoredVersion: Integer; + FStoringName: string; + FStyles: TcxCustomGridStyles; + FSynchronization: Boolean; + FSynchronizationAssignNeeded: Boolean; + FSynchronizationNeeded: Boolean; + FUpdateLockCount: Integer; + FViewData: TcxCustomGridViewData; + FViewInfo: TcxCustomGridViewInfo; + FViewInfoCache: TcxCustomGridViewInfoCache; + FOnCustomization: TNotifyEvent; + FOnGetStoredProperties: TcxGridViewGetStoredPropertiesEvent; + FOnGetStoredPropertyValue: TcxGridViewGetStoredPropertyValueEvent; + FOnInitStoredObject: TcxGridInitStoredObjectEvent; + FOnSetStoredPropertyValue: TcxGridViewSetStoredPropertyValueEvent; + + function GetClone(Index: Integer): TcxCustomGridView; + function GetCloneCount: Integer; + function GetDragMode: TDragMode; + function GetFocused: Boolean; + function GetIsControlFocusedValue: Boolean; + function GetIsDetail: Boolean; + function GetIsMaster: Boolean; + function GetIsPattern: Boolean; + function GetIsStoringNameMode: Boolean; + function GetIsUpdating: Boolean; + function GetLookAndFeel: TcxLookAndFeel; + function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; + function GetMasterGridView: TcxCustomGridView; + function GetMasterGridRecordIndex: Integer; + function GetMasterRecordIndex: Integer; + function GetOnDblClick: TNotifyEvent; + function GetOnDragDrop: TDragDropEvent; + function GetOnDragOver: TDragOverEvent; + function GetOnEndDrag: TEndDragEvent; + function GetOnKeyDown: TKeyEvent; + function GetOnKeyPress: TKeyPressEvent; + function GetOnKeyUp: TKeyEvent; + function GetOnMouseDown: TMouseEvent; + function GetOnMouseEnter: TNotifyEvent; + function GetOnMouseLeave: TNotifyEvent; + function GetOnMouseMove: TMouseMoveEvent; + function GetOnMouseUp: TMouseEvent; + function GetOnMouseWheel: TMouseWheelEvent; + function GetOnMouseWheelDown: TMouseWheelUpDownEvent; + function GetOnMouseWheelUp: TMouseWheelUpDownEvent; + function GetOnStartDrag: TStartDragEvent; + function GetPatternGridView: TcxCustomGridView; + function GetPopupMenu: TComponent; + function GetSite: TcxGridSite; + function GetSynchronization: Boolean; + procedure SetBackgroundBitmaps(Value: TcxCustomGridBackgroundBitmaps); + procedure SetDragMode(Value: TDragMode); + procedure SetFocused(Value: Boolean); + procedure SetIsRestoring(Value: Boolean); + procedure SetSynchronization(Value: Boolean); + procedure SetOnCustomization(Value: TNotifyEvent); + procedure SetOnDblClick(Value: TNotifyEvent); + procedure SetOnDragDrop(Value: TDragDropEvent); + procedure SetOnDragOver(Value: TDragOverEvent); + procedure SetOnEndDrag(Value: TEndDragEvent); + procedure SetOnGetStoredProperties(Value: TcxGridViewGetStoredPropertiesEvent); + procedure SetOnGetStoredPropertyValue(Value: TcxGridViewGetStoredPropertyValueEvent); + procedure SetOnInitStoredObject(Value: TcxGridInitStoredObjectEvent); + procedure SetOnKeyDown(Value: TKeyEvent); + procedure SetOnKeyPress(Value: TKeyPressEvent); + procedure SetOnKeyUp(Value: TKeyEvent); + procedure SetOnMouseDown(Value: TMouseEvent); + procedure SetOnMouseEnter(Value: TNotifyEvent); + procedure SetOnMouseLeave(Value: TNotifyEvent); + procedure SetOnMouseMove(Value: TMouseMoveEvent); + procedure SetOnMouseUp(Value: TMouseEvent); + procedure SetOnMouseWheel(Value: TMouseWheelEvent); + procedure SetOnMouseWheelDown(Value: TMouseWheelUpDownEvent); + procedure SetOnMouseWheelUp(Value: TMouseWheelUpDownEvent); + procedure SetOnSetStoredPropertyValue(Value: TcxGridViewSetStoredPropertyValueEvent); + procedure SetOnStartDrag(Value: TStartDragEvent); + procedure SetOptionsBehavior(Value: TcxCustomGridOptionsBehavior); + procedure SetOptionsData(Value: TcxCustomGridOptionsData); + procedure SetOptionsSelection(Value: TcxCustomGridOptionsSelection); + procedure SetOptionsView(Value: TcxCustomGridOptionsView); + procedure SetPopupMenu(Value: TComponent); + procedure SetStyles(Value: TcxCustomGridStyles); + + procedure ClearListenerLinks; + protected + FDataController: TcxCustomDataController; + FSubClassEvents: TNotifyEvent; + // IcxStoredObject + function GetObjectName: string; virtual; + function GetProperties(AProperties: TStrings): Boolean; virtual; + procedure GetPropertyValue(const AName: string; var AValue: Variant); virtual; + procedure SetPropertyValue(const AName: string; const AValue: Variant); virtual; + // IcxStoredParent + function CreateChild(const AObjectName, AClassName: string): TObject; + function CreateStoredObject(const AObjectName, AClassName: string): TObject; virtual; + procedure DeleteChild(const AObjectName: string; AObject: TObject); virtual; + procedure IcxStoredParent.GetChildren = GetStoredChildren; + procedure GetStoredChildren(AChildren: TStringList); virtual; + // IcxGridViewLayoutEditorSupport - for design-time layout editor + procedure AssignLayout(ALayoutView: TcxCustomGridView); virtual; + procedure BeforeEditLayout(ALayoutView: TcxCustomGridView); virtual; + procedure DoAssignLayout(ALayoutView: TcxCustomGridView); + function GetLayoutCustomizationFormButtonCaption: string; virtual; + function HasLayoutCustomizationForm: Boolean; virtual; + function IsLayoutChangeable: Boolean; virtual; + procedure RunLayoutCustomizationForm; virtual; + + procedure GetFakeComponentLinks(AList: TList); override; + function GetIsDestroying: Boolean; override; + procedure Loaded; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure SetControl(Value: TcxControl); override; + procedure SetName(const NewName: TComponentName); override; + procedure Updated; override; + procedure Updating; override; + + procedure CreateHandlers; virtual; + procedure DestroyHandlers; virtual; + procedure InitDataController; virtual; + + procedure CreateOptions; virtual; + procedure DestroyOptions; virtual; + + procedure AddOptions(AOptions: TcxCustomGridOptions); + procedure RemoveOptions(AOptions: TcxCustomGridOptions); + procedure NotifyOptions(AComponent: TComponent; AOperation: TOperation); + + procedure AddClone(AClone: TcxCustomGridView); + procedure RemoveClone(AClone: TcxCustomGridView); + + function AddListenerLink: TcxGridListenerLink; + procedure RemoveListenerLink(ALink: TcxGridListenerLink); + + procedure Synchronize(ACheckUpdateLock: Boolean = True); overload; + procedure Synchronize(AView: TcxCustomGridView); overload; + property SynchronizationAssignNeeded: Boolean read FSynchronizationAssignNeeded; + property SynchronizationNeeded: Boolean read FSynchronizationNeeded; + + procedure AssignPattern(APattern: TcxCustomGridView); + procedure BeforeAssign(ASource: TcxCustomGridView); virtual; + procedure DoAssign(ASource: TcxCustomGridView); virtual; + procedure DoAssignSettings(ASource: TcxCustomGridView); virtual; + procedure AfterAssign(ASource: TcxCustomGridView); virtual; + property AssigningPattern: Boolean read FAssigningPattern; + property AssigningSettings: Boolean read FAssigningSettings; + + procedure BeforeRestoring; virtual; + procedure AfterRestoring; virtual; + property IsRestoring: Boolean read FIsRestoring write SetIsRestoring; + + //procedure BeforeLevelChange; virtual; + function CanFocus: Boolean; virtual; + function CanTabStop: Boolean; virtual; + procedure DetailDataChanged(ADetail: TcxCustomGridView); virtual; + procedure DetailVisibleChanged(ADetailLevel: TComponent; + APrevVisibleDetailCount, AVisibleDetailCount: Integer); virtual; + procedure DoChanged(AChangeKind: TcxGridViewChangeKind); virtual; + function GetChangeable: Boolean; virtual; + function GetCustomVisible(ALevelVisible: Boolean): Boolean; virtual; + function GetIsControlFocused: Boolean; virtual; + function GetResizeOnBoundsChange: Boolean; virtual; + function GetVisible: Boolean; virtual; + procedure Init; virtual; + function IsDetailVisible(AGridView: TcxCustomGridView): Boolean; virtual; + procedure FocusChanged(AFocused: Boolean); virtual; + procedure LoadingComplete; virtual; + procedure LookAndFeelChanged; virtual; + procedure NotifyControl(AChangeKind: TcxGridViewChangeNotificationKind); + procedure RestoringComplete; virtual; + procedure SetLevel(Value: TComponent); virtual; + procedure SetTabStop(Value: Boolean); virtual; + procedure UpdateControl(AInfo: TcxUpdateControlInfo); virtual; + + function GetControllerClass: TcxCustomGridControllerClass; virtual; abstract; + function GetDataControllerClass: TcxCustomDataControllerClass; virtual; abstract; + function GetPainterClass: TcxCustomGridPainterClass; virtual; abstract; + function GetViewDataClass: TcxCustomGridViewDataClass; virtual; abstract; + function GetViewInfoCacheClass: TcxCustomGridViewInfoCacheClass; virtual; + function GetViewInfoClass: TcxCustomGridViewInfoClass; virtual; abstract; + + function GetBackgroundBitmapsClass: TcxCustomGridBackgroundBitmapsClass; virtual; + function GetOptionsBehaviorClass: TcxCustomGridOptionsBehaviorClass; virtual; + function GetOptionsDataClass: TcxCustomGridOptionsDataClass; virtual; + function GetOptionsSelectionClass: TcxCustomGridOptionsSelectionClass; virtual; + function GetOptionsViewClass: TcxCustomGridOptionsViewClass; virtual; + function GetStylesClass: TcxCustomGridViewStylesClass; virtual; + + procedure Initialize; override; + + procedure RefreshCustomizationForm; + + procedure DoCustomization; virtual; + procedure DoInitStoredObject(AObject: TObject); virtual; + + property BackgroundBitmaps: TcxCustomGridBackgroundBitmaps read FBackgroundBitmaps + write SetBackgroundBitmaps; {4} + property Changeable: Boolean read GetChangeable; + property IsStoringNameMode: Boolean read GetIsStoringNameMode; + property IsSynchronizing: Boolean read FIsSynchronizing; + property IsUpdating: Boolean read GetIsUpdating; + property OptionsBehavior: TcxCustomGridOptionsBehavior read FOptionsBehavior + write SetOptionsBehavior; + property OptionsData: TcxCustomGridOptionsData read FOptionsData write SetOptionsData; + property OptionsSelection: TcxCustomGridOptionsSelection read FOptionsSelection + write SetOptionsSelection; + property OptionsView: TcxCustomGridOptionsView read FOptionsView write SetOptionsView; + property ResizeOnBoundsChange: Boolean read GetResizeOnBoundsChange; + property StoredVersion: Integer read FStoredVersion; + property Styles: TcxCustomGridStyles read FStyles write SetStyles; + property OnCustomization: TNotifyEvent read FOnCustomization write SetOnCustomization; + property OnInitStoredObject: TcxGridInitStoredObjectEvent read FOnInitStoredObject write SetOnInitStoredObject; + public + constructor CreateCloned(AControl: TcxControl); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure AssignSettings(ASource: TcxCustomGridView); + function GetParentComponent: TComponent; override; + function HasParent: Boolean; override; + function HasAsClone(AGridView: TcxCustomGridView): Boolean; + function HasAsMaster(AGridView: TcxCustomGridView): Boolean; + procedure Invalidate(AHardUpdate: Boolean = False); + procedure RestoreDefaults; virtual; + procedure SetParentComponent(Value: TComponent); override; + + procedure CheckSynchronizationAssignNeeded; + function IsSynchronization: Boolean; + + procedure BeginUpdate; + procedure CancelUpdate; + function Changed(AGridChange: TObject): Boolean; overload; {$IFDEF BCB}virtual;{$ENDIF} + procedure EndUpdate; + function IsUpdateLocked: Boolean; + + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; overload; {$IFDEF BCB}virtual;{$ENDIF} + function GetHitTest(X, Y: Integer): TcxCustomGridHitTest; overload; {$IFDEF BCB}virtual;{$ENDIF} + + procedure BoundsChanged(AUpdateSelfOnly: Boolean = False; AKeepMaster: Boolean = False); virtual; + procedure Changed(AChangeKind: TcxGridViewChangeKind); overload; {$IFDEF BCB}virtual;{$ENDIF} + procedure LayoutChanged(AUpdateSelfOnly: Boolean = True); + function SizeChanged(AUpdateSelfOnly: Boolean = False; AKeepMaster: Boolean = False): Boolean; + procedure ViewChanged; overload; {$IFDEF BCB}virtual;{$ENDIF} + procedure ViewChanged(const AUpdateRect: TRect); overload; {$IFDEF BCB}virtual;{$ENDIF} + procedure ViewChanged(ARegion: TcxRegion); overload; {$IFDEF BCB}virtual;{$ENDIF} + + procedure RestoreFromIniFile(const AStorageName: string; AChildrenCreating: Boolean = True{False}; + AChildrenDeleting: Boolean = False; AOptions: TcxGridStorageOptions = [gsoUseFilter, gsoUseSummary]{[]}; + const ARestoreViewName: string = ''); + procedure RestoreFromRegistry(const AStorageName: string; AChildrenCreating: Boolean = True{False}; + AChildrenDeleting: Boolean = False; AOptions: TcxGridStorageOptions = [gsoUseFilter, gsoUseSummary]{[]}; + const ARestoreViewName: string = ''); + procedure RestoreFromStream(AStream: TStream; AChildrenCreating: Boolean = True{False}; + AChildrenDeleting: Boolean = False; AOptions: TcxGridStorageOptions = [gsoUseFilter, gsoUseSummary]{[]}; + const ARestoreViewName: string = ''); + procedure RestoreFromStorage(const AStorageName: string; AReaderClass: TcxCustomReaderClass; + AChildrenCreating: Boolean = True; AChildrenDeleting: Boolean = False; + AOptions: TcxGridStorageOptions = [gsoUseFilter, gsoUseSummary]; + const ARestoreViewName: string = ''); + + procedure StoreToIniFile(const AStorageName: string; AReCreate: Boolean = True; + AOptions: TcxGridStorageOptions = []; const ASaveViewName: string = ''); + procedure StoreToRegistry(const AStorageName: string; AReCreate: Boolean = True; + AOptions: TcxGridStorageOptions = []; const ASaveViewName: string = ''); + procedure StoreToStream(AStream: TStream; AOptions: TcxGridStorageOptions = []; + const ASaveViewName: string = ''); + procedure StoreToStorage(const AStorageName: string; AWriterClass: TcxCustomWriterClass; + AReCreate: Boolean = True; AOptions: TcxGridStorageOptions = []; const ASaveViewName: string = ''); + + function CreateViewInfo: TcxCustomGridViewInfo; + + property Focused: Boolean read GetFocused write SetFocused; + property StorageOptions: TcxGridStorageOptions read FStorageOptions write FStorageOptions; + property StoringName: string read FStoringName write FStoringName; + property TabStop: Boolean write SetTabStop; + + property CloneCount: Integer read GetCloneCount; + property Clones[Index: Integer]: TcxCustomGridView read GetClone; + property IsControlFocused: Boolean read GetIsControlFocusedValue; + property IsDetail: Boolean read GetIsDetail; + property IsMaster: Boolean read GetIsMaster; + property IsPattern: Boolean read GetIsPattern; + property Level: TComponent read FLevel; // TcxGridLevel + property MasterGridView: TcxCustomGridView read GetMasterGridView; + property MasterGridRecordIndex: Integer read GetMasterGridRecordIndex; + property MasterRecordIndex: Integer read GetMasterRecordIndex; + property PatternGridView: TcxCustomGridView read GetPatternGridView; + property Repository: TComponent read FRepository write FRepository; {5} + + property Controller: TcxCustomGridController read FController; + property DataController: TcxCustomDataController read FDataController; + property LookAndFeel: TcxLookAndFeel read GetLookAndFeel; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter; + property Painter: TcxCustomGridPainter read FPainter; + property Site: TcxGridSite read GetSite; + property StorageControl: TcxControl read FStorageControl; + property ViewData: TcxCustomGridViewData read FViewData; + property ViewInfo: TcxCustomGridViewInfo read FViewInfo; + property ViewInfoCache: TcxCustomGridViewInfoCache read FViewInfoCache; + property Visible: Boolean read GetVisible; + published + property DataControllerEvents: TNotifyEvent read FSubClassEvents write FSubClassEvents; + property DragMode: TDragMode read GetDragMode write SetDragMode default dmManual; + property PopupMenu: TComponent read GetPopupMenu write SetPopupMenu; + property StylesEvents: TNotifyEvent read FSubClassEvents write FSubClassEvents; + property Synchronization: Boolean read GetSynchronization write SetSynchronization default True{False}; + + property OnDblClick: TNotifyEvent read GetOnDblClick write SetOnDblClick; + property OnDragDrop: TDragDropEvent read GetOnDragDrop write SetOnDragDrop; + property OnDragOver: TDragOverEvent read GetOnDragOver write SetOnDragOver; + property OnEndDrag: TEndDragEvent read GetOnEndDrag write SetOnEndDrag; + property OnKeyDown: TKeyEvent read GetOnKeyDown write SetOnKeyDown; + property OnKeyPress: TKeyPressEvent read GetOnKeyPress write SetOnKeyPress; + property OnKeyUp: TKeyEvent read GetOnKeyUp write SetOnKeyUp; + property OnMouseDown: TMouseEvent read GetOnMouseDown write SetOnMouseDown; + property OnMouseEnter: TNotifyEvent read GetOnMouseEnter write SetOnMouseEnter; + property OnMouseLeave: TNotifyEvent read GetOnMouseLeave write SetOnMouseLeave; + property OnMouseMove: TMouseMoveEvent read GetOnMouseMove write SetOnMouseMove; + property OnMouseUp: TMouseEvent read GetOnMouseUp write SetOnMouseUp; + property OnMouseWheel: TMouseWheelEvent read GetOnMouseWheel write SetOnMouseWheel; + property OnMouseWheelDown: TMouseWheelUpDownEvent read GetOnMouseWheelDown write SetOnMouseWheelDown; + property OnMouseWheelUp: TMouseWheelUpDownEvent read GetOnMouseWheelUp write SetOnMouseWheelUp; + property OnStartDrag: TStartDragEvent read GetOnStartDrag write SetOnStartDrag; + + property OnGetStoredProperties: TcxGridViewGetStoredPropertiesEvent + read FOnGetStoredProperties write SetOnGetStoredProperties; + property OnGetStoredPropertyValue: TcxGridViewGetStoredPropertyValueEvent + read FOnGetStoredPropertyValue write SetOnGetStoredPropertyValue; + property OnSetStoredPropertyValue: TcxGridViewSetStoredPropertyValueEvent + read FOnSetStoredPropertyValue write SetOnSetStoredPropertyValue; + end; + + { TcxCustomGridViewAccess } + + TcxCustomGridViewAccess = class + class procedure AddClone(AInstance: TcxCustomGridView; AClone: TcxCustomGridView); + class procedure AssignPattern(AInstance: TcxCustomGridView; APattern: TcxCustomGridView); + class function CanFocus(AInstance: TcxCustomGridView): Boolean; + class procedure DetailVisibleChanged(AInstance: TcxCustomGridView; + ADetailLevel: TComponent; APrevVisibleDetailCount, AVisibleDetailCount: Integer); + class procedure FocusChanged(AInstance: TcxCustomGridView; AFocused: Boolean); + class procedure LookAndFeelChanged(AInstance: TcxCustomGridView); + class procedure SetLevel(AInstance: TcxCustomGridView; Value: TComponent); + + class function GetChangeable(AInstance: TcxCustomGridView): Boolean; + class function GetStyles(AInstance: TcxCustomGridView): TcxCustomGridStyles; + end; + +function GetGridViewDataController(AView: TcxCustomGridView): TcxCustomDataController; +function GetParentGridView(AControl: TControl): TcxCustomGridView; + +var + cxGridRegisteredViews: TcxRegisteredClasses; + +implementation + +uses + SysUtils, Math, ImgList, cxGeometry, cxScrollBar, cxVariants, cxLibraryConsts, + cxGrid, cxGridLevel, cxGridStrs; + +const + CheckOffset = 2; + + DesignSelectorWidth = 20; + DesignSelectorHeight = 20; + +type + TCustomFormAccess = class(TCustomForm); + TcxControlAccess = class(TcxControl); + TcxCustomGridAccess = class(TcxCustomGrid); + TcxGridViewRepositoryAccess = class(TcxGridViewRepository); + +{ TGridHitTests } + +type + TGridHitTests = class + private + FItems: TList; + function GetCount: Integer; + function GetInstance(AClass: TcxCustomGridHitTestClass): TcxCustomGridHitTest; + function GetItem(Index: Integer): TcxCustomGridHitTest; + protected + function GetObjectByClass(AClass: TcxCustomGridHitTestClass): TcxCustomGridHitTest; + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxCustomGridHitTest read GetItem; + public + constructor Create; + destructor Destroy; override; + property Instances[AClass: TcxCustomGridHitTestClass]: TcxCustomGridHitTest read GetInstance; default; + end; + +var + GridHitTests: TGridHitTests; + +constructor TGridHitTests.Create; +begin + inherited; + FItems := TList.Create; +end; + +destructor TGridHitTests.Destroy; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].Free; + FItems.Free; + inherited; +end; + +function TGridHitTests.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TGridHitTests.GetInstance(AClass: TcxCustomGridHitTestClass): TcxCustomGridHitTest; +begin + Result := GetObjectByClass(AClass); + if Result = nil then + begin + Result := AClass.Create; + FItems.Add(Result); + end; +end; + +function TGridHitTests.GetItem(Index: Integer): TcxCustomGridHitTest; +begin + Result := TcxCustomGridHitTest(FItems[Index]); +end; + +function TGridHitTests.GetObjectByClass(AClass: TcxCustomGridHitTestClass): TcxCustomGridHitTest; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I]; + if Result.ClassType = AClass then Exit; + end; + Result := nil; +end; + +{ TcxCustomGridViewChange } + +constructor TcxCustomGridViewChange.Create(AGridView: TcxCustomGridView); +begin + inherited Create; + FGridView := AGridView; +end; + +function TcxCustomGridViewChange.IsEqual(AChange: TcxCustomGridChange): Boolean; +begin + Result := inherited IsEqual(AChange) and + (FGridView = TcxCustomGridViewChange(AChange).GridView); +end; + +{ TcxGridControlFocusChange } + +procedure TcxGridControlFocusChange.Execute; +begin + if GridView.Changeable then + GridView.Controller.ControlFocusChanged; +end; + +{ TcxCustomGridHitTest } + +destructor TcxCustomGridHitTest.Destroy; +begin + ViewInfo := nil; + inherited; +end; + +procedure TcxCustomGridHitTest.SetViewInfo(Value: TcxCustomGridCellViewInfo); +var + APrevViewInfo: TcxCustomGridCellViewInfo; +begin + if FViewInfo <> Value then + begin + APrevViewInfo := FViewInfo; + FViewInfo := Value; + if (APrevViewInfo <> nil) and (APrevViewInfo.LinkedHitTest = Self) then + APrevViewInfo.LinkedHitTest := nil; + if FViewInfo <> nil then + FViewInfo.LinkedHitTest := Self; + end; +end; + +class function TcxCustomGridHitTest.GetHitTestCode: Integer; +begin + Result := htError; +end; + +procedure TcxCustomGridHitTest.Init(const APos: TPoint); +begin + FPos := APos; +end; + +function TcxCustomGridHitTest.Cursor: TCursor; +begin + Result := crDefault; +end; + +function TcxCustomGridHitTest.DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; +begin + Result := nil; +end; + +class function TcxCustomGridHitTest.HitTestCode: Integer; +begin + Result := GetHitTestCode; +end; + +class function TcxCustomGridHitTest.Instance(const APos: TPoint): TcxCustomGridHitTest; +begin + Result := GridHitTests.Instances[Self]; + Result.Init(APos); +end; + +{ TcxGridHitTestNone } + +class function TcxGridNoneHitTest.GetHitTestCode: Integer; +begin + Result := htNone; +end; + +{ TcxGridViewNoneHitTest } + +class function TcxGridViewNoneHitTest.GetHitTestCode: Integer; +begin + Result := htNone; +end; + +{ TcxGridNavigatorHitTest } + +class function TcxGridNavigatorHitTest.GetHitTestCode: Integer; +begin + Result := htNavigator; +end; + +{ TcxGridCustomizationFormHitTest } + +class function TcxGridCustomizationFormHitTest.GetHitTestCode: Integer; +begin + Result := htCustomizationForm; +end; + +{ TcxGridDesignSelectorHitTest } + +class function TcxGridDesignSelectorHitTest.GetHitTestCode: Integer; +begin + Result := htDesignSelector; +end; + +function TcxGridDesignSelectorHitTest.Cursor: TCursor; +begin + Result := crcxHandPoint; +end; + +{ TcxGridViewHandler } + +constructor TcxGridViewHandler.Create(AGridView: TcxCustomGridView); +begin + inherited Create(nil); + FGridView := AGridView; +end; + +function TcxGridViewHandler.GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := FGridView.LookAndFeelPainter; +end; + +function TcxGridViewHandler.GetControl: TcxControl; +begin + Result := FGridView.Control; +end; + +function TcxGridViewHandler.GetController: TcxCustomGridController; +begin + Result := FGridView.Controller; +end; + +function TcxGridViewHandler.GetDataController: TcxCustomDataController; +begin + Result := FGridView.DataController; +end; + +function TcxGridViewHandler.GetPainter: TcxCustomGridPainter; +begin + Result := FGridView.Painter; +end; + +function TcxGridViewHandler.GetSite: TcxGridSite; +begin + Result := FGridView.Site; +end; + +function TcxGridViewHandler.GetViewData: TcxCustomGridViewData; +begin + Result := FGridView.ViewData; +end; + +function TcxGridViewHandler.GetViewInfo: TcxCustomGridViewInfo; +begin + Result := FGridView.ViewInfo; +end; + +procedure TcxGridViewHandler.BeginUpdate; +begin + FGridView.BeginUpdate; +end; + +procedure TcxGridViewHandler.EndUpdate; +begin + FGridView.EndUpdate; +end; + +{ TcxCustomGridDragAndDropObject } + +function TcxCustomGridDragAndDropObject.GetController: TcxCustomGridController; +begin + Result := GridView.Controller; +end; + +function TcxCustomGridDragAndDropObject.GetGridView: TcxCustomGridView; +begin + Result := TcxGridSite(Control).GridView; +end; + +function TcxCustomGridDragAndDropObject.GetViewInfo: TcxCustomGridViewInfo; +begin + Result := GridView.ViewInfo; +end; + +procedure TcxCustomGridDragAndDropObject.AfterDragAndDrop(Accepted: Boolean); +begin + inherited; + if Accepted then Controller.DesignerModified; +end; + +procedure TcxCustomGridDragAndDropObject.AfterPaint; +begin + AfterViewChange; +end; + +procedure TcxCustomGridDragAndDropObject.BeforePaint; +begin + BeforeViewChange; +end; + +procedure TcxCustomGridDragAndDropObject.AfterScrolling; +begin +end; + +procedure TcxCustomGridDragAndDropObject.BeforeScrolling; +begin +end; + +procedure TcxCustomGridDragAndDropObject.AfterViewChange; +begin +end; + +procedure TcxCustomGridDragAndDropObject.BeforeViewChange; +begin +end; + +procedure TcxCustomGridDragAndDropObject.Init(const P: TPoint; AParams: TcxCustomGridHitTest); +begin + SourcePoint := P; +end; + +{ TcxCustomGridMovingObject } + +function TcxCustomGridMovingObject.GetArrowPlace(AArrowNumber: TcxGridArrowNumber): TcxGridArrowPlace; +begin + if AreArrowsVertical then + if AArrowNumber = anFirst then + Result := apTop + else + Result := apBottom + else + if AArrowNumber = anFirst then + Result := apLeft + else + Result := apRight; +end; + +function TcxCustomGridMovingObject.GetCustomizationForm: TcxCustomGridCustomizationForm; +begin + Result := Controller.CustomizationForm; +end; + +procedure TcxCustomGridMovingObject.DirtyChanged; +begin + inherited; + ChangeArrowsPosition(not Dirty); + ChangeDragImagePosition(not Dirty); +end; + +function TcxCustomGridMovingObject.GetDragAndDropCursor(Accepted: Boolean): TCursor; +begin + if Accepted then + Result := crArrow + else + if CanRemove then + Result := crcxGridRemove + else + Result := crcxGridNoDrop; +end; + +procedure TcxCustomGridMovingObject.ChangeArrowsPosition(AVisible: Boolean = True); +var + AArrowNumber: TcxGridArrowNumber; +begin + if AVisible and not IsValidDestination then + AVisible := False; + for AArrowNumber := Low(Arrows) to High(Arrows) do + begin + if AVisible then + Arrows[AArrowNumber].Init(GridView.Site, GetArrowAreaBounds(ArrowPlaces[AArrowNumber]), + ArrowsClientRect, ArrowPlaces[AArrowNumber]); + Arrows[AArrowNumber].Visible := AVisible; + end; +end; + +procedure TcxCustomGridMovingObject.ChangeDragImagePosition(AVisible: Boolean = True); +begin + if AVisible then + DragImage.MoveTo(Control.ClientToScreen(CurMousePos)); + DragImage.Visible := AVisible; +end; + +function TcxCustomGridMovingObject.AreArrowsVertical: Boolean; +begin + Result := True; +end; + +function TcxCustomGridMovingObject.GetArrowClass: TcxDragAndDropArrowClass; +begin + Result := TcxDragAndDropArrow; +end; + +function TcxCustomGridMovingObject.GetArrowsClientRect: TRect; +begin + Result := ViewInfo.Bounds; +end; + +function TcxCustomGridMovingObject.GetDragImageClass: TcxDragImageClass; +begin + Result := TcxDragImage; +end; + +function TcxCustomGridMovingObject.GetSourceItemBounds: TRect; +begin + if SourceItemViewInfo <> nil then + Result := SourceItemViewInfo.Bounds + else + if IsSourceCustomizationForm and (CustomizationFormListBox <> nil) then + with CustomizationFormListBox do + begin + Result := ItemRect(IndexOfItem(SourceItem)); + MapWindowRect(Handle, Control.Handle, Result); + end + else + Result := Rect(0, 0, 0, 0); +end; + +function TcxCustomGridMovingObject.GetSourceItemViewInfo: TcxCustomGridCellViewInfo; +begin + Result := nil; +end; + +procedure TcxCustomGridMovingObject.InitDragImage; + + procedure InitUsingSourceItemViewInfo; + var + AViewInfo: TcxCustomGridCellViewInfo; + begin + AViewInfo := SourceItemViewInfo; + with AViewInfo.Bounds.TopLeft do + SetViewportOrgEx(DragImage.Canvas.Handle, -X, -Y, nil); + AViewInfo.Paint(DragImage.Canvas); + end; + + procedure InitFromCustomizationForm; + var + R: TRect; + begin + R := SourceItemBounds; + with R do + OffsetRect(R, -Left, -Top); + InitDragImageUsingCustomizationForm(DragImage.Canvas, R, SourceItem); + end; + +begin + DragImage.Init(SourceItemBounds, SourcePoint); + if SourceItemViewInfo <> nil then + InitUsingSourceItemViewInfo + else + if IsSourceCustomizationForm then + InitFromCustomizationForm; +end; + +procedure TcxCustomGridMovingObject.InitDragImageUsingCustomizationForm(ACanvas: TcxCanvas; + const R: TRect; AItem: TObject); +begin + if CustomizationFormListBox <> nil then + CustomizationFormListBox.PaintDragAndDropItem(ACanvas, R, AItem); +end; + +procedure TcxCustomGridMovingObject.BeginDragAndDrop; +var + AArrowNumber: TcxGridArrowNumber; +begin + FDragImage := GetDragImageClass.Create; + InitDragImage; + for AArrowNumber := Low(Arrows) to High(Arrows) do + Arrows[AArrowNumber] := GetArrowClass.Create(DragImage.AlphaBlended); + GridView.Control.UpdateWithChildren; + inherited; +end; + +procedure TcxCustomGridMovingObject.DragAndDrop(const P: TPoint; var Accepted: Boolean); +begin + inherited; + ChangeDragImagePosition; +end; + +procedure TcxCustomGridMovingObject.EndDragAndDrop(Accepted: Boolean); +var + AArrowNumber: TcxGridArrowNumber; +begin + inherited; + for AArrowNumber := Low(Arrows) to High(Arrows) do + FreeAndNil(Arrows[AArrowNumber]); + FreeAndNil(FDragImage); +end; + +procedure TcxCustomGridMovingObject.AfterScrolling; +begin + ChangeArrowsPosition; + inherited; +end; + +{ TcxCustomGridItemsInnerListBox } + +constructor TcxCustomGridItemsInnerListBox.Create(AOwner: TComponent); +begin + inherited; + Sorted := True; + Style := lbOwnerDrawFixed; + CalculateBorderStyle; + FDragAndDropItemIndex := -1; +end; + +function TcxCustomGridItemsInnerListBox.GetContainer: TcxCustomGridItemsListBox; +begin + Result := TcxCustomGridItemsListBox(inherited Container); +end; + +function TcxCustomGridItemsInnerListBox.GetDragAndDropItem: TObject; +begin + Result := Items.Objects[FDragAndDropItemIndex]; +end; + +function TcxCustomGridItemsInnerListBox.GetGridView: TcxCustomGridView; +begin + Result := Container.GridView; +end; + +function TcxCustomGridItemsInnerListBox.GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := LookAndFeel.Painter; +end; + +procedure TcxCustomGridItemsInnerListBox.WMCancelMode(var Message: TWMCancelMode); +begin + inherited; + FDragAndDropItemIndex := -1; +end; + +procedure TcxCustomGridItemsInnerListBox.WMNCCalcSize(var Message: TWMNCCalcSize); +begin + inherited; + if BorderStyle = bsNone then + InflateRect(Message.CalcSize_Params^.rgrc[0], -1, -1); +end; + +procedure TcxCustomGridItemsInnerListBox.WMNCPaint(var Message: TWMNCPaint); +var + R: TRect; + DC: HDC; +begin + inherited; + if BorderStyle = bsNone then + begin + GetWindowRect(Handle, R); + OffsetRect(R, -R.Left, -R.Top); + DC := GetWindowDC(Handle); + DrawEdge(DC, R, BDR_SUNKENOUTER, BF_RECT); + ReleaseDC(Handle, DC); + end; +end; + +procedure TcxCustomGridItemsInnerListBox.CreateParams(var Params: TCreateParams); +begin + inherited; + with Params do + WindowClass.Style := WindowClass.Style or CS_HREDRAW; +end; + +procedure TcxCustomGridItemsInnerListBox.CreateWnd; +begin + inherited; + CalculateItemHeight; +end; + +procedure TcxCustomGridItemsInnerListBox.DrawItem(Index: Integer; Rect: TRect; + State: TOwnerDrawState); +begin + Container.PaintItem(Canvas, Rect, Index, odFocused in State); + if odFocused in State then Canvas.DrawFocusRect(Rect); +end; + +procedure TcxCustomGridItemsInnerListBox.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited; + if Key = VK_ESCAPE then + GridView.Site.FinishDragAndDrop(False); +end; + +procedure TcxCustomGridItemsInnerListBox.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + CalculateBorderStyle; + CalculateItemHeight; + inherited; +end; + +procedure TcxCustomGridItemsInnerListBox.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +var + AItemIndex: Integer; +begin + inherited; + if Button = mbLeft then + begin + AItemIndex := ItemAtPos(Point(X, Y), True); + if AItemIndex <> -1 then + begin + FDragAndDropItemIndex := AItemIndex; + FMouseDownPos := Point(X, Y); + end; + end; +end; + +procedure TcxCustomGridItemsInnerListBox.MouseMove(Shift: TShiftState; X, Y: Integer); +var + AParams: TcxCustomGridHitTest; + P: TPoint; +begin + inherited; + if (FDragAndDropItemIndex <> -1) and + (not IsPointInDragDetectArea(FMouseDownPos, X, Y) or + (ItemAtPos(Point(X, Y), False) <> FDragAndDropItemIndex)) then + begin + ItemIndex := FDragAndDropItemIndex; + AParams := Container.GetDragAndDropParams; + with GridView do + begin + P := FMouseDownPos; + P := Site.ScreenToClient(ClientToScreen(P)); + Controller.DragAndDropObjectClass := AParams.DragAndDropObjectClass; + Controller.DragAndDropObject.Init(P, AParams); + Site.BeginDragAndDrop; + end; + FDragAndDropItemIndex := -1; + end; +end; + +procedure TcxCustomGridItemsInnerListBox.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + inherited; + FDragAndDropItemIndex := -1; +end; + +procedure TcxCustomGridItemsInnerListBox.CalculateBorderStyle; +begin + if LookAndFeelPainter.HeaderBorderSize <= 1 then + BorderStyle := bsNone + else + BorderStyle := bsSingle; +end; + +procedure TcxCustomGridItemsInnerListBox.CalculateItemHeight; +begin + if HandleAllocated then + ItemHeight := Container.CalculateItemHeight; +end; + +{ TcxCustomGridItemsListBox } + +constructor TcxCustomGridItemsListBox.Create(AOwner: TComponent); +begin + inherited; + with Style do + begin + BorderStyle := cbsNone; + HotTrack := False; + LookAndFeel.MasterLookAndFeel := GridView.LookAndFeel; + TransparentBorder := False; + end; + StyleFocused.BorderStyle := cbsNone; + StyleHot.BorderStyle := cbsNone; + ParentFont := True; +end; + +function TcxCustomGridItemsListBox.GetDragAndDropItem: TObject; +begin + Result := InnerListBox.DragAndDropItem; +end; + +function TcxCustomGridItemsListBox.GetGridView: TcxCustomGridView; +begin + Result := (Owner as TcxCustomGridCustomizationForm).GridView; +end; + +function TcxCustomGridItemsListBox.GetInnerListBox: TcxCustomGridItemsInnerListBox; +begin + Result := TcxCustomGridItemsInnerListBox(inherited InnerListBox); +end; + +function TcxCustomGridItemsListBox.GetInnerListBoxClass: TcxInnerListBoxClass; +begin + Result := TcxCustomGridItemsInnerListBox; +end; + +function TcxCustomGridItemsListBox.IndexOfItem(AItem: TObject): Integer; +begin + Result := Items.IndexOfObject(AItem); +end; + +procedure TcxCustomGridItemsListBox.PaintDragAndDropItem(ACanvas: TcxCanvas; + const R: TRect; AItem: TObject); +begin + ACanvas.Brush.Color := Color; + ACanvas.Font := Font; + PaintItem(ACanvas, R, IndexOfItem(AItem), False); +end; + +procedure TcxCustomGridItemsListBox.RefreshItems; +begin + InnerListBox.CalculateItemHeight; +end; + +{ TcxCustomGridCustomizationForm } + +// TODO: system menu + +constructor TcxCustomGridCustomizationForm.Create(AController: TcxCustomGridController); +begin + inherited CreateNew(nil); + FController := AController; + Caption := cxGetResourceString(@scxGridCustomizationFormCaption); + BorderStyle := bsSizeToolWin; + Font := TcxControlAccess(Controller.Control).Font; + CalculateConsts; + CreateControls; +end; + +destructor TcxCustomGridCustomizationForm.Destroy; +begin + FHookTimer.Free; + FController.Customization := False; + inherited; +end; + +function TcxCustomGridCustomizationForm.GetGridView: TcxCustomGridView; +begin + Result := FController.GridView; +end; + +function TcxCustomGridCustomizationForm.GetViewInfo: TcxCustomGridViewInfo; +begin + Result := FController.ViewInfo; +end; + +procedure TcxCustomGridCustomizationForm.HookTimerHandler(Sender: TObject); +begin + if IsIconic(Application.Handle) then + Visible := False + else + if not GridView.Visible or not IsWindowVisible(FController.Site.Handle) then + FController.Customization := False + else + if not Visible then + begin + ShowWindow(Handle, SW_SHOWNOACTIVATE); + Visible := True; + end; +end; + +procedure TcxCustomGridCustomizationForm.CreateParams(var Params: TCreateParams); +begin + inherited; + with Params do + begin + Style := Style or WS_POPUP; + WndParent := FController.Site.Handle; + end; +end; + +procedure TcxCustomGridCustomizationForm.DoClose(var Action: TCloseAction); +begin + FreeAndNil(FHookTimer); + Action := caFree; +end; + +procedure TcxCustomGridCustomizationForm.DoShow; +begin + if FHookTimer = nil then + begin + FHookTimer := TcxTimer.Create(nil); + with FHookTimer do + begin + Interval := 100; + OnTimer := HookTimerHandler; + end; + end; + inherited; +end; + +procedure TcxCustomGridCustomizationForm.CalculateConsts; +begin + FOffset := Canvas.TextHeight('Qq') div 6; +end; + +procedure TcxCustomGridCustomizationForm.CreateControls; +begin + FPageControl := TcxPageControl.Create(Self); + with FPageControl do + begin + Anchors := [akTop, akLeft, akRight, akBottom]; + BoundsRect := GetPageControlBounds; + Focusable := False; + HotTrack := True; + LookAndFeel.MasterLookAndFeel := GridView.LookAndFeel; + Parent := Self; + InitPageControl; + end; +end; + +function TcxCustomGridCustomizationForm.CreatePage(const ACaption: string; + AVisible: Boolean): TcxTabSheet; +begin + Result := TcxTabSheet.Create(FPageControl); + with Result do + begin + Caption := ACaption; + TabVisible := AVisible; + PageControl := FPageControl; + end; +end; + +procedure TcxCustomGridCustomizationForm.GridViewChanged; +begin +end; + +function TcxCustomGridCustomizationForm.GetContentBounds: TRect; +begin + Result := ClientRect; + InflateRect(Result, -Offset, -Offset); +end; + +function TcxCustomGridCustomizationForm.GetPageControlBounds: TRect; +begin + Result := ContentBounds; +end; + +procedure TcxCustomGridCustomizationForm.InitPageControl; +begin +end; + +procedure TcxCustomGridCustomizationForm.ActivatePage(APage: TcxTabSheet); +begin + if APage.TabVisible then + FPageControl.ActivePage := APage; +end; + +procedure TcxCustomGridCustomizationForm.RefreshData; +begin +end; + +{ TcxCustomGridPopup } + +constructor TcxCustomGridPopup.Create(AGridView: TcxCustomGridView); +begin + inherited Create(AGridView.Site); + FGridView := AGridView; + Color := clWindow; + IsTopMost := True; + OwnerParent := FGridView.Site; +end; + +procedure TcxCustomGridPopup.SetOwner(Value: IcxCustomGridPopupOwner); +begin + if FOwner <> Value then + begin + if (Value = nil) and Visible and FOwner.ClosePopupWhenNilOwner then + CloseUp; + FOwner := Value; + end; +end; + +function TcxCustomGridPopup.CalculateOwnerBounds: TRect; +begin + Result := FOwner.GetOwnerBounds; +end; + +function TcxCustomGridPopup.GetClientMinWidth: Integer; +begin + with Owner.GetOwnerBounds do + Result := Right - Left - NCWidth; +end; + +procedure TcxCustomGridPopup.InitPopup; +begin + inherited; + BorderStyle := GridView.LookAndFeelPainter.PopupBorderStyle; + Font := TcxControlAccess(FGridView.Control).Font; + OwnerBounds := CalculateOwnerBounds; +end; + +procedure TcxCustomGridPopup.Paint; +begin + DrawFrame; + Canvas.Brush.Color := Color; + Canvas.FillRect(ClientBounds); +end; + +procedure TcxCustomGridPopup.VisibleChanged; +begin + inherited; + if not Visible and (FOwner <> nil) then + begin + FOwner.PopupClosed; + end; +end; + +procedure TcxCustomGridPopup.CloseUp; +begin + inherited; + //TcxControlAccess(FGridView.Site).FocusChanged; +end; + +procedure TcxCustomGridPopup.Popup; +begin + SetCaptureControl(nil); + inherited Popup(FindNextControl(nil, True, True, False)); +end; + +{ TcxGridPopupListBox } + +constructor TcxGridPopupListBox.Create(APopup: TcxCustomGridPopup); +begin + inherited Create(APopup); + FItemTextOffsetLeft := cxGridCellTextOffset; + FItemTextOffsetRight := cxGridCellTextOffset; + FCheckedIndexes := TList.Create; + FPopup := APopup; + FPressedItemIndex := -1; + Init; + Parent := FPopup; +end; + +destructor TcxGridPopupListBox.Destroy; +begin + FCheckedIndexes.Free; + inherited; +end; + +function TcxGridPopupListBox.GetChecked(Index: Integer): Boolean; +begin + Result := FCheckedIndexes.IndexOf(TObject(Index)) <> -1; +end; + +function TcxGridPopupListBox.GetCheckedIndexes: TcxGridIndexes; +var + I: Integer; +begin + SetLength(Result, FCheckedIndexes.Count); + for I := 0 to FCheckedIndexes.Count - 1 do + Result[I] := Integer(FCheckedIndexes[I]); +end; + +function TcxGridPopupListBox.GetGridView: TcxCustomGridView; +begin + Result := FPopup.GridView; +end; + +procedure TcxGridPopupListBox.SetChecked(Index: Integer; Value: Boolean); +var + AChanged: Boolean; + I: Integer; +begin + AChanged := False; + I := FCheckedIndexes.IndexOf(TObject(Index)); + if Value then + if I = -1 then + begin + FCheckedIndexes.Add(TObject(Index)); + AChanged := True; + end + else + else + if I <> -1 then + begin + FCheckedIndexes.Delete(I); + AChanged := True; + end; + if AChanged then InvalidateItem(Index); +end; + +procedure TcxGridPopupListBox.SetCheckedIndexes(const Value: TcxGridIndexes); +var + I: Integer; +begin + FCheckedIndexes.Count := Length(Value); + for I := 0 to Length(Value) - 1 do + FCheckedIndexes[I] := TObject(Value[I]); +end; + +procedure TcxGridPopupListBox.SetPressedItemIndex(Value: Integer); +begin + if FPressedItemIndex <> Value then + begin + if FPressedItemIndex <> -1 then + InvalidateItem(FPressedItemIndex); + FPressedItemIndex := Value; + if FPressedItemIndex <> -1 then + InvalidateItem(FPressedItemIndex); + end; +end; + +procedure TcxGridPopupListBox.SetShowChecks(Value: Boolean); +begin + if FShowChecks <> Value then + begin + FShowChecks := Value; + FCheckedIndexes.Clear; + end; +end; + +function TcxGridPopupListBox.DrawItem(ACanvas: TcxCanvas; AIndex: Integer; + const ARect: TRect; AState: TOwnerDrawState): Boolean; +var + AContentRect, ACheckAreaRect: TRect; +begin + AContentRect := ARect; + if CanHaveCheck(AIndex) then + begin + Inc(AContentRect.Left, GetCheckAreaWidth); + ACheckAreaRect := ARect; + ACheckAreaRect.Right := AContentRect.Left; + if HasCheck(AIndex) and Checked[AIndex] then + begin + ACanvas.Brush.Color := clHighlight; + ACanvas.Font.Color := clHighlightText; + end; + end; + DrawItemContent(ACanvas, AIndex, AContentRect, AState); + if IsCheck(AIndex) then + DrawItemCheck(ACanvas, AIndex, ACheckAreaRect, AState); + if odFocused in AState then ACanvas.DrawFocusRect(ARect); + Result := True; +end; + +procedure TcxGridPopupListBox.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited; + case Key of + VK_RETURN, VK_SPACE: + DoAction(ItemIndex); + VK_ESCAPE: + FPopup.CloseUp; + end; +end; + +procedure TcxGridPopupListBox.MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + PressedItemIndex := ItemAtPos(Point(X, Y), True); + inherited; +end; + +procedure TcxGridPopupListBox.MouseLeave(AControl: TControl); +begin + inherited; + ItemIndex := -1; + PressedItemIndex := -1; +end; + +procedure TcxGridPopupListBox.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + ItemIndex := ItemAtPos(Point(X, Y), True); + if PressedItemIndex <> ItemIndex then + PressedItemIndex := -1; + inherited; +end; + +procedure TcxGridPopupListBox.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +var + AItemIndex: Integer; +begin + inherited; + AItemIndex := ItemAtPos(Point(X, Y), True); + if not IsCheck(AItemIndex) or (AItemIndex = PressedItemIndex) then + DoAction(AItemIndex); + PressedItemIndex := -1; +end; + +function TcxGridPopupListBox.GetVisibleItemCount(AItems: TStrings): Integer; +begin + Result := FVisibleItemCount; + if (Result = 0) or (Result > AItems.Count) then + Result := AItems.Count; +end; + +function TcxGridPopupListBox.CalculateItemHeight: Integer; +begin + Result := Canvas.TextHeight('Qq') + 2 * FItemTextOffsetVert; + if ShowChecks then + Result := Max(Result, GetCheckAreaHeight); +end; + +procedure TcxGridPopupListBox.DoAction(AItemIndex: Integer); +begin + if AItemIndex = -1 then Exit; + if IsCheck(AItemIndex) then + ChangeChecked(AItemIndex) + else + FPopup.CloseUp; + if Assigned(FOnAction) then FOnAction(Self, AItemIndex); +end; + +procedure TcxGridPopupListBox.DrawItemCheck(ACanvas: TcxCanvas; AIndex: Integer; + const ACheckAreaRect: TRect; AState: TOwnerDrawState); +var + R: TRect; + ACheckState: TcxButtonState; +begin + R := cxRectCenter(ACheckAreaRect, LookAndFeelPainter.CheckButtonSize); + if (odFocused in AState) and (odSelected in AState) then + if AIndex = PressedItemIndex then + ACheckState := cxbsPressed + else + ACheckState := cxbsHot + else + ACheckState := cxbsNormal; + LookAndFeelPainter.DrawCheckButton(ACanvas, R, ACheckState, Checked[AIndex]); +end; + +procedure TcxGridPopupListBox.DrawItemContent(ACanvas: TcxCanvas; AIndex: Integer; + ARect: TRect; AState: TOwnerDrawState); +begin + with ACanvas do + begin + FillRect(ARect); + Inc(ARect.Left, FItemTextOffsetLeft); + DrawText(Items[AIndex], ARect, cxSingleLine or cxAlignLeft or cxAlignVCenter); + end; +end; + +procedure TcxGridPopupListBox.Init; +begin + Style.LookAndFeel.MasterLookAndFeel := GridView.LookAndFeel; + ListStyle := lbOwnerDrawFixed; + with Style do + begin + BorderStyle := cbsNone; + HotTrack := False; + TransparentBorder := False; + end; + StyleFocused.BorderStyle := cbsNone; + StyleHot.BorderStyle := cbsNone; + ParentFont := True; +end; + +procedure TcxGridPopupListBox.InvalidateItem(AIndex: Integer); +var + R: TRect; +begin + R := InnerListBox.ItemRect(AIndex); + Windows.InvalidateRect(InnerListBox.Handle, @R, False); +end; + +function TcxGridPopupListBox.CanHaveCheck(AItemIndex: Integer): Boolean; +begin + Result := ShowChecks; +end; + +procedure TcxGridPopupListBox.ChangeChecked(AItemIndex: Integer); +begin + Checked[AItemIndex] := not Checked[AItemIndex]; +end; + +function TcxGridPopupListBox.GetCheckAreaHeight: Integer; +begin + Result := 2 * CheckOffset + LookAndFeelPainter.CheckButtonSize.cy; +end; + +function TcxGridPopupListBox.GetCheckAreaWidth: Integer; +begin + Result := 2 * CheckOffset + LookAndFeelPainter.CheckButtonSize.cx; +end; + +function TcxGridPopupListBox.HasCheck(AItemIndex: Integer): Boolean; +begin + Result := False; +end; + +function TcxGridPopupListBox.IsCheck(AItemIndex: Integer): Boolean; +begin + Result := (AItemIndex <> -1) and CanHaveCheck(AItemIndex) and HasCheck(AItemIndex); +end; + +procedure TcxGridPopupListBox.AdjustBounds(AItems: TStrings = nil); + + function CalculateClientHeight: Integer; + begin + Result := GetVisibleItemCount(AItems) * ItemHeight; + end; + + function CalculateClientWidth: Integer; + var + I: Integer; + begin + Result := 0; + for I := 0 to AItems.Count - 1 do + Result := Max(Result, Canvas.TextWidth(AItems[I])); + Inc(Result, FItemTextOffsetLeft + FItemTextOffsetRight); + if ShowChecks then + Inc(Result, GetCheckAreaWidth); + if FVisibleWidth <> 0 then + Result := Min(Result, FVisibleWidth); + if GetVisibleItemCount(AItems) < AItems.Count then + Inc(Result, GetScrollBarSize.cx); + end; + +begin + if AItems = nil then AItems := Items; + Canvas.Font := Font; + ItemHeight := CalculateItemHeight; + ClientHeight := CalculateClientHeight; + ClientWidth := CalculateClientWidth; + MinWidth := FPopup.ClientMinWidth; + if (FMinWidth <> 0) and (Width < FMinWidth) then + Width := FMinWidth; +end; + +{ TcxCustomGridDesignController } + +function TcxCustomGridDesignController.GetDesignObject(AObject: TPersistent): TPersistent; +begin + Result := AObject; +end; + +function TcxCustomGridDesignController.IsObjectSelected(AObject: TPersistent): Boolean; +begin +{$IFDEF DELPHI6} + if TcxCustomGrid(Control).StructureNavigator = nil then + Result := False + else + Result := TcxCustomGrid(Control).StructureNavigator.IsObjectSelected(GetDesignObject(AObject)); +{$ELSE} + Result := False; +{$ENDIF} +end; + +procedure TcxCustomGridDesignController.SelectObject(AObject: TPersistent; AClearSelection: Boolean); +begin + TcxCustomGrid(Control).StructureNavigator.SelectObject(GetDesignObject(AObject), AClearSelection); +end; + +procedure TcxCustomGridDesignController.SelectObjects(AObjects: TList); +var + I: Integer; +begin + for I := 0 to AObjects.Count - 1 do + AObjects[I] := GetDesignObject(AObjects[I]); + TcxCustomGrid(Control).StructureNavigator.SelectObjects(AObjects); +end; + +procedure TcxCustomGridDesignController.UnselectObject(AObject: TPersistent); +begin + if Control <> nil then + TcxCustomGrid(Control).StructureNavigator.UnselectObject(GetDesignObject(AObject)); +end; + +{ TcxGridViewDesignController } + +constructor TcxGridViewDesignController.Create(AController: TcxCustomGridController); +begin + inherited Create; + FController := AController; +end; + +function TcxGridViewDesignController.GetControl: TcxControl; +begin + Result := FController.Control; +end; + +function TcxGridViewDesignController.GetDesignObject(AObject: TPersistent): TPersistent; +begin + if FController.GridView.IsPattern then + Result := inherited GetDesignObject(AObject) + else + Result := FController.GetPatternObject(AObject); +end; + +{ TcxCustomGridController } + +destructor TcxCustomGridController.Destroy; +begin + HideHint; + FreeAndNil(FHintWindow); + FreeAndNil(FDesignController); + inherited; +end; + +function TcxCustomGridController.GetDesignController: TcxGridViewDesignController; +begin + if (FDesignController = nil) and GridView.IsDesigning then + FDesignController := GetDesignControllerClass.Create(Self); + Result := FDesignController; +end; + +function TcxCustomGridController.GetDragAndDropObject: TcxCustomGridDragAndDropObject; +begin + Result := Site.DragAndDropObject as TcxCustomGridDragAndDropObject; +end; + +function TcxCustomGridController.GetDragAndDropObjectClass: TcxDragAndDropObjectClass; +begin + Result := Site.DragAndDropObjectClass; +end; + +function TcxCustomGridController.GetDragImages: TcxDragImageList; +begin + Result := Site.DragImages; +end; + +function TcxCustomGridController.GetIsDragging: Boolean; +begin + Result := Site.DragAndDropState = ddsInProcess; +end; + +function TcxCustomGridController.GetMouseCaptureViewInfo: TcxCustomGridCellViewInfo; +begin + if Site.MouseCaptureObject is TcxCustomGridCellViewInfo then + Result := TcxCustomGridCellViewInfo(Site.MouseCaptureObject) + else + Result := nil; +end; + +procedure TcxCustomGridController.SetCustomization(Value: Boolean); +begin + if Value and (GridView.IsPattern or not Site.HandleAllocated) then Exit; + if FCustomization <> Value then + begin + FCustomization := Value; + CustomizationChanged; + end; +end; + +procedure TcxCustomGridController.SetDragAndDropObjectClass(Value: TcxDragAndDropObjectClass); +begin + Site.DragAndDropObjectClass := Value; +end; + +procedure TcxCustomGridController.SetMouseCaptureViewInfo(Value: TcxCustomGridCellViewInfo); +begin + Site.MouseCaptureObject := Value; +end; + +procedure TcxCustomGridController.HintCheckerTimerHandler(Sender: TObject); +begin + if not CanShowHint then HideHint; +end; + +procedure TcxCustomGridController.MouseLeave; +begin + HideHint; +end; + +function TcxCustomGridController.PtInCaller(const P: TPoint): Boolean; +begin + if FHintCellViewInfo = nil then + if IsRectEmpty(FHintAreaBounds) then + Result := PtInRect(Site.Bounds, P) + else + Result := PtInRect(FHintAreaBounds, P) + else + Result := FHintCellViewInfo.HasHintPoint(P); +end; + +procedure TcxCustomGridController.AfterPaint; +begin + if IsDragging then + DragAndDropObject.AfterPaint; +end; + +procedure TcxCustomGridController.BeforeKillFocus; +begin +end; + +procedure TcxCustomGridController.BeforePaint; +begin + if IsDragging then + DragAndDropObject.BeforePaint; +end; + +function TcxCustomGridController.CanFocusOnClick(X, Y: Integer): Boolean; +begin + Result := True; +end; + +function TcxCustomGridController.CanHandleHitTest(AHitTest: TcxCustomGridHitTest): Boolean; +begin + Result := not (AHitTest is TcxCustomGridViewHitTest) or + (TcxCustomGridViewHitTest(AHitTest).GridView = FGridView); +end; + +procedure TcxCustomGridController.CheckCoordinates; +begin +end; + +procedure TcxCustomGridController.DetailFocused(ADetail: TcxCustomGridView); +begin +end; + +procedure TcxCustomGridController.DoEnter; +begin +end; + +procedure TcxCustomGridController.DoExit; +begin +end; + +procedure TcxCustomGridController.DoSetFocus(ANotifyMaster: Boolean); +begin + FIsFocusing := True; + try + SetFocus(ANotifyMaster); + finally + FIsFocusing := False; + end; +end; + +function TcxCustomGridController.GetDesignControllerClass: TcxGridViewDesignControllerClass; +begin + Result := TcxGridViewDesignController; +end; + +function TcxCustomGridController.GetDesignHitTest(AHitTest: TcxCustomGridHitTest): Boolean; +begin + Result := (AHitTest.DragAndDropObjectClass <> nil) or + (AHitTest.HitTestCode = htDesignSelector); +end; + +function TcxCustomGridController.GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; +begin + Result := mwskNone; +end; + +function TcxCustomGridController.GetPatternObject(AObject: TPersistent): TPersistent; +begin + if AObject is TcxCustomGridView then + Result := TcxCustomGridView(AObject).PatternGridView + else + if AObject is TcxDataSummaryItem then + Result := DataController.Summary.GetPatternSummaryItems(GridView.PatternGridView.DataController.Summary, + TcxDataSummaryItem(AObject).SummaryItems)[TcxDataSummaryItem(AObject).Index] + else + Result := AObject; +end; + +procedure TcxCustomGridController.GridViewChanged; +begin + if CustomizationForm <> nil then + CustomizationForm.GridViewChanged; +end; + +function TcxCustomGridController.IsPixelScrollBar(AKind: TScrollBarKind): Boolean; +begin + Result := False; +end; + +function TcxCustomGridController.MayFocus: Boolean; +begin + Result := True; +end; + +procedure TcxCustomGridController.RemoveFocus; +begin + BeforeKillFocus; + GridView.TabStop := False; + if not GridView.Visible then + begin + Site.Parent := nil; + end; +end; + +procedure TcxCustomGridController.SetFocus(ANotifyMaster: Boolean); +begin + GridView.TabStop := True; + ViewInfo.DoVisibilityChanged(True); + if Control.IsFocused and Site.CanFocusEx then + Site.SetFocus; + if ANotifyMaster and GridView.IsDetail then + GridView.MasterGridView.Controller.DetailFocused(GridView); +end; + +procedure TcxCustomGridController.CheckCustomizationFormBounds(var R: TRect); +begin +end; + +procedure TcxCustomGridController.CustomizationChanged; +begin + if Customization then + ShowCustomizationForm + else + HideCustomizationForm; + if Control <> nil then + TcxCustomGrid(Control).SendNotifications(gnkCustomization); + GridView.DoCustomization; +end; + +function TcxCustomGridController.GetCustomizationFormBounds: TRect; +begin + if IsRectEmpty(FCustomizationFormBounds) then + begin + Result.BottomRight := Site.ClientToScreen(Site.ClientRect.BottomRight); + Result.Left := Result.Right - GetCustomizationFormDefaultWidth; + Result.Top := Result.Bottom - GetCustomizationFormDefaultHeight; + CheckCustomizationFormBounds(Result); + end + else + Result := FCustomizationFormBounds; +end; + +function TcxCustomGridController.GetCustomizationFormClass: TcxCustomGridCustomizationFormClass; +begin + Result := TcxCustomGridCustomizationForm; +end; + +function TcxCustomGridController.GetCustomizationFormDefaultWidth: Integer; +begin + Result := cxGridCustomizationFormDefaultWidth; +end; + +function TcxCustomGridController.GetCustomizationFormDefaultHeight: Integer; +begin + Result := cxGridCustomizationFormDefaultHeight; +end; + +procedure TcxCustomGridController.HideCustomizationForm; +begin + if not (csDestroying in FCustomizationForm.ComponentState) then + FCustomizationForm.Free; + FCustomizationForm := nil; +end; + +procedure TcxCustomGridController.ShowCustomizationForm; +begin + FCustomizationForm := GetCustomizationFormClass.Create(Self); + FCustomizationForm.BoundsRect := GetCustomizationFormBounds; + FCustomizationForm.Show; +end; + +procedure TcxCustomGridController.ControlFocusChanged; +begin + ViewInfo.ControlFocusChanged; +end; + +procedure TcxCustomGridController.DesignerModified; +begin + Site.Modified; +end; + +procedure TcxCustomGridController.DoCancelMode; +begin +end; + +procedure TcxCustomGridController.DoCheckCoordinates; +var + APrevIsCheckingCoordinates: Boolean; +begin + APrevIsCheckingCoordinates := FIsCheckingCoordinates; + FIsCheckingCoordinates := True; + try + CheckCoordinates; + finally + FIsCheckingCoordinates := APrevIsCheckingCoordinates; + end; +end; + +procedure TcxCustomGridController.DoControlFocusChanged; +begin + GridView.Changed(TcxGridControlFocusChange.Create(GridView)); +end; + +function TcxCustomGridController.GetCursor(X, Y: Integer): TCursor; +var + AHitTest: TcxCustomGridHitTest; +begin + AHitTest := ViewInfo.GetHitTest(Point(X, Y)); + if CanHandleHitTest(AHitTest) then + Result := AHitTest.Cursor + else + Result := crDefault; +end; + +function TcxCustomGridController.HasFocusedControls: Boolean; +begin + Result := False; +end; + +{function TcxCustomGridController.CanDrag(X, Y: Integer): Boolean; +begin + Result := False; +end; + +function TcxCustomGridController.GetDragObjectClass: TDragControlObjectClass; +begin + Result := TcxDragControlObject; +end;} + +procedure TcxCustomGridController.InitScrollBarsParameters; +begin +end; + +function TcxCustomGridController.IsDataFullyVisible(AIsCallFromMaster: Boolean = False): Boolean; +begin + Result := True; +end; + +procedure TcxCustomGridController.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +begin +end; + +procedure TcxCustomGridController.SetScrollBarInfo(AScrollBarKind: TScrollBarKind; + AMin, AMax, AStep, APage, APos: Integer; AAllowShow, AAllowHide: Boolean); +begin + Site.SetScrollBarInfo(AScrollBarKind, AMin, AMax, AStep, APage, APos, AAllowShow, AAllowHide); +end; + +procedure TcxCustomGridController.UpdateScrollBars(AIgnoreUpdateLock: Boolean = False); +var + APrevIgnoreUpdateLock: Boolean; +begin + APrevIgnoreUpdateLock := Site.IgnoreUpdateLock; + Site.IgnoreUpdateLock := AIgnoreUpdateLock; + try + Site.UpdateScrollBars; + finally + Site.IgnoreUpdateLock := APrevIgnoreUpdateLock; + end; +end; + +procedure TcxCustomGridController.BeginDragAndDrop; +begin +end; + +procedure TcxCustomGridController.DragAndDrop(const P: TPoint; var Accepted: Boolean); +begin +end; + +procedure TcxCustomGridController.EndDragAndDrop(Accepted: Boolean); +begin +end; + +function TcxCustomGridController.StartDragAndDrop(const P: TPoint): Boolean; +var + AHitTest: TcxCustomGridHitTest; +begin + AHitTest := ViewInfo.GetHitTest(P); + Result := CanHandleHitTest(AHitTest); + if Result then + begin + Result := AHitTest.DragAndDropObjectClass <> nil; + if Result then + begin + HideHint; + DragAndDropObjectClass := AHitTest.DragAndDropObjectClass; + DragAndDropObject.Init(P, AHitTest); + end; + end; +end; + +procedure TcxCustomGridController.BeforeStartDrag; +begin +end; + +function TcxCustomGridController.CanDrag(X, Y: Integer): Boolean; +begin + Result := True; +end; + +procedure TcxCustomGridController.DragDrop(Source: TObject; X, Y: Integer); +begin +end; + +procedure TcxCustomGridController.DragOver(Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); +begin +end; + +procedure TcxCustomGridController.DrawDragImage(ACanvas: TcxCanvas; R: TRect); +begin +end; + +procedure TcxCustomGridController.EndDrag(Target: TObject; X, Y: Integer); +begin +end; + +function TcxCustomGridController.GetDragImagesSize: TPoint; +begin + Result := Point(0, 0); +end; + +function TcxCustomGridController.HasDragImages: Boolean; +begin + Result := False; +end; + +procedure TcxCustomGridController.StartDrag(var DragObject: TDragObject); +begin +end; + +function TcxCustomGridController.CanShowHint: Boolean; +var + AForm: TCustomForm; +begin + AForm := GetParentForm(Site); + Result := (AForm = nil) or Application.Active and + (AForm.Active or + (TCustomFormAccess(AForm).FormStyle = fsMDIForm)); + if Result then + Result := Site.HandleAllocated and IsWindowVisible(Site.Handle) and + (FindVCLWindow(GetMouseCursorPos) = Site); +end; + +procedure TcxCustomGridController.HideHint; +begin + StopHintCheckerTimer; + EndMouseTracking(Self); + FHintCellViewInfo := nil; + SetRectEmpty(FHintAreaBounds); + if (FHintWindow <> nil) and FHintWindow.HandleAllocated then + ShowWindow(FHintWindow.Handle, SW_HIDE); +end; + +function TcxCustomGridController.GetHintWindowClass: THintWindowClass; +begin + Result := HintWindowClass; +end; + +procedure TcxCustomGridController.ShowHint(const AHintAreaBounds, ATextRect: TRect; + const AText: string; AIsHintMultiLine: Boolean; AFont: TFont; + AHintCellViewInfo: TcxCustomGridViewCellViewInfo); + + function GetHintWindowRect: TRect; + + function GetMaxTextWidth: Integer; + begin + if AIsHintMultiLine then + Result := ATextRect.Right - ATextRect.Left + else + Result := MaxInt div 20; + end; + + function GetTextRectOffset: TPoint; + const + TextOffset: TPoint = (X: 2; Y: 2); + begin + with FHintWindow.ClientToScreen(Point(0, 0)) do + begin + Result.X := X - FHintWindow.Left + TextOffset.X; + Result.Y := Y - FHintWindow.Top + TextOffset.Y; + end; + end; + + begin + Result := FHintWindow.CalcHintRect(GetMaxTextWidth, AText, nil); + with Result do + begin + Inc(Right, -6); + Inc(Bottom, -2); + end; + with Site.ClientToScreen(ATextRect.TopLeft) do + OffsetRect(Result, X, Y); + with GetTextRectOffset do + InflateRect(Result, X, Y); + MakeVisibleOnDesktop(Result, Result.TopLeft); + Dec(Result.Bottom, 4); + end; + +begin + if not CanShowHint then Exit; + if (FHintWindow = nil) or (FHintWindow.ClassType <> GetHintWindowClass) then + begin + FHintWindow.Free; + FHintWindow := GetHintWindowClass.Create(nil); + FHintWindow.Color := Application.HintColor; + end + else + if IsWindowVisible(FHintWindow.Handle) then + begin + if (FHintWindow.Caption = AText) and EqualRect(FHintTextRect, ATextRect) then + Exit; + EndMouseTracking(Self); + end; + FHintTextRect := ATextRect; + FHintWindow.Canvas.Font := AFont; + FHintWindow.ActivateHint(GetHintWindowRect, AText); + FHintAreaBounds := AHintAreaBounds; + FHintCellViewInfo := AHintCellViewInfo; + BeginMouseTracking(Site, FHintAreaBounds, Self); + StartHintCheckerTimer; +end; + +procedure TcxCustomGridController.StartHintCheckerTimer; +begin + if FHintCheckerTimer <> nil then Exit; + FHintCheckerTimer := TcxTimer.Create(nil); + with FHintCheckerTimer do + begin + Interval := 100; + OnTimer := HintCheckerTimerHandler; + end; +end; + +procedure TcxCustomGridController.StopHintCheckerTimer; +begin + FreeAndNil(FHintCheckerTimer); +end; + +procedure TcxCustomGridController.DoKeyDown(var Key: Word; Shift: TShiftState); +begin + KeyDown(Key, Shift); +end; + +procedure TcxCustomGridController.KeyDown(var Key: Word; Shift: TShiftState); +begin +end; + +procedure TcxCustomGridController.KeyPress(var Key: Char); +begin +end; + +procedure TcxCustomGridController.KeyUp(var Key: Word; Shift: TShiftState); +begin +end; + +procedure TcxCustomGridController.MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +var + AHitTest: TcxCustomGridHitTest; +begin + FIsDblClick := ssDouble in Shift; + AHitTest := ViewInfo.GetHitTest(X, Y); + if AHitTest.ViewInfo <> nil then + AHitTest.ViewInfo.MouseDown(AHitTest, Button, Shift); +end; + +procedure TcxCustomGridController.MouseMove(Shift: TShiftState; X, Y: Integer); +var + AHitTest: TcxCustomGridHitTest; +begin + AHitTest := ViewInfo.GetHitTest(X, Y); + if MouseCaptureViewInfo <> nil then + MouseCaptureViewInfo.MouseMove(AHitTest, Shift) + else + if AHitTest.ViewInfo <> nil then + AHitTest.ViewInfo.MouseMove(AHitTest, Shift); +end; + +procedure TcxCustomGridController.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +var + AHitTest: TcxCustomGridHitTest; +begin + AHitTest := ViewInfo.GetHitTest(X, Y); + if MouseCaptureViewInfo <> nil then + MouseCaptureViewInfo.MouseUp(AHitTest, Button, Shift) + else + if AHitTest.ViewInfo <> nil then + AHitTest.ViewInfo.MouseUp(AHitTest, Button, Shift); +end; + +function TcxCustomGridController.ProcessDetailDialogChar(ADetail: TcxCustomGridView; + ACharCode: Word): Boolean; +begin + Result := False; +end; + +function TcxCustomGridController.ProcessDialogChar(ACharCode: Word): Boolean; +begin + Result := (GridView.MasterGridView <> nil) and + GridView.MasterGridView.Controller.ProcessDetailDialogChar(GridView, ACharCode); +end; + +procedure TcxCustomGridController.WndProc(var Message: TMessage); +begin + if (Message.Msg = CN_SYSCHAR) and ProcessDialogChar(Message.WParam) then + Message.Msg := WM_NULL; +end; + +procedure TcxCustomGridController.RefreshCustomizationForm; +begin + if CustomizationForm <> nil then + CustomizationForm.RefreshData; +end; + +{procedure TcxCustomGridController.BeginCellMouseTracking(AViewInfo: TcxCustomGridCellViewInfo); +begin + BeginMouseTracking(Site, AViewInfo.Bounds, AViewInfo); +end; + +procedure TcxCustomGridController.EndCellMouseTracking(AViewInfo: TcxCustomGridCellViewInfo); +begin + EndMouseTracking(AViewInfo); +end;} + +{ TcxDataGroupNode } + +constructor TcxDataGroupNode.Create(AParent: TcxDataGroupNode; ADataGroupInfo: TcxDataGroupInfo); +begin + inherited Create; + FChilds := TList.Create; + FDataGroupInfo := ADataGroupInfo; + FParent := AParent; +end; + +destructor TcxDataGroupNode.Destroy; +var + I: Integer; +begin + for I := 0 to ChildCount - 1 do + Childs[I].Free; + FChilds.Free; + inherited Destroy; +end; + +function TcxDataGroupNode.GetChild(Index: Integer): TcxDataGroupNode; +begin + Result := TcxDataGroupNode(FChilds[Index]); +end; + +function TcxDataGroupNode.GetChildCount: Integer; +begin + Result := FChilds.Count; +end; + +function TcxDataGroupNode.AddChild(ADataGroupInfo: TcxDataGroupInfo): TcxDataGroupNode; +begin + Result := TcxDataGroupNode.Create(Self, ADataGroupInfo); + FChilds.Add(Result); +end; + +{ TcxGridSortingBySummaryEngine } + +constructor TcxGridSortingBySummaryEngine.Create(ADataControllerInfo: TcxCustomDataControllerInfo); +begin + inherited; + FInfos := TList.Create; + FRootNode := TcxDataGroupNode.Create(nil, nil); +end; + +destructor TcxGridSortingBySummaryEngine.Destroy; +begin + FRootNode.Free; + ClearInfos; + FInfos.Free; + inherited Destroy; +end; + +function TcxGridSortingBySummaryEngine.GetDataGroups: TcxDataGroups; +begin + Result := DataControllerInfo.DataGroups; +end; + +function TcxGridSortingBySummaryEngine.GetInfo(Index: Integer): TcxSortingBySummaryInfo; +begin + Result := TcxSortingBySummaryInfo(FInfos[Index]); +end; + +function TcxGridSortingBySummaryEngine.GetInfoCount: Integer; +begin + Result := FInfos.Count; +end; + +procedure TcxGridSortingBySummaryEngine.AddInfo(AInfo: TcxSortingBySummaryInfo); +begin + FInfos.Add(AInfo); +end; + +procedure TcxGridSortingBySummaryEngine.BuildNodes(AParentNode: TcxDataGroupNode; ALevel: Integer; + var ACurIndex: Integer); +var + ANode: TcxDataGroupNode; +begin + while ACurIndex < DataGroups.Count do + if DataGroups[ACurIndex].Level = ALevel then + begin + ANode := AParentNode.AddChild(DataGroups[ACurIndex]); + Inc(ACurIndex); + if ALevel < DataGroups.LevelCount - 1 then // build childs + BuildNodes(ANode, ALevel + 1, ACurIndex); + end + else + Break; +end; + +procedure TcxGridSortingBySummaryEngine.ClearInfos; +var + I: Integer; +begin + for I := 0 to InfoCount - 1 do + Infos[I].Free; + FInfos.Clear; +end; + +function TcxGridSortingBySummaryEngine.CompareGroupsBySummary(AInfo1, AInfo2: + Pointer): Integer; +var + AInfo: TcxSortingBySummaryInfo; +begin + AInfo := Infos[TcxDataGroupNode(AInfo1).DataGroupInfo.Level]; + Result := VarCompare( + TcxDataGroupNode(AInfo1).DataGroupInfo.SummaryValues[AInfo.SummaryItemIndex], + TcxDataGroupNode(AInfo2).DataGroupInfo.SummaryValues[AInfo.SummaryItemIndex]); + if Result = 0 then + begin + Result := DataControllerInfo.CompareGroupRecords( + {DataControllerInfo.GetRowInfo(TcxDataGroupNode(AInfo1).DataGroupInfo.RowIndex).RecordIndex, + DataControllerInfo.GetRowInfo(TcxDataGroupNode(AInfo2).DataGroupInfo.RowIndex).RecordIndex,} + DataControllerInfo.GetInternalRecordIndex( + DataGroups.GetDataRecordListIndex(TcxDataGroupNode(AInfo1).DataGroupInfo)), + DataControllerInfo.GetInternalRecordIndex( + DataGroups.GetDataRecordListIndex(TcxDataGroupNode(AInfo2).DataGroupInfo)), + TcxDataGroupNode(AInfo1).DataGroupInfo.Level) + end + else + if AInfo.SortOrder = soDescending then + Result := -Result; +end; + +procedure TcxGridSortingBySummaryEngine.RebuildDataGroupRecursive(AParentNode: TcxDataGroupNode; + var ABeginRecordListIndex: Integer); +var + I: Integer; +begin + DataGroups.SetItem(ABeginRecordListIndex, AParentNode.DataGroupInfo); + Inc(ABeginRecordListIndex); + if AParentNode.DataGroupInfo.Level < (DataGroups.LevelCount - 1) then + begin + AParentNode.DataGroupInfo.BeginRecordListIndex := ABeginRecordListIndex; + for I := 0 to AParentNode.ChildCount - 1 do + RebuildDataGroupRecursive(AParentNode.Childs[I], ABeginRecordListIndex); + AParentNode.DataGroupInfo.EndRecordListIndex := ABeginRecordListIndex - 1; + end; +end; + +procedure TcxGridSortingBySummaryEngine.RebuildDataGroups; +var + I: Integer; + ABeginRecordListIndex: Integer; +begin + ABeginRecordListIndex := 0; + for I := 0 to FRootNode.ChildCount - 1 do + RebuildDataGroupRecursive(FRootNode.Childs[I], ABeginRecordListIndex); + DataGroups.Rebuild; +end; + +procedure TcxGridSortingBySummaryEngine.SortNodeRecursive(ANode: TcxDataGroupNode; ALevel: Integer); +var + I: Integer; +begin + if Infos[ALevel].SummaryItemIndex <> -1 then + QuickSortList(ANode.FChilds.List, 0, ANode.FChilds.Count - 1, CompareGroupsBySummary); + if (ALevel + 1) < DataGroups.LevelCount then // Last Level? + for I := 0 to ANode.ChildCount - 1 do + SortNodeRecursive(ANode.Childs[I], ALevel + 1); +end; + +procedure TcxGridSortingBySummaryEngine.SortNodes; +var + I: Integer; + AInfo: TcxSortingBySummaryInfo; + ASortedSummaryItem: TcxDataSummaryItem; +begin + ClearInfos; + for I := 0 to DataControllerInfo.GroupingFieldList.Count - 1 do + begin + AInfo := TcxSortingBySummaryInfo.Create; + ASortedSummaryItem := DataController.Summary.GroupSummaryItems[I].SortedSummaryItem; + if ASortedSummaryItem <> nil then + begin + AInfo.SummaryItemIndex := ASortedSummaryItem.Index; + if DataController.SortingBySummaryDataItemIndex <> -1 then + AInfo.SortOrder := DataController.GetItemSortOrder(DataController.SortingBySummaryDataItemIndex) + else + AInfo.SortOrder := DataControllerInfo.GroupingFieldList[I].SortOrder; + end + else + AInfo.SummaryItemIndex := -1; + AddInfo(AInfo); + end; + + SortNodeRecursive(FRootNode, 0); +end; + +procedure TcxGridSortingBySummaryEngine.Sort; +var + ACurIndex: Integer; +begin + if DataGroups.Count = 0 then Exit; + ACurIndex := 0; + BuildNodes(FRootNode, 0, ACurIndex); + SortNodes; + RebuildDataGroups; +end; + +{ TcxCustomGridCellPainter } + +constructor TcxCustomGridCellPainter.Create(ACanvas: TcxCanvas; + AViewInfo: TcxCustomGridCellViewInfo); +begin + inherited Create; + FCanvas := ACanvas; + FViewInfo := AViewInfo; +end; + +function TcxCustomGridCellPainter.GetIsMainCanvasInUseValue: Boolean; +begin + Result := GetIsMainCanvasInUse(FCanvas, FViewInfo); +end; + +procedure TcxCustomGridCellPainter.AfterPaint; +begin + if CanDrawDesignSelection then DoDrawDesignSelection(Canvas, ViewInfo); +end; + +procedure TcxCustomGridCellPainter.BeforePaint; +begin +end; + +function TcxCustomGridCellPainter.CanDrawDesignSelection: Boolean; +begin + Result := True; +end; + +procedure TcxCustomGridCellPainter.DoExcludeFromClipRect; +begin + Canvas.ExcludeClipRect(ViewInfo.Bounds); +end; + +procedure TcxCustomGridCellPainter.DrawBackground; +begin + DrawBackground(ViewInfo.ClientBounds); +end; + +procedure TcxCustomGridCellPainter.DrawBackground(const R: TRect); +begin + with Canvas, ViewInfo do + if not Transparent then + begin + Brush.Color := Params.Color; + FillRect(R); + end + else + if BackgroundBitmap <> nil then + FillRect(R, BackgroundBitmap); +end; + +function TcxCustomGridCellPainter.DrawBackgroundHandler(ACanvas: TcxCanvas; + const ABounds: TRect): Boolean; +begin {4} + Result := ViewInfo.BackgroundBitmap <> nil; + if Result then + ACanvas.FillRect(ABounds, ViewInfo.BackgroundBitmap); +end; + +procedure TcxCustomGridCellPainter.DrawBorder(ABorder: TcxBorder); +begin + with Canvas do + begin + SetBrushColor(ViewInfo.BorderColor[ABorder]); + FillRect(ViewInfo.BorderBounds[ABorder]); + end; +end; + +procedure TcxCustomGridCellPainter.DrawBorders; +var + ABorder: TcxBorder; +begin + for ABorder := Low(ABorder) to High(ABorder) do + if ABorder in ViewInfo.Borders then + DrawBorder(ABorder); +end; + +procedure TcxCustomGridCellPainter.DrawContent; +begin + if ViewInfo.HasBackground and not ViewInfo.DoCustomDrawBackground(Canvas) then + DrawBackground; + DrawText; +end; + +class procedure TcxCustomGridCellPainter.DrawDesignSelection(ACanvas: TcxCanvas; + AViewInfo: TcxCustomGridCellViewInfo); +begin + ACanvas.DrawDesignSelection(AViewInfo.DesignSelectionBounds, AViewInfo.DesignSelectionWidth); +end; + +procedure TcxCustomGridCellPainter.DrawText; +var + R: TRect; +begin + with Canvas, ViewInfo do + if TextForPainting <> '' then + begin + R := TextAreaBounds; // can call font change + Font := Params.Font; + Font.Color := Params.TextColor; + Brush.Style := bsClear; + PrepareCanvasForDrawText; + DrawText(TextForPainting, R, GetTextAttributes(True)); + UnprepareCanvasForDrawText; + Brush.Style := bsSolid; + end; +end; + +function TcxCustomGridCellPainter.ExcludeFromClipRect: Boolean; +begin + Result := False; +end; + +class function TcxCustomGridCellPainter.GetIsMainCanvasInUse(ACanvas: TcxCanvas; + AViewInfo: TcxCustomGridCellViewInfo): Boolean; +begin + Result := ACanvas = AViewInfo.Canvas; +end; + +function TcxCustomGridCellPainter.NeedsPainting: Boolean; +begin + Result := Canvas.RectVisible(ViewInfo.GetAreaBoundsForPainting); +end; + +procedure TcxCustomGridCellPainter.Paint; +var + ASavedParams: TcxViewParams; +begin + ViewInfo.SaveParams(ASavedParams); + try + if not ViewInfo.DoCustomDraw(Canvas) then + DrawContent; + finally + ViewInfo.RestoreParams(ASavedParams); + end; + DrawBorders; +end; + +procedure TcxCustomGridCellPainter.PrepareCanvasForDrawText; +begin +end; + +procedure TcxCustomGridCellPainter.UnprepareCanvasForDrawText; +begin +end; + +class procedure TcxCustomGridCellPainter.DoDrawDesignSelection(ACanvas: TcxCanvas; + AViewInfo: TcxCustomGridCellViewInfo); +begin + if AViewInfo.IsDesignSelected and GetIsMainCanvasInUse(ACanvas, AViewInfo) then + DrawDesignSelection(ACanvas, AViewInfo); +end; + +procedure TcxCustomGridCellPainter.MainPaint; +begin + if not NeedsPainting then Exit; + BeforePaint; + Paint; + AfterPaint; + if ExcludeFromClipRect then DoExcludeFromClipRect; +end; + +{ TcxGridDesignSelectorPainter } + +function TcxGridDesignSelectorPainter.GetViewInfo: TcxGridDesignSelectorViewInfo; +begin + Result := TcxGridDesignSelectorViewInfo(inherited ViewInfo); +end; + +procedure TcxGridDesignSelectorPainter.DoExcludeFromClipRect; +begin + Canvas.SetClipRegion(ViewInfo.Region, roSubtract, False); +end; + +procedure TcxGridDesignSelectorPainter.DrawSign(AColor: TColor); +const + SignOffsetStart = 3; + SignOffsetEnd = 8; + SignElementSize = 2; + SignLineWidth = 1; +var + R: TRect; + I: Integer; +begin + R := ViewInfo.Bounds; + with R do + begin + Inc(Left, SignOffsetStart); + Inc(Top, SignOffsetStart); + Dec(Right, SignOffsetEnd); + Dec(Bottom, SignOffsetEnd); + end; + Canvas.Brush.Color := AColor; + + Canvas.FillRect(Rect(R.Left, R.Top, R.Left + SignLineWidth, R.Bottom)); + Inc(R.Left, SignLineWidth); + for I := 0 to (R.Bottom - R.Top) div SignElementSize - 1 do + begin + R.Bottom := R.Top + SignLineWidth; + Canvas.FillRect(R); + R.Top := R.Bottom + SignElementSize - SignLineWidth; + Dec(R.Right, SignElementSize); + end; +end; + +function TcxGridDesignSelectorPainter.ExcludeFromClipRect: Boolean; +begin + Result := True; +end; + +procedure TcxGridDesignSelectorPainter.Paint; +var + AParams: TcxViewParams; +begin + ViewInfo.GetViewParams(AParams); + Canvas.DrawRegion(ViewInfo.Region, AParams.Color, AParams.TextColor); + DrawSign(AParams.TextColor); +end; + +{ TcxCustomGridPainter } + +function TcxCustomGridPainter.GetCanvas: TcxCanvas; +begin + if FCanvas = nil then + Result := ViewInfo.Canvas + else + Result := FCanvas; +end; + +function TcxCustomGridPainter.GetViewInfo: TcxCustomGridViewInfo; +begin + if FViewInfo = nil then + Result := inherited ViewInfo + else + Result := FViewInfo; +end; + +procedure TcxCustomGridPainter.DrawBackground; + + procedure DrawBackgroundUsingBrush; + begin + with Canvas do + begin + Brush.Color := ViewInfo.BackgroundColor; + FillRgn(Handle, FBackgroundRegion.Handle, Brush.Handle); + end; + end; + + procedure DrawBackgroundUsingBitmap; + var + AClipRegion: TcxRegion; + begin + with Canvas do + begin + AClipRegion := GetClipRegion; + SetClipRegion(FBackgroundRegion, roIntersect, False); + FillRect(ViewInfo.Bounds, ViewInfo.BackgroundBitmap); + SetClipRegion(AClipRegion, roSet); + end; + end; + +begin + if ViewInfo.BackgroundBitmap = nil then + DrawBackgroundUsingBrush + else + DrawBackgroundUsingBitmap; {4} + //Canvas.ExcludeClipRect(ViewInfo.Bounds); +end; + +procedure TcxCustomGridPainter.PaintAfter; +begin + DrawBackground; + FreeAndNil(FBackgroundRegion); + Canvas.SetClipRegion(FBeforePaintClipRegion, roSet); +end; + +procedure TcxCustomGridPainter.PaintBefore; +begin + FBeforePaintClipRegion := Canvas.GetClipRegion; + FBackgroundRegion := TcxRegion.Create(ViewInfo.Bounds); + if ViewInfo.DesignSelectorViewInfo <> nil then + ViewInfo.DesignSelectorViewInfo.Paint(Canvas); +end; + +procedure TcxCustomGridPainter.PaintContent; +begin +end; + +procedure TcxCustomGridPainter.DrawFocusRect(const R: TRect; AHideFocusRect: Boolean); +begin + if GridView.IsControlFocused then + Canvas.DrawFocusRect(R) + else + if not AHideFocusRect then + with Canvas, R do + begin + InvertRect(Rect(Left, Top, Right, Top + 1)); + InvertRect(Rect(Left, Bottom - 1, Right, Bottom)); + InvertRect(Rect(Left, Top + 1, Left + 1, Bottom - 1)); + InvertRect(Rect(Right - 1, Top + 1, Right, Bottom - 1)); + end; +end; + +procedure TcxCustomGridPainter.ExcludeFromBackground(const R: TRect); +begin + FBackgroundRegion.Combine(TcxRegion.Create(R), roSubtract); +end; + +procedure TcxCustomGridPainter.Paint(ACanvas: TcxCanvas = nil; + AViewInfo: TcxCustomGridViewInfo = nil); +{ +var i,ft,lt:integer; +} +begin +{ + ft:=gettickcount; + for i:=1 to 10 do + begin +} + ViewInfo := AViewInfo; + Canvas := ACanvas; + + Controller.BeforePaint; + PaintBefore; + PaintContent; + PaintAfter; + Controller.AfterPaint; + + Canvas := nil; + ViewInfo := nil; +{ + windows.SelectClipRgn(canvas.Handle, 0); + end; + lt:=gettickcount; + application.MainForm.caption := inttostr(lt-ft); +} +end; + +procedure TcxCustomGridPainter.Invalidate; +begin + Site.Invalidate; +end; + +procedure TcxCustomGridPainter.Invalidate(const R: TRect); +begin + Site.InvalidateRect(R, False); +end; + +procedure TcxCustomGridPainter.Invalidate(ARegion: TcxRegion); +begin + Site.InvalidateRgn(ARegion, False); +end; + +{ TcxCustomGridViewData } + +function TcxCustomGridViewData.GetSortingBySummaryEngineClass: TcxSortingBySummaryEngineClass; +begin + Result := TcxGridSortingBySummaryEngine; +end; + +function TcxCustomGridViewData.IsEmpty: Boolean; +begin + Result := DataController.RowCount = 0; +end; + +function TcxCustomGridViewData.MakeDetailVisible(ADetailLevel: TComponent{TcxGridLevel}): TcxCustomGridView; +begin + Result := nil; +end; + +{ TcxGridSite } + +constructor TcxGridSite.Create(AViewInfo: TcxCustomGridViewInfo); +begin + FViewInfo := AViewInfo; + inherited Create(nil); + ControlStyle := ControlStyle + [csNoDesignVisible]; + Keys := [kArrows, kChars]; + ParentColor := False; +{$IFDEF USETCXSCROLLBAR} + HScrollBar.UnlimitedTracking := True; + VScrollBar.UnlimitedTracking := True; +{$ENDIF} +end; + +destructor TcxGridSite.Destroy; +begin + CancelPostBoundsChanged; + //!!!!FViewInfo.FSite := nil; should always be nil here already; + inherited; +end; + +function TcxGridSite.GetContainer: TcxControl; +begin + Result := GridView.Control; +end; + +function TcxGridSite.GetController: TcxCustomGridController; +begin + Result := GridView.Controller; +end; + +function TcxGridSite.GetGridView: TcxCustomGridView; +begin + Result := FViewInfo.GridView; +end; + +function TcxGridSite.GetPainter: TcxCustomGridPainter; +begin + Result := GridView.Painter; +end; + +procedure TcxGridSite.SendKeyDownNotification(var Message: TWMKeyDown); +begin + TcxCustomGrid(GridView.Control).SendNotifications(gnkKeyDown, + @Message); +end; + +procedure TcxGridSite.CNKeyDown(var Message: TWMKeyDown); +begin + SendKeyDownNotification(Message); + if Message.Result = 0 then + inherited; +end; + +procedure TcxGridSite.CNSysKeyDown(var Message: TWMKeyDown); +begin + SendKeyDownNotification(Message); + if Message.Result = 0 then + inherited; +end; + +procedure TcxGridSite.BoundsChangedTimerHandler(Sender: TObject); +begin + CancelPostBoundsChanged; + GridView.BoundsChanged; +end; + +function TcxGridSite.AllowAutoDragAndDropAtDesignTime(X, Y: Integer; + Shift: TShiftState): Boolean; +begin + Result := False; +end; + +function TcxGridSite.AllowDragAndDropWithoutFocus: Boolean; +begin + if TcxCustomGridAccess(GridView.Control).IsPopupControl then {8} + Result := True + else + Result := inherited AllowDragAndDropWithoutFocus; +end; + +procedure TcxGridSite.BeforeMouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + inherited; + if HandleAllocated then + Controller.MouseDown(Button, Shift, X, Y); +end; + +procedure TcxGridSite.BoundsChanged; +var + APrevSize: TPoint; + + function AllowNotification: Boolean; + var + AGridView: TcxCustomGridView; + begin + AGridView := GridView; + repeat + Result := AGridView.ViewInfo.AllowBoundsChangedNotification; + AGridView := AGridView.MasterGridView; + until not Result or (AGridView = nil); + end; + +begin + if CreatingWindow then Exit; + APrevSize := FSize; + UpdateSize; + if ViewInfo.VisibilityChanging then Exit; + if ((APrevSize.X <> 0) or (APrevSize.Y <> 0)) and + ((APrevSize.X <> FSize.X) or (APrevSize.Y <> FSize.Y)) then + if AllowNotification then + GridView.BoundsChanged(True) + else + if UpdatingScrollBars then PostBoundsChanged; + {if AllowNotification and + ((APrevSize.X <> 0) or (APrevSize.Y <> 0)) and + ((APrevSize.X <> FSize.X) or (APrevSize.Y <> FSize.Y)) then + GridView.BoundsChanged(True);} + inherited; +end; + +function TcxGridSite.CanDrag(X, Y: Integer): Boolean; +begin + Result := inherited CanDrag(X, Y) and Controller.CanDrag(X, Y); +end; + +function TcxGridSite.CanFocusOnClick(X, Y: Integer): Boolean; +begin + Result := inherited CanFocusOnClick(X, Y) and Controller.CanFocusOnClick(X, Y); +end; + +procedure TcxGridSite.DoCancelMode; +begin + inherited; + Controller.DoCancelMode; +end; + +procedure TcxGridSite.DoContextPopup(MousePos: TPoint; var Handled: Boolean); +begin + inherited; + if not Handled and (GridView.Control <> nil) then + Handled := TcxCustomGrid(GridView.Control).SendNotifications(gnkContextMenu, + TObject((MousePos.X = -1) and (MousePos.Y = -1))); +end; + +procedure TcxGridSite.DoEnter; +begin + inherited; + Controller.DoEnter; +end; + +procedure TcxGridSite.DoExit; +begin + if not GridView.IsDestroying then + Controller.DoExit; + inherited; +end; + +procedure TcxGridSite.FocusChanged; +var + ALink: TcxObjectLink; +begin + ALink := cxAddObjectLink(Self); + try + inherited; + if IsFocused then + GridView.Focused := True; + if ALink.Ref = nil then Exit; + TcxCustomGridAccess(Container).UpdateFocusing(GridView.IsControlFocused); + finally + cxRemoveObjectLink(ALink); + end; +end; + +function TcxGridSite.FocusWhenChildIsClicked(AChild: TControl): Boolean; +begin + Result := inherited FocusWhenChildIsClicked(AChild) and not Container.IsFocused; +end; + +function TcxGridSite.GetClientBounds: TRect; +begin + Result := inherited GetClientBounds; + ViewInfo.AdjustClientBounds(Result); +end; + +function TcxGridSite.GetCursor(X, Y: Integer): TCursor; +begin + Result := Controller.GetCursor(X, Y); + if Result = crDefault then + Result := inherited GetCursor(X, Y); +end; + +function TcxGridSite.GetDesignHitTest(X, Y: Integer; Shift: TShiftState): Boolean; +var + AHitTest: TcxCustomGridHitTest; +begin + Result := inherited GetDesignHitTest(X, Y, Shift); + if not Result and not ((ssRight in Shift) or (Shift = []) and MouseRightButtonReleased) and + not TcxCustomGrid(Container).UpdateLocked then + begin + AHitTest := ViewInfo.GetHitTest(X, Y); + Result := Controller.GetDesignHitTest(AHitTest); + end; +end; + +function TcxGridSite.GetIsDesigning: Boolean; +begin + if Container = nil then + Result := GridView.IsDesigning + else + Result := Container.IsDesigning; +end; + +function TcxGridSite.GetIsFocused: Boolean; +begin + Result := (GridView.Control <> nil) and + TcxCustomGridAccess(GridView.Control).IsPopupControl or {8} + inherited GetIsFocused or Controller.HasFocusedControls; +end; + +function TcxGridSite.GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; +begin + Result := Controller.GetMouseWheelScrollingKind; +end; + +function TcxGridSite.IsPixelScrollBar(AKind: TScrollBarKind): Boolean; +begin + Result := Controller.IsPixelScrollBar(AKind); +end; + +procedure TcxGridSite.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited; + Controller.DoKeyDown(Key, Shift); +end; + +procedure TcxGridSite.KeyPress(var Key: Char); +begin + inherited; + Controller.KeyPress(Key); +end; + +procedure TcxGridSite.KeyUp(var Key: Word; Shift: TShiftState); +begin + inherited; + Controller.KeyUp(Key, Shift); +end; + +function TcxGridSite.MayFocus: Boolean; +begin + Result := inherited MayFocus and ((Parent = nil) or Controller.MayFocus); +end; + +procedure TcxGridSite.MouseLeave(AControl: TControl); +begin + inherited; + Controller.MouseLeave; +end; + +procedure TcxGridSite.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited; + if DragAndDropState = ddsNone then + Controller.MouseMove(Shift, X, Y); +end; + +procedure TcxGridSite.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + if DragAndDropState = ddsNone then + begin + Controller.MouseUp(Button, Shift, X, Y); + inherited; + end + else + begin + inherited; + Controller.MouseUp(Button, Shift, X, Y); + end; +end; + +procedure TcxGridSite.Paint; +begin + if not FViewInfo.IsCalculating and (Left <> cxGridInvisibleCoordinate) then + begin + inherited; + Painter.Paint; + end; +end; + +procedure TcxGridSite.RequestAlign; +begin +end; + +procedure TcxGridSite.SetParent(AParent: TWinControl); +begin + if Parent <> AParent then + begin + if AParent <> nil then + LookAndFeel.MasterLookAndFeel := GridView.LookAndFeel; + InitTabStop(AParent); + if (AParent = nil) and GridView.Focused and + not (csDestroying in Parent.ComponentState) and Parent.CanFocus then + Parent.SetFocus; + end; + inherited; +end; + +procedure TcxGridSite.WndProc(var Message: TMessage); +begin + {if (Message.Msg = WM_MOUSEACTIVATE) and IsDesigning then + Exit;} + Controller.WndProc(Message); + inherited WndProc(Message); +end; + +procedure TcxGridSite.DoEndDrag(Target: TObject; X, Y: Integer); +begin + Controller.EndDrag(Target, X, Y); + inherited; +end; + +procedure TcxGridSite.DoStartDrag(var DragObject: TDragObject); +begin + Controller.BeforeStartDrag; + inherited; + Controller.StartDrag(DragObject); +end; + +procedure TcxGridSite.DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); +begin + inherited; + Controller.DragOver(Source, X, Y, State, Accept); +end; + +procedure TcxGridSite.DrawDragImage(ACanvas: TcxCanvas; const R: TRect); +begin + Controller.DrawDragImage(ACanvas, R); +end; + +function TcxGridSite.GetDragImagesSize: TPoint; +begin + Result := Controller.GetDragImagesSize; +end; + +function TcxGridSite.HasDragImages: Boolean; +begin + Result := Controller.HasDragImages; +end; + +function TcxGridSite.GetHScrollBarBounds: TRect; +begin + Result := inherited GetHScrollBarBounds; + ViewInfo.GetHScrollBarBounds(Result); +end; + +procedure TcxGridSite.InitScrollBarsParameters; +begin + Controller.InitScrollBarsParameters; +end; + +procedure TcxGridSite.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +begin + Controller.Scroll(AScrollBarKind, AScrollCode, AScrollPos); +end; + +procedure TcxGridSite.UpdateScrollBars; +begin + if not FViewInfo.IsCalculating and GridView.Visible and + (IgnoreUpdateLock or (Container <> nil) and not TcxCustomGrid(Container).UpdateLocked) then + inherited; +end; + +procedure TcxGridSite.DragAndDrop(const P: TPoint; var Accepted: Boolean); +begin + inherited; + Controller.DragAndDrop(P, Accepted); +end; + +procedure TcxGridSite.EndDragAndDrop(Accepted: Boolean); +begin + Controller.EndDragAndDrop(Accepted); + inherited; +end; + +function TcxGridSite.StartDragAndDrop(const P: TPoint): Boolean; +begin + Result := Controller.StartDragAndDrop(P); +end; + +procedure TcxGridSite.CancelPostBoundsChanged; +begin + FreeAndNil(FBoundsChangedTimer); +end; + +procedure TcxGridSite.InitTabStop(AParent: TWinControl); +begin + if (AParent <> nil) and (GridView.Level <> nil) then + GridView.TabStop := TcxGridLevel(GridView.Level).IsTop; +end; + +procedure TcxGridSite.PostBoundsChanged; +begin + if FBoundsChangedTimer <> nil then Exit; + FBoundsChangedTimer := TcxTimer.Create(nil); + with FBoundsChangedTimer do + begin + Interval := 1; + OnTimer := BoundsChangedTimerHandler; + end; +end; + +procedure TcxGridSite.UpdateSize; +begin + FSize := ClientBounds.BottomRight; +end; + +procedure TcxGridSite.BeginDragAndDrop; +begin + Controller.BeginDragAndDrop; + inherited; +end; + +procedure TcxGridSite.DragDrop(Source: TObject; X, Y: Integer); +begin + Controller.DragDrop(Source, X, Y); + inherited; +end; + +function TcxGridSite.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action) or + GridView.Focused and GridView.DataController.ExecuteAction(Action); +end; + +procedure TcxGridSite.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); +var + APrevWidth, APrevHeight: Integer; +begin + APrevWidth := Width; + APrevHeight := Height; + inherited; + if (Width <> APrevWidth) or (Height <> APrevHeight) then + UpdateSize; +end; + +procedure TcxGridSite.SetFocus; +var + ALink: TcxObjectLink; +begin + ALink := cxAddObjectLink(Self); + try + if not GridView.Focused then + TcxCustomGrid(Container).FocusedView.Controller.BeforeKillFocus; + if ALink.Ref = nil then Exit; + inherited; + finally + cxRemoveObjectLink(ALink); + end; +end; + +function TcxGridSite.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action) or + GridView.Focused and GridView.DataController.UpdateAction(Action); +end; + +{ TcxCustomGridCellViewInfo } + +constructor TcxCustomGridCellViewInfo.Create; +begin + inherited; + FVisible := True; +end; + +destructor TcxCustomGridCellViewInfo.Destroy; +begin + LinkedHitTest := nil; + if DropDownWindowExists and (DropDownWindow.Owner = IcxCustomGridPopupOwner(Self)) then + DropDownWindow.Owner := nil; + MouseCapture := False; + State := gcsNone; + inherited; +end; + +function TcxCustomGridCellViewInfo.GetBorderSize(AIndex: TcxBorder): Integer; +begin + if AIndex in Borders then + Result := BorderWidth[AIndex] + else + Result := 0; +end; + +function TcxCustomGridCellViewInfo.GetButtonState: TcxButtonState; +begin + Result := GridCellStateToButtonState(ActualState); +end; + +function TcxCustomGridCellViewInfo.GetClientBounds: TRect; +begin + if IsRectEmpty(FClientBounds) then + FClientBounds := CalculateClientBounds; + Result := FClientBounds; +end; + +function TcxCustomGridCellViewInfo.GetContentBounds: TRect; +begin + if IsRectEmpty(FContentBounds) then + FContentBounds := CalculateContentBounds; + Result := FContentBounds; +end; + +function TcxCustomGridCellViewInfo.GetTextBoundsValue: TRect; +begin + Result := GetTextBounds(True, True); +end; + +function TcxCustomGridCellViewInfo.GetTextHeight: Integer; +begin + Result := CalculateTextHeight(False); +end; + +function TcxCustomGridCellViewInfo.GetTextHeightWithOffset: Integer; +begin + Result := TextHeight; + GetCellTextAreaSize(Result); +end; + +function TcxCustomGridCellViewInfo.GetTextWidth: Integer; +begin + Result := CalculateTextWidth; +end; + +function TcxCustomGridCellViewInfo.GetTextWidthWithOffset: Integer; +begin + Result := TextWidth; + GetCellTextAreaSize(Result); +end; + +procedure TcxCustomGridCellViewInfo.SetLinkedHitTest(Value: TcxCustomGridHitTest); +var + APrevLinkedHitTest: TcxCustomGridHitTest; +begin + if FLinkedHitTest <> Value then + begin + APrevLinkedHitTest := FLinkedHitTest; + FLinkedHitTest := Value; + if (APrevLinkedHitTest <> nil) and (APrevLinkedHitTest.ViewInfo = Self) then + APrevLinkedHitTest.ViewInfo := nil; + if FLinkedHitTest <> nil then + FLinkedHitTest.ViewInfo := Self; + end; +end; + +procedure TcxCustomGridCellViewInfo.SetState(Value: TcxGridCellState); +var + APrevState: TcxGridCellState; +begin + if FState <> Value then + begin + BeforeStateChange; + APrevState := FState; + FState := Value; + StateChanged(APrevState); + end; +end; + +procedure TcxCustomGridCellViewInfo.DoCancelMode; +begin + State := gcsNone; +end; + +procedure TcxCustomGridCellViewInfo.MouseLeave; +begin + if not MouseCapture and + ((FState = gcsSelected) or not IsCheck and (FState = gcsPressed)) then + State := gcsNone; +end; + +function TcxCustomGridCellViewInfo.PtInCaller(const P: TPoint): Boolean; +begin + Result := HasPoint(P); +end; + +function TcxCustomGridCellViewInfo.ClosePopupWhenNilOwner: Boolean; +begin + Result := CloseDropDownWindowOnDestruction; +end; + +function TcxCustomGridCellViewInfo.GetOwnerBounds: TRect; +begin + Result := GetDropDownWindowOwnerBounds; +end; + +procedure TcxCustomGridCellViewInfo.PopupClosed; +begin + CloseUp; +end; + +procedure TcxCustomGridCellViewInfo.AfterCalculateBounds(var ABounds: TRect); +begin + ResetContentBounds; +end; + +procedure TcxCustomGridCellViewInfo.AfterCustomDraw(ACanvas: TcxCanvas); +begin + ACanvas.GetParams(Params); +end; + +procedure TcxCustomGridCellViewInfo.BeforeCustomDraw(ACanvas: TcxCanvas); +begin + ACanvas.SetParams(Params); +end; + +procedure TcxCustomGridCellViewInfo.BeforeStateChange; +begin +end; + +function TcxCustomGridCellViewInfo.CalculateClientBounds: TRect; +var + ABorder: TcxBorder; + ABorderSize: Integer; +begin + Result := Bounds; + for ABorder := Low(ABorder) to High(ABorder) do + begin + ABorderSize := BorderSize[ABorder]; + with Result do + case ABorder of + bLeft: + Inc(Left, ABorderSize); + bTop: + Inc(Top, ABorderSize); + bRight: + Dec(Right, ABorderSize); + bBottom: + Dec(Bottom, ABorderSize); + end; + end; +end; + +function TcxCustomGridCellViewInfo.CalculateContentBounds: TRect; +begin + Result := ClientBounds; +end; + +function TcxCustomGridCellViewInfo.CalculateTextWidth(AAngle: Integer = 0): Integer; +var + R: TRect; +begin + CalculateParams; + R := Rect(0, 0, MaxInt div 2, MaxInt div 2); + Canvas.Font := Params.Font; + if AAngle <> 0 then + Canvas.SetFontAngle(AAngle); +// Result := Canvas.TextWidth(Text); + Canvas.TextExtent(Text, R, + GetTextAttributes(False{AForPainting}) and not (cxAlignRight or cxAlignCenter) or cxAlignLeft); + if AAngle <> 0 then + Canvas.SetFontAngle(0); + Result := R.Right - R.Left; +end; + +function TcxCustomGridCellViewInfo.CalculateTextHeight(AForPainting: Boolean; + AAngle: Integer = 0): Integer; +var + R: TRect; +begin + CalculateParams; + R := TextAreaBounds; + Canvas.Font := Params.Font; + if AAngle <> 0 then + Canvas.SetFontAngle(AAngle); + Canvas.TextExtent(Text, R, + GetTextAttributes(AForPainting) and not (cxAlignBottom or cxAlignVCenter) or cxAlignTop); {1} + if AAngle <> 0 then + Canvas.SetFontAngle(0); + Result := R.Bottom - R.Top; +end; + +procedure TcxCustomGridCellViewInfo.CalculateParams; +begin + if FParamsCalculated or FCalculatingParams then Exit; + FCalculatingParams := True; + try + DoCalculateParams; + finally + FCalculatingParams := False; + FParamsCalculated := True; + end; +end; + +procedure TcxCustomGridCellViewInfo.CalculateParamsNeeded; +begin + FParamsCalculated := False; +end; + +function TcxCustomGridCellViewInfo.CalculateHeight: Integer; +begin + Result := Bounds.Bottom - Bounds.Top; +end; + +function TcxCustomGridCellViewInfo.CalculateWidth: Integer; +begin + Result := Bounds.Right - Bounds.Left; +end; + +function TcxCustomGridCellViewInfo.CaptureMouseOnPress: Boolean; +begin + Result := False; +end; + +procedure TcxCustomGridCellViewInfo.Click; +begin +end; + +function TcxCustomGridCellViewInfo.CustomDraw(ACanvas: TcxCanvas): Boolean; +begin + Result := False; +end; + +function TcxCustomGridCellViewInfo.CustomDrawBackground(ACanvas: TcxCanvas): Boolean; +begin + Result := False; +end; + +procedure TcxCustomGridCellViewInfo.Destroying; +begin + FIsDestroying := True; +end; + +procedure TcxCustomGridCellViewInfo.DoCalculateParams; +begin + AlignmentHorz := GetAlignmentHorz; + AlignmentVert := GetAlignmentVert; + GetViewParams(Params); + Borders := GetBorders; + Text := GetText; + MultiLine := GetMultiLine; + MultiLinePainting := GetMultiLinePainting; + Width := CalculateWidth; +end; + +procedure TcxCustomGridCellViewInfo.DoInvalidate; +begin + if Control <> nil then + Control.InvalidateRect(Bounds, False); +end; + +function TcxCustomGridCellViewInfo.DoCustomDraw(ACanvas: TcxCanvas): Boolean; +begin + Result := HasCustomDraw; + if Result then + begin + BeforeCustomDraw(ACanvas); + Result := CustomDraw(ACanvas); + if not Result then + AfterCustomDraw(ACanvas); + end; +end; + +function TcxCustomGridCellViewInfo.DoCustomDrawBackground(ACanvas: TcxCanvas): Boolean; +begin + Result := HasCustomDrawBackground; + if Result then + begin + BeforeCustomDraw(ACanvas); + Result := CustomDrawBackground(ACanvas); + if not Result then + AfterCustomDraw(ACanvas); + end; +end; + +function TcxCustomGridCellViewInfo.GetActualState: TcxGridCellState; +begin + Result := FState; +end; + +function TcxCustomGridCellViewInfo.GetAlignmentHorz: TAlignment; +begin + Result := taLeftJustify; +end; + +function TcxCustomGridCellViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + Result := vaTop; +end; + +function TcxCustomGridCellViewInfo.GetAreaBounds: TRect; +begin + SetRectEmpty(Result); +end; + +function TcxCustomGridCellViewInfo.GetBackgroundBitmap: TBitmap; +begin {4} + Result := Params.Bitmap; + //Result := nil; +end; + +function TcxCustomGridCellViewInfo.GetBorderColor(AIndex: TcxBorder): TColor; +begin + Result := clDefault; +end; + +function TcxCustomGridCellViewInfo.GetBorderBounds(AIndex: TcxBorder): TRect; +begin + Result := ClientBounds; + with Result do + begin + case AIndex of + bLeft: + begin + Right := Left; + Dec(Left, BorderWidth[AIndex]); + end; + bTop: + begin + Bottom := Top; + Dec(Top, BorderWidth[AIndex]); + end; + bRight: + begin + Left := Right; + Inc(Right, BorderWidth[AIndex]); + end; + bBottom: + begin + Top := Bottom; + Inc(Bottom, BorderWidth[AIndex]); + end; + end; + if AIndex in [bLeft, bRight] then + begin + if bTop in Borders then + Dec(Top, BorderWidth[bTop]); + if bBottom in Borders then + Inc(Bottom, BorderWidth[bBottom]); + end; + end; +end; + +function TcxCustomGridCellViewInfo.GetBorders: TcxBorders; +begin + Result := []; +end; + +function TcxCustomGridCellViewInfo.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := 0; +end; + +function TcxCustomGridCellViewInfo.GetBounds: TRect; +var + AArea: TRect; +begin + Result := Bounds; + AArea := GetAreaBounds; + if not IsRectEmpty(AArea) then + IntersectRect(Result, Result, AArea); +end; + +class function TcxCustomGridCellViewInfo.GetCellHeight(ATextHeight: Integer; + ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; +begin + Result := ATextHeight; + GetCellTextAreaSize(Result); +end; + +function TcxCustomGridCellViewInfo.GetContentHeight: Integer; +begin + with ContentBounds do + Result := Bottom - Top; +end; + +function TcxCustomGridCellViewInfo.GetContentWidth: Integer; +begin + with ContentBounds do + Result := Right - Left; +end; + +function TcxCustomGridCellViewInfo.GetControl: TcxControl; +begin + if (Canvas.Canvas is TControlCanvas) and + (TControlCanvas(Canvas.Canvas).Control is TcxControl) then + Result := TControlCanvas(Canvas.Canvas).Control as TcxControl + else + Result := nil; +end; + +function TcxCustomGridCellViewInfo.GetDesignSelectionBounds: TRect; +begin + Result := Bounds; + InflateRect(Result, -1, -1); +end; + +function TcxCustomGridCellViewInfo.GetDesignSelectionWidth: Integer; +begin + Result := cxDesignSelectionWidth; +end; + +function TcxCustomGridCellViewInfo.GetHeight: Integer; +begin + with Bounds do + Result := Bottom - Top; +end; + +function TcxCustomGridCellViewInfo.GetHotTrack: Boolean; +begin + Result := IsCheck; +end; + +function TcxCustomGridCellViewInfo.GetIsCheck: Boolean; +begin + Result := DropDownWindow <> nil; +end; + +function TcxCustomGridCellViewInfo.GetIsDesignSelected: Boolean; +begin + Result := False; +end; + +function TcxCustomGridCellViewInfo.GetIsVisibleForPainting: Boolean; +begin + Result := Visible; +end; + +function TcxCustomGridCellViewInfo.GetMouseCapture: Boolean; +begin + if Control = nil then + Result := False + else + Result := Control.MouseCaptureObject = Self; +end; + +function TcxCustomGridCellViewInfo.GetMultiLine: Boolean; +begin + Result := False; +end; + +function TcxCustomGridCellViewInfo.GetMultiLinePainting: Boolean; +begin + Result := MultiLine; +end; + +function TcxCustomGridCellViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxCustomGridCellPainter; +end; + +function TcxCustomGridCellViewInfo.GetShowEndEllipsis: Boolean; +begin + Result := False; +end; + +function TcxCustomGridCellViewInfo.GetText: string; +begin + Result := ''; +end; + +function TcxCustomGridCellViewInfo.GetTextAreaBounds: TRect; +begin + Result := ContentBounds; + InflateRect(Result, -cxGridCellTextOffset, -cxGridCellTextOffset); +end; + +function TcxCustomGridCellViewInfo.GetTextAttributes(AForPainting: Boolean): Integer; +const + MultiLines: array[Boolean] of Integer = (cxSingleLine, cxWordBreak); + ShowEndEllipsises: array[Boolean] of Integer = (0, cxShowEndEllipsis); +begin + Result := + cxAlignmentsHorz[AlignmentHorz] or cxAlignmentsVert[AlignmentVert] or + MultiLines[AForPainting and MultiLinePainting or not AForPainting and MultiLine] or + ShowEndEllipsises[ShowEndEllipsis]; +end; + +function TcxCustomGridCellViewInfo.GetTextBounds(AHorizontal, AVertical: Boolean): TRect; +var + ATextWidth, ATextHeight: Integer; +begin + Result := TextAreaBounds; + if AHorizontal then + begin + ATextWidth := TextWidth; + with Result do + begin + if MultiLinePainting and (ATextWidth > Right - Left) then Exit; + case AlignmentHorz of + taLeftJustify: + Right := Left + ATextWidth; + taRightJustify: + Left := Right - ATextWidth; + taCenter: + begin + Left := (Left + Right - ATextWidth) div 2; + Right := Left + ATextWidth; + end; + end; + end; + end; + if AVertical then + begin + ATextHeight := TextHeight; + with Result do + case AlignmentVert of + vaTop: + Bottom := Top + ATextHeight; + vaBottom: + Top := Bottom - ATextHeight; + vaCenter: + begin + Top := (Top + Bottom - ATextHeight) div 2; + Bottom := Top + ATextHeight; + end; + end; + end; +end; + +function TcxCustomGridCellViewInfo.GetTextCellHeight(AGridViewInfo: TcxCustomGridViewInfo; + ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; +begin + CalculateParams; + if MultiLine then + Result := TextHeight + else + Result := AGridViewInfo.GetFontHeight(Params.Font); + Result := GetCellHeight(Result, ALookAndFeelPainter); +end; + +function TcxCustomGridCellViewInfo.GetTextForPainting: string; +begin + Result := Text; +end; + +function TcxCustomGridCellViewInfo.GetTransparent: Boolean; +begin {4} + Result := BackgroundBitmap <> nil; +end; + +procedure TcxCustomGridCellViewInfo.GetViewParams(var AParams: TcxViewParams); +begin +end; + +function TcxCustomGridCellViewInfo.GetVisible: Boolean; +begin + Result := FVisible; +end; + +function TcxCustomGridCellViewInfo.GetVisibleForHitTest: Boolean; +begin + Result := Visible; +end; + +function TcxCustomGridCellViewInfo.GetWidth: Integer; +begin + with Bounds do + Result := Right - Left; +end; + +function TcxCustomGridCellViewInfo.HasBackground: Boolean; +begin + Result := True; +end; + +function TcxCustomGridCellViewInfo.HasCustomDraw: Boolean; +begin + Result := False; +end; + +function TcxCustomGridCellViewInfo.HasCustomDrawBackground: Boolean; +begin + Result := False; +end; + +function TcxCustomGridCellViewInfo.HasHitTestPoint(const P: TPoint): Boolean; +begin + Result := HasPoint(P); +end; + +function TcxCustomGridCellViewInfo.HasMouse(AHitTest: TcxCustomGridHitTest): Boolean; +begin + Result := AHitTest is GetHitTestClass; +end; + +procedure TcxCustomGridCellViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + AHitTest.ViewInfo := Self; +end; + +function TcxCustomGridCellViewInfo.InvalidateOnStateChange: Boolean; +begin + Result := True; +end; + +procedure TcxCustomGridCellViewInfo.Offset(DX, DY: Integer); +begin + OffsetRect(Bounds, DX, DY); + if not IsRectEmpty(FClientBounds) then + OffsetRect(FClientBounds, DX, DY); + if not IsRectEmpty(FContentBounds) then + OffsetRect(FContentBounds, DX, DY); +end; + +procedure TcxCustomGridCellViewInfo.RestoreParams(const AParams: TcxViewParams); +begin + Params := AParams; +end; + +procedure TcxCustomGridCellViewInfo.SaveParams(out AParams: TcxViewParams); +begin + AParams := Params; +end; + +procedure TcxCustomGridCellViewInfo.SetHeight(Value: Integer); +begin + with Bounds do + Bottom := Top + Value; +end; + +procedure TcxCustomGridCellViewInfo.SetMouseCapture(Value: Boolean); +begin + if (Control <> nil) and (MouseCapture <> Value) then + if Value then + Control.MouseCaptureObject := Self + else + Control.MouseCaptureObject := nil; +end; + +procedure TcxCustomGridCellViewInfo.SetWidth(Value: Integer); +begin + with Bounds do + Right := Left + Value; +end; + +procedure TcxCustomGridCellViewInfo.StateChanged(APrevState: TcxGridCellState); +begin + if InvalidateOnStateChange then Invalidate; + case State of + gcsNone: + EndMouseTracking(Self); + gcsSelected: + if Control <> nil then + BeginMouseTracking(Control, Bounds, Self); + end; + if CaptureMouseOnPress then + case State of + gcsPressed: + MouseCapture := True; + {gcsNone: + MouseCapture := False; - commented because of the Offset happening during drag&drop} + end; + if (State = gcsPressed) and (DropDownWindow <> nil) then + DropDown; +end; + +procedure TcxCustomGridCellViewInfo.DropDown; +begin + if DropDownWindow.Visible then Exit; + DropDownWindow.Owner := Self; + DropDownWindow.Popup; +end; + +procedure TcxCustomGridCellViewInfo.CloseUp; +begin + State := gcsNone; +end; + +function TcxCustomGridCellViewInfo.CloseDropDownWindowOnDestruction: Boolean; +begin + Result := True; +end; + +function TcxCustomGridCellViewInfo.DropDownWindowExists: Boolean; +begin + Result := False; +end; + +function TcxCustomGridCellViewInfo.GetDropDownWindow: TcxCustomGridPopup; +begin + Result := nil; +end; + +function TcxCustomGridCellViewInfo.GetDropDownWindowOwnerBounds: TRect; +begin + Result := Bounds; +end; + +function TcxCustomGridCellViewInfo.IsDropDownWindowOwner: Boolean; +begin + Result := DropDownWindow.Owner = nil; +end; + +procedure TcxCustomGridCellViewInfo.AfterConstruction; +begin + inherited; + if not CloseDropDownWindowOnDestruction and DropDownWindowExists and + DropDownWindow.Visible and IsDropDownWindowOwner then + begin + DropDownWindow.Owner := Self; + State := gcsPressed; + end; +end; + +procedure TcxCustomGridCellViewInfo.AfterRecalculation; +begin +end; + +procedure TcxCustomGridCellViewInfo.BeforeDestruction; +begin + Destroying; + inherited; +end; + +procedure TcxCustomGridCellViewInfo.BeforeRecalculation; +begin + CalculateParamsNeeded; + //ResetContentBounds; +end; + +procedure TcxCustomGridCellViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + CalculateParams; + if AWidth = -1 then AWidth := CalculateWidth; + if AHeight = -1 then AHeight := CalculateHeight; + with Bounds do + begin + Left := ALeftBound; + Top := ATopBound; + Right := Left + AWidth; + Bottom := Top + AHeight; + end; + AfterCalculateBounds(Bounds); + FCalculated := True; +end; + +procedure TcxCustomGridCellViewInfo.Calculate(const ABounds: TRect); +begin + with ABounds do + Calculate(Left, Top, Max(0, Right - Left), Max(0, Bottom - Top)); +end; + +function TcxCustomGridCellViewInfo.GetAreaBoundsForPainting: TRect; +begin + Result := Bounds; +end; + +function TcxCustomGridCellViewInfo.GetBestFitWidth: Integer; +begin + Result := BorderSize[bLeft] + TextWidthWithOffset + BorderSize[bRight]; +end; + +function TcxCustomGridCellViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + if VisibleForHitTest and HasHitTestPoint(P) and (GetHitTestClass <> nil) then + begin + Result := GetHitTestClass.Instance(P); + InitHitTest(Result); + end + else + Result := nil; +end; + +function TcxCustomGridCellViewInfo.HasPoint(const P: TPoint): Boolean; +begin + Result := PtInRect(GetBounds, P); +end; + +procedure TcxCustomGridCellViewInfo.Invalidate; +begin + DoInvalidate; +end; + +function TcxCustomGridCellViewInfo.MouseDown(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +begin + Result := False; + if (AButton = mbLeft) and HotTrack and HasMouse(AHitTest) then + begin + if IsCheck then + case FState of + gcsSelected: + State := gcsPressed; + gcsPressed: + State := gcsSelected; + end + else + State := gcsPressed; + Result := True; + end; +end; + +function TcxCustomGridCellViewInfo.MouseMove(AHitTest: TcxCustomGridHitTest; + AShift: TShiftState): Boolean; +begin + Result := False; + if HotTrack then + if IsCheck then + if State <> gcsPressed then + begin + if HasMouse(AHitTest) then + State := gcsSelected + else + State := gcsNone; + Result := True; + end + else + else + begin + if HasMouse(AHitTest) then + if MouseCapture then + State := gcsPressed + else + State := gcsSelected + else + if MouseCapture then + State := gcsSelected + else + State := gcsNone; + Result := True; + end; +end; + +function TcxCustomGridCellViewInfo.MouseUp(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +begin + Result := False; + if (AButton = mbLeft) and not IsCheck then + begin + Result := State = gcsPressed; + State := gcsNone; + if Result then Click; + end; +end; + +procedure TcxCustomGridCellViewInfo.DoOffset(DX, DY: Integer); +begin + Offset(DX, DY); + State := gcsNone; + MouseLeave; +end; + +procedure TcxCustomGridCellViewInfo.Paint(ACanvas: TcxCanvas = nil); +begin + {if ACanvas = nil then ACanvas := Canvas; + if Visible and ACanvas.RectVisible(Bounds) and (GetPainterClass <> nil) then + begin + with GetPainterClass.Create(ACanvas, Self) do + try + MainPaint; + finally + Free; + end; + end;} + if IsVisibleForPainting and (GetPainterClass <> nil) then + begin + if ACanvas = nil then ACanvas := Canvas; + with GetPainterClass.Create(ACanvas, Self) do + try + MainPaint; + finally + Free; + end; + end; +end; + +procedure TcxCustomGridCellViewInfo.Recalculate; +begin + BeforeRecalculation; + Calculate(Bounds); +end; + +procedure TcxCustomGridCellViewInfo.ResetContentBounds; +begin + SetRectEmpty(FClientBounds); + SetRectEmpty(FContentBounds); +end; + +procedure TcxCustomGridCellViewInfo.Update; +begin + Recalculate; + Invalidate; +end; + +{ TcxCustomGridViewCellViewInfo } + +constructor TcxCustomGridViewCellViewInfo.Create(AGridViewInfo: TcxCustomGridViewInfo); +begin + FGridViewInfo := AGridViewInfo; + inherited Create; +end; + +destructor TcxCustomGridViewCellViewInfo.Destroy; +begin + FGridViewInfo.RemoveActiveViewInfo(Self, True); + if Controller.HintCellViewInfo = Self then + Controller.HideHint; + inherited; +end; + +function TcxCustomGridViewCellViewInfo.GetController: TcxCustomGridController; +begin + Result := GridView.Controller; +end; + +function TcxCustomGridViewCellViewInfo.GetGridView: TcxCustomGridView; +begin + Result := FGridViewInfo.GridView; +end; + +function TcxCustomGridViewCellViewInfo.GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := FGridViewInfo.LookAndFeelPainter; +end; + +function TcxCustomGridViewCellViewInfo.GetCanvas: TcxCanvas; +begin + Result := FGridViewInfo.Canvas; +end; + +procedure TcxCustomGridViewCellViewInfo.AfterCalculateBounds(var ABounds: TRect); +var + AHitTest: TcxCustomGridHitTest; +begin + inherited; + if EmulateMouseMoveAfterCalculate and HotTrack and + Control.HandleAllocated and GridViewInfo.Visible and + PtInRect(Bounds, GridViewInfo.MousePos) then + begin + AHitTest := GetHitTestClass.Instance(GridViewInfo.MousePos); + InitHitTest(AHitTest); + MouseMove(AHitTest, []); + end; +end; + +procedure TcxCustomGridViewCellViewInfo.DoInvalidate; +begin + GridView.ViewChanged(Bounds); +end; + +function TcxCustomGridViewCellViewInfo.EmulateMouseMoveAfterCalculate: Boolean; +begin + Result := False; +end; + +function TcxCustomGridViewCellViewInfo.GetControl: TcxControl; +begin + Result := GridView.Site; +end; + +function TcxCustomGridViewCellViewInfo.HasMouse(AHitTest: TcxCustomGridHitTest): Boolean; +begin + Result := inherited HasMouse(AHitTest) and + (TcxCustomGridViewHitTest(AHitTest).GridView = GridView); +end; + +procedure TcxCustomGridViewCellViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + inherited; + GridViewInfo.InitHitTest(AHitTest); +end; + +function TcxCustomGridViewCellViewInfo.CanShowHint: Boolean; +begin + Result := False; +end; + +procedure TcxCustomGridViewCellViewInfo.CheckHint(AHitTest: TcxCustomGridHitTest); +var + AHintText: TCaption; + AIsHintMultiLine: Boolean; + ATextRect, R: TRect; +begin + if NeedShowHint(AHitTest.Pos, AHintText, AIsHintMultiLine, ATextRect) then + begin + R := GetAreaBoundsForHint; + if not IsRectEmpty(R) then + begin + IntersectRect(R, ATextRect, R); + if not IsRectEmpty(R) then ATextRect := R; + end; + Controller.ShowHint(GetBoundsForHint, ATextRect, AHintText, AIsHintMultiLine, + Params.Font, Self); + end + else + Controller.HideHint; +end; + +function TcxCustomGridViewCellViewInfo.GetAreaBoundsForHint: TRect; +begin + Result := GetAreaBounds; +end; + +function TcxCustomGridViewCellViewInfo.GetBoundsForHint: TRect; +var + R: TRect; +begin + Result := GetCellBoundsForHint; + R := GetAreaBoundsForHint; + if not IsRectEmpty(R) then + IntersectRect(Result, Result, R); +end; + +function TcxCustomGridViewCellViewInfo.GetCellBoundsForHint: TRect; +begin + Result := TextAreaBounds; +end; + +function TcxCustomGridViewCellViewInfo.GetHintText: string; +begin + Result := Text; +end; + +function TcxCustomGridViewCellViewInfo.GetHintTextRect(const AMousePos: TPoint): TRect; +begin + Result := TextAreaBounds; +end; + +function TcxCustomGridViewCellViewInfo.HasHintPoint(const P: TPoint): Boolean; +begin + Result := PtInRect(GetBoundsForHint, P); +end; + +procedure TcxCustomGridViewCellViewInfo.InitHint(const AMousePos: TPoint; + out AHintText: TCaption; out AIsHintMultiLine: Boolean; out ATextRect: TRect); +begin + AHintText := HintText; + AIsHintMultiLine := IsHintMultiLine; + ATextRect := GetHintTextRect(AMousePos); +end; + +function TcxCustomGridViewCellViewInfo.IsHintForText: Boolean; +begin + Result := True; +end; + +function TcxCustomGridViewCellViewInfo.IsHintMultiLine: Boolean; +begin + Result := MultiLinePainting; +end; + +function TcxCustomGridViewCellViewInfo.NeedShowHint(const AMousePos: TPoint; + out AHintText: TCaption; out AIsHintMultiLine: Boolean; out ATextRect: TRect): Boolean; +var + ATextBounds, R: TRect; +begin + Result := (HintText <> '') and HasHintPoint(AMousePos); + if Result then + begin + if IsHintForText then + begin + with TextAreaBounds do + Result := (CalculateTextHeight(True) > Bottom - Top) or + not MultiLinePainting and (TextWidth > Right - Left); + if not Result then + begin + ATextBounds := TextBounds; + IntersectRect(R, GetBoundsForHint, ATextBounds); + Result := not EqualRect(R, ATextBounds); + end; + end; + if Result then + InitHint(AMousePos, AHintText, AIsHintMultiLine, ATextRect); + end; +end; + +procedure TcxCustomGridViewCellViewInfo.BeforeRecalculation; +begin + GridViewInfo.UpdateMousePos; + inherited; +end; + +procedure TcxCustomGridViewCellViewInfo.Invalidate; +begin + if IsDestroying then Exit; + CalculateParams; + inherited; +end; + +function TcxCustomGridViewCellViewInfo.MouseMove(AHitTest: TcxCustomGridHitTest; + AShift: TShiftState): Boolean; +begin + Result := inherited MouseMove(AHitTest, AShift); + if Visible and CanShowHint then + CheckHint(AHitTest); +end; + +{ TcxGridDesignSelectorViewInfo } + +destructor TcxGridDesignSelectorViewInfo.Destroy; +begin + DestroyRegion; + inherited; +end; + +function TcxGridDesignSelectorViewInfo.CalculateHeight: Integer; +begin + Result := DesignSelectorHeight; +end; + +function TcxGridDesignSelectorViewInfo.CalculateWidth: Integer; +begin + Result := DesignSelectorWidth; +end; + +function TcxGridDesignSelectorViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridDesignSelectorHitTest; +end; + +function TcxGridDesignSelectorViewInfo.GetHotTrack: Boolean; +begin + Result := True; +end; + +function TcxGridDesignSelectorViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridDesignSelectorPainter; +end; + +procedure TcxGridDesignSelectorViewInfo.GetViewParams(var AParams: TcxViewParams); +const + Colors: array[Boolean, Boolean] of TColor = + ((cxGridDesignViewColor, cxGridDesignViewHotColor), + (cxGridDesignSelectedColor, cxGridDesignSelectedHotColor)); + BorderColors: array[Boolean, Boolean] of TColor = + ((cxGridDesignViewBorderColor, cxGridDesignViewBorderColor), + (cxGridDesignSelectedBorderColor, cxGridDesignSelectedHotBorderColor)); +var + AObjectSelected: Boolean; +begin + AObjectSelected := GridView.Controller.DesignController.IsObjectSelected(GridView); + AParams.Color := GetRealColor(Colors[AObjectSelected, State = gcsSelected]); + AParams.TextColor := GetRealColor(BorderColors[AObjectSelected, State = gcsSelected]); +end; + +procedure TcxGridDesignSelectorViewInfo.CreateRegion; +var + Points: array[1..3] of TPoint; +begin + Points[1] := Point(0, 0); + Points[2] := Point(Width, 0); + Points[3] := Point(0, Height); + FRegion := TcxRegion.Create(CreatePolygonRgn(Points, Length(Points), WINDING)); + FRegion.Offset(Bounds.Left, Bounds.Top); +end; + +procedure TcxGridDesignSelectorViewInfo.DestroyRegion; +begin + FreeAndNil(FRegion); +end; + +procedure TcxGridDesignSelectorViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + inherited; + DestroyRegion; + CreateRegion; +end; + +function TcxGridDesignSelectorViewInfo.HasPoint(const P: TPoint): Boolean; +begin + Result := Region.PtInRegion(P); +end; + +function TcxGridDesignSelectorViewInfo.MouseDown(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +begin + if AButton = mbLeft then + begin + GridView.Controller.DesignController.SelectObject(GridView, not (ssShift in AShift)); + Result := True; + end + else + Result := inherited MouseDown(AHitTest, AButton, AShift); +end; + +{ TcxCustomGridViewInfo } + +constructor TcxCustomGridViewInfo.Create(AGridView: TcxCustomGridView); +begin + inherited; + InitializeCriticalSection(FLock); + FActiveViewInfos := TList.Create; + FAllowCheckCoordinates := True; + FAllowHideSite := True; + CreateSite; + CreateViewInfos; +end; + +destructor TcxCustomGridViewInfo.Destroy; +begin + DestroySite; + FreeAndNil(FActiveViewInfos); + DeleteCriticalSection(FLock); + inherited; +end; + +function TcxCustomGridViewInfo.GetCalculated: Boolean; +begin + Result := not IsRectEmpty(Bounds); +end; + +function TcxCustomGridViewInfo.GetCanvas: TcxCanvas; +begin + Result := FSite.ActiveCanvas; +end; + +function TcxCustomGridViewInfo.GetClientBounds: TRect; +begin + if FClientBoundsAssigned then + Result := FClientBounds + else + Result := CalculateClientBounds; +end; + +function TcxCustomGridViewInfo.GetClientHeight: Integer; +begin + with ClientBounds do + Result := Bottom - Top; +end; + +function TcxCustomGridViewInfo.GetClientWidth: Integer; +begin + with ClientBounds do + Result := Right - Left; +end; + +{function TcxCustomGridViewInfo.GetIsCalculating: Boolean; +begin + Result := FIsCalculating or + GridView.IsDetail and GridView.MasterGridView.ViewInfo.IsCalculating; +end;} + +function TcxCustomGridViewInfo.GetIsInternalUseValue: Boolean; +begin + Result := GetIsInternalUse or + GridView.IsDetail and + (GridView.MasterGridView.ViewInfo <> nil) and + GridView.MasterGridView.ViewInfo.IsInternalUse; +end; + +procedure TcxCustomGridViewInfo.SetClientBounds(const Value: TRect); +begin + FClientBounds := Value; + FClientBoundsAssigned := True; +end; + +procedure TcxCustomGridViewInfo.CreateViewInfos; +begin + if GridView.IsDesigning then + FDesignSelectorViewInfo := GetDesignSelectorViewInfoClass.Create(Self); +end; + +procedure TcxCustomGridViewInfo.DestroyViewInfos(AIsRecreating: Boolean); +begin + FreeAndNil(FDesignSelectorViewInfo); +end; + +procedure TcxCustomGridViewInfo.RecreateViewInfos; +begin + FClientBoundsAssigned := False; + DestroyViewInfos(True); + CreateViewInfos; +end; + +function TcxCustomGridViewInfo.GetDesignSelectorViewInfoClass: TcxGridDesignSelectorViewInfoClass; +begin + Result := TcxGridDesignSelectorViewInfo; +end; + +function TcxCustomGridViewInfo.CanHideSite: Boolean; +var + AGrid: TcxCustomGrid; +begin + AGrid := TcxCustomGrid(Control); + Result := (Control = nil) or GridView.IsDestroying or + FAllowHideSite and not FSite.IsFocused and + ((AGrid.FocusedView = nil) or not FSite.ContainsControl(AGrid.FocusedView.Site)); +end; + +procedure TcxCustomGridViewInfo.CreateSite; +begin + FSite := GetSiteClass.Create(Self); +end; + +procedure TcxCustomGridViewInfo.DestroySite; +begin + FreeAndNil(FSite); +end; + +function TcxCustomGridViewInfo.GetSiteClass: TcxGridSiteClass; +begin + Result := TcxGridSite; +end; + +function TcxCustomGridViewInfo.GetSiteParent: TWinControl; +begin + if GridView.IsDetail then + Result := GridView.MasterGridView.Site + else + Result := Control; +end; + +procedure TcxCustomGridViewInfo.AddActiveViewInfo(AViewInfo: TObject); +begin + FActiveViewInfos.Add(AViewInfo); +end; + +function TcxCustomGridViewInfo.IsViewInfoActive(AViewInfo: TObject): Boolean; +begin + Result := FActiveViewInfos.IndexOf(AViewInfo) <> -1; +end; + +procedure TcxCustomGridViewInfo.RemoveActiveViewInfo(AViewInfo: TObject; + ARemoveAll: Boolean = False); +var + AIndex: Integer; +begin + repeat + AIndex := FActiveViewInfos.IndexOf(AViewInfo); + if AIndex = -1 then Break; + FActiveViewInfos.Delete(AIndex); + if not ARemoveAll then Break; + until False; +end; + +procedure TcxCustomGridViewInfo.AddScrollBarHeight(var AHeight: Integer); +begin + if Site.HScrollBarVisible then + Inc(AHeight, Site.HScrollBar.Height); +end; + +procedure TcxCustomGridViewInfo.AdjustClientBounds(var ABounds: TRect); +begin +end; + +procedure TcxCustomGridViewInfo.AfterCalculating; +begin + if not IsInternalUse then Controller.UpdateScrollBars(True); + if CanCheckCoordinates then Controller.DoCheckCoordinates; +end; + +procedure TcxCustomGridViewInfo.BeforeCalculating; +begin + UpdateMousePos; +end; + +procedure TcxCustomGridViewInfo.Calculate; +begin + if DesignSelectorViewInfo <> nil then + with GetDesignSelectorPos do + DesignSelectorViewInfo.Calculate(X, Y); +end; + +function TcxCustomGridViewInfo.CalculateClientBounds: TRect; +begin + Result := Bounds; +end; + +procedure TcxCustomGridViewInfo.CalculateHeight(const AMaxSize: TPoint; + var AHeight: Integer; var AFullyVisible: Boolean); +begin + AddScrollBarHeight(AHeight); +end; + +procedure TcxCustomGridViewInfo.CalculateWidth(const AMaxSize: TPoint; var AWidth: Integer); +begin + if Site.VScrollBarVisible then + Inc(AWidth, Site.VScrollBar.Width); + if AWidth > AMaxSize.X then AWidth := AMaxSize.X; +end; + +function TcxCustomGridViewInfo.CanCheckCoordinates: Boolean; +begin + Result := not IsInternalUse and FAllowCheckCoordinates; +end; + +procedure TcxCustomGridViewInfo.ControlFocusChanged; +begin +end; + +function TcxCustomGridViewInfo.DoGetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + Result := TcxGridViewNoneHitTest.Instance(P); + InitHitTest(Result); +end; + +function TcxCustomGridViewInfo.GetAllowBoundsChangedNotification: Boolean; +begin + Result := not IsCalculating and not VisibilityChanging; +end; + +function TcxCustomGridViewInfo.GetBackgroundBitmap: TBitmap; +begin {4} + Result := GridView.BackgroundBitmaps.GetBitmap(bbBackground); +end; + +function TcxCustomGridViewInfo.GetBackgroundColor: TColor; +var + AParams: TcxViewParams; +begin + GridView.Styles.GetViewParams(vsBackground, nil, nil, AParams); + Result := AParams.Color; +end; + +function TcxCustomGridViewInfo.GetDesignSelectorPos: TPoint; +begin + Result := Bounds.TopLeft; +end; + +procedure TcxCustomGridViewInfo.GetHScrollBarBounds(var ABounds: TRect); +begin +end; + +function TcxCustomGridViewInfo.GetIsInternalUse: Boolean; +begin + Result := FIsInternalUse; +end; + +function TcxCustomGridViewInfo.GetVisible: Boolean; +begin + Result := not IsInternalUse and not FSizeCalculating and + not GridView.DataController.IsUpdatingItems; +end; + +procedure TcxCustomGridViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + (AHitTest as TcxCustomGridViewHitTest).GridView := GridView; +end; + +procedure TcxCustomGridViewInfo.UpdateMousePos; +begin + if FSite.Left = cxGridInvisibleCoordinate then Exit; + if FSite.HandleAllocated and not FSite.IsDesigning then + FMousePos := FSite.ScreenToClient(GetMouseCursorPos) + else + FMousePos := Point(MaxInt, MaxInt); +end; + +procedure TcxCustomGridViewInfo.VisibilityChanged(AVisible: Boolean); +begin + UpdateMousePos; + if AVisible then + begin + FSite.Parent := GetSiteParent; + end + else + if CanHideSite then + begin + FSite.Parent := nil; + end + else + FSite.Left := cxGridInvisibleCoordinate; +end; + +procedure TcxCustomGridViewInfo.BeforeDestruction; +begin + inherited; + DestroyViewInfos(False); +end; + +procedure TcxCustomGridViewInfo.DoVisibilityChanged(AVisible: Boolean); +begin + if Visible then + begin + FVisibilityChanging := True; + try + VisibilityChanged(AVisible and GridView.Visible); + finally + FVisibilityChanging := False; + end; + end; +end; + +function TcxCustomGridViewInfo.GetFontHeight(AFont: TFont): Integer; +begin + Canvas.Font := AFont; + Result := Canvas.TextHeight('Qq'); +end; + +procedure TcxCustomGridViewInfo.GetFontMetrics(AFont: TFont; out AMetrics: TTextMetric); +begin + Canvas.Font := AFont; + GetTextMetrics(Canvas.Handle, AMetrics); +end; + +procedure TcxCustomGridViewInfo.GetHeight(const AMaxSize: TPoint; var AHeight: Integer; + var AFullyVisible: Boolean); +begin + FSizeCalculating := True; + CalculateHeight(AMaxSize, AHeight, AFullyVisible); + FSizeCalculating := False; +end; + +function TcxCustomGridViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + Result := nil; + if (Controller.CustomizationForm <> nil) and Site.HandleAllocated and + PtInRect(Controller.CustomizationForm.BoundsRect, Site.ClientToScreen(P)) then + begin + Result := TcxGridCustomizationFormHitTest.Instance(P); + InitHitTest(Result); + end + else + if DesignSelectorViewInfo <> nil then + Result := DesignSelectorViewInfo.GetHitTest(P); + if Result = nil then + Result := DoGetHitTest(P); +end; + +function TcxCustomGridViewInfo.GetHitTest(X, Y: Integer): TcxCustomGridHitTest; +begin + Result := GetHitTest(Point(X, Y)); +end; + +procedure TcxCustomGridViewInfo.GetWidth(const AMaxSize: TPoint; var AWidth: Integer); +begin + FSizeCalculating := True; + CalculateWidth(AMaxSize, AWidth); + FSizeCalculating := False; +end; + +procedure TcxCustomGridViewInfo.MainCalculate(const ABounds: TRect); + +//var ft,lt,i:integer; + +begin + if FIsCalculating {or GridView.IsPattern} then Exit; +{ + ft:=gettickcount; + for i:=1 to 1 + 9 * ord(not isinternaluse) do + begin +} + BeforeCalculating; + FIsCalculating := True; + try + FSite.BoundsRect := ABounds; + FBounds := FSite.ClientBounds; + Calculate; + finally + FIsCalculating := False; + AfterCalculating; + DoVisibilityChanged(True); + end; +{ + end; + lt:=gettickcount; + if not isinternaluse then + application.MainForm.Caption := inttostr(lt-ft) + ' - ' + application.MainForm.Caption; +} +end; + +procedure TcxCustomGridViewInfo.Recalculate; +begin + MainCalculate(FSite.BoundsRect); +end; + +{ TcxCustomGridViewInfoCacheItem } + +constructor TcxCustomGridViewInfoCacheItem.Create(AOwner: TcxCustomGridViewInfoCache; + AIndex: Integer); +begin + inherited Create; + FIndex := AIndex; + FOwner := AOwner; +end; + +procedure TcxCustomGridViewInfoCacheItem.UnassignValues(AKeepMaster: Boolean); +begin +end; + +{ TcxCustomGridViewInfoCache } + +constructor TcxCustomGridViewInfoCache.Create(AGridView: TcxCustomGridView); +begin + inherited; + FItems := TList.Create; +end; + +destructor TcxCustomGridViewInfoCache.Destroy; +begin + DestroyItems; + FItems.Free; + inherited; +end; + +function TcxCustomGridViewInfoCache.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxCustomGridViewInfoCache.GetInternalItem(Index: Integer): TcxCustomGridViewInfoCacheItem; +begin + Result := TcxCustomGridViewInfoCacheItem(FItems[Index]); +end; + +function TcxCustomGridViewInfoCache.GetItem(Index: Integer): TcxCustomGridViewInfoCacheItem; +begin + Result := InternalItems[Index]; + if Result = nil then + begin + Result := GetItemClass(Index).Create(Self, Index); + FItems[Index] := Result; + end; +end; + +procedure TcxCustomGridViewInfoCache.SetCount(Value: Integer); +begin + DestroyItems; + FItems.Count := Value; +end; + +procedure TcxCustomGridViewInfoCache.DestroyItems; +var + I: Integer; +begin + for I := 0 to Count - 1 do TObject(FItems[I]).Free; + FItems.Clear; +end; + +procedure TcxCustomGridViewInfoCache.UnassignValues(AKeepMaster: Boolean = False); + + procedure ProcessItems; + var + I: Integer; + AItem: TcxCustomGridViewInfoCacheItem; + begin + for I := 0 to Count - 1 do + begin + AItem := InternalItems[I]; + if AItem <> nil then AItem.UnassignValues(AKeepMaster); + end; + end; + + procedure ProcessMasterItems; + var + AGridView: TcxCustomGridView; + AGridRecordIndex: Integer; + begin + AGridView := GridView; + while AGridView.IsDetail do + begin + AGridRecordIndex := AGridView.MasterGridRecordIndex; + AGridView := AGridView.MasterGridView; + if (AGridRecordIndex <> -1) and (AGridView.ViewInfoCache <> nil) then + AGridView.ViewInfoCache[AGridRecordIndex].UnassignValues(False); + end; + end; + +begin + if FUnassigningValues then Exit; + FUnassigningValues := True; + try + ProcessItems; + if not AKeepMaster then ProcessMasterItems; + finally + FUnassigningValues := False; + end; +end; + +{ TcxCustomGridOptions } + +constructor TcxCustomGridOptions.Create(AGridView: TcxCustomGridView); +begin + inherited Create(nil); + FGridView := AGridView; + if GridView <> nil then GridView.AddOptions(Self); +end; + +destructor TcxCustomGridOptions.Destroy; +begin + if GridView <> nil then GridView.RemoveOptions(Self); + inherited; +end; + +function TcxCustomGridOptions.GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := GridView.LookAndFeelPainter; +end; + +procedure TcxCustomGridOptions.Changed(AChangeKind: TcxGridViewChangeKind); +begin + GridView.Changed(AChangeKind); +end; + +function TcxCustomGridOptions.GetGridViewValue: TcxCustomGridView; +begin + Result := FGridView; +end; + +procedure TcxCustomGridOptions.Notification(AComponent: TComponent; + AOperation: TOperation); +begin +end; + +procedure TcxCustomGridOptions.GetStoredProperties(AProperties: TStrings); +begin +end; + +procedure TcxCustomGridOptions.GetStoredPropertyValue(const AName: string; + var AValue: Variant); +begin +end; + +procedure TcxCustomGridOptions.SetStoredPropertyValue(const AName: string; + const AValue: Variant); +begin +end; + +procedure TcxCustomGridOptions.Assign(Source: TPersistent); +begin + if not (Source is TcxCustomGridOptions) then + inherited; +end; + +{ TcxCustomGridBackgroundBitmaps } + +constructor TcxCustomGridBackgroundBitmaps.Create(AGridView: TcxCustomGridView); +begin + inherited; + FItems := TList.Create; +end; + +destructor TcxCustomGridBackgroundBitmaps.Destroy; + + procedure ClearItems; + var + I: Integer; + begin + for I := 0 to Count - 1 do + if FItems[I] <> nil then TBitmap(FItems[I]).Free; + end; + +begin + ClearItems; + FItems.Free; + inherited; +end; + +function TcxCustomGridBackgroundBitmaps.GetCount: Integer; +begin + Result := FItems.Count; +end; + +procedure TcxCustomGridBackgroundBitmaps.BitmapChanged(Sender: TObject); +begin + Changed(vcLayout); +end; + +function TcxCustomGridBackgroundBitmaps.GetBitmapStyleIndex(Index: Integer): Integer; +begin + if Index = bbBackground then + Result := vsBackground + else + Result := -1; +end; + +function TcxCustomGridBackgroundBitmaps.GetDefaultBitmap(Index: Integer): TBitmap; +var + AStyleIndex: Integer; +begin + AStyleIndex := GetBitmapStyleIndex(Index); + if AStyleIndex = -1 then + Result := nil + else + Result := GridView.Styles.GetBitmap(AStyleIndex); +end; + +function TcxCustomGridBackgroundBitmaps.GetValue(Index: Integer): TBitmap; +begin + if Index >= Count then + FItems.Count := Index + 1; + if FItems[Index] = nil then + begin + FItems[Index] := TBitmap.Create; + TBitmap(FItems[Index]).OnChange := BitmapChanged; + end; + Result := TBitmap(FItems[Index]); +end; + +procedure TcxCustomGridBackgroundBitmaps.SetValue(Index: Integer; Value: TBitmap); +begin + Values[Index].Assign(Value); +end; + +procedure TcxCustomGridBackgroundBitmaps.Assign(Source: TPersistent); +begin + if Source is TcxCustomGridBackgroundBitmaps then + with TcxCustomGridBackgroundBitmaps(Source) do + Self.Background := Background; + inherited; +end; + +function TcxCustomGridBackgroundBitmaps.GetBitmap(Index: Integer): TBitmap; +begin + Result := Values[Index]; + if Result.Empty then + Result := GetDefaultBitmap(Index); +end; + +{ TcxCustomGridOptionsBehavior } + +constructor TcxCustomGridOptionsBehavior.Create(AGridView: TcxCustomGridView); +begin + inherited; + FPostponedSynchronization := True; +end; + +function TcxCustomGridOptionsBehavior.GetPostponedSynchronization: Boolean; +begin + if GridView.PatternGridView = GridView then + Result := FPostponedSynchronization + else + Result := GridView.PatternGridView.OptionsBehavior.PostponedSynchronization; +end; + +procedure TcxCustomGridOptionsBehavior.Assign(Source: TPersistent); +begin + if Source is TcxCustomGridOptionsBehavior then + PostponedSynchronization := TcxCustomGridOptionsBehavior(Source).PostponedSynchronization; + inherited; +end; + +{ TcxCustomGridOptionsView } + +function TcxCustomGridOptionsView.GetScrollBars: TScrollStyle; +begin + Result := GridView.Site.ScrollBars; +end; + +procedure TcxCustomGridOptionsView.SetScrollBars(Value: TScrollStyle); +begin + if ScrollBars <> Value then + begin + GridView.Site.ScrollBars := Value; + Changed(vcLayout); + end; +end; + +procedure TcxCustomGridOptionsView.Assign(Source: TPersistent); +begin + if Source is TcxCustomGridOptionsView then + with TcxCustomGridOptionsView(Source) do + Self.ScrollBars := ScrollBars; + inherited; +end; + +{ TcxCustomGridStyles } + +function TcxCustomGridStyles.GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := GridView.LookAndFeelPainter; +end; + +procedure TcxCustomGridStyles.Changed(AIndex: Integer); +begin + inherited; + if GridView <> nil then + begin + GridView.UpdateFakeLinks; + GridView.Changed(vcSize); + end; +end; + +procedure TcxCustomGridStyles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +var + AGrid: TcxCustomGrid; +begin + inherited; + AGrid := TcxCustomGrid(GridView.Control); + if AGrid = nil then + AParams.Font := GridView.Painter.Canvas.Font + else + AParams.Font := AGrid.Font; +end; + +procedure TcxCustomGridStyles.GetFakeComponentLinks(AList: TList); +var + I: Integer; + AOwner: TComponent; +begin + for I := 0 to Count - 1 do + begin + AOwner := Items[I].Item.Owner; + if (AOwner <> GridView.Owner) and (AList.IndexOf(AOwner) = -1) then + AList.Add(AOwner); + end; +end; + +{ TcxCustomGridViewStyles } + +procedure TcxCustomGridViewStyles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +begin + inherited; + with AParams, LookAndFeelPainter do + case Index of + vsBackground: + begin + Color := DefaultContentColor; + TextColor := clGrayText; + end; + end; +end; + +function TcxCustomGridViewStyles.GetGridView: TcxCustomGridView; +begin + if GetOwner is TcxCustomGridView then + Result := TcxCustomGridView(GetOwner) + else + Result := nil; +end; + +procedure TcxCustomGridViewStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxCustomGridViewStyles then + with TcxCustomGridViewStyles(Source) do + Self.Background := Background; +end; + +{ TcxGridListenerLink } + +constructor TcxGridListenerLink.Create(AGridView: TcxCustomGridView); +begin + inherited Create; + FGridView := AGridView; +end; + +destructor TcxGridListenerLink.Destroy; +begin + if FGridView <> nil then + FGridView.RemoveListenerLink(Self); + inherited Destroy; +end; + +procedure TcxGridListenerLink.Clear; +begin + FGridView := nil; +end; + +{ TcxCustomGridView } + +constructor TcxCustomGridView.CreateCloned(AControl: TcxControl); +begin + CreateEx(AControl); +{$IFDEF DELPHI6} + FComponentStyle := FComponentStyle + [csTransient]; +{$ENDIF} +end; + +destructor TcxCustomGridView.Destroy; +begin + Controller.Customization := False; + Focused := False; + if not IsPattern and (PatternGridView <> nil) then + PatternGridView.RemoveClone(Self); + if (FLevel <> nil) and (TcxGridLevel(FLevel).GridView = Self) then + TcxGridLevel(FLevel).GridView := nil; + if FRepository <> nil then + TcxGridViewRepositoryAccess(FRepository).RemoveItem(Self); {5} + DestroyHandlers; + DestroyOptions; + FClones.Free; + ClearListenerLinks; + FListenerLinks.Free; + inherited; +end; + +function TcxCustomGridView.GetClone(Index: Integer): TcxCustomGridView; +begin + Result := TcxCustomGridView(FClones[Index]); +end; + +function TcxCustomGridView.GetCloneCount: Integer; +begin + Result := FClones.Count; +end; + +function TcxCustomGridView.GetDragMode: TDragMode; +begin + Result := Site.DragMode; +end; + +function TcxCustomGridView.GetFocused: Boolean; +begin + Result := (Control <> nil){5} and (TcxCustomGrid(Control).FocusedView = Self); +end; + +function TcxCustomGridView.GetIsControlFocusedValue: Boolean; +var + AForm: TCustomForm; +begin + Result := not IsDesigning; + if Result then + begin + AForm := GetParentForm(Control); + if (AForm <> nil) and (TCustomFormAccess(AForm).FormStyle = fsMDIForm) then + Result := Control.IsFocused + else + Result := GetIsControlFocused; + end; +end; + +function TcxCustomGridView.GetIsDetail: Boolean; +begin + Result := (DataController <> nil) and DataController.IsDetailMode; +end; + +function TcxCustomGridView.GetIsMaster: Boolean; +begin + Result := (FLevel <> nil) and TcxGridLevel(FLevel).IsMaster; +end; + +function TcxCustomGridView.GetIsPattern: Boolean; +begin + Result := {(Level = nil) or }DataController.IsPattern; +end; + +function TcxCustomGridView.GetIsStoringNameMode: Boolean; +begin + Result := FStoringName <> ''; +end; + +function TcxCustomGridView.GetIsUpdating: Boolean; +begin + Result := csUpdating in ComponentState; +end; + +function TcxCustomGridView.GetLookAndFeel: TcxLookAndFeel; +begin + if Control = nil then + Result := nil + else + Result := TcxCustomGrid(Control).LookAndFeel; +end; + +function TcxCustomGridView.GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +begin + if Control = nil then + Result := TcxStandardLookAndFeelPainter + else + Result := TcxCustomGrid(Control).LookAndFeelPainter; +end; + +function TcxCustomGridView.GetMasterGridView: TcxCustomGridView; +begin + if IsDetail then + Result := (DataController.GetMasterDataController as IcxCustomGridDataController).GridView + else + Result := nil; +end; + +function TcxCustomGridView.GetMasterGridRecordIndex: Integer; +begin + if MasterRecordIndex <> -1 then + Result := MasterGridView.DataController.GetRowIndexByRecordIndex(MasterRecordIndex, False) + else + Result := -1; +end; + +function TcxCustomGridView.GetMasterRecordIndex: Integer; +begin + Result := DataController.GetMasterRecordIndex; +end; + +function TcxCustomGridView.GetOnDblClick: TNotifyEvent; +begin + Result := Site.OnDblClick; +end; + +function TcxCustomGridView.GetOnDragDrop: TDragDropEvent; +begin + Result := Site.OnDragDrop; +end; + +function TcxCustomGridView.GetOnDragOver: TDragOverEvent; +begin + Result := Site.OnDragOver; +end; + +function TcxCustomGridView.GetOnEndDrag: TEndDragEvent; +begin + Result := Site.OnEndDrag; +end; + +function TcxCustomGridView.GetOnKeyDown: TKeyEvent; +begin + Result := Site.OnKeyDown; +end; + +function TcxCustomGridView.GetOnKeyPress: TKeyPressEvent; +begin + Result := Site.OnKeyPress; +end; + +function TcxCustomGridView.GetOnKeyUp: TKeyEvent; +begin + Result := Site.OnKeyUp; +end; + +function TcxCustomGridView.GetOnMouseDown: TMouseEvent; +begin + Result := Site.OnMouseDown; +end; + +function TcxCustomGridView.GetOnMouseEnter: TNotifyEvent; +begin + Result := Site.OnMouseEnter; +end; + +function TcxCustomGridView.GetOnMouseLeave: TNotifyEvent; +begin + Result := Site.OnMouseLeave; +end; + +function TcxCustomGridView.GetOnMouseMove: TMouseMoveEvent; +begin + Result := Site.OnMouseMove; +end; + +function TcxCustomGridView.GetOnMouseUp: TMouseEvent; +begin + Result := Site.OnMouseUp; +end; + +function TcxCustomGridView.GetOnMouseWheel: TMouseWheelEvent; +begin + Result := Site.OnMouseWheel; +end; + +function TcxCustomGridView.GetOnMouseWheelDown: TMouseWheelUpDownEvent; +begin + Result := Site.OnMouseWheelDown; +end; + +function TcxCustomGridView.GetOnMouseWheelUp: TMouseWheelUpDownEvent; +begin + Result := Site.OnMouseWheelUp; +end; + +function TcxCustomGridView.GetOnStartDrag: TStartDragEvent; +begin + Result := Site.OnStartDrag; +end; + +function TcxCustomGridView.GetPatternGridView: TcxCustomGridView; +begin + Result := FPatternGridView; + if Result = nil then Result := Self; +end; + +function TcxCustomGridView.GetPopupMenu: TComponent; +begin + Result := Site.PopupMenu; +end; + +function TcxCustomGridView.GetSite: TcxGridSite; +begin + if FViewInfo = nil then + Result := nil + else + Result := FViewInfo.Site; +end; + +function TcxCustomGridView.GetSynchronization: Boolean; +begin + if PatternGridView = Self then + Result := FSynchronization + else + Result := PatternGridView.Synchronization; +end; + +procedure TcxCustomGridView.SetBackgroundBitmaps(Value: TcxCustomGridBackgroundBitmaps); +begin + FBackgroundBitmaps.Assign(Value); +end; + +procedure TcxCustomGridView.SetDragMode(Value: TDragMode); +begin + if DragMode <> Value then + begin + Site.DragMode := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetFocused(Value: Boolean); +begin + if Focused <> Value then + with TcxCustomGrid(Control) do + if Value then + FocusedView := Self + else + FocusedView := nil; +end; + +procedure TcxCustomGridView.SetIsRestoring(Value: Boolean); +begin + if FIsRestoring <> Value then + begin + FIsRestoring := Value; + if FIsRestoring then + BeforeRestoring + else + AfterRestoring; + end; +end; + +procedure TcxCustomGridView.SetSynchronization(Value: Boolean); +begin + if not IsPattern then Exit; + if FSynchronization <> Value then + begin + FSynchronization := Value; + if Value then + Synchronize + else + FSynchronizationNeeded := False; + end; +end; + +procedure TcxCustomGridView.SetOnCustomization(Value: TNotifyEvent); +begin + if @FOnCustomization <> @Value then + begin + FOnCustomization := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOnDblClick(Value: TNotifyEvent); +begin + if @OnDblClick <> @Value then + begin + Site.OnDblClick := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOnDragDrop(Value: TDragDropEvent); +begin + if @OnDragDrop <> @Value then + begin + Site.OnDragDrop := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOnDragOver(Value: TDragOverEvent); +begin + if @OnDragOver <> @Value then + begin + Site.OnDragOver := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOnEndDrag(Value: TEndDragEvent); +begin + if @OnEndDrag <> @Value then + begin + Site.OnEndDrag := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOnGetStoredProperties(Value: TcxGridViewGetStoredPropertiesEvent); +begin + if @FOnGetStoredProperties <> @Value then + begin + FOnGetStoredProperties := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOnGetStoredPropertyValue(Value: TcxGridViewGetStoredPropertyValueEvent); +begin + if @FOnGetStoredPropertyValue <> @Value then + begin + FOnGetStoredPropertyValue := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOnInitStoredObject(Value: TcxGridInitStoredObjectEvent); +begin + if @FOnInitStoredObject <> @Value then + begin + FOnInitStoredObject := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOnKeyDown(Value: TKeyEvent); +begin + if @OnKeyDown <> @Value then + begin + Site.OnKeyDown := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOnKeyPress(Value: TKeyPressEvent); +begin + if @OnKeyPress <> @Value then + begin + Site.OnKeyPress := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOnKeyUp(Value: TKeyEvent); +begin + if @OnKeyUp <> @Value then + begin + Site.OnKeyUp := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOnMouseDown(Value: TMouseEvent); +begin + if @OnMouseDown <> @Value then + begin + Site.OnMouseDown := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOnMouseEnter(Value: TNotifyEvent); +begin + if @OnMouseEnter <> @Value then + begin + Site.OnMouseEnter := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOnMouseLeave(Value: TNotifyEvent); +begin + if @OnMouseLeave <> @Value then + begin + Site.OnMouseLeave := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOnMouseMove(Value: TMouseMoveEvent); +begin + if @OnMouseMove <> @Value then + begin + Site.OnMouseMove := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOnMouseUp(Value: TMouseEvent); +begin + if @OnMouseUp <> @Value then + begin + Site.OnMouseUp := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOnMouseWheel(Value: TMouseWheelEvent); +begin + if @OnMouseWheel <> @Value then + begin + Site.OnMouseWheel := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOnMouseWheelDown(Value: TMouseWheelUpDownEvent); +begin + if @OnMouseWheelDown <> @Value then + begin + Site.OnMouseWheelDown := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOnMouseWheelUp(Value: TMouseWheelUpDownEvent); +begin + if @OnMouseWheelUp <> @Value then + begin + Site.OnMouseWheelUp := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOnSetStoredPropertyValue(Value: TcxGridViewSetStoredPropertyValueEvent); +begin + if @FOnSetStoredPropertyValue <> @Value then + begin + FOnSetStoredPropertyValue := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOnStartDrag(Value: TStartDragEvent); +begin + if @OnStartDrag <> @Value then + begin + Site.OnStartDrag := Value; + Changed(vcProperty); + end; +end; + +procedure TcxCustomGridView.SetOptionsBehavior(Value: TcxCustomGridOptionsBehavior); +begin + FOptionsBehavior.Assign(Value); +end; + +procedure TcxCustomGridView.SetOptionsData(Value: TcxCustomGridOptionsData); +begin + FOptionsData.Assign(Value); +end; + +procedure TcxCustomGridView.SetOptionsSelection(Value: TcxCustomGridOptionsSelection); +begin + FOptionsSelection.Assign(Value); +end; + +procedure TcxCustomGridView.SetOptionsView(Value: TcxCustomGridOptionsView); +begin + FOptionsView.Assign(Value); +end; + +procedure TcxCustomGridView.SetPopupMenu(Value: TComponent); +begin + if PopupMenu <> Value then + begin + Site.PopupMenu := Value; + Changed(vcProperty) + end; +end; + +procedure TcxCustomGridView.SetStyles(Value: TcxCustomGridStyles); +begin + FStyles.Assign(Value); +end; + +procedure TcxCustomGridView.ClearListenerLinks; +var + I: Integer; +begin + for I := FListenerLinks.Count - 1 downto 0 do + RemoveListenerLink(TcxGridListenerLink(FListenerLinks[I])); +end; + +function TcxCustomGridView.GetObjectName: string; +begin + if IsStoringNameMode then + Result := FStoringName + else + Result := Name; +end; + +function TcxCustomGridView.GetProperties(AProperties: TStrings): Boolean; +begin + AProperties.Add('Version'); + if Assigned(FOnGetStoredProperties) then + FOnGetStoredProperties(Self, AProperties); + Result := True; +end; + +procedure TcxCustomGridView.GetPropertyValue(const AName: string; var AValue: Variant); +begin + if AName = 'Version' then + AValue := StoringVersion; + if Assigned(FOnGetStoredPropertyValue) then + FOnGetStoredPropertyValue(Self, AName, AValue); +end; + +procedure TcxCustomGridView.SetPropertyValue(const AName: string; const AValue: Variant); +begin + if AName = 'Version' then + FStoredVersion := AValue; + if Assigned(FOnSetStoredPropertyValue) then + FOnSetStoredPropertyValue(Self, AName, AValue); +end; + +function TcxCustomGridView.CreateChild(const AObjectName, AClassName: string): TObject; +begin + Result := CreateStoredObject(AObjectName, AClassName); + if not IsStoringNameMode and (Result is TComponent) then + TComponent(Result).Name := AObjectName; + DoInitStoredObject(Result); +end; + +function TcxCustomGridView.CreateStoredObject(const AObjectName, AClassName: string): TObject; +begin + Result := nil; +end; + +procedure TcxCustomGridView.DeleteChild(const AObjectName: string; AObject: TObject); +begin + AObject.Free; +end; + +procedure TcxCustomGridView.GetStoredChildren(AChildren: TStringList); +begin +end; + +procedure TcxCustomGridView.AssignLayout(ALayoutView: TcxCustomGridView); +begin +end; + +procedure TcxCustomGridView.BeforeEditLayout(ALayoutView: TcxCustomGridView); +begin +end; + +procedure TcxCustomGridView.DoAssignLayout(ALayoutView: TcxCustomGridView); +begin + BeginUpdate; + try + AssignLayout(ALayoutView); + finally + EndUpdate; + end; +end; + +function TcxCustomGridView.GetLayoutCustomizationFormButtonCaption: string; +begin + Result := ''; +end; + +function TcxCustomGridView.HasLayoutCustomizationForm: Boolean; +begin + Result := False; +end; + +function TcxCustomGridView.IsLayoutChangeable: Boolean; +begin + Result := True; +end; + +procedure TcxCustomGridView.RunLayoutCustomizationForm; +begin + Controller.Customization := True; +end; + +procedure TcxCustomGridView.GetFakeComponentLinks(AList: TList); +begin + inherited; + (FDataController as IcxCustomGridDataController).GetFakeComponentLinks(AList); + FStyles.GetFakeComponentLinks(AList); +end; + +function TcxCustomGridView.GetIsDestroying: Boolean; +begin + Result := inherited GetIsDestroying or + IsDetail and MasterGridView.IsDestroying; +end; + +procedure TcxCustomGridView.Loaded; +begin + inherited; + LoadingComplete; + DataController.Loaded; + Init; +end; + +procedure TcxCustomGridView.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited; + NotifyOptions(AComponent, Operation); +end; + +procedure TcxCustomGridView.SetControl(Value: TcxControl); +begin + if Control <> Value then + begin + if Control <> nil then + begin + TcxCustomGrid(Control).RemoveFontListener(FStyles); {5} + if Control.IsDesigning and (Site <> nil) then + Control.RemoveComponent(Site); + end; + inherited; + if Control <> nil then + begin + if (FStorageControl = nil) and (FRepository = nil) then + FStorageControl := Value; + if Control.IsDesigning then + Control.InsertComponent(Site); + TcxCustomGrid(Control).AddFontListener(FStyles); + end; + end; +end; + +procedure TcxCustomGridView.SetName(const NewName: TComponentName); +begin + inherited; + NotifyControl(vcnName); +end; + +procedure TcxCustomGridView.Updated; +begin + inherited; + EndUpdate; +end; + +procedure TcxCustomGridView.Updating; +begin + BeginUpdate; + inherited; +end; + +procedure TcxCustomGridView.CreateHandlers; +begin + FController := GetControllerClass.Create(Self); + FDataController := GetDataControllerClass.Create(Self); + InitDataController; + FPainter := GetPainterClass.Create(Self); + FViewData := GetViewDataClass.Create(Self); + FViewInfo := CreateViewInfo; + if GetViewInfoCacheClass <> nil then + FViewInfoCache := GetViewInfoCacheClass.Create(Self); +end; + +procedure TcxCustomGridView.DestroyHandlers; +begin + FDataController.Free; + FDataController := nil; +// FreeAndNil(FViewInfoCache); + if (Control <> nil) and Control.IsDesigning then + Control.RemoveComponent(Site); + FViewInfo.Free; + FViewInfo := nil; + FreeAndNil(FViewInfoCache); + FreeAndNil(FViewData); + FreeAndNil(FPainter); + FreeAndNil(FController); +end; + +procedure TcxCustomGridView.InitDataController; +begin + FDataController.OnUpdateControl := UpdateControl; +end; + +procedure TcxCustomGridView.CreateOptions; +begin + FOptionsList := TList.Create; + FBackgroundBitmaps := GetBackgroundBitmapsClass.Create(Self); + FOptionsBehavior := GetOptionsBehaviorClass.Create(Self); + FOptionsData := GetOptionsDataClass.Create(Self); + FOptionsSelection := GetOptionsSelectionClass.Create(Self); + FOptionsView := GetOptionsViewClass.Create(Self); + FStyles := GetStylesClass.Create(Self); +end; + +procedure TcxCustomGridView.DestroyOptions; +begin + if Control <> nil then {5} + TcxCustomGrid(Control).RemoveFontListener(FStyles); + FreeAndNil(FStyles); + FreeAndNil(FOptionsView); + FreeAndNil(FOptionsSelection); + FreeAndNil(FOptionsData); + FreeAndNil(FOptionsBehavior); + FreeAndNil(FBackgroundBitmaps); + FreeAndNil(FOptionsList); +end; + +procedure TcxCustomGridView.AddOptions(AOptions: TcxCustomGridOptions); +begin + FOptionsList.Add(AOptions); +end; + +procedure TcxCustomGridView.RemoveOptions(AOptions: TcxCustomGridOptions); +begin + FOptionsList.Remove(AOptions); +end; + +procedure TcxCustomGridView.NotifyOptions(AComponent: TComponent; + AOperation: TOperation); +var + I: Integer; +begin + if FOptionsList = nil then Exit; + for I := 0 to FOptionsList.Count - 1 do + TcxCustomGridOptions(FOptionsList[I]).Notification(AComponent, AOperation); +end; + +procedure TcxCustomGridView.AddClone(AClone: TcxCustomGridView); +begin + FClones.Add(AClone); + AClone.FPatternGridView := Self; +end; + +procedure TcxCustomGridView.RemoveClone(AClone: TcxCustomGridView); +begin + FClones.Remove(AClone); + AClone.FPatternGridView := nil; +end; + +function TcxCustomGridView.AddListenerLink: TcxGridListenerLink; +begin + Result := TcxGridListenerLink.Create(Self); + FListenerLinks.Add(Result); +end; + +procedure TcxCustomGridView.RemoveListenerLink(ALink: TcxGridListenerLink); +begin + ALink.Clear; + FListenerLinks.Remove(ALink); +end; + +procedure TcxCustomGridView.Synchronize(ACheckUpdateLock: Boolean = True); +var + I: Integer; +begin + if IsLoading or IsDestroying or (Control = nil) or + not IsSynchronization or FAssigningPattern or FSynchronizationAssignNeeded then + Exit; + if ACheckUpdateLock and IsUpdateLocked then + begin + FSynchronizationNeeded := True; + Exit; + end; + FIsSynchronizing := True; + try + if IsPattern then + begin + BeginUpdate; + try + for I := 0 to CloneCount - 1 do + Clones[I].Synchronize(Self); + finally + EndUpdate; + end; + end + else + PatternGridView.Synchronize(Self); + finally + FIsSynchronizing := False; + FSynchronizationNeeded := False; + end; +end; + +procedure TcxCustomGridView.Synchronize(AView: TcxCustomGridView); +begin + if not IsSynchronization or FIsSynchronizing or FAssigningPattern then Exit; + if OptionsBehavior.PostponedSynchronization and not IsPattern and not Visible then + begin + FSynchronizationAssignNeeded := True; + Exit; + end; + BeginUpdate; + try + AssignPattern(AView); + if IsPattern then Synchronize; + finally + EndUpdate; + FSynchronizationAssignNeeded := False; + end; +end; + +procedure TcxCustomGridView.AssignPattern(APattern: TcxCustomGridView); +begin + FAssigningPattern := True; + try + Assign(APattern); + finally + FAssigningPattern := False; + end; +end; + +procedure TcxCustomGridView.BeforeAssign(ASource: TcxCustomGridView); +begin + if not AssigningSettings then + DataController.Assign(ASource.DataController); +end; + +procedure TcxCustomGridView.DoAssign(ASource: TcxCustomGridView); +begin + with ASource do + begin + Self.BackgroundBitmaps := BackgroundBitmaps; + Self.DragMode := DragMode; + Self.OptionsBehavior := OptionsBehavior; + Self.OptionsData := OptionsData; + Self.OptionsSelection := OptionsSelection; + Self.OptionsView := OptionsView; + Self.PopupMenu := PopupMenu; + Self.Styles := Styles; + Self.Synchronization := Synchronization; + Self.OnCustomization := OnCustomization; + Self.OnDblClick := OnDblClick; + Self.OnDragDrop := OnDragDrop; + Self.OnDragOver := OnDragOver; + Self.OnEndDrag := OnEndDrag; + Self.OnGetStoredProperties := OnGetStoredProperties; + Self.OnGetStoredPropertyValue := OnGetStoredPropertyValue; + Self.OnInitStoredObject := OnInitStoredObject; + Self.OnKeyDown := OnKeyDown; + Self.OnKeyPress := OnKeyPress; + Self.OnKeyUp := OnKeyUp; + Self.OnMouseDown := OnMouseDown; + Self.OnMouseEnter := OnMouseEnter; + Self.OnMouseLeave := OnMouseLeave; + Self.OnMouseMove := OnMouseMove; + Self.OnMouseUp := OnMouseUp; + Self.OnMouseWheel := OnMouseWheel; + Self.OnMouseWheelDown := OnMouseWheelDown; + Self.OnMouseWheelUp := OnMouseWheelUp; + Self.OnSetStoredPropertyValue := OnSetStoredPropertyValue; + Self.OnStartDrag := OnStartDrag; + Self.Init; + end +end; + +procedure TcxCustomGridView.DoAssignSettings(ASource: TcxCustomGridView); +begin + Assign(ASource); +end; + +procedure TcxCustomGridView.AfterAssign(ASource: TcxCustomGridView); +begin + if not AssigningSettings then + DataController.Assign(ASource.DataController); +end; + +procedure TcxCustomGridView.BeforeRestoring; +begin +end; + +procedure TcxCustomGridView.AfterRestoring; +begin + RestoringComplete; +end; + +{procedure TcxCustomGridView.BeforeLevelChange; +begin +end;} + +function TcxCustomGridView.CanTabStop: Boolean; +begin + Result := TcxCustomGrid(Control).TabStop; +end; + +procedure TcxCustomGridView.DetailDataChanged(ADetail: TcxCustomGridView); +begin +end; + +procedure TcxCustomGridView.DetailVisibleChanged(ADetailLevel: TComponent; + APrevVisibleDetailCount, AVisibleDetailCount: Integer); +begin +end; + +procedure TcxCustomGridView.DoChanged(AChangeKind: TcxGridViewChangeKind); +begin + if Controller <> nil then Controller.GridViewChanged; +end; + +function TcxCustomGridView.GetChangeable: Boolean; +begin + Result := (Visible or IsPattern) and (Control <> nil); +end; + +function TcxCustomGridView.GetCustomVisible(ALevelVisible: Boolean): Boolean; +begin + Result := ALevelVisible and not IsPattern and + (not IsDetail or MasterGridView.Visible and MasterGridView.IsDetailVisible(Self)); +end; + +function TcxCustomGridView.GetIsControlFocused: Boolean; +begin + Result := Control.IsFocused; +end; + +function TcxCustomGridView.GetResizeOnBoundsChange: Boolean; +begin + Result := False; +end; + +function TcxCustomGridView.GetVisible: Boolean; +begin + Result := not IsDestroying and + GetCustomVisible((FLevel <> nil) and TcxGridLevel(FLevel).ActuallyVisible); +end; + +procedure TcxCustomGridView.Init; +begin +end; + +function TcxCustomGridView.IsDetailVisible(AGridView: TcxCustomGridView): Boolean; +begin + Result := False; +end; + +procedure TcxCustomGridView.LoadingComplete; +begin + SizeChanged; +end; + +procedure TcxCustomGridView.NotifyControl(AChangeKind: TcxGridViewChangeNotificationKind); +begin + if Control <> nil then + TcxCustomGridAccess(Control).ViewChanged(Self, AChangeKind); +end; + +procedure TcxCustomGridView.RestoringComplete; +begin +end; + +procedure TcxCustomGridView.SetLevel(Value: TComponent); +begin + if FLevel <> Value then + begin + //BeforeLevelChange; + FLevel := Value; + Site.InitTabStop(Site.Parent); + end; +end; + +procedure TcxCustomGridView.SetTabStop(Value: Boolean); +begin + Site.TabStop := Value and CanTabStop; +end; + +procedure TcxCustomGridView.UpdateControl(AInfo: TcxUpdateControlInfo); +begin + if not (IsLoading or IsDestroying or IsPattern) and (AInfo is TcxDataChangedInfo) then + if IsDetail then + if (MasterGridView <> nil) and not MasterGridView.IsUpdateLocked and + (MasterGridView.DataController.LockCount = 0) and + (PatternGridView <> nil) and PatternGridView.HasAsClone(Self) then + MasterGridView.DetailDataChanged(Self) + else + else + if Control <> nil then // ext lookup editor + TcxCustomGrid(Control).RootViewDataChanged(Self); +end; + +function TcxCustomGridView.GetViewInfoCacheClass: TcxCustomGridViewInfoCacheClass; +begin + Result := nil; +end; + +function TcxCustomGridView.GetBackgroundBitmapsClass: TcxCustomGridBackgroundBitmapsClass; +begin + Result := TcxCustomGridBackgroundBitmaps; +end; + +function TcxCustomGridView.GetOptionsBehaviorClass: TcxCustomGridOptionsBehaviorClass; +begin + Result := TcxCustomGridOptionsBehavior; +end; + +function TcxCustomGridView.GetOptionsDataClass: TcxCustomGridOptionsDataClass; +begin + Result := TcxCustomGridOptionsData; +end; + +function TcxCustomGridView.GetOptionsSelectionClass: TcxCustomGridOptionsSelectionClass; +begin + Result := TcxCustomGridOptionsSelection; +end; + +function TcxCustomGridView.GetOptionsViewClass: TcxCustomGridOptionsViewClass; +begin + Result := TcxCustomGridOptionsView; +end; + +function TcxCustomGridView.GetStylesClass: TcxCustomGridViewStylesClass; +begin + Result := TcxCustomGridViewStyles; +end; + +procedure TcxCustomGridView.Initialize; +begin + inherited Initialize; + FListenerLinks := TList.Create; + FClones := TList.Create; + FSynchronization := True; + CreateOptions; + CreateHandlers; +end; + +procedure TcxCustomGridView.RefreshCustomizationForm; +begin + if Controller <> nil then + Controller.RefreshCustomizationForm; +end; + +procedure TcxCustomGridView.DoCustomization; +begin + if Assigned(FOnCustomization) then FOnCustomization(Self); +end; + +procedure TcxCustomGridView.DoInitStoredObject(AObject: TObject); +begin + if (AObject <> nil) and Assigned(FOnInitStoredObject) then + FOnInitStoredObject(Self, AObject); +end; + +procedure TcxCustomGridView.Assign(Source: TPersistent); +begin + if Source is TcxCustomGridView then + begin + BeginUpdate; + try + BeforeAssign(TcxCustomGridView(Source)); + DoAssign(TcxCustomGridView(Source)); + AfterAssign(TcxCustomGridView(Source)); + finally + EndUpdate; + end; + end + else + inherited; +end; + +procedure TcxCustomGridView.AssignSettings(ASource: TcxCustomGridView); +begin + FAssigningSettings := True; + try + DoAssignSettings(ASource); + finally + FAssigningSettings := False; + end; +end; + +function TcxCustomGridView.CanFocus: Boolean; +begin + Result := GetCustomVisible((FLevel <> nil) and TcxGridLevel(FLevel).CanBeVisible); +end; + +function TcxCustomGridView.GetParentComponent: TComponent; +begin {5} + Result := FStorageControl; + if Result = nil then + Result := FRepository; +end; + +function TcxCustomGridView.HasParent: Boolean; +begin {5} + Result := (FStorageControl <> nil) or (FRepository <> nil); +end; + +function TcxCustomGridView.HasAsClone(AGridView: TcxCustomGridView): Boolean; +begin + Result := FClones.IndexOf(AGridView) <> -1; +end; + +function TcxCustomGridView.HasAsMaster(AGridView: TcxCustomGridView): Boolean; +begin + Result := (MasterGridView = AGridView) or + (MasterGridView <> nil) and MasterGridView.HasAsMaster(AGridView); +end; + +procedure TcxCustomGridView.Invalidate(AHardUpdate: Boolean = False); +var + I: Integer; +begin + if IsPattern then + for I := 0 to CloneCount - 1 do + Clones[I].Invalidate(AHardUpdate) + else + if AHardUpdate then + LayoutChanged + else + ViewChanged; +end; + +procedure TcxCustomGridView.RestoreDefaults; +begin +end; + +procedure TcxCustomGridView.SetParentComponent(Value: TComponent); +begin {5} + inherited; + if Value is TcxGridViewRepository then + TcxGridViewRepositoryAccess(Value).AddItem(Self); +end; + +procedure TcxCustomGridView.CheckSynchronizationAssignNeeded; +begin + if FSynchronizationAssignNeeded then + begin + BeginUpdate; + try + Synchronize(PatternGridView); + finally + CancelUpdate; + end; + end; +end; + +function TcxCustomGridView.IsSynchronization: Boolean; +begin + Result := Synchronization or IsDesigning; +end; + +procedure TcxCustomGridView.BeginUpdate; +begin + if Control <> nil then + TcxCustomGrid(Control).BeginUpdate; + Inc(FUpdateLockCount); + if DataController <> nil then + DataController.BeginUpdate; +end; + +procedure TcxCustomGridView.CancelUpdate; +begin + try + if DataController <> nil then + DataController.EndUpdate; + if IsUpdateLocked then + begin + Dec(FUpdateLockCount); + if not IsUpdateLocked then + FSynchronizationNeeded := False; + end; + finally + if Control <> nil then {5} + TcxCustomGrid(Control).CancelUpdate; + end; +end; + +function TcxCustomGridView.Changed(AGridChange: TObject): Boolean; +begin + Result := True; + if IsLoading or IsDestroying {or IsPattern} or + (FViewInfo = nil) or FViewInfo.IsCalculating then + begin + AGridChange.Free; + Result := False; + end + else + if Control = nil{5} then + try + with AGridChange as TcxCustomGridChange do {7} + begin + Control := nil; + Execute; + end + finally + AGridChange.Free; + end + else + TcxCustomGrid(Control).Changed(AGridChange as TcxCustomGridChange); +end; + +procedure TcxCustomGridView.EndUpdate; +begin + try + if DataController <> nil then + DataController.EndUpdate; + if IsUpdateLocked then + begin + if (FUpdateLockCount = 1) and FSynchronizationNeeded then + Synchronize(False); + Dec(FUpdateLockCount); + end; + finally + if Control <> nil then + TcxCustomGrid(Control).EndUpdate; + end; +end; + +function TcxCustomGridView.IsUpdateLocked: Boolean; +begin + Result := FUpdateLockCount > 0; +end; + +function TcxCustomGridView.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + Result := ViewInfo.GetHitTest(P); +end; + +function TcxCustomGridView.GetHitTest(X, Y: Integer): TcxCustomGridHitTest; +begin + Result := ViewInfo.GetHitTest(X, Y); +end; + +procedure TcxCustomGridView.BoundsChanged(AUpdateSelfOnly: Boolean = False; + AKeepMaster: Boolean = False); +begin + if ResizeOnBoundsChange then + SizeChanged(AUpdateSelfOnly, AKeepMaster) + else + LayoutChanged(AUpdateSelfOnly); +end; + +procedure TcxCustomGridView.Changed(AChangeKind: TcxGridViewChangeKind); +begin + if (DataController <> nil) and DataController.IsDataLoading then Exit; + BeginUpdate; + try + case AChangeKind of + vcLayout: + LayoutChanged; + vcSize: + SizeChanged; + end; + Synchronize; + finally + EndUpdate; + end; + DoChanged(AChangeKind); +end; + +procedure TcxCustomGridView.FocusChanged(AFocused: Boolean); +begin + if AFocused then + begin + DataController.SetFocus; + Controller.DoSetFocus(True); + end + else + Controller.RemoveFocus; +end; + +procedure TcxCustomGridView.LayoutChanged(AUpdateSelfOnly: Boolean = True); + + function GetParameter: TcxCustomGridView; + begin + if AUpdateSelfOnly then + Result := Self + else + Result := nil; + end; + +begin + Changed(TcxGridLayoutChange.Create(GetParameter)); +end; + +procedure TcxCustomGridView.LookAndFeelChanged; +var + I: Integer; +begin + for I := 0 to CloneCount - 1 do + Clones[I].LookAndFeelChanged; +end; + +function TcxCustomGridView.SizeChanged(AUpdateSelfOnly: Boolean = False; + AKeepMaster: Boolean = False): Boolean; +begin + Result := Changed(TcxGridSizeChange.Create(Self, + AUpdateSelfOnly or (Control = nil){7}, AKeepMaster)); +end; + +procedure TcxCustomGridView.ViewChanged; +begin + Changed(TcxGridViewChange.Create(Self)); +end; + +procedure TcxCustomGridView.ViewChanged(const AUpdateRect: TRect); +begin + if not IsRectEmpty(AUpdateRect) then + Changed(TcxGridViewChange.Create(Self, AUpdateRect)); +end; + +procedure TcxCustomGridView.ViewChanged(ARegion: TcxRegion); +begin + if (ARegion <> nil) and not ARegion.IsEmpty then + Changed(TcxGridViewChange.Create(Self, ARegion)); +end; + +procedure TcxCustomGridView.RestoreFromIniFile(const AStorageName: string; + AChildrenCreating, AChildrenDeleting: Boolean; AOptions: TcxGridStorageOptions; + const ARestoreViewName: string); +var + AStorage: TcxStorage; + AModes: TcxStorageModes; +begin + FStoringName := ARestoreViewName; + AStorage := TcxStorage.Create(AStorageName); + try + if not IsStoringNameMode then + AStorage.NamePrefix := Owner.Name; + FStorageOptions := AOptions; + AModes := []; + if AChildrenCreating then + Include(AModes, smChildrenCreating); + if AChildrenDeleting then + Include(AModes, smChildrenDeleting); + AStorage.Modes := AModes; + BeginUpdate; + try + IsRestoring := True; + try + AStorage.RestoreFromIni(Self); + finally + IsRestoring := False; + end; + finally + EndUpdate; + end; + finally + AStorage.Free; + end; +end; + +procedure TcxCustomGridView.RestoreFromRegistry(const AStorageName: string; + AChildrenCreating, AChildrenDeleting: Boolean; AOptions: TcxGridStorageOptions; + const ARestoreViewName: string); +var + AStorage: TcxStorage; + AModes: TcxStorageModes; +begin + FStoringName := ARestoreViewName; + AStorage := TcxStorage.Create(AStorageName); + try + if not IsStoringNameMode then + AStorage.NamePrefix := Owner.Name; + FStorageOptions := AOptions; + AModes := []; + if AChildrenCreating then + Include(AModes, smChildrenCreating); + if AChildrenDeleting then + Include(AModes, smChildrenDeleting); + AStorage.Modes := AModes; + BeginUpdate; + try + IsRestoring := True; + try + AStorage.RestoreFromRegistry(Self); + finally + IsRestoring := False; + end; + finally + EndUpdate; + end; + finally + AStorage.Free; + end; +end; + +procedure TcxCustomGridView.RestoreFromStream(AStream: TStream; + AChildrenCreating, AChildrenDeleting: Boolean; AOptions: TcxGridStorageOptions; + const ARestoreViewName: string); +var + AStorage: TcxStorage; + AModes: TcxStorageModes; +begin + FStoringName := ARestoreViewName; + AStorage := TcxStorage.Create(AStream); + try + if not IsStoringNameMode then + AStorage.NamePrefix := Owner.Name; + FStorageOptions := AOptions; + AModes := []; + if AChildrenCreating then + Include(AModes, smChildrenCreating); + if AChildrenDeleting then + Include(AModes, smChildrenDeleting); + AStorage.Modes := AModes; + BeginUpdate; + try + IsRestoring := True; + try + AStorage.RestoreFromStream(Self); + finally + IsRestoring := False; + end; + finally + EndUpdate; + end; + finally + AStorage.Free; + end; +end; + +procedure TcxCustomGridView.RestoreFromStorage(const AStorageName: string; + AReaderClass: TcxCustomReaderClass; AChildrenCreating, AChildrenDeleting: Boolean; + AOptions: TcxGridStorageOptions; const ARestoreViewName: string); +var + AStorage: TcxStorage; + AModes: TcxStorageModes; +begin + FStoringName := ARestoreViewName; + AStorage := TcxStorage.Create(AStorageName); + try + if not IsStoringNameMode then + AStorage.NamePrefix := Owner.Name; + FStorageOptions := AOptions; + AModes := []; + if AChildrenCreating then + Include(AModes, smChildrenCreating); + if AChildrenDeleting then + Include(AModes, smChildrenDeleting); + AStorage.Modes := AModes; + BeginUpdate; + try + IsRestoring := True; + try + AStorage.RestoreFrom(Self, AReaderClass); + finally + IsRestoring := False; + end; + finally + EndUpdate; + end; + finally + AStorage.Free; + end; +end; + +procedure TcxCustomGridView.StoreToIniFile(const AStorageName: string; AReCreate: Boolean; + AOptions: TcxGridStorageOptions; const ASaveViewName: string); +var + AStorage: TcxStorage; +begin + FStoringName := ASaveViewName; + AStorage := TcxStorage.Create(AStorageName); + try + FStorageOptions := AOptions; + if ASaveViewName = '' then + AStorage.NamePrefix := Owner.Name; + AStorage.ReCreate := AReCreate; + AStorage.StoreToIni(Self); + finally + AStorage.Free; + end; +end; + +procedure TcxCustomGridView.StoreToRegistry(const AStorageName: string; AReCreate: Boolean; + AOptions: TcxGridStorageOptions; const ASaveViewName: string); +var + AStorage: TcxStorage; +begin + FStoringName := ASaveViewName; + AStorage := TcxStorage.Create(AStorageName); + try + FStorageOptions := AOptions; + if ASaveViewName = '' then + AStorage.NamePrefix := Owner.Name; + AStorage.ReCreate := AReCreate; + AStorage.StoreToRegistry(Self); + finally + AStorage.Free; + end; +end; + +procedure TcxCustomGridView.StoreToStream(AStream: TStream; AOptions: TcxGridStorageOptions; + const ASaveViewName: string); +var + AStorage: TcxStorage; +begin + FStoringName := ASaveViewName; + AStorage := TcxStorage.Create(AStream); + try + FStorageOptions := AOptions; + if ASaveViewName = '' then + AStorage.NamePrefix := Owner.Name; + AStorage.StoreToStream(Self); + finally + AStorage.Free; + end; +end; + +procedure TcxCustomGridView.StoreToStorage(const AStorageName: string; + AWriterClass: TcxCustomWriterClass; AReCreate: Boolean; + AOptions: TcxGridStorageOptions; const ASaveViewName: string); +var + AStorage: TcxStorage; +begin + FStoringName := ASaveViewName; + AStorage := TcxStorage.Create(AStorageName); + try + FStorageOptions := AOptions; + if ASaveViewName = '' then + AStorage.NamePrefix := Owner.Name; + AStorage.ReCreate := AReCreate; + AStorage.StoreTo(Self, AWriterClass); + finally + AStorage.Free; + end; +end; + +function TcxCustomGridView.CreateViewInfo: TcxCustomGridViewInfo; +begin + Result := GetViewInfoClass.Create(Self); +end; + +{ functions } + +function GetGridViewDataController(AView: TcxCustomGridView): TcxCustomDataController; +begin + Result := AView.FDataController; +end; + +function GetParentGridView(AControl: TControl): TcxCustomGridView; +begin + while (AControl <> nil) and not (AControl is TcxGridSite) do + AControl := AControl.Parent; + if AControl = nil then + Result := nil + else + Result := TcxGridSite(AControl).GridView; +end; + +procedure AddGridViewClone(AView, AClone: TcxCustomGridView); +begin + AView.AddClone(AClone); +end; + +procedure AssignGridViewPattern(AView, APattern: TcxCustomGridView); +begin + AView.AssignPattern(APattern); +end; + +procedure SetGridViewLevel(AView: TcxCustomGridView; Value: TComponent); +begin + AView.SetLevel(Value); +end; + +procedure SiteFocusChanged(ASite: TcxGridSite); +begin + ASite.FocusChanged; +end; + +{ TcxCustomGridViewAccess } + +class procedure TcxCustomGridViewAccess.AddClone(AInstance: TcxCustomGridView; + AClone: TcxCustomGridView); +begin + AInstance.AddClone(AClone); +end; + +class procedure TcxCustomGridViewAccess.AssignPattern(AInstance: TcxCustomGridView; + APattern: TcxCustomGridView); +begin + AInstance.AssignPattern(APattern); +end; + +class function TcxCustomGridViewAccess.CanFocus(AInstance: TcxCustomGridView): Boolean; +begin + Result := AInstance.CanFocus; +end; + +class procedure TcxCustomGridViewAccess.DetailVisibleChanged(AInstance: TcxCustomGridView; + ADetailLevel: TComponent; APrevVisibleDetailCount, AVisibleDetailCount: Integer); +begin + AInstance.DetailVisibleChanged(ADetailLevel, APrevVisibleDetailCount, AVisibleDetailCount); +end; + +class procedure TcxCustomGridViewAccess.FocusChanged(AInstance: TcxCustomGridView; + AFocused: Boolean); +begin + AInstance.FocusChanged(AFocused); +end; + +class procedure TcxCustomGridViewAccess.LookAndFeelChanged(AInstance: TcxCustomGridView); +begin + AInstance.LookAndFeelChanged; +end; + +class procedure TcxCustomGridViewAccess.SetLevel(AInstance: TcxCustomGridView; + Value: TComponent); +begin + AInstance.SetLevel(Value); +end; + +class function TcxCustomGridViewAccess.GetChangeable(AInstance: TcxCustomGridView): Boolean; +begin + Result := AInstance.Changeable; +end; + +class function TcxCustomGridViewAccess.GetStyles(AInstance: TcxCustomGridView): TcxCustomGridStyles; +begin + Result := AInstance.Styles; +end; + +{ TcxGridRegisteredViews } + +type + TcxGridRegisteredViews = class(TcxRegisteredClasses) + protected + function CompareItems(AIndex1, AIndex2: Integer): Integer; override; + public + constructor Create; + end; + +constructor TcxGridRegisteredViews.Create; +begin + inherited Create(True); + Sorted := True; +end; + +function TcxGridRegisteredViews.CompareItems(AIndex1, AIndex2: Integer): Integer; +var + AIsDBView1, AIsDBView2: Boolean; +begin + AIsDBView1 := Pos('DB', Descriptions[AIndex1]) = 1; + AIsDBView2 := Pos('DB', Descriptions[AIndex2]) = 1; + if not AIsDBView1 and AIsDBView2 then + Result := -1 + else + if AIsDBView1 and not AIsDBView2 then + Result := 1 + else + Result := inherited CompareItems(AIndex1, AIndex2); +end; + +initialization + GridHitTests := TGridHitTests.Create; + cxGridRegisteredViews := TcxGridRegisteredViews.Create; + +finalization + FreeAndNil(cxGridRegisteredViews); + FreeAndNil(GridHitTests); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridDBBandedTableView.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridDBBandedTableView.pas new file mode 100644 index 00000000..cc5659de --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridDBBandedTableView.pas @@ -0,0 +1,145 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridDBBandedTableView; + +{$I cxVer.inc} + +interface + +uses + Classes, cxStorage, cxCustomData, cxDBData, + cxGridCustomTableView, cxGridDBDataDefinitions, cxGridBandedTableView; + +type + TcxGridDBBandedTableView = class; + + TcxGridDBBandedColumn = class(TcxGridBandedColumn) + private + function GetDataBinding: TcxGridItemDBDataBinding; + procedure SetDataBinding(Value: TcxGridItemDBDataBinding); + published + property DataBinding: TcxGridItemDBDataBinding read GetDataBinding write SetDataBinding; + end; + + TcxGridDBBandedTableView = class(TcxGridBandedTableView) + private + function GetColumn(Index: Integer): TcxGridDBBandedColumn; + function GetDataController: TcxGridDBDataController; + procedure SetColumn(Index: Integer; Value: TcxGridDBBandedColumn); + procedure SetDataController(Value: TcxGridDBDataController); + protected + function GetDataControllerClass: TcxCustomDataControllerClass; override; + function GetItemClass: TcxCustomGridTableItemClass; override; + function GetSummaryItemClass: TcxDataSummaryItemClass; override; + public + function CreateColumn: TcxGridDBBandedColumn; + function GetColumnByFieldName(const AFieldName: string): TcxGridDBBandedColumn; + property Columns[Index: Integer]: TcxGridDBBandedColumn read GetColumn write SetColumn; + published + property DataController: TcxGridDBDataController read GetDataController write SetDataController; + end; + +implementation + +uses + cxGridCustomView, cxGridDBTableView; + +{ TcxGridDBBandedColumn } + +function TcxGridDBBandedColumn.GetDataBinding: TcxGridItemDBDataBinding; +begin + Result := TcxGridItemDBDataBinding(inherited DataBinding); +end; + +procedure TcxGridDBBandedColumn.SetDataBinding(Value: TcxGridItemDBDataBinding); +begin + inherited DataBinding := Value; +end; + +{ TcxGridDBBandedTableView } + +function TcxGridDBBandedTableView.GetColumn(Index: Integer): TcxGridDBBandedColumn; +begin + Result := TcxGridDBBandedColumn(inherited Columns[Index]); +end; + +function TcxGridDBBandedTableView.GetDataController: TcxGridDBDataController; +begin + Result := TcxGridDBDataController(FDataController); +end; + +procedure TcxGridDBBandedTableView.SetColumn(Index: Integer; Value: TcxGridDBBandedColumn); +begin + inherited Columns[Index] := Value; +end; + +procedure TcxGridDBBandedTableView.SetDataController(Value: TcxGridDBDataController); +begin + FDataController.Assign(Value); +end; + +function TcxGridDBBandedTableView.GetDataControllerClass: TcxCustomDataControllerClass; +begin + Result := TcxGridDBDataController; +end; + +function TcxGridDBBandedTableView.GetItemClass: TcxCustomGridTableItemClass; +begin + Result := TcxGridDBBandedColumn; +end; + +function TcxGridDBBandedTableView.GetSummaryItemClass: TcxDataSummaryItemClass; +begin + Result := TcxGridDBTableSummaryItem; +end; + +function TcxGridDBBandedTableView.CreateColumn: TcxGridDBBandedColumn; +begin + Result := TcxGridDBBandedColumn(inherited CreateColumn); +end; + +function TcxGridDBBandedTableView.GetColumnByFieldName(const AFieldName: string): TcxGridDBBandedColumn; +begin + Result := TcxGridDBBandedColumn(DataController.GetItemByFieldName(AFieldName)); +end; + +initialization + cxGridRegisteredViews.Register(TcxGridDBBandedTableView, 'DB Banded Table'); + Classes.RegisterClass(TcxGridDBBandedColumn); + +finalization + cxGridRegisteredViews.Unregister(TcxGridDBBandedTableView); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridDBCardView.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridDBCardView.pas new file mode 100644 index 00000000..e23770d3 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridDBCardView.pas @@ -0,0 +1,190 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridDBCardView; + +interface + +uses + Classes, cxGridCustomTableView, cxGridCardView, cxGridDBDataDefinitions, + cxCustomData, cxDBData; + +type + TcxGridDBCardViewRow = class(TcxGridCardViewRow) + private + function GetDataBinding: TcxGridItemDBDataBinding; + procedure SetDataBinding(Value: TcxGridItemDBDataBinding); + protected + // IcxStoredObject + {function GetStoredProperties(AProperties: TStrings): Boolean; override; + procedure GetPropertyValue(const AName: string; var AValue: Variant); override; + procedure SetPropertyValue(const AName: string; const AValue: Variant); override;} + published + property DataBinding: TcxGridItemDBDataBinding read GetDataBinding write SetDataBinding; + end; + + {TcxGridDBCardViewSummaryItem = class(TcxDBDataSummaryItem) + private + function GetRow: TcxGridDBCardViewRow; + procedure SetRow(Value: TcxGridDBCardViewRow); + published + property Row: TcxGridDBCardViewRow read GetRow write SetRow; + end;} + + TcxGridDBCardView = class(TcxGridCardView) + private + function GetDataController: TcxGridDBDataController; + function GetRow(Index: Integer): TcxGridDBCardViewRow; + procedure SetDataController(Value: TcxGridDBDataController); + procedure SetRow(Index: Integer; Value: TcxGridDBCardViewRow); + protected + function GetDataControllerClass: TcxCustomDataControllerClass; override; + function GetItemClass: TcxCustomGridTableItemClass; override; + //function GetSummaryItemClass: TcxDataSummaryItemClass; override; + public + function CreateRow: TcxGridDBCardViewRow; + function GetRowByFieldName(const AFieldName: string): TcxGridDBCardViewRow; + property Rows[Index: Integer]: TcxGridDBCardViewRow read GetRow write SetRow; + published + property DataController: TcxGridDBDataController read GetDataController write SetDataController; + end; + +implementation + +uses + cxGridCustomView; + +{ TcxGridDBCardViewRow } + +function TcxGridDBCardViewRow.GetDataBinding: TcxGridItemDBDataBinding; +begin + Result := TcxGridItemDBDataBinding(inherited DataBinding); +end; + +procedure TcxGridDBCardViewRow.SetDataBinding(Value: TcxGridItemDBDataBinding); +begin + inherited DataBinding := Value; +end; + +{function TcxGridDBCardViewRow.GetStoredProperties(AProperties: TStrings): Boolean; +begin + inherited GetStoredProperties(AProperties); + with AProperties do + Add('FieldName'); + Result := True; +end; + +procedure TcxGridDBCardViewRow.GetPropertyValue(const AName: string; var AValue: Variant); +begin + if AName = 'FieldName' then + AValue := DataBinding.FieldName + else + inherited; +end; + +procedure TcxGridDBCardViewRow.SetPropertyValue(const AName: string; const AValue: Variant); +begin + if AName = 'FieldName' then + DataBinding.FieldName := AValue + else + inherited; +end;} + +(*{ TcxGridDBCardViewSummaryItem } + +function TcxGridDBCardViewSummaryItem.GetRow: TcxGridDBCardViewRow; +begin + Result := TcxGridDBCardViewRow(ItemLink); +end; + +procedure TcxGridDBCardViewSummaryItem.SetRow(Value: TcxGridDBCardViewRow); +begin + ItemLink := Value; +end;*) + +{ TcxGridDBCardView } + +function TcxGridDBCardView.GetDataController: TcxGridDBDataController; +begin + Result := TcxGridDBDataController(FDataController); +end; + +function TcxGridDBCardView.GetRow(Index: Integer): TcxGridDBCardViewRow; +begin + Result := TcxGridDBCardViewRow(inherited Rows[Index]); +end; + +procedure TcxGridDBCardView.SetDataController(Value: TcxGridDBDataController); +begin + FDataController.Assign(Value); +end; + +procedure TcxGridDBCardView.SetRow(Index: Integer; Value: TcxGridDBCardViewRow); +begin + inherited Rows[Index] := Value; +end; + +function TcxGridDBCardView.GetDataControllerClass: TcxCustomDataControllerClass; +begin + Result := TcxGridDBDataController; +end; + +function TcxGridDBCardView.GetItemClass: TcxCustomGridTableItemClass; +begin + Result := TcxGridDBCardViewRow; +end; + +{function TcxGridDBCardView.GetSummaryItemClass: TcxDataSummaryItemClass; +begin + Result := TcxGridDBCardViewSummaryItem; +end;} + +function TcxGridDBCardView.CreateRow: TcxGridDBCardViewRow; +begin + Result := TcxGridDBCardViewRow(inherited CreateRow); +end; + +function TcxGridDBCardView.GetRowByFieldName(const AFieldName: string): TcxGridDBCardViewRow; +begin + Result := TcxGridDBCardViewRow(DataController.GetItemByFieldName(AFieldName)); +end; + +initialization + cxGridRegisteredViews.Register(TcxGridDBCardView, 'DB Cards'); + Classes.RegisterClass(TcxGridDBCardViewRow); + +finalization + cxGridRegisteredViews.Unregister(TcxGridDBCardView); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridDBChartView.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridDBChartView.pas new file mode 100644 index 00000000..f12a9901 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridDBChartView.pas @@ -0,0 +1,569 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridDBChartView; + +{$I cxVer.inc} + +interface + +uses + Classes, DB, cxCustomData, cxDataStorage, cxDBData, cxEdit, + cxGridCustomView, cxGridChartView; + +type + TcxGridDBChartView = class; + + TcxGridDBChartDataController = class(TcxDBDataController, IcxCustomGridDataController, + IcxGridChartViewItemsProvider) + private + function GetGridViewValue: TcxGridDBChartView; + protected + { IcxCustomGridDataController } + procedure AssignData(ADataController: TcxCustomDataController); + procedure CreateAllItems(AMissingItemsOnly: Boolean); + procedure DeleteAllItems; + procedure GetFakeComponentLinks(AList: TList); + function GetGridView: TcxCustomGridView; + function HasAllItems: Boolean; + function IsDataChangeable: Boolean; + function IsDataLinked: Boolean; + function SupportsCreateAllItems: Boolean; + { IcxGridChartViewItemsProvider } + function IcxGridChartViewItemsProvider.GetItem = GetChartItem; + function GetChartItem(AItemClass: TcxGridChartItemClass; AIndex: Integer): TcxGridChartItem; + procedure GetItemCaptions(AItemClass: TcxGridChartItemClass; ACaptions: TStringList); + procedure InitItem(AItem: TcxGridChartItem; AIndex: Integer); + + procedure DoDataSourceChanged; override; + procedure DoValueTypeClassChanged(AItemIndex: Integer); override; + //function GetChartViewItemIndex: Integer; override; + function GetItemID(AItem: TObject): Integer; override; + function GetSortingBySummaryEngineClass: TcxSortingBySummaryEngineClass; override; + procedure GetValidValueFields(AItemClass: TcxGridChartItemClass; AFields: TList); + procedure Unlocked; override; + public + procedure BeginFullUpdate; override; + procedure EndFullUpdate; override; + function GetItem(Index: Integer): TObject; override; + + property GridView: TcxGridDBChartView read GetGridViewValue; + published + property DataModeController; + property DataSource; + property DetailKeyFieldNames; + property KeyFieldNames; + property MasterKeyFieldNames; + property Options; + property OnCompare; + property OnDataChanged; + property OnFilterRecord; + end; + + TcxGridDBChartItemDataBinding = class(TcxGridChartItemDataBinding) + private + function GetDataController: TcxGridDBChartDataController; + function GetField: TField; + function GetFieldName: string; + procedure SetFieldName(const Value: string); + protected + function GetDefaultDisplayText: string; override; + function GetDefaultRepositoryItem: TcxEditRepositoryItem; override; + function GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; override; + function GetDefaultValueTypeClass: TcxValueTypeClass; override; + procedure InitDefaultValuesProvider(ADefaultValuesProvider: TcxCustomEditDefaultValuesProvider); override; + function IsValueTypeStored: Boolean; override; + public + procedure Assign(Source: TPersistent); override; + property DataController: TcxGridDBChartDataController read GetDataController; + property Field: TField read GetField; + published + property FieldName: string read GetFieldName write SetFieldName; + end; + + TcxGridDBChartCategories = class(TcxGridChartCategories) + private + function GetDataBinding: TcxGridDBChartItemDataBinding; + procedure SetDataBinding(Value: TcxGridDBChartItemDataBinding); + published + property DataBinding: TcxGridDBChartItemDataBinding read GetDataBinding write SetDataBinding; + end; + + TcxGridDBChartDataGroup = class(TcxGridChartDataGroup) + private + function GetDataBinding: TcxGridDBChartItemDataBinding; + procedure SetDataBinding(Value: TcxGridDBChartItemDataBinding); + published + property DataBinding: TcxGridDBChartItemDataBinding read GetDataBinding write SetDataBinding; + end; + + TcxGridDBChartSeries = class(TcxGridChartSeries) + private + function GetDataBinding: TcxGridDBChartItemDataBinding; + procedure SetDataBinding(Value: TcxGridDBChartItemDataBinding); + published + property DataBinding: TcxGridDBChartItemDataBinding read GetDataBinding write SetDataBinding; + end; + + TcxGridDBChartView = class(TcxGridChartView) + private + function GetCategories: TcxGridDBChartCategories; + function GetDataController: TcxGridDBChartDataController; + function GetDataGroup(Index: Integer): TcxGridDBChartDataGroup; + function GetSeries(Index: Integer): TcxGridDBChartSeries; + procedure SetCategories(Value: TcxGridDBChartCategories); + procedure SetDataController(Value: TcxGridDBChartDataController); + procedure SetDataGroup(Index: Integer; Value: TcxGridDBChartDataGroup); + procedure SetSeries(Index: Integer; Value: TcxGridDBChartSeries); + protected + function GetCategoriesClass: TcxGridChartCategoriesClass; override; + function GetDataControllerClass: TcxCustomDataControllerClass; override; + function GetItemDataBindingClass: TcxGridChartItemDataBindingClass; override; + + function FindItemByFieldName(AItemClass: TcxGridChartItemClass; const AFieldName: string): TcxGridChartItem; + public + function CreateDataGroup: TcxGridDBChartDataGroup; + function FindDataGroupByFieldName(const AFieldName: string): TcxGridDBChartDataGroup; + function GetDataGroupClass: TcxGridChartDataGroupClass; override; + property DataGroups[Index: Integer]: TcxGridDBChartDataGroup read GetDataGroup write SetDataGroup; + + function CreateSeries: TcxGridDBChartSeries; + function FindSeriesByFieldName(const AFieldName: string): TcxGridDBChartSeries; + function GetSeriesClass: TcxGridChartSeriesClass; override; + property Series[Index: Integer]: TcxGridDBChartSeries read GetSeries write SetSeries; + published + property Categories: TcxGridDBChartCategories read GetCategories write SetCategories; + property DataController: TcxGridDBChartDataController read GetDataController write SetDataController; + end; + +implementation + +uses + SysUtils, cxClasses, cxDBEdit, cxEditDBRegisteredRepositoryItems; + +type + TcxComponentAccess = class(TcxComponent); + +{ TcxGridDBChartDataController } + +function TcxGridDBChartDataController.GetGridViewValue: TcxGridDBChartView; +begin + Result := TcxGridDBChartView(GetOwner); +end; + +procedure TcxGridDBChartDataController.AssignData(ADataController: TcxCustomDataController); +begin +end; + +procedure TcxGridDBChartDataController.CreateAllItems(AMissingItemsOnly: Boolean); +begin +end; + +procedure TcxGridDBChartDataController.DeleteAllItems; +begin +end; + +procedure TcxGridDBChartDataController.GetFakeComponentLinks(AList: TList); +begin + if (DataSource <> nil) and (DataSource.Owner <> GridView.Owner) and + (AList.IndexOf(DataSource.Owner) = -1) then + AList.Add(DataSource.Owner); +end; + +function TcxGridDBChartDataController.GetGridView: TcxCustomGridView; +begin + Result := GridView; +end; + +function TcxGridDBChartDataController.HasAllItems: Boolean; +begin + Result := True; +end; + +function TcxGridDBChartDataController.IsDataChangeable: Boolean; +begin + Result := False; +end; + +function TcxGridDBChartDataController.IsDataLinked: Boolean; +begin + Result := DataSet <> nil; +end; + +function TcxGridDBChartDataController.SupportsCreateAllItems: Boolean; +begin + Result := False; +end; + +function TcxGridDBChartDataController.GetChartItem(AItemClass: TcxGridChartItemClass; + AIndex: Integer): TcxGridChartItem; +var + AFields: TList; +begin + AFields := TList.Create; + try + GetValidValueFields(AItemClass, AFields); + Result := GridView.FindItemByFieldName(AItemClass, TField(AFields[AIndex]).FieldName); + finally + AFields.Free; + end; +end; + +procedure TcxGridDBChartDataController.GetItemCaptions(AItemClass: TcxGridChartItemClass; + ACaptions: TStringList); +var + AFields: TList; + I: Integer; +begin + AFields := TList.Create; + try + GetValidValueFields(AItemClass, AFields); + for I := 0 to AFields.Count - 1 do + ACaptions.Add(TField(AFields[I]).DisplayName); + finally + AFields.Free; + end; +end; + +procedure TcxGridDBChartDataController.InitItem(AItem: TcxGridChartItem; AIndex: Integer); +var + AFields: TList; +begin + AFields := TList.Create; + try + GetValidValueFields(TcxGridChartItemClass(AItem.ClassType), AFields); + TcxGridDBChartItemDataBinding(AItem.DataBinding).FieldName := TField(AFields[AIndex]).FieldName; + finally + AFields.Free; + end; +end; + +procedure TcxGridDBChartDataController.DoDataSourceChanged; +begin + TcxComponentAccess(GridView).UpdateFakeLinks; +end; + +procedure TcxGridDBChartDataController.DoValueTypeClassChanged(AItemIndex: Integer); +var + AChartItem: IcxGridChartItem; +begin + inherited; + if Supports(GetItem(AItemIndex), IcxGridChartItem, AChartItem) then + AChartItem.ValueTypeClassChanged; +end; + +{function TcxGridDBChartDataController.GetChartViewItemIndex: Integer; +begin + if GridView.SortedSeries = nil then + Result := -1 + else + Result := GridView.SortedSeries.DataBinding.DataIndex; +end;} + +function TcxGridDBChartDataController.GetItemID(AItem: TObject): Integer; +var + AChartItem: IcxGridChartItem; +begin + if Supports(AItem, IcxGridChartItem, AChartItem) then + Result := AChartItem.GetID + else + Result := -1; +end; + +function TcxGridDBChartDataController.GetSortingBySummaryEngineClass: TcxSortingBySummaryEngineClass; +begin + Result := GridView.ViewData.GetSortingBySummaryEngineClass; +end; + +function CompareFields(Item1, Item2: Pointer): Integer; +begin + if TField(Item1).DisplayName < TField(Item2).DisplayName then + Result := -1 + else + if TField(Item1).DisplayName > TField(Item2).DisplayName then + Result := 1 + else + Result := 0; +end; + +procedure TcxGridDBChartDataController.GetValidValueFields(AItemClass: TcxGridChartItemClass; + AFields: TList); +var + I: Integer; + AField: TField; +begin + if DataSet = nil then Exit; + for I := 0 to DataSet.FieldCount - 1 do + begin + AField := DataSet.Fields[I]; + if not AItemClass.IsValue or + IsValueTypeClassValid(GetValueTypeClassByField(AField)) then + AFields.Add(AField); + end; + AFields.Sort(CompareFields); +end; + +procedure TcxGridDBChartDataController.Unlocked; +begin + inherited; + GridView.DataControllerUnlocked; +end; + +procedure TcxGridDBChartDataController.BeginFullUpdate; +begin + GridView.BeginUpdate; + inherited; +end; + +procedure TcxGridDBChartDataController.EndFullUpdate; +begin + inherited; + GridView.EndUpdate; +end; + +function TcxGridDBChartDataController.GetItem(Index: Integer): TObject; +begin + Result := Fields[Index].Item; +end; + +{ TcxGridDBChartItemDataBinding } + +function TcxGridDBChartItemDataBinding.GetDataController: TcxGridDBChartDataController; +begin + Result := TcxGridDBChartDataController(inherited DataController); +end; + +function TcxGridDBChartItemDataBinding.GetField: TField; +begin + Result := DataController.GetItemField(DataIndex); +end; + +function TcxGridDBChartItemDataBinding.GetFieldName: string; +begin + Result := DataController.GetItemFieldName(DataIndex); +end; + +procedure TcxGridDBChartItemDataBinding.SetFieldName(const Value: string); +begin + DataController.ChangeFieldName(DataIndex, Value); +end; + +function TcxGridDBChartItemDataBinding.GetDefaultDisplayText: string; +begin + if Field = nil then + Result := inherited GetDefaultDisplayText + else + Result := Field.DisplayName; +end; + +function TcxGridDBChartItemDataBinding.GetDefaultRepositoryItem: TcxEditRepositoryItem; +begin + Result := GetDefaultEditDBRepositoryItems.GetItemByField(Field); +end; + +function TcxGridDBChartItemDataBinding.GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; +begin + Result := TcxCustomDBEditDefaultValuesProvider; +end; + +function TcxGridDBChartItemDataBinding.GetDefaultValueTypeClass: TcxValueTypeClass; +begin + Result := nil; +end; + +procedure TcxGridDBChartItemDataBinding.InitDefaultValuesProvider(ADefaultValuesProvider: TcxCustomEditDefaultValuesProvider); +begin + inherited; + TcxCustomDBEditDefaultValuesProvider(ADefaultValuesProvider).DataSource := DataController.DataSource; + TcxCustomDBEditDefaultValuesProvider(ADefaultValuesProvider).Field := Field; +end; + +function TcxGridDBChartItemDataBinding.IsValueTypeStored: Boolean; +begin + Result := FieldName = ''; +end; + +procedure TcxGridDBChartItemDataBinding.Assign(Source: TPersistent); +begin + if Source is TcxGridDBChartItemDataBinding then + FieldName := TcxGridDBChartItemDataBinding(Source).FieldName; + inherited; +end; + +{ TcxGridDBChartCategories } + +function TcxGridDBChartCategories.GetDataBinding: TcxGridDBChartItemDataBinding; +begin + Result := TcxGridDBChartItemDataBinding(inherited DataBinding); +end; + +procedure TcxGridDBChartCategories.SetDataBinding(Value: TcxGridDBChartItemDataBinding); +begin + inherited DataBinding := Value; +end; + +{ TcxGridDBChartDataGroup } + +function TcxGridDBChartDataGroup.GetDataBinding: TcxGridDBChartItemDataBinding; +begin + Result := TcxGridDBChartItemDataBinding(inherited DataBinding); +end; + +procedure TcxGridDBChartDataGroup.SetDataBinding(Value: TcxGridDBChartItemDataBinding); +begin + inherited DataBinding := Value; +end; + +{ TcxGridDBChartSeries } + +function TcxGridDBChartSeries.GetDataBinding: TcxGridDBChartItemDataBinding; +begin + Result := TcxGridDBChartItemDataBinding(inherited DataBinding); +end; + +procedure TcxGridDBChartSeries.SetDataBinding(Value: TcxGridDBChartItemDataBinding); +begin + inherited DataBinding := Value; +end; + +{ TcxGridDBChartView } + +function TcxGridDBChartView.GetCategories: TcxGridDBChartCategories; +begin + Result := TcxGridDBChartCategories(inherited Categories); +end; + +function TcxGridDBChartView.GetDataController: TcxGridDBChartDataController; +begin + Result := TcxGridDBChartDataController(FDataController); +end; + +function TcxGridDBChartView.GetDataGroup(Index: Integer): TcxGridDBChartDataGroup; +begin + Result := TcxGridDBChartDataGroup(inherited DataGroups[Index]); +end; + +function TcxGridDBChartView.GetSeries(Index: Integer): TcxGridDBChartSeries; +begin + Result := TcxGridDBChartSeries(inherited Series[Index]); +end; + +procedure TcxGridDBChartView.SetCategories(Value: TcxGridDBChartCategories); +begin + inherited Categories := Value; +end; + +procedure TcxGridDBChartView.SetDataController(Value: TcxGridDBChartDataController); +begin + FDataController.Assign(Value); +end; + +procedure TcxGridDBChartView.SetDataGroup(Index: Integer; Value: TcxGridDBChartDataGroup); +begin + inherited DataGroups[Index] := Value; +end; + +procedure TcxGridDBChartView.SetSeries(Index: Integer; Value: TcxGridDBChartSeries); +begin + inherited Series[Index] := Value; +end; + +function TcxGridDBChartView.GetCategoriesClass: TcxGridChartCategoriesClass; +begin + Result := TcxGridDBChartCategories; +end; + +function TcxGridDBChartView.GetDataControllerClass: TcxCustomDataControllerClass; +begin + Result := TcxGridDBChartDataController; +end; + +function TcxGridDBChartView.GetItemDataBindingClass: TcxGridChartItemDataBindingClass; +begin + Result := TcxGridDBChartItemDataBinding; +end; + +function TcxGridDBChartView.FindItemByFieldName(AItemClass: TcxGridChartItemClass; + const AFieldName: string): TcxGridChartItem; +var + AItems: TList; + I: Integer; +begin + AItems := GetItemList(AItemClass); + for I := 0 to AItems.Count - 1 do + begin + Result := TcxGridChartItem(AItems[I]); + if SameText(TcxGridDBChartItemDataBinding(Result.DataBinding).FieldName, AFieldName) then Exit; + end; + Result := nil; +end; + +function TcxGridDBChartView.CreateDataGroup: TcxGridDBChartDataGroup; +begin + Result := TcxGridDBChartDataGroup(inherited CreateDataGroup); +end; + +function TcxGridDBChartView.FindDataGroupByFieldName(const AFieldName: string): TcxGridDBChartDataGroup; +begin + Result := TcxGridDBChartDataGroup(FindItemByFieldName(GetDataGroupClass, AFieldName)); +end; + +function TcxGridDBChartView.GetDataGroupClass: TcxGridChartDataGroupClass; +begin + Result := TcxGridDBChartDataGroup; +end; + +function TcxGridDBChartView.CreateSeries: TcxGridDBChartSeries; +begin + Result := TcxGridDBChartSeries(inherited CreateSeries); +end; + +function TcxGridDBChartView.FindSeriesByFieldName(const AFieldName: string): TcxGridDBChartSeries; +begin + Result := TcxGridDBChartSeries(FindItemByFieldName(GetSeriesClass, AFieldName)); +end; + +function TcxGridDBChartView.GetSeriesClass: TcxGridChartSeriesClass; +begin + Result := TcxGridDBChartSeries; +end; + +initialization + cxGridRegisteredViews.Register(TcxGridDBChartView, 'DB Chart'); + Classes.RegisterClasses([TcxGridDBChartDataGroup, TcxGridDBChartSeries]); + +finalization + cxGridRegisteredViews.Unregister(TcxGridDBChartView); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridDBDataDefinitions.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridDBDataDefinitions.pas new file mode 100644 index 00000000..54b5520f --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridDBDataDefinitions.pas @@ -0,0 +1,681 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridDBDataDefinitions; + +{$I cxVer.inc} + +interface + +uses + Classes, DB, cxGridCustomView, + cxCustomData, cxFilter, cxDBData, cxDataStorage, cxDataUtils, + cxEdit, cxDBEdit, cxGridCustomTableView; + +type + TcxGridDBDefaultValuesProvider = class(TcxCustomDBEditDefaultValuesProvider) + private + FFieldName: string; + public + function DefaultCanModify: Boolean; override; + function IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean; override; + property FieldName: string read FFieldName write FFieldName; + end; + + TcxGridDBDataController = class(TcxDBDataController, + IcxCustomGridDataController, IcxGridDataController) + private + FPrevScrollBarPos: Integer; + function GetController: TcxCustomGridTableController; + function GetGridViewValue: TcxCustomGridTableView; + protected + { IcxCustomGridDataController } + procedure AssignData(ADataController: TcxCustomDataController); + procedure DeleteAllItems; + procedure GetFakeComponentLinks(AList: TList); + function GetGridView: TcxCustomGridView; + function HasAllItems: Boolean; + function IsDataChangeable: Boolean; + function IsDataLinked: Boolean; + function SupportsCreateAllItems: Boolean; + { IcxGridDataController } + procedure CheckGridModeBufferCount; + function DoScroll(AForward: Boolean): Boolean; + function DoScrollPage(AForward: Boolean): Boolean; + //function GetFilterPropertyValue(const AName: string; var AValue: Variant): Boolean; + function GetItemDataBindingClass: TcxGridItemDataBindingClass; + function GetItemDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; + function GetNavigatorIsBof: Boolean; + function GetNavigatorIsEof: Boolean; + function GetScrollBarPos: Integer; + function GetScrollBarRecordCount: Integer; + //function SetFilterPropertyValue(const AName: string; const AValue: Variant): Boolean; + function SetScrollBarPos(Value: Integer): Boolean; + + function CanSelectRow(ARowIndex: Integer): Boolean; override; + function CompareByField(ARecordIndex1, ARecordIndex2: Integer; + AField: TcxCustomDataField; AMode: TcxDataControllerComparisonMode): Integer; override; + procedure DoDataSetCurrentChanged(AIsCurrent: Boolean); override; + procedure DoDataSourceChanged; override; + procedure DoValueTypeClassChanged(AItemIndex: Integer); override; + procedure FilterChanged; override; + function GetDefaultActiveRelationIndex: Integer; override; + function GetDefaultGridModeBufferCount: Integer; override; + function GetFilterDisplayText(ARecordIndex, AItemIndex: Integer): string; override; + //function GetIncrementalSearchText(ARecordIndex, AItemIndex: Integer): string; override; + function GetItemID(AItem: TObject): Integer; override; + function GetSortingBySummaryEngineClass: TcxSortingBySummaryEngineClass; override; + function GetSummaryGroupItemLinkClass: TcxDataSummaryGroupItemLinkClass; override; + function GetSummaryItemClass: TcxDataSummaryItemClass; override; + function SupportsScrollBarParams: Boolean; virtual; + function SyncDetailsFocusWithMaster: Boolean; override; + procedure UpdateScrollBars; override; + public + procedure BeginFullUpdate; override; + procedure EndFullUpdate; override; + function CreateDetailLinkObject(ARelation: TcxCustomDataRelation; + ARecordIndex: Integer): TObject; override; + procedure FocusControl(AItemIndex: Integer; var Done: Boolean); override; + function GetDetailDataControllerByLinkObject(ALinkObject: TObject): TcxCustomDataController; override; + function GetDisplayText(ARecordIndex, AItemIndex: Integer): string; override; + function GetFilterDataValue(ARecordIndex: Integer; AField: TcxCustomDataField): Variant; override; + function GetFilterItemFieldCaption(AItem: TObject): string; override; + function GetItem(Index: Integer): TObject; override; + function GetItemSortByDisplayText(AItemIndex: Integer; ASortByDisplayText: Boolean): Boolean; override; + function GetItemValueSource(AItemIndex: Integer): TcxDataEditValueSource; override; + procedure UpdateData; override; + + procedure CreateAllItems(AMissingItemsOnly: Boolean = False); // IcxCustomGridDataController + function GetItemByFieldName(const AFieldName: string): TcxCustomGridTableItem; + + property Controller: TcxCustomGridTableController read GetController; + property GridView: TcxCustomGridTableView read GetGridViewValue; + published + property DataModeController; + property DataSource; + property DetailKeyFieldNames; + property Filter; + property KeyFieldNames; + property MasterKeyFieldNames; + property Options; + property Summary; + property OnCompare; + property OnDataChanged; + property OnDetailCollapsing; + property OnDetailCollapsed; + property OnDetailExpanding; + property OnDetailExpanded; + property OnDetailHasChildren; + property OnFilterRecord; + property OnGroupingChanged; + property OnSortingChanged; + end; + + TcxGridItemDBDataBinding = class(TcxGridItemDataBinding) + private + function GetDataController: TcxGridDBDataController; + function GetField: TField; + function GetFieldName: string; + procedure SetFieldName(const Value: string); + protected + function GetDefaultValueTypeClass: TcxValueTypeClass; override; + function GetFilterFieldName: string; override; + procedure Init; override; + function IsValueTypeStored: Boolean; override; + public + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; override; + function DefaultRepositoryItem: TcxEditRepositoryItem; override; + function DefaultWidth(ATakeHeaderIntoAccount: Boolean = True): Integer; override; + property DataController: TcxGridDBDataController read GetDataController; + property Field: TField read GetField; + published + property FieldName: string read GetFieldName write SetFieldName; + end; + +implementation + +uses + SysUtils, cxClasses, cxGraphics, cxControls, cxLookAndFeelPainters, + cxEditDBRegisteredRepositoryItems, + cxStorage, cxGridCommon, cxGridLevel, Controls, Forms; + +type + TcxComponentAccess = class(TcxComponent); + +{ TcxGridDBDefaultValuesProvider } + +function TcxGridDBDefaultValuesProvider.DefaultCanModify: Boolean; +begin + Result := (FieldName = '') or inherited DefaultCanModify; +end; + +function TcxGridDBDefaultValuesProvider.IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean; +begin + Result := TcxGridItemDataBinding(Owner).IsDisplayFormatDefined(AIsCurrencyValueAccepted); +end; + +{ TcxGridDBDataController } + +function TcxGridDBDataController.GetController: TcxCustomGridTableController; +begin + Result := GridView.Controller; +end; + +function TcxGridDBDataController.GetGridViewValue: TcxCustomGridTableView; +begin + Result := TcxCustomGridTableView(GetGridView); +end; + +procedure TcxGridDBDataController.AssignData(ADataController: TcxCustomDataController); +begin +end; + +procedure TcxGridDBDataController.DeleteAllItems; +begin + GridView.ClearItems; +end; + +procedure TcxGridDBDataController.GetFakeComponentLinks(AList: TList); +begin + if (DataSource <> nil) and (DataSource.Owner <> GridView.Owner) and + (AList.IndexOf(DataSource.Owner) = -1) then + AList.Add(DataSource.Owner); +end; + +function TcxGridDBDataController.GetGridView: TcxCustomGridView; +begin + Result := TcxCustomGridView(GetOwner); +end; + +function TcxGridDBDataController.HasAllItems: Boolean; +var + I: Integer; +begin + Result := True; + with DataSet do + for I := 0 to FieldCount - 1 do + begin + Result := GetItemByFieldName(Fields[I].FieldName) <> nil; + if not Result then Break; + end; +end; + +function TcxGridDBDataController.IsDataChangeable: Boolean; +begin + Result := False; +end; + +function TcxGridDBDataController.IsDataLinked: Boolean; +begin + Result := DataSet <> nil; +end; + +function TcxGridDBDataController.SupportsCreateAllItems: Boolean; +begin + Result := True; +end; + +procedure TcxGridDBDataController.CheckGridModeBufferCount; +begin + UpdateGridModeBufferCount; +end; + +function TcxGridDBDataController.DoScroll(AForward: Boolean): Boolean; +var + AScrolled: Boolean; +begin + Result := SupportsScrollBarParams; + if Result then + begin + if AForward then + AScrolled := Controller.GoToNext(False, False) + else + AScrolled := Controller.GoToPrev(False, False); + if AScrolled then + SetSelectionAnchor(FocusedRowIndex); + end; +end; + +function TcxGridDBDataController.DoScrollPage(AForward: Boolean): Boolean; +var + APrevRecNo: Integer; +begin + Result := SupportsScrollBarParams; + if Result then + begin + APrevRecNo := RecNo; + if AForward then + TcxCustomGridTableControllerAccess.FocusNextPage(Controller, False) + else + TcxCustomGridTableControllerAccess.FocusPrevPage(Controller, False); + if RecNo <> APrevRecNo then + SetSelectionAnchor(FocusedRowIndex); + end; +end; + +{function TcxGridDBDataController.GetFilterPropertyValue(const AName: string; + var AValue: Variant): Boolean; +begin + Result := True; + if AName = 'FilterAutoDataSetFilter' then + AValue := Filter.AutoDataSetFilter + else + Result := False; +end;} + +function TcxGridDBDataController.GetItemDataBindingClass: TcxGridItemDataBindingClass; +begin + Result := TcxGridItemDBDataBinding; +end; + +function TcxGridDBDataController.GetItemDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; +begin + Result := TcxGridDBDefaultValuesProvider; +end; + +function TcxGridDBDataController.GetNavigatorIsBof: Boolean; +begin + Result := GridView.Controller.IsStart; +end; + +function TcxGridDBDataController.GetNavigatorIsEof: Boolean; +begin + Result := GridView.Controller.IsFinish; +end; + +function TcxGridDBDataController.GetScrollBarPos: Integer; +begin + if SupportsScrollBarParams then + if dceInsert in EditState then + Result := FPrevScrollBarPos + else + Result := RecNo - 1 + else + Result := -1; + FPrevScrollBarPos := Result; +end; + +function TcxGridDBDataController.GetScrollBarRecordCount: Integer; +begin + if SupportsScrollBarParams then + Result := DataSetRecordCount + GridView.ViewInfo.VisibleRecordCount - 1 + else + Result := -1; +end; + +{function TcxGridDBDataController.SetFilterPropertyValue(const AName: string; + const AValue: Variant): Boolean; +begin + Result := True; + if AName = 'FilterAutoDataSetFilter' then + Filter.AutoDataSetFilter := StringToBoolean(AValue) + else + Result := False; +end;} + +function TcxGridDBDataController.SetScrollBarPos(Value: Integer): Boolean; +begin + Result := SupportsScrollBarParams; + if Result and (RecNo <> Value + 1) then + begin + RecNo := Value + 1; + if RecNo = Value + 1 then + SetSelectionAnchor(FocusedRowIndex); + end; +end; + +function TcxGridDBDataController.CanSelectRow(ARowIndex: Integer): Boolean; +begin + Result := TcxCustomGridTableViewAccess.CanSelectRecord(GridView, ARowIndex); +end; + +function TcxGridDBDataController.CompareByField(ARecordIndex1, ARecordIndex2: Integer; + AField: TcxCustomDataField; AMode: TcxDataControllerComparisonMode): Integer; +begin + if GridView.ViewData.NeedsCustomDataComparison(AField, AMode) then + Result := GridView.ViewData.CustomCompareDataValues(AField, + GetComparedValue(ARecordIndex1, AField), GetComparedValue(ARecordIndex2, AField), AMode) + else + Result := inherited CompareByField(ARecordIndex1, ARecordIndex2, AField, AMode); +end; + +procedure TcxGridDBDataController.DoDataSetCurrentChanged(AIsCurrent: Boolean); +begin + inherited; + TcxCustomGridTableViewAccess.RefreshNavigators(GridView); +end; + +procedure TcxGridDBDataController.DoDataSourceChanged; +begin + TcxComponentAccess(GridView).UpdateFakeLinks; +end; + +procedure TcxGridDBDataController.DoValueTypeClassChanged(AItemIndex: Integer); +begin + inherited; + TcxCustomGridTableViewAccess.ItemValueTypeClassChanged(GridView, AItemIndex); +end; + +procedure TcxGridDBDataController.FilterChanged; +begin + inherited; + TcxCustomGridTableViewAccess.FilterChanged(GridView); +end; + +function TcxGridDBDataController.GetDefaultActiveRelationIndex: Integer; +begin + Result := TcxCustomGridTableViewAccess.GetDefaultActiveDetailIndex(GridView); +end; + +function TcxGridDBDataController.GetDefaultGridModeBufferCount: Integer; +begin + Result := TcxCustomGridTableViewInfoAccess.GetDefaultGridModeBufferCount(GridView.ViewInfo); + if Result = 0 then + Result := inherited GetDefaultGridModeBufferCount; +end; + +function TcxGridDBDataController.GetFilterDisplayText(ARecordIndex, AItemIndex: Integer): string; +begin + if GridView.ViewData.HasCustomDataHandling(Fields[AItemIndex], doFiltering) then + Result := GridView.ViewData.GetCustomDataDisplayText(ARecordIndex, AItemIndex, doFiltering) + else + Result := inherited GetFilterDisplayText(ARecordIndex, AItemIndex); +end; + +{function TcxGridDBDataController.GetIncrementalSearchText(ARecordIndex, AItemIndex: Integer): string; +begin + if not TcxCustomGridTableViewAccess(GridView).GetDisplayText(ARecordIndex, AItemIndex, Result) then + Result := inherited GetIncrementalSearchText(ARecordIndex, AItemIndex); +end;} + +function TcxGridDBDataController.GetItemID(AItem: TObject): Integer; +begin + if AItem is TcxCustomGridTableItem then + Result := TcxCustomGridTableItem(AItem).ID + else + Result := -1; +end; + +function TcxGridDBDataController.GetSortingBySummaryEngineClass: TcxSortingBySummaryEngineClass; +begin + Result := GridView.ViewData.GetSortingBySummaryEngineClass; +end; + +function TcxGridDBDataController.GetSummaryGroupItemLinkClass: TcxDataSummaryGroupItemLinkClass; +begin + Result := TcxCustomGridTableViewAccess.GetSummaryGroupItemLinkClass(GridView); + if Result = nil then + Result := inherited GetSummaryGroupItemLinkClass; +end; + +function TcxGridDBDataController.GetSummaryItemClass: TcxDataSummaryItemClass; +begin + Result := TcxCustomGridTableViewAccess.GetSummaryItemClass(GridView); + if Result = nil then + Result := inherited GetSummaryItemClass; +end; + +function TcxGridDBDataController.SupportsScrollBarParams: Boolean; +begin + Result := IsGridMode and IsSequenced and + TcxCustomGridTableViewAccess.IsEqualHeightRecords(GridView); +end; + +function TcxGridDBDataController.SyncDetailsFocusWithMaster: Boolean; +begin + Result := GridView.IsSynchronization; +end; + +procedure TcxGridDBDataController.UpdateScrollBars; +begin + inherited; + Controller.UpdateScrollBars; +end; + +procedure TcxGridDBDataController.BeginFullUpdate; +begin + GridView.BeginUpdate; + inherited; +end; + +procedure TcxGridDBDataController.EndFullUpdate; +begin + inherited; + GridView.EndUpdate; +end; + +function TcxGridDBDataController.CreateDetailLinkObject(ARelation: TcxCustomDataRelation; + ARecordIndex: Integer): TObject; +begin + Result := TcxGridLevelAccess.CreateLinkObject(TcxGridLevel(ARelation.Item), ARelation, ARecordIndex); +end; + +procedure TcxGridDBDataController.FocusControl(AItemIndex: Integer; var Done: Boolean); +begin + inherited; + TcxCustomGridTableViewAccess.FocusEdit(GridView, AItemIndex, Done); +end; + +function TcxGridDBDataController.GetDetailDataControllerByLinkObject(ALinkObject: TObject): TcxCustomDataController; +begin + Result := TcxCustomGridView(ALinkObject).DataController; +end; + +function TcxGridDBDataController.GetDisplayText(ARecordIndex, AItemIndex: Integer): string; +begin + if not GridView.ViewData.GetDisplayText(ARecordIndex, AItemIndex, Result) then + Result := inherited GetDisplayText(ARecordIndex, AItemIndex); + TcxCustomGridTableItemAccess.DoGetDataText(GridView.Items[AItemIndex], ARecordIndex, Result); +end; + +function TcxGridDBDataController.GetFilterDataValue(ARecordIndex: Integer; AField: TcxCustomDataField): Variant; +begin + Result := inherited GetFilterDataValue(ARecordIndex, AField); + if GridView.ViewData.HasCustomDataHandling(AField, doFiltering) then + Result := GridView.ViewData.GetCustomDataValue(AField, Result, doFiltering); +end; + +function TcxGridDBDataController.GetFilterItemFieldCaption(AItem: TObject): string; +begin + Result := TcxCustomGridTableItemAccess.GetFilterCaption(TcxCustomGridTableItem(AItem)); +end; + +function TcxGridDBDataController.GetItem(Index: Integer): TObject; +begin + Result := GridView.Items[Index]; +end; + +function TcxGridDBDataController.GetItemSortByDisplayText(AItemIndex: Integer; + ASortByDisplayText: Boolean): Boolean; +begin + Result := TcxCustomGridTableViewAccess.GetItemSortByDisplayText(GridView, + AItemIndex, ASortByDisplayText); +end; + +function TcxGridDBDataController.GetItemValueSource(AItemIndex: Integer): TcxDataEditValueSource; +begin + Result := TcxCustomGridTableViewAccess.GetItemValueSource(GridView, AItemIndex); +end; + +procedure TcxGridDBDataController.UpdateData; +begin + inherited; + TcxCustomGridTableViewAccess.UpdateRecord(GridView); +end; + +procedure TcxGridDBDataController.CreateAllItems(AMissingItemsOnly: Boolean = False); +var + I: Integer; + AItem: TcxCustomGridTableItem; +begin + if DataSet = nil then Exit; + ShowHourglassCursor; + try + GridView.BeginUpdate; + BeginUpdateFields; + try + with DataSet do + for I := 0 to FieldCount - 1 do + if not AMissingItemsOnly or (GetItemByFieldName(Fields[I].FieldName) = nil) then + begin + AItem := GridView.CreateItem; + with AItem do + begin + with DataBinding as TcxGridItemDBDataBinding do + FieldName := Fields[I].FieldName; + Name := CreateUniqueName(GridView.Owner, GridView, AItem, + ScxGridPrefixName, Fields[I].FieldName); + Visible := Fields[I].Visible; + end; + end; + finally + EndUpdateFields; + GridView.EndUpdate; + end; + finally + HideHourglassCursor; + end; +end; + +function TcxGridDBDataController.GetItemByFieldName(const AFieldName: string): TcxCustomGridTableItem; +begin + Result := TcxCustomGridTableItem(inherited GetItemByFieldName(AFieldName)); +end; + +{ TcxGridItemDBDataBinding } + +function TcxGridItemDBDataBinding.GetDataController: TcxGridDBDataController; +begin + Result := TcxGridDBDataController(inherited DataController); +end; + +function TcxGridItemDBDataBinding.GetField: TField; +begin + Result := DataController.GetItemField(Item.Index); +end; + +function TcxGridItemDBDataBinding.GetFieldName: string; +begin + Result := DataController.GetItemFieldName(Item.Index); +end; + +procedure TcxGridItemDBDataBinding.SetFieldName(const Value: string); +begin + if FieldName <> Value then + begin + FilterMRUValueItems.ClearItems; + DataController.ChangeFieldName(Item.Index, Value); + end; +end; + +function TcxGridItemDBDataBinding.GetDefaultValueTypeClass: TcxValueTypeClass; +begin + Result := nil; +end; + +function TcxGridItemDBDataBinding.GetFilterFieldName: string; +begin + if Field = nil then + Result := '' + else + Result := Field.FieldName; +end; + +procedure TcxGridItemDBDataBinding.Init; +begin + inherited; + TcxGridDBDefaultValuesProvider(DefaultValuesProvider).DataSource := DataController.DataSource; + TcxGridDBDefaultValuesProvider(DefaultValuesProvider).Field := Field; + TcxGridDBDefaultValuesProvider(DefaultValuesProvider).FieldName := FieldName; +end; + +function TcxGridItemDBDataBinding.IsValueTypeStored: Boolean; +begin + Result := FieldName = ''; +end; + +procedure TcxGridItemDBDataBinding.Assign(Source: TPersistent); +begin + if Source is TcxGridItemDBDataBinding then + FieldName := TcxGridItemDBDataBinding(Source).FieldName; + inherited; +end; + +function TcxGridItemDBDataBinding.DefaultCaption: string; +var + AField: TField; +begin + AField := Field; + if AField = nil then + Result := FieldName + else + Result := AField.DisplayName; +end; + +function TcxGridItemDBDataBinding.DefaultRepositoryItem: TcxEditRepositoryItem; +begin + Result := GetDefaultEditDBRepositoryItems.GetItemByField(Field); +end; + +function TcxGridItemDBDataBinding.DefaultWidth(ATakeHeaderIntoAccount: Boolean = True): Integer; +var + AField: TField; + ACanvas: TcxCanvas; + AParams: TcxViewParams; + //W: Integer; +begin + AField := Field; + if AField = nil then + Result := inherited DefaultWidth(ATakeHeaderIntoAccount) + else + begin + ACanvas := GridView.ViewInfo.Canvas; + Item.Styles.GetContentParams(nil, AParams); + ACanvas.Font := AParams.Font; + Result := AField.DisplayWidth * ACanvas.TextWidth('0') + 2 * cxTextOffset; + {if ATakeHeaderIntoAccount then + begin + W := ACanvas.TextWidth(TcxCustomGridTableItemAccess(Item).Caption) + + 2 * (GridView.LookAndFeelPainter.HeaderBorderSize + cxTextOffset); + if W > Result then Result := W; + end;} + end; + TcxCustomGridTableItemAccess.CheckWidthValue(Item, Result); +end; + +initialization + RegisterClasses([TcxGridItemDBDataBinding]); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridDBTableView.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridDBTableView.pas new file mode 100644 index 00000000..8102f335 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridDBTableView.pas @@ -0,0 +1,289 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridDBTableView; + +{$I cxVer.inc} + +interface + +uses + Classes, cxGridCustomTableView, cxGridTableView, cxGridDBDataDefinitions, + cxStorage, cxCustomData, cxDBData; + +type + TcxGridDBTableView = class; + + TcxGridDBColumn = class(TcxGridColumn) + private + function GetDataBinding: TcxGridItemDBDataBinding; + procedure SetDataBinding(Value: TcxGridItemDBDataBinding); + published + property DataBinding: TcxGridItemDBDataBinding read GetDataBinding write SetDataBinding; + end; + + TcxGridDBTableSummaryItem = class(TcxDBDataSummaryItem, + {$IFNDEF DELPHI6}IUnknown,{$ENDIF} IcxStoredObject, IcxGridSummaryItem) + private + FDisplayText: string; + FVisibleForCustomization: Boolean; + function GetColumn: TcxGridColumn; + function GetGridView: TcxGridTableView; + procedure SetColumn(Value: TcxGridColumn); + procedure SetDisplayText(const Value: string); + procedure SetVisibleForCustomization(Value: Boolean); + protected + // IInterface + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + // IcxStoredObject + function GetObjectName: string; + function GetProperties(AProperties: TStrings): Boolean; + procedure GetPropertyValue(const AName: string; var AValue: Variant); + procedure SetPropertyValue(const AName: string; const AValue: Variant); + // IcxGridSummaryItem + function GetDisplayText: string; + function GetVisibleForCustomization: Boolean; + + property GridView: TcxGridTableView read GetGridView; + public + constructor Create(Collection: TCollection); override; + procedure Assign(Source: TPersistent); override; + published + property Column: TcxGridColumn read GetColumn write SetColumn; + property DisplayText: string read FDisplayText write SetDisplayText; + property Sorted; + property VisibleForCustomization: Boolean read FVisibleForCustomization + write SetVisibleForCustomization default True; + end; + + TcxGridDBTableView = class(TcxGridTableView) + private + function GetColumn(Index: Integer): TcxGridDBColumn; + function GetDataController: TcxGridDBDataController; + procedure SetColumn(Index: Integer; Value: TcxGridDBColumn); + procedure SetDataController(Value: TcxGridDBDataController); + protected + function GetDataControllerClass: TcxCustomDataControllerClass; override; + function GetItemClass: TcxCustomGridTableItemClass; override; + function GetSummaryItemClass: TcxDataSummaryItemClass; override; + public + function CreateColumn: TcxGridDBColumn; + function GetColumnByFieldName(const AFieldName: string): TcxGridDBColumn; + property Columns[Index: Integer]: TcxGridDBColumn read GetColumn write SetColumn; + published + property DataController: TcxGridDBDataController read GetDataController write SetDataController; + end; + +implementation + +uses + cxGridCustomView; + +{ TcxGridDBColumn } + +function TcxGridDBColumn.GetDataBinding: TcxGridItemDBDataBinding; +begin + Result := TcxGridItemDBDataBinding(inherited DataBinding); +end; + +procedure TcxGridDBColumn.SetDataBinding(Value: TcxGridItemDBDataBinding); +begin + inherited DataBinding := Value; +end; + +{ TcxGridDBTableSummaryItem } + +constructor TcxGridDBTableSummaryItem.Create(Collection: TCollection); +begin + inherited; + FVisibleForCustomization := True; +end; + +function TcxGridDBTableSummaryItem.GetColumn: TcxGridColumn; +begin + Result := TcxGridColumn(ItemLink); +end; + +function TcxGridDBTableSummaryItem.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(TcxGridDBDataController(DataController).GridView); +end; + +procedure TcxGridDBTableSummaryItem.SetColumn(Value: TcxGridColumn); +begin + ItemLink := Value; +end; + +procedure TcxGridDBTableSummaryItem.SetDisplayText(const Value: string); +begin + if FDisplayText <> Value then + begin + FDisplayText := Value; + GridView.Changed(vcProperty); + end; +end; + +procedure TcxGridDBTableSummaryItem.SetVisibleForCustomization(Value: Boolean); +begin + if FVisibleForCustomization <> Value then + begin + FVisibleForCustomization := Value; + GridView.Changed(vcProperty); + end; +end; + +function TcxGridDBTableSummaryItem.QueryInterface(const IID: TGUID; out Obj): HResult; +const + E_NOINTERFACE = HResult($80004002); +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +function TcxGridDBTableSummaryItem._AddRef: Integer; +begin + Result := -1; +end; + +function TcxGridDBTableSummaryItem._Release: Integer; +begin + Result := -1; +end; + +function TcxGridDBTableSummaryItem.GetObjectName: string; +begin + Result := ''; +end; + +function TcxGridDBTableSummaryItem.GetProperties(AProperties: TStrings): Boolean; +begin + AProperties.Add('Column'); + Result := False; +end; + +procedure TcxGridDBTableSummaryItem.GetPropertyValue(const AName: string; var AValue: Variant); +begin + if AName = 'Column' then + if Column <> nil then + AValue := (Column as IcxStoredObject).GetObjectName + else + AValue := ''; +end; + +procedure TcxGridDBTableSummaryItem.SetPropertyValue(const AName: string; const AValue: Variant); +begin + if AName = 'Column' then + Column := TcxGridColumn(TcxCustomGridTableViewAccess.FindItemByObjectName(GridView, AValue)); +end; + +function TcxGridDBTableSummaryItem.GetDisplayText: string; +begin + Result := DisplayText; +end; + +function TcxGridDBTableSummaryItem.GetVisibleForCustomization: Boolean; +begin + Result := VisibleForCustomization; +end; + +procedure TcxGridDBTableSummaryItem.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridDBTableSummaryItem then + with TcxGridDBTableSummaryItem(Source) do + begin + Self.DisplayText := DisplayText; + Self.VisibleForCustomization := VisibleForCustomization; + end; +end; + +{ TcxGridDBTableView } + +function TcxGridDBTableView.GetColumn(Index: Integer): TcxGridDBColumn; +begin + Result := TcxGridDBColumn(inherited Columns[Index]); +end; + +function TcxGridDBTableView.GetDataController: TcxGridDBDataController; +begin + Result := TcxGridDBDataController(FDataController); +end; + +procedure TcxGridDBTableView.SetColumn(Index: Integer; Value: TcxGridDBColumn); +begin + inherited Columns[Index] := Value; +end; + +procedure TcxGridDBTableView.SetDataController(Value: TcxGridDBDataController); +begin + FDataController.Assign(Value); +end; + +function TcxGridDBTableView.GetDataControllerClass: TcxCustomDataControllerClass; +begin + Result := TcxGridDBDataController; +end; + +function TcxGridDBTableView.GetItemClass: TcxCustomGridTableItemClass; +begin + Result := TcxGridDBColumn; +end; + +function TcxGridDBTableView.GetSummaryItemClass: TcxDataSummaryItemClass; +begin + Result := TcxGridDBTableSummaryItem; +end; + +function TcxGridDBTableView.CreateColumn: TcxGridDBColumn; +begin + Result := TcxGridDBColumn(inherited CreateColumn); +end; + +function TcxGridDBTableView.GetColumnByFieldName(const AFieldName: string): TcxGridDBColumn; +begin + Result := TcxGridDBColumn(DataController.GetItemByFieldName(AFieldName)); +end; + +initialization + cxGridRegisteredViews.Register(TcxGridDBTableView, 'DB Table'); + Classes.RegisterClass(TcxGridDBColumn); + +finalization + cxGridRegisteredViews.Unregister(TcxGridDBTableView); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridDetailsSite.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridDetailsSite.pas new file mode 100644 index 00000000..ade5a2d0 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridDetailsSite.pas @@ -0,0 +1,2041 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridDetailsSite; + +{$I cxVer.inc} +{$I cxGridVer.inc} + +interface + +uses + Windows, Messages, Classes, Graphics, Controls, + cxClasses, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters, +{$IFDEF USETABCONTROL} + cxPC, +{$ENDIF} + cxGridCommon, cxGridLevel, cxGridCustomView; + +const + htTab = 50; + + cxGridTabsRootSize: Integer = 1 + 3; + +type +{$IFNDEF USETABCONTROL} + TcxCustomGridDetailsSiteTabViewInfo = class; +{$ENDIF} + TcxCustomGridDetailsSiteTabsViewInfo = class; + TcxCustomGridDetailsSiteViewInfo = class; + + { hit tests } + + TcxGridDetailsSiteTabHitTestClass = class of TcxGridDetailsSiteTabHitTest; + + TcxGridDetailsSiteTabHitTest = class(TcxCustomGridHitTest) + private + FLevel: TcxGridLevel; + FOwner: TObject; + protected + class function GetHitTestCode: Integer; override; + public + property Level: TcxGridLevel read FLevel write FLevel; + property Owner: TObject read FOwner write FOwner; + end; + + { painters } + +{$IFNDEF USETABCONTROL} + + TcxGridDetailsSiteTabPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxCustomGridDetailsSiteTabViewInfo; + protected + procedure DrawBorder(ABorder: TcxBorder); override; + procedure DrawContent; override; + property ViewInfo: TcxCustomGridDetailsSiteTabViewInfo read GetViewInfo; + end; + +{$ENDIF} + + TcxGridDetailsSiteTabsPainterClass = class of TcxGridDetailsSiteTabsPainter; + + TcxGridDetailsSiteTabsPainter = class + private + FCanvas: TcxCanvas; + FViewInfo: TcxCustomGridDetailsSiteTabsViewInfo; + protected + {$IFNDEF USETABCONTROL} + procedure DrawBackground; virtual; + procedure DrawItems; virtual; + procedure DrawRoot; virtual; + {$ENDIF} + procedure Paint; virtual; + property Canvas: TcxCanvas read FCanvas; + property ViewInfo: TcxCustomGridDetailsSiteTabsViewInfo read FViewInfo; + public + constructor Create(ACanvas: TcxCanvas; AViewInfo: TcxCustomGridDetailsSiteTabsViewInfo); virtual; + procedure MainPaint; + end; + + TcxGridDetailsSitePainterClass = class of TcxGridDetailsSitePainter; + + TcxGridDetailsSitePainter = class + private + FCanvas: TcxCanvas; + FViewInfo: TcxCustomGridDetailsSiteViewInfo; + protected + procedure DrawBackground; virtual; + procedure DrawFrame; virtual; + procedure DrawTabs; virtual; + property Canvas: TcxCanvas read FCanvas; + property ViewInfo: TcxCustomGridDetailsSiteViewInfo read FViewInfo; + public + constructor Create(ACanvas: TcxCanvas; AViewInfo: TcxCustomGridDetailsSiteViewInfo); virtual; + procedure Paint; virtual; + end; + + { view infos } + + // custom tabs + +{$IFNDEF USETABCONTROL} + + TcxCustomGridDetailsSiteTabViewInfoClass = class of TcxCustomGridDetailsSiteTabViewInfo; + + TcxCustomGridDetailsSiteTabViewInfo = class(TcxCustomGridCellViewInfo) + private + FIndex: Integer; + FLevel: TcxGridLevel; + FTabsViewInfo: TcxCustomGridDetailsSiteTabsViewInfo; + function GetActive: Boolean; + function GetCaption: string; + function GetGrid: TcxControl; + function GetIsVertical: Boolean; + function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; + function GetSiteViewInfo: TcxCustomGridDetailsSiteViewInfo; + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + function GetCanvas: TcxCanvas; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetHotTrack: Boolean; override; + function GetIsDesignSelected: Boolean; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetStateForPaint: TcxGridCellState; virtual; + function GetText: string; override; + function GetTextAreaBounds: TRect; override; + function GetTextAttributes(AForPainting: Boolean): Integer; override; + function GetTextForPainting: string; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function HasFirstBorder: Boolean; + function HasLastBorder: Boolean; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + + property Grid: TcxControl read GetGrid; + property Index: Integer read FIndex; + property IsVertical: Boolean read GetIsVertical; + property Level: TcxGridLevel read FLevel; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter; + property SiteViewInfo: TcxCustomGridDetailsSiteViewInfo read GetSiteViewInfo; + property TabsViewInfo: TcxCustomGridDetailsSiteTabsViewInfo read FTabsViewInfo; + public + constructor Create(ATabsViewInfo: TcxCustomGridDetailsSiteTabsViewInfo; + ALevel: TcxGridLevel); virtual; + function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + function ProcessDialogChar(ACharCode: Word): Boolean; virtual; + property Active: Boolean read GetActive; + property Caption: string read GetCaption; + property StateForPaint: TcxGridCellState read GetStateForPaint; + end; + +{$ENDIF} + +{$IFDEF USETABCONTROL} + + TcxGridLevelTabControlClass = class of TcxGridLevelTabControl; + + TcxGridLevelTabControl = class(TcxTabControl) + private + FSiteViewInfo: TcxCustomGridDetailsSiteViewInfo; + FUnderlineHotKeys: Boolean; + function GetActiveLevel: TcxGridLevel; + function GetLevel(Index: Integer): TcxGridLevel; + function GetLevelCount: Integer; + procedure SetActiveLevel(Value: TcxGridLevel); + procedure SetUnderlineHotKeys(Value: Boolean); + procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR; + procedure CMDrag(var Message: TCMDrag); message CM_DRAG; + protected + FocusActiveViewOnChange: Boolean; + procedure AfterPaintTab(ACanvas: TcxCanvas; ATab: TcxTab; + AImageAndTextData: TcxPCOutTabImageAndTextData); override; + procedure Change; override; + function GetLevelDisplayText(ALevel: TcxGridLevel): string; virtual; + function GetTabHitTestClass: TcxGridDetailsSiteTabHitTestClass; virtual; + function HandleDialogChar(Key: Integer): Boolean; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure Notification(AComponent: TComponent; AOperation: TOperation); override; + procedure PrepareTabCanvasFont(ATab: TcxTab; ACanvas: TcxCanvas); override; + procedure WndProc(var Message: TMessage); override; + + procedure DblClick; override; + function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + public + constructor Create(ASiteViewInfo: TcxCustomGridDetailsSiteViewInfo); reintroduce; virtual; + procedure AddLevel(ALevel: TcxGridLevel); + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; virtual; + + property ActiveLevel: TcxGridLevel read GetActiveLevel write SetActiveLevel; + property LevelCount: Integer read GetLevelCount; + property Levels[Index: Integer]: TcxGridLevel read GetLevel; + property SiteViewInfo: TcxCustomGridDetailsSiteViewInfo read FSiteViewInfo; + property UnderlineHotKeys: Boolean read FUnderlineHotKeys write SetUnderlineHotKeys; + end; + +{$ENDIF} + + TcxCustomGridDetailsSiteTabsViewInfoClass = class of TcxCustomGridDetailsSiteTabsViewInfo; + + TcxCustomGridDetailsSiteTabsViewInfo = class + private + FHeight: Integer; + FSiteViewInfo: TcxCustomGridDetailsSiteViewInfo; + {$IFDEF USETABCONTROL} + FTabControl: TcxGridLevelTabControl; + {$ELSE} + FItems: TList; + {$ENDIF} + FWidth: Integer; + function GetActiveLevel: TcxGridLevel; + {$IFNDEF USETABCONTROL} + function GetCanvas: TcxCanvas; + function GetCount: Integer; + function GetItem(Index: Integer): TcxCustomGridDetailsSiteTabViewInfo; + function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; + function GetMainSize: Integer; + function GetTabSize: Integer; + {$ENDIF} + function GetHeight: Integer; + function GetLevel: TcxGridLevel; + function GetWidth: Integer; + {$IFNDEF USETABCONTROL} + procedure CreateItems; + procedure DestroyItems; + {$ENDIF} + protected + procedure AdjustBounds; virtual; abstract; + function CalculateHeight: Integer; virtual; + function CalculateWidth: Integer; virtual; + procedure CheckSiteViewInfoHeight(var AHeight: Integer); virtual; + procedure CheckSiteViewInfoWidth(var AWidth: Integer); virtual; + function GetBkColor: TColor; virtual; + function GetFirstVisibleTabIndex: Integer; virtual; + procedure SetFirstVisibleTabIndex(Value: Integer); virtual; + function GetIsVertical: Boolean; virtual; abstract; + {$IFNDEF USETABCONTROL} + function GetActiveTabOffset: Integer; virtual; abstract; + function GetItemClass: TcxCustomGridDetailsSiteTabViewInfoClass; virtual; abstract; + function GetItemHeight(AItem: TcxCustomGridDetailsSiteTabViewInfo): Integer; virtual; + function GetItemWidth(AItem: TcxCustomGridDetailsSiteTabViewInfo): Integer; virtual; + function GetRootBorders: TcxBorders; virtual; abstract; + function GetRootBounds: TRect; virtual; abstract; + {$ENDIF} + function GetPainterClass: TcxGridDetailsSiteTabsPainterClass; virtual; + {$IFDEF USETABCONTROL} + function AreTabsRotated: Boolean; virtual; + function GetTabControlBounds: TRect; virtual; + function GetTabControlClass: TcxGridLevelTabControlClass; virtual; + function GetTabPosition: TcxTabPosition; virtual; abstract; + procedure InitTabControl; virtual; + procedure InitTabControlData; virtual; + procedure InitTabControlHotKeyParams; virtual; + procedure InitTabControlLayout; virtual; + procedure InitTabControlStyle; virtual; + procedure InitTabsStyle; virtual; + {$ENDIF} + + property FirstVisibleTabIndex: Integer read GetFirstVisibleTabIndex write SetFirstVisibleTabIndex; + property IsVertical: Boolean read GetIsVertical; + property Level: TcxGridLevel read GetLevel; + {$IFNDEF USETABCONTROL} + property ActiveTabOffset: Integer read GetActiveTabOffset; + property Canvas: TcxCanvas read GetCanvas; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter; + property MainSize: Integer read GetMainSize; + property TabSize: Integer read GetTabSize; + {$ENDIF} + public + Bounds: TRect; + constructor Create(ASiteViewInfo: TcxCustomGridDetailsSiteViewInfo); virtual; + destructor Destroy; override; + procedure BeforeRecalculation; virtual; + procedure Calculate(const ABounds: TRect); virtual; + procedure GetClientBounds(var AClientBounds: TRect); virtual; abstract; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; virtual; + function ProcessDialogChar(ACharCode: Word): Boolean; virtual; + + property ActiveLevel: TcxGridLevel read GetActiveLevel; + property BkColor: TColor read GetBkColor; + {$IFDEF USETABCONTROL} + property TabControl: TcxGridLevelTabControl read FTabControl; + {$ELSE} + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxCustomGridDetailsSiteTabViewInfo read GetItem; + property RootBorders: TcxBorders read GetRootBorders; + property RootBounds: TRect read GetRootBounds; + {$ENDIF} + property Height: Integer read GetHeight; + property SiteViewInfo: TcxCustomGridDetailsSiteViewInfo read FSiteViewInfo; + property Width: Integer read GetWidth; + end; + + // left tabs + +{$IFNDEF USETABCONTROL} + + TcxGridDetailsSiteLeftTabViewInfo = class(TcxCustomGridDetailsSiteTabViewInfo) + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetAlignmentVert: TcxAlignmentVert; override; + function GetBorders: TcxBorders; override; + public + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + end; + +{$ENDIF} + + TcxGridDetailsSiteLeftTabsViewInfo = class(TcxCustomGridDetailsSiteTabsViewInfo) + protected + procedure AdjustBounds; override; + procedure CheckSiteViewInfoHeight(var AHeight: Integer); override; + function GetIsVertical: Boolean; override; + {$IFDEF USETABCONTROL} + function GetTabPosition: TcxTabPosition; override; + {$ELSE} + function GetActiveTabOffset: Integer; override; + function GetItemClass: TcxCustomGridDetailsSiteTabViewInfoClass; override; + function GetRootBorders: TcxBorders; override; + function GetRootBounds: TRect; override; + {$ENDIF} + public + procedure GetClientBounds(var AClientBounds: TRect); override; + end; + + // top tabs + +{$IFNDEF USETABCONTROL} + + TcxGridDetailsSiteTopTabViewInfo = class(TcxCustomGridDetailsSiteTabViewInfo) + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetBorders: TcxBorders; override; + public + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + end; + +{$ENDIF} + + TcxGridDetailsSiteTopTabsViewInfo = class(TcxCustomGridDetailsSiteTabsViewInfo) + protected + procedure AdjustBounds; override; + procedure CheckSiteViewInfoWidth(var AWidth: Integer); override; + function GetIsVertical: Boolean; override; + {$IFDEF USETABCONTROL} + function GetTabPosition: TcxTabPosition; override; + {$ELSE} + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetActiveTabOffset: Integer; override; + function GetItemClass: TcxCustomGridDetailsSiteTabViewInfoClass; override; + function GetItemHeight(AItem: TcxCustomGridDetailsSiteTabViewInfo): Integer; override; + function GetItemWidth(AItem: TcxCustomGridDetailsSiteTabViewInfo): Integer; override; + function GetRootBorders: TcxBorders; override; + function GetRootBounds: TRect; override; + {$ENDIF} + public + procedure GetClientBounds(var AClientBounds: TRect); override; + end; + + // custom details site + + TcxCustomGridDetailsSiteViewInfoCachedInfoClass = class of TcxCustomGridDetailsSiteViewInfoCachedInfo; + + TcxCustomGridDetailsSiteViewInfoCachedInfo = class + FirstVisibleTabIndex: Integer; + end; + + TcxCustomGridDetailsSiteViewInfo = class(TcxComponent) + private + FActiveGridView: TcxCustomGridView; + FFullyVisible: Boolean; + FLevel: TcxGridLevel; + FNormalHeight: Integer; + FTabsViewInfo: TcxCustomGridDetailsSiteTabsViewInfo; + function GetClientHeight: Integer; + function GetClientWidth: Integer; + function GetControl: TcxControl; + function GetFrameBounds: TRect; + function GetInternalHeight: Integer; + function GetInternalWidth: Integer; + function GetIsActiveGridViewDestroying: Boolean; + function GetLookAndFeel: TcxLookAndFeel; + function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; + function GetMaxDetailHeight: Integer; + function GetMaxDetailSize: TPoint; + function GetMaxDetailWidth: Integer; + function GetNonClientHeight: Integer; + function GetNonClientWidth: Integer; + function GetTabsPosition: TcxGridDetailTabsPosition; + protected + procedure Notification(AComponent: TComponent; AOperation: TOperation); override; + + function CalculateHeight: Integer; virtual; + function CalculateWidth: Integer; virtual; + function GetBkColor: TColor; virtual; + function GetCanvas: TcxCanvas; virtual; abstract; + function GetClientBounds: TRect; virtual; + function GetContainer: TcxControl; virtual; abstract; + function GetDesignController: TcxCustomGridDesignController; virtual; abstract; + function GetEmptyClientHeight: Integer; virtual; + function GetEmptyClientWidth: Integer; virtual; + function GetFrameColor: TColor; virtual; + function GetFrameWidth: Integer; virtual; + function GetFullyVisible: Boolean; virtual; + function GetHeight: Integer; virtual; + function GetMasterRecord: TObject; virtual; abstract; // TcxCustomGridRecord + function GetMaxHeight: Integer; virtual; abstract; + function GetMaxNormalHeight: Integer; virtual; + function GetMaxWidth: Integer; virtual; abstract; + function GetMinWidth: Integer; virtual; + function GetNormalHeight: Integer; virtual; + function GetWidth: Integer; virtual; + + function GetPainterClass: TcxGridDetailsSitePainterClass; virtual; + function GetTabsViewInfoClass: TcxCustomGridDetailsSiteTabsViewInfoClass; virtual; + + function GetActiveGridView: TcxCustomGridView; virtual; abstract; + function GetActiveGridViewExists: Boolean; virtual; + function GetActiveGridViewValue: TcxCustomGridView; virtual; + function GetActiveLevel: TcxGridLevel; virtual; abstract; + function GetVisible: Boolean; virtual; + + procedure GetLevelTabDefaultParams(var AParams: TcxViewParams); virtual; + procedure GetLevelTabParams(ALevel: TcxGridLevel; var AParams: TcxViewParams); virtual; + procedure InitTabHitTest(AHitTest: TcxGridDetailsSiteTabHitTest); virtual; abstract; + + procedure GetCachedInfo(var AInfo: TcxCustomGridDetailsSiteViewInfoCachedInfo); virtual; + function GetCachedInfoClass: TcxCustomGridDetailsSiteViewInfoCachedInfoClass; virtual; + procedure SetCachedInfo(var AInfo: TcxCustomGridDetailsSiteViewInfoCachedInfo); virtual; + + property ActiveGridView: TcxCustomGridView read GetActiveGridViewValue; + property ActiveGridViewExists: Boolean read GetActiveGridViewExists; + property Canvas: TcxCanvas read GetCanvas; + property ClientHeight: Integer read GetClientHeight; + property ClientWidth: Integer read GetClientWidth; + property Container: TcxControl read GetContainer; // grid or site + property Control: TcxControl read GetControl; // grid + property DesignController: TcxCustomGridDesignController read GetDesignController; + property EmptyClientHeight: Integer read GetEmptyClientHeight; + property EmptyClientWidth: Integer read GetEmptyClientWidth; + property InternalHeight: Integer read GetInternalHeight; + property InternalWidth: Integer read GetInternalWidth; + property IsActiveGridViewDestroying: Boolean read GetIsActiveGridViewDestroying; + property LookAndFeel: TcxLookAndFeel read GetLookAndFeel; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter; + property MaxDetailHeight: Integer read GetMaxDetailHeight; + property MaxDetailSize: TPoint read GetMaxDetailSize; + property MaxDetailWidth: Integer read GetMaxDetailWidth; + property MaxHeight: Integer read GetMaxHeight; + property MaxNormalHeight: Integer read GetMaxNormalHeight; + property MaxWidth: Integer read GetMaxWidth; + property MinWidth: Integer read GetMinWidth; + property NonClientHeight: Integer read GetNonClientHeight; + property NonClientWidth: Integer read GetNonClientWidth; + property TabsPosition: TcxGridDetailTabsPosition read GetTabsPosition; + public + Bounds: TRect; + constructor Create(ALevel: TcxGridLevel); reintroduce; virtual; + destructor Destroy; override; + procedure BeforeRecalculation; virtual; + procedure Calculate(ALeftBound, ATopBound: Integer); virtual; + procedure ChangeActiveTab(ALevel: TcxGridLevel; AFocusView: Boolean = False); virtual; abstract; + function DetailHasData(ALevel: TcxGridLevel): Boolean; virtual; abstract; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; virtual; + function IsTabVisible(ALevel: TcxGridLevel): Boolean; virtual; + procedure Paint(ACanvas: TcxCanvas); + function ProcessDialogChar(ACharCode: Word): Boolean; + function SupportsTabAccelerators: Boolean; virtual; + procedure VisibilityChanged(AVisible: Boolean); virtual; + + property ActiveLevel: TcxGridLevel read GetActiveLevel; + property BkColor: TColor read GetBkColor; + property ClientBounds: TRect read GetClientBounds; + property FrameBounds: TRect read GetFrameBounds; + property FrameColor: TColor read GetFrameColor; + property FrameWidth: Integer read GetFrameWidth; + property FullyVisible: Boolean read GetFullyVisible; + property Height: Integer read GetHeight; + property Level: TcxGridLevel read FLevel; + property MasterRecord: TObject read GetMasterRecord; + property NormalHeight: Integer read GetNormalHeight; + property TabsViewInfo: TcxCustomGridDetailsSiteTabsViewInfo read FTabsViewInfo; + property Visible: Boolean read GetVisible; + property Width: Integer read GetWidth; + end; + +implementation + +uses + SysUtils, Math, Forms, Menus, cxPCPainters, cxGrid, cxGridCustomTableView; + +const + ActiveLeftTabOffset = 3; + ActiveTopTabOffset = 2; + TabsAreaOffset = 2; + TabTextOffset = 5; + +type + TWinControlAccess = class(TWinControl); + +{ TcxGridDetailsSiteTabHitTest } + +class function TcxGridDetailsSiteTabHitTest.GetHitTestCode: Integer; +begin + Result := htTab; +end; + +{$IFNDEF USETABCONTROL} + +{ TcxGridDetailsSiteTabPainter } + +function TcxGridDetailsSiteTabPainter.GetViewInfo: TcxCustomGridDetailsSiteTabViewInfo; +begin + Result := TcxCustomGridDetailsSiteTabViewInfo(inherited ViewInfo); +end; + +procedure TcxGridDetailsSiteTabPainter.DrawBorder(ABorder: TcxBorder); +begin + with ViewInfo do + LookAndFeelPainter.DrawTabBorder(Self.Canvas, BorderBounds[ABorder], ABorder, + Borders, IsVertical); +end; + +procedure TcxGridDetailsSiteTabPainter.DrawContent; +begin + with ViewInfo do + if LookAndFeelPainter.IsDrawTabImplemented(IsVertical) then + LookAndFeelPainter.DrawTab(Self.Canvas, Bounds, Borders, + TextForPainting, GridCellStateToButtonState(StateForPaint), IsVertical, Params.Font, + Params.TextColor, Params.Color, cxGridTabAccelSupport and SiteViewInfo.SupportsTabAccelerators) + else + inherited; +end; + +{$ENDIF} + +{ TcxGridDetailsSiteTabsPainter } + +constructor TcxGridDetailsSiteTabsPainter.Create(ACanvas: TcxCanvas; + AViewInfo: TcxCustomGridDetailsSiteTabsViewInfo); +begin + inherited Create; + FCanvas := ACanvas; + FViewInfo := AViewInfo; +end; + +{$IFNDEF USETABCONTROL} + +procedure TcxGridDetailsSiteTabsPainter.DrawBackground; +begin + Canvas.Brush.Color := ViewInfo.BkColor; + Canvas.FillRect(ViewInfo.Bounds); +end; + +procedure TcxGridDetailsSiteTabsPainter.DrawItems; +var + I: Integer; +begin + for I := 0 to FViewInfo.Count - 1 do + FViewInfo.Items[I].Paint; +end; + +procedure TcxGridDetailsSiteTabsPainter.DrawRoot; +begin + with ViewInfo do + LookAndFeelPainter.DrawTabsRoot(Self.Canvas, RootBounds, RootBorders, IsVertical); +end; + +{$ENDIF} + +procedure TcxGridDetailsSiteTabsPainter.Paint; +begin +{$IFDEF USETABCONTROL} + // to create handle and show control if it was recreated during form loading + ViewInfo.TabControl.UpdateControlState; +{$ELSE} + DrawBackground; + DrawRoot; + DrawItems; +{$ENDIF} +end; + +procedure TcxGridDetailsSiteTabsPainter.MainPaint; +var + AClipRegion, ARegion: TcxRegion; +begin + AClipRegion := Canvas.GetClipRegion; + ARegion := TcxRegion.Create(ViewInfo.Bounds); + Canvas.SetClipRegion(ARegion, roIntersect); + try + Paint; + finally + Canvas.SetClipRegion(AClipRegion, roSet); + end; +end; + +{ TcxGridDetailsSitePainter } + +constructor TcxGridDetailsSitePainter.Create(ACanvas: TcxCanvas; + AViewInfo: TcxCustomGridDetailsSiteViewInfo); +begin + inherited Create; + FCanvas := ACanvas; + FViewInfo := AViewInfo; +end; + +procedure TcxGridDetailsSitePainter.DrawBackground; +begin + Canvas.Brush.Color := ViewInfo.BkColor; + Canvas.FillRect(ViewInfo.ClientBounds); +end; + +procedure TcxGridDetailsSitePainter.DrawFrame; +begin + with ViewInfo do + Self.Canvas.FrameRect(FrameBounds, FrameColor, FrameWidth); +end; + +procedure TcxGridDetailsSitePainter.DrawTabs; +var + AViewInfo: TcxCustomGridDetailsSiteTabsViewInfo; +begin + AViewInfo := ViewInfo.TabsViewInfo; + if AViewInfo <> nil then + with AViewInfo.GetPainterClass.Create(Canvas, AViewInfo) do + try + MainPaint; + finally + Free; + end; +end; + +procedure TcxGridDetailsSitePainter.Paint; +begin + if ViewInfo.FrameWidth <> 0 then + DrawFrame; + DrawTabs; + DrawBackground; + //Canvas.ExcludeClipRect(ViewInfo.Bounds); +end; + +{$IFNDEF USETABCONTROL} + +{ TcxCustomGridDetailsSiteTabViewInfo } + +constructor TcxCustomGridDetailsSiteTabViewInfo.Create(ATabsViewInfo: TcxCustomGridDetailsSiteTabsViewInfo; + ALevel: TcxGridLevel); +begin + inherited Create; + FTabsViewInfo := ATabsViewInfo; + FLevel := ALevel; + FIndex := FLevel.VisibleIndex; +end; + +function TcxCustomGridDetailsSiteTabViewInfo.GetActive: Boolean; +begin + Result := FTabsViewInfo.ActiveLevel = FLevel; +end; + +function TcxCustomGridDetailsSiteTabViewInfo.GetCaption: string; +begin + Result := FLevel.Caption; +end; + +function TcxCustomGridDetailsSiteTabViewInfo.GetGrid: TcxControl; +begin + Result := FLevel.Control; +end; + +function TcxCustomGridDetailsSiteTabViewInfo.GetIsVertical: Boolean; +begin + Result := FTabsViewInfo.IsVertical; +end; + +function TcxCustomGridDetailsSiteTabViewInfo.GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := FTabsViewInfo.LookAndFeelPainter; +end; + +function TcxCustomGridDetailsSiteTabViewInfo.GetSiteViewInfo: TcxCustomGridDetailsSiteViewInfo; +begin + Result := FTabsViewInfo.SiteViewInfo; +end; + +function TcxCustomGridDetailsSiteTabViewInfo.CalculateHeight: Integer; +begin + Result := TextHeightWithOffset; +end; + +function TcxCustomGridDetailsSiteTabViewInfo.CalculateWidth: Integer; +begin + Result := 2 * TabTextOffset + TextWidthWithOffset; +end; + +function TcxCustomGridDetailsSiteTabViewInfo.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := LookAndFeelPainter.TabBorderSize(IsVertical); +end; + +function TcxCustomGridDetailsSiteTabViewInfo.GetCanvas: TcxCanvas; +begin + Result := FTabsViewInfo.Canvas; +end; + +function TcxCustomGridDetailsSiteTabViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridDetailsSiteTabHitTest; +end; + +function TcxCustomGridDetailsSiteTabViewInfo.GetHotTrack: Boolean; +begin + Result := LookAndFeelPainter.IsTabHotTrack(IsVertical); +end; + +function TcxCustomGridDetailsSiteTabViewInfo.GetIsDesignSelected: Boolean; +begin + Result := Grid.IsDesigning and + TcxCustomGrid(Grid).StructureNavigator.IsObjectSelected(FLevel); +end; + +function TcxCustomGridDetailsSiteTabViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridDetailsSiteTabPainter; +end; + +function TcxCustomGridDetailsSiteTabViewInfo.GetStateForPaint: TcxGridCellState; +begin + if Active then + Result := gcsPressed + else + Result := State; +end; + +function TcxCustomGridDetailsSiteTabViewInfo.GetText: string; +begin + Result := Caption; +end; + +function TcxCustomGridDetailsSiteTabViewInfo.GetTextAreaBounds: TRect; +begin + Result := inherited GetTextAreaBounds; + InflateRect(Result, -TabTextOffset, 0); +end; + +function TcxCustomGridDetailsSiteTabViewInfo.GetTextAttributes(AForPainting: Boolean): Integer; +begin + Result := inherited GetTextAttributes(AForPainting); + if cxGridTabAccelSupport and SiteViewInfo.SupportsTabAccelerators then + Result := Result or cxShowPrefix; +end; + +function TcxCustomGridDetailsSiteTabViewInfo.GetTextForPainting: string; +begin + if cxGridTabAccelSupport and not SiteViewInfo.SupportsTabAccelerators then + Result := FLevel.DisplayCaption + else + Result := inherited GetTextForPainting; +end; + +procedure TcxCustomGridDetailsSiteTabViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + FTabsViewInfo.Level.Styles.GetTabParams(TcxCustomGridRecord(SiteViewInfo.MasterRecord), + Level, AParams); +end; + +function TcxCustomGridDetailsSiteTabViewInfo.HasFirstBorder: Boolean; +begin + Result := (Index = 0) or not TabsViewInfo.Items[Index - 1].Active; +end; + +function TcxCustomGridDetailsSiteTabViewInfo.HasLastBorder: Boolean; +begin + Result := (Index = TabsViewInfo.Count - 1) or not TabsViewInfo.Items[Index + 1].Active; +end; + +procedure TcxCustomGridDetailsSiteTabViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + inherited; + TcxGridDetailsSiteTabHitTest(AHitTest).Level := FLevel; + SiteViewInfo.InitTabHitTest(TcxGridDetailsSiteTabHitTest(AHitTest)); +end; + +function TcxCustomGridDetailsSiteTabViewInfo.MouseDown(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +begin + inherited MouseDown(AHitTest, AButton, AShift); + if (AButton = mbLeft) and not (ssDouble in AShift) and Grid.IsDesigning then + TcxCustomGrid(Grid).StructureNavigator.SelectObject(FLevel, not (ssShift in AShift)); + SiteViewInfo.ChangeActiveTab(FLevel, False); + Result := True; +end; + +function TcxCustomGridDetailsSiteTabViewInfo.ProcessDialogChar(ACharCode: Word): Boolean; +begin + Result := cxGridTabAccelSupport and SiteViewInfo.SupportsTabAccelerators and + IsAccel(ACharCode, Caption); + if Result then + SiteViewInfo.ChangeActiveTab(FLevel, True); +end; + +{$ENDIF} + +{$IFDEF USETABCONTROL} + +{ TcxGridTabControl } + +constructor TcxGridLevelTabControl.Create(ASiteViewInfo: TcxCustomGridDetailsSiteViewInfo); +begin + inherited Create(nil); + Focusable := False; + IsTabsContainer := True; + Options := Options + [pcoFixedTabWidthWhenRotated]; + ParentBackground := False; + FSiteViewInfo := ASiteViewInfo; + FUnderlineHotKeys := True; +end; + +function TcxGridLevelTabControl.GetActiveLevel: TcxGridLevel; +begin + if TabIndex = -1 then + Result := nil + else + Result := Levels[TabIndex]; +end; + +function TcxGridLevelTabControl.GetLevel(Index: Integer): TcxGridLevel; +begin + Result := TcxGridLevel(Tabs.Objects[Index]); +end; + +function TcxGridLevelTabControl.GetLevelCount: Integer; +begin + Result := Tabs.Count; +end; + +procedure TcxGridLevelTabControl.SetActiveLevel(Value: TcxGridLevel); +var + ATabIndex: Integer; +begin + ATabIndex := Tabs.IndexOfObject(Value); + if ATabIndex = -1 then ATabIndex := 0; + TabIndex := ATabIndex; +end; + +procedure TcxGridLevelTabControl.SetUnderlineHotKeys(Value: Boolean); +var + I: Integer; +begin + if FUnderlineHotKeys <> Value then + begin + FUnderlineHotKeys := Value; + for I := 0 to Tabs.Count - 1 do + Tabs[I].Caption := GetLevelDisplayText(Levels[I]); + end; +end; + +procedure TcxGridLevelTabControl.CMDialogChar(var Message: TCMDialogChar); +begin + // no default handling +end; + +procedure TcxGridLevelTabControl.CMDrag(var Message: TCMDrag); +begin + // to restore correct handle after previous TabControl was destroyed as result of tab change + Message.DragRec.Source.DragHandle := Handle; + // no default behavior - message goes to parent in WndProc +end; + +procedure TcxGridLevelTabControl.AfterPaintTab(ACanvas: TcxCanvas; ATab: TcxTab; + AImageAndTextData: TcxPCOutTabImageAndTextData); + + function GetDesignSelectionBounds: TRect; + begin + Result := AImageAndTextData.TabTextRect; + InflateRect(Result, cxDesignSelectionWidth, cxDesignSelectionWidth); + if IsVerticalText(Self) then + InflateRect(Result, 0, 1) + else + InflateRect(Result, 1, 0); + end; + +begin + inherited; + if SiteViewInfo.Container.IsDesigning and + SiteViewInfo.DesignController.IsObjectSelected(Levels[ATab.Index]) then + ACanvas.DrawDesignSelection(GetDesignSelectionBounds); +end; + +procedure TcxGridLevelTabControl.Change; +begin + inherited; + SiteViewInfo.ChangeActiveTab(ActiveLevel, FocusActiveViewOnChange); +end; + +function TcxGridLevelTabControl.GetLevelDisplayText(ALevel: TcxGridLevel): string; + + procedure ConvertTextToDisplayText(var AText: string); + var + I: Integer; + begin + for I := Length(AText) downto 1 do + if AText[I] = cHotkeyPrefix then + Insert(cHotkeyPrefix, AText, I); + end; + +begin + Result := ALevel.Caption; + if cxGridTabAccelSupport then + if UnderlineHotKeys then + // nothing to do + else + begin + Result := StripHotkey(Result); + ConvertTextToDisplayText(Result); + end + else + ConvertTextToDisplayText(Result); +end; + +function TcxGridLevelTabControl.GetTabHitTestClass: TcxGridDetailsSiteTabHitTestClass; +begin + Result := TcxGridDetailsSiteTabHitTest; +end; + +function TcxGridLevelTabControl.HandleDialogChar(Key: Integer): Boolean; +begin + FocusActiveViewOnChange := (SiteViewInfo.ActiveGridView <> nil) and + SiteViewInfo.ActiveGridView.Focused; + try + Result := inherited HandleDialogChar(Key); + finally + FocusActiveViewOnChange := False; + end; +end; + +procedure TcxGridLevelTabControl.Notification(AComponent: TComponent; AOperation: TOperation); +var + ATabIndex: Integer; +begin + inherited; + if (AOperation = opRemove) and (AComponent is TcxGridLevel) then + begin + ATabIndex := Tabs.IndexOfObject(AComponent); + if ATabIndex <> -1 then + Tabs.Delete(ATabIndex); + end; +end; + +procedure TcxGridLevelTabControl.MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +var + ATabIndex: Integer; + AParent: TWinControl; + P: TPoint; +begin + if (Button = mbLeft) and not (ssDouble in Shift) and SiteViewInfo.Container.IsDesigning then + begin + ATabIndex := IndexOfTabAt(X, Y); + if ATabIndex <> -1 then + SiteViewInfo.DesignController.SelectObject(Levels[ATabIndex], not (ssShift in Shift)); + end; + AParent := Parent; + P := AParent.ScreenToClient(ClientToScreen(Point(X, Y))); + inherited; + TWinControlAccess(AParent).MouseDown(Button, Shift, P.X, P.Y); +end; + +procedure TcxGridLevelTabControl.PrepareTabCanvasFont(ATab: TcxTab; ACanvas: TcxCanvas); +var + AParams: TcxViewParams; +begin + inherited; + if (Levels[ATab.Index] = nil) or (LookAndFeel.SkinPainter <> nil) then Exit; + SiteViewInfo.GetLevelTabParams(Levels[ATab.Index], AParams); + ACanvas.Font := AParams.Font; + ACanvas.Font.Color := AParams.TextColor; +end; + +procedure TcxGridLevelTabControl.WndProc(var Message: TMessage); +begin + inherited; + // TabControl is transparent for drag & drop: message goes to parent (site) + if Message.Msg = CM_DRAG then + with Message do + Result := Parent.Perform(Msg, WParam, LParam); +end; + +procedure TcxGridLevelTabControl.DblClick; +begin + inherited; + TWinControlAccess(Parent).DblClick; +end; + +function TcxGridLevelTabControl.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; +begin + Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos); + if not Result then + Result := TWinControlAccess(Parent).DoMouseWheel(Shift, WheelDelta, MousePos); +end; + +procedure TcxGridLevelTabControl.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited; + with Parent.ScreenToClient(ClientToScreen(Point(X, Y))) do + TWinControlAccess(Parent).MouseMove(Shift, X, Y); +end; + +procedure TcxGridLevelTabControl.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +var + AParent: TWinControl; + P: TPoint; +begin + AParent := Parent; + P := AParent.ScreenToClient(ClientToScreen(Point(X, Y))); + inherited; + TWinControlAccess(AParent).MouseUp(Button, Shift, P.X, P.Y); +end; + +procedure TcxGridLevelTabControl.AddLevel(ALevel: TcxGridLevel); +var + ATabIndex: Integer; +begin + ATabIndex := Tabs.AddObject(GetLevelDisplayText(ALevel), ALevel); + Tabs[ATabIndex].ImageIndex := ALevel.ImageIndex; + ALevel.FreeNotification(Self); +end; + +function TcxGridLevelTabControl.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +var + ATabIndex: Integer; +begin + ATabIndex := IndexOfTabAt(P.X, P.Y); + if ATabIndex = -1 then + Result := nil + else + begin + Result := GetTabHitTestClass.Instance(P); + Result.ViewInfo := nil; + TcxGridDetailsSiteTabHitTest(Result).Level := Levels[ATabIndex]; + SiteViewInfo.InitTabHitTest(TcxGridDetailsSiteTabHitTest(Result)); + end; +end; + +{$ENDIF} + +{ TcxCustomGridDetailsSiteTabsViewInfo } + +constructor TcxCustomGridDetailsSiteTabsViewInfo.Create(ASiteViewInfo: TcxCustomGridDetailsSiteViewInfo); +begin + inherited Create; + FSiteViewInfo := ASiteViewInfo; +{$IFDEF USETABCONTROL} + FTabControl := GetTabControlClass.Create(FSiteViewInfo); + InitTabControl; +{$ELSE} + CreateItems; +{$ENDIF} +end; + +destructor TcxCustomGridDetailsSiteTabsViewInfo.Destroy; +begin +{$IFDEF USETABCONTROL} + TabControl.Parent := nil; + FreeAndNil(FTabControl); +{$ELSE} + DestroyItems; +{$ENDIF} + inherited; +end; + +function TcxCustomGridDetailsSiteTabsViewInfo.GetActiveLevel: TcxGridLevel; +begin + Result := FSiteViewInfo.ActiveLevel; +end; + +{$IFNDEF USETABCONTROL} + +function TcxCustomGridDetailsSiteTabsViewInfo.GetCanvas: TcxCanvas; +begin + Result := FSiteViewInfo.Canvas; +end; + +function TcxCustomGridDetailsSiteTabsViewInfo.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxCustomGridDetailsSiteTabsViewInfo.GetItem(Index: Integer): TcxCustomGridDetailsSiteTabViewInfo; +begin + Result := TcxCustomGridDetailsSiteTabViewInfo(FItems[Index]); +end; + +function TcxCustomGridDetailsSiteTabsViewInfo.GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := FSiteViewInfo.LookAndFeelPainter; +end; + +function TcxCustomGridDetailsSiteTabsViewInfo.GetMainSize: Integer; +begin + if IsVertical then + Result := Width + else + Result := Height; +end; + +function TcxCustomGridDetailsSiteTabsViewInfo.GetTabSize: Integer; +begin + Result := MainSize - TabsAreaOffset - (cxGridTabsRootSize - 1); +end; + +{$ENDIF} + +function TcxCustomGridDetailsSiteTabsViewInfo.GetHeight: Integer; +begin + if FHeight = 0 then + FHeight := CalculateHeight; + Result := FHeight; +end; + +function TcxCustomGridDetailsSiteTabsViewInfo.GetLevel: TcxGridLevel; +begin + Result := FSiteViewInfo.Level; +end; + +function TcxCustomGridDetailsSiteTabsViewInfo.GetWidth: Integer; +begin + if FWidth = 0 then + FWidth := CalculateWidth; + Result := FWidth; +end; + +{$IFNDEF USETABCONTROL} + +procedure TcxCustomGridDetailsSiteTabsViewInfo.CreateItems; +var + I: Integer; +begin + FItems := TList.Create; + for I := 0 to Level.VisibleCount - 1 do + FItems.Add(GetItemClass.Create(Self, Level.VisibleItems[I])); +end; + +procedure TcxCustomGridDetailsSiteTabsViewInfo.DestroyItems; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].Free; + FItems.Free; +end; + +{$ENDIF} + +function TcxCustomGridDetailsSiteTabsViewInfo.CalculateHeight: Integer; +{$IFNDEF USETABCONTROL} +var + I: Integer; +{$ENDIF} +begin +{$IFDEF USETABCONTROL} + if IsVertical then + Result := TabControl.GetOptimalSize + else + Result := TabControl.DisplayRect.Top; +{$ELSE} + Result := 2 * TabsAreaOffset; + for I := 0 to Count - 1 do + Inc(Result, GetItemHeight(Items[I])); +{$ENDIF} +end; + +function TcxCustomGridDetailsSiteTabsViewInfo.CalculateWidth: Integer; +{$IFNDEF USETABCONTROL} +var + I, AItemWidth: Integer; +{$ENDIF} +begin +{$IFDEF USETABCONTROL} + if IsVertical then + Result := TabControl.DisplayRect.Left + else + Result := TabControl.GetOptimalSize; +{$ELSE} + Result := 0; + for I := 0 to Count - 1 do + begin + AItemWidth := GetItemWidth(Items[I]); + if AItemWidth > Result then Result := AItemWidth; + end; + if Count > 1 then Inc(Result, ActiveTabOffset); + Inc(Result, TabsAreaOffset + cxGridTabsRootSize - 1); +{$ENDIF} +end; + +procedure TcxCustomGridDetailsSiteTabsViewInfo.CheckSiteViewInfoHeight(var AHeight: Integer); +begin +end; + +procedure TcxCustomGridDetailsSiteTabsViewInfo.CheckSiteViewInfoWidth(var AWidth: Integer); +begin +end; + +function TcxCustomGridDetailsSiteTabsViewInfo.GetBkColor: TColor; +var + AParams: TcxViewParams; +begin + Level.Styles.GetViewParams(lsTabsBackground, nil, nil, AParams); + Result := AParams.Color; +end; + +function TcxCustomGridDetailsSiteTabsViewInfo.GetFirstVisibleTabIndex: Integer; +begin +{$IFDEF USETABCONTROL} + Result := TabControl.FirstVisibleTab; +{$ELSE} + Result := 0; +{$ENDIF} +end; + +procedure TcxCustomGridDetailsSiteTabsViewInfo.SetFirstVisibleTabIndex(Value: Integer); +begin +{$IFDEF USETABCONTROL} + TabControl.FirstVisibleTab := Value; +{$ENDIF} +end; + +{$IFNDEF USETABCONTROL} + +function TcxCustomGridDetailsSiteTabsViewInfo.GetItemHeight(AItem: TcxCustomGridDetailsSiteTabViewInfo): Integer; +begin + Result := AItem.CalculateHeight; +end; + +function TcxCustomGridDetailsSiteTabsViewInfo.GetItemWidth(AItem: TcxCustomGridDetailsSiteTabViewInfo): Integer; +begin + Result := AItem.CalculateWidth; +end; + +{$ENDIF} + +function TcxCustomGridDetailsSiteTabsViewInfo.GetPainterClass: TcxGridDetailsSiteTabsPainterClass; +begin + Result := TcxGridDetailsSiteTabsPainter; +end; + +{$IFDEF USETABCONTROL} + +function TcxCustomGridDetailsSiteTabsViewInfo.AreTabsRotated: Boolean; +begin + Result := IsVertical; +end; + +function TcxCustomGridDetailsSiteTabsViewInfo.GetTabControlBounds: TRect; +begin + Result := Bounds; +end; + +function TcxCustomGridDetailsSiteTabsViewInfo.GetTabControlClass: TcxGridLevelTabControlClass; +begin + Result := TcxGridLevelTabControl; +end; + +procedure TcxCustomGridDetailsSiteTabsViewInfo.InitTabControl; +begin + InitTabControlHotKeyParams; + InitTabControlData; + InitTabControlLayout; + InitTabControlStyle; +end; + +procedure TcxCustomGridDetailsSiteTabsViewInfo.InitTabControlData; +var + I: Integer; + AActiveLevel, ALevel: TcxGridLevel; +begin + AActiveLevel := ActiveLevel; + for I := 0 to Level.VisibleCount - 1 do + begin + ALevel := Level.VisibleItems[I]; + if (ALevel = AActiveLevel) or SiteViewInfo.IsTabVisible(ALevel) then + TabControl.AddLevel(ALevel); + end; + TabControl.ActiveLevel := AActiveLevel; +end; + +procedure TcxCustomGridDetailsSiteTabsViewInfo.InitTabControlHotKeyParams; +begin + TabControl.UnderlineHotKeys := SiteViewInfo.SupportsTabAccelerators; +end; + +procedure TcxCustomGridDetailsSiteTabsViewInfo.InitTabControlLayout; +begin + TabControl.Rotate := AreTabsRotated; + TabControl.TabPosition := GetTabPosition; +end; + +procedure TcxCustomGridDetailsSiteTabsViewInfo.InitTabControlStyle; +var + ATabsInfo: TcxGridLevelTabs; +begin + ATabsInfo := TcxCustomGrid(SiteViewInfo.Control).LevelTabs; + if BkColor <> clDefault then + TabControl.Color := BkColor; + TabControl.ImageBorder := ATabsInfo.ImageBorder; + TabControl.Images := ATabsInfo.Images; + TabControl.TabCaptionAlignment := ATabsInfo.CaptionAlignment; + TabControl.Style := ATabsInfo.Style; + TabControl.TabSlants := ATabsInfo.Slants; + TabControl.LookAndFeel.MasterLookAndFeel := SiteViewInfo.LookAndFeel; + InitTabsStyle; +end; + +procedure TcxCustomGridDetailsSiteTabsViewInfo.InitTabsStyle; +var + ATabDefaultParams, ATabParams: TcxViewParams; + I: Integer; +begin + SiteViewInfo.GetLevelTabDefaultParams(ATabDefaultParams); + for I := 0 to TabControl.Tabs.Count - 1 do + begin + SiteViewInfo.GetLevelTabParams(TabControl.Levels[I], ATabParams); + if ATabParams.Color <> ATabDefaultParams.Color then + TabControl.Tabs[I].Color := ATabParams.Color; + end; +end; + +{$ENDIF} + +procedure TcxCustomGridDetailsSiteTabsViewInfo.BeforeRecalculation; +begin +{$IFDEF USETABCONTROL} + InitTabControlHotKeyParams; +{$ENDIF} +end; + +procedure TcxCustomGridDetailsSiteTabsViewInfo.Calculate(const ABounds: TRect); +{$IFNDEF USETABCONTROL} +var + ATabLeft, ATabTop, ATabSize, I: Integer; + + procedure CalculateFirstTabPos; + begin + ATabLeft := Bounds.Left + TabsAreaOffset; + ATabTop := Bounds.Top + TabsAreaOffset; + if (Count <> 0) and Items[0].Active then + if IsVertical then + Dec(ATabTop, Items[0].BorderWidth[bTop]) + else + Dec(ATabLeft, Items[0].BorderWidth[bLeft]); + end; + + function GetTabWidth: Integer; + begin + if IsVertical then + Result := ATabSize + else + Result := -1; + end; + + function GetTabHeight: Integer; + begin + if IsVertical then + Result := -1 + else + Result := ATabSize; + end; + + procedure CalculateNextTabPos; + begin + if IsVertical then + Inc(ATabTop, Items[I].Height) + else + Inc(ATabLeft, Items[I].Width); + end; +{$ENDIF} +begin + Bounds := ABounds; + AdjustBounds; +{$IFDEF USETABCONTROL} + TabControl.BoundsRect := GetTabControlBounds; + TabControl.Parent := SiteViewInfo.Container; +{$ELSE} + CalculateFirstTabPos; + ATabSize := TabSize; + for I := 0 to Count - 1 do + begin + Items[I].Calculate(ATabLeft, ATabTop, GetTabWidth, GetTabHeight); + CalculateNextTabPos; + end; +{$ENDIF} +end; + +function TcxCustomGridDetailsSiteTabsViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +{$IFNDEF USETABCONTROL} +var + I: Integer; +{$ENDIF} +begin +{$IFDEF USETABCONTROL} + Result := TabControl.GetHitTest(TabControl.ScreenToClient(SiteViewInfo.Container.ClientToScreen(P))); +{$ELSE} + Result := nil; + for I := 0 to Count - 1 do + begin + Result := Items[I].GetHitTest(P); + if Result <> nil then Break; + end; +{$ENDIF} +end; + +function TcxCustomGridDetailsSiteTabsViewInfo.ProcessDialogChar(ACharCode: Word): Boolean; +{$IFNDEF USETABCONTROL} +var + I: Integer; +{$ENDIF} +begin +{$IFDEF USETABCONTROL} + Result := TabControl.HandleDialogChar(ACharCode); +{$ELSE} + for I := 0 to Count - 1 do + begin + Result := Items[I].Visible and Items[I].ProcessDialogChar(ACharCode); + if Result then Exit; + end; + Result := False; +{$ENDIF} +end; + +{$IFNDEF USETABCONTROL} + +{ TcxGridDetailsSiteLeftTabViewInfo } + +function TcxGridDetailsSiteLeftTabViewInfo.CalculateHeight: Integer; +begin + Result := inherited CalculateHeight; + if Active then Inc(Result, BorderWidth[bTop] + BorderWidth[bBottom]); + Inc(Result, BorderSize[bTop] + BorderSize[bBottom]); +end; + +function TcxGridDetailsSiteLeftTabViewInfo.CalculateWidth: Integer; +begin + Result := inherited CalculateWidth; + Inc(Result, BorderWidth[bLeft] + BorderWidth[bRight]); +end; + +function TcxGridDetailsSiteLeftTabViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + Result := vaCenter; +end; + +function TcxGridDetailsSiteLeftTabViewInfo.GetBorders: TcxBorders; +begin + Result := [bLeft]; + if Active then + Result := Result + [bTop, bBottom] + else + begin + Include(Result, bRight); + if HasFirstBorder then Include(Result, bTop); + if HasLastBorder then Include(Result, bBottom); + end; +end; + +procedure TcxGridDetailsSiteLeftTabViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + if not Active then + begin + Inc(ALeftBound, TabsViewInfo.ActiveTabOffset); + if AWidth <> -1 then Dec(AWidth, TabsViewInfo.ActiveTabOffset); + end; + inherited; +end; + +{$ENDIF} + +{ TcxGridDetailsSiteLeftTabsViewInfo } + +procedure TcxGridDetailsSiteLeftTabsViewInfo.AdjustBounds; +begin + Bounds.Right := Min(Bounds.Left + Width, Bounds.Right); +end; + +procedure TcxGridDetailsSiteLeftTabsViewInfo.CheckSiteViewInfoHeight(var AHeight: Integer); +begin + inherited; + if AHeight < Height then AHeight := Height; +end; + +function TcxGridDetailsSiteLeftTabsViewInfo.GetIsVertical: Boolean; +begin + Result := True; +end; + +{$IFDEF USETABCONTROL} + +function TcxGridDetailsSiteLeftTabsViewInfo.GetTabPosition: TcxTabPosition; +begin + Result := tpLeft; +end; + +{$ELSE} + +function TcxGridDetailsSiteLeftTabsViewInfo.GetActiveTabOffset: Integer; +begin + Result := ActiveLeftTabOffset; +end; + +function TcxGridDetailsSiteLeftTabsViewInfo.GetItemClass: TcxCustomGridDetailsSiteTabViewInfoClass; +begin + Result := TcxGridDetailsSiteLeftTabViewInfo; +end; + +function TcxGridDetailsSiteLeftTabsViewInfo.GetRootBorders: TcxBorders; +begin + Result := [bLeft, bTop, bBottom]; +end; + +function TcxGridDetailsSiteLeftTabsViewInfo.GetRootBounds: TRect; +begin + Result := Bounds; + Result.Left := Result.Right - cxGridTabsRootSize; +end; + +{$ENDIF} + +procedure TcxGridDetailsSiteLeftTabsViewInfo.GetClientBounds(var AClientBounds: TRect); +begin + Inc(AClientBounds.Left, Width); +end; + +{$IFNDEF USETABCONTROL} + +{ TcxGridDetailsSiteTopTabViewInfo } + +function TcxGridDetailsSiteTopTabViewInfo.CalculateHeight: Integer; +begin + Result := inherited CalculateHeight; + Inc(Result, BorderWidth[bTop] + BorderWidth[bBottom]); +end; + +function TcxGridDetailsSiteTopTabViewInfo.CalculateWidth: Integer; +begin + Result := inherited CalculateWidth; + if Active then Inc(Result, BorderWidth[bLeft] + BorderWidth[bRight]); + Inc(Result, BorderSize[bLeft] + BorderSize[bRight]); +end; + +function TcxGridDetailsSiteTopTabViewInfo.GetBorders: TcxBorders; +begin + Result := [bTop]; + if Active then + Result := Result + [bLeft, bRight] + else + begin + Include(Result, bBottom); + if HasFirstBorder then Include(Result, bLeft); + if HasLastBorder then Include(Result, bRight); + end; +end; + +procedure TcxGridDetailsSiteTopTabViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + if not Active then + begin + Inc(ATopBound, TabsViewInfo.ActiveTabOffset); + if AHeight <> -1 then Dec(AHeight, TabsViewInfo.ActiveTabOffset); + end; + inherited; +end; + +{$ENDIF} + +{ TcxGridDetailsSiteTopTabsViewInfo } + +procedure TcxGridDetailsSiteTopTabsViewInfo.AdjustBounds; +begin + Bounds.Bottom := Min(Bounds.Top + Height, Bounds.Bottom); +end; + +procedure TcxGridDetailsSiteTopTabsViewInfo.CheckSiteViewInfoWidth(var AWidth: Integer); +begin + inherited; + if AWidth < Width then AWidth := Width; +end; + +function TcxGridDetailsSiteTopTabsViewInfo.GetIsVertical: Boolean; +begin + Result := False; +end; + +{$IFDEF USETABCONTROL} + +function TcxGridDetailsSiteTopTabsViewInfo.GetTabPosition: TcxTabPosition; +begin + Result := tpTop; +end; + +{$ELSE} + +function TcxGridDetailsSiteTopTabsViewInfo.CalculateHeight: Integer; +begin + Result := inherited CalculateWidth; +end; + +function TcxGridDetailsSiteTopTabsViewInfo.CalculateWidth: Integer; +begin + Result := inherited CalculateHeight; +end; + +function TcxGridDetailsSiteTopTabsViewInfo.GetActiveTabOffset: Integer; +begin + Result := ActiveTopTabOffset; +end; + +function TcxGridDetailsSiteTopTabsViewInfo.GetItemClass: TcxCustomGridDetailsSiteTabViewInfoClass; +begin + Result := TcxGridDetailsSiteTopTabViewInfo; +end; + +function TcxGridDetailsSiteTopTabsViewInfo.GetItemHeight(AItem: TcxCustomGridDetailsSiteTabViewInfo): Integer; +begin + Result := inherited GetItemWidth(AItem); +end; + +function TcxGridDetailsSiteTopTabsViewInfo.GetItemWidth(AItem: TcxCustomGridDetailsSiteTabViewInfo): Integer; +begin + Result := inherited GetItemHeight(AItem); +end; + +function TcxGridDetailsSiteTopTabsViewInfo.GetRootBorders: TcxBorders; +begin + Result := [bLeft, bTop, bRight]; +end; + +function TcxGridDetailsSiteTopTabsViewInfo.GetRootBounds: TRect; +begin + Result := Bounds; + Result.Top := Result.Bottom - cxGridTabsRootSize; +end; + +{$ENDIF} + +procedure TcxGridDetailsSiteTopTabsViewInfo.GetClientBounds(var AClientBounds: TRect); +begin + Inc(AClientBounds.Top, Height); +end; + +{ TcxCustomGridDetailsSiteViewInfo } + +constructor TcxCustomGridDetailsSiteViewInfo.Create(ALevel: TcxGridLevel); +begin + inherited Create(nil); + FLevel := ALevel; + if GetTabsViewInfoClass <> nil then + FTabsViewInfo := GetTabsViewInfoClass.Create(Self); +end; + +destructor TcxCustomGridDetailsSiteViewInfo.Destroy; +begin + VisibilityChanged(False); + FTabsViewInfo.Free; + inherited; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetClientHeight: Integer; +begin + with ClientBounds do + Result := Bottom - Top; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetClientWidth: Integer; +begin + with ClientBounds do + Result := Right - Left; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetControl: TcxControl; +begin + Result := FLevel.Control; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetFrameBounds: TRect; +begin + Result := ClientBounds; + InflateRect(Result, FrameWidth, FrameWidth); +end; + +function TcxCustomGridDetailsSiteViewInfo.GetInternalHeight: Integer; +begin + with Bounds do + Result := Bottom - Top; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetInternalWidth: Integer; +begin + with Bounds do + Result := Right - Left; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetIsActiveGridViewDestroying: Boolean; +begin + Result := (FActiveGridView <> nil) and FActiveGridView.IsDestroying; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetLookAndFeel: TcxLookAndFeel; +begin + Result := TcxCustomGrid(Control).LookAndFeel; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := LookAndFeel.Painter; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetMaxDetailHeight: Integer; +begin + Result := MaxHeight - NonClientHeight; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetMaxDetailSize: TPoint; +begin + Result := Point(MaxDetailWidth, MaxDetailHeight); +end; + +function TcxCustomGridDetailsSiteViewInfo.GetMaxDetailWidth: Integer; +begin + Result := MaxWidth - NonClientWidth; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetNonClientHeight: Integer; +begin + Result := InternalHeight - ClientHeight; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetNonClientWidth: Integer; +begin + Result := InternalWidth - ClientWidth; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetTabsPosition: TcxGridDetailTabsPosition; +begin + Result := Level.Options.DetailTabsPosition; +end; + +procedure TcxCustomGridDetailsSiteViewInfo.Notification(AComponent: TComponent; + AOperation: TOperation); +begin + inherited; + if (AOperation = opRemove) and (AComponent = FActiveGridView) then + FActiveGridView := nil; +end; + +function TcxCustomGridDetailsSiteViewInfo.CalculateHeight: Integer; +begin + if ActiveGridView = nil then + begin + FFullyVisible := True; + Result := EmptyClientHeight; + end + else + begin + Result := 0; + FFullyVisible := False; + ActiveGridView.ViewInfo.GetHeight(MaxDetailSize, Result, FFullyVisible); + end; + Inc(Result, NonClientHeight); + if FTabsViewInfo <> nil then + FTabsViewInfo.CheckSiteViewInfoHeight(Result); + FNormalHeight := Result; + if FNormalHeight > MaxNormalHeight then FNormalHeight := MaxNormalHeight; + if not FullyVisible then + Result := MaxHeight + else + begin + if Result > MaxHeight then Result := MaxHeight; + if Result < 0 then Result := 0; + end; + if FNormalHeight < Result then FNormalHeight := Result; +end; + +function TcxCustomGridDetailsSiteViewInfo.CalculateWidth: Integer; +begin + if ActiveGridView = nil then + Result := EmptyClientWidth + else + ActiveGridView.ViewInfo.GetWidth(MaxDetailSize, Result); + Inc(Result, NonClientWidth); + if FTabsViewInfo <> nil then + FTabsViewInfo.CheckSiteViewInfoWidth(Result); + if Result < MinWidth then Result := MinWidth; + if Result > MaxWidth then Result := MaxWidth; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetBkColor: TColor; +begin + Result := TcxCustomGrid(Control).Color; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetClientBounds: TRect; +begin + Result := Bounds; + if FTabsViewInfo <> nil then + FTabsViewInfo.GetClientBounds(Result); + InflateRect(Result, -FrameWidth, -FrameWidth); +end; + +function TcxCustomGridDetailsSiteViewInfo.GetEmptyClientHeight: Integer; +begin + Result := 100; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetEmptyClientWidth: Integer; +begin + Result := 200; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetFrameColor: TColor; +begin + Result := FLevel.Options.GetDetailFrameColor; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetFrameWidth: Integer; +begin + Result := Level.Options.DetailFrameWidth; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetFullyVisible: Boolean; +begin + Result := FFullyVisible; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetHeight: Integer; +begin + Result := CalculateHeight; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetMaxNormalHeight: Integer; +begin + Result := MaxInt; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetMinWidth: Integer; +begin + Result := MaxWidth; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetNormalHeight: Integer; +begin + Result := FNormalHeight; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetWidth: Integer; +begin + Result := CalculateWidth; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetPainterClass: TcxGridDetailsSitePainterClass; +begin + Result := TcxGridDetailsSitePainter; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetTabsViewInfoClass: TcxCustomGridDetailsSiteTabsViewInfoClass; +begin + case TabsPosition of + dtpLeft: + Result := TcxGridDetailsSiteLeftTabsViewInfo; + dtpTop: + Result := TcxGridDetailsSiteTopTabsViewInfo; + else + Result := nil; + end; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetActiveGridViewExists: Boolean; +begin + Result := (FActiveGridView <> nil) and not IsActiveGridViewDestroying; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetActiveGridViewValue: TcxCustomGridView; +begin + if FActiveGridView = nil then + begin + FActiveGridView := GetActiveGridView; + if FActiveGridView <> nil then + FActiveGridView.FreeNotification(Self); + end; + Result := FActiveGridView; + if IsActiveGridViewDestroying then + Result := nil; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetVisible: Boolean; +begin + Result := True; +end; + +procedure TcxCustomGridDetailsSiteViewInfo.GetLevelTabDefaultParams(var AParams: TcxViewParams); +begin + Level.Styles.GetTabDefaultParams(AParams); +end; + +procedure TcxCustomGridDetailsSiteViewInfo.GetLevelTabParams(ALevel: TcxGridLevel; + var AParams: TcxViewParams); +begin + Level.Styles.GetTabParams(TcxCustomGridRecord(MasterRecord), ALevel, AParams); +end; + +procedure TcxCustomGridDetailsSiteViewInfo.GetCachedInfo(var AInfo: TcxCustomGridDetailsSiteViewInfoCachedInfo); +begin + AInfo := GetCachedInfoClass.Create; + if TabsViewInfo <> nil then + AInfo.FirstVisibleTabIndex := TabsViewInfo.FirstVisibleTabIndex; +end; + +function TcxCustomGridDetailsSiteViewInfo.GetCachedInfoClass: TcxCustomGridDetailsSiteViewInfoCachedInfoClass; +begin + Result := TcxCustomGridDetailsSiteViewInfoCachedInfo; +end; + +procedure TcxCustomGridDetailsSiteViewInfo.SetCachedInfo(var AInfo: TcxCustomGridDetailsSiteViewInfoCachedInfo); +begin + if TabsViewInfo <> nil then + TabsViewInfo.FirstVisibleTabIndex := AInfo.FirstVisibleTabIndex; + FreeAndNil(AInfo); +end; + +procedure TcxCustomGridDetailsSiteViewInfo.BeforeRecalculation; +begin + if FTabsViewInfo <> nil then + FTabsViewInfo.BeforeRecalculation; +end; + +procedure TcxCustomGridDetailsSiteViewInfo.Calculate(ALeftBound, ATopBound: Integer); +begin + Bounds.Left := ALeftBound; + Bounds.Top := ATopBound; + Bounds.Right := Bounds.Left + Width; + Bounds.Bottom := Bounds.Top + Height; + + if FTabsViewInfo <> nil then + FTabsViewInfo.Calculate(Bounds); + + if ActiveGridView <> nil then + ActiveGridView.ViewInfo.MainCalculate(ClientBounds); +end; + +function TcxCustomGridDetailsSiteViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; + + function GetDetailP: TPoint; + begin + with ActiveGridView.Site do + begin + Result.X := P.X - Left; + Result.Y := P.Y - Top; + end; + end; + +begin + if FTabsViewInfo <> nil then + Result := FTabsViewInfo.GetHitTest(P) + else + Result := nil; + if (Result = nil) and (ActiveGridView <> nil) then + Result := ActiveGridView.ViewInfo.GetHitTest(GetDetailP); +end; + +function TcxCustomGridDetailsSiteViewInfo.IsTabVisible(ALevel: TcxGridLevel): Boolean; +begin + Result := Level.Options.TabsForEmptyDetails or DetailHasData(ALevel); +end; + +procedure TcxCustomGridDetailsSiteViewInfo.Paint(ACanvas: TcxCanvas); +begin + with GetPainterClass.Create(ACanvas, Self) do + try + Paint; + finally + Free; + end; +end; + +function TcxCustomGridDetailsSiteViewInfo.ProcessDialogChar(ACharCode: Word): Boolean; +begin + Result := (FTabsViewInfo <> nil) and FTabsViewInfo.ProcessDialogChar(ACharCode); +end; + +function TcxCustomGridDetailsSiteViewInfo.SupportsTabAccelerators: Boolean; +begin + Result := False; +end; + +procedure TcxCustomGridDetailsSiteViewInfo.VisibilityChanged(AVisible: Boolean); +begin + if ActiveGridViewExists then + ActiveGridView.ViewInfo.DoVisibilityChanged(AVisible); +end; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridEditor.dfm b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridEditor.dfm new file mode 100644 index 00000000..5e7018c7 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridEditor.dfm @@ -0,0 +1,339 @@ +object cxGridEditor: TcxGridEditor + Left = 457 + Top = 105 + Width = 610 + Height = 435 + HorzScrollBar.Range = 4 + VertScrollBar.Range = 34 + BorderIcons = [biSystemMenu] + Caption = 'Editing' + Color = clBtnFace + ParentFont = True + OldCreateOrder = True + OnClose = FormClose + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 594 + Height = 361 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Splitter1: TSplitter + Left = 240 + Top = 0 + Width = 8 + Height = 361 + end + object Panel4: TPanel + Left = 248 + Top = 0 + Width = 346 + Height = 361 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Panel11: TPanel + Left = 0 + Top = 8 + Width = 346 + Height = 23 + Align = alTop + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object Panel12: TPanel + Left = 1 + Top = 1 + Width = 344 + Height = 21 + Align = alClient + BevelOuter = bvNone + Color = clInfoBk + TabOrder = 0 + object Label1: TLabel + Left = 7 + Top = 4 + Width = 26 + Height = 13 + Caption = 'View:' + end + object LSelectedView: TLabel + Left = 38 + Top = 4 + Width = 72 + Height = 13 + Caption = '' + end + end + end + object Panel5: TPanel + Left = 0 + Top = 0 + Width = 346 + Height = 8 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + end + object Panel13: TPanel + Left = 0 + Top = 31 + Width = 346 + Height = 8 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + end + object Panel15: TPanel + Left = 0 + Top = 39 + Width = 346 + Height = 322 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + Constraints.MinWidth = 100 + TabOrder = 3 + object PViewFrame: TPanel + Left = 1 + Top = 1 + Width = 344 + Height = 320 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + end + end + end + object PLeft: TPanel + Left = 0 + Top = 0 + Width = 240 + Height = 361 + Align = alLeft + BevelOuter = bvNone + TabOrder = 1 + object Panel7: TPanel + Left = 0 + Top = 8 + Width = 8 + Height = 353 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + end + object Panel8: TPanel + Left = 0 + Top = 0 + Width = 240 + Height = 8 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + end + object Panel14: TPanel + Left = 8 + Top = 8 + Width = 232 + Height = 353 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + Constraints.MinHeight = 200 + Constraints.MinWidth = 189 + TabOrder = 2 + object PageControl1: TcxPageControl + Left = 1 + Top = 1 + Width = 230 + Height = 351 + ActivePage = tsLevels + Align = alClient + TabOrder = 0 + ClientRectBottom = 351 + ClientRectRight = 230 + ClientRectTop = 24 + object tsLevels: TcxTabSheet + BorderWidth = 8 + Caption = ' Structure ' + Color = clBtnFace + ParentColor = False + object PLevels: TPanel + Left = 0 + Top = 0 + Width = 214 + Height = 277 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + end + object Panel6: TPanel + Left = 0 + Top = 277 + Width = 214 + Height = 34 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object BAddLevel: TcxButton + Left = 1 + Top = 8 + Width = 80 + Height = 24 + Caption = '&Add Level' + TabOrder = 0 + OnClick = BAddLevelClick + end + object BDeleteLevel: TcxButton + Left = 90 + Top = 8 + Width = 80 + Height = 24 + Caption = '&Delete Level' + TabOrder = 1 + OnClick = BDeleteLevelClick + end + end + end + object TabSheet2: TcxTabSheet + BorderWidth = 8 + Caption = ' Views ' + Color = clBtnFace + ImageIndex = 1 + ParentColor = False + object PViews: TPanel + Left = 0 + Top = 0 + Width = 214 + Height = 247 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object LBViews: TListBox + Left = 1 + Top = 1 + Width = 212 + Height = 245 + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + PopupMenu = PMViewList + TabOrder = 0 + OnClick = LBViewsClick + OnKeyPress = GridStructureControlKeyPress + end + end + object Panel9: TPanel + Left = 0 + Top = 247 + Width = 214 + Height = 64 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object BAddView: TcxButton + Left = 1 + Top = 8 + Width = 80 + Height = 24 + Caption = 'Add &View...' + TabOrder = 0 + OnClick = BAddViewClick + end + object BDeleteView: TcxButton + Left = 90 + Top = 8 + Width = 80 + Height = 24 + Caption = 'D&elete View' + TabOrder = 1 + OnClick = BDeleteViewClick + end + object BEditView: TcxButton + Left = 1 + Top = 40 + Width = 169 + Height = 24 + Caption = 'Edit View &Layout and Data...' + TabOrder = 2 + OnClick = miEditLayoutClick + end + end + end + end + end + end + end + object Panel2: TPanel + Left = 0 + Top = 361 + Width = 602 + Height = 40 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object Panel3: TPanel + Left = 425 + Top = 0 + Width = 177 + Height = 40 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object BClose: TcxButton + Left = 89 + Top = 8 + Width = 80 + Height = 24 + Cancel = True + Caption = '&Close' + TabOrder = 0 + OnClick = BCloseClick + end + end + end + object Panel10: TPanel + Left = 594 + Top = 0 + Width = 8 + Height = 361 + Align = alRight + BevelOuter = bvNone + TabOrder = 2 + end + object PMGridStructureControl: TPopupMenu + Left = 80 + Top = 64 + end + object PMViews: TPopupMenu + Left = 80 + Top = 96 + end + object PMViewList: TPopupMenu + Left = 80 + Top = 128 + object miDeleteView: TMenuItem + Caption = '&Delete' + ShortCut = 46 + OnClick = BDeleteViewClick + end + object N1: TMenuItem + Caption = '-' + end + object miEditLayout: TMenuItem + Caption = '&Edit Layout and Data...' + OnClick = miEditLayoutClick + end + end +end diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridEditor.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridEditor.pas new file mode 100644 index 00000000..463231e9 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridEditor.pas @@ -0,0 +1,768 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridEditor; // TODO: Add Level and View... + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + DesignIntf, DesignWindows, ComponentDesigner, +{$ELSE} + DsgnIntf, LibIntf, +{$ENDIF} + Windows, Classes, SysUtils, Controls, Graphics, Forms, cxClasses, + StdCtrls, ExtCtrls, ComCtrls, Menus, + cxControls, cxDesignWindows, cxGridStructureNavigator, + cxGrid, cxGridLevel, cxGridCustomView, cxViewEditor, + cxGridViewLayoutEditor, cxLookAndFeelPainters, cxButtons, cxPC, cxLookAndFeels; + +type + TSelectionInfo = record + Level: TcxGridLevel; + View: TcxCustomGridView; + MultiSelect: Boolean; + end; + + TcxGridEditor = class(TcxDesignFormEditor) + Panel1: TPanel; + Panel2: TPanel; + Panel3: TPanel; + BClose: TcxButton; + Panel4: TPanel; + PLeft: TPanel; + Splitter1: TSplitter; + Panel7: TPanel; + Panel8: TPanel; + PMGridStructureControl: TPopupMenu; + PMViews: TPopupMenu; + Panel11: TPanel; + Panel10: TPanel; + PMViewList: TPopupMenu; + miDeleteView: TMenuItem; + N1: TMenuItem; + miEditLayout: TMenuItem; + Panel5: TPanel; + Panel12: TPanel; + Label1: TLabel; + LSelectedView: TLabel; + Panel13: TPanel; + Panel14: TPanel; + PageControl1: TcxPageControl; + tsLevels: TcxTabSheet; + PLevels: TPanel; + Panel6: TPanel; + BAddLevel: TcxButton; + BDeleteLevel: TcxButton; + TabSheet2: TcxTabSheet; + PViews: TPanel; + LBViews: TListBox; + Panel9: TPanel; + BAddView: TcxButton; + BDeleteView: TcxButton; + BEditView: TcxButton; + Panel15: TPanel; + PViewFrame: TPanel; + procedure BCloseClick(Sender: TObject); + procedure BDeleteLevelClick(Sender: TObject); + procedure BAddLevelClick(Sender: TObject); + procedure LBViewsClick(Sender: TObject); + procedure BAddViewClick(Sender: TObject); + procedure BDeleteViewClick(Sender: TObject); + procedure GridStructureControlKeyPress(Sender: TObject; var Key: Char); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure miEditLayoutClick(Sender: TObject); + private + FGridStructureControl: TcxGridStructureControl; + FGridStructureHelper: TcxGridStructureHelper; + FViewEditor: TcxViewEditor; + procedure CreateViewClick(Sender: TObject); + function GetGrid: TcxCustomGrid; + function GetView(Index: Integer): TcxCustomGridView; + function GetViewCount: Integer; + function GetViewRepository: TcxGridViewRepository; + procedure GridStructureControlSelectionChanged(Sender: TObject); + procedure HideViewFrame; + procedure ShowViewFrame(AView: TcxCustomGridView; AMultiView: Boolean; ARefreshNeeded: Boolean); + procedure UpdateButtons; + procedure UpdateDesigner(Sender: TObject); + procedure UpdateGridStructureControl; + procedure UpdateGridStructureControlSelection; + procedure UpdateViewFrame(ARefreshNeeded: Boolean); + procedure UpdateViewFrameCaption; + procedure UpdateViewList; + protected + function GetSelectionInfo: TSelectionInfo; + function GetViewEditorClass(AView: TcxCustomGridView): TcxViewEditorClass; virtual; + procedure InitFormEditor; override; + procedure InitIDESelection; virtual; + procedure InitLookAndFeel(AControl: TWinControl); + procedure LoadSettings; + procedure SaveSettings; + function UniqueName(Component: TComponent): string; override; + procedure UpdateContent; override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure DoItemsModified; override; + function GetRegKey: string; + function GetRegSectionName: string; + procedure SelectionsChanged(const ASelection: TDesignerSelectionList); override; + property Grid: TcxCustomGrid read GetGrid; + property ViewCount: Integer read GetViewCount; + property ViewRepository: TcxGridViewRepository read GetViewRepository; + property Views[Index: Integer]: TcxCustomGridView read GetView; + end; + +procedure ShowGridEditor(ADesigner: IDesigner; AGrid: TcxCustomGrid); +procedure ShowViewRepositoryEditor(ADesigner: IDesigner; AViewRepository: TcxGridViewRepository); + +implementation + +uses + Messages, Registry; + +{$R *.dfm} + +procedure ShowGridEditor(ADesigner: IDesigner; AGrid: TcxCustomGrid); +begin + ShowFormEditorClass(ADesigner, AGrid, TcxGridEditor); +end; + +procedure ShowViewRepositoryEditor(ADesigner: IDesigner; AViewRepository: TcxGridViewRepository); +begin + ShowFormEditorClass(ADesigner, AViewRepository, TcxGridEditor); +end; + +{ TcxGridEditor } + +constructor TcxGridEditor.Create(AOwner: TComponent); +var + P: TPoint; +begin + inherited; +{$IFDEF DELPHI6} + P := {ComponentDesigner}ActiveDesigner.Environment.GetWorkspaceOrigin; +{$ELSE} + P := DelphiIDE.GetWorkspaceOrigin; +{$ENDIF} + Left := P.X + 10; + Top := P.Y + 10; +end; + +destructor TcxGridEditor.Destroy; +begin + FreeAndNil(FGridStructureHelper); + inherited Destroy; +end; + +procedure TcxGridEditor.DoItemsModified; +begin + inherited; + UpdateViewList; + UpdateViewFrame(True); +end; + +function TcxGridEditor.GetRegKey: string; +begin + Result := GetBaseRegKey{$IFDEF DELPHI6}(ComponentDesigner){$ENDIF} + '\TcxGridEditor'; +end; + +function TcxGridEditor.GetRegSectionName: string; +begin + Result := ComponentClassName; +end; + +procedure TcxGridEditor.SelectionsChanged(const ASelection: TDesignerSelectionList); +begin + if Closing then Exit; + UpdateGridStructureControlSelection; + ListBoxSynchronizeSelection(LBViews); + UpdateButtons; + UpdateViewFrame(False); +end; + +function TcxGridEditor.GetSelectionInfo: TSelectionInfo; + + procedure FindView(ASelection: TDesignerSelectionList; var AInfo: TSelectionInfo); + var + I: Integer; + begin + for I := 0 to ASelection.Count - 1 do + if (ASelection[I] is TcxCustomGridView) and + IsViewLinkedToComponent(TcxCustomGridView(ASelection[I]), Component) then + if AInfo.View = nil then + AInfo.View := TcxCustomGridView(ASelection[I]) + else + begin + AInfo.View := nil; + AInfo.MultiSelect := True; + Break; + end; + end; + + procedure FindLevel(ASelection: TDesignerSelectionList; var AInfo: TSelectionInfo); + var + I: Integer; + ALevel: TcxGridLevel; + begin + for I := 0 to ASelection.Count - 1 do + if ASelection[I] is TcxGridLevel then + begin + ALevel := TcxGridLevel(ASelection[I]); + if ALevel.Control = Grid then + if (AInfo.Level = nil) and (AInfo.View = nil) then + if ALevel.GridView = nil then + AInfo.Level := ALevel + else + AInfo.View := ALevel.GridView + else + begin + AInfo.Level := nil; + AInfo.View := nil; + AInfo.MultiSelect := True; + Break; + end; + end; + end; + + procedure FindViewItem(ASelection: TDesignerSelectionList; var AInfo: TSelectionInfo); + var + I: Integer; + AView: TcxCustomGridView; + begin + for I := 0 to ASelection.Count - 1 do + begin + AView := GetLinkedView(ASelection[I]); + if (AView <> nil) and IsViewLinkedToComponent(AView, Component) then + if AInfo.View = nil then + AInfo.View := AView + else + if AInfo.View <> AView then + begin + AInfo.View := nil; + AInfo.MultiSelect := True; + Break; + end; + end; + end; + +var + ASelectionList: TDesignerSelectionList; +begin + Result.Level := nil; + Result.View := nil; + Result.MultiSelect := False; + + ASelectionList := CreateDesignerSelectionList; + try + Designer.GetSelections(ASelectionList); + FindView(ASelectionList, Result); + if (Result.View = nil) and not Result.MultiSelect then + begin + FindLevel(ASelectionList, Result); + if (Result.Level = nil) and (Result.View = nil) and not Result.MultiSelect then + FindViewItem(ASelectionList, Result); + end; + finally + DeleteDesignerSelectionList(ASelectionList); + end; + + if (Result.Level <> nil) and Result.Level.IsDestroying then + Result.Level := nil; + if (Result.View <> nil) and Result.View.IsDestroying then + Result.View := nil; +end; + +function TcxGridEditor.GetViewEditorClass(AView: TcxCustomGridView): TcxViewEditorClass; +begin + Result := cxViewEditor.GetViewEditorClass(TcxCustomGridViewClass(AView.ClassType)); +end; + +procedure TcxGridEditor.InitFormEditor; +begin + inherited InitFormEditor; + FGridStructureControl := TcxGridStructureControl.Create(Self); + with FGridStructureControl do + begin + Align := alClient; + Grid := Self.Grid; + MayFocused := True; + MultiSelect := True; + Keys := [kChars]; + OnKeyPress := GridStructureControlKeyPress; + OnSelectionChanged := GridStructureControlSelectionChanged; + Parent := PLevels; + end; + FGridStructureHelper := TcxGridStructureHelper.Create(FGridStructureControl); + FGridStructureHelper.OnUpdateDesigner := UpdateDesigner; + tsLevels.TabVisible := Grid <> nil; + LSelectedView.Caption := ''; + LSelectedView.Font.Style := [fsBold]; + InitLookAndFeel(Self); +{$IFDEF DELPHI10} // should be DELPHI105 + MakeColoredControlsOpaque(Self); +{$ENDIF} + + UpdateViewList; + InitIDESelection; + UpdateSelection; + LoadSettings; +end; + +procedure TcxGridEditor.InitIDESelection; +var + ASelectionInfo: TSelectionInfo; +begin + if (Grid = nil) or (Grid.ActiveLevel = nil) {or Grid.ActiveLevel.IsMaster} then Exit; + ASelectionInfo := GetSelectionInfo; + if (ASelectionInfo.Level = nil) and (ASelectionInfo.View = nil) and not ASelectionInfo.MultiSelect then + if Grid.ActiveView = nil then + SelectComponent(Grid.ActiveLevel) + else + SelectComponent(Grid.ActiveView); +end; + +procedure TcxGridEditor.InitLookAndFeel(AControl: TWinControl); +begin + SetControlLookAndFeel(AControl, lfUltraFlat, False); +end; + +procedure TcxGridEditor.LoadSettings; +begin + with TRegIniFile.Create(GetRegKey) do + try + Left := ReadInteger(GetRegSectionName, 'Left', Left); + Top := ReadInteger(GetRegSectionName, 'Top', Top); + Width := ReadInteger(GetRegSectionName, 'Width', Width); + Height := ReadInteger(GetRegSectionName, 'Height', Height); + PLeft.Width := ReadInteger(GetRegSectionName, 'PLeft.Width', PLeft.Width); + // TODO: splitters + finally + Free; + end; + MakeVisibleOnDesktop(Self); +end; + +procedure TcxGridEditor.SaveSettings; +begin + with TRegIniFile.Create(GetRegKey) do + try + EraseSection(GetRegSectionName); + WriteInteger(GetRegSectionName, 'Left', Left); + WriteInteger(GetRegSectionName, 'Top', Top); + WriteInteger(GetRegSectionName, 'Width', Width); + WriteInteger(GetRegSectionName, 'Height', Height); + WriteInteger(GetRegSectionName, 'PLeft.Width', PLeft.Width); + // TODO: splitters + finally + Free; + end; +end; + +function TcxGridEditor.UniqueName(Component: TComponent): string; +begin + if Component is TcxGridLevel then + begin + if Grid <> nil then + Result := GenLevelName(Grid, Component as TcxGridLevel) + else + Result := inherited UniqueName(Component); // TODO + end + else + if Component is TcxCustomGridView then + Result := GenViewName(Self.Component, Component as TcxCustomGridView) + else + Result := inherited UniqueName(Component); // TODO +end; + +procedure TcxGridEditor.UpdateContent; +begin + inherited UpdateContent; + UpdateGridStructureControl; + UpdateViewList; + UpdateButtons; + UpdateViewFrame(True); +end; + +procedure TcxGridEditor.CreateViewClick(Sender: TObject); +var + AViewClass: TcxCustomGridViewClass; + AView: TcxCustomGridView; +begin + AViewClass := TcxCustomGridViewClass( + cxGridRegisteredViews[((Sender as TMenuItem).Tag)]); + FGridStructureControl.BeginUpdate; + try + ListBoxClearSelection(LBViews); + if Grid <> nil then + AView := Grid.CreateView(AViewClass) + else + AView := ViewRepository.CreateItem(AViewClass); + AView.Name := GenViewName(Component, AView); + RestoreViewFromTemplate(GetViewTemplateRegKey, AView); + UpdateViewList; + ListBoxSelectByObject(LBViews, AView); + UpdateDesigner(nil); + finally + FGridStructureControl.EndUpdate; + end; + LBViewsClick(nil); +end; + +function TcxGridEditor.GetGrid: TcxCustomGrid; +begin + if Component is TcxCustomGrid then + Result := TcxCustomGrid(Component) + else + Result := nil; +end; + +function TcxGridEditor.GetView(Index: Integer): TcxCustomGridView; +begin + if Grid <> nil then + Result := Grid.Views[Index] + else + Result := ViewRepository[Index]; +end; + +function TcxGridEditor.GetViewCount: Integer; +begin + if Grid <> nil then + Result := Grid.ViewCount + else + Result := ViewRepository.Count; +end; + +function TcxGridEditor.GetViewRepository: TcxGridViewRepository; +begin + if Component is TcxGridViewRepository then + Result := TcxGridViewRepository(Component) + else + Result := nil; +end; + +procedure TcxGridEditor.GridStructureControlKeyPress(Sender: TObject; var Key: Char); +begin + case Key of + #13, #33..#126: + begin + if Key = #13 then Key := #0; + ActivateInspector(Key); + Key := #0; + end; + end; +end; + +procedure TcxGridEditor.GridStructureControlSelectionChanged(Sender: TObject); +var + AList: TList; +begin + BeginUpdate; + try + AList := TList.Create; + try + FGridStructureControl.GetSelection(AList); + SelectComponents(AList, Component.Owner); + finally + AList.Free; + end; + finally + EndUpdate; + end; +end; + +procedure TcxGridEditor.HideViewFrame; +begin + if FViewEditor <> nil then + begin + FViewEditor.PViewEditor.Parent := FViewEditor; + FViewEditor.Release; + end; + FViewEditor := nil; +end; + +procedure TcxGridEditor.ShowViewFrame(AView: TcxCustomGridView; AMultiView: Boolean; + ARefreshNeeded: Boolean); + + function IsExist(AView: TcxCustomGridView): Boolean; + var + I: Integer; + begin + Result := False; + for I := 0 to ViewCount - 1 do + if Views[I] = AView then + begin + Result := True; + Break; + end; + end; + +var + AViewEditorClass: TcxViewEditorClass; +begin + if (FViewEditor <> nil) and + (AView <> nil) and (FViewEditor.ClassType = GetViewEditorClass(AView)) and + (FViewEditor.View = AView) then + FViewEditor.SetView(AView, ARefreshNeeded) + else + begin + SendMessage(PViewFrame.Handle, WM_SETREDRAW, 0, 0); + try + HideViewFrame; + if AView <> nil then + begin + AViewEditorClass := GetViewEditorClass(AView); + if AViewEditorClass <> nil then + begin + FViewEditor := AViewEditorClass.Create(Self); + InitLookAndFeel(FViewEditor); + FViewEditor.FormEditor := Self; + FViewEditor.SetView(AView, True); + FViewEditor.PViewEditor.Parent := PViewFrame; + {$IFDEF DELPHI10} // should be DELPHI105 + MakeColoredControlsOpaque(PViewFrame); + {$ENDIF} + end; + end; + finally + SendMessage(PViewFrame.Handle, WM_SETREDRAW, 1, 0); + RedrawWindow(PViewFrame.Handle, nil, 0, RDW_INVALIDATE or RDW_ALLCHILDREN or RDW_UPDATENOW); + end; + end; + UpdateViewFrameCaption; +end; + +procedure TcxGridEditor.UpdateButtons; +var + ASelectionLevelCount: Integer; +begin + ASelectionLevelCount := FGridStructureControl.GetSelectionLevelCount; + BAddLevel.Enabled := CanAddComponent and (ASelectionLevelCount <= 1); + BDeleteLevel.Enabled := CanDeleteComponent(nil) and (ASelectionLevelCount > 0); + BAddView.Enabled := CanAddComponent; + BDeleteView.Enabled := CanDeleteComponent(nil) and (LBViews.SelCount > 0); + BEditView.Enabled := LBViews.SelCount = 1; + miDeleteView.Enabled := BDeleteView.Enabled; + miEditLayout.Enabled := BEditView.Enabled; + // TODO: Popup Menu +end; + +procedure TcxGridEditor.UpdateDesigner(Sender: TObject); +begin + Designer.Modified; +end; + +procedure TcxGridEditor.UpdateGridStructureControl; +begin + FGridStructureControl.Changed; +end; + +procedure TcxGridEditor.UpdateGridStructureControlSelection; +var + AList: TList; +begin + AList := TList.Create; + try + GetSelectionList(AList); + FGridStructureControl.SyncSelection(AList); + finally + AList.Free; + end; +end; + +procedure TcxGridEditor.UpdateViewFrame(ARefreshNeeded: Boolean); +var + ASelectionInfo: TSelectionInfo; +begin + ASelectionInfo := GetSelectionInfo; + ShowViewFrame(ASelectionInfo.View, ASelectionInfo.MultiSelect, ARefreshNeeded); +end; + +procedure TcxGridEditor.UpdateViewFrameCaption; +begin + if FViewEditor <> nil then + LSelectedView.Caption := FViewEditor.View.Name + else + LSelectedView.Caption := 'none'; +end; + +procedure TcxGridEditor.UpdateViewList; +var + I, AItemIndex, ATopIndex: Integer; + ASelection: TStringList; +begin + ListBoxSaveSelection(LBViews, ASelection, AItemIndex, ATopIndex); + try + LBViews.Items.Clear; + for I := 0 to ViewCount - 1 do + LBViews.Items.AddObject(Views[I].Name, Views[I]); + finally + ListBoxRestoreSelection(LBViews, ASelection, AItemIndex, ATopIndex); + end; +end; + +procedure TcxGridEditor.BCloseClick(Sender: TObject); +begin + Close; +end; + +// Levels + +procedure TcxGridEditor.BAddLevelClick(Sender: TObject); +var + ALevel: TcxGridLevel; +begin + if Grid = nil then Exit; + FGridStructureControl.BeginUpdate; + try + ALevel := FGridStructureControl.GetSelectedLevel; + if ALevel <> nil then + ALevel := ALevel.Add + else + ALevel := Grid.Levels.Add; + ALevel.Name := GenLevelName(Grid, ALevel); + UpdateDesigner(nil); + finally + FGridStructureControl.EndUpdate; + end; + GridStructureControlSelectionChanged(nil); +end; + +function LevelsCompare( + AItem1, AItem2: Pointer): Integer; +var + ALevel1, ALevel2: TcxGridLevel; +begin + ALevel1 := TcxGridLevel(AItem1); + ALevel2 := TcxGridLevel(AItem2); + Result := ALevel1.Level - ALevel2.Level; + if Result = 0 then + begin + if not ALevel1.IsTop then + Result := LevelsCompare(ALevel1.Parent, ALevel2.Parent); + if Result = 0 then + Result := ALevel1.Index - ALevel2.Index; + end; +end; + +procedure TcxGridEditor.BDeleteLevelClick(Sender: TObject); +var + AList: TList; + ALevel: TcxGridLevel; + I: Integer; +begin + AList := TList.Create; + try + FGridStructureControl.GetSelectionLevels(AList); + AList.Sort(LevelsCompare); + for I := AList.Count - 1 downto 0 do + begin + ALevel := TcxGridLevel(AList[I]); + if not CanDeleteComponent(ALevel) then + AList.Delete(I); + end; + if AList.Count > 0 then + begin + FGridStructureControl.BeginUpdate; + try + for I := AList.Count - 1 downto 0 do + TcxGridLevel(AList[I]).Free; + UpdateDesigner(nil); + finally + FGridStructureControl.EndUpdate; + end; + end; + finally + AList.Free; + end; + GridStructureControlSelectionChanged(nil); +end; + +// Views + +procedure TcxGridEditor.LBViewsClick(Sender: TObject); +begin + ListBoxApplySelection(LBViews, Component); +end; + +procedure TcxGridEditor.BAddViewClick(Sender: TObject); +var + P: TPoint; +begin + // TODO: cxButton + PMViews.Items.Clear; + FillRegisteredViewsMenu(PMViews.Items, CreateViewClick); + P.X := 0; + P.Y := BAddView.Height; + P := BAddView.ClientToScreen(P); + PMViews.Popup(P.X, P.Y); +end; + +procedure TcxGridEditor.BDeleteViewClick(Sender: TObject); +begin + if LBViews.SelCount > 0 then + begin + BeginUpdate; + try + ListBoxDeleteSelection(LBViews, True); + UpdateViewList; + LBViewsClick(nil); + UpdateDesigner(nil); + finally + EndUpdate; + end; + end; +end; + +procedure TcxGridEditor.miEditLayoutClick(Sender: TObject); +var + ASelectionInfo: TSelectionInfo; +begin + ASelectionInfo := GetSelectionInfo; + if not ASelectionInfo.MultiSelect and (ASelectionInfo.View <> nil) then + if ShowGridViewEditor(ASelectionInfo.View) then + UpdateDesigner(nil); +end; + +procedure TcxGridEditor.FormClose(Sender: TObject; + var Action: TCloseAction); +begin + SaveSettings; + inherited; +end; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridExportLink.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridExportLink.pas new file mode 100644 index 00000000..51bd46ba --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridExportLink.pas @@ -0,0 +1,3335 @@ +{*******************************************************************} +{ } +{ Developer Express Cross Platform Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL AND CLX CONTROLS AS PART OF AN EXECUTABLE } +{ PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit cxGridExportLink; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Windows, +{$IFDEF DELPHI6} + Variants, FMTBcd, SqlTimSt, +{$ENDIF} + Classes, SysUtils, Graphics, cxGrid, cxExport, cxGridTableView, cxGridBandedTableView, + cxGridCustomView, cxCustomData, cxDBData, cxGridCustomTableView, cxStyles, DB, + cxGridCardView, cxGridLevel, cxEdit, cxImage, cxCalendar, cxCurrencyEdit, cxSpinEdit, + cxCalc, cxTimeEdit, cxGraphics, cxMaskEdit, cxClasses, cxGridStrs, cxDataUtils, + cxGridDBDataDefinitions, cxLookAndFeels, cxGridCommon, cxGridChartView, + cxLookAndFeelPainters, cxGeometry, cxControls, cxDataStorage, cxVariants; + +const + cxGridFooterCellIndent: Integer = 0; + +type + EcxGridExport = class(Exception); + + { TcxGridCustomExport } + + TcxGridCustomExport = class + private + FColumns: TcxExportScale; + FDefaultRowHeight: Integer; + FDefaultStyle: TcxCacheCellStyle; + FDefaultStyleIndex: Integer; + FExpand: Boolean; + FExportType: Integer; + FFileName: string; + FGrid: TcxCustomGrid; + FGridView: TcxCustomGridView; + FInternalProvider: IcxCellInternalCache; + FInternalProviderSupported: Boolean; + FProvider: IcxExportProvider; + FRows: TcxExportScale; + FRecordsList: TList; + FSaveAll: Boolean; + FSaveGridModeFlag: Boolean; + FUseNativeFormat: Boolean; + FViewInfo: TcxCustomGridViewInfo; + function GetDataController: TcxCustomDataController; + function GetExpandButtonSize: Integer; + function GetRecord(ARecordIndex: Integer): TcxCustomGridRecord; + function GetRecordCount: Integer; + function GetViewInfo: TcxCustomGridViewInfo; + protected + procedure BeforeCommit; virtual; + function CalculateViewViewInfo(AGridView: TcxCustomGridView; ABounds: TRect): TcxCustomGridViewInfo; virtual; + function CheckNativeValue(AProperties: TcxCustomEditProperties; AItem: TcxCustomGridTableItem; const AValue: Variant): Variant; + procedure CreateExportCache; virtual; + procedure CreateExportCells; virtual; + procedure ExpandRecords(AFullExpand: Boolean); virtual; + procedure ExportCells; virtual; + procedure ExtractRowsForExport; virtual; + procedure FillArea(const ABounds: TRect; AStyleIndex: Integer; + ABorderColor: TColor = clDefault; ABorders: TcxBorders = cxBordersAll); + procedure FillRealArea(const ABounds: TRect; AStyleIndex: Integer; + ABorderColor: TColor = clDefault; ABorders: TcxBorders = cxBordersAll); + procedure Finalize; virtual; + function GetContentParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams; ABorders: TcxBorders = []; ABorderColor: TColor = clDefault): TcxCacheCellStyle; + function GetViewItemValue(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem): Variant; + function GetViewItemValueEx(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AProperties: TcxCustomEditProperties): Variant; virtual; + function HasSelectedChildren(ARecord: TcxCustomGridRecord): Boolean; + function HasSelectedRecords(AView: TcxCustomGridView): Boolean; + procedure Initialize; virtual; + function IsCurrencyItem(AItem: TcxCustomGridTableItem): Boolean; + function IsCurrencyProperties(AProperties: TcxCustomEditProperties): Boolean; + function IsEmpty: Boolean; + function IsNativeFormatProperties(AProperties: TcxCustomEditProperties; AItem: TcxCustomGridTableItem): Boolean; virtual; + procedure RealBoundsToLogicalBounds(const ABounds: TRect; out ALogicalBounds: TRect); + procedure RealBoundsToLogicalBoundsEx(const ABounds, ASearchArea: TRect; out ALogicalBounds: TRect); + function RegisterContentParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AParams: TcxViewParams): Integer; + function RegisterSolidStyle(AStyleIndex: Integer; AData: TObject = nil): Integer; + function RegisterSolidStyleEx(AColor: TColor): Integer; + procedure RegisterStyles; virtual; + function RegisterViewParams(const AViewParams: TcxViewParams; const AAlignment: TAlignment = taLeftJustify): Integer; + function SetCellAsGraphic(AColumn, ARow: Integer; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem): Boolean; + procedure SetCellValueAndStyle(AColumn, ARow: Integer; + const AValue: Variant; const AStyle: TcxCacheCellStyle); + procedure SetRealCellStyle(const ARealBounds, ASearchArea: TRect; AStyleIndex: Integer); + procedure SetRealCellStyleAndValue(const ARealBounds, ASearchArea: TRect; AStyleIndex: Integer; const AValue: Variant); + procedure SetRealCellStyleAndValueEx(const ARealBounds, ASearchArea: TRect; + AStyleIndex: Integer; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem); + function TextHeight(AFont: TFont): Integer; + function TextHeightEx(const AViewParams: TcxViewParams): Integer; + function TextWidth(AFont: TFont; const AText: string): Integer; + function TextWidthEx(const AViewParams: TcxViewParams; const AText: string): Integer; + procedure ViewParamsToExportStyle(const AViewParams: TcxViewParams; + var AExportStyle: TcxCacheCellStyle; const AAlignment: TAlignment = taLeftJustify; + ABorders: TcxBorders = []; ABorderColor: TColor = clDefault); + + property DataController: TcxCustomDataController read GetDataController; + property DefaultRowHeight: Integer read FDefaultRowHeight write FDefaultRowHeight; + property DefaultStyle: TcxCacheCellStyle read FDefaultStyle write FDefaultStyle; + property DefaultStyleIndex: Integer read FDefaultStyleIndex write FDefaultStyleIndex; + property ExportType: Integer read FExportType; + property RecordsList: TList read FRecordsList; + public + constructor Create(AFileName: string; AExportType: Integer; AGridView: TcxCustomGridView; + AGrid: TcxCustomGrid; AViewInfo: TcxCustomGridViewInfo); virtual; + constructor CreateFrom(AMasterExport: TcxGridCustomExport; + AGridView: TcxCustomGridView; AViewInfo: TcxCustomGridViewInfo); virtual; + destructor Destroy; override; + procedure AddSeparators(const ASeparators: array of string); + procedure DoExport; virtual; + + property Columns: TcxExportScale read FColumns; + property Expand: Boolean read FExpand write FExpand; + property ExpandButtonSize: Integer read GetExpandButtonSize; + property FileName: string read FFileName; + property Grid: TcxCustomGrid read FGrid; + property GridView: TcxCustomGridView read FGridView; + property InternalProvider: IcxCellInternalCache read FInternalProvider; + property InternalProviderSupported: Boolean read FInternalProviderSupported; + property Provider: IcxExportProvider read FProvider; + property RecordCount: Integer read GetRecordCount; + property Records[ARecordIndex: Integer]: TcxCustomGridRecord read GetRecord; + property Rows: TcxExportScale read FRows; + property SaveAll: Boolean read FSaveAll write FSaveAll; + property UseNativeFormat: Boolean read FUseNativeFormat write FUseNativeFormat; + property ViewInfo: TcxCustomGridViewInfo read GetViewInfo; + end; + + TcxGridCustomExportClass = class of TcxGridCustomExport; + + TcxExportVisualItem = class + public + Bounds: TRect; + Data: TObject; + Data2: TObject; + DisplayText: string; + Hidden: Boolean; + IsBackground: Boolean; + Style: Integer; + Slave: Boolean; + Value: Variant; + function GetBoundsRelativeTo(ATop, ALeft: Integer): TRect; + function IsColumn: Boolean; + end; + + TcxExportGroupSummaryItem = class + public + Alignment: TAlignment; + Bounds: TRect; + Column: TcxGridColumn; + Index: Integer; + SummaryItem: TcxGridTableSummaryItem; + Text: string; + Value: Variant; + ViewParams: TcxViewParams; + procedure InitWidth; + end; + + TcxExportVisualItemClass = class of TcxExportVisualItem; + + { TcxGridTableViewExport } + + TcxGridTableViewExport = class(TcxGridCustomExport) + private + FGroupSummaryItemsList: TcxObjectList; + FRecordHeight: Integer; + FRecordRowCount: Integer; + FRecordWidth: Integer; + FPatternsList: TcxObjectList; + FVisualItemsList: TcxObjectList; + function GetFooterCellBorderColor: TColor; + function GetGridLineColor: TColor; + function GetGridLines: TcxBorders; + function GetGridView: TcxGridTableView; + function GetGroupSummaryCount: Integer; + function GetGroupSummaryItem(AIndex: Integer): TcxExportGroupSummaryItem; + function GetHasPreview(ARow: TcxCustomGridRecord): Boolean; + function GetIndicatorWidth: Integer; + function GetLeftPos: Integer; + function GetOptionsView: TcxGridTableOptionsView; + function GetPattern(AIndex: Integer): TcxExportVisualItem; + function GetPatternCount: Integer; + function GetPreviewPlace: TcxGridPreviewPlace; + function GetStyles: TcxGridTableViewStyles; + function GetViewInfo: TcxGridTableViewInfo; + function GetVisualItem(AIndex: Integer): TcxExportVisualItem; + function GetVisualItemCount: Integer; + procedure SetLeftPos(AValue: Integer); + protected + procedure AddDataRow(var ATop, ALeft: Integer; ARow: TcxGridDataRow); virtual; + procedure AddFooterCells(var ATop, ALeft: Integer; ARow: TcxCustomGridRow; + ALevel, ADataLevel: Integer; AItems: TcxDataSummaryItems; AValues: PVariant; AIsFooter: Boolean); virtual; + procedure AddGroupRow(var ATop, ALeft: Integer; ARow: TcxGridGroupRow); virtual; + function AddIndents(ATop, ARowHeight: Integer; ARow: TcxCustomGridRecord; AHasButton: Boolean; ALevel: Integer = -1): Integer; virtual; + procedure AddMasterDataRow(var ATop, ALeft: Integer; ARow: TcxGridMasterDataRow); virtual; + procedure AddRowFooter(var ATop, ALeft: Integer; ADataLevel, ALevel: Integer; ARow: TcxCustomGridRecord); virtual; + procedure AddRowFooters(var ATop, ALeft: Integer; ARow: TcxCustomGridRecord); virtual; + procedure AddRowPreview(var ATop, ALeft: Integer; ARow: TcxCustomGridRecord); virtual; + function AddVisualDataItem(const AItemBounds: TRect; AStyle: Integer; + ARecord: TcxCustomGridRecord; AColumn: TcxGridColumn): TcxExportVisualItem; + function AddVisualItem(AItemClass: TcxExportVisualItemClass; const ABounds: TRect): TcxExportVisualItem; virtual; + function AddVisualItemEx(const AItemBounds: TRect; const ADisplayText: string; + const AViewParams: TcxViewParams; AAlignment: TAlignment; ABorders: TcxBorders; + ABorderColor: TColor = clDefault; AIsBackground: Boolean = False): TcxExportVisualItem; overload; + function AddVisualItemEx(const AItemBounds: TRect; const ADisplayText: string; + AStyle: Integer; AIsBackground: Boolean = False): TcxExportVisualItem; overload; + function AddPattern(const ABounds: TRect; AData: TObject; AOffset: Integer = 0): TcxExportVisualItem; + function CanShowMultiSummaries(AIsFooter: Boolean): Boolean; + procedure CreateContent(var ATop, ALeft: Integer); virtual; + procedure CreateFooter(var ATop, ALeft: Integer); virtual; + procedure CreateHeader(var ATop, ALeft: Integer); virtual; + procedure CreateExportCells; override; + procedure CreateRecordFromPattern(var ATop, ALeft: Integer; ARecord: TcxCustomGridRecord); + function DoMergeCell(AMasterItem, ASlaveItem: TcxExportVisualItem): Boolean; + procedure ExportCells; override; + procedure ExportDetailCell(ACell: TcxExportVisualItem); virtual; + procedure Finalize; override; + function GetColumnOffset(AColumn: TcxGridColumn): Integer; virtual; + function GetExpandButtonParams(ABorders: TcxBorders): TcxCacheCellStyle; + function GetFooterCellCount(AItems: TcxDataSummaryItems): Integer; + function GetFooterItemBounds(AIndex, ALineIndex: Integer; const AOrigin: TRect; AIsFooter: Boolean): TRect; + function GetFooterLineCount(AItems: TcxDataSummaryItems): Integer; + function GetGroupRowColumnIntersection(const ARowBounds: TRect; AColumn: TcxGridColumn): TRect; + function GetIsSummaryUnderColumns: Boolean; virtual; + function GetPatternParams(ARecord: TcxCustomGridRecord; AItem: TcxExportVisualItem): TcxViewParams; virtual; + function GetPreviewHeight(ARow: TcxCustomGridRecord): Integer; + function HasFooter(ARow: TcxCustomGridRecord; var ALevel: Integer): Boolean; virtual; + procedure Initialize; override; + procedure MergeCells; virtual; + procedure ProcessGroupSummaryItem(ARow: TcxGridGroupRow; AValues: PVariant; + AIndex: Integer; const ABounds: TRect; const ARowViewParams: TcxViewParams); + procedure ProcessGroupSummaryItems(ARow: TcxGridGroupRow; ABounds: TRect); + procedure ProduceHeadersContainer(var ATop, ALeft: Integer; + AViewInfo: TcxGridColumnContainerViewInfo); + procedure SetPatternsBounds(ATop, ABottom: Integer); + + property GroupSummaryItemCount: Integer read GetGroupSummaryCount; + property GroupSummaryItems[Index: Integer]: TcxExportGroupSummaryItem read GetGroupSummaryItem; + property GroupSummaryItemsList: TcxObjectList read FGroupSummaryItemsList; + property LeftPos: Integer read GetLeftPos write SetLeftPos; + property PatternCount: Integer read GetPatternCount; + property Patterns[Index: Integer]: TcxExportVisualItem read GetPattern; + property PatternsList: TcxObjectList read FPatternsList; + public + property FooterCellBorderColor: TColor read GetFooterCellBorderColor; + property GridLineColor: TColor read GetGridLineColor; + property GridLines: TcxBorders read GetGridLines; + property GridView: TcxGridTableView read GetGridView; + property HasPreview[ARow: TcxCustomGridRecord]: Boolean read GetHasPreview; + property IndicatorWidth: Integer read GetIndicatorWidth; + property IsSummaryUnderColumns: Boolean read GetIsSummaryUnderColumns; + property OptionsView: TcxGridTableOptionsView read GetOptionsView; + property PreviewPlace: TcxGridPreviewPlace read GetPreviewPlace; + property RecordHeight: Integer read FRecordHeight write FRecordHeight; + property RecordRowCount: Integer read FRecordRowCount; + property RecordWidth: Integer read FRecordWidth write FRecordHeight; + property Styles: TcxGridTableViewStyles read GetStyles; + property ViewInfo: TcxGridTableViewInfo read GetViewInfo; + property VisualItemCount: Integer read GetVisualItemCount; + property VisualItems[Index: Integer]: TcxExportVisualItem read GetVisualItem; + property VisualItemsList: TcxObjectList read FVisualItemsList; + end; + + { TcxGridBandedTableViewExport } + + TcxGridBandedTableViewExport = class(TcxGridTableViewExport) + private + function GetGridView: TcxGridBandedTableView; + function GetOptionsView: TcxGridBandedTableOptionsView; + function GetViewInfo: TcxGridBandedTableViewInfo; + protected + procedure CreateBandHeaders(var ATop: Integer; AForRootBands: Boolean); virtual; + procedure CreateHeader(var ATop, ALeft: Integer); override; + function GetColumnOffset(AColumn: TcxGridColumn): Integer; override; + function GetContentOffset: TPoint; virtual; + function GetIsSummaryUnderColumns: Boolean; override; + function GetParentBandOffset(ABand: TcxGridBand): Integer; + function GetPatternByBand(ABand: TcxGridBand): TcxExportVisualItem; + function GetPatternParams(ARecord: TcxCustomGridRecord; AItem: TcxExportVisualItem): TcxViewParams; override; + function ProduceColumnsContainer(AContainer: TcxGridColumnContainerViewInfo; ATop, ALeft: Integer): Integer; + public + property ContentOffset: TPoint read GetContentOffset; + property GridView: TcxGridBandedTableView read GetGridView; + property OptionsView: TcxGridBandedTableOptionsView read GetOptionsView; + property ViewInfo: TcxGridBandedTableViewInfo read GetViewInfo; + end; + + { TcxGridCardViewExport } + + TcxExportCard = class; + TcxGridCardViewExport = class; + + TcxExportCardRow = class + private + FHasSeparator: Boolean; + FOwner: TcxExportCard; + function GetCaptionBounds: TRect; + function GetCaptionStyle: TcxViewParams; + function GetCard: TcxGridCard; + function GetCategoryIndent: Integer; + function GetDataAlignment: TAlignment; + function GetDataBounds: TRect; + function GetDataStyle: TcxViewParams; + function GetDataValue: Variant; + function GetHasIndent: Boolean; + function GetHasSeparator: Boolean; + function GetHeight: Integer; + function GetIndentBounds: TRect; + function GetIndentStyle: TcxViewParams; + function GetSeparatorBounds: TRect; + function GetSeparatorWidth: Integer; + function GetShowCaption: Boolean; + function GetShowData: Boolean; + function GetVisibleCaption: string; + function GetWidth: Integer; + procedure SetHeight(AValue: Integer); + procedure SetWidth(AValue: Integer); + protected + procedure AddToScales(AColumnScale, ARowScale: TcxExportScale); + public + Bounds: TRect; + CaptionStyleIndex: Integer; + CaptionWidth: Integer; + DataStyleIndex: Integer; + IndentStyleIndex: Integer; + Row: TcxGridCardViewRow; + constructor Create(AOwner: TcxExportCard); + + property CaptionBounds: TRect read GetCaptionBounds; + property CaptionStyle: TcxViewParams read GetCaptionStyle; + property Card: TcxGridCard read GetCard; + property CategoryIndent: Integer read GetCategoryIndent; + property DataAlignment: TAlignment read GetDataAlignment; + property DataBounds: TRect read GetDataBounds; + property DataStyle: TcxViewParams read GetDataStyle; + property DataValue: Variant read GetDataValue; + property HasIndent: Boolean read GetHasIndent; + property HasSeparator: Boolean read GetHasSeparator; + property Height: Integer read GetHeight write SetHeight; + property IndentBounds: TRect read GetIndentBounds; + property IndentStyle: TcxViewParams read GetIndentStyle; + property Owner: TcxExportCard read FOwner; + property SeparatorBounds: TRect read GetSeparatorBounds; + property SeparatorWidth: Integer read GetSeparatorWidth; + property ShowCaption: Boolean read GetShowCaption; + property ShowData: Boolean read GetShowData; + property VisibleCaption: string read GetVisibleCaption; + property Width: Integer read GetWidth write SetWidth; + end; + + TcxExportCard = class + protected + FBounds: TRect; + FCard: TcxGridCard; + FLayersList: TcxObjectList; + FOwner: TcxGridCardViewExport; + function GetBorderWidth: Integer; + function GetHasSeparators: Boolean; + function GetLayer(AIndex: Integer): TList; + function GetLayerCount: Integer; + function GetLayerSeparator(AIndex: Integer): TRect; + function GetRow(ALayerIndex, ARowIndex: Integer): TcxExportCardRow; + function GetRowCount(ALayerIndex: Integer): Integer; + function GetSeparatorWidth: Integer; + procedure SetBounds(const ABounds: TRect); + protected + function AddLayer: TList; + function AddRow(ALayerIndex: Integer; ARow: TcxGridCardViewRow): TcxExportCardRow; + procedure AddLayerSeparators; + procedure AdjustLayersWidthToWidth; + function AdjustRowsHeightInLayer(ALayer, ATop: Integer): Integer; + procedure AdjustRowsWidthToWidth(ALayer: Integer); + procedure CheckCategorySeparators(AHorizontalLayout: Boolean); + public + constructor Create(AOwner: TcxGridCardViewExport; ACard: TcxGridCard); + destructor Destroy; override; + procedure AddToScales(AColumnScale, ARowScale: TcxExportScale); + procedure CalculateLayersCaptionWidth(AWidths: TcxExportIntList; AFistRowInLayerOnly: Boolean); + function GetRowCaptionWidth(ALayerIndex, ARowIndex: Integer; AMaxWidth: Integer = 0): Integer; + procedure SetLayersCaptionWidth(AWidths: TcxExportIntList; AFistRowInLayerOnly: Boolean); + procedure SetRowCaptionWidth(ALayerIndex, ARowIndex, AWidth: Integer); + + property BorderWidth: Integer read GetBorderWidth; + property Bounds: TRect read FBounds write SetBounds; + property Card: TcxGridCard read FCard; + property HasSeparators: Boolean read GetHasSeparators; + property LayerCount: Integer read GetLayerCount; + property Layers[AIndex: Integer]: TList read GetLayer; + property LayerSeparators[Index: Integer]: TRect read GetLayerSeparator; + property LayersList: TcxObjectList read FLayersList; + property Owner: TcxGridCardViewExport read FOwner; + property RowCount[ALayerIndex: Integer]: Integer read GetRowCount; + property Rows[ALayerIndex, ARowIndex: Integer]: TcxExportCardRow read GetRow; + property SeparatorWidth: Integer read GetSeparatorWidth; + end; + + TcxExportCardLayoutBuilder = class + private + FExportCard: TcxExportCard; + FOwner: TcxGridCardViewExport; + FRowsList: TList; + protected + function GetLayerIndex(ARow: TcxGridCardViewRow): Integer; virtual; + procedure SplitRowsToLayers; virtual; + public + constructor Create(AOwner: TcxGridCardViewExport); + destructor Destroy; override; + procedure BuildLayout(ACard: TcxGridCard; AExportCard: TcxExportCard); + + property ExportCard: TcxExportCard read FExportCard; + property Owner: TcxGridCardViewExport read FOwner; + property RowsList: TList read FRowsList; + end; + + TcxGridCardViewExport = class(TcxGridCustomExport) + private + FCardBorderStyle: Integer; + FCardSeparators: TcxExportScale; + FCardSeparatorStyleIndex: Integer; + + FCategorySeparatorStyleIndex: Integer; + FColumnCardCount: Integer; + FKeepRowsSameHeight: Boolean; + FLayerSeparatorStyleIndex: Integer; + FLayoutBuilder: TcxExportCardLayoutBuilder; + FRowCardCount: Integer; + FExportCardsList: TcxObjectList; + function GetCard(AIndex: Integer): TcxGridCard; + function GetCardBorderWidth: Integer; + function GetCardCount: Integer; + function GetCardHeight: Integer; + function GetCardIndent: Integer; + function GetCardSeparator(AIndex: Integer): TRect; + function GetCardSeparatorCount: Integer; + function GetCardWidth: Integer; + function GetCategoryIndent: Integer; + function GetCategorySeparatorWidth: Integer; + function GetExportCard(AIndex: Integer): TcxExportCard; + function GetGridView: TcxGridCardView; + function GetInterCardHorzSpace: Integer; + function GetInterCardVertSpace: Integer; + function GetIsHorizontalRows: Boolean; + function GetIsSimpleLayout: Boolean; + function GetLayerSeparatorWidth: Integer; + function GetLayoutDirection: TcxGridCardViewLayoutDirection; + function GetOptionsView: TcxGridCardViewOptionsView; + protected + procedure AddCardSeparator(APosition: Integer); + function AddExportCard(AColumnPosition, ARowPosition: Integer; ACard: TcxGridCard): TcxExportCard; + procedure AdjustRowCaptionWidth; + procedure CalculateVisibleInfo; + function CreateCardLayoutBuilder: TcxExportCardLayoutBuilder; + procedure CreateExportCells; override; + procedure ExportCardRow(ACard: TcxExportCard; ARow: TcxExportCardRow; const ACardLogicalBounds: TRect); + procedure ExportCells; override; + procedure Finalize; override; + procedure RegisterStyles; override; + procedure SetRowSameHeight; virtual; + + property ExportCardsList: TcxObjectList read FExportCardsList; + public + property CardBorderStyle: Integer read FCardBorderStyle; + property CardBorderWidth: Integer read GetCardBorderWidth; + property CardCount: Integer read GetCardCount; + property CardHeight: Integer read GetCardHeight; + property CardIndent: Integer read GetCardIndent; + property Cards[Index: Integer]: TcxGridCard read GetCard; + property CardSeparatorCount: Integer read GetCardSeparatorCount; + property CardSeparators[Index: Integer]: TRect read GetCardSeparator; + property CardSeparatorStyleIndex: Integer read FCardSeparatorStyleIndex; + property CardWidth: Integer read GetCardWidth; + property CategoryIndent: Integer read GetCategoryIndent; + property CategorySeparatorStyleIndex: Integer read FCategorySeparatorStyleIndex; + property CategorySeparatorWidth: Integer read GetCategorySeparatorWidth; + property ColumnCardCount: Integer read FColumnCardCount write FColumnCardCount; + property ExportCards[Index: Integer]: TcxExportCard read GetExportCard; + property GridView: TcxGridCardView read GetGridView; + property InterCardHorzSpace: Integer read GetInterCardHorzSpace; + property InterCardVertSpace: Integer read GetInterCardVertSpace; + property IsHorizontalRows: Boolean read GetIsHorizontalRows; + property IsSimpleLayout: Boolean read GetIsSimpleLayout; + property KeepRowsSameHeight: Boolean read FKeepRowsSameHeight; + property LayerSeparatorStyleIndex: Integer read FLayerSeparatorStyleIndex; + property LayerSeparatorWidth: Integer read GetLayerSeparatorWidth; + property LayoutBuilder: TcxExportCardLayoutBuilder read FLayoutBuilder; + property LayoutDirection: TcxGridCardViewLayoutDirection read GetLayoutDirection; + property OptionsView: TcxGridCardViewOptionsView read GetOptionsView; + property RowCardCount: Integer read FRowCardCount write FRowCardCount; + end; + + { TcxGridChartViewExport } + + TcxGridChartViewExport = class(TcxGridCustomExport) + private + function GetGridView: TcxGridChartView; + protected + procedure CreateExportCache; override; + procedure ExportAsGraphic; virtual; + procedure ExportAsData; virtual; + public + property GridView: TcxGridChartView read GetGridView; + end; + +procedure ExportGridToHTML(const AFileName: string; AGrid: TcxGrid; + AExpand: Boolean = True; ASaveAll: Boolean = True; const AFileExt: string = 'html'); +procedure ExportGridToXML(const AFileName: string; AGrid: TcxGrid; + AExpand: Boolean = True; ASaveAll: Boolean = True; const AFileExt: string = 'xml'); +procedure ExportGridToExcel(const AFileName: string; AGrid: TcxGrid; + AExpand: Boolean = True; ASaveAll: Boolean = True; AUseNativeFormat: Boolean = True; + const AFileExt: string = 'xls'); +procedure ExportGridToText(const AFileName: string; AGrid: TcxGrid; + AExpand: Boolean = True; ASaveAll: Boolean = True; const ASeparator: string = ''; + const ABeginString: string = ''; const AEndString: string = ''; + const AFileExt: string = 'txt'); + +const + ExportImagesAsGraphic: Boolean = True; + +implementation + +uses + cxXLSExport, cxHtmlXmlTxtExport, Math; + +const + Alignment2ExportAlignment: array[TAlignment] of TcxAlignText = + (catLeft, catRight, catCenter); + + GridLines2Borders: array[TcxGridLines] of TcxBorders = + (cxBordersAll, [], [bRight, bLeft], [bTop, bBottom]); + + BorderWidths: array[Boolean] of Integer = (0, 1); + + ButtonTexts: array[Boolean] of string = ('+', '-'); + + CardRowDefaultWidth = 20; + cxDefaultRowHeight = 19; + +type + TcxCustomGridRecordAccess = class(TcxCustomGridRecord); + +function cxCompareGroupSummaryItems(AItem1, AItem2: TcxExportGroupSummaryItem): Integer; +begin + if AItem1.Column = AItem2.Column then + Result := AItem1.Index - AItem2.Index + else + if AItem1.Column = nil then + Result := -1 + else + if AItem2.Column = nil then + Result := 1 + else + Result := AItem1.Column.VisibleIndex - AItem2.Column.VisibleIndex; +end; + +function GetExportClassByGridView(AGridView: TcxCustomGridView): TcxGridCustomExportClass; +begin + if AGridView is TcxGridBandedTableView then + Result := TcxGridBandedTableViewExport + else + if AGridView is TcxGridTableView then + Result := TcxGridTableViewExport + else + if AGridView is TcxGridCardView then + Result := TcxGridCardViewExport + else + if AGridView is TcxGridChartView then + Result := TcxGridChartViewExport + else + raise EcxGridExport.Create(cxGetResourceString(@scxNotExistGridView)); +end; + +procedure CalculateCardRowWidths(var AWidths: array of Integer; AAvailableWidth: Integer); +var + AAutoWidths: TcxAutoWidthObject; + AAllFixed: Boolean; + I: Integer; +begin + AAutoWidths := TcxAutoWidthObject.Create(Length(AWidths)); + try + AAllFixed := True; + for I := 0 to High(AWidths) do + with AAutoWidths.AddItem do + begin + Width := AWidths[I]; + Fixed := Width <> 0; + AAllFixed := AAllFixed and Fixed; + if Width = 0 then Width := CardRowDefaultWidth; + end; + if AAllFixed or (AAutoWidths.Width > AAvailableWidth) then + for I := 0 to AAutoWidths.Count - 1 do + AAutoWidths[I].Fixed := False; + AAutoWidths.AvailableWidth := AAvailableWidth; + AAutoWidths.Calculate; + for I := 0 to High(AWidths) do + AWidths[I] := AAutoWidths[I].AutoWidth; + finally + AAutoWidths.Free; + end; +end; + +procedure ExportGridToFile(AFileName: string; AExportType: Integer; + AGrid: TcxGrid; AExpand, ASaveAll, AUseNativeFormat: Boolean; + const ASeparator, ABeginString, AEndString: string; const AFileExt: string); +var + AView: TcxCustomGridView; + AGridExport: TcxGridCustomExport; +begin + if AGrid <> nil then + begin + if AFileExt <> '' then + AFileName := ChangeFileExt(AFileName, '.' + AFileExt); + AView := AGrid.ActiveLevel.GridView; + AGridExport := GetExportClassByGridView(AGrid.FocusedView).Create(AFileName, AExportType, AView, AGrid, nil); + AGridExport.SaveAll := ASaveAll; + AGridExport.Expand := AExpand; + AGridExport.UseNativeFormat := AUseNativeFormat; + AGridExport.AddSeparators([ASeparator, ABeginString, AEndString]); + AGrid.BeginUpdate; + try + try + AGridExport.DoExport; + finally + AGridExport.Free; + end; + finally + AGrid.EndUpdate; + end; + end; +end; + +// *** + +{ TcxGridCustomExport } + +constructor TcxGridCustomExport.Create(AFileName: string; AExportType: Integer; + AGridView: TcxCustomGridView; AGrid: TcxCustomGrid; AViewInfo: TcxCustomGridViewInfo); +begin + try + {$IFDEF DELPHI5} + FProvider := TcxExport.Provider(AExportType, AFileName) as IcxExportProvider; + FInternalProviderSupported := Supports(FProvider, + IcxCellInternalCache, FInternalProvider); + {$ELSE} + TcxExport.Provider(AExportType, AFileName).GetInterface(IcxExportProvider, FProvider); + FInternalProviderSupported := (FExport.QueryInterface(IcxCellInternalCache, FInternalProvider) = S_OK); + {$ENDIF} + except + on EStreamError do + raise EcxGridExport.Create(cxGetResourceString(@scxCantCreateExportOutputFile)); + end; + FDefaultRowHeight := cxDefaultRowHeight; + FGridView := AGridView; + FGrid := AGrid; + FRecordsList := TList.Create; + FViewInfo := AViewInfo; + FFileName := AFileName; + FExportType := AExportType; + FColumns := TcxExportScale.Create; + FRows := TcxExportScale.Create; +end; + +constructor TcxGridCustomExport.CreateFrom(AMasterExport: TcxGridCustomExport; + AGridView: TcxCustomGridView; AViewInfo: TcxCustomGridViewInfo); +begin + Create(AMasterExport.FileName, AMasterExport.ExportType, + AGridView, AMasterExport.Grid, AViewInfo); + Expand := AMasterExport.Expand; + SaveAll := AMasterExport.SaveAll; +end; + +destructor TcxGridCustomExport.Destroy; +begin + FInternalProvider := nil; + FProvider := nil; + FreeAndNil(FRecordsList); + FreeAndNil(FColumns); + FreeAndNil(FRows); + inherited Destroy; +end; + +procedure TcxGridCustomExport.AddSeparators(const ASeparators: array of string); +var + I: Integer; + AExportWithSeparators: IcxExportWithSeparators; +begin +{$IFDEF DELPHI5} + if Supports(Provider, IcxExportWithSeparators, AExportWithSeparators) then +{$ELSE} + if (FExport.QueryInterface(IcxExportWithSeparators, AExportWithSeparators) = S_OK) then +{$ENDIF} + begin + for I := 0 to High(ASeparators) do + AExportWithSeparators.AddSeparator(ASeparators[I]); + end; +end; + +procedure TcxGridCustomExport.DoExport; +begin + CreateExportCache; + BeforeCommit; + Provider.Commit; +end; + +procedure TcxGridCustomExport.BeforeCommit; +begin +end; + +function TcxGridCustomExport.CalculateViewViewInfo(AGridView: TcxCustomGridView; + ABounds: TRect): TcxCustomGridViewInfo; +begin + Result := nil; + if not (AGridView is TcxCustomGridTableView) then Exit; + Result := AGridView.CreateViewInfo; + with Result as TcxCustomGridTableViewInfo do + begin + FirstRecordIndex := 0; + MainCalculate(ABounds); + end; +end; + +function TcxGridCustomExport.CheckNativeValue(AProperties: TcxCustomEditProperties; + AItem: TcxCustomGridTableItem; const AValue: Variant): Variant; +begin + try + if (IsCurrencyItem(AItem) and IsCurrencyProperties(AProperties)) or + (AProperties is TcxCurrencyEditProperties) then + VarCast(Result, AValue, varCurrency) + else + if (VarType(AValue) = varCurrency) and not IsCurrencyItem(AItem) and + not (AProperties is TcxCurrencyEditProperties) then + VarCast(Result, AValue, varDouble) + else + Result := AValue; + except + on EVariantError do + Result := AValue + else + raise; + end; +end; + +procedure TcxGridCustomExport.CreateExportCache; +begin + Initialize; + try + ExtractRowsForExport; + RegisterStyles; + CreateExportCells; + Columns.Arrange; + Rows.Arrange; + if not IsEmpty then + begin + Provider.SetRange(Columns.VisibleCount, Rows.VisibleCount, False); + ExportCells; + end; + finally + Finalize; + end; +end; + +procedure TcxGridCustomExport.CreateExportCells; +begin +end; + +procedure TcxGridCustomExport.ExpandRecords(AFullExpand: Boolean); +var + I: Integer; + ARecord: TcxCustomGridRecord; + AViewData: TcxCustomGridTableViewData; +begin + if not GridView.InheritsFrom(TcxCustomGridTableView) then Exit; + AViewData := (GridView as TcxCustomGridTableView).ViewData; + if AFullExpand then + AViewData.Expand(True) + else + begin + I := 0; + while I < AViewData.RecordCount - 1 do + begin + ARecord := AViewData.Records[I]; + if ARecord.Selected and ARecord.Expandable and not ARecord.Expanded then + ARecord.Expanded := True + else + Inc(I); + end; + end; +end; + +procedure TcxGridCustomExport.ExportCells; +var + I: Integer; +begin + for I := 0 to Columns.VisibleCount - 1 do + Provider.SetColumnWidth(I, Columns.Delta[I]); + for I := 0 to Rows.VisibleCount - 1 do + begin + if Rows.Delta[I] <> DefaultRowHeight then + Provider.SetRowHeight(I, Rows.Delta[I]); + end; + FillArea(Rect(0, 0, Columns.Count - 1, Rows.Count - 1), DefaultStyleIndex); +end; + +procedure TcxGridCustomExport.ExtractRowsForExport; +var + I: Integer; + ARecord: TcxCustomGridRecord; + AViewData: TcxCustomGridTableViewData; +begin + if not (GridView.ViewData is TcxCustomGridTableViewData) then Exit; + AViewData := GridView.ViewData as TcxCustomGridTableViewData; + SaveAll := SaveAll or not HasSelectedRecords(GridView); + Grid.BeginUpdate; + try + I := 0; + while I < AViewData.RecordCount do + begin + ARecord := AViewData.Records[I]; + Inc(I); + if not SaveAll and not HasSelectedChildren(ARecord) then Continue; + if Expand then + ARecord.Expanded := True; + RecordsList.Add(Pointer(I - 1)); + end; + for I := 0 to RecordCount - 1 do + RecordsList[I] := AViewData.Records[Integer(RecordsList[I])]; + finally + Grid.EndUpdate; + end; +end; + +procedure TcxGridCustomExport.FillArea(const ABounds: TRect; AStyleIndex: Integer; + ABorderColor: TColor = clDefault; ABorders: TcxBorders = cxBordersAll); +var + AStyle: TcxCacheCellStyle; + I, J, AActualStyleIndex: Integer; + + procedure SetBorderStyle(ASide: TcxBorder); + begin + AStyle.Borders[Integer(ASide)].IsDefault := False; + AStyle.Borders[Integer(ASide)].Width := 1; + AStyle.Borders[Integer(ASide)].Color := ColorToRgb(ABorderColor); + end; + +begin + for I := ABounds.Top to ABounds.Bottom - 1 do + for J := ABounds.Left to ABounds.Right - 1 do + begin + AActualStyleIndex := AStyleIndex; + if (ABorderColor <> clDefault) and (ABorders <> []) then + begin + AStyle := Provider.GetStyle(AStyleIndex)^; + if J = ABounds.Left then + SetBorderStyle(bLeft); + if I = ABounds.Top then + SetBorderStyle(bTop); + if J = ABounds.Right - 1 then + SetBorderStyle(bRight); + if I = ABounds.Bottom - 1 then + SetBorderStyle(bBottom); + AActualStyleIndex := Provider.RegisterStyle(AStyle); + end; + Provider.SetCellStyle(J, I, AActualStyleIndex); + end; +end; + +procedure TcxGridCustomExport.FillRealArea(const ABounds: TRect; AStyleIndex: Integer; + ABorderColor: TColor = clDefault; ABorders: TcxBorders = cxBordersAll); +var + ALogicalBounds: TRect; +begin + RealBoundsToLogicalBounds(ABounds, ALogicalBounds); + FillArea(ALogicalBounds, AStyleIndex, ABorderColor, ABorders); +end; + +procedure TcxGridCustomExport.Finalize; +begin + if FSaveGridModeFlag and (DataController is TcxDBDataController) then + begin + TcxDBDataController(DataController).DataModeController.GridMode := FSaveGridModeFlag; + DataController.RestoreDataSetPos; + end; +end; + +function TcxGridCustomExport.GetContentParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams; + ABorders: TcxBorders = []; ABorderColor: TColor = clDefault): TcxCacheCellStyle; +begin + AItem.Styles.GetContentParams(ARecord, AParams); + ViewParamsToExportStyle(AParams, Result, AItem.GetProperties.Alignment.Horz, + ABorders, ABorderColor); +end; + +function TcxGridCustomExport.GetViewItemValue( + ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem): Variant; +var + AProperties: TcxCustomEditProperties; +begin + Result := GetViewItemValueEx(ARecord, AItem, AProperties); +end; + +function TcxGridCustomExport.GetViewItemValueEx(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AProperties: TcxCustomEditProperties): Variant; +var + S: string; +begin + AProperties := AItem.GetProperties(ARecord); + if IsNativeFormatProperties(AProperties, AItem) then + Result := CheckNativeValue(AProperties, AItem, ARecord.Values[AItem.Index]) + else + begin + if AProperties.GetEditValueSource(False) = evsValue then + S := AProperties.GetDisplayText(ARecord.Values[AItem.Index], True) + else + S := ARecord.DisplayTexts[AItem.Index]; + TcxCustomGridTableItemAccess.DoGetDisplayText(AItem, ARecord, S); + Result := S; + end; +end; + +function TcxGridCustomExport.HasSelectedChildren(ARecord: TcxCustomGridRecord): Boolean; +begin + Result := ARecord.Selected or ARecord.Expanded and (ARecord is TcxGridMasterDataRow) and + (TcxGridMasterDataRow(ARecord).ActiveDetailGridView <> nil) and + HasSelectedRecords(TcxGridMasterDataRow(ARecord).ActiveDetailGridView) +end; + +function TcxGridCustomExport.HasSelectedRecords(AView: TcxCustomGridView): Boolean; +var + I: Integer; +begin + Result := False; + if AView is TcxCustomGridTableView then + begin + Result := TcxCustomGridTableView(AView).Controller.SelectedRecordCount > 0; + if Result then Exit; + for I := 0 to TcxCustomGridTableView(AView).ViewData.RecordCount - 1 do + if HasSelectedChildren(TcxCustomGridTableView(AView).ViewData.Records[I]) then + begin + Result := True; + Break; + end; + end; +end; + +procedure TcxGridCustomExport.Initialize; +begin + FSaveGridModeFlag := DataController.IsGridMode; + if FSaveGridModeFlag and (DataController is TcxDBDataController) then + begin + DataController.SaveDataSetPos; + TcxDBDataController(DataController).DataModeController.GridMode := False; + end; + Columns.Add(0); + Rows.Add(0); +end; + +function TcxGridCustomExport.IsCurrencyItem(AItem: TcxCustomGridTableItem): Boolean; +var + AField: TField; +begin + Result := AItem.DataBinding.ValueTypeClass = TcxCurrencyValueType; + if GridView.DataController is TcxGridDBDataController then + begin + AField := TcxGridDBDataController(GridView.DataController).GetItemField(AItem.Index); + if AField is TFloatField then + Result := TFloatField(AField).Currency + else + if AField is TBCDField then + Result := TBCDField(AField).Currency + {$IFDEF DELPHI5} + else + if AField is TAggregateField then + Result := TAggregateField(AField).Currency + {$ENDIF} + {$IFDEF DELPHI6} + else + if AField is TFMTBCDField then + Result := TFMTBCDField(AField).Currency + {$ENDIF} + end; +end; + +function TcxGridCustomExport.IsCurrencyProperties( + AProperties: TcxCustomEditProperties): Boolean; +begin + Result := ((AProperties is TcxMaskEditProperties) or + (AProperties is TcxCalcEditProperties) or + (AProperties is TcxCurrencyEditProperties)) and UseNativeFormat; +end; + +function TcxGridCustomExport.IsEmpty: Boolean; +begin + Result := (Columns.VisibleCount = 0) or (Rows.VisibleCount = 0); +end; + +function TcxGridCustomExport.IsNativeFormatProperties( + AProperties: TcxCustomEditProperties; AItem: TcxCustomGridTableItem): Boolean; +begin + Result := (AProperties is TcxDateEditProperties) or (AProperties is TcxSpinEditProperties) + or (AProperties is TcxTimeEditProperties) or IsCurrencyProperties(AProperties); + Result := Result and UseNativeFormat; +end; + +procedure TcxGridCustomExport.RealBoundsToLogicalBounds( + const ABounds: TRect; out ALogicalBounds: TRect); +begin + with ALogicalBounds do + begin + Columns.GetPosition(ABounds.Left, ABounds.Right, Left, Right); + Rows.GetPosition(ABounds.Top, ABounds.Bottom, Top, Bottom); + end; +end; + +procedure TcxGridCustomExport.RealBoundsToLogicalBoundsEx( + const ABounds, ASearchArea: TRect; out ALogicalBounds: TRect); +begin + with ALogicalBounds do + begin + Columns.GetPositionEx(ABounds.Left, ABounds.Right, + ASearchArea.Left, ASearchArea.Right, Left, Right); + Rows.GetPositionEx(ABounds.Top, ABounds.Bottom, + ASearchArea.Top, ASearchArea.Bottom, Top, Bottom); + end; +end; + +function TcxGridCustomExport.RegisterContentParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams): Integer; +begin + Result := Provider.RegisterStyle(GetContentParams(ARecord, AItem, AParams)); +end; + +function TcxGridCustomExport.RegisterSolidStyle( + AStyleIndex: Integer; AData: TObject = nil): Integer; +var + AParams: TcxViewParams; +begin + AParams.Color := clNone; + if GridView is TcxCustomGridTableView then + TcxCustomGridTableView(GridView).Styles.GetViewParams(AStyleIndex, AData, nil, AParams); + Result := RegisterSolidStyleEx(AParams.Color); +end; + +procedure TcxGridCustomExport.RegisterStyles; +var + AViewParams: TcxViewParams; +begin + if GridView is TcxCustomGridTableView then + with TcxCustomGridTableView(GridView).Styles do + begin + GetViewParams(vsBackground, nil, Background, AViewParams); + ViewParamsToExportStyle(AViewParams, FDefaultStyle); + end; + Provider.SetDefaultStyle(DefaultStyle); + DefaultStyleIndex := Provider.RegisterStyle(DefaultStyle); +end; + +function TcxGridCustomExport.RegisterSolidStyleEx(AColor: TColor): Integer; +var + AStyle: TcxCacheCellStyle; +begin + AStyle := DefaultStyle; + AStyle.BrushBkColor := ColorToRgb(AColor); + Result := Provider.RegisterStyle(AStyle); +end; + +function TcxGridCustomExport.RegisterViewParams( + const AViewParams: TcxViewParams; const AAlignment: TAlignment = taLeftJustify): Integer; +var + AStyle: TcxCacheCellStyle; +begin + ViewParamsToExportStyle(AViewParams, AStyle, AAlignment); + Result := Provider.RegisterStyle(AStyle) +end; + +function TcxGridCustomExport.SetCellAsGraphic(AColumn, ARow: Integer; + ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem): Boolean; +var + AGraphic: TGraphic; + APicture: TPicture; +begin + Result := (AItem.GetProperties is TcxImageProperties) and ExportImagesAsGraphic; + if not Result then Exit; + APicture := TPicture.Create; + try + LoadPicture(APicture, TcxImageProperties(AItem.GetProperties).GetGraphicClass( + AItem, ARecord.Index), ARecord.Values[AItem.Index]); + AGraphic := APicture.Graphic; + if AGraphic <> nil then + Provider.SetCellDataGraphic(AColumn, ARow, AGraphic); + finally + APicture.Free; + end +end; + +procedure TcxGridCustomExport.SetCellValueAndStyle( + AColumn, ARow: Integer; const AValue: Variant; const AStyle: TcxCacheCellStyle); +begin + Provider.SetCellValue(AColumn, ARow, AValue); + Provider.SetCellStyle(AColumn, ARow, AStyle); +end; + +procedure TcxGridCustomExport.SetRealCellStyle( + const ARealBounds, ASearchArea: TRect; AStyleIndex: Integer); +begin + SetRealCellStyleAndValue(ARealBounds, ASearchArea, AStyleIndex, Null); +end; + +procedure TcxGridCustomExport.SetRealCellStyleAndValue( + const ARealBounds, ASearchArea: TRect; AStyleIndex: Integer; const AValue: Variant); +var + R: TRect; +begin + RealBoundsToLogicalBoundsEx(ARealBounds, ASearchArea, R); + if not VarIsNull(AValue) then + Provider.SetCellValue(R.Left, R.Top, AValue); + Provider.SetCellStyleEx(R.Left, R.Top, R.Bottom - R.Top, R.Right - R.Left, AStyleIndex); +end; + +procedure TcxGridCustomExport.SetRealCellStyleAndValueEx( + const ARealBounds, ASearchArea: TRect; AStyleIndex: Integer; + ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem); +var + R: TRect; +begin + RealBoundsToLogicalBoundsEx(ARealBounds, ASearchArea, R); + if AItem <> nil then + begin + if not Provider.SupportGraphic or not SetCellAsGraphic(R.Left, R.Top, ARecord, AItem) then + Provider.SetCellValue(R.Left, R.Top, GetViewItemValue(ARecord, AItem)); + end; + Provider.SetCellStyleEx(R.Left, R.Top, R.Bottom - R.Top, R.Right - R.Left, AStyleIndex); +end; + +function TcxGridCustomExport.TextHeight(AFont: TFont): Integer; +begin + Result := cxTextHeight(AFont) + cxTextOffset * 2; +end; + +function TcxGridCustomExport.TextHeightEx( + const AViewParams: TcxViewParams): Integer; +begin + Result := TextHeight(AViewParams.Font); +end; + +function TcxGridCustomExport.TextWidth( + AFont: TFont; const AText: string): Integer; +begin + Result := cxTextWidth(AFont, AText) + cxTextOffset * 2; +end; + +function TcxGridCustomExport.TextWidthEx( + const AViewParams: TcxViewParams; const AText: string): Integer; +begin + Result := TextWidth(AViewParams.Font, AText); +end; + +procedure TcxGridCustomExport.ViewParamsToExportStyle( + const AViewParams: TcxViewParams; var AExportStyle: TcxCacheCellStyle; + const AAlignment: TAlignment = taLeftJustify; + ABorders: TcxBorders = []; ABorderColor: TColor = clDefault); +var + I: Integer; +begin + AExportStyle := DefaultCellStyle; + with AExportStyle do + begin + BrushBkColor := cxColorToRGB(AViewParams.Color); + FontColor := cxColorToRGB(AViewParams.TextColor); + StrPCopy(FontName, AViewParams.Font.Name); + FontStyle := TcxFontStyles(AViewParams.Font.Style); + FontSize := AViewParams.Font.Size; + FontCharset := Integer(AViewParams.Font.Charset); + AlignText := Alignment2ExportAlignment[AAlignment]; + for I := 0 to 3 do + begin + Borders[I].IsDefault := (ABorderColor = clDefault) or not (TcxBorder(I) in ABorders); + Borders[I].Width := BorderWidths[not Borders[I].IsDefault]; + if not Borders[I].IsDefault then + Borders[I].Color := ColorToRgb(ABorderColor); + end; + end; +end; + +function TcxGridCustomExport.GetDataController: TcxCustomDataController; +begin + Result := GridView.DataController; +end; + +function TcxGridCustomExport.GetExpandButtonSize: Integer; +begin + Result := ViewInfo.LookAndFeelPainter.ExpandButtonSize; +end; + +function TcxGridCustomExport.GetRecord( + ARecordIndex: Integer): TcxCustomGridRecord; +begin + Result := TcxCustomGridRecord(RecordsList[ARecordIndex]); +end; + +function TcxGridCustomExport.GetRecordCount: Integer; +begin + Result := RecordsList.Count; +end; + +function TcxGridCustomExport.GetViewInfo: TcxCustomGridViewInfo; +begin + if FViewInfo = nil then + FViewInfo := GridView.ViewInfo; + Result := FViewInfo; +end; + +{ TcxExportVisualItem } + +function TcxExportVisualItem.GetBoundsRelativeTo(ATop, ALeft: Integer): TRect; +begin + Result := Bounds; + OffsetRect(Result, 0, ATop); + Result.Left := Max(Result.Left, ALeft); + Result.Right := Max(Result.Right, ALeft); +end; + +function TcxExportVisualItem.IsColumn: Boolean; +begin + Result := Data is TcxGridColumn; +end; + +{ TcxExportGroupSummaryItem } + +procedure TcxExportGroupSummaryItem.InitWidth; +begin + Bounds.Right := Min(Bounds.Right, Bounds.Left + + cxTextWidth(ViewParams.Font, Text) + cxTextOffset * 3); +end; + +{ TcxGridTableViewExport } + +procedure TcxGridTableViewExport.AddDataRow( + var ATop, ALeft: Integer; ARow: TcxGridDataRow); +begin + ALeft := AddIndents(ATop, RecordHeight + GetPreviewHeight(ARow), ARow, ARow.Expandable); + if (PreviewPlace = ppTop) and HasPreview[ARow] then + AddRowPreview(ATop, ALeft, ARow); + CreateRecordFromPattern(ATop, ALeft, ARow); + Inc(ATop, RecordHeight); + if (PreviewPlace = ppBottom) and HasPreview[ARow] then + AddRowPreview(ATop, ALeft, ARow); +end; + +procedure TcxGridTableViewExport.AddFooterCells(var ATop, ALeft: Integer; + ARow: TcxCustomGridRow; ALevel, ADataLevel: Integer; AItems: TcxDataSummaryItems; + AValues: PVariant; AIsFooter: Boolean); +var + R: TRect; + AValue: Variant; + AColumn: TcxGridColumn; + AParams: TcxViewParams; + AItem: TcxDataSummaryItem; + I, J, ACellCount, ALineIndex, ARowCount: Integer; + AFooterCell: TcxExportVisualItem; +begin + if CanShowMultiSummaries(AIsFooter) then + ARowCount := GetFooterLineCount(AItems) + else + ARowCount := RecordRowCount; + R.Bottom := ATop + ARowCount * (DefaultRowHeight + cxGridFooterCellIndent); + if ALevel <> 0 then + ALeft := AddIndents(ATop, R.Bottom - ATop, ARow, False, ALevel - 1); + R := Rect(ALeft, ATop, RecordWidth, R.Bottom); + Styles.GetFooterParams(TcxCustomGridRow(ARow), nil, ADataLevel, nil, AParams); + AddVisualItemEx(R, '', AParams, taLeftJustify, [], clDefault, True); + ATop := R.Bottom; + ACellCount := GetFooterCellCount(AItems); + for I := 0 to PatternCount - 1 do + begin + if ACellCount = 0 then Break; + ALineIndex := 0; + if Patterns[I].IsColumn then + begin + AColumn := TcxGridColumn(Patterns[I].Data); + for J := 0 to AItems.Count - 1 do + begin + AItem := AItems[J]; + if (AItem.ItemLink <> AColumn) or (AItem.Position <> spFooter) then Continue; + GridView.Styles.GetFooterCellParams(ARow, AColumn, ADataLevel, AItem, AParams); + if AIsFooter then + AValue := DataController.Summary.FooterSummaryValues[J] + else + AValue := AValues^[J]; + AFooterCell := AddVisualItemEx(GetFooterItemBounds(I, ALineIndex, R, AIsFooter), AItem.FormatValue( + AValue, True), AParams, AColumn.FooterAlignmentHorz, cxBordersAll, FooterCellBorderColor); + if UseNativeFormat and VarIsNumeric(AValue) then + begin + AFooterCell.Data2 := AItem; + AFooterCell.Value := AValue; +{ if AColumn <> nil then + AFooterCell.Value := CheckNativeValue(AColumn.GetProperties, AColumn, AValue);} + end; + Dec(ACellCount); + Inc(ALineIndex); + if not CanShowMultiSummaries(AIsFooter) then Break; + end; + end; + end; +end; + +procedure TcxGridTableViewExport.AddGroupRow( + var ATop, ALeft: Integer; ARow: TcxGridGroupRow); +var + R: TRect; + S: string; + AValues: PVariant; + I, AHeight: Integer; + AViewParams: TcxViewParams; + AItems: TcxDataSummaryItems; + AItem: TcxExportGroupSummaryItem; + AExportItem: TcxExportVisualItem; +begin + AHeight := Viewinfo.RecordsViewInfo.GroupRowHeight; + R := Rect(0, ATop, RecordWidth, ATop + AHeight); + R.Left := AddIndents(ATop, AHeight, ARow, True); + Styles.GetGroupParams(ARow, ARow.Level, AViewParams); + AddVisualItemEx(R, '', AViewParams, taLeftJustify, [], clDefault, True); + if IsSummaryUnderColumns and ARow.GetGroupSummaryInfo(AItems, AValues) then + begin + GroupSummaryItemsList.Clear; + GroupSummaryItemsList.Capacity := 1024; + for I := 0 to AItems.Count - 1 do + ProcessGroupSummaryItem(ARow, AValues, I, R, AViewParams); + GroupSummaryItemsList.Sort(@cxCompareGroupSummaryItems); + ProcessGroupSummaryItems(ARow, R); + for I := 0 to GroupSummaryItemCount - 1 do + begin + AItem := GroupSummaryItems[I]; + AExportItem := AddVisualItemEx(AItem.Bounds, AItem.Text, AItem.ViewParams, + AItem.Alignment, GridLines - [bLeft, bRight], GridLineColor, False); + if not VarIsNull(AItem.Value) then + begin + AExportItem.Data2 := AItem.SummaryItem; + AExportItem.Value := AItem.Value; + end; + end; + end + else + begin + S := ARow.DisplayText; + TcxCustomGridTableItemAccess.DoGetDisplayText(ARow.GroupedColumn, ARow, S); + AddVisualItemEx(R, S, AViewParams, + taLeftJustify, GridLines, GridLineColor, False); + end; + Inc(ATop, AHeight); +end; + +function TcxGridTableViewExport.AddIndents(ATop, ARowHeight: Integer; + ARow: TcxCustomGridRecord; AHasButton: Boolean; ALevel: Integer = -1): Integer; +var + R: TRect; + I: Integer; + AText: string; + AStyle: TcxCacheCellStyle; + AGridLines: TcxBorders; + AViewParams: TcxViewParams; +begin + if ALevel = -1 then + ALevel := ARow.Level - 1 + Byte(AHasButton); + while (ALevel >= 0) and (ALevel < ARow.Level) do + ARow := TcxGridDataRow(ARow).ParentRecord; + R := Rect(ALevel * ViewInfo.LevelIndent, ATop, + (ALevel + 1) * ViewInfo.LevelIndent, ATop + ARowHeight); + AGridLines := GridLines; + if not ARow.IsLast or AHasButton and ARow.Expanded then + AGridLines := GridLines - [bBottom]; + for I := ALevel downto 0 do + begin + AText := ''; + if AHasButton and (I = ALevel) then + begin + AText := ButtonTexts[ARow.Expanded]; + AStyle := GetExpandButtonParams(AGridLines); + end + else + begin + if ARow is TcxGridGroupRow then + Styles.GetGroupParams(ARow, I, AViewParams) + else + Styles.GetContentParams(ARow, nil, AViewParams); + ViewParamsToExportStyle(AViewParams, AStyle, taLeftJustify, AGridLines - [bTop], GridLineColor); + end; + ARow := ARow.ParentRecord; + AddVisualItemEx(R, AText, Provider.RegisterStyle(AStyle), False); + OffsetRect(R, -ViewInfo.LevelIndent, 0); + end; + Result := (ALevel + 1) * ViewInfo.LevelIndent; +end; + +procedure TcxGridTableViewExport.AddMasterDataRow( + var ATop, ALeft: Integer; ARow: TcxGridMasterDataRow); +var + ABounds: TRect; +begin + AddDataRow(ATop, ALeft, ARow); + if not ARow.Expanded or not InternalProviderSupported then Exit; + ALeft := AddIndents(ATop, DefaultRowHeight, ARow, False, ARow.Level); + ABounds := Rect(ALeft, ATop, RecordWidth, ATop + DefaultRowHeight); + with AddVisualDataItem(ABounds, DefaultStyleIndex, ARow, nil) do + Hidden := True; + ATop := ABounds.Bottom; +end; + +procedure TcxGridTableViewExport.AddRowFooter( + var ATop, ALeft: Integer; ADataLevel, ALevel: Integer; ARow: TcxCustomGridRecord); +var + AValues: PVariant; + AItems: TcxDataSummaryItems; +begin + ALeft := 0; + while ARow.Level > ADataLevel do + ARow := ARow.ParentRecord; + if DataController.Summary.GetGroupSummaryInfo(ARow.Index, AItems, AValues) then + begin + AddFooterCells(ATop, ALeft, TcxCustomGridRow(ARow), + ALevel, ADataLevel, AItems, AValues, False); + end; +end; + +procedure TcxGridTableViewExport.AddRowFooters( + var ATop, ALeft: Integer; ARow: TcxCustomGridRecord); +var + ALevel, ARealLevel: Integer; +begin + for ALevel := 0 to ARow.Level do + begin + ARealLevel := ALevel; + if HasFooter(ARow, ARealLevel) then + AddRowFooter(ATop, ALeft, ARealLevel, ARow.Level - ALevel, ARow); + end; +end; + +procedure TcxGridTableViewExport.AddRowPreview( + var ATop, ALeft: Integer; ARow: TcxCustomGridRecord); +var + R: TRect; + AColumn: TcxGridColumn; + AParams: TcxViewParams; +begin + AColumn := GridView.Preview.Column; + AColumn.Styles.GetContentParams(ARow, AParams); + R := Rect(ALeft, ATop, RecordWidth, ATop + GetPreviewHeight(ARow)); + AddVisualItemEx(R, VarToStr(GetViewItemValue(ARow, AColumn)), AParams, + AColumn.GetProperties.Alignment.Horz, GridLines, GridLineColor); + ATop := R.Bottom; +end; + +function TcxGridTableViewExport.AddVisualItem( + AItemClass: TcxExportVisualItemClass; const ABounds: TRect): TcxExportVisualItem; +begin + Result := AItemClass.Create(); + Result.Style := -1; + Result.Bounds := ABounds; + with ABounds do + begin + Columns.AddPairs(Left, Right); + Rows.AddPairs(Top, Bottom); + end; + with VisualItemsList do + if Capacity - Count < 2 then Capacity := Count * 2; + VisualItemsList.Add(Result); +end; + +function TcxGridTableViewExport.AddVisualDataItem( + const AItemBounds: TRect; AStyle: Integer; + ARecord: TcxCustomGridRecord; AColumn: TcxGridColumn): TcxExportVisualItem; +begin + Result := AddVisualItem(TcxExportVisualItem, AItemBounds); + Result.Style := AStyle; + Result.Data := ARecord; + Result.Data2 := AColumn; +end; + +function TcxGridTableViewExport.AddVisualItemEx( + const AItemBounds: TRect; const ADisplayText: string; const AViewParams: TcxViewParams; + AAlignment: TAlignment; ABorders: TcxBorders; ABorderColor: TColor = clDefault; + AIsBackground: Boolean = False): TcxExportVisualItem; +var + ASide: TcxBorder; + AStyle: TcxCacheCellStyle; +begin + ViewParamsToExportStyle(AViewParams, AStyle, AAlignment); + if ABorderColor <> clDefault then + begin + ABorderColor := ColorToRgb(ABorderColor); + for ASide := bLeft to bBottom do + if ASide in ABorders then + begin + AStyle.Borders[Integer(ASide)].IsDefault := False; + AStyle.Borders[Integer(ASide)].Color := ABorderColor; + AStyle.Borders[Integer(ASide)].Width := 1; + end; + end; + Result := AddVisualItemEx(AItemBounds, ADisplayText, + Provider.RegisterStyle(AStyle), AIsBackground); +end; + +function TcxGridTableViewExport.AddVisualItemEx( + const AItemBounds: TRect; const ADisplayText: string; + AStyle: Integer; AIsBackground: Boolean = False): TcxExportVisualItem; +begin + Result := AddVisualItem(TcxExportVisualItem, AItemBounds); + Result.Bounds := AItemBounds; + Result.IsBackground := AIsBackground; + Result.DisplayText := ADisplayText; + Result.Style := AStyle; +end; + +function TcxGridTableViewExport.AddPattern(const ABounds: TRect; + AData: TObject; AOffset: Integer = 0): TcxExportVisualItem; +begin + Result := TcxExportVisualItem.Create; + Result.Bounds := ABounds; + Result.Data := AData; + Result.Data2 := TObject(AOffset); + PatternsList.Add(Result); +end; + +function TcxGridTableViewExport.CanShowMultiSummaries(AIsFooter: Boolean): Boolean; +begin + if AIsFooter then + Result := OptionsView.CanShowFooterMultiSummaries + else + Result := OptionsView.CanShowGroupFooterMultiSummaries; +end; + +procedure TcxGridTableViewExport.CreateContent(var ATop, ALeft: Integer); +var + I: Integer; + ARow: TcxCustomGridRecord; +begin + for I := 0 to RecordCount - 1 do + begin + ALeft := 0; + ARow := Records[I]; + if ARow is TcxGridGroupRow then + AddGroupRow(ATop, ALeft, TcxGridGroupRow(ARow)) + else + if ARow is TcxGridMasterDataRow then + AddMasterDataRow(ATop, ALeft, TcxGridMasterDataRow(ARow)) + else + if ARow is TcxGridDataRow then + AddDataRow(ATop, ALeft, TcxGridDataRow(ARow)); + AddRowFooters(ATop, ALeft, ARow); + end; +end; + +procedure TcxGridTableViewExport.CreateFooter(var ATop, ALeft: Integer); +begin + if not OptionsView.Footer then Exit; + AddFooterCells(ATop, ALeft, nil, 0, -1, + DataController.Summary.FooterSummaryItems, nil, True); +end; + +procedure TcxGridTableViewExport.CreateHeader(var ATop, ALeft: Integer); +begin + FRecordWidth := ViewInfo.DataWidth; + ProduceHeadersContainer(ATop, ALeft, ViewInfo.HeaderViewInfo); +end; + +procedure TcxGridTableViewExport.CreateExportCells; +var + ATop, ALeft: Integer; +begin + ATop := 0; + ALeft := 0; + CreateHeader(ATop, ALeft); + CreateContent(ATop, ALeft); + ALeft := 0; + CreateFooter(ATop, ALeft); + MergeCells; +end; + +procedure TcxGridTableViewExport.CreateRecordFromPattern( + var ATop, ALeft: Integer; ARecord: TcxCustomGridRecord); +var + R: TRect; + I: Integer; + APattern: TcxExportVisualItem; + AViewParams: TcxViewParams; + AStyle: TcxCacheCellStyle; +begin + for I := 0 to PatternCount - 1 do + begin + APattern := Patterns[I]; + R := APattern.GetBoundsRelativeTo(ATop, ALeft); + if APattern.IsColumn then + begin + AStyle := GetContentParams(ARecord, TcxGridColumn(APattern.Data), + AViewParams, GridLines, GridLineColor); + AddVisualDataItem(R, Provider.RegisterStyle(AStyle), ARecord, TcxGridColumn(APattern.Data)); + end + else + AddVisualItemEx(R, '', GetPatternParams(ARecord, APattern), taLeftJustify, [], clDefault, True); + end; +end; + +function TcxGridTableViewExport.DoMergeCell( + AMasterItem, ASlaveItem: TcxExportVisualItem): Boolean; +var + AColumn: TcxGridColumn; + AMasterValue, ASlaveValue: Variant; + AMasterProperties, ASlaveProperties: TcxCustomEditProperties; +begin + Result := AMasterItem <> ASlaveItem; + with AMasterItem.Bounds do + begin + Result := Result and not TcxGridDataRow(AMasterItem.Data).Expanded and + (Bottom = ASlaveItem.Bounds.Top) and (Left = ASlaveItem.Bounds.Left) and + (Right = ASlaveItem.Bounds.Right); + end; + if Result then + begin + AColumn := TcxGridColumn(AMasterItem.Data2); + AMasterValue := GetViewItemValueEx( + TcxGridDataRow(AMasterItem.Data), AColumn, AMasterProperties); + ASlaveValue := GetViewItemValueEx( + TcxGridDataRow(ASlaveItem.Data), AColumn, ASlaveProperties); + Result := AColumn.DoCompareValuesForCellMerging(TcxGridDataRow(AMasterItem.Data), AMasterProperties, + AMasterValue, TcxGridDataRow(ASlaveItem.Data), ASlaveProperties, ASlaveValue); + end; + if Result then + begin + AMasterItem.Bounds.Bottom := ASlaveItem.Bounds.Bottom; + ASlaveItem.Hidden := True; + ASlaveItem.Slave := True; + end; +end; + +procedure TcxGridTableViewExport.ExportCells; +var + R: TRect; + I: Integer; + AItem: TcxExportVisualItem; +begin + inherited ExportCells; + R := Rect(0, 0, Columns.Count - 1, Rows.Count - 1); + for I := 0 to VisualItemCount - 1 do + begin + AItem := VisualItems[I]; + if AItem.Slave then Continue; + if AItem.Hidden then + begin + if AItem.Data is TcxGridMasterDataRow and TcxGridMasterDataRow(AItem.Data).Expanded then + ExportDetailCell(AItem); + Continue; + end; + if AItem.IsBackground then + FillRealArea(AItem.Bounds, AItem.Style, clBtnShadow) + else + begin + if AItem.Data2 is TcxGridColumn then + begin + SetRealCellStyleAndValueEx(AItem.Bounds, R, AItem.Style, + TcxCustomGridRecord(AItem.Data), TcxGridColumn(AItem.Data2)); + end + else + if AItem.Data2 is TcxDataSummaryItem then + SetRealCellStyleAndValue(AItem.Bounds, R, AItem.Style, AItem.Value) + else + SetRealCellStyleAndValue(AItem.Bounds, R, AItem.Style, AItem.DisplayText) + end; + end; +end; + +procedure TcxGridTableViewExport.ExportDetailCell(ACell: TcxExportVisualItem); +var + R: TRect; + AViewInfo: TcxCustomGridViewInfo; + AGridRow: TcxGridMasterDataRow; + ADetailExport: TcxGridCustomExport; + AParams: TcxViewParams; + AStyle: TcxCacheCellStyle; + AStyleIndex: Integer; +begin + AGridRow := TcxGridMasterDataRow(ACell.Data); + AViewInfo := CalculateViewViewInfo(AGridRow.ActiveDetailGridView, ViewInfo.Bounds); + try + ADetailExport := GetExportClassByGridView(AGridRow.ActiveDetailGridView).CreateFrom( + Self, AGridRow.ActiveDetailGridView, AViewInfo); + try + ADetailExport.CreateExportCache; + RealBoundsToLogicalBounds(ACell.Bounds, R); + Styles.GetContentParams(AGridRow, nil, AParams); + ViewParamsToExportStyle(AParams, AStyle, taLeftJustify, GridLines, GridLineColor); + AStyleIndex := Provider.RegisterStyle(AStyle); + Provider.SetCellStyleEx(R.Left, R.Top, R.Bottom - R.Top, R.Right - R.Left, AStyleIndex); + if not ADetailExport.IsEmpty then + InternalProvider.SetCacheIntoCell(R.Left, R.Top, ADetailExport.InternalProvider); + finally + ADetailExport.Free; + end; + finally + AViewInfo.Free; + end; +end; + +procedure TcxGridTableViewExport.Finalize; +begin + inherited Finalize; + FreeAndNil(FPatternsList); + FreeAndNil(FVisualItemsList); + FreeAndNil(FGroupSummaryItemsList); +end; + +function TcxGridTableViewExport.GetColumnOffset( + AColumn: TcxGridColumn): Integer; +begin + Result := LeftPos - IndicatorWidth; +end; + +function TcxGridTableViewExport.GetExpandButtonParams( + ABorders: TcxBorders): TcxCacheCellStyle; +var + ABorder: TcxBorder; +begin + Result := DefaultCellStyle; + for ABorder := bLeft to bBottom do + if ABorder in ABorders then + begin + Result.Borders[Integer(ABorder)].IsDefault := False; + Result.Borders[Integer(ABorder)].Width := 1; + Result.Borders[Integer(ABorder)].Color := ColorToRgb(GridLineColor); + end + else + begin + Result.Borders[Integer(ABorder)].IsDefault := True; + Result.Borders[Integer(ABorder)].Width := 0; + end; + Result.BrushBkColor := ColorToRgb(clBtnFace); +end; + +function TcxGridTableViewExport.GetFooterCellCount( + AItems: TcxDataSummaryItems): Integer; +var + I: Integer; +begin + Result := 0; + if AItems = nil then Exit; + for I := 0 to AItems.Count - 1 do + if AItems[I].Position = spFooter then + Inc(Result); +end; + +function TcxGridTableViewExport.GetFooterItemBounds( + AIndex, ALineIndex: Integer; const AOrigin: TRect; AIsFooter: Boolean): TRect; +var + H, LCount: Integer; +begin + with Patterns[AIndex] do + begin + H := DefaultRowHeight + cxGridFooterCellIndent; + Result.Left := Max(Bounds.Left, AOrigin.Left); + Result.Right := Min(Bounds.Right, AOrigin.Right); + Result.Top := AOrigin.Top + (Bounds.Top div DefaultRowHeight + ALineIndex) * H; + LCount := 1; + if not CanShowMultiSummaries(AIsFooter) then + LCount := Max(1, (Bounds.Bottom - Bounds.Top) div DefaultRowHeight); + Result.Bottom := Result.Top + LCount * H; + InflateRect(Result, -cxGridFooterCellIndent, -cxGridFooterCellIndent); + end; +end; + +function TcxGridTableViewExport.GetFooterLineCount( + AItems: TcxDataSummaryItems): Integer; + + function IsSameFooterItems(AItem1, AItem2: TcxDataSummaryItem): Boolean; + begin + Result := (AItem1.ItemLink = AItem2.ItemLink) and + (AItem1.Position = spFooter) and (AItem2.Position = spFooter); + end; + +var + I, J, ACount: Integer; +begin + Result := 1; + if AItems = nil then Exit; + for I := 0 to AItems.Count - 1 do + begin + ACount := 0; + for J := 0 to AItems.Count - 1 do + if IsSameFooterItems(AItems[I], AItems[J]) then + Inc(ACount); + Result := Max(Result, ACount); + end; +end; + +function TcxGridTableViewExport.GetGroupRowColumnIntersection( + const ARowBounds: TRect; AColumn: TcxGridColumn): TRect; +var + I: Integer; +begin + Result := ARowBounds; + if AColumn = nil then Exit; + for I := 0 to PatternCount - 1 do + begin + if Patterns[I].Data = AColumn then + begin + Result.Left := Max(Result.Left, Patterns[I].Bounds.Left); + Result.Right := Min(Result.Right, Patterns[I].Bounds.Right); + Break; + end; + end; +end; + +function TcxGridTableViewExport.GetIsSummaryUnderColumns: Boolean; +begin + Result := OptionsView.GroupSummaryLayout <> gslStandard; +end; + +function TcxGridTableViewExport.GetPatternParams( + ARecord: TcxCustomGridRecord; AItem: TcxExportVisualItem): TcxViewParams; +begin + if AItem.IsColumn then + TcxGridColumn(AItem.Data).Styles.GetContentParams(ARecord, Result) + else + FillChar(Result, SizeOf(Result), 0); +end; + +function TcxGridTableViewExport.GetPreviewHeight(ARow: TcxCustomGridRecord): Integer; +begin + if HasPreview[ARow] then + Result := DefaultRowHeight + else + Result := 0; +end; + +function TcxGridTableViewExport.HasFooter( + ARow: TcxCustomGridRecord; var ALevel: Integer): Boolean; +begin + if OptionsView.GroupFooters = gfInvisible then + Result := False + else + begin + if OptionsView.GroupFooters = gfAlwaysVisible then + Dec(ALevel); + Result := (0 <= ALevel) and (ALevel < ARow.Level) and + TcxCustomGridRecordAccess(ARow).IsParentRecordLast[ALevel] and + TcxGridColumnAccess.CanShowGroupFooters(GridView.GroupedColumns[ARow.Level - 1 - ALevel]); + end; + if ARow is TcxGridGroupRow then + begin + Result := Result or + (OptionsView.GroupFooters = gfAlwaysVisible) and + (ALevel = -1) and not ARow.Expanded and + TcxGridColumnAccess.CanShowGroupFooters(TcxGridGroupRow(ARow).GroupedColumn); + end; + if Result then + ALevel := ARow.Level - ALevel - 1; +end; + +procedure TcxGridTableViewExport.Initialize; +begin + inherited Initialize; + FRecordRowCount := 1; + FPatternsList := TcxObjectList.Create; + FVisualItemsList := TcxObjectList.Create; + FVisualItemsList.Capacity := 1024 * 1024; + FGroupSummaryItemsList := TcxObjectList.Create; + FGroupSummaryItemsList.Capacity := 1024; + +end; + +procedure TcxGridTableViewExport.MergeCells; +var + I, J, AMasterRowIndex, ASlaveRowIndex: Integer; + AColumn: TcxGridColumn; + AMergedRowsList: TList; +begin + AMergedRowsList := TList.Create; + try + for I := 0 to PatternCount - 1 do + begin + if not Patterns[I].IsColumn then Continue; + AColumn := TcxGridColumn(Patterns[I].Data); + if not AColumn.Options.CellMerging then Continue; + AMergedRowsList.Clear; + for J := 0 to VisualItemCount - 1 do + begin + if VisualItems[J].Data2 = AColumn then + AMergedRowsList.Add(VisualItems[J]); + end; + AMasterRowIndex := 0; + while AMasterRowIndex < AMergedRowsList.Count do + begin + ASlaveRowIndex := AMasterRowIndex + 1; + while ASlaveRowIndex < AMergedRowsList.Count do + begin + if DoMergeCell(TcxExportVisualItem(AMergedRowsList[AMasterRowIndex]), + TcxExportVisualItem(AMergedRowsList[ASlaveRowIndex])) then + Inc(ASlaveRowIndex) + else + Break; + end; + AMasterRowIndex := ASlaveRowIndex; + end; + end; + finally + AMergedRowsList.Free; + end; +end; + +procedure TcxGridTableViewExport.ProcessGroupSummaryItem(ARow: TcxGridGroupRow; + AValues: PVariant; AIndex: Integer; const ABounds: TRect; const ARowViewParams: TcxViewParams); +var + ADisplayText: string; + ADisplayValue: Variant; + AItem: TcxExportGroupSummaryItem; + ASummaryItem: TcxGridTableSummaryItem; +begin + ASummaryItem := TcxGridTableSummaryItem(ARow.GroupSummaryItems[AIndex]); + if (ASummaryItem.Column <> nil) and not ASummaryItem.Column.Visible then Exit; + ADisplayText := ASummaryItem.FormatValue(AValues^[AIndex], False); + ADisplayValue := AValues^[AIndex]; + if (ASummaryItem.Position <> spGroup) or (ADisplayText = '') then Exit; + AItem := TcxExportGroupSummaryItem.Create; + AItem.Column := ASummaryItem.Column; + if (AItem.Column <> nil) and (AItem.Column.VisibleIndex < 0) then + AItem.Column := nil; + if AItem.Column <> nil then + begin + Styles.GetGroupSummaryCellContentParams(ARow, ASummaryItem, AItem.ViewParams); + AItem.ViewParams.Color := ARowViewParams.Color; + AItem.ViewParams.Bitmap := ARowViewParams.Bitmap; + end + else + AItem.ViewParams := ARowViewParams; + AItem.Bounds := GetGroupRowColumnIntersection(ABounds, AItem.Column); + AItem.Text := ADisplayText; + AItem.SummaryItem := ASummaryItem; + AItem.Value := ADisplayValue; + AItem.Index := AIndex; + GroupSummaryItemsList.Add(AItem); +end; + +procedure TcxGridTableViewExport.ProcessGroupSummaryItems( + ARow: TcxGridGroupRow; ABounds: TRect); +var + I: Integer; + AItem: TcxExportGroupSummaryItem; + AItems: TcxDataGroupSummaryItems; +begin + I := 0; + AItems := ARow.GroupSummaryItems; + while I < GroupSummaryItemCount do + begin + AItem := GroupSummaryItems[I]; + if (I < (GroupSummaryItemCount - 1)) and + (AItem.Column = GroupSummaryItems[I + 1].Column) then + begin + AItem.Text := AItem.Text + AItems.Separator + ' ' + GroupSummaryItems[I + 1].Text; + AItem.Value := Null; + GroupSummaryItemsList[I + 1].Free; + GroupSummaryItemsList.Delete(I + 1); + Continue; + end + else + Inc(I); + end; + if (GroupSummaryItemCount > 0) and (GroupSummaryItems[0].Column = nil) then + begin + GroupSummaryItems[0].Text := ARow.DisplayCaption + + AItems.BeginText + GroupSummaryItems[0].Text + AItems.EndText; + GroupSummaryItems[0].Value := Null; + end + else + begin + AItem := TcxExportGroupSummaryItem.Create; + AItem.Text := ARow.DisplayCaption; + if GroupSummaryItemCount = 0 then + begin + TcxCustomGridTableItemAccess.DoGetDisplayText(ARow.GroupedColumn, ARow, AItem.Text); + if AItem.Text <> ARow.DisplayCaption then + AItem.Value := Null; + end; + Styles.GetGroupParams(ARow, ARow.Level, AItem.ViewParams); + AItem.Bounds := ABounds; + GroupSummaryItemsList.Insert(0, AItem); + end; + GroupSummaryItemsList.Sort(@cxCompareGroupSummaryItems); + I := 0; + while I <= GroupSummaryItemCount - 2 do + begin + if (I = 0) and (GroupSummaryItems[I].Column = nil) then + GroupSummaryItems[I].InitWidth; + with GroupSummaryItems[I] do + begin + if (I = 0) and (Column = nil) and (Bounds.Left >= GroupSummaryItems[I + 1].Bounds.Left) then + GroupSummaryItems[I + 1].Bounds.Left := Bounds.Right + else + Bounds.Right := Min(Bounds.Right, GroupSummaryItems[I + 1].Bounds.Left); + if Bounds.Left >= Bounds.Right then + GroupSummaryItemsList.Delete(I) + else + Inc(I); + end; + end; +end; + +procedure TcxGridTableViewExport.ProduceHeadersContainer(var ATop, ALeft: Integer; + AViewInfo: TcxGridColumnContainerViewInfo); +var + R, AVisibleRect: TRect; + I, APrevTop, AOffsetY: Integer; + AItem: TcxGridColumnHeaderViewInfo; + AVisualItem: TcxExportVisualItem; +begin + AOffsetY := ATop - AViewInfo.Bounds.Top; + APrevTop := MaxInt; + for I := 0 to AViewInfo.Count - 1 do + begin + AItem := AViewInfo.Items[I]; + AItem.Recalculate; + R := cxRectOffset(AItem.RealBounds, GetColumnOffset(AItem.Column), AOffsetY); + APrevTop := Min(APrevTop, R.Top); + AVisibleRect := R; + if not AViewInfo.Visible or not OptionsView.Header then + AVisibleRect := cxNullRect; + AVisualItem := AddVisualItemEx(AVisibleRect, AItem.Text, + AItem.Params, AItem.AlignmentHorz, cxBordersAll, clBtnShadow); + AVisualItem.Bounds := R; + AVisualItem.Hidden := not OptionsView.Header; + ATop := Max(ATop, R.Bottom); + AVisualItem.Data := AItem.Column; + AddPattern(R, AVisualItem.Data); + end; + SetPatternsBounds(APrevTop, ATop - APrevTop); + if not OptionsView.Header then + ATop := 0; +end; + +procedure TcxGridTableViewExport.SetPatternsBounds(ATop, ABottom: Integer); +var + I: Integer; +begin + for I := 0 to PatternsList.Count - 1 do + with Patterns[I] do + begin + OffsetRect(Bounds, 0, -ATop); + Bounds.Top := Max(0, Bounds.Top); + Bounds.Bottom := Min(ABottom, Bounds.Bottom); + end; + RecordHeight := ABottom; + if RecordHeight = 0 then + RecordHeight := ViewInfo.RecordsViewInfo.RowHeight; + DefaultRowHeight := RecordHeight; +end; + +function TcxGridTableViewExport.GetFooterCellBorderColor: TColor; +begin + Result := Grid.LookAndFeelPainter.FooterSeparatorColor; +end; + +function TcxGridTableViewExport.GetGridLineColor: TColor; +begin + Result := OptionsView.GridLineColor; + if Result = clDefault then + Result := clBtnShadow; +end; + +function TcxGridTableViewExport.GetGridLines: TcxBorders; +begin + Result := GridLines2Borders[OptionsView.GridLines]; +end; + +function TcxGridTableViewExport.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxGridTableViewExport.GetGroupSummaryCount: Integer; +begin + Result := FGroupSummaryItemsList.Count; +end; + +function TcxGridTableViewExport.GetGroupSummaryItem( + AIndex: Integer): TcxExportGroupSummaryItem; +begin + Result := TcxExportGroupSummaryItem(FGroupSummaryItemsList[AIndex]); +end; + +function TcxGridTableViewExport.GetHasPreview( + ARow: TcxCustomGridRecord): Boolean; +begin + with GridView.Preview do + Result := Visible and (Column <> nil); +end; + +function TcxGridTableViewExport.GetIndicatorWidth: Integer; +begin + if ViewInfo.IndicatorViewInfo.Visible then + Result := OptionsView.IndicatorWidth + else + Result := 0; +end; + +function TcxGridTableViewExport.GetLeftPos: Integer; +begin + Result := GridView.Controller.LeftPos; +end; + +function TcxGridTableViewExport.GetOptionsView: TcxGridTableOptionsView; +begin + Result := GridView.OptionsView; +end; + +function TcxGridTableViewExport.GetPattern(AIndex: Integer): TcxExportVisualItem; +begin + Result := PatternsList[AIndex] as TcxExportVisualItem; +end; + +function TcxGridTableViewExport.GetPatternCount: Integer; +begin + Result := PatternsList.Count; +end; + +function TcxGridTableViewExport.GetPreviewPlace: TcxGridPreviewPlace; +begin + Result := GridView.Preview.Place; +end; + +function TcxGridTableViewExport.GetStyles: TcxGridTableViewStyles; +begin + Result := GridView.Styles; +end; + +function TcxGridTableViewExport.GetViewInfo: TcxGridTableViewInfo; +begin + Result := inherited ViewInfo as TcxGridTableViewInfo; +end; + +function TcxGridTableViewExport.GetVisualItem( + AIndex: Integer): TcxExportVisualItem; +begin + Result := VisualItemsList[AIndex] as TcxExportVisualItem; +end; + +function TcxGridTableViewExport.GetVisualItemCount: Integer; +begin + Result := VisualItemsList.Count; +end; + +procedure TcxGridTableViewExport.SetLeftPos(AValue: Integer); +begin + GridView.Controller.LeftPos := AValue; + ViewInfo.Recalculate; +end; + +{ TcxGridBandedTableViewExport } + +procedure TcxGridBandedTableViewExport.CreateBandHeaders( + var ATop: Integer; AForRootBands: Boolean); +var + R: TRect; + ABandViewInfo: TcxGridBandViewInfo; + ABandsViewInfo: TcxGridBandsViewInfo; + ABandHeader: TcxGridBandHeaderViewInfo; + AVisualItem: TcxExportVisualItem; + AHeight, I, AOffsetX, AOffsetY, AColsOffset: Integer; +begin + AHeight := 0; + AOffsetX := 0; + AOffsetY := ATop - ViewInfo.HeaderViewInfo.Bounds.Top; + ABandsViewInfo := ViewInfo.HeaderViewInfo.BandsViewInfo; + for I := 0 to ABandsViewInfo.Count - 1 do + begin + ABandViewInfo := ABandsViewInfo.Items[I]; + if (AForRootBands and (ABandViewInfo.Band.ParentBand <> nil)) or + (not AForRootBands and (ABandViewInfo.Band.ParentBand = nil)) then Continue; + if not AForRootBands then + AOffsetX := ABandViewInfo.Bounds.Left + GetParentBandOffset(ABandViewInfo.Band.ParentBand); + with cxRectSize(ABandViewInfo.Bounds) do + R := cxRectBounds(AOffsetX, ABandViewInfo.Bounds.Top + AOffsetY, cx, cy); + if not cxRectIsEmpty(R) then + begin + AddVisualItemEx(R, ABandViewInfo.Text, ABandViewInfo.Params, + ABandViewInfo.AlignmentHorz, [], clDefault, True); + end; + AColsOffset := AOffsetX - ABandViewInfo.Bounds.Left; + AddPattern(R, ABandViewInfo.Band, AColsOffset); + ABandHeader := ABandViewInfo.HeaderViewInfo; + R := cxRectOffset(cxRectSetLeft(ABandHeader.Bounds, AOffsetX), 0, AOffsetY); + AVisualItem := AddVisualItemEx(R, ABandHeader.Text, ABandHeader.Params, + ABandHeader.AlignmentHorz, cxBordersAll, clBtnShadow); + AVisualItem.Data := ABandHeader.Band; + AVisualItem.Hidden := not OptionsView.BandHeaders; + if OptionsView.BandHeaders then + AHeight := Max(AHeight, R.Bottom); + if AForRootBands then + Inc(AOffsetX, cxRectWidth(ABandViewInfo.Bounds)); + end; + ATop := AHeight; +end; + +procedure TcxGridBandedTableViewExport.CreateHeader(var ATop, ALeft: Integer); +var + ABandsViewInfo: TcxGridBandsViewInfo; + AHeight: Integer; +begin + AHeight := 0; + ABandsViewInfo := ViewInfo.HeaderViewInfo.BandsViewInfo; + CreateBandHeaders(AHeight, True); + AHeight := ATop; + CreateBandHeaders(AHeight, False); + inherited CreateHeader(ATop, ALeft); + if not OptionsView.Header and (ABandsViewInfo.Count > 0) then + ATop := AHeight; + FRecordRowCount := ABandsViewInfo.LineCount; + if RecordRowCount = 0 then + DefaultRowHeight := RecordHeight + else + DefaultRowHeight := RecordHeight div RecordRowCount; +end; + +function TcxGridBandedTableViewExport.GetColumnOffset( + AColumn: TcxGridColumn): Integer; +begin + Result := Integer(GetPatternByBand( + TcxGridBandedColumn(AColumn).Position.Band).Data2); +end; + +function TcxGridBandedTableViewExport.GetContentOffset: TPoint; +begin + Result := Point(0, 0); + if ViewInfo.GroupByBoxViewInfo.Visible then + Result.Y := -ViewInfo.GroupByBoxViewInfo.Bounds.Bottom; +end; + +function TcxGridBandedTableViewExport.GetIsSummaryUnderColumns: Boolean; +var + I: Integer; + ARowIndex: Integer; +begin + Result := inherited GetIsSummaryUnderColumns; + ARowIndex := -1; + for I := 0 to GridView.VisibleColumnCount - 1 do + with GridView.VisibleColumns[I] do + begin + if ARowIndex = -1 then + ARowIndex := Position.RowIndex + else + Result := Result and (ARowIndex = Position.RowIndex); + end; +end; + +function TcxGridBandedTableViewExport.GetParentBandOffset(ABand: TcxGridBand): Integer; +begin + while ABand.ParentBand <> nil do + ABand := ABand.ParentBand; + Result := Integer(GetPatternByBand(ABand).Data2); +end; + +function TcxGridBandedTableViewExport.GetPatternByBand( + ABand: TcxGridBand): TcxExportVisualItem; +var + I: Integer; +begin + Result := nil; + for I := 0 to PatternCount - 1 do + with Patterns[I] do + if not IsColumn and (Data = ABand) then + begin + Result := Patterns[I]; + Break; + end; +end; + +function TcxGridBandedTableViewExport.GetPatternParams( + ARecord: TcxCustomGridRecord; AItem: TcxExportVisualItem): TcxViewParams; +var + ACellPos: TcxGridDataCellPos; +begin + if AItem.IsColumn then + Result := inherited GetPatternParams(ARecord, AItem) + else + begin + ACellPos := TcxGridDataCellPos.Create(ARecord, nil); + try + TcxGridBand(AItem.Data).Styles.GetViewParams(bsContent, ACellPos, nil, Result); + finally + ACellPos.Free; + end; + end; +end; + +function TcxGridBandedTableViewExport.ProduceColumnsContainer( + AContainer: TcxGridColumnContainerViewInfo; ATop, ALeft: Integer): Integer; +var + R: TRect; + I: Integer; + AItem: TcxGridColumnHeaderViewInfo; + AVisualItem: TcxExportVisualItem; +begin + Result := 0; + if not AContainer.Visible then Exit; + Dec(ATop, AContainer.Bounds.Top); + Dec(ALeft, AContainer.Bounds.Left); + R := AContainer.Bounds; + AddVisualItemEx(cxRectOffset(AContainer.Bounds, ALeft, ATop), + AContainer.Text, AContainer.Params, AContainer.AlignmentHorz, [], clDefault, True); + Result := 0; + for I := 0 to AContainer.Count - 1 do + begin + AItem := AContainer.Items[I]; + if not AItem.Visible then + R := cxRectOffset(AItem.RealBounds, ALeft, ATop); + AVisualItem := AddVisualItemEx(R, AItem.Text, + AItem.Params, AItem.AlignmentHorz, cxBordersAll, clBtnShadow); + Result := Max(Result, R.Bottom); + AVisualItem.Data := AItem.Column; + end; +end; + +function TcxGridBandedTableViewExport.GetGridView: TcxGridBandedTableView; +begin + Result := TcxGridBandedTableView(inherited GridView); +end; + +function TcxGridBandedTableViewExport.GetViewInfo: TcxGridBandedTableViewInfo; +begin + Result := TcxGridBandedTableViewInfo(inherited ViewInfo); +end; + +function TcxGridBandedTableViewExport.GetOptionsView: TcxGridBandedTableOptionsView; +begin + Result := TcxGridBandedTableOptionsView(inherited OptionsView); +end; + +{ TcxExportCardRow } + +constructor TcxExportCardRow.Create(AOwner: TcxExportCard); +begin + FOwner := AOwner; +end; + +procedure TcxExportCardRow.AddToScales( + AColumnScale, ARowScale: TcxExportScale); +begin + AColumnScale.AddPairs(Bounds.Left, Bounds.Right); + if HasIndent then + AColumnScale.Add(Bounds.Left + CategoryIndent); + if HasSeparator then + ARowScale.Add(Bounds.Top + SeparatorWidth); + if ShowCaption then + AColumnScale.Add(Bounds.Left + CaptionWidth); + ARowScale.AddPairs(Bounds.Top, Bounds.Bottom); +end; + +function TcxExportCardRow.GetCaptionBounds: TRect; +begin + Result := Bounds; + if ShowData then + Result.Right := Result.Left + CaptionWidth; + if HasIndent then + Inc(Result.Left, CategoryIndent); + if HasSeparator then + Inc(Result.Top, SeparatorWidth); +end; + +function TcxExportCardRow.GetCaptionStyle: TcxViewParams; +begin + case Row.Kind of + rkCaption: + Row.Styles.GetCaptionRowParams(Card, Result); + rkCategory: + Row.Styles.GetCategoryRowParams(Card,Result); + else + Row.Styles.GetCaptionParams(Card, Result); + end; +end; + +function TcxExportCardRow.GetCard: TcxGridCard; +begin + Result := Owner.Card; +end; + +function TcxExportCardRow.GetCategoryIndent: Integer; +begin + if Row.HasExpandButton then + Result := Owner.Owner.ExpandButtonSize + cxTextOffset * 2 + else + Result := Owner.Owner.CategoryIndent; +end; + +function TcxExportCardRow.GetDataAlignment: TAlignment; +begin + Result := Row.GetProperties.Alignment.Horz; +end; + +function TcxExportCardRow.GetDataBounds: TRect; +begin + Result := Bounds; + if ShowCaption then + Inc(Result.Left, CaptionWidth) + else + if HasIndent then + Inc(Result.Left, CategoryIndent); + if HasSeparator then + Inc(Result.Top, SeparatorWidth); +end; + +function TcxExportCardRow.GetDataStyle: TcxViewParams; +begin + case Row.Kind of + rkCaption: + Row.Styles.GetCaptionRowParams(Card, Result); + rkCategory: + Row.Styles.GetCategoryRowParams(Card, Result); + else + Row.Styles.GetContentParams(Card, Result); + end; +end; + +function TcxExportCardRow.GetDataValue: Variant; +begin + Result := Owner.Owner.GetViewItemValue(Card, Row); +end; + +function TcxExportCardRow.GetHasIndent: Boolean; +begin + Result := Row.HasExpandButton or (Row.CategoryRow <> nil); + if Result and Owner.Owner.IsHorizontalRows then + Result := Row.Position.VisibleIndexInLayer = 0; +end; + +function TcxExportCardRow.GetHasSeparator: Boolean; +begin + Result := FHasSeparator; +end; + +function TcxExportCardRow.GetHeight: Integer; +begin + Result := Bounds.Bottom - Bounds.Top; +end; + +function TcxExportCardRow.GetIndentBounds: TRect; +begin + Result := Bounds; + Result.Right := Result.Left + CategoryIndent; + if HasSeparator then + Inc(Result.Top, SeparatorWidth); +end; + +function TcxExportCardRow.GetIndentStyle: TcxViewParams; +begin + if HasIndent then + begin + if Row.HasExpandButton or (Row.CategoryRow = nil) then + Result := CaptionStyle + else + Row.CategoryRow.Styles.GetCategoryRowParams(Card, Result); + end; +end; + +function TcxExportCardRow.GetSeparatorBounds: TRect; +begin + if Owner.Owner.IsHorizontalRows then + begin + Result := cxRectSetTop(Owner.Bounds, Bounds.Top, SeparatorWidth); + InflateRect(Result, -Owner.BorderWidth, 0); + end + else + Result := cxRectSetTop(Bounds, Bounds.Top, SeparatorWidth); +end; + +function TcxExportCardRow.GetSeparatorWidth: Integer; +begin + Result := Owner.Owner.OptionsView.CategorySeparatorWidth; +end; + +function TcxExportCardRow.GetShowCaption: Boolean; +begin + Result := Row.Options.ShowCaption; +end; + +function TcxExportCardRow.GetShowData: Boolean; +begin + Result := Row.Options.ShowData; +end; + +function TcxExportCardRow.GetVisibleCaption: string; +begin + Result := Row.VisibleCaption; +end; + +function TcxExportCardRow.GetWidth: Integer; +begin + Result := Bounds.Right - Bounds.Left; +end; + +procedure TcxExportCardRow.SetHeight(AValue: Integer); +begin + Bounds.Bottom := Bounds.Top + AValue; +end; + +procedure TcxExportCardRow.SetWidth(AValue: Integer); +begin + Bounds.Right := Bounds.Left + AValue; +end; + +{ TcxExportCard } + +constructor TcxExportCard.Create( + AOwner: TcxGridCardViewExport; ACard: TcxGridCard); +begin + FCard := ACard; + FLayersList := TcxObjectList.Create(); + FOwner := AOwner; +end; + +destructor TcxExportCard.Destroy; +begin + FreeAndNil(FLayersList); + inherited Destroy; +end; + +procedure TcxExportCard.AddToScales( + AColumnScale, ARowScale: TcxExportScale); +var + ALayerIndex, ARowIndex: Integer; +begin + for ALayerIndex := 0 to LayerCount - 1 do + for ARowIndex := 0 to RowCount[ALayerIndex] - 1 do + Rows[ALayerIndex, ARowIndex].AddToScales(AColumnScale, ARowScale); + if BorderWidth > 0 then + begin + AColumnScale.AddPairs(Bounds.Left, Bounds.Right); + ARowScale.AddPairs(Bounds.Top, Bounds.Bottom); + end; + if HasSeparators then + begin + for ALayerIndex := 0 to LayerCount - 2 do + with LayerSeparators[ALayerIndex] do + begin + AColumnScale.AddPairs(Left, Right); + ARowScale.AddPairs(Top, Bottom); + end; + end; +end; + +procedure TcxExportCard.CalculateLayersCaptionWidth( + AWidths: TcxExportIntList; AFistRowInLayerOnly: Boolean); +var + I, J: Integer; +begin + I := LayerCount; + if AFistRowInLayerOnly then + I := 1; + if AWidths.Count < I then + AWidths.Count := I; + for I := 0 to LayerCount - 1 do + begin + if AFistRowInLayerOnly then + AWidths[0] := GetRowCaptionWidth(I, 0, AWidths[0]) + else + for J := 0 to RowCount[I] - 1 do + AWidths[I] := GetRowCaptionWidth(I, J, AWidths[I]); + end; +end; + +function TcxExportCard.GetRowCaptionWidth( + ALayerIndex, ARowIndex: Integer; AMaxWidth: Integer = 0): Integer; +var + ARow: TcxExportCardRow; +begin + ARow := Rows[ALayerIndex, ARowIndex]; + if ARow.HasIndent then + Result := Owner.OptionsView.CategoryIndent + else + Result := 0; + if ARow.ShowCaption and ARow.ShowData then + Inc(Result, Owner.TextWidthEx(ARow.CaptionStyle, ARow.VisibleCaption) + cxTextOffset * 2); + Result := Max(Result, AMaxWidth); +end; + +procedure TcxExportCard.SetLayersCaptionWidth( + AWidths: TcxExportIntList; AFistRowInLayerOnly: Boolean); +var + ALayerIndex, ARowIndex, AWidth: Integer; +begin + for ALayerIndex := 0 to LayerCount - 1 do + for ARowIndex := 0 to RowCount[ALayerIndex] - 1 do + begin + if Owner.IsHorizontalRows then + begin + if (ARowIndex = 0) or not AFistRowInLayerOnly then + AWidth := AWidths[ARowIndex] + else + AWidth := GetRowCaptionWidth(ALayerIndex, ARowIndex); + SetRowCaptionWidth(ALayerIndex, ARowIndex, AWidth); + end + else + SetRowCaptionWidth(ALayerIndex, ARowIndex, AWidths[ALayerIndex]); + end; +end; + +procedure TcxExportCard.SetRowCaptionWidth( + ALayerIndex, ARowIndex, AWidth: Integer); +begin + Rows[ALayerIndex, ARowIndex].CaptionWidth := AWidth; +end; + +function TcxExportCard.AddLayer: TList; +begin + Result := TList.Create; + LayersList.Add(Result); +end; + +function TcxExportCard.AddRow( + ALayerIndex: Integer; ARow: TcxGridCardViewRow): TcxExportCardRow; +begin + Result := TcxExportCardRow.Create(Self); + Result.Row := ARow; + if ARow.Options.ShowCaption then + begin + Result.CaptionStyleIndex := + Owner.RegisterViewParams(Result.CaptionStyle, ARow.CaptionAlignmentHorz); + end; + Result.DataStyleIndex := Owner.RegisterViewParams(Result.DataStyle, Result.DataAlignment); + if Result.HasIndent then + Result.IndentStyleIndex := Owner.RegisterViewParams(Result.IndentStyle); + Result.Bounds := Rect(Bounds.Left, 0, Bounds.Left + ARow.Position.Width, + ARow.Position.LineCount * Owner.TextHeightEx(Result.DataStyle)); + Layers[ALayerIndex].Add(Result); +end; + +procedure TcxExportCard.AddLayerSeparators; +var + ALayerIndex, ARowIndex, AOffset: Integer; +begin + if not HasSeparators then Exit; + if Owner.IsHorizontalRows then + begin + AOffset := 0; + for ALayerIndex := 1 to LayerCount - 1 do + begin + Inc(AOffset, SeparatorWidth); + for ARowIndex := 0 to RowCount[ALayerIndex] - 1 do + OffsetRect(Rows[ALayerIndex, ARowIndex].Bounds, 0, AOffset); + end; + Inc(FBounds.Bottom, AOffset); + end; +end; + +procedure TcxExportCard.AdjustLayersWidthToWidth; +var + ALayer, ARowIndex, ALeft: Integer; + AWidths: array of Integer; +begin + SetLength(AWidths, LayerCount); + for ALayer := 0 to LayerCount - 1 do + for ARowIndex := 0 to RowCount[ALayer] - 1 do + AWidths[ALayer] := Max(AWidths[ALayer], Rows[ALayer, ARowIndex].Width); + CalculateCardRowWidths(AWidths, (Bounds.Right - Bounds.Left) - BorderWidth * 2); + ALeft := Bounds.Left + BorderWidth; + for ALayer := 0 to LayerCount - 1 do + begin + if HasSeparators and (ALayer > 0) then + begin + Inc(ALeft, SeparatorWidth); + Dec(AWidths[ALayer], SeparatorWidth); + end; + for ARowIndex := 0 to RowCount[ALayer] - 1 do + with Rows[ALayer, ARowIndex] do + Bounds := cxRectSetLeft(Bounds, ALeft, AWidths[ALayer]); + Inc(ALeft, AWidths[ALayer]); + end; +end; + +function TcxExportCard.AdjustRowsHeightInLayer( + ALayer, ATop: Integer): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to RowCount[ALayer] - 1 do + Result := Max(Rows[ALayer, I].Height, Result); + for I := 0 to RowCount[ALayer] - 1 do + with Rows[ALayer, I].Bounds do + begin + Top := ATop; + Bottom := Top + Result; + end; +end; + +procedure TcxExportCard.AdjustRowsWidthToWidth(ALayer: Integer); +var + I, ALeft, AWidth: Integer; + AWidths: array of Integer; +begin + AWidth := Bounds.Right - Bounds.Left - BorderWidth * 2; + if RowCount[ALayer] = 1 then + begin + Rows[ALayer, 0].Bounds.Left := Bounds.Left + BorderWidth; + Rows[ALayer, 0].Width := AWidth + end + else + begin + SetLength(AWidths, RowCount[ALayer]); + for I := 0 to RowCount[ALayer] - 1 do + AWidths[I] := Rows[ALayer, I].Width; + CalculateCardRowWidths(AWidths, AWidth); + ALeft := Bounds.Left + BorderWidth; + for I := 0 to RowCount[ALayer] - 1 do + with Rows[ALayer, I] do + begin + Bounds.Left := ALeft; + Inc(ALeft, AWidths[I]); + Bounds.Right := ALeft; + end; + end; +end; + +procedure TcxExportCard.CheckCategorySeparators(AHorizontalLayout: Boolean); +var + ARow: TcxExportCardRow; + ALayerIndex, ARowIndex, ACountRowsInLayer: Integer; +begin + if Owner.OptionsView.CategorySeparatorWidth = 0 then Exit; + for ALayerIndex := 1 to LayerCount - 1 do + begin + ACountRowsInLayer := RowCount[ALayerIndex]; + for ARowIndex := 0 to ACountRowsInLayer - 1 do + begin + ARow := Rows[ALayerIndex, ARowIndex]; + ARow.FHasSeparator := ARow.Row.Kind = rkCategory; + if ARow.FHasSeparator then + begin + if Owner.IsHorizontalRows then + ARow.FHasSeparator := ACountRowsInLayer = 1 + else + ARow.FHasSeparator := ARowIndex > 0 + end; + if ARow.HasSeparator then + Inc(ARow.Bounds.Bottom, SeparatorWidth); + end; + end; +end; + +function TcxExportCard.GetBorderWidth: Integer; +begin + Result := Owner.OptionsView.CardBorderWidth; +end; + +function TcxExportCard.GetHasSeparators: Boolean; +begin + Result := not Owner.IsSimpleLayout and (LayerCount > 1) and (SeparatorWidth > 0); +end; + +function TcxExportCard.GetLayer(AIndex: Integer): TList; +begin + Result := TList(LayersList[AIndex]) +end; + +function TcxExportCard.GetLayerCount: Integer; +begin + Result := LayersList.Count; +end; + +function TcxExportCard.GetLayerSeparator(AIndex: Integer): TRect; +begin + if Owner.IsHorizontalRows then + begin + Result := cxRectSetTop(Bounds, Rows[AIndex, 0].Bounds.Bottom, SeparatorWidth); + InflateRect(Result, -BorderWidth, 0); + end + else + begin + Result := cxRectSetLeft(Bounds, Rows[AIndex, 0].Bounds.Right, SeparatorWidth); + InflateRect(Result, 0, -BorderWidth); + end; +end; + +function TcxExportCard.GetRow(ALayerIndex, ARowIndex: Integer): TcxExportCardRow; +begin + Result := TcxExportCardRow(Layers[ALayerIndex][ARowIndex]); +end; + +function TcxExportCard.GetRowCount(ALayerIndex: Integer): Integer; +begin + Result := Layers[ALayerIndex].Count; +end; + +function TcxExportCard.GetSeparatorWidth: Integer; +begin + Result := Owner.OptionsView.LayerSeparatorWidth; +end; + +procedure TcxExportCard.SetBounds(const ABounds: TRect); +var + AOffset: TPoint; + ALayerIndex, ARowIndex: Integer; +begin + FBounds := ABounds; + AOffset := Point(ABounds.Left - FBounds.Left, ABounds.Top - FBounds.Top); + for ALayerIndex := 0 to LayerCount - 1 do + for ARowIndex := 0 to RowCount[ALayerIndex] - 1 do + OffsetRect(Rows[ALayerIndex, ARowIndex].Bounds, AOffset.X, AOffset.Y); +end; + +{ TcxExportCardLayoutBuilder } + +constructor TcxExportCardLayoutBuilder.Create(AOwner: TcxGridCardViewExport); +begin + FRowsList := TList.Create; + FOwner := AOwner; +end; + +destructor TcxExportCardLayoutBuilder.Destroy; +begin + FreeAndNil(FRowsList); + inherited Destroy; +end; + +procedure TcxExportCardLayoutBuilder.BuildLayout( + ACard: TcxGridCard; AExportCard: TcxExportCard); +var + ALayerIndex, ARowIndex, ATop: Integer; +begin + FExportCard := AExportCard; + ACard.GetVisibleRows(RowsList); + ATop := AExportCard.Bounds.Top + AExportCard.BorderWidth; + SplitRowsToLayers; + if Owner.IsHorizontalRows then + begin + for ALayerIndex := 0 to ExportCard.LayerCount - 1 do + begin + ExportCard.AdjustRowsWidthToWidth(ALayerIndex); + Inc(ATop, ExportCard.AdjustRowsHeightInLayer(ALayerIndex, ATop)); + AExportCard.FBounds.Bottom := ATop + AExportCard.BorderWidth; + end; + ExportCard.AddLayerSeparators; + end + else + begin + ExportCard.AdjustLayersWidthToWidth(); + for ALayerIndex := 0 to ExportCard.LayerCount - 1 do + begin + ATop := ExportCard.Bounds.Top + ExportCard.BorderWidth; + for ARowIndex := 0 to ExportCard.RowCount[ALayerIndex] - 1 do + with ExportCard.Rows[ALayerIndex, ARowIndex] do + begin + Bounds := cxRectSetTop(Bounds, ATop); + ATop := Bounds.Bottom; + end; + ExportCard.FBounds.Bottom := Max(ExportCard.FBounds.Bottom, ATop + ExportCard.BorderWidth); + end; + end; +end; + +function TcxExportCardLayoutBuilder.GetLayerIndex(ARow: TcxGridCardViewRow): Integer; +begin + if Owner.IsHorizontalRows then + Result := ARow.Position.RowIndex + else + Result := ARow.Position.ColIndex; +end; + +procedure TcxExportCardLayoutBuilder.SplitRowsToLayers; +var + ARow: TcxGridCardViewRow; + I, ACurrentLayerIndex: Integer; +begin + ACurrentLayerIndex := -1; + for I := 0 to RowsList.Count - 1 do + begin + ARow := TcxGridCardViewRow(RowsList[I]); + if GetLayerIndex(ARow) <> ACurrentLayerIndex then + begin + ACurrentLayerIndex := GetLayerIndex(ARow); + ExportCard.AddLayer(); + end; + ExportCard.AddRow(ExportCard.LayerCount - 1, ARow); + end; + ExportCard.CheckCategorySeparators(Owner.IsHorizontalRows); +end; + +{ TcxGridCardViewExport } + +procedure TcxGridCardViewExport.AddCardSeparator(APosition: Integer); +begin + if LayoutDirection = ldHorizontal then + Columns.AddPairs(APosition, APosition + OptionsView.SeparatorWidth) + else + Rows.AddPairs(APosition, APosition + OptionsView.SeparatorWidth); + FCardSeparators.AddPairs(APosition, APosition + OptionsView.SeparatorWidth); +end; + +function TcxGridCardViewExport.AddExportCard( + AColumnPosition, ARowPosition: Integer; ACard: TcxGridCard): TcxExportCard; +begin + Result := TcxExportCard.Create(Self, ACard); + Result.Bounds := cxRectBounds(AColumnPosition, ARowPosition, CardWidth, 0); + LayoutBuilder.BuildLayout(ACard, Result); + FExportCardsList.Add(Result); +end; + +procedure TcxGridCardViewExport.AdjustRowCaptionWidth; +var + I: Integer; + AWidths: TcxExportIntList; + AAutoWidth: Boolean; +begin + AWidths := TcxExportIntList.Create; + try + AAutoWidth := (GridView.OptionsView.CaptionWidth = 0); + if AAutoWidth then + begin + for I := 0 to CardCount - 1 do + ExportCards[I].CalculateLayersCaptionWidth(AWidths, IsHorizontalRows); + end + else + begin + for I := 0 to CardCount - 1 do + AWidths.Count := Max(AWidths.Count, ExportCards[I].LayerCount); + for I := 0 to AWidths.Count - 1 do + AWidths[I] := GridView.OptionsView.CaptionWidth; + end; + for I := 0 to CardCount - 1 do + ExportCards[I].SetLayersCaptionWidth(AWidths, AAutoWidth); + finally + AWidths.Free; + end; +end; + +procedure TcxGridCardViewExport.CalculateVisibleInfo; +begin + FCardSeparators := TcxExportScale.Create; + FExportCardsList := TcxObjectList.Create; + FLayoutBuilder := CreateCardLayoutBuilder; + RowCardCount := 1; + ColumnCardCount := 1; + with GridView.ViewInfo do + try + if LayoutDirection = ldVertical then + ColumnCardCount := Min(CardCount, Max(1, (Bounds.Right - Bounds.Left) div CardWidth)) + else + RowCardCount := Min(CardCount, Max(1, (Bounds.Bottom - Bounds.Top) div CardHeight)); + + except + on EDivByZero do; + end; + if LayoutDirection = ldHorizontal then + ColumnCardCount := Ceil(CardCount / RowCardCount) + else + RowCardCount := Ceil(CardCount / ColumnCardCount) +end; + +function TcxGridCardViewExport.CreateCardLayoutBuilder: TcxExportCardLayoutBuilder; +begin + Result := TcxExportCardLayoutBuilder.Create(Self); +end; + +procedure TcxGridCardViewExport.CreateExportCells; +var + AIndex, AColumnPosition, ARowPosition, ARowHeight, ACount: Integer; +begin + CalculateVisibleInfo; + ACount := CardCount; + AColumnPosition := CardIndent; + ARowPosition := CardIndent; + ARowHeight := 0; + for AIndex := 0 to ACount - 1 do + begin + ARowHeight := Max(ARowHeight, + cxRectHeight(AddExportCard(AColumnPosition, ARowPosition, Cards[AIndex]).Bounds)); + if LayoutDirection = ldHorizontal then + begin + Inc(ARowPosition, ARowHeight + InterCardVertSpace); + if (AIndex + 1) mod RowCardCount = 0 then + begin + AddCardSeparator(AColumnPosition + CardWidth + CardIndent); + Inc(AColumnPosition, CardWidth + InterCardHorzSpace); + ARowPosition := CardIndent; + end; + end + else + begin + Inc(AColumnPosition, CardWidth + InterCardHorzSpace); + if (AIndex + 1) mod ColumnCardCount = 0 then + begin + AddCardSeparator(AColumnPosition + ARowHeight + CardIndent); + Inc(ARowPosition, ARowHeight + InterCardVertSpace); + AColumnPosition := CardIndent; + end; + end; + end; + AdjustRowCaptionWidth; + if KeepRowsSameHeight then + SetRowSameHeight; + for AIndex := 0 to ACount - 1 do + ExportCards[AIndex].AddToScales(Columns, Rows); + Columns.Arrange; + Columns.Add(Columns.Last + CardIndent); + Rows.Arrange; + Rows.Add(Rows.Last + CardIndent); +end; + +procedure TcxGridCardViewExport.ExportCardRow(ACard: TcxExportCard; + ARow: TcxExportCardRow; const ACardLogicalBounds: TRect); +var + ARowLogicalBounds: TRect; +begin + RealBoundsToLogicalBoundsEx(ARow.Bounds, ACardLogicalBounds, ARowLogicalBounds); + if ARow.HasIndent then + SetRealCellStyle(ARow.IndentBounds, ARowLogicalBounds, ARow.IndentStyleIndex); + if ARow.HasSeparator then + SetRealCellStyle(ARow.SeparatorBounds, ARowLogicalBounds, CategorySeparatorStyleIndex); + if ARow.ShowCaption then + SetRealCellStyleAndValue(ARow.CaptionBounds, ARowLogicalBounds, ARow.CaptionStyleIndex, ARow.VisibleCaption); + if ARow.Row.Options.ShowData then + SetRealCellStyleAndValueEx(ARow.DataBounds, ARowLogicalBounds, ARow.DataStyleIndex, ACard.Card, ARow.Row); +end; + +procedure TcxGridCardViewExport.ExportCells; +var + ACard: TcxExportCard; + ALogicalBounds: TRect; + AParams: TcxViewParams; + I, ALayerIndex, ARowIndex: Integer; +begin + inherited ExportCells; + for I := 0 to CardCount - 1 do + begin + ACard := ExportCards[I]; + RealBoundsToLogicalBounds(ACard.Bounds, ALogicalBounds); + FillArea(ALogicalBounds, CardBorderStyle); + RealBoundsToLogicalBounds(cxRectInflate(ACard.Bounds, + -CardBorderWidth, -CardBorderWidth), ALogicalBounds); + GridView.Styles.GetContentParams(ACard.Card, nil, AParams); + FillArea(ALogicalBounds, RegisterViewParams(AParams)); + for ALayerIndex := 0 to ACard.LayerCount - 1 do + begin + for ARowIndex := 0 to ACard.RowCount[ALayerIndex] - 1 do + ExportCardRow(ACard, ACard.Rows[ALayerIndex, ARowIndex], ALogicalBounds); + if ACard.HasSeparators and (ALayerIndex < (ACard.LayerCount - 1)) then + SetRealCellStyle(ACard.LayerSeparators[ALayerIndex], + ALogicalBounds, LayerSeparatorStyleIndex); + end; + end; + for I := 0 to CardSeparatorCount - 1 do + FillArea(CardSeparators[I], CardSeparatorStyleIndex); +end; + +procedure TcxGridCardViewExport.Finalize; +begin + FreeAndNil(FCardSeparators); + FreeAndNil(FLayoutBuilder); + FreeAndNil(FExportCardsList); + inherited Finalize; +end; + +procedure TcxGridCardViewExport.RegisterStyles; +begin + inherited RegisterStyles; + FCardSeparatorStyleIndex := RegisterSolidStyleEx(OptionsView.SeparatorColor); + FCategorySeparatorStyleIndex := RegisterSolidStyle(vsCategorySeparator); + FLayerSeparatorStyleIndex := RegisterSolidStyle(vsLayerSeparator); + FCardBorderStyle := RegisterSolidStyle(vsCardBorder); +end; + +procedure TcxGridCardViewExport.SetRowSameHeight; +begin +end; + +function TcxGridCardViewExport.GetCard(AIndex: Integer): TcxGridCard; +begin + Result := Records[AIndex] as TcxGridCard; +end; + +function TcxGridCardViewExport.GetCardBorderWidth: Integer; +begin + Result := OptionsView.CardBorderWidth; +end; + +function TcxGridCardViewExport.GetCardCount: Integer; +begin + Result := RecordCount; +end; + +function TcxGridCardViewExport.GetCardHeight: Integer; +begin + Result := GridView.ViewInfo.RecordsViewInfo.RowHeight; +end; + +function TcxGridCardViewExport.GetCardIndent: Integer; +begin + Result := OptionsView.CardIndent; +end; + +function TcxGridCardViewExport.GetCardSeparatorCount: Integer; +begin + Result := FCardSeparators.Count div 2; +end; + +function TcxGridCardViewExport.GetCardSeparator(AIndex: Integer): TRect; +var + AIndex1, AIndex2: Integer; +begin + if LayoutDirection = ldHorizontal then + begin + Columns.GetPosition(FCardSeparators[AIndex * 2], + FCardSeparators[AIndex * 2 + 1], AIndex1, AIndex2); + Result := Rect(AIndex1, 1, AIndex2, Rows.Count - 1); + end + else + begin + Rows.GetPosition(FCardSeparators[AIndex * 2], + FCardSeparators[AIndex * 2 + 1], AIndex1, AIndex2); + Result := Rect(1, AIndex1, Columns.Count - 1, AIndex2); + end; +end; + +function TcxGridCardViewExport.GetCardWidth: Integer; +var + R: TRect; +begin + Result := OptionsView.CardWidth; + if OptionsView.CardAutoWidth then + begin + R := GridView.ViewInfo.Bounds; + Result := Max(1, (R.Right - R.Left) div (Result + InterCardHorzSpace)); + Result := (R.Right - R.Left) div Result; + end; +end; + +function TcxGridCardViewExport.GetCategoryIndent: Integer; +begin + Result := OptionsView.CategoryIndent; +end; + +function TcxGridCardViewExport.GetCategorySeparatorWidth: Integer; +begin + Result := GridView.OptionsView.CategorySeparatorWidth; +end; + +function TcxGridCardViewExport.GetExportCard(AIndex: Integer): TcxExportCard; +begin + Result := ExportCardsList[AIndex] as TcxExportCard; +end; + +function TcxGridCardViewExport.GetGridView: TcxGridCardView; +begin + Result := TcxGridCardView(inherited GridView); +end; + +function TcxGridCardViewExport.GetInterCardHorzSpace: Integer; +begin + Result := CardIndent * 2; + if LayoutDirection = ldHorizontal then + Inc(Result, OptionsView.SeparatorWidth); +end; + +function TcxGridCardViewExport.GetInterCardVertSpace: Integer; +begin + Result := CardIndent * 2; + if LayoutDirection = ldVertical then + Inc(Result, OptionsView.SeparatorWidth); +end; + +function TcxGridCardViewExport.GetIsHorizontalRows: Boolean; +begin + Result := GridView.RowLayout = rlHorizontal; +end; + +function TcxGridCardViewExport.GetIsSimpleLayout: Boolean; +begin + Result := GridView.RowLayoutController.IsSimpleLayout or + (LayerSeparatorWidth = 0); +end; + +function TcxGridCardViewExport.GetLayerSeparatorWidth: Integer; +begin + Result := GridView.OptionsView.LayerSeparatorWidth; +end; + +function TcxGridCardViewExport.GetLayoutDirection: TcxGridCardViewLayoutDirection; +begin + Result := GridView.LayoutDirection; +end; + +function TcxGridCardViewExport.GetOptionsView: TcxGridCardViewOptionsView; +begin + Result := GridView.OptionsView; +end; + +{ TcxGridChartViewExport } + +procedure TcxGridChartViewExport.CreateExportCache; +begin + if Provider.SupportGraphic then + ExportAsGraphic + else + ExportAsData; +end; + +procedure TcxGridChartViewExport.ExportAsGraphic; +var + AGraphic: TGraphic; +begin + Provider.SetRange(1, 1, False); + if SupportGraphic(cxExportGraphicClass) then + AGraphic := GridView.CreateImage(cxExportGraphicClass) + else + AGraphic := GridView.CreateImage(TBitmap); + try + Provider.SetCellDataGraphic(0, 0, AGraphic); + finally + AGraphic.Free; + end; +end; + +procedure TcxGridChartViewExport.ExportAsData; +var + AColCount, ARowCount, C, R: Integer; + ASeries: TcxGridChartSeries; + AHeaderStyle, AStyle: TcxCacheCellStyle; +begin + AStyle := DefaultCellStyle; + for C := 0 to 3 do + with AStyle.Borders[C] do + begin + IsDefault := False; + Width := 1; + Color := clBlack; + end; + AHeaderStyle := AStyle; + AHeaderStyle.BrushStyle := cbsSolid; + AHeaderStyle.BrushBkColor := cxColorToRGB(clBtnFace); + Provider.SetDefaultStyle(DefaultCellStyle); + AColCount := Max(GridView.VisibleSeriesCount + 1, 1); + ARowCount := GridView.DataController.RowCount + 1; + Provider.SetRange(AColCount, ARowCount, False); + for C := 0 to AColCount - 1 do + begin + if C = 0 then + begin + Provider.SetCellDataWideString(C, 0, 'Category'); + for R := 1 to ARowCount - 1 do + SetCellValueAndStyle(C, R, GridView.ViewData.Categories[R - 1], AStyle); + end + else + begin + ASeries := GridView.VisibleSeries[C - 1]; + Provider.SetCellDataWideString(C, 0, ASeries.GetDisplayText); + for R := 1 to ARowCount - 1 do + SetCellValueAndStyle(C, R, ASeries.Values[R - 1], AStyle); + end; + Provider.SetCellStyle(C, 0, AHeaderStyle); + end; +end; + +function TcxGridChartViewExport.GetGridView: TcxGridChartView; +begin + Result := TcxGridChartView(FGridView); +end; + +// *** + +procedure ExportGridToHTML(const AFileName: string; AGrid: TcxGrid; + AExpand: Boolean; ASaveAll: Boolean; const AFileExt: string); +begin + ExportGridToFile(AFileName, cxExportToHtml, AGrid, AExpand, ASaveAll, False, '', '', '', AFileExt); +end; + +procedure ExportGridToXML(const AFileName: string; AGrid: TcxGrid; + AExpand: Boolean; ASaveAll: Boolean; const AFileExt: string); +begin + ExportGridToFile(AFileName, cxExportToXml, AGrid, AExpand, ASaveAll, False, '', '', '', AFileExt); +end; + +procedure ExportGridToExcel(const AFileName: string; AGrid: TcxGrid; + AExpand: Boolean; ASaveAll: Boolean; AUseNativeFormat: Boolean; const AFileExt: string); +begin + ExportGridToFile(AFileName, cxExportToExcel, AGrid, AExpand, ASaveAll, AUseNativeFormat, '', '', '', AFileExt); +end; + +procedure ExportGridToText(const AFileName: string; AGrid: TcxGrid; + AExpand: Boolean; ASaveAll: Boolean; const ASeparator: string; + const ABeginString: string; const AEndString: string; const AFileExt: string); +begin + ExportGridToFile(AFileName, cxExportToText, AGrid, AExpand, ASaveAll, False, + ASeparator, ABeginString, AEndString, AFileExt); +end; + +initialization + cxExportInit(TcxGetResourceStringProc(@cxGetResourceString), @ColorToRGB, True ); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridFilterHelpers.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridFilterHelpers.pas new file mode 100644 index 00000000..cd3905f1 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridFilterHelpers.pas @@ -0,0 +1,108 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridFilterHelpers; + +{$I cxVer.inc} + +interface + +uses + cxGridCustomTableView, cxDataStorage, cxEdit, cxDropDownEdit, cxFilterControlUtils; + +type + { TcxFilterExtLookupComboBoxHelper } + + TcxFilterExtLookupComboBoxHelper = class(TcxFilterComboBoxHelper) + public + class function GetFilterEditClass: TcxCustomEditClass; override; + class function GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; + AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; override; + class procedure InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); override; + end; + +implementation + +uses + cxDBLookupComboBox, cxDBExtLookupComboBox, cxGridDBDataDefinitions, + cxDBLookupEdit, cxDBData; + +{ TcxFilterExtLookupComboBoxHelper } + +class function TcxFilterExtLookupComboBoxHelper.GetFilterEditClass: TcxCustomEditClass; +begin + Result := TcxLookupComboBox; +end; + +class function TcxFilterExtLookupComboBoxHelper.GetSupportedFilterOperators( + AProperties: TcxCustomEditProperties; AValueTypeClass: TcxValueTypeClass; + AExtendedSet: Boolean = False): TcxFilterControlOperators; +begin + Result := [fcoEqual, fcoNotEqual, fcoBlanks, fcoNonBlanks]; +end; + +class procedure TcxFilterExtLookupComboBoxHelper.InitializeProperties(AProperties, + AEditProperties: TcxCustomEditProperties; AHasButtons: Boolean); +var + AView: TcxCustomGridTableView; +begin + inherited InitializeProperties(AProperties, AEditProperties, AHasButtons); + with TcxLookupComboBoxProperties(AProperties) do + begin + DropDownAutoSize := False; + DropDownListStyle := lsFixedList; + AView := TcxExtLookupComboBoxProperties(AEditProperties).View; + if (AView <> nil) and (TcxExtLookupComboBoxProperties(AEditProperties).ListFieldItem <> nil) then + begin + ListSource := TcxDBDataController(AView.DataController).DataSource; + KeyFieldNames := TcxExtLookupComboBoxProperties(AEditProperties).KeyFieldNames; + ListFieldNames := TcxGridItemDBDataBinding(TcxExtLookupComboBoxProperties(AEditProperties).ListFieldItem.DataBinding).FieldName; + DropDownSizeable := True; + IncrementalFiltering := True; + end; + end; +end; + +initialization + FilterEditsController.Register(TcxExtLookupComboBoxProperties, + TcxFilterExtLookupComboBoxHelper); + +finalization + FilterEditsController.Unregister(TcxExtLookupComboBoxProperties, + TcxFilterExtLookupComboBoxHelper); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridFooterPopupMenuItems.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridFooterPopupMenuItems.pas new file mode 100644 index 00000000..cbe37f78 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridFooterPopupMenuItems.pas @@ -0,0 +1,198 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid Utils } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridFooterPopupMenuItems; + +{$I cxVer.inc} + +interface + +uses + cxCustomData, cxGridTableView, cxGridMenuOperations; + +type + TcxGridFooterSummaryOperation = class(TcxGridTableColumnMenuOperation) + private + FKind: TcxSummaryKind; + function GetFooterViewInfo: TcxGridFooterViewInfo; + function GetMultipleSummaries: Boolean; + function GetSummaryItems: TcxDataSummaryItems; + procedure SetKind(Value: TcxSummaryKind); + protected + procedure Execute(Sender: TObject); override; + function GetDown: Boolean; override; + function GetEnabled: Boolean; override; + function GetImageResourceName: string; override; + property FooterViewInfo: TcxGridFooterViewInfo read GetFooterViewInfo; + property MultipleSummaries: Boolean read GetMultipleSummaries; + property SummaryItems: TcxDataSummaryItems read GetSummaryItems; + public + property Kind: TcxSummaryKind read FKind write SetKind; + end; + + TcxGridFooterPopupMenuOperations = class(TcxGridPopupMenuOperations) + protected + procedure AddItems; override; + end; + +implementation + +uses + cxDataStorage, cxLookupEdit, cxGridCustomView, + cxGridCustomPopupMenu, cxGridPopupMenu, cxGridPopupMenuConsts; + +{ TcxGridFooterSummaryOperation } + +function TcxGridFooterSummaryOperation.GetFooterViewInfo: TcxGridFooterViewInfo; +begin + if GridPopupMenu.HitTest.ViewInfo is TcxGridFooterCellViewInfo then + Result := TcxGridFooterCellViewInfo(GridPopupMenu.HitTest.ViewInfo).Container + else + if GridPopupMenu.HitTest.ViewInfo is TcxGridFooterViewInfo then + Result := TcxGridFooterViewInfo(GridPopupMenu.HitTest.ViewInfo) + else + Result := nil; +end; + +function TcxGridFooterSummaryOperation.GetMultipleSummaries: Boolean; +begin + Result := FooterViewInfo.CanShowMultipleSummaries; +end; + +function TcxGridFooterSummaryOperation.GetSummaryItems: TcxDataSummaryItems; +begin + Result := FooterViewInfo.SummaryItems; +end; + +procedure TcxGridFooterSummaryOperation.SetKind(Value: TcxSummaryKind); +begin + FKind := Value; + ResCaption := GetSummaryName(Kind); + UpdateImage; +end; + +procedure TcxGridFooterSummaryOperation.Execute(Sender: TObject); +var + ASummaryItems: TcxDataSummaryItems; + ASummaryItem: TcxDataSummaryItem; +begin + ASummaryItems := SummaryItems; + if MultipleSummaries then + if Kind <> skNone then + if Down then + ASummaryItems.GetDataItem(HitColumn.Index, spFooter, True, Kind).Free + else + Params.Add(ASummaryItems.Add(HitColumn, spFooter, Kind)) + else + if not Down then + ASummaryItems.DeleteItems(HitColumn, spFooter) + else + else + begin + ASummaryItems.SetDataItemKind(HitColumn.Index, spFooter, Kind); + ASummaryItem := ASummaryItems.GetDataItem(HitColumn.Index, spFooter, True, Kind); + if ASummaryItem <> nil then Params.Add(ASummaryItem); + end; +end; + +function TcxGridFooterSummaryOperation.GetDown: Boolean; +var + ASummaryItem: TcxDataSummaryItem; +begin + if Kind = skNone then + Result := SummaryItems.GetDataItem(HitColumn.Index, spFooter) = nil + else + if MultipleSummaries then + Result := SummaryItems.GetDataItem(HitColumn.Index, spFooter, True, Kind) <> nil + else + begin + ASummaryItem := SummaryItems.GetDataItem(HitColumn.Index, spFooter); + Result := (ASummaryItem <> nil) and (ASummaryItem.Kind = Kind); + end; +end; + +function TcxGridFooterSummaryOperation.GetEnabled: Boolean; + +{$IFDEF DELPHI6} + function GetFMTBcdVarType: Integer; + begin + Result := TcxFMTBcdValueType.GetVarType; + end; +{$ENDIF} + +const + NumberVarTypes = [varSmallint, varInteger, varSmallint, varSingle, varByte, + varDouble, varCurrency, varDate + {$IFDEF DELPHI6}, varLongWord, varWord, varInt64, varShortInt{$ENDIF}]; + TimeVarTypes = [varDate]; +var + AVarType: Integer; +begin + Result := Kind in [skCount, skNone]; + if Result then Exit; + + Result := not HitColumn.GetProperties.InheritsFrom(TcxCustomLookupEditProperties); + if not Result then Exit; + + Result := HitColumn.DataBinding.ValueTypeClass <> nil; + if not Result then Exit; + + AVarType := HitColumn.DataBinding.ValueTypeClass.GetVarType; + Result := (AVarType in NumberVarTypes){$IFDEF DELPHI6} or (AVarType = GetFMTBcdVarType){$ENDIF}; + if Result and (Kind in [skSum, skAverage]) then + Result := not (AVarType in TimeVarTypes); +end; + +function TcxGridFooterSummaryOperation.GetImageResourceName: string; +begin + Result := GetSummaryImageResourceName(Kind); +end; + +{ TcxGridFooterPopupMenuOperations } + +procedure TcxGridFooterPopupMenuOperations.AddItems; +var + ASummaryKind: TcxSummaryKind; +begin + for ASummaryKind := Low(ASummaryKind) to High(ASummaryKind) do + if ASummaryKind <> skNone then + TcxGridFooterSummaryOperation(AddItem(TcxGridFooterSummaryOperation)).Kind := ASummaryKind; + with TcxGridFooterSummaryOperation(AddItem(TcxGridFooterSummaryOperation)) do + begin + BeginGroup := True; + Kind := skNone; + end; +end; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridGroupRowPopupMenuItems.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridGroupRowPopupMenuItems.pas new file mode 100644 index 00000000..07d5dd29 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridGroupRowPopupMenuItems.pas @@ -0,0 +1,183 @@ +unit cxGridGroupRowPopupMenuItems; + +{$I cxVer.inc} + +interface + +uses + cxCustomData, cxGridCustomView, cxGridTableView, cxGridMenuOperations; + +type + TcxGridGroupRowPopupMenuOperation = class(TcxGridTablePopupMenuOperation) + private + function GetHitRow: TcxGridGroupRow; + public + property HitRow: TcxGridGroupRow read GetHitRow; + end; + + TcxGridGroupRowSortByGroupValuesOperation = class(TcxGridGroupRowPopupMenuOperation) + protected + procedure Execute(Sender: TObject); override; + function GetDown: Boolean; override; + public + constructor Create; override; + end; + + TcxGridGroupRowSortBySummaryCaptionOperation = class(TcxGridGroupRowPopupMenuOperation) + public + constructor Create; override; + end; + + TcxGridGroupRowSortBySummaryOperation = class(TcxGridGroupRowPopupMenuOperation) + private + FSummaryItem: TcxDataSummaryItem; + procedure SetSummaryItem(Value: TcxDataSummaryItem); + protected + procedure Execute(Sender: TObject); override; + function GetCaption: string; override; + function GetDown: Boolean; override; + function GetImageResourceName: string; override; + public + constructor Create; override; + property SummaryItem: TcxDataSummaryItem read FSummaryItem write SetSummaryItem; + end; + + TcxGridGroupRowPopupMenuOperations = class(TcxGridPopupMenuOperations) + private + FGroupRow: TcxGridGroupRow; + procedure SetGroupRow(Value: TcxGridGroupRow); + protected + procedure AddItems; override; + public + function CanProcess(AHitTest: TcxCustomGridHitTest): Boolean; override; + property GroupRow: TcxGridGroupRow read FGroupRow write SetGroupRow; + end; + +implementation + +uses + SysUtils, cxClasses, cxGridCustomTableView, cxGridPopupMenuConsts; + +{ TcxGridGroupRowPopupMenuOperation } + +function TcxGridGroupRowPopupMenuOperation.GetHitRow: TcxGridGroupRow; +begin + if (GridPopupMenu.HitTest is TcxGridRecordHitTest) and + (TcxGridRecordHitTest(GridPopupMenu.HitTest).GridRecord is TcxGridGroupRow) then + Result := TcxGridGroupRow(TcxGridRecordHitTest(GridPopupMenu.HitTest).GridRecord) + else + Result := nil; +end; + +{ TcxGridGroupRowSortByGroupValuesOperation } + +constructor TcxGridGroupRowSortByGroupValuesOperation.Create; +begin + inherited; + ResCaption := @cxSGridSortByGroupValues; +end; + +procedure TcxGridGroupRowSortByGroupValuesOperation.Execute(Sender: TObject); +begin + if HitRow.GroupSummaryItems.SortedSummaryItem <> nil then + HitRow.GroupSummaryItems.SortedSummaryItem.Sorted := False; +end; + +function TcxGridGroupRowSortByGroupValuesOperation.GetDown: Boolean; +begin + Result := HitRow.GroupSummaryItems.SortedSummaryItem = nil; +end; + +{ TcxGridGroupRowSortBySummaryCaptionOperation } + +constructor TcxGridGroupRowSortBySummaryCaptionOperation.Create; +begin + inherited; + ResCaption := @cxSGridSortBySummaryCaption; +end; + +{ TcxGridGroupRowSortBySummaryOperation } + +constructor TcxGridGroupRowSortBySummaryOperation.Create; +begin + inherited; + ResCaption := @cxSGridSortBySummary; +end; + +procedure TcxGridGroupRowSortBySummaryOperation.SetSummaryItem(Value: TcxDataSummaryItem); +begin + if FSummaryItem <> Value then + begin + FSummaryItem := Value; + UpdateImage; + end; +end; + +procedure TcxGridGroupRowSortBySummaryOperation.Execute(Sender: TObject); +begin + SummaryItem.Sorted := True; +end; + +function TcxGridGroupRowSortBySummaryOperation.GetCaption: string; +var + AGridSummaryItem: IcxGridSummaryItem; +begin + if Supports(SummaryItem, IcxGridSummaryItem, AGridSummaryItem) then + Result := AGridSummaryItem.DisplayText + else + Result := ''; + if Result = '' then + begin + Result := cxGetResourceString(GetSummaryName(SummaryItem.Kind)); + if SummaryItem.ItemLink <> nil then + Result := Format(inherited GetCaption, + [Result, (SummaryItem.ItemLink as TcxGridColumn).GetAlternateCaption]); + end; + Result := ' ' + Result; +end; + +function TcxGridGroupRowSortBySummaryOperation.GetDown: Boolean; +begin + Result := SummaryItem.Sorted; +end; + +function TcxGridGroupRowSortBySummaryOperation.GetImageResourceName: string; +begin + if SummaryItem <> nil then + Result := GetSummaryImageResourceName(SummaryItem.Kind) + else + Result := inherited GetImageResourceName; +end; + +{ TcxGridGroupRowPopupMenuOperations } + +procedure TcxGridGroupRowPopupMenuOperations.SetGroupRow(Value: TcxGridGroupRow); +begin + FGroupRow := Value; + RecreateItems; +end; + +procedure TcxGridGroupRowPopupMenuOperations.AddItems; +var + ASummaryItems: TcxDataGroupSummaryItems; + I: Integer; + AGridSummaryItem: IcxGridSummaryItem; +begin + if GroupRow = nil then Exit; + ASummaryItems := GroupRow.GroupSummaryItems; + if ASummaryItems.Count = 0 then Exit; + AddItem(TcxGridGroupRowSortByGroupValuesOperation); + AddItem(TcxGridGroupRowSortBySummaryCaptionOperation).BeginGroup := True; + for I := 0 to ASummaryItems.Count - 1 do + if not Supports(ASummaryItems[I], IcxGridSummaryItem, AGridSummaryItem) or + AGridSummaryItem.VisibleForCustomization then + TcxGridGroupRowSortBySummaryOperation(AddItem(TcxGridGroupRowSortBySummaryOperation)).SummaryItem := ASummaryItems[I]; +end; + +function TcxGridGroupRowPopupMenuOperations.CanProcess(AHitTest: TcxCustomGridHitTest): Boolean; +begin + Result := inherited CanProcess(AHitTest) and (AHitTest is TcxGridRecordHitTest) and + (TcxGridRecordHitTest(AHitTest).GridRecord is TcxGridGroupRow); +end; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridHeaderPopupMenuItems.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridHeaderPopupMenuItems.pas new file mode 100644 index 00000000..f955d0d2 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridHeaderPopupMenuItems.pas @@ -0,0 +1,650 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid Utils } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridHeaderPopupMenuItems; + +{$I cxVer.inc} + +interface + +uses + Classes, cxGridMenuOperations; + +type + TcxGridHeaderPopupMenuOperation = class(TcxGridTableColumnMenuOperation); + + TcxGridSortingMenuOperation = class(TcxGridHeaderPopupMenuOperation) + protected + procedure Execute(Sender: TObject); override; + function GetVisible: Boolean; override; + function IsSorted: Boolean; + end; + + TcxGridSortColumn = class(TcxGridSortingMenuOperation) + protected + procedure Execute(Sender: TObject); override; + function GetDown: Boolean; override; + function GetEnabled: Boolean; override; + end; + + TcxGridSortColumnAsc = class(TcxGridSortColumn) + protected + function GetImageResourceName: string; override; + public + constructor Create; override; + end; + + TcxGridSortColumnDesc = class(TcxGridSortColumn) + protected + function GetImageResourceName: string; override; + public + constructor Create; override; + end; + + TcxGridClearSorting = class(TcxGridSortingMenuOperation) + protected + function GetEnabled: Boolean; override; + public + constructor Create; override; + end; + + TcxGridGroupByThisField = class(TcxGridHeaderPopupMenuOperation) + protected + procedure Execute(Sender: TObject); override; + function GetCaption: string; override; + function GetEnabled: Boolean; override; + function GetImageResourceName: string; override; + function GetVisible: Boolean; override; + public + constructor Create; override; + end; + + TcxGridGroupByBox = class(TcxGridHeaderPopupMenuOperation) + protected + procedure Execute(Sender: TObject); override; + function GetDown: Boolean; override; + function GetImageResourceName: string; override; + function GetVisible: Boolean; override; + public + constructor Create; override; + end; + + TcxGridAlignmentSubMenu = class(TcxGridHeaderPopupMenuOperation) + protected + function GetVisible: Boolean; override; + public + constructor Create; override; + end; + + TcxGridAlign = class(TcxGridHeaderPopupMenuOperation) + protected + procedure Execute(Sender: TObject); override; + function GetDown: Boolean; Override; + function GetEnabled: Boolean; override; + public + class function GetParentOperationClass: TcxGridPopupMenuOperationClass; override; + end; + + TcxGridAlignLeft = class(TcxGridAlign) + protected + function GetImageResourceName: string; override; + public + constructor Create; override; + end; + + TcxGridAlignRight = class(TcxGridAlign) + protected + function GetImageResourceName: string; override; + public + constructor Create; override; + end; + + TcxGridAlignCenter = class(TcxGridAlign) + protected + function GetImageResourceName: string; override; + public + constructor Create; override; + end; + + TcxGridBestFit = class(TcxGridHeaderPopupMenuOperation) + protected + procedure Execute(Sender: TObject); override; + function GetEnabled: Boolean; override; + function GetImageResourceName: string; override; + function GetVisible: Boolean; override; + public + constructor Create; override; + end; + + TcxGridBestFitAllColumns = class(TcxGridHeaderPopupMenuOperation) + protected + procedure Execute(Sender: TObject); override; + function GetVisible: Boolean; override; + public + constructor Create; override; + end; + + TcxGridRemoveColumn = class(TcxGridHeaderPopupMenuOperation) + protected + procedure Execute(Sender: TObject); override; + function GetVisible: Boolean; override; + public + constructor Create; override; + end; + + TcxGridFieldChooser = class(TcxGridHeaderPopupMenuOperation) + protected + procedure Execute(Sender: TObject); override; + function GetDown: Boolean; override; + function GetImageResourceName: string; override; + public + constructor Create; override; + end; + + TcxGridShowFooter = class(TcxGridHeaderPopupMenuOperation) + protected + procedure Execute(Sender: TObject); override; + function GetDown: Boolean; Override; + function GetImageResourceName: string; override; + public + constructor Create; override; + end; + + TcxGridShowGroupFooter = class(TcxGridHeaderPopupMenuOperation) + protected + procedure Execute(Sender: TObject); override; + function GetDown: Boolean; override; + function GetEnabled: Boolean; override; + function GetImageResourceName: string; override; + function GetVisible: Boolean; override; + public + constructor Create; override; + end; + + TcxGridHeaderPopupMenuOperations = class(TcxGridPopupMenuOperations) + protected + procedure AddItems; override; + end; + +implementation + +uses + cxCustomData, cxEdit, cxGridCustomTableView, cxGridTableView, cxGridPopupMenuConsts; + +const + AImageName = 'HdrImg'; + +{ TcxGridSortingMenuOperation } + +procedure TcxGridSortingMenuOperation.Execute(Sender: TObject); +begin + if IsSorted then + HitGridView.DataController.ClearSorting(True); +end; + +function TcxGridSortingMenuOperation.GetVisible: Boolean; +begin + Result := HitGridView.OptionsCustomize.ColumnSorting; +end; + +function TcxGridSortingMenuOperation.IsSorted: Boolean; +var + I: Integer; +begin + Result := False; + with HitGridView do + if SortedItemCount > 0 then + for I := 0 to SortedItemCount - 1 do + if TcxCustomGridTableItemAccess.GetGroupIndex(SortedItems[I]) = -1 then + begin + Result := True; + Break; + end; +end; + +{ TcxGridSortColumn } + +procedure TcxGridSortColumn.Execute(Sender: TObject); +var + ASortOrder: TcxDataSortOrder; +begin + HitGridView.BeginUpdate; + try + inherited; + case Tag of + 0: ASortOrder := soAscending; + 1: ASortOrder := soDescending; + else + ASortOrder := soNone; + end; + HitColumn.SortOrder := ASortOrder; + finally + HitGridView.EndUpdate; + end; +end; + +function TcxGridSortColumn.GetDown: Boolean; +begin + if Tag = 0 then + Result := HitColumn.SortOrder = soAscending + else + Result := HitColumn.SortOrder = soDescending; +end; + +function TcxGridSortColumn.GetEnabled: Boolean; +begin + Result := TcxCustomGridTableItemAccess.CanSort(HitColumn); +end; + +{ TcxGridSortColumnAsc } + +constructor TcxGridSortColumnAsc.Create; +begin + inherited; + ResCaption := @cxSGridSortColumnAsc; + Tag := 0; +end; + +function TcxGridSortColumnAsc.GetImageResourceName: string; +begin + Result := AImageName + '1'; +end; + +{ TcxGridSortColumnDesc } + +constructor TcxGridSortColumnDesc.Create; +begin + inherited; + ResCaption := @cxSGridSortColumnDesc; + Tag := 1; +end; + +function TcxGridSortColumnDesc.GetImageResourceName: string; +begin + Result := AImageName + '2'; +end; + +{ TcxGridClearSorting } + +constructor TcxGridClearSorting.Create; +begin + inherited; + ResCaption := @cxSGridClearSorting; +end; + +function TcxGridClearSorting.GetEnabled: Boolean; +begin + Result := IsSorted; +end; + +{ TcxGridGroupBy } + +constructor TcxGridGroupByThisField.Create; +begin + inherited; + ResCaption := @cxSGridGroupByThisField; +end; + +procedure TcxGridGroupByThisField.Execute(Sender: TObject); +var + AGroupIndex: Integer; +begin + HitGridView.BeginUpdate; + try + HitGridView.OptionsView.GroupByBox := True; + if HitColumn.GroupIndex <> -1 then + AGroupIndex := -1 + else + AGroupIndex := HitGridView.GroupedColumnCount; + HitColumn.GroupBy(AGroupIndex); + finally + HitGridView.EndUpdate; + end; + TcxGridTableViewAccess.DoColumnPosChanged(HitGridView, HitColumn); +end; + +function TcxGridGroupByThisField.GetCaption: string; +begin + if HitColumn.GroupIndex <> -1 then + ResCaption := @cxSGridRemoveThisGroupItem + else + ResCaption := @cxSGridGroupByThisField; + Result := inherited GetCaption; +end; + +function TcxGridGroupByThisField.GetEnabled: Boolean; +begin + Result := TcxCustomGridTableItemAccess.CanGroup(HitColumn); +end; + +function TcxGridGroupByThisField.GetImageResourceName: string; +begin + Result := AImageName + '3'; +end; + +function TcxGridGroupByThisField.GetVisible: Boolean; +begin + Result := HitGridView.OptionsCustomize.ColumnGrouping; +end; + +{ TcxGridGroupByBox } + +constructor TcxGridGroupByBox.Create; +begin + inherited; + ResCaption := @cxSGridGroupByBox; +end; + +procedure TcxGridGroupByBox.Execute(Sender: TObject); +begin + GridOperationHelper.DoShowGroupingPanel(not GridOperationHelper.IsGroupingPanelShowing); +end; + +function TcxGridGroupByBox.GetDown: Boolean; +begin + Result := GridOperationHelper.IsGroupingPanelShowing; +end; + +function TcxGridGroupByBox.GetImageResourceName: string; +begin + Result := AImageName + '7'; +end; + +function TcxGridGroupByBox.GetVisible: Boolean; +begin + Result := HitGridView.OptionsCustomize.ColumnGrouping; +end; + +{ TcxGridAligmentSubMenu } + +constructor TcxGridAlignmentSubMenu.Create; +begin + inherited; + ResCaption := @cxSGridAlignmentSubMenu; +end; + +function TcxGridAlignmentSubMenu.GetVisible: Boolean; +begin + Result := HitColumn.Properties <> nil; +end; + +{ TcxGridAlignLeft } + +procedure TcxGridAlign.Execute(Sender: TObject); +begin + case Tag of + 0: HitColumn.GetProperties.Alignment.Horz := taLeftJustify; + 1: HitColumn.GetProperties.Alignment.Horz := taRightJustify; + 2: HitColumn.GetProperties.Alignment.Horz := taCenter; + end; +end; + +function TcxGridAlign.GetDown: Boolean; +var + AProperties: TcxCustomEditProperties; +begin + AProperties := HitColumn.GetProperties; + case Tag of + 0: Result := AProperties.Alignment.Horz = taLeftJustify; + 1: Result := AProperties.Alignment.Horz = taRightJustify; + else + Result := AProperties.Alignment.Horz = taCenter; + end; +end; + +function TcxGridAlign.GetEnabled: Boolean; +begin + Result := esoHorzAlignment in HitColumn.GetProperties.GetSupportedOperations; +end; + +class function TcxGridAlign.GetParentOperationClass: TcxGridPopupMenuOperationClass; +begin + Result := TcxGridAlignmentSubMenu; +end; + +{ TcxGridAlignLeft } + +constructor TcxGridAlignLeft.Create; +begin + inherited; + ResCaption := @cxSGridAlignLeft; + Tag := 0; +end; + +function TcxGridAlignLeft.GetImageResourceName: string; +begin + Result := AImageName + '4'; +end; + +{ TcxGridAlignRight } + +constructor TcxGridAlignRight.Create; +begin + inherited; + ResCaption := @cxSGridAlignRight; + Tag := 1; +end; + +function TcxGridAlignRight.GetImageResourceName: string; +begin + Result := AImageName + '5'; +end; + +{ TcxGridAlignCenter } + +constructor TcxGridAlignCenter.Create; +begin + inherited; + ResCaption := @cxSGridAlignCenter; + Tag := 2; +end; + +function TcxGridAlignCenter.GetImageResourceName: string; +begin + Result := AImageName + '6'; +end; + +{ TcxGridBestFit } + +constructor TcxGridBestFit.Create; +begin + inherited; + ResCaption := @cxSGridBestFit; +end; + +procedure TcxGridBestFit.Execute(Sender: TObject); +begin + HitColumn.ApplyBestFit(True, True); +end; + +function TcxGridBestFit.GetEnabled: Boolean; +begin + Result := TcxCustomGridTableItemAccess.CanHorzSize(HitColumn); +end; + +function TcxGridBestFit.GetImageResourceName: string; +begin + Result := AImageName + '9'; +end; + +function TcxGridBestFit.GetVisible: Boolean; +begin + Result := HitGridView.OptionsCustomize.ColumnHorzSizing; +end; + +{ TcxGridBestFitAllColumns } + +constructor TcxGridBestFitAllColumns.Create; +begin + inherited; + ResCaption := @cxSGridBestFitAllColumns; +end; + +procedure TcxGridBestFitAllColumns.Execute(Sender: TObject); +begin + TcxCustomGridTableView(HitGridView).ApplyBestFit(nil, True, True); +end; + +function TcxGridBestFitAllColumns.GetVisible: Boolean; +begin + Result := HitGridView.OptionsCustomize.ColumnHorzSizing; +end; + +{ TcxGridCustColumns } + +constructor TcxGridRemoveColumn.Create; +begin + inherited; + ResCaption := @cxSGridRemoveColumn; +end; + +procedure TcxGridRemoveColumn.Execute(Sender: TObject); +begin + HitColumn.Visible := False; + TcxGridTableViewAccess.DoColumnPosChanged(HitGridView, HitColumn); +end; + +function TcxGridRemoveColumn.GetVisible: Boolean; +begin + Result := TcxCustomGridTableItemAccess.CanHide(HitColumn); +end; + +{ TcxGridFieldChoozer } + +constructor TcxGridFieldChooser.Create; +begin + inherited; + ResCaption := @cxSGridFieldChooser; +end; + +procedure TcxGridFieldChooser.Execute(Sender: TObject); +begin + GridOperationHelper.DoShowColumnCustomizing( + not GridOperationHelper.IsColumnsCustomizingShowing); +end; + +function TcxGridFieldChooser.GetDown: Boolean; +begin + Result := GridOperationHelper.IsColumnsCustomizingShowing; +end; + +function TcxGridFieldChooser.GetImageResourceName: string; +begin + Result := AImageName + '8'; +end; + +{ TcxGridShowFooter } + +constructor TcxGridShowFooter.Create; +begin + inherited; + ResCaption := @cxSGridShowFooter; +end; + +procedure TcxGridShowFooter.Execute(Sender: TObject); +begin + GridOperationHelper.DoShowSummaryFooter( + not GridOperationHelper.IsSummaryFooterShowing); +end; + +function TcxGridShowFooter.GetDown: Boolean; +begin + Result := GridOperationHelper.IsSummaryFooterShowing; +end; + +function TcxGridShowFooter.GetImageResourceName: string; +begin + Result := AImageName + '10'; +end; + +{ TcxGridShowGroupFooter } + +constructor TcxGridShowGroupFooter.Create; +begin + inherited; + ResCaption := @cxSGridShowGroupFooter; +end; + +procedure TcxGridShowGroupFooter.Execute(Sender: TObject); +begin + with HitGridView.OptionsView do + if GroupFooters = gfInvisible then + GroupFooters := PrevGroupFooters + else + GroupFooters := gfInvisible; +end; + +function TcxGridShowGroupFooter.GetDown: Boolean; +begin + Result := HitGridView.OptionsView.GroupFooters <> gfInvisible; +end; + +function TcxGridShowGroupFooter.GetEnabled: Boolean; +begin + Result := HitGridView.GroupedColumnCount <> 0; +end; + +function TcxGridShowGroupFooter.GetImageResourceName: string; +begin + Result := AImageName + '11'; +end; + +function TcxGridShowGroupFooter.GetVisible: Boolean; +begin + with HitGridView do + Result := (GroupedColumnCount <> 0) or OptionsCustomize.ColumnGrouping; +end; + +{ TcxGridHeaderPopupMenuOperations } + +procedure TcxGridHeaderPopupMenuOperations.AddItems; +begin + AddItem(TcxGridSortColumnAsc); + AddItem(TcxGridSortColumnDesc); + AddItem(TcxGridClearSorting); + AddItem(TcxGridGroupByThisField).BeginGroup := True; + AddItem(TcxGridGroupByBox); + AddItem(TcxGridShowFooter).BeginGroup := True; + AddItem(TcxGridShowGroupFooter); + AddItem(TcxGridRemoveColumn).BeginGroup := True; + AddItem(TcxGridFieldChooser); + AddItem(TcxGridAlignmentSubMenu).BeginGroup := True; + AddItem(TcxGridAlignLeft); + AddItem(TcxGridAlignRight); + AddItem(TcxGridAlignCenter); + AddItem(TcxGridBestFit); + AddItem(TcxGridBestFitAllColumns).BeginGroup := True; +end; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridImportDialog.dfm b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridImportDialog.dfm new file mode 100644 index 00000000..3e08ec17 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridImportDialog.dfm @@ -0,0 +1,237 @@ +object ImportDialog: TImportDialog + Left = 0 + Top = 0 + BorderStyle = bsDialog + Caption = 'Import' + ClientHeight = 368 + ClientWidth = 694 + Color = clBtnFace + ParentFont = True + KeyPreview = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 237 + Top = 0 + Width = 80 + Height = 368 + Align = alLeft + BevelOuter = bvNone + TabOrder = 1 + object btnImport: TcxButton + Left = 0 + Top = 8 + Width = 80 + Height = 24 + Caption = 'Import ->' + Enabled = False + TabOrder = 0 + OnClick = btnImportClick + end + object btnClose: TcxButton + Left = 0 + Top = 40 + Width = 80 + Height = 24 + Cancel = True + Caption = 'Close' + TabOrder = 1 + OnClick = btnCloseClick + end + end + object Panel2: TPanel + Left = 317 + Top = 0 + Width = 377 + Height = 368 + Align = alClient + BevelOuter = bvNone + BorderWidth = 8 + TabOrder = 2 + object Panel6: TPanel + Left = 8 + Top = 8 + Width = 361 + Height = 352 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object PageControl1: TcxPageControl + Left = 1 + Top = 1 + Width = 359 + Height = 350 + ActivePage = TabSheet1 + Align = alClient + Color = clBtnFace + ParentColor = False + TabOrder = 0 + ClientRectBottom = 350 + ClientRectRight = 359 + ClientRectTop = 24 + object TabSheet1: TcxTabSheet + BorderWidth = 8 + Caption = ' Levels ' + Color = clBtnFace + ParentColor = False + object cbDeleteAllSublevels: TcxCheckBox + Left = 0 + Top = 289 + Align = alBottom + Caption = 'Delete All Sublevels' + State = cbsChecked + TabOrder = 3 + Width = 343 + end + object Panel7: TPanel + Left = 0 + Top = 0 + Width = 343 + Height = 13 + Align = alTop + AutoSize = True + BevelOuter = bvNone + TabOrder = 0 + object lblLevelName: TLabel + Left = 89 + Top = 0 + Width = 254 + Height = 13 + Align = alClient + end + object Label1: TLabel + Left = 0 + Top = 0 + Width = 89 + Height = 13 + Align = alLeft + Caption = 'Destination Level: ' + end + end + object pnlStructureControlSite: TPanel + Left = 0 + Top = 21 + Width = 343 + Height = 260 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 1 + end + object Panel3: TPanel + Left = 0 + Top = 13 + Width = 343 + Height = 8 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + end + object Panel8: TPanel + Left = 0 + Top = 281 + Width = 343 + Height = 8 + Align = alBottom + BevelOuter = bvNone + TabOrder = 4 + end + end + object TabSheet2: TcxTabSheet + BorderWidth = 8 + Caption = ' Styles ' + Color = clBtnFace + ImageIndex = 1 + ParentColor = False + object cbImportStyles: TcxCheckBox + Left = 0 + Top = 0 + Align = alTop + Caption = 'Import Styles' + State = cbsChecked + TabOrder = 0 + OnClick = cbImportStylesClick + Width = 343 + end + object rbCreateNewStyleRepository: TcxRadioButton + Left = 12 + Top = 29 + Width = 169 + Height = 17 + Caption = 'Create New StyleRepository' + Checked = True + TabOrder = 1 + TabStop = True + OnClick = rbStyleRepositoryClick + end + object rbUseExistingStyleRepository: TcxRadioButton + Left = 12 + Top = 87 + Width = 173 + Height = 17 + Caption = 'Use Existing StyleRepository' + TabOrder = 3 + TabStop = True + OnClick = rbStyleRepositoryClick + end + object edNewStyleRepository: TcxTextEdit + Left = 36 + Top = 52 + TabOrder = 2 + Width = 290 + end + object cbStyleRepositories: TcxComboBox + Left = 36 + Top = 110 + Properties.DropDownListStyle = lsFixedList + TabOrder = 4 + Width = 290 + end + end + end + end + end + object Panel4: TPanel + Left = 0 + Top = 0 + Width = 237 + Height = 368 + Align = alLeft + BevelOuter = bvNone + BorderWidth = 8 + TabOrder = 0 + object Panel5: TPanel + Left = 8 + Top = 8 + Width = 221 + Height = 352 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object lbComponentsForImport: TListBox + Left = 1 + Top = 1 + Width = 219 + Height = 350 + Style = lbOwnerDrawVariable + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + TabOrder = 0 + OnClick = lbComponentsForImportClick + OnDblClick = lbComponentsForImportDblClick + OnMeasureItem = lbComponentsForImportMeasureItem + end + end + end +end diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridImportDialog.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridImportDialog.pas new file mode 100644 index 00000000..fd516ae5 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridImportDialog.pas @@ -0,0 +1,426 @@ +{*******************************************************************} +{ } +{ Developer Express Cross Platform Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL AND CLX CONTROLS AS PART OF AN EXECUTABLE } +{ PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} +unit cxGridImportDialog; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + DesignIntf, Variants, +{$ELSE} + DsgnIntf, +{$ENDIF} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, ExtCtrls, StdCtrls, cxConverterFactory, cxGridConverter, cxGrid, TypInfo, + cxGridStructureNavigator, cxGridLevel, cxGridCustomView, ComCtrls, cxStyles, + Menus, cxLookAndFeelPainters, cxButtons, cxControls, cxPC, cxContainer, + cxEdit, cxCheckBox, cxRadioGroup, cxGraphics, cxMaskEdit, cxDropDownEdit, + cxTextEdit, cxDesignWindows; + +type + TImportDialog = class(TForm) + Panel1: TPanel; + btnImport: TcxButton; + btnClose: TcxButton; + Panel2: TPanel; + Panel4: TPanel; + Panel5: TPanel; + lbComponentsForImport: TListBox; + Panel6: TPanel; + PageControl1: TcxPageControl; + TabSheet1: TcxTabSheet; + cbDeleteAllSublevels: TcxCheckBox; + TabSheet2: TcxTabSheet; + cbImportStyles: TcxCheckBox; + Panel7: TPanel; + lblLevelName: TLabel; + Label1: TLabel; + pnlStructureControlSite: TPanel; + Panel3: TPanel; + Panel8: TPanel; + rbCreateNewStyleRepository: TcxRadioButton; + rbUseExistingStyleRepository: TcxRadioButton; + edNewStyleRepository: TcxTextEdit; + cbStyleRepositories: TcxComboBox; + procedure btnCloseClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure btnImportClick(Sender: TObject); + procedure lbComponentsForImportClick(Sender: TObject); + procedure lbComponentsForImportDblClick(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure cbImportStylesClick(Sender: TObject); + procedure rbStyleRepositoryClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure lbComponentsForImportMeasureItem(Control: TWinControl; Index: Integer; + var Height: Integer); + private + { Private declarations } + FGrid: TcxCustomGrid; + FDesigner: IDesigner; + FGridStructureControl: TcxGridStructureControl; + FGridStructureHelper: TcxGridStructureHelper; + FIntermediaryList: TStringList; + FLevel: TcxGridLevel; + function GetComponent: TComponent; + procedure SetGrid(Value: TcxCustomGrid); + procedure SetLevel(Value: TcxGridLevel); + + function GetConverterClass(ASource: TObject): TcxCustomGridConverterClass; + procedure LoadComponentForImport(const S: string); + procedure LoadIntermediary(const S: string); + procedure LoadStyleRepository(const S: string); + procedure DoImport; + procedure DisableStylesOptions; + procedure EnableStylesOptions; + function GetIntermediaryComponent: TComponent; + procedure StructureControlSelectionChanged(Sender: TObject); + procedure UpdateDesigner(Sender: TObject); + procedure UpdateStyleRepositoryEdits; + protected + property Component: TComponent read GetComponent; + property Level: TcxGridLevel read FLevel write SetLevel; + public + { Public declarations } + property Grid: TcxCustomGrid read FGrid write SetGrid; + property Designer: IDesigner read FDesigner write FDesigner; + end; + + procedure ShowGridImportDialog(ADesigner: IDesigner; AGrid: TcxCustomGrid); + +implementation + +{$R *.dfm} + +uses + cxLookAndFeels; + +procedure ShowGridImportDialog(ADesigner: IDesigner; AGrid: TcxCustomGrid); +var + ADialog: TImportDialog; +begin + ADialog := TImportDialog.Create(Application); + try + ADialog.Grid := AGrid; + ADialog.Designer := ADesigner; + ADialog.ShowModal; + finally + ADialog.Free; + end; +end; + +procedure TImportDialog.btnCloseClick(Sender: TObject); +begin + Close; +end; + +procedure TImportDialog.FormShow(Sender: TObject); +begin + FDesigner.GetComponentNames(GetTypeData(PTypeInfo(TComponent.ClassInfo)), + LoadComponentForImport); + + UpdateStyleRepositoryEdits; + EnableStylesOptions; +end; + +procedure TImportDialog.btnImportClick(Sender: TObject); +begin + DoImport; +end; + +function TImportDialog.GetComponent: TComponent; +begin + if lbComponentsForImport.ItemIndex = -1 then + Result := nil + else + Result := lbComponentsForImport.Items.Objects[lbComponentsForImport.ItemIndex] as TComponent; +end; + +procedure TImportDialog.SetGrid(Value: TcxCustomGrid); +var + AList: TList; +begin + if FGrid <> Value then + begin + FGrid := Value; + FGridStructureControl.Grid := FGrid; + if FGrid <> nil then + begin + AList := TList.Create; + try + AList.Add(FGrid); + FGridStructureControl.SyncSelection(AList); + finally + AList.Free; + end; + Level := nil; + end; + end; +end; + +procedure TImportDialog.SetLevel(Value: TcxGridLevel); +begin + FLevel := Value; + if FLevel = nil then + lblLevelName.Caption := Grid.Name + else + lblLevelName.Caption := FLevel.Name; +end; + +function TImportDialog.GetConverterClass(ASource: TObject): TcxCustomGridConverterClass; +var + AConverterClass: TcxCustomConverterWithStylesClass; +begin + AConverterClass := ConverterFactory(cxGridGroupConverterName).FindConverter(ASource); + if (AConverterClass <> nil) and AConverterClass.InheritsFrom(TcxCustomGridConverter) then + Result := TcxCustomGridConverterClass(AConverterClass) + else + Result := nil; +end; + +procedure TImportDialog.LoadComponentForImport(const S: string); +var + AComponent: TComponent; +begin + AComponent := FDesigner.GetComponent(S); + if (AComponent <> nil) and (GetConverterClass(AComponent) <> nil) then + lbComponentsForImport.Items.AddObject(S, AComponent); +end; + +procedure TImportDialog.LoadIntermediary(const S: string); +var + AComponent: TComponent; + AConverterClass: TcxCustomGridConverterClass; +begin + AComponent := FDesigner.GetComponent(S); + if AComponent <> nil then + begin + AConverterClass := GetConverterClass(Component); + if (AConverterClass <> nil) and + (AConverterClass.GetIntermediaryClassName = AComponent.ClassName) then + FIntermediaryList.AddObject(AComponent.ClassName, AComponent); + end; +end; + +procedure TImportDialog.LoadStyleRepository(const S: string); +var + AComponent: TComponent; +begin + AComponent := FDesigner.GetComponent(S); + if (AComponent <> nil) and (AComponent is TcxStyleRepository) then + cbStyleRepositories.Properties.Items.AddObject(S, AComponent); +end; + +procedure TImportDialog.DoImport; +var + AConverter: TcxCustomGridConverter; +begin + if Component = nil then Exit; + + btnImport.Enabled := False; + + AConverter := GetConverterClass(Component).Create(FGrid); + try + AConverter.Intermediary := GetIntermediaryComponent; + AConverter.Designer_ := Designer; + AConverter.DestinationLevel := Level; + AConverter.DeleteAllSublevels := cbDeleteAllSublevels.Checked; + AConverter.ConvertWithStyles := cbImportStyles.Checked; + if cbImportStyles.Checked then + if rbCreateNewStyleRepository.Checked then + AConverter.NameOfNewStyleRepository := edNewStyleRepository.Text + else + AConverter.StyleRepository := cbStyleRepositories.ItemObject as TcxStyleRepository; + AConverter.ImportFrom(Component); + finally + AConverter.Free; + + if FGridStructureControl <> nil then + FGridStructureControl.Changed; + if rbCreateNewStyleRepository.Checked then + UpdateStyleRepositoryEdits; + if cbImportStyles.Checked then + EnableStylesOptions; + + btnImport.Enabled := True; + + Designer.Modified; + end; +end; + +procedure EnableEdit(AEdit: TcxCustomEdit; AEnable: Boolean); +begin + AEdit.Enabled := AEnable; + if AEnable then + AEdit.Style.Color := clWindow + else + AEdit.Style.Color := clBtnFace; +end; + +procedure TImportDialog.DisableStylesOptions; +begin + rbCreateNewStyleRepository.Enabled := False; + rbUseExistingStyleRepository.Enabled := False; + EnableEdit(edNewStyleRepository, False); + EnableEdit(cbStyleRepositories, False); +end; + +procedure TImportDialog.EnableStylesOptions; +begin + rbCreateNewStyleRepository.Enabled := True; + rbUseExistingStyleRepository.Enabled := cbStyleRepositories.Properties.Items.Count <> 0; + if not rbUseExistingStyleRepository.Enabled then + rbCreateNewStyleRepository.Checked := True; + EnableEdit(edNewStyleRepository, rbCreateNewStyleRepository.Checked); + EnableEdit(cbStyleRepositories, rbUseExistingStyleRepository.Checked); +end; + +function TImportDialog.GetIntermediaryComponent: TComponent; +begin + Result := nil; + FIntermediaryList := TStringList.Create; + try + FDesigner.GetComponentNames(GetTypeData(PTypeInfo(TComponent.ClassInfo)), LoadIntermediary); + if FIntermediaryList.Count <> 0 then + Result := FIntermediaryList.Objects[0] as TComponent; + finally + FIntermediaryList.Free; + end; +end; + +procedure TImportDialog.StructureControlSelectionChanged(Sender: TObject); +var + AList: TList; + AObject: TObject; +begin + AList := TList.Create; + try + FGridStructureControl.GetSelection(AList); + if AList.Count = 0 then Exit; + AObject := TObject(AList[0]); + if AObject is TcxGridLevel then + Level := TcxGridLevel(AObject) + else + if AObject is TcxCustomGrid then + Level := nil + else + if AObject is TcxCustomGridView then + Level := TcxGridLevel(TcxCustomGridView(AObject).Level); + finally + AList.Free; + end; +end; + +procedure TImportDialog.UpdateDesigner(Sender: TObject); +begin + Designer.Modified; +end; + +procedure TImportDialog.UpdateStyleRepositoryEdits; +var + AIndex: Integer; +begin + edNewStyleRepository.Text := FDesigner.UniqueName(TcxStyleRepository.ClassName); + + if cbStyleRepositories.Properties.Items.Count <> 0 then + AIndex := cbStyleRepositories.ItemIndex + else + AIndex := 0; + cbStyleRepositories.Clear; + FDesigner.GetComponentNames(GetTypeData(PTypeInfo(TComponent.ClassInfo)), LoadStyleRepository); + if cbStyleRepositories.Properties.Items.Count <> 0 then + cbStyleRepositories.ItemIndex := AIndex; +end; + +procedure TImportDialog.lbComponentsForImportClick(Sender: TObject); +begin + btnImport.Enabled := Component <> nil; +end; + +procedure TImportDialog.lbComponentsForImportDblClick(Sender: TObject); +begin + DoImport; +end; + +procedure TImportDialog.lbComponentsForImportMeasureItem(Control: TWinControl; + Index: Integer; var Height: Integer); +begin + Height := lbComponentsForImport.Canvas.TextHeight('Qq') + 2 * 2; +end; + +procedure TImportDialog.FormCreate(Sender: TObject); +begin + with lblLevelName.Font do + begin + Color := clNavy; + Style := [fsBold]; + end; + FGridStructureControl := TcxGridStructureControl.Create(Self); + with FGridStructureControl do + begin + Align := alClient; + MayFocused := True; + OnSelectionChanged := StructureControlSelectionChanged; + Parent := pnlStructureControlSite; + end; + FGridStructureHelper := TcxGridStructureHelper.Create(FGridStructureControl); + FGridStructureHelper.OnUpdateDesigner := UpdateDesigner; + SetControlLookAndFeel(Self, lfUltraFlat, False); +{$IFDEF DELPHI10} // should be DELPHI105 + MakeColoredControlsOpaque(Self); +{$ENDIF} +end; + +procedure TImportDialog.FormDestroy(Sender: TObject); +begin + FGridStructureHelper.Free; + FGridStructureControl.Free; +end; + +procedure TImportDialog.cbImportStylesClick(Sender: TObject); +begin + if cbImportStyles.Checked then + EnableStylesOptions + else + DisableStylesOptions; +end; + +procedure TImportDialog.rbStyleRepositoryClick(Sender: TObject); +begin + EnableStylesOptions; +end; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridLevel.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridLevel.pas new file mode 100644 index 00000000..2c4415ec --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridLevel.pas @@ -0,0 +1,949 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridLevel; + +{$I cxVer.inc} +{$I cxGridVer.inc} + +interface + +uses + Classes, Graphics, ImgList, + cxClasses, cxControls, cxGraphics, cxLookAndFeelPainters, cxStyles, + cxCustomData, + cxGridCustomView, cxGridCustomTableView; + +type + TcxGridDetailTabsPosition = (dtpNone, dtpLeft, dtpTop); + +const + cxGridLevelDefaultDetailFrameWidth = 1; + cxGridLevelDefaultDetailTabsPosition = dtpNone; + + lsFirst = 0; + lsTab = lsFirst; + lsTabsBackground = lsFirst + 1; + lsLast = lsTabsBackground; + +type + TcxGridLevel = class; + + TcxGridLevelOptionsClass = class of TcxGridLevelOptions; + + TcxGridLevelOptions = class(TPersistent) + private + FDetailFrameColor: TColor; + FDetailFrameWidth: Integer; + FDetailTabsPosition: TcxGridDetailTabsPosition; + FLevel: TcxGridLevel; + FTabsForEmptyDetails: Boolean; + procedure SetDetailFrameColor(Value: TColor); + procedure SetDetailFrameWidth(Value: Integer); + procedure SetDetailTabsPosition(Value: TcxGridDetailTabsPosition); + procedure SetTabsForEmptyDetails(Value: Boolean); + protected + procedure Changed(AHardChange: Boolean = True); + property Level: TcxGridLevel read FLevel; + public + constructor Create(ALevel: TcxGridLevel); virtual; + function GetDetailFrameColor: TColor; + published + property DetailFrameColor: TColor read FDetailFrameColor write SetDetailFrameColor + default clDefault; + property DetailFrameWidth: Integer read FDetailFrameWidth write SetDetailFrameWidth + default cxGridLevelDefaultDetailFrameWidth; + property DetailTabsPosition: TcxGridDetailTabsPosition read FDetailTabsPosition + write SetDetailTabsPosition default cxGridLevelDefaultDetailTabsPosition; + property TabsForEmptyDetails: Boolean read FTabsForEmptyDetails write SetTabsForEmptyDetails default True; + end; + + TcxGridLevelGetOwnTabStyleEvent = procedure(Sender: TcxGridLevel; + AMasterRecord: TcxCustomGridRecord; var AStyle: TcxStyle) of object; + TcxGridLevelGetTabStyleEvent = procedure(Sender, ATabLevel: TcxGridLevel; + {$IFDEF BCB}var{$ELSE}out{$ENDIF} AStyle: TcxStyle) of object; + + TcxGridLevelStylesClass = class of TcxGridLevelStyles; + + TcxGridLevelStyles = class(TcxStyles) + private + FOnGetOwnTabStyle: TcxGridLevelGetOwnTabStyleEvent; + FOnGetTabStyle: TcxGridLevelGetTabStyleEvent; + function GetLevel: TcxGridLevel; + function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; + protected + procedure Changed(AIndex: Integer); override; + procedure DoGetOwnTabStyle(AMasterRecord: TcxCustomGridRecord; var AStyle: TcxStyle); virtual; + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter; + public + property Level: TcxGridLevel read GetLevel; + procedure GetTabDefaultParams(out AParams: TcxViewParams); + procedure GetTabParams(ARecord: TcxCustomGridRecord; ATabLevel: TcxGridLevel; + out AParams: TcxViewParams); virtual; + published + property Tab: TcxStyle index lsTab read GetValue write SetValue; + property TabsBackground: TcxStyle index lsTabsBackground read GetValue write SetValue; + property OnGetOwnTabStyle: TcxGridLevelGetOwnTabStyleEvent read FOnGetOwnTabStyle write FOnGetOwnTabStyle; + property OnGetTabStyle: TcxGridLevelGetTabStyleEvent read FOnGetTabStyle write FOnGetTabStyle; + end; + + TcxGridLevelGetGridViewEvent = procedure(Sender: TcxGridLevel; AMasterRecord: TcxCustomGridRecord; + var AGridView: TcxCustomGridView) of object; + + TcxGridLevelChangeKind = (lcName, lcCaption, lcGridView, lcStructure, lcVisibility); + + TcxGridLevelClass = class of TcxGridLevel; + + TcxGridLevel = class(TcxComponent) + private + FCaption: string; + FControl: TcxControl; // TcxCustomGrid; + FDataRelation: TcxCustomDataRelation; + FGridView: TcxCustomGridView; + FImageIndex: TImageIndex; + FItems: TList; + FMaxDetailHeight: Integer; + FOptions: TcxGridLevelOptions; + FParent: TcxGridLevel; + FStyles: TcxGridLevelStyles; + FVisible: Boolean; + FVisibleItems: TList; + FSubClassEvents: TNotifyEvent; + FOnGetGridView: TcxGridLevelGetGridViewEvent; + + function GetActive: Boolean; + function GetActuallyVisible: Boolean; + function GetCanBeVisible: Boolean; + function GetCount: Integer; + function GetIndex: Integer; + function GetIsLoading: Boolean; + function GetIsMaster: Boolean; + function GetIsRoot: Boolean; + function GetIsTop: Boolean; + function GetItem(Index: Integer): TcxGridLevel; + function GetLevel: Integer; + function GetVisibleCount: Integer; + function GetVisibleIndex: Integer; + function GetVisibleItem(Index: Integer): TcxGridLevel; + procedure SetActive(Value: Boolean); + procedure SetCaption(const Value: string); + procedure SetGridView(Value: TcxCustomGridView); + procedure SetImageIndex(Value: TImageIndex); + procedure SetIndex(Value: Integer); + procedure SetMaxDetailHeight(Value: Integer); + procedure SetParent(Value: TcxGridLevel); + procedure SetStyles(Value: TcxGridLevelStyles); + procedure SetVisible(Value: Boolean); + + procedure AddItem(AItem: TcxGridLevel); + procedure RemoveItem(AItem: TcxGridLevel); + procedure ChangeItemIndex(AItem: TcxGridLevel; Value: Integer); + function GetItemIndex(AItem: TcxGridLevel): Integer; + procedure DestroyItems; + procedure RefreshVisibleItemsList; + + procedure AddDataRelation(AItem: TcxGridLevel); + procedure MoveDataRelation(AItem: TcxGridLevel; AIndex: Integer); + procedure RemoveDataRelation(AItem: TcxGridLevel); + protected + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + procedure SetChildOrder(Child: TComponent; Order: Integer); override; + procedure SetName(const NewName: TComponentName); override; + procedure SetParentComponent(Value: TComponent); override; + + function CreateLinkObject(ARelation: TcxCustomDataRelation; + ARecordIndex: Integer): TcxCustomGridView; virtual; + procedure Changed(AHardChange: Boolean = True); virtual; + procedure CheckHeight(var Value: Integer); virtual; + function GetDisplayCaption: string; virtual; + function GetItemClass: TcxGridLevelClass; virtual; + function GetOptionsClass: TcxGridLevelOptionsClass; virtual; + function GetStylesClass: TcxGridLevelStylesClass; virtual; + procedure ItemVisibleChanged(AItem: TcxGridLevel); virtual; + procedure NotifyControl(AChangeKind: TcxGridLevelChangeKind); + procedure SetupMasterRelation(AVisible, AIsPattern: Boolean); + + property IsLoading: Boolean read GetIsLoading; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function GetParentComponent: TComponent; override; + function HasParent: Boolean; override; + + function Add: TcxGridLevel; + function GetAvailableItem: TcxGridLevel; + function HasAsChild(ALevel: TcxGridLevel): Boolean; + function MakeVisible: TcxCustomGridView; + + property Active: Boolean read GetActive write SetActive; + property ActuallyVisible: Boolean read GetActuallyVisible; + property CanBeVisible: Boolean read GetCanBeVisible; + property Control: TcxControl read FControl write FControl; + property Count: Integer read GetCount; + property DataRelation: TcxCustomDataRelation read FDataRelation; + property DisplayCaption: string read GetDisplayCaption; + property Index: Integer read GetIndex write SetIndex; + property IsMaster: Boolean read GetIsMaster; + property IsRoot: Boolean read GetIsRoot; + property IsTop: Boolean read GetIsTop; + property Items[Index: Integer]: TcxGridLevel read GetItem; default; + property Level: Integer read GetLevel; + property Parent: TcxGridLevel read FParent write SetParent; + property VisibleCount: Integer read GetVisibleCount; + property VisibleIndex: Integer read GetVisibleIndex; + property VisibleItems[Index: Integer]: TcxGridLevel read GetVisibleItem; + published + property Caption: string read FCaption write SetCaption; + property GridView: TcxCustomGridView read FGridView write SetGridView; + property ImageIndex: TImageIndex read FImageIndex write SetImageIndex default -1; + property MaxDetailHeight: Integer read FMaxDetailHeight write SetMaxDetailHeight default 0; + property Options: TcxGridLevelOptions read FOptions write FOptions; + property Styles: TcxGridLevelStyles read FStyles write SetStyles; + property Visible: Boolean read FVisible write SetVisible default True; + property StylesEvents: TNotifyEvent read FSubClassEvents write FSubClassEvents; + property OnGetGridView: TcxGridLevelGetGridViewEvent read FOnGetGridView write FOnGetGridView; + end; + + { TcxGridLevelAccess } + + TcxGridLevelAccess = class + public + class procedure CheckHeight(AInstance: TcxGridLevel; var Value: Integer); + class function CreateLinkObject(AInstance: TcxGridLevel; + ARelation: TcxCustomDataRelation; ARecordIndex: Integer): TcxCustomGridView; + end; + +var + cxGridTabAccelSupport: Boolean = True; + +implementation + +uses + SysUtils, Menus, cxGrid, cxGridStrs; + +type + TcxCustomGridAccess = class(TcxCustomGrid); + TcxCustomGridViewAccess = class(TcxCustomGridView); + +{ TcxGridLevelOptions } + +constructor TcxGridLevelOptions.Create(ALevel: TcxGridLevel); +begin + inherited Create; + FLevel := ALevel; + FDetailFrameColor := clDefault; + FDetailFrameWidth := cxGridLevelDefaultDetailFrameWidth; + FDetailTabsPosition := cxGridLevelDefaultDetailTabsPosition; + FTabsForEmptyDetails := True; +end; + +procedure TcxGridLevelOptions.SetDetailFrameColor(Value: TColor); +begin + if FDetailFrameColor <> Value then + begin + FDetailFrameColor := Value; + Changed(False); + end; +end; + +procedure TcxGridLevelOptions.SetDetailFrameWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FDetailFrameWidth <> Value then + begin + FDetailFrameWidth := Value; + Changed; + end; +end; + +procedure TcxGridLevelOptions.SetDetailTabsPosition(Value: TcxGridDetailTabsPosition); +begin + if FDetailTabsPosition <> Value then + begin + FDetailTabsPosition := Value; + Changed; + end; +end; + +procedure TcxGridLevelOptions.SetTabsForEmptyDetails(Value: Boolean); +begin + if FTabsForEmptyDetails <> Value then + begin + FTabsForEmptyDetails := Value; + Changed; + end; +end; + +procedure TcxGridLevelOptions.Changed(AHardChange: Boolean = True); +begin + FLevel.Changed(AHardChange); +end; + +function TcxGridLevelOptions.GetDetailFrameColor: TColor; +begin + Result := FDetailFrameColor; + if Result = clDefault then + Result := TcxCustomGrid(FLevel.Control).LookAndFeelPainter.DefaultFixedSeparatorColor; +end; + +{ TcxGridLevelStyles } + +function TcxGridLevelStyles.GetLevel: TcxGridLevel; +begin + Result := TcxGridLevel(GetOwner); +end; + +function TcxGridLevelStyles.GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := TcxCustomGrid(Level.Control).LookAndFeelPainter;; +end; + +procedure TcxGridLevelStyles.Changed(AIndex: Integer); +begin + inherited; + Level.Changed; +end; + +procedure TcxGridLevelStyles.DoGetOwnTabStyle(AMasterRecord: TcxCustomGridRecord; + var AStyle: TcxStyle); +begin + if Assigned(FOnGetOwnTabStyle) then + FOnGetOwnTabStyle(Level, AMasterRecord, AStyle); +end; + +procedure TcxGridLevelStyles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +begin + inherited; + AParams.Font := TcxCustomGrid(Level.Control).Font; + with LookAndFeelPainter, AParams do + case Index of + lsTab: + begin + Color := DefaultTabColor; + TextColor := DefaultTabTextColor; + end; + lsTabsBackground: + Color := {$IFDEF USETABCONTROL}clDefault{$ELSE}DefaultTabsBackgroundColor{$ENDIF}; + end; +end; + +procedure TcxGridLevelStyles.GetTabDefaultParams(out AParams: TcxViewParams); +begin + GetDefaultViewParams(lsTab, nil, AParams); +end; + +procedure TcxGridLevelStyles.GetTabParams(ARecord: TcxCustomGridRecord; + ATabLevel: TcxGridLevel; out AParams: TcxViewParams); +var + AStyle: TcxStyle; +begin + AStyle := nil; + if Assigned(FOnGetTabStyle) then FOnGetTabStyle(Level, ATabLevel, AStyle); + ATabLevel.Styles.DoGetOwnTabStyle(ARecord, AStyle); + GetViewParams(lsTab, nil, AStyle, AParams); +end; + +{ TcxGridLevel } + +constructor TcxGridLevel.Create(AOwner: TComponent); +begin + inherited; + FImageIndex := -1; + FItems := TList.Create; + FOptions := GetOptionsClass.Create(Self); + FStyles := GetStylesClass.Create(Self); + FVisible := True; + FVisibleItems := TList.Create; +end; + +destructor TcxGridLevel.Destroy; +begin + if not (FControl.IsLoading or FControl.IsDestroying) and IsDesigning then + TcxCustomGrid(FControl).StructureNavigator.UnselectObject(Self); + DestroyItems; + GridView := nil; + if FParent <> nil then + FParent.RemoveItem(Self); + FVisibleItems.Free; + FItems.Free; + FStyles.Free; + FOptions.Free; + inherited; +end; + +function TcxGridLevel.GetActive: Boolean; +begin + Result := TcxCustomGrid(FControl).ActiveLevel = Self; +end; + +function TcxGridLevel.GetActuallyVisible: Boolean; +begin + Result := FVisible and (not IsTop or Active) and + ((FParent = nil) or FParent.ActuallyVisible); +end; + +function TcxGridLevel.GetCanBeVisible: Boolean; +begin + Result := FVisible and ((FParent = nil) or FParent.CanBeVisible); +end; + +function TcxGridLevel.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxGridLevel.GetIndex: Integer; +begin + Result := FParent.GetItemIndex(Self); +end; + +function TcxGridLevel.GetIsLoading: Boolean; +begin + Result := csLoading in ComponentState; +end; + +function TcxGridLevel.GetIsMaster: Boolean; +begin + Result := VisibleCount <> 0; +end; + +function TcxGridLevel.GetIsRoot: Boolean; +begin + Result := TcxCustomGrid(FControl).Levels = Self; +end; + +function TcxGridLevel.GetIsTop: Boolean; +begin + Result := FParent = TcxCustomGrid(FControl).Levels; +end; + +function TcxGridLevel.GetItem(Index: Integer): TcxGridLevel; +begin + Result := TcxGridLevel(FItems[Index]); +end; + +function TcxGridLevel.GetLevel: Integer; +var + AParent: TcxGridLevel; +begin + Result := -1; + AParent := Parent; + while AParent <> nil do + begin + Inc(Result); + AParent := AParent.Parent; + end; +end; + +function TcxGridLevel.GetVisibleCount: Integer; +begin + Result := FVisibleItems.Count; +end; + +function TcxGridLevel.GetVisibleIndex: Integer; +begin + Result := FParent.FVisibleItems.IndexOf(Self); +end; + +function TcxGridLevel.GetVisibleItem(Index: Integer): TcxGridLevel; +begin + Result := TcxGridLevel(FVisibleItems[Index]); +end; + +procedure TcxGridLevel.SetActive(Value: Boolean); +begin + if Active <> Value then + if Value then + if IsTop then + TcxCustomGrid(FControl).ActiveLevel := Self + else + else + TcxCustomGrid(FControl).ActiveLevel := nil; +end; + +procedure TcxGridLevel.SetCaption(const Value: string); +begin + if FCaption <> Value then + begin + FCaption := Value; + Changed; + NotifyControl(lcCaption); + end; +end; + +procedure TcxGridLevel.SetGridView(Value: TcxCustomGridView); +var + I: Integer; + APrevGridView: TcxCustomGridView; + + procedure CheckFocusedGridView; + begin + if FGridView <> nil then + if (APrevGridView = nil) and (TcxCustomGrid(FControl).FocusedView = nil) or + (APrevGridView <> nil) and APrevGridView.Focused then + FGridView.Focused := True + else + else + APrevGridView.Focused := False; + end; + +begin + if FGridView <> Value then + begin + if (Value <> nil) and (Value.Level <> nil) then + TcxGridLevel(Value.Level).GridView := nil; + if FGridView <> nil then + begin + FGridView.BeginUpdate; + try + for I := 0 to Count - 1 do + RemoveDataRelation(Items[I]); + finally + //FGridView.EndUpdate; + FGridView.CancelUpdate; + end; + TcxCustomGridViewAccess(FGridView).SetLevel(nil); + end; + APrevGridView := FGridView; + FGridView := Value; + if FGridView <> nil then + FGridView.Control := Control; {5} + if FParent <> nil then + FParent.RefreshVisibleItemsList; + + if FGridView <> nil then FGridView.BeginUpdate; + try + if APrevGridView <> nil then + APrevGridView.DataController.SetMasterMode(nil, True); + if FGridView <> nil then + begin + TcxCustomGridViewAccess(FGridView).SetLevel(Self); + SetupMasterRelation(FVisible, not IsTop); + for I := 0 to Count - 1 do + AddDataRelation(Items[I]); + end; + Changed(False); {5} + finally + if FGridView <> nil then FGridView.EndUpdate; + + CheckFocusedGridView; + if APrevGridView <> nil then + APrevGridView.Control := APrevGridView.StorageControl; + NotifyControl(lcGridView); + end; + end; +end; + +procedure TcxGridLevel.SetImageIndex(Value: TImageIndex); +begin + if Value < -1 then Value := -1; + if FImageIndex <> Value then + begin + FImageIndex := Value; + Changed; + end; +end; + +procedure TcxGridLevel.SetIndex(Value: Integer); +begin + FParent.ChangeItemIndex(Self, Value); +end; + +procedure TcxGridLevel.SetMaxDetailHeight(Value: Integer); +begin + if Value < 0 then Value := 0; + if FMaxDetailHeight <> Value then + begin + FMaxDetailHeight := Value; + Changed; + end; +end; + +procedure TcxGridLevel.SetParent(Value: TcxGridLevel); +begin + if FParent <> Value then + begin + TcxCustomGrid(Control).BeginUpdate; + try + if (Value <> nil) and ((Value = Self) or HasAsChild(Value)) then + raise Exception.Create(scxGridRecursiveLevels); + if FParent <> nil then + FParent.RemoveItem(Self); + if Value <> nil then + Value.AddItem(Self); + finally + TcxCustomGrid(Control).EndUpdate; + end; + end; +end; + +procedure TcxGridLevel.SetStyles(Value: TcxGridLevelStyles); +begin + FStyles.Assign(Value); +end; + +procedure TcxGridLevel.SetVisible(Value: Boolean); +begin + if FVisible <> Value then + begin + {if Value and (FGridView <> nil) then + SetupMasterRelation(Value, not IsTop);} + FVisible := Value; + if Value and (FGridView <> nil) then + SetupMasterRelation(Value, not IsTop); + if FParent <> nil then + FParent.ItemVisibleChanged(Self); + if FVisible then + if TcxCustomGrid(FControl).ActiveLevel = nil then + Active := True + else + else + Active := False; + Changed; + TcxCustomGrid(Control).CheckFocusedView; + if not Value and (FGridView <> nil) then + SetupMasterRelation(Value, not IsTop); + NotifyControl(lcVisibility); + end; +end; + +procedure TcxGridLevel.AddItem(AItem: TcxGridLevel); +begin + TcxCustomGrid(Control).BeginUpdate; + try + FItems.Add(AItem); + AItem.FControl := FControl; + AItem.FParent := Self; + RefreshVisibleItemsList; + AddDataRelation(AItem); + if IsRoot and (TcxCustomGrid(FControl).ActiveLevel = nil) then + TcxCustomGrid(FControl).ActiveLevel := GetAvailableItem; + Changed; + finally + TcxCustomGrid(Control).EndUpdate; + end; + NotifyControl(lcStructure); +end; + +procedure TcxGridLevel.RemoveItem(AItem: TcxGridLevel); +begin + TcxCustomGrid(Control).BeginUpdate; + try + FItems.Remove(AItem); + FVisibleItems.Remove(AItem); + AItem.FParent := nil; + RemoveDataRelation(AItem); + AItem.Active := False; + Changed; + finally + TcxCustomGrid(Control).EndUpdate; + end; + NotifyControl(lcStructure); +end; + +procedure TcxGridLevel.ChangeItemIndex(AItem: TcxGridLevel; Value: Integer); +begin + if Value < 0 then Value := 0; + if Value >= Count then Value := Count - 1; + FItems.Move(AItem.Index, Value); + RefreshVisibleItemsList; + MoveDataRelation(AItem, Value); + Changed; + NotifyControl(lcStructure); +end; + +function TcxGridLevel.GetItemIndex(AItem: TcxGridLevel): Integer; +begin + Result := FItems.IndexOf(AItem); +end; + +procedure TcxGridLevel.DestroyItems; +var + I: Integer; +begin + for I := Count - 1 downto 0 do + Items[I].Free; +end; + +procedure TcxGridLevel.RefreshVisibleItemsList; +var + I: Integer; +begin + FVisibleItems.Clear; + for I := 0 to Count - 1 do + if Items[I].Visible then + FVisibleItems.Add(Items[I]); +end; + +procedure TcxGridLevel.AddDataRelation(AItem: TcxGridLevel); +begin + if FGridView <> nil then + begin + AItem.FDataRelation := FGridView.DataController.Relations.Add(AItem); + with AItem do + if GridView <> nil then + SetupMasterRelation(Visible, GridView.DataController.IsPattern); + end; +end; + +procedure TcxGridLevel.MoveDataRelation(AItem: TcxGridLevel; AIndex: Integer); +begin + if FGridView <> nil then + FGridView.DataController.Relations.Move(AItem.DataRelation.Index, AIndex); +end; + +procedure TcxGridLevel.RemoveDataRelation(AItem: TcxGridLevel); +begin + FreeAndNil(AItem.FDataRelation); +end; + +procedure TcxGridLevel.GetChildren(Proc: TGetChildProc; Root: TComponent); +var + I: Integer; +begin + inherited; + for I := 0 to Count - 1 do + if Items[I].Owner = Root then + Proc(Items[I]); +end; + +procedure TcxGridLevel.SetChildOrder(Child: TComponent; Order: Integer); +begin + inherited; + if Child is TcxGridLevel then + TcxGridLevel(Child).Index := Order; +end; + +procedure TcxGridLevel.SetName(const NewName: TComponentName); +begin + inherited; + NotifyControl(lcName); +end; + +procedure TcxGridLevel.SetParentComponent(Value: TComponent); +begin + inherited; + if Value is TcxCustomGrid then + TcxCustomGrid(Value).Levels.AddItem(Self) + else + if Value is TcxGridLevel then + TcxGridLevel(Value).AddItem(Self); +end; + +procedure TcxGridLevel.Changed(AHardChange: Boolean); +begin + if FControl = nil then Exit; + if AHardChange then + TcxCustomGrid(FControl).SizeChanged + else + TcxCustomGrid(FControl).LayoutChanged +end; + +function TcxGridLevel.GetItemClass: TcxGridLevelClass; +begin + Result := TcxGridLevel; +end; + +function TcxGridLevel.GetOptionsClass: TcxGridLevelOptionsClass; +begin + Result := TcxGridLevelOptions; +end; + +function TcxGridLevel.GetStylesClass: TcxGridLevelStylesClass; +begin + Result := TcxGridLevelStyles; +end; + +procedure TcxGridLevel.ItemVisibleChanged(AItem: TcxGridLevel); +var + APrevVisibleCount: Integer; +begin + APrevVisibleCount := VisibleCount; + RefreshVisibleItemsList; + if FGridView <> nil then + TcxCustomGridViewAccess(FGridView).DetailVisibleChanged(AItem, + APrevVisibleCount, VisibleCount); +end; + +procedure TcxGridLevel.NotifyControl(AChangeKind: TcxGridLevelChangeKind); +begin + TcxCustomGridAccess(FControl).LevelChanged(Self, AChangeKind); +end; + +procedure TcxGridLevel.SetupMasterRelation(AVisible, AIsPattern: Boolean); +begin + if AVisible then + FGridView.DataController.SetMasterMode(FDataRelation, AIsPattern) + else + FGridView.DataController.SetMasterMode(nil, True); +end; + +function TcxGridLevel.GetParentComponent: TComponent; +begin + if IsTop then + Result := FControl + else + Result := FParent; +end; + +function TcxGridLevel.HasParent: Boolean; +begin + Result := True; +end; + +function TcxGridLevel.Add: TcxGridLevel; +begin + Result := GetItemClass.Create(FControl.Owner); + AddItem(Result); +end; + +function TcxGridLevel.GetAvailableItem: TcxGridLevel; +begin + if (VisibleCount = 0) or Control.IsDestroying then + Result := nil + else + Result := VisibleItems[0]; +end; + +function TcxGridLevel.HasAsChild(ALevel: TcxGridLevel): Boolean; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := (Items[I] = ALevel) or Items[I].HasAsChild(ALevel); + if Result then Exit; + end; + Result := False; +end; + +function TcxGridLevel.MakeVisible: TcxCustomGridView; +var + AParentView: TcxCustomGridView; +begin + if IsTop then + begin + Active := True; + if Active then + Result := GridView + else + Result := nil; + end + else + begin + AParentView := Parent.MakeVisible; + if AParentView = nil then + Result := nil + else + Result := AParentView.ViewData.MakeDetailVisible(Self); + end; +end; + +procedure TcxGridLevel.CheckHeight(var Value: Integer); +begin + if Value < 0 then Value := 0; + if (FMaxDetailHeight <> 0) and (Value > FMaxDetailHeight) then + Value := FMaxDetailHeight; +end; + +function TcxGridLevel.GetDisplayCaption: string; +begin + Result := Caption; + if cxGridTabAccelSupport then + Result := StripHotkey(Result); +end; + +function TcxGridLevel.CreateLinkObject(ARelation: TcxCustomDataRelation; + ARecordIndex: Integer): TcxCustomGridView; +var + AGridView: TcxCustomGridView; + + function GetMasterRecord: TcxCustomGridRecord; + var + AGridView: TcxCustomGridTableView; + begin + AGridView := (ARelation.DataController as IcxCustomGridDataController).GridView as TcxCustomGridTableView; + Result := AGridView.ViewData.GetRecordByRecordIndex(ARecordIndex); + end; + + function GetRelationsGridView: TcxCustomGridView; + begin + Result := FGridView; + if Result = nil then + Result := AGridView; + end; + +begin + AGridView := FGridView; + if Assigned(FOnGetGridView) then FOnGetGridView(Self, GetMasterRecord, AGridView); + if (AGridView = nil) or not Visible then + Result := nil + else + begin + Result := TcxCustomGridViewClass(AGridView.ClassType).CreateCloned(FControl); + Result.BeginUpdate; + try + TcxCustomGridViewAccess(Result).AssignPattern(AGridView); + Result.DataController.Relations.BeginUpdate; + try + Result.DataController.Relations.Assign(GetRelationsGridView.DataController.Relations); + Result.DataController.SetMasterRelation(ARelation, ARecordIndex); + finally + Result.DataController.Relations.EndUpdate; + end; + TcxCustomGridViewAccess(Result).SetLevel(Self); + finally + Result.CancelUpdate; + end; + TcxCustomGridViewAccess(AGridView).AddClone(Result); + end; +end; + +{ TcxGridLevelAccess } + +class procedure TcxGridLevelAccess.CheckHeight(AInstance: TcxGridLevel; + var Value: Integer); +begin + AInstance.CheckHeight(Value); +end; + +class function TcxGridLevelAccess.CreateLinkObject(AInstance: TcxGridLevel; + ARelation: TcxCustomDataRelation; ARecordIndex: Integer): TcxCustomGridView; +begin + Result := AInstance.CreateLinkObject(ARelation, ARecordIndex); +end; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridMenuOperations.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridMenuOperations.pas new file mode 100644 index 00000000..74f960f0 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridMenuOperations.pas @@ -0,0 +1,393 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid Utils } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridMenuOperations; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Classes, ImgList, cxClasses, cxCustomData, cxGridCustomView, cxGridTableView, + cxGridCustomPopupMenu, cxGridPopupMenu, cxGridUIHelper; + +type + TcxGridPopupMenuOperation = class; + + TcxGridPopupMenuOperationClass = class of TcxGridPopupMenuOperation; + + TcxGridPopupMenuOperationState = (pmoDefault, pmoTrue, pmoFalse); + + TcxGetStateFunc = function : Boolean of object; + + TcxGridPopupMenuOperation = class + private + FBeginGroup: Boolean; + FDownState: TcxGridPopupMenuOperationState; + FEnabledState: TcxGridPopupMenuOperationState; + FImageIndex: Integer; + FParams: TList; + FResCaption: TcxResourceStringID; + FTag: Integer; + FVisibleState: TcxGridPopupMenuOperationState; + function GetGridOperationHelper: TcxGridOperationHelper; + function GetGridPopupMenu: TcxGridPopupMenu; + function GetHitGridView: TcxCustomGridView; + function GetState(AState: TcxGridPopupMenuOperationState; + AGetFunc: TcxGetStateFunc): boolean; + protected + procedure Execute(Sender: TObject); virtual; + function GetImageIndex: Integer; virtual; + function GetImageResourceName: string; virtual; + procedure UpdateImage; + + function GetCaption: string; virtual; + + function GetDown: Boolean; virtual; + function GetCheckedState: Boolean; virtual; + + function GetEnabled: Boolean; virtual; + function GetEnabledState: Boolean; virtual; + + function GetVisible: Boolean; virtual; + function GetVisibleState: Boolean; virtual; + + property GridOperationHelper: TcxGridOperationHelper read GetGridOperationHelper; + + property Params: TList read FParams; + property ResCaption: TcxResourceStringID read FResCaption write FResCaption; + property Tag: Integer read FTag write FTag; + public + constructor Create; virtual; + procedure DoExecute(Sender: TObject); + class function GetParentOperationClass: TcxGridPopupMenuOperationClass; virtual; + + property BeginGroup: Boolean read FBeginGroup write FBeginGroup; + property Caption: string read GetCaption; + property Down: Boolean read GetCheckedState; + property Enabled: Boolean read GetEnabledState; + property ImageIndex: Integer read FImageIndex write FImageIndex; + property Visible: Boolean read GetVisibleState; + + property DownState: TcxGridPopupMenuOperationState read FDownState write FDownState default pmoDefault; + property EnabledState: TcxGridPopupMenuOperationState read FEnabledState write FEnabledState default pmoDefault; + property HitGridView: TcxCustomGridView read GetHitGridView; + property GridPopupMenu: TcxGridPopupMenu read GetGridPopupMenu; + property VisibleState: TcxGridPopupMenuOperationState read FVisibleState write FVisibleState default pmoDefault; + end; + + TcxGridTablePopupMenuOperation = class(TcxGridPopupMenuOperation) + private + function GetHitGridView: TcxGridTableView; + public + property HitGridView: TcxGridTableView read GetHitGridView; + end; + + TcxGridTableColumnMenuOperation = class(TcxGridTablePopupMenuOperation) + private + function GetHitColumn: TcxGridColumn; + public + property HitColumn: TcxGridColumn read GetHitColumn; + end; + + TcxGridPopupMenuOperationsClass = class of TcxGridPopupMenuOperations; + + TcxGridPopupMenuOperations = class + private + FItems: TList; + function GetCount: Integer; + function GetItem(Index: Integer): TcxGridPopupMenuOperation; + protected + function AddItem(AItemClass: TcxGridPopupMenuOperationClass): TcxGridPopupMenuOperation; + procedure AddItems; virtual; abstract; + procedure ClearItems; + procedure RecreateItems; + public + constructor Create; virtual; + destructor Destroy; override; + function CanProcess(AHitTest: TcxCustomGridHitTest): Boolean; virtual; + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxGridPopupMenuOperation read GetItem; default; + end; + +var + cxGridPopupMenuImages: TCustomImageList; + +function GetSummaryImageResourceName(ASummaryKind: TcxSummaryKind): string; + +implementation + +{$R cxGridMenuOperations.res} + +uses + SysUtils, Graphics, cxGridPopupMenuConsts; + +type + TcxGridPopupMenuAccess = class(TcxGridPopupMenu); + +var + FOperationImageResourceNames: TStringList; + +function OperationImageResourceNames: TStringList; +begin + if FOperationImageResourceNames = nil then + FOperationImageResourceNames := TStringList.Create; + Result := FOperationImageResourceNames; +end; + +function GetSummaryImageResourceName(ASummaryKind: TcxSummaryKind): string; +begin + if ASummaryKind = skNone then + Result := '' + else + Result := 'FtrImg' + IntToStr(Ord(ASummaryKind)); +end; + +{ TcxGridPopupMenuOperation } + +constructor TcxGridPopupMenuOperation.Create; +begin + inherited; + FDownState := pmoDefault; + FEnabledState := pmoDefault; + UpdateImage; + FVisibleState := pmoDefault; + FResCaption := @cxSGridNone; +end; + +procedure TcxGridPopupMenuOperation.DoExecute(Sender: TObject); +var + AHandled: Boolean; + AHandler: TNotifyEvent; +begin + AHandled := True; + AHandler := Execute; + FParams := TList.Create; + try + if Assigned(GridPopupMenu.OnMenuItemClick) then + GridPopupMenu.OnMenuItemClick(Sender, GridPopupMenu.HitTest, AHandler, + FParams, AHandled); + if AHandled then AHandler(Sender); + finally + FreeAndNil(FParams); + end; +end; + +procedure TcxGridPopupMenuOperation.Execute(Sender: TObject); +begin +end; + +function TcxGridPopupMenuOperation.GetImageIndex: Integer; +var + B: TBitmap; +begin + Result := -1; + if GetImageResourceName = '' then Exit; + Result := OperationImageResourceNames.IndexOf(GetImageResourceName); + if Result = -1 then + begin + B := TBitmap.Create; + try + B.LoadFromResourceName(HInstance, GetImageResourceName); + if cxGridPopupMenuImages = nil then + cxGridPopupMenuImages := TCustomImageList.CreateSize(B.Width, B.Height); + cxGridPopupMenuImages.AddMasked(B, clDefault); + finally + B.Free; + end; + Result := cxGridPopupMenuImages.Count - 1; + + while OperationImageResourceNames.Count < Result + 1 do + OperationImageResourceNames.Add(''); + OperationImageResourceNames[Result] := GetImageResourceName; + end; +end; + +function TcxGridPopupMenuOperation.GetImageResourceName: string; +begin + Result := ''; +end; + +procedure TcxGridPopupMenuOperation.UpdateImage; +begin + FImageIndex := GetImageIndex; +end; + +class function TcxGridPopupMenuOperation.GetParentOperationClass: TcxGridPopupMenuOperationClass; +begin + Result := nil; +end; + +function TcxGridPopupMenuOperation.GetDown: Boolean; +begin + Result := False; +end; + +function TcxGridPopupMenuOperation.GetCheckedState: Boolean; +begin + Result := GetState(FDownState, GetDown); +end; + +function TcxGridPopupMenuOperation.GetEnabled: Boolean; +begin + Result := True; +end; + +function TcxGridPopupMenuOperation.GetEnabledState: Boolean; +begin + Result := GetState(FEnabledState, GetEnabled); +end; + +function TcxGridPopupMenuOperation.GetVisible: Boolean; +begin + Result := True; +end; + +function TcxGridPopupMenuOperation.GetVisibleState: Boolean; +begin + Result := GetState(FVisibleState, GetVisible); +end; + +function TcxGridPopupMenuOperation.GetCaption: string; +begin + Result := cxGetResourceString(FResCaption); +end; + +function TcxGridPopupMenuOperation.GetGridOperationHelper: TcxGridOperationHelper; +begin + Result := TcxGridPopupMenuAccess(GridPopupMenu).GridOperationHelper; +end; + +function TcxGridPopupMenuOperation.GetGridPopupMenu: TcxGridPopupMenu; +begin + Result := TcxGridPopupMenu(ActiveGridPopupMenu); +end; + +function TcxGridPopupMenuOperation.GetHitGridView: TcxCustomGridView; +begin + Result := GridPopupMenu.HitGridView; +end; + +function TcxGridPopupMenuOperation.GetState(AState: TcxGridPopupMenuOperationState; + AGetFunc: TcxGetStateFunc): boolean; +begin + case AState of + pmoTrue: + Result := True; + pmoFalse: + Result := False; + else + Result := AGetFunc; + end; +end; + +{ TcxGridTablePopupMenuOperation } + +function TcxGridTablePopupMenuOperation.GetHitGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited HitGridView); +end; + +{ TcxGridTableColumnMenuOperation } + +function TcxGridTableColumnMenuOperation.GetHitColumn: TcxGridColumn; +begin + if GridPopupMenu.HitTest is TcxCustomGridColumnHitTest then + Result := TcxCustomGridColumnHitTest(GridPopupMenu.HitTest).Column + else + Result := nil; +end; + +{ TcxGridPopupMenuOperations } + +constructor TcxGridPopupMenuOperations.Create; +begin + inherited; + FItems := TList.Create; + AddItems; +end; + +destructor TcxGridPopupMenuOperations.Destroy; +begin + ClearItems; + FItems.Free; + inherited; +end; + +function TcxGridPopupMenuOperations.GetItem(Index: Integer): TcxGridPopupMenuOperation; +begin + Result := TcxGridPopupMenuOperation(FItems[Index]); +end; + +function TcxGridPopupMenuOperations.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxGridPopupMenuOperations.AddItem(AItemClass: TcxGridPopupMenuOperationClass): TcxGridPopupMenuOperation; +begin + Result := AItemClass.Create; + FItems.Add(Result); +end; + +procedure TcxGridPopupMenuOperations.ClearItems; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].Free; + FItems.Clear; +end; + +procedure TcxGridPopupMenuOperations.RecreateItems; +begin + ClearItems; + AddItems; +end; + +function TcxGridPopupMenuOperations.CanProcess(AHitTest: TcxCustomGridHitTest): Boolean; +begin + Result := True; +end; + +initialization + +finalization + FreeAndNil(FOperationImageResourceNames); + FreeAndNil(cxGridPopupMenuImages); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridMenuOperations.res b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridMenuOperations.res new file mode 100644 index 00000000..d726fd87 Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridMenuOperations.res differ diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridPopupMenu.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridPopupMenu.pas new file mode 100644 index 00000000..b3f3edf3 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridPopupMenu.pas @@ -0,0 +1,481 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid Utils } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridPopupMenu; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, +{$IFDEF DELPHI6} + Types, +{$ENDIF} + SysUtils, Classes, Controls, cxGrid, cxGridCustomView, + cxGridUIHelper, cxGridUICustomTableHelper, cxGridUITableHelper, + cxGridUIBandedTableHelper, cxGridUICardHelper, cxGridCustomPopupMenu; + +type + TcxGridPopupMenu = class(TcxCustomGridPopupMenu) + private + FAlwaysFireOnPopup: Boolean; + FGrid: TcxGrid; + FGridDefaultPopupMenu: TcxGridDefaultPopupMenu; + FGridOperationHelper: TcxGridOperationHelper; + FHitGridView: TcxCustomGridView; + FHitPoint: TPoint; + FHitTest: TcxCustomGridHitTest; + FHitType: TcxGridViewHitType; + FMouseupNotification: TcxCustomGridNotification; + FOnClick: TcxGridPopupMenuItemClickProc; + FOnPopup: TcxGridBeforePopupProc; + FUseBuiltInPopupMenus: Boolean; + procedure CreateBuiltInPopupMenus; + procedure FreeBuiltInPopupMenus; + function GetPopupMenus: TcxPopupMenuInfos; + procedure SetUseBuiltInPopupMenus(const Value: Boolean); + procedure SetGrid(const AValue: TcxGrid); + procedure SetPopupMenus(const AValue: TcxPopupMenuInfos); + function TryPopupAsIcxPopupMenuIntf(APopupMenu: TComponent; + AHitTest: TcxCustomGridHitTest; APoint: TPoint): Boolean; + function TryPopupAsIDoPopupIntf(APopupMenu: TComponent; + AHitTest: TcxCustomGridHitTest; APoint: TPoint): Boolean; + function TryPopupAsVCLPopupMenu(APopupMenu: TComponent; + AHitTest: TcxCustomGridHitTest; APoint: TPoint): Boolean; + protected + function DoOnPopup(ASenderMenu: TComponent; + AHitTest: TcxCustomGridHitTest; X,Y: Integer): Boolean; virtual; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + function DoPopup(AAPPSKeyPressed: Boolean): Boolean; virtual; + function GetPopupMenuInfo(const AMenu: TComponent; const AView: TcxCustomGridView; + SearchDefault: Boolean = True): TcxPopupMenuInfo; override; + property GridOperationHelper: TcxGridOperationHelper read FGridOperationHelper; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function CheckShortCuts(var Message: TWMKeyDown): Boolean; override; + function FindPopupMenuInfo(const AView: TcxCustomGridView; + AHitType: TcxGridViewHitType; AHitTest: TcxCustomGridHitTest): TcxPopupMenuInfo; override; + function GetBuiltInPopupMenuByClass(const AMenuClass: TcxPopupMenuClass): TComponent; + procedure RegisterPopupMenu(const AMenu: TComponent; AHitTypes: TcxGridViewHitTypes; + ADoPopupProc: TcxGridOnPopupProc; const AView: TcxCustomGridView); overload; virtual; + procedure RegisterPopupMenu(const AMenu: TComponent; AHitTypes: TcxGridViewHitTypes; + ADoPopupProc: TcxGridOnPopupProc; AViewClass: TcxCustomGridViewClass); overload; virtual; + procedure UnregisterPopupMenu(const AMenu: TComponent; const AGridView: TcxCustomGridView; + AHitTypes: TcxGridViewHitTypes = []); overload; virtual; + procedure UnregisterPopupMenu(const AMenu: TComponent; AGridViewClass: TcxCustomGridViewClass; + AHitTypes: TcxGridViewHitTypes = []); overload; virtual; + property BuiltInPopupMenus: TcxGridDefaultPopupMenu read FGridDefaultPopupMenu; + property HitGridView: TcxCustomGridView read FHitGridView; + property HitPoint: TPoint read FHitPoint; + property HitTest: TcxCustomGridHitTest read FHitTest; + property HitType: TcxGridViewHitType read FHitType; + published + property Grid: TcxGrid read FGrid write SetGrid; + property PopupMenus: TcxPopupMenuInfos read GetPopupMenus write SetPopupMenus; + property UseBuiltInPopupMenus: Boolean read FUseBuiltInPopupMenus write + SetUseBuiltInPopupMenus default True; + property OnMenuItemClick: TcxGridPopupMenuItemClickProc read FOnClick write FOnClick; + property OnPopup: TcxGridBeforePopupProc read FOnPopup write FOnPopup; + property AlwaysFireOnPopup: Boolean read FAlwaysFireOnPopup write FAlwaysFireOnPopup default False; + end; + +var + ActiveGridPopupMenu: TcxGridPopupMenu; + +implementation + +uses + Forms, cxGridLevel, Dialogs, cxGridStdPopupMenu, Menus, cxGridCustomTableView, cxControls; + +type + TcxGridContextPopupNotification = class(TcxCustomGridNotification) + private + FGridPopupMenu: TcxGridPopupMenu; + protected + procedure Notify(AKind: TcxGridNotificationKind; AData: TObject; var AHandled: Boolean); override; + function NotificationKinds: TcxGridNotificationKinds; override; + end; + + PWMKeyDown = ^TWMKeyDown; + TcxCustomGridCellViewInfoAccess = class(TcxCustomGridCellViewInfo); + TcxCustomGridViewInfoAccess = class(TcxCustomGridViewInfo); + +procedure TcxGridContextPopupNotification.Notify(AKind: TcxGridNotificationKind; + AData: TObject; var AHandled: Boolean); +begin + case (AKind) of + gnkContextMenu: + begin + Application.ProcessMessages; + AHandled := FGridPopupMenu.DoPopup(Boolean(AData)); + end; + gnkKeyDown: + begin + FGridPopupMenu.CheckShortCuts(PWMKeyDown(AData)^); + end; + end; +end; + +function TcxGridContextPopupNotification.NotificationKinds: TcxGridNotificationKinds; +begin + Result := [gnkContextMenu, gnkKeyDown]; +end; + +{TcxGridPopupMenu} + +constructor TcxGridPopupMenu.Create (AOwner: TComponent); +begin + inherited Create(AOwner); + FAlwaysFireOnPopup := False; + FGridDefaultPopupMenu := TcxGridDefaultPopupMenu.Create(Self); + FUseBuiltInPopupMenus := True; + CreateBuiltInPopupMenus; + FGridOperationHelper := TcxGridOperationHelper.Create(Self); + FMouseupNotification := TcxGridContextPopupNotification.Create; + TcxGridContextPopupNotification(FMouseupNotification).FGridPopupMenu := self; +end; + +destructor TcxGridPopupMenu.Destroy; +begin + FreeBuiltInPopupMenus; + FreeAndNil(FGridOperationHelper); + FreeAndNil(FGridDefaultPopupMenu); + if Grid <> nil then + Grid.UnregisterNotification(FMouseupNotification); + FreeAndNil(FMouseupNotification); + inherited Destroy; +end; + +function TcxGridPopupMenu.CheckShortCuts(var Message: TWMKeyDown): Boolean; +begin + Result := inherited CheckShortCuts(Message); + if not Result then + Result := FGridDefaultPopupMenu.CheckShortCuts(Message); +end; + +function TcxGridPopupMenu.GetBuiltInPopupMenuByClass( + const AMenuClass: TcxPopupMenuClass): TComponent; +var + I: Integer; +begin + Result := nil; + for I := 0 to FGridDefaultPopupMenu.Count - 1 do + if Assigned(FGridDefaultPopupMenu[i].PopupMenu) and + (FGridDefaultPopupMenu[i].PopupMenu.ClassType = AMenuClass) then + begin + Result := FGridDefaultPopupMenu[i].PopupMenu; + break; + end; +end; + +function TcxGridPopupMenu.FindPopupMenuInfo(const AView: TcxCustomGridView; + AHitType: TcxGridViewHitType; AHitTest: TcxCustomGridHitTest): TcxPopupMenuInfo; +begin + Result := inherited FindPopupMenuInfo(AView, AHitType, AHitTest); + if Result = nil then + Result := FGridDefaultPopupMenu.FindPopupMenuInfo(AView, AHitType, AHitTest); +end; + +function TcxGridPopupMenu.GetPopupMenuInfo(const AMenu: TComponent; + const AView: TcxCustomGridView; SearchDefault: Boolean = True): TcxPopupMenuInfo; +var + I : Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + If (AMenu = MenuInfos[I].PopupMenu) and (AView = MenuInfos[I].GridView) then + begin + Result := MenuInfos[I]; + Result.Index := I; + break; + end; + if SearchDefault and not Assigned(Result) then + Result := FGridDefaultPopupMenu.GetPopupMenuInfo(AMenu, + TcxCustomGridViewClass(AView.ClassType)); +end; + +procedure TcxGridPopupMenu.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (AComponent = Grid) then + FGrid := nil; +end; + +procedure TcxGridPopupMenu.RegisterPopupMenu(const AMenu: TComponent; + AHitTypes: TcxGridViewHitTypes; ADoPopupProc: TcxGridOnPopupProc; + const AView: TcxCustomGridView); +begin + if not Assigned(AView) then exit; + AdjustMenuInfo(GetPopupMenuInfo(AMenu, AView), AMenu, AHitTypes, ADoPopupProc, + nil, AView); +end; + +procedure TcxGridPopupMenu.RegisterPopupMenu(const AMenu: TComponent; + AHitTypes: TcxGridViewHitTypes; ADoPopupProc: TcxGridOnPopupProc; + AViewClass: TcxCustomGridViewClass); +begin + FGridDefaultPopupMenu.RegisterPopupMenu(AMenu, AHitTypes, ADoPopupProc, AViewClass); +end; + +procedure TcxGridPopupMenu.UnregisterPopupMenu(const AMenu: TComponent; + const AGridView: TcxCustomGridView; AHitTypes: TcxGridViewHitTypes); +var + AMenuInfo: TcxPopupMenuInfo; +begin + AMenuInfo := GetPopupMenuInfo(AMenu, AGridView, false); + If (AMenuInfo <> nil) then + If AMenuInfo.HitTypes = AHitTypes then + AMenuInfo.Free + else + AMenuInfo.HitTypes := AMenuInfo.HitTypes - AHitTypes; +end; + +procedure TcxGridPopupMenu.UnregisterPopupMenu(const AMenu: TComponent; + AGridViewClass: TcxCustomGridViewClass; AHitTypes: TcxGridViewHitTypes = []); +begin + FGridDefaultPopupMenu.UnRegisterPopupMenu(AMenu, AGridViewClass, AHitTypes); +end; + +function TcxGridPopupMenu.DoOnPopup(ASenderMenu: TComponent; + AHitTest: TcxCustomGridHitTest; X, + Y: Integer): Boolean; +begin + Result := True; + if Assigned(FOnPopup) then + FOnPopup(ASenderMenu, AHitTest, X, Y, Result); +end; + +function TcxGridPopupMenu.DoPopup(AAPPSKeyPressed: Boolean): Boolean; + + function DoAutoPopup(AMenuInfo:TcxPopupMenuInfo; AHitTest: TcxCustomGridHitTest; + APoint: TPoint): Boolean; + begin + Result := Assigned(AMenuInfo.PopupMenu); + if Result then + Result := TryPopupAsIDoPopupIntf(AMenuInfo.PopupMenu, AHitTest, APoint) or + TryPopupAsIcxPopupMenuIntf(AMenuInfo.PopupMenu, AHitTest, APoint) or + TryPopupAsVCLPopupMenu(AMenuInfo.PopupMenu, AHitTest, APoint); + end; + + function DoPopupByAPPSKey(var AHitCode: Integer; var APoint: TPoint): Boolean; + var + AViewInfo: TcxCustomGridCellViewInfo; + ABounds: TRect; + begin + Result := FHitGridView is TcxCustomGridTableView; + if not Result then Exit; + with TcxCustomGridTableView(FHitGridView).Controller do + begin + if (FocusedRecord <> nil) then + begin + if not FocusedRecord.Visible then + MakeFocusedRecordVisible; + if (FocusedItem <> nil) and (FocusedItem.FocusedCellViewInfo <> nil) then + begin + ABounds := FocusedItem.FocusedCellViewInfo.ContentBounds; + AViewInfo := FocusedItem.FocusedCellViewInfo; + end + else + begin + ABounds := FocusedRecord.ViewInfo.ContentBounds; + if ABounds.Left < 0 then + ABounds.Left := 0; + AViewInfo := FocusedRecord.ViewInfo; + end; + with ABounds do + APoint := Point(Left, Bottom); + FHitTest := TcxCustomGridCellViewInfoAccess(AViewInfo).GetHitTestClass.Instance(APoint); + TcxCustomGridCellViewInfoAccess(AViewInfo).InitHitTest(FHitTest); + end + else + begin + APoint := Point(0,0); + FHitTest := TcxGridViewNoneHitTest.Instance(APoint); + TcxCustomGridViewInfoAccess(FHitGridView.Site.ViewInfo).InitHitTest(FHitTest); + end; + AHitCode := FHitTest.HitTestCode; + FHitPoint := APoint; + APoint := FHitGridView.Site.ClientToScreen(APoint); + end; + end; + + function InternalPopup(AHitType: TcxGridViewHitType; APoint: TPoint; + AHitTest: TcxCustomGridHitTest): Boolean; + var + AMenuInfo: TcxPopupMenuInfo; + begin + Result := False; + if FHitGridView = nil then Exit; + AMenuInfo := FindPopupMenuInfo(FHitGridView.PatternGridView, AHitType, AHitTest); + if AMenuInfo = nil then + Exit; + if Assigned(AMenuInfo.OnPopup) then + begin + if Assigned(AMenuInfo.PopupMenu) or FAlwaysFireOnPopup then + begin + if DoOnPopup(AMenuInfo.PopupMenu, AHitTest, APoint.X, APoint.Y) then + AMenuInfo.OnPopup(AMenuInfo.PopupMenu, AHitTest, APoint.X, APoint.Y); + Result := True; + end; + end + else + Result := DoAutoPopup(AMenuInfo, AHitTest, APoint); + end; + +var + AHitCode: Integer; + APoint: TPoint; +begin + Result := True; + FHitGridView := Grid.FocusedView; + ActiveGridPopupMenu := Self; + AHitCode := 0; + if AAPPSKeyPressed then + Result := DoPopupByAPPSKey(AHitCode, APoint) + else + begin + GetCursorPos(APoint); + FHitPoint := Grid.ScreenToClient(APoint); + FHitTest := Grid.ViewInfo.GetHitTest(FHitPoint.X, FHitPoint.Y); + AHitCode := FHitTest.HitTestCode; + if (FHitGridView = nil) or + not PtInRect(FHitGridView.Site.ClientRect, FHitGridView.Site.ScreenToClient(APoint)) then + AHitCode := AHitCode + cxhtGridBase; + end; + if Result then + begin + FHitType := GetHitTypeByHitCode(AHitCode); + Result := InternalPopup(FHitType, APoint, FHitTest); + end; +end; + +procedure TcxGridPopupMenu.CreateBuiltInPopupMenus; +begin + BuiltInPopupMenuList.RegisterItemsTo(FGridDefaultPopupMenu); +end; + +procedure TcxGridPopupMenu.FreeBuiltInPopupMenus; +var + I: Integer; +begin + for I := FGridDefaultPopupMenu.Count - 1 downto 0 do + if FGridDefaultPopupMenu[I].IsBuiltIn then + FGridDefaultPopupMenu[I].Free; +end; + +function TcxGridPopupMenu.GetPopupMenus: TcxPopupMenuInfos; +begin + Result := PopupMenuInfos; +end; + +procedure TcxGridPopupMenu.SetUseBuiltInPopupMenus(const Value: Boolean); +begin + if FUseBuiltInPopupMenus <> Value then + if Value then + CreateBuiltInPopupMenus + else + FreeBuiltInPopupMenus; + FUseBuiltInPopupMenus := Value; +end; + +procedure TcxGridPopupMenu.SetGrid(const AValue: TcxGrid); +begin + if FGrid <> AValue then + begin + FGridOperationHelper.Grid := AValue; + if (FGrid <> nil) and not (csDestroying in FGrid.ComponentState) then + begin + FGrid.UnregisterNotification(FMouseupNotification); + FGrid.RemoveFreeNotification(self); + ClearMenuInfosGridView; + end; + FGrid := AValue; + if FGrid <> nil then + begin + FGrid.FreeNotification(self); + FGrid.RegisterNotification(FMouseupNotification); + end; + end; +end; + +procedure TcxGridPopupMenu.SetPopupMenus(const AValue: TcxPopupMenuInfos); +begin + PopupMenuInfos.Assign(AValue); +end; + +function TcxGridPopupMenu.TryPopupAsIcxPopupMenuIntf(APopupMenu: TComponent; + AHitTest: TcxCustomGridHitTest; APoint: TPoint): Boolean; +var + AIcxPopupMenuIntf: IcxPopupMenu; +begin + Result := False; + if APopupMenu = nil then + Exit; + Result := Supports(APopupMenu, IcxPopupMenu, AIcxPopupMenuIntf); + if Result and DoOnPopup(APopupMenu, AHitTest, APoint.X, APoint.Y) then + AIcxPopupMenuIntf.Popup(APoint.X, APoint.Y); +end; + +function TcxGridPopupMenu.TryPopupAsIDoPopupIntf(APopupMenu: TComponent; + AHitTest: TcxCustomGridHitTest; APoint: TPoint): Boolean; +var + AIDoPopupIntf: IDoPopup; +begin + Result := False; + if APopupMenu = nil then + Exit; + Result := Supports(APopupMenu, IDoPopup, AIDoPopupIntf); + if Result and DoOnPopup(APopupMenu, AHitTest, APoint.X, APoint.Y) then + TcxGridOnPopupProc(AIDoPopupIntf.GetPopupHandler)( + APopupMenu, AHitTest, APoint.X, APoint.Y); +end; + +function TcxGridPopupMenu.TryPopupAsVCLPopupMenu(APopupMenu: TComponent; + AHitTest: TcxCustomGridHitTest; APoint: TPoint): Boolean; +begin + Result := False; + if APopupMenu = nil then + Exit; + Result := + (APopupMenu is TPopupMenu) or (APopupMenu.InheritsFrom(TPopupMenu)); + if Result and DoOnPopup(APopupMenu, AHitTest, APoint.X, APoint.Y) then + begin + TPopupMenu(APopupMenu).PopupComponent := FHitGridView; + TPopupMenu(APopupMenu).Popup(APoint.X, APoint.Y); + end; +end; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridPopupMenuConsts.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridPopupMenuConsts.pas new file mode 100644 index 00000000..f56e18c1 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridPopupMenuConsts.pas @@ -0,0 +1,99 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridPopupMenuConsts; + +{$I cxVer.inc} + +interface + +uses + cxClasses, cxCustomData; + +resourcestring + cxSGridNone = 'None'; + + // Header popup menu item captions + + cxSGridSortColumnAsc = 'Sort Ascending'; + cxSGridSortColumnDesc = 'Sort Descending'; + cxSGridClearSorting = 'Clear Sorting'; + cxSGridGroupByThisField = 'Group By This Field'; + cxSGridRemoveThisGroupItem = 'Remove from grouping'; + cxSGridGroupByBox = 'Group By Box'; + cxSGridAlignmentSubMenu = 'Alignment'; + cxSGridAlignLeft = 'Align Left'; + cxSGridAlignRight = 'Align Right'; + cxSGridAlignCenter = 'Align Center'; + cxSGridRemoveColumn = 'Remove This Column'; + cxSGridFieldChooser = 'Field Chooser'; + cxSGridBestFit = 'Best Fit'; + cxSGridBestFitAllColumns = 'Best Fit (all columns)'; + cxSGridShowFooter = 'Footer'; + cxSGridShowGroupFooter = 'Group Footers'; + + // Footer popup menu item captions + + cxSGridNoneMenuItem = 'None'; + cxSGridSumMenuItem = 'Sum'; + cxSGridMinMenuItem = 'Min'; + cxSGridMaxMenuItem = 'Max'; + cxSGridCountMenuItem = 'Count'; + cxSGridAvgMenuItem = 'Average'; + + // Group row popup menu item captions + + cxSGridSortByGroupValues = 'Sort by Group Value'; + cxSGridSortBySummaryCaption = 'Sort by Group Summary:'; + cxSGridSortBySummary = '%s for %s'; + +function GetSummaryName(ASummaryKind: TcxSummaryKind): TcxResourceStringID; + +implementation + +function GetSummaryName(ASummaryKind: TcxSummaryKind): TcxResourceStringID; +const + SummaryNames: array[TcxSummaryKind] of TcxResourceStringID = ( + @cxSGridNoneMenuItem, + @cxSGridSumMenuItem, + @cxSGridMinMenuItem, + @cxSGridMaxMenuItem, + @cxSGridCountMenuItem, + @cxSGridAvgMenuItem); +begin + Result := SummaryNames[ASummaryKind]; +end; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridPopupMenuReg.dcr b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridPopupMenuReg.dcr new file mode 100644 index 00000000..2fd9240e Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridPopupMenuReg.dcr differ diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridPopupMenuReg.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridPopupMenuReg.pas new file mode 100644 index 00000000..355ed260 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridPopupMenuReg.pas @@ -0,0 +1,116 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid Utils } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridPopupMenuReg; + +{$I cxVer.inc} + +interface + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI6} + DesignIntf, DesignEditors, + Types, +{$ELSE} + DsgnIntf, cxClasses, +{$ENDIF} + Windows, Classes, Messages, SysUtils, cxGridPopupMenu, cxGridCustomPopupMenu, + cxGridReg, TypInfo, Dialogs; + +type + TcxGridPopupMenuEditor = class(TComponentEditor) + public + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + end; + + TcxGridPopupMenuProperty = class(TComponentProperty) + private + FGetValuesStrProc: TGetStrProc; + protected + procedure ReceiveComponentNames(const S: string); + public + procedure GetValues(Proc: TGetStrProc); override; + end; + +procedure Register; +begin + RegisterPropertyEditor(TypeInfo(TComponent), TcxPopupMenuInfo, 'PopupMenu', TcxGridPopupMenuProperty); + RegisterComponentEditor(TcxGridPopupMenu, TcxGridPopupMenuEditor); + RegisterComponents('Dev Express', [TcxGridPopupMenu]); +end; + +{ TcxGridPopupMenuEditor } + +function TcxGridPopupMenuEditor.GetVerb(Index: Integer): string; +begin + case Index of + 0: Result := 'ExpressQuantumGrid Suite ' + cxGridVersion; + 1: Result := 'www.devexpress.com'; + end; +end; + +function TcxGridPopupMenuEditor.GetVerbCount: Integer; +begin + Result := 2; +end; + +{ TcxGridPopupMenuProperty } + +procedure TcxGridPopupMenuProperty.GetValues(Proc: TGetStrProc); +begin + FGetValuesStrProc := Proc; + try + Designer.GetComponentNames(GetTypeData(GetPropType), ReceiveComponentNames); + finally + FGetValuesStrProc := nil; + end; +end; + +procedure TcxGridPopupMenuProperty.ReceiveComponentNames(const S: string); +var + AComponent: TComponent; +begin + AComponent := Designer.GetComponent(S); + if Assigned(FGetValuesStrProc) and Assigned(AComponent) and + (Supports(AComponent, IDoPopup) or (AComponent.ClassName = 'TPopupMenu') or + (AComponent.ClassName = 'TdxBarPopupMenu')) then + FGetValuesStrProc(S); +end; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridPredefinedStyles.dfm b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridPredefinedStyles.dfm new file mode 100644 index 00000000..350308ba --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridPredefinedStyles.dfm @@ -0,0 +1,4856 @@ +object cxdmGridPredefinedStyles: TcxdmGridPredefinedStyles + OldCreateOrder = False + Left = 262 + Top = 123 + Height = 253 + Width = 356 + object StyleRepository: TcxStyleRepository + Left = 160 + Top = 96 + object ClassicBackground: TcxStyle + AssignedValues = [svColor] + Color = 15451300 + end + object ClassicContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 16247513 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object ClassicContentEven: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16247513 + TextColor = clBlack + end + object ClassicContentOdd: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16247513 + TextColor = clBlack + end + object ClassicFilterBox: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14811135 + TextColor = clBlack + end + object ClassicFooter: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14811135 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clNavy + end + object ClassicGroup: TcxStyle + AssignedValues = [svColor] + Color = 14872561 + end + object ClassicGroupByBox: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBlack + end + object ClassicHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12937777 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object ClassicInactive: TcxStyle + AssignedValues = [svColor] + Color = 15451300 + end + object ClassicIncSearch: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBlack + end + object ClassicIndicator: TcxStyle + AssignedValues = [svColor] + Color = 15451300 + end + object ClassicPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14811135 + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clNavy + end + object ClassicSelection: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 12937777 + TextColor = clWhite + end + object cxStyle1: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8894686 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle2: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8894686 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle3: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle4: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 1262987 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Arial' + Font.Style = [] + TextColor = clWhite + end + object cxStyle5: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlue + end + object cxStyle6: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15136253 + Font.Charset = DEFAULT_CHARSET + Font.Color = 7346457 + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [] + TextColor = 7346457 + end + object cxStyle7: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16436871 + TextColor = clBlack + end + object cxStyle8: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 8036607 + TextColor = clBlack + end + object cxStyle9: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12180223 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle10: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle11: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8894686 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial Narrow' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle12: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9157775 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle13: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9157775 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle14: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4615972 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle15: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5737262 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial Black' + Font.Style = [] + TextColor = clBlack + end + object cxStyle16: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlue + end + object cxStyle17: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle18: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 9234160 + TextColor = clBlack + end + object cxStyle19: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 11788021 + TextColor = clBlack + end + object cxStyle20: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11193702 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clBlack + end + object cxStyle21: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5736750 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle22: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9157775 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle23: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13749760 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle24: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13749760 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle25: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 166 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -12 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle26: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8519755 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 14481663 + end + object cxStyle27: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlue + end + object cxStyle28: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle29: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16775416 + TextColor = clBlack + end + object cxStyle30: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16443110 + TextColor = clBlack + end + object cxStyle31: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14599344 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle32: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 191 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -12 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle33: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13749760 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle34: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6908265 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle35: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6908265 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle36: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 85 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle37: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle38: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlue + end + object cxStyle39: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle40: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle41: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 15461355 + TextColor = clBlack + end + object cxStyle42: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle43: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 85 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle44: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6908265 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle45: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10862530 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle46: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10862530 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle47: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6392205 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle48: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 66 + Font.Charset = DEFAULT_CHARSET + Font.Color = 13820129 + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = 13820129 + end + object cxStyle49: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle50: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle51: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 10862530 + TextColor = clBlack + end + object cxStyle52: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 13820129 + TextColor = clBlack + end + object cxStyle53: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6392205 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 13820129 + end + object cxStyle54: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6392205 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle55: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10862530 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle56: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12307669 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle57: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12307669 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle58: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle59: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6852002 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle60: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clTeal + end + object cxStyle61: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle62: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 12307669 + TextColor = clBlack + end + object cxStyle63: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14542570 + TextColor = clBlack + end + object cxStyle64: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6852002 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle65: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle66: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12307669 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle67: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11055248 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle68: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11055248 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle69: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7897176 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle70: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4194368 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle71: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = 7897176 + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = 7897176 + end + object cxStyle72: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle73: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 11055248 + TextColor = clBlack + end + object cxStyle74: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14211272 + TextColor = clBlack + end + object cxStyle75: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7897176 + Font.Charset = DEFAULT_CHARSET + Font.Color = 524288 + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = 524288 + end + object cxStyle76: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7897176 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle77: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11055248 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle78: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14264494 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -15 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle79: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14264494 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = 'Garamond' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle80: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11619930 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle81: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -15 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle82: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = 11619930 + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 11619930 + end + object cxStyle83: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = 'Garamond' + Font.Style = [] + TextColor = clBlack + end + object cxStyle84: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14264494 + TextColor = clBlack + end + object cxStyle85: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 15521240 + TextColor = clBlack + end + object cxStyle86: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11619930 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -15 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle87: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11619930 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle88: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14264494 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle89: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11458790 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle90: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11458790 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle91: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4630214 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle92: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle93: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle94: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle95: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 11458790 + TextColor = clBlack + end + object cxStyle96: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14150898 + TextColor = clBlack + end + object cxStyle97: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4630214 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 14150898 + end + object cxStyle98: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4630214 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle99: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11458790 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle100: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12107912 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle101: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12107912 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle102: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6053956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle103: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4673068 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle104: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14213320 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clNavy + end + object cxStyle105: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14213320 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle106: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 12107912 + TextColor = clBlack + end + object cxStyle107: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14213320 + TextColor = clBlack + end + object cxStyle108: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8949832 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clSilver + end + object cxStyle109: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6053956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle110: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12107912 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle111: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9476264 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle112: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9476264 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle113: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4210816 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 13160664 + end + object cxStyle114: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4204608 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle115: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160664 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 6307912 + end + object cxStyle116: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160664 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle117: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 10266296 + TextColor = clBlack + end + object cxStyle118: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14476524 + TextColor = clBlack + end + object cxStyle119: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5791864 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 9476264 + end + object cxStyle120: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4210816 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 13160664 + end + object cxStyle121: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9476264 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle122: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10343916 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle123: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10343916 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle124: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4944971 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle125: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4325442 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle126: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 3122647 + end + object cxStyle127: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle128: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 10343916 + TextColor = clBlack + end + object cxStyle129: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 13626101 + TextColor = clBlack + end + object cxStyle130: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3122647 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 13626101 + end + object cxStyle131: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4944971 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle132: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10343916 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle133: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11639171 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle134: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11639171 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle135: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8217935 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle136: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle137: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 8217935 + end + object cxStyle138: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle139: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 11639171 + TextColor = clBlack + end + object cxStyle140: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14273729 + TextColor = clBlack + end + object cxStyle141: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8217935 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 14273729 + end + object cxStyle142: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8217935 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle143: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11639171 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle144: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clBlack + end + object cxStyle145: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle146: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clMaroon + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clWhite + end + object cxStyle147: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4325376 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle148: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle149: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clBlack + end + object cxStyle150: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle151: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle152: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clSilver + end + object cxStyle153: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clMaroon + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clWhite + end + object cxStyle154: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle155: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle156: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle157: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5855675 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle158: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3552892 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle159: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 7364767 + end + object cxStyle160: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15461375 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle161: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 15461375 + TextColor = clBlack + end + object cxStyle162: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 15461375 + TextColor = clBlack + end + object cxStyle163: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3552892 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 14540253 + end + object cxStyle164: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5855675 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle165: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clBlack + end + object cxStyle166: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12103888 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle167: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [] + TextColor = clBlack + end + object cxStyle168: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5855675 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle169: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3552892 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clWhite + end + object cxStyle170: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 7364768 + end + object cxStyle171: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15461375 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [] + TextColor = clBlack + end + object cxStyle172: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 15461375 + TextColor = clBlack + end + object cxStyle173: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle174: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3552892 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 14540253 + end + object cxStyle175: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5855675 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle176: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12103888 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clBlack + end + object cxStyle177: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13154717 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle178: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13154717 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle179: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9928789 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle180: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4276545 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle181: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 9928789 + end + object cxStyle182: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle183: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 13154717 + TextColor = clBlack + end + object cxStyle184: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14933198 + TextColor = clBlack + end + object cxStyle185: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9928789 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clSilver + end + object cxStyle186: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9928789 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle187: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13154717 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle188: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11126946 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle189: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11126946 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle190: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6592345 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle191: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 2178849 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle192: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 6592345 + end + object cxStyle193: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle194: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 11126946 + TextColor = clBlack + end + object cxStyle195: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 13886416 + TextColor = clBlack + end + object cxStyle196: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6592345 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 13886416 + end + object cxStyle197: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6592345 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle198: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11126946 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle199: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle200: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle201: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4194432 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle202: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle203: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clPurple + end + object cxStyle204: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle205: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle206: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle207: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clSilver + end + object cxStyle208: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4194432 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle209: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle210: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle211: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle212: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle213: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4210688 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle214: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clTeal + end + object cxStyle215: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle216: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle217: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle218: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle219: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle220: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle221: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10542814 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle222: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10542814 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle223: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clOlive + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle224: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 1916928 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle225: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clOlive + end + object cxStyle226: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle227: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 10542814 + TextColor = clBlack + end + object cxStyle228: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 13692654 + TextColor = clBlack + end + object cxStyle229: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4308156 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle230: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clOlive + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle231: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10542814 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle232: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle233: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle234: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle235: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10841658 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle236: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clNavy + end + object cxStyle237: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle238: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle239: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle240: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clSilver + end + object cxStyle241: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle242: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle243: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle244: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle245: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle246: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10841658 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle247: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clNavy + end + object cxStyle248: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle249: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14671839 + TextColor = clBlack + end + object cxStyle250: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle251: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clSilver + end + object cxStyle252: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle253: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle254: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle255: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle256: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle257: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10841658 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle258: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 6956042 + end + object cxStyle259: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle260: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 13160660 + TextColor = clBlack + end + object cxStyle261: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle262: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 13160660 + end + object cxStyle263: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle264: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle265: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle266: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle267: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle268: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10841658 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle269: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 6956042 + end + object cxStyle270: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle271: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 13160660 + TextColor = clBlack + end + object cxStyle272: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle273: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 13160660 + end + object cxStyle274: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle275: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle276: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle277: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle278: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 206 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle279: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clSilver + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clSilver + end + object cxStyle280: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlue + end + object cxStyle281: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clYellow + end + object cxStyle282: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle283: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle284: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle285: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 206 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle286: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle287: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle288: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle289: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 206 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle290: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle291: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlue + end + object cxStyle292: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clYellow + end + object cxStyle293: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle294: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle295: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle296: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 206 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle297: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle298: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clYellow + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clYellow + end + object cxStyle299: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clYellow + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clYellow + end + object cxStyle300: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle301: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle302: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clAqua + end + object cxStyle303: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle304: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle305: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle306: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle307: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle308: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle309: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clYellow + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clYellow + end + object cxStyle310: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clYellow + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clYellow + end + object cxStyle311: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle312: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -15 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle313: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clAqua + end + object cxStyle314: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle315: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle316: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle317: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle318: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle319: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle320: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle321: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle322: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clPurple + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle323: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle324: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clPurple + end + object cxStyle325: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle326: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle327: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clWhite + end + object cxStyle328: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle329: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clPurple + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle330: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle331: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle332: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle333: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clPurple + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle334: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -15 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle335: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clPurple + end + object cxStyle336: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle337: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle338: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clWhite + end + object cxStyle339: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle340: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clPurple + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle341: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle342: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle343: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle344: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle345: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clSilver + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clSilver + end + object cxStyle346: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle347: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle348: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle349: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 15658734 + TextColor = clBlack + end + object cxStyle350: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle351: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle352: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle353: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle354: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle355: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle356: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clSilver + Font.Height = -15 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clSilver + end + object cxStyle357: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle358: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle359: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle360: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 15658734 + TextColor = clBlack + end + object cxStyle361: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle362: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle363: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object ClassicRowCaption: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16749885 + TextColor = clWhite + end + object cxStyle364: TcxStyle + AssignedValues = [svColor] + Color = clSilver + end + object cxStyle365: TcxStyle + AssignedValues = [svColor] + Color = 13160660 + end + object cxStyle366: TcxStyle + AssignedValues = [svColor] + Color = 13160660 + end + object GridTableViewStyleSheetDevExpress: TcxGridTableViewStyleSheet + Caption = 'DevExpress' + Styles.Background = ClassicBackground + Styles.Content = ClassicContent + Styles.ContentEven = ClassicContentEven + Styles.ContentOdd = ClassicContentOdd + Styles.FilterBox = ClassicFilterBox + Styles.Inactive = ClassicInactive + Styles.IncSearch = ClassicIncSearch + Styles.Selection = ClassicSelection + Styles.Footer = ClassicFooter + Styles.Group = ClassicGroup + Styles.GroupByBox = ClassicGroupByBox + Styles.Header = ClassicHeader + Styles.Indicator = ClassicIndicator + Styles.Preview = ClassicPreview + BuiltIn = True + end + object GridBandedTableViewStyleSheetDevExpress: TcxGridBandedTableViewStyleSheet + Caption = 'DevExpress' + Styles.Background = ClassicBackground + Styles.Content = ClassicContent + Styles.ContentEven = ClassicContentEven + Styles.ContentOdd = ClassicContentOdd + Styles.FilterBox = ClassicFilterBox + Styles.Inactive = ClassicInactive + Styles.IncSearch = ClassicIncSearch + Styles.Selection = ClassicSelection + Styles.Footer = ClassicFooter + Styles.Group = ClassicGroup + Styles.GroupByBox = ClassicGroupByBox + Styles.Header = ClassicHeader + Styles.Indicator = ClassicIndicator + Styles.Preview = ClassicPreview + Styles.BandBackground = ClassicBackground + Styles.BandHeader = ClassicHeader + BuiltIn = True + end + object GridCardViewStyleSheetDevExpress: TcxGridCardViewStyleSheet + Caption = 'DevExpress' + Styles.Background = ClassicBackground + Styles.Content = ClassicContent + Styles.ContentEven = ClassicContentOdd + Styles.ContentOdd = ClassicContentEven + Styles.Inactive = ClassicInactive + Styles.IncSearch = ClassicIncSearch + Styles.Selection = ClassicSelection + Styles.CaptionRow = ClassicHeader + Styles.CardBorder = ClassicHeader + Styles.RowCaption = ClassicRowCaption + BuiltIn = True + end + object GridTableViewStyleSheetUserFormat1: TcxGridTableViewStyleSheet + Caption = 'UserFormat1' + Styles.Content = cxStyle6 + Styles.ContentEven = cxStyle7 + Styles.ContentOdd = cxStyle8 + Styles.Inactive = cxStyle10 + Styles.Selection = cxStyle3 + Styles.Footer = cxStyle1 + Styles.Group = cxStyle9 + Styles.GroupByBox = cxStyle4 + Styles.Header = cxStyle2 + Styles.Indicator = cxStyle11 + Styles.Preview = cxStyle5 + BuiltIn = True + end + object GridBandedTableViewStyleSheetUserFormat1: TcxGridBandedTableViewStyleSheet + Caption = 'UserFormat1' + Styles.Content = cxStyle6 + Styles.ContentEven = cxStyle7 + Styles.ContentOdd = cxStyle8 + Styles.Inactive = cxStyle10 + Styles.Selection = cxStyle3 + Styles.Footer = cxStyle1 + Styles.Group = cxStyle9 + Styles.GroupByBox = cxStyle4 + Styles.Header = cxStyle2 + Styles.Indicator = cxStyle11 + Styles.Preview = cxStyle5 + Styles.BandHeader = cxStyle2 + BuiltIn = True + end + object GridCardViewStyleSheetUserFormat1: TcxGridCardViewStyleSheet + Caption = 'UserFormat1' + Styles.Content = cxStyle6 + Styles.ContentEven = cxStyle7 + Styles.ContentOdd = cxStyle8 + Styles.Inactive = cxStyle10 + Styles.Selection = cxStyle3 + Styles.CaptionRow = cxStyle2 + Styles.RowCaption = cxStyle2 + BuiltIn = True + end + object GridTableViewStyleSheetUserFormat2: TcxGridTableViewStyleSheet + Caption = 'UserFormat2' + Styles.Content = cxStyle17 + Styles.ContentEven = cxStyle18 + Styles.ContentOdd = cxStyle19 + Styles.Inactive = cxStyle21 + Styles.Selection = cxStyle14 + Styles.Footer = cxStyle12 + Styles.Group = cxStyle20 + Styles.GroupByBox = cxStyle15 + Styles.Header = cxStyle13 + Styles.Indicator = cxStyle22 + Styles.Preview = cxStyle16 + BuiltIn = True + end + object GridBandedTableViewStyleSheetUserFormat2: TcxGridBandedTableViewStyleSheet + Caption = 'UserFormat2' + Styles.Content = cxStyle17 + Styles.ContentEven = cxStyle18 + Styles.ContentOdd = cxStyle19 + Styles.Inactive = cxStyle21 + Styles.Selection = cxStyle14 + Styles.Footer = cxStyle12 + Styles.Group = cxStyle20 + Styles.GroupByBox = cxStyle15 + Styles.Header = cxStyle13 + Styles.Indicator = cxStyle22 + Styles.Preview = cxStyle16 + Styles.BandHeader = cxStyle13 + BuiltIn = True + end + object GridCardViewStyleSheetUserFormat2: TcxGridCardViewStyleSheet + Caption = 'UserFormat2' + Styles.Content = cxStyle17 + Styles.ContentEven = cxStyle18 + Styles.ContentOdd = cxStyle19 + Styles.Inactive = cxStyle21 + Styles.Selection = cxStyle14 + Styles.CaptionRow = cxStyle13 + Styles.RowCaption = cxStyle13 + BuiltIn = True + end + object GridTableViewStyleSheetUserFormat3: TcxGridTableViewStyleSheet + Caption = 'UserFormat3' + Styles.Content = cxStyle28 + Styles.ContentEven = cxStyle29 + Styles.ContentOdd = cxStyle30 + Styles.Inactive = cxStyle32 + Styles.Selection = cxStyle25 + Styles.Footer = cxStyle23 + Styles.Group = cxStyle31 + Styles.GroupByBox = cxStyle26 + Styles.Header = cxStyle24 + Styles.Indicator = cxStyle33 + Styles.Preview = cxStyle27 + BuiltIn = True + end + object GridBandedTableViewStyleSheetUserFormat3: TcxGridBandedTableViewStyleSheet + Caption = 'UserFormat3' + Styles.Content = cxStyle28 + Styles.ContentEven = cxStyle29 + Styles.ContentOdd = cxStyle30 + Styles.Inactive = cxStyle32 + Styles.Selection = cxStyle25 + Styles.Footer = cxStyle23 + Styles.Group = cxStyle31 + Styles.GroupByBox = cxStyle26 + Styles.Header = cxStyle24 + Styles.Indicator = cxStyle33 + Styles.Preview = cxStyle27 + Styles.BandHeader = cxStyle24 + BuiltIn = True + end + object GridCardViewStyleSheetUserFormat3: TcxGridCardViewStyleSheet + Caption = 'UserFormat3' + Styles.Content = cxStyle28 + Styles.ContentEven = cxStyle29 + Styles.ContentOdd = cxStyle30 + Styles.Inactive = cxStyle32 + Styles.Selection = cxStyle25 + Styles.CaptionRow = cxStyle24 + Styles.RowCaption = cxStyle24 + BuiltIn = True + end + object GridTableViewStyleSheetUserFormat4: TcxGridTableViewStyleSheet + Caption = 'UserFormat4' + Styles.Content = cxStyle39 + Styles.ContentEven = cxStyle40 + Styles.ContentOdd = cxStyle41 + Styles.Inactive = cxStyle43 + Styles.Selection = cxStyle36 + Styles.Footer = cxStyle34 + Styles.Group = cxStyle42 + Styles.GroupByBox = cxStyle37 + Styles.Header = cxStyle35 + Styles.Indicator = cxStyle44 + Styles.Preview = cxStyle38 + BuiltIn = True + end + object GridBandedTableViewStyleSheetUserFormat4: TcxGridBandedTableViewStyleSheet + Caption = 'UserFormat4' + Styles.Content = cxStyle39 + Styles.ContentEven = cxStyle40 + Styles.ContentOdd = cxStyle41 + Styles.Inactive = cxStyle43 + Styles.Selection = cxStyle36 + Styles.Footer = cxStyle34 + Styles.Group = cxStyle42 + Styles.GroupByBox = cxStyle37 + Styles.Header = cxStyle35 + Styles.Indicator = cxStyle44 + Styles.Preview = cxStyle38 + Styles.BandHeader = cxStyle35 + BuiltIn = True + end + object GridCardViewStyleSheetUserFormat4: TcxGridCardViewStyleSheet + Caption = 'UserFormat4' + Styles.Content = cxStyle39 + Styles.ContentEven = cxStyle40 + Styles.ContentOdd = cxStyle41 + Styles.Inactive = cxStyle43 + Styles.Selection = cxStyle36 + Styles.CaptionRow = cxStyle35 + Styles.RowCaption = cxStyle35 + BuiltIn = True + end + object GridTableViewStyleSheetBrick: TcxGridTableViewStyleSheet + Caption = 'Brick' + Styles.Content = cxStyle50 + Styles.ContentEven = cxStyle51 + Styles.ContentOdd = cxStyle52 + Styles.Inactive = cxStyle54 + Styles.Selection = cxStyle47 + Styles.Footer = cxStyle45 + Styles.Group = cxStyle53 + Styles.GroupByBox = cxStyle48 + Styles.Header = cxStyle46 + Styles.Indicator = cxStyle55 + Styles.Preview = cxStyle49 + BuiltIn = True + end + object GridBandedTableViewStyleSheetBrick: TcxGridBandedTableViewStyleSheet + Caption = 'Brick' + Styles.Content = cxStyle50 + Styles.ContentEven = cxStyle51 + Styles.ContentOdd = cxStyle52 + Styles.Inactive = cxStyle54 + Styles.Selection = cxStyle47 + Styles.Footer = cxStyle45 + Styles.Group = cxStyle53 + Styles.GroupByBox = cxStyle48 + Styles.Header = cxStyle46 + Styles.Indicator = cxStyle55 + Styles.Preview = cxStyle49 + Styles.BandHeader = cxStyle46 + BuiltIn = True + end + object GridCardViewStyleSheetBrick: TcxGridCardViewStyleSheet + Caption = 'Brick' + Styles.Content = cxStyle50 + Styles.ContentEven = cxStyle51 + Styles.ContentOdd = cxStyle52 + Styles.Inactive = cxStyle54 + Styles.Selection = cxStyle47 + Styles.CaptionRow = cxStyle46 + Styles.RowCaption = cxStyle46 + BuiltIn = True + end + object GridTableViewStyleSheetDesert: TcxGridTableViewStyleSheet + Caption = 'Desert' + Styles.Content = cxStyle61 + Styles.ContentEven = cxStyle62 + Styles.ContentOdd = cxStyle63 + Styles.Inactive = cxStyle65 + Styles.Selection = cxStyle58 + Styles.Footer = cxStyle56 + Styles.Group = cxStyle64 + Styles.GroupByBox = cxStyle59 + Styles.Header = cxStyle57 + Styles.Indicator = cxStyle66 + Styles.Preview = cxStyle60 + BuiltIn = True + end + object GridBandedTableViewStyleSheetDesert: TcxGridBandedTableViewStyleSheet + Caption = 'Desert' + Styles.Content = cxStyle61 + Styles.ContentEven = cxStyle62 + Styles.ContentOdd = cxStyle63 + Styles.Inactive = cxStyle65 + Styles.Selection = cxStyle58 + Styles.Footer = cxStyle56 + Styles.Group = cxStyle64 + Styles.GroupByBox = cxStyle59 + Styles.Header = cxStyle57 + Styles.Indicator = cxStyle66 + Styles.Preview = cxStyle60 + Styles.BandHeader = cxStyle57 + BuiltIn = True + end + object GridCardViewStyleSheetDesert: TcxGridCardViewStyleSheet + Caption = 'Desert' + Styles.Content = cxStyle61 + Styles.ContentEven = cxStyle62 + Styles.ContentOdd = cxStyle63 + Styles.Inactive = cxStyle65 + Styles.Selection = cxStyle58 + Styles.CaptionRow = cxStyle57 + Styles.RowCaption = cxStyle57 + BuiltIn = True + end + object GridTableViewStyleSheetEggplant: TcxGridTableViewStyleSheet + Caption = 'Eggplant' + Styles.Content = cxStyle72 + Styles.ContentEven = cxStyle73 + Styles.ContentOdd = cxStyle74 + Styles.Inactive = cxStyle76 + Styles.Selection = cxStyle69 + Styles.Footer = cxStyle67 + Styles.Group = cxStyle75 + Styles.GroupByBox = cxStyle70 + Styles.Header = cxStyle68 + Styles.Indicator = cxStyle77 + Styles.Preview = cxStyle71 + BuiltIn = True + end + object GridBandedTableViewStyleSheetEggplant: TcxGridBandedTableViewStyleSheet + Caption = 'Eggplant' + Styles.Content = cxStyle72 + Styles.ContentEven = cxStyle73 + Styles.ContentOdd = cxStyle74 + Styles.Inactive = cxStyle76 + Styles.Selection = cxStyle69 + Styles.Footer = cxStyle67 + Styles.Group = cxStyle75 + Styles.GroupByBox = cxStyle70 + Styles.Header = cxStyle68 + Styles.Indicator = cxStyle77 + Styles.Preview = cxStyle71 + Styles.BandBackground = cxStyle68 + BuiltIn = True + end + object GridCardViewStyleSheetEggplant: TcxGridCardViewStyleSheet + Caption = 'Eggplant' + Styles.Content = cxStyle72 + Styles.ContentEven = cxStyle73 + Styles.ContentOdd = cxStyle74 + Styles.Inactive = cxStyle76 + Styles.Selection = cxStyle69 + Styles.CaptionRow = cxStyle68 + Styles.RowCaption = cxStyle68 + BuiltIn = True + end + object GridTableViewStyleSheetLilac: TcxGridTableViewStyleSheet + Caption = 'Lilac' + Styles.Content = cxStyle83 + Styles.ContentEven = cxStyle84 + Styles.ContentOdd = cxStyle85 + Styles.Inactive = cxStyle87 + Styles.Selection = cxStyle80 + Styles.Footer = cxStyle78 + Styles.Group = cxStyle86 + Styles.GroupByBox = cxStyle81 + Styles.Header = cxStyle79 + Styles.Indicator = cxStyle88 + Styles.Preview = cxStyle82 + BuiltIn = True + end + object GridBandedTableViewStyleSheetLilac: TcxGridBandedTableViewStyleSheet + Caption = 'Lilac' + Styles.Content = cxStyle83 + Styles.ContentEven = cxStyle84 + Styles.ContentOdd = cxStyle85 + Styles.Inactive = cxStyle87 + Styles.Selection = cxStyle80 + Styles.Footer = cxStyle78 + Styles.Group = cxStyle86 + Styles.GroupByBox = cxStyle81 + Styles.Header = cxStyle79 + Styles.Indicator = cxStyle88 + Styles.Preview = cxStyle82 + Styles.BandHeader = cxStyle79 + BuiltIn = True + end + object GridCardViewStyleSheetLilac: TcxGridCardViewStyleSheet + Caption = 'Lilac' + Styles.Content = cxStyle83 + Styles.ContentEven = cxStyle84 + Styles.ContentOdd = cxStyle85 + Styles.Inactive = cxStyle87 + Styles.Selection = cxStyle80 + Styles.CaptionRow = cxStyle79 + Styles.RowCaption = cxStyle79 + BuiltIn = True + end + object GridTableViewStyleSheetMaple: TcxGridTableViewStyleSheet + Caption = 'Maple' + Styles.Content = cxStyle94 + Styles.ContentEven = cxStyle95 + Styles.ContentOdd = cxStyle96 + Styles.Inactive = cxStyle98 + Styles.Selection = cxStyle91 + Styles.Footer = cxStyle89 + Styles.Group = cxStyle97 + Styles.GroupByBox = cxStyle92 + Styles.Header = cxStyle90 + Styles.Indicator = cxStyle99 + Styles.Preview = cxStyle93 + BuiltIn = True + end + object GridBandedTableViewStyleSheetMaple: TcxGridBandedTableViewStyleSheet + Caption = 'Maple' + Styles.Content = cxStyle94 + Styles.ContentEven = cxStyle95 + Styles.ContentOdd = cxStyle96 + Styles.Inactive = cxStyle98 + Styles.Selection = cxStyle91 + Styles.Footer = cxStyle89 + Styles.Group = cxStyle97 + Styles.GroupByBox = cxStyle92 + Styles.Header = cxStyle90 + Styles.Indicator = cxStyle99 + Styles.Preview = cxStyle93 + Styles.BandHeader = cxStyle90 + BuiltIn = True + end + object GridCardViewStyleSheetMaple: TcxGridCardViewStyleSheet + Caption = 'Maple' + Styles.Content = cxStyle94 + Styles.ContentEven = cxStyle95 + Styles.ContentOdd = cxStyle96 + Styles.Inactive = cxStyle98 + Styles.Selection = cxStyle91 + Styles.CaptionRow = cxStyle90 + Styles.RowCaption = cxStyle90 + BuiltIn = True + end + object GridTableViewStyleSheetMarinehighcolor: TcxGridTableViewStyleSheet + Caption = 'Marine (high color)' + Styles.Content = cxStyle105 + Styles.ContentEven = cxStyle106 + Styles.ContentOdd = cxStyle107 + Styles.Inactive = cxStyle109 + Styles.Selection = cxStyle102 + Styles.Footer = cxStyle100 + Styles.Group = cxStyle108 + Styles.GroupByBox = cxStyle103 + Styles.Header = cxStyle101 + Styles.Indicator = cxStyle110 + Styles.Preview = cxStyle104 + BuiltIn = True + end + object GridBandedTableViewStyleSheetMarinehighcolor: TcxGridBandedTableViewStyleSheet + Caption = 'Marine (high color)' + Styles.Content = cxStyle105 + Styles.ContentEven = cxStyle106 + Styles.ContentOdd = cxStyle107 + Styles.Inactive = cxStyle109 + Styles.Selection = cxStyle102 + Styles.Footer = cxStyle100 + Styles.Group = cxStyle108 + Styles.GroupByBox = cxStyle103 + Styles.Header = cxStyle101 + Styles.Indicator = cxStyle110 + Styles.Preview = cxStyle104 + Styles.BandHeader = cxStyle101 + BuiltIn = True + end + object GridCardViewStyleSheetMarinehighcolor: TcxGridCardViewStyleSheet + Caption = 'Marine (high color)' + Styles.Content = cxStyle105 + Styles.ContentEven = cxStyle106 + Styles.ContentOdd = cxStyle107 + Styles.Inactive = cxStyle109 + Styles.Selection = cxStyle102 + Styles.CaptionRow = cxStyle101 + Styles.RowCaption = cxStyle101 + BuiltIn = True + end + object GridTableViewStyleSheetPlumhighcolor: TcxGridTableViewStyleSheet + Caption = 'Plum (high color)' + Styles.Content = cxStyle116 + Styles.ContentEven = cxStyle117 + Styles.ContentOdd = cxStyle118 + Styles.Inactive = cxStyle120 + Styles.Selection = cxStyle113 + Styles.Footer = cxStyle111 + Styles.Group = cxStyle119 + Styles.GroupByBox = cxStyle114 + Styles.Header = cxStyle112 + Styles.Indicator = cxStyle121 + Styles.Preview = cxStyle115 + BuiltIn = True + end + object GridBandedTableViewStyleSheetPlumhighcolor: TcxGridBandedTableViewStyleSheet + Caption = 'Plum (high color)' + Styles.Content = cxStyle116 + Styles.ContentEven = cxStyle117 + Styles.ContentOdd = cxStyle118 + Styles.Inactive = cxStyle120 + Styles.Selection = cxStyle113 + Styles.Footer = cxStyle111 + Styles.Group = cxStyle119 + Styles.GroupByBox = cxStyle114 + Styles.Header = cxStyle112 + Styles.Indicator = cxStyle121 + Styles.Preview = cxStyle115 + Styles.BandHeader = cxStyle112 + BuiltIn = True + end + object GridCardViewStyleSheetPlumhighcolor: TcxGridCardViewStyleSheet + Caption = 'Plum (high color)' + Styles.Content = cxStyle116 + Styles.ContentEven = cxStyle117 + Styles.ContentOdd = cxStyle118 + Styles.Inactive = cxStyle120 + Styles.Selection = cxStyle113 + Styles.CaptionRow = cxStyle112 + Styles.CardBorder = cxStyle112 + Styles.RowCaption = cxStyle112 + BuiltIn = True + end + object GridTableViewStyleSheetPumpkinlarge: TcxGridTableViewStyleSheet + Caption = 'Pumpkin (large)' + Styles.Content = cxStyle127 + Styles.ContentEven = cxStyle128 + Styles.ContentOdd = cxStyle129 + Styles.Inactive = cxStyle131 + Styles.Selection = cxStyle124 + Styles.Footer = cxStyle122 + Styles.Group = cxStyle130 + Styles.GroupByBox = cxStyle125 + Styles.Header = cxStyle123 + Styles.Indicator = cxStyle132 + Styles.Preview = cxStyle126 + BuiltIn = True + end + object GridBandedTableViewStyleSheetPumpkinlarge: TcxGridBandedTableViewStyleSheet + Caption = 'Pumpkin (large)' + Styles.Content = cxStyle127 + Styles.ContentEven = cxStyle128 + Styles.ContentOdd = cxStyle129 + Styles.Inactive = cxStyle131 + Styles.Selection = cxStyle124 + Styles.Footer = cxStyle122 + Styles.Group = cxStyle130 + Styles.GroupByBox = cxStyle125 + Styles.Header = cxStyle123 + Styles.Indicator = cxStyle132 + Styles.Preview = cxStyle126 + Styles.BandHeader = cxStyle123 + BuiltIn = True + end + object GridCardViewStyleSheetPumpkinlarge: TcxGridCardViewStyleSheet + Caption = 'Pumpkin (large)' + Styles.Content = cxStyle127 + Styles.ContentEven = cxStyle128 + Styles.ContentOdd = cxStyle129 + Styles.Inactive = cxStyle131 + Styles.Selection = cxStyle124 + Styles.CaptionRow = cxStyle123 + Styles.RowCaption = cxStyle123 + BuiltIn = True + end + object GridTableViewStyleSheetRainyDay: TcxGridTableViewStyleSheet + Caption = 'Rainy Day' + Styles.Content = cxStyle138 + Styles.ContentEven = cxStyle139 + Styles.ContentOdd = cxStyle140 + Styles.Inactive = cxStyle142 + Styles.Selection = cxStyle135 + Styles.Footer = cxStyle133 + Styles.Group = cxStyle141 + Styles.GroupByBox = cxStyle136 + Styles.Header = cxStyle134 + Styles.Indicator = cxStyle143 + Styles.Preview = cxStyle137 + BuiltIn = True + end + object GridBandedTableViewStyleSheetRainyDay: TcxGridBandedTableViewStyleSheet + Caption = 'Rainy Day' + Styles.Content = cxStyle138 + Styles.ContentEven = cxStyle139 + Styles.ContentOdd = cxStyle140 + Styles.Inactive = cxStyle142 + Styles.Selection = cxStyle135 + Styles.Footer = cxStyle133 + Styles.Group = cxStyle141 + Styles.GroupByBox = cxStyle136 + Styles.Header = cxStyle134 + Styles.Indicator = cxStyle143 + Styles.Preview = cxStyle137 + Styles.BandHeader = cxStyle134 + BuiltIn = True + end + object GridCardViewStyleSheetRainyDay: TcxGridCardViewStyleSheet + Caption = 'Rainy Day' + Styles.Content = cxStyle138 + Styles.ContentEven = cxStyle139 + Styles.ContentOdd = cxStyle140 + Styles.Inactive = cxStyle142 + Styles.Selection = cxStyle135 + Styles.CaptionRow = cxStyle134 + Styles.RowCaption = cxStyle134 + BuiltIn = True + end + object GridTableViewStyleSheetRedWhiteandBlueVGA: TcxGridTableViewStyleSheet + Caption = 'Red, White, and Blue (VGA)' + Styles.Content = cxStyle149 + Styles.ContentEven = cxStyle150 + Styles.ContentOdd = cxStyle151 + Styles.Inactive = cxStyle153 + Styles.Selection = cxStyle146 + Styles.Footer = cxStyle144 + Styles.Group = cxStyle152 + Styles.GroupByBox = cxStyle147 + Styles.Header = cxStyle145 + Styles.Indicator = cxStyle154 + Styles.Preview = cxStyle148 + BuiltIn = True + end + object GridBandedTableViewStyleSheetRedWhiteandBlueVGA: TcxGridBandedTableViewStyleSheet + Caption = 'Red, White, and Blue (VGA)' + Styles.Content = cxStyle149 + Styles.ContentEven = cxStyle150 + Styles.ContentOdd = cxStyle151 + Styles.Inactive = cxStyle153 + Styles.Selection = cxStyle146 + Styles.Footer = cxStyle144 + Styles.Group = cxStyle152 + Styles.GroupByBox = cxStyle147 + Styles.Header = cxStyle145 + Styles.Indicator = cxStyle154 + Styles.Preview = cxStyle148 + Styles.BandHeader = cxStyle145 + BuiltIn = True + end + object GridCardViewStyleSheetRedWhiteandBlueVGA: TcxGridCardViewStyleSheet + Caption = 'Red, White, and Blue (VGA)' + Styles.Content = cxStyle149 + Styles.ContentEven = cxStyle150 + Styles.ContentOdd = cxStyle151 + Styles.Inactive = cxStyle153 + Styles.Selection = cxStyle146 + Styles.CaptionRow = cxStyle145 + Styles.RowCaption = cxStyle145 + BuiltIn = True + end + object GridTableViewStyleSheetRose: TcxGridTableViewStyleSheet + Caption = 'Rose' + Styles.Content = cxStyle160 + Styles.ContentEven = cxStyle161 + Styles.ContentOdd = cxStyle162 + Styles.Inactive = cxStyle164 + Styles.Selection = cxStyle157 + Styles.Footer = cxStyle155 + Styles.Group = cxStyle163 + Styles.GroupByBox = cxStyle158 + Styles.Header = cxStyle156 + Styles.Indicator = cxStyle165 + Styles.Preview = cxStyle159 + BuiltIn = True + end + object GridBandedTableViewStyleSheetRose: TcxGridBandedTableViewStyleSheet + Caption = 'Rose' + Styles.Content = cxStyle160 + Styles.ContentEven = cxStyle161 + Styles.ContentOdd = cxStyle162 + Styles.Inactive = cxStyle164 + Styles.Selection = cxStyle157 + Styles.Footer = cxStyle155 + Styles.Group = cxStyle163 + Styles.GroupByBox = cxStyle158 + Styles.Header = cxStyle156 + Styles.Indicator = cxStyle165 + Styles.Preview = cxStyle159 + Styles.BandHeader = cxStyle156 + BuiltIn = True + end + object GridCardViewStyleSheetRose: TcxGridCardViewStyleSheet + Caption = 'Rose' + Styles.Content = cxStyle160 + Styles.ContentEven = cxStyle161 + Styles.ContentOdd = cxStyle162 + Styles.Inactive = cxStyle164 + Styles.Selection = cxStyle157 + Styles.CaptionRow = cxStyle156 + Styles.RowCaption = cxStyle156 + BuiltIn = True + end + object GridTableViewStyleSheetRoselarge: TcxGridTableViewStyleSheet + Caption = 'Rose (large)' + Styles.Content = cxStyle171 + Styles.ContentEven = cxStyle172 + Styles.ContentOdd = cxStyle173 + Styles.Inactive = cxStyle175 + Styles.Selection = cxStyle168 + Styles.Footer = cxStyle166 + Styles.Group = cxStyle174 + Styles.GroupByBox = cxStyle169 + Styles.Header = cxStyle167 + Styles.Indicator = cxStyle176 + Styles.Preview = cxStyle170 + BuiltIn = True + end + object GridBandedTableViewStyleSheetRoselarge: TcxGridBandedTableViewStyleSheet + Caption = 'Rose (large)' + Styles.Content = cxStyle171 + Styles.ContentEven = cxStyle172 + Styles.ContentOdd = cxStyle173 + Styles.Inactive = cxStyle175 + Styles.Selection = cxStyle168 + Styles.Footer = cxStyle166 + Styles.Group = cxStyle174 + Styles.GroupByBox = cxStyle169 + Styles.Header = cxStyle167 + Styles.Indicator = cxStyle176 + Styles.Preview = cxStyle170 + Styles.BandHeader = cxStyle167 + BuiltIn = True + end + object GridCardViewStyleSheetRoselarge: TcxGridCardViewStyleSheet + Caption = 'Rose (large)' + Styles.Content = cxStyle171 + Styles.ContentEven = cxStyle172 + Styles.ContentOdd = cxStyle173 + Styles.Inactive = cxStyle175 + Styles.Selection = cxStyle168 + Styles.CaptionRow = cxStyle167 + Styles.RowCaption = cxStyle167 + BuiltIn = True + end + object GridTableViewStyleSheetSlate: TcxGridTableViewStyleSheet + Caption = 'Slate' + Styles.Content = cxStyle182 + Styles.ContentEven = cxStyle183 + Styles.ContentOdd = cxStyle184 + Styles.Inactive = cxStyle186 + Styles.Selection = cxStyle179 + Styles.Footer = cxStyle177 + Styles.Group = cxStyle185 + Styles.GroupByBox = cxStyle180 + Styles.Header = cxStyle178 + Styles.Indicator = cxStyle187 + Styles.Preview = cxStyle181 + BuiltIn = True + end + object GridBandedTableViewStyleSheetSlate: TcxGridBandedTableViewStyleSheet + Caption = 'Slate' + Styles.Content = cxStyle182 + Styles.ContentEven = cxStyle183 + Styles.ContentOdd = cxStyle184 + Styles.Inactive = cxStyle186 + Styles.Selection = cxStyle179 + Styles.Footer = cxStyle177 + Styles.Group = cxStyle185 + Styles.GroupByBox = cxStyle180 + Styles.Header = cxStyle178 + Styles.Indicator = cxStyle187 + Styles.Preview = cxStyle181 + Styles.BandHeader = cxStyle178 + BuiltIn = True + end + object GridCardViewStyleSheetSlate: TcxGridCardViewStyleSheet + Caption = 'Slate' + Styles.Content = cxStyle182 + Styles.ContentEven = cxStyle183 + Styles.ContentOdd = cxStyle184 + Styles.Inactive = cxStyle186 + Styles.Selection = cxStyle179 + Styles.CaptionRow = cxStyle178 + Styles.RowCaption = cxStyle178 + BuiltIn = True + end + object GridTableViewStyleSheetSpruce: TcxGridTableViewStyleSheet + Caption = 'Spruce' + Styles.Content = cxStyle193 + Styles.ContentEven = cxStyle194 + Styles.ContentOdd = cxStyle195 + Styles.Inactive = cxStyle197 + Styles.Selection = cxStyle190 + Styles.Footer = cxStyle188 + Styles.Group = cxStyle196 + Styles.GroupByBox = cxStyle191 + Styles.Header = cxStyle189 + Styles.Indicator = cxStyle198 + Styles.Preview = cxStyle192 + BuiltIn = True + end + object GridBandedTableViewStyleSheetSpruce: TcxGridBandedTableViewStyleSheet + Caption = 'Spruce' + Styles.Content = cxStyle193 + Styles.ContentEven = cxStyle194 + Styles.ContentOdd = cxStyle195 + Styles.Inactive = cxStyle197 + Styles.Selection = cxStyle190 + Styles.Footer = cxStyle188 + Styles.Group = cxStyle196 + Styles.GroupByBox = cxStyle191 + Styles.Header = cxStyle189 + Styles.Indicator = cxStyle198 + Styles.Preview = cxStyle192 + Styles.BandHeader = cxStyle189 + BuiltIn = True + end + object GridCardViewStyleSheetSpruce: TcxGridCardViewStyleSheet + Caption = 'Spruce' + Styles.Content = cxStyle193 + Styles.ContentEven = cxStyle194 + Styles.ContentOdd = cxStyle195 + Styles.Inactive = cxStyle197 + Styles.Selection = cxStyle190 + Styles.CaptionRow = cxStyle189 + Styles.RowCaption = cxStyle189 + BuiltIn = True + end + object GridTableViewStyleSheetStormVGA: TcxGridTableViewStyleSheet + Caption = 'Storm (VGA)' + Styles.Content = cxStyle204 + Styles.ContentEven = cxStyle205 + Styles.ContentOdd = cxStyle206 + Styles.Inactive = cxStyle208 + Styles.Selection = cxStyle201 + Styles.Footer = cxStyle199 + Styles.Group = cxStyle207 + Styles.GroupByBox = cxStyle202 + Styles.Header = cxStyle200 + Styles.Indicator = cxStyle209 + Styles.Preview = cxStyle203 + BuiltIn = True + end + object GridBandedTableViewStyleSheetStormVGA: TcxGridBandedTableViewStyleSheet + Caption = 'Storm (VGA)' + Styles.Content = cxStyle204 + Styles.ContentEven = cxStyle205 + Styles.ContentOdd = cxStyle206 + Styles.Inactive = cxStyle208 + Styles.Selection = cxStyle201 + Styles.Footer = cxStyle199 + Styles.Group = cxStyle207 + Styles.GroupByBox = cxStyle202 + Styles.Header = cxStyle200 + Styles.Indicator = cxStyle209 + Styles.Preview = cxStyle203 + Styles.BandHeader = cxStyle200 + BuiltIn = True + end + object GridCardViewStyleSheetStormVGA: TcxGridCardViewStyleSheet + Caption = 'Storm (VGA)' + Styles.Content = cxStyle204 + Styles.ContentEven = cxStyle205 + Styles.ContentOdd = cxStyle206 + Styles.Inactive = cxStyle208 + Styles.Selection = cxStyle201 + Styles.CaptionRow = cxStyle200 + Styles.RowCaption = cxStyle200 + BuiltIn = True + end + object GridTableViewStyleSheetTealVGA: TcxGridTableViewStyleSheet + Caption = 'Teal (VGA)' + Styles.Content = cxStyle215 + Styles.ContentEven = cxStyle216 + Styles.ContentOdd = cxStyle217 + Styles.Inactive = cxStyle219 + Styles.Selection = cxStyle212 + Styles.Footer = cxStyle210 + Styles.Group = cxStyle218 + Styles.GroupByBox = cxStyle213 + Styles.Header = cxStyle211 + Styles.Indicator = cxStyle220 + Styles.Preview = cxStyle214 + BuiltIn = True + end + object GridBandedTableViewStyleSheetTealVGA: TcxGridBandedTableViewStyleSheet + Caption = 'Teal (VGA)' + Styles.Content = cxStyle215 + Styles.ContentEven = cxStyle216 + Styles.ContentOdd = cxStyle217 + Styles.Inactive = cxStyle219 + Styles.Selection = cxStyle212 + Styles.Footer = cxStyle210 + Styles.Group = cxStyle218 + Styles.GroupByBox = cxStyle213 + Styles.Header = cxStyle211 + Styles.Indicator = cxStyle220 + Styles.Preview = cxStyle214 + Styles.BandHeader = cxStyle211 + BuiltIn = True + end + object GridCardViewStyleSheetTealVGA: TcxGridCardViewStyleSheet + Caption = 'Teal (VGA)' + Styles.Content = cxStyle215 + Styles.ContentEven = cxStyle216 + Styles.ContentOdd = cxStyle217 + Styles.Inactive = cxStyle219 + Styles.Selection = cxStyle212 + Styles.CaptionRow = cxStyle211 + Styles.CardBorder = cxStyle364 + Styles.RowCaption = cxStyle211 + BuiltIn = True + end + object GridTableViewStyleSheetWheat: TcxGridTableViewStyleSheet + Caption = 'Wheat' + Styles.Content = cxStyle226 + Styles.ContentEven = cxStyle227 + Styles.ContentOdd = cxStyle228 + Styles.Inactive = cxStyle230 + Styles.Selection = cxStyle223 + Styles.Footer = cxStyle221 + Styles.Group = cxStyle229 + Styles.GroupByBox = cxStyle224 + Styles.Header = cxStyle222 + Styles.Indicator = cxStyle231 + Styles.Preview = cxStyle225 + BuiltIn = True + end + object GridBandedTableViewStyleSheetWheat: TcxGridBandedTableViewStyleSheet + Caption = 'Wheat' + Styles.Content = cxStyle226 + Styles.ContentEven = cxStyle227 + Styles.ContentOdd = cxStyle228 + Styles.Inactive = cxStyle230 + Styles.Selection = cxStyle223 + Styles.Footer = cxStyle221 + Styles.Group = cxStyle229 + Styles.GroupByBox = cxStyle224 + Styles.Header = cxStyle222 + Styles.Indicator = cxStyle231 + Styles.Preview = cxStyle225 + Styles.BandHeader = cxStyle222 + BuiltIn = True + end + object GridCardViewStyleSheetWheat: TcxGridCardViewStyleSheet + Caption = 'Wheat' + Styles.Content = cxStyle226 + Styles.ContentEven = cxStyle227 + Styles.ContentOdd = cxStyle228 + Styles.Inactive = cxStyle230 + Styles.Selection = cxStyle223 + Styles.CaptionRow = cxStyle222 + Styles.RowCaption = cxStyle222 + BuiltIn = True + end + object GridTableViewStyleSheetWindowsClassic: TcxGridTableViewStyleSheet + Caption = 'Windows Classic' + Styles.Content = cxStyle237 + Styles.ContentEven = cxStyle238 + Styles.ContentOdd = cxStyle239 + Styles.Inactive = cxStyle241 + Styles.Selection = cxStyle234 + Styles.Footer = cxStyle232 + Styles.Group = cxStyle240 + Styles.GroupByBox = cxStyle235 + Styles.Header = cxStyle233 + Styles.Indicator = cxStyle242 + Styles.Preview = cxStyle236 + BuiltIn = True + end + object GridBandedTableViewStyleSheetWindowsClassic: TcxGridBandedTableViewStyleSheet + Caption = 'Windows Classic' + Styles.Content = cxStyle237 + Styles.ContentEven = cxStyle238 + Styles.ContentOdd = cxStyle239 + Styles.Inactive = cxStyle241 + Styles.Selection = cxStyle234 + Styles.Footer = cxStyle232 + Styles.Group = cxStyle240 + Styles.GroupByBox = cxStyle235 + Styles.Header = cxStyle233 + Styles.Indicator = cxStyle242 + Styles.Preview = cxStyle236 + Styles.BandHeader = cxStyle233 + BuiltIn = True + end + object GridCardViewStyleSheetWindowsClassic: TcxGridCardViewStyleSheet + Caption = 'Windows Classic' + Styles.Content = cxStyle237 + Styles.ContentEven = cxStyle238 + Styles.ContentOdd = cxStyle239 + Styles.Inactive = cxStyle241 + Styles.Selection = cxStyle234 + Styles.CaptionRow = cxStyle233 + Styles.RowCaption = cxStyle233 + BuiltIn = True + end + object GridTableViewStyleSheetWindowsClassiclarge: TcxGridTableViewStyleSheet + Caption = 'Windows Classic (large)' + Styles.Content = cxStyle248 + Styles.ContentEven = cxStyle249 + Styles.ContentOdd = cxStyle250 + Styles.Inactive = cxStyle252 + Styles.Selection = cxStyle245 + Styles.Footer = cxStyle243 + Styles.Group = cxStyle251 + Styles.GroupByBox = cxStyle246 + Styles.Header = cxStyle244 + Styles.Indicator = cxStyle253 + Styles.Preview = cxStyle247 + BuiltIn = True + end + object GridBandedTableViewStyleSheetWindowsClassiclarge: TcxGridBandedTableViewStyleSheet + Caption = 'Windows Classic (large)' + Styles.Content = cxStyle248 + Styles.ContentEven = cxStyle249 + Styles.ContentOdd = cxStyle250 + Styles.Inactive = cxStyle252 + Styles.Selection = cxStyle245 + Styles.Footer = cxStyle243 + Styles.Group = cxStyle251 + Styles.GroupByBox = cxStyle246 + Styles.Header = cxStyle244 + Styles.Indicator = cxStyle253 + Styles.Preview = cxStyle247 + Styles.BandHeader = cxStyle244 + BuiltIn = True + end + object GridCardViewStyleSheetWindowsClassiclarge: TcxGridCardViewStyleSheet + Caption = 'Windows Classic (large)' + Styles.Content = cxStyle248 + Styles.ContentEven = cxStyle249 + Styles.ContentOdd = cxStyle250 + Styles.Inactive = cxStyle252 + Styles.Selection = cxStyle245 + Styles.CaptionRow = cxStyle244 + Styles.RowCaption = cxStyle244 + BuiltIn = True + end + object GridTableViewStyleSheetWindowsStandard: TcxGridTableViewStyleSheet + Caption = 'Windows Standard' + Styles.Content = cxStyle259 + Styles.ContentEven = cxStyle260 + Styles.ContentOdd = cxStyle261 + Styles.Inactive = cxStyle263 + Styles.Selection = cxStyle256 + Styles.Footer = cxStyle254 + Styles.Group = cxStyle262 + Styles.GroupByBox = cxStyle257 + Styles.Header = cxStyle255 + Styles.Indicator = cxStyle264 + Styles.Preview = cxStyle258 + BuiltIn = True + end + object GridBandedTableViewStyleSheetWindowsStandard: TcxGridBandedTableViewStyleSheet + Caption = 'Windows Standard' + Styles.Content = cxStyle259 + Styles.ContentEven = cxStyle260 + Styles.ContentOdd = cxStyle261 + Styles.Inactive = cxStyle263 + Styles.Selection = cxStyle256 + Styles.Footer = cxStyle254 + Styles.Group = cxStyle262 + Styles.GroupByBox = cxStyle257 + Styles.Header = cxStyle255 + Styles.Indicator = cxStyle264 + Styles.Preview = cxStyle258 + Styles.BandHeader = cxStyle255 + BuiltIn = True + end + object GridCardViewStyleSheetWindowsStandard: TcxGridCardViewStyleSheet + Caption = 'Windows Standard' + Styles.Content = cxStyle259 + Styles.ContentEven = cxStyle260 + Styles.ContentOdd = cxStyle261 + Styles.Inactive = cxStyle263 + Styles.Selection = cxStyle256 + Styles.CaptionRow = cxStyle255 + Styles.CardBorder = cxStyle365 + Styles.RowCaption = cxStyle255 + BuiltIn = True + end + object GridTableViewStyleSheetWindowsStandardlarge: TcxGridTableViewStyleSheet + Caption = 'Windows Standard (large)' + Styles.Content = cxStyle270 + Styles.ContentEven = cxStyle271 + Styles.ContentOdd = cxStyle272 + Styles.Inactive = cxStyle274 + Styles.Selection = cxStyle267 + Styles.Footer = cxStyle265 + Styles.Group = cxStyle273 + Styles.GroupByBox = cxStyle268 + Styles.Header = cxStyle266 + Styles.Indicator = cxStyle275 + Styles.Preview = cxStyle269 + BuiltIn = True + end + object GridBandedTableViewStyleSheetWindowsStandardlarge: TcxGridBandedTableViewStyleSheet + Caption = 'Windows Standard (large)' + Styles.Content = cxStyle270 + Styles.ContentEven = cxStyle271 + Styles.ContentOdd = cxStyle272 + Styles.Inactive = cxStyle274 + Styles.Selection = cxStyle267 + Styles.Footer = cxStyle265 + Styles.Group = cxStyle273 + Styles.GroupByBox = cxStyle268 + Styles.Header = cxStyle266 + Styles.Indicator = cxStyle275 + Styles.Preview = cxStyle269 + Styles.BandHeader = cxStyle266 + BuiltIn = True + end + object GridCardViewStyleSheetWindowsStandardlarge: TcxGridCardViewStyleSheet + Caption = 'Windows Standard (large)' + Styles.Content = cxStyle270 + Styles.ContentEven = cxStyle271 + Styles.ContentOdd = cxStyle272 + Styles.Inactive = cxStyle274 + Styles.Selection = cxStyle267 + Styles.CaptionRow = cxStyle266 + Styles.CardBorder = cxStyle366 + Styles.RowCaption = cxStyle266 + BuiltIn = True + end + object GridTableViewStyleSheetHighContrast1: TcxGridTableViewStyleSheet + Caption = 'High Contrast #1' + Styles.Content = cxStyle281 + Styles.ContentEven = cxStyle282 + Styles.ContentOdd = cxStyle283 + Styles.Inactive = cxStyle285 + Styles.Selection = cxStyle278 + Styles.Footer = cxStyle276 + Styles.Group = cxStyle284 + Styles.GroupByBox = cxStyle279 + Styles.Header = cxStyle277 + Styles.Indicator = cxStyle286 + Styles.Preview = cxStyle280 + BuiltIn = True + end + object GridBandedTableViewStyleSheetHighContrast1: TcxGridBandedTableViewStyleSheet + Caption = 'High Contrast #1' + Styles.Content = cxStyle281 + Styles.ContentEven = cxStyle282 + Styles.ContentOdd = cxStyle283 + Styles.Inactive = cxStyle285 + Styles.Selection = cxStyle278 + Styles.Footer = cxStyle276 + Styles.Group = cxStyle284 + Styles.GroupByBox = cxStyle279 + Styles.Header = cxStyle277 + Styles.Indicator = cxStyle286 + Styles.Preview = cxStyle280 + Styles.BandHeader = cxStyle286 + BuiltIn = True + end + object GridCardViewStyleSheetHighContrast1: TcxGridCardViewStyleSheet + Caption = 'High Contrast #1' + Styles.Content = cxStyle281 + Styles.ContentEven = cxStyle282 + Styles.ContentOdd = cxStyle283 + Styles.Inactive = cxStyle285 + Styles.Selection = cxStyle278 + Styles.CaptionRow = cxStyle277 + Styles.RowCaption = cxStyle277 + BuiltIn = True + end + object GridTableViewStyleSheetHighContrast1large: TcxGridTableViewStyleSheet + Caption = 'High Contrast #1 (large)' + Styles.Content = cxStyle292 + Styles.ContentEven = cxStyle293 + Styles.ContentOdd = cxStyle294 + Styles.Inactive = cxStyle296 + Styles.Selection = cxStyle289 + Styles.Footer = cxStyle287 + Styles.Group = cxStyle295 + Styles.GroupByBox = cxStyle290 + Styles.Header = cxStyle288 + Styles.Indicator = cxStyle297 + Styles.Preview = cxStyle291 + BuiltIn = True + end + object GridBandedTableViewStyleSheetHighContrast1large: TcxGridBandedTableViewStyleSheet + Caption = 'High Contrast #1 (large)' + Styles.Content = cxStyle292 + Styles.ContentEven = cxStyle293 + Styles.ContentOdd = cxStyle294 + Styles.Inactive = cxStyle296 + Styles.Selection = cxStyle289 + Styles.Footer = cxStyle287 + Styles.Group = cxStyle295 + Styles.GroupByBox = cxStyle290 + Styles.Header = cxStyle288 + Styles.Indicator = cxStyle297 + Styles.Preview = cxStyle291 + Styles.BandHeader = cxStyle297 + BuiltIn = True + end + object GridCardViewStyleSheetHighContrast1large: TcxGridCardViewStyleSheet + Caption = 'High Contrast #1 (large)' + Styles.Content = cxStyle292 + Styles.ContentEven = cxStyle293 + Styles.ContentOdd = cxStyle294 + Styles.Inactive = cxStyle296 + Styles.Selection = cxStyle289 + Styles.CaptionRow = cxStyle288 + Styles.RowCaption = cxStyle288 + BuiltIn = True + end + object GridTableViewStyleSheetHighContrast2: TcxGridTableViewStyleSheet + Caption = 'High Contrast #2' + Styles.Content = cxStyle303 + Styles.ContentEven = cxStyle304 + Styles.ContentOdd = cxStyle305 + Styles.Inactive = cxStyle307 + Styles.Selection = cxStyle300 + Styles.Footer = cxStyle298 + Styles.Group = cxStyle306 + Styles.GroupByBox = cxStyle301 + Styles.Header = cxStyle299 + Styles.Indicator = cxStyle308 + Styles.Preview = cxStyle302 + BuiltIn = True + end + object GridBandedTableViewStyleSheetHighContrast2: TcxGridBandedTableViewStyleSheet + Caption = 'High Contrast #2' + Styles.Content = cxStyle303 + Styles.ContentEven = cxStyle304 + Styles.ContentOdd = cxStyle305 + Styles.Inactive = cxStyle307 + Styles.Selection = cxStyle300 + Styles.Footer = cxStyle298 + Styles.Group = cxStyle306 + Styles.GroupByBox = cxStyle301 + Styles.Header = cxStyle299 + Styles.Indicator = cxStyle308 + Styles.Preview = cxStyle302 + Styles.BandHeader = cxStyle308 + BuiltIn = True + end + object GridCardViewStyleSheetHighContrast2: TcxGridCardViewStyleSheet + Caption = 'High Contrast #2' + Styles.Content = cxStyle303 + Styles.ContentEven = cxStyle304 + Styles.ContentOdd = cxStyle305 + Styles.Inactive = cxStyle307 + Styles.Selection = cxStyle300 + Styles.CaptionRow = cxStyle299 + Styles.RowCaption = cxStyle299 + BuiltIn = True + end + object GridTableViewStyleSheetHighContrast2large: TcxGridTableViewStyleSheet + Caption = 'High Contrast #2 (large)' + Styles.Content = cxStyle314 + Styles.ContentEven = cxStyle315 + Styles.ContentOdd = cxStyle316 + Styles.Inactive = cxStyle318 + Styles.Selection = cxStyle311 + Styles.Footer = cxStyle309 + Styles.Group = cxStyle317 + Styles.GroupByBox = cxStyle312 + Styles.Header = cxStyle310 + Styles.Indicator = cxStyle319 + Styles.Preview = cxStyle313 + BuiltIn = True + end + object GridBandedTableViewStyleSheetHighContrast2large: TcxGridBandedTableViewStyleSheet + Caption = 'High Contrast #2 (large)' + Styles.Content = cxStyle314 + Styles.ContentEven = cxStyle315 + Styles.ContentOdd = cxStyle316 + Styles.Inactive = cxStyle318 + Styles.Selection = cxStyle311 + Styles.Footer = cxStyle309 + Styles.Group = cxStyle317 + Styles.GroupByBox = cxStyle312 + Styles.Header = cxStyle310 + Styles.Indicator = cxStyle319 + Styles.Preview = cxStyle313 + Styles.BandHeader = cxStyle319 + BuiltIn = True + end + object GridCardViewStyleSheetHighContrast2large: TcxGridCardViewStyleSheet + Caption = 'High Contrast #2 (large)' + Styles.Content = cxStyle314 + Styles.ContentEven = cxStyle315 + Styles.ContentOdd = cxStyle316 + Styles.Inactive = cxStyle318 + Styles.Selection = cxStyle311 + Styles.CaptionRow = cxStyle310 + Styles.RowCaption = cxStyle310 + BuiltIn = True + end + object GridTableViewStyleSheetHighContrastBlack: TcxGridTableViewStyleSheet + Caption = 'High Contrast Black' + Styles.Content = cxStyle325 + Styles.ContentEven = cxStyle326 + Styles.ContentOdd = cxStyle327 + Styles.Inactive = cxStyle329 + Styles.Selection = cxStyle322 + Styles.Footer = cxStyle320 + Styles.Group = cxStyle328 + Styles.GroupByBox = cxStyle323 + Styles.Header = cxStyle321 + Styles.Indicator = cxStyle330 + Styles.Preview = cxStyle324 + BuiltIn = True + end + object GridBandedTableViewStyleSheetHighContrastBlack: TcxGridBandedTableViewStyleSheet + Caption = 'High Contrast Black' + Styles.Content = cxStyle325 + Styles.ContentEven = cxStyle326 + Styles.ContentOdd = cxStyle327 + Styles.Inactive = cxStyle329 + Styles.Selection = cxStyle322 + Styles.Footer = cxStyle320 + Styles.Group = cxStyle328 + Styles.GroupByBox = cxStyle323 + Styles.Header = cxStyle321 + Styles.Indicator = cxStyle330 + Styles.Preview = cxStyle324 + Styles.BandHeader = cxStyle330 + BuiltIn = True + end + object GridCardViewStyleSheetHighContrastBlack: TcxGridCardViewStyleSheet + Caption = 'High Contrast Black' + Styles.Content = cxStyle325 + Styles.ContentEven = cxStyle326 + Styles.ContentOdd = cxStyle327 + Styles.Inactive = cxStyle329 + Styles.Selection = cxStyle322 + Styles.CaptionRow = cxStyle321 + Styles.RowCaption = cxStyle321 + BuiltIn = True + end + object GridTableViewStyleSheetHighContrastBlacklarge: TcxGridTableViewStyleSheet + Caption = 'High Contrast Black (large)' + Styles.Content = cxStyle336 + Styles.ContentEven = cxStyle337 + Styles.ContentOdd = cxStyle338 + Styles.Inactive = cxStyle340 + Styles.Selection = cxStyle333 + Styles.Footer = cxStyle331 + Styles.Group = cxStyle339 + Styles.GroupByBox = cxStyle334 + Styles.Header = cxStyle332 + Styles.Indicator = cxStyle341 + Styles.Preview = cxStyle335 + BuiltIn = True + end + object GridBandedTableViewStyleSheetHighContrastBlacklarge: TcxGridBandedTableViewStyleSheet + Caption = 'High Contrast Black (large)' + Styles.Content = cxStyle336 + Styles.ContentEven = cxStyle337 + Styles.ContentOdd = cxStyle338 + Styles.Inactive = cxStyle340 + Styles.Selection = cxStyle333 + Styles.Footer = cxStyle331 + Styles.Group = cxStyle339 + Styles.GroupByBox = cxStyle334 + Styles.Header = cxStyle332 + Styles.Indicator = cxStyle341 + Styles.Preview = cxStyle335 + Styles.BandHeader = cxStyle341 + BuiltIn = True + end + object GridCardViewStyleSheetHighContrastBlacklarge: TcxGridCardViewStyleSheet + Caption = 'High Contrast Black (large)' + Styles.Content = cxStyle336 + Styles.ContentEven = cxStyle337 + Styles.ContentOdd = cxStyle338 + Styles.Inactive = cxStyle340 + Styles.Selection = cxStyle333 + Styles.CaptionRow = cxStyle332 + Styles.RowCaption = cxStyle332 + BuiltIn = True + end + object GridTableViewStyleSheetHighContrastWhite: TcxGridTableViewStyleSheet + Caption = 'High Contrast White' + Styles.Content = cxStyle347 + Styles.ContentEven = cxStyle348 + Styles.ContentOdd = cxStyle349 + Styles.Inactive = cxStyle351 + Styles.Selection = cxStyle344 + Styles.Footer = cxStyle342 + Styles.Group = cxStyle350 + Styles.GroupByBox = cxStyle345 + Styles.Header = cxStyle343 + Styles.Indicator = cxStyle352 + Styles.Preview = cxStyle346 + BuiltIn = True + end + object GridBandedTableViewStyleSheetHighContrastWhite: TcxGridBandedTableViewStyleSheet + Caption = 'High Contrast White' + Styles.Content = cxStyle347 + Styles.ContentEven = cxStyle348 + Styles.ContentOdd = cxStyle349 + Styles.Inactive = cxStyle351 + Styles.Selection = cxStyle344 + Styles.Footer = cxStyle342 + Styles.Group = cxStyle350 + Styles.GroupByBox = cxStyle345 + Styles.Header = cxStyle343 + Styles.Indicator = cxStyle352 + Styles.Preview = cxStyle346 + Styles.BandHeader = cxStyle343 + BuiltIn = True + end + object GridCardViewStyleSheetHighContrastWhite: TcxGridCardViewStyleSheet + Caption = 'High Contrast White' + Styles.Content = cxStyle347 + Styles.ContentEven = cxStyle348 + Styles.ContentOdd = cxStyle349 + Styles.Inactive = cxStyle351 + Styles.Selection = cxStyle344 + Styles.CaptionRow = cxStyle343 + Styles.RowCaption = cxStyle343 + BuiltIn = True + end + object GridTableViewStyleSheetHighContrastWhitelarge: TcxGridTableViewStyleSheet + Caption = 'High Contrast White (large)' + Styles.Content = cxStyle358 + Styles.ContentEven = cxStyle359 + Styles.ContentOdd = cxStyle360 + Styles.Inactive = cxStyle362 + Styles.Selection = cxStyle355 + Styles.Footer = cxStyle353 + Styles.Group = cxStyle361 + Styles.GroupByBox = cxStyle356 + Styles.Header = cxStyle354 + Styles.Indicator = cxStyle363 + Styles.Preview = cxStyle357 + BuiltIn = True + end + object GridBandedTableViewStyleSheetHighContrastWhitelarge: TcxGridBandedTableViewStyleSheet + Caption = 'High Contrast White (large)' + Styles.Content = cxStyle358 + Styles.ContentEven = cxStyle359 + Styles.ContentOdd = cxStyle360 + Styles.Inactive = cxStyle362 + Styles.Selection = cxStyle355 + Styles.Footer = cxStyle353 + Styles.Group = cxStyle361 + Styles.GroupByBox = cxStyle356 + Styles.Header = cxStyle354 + Styles.Indicator = cxStyle363 + Styles.Preview = cxStyle357 + Styles.BandHeader = cxStyle354 + BuiltIn = True + end + object GridCardViewStyleSheetHighContrastWhitelarge: TcxGridCardViewStyleSheet + Caption = 'High Contrast White (large)' + Styles.Content = cxStyle358 + Styles.ContentEven = cxStyle359 + Styles.ContentOdd = cxStyle360 + Styles.Inactive = cxStyle362 + Styles.Selection = cxStyle355 + Styles.CaptionRow = cxStyle354 + Styles.RowCaption = cxStyle354 + BuiltIn = True + end + end +end diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridPredefinedStyles.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridPredefinedStyles.pas new file mode 100644 index 00000000..f9e375b7 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridPredefinedStyles.pas @@ -0,0 +1,568 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridPredefinedStyles; + +{$I cxVer.inc} + +interface + +uses + SysUtils, Classes, Forms, cxClasses, cxStyles, + cxGridTableView, cxGridBandedTableView, cxGridCardView; + +type + TcxdmGridPredefinedStyles = class(TDataModule) + StyleRepository: TcxStyleRepository; + cxStyle1: TcxStyle; + cxStyle2: TcxStyle; + cxStyle3: TcxStyle; + cxStyle4: TcxStyle; + cxStyle5: TcxStyle; + cxStyle6: TcxStyle; + cxStyle7: TcxStyle; + cxStyle8: TcxStyle; + cxStyle9: TcxStyle; + cxStyle10: TcxStyle; + cxStyle11: TcxStyle; + cxStyle12: TcxStyle; + cxStyle13: TcxStyle; + cxStyle14: TcxStyle; + cxStyle15: TcxStyle; + cxStyle16: TcxStyle; + cxStyle17: TcxStyle; + cxStyle18: TcxStyle; + cxStyle19: TcxStyle; + cxStyle20: TcxStyle; + cxStyle21: TcxStyle; + cxStyle22: TcxStyle; + cxStyle23: TcxStyle; + cxStyle24: TcxStyle; + cxStyle25: TcxStyle; + cxStyle26: TcxStyle; + cxStyle27: TcxStyle; + cxStyle28: TcxStyle; + cxStyle29: TcxStyle; + cxStyle30: TcxStyle; + cxStyle31: TcxStyle; + cxStyle32: TcxStyle; + cxStyle33: TcxStyle; + cxStyle34: TcxStyle; + cxStyle35: TcxStyle; + cxStyle36: TcxStyle; + cxStyle37: TcxStyle; + cxStyle38: TcxStyle; + cxStyle39: TcxStyle; + cxStyle40: TcxStyle; + cxStyle41: TcxStyle; + cxStyle42: TcxStyle; + cxStyle43: TcxStyle; + cxStyle44: TcxStyle; + cxStyle45: TcxStyle; + cxStyle46: TcxStyle; + cxStyle47: TcxStyle; + cxStyle48: TcxStyle; + cxStyle49: TcxStyle; + cxStyle50: TcxStyle; + cxStyle51: TcxStyle; + cxStyle52: TcxStyle; + cxStyle53: TcxStyle; + cxStyle54: TcxStyle; + cxStyle55: TcxStyle; + cxStyle56: TcxStyle; + cxStyle57: TcxStyle; + cxStyle58: TcxStyle; + cxStyle59: TcxStyle; + cxStyle60: TcxStyle; + cxStyle61: TcxStyle; + cxStyle62: TcxStyle; + cxStyle63: TcxStyle; + cxStyle64: TcxStyle; + cxStyle65: TcxStyle; + cxStyle66: TcxStyle; + cxStyle67: TcxStyle; + cxStyle68: TcxStyle; + cxStyle69: TcxStyle; + cxStyle70: TcxStyle; + cxStyle71: TcxStyle; + cxStyle72: TcxStyle; + cxStyle73: TcxStyle; + cxStyle74: TcxStyle; + cxStyle75: TcxStyle; + cxStyle76: TcxStyle; + cxStyle77: TcxStyle; + cxStyle78: TcxStyle; + cxStyle79: TcxStyle; + cxStyle80: TcxStyle; + cxStyle81: TcxStyle; + cxStyle82: TcxStyle; + cxStyle83: TcxStyle; + cxStyle84: TcxStyle; + cxStyle85: TcxStyle; + cxStyle86: TcxStyle; + cxStyle87: TcxStyle; + cxStyle88: TcxStyle; + cxStyle89: TcxStyle; + cxStyle90: TcxStyle; + cxStyle91: TcxStyle; + cxStyle92: TcxStyle; + cxStyle93: TcxStyle; + cxStyle94: TcxStyle; + cxStyle95: TcxStyle; + cxStyle96: TcxStyle; + cxStyle97: TcxStyle; + cxStyle98: TcxStyle; + cxStyle99: TcxStyle; + cxStyle100: TcxStyle; + cxStyle101: TcxStyle; + cxStyle102: TcxStyle; + cxStyle103: TcxStyle; + cxStyle104: TcxStyle; + cxStyle105: TcxStyle; + cxStyle106: TcxStyle; + cxStyle107: TcxStyle; + cxStyle108: TcxStyle; + cxStyle109: TcxStyle; + cxStyle110: TcxStyle; + cxStyle111: TcxStyle; + cxStyle112: TcxStyle; + cxStyle113: TcxStyle; + cxStyle114: TcxStyle; + cxStyle115: TcxStyle; + cxStyle116: TcxStyle; + cxStyle117: TcxStyle; + cxStyle118: TcxStyle; + cxStyle119: TcxStyle; + cxStyle120: TcxStyle; + cxStyle121: TcxStyle; + cxStyle122: TcxStyle; + cxStyle123: TcxStyle; + cxStyle124: TcxStyle; + cxStyle125: TcxStyle; + cxStyle126: TcxStyle; + cxStyle127: TcxStyle; + cxStyle128: TcxStyle; + cxStyle129: TcxStyle; + cxStyle130: TcxStyle; + cxStyle131: TcxStyle; + cxStyle132: TcxStyle; + cxStyle133: TcxStyle; + cxStyle134: TcxStyle; + cxStyle135: TcxStyle; + cxStyle136: TcxStyle; + cxStyle137: TcxStyle; + cxStyle138: TcxStyle; + cxStyle139: TcxStyle; + cxStyle140: TcxStyle; + cxStyle141: TcxStyle; + cxStyle142: TcxStyle; + cxStyle143: TcxStyle; + cxStyle144: TcxStyle; + cxStyle145: TcxStyle; + cxStyle146: TcxStyle; + cxStyle147: TcxStyle; + cxStyle148: TcxStyle; + cxStyle149: TcxStyle; + cxStyle150: TcxStyle; + cxStyle151: TcxStyle; + cxStyle152: TcxStyle; + cxStyle153: TcxStyle; + cxStyle154: TcxStyle; + cxStyle155: TcxStyle; + cxStyle156: TcxStyle; + cxStyle157: TcxStyle; + cxStyle158: TcxStyle; + cxStyle159: TcxStyle; + cxStyle160: TcxStyle; + cxStyle161: TcxStyle; + cxStyle162: TcxStyle; + cxStyle163: TcxStyle; + cxStyle164: TcxStyle; + cxStyle165: TcxStyle; + cxStyle166: TcxStyle; + cxStyle167: TcxStyle; + cxStyle168: TcxStyle; + cxStyle169: TcxStyle; + cxStyle170: TcxStyle; + cxStyle171: TcxStyle; + cxStyle172: TcxStyle; + cxStyle173: TcxStyle; + cxStyle174: TcxStyle; + cxStyle175: TcxStyle; + cxStyle176: TcxStyle; + cxStyle177: TcxStyle; + cxStyle178: TcxStyle; + cxStyle179: TcxStyle; + cxStyle180: TcxStyle; + cxStyle181: TcxStyle; + cxStyle182: TcxStyle; + cxStyle183: TcxStyle; + cxStyle184: TcxStyle; + cxStyle185: TcxStyle; + cxStyle186: TcxStyle; + cxStyle187: TcxStyle; + cxStyle188: TcxStyle; + cxStyle189: TcxStyle; + cxStyle190: TcxStyle; + cxStyle191: TcxStyle; + cxStyle192: TcxStyle; + cxStyle193: TcxStyle; + cxStyle194: TcxStyle; + cxStyle195: TcxStyle; + cxStyle196: TcxStyle; + cxStyle197: TcxStyle; + cxStyle198: TcxStyle; + cxStyle199: TcxStyle; + cxStyle200: TcxStyle; + cxStyle201: TcxStyle; + cxStyle202: TcxStyle; + cxStyle203: TcxStyle; + cxStyle204: TcxStyle; + cxStyle205: TcxStyle; + cxStyle206: TcxStyle; + cxStyle207: TcxStyle; + cxStyle208: TcxStyle; + cxStyle209: TcxStyle; + cxStyle210: TcxStyle; + cxStyle211: TcxStyle; + cxStyle212: TcxStyle; + cxStyle213: TcxStyle; + cxStyle214: TcxStyle; + cxStyle215: TcxStyle; + cxStyle216: TcxStyle; + cxStyle217: TcxStyle; + cxStyle218: TcxStyle; + cxStyle219: TcxStyle; + cxStyle220: TcxStyle; + cxStyle221: TcxStyle; + cxStyle222: TcxStyle; + cxStyle223: TcxStyle; + cxStyle224: TcxStyle; + cxStyle225: TcxStyle; + cxStyle226: TcxStyle; + cxStyle227: TcxStyle; + cxStyle228: TcxStyle; + cxStyle229: TcxStyle; + cxStyle230: TcxStyle; + cxStyle231: TcxStyle; + cxStyle232: TcxStyle; + cxStyle233: TcxStyle; + cxStyle234: TcxStyle; + cxStyle235: TcxStyle; + cxStyle236: TcxStyle; + cxStyle237: TcxStyle; + cxStyle238: TcxStyle; + cxStyle239: TcxStyle; + cxStyle240: TcxStyle; + cxStyle241: TcxStyle; + cxStyle242: TcxStyle; + cxStyle243: TcxStyle; + cxStyle244: TcxStyle; + cxStyle245: TcxStyle; + cxStyle246: TcxStyle; + cxStyle247: TcxStyle; + cxStyle248: TcxStyle; + cxStyle249: TcxStyle; + cxStyle250: TcxStyle; + cxStyle251: TcxStyle; + cxStyle252: TcxStyle; + cxStyle253: TcxStyle; + cxStyle254: TcxStyle; + cxStyle255: TcxStyle; + cxStyle256: TcxStyle; + cxStyle257: TcxStyle; + cxStyle258: TcxStyle; + cxStyle259: TcxStyle; + cxStyle260: TcxStyle; + cxStyle261: TcxStyle; + cxStyle262: TcxStyle; + cxStyle263: TcxStyle; + cxStyle264: TcxStyle; + cxStyle265: TcxStyle; + cxStyle266: TcxStyle; + cxStyle267: TcxStyle; + cxStyle268: TcxStyle; + cxStyle269: TcxStyle; + cxStyle270: TcxStyle; + cxStyle271: TcxStyle; + cxStyle272: TcxStyle; + cxStyle273: TcxStyle; + cxStyle274: TcxStyle; + cxStyle275: TcxStyle; + cxStyle276: TcxStyle; + cxStyle277: TcxStyle; + cxStyle278: TcxStyle; + cxStyle279: TcxStyle; + cxStyle280: TcxStyle; + cxStyle281: TcxStyle; + cxStyle282: TcxStyle; + cxStyle283: TcxStyle; + cxStyle284: TcxStyle; + cxStyle285: TcxStyle; + cxStyle286: TcxStyle; + cxStyle287: TcxStyle; + cxStyle288: TcxStyle; + cxStyle289: TcxStyle; + cxStyle290: TcxStyle; + cxStyle291: TcxStyle; + cxStyle292: TcxStyle; + cxStyle293: TcxStyle; + cxStyle294: TcxStyle; + cxStyle295: TcxStyle; + cxStyle296: TcxStyle; + cxStyle297: TcxStyle; + cxStyle298: TcxStyle; + cxStyle299: TcxStyle; + cxStyle300: TcxStyle; + cxStyle301: TcxStyle; + cxStyle302: TcxStyle; + cxStyle303: TcxStyle; + cxStyle304: TcxStyle; + cxStyle305: TcxStyle; + cxStyle306: TcxStyle; + cxStyle307: TcxStyle; + cxStyle308: TcxStyle; + cxStyle309: TcxStyle; + cxStyle310: TcxStyle; + cxStyle311: TcxStyle; + cxStyle312: TcxStyle; + cxStyle313: TcxStyle; + cxStyle314: TcxStyle; + cxStyle315: TcxStyle; + cxStyle316: TcxStyle; + cxStyle317: TcxStyle; + cxStyle318: TcxStyle; + cxStyle319: TcxStyle; + cxStyle320: TcxStyle; + cxStyle321: TcxStyle; + cxStyle322: TcxStyle; + cxStyle323: TcxStyle; + cxStyle324: TcxStyle; + cxStyle325: TcxStyle; + cxStyle326: TcxStyle; + cxStyle327: TcxStyle; + cxStyle328: TcxStyle; + cxStyle329: TcxStyle; + cxStyle330: TcxStyle; + cxStyle331: TcxStyle; + cxStyle332: TcxStyle; + cxStyle333: TcxStyle; + cxStyle334: TcxStyle; + cxStyle335: TcxStyle; + cxStyle336: TcxStyle; + cxStyle337: TcxStyle; + cxStyle338: TcxStyle; + cxStyle339: TcxStyle; + cxStyle340: TcxStyle; + cxStyle341: TcxStyle; + cxStyle342: TcxStyle; + cxStyle343: TcxStyle; + cxStyle344: TcxStyle; + cxStyle345: TcxStyle; + cxStyle346: TcxStyle; + cxStyle347: TcxStyle; + cxStyle348: TcxStyle; + cxStyle349: TcxStyle; + cxStyle350: TcxStyle; + cxStyle351: TcxStyle; + cxStyle352: TcxStyle; + cxStyle353: TcxStyle; + cxStyle354: TcxStyle; + cxStyle355: TcxStyle; + cxStyle356: TcxStyle; + cxStyle357: TcxStyle; + cxStyle358: TcxStyle; + cxStyle359: TcxStyle; + cxStyle360: TcxStyle; + cxStyle361: TcxStyle; + cxStyle362: TcxStyle; + cxStyle363: TcxStyle; + GridTableViewStyleSheetDevExpress: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetDevExpress: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetDevExpress: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetUserFormat1: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetUserFormat1: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetUserFormat1: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetUserFormat2: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetUserFormat2: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetUserFormat2: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetUserFormat3: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetUserFormat3: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetUserFormat3: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetUserFormat4: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetUserFormat4: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetUserFormat4: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetBrick: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetBrick: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetBrick: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetDesert: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetDesert: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetDesert: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetEggplant: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetEggplant: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetEggplant: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetLilac: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetLilac: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetLilac: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetMaple: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetMaple: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetMaple: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetMarinehighcolor: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetMarinehighcolor: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetMarinehighcolor: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetPlumhighcolor: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetPlumhighcolor: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetPlumhighcolor: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetPumpkinlarge: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetPumpkinlarge: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetPumpkinlarge: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetRainyDay: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetRainyDay: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetRainyDay: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetRedWhiteandBlueVGA: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetRedWhiteandBlueVGA: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetRedWhiteandBlueVGA: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetRose: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetRose: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetRose: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetRoselarge: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetRoselarge: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetRoselarge: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetSlate: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetSlate: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetSlate: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetSpruce: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetSpruce: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetSpruce: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetStormVGA: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetStormVGA: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetStormVGA: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetTealVGA: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetTealVGA: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetTealVGA: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetWheat: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetWheat: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetWheat: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetWindowsClassic: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetWindowsClassic: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetWindowsClassic: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetWindowsClassiclarge: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetWindowsClassiclarge: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetWindowsClassiclarge: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetWindowsStandard: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetWindowsStandard: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetWindowsStandard: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetWindowsStandardlarge: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetWindowsStandardlarge: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetWindowsStandardlarge: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetHighContrast1: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetHighContrast1: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetHighContrast1: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetHighContrast1large: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetHighContrast1large: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetHighContrast1large: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetHighContrast2: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetHighContrast2: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetHighContrast2: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetHighContrast2large: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetHighContrast2large: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetHighContrast2large: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetHighContrastBlack: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetHighContrastBlack: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetHighContrastBlack: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetHighContrastBlacklarge: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetHighContrastBlacklarge: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetHighContrastBlacklarge: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetHighContrastWhite: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetHighContrastWhite: TcxGridBandedTableViewStyleSheet; + GridCardViewStyleSheetHighContrastWhite: TcxGridCardViewStyleSheet; + GridTableViewStyleSheetHighContrastWhitelarge: TcxGridTableViewStyleSheet; + GridBandedTableViewStyleSheetHighContrastWhitelarge: TcxGridBandedTableViewStyleSheet; + ClassicRowCaption: TcxStyle; + cxStyle364: TcxStyle; + cxStyle365: TcxStyle; + cxStyle366: TcxStyle; + private + { Private declarations } + public + { Public declarations } + end; + +implementation + +{$R *.dfm} + +uses + cxStyleSheetsLoad; + +type +TcxGridPredefinedStyleSheets = class(TcxPredefinedStyleSheets) +private + FData: TcxdmGridPredefinedStyles; +protected + procedure AddStyleSheets; override; +public + constructor Create; override; + destructor Destroy; override; +end; + +{ TcxGridPredefinedStyleSheets } +constructor TcxGridPredefinedStyleSheets.Create; +begin + inherited Create; + FData := TcxdmGridPredefinedStyles.Create(nil); + AddStyleSheets; +end; + +destructor TcxGridPredefinedStyleSheets.Destroy; +begin + FData.Free; + inherited Destroy; +end; + +procedure TcxGridPredefinedStyleSheets.AddStyleSheets; +var + I: Integer; +begin + for I := 0 to FData.StyleRepository.StyleSheetCount - 1 do + AddStyleSheet(FData.StyleRepository.StyleSheets[I]); +end; + +initialization + RegisterPredefinedStyleSheets(TcxGridPredefinedStyleSheets); + +finalization + UnregisterPredefinedStyleSheets(TcxGridPredefinedStyleSheets); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridReg.dcr b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridReg.dcr new file mode 100644 index 00000000..676aae5e Binary files /dev/null and b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridReg.dcr differ diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridReg.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridReg.pas new file mode 100644 index 00000000..97c96b7b --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridReg.pas @@ -0,0 +1,1331 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridReg; + +{$I cxVer.inc} + +interface + +const + cxGridVersion = '6.35'; + +procedure Register; + +implementation + +uses + Windows, +{$IFDEF DELPHI6} + DesignEditors, DesignIntf, DesignMenus, VCLEditors, + Types, +{$ELSE} + DsgnIntf, +{$ENDIF} +{$IFNDEF NONDB} + DB, cxDBData, cxDBExtLookupComboBox, cxGridDBBandedTableView, + cxGridDBCardView, cxGridDBDataDefinitions, cxGridDBTableView, cxGridDBChartView, +{$ENDIF} + cxGridImportDialog, + Classes, Controls, ExtCtrls, Graphics, Menus, SysUtils, TypInfo, ImgList, cxControls, + cxCustomData, cxDataStorage, cxEdit, cxEditPropEditors, + cxEditRepositoryEditor, cxEditRepositoryItems, cxGrid, cxGridBandedTableView, + cxGridCardView, cxGridCommon, cxGridCustomTableView, cxGridCustomView, cxGridChartView, + cxGridEditor, cxGridLevel, cxGridStrs, cxGridStructureNavigator, + cxGridTableView, cxImageComboBox, cxImageComboBoxItemsEditor, cxLibraryReg, + cxPropEditors, cxStyles, cxViewEditor, cxBandedTableViewEditor, cxCardViewEditor, + cxChartViewEditor, cxGridPredefinedStyles, cxGridStyleSheetsPreview; + +const + UnitNamePrefix = ''; + +{ TGridEditor } + +const + GridEditorVerbs: array [0..4] of string = ( + 'Editor...', + 'Import...', + '-', + 'ExpressQuantumGrid Suite ' + cxGridVersion, + 'www.devexpress.com' + ); + + AddOnInsertPosition = 2; + +type + TViewMenuItemAction = (vmiaExecute, vmiaGetCaption, vmiaPrepare); + + TGridEditor = class(TComponentEditor) + private + FViewMenuProvider: TcxCustomGridViewMenuProvider; + function GetGrid: TcxCustomGrid; + function GetGridView: TcxCustomGridView; + protected + function GetViewMenuItemCount: Integer; + function ProcessViewMenuItem(var AIndex: Integer; AAction: TViewMenuItemAction; + const ADesignMenuItem: TDesignMenuItem = nil): Boolean; + + property Grid: TcxCustomGrid read GetGrid; + property GridView: TcxCustomGridView read GetGridView; + property ViewMenuProvider: TcxCustomGridViewMenuProvider read FViewMenuProvider; + public + destructor Destroy; override; + procedure ExecuteVerb(Index: Integer); override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + procedure PrepareItem(Index: Integer; const AItem: TDesignMenuItem); override; + end; + +destructor TGridEditor.Destroy; +begin + FViewMenuProvider.Free; + inherited; +end; + +function TGridEditor.GetGrid: TcxCustomGrid; +begin + Result := TcxCustomGrid(Component); +end; + +function TGridEditor.GetGridView: TcxCustomGridView; +begin + Result := Grid.ActiveView; + if (Result <> nil) and Result.IsMaster then + Result := nil; +end; + +function TGridEditor.GetViewMenuItemCount: Integer; +begin + if ViewMenuProvider = nil then + Result := 0 + else + Result := 1 + ViewMenuProvider.Items.Count; // 1 - for separator +end; + +function TGridEditor.ProcessViewMenuItem(var AIndex: Integer; + AAction: TViewMenuItemAction; const ADesignMenuItem: TDesignMenuItem = nil): Boolean; +var + AMenuProviderItem: TcxGridViewMenuItem; +begin + Result := False; + if (AIndex >= AddOnInsertPosition) and (ViewMenuProvider <> nil) then + if AIndex - AddOnInsertPosition < GetViewMenuItemCount then + begin + if AIndex = AddOnInsertPosition then // separator + AMenuProviderItem := nil + else + AMenuProviderItem := ViewMenuProvider.Items[AIndex - AddOnInsertPosition - 1]; + case AAction of + vmiaExecute: + if AMenuProviderItem <> nil then + AMenuProviderItem.DoAction; + vmiaGetCaption: ; + vmiaPrepare: + if AMenuProviderItem = nil then + ADesignMenuItem.Caption := cxGridViewMenuSeparatorCaption + else + AMenuProviderItem.Prepare(ADesignMenuItem); + end; + Result := True; + end + else + Dec(AIndex, GetViewMenuItemCount); +end; + +procedure TGridEditor.ExecuteVerb(Index: Integer); +begin + inherited; + if ProcessViewMenuItem(Index, vmiaExecute) then Exit; + case Index of + 0: ShowGridEditor(Designer, Grid); + 1: ShowGridImportDialog(Designer, Grid); + end; +end; + +function TGridEditor.GetVerb(Index: Integer): string; +begin + if ProcessViewMenuItem(Index, vmiaGetCaption) then + Result := '' + else + if (Index >= 0) and (Index <= High(GridEditorVerbs)) then + Result := GridEditorVerbs[Index] + else + Result := ''; +end; + +function TGridEditor.GetVerbCount: Integer; +begin + FViewMenuProvider.Free; + if GridView <> nil then + FViewMenuProvider := CreateViewMenuProvider(GridView); + + Result := Length(GridEditorVerbs) + GetViewMenuItemCount; +end; + +procedure TGridEditor.PrepareItem(Index: Integer; const AItem: TDesignMenuItem); +begin + inherited; + ProcessViewMenuItem(Index, vmiaPrepare, AItem); +end; + +{ TGridViewRepositoryEditor } + +type + TGridViewRepositoryEditor = class(TComponentEditor) + private + function GetGridViewRepository: TcxGridViewRepository; + protected + property GridViewRepository: TcxGridViewRepository read GetGridViewRepository; + public + procedure ExecuteVerb(Index: Integer); override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + end; + +function TGridViewRepositoryEditor.GetGridViewRepository: TcxGridViewRepository; +begin + Result := TcxGridViewRepository(Component); +end; + +procedure TGridViewRepositoryEditor.ExecuteVerb(Index: Integer); +begin + inherited; + case Index of + //0: GridViewRepository.CreateItem(TcxGridDBTableView).Name := Designer.UniqueName('cxGridDBTableView'); + 0: ShowViewRepositoryEditor(Designer, GridViewRepository); + end; +end; + +function TGridViewRepositoryEditor.GetVerb(Index: Integer): string; +begin + case Index of + //0: Result := 'Create TcxGridDBTableView'; + 0: Result := 'Editor...'; + 1: Result := '-'; + 2: Result := 'ExpressQuantumGrid Suite ' + cxGridVersion; + 3: Result := 'www.devexpress.com'; + end; +end; + +function TGridViewRepositoryEditor.GetVerbCount: Integer; +begin + Result := 4; +end; + +{ TcxGridRootLevelStylesEventsProperty } + +type + TcxGridRootLevelStylesEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + +function TcxGridRootLevelStylesEventsProperty.GetInstance: TPersistent; +begin + Result := TcxCustomGrid(GetComponent(0)).RootLevelStyles; +end; + +{ TcxGridTableItemPropertiesEventsProperty } + +type + TcxGridTableItemPropertiesEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + +function TcxGridTableItemPropertiesEventsProperty.GetInstance: TPersistent; +begin + Result := TcxCustomGridTableItem(GetComponent(0)).Properties; +end; + +{ TcxGridTableItemStylesEventsProperty } + +type + TcxGridTableItemStylesEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + +function TcxGridTableItemStylesEventsProperty.GetInstance: TPersistent; +begin + Result := TcxCustomGridTableItem(GetComponent(0)).Styles; +end; + +{ TcxGridDataControllerEventsProperty } + +type + TcxGridDataControllerEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + +function TcxGridDataControllerEventsProperty.GetInstance: TPersistent; +begin + Result := TcxCustomGridView(GetComponent(0)).DataController; +end; + +{ TcxGridViewStylesEventsProperty } + +type + TcxGridViewStylesEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + +function TcxGridViewStylesEventsProperty.GetInstance: TPersistent; +begin + Result := TcxCustomGridViewAccess.GetStyles(TcxCustomGridView(GetComponent(0))); +end; + +{ TcxGridViewNavigatorButtonsEventsProperty } + +type + TcxGridViewNavigatorButtonsEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + +function TcxGridViewNavigatorButtonsEventsProperty.GetInstance: TPersistent; +begin + Result := TcxCustomGridTableView(GetComponent(0)).NavigatorButtons; +end; + +{ TcxGridLevelStylesEventsProperty } + +type + TcxGridLevelStylesEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + +function TcxGridLevelStylesEventsProperty.GetInstance: TPersistent; +begin + Result := TcxGridLevel(GetComponent(0)).Styles; +end; + +{ TcxGridBandStylesEventsProperty } + +type + TcxGridBandStylesEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + +function TcxGridBandStylesEventsProperty.GetInstance: TPersistent; +begin + Result := TcxGridBand(GetComponent(0)).Styles; +end; + +{ TcxGridChartSeriesStylesEventsProperty } + +type + TcxGridChartSeriesStylesEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + +function TcxGridChartSeriesStylesEventsProperty.GetInstance: TPersistent; +begin + Result := TcxGridChartSeries(GetComponent(0)).Styles; +end; + +{ TcxGridChartHistogramValuesEventsProperty } + +type + TcxGridChartHistogramValuesEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + +function TcxGridChartHistogramValuesEventsProperty.GetInstance: TPersistent; +begin + Result := TcxGridChartHistogram(GetComponent(0)).Values; +end; + +{ TcxGridChartCategoriesEventsProperty } + +type + TcxGridChartCategoriesEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + +function TcxGridChartCategoriesEventsProperty.GetInstance: TPersistent; +begin + Result := TcxGridChartView(GetComponent(0)).Categories; +end; + +{ TcxGridChartAreaDiagramEventsProperty } + +type + TcxGridChartAreaDiagramEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + +function TcxGridChartAreaDiagramEventsProperty.GetInstance: TPersistent; +begin + Result := TcxGridChartView(GetComponent(0)).DiagramArea; +end; + +{ TcxGridChartBarDiagramEventsProperty } + +type + TcxGridChartBarDiagramEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + +function TcxGridChartBarDiagramEventsProperty.GetInstance: TPersistent; +begin + Result := TcxGridChartView(GetComponent(0)).DiagramBar; +end; + +{ TcxGridChartColumnDiagramEventsProperty } + +type + TcxGridChartColumnDiagramEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + +function TcxGridChartColumnDiagramEventsProperty.GetInstance: TPersistent; +begin + Result := TcxGridChartView(GetComponent(0)).DiagramColumn; +end; + +{ TcxGridChartLineDiagramEventsProperty } + +type + TcxGridChartLineDiagramEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + +function TcxGridChartLineDiagramEventsProperty.GetInstance: TPersistent; +begin + Result := TcxGridChartView(GetComponent(0)).DiagramLine; +end; + +{ TcxGridChartPieDiagramEventsProperty } + +type + TcxGridChartPieDiagramEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + +function TcxGridChartPieDiagramEventsProperty.GetInstance: TPersistent; +begin + Result := TcxGridChartView(GetComponent(0)).DiagramPie; +end; + +{ TcxGridLevelGridViewProperty } + +type + TcxGridLevelGridViewProperty = class(TComponentProperty) + private + function GetLevel: TcxGridLevel; + protected + property Level: TcxGridLevel read GetLevel; + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + end; + +function TcxGridLevelGridViewProperty.GetLevel: TcxGridLevel; +begin + Result := TcxGridLevel(GetComponent(0)); +end; + +function TcxGridLevelGridViewProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes - [paMultiSelect]; +end; + +procedure TcxGridLevelGridViewProperty.GetValues(Proc: TGetStrProc); +var + AViewList: TcxGridLevelViewList; + I: Integer; +begin + AViewList := TcxGridLevelViewList.Create(Level); + try + for I := 0 to AViewList.ViewNames.Count - 1 do + Proc(AViewList.ViewNames[I]); + finally + AViewList.Free; + end; +end; + +{ TcxGridLevelImageIndexProperty } + +type + TcxGridLevelImageIndexProperty = class(TImageIndexProperty) + public + function GetImages: TCustomImageList; override; + end; + +function TcxGridLevelImageIndexProperty.GetImages: TCustomImageList; +begin + Result := TcxCustomGrid(TcxGridLevel(GetComponent(0)).Control).LevelTabs.Images; +end; + +{ TcxCustomGridTableItemPropertiesProperty } + +type + TcxCustomGridTableItemPropertiesProperty = class(TClassProperty) + protected + function HasSubProperties: Boolean; + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + +function TcxCustomGridTableItemPropertiesProperty.HasSubProperties: Boolean; +var + I: Integer; +begin + for I := 0 to PropCount - 1 do + begin + Result := TcxCustomGridTableItem(GetComponent(I)).Properties <> nil; + if not Result then Exit; + end; + Result := True; +end; + +function TcxCustomGridTableItemPropertiesProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes; + if not HasSubProperties then + Exclude(Result, paSubProperties); + Result := Result - [paReadOnly] + + [paValueList, paSortList, paRevertable{$IFDEF DELPHI6}, paVolatileSubProperties{$ENDIF}]; +end; + +function TcxCustomGridTableItemPropertiesProperty.GetValue: string; +begin + if HasSubProperties then + Result := GetRegisteredEditProperties.GetDescriptionByClass( + TcxCustomGridTableItem(GetComponent(0)).Properties.ClassType) + else + Result := ''; +end; + +procedure TcxCustomGridTableItemPropertiesProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to GetRegisteredEditProperties.Count - 1 do + Proc(GetRegisteredEditProperties.Descriptions[I]); +end; + +procedure TcxCustomGridTableItemPropertiesProperty.SetValue(const Value: string); +var + APropertiesClass: TcxCustomEditPropertiesClass; + I: Integer; +begin + APropertiesClass := TcxCustomEditPropertiesClass(GetRegisteredEditProperties.FindByClassName(Value)); + if APropertiesClass = nil then + APropertiesClass := TcxCustomEditPropertiesClass(GetRegisteredEditProperties.FindByDescription(Value)); +{$IFNDEF DELPHI7} + if GetValue <> Value then + ObjectInspectorCollapseProperty; +{$ENDIF} + for I := 0 to PropCount - 1 do + TcxCustomGridTableItem(GetComponent(I)).PropertiesClass := APropertiesClass; + Modified; +end; + +{$IFNDEF NONDB} + +type + TcxDBDataSummaryItemFieldNameProperty = class(TFieldNameProperty) + public + function GetDataSource: TDataSource; override; + end; + +function TcxDBDataSummaryItemFieldNameProperty.GetDataSource: TDataSource; +begin + Result := (GetComponent(0) as TcxDBDataSummaryItem).DataController.DataSource; +end; + +type + TcxGridItemDBDataBindingFieldNameProperty = class(TFieldNameProperty) + public + function GetDataSource: TDataSource; override; + end; + +function TcxGridItemDBDataBindingFieldNameProperty.GetDataSource: TDataSource; +begin + Result := TcxGridItemDBDataBinding(GetComponent(0)).DataController.DataSource; +end; + +type + TMasterKeyFieldNamesProperty = class(TFieldNameProperty) + function GetDataSource: TDataSource; override; + end; + +function TMasterKeyFieldNamesProperty.GetDataSource: TDataSource; +var + AIDataController: IcxCustomGridDataController; + AParentLevel: TcxGridLevel; +begin + Result := nil; + if Supports(GetComponent(0), IcxCustomGridDataController, AIDataController) then + begin + AParentLevel := AIDataController.GridView.Level as TcxGridLevel; + if AParentLevel <> nil then + AParentLevel := AParentLevel.Parent; + if (AParentLevel <> nil) and (AParentLevel.GridView <> nil) and + (AParentLevel.GridView.DataController is TcxDBDataController) then + Result := TcxDBDataController(AParentLevel.GridView.DataController).DataSource; + end; +end; + +{ TcxGridDBChartItemDataBindingFieldNameProperty } + +type + TcxGridDBChartItemDataBindingFieldNameProperty = class(TFieldNameProperty) + public + function GetDataSource: TDataSource; override; + procedure GetValueList(AList: TStrings); override; + end; + +function TcxGridDBChartItemDataBindingFieldNameProperty.GetDataSource: TDataSource; +begin + Result := TcxGridDBChartItemDataBinding(GetComponent(0)).DataController.DataSource; +end; + +procedure TcxGridDBChartItemDataBindingFieldNameProperty.GetValueList(AList: TStrings); +var + I, J: Integer; + AField: TField; + AValueTypeClass: TcxValueTypeClass; +begin + inherited; + for I := AList.Count - 1 downto 0 do + begin + AField := GetDataSource.DataSet.FindField(AList[I]); + if AField = nil then + AList.Delete(I) + else + begin + AValueTypeClass := GetValueTypeClassByField(AField); + for J := 0 to PropCount - 1 do + if not (GetComponent(J) as TcxGridDBChartItemDataBinding).IsValueTypeClassValid(AValueTypeClass) then + begin + AList.Delete(I); + Break; + end; + end; + end; +end; + +{$ENDIF} + +{ TcxCustomGridBandIndexProperty } + +const + sNoBand = ''; + sIndexCaptionSeparator = ' - '; + +type + TcxCustomGridBandIndexProperty = class(TIntegerProperty) + private + function GetGridView: TcxGridBandedTableView; + protected + function GetGridViewForComponent(AIndex: Integer): TcxGridBandedTableView; virtual; abstract; + function GetValueForBandIndex(AIndex: Integer): string; + function IsSameGridView: Boolean; + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + property GridView: TcxGridBandedTableView read GetGridView; + end; + +function TcxCustomGridBandIndexProperty.GetGridView: TcxGridBandedTableView; +begin + Result := GetGridViewForComponent(0); +end; + +function TcxCustomGridBandIndexProperty.GetValueForBandIndex(AIndex: Integer): string; +begin + if AIndex = -1 then + Result := sNoBand + else + begin + Result := IntToStr(AIndex); + if GridView.Bands[AIndex].Caption <> '' then + Result := Result + sIndexCaptionSeparator + GridView.Bands[AIndex].Caption; + end; +end; + +function TcxCustomGridBandIndexProperty.IsSameGridView: Boolean; +var + I: Integer; +begin + Result := True; + for I := 1 to PropCount - 1 do + begin + Result := GetGridViewForComponent(I) = GridView; + if not Result then Break; + end; +end; + +function TcxCustomGridBandIndexProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes; + if IsSameGridView then Include(Result, paValueList); +end; + +function TcxCustomGridBandIndexProperty.GetValue: string; +begin + if IsSameGridView or (GetOrdValue = -1) then + Result := GetValueForBandIndex(GetOrdValue) + else + Result := inherited GetValue; +end; + +procedure TcxCustomGridBandIndexProperty.GetValues(Proc: TGetStrProc); +begin + Proc(GetValueForBandIndex(-1)); +end; + +procedure TcxCustomGridBandIndexProperty.SetValue(const Value: string); +var + P: Integer; +begin + if Value = sNoBand then + SetOrdValue(-1) + else + begin + P := Pos(sIndexCaptionSeparator, Value); + if P = 0 then + inherited SetValue(Value) + else + inherited SetValue(Copy(Value, 1, P - 1)); + end; +end; + +{ TcxGridBandedColumnBandIndexProperty } + +type + TcxGridBandedColumnBandIndexProperty = class(TcxCustomGridBandIndexProperty) + protected + function GetGridViewForComponent(AIndex: Integer): TcxGridBandedTableView; override; + public + procedure GetValues(Proc: TGetStrProc); override; + end; + +function TcxGridBandedColumnBandIndexProperty.GetGridViewForComponent(AIndex: Integer): TcxGridBandedTableView; +begin + Result := TcxGridBandedColumnPosition(GetComponent(AIndex)).GridView; +end; + +procedure TcxGridBandedColumnBandIndexProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + inherited; + for I := 0 to GridView.Bands.BottomItemCount - 1 do + Proc(GetValueForBandIndex(GridView.Bands.BottomItems[I].Index)); +end; + +{ TcxGridBandBandIndexProperty } + +type + TcxGridBandBandIndexProperty = class(TcxCustomGridBandIndexProperty) + protected + function GetGridViewForComponent(AIndex: Integer): TcxGridBandedTableView; override; + public + procedure GetValues(Proc: TGetStrProc); override; + end; + +function TcxGridBandBandIndexProperty.GetGridViewForComponent(AIndex: Integer): TcxGridBandedTableView; +begin + Result := TcxGridBandPosition(GetComponent(AIndex)).GridView; +end; + +procedure TcxGridBandBandIndexProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; + + function IsBandSelected(ABandIndex: Integer): Boolean; + var + ABand: TcxGridBand; + I: Integer; + begin + ABand := GridView.Bands[ABandIndex]; + for I := 0 to PropCount - 1 do + begin + Result := TcxGridBandPosition(GetComponent(I)).Band = ABand; + if Result then Exit; + end; + Result := False; + end; + +begin + inherited; + for I := 0 to GridView.Bands.Count - 1 do + if not IsBandSelected(I) then + Proc(GetValueForBandIndex(I)); +end; + +{ TcxCustomGridTableItemProperty } + +type + TcxCustomGridTableItemProperty = class(TComponentProperty) + protected + function GetGridView: TcxCustomGridView; + procedure GetGridViewItemNames(AGridView: TcxCustomGridView; Proc: TGetStrProc); virtual; + function InternalGetGridView(APersistent: TPersistent): TcxCustomGridView; virtual; abstract; + public + procedure GetValues(Proc: TGetStrProc); override; + end; + +procedure TcxCustomGridTableItemProperty.GetValues(Proc: TGetStrProc); +var + AGridView: TcxCustomGridView; +begin + AGridView := GetGridView; + if AGridView <> nil then + GetGridViewItemNames(AGridView, Proc); +end; + +function TcxCustomGridTableItemProperty.GetGridView: TcxCustomGridView; +var + I: Integer; +begin + Result := InternalGetGridView(GetComponent(0)); + for I := 1 to PropCount - 1 do + if InternalGetGridView(GetComponent(I)) <> Result then + begin + Result := nil; + Break; + end; +end; + +procedure TcxCustomGridTableItemProperty.GetGridViewItemNames(AGridView: TcxCustomGridView; + Proc: TGetStrProc); +var + I: Integer; +begin + if AGridView is TcxCustomGridTableView then + with AGridView as TcxCustomGridTableView do + for I := 0 to ItemCount - 1 do + Proc(Designer.GetComponentName(Items[I])); +end; + +{ TcxGridIncSearchItemProperty } + +type + TcxGridIncSearchItemProperty = class(TcxCustomGridTableItemProperty) + protected + function InternalGetGridView(APersistent: TPersistent): TcxCustomGridView; override; + end; + +function TcxGridIncSearchItemProperty.InternalGetGridView(APersistent: TPersistent): + TcxCustomGridView; +begin + Result := TcxCustomGridTableOptionsBehavior(APersistent).GridView; +end; + +{ TcxGridPreviewColumnProperty } + +type + TcxGridPreviewColumnProperty = class(TcxCustomGridTableItemProperty) + protected + function InternalGetGridView(APersistent: TPersistent): TcxCustomGridView; override; + end; + +function TcxGridPreviewColumnProperty.InternalGetGridView(APersistent: TPersistent): + TcxCustomGridView; +begin + Result := TcxGridPreview(APersistent).GridView; +end; + +{ TcxGridTableSummaryItemColumnProperty } + +type + TcxGridTableSummaryItemColumnProperty = class(TcxCustomGridTableItemProperty) + protected + function InternalGetGridView(APersistent: TPersistent): TcxCustomGridView; override; + end; + +function TcxGridTableSummaryItemColumnProperty.InternalGetGridView(APersistent: TPersistent): + TcxCustomGridView; +begin + Result := (TcxCustomDataSummaryItem(APersistent).DataController as + IcxCustomGridDataController).GridView; +end; + +{ TcxGridChartItemValueTypeProperty } + +type + TcxGridChartItemValueTypeProperty = class(TcxValueTypeProperty) + protected + function IsValueTypeClassValid(AValueTypeClass: TcxValueTypeClass): Boolean; override; + end; + +function TcxGridChartItemValueTypeProperty.IsValueTypeClassValid(AValueTypeClass: TcxValueTypeClass): Boolean; +var + I: Integer; +begin + Result := inherited IsValueTypeClassValid(AValueTypeClass); + if Result then + for I := 0 to PropCount - 1 do + begin + Result := (GetComponent(I) as TcxGridChartItemDataBinding).IsValueTypeClassValid(AValueTypeClass); + if not Result then Break; + end; +end; + +{ TcxGridChartActiveDiagramProperty } + +type + TcxGridChartActiveDiagramProperty = class(TPropertyEditor) + private + function GetGridView: TcxGridChartView; + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + property GridView: TcxGridChartView read GetGridView; + end; + +function TcxGridChartActiveDiagramProperty.GetGridView: TcxGridChartView; +begin + Result := GetComponent(0) as TcxGridChartView; +end; + +function TcxGridChartActiveDiagramProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList]; +end; + +function TcxGridChartActiveDiagramProperty.GetValue: string; +begin + if GridView.ActiveDiagram = nil then + Result := 'All diagrams are disabled' + else + Result := GridView.ActiveDiagram.DisplayText; +end; + +procedure TcxGridChartActiveDiagramProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to GridView.AvailableDiagramCount - 1 do + Proc(GridView.AvailableDiagrams[I].DisplayText); +end; + +procedure TcxGridChartActiveDiagramProperty.SetValue(const Value: string); +var + I: Integer; +begin + for I := 0 to GridView.AvailableDiagramCount - 1 do + if GridView.AvailableDiagrams[I].DisplayText = Value then + begin + GridView.AvailableDiagrams[I].Active := True; + Modified; + Break; + end; +end; + +{$IFNDEF NONDB} + +{ Ext Lookup } + +type + TcxExtLookupComboBoxPropertiesFieldNameProperty = class(TFieldNameProperty) + public + function GetDataSource: TDataSource; override; + end; + + TcxExtLookupComboBoxPropertiesItemColumnProperty = class(TcxCustomGridTableItemProperty) + protected + function InternalGetGridView(APersistent: TPersistent): TcxCustomGridView; override; + end; + + TcxExtLookupComboBoxPropertiesViewProperty = class(TComponentProperty) + private + FProc: TGetStrProc; + procedure CheckComponent(const Value: string); + public + procedure GetValues(Proc: TGetStrProc); override; + end; + +function TcxExtLookupComboBoxPropertiesFieldNameProperty.GetDataSource: TDataSource; +var + AProperties: TcxExtLookupComboBoxProperties; +begin + AProperties := GetComponent(0) as TcxExtLookupComboBoxProperties; + if AProperties.DataController <> nil then + Result := AProperties.DataController.DataSource + else + Result := nil; +end; + +function TcxExtLookupComboBoxPropertiesItemColumnProperty.InternalGetGridView(APersistent: TPersistent): TcxCustomGridView; +var + AProperties: TcxExtLookupComboBoxProperties; +begin + AProperties := APersistent as TcxExtLookupComboBoxProperties; + Result := AProperties.View; +end; + +procedure TcxExtLookupComboBoxPropertiesViewProperty.GetValues(Proc: TGetStrProc); +begin + FProc := Proc; + inherited GetValues(CheckComponent); +end; + +procedure TcxExtLookupComboBoxPropertiesViewProperty.CheckComponent(const Value: string); +var + AView: TcxCustomGridTableView; +begin + AView := TcxCustomGridTableView(Designer.GetComponent(Value)); + if (AView <> nil) and TcxExtLookupComboBoxProperties.IsViewSupported(AView) then + FProc(Value); +end; + +{$ENDIF} + +{$IFDEF DELPHI6} + +type + TcxGridSelectionEditor = class(TSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + + TcxGridLevelSelectionEditor = class(TSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + + TcxCustomTableViewSelectionEditor = class(TSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + + TcxCustomDBTableViewSelectionEditor = class(TcxCustomTableViewSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + + TcxCustomGridTableItemSelectionEditor = class(TSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + +procedure TcxGridSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + Proc(UnitNamePrefix + 'cxStyles'); +end; + +procedure TcxGridLevelSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + Proc(UnitNamePrefix + 'cxStyles'); +end; + +procedure TcxCustomTableViewSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + Proc(UnitNamePrefix + 'cxStyles'); + Proc('cxCustomData'); + Proc(UnitNamePrefix + 'cxGraphics'); + Proc('cxFilter'); + Proc('cxData'); + Proc('cxDataStorage'); + Proc(UnitNamePrefix + 'cxEdit'); +end; + +procedure TcxCustomDBTableViewSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + inherited RequiresUnits(Proc); + Proc('DB'); + Proc('cxDBData'); +end; + +procedure TcxCustomGridTableItemSelectionEditor.RequiresUnits(Proc: TGetStrProc); +var + I: Integer; + AComponent: TComponent; + AItem: TcxCustomGridTableItem; +begin + for I := 0 to Designer.Root.ComponentCount - 1 do + begin + AComponent := Designer.Root.Components[I]; + if AComponent is TcxCustomGridTableItem then + begin + AItem := TcxCustomGridTableItem(AComponent); + if AItem.Properties <> nil then + Proc(GetTypeData(PTypeInfo(AItem.Properties.ClassType.ClassInfo)).UnitName); + end; + end; +end; + +{ TcxGridChartViewSelectionEditor } + +type + TcxGridChartViewSelectionEditor = class(TSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + +procedure TcxGridChartViewSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + inherited; + Proc('cxStyles'); + Proc('cxCustomData'); + Proc('cxGraphics'); +end; + +{$IFNDEF NONDB} + +{ TcxGridDBChartViewSelectionEditor } + +type + TcxGridDBChartViewSelectionEditor = class(TcxGridChartViewSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + +procedure TcxGridDBChartViewSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + inherited; + Proc('DB'); + Proc('cxDBData'); +end; + +{$ENDIF} + +{$ENDIF} + +type + +{ TcxImageComboBoxItemsProperty } + + TcxImageComboBoxItemsProperty = class(TPropertyEditor) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + end; + +procedure TcxImageComboBoxItemsProperty.Edit; +var + S: string; + AProperties: TcxImageComboBoxProperties; +begin + S := 'Properties' + '.' + GetName; + AProperties := TcxImageComboBoxProperties(GetComponent(0)); + if (AProperties.Owner <> nil) and (AProperties.Owner is TComponent) then + S := TComponent(AProperties.Owner).Name + '.' + S; + with TfmImageComboBoxItemsEditor.Create( + AProperties.Items, AProperties.Images, AProperties.LargeImages) do + try + Caption := S; + if ShowModal = mrOk then + Self.Designer.Modified; + finally + Free; + end; +end; + +function TcxImageComboBoxItemsProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paDialog, paReadOnly]; +end; + +function TcxImageComboBoxItemsProperty.GetValue: string; +begin + FmtStr(Result, '(%s)', [GetPropType^.Name]); +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterComponentEditor(TcxGrid, TGridEditor); + RegisterComponentEditor(TcxGridViewRepository, TGridViewRepositoryEditor); + + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomGrid, 'RootLevelStylesEvents', + TcxGridRootLevelStylesEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomGridTableItem, 'PropertiesEvents', + TcxGridTableItemPropertiesEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomGridTableItem, 'StylesEvents', + TcxGridTableItemStylesEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomGridView, 'DataControllerEvents', + TcxGridDataControllerEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomGridView, 'StylesEvents', + TcxGridViewStylesEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomGridTableView, 'NavigatorButtonsEvents', + TcxGridViewNavigatorButtonsEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxGridLevel, 'StylesEvents', + TcxGridLevelStylesEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxGridBand, 'StylesEvents', + TcxGridBandStylesEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxGridChartSeries, 'StylesEvents', + TcxGridChartSeriesStylesEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxGridChartHistogram, 'ValuesEvents', + TcxGridChartHistogramValuesEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxGridChartView, 'CategoriesEvents', + TcxGridChartCategoriesEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxGridChartView, 'DiagramAreaEvents', + TcxGridChartAreaDiagramEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxGridChartView, 'DiagramBarEvents', + TcxGridChartBarDiagramEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxGridChartView, 'DiagramColumnEvents', + TcxGridChartColumnDiagramEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxGridChartView, 'DiagramLineEvents', + TcxGridChartLineDiagramEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxGridChartView, 'DiagramPieEvents', + TcxGridChartPieDiagramEventsProperty); + + RegisterPropertyEditor(TypeInfo(TcxCustomGridView), TcxGridLevel, 'GridView', + TcxGridLevelGridViewProperty); + RegisterPropertyEditor(TypeInfo(TImageIndex), TcxGridLevel, 'ImageIndex', + TcxGridLevelImageIndexProperty); + RegisterPropertyEditor(TypeInfo(string), TcxCustomGridTableItem, 'PropertiesClassName', nil); + RegisterPropertyEditor(TypeInfo(TcxCustomEditProperties), TcxCustomGridTableItem, + 'Properties', TcxCustomGridTableItemPropertiesProperty); + RegisterPropertyEditor(TypeInfo(string), TcxGridItemDataBinding, 'ValueType', + TcxValueTypeProperty); + RegisterPropertyEditor(TypeInfo(TComponent), TcxCustomGridView, 'PopupMenu', + TcxControlPopupMenuProperty); + RegisterPropertyEditor(TypeInfo(Boolean), TcxCustomGridTableOptionsSelection, 'HideFocusRect', nil); + RegisterPropertyEditor(TypeInfo(TAlignment), TcxGridBand, 'Alignment', nil); + RegisterPropertyEditor(TypeInfo(Integer), TcxGridBandedColumnPosition, 'BandIndex', + TcxGridBandedColumnBandIndexProperty); + RegisterPropertyEditor(TypeInfo(Integer), TcxGridBandPosition, 'BandIndex', + TcxGridBandBandIndexProperty); + RegisterPropertyEditor(TypeInfo(string), TcxGridChartItemDataBinding, 'ValueType', + TcxGridChartItemValueTypeProperty); + RegisterPropertyEditor(TypeInfo(TcxGridChartDiagram), TcxGridChartView, 'ActiveDiagram', + TcxGridChartActiveDiagramProperty); + + RegisterPropertyEditor(TypeInfo(TcxCustomGridTableItem), TcxCustomGridTableOptionsBehavior, + 'IncSearchItem', TcxGridIncSearchItemProperty); + RegisterPropertyEditor(TypeInfo(TcxCustomGridTableItem), TcxGridPreview, + 'Column', TcxGridPreviewColumnProperty); + RegisterPropertyEditor(TypeInfo(TcxCustomGridTableItem), TcxGridTableSummaryItem, + 'Column', TcxGridTableSummaryItemColumnProperty); +{$IFNDEF NONDB} + RegisterPropertyEditor(TypeInfo(TcxCustomGridTableItem), TcxGridDBTableSummaryItem, + 'Column', TcxGridTableSummaryItemColumnProperty); +{$ENDIF} + RegisterPropertyEditor(TypeInfo(TcxCustomGridTableItem), TcxGridTableSummaryGroupItemLink, + 'Column', TcxGridTableSummaryItemColumnProperty); + +{$IFNDEF NONDB} + RegisterPropertyEditor(TypeInfo(string), TcxDBDataController, 'DetailKeyFieldNames', TFieldNameProperty); + RegisterPropertyEditor(TypeInfo(string), TcxDBDataController, 'KeyFieldNames', TFieldNameProperty); + RegisterPropertyEditor(TypeInfo(string), TcxDBDataController, 'MasterKeyFieldNames', TMasterKeyFieldNamesProperty); + RegisterPropertyEditor(TypeInfo(string), TcxDBDataSummaryItem, 'FieldName', TcxDBDataSummaryItemFieldNameProperty); + RegisterPropertyEditor(TypeInfo(string), TcxGridItemDBDataBinding, 'FieldName', TcxGridItemDBDataBindingFieldNameProperty); + RegisterPropertyEditor(TypeInfo(string), TcxGridDBChartItemDataBinding, 'FieldName', TcxGridDBChartItemDataBindingFieldNameProperty); +{$ENDIF} + + RegisterNoIcon([TcxGridLevel, + TcxGridTableView, {$IFNDEF NONDB}TcxGridDBTableView,{$ENDIF} + TcxGridBandedTableView, {$IFNDEF NONDB}TcxGridDBBandedTableView,{$ENDIF} + TcxGridChartView, {$IFNDEF NONDB}TcxGridDBChartView,{$ENDIF} + TcxGridCardView{$IFNDEF NONDB}, TcxGridDBCardView{$ENDIF}]); + RegisterNoIcon([ + TcxGridColumn, {$IFNDEF NONDB}TcxGridDBColumn,{$ENDIF} + TcxGridBandedColumn, {$IFNDEF NONDB}TcxGridDBBandedColumn,{$ENDIF} + TcxGridCardViewRow, {$IFNDEF NONDB}TcxGridDBCardViewRow,{$ENDIF} + TcxGridChartDataGroup, {$IFNDEF NONDB}TcxGridDBChartDataGroup,{$ENDIF} + TcxGridChartSeries{$IFNDEF NONDB}, TcxGridDBChartSeries{$ENDIF}]); + RegisterNoIcon([TcxGridTableViewStyleSheet, TcxGridBandedTableViewStyleSheet, TcxGridCardViewStyleSheet]); + RegisterComponents('Dev Express', [TcxGrid, TcxGridViewRepository]); +{$IFNDEF NONDB} + // Ext Lookup + RegisterComponents('Express Editors 6', [TcxExtLookupComboBox]); + RegisterComponents('Express DBEditors 6', [TcxDBExtLookupComboBox]); + RegisterEditRepositoryItem(TcxEditRepositoryExtLookupComboBoxItem, cxSEditRepositoryExtLookupComboBoxItem); + RegisterPropertyEditor(TypeInfo(string), TcxExtLookupComboBoxProperties, 'KeyFieldNames', TcxExtLookupComboBoxPropertiesFieldNameProperty); + RegisterPropertyEditor(TypeInfo(TcxCustomGridTableItem), TcxExtLookupComboBoxProperties, 'ListFieldItem', TcxExtLookupComboBoxPropertiesItemColumnProperty); + RegisterPropertyEditor(TypeInfo(TcxCustomGridTableView), TcxExtLookupComboBoxProperties, 'View', TcxExtLookupComboBoxPropertiesViewProperty); + RegisterPropertyEditor(TypeInfo(TShortCut), TcxExtLookupComboBoxProperties, 'ClearKey', TShortCutProperty); +{$ENDIF} + +{$IFDEF DELPHI6} + RegisterSelectionEditor(TcxCustomGrid, TcxGridSelectionEditor); + RegisterSelectionEditor(TcxGridLevel, TcxGridLevelSelectionEditor); + RegisterSelectionEditor(TcxCustomGridTableView, TcxCustomTableViewSelectionEditor); + RegisterSelectionEditor(TcxGridChartView, TcxGridChartViewSelectionEditor); +{$IFNDEF NONDB} + RegisterSelectionEditor(TcxGridDBTableView, TcxCustomDBTableViewSelectionEditor); + RegisterSelectionEditor(TcxGridDBBandedTableView, TcxCustomDBTableViewSelectionEditor); + RegisterSelectionEditor(TcxGridDBCardView, TcxCustomDBTableViewSelectionEditor); + RegisterSelectionEditor(TcxGridDBChartView, TcxGridDBChartViewSelectionEditor); +{$ENDIF} + RegisterSelectionEditor(TcxCustomGridTableItem, TcxCustomGridTableItemSelectionEditor); +{$ENDIF} + + RegisterPropertyEditor(TypeInfo(TcxImageComboBoxItems), + TcxImageComboBoxProperties, 'Items', TcxImageComboBoxItemsProperty); + +end; + +initialization +{$IFDEF DELPHI6} + StartClassGroup(TControl); + GroupDescendentsWith(TcxGrid, TControl); + GroupDescendentsWith(TcxGridViewRepository, TControl); + GroupDescendentsWith(TcxGridLevel, TControl); + GroupDescendentsWith(TcxCustomGridView, TControl); + GroupDescendentsWith(TcxCustomGridTableItem, TControl); + GroupDescendentsWith(TcxGridItemDataBinding, TControl); + GroupDescendentsWith(TcxGridChartItem, TControl); +{$ENDIF} + RegisterStyleSheetClass(TcxGridTableViewStyleSheet); + RegisterStyleSheetClass(TcxGridBandedTableViewStyleSheet); + RegisterStyleSheetClass(TcxGridCardViewStyleSheet); + +finalization + UnregisterStyleSheetClass(TcxGridCardViewStyleSheet); + UnregisterStyleSheetClass(TcxGridBandedTableViewStyleSheet); + UnregisterStyleSheetClass(TcxGridTableViewStyleSheet); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridRows.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridRows.pas new file mode 100644 index 00000000..b0d8e518 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridRows.pas @@ -0,0 +1,3404 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridRows; + +{$I cxVer.inc} +{$I cxGridVer.inc} + +interface + +uses + Windows, Classes, Graphics, Controls, + cxClasses, cxControls, cxGraphics, cxLookAndFeels, cxLookAndFeelPainters, cxCustomData, cxPC, + cxGridCommon, cxGridLevel, cxGridCustomView, + cxGridCustomTableView, cxGridTableView, + cxGridDetailsSite; + +const + htPreview = htGridBase + 31; + +type + TcxGridDataCellViewInfoClass = class of TcxGridDataCellViewInfo; + TcxGridDataCellViewInfo = class; + TcxGridDataRowCellsAreaViewInfo = class; + TcxGridDataRowViewInfo = class; + TcxGridNewItemRowViewInfo = class; + TcxGridGroupCellViewInfo = class; + TcxGridGroupSummaryCellViewInfo = class; + TcxGridGroupRowViewInfo = class; +{$IFDEF USETABCONTROL} + TcxGridMasterDataRowDetailsSiteLeftTabsViewInfo = class; +{$ENDIF} + TcxGridDetailsSiteViewInfo = class; + TcxGridExpandButtonCellViewInfo = class; + TcxGridMasterDataRowViewInfo = class; + + { hit tests } + + TcxGridPreviewHitTest = class(TcxGridRecordCellHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + { painters } + + TcxGridDataCellPainter = class(TcxGridTableDataCellPainter) + private + function GetViewInfo: TcxGridDataCellViewInfo; + protected + procedure DrawBorder(ABorder: TcxBorder); override; + function ExcludeFromClipRect: Boolean; override; + property ViewInfo: TcxGridDataCellViewInfo read GetViewInfo; + end; + + TcxGridDataRowPainter = class(TcxCustomGridRowPainter) + private + function GetViewInfo: TcxGridDataRowViewInfo; + protected + procedure DrawCells; virtual; + function GetShowCells: Boolean; virtual; + procedure Paint; override; + property ShowCells: Boolean read GetShowCells; + property ViewInfo: TcxGridDataRowViewInfo read GetViewInfo; + end; + + TcxGridNewItemRowPainter = class(TcxGridDataRowPainter) + private + function GetViewInfo: TcxGridNewItemRowViewInfo; + protected + procedure DrawBackground; override; + procedure DrawSeparator; override; + function GetShowCells: Boolean; override; + procedure Paint; override; + property ViewInfo: TcxGridNewItemRowViewInfo read GetViewInfo; + end; + +{$IFDEF USETABCONTROL} + + TcxGridMasterDataRowDetailsSiteTabsPainter = class(TcxGridDetailsSiteTabsPainter) + private + function GetViewInfo: TcxGridMasterDataRowDetailsSiteLeftTabsViewInfo; + protected + procedure DrawBottomGridLine; virtual; + procedure Paint; override; + property ViewInfo: TcxGridMasterDataRowDetailsSiteLeftTabsViewInfo read GetViewInfo; + end; + +{$ENDIF} + + TcxGridExpandButtonCellPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridExpandButtonCellViewInfo; + protected + procedure DrawBorder(ABorder: TcxBorder); override; + property ViewInfo: TcxGridExpandButtonCellViewInfo read GetViewInfo; + end; + + TcxGridMasterDataRowPainter = class(TcxGridDataRowPainter) + private + function GetViewInfo: TcxGridMasterDataRowViewInfo; + protected + procedure DrawCells; override; + procedure DrawDetailsSite; virtual; + //procedure DrawDetailsArea; virtual; + procedure DrawExpandButtonCell; virtual; + function NeedsPainting: Boolean; override; + procedure Paint; override; + property ViewInfo: TcxGridMasterDataRowViewInfo read GetViewInfo; + end; + + TcxGridGroupCellPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridGroupCellViewInfo; + protected + procedure DrawBorder(ABorder: TcxBorder); override; + property ViewInfo: TcxGridGroupCellViewInfo read GetViewInfo; + end; + + TcxGridGroupSummaryCellPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridGroupSummaryCellViewInfo; + protected + procedure Paint; override; + property ViewInfo: TcxGridGroupSummaryCellViewInfo read GetViewInfo; + end; + + TcxGridGroupRowPainter = class(TcxCustomGridRowPainter) + private + function GetViewInfo: TcxGridGroupRowViewInfo; + protected + procedure DrawBackground; override; + procedure DrawSeparator; override; + procedure DrawSummaryCells; virtual; + procedure Paint; override; + property ViewInfo: TcxGridGroupRowViewInfo read GetViewInfo; + end; + + { view infos } + + TcxGridCellViewInfo = class(TcxGridTableCellViewInfo) + private + function GetGridView: TcxGridTableView; + function GetGridLines: TcxGridLines; + function GetGridRecord: TcxCustomGridRow; + function GetGridViewInfo: TcxGridTableViewInfo; + function GetRecordViewInfo: TcxCustomGridRowViewInfo; + protected + function GetBorderColor(AIndex: TcxBorder): TColor; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + property GridLines: TcxGridLines read GetGridLines; + public + property GridRecord: TcxCustomGridRow read GetGridRecord; + property GridView: TcxGridTableView read GetGridView; + property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo; + property RecordViewInfo: TcxCustomGridRowViewInfo read GetRecordViewInfo; + end; + + // data row + + TcxGridDataCellViewInfo = class(TcxGridTableDataCellViewInfo) + private + FIsMerged: Boolean; + FIsMerging: Boolean; + FMergedCells: TList; + FMergingCell: TcxGridDataCellViewInfo; + FOriginalHeight: Integer; + function GetCacheItem: TcxGridTableViewInfoCacheItem; + function GetGridView: TcxGridTableView; + function GetGridViewInfo: TcxGridTableViewInfo; + function GetItem: TcxGridColumn; + function GetMergedCell(Index: Integer): TcxGridDataCellViewInfo; + function GetMergedCellCount: Integer; + function GetMergedCellOfFocusedRow: TcxGridDataCellViewInfo; + function GetRecordViewInfo: TcxGridDataRowViewInfo; + protected + OriginalBounds: TRect; + procedure AfterRowsViewInfoCalculate; virtual; + procedure AfterRowsViewInfoOffset; virtual; + function CalculateSelected: Boolean; override; + function CalculateWidth: Integer; override; + function CanBeMergingCell: Boolean; virtual; + function CanCellMerging: Boolean; virtual; + function GetBorderColor(AIndex: TcxBorder): TColor; override; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + function GetFocused: Boolean; override; + function GetMultiLine: Boolean; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetVisible: Boolean; override; + function GetVisibleForHitTest: Boolean; override; + function HasHitTestPoint(const P: TPoint): Boolean; override; + procedure Offset(DX, DY: Integer); override; + procedure RemoveMergedCell(ACellViewInfo: TcxGridDataCellViewInfo); + + property CacheItem: TcxGridTableViewInfoCacheItem read GetCacheItem; + property MergedCellOfFocusedRow: TcxGridDataCellViewInfo read GetMergedCellOfFocusedRow; + property GridView: TcxGridTableView read GetGridView; + property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo; + property OriginalHeight: Integer read FOriginalHeight; + public + destructor Destroy; override; + procedure BeforeRecalculation; override; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + function MouseMove(AHitTest: TcxCustomGridHitTest; AShift: TShiftState): Boolean; override; + procedure Paint(ACanvas: TcxCanvas = nil); override; + + property IsMerged: Boolean read FIsMerged; + property IsMerging: Boolean read FIsMerging; + property Item: TcxGridColumn read GetItem; + property MergedCellCount: Integer read GetMergedCellCount; + property MergedCells[Index: Integer]: TcxGridDataCellViewInfo read GetMergedCell; + property MergingCell: TcxGridDataCellViewInfo read FMergingCell; + property RecordViewInfo: TcxGridDataRowViewInfo read GetRecordViewInfo; + end; + + TcxGridDataRowCellsAreaViewInfoClass = class of TcxGridDataRowCellsAreaViewInfo; + + TcxGridDataRowCellsAreaViewInfo = class(TcxGridCellViewInfo) + private + function GetRecordViewInfo: TcxGridDataRowViewInfo; + protected + function CalculateHeight: Integer; override; + function CalculateVisible: Boolean; virtual; + function CalculateWidth: Integer; override; + function GetBorders: TcxBorders; override; + function GetIsBottom: Boolean; virtual; + public + constructor Create(ARecordViewInfo: TcxCustomGridRecordViewInfo); override; + function CanDrawSelected: Boolean; override; + function DrawMergedCells: Boolean; virtual; + property IsBottom: Boolean read GetIsBottom; + property RecordViewInfo: TcxGridDataRowViewInfo read GetRecordViewInfo; + end; + + TcxGridPreviewCellViewInfoClass = class of TcxGridPreviewCellViewInfo; + + TcxGridPreviewCellViewInfo = class(TcxGridDataCellViewInfo) + private + function GetPreview: TcxGridPreview; + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetAutoHeight: Boolean; override; + function GetBackgroundBitmap: TBitmap; override; + function GetBorders: TcxBorders; override; + procedure GetEditViewDataContentOffsets(var R: TRect); override; + function GetHeight: Integer; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetMaxLineCount: Integer; override; + function GetMultiLine: Boolean; override; + function GetTextAreaBounds: TRect; override; + function SupportsZeroHeight: Boolean; override; + property Preview: TcxGridPreview read GetPreview; + end; + + TcxGridDataRowViewInfo = class(TcxCustomGridRowViewInfo) + private + FCellHeight: Integer; + FCellsAreaBounds: TRect; + FCellsAreaViewInfo: TcxGridDataRowCellsAreaViewInfo; + FCellViewInfos: TList; + FPreviewViewInfo: TcxGridPreviewCellViewInfo; + function GetCellViewInfo(Index: Integer): TcxGridDataCellViewInfo; + function GetCellViewInfoCount: Integer; + function GetGridRecord: TcxGridDataRow; + function GetHasPreview: Boolean; + function GetInternalCellViewInfo(Index: Integer): TcxGridDataCellViewInfo; + procedure CreateViewInfos; + procedure DestroyViewInfos; + protected + procedure AfterRowsViewInfoCalculate; override; + procedure AfterRowsViewInfoOffset; override; + procedure ApplyMergedCellsBounds(var R: TRect; AItem: TcxCustomGridTableItem); + procedure ApplyMergingCellsBounds(var R: TRect); + procedure CalculateCellViewInfo(AIndex: Integer); virtual; + function CalculateHeight: Integer; override; + function CanSize: Boolean; override; + procedure CheckRowHeight(var AValue: Integer); override; + function GetAutoHeight: Boolean; override; + function GetBackgroundBitmapBounds: TRect; override; + function GetBaseHeight: Integer; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + procedure Offset(DX, DY: Integer); override; + procedure SetRowHeight(Value: Integer); override; + + function GetCellHeight(AIndex: Integer): Integer; reintroduce; virtual; + function GetCellHeightValue: Integer; virtual; + function GetCellLeftBound(AIndex: Integer): Integer; virtual; + function GetCellTopBound(AIndex: Integer): Integer; virtual; + function GetCellsAreaBounds: TRect; virtual; + function GetCellsAreaViewInfoClass: TcxGridDataRowCellsAreaViewInfoClass; virtual; + function GetCellViewInfoClass(AIndex: Integer): TcxGridDataCellViewInfoClass; virtual; + function GetCellWidth(AIndex: Integer): Integer; virtual; + function GetPreviewViewInfoClass: TcxGridPreviewCellViewInfoClass; virtual; + function GetShowPreview: Boolean; virtual; + function IsCellVisible(AIndex: Integer): Boolean; virtual; + + property CellHeight: Integer read GetCellHeightValue; + property ShowPreview: Boolean read GetShowPreview; + public + constructor Create(ARecordsViewInfo: TcxCustomGridRecordsViewInfo; + ARecord: TcxCustomGridRecord); override; + destructor Destroy; override; + procedure BeforeCellRecalculation(ACell: TcxGridTableCellViewInfo); virtual; + procedure BeforeRecalculation; override; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + function GetAreaBoundsForPainting: TRect; override; + function GetBoundsForInvalidate(AItem: TcxCustomGridTableItem): TRect; override; + function GetBoundsForItem(AItem: TcxCustomGridTableItem): TRect; override; + function GetCellBorders(AIsRight, AIsBottom: Boolean): TcxBorders; virtual; + function GetCellViewInfoByItem(AItem: TcxCustomGridTableItem): TcxGridTableDataCellViewInfo; override; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + + property CellsAreaBounds: TRect read GetCellsAreaBounds; + property CellsAreaViewInfo: TcxGridDataRowCellsAreaViewInfo read FCellsAreaViewInfo; + property CellViewInfoCount: Integer read GetCellViewInfoCount; + property CellViewInfos[Index: Integer]: TcxGridDataCellViewInfo read GetCellViewInfo; + property GridRecord: TcxGridDataRow read GetGridRecord; + property HasPreview: Boolean read GetHasPreview; + property InternalCellViewInfos[Index: Integer]: TcxGridDataCellViewInfo read GetInternalCellViewInfo; + property PreviewViewInfo: TcxGridPreviewCellViewInfo read FPreviewViewInfo; + end; + + // new item row + + TcxGridNewItemRowViewInfo = class(TcxGridDataRowViewInfo) + private + FHeight: Integer; + protected + function CalculateSelected: Boolean; override; + function GetAlignmentHorz: TAlignment; override; + function GetAlignmentVert: TcxAlignmentVert; override; + function GetAutoHeight: Boolean; override; + function GetCellLeftBound(AIndex: Integer): Integer; override; + function GetCellWidth(AIndex: Integer): Integer; override; + function GetHeight: Integer; override; + function GetInfoText: string; virtual; + function GetOptions: TcxGridSpecialRowOptions; virtual; + function GetSeparatorColor: TColor; override; + function GetSeparatorWidth: Integer; override; + function GetShowInfoText: Boolean; virtual; + function GetShowPreview: Boolean; override; + function GetStyleIndex: Integer; virtual; + function GetText: string; override; + function GetTextAreaBounds: TRect; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function HasFooters: Boolean; override; + function HasLastHorzGridLine: Boolean; override; + + function GetPainterClass: TcxCustomGridCellPainterClass; override; + + property InfoText: string read GetInfoText; + property Options: TcxGridSpecialRowOptions read GetOptions; + property ShowInfoText: Boolean read GetShowInfoText; + end; + + // filtering row + + TcxGridFilterRowViewInfo = class(TcxGridNewItemRowViewInfo) + private + function GetGridRecord: TcxGridFilterRow; + protected + function GetOptions: TcxGridSpecialRowOptions; override; + function GetShowInfoText: Boolean; override; + function GetStyleIndex: Integer; override; + public + property GridRecord: TcxGridFilterRow read GetGridRecord; + end; + + // details site + +{$IFDEF USETABCONTROL} + + TcxGridMasterDataRowDetailsSiteLeftTabsViewInfo = class(TcxGridDetailsSiteLeftTabsViewInfo) + private + function GetBottomGridLineColor: TColor; + function GetBottomGridLineWidth: Integer; + function GetSiteViewInfo: TcxGridDetailsSiteViewInfo; + protected + function CalculateHeight: Integer; override; + function GetBottomGridLineBounds: TRect; virtual; + function GetPainterClass: TcxGridDetailsSiteTabsPainterClass; override; + function GetTabControlBounds: TRect; override; + property BottomGridLineWidth: Integer read GetBottomGridLineWidth; + public + function HasBottomGridLine: Boolean; virtual; + property BottomGridLineBounds: TRect read GetBottomGridLineBounds; + property BottomGridLineColor: TColor read GetBottomGridLineColor; + property SiteViewInfo: TcxGridDetailsSiteViewInfo read GetSiteViewInfo; + end; + +{$ENDIF} + + TcxGridDetailsSiteViewInfoClass = class of TcxGridDetailsSiteViewInfo; + + TcxGridDetailsSiteViewInfo = class(TcxCustomGridDetailsSiteViewInfo) + private + FMasterDataRowViewInfo: TcxGridMasterDataRowViewInfo; + function GetCacheItem: TcxGridMasterTableViewInfoCacheItem; + function GetMasterGridView: TcxGridTableView; + function GetMasterGridViewInfo: TcxGridTableViewInfo; + protected + procedure ControlFocusChanged; virtual; + function GetActiveGridView: TcxCustomGridView; override; + function GetActiveGridViewExists: Boolean; override; + function GetActiveGridViewValue: TcxCustomGridView; override; + function GetActiveLevel: TcxGridLevel; override; + function GetCanvas: TcxCanvas; override; + function GetContainer: TcxControl; override; + function GetDesignController: TcxCustomGridDesignController; override; + function GetFullyVisible: Boolean; override; + function GetHeight: Integer; override; + function GetMasterRecord: TObject; override; + function GetMaxHeight: Integer; override; + function GetMaxNormalHeight: Integer; override; + function GetMaxWidth: Integer; override; + function GetNormalHeight: Integer; override; + {$IFDEF USETABCONTROL} + function GetTabsViewInfoClass: TcxCustomGridDetailsSiteTabsViewInfoClass; override; + {$ENDIF} + function GetVisible: Boolean; override; + function GetWidth: Integer; override; + procedure InitTabHitTest(AHitTest: TcxGridDetailsSiteTabHitTest); override; + + property CacheItem: TcxGridMasterTableViewInfoCacheItem read GetCacheItem; + property MasterGridView: TcxGridTableView read GetMasterGridView; + property MasterGridViewInfo: TcxGridTableViewInfo read GetMasterGridViewInfo; + property MasterDataRowViewInfo: TcxGridMasterDataRowViewInfo read FMasterDataRowViewInfo; + public + constructor Create(AMasterDataRowViewInfo: TcxGridMasterDataRowViewInfo); reintroduce; virtual; + destructor Destroy; override; + procedure ChangeActiveTab(ALevel: TcxGridLevel; AFocusView: Boolean = False); override; + function DetailHasData(ALevel: TcxGridLevel): Boolean; override; + function HasMaxHeight: Boolean; + function SupportsTabAccelerators: Boolean; override; + end; + + // master data row + + TcxGridExpandButtonCellViewInfoClass = class of TcxGridExpandButtonCellViewInfo; + + TcxGridExpandButtonCellViewInfo = class(TcxGridCellViewInfo) + private + function GetRecordViewInfo: TcxGridMasterDataRowViewInfo; + function GetRightBorderRestSpaceBounds: TRect; + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetBackgroundBitmap: TBitmap; override; + function GetBaseWidth: Integer; virtual; + function GetBorderBounds(AIndex: TcxBorder): TRect; override; + function GetBorders: TcxBorders; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + + property BaseWidth: Integer read GetBaseWidth; + property RightBorderRestSpaceBounds: TRect read GetRightBorderRestSpaceBounds; + public + property RecordViewInfo: TcxGridMasterDataRowViewInfo read GetRecordViewInfo; + end; + + TcxGridDetailsAreaViewInfoClass = class of TcxGridDetailsAreaViewInfo; + + TcxGridDetailsAreaViewInfo = class(TcxGridCellViewInfo) + private + function GetRecordViewInfo: TcxGridMasterDataRowViewInfo; + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetBorders: TcxBorders; override; + public + property RecordViewInfo: TcxGridMasterDataRowViewInfo read GetRecordViewInfo; + end; + + TcxGridMasterDataRowViewInfo = class(TcxGridDataRowViewInfo) + private + FDetailsAreaViewInfo: TcxGridDetailsAreaViewInfo; + FDetailsSiteViewInfo: TcxGridDetailsSiteViewInfo; + FExpandButtonCellViewInfo: TcxGridExpandButtonCellViewInfo; + FRestHeight: Integer; + function GetCacheItem: TcxGridMasterTableViewInfoCacheItem; + function GetDetailsSiteIndentBounds: TRect; + function GetGridRecord: TcxGridMasterDataRow; + protected + procedure CalculateExpandButtonBounds(var ABounds: TRect); override; + function CalculateHeight: Integer; override; + function CalculateRestHeight(ARowHeight: Integer): Integer; virtual; + procedure ControlFocusChanged; override; + function GetDataHeight: Integer; override; + function GetDataIndent: Integer; override; + function GetDataWidth: Integer; override; + function GetDetailsSiteVisible: Boolean; virtual; + function GetExpandButtonAreaBounds: TRect; override; + function GetFullyVisible: Boolean; override; + function GetMaxHeight: Integer; override; + function IsDetailVisible(ADetail: TcxCustomGridView): Boolean; override; + procedure VisibilityChanged(AVisible: Boolean); override; + + function GetPainterClass: TcxCustomGridCellPainterClass; override; + + function GetDetailsAreaViewInfoClass: TcxGridDetailsAreaViewInfoClass; virtual; + function GetDetailsSiteViewInfoClass: TcxGridDetailsSiteViewInfoClass; virtual; + function GetExpandButtonCellViewInfoClass: TcxGridExpandButtonCellViewInfoClass; virtual; + + property CacheItem: TcxGridMasterTableViewInfoCacheItem read GetCacheItem; + property DetailsAreaViewInfo: TcxGridDetailsAreaViewInfo read FDetailsAreaViewInfo; + property DetailsSiteIndentBounds: TRect read GetDetailsSiteIndentBounds; + property ExpandButtonCellViewInfo: TcxGridExpandButtonCellViewInfo read FExpandButtonCellViewInfo; + property RestHeight: Integer read FRestHeight write FRestHeight; + public + constructor Create(ARecordsViewInfo: TcxCustomGridRecordsViewInfo; + ARecord: TcxCustomGridRecord); override; + destructor Destroy; override; + procedure BeforeRecalculation; override; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + function ProcessDialogChar(ACharCode: Word): Boolean; override; + function SupportsTabAccelerators: Boolean; virtual; + property DetailsSiteViewInfo: TcxGridDetailsSiteViewInfo read FDetailsSiteViewInfo; + property DetailsSiteVisible: Boolean read GetDetailsSiteVisible; + property GridRecord: TcxGridMasterDataRow read GetGridRecord; + end; + + // group row + + TcxGridGroupCellViewInfo = class(TcxGridCellViewInfo) + private + function GetExpandedAreaBounds: TRect; + function GetGridRecord: TcxGridGroupRow; + function GetRecordViewInfo: TcxGridGroupRowViewInfo; + function GetRowStyle: TcxGridGroupRowStyle; + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function CustomDraw(ACanvas: TcxCanvas): Boolean; override; + function GetAlignmentVert: TcxAlignmentVert; override; + function GetAlwaysSelected: Boolean; override; + function GetBackgroundBitmap: TBitmap; override; + function GetBorderBounds(AIndex: TcxBorder): TRect; override; + function GetBorderColor(AIndex: TcxBorder): TColor; override; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetText: string; override; + function GetTextAreaBounds: TRect; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function HasCustomDraw: Boolean; override; + + property ExpandedAreaBounds: TRect read GetExpandedAreaBounds; + property RowStyle: TcxGridGroupRowStyle read GetRowStyle; + public + function CanDrawSelected: Boolean; override; + property GridRecord: TcxGridGroupRow read GetGridRecord; + property RecordViewInfo: TcxGridGroupRowViewInfo read GetRecordViewInfo; + end; + + TcxGridGroupRowSpacerViewInfoClass = class of TcxGridGroupRowSpacerViewInfo; + + TcxGridGroupRowSpacerViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FRowViewInfo: TcxGridGroupRowViewInfo; + function GetGridView: TcxGridTableView; + protected + function CalculateWidth: Integer; override; + function GetAlignmentVert: TcxAlignmentVert; override; + function GetText: string; override; + function GetTextAreaBounds: TRect; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function GetWidth: Integer; override; + function HasBackground: Boolean; override; + public + constructor Create(ARowViewInfo: TcxGridGroupRowViewInfo; const AText: string); reintroduce; virtual; + property GridView: TcxGridTableView read GetGridView; + property RowViewInfo: TcxGridGroupRowViewInfo read FRowViewInfo; + end; + + TcxGridGroupSummaryCellViewInfoClass = class of TcxGridGroupSummaryCellViewInfo; + + TcxGridGroupSummaryCellViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FIsLast: Boolean; + FRowViewInfo: TcxGridGroupRowViewInfo; + FSeparatorViewInfo: TcxGridGroupRowSpacerViewInfo; + FSummaryItem: TcxDataSummaryItem; + FTextWidth: Integer; + FValue: Variant; + function GetColumn: TcxGridColumn; + function GetGridView: TcxGridTableView; + procedure SetIsLast(Value: Boolean); + protected + function CalculateWidth: Integer; override; + function CanAlignWithColumn: Boolean; + function CustomDraw(ACanvas: TcxCanvas): Boolean; override; + function GetAlignmentHorz: TAlignment; override; + function GetAlignmentVert: TcxAlignmentVert; override; + function GetDesignSelectionBounds: TRect; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetIsDesignSelected: Boolean; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetSeparatorBounds: TRect; virtual; + function GetSeparatorText: string; virtual; + function GetShowEndEllipsis: Boolean; override; + function GetText: string; override; + function GetTextAreaBounds: TRect; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function HasBackground: Boolean; override; + function HasCustomDraw: Boolean; override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + procedure Offset(DX, DY: Integer); override; + public + constructor Create(ARowViewInfo: TcxGridGroupRowViewInfo; + ASummaryItem: TcxDataSummaryItem; const AValue: Variant); reintroduce; virtual; + destructor Destroy; override; + procedure BeforeRecalculation; override; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + property Column: TcxGridColumn read GetColumn; + property GridView: TcxGridTableView read GetGridView; + property IsLast: Boolean read FIsLast write SetIsLast; + property RowViewInfo: TcxGridGroupRowViewInfo read FRowViewInfo; + property SeparatorViewInfo: TcxGridGroupRowSpacerViewInfo read FSeparatorViewInfo; + property SummaryItem: TcxDataSummaryItem read FSummaryItem; + property Value: Variant read FValue; + end; + + TcxGridGroupRowViewInfo = class(TcxCustomGridRowViewInfo) + private + FCellViewInfo: TcxGridGroupCellViewInfo; + FSummaryBeginningSpacerViewInfo: TcxGridGroupRowSpacerViewInfo; + FSummaryCellsWithoutColumns: TList; + FSummaryCellViewInfos: TList; + FSummaryEndingSpacerViewInfo: TcxGridGroupRowSpacerViewInfo; + function GetGridRecord: TcxGridGroupRow; + function GetRowStyle: TcxGridGroupRowStyle; + function GetSummaryCellLayout: TcxGridGroupSummaryLayout; + function GetSummaryCellViewInfo(Index: Integer): TcxGridGroupSummaryCellViewInfo; + function GetSummaryCellViewInfoCount: Integer; + protected + procedure CalculateExpandButtonBounds(var ABounds: TRect); override; + function CalculateHeight: Integer; override; + function CanSize: Boolean; override; + procedure CheckRowHeight(var AValue: Integer); override; + function GetAutoHeight: Boolean; override; + function GetBackgroundBitmap: TBitmap; override; + function GetExpandButtonAreaBounds: TRect; override; + function GetFocusRectBounds: TRect; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetSeparatorBounds: TRect; override; + function GetSeparatorIndentBounds: TRect; virtual; + function GetShowSeparator: Boolean; override; + function HasFocusRect: Boolean; override; + function HasFooter(ALevel: Integer): Boolean; override; + procedure Offset(DX, DY: Integer); override; + procedure SetRowHeight(Value: Integer); override; + + function CreateSpacerViewInfo(const AText: string): TcxGridGroupRowSpacerViewInfo; + procedure CreateSpacerViewInfos; virtual; + procedure DestroySpacerViewInfos; virtual; + function GetSpacerViewInfoClass: TcxGridGroupRowSpacerViewInfoClass; virtual; + + function AddSummaryCellViewInfo(ASummaryItem: TcxDataSummaryItem; + const AValue: Variant): TcxGridGroupSummaryCellViewInfo; + procedure CreateSummaryCellViewInfos; virtual; + procedure DestroySummaryCellViewInfos; virtual; + function GetSummaryCellViewInfoClass: TcxGridGroupSummaryCellViewInfoClass; virtual; + + procedure CalculateSummaryCells; overload; virtual; + procedure CalculateSummaryCells(ACellViewInfos: TList; + const AAreaBounds: TRect; AAlignment: TAlignment; AAutoWidth: Boolean); overload; virtual; + function CalculateSummaryCellWidths(ACellViewInfos: TList; AAvailableWidth: Integer; + AAutoWidth: Boolean): TcxAutoWidthObject; virtual; + function GetColumnSummaryCellsAreaBounds(AColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo): TRect; virtual; + procedure GetColumnSummaryCellViewInfos(AColumn: TcxGridColumn; AList: TList); + function GetSummaryBeginningSpacerBounds: TRect; virtual; + function GetSummaryEndingSpacerBounds: TRect; virtual; + function GetSummaryBeginningSpacerText: string; virtual; + function GetSummaryEndingSpacerText: string; virtual; + function GetSummaryCellAutoWidth: Boolean; virtual; + function GetSummaryCellsAreaBounds(AForAlignableCells: Boolean): TRect; virtual; + function GetSummaryCellsBounds(const AAreaBounds: TRect; + AWidths: TcxAutoWidthObject; AAlignment: TAlignment; AAutoWidth: Boolean): TRect; virtual; + function GetUnalignableSummaryCells: TList; virtual; + function HasUnalignableSummaryCells: Boolean; virtual; + + property SummaryBeginningSpacerViewInfo: TcxGridGroupRowSpacerViewInfo read FSummaryBeginningSpacerViewInfo; + property SummaryEndingSpacerViewInfo: TcxGridGroupRowSpacerViewInfo read FSummaryEndingSpacerViewInfo; + property SummaryCellAutoWidth: Boolean read GetSummaryCellAutoWidth; + property SummaryCellLayout: TcxGridGroupSummaryLayout read GetSummaryCellLayout; + property SummaryCells: TList read FSummaryCellViewInfos; + property SummaryCellsWithoutColumns: TList read FSummaryCellsWithoutColumns; + property UnalignableSummaryCells: TList read GetUnalignableSummaryCells; + + property RowStyle: TcxGridGroupRowStyle read GetRowStyle; + public + constructor Create(ARecordsViewInfo: TcxCustomGridRecordsViewInfo; + ARecord: TcxCustomGridRecord); override; + destructor Destroy; override; + procedure BeforeRecalculation; override; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + property CellViewInfo: TcxGridGroupCellViewInfo read FCellViewInfo; + property GridRecord: TcxGridGroupRow read GetGridRecord; + property SeparatorIndentBounds: TRect read GetSeparatorIndentBounds; + property SummaryCellViewInfoCount: Integer read GetSummaryCellViewInfoCount; + property SummaryCellViewInfos[Index: Integer]: TcxGridGroupSummaryCellViewInfo read GetSummaryCellViewInfo; + end; + +implementation + +uses + SysUtils, Math, Forms, cxVariants, cxGrid, cxEdit, dxOffice11; + +{ TcxGridPreviewHitTest } + +class function TcxGridPreviewHitTest.GetHitTestCode: Integer; +begin + Result := htPreview; +end; + +{ TcxGridDataCellPainter } + +function TcxGridDataCellPainter.GetViewInfo: TcxGridDataCellViewInfo; +begin + Result := TcxGridDataCellViewInfo(inherited ViewInfo); +end; + +procedure TcxGridDataCellPainter.DrawBorder(ABorder: TcxBorder); +begin + if ExcludeFromClipRect then + inherited + else + TcxGridTablePainter(ViewInfo.GridViewInfo.Painter).AddGridLine(ViewInfo.BorderBounds[ABorder]); +end; + +function TcxGridDataCellPainter.ExcludeFromClipRect: Boolean; +begin + Result := ViewInfo.RecordViewInfo.CellsAreaViewInfo.Visible; +end; + +{ TcxGridDataRowPainter } + +function TcxGridDataRowPainter.GetViewInfo: TcxGridDataRowViewInfo; +begin + Result := TcxGridDataRowViewInfo(inherited ViewInfo); +end; + +procedure TcxGridDataRowPainter.DrawCells; +begin + ViewInfo.RecordsViewInfo.PainterClass.DrawDataRowCells(ViewInfo); + with ViewInfo do + if HasPreview and (PreviewViewInfo.Height <> 0) then + PreviewViewInfo.Paint; +end; + +function TcxGridDataRowPainter.GetShowCells: Boolean; +begin + Result := True; +end; + +procedure TcxGridDataRowPainter.Paint; +var + AClipRegion: TcxRegion; +begin + if ShowCells then + begin + AClipRegion := Canvas.GetClipRegion; + try + DrawCells; + finally + Canvas.SetClipRegion(AClipRegion, roSet); + end; + end; + inherited; +end; + +{ TcxGridNewItemRowPainter } + +function TcxGridNewItemRowPainter.GetViewInfo: TcxGridNewItemRowViewInfo; +begin + Result := TcxGridNewItemRowViewInfo(inherited ViewInfo); +end; + +procedure TcxGridNewItemRowPainter.DrawBackground; +begin + if not ShowCells and not ViewInfo.Transparent then + DrawBackground(ViewInfo.ContentBounds) + else + inherited; +end; + +procedure TcxGridNewItemRowPainter.DrawSeparator; +begin + ViewInfo.LookAndFeelPainter.DrawHeader(Canvas, ViewInfo.SeparatorBounds, + ViewInfo.SeparatorBounds, [], cxBordersAll, cxbsNormal, taLeftJustify, vaTop, + False, False, '', nil, ViewInfo.LookAndFeelPainter.DefaultHeaderTextColor, + ViewInfo.SeparatorColor); +end; + +function TcxGridNewItemRowPainter.GetShowCells: Boolean; +begin + Result := ViewInfo.Text = ''; +end; + +procedure TcxGridNewItemRowPainter.Paint; +begin + inherited; + DrawText; +end; + +{$IFDEF USETABCONTROL} + +{ TcxGridMasterDataRowDetailsSiteTabsPainter } + +function TcxGridMasterDataRowDetailsSiteTabsPainter.GetViewInfo: TcxGridMasterDataRowDetailsSiteLeftTabsViewInfo; +begin + Result := TcxGridMasterDataRowDetailsSiteLeftTabsViewInfo(inherited ViewInfo); +end; + +procedure TcxGridMasterDataRowDetailsSiteTabsPainter.DrawBottomGridLine; +begin + Canvas.Brush.Color := ViewInfo.BottomGridLineColor; + Canvas.FillRect(ViewInfo.BottomGridLineBounds); +end; + +procedure TcxGridMasterDataRowDetailsSiteTabsPainter.Paint; +begin + inherited; + if ViewInfo.HasBottomGridLine then DrawBottomGridLine; +end; + +{$ENDIF} + +{ TcxGridExpandButtonCellPainter } + +function TcxGridExpandButtonCellPainter.GetViewInfo: TcxGridExpandButtonCellViewInfo; +begin + Result := TcxGridExpandButtonCellViewInfo(inherited ViewInfo); +end; + +procedure TcxGridExpandButtonCellPainter.DrawBorder(ABorder: TcxBorder); +begin + inherited; + if (ABorder = bRight) and not ViewInfo.Transparent then + DrawBackground(ViewInfo.RightBorderRestSpaceBounds); +end; + +{ TcxGridMasterDataRowPainter } + +function TcxGridMasterDataRowPainter.GetViewInfo: TcxGridMasterDataRowViewInfo; +begin + Result := TcxGridMasterDataRowViewInfo(inherited ViewInfo); +end; + +procedure TcxGridMasterDataRowPainter.DrawCells; +begin + inherited; + DrawExpandButtonCell; +end; + +procedure TcxGridMasterDataRowPainter.DrawDetailsSite; +begin + ViewInfo.DetailsSiteViewInfo.Paint(Canvas); + ViewInfo.GridViewInfo.Painter.ExcludeFromBackground(ViewInfo.DetailsSiteViewInfo.Bounds); +end; + +{procedure TcxGridMasterDataRowPainter.DrawDetailsArea; +begin + ViewInfo.DetailsAreaViewInfo.Paint; +end;} + +procedure TcxGridMasterDataRowPainter.DrawExpandButtonCell; +var + AClipRegion: TcxRegion; +begin + AClipRegion := Canvas.GetClipRegion; + try + Canvas.ExcludeClipRect(ViewInfo.CellsAreaBounds); + ViewInfo.ExpandButtonCellViewInfo.Paint; + finally + Canvas.SetClipRegion(AClipRegion, roSet); + end; +end; + +function TcxGridMasterDataRowPainter.NeedsPainting: Boolean; +begin + Result := inherited NeedsPainting or + ViewInfo.DetailsSiteVisible and Canvas.RectVisible(ViewInfo.DetailsAreaViewInfo.GetAreaBoundsForPainting); +end; + +procedure TcxGridMasterDataRowPainter.Paint; +begin + if ViewInfo.DetailsSiteVisible then + begin + DrawDetailsSite; + //DrawDetailsArea; + end; + inherited; +end; + +{ TcxGridGroupCellPainter } + +function TcxGridGroupCellPainter.GetViewInfo: TcxGridGroupCellViewInfo; +begin + Result := TcxGridGroupCellViewInfo(inherited ViewInfo); +end; + +procedure TcxGridGroupCellPainter.DrawBorder(ABorder: TcxBorder); +begin + inherited; + with Canvas, ViewInfo do + if (ABorder = bBottom) and GridRecord.Expanded then + if GridViewInfo.LevelIndentBackgroundBitmap = nil then + begin + Brush.Color := GridViewInfo.LevelIndentColors[GridRecord.Level]; + FillRect(ExpandedAreaBounds); + end + else + FillRect(ExpandedAreaBounds, GridViewInfo.LevelIndentBackgroundBitmap); +end; + +{ TcxGridGroupSummaryCellPainter } + +function TcxGridGroupSummaryCellPainter.GetViewInfo: TcxGridGroupSummaryCellViewInfo; +begin + Result := TcxGridGroupSummaryCellViewInfo(inherited ViewInfo); +end; + +procedure TcxGridGroupSummaryCellPainter.Paint; +begin + inherited; + ViewInfo.SeparatorViewInfo.Paint(Canvas); +end; + +{ TcxGridGroupRowPainter } + +function TcxGridGroupRowPainter.GetViewInfo: TcxGridGroupRowViewInfo; +begin + Result := TcxGridGroupRowViewInfo(inherited ViewInfo); +end; + +procedure TcxGridGroupRowPainter.DrawBackground; +begin +end; + +procedure TcxGridGroupRowPainter.DrawSeparator; +var + R: TRect; +begin + R := ViewInfo.SeparatorIndentBounds; + if not IsRectEmpty(R) then + DrawIndentPart(ViewInfo.Level, R); + inherited; +end; + +procedure TcxGridGroupRowPainter.DrawSummaryCells; +var + I: Integer; +begin + if ViewInfo.SummaryBeginningSpacerViewInfo <> nil then + ViewInfo.SummaryBeginningSpacerViewInfo.Paint(Canvas); + for I := 0 to ViewInfo.SummaryCellViewInfoCount - 1 do + ViewInfo.SummaryCellViewInfos[I].Paint(Canvas); + if ViewInfo.SummaryEndingSpacerViewInfo <> nil then + ViewInfo.SummaryEndingSpacerViewInfo.Paint(Canvas); +end; + +procedure TcxGridGroupRowPainter.Paint; +begin + ViewInfo.CellViewInfo.Paint; + DrawSummaryCells; + inherited; +end; + +{ TcxGridCellViewInfo } + +function TcxGridCellViewInfo.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxGridCellViewInfo.GetGridLines: TcxGridLines; +begin + Result := RecordViewInfo.GridLines; +end; + +function TcxGridCellViewInfo.GetGridRecord: TcxCustomGridRow; +begin + Result := TcxCustomGridRow(inherited GridRecord); +end; + +function TcxGridCellViewInfo.GetGridViewInfo: TcxGridTableViewInfo; +begin + Result := TcxGridTableViewInfo(inherited GridViewInfo); +end; + +function TcxGridCellViewInfo.GetRecordViewInfo: TcxCustomGridRowViewInfo; +begin + Result := TcxCustomGridRowViewInfo(inherited RecordViewInfo); +end; + +function TcxGridCellViewInfo.GetBorderColor(AIndex: TcxBorder): TColor; +begin + Result := GridViewInfo.GridLineColor; +end; + +function TcxGridCellViewInfo.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := GridViewInfo.GridLineWidth; +end; + +procedure TcxGridCellViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetDataCellParams(GridRecord, nil, AParams, True, Self); +end; + +{ TcxGridDataCellViewInfo } + +destructor TcxGridDataCellViewInfo.Destroy; +var + I: Integer; +begin + if FIsMerging then + begin + for I := 0 to MergedCellCount - 1 do + MergedCells[I].FMergingCell := nil; + FMergedCells.Free; + end + else + if FIsMerged and (FMergingCell <> nil) then + FMergingCell.RemoveMergedCell(Self); + inherited; +end; + +function TcxGridDataCellViewInfo.GetCacheItem: TcxGridTableViewInfoCacheItem; +begin + Result := TcxGridTableViewInfoCacheItem(inherited CacheItem); +end; + +function TcxGridDataCellViewInfo.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxGridDataCellViewInfo.GetGridViewInfo: TcxGridTableViewInfo; +begin + Result := TcxGridTableViewInfo(inherited GridViewInfo); +end; + +function TcxGridDataCellViewInfo.GetItem: TcxGridColumn; +begin + Result := TcxGridColumn(inherited Item); +end; + +function TcxGridDataCellViewInfo.GetMergedCell(Index: Integer): TcxGridDataCellViewInfo; +begin + Result := TcxGridDataCellViewInfo(FMergedCells[Index]); +end; + +function TcxGridDataCellViewInfo.GetMergedCellCount: Integer; +begin + Result := FMergedCells.Count; +end; + +function TcxGridDataCellViewInfo.GetMergedCellOfFocusedRow: TcxGridDataCellViewInfo; +var + I: Integer; +begin + for I := 0 to MergedCellCount - 1 do + begin + Result := MergedCells[I]; + if Result.RecordViewInfo.Focused then Exit; + end; + Result := nil; +end; + +function TcxGridDataCellViewInfo.GetRecordViewInfo: TcxGridDataRowViewInfo; +begin + Result := TcxGridDataRowViewInfo(inherited RecordViewInfo); +end; + +procedure TcxGridDataCellViewInfo.AfterRowsViewInfoCalculate; +var + AProperties: TcxCustomEditProperties; + AValue: TcxEditValue; + I: Integer; + ARowViewInfo: TcxCustomGridRowViewInfo; + ACellViewInfo: TcxGridDataCellViewInfo; + + procedure UpdateBounds; + begin + if FIsMerging then + begin + Bounds.Bottom := MergedCells[MergedCellCount - 1].Bounds.Bottom; + Recalculate; + end + else + if Height <> FOriginalHeight then + begin + Bounds.Bottom := Bounds.Top + FOriginalHeight; + Recalculate; + end; + end; + +begin + if FIsMerged then + begin + UpdateBounds; + Exit; + end; + if not CanCellMerging or GridViewInfo.IsInternalUse then Exit; + AProperties := Properties; + AValue := DisplayValue; + for I := RecordViewInfo.Index + 1 to RecordViewInfo.RecordsViewInfo.Count - 1 do + begin + ARowViewInfo := RecordViewInfo.RecordsViewInfo[I]; + if ARowViewInfo is TcxGridDataRowViewInfo then + begin + ACellViewInfo := TcxGridDataRowViewInfo(ARowViewInfo).InternalCellViewInfos[Item.VisibleIndex]; + if Item.DoCompareValuesForCellMerging( + RecordViewInfo.GridRecord, AProperties, AValue, + TcxGridDataRowViewInfo(ARowViewInfo).GridRecord, ACellViewInfo.Properties, ACellViewInfo.DisplayValue) then + begin + if not FIsMerging then + begin + FIsMerging := True; + FMergedCells := TList.Create; + end; + FMergedCells.Add(ACellViewInfo); + ACellViewInfo.FIsMerged := True; + ACellViewInfo.FMergingCell := Self; + if not ACellViewInfo.CanBeMergingCell then Break; + end + else + Break; + end + else + Break; + end; + UpdateBounds; +end; + +procedure TcxGridDataCellViewInfo.AfterRowsViewInfoOffset; +begin + FIsMerging := False; + FIsMerged := False; + FreeAndNil(FMergedCells); + FMergingCell := nil; +end; + +function TcxGridDataCellViewInfo.CalculateSelected: Boolean; +var + AMergedCellOfFocusedRow: TcxGridDataCellViewInfo; + + procedure CheckMergedCells; + var + I: Integer; + begin + if not Result and GridView.OptionsSelection.MultiSelect then + for I := 0 to MergedCellCount - 1 do + begin + Result := MergedCells[I].Selected; + if Result then Break; + end; + end; + +begin + Result := inherited CalculateSelected; + if FIsMerging then + if not GridView.OptionsSelection.MultiSelect or + GridView.OptionsSelection.InvertSelect or Item.Focused then + if not RecordViewInfo.Focused then + begin + AMergedCellOfFocusedRow := MergedCellOfFocusedRow; + if AMergedCellOfFocusedRow <> nil then + Result := AMergedCellOfFocusedRow.Selected + else + CheckMergedCells; + end + else + else + CheckMergedCells; +end; + +function TcxGridDataCellViewInfo.CalculateWidth: Integer; +begin + Result := RecordViewInfo.GetCellWidth(Item.VisibleIndex); +end; + +function TcxGridDataCellViewInfo.CanBeMergingCell: Boolean; +begin + Result := not RecordViewInfo.Expanded; +end; + +function TcxGridDataCellViewInfo.CanCellMerging: Boolean; +begin + Result := CanBeMergingCell and TcxGridColumnAccess.CanCellMerging(Item); +end; + +function TcxGridDataCellViewInfo.GetBorderColor(AIndex: TcxBorder): TColor; +begin + Result := GridViewInfo.GridLineColor; +end; + +function TcxGridDataCellViewInfo.GetBorders: TcxBorders; +begin + Result := RecordViewInfo.GetCellBorders(Item.IsMostRight, + Item.IsMostBottom and RecordViewInfo.CellsAreaViewInfo.IsBottom); +end; + +function TcxGridDataCellViewInfo.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := GridViewInfo.GridLineWidth; +end; + +function TcxGridDataCellViewInfo.GetFocused: Boolean; +var + AMergedCellOfFocusedRow: TcxGridDataCellViewInfo; +begin + Result := inherited GetFocused; + if FIsMerging and not RecordViewInfo.Focused then + begin + AMergedCellOfFocusedRow := MergedCellOfFocusedRow; + if AMergedCellOfFocusedRow <> nil then + Result := AMergedCellOfFocusedRow.Focused; + end; +end; + +function TcxGridDataCellViewInfo.GetMultiLine: Boolean; +begin + Result := inherited GetMultiLine or RecordViewInfo.AutoHeight; +end; + +function TcxGridDataCellViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridDataCellPainter; +end; + +function TcxGridDataCellViewInfo.GetVisible: Boolean; +begin + Result := not FIsMerged and inherited GetVisible; +end; + +function TcxGridDataCellViewInfo.GetVisibleForHitTest: Boolean; +begin + Result := inherited GetVisible; +end; + +function TcxGridDataCellViewInfo.HasHitTestPoint(const P: TPoint): Boolean; +begin + if IsMerging then + Result := PtInRect(OriginalBounds, P) + else + Result := inherited HasHitTestPoint(P); +end; + +procedure TcxGridDataCellViewInfo.Offset(DX, DY: Integer); +begin + inherited; + OffsetRect(OriginalBounds, DX, DY); +end; + +procedure TcxGridDataCellViewInfo.RemoveMergedCell(ACellViewInfo: TcxGridDataCellViewInfo); +begin + FMergedCells.Remove(ACellViewInfo); +end; + +procedure TcxGridDataCellViewInfo.BeforeRecalculation; +begin + inherited; + RecordViewInfo.BeforeCellRecalculation(Self); +end; + +procedure TcxGridDataCellViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + inherited; + if not FIsMerging then + begin + OriginalBounds := Bounds; + FOriginalHeight := Height; + end; + if FIsMerged and (FMergingCell <> nil) then + FMergingCell.Recalculate; +end; + +function TcxGridDataCellViewInfo.MouseMove(AHitTest: TcxCustomGridHitTest; + AShift: TShiftState): Boolean; +begin + if IsMerged then + Result := MergingCell.MouseMove(AHitTest, AShift) + else + Result := inherited MouseMove(AHitTest, AShift); +end; + +procedure TcxGridDataCellViewInfo.Paint(ACanvas: TcxCanvas = nil); +begin + inherited; + if FIsMerged and RecordViewInfo.CellsAreaViewInfo.DrawMergedCells then + FMergingCell.Paint(ACanvas); +end; + +{ TcxGridDataRowCellsAreaViewInfo } + +constructor TcxGridDataRowCellsAreaViewInfo.Create(ARecordViewInfo: TcxCustomGridRecordViewInfo); +begin + inherited; + Visible := CalculateVisible; +end; + +function TcxGridDataRowCellsAreaViewInfo.GetRecordViewInfo: TcxGridDataRowViewInfo; +begin + Result := TcxGridDataRowViewInfo(inherited RecordViewInfo); +end; + +function TcxGridDataRowCellsAreaViewInfo.CalculateHeight: Integer; +begin + Result := 0; +end; + +function TcxGridDataRowCellsAreaViewInfo.CalculateVisible: Boolean; +begin + Result := RecordViewInfo.GridViewInfo.HeaderViewInfo.Count = 0; +end; + +function TcxGridDataRowCellsAreaViewInfo.CalculateWidth: Integer; +begin + Result := 0; +end; + +function TcxGridDataRowCellsAreaViewInfo.GetBorders: TcxBorders; +begin + Result := GridViewInfo.GetCellBorders(True, IsBottom); +end; + +function TcxGridDataRowCellsAreaViewInfo.GetIsBottom: Boolean; +begin + Result := + not RecordViewInfo.HasPreview or (GridView.Preview.Place = ppTop) or + (RecordViewInfo.PreviewViewInfo.Height = 0); +end; + +function TcxGridDataRowCellsAreaViewInfo.CanDrawSelected: Boolean; +begin + Result := True; +end; + +function TcxGridDataRowCellsAreaViewInfo.DrawMergedCells: Boolean; +begin + Result := RecordViewInfo.Transparent; +end; + +{ TcxGridPreviewCellViewInfo } + +function TcxGridPreviewCellViewInfo.GetPreview: TcxGridPreview; +begin + Result := GridView.Preview; +end; + +function TcxGridPreviewCellViewInfo.CalculateHeight: Integer; + + function GetMaxValue: Integer; + begin + if Preview.MaxLineCount = 0 then + Result := 0 + else + begin + Result := Preview.MaxLineCount * GridViewInfo.GetFontHeight(Params.Font); + GetCellTextAreaSize(Result); + end; + end; + +begin + if CacheItem.IsPreviewHeightAssigned then + Result := Height + else + begin + if AutoHeight then + Result := inherited CalculateHeight + else + begin + CalculateParams; + Result := GetMaxValue; + end; + if Result <> 0 then + Result := RecordViewInfo.RecordsViewInfo.GetCellHeight(Result); + end; +end; + +function TcxGridPreviewCellViewInfo.CalculateWidth: Integer; +begin + Result := RecordViewInfo.DataWidth; +end; + +function TcxGridPreviewCellViewInfo.GetAutoHeight: Boolean; +begin + Result := Preview.AutoHeight; +end; + +function TcxGridPreviewCellViewInfo.GetBackgroundBitmap: TBitmap; +begin + Result := GridView.BackgroundBitmaps.GetBitmap(bbPreview); +end; + +function TcxGridPreviewCellViewInfo.GetBorders: TcxBorders; +begin + Result := GridViewInfo.GetCellBorders(True, + (Preview.Place = ppBottom) or (RecordViewInfo.CellViewInfoCount = 0)); +end; + +procedure TcxGridPreviewCellViewInfo.GetEditViewDataContentOffsets(var R: TRect); +begin + inherited; + R.Left := Preview.LeftIndent - (cxGridCellTextOffset - cxGridEditOffset); + R.Right := Preview.RightIndent - (cxGridCellTextOffset - cxGridEditOffset); +end; + +function TcxGridPreviewCellViewInfo.GetHeight: Integer; +begin + if CacheItem.IsPreviewHeightAssigned then + Result := CacheItem.PreviewHeight + else + begin + Result := CalculateHeight; + CacheItem.PreviewHeight := Result; + end; +end; + +function TcxGridPreviewCellViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridPreviewHitTest; +end; + +function TcxGridPreviewCellViewInfo.GetMaxLineCount: Integer; +begin + Result := Preview.MaxLineCount; +end; + +function TcxGridPreviewCellViewInfo.GetMultiLine: Boolean; +begin + Result := True; +end; + +function TcxGridPreviewCellViewInfo.GetTextAreaBounds: TRect; +begin + Result := inherited GetTextAreaBounds; + InflateRect(Result, cxGridCellTextOffset, 0); + Inc(Result.Left, Preview.LeftIndent); + Dec(Result.Right, Preview.RightIndent); +end; + +function TcxGridPreviewCellViewInfo.SupportsZeroHeight: Boolean; +begin + Result := True; +end; + +{ TcxGridDataRowViewInfo } + +constructor TcxGridDataRowViewInfo.Create(ARecordsViewInfo: TcxCustomGridRecordsViewInfo; + ARecord: TcxCustomGridRecord); +begin + inherited; + CreateViewInfos; +end; + +destructor TcxGridDataRowViewInfo.Destroy; +begin + DestroyViewInfos; + inherited; +end; + +function TcxGridDataRowViewInfo.GetCellViewInfo(Index: Integer): TcxGridDataCellViewInfo; +begin + Result := InternalCellViewInfos[Index]; + if Result = nil then + begin + Result := GetCellViewInfoClass(Index).Create(Self, GridView.VisibleColumns[Index]); + FCellViewInfos[Index] := Result; + end; +end; + +function TcxGridDataRowViewInfo.GetCellViewInfoCount: Integer; +begin + Result := FCellViewInfos.Count; +end; + +function TcxGridDataRowViewInfo.GetGridRecord: TcxGridDataRow; +begin + Result := TcxGridDataRow(inherited GridRecord); +end; + +function TcxGridDataRowViewInfo.GetHasPreview: Boolean; +begin + Result := FPreviewViewInfo <> nil; +end; + +function TcxGridDataRowViewInfo.GetInternalCellViewInfo(Index: Integer): TcxGridDataCellViewInfo; +begin + Result := TcxGridDataCellViewInfo(FCellViewInfos[Index]); +end; + +procedure TcxGridDataRowViewInfo.CreateViewInfos; +begin + FCellViewInfos := TList.Create; + FCellViewInfos.Count := GridViewInfo.HeaderViewInfo.Count; + FCellsAreaViewInfo := GetCellsAreaViewInfoClass.Create(Self); + if ShowPreview then + FPreviewViewInfo := GetPreviewViewInfoClass.Create(Self, GridView.Preview.Column); +end; + +procedure TcxGridDataRowViewInfo.DestroyViewInfos; +var + I: Integer; +begin + FPreviewViewInfo.Free; + FCellsAreaViewInfo.Free; + for I := 0 to CellViewInfoCount - 1 do + InternalCellViewInfos[I].Free; + FCellViewInfos.Free; +end; + +procedure TcxGridDataRowViewInfo.AfterRowsViewInfoCalculate; +var + I: Integer; + ACellViewInfo: TcxGridDataCellViewInfo; +begin + inherited; + for I := 0 to CellViewInfoCount - 1 do + begin + ACellViewInfo := InternalCellViewInfos[I]; + if (ACellViewInfo <> nil) and ACellViewInfo.Calculated then + ACellViewInfo.AfterRowsViewInfoCalculate; + end; +end; + +procedure TcxGridDataRowViewInfo.AfterRowsViewInfoOffset; +var + I: Integer; + ACellViewInfo: TcxGridDataCellViewInfo; +begin + inherited; + for I := 0 to CellViewInfoCount - 1 do + begin + ACellViewInfo := InternalCellViewInfos[I]; + if ACellViewInfo <> nil then + ACellViewInfo.AfterRowsViewInfoOffset; + end; +end; + +procedure TcxGridDataRowViewInfo.ApplyMergedCellsBounds(var R: TRect; + AItem: TcxCustomGridTableItem); +var + I: Integer; + + procedure ProcessCell(ACellViewInfo: TcxGridDataCellViewInfo); + begin + if (ACellViewInfo <> nil) and ACellViewInfo.IsMerged then + with ACellViewInfo.MergingCell do + begin + if Bounds.Top < R.Top then + R.Top := Bounds.Top; + if Bounds.Bottom > R.Bottom then + R.Bottom := Bounds.Bottom; + end; + end; + +begin + if AItem = nil then + for I := 0 to CellViewInfoCount - 1 do + ProcessCell(InternalCellViewInfos[I]) + else + ProcessCell(InternalCellViewInfos[AItem.VisibleIndex]); +end; + +procedure TcxGridDataRowViewInfo.ApplyMergingCellsBounds(var R: TRect); +var + I: Integer; + ACellViewInfo: TcxGridDataCellViewInfo; +begin + for I := 0 to CellViewInfoCount - 1 do + begin + ACellViewInfo := InternalCellViewInfos[I]; + if (ACellViewInfo <> nil) and + ACellViewInfo.IsMerging and (ACellViewInfo.Bounds.Bottom > R.Bottom) then + R.Bottom := ACellViewInfo.Bounds.Bottom; + end; +end; + +procedure TcxGridDataRowViewInfo.CalculateCellViewInfo(AIndex: Integer); +begin + CellViewInfos[AIndex].Calculate(GetCellLeftBound(AIndex), GetCellTopBound(AIndex), + -1, GetCellHeight(AIndex)); +end; + +function TcxGridDataRowViewInfo.CalculateHeight: Integer; +var + I, AHeight: Integer; +begin + if AutoHeight then + begin + Result := 0; + for I := 0 to CellViewInfoCount - 1 do + begin + AHeight := CellViewInfos[I].CalculateHeight; + if AHeight > Result then Result := AHeight; + end; + Result := RecordsViewInfo.GetCellHeight(Result); + if not TcxCustomGridTableViewAccess.IsGetCellHeightAssigned(GridView) then + with RecordsViewInfo do + if Result < DataRowHeight then Result := DataRowHeight; + end + else + Result := RecordsViewInfo.DataRowHeight; + if HasPreview then + Inc(Result, PreviewViewInfo.Height); + Inc(Result, inherited CalculateHeight); +end; + +function TcxGridDataRowViewInfo.CanSize: Boolean; +begin + Result := RecordsViewInfo.CanDataRowSize; +end; + +procedure TcxGridDataRowViewInfo.CheckRowHeight(var AValue: Integer); +begin + Dec(AValue, NonBaseHeight); + inherited; + GridView.OptionsView.CheckDataRowHeight(AValue); + Inc(AValue, NonBaseHeight); +end; + +function TcxGridDataRowViewInfo.GetAutoHeight: Boolean; +begin + Result := RecordsViewInfo.AutoDataRecordHeight; +end; + +function TcxGridDataRowViewInfo.GetBackgroundBitmapBounds: TRect; +begin + Result := inherited GetBackgroundBitmapBounds; + if HasPreview and (FPreviewViewInfo.BackgroundBitmap <> nil) then + with CellsAreaBounds do + begin + Result.Top := Top; + Result.Bottom := Bottom; + end; +end; + +function TcxGridDataRowViewInfo.GetBaseHeight: Integer; +begin + Result := inherited GetBaseHeight; + if HasPreview then + Dec(Result, PreviewViewInfo.Height); +end; + +function TcxGridDataRowViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridDataRowPainter; +end; + +procedure TcxGridDataRowViewInfo.Offset(DX, DY: Integer); + + procedure OffsetCells; + var + I: Integer; + ACellViewInfo: TcxGridDataCellViewInfo; + begin + for I := 0 to CellViewInfoCount - 1 do + begin + ACellViewInfo := InternalCellViewInfos[I]; + if IsCellVisible(I) then + if (ACellViewInfo = nil) or not ACellViewInfo.Calculated then + CalculateCellViewInfo(I) + else + ACellViewInfo.DoOffset(DX, DY) + else + if (DX <> 0) and (ACellViewInfo <> nil) then + begin + ACellViewInfo.Free; + FCellViewInfos[I] := nil; + end; + end; + end; + +begin + inherited; + OffsetRect(FCellsAreaBounds, DX, DY); + OffsetCells; + FCellsAreaViewInfo.DoOffset(DX, DY); + if FPreviewViewInfo <> nil then + FPreviewViewInfo.DoOffset(DX, DY); +end; + +procedure TcxGridDataRowViewInfo.SetRowHeight(Value: Integer); +begin + if RowHeight <> Value then + GridView.OptionsView.DataRowHeight := Value - NonBaseHeight; +end; + +function TcxGridDataRowViewInfo.GetCellHeight(AIndex: Integer): Integer; +begin + if CellViewInfos[AIndex].IsMerging then + Result := InternalCellViewInfos[AIndex].Height + else + Result := GridViewInfo.GetCellHeight(AIndex, FCellHeight); +end; + +function TcxGridDataRowViewInfo.GetCellHeightValue: Integer; +begin + if AutoHeight then + begin + Result := DataHeight; + if HasPreview then Dec(Result, PreviewViewInfo.Height); + end + else + Result := RecordsViewInfo.RowHeight; +end; + +function TcxGridDataRowViewInfo.GetCellLeftBound(AIndex: Integer): Integer; +begin + Result := GridViewInfo.HeaderViewInfo[AIndex].DataOffset; +end; + +function TcxGridDataRowViewInfo.GetCellTopBound(AIndex: Integer): Integer; +begin + Result := FCellsAreaBounds.Top + GridViewInfo.GetCellTopOffset(AIndex, FCellHeight); +end; + +function TcxGridDataRowViewInfo.GetCellsAreaBounds: TRect; +begin + with Result do + begin + Left := DataIndent; + Right := Left + DataWidth; + Top := Bounds.Top; + Bottom := Top + DataHeight; + if HasPreview then + if PreviewViewInfo.Preview.Place = ppTop then + Inc(Top, PreviewViewInfo.Height) + else + Dec(Bottom, PreviewViewInfo.Height); + end; +end; + +function TcxGridDataRowViewInfo.GetCellsAreaViewInfoClass: TcxGridDataRowCellsAreaViewInfoClass; +begin + Result := TcxGridDataRowCellsAreaViewInfoClass(RecordsViewInfo.GetDataRowCellsAreaViewInfoClass); +end; + +function TcxGridDataRowViewInfo.GetCellViewInfoClass(AIndex: Integer): TcxGridDataCellViewInfoClass; +begin + Result := TcxGridDataCellViewInfo; +end; + +function TcxGridDataRowViewInfo.GetCellWidth(AIndex: Integer): Integer; +begin + Result := GridViewInfo.HeaderViewInfo[AIndex].RealWidth; +end; + +function TcxGridDataRowViewInfo.GetPreviewViewInfoClass: TcxGridPreviewCellViewInfoClass; +begin + Result := TcxGridPreviewCellViewInfo; +end; + +function TcxGridDataRowViewInfo.GetShowPreview: Boolean; +begin + Result := GridView.Preview.Active; +end; + +function TcxGridDataRowViewInfo.IsCellVisible(AIndex: Integer): Boolean; +begin + Result := GridViewInfo.HeaderViewInfo[AIndex].Visible; +end; + +procedure TcxGridDataRowViewInfo.BeforeCellRecalculation(ACell: TcxGridTableCellViewInfo); +begin +end; + +procedure TcxGridDataRowViewInfo.BeforeRecalculation; +var + I: Integer; +begin + inherited; + FCellsAreaViewInfo.BeforeRecalculation; + for I := 0 to CellViewInfoCount - 1 do + if InternalCellViewInfos[I] <> nil then + InternalCellViewInfos[I].BeforeRecalculation; + if FPreviewViewInfo <> nil then + FPreviewViewInfo.BeforeRecalculation; +end; + +procedure TcxGridDataRowViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +var + I: Integer; + + procedure CalculatePreview; + + function GetTopBound: Integer; + begin + if PreviewViewInfo.Preview.Place = ppTop then + Result := ATopBound + else + Result := FCellsAreaBounds.Bottom; + end; + + begin + PreviewViewInfo.Calculate(FCellsAreaBounds.Left, GetTopBound); + end; + +begin + inherited; + FCellsAreaBounds := CellsAreaBounds; + if HasPreview then CalculatePreview; + FCellHeight := CellHeight; + for I := 0 to CellViewInfoCount - 1 do + if IsCellVisible(I) then CalculateCellViewInfo(I); + if FCellsAreaViewInfo.Visible then + FCellsAreaViewInfo.Calculate(FCellsAreaBounds); +end; + +function TcxGridDataRowViewInfo.GetAreaBoundsForPainting: TRect; +begin + Result := inherited GetAreaBoundsForPainting; + ApplyMergingCellsBounds(Result); +end; + +function TcxGridDataRowViewInfo.GetBoundsForInvalidate(AItem: TcxCustomGridTableItem): TRect; +begin + Result := inherited GetBoundsForInvalidate(AItem); + if AItem = nil then + ApplyMergingCellsBounds(Result); + ApplyMergedCellsBounds(Result, AItem); +end; + +function TcxGridDataRowViewInfo.GetBoundsForItem(AItem: TcxCustomGridTableItem): TRect; +begin + if InternalCellViewInfos[AItem.VisibleIndex] = nil then + Result := inherited GetBoundsForItem(AItem) + else + Result := InternalCellViewInfos[AItem.VisibleIndex].Bounds; +end; + +function TcxGridDataRowViewInfo.GetCellBorders(AIsRight, AIsBottom: Boolean): TcxBorders; +begin + Result := GridViewInfo.GetCellBorders(AIsRight, AIsBottom); +end; + +function TcxGridDataRowViewInfo.GetCellViewInfoByItem(AItem: TcxCustomGridTableItem): TcxGridTableDataCellViewInfo; +begin + if TcxGridColumn(AItem).IsPreview then + Result := FPreviewViewInfo + else + if (AItem.VisibleIndex = -1) or TcxCustomGrid(GridView.Control).UpdateLocked then + Result := nil + else + Result := InternalCellViewInfos[AItem.VisibleIndex]; +end; + +function TcxGridDataRowViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +var + I: Integer; + ACellViewInfo: TcxGridDataCellViewInfo; + AHitTest: TcxCustomGridHitTest; +begin + Result := inherited GetHitTest(P); + if (Result <> nil) and (Result.ClassType = GetHitTestClass) then + begin + for I := 0 to CellViewInfoCount - 1 do + begin + ACellViewInfo := InternalCellViewInfos[I]; + if ACellViewInfo <> nil then + begin + AHitTest := ACellViewInfo.GetHitTest(P); + if AHitTest <> nil then + begin + Result := AHitTest; + Exit; + end; + end; + end; + if HasPreview then + begin + AHitTest := FPreviewViewInfo.GetHitTest(P); + if AHitTest <> nil then + begin + Result := AHitTest; + Exit; + end; + end; + end; +end; + +{ TcxGridNewItemRowViewInfo } + +function TcxGridNewItemRowViewInfo.CalculateSelected: Boolean; +begin + Result := GridRecord.Selected; +end; + +function TcxGridNewItemRowViewInfo.GetAlignmentHorz: TAlignment; +begin + Result := taCenter; +end; + +function TcxGridNewItemRowViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + Result := vaCenter; +end; + +function TcxGridNewItemRowViewInfo.GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TcxGridNewItemRowViewInfo.GetCellLeftBound(AIndex: Integer): Integer; +begin + Result := GridViewInfo.HeaderViewInfo[AIndex].RealBounds.Left; +end; + +function TcxGridNewItemRowViewInfo.GetCellWidth(AIndex: Integer): Integer; +begin + Result := GridViewInfo.HeaderViewInfo[AIndex].Width; +end; + +function TcxGridNewItemRowViewInfo.GetHeight: Integer; +begin + if FHeight = 0 then + FHeight := CalculateHeight; + Result := FHeight; +end; + +function TcxGridNewItemRowViewInfo.GetInfoText: string; +begin + Result := Options.InfoText; +end; + +function TcxGridNewItemRowViewInfo.GetOptions: TcxGridSpecialRowOptions; +begin + Result := GridView.NewItemRow; +end; + +function TcxGridNewItemRowViewInfo.GetSeparatorColor: TColor; +begin + Result := Options.GetSeparatorColor; +end; + +function TcxGridNewItemRowViewInfo.GetSeparatorWidth: Integer; +begin + Result := Options.SeparatorWidth; +end; + +function TcxGridNewItemRowViewInfo.GetShowInfoText: Boolean; +begin + Result := not Focused; +end; + +function TcxGridNewItemRowViewInfo.GetShowPreview: Boolean; +begin + Result := False; +end; + +function TcxGridNewItemRowViewInfo.GetStyleIndex: Integer; +begin + Result := vsNewItemRowInfoText; +end; + +function TcxGridNewItemRowViewInfo.GetText: string; +begin + if ShowInfoText then + Result := InfoText + else + Result := inherited GetText; +end; + +function TcxGridNewItemRowViewInfo.GetTextAreaBounds: TRect; +begin + Result := ContentBounds; + with GridViewInfo.ScrollableAreaBoundsHorz do + begin + Result.Left := Left; + if Result.Right > Right then + Result.Right := Right; + end; +end; + +procedure TcxGridNewItemRowViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetViewParams(GetStyleIndex, GridRecord, nil, AParams); +end; + +function TcxGridNewItemRowViewInfo.HasFooters: Boolean; +begin + Result := False; +end; + +function TcxGridNewItemRowViewInfo.HasLastHorzGridLine: Boolean; +begin + Result := False; +end; + +function TcxGridNewItemRowViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridNewItemRowPainter; +end; + +{ TcxGridFilterRowViewInfo } + +function TcxGridFilterRowViewInfo.GetGridRecord: TcxGridFilterRow; +begin + Result := TcxGridFilterRow(inherited GridRecord); +end; + +function TcxGridFilterRowViewInfo.GetOptions: TcxGridSpecialRowOptions; +begin + Result := GridView.FilterRow; +end; + +function TcxGridFilterRowViewInfo.GetShowInfoText: Boolean; +begin + Result := inherited GetShowInfoText and GridRecord.IsEmpty; +end; + +function TcxGridFilterRowViewInfo.GetStyleIndex: Integer; +begin + Result := vsFilterRowInfoText; +end; + +{$IFDEF USETABCONTROL} + +{ TcxGridMasterDataRowDetailsSiteLeftTabsViewInfo } + +function TcxGridMasterDataRowDetailsSiteLeftTabsViewInfo.GetBottomGridLineColor: TColor; +begin + Result := SiteViewInfo.MasterGridViewInfo.GridLineColor; +end; + +function TcxGridMasterDataRowDetailsSiteLeftTabsViewInfo.GetBottomGridLineWidth: Integer; +begin + Result := SiteViewInfo.MasterGridViewInfo.GridLineWidth; +end; + +function TcxGridMasterDataRowDetailsSiteLeftTabsViewInfo.GetSiteViewInfo: TcxGridDetailsSiteViewInfo; +begin + Result := TcxGridDetailsSiteViewInfo(inherited SiteViewInfo); +end; + +function TcxGridMasterDataRowDetailsSiteLeftTabsViewInfo.CalculateHeight: Integer; +begin + Result := inherited CalculateHeight; + if HasBottomGridLine then + Inc(Result, BottomGridLineWidth); +end; + +function TcxGridMasterDataRowDetailsSiteLeftTabsViewInfo.GetBottomGridLineBounds: TRect; +begin + Result := Bounds; + Result.Top := Result.Bottom - BottomGridLineWidth; +end; + +function TcxGridMasterDataRowDetailsSiteLeftTabsViewInfo.GetPainterClass: TcxGridDetailsSiteTabsPainterClass; +begin + Result := TcxGridMasterDataRowDetailsSiteTabsPainter; +end; + +function TcxGridMasterDataRowDetailsSiteLeftTabsViewInfo.GetTabControlBounds: TRect; +begin + Result := inherited GetTabControlBounds; + if HasBottomGridLine then + Dec(Result.Bottom, BottomGridLineWidth); +end; + +function TcxGridMasterDataRowDetailsSiteLeftTabsViewInfo.HasBottomGridLine: Boolean; +begin + Result := bBottom in SiteViewInfo.MasterGridViewInfo.GetCellBorders(False, True); +end; + +{$ENDIF} + +{ TcxGridDetailsSiteViewInfo } + +constructor TcxGridDetailsSiteViewInfo.Create(AMasterDataRowViewInfo: TcxGridMasterDataRowViewInfo); +begin + FMasterDataRowViewInfo := AMasterDataRowViewInfo; + inherited Create(TcxGridLevel(FMasterDataRowViewInfo.GridView.Level)); + if CacheItem.IsDetailsSiteCachedInfoAssigned then + SetCachedInfo(CacheItem.DetailsSiteCachedInfo); +end; + +destructor TcxGridDetailsSiteViewInfo.Destroy; +begin + if not MasterGridViewInfo.IsInternalUse and (CacheItem <> nil) then + begin + if CacheItem.IsDetailsSiteCachedInfoAssigned then + raise Exception.Create('CacheItem.IsDetailsSiteCachedInfoAssigned'); //!!! + GetCachedInfo(CacheItem.DetailsSiteCachedInfo); + end; + inherited; +end; + +function TcxGridDetailsSiteViewInfo.GetCacheItem: TcxGridMasterTableViewInfoCacheItem; +begin + Result := FMasterDataRowViewInfo.CacheItem; +end; + +function TcxGridDetailsSiteViewInfo.GetMasterGridView: TcxGridTableView; +begin + Result := FMasterDataRowViewInfo.GridView; +end; + +function TcxGridDetailsSiteViewInfo.GetMasterGridViewInfo: TcxGridTableViewInfo; +begin + Result := FMasterDataRowViewInfo.GridViewInfo; +end; + +procedure TcxGridDetailsSiteViewInfo.ControlFocusChanged; +begin + if ActiveGridViewExists then + ActiveGridView.Controller.ControlFocusChanged; +end; + +function TcxGridDetailsSiteViewInfo.GetActiveGridView: TcxCustomGridView; +begin + Result := FMasterDataRowViewInfo.GridRecord.ActiveDetailGridView; + if Result <> nil then + Result.CheckSynchronizationAssignNeeded; +end; + +function TcxGridDetailsSiteViewInfo.GetActiveGridViewExists: Boolean; +var + AMasterGridRecord: TcxGridMasterDataRow; +begin + Result := inherited GetActiveGridViewExists; + if not Result and not IsActiveGridViewDestroying and not (csDestroying in ComponentState) then + begin + AMasterGridRecord := FMasterDataRowViewInfo.GridRecord; + Result := + (AMasterGridRecord <> nil) and AMasterGridRecord.ActiveDetailGridViewExists and + not AMasterGridRecord.ActiveDetailGridView.IsDestroying; + end; +end; + +function TcxGridDetailsSiteViewInfo.GetActiveGridViewValue: TcxCustomGridView; +begin + Result := inherited GetActiveGridViewValue; + if (Result <> nil) and (Result.ViewInfo <> nil) then + Result.ViewInfo.IsInternalUse := MasterGridViewInfo.IsInternalUse; +end; + +function TcxGridDetailsSiteViewInfo.GetActiveLevel: TcxGridLevel; +begin + Result := FMasterDataRowViewInfo.GridRecord.ActiveDetailLevel; +end; + +function TcxGridDetailsSiteViewInfo.GetCanvas: TcxCanvas; +begin + Result := MasterGridViewInfo.Canvas; +end; + +function TcxGridDetailsSiteViewInfo.GetContainer: TcxControl; +begin + Result := MasterGridViewInfo.Site; +end; + +function TcxGridDetailsSiteViewInfo.GetDesignController: TcxCustomGridDesignController; +begin + Result := MasterGridView.Controller.DesignController; +end; + +function TcxGridDetailsSiteViewInfo.GetFullyVisible: Boolean; +begin + if CacheItem.IsDetailsSiteFullyVisibleAssigned then + Result := CacheItem.DetailsSiteFullyVisible + else + begin + Result := inherited GetFullyVisible; + CacheItem.DetailsSiteFullyVisible := Result; + end; +end; + +function TcxGridDetailsSiteViewInfo.GetHeight: Integer; +begin + if CacheItem.IsDetailsSiteHeightAssigned then + Result := CacheItem.DetailsSiteHeight + else + begin + Result := inherited GetHeight; + CacheItem.DetailsSiteHeight := Result; + end; +end; + +function TcxGridDetailsSiteViewInfo.GetMasterRecord: TObject; +begin + Result := MasterDataRowViewInfo.GridRecord; +end; + +function TcxGridDetailsSiteViewInfo.GetMaxHeight: Integer; +begin + Result := FMasterDataRowViewInfo.RestHeight; + TcxGridLevelAccess.CheckHeight(Level, Result); +end; + +function TcxGridDetailsSiteViewInfo.GetMaxNormalHeight: Integer; +begin + Result := inherited GetMaxNormalHeight; + TcxGridLevelAccess.CheckHeight(Level, Result); +end; + +function TcxGridDetailsSiteViewInfo.GetMaxWidth: Integer; +begin + Result := MasterGridViewInfo.ClientWidth - + FMasterDataRowViewInfo.LevelIndent - + FMasterDataRowViewInfo.ExpandButtonCellViewInfo.BaseWidth; +end; + +function TcxGridDetailsSiteViewInfo.GetNormalHeight: Integer; +begin + if CacheItem.IsDetailsSiteNormalHeightAssigned then + Result := CacheItem.DetailsSiteNormalHeight + else + begin + Result := inherited GetNormalHeight; + CacheItem.DetailsSiteNormalHeight := Result; + end; +end; + +{$IFDEF USETABCONTROL} + +function TcxGridDetailsSiteViewInfo.GetTabsViewInfoClass: TcxCustomGridDetailsSiteTabsViewInfoClass; +begin + if TabsPosition = dtpLeft then + Result := TcxGridMasterDataRowDetailsSiteLeftTabsViewInfo + else + Result := inherited GetTabsViewInfoClass; +end; + +{$ENDIF} + +function TcxGridDetailsSiteViewInfo.GetVisible: Boolean; +begin + Result := FMasterDataRowViewInfo.DetailsSiteVisible; +end; + +function TcxGridDetailsSiteViewInfo.GetWidth: Integer; +begin + if CacheItem.IsDetailsSiteWidthAssigned then + Result := CacheItem.DetailsSiteWidth + else + begin + Result := inherited GetWidth; + CacheItem.DetailsSiteWidth := Result; + end; +end; + +procedure TcxGridDetailsSiteViewInfo.InitTabHitTest(AHitTest: TcxGridDetailsSiteTabHitTest); +begin + AHitTest.Owner := MasterDataRowViewInfo.GridRecord; +end; + +procedure TcxGridDetailsSiteViewInfo.ChangeActiveTab(ALevel: TcxGridLevel; + AFocusView: Boolean = False); +var + ARow: TcxGridMasterDataRow; +begin + ARow := MasterDataRowViewInfo.GridRecord; + ARow.ActiveDetailIndex := ALevel.Index; + if AFocusView and (ARow.ActiveDetailGridView <> nil) then + ARow.ActiveDetailGridView.Focused := True; +end; + +function TcxGridDetailsSiteViewInfo.DetailHasData(ALevel: TcxGridLevel): Boolean; +begin + Result := TcxGridMasterDataRow(MasterRecord).DetailGridViewHasData[ALevel.Index]; +end; + +function TcxGridDetailsSiteViewInfo.HasMaxHeight: Boolean; +begin + Result := (Level.MaxDetailHeight <> 0) and (Height = Level.MaxDetailHeight); +end; + +function TcxGridDetailsSiteViewInfo.SupportsTabAccelerators: Boolean; +begin + Result := MasterDataRowViewInfo.SupportsTabAccelerators; +end; + +{ TcxGridExpandButtonCellViewInfo } + +function TcxGridExpandButtonCellViewInfo.GetRecordViewInfo: TcxGridMasterDataRowViewInfo; +begin + Result := TcxGridMasterDataRowViewInfo(inherited RecordViewInfo); +end; + +function TcxGridExpandButtonCellViewInfo.GetRightBorderRestSpaceBounds: TRect; +begin + Result := inherited GetBorderBounds(bRight); + Result.Bottom := BorderBounds[bRight].Top; +end; + +function TcxGridExpandButtonCellViewInfo.CalculateHeight: Integer; +begin + Result := RecordViewInfo.DataHeight; + if RecordViewInfo.DetailsSiteVisible then + Inc(Result, RecordViewInfo.DetailsAreaViewInfo.CalculateHeight); +end; + +function TcxGridExpandButtonCellViewInfo.CalculateWidth: Integer; +begin + Result := GridViewInfo.ClientBounds.Left + RecordViewInfo.LevelIndent + + BaseWidth - RecordViewInfo.ContentIndent; +end; + +function TcxGridExpandButtonCellViewInfo.GetBackgroundBitmap: TBitmap; +begin + Result := RecordViewInfo.BackgroundBitmap; +end; + +function TcxGridExpandButtonCellViewInfo.GetBaseWidth: Integer; +begin + Result := GridViewInfo.LevelIndent; +end; + +function TcxGridExpandButtonCellViewInfo.GetBorderBounds(AIndex: TcxBorder): TRect; +begin + Result := inherited GetBorderBounds(AIndex); + if AIndex = bRight then + begin + Inc(Result.Top, RecordViewInfo.DataHeight); + if bBottom in Borders then + Dec(Result.Top, BorderWidth[bBottom]); + end; +end; + +function TcxGridExpandButtonCellViewInfo.GetBorders: TcxBorders; +begin + Result := GridViewInfo.GetCellBorders(False, True); + if RecordViewInfo.Expanded and (bBottom in Result) then + Include(Result, bRight) + else + Exclude(Result, bRight); +end; + +function TcxGridExpandButtonCellViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridExpandButtonCellPainter; +end; + +{ TcxGridDetailsAreaViewInfo } + +function TcxGridDetailsAreaViewInfo.GetRecordViewInfo: TcxGridMasterDataRowViewInfo; +begin + Result := TcxGridMasterDataRowViewInfo(inherited RecordViewInfo); +end; + +function TcxGridDetailsAreaViewInfo.CalculateHeight: Integer; +begin + Result := RecordViewInfo.DetailsSiteViewInfo.Height; +end; + +function TcxGridDetailsAreaViewInfo.CalculateWidth: Integer; +begin + Result := RecordViewInfo.DetailsSiteViewInfo.MaxWidth; +end; + +function TcxGridDetailsAreaViewInfo.GetBorders: TcxBorders; +begin + if GridLines in [glBoth, glHorizontal] then + Result := [bBottom] + else + Result := []; +end; + +{ TcxGridMasterDataRowViewInfo } + +constructor TcxGridMasterDataRowViewInfo.Create(ARecordsViewInfo: TcxCustomGridRecordsViewInfo; + ARecord: TcxCustomGridRecord); +begin + inherited; + if DetailsSiteVisible then + begin + FDetailsAreaViewInfo := GetDetailsAreaViewInfoClass.Create(Self); + FDetailsSiteViewInfo := GetDetailsSiteViewInfoClass.Create(Self); + end; + FExpandButtonCellViewInfo := GetExpandButtonCellViewInfoClass.Create(Self); +end; + +destructor TcxGridMasterDataRowViewInfo.Destroy; +begin + FExpandButtonCellViewInfo.Free; + FDetailsSiteViewInfo.Free; + FDetailsAreaViewInfo.Free; + inherited; +end; + +function TcxGridMasterDataRowViewInfo.GetCacheItem: TcxGridMasterTableViewInfoCacheItem; +begin + Result := TcxGridMasterTableViewInfoCacheItem(inherited CacheItem); +end; + +function TcxGridMasterDataRowViewInfo.GetDetailsSiteIndentBounds: TRect; +begin + with DetailsSiteViewInfo.Bounds do + Result := Rect(ContentIndent, Top, Left, Bottom); +end; + +function TcxGridMasterDataRowViewInfo.GetGridRecord: TcxGridMasterDataRow; +begin + Result := TcxGridMasterDataRow(inherited GridRecord); +end; + +procedure TcxGridMasterDataRowViewInfo.CalculateExpandButtonBounds(var ABounds: TRect); +begin + ABounds := ExpandButtonAreaBounds; + inherited; +end; + +function TcxGridMasterDataRowViewInfo.CalculateHeight: Integer; +begin + Result := inherited CalculateHeight; + if DetailsSiteVisible then + begin + FRestHeight := CalculateRestHeight(Result); + Inc(Result, DetailsSiteViewInfo.Height); + end; +end; + +function TcxGridMasterDataRowViewInfo.CalculateRestHeight(ARowHeight: Integer): Integer; +begin + Result := RecordsViewInfo.GetRestHeight(Bounds.Top) - ARowHeight; +end; + +procedure TcxGridMasterDataRowViewInfo.ControlFocusChanged; +begin + inherited; + if DetailsSiteVisible then + DetailsSiteViewInfo.ControlFocusChanged; +end; + +function TcxGridMasterDataRowViewInfo.GetDataHeight: Integer; +begin + Result := inherited GetDataHeight; + if DetailsSiteVisible then + Dec(Result, DetailsSiteViewInfo.Height); +end; + +function TcxGridMasterDataRowViewInfo.GetDataIndent: Integer; +begin + Result := inherited GetDataIndent + GridViewInfo.LevelIndent; +end; + +function TcxGridMasterDataRowViewInfo.GetDataWidth: Integer; +begin + Result := inherited GetDataWidth - GridViewInfo.LevelIndent; +end; + +function TcxGridMasterDataRowViewInfo.GetDetailsSiteVisible: Boolean; +begin + Result := Expanded; +end; + +function TcxGridMasterDataRowViewInfo.GetExpandButtonAreaBounds: TRect; +begin + Result := Rect(ContentIndent, Bounds.Top, DataIndent, Bounds.Top + DataHeight); +end; + +function TcxGridMasterDataRowViewInfo.GetFullyVisible: Boolean; +begin + Result := inherited GetFullyVisible and + (not DetailsSiteVisible or DetailsSiteViewInfo.HasMaxHeight or DetailsSiteViewInfo.FullyVisible); +end; + +function TcxGridMasterDataRowViewInfo.GetMaxHeight: Integer; +begin + Result := inherited GetMaxHeight; + if DetailsSiteVisible then + if not DetailsSiteViewInfo.FullyVisible and not GridViewInfo.CalculateDown and + (Index > 0) and not DetailsSiteViewInfo.HasMaxHeight then + Result := MaxInt div 2 + else + Result := Result - DetailsSiteViewInfo.Height + DetailsSiteViewInfo.NormalHeight; +end; + +function TcxGridMasterDataRowViewInfo.IsDetailVisible(ADetail: TcxCustomGridView): Boolean; +begin + Result := DetailsSiteVisible and (DetailsSiteViewInfo <> nil) and + (DetailsSiteViewInfo.ActiveLevel = ADetail.Level); +end; + +procedure TcxGridMasterDataRowViewInfo.VisibilityChanged(AVisible: Boolean); +begin + inherited; + if DetailsSiteVisible then + DetailsSiteViewInfo.VisibilityChanged(AVisible); +end; + +function TcxGridMasterDataRowViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridMasterDataRowPainter; +end; + +function TcxGridMasterDataRowViewInfo.GetDetailsAreaViewInfoClass: TcxGridDetailsAreaViewInfoClass; +begin + Result := TcxGridDetailsAreaViewInfo; +end; + +function TcxGridMasterDataRowViewInfo.GetDetailsSiteViewInfoClass: TcxGridDetailsSiteViewInfoClass; +begin + Result := TcxGridDetailsSiteViewInfo; +end; + +function TcxGridMasterDataRowViewInfo.GetExpandButtonCellViewInfoClass: TcxGridExpandButtonCellViewInfoClass; +begin + Result := TcxGridExpandButtonCellViewInfo; +end; + +procedure TcxGridMasterDataRowViewInfo.BeforeRecalculation; +begin + inherited; + if DetailsSiteVisible then + begin + FDetailsSiteViewInfo.BeforeRecalculation; + FDetailsAreaViewInfo.BeforeRecalculation; + end; + FExpandButtonCellViewInfo.BeforeRecalculation; +end; + +procedure TcxGridMasterDataRowViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +var + ADetailLeftBound, ADetailTopBound: Integer; + + function NeedCalculateDetail: Boolean; + begin + Result := DetailsSiteVisible and + (GridViewInfo.IsCalculating or + DetailsSiteViewInfo.ActiveGridViewExists and + (DetailsSiteViewInfo.ActiveGridView.Site.Left = cxGridInvisibleCoordinate)); + end; + +begin + inherited; + ExpandButtonCellViewInfo.Calculate(ContentIndent, ATopBound); + if NeedCalculateDetail then + begin + ADetailLeftBound := ExpandButtonCellViewInfo.Bounds.Right; + ADetailTopBound := ATopBound + DataHeight; + DetailsSiteViewInfo.Calculate(ADetailLeftBound, ADetailTopBound); + DetailsAreaViewInfo.Calculate(ADetailLeftBound, ADetailTopBound); + end; +end; + +function TcxGridMasterDataRowViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + if DetailsSiteVisible and PtInRect(DetailsSiteViewInfo.Bounds, P) then + Result := DetailsSiteViewInfo.GetHitTest(P) + else + Result := inherited GetHitTest(P); +end; + +function TcxGridMasterDataRowViewInfo.ProcessDialogChar(ACharCode: Word): Boolean; +begin + Result := inherited ProcessDialogChar(ACharCode); + if not Result and DetailsSiteVisible then + Result := DetailsSiteViewInfo.ProcessDialogChar(ACharCode); +end; + +function TcxGridMasterDataRowViewInfo.SupportsTabAccelerators: Boolean; +begin + Result := GridView.Controller.SupportsTabAccelerators(GridRecord); +end; + +{ TcxGridGroupCellViewInfo } + +function TcxGridGroupCellViewInfo.GetExpandedAreaBounds: TRect; +begin + Result := inherited GetBorderBounds(bBottom); + Result.Right := BorderBounds[bBottom].Left; +end; + +function TcxGridGroupCellViewInfo.GetGridRecord: TcxGridGroupRow; +begin + Result := TcxGridGroupRow(inherited GridRecord); +end; + +function TcxGridGroupCellViewInfo.GetRecordViewInfo: TcxGridGroupRowViewInfo; +begin + Result := TcxGridGroupRowViewInfo(inherited RecordViewInfo); +end; + +function TcxGridGroupCellViewInfo.GetRowStyle: TcxGridGroupRowStyle; +begin + Result := RecordViewInfo.RowStyle; +end; + +function TcxGridGroupCellViewInfo.CalculateHeight: Integer; +begin + Result := RecordViewInfo.DataHeight; +end; + +function TcxGridGroupCellViewInfo.CalculateWidth: Integer; +begin + with RecordViewInfo, Bounds do + Result := Right - Left - LevelIndent; +end; + +function TcxGridGroupCellViewInfo.CustomDraw(ACanvas: TcxCanvas): Boolean; +begin + Result := inherited CustomDraw(ACanvas); + if not Result then + TcxGridTableViewAccess.DoCustomDrawGroupCell(GridView, ACanvas, Self, Result); +end; + +function TcxGridGroupCellViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + if RowStyle = grsStandard then + Result := vaCenter + else + Result := vaBottom; +end; + +function TcxGridGroupCellViewInfo.GetAlwaysSelected: Boolean; +begin + Result := True; +end; + +function TcxGridGroupCellViewInfo.GetBackgroundBitmap: TBitmap; +begin + Result := RecordViewInfo.BackgroundBitmap; +end; + +function TcxGridGroupCellViewInfo.GetBorderBounds(AIndex: TcxBorder): TRect; +begin + Result := inherited GetBorderBounds(AIndex); + if (AIndex = bBottom) and (RowStyle = grsStandard) and GridRecord.Expanded then + Result.Left := RecordViewInfo.LevelIndentVertLineBounds[GridRecord.Level].Left; +end; + +function TcxGridGroupCellViewInfo.GetBorderColor(AIndex: TcxBorder): TColor; +begin + if (AIndex = bBottom) and (RowStyle = grsOffice11) then + Result := dxOffice11GroupRowSeparatorColor + else + Result := GridViewInfo.GridLineColor; +end; + +function TcxGridGroupCellViewInfo.GetBorders: TcxBorders; +begin + Result := GridViewInfo.GetCellBorders(True, True); + if RowStyle = grsOffice11 then + Include(Result, bBottom); +end; + +function TcxGridGroupCellViewInfo.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + if (AIndex = bBottom) and (RowStyle = grsOffice11) then + Result := RecordViewInfo.RecordsViewInfo.GroupRowSeparatorWidth + else + Result := GridViewInfo.GridLineWidth; +end; + +function TcxGridGroupCellViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridGroupCellPainter; +end; + +function TcxGridGroupCellViewInfo.GetText: string; +begin + Result := GridRecord.DisplayCaption; + TcxCustomGridTableItemAccess.DoGetDisplayText(GridRecord.GroupedColumn, GridRecord, Result); +end; + +function TcxGridGroupCellViewInfo.GetTextAreaBounds: TRect; +begin + Result := inherited GetTextAreaBounds; + if GridRecord.Expandable then + Inc(Result.Left, GridViewInfo.LevelIndent); +end; + +procedure TcxGridGroupCellViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetDataCellParams(GridRecord, nil, AParams, True, Self); +end; + +function TcxGridGroupCellViewInfo.HasCustomDraw: Boolean; +begin + Result := TcxGridTableViewAccess.HasCustomDrawGroupCell(GridView); +end; + +function TcxGridGroupCellViewInfo.CanDrawSelected: Boolean; +begin + Result := True; +end; + +{ TcxGridGroupRowSpacerViewInfo } + +constructor TcxGridGroupRowSpacerViewInfo.Create(ARowViewInfo: TcxGridGroupRowViewInfo; + const AText: string); +begin + inherited Create(ARowViewInfo.GridViewInfo); + FRowViewInfo := ARowViewInfo; + Text := AText; +end; + +function TcxGridGroupRowSpacerViewInfo.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxGridGroupRowSpacerViewInfo.CalculateWidth: Integer; +begin + Result := TextWidth; +end; + +function TcxGridGroupRowSpacerViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + Result := FRowViewInfo.CellViewInfo.AlignmentVert; +end; + +function TcxGridGroupRowSpacerViewInfo.GetText: string; +begin + Result := Text; +end; + +function TcxGridGroupRowSpacerViewInfo.GetTextAreaBounds: TRect; +begin + Result := ContentBounds; + InflateRect(Result, 0, -cxGridCellTextOffset); +end; + +procedure TcxGridGroupRowSpacerViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetGroupSummaryCellParams(RowViewInfo.GridRecord, nil, AParams); +end; + +function TcxGridGroupRowSpacerViewInfo.GetWidth: Integer; +begin + CalculateParams; + Result := inherited GetWidth; +end; + +function TcxGridGroupRowSpacerViewInfo.HasBackground: Boolean; +begin + Result := False; +end; + +{ TcxGridGroupSummaryCellViewInfo } + +constructor TcxGridGroupSummaryCellViewInfo.Create(ARowViewInfo: TcxGridGroupRowViewInfo; + ASummaryItem: TcxDataSummaryItem; const AValue: Variant); +begin + inherited Create(ARowViewInfo.GridViewInfo); + FRowViewInfo := ARowViewInfo; + FSummaryItem := ASummaryItem; + FValue := AValue; + FSeparatorViewInfo := FRowViewInfo.CreateSpacerViewInfo(GetSeparatorText); + FTextWidth := -1; +end; + +destructor TcxGridGroupSummaryCellViewInfo.Destroy; +begin + FSeparatorViewInfo.Free; + inherited; +end; + +function TcxGridGroupSummaryCellViewInfo.GetColumn: TcxGridColumn; +begin + Result := FSummaryItem.ItemLink as TcxGridColumn; +end; + +function TcxGridGroupSummaryCellViewInfo.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +procedure TcxGridGroupSummaryCellViewInfo.SetIsLast(Value: Boolean); +begin + if FIsLast <> Value then + begin + FIsLast := Value; + FSeparatorViewInfo.Text := GetSeparatorText; + end; +end; + +function TcxGridGroupSummaryCellViewInfo.CalculateWidth: Integer; +begin + Result := TextWidth + FSeparatorViewInfo.Width; +end; + +function TcxGridGroupSummaryCellViewInfo.CanAlignWithColumn: Boolean; +begin + Result := Column <> nil; +end; + +function TcxGridGroupSummaryCellViewInfo.CustomDraw(ACanvas: TcxCanvas): Boolean; +begin + Result := inherited CustomDraw(ACanvas); + if not Result then + begin + if Column <> nil then + TcxGridColumnAccess.DoCustomDrawGroupSummaryCell(Column, ACanvas, Self, Result); + if not Result then + TcxGridTableViewAccess.DoCustomDrawGroupSummaryCell(GridView, ACanvas, Self, Result); + end; +end; + +function TcxGridGroupSummaryCellViewInfo.GetAlignmentHorz: TAlignment; +begin + if CanAlignWithColumn and FRowViewInfo.SummaryCellAutoWidth then + Result := Column.GroupSummaryAlignment + else + Result := taLeftJustify; +end; + +function TcxGridGroupSummaryCellViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + Result := FRowViewInfo.CellViewInfo.AlignmentVert; +end; + +function TcxGridGroupSummaryCellViewInfo.GetDesignSelectionBounds: TRect; +begin + Result := Bounds; + InflateRect(Result, 0, -1); +end; + +function TcxGridGroupSummaryCellViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridGroupSummaryHitTest; +end; + +function TcxGridGroupSummaryCellViewInfo.GetIsDesignSelected: Boolean; +begin + Result := GridView.IsDesigning and + GridView.Controller.DesignController.IsObjectSelected(SummaryItem); +end; + +function TcxGridGroupSummaryCellViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridGroupSummaryCellPainter; +end; + +function TcxGridGroupSummaryCellViewInfo.GetSeparatorBounds: TRect; +begin + Result := Bounds; + Result.Left := Min(GetTextBounds(True, False).Right, TextAreaBounds.Right); +end; + +function TcxGridGroupSummaryCellViewInfo.GetSeparatorText: string; +begin + if IsLast then + Result := '' + else + Result := (FSummaryItem.SummaryItems as TcxDataGroupSummaryItems).Separator + ' '; +end; + +function TcxGridGroupSummaryCellViewInfo.GetShowEndEllipsis: Boolean; +begin + Result := True; +end; + +function TcxGridGroupSummaryCellViewInfo.GetText: string; +begin + try + Result := FSummaryItem.FormatValue(FValue, False); + except + Application.HandleException(Self); + end; +end; + +function TcxGridGroupSummaryCellViewInfo.GetTextAreaBounds: TRect; +begin + Result := ContentBounds; + InflateRect(Result, 0, -cxGridCellTextOffset); + Dec(Result.Right, FSeparatorViewInfo.Width); + if Result.Right < Result.Left then + Result.Right := Result.Left; +end; + +procedure TcxGridGroupSummaryCellViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetGroupSummaryCellParams(RowViewInfo.GridRecord, SummaryItem, AParams); +end; + +function TcxGridGroupSummaryCellViewInfo.HasBackground: Boolean; +begin + Result := False; +end; + +function TcxGridGroupSummaryCellViewInfo.HasCustomDraw: Boolean; +begin + Result := inherited HasCustomDraw or + (Column <> nil) and TcxGridColumnAccess.HasCustomDrawGroupSummaryCell(Column) or + TcxGridTableViewAccess.HasCustomDrawGroupSummaryCell(GridView); +end; + +procedure TcxGridGroupSummaryCellViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + inherited; + with TcxGridGroupSummaryHitTest(AHitTest) do + begin + if not GridView.IsDesigning then + ViewInfo := Self.RowViewInfo; + GridRecord := Self.RowViewInfo.GridRecord; + SummaryItem := Self.SummaryItem; + end; +end; + +procedure TcxGridGroupSummaryCellViewInfo.Offset(DX, DY: Integer); +begin + inherited; + FSeparatorViewInfo.DoOffset(DX, DY); +end; + +procedure TcxGridGroupSummaryCellViewInfo.BeforeRecalculation; +begin + inherited; + FSeparatorViewInfo.BeforeRecalculation; +end; + +procedure TcxGridGroupSummaryCellViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + inherited; + FSeparatorViewInfo.Calculate(GetSeparatorBounds); +end; + +function TcxGridGroupSummaryCellViewInfo.MouseDown(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +begin + Result := inherited MouseDown(AHitTest, AButton, AShift); + if GridView.IsDesigning and (AButton = mbLeft) then + begin + GridView.Controller.DesignController.SelectObject(SummaryItem, not (ssShift in AShift)); + Result := True; + end; +end; + +{ TcxGridGroupRowViewInfo } + +constructor TcxGridGroupRowViewInfo.Create(ARecordsViewInfo: TcxCustomGridRecordsViewInfo; + ARecord: TcxCustomGridRecord); +begin + inherited; + FCellViewInfo := TcxGridGroupCellViewInfo.Create(Self); + FSummaryCellViewInfos := TList.Create; + FSummaryCellsWithoutColumns := TList.Create; + CreateSummaryCellViewInfos; + GetColumnSummaryCellViewInfos(nil, FSummaryCellsWithoutColumns); + CreateSpacerViewInfos; +end; + +destructor TcxGridGroupRowViewInfo.Destroy; +begin + DestroySpacerViewInfos; + DestroySummaryCellViewInfos; + FSummaryCellsWithoutColumns.Free; + FSummaryCellViewInfos.Free; + FCellViewInfo.Free; + inherited; +end; + +function TcxGridGroupRowViewInfo.GetGridRecord: TcxGridGroupRow; +begin + Result := TcxGridGroupRow(inherited GridRecord); +end; + +function TcxGridGroupRowViewInfo.GetRowStyle: TcxGridGroupRowStyle; +begin + Result := GridView.OptionsView.GroupRowStyle; +end; + +function TcxGridGroupRowViewInfo.GetSummaryCellLayout: TcxGridGroupSummaryLayout; +begin + Result := GridView.OptionsView.GetGroupSummaryLayout; +end; + +function TcxGridGroupRowViewInfo.GetSummaryCellViewInfo(Index: Integer): TcxGridGroupSummaryCellViewInfo; +begin + Result := TcxGridGroupSummaryCellViewInfo(FSummaryCellViewInfos[Index]); +end; + +function TcxGridGroupRowViewInfo.GetSummaryCellViewInfoCount: Integer; +begin + Result := FSummaryCellViewInfos.Count; +end; + +procedure TcxGridGroupRowViewInfo.CalculateExpandButtonBounds(var ABounds: TRect); +begin + ABounds := FCellViewInfo.ContentBounds; + if RowStyle = grsOffice11 then + with ABounds do + Top := Bottom - FCellViewInfo.TextHeightWithOffset; + inherited; +end; + +function TcxGridGroupRowViewInfo.CalculateHeight: Integer; +begin + if AutoHeight then + begin + CellViewInfo.CalculateParams; + Result := RecordsViewInfo.CalculateCustomGroupRowHeight(False, CellViewInfo.Params); + end + else + Result := RecordsViewInfo.GroupRowHeight; + Inc(Result, inherited CalculateHeight); +end; + +function TcxGridGroupRowViewInfo.CanSize: Boolean; +begin + Result := GridView.OptionsCustomize.GroupRowSizing; +end; + +procedure TcxGridGroupRowViewInfo.CheckRowHeight(var AValue: Integer); +begin + Dec(AValue, NonBaseHeight); + inherited; + GridView.OptionsView.CheckGroupRowHeight(AValue); + Inc(AValue, NonBaseHeight); +end; + +function TcxGridGroupRowViewInfo.GetAutoHeight: Boolean; +begin + Result := inherited GetAutoHeight and (GridView.OptionsView.GroupRowHeight = 0); +end; + +function TcxGridGroupRowViewInfo.GetBackgroundBitmap: TBitmap; +begin + Result := RecordsViewInfo.GroupBackgroundBitmap; +end; + +function TcxGridGroupRowViewInfo.GetExpandButtonAreaBounds: TRect; +begin + Result := FCellViewInfo.ContentBounds; + Result.Right := Result.Left + GridViewInfo.LevelIndent; +end; + +function TcxGridGroupRowViewInfo.GetFocusRectBounds: TRect; +begin + Result := inherited GetFocusRectBounds; + Result.Bottom := FCellViewInfo.ContentBounds.Bottom; +end; + +function TcxGridGroupRowViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridGroupRowPainter; +end; + +function TcxGridGroupRowViewInfo.GetSeparatorBounds: TRect; +begin + Result := inherited GetSeparatorBounds; + if Expanded then Inc(Result.Left, GridViewInfo.LevelIndent); +end; + +function TcxGridGroupRowViewInfo.GetSeparatorIndentBounds: TRect; +begin + Result := inherited GetSeparatorBounds; + Result.Right := SeparatorBounds.Left; +end; + +function TcxGridGroupRowViewInfo.GetShowSeparator: Boolean; +begin + if RowStyle = grsStandard then + Result := inherited GetShowSeparator + else + Result := False; +end; + +function TcxGridGroupRowViewInfo.HasFocusRect: Boolean; +begin + Result := True; +end; + +function TcxGridGroupRowViewInfo.HasFooter(ALevel: Integer): Boolean; +begin + Result := inherited HasFooter(ALevel) or + (GridView.OptionsView.GroupFooters = gfAlwaysVisible) and + (ALevel = 0) and not GridRecord.Expanded and + TcxGridColumnAccess.CanShowGroupFooters(GridRecord.GroupedColumn); +end; + +procedure TcxGridGroupRowViewInfo.Offset(DX, DY: Integer); +var + I: Integer; +begin + inherited; + FCellViewInfo.DoOffset(DX, DY); + if FSummaryBeginningSpacerViewInfo <> nil then + FSummaryBeginningSpacerViewInfo.DoOffset(DX, DY); + for I := 0 to SummaryCellViewInfoCount - 1 do + SummaryCellViewInfos[I].DoOffset(DX, DY); + if FSummaryEndingSpacerViewInfo <> nil then + FSummaryEndingSpacerViewInfo.DoOffset(DX, DY); +end; + +procedure TcxGridGroupRowViewInfo.SetRowHeight(Value: Integer); +begin + if RowHeight <> Value then + GridView.OptionsView.GroupRowHeight := Value - NonBaseHeight; +end; + +function TcxGridGroupRowViewInfo.CreateSpacerViewInfo(const AText: string): TcxGridGroupRowSpacerViewInfo; +begin + Result := GetSpacerViewInfoClass.Create(Self, AText); +end; + +procedure TcxGridGroupRowViewInfo.CreateSpacerViewInfos; +begin + if HasUnalignableSummaryCells then + begin + FSummaryBeginningSpacerViewInfo := CreateSpacerViewInfo(GetSummaryBeginningSpacerText); + FSummaryEndingSpacerViewInfo := CreateSpacerViewInfo(GetSummaryEndingSpacerText); + end; +end; + +procedure TcxGridGroupRowViewInfo.DestroySpacerViewInfos; +begin + FSummaryEndingSpacerViewInfo.Free; + FSummaryBeginningSpacerViewInfo.Free; +end; + +function TcxGridGroupRowViewInfo.GetSpacerViewInfoClass: TcxGridGroupRowSpacerViewInfoClass; +begin + Result := TcxGridGroupRowSpacerViewInfo; +end; + +function TcxGridGroupRowViewInfo.AddSummaryCellViewInfo(ASummaryItem: TcxDataSummaryItem; + const AValue: Variant): TcxGridGroupSummaryCellViewInfo; +begin + Result := GetSummaryCellViewInfoClass.Create(Self, ASummaryItem, AValue); + FSummaryCellViewInfos.Add(Result); +end; + +procedure TcxGridGroupRowViewInfo.CreateSummaryCellViewInfos; +var + ASummaryItems: TcxDataSummaryItems; + ASummaryValues: PVariant; + I: Integer; +begin + if not GridRecord.GetGroupSummaryInfo(ASummaryItems, ASummaryValues) then Exit; + for I := 0 to ASummaryItems.Count - 1 do + if ASummaryItems[I].Position = spGroup then + AddSummaryCellViewInfo(ASummaryItems[I], ASummaryValues^[I]); +end; + +procedure TcxGridGroupRowViewInfo.DestroySummaryCellViewInfos; +var + I: Integer; +begin + for I := 0 to SummaryCellViewInfoCount - 1 do + SummaryCellViewInfos[I].Free; +end; + +function TcxGridGroupRowViewInfo.GetSummaryCellViewInfoClass: TcxGridGroupSummaryCellViewInfoClass; +begin + Result := TcxGridGroupSummaryCellViewInfo; +end; + +procedure TcxGridGroupRowViewInfo.CalculateSummaryCells; +var + I: Integer; + AColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo; + ACellViewInfos: TList; +begin + if SummaryCellViewInfoCount = 0 then Exit; + + if HasUnalignableSummaryCells then + begin + SummaryBeginningSpacerViewInfo.Calculate(GetSummaryBeginningSpacerBounds); + TcxGridGroupSummaryCellViewInfo(UnalignableSummaryCells.Last).IsLast := True; + CalculateSummaryCells(UnalignableSummaryCells, GetSummaryCellsAreaBounds(False), + taLeftJustify, False); + SummaryEndingSpacerViewInfo.Calculate(GetSummaryEndingSpacerBounds); + end; + + if SummaryCellLayout <> gslStandard then + begin + ACellViewInfos := TList.Create; + try + for I := 0 to GridViewInfo.HeaderViewInfo.Count - 1 do + begin + AColumnHeaderViewInfo := GridViewInfo.HeaderViewInfo[I]; + GetColumnSummaryCellViewInfos(AColumnHeaderViewInfo.Column, ACellViewInfos); + if ACellViewInfos.Count <> 0 then + begin + TcxGridGroupSummaryCellViewInfo(ACellViewInfos.Last).IsLast := True; + CalculateSummaryCells(ACellViewInfos, + GetColumnSummaryCellsAreaBounds(AColumnHeaderViewInfo), + AColumnHeaderViewInfo.Column.GroupSummaryAlignment, SummaryCellAutoWidth); + end; + end; + finally + ACellViewInfos.Free; + end; + end; +end; + +procedure TcxGridGroupRowViewInfo.CalculateSummaryCells(ACellViewInfos: TList; + const AAreaBounds: TRect; AAlignment: TAlignment; AAutoWidth: Boolean); +var + AWidths: TcxAutoWidthObject; + ABounds: TRect; + I: Integer; +begin + AWidths := CalculateSummaryCellWidths(ACellViewInfos, AAreaBounds.Right - AAreaBounds.Left, + AAutoWidth); + try + ABounds := GetSummaryCellsBounds(AAreaBounds, AWidths, AAlignment, AAutoWidth); + for I := 0 to ACellViewInfos.Count - 1 do + begin + ABounds.Right := Min(ABounds.Left + AWidths[I].AutoWidth, AAreaBounds.Right); + TcxGridGroupSummaryCellViewInfo(ACellViewInfos[I]).Calculate(ABounds); + ABounds.Left := ABounds.Right; + end; + finally + AWidths.Free; + end; +end; + +function TcxGridGroupRowViewInfo.CalculateSummaryCellWidths(ACellViewInfos: TList; + AAvailableWidth: Integer; AAutoWidth: Boolean): TcxAutoWidthObject; +var + I: Integer; +begin + Result := TcxAutoWidthObject.Create(ACellViewInfos.Count); + Result.AvailableWidth := AAvailableWidth; + for I := 0 to ACellViewInfos.Count - 1 do + with Result.AddItem do + begin + Width := TcxGridGroupSummaryCellViewInfo(ACellViewInfos[I]).CalculateWidth; + MinWidth := Width; + Fixed := False; + if not AAutoWidth then AutoWidth := Width; + end; + if AAutoWidth then Result.Calculate; +end; + +function TcxGridGroupRowViewInfo.GetColumnSummaryCellsAreaBounds(AColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo): TRect; +begin + Result := GetSummaryCellsAreaBounds(True); + Result.Left := Max(Result.Left, AColumnHeaderViewInfo.DataOffset + cxGridCellTextOffset); + Result.Right := Min(Result.Right, AColumnHeaderViewInfo.Bounds.Right - cxGridCellTextOffset); +end; + +procedure TcxGridGroupRowViewInfo.GetColumnSummaryCellViewInfos(AColumn: TcxGridColumn; AList: TList); +var + I: Integer; +begin + AList.Clear; + for I := 0 to SummaryCellViewInfoCount - 1 do + if SummaryCellViewInfos[I].Column = AColumn then + AList.Add(SummaryCellViewInfos[I]); +end; + +function TcxGridGroupRowViewInfo.GetSummaryBeginningSpacerBounds: TRect; +begin + Result := GetSummaryCellsAreaBounds(False); + Result.Right := Result.Left; + Dec(Result.Left, SummaryBeginningSpacerViewInfo.Width); + Result.Right := Min(Result.Right, CellViewInfo.TextAreaBounds.Right); +end; + +function TcxGridGroupRowViewInfo.GetSummaryEndingSpacerBounds: TRect; +begin + Result := GetSummaryCellsAreaBounds(False); + Result.Left := TcxGridGroupSummaryCellViewInfo(UnalignableSummaryCells.Last).Bounds.Right; + Result.Right := Result.Left + SummaryEndingSpacerViewInfo.Width; + Result.Right := Min(Result.Right, CellViewInfo.TextAreaBounds.Right); +end; + +function TcxGridGroupRowViewInfo.GetSummaryBeginningSpacerText: string; +begin + Result := ' ' + GridRecord.GroupSummaryItems.BeginText; +end; + +function TcxGridGroupRowViewInfo.GetSummaryEndingSpacerText: string; +begin + Result := GridRecord.GroupSummaryItems.EndText; +end; + +function TcxGridGroupRowViewInfo.GetSummaryCellAutoWidth: Boolean; +begin + Result := SummaryCellLayout = gslAlignWithColumnsAndDistribute; +end; + +function TcxGridGroupRowViewInfo.GetSummaryCellsAreaBounds(AForAlignableCells: Boolean): TRect; +begin + Result := CellViewInfo.ContentBounds; + Result.Right := CellViewInfo.TextAreaBounds.Right; + Result.Left := Min(CellViewInfo.GetTextBounds(True, False).Right, Result.Right); + if AForAlignableCells then + begin + if HasUnalignableSummaryCells then + Result.Left := SummaryEndingSpacerViewInfo.Bounds.Right; + Inc(Result.Left, 2 * cxGridCellTextOffset); + end + else + begin + Inc(Result.Left, SummaryBeginningSpacerViewInfo.Width); + Dec(Result.Right, SummaryEndingSpacerViewInfo.Width); + if Result.Right < Result.Left then + Result.Right := Result.Left; + end; +end; + +function TcxGridGroupRowViewInfo.GetSummaryCellsBounds(const AAreaBounds: TRect; + AWidths: TcxAutoWidthObject; AAlignment: TAlignment; AAutoWidth: Boolean): TRect; +begin + Result := AAreaBounds; + if not AAutoWidth and (AWidths.Width < AWidths.AvailableWidth) then + case AAlignment of + taRightJustify: + Result.Left := Result.Right - AWidths.Width; + taCenter: + Result.Left := (Result.Left + Result.Right - AWidths.Width) div 2; + end; +end; + +function TcxGridGroupRowViewInfo.GetUnalignableSummaryCells: TList; +begin + if SummaryCellLayout = gslStandard then + Result := SummaryCells + else + Result := SummaryCellsWithoutColumns; +end; + +function TcxGridGroupRowViewInfo.HasUnalignableSummaryCells: Boolean; +begin + Result := (SummaryCellLayout = gslStandard) or (SummaryCellsWithoutColumns.Count <> 0); +end; + +procedure TcxGridGroupRowViewInfo.BeforeRecalculation; +var + I: Integer; +begin + inherited; + FCellViewInfo.BeforeRecalculation; + if FSummaryBeginningSpacerViewInfo <> nil then + FSummaryBeginningSpacerViewInfo.BeforeRecalculation; + for I := 0 to SummaryCellViewInfoCount - 1 do + SummaryCellViewInfos[I].BeforeRecalculation; + if FSummaryEndingSpacerViewInfo <> nil then + FSummaryEndingSpacerViewInfo.BeforeRecalculation; +end; + +procedure TcxGridGroupRowViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + inherited; + FCellViewInfo.Calculate(ALeftBound + LevelIndent, ATopBound); + CalculateSummaryCells; +end; + +function TcxGridGroupRowViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +var + I: Integer; + AHitTest: TcxCustomGridHitTest; +begin + Result := inherited GetHitTest(P); + if Result <> nil then + for I := 0 to SummaryCellViewInfoCount - 1 do + begin + AHitTest := SummaryCellViewInfos[I].GetHitTest(P); + if AHitTest <> nil then + begin + Result := AHitTest; + Break; + end; + end; +end; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridStdPopupMenu.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridStdPopupMenu.pas new file mode 100644 index 00000000..36ecbe46 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridStdPopupMenu.pas @@ -0,0 +1,385 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid Utils } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridStdPopupMenu; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, Graphics, ImgList, Menus, cxGridMenuOperations, cxGridCustomPopupMenu, + cxGridCustomView; + +type + TcxGridPopupMenuItem = class(TMenuItem) + private + FOperation: TcxGridPopupMenuOperation; + public + constructor Create(AOwner: TComponent; AOperation: TcxGridPopupMenuOperation); reintroduce; virtual; + property Operation: TcxGridPopupMenuOperation read FOperation; + end; + + TcxGridStdPopupMenu = class(TPopupMenu, IDoPopup, IcxGridPopupMenu) + private + FOperations: TcxGridPopupMenuOperations; + protected + // IDoPopup + function GetPopupHandler: TcxGridOnPopupProc; + // IcxGridPopupMenu + function CanPopup(AHitTest: TcxCustomGridHitTest): Boolean; + + {$IFDEF DELPHI7} + procedure AdvancedDrawItem(Sender: TObject; ACanvas: TCanvas; + ARect: TRect; State: TOwnerDrawState); virtual; + {$ENDIF} + procedure CreateMenuItems; virtual; + procedure DoPopup(Sender: TObject); override; + procedure GridMenuPopup(ASenderMenu: TComponent; AHitTest: TcxCustomGridHitTest; + X,Y: Integer); virtual; + function HasDynamicContent: Boolean; virtual; + procedure InitItems(AItems: TMenuItem); + + function GetOperationsClass: TcxGridPopupMenuOperationsClass; virtual; abstract; + property Operations: TcxGridPopupMenuOperations read FOperations; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + end; + + TcxGridStdHeaderMenu = class(TcxGridStdPopupMenu) + protected + function GetOperationsClass: TcxGridPopupMenuOperationsClass; override; + end; + + TcxGridStdFooterMenu = class(TcxGridStdPopupMenu) + protected + function GetOperationsClass: TcxGridPopupMenuOperationsClass; override; + end; + + TcxGridStdGroupRowMenu = class(TcxGridStdPopupMenu) + protected + function GetOperationsClass: TcxGridPopupMenuOperationsClass; override; + procedure GridMenuPopup(ASenderMenu: TComponent; AHitTest: TcxCustomGridHitTest; + X,Y: Integer); override; + function HasDynamicContent: Boolean; override; + end; + +function cxGetGridPopupMenuOperation(AMenuItem: TComponent): TcxGridPopupMenuOperation; + +implementation + +uses + Types, +{$IFDEF DELPHI7} + Themes, +{$ENDIF} + SysUtils, cxGraphics, cxGeometry, cxLookAndFeelPainters, cxGridCustomTableView, cxGridTableView, + cxGridHeaderPopupMenuItems, cxGridFooterPopupMenuItems, cxGridGroupRowPopupMenuItems; + +function cxGetGridPopupMenuOperation(AMenuItem: TComponent): TcxGridPopupMenuOperation; +begin + if AMenuItem is TcxGridPopupMenuItem then + Result := TcxGridPopupMenuItem(AMenuItem).Operation + else + Result := nil; +end; + +{ TcxGridPopupMenuItem } + +constructor TcxGridPopupMenuItem.Create(AOwner: TComponent; AOperation: TcxGridPopupMenuOperation); +begin + inherited Create(AOwner); + FOperation := AOperation; +end; + +{ TcxGridStdPopupMenu } + +constructor TcxGridStdPopupMenu.Create(AOwner: TComponent); +begin + inherited; + FOperations := GetOperationsClass.Create; + if not HasDynamicContent then + CreateMenuItems; +end; + +destructor TcxGridStdPopupMenu.Destroy; +begin + FOperations.Free; + inherited; +end; + +function TcxGridStdPopupMenu.GetPopupHandler: TcxGridOnPopupProc; +begin + Result := GridMenuPopup; +end; + +function TcxGridStdPopupMenu.CanPopup(AHitTest: TcxCustomGridHitTest): Boolean; +begin + Result := Operations.CanProcess(AHitTest); +end; + +{$IFDEF DELPHI7} + +procedure TcxGridStdPopupMenu.AdvancedDrawItem(Sender: TObject; + ACanvas: TCanvas; ARect: TRect; State: TOwnerDrawState); +var + AMenuItem: TcxGridPopupMenuItem; + AImages: TCustomImageList; + ASelected, AHasImage: Boolean; + AImageAreaRect, AImageRect, ACheckRect: TRect; + AcxCanvas: TcxCanvas; +begin + AMenuItem := TcxGridPopupMenuItem(Sender); + AImages := AMenuItem.GetParentMenu.Images; + ASelected := odSelected in State; + AHasImage := (0 <= AMenuItem.ImageIndex) and (AMenuItem.ImageIndex < AImages.Count); + + // draw background + if ASelected then + begin + if ThemeServices.ThemesEnabled then + ACanvas.Brush.Color := clMenuHighlight + else + ACanvas.Brush.Color := clHighlight; + ACanvas.Font.Color := clHighlightText; + end; + ACanvas.FillRect(ARect); + + // draw image + AImageAreaRect := ARect; + AImageAreaRect.Right := AImageAreaRect.Left + cxRectHeight(AImageAreaRect); + AImageRect := Bounds(AImageAreaRect.Left + 1, AImageAreaRect.Top + 1, + AImages.Width, AImages.Height); + if AMenuItem.Checked then + begin + ACanvas.Brush.Color := clBtnShadow; + ACanvas.FrameRect(AImageAreaRect); + InflateRect(AImageAreaRect, -1, -1); + ACanvas.Brush.Color := clBtnFace; + ACanvas.FillRect(AImageAreaRect); + InflateRect(AImageAreaRect, 1, 1); + if not AHasImage then + begin + ACheckRect := cxRectCenter(AImageAreaRect, TcxCustomLookAndFeelPainter.CheckButtonSize); + InflateRect(ACheckRect, -TcxCustomLookAndFeelPainter.CheckBorderSize, + -TcxCustomLookAndFeelPainter.CheckBorderSize); + AcxCanvas := TcxCanvas.Create(ACanvas); + try + AcxCanvas.Brush.Style := bsClear; + TcxCustomLookAndFeelPainter.DrawCheck(AcxCanvas, ACheckRect, cxbsNormal, + True, clBtnText); + AcxCanvas.Brush.Style := bsSolid; + finally + AcxCanvas.Free; + end; + end; + end; + if AHasImage then + AImages.Draw(ACanvas, AImageRect.Left, AImageRect.Top, AMenuItem.ImageIndex, + AMenuItem.Enabled); + + // draw text + ARect.Left := AImageAreaRect.Right + 3; + Dec(ARect.Right); + AMenuItem.DoDrawText(ACanvas, AMenuItem.Caption, ARect, ASelected, + DT_SINGLELINE or DT_EXPANDTABS or DT_LEFT or DT_VCENTER); + if AMenuItem.ShortCut <> 0 then + begin + Dec(ARect.Right, 10); + AMenuItem.DoDrawText(ACanvas, ShortCutToText(AMenuItem.ShortCut), ARect, + ASelected, DT_SINGLELINE or DT_RIGHT or DT_VCENTER); + end; +end; + +{$ENDIF} + +procedure TcxGridStdPopupMenu.CreateMenuItems; + + procedure InsertNewGroup(AItems: TMenuItem); + var + AItem: TcxGridPopupMenuItem; + begin + AItem := TcxGridPopupMenuItem.Create(Self, nil); + AItem.Caption := '-'; + AItems.Add(AItem); + end; + + function GetMenuItemByOperationClass(const AItems: TMenuItem; + AClass: TcxGridPopupMenuOperationClass): TMenuItem; + var + I: Integer; + AOperation: TcxGridPopupMenuOperation; + begin + for I := 0 to AItems.Count - 1 do + begin + Result := AItems[I]; + AOperation := cxGetGridPopupMenuOperation(Result); + if (AOperation <> nil) and (AOperation.ClassType = AClass) then + Exit + else + begin + Result := GetMenuItemByOperationClass(Result, AClass); + if Result <> nil then Exit; + end; + end; + Result := nil; + end; + +var + I: Integer; + AOperation: TcxGridPopupMenuOperation; + AMenuItem, AParentMenuItem: TMenuItem; +begin + for I := 0 to Operations.Count - 1 do + begin + AOperation := Operations[I]; + AMenuItem := TcxGridPopupMenuItem.Create(Self, AOperation); + + if AOperation.GetParentOperationClass = nil then + AParentMenuItem := nil + else + AParentMenuItem := GetMenuItemByOperationClass(Items, AOperation.GetParentOperationClass); + if AParentMenuItem = nil then + AParentMenuItem := Items; + + if AOperation.BeginGroup then + InsertNewGroup(AParentMenuItem); + AParentMenuItem.Add(AMenuItem); + end; +end; + +procedure TcxGridStdPopupMenu.DoPopup(Sender: TObject); +begin + if HasDynamicContent then + begin + Items.Clear; + CreateMenuItems; + end; + Images := cxGridPopupMenuImages; + InitItems(Items); + inherited DoPopup(Sender); +end; + +procedure TcxGridStdPopupMenu.GridMenuPopup(ASenderMenu: TComponent; + AHitTest: TcxCustomGridHitTest; X, Y: Integer); +begin + Popup(X, Y); +end; + +function TcxGridStdPopupMenu.HasDynamicContent: Boolean; +begin + Result := False; +end; + +procedure TcxGridStdPopupMenu.InitItems(AItems: TMenuItem); +var +{$IFDEF DELPHI7} + ACustomDrawNeeded: Boolean; +{$ENDIF} + I: Integer; + AOperation: TcxGridPopupMenuOperation; +begin +{$IFDEF DELPHI7} + ACustomDrawNeeded := (Win32MajorVersion >= 5) and (Win32MinorVersion >= 1) and + (Images <> nil) and not IsRightToLeft; +{$ENDIF} + for I := 0 to AItems.Count - 1 do + begin + AOperation := cxGetGridPopupMenuOperation(AItems[I]); + if AOperation <> nil then + begin + AItems[I].Caption := AOperation.Caption; + AItems[I].Checked := AOperation.Down; + AItems[I].Enabled := AOperation.Enabled; + AItems[I].ImageIndex := AOperation.ImageIndex; + AItems[I].Visible := AOperation.Visible; + AItems[I].OnClick := AOperation.DoExecute; + {$IFDEF DELPHI7} + if ACustomDrawNeeded then + AItems[I].OnAdvancedDrawItem := AdvancedDrawItem; + {$ENDIF} + end; + InitItems(AItems[I]); + end; +end; + +{ TcxGridStdHeaderMenu } + +function TcxGridStdHeaderMenu.GetOperationsClass: TcxGridPopupMenuOperationsClass; +begin + Result := TcxGridHeaderPopupMenuOperations; +end; + +{ TcxGridStdFooterMenu } + +function TcxGridStdFooterMenu.GetOperationsClass: TcxGridPopupMenuOperationsClass; +begin + Result := TcxGridFooterPopupMenuOperations; +end; + +{ TcxGridStdGroupRowMenu } + +function TcxGridStdGroupRowMenu.GetOperationsClass: TcxGridPopupMenuOperationsClass; +begin + Result := TcxGridGroupRowPopupMenuOperations; +end; + +procedure TcxGridStdGroupRowMenu.GridMenuPopup(ASenderMenu: TComponent; + AHitTest: TcxCustomGridHitTest; X, Y: Integer); +begin + TcxGridGroupRowPopupMenuOperations(Operations).GroupRow := + (AHitTest as TcxGridRecordHitTest).GridRecord as TcxGridGroupRow; + inherited; +end; + +function TcxGridStdGroupRowMenu.HasDynamicContent: Boolean; +begin + Result := True; +end; + +initialization + RegisterPopupMenuClass(TcxGridStdHeaderMenu, [gvhtColumnHeader], TcxGridTableView); + RegisterPopupMenuClass(TcxGridStdFooterMenu, [gvhtFooterCell, gvhtGroupFooterCell], + TcxGridTableView); + RegisterPopupMenuClass(TcxGridStdGroupRowMenu, [gvhtRecord, gvhtGroupSummary], + TcxGridTableView); + +finalization + UnregisterPopupMenuClass(TcxGridStdGroupRowMenu); + UnregisterPopupMenuClass(TcxGridStdFooterMenu); + UnregisterPopupMenuClass(TcxGridStdHeaderMenu); + +end. + diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridStrs.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridStrs.pas new file mode 100644 index 00000000..e7b0a9cc --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridStrs.pas @@ -0,0 +1,155 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridStrs; + +interface + +resourcestring + scxGridRecursiveLevels = 'You cannot create recursive levels'; + + scxGridDeletingConfirmationCaption = 'Confirm'; + scxGridDeletingFocusedConfirmationText = 'Delete record?'; + scxGridDeletingSelectedConfirmationText = 'Delete all selected records?'; + + scxGridNoDataInfoText = ''; + + scxGridFilterRowInfoText = 'Click here to define a filter'; + scxGridNewItemRowInfoText = 'Click here to add a new row'; + + scxGridFilterIsEmpty = ''; + + scxGridCustomizationFormCaption = 'Customization'; + scxGridCustomizationFormColumnsPageCaption = 'Columns'; + scxGridGroupByBoxCaption = 'Drag a column header here to group by that column'; + scxGridFilterApplyButtonCaption = 'Apply Filter'; + scxGridFilterCustomizeButtonCaption = 'Customize...'; + scxGridColumnsQuickCustomizationHint = 'Click here to show/hide/move columns'; + + scxGridCustomizationFormBandsPageCaption = 'Bands'; + scxGridBandsQuickCustomizationHint = 'Click here to show/hide/move bands'; + + scxGridCustomizationFormRowsPageCaption = 'Rows'; + + scxGridConverterIntermediaryMissing = 'Missing an intermediary component!'#13#10'Please add a %s component to the form.'; + scxGridConverterNotExistGrid = 'cxGrid does not exist'; + scxGridConverterNotExistComponent = 'Component does not exist'; + scxImportErrorCaption = 'Import error'; + + scxNotExistGridView = 'Grid view does not exist'; + scxNotExistGridLevel = 'Active grid level does not exist'; + scxCantCreateExportOutputFile = 'Can''t create the export output file'; + + cxSEditRepositoryExtLookupComboBoxItem = 'ExtLookupComboBox|Represents an ultra-advanced lookup using the QuantumGrid as its drop down control'; + + // date ranges + + scxGridYesterday = 'Yesterday'; + scxGridToday = 'Today'; + scxGridTomorrow = 'Tomorrow'; + scxGridLast30Days = 'Last 30 days'; + scxGridLast14Days = 'Last 14 days'; + scxGridLast7Days = 'Last 7 days'; + scxGridNext7Days = 'Next 7 days'; + scxGridNext14Days = 'Next 14 days'; + scxGridNext30Days = 'Next 30 days'; + scxGridLastTwoWeeks = 'Last two weeks'; + scxGridLastWeek = 'Last week'; + scxGridThisWeek = 'This week'; + scxGridNextWeek = 'Next week'; + scxGridNextTwoWeeks = 'Next two weeks'; + scxGridLastMonth = 'Last month'; + scxGridThisMonth = 'This month'; + scxGridNextMonth = 'Next month'; + scxGridLastYear = 'Last year'; + scxGridThisYear = 'This year'; + scxGridNextYear = 'Next year'; + scxGridPast = 'Past'; + scxGridFuture = 'Future'; + + scxGridMonthFormat = 'mmmm yyyy'; + scxGridYearFormat = 'yyyy'; + + // ChartView + + scxGridChartCategoriesDisplayText = 'Data'; + + scxGridChartValueHintFormat = '%s for %s is %s'; // series display text, category, value + scxGridChartPercentValueTickMarkLabelFormat = '0%'; + + scxGridChartToolBoxDataLevels = 'Data Levels:'; + scxGridChartToolBoxDataLevelSelectValue = 'select value'; + scxGridChartToolBoxCustomizeButtonCaption = 'Customize Chart'; + + scxGridChartNoneDiagramDisplayText = 'No diagram'; + scxGridChartColumnDiagramDisplayText = 'Column diagram'; + scxGridChartBarDiagramDisplayText = 'Bar diagram'; + scxGridChartLineDiagramDisplayText = 'Line diagram'; + scxGridChartAreaDiagramDisplayText = 'Area diagram'; + scxGridChartPieDiagramDisplayText = 'Pie diagram'; + + scxGridChartCustomizationFormSeriesPageCaption = 'Series'; + scxGridChartCustomizationFormSortBySeries = 'Sort by:'; + scxGridChartCustomizationFormNoSortedSeries = ''; + scxGridChartCustomizationFormDataGroupsPageCaption = 'Data Groups'; + scxGridChartCustomizationFormOptionsPageCaption = 'Options'; + + scxGridChartLegend = 'Legend'; + scxGridChartLegendKeyBorder = 'Key Border'; + scxGridChartPosition = 'Position'; + scxGridChartPositionDefault = 'Default'; + scxGridChartPositionNone = 'None'; + scxGridChartPositionLeft = 'Left'; + scxGridChartPositionTop = 'Top'; + scxGridChartPositionRight = 'Right'; + scxGridChartPositionBottom = 'Bottom'; + scxGridChartAlignment = 'Alignment'; + scxGridChartAlignmentDefault = 'Default'; + scxGridChartAlignmentStart = 'Start'; + scxGridChartAlignmentCenter = 'Center'; + scxGridChartAlignmentEnd = 'End'; + scxGridChartOrientation = 'Orientation'; + scxGridChartOrientationDefault = 'Default'; + scxGridChartOrientationHorizontal = 'Horizontal'; + scxGridChartOrientationVertical = 'Vertical'; + scxGridChartBorder = 'Border'; + scxGridChartTitle = 'Title'; + scxGridChartToolBox = 'ToolBox'; + scxGridChartDiagramSelector = 'Diagram Selector'; + scxGridChartOther = 'Other'; + scxGridChartValueHints = 'Value Hints'; + +implementation + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridStructureNavigator.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridStructureNavigator.pas new file mode 100644 index 00000000..cd767038 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridStructureNavigator.pas @@ -0,0 +1,1890 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridStructureNavigator; // TODO transparency + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + DesignIntf, +{$ELSE} + DsgnIntf, +{$ENDIF} + Windows, Messages, TypInfo, Classes, SysUtils, Controls, Graphics, Forms, + Menus, ExtCtrls, Buttons, + cxControls, cxClasses, cxGraphics, cxDesignWindows, + cxGridCommon, cxGrid, cxGridLevel, cxGridCustomView, cxViewEditor; + +const + CM_DeferUpdate = WM_DX + 25; + +type + TcxGridStructureControl = class; + TcxGridStructureNavigator = class; + + TcxGridColorIndex = (ciGrid, ciLevel, ciView); + + { TcxGridStructureControlViewInfo } + + TcxGridStructureControlRowViewInfo = class + Bounds: TRect; + + LevelBounds: TRect; + LevelContentBounds: TRect; + LevelHighlighted: Boolean; + LevelSelected: Boolean; + LevelText: string; + LevelTextArea: TRect; + + ViewBounds: TRect; + ViewContentBounds: TRect; + ViewHighlighted: Boolean; + ViewSelected: Boolean; + ViewText: string; + ViewTextArea: TRect; + + TreeLineVertCount: Integer; + TreeLineIsParent: Boolean; + TreeLineIsLast: Boolean; + end; + + TcxGridStructureControlRowsViewInfo = class(TcxObjectList) + private + function GetItem(Index: Integer): TcxGridStructureControlRowViewInfo; + public + property Items[Index: Integer]: TcxGridStructureControlRowViewInfo read GetItem; default; + end; + + TcxGridStructureControlViewInfo = class + private + FCanvas: TcxCanvas; + FStructureControl: TcxGridStructureControl; + FTextHeight: Integer; + FRowHeight: Integer; + FRows: TcxGridStructureControlRowsViewInfo; + function GetCanvas: TcxCanvas; + function GetGrid: TcxCustomGrid; + function GetLevelByIndex(AIndex: Integer): TcxGridLevel; + procedure GetLevelInfo(AIndex: Integer; var ALevelText, AViewText: string; var ALevelIndex: Integer; var AIsParent, AIsLast: Boolean); + function GetRowCount: Integer; + public + Bounds: TRect; + constructor Create(AStructureControl: TcxGridStructureControl); + destructor Destroy; override; + procedure Calculate; + + function GetContentColor: TColor; + function GetContentFont: TFont; + function GetContentFontColor: TColor; + function GetGridColor(AHighlighted: Boolean): TColor; + function GetHighlightedFontColor: TColor; + function GetLevelColor(AHighlighted: Boolean): TColor; + function GetRowBorderColor(AColorIndex: TcxGridColorIndex; ASelected, AHighlighted: Boolean): TColor; + function GetRowColor(AColorIndex: TcxGridColorIndex; ASelected, AHighlighted: Boolean): TColor; + function GetRowTextColor(AColorIndex: TcxGridColorIndex; ASelected, AHighlighted: Boolean): TColor; + function GetSelectedColor(AHighlighted: Boolean): TColor; + function GetSelectedFontColor: TColor; + function GetViewColor(AHighlighted: Boolean): TColor; + + procedure Paint; + + property Canvas: TcxCanvas read GetCanvas; + property Grid: TcxCustomGrid read GetGrid; + property StructureControl: TcxGridStructureControl read FStructureControl; + property Rows: TcxGridStructureControlRowsViewInfo read FRows; + end; + + { TcxGridStructureControl } + + TcxGridStructureControlSelectComponentEvent = procedure(AObject: TPersistent; + AClearSelection: Boolean) of object; + + TcxGridStructureControlHitTest = (htNowhere, htLevel, htView); + + TcxGridStructureControlHitInfo = record + HitTest: TcxGridStructureControlHitTest; + RowIndex: Integer; + end; + + TcxGridStructureControl = class(TcxControl) + private + FGrid: TcxCustomGrid; + FHitInfo: TcxGridStructureControlHitInfo; + FLockCount: Integer; + FMayFocused: Boolean; + FMouseDownHitInfo: TcxGridStructureControlHitInfo; + FMousePressed: Boolean; + FMultiSelect: Boolean; + FViewInfo: TcxGridStructureControlViewInfo; + FOnDrawBackground: TNotifyEvent; + FOnSelectComponent: TcxGridStructureControlSelectComponentEvent; + FOnSelectionChanged: TNotifyEvent; + procedure ClearSelection; + procedure SetGrid(Value: TcxCustomGrid); + procedure SetMultiSelect(Value: Boolean); + protected + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure Paint; override; + + procedure AddToSelection(AObject: TPersistent; AClearSelection: Boolean); + procedure CancelPressed(P: TPoint); + procedure CheckMousePos(P: TPoint); + procedure BoundsChanged; override; + procedure DoDrawBackground; virtual; + procedure FontChanged; override; + function GetComponentByHitInfo(AHitInfo: TcxGridStructureControlHitInfo): TComponent; + function GetCursor(X, Y: Integer): TCursor; override; + function MayFocus: Boolean; override; + procedure MouseLeave(AControl: TControl); override; + procedure SelectComponent(AObject: TPersistent; AClearSelection: Boolean = True); + procedure SelectionChanged; virtual; + procedure SetPressed(APressed: Boolean); + procedure UpdateContent; virtual; + procedure UpdateHighlighted; + property LockCount: Integer read FLockCount; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure BeginUpdate; + procedure Changed; + procedure EndUpdate; + function GetHitInfo(P: TPoint): TcxGridStructureControlHitInfo; + function GetLevelByRowIndex(ARowIndex: Integer): TcxGridLevel; + function GetSelectedLevel: TcxGridLevel; + procedure GetSelection(ASelectionList: TList); + procedure GetSelectionLevels(ASelectionList: TList); + function GetSelectionLevelCount: Integer; +// function GetSelectedView: TcxCustomGridView; + procedure GetSelectionViews(ASelectionList: TList); + function GetSelectionViewCount: Integer; + procedure SyncSelection(ASelectionList: TList); + property Grid: TcxCustomGrid read FGrid write SetGrid; + property Keys; + property MayFocused: Boolean read FMayFocused write FMayFocused; + property MultiSelect: Boolean read FMultiSelect write SetMultiSelect; + property ViewInfo: TcxGridStructureControlViewInfo read FViewInfo; + property OnKeyPress; + property OnDrawBackground: TNotifyEvent read FOnDrawBackground write FOnDrawBackground; + property OnSelectComponent: TcxGridStructureControlSelectComponentEvent read FOnSelectComponent write FOnSelectComponent; + property OnSelectionChanged: TNotifyEvent read FOnSelectionChanged write FOnSelectionChanged; + end; + + { TcxGridStructureHelper } + + TcxGridLevelViewList = class(TcxGridViewList) + private + FLevel: TcxGridLevel; + protected + procedure GetViewNames; override; + public + constructor Create(ALevel: TcxGridLevel); + property Level: TcxGridLevel read FLevel; + end; + + TcxGridStructureHelper = class + private + FPopupMenu: TPopupMenu; + FPopupMenuLevel: TcxGridLevel; + FStructureControl: TcxGridStructureControl; + FOnUpdateDesigner: TNotifyEvent; + procedure CreateLevelClick(Sender: TObject); + procedure CreateViewClick(Sender: TObject); + procedure SelectViewClick(Sender: TObject); + procedure DeleteLevelClick(Sender: TObject); + procedure MoveLevelClick(Sender: TObject); + protected + FPopupMenuView: TcxCustomGridView; + FViewMenuProvider: TcxCustomGridViewMenuProvider; + function CanAddComponent: Boolean; + function CanDeleteComponent(AComponent: TComponent): Boolean; + procedure ExecuteLevelViewsMenuItem(ALevel: TcxGridLevel; AMenuItem: TMenuItem); + procedure FillLevelViewsMenu(AMenu: TMenuItem; ALevel: TcxGridLevel; AOnClick: TNotifyEvent); + procedure StructureControlMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure UpdateDesigner; + public + constructor Create(AStructureControl: TcxGridStructureControl); virtual; + destructor Destroy; override; + property StructureControl: TcxGridStructureControl read FStructureControl; + property OnUpdateDesigner: TNotifyEvent read FOnUpdateDesigner write FOnUpdateDesigner; + end; + + { TcxGridStructureNavigator } + + TcxGridStructureNavigator = class(TcxCustomGridStructureNavigator) + private + FCloseButton: TSpeedButton; + FCustomizeButton: TSpeedButton; + FDefaultLevel: TcxGridLevel; + FDefaultView: TcxCustomGridView; + FDesignHelper: TcxDesignHelper; + FMakeSelectionVisible: Boolean; + FSeparator: TBevel; + FStructureControl: TcxGridStructureControl; + FStructureHelper: TcxGridStructureHelper; + procedure CloseButtonClick(Sender: TObject); + procedure CustomizeButtonClick(Sender: TObject); + procedure UpdateDesigner(Sender: TObject); + procedure CMDeferUpdate(var Message: TMessage); message CM_DeferUpdate; + protected + procedure Paint; override; + procedure Calculate; + function CalculateBoundsRect: TRect; override; + procedure Changed; override; + procedure CreateDefaultComponents; + procedure DrawBackground(ACanvas: TcxCanvas); virtual; + procedure DrawStructureControlBackground(Sender: TObject); + function GetClientBounds: TRect; override; + function GetDefaultViewClass: TcxCustomGridViewClass; virtual; + function GetDesigner: IDesigner; + procedure NotifyEditors; + procedure SelectComponent(AObject: TPersistent; AClearSelection: Boolean); + property MakeSelectionVisible: Boolean read FMakeSelectionVisible write FMakeSelectionVisible; + public + constructor Create(AGrid: TcxCustomGrid); override; + destructor Destroy; override; + procedure BeforeGridLoading; override; + function IsObjectSelected(AObject: TPersistent): Boolean; override; + procedure SelectionChanged(ASelection: TList); override; + procedure SelectObject(AObject: TPersistent; AClearSelection: Boolean); override; + procedure SelectObjects(AObjects: TList); override; + procedure UnselectObject(AObject: TPersistent); override; + end; + +function GenLevelName(AGrid: TcxCustomGrid; ALevel: TcxGridLevel): string; +function GenViewName(AOwnerComponent: TComponent; AView: TcxCustomGridView): string; +procedure FillRegisteredViewsMenu(AMenu: TMenuItem; AOnClick: TNotifyEvent); + +implementation + +uses + Math, dxOffice11, cxLookAndFeelPainters, cxCustomData, cxGridDBTableView, + cxGridEditor, cxLibraryConsts; + +const + ButtonBorderSize = 1; + ButtonOffset = 2; + CloseButtonHeight = 13; + CloseButtonWidth = 14; + FrameBorderSize = 1; + LevelIndent = 16; + RowBorderWidth = 1; + RowOffset = 2; + TextOffset = 2; + NavigatorOffset = 12; + // strings + SCustomizeText = 'Customize...'; // TODO res + SSubStr = 'TcxGrid'; + + cxGridDesignLevelColor = 15851215{16248036}; + cxGridDesignLevelHotColor = 13747387; + cxGridDesignLevelBorderColor = 13547166; + cxGridDesignLevelHotBorderColor = 12033927; + cxGridDesignGridColor = 12639424; + cxGridDesignGridHotColor = 10800292; + cxGridDesignGridBorderColor = 10526880; + cxGridDesignGridHotBorderColor = clDkGray; + +type + TcxCustomGridAccess = class(TcxCustomGrid); + +function GenLevelName(AGrid: TcxCustomGrid; ALevel: TcxGridLevel): string; +begin + Result := CreateUniqueName(AGrid.Owner, AGrid, ALevel, ScxGridPrefixName, ''); +end; + +function GenViewName(AOwnerComponent: TComponent; AView: TcxCustomGridView): string; +begin + Result := CreateUniqueName(AOwnerComponent.Owner, AOwnerComponent, AView, ScxGridPrefixName, ''); +end; + +procedure FillRegisteredViewsMenu(AMenu: TMenuItem; AOnClick: TNotifyEvent); +var + I: Integer; +begin + for I := 0 to cxGridRegisteredViews.Count - 1 do + begin + if (I <> 0) and (Pos('DB', cxGridRegisteredViews.Descriptions[I]) = 1) and + (Pos('DB', cxGridRegisteredViews.Descriptions[I - 1]) <> 1) then + AMenu.Add(CreateMenuItem(AMenu.Owner, '-')); + AMenu.Add(CreateMenuItem(AMenu.Owner, cxGridRegisteredViews.Descriptions[I], + AOnClick, True, I)); + end; +end; + +procedure CreateCloseBitmap(ABitmap: TBitmap); +var + ACanvas: TcxCanvas; + R: TRect; +begin + R := Rect(0, 0, CloseButtonWidth, CloseButtonHeight); + with ABitmap do + begin + Width := R.Right - R.Left; + Height := R.Bottom - R.Top; + Canvas.Brush.Color := clBtnFace; + Canvas.FillRect(R); + ACanvas := TcxCanvas.Create(Canvas); + try + TcxUltraFlatLookAndFeelPainter.DrawButtonCross(ACanvas, R, clBtnText, cxbsNormal); + finally + ACanvas.Free; + end; + end; +end; + +{$IFDEF DELPHI6} + +{ TDesignNotificationHandler } + +type + TDesignNotificationHandler = class(TInterfacedPersistent, IDesignNotification) + private + FGrids: TList; + protected + // IDesignNotification + procedure ItemDeleted(const ADesigner: IDesigner; AItem: TPersistent); + procedure ItemInserted(const ADesigner: IDesigner; AItem: TPersistent); + procedure ItemsModified(const ADesigner: IDesigner); + procedure SelectionChanged(const ADesigner: IDesigner; const ASelection: IDesignerSelections); + procedure DesignerOpened(const ADesigner: IDesigner; AResurrecting: Boolean); + procedure DesignerClosed(const ADesigner: IDesigner; AGoingDormant: Boolean); + public + constructor Create; virtual; + destructor Destroy; override; + procedure RegisterGrid(AGrid: TcxCustomGrid); + procedure UnregisterGrid(AGrid: TcxCustomGrid); + end; + +var + DesignNotificationHandler: TDesignNotificationHandler; + +constructor TDesignNotificationHandler.Create; +begin + inherited; + FGrids := TList.Create; + RegisterDesignNotification(Self); +end; + +destructor TDesignNotificationHandler.Destroy; +begin + UnregisterDesignNotification(Self); + FGrids.Free; + inherited; +end; + +procedure TDesignNotificationHandler.ItemDeleted(const ADesigner: IDesigner; + AItem: TPersistent); +begin +end; + +procedure TDesignNotificationHandler.ItemInserted(const ADesigner: IDesigner; + AItem: TPersistent); +begin +end; + +procedure TDesignNotificationHandler.ItemsModified(const ADesigner: IDesigner); +begin +end; + +procedure TDesignNotificationHandler.SelectionChanged(const ADesigner: IDesigner; + const ASelection: IDesignerSelections); +var + ASelectionList: TList; + I: Integer; +begin + ASelectionList := TList.Create; + try + ConvertSelectionToList(ASelection, ASelectionList); + for I := 0 to FGrids.Count - 1 do + TcxCustomGrid(FGrids[I]).StructureNavigator.SelectionChanged(ASelectionList); + finally + ASelectionList.Free; + end; +end; + +procedure TDesignNotificationHandler.DesignerOpened(const ADesigner: IDesigner; + AResurrecting: Boolean); +begin +end; + +procedure TDesignNotificationHandler.DesignerClosed(const ADesigner: IDesigner; + AGoingDormant: Boolean); +begin +end; + +procedure TDesignNotificationHandler.RegisterGrid(AGrid: TcxCustomGrid); +begin + FGrids.Add(AGrid); +end; + +procedure TDesignNotificationHandler.UnregisterGrid(AGrid: TcxCustomGrid); +begin + FGrids.Remove(AGrid); +end; + +{$ENDIF} + +{ TcxGridStructureControlRowsViewInfo } + +function TcxGridStructureControlRowsViewInfo.GetItem(Index: Integer): TcxGridStructureControlRowViewInfo; +begin + Result := TcxGridStructureControlRowViewInfo(inherited Items[Index]); +end; + +{ TcxGridStructureControlViewInfo } + +constructor TcxGridStructureControlViewInfo.Create(AStructureControl: TcxGridStructureControl); +begin + inherited Create; + FStructureControl := AStructureControl; + FRows := TcxGridStructureControlRowsViewInfo.Create; +end; + +destructor TcxGridStructureControlViewInfo.Destroy; +begin + FRows.Free; + FreeAndNil(FCanvas); + inherited Destroy; +end; + +procedure TcxGridStructureControlViewInfo.Calculate; +var + ASelection: TList; + W, H: Integer; + I, ALevelOffset, ATop: Integer; + ARow: TcxGridStructureControlRowViewInfo; +begin + // TODO: ref + if Grid = nil then Exit; + ASelection := TList.Create; + try + // save selection + StructureControl.GetSelection(ASelection); + // Init + Canvas.Font := GetContentFont; + FTextHeight := Canvas.TextHeight('Wg'); + FRowHeight := 2 * RowOffset + 2 * RowBorderWidth + 2 * TextOffset + FTextHeight; + // Rows + FRows.Clear; + H := GetRowCount * FRowHeight; + Bounds := Rect(0, 0, 0, H); + ATop := 0; + for I := 0 to GetRowCount - 1 do + begin + ARow := TcxGridStructureControlRowViewInfo.Create; + GetLevelInfo(I, ARow.LevelText, ARow.ViewText, ARow.TreeLineVertCount, + ARow.TreeLineIsParent, ARow.TreeLineIsLast); + // Level + ARow.LevelTextArea := Rect(0, ATop, Canvas.TextWidth(ARow.LevelText), ATop + FTextHeight); + OffsetRect(ARow.LevelTextArea, TextOffset, TextOffset); + ARow.LevelContentBounds := ARow.LevelTextArea; + InflateRect(ARow.LevelContentBounds, TextOffset, TextOffset); + OffsetRect(ARow.LevelTextArea, RowBorderWidth, RowBorderWidth); + OffsetRect(ARow.LevelContentBounds, RowBorderWidth, RowBorderWidth); + ARow.LevelBounds := ARow.LevelContentBounds; + InflateRect(ARow.LevelBounds, RowBorderWidth, RowBorderWidth); + ARow.Bounds := ARow.LevelBounds; + OffsetRect(ARow.LevelBounds, RowOffset, RowOffset); + OffsetRect(ARow.LevelContentBounds, RowOffset, RowOffset); + OffsetRect(ARow.LevelTextArea, RowOffset, RowOffset); + //InflateRect(ARow.Bounds, RowOffset, RowOffset); + OffsetRect(ARow.Bounds, RowOffset, RowOffset); + // Indent + ALevelOffset := ARow.TreeLineVertCount * (LevelIndent + RowOffset); + OffsetRect(ARow.LevelBounds, ALevelOffset, 0); + OffsetRect(ARow.LevelContentBounds, ALevelOffset, 0); + OffsetRect(ARow.LevelTextArea, ALevelOffset, 0); + OffsetRect(ARow.Bounds, ALevelOffset, 0); + // View + if (I > 0) and (ARow.ViewText <> '') then + begin + W := 2 * RowBorderWidth + 2 * TextOffset + Canvas.TextWidth(ARow.ViewText); + ARow.ViewBounds := Rect(ARow.LevelBounds.Right - RowBorderWidth, ARow.LevelBounds.Top, + ARow.LevelBounds.Right - RowBorderWidth + W, ARow.LevelBounds.Bottom); + ARow.ViewContentBounds := ARow.ViewBounds; + InflateRect(ARow.ViewContentBounds, -RowBorderWidth, -RowBorderWidth); + ARow.ViewTextArea := ARow.ViewContentBounds; + InflateRect(ARow.ViewTextArea, -TextOffset, -TextOffset); + Inc(ARow.Bounds.Right, W - RowBorderWidth); + end; + FRows.Add(ARow); + Bounds.Right := Max(Bounds.Right, ARow.Bounds.Right + RowOffset); + Inc(ATop, FRowHeight); + end; + Bounds.Bottom := ATop; + // restore selection + StructureControl.SyncSelection(ASelection); + finally + ASelection.Free; + end; +end; + +function TcxGridStructureControlViewInfo.GetContentColor: TColor; +begin + Result := clWhite; +end; + +function TcxGridStructureControlViewInfo.GetContentFont: TFont; +begin + Result := StructureControl.Font; +end; + +function TcxGridStructureControlViewInfo.GetContentFontColor: TColor; +begin + Result := clBlack; +end; + +function TcxGridStructureControlViewInfo.GetGridColor(AHighlighted: Boolean): TColor; +begin + if AHighlighted then + Result := cxGridDesignGridHotColor + else + Result := cxGridDesignGridColor; +end; + +function TcxGridStructureControlViewInfo.GetHighlightedFontColor: TColor; +begin + Result := GetContentFontColor; +end; + +function TcxGridStructureControlViewInfo.GetLevelColor(AHighlighted: Boolean): TColor; +begin + if AHighlighted then + Result := cxGridDesignLevelHotColor + else + Result := cxGridDesignLevelColor; +end; + +function TcxGridStructureControlViewInfo.GetRowBorderColor(AColorIndex: TcxGridColorIndex; + ASelected, AHighlighted: Boolean): TColor; +begin + if ASelected then + if AHighlighted then + Result := cxGridDesignSelectedHotBorderColor + else + Result := cxGridDesignSelectedBorderColor + else + case AColorIndex of + ciLevel: + if AHighlighted then + Result := cxGridDesignLevelHotBorderColor + else + Result := cxGridDesignLevelBorderColor; + ciView: + Result := cxGridDesignViewBorderColor; + else + if AHighlighted then + Result := cxGridDesignGridHotBorderColor + else + Result := cxGridDesignGridBorderColor; + end; +end; + +function TcxGridStructureControlViewInfo.GetRowColor(AColorIndex: TcxGridColorIndex; + ASelected, AHighlighted: Boolean): TColor; +begin + if ASelected then + Result := GetSelectedColor(AHighlighted) + else + case AColorIndex of + ciLevel: + Result := GetLevelColor(AHighlighted); + ciView: + Result := GetViewColor(AHighlighted); + else + Result := GetGridColor(AHighlighted); + end; +end; + +function TcxGridStructureControlViewInfo.GetRowTextColor(AColorIndex: TcxGridColorIndex; + ASelected, AHighlighted: Boolean): TColor; +begin + if ASelected then + Result := GetSelectedFontColor + else + if AHighlighted then + Result := GetHighlightedFontColor + else + Result := GetContentFontColor; +end; + +function TcxGridStructureControlViewInfo.GetSelectedColor(AHighlighted: Boolean): TColor; +begin + if AHighlighted then + Result := cxGridDesignSelectedHotColor + else + Result := cxGridDesignSelectedColor; +end; + +function TcxGridStructureControlViewInfo.GetSelectedFontColor: TColor; +begin + Result := GetContentFontColor; +end; + +function TcxGridStructureControlViewInfo.GetViewColor(AHighlighted: Boolean): TColor; +begin + if AHighlighted then + Result := cxGridDesignViewHotColor + else + Result := cxGridDesignViewColor; +end; + +procedure TcxGridStructureControlViewInfo.Paint; + + procedure SetFontAndBrush(ASelected, AHighlighted: Boolean; AColorIndex: TcxGridColorIndex); + begin + Canvas.Brush.Color := GetRealColor(GetRowColor(AColorIndex, ASelected, AHighlighted)); + Canvas.Font.Color := GetRealColor(GetRowTextColor(AColorIndex, ASelected, AHighlighted)); + {if AHighlighted then + Canvas.Font.Style := Canvas.Font.Style + [fsUnderline] + else + Canvas.Font.Style := Canvas.Font.Style - [fsUnderline];} + end; + + procedure DrawCell(ACellRect, ATextRect: TRect; const AText: string); + begin + Canvas.FillRect(ACellRect); + Canvas.Brush.Style := bsClear; + Canvas.DrawText(AText, ATextRect, cxAlignLeft or cxAlignVCenter or cxSingleLine); + Canvas.Brush.Style := bsSolid; + end; + + procedure DrawRows; + var + I: Integer; + ARow: TcxGridStructureControlRowViewInfo; + AColorIndex: TcxGridColorIndex; + begin + for I := 0 to Rows.Count - 1 do + begin + ARow := Rows[I]; + // Level + if I = 0 then + AColorIndex := ciGrid + else + AColorIndex := ciLevel; + Canvas.FrameRect(ARow.LevelBounds, + GetRealColor(GetRowBorderColor(AColorIndex, ARow.LevelSelected, ARow.LevelHighlighted)), + RowBorderWidth); + SetFontAndBrush(ARow.LevelSelected, ARow.LevelHighlighted, AColorIndex); + DrawCell(ARow.LevelContentBounds, ARow.LevelTextArea, ARow.LevelText); + // View + if not IsRectEmpty(ARow.ViewBounds) then + begin + Canvas.FrameRect(ARow.ViewBounds, + GetRealColor(GetRowBorderColor(ciView, ARow.ViewSelected, ARow.ViewHighlighted)), + RowBorderWidth); + SetFontAndBrush(ARow.ViewSelected, ARow.ViewHighlighted, ciView); + DrawCell(ARow.ViewContentBounds, ARow.ViewTextArea, ARow.ViewText); + end; + Canvas.ExcludeClipRect(ARow.Bounds); + end; + end; + +begin + // Rows + Canvas.Font := GetContentFont; + DrawRows; + // Background + StructureControl.DoDrawBackground; +end; + +function TcxGridStructureControlViewInfo.GetCanvas: TcxCanvas; +begin + if StructureControl.HandleAllocated then + begin + if FCanvas <> nil then + FreeAndNil(FCanvas); + Result := StructureControl.Canvas; + end + else + begin + if FCanvas = nil then + FCanvas := TcxScreenCanvas.Create; + Result := FCanvas; + end; +end; + +function TcxGridStructureControlViewInfo.GetGrid: TcxCustomGrid; +begin + Result := StructureControl.Grid; +end; + +function TcxGridStructureControlViewInfo.GetLevelByIndex(AIndex: Integer): TcxGridLevel; +var + ACurrent: Integer; + + procedure CalculateCount(ALevel: TcxGridLevel); + var + I: Integer; + begin + if ALevel = nil then Exit; + if ACurrent = AIndex then + Result := ALevel + else + begin + Inc(ACurrent); + for I := 0 to ALevel.Count - 1 do + begin + CalculateCount(ALevel[I]); + if Result <> nil then + Break; + end; + end; + end; + +begin + Result := nil; + ACurrent := 0; + if (Grid <> nil) and (Grid.Levels <> nil) then + CalculateCount(Grid.Levels); +end; + +procedure TcxGridStructureControlViewInfo.GetLevelInfo(AIndex: Integer; + var ALevelText, AViewText: string; var ALevelIndex: Integer; + var AIsParent, AIsLast: Boolean); + + function GetCompName(AComponent: TComponent): string; + begin + Result := AComponent.Name; + if Result = '' then + Result := '< >'; + end; + +var + ALevel: TcxGridLevel; +begin + ALevelText := ''; + AViewText := ''; + ALevelIndex := 0; + AIsParent := False; + AIsLast := False; + ALevel := GetLevelByIndex(AIndex); + if ALevel <> nil then + begin + AIsParent := ALevel.Count > 0; + AIsLast := (ALevel.Parent <> nil) and + (ALevel.Parent[ALevel.Parent.Count - 1] = ALevel); + if ALevel.IsRoot then // TODO: IsRoot + ALevelText := GetCompName(Grid) + else + begin + ALevelText := GetCompName(ALevel); + if ALevel.GridView <> nil then + AViewText := GetCompName(ALevel.GridView); + end; + end; + ALevelIndex := 0; + while ALevel <> nil do + begin + if ALevel.IsRoot then // TODO: IsRoot + Break + else + begin + Inc(ALevelIndex); + ALevel := ALevel.Parent; + end; + end; +end; + +function TcxGridStructureControlViewInfo.GetRowCount: Integer; + + procedure CalculateCount(ALevel: TcxGridLevel); + var + I: Integer; + begin + Inc(Result, ALevel.Count); + for I := 0 to ALevel.Count - 1 do + CalculateCount(ALevel[I]); + end; + +begin + if Grid = nil then + Result := 0 + else + begin + Result := 1; // Root + if Grid.Levels <> nil then + CalculateCount(Grid.Levels); + end; +end; + +{ TcxGridStructureControl } + +constructor TcxGridStructureControl.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FViewInfo := TcxGridStructureControlViewInfo.Create(Self); +end; + +destructor TcxGridStructureControl.Destroy; +begin + FreeAndNil(FViewInfo); + inherited Destroy; +end; + +procedure TcxGridStructureControl.BeginUpdate; +begin + Inc(FLockCount); +end; + +procedure TcxGridStructureControl.Changed; +begin + if LockCount = 0 then + UpdateContent; +end; + +procedure TcxGridStructureControl.EndUpdate; +begin + Dec(FLockCount); + Changed; +end; + +function TcxGridStructureControl.GetHitInfo(P: TPoint): TcxGridStructureControlHitInfo; +var + I: Integer; +begin + Result.HitTest := htNowhere; + Result.RowIndex := -1; + for I := 0 to ViewInfo.Rows.Count - 1 do + if PtInRect(ViewInfo.Rows[I].Bounds, P) then + begin + Result.RowIndex := I; + if PtInRect(ViewInfo.Rows[I].LevelBounds, P) then + begin + Result.HitTest := htLevel; + Break; + end + else + if PtInRect(ViewInfo.Rows[I].ViewBounds, P) then + begin + Result.HitTest := htView; + Break; + end; + end; +end; + +function TcxGridStructureControl.GetLevelByRowIndex(ARowIndex: Integer): TcxGridLevel; +begin + Result := ViewInfo.GetLevelByIndex(ARowIndex); +end; + +function TcxGridStructureControl.GetSelectedLevel: TcxGridLevel; +var + ASelectionList: TList; +begin + Result := nil; + ASelectionList := TList.Create; + try + GetSelectionLevels(ASelectionList); + if ASelectionList.Count = 1 then + Result := TcxGridLevel(ASelectionList[0]); + finally + ASelectionList.Free; + end; +end; + +procedure TcxGridStructureControl.GetSelection(ASelectionList: TList); +var + I: Integer; + ALevel: TcxGridLevel; +begin + ASelectionList.Clear; + for I := 0 to ViewInfo.Rows.Count - 1 do + begin + ALevel := ViewInfo.GetLevelByIndex(I); + if Assigned(ALevel) then + begin + if ViewInfo.Rows[I].LevelSelected then + begin + if ALevel.IsRoot then // TODO: IsRoot + ASelectionList.Add(Grid) + else + ASelectionList.Add(ALevel); + end; + if ViewInfo.Rows[I].ViewSelected and (ALevel.GridView <> nil) then + ASelectionList.Add(ALevel.GridView); + end; + end; +end; + +procedure TcxGridStructureControl.GetSelectionLevels(ASelectionList: TList); +var + I: Integer; +begin + GetSelection(ASelectionList); + for I := ASelectionList.Count - 1 downto 0 do + if not (TObject(ASelectionList[I]) is TcxGridLevel) then + ASelectionList.Delete(I); +end; + +function TcxGridStructureControl.GetSelectionLevelCount: Integer; +var + ASelectionList: TList; +begin + ASelectionList := TList.Create; + try + GetSelectionLevels(ASelectionList); + Result := ASelectionList.Count; + finally + ASelectionList.Free; + end; +end; + +procedure TcxGridStructureControl.GetSelectionViews(ASelectionList: TList); +var + I: Integer; +begin + GetSelection(ASelectionList); + for I := ASelectionList.Count - 1 downto 0 do + if not (TObject(ASelectionList[I]) is TcxCustomGridView) then + ASelectionList.Delete(I); +end; + +function TcxGridStructureControl.GetSelectionViewCount: Integer; +var + ASelectionList: TList; +begin + ASelectionList := TList.Create; + try + GetSelectionViews(ASelectionList); + Result := ASelectionList.Count; + finally + ASelectionList.Free; + end; +end; + +procedure TcxGridStructureControl.SyncSelection(ASelectionList: TList); + + procedure CheckLevel(ARow: TcxGridStructureControlRowViewInfo; AComponent: TComponent); + var + ASelected: Boolean; + begin + ASelected := ASelectionList.IndexOf(AComponent) <> -1; + if ARow.LevelSelected <> ASelected then + begin + ARow.LevelSelected := ASelected; + InvalidateRect(ARow.LevelBounds, False); + end; + end; + + procedure CheckView(ARow: TcxGridStructureControlRowViewInfo; AComponent: TComponent); + var + ASelected: Boolean; + begin + ASelected := ASelectionList.IndexOf(AComponent) <> -1; + if ARow.ViewSelected <> ASelected then + begin + ARow.ViewSelected := ASelected; + InvalidateRect(ARow.ViewBounds, False); + end; + end; + +var + I: Integer; + ALevel: TcxGridLevel; +begin + for I := 0 to ViewInfo.Rows.Count - 1 do + begin + ALevel := ViewInfo.GetLevelByIndex(I); + if Assigned(ALevel) then + if ALevel.IsRoot then // TODO: IsRoot + CheckLevel(ViewInfo.Rows[I], Grid) + else + begin + CheckLevel(ViewInfo.Rows[I], ALevel); + if ALevel.GridView <> nil then + CheckView(ViewInfo.Rows[I], ALevel.GridView); + end; + end; +end; + +procedure TcxGridStructureControl.MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +var + AComponent: TComponent; +begin + FMouseDownHitInfo := GetHitInfo(Point(X, Y)); + if Button in [mbLeft, mbRight] then + begin + AComponent := GetComponentByHitInfo(FMouseDownHitInfo); + if AComponent <> nil then + SelectComponent(AComponent, (Button = mbRight) or not MultiSelect or not (ssShift in Shift)); + SetPressed(True); + CheckMousePos(Point(X, Y)); + end; + inherited; +end; + +procedure TcxGridStructureControl.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited; + CheckMousePos(Point(X, Y)); +end; + +procedure TcxGridStructureControl.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + inherited; + if Button in [mbLeft, mbRight] then + CancelPressed(Point(X, Y)); +end; + +procedure TcxGridStructureControl.Paint; +begin + ViewInfo.Paint; +end; + +procedure TcxGridStructureControl.AddToSelection(AObject: TPersistent; AClearSelection: Boolean); + + function IsEquals(AList1, AList2: TList): Boolean; + var + I: Integer; + begin + Result := AList1.Count = AList2.Count; + if Result then + for I := 0 to AList1.Count - 1 do + if AList1[I] <> AList2[I] then + begin + Result := False; + Break; + end; + end; + +var + APrevSelection, ASelection: TList; +begin + APrevSelection := TList.Create; + ASelection := TList.Create; + try + GetSelection(APrevSelection); + if not AClearSelection then + GetSelection(ASelection); + if (AObject <> nil) and (ASelection.Remove(AObject) = -1) then + ASelection.Add(AObject); + if not IsEquals(ASelection, APrevSelection) then + begin + SyncSelection(ASelection); + SelectionChanged; + end; + finally + ASelection.Free; + APrevSelection.Free; + end; +end; + +procedure TcxGridStructureControl.CancelPressed(P: TPoint); +begin + SetPressed(False); + CheckMousePos(P); +end; + +procedure TcxGridStructureControl.CheckMousePos(P: TPoint); +begin + FHitInfo := GetHitInfo(P); + UpdateHighlighted; +end; + +procedure TcxGridStructureControl.BoundsChanged; +begin + inherited; + Changed; +end; + +procedure TcxGridStructureControl.DoDrawBackground; +begin + if Assigned(FOnDrawBackground) then + FOnDrawBackground(Self) + else + begin + Canvas.Brush.Color := ViewInfo.GetContentColor; + Canvas.FillRect(ClientRect); + end; +end; + +procedure TcxGridStructureControl.FontChanged; +begin + inherited; + Changed; +end; + +function TcxGridStructureControl.GetComponentByHitInfo(AHitInfo: TcxGridStructureControlHitInfo): TComponent; +var + ALevel: TcxGridLevel; +begin + Result := nil; + if AHitInfo.RowIndex = -1 then Exit; + ALevel := ViewInfo.GetLevelByIndex(AHitInfo.RowIndex); + if ALevel = nil then Exit; + if AHitInfo.HitTest = htLevel then + begin + if ALevel.IsRoot then // TODO + Result := Grid + else + Result := ALevel; + end + else + if AHitInfo.HitTest = htView then + begin + if ALevel.GridView <> nil then + Result := ALevel.GridView; + end; +end; + +function TcxGridStructureControl.GetCursor(X, Y: Integer): TCursor; +begin + if GetHitInfo(Point(X, Y)).HitTest in [htLevel, htView] then + Result := crcxHandPoint + else + Result := inherited GetCursor(X, Y); +end; + +function TcxGridStructureControl.MayFocus: Boolean; +begin + Result := FMayFocused; +end; + +procedure TcxGridStructureControl.MouseLeave(AControl: TControl); +begin + CheckMousePos(Point(-1, -1)); +end; + +procedure TcxGridStructureControl.SelectComponent(AObject: TPersistent; + AClearSelection: Boolean = True); +begin +{$IFNDEF DELPHI6} + if not Assigned(FOnSelectComponent) then +{$ENDIF} + AddToSelection(AObject, AClearSelection); + if Assigned(FOnSelectComponent) then + FOnSelectComponent(AObject, AClearSelection); +end; + +procedure TcxGridStructureControl.SelectionChanged; +begin + if Assigned(FOnSelectionChanged) then + FOnSelectionChanged(Self); +end; + +procedure TcxGridStructureControl.SetPressed(APressed: Boolean); +begin + if FMousePressed <> APressed then + begin + FMousePressed := APressed; + // TODO + end; +end; + +procedure TcxGridStructureControl.UpdateContent; +begin + ViewInfo.Calculate; + Invalidate; +end; + +procedure TcxGridStructureControl.UpdateHighlighted; + + procedure CheckLevel(ARow: TcxGridStructureControlRowViewInfo; AHighlighted: Boolean); + begin + if ARow.LevelHighlighted <> AHighlighted then + begin + ARow.LevelHighlighted := AHighlighted; + InvalidateRect(ARow.LevelBounds, False); + end; + end; + + procedure CheckView(ARow: TcxGridStructureControlRowViewInfo; AHighlighted: Boolean); + begin + if ARow.ViewHighlighted <> AHighlighted then + begin + ARow.ViewHighlighted := AHighlighted; + InvalidateRect(ARow.ViewBounds, False); + end; + end; + +var + I: Integer; + AHitInfo: TcxGridStructureControlHitInfo; +begin + for I := 0 to ViewInfo.Rows.Count - 1 do + begin + if FMousePressed then + AHitInfo := FMouseDownHitInfo + else + AHitInfo := FHitInfo; + if AHitInfo.HitTest = htLevel then + begin + CheckLevel(ViewInfo.Rows[I], (AHitInfo.RowIndex = I)); + CheckView(ViewInfo.Rows[I], False); + end + else + if AHitInfo.HitTest = htView then + begin + CheckLevel(ViewInfo.Rows[I], False); + CheckView(ViewInfo.Rows[I], (AHitInfo.RowIndex = I)); + end + else + begin + CheckLevel(ViewInfo.Rows[I], False); + CheckView(ViewInfo.Rows[I], False); + end; + end; +end; + +procedure TcxGridStructureControl.ClearSelection; +begin + AddToSelection(nil, True); +end; + +procedure TcxGridStructureControl.SetGrid(Value: TcxCustomGrid); +begin + if FGrid <> Value then + begin + FGrid := Value; + Changed; + end; +end; + +procedure TcxGridStructureControl.SetMultiSelect(Value: Boolean); +begin + if FMultiSelect <> Value then + begin + FMultiSelect := Value; + ClearSelection; + end; +end; + +{ TcxGridLevelViewList } + +constructor TcxGridLevelViewList.Create(ALevel: TcxGridLevel); +begin + FLevel := ALevel; + inherited Create(GetObjectDesigner(ALevel)); +end; + +procedure TcxGridLevelViewList.GetViewNames; +var + I: Integer; + AView: TcxCustomGridView; +begin + inherited; + for I := ViewNames.Count - 1 downto 0 do + begin + AView := Views[I]; + if (AView.Repository = nil) and (AView.StorageControl <> Level.Control) then + ViewNames.Delete(I); + end; +end; + +{ TcxGridStructureHelper } + +constructor TcxGridStructureHelper.Create(AStructureControl: TcxGridStructureControl); +begin + inherited Create; + FStructureControl := AStructureControl; + FStructureControl.OnMouseDown := StructureControlMouseDown; +end; + +destructor TcxGridStructureHelper.Destroy; +begin + FViewMenuProvider.Free; + FreeAndNil(FPopupMenu); + inherited Destroy; +end; + +function TcxGridStructureHelper.CanAddComponent: Boolean; +begin + Result := cxDesignWindows.CanAddComponent(StructureControl.Grid.Owner); +end; + +function TcxGridStructureHelper.CanDeleteComponent(AComponent: TComponent): Boolean; +var + AOwner: TComponent; +begin + if AComponent = nil then + AOwner := StructureControl.Grid.Owner + else + AOwner := AComponent.Owner; + Result := cxDesignWindows.CanDeleteComponent(AOwner, AComponent); +end; + +procedure TcxGridStructureHelper.ExecuteLevelViewsMenuItem(ALevel: TcxGridLevel; AMenuItem: TMenuItem); +var + ALevelViewList: TcxGridLevelViewList; + AView: TcxCustomGridView; +begin + ALevelViewList := TcxGridLevelViewList.Create(ALevel); + try + AView := ALevelViewList.Views[AMenuItem.MenuIndex]; + if ALevel.GridView <> AView then + begin + ALevel.GridView := AView; + UpdateDesigner; + end; + finally + ALevelViewList.Free; + end; +end; + +procedure TcxGridStructureHelper.FillLevelViewsMenu(AMenu: TMenuItem; + ALevel: TcxGridLevel; AOnClick: TNotifyEvent); +var + ALevelViewList: TcxGridLevelViewList; + I: Integer; +begin + ALevelViewList := TcxGridLevelViewList.Create(ALevel); + try + for I := 0 to ALevelViewList.ViewNames.Count - 1 do + AMenu.Add(CreateMenuItem(AMenu.Owner, ALevelViewList.ViewNames[I], AOnClick)); + if ALevel.GridView <> nil then + AMenu[ALevelViewList.GetViewIndex(ALevel.GridView)].Checked := True; + finally + ALevelViewList.Free; + end; + AMenu.Add(CreateMenuItem(AMenu.Owner, '-')); + AMenu.Add(CreateMenuItem(AMenu.Owner, 'None', AOnClick, True, -1, ALevel.GridView = nil)); +end; + +procedure TcxGridStructureHelper.StructureControlMouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + + function IsViewEmpty(AView: TcxCustomGridView): Boolean; + begin + Result := AView.DataController.ItemCount = 0; + end; + + procedure PrepareGridMenu; + begin + FPopupMenu.Items.Add(CreateMenuItem(FPopupMenu, 'Add Level', CreateLevelClick, + CanAddComponent)); + end; + + procedure PrepareLevelMenu; + var + AMenuItem: TMenuItem; + begin + AMenuItem := CreateMenuItem(FPopupMenu, 'Create View', nil, CanAddComponent); + FPopupMenu.Items.Add(AMenuItem); + FillRegisteredViewsMenu(AMenuItem, CreateViewClick); + + AMenuItem := CreateMenuItem(FPopupMenu, 'Select View'); + FPopupMenu.Items.Add(AMenuItem); + FillLevelViewsMenu(AMenuItem, FPopupMenuLevel, SelectViewClick); + + PrepareGridMenu; + FPopupMenu.Items.Add(CreateMenuItem(FPopupMenu, '-')); + FPopupMenu.Items.Add(CreateMenuItem(FPopupMenu, 'Delete Level', + DeleteLevelClick, CanDeleteComponent(FPopupMenuLevel))); + FPopupMenu.Items.Add(CreateMenuItem(FPopupMenu, '-')); + FPopupMenu.Items.Add(CreateMenuItem(FPopupMenu, 'Move Level Up', MoveLevelClick, + FPopupMenuLevel.Index > 0, -1)); + FPopupMenu.Items.Add(CreateMenuItem(FPopupMenu, 'Move Level Down', MoveLevelClick, + FPopupMenuLevel.Index < FPopupMenuLevel.Parent.Count - 1, 1)); + end; + + function PrepareViewMenu(AView: TcxCustomGridView): TcxCustomGridViewMenuProvider; + var + I: Integer; + AMenuItem: TMenuItem; + begin + FPopupMenuView := AView; + Result := CreateViewMenuProvider(AView); + if Result = nil then Exit; + for I := 0 to Result.Items.Count - 1 do + begin + AMenuItem := CreateMenuItem(FPopupMenu, ''); + Result.Items[I].Prepare(AMenuItem); + FPopupMenu.Items.Add(AMenuItem); + end; + end; + +var + AHitInfo: TcxGridStructureControlHitInfo; + P: TPoint; +begin + if Button <> mbRight then Exit; + P := Point(X, Y); + AHitInfo := FStructureControl.GetHitInfo(P); + if AHitInfo.HitTest <> htNowhere then + begin + if FPopupMenu = nil then + FPopupMenu := TPopupMenu.Create(nil); + while FPopupMenu.Items.Count > 0 do + FPopupMenu.Items[0].Free; + + FPopupMenuLevel := FStructureControl.GetLevelByRowIndex(AHitInfo.RowIndex); + if FPopupMenuLevel <> nil then + begin + if FPopupMenuLevel.IsRoot then + PrepareGridMenu + else + if AHitInfo.HitTest = htLevel then + PrepareLevelMenu + else + begin + FViewMenuProvider.Free; + FViewMenuProvider := PrepareViewMenu(FPopupMenuLevel.GridView); + end; + P := FStructureControl.ClientToScreen(P); + FPopupMenu.Popup(P.X, P.Y); + FStructureControl.CancelPressed(Point(-1, -1)); + end; + end; +end; + +procedure TcxGridStructureHelper.UpdateDesigner; +begin + if Assigned(FOnUpdateDesigner) then + FOnUpdateDesigner(Self); +end; + +procedure TcxGridStructureHelper.CreateLevelClick(Sender: TObject); +var + ALevel: TcxGridLevel; +begin + StructureControl.BeginUpdate; + try + ALevel := FPopupMenuLevel.Add; + ALevel.Name := GenLevelName(StructureControl.Grid, ALevel); + StructureControl.SelectComponent(ALevel); + UpdateDesigner; + finally + StructureControl.EndUpdate; + end; +end; + +procedure TcxGridStructureHelper.CreateViewClick(Sender: TObject); +var + AViewClass: TcxCustomGridViewClass; + AView: TcxCustomGridView; +begin + AViewClass := TcxCustomGridViewClass( + cxGridRegisteredViews[((Sender as TMenuItem).Tag)]); + StructureControl.BeginUpdate; + try + AView := StructureControl.Grid.CreateView(AViewClass); + AView.Name := GenViewName(StructureControl.Grid, AView); + RestoreViewFromTemplate(GetViewTemplateRegKey, AView); + FPopupMenuLevel.GridView := AView; + StructureControl.SelectComponent(AView); + UpdateDesigner; + finally + StructureControl.EndUpdate; + end; +end; + +procedure TcxGridStructureHelper.SelectViewClick(Sender: TObject); +begin + ExecuteLevelViewsMenuItem(FPopupMenuLevel, Sender as TMenuItem); +end; + +procedure TcxGridStructureHelper.DeleteLevelClick(Sender: TObject); +begin + StructureControl.BeginUpdate; + try + StructureControl.SelectComponent(FPopupMenuLevel.GetParentComponent); + FPopupMenuLevel.Free; + UpdateDesigner; + finally + StructureControl.EndUpdate; + end; +end; + +procedure TcxGridStructureHelper.MoveLevelClick(Sender: TObject); +var + ASelection: TList; +begin + ASelection := TList.Create; + try + StructureControl.GetSelection(ASelection); + FPopupMenuLevel.Index := FPopupMenuLevel.Index + Integer(TMenuItem(Sender).Tag); + UpdateDesigner; + StructureControl.SyncSelection(ASelection); + finally + ASelection.Free; + end; +end; + +{ TcxGridStructureNavigator } + +constructor TcxGridStructureNavigator.Create(AGrid: TcxCustomGrid); +begin + inherited; + FMakeSelectionVisible := True; + FStructureControl := TcxGridStructureControl.Create(Self); + with FStructureControl do + begin + SetBounds(0, 0, 0, 0); + Grid := Self.Grid; + {$IFDEF DELPHI6} + MultiSelect := True; + {$ENDIF} + OnDrawBackground := DrawStructureControlBackground; + OnSelectComponent := Self.SelectComponent; + Parent := Self; + end; + FStructureHelper := TcxGridStructureHelper.Create(FStructureControl); + FStructureHelper.OnUpdateDesigner := UpdateDesigner; + FCloseButton := TSpeedButton.Create(Self); + with FCloseButton do + begin + CreateCloseBitmap(Glyph); + Flat := True; + SetBounds(0, 0, 0, 0); + OnClick := CloseButtonClick; + Parent := Self; + end; + FCustomizeButton := TSpeedButton.Create(Self); + with FCustomizeButton do + begin + Caption := SCustomizeText; + Flat := True; + SetBounds(0, 0, 0, 0); + OnClick := CustomizeButtonClick; + Parent := Self; + end; + FSeparator := TBevel.Create(Self); + with FSeparator do + begin + Shape := bsTopLine; + SetBounds(0, 0, 0, 0); + Parent := Self; + end; + CreateDefaultComponents; + FDesignHelper := TcxDesignHelper.Create(Grid); +{$IFDEF DELPHI6} + DesignNotificationHandler.RegisterGrid(Grid); +{$ENDIF} +end; + +destructor TcxGridStructureNavigator.Destroy; +begin +{$IFDEF DELPHI6} + DesignNotificationHandler.UnregisterGrid(Grid); +{$ENDIF} + FreeAndNil(FDesignHelper); + FreeAndNil(FStructureHelper); + inherited Destroy; +end; + +procedure TcxGridStructureNavigator.Paint; +begin + // Border + Canvas.FrameRect(ClientRect, clWindowFrame, FrameBorderSize); + // Background + DrawBackground(Canvas); +end; + +(* +procedure TcxGridStructureNavigator.Calculate; +var + R: TRect; + ACanvas: TcxCanvas; + ACloseButtonSize: TSize; + ACloseButtonArea: TRect; + ACustomizeButtonArea: TRect; + ASeparatorArea: TRect; + ASeparatorHeight: Integer; +begin + FStructureControl.ViewInfo.Calculate; + R := FStructureControl.ViewInfo.Bounds; + OffsetRect(R, FrameBorderSize, FrameBorderSize); + FStructureControl.BoundsRect := R; + // Calc Customize Button + ASeparatorHeight := ButtonOffset * 2; + ACanvas := FStructureControl.ViewInfo.Canvas; + ACanvas.Font := FCustomizeButton.Font; + ACloseButtonSize.cx := 2 * TextOffset + ACanvas.TextWidth(SCustomizeText) + 2 * ButtonBorderSize; + ACloseButtonSize.cy := 2 * TextOffset + ACanvas.TextHeight(SCustomizeText) + 2 * ButtonBorderSize; + ACustomizeButtonArea := Rect(R.Left, R.Bottom + ASeparatorHeight, R.Left + 2 * ButtonOffset + ACloseButtonSize.cx, + R.Bottom + ASeparatorHeight + 2 * ButtonOffset + ACloseButtonSize.cy); + FCustomizeButton.SetBounds(ACustomizeButtonArea.Left + ButtonOffset, + ACustomizeButtonArea.Top + ButtonOffset, ACloseButtonSize.cx, ACloseButtonSize.cy); + ASeparatorArea := Rect(ACustomizeButtonArea.Left, ACustomizeButtonArea.Top - ASeparatorHeight, + ACustomizeButtonArea.Right, ACustomizeButtonArea.Top); + if R.Right < ACustomizeButtonArea.Right then + R.Right := ACustomizeButtonArea.Right; + FSeparator.BoundsRect := Rect(ASeparatorArea.Left + ButtonOffset, + ASeparatorArea.Top + ButtonOffset, R.Right - ButtonOffset, + ASeparatorArea.Bottom); + // Calc Close Button + ACloseButtonArea := Rect(R.Right, R.Top, + R.Right + 2 * ButtonOffset + CloseButtonWidth + 2 * ButtonBorderSize, + R.Top + 2 * ButtonOffset + CloseButtonHeight + 2 * ButtonBorderSize); + FCloseButton.SetBounds(ACloseButtonArea.Left + ButtonOffset, + ACloseButtonArea.Top + ButtonOffset, CloseButtonWidth + 2 * ButtonBorderSize, + CloseButtonHeight + 2 * ButtonBorderSize); + if R.Bottom < ACloseButtonArea.Bottom then + R.Bottom := ACloseButtonArea.Bottom; + // Total Area + R.Right := ACloseButtonArea.Right; + R.Bottom := ACustomizeButtonArea.Bottom; + InflateRect(R, FrameBorderSize, FrameBorderSize); + SetBounds(Left, Top, R.Right - R.Left, R.Bottom - R.Top); +end; +*) + +procedure TcxGridStructureNavigator.Calculate; +var + R: TRect; + ACanvas: TcxCanvas; + ACloseButtonSize: TSize; +// ACloseButtonArea: TRect; + ACustomizeButtonArea: TRect; + ASeparatorArea: TRect; + ASeparatorHeight: Integer; +begin + FStructureControl.ViewInfo.Calculate; + R := FStructureControl.ViewInfo.Bounds; + OffsetRect(R, FrameBorderSize, FrameBorderSize); + FStructureControl.BoundsRect := R; + // Calc Customize Button + ASeparatorHeight := ButtonOffset * 2; + ACanvas := FStructureControl.ViewInfo.Canvas; + ACanvas.Font := FCustomizeButton.Font; + ACloseButtonSize.cx := 2 * TextOffset + ACanvas.TextWidth(SCustomizeText) + 2 * ButtonBorderSize; + ACloseButtonSize.cy := 2 * TextOffset + ACanvas.TextHeight(SCustomizeText) + 2 * ButtonBorderSize; + ACustomizeButtonArea := Rect(R.Left, R.Bottom + ASeparatorHeight, R.Left + 2 * ButtonOffset + ACloseButtonSize.cx, + R.Bottom + ASeparatorHeight + 2 * ButtonOffset + ACloseButtonSize.cy); + FCustomizeButton.SetBounds(ACustomizeButtonArea.Left + ButtonOffset, + ACustomizeButtonArea.Top + ButtonOffset, ACloseButtonSize.cx, ACloseButtonSize.cy); + ASeparatorArea := Rect(ACustomizeButtonArea.Left, ACustomizeButtonArea.Top - ASeparatorHeight, + ACustomizeButtonArea.Right, ACustomizeButtonArea.Top); + if R.Right < ACustomizeButtonArea.Right then + R.Right := ACustomizeButtonArea.Right; + FSeparator.BoundsRect := Rect(ASeparatorArea.Left + ButtonOffset, + ASeparatorArea.Top + ButtonOffset, R.Right - ButtonOffset, + ASeparatorArea.Bottom); + {// Calc Close Button + ACloseButtonArea := Rect(R.Right, R.Top, + R.Right + 2 * ButtonOffset + CloseButtonWidth + 2 * ButtonBorderSize, + R.Top + 2 * ButtonOffset + CloseButtonHeight + 2 * ButtonBorderSize); + FCloseButton.SetBounds(ACloseButtonArea.Left + ButtonOffset, + ACloseButtonArea.Top + ButtonOffset, CloseButtonWidth + 2 * ButtonBorderSize, + CloseButtonHeight + 2 * ButtonBorderSize); + if R.Bottom < ACloseButtonArea.Bottom then + R.Bottom := ACloseButtonArea.Bottom; + // Total Area + R.Right := ACloseButtonArea.Right; + } + R.Bottom := ACustomizeButtonArea.Bottom; + InflateRect(R, FrameBorderSize, FrameBorderSize); + SetBounds(Left, Top, R.Right - R.Left, R.Bottom - R.Top); +end; + +function TcxGridStructureNavigator.CalculateBoundsRect: TRect; +begin + Result := Rect(0, 0, Width, Height); + OffsetRect(Result, Grid.ClientBounds.Right - Result.Right - NavigatorOffset, + Grid.ClientBounds.Bottom - Result.Bottom - NavigatorOffset); +end; + +procedure TcxGridStructureNavigator.Changed; +begin + if FStructureControl = nil then Exit; + Calculate; + inherited Changed; + FStructureControl.Invalidate; + NotifyEditors; +end; + +procedure TcxGridStructureNavigator.CreateDefaultComponents; +var + AViewClass: TcxCustomGridViewClass; +begin + if Grid.ViewCount <> 0 then Exit; + AViewClass := GetDefaultViewClass; + if AViewClass <> nil then + begin + FDefaultView := Grid.CreateView(AViewClass); + FDefaultView.Name := GenViewName(Grid, FDefaultView); + RestoreViewFromTemplate(GetViewTemplateRegKey, FDefaultView); + // TODO: load default + FDefaultLevel := Grid.Levels.Add; + FDefaultLevel.Name := GenLevelName(Grid, FDefaultLevel); + FDefaultLevel.GridView := FDefaultView; + end; +end; + +procedure TcxGridStructureNavigator.DrawBackground(ACanvas: TcxCanvas); +begin + FillTubeGradientRect(ACanvas.Handle, ClientBounds, clWhite, {16248293}16115935{15785423}, False); +end; + +procedure TcxGridStructureNavigator.DrawStructureControlBackground(Sender: TObject); +begin + MoveWindowOrg(FStructureControl.Canvas.Handle, -FStructureControl.Left, -FStructureControl.Top); + DrawBackground(FStructureControl.Canvas); + MoveWindowOrg(FStructureControl.Canvas.Handle, FStructureControl.Left, FStructureControl.Top); +end; + +function TcxGridStructureNavigator.GetClientBounds: TRect; +begin + Result := inherited GetClientBounds; + InflateRect(Result, -FrameBorderSize, -FrameBorderSize); +end; + +function TcxGridStructureNavigator.GetDefaultViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridAccess(Grid).GetDefaultViewClass; + if Result = nil then + Result := TcxGridDBTableView; +end; + +function TcxGridStructureNavigator.GetDesigner: IDesigner; +begin + Result := GetObjectDesigner(Grid); +end; + +procedure TcxGridStructureNavigator.NotifyEditors; +var + Msg: TMsg; +begin + if not HandleAllocated then Exit; + if not PeekMessage(Msg, Handle, CM_DeferUpdate, CM_DeferUpdate, PM_NOREMOVE) then + PostMessage(Handle, CM_DeferUpdate, 0, 0); +end; + +procedure TcxGridStructureNavigator.CloseButtonClick(Sender: TObject); +begin + // TODO: +// Visible := False; +end; + +procedure TcxGridStructureNavigator.CustomizeButtonClick(Sender: TObject); +begin + // TODO: + if GetDesigner <> nil then + ShowGridEditor(GetDesigner, Grid); +end; + +procedure TcxGridStructureNavigator.SelectComponent(AObject: TPersistent; + AClearSelection: Boolean); +begin + if AClearSelection then + FDesignHelper.SelectObject(AObject, True, False) + else + FDesignHelper.ChangeSelection(AObject); +end; + +procedure TcxGridStructureNavigator.UpdateDesigner(Sender: TObject); +begin + if GetDesigner <> nil then + GetDesigner.Modified; +end; + +procedure TcxGridStructureNavigator.CMDeferUpdate(var Message: TMessage); +begin + UpdateDesignFormEditors(Grid); +end; + +procedure TcxGridStructureNavigator.BeforeGridLoading; +begin + FreeAndNil(FDefaultLevel); + FreeAndNil(FDefaultView); +end; + +function TcxGridStructureNavigator.IsObjectSelected(AObject: TPersistent): Boolean; +begin + Result := FDesignHelper.IsObjectSelected(AObject); +end; + +procedure TcxGridStructureNavigator.SelectionChanged(ASelection: TList); + + procedure MakeObjectVisible(AObject: TPersistent); + begin + //!!! columns/rows/bands/chartitems? + if (AObject is TcxGridLevel) or (AObject is TcxCustomGridView) then + begin + if AObject is TcxCustomGridView then + AObject := TcxCustomGridView(AObject).Level; + if (AObject <> nil) and (TcxGridLevel(AObject).Control = Grid) then + TcxGridLevel(AObject).MakeVisible; + end; + end; + +begin + if MakeSelectionVisible and (ASelection.Count = 1) then + MakeObjectVisible(ASelection[0]); + FStructureControl.SyncSelection(ASelection); + if Grid.HandleAllocated then + RedrawWindow(Grid.Handle, nil, 0, RDW_INVALIDATE or RDW_ALLCHILDREN); +end; + +procedure TcxGridStructureNavigator.SelectObject(AObject: TPersistent; + AClearSelection: Boolean); +begin + MakeSelectionVisible := False; + try + SelectComponent(AObject, AClearSelection); + finally + MakeSelectionVisible := True; + end; +end; + +procedure TcxGridStructureNavigator.SelectObjects(AObjects: TList); +begin + MakeSelectionVisible := False; + try + FDesignHelper.SetSelection(AObjects); + finally + MakeSelectionVisible := True; + end; +end; + +procedure TcxGridStructureNavigator.UnselectObject(AObject: TPersistent); +begin + MakeSelectionVisible := False; + try + FDesignHelper.UnselectObject(AObject); + finally + MakeSelectionVisible := True; + end; +end; + +initialization + cxGridStructureNavigatorClass := TcxGridStructureNavigator; +{$IFDEF DELPHI6} + DesignNotificationHandler := TDesignNotificationHandler.Create; +{$ENDIF} + +finalization +{$IFDEF DELPHI6} + FreeAndNil(DesignNotificationHandler); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridStyleSheetsPreview.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridStyleSheetsPreview.pas new file mode 100644 index 00000000..e75a3c98 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridStyleSheetsPreview.pas @@ -0,0 +1,311 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridStyleSheetsPreview; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, Classes, Controls, SysUtils, cxStyles, cxGridCustomView, + cxGridLevel, cxGrid; + +implementation + +uses + cxStyleSheetEditor, cxCustomData, cxGridTableView, cxDataStorage, + cxGridCustomTableView, cxGridBandedTableView, cxGridCardView; + +type +TcxCustomViewStyleSheetEditorPreview = class(TcxStyleSheetEditorPreview) +private + FGrid: TcxGrid; +protected + RootLevel: TcxGridLevel; +public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function Control: TWinControl; override; +end; + +TcxCustomTableViewStyleSheetEditorPreview = class(TcxCustomViewStyleSheetEditorPreview) +protected + procedure CreateData; virtual; + function TableView: TcxGridTableView; virtual; abstract; + procedure SetupView; virtual; +end; + +TcxTableViewStyleSheetEditorPreview = class(TcxCustomTableViewStyleSheetEditorPreview) +private + FTableView: TcxGridTableView; +protected + function TableView: TcxGridTableView; override; +public + constructor Create(AOwner: TComponent); override; + class function GetStyleSheetClass: TcxCustomStyleSheetClass; override; + procedure SetStyleSheet(AStyleSheet: TcxCustomStyleSheet); override; +end; + +TcxBandedTableViewStyleSheetEditorPreview = class(TcxCustomTableViewStyleSheetEditorPreview) +private + FBandedTableView: TcxGridBandedTableView; +protected + function TableView: TcxGridTableView; override; +public + constructor Create(AOwner: TComponent); override; + class function GetStyleSheetClass: TcxCustomStyleSheetClass; override; + procedure SetStyleSheet(AStyleSheet: TcxCustomStyleSheet); override; +end; + +TcxCardViewStyleSheetEditorPreview = class(TcxCustomViewStyleSheetEditorPreview) +protected + FCardView: TcxGridCardView; + procedure CreateData; + procedure SetupView; +public + constructor Create(AOwner: TComponent); override; + class function GetStyleSheetClass: TcxCustomStyleSheetClass; override; + procedure SetStyleSheet(AStyleSheet: TcxCustomStyleSheet); override; +end; + +{ TcxCustomViewStyleSheetEditorPreview } +constructor TcxCustomViewStyleSheetEditorPreview.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FGrid := TcxGrid.Create(AOwner); + RootLevel := FGrid.Levels.Add; +end; + +destructor TcxCustomViewStyleSheetEditorPreview.Destroy; +begin + FGrid.Free; + inherited Destroy; +end; + +function TcxCustomViewStyleSheetEditorPreview.Control: TWinControl; +begin + Result := FGrid; +end; + +{ TcxCustomTableViewStyleSheetEditorPreview } +procedure TcxCustomTableViewStyleSheetEditorPreview.CreateData; +var + I: Integer; +begin + TableView.CreateColumn; + TableView.CreateColumn; + TableView.CreateColumn; + TableView.CreateColumn; + TableView.Columns[0].Caption := 'Text'; + TableView.Columns[1].Caption := 'Currency'; + TableView.Columns[2].Caption := 'Date'; + TableView.Columns[0].DataBinding.ValueTypeClass := TcxStringValueType; + TableView.Columns[1].DataBinding.ValueTypeClass := TcxCurrencyValueType; + TableView.Columns[2].DataBinding.ValueTypeClass := TcxDateTimeValueType; + TableView.Columns[3].DataBinding.ValueTypeClass := TcxStringValueType; + TableView.Columns[2].GroupIndex := 0; + TableView.Columns[3].Visible := False; + TableView.Preview.Visible := True; + TableView.Preview.Column := TableView.Columns[3]; + + with TableView.DataController as TcxGridDataController do + begin + BeginUpdate; + RecordCount := 3; + try + for I := 0 to 2 do + begin + Values[I, 0] := 'ABC'; + Values[I, 1] := (I + 1) * 100; + Values[I, 2] := Date - I; + Values[I, 3] := 'Check the preview style'; + end; + finally + EndUpdate; + end; + end; + TableView.DataController.Groups.FullExpand; + TableView.DataController.Summary.FooterSummaryItems.Add; + TableView.DataController.Summary.FooterSummaryItems.Items[0].Kind := skSum; + TableView.DataController.Summary.FooterSummaryItems.Items[0].ItemLink := TableView.Columns[1]; +end; + +procedure TcxCustomTableViewStyleSheetEditorPreview.SetupView; +begin + TableView.OptionsView.ColumnAutoWidth := True; + TableView.OptionsView.Footer := True; + TableView.OptionsView.Indicator := True; + TableView.OptionsData.Deleting := False; + TableView.OptionsData.Editing := False; + TableView.OptionsData.Appending := False; + TableView.OptionsData.Inserting := False; + TableView.OptionsBehavior.IncSearch := True; +end; + +{ TcxTableViewStyleSheetEditorPreview } + +constructor TcxTableViewStyleSheetEditorPreview.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FTableView := TcxGridTableView(FGrid.CreateView(TcxGridTableView)); + RootLevel.GridView := FTableView; + SetupView; + CreateData; +end; + +function TcxTableViewStyleSheetEditorPreview.TableView: TcxGridTableView; +begin + Result := FTableView; +end; + +class function TcxTableViewStyleSheetEditorPreview.GetStyleSheetClass: TcxCustomStyleSheetClass; +begin + Result := TcxGridTableViewStyleSheet; +end; + +procedure TcxTableViewStyleSheetEditorPreview.SetStyleSheet(AStyleSheet: TcxCustomStyleSheet); +begin + FTableView.Styles.StyleSheet := AStyleSheet; +end; + +{ TcxBandedTableViewStyleSheetEditorPreview } + +constructor TcxBandedTableViewStyleSheetEditorPreview.Create(AOwner: TComponent); +var + I: Integer; +begin + inherited Create(AOwner); + FBandedTableView := TcxGridBandedTableView(FGrid.CreateView(TcxGridBandedTableView)); + RootLevel.GridView := FBandedTableView; + SetupView; + CreateData; + FBandedTableView.OptionsView.BandHeaders := True; + FBandedTableView.Bands.Add; + FBandedTableView.Bands[0].Caption := 'Band'; + for I := 0 to FBandedTableView.ColumnCount - 1 do + FBandedTableView.Columns[I].Position.BandIndex := 0; +end; + +function TcxBandedTableViewStyleSheetEditorPreview.TableView: TcxGridTableView; +begin + Result := FBandedTableView; +end; + +class function TcxBandedTableViewStyleSheetEditorPreview.GetStyleSheetClass: TcxCustomStyleSheetClass; +begin + Result := TcxGridBandedTableViewStyleSheet; +end; + +procedure TcxBandedTableViewStyleSheetEditorPreview.SetStyleSheet(AStyleSheet: TcxCustomStyleSheet); +begin + FBandedTableView.Styles.StyleSheet := AStyleSheet; +end; + +{ TcxCardViewStyleSheetEditorPreview } +constructor TcxCardViewStyleSheetEditorPreview.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FCardView := TcxGridCardView(FGrid.CreateView(TcxGridCardView)); + RootLevel.GridView := FCardView; + SetupView; + CreateData; +end; + +class function TcxCardViewStyleSheetEditorPreview.GetStyleSheetClass: TcxCustomStyleSheetClass; +begin + Result := TcxGridCardViewStyleSheet; +end; + +procedure TcxCardViewStyleSheetEditorPreview.CreateData; +var + I: Integer; +begin + FCardView.CreateRow; + FCardView.CreateRow; + FCardView.CreateRow; + FCardView.CreateRow; + FCardView.Rows[0].Caption := 'Caption'; + FCardView.Rows[0].Kind := rkCaption; + FCardView.Rows[1].Caption := 'Text'; + FCardView.Rows[2].Caption := 'Currency'; + FCardView.Rows[3].Caption := 'Date'; + FCardView.Rows[0].DataBinding.ValueTypeClass := TcxStringValueType; + FCardView.Rows[1].DataBinding.ValueTypeClass := TcxStringValueType; + FCardView.Rows[2].DataBinding.ValueTypeClass := TcxCurrencyValueType; + FCardView.Rows[3].DataBinding.ValueTypeClass := TcxDateTimeValueType; + + with FCardView.DataController as TcxGridDataController do + begin + BeginUpdate; + RecordCount := 3; + try + for I := 0 to 2 do + begin + Values[I, 0] := 'Caption'; + Values[I, 1] := 'ABC'; + Values[I, 2] := (I + 1) * 100; + Values[I, 3] := Date - I; + end; + finally + EndUpdate; + end; + end; +end; + +procedure TcxCardViewStyleSheetEditorPreview.SetupView; +begin + FCardView.OptionsData.Deleting := False; + FCardView.OptionsData.Editing := False; + FCardView.OptionsData.Appending := False; + FCardView.OptionsData.Inserting := False; + FCardView.OptionsBehavior.IncSearch := True; +end; + +procedure TcxCardViewStyleSheetEditorPreview.SetStyleSheet(AStyleSheet: TcxCustomStyleSheet); +begin + FCardView.Styles.StyleSheet := AStyleSheet; +end; + +initialization + RegisterStyleSheetEditorPreview(TcxTableViewStyleSheetEditorPreview); + RegisterStyleSheetEditorPreview(TcxBandedTableViewStyleSheetEditorPreview); + RegisterStyleSheetEditorPreview(TcxCardViewStyleSheetEditorPreview); + +finalization + UnregisterStyleSheetEditorPreview(TcxCardViewStyleSheetEditorPreview); + UnregisterStyleSheetEditorPreview(TcxBandedTableViewStyleSheetEditorPreview); + UnregisterStyleSheetEditorPreview(TcxTableViewStyleSheetEditorPreview); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridTableView.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridTableView.pas new file mode 100644 index 00000000..9a446234 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridTableView.pas @@ -0,0 +1,14104 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridTableView; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Messages, + Classes, Graphics, Controls, ImgList, Forms, Buttons, StdCtrls, ExtCtrls, ComCtrls, + cxClasses, cxControls, cxGraphics, cxLookAndFeels, cxLookAndFeelPainters, cxStyles, + cxStorage, cxPC, cxListBox, + cxContainer, cxEdit, cxTextEdit, + cxGrid, cxGridCommon, cxGridLevel, cxGridCustomView, cxGridCustomTableView, cxGridDetailsSite, + cxCustomData, cxData, cxDataStorage, cxFilter; + +const + htGridBase = 200; + htGroupByBox = htGridBase + 1; + htColumnHeader = htGridBase + 2; + htColumnHeaderHorzSizingEdge = htGridBase + 3; + htColumnHeaderFilterButton = htGridBase + 4; + htFooter = htGridBase + 5; + htFooterCell = htGridBase + 6; + htGroupFooter = htGridBase + 7; + htGroupFooterCell = htGridBase + 8; + htRowIndicator = htGridBase + 9; + htRowSizingEdge = htGridBase + 10; + htIndicator = htGridBase + 11; + htIndicatorHeader = htGridBase + 12; + htRowLevelIndent = htGridBase + 13; + htHeader = htGridBase + 14; + htGroupSummary = htGridBase + 15; + + ckHeader = 2; + ckGroupByBox = 3; + ckFooter = 4; + + cxGridDefaultIndicatorWidth = 12; + + cxGridCustomRowSeparatorDefaultWidth = 6; + cxGridCustomRowSeparatorMinWidth = 2; + + cxGridPreviewDefaultLeftIndent = 20; + cxGridPreviewDefaultMaxLineCount = 3; + cxGridPreviewDefaultRightIndent = 5; + + cxGridHeaderSizingEdgeSize = 8; + cxGridRowSizingEdgeSize = 8; + + cxGridOffice11GroupRowSeparatorWidth: Integer = 2; + + // record kind + rkFiltering = 2; + + isColumnFirst = isCustomItemLast + 1; + isFooter = isColumnFirst; + isGroupSummary = isColumnFirst + 1; + isHeader = isColumnFirst + 2; + isColumnLast = isHeader; + + bbTableFirst = bbCustomTableLast + 1; + bbFooter = bbTableFirst; + bbHeader = bbTableFirst + 1; + bbGroup = bbTableFirst + 2; + bbGroupByBox = bbTableFirst + 3; + bbIndicator = bbTableFirst + 4; + bbPreview = bbTableFirst + 5; + bbTableLast = bbPreview; + + vsTableFirst = vsCustomTableLast + 1; + vsFilterRowInfoText = vsTableFirst; + vsFooter = vsTableFirst + 1; + vsGroup = vsTableFirst + 2; + vsGroupByBox = vsTableFirst + 3; + vsGroupFooterSortedSummary = vsTableFirst + 4; + vsGroupSortedSummary = vsTableFirst + 5; + vsGroupSummary = vsTableFirst + 6; + vsHeader = vsTableFirst + 7; + vsNewItemRowInfoText = vsTableFirst + 8; + vsIndicator = vsTableFirst + 9; + vsPreview = vsTableFirst + 10; + vsTableLast = vsPreview; + +{$IFDEF BCB} + siFooter = 0; + siGroupFooter = 1; + siGroup = 2; +{$ENDIF} + +type + TcxGridTableCustomizationForm = class; + TcxGridTableController = class; + TcxCustomGridRow = class; + TcxGridMasterDataRow = class; + TcxGridGroupRow = class; + TcxGridViewData = class; + TcxGridColumnHeaderAreaPainterClass = class of TcxGridColumnHeaderAreaPainter; + TcxGridColumnContainerViewInfo = class; + TcxGridColumnHeaderAreaViewInfoClass = class of TcxGridColumnHeaderAreaViewInfo; + TcxGridColumnHeaderAreaViewInfo = class; + TcxGridColumnHeaderFilterButtonViewInfo = class; + TcxGridColumnHeaderGlyphViewInfo = class; + TcxGridColumnHeaderViewInfoClass = class of TcxGridColumnHeaderViewInfo; + TcxGridColumnHeaderViewInfo = class; + TcxGridHeaderViewInfo = class; + TcxGridGroupByBoxViewInfo = class; + TcxGridFooterViewInfo = class; + TcxCustomGridIndicatorItemViewInfo = class; + TcxGridIndicatorHeaderItemViewInfo = class; + TcxGridIndicatorRowItemViewInfo = class; + TcxGridIndicatorFooterItemViewInfo = class; + TcxGridIndicatorViewInfo = class; + TcxGridRowFooterViewInfo = class; + TcxGridRowFootersViewInfo = class; + TcxCustomGridRowViewInfo = class; + TcxGridRowsViewInfo = class; + TcxGridTableViewInfo = class; + TcxGridTableViewInfoCacheItem = class; + TcxGridColumn = class; + TcxGridTableView = class; + + TcxGridColumnContainerKind = Integer; + + { hit tests } + + // custom column + + TcxCustomGridColumnHitTest = class(TcxCustomGridViewHitTest) + public + Column: TcxGridColumn; + ColumnContainerKind: TcxGridColumnContainerKind; + end; + + // group by box + + TcxGridGroupByBoxHitTest = class(TcxCustomGridViewHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + // column header + + TcxGridColumnHeaderHitTest = class(TcxCustomGridColumnHitTest) + protected + class function GetHitTestCode: Integer; override; + public + function DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; override; + end; + + TcxGridColumnHeaderHorzSizingEdgeHitTest = class(TcxCustomGridColumnHitTest) + protected + class function GetHitTestCode: Integer; override; + public + function Cursor: TCursor; override; + function DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; override; + end; + + TcxGridColumnHeaderFilterButtonHitTest = class(TcxCustomGridColumnHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + // header + + TcxGridHeaderHitTest = class(TcxCustomGridViewHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + // footer + + TcxGridFooterHitTest = class(TcxCustomGridViewHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + TcxGridFooterCellHitTest = class(TcxCustomGridColumnHitTest) + protected + class function GetHitTestCode: Integer; override; + public + SummaryItem: TcxDataSummaryItem; + end; + + TcxGridGroupFooterHitTest = class(TcxGridFooterHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + TcxGridGroupFooterCellHitTest = class(TcxGridFooterCellHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + // indicator + + TcxGridRowIndicatorHitTest = class(TcxGridRecordHitTest) + protected + class function GetHitTestCode: Integer; override; + public + MultiSelect: Boolean; + function Cursor: TCursor; override; + end; + + TcxGridRowSizingEdgeHitTest = class(TcxGridRecordHitTest) + protected + class function GetHitTestCode: Integer; override; + public + function Cursor: TCursor; override; + function DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; override; + end; + + TcxGridIndicatorHitTest = class(TcxCustomGridViewHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + TcxGridIndicatorHeaderHitTest = class(TcxGridIndicatorHitTest) + protected + class function GetHitTestCode: Integer; override; + end; + + // row + + TcxGridRowLevelIndentHitTest = class(TcxGridRecordHitTest) + protected + class function GetHitTestCode: Integer; override; + public + class function CanClick: Boolean; override; + end; + + TcxGridGroupSummaryHitTest = class(TcxGridRecordHitTest) + private + function GetColumn: TcxGridColumn; + protected + class function GetHitTestCode: Integer; override; + public + SummaryItem: TcxDataSummaryItem; + property Column: TcxGridColumn read GetColumn; + end; + + { view data } + + TcxCustomGridRowClass = class of TcxCustomGridRow; + + TcxCustomGridRow = class(TcxCustomGridRecord) + private + function GetAsGroupRow: TcxGridGroupRow; + function GetAsMasterDataRow: TcxGridMasterDataRow; + function GetGridView: TcxGridTableView; + function GetGridViewLevel: TcxGridLevel; + function GetIsFilterRow: Boolean; + function GetIsNewItemRow: Boolean; + function GetViewData: TcxGridViewData; + protected + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + public + function ExpandOnDblClick: Boolean; virtual; + function SupportsCellMultiSelect: Boolean; virtual; + + property AsGroupRow: TcxGridGroupRow read GetAsGroupRow; + property AsMasterDataRow: TcxGridMasterDataRow read GetAsMasterDataRow; + property GridView: TcxGridTableView read GetGridView; + property GridViewLevel: TcxGridLevel read GetGridViewLevel; + property IsFilterRow: Boolean read GetIsFilterRow; + property IsNewItemRow: Boolean read GetIsNewItemRow; + property ViewData: TcxGridViewData read GetViewData; + end; + + TcxGridDataRow = class(TcxCustomGridRow) + protected + function GetHasCells: Boolean; override; + function GetViewInfoCacheItemClass: TcxCustomGridViewInfoCacheItemClass; override; + function GetViewInfoClass: TcxCustomGridRecordViewInfoClass; override; + public + function SupportsCellMultiSelect: Boolean; override; + end; + + TcxGridNewItemRowClass = class of TcxGridNewItemRow; + + TcxGridNewItemRow = class(TcxGridDataRow) + public + function SupportsCellMultiSelect: Boolean; override; + end; + + TcxGridFilterRowClass = class of TcxGridFilterRow; + + TcxGridFilterRow = class(TcxGridNewItemRow) + private + FSelected: Boolean; + function GetFilterCriteriaItem(Index: Integer): TcxFilterCriteriaItem; + protected + procedure RefreshRecordInfo; override; + + function GetSelected: Boolean; override; + function GetVisible: Boolean; override; + procedure SetSelected(Value: Boolean); override; + + function GetDisplayText(Index: Integer): string; override; + function GetValue(Index: Integer): Variant; override; + procedure SetDisplayText(Index: Integer; const Value: string); override; + procedure SetValue(Index: Integer; const Value: Variant); override; + + function GetDisplayTextForValue(AIndex: Integer; const AValue: Variant): string; virtual; + function GetFilterOperatorKind(const AValue: Variant; ACheckMask: Boolean): TcxFilterOperatorKind; virtual; + function IsFilterOperatorSupported(AKind: TcxFilterOperatorKind; const AValue: Variant): Boolean; virtual; + + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + + property FilterCriteriaItems[Index: Integer]: TcxFilterCriteriaItem read GetFilterCriteriaItem; + property InternalSelected: Boolean read FSelected write FSelected; + public + destructor Destroy; override; + function CanFocusCells: Boolean; override; + function IsEmpty: Boolean; + end; + + TcxGridMasterDataRow = class(TcxGridDataRow) + private + function GetActiveDetailGridView: TcxCustomGridView; + function GetActiveDetailGridViewExists: Boolean; + function GetActiveDetailIndex: Integer; + function GetActiveDetailLevel: TcxGridLevel; + function GetDetailGridView(Index: Integer): TcxCustomGridView; + function GetDetailGridViewCount: Integer; + function GetDetailGridViewExists(Index: Integer): Boolean; + function GetDetailGridViewHasData(Index: Integer): Boolean; + function GetInternalActiveDetailGridView: TcxCustomGridView; + function GetInternalActiveDetailGridViewExists: Boolean; + function GetInternalActiveDetailIndex: Integer; + procedure SetActiveDetailIndex(Value: Integer); + procedure SetActiveDetailLevel(Value: TcxGridLevel); + protected + procedure DoCollapse(ARecurse: Boolean); override; + procedure DoExpand(ARecurse: Boolean); override; + function GetExpandable: Boolean; override; + function GetExpanded: Boolean; override; + function GetHasChildren: Boolean; virtual; + function GetViewInfoCacheItemClass: TcxCustomGridViewInfoCacheItemClass; override; + function GetViewInfoClass: TcxCustomGridRecordViewInfoClass; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure ToggleExpanded; override; + property InternalActiveDetailGridView: TcxCustomGridView read GetInternalActiveDetailGridView; + property InternalActiveDetailGridViewExists: Boolean read GetInternalActiveDetailGridViewExists; + property InternalActiveDetailIndex: Integer read GetInternalActiveDetailIndex; + public + function ExpandOnDblClick: Boolean; override; + function GetFirstFocusableChild: TcxCustomGridRecord; override; + function GetLastFocusableChild(ARecursive: Boolean): TcxCustomGridRecord; override; + + property ActiveDetailGridView: TcxCustomGridView read GetActiveDetailGridView; + property ActiveDetailGridViewExists: Boolean read GetActiveDetailGridViewExists; + property ActiveDetailIndex: Integer read GetActiveDetailIndex write SetActiveDetailIndex; + property ActiveDetailLevel: TcxGridLevel read GetActiveDetailLevel write SetActiveDetailLevel; + property DetailGridViewCount: Integer read GetDetailGridViewCount; + property DetailGridViewExists[Index: Integer]: Boolean read GetDetailGridViewExists; + property DetailGridViewHasData[Index: Integer]: Boolean read GetDetailGridViewHasData; + property DetailGridViews[Index: Integer]: TcxCustomGridView read GetDetailGridView; + property HasChildren: Boolean read GetHasChildren; + end; + + TcxGridGroupRow = class(TcxCustomGridRow) + private + function GetGroupedColumn: TcxGridColumn; + function GetGroupSummaryItems: TcxDataGroupSummaryItems; + protected + procedure DoCollapse(ARecurse: Boolean); override; + procedure DoExpand(ARecurse: Boolean); override; + //function GetDestroyingOnExpanding: Boolean; override; + function GetExpandable: Boolean; override; + function GetExpanded: Boolean; override; + + function GetDisplayCaption: string; virtual; + function GetDisplayText(Index: Integer): string; override; + function GetDisplayTextValue: string; virtual; + function GetIsData: Boolean; override; + function GetIsParent: Boolean; override; + function GetValue: Variant; reintroduce; virtual; + function GetViewInfoCacheItemClass: TcxCustomGridViewInfoCacheItemClass; override; + function GetViewInfoClass: TcxCustomGridRecordViewInfoClass; override; + procedure SetDisplayText(Index: Integer; const Value: string); override; + procedure SetValue(Index: Integer; const Value: Variant); override; + public + function GetGroupSummaryInfo(var ASummaryItems: TcxDataSummaryItems; + var ASummaryValues: PVariant): Boolean; + + property DisplayCaption: string read GetDisplayCaption; + property DisplayText: string read GetDisplayTextValue; + property GroupedColumn: TcxGridColumn read GetGroupedColumn; + property GroupSummaryItems: TcxDataGroupSummaryItems read GetGroupSummaryItems; + property Value: Variant read GetValue; + end; + + TcxGridViewData = class(TcxCustomGridTableViewData) + private + FFilterRow: TcxGridFilterRow; + function GetNewItemRow: TcxGridNewItemRow; + function GetRow(Index: Integer): TcxCustomGridRow; + function GetRowCount: Integer; + protected + function GetFirstVisibleExpandedMasterRow: TcxGridMasterDataRow; virtual; + function GetNewItemRecordClass: TcxCustomGridRecordClass; override; + function GetRecordByKind(AKind, AIndex: Integer): TcxCustomGridRecord; override; + function GetRecordClass(ARecordInfo: TcxRowInfo): TcxCustomGridRecordClass; override; + function GetRecordKind(ARecord: TcxCustomGridRecord): Integer; override; + + procedure CreateFilterRow; + procedure DestroyFilterRow; + procedure CheckFilterRow; + //procedure RecreateFilterRow; + function GetFilterRowClass: TcxGridFilterRowClass; virtual; + public + destructor Destroy; override; + procedure Collapse(ARecurse: Boolean); override; + procedure Expand(ARecurse: Boolean); override; + function HasFilterRow: Boolean; virtual; + function HasNewItemRecord: Boolean; override; + function MakeDetailVisible(ADetailLevel: TComponent{TcxGridLevel}): TcxCustomGridView; override; + //procedure Refresh(ARecordCount: Integer); override; + + property FilterRow: TcxGridFilterRow read FFilterRow; + property NewItemRow: TcxGridNewItemRow read GetNewItemRow; + property RowCount: Integer read GetRowCount; + property Rows[Index: Integer]: TcxCustomGridRow read GetRow; + end; + + { controller } + + // drag&drop objects + + TcxGridColumnHeaderMovingObjectClass = class of TcxGridColumnHeaderMovingObject; + + TcxGridColumnHeaderMovingObject = class(TcxCustomGridTableItemMovingObject) + private + FOriginalDestColumnContainerKind: TcxGridColumnContainerKind; + + function GetGridView: TcxGridTableView; + function GetSourceItem: TcxGridColumn; + function GetViewInfo: TcxGridTableViewInfo; + procedure SetSourceItem(Value: TcxGridColumn); + protected + procedure CalculateDestParams(AHitTest: TcxCustomGridHitTest; + out AContainerKind: TcxGridItemContainerKind; out AZone: TcxGridItemContainerZone); override; + function CanRemove: Boolean; override; + procedure CheckDestItemContainerKind(var AValue: TcxGridItemContainerKind); override; + procedure DoColumnMoving; virtual; + function GetArrowAreaBounds(APlace: TcxGridArrowPlace): TRect; override; + function GetArrowAreaBoundsForHeader(APlace: TcxGridArrowPlace): TRect; virtual; + function GetArrowsClientRect: TRect; override; + function GetSourceItemViewInfo: TcxCustomGridCellViewInfo; override; + function IsValidDestination: Boolean; override; + function IsValidDestinationForVisibleSource: Boolean; virtual; + + procedure EndDragAndDrop(Accepted: Boolean); override; + + property GridView: TcxGridTableView read GetGridView; + property OriginalDestColumnContainerKind: TcxGridColumnContainerKind + read FOriginalDestColumnContainerKind write FOriginalDestColumnContainerKind; + property SourceItem: TcxGridColumn read GetSourceItem write SetSourceItem; + property ViewInfo: TcxGridTableViewInfo read GetViewInfo; + public + procedure Init(const P: TPoint; AParams: TcxCustomGridHitTest); override; + end; + + TcxCustomGridSizingObject = class(TcxCustomGridDragAndDropObject) + private + FDestPointX: Integer; + FDestPointY: Integer; + FOriginalSize: Integer; + function GetController: TcxGridTableController; + function GetGridView: TcxGridTableView; + function GetViewInfo: TcxGridTableViewInfo; + procedure SetDestPointX(Value: Integer); + procedure SetDestPointY(Value: Integer); + protected + procedure DirtyChanged; override; + function GetCurrentSize: Integer; virtual; + function GetDeltaSize: Integer; virtual; + function GetDragAndDropCursor(Accepted: Boolean): TCursor; override; + function GetHorzSizingMarkBounds: TRect; virtual; + function GetImmediateStart: Boolean; override; + function GetIsHorizontalSizing: Boolean; virtual; + function GetSizingItemBounds: TRect; virtual; abstract; + function GetSizingMarkBounds: TRect; virtual; + function GetSizingMarkWidth: Integer; virtual; abstract; + function GetVertSizingMarkBounds: TRect; virtual; + + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); override; + + property Controller: TcxGridTableController read GetController; + property CurrentSize: Integer read GetCurrentSize; + property DeltaSize: Integer read GetDeltaSize; + property DestPointX: Integer read FDestPointX write SetDestPointX; + property DestPointY: Integer read FDestPointY write SetDestPointY; + property GridView: TcxGridTableView read GetGridView; + property IsHorizontalSizing: Boolean read GetIsHorizontalSizing; + property OriginalSize: Integer read FOriginalSize write FOriginalSize; + property SizingItemBounds: TRect read GetSizingItemBounds; + property SizingMarkBounds: TRect read GetSizingMarkBounds; + property SizingMarkWidth: Integer read GetSizingMarkWidth; + property ViewInfo: TcxGridTableViewInfo read GetViewInfo; + public + procedure Init(const P: TPoint; AParams: TcxCustomGridHitTest); override; + end; + + TcxCustomGridColumnSizingObject = class(TcxCustomGridSizingObject) + private + FColumn: TcxGridColumn; + function GetColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo; + protected + function GetSizingItemBounds: TRect; override; + function GetSizingMarkWidth: Integer; override; + property Column: TcxGridColumn read FColumn write FColumn; + property ColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo read GetColumnHeaderViewInfo; + public + procedure Init(const P: TPoint; AParams: TcxCustomGridHitTest); override; + end; + + TcxGridColumnHorzSizingObject = class(TcxCustomGridColumnSizingObject) + protected + procedure BeginDragAndDrop; override; + procedure EndDragAndDrop(Accepted: Boolean); override; + function GetCurrentSize: Integer; override; + end; + + TcxGridRowSizingObject = class(TcxCustomGridSizingObject) + private + FRow: TcxCustomGridRow; + function GetRowViewInfo: TcxCustomGridRowViewInfo; + protected + procedure BeginDragAndDrop; override; + procedure EndDragAndDrop(Accepted: Boolean); override; + function GetCurrentSize: Integer; override; + function GetIsHorizontalSizing: Boolean; override; + function GetSizingItemBounds: TRect; override; + function GetSizingMarkWidth: Integer; override; + property Row: TcxCustomGridRow read FRow; + property RowViewInfo: TcxCustomGridRowViewInfo read GetRowViewInfo; + public + procedure Init(const P: TPoint; AParams: TcxCustomGridHitTest); override; + end; + + // customization form + + TcxGridTableItemsListBox = class(TcxCustomGridTableItemsListBox) + private + function GetGridView: TcxGridTableView; + protected + function CalculateItemHeight: Integer; override; + function DrawItemDrawBackgroundHandler(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; virtual; abstract; + function GetItemEndEllipsis: Boolean; virtual; abstract; + property GridView: TcxGridTableView read GetGridView; + public + constructor Create(AOwner: TComponent); override; + procedure PaintItem(ACanvas: TcxCanvas; R: TRect; AIndex: Integer; AFocused: Boolean); override; + end; + + TcxGridTableColumnsListBox = class(TcxGridTableItemsListBox) + protected + function DrawItemDrawBackgroundHandler(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; override; + function GetDragAndDropParams: TcxCustomGridHitTest; override; + function GetItemEndEllipsis: Boolean; override; + public + procedure RefreshItems; override; + end; + + TcxGridTableCustomizationForm = class(TcxCustomGridTableCustomizationForm) + private + function GetColumnsListBox: TcxGridTableColumnsListBox; + function GetColumnsPage: TcxTabSheet; + function GetController: TcxGridTableController; + function GetGridView: TcxGridTableView; + function GetViewInfo: TcxGridTableViewInfo; + protected + function GetItemsListBoxClass: TcxCustomGridTableItemsListBoxClass; override; + function GetItemsPageCaption: string; override; + + property ColumnsListBox: TcxGridTableColumnsListBox read GetColumnsListBox; + property GridView: TcxGridTableView read GetGridView; + property ViewInfo: TcxGridTableViewInfo read GetViewInfo; + public + property Controller: TcxGridTableController read GetController; + property ColumnsPage: TcxTabSheet read GetColumnsPage; + end; + + // drag open info + + TcxGridDragOpenInfoMasterDataRowTab = class(TcxGridDragOpenInfoTab) + public + GridRow: TcxGridMasterDataRow; + constructor Create(ALevel: TcxGridLevel; AGridRow: TcxGridMasterDataRow); reintroduce; virtual; + function Equals(AInfo: TcxCustomGridDragOpenInfo): Boolean; override; + procedure Run; override; + end; + + // popup + + TcxGridColumnsCustomizationPopup = class(TcxCustomGridItemsCustomizationPopup) + private + function GetGridView: TcxGridTableView; + protected + procedure ItemClicked(AItem: TObject; AChecked: Boolean); override; + procedure SetItemIndex(AItem: TObject; AIndex: Integer); override; + public + property GridView: TcxGridTableView read GetGridView; + end; + + // controllers + + TcxGridTableEditingController = class(TcxGridEditingController) + private + FApplyingImmediateFiltering: Boolean; + function GetController: TcxGridTableController; + function GetGridView: TcxGridTableView; + protected + function CanInitEditing: Boolean; override; + function CanUpdateEditValue: Boolean; override; + procedure DoEditChanged; override; + procedure DoEditKeyDown(var Key: Word; Shift: TShiftState); override; + function GetHideEditOnFocusedRecordChange: Boolean; override; + procedure InitEdit; override; + procedure PostEditingData; override; + property ApplyingImmediateFiltering: Boolean read FApplyingImmediateFiltering write FApplyingImmediateFiltering; + public + property Controller: TcxGridTableController read GetController; + property GridView: TcxGridTableView read GetGridView; + end; + + TcxGridTableController = class(TcxCustomGridTableController) + private + FCellSelectionAnchor: TcxGridColumn; + FHorzSizingColumn: TcxGridColumn; + FIsFilterPopupOpenedFromHeader: Boolean; + FKeepFilterRowFocusing: Boolean; + FLeftPos: Integer; + FPressedColumn: TcxGridColumn; + FSelectedColumns: TList; + + function GetColumnsCustomizationPopup: TcxGridColumnsCustomizationPopup; + function GetCustomizationForm: TcxGridTableCustomizationForm; + function GetEditingController: TcxGridTableEditingController; + function GetFocusedColumn: TcxGridColumn; + function GetFocusedColumnIndex: Integer; + function GetFocusedRow: TcxCustomGridRow; + function GetFocusedRowIndex: Integer; + function GetGridView: TcxGridTableView; + function GetIsColumnHorzSizing: Boolean; + function GetSelectedColumn(Index: Integer): TcxGridColumn; + function GetSelectedColumnCount: Integer; + function GetSelectedRow(Index: Integer): TcxCustomGridRow; + function GetSelectedRowCount: Integer; + function GetTopRowIndex: Integer; + function GetViewData: TcxGridViewData; + function GetViewInfo: TcxGridTableViewInfo; + procedure SetFocusedColumn(Value: TcxGridColumn); + procedure SetFocusedColumnIndex(Value: Integer); + procedure SetFocusedRow(Value: TcxCustomGridRow); + procedure SetFocusedRowIndex(Value: Integer); + procedure SetLeftPos(Value: Integer); + procedure SetPressedColumn(Value: TcxGridColumn); + procedure SetTopRowIndex(Value: Integer); + + procedure AddSelectedColumn(AColumn: TcxGridColumn); + procedure RemoveSelectedColumn(AColumn: TcxGridColumn); + protected + function CanAppend(ACheckOptions: Boolean): Boolean; override; + function CanDelete(ACheckOptions: Boolean): Boolean; override; + function CanEdit: Boolean; override; + function CanInsert(ACheckOptions: Boolean): Boolean; override; + procedure CheckCoordinates; override; + procedure CheckLeftPos(var Value: Integer); + procedure FocusedItemChanged(APrevFocusedItem: TcxCustomGridTableItem); override; + procedure FocusedRecordChanged(APrevFocusedRecordIndex, AFocusedRecordIndex: Integer; + ANewItemRecordFocusingChanged: Boolean); override; + function GetDesignHitTest(AHitTest: TcxCustomGridHitTest): Boolean; override; + function GetFocusedRecord: TcxCustomGridRecord; override; + function GetIsRecordsScrollHorizontal: Boolean; override; + function GetItemsCustomizationPopupClass: TcxCustomGridItemsCustomizationPopupClass; override; + function GetMaxTopRecordIndexValue: Integer; override; + function GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; override; + function GetScrollBarRecordCount: Integer; override; + function IsColumnFixedDuringHorzSizing(AColumn: TcxGridColumn): Boolean; virtual; + function IsKeyForMultiSelect(AKey: Word; AShift: TShiftState; + AFocusedRecordChanged: Boolean): Boolean; override; + function IsPixelScrollBar(AKind: TScrollBarKind): Boolean; override; + procedure LeftPosChanged; virtual; + function NeedsAdditionalRowsScrolling(AIsCallFromMaster: Boolean = False): Boolean; virtual; + procedure RemoveFocus; override; + procedure ScrollData(ADirection: TcxDirection); override; + procedure SetFocusedRecord(Value: TcxCustomGridRecord); override; + procedure ShowNextPage; override; + procedure ShowPrevPage; override; + + // internal draganddrop data scrolling + function CanScrollData(ADirection: TcxDirection): Boolean; override; + + // selection + function CanPostponeRecordSelection: Boolean; override; + function CanProcessMultiSelect(AHitTest: TcxCustomGridHitTest; + AShift: TShiftState): Boolean; override; + procedure DoMouseNormalSelection(AHitTest: TcxCustomGridHitTest); override; + procedure DoMouseRangeSelection(AClearSelection: Boolean = True; AData: TObject = nil); override; + procedure DoNormalSelection; override; + procedure MultiSelectKeyDown(var Key: Word; Shift: TShiftState); override; + function SupportsAdditiveSelection: Boolean; override; + function SupportsRecordSelectionToggling: Boolean; override; + + // special row focusing + function DefocusSpecialRow: Boolean; virtual; + function FocusSpecialRow: Boolean; virtual; + procedure FilterRowFocusChanged; virtual; + procedure FilterRowFocusChanging(AValue: Boolean); virtual; + + // pull focusing + procedure DoPullFocusingScrolling(ADirection: TcxDirection); override; + function GetPullFocusingScrollingDirection(X, Y: Integer; out ADirection: TcxDirection): Boolean; override; + function SupportsPullFocusing: Boolean; override; + + // delphi drag and drop + function GetDragOpenInfo(AHitTest: TcxCustomGridHitTest): TcxCustomGridDragOpenInfo; override; + function GetDragScrollDirection(X, Y: Integer): TcxDirection; override; + + // customization + procedure CheckCustomizationFormBounds(var R: TRect); override; + function GetColumnHeaderDragAndDropObjectClass: TcxGridColumnHeaderMovingObjectClass; virtual; + function GetCustomizationFormClass: TcxCustomGridCustomizationFormClass; override; + + // cells selection + function CanProcessCellMultiSelect(APrevFocusedColumn: TcxGridColumn): Boolean; virtual; + procedure CellMultiSelectKeyDown(var Key: Word; Shift: TShiftState); virtual; + procedure DoNormalCellSelection; + procedure DoRangeCellSelection; + function GetCellMultiSelect: Boolean; virtual; + property CellMultiSelect: Boolean read GetCellMultiSelect; + + // BeginsWith mask + procedure AddBeginsWithMask(var AValue: Variant); + procedure RemoveBeginsWithMask(var AValue: Variant); + function GetBeginsWithMaskPos(const AValue: string): Integer; + + function GetEditingControllerClass: TcxGridEditingControllerClass; override; + + property IsFilterPopupOpenedFromHeader: Boolean read FIsFilterPopupOpenedFromHeader + write FIsFilterPopupOpenedFromHeader; + property KeepFilterRowFocusing: Boolean read FKeepFilterRowFocusing write FKeepFilterRowFocusing; + property ViewData: TcxGridViewData read GetViewData; + property ViewInfo: TcxGridTableViewInfo read GetViewInfo; + public + constructor Create(AGridView: TcxCustomGridView); override; + destructor Destroy; override; + procedure CheckScrolling(const P: TPoint); override; + procedure ClearGrouping; + procedure ClearSelection; override; + procedure DoCancelMode; override; + function IsFilterRowFocused: Boolean; + function IsNewItemRowFocused: Boolean; + function IsSpecialRowFocused: Boolean; virtual; + procedure MakeItemVisible(AItem: TcxCustomGridTableItem); override; + procedure SelectAll; override; + + procedure InitScrollBarsParameters; override; + function IsDataFullyVisible(AIsCallFromMaster: Boolean = False): Boolean; override; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); override; + + procedure EndDragAndDrop(Accepted: Boolean); override; + + procedure DoKeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + + // cells selection + procedure ClearCellSelection; + procedure SelectAllColumns; + procedure SelectCells(AFromColumn, AToColumn: TcxGridColumn; + AFromRowIndex, AToRowIndex: Integer); + procedure SelectColumns(AFromColumn, AToColumn: TcxGridColumn); + + property CellSelectionAnchor: TcxGridColumn read FCellSelectionAnchor write FCellSelectionAnchor; + property ColumnsCustomizationPopup: TcxGridColumnsCustomizationPopup read GetColumnsCustomizationPopup; + property CustomizationForm: TcxGridTableCustomizationForm read GetCustomizationForm; + property EditingController: TcxGridTableEditingController read GetEditingController; + property FocusedColumn: TcxGridColumn read GetFocusedColumn write SetFocusedColumn; + property FocusedColumnIndex: Integer read GetFocusedColumnIndex write SetFocusedColumnIndex; + property FocusedRow: TcxCustomGridRow read GetFocusedRow write SetFocusedRow; + property FocusedRowIndex: Integer read GetFocusedRowIndex write SetFocusedRowIndex; + property GridView: TcxGridTableView read GetGridView; + property HorzSizingColumn: TcxGridColumn read FHorzSizingColumn; + property IsColumnHorzSizing: Boolean read GetIsColumnHorzSizing; + property LeftPos: Integer read FLeftPos write SetLeftPos; + property PressedColumn: TcxGridColumn read FPressedColumn write SetPressedColumn; + property SelectedColumnCount: Integer read GetSelectedColumnCount; + property SelectedColumns[Index: Integer]: TcxGridColumn read GetSelectedColumn; + property SelectedRowCount: Integer read GetSelectedRowCount; + property SelectedRows[Index: Integer]: TcxCustomGridRow read GetSelectedRow; + property TopRowIndex: Integer read GetTopRowIndex write SetTopRowIndex; + end; + + { painters } + + // column container + + TcxGridColumnContainerPainter = class(TcxCustomGridPartPainter) + private + function GetViewInfo: TcxGridColumnContainerViewInfo; + protected + procedure DrawContent; override; + procedure DrawItems; virtual; + function DrawItemsFirst: Boolean; virtual; + function ExcludeFromClipRect: Boolean; override; + property ViewInfo: TcxGridColumnContainerViewInfo read GetViewInfo; + end; + + // header + + TcxGridColumnHeaderAreaPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridColumnHeaderAreaViewInfo; + protected + function ExcludeFromClipRect: Boolean; override; + property ViewInfo: TcxGridColumnHeaderAreaViewInfo read GetViewInfo; + end; + + TcxGridColumnHeaderSortingMarkPainter = class(TcxGridColumnHeaderAreaPainter) + protected + procedure Paint; override; + end; + + TcxGridColumnHeaderFilterButtonPainter = class(TcxGridColumnHeaderAreaPainter) + private + function GetViewInfo: TcxGridColumnHeaderFilterButtonViewInfo; + protected + procedure Paint; override; + property ViewInfo: TcxGridColumnHeaderFilterButtonViewInfo read GetViewInfo; + end; + + TcxGridColumnHeaderGlyphPainter = class(TcxGridColumnHeaderAreaPainter) + private + function GetViewInfo: TcxGridColumnHeaderGlyphViewInfo; + protected + procedure Paint; override; + property ViewInfo: TcxGridColumnHeaderGlyphViewInfo read GetViewInfo; + end; + + TcxGridColumnHeaderPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridColumnHeaderViewInfo; + protected + procedure DrawAreas; virtual; + procedure DrawBorders; override; + procedure DrawContent; override; + procedure DrawPressed; virtual; + function ExcludeFromClipRect: Boolean; override; + procedure Paint; override; + property ViewInfo: TcxGridColumnHeaderViewInfo read GetViewInfo; + end; + + TcxGridHeaderPainter = class(TcxGridColumnContainerPainter) + protected + function DrawItemsFirst: Boolean; override; + end; + + // group by box + + TcxGridGroupByBoxPainter = class(TcxGridColumnContainerPainter) + protected + procedure DrawBackground(const R: TRect); override; + procedure DrawContent; override; + function DrawItemsFirst: Boolean; override; + end; + + // footer + + TcxGridFooterCellPainter = class(TcxGridColumnHeaderPainter) + protected + procedure DrawBorders; override; + procedure DrawContent; override; + end; + + TcxGridFooterPainterClass = class of TcxGridFooterPainter; + + TcxGridFooterPainter = class(TcxGridColumnContainerPainter) + private + function GetViewInfo: TcxGridFooterViewInfo; + protected + procedure DrawBackground(const R: TRect); override; + procedure DrawBorders; override; + function DrawItemsFirst: Boolean; override; + procedure DrawSeparator; virtual; + property ViewInfo: TcxGridFooterViewInfo read GetViewInfo; + end; + + // indicator + + TcxCustomGridIndicatorItemPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxCustomGridIndicatorItemViewInfo; + protected + function ExcludeFromClipRect: Boolean; override; + property ViewInfo: TcxCustomGridIndicatorItemViewInfo read GetViewInfo; + end; + + TcxGridIndicatorHeaderItemPainter = class(TcxCustomGridIndicatorItemPainter) + private + function GetViewInfo: TcxGridIndicatorHeaderItemViewInfo; + protected + function DrawBackgroundHandler(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; override; + procedure DrawContent; override; + procedure DrawQuickCustomizationMark; virtual; + property ViewInfo: TcxGridIndicatorHeaderItemViewInfo read GetViewInfo; + end; + + TcxGridIndicatorRowItemPainter = class(TcxCustomGridIndicatorItemPainter) + private + function GetViewInfo: TcxGridIndicatorRowItemViewInfo; + protected + procedure DrawContent; override; + property ViewInfo: TcxGridIndicatorRowItemViewInfo read GetViewInfo; + end; + + TcxGridIndicatorFooterItemPainter = class(TcxCustomGridIndicatorItemPainter) + private + function GetViewInfo: TcxGridIndicatorFooterItemViewInfo; + protected + procedure DrawContent; override; + procedure DrawBorders; override; + property ViewInfo: TcxGridIndicatorFooterItemViewInfo read GetViewInfo; + end; + + TcxGridIndicatorPainter = class(TcxCustomGridCellPainter) + private + function GetViewInfo: TcxGridIndicatorViewInfo; + protected + procedure DrawContent; override; + procedure DrawItems; virtual; + function DrawItemsFirst: Boolean; virtual; + function ExcludeFromClipRect: Boolean; override; + property ViewInfo: TcxGridIndicatorViewInfo read GetViewInfo; + end; + + // custom row + + TcxCustomGridRowPainter = class(TcxCustomGridRecordPainter) + private + function GetViewInfo: TcxCustomGridRowViewInfo; + protected + procedure DrawFooters; virtual; + procedure DrawIndent; virtual; + procedure DrawIndentPart(ALevel: Integer; const ABounds: TRect); virtual; + procedure DrawLastHorzGridLine; virtual; + procedure DrawSeparator; virtual; + procedure Paint; override; + property ViewInfo: TcxCustomGridRowViewInfo read GetViewInfo; + end; + + // rows + + TcxGridRowsPainterClass = class of TcxGridRowsPainter; + + TcxGridRowsPainter = class(TcxCustomGridRecordsPainter) + private + function GetViewInfo: TcxGridRowsViewInfo; + protected + procedure Paint; override; + property ViewInfo: TcxGridRowsViewInfo read GetViewInfo; + public + class procedure DrawDataRowCells(ARowViewInfo: TcxCustomGridRowViewInfo); virtual; + end; + + // table + + TcxGridTablePainter = class(TcxCustomGridTablePainter) + private + FGridLines: TList; + function GetController: TcxGridTableController; + function GetGridView: TcxGridTableView; + function GetViewInfo: TcxGridTableViewInfo; + protected + function CanOffset(AItemsOffset, DX, DY: Integer): Boolean; override; + procedure DrawFooter; virtual; + procedure DrawGroupByBox; virtual; + procedure DrawHeader; virtual; + procedure DrawIndicator; virtual; + procedure DrawRecords; override; + procedure Offset(AItemsOffset: Integer); override; + procedure Offset(DX, DY: Integer); override; + procedure PaintContent; override; + public + procedure AddGridLine(const R: TRect); + property Controller: TcxGridTableController read GetController; + property GridView: TcxGridTableView read GetGridView; + property ViewInfo: TcxGridTableViewInfo read GetViewInfo; + end; + + { view infos } + + // column container + + TcxGridColumnContainerViewInfo = class(TcxCustomGridPartViewInfo) + private + FItemHeight: Integer; + FItems: TList; + function GetController: TcxGridTableController; + function GetCount: Integer; + function GetGridView: TcxGridTableView; + function GetGridViewInfo: TcxGridTableViewInfo; + function GetInternalItem(Index: Integer): TcxGridColumnHeaderViewInfo; + function GetItem(Index: Integer): TcxGridColumnHeaderViewInfo; + function GetItemHeight: Integer; + protected + function CreateItem(AIndex: Integer): TcxGridColumnHeaderViewInfo; virtual; + procedure CreateItems; virtual; + procedure DestroyItems; virtual; + function GetColumn(Index: Integer): TcxGridColumn; virtual; abstract; + function GetColumnCount: Integer; virtual; abstract; + function GetItemClass: TcxGridColumnHeaderViewInfoClass; virtual; + + function CalculateItemHeight: Integer; virtual; + function GetAutoHeight: Boolean; virtual; + function GetColumnAdditionalWidth(AColumn: TcxGridColumn): Integer; + function GetColumnMinWidth(AColumn: TcxGridColumn): Integer; virtual; + function GetColumnNeighbors(AColumn: TcxGridColumn): TcxNeighbors; virtual; + function GetColumnWidth(AColumn: TcxGridColumn): Integer; virtual; + function GetItemAreaBounds(AItem: TcxGridColumnHeaderViewInfo): TRect; virtual; + function GetItemMultiLinePainting(AItem: TcxGridColumnHeaderViewInfo): Boolean; virtual; + function GetItemsAreaBounds: TRect; virtual; + function GetItemsHitTest(const P: TPoint): TcxCustomGridHitTest; virtual; + function GetKind: TcxGridColumnContainerKind; virtual; abstract; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetZonesAreaBounds: TRect; virtual; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + procedure Offset(DX, DY: Integer); override; + + property AutoHeight: Boolean read GetAutoHeight; + property ColumnCount: Integer read GetColumnCount; + property Columns[Index: Integer]: TcxGridColumn read GetColumn; + property Controller: TcxGridTableController read GetController; + property ZonesAreaBounds: TRect read GetZonesAreaBounds; + public + constructor Create(AGridViewInfo: TcxCustomGridTableViewInfo); override; + destructor Destroy; override; + procedure BeforeRecalculation; override; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + function GetZone(const P: TPoint): TcxGridItemContainerZone; virtual; + property Count: Integer read GetCount; + property GridView: TcxGridTableView read GetGridView; + property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo; + property InternalItems[Index: Integer]: TcxGridColumnHeaderViewInfo read GetInternalItem; + property ItemHeight: Integer read GetItemHeight; + property Items[Index: Integer]: TcxGridColumnHeaderViewInfo read GetItem; default; + property ItemsAreaBounds: TRect read GetItemsAreaBounds; + property Kind: TcxGridColumnContainerKind read GetKind; + end; + + // column header areas + + TcxGridColumnHeaderAreaViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo; + function GetColumn: TcxGridColumn; + function GetGridView: TcxGridTableView; + function GetGridViewInfo: TcxGridTableViewInfo; + protected + function GetAlignmentVert: TcxAlignmentVert; override; + function GetCanvas: TcxCanvas; override; + function GetHeight: Integer; override; + function GetWidth: Integer; override; + function HasMouse(AHitTest: TcxCustomGridHitTest): Boolean; override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + //procedure Invalidate; virtual; + function NeedsContainerHotTrack: Boolean; virtual; + function OccupiesSpace: Boolean; virtual; + function ResidesInContent: Boolean; virtual; + + property Column: TcxGridColumn read GetColumn; + property GridView: TcxGridTableView read GetGridView; + property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo; + public + constructor Create(AColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo); reintroduce; virtual; + procedure Calculate(const ABounds: TRect; var ATextAreaBounds: TRect); reintroduce; virtual; + property AlignmentHorz: TAlignment read GetAlignmentHorz; + property AlignmentVert: TcxAlignmentVert read GetAlignmentVert; + property ColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo read FColumnHeaderViewInfo; + property Height: Integer read GetHeight; + property Width: Integer read GetWidth; + end; + + TcxGridColumnHeaderSortingMarkViewInfo = class(TcxGridColumnHeaderAreaViewInfo) + private + function GetSortOrder: TcxGridSortOrder; + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetAlignmentHorz: TAlignment; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + property SortOrder: TcxGridSortOrder read GetSortOrder; + end; + + TcxGridColumnHeaderHorzSizingEdgeViewInfo = class(TcxGridColumnHeaderAreaViewInfo) + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetAlignmentHorz: TAlignment; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function OccupiesSpace: Boolean; override; + function ResidesInContent: Boolean; override; + public + procedure Calculate(const ABounds: TRect; var ATextAreaBounds: TRect); override; + function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + end; + + TcxGridColumnHeaderFilterButtonViewInfo = class(TcxGridColumnHeaderAreaViewInfo, + IcxGridFilterPopupOwner) + private + function GetActive: Boolean; + function GetDropDownWindowValue: TcxGridFilterPopup; + protected + { IcxGridFilterPopupOwner } + function GetItem: TcxCustomGridTableItem; + + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + procedure DropDown; override; + function EmulateMouseMoveAfterCalculate: Boolean; override; + function GetAlignmentHorz: TAlignment; override; + function GetAlwaysVisible: Boolean; virtual; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetVisible: Boolean; override; + function NeedsContainerHotTrack: Boolean; override; + function OccupiesSpace: Boolean; override; + procedure StateChanged(APrevState: TcxGridCellState); override; + + function CloseDropDownWindowOnDestruction: Boolean; override; + function DropDownWindowExists: Boolean; override; + function GetDropDownWindow: TcxCustomGridPopup; override; + function GetDropDownWindowOwnerBounds: TRect; override; + function IsDropDownWindowOwner: Boolean; override; + property DropDownWindow: TcxGridFilterPopup read GetDropDownWindowValue; + + property AlwaysVisible: Boolean read GetAlwaysVisible; + public + function MouseMove(AHitTest: TcxCustomGridHitTest; AShift: TShiftState): Boolean; override; + property Active: Boolean read GetActive; + end; + + TcxGridColumnHeaderGlyphViewInfo = class(TcxGridColumnHeaderAreaViewInfo) + private + function GetGlyph: TBitmap; + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetAlignmentHorz: TAlignment; override; + function GetAlignmentVert: TcxAlignmentVert; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + public + property Glyph: TBitmap read GetGlyph; + end; + + // column header + + TcxGridColumnHeaderViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FAdditionalHeightAtTop: Integer; + FAdditionalWidthAtLeft: Integer; + FAreaViewInfos: TList; + FColumn: TcxGridColumn; + FContainer: TcxGridColumnContainerViewInfo; + FNeighbors: TcxNeighbors; + FRealWidth: Integer; + FTextAreaBounds: TRect; + FWidth: Integer; + + function GetAreaViewInfoCount: Integer; + function GetAreaViewInfo(Index: Integer): TcxGridColumnHeaderAreaViewInfo; + function GetGridView: TcxGridTableView; + function GetGridViewInfo: TcxGridTableViewInfo; + function GetHasTextOffsetLeft: Boolean; + function GetHasTextOffsetRight: Boolean; + function GetIndex: Integer; + function GetIsFixed: Boolean; + function GetRealBounds: TRect; + function GetRealWidth: Integer; + + procedure EnumAreaViewInfoClasses(AClass: TClass); + procedure CreateAreaViewInfos; + procedure DestroyAreaViewInfos; + protected + function AreasNeedHotTrack: Boolean; + function CalculateHasTextOffset(ASide: TAlignment): Boolean; virtual; + function CalculateHeight: Integer; override; + function CalculateRealWidth(Value: Integer): Integer; + procedure CalculateTextAreaBounds; virtual; + procedure CalculateVisible(ALeftBound, AWidth: Integer); virtual; + function CalculateWidth: Integer; override; + function CanFilter: Boolean; virtual; + function CanHorzSize: Boolean; virtual; + function CanPress: Boolean; virtual; + function CanShowHint: Boolean; override; + function CanSort: Boolean; virtual; + procedure CheckWidth(var Value: Integer); virtual; + function CustomDraw(ACanvas: TcxCanvas): Boolean; override; + procedure DoCalculateParams; override; + function GetAlignmentHorz: TAlignment; override; + function GetAlignmentVert: TcxAlignmentVert; override; + function GetAreaBounds: TRect; override; + procedure GetAreaViewInfoClasses(AProc: TcxGridClassEnumeratorProc); virtual; + function GetBackgroundBitmap: TBitmap; override; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + function GetCanvas: TcxCanvas; override; + function GetCaption: string; virtual; + class function GetCellBorderWidth(ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; virtual; + class function GetCellHeight(ATextHeight: Integer; + ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; override; + function GetDataOffset: Integer; virtual; + function GetHeight: Integer; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetHotTrack: Boolean; override; + function GetIsDesignSelected: Boolean; override; + function GetIsPressed: Boolean; virtual; + function GetMaxWidth: Integer; virtual; + function GetMinWidth: Integer; virtual; + function GetMultiLine: Boolean; override; + function GetMultiLinePainting: Boolean; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetShowEndEllipsis: Boolean; override; + function GetText: string; override; + function GetTextAreaBounds: TRect; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function GetWidth: Integer; override; + function HasCustomDraw: Boolean; override; + function HasFixedContentSpace: Boolean; virtual; + function HasGlyph: Boolean; virtual; + function HasHeaderAsContainer: Boolean; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + procedure Offset(DX, DY: Integer); override; + procedure SetWidth(Value: Integer); override; + procedure StateChanged(APrevState: TcxGridCellState); override; + + property AdditionalWidthAtLeft: Integer read FAdditionalWidthAtLeft write FAdditionalWidthAtLeft; + property Caption: string read GetCaption; + property GridView: TcxGridTableView read GetGridView; + property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo; + property HasTextOffsetLeft: Boolean read GetHasTextOffsetLeft; + property HasTextOffsetRight: Boolean read GetHasTextOffsetRight; + public + constructor Create(AContainer: TcxGridColumnContainerViewInfo; + AColumn: TcxGridColumn); reintroduce; virtual; + destructor Destroy; override; + procedure BeforeRecalculation; override; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + function GetBestFitWidth: Integer; override; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + procedure InitAutoWidthItem(AAutoWidthItem: TcxAutoWidthItem); + function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + + property AreaViewInfoCount: Integer read GetAreaViewInfoCount; + property AreaViewInfos[Index: Integer]: TcxGridColumnHeaderAreaViewInfo read GetAreaViewInfo; + property Column: TcxGridColumn read FColumn; + property Container: TcxGridColumnContainerViewInfo read FContainer; + property DataOffset: Integer read GetDataOffset; + property Index: Integer read GetIndex; + property IsFixed: Boolean read GetIsFixed; + property IsPressed: Boolean read GetIsPressed; + property MaxWidth: Integer read GetMaxWidth; + property MinWidth: Integer read GetMinWidth; + property Neighbors: TcxNeighbors read FNeighbors write FNeighbors; + property RealBounds: TRect read GetRealBounds; + property RealWidth: Integer read GetRealWidth; + end; + + // header + + TcxGridHeaderViewInfoSpecificClass = class of TcxGridHeaderViewInfoSpecific; + + TcxGridHeaderViewInfoSpecific = class + private + FContainerViewInfo: TcxGridHeaderViewInfo; + function GetGridViewInfo: TcxGridTableViewInfo; + function GetItemHeight: Integer; + protected + function CalculateHeight: Integer; virtual; + function GetHeight: Integer; virtual; + public + constructor Create(AContainerViewInfo: TcxGridHeaderViewInfo); virtual; + property ContainerViewInfo: TcxGridHeaderViewInfo read FContainerViewInfo; + property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo; + property Height: Integer read GetHeight; + property ItemHeight: Integer read GetItemHeight; + end; + + TcxGridHeaderViewInfoClass = class of TcxGridHeaderViewInfo; + + TcxGridHeaderViewInfo = class(TcxGridColumnContainerViewInfo) + private + FSpecific: TcxGridHeaderViewInfoSpecific; + protected + function GetColumn(Index: Integer): TcxGridColumn; override; + function GetColumnCount: Integer; override; + + procedure AddIndicatorItems(AIndicatorViewInfo: TcxGridIndicatorViewInfo; ATopBound: Integer); virtual; + procedure CalculateColumnAutoWidths; virtual; + procedure CalculateColumnWidths; virtual; + function CalculateHeight: Integer; override; + procedure CalculateInvisible; override; + function CalculateItemHeight: Integer; override; + procedure CalculateItems; virtual; + procedure CalculateVisible; override; + function CalculateWidth: Integer; override; + function CanCalculateAutoWidths: Boolean; virtual; + function DrawColumnBackgroundHandler(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; virtual; + function GetAlignment: TcxGridPartAlignment; override; + function GetAutoHeight: Boolean; override; + function GetColumnBackgroundBitmap: TBitmap; virtual; + function GetColumnNeighbors(AColumn: TcxGridColumn): TcxNeighbors; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetIsAutoWidth: Boolean; override; + function GetIsScrollable: Boolean; override; + function GetItemMultiLinePainting(AItem: TcxGridColumnHeaderViewInfo): Boolean; override; + function GetKind: TcxGridColumnContainerKind; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function GetVisible: Boolean; override; + function GetWidth: Integer; override; + function GetZonesAreaBounds: TRect; override; + function IsAlwaysVisibleForCalculation: Boolean; virtual; + function IsHeightAssigned: Boolean; virtual; + procedure Offset(DX, DY: Integer); override; + procedure RecalculateItemVisibles; + + property ColumnBackgroundBitmap: TBitmap read GetColumnBackgroundBitmap; + public + constructor Create(AGridViewInfo: TcxCustomGridTableViewInfo); override; + destructor Destroy; override; + procedure AssignColumnWidths; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + property Specific: TcxGridHeaderViewInfoSpecific read FSpecific; + end; + + // group by box + + TcxGridGroupByBoxColumnHeaderViewInfo = class(TcxGridColumnHeaderViewInfo) + private + function GetContainer: TcxGridGroupByBoxViewInfo; + protected + function CalculateHeight: Integer; override; + function GetCaption: string; override; + function HasFixedContentSpace: Boolean; override; + function InheritedCalculateHeight: Integer; + public + property Container: TcxGridGroupByBoxViewInfo read GetContainer; + end; + + TcxGridGroupByBoxViewInfoClass = class of TcxGridGroupByBoxViewInfo; + + TcxGridGroupByBoxViewInfo = class(TcxGridColumnContainerViewInfo) + private + FCalculatingColumnWidth: Boolean; + function GetGroupByBoxVerOffset: Integer; + function GetLinkLineBounds(Index: Integer; Horizontal: Boolean): TRect; + protected + function GetColumn(Index: Integer): TcxGridColumn; override; + function GetColumnCount: Integer; override; + function GetItemClass: TcxGridColumnHeaderViewInfoClass; override; + + function CalculateHeight: Integer; override; + function CalculateItemHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetAlignment: TcxGridPartAlignment; override; + function GetAlignmentVert: TcxAlignmentVert; override; + function GetBackgroundBitmap: TBitmap; override; + function GetColumnWidth(AColumn: TcxGridColumn): Integer; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetIsAutoWidth: Boolean; override; + function GetIsScrollable: Boolean; override; + function GetItemAreaBounds(AItem: TcxGridColumnHeaderViewInfo): TRect; override; + function GetKind: TcxGridColumnContainerKind; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetText: string; override; + function GetTextAreaBounds: TRect; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function GetVisible: Boolean; override; + + property CalculatingColumnWidth: Boolean read FCalculatingColumnWidth; + property GroupByBoxVerOffset: Integer read GetGroupByBoxVerOffset; + public + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + property LinkLineBounds[Index: Integer; Horizontal: Boolean]: TRect read GetLinkLineBounds; + end; + + // footer + + TcxGridFooterCellViewInfoClass = class of TcxGridFooterCellViewInfo; + + TcxGridFooterCellViewInfo = class(TcxGridColumnHeaderViewInfo) + private + FSummaryItem: TcxDataSummaryItem; + function GetContainer: TcxGridFooterViewInfo; + function GetSummary: TcxDataSummary; + protected + procedure AfterCalculateBounds(var ABounds: TRect); override; + function CanPress: Boolean; override; + function CustomDraw(ACanvas: TcxCanvas): Boolean; override; + function GetAlignmentHorz: TAlignment; override; + function GetBackgroundBitmap: TBitmap; override; + procedure GetAreaViewInfoClasses(AProc: TcxGridClassEnumeratorProc); override; + function GetBorders: TcxBorders; override; + class function GetCellBorderWidth(ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetIsDesignSelected: Boolean; override; + function GetIsPressed: Boolean; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetText: string; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function HasCustomDraw: Boolean; override; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + property Summary: TcxDataSummary read GetSummary; + public + constructor Create(AContainer: TcxGridColumnContainerViewInfo; + ASummaryItem: TcxDataSummaryItem); reintroduce; virtual; + function GetBestFitWidth: Integer; override; + function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + property Container: TcxGridFooterViewInfo read GetContainer; + property SummaryItem: TcxDataSummaryItem read FSummaryItem; + end; + + TcxGridFooterViewInfoClass = class of TcxGridFooterViewInfo; + + TcxGridFooterViewInfo = class(TcxGridHeaderViewInfo) + private + FRowCount: Integer; + FSummaryItems: TList; + function GetMultipleSummaries: Boolean; + function GetRowCount: Integer; + function GetRowHeight: Integer; + protected + function CreateItem(AIndex: Integer): TcxGridColumnHeaderViewInfo; override; + procedure CreateItems; override; + procedure DestroyItems; override; + function GetColumn(Index: Integer): TcxGridColumn; override; + function GetColumnCount: Integer; override; + function GetItemClass: TcxGridColumnHeaderViewInfoClass; override; + procedure PrepareSummaryItems(ASummaryItems: TList); virtual; + + function CalculateBounds: TRect; override; + function CalculateHeight: Integer; override; + function CalculateItemHeight: Integer; override; + procedure CalculateItem(AIndex: Integer); virtual; + procedure CalculateItems; override; + function CalculateRowCount: Integer; virtual; + function CanCalculateAutoWidths: Boolean; override; + function GetAlignment: TcxGridPartAlignment; override; + function GetAutoHeight: Boolean; override; + function GetBackgroundBitmap: TBitmap; override; + function GetBordersBounds: TRect; virtual; + function GetBorders: TcxBorders; override; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + function GetColumnWidth(AColumn: TcxGridColumn): Integer; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetIsAutoWidth: Boolean; override; + function GetIsScrollable: Boolean; override; + function GetItemAreaBounds(AItem: TcxGridColumnHeaderViewInfo): TRect; override; + function GetItemHeight(AColumn: TcxGridColumn): Integer; overload; virtual; + function GetItemHeight(AIndex: Integer): Integer; overload; + function GetItemHitTestClass: TcxCustomGridHitTestClass; virtual; + function GetItemLeftBound(AColumn: TcxGridColumn): Integer; overload; virtual; + function GetItemLeftBound(AIndex: Integer): Integer; overload; + function GetItemRowIndex(AIndex: Integer): Integer; virtual; + function GetItemsAreaBounds: TRect; override; + function GetItemTopBound(AColumn: TcxGridColumn): Integer; overload; virtual; + function GetItemTopBound(AIndex: Integer): Integer; overload; virtual; + function GetKind: TcxGridColumnContainerKind; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetSeparatorBounds: TRect; virtual; + function GetSeparatorWidth: Integer; virtual; + function GetSummaryItems: TcxDataSummaryItems; virtual; + procedure GetViewParams(var AParams: TcxViewParams); override; + function GetVisible: Boolean; override; + function HasSeparator: Boolean; virtual; + function IsAlwaysVisibleForCalculation: Boolean; override; + function IsHeightAssigned: Boolean; override; + function IsItemVisible(AIndex: Integer): Boolean; virtual; + procedure Offset(DX, DY: Integer); override; + + property SummaryItemsList: TList read FSummaryItems; + public + function CanShowMultipleSummaries: Boolean; virtual; + function GetCellBestFitWidth(AColumn: TcxGridColumn): Integer; virtual; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + + property BordersBounds: TRect read GetBordersBounds; + property MultipleSummaries: Boolean read GetMultipleSummaries; + property RowCount: Integer read GetRowCount; + property RowHeight: Integer read GetRowHeight; + property SeparatorBounds: TRect read GetSeparatorBounds; + property SeparatorWidth: Integer read GetSeparatorWidth; + property SummaryItems: TcxDataSummaryItems read GetSummaryItems; + end; + + // indicator + + TcxCustomGridIndicatorItemViewInfoClass = class of TcxCustomGridIndicatorItemViewInfo; + + TcxCustomGridIndicatorItemViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FContainer: TcxGridIndicatorViewInfo; + function GetGridView: TcxGridTableView; + function GetGridViewInfo: TcxGridTableViewInfo; + protected + function CalculateWidth: Integer; override; + function CustomDraw(ACanvas: TcxCanvas): Boolean; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function HasCustomDraw: Boolean; override; + public + constructor Create(AContainer: TcxGridIndicatorViewInfo); reintroduce; virtual; + destructor Destroy; override; + property Container: TcxGridIndicatorViewInfo read FContainer; + property GridView: TcxGridTableView read GetGridView; + property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo; + end; + + TcxGridIndicatorHeaderItemViewInfo = class(TcxCustomGridIndicatorItemViewInfo) + private + function GetDropDownWindowValue: TcxCustomGridCustomizationPopup; + protected + function CalculateHeight: Integer; override; + function CanShowHint: Boolean; override; + function GetCellBoundsForHint: TRect; override; + function GetHintTextRect(const AMousePos: TPoint): TRect; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetHotTrack: Boolean; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetText: string; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function IsHintForText: Boolean; override; + function IsHintMultiLine: Boolean; override; + function SupportsQuickCustomization: Boolean; virtual; + + function CloseDropDownWindowOnDestruction: Boolean; override; + function DropDownWindowExists: Boolean; override; + function GetDropDownWindow: TcxCustomGridPopup; override; + property DropDownWindow: TcxCustomGridCustomizationPopup read GetDropDownWindowValue; + end; + + TcxGridIndicatorRowItemViewInfo = class(TcxCustomGridIndicatorItemViewInfo) + private + FRowViewInfo: TcxCustomGridRowViewInfo; + function GetGridRecord: TcxCustomGridRow; + function GetGridView: TcxGridTableView; + protected + function CalculateHeight: Integer; override; + function GetBackgroundBitmap: TBitmap; override; + function GetIndicatorKind: TcxIndicatorKind; virtual; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetRowSizingEdgeBounds: TRect; virtual; + procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override; + property RowSizingEdgeBounds: TRect read GetRowSizingEdgeBounds; + public + destructor Destroy; override; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + property GridRecord: TcxCustomGridRow read GetGridRecord; + property GridView: TcxGridTableView read GetGridView; + property IndicatorKind: TcxIndicatorKind read GetIndicatorKind; + property RowViewInfo: TcxCustomGridRowViewInfo read FRowViewInfo write FRowViewInfo; + end; + + TcxGridIndicatorFooterItemViewInfo = class(TcxCustomGridIndicatorItemViewInfo) + private + function GetSeparatorWidth: Integer; + protected + function CalculateHeight: Integer; override; + function GetBackgroundBitmap: TBitmap; override; + function GetBorders: TcxBorders; override; + function GetBordersBounds: TRect; virtual; + function GetBorderWidth(AIndex: TcxBorder): Integer; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + function GetSeparatorBounds: TRect; virtual; + function HasSeparator: Boolean; + public + property BordersBounds: TRect read GetBordersBounds; + property SeparatorBounds: TRect read GetSeparatorBounds; + property SeparatorWidth: Integer read GetSeparatorWidth; + end; + + TcxGridIndicatorViewInfoClass = class of TcxGridIndicatorViewInfo; + + TcxGridIndicatorViewInfo = class(TcxCustomGridViewCellViewInfo) + private + FItems: TList; + function GetCount: Integer; + function GetGridView: TcxGridTableView; + function GetGridViewInfo: TcxGridTableViewInfo; + function GetItem(Index: Integer): TcxCustomGridIndicatorItemViewInfo; + procedure DestroyItems; + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetAlwaysVisible: Boolean; virtual; + function GetBackgroundBitmap: TBitmap; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetPainterClass: TcxCustomGridCellPainterClass; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function GetVisible: Boolean; override; + function GetWidth: Integer; override; + public + constructor Create(AGridViewInfo: TcxGridTableViewInfo); reintroduce; virtual; + destructor Destroy; override; + function AddItem(AItemClass: TcxCustomGridIndicatorItemViewInfoClass): TcxCustomGridIndicatorItemViewInfo; overload; + function AddItem(ATopBound, AHeight: Integer; + AItemClass: TcxCustomGridIndicatorItemViewInfoClass): TcxCustomGridIndicatorItemViewInfo; overload; + function AddRowItem(ARowViewInfo: TcxCustomGridRowViewInfo): TcxCustomGridIndicatorItemViewInfo; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + procedure CalculateRowItem(ARowViewInfo: TcxCustomGridRowViewInfo; + AItem: TcxCustomGridIndicatorItemViewInfo); + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + function GetRowItemBounds(AGridRecord: TcxCustomGridRow): TRect; + + property AlwaysVisible: Boolean read GetAlwaysVisible; + property Count: Integer read GetCount; + property GridView: TcxGridTableView read GetGridView; + property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo; + property Items[Index: Integer]: TcxCustomGridIndicatorItemViewInfo read GetItem; + end; + + // custom row + + TcxGridRowFooterCellViewInfo = class(TcxGridFooterCellViewInfo) + private + function GetContainer: TcxGridRowFooterViewInfo; + function GetGridRecord: TcxCustomGridRow; + protected + function GetText: string; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + public + property Container: TcxGridRowFooterViewInfo read GetContainer; + property GridRecord: TcxCustomGridRow read GetGridRecord; + end; + + TcxGridRowFooterViewInfoClass = class of TcxGridRowFooterViewInfo; + + TcxGridRowFooterViewInfo = class(TcxGridFooterViewInfo) + private + FContainer: TcxGridRowFootersViewInfo; + FLevel: Integer; + function GetIndent: Integer; + function GetGridRecord: TcxCustomGridRow; + function GetGroupLevel: Integer; + function GetRowViewInfo: TcxCustomGridRowViewInfo; + protected + function CalculateHeight: Integer; override; + function CalculateWidth: Integer; override; + function GetColumnWidth(AColumn: TcxGridColumn): Integer; override; + function GetHitTestClass: TcxCustomGridHitTestClass; override; + function GetIsPart: Boolean; override; + function GetItemAreaBounds(AItem: TcxGridColumnHeaderViewInfo): TRect; override; + function GetItemClass: TcxGridColumnHeaderViewInfoClass; override; + function GetItemHitTestClass: TcxCustomGridHitTestClass; override; + function GetItemMultiLinePainting(AItem: TcxGridColumnHeaderViewInfo): Boolean; override; + function GetSummaryItems: TcxDataSummaryItems; override; + procedure GetViewParams(var AParams: TcxViewParams); override; + function GetVisible: Boolean; override; + function GetVisualLevel: Integer; virtual; + function HasSeparator: Boolean; override; + procedure PrepareSummaryItems(ASummaryItems: TList); override; + property Indent: Integer read GetIndent; + public + constructor Create(AContainer: TcxGridRowFootersViewInfo; ALevel: Integer); reintroduce; virtual; + function CanShowMultipleSummaries: Boolean; override; + property Container: TcxGridRowFootersViewInfo read FContainer; + property GridRecord: TcxCustomGridRow read GetGridRecord; + property GroupLevel: Integer read GetGroupLevel; + property Level: Integer read FLevel; + property RowViewInfo: TcxCustomGridRowViewInfo read GetRowViewInfo; + property VisualLevel: Integer read GetVisualLevel; + end; + + TcxGridRowFootersViewInfoClass = class of TcxGridRowFootersViewInfo; + + TcxGridRowFootersViewInfo = class + private + FHeight: Integer; + FItems: TList; + FRowViewInfo: TcxCustomGridRowViewInfo; + function GetCount: Integer; + function GetGridViewInfo: TcxGridTableViewInfo; + function GetHeight: Integer; + function GetItem(Index: Integer): TcxGridRowFooterViewInfo; + function GetVisibleItem(ALevel: Integer): TcxGridRowFooterViewInfo; + procedure CreateItems; + procedure DestroyItems; + protected + procedure BeforeRecalculation; virtual; + procedure Calculate(ALeftBound, ATopBound: Integer); virtual; + function CalculateHeight: Integer; virtual; + function GetItemClass: TcxGridRowFooterViewInfoClass; virtual; + public + constructor Create(ARowViewInfo: TcxCustomGridRowViewInfo); virtual; + destructor Destroy; override; + function GetCellBestFitWidth(AColumn: TcxGridColumn): Integer; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; virtual; + function GetTopBound(ALevel: Integer; var ATopBound: Integer): Boolean; + procedure Offset(DX, DY: Integer); virtual; + procedure Paint; + + property Count: Integer read GetCount; + property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo; + property Items[Index: Integer]: TcxGridRowFooterViewInfo read GetItem; default; + property Height: Integer read GetHeight; + property RowViewInfo: TcxCustomGridRowViewInfo read FRowViewInfo; + property VisibleItems[ALevel: Integer]: TcxGridRowFooterViewInfo read GetVisibleItem; + end; + + TcxCustomGridRowViewInfoClass = class of TcxCustomGridRowViewInfo; + + TcxCustomGridRowViewInfo = class(TcxCustomGridRecordViewInfo) + private + FFootersViewInfo: TcxGridRowFootersViewInfo; + FIndicatorItem: TcxCustomGridIndicatorItemViewInfo; + function GetCacheItem: TcxGridTableViewInfoCacheItem; + function GetGridView: TcxGridTableView; + function GetGridLines: TcxGridLines; + function GetGridRecord: TcxCustomGridRow; + function GetGridViewInfo: TcxGridTableViewInfo; + function GetLevel: Integer; + function GetLevelIndent: Integer; + function GetLevelIndentBounds(Index: Integer): TRect; + function GetLevelIndentHorzLineBounds(Index: Integer): TRect; + function GetLevelIndentSpaceBounds(Index: Integer): TRect; + function GetLevelIndentVertLineBounds(Index: Integer): TRect; + function GetRecordsViewInfo: TcxGridRowsViewInfo; + function GetVisualLevel: Integer; + procedure CreateFootersViewInfo; + procedure DestroyFootersViewInfo; + procedure RecreateFootersViewInfo; + protected + procedure AfterRowsViewInfoCalculate; virtual; + procedure AfterRowsViewInfoOffset; virtual; + procedure CalculateExpandButtonBounds(var ABounds: TRect); override; + function CalculateHeight: Integer; override; + function CalculateLevelIndentHorzLineBounds(ALevel: Integer; const ABounds: TRect): TRect; + function CalculateLevelIndentSpaceBounds(ALevel: Integer; const ABounds: TRect): TRect; + function CalculateLevelIndentVertLineBounds(ALevel: Integer; const ABounds: TRect): TRect; + function CalculateWidth: Integer; override; + function CanSize: Boolean; virtual; + procedure CheckRowHeight(var AValue: Integer); virtual; + function GetAutoHeight: Boolean; override; + function GetBaseHeight: Integer; virtual; + function GetBottomPartHeight: Integer; virtual; + function GetCellTransparent(ACell: TcxGridTableCellViewInfo): Boolean; override; + function GetContentBounds: TRect; override; + function GetContentIndent: Integer; virtual; + function GetContentWidth: Integer; override; + function GetDataHeight: Integer; virtual; + function GetDataIndent: Integer; virtual; + function GetDataWidth: Integer; virtual; + function GetFocusRectBounds: TRect; override; + function GetFootersViewInfoClass: TcxGridRowFootersViewInfoClass; virtual; + function GetFullyVisible: Boolean; virtual; + function GetLastHorzGridLineBounds: TRect; virtual; + function GetMaxHeight: Integer; virtual; + function GetNonBaseHeight: Integer; virtual; + function GetRowHeight: Integer; virtual; + function GetSeparatorBounds: TRect; virtual; + function GetSeparatorColor: TColor; virtual; + function GetSeparatorWidth: Integer; virtual; + function GetShowSeparator: Boolean; virtual; + function GetVisible: Boolean; override; + function GetWidth: Integer; override; + function HasAnyFooter(ALevel: Integer): Boolean; + function HasFooter(ALevel: Integer): Boolean; virtual; + function HasFooters: Boolean; virtual; + function HasLastHorzGridLine: Boolean; virtual; + procedure Offset(DX, DY: Integer); override; + procedure SetRowHeight(Value: Integer); virtual; abstract; + + property BaseHeight: Integer read GetBaseHeight; + property BottomPartHeight: Integer read GetBottomPartHeight; + property CacheItem: TcxGridTableViewInfoCacheItem read GetCacheItem; + property IndicatorItem: TcxCustomGridIndicatorItemViewInfo read FIndicatorItem; + property LastHorzGridLineBounds: TRect read GetLastHorzGridLineBounds; + property Level: Integer read GetLevel; + property LevelIndent: Integer read GetLevelIndent; + property NonBaseHeight: Integer read GetNonBaseHeight; + property RowHeight: Integer read GetRowHeight write SetRowHeight; + property ShowSeparator: Boolean read GetShowSeparator; + public + constructor Create(ARecordsViewInfo: TcxCustomGridRecordsViewInfo; + ARecord: TcxCustomGridRecord); override; + destructor Destroy; override; + procedure BeforeRecalculation; override; + procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1; + AHeight: Integer = -1); override; + function Click(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; override; + function GetBoundsForInvalidate(AItem: TcxCustomGridTableItem): TRect; override; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + function HasSeparator: Boolean; + + property ContentIndent: Integer read GetContentIndent; + property DataHeight: Integer read GetDataHeight; + property DataIndent: Integer read GetDataIndent; + property DataWidth: Integer read GetDataWidth; + property FootersViewInfo: TcxGridRowFootersViewInfo read FFootersViewInfo; + property FullyVisible: Boolean read GetFullyVisible; + property GridView: TcxGridTableView read GetGridView; + property GridLines: TcxGridLines read GetGridLines; + property GridRecord: TcxCustomGridRow read GetGridRecord; + property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo; + property LevelIndentBounds[Index: Integer]: TRect read GetLevelIndentBounds; + property LevelIndentHorzLineBounds[Index: Integer]: TRect read GetLevelIndentHorzLineBounds; + property LevelIndentSpaceBounds[Index: Integer]: TRect read GetLevelIndentSpaceBounds; + property LevelIndentVertLineBounds[Index: Integer]: TRect read GetLevelIndentVertLineBounds; + property MaxHeight: Integer read GetMaxHeight; + property RecordsViewInfo: TcxGridRowsViewInfo read GetRecordsViewInfo; + property SeparatorBounds: TRect read GetSeparatorBounds; + property SeparatorColor: TColor read GetSeparatorColor; + property SeparatorWidth: Integer read GetSeparatorWidth; + property VisualLevel: Integer read GetVisualLevel; + end; + + // rows + + TcxGridRowsViewInfoClass = class of TcxGridRowsViewInfo; + + TcxGridRowsViewInfo = class(TcxCustomGridRecordsViewInfo) + private + FDataRowHeight: Integer; + FFilterRowViewInfo: TcxCustomGridRowViewInfo; + FGroupRowHeight: Integer; + FNewItemRowViewInfo: TcxCustomGridRowViewInfo; + FRestHeight: Integer; + FRowHeight: Integer; + function GetFilterRowViewInfo: TcxCustomGridRowViewInfo; + function GetGridView: TcxGridTableView; + function GetGridLines: TcxGridLines; + function GetGridViewInfo: TcxGridTableViewInfo; + function GetHeaderViewInfo: TcxGridHeaderViewInfo; + function GetItem(Index: Integer): TcxCustomGridRowViewInfo; + function GetNewItemRowViewInfo: TcxCustomGridRowViewInfo; + function GetPainterClassValue: TcxGridRowsPainterClass; + function GetViewData: TcxGridViewData; + protected + FIsFirstRowFullyVisible: Boolean; + FPartVisibleCount: Integer; + procedure AfterCalculate; override; + procedure AfterOffset; override; + procedure Calculate; override; + function CalculateBounds: TRect; override; + procedure CalculateConsts; virtual; + function CalculateContentBounds: TRect; override; + function CalculateDataRowHeight: Integer; virtual; + function CalculateGroupRowDefaultHeight(AMinHeight: Boolean): Integer; virtual; + function CalculateGroupRowHeight: Integer; virtual; + function CalculateRestHeight(ATopBound: Integer): Integer; virtual; + function CalculateRowDefaultHeight: Integer; virtual; + function CalculateRowHeight: Integer; virtual; + procedure CalculateVisibleCount; override; + function GetAutoDataCellHeight: Boolean; override; + function GetCommonDataRowHeight: Integer; virtual; + function GetFilterRowViewInfoClass: TcxCustomGridRowViewInfoClass; virtual; + function GetGroupBackgroundBitmap: TBitmap; virtual; + function GetGroupRowSeparatorWidth: Integer; virtual; + function GetItemLeftBound(AIndex: Integer): Integer; override; + function GetItemsOffset(AItemCountDelta: Integer): Integer; override; + function GetItemTopBound(AIndex: Integer): Integer; override; + function GetIsScrollable: Boolean; virtual; + function GetNewItemRowViewInfoClass: TcxCustomGridRowViewInfoClass; virtual; + function GetPainterClass: TcxCustomGridRecordsPainterClass; override; + function GetRowWidth: Integer; virtual; + function GetSeparatorWidth: Integer; virtual; + function HasFilterRow: Boolean; + function HasLastHorzGridLine(ARowViewInfo: TcxCustomGridRowViewInfo): Boolean; virtual; + function HasNewItemRow: Boolean; + function IsFilterRowVisible: Boolean; virtual; + function IsNewItemRowVisible: Boolean; virtual; + procedure NotifyItemsCalculationFinished; + procedure OffsetItem(AIndex, AOffset: Integer); override; + + property GridView: TcxGridTableView read GetGridView; + property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo; + property HeaderViewInfo: TcxGridHeaderViewInfo read GetHeaderViewInfo; + property IsScrollable: Boolean read GetIsScrollable; + property ViewData: TcxGridViewData read GetViewData; + public + destructor Destroy; override; + procedure AfterConstruction; override; + function CalculateCustomGroupRowHeight(AMinHeight: Boolean; AParams: TcxViewParams): Integer; virtual; + function CanDataRowSize: Boolean; virtual; + function GetCellHeight(ACellContentHeight: Integer): Integer; override; + function GetDataRowCellsAreaViewInfoClass: TClass; virtual; + function GetFooterCellBestFitWidth(AColumn: TcxGridColumn): Integer; + function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + function GetRealItem(ARecord: TcxCustomGridRecord): TcxCustomGridRecordViewInfo; override; + function GetRestHeight(ATopBound: Integer): Integer; virtual; + function IsCellMultiLine(AItem: TcxCustomGridTableItem): Boolean; override; + function IsDataRowHeightAssigned: Boolean; virtual; + procedure Offset(DX, DY: Integer); override; + + property CommonDataRowHeight: Integer read GetCommonDataRowHeight; + property DataRowHeight: Integer read FDataRowHeight; + property FilterRowViewInfo: TcxCustomGridRowViewInfo read GetFilterRowViewInfo; + property GridLines: TcxGridLines read GetGridLines; + property GroupBackgroundBitmap: TBitmap read GetGroupBackgroundBitmap; + property GroupRowHeight: Integer read FGroupRowHeight write FGroupRowHeight; + property GroupRowSeparatorWidth: Integer read GetGroupRowSeparatorWidth; + property IsFirstRowFullyVisible: Boolean read FIsFirstRowFullyVisible; + property Items[Index: Integer]: TcxCustomGridRowViewInfo read GetItem; default; + property NewItemRowViewInfo: TcxCustomGridRowViewInfo read GetNewItemRowViewInfo; + property PainterClass: TcxGridRowsPainterClass read GetPainterClassValue; + property PartVisibleCount: Integer read FPartVisibleCount; + property RowHeight: Integer read FRowHeight write FRowHeight; + property RowWidth: Integer read GetRowWidth; + property SeparatorWidth: Integer read GetSeparatorWidth; + end; + + // table + + TcxGridTableViewInfo = class(TcxCustomGridTableViewInfo) + private + FDataWidth: Integer; + FExpandButtonIndent: Integer; + FFooterViewInfo: TcxGridFooterViewInfo; + FGroupByBoxViewInfo: TcxGridGroupByBoxViewInfo; + FHeaderViewInfo: TcxGridHeaderViewInfo; + FIndicatorViewInfo: TcxGridIndicatorViewInfo; + FLevelIndent: Integer; + FPrevDataRowHeight: Integer; + + function GetController: TcxGridTableController; + function GetDataWidth: Integer; + function GetGridView: TcxGridTableView; + function GetGridLineColor: TColor; + function GetGridLines: TcxGridLines; + function GetLeftPos: Integer; + function GetLevelIndentBackgroundBitmap: TBitmap; + function GetLevelIndentColor(Index: Integer): TColor; + function GetRecordsViewInfo: TcxGridRowsViewInfo; + function GetViewData: TcxGridViewData; + protected + procedure AfterCalculating; override; + procedure BeforeCalculating; override; + procedure CreateViewInfos; override; + procedure DestroyViewInfos(AIsRecreating: Boolean); override; + procedure Calculate; override; + function CalculateClientBounds: TRect; override; + function CalculateDataWidth: Integer; virtual; + procedure CalculateExpandButtonParams; virtual; + procedure CalculateHeight(const AMaxSize: TPoint; var AHeight: Integer; + var AFullyVisible: Boolean); override; + function CalculatePartBounds(APart: TcxCustomGridPartViewInfo): TRect; override; + procedure CalculateParts; virtual; + function CalculateVisibleEqualHeightRecordCount: Integer; override; + procedure CalculateWidth(const AMaxSize: TPoint; var AWidth: Integer); override; + function DoGetHitTest(const P: TPoint): TcxCustomGridHitTest; override; + function GetDefaultGridModeBufferCount: Integer; override; + function GetFirstItemAdditionalWidth: Integer; virtual; + function GetGridLineWidth: Integer; virtual; + function GetLevelSeparatorColor: TColor; virtual; + function GetNonRecordsAreaHeight(ACheckScrollBar: Boolean): Integer; override; + function GetScrollableAreaBoundsHorz: TRect; override; + function GetScrollableAreaBoundsVert: TRect; override; + function GetVisualLevelCount: Integer; virtual; + procedure Offset(DX, DY: Integer); override; + procedure RecreateViewInfos; override; + function SupportsAutoHeight: Boolean; virtual; + function SupportsGroupSummariesAlignedWithColumns: Boolean; virtual; + function SupportsMultipleFooterSummaries: Boolean; virtual; + + function GetFooterPainterClass: TcxGridFooterPainterClass; virtual; + function GetFooterViewInfoClass: TcxGridFooterViewInfoClass; virtual; + function GetGroupByBoxViewInfoClass: TcxGridGroupByBoxViewInfoClass; virtual; + function GetHeaderViewInfoClass: TcxGridHeaderViewInfoClass; virtual; + function GetIndicatorViewInfoClass: TcxGridIndicatorViewInfoClass; virtual; + function GetHeaderViewInfoSpecificClass: TcxGridHeaderViewInfoSpecificClass; virtual; + function GetRecordsViewInfoClass: TcxCustomGridRecordsViewInfoClass; override; + + property Controller: TcxGridTableController read GetController; + property ViewData: TcxGridViewData read GetViewData; + public + function GetCellBorders(AIsRight, AIsBottom: Boolean): TcxBorders; virtual; + function GetCellHeight(AIndex, ACellHeight: Integer): Integer; virtual; + function GetCellTopOffset(AIndex, ACellHeight: Integer): Integer; virtual; + function GetOffsetBounds(AItemsOffset: Integer; out AUpdateBounds: TRect): TRect; overload; virtual; + function GetOffsetBounds(DX, DY: Integer; out AUpdateBounds: TRect): TRect; overload; virtual; + function GetVisualLevel(ALevel: Integer): Integer; virtual; + + // for extended lookup edit + function GetNearestPopupHeight(AHeight: Integer; AAdditionalRecord: Boolean = False): Integer; override; + function GetPopupHeight(ADropDownRowCount: Integer): Integer; override; + + property DataWidth: Integer read GetDataWidth; + property ExpandButtonIndent: Integer read FExpandButtonIndent write FExpandButtonIndent; + property FirstItemAdditionalWidth: Integer read GetFirstItemAdditionalWidth; + property FooterViewInfo: TcxGridFooterViewInfo read FFooterViewInfo; + property GridLineColor: TColor read GetGridLineColor; + property GridLines: TcxGridLines read GetGridLines; + property GridLineWidth: Integer read GetGridLineWidth; + property GridView: TcxGridTableView read GetGridView; + property GroupByBoxViewInfo: TcxGridGroupByBoxViewInfo read FGroupByBoxViewInfo; + property HeaderViewInfo: TcxGridHeaderViewInfo read FHeaderViewInfo; + property IndicatorViewInfo: TcxGridIndicatorViewInfo read FIndicatorViewInfo; + property LeftPos: Integer read GetLeftPos; + property LevelIndent: Integer read FLevelIndent write FLevelIndent; + property LevelIndentBackgroundBitmap: TBitmap read GetLevelIndentBackgroundBitmap; + property LevelIndentColors[Index: Integer]: TColor read GetLevelIndentColor; + property LevelSeparatorColor: TColor read GetLevelSeparatorColor; + property RecordsViewInfo: TcxGridRowsViewInfo read GetRecordsViewInfo; + property VisualLevelCount: Integer read GetVisualLevelCount; + end; + + // cache + + TcxGridTableViewInfoCacheItem = class(TcxCustomGridTableViewInfoCacheItem) + private + FIsPreviewHeightAssigned: Boolean; + FPreviewHeight: Integer; + procedure SetPreviewHeight(Value: Integer); + public + procedure UnassignValues(AKeepMaster: Boolean); override; + property IsPreviewHeightAssigned: Boolean read FIsPreviewHeightAssigned + write FIsPreviewHeightAssigned; + property PreviewHeight: Integer read FPreviewHeight write SetPreviewHeight; + end; + + TcxGridMasterTableViewInfoCacheItem = class(TcxGridTableViewInfoCacheItem) + private + FIsDetailsSiteFullyVisibleAssigned: Boolean; + FIsDetailsSiteHeightAssigned: Boolean; + FIsDetailsSiteNormalHeightAssigned: Boolean; + FIsDetailsSiteWidthAssigned: Boolean; + FDetailsSiteFullyVisible: Boolean; + FDetailsSiteHeight: Integer; + FDetailsSiteNormalHeight: Integer; + FDetailsSiteWidth: Integer; + FUnassigningValues: Boolean; + function GetGridRecord: TcxGridMasterDataRow; + function GetIsDetailsSiteCachedInfoAssigned: Boolean; + procedure SetDetailsSiteFullyVisible(Value: Boolean); + procedure SetDetailsSiteHeight(Value: Integer); + procedure SetDetailsSiteNormalHeight(Value: Integer); + procedure SetDetailsSiteWidth(Value: Integer); + protected + property GridRecord: TcxGridMasterDataRow read GetGridRecord; + public + DetailsSiteCachedInfo: TcxCustomGridDetailsSiteViewInfoCachedInfo; + destructor Destroy; override; + procedure UnassignValues(AKeepMaster: Boolean); override; + property IsDetailsSiteCachedInfoAssigned: Boolean read GetIsDetailsSiteCachedInfoAssigned; + property IsDetailsSiteFullyVisibleAssigned: Boolean read FIsDetailsSiteFullyVisibleAssigned write FIsDetailsSiteFullyVisibleAssigned; + property IsDetailsSiteHeightAssigned: Boolean read FIsDetailsSiteHeightAssigned write FIsDetailsSiteHeightAssigned; + property IsDetailsSiteNormalHeightAssigned: Boolean read FIsDetailsSiteNormalHeightAssigned write FIsDetailsSiteNormalHeightAssigned; + property IsDetailsSiteWidthAssigned: Boolean read FIsDetailsSiteWidthAssigned write FIsDetailsSiteWidthAssigned; + property DetailsSiteFullyVisible: Boolean read FDetailsSiteFullyVisible write SetDetailsSiteFullyVisible; + property DetailsSiteHeight: Integer read FDetailsSiteHeight write SetDetailsSiteHeight; + property DetailsSiteNormalHeight: Integer read FDetailsSiteNormalHeight write SetDetailsSiteNormalHeight; + property DetailsSiteWidth: Integer read FDetailsSiteWidth write SetDetailsSiteWidth; + end; + + { view } + + // column + + TcxGridColumnOptions = class(TcxCustomGridTableItemOptions) + private + FCellMerging: Boolean; + FGroupFooters: Boolean; + FHorzSizing: Boolean; + function GetGridView: TcxGridTableView; + procedure SetCellMerging(Value: Boolean); + procedure SetGroupFooters(Value: Boolean); + procedure SetHorzSizing(Value: Boolean); + protected + property GridView: TcxGridTableView read GetGridView; + public + constructor Create(AItem: TcxCustomGridTableItem); override; + procedure Assign(Source: TPersistent); override; + published + property CellMerging: Boolean read FCellMerging write SetCellMerging default False; + property GroupFooters: Boolean read FGroupFooters write SetGroupFooters default True; + property Grouping; + property HorzSizing: Boolean read FHorzSizing write SetHorzSizing default True; + property Moving; + property ShowCaption; + property SortByDisplayText; + property Sorting; + end; + + TcxGridGetFooterStyleExEvent = procedure(Sender: TcxGridTableView; ARow: TcxCustomGridRow; + AColumn: TcxGridColumn; AFooterGroupLevel: Integer; var AStyle: TcxStyle) of object; + TcxGridGetFooterSummaryStyleEvent = procedure(AView: TcxGridTableView; ARow: TcxCustomGridRow; + AColumn: TcxGridColumn; AFooterGroupLevel: Integer; ASummaryItem: TcxDataSummaryItem; var AStyle: TcxStyle) of object; + TcxGridGetGroupSummaryStyleEvent = procedure(Sender: TcxGridTableView; ARow: TcxGridGroupRow; + AColumn: TcxGridColumn; ASummaryItem: TcxDataSummaryItem; var AStyle: TcxStyle) of object; + TcxGridGetHeaderStyleEvent = procedure(Sender: TcxGridTableView; + AColumn: TcxGridColumn; {$IFDEF BCB}var{$ELSE}out{$ENDIF} AStyle: TcxStyle) of object; + + TcxGridColumnStyles = class(TcxCustomGridTableItemStyles) + private + FOnGetFooterStyle: TcxGridGetCellStyleEvent; + FOnGetFooterStyleEx: TcxGridGetFooterStyleExEvent; + FOnGetFooterSummaryStyle: TcxGridGetFooterSummaryStyleEvent; + FOnGetGroupSummaryStyle: TcxGridGetGroupSummaryStyleEvent; + FOnGetHeaderStyle: TcxGridGetHeaderStyleEvent; + function GetGridViewValue: TcxGridTableView; + function GetItem: TcxGridColumn; + procedure SetOnGetFooterStyle(Value: TcxGridGetCellStyleEvent); + procedure SetOnGetFooterStyleEx(Value: TcxGridGetFooterStyleExEvent); + procedure SetOnGetFooterSummaryStyle(Value: TcxGridGetFooterSummaryStyleEvent); + procedure SetOnGetGroupSummaryStyle(Value: TcxGridGetGroupSummaryStyleEvent); + procedure SetOnGetHeaderStyle(Value: TcxGridGetHeaderStyleEvent); + protected + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + public + procedure Assign(Source: TPersistent); override; + procedure GetFooterParams(ARow: TcxCustomGridRow; AFooterGroupLevel: Integer; + ASummaryItem: TcxDataSummaryItem; out AParams: TcxViewParams); virtual; + procedure GetGroupSummaryParams(ARow: TcxGridGroupRow; ASummaryItem: TcxDataSummaryItem; + out AParams: TcxViewParams); virtual; + procedure GetHeaderParams(out AParams: TcxViewParams); virtual; + property GridView: TcxGridTableView read GetGridViewValue; + property Item: TcxGridColumn read GetItem; + published + property Footer: TcxStyle index isFooter read GetValue write SetValue; + property GroupSummary: TcxStyle index isGroupSummary read GetValue write SetValue; + property Header: TcxStyle index isHeader read GetValue write SetValue; + property OnGetFooterStyle: TcxGridGetCellStyleEvent read FOnGetFooterStyle write SetOnGetFooterStyle; + property OnGetFooterStyleEx: TcxGridGetFooterStyleExEvent read FOnGetFooterStyleEx write SetOnGetFooterStyleEx; + property OnGetFooterSummaryStyle: TcxGridGetFooterSummaryStyleEvent read FOnGetFooterSummaryStyle write SetOnGetFooterSummaryStyle; + property OnGetGroupSummaryStyle: TcxGridGetGroupSummaryStyleEvent read FOnGetGroupSummaryStyle write SetOnGetGroupSummaryStyle; + property OnGetHeaderStyle: TcxGridGetHeaderStyleEvent read FOnGetHeaderStyle write SetOnGetHeaderStyle; + end; + +{$IFNDEF BCB} + TcxGridSummariesIndex = (siFooter, siGroupFooter, siGroup); +{$ELSE} + TcxGridSummariesIndex = Integer; +{$ENDIF} + + TcxGridColumnSummaryClass = class of TcxGridColumnSummary; + + TcxGridColumnSummary = class(TcxCustomGridTableItemCustomOptions) + private + function GetDataController: TcxCustomDataController; + function GetFormat(Index: TcxGridSummariesIndex): string; + function GetKind(Index: TcxGridSummariesIndex): TcxSummaryKind; + function GetSortByGroupFooterSummary: Boolean; + function GetSortByGroupSummary: Boolean; + procedure SetFormat(Index: TcxGridSummariesIndex; const Value: string); + procedure SetKind(Index: TcxGridSummariesIndex; Value: TcxSummaryKind); + procedure SetSortByGroupFooterSummary(Value: Boolean); + procedure SetSortByGroupSummary(Value: Boolean); + protected + function GetSummaryItems(AIndex: TcxGridSummariesIndex): TcxDataSummaryItems; + function GetSummaryItemsPosition(AIndex: TcxGridSummariesIndex): TcxSummaryPosition; + property DataController: TcxCustomDataController read GetDataController; + public + procedure Assign(Source: TPersistent); override; + published + property FooterKind: TcxSummaryKind index siFooter read GetKind write SetKind stored False; + property FooterFormat: string index siFooter read GetFormat write SetFormat stored False; + property GroupFooterKind: TcxSummaryKind index siGroupFooter read GetKind write SetKind stored False; + property GroupFooterFormat: string index siGroupFooter read GetFormat write SetFormat stored False; + property GroupKind: TcxSummaryKind index siGroup read GetKind write SetKind stored False; + property GroupFormat: string index siGroup read GetFormat write SetFormat stored False; + property SortByGroupFooterSummary: Boolean read GetSortByGroupFooterSummary write SetSortByGroupFooterSummary stored False; + property SortByGroupSummary: Boolean read GetSortByGroupSummary write SetSortByGroupSummary stored False; + end; + + TcxGridColumnCompareRowValuesEvent = procedure(Sender: TcxGridColumn; + ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: TcxEditValue; + ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: TcxEditValue; + var AAreEqual: Boolean) of object; + TcxGridColumnCompareValuesEvent = procedure(Sender: TcxGridColumn; + AProperties1: TcxCustomEditProperties; const AValue1: TcxEditValue; + AProperties2: TcxCustomEditProperties; const AValue2: TcxEditValue; var AAreEqual: Boolean) of object; + TcxGridColumnCustomDrawHeaderEvent = procedure(Sender: TcxGridTableView; ACanvas: TcxCanvas; + AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean) of object; + TcxGridGroupSummaryCellCustomDrawEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + ARow: TcxGridGroupRow; AColumn: TcxGridColumn; ASummaryItem: TcxDataSummaryItem; + AViewInfo: TcxCustomGridViewCellViewInfo; var ADone: Boolean) of object; + + TcxGridColumn = class(TcxCustomGridTableItem) + private + FFooterAlignmentHorz: TAlignment; + FGroupSummaryAlignment: TAlignment; + FHeaderGlyph: TBitmap; + FHeaderGlyphAlignmentHorz: TAlignment; + FHeaderGlyphAlignmentVert: TcxAlignmentVert; + FIsFooterAlignmentHorzAssigned: Boolean; + FIsGroupSummaryAlignmentAssigned: Boolean; + FSelected: Boolean; + FSummary: TcxGridColumnSummary; + FOnCompareRowValuesForCellMerging: TcxGridColumnCompareRowValuesEvent; + FOnCompareValuesForCellMerging: TcxGridColumnCompareValuesEvent; + FOnCustomDrawFooterCell: TcxGridColumnCustomDrawHeaderEvent; + FOnCustomDrawGroupSummaryCell: TcxGridGroupSummaryCellCustomDrawEvent; + FOnCustomDrawHeader: TcxGridColumnCustomDrawHeaderEvent; + FOnHeaderClick: TNotifyEvent; + + function GetController: TcxGridTableController; + function GetFooterAlignmentHorz: TAlignment; + function GetGridView: TcxGridTableView; + function GetGroupSummaryAlignment: TAlignment; + function GetIsPreview: Boolean; + function GetOptions: TcxGridColumnOptions; + function GetStyles: TcxGridColumnStyles; + function GetViewData: TcxGridViewData; + procedure SetFooterAlignmentHorz(Value: TAlignment); + procedure SetGroupSummaryAlignment(Value: TAlignment); + procedure SetHeaderGlyph(Value: TBitmap); + procedure SetHeaderGlyphAlignmentHorz(Value: TAlignment); + procedure SetHeaderGlyphAlignmentVert(Value: TcxAlignmentVert); + procedure SetIsPreview(Value: Boolean); + procedure SetOnCompareRowValuesForCellMerging(Value: TcxGridColumnCompareRowValuesEvent); + procedure SetOnCompareValuesForCellMerging(Value: TcxGridColumnCompareValuesEvent); + procedure SetOnCustomDrawFooterCell(Value: TcxGridColumnCustomDrawHeaderEvent); + procedure SetOnCustomDrawGroupSummaryCell(Value: TcxGridGroupSummaryCellCustomDrawEvent); + procedure SetOnCustomDrawHeader(Value: TcxGridColumnCustomDrawHeaderEvent); + procedure SetOnHeaderClick(Value: TNotifyEvent); + procedure SetOptions(Value: TcxGridColumnOptions); + procedure SetSelected(Value: Boolean); + procedure SetStyles(Value: TcxGridColumnStyles); + procedure SetSummary(Value: TcxGridColumnSummary); + + function IsFooterAlignmentHorzStored: Boolean; + function IsGroupSummaryAlignmentStored: Boolean; + + procedure HeaderGlyphChanged(Sender: TObject); + protected + // IcxStoredObject + function GetStoredProperties(AProperties: TStrings): Boolean; override; + procedure GetPropertyValue(const AName: string; var AValue: Variant); override; + procedure SetPropertyValue(const AName: string; const AValue: Variant); override; + + procedure CreateSubClasses; override; + procedure DestroySubClasses; override; + function GetOptionsClass: TcxCustomGridTableItemOptionsClass; override; + function GetStylesClass: TcxCustomGridTableItemStylesClass; override; + function GetSummaryClass: TcxGridColumnSummaryClass; virtual; + + procedure AssignColumnWidths; virtual; + procedure BestFitApplied(AFireEvents: Boolean); override; + function CalculateBestFitWidth: Integer; override; + function CanCellMerging: Boolean; virtual; + function CanEdit: Boolean; override; + function CanFocus(ARecord: TcxCustomGridRecord): Boolean; override; + function CanHorzSize: Boolean; override; + function CanShowGroupFooters: Boolean; virtual; + procedure ForceWidth(Value: Integer); override; + function GetEditValue: Variant; override; + procedure SetEditValue(const Value: Variant); override; + function GetFixed: Boolean; override; + function GetIsBottom: Boolean; virtual; + function GetIsLeft: Boolean; virtual; + function GetIsMostBottom: Boolean; virtual; + function GetIsMostLeft: Boolean; virtual; + function GetIsMostRight: Boolean; virtual; + function GetIsRight: Boolean; virtual; + function GetIsTop: Boolean; virtual; + function GetVisible: Boolean; override; + function GetVisibleForCustomization: Boolean; override; + function HasFixedWidth: Boolean; override; + function HideOnGrouping: Boolean; virtual; + function IsVisibleStored: Boolean; override; + function IsVisibleForCustomizationStored: Boolean; override; + function SupportsBeginsWithFilterOperator(ARow: TcxCustomGridRow): Boolean; + //procedure VisibleChanged; dynamic; + + function GetHeaderViewInfoClass: TcxGridColumnHeaderViewInfoClass; + + procedure DoCustomDrawFooterCell(ACanvas: TcxCanvas; AViewInfo: TcxGridColumnHeaderViewInfo; + var ADone: Boolean); virtual; + procedure DoCustomDrawGroupSummaryCell(ACanvas: TcxCanvas; AViewInfo: TcxCustomGridViewCellViewInfo; + var ADone: Boolean); virtual; + procedure DoCustomDrawHeader(ACanvas: TcxCanvas; AViewInfo: TcxGridColumnHeaderViewInfo; + var ADone: Boolean); virtual; + procedure DoHeaderClick; virtual; + function HasCustomDrawFooterCell: Boolean; + function HasCustomDrawGroupSummaryCell: Boolean; + function HasCustomDrawHeader: Boolean; + + property Controller: TcxGridTableController read GetController; + property ViewData: TcxGridViewData read GetViewData; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function DoCompareValuesForCellMerging( + ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: TcxEditValue; + ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: TcxEditValue): Boolean; + procedure FocusWithSelection; override; + function GroupBy(AGroupIndex: Integer; ACanShow: Boolean = True): Boolean; + + property GridView: TcxGridTableView read GetGridView; + property GroupingDateRanges; + property Hidden; // obsolete, use VisibleForCustomization + property IsBottom: Boolean read GetIsBottom; + property IsLeft: Boolean read GetIsLeft; + property IsMostBottom: Boolean read GetIsMostBottom; + property IsMostLeft: Boolean read GetIsMostLeft; + property IsMostRight: Boolean read GetIsMostRight; + property IsPreview: Boolean read GetIsPreview write SetIsPreview; + property IsRight: Boolean read GetIsRight; + property IsTop: Boolean read GetIsTop; + property Selected: Boolean read FSelected write SetSelected; + published + property BestFitMaxWidth; + property DateTimeGrouping; + property FooterAlignmentHorz: TAlignment read GetFooterAlignmentHorz write SetFooterAlignmentHorz stored IsFooterAlignmentHorzStored; + property GroupIndex; + property GroupSummaryAlignment: TAlignment read GetGroupSummaryAlignment write SetGroupSummaryAlignment stored IsGroupSummaryAlignmentStored; + property HeaderAlignmentHorz; + property HeaderAlignmentVert; + property HeaderGlyph: TBitmap read FHeaderGlyph write SetHeaderGlyph; + property HeaderGlyphAlignmentHorz: TAlignment read FHeaderGlyphAlignmentHorz write SetHeaderGlyphAlignmentHorz default taLeftJustify; + property HeaderGlyphAlignmentVert: TcxAlignmentVert read FHeaderGlyphAlignmentVert write SetHeaderGlyphAlignmentVert default vaCenter; + property MinWidth; + property Options: TcxGridColumnOptions read GetOptions write SetOptions; + property SortIndex; + property SortOrder; + property Styles: TcxGridColumnStyles read GetStyles write SetStyles; + property Summary: TcxGridColumnSummary read FSummary write SetSummary; + property VisibleForCustomization; + property Width; + property OnCompareRowValuesForCellMerging: TcxGridColumnCompareRowValuesEvent read FOnCompareRowValuesForCellMerging write SetOnCompareRowValuesForCellMerging; + property OnCompareValuesForCellMerging: TcxGridColumnCompareValuesEvent read FOnCompareValuesForCellMerging write SetOnCompareValuesForCellMerging; + property OnCustomDrawFooterCell: TcxGridColumnCustomDrawHeaderEvent read FOnCustomDrawFooterCell write SetOnCustomDrawFooterCell; + property OnCustomDrawGroupSummaryCell: TcxGridGroupSummaryCellCustomDrawEvent read FOnCustomDrawGroupSummaryCell write SetOnCustomDrawGroupSummaryCell; + property OnCustomDrawHeader: TcxGridColumnCustomDrawHeaderEvent read FOnCustomDrawHeader write SetOnCustomDrawHeader; + property OnHeaderClick: TNotifyEvent read FOnHeaderClick write SetOnHeaderClick; + property OnInitGroupingDateRanges; + end; + + // options + + TcxGridTableBackgroundBitmaps = class(TcxCustomGridTableBackgroundBitmaps) + protected + function GetBitmapStyleIndex(Index: Integer): Integer; override; + public + procedure Assign(Source: TPersistent); override; + published + property Footer: TBitmap index bbFooter read GetValue write SetValue; + property Header: TBitmap index bbHeader read GetValue write SetValue; + property Group: TBitmap index bbGroup read GetValue write SetValue; + property GroupByBox: TBitmap index bbGroupByBox read GetValue write SetValue; + property Indicator: TBitmap index bbIndicator read GetValue write SetValue; + property Preview: TBitmap index bbPreview read GetValue write SetValue; + end; + + TcxGridTableDateTimeHandling = class(TcxCustomGridTableDateTimeHandling) + published + property DateFormat; + property Grouping; + property HourFormat; + property UseLongDateFormat; + property UseShortTimeFormat; + end; + + // behavior + + TcxGridTableOptionsBehavior = class(TcxCustomGridTableOptionsBehavior) + private + FColumnHeaderHints: Boolean; + FCopyPreviewToClipboard: Boolean; + FExpandMasterRowOnDblClick: Boolean; + procedure SetColumnHeaderHints(Value: Boolean); + procedure SetCopyPreviewToClipboard(Value: Boolean); + procedure SetExpandMasterRowOnDblClick(Value: Boolean); + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + published + property BestFitMaxRecordCount; + property ColumnHeaderHints: Boolean read FColumnHeaderHints write SetColumnHeaderHints default True; + property CopyPreviewToClipboard: Boolean read FCopyPreviewToClipboard write SetCopyPreviewToClipboard default True; + property ExpandMasterRowOnDblClick: Boolean read FExpandMasterRowOnDblClick write SetExpandMasterRowOnDblClick default True; + property FocusCellOnCycle; + property PullFocusing; + end; + + // filter + + TcxGridTableFiltering = class(TcxCustomGridTableFiltering) + private + function GetColumnFilteredItemsList: Boolean; + function GetColumnMRUItemsList: Boolean; + function GetColumnMRUItemsListCount: Integer; + function GetColumnPopup: TcxGridItemFilterPopupOptions; + procedure SetColumnFilteredItemsList(Value: Boolean); + procedure SetColumnMRUItemsList(Value: Boolean); + procedure SetColumnMRUItemsListCount(Value: Integer); + procedure SetColumnPopup(Value: TcxGridItemFilterPopupOptions); + protected + procedure DefineProperties(Filer: TFiler); override; + public + // obsolete - use ColumnPopup.DropDownWidth + property ColumnPopupDropDownWidth: Integer read GetItemPopupDropDownWidth write SetItemPopupDropDownWidth; + property DropDownWidth; + // obsolete - use ColumnPopup.MaxDropDownItemCount + property ColumnPopupMaxDropDownItemCount: Integer read GetItemPopupMaxDropDownItemCount write SetItemPopupMaxDropDownItemCount; + property MaxDropDownCount; + published + property ColumnFilteredItemsList: Boolean read GetColumnFilteredItemsList + write SetColumnFilteredItemsList default False; + property ColumnMRUItemsList: Boolean read GetColumnMRUItemsList write SetColumnMRUItemsList default True; + property ColumnMRUItemsListCount: Integer read GetColumnMRUItemsListCount + write SetColumnMRUItemsListCount default cxGridFilterDefaultItemMRUItemsListCount; + property ColumnPopup: TcxGridItemFilterPopupOptions read GetColumnPopup write SetColumnPopup; + end; + + // customize + + TcxGridTableOptionsCustomize = class(TcxCustomGridTableOptionsCustomize) + private + FColumnHidingOnGrouping: Boolean; + FColumnHorzSizing: Boolean; + FDataRowSizing: Boolean; + FGroupBySorting: Boolean; + FGroupRowSizing: Boolean; + function GetColumnFiltering: Boolean; + function GetColumnGrouping: Boolean; + function GetColumnHiding: Boolean; + function GetColumnMoving: Boolean; + function GetColumnSorting: Boolean; + function GetColumnsQuickCustomization: Boolean; + function GetColumnsQuickCustomizationMaxDropDownCount: Integer; + function GetColumnsQuickCustomizationReordering: TcxGridQuickCustomizationReordering; + function GetGridView: TcxGridTableView; + procedure SetColumnFiltering(Value: Boolean); + procedure SetColumnGrouping(Value: Boolean); + procedure SetColumnHiding(Value: Boolean); + procedure SetColumnHidingOnGrouping(Value: Boolean); + procedure SetColumnHorzSizing(Value: Boolean); + procedure SetColumnMoving(Value: Boolean); + procedure SetColumnSorting(Value: Boolean); + procedure SetColumnsQuickCustomization(Value: Boolean); + procedure SetColumnsQuickCustomizationMaxDropDownCount(Value: Integer); + procedure SetColumnsQuickCustomizationReordering(Value: TcxGridQuickCustomizationReordering); + procedure SetDataRowSizing(Value: Boolean); + procedure SetGroupBySorting(Value: Boolean); + procedure SetGroupRowSizing(Value: Boolean); + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + property GridView: TcxGridTableView read GetGridView; + published + property ColumnFiltering: Boolean read GetColumnFiltering write SetColumnFiltering default True; + property ColumnGrouping: Boolean read GetColumnGrouping write SetColumnGrouping default True; + property ColumnHiding: Boolean read GetColumnHiding write SetColumnHiding default False; + property ColumnHidingOnGrouping: Boolean read FColumnHidingOnGrouping write SetColumnHidingOnGrouping default True; + property ColumnHorzSizing: Boolean read FColumnHorzSizing write SetColumnHorzSizing default True; + property ColumnMoving: Boolean read GetColumnMoving write SetColumnMoving default True; + property ColumnSorting: Boolean read GetColumnSorting write SetColumnSorting default True; + property ColumnsQuickCustomization: Boolean read GetColumnsQuickCustomization + write SetColumnsQuickCustomization default False; + property ColumnsQuickCustomizationMaxDropDownCount: Integer read GetColumnsQuickCustomizationMaxDropDownCount + write SetColumnsQuickCustomizationMaxDropDownCount default 0; + property ColumnsQuickCustomizationReordering: TcxGridQuickCustomizationReordering + read GetColumnsQuickCustomizationReordering write SetColumnsQuickCustomizationReordering default qcrDefault; + property DataRowSizing: Boolean read FDataRowSizing write SetDataRowSizing default False; + property GroupBySorting: Boolean read FGroupBySorting write SetGroupBySorting default False; + property GroupRowSizing: Boolean read FGroupRowSizing write SetGroupRowSizing default False; + end; + + // data + + TcxGridTableOptionsData = class(TcxCustomGridTableOptionsData); + + // selection + + TcxGridTableOptionsSelection = class(TcxCustomGridTableOptionsSelection) + private + FCellMultiSelect: Boolean; + procedure SetCellMultiSelect(Value: Boolean); + function IsCellSelectStored: Boolean; + protected + function IsInvertSelectStored: Boolean; override; + function IsMultiSelectStored: Boolean; override; + procedure SetCellSelect(Value: Boolean); override; + procedure SetInvertSelect(Value: Boolean); override; + procedure SetMultiSelect(Value: Boolean); override; + public + procedure Assign(Source: TPersistent); override; + published + property CellMultiSelect: Boolean read FCellMultiSelect write SetCellMultiSelect default False; + property CellSelect stored IsCellSelectStored; + end; + + // view + + TcxGridSpecialRowOptions = class(TcxCustomGridOptions) + private + FInfoText: string; + FSeparatorColor: TColor; + FSeparatorWidth: Integer; + FVisible: Boolean; + function GetGridView: TcxGridTableView; + procedure SetInfoText(const Value: string); + procedure SetSeparatorColor(Value: TColor); + procedure SetSeparatorWidth(Value: Integer); + procedure SetVisible(Value: Boolean); + function IsInfoTextStored: Boolean; + protected + function DefaultInfoText: string; virtual; abstract; + function DefaultSeparatorColor: TColor; virtual; + procedure VisibleChanged; virtual; abstract; + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + function GetSeparatorColor: TColor; + property GridView: TcxGridTableView read GetGridView; + published + property InfoText: string read FInfoText write SetInfoText stored IsInfoTextStored; + property SeparatorColor: TColor read FSeparatorColor write SetSeparatorColor default clDefault; + property SeparatorWidth: Integer read FSeparatorWidth write SetSeparatorWidth default cxGridCustomRowSeparatorDefaultWidth; + property Visible: Boolean read FVisible write SetVisible default False; + end; + + TcxGridFilterRowApplyChangesMode = (fracOnCellExit, fracImmediately); + + TcxGridFilterRowOptionsClass = class of TcxGridFilterRowOptions; + + TcxGridFilterRowOptions = class(TcxGridSpecialRowOptions) + private + FApplyChanges: TcxGridFilterRowApplyChangesMode; + procedure SetApplyChanges(Value: TcxGridFilterRowApplyChangesMode); + protected + function DefaultInfoText: string; override; + procedure VisibleChanged; override; + public + procedure Assign(Source: TPersistent); override; + published + property ApplyChanges: TcxGridFilterRowApplyChangesMode read FApplyChanges + write SetApplyChanges default fracOnCellExit; + end; + + TcxGridNewItemRowOptionsClass = class of TcxGridNewItemRowOptions; + + TcxGridNewItemRowOptions = class(TcxGridSpecialRowOptions) + protected + function DefaultInfoText: string; override; + procedure VisibleChanged; override; + end; + + TcxGridGroupFootersMode = (gfInvisible, gfVisibleWhenExpanded, gfAlwaysVisible); + TcxGridGroupRowStyle = (grsStandard, grsOffice11); + TcxGridGroupSummaryLayout = (gslStandard, gslAlignWithColumns, + gslAlignWithColumnsAndDistribute); + + TcxGridTableOptionsView = class(TcxCustomGridTableOptionsView) + private + FColumnAutoWidth: Boolean; + FDataRowHeight: Integer; + FExpandButtonsForEmptyDetails: Boolean; + FFooter: Boolean; + FFooterAutoHeight: Boolean; + FFooterMultiSummaries: Boolean; + FGridLineColor: TColor; + FGridLines: TcxGridLines; + FGroupByBox: Boolean; + FGroupFooterMultiSummaries: Boolean; + FGroupFooters: TcxGridGroupFootersMode; + FGroupRowHeight: Integer; + FGroupRowStyle: TcxGridGroupRowStyle; + FGroupSummaryLayout: TcxGridGroupSummaryLayout; + FHeader: Boolean; + FHeaderHeight: Integer; + FIndicator: Boolean; + FIndicatorWidth: Integer; + FPrevGroupFooters: TcxGridGroupFootersMode; + FRowSeparatorColor: TColor; + FRowSeparatorWidth: Integer; + function GetExpandButtonsForEmptyDetails: Boolean; + function GetGridView: TcxGridTableView; + function GetHeaderAutoHeight: Boolean; + function GetHeaderEndEllipsis: Boolean; + function GetNewItemRow: Boolean; + function GetNewItemRowInfoText: string; + function GetNewItemRowSeparatorColor: TColor; + function GetNewItemRowSeparatorWidth: Integer; + function GetShowColumnFilterButtons: TcxGridShowItemFilterButtons; + procedure SetColumnAutoWidth(Value: Boolean); + procedure SetDataRowHeight(Value: Integer); + procedure SetExpandButtonsForEmptyDetails(Value: Boolean); + procedure SetFooter(Value: Boolean); + procedure SetFooterAutoHeight(Value: Boolean); + procedure SetFooterMultiSummaries(Value: Boolean); + procedure SetGridLineColor(Value: TColor); + procedure SetGridLines(Value: TcxGridLines); + procedure SetGroupByBox(Value: Boolean); + procedure SetGroupFooterMultiSummaries(Value: Boolean); + procedure SetGroupFooters(Value: TcxGridGroupFootersMode); + procedure SetGroupRowHeight(Value: Integer); + procedure SetGroupRowStyle(Value: TcxGridGroupRowStyle); + procedure SetGroupSummaryLayout(Value: TcxGridGroupSummaryLayout); + procedure SetHeader(Value: Boolean); + procedure SetHeaderAutoHeight(Value: Boolean); + procedure SetHeaderEndEllipsis(Value: Boolean); + procedure SetHeaderHeight(Value: Integer); + procedure SetIndicator(Value: Boolean); + procedure SetIndicatorWidth(Value: Integer); + procedure SetNewItemRow(Value: Boolean); + procedure SetNewItemRowInfoText(const Value: string); + procedure SetNewItemRowSeparatorColor(Value: TColor); + procedure SetNewItemRowSeparatorWidth(Value: Integer); + procedure SetRowSeparatorColor(Value: TColor); + procedure SetRowSeparatorWidth(Value: Integer); + procedure SetShowColumnFilterButtons(Value: TcxGridShowItemFilterButtons); + procedure ReadNewItemRow(Reader: TReader); + procedure ReadNewItemRowInfoText(Reader: TReader); + procedure ReadNewItemRowSeparatorColor(Reader: TReader); + procedure ReadNewItemRowSeparatorWidth(Reader: TReader); + protected + procedure DefineProperties(Filer: TFiler); override; + procedure ItemCaptionAutoHeightChanged; override; + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + function CanShowFooterMultiSummaries: Boolean; + function CanShowGroupFooterMultiSummaries: Boolean; + procedure CheckDataRowHeight(var AValue: Integer); virtual; + procedure CheckGroupRowHeight(var AValue: Integer); virtual; + function GetGridLineColor: TColor; + function GetGroupSummaryLayout: TcxGridGroupSummaryLayout; + function GetRowSeparatorColor: TColor; + + property GridView: TcxGridTableView read GetGridView; + // obsolete - use GridView.NewItemRow + property NewItemRow: Boolean read GetNewItemRow write SetNewItemRow; + property NewItemRowInfoText: string read GetNewItemRowInfoText write SetNewItemRowInfoText; + property NewItemRowSeparatorColor: TColor read GetNewItemRowSeparatorColor write SetNewItemRowSeparatorColor; + property NewItemRowSeparatorWidth: Integer read GetNewItemRowSeparatorWidth write SetNewItemRowSeparatorWidth; + property PrevGroupFooters: TcxGridGroupFootersMode read FPrevGroupFooters; + published + property CellAutoHeight; + property CellTextMaxLineCount; + property ColumnAutoWidth: Boolean read FColumnAutoWidth write SetColumnAutoWidth default False; + property DataRowHeight: Integer read FDataRowHeight write SetDataRowHeight default 0; + property ExpandButtonsForEmptyDetails: Boolean read GetExpandButtonsForEmptyDetails + write SetExpandButtonsForEmptyDetails default True; + property Footer: Boolean read FFooter write SetFooter default False; + property FooterAutoHeight: Boolean read FFooterAutoHeight write SetFooterAutoHeight default False; + property FooterMultiSummaries: Boolean read FFooterMultiSummaries write SetFooterMultiSummaries default False; + property GridLineColor: TColor read FGridLineColor write SetGridLineColor default clDefault; + property GridLines: TcxGridLines read FGridLines write SetGridLines default glBoth; + property GroupByBox: Boolean read FGroupByBox write SetGroupByBox default True; + property GroupFooterMultiSummaries: Boolean read FGroupFooterMultiSummaries write SetGroupFooterMultiSummaries default False; + property GroupFooters: TcxGridGroupFootersMode read FGroupFooters write SetGroupFooters default gfInvisible; + property GroupRowHeight: Integer read FGroupRowHeight write SetGroupRowHeight default 0; + property GroupRowStyle: TcxGridGroupRowStyle read FGroupRowStyle write SetGroupRowStyle default grsStandard; + property GroupSummaryLayout: TcxGridGroupSummaryLayout read FGroupSummaryLayout + write SetGroupSummaryLayout default gslStandard; + property Header: Boolean read FHeader write SetHeader default True; + property HeaderAutoHeight: Boolean read GetHeaderAutoHeight write SetHeaderAutoHeight default False; + property HeaderEndEllipsis: Boolean read GetHeaderEndEllipsis write SetHeaderEndEllipsis default False; + property HeaderHeight: Integer read FHeaderHeight write SetHeaderHeight default 0; + property Indicator: Boolean read FIndicator write SetIndicator default False; + property IndicatorWidth: Integer read FIndicatorWidth write SetIndicatorWidth default cxGridDefaultIndicatorWidth; + property RowSeparatorColor: TColor read FRowSeparatorColor write SetRowSeparatorColor default clDefault; + property RowSeparatorWidth: Integer read FRowSeparatorWidth write SetRowSeparatorWidth default 0; + property ShowColumnFilterButtons: TcxGridShowItemFilterButtons read GetShowColumnFilterButtons + write SetShowColumnFilterButtons default sfbWhenSelected; + end; + + // preview + + TcxGridPreviewPlace = (ppBottom, ppTop); + + TcxGridPreviewClass = class of TcxGridPreview; + + TcxGridPreview = class(TcxCustomGridOptions) + private + FAutoHeight: Boolean; + FColumn: TcxGridColumn; + FLeftIndent: Integer; + FMaxLineCount: Integer; + FPlace: TcxGridPreviewPlace; + FRightIndent: Integer; + FVisible: Boolean; + function GetActive: Boolean; + function GetGridView: TcxGridTableView; + procedure SetAutoHeight(Value: Boolean); + procedure SetColumn(Value: TcxGridColumn); + procedure SetLeftIndent(Value: Integer); + procedure SetMaxLineCount(Value: Integer); + procedure SetPlace(Value: TcxGridPreviewPlace); + procedure SetRightIndent(Value: Integer); + procedure SetVisible(Value: Boolean); + protected + procedure Notification(AComponent: TComponent; AOperation: TOperation); override; + procedure PropertyChanged; + public + constructor Create(AGridView: TcxCustomGridView); override; + procedure Assign(Source: TPersistent); override; + property Active: Boolean read GetActive; + property GridView: TcxGridTableView read GetGridView; + published + property AutoHeight: Boolean read FAutoHeight write SetAutoHeight default True; + property Column: TcxGridColumn read FColumn write SetColumn; + property LeftIndent: Integer read FLeftIndent write SetLeftIndent + default cxGridPreviewDefaultLeftIndent; + property MaxLineCount: Integer read FMaxLineCount write SetMaxLineCount + default cxGridPreviewDefaultMaxLineCount; + property Place: TcxGridPreviewPlace read FPlace write SetPlace default ppBottom; + property RightIndent: Integer read FRightIndent write SetRightIndent + default cxGridPreviewDefaultRightIndent; + property Visible: Boolean read FVisible write SetVisible default False; + end; + + // styles + + TcxGridGetGroupStyleEvent = procedure(Sender: TcxGridTableView; ARecord: TcxCustomGridRecord; + ALevel: Integer; {$IFDEF BCB}var{$ELSE}out{$ENDIF} AStyle: TcxStyle) of object; + + TcxGridTableViewStyles = class(TcxCustomGridTableViewStyles) + private + FProcessingGroupSortedSummary: Boolean; + FOnGetFooterStyle: TcxGridGetCellStyleEvent; + FOnGetFooterStyleEx: TcxGridGetFooterStyleExEvent; + FOnGetFooterSummaryStyle: TcxGridGetFooterSummaryStyleEvent; + FOnGetGroupStyle: TcxGridGetGroupStyleEvent; + FOnGetGroupSummaryStyle: TcxGridGetGroupSummaryStyleEvent; + FOnGetHeaderStyle: TcxGridGetHeaderStyleEvent; + FOnGetPreviewStyle: TcxGridGetCellStyleEvent; + function GetGridViewValue: TcxGridTableView; + procedure SetOnGetFooterStyle(Value: TcxGridGetCellStyleEvent); + procedure SetOnGetFooterStyleEx(Value: TcxGridGetFooterStyleExEvent); + procedure SetOnGetFooterSummaryStyle(Value: TcxGridGetFooterSummaryStyleEvent); + procedure SetOnGetGroupStyle(Value: TcxGridGetGroupStyleEvent); + procedure SetOnGetGroupSummaryStyle(Value: TcxGridGetGroupSummaryStyleEvent); + procedure SetOnGetHeaderStyle(Value: TcxGridGetHeaderStyleEvent); + procedure SetOnGetPreviewStyle(Value: TcxGridGetCellStyleEvent); + protected + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + public + procedure Assign(Source: TPersistent); override; + procedure GetCellContentParams(ARecord: TcxCustomGridRecord; AItem: TObject; + out AParams: TcxViewParams); override; + procedure GetContentParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); override; + procedure GetFooterCellParams(ARow: TcxCustomGridRow; AColumn: TcxGridColumn; + AFooterGroupLevel: Integer; ASummaryItem: TcxDataSummaryItem; out AParams: TcxViewParams); virtual; + procedure GetFooterParams(ARow: TcxCustomGridRow; AColumn: TcxGridColumn; + AFooterGroupLevel: Integer; ASummaryItem: TcxDataSummaryItem; out AParams: TcxViewParams); virtual; + procedure GetGroupParams(ARecord: TcxCustomGridRecord; ALevel: Integer; + out AParams: TcxViewParams); virtual; + procedure GetGroupSummaryCellContentParams(ARow: TcxGridGroupRow; + ASummaryItem: TcxDataSummaryItem; out AParams: TcxViewParams); virtual; + procedure GetGroupSummaryCellParams(ARow: TcxGridGroupRow; + ASummaryItem: TcxDataSummaryItem; out AParams: TcxViewParams); virtual; + procedure GetGroupSummaryParams(ARow: TcxGridGroupRow; ASummaryItem: TcxDataSummaryItem; + out AParams: TcxViewParams); virtual; + procedure GetHeaderParams(AItem: TcxGridColumn; out AParams: TcxViewParams); virtual; + procedure GetPreviewParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); virtual; + procedure GetRecordContentParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; + out AParams: TcxViewParams); override; + property GridView: TcxGridTableView read GetGridViewValue; + published + property FilterRowInfoText: TcxStyle index vsFilterRowInfoText read GetValue write SetValue; + property Footer: TcxStyle index vsFooter read GetValue write SetValue; + property Group: TcxStyle index vsGroup read GetValue write SetValue; + property GroupByBox: TcxStyle index vsGroupByBox read GetValue write SetValue; + property GroupFooterSortedSummary: TcxStyle index vsGroupFooterSortedSummary read GetValue write SetValue; + property GroupSortedSummary: TcxStyle index vsGroupSortedSummary read GetValue write SetValue; + property GroupSummary: TcxStyle index vsGroupSummary read GetValue write SetValue; + property Header: TcxStyle index vsHeader read GetValue write SetValue; + property Indicator: TcxStyle index vsIndicator read GetValue write SetValue; + property NewItemRowInfoText: TcxStyle index vsNewItemRowInfoText read GetValue write SetValue; + property Preview: TcxStyle index vsPreview read GetValue write SetValue; + property StyleSheet; + property OnGetFooterStyle: TcxGridGetCellStyleEvent read FOnGetFooterStyle write SetOnGetFooterStyle; + property OnGetFooterStyleEx: TcxGridGetFooterStyleExEvent read FOnGetFooterStyleEx write SetOnGetFooterStyleEx; + property OnGetFooterSummaryStyle: TcxGridGetFooterSummaryStyleEvent read FOnGetFooterSummaryStyle write SetOnGetFooterSummaryStyle; + property OnGetGroupStyle: TcxGridGetGroupStyleEvent read FOnGetGroupStyle write SetOnGetGroupStyle; + property OnGetGroupSummaryStyle: TcxGridGetGroupSummaryStyleEvent read FOnGetGroupSummaryStyle write SetOnGetGroupSummaryStyle; + property OnGetHeaderStyle: TcxGridGetHeaderStyleEvent read FOnGetHeaderStyle write SetOnGetHeaderStyle; + property OnGetPreviewStyle: TcxGridGetCellStyleEvent read FOnGetPreviewStyle write SetOnGetPreviewStyle; + end; + + TcxGridTableViewStyleSheet = class(TcxCustomStyleSheet) + private + function GetStylesValue: TcxGridTableViewStyles; + procedure SetStylesValue(Value: TcxGridTableViewStyles); + public + class function GetStylesClass: TcxCustomStylesClass; override; + published + property Styles: TcxGridTableViewStyles read GetStylesValue write SetStylesValue; + end; + + // grid view + + TcxGridTableSummaryGroupItemLink = class(TcxDataSummaryGroupItemLink, + {$IFNDEF DELPHI6}IUnknown,{$ENDIF} IcxStoredObject) + private + function GetColumn: TcxGridColumn; + procedure SetColumn(Value: TcxGridColumn); + function GetGridView: TcxGridTableView; + protected + // IInterface + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + // IcxStoredObject + function GetObjectName: string; + function GetProperties(AProperties: TStrings): Boolean; + procedure GetPropertyValue(const AName: string; var AValue: Variant); + procedure SetPropertyValue(const AName: string; const AValue: Variant); + property GridView: TcxGridTableView read GetGridView; + published + property Column: TcxGridColumn read GetColumn write SetColumn; + end; + + IcxGridSummaryItem = interface + ['{6F9A0C3E-E33F-4E77-9357-82F1D19CDB67}'] + function GetDisplayText: string; + function GetVisibleForCustomization: Boolean; + property DisplayText: string read GetDisplayText; + property VisibleForCustomization: Boolean read GetVisibleForCustomization; + end; + + TcxGridTableSummaryItem = class(TcxDataSummaryItem, + {$IFNDEF DELPHI6}IUnknown,{$ENDIF} IcxStoredObject, IcxGridSummaryItem) + private + FDisplayText: string; + FVisibleForCustomization: Boolean; + function GetColumn: TcxGridColumn; + function GetGridView: TcxGridTableView; + procedure SetColumn(Value: TcxGridColumn); + procedure SetDisplayText(const Value: string); + procedure SetVisibleForCustomization(Value: Boolean); + protected + // IInterface + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + // IcxStoredObject + function GetObjectName: string; + function GetProperties(AProperties: TStrings): Boolean; + procedure GetPropertyValue(const AName: string; var AValue: Variant); + procedure SetPropertyValue(const AName: string; const AValue: Variant); + // IcxGridSummaryItem + function GetDisplayText: string; + function GetVisibleForCustomization: Boolean; + + property GridView: TcxGridTableView read GetGridView; + public + constructor Create(Collection: TCollection); override; + procedure Assign(Source: TPersistent); override; + published + property Column: TcxGridColumn read GetColumn write SetColumn; + property DisplayText: string read FDisplayText write SetDisplayText; + property Sorted; + property VisibleForCustomization: Boolean read FVisibleForCustomization + write SetVisibleForCustomization default True; + end; + + TcxGridColumnEvent = procedure(Sender: TcxGridTableView; AColumn: TcxGridColumn) of object; + TcxGridIndicatorCellCustomDrawEvent = procedure(Sender: TcxGridTableView; + ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean) of object; + + TcxGridTableView = class(TcxCustomGridTableView) + private + FFilterRow: TcxGridFilterRowOptions; + FNewItemRow: TcxGridNewItemRowOptions; + FPreview: TcxGridPreview; + FOnColumnHeaderClick: TcxGridColumnEvent; + FOnColumnPosChanged: TcxGridColumnEvent; + FOnColumnSizeChanged: TcxGridColumnEvent; + FOnCustomDrawColumnHeader: TcxGridColumnCustomDrawHeaderEvent; + FOnCustomDrawFooterCell: TcxGridColumnCustomDrawHeaderEvent; + FOnCustomDrawGroupCell: TcxGridTableCellCustomDrawEvent; + FOnCustomDrawGroupSummaryCell: TcxGridGroupSummaryCellCustomDrawEvent; + FOnCustomDrawIndicatorCell: TcxGridIndicatorCellCustomDrawEvent; + FOnLeftPosChanged: TNotifyEvent; + + function GetBackgroundBitmaps: TcxGridTableBackgroundBitmaps; + function GetColumn(Index: Integer): TcxGridColumn; + function GetColumnCount: Integer; + function GetController: TcxGridTableController; + function GetDataController: TcxGridDataController; + function GetDateTimeHandling: TcxGridTableDateTimeHandling; + function GetFiltering: TcxGridTableFiltering; + function GetGroupedColumn(Index: Integer): TcxGridColumn; + function GetGroupedColumnCount: Integer; + function GetOptionsBehavior: TcxGridTableOptionsBehavior; + function GetOptionsCustomize: TcxGridTableOptionsCustomize; + function GetOptionsData: TcxGridTableOptionsData; + function GetOptionsSelection: TcxGridTableOptionsSelection; + function GetOptionsView: TcxGridTableOptionsView; + function GetPainter: TcxGridTablePainter; + function GetStyles: TcxGridTableViewStyles; + function GetViewData: TcxGridViewData; + function GetViewInfo: TcxGridTableViewInfo; + function GetVisibleColumn(Index: Integer): TcxGridColumn; + function GetVisibleColumnCount: Integer; + procedure SetBackgroundBitmaps(Value: TcxGridTableBackgroundBitmaps); + procedure SetColumn(Index: Integer; Value: TcxGridColumn); + procedure SetDataController(Value: TcxGridDataController); + procedure SetDateTimeHandling(Value: TcxGridTableDateTimeHandling); + procedure SetFiltering(Value: TcxGridTableFiltering); + procedure SetFilterRow(Value: TcxGridFilterRowOptions); + procedure SetNewItemRow(Value: TcxGridNewItemRowOptions); + procedure SetOnColumnHeaderClick(Value: TcxGridColumnEvent); + procedure SetOnColumnPosChanged(Value: TcxGridColumnEvent); + procedure SetOnColumnSizeChanged(Value: TcxGridColumnEvent); + procedure SetOnCustomDrawColumnHeader(Value: TcxGridColumnCustomDrawHeaderEvent); + procedure SetOnCustomDrawFooterCell(Value: TcxGridColumnCustomDrawHeaderEvent); + procedure SetOnCustomDrawGroupCell(Value: TcxGridTableCellCustomDrawEvent); + procedure SetOnCustomDrawGroupSummaryCell(Value: TcxGridGroupSummaryCellCustomDrawEvent); + procedure SetOnCustomDrawIndicatorCell(Value: TcxGridIndicatorCellCustomDrawEvent); + procedure SetOnLeftPosChanged(Value: TNotifyEvent); + procedure SetOptionsBehavior(Value: TcxGridTableOptionsBehavior); + procedure SetOptionsCustomize(Value: TcxGridTableOptionsCustomize); + procedure SetOptionsData(Value: TcxGridTableOptionsData); + procedure SetOptionsSelection(Value: TcxGridTableOptionsSelection); + procedure SetOptionsView(Value: TcxGridTableOptionsView); + procedure SetPreview(Value: TcxGridPreview); + procedure SetStyles(Value: TcxGridTableViewStyles); + + protected + // IcxStoredObject + function GetProperties(AProperties: TStrings): Boolean; override; + procedure GetPropertyValue(const AName: string; var AValue: Variant); override; + procedure SetPropertyValue(const AName: string; const AValue: Variant); override; + // IcxGridViewLayoutEditorSupport - for design-time layout editor + procedure AssignLayout(ALayoutView: TcxCustomGridView); override; + function GetLayoutCustomizationFormButtonCaption: string; override; + + procedure CreateOptions; override; + procedure DestroyOptions; override; + + function CanCellMerging: Boolean; virtual; + function CanOffset(ARecordCountDelta: Integer): Boolean; override; + function CanOffsetHorz: Boolean; virtual; + procedure DetailDataChanged(ADetail: TcxCustomGridView); override; + procedure DoAssign(ASource: TcxCustomGridView); override; + procedure GetItemsListForClipboard(AItems: TList; ACopyAll: Boolean); override; + function GetResizeOnBoundsChange: Boolean; override; + function HasCellMerging: Boolean; + function IsEqualHeightRecords: Boolean; override; + function IsRecordHeightDependsOnData: Boolean; override; + function UpdateOnDetailDataChange(ADetail: TcxCustomGridView): Boolean; virtual; + + function GetControllerClass: TcxCustomGridControllerClass; override; + function GetDataControllerClass: TcxCustomDataControllerClass; override; + function GetPainterClass: TcxCustomGridPainterClass; override; + function GetViewDataClass: TcxCustomGridViewDataClass; override; + function GetViewInfoClass: TcxCustomGridViewInfoClass; override; + + function GetBackgroundBitmapsClass: TcxCustomGridBackgroundBitmapsClass; override; + function GetDateTimeHandlingClass: TcxCustomGridTableDateTimeHandlingClass; override; + function GetFilteringClass: TcxCustomGridTableFilteringClass; override; + function GetFilterRowOptionsClass: TcxGridFilterRowOptionsClass; virtual; + function GetNewItemRowOptionsClass: TcxGridNewItemRowOptionsClass; virtual; + function GetOptionsBehaviorClass: TcxCustomGridOptionsBehaviorClass; override; + function GetOptionsCustomizeClass: TcxCustomGridTableOptionsCustomizeClass; override; + function GetOptionsDataClass: TcxCustomGridOptionsDataClass; override; + function GetOptionsSelectionClass: TcxCustomGridOptionsSelectionClass; override; + function GetOptionsViewClass: TcxCustomGridOptionsViewClass; override; + function GetPreviewClass: TcxGridPreviewClass; virtual; + function GetStylesClass: TcxCustomGridViewStylesClass; override; + + function GetSummaryGroupItemLinkClass: TcxDataSummaryGroupItemLinkClass; override; + function GetSummaryItemClass: TcxDataSummaryItemClass; override; + + function GetItemClass: TcxCustomGridTableItemClass; override; + procedure ItemVisibilityChanged(AItem: TcxCustomGridTableItem; Value: Boolean); override; + + function CalculateDataCellSelected(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; AUseViewInfo: Boolean; + ACellViewInfo: TcxGridTableCellViewInfo): Boolean; override; + + procedure DoColumnHeaderClick(AColumn: TcxGridColumn); virtual; + procedure DoColumnPosChanged(AColumn: TcxGridColumn); virtual; + procedure DoColumnSizeChanged(AColumn: TcxGridColumn); virtual; + procedure DoCustomDrawColumnHeader(ACanvas: TcxCanvas; AViewInfo: TcxGridColumnHeaderViewInfo; + var ADone: Boolean); virtual; + procedure DoCustomDrawFooterCell(ACanvas: TcxCanvas; AViewInfo: TcxGridColumnHeaderViewInfo; + var ADone: Boolean); virtual; + procedure DoCustomDrawGroupCell(ACanvas: TcxCanvas; AViewInfo: TcxGridTableCellViewInfo; + var ADone: Boolean); virtual; + procedure DoCustomDrawGroupSummaryCell(ACanvas: TcxCanvas; AViewInfo: TcxCustomGridViewCellViewInfo; + var ADone: Boolean); virtual; + procedure DoCustomDrawIndicatorCell(ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; + var ADone: Boolean); virtual; + procedure DoLeftPosChanged; virtual; + function HasCustomDrawColumnHeader: Boolean; + function HasCustomDrawFooterCell: Boolean; + function HasCustomDrawGroupCell: Boolean; + function HasCustomDrawGroupSummaryCell: Boolean; + function HasCustomDrawIndicatorCell: Boolean; + public + function CreateColumn: TcxGridColumn; + + // for extended lookup edit + class function CanBeLookupList: Boolean; override; + + property ColumnCount: Integer read GetColumnCount; + property Columns[Index: Integer]: TcxGridColumn read GetColumn write SetColumn; + property Controller: TcxGridTableController read GetController; + property GroupedColumnCount: Integer read GetGroupedColumnCount; + property GroupedColumns[Index: Integer]: TcxGridColumn read GetGroupedColumn; + property Painter: TcxGridTablePainter read GetPainter; + property ViewData: TcxGridViewData read GetViewData; + property ViewInfo: TcxGridTableViewInfo read GetViewInfo; + property VisibleColumnCount: Integer read GetVisibleColumnCount; + property VisibleColumns[Index: Integer]: TcxGridColumn read GetVisibleColumn; + published + property BackgroundBitmaps: TcxGridTableBackgroundBitmaps read GetBackgroundBitmaps write SetBackgroundBitmaps; + property DataController: TcxGridDataController read GetDataController write SetDataController; + property DateTimeHandling: TcxGridTableDateTimeHandling read GetDateTimeHandling write SetDateTimeHandling; + property Filtering: TcxGridTableFiltering read GetFiltering write SetFiltering; + property FilterRow: TcxGridFilterRowOptions read FFilterRow write SetFilterRow; + property NewItemRow: TcxGridNewItemRowOptions read FNewItemRow write SetNewItemRow; + property OptionsBehavior: TcxGridTableOptionsBehavior read GetOptionsBehavior write SetOptionsBehavior; + property OptionsCustomize: TcxGridTableOptionsCustomize read GetOptionsCustomize write SetOptionsCustomize; + property OptionsData: TcxGridTableOptionsData read GetOptionsData write SetOptionsData; + property OptionsSelection: TcxGridTableOptionsSelection read GetOptionsSelection write SetOptionsSelection; + property OptionsView: TcxGridTableOptionsView read GetOptionsView write SetOptionsView; + property Preview: TcxGridPreview read FPreview write SetPreview; + property Styles: TcxGridTableViewStyles read GetStyles write SetStyles ; + + property OnColumnHeaderClick: TcxGridColumnEvent read FOnColumnHeaderClick write SetOnColumnHeaderClick; + property OnColumnPosChanged: TcxGridColumnEvent read FOnColumnPosChanged write SetOnColumnPosChanged; + property OnColumnSizeChanged: TcxGridColumnEvent read FOnColumnSizeChanged write SetOnColumnSizeChanged; + property OnCustomDrawColumnHeader: TcxGridColumnCustomDrawHeaderEvent read FOnCustomDrawColumnHeader write SetOnCustomDrawColumnHeader; + property OnCustomDrawFooterCell: TcxGridColumnCustomDrawHeaderEvent read FOnCustomDrawFooterCell write SetOnCustomDrawFooterCell; + property OnCustomDrawGroupCell: TcxGridTableCellCustomDrawEvent read FOnCustomDrawGroupCell write SetOnCustomDrawGroupCell; + property OnCustomDrawGroupSummaryCell: TcxGridGroupSummaryCellCustomDrawEvent read FOnCustomDrawGroupSummaryCell write SetOnCustomDrawGroupSummaryCell; + property OnCustomDrawIndicatorCell: TcxGridIndicatorCellCustomDrawEvent read FOnCustomDrawIndicatorCell write SetOnCustomDrawIndicatorCell; + property OnCustomization; + property OnInitGroupingDateRanges; + property OnLeftPosChanged: TNotifyEvent read FOnLeftPosChanged write SetOnLeftPosChanged; + end; + + { TcxGridColumnAccess } + + TcxGridColumnAccess = class + public + class function CanCellMerging(AInstance: TcxGridColumn): Boolean; + class function CanShowGroupFooters(AInstance: TcxGridColumn): Boolean; + class procedure DoCustomDrawGroupSummaryCell(AInstance: TcxGridColumn; + ACanvas: TcxCanvas; AViewInfo: TcxCustomGridViewCellViewInfo; var ADone: Boolean); virtual; + class function HasCustomDrawGroupSummaryCell(AInstance: TcxGridColumn): Boolean; + end; + + { TcxGridTableViewAccess } + + TcxGridTableViewAccess = class + public + class procedure DoColumnPosChanged(AInstance: TcxGridTableView; + AColumn: TcxGridColumn); + class procedure DoCustomDrawGroupCell(AInstance: TcxGridTableView; + ACanvas: TcxCanvas; AViewInfo: TcxGridTableCellViewInfo; var ADone: Boolean); + class procedure DoCustomDrawGroupSummaryCell(AInstance: TcxGridTableView; + ACanvas: TcxCanvas; AViewInfo: TcxCustomGridViewCellViewInfo; var ADone: Boolean); virtual; + class function HasCustomDrawGroupCell(AInstance: TcxGridTableView): Boolean; + class function HasCustomDrawGroupSummaryCell(AInstance: TcxGridTableView): Boolean; + end; + +implementation + +uses + SysUtils, Math, dxOffice11, cxVariants, cxDataUtils, cxFilterControlUtils, + cxLibraryConsts, cxGridRows, cxGridStrs; + +const + GroupByBoxLeftOffset = 6; + GroupByBoxTopOffset = 8; + GroupByBoxHorOffset = 4; + GroupByBoxLineVerOffset = 4; + GroupByBoxColumnWidth = 100; + GroupByBoxLineWidth = 1; + GroupByBoxLineColor = clBtnText; + HScrollDelta = 10; + + FooterSeparatorWidth = 1; + + TopIndexNone = -2; + RowIndexNone = -1; + + ColumnHeaderHitTestCodes = [htColumnHeader]; + + ColumnHeaderMovingZoneSize = 15; + + ColumnSizingMarkWidth = 1; + RowSizingMarkWidth = 1; + + ScrollHotZoneWidth = 15; + +type + TcxCustomGridAccess = class(TcxCustomGrid); + +{ TcxGridGroupByBoxHitTest } + +class function TcxGridGroupByBoxHitTest.GetHitTestCode: Integer; +begin + Result := htGroupByBox; +end; + +{ TcxGridColumnHeaderHitTest } + +class function TcxGridColumnHeaderHitTest.GetHitTestCode: Integer; +begin + Result := htColumnHeader; +end; + +function TcxGridColumnHeaderHitTest.DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; +begin + if Column.CanMove then + Result := TcxGridTableView(GridView).Controller.GetColumnHeaderDragAndDropObjectClass + else + Result := nil; +end; + +{ TcxGridColumnHeaderHorzSizingEdgeHitTest } + +class function TcxGridColumnHeaderHorzSizingEdgeHitTest.GetHitTestCode: Integer; +begin + Result := htColumnHeaderHorzSizingEdge; +end; + +function TcxGridColumnHeaderHorzSizingEdgeHitTest.Cursor: TCursor; +begin + Result := crcxGridHorzSize; +end; + +function TcxGridColumnHeaderHorzSizingEdgeHitTest.DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; +begin + Result := TcxGridColumnHorzSizingObject; +end; + +{ TcxGridColumnHeaderFilterButtonHitTest } + +class function TcxGridColumnHeaderFilterButtonHitTest.GetHitTestCode: Integer; +begin + Result := htColumnHeaderFilterButton; +end; + +{ TcxGridHeaderHitTest } + +class function TcxGridHeaderHitTest.GetHitTestCode: Integer; +begin + Result := htHeader; +end; + +{ TcxGridFooterHitTest } + +class function TcxGridFooterHitTest.GetHitTestCode: Integer; +begin + Result := htFooter; +end; + +{ TcxGridFooterCellHitTest } + +class function TcxGridFooterCellHitTest.GetHitTestCode: Integer; +begin + Result := htFooterCell; +end; + +{ TcxGridGroupFooterHitTest } + +class function TcxGridGroupFooterHitTest.GetHitTestCode: Integer; +begin + Result := htGroupFooter; +end; + +{ TcxGridGroupFooterCellHitTest } + +class function TcxGridGroupFooterCellHitTest.GetHitTestCode: Integer; +begin + Result := htGroupFooterCell; +end; + +{ TcxGridRowIndicatorHitTest } + +class function TcxGridRowIndicatorHitTest.GetHitTestCode: Integer; +begin + Result := htRowIndicator; +end; + +function TcxGridRowIndicatorHitTest.Cursor: TCursor; +begin + if MultiSelect then + Result := crcxGridSelectRow + else + Result := inherited Cursor; +end; + +{ TcxGridRowSizingEdgeHitTest } + +class function TcxGridRowSizingEdgeHitTest.GetHitTestCode: Integer; +begin + Result := htRowSizingEdge; +end; + +function TcxGridRowSizingEdgeHitTest.Cursor: TCursor; +begin + Result := crcxGridVertSize; +end; + +function TcxGridRowSizingEdgeHitTest.DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; +begin + Result := TcxGridRowSizingObject; +end; + +{ TcxGridIndicatorHitTest } + +class function TcxGridIndicatorHitTest.GetHitTestCode: Integer; +begin + Result := htIndicator; +end; + +{ TcxGridIndicatorHeaderHitTest } + +class function TcxGridIndicatorHeaderHitTest.GetHitTestCode: Integer; +begin + Result := htIndicatorHeader; +end; + +{ TcxGridRowLevelIndentHitTest } + +class function TcxGridRowLevelIndentHitTest.GetHitTestCode: Integer; +begin + Result := htRowLevelIndent; +end; + +class function TcxGridRowLevelIndentHitTest.CanClick: Boolean; +begin + Result := False; +end; + +{ TcxGridGroupSummaryHitTest } + +function TcxGridGroupSummaryHitTest.GetColumn: TcxGridColumn; +begin + if SummaryItem = nil then + Result := nil + else + Result := SummaryItem.ItemLink as TcxGridColumn; +end; + +class function TcxGridGroupSummaryHitTest.GetHitTestCode: Integer; +begin + Result := htGroupSummary; +end; + +{ TcxCustomGridRow } + +function TcxCustomGridRow.GetAsGroupRow: TcxGridGroupRow; +begin + Result := Self as TcxGridGroupRow; +end; + +function TcxCustomGridRow.GetAsMasterDataRow: TcxGridMasterDataRow; +begin + Result := Self as TcxGridMasterDataRow; +end; + +function TcxCustomGridRow.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxCustomGridRow.GetGridViewLevel: TcxGridLevel; +begin + Result := TcxGridLevel(GridView.Level); +end; + +function TcxCustomGridRow.GetIsFilterRow: Boolean; +begin + Result := ViewData.FilterRow = Self; +end; + +function TcxCustomGridRow.GetIsNewItemRow: Boolean; +begin + Result := IsNewItemRecord; +end; + +function TcxCustomGridRow.GetViewData: TcxGridViewData; +begin + Result := TcxGridViewData(inherited ViewData); +end; + +procedure TcxCustomGridRow.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited; + case Key of + VK_LEFT: + if Expandable and Expanded then + begin + Expanded := False; + Key := 0; + end; + VK_RIGHT: + if Expandable and not Expanded then + begin + Expanded := True; + Key := 0; + end; + VK_MULTIPLY: + if Expandable then + begin + GridView.Controller.EatKeyPress := True; + Expand(True); + Key := 0; + end; + end; +end; + +function TcxCustomGridRow.ExpandOnDblClick: Boolean; +begin + Result := Expandable; +end; + +function TcxCustomGridRow.SupportsCellMultiSelect: Boolean; +begin + Result := False; +end; + +{ TcxGridDataRow } + +function TcxGridDataRow.GetHasCells: Boolean; +begin + Result := True; +end; + +function TcxGridDataRow.GetViewInfoCacheItemClass: TcxCustomGridViewInfoCacheItemClass; +begin + Result := TcxGridTableViewInfoCacheItem; +end; + +function TcxGridDataRow.GetViewInfoClass: TcxCustomGridRecordViewInfoClass; +begin + Result := TcxGridDataRowViewInfo; +end; + +function TcxGridDataRow.SupportsCellMultiSelect: Boolean; +begin + Result := True; +end; + +{ TcxGridNewItemRow } + +function TcxGridNewItemRow.SupportsCellMultiSelect: Boolean; +begin + Result := False; +end; + +{ TcxGridFilterRow } + +destructor TcxGridFilterRow.Destroy; +begin + Selected := False; + inherited; +end; + +function TcxGridFilterRow.GetFilterCriteriaItem(Index: Integer): TcxFilterCriteriaItem; +begin + Result := GridView.Columns[Index].DataBinding.FilterCriteriaItem; + if (Result <> nil) and not IsFilterOperatorSupported(Result.OperatorKind, Result.Value) then + Result := nil; +end; + +procedure TcxGridFilterRow.RefreshRecordInfo; +begin + with RecordInfo do + begin + Expanded := False; + Level := 0; + RecordIndex := -1; + end +end; + +function TcxGridFilterRow.GetSelected: Boolean; +begin + Result := FSelected; +end; + +function TcxGridFilterRow.GetVisible: Boolean; +begin + Result := True; +end; + +procedure TcxGridFilterRow.SetSelected(Value: Boolean); +begin + if FSelected <> Value then + begin + GridView.Controller.FilterRowFocusChanging(Value); + FSelected := Value; + Invalidate; + GridView.Controller.FilterRowFocusChanged; + end; +end; + +function TcxGridFilterRow.GetDisplayText(Index: Integer): string; +var + AFilterCriteriaItem: TcxFilterCriteriaItem; +begin + AFilterCriteriaItem := FilterCriteriaItems[Index]; + if AFilterCriteriaItem = nil then + Result := '' + else + Result := AFilterCriteriaItem.DisplayValue; +end; + +function TcxGridFilterRow.GetValue(Index: Integer): Variant; +var + AFilterCriteriaItem: TcxFilterCriteriaItem; +begin + AFilterCriteriaItem := FilterCriteriaItems[Index]; + if AFilterCriteriaItem = nil then + Result := Null + else + Result := AFilterCriteriaItem.Value; +end; + +procedure TcxGridFilterRow.SetDisplayText(Index: Integer; const Value: string); +var + AFilterCriteriaItem: TcxFilterCriteriaItem; +begin + AFilterCriteriaItem := FilterCriteriaItems[Index]; + if AFilterCriteriaItem <> nil then + AFilterCriteriaItem.DisplayValue := Value; +end; + +procedure TcxGridFilterRow.SetValue(Index: Integer; const Value: Variant); +var + AGridView: TcxGridTableView; +begin + AGridView := GridView; + AGridView.Controller.KeepFilterRowFocusing := True; + try + if VarIsSoftNull(Value) then + AGridView.Columns[Index].DataBinding.Filtered := False + else + begin + DataController.Filter.BeginUpdate; + try + DataController.Filter.Active := True; + AGridView.Columns[Index].DataBinding.AddToFilter(nil, + GetFilterOperatorKind(Value, True), Value, + GetDisplayTextForValue(Index, Value), True); + finally + DataController.Filter.EndUpdate; + end; + end; + finally + AGridView.Controller.KeepFilterRowFocusing := False; + end; +end; + +function TcxGridFilterRow.GetDisplayTextForValue(AIndex: Integer; const AValue: Variant): string; +var + AValueList: TcxGridFilterValueList; + AValueIndex: Integer; +begin + AValueList := ViewData.CreateFilterValueList; + try + GridView.Columns[AIndex].DataBinding.GetFilterValues(AValueList); + AValueIndex := AValueList.FindItemByValue(AValue); + if AValueIndex = -1 then + Result := GridView.Columns[AIndex].GetProperties(Self).GetDisplayText(AValue) + else + Result := AValueList[AValueIndex].DisplayText; + finally + AValueList.Free; + end; +end; + +function TcxGridFilterRow.GetFilterOperatorKind(const AValue: Variant; ACheckMask: Boolean): TcxFilterOperatorKind; + + function HasMask(const AValue: string): Boolean; + begin + Result := + (Pos(DataController.Filter.PercentWildcard, AValue) <> 0) or + (Pos(DataController.Filter.UnderscoreWildcard, AValue) <> 0); + end; + +begin + if VarIsStr(AValue) and (not ACheckMask or HasMask(AValue)) then + Result := foLike + else + Result := foEqual; +end; + +function TcxGridFilterRow.IsFilterOperatorSupported(AKind: TcxFilterOperatorKind; + const AValue: Variant): Boolean; +begin + Result := (AKind = foEqual) or (GetFilterOperatorKind(AValue, False) = AKind); +end; + +procedure TcxGridFilterRow.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited; + if Key = VK_ESCAPE then + begin + Focused := False; + Key := 0; + end; +end; + +function TcxGridFilterRow.CanFocusCells: Boolean; +begin + Result := True; +end; + +function TcxGridFilterRow.IsEmpty: Boolean; +{var + I: Integer;} +begin +{ for I := 0 to ValueCount - 1 do + begin + Result := FilterCriteriaItems[I] = nil; + if not Result then Exit; + end; + Result := True;} + Result := DataController.Filter.IsEmpty; +end; + +{ TcxGridMasterDataRow } + +function TcxGridMasterDataRow.GetActiveDetailGridView: TcxCustomGridView; +begin + if ActiveDetailIndex = -1 then + Result := nil + else + Result := DetailGridViews[ActiveDetailIndex]; +end; + +function TcxGridMasterDataRow.GetActiveDetailGridViewExists: Boolean; +begin + Result := IsValid and (ActiveDetailIndex <> -1) and DetailGridViewExists[ActiveDetailIndex]; +end; + +function TcxGridMasterDataRow.GetActiveDetailIndex: Integer; +begin + Result := InternalActiveDetailIndex; + if (Result <> -1) and not GridView.IsDestroying then + if not GridViewLevel[Result].Visible then + begin + GridView.BeginUpdate; + try + Result := GridView.GetDefaultActiveDetailIndex; + ActiveDetailIndex := Result; + finally + GridView.CancelUpdate; + end; + end + else + if not GridViewLevel.Options.TabsForEmptyDetails and not DetailGridViewHasData[Result] then + begin + GridView.BeginUpdate; + try + for Result := 0 to DetailGridViewCount - 1 do + if DetailGridViewHasData[Result] then + begin + ActiveDetailIndex := Result; + Exit; + end; + Result := -1; + finally + GridView.CancelUpdate; + end; + end; +end; + +function TcxGridMasterDataRow.GetActiveDetailLevel: TcxGridLevel; +begin + if ActiveDetailIndex = -1 then + Result := nil + else + Result := GridViewLevel[ActiveDetailIndex]; +end; + +function TcxGridMasterDataRow.GetDetailGridView(Index: Integer): TcxCustomGridView; +begin + Result := DataController.GetDetailLinkObject(RecordIndex, Index) as TcxCustomGridView; +end; + +function TcxGridMasterDataRow.GetDetailGridViewCount: Integer; +begin + Result := DataController.Relations.Count; +end; + +function TcxGridMasterDataRow.GetDetailGridViewExists(Index: Integer): Boolean; +begin + Result := DataController.IsDetailDataControllerExist(RecordIndex, Index); +end; + +function TcxGridMasterDataRow.GetDetailGridViewHasData(Index: Integer): Boolean; +begin + Result := DataController.GetDetailHasChildren(RecordIndex, Index); +end; + +function TcxGridMasterDataRow.GetInternalActiveDetailGridView: TcxCustomGridView; +begin + if InternalActiveDetailIndex = -1 then + Result := nil + else + Result := DetailGridViews[InternalActiveDetailIndex]; +end; + +function TcxGridMasterDataRow.GetInternalActiveDetailGridViewExists: Boolean; +begin + Result := IsValid and (InternalActiveDetailIndex <> -1) and DetailGridViewExists[InternalActiveDetailIndex]; +end; + +function TcxGridMasterDataRow.GetInternalActiveDetailIndex: Integer; +begin + Result := DataController.GetDetailActiveRelationIndex(RecordIndex); +end; + +procedure TcxGridMasterDataRow.SetActiveDetailIndex(Value: Integer); +var + AGridView: TcxCustomGridTableView; + APrevValue: Integer; + ANewActiveDetailLevel: TcxGridLevel; +begin + AGridView := GridView; + APrevValue := InternalActiveDetailIndex; + if APrevValue <> Value then + begin + ANewActiveDetailLevel := GridViewLevel.Items[Value]; + DataController.ChangeDetailActiveRelationIndex(RecordIndex, Value); + //if InternalActiveDetailIndex <> APrevValue then + TcxCustomGridAccess(AGridView.Control).DoActiveTabChanged(ANewActiveDetailLevel); + end; +end; + +procedure TcxGridMasterDataRow.SetActiveDetailLevel(Value: TcxGridLevel); +begin + if Value.Parent = GridViewLevel then + ActiveDetailIndex := Value.Index; +end; + +procedure TcxGridMasterDataRow.DoCollapse(ARecurse: Boolean); +var + I: Integer; + AGridView: TcxCustomGridView; +begin + //GridView.BeginUpdate; + try + if Expanded and ARecurse then + for I := 0 to DetailGridViewCount - 1 do + if DetailGridViewExists[I] then + begin + AGridView := DetailGridViews[I]; + if AGridView is TcxCustomGridTableView then + TcxCustomGridTableView(AGridView).ViewData.Collapse(ARecurse); + end; + DataController.ChangeDetailExpanding(RecordIndex, False); + finally + //GridView.EndUpdate; + end; +end; + +procedure TcxGridMasterDataRow.DoExpand(ARecurse: Boolean); +var + AViewData: TcxGridViewData; + ARecordIndex, I: Integer; + ARecord: TcxCustomGridRecord; + AGridView: TcxCustomGridView; +begin + AViewData := ViewData; + ARecordIndex := RecordIndex; + if not DataController.ChangeDetailExpanding(RecordIndex, True) then Exit; + ARecord := AViewData.GetRecordByRecordIndex(ARecordIndex); + if Self <> ARecord then + if ARecord is TcxGridMasterDataRow then + TcxGridMasterDataRow(ARecord).DoExpand(ARecurse) + else + else + if Expanded and ARecurse then + for I := 0 to DetailGridViewCount - 1 do + begin + AGridView := DetailGridViews[I]; + if AGridView is TcxCustomGridTableView then + TcxCustomGridTableView(AGridView).ViewData.Expand(ARecurse); + end; +end; + +function TcxGridMasterDataRow.GetExpandable: Boolean; +begin + Result := GridView.OptionsView.ExpandButtonsForEmptyDetails or + HasChildren or Expanded; +end; + +function TcxGridMasterDataRow.GetExpanded: Boolean; +begin + Result := DataController.GetDetailExpanding(RecordInfo.RecordIndex); +end; + +function TcxGridMasterDataRow.GetHasChildren: Boolean; +var + I: Integer; + ADataRelation: TcxCustomDataRelation; +begin + for I := 0 to GridViewLevel.VisibleCount - 1 do + begin + ADataRelation := GridViewLevel.VisibleItems[I].DataRelation; + //if ADataRelation <> nil then //!!! + begin + Result := DetailGridViewHasData[ADataRelation.Index]; + if Result then Exit; + end; + end; + Result := False; +end; + +function TcxGridMasterDataRow.GetViewInfoCacheItemClass: TcxCustomGridViewInfoCacheItemClass; +begin + Result := TcxGridMasterTableViewInfoCacheItem; +end; + +function TcxGridMasterDataRow.GetViewInfoClass: TcxCustomGridRecordViewInfoClass; +begin + Result := TcxGridMasterDataRowViewInfo; +end; + +procedure TcxGridMasterDataRow.KeyDown(var Key: Word; Shift: TShiftState); +begin + //if not ((Key = VK_LEFT) or (Key = VK_RIGHT)) then - AS5427 + inherited; +end; + +procedure TcxGridMasterDataRow.ToggleExpanded; +var + AGridView: TcxGridTableView; + AGridRecordIndex: Integer; +begin + if DataController.IsGridMode and not Expanded and not Focused then + begin + AGridView := GridView; + AGridRecordIndex := RecordIndex; + inherited; + if (AGridView.DataController.FocusedRecordIndex = AGridRecordIndex) then + AGridView.Controller.SelectFocusedRecord; + end + else + inherited; +end; + +function TcxGridMasterDataRow.ExpandOnDblClick: Boolean; +begin + Result := inherited ExpandOnDblClick and + GridView.OptionsBehavior.ExpandMasterRowOnDblClick; +end; + +function TcxGridMasterDataRow.GetFirstFocusableChild: TcxCustomGridRecord; +var + AGridView: TcxCustomGridView; + AGridRecordIndex: Integer; + ACycleChanged: Boolean; +begin + Result := inherited GetFirstFocusableChild; + if Expanded then + begin + AGridView := ActiveDetailGridView; + if (AGridView is TcxGridTableView) and TcxGridTableView(AGridView).ViewData.HasFilterRow then + Result := TcxGridTableView(AGridView).ViewData.FilterRow + else + if AGridView is TcxCustomGridTableView then + with TcxCustomGridTableView(AGridView) do + if ViewData.HasNewItemRecord then + Result := ViewData.NewItemRecord + else + begin + AGridRecordIndex := Controller.FindNextRecord(-1, True, False, ACycleChanged); + if AGridRecordIndex <> -1 then + Result := ViewData.Records[AGridRecordIndex]; + end; + end; +end; + +function TcxGridMasterDataRow.GetLastFocusableChild(ARecursive: Boolean): TcxCustomGridRecord; +var + AGridView: TcxCustomGridView; + AGridRecordIndex: Integer; + AGridRecord: TcxCustomGridRecord; + ACycleChanged: Boolean; +begin + Result := inherited GetLastFocusableChild(ARecursive); + if Expanded then + begin + AGridView := ActiveDetailGridView; + if AGridView is TcxCustomGridTableView then + with TcxCustomGridTableView(AGridView) do + begin + AGridRecordIndex := Controller.FindNextRecord(-1, False, True, ACycleChanged); + if AGridRecordIndex <> -1 then + begin + Result := ViewData.Records[AGridRecordIndex]; + if ARecursive then + begin + AGridRecord := Result.GetLastFocusableChild(ARecursive); + if AGridRecord <> nil then Result := AGridRecord; + end; + end + else + if ViewData.HasNewItemRecord then + Result := ViewData.NewItemRecord + else + if (AGridView is TcxGridTableView) and + TcxGridTableView(AGridView).ViewData.HasFilterRow then + Result := TcxGridTableView(AGridView).ViewData.FilterRow; + end; + end; +end; + +{ TcxGridGroupRow } + +function TcxGridGroupRow.GetGroupedColumn: TcxGridColumn; +begin + Result := GridView.GroupedColumns[Level]; +end; + +function TcxGridGroupRow.GetGroupSummaryItems: TcxDataGroupSummaryItems; +begin + Result := DataController.Summary.GroupSummaryItems[Level]; +end; + +procedure TcxGridGroupRow.DoCollapse(ARecurse: Boolean); +begin + if ARecurse or Expanded then //!!! + DataController.Groups.ChangeExpanding(Index, False, ARecurse); +end; + +procedure TcxGridGroupRow.DoExpand(ARecurse: Boolean); +begin + if ARecurse or not Expanded then //!!! + DataController.Groups.ChangeExpanding(Index, True, ARecurse); +end; + +{function TcxGridGroupRow.GetDestroyingOnExpanding: Boolean; +begin + Result := True; +end;} + +function TcxGridGroupRow.GetExpandable: Boolean; +begin + Result := not (dcoGroupsAlwaysExpanded in DataController.Options); +end; + +function TcxGridGroupRow.GetExpanded: Boolean; +begin + Result := RecordInfo.Expanded; +end; + +function TcxGridGroupRow.GetDisplayCaption: string; +begin + Result := GroupedColumn.GetAlternateCaption; + if Result <> '' then + Result := Result + ' : '; + Result := Result + DisplayTexts[-1]; +end; + +function TcxGridGroupRow.GetDisplayText(Index: Integer): string; +begin + if ViewData.HasCustomDataHandling(GroupedColumn, doGrouping) then + Result := ViewData.GetCustomDataDisplayText(RecordIndex, GroupedColumn.Index, doGrouping) + else + Result := inherited GetDisplayText(Index); +end; + +function TcxGridGroupRow.GetDisplayTextValue: string; +var + S: string; +begin + Result := DisplayCaption; + S := DataController.Summary.GroupSummaryText[Index]; + if S <> '' then + Result := Result + ' ' + S; +end; + +function TcxGridGroupRow.GetIsData: Boolean; +begin + Result := False; +end; + +function TcxGridGroupRow.GetIsParent: Boolean; +begin + Result := RecordInfo.Level < DataController.Groups.GroupingItemCount; //!!! +end; + +function TcxGridGroupRow.GetValue: Variant; +begin + Result := Values[-1]; + if ViewData.HasCustomDataHandling(GroupedColumn, doGrouping) then + Result := ViewData.GetCustomDataValue(GroupedColumn, Result, doGrouping); +end; + +function TcxGridGroupRow.GetViewInfoCacheItemClass: TcxCustomGridViewInfoCacheItemClass; +begin + Result := TcxGridTableViewInfoCacheItem; +end; + +function TcxGridGroupRow.GetViewInfoClass: TcxCustomGridRecordViewInfoClass; +begin + Result := TcxGridGroupRowViewInfo; +end; + +procedure TcxGridGroupRow.SetDisplayText(Index: Integer; const Value: string); +begin +end; + +procedure TcxGridGroupRow.SetValue(Index: Integer; const Value: Variant); +begin +end; + +function TcxGridGroupRow.GetGroupSummaryInfo(var ASummaryItems: TcxDataSummaryItems; + var ASummaryValues: PVariant): Boolean; +begin + Result := DataController.Summary.GetGroupSummaryInfo(Index, ASummaryItems, ASummaryValues); +end; + +{ TcxGridViewData } + +destructor TcxGridViewData.Destroy; +begin + DestroyFilterRow; + inherited; +end; + +function TcxGridViewData.GetNewItemRow: TcxGridNewItemRow; +begin + Result := TcxGridNewItemRow(NewItemRecord); +end; + +function TcxGridViewData.GetRow(Index: Integer): TcxCustomGridRow; +begin + Result := TcxCustomGridRow(Records[Index]); +end; + +function TcxGridViewData.GetRowCount: Integer; +begin + Result := RecordCount; +end; + +function TcxGridViewData.GetFirstVisibleExpandedMasterRow: TcxGridMasterDataRow; + + function GetExistingVisibleExpandedMasterRowIndex: Integer; + begin + for Result := Controller.TopRecordIndex to Controller.TopRecordIndex + ViewInfo.RecordsViewInfo.VisibleCount - 1 do + if (Rows[Result] is TcxGridMasterDataRow) and Rows[Result].Expanded then + Exit; + Result := -1; + end; + + function FindMasterRowAndMakeItExpandedAndVisible: Integer; + begin + Result := Controller.TopRecordIndex; + if Rows[Result] is TcxGridGroupRow then + begin + Rows[Result].Expand(True); + while (Result < RowCount) and not (Rows[Result] is TcxGridMasterDataRow) do + Inc(Result); + end; + if Result < RowCount then + Rows[Result].Expanded := True + else + Result := -1; + end; + +var + ARowIndex: Integer; +begin + if (RowCount = 0) or not GridView.IsMaster then + Result := nil + else + begin + ARowIndex := GetExistingVisibleExpandedMasterRowIndex; + if ARowIndex = -1 then + ARowIndex := FindMasterRowAndMakeItExpandedAndVisible; + if ARowIndex = -1 then + Result := nil + else + Result := Rows[ARowIndex].AsMasterDataRow; + end; +end; + +function TcxGridViewData.GetNewItemRecordClass: TcxCustomGridRecordClass; +begin + Result := TcxGridNewItemRow; +end; + +function TcxGridViewData.GetRecordByKind(AKind, AIndex: Integer): TcxCustomGridRecord; +begin + if AKind = rkFiltering then + if HasFilterRow then + Result := FilterRow + else + Result := nil + else + Result := inherited GetRecordByKind(AKind, AIndex); +end; + +function TcxGridViewData.GetRecordClass(ARecordInfo: TcxRowInfo): TcxCustomGridRecordClass; +begin + if ARecordInfo.Level < DataController.Groups.GroupingItemCount then + Result := TcxGridGroupRow + else + if GridView.IsMaster then + Result := TcxGridMasterDataRow + else + Result := TcxGridDataRow; +end; + +function TcxGridViewData.GetRecordKind(ARecord: TcxCustomGridRecord): Integer; +begin + if HasFilterRow and (ARecord = FilterRow) then + Result := rkFiltering + else + Result := inherited GetRecordKind(ARecord); +end; + +procedure TcxGridViewData.CreateFilterRow; +var + ARowInfo: TcxRowInfo; +begin + FFilterRow := GetFilterRowClass.Create(Self, -1, ARowInfo); + FFilterRow.RefreshRecordInfo; +end; + +procedure TcxGridViewData.DestroyFilterRow; +begin + FFilterRow.Free; + FFilterRow := nil; +end; + +procedure TcxGridViewData.CheckFilterRow; +begin + if HasFilterRow then + CreateFilterRow + else + DestroyFilterRow; +end; + +{procedure TcxGridViewData.RecreateFilterRow; +var + ASelected: Boolean; +begin + if HasFilterRow then + begin + ASelected := FilterRow.InternalSelected; + DestroyFilterRow; + CreateFilterRow; + FilterRow.InternalSelected := ASelected; + end; +end;} + +function TcxGridViewData.GetFilterRowClass: TcxGridFilterRowClass; +begin + Result := TcxGridFilterRow; +end; + +procedure TcxGridViewData.Collapse(ARecurse: Boolean); +begin + if ARecurse then + begin + BeginUpdate; + try + DataController.Groups.FullCollapse; + DataController.CollapseDetails; + finally + EndUpdate; + end; + end + else + inherited; +end; + +procedure TcxGridViewData.Expand(ARecurse: Boolean); +begin + DataController.Groups.FullExpand; + inherited; +end; + +function TcxGridViewData.HasFilterRow: Boolean; +begin + Result := TcxGridTableView(GridView).FilterRow.Visible; +end; + +function TcxGridViewData.HasNewItemRecord: Boolean; +begin + Result := TcxGridTableView(GridView).NewItemRow.Visible; +end; + +function TcxGridViewData.MakeDetailVisible(ADetailLevel: TComponent{TcxGridLevel}): TcxCustomGridView; +var + ARow: TcxGridMasterDataRow; +begin + Result := inherited MakeDetailVisible(ADetailLevel); + ARow := GetFirstVisibleExpandedMasterRow; + if ARow <> nil then + begin + ARow.ActiveDetailLevel := TcxGridLevel(ADetailLevel); + if ARow.ActiveDetailLevel = ADetailLevel then + Result := ARow.ActiveDetailGridView; + ARow.MakeVisible; + end; +end; + +{procedure TcxGridViewData.Refresh(ARecordCount: Integer); +begin + RecreateFilterRow; + inherited; +end;} + +{ TcxGridColumnHeaderMovingObject } + +function TcxGridColumnHeaderMovingObject.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxGridColumnHeaderMovingObject.GetSourceItem: TcxGridColumn; +begin + Result := TcxGridColumn(inherited SourceItem); +end; + +function TcxGridColumnHeaderMovingObject.GetViewInfo: TcxGridTableViewInfo; +begin + Result := TcxGridTableViewInfo(inherited ViewInfo); +end; + +procedure TcxGridColumnHeaderMovingObject.SetSourceItem(Value: TcxGridColumn); +begin + inherited SourceItem := Value; +end; + +procedure TcxGridColumnHeaderMovingObject.CalculateDestParams(AHitTest: TcxCustomGridHitTest; + out AContainerKind: TcxGridItemContainerKind; out AZone: TcxGridItemContainerZone); +begin + inherited; + if AContainerKind = ckNone then + begin + AZone := ViewInfo.GroupByBoxViewInfo.GetZone(AHitTest.Pos); + if AZone = nil then + begin + AZone := ViewInfo.HeaderViewInfo.GetZone(AHitTest.Pos); + if AZone <> nil then + AContainerKind := ckHeader; + end + else + AContainerKind := ckGroupByBox; + end; +end; + +function TcxGridColumnHeaderMovingObject.CanRemove: Boolean; +begin + Result := + (SourceItemContainerKind = ckGroupByBox) and SourceItem.CanGroup or + (SourceItemContainerKind = ckHeader) and SourceItem.CanHide and + (FOriginalDestColumnContainerKind <> ckGroupByBox) and + (GridView.Controller.Customization or GridView.OptionsCustomize.ColumnHiding); +end; + +procedure TcxGridColumnHeaderMovingObject.CheckDestItemContainerKind(var AValue: TcxGridItemContainerKind); +begin + if (AValue = ckGroupByBox) and not SourceItem.CanGroup then + AValue := ckNone; + inherited; +end; + +procedure TcxGridColumnHeaderMovingObject.DoColumnMoving; +var + AIndex: Integer; +begin + with SourceItem do + begin + if DestZone.ItemIndex = GridView.VisibleColumnCount then + AIndex := GridView.ColumnCount - 1 + else + begin + AIndex := GridView.VisibleColumns[DestZone.ItemIndex].Index; + if Index < AIndex then Dec(AIndex); + end; + Index := AIndex; + end; +end; + +function TcxGridColumnHeaderMovingObject.GetArrowAreaBounds(APlace: TcxGridArrowPlace): TRect; + + procedure CalculateForGroupByBox; + begin + with ViewInfo.GroupByBoxViewInfo do + if DestZone.ItemIndex = Count then + if Count = 0 then + begin + Result := Bounds; + Inc(Result.Left, GroupByBoxLeftOffset); + InflateRect(Result, 0, -GroupByBoxTopOffset); + end + else + begin + Result := Items[Count - 1].Bounds; + Result.Left := Result.Right + GroupByBoxHorOffset div 2; + end + else + begin + Result := Items[DestZone.ItemIndex].Bounds; + Dec(Result.Left, GroupByBoxHorOffset div 2); + if DestZone.ItemIndex <> 0 then + OffsetRect(Result, 0, -GroupByBoxVerOffset div 2); + end; + end; + +begin + if DestItemContainerKind = ckGroupByBox then + CalculateForGroupByBox + else + Result := GetArrowAreaBoundsForHeader(APlace); +end; + +function TcxGridColumnHeaderMovingObject.GetArrowAreaBoundsForHeader(APlace: TcxGridArrowPlace): TRect; +begin + with ViewInfo.HeaderViewInfo do + if DestZone.ItemIndex = Count then + if Count = 0 then + Result := Bounds + else + begin + Result := Items[Count - 1].Bounds; + Result.Left := Result.Right; + end + else + Result := Items[DestZone.ItemIndex].Bounds; +end; + +function TcxGridColumnHeaderMovingObject.GetArrowsClientRect: TRect; +begin + Result := inherited GetArrowsClientRect; + with ViewInfo.ClientBounds do + begin + Result.Left := Left; + Result.Right := Right; + end; +end; + +function TcxGridColumnHeaderMovingObject.GetSourceItemViewInfo: TcxCustomGridCellViewInfo; +begin + case SourceItemContainerKind of + ckGroupByBox: + Result := ViewInfo.GroupByBoxViewInfo[SourceItem.GroupIndex]; + ckHeader: + Result := ViewInfo.HeaderViewInfo[SourceItem.VisibleIndex]; + else + Result := inherited GetSourceItemViewInfo; + end; +end; + +function TcxGridColumnHeaderMovingObject.IsValidDestination: Boolean; +begin + Result := DestItemContainerKind in [ckGroupByBox, ckHeader]; + if Result then + begin + case DestItemContainerKind of + ckGroupByBox: + Result := SourceItem.GroupIndex = -1; + ckHeader: + Result := not SourceItem.Visible; + end; + Result := Result or IsValidDestinationForVisibleSource; + end; +end; + +function TcxGridColumnHeaderMovingObject.IsValidDestinationForVisibleSource: Boolean; +begin + case DestItemContainerKind of + ckGroupByBox: + Result := + (DestZone.ItemIndex < SourceItem.GroupIndex) or + (SourceItem.GroupIndex + 1 < DestZone.ItemIndex); + ckHeader: + Result := + (SourceItemContainerKind = ckGroupByBox) or + (DestZone.ItemIndex < SourceItem.VisibleIndex) or + (SourceItem.VisibleIndex + 1 < DestZone.ItemIndex); + else + Result := False; + end; +end; + +procedure TcxGridColumnHeaderMovingObject.EndDragAndDrop(Accepted: Boolean); +var + APrevGroupIndex: Integer; + AColumnPosChanged: Boolean; + + procedure DoColumnGrouping; + begin + if IsValidDestination then + AColumnPosChanged := SourceItem.GroupBy(DestZone.ItemIndex - + Byte((SourceItem.GroupIndex <> -1) and (SourceItem.GroupIndex < DestZone.ItemIndex))); + end; + + procedure DoColumnRemoving; + begin + if not CanRemove then Exit; + with SourceItem do + case SourceItemContainerKind of + ckGroupByBox: + AColumnPosChanged := SourceItem.GroupBy(-1, + (DestItemContainerKind <> ckCustomizationForm) and + (not GridView.OptionsCustomize.ColumnHiding or not CanHide) and + not Controller.Customization); + ckHeader: + if CanHide then + begin + Visible := False; + AColumnPosChanged := True; + end; + end; + end; + +begin + inherited; + if Accepted then + begin + AColumnPosChanged := False; + APrevGroupIndex := SourceItem.GroupIndex; + TcxCustomGrid(GridView.Control){GridView}.BeginUpdate; + try + case DestItemContainerKind of + ckGroupByBox: + DoColumnGrouping; + ckHeader: + if IsValidDestination then + begin + DoColumnMoving; + with SourceItem do + begin + if (SourceItemContainerKind = ckGroupByBox) and CanGroup then + GroupIndex := -1; + Visible := True; + end; + AColumnPosChanged := True; + end; + else + DoColumnRemoving; + end; + finally + TcxCustomGrid(GridView.Control){GridView}.EndUpdate; + end; + if SourceItem.GroupIndex <> APrevGroupIndex then + Controller.MakeFocusedRecordVisible; + if AColumnPosChanged then + GridView.DoColumnPosChanged(SourceItem); + end; +end; + +procedure TcxGridColumnHeaderMovingObject.Init(const P: TPoint; AParams: TcxCustomGridHitTest); +begin + inherited; + with AParams as TcxGridColumnHeaderHitTest do + begin + SourceItem := Column; + SourceItemContainerKind := ColumnContainerKind; + end; +end; + +{ TcxCustomGridSizingObject } + +function TcxCustomGridSizingObject.GetController: TcxGridTableController; +begin + Result := TcxGridTableController(inherited Controller); +end; + +function TcxCustomGridSizingObject.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxCustomGridSizingObject.GetViewInfo: TcxGridTableViewInfo; +begin + Result := TcxGridTableViewInfo(inherited ViewInfo); +end; + +procedure TcxCustomGridSizingObject.SetDestPointX(Value: Integer); +begin + if FDestPointX <> Value then + begin + Dirty := True; + FDestPointX := Value; + end; +end; + +procedure TcxCustomGridSizingObject.SetDestPointY(Value: Integer); +begin + if FDestPointY <> Value then + begin + Dirty := True; + FDestPointY := Value; + end; +end; + +procedure TcxCustomGridSizingObject.DirtyChanged; +begin + Canvas.InvertRect(SizingMarkBounds); +end; + +function TcxCustomGridSizingObject.GetCurrentSize: Integer; +begin + Result := OriginalSize + DeltaSize; +end; + +function TcxCustomGridSizingObject.GetDeltaSize: Integer; +begin + if IsHorizontalSizing then + Result := DestPointX - SourcePoint.X + else + Result := DestPointY - SourcePoint.Y; +end; + +function TcxCustomGridSizingObject.GetDragAndDropCursor(Accepted: Boolean): TCursor; +begin + if IsHorizontalSizing then + Result := crcxGridHorzSize + else + Result := crcxGridVertSize; +end; + +function TcxCustomGridSizingObject.GetHorzSizingMarkBounds: TRect; +begin + with Result do + begin + Right := SizingItemBounds.Left + CurrentSize; + Left := Right - SizingMarkWidth; + Top := SizingItemBounds.Top; + Bottom := ViewInfo.Bounds.Bottom - ViewInfo.PartsBottomHeight; + end; +end; + +function TcxCustomGridSizingObject.GetImmediateStart: Boolean; +begin + Result := True; +end; + +function TcxCustomGridSizingObject.GetIsHorizontalSizing: Boolean; +begin + Result := True; +end; + +function TcxCustomGridSizingObject.GetSizingMarkBounds: TRect; +begin + if IsHorizontalSizing then + Result := GetHorzSizingMarkBounds + else + Result := GetVertSizingMarkBounds; +end; + +function TcxCustomGridSizingObject.GetVertSizingMarkBounds: TRect; +begin + with Result do + begin + Left := ViewInfo.Bounds.Left; + Right := ViewInfo.Bounds.Right; + Bottom := SizingItemBounds.Top + CurrentSize; + Top := Bottom - SizingMarkWidth; + end; +end; + +procedure TcxCustomGridSizingObject.DragAndDrop(const P: TPoint; var Accepted: Boolean); +begin + if IsHorizontalSizing then + DestPointX := P.X + else + DestPointY := P.Y; + Accepted := True; + inherited; +end; + +procedure TcxCustomGridSizingObject.Init(const P: TPoint; AParams: TcxCustomGridHitTest); +begin + inherited; + FDestPointX := SourcePoint.X; + FDestPointY := SourcePoint.Y; +end; + +{ TcxCustomGridColumnSizingObject } + +function TcxCustomGridColumnSizingObject.GetColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo; +begin + Result := ViewInfo.HeaderViewInfo[Column.VisibleIndex]; +end; + +function TcxCustomGridColumnSizingObject.GetSizingItemBounds: TRect; +begin + Result := ColumnHeaderViewInfo.Bounds; +end; + +function TcxCustomGridColumnSizingObject.GetSizingMarkWidth: Integer; +begin + Result := ColumnSizingMarkWidth; +end; + +procedure TcxCustomGridColumnSizingObject.Init(const P: TPoint; AParams: TcxCustomGridHitTest); +begin + inherited; + Column := (AParams as TcxCustomGridColumnHitTest).Column; +end; + +{ TcxGridColumnHorzSizingObject } + +procedure TcxGridColumnHorzSizingObject.BeginDragAndDrop; +begin + OriginalSize := ColumnHeaderViewInfo.Width; + Controller.FHorzSizingColumn := Column; + inherited; +end; + +procedure TcxGridColumnHorzSizingObject.EndDragAndDrop(Accepted: Boolean); +begin + inherited; + Controller.FHorzSizingColumn := nil; + if Accepted and (CurrentSize <> OriginalSize) then + begin + Column.ForceWidth(ColumnHeaderViewInfo.CalculateRealWidth(CurrentSize)); + GridView.DoColumnSizeChanged(Column); + end; +end; + +function TcxGridColumnHorzSizingObject.GetCurrentSize: Integer; +begin + Result := inherited GetCurrentSize; + ColumnHeaderViewInfo.CheckWidth(Result); +end; + +{ TcxGridRowSizingObject } + +function TcxGridRowSizingObject.GetRowViewInfo: TcxCustomGridRowViewInfo; +begin + Result := TcxCustomGridRowViewInfo(FRow.ViewInfo); +end; + +procedure TcxGridRowSizingObject.BeginDragAndDrop; +begin + OriginalSize := RowViewInfo.RowHeight; + inherited; +end; + +procedure TcxGridRowSizingObject.EndDragAndDrop(Accepted: Boolean); +begin + inherited; + if Accepted then + RowViewInfo.RowHeight := CurrentSize; +end; + +function TcxGridRowSizingObject.GetCurrentSize: Integer; +begin + Result := inherited GetCurrentSize; + RowViewInfo.CheckRowHeight(Result); +end; + +function TcxGridRowSizingObject.GetIsHorizontalSizing: Boolean; +begin + Result := False; +end; + +function TcxGridRowSizingObject.GetSizingItemBounds: TRect; +begin //!!! + Result := RowViewInfo.Bounds; +end; + +function TcxGridRowSizingObject.GetSizingMarkWidth: Integer; +begin + Result := RowSizingMarkWidth; +end; + +procedure TcxGridRowSizingObject.Init(const P: TPoint; AParams: TcxCustomGridHitTest); +begin + inherited; + FRow := TcxCustomGridRow((AParams as TcxGridRowSizingEdgeHitTest).GridRecord); +end; + +{ TcxGridTableItemsListBox } + +constructor TcxGridTableItemsListBox.Create(AOwner: TComponent); +begin + inherited; + Style.Color := clBtnFace; +end; + +function TcxGridTableItemsListBox.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxGridTableItemsListBox.CalculateItemHeight: Integer; +begin + Result := 2 * (LookAndFeelPainter.HeaderBorderSize + cxGridCellTextOffset) + + Canvas.TextHeight('Qq'); +end; + +procedure TcxGridTableItemsListBox.PaintItem(ACanvas: TcxCanvas; R: TRect; + AIndex: Integer; AFocused: Boolean); +const + States: array[Boolean] of TcxButtonState = (cxbsNormal, cxbsHot); +var + ATextR, ASelectionR: TRect; +begin + ACanvas.Font.Color := clBtnText; + ASelectionR := R; + with LookAndFeelPainter do + begin + InflateRect(ASelectionR, -HeaderBorderSize, -HeaderBorderSize); + ATextR := ASelectionR; + InflateRect(ATextR, -cxGridCellTextOffset, 0); + DrawHeader(ACanvas, R, ATextR, [], + cxBordersAll, States[AFocused], taLeftJustify, vaCenter, False, + GetItemEndEllipsis, Items[AIndex], ACanvas.Font, + clBtnText, clBtnFace, DrawItemDrawBackgroundHandler); + if AFocused then + DrawHeaderPressed(ACanvas, ASelectionR); + end; +end; + +{ TcxGridTableColumnsListBox } + +function TcxGridTableColumnsListBox.DrawItemDrawBackgroundHandler(ACanvas: TcxCanvas; + const ABounds: TRect): Boolean; +begin + Result := GridView.ViewInfo.HeaderViewInfo.DrawColumnBackgroundHandler(ACanvas, ABounds); +end; + +function TcxGridTableColumnsListBox.GetDragAndDropParams: TcxCustomGridHitTest; +begin + Result := TcxGridColumnHeaderHitTest.Instance(Point(-1, -1)); + with TcxGridColumnHeaderHitTest(Result) do + begin + GridView := Self.GridView; + Column := TcxGridColumn(DragAndDropItem); + ColumnContainerKind := ckCustomizationForm; + end; +end; + +function TcxGridTableColumnsListBox.GetItemEndEllipsis: Boolean; +begin + Result := GridView.OptionsView.HeaderEndEllipsis; +end; + +procedure TcxGridTableColumnsListBox.RefreshItems; +begin + inherited; + RefreshItemsAsTableItems; +end; + +{ TcxGridTableCustomizationForm } + +function TcxGridTableCustomizationForm.GetColumnsListBox: TcxGridTableColumnsListBox; +begin + Result := TcxGridTableColumnsListBox(ItemsListBox); +end; + +function TcxGridTableCustomizationForm.GetColumnsPage: TcxTabSheet; +begin + Result := ItemsPage; +end; + +function TcxGridTableCustomizationForm.GetController: TcxGridTableController; +begin + Result := TcxGridTableController(inherited Controller); +end; + +function TcxGridTableCustomizationForm.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxGridTableCustomizationForm.GetViewInfo: TcxGridTableViewInfo; +begin + Result := TcxGridTableViewInfo(inherited ViewInfo); +end; + +function TcxGridTableCustomizationForm.GetItemsListBoxClass: TcxCustomGridTableItemsListBoxClass; +begin + Result := TcxGridTableColumnsListBox; +end; + +function TcxGridTableCustomizationForm.GetItemsPageCaption: string; +begin + Result := cxGetResourceString(@scxGridCustomizationFormColumnsPageCaption); +end; + +{ TcxGridDragOpenInfoMasterDataRowTab } + +constructor TcxGridDragOpenInfoMasterDataRowTab.Create(ALevel: TcxGridLevel; + AGridRow: TcxGridMasterDataRow); +begin + inherited Create(ALevel); + GridRow := AGridRow; +end; + +function TcxGridDragOpenInfoMasterDataRowTab.Equals(AInfo: TcxCustomGridDragOpenInfo): Boolean; +begin + Result := inherited Equals(AInfo) and + (GridRow = TcxGridDragOpenInfoMasterDataRowTab(AInfo).GridRow); +end; + +procedure TcxGridDragOpenInfoMasterDataRowTab.Run; +begin + GridRow.ActiveDetailIndex := Level.Index; +end; + +{ TcxGridColumnsCustomizationPopup } + +function TcxGridColumnsCustomizationPopup.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +procedure TcxGridColumnsCustomizationPopup.ItemClicked(AItem: TObject; AChecked: Boolean); +begin + inherited; + GridView.DoColumnPosChanged(TcxGridColumn(AItem)); +end; + +procedure TcxGridColumnsCustomizationPopup.SetItemIndex(AItem: TObject; AIndex: Integer); +begin + inherited; + GridView.DoColumnPosChanged(TcxGridColumn(AItem)); +end; + +{ TcxGridTableEditingController } + +function TcxGridTableEditingController.GetController: TcxGridTableController; +begin + Result := TcxGridTableController(inherited Controller); +end; + +function TcxGridTableEditingController.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxGridTableEditingController.CanInitEditing: Boolean; +begin + if Controller.IsFilterRowFocused then + Result := True + else + Result := inherited CanInitEditing; +end; + +function TcxGridTableEditingController.CanUpdateEditValue: Boolean; +begin + Result := inherited CanUpdateEditValue and not ApplyingImmediateFiltering; +end; + +procedure TcxGridTableEditingController.DoEditChanged; +begin + inherited; + if Controller.IsFilterRowFocused and (GridView.FilterRow.ApplyChanges = fracImmediately) then + begin + ApplyingImmediateFiltering := True; + try + EditingItem.EditValue := Edit.EditingValue; + finally + ApplyingImmediateFiltering := False; + end; + end; +end; + +procedure TcxGridTableEditingController.DoEditKeyDown(var Key: Word; Shift: TShiftState); +begin + if Controller.IsFilterRowFocused and (GridView.FilterRow.ApplyChanges = fracImmediately) and + (Key = VK_ESCAPE) then + Edit.Reset; + inherited; +end; + +function TcxGridTableEditingController.GetHideEditOnFocusedRecordChange: Boolean; +begin + Result := inherited GetHideEditOnFocusedRecordChange or + GridView.ViewData.HasFilterRow; +end; + +procedure TcxGridTableEditingController.InitEdit; + + procedure AddFilterValues(AStrings: TStrings); + var + AValueList: TcxGridFilterValueList; + I: Integer; + begin + AValueList := Controller.ViewData.CreateFilterValueList; + try + EditingItem.DataBinding.GetFilterValues(AValueList, True, False, True); + with AStrings do + begin + BeginUpdate; + try + for I := 0 to AValueList.Count - 1 do + Add(AValueList[I].Value); + finally + EndUpdate; + end; + end; + finally + AValueList.Free; + end; + end; + +begin + inherited; + if Controller.IsFilterRowFocused then + begin + // won't work if both Properties and RepositoryItem are assigned to column + Edit.InternalProperties.ReadOnly := False; + if (GridView.FilterRow.ApplyChanges = fracOnCellExit) and + (Edit is TcxCustomTextEdit) and (Edit.ActiveProperties = TcxCustomTextEdit(Edit).Properties) then + AddFilterValues(TcxCustomTextEdit(Edit).Properties.LookupItems); + end; +end; + +procedure TcxGridTableEditingController.PostEditingData; +begin + if Controller.IsFilterRowFocused then + UpdateValue + else + inherited; +end; + +{ TcxGridTableController } + +constructor TcxGridTableController.Create(AGridView: TcxCustomGridView); +begin + inherited; + FSelectedColumns := TList.Create; +end; + +destructor TcxGridTableController.Destroy; +begin + FreeAndNil(FSelectedColumns); + inherited; +end; + +function TcxGridTableController.GetColumnsCustomizationPopup: TcxGridColumnsCustomizationPopup; +begin + Result := TcxGridColumnsCustomizationPopup(ItemsCustomizationPopup); +end; + +function TcxGridTableController.GetCustomizationForm: TcxGridTableCustomizationForm; +begin + Result := TcxGridTableCustomizationForm(inherited CustomizationForm); +end; + +function TcxGridTableController.GetEditingController: TcxGridTableEditingController; +begin + Result := TcxGridTableEditingController(inherited EditingController); +end; + +function TcxGridTableController.GetFocusedColumn: TcxGridColumn; +begin + Result := TcxGridColumn(FocusedItem); +end; + +function TcxGridTableController.GetFocusedColumnIndex: Integer; +begin + Result := FocusedItemIndex; +end; + +function TcxGridTableController.GetFocusedRow: TcxCustomGridRow; +begin + Result := TcxCustomGridRow(FocusedRecord); +end; + +function TcxGridTableController.GetFocusedRowIndex: Integer; +begin + Result := FocusedRecordIndex; +end; + +function TcxGridTableController.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxGridTableController.GetIsColumnHorzSizing: Boolean; +begin + Result := FHorzSizingColumn <> nil; +end; + +function TcxGridTableController.GetSelectedColumn(Index: Integer): TcxGridColumn; +begin + Result := TcxGridColumn(FSelectedColumns[Index]); +end; + +function TcxGridTableController.GetSelectedColumnCount: Integer; +begin + Result := FSelectedColumns.Count; +end; + +function TcxGridTableController.GetSelectedRow(Index: Integer): TcxCustomGridRow; +begin + Result := TcxCustomGridRow(SelectedRecords[Index]); +end; + +function TcxGridTableController.GetSelectedRowCount: Integer; +begin + Result := SelectedRecordCount; +end; + +function TcxGridTableController.GetTopRowIndex: Integer; +begin + Result := TopRecordIndex; +end; + +function TcxGridTableController.GetViewData: TcxGridViewData; +begin + Result := TcxGridViewData(inherited ViewData); +end; + +function TcxGridTableController.GetViewInfo: TcxGridTableViewInfo; +begin + Result := TcxGridTableViewInfo(inherited ViewInfo); +end; + +procedure TcxGridTableController.SetFocusedColumn(Value: TcxGridColumn); +begin + FocusedItem := Value; +end; + +procedure TcxGridTableController.SetFocusedColumnIndex(Value: Integer); +begin + FocusedItemIndex := Value; +end; + +procedure TcxGridTableController.SetFocusedRow(Value: TcxCustomGridRow); +begin + FocusedRecord := Value; +end; + +procedure TcxGridTableController.SetFocusedRowIndex(Value: Integer); +begin + FocusedRecordIndex := Value; +end; + +procedure TcxGridTableController.SetLeftPos(Value: Integer); +var + APrevLeftPos: Integer; + +//var ft,lt:integer; + +begin + CheckLeftPos(Value); + if FLeftPos <> Value then + begin + + //ft:=gettickcount; + + APrevLeftPos := FLeftPos; + FLeftPos := Value; + if GridView.CanOffsetHorz then + GridView.Offset(0, APrevLeftPos - FLeftPos, 0) + else + LeftPosChanged; + GridView.DoLeftPosChanged; + + {site.Update; + lt := gettickcount; + application.MainForm.Caption := inttostr(lt-ft);} + + end; +end; + +procedure TcxGridTableController.SetPressedColumn(Value: TcxGridColumn); +var + R1, R2: TRect; + + procedure GetUpdateRects; + + function GetUpdateRect(AContainerViewInfo: TcxGridColumnContainerViewInfo; + AIndex: Integer): TRect; + begin + if AIndex <> -1 then + Result := AContainerViewInfo[AIndex].Bounds + else + Result := Rect(0, 0, 0, 0); + end; + + begin + R1 := GetUpdateRect(ViewInfo.GroupByBoxViewInfo, FPressedColumn.GroupIndex); + R2 := GetUpdateRect(ViewInfo.HeaderViewInfo, FPressedColumn.VisibleIndex); + end; + + procedure InvalidateRects; + begin + GridView.ViewChanged(R1); + GridView.ViewChanged(R2); + end; + +begin + if FPressedColumn <> Value then + if ViewInfo.IsCalculating then + FPressedColumn := Value + else + begin + if Value = nil then GetUpdateRects; + FPressedColumn := Value; + if Value <> nil then GetUpdateRects; + InvalidateRects; + end; +end; + +procedure TcxGridTableController.SetTopRowIndex(Value: Integer); +begin + TopRecordIndex := Value; +end; + +procedure TcxGridTableController.AddSelectedColumn(AColumn: TcxGridColumn); +begin + AColumn.FSelected := True; + FSelectedColumns.Add(AColumn); + //GridView.LayoutChanged; + InvalidateSelection; +end; + +procedure TcxGridTableController.RemoveSelectedColumn(AColumn: TcxGridColumn); +begin + AColumn.FSelected := False; + FSelectedColumns.Remove(AColumn); + //GridView.LayoutChanged; + InvalidateSelection; +end; + +function TcxGridTableController.CanAppend(ACheckOptions: Boolean): Boolean; +begin + Result := inherited CanAppend(ACheckOptions) and not ViewData.HasNewItemRecord; +end; + +function TcxGridTableController.CanDelete(ACheckOptions: Boolean): Boolean; +begin + Result := inherited CanDelete(ACheckOptions) and + not IsFilterRowFocused and not IsNewItemRowFocused; +end; + +function TcxGridTableController.CanEdit: Boolean; +begin + Result := inherited CanEdit and not IsFilterRowFocused; +end; + +function TcxGridTableController.CanInsert(ACheckOptions: Boolean): Boolean; +begin + Result := inherited CanInsert(ACheckOptions) and not IsFilterRowFocused; +end; + +procedure TcxGridTableController.CheckCoordinates; +begin + inherited; + LeftPos := LeftPos; +end; + +procedure TcxGridTableController.CheckLeftPos(var Value: Integer); +begin + if Value > ViewInfo.DataWidth - ViewInfo.ClientWidth then + Value := ViewInfo.DataWidth - ViewInfo.ClientWidth; + if Value < 0 then Value := 0; +end; + +procedure TcxGridTableController.FocusedItemChanged(APrevFocusedItem: TcxCustomGridTableItem); +begin + if CellSelectionAnchor = nil then + CellSelectionAnchor := FocusedColumn; + inherited; +end; + +procedure TcxGridTableController.FocusedRecordChanged(APrevFocusedRecordIndex, AFocusedRecordIndex: Integer; + ANewItemRecordFocusingChanged: Boolean); +begin + if IsFilterRowFocused and KeepFilterRowFocusing then Exit; + inherited; + if ViewData.HasFilterRow and + ((AFocusedRecordIndex <> APrevFocusedRecordIndex) or ANewItemRecordFocusingChanged) then + ViewData.FilterRow.Focused := False; +end; + +function TcxGridTableController.GetDesignHitTest(AHitTest: TcxCustomGridHitTest): Boolean; +begin + Result := inherited GetDesignHitTest(AHitTest); + if not Result then + if AHitTest is TcxGridFooterCellHitTest then + Result := TcxGridFooterCellHitTest(AHitTest).SummaryItem <> nil + else + Result := AHitTest.HitTestCode in [htColumnHeader, htExpandButton, htTab, + htIndicatorHeader, htGroupSummary]; +end; + +function TcxGridTableController.GetFocusedRecord: TcxCustomGridRecord; +begin + if ViewData.HasFilterRow and ViewData.FilterRow.Selected then + Result := ViewData.FilterRow + else + begin + Result := inherited GetFocusedRecord; + if (Result = nil) and ViewData.HasNewItemRecord and ViewData.NewItemRow.Selected then + Result := ViewData.NewItemRow; + end; +end; + +function TcxGridTableController.GetIsRecordsScrollHorizontal: Boolean; +begin + Result := False; +end; + +function TcxGridTableController.GetItemsCustomizationPopupClass: TcxCustomGridItemsCustomizationPopupClass; +begin + Result := TcxGridColumnsCustomizationPopup; +end; + +function TcxGridTableController.GetMaxTopRecordIndexValue: Integer; +begin + if NeedsAdditionalRowsScrolling then + Result := TopRowIndex + 1 + else + Result := inherited GetMaxTopRecordIndexValue; +end; + +function TcxGridTableController.GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; +begin + Result := mwskVertical; +end; + +function TcxGridTableController.GetScrollBarRecordCount: Integer; +begin + Result := inherited GetScrollBarRecordCount; + if NeedsAdditionalRowsScrolling then Inc(Result); +end; + +function TcxGridTableController.IsColumnFixedDuringHorzSizing(AColumn: TcxGridColumn): Boolean; +begin + Result := + (AColumn = ForcingWidthItem) or + not ForcingWidthItem.IsLast and (AColumn.VisibleIndex < ForcingWidthItem.VisibleIndex); +end; + +function TcxGridTableController.IsKeyForMultiSelect(AKey: Word; AShift: TShiftState; + AFocusedRecordChanged: Boolean): Boolean; +begin + Result := inherited IsKeyForMultiSelect(AKey, AShift, AFocusedRecordChanged) or + (AKey = VK_UP) or (AKey = VK_DOWN) or + ((AKey = VK_HOME) or (AKey = VK_END)) and + (not GridView.OptionsSelection.CellSelect or (FocusedRecord = nil) or not FocusedRecord.HasCells); +end; + +function TcxGridTableController.IsPixelScrollBar(AKind: TScrollBarKind): Boolean; +begin + Result := AKind = sbHorizontal; +end; + +procedure TcxGridTableController.LeftPosChanged; +begin + GridView.LayoutChanged; +end; + +function TcxGridTableController.NeedsAdditionalRowsScrolling(AIsCallFromMaster: Boolean = False): Boolean; +var + ALastRow: TcxGridMasterDataRow; +begin + Result := False; + if GridView.IsMaster and (ViewData.RowCount <> 0) and + ((ViewInfo.VisibleRecordCount > 1) or AIsCallFromMaster) and + ((ScrollBarPos = inherited GetScrollBarRecordCount - ViewInfo.VisibleRecordCount) or + AIsCallFromMaster and (ViewData.RowCount = 1)) and + (ViewData.Rows[ViewData.RowCount - 1] is TcxGridMasterDataRow) then + begin + ALastRow := ViewData.Rows[ViewData.RowCount - 1].AsMasterDataRow; + if ALastRow.Expanded and ALastRow.ActiveDetailGridViewExists then + Result := + not ALastRow.ActiveDetailGridView.Controller.IsDataFullyVisible(True) and + TcxGridMasterDataRowViewInfo(ALastRow.ViewInfo).DetailsSiteVisible and + not TcxGridMasterDataRowViewInfo(ALastRow.ViewInfo).DetailsSiteViewInfo.HasMaxHeight; + end; +end; + +procedure TcxGridTableController.RemoveFocus; +begin + with ViewData do + begin + if HasFilterRow then + FilterRow.Focused := False; + if HasNewItemRecord then + NewItemRow.Focused := False; + end; + inherited; +end; + +procedure TcxGridTableController.ScrollData(ADirection: TcxDirection); +begin + case ADirection of + dirLeft: + LeftPos := LeftPos - HScrollDelta; + dirRight: + LeftPos := LeftPos + HScrollDelta; + dirUp: + ScrollRecords(False, 1); + dirDown: + ScrollRecords(True, 1); + end; +end; + +procedure TcxGridTableController.SetFocusedRecord(Value: TcxCustomGridRecord); +begin + if (FocusedRecord <> Value) and ViewData.HasNewItemRecord then + if Value = ViewData.NewItemRow then + begin + Value.Selected := True; + Value := ViewData.NewItemRow; + end + else + if (FocusedRecord = ViewData.NewItemRow) and (Value = nil) then + FocusedRecord.Selected := False; + + if ViewData.HasFilterRow then + if Value = ViewData.FilterRow then + if FocusedRecord = Value then + Exit + else + begin + ViewData.FilterRow.Selected := True; + Value := ViewData.GetRecordByIndex(FocusedRecordindex); + end + else + if FocusedRow = ViewData.FilterRow then + begin + FocusedRow.Selected := False; + if Value = nil then Exit; + end; + + inherited; +end; + +procedure TcxGridTableController.ShowNextPage; +begin + if TopRecordIndex <> -1 then + TopRecordIndex := TopRecordIndex + Max(1, ViewInfo.VisibleRecordCount - 1); +end; + +procedure TcxGridTableController.ShowPrevPage; +var + AVisibleRowCount: Integer; +begin + if TopRecordIndex = -1 then Exit; + if TopRecordIndex = 0 then + if DataController.IsGridMode then + AVisibleRowCount := ViewInfo.VisibleRecordCount + else + Exit + else + begin + AVisibleRowCount := GetVisibleRecordCount(TopRecordIndex, False); + if DataController.IsGridMode and (TopRecordIndex - (AVisibleRowCount - 1) = 0) and + (AVisibleRowCount < ViewInfo.VisibleRecordCount) then + AVisibleRowCount := ViewInfo.VisibleRecordCount; + end; + if AVisibleRowCount = 1 then + TopRecordIndex := TopRecordIndex - 1 + else + if DataController.IsGridMode then + TopRecordIndex := TopRecordIndex - (AVisibleRowCount - 1) + else + InternalTopRecordIndex := TopRecordIndex - (AVisibleRowCount - 1); +end; + +function TcxGridTableController.CanScrollData(ADirection: TcxDirection): Boolean; +var + Value: Integer; +begin + case ADirection of + dirLeft: + Result := LeftPos <> 0; + dirRight: + begin + Value := LeftPos + HScrollDelta; + CheckLeftPos(Value); + Result := LeftPos <> Value; + end; + dirUp: + Result := TopRowIndex <> 0; + dirDown: + begin + Value := TopRowIndex + 1; + CheckTopRecordIndex(Value); + Result := TopRowIndex <> Value; + end; + else + Result := False; + end; +end; + +function TcxGridTableController.CanPostponeRecordSelection: Boolean; +begin + Result := inherited CanPostponeRecordSelection and not CellMultiSelect; +end; + +function TcxGridTableController.CanProcessMultiSelect(AHitTest: TcxCustomGridHitTest; + AShift: TShiftState): Boolean; +begin + Result := inherited CanProcessMultiSelect(AHitTest, AShift) and + not (IsClickableRecordHitTest(AHitTest) and + TcxCustomGridRow(TcxGridRecordHitTest(AHitTest).GridRecord).IsFilterRow) and + (not CellMultiSelect or (ssLeft in AShift) or + not (AHitTest.ViewInfo is TcxGridTableDataCellViewInfo) or + not TcxGridTableDataCellViewInfo(AHitTest.ViewInfo).Selected); +end; + +procedure TcxGridTableController.DoMouseNormalSelection(AHitTest: TcxCustomGridHitTest); +begin + inherited; + if CellMultiSelect and (AHitTest is TcxGridRowIndicatorHitTest) then + SelectAllColumns; +end; + +procedure TcxGridTableController.DoMouseRangeSelection(AClearSelection: Boolean = True; + AData: TObject = nil); +begin + inherited; + if CellMultiSelect then + if AData is TcxGridRowIndicatorHitTest then + SelectAllColumns + else + DoRangeCellSelection; +end; + +procedure TcxGridTableController.DoNormalSelection; +var + ASelectionChanged: Boolean; +begin + ASelectionChanged := False; + BeginUpdate; + try + inherited; + if CellMultiSelect then + begin + if (SelectedColumnCount = 1) and SelectedColumns[0].Focused then Exit; + ClearCellSelection; + if FocusedColumn <> nil then + begin + FocusedColumn.Selected := True; + CellSelectionAnchor := FocusedColumn; + end; + ASelectionChanged := True; + end; + finally + EndUpdate; + end; + if ASelectionChanged then GridView.DoSelectionChanged; +end; + +procedure TcxGridTableController.MultiSelectKeyDown(var Key: Word; Shift: TShiftState); +begin + if CellMultiSelect then + if ssShift in Shift then + DoRangeSelection + else + DoNormalSelectionWithAnchor + else + inherited; +end; + +function TcxGridTableController.SupportsAdditiveSelection: Boolean; +begin + Result := not CellMultiSelect; +end; + +function TcxGridTableController.SupportsRecordSelectionToggling: Boolean; +begin + Result := not CellMultiSelect; +end; + +function TcxGridTableController.DefocusSpecialRow: Boolean; + + function FocusTopRow: Boolean; + begin + if TopRecordIndex <> -1 then + begin + FocusedRecordIndex := TopRecordIndex; + Result := FocusedRecordIndex = TopRecordIndex; + end + else + Result := False; + end; + +begin + Result := IsFilterRowFocused; + if Result then + if ViewData.HasNewItemRecord then + begin + ViewData.NewItemRow.Focused := True; + Result := ViewData.NewItemRow.Focused; + end + else + begin + Result := FocusTopRow; + if Result then + ViewData.FilterRow.Focused := False; + end + else + Result := IsNewItemRowFocused and FocusTopRow; +end; + +function TcxGridTableController.FocusSpecialRow: Boolean; +begin + Result := ViewData.HasNewItemRecord and not ViewData.NewItemRow.Focused; + if Result then + begin + Result := not IsFilterRowFocused and IsStart; + if Result then + ViewData.NewItemRow.Focused := True; + end + else + begin + Result := ViewData.HasFilterRow and not ViewData.FilterRow.Focused; + if Result then + begin + Result := ViewData.HasNewItemRecord or IsStart; + if Result then + ViewData.FilterRow.Focused := True; + end; + end; +end; + +procedure TcxGridTableController.FilterRowFocusChanged; +begin + inherited FocusedRecordChanged(FocusedRecordIndex, FocusedRecordIndex, + NewItemRecordFocused); + GridView.RefreshNavigators; +end; + +procedure TcxGridTableController.FilterRowFocusChanging(AValue: Boolean); +var + AFocusedRecordIndex: Integer; +begin + if AValue then + begin + AFocusedRecordIndex := -1; + CheckEditing(AFocusedRecordIndex, False); + end + else + EditingController.HideEdit(not GridView.IsDestroying); +end; + +procedure TcxGridTableController.DoPullFocusingScrolling(ADirection: TcxDirection); +begin + if ADirection in [dirLeft, dirRight] then + FocusNextCell(ADirection = dirRight, True, False); + inherited; +end; + +function TcxGridTableController.GetPullFocusingScrollingDirection(X, Y: Integer; + out ADirection: TcxDirection): Boolean; +var + R: TRect; +begin + Result := inherited GetPullFocusingScrollingDirection(X, Y, ADirection); + if not Result then + begin + R := ViewInfo.ScrollableAreaBoundsVert; + if X < R.Left then + begin + ADirection := dirLeft; + Result := True; + end; + if X >= R.Right then + begin + ADirection := dirRight; + Result := True; + end; + end; +end; + +function TcxGridTableController.SupportsPullFocusing: Boolean; +begin + Result := inherited SupportsPullFocusing or CellMultiSelect; +end; + +function TcxGridTableController.GetDragOpenInfo(AHitTest: TcxCustomGridHitTest): TcxCustomGridDragOpenInfo; +begin + Result := inherited GetDragOpenInfo(AHitTest); + if (Result = nil) and (AHitTest.HitTestCode = htTab) then + with TcxGridDetailsSiteTabHitTest(AHitTest) do + Result := TcxGridDragOpenInfoMasterDataRowTab.Create(Level, Owner as TcxGridMasterDataRow); +end; + +function TcxGridTableController.GetDragScrollDirection(X, Y: Integer): TcxDirection; +var + R: TRect; +begin + Result := dirNone; + + R := ViewInfo.ScrollableAreaBoundsVert; + if PtInRect(R, Point(X, Y)) then + if Y < R.Top + ScrollHotZoneWidth then + Result := dirUp + else + if Y >= R.Bottom - ScrollHotZoneWidth then + Result := dirDown; + + if Result = dirNone then + begin + R := ViewInfo.ScrollableAreaBoundsHorz; + if PtInRect(R, Point(X, Y)) then + if X < R.Left + ScrollHotZoneWidth then + Result := dirLeft + else + if X >= R.Right - ScrollHotZoneWidth then + Result := dirRight; + end; +end; + +procedure TcxGridTableController.CheckCustomizationFormBounds(var R: TRect); +var + AHeaderBottomBound: Integer; +begin + inherited; + AHeaderBottomBound := Site.ClientToScreen(ViewInfo.HeaderViewInfo.Bounds.BottomRight).Y; + if R.Top < AHeaderBottomBound then + OffsetRect(R, 0, AHeaderBottomBound - R.Top); +end; + +function TcxGridTableController.GetColumnHeaderDragAndDropObjectClass: TcxGridColumnHeaderMovingObjectClass; +begin + Result := TcxGridColumnHeaderMovingObject; +end; + +function TcxGridTableController.GetCustomizationFormClass: TcxCustomGridCustomizationFormClass; +begin + Result := TcxGridTableCustomizationForm; +end; + +function TcxGridTableController.CanProcessCellMultiSelect(APrevFocusedColumn: TcxGridColumn): Boolean; +begin + Result := CellMultiSelect and (FocusedColumn <> APrevFocusedColumn); +end; + +procedure TcxGridTableController.CellMultiSelectKeyDown(var Key: Word; Shift: TShiftState); +begin + if ssShift in Shift then + DoRangeCellSelection + else + DoNormalCellSelection; +end; + +procedure TcxGridTableController.DoNormalCellSelection; +begin + DoNormalSelection; + SetSelectionAnchor(FocusedRowIndex); + //GridView.DoSelectionChanged; +end; + +procedure TcxGridTableController.DoRangeCellSelection; +begin + SelectColumns(FCellSelectionAnchor, FocusedColumn); +end; + +function TcxGridTableController.GetCellMultiSelect: Boolean; +begin + Result := GridView.OptionsSelection.CellMultiSelect; +end; + +procedure TcxGridTableController.AddBeginsWithMask(var AValue: Variant); +begin + if VarIsStr(AValue) and (AValue <> '') and (GetBeginsWithMaskPos(AValue) = 0) then + AValue := AValue + DataController.Filter.PercentWildcard; +end; + +procedure TcxGridTableController.RemoveBeginsWithMask(var AValue: Variant); +var + APos: Integer; + S: string; +begin + if VarIsStr(AValue) then + begin + APos := GetBeginsWithMaskPos(AValue); + if APos <> 0 then + begin + S := AValue; + Delete(S, APos, Length(DataController.Filter.PercentWildcard)); + AValue := S; + end; + end; +end; + +function TcxGridTableController.GetBeginsWithMaskPos(const AValue: string): Integer; +begin + if (Length(AValue) = 0) or (AValue[Length(AValue)] <> DataController.Filter.PercentWildcard) then + Result := 0 + else + Result := Length(AValue); +end; + +function TcxGridTableController.GetEditingControllerClass: TcxGridEditingControllerClass; +begin + Result := TcxGridTableEditingController; +end; + +procedure TcxGridTableController.CheckScrolling(const P: TPoint); +var + R: TRect; +begin + R := ViewInfo.ScrollableAreaBoundsHorz; + if PtInRect(R, P) then + if P.X < R.Left + ScrollHotZoneWidth then + ScrollDirection := dirLeft + else + if R.Right - ScrollHotZoneWidth <= P.X then + ScrollDirection := dirRight + else + ScrollDirection := dirNone + else + ScrollDirection := dirNone; +end; + +procedure TcxGridTableController.ClearGrouping; +var + I: Integer; +begin + BeginUpdate; + try + for I := 0 to GridView.GroupedColumnCount - 1 do + GridView.GroupedColumns[I].Visible := True; + DataController.Groups.ClearGrouping; + finally + EndUpdate; + end; +end; + +procedure TcxGridTableController.ClearSelection; +begin + ClearCellSelection; + inherited; +end; + +procedure TcxGridTableController.DoCancelMode; +begin + inherited; + PressedColumn := nil; +end; + +function TcxGridTableController.IsFilterRowFocused: Boolean; +begin + Result := ViewData.HasFilterRow and ViewData.FilterRow.Focused; +end; + +function TcxGridTableController.IsNewItemRowFocused: Boolean; +begin + Result := ViewData.HasNewItemRecord and ViewData.NewItemRow.Focused; +end; + +function TcxGridTableController.IsSpecialRowFocused: Boolean; +begin + Result := IsFilterRowFocused or IsNewItemRowFocused; +end; + +procedure TcxGridTableController.MakeItemVisible(AItem: TcxCustomGridTableItem); +var + R: TRect; + + function GetColumnBounds: TRect; + begin + Result := ViewInfo.HeaderViewInfo[AItem.VisibleIndex].Bounds; + end; + +begin + if (AItem = nil) or (AItem.VisibleIndex = -1) or + (AItem.VisibleIndex >= ViewInfo.HeaderViewInfo.Count){!!!} then + Exit; + MakeFocusedRecordVisible; + if TcxGridColumn(AItem).CanScroll then + begin + R := GetColumnBounds; + with ViewInfo.ScrollableAreaBoundsHorz do + if R.Right - R.Left >= Right - Left then + LeftPos := LeftPos - (Left - R.Left) + else + begin + if R.Right > Right then + begin + LeftPos := LeftPos + (R.Right - Right); + R := GetColumnBounds; + end; + if R.Left < Left then + LeftPos := LeftPos - (Left - R.Left); + end; + end; +end; + +procedure TcxGridTableController.SelectAll; +begin + BeginUpdate; + try + inherited; + if CellMultiSelect then + SelectAllColumns; + finally + EndUpdate; + end; +end; + +procedure TcxGridTableController.InitScrollBarsParameters; +var + APos: Integer; +begin + if ViewInfo.ScrollableAreaWidth > 0 then + APos := LeftPos + else + APos := -1; + Controller.SetScrollBarInfo(sbHorizontal, 0, ViewInfo.DataWidth - 1, + HScrollDelta, ViewInfo.ClientWidth, APos, True, CanHScrollBarHide); + Controller.SetScrollBarInfo(sbVertical, 0, ScrollBarRecordCount - 1, + 1, ViewInfo.VisibleRecordCount, ScrollBarPos, True, True); +end; + +function TcxGridTableController.IsDataFullyVisible(AIsCallFromMaster: Boolean = False): Boolean; +begin + Result := inherited IsDataFullyVisible(AIsCallFromMaster) and + ViewInfo.RecordsViewInfo.IsFirstRowFullyVisible; + if Result and GridView.IsMaster then + Result := not NeedsAdditionalRowsScrolling(AIsCallFromMaster); +end; + +procedure TcxGridTableController.Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); + + procedure ScrollHorizontal; + begin + case AScrollCode of + scLineUp: + ScrollData(dirLeft); + scLineDown: + ScrollData(dirRight); + scPageUp: + LeftPos := LeftPos - ViewInfo.ScrollableAreaWidth; + scPageDown: + LeftPos := LeftPos + ViewInfo.ScrollableAreaWidth; + scTrack: + LeftPos := AScrollPos; + end; + AScrollPos := LeftPos; + end; + + procedure ScrollVertical; + begin + case AScrollCode of + scLineUp: + ScrollData(dirUp); + scLineDown: + ScrollData(dirDown); + scPageUp: + ScrollPage(False); + scPageDown: + ScrollPage(True); + scTrack: + if not DataController.IsGridMode then + ScrollBarPos := AScrollPos; + scPosition: + if DataController.IsGridMode then + ScrollBarPos := AScrollPos; + end; + AScrollPos := ScrollBarPos; + end; + +begin + case AScrollBarKind of + sbHorizontal: + ScrollHorizontal; + sbVertical: + ScrollVertical; + end; +end; + +procedure TcxGridTableController.EndDragAndDrop(Accepted: Boolean); +begin + PressedColumn := nil; + inherited; +end; + +procedure TcxGridTableController.DoKeyDown(var Key: Word; Shift: TShiftState); +var + AFocusedColumn: TcxGridColumn; +begin + AFocusedColumn := FocusedColumn; + inherited; + if (Key <> 0) and CanProcessCellMultiSelect(AFocusedColumn) then + CellMultiSelectKeyDown(Key, Shift); +end; + +procedure TcxGridTableController.KeyDown(var Key: Word; Shift: TShiftState); +var + AGridViewLink: TcxGridListenerLink; + AFocusedRowIndex: Integer; +begin + case Key of + VK_LEFT, VK_RIGHT: + if FocusNextCell(Key = VK_RIGHT) then Exit;//Key := 0; + VK_PRIOR: + if FocusSpecialRow then + Exit + else + if IsSpecialRowFocused then + begin + Key := 0; + Exit; + end; + VK_NEXT: + if DefocusSpecialRow then Exit; + end; + inherited; + AGridViewLink := GridView.AddListenerLink; + try + case Key of + VK_LEFT: + ScrollData(dirLeft); + VK_RIGHT: + ScrollData(dirRight); + VK_UP: + if not FocusSpecialRow then + begin + if IsSpecialRowFocused then + AFocusedRowIndex := -1 + else + AFocusedRowIndex := FocusedRowIndex; + if not FocusNextRecord(AFocusedRowIndex, False, False, not (ssShift in Shift), + not (ssShift in Shift)) and IsSpecialRowFocused then + Key := 0; + if (AGridViewLink.GridView <> nil) and not MultiSelect then + Site.Update; + end; + VK_DOWN: + if not DefocusSpecialRow then + begin + FocusNextRecord(FocusedRowIndex, True, False, not (ssShift in Shift), not (ssShift in Shift)); + if (AGridViewLink.GridView <> nil) and not MultiSelect then + Site.Update; + end; + VK_HOME: + if (ssCtrl in Shift) or not FocusedRecordHasCells(True) then + GoToFirst(False) + else + FocusNextItem(-1, True, False, False); + VK_END: + if (ssCtrl in Shift) or not FocusedRecordHasCells(True) then + GoToLast(False, False) + else + FocusNextItem(-1, False, True, False); + end; + finally + AGridViewLink.Free; + end; +end; + +procedure TcxGridTableController.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); + + procedure ProcessSorting; + + procedure RemoveColumnSorting; + var + I: Integer; + begin + if GridView.OptionsCustomize.GroupBySorting then + with PressedColumn do + if (GroupIndex = 0) and CanGroup then + begin + GroupIndex := -1; + Visible := True; + end; + PressedColumn.SortOrder := soNone; + if GridView.OptionsCustomize.GroupBySorting then + for I := 0 to GridView.SortedItemCount - 1 do + with TcxGridColumn(GridView.SortedItems[I]) do + if CanGroup then + begin + GroupIndex := 0; + Break; + end; + end; + + procedure AddColumnSorting; + var + ASortOrder: TcxGridSortOrder; + begin + if PressedColumn.SortOrder = soAscending then + ASortOrder := soDescending + else + ASortOrder := soAscending; + if not (ssShift in Shift) and (PressedColumn.GroupIndex = -1) then + begin + if GridView.OptionsCustomize.GroupBySorting and PressedColumn.CanGroup then + ClearGrouping; + DataController.ClearSorting(True); + end; + PressedColumn.SortOrder := ASortOrder; + if GridView.OptionsCustomize.GroupBySorting and (PressedColumn.SortIndex = 0) and + (GridView.GroupedColumnCount = 0) and PressedColumn.CanGroup then + PressedColumn.GroupIndex := 0; + end; + + begin + if not PressedColumn.CanSort then Exit; + try + ShowHourglassCursor; + BeginUpdate; + try + if ssCtrl in Shift then + RemoveColumnSorting + else + AddColumnSorting; + finally + EndUpdate; + HideHourglassCursor; + end; + finally + MakeFocusedRecordVisible; + DesignerModified; + end; + end; + +begin + inherited; + if Site.IsMouseInPressedArea(X, Y) and (PressedColumn <> nil) then + ProcessSorting; + PressedColumn := nil; +end; + +procedure TcxGridTableController.ClearCellSelection; +var + I: Integer; +begin + BeginUpdate; + try + for I := SelectedColumnCount - 1 downto 0 do + SelectedColumns[I].Selected := False; + finally + EndUpdate; + end; +end; + +procedure TcxGridTableController.SelectAllColumns; +begin + SelectColumns(nil, nil); +end; + +procedure TcxGridTableController.SelectCells(AFromColumn, AToColumn: TcxGridColumn; + AFromRowIndex, AToRowIndex: Integer); +begin + BeginUpdate; + try + if AFromRowIndex = -1 then AFromRowIndex := 0; + if AToRowIndex = -1 then AToRowIndex := DataController.RowCount - 1; + DataController.ClearSelection; + DataController.SelectRows(AFromRowIndex, AToRowIndex); + + SelectColumns(AFromColumn, AToColumn); + finally + EndUpdate; + end; +end; + +procedure TcxGridTableController.SelectColumns(AFromColumn, AToColumn: TcxGridColumn); + + procedure GetNewSelectedColumns(AColumns: TList); + var + AStartIndex, AFinishIndex, I: Integer; + begin + AStartIndex := AColumns.IndexOf(AFromColumn); + if AStartIndex = -1 then AStartIndex := 0; + AFinishIndex := AColumns.IndexOf(AToColumn); + if AFinishIndex = -1 then + AFinishIndex := AColumns.Count - 1; + if (AStartIndex > AFinishIndex) and (AFinishIndex <> -1) then + begin + I := AStartIndex; + AStartIndex := AFinishIndex; + AFinishIndex := I; + end; + + AColumns.Count := AFinishIndex + 1; + for I := 0 to AStartIndex - 1 do + AColumns.Delete(0); + end; + + function IsSelectionChanged(ANewSelectedColumns: TList): Boolean; + var + I: Integer; + begin + Result := ANewSelectedColumns.Count <> SelectedColumnCount; + if not Result then + for I := 0 to ANewSelectedColumns.Count - 1 do + begin + Result := not TcxGridColumn(ANewSelectedColumns[I]).Selected; + if Result then Break; + end; + end; + +var + ASelectionChanged: Boolean; + AColumns: TList; + I: Integer; +begin + ASelectionChanged := False; + BeginUpdate; + AColumns := TList.Create; + try + GridView.GetVisibleItemsList(AColumns); + GetNewSelectedColumns(AColumns); + ASelectionChanged := IsSelectionChanged(AColumns); + + if ASelectionChanged then + begin + ClearCellSelection; + for I := 0 to AColumns.Count - 1 do + TcxGridColumn(AColumns[I]).Selected := True; + end; + finally + AColumns.Free; + EndUpdate; + if ASelectionChanged then + GridView.DoSelectionChanged; + end; +end; + +{ TcxGridColumnContainerPainter } + +function TcxGridColumnContainerPainter.GetViewInfo: TcxGridColumnContainerViewInfo; +begin + Result := TcxGridColumnContainerViewInfo(inherited ViewInfo); +end; + +procedure TcxGridColumnContainerPainter.DrawContent; +var + AClipRegion: TcxRegion; +begin + AClipRegion := Canvas.GetClipRegion; + try + Canvas.IntersectClipRect(ViewInfo.Bounds); + if DrawItemsFirst then + begin + DrawItems; + inherited; + end + else + begin + inherited; + DrawItems; + end + finally + Canvas.SetClipRegion(AClipRegion, roSet); + end; +end; + +procedure TcxGridColumnContainerPainter.DrawItems; +var + I: Integer; + AViewInfo: TcxGridColumnHeaderViewInfo; +begin + for I := 0 to ViewInfo.Count - 1 do + begin + AViewInfo := ViewInfo.InternalItems[I]; + if AViewInfo <> nil then AViewInfo.Paint; + end; +end; + +function TcxGridColumnContainerPainter.DrawItemsFirst: Boolean; +begin + Result := True; +end; + +function TcxGridColumnContainerPainter.ExcludeFromClipRect: Boolean; +begin + Result := True; +end; + +{ TcxGridColumnHeaderAreaPainter } + +function TcxGridColumnHeaderAreaPainter.GetViewInfo: TcxGridColumnHeaderAreaViewInfo; +begin + Result := TcxGridColumnHeaderAreaViewInfo(inherited ViewInfo); +end; + +function TcxGridColumnHeaderAreaPainter.ExcludeFromClipRect: Boolean; +begin + Result := True; +end; + +{ TcxGridColumnHeaderSortingMarkPainter } + +procedure TcxGridColumnHeaderSortingMarkPainter.Paint; +begin + ViewInfo.LookAndFeelPainter.DrawSortingMark(Canvas, ViewInfo.Bounds, + TcxGridColumnHeaderSortingMarkViewInfo(ViewInfo).SortOrder = soAscending); +end; + +{ TcxGridColumnHeaderFilterButtonPainter } + +function TcxGridColumnHeaderFilterButtonPainter.GetViewInfo: TcxGridColumnHeaderFilterButtonViewInfo; +begin + Result := TcxGridColumnHeaderFilterButtonViewInfo(inherited ViewInfo); +end; + +procedure TcxGridColumnHeaderFilterButtonPainter.Paint; +begin + ViewInfo.LookAndFeelPainter.DrawFilterDropDownButton(Canvas, ViewInfo.Bounds, + ViewInfo.ButtonState, ViewInfo.Active); +end; + +{ TcxGridColumnHeaderGlyphPainter } + +function TcxGridColumnHeaderGlyphPainter.GetViewInfo: TcxGridColumnHeaderGlyphViewInfo; +begin + Result := TcxGridColumnHeaderGlyphViewInfo(inherited ViewInfo); +end; + +procedure TcxGridColumnHeaderGlyphPainter.Paint; +begin + with ViewInfo.Bounds do + Canvas.DrawGlyph(Left, Top, ViewInfo.Glyph); +end; + +{ TcxGridColumnHeaderPainter } + +function TcxGridColumnHeaderPainter.GetViewInfo: TcxGridColumnHeaderViewInfo; +begin + Result := TcxGridColumnHeaderViewInfo(inherited ViewInfo); +end; + +procedure TcxGridColumnHeaderPainter.DrawAreas; +var + AClipRegion: TcxRegion; + I: Integer; +begin + AClipRegion := Canvas.GetClipRegion; + try + for I := 0 to ViewInfo.AreaViewInfoCount - 1 do + ViewInfo.AreaViewInfos[I].Paint(Canvas); + finally + Canvas.SetClipRegion(AClipRegion, roSet); + end; +end; + +procedure TcxGridColumnHeaderPainter.DrawBorders; +begin + // inherited; +end; + +procedure TcxGridColumnHeaderPainter.DrawContent; +const + States: array[TcxGridCellState] of TcxButtonState = (cxbsNormal, cxbsHot, cxbsPressed); +var + AState: TcxButtonState; +begin + with ViewInfo do + begin + if IsMainCanvasInUse then + begin + AState := States[State]; + if IsPressed then AState := cxbsPressed; + end + else + AState := cxbsNormal; + LookAndFeelPainter.DrawHeader(Self.Canvas, Bounds, TextAreaBounds, Neighbors, + Borders, AState, AlignmentHorz, AlignmentVert, MultiLinePainting, ShowEndEllipsis, + Text, Params.Font, Params.TextColor, Params.Color, + ViewInfo.GridViewInfo.HeaderViewInfo.DrawColumnBackgroundHandler, Column.IsMostRight, + ViewInfo.Container.Kind = ckGroupByBox); + end; + DrawAreas; +end; + +procedure TcxGridColumnHeaderPainter.DrawPressed; +begin + with ViewInfo do + LookAndFeelPainter.DrawHeaderPressed(Self.Canvas, Bounds); +end; + +function TcxGridColumnHeaderPainter.ExcludeFromClipRect: Boolean; +begin + Result := True; +end; + +procedure TcxGridColumnHeaderPainter.Paint; +begin + inherited; + if ViewInfo.IsPressed and IsMainCanvasInUse then DrawPressed; +end; + +{ TcxGridHeaderPainter } + +function TcxGridHeaderPainter.DrawItemsFirst: Boolean; +begin + Result := ViewInfo.LookAndFeelPainter.HeaderDrawCellsFirst; +end; + +{ TcxGridGroupByBoxPainter } + +procedure TcxGridGroupByBoxPainter.DrawBackground(const R: TRect); +begin + with ViewInfo do + LookAndFeelPainter.DrawGroupByBox(Canvas, R, Transparent, Params.Color, + BackgroundBitmap); +end; + +procedure TcxGridGroupByBoxPainter.DrawContent; +var + I: Integer; + J: Boolean; + R: TRect; +begin + inherited; + Canvas.Brush.Color := GroupByBoxLineColor; + for I := 0 to ViewInfo.Count - 2 do + for J := Low(J) to High(J) do + begin + R := TcxGridGroupByBoxViewInfo(ViewInfo).LinkLineBounds[I, J]; + with Canvas do + begin + FillRect(R); + //ExcludeClipRect(R); + end; + end; +end; + +function TcxGridGroupByBoxPainter.DrawItemsFirst: Boolean; +begin + Result := ViewInfo.LookAndFeelPainter.HeaderDrawCellsFirst; +end; + +{ TcxGridFooterCellPainter } + +procedure TcxGridFooterCellPainter.DrawBorders; +begin + // inherited; +end; + +procedure TcxGridFooterCellPainter.DrawContent; +begin + with ViewInfo do + LookAndFeelPainter.DrawFooterCell(Self.Canvas, Bounds, AlignmentHorz, + AlignmentVert, MultiLinePainting, Text, Params.Font, Params.TextColor, Params.Color, + DrawBackgroundHandler); +end; + +{ TcxGridFooterPainter } + +function TcxGridFooterPainter.GetViewInfo: TcxGridFooterViewInfo; +begin + Result := TcxGridFooterViewInfo(inherited ViewInfo); +end; + +procedure TcxGridFooterPainter.DrawBackground(const R: TRect); +begin + ViewInfo.LookAndFeelPainter.DrawFooterContent(Canvas, R, ViewInfo.Params); +end; + +procedure TcxGridFooterPainter.DrawBorders; +begin + if ViewInfo.HasSeparator then DrawSeparator; + ViewInfo.LookAndFeelPainter.DrawFooterBorder(Canvas, ViewInfo.BordersBounds); +end; + +function TcxGridFooterPainter.DrawItemsFirst: Boolean; +begin + Result := ViewInfo.LookAndFeelPainter.FooterDrawCellsFirst; +end; + +procedure TcxGridFooterPainter.DrawSeparator; +begin + ViewInfo.LookAndFeelPainter.DrawFooterSeparator(Canvas, ViewInfo.SeparatorBounds); +end; + +{ TcxCustomGridIndicatorItemPainter } + +function TcxCustomGridIndicatorItemPainter.GetViewInfo: TcxCustomGridIndicatorItemViewInfo; +begin + Result := TcxCustomGridIndicatorItemViewInfo(inherited ViewInfo); +end; + +function TcxCustomGridIndicatorItemPainter.ExcludeFromClipRect: Boolean; +begin + Result := True; +end; + +{ TcxGridIndicatorHeaderItemPainter } + +function TcxGridIndicatorHeaderItemPainter.GetViewInfo: TcxGridIndicatorHeaderItemViewInfo; +begin + Result := TcxGridIndicatorHeaderItemViewInfo(inherited ViewInfo); +end; + +function TcxGridIndicatorHeaderItemPainter.DrawBackgroundHandler(ACanvas: TcxCanvas; + const ABounds: TRect): Boolean; +begin + Result := ViewInfo.GridViewInfo.HeaderViewInfo.DrawColumnBackgroundHandler(ACanvas, ABounds); +end; + +procedure TcxGridIndicatorHeaderItemPainter.DrawContent; +begin + with ViewInfo do + begin + LookAndFeelPainter.DrawHeader(Self.Canvas, Bounds, Bounds, [nRight], cxBordersAll, + GridCellStateToButtonState(State), taLeftJustify, vaTop, False, + False, '', nil, clNone, Params.Color, DrawBackgroundHandler); + if SupportsQuickCustomization then + DrawQuickCustomizationMark; + if State = gcsPressed then + LookAndFeelPainter.DrawHeaderPressed(Self.Canvas, Bounds); + end; +end; + +procedure TcxGridIndicatorHeaderItemPainter.DrawQuickCustomizationMark; +begin + with ViewInfo do + LookAndFeelPainter.DrawIndicatorCustomizationMark(Canvas, Bounds, Params.TextColor); +end; + +{ TcxGridIndicatorRowItemPainter } + +function TcxGridIndicatorRowItemPainter.GetViewInfo: TcxGridIndicatorRowItemViewInfo; +begin + Result := TcxGridIndicatorRowItemViewInfo(inherited ViewInfo); +end; + +procedure TcxGridIndicatorRowItemPainter.DrawContent; +begin + with ViewInfo do + LookAndFeelPainter.DrawIndicatorItem(Self.Canvas, Bounds, IndicatorKind, Params.Color, + DrawBackgroundHandler); +end; + +{ TcxGridIndicatorFooterItemPainter } + +function TcxGridIndicatorFooterItemPainter.GetViewInfo: TcxGridIndicatorFooterItemViewInfo; +begin + Result := TcxGridIndicatorFooterItemViewInfo(inherited ViewInfo); +end; + +procedure TcxGridIndicatorFooterItemPainter.DrawBorders; +begin + with Canvas, ViewInfo do + begin + if HasSeparator then + LookAndFeelPainter.DrawFooterSeparator(Self.Canvas, SeparatorBounds); + LookAndFeelPainter.DrawFooterBorder(Self.Canvas, BordersBounds); + end; +end; + +procedure TcxGridIndicatorFooterItemPainter.DrawContent; +begin + if ViewInfo.GridView.LookAndFeel.SkinPainter = nil then + inherited DrawContent + else + with ViewInfo do + LookAndFeelPainter.DrawHeader(Canvas, Bounds, Bounds, [], [], cxbsNormal, + taLeftJustify, vaTop, False, False, '', nil, clNone, Params.Color, DrawBackgroundHandler); +end; + +{ TcxGridIndicatorPainter } + +function TcxGridIndicatorPainter.GetViewInfo: TcxGridIndicatorViewInfo; +begin + Result := TcxGridIndicatorViewInfo(inherited ViewInfo); +end; + +procedure TcxGridIndicatorPainter.DrawContent; +begin + if DrawItemsFirst then + begin + DrawItems; + inherited; + end + else + begin + inherited; + DrawItems; + end; +end; + +procedure TcxGridIndicatorPainter.DrawItems; +var + I: Integer; +begin + with ViewInfo do + for I := 0 to Count - 1 do + Items[I].Paint; +end; + +function TcxGridIndicatorPainter.DrawItemsFirst: Boolean; +begin + Result := ViewInfo.LookAndFeelPainter.IndicatorDrawItemsFirst; +end; + +function TcxGridIndicatorPainter.ExcludeFromClipRect: Boolean; +begin + Result := True; +end; + +{ TcxCustomGridRowPainter } + +function TcxCustomGridRowPainter.GetViewInfo: TcxCustomGridRowViewInfo; +begin + Result := TcxCustomGridRowViewInfo(inherited ViewInfo); +end; + +procedure TcxCustomGridRowPainter.DrawFooters; +begin + ViewInfo.FootersViewInfo.Paint; +end; + +procedure TcxCustomGridRowPainter.DrawIndent; +var + I: Integer; +begin + for I := 0 to ViewInfo.VisualLevel - 1 do + DrawIndentPart(I, ViewInfo.LevelIndentBounds[I]); +end; + +procedure TcxCustomGridRowPainter.DrawIndentPart(ALevel: Integer; const ABounds: TRect); +begin + with Canvas, ViewInfo do + begin + if GridViewInfo.LevelIndentBackgroundBitmap = nil then + begin + Brush.Color := GridViewInfo.LevelIndentColors[ALevel]; + FillRect(CalculateLevelIndentSpaceBounds(ALevel, ABounds)); + end + else + FillRect(CalculateLevelIndentSpaceBounds(ALevel, ABounds), + GridViewInfo.LevelIndentBackgroundBitmap); + + Brush.Color := GridViewInfo.LevelSeparatorColor; + FillRect(CalculateLevelIndentVertLineBounds(ALevel, ABounds)); + + Brush.Color := GridViewInfo.GridLineColor; + FillRect(CalculateLevelIndentHorzLineBounds(ALevel, ABounds)); + end; +end; + +procedure TcxCustomGridRowPainter.DrawLastHorzGridLine; +begin + with Canvas do + begin + Brush.Color := ViewInfo.GridViewInfo.GridLineColor; + FillRect(ViewInfo.LastHorzGridLineBounds); + end; +end; + +procedure TcxCustomGridRowPainter.DrawSeparator; +begin + Canvas.Brush.Color := ViewInfo.SeparatorColor; + Canvas.FillRect(ViewInfo.SeparatorBounds); +end; + +procedure TcxCustomGridRowPainter.Paint; +begin + if ViewInfo.HasFooters then DrawFooters; + DrawIndent; + if ViewInfo.HasLastHorzGridLine then DrawLastHorzGridLine; + if ViewInfo.HasSeparator then DrawSeparator; + inherited; +end; + +{ TcxGridRowsPainter } + +function TcxGridRowsPainter.GetViewInfo: TcxGridRowsViewInfo; +begin + Result := TcxGridRowsViewInfo(inherited ViewInfo); +end; + +procedure TcxGridRowsPainter.Paint; +begin + with ViewInfo do + begin + if HasFilterRow then + FilterRowViewInfo.Paint; + if HasNewItemRow then + NewItemRowViewInfo.Paint; + end; + inherited; +end; + +class procedure TcxGridRowsPainter.DrawDataRowCells(ARowViewInfo: TcxCustomGridRowViewInfo); +var + I: Integer; + ACellViewInfo: TcxGridDataCellViewInfo; +begin + with ARowViewInfo as TcxGridDataRowViewInfo do + begin + for I := 0 to CellViewInfoCount - 1 do + begin + ACellViewInfo := InternalCellViewInfos[I]; + if ACellViewInfo <> nil then ACellViewInfo.Paint; + end; + CellsAreaViewInfo.Paint; + end; +end; + +{ TcxGridTablePainter } + +function TcxGridTablePainter.GetController: TcxGridTableController; +begin + Result := TcxGridTableController(inherited Controller); +end; + +function TcxGridTablePainter.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxGridTablePainter.GetViewInfo: TcxGridTableViewInfo; +begin + Result := TcxGridTableViewInfo(inherited ViewInfo); +end; + +function TcxGridTablePainter.CanOffset(AItemsOffset, DX, DY: Integer): Boolean; +begin + Result := inherited CanOffset(AItemsOffset, DX, DY) and + ((AItemsOffset <> 0) or not GridView.IsMaster) and + (ViewInfo.RecordsViewInfo.GroupBackgroundBitmap = nil) and + ((AItemsOffset <> 0) or (ViewInfo.HeaderViewInfo.ColumnBackgroundBitmap = nil)) and + (ViewInfo.FooterViewInfo.BackgroundBitmap = nil) and + ((AItemsOffset <> 0) or not GridView.FilterRow.Visible or + (GridView.FilterRow.InfoText = '')) and + ((AItemsOffset <> 0) or not GridView.NewItemRow.Visible or + (GridView.NewItemRow.InfoText = '')) and + ((AItemsOffset = 0) or not GridView.HasCellMerging); +end; + +procedure TcxGridTablePainter.DrawFooter; +begin + ViewInfo.FooterViewInfo.Paint; +end; + +procedure TcxGridTablePainter.DrawGroupByBox; +begin + ViewInfo.GroupByBoxViewInfo.Paint; +end; + +procedure TcxGridTablePainter.DrawHeader; +begin + ViewInfo.HeaderViewInfo.Paint; +end; + +procedure TcxGridTablePainter.DrawIndicator; +begin + ViewInfo.IndicatorViewInfo.Paint; +end; + +procedure TcxGridTablePainter.DrawRecords; + + procedure DrawGridLines; + var + I: Integer; + N: array of DWORD; + P: array of TPoint; + R: TRect; + begin + SetLength(P, FGridLines.Count * 2); + SetLength(N, FGridLines.Count); + for I := 0 to FGridLines.Count - 1 do + begin + R := PRect(FGridLines[I])^; + P[2 * I] := R.TopLeft; + if R.Bottom = R.Top + 1 then + P[2 * I + 1] := Point(R.Right, R.Top) + else + P[2 * I + 1] := Point(R.Left, R.Bottom); + N[I] := 2; + end; + with Canvas do + begin + Pen.Color := ViewInfo.GridLineColor; + PolyPolyLine(Handle, P[0], N[0], FGridLines.Count); + end; + N := nil; + P := nil; + end; + + procedure ClearGridLines; + var + I: Integer; + begin + for I := 0 to FGridLines.Count - 1 do + Dispose(PRect(FGridLines[I])); + end; + +begin + FGridLines := TList.Create; + try + inherited; + DrawGridLines; + finally + ClearGridLines; + FreeAndNil(FGridLines); + end; +end; + +procedure TcxGridTablePainter.Offset(AItemsOffset: Integer); +var + R, AUpdateBounds: TRect; +begin + R := ViewInfo.GetOffsetBounds(AItemsOffset, AUpdateBounds); + Site.ScrollWindow(0, AItemsOffset, R); + Site.InvalidateRect(AUpdateBounds, True); + Controller.InvalidateFocusedRecord; + if Controller.IsEditing then + RedrawWindow(Controller.EditingController.Edit.Handle, nil, 0, RDW_INVALIDATE or RDW_ALLCHILDREN); +end; + +procedure TcxGridTablePainter.Offset(DX, DY: Integer); +var + R, AUpdateBounds: TRect; +begin + R := ViewInfo.GetOffsetBounds(DX, DY, AUpdateBounds); + if not IsRectEmpty(R) then + Site.ScrollWindow(DX, 0, R); + if not IsRectEmpty(AUpdateBounds) then + Site.InvalidateRect(AUpdateBounds, True); + Controller.InvalidateFocusedRecord; + Site.Update; +end; + +procedure TcxGridTablePainter.PaintContent; +//var +// ft,lt{,i}:integer; +begin + {ft:=gettickcount; + for I:=1 to 10 do + begin} + DrawGroupByBox; + DrawFilterBar; + DrawIndicator; + DrawHeader; + DrawFooter; + inherited; + {end; + lt:=gettickcount; + application.mainform.caption := + inttostr(lt-ft);} +end; + +procedure TcxGridTablePainter.AddGridLine(const R: TRect); +var + AR: PRect; +begin + New(AR); + AR^ := R; + FGridLines.Add(AR); +end; + +{ TcxGridColumnContainerViewInfo } + +constructor TcxGridColumnContainerViewInfo.Create(AGridViewInfo: TcxCustomGridTableViewInfo); +begin + inherited; + FItemHeight := -1; + CreateItems; +end; + +destructor TcxGridColumnContainerViewInfo.Destroy; +begin + DestroyItems; + inherited; +end; + +function TcxGridColumnContainerViewInfo.GetController: TcxGridTableController; +begin + Result := GridView.Controller; +end; + +function TcxGridColumnContainerViewInfo.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxGridColumnContainerViewInfo.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxGridColumnContainerViewInfo.GetGridViewInfo: TcxGridTableViewInfo; +begin + Result := TcxGridTableViewInfo(inherited GridViewInfo); +end; + +function TcxGridColumnContainerViewInfo.GetInternalItem(Index: Integer): TcxGridColumnHeaderViewInfo; +begin + Result := TcxGridColumnHeaderViewInfo(FItems[Index]); +end; + +function TcxGridColumnContainerViewInfo.GetItem(Index: Integer): TcxGridColumnHeaderViewInfo; +begin + Result := InternalItems[Index]; + if Result = nil then + begin + Result := CreateItem(Index); + FItems[Index] := Result; + end; +end; + +function TcxGridColumnContainerViewInfo.GetItemHeight: Integer; +begin + if FItemHeight = -1 then + FItemHeight := CalculateItemHeight; + Result := FItemHeight; +end; + +function TcxGridColumnContainerViewInfo.CreateItem(AIndex: Integer): TcxGridColumnHeaderViewInfo; +begin + Result := GetItemClass.Create(Self, Columns[AIndex]); +end; + +procedure TcxGridColumnContainerViewInfo.CreateItems; +begin + FItems := TList.Create; + FItems.Count := ColumnCount; +end; + +procedure TcxGridColumnContainerViewInfo.DestroyItems; +var + I: Integer; +begin + for I := 0 to Count - 1 do InternalItems[I].Free; + FreeAndNil(FItems); +end; + +function TcxGridColumnContainerViewInfo.GetItemClass: TcxGridColumnHeaderViewInfoClass; +begin + Result := TcxGridColumnHeaderViewInfo; +end; + +function TcxGridColumnContainerViewInfo.CalculateItemHeight: Integer; +begin + CalculateParams; + Result := GetItemClass.GetCellHeight( + GridViewInfo.GetFontHeight(Params.Font), LookAndFeelPainter); +end; + +function TcxGridColumnContainerViewInfo.GetAutoHeight: Boolean; +begin + Result := False; +end; + +function TcxGridColumnContainerViewInfo.GetColumnAdditionalWidth(AColumn: TcxGridColumn): Integer; +begin + if AColumn.IsMostLeft then + Result := GridViewInfo.FirstItemAdditionalWidth + else + Result := 0; +end; + +function TcxGridColumnContainerViewInfo.GetColumnMinWidth(AColumn: TcxGridColumn): Integer; +begin + Result := AColumn.MinWidth + GetColumnAdditionalWidth(AColumn); +end; + +function TcxGridColumnContainerViewInfo.GetColumnNeighbors(AColumn: TcxGridColumn): TcxNeighbors; +begin + Result := []; +end; + +function TcxGridColumnContainerViewInfo.GetColumnWidth(AColumn: TcxGridColumn): Integer; +begin + Result := AColumn.Width + GetColumnAdditionalWidth(AColumn); +end; + +function TcxGridColumnContainerViewInfo.GetItemAreaBounds(AItem: TcxGridColumnHeaderViewInfo): TRect; +begin + Result := GridViewInfo.ScrollableAreaBoundsHorz; +end; + +function TcxGridColumnContainerViewInfo.GetItemMultiLinePainting(AItem: TcxGridColumnHeaderViewInfo): Boolean; +begin + Result := False; +end; + +function TcxGridColumnContainerViewInfo.GetItemsAreaBounds: TRect; +begin + Result := Bounds; +end; + +function TcxGridColumnContainerViewInfo.GetItemsHitTest(const P: TPoint): TcxCustomGridHitTest; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I].GetHitTest(P); + if Result <> nil then Exit; + end; + Result := nil; +end; + +function TcxGridColumnContainerViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridColumnContainerPainter; +end; + +function TcxGridColumnContainerViewInfo.GetZonesAreaBounds: TRect; +begin + Result := Bounds; + Result.Right := GridViewInfo.ClientBounds.Right; +end; + +procedure TcxGridColumnContainerViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + inherited; + if AHitTest is TcxCustomGridColumnHitTest then + TcxCustomGridColumnHitTest(AHitTest).ColumnContainerKind := Kind; +end; + +procedure TcxGridColumnContainerViewInfo.Offset(DX, DY: Integer); +var + I: Integer; +begin + inherited; + for I := 0 to Count - 1 do + Items[I].DoOffset(DX, DY); +end; + +procedure TcxGridColumnContainerViewInfo.BeforeRecalculation; +var + I: Integer; +begin + inherited; + for I := 0 to Count - 1 do + Items[I].BeforeRecalculation; +end; + +function TcxGridColumnContainerViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + Result := GetItemsHitTest(P); + if Result = nil then + Result := inherited GetHitTest(P); +end; + +function TcxGridColumnContainerViewInfo.GetZone(const P: TPoint): TcxGridItemContainerZone; +var + R: TRect; + ALastBound, I: Integer; +begin + Result := nil; + if not Visible then Exit; + R := ZonesAreaBounds; + if not PtInRect(R, P) then Exit; + ALastBound := R.Right; + for I := 0 to Count do + begin + if I = Count then + R.Right := ALastBound + else + with Items[I] do + R.Right := (Bounds.Left + Bounds.Right) div 2; + if PtInRect(R, P) then + begin + Result := TcxGridItemContainerZone.Create(I); + Break; + end; + R.Left := R.Right; + end; +end; + +{ TcxGridColumnHeaderAreaViewInfo } + +constructor TcxGridColumnHeaderAreaViewInfo.Create(AColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo); +begin + inherited Create(AColumnHeaderViewInfo.GridViewInfo); + FColumnHeaderViewInfo := AColumnHeaderViewInfo; +end; + +function TcxGridColumnHeaderAreaViewInfo.GetColumn: TcxGridColumn; +begin + Result := FColumnHeaderViewInfo.Column; +end; + +function TcxGridColumnHeaderAreaViewInfo.GetGridView: TcxGridTableView; +begin + Result := FColumnHeaderViewInfo.GridView; +end; + +function TcxGridColumnHeaderAreaViewInfo.GetGridViewInfo: TcxGridTableViewInfo; +begin + Result := FColumnHeaderViewInfo.GridViewInfo; +end; + +function TcxGridColumnHeaderAreaViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + Result := vaCenter; +end; + +function TcxGridColumnHeaderAreaViewInfo.GetCanvas: TcxCanvas; +begin + Result := GridViewInfo.Canvas; +end; + +function TcxGridColumnHeaderAreaViewInfo.GetHeight: Integer; +begin + Result := CalculateHeight; +end; + +function TcxGridColumnHeaderAreaViewInfo.GetWidth: Integer; +begin + Result := CalculateWidth; +end; + +function TcxGridColumnHeaderAreaViewInfo.HasMouse(AHitTest: TcxCustomGridHitTest): Boolean; +begin + Result := inherited HasMouse(AHitTest); + if Result then + with TcxCustomGridColumnHitTest(AHitTest) do + Result := (Column = Self.Column) and + (ColumnContainerKind = ColumnHeaderViewInfo.Container.Kind); +end; + +procedure TcxGridColumnHeaderAreaViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + FColumnHeaderViewInfo.InitHitTest(AHitTest); + inherited; +end; + +{procedure TcxGridColumnHeaderAreaViewInfo.Invalidate; +begin + if GridView <> nil then + GridView.ViewChanged(Bounds); +end;} + +function TcxGridColumnHeaderAreaViewInfo.NeedsContainerHotTrack: Boolean; +begin + Result := False; +end; + +function TcxGridColumnHeaderAreaViewInfo.OccupiesSpace: Boolean; +begin + Result := True; +end; + +function TcxGridColumnHeaderAreaViewInfo.ResidesInContent: Boolean; +begin + Result := True; +end; + +procedure TcxGridColumnHeaderAreaViewInfo.Calculate(const ABounds: TRect; + var ATextAreaBounds: TRect); + + procedure AlignHorizontally; + var + AAreaAndTextWidth: Integer; + begin + case AlignmentHorz of + taLeftJustify: + begin + Bounds.Right := Bounds.Left + Width; + if OccupiesSpace then + ATextAreaBounds.Left := Bounds.Right; + end; + taRightJustify: + begin + Bounds.Left := Bounds.Right - Width; + if OccupiesSpace then + ATextAreaBounds.Right := Bounds.Left; + end; + taCenter: + if OccupiesSpace and (ColumnHeaderViewInfo.AlignmentHorz = taCenter) then + begin + AAreaAndTextWidth := Width + ColumnHeaderViewInfo.TextWidthWithOffset; + if AAreaAndTextWidth < Bounds.Right - Bounds.Left then + Inc(Bounds.Left, (Bounds.Right - Bounds.Left - AAreaAndTextWidth) div 2); + Bounds.Right := Bounds.Left + Width; + + ATextAreaBounds.Left := Bounds.Right; + ATextAreaBounds.Right := + Min(ATextAreaBounds.Right, ATextAreaBounds.Left + ColumnHeaderViewInfo.TextWidthWithOffset); + end + else + begin + Inc(Bounds.Left, (Bounds.Right - Bounds.Left - Width) div 2); + Bounds.Right := Bounds.Left + Width; + end; + end; + end; + + procedure AlignVertically; + begin + case AlignmentVert of + vaTop: + Bounds.Bottom := Bounds.Top + Height; + vaBottom: + Bounds.Top := Bounds.Bottom - Height; + vaCenter: + begin + Inc(Bounds.Top, (Bounds.Bottom - Bounds.Top - Height) div 2); + Bounds.Bottom := Bounds.Top + Height; + end; + end; + end; + +begin + if ResidesInContent then + Bounds := ATextAreaBounds + else + Bounds := ABounds; + if Width <> 0 then AlignHorizontally; + if Height <> 0 then AlignVertically; + with Bounds do + inherited Calculate(Left, Top, Right - Left, Bottom - Top); +end; + +{ TcxGridColumnHeaderSortingMarkViewInfo } + +function TcxGridColumnHeaderSortingMarkViewInfo.GetSortOrder: TcxGridSortOrder; +begin + Result := Column.SortOrder; +end; + +function TcxGridColumnHeaderSortingMarkViewInfo.CalculateHeight: Integer; +begin + Result := LookAndFeelPainter.SortingMarkAreaSize.Y; +end; + +function TcxGridColumnHeaderSortingMarkViewInfo.CalculateWidth: Integer; +begin + Result := LookAndFeelPainter.SortingMarkAreaSize.X; +end; + +function TcxGridColumnHeaderSortingMarkViewInfo.GetAlignmentHorz: TAlignment; +begin + Result := taRightJustify; +end; + +function TcxGridColumnHeaderSortingMarkViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := nil; +end; + +function TcxGridColumnHeaderSortingMarkViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridColumnHeaderSortingMarkPainter; +end; + +{ TcxGridColumnHeaderHorzSizingEdgeViewInfo } + +function TcxGridColumnHeaderHorzSizingEdgeViewInfo.CalculateHeight: Integer; +begin + Result := 0; +end; + +function TcxGridColumnHeaderHorzSizingEdgeViewInfo.CalculateWidth: Integer; +begin + Result := cxGridHeaderSizingEdgeSize; +end; + +function TcxGridColumnHeaderHorzSizingEdgeViewInfo.GetAlignmentHorz: TAlignment; +begin + Result := taRightJustify; +end; + +function TcxGridColumnHeaderHorzSizingEdgeViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridColumnHeaderHorzSizingEdgeHitTest; +end; + +function TcxGridColumnHeaderHorzSizingEdgeViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := nil; +end; + +function TcxGridColumnHeaderHorzSizingEdgeViewInfo.OccupiesSpace: Boolean; +begin + Result := False; +end; + +function TcxGridColumnHeaderHorzSizingEdgeViewInfo.ResidesInContent: Boolean; +begin + Result := False; +end; + +procedure TcxGridColumnHeaderHorzSizingEdgeViewInfo.Calculate(const ABounds: TRect; + var ATextAreaBounds: TRect); +begin + inherited; + OffsetRect(Bounds, Width div 2, 0); +end; + +function TcxGridColumnHeaderHorzSizingEdgeViewInfo.MouseDown(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +var + AColumn: TcxGridColumn; +begin + Result := inherited MouseDown(AHitTest, AButton, AShift); + if (AButton = mbLeft) and (ssDouble in AShift) then + begin + AColumn := Column; + AColumn.ApplyBestFit(True, True); + Result := True; + end; +end; + +{ TcxGridColumnHeaderFilterButtonViewInfo } + +function TcxGridColumnHeaderFilterButtonViewInfo.GetActive: Boolean; +begin + Result := Column.Filtered; +end; + +function TcxGridColumnHeaderFilterButtonViewInfo.GetDropDownWindowValue: TcxGridFilterPopup; +begin + Result := TcxGridFilterPopup(inherited DropDownWindow); +end; + +function TcxGridColumnHeaderFilterButtonViewInfo.GetItem: TcxCustomGridTableItem; +begin + Result := Column; +end; + +function TcxGridColumnHeaderFilterButtonViewInfo.CalculateHeight: Integer; +begin + Result := LookAndFeelPainter.FilterDropDownButtonSize.Y; +end; + +function TcxGridColumnHeaderFilterButtonViewInfo.CalculateWidth: Integer; +begin + Result := LookAndFeelPainter.FilterDropDownButtonSize.X; +end; + +procedure TcxGridColumnHeaderFilterButtonViewInfo.DropDown; +begin + GridView.Controller.IsFilterPopupOpenedFromHeader := ColumnHeaderViewInfo.HasHeaderAsContainer; + inherited; +end; + +function TcxGridColumnHeaderFilterButtonViewInfo.EmulateMouseMoveAfterCalculate: Boolean; +begin + Result := True; +end; + +function TcxGridColumnHeaderFilterButtonViewInfo.GetAlignmentHorz: TAlignment; +begin + Result := taRightJustify; +end; + +function TcxGridColumnHeaderFilterButtonViewInfo.GetAlwaysVisible: Boolean; +begin + Result := GridView.OptionsView.ShowColumnFilterButtons = sfbAlways; +end; + +function TcxGridColumnHeaderFilterButtonViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + if GridView.IsDesigning then + Result := nil + else + Result := TcxGridColumnHeaderFilterButtonHitTest; +end; + +function TcxGridColumnHeaderFilterButtonViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridColumnHeaderFilterButtonPainter; +end; + +function TcxGridColumnHeaderFilterButtonViewInfo.GetVisible: Boolean; +begin + Result := AlwaysVisible or + (ColumnHeaderViewInfo.State <> gcsNone) or (State = gcsPressed); +end; + +function TcxGridColumnHeaderFilterButtonViewInfo.NeedsContainerHotTrack: Boolean; +begin + Result := not AlwaysVisible; +end; + +function TcxGridColumnHeaderFilterButtonViewInfo.OccupiesSpace: Boolean; +begin + Result := ColumnHeaderViewInfo.HasFixedContentSpace or Visible; +end; + +procedure TcxGridColumnHeaderFilterButtonViewInfo.StateChanged(APrevState: TcxGridCellState); +begin + if not IsDestroying and not Visible then + ColumnHeaderViewInfo.Update; + inherited; +end; + +function TcxGridColumnHeaderFilterButtonViewInfo.CloseDropDownWindowOnDestruction: Boolean; +begin + Result := False; +end; + +function TcxGridColumnHeaderFilterButtonViewInfo.DropDownWindowExists: Boolean; +begin + Result := GridView.Controller.HasFilterPopup; +end; + +function TcxGridColumnHeaderFilterButtonViewInfo.GetDropDownWindow: TcxCustomGridPopup; +begin + Result := GridView.Controller.FilterPopup; +end; + +function TcxGridColumnHeaderFilterButtonViewInfo.GetDropDownWindowOwnerBounds: TRect; +begin + Result := Bounds; + with ColumnHeaderViewInfo.Bounds do + begin + Result.Left := Left; + Result.Right := Right; + end; +end; + +function TcxGridColumnHeaderFilterButtonViewInfo.IsDropDownWindowOwner: Boolean; +begin + Result := inherited IsDropDownWindowOwner and (DropDownWindow.Item = Column) and + (GridView.Controller.IsFilterPopupOpenedFromHeader = ColumnHeaderViewInfo.HasHeaderAsContainer); +end; + +function TcxGridColumnHeaderFilterButtonViewInfo.MouseMove(AHitTest: TcxCustomGridHitTest; + AShift: TShiftState): Boolean; +begin + Result := inherited MouseMove(AHitTest, AShift); + if State = gcsPressed then + ColumnHeaderViewInfo.State := gcsSelected; +end; + +{ TcxGridColumnHeaderGlyphViewInfo } + +function TcxGridColumnHeaderGlyphViewInfo.GetGlyph: TBitmap; +begin + Result := Column.HeaderGlyph; +end; + +function TcxGridColumnHeaderGlyphViewInfo.CalculateHeight: Integer; +begin + Result := Glyph.Height; +end; + +function TcxGridColumnHeaderGlyphViewInfo.CalculateWidth: Integer; +begin + Result := Glyph.Width; +end; + +function TcxGridColumnHeaderGlyphViewInfo.GetAlignmentHorz: TAlignment; +begin + Result := Column.HeaderGlyphAlignmentHorz; +end; + +function TcxGridColumnHeaderGlyphViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + Result := Column.HeaderGlyphAlignmentVert; +end; + +function TcxGridColumnHeaderGlyphViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := nil; +end; + +function TcxGridColumnHeaderGlyphViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridColumnHeaderGlyphPainter; +end; + +{ TcxGridColumnHeaderViewInfo } + +constructor TcxGridColumnHeaderViewInfo.Create(AContainer: TcxGridColumnContainerViewInfo; + AColumn: TcxGridColumn); +begin + inherited Create(AContainer.GridViewInfo); + FAreaViewInfos := TList.Create; + FContainer := AContainer; + FColumn := AColumn; + FWidth := -1; + Width := -1; + CreateAreaViewInfos; +end; + +destructor TcxGridColumnHeaderViewInfo.Destroy; +begin + DestroyAreaViewInfos; + FAreaViewInfos.Free; + inherited; +end; + +function TcxGridColumnHeaderViewInfo.GetAreaViewInfoCount: Integer; +begin + Result := FAreaViewInfos.Count; +end; + +function TcxGridColumnHeaderViewInfo.GetAreaViewInfo(Index: Integer): TcxGridColumnHeaderAreaViewInfo; +begin + Result := TcxGridColumnHeaderAreaViewInfo(FAreaViewInfos[Index]); +end; + +function TcxGridColumnHeaderViewInfo.GetGridView: TcxGridTableView; +begin + Result := FContainer.GridView; +// if Result.IsDestroying then Result := nil; +end; + +function TcxGridColumnHeaderViewInfo.GetGridViewInfo: TcxGridTableViewInfo; +begin + Result := FContainer.GridViewInfo; +end; + +function TcxGridColumnHeaderViewInfo.GetHasTextOffsetLeft: Boolean; +begin + Result := CalculateHasTextOffset(taLeftJustify); +end; + +function TcxGridColumnHeaderViewInfo.GetHasTextOffsetRight: Boolean; +begin + Result := CalculateHasTextOffset(taRightJustify); +end; + +function TcxGridColumnHeaderViewInfo.GetIndex: Integer; +begin + Result := FColumn.VisibleIndex; +end; + +function TcxGridColumnHeaderViewInfo.GetIsFixed: Boolean; +begin + Result := FColumn.Fixed; +end; + +function TcxGridColumnHeaderViewInfo.GetRealBounds: TRect; +begin + Result := Bounds; + Inc(Result.Left, FAdditionalWidthAtLeft); + Inc(Result.Top, FAdditionalHeightAtTop); +end; + +function TcxGridColumnHeaderViewInfo.GetRealWidth: Integer; +begin + if FRealWidth = 0 then + FRealWidth := CalculateRealWidth(Width); + Result := FRealWidth; +end; + +procedure TcxGridColumnHeaderViewInfo.EnumAreaViewInfoClasses(AClass: TClass); +begin + FAreaViewInfos.Add(TcxGridColumnHeaderAreaViewInfoClass(AClass).Create(Self)); +end; + +procedure TcxGridColumnHeaderViewInfo.CreateAreaViewInfos; +begin + GetAreaViewInfoClasses(EnumAreaViewInfoClasses); +end; + +procedure TcxGridColumnHeaderViewInfo.DestroyAreaViewInfos; +var + I: Integer; +begin + for I := 0 to AreaViewInfoCount - 1 do + AreaViewInfos[I].Free; +end; + +function TcxGridColumnHeaderViewInfo.AreasNeedHotTrack: Boolean; +var + I: Integer; +begin + for I := 0 to AreaViewInfoCount - 1 do + begin + Result := AreaViewInfos[I].NeedsContainerHotTrack; + if Result then Exit; + end; + Result := False; +end; + +function TcxGridColumnHeaderViewInfo.CalculateHasTextOffset(ASide: TAlignment): Boolean; +var + I: Integer; +begin + if Text <> '' then + begin + Result := True; + for I := 0 to AreaViewInfoCount - 1 do + with AreaViewInfos[I] do + if OccupiesSpace and (AlignmentHorz = ASide) then Exit; + end; + Result := False; +end; + +function TcxGridColumnHeaderViewInfo.CalculateHeight: Integer; +begin + Result := GetTextCellHeight(GridViewInfo, LookAndFeelPainter); +end; + +function TcxGridColumnHeaderViewInfo.CalculateRealWidth(Value: Integer): Integer; +begin + Result := Value - FContainer.GetColumnAdditionalWidth(Column); +end; + +procedure TcxGridColumnHeaderViewInfo.CalculateTextAreaBounds; +var + I: Integer; +begin + FTextAreaBounds := inherited GetTextAreaBounds; + for I := 0 to AreaViewInfoCount - 1 do + AreaViewInfos[I].Calculate(Bounds, FTextAreaBounds); + if HasTextOffsetLeft then + Inc(FTextAreaBounds.Left, cxGridCellTextOffset); + if HasTextOffsetRight then + Dec(FTextAreaBounds.Right, cxGridCellTextOffset); +end; + +procedure TcxGridColumnHeaderViewInfo.CalculateVisible(ALeftBound, AWidth: Integer); +begin + with GridViewInfo.ClientBounds do + Visible := (ALeftBound < Right) and (ALeftBound + AWidth > Left); +end; + +function TcxGridColumnHeaderViewInfo.CalculateWidth: Integer; +begin + if FWidth = -1 then + FWidth := FContainer.GetColumnWidth(Column); + Result := FWidth; +end; + +function TcxGridColumnHeaderViewInfo.CanFilter: Boolean; +begin + Result := FColumn.CanFilter(True); +end; + +function TcxGridColumnHeaderViewInfo.CanHorzSize: Boolean; +begin + Result := FColumn.CanHorzSize and (Container.Kind = ckHeader); +end; + +function TcxGridColumnHeaderViewInfo.CanPress: Boolean; +begin + Result := True; +end; + +function TcxGridColumnHeaderViewInfo.CanShowHint: Boolean; +begin + Result := GridView.OptionsBehavior.ColumnHeaderHints; +end; + +function TcxGridColumnHeaderViewInfo.CanSort: Boolean; +begin + Result := FColumn.SortOrder <> soNone; +end; + +procedure TcxGridColumnHeaderViewInfo.CheckWidth(var Value: Integer); +begin + if Value < MinWidth then Value := MinWidth; + if Value > MaxWidth then Value := MaxWidth; +end; + +function TcxGridColumnHeaderViewInfo.CustomDraw(ACanvas: TcxCanvas): Boolean; +begin + Result := inherited CustomDraw(ACanvas); + if not Result then + begin + FColumn.DoCustomDrawHeader(ACanvas, Self, Result); + if not Result then + GridView.DoCustomDrawColumnHeader(ACanvas, Self, Result); + end; +end; + +procedure TcxGridColumnHeaderViewInfo.DoCalculateParams; +begin + FNeighbors := FContainer.GetColumnNeighbors(Column); + inherited; + CalculateTextAreaBounds; +end; + +function TcxGridColumnHeaderViewInfo.GetAlignmentHorz: TAlignment; +begin + Result := FColumn.HeaderAlignmentHorz; +end; + +function TcxGridColumnHeaderViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + Result := FColumn.HeaderAlignmentVert; +end; + +function TcxGridColumnHeaderViewInfo.GetAreaBounds: TRect; +begin + Result := Container.GetItemAreaBounds(Self); +end; + +procedure TcxGridColumnHeaderViewInfo.GetAreaViewInfoClasses(AProc: TcxGridClassEnumeratorProc); +begin + if CanHorzSize then AProc(TcxGridColumnHeaderHorzSizingEdgeViewInfo); + if CanFilter then AProc(TcxGridColumnHeaderFilterButtonViewInfo); + if CanSort then AProc(TcxGridColumnHeaderSortingMarkViewInfo); + if HasGlyph then AProc(TcxGridColumnHeaderGlyphViewInfo); +end; + +function TcxGridColumnHeaderViewInfo.GetBackgroundBitmap: TBitmap; +begin + Result := GridViewInfo.HeaderViewInfo.ColumnBackgroundBitmap; +end; + +function TcxGridColumnHeaderViewInfo.GetBorders: TcxBorders; +begin + Result := LookAndFeelPainter.HeaderBorders(Neighbors); +end; + +function TcxGridColumnHeaderViewInfo.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := GetCellBorderWidth(LookAndFeelPainter); +end; + +function TcxGridColumnHeaderViewInfo.GetCanvas: TcxCanvas; +begin + Result := GridViewInfo.Canvas; +end; + +function TcxGridColumnHeaderViewInfo.GetCaption: string; +begin + Result := Column.VisibleCaption; +end; + +class function TcxGridColumnHeaderViewInfo.GetCellBorderWidth(ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; +begin + Result := ALookAndFeelPainter.HeaderBorderSize; +end; + +class function TcxGridColumnHeaderViewInfo.GetCellHeight(ATextHeight: Integer; + ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; +begin + Result := inherited GetCellHeight(ATextHeight, ALookAndFeelPainter); + Inc(Result, 2 * GetCellBorderWidth(ALookAndFeelPainter)); +end; + +function TcxGridColumnHeaderViewInfo.GetDataOffset: Integer; +begin + Result := Bounds.Right - RealWidth; +end; + +function TcxGridColumnHeaderViewInfo.GetHeight: Integer; +begin + Result := inherited GetHeight - FAdditionalHeightAtTop; +end; + +function TcxGridColumnHeaderViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridColumnHeaderHitTest; +end; + +function TcxGridColumnHeaderViewInfo.GetHotTrack: Boolean; +begin + Result := LookAndFeelPainter.IsHeaderHotTrack or AreasNeedHotTrack; +end; + +function TcxGridColumnHeaderViewInfo.GetIsDesignSelected: Boolean; +begin + Result := GridView.IsDesigning and + GridView.Controller.DesignController.IsObjectSelected(FColumn); +end; + +function TcxGridColumnHeaderViewInfo.GetIsPressed: Boolean; +begin + Result := (State = gcsPressed) or (GridViewInfo.Controller.PressedColumn = Column); +end; + +function TcxGridColumnHeaderViewInfo.GetMaxWidth: Integer; +var + AIndex, I: Integer; +begin + if GridView.OptionsView.ColumnAutoWidth then + begin + Result := GridViewInfo.ClientWidth; + AIndex := Column.VisibleIndex; + if AIndex = FContainer.Count - 1 then + for I := 0 to AIndex - 1 do + Dec(Result, FContainer[I].MinWidth) + else + for I := 0 to FContainer.Count - 1 do + begin + if I < AIndex then + Dec(Result, FContainer[I].Width); + if I > AIndex then + Dec(Result, FContainer[I].MinWidth); + end; + if Result < MinWidth then Result := MinWidth; + end + else + Result := MaxInt; +end; + +function TcxGridColumnHeaderViewInfo.GetMinWidth: Integer; +begin + if IsFixed then + Result := CalculateWidth + else + Result := FContainer.GetColumnMinWidth(Column); +end; + +function TcxGridColumnHeaderViewInfo.GetMultiLine: Boolean; +begin + Result := FContainer.AutoHeight; +end; + +function TcxGridColumnHeaderViewInfo.GetMultiLinePainting: Boolean; +begin + Result := inherited GetMultiLinePainting or FContainer.GetItemMultiLinePainting(Self); +end; + +function TcxGridColumnHeaderViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridColumnHeaderPainter; +end; + +function TcxGridColumnHeaderViewInfo.GetShowEndEllipsis: Boolean; +begin + Result := GridView.OptionsView.HeaderEndEllipsis; +end; + +function TcxGridColumnHeaderViewInfo.GetText: string; +begin + if Column.Options.ShowCaption then + Result := Caption + else + Result := ''; +end; + +function TcxGridColumnHeaderViewInfo.GetTextAreaBounds: TRect; +begin + Result := FTextAreaBounds; +end; + +procedure TcxGridColumnHeaderViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + Column.Styles.GetHeaderParams(AParams); +end; + +function TcxGridColumnHeaderViewInfo.GetWidth: Integer; +begin + Result := inherited GetWidth - FAdditionalWidthAtLeft; +end; + +function TcxGridColumnHeaderViewInfo.HasCustomDraw: Boolean; +begin + Result := Column.HasCustomDrawHeader or GridView.HasCustomDrawColumnHeader; +end; + +function TcxGridColumnHeaderViewInfo.HasFixedContentSpace: Boolean; +begin + Result := False; +end; + +function TcxGridColumnHeaderViewInfo.HasGlyph: Boolean; +begin + Result := not FColumn.HeaderGlyph.Empty; +end; + +function TcxGridColumnHeaderViewInfo.HasHeaderAsContainer: Boolean; +begin + Result := FContainer = GridViewInfo.HeaderViewInfo; +end; + +procedure TcxGridColumnHeaderViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + FContainer.InitHitTest(AHitTest); + inherited; + (AHitTest as TcxCustomGridColumnHitTest).Column := Column; +end; + +procedure TcxGridColumnHeaderViewInfo.Offset(DX, DY: Integer); +var + I: Integer; +begin + inherited; + OffsetRect(FTextAreaBounds, DX, DY); + for I := 0 to AreaViewInfoCount - 1 do + AreaViewInfos[I].DoOffset(DX, DY); +end; + +procedure TcxGridColumnHeaderViewInfo.SetWidth(Value: Integer); +begin + inherited; + FWidth := Value; +end; + +procedure TcxGridColumnHeaderViewInfo.StateChanged(APrevState: TcxGridCellState); +begin + if not IsDestroying and AreasNeedHotTrack then + Recalculate; + inherited; +end; + +procedure TcxGridColumnHeaderViewInfo.BeforeRecalculation; +begin + inherited; + Bounds := RealBounds; +end; + +procedure TcxGridColumnHeaderViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); + + procedure CheckHiddenBorders(var AAdditionalWidthAtLeft, AAdditionalHeightAtTop: Integer); + var + AHiddenBorders: TcxBorders; + begin + CalculateParams; + AHiddenBorders := cxBordersAll - Borders; + if AHiddenBorders <> [] then + begin + if bLeft in AHiddenBorders then + begin + Dec(ALeftBound, BorderWidth[bLeft]); + Inc(AWidth, BorderWidth[bLeft]); + Inc(AAdditionalWidthAtLeft, BorderWidth[bLeft]); + end; + if bTop in AHiddenBorders then + begin + Dec(ATopBound, BorderWidth[bTop]); + Inc(AHeight, BorderWidth[bTop]); + Inc(AAdditionalHeightAtTop, BorderWidth[bTop]); + end; + Borders := cxBordersAll; + end; + end; + +begin + FAdditionalWidthAtLeft := 0; + FAdditionalHeightAtTop := 0; + if AWidth = -1 then + AWidth := CalculateWidth; + CalculateVisible(ALeftBound, AWidth); + CheckHiddenBorders(FAdditionalWidthAtLeft, FAdditionalHeightAtTop); + inherited; + {if Visible then }CalculateTextAreaBounds; +end; + +function TcxGridColumnHeaderViewInfo.GetBestFitWidth: Integer; +var + I: Integer; +begin + Result := inherited GetBestFitWidth - FAdditionalWidthAtLeft; + if HasTextOffsetLeft then Inc(Result, cxGridCellTextOffset); + if HasTextOffsetRight then Inc(Result, cxGridCellTextOffset); + for I := 0 to AreaViewInfoCount - 1 do + with AreaViewInfos[I] do + if OccupiesSpace then Inc(Result, Width); +end; + +function TcxGridColumnHeaderViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +var + I: Integer; +begin + for I := 0 to AreaViewInfoCount - 1 do + begin + Result := AreaViewInfos[I].GetHitTest(P); + if Result <> nil then Exit; + end; + Result := inherited GetHitTest(P); +end; + +procedure TcxGridColumnHeaderViewInfo.InitAutoWidthItem(AAutoWidthItem: TcxAutoWidthItem); +begin + AAutoWidthItem.MinWidth := MinWidth; + AAutoWidthItem.Width := CalculateWidth; + AAutoWidthItem.Fixed := IsFixed; +end; + +function TcxGridColumnHeaderViewInfo.MouseDown(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +begin + Result := inherited MouseDown(AHitTest, AButton, AShift); + if (AButton = mbLeft) and not (ssDouble in AShift) and CanPress then + begin + if GridView.IsDesigning then + GridView.Controller.DesignController.SelectObject(FColumn, not (ssShift in AShift)) + else + begin + GridView.Controller.PressedColumn := FColumn; + FColumn.DoHeaderClick; + end; + Result := True; + end; +end; + +{ TcxGridHeaderViewInfoSpecific } + +constructor TcxGridHeaderViewInfoSpecific.Create(AContainerViewInfo: TcxGridHeaderViewInfo); +begin + inherited Create; + FContainerViewInfo := AContainerViewInfo; +end; + +function TcxGridHeaderViewInfoSpecific.GetGridViewInfo: TcxGridTableViewInfo; +begin + Result := FContainerViewInfo.GridViewInfo; +end; + +function TcxGridHeaderViewInfoSpecific.GetItemHeight: Integer; +begin + Result := FContainerViewInfo.ItemHeight; +end; + +function TcxGridHeaderViewInfoSpecific.CalculateHeight: Integer; +begin + Result := ItemHeight; +end; + +function TcxGridHeaderViewInfoSpecific.GetHeight: Integer; +begin + Result := CalculateHeight; +end; + +{ TcxGridHeaderViewInfo } + +constructor TcxGridHeaderViewInfo.Create(AGridViewInfo: TcxCustomGridTableViewInfo); +begin + inherited; + FSpecific := GridViewInfo.GetHeaderViewInfoSpecificClass.Create(Self); +end; + +destructor TcxGridHeaderViewInfo.Destroy; +begin + FSpecific.Free; + inherited; +end; + +function TcxGridHeaderViewInfo.GetColumn(Index: Integer): TcxGridColumn; +begin + Result := GridView.VisibleColumns[Index]; +end; + +function TcxGridHeaderViewInfo.GetColumnCount: Integer; +begin + Result := GridView.VisibleColumnCount; +end; + +procedure TcxGridHeaderViewInfo.AddIndicatorItems(AIndicatorViewInfo: TcxGridIndicatorViewInfo; + ATopBound: Integer); +begin + AIndicatorViewInfo.AddItem(ATopBound, Height, TcxGridIndicatorHeaderItemViewInfo); +end; + +procedure TcxGridHeaderViewInfo.CalculateColumnAutoWidths; +var + AAutoWidthObject: TcxAutoWidthObject; + I: Integer; +begin + AAutoWidthObject := TcxAutoWidthObject.Create(Count); + try + for I := 0 to Count - 1 do + Items[I].InitAutoWidthItem(AAutoWidthObject.AddItem); + AAutoWidthObject.AvailableWidth := GridViewInfo.ClientWidth; + AAutoWidthObject.Calculate; + for I := 0 to Count - 1 do + Items[I].Width := AAutoWidthObject[I].AutoWidth; + finally + AAutoWidthObject.Free; + end; +end; + +procedure TcxGridHeaderViewInfo.CalculateColumnWidths; +begin + if CanCalculateAutoWidths then CalculateColumnAutoWidths; +end; + +function TcxGridHeaderViewInfo.CalculateHeight: Integer; +begin + Result := FSpecific.Height; +end; + +procedure TcxGridHeaderViewInfo.CalculateInvisible; +begin + if IsAlwaysVisibleForCalculation then + begin + CalculateVisible; + Height := 0; + Bounds := Rect(0, 0, 0, 0); + end + else + inherited; +end; + +function TcxGridHeaderViewInfo.CalculateItemHeight: Integer; +var + I, AColumnHeight: Integer; +begin + if IsHeightAssigned then + Result := GridView.OptionsView.HeaderHeight + else + begin + Result := 0; + CalculateParams; + for I := 0 to Count - 1 do + if Items[I].Visible then + begin + AColumnHeight := Items[I].CalculateHeight; + if AColumnHeight > Result then Result := AColumnHeight; + end; + if Result = 0 then + Result := inherited CalculateItemHeight; + end; +end; + +procedure TcxGridHeaderViewInfo.CalculateItems; +var + ALeftBound, ATopBound, I, AWidth: Integer; + AItem: TcxGridColumnHeaderViewInfo; +begin + with ItemsAreaBounds do + begin + ALeftBound := Left; + ATopBound := Top; + end; + for I := 0 to Count - 1 do + begin + AItem := Items[I]; + AWidth := AItem.CalculateWidth; + AItem.Calculate(ALeftBound, ATopBound, AWidth, ItemHeight); + Inc(ALeftBound, AWidth); + end; +end; + +procedure TcxGridHeaderViewInfo.CalculateVisible; +begin + CalculateColumnWidths; + inherited; +end; + +function TcxGridHeaderViewInfo.CalculateWidth: Integer; +begin + Result := GridViewInfo.RecordsViewInfo.RowWidth; +end; + +function TcxGridHeaderViewInfo.CanCalculateAutoWidths: Boolean; +begin + Result := GridView.OptionsView.ColumnAutoWidth; +end; + +function TcxGridHeaderViewInfo.DrawColumnBackgroundHandler(ACanvas: TcxCanvas; + const ABounds: TRect): Boolean; +begin + Result := ColumnBackgroundBitmap <> nil; + if Result then + ACanvas.FillRect(ABounds, ColumnBackgroundBitmap); +end; + +function TcxGridHeaderViewInfo.GetAlignment: TcxGridPartAlignment; +begin + Result := gpaTop; +end; + +function TcxGridHeaderViewInfo.GetAutoHeight: Boolean; +begin + Result := GridViewInfo.SupportsAutoHeight and GridView.OptionsView.HeaderAutoHeight; +end; + +function TcxGridHeaderViewInfo.GetColumnBackgroundBitmap: TBitmap; +begin + Result := GridView.BackgroundBitmaps.GetBitmap(bbHeader); +end; + +function TcxGridHeaderViewInfo.GetColumnNeighbors(AColumn: TcxGridColumn): TcxNeighbors; +begin + Result := []; + if not AColumn.IsLeft then Include(Result, nLeft); + if not AColumn.IsRight then Include(Result, nRight); +end; + +function TcxGridHeaderViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridHeaderHitTest; +end; + +function TcxGridHeaderViewInfo.GetIsAutoWidth: Boolean; +begin + Result := False; +end; + +function TcxGridHeaderViewInfo.GetIsScrollable: Boolean; +begin + Result := True; +end; + +function TcxGridHeaderViewInfo.GetItemMultiLinePainting(AItem: TcxGridColumnHeaderViewInfo): Boolean; +begin + Result := inherited GetItemMultiLinePainting(AItem) or IsHeightAssigned; +end; + +function TcxGridHeaderViewInfo.GetKind: TcxGridColumnContainerKind; +begin + Result := ckHeader; +end; + +function TcxGridHeaderViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridHeaderPainter; +end; + +procedure TcxGridHeaderViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetHeaderParams(nil, AParams); +end; + +function TcxGridHeaderViewInfo.GetVisible: Boolean; +begin + Result := GridView.OptionsView.Header; +end; + +function TcxGridHeaderViewInfo.GetWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + Inc(Result, Items[I].CalculateWidth); +end; + +function TcxGridHeaderViewInfo.GetZonesAreaBounds: TRect; +begin + Result := inherited GetZonesAreaBounds; + InflateRect(Result, 0, ColumnHeaderMovingZoneSize); +end; + +function TcxGridHeaderViewInfo.IsAlwaysVisibleForCalculation: Boolean; +begin + Result := True; +end; + +function TcxGridHeaderViewInfo.IsHeightAssigned: Boolean; +begin + Result := GridView.OptionsView.HeaderHeight <> 0; +end; + +procedure TcxGridHeaderViewInfo.Offset(DX, DY: Integer); +begin + inherited; + RecalculateItemVisibles; +end; + +procedure TcxGridHeaderViewInfo.RecalculateItemVisibles; +var + I: Integer; +begin + for I := 0 to Count - 1 do + with Items[I] do + CalculateVisible(Bounds.Left, Bounds.Right - Bounds.Left); +end; + +procedure TcxGridHeaderViewInfo.AssignColumnWidths; +var + I: Integer; +begin + GridView.BeginUpdate; + try + for I := 0 to Count - 1 do + with Items[I] do + Column.Width := RealWidth; + finally + GridView.EndUpdate; + end; +end; + +procedure TcxGridHeaderViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + inherited; + CalculateItems; +end; + +{ TcxGridGroupByBoxColumnHeaderViewInfo } + +function TcxGridGroupByBoxColumnHeaderViewInfo.GetContainer: TcxGridGroupByBoxViewInfo; +begin + Result := TcxGridGroupByBoxViewInfo(inherited Container); +end; + +function TcxGridGroupByBoxColumnHeaderViewInfo.CalculateHeight: Integer; +begin + Result := TcxGridGroupByBoxViewInfo(Container).ItemHeight; +end; + +function TcxGridGroupByBoxColumnHeaderViewInfo.GetCaption: string; +begin + Result := Column.GetAlternateCaption; +end; + +function TcxGridGroupByBoxColumnHeaderViewInfo.HasFixedContentSpace: Boolean; +begin + Result := Container.CalculatingColumnWidth; +end; + +function TcxGridGroupByBoxColumnHeaderViewInfo.InheritedCalculateHeight: Integer; +begin + Result := inherited CalculateHeight; +end; + +{ TcxGridGroupByBoxViewInfo } + +function TcxGridGroupByBoxViewInfo.GetGroupByBoxVerOffset: Integer; +begin + Result := ItemHeight div 2; +end; + +function TcxGridGroupByBoxViewInfo.GetLinkLineBounds(Index: Integer; + Horizontal: Boolean): TRect; +begin + Result := Items[Index].Bounds; + Result.Left := Result.Right - 2 * GroupByBoxHorOffset; + Result.Top := Result.Bottom; + Inc(Result.Bottom, GroupByBoxLineVerOffset); + if Horizontal then + begin + Result.Top := Result.Bottom - GroupByBoxLineWidth; + Inc(Result.Right, GroupByBoxHorOffset); + end + else + Result.Right := Result.Left + GroupByBoxLineWidth; +end; + +function TcxGridGroupByBoxViewInfo.GetColumn(Index: Integer): TcxGridColumn; +begin + Result := GridView.GroupedColumns[Index]; +end; + +function TcxGridGroupByBoxViewInfo.GetColumnCount: Integer; +begin + Result := GridView.GroupedColumnCount; +end; + +function TcxGridGroupByBoxViewInfo.GetItemClass: TcxGridColumnHeaderViewInfoClass; +begin + Result := TcxGridGroupByBoxColumnHeaderViewInfo; +end; + +function TcxGridGroupByBoxViewInfo.CalculateHeight: Integer; + + function TextHeight: Integer; + begin + CalculateParams; + Result := GridViewInfo.GetFontHeight(Params.Font); + GetCellTextAreaSize(Result); + Inc(Result, 2); + end; + +begin + Result := ColumnCount; + if Result = 0 then + Result := 2 * GroupByBoxTopOffset + TextHeight + else + Result := 2 * GroupByBoxTopOffset + + ItemHeight div 2 * (Result + 1) + Byte(Odd(ItemHeight)); +end; + +function TcxGridGroupByBoxViewInfo.CalculateItemHeight: Integer; +var + I, AColumnHeight: Integer; +begin + Result := 0; + CalculateParams; + for I := 0 to Count - 1 do + begin + AColumnHeight := TcxGridGroupByBoxColumnHeaderViewInfo(Items[I]).InheritedCalculateHeight; + if AColumnHeight > Result then Result := AColumnHeight; + end; + if Result = 0 then + Result := inherited CalculateItemHeight; +end; + +function TcxGridGroupByBoxViewInfo.CalculateWidth: Integer; +begin + Result := GridViewInfo.ClientWidth; +end; + +function TcxGridGroupByBoxViewInfo.GetAlignment: TcxGridPartAlignment; +begin + Result := gpaTop; +end; + +function TcxGridGroupByBoxViewInfo.GetAlignmentVert: TcxAlignmentVert; +begin + Result := vaCenter; +end; + +function TcxGridGroupByBoxViewInfo.GetBackgroundBitmap: TBitmap; +begin + Result := GridView.BackgroundBitmaps.GetBitmap(bbGroupByBox); +end; + +function TcxGridGroupByBoxViewInfo.GetColumnWidth(AColumn: TcxGridColumn): Integer; +begin + FCalculatingColumnWidth := True; + Result := Items[AColumn.GroupIndex].GetBestFitWidth; + FCalculatingColumnWidth := False; +end; + +function TcxGridGroupByBoxViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridGroupByBoxHitTest; +end; + +function TcxGridGroupByBoxViewInfo.GetIsAutoWidth: Boolean; +begin + Result := True; +end; + +function TcxGridGroupByBoxViewInfo.GetIsScrollable: Boolean; +begin + Result := False; +end; + +function TcxGridGroupByBoxViewInfo.GetItemAreaBounds(AItem: TcxGridColumnHeaderViewInfo): TRect; +begin + SetRectEmpty(Result); +end; + +function TcxGridGroupByBoxViewInfo.GetKind: TcxGridColumnContainerKind; +begin + Result := ckGroupByBox; +end; + +function TcxGridGroupByBoxViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridGroupByBoxPainter; +end; + +function TcxGridGroupByBoxViewInfo.GetText: string; +begin + if Count = 0 then + Result := cxGetResourceString(@scxGridGroupByBoxCaption) + else + Result := ''; +end; + +function TcxGridGroupByBoxViewInfo.GetTextAreaBounds: TRect; +begin + Result := inherited GetTextAreaBounds; + Inc(Result.Left, GroupByBoxLeftOffset); +end; + +procedure TcxGridGroupByBoxViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetViewParams(vsGroupByBox, nil, nil, AParams); +end; + +function TcxGridGroupByBoxViewInfo.GetVisible: Boolean; +begin + Result := GridView.OptionsView.GroupByBox; +end; + +procedure TcxGridGroupByBoxViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +var + I: Integer; + AColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo; +begin + inherited; + with Bounds do + begin + ALeftBound := Left + GroupByBoxLeftOffset; + ATopBound := Top + GroupByBoxTopOffset; + end; + for I := 0 to Count - 1 do + begin + AColumnHeaderViewInfo := Items[I]; + AColumnHeaderViewInfo.Calculate(ALeftBound, ATopBound); + Inc(ALeftBound, AColumnHeaderViewInfo.Width + GroupByBoxHorOffset); + Inc(ATopBound, GroupByBoxVerOffset); + end; +end; + +{ TcxGridFooterCellViewInfo } + +constructor TcxGridFooterCellViewInfo.Create(AContainer: TcxGridColumnContainerViewInfo; + ASummaryItem: TcxDataSummaryItem); +begin + inherited Create(AContainer, TcxGridColumn(ASummaryItem.ItemLink)); + FSummaryItem := ASummaryItem; +end; + +function TcxGridFooterCellViewInfo.GetContainer: TcxGridFooterViewInfo; +begin + Result := TcxGridFooterViewInfo(inherited Container); +end; + +function TcxGridFooterCellViewInfo.GetSummary: TcxDataSummary; +begin + Result := SummaryItem.SummaryItems.Summary; +end; + +procedure TcxGridFooterCellViewInfo.AfterCalculateBounds(var ABounds: TRect); +begin + inherited; + with LookAndFeelPainter do + InflateRect(ABounds, -FooterCellOffset, -FooterCellOffset); +end; + +function TcxGridFooterCellViewInfo.CanPress: Boolean; +begin + Result := False; +end; + +function TcxGridFooterCellViewInfo.CustomDraw(ACanvas: TcxCanvas): Boolean; +begin + Result := False; + Column.DoCustomDrawFooterCell(ACanvas, Self, Result); + if not Result then + GridView.DoCustomDrawFooterCell(ACanvas, Self, Result); +end; + +function TcxGridFooterCellViewInfo.GetAlignmentHorz: TAlignment; +begin + Result := Column.FooterAlignmentHorz; +end; + +function TcxGridFooterCellViewInfo.GetBackgroundBitmap: TBitmap; +begin + Result := Container.BackgroundBitmap; +end; + +procedure TcxGridFooterCellViewInfo.GetAreaViewInfoClasses(AProc: TcxGridClassEnumeratorProc); +begin +end; + +function TcxGridFooterCellViewInfo.GetBorders: TcxBorders; +begin + Result := cxBordersAll; +end; + +class function TcxGridFooterCellViewInfo.GetCellBorderWidth(ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; +begin + Result := ALookAndFeelPainter.FooterCellBorderSize; +end; + +function TcxGridFooterCellViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := Container.GetItemHitTestClass; +end; + +function TcxGridFooterCellViewInfo.GetIsDesignSelected: Boolean; +begin + Result := GridView.IsDesigning and + GridView.Controller.DesignController.IsObjectSelected(SummaryItem); +end; + +function TcxGridFooterCellViewInfo.GetIsPressed: Boolean; +begin + Result := False; +end; + +function TcxGridFooterCellViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridFooterCellPainter; +end; + +function TcxGridFooterCellViewInfo.GetText: string; +begin + try + Result := Summary.FooterSummaryTexts[SummaryItem.Index]; + except + Application.HandleException(Self); + end; +end; + +procedure TcxGridFooterCellViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetFooterCellParams(nil, Column, -1, SummaryItem, AParams); +end; + +function TcxGridFooterCellViewInfo.HasCustomDraw: Boolean; +begin + Result := Column.HasCustomDrawFooterCell or GridView.HasCustomDrawFooterCell; +end; + +procedure TcxGridFooterCellViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + inherited; + (AHitTest as TcxGridFooterCellHitTest).SummaryItem := SummaryItem; +end; + +function TcxGridFooterCellViewInfo.GetBestFitWidth: Integer; +begin + Result := inherited GetBestFitWidth + 2 * LookAndFeelPainter.FooterCellOffset; +end; + +function TcxGridFooterCellViewInfo.MouseDown(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +begin + Result := inherited MouseDown(AHitTest, AButton, AShift); + if GridView.IsDesigning and (AButton = mbLeft) then + begin + GridView.Controller.DesignController.SelectObject(SummaryItem, not (ssShift in AShift)); + Result := True; + end; +end; + +{ TcxGridFooterViewInfo } + +function TcxGridFooterViewInfo.GetMultipleSummaries: Boolean; +begin + Result := RowCount > 1; +end; + +function TcxGridFooterViewInfo.GetRowCount: Integer; +begin + if FRowCount = 0 then + FRowCount := CalculateRowCount; + Result := FRowCount; +end; + +function TcxGridFooterViewInfo.GetRowHeight: Integer; +begin + if MultipleSummaries then + Result := ItemHeight + else + Result := inherited CalculateHeight; +end; + +function TcxGridFooterViewInfo.CreateItem(AIndex: Integer): TcxGridColumnHeaderViewInfo; +begin + Result := TcxGridFooterCellViewInfoClass(GetItemClass).Create(Self, FSummaryItems[AIndex]); +end; + +procedure TcxGridFooterViewInfo.CreateItems; +var + AColumnHasSummaries: array of Boolean; + I, AColumnVisibleIndex: Integer; + ASummaryItem: TcxDataSummaryItem; +begin + FSummaryItems := TList.Create; + SetLength(AColumnHasSummaries, GridView.VisibleColumnCount); + for I := 0 to SummaryItems.Count - 1 do + begin + ASummaryItem := SummaryItems[I]; + if (ASummaryItem.Position = spFooter) and (ASummaryItem.ItemLink is TcxGridColumn) then + begin + AColumnVisibleIndex := TcxGridColumn(ASummaryItem.ItemLink).VisibleIndex; + if (AColumnVisibleIndex <> -1) and + (CanShowMultipleSummaries or not AColumnHasSummaries[AColumnVisibleIndex]) then + begin + FSummaryItems.Add(ASummaryItem); + AColumnHasSummaries[AColumnVisibleIndex] := True; + end; + end; + end; + PrepareSummaryItems(FSummaryItems); + inherited; +end; + +procedure TcxGridFooterViewInfo.DestroyItems; +begin + inherited; + FreeAndNil(FSummaryItems); +end; + +function TcxGridFooterViewInfo.GetColumn(Index: Integer): TcxGridColumn; +begin + Result := TcxGridColumn(TcxDataSummaryItem(FSummaryItems[Index]).ItemLink); +end; + +function TcxGridFooterViewInfo.GetColumnCount: Integer; +begin + Result := FSummaryItems.Count; +end; + +function TcxGridFooterViewInfo.GetItemClass: TcxGridColumnHeaderViewInfoClass; +begin + Result := TcxGridFooterCellViewInfo; +end; + +procedure TcxGridFooterViewInfo.PrepareSummaryItems(ASummaryItems: TList); +begin +end; + +function TcxGridFooterViewInfo.CalculateBounds: TRect; +begin + Result := inherited CalculateBounds; + with GridViewInfo.HeaderViewInfo.CalculateBounds do + begin + Result.Left := Left; + Result.Right := Right; + end; +end; + +function TcxGridFooterViewInfo.CalculateHeight: Integer; +begin + CalculateParams; + Result := BorderSize[bTop] + RowCount * RowHeight + BorderSize[bBottom]; + Inc(Result, SeparatorWidth); +end; + +function TcxGridFooterViewInfo.CalculateItemHeight: Integer; +begin + Result := inherited CalculateItemHeight + 2 * LookAndFeelPainter.FooterCellOffset; +end; + +procedure TcxGridFooterViewInfo.CalculateItem(AIndex: Integer); +begin + Items[AIndex].Calculate(GetItemLeftBound(AIndex), GetItemTopBound(AIndex), + -1, GetItemHeight(AIndex)); +end; + +procedure TcxGridFooterViewInfo.CalculateItems; +var + I: Integer; +begin + for I := 0 to Count - 1 do + if IsItemVisible(I) then CalculateItem(I); +end; + +function TcxGridFooterViewInfo.CalculateRowCount: Integer; +var + I: Integer; + ItemCount: array of Integer; +begin + Result := 1; + if Count = 0 then Exit; + SetLength(ItemCount, GridView.VisibleItemCount); + for I := 0 to Count - 1 do + Inc(ItemCount[Items[I].Column.VisibleIndex]); + for I := 0 to Length(ItemCount) - 1 do + Result := Max(Result, ItemCount[I]); +end; + +function TcxGridFooterViewInfo.CanCalculateAutoWidths: Boolean; +begin + Result := False; +end; + +function TcxGridFooterViewInfo.GetAlignment: TcxGridPartAlignment; +begin + Result := gpaBottom; +end; + +function TcxGridFooterViewInfo.GetAutoHeight: Boolean; +begin + Result := GridViewInfo.SupportsAutoHeight and + GridView.OptionsView.FooterAutoHeight and not MultipleSummaries; +end; + +function TcxGridFooterViewInfo.GetBackgroundBitmap: TBitmap; +begin + Result := GridView.BackgroundBitmaps.GetBitmap(bbFooter); +end; + +function TcxGridFooterViewInfo.GetBordersBounds: TRect; +begin + Result := Bounds; + Inc(Result.Top, SeparatorWidth); +end; + +function TcxGridFooterViewInfo.GetBorders: TcxBorders; +begin + Result := LookAndFeelPainter.FooterBorders; +end; + +function TcxGridFooterViewInfo.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := LookAndFeelPainter.FooterBorderSize; +end; + +function TcxGridFooterViewInfo.GetColumnWidth(AColumn: TcxGridColumn): Integer; +begin + Result := GridViewInfo.HeaderViewInfo[AColumn.VisibleIndex].Width; + if AColumn.IsMostLeft then + Dec(Result, BorderSize[bLeft]); + if AColumn.IsMostRight then + Dec(Result, BorderSize[bRight]); +end; + +function TcxGridFooterViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridFooterHitTest; +end; + +function TcxGridFooterViewInfo.GetIsAutoWidth: Boolean; +begin + Result := GridViewInfo.HeaderViewInfo.IsAutoWidth; +end; + +function TcxGridFooterViewInfo.GetIsScrollable: Boolean; +begin + Result := GridViewInfo.HeaderViewInfo.IsScrollable; +end; + +function TcxGridFooterViewInfo.GetItemAreaBounds(AItem: TcxGridColumnHeaderViewInfo): TRect; +begin + Result := GridViewInfo.HeaderViewInfo.GetItemAreaBounds(AItem); +end; + +function TcxGridFooterViewInfo.GetItemHeight(AColumn: TcxGridColumn): Integer; +begin + if MultipleSummaries then + Result := ItemHeight + else + Result := GridViewInfo.GetCellHeight(AColumn.VisibleIndex, ItemHeight); +end; + +function TcxGridFooterViewInfo.GetItemHeight(AIndex: Integer): Integer; +begin + Result := GetItemHeight(Items[AIndex].Column); +end; + +function TcxGridFooterViewInfo.GetItemHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridFooterCellHitTest; +end; + +function TcxGridFooterViewInfo.GetItemLeftBound(AColumn: TcxGridColumn): Integer; +begin + if AColumn.IsMostLeft then + Result := ItemsAreaBounds.Left + else + Result := GridViewInfo.HeaderViewInfo[AColumn.VisibleIndex].RealBounds.Left; +end; + +function TcxGridFooterViewInfo.GetItemLeftBound(AIndex: Integer): Integer; +begin + Result := GetItemLeftBound(Items[AIndex].Column); +end; + +function TcxGridFooterViewInfo.GetItemRowIndex(AIndex: Integer): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to AIndex - 1 do + if Items[I].Column = Items[AIndex].Column then + Inc(Result); +end; + +function TcxGridFooterViewInfo.GetItemsAreaBounds: TRect; +begin + Result := BordersBounds; + with Result do + begin + Inc(Left, BorderSize[bLeft]); + Inc(Top, BorderSize[bTop]); + Dec(Right, BorderSize[bRight]); + Dec(Bottom, BorderSize[bBottom]); + end; +end; + +function TcxGridFooterViewInfo.GetItemTopBound(AColumn: TcxGridColumn): Integer; +begin + Result := ItemsAreaBounds.Top + GridViewInfo.GetCellTopOffset(AColumn.VisibleIndex, ItemHeight); +end; + +function TcxGridFooterViewInfo.GetItemTopBound(AIndex: Integer): Integer; +begin + Result := GetItemTopBound(Items[AIndex].Column) + GetItemRowIndex(AIndex) * RowHeight; +end; + +function TcxGridFooterViewInfo.GetKind: TcxGridColumnContainerKind; +begin + Result := ckFooter; +end; + +function TcxGridFooterViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := GridViewInfo.GetFooterPainterClass; +end; + +function TcxGridFooterViewInfo.GetSeparatorBounds: TRect; +begin + Result := Bounds; + Result.Bottom := Result.Top + SeparatorWidth; +end; + +function TcxGridFooterViewInfo.GetSeparatorWidth: Integer; +begin + if HasSeparator then + Result := LookAndFeelPainter.FooterSeparatorSize + else + Result := 0; +end; + +function TcxGridFooterViewInfo.GetSummaryItems: TcxDataSummaryItems; +begin + Result := GridView.FDataController.Summary.FooterSummaryItems; +end; + +procedure TcxGridFooterViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetFooterParams(nil, nil, -1, nil, AParams); +end; + +function TcxGridFooterViewInfo.GetVisible: Boolean; +begin + Result := GridView.OptionsView.Footer; +end; + +function TcxGridFooterViewInfo.HasSeparator: Boolean; +begin + Result := True; +end; + +function TcxGridFooterViewInfo.IsAlwaysVisibleForCalculation: Boolean; +begin + Result := False; +end; + +function TcxGridFooterViewInfo.IsHeightAssigned: Boolean; +begin + Result := False; +end; + +function TcxGridFooterViewInfo.IsItemVisible(AIndex: Integer): Boolean; +begin + Result := GridViewInfo.HeaderViewInfo[Items[AIndex].Column.VisibleIndex].Visible; +end; + +procedure TcxGridFooterViewInfo.Offset(DX, DY: Integer); +var + I: Integer; +begin + inherited; + if DX <> 0 then + for I := 0 to Count - 1 do + if IsItemVisible(I) then + if not Items[I].Calculated then + CalculateItem(I) + else + else + Items[I].Calculated := False; +end; + +function TcxGridFooterViewInfo.CanShowMultipleSummaries: Boolean; +begin + Result := GridView.OptionsView.CanShowFooterMultiSummaries; +end; + +function TcxGridFooterViewInfo.GetCellBestFitWidth(AColumn: TcxGridColumn): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + if Items[I].Column = AColumn then + Result := Max(Result, Items[I].GetBestFitWidth); +end; + +function TcxGridFooterViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; + + function GetCellBounds(AColumn: TcxGridColumn): TRect; + begin + Result.Left := GetItemLeftBound(AColumn); + Result.Right := Result.Left + GetColumnWidth(AColumn); + if MultipleSummaries then + with ItemsAreaBounds do + begin + Result.Top := Top; + Result.Bottom := Bottom; + end + else + begin + Result.Top := GetItemTopBound(AColumn); + Result.Bottom := Result.Top + GetItemHeight(AColumn); + end; + end; + +var + I: Integer; + AColumn: TcxGridColumn; +begin + Result := GetItemsHitTest(P); + if Result = nil then + begin + Result := inherited GetHitTest(P); + if Result <> nil then + for I := 0 to GridView.VisibleColumnCount - 1 do + begin + AColumn := GridView.VisibleColumns[I]; + if PtInRect(GetCellBounds(AColumn), P) then + begin + Result := GetItemHitTestClass.Instance(P); + InitHitTest(Result); + TcxGridFooterCellHitTest(Result).Column := AColumn; + TcxGridFooterCellHitTest(Result).SummaryItem := nil; + Break; + end; + end; + end; +end; + +{ TcxCustomGridIndicatorItemViewInfo } + +constructor TcxCustomGridIndicatorItemViewInfo.Create(AContainer: TcxGridIndicatorViewInfo); +begin + inherited Create(AContainer.GridViewInfo); + FContainer := AContainer; +end; + +destructor TcxCustomGridIndicatorItemViewInfo.Destroy; +begin + FContainer.FItems.Remove(Self); + inherited; +end; + +function TcxCustomGridIndicatorItemViewInfo.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxCustomGridIndicatorItemViewInfo.GetGridViewInfo: TcxGridTableViewInfo; +begin + Result := TcxGridTableViewInfo(inherited GridViewInfo); +end; + +function TcxCustomGridIndicatorItemViewInfo.CalculateWidth: Integer; +begin + Result := FContainer.Width; +end; + +function TcxCustomGridIndicatorItemViewInfo.CustomDraw(ACanvas: TcxCanvas): Boolean; +begin + Result := inherited CustomDraw(ACanvas); + if not Result then + GridView.DoCustomDrawIndicatorCell(ACanvas, Self, Result); +end; + +function TcxCustomGridIndicatorItemViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridIndicatorHitTest; +end; + +function TcxCustomGridIndicatorItemViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxCustomGridIndicatorItemPainter; +end; + +procedure TcxCustomGridIndicatorItemViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetViewParams(vsIndicator, nil, nil, AParams); +end; + +function TcxCustomGridIndicatorItemViewInfo.HasCustomDraw: Boolean; +begin + Result := GridView.HasCustomDrawIndicatorCell; +end; + +{ TcxGridIndicatorHeaderItemViewInfo } + +function TcxGridIndicatorHeaderItemViewInfo.GetDropDownWindowValue: TcxCustomGridCustomizationPopup; +begin + Result := TcxCustomGridCustomizationPopup(inherited DropDownWindow); +end; + +function TcxGridIndicatorHeaderItemViewInfo.CalculateHeight: Integer; +begin + Result := 0; +end; + +function TcxGridIndicatorHeaderItemViewInfo.CanShowHint: Boolean; +begin + Result := SupportsQuickCustomization; +end; + +function TcxGridIndicatorHeaderItemViewInfo.GetCellBoundsForHint: TRect; +begin + Result := Bounds; +end; + +function TcxGridIndicatorHeaderItemViewInfo.GetHintTextRect(const AMousePos: TPoint): TRect; +begin + Result := Bounds; + OffsetRect(Result, 0, Height + 5); +end; + +function TcxGridIndicatorHeaderItemViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridIndicatorHeaderHitTest; +end; + +function TcxGridIndicatorHeaderItemViewInfo.GetHotTrack: Boolean; +begin + Result := SupportsQuickCustomization; +end; + +function TcxGridIndicatorHeaderItemViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridIndicatorHeaderItemPainter; +end; + +function TcxGridIndicatorHeaderItemViewInfo.GetText: string; +begin + Result := cxGetResourceString(@scxGridColumnsQuickCustomizationHint); +end; + +procedure TcxGridIndicatorHeaderItemViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetHeaderParams(nil, AParams); +end; + +function TcxGridIndicatorHeaderItemViewInfo.IsHintForText: Boolean; +begin + Result := False; +end; + +function TcxGridIndicatorHeaderItemViewInfo.IsHintMultiLine: Boolean; +begin + Result := False; +end; + +function TcxGridIndicatorHeaderItemViewInfo.SupportsQuickCustomization: Boolean; +begin + Result := GridView.OptionsCustomize.ColumnsQuickCustomization; +end; + +function TcxGridIndicatorHeaderItemViewInfo.CloseDropDownWindowOnDestruction: Boolean; +begin + Result := False; +end; + +function TcxGridIndicatorHeaderItemViewInfo.DropDownWindowExists: Boolean; +begin + Result := GridView.Controller.HasItemsCustomizationPopup; +end; + +function TcxGridIndicatorHeaderItemViewInfo.GetDropDownWindow: TcxCustomGridPopup; +begin + Result := GridView.Controller.ItemsCustomizationPopup; +end; + +{ TcxGridIndicatorRowItemViewInfo } + +destructor TcxGridIndicatorRowItemViewInfo.Destroy; +begin + FRowViewInfo.FIndicatorItem := nil; + inherited; +end; + +function TcxGridIndicatorRowItemViewInfo.GetGridRecord: TcxCustomGridRow; +begin + Result := FRowViewInfo.GridRecord; +end; + +function TcxGridIndicatorRowItemViewInfo.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxGridIndicatorRowItemViewInfo.CalculateHeight: Integer; +begin + Result := 0; +end; + +function TcxGridIndicatorRowItemViewInfo.GetBackgroundBitmap: TBitmap; +begin + Result := GridView.BackgroundBitmaps.GetBitmap(bbIndicator); +end; + +function TcxGridIndicatorRowItemViewInfo.GetIndicatorKind: TcxIndicatorKind; +var + ARecordSelected: Boolean; +begin + if GridRecord.IsFilterRow then + Result := ikFilter + else + if GridRecord.IsNewItemRow then + Result := ikInsert + else + if GridRecord.IsEditing then + if dceInsert in GridView.FDataController.EditState then + Result := ikInsert + else + Result := ikEdit + else + begin + ARecordSelected := GridView.OptionsSelection.MultiSelect and GridRecord.Selected; + if GridRecord.Focused then + if ARecordSelected then + Result := ikMultiArrow + else + Result := ikArrow + else + if ARecordSelected then + Result := ikMultiDot + else + Result := ikNone; + end; +end; + +function TcxGridIndicatorRowItemViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridRowIndicatorHitTest; +end; + +function TcxGridIndicatorRowItemViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridIndicatorRowItemPainter; +end; + +function TcxGridIndicatorRowItemViewInfo.GetRowSizingEdgeBounds: TRect; +begin + Result := Bounds; + with Result do + begin + Top := Bottom - cxGridRowSizingEdgeSize div 2; + Inc(Bottom, cxGridRowSizingEdgeSize div 2); + end; +end; + +procedure TcxGridIndicatorRowItemViewInfo.InitHitTest(AHitTest: TcxCustomGridHitTest); +begin + inherited; + TcxGridRecordHitTest(AHitTest).GridRecord := GridRecord; + if AHitTest is TcxGridRowIndicatorHitTest then + begin + AHitTest.ViewInfo := GridRecord.ViewInfo; + TcxGridRowIndicatorHitTest(AHitTest).MultiSelect := GridView.Controller.MultiSelect; + end; +end; + +function TcxGridIndicatorRowItemViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + if RowViewInfo.CanSize and PtInRect(RowSizingEdgeBounds, P) then + begin + Result := TcxGridRowSizingEdgeHitTest.Instance(P); + InitHitTest(Result); + end + else + Result := inherited GetHitTest(P); +end; + +function TcxGridIndicatorRowItemViewInfo.MouseDown(AHitTest: TcxCustomGridHitTest; + AButton: TMouseButton; AShift: TShiftState): Boolean; +begin + Result := inherited MouseDown(AHitTest, AButton, AShift); + if (AButton = mbLeft) and (ssDouble in AShift) and + (AHitTest.HitTestCode = htRowSizingEdge) then + RowViewInfo.RowHeight := 0; +end; + +{ TcxGridIndicatorFooterItemViewInfo } + +function TcxGridIndicatorFooterItemViewInfo.GetSeparatorWidth: Integer; +begin + Result := GridViewInfo.FooterViewInfo.SeparatorWidth; +end; + +function TcxGridIndicatorFooterItemViewInfo.CalculateHeight: Integer; +begin + Result := 0; +end; + +function TcxGridIndicatorFooterItemViewInfo.GetBackgroundBitmap: TBitmap; +begin + Result := GridViewInfo.FooterViewInfo.BackgroundBitmap; +end; + +function TcxGridIndicatorFooterItemViewInfo.GetBorders: TcxBorders; +begin + Result := LookAndFeelPainter.FooterBorders; +end; + +function TcxGridIndicatorFooterItemViewInfo.GetBordersBounds: TRect; +begin + Result := Bounds; + Inc(Result.Top, SeparatorWidth); +end; + +function TcxGridIndicatorFooterItemViewInfo.GetBorderWidth(AIndex: TcxBorder): Integer; +begin + Result := LookAndFeelPainter.FooterBorderSize; + if AIndex = bTop then Inc(Result, SeparatorWidth); +end; + +function TcxGridIndicatorFooterItemViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridIndicatorFooterItemPainter; +end; + +function TcxGridIndicatorFooterItemViewInfo.GetSeparatorBounds: TRect; +begin + Result := Bounds; + Result.Bottom := Result.Top + SeparatorWidth; +end; + +function TcxGridIndicatorFooterItemViewInfo.HasSeparator: Boolean; +begin + Result := GridViewInfo.FooterViewInfo.HasSeparator; +end; + +{ TcxGridIndicatorViewInfo } + +constructor TcxGridIndicatorViewInfo.Create(AGridViewInfo: TcxGridTableViewInfo); +begin + inherited Create(AGridViewInfo); + FItems := TList.Create; +end; + +destructor TcxGridIndicatorViewInfo.Destroy; +begin + DestroyItems; + FItems.Free; + inherited; +end; + +function TcxGridIndicatorViewInfo.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxGridIndicatorViewInfo.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxGridIndicatorViewInfo.GetGridViewInfo: TcxGridTableViewInfo; +begin + Result := TcxGridTableViewInfo(inherited GridViewInfo); +end; + +function TcxGridIndicatorViewInfo.GetItem(Index: Integer): TcxCustomGridIndicatorItemViewInfo; +begin + Result := TcxCustomGridIndicatorItemViewInfo(FItems[Index]); +end; + +procedure TcxGridIndicatorViewInfo.DestroyItems; +var + I: Integer; +begin + for I := Count - 1 downto 0 do Items[I].Free; +end; + +function TcxGridIndicatorViewInfo.CalculateHeight: Integer; +begin + with GridViewInfo do + Result := HeaderViewInfo.Height + ClientHeight + FooterViewInfo.Height; +end; + +function TcxGridIndicatorViewInfo.CalculateWidth: Integer; +begin + if Visible then + Result := GridView.OptionsView.IndicatorWidth + else + Result := 0; +end; + +function TcxGridIndicatorViewInfo.GetAlwaysVisible: Boolean; +begin + Result := GridView.OptionsCustomize.ColumnsQuickCustomization; +end; + +function TcxGridIndicatorViewInfo.GetBackgroundBitmap: TBitmap; +begin + Result := GridViewInfo.BackgroundBitmap; +end; + +function TcxGridIndicatorViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridIndicatorHitTest; +end; + +function TcxGridIndicatorViewInfo.GetPainterClass: TcxCustomGridCellPainterClass; +begin + Result := TcxGridIndicatorPainter; +end; + +procedure TcxGridIndicatorViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + AParams.Color := GridViewInfo.BackgroundColor; +end; + +function TcxGridIndicatorViewInfo.GetVisible: Boolean; +begin + Result := GridView.OptionsView.Indicator or AlwaysVisible; +end; + +function TcxGridIndicatorViewInfo.GetWidth: Integer; +begin + Result := CalculateWidth; +end; + +function TcxGridIndicatorViewInfo.AddItem(AItemClass: TcxCustomGridIndicatorItemViewInfoClass): TcxCustomGridIndicatorItemViewInfo; +begin + Result := AItemClass.Create(Self); + FItems.Add(Result); +end; + +function TcxGridIndicatorViewInfo.AddItem(ATopBound, AHeight: Integer; + AItemClass: TcxCustomGridIndicatorItemViewInfoClass): TcxCustomGridIndicatorItemViewInfo; +begin + Result := AddItem(AItemClass); + Result.Calculate(Bounds.Left, ATopBound, Width, AHeight); +end; + +function TcxGridIndicatorViewInfo.AddRowItem(ARowViewInfo: TcxCustomGridRowViewInfo): TcxCustomGridIndicatorItemViewInfo; +begin + Result := AddItem(TcxGridIndicatorRowItemViewInfo); + TcxGridIndicatorRowItemViewInfo(Result).RowViewInfo := ARowViewInfo; +end; + +procedure TcxGridIndicatorViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + inherited; + if GridViewInfo.HeaderViewInfo.Visible then + GridViewInfo.HeaderViewInfo.AddIndicatorItems(Self, Bounds.Top); + if GridViewInfo.FooterViewInfo.Visible then + AddItem(Bounds.Bottom - GridViewInfo.FooterViewInfo.Height, + GridViewInfo.FooterViewInfo.Height, TcxGridIndicatorFooterItemViewInfo); +end; + +procedure TcxGridIndicatorViewInfo.CalculateRowItem(ARowViewInfo: TcxCustomGridRowViewInfo; + AItem: TcxCustomGridIndicatorItemViewInfo); +begin + AItem.Calculate(Bounds.Left, ARowViewInfo.Bounds.Top, Width, ARowViewInfo.Height); +end; + +function TcxGridIndicatorViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I].GetHitTest(P); + if Result <> nil then Exit; + end; + Result := inherited GetHitTest(P); +end; + +function TcxGridIndicatorViewInfo.GetRowItemBounds(AGridRecord: TcxCustomGridRow): TRect; +var + I: Integer; +begin + for I := 0 to Count - 1 do + if (Items[I] is TcxGridIndicatorRowItemViewInfo) and + (TcxGridIndicatorRowItemViewInfo(Items[I]).GridRecord = AGridRecord) then + begin + Result := Items[I].Bounds; + Exit; + end; + Result := Rect(0, 0, 0, 0); +end; + +{ TcxGridRowFooterCellViewInfo } + +function TcxGridRowFooterCellViewInfo.GetContainer: TcxGridRowFooterViewInfo; +begin + Result := TcxGridRowFooterViewInfo(inherited Container); +end; + +function TcxGridRowFooterCellViewInfo.GetGridRecord: TcxCustomGridRow; +begin + Result := Container.GridRecord; +end; + +function TcxGridRowFooterCellViewInfo.GetText: string; +begin + try + Result := Summary.GroupFooterSummaryTexts[GridRecord.Index, Container.GroupLevel, + SummaryItem.Index]; + except + Application.HandleException(Self); + end; +end; + +procedure TcxGridRowFooterCellViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetFooterCellParams(GridRecord, Column, Container.GroupLevel, + SummaryItem, AParams); +end; + +{ TcxGridRowFooterViewInfo } + +constructor TcxGridRowFooterViewInfo.Create(AContainer: TcxGridRowFootersViewInfo; + ALevel: Integer); +begin + FContainer := AContainer; + FLevel := ALevel; + inherited Create(AContainer.GridViewInfo); +end; + +function TcxGridRowFooterViewInfo.GetIndent: Integer; +begin + Result := VisualLevel * GridViewInfo.LevelIndent; +end; + +function TcxGridRowFooterViewInfo.GetGridRecord: TcxCustomGridRow; +begin + Result := RowViewInfo.GridRecord; +end; + +function TcxGridRowFooterViewInfo.GetGroupLevel: Integer; +begin + Result := RowViewInfo.Level - FLevel; + if GridView.OptionsView.GroupFooters = gfVisibleWhenExpanded then + Dec(Result); +end; + +function TcxGridRowFooterViewInfo.GetRowViewInfo: TcxCustomGridRowViewInfo; +begin + Result := FContainer.RowViewInfo; +end; + +function TcxGridRowFooterViewInfo.CalculateHeight: Integer; +begin + Result := inherited CalculateHeight; + Height := Result; +end; + +function TcxGridRowFooterViewInfo.CalculateWidth: Integer; +begin + Result := inherited CalculateWidth - Indent; +end; + +function TcxGridRowFooterViewInfo.GetColumnWidth(AColumn: TcxGridColumn): Integer; +begin + Result := inherited GetColumnWidth(AColumn); + if AColumn.IsMostLeft then Dec(Result, Indent); +end; + +function TcxGridRowFooterViewInfo.GetHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridGroupFooterHitTest; +end; + +function TcxGridRowFooterViewInfo.GetIsPart: Boolean; +begin + Result := False; +end; + +function TcxGridRowFooterViewInfo.GetItemAreaBounds(AItem: TcxGridColumnHeaderViewInfo): TRect; +begin + Result := Container.GridViewInfo.FooterViewInfo.GetItemAreaBounds(AItem); +end; + +function TcxGridRowFooterViewInfo.GetItemClass: TcxGridColumnHeaderViewInfoClass; +begin + Result := TcxGridRowFooterCellViewInfo; +end; + +function TcxGridRowFooterViewInfo.GetItemHitTestClass: TcxCustomGridHitTestClass; +begin + Result := TcxGridGroupFooterCellHitTest; +end; + +function TcxGridRowFooterViewInfo.GetItemMultiLinePainting(AItem: TcxGridColumnHeaderViewInfo): Boolean; +begin + Result := GridViewInfo.FooterViewInfo.GetItemMultiLinePainting(AItem); +end; + +function TcxGridRowFooterViewInfo.GetSummaryItems: TcxDataSummaryItems; +begin + Result := GridView.FDataController.Summary.GroupSummaryItems[GroupLevel]; +end; + +procedure TcxGridRowFooterViewInfo.GetViewParams(var AParams: TcxViewParams); +begin + GridView.Styles.GetFooterParams(GridRecord, nil, GroupLevel, nil, AParams); +end; + +function TcxGridRowFooterViewInfo.GetVisible: Boolean; +begin + Result := True; +end; + +function TcxGridRowFooterViewInfo.GetVisualLevel: Integer; +begin + Result := Container.GridViewInfo.GetVisualLevel(RowViewInfo.Level - FLevel); +end; + +function TcxGridRowFooterViewInfo.HasSeparator: Boolean; +begin + Result := False; +end; + +procedure TcxGridRowFooterViewInfo.PrepareSummaryItems(ASummaryItems: TList); +begin + GridViewInfo.FooterViewInfo.PrepareSummaryItems(ASummaryItems); +end; + +function TcxGridRowFooterViewInfo.CanShowMultipleSummaries: Boolean; +begin + Result := GridView.OptionsView.CanShowGroupFooterMultiSummaries; +end; + +{ TcxGridRowFootersViewInfo } + +constructor TcxGridRowFootersViewInfo.Create(ARowViewInfo: TcxCustomGridRowViewInfo); +begin + inherited Create; + FRowViewInfo := ARowViewInfo; + FHeight := -1; + CreateItems; +end; + +destructor TcxGridRowFootersViewInfo.Destroy; +begin + DestroyItems; + inherited; +end; + +function TcxGridRowFootersViewInfo.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxGridRowFootersViewInfo.GetGridViewInfo: TcxGridTableViewInfo; +begin + Result := FRowViewInfo.GridViewInfo; +end; + +function TcxGridRowFootersViewInfo.GetHeight: Integer; +begin + if FHeight = -1 then + FHeight := CalculateHeight; + Result := FHeight; +end; + +function TcxGridRowFootersViewInfo.GetItem(Index: Integer): TcxGridRowFooterViewInfo; +begin + Result := TcxGridRowFooterViewInfo(FItems[Index]); +end; + +function TcxGridRowFootersViewInfo.GetVisibleItem(ALevel: Integer): TcxGridRowFooterViewInfo; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I]; + if Result.Level = ALevel then Exit; + end; + Result := nil; +end; + +procedure TcxGridRowFootersViewInfo.CreateItems; +var + I: Integer; +begin + FItems := TList.Create; + for I := 0 to FRowViewInfo.Level do + if FRowViewInfo.HasFooter(I) then + FItems.Add(GetItemClass.Create(Self, I)); +end; + +procedure TcxGridRowFootersViewInfo.DestroyItems; +var + I: Integer; +begin + for I := 0 to Count - 1 do Items[I].Free; + FItems.Free; +end; + +procedure TcxGridRowFootersViewInfo.BeforeRecalculation; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].BeforeRecalculation; +end; + +procedure TcxGridRowFootersViewInfo.Calculate(ALeftBound, ATopBound: Integer); +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Items[I].Calculate(ALeftBound + Items[I].Indent, ATopBound); + Inc(ATopBound, Items[I].Height); + end; +end; + +function TcxGridRowFootersViewInfo.CalculateHeight: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + Inc(Result, Items[I].CalculateHeight); +end; + +function TcxGridRowFootersViewInfo.GetItemClass: TcxGridRowFooterViewInfoClass; +begin + Result := TcxGridRowFooterViewInfo; +end; + +function TcxGridRowFootersViewInfo.GetCellBestFitWidth(AColumn: TcxGridColumn): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + Result := Max(Result, Items[I].GetCellBestFitWidth(AColumn)); +end; + +function TcxGridRowFootersViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +var + I: Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + begin + Result := Items[I].GetHitTest(P); + if Result <> nil then Break; + end; +end; + +function TcxGridRowFootersViewInfo.GetTopBound(ALevel: Integer; var ATopBound: Integer): Boolean; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I].Level >= ALevel; + if Result then + begin + ATopBound := Items[I].Bounds.Top; + Exit; + end; + end; + Result := False; +end; + +procedure TcxGridRowFootersViewInfo.Offset(DX, DY: Integer); +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].DoOffset(DX, DY); +end; + +procedure TcxGridRowFootersViewInfo.Paint; +var + I: Integer; +begin + for I := 0 to Count - 1 do Items[I].Paint; +end; + +{ TcxCustomGridRowViewInfo } + +constructor TcxCustomGridRowViewInfo.Create(ARecordsViewInfo: TcxCustomGridRecordsViewInfo; + ARecord: TcxCustomGridRecord); +begin + inherited; + FIndicatorItem := GridViewInfo.IndicatorViewInfo.AddRowItem(Self); + CreateFootersViewInfo; +end; + +destructor TcxCustomGridRowViewInfo.Destroy; +begin + DestroyFootersViewInfo; + FIndicatorItem.Free; + inherited; +end; + +function TcxCustomGridRowViewInfo.GetCacheItem: TcxGridTableViewInfoCacheItem; +begin + Result := TcxGridTableViewInfoCacheItem(inherited CacheItem); +end; + +function TcxCustomGridRowViewInfo.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxCustomGridRowViewInfo.GetGridLines: TcxGridLines; +begin + Result := RecordsViewInfo.GridLines; +end; + +function TcxCustomGridRowViewInfo.GetGridRecord: TcxCustomGridRow; +begin + Result := TcxCustomGridRow(inherited GridRecord); +end; + +function TcxCustomGridRowViewInfo.GetGridViewInfo: TcxGridTableViewInfo; +begin + Result := TcxGridTableViewInfo(inherited GridViewInfo); +end; + +function TcxCustomGridRowViewInfo.GetLevel: Integer; +begin + Result := GridRecord.Level; +end; + +function TcxCustomGridRowViewInfo.GetLevelIndent: Integer; +begin + Result := VisualLevel * GridViewInfo.LevelIndent; +end; + +function TcxCustomGridRowViewInfo.GetLevelIndentBounds(Index: Integer): TRect; +begin + Result := Bounds; + if Index = -1 then + Result.Right := ContentIndent + else + begin + Inc(Result.Left, GridViewInfo.LevelIndent * Index); + Result.Right := Result.Left + GridViewInfo.LevelIndent; + FootersViewInfo.GetTopBound(Level - Index, Result.Bottom); + end; +end; + +function TcxCustomGridRowViewInfo.GetLevelIndentHorzLineBounds(Index: Integer): TRect; +begin + Result := CalculateLevelIndentHorzLineBounds(Index, LevelIndentBounds[Index]); +end; + +function TcxCustomGridRowViewInfo.GetLevelIndentSpaceBounds(Index: Integer): TRect; +begin + Result := CalculateLevelIndentSpaceBounds(Index, LevelIndentBounds[Index]); +end; + +function TcxCustomGridRowViewInfo.GetLevelIndentVertLineBounds(Index: Integer): TRect; +begin + Result := CalculateLevelIndentVertLineBounds(Index, LevelIndentBounds[Index]); +end; + +function TcxCustomGridRowViewInfo.GetRecordsViewInfo: TcxGridRowsViewInfo; +begin + Result := TcxGridRowsViewInfo(inherited RecordsViewInfo); +end; + +function TcxCustomGridRowViewInfo.GetVisualLevel: Integer; +begin + Result := GridViewInfo.GetVisualLevel(Level); +end; + +procedure TcxCustomGridRowViewInfo.CreateFootersViewInfo; +begin + if HasFooters then + FFootersViewInfo := GetFootersViewInfoClass.Create(Self); +end; + +procedure TcxCustomGridRowViewInfo.DestroyFootersViewInfo; +begin + FFootersViewInfo.Free; +end; + +procedure TcxCustomGridRowViewInfo.RecreateFootersViewInfo; +begin + DestroyFootersViewInfo; + CreateFootersViewInfo; +end; + +procedure TcxCustomGridRowViewInfo.AfterRowsViewInfoCalculate; +begin +end; + +procedure TcxCustomGridRowViewInfo.AfterRowsViewInfoOffset; +begin +end; + +procedure TcxCustomGridRowViewInfo.CalculateExpandButtonBounds(var ABounds: TRect); +begin + if IsRectEmpty(Bounds) then + ABounds := Rect(0, 0, 0, 0) + else + with ABounds do + begin + Inc(Left, GridViewInfo.ExpandButtonIndent); + Right := Left + GridViewInfo.ExpandButtonSize; + Top := (Top + Bottom - GridViewInfo.ExpandButtonSize) div 2; + Bottom := Top + GridViewInfo.ExpandButtonSize; + end; +end; + +function TcxCustomGridRowViewInfo.CalculateHeight: Integer; +begin + Result := BottomPartHeight; +end; + +function TcxCustomGridRowViewInfo.CalculateLevelIndentHorzLineBounds(ALevel: Integer; + const ABounds: TRect): TRect; +begin + Result := ABounds; + with Result do + begin + Top := CalculateLevelIndentSpaceBounds(ALevel, ABounds).Bottom; + Bottom := Top + GridViewInfo.GridLineWidth; + if Bottom > ABounds.Bottom then Bottom := ABounds.Bottom; + end; +end; + +function TcxCustomGridRowViewInfo.CalculateLevelIndentSpaceBounds(ALevel: Integer; + const ABounds: TRect): TRect; +var + AIsParentRecordLast: Boolean; +begin + AIsParentRecordLast := GridRecord.IsParentRecordLast[Level - ALevel - 1]; + Result := ABounds; + if GridLines in [glBoth, glHorizontal] then + Dec(Result.Right, GridViewInfo.GridLineWidth); + if (GridLines <> glNone) and ((GridLines <> glVertical) and AIsParentRecordLast) then + Dec(Result.Bottom, GridViewInfo.GridLineWidth); + if AIsParentRecordLast and not HasAnyFooter(Level - ALevel) then + Dec(Result.Bottom, SeparatorWidth); +end; + +function TcxCustomGridRowViewInfo.CalculateLevelIndentVertLineBounds(ALevel: Integer; + const ABounds: TRect): TRect; +begin + Result := ABounds; + with CalculateLevelIndentSpaceBounds(ALevel, ABounds) do + begin + Result.Left := Right; + Result.Bottom := Bottom; + end; +end; + +function TcxCustomGridRowViewInfo.CalculateWidth: Integer; +begin + Result := 0{Width}; +end; + +function TcxCustomGridRowViewInfo.CanSize: Boolean; +begin + Result := False; +end; + +procedure TcxCustomGridRowViewInfo.CheckRowHeight(var AValue: Integer); +begin + if AValue < 1 then AValue := 1; +end; + +function TcxCustomGridRowViewInfo.GetAutoHeight: Boolean; +begin + Result := RecordsViewInfo.AutoRecordHeight; +end; + +function TcxCustomGridRowViewInfo.GetBaseHeight: Integer; +begin + Result := DataHeight; +end; + +function TcxCustomGridRowViewInfo.GetBottomPartHeight: Integer; +begin + Result := SeparatorWidth; + if HasFooters then + Inc(Result, FFootersViewInfo.Height); + if HasLastHorzGridLine then + Inc(Result, GridViewInfo.GridLineWidth); +end; + +function TcxCustomGridRowViewInfo.GetCellTransparent(ACell: TcxGridTableCellViewInfo): Boolean; +begin + Result := inherited GetCellTransparent(ACell) and not ACell.Selected; +end; + +function TcxCustomGridRowViewInfo.GetContentBounds: TRect; +begin + Result := inherited GetContentBounds; + Result.Left := ContentIndent; + Result.Bottom := Result.Top + DataHeight; +end; + +function TcxCustomGridRowViewInfo.GetContentIndent: Integer; +begin + Result := Bounds.Left + LevelIndent; +end; + +function TcxCustomGridRowViewInfo.GetContentWidth: Integer; +begin + Result := Width - LevelIndent; +end; + +function TcxCustomGridRowViewInfo.GetDataHeight: Integer; +begin + Result := Height - BottomPartHeight; +end; + +function TcxCustomGridRowViewInfo.GetDataIndent: Integer; +begin + Result := ContentIndent; +end; + +function TcxCustomGridRowViewInfo.GetDataWidth: Integer; +begin + Result := ContentWidth; +end; + +function TcxCustomGridRowViewInfo.GetFocusRectBounds: TRect; +begin + Result := inherited GetFocusRectBounds; + Result.Left := DataIndent; + if GridLines <> glNone then + Dec(Result.Right, GridViewInfo.GridLineWidth); + Result.Bottom := Result.Top + DataHeight; + if GridLines in [glBoth, glHorizontal] then + Dec(Result.Bottom, GridViewInfo.GridLineWidth); +end; + +function TcxCustomGridRowViewInfo.GetFootersViewInfoClass: TcxGridRowFootersViewInfoClass; +begin + Result := TcxGridRowFootersViewInfo; +end; + +function TcxCustomGridRowViewInfo.GetFullyVisible: Boolean; +begin + Result := Height = MaxHeight; +end; + +function TcxCustomGridRowViewInfo.GetLastHorzGridLineBounds: TRect; +begin + Result := Bounds; + Result.Top := Result.Bottom - GridViewInfo.GridLineWidth; +end; + +function TcxCustomGridRowViewInfo.GetMaxHeight: Integer; +begin + Result := Height; +end; + +function TcxCustomGridRowViewInfo.GetNonBaseHeight: Integer; +begin + Result := Height - BaseHeight; +end; + +function TcxCustomGridRowViewInfo.GetRowHeight: Integer; +begin + Result := Height; +end; + +function TcxCustomGridRowViewInfo.GetSeparatorBounds: TRect; +var + ASeparatorVisualLevel: Integer; +begin + with Result do + begin + Left := ContentIndent; + Right := Left + ContentWidth; + ASeparatorVisualLevel := + GridViewInfo.GetVisualLevel(Level - GridRecord.LastParentRecordCount); + Dec(Left, (VisualLevel - ASeparatorVisualLevel) * GridViewInfo.LevelIndent); + Bottom := Bounds.Bottom; + Top := Bottom - SeparatorWidth; + end; +end; + +function TcxCustomGridRowViewInfo.GetSeparatorColor: TColor; +begin + Result := GridView.OptionsView.GetRowSeparatorColor; +end; + +function TcxCustomGridRowViewInfo.GetSeparatorWidth: Integer; +begin + if ShowSeparator then + Result := RecordsViewInfo.SeparatorWidth + else + Result := 0; +end; + +function TcxCustomGridRowViewInfo.GetShowSeparator: Boolean; +begin + Result := True; +end; + +function TcxCustomGridRowViewInfo.GetVisible: Boolean; +begin + Result := Index < RecordsViewInfo.PartVisibleCount; +end; + +function TcxCustomGridRowViewInfo.GetWidth: Integer; +begin + Result := RecordsViewInfo.RowWidth; +end; + +function TcxCustomGridRowViewInfo.HasAnyFooter(ALevel: Integer): Boolean; +var + AFooterTopBound: Integer; +begin + Result := FootersViewInfo.GetTopBound(ALevel, AFooterTopBound); +end; + +function TcxCustomGridRowViewInfo.HasFooter(ALevel: Integer): Boolean; +begin + if GridView.OptionsView.GroupFooters = gfInvisible then + Result := False + else + begin + if GridView.OptionsView.GroupFooters = gfAlwaysVisible then + Dec(ALevel); + Result := (0 <= ALevel) and (ALevel < Level) and + GridRecord.IsParentRecordLast[ALevel] and + GridView.GroupedColumns[Level - 1 - ALevel].CanShowGroupFooters; + end; +end; + +function TcxCustomGridRowViewInfo.HasFooters: Boolean; +begin + Result := True; +end; + +function TcxCustomGridRowViewInfo.HasLastHorzGridLine: Boolean; +begin + Result := RecordsViewInfo.HasLastHorzGridLine(Self) and GridRecord.IsLast; +end; + +procedure TcxCustomGridRowViewInfo.Offset(DX, DY: Integer); +begin + inherited; + FIndicatorItem.DoOffset(0, DY); + if HasFooters then + FFootersViewInfo.Offset(DX, DY); +end; + +procedure TcxCustomGridRowViewInfo.BeforeRecalculation; +begin + inherited; + if HasFooters then + FFootersViewInfo.BeforeRecalculation; +end; + +procedure TcxCustomGridRowViewInfo.Calculate(ALeftBound, ATopBound: Integer; + AWidth: Integer = -1; AHeight: Integer = -1); +begin + RecreateFootersViewInfo; + inherited; + GridViewInfo.IndicatorViewInfo.CalculateRowItem(Self, FIndicatorItem); + if HasFooters then + FFootersViewInfo.Calculate(Bounds.Left, ATopBound + Height - BottomPartHeight); +end; + +function TcxCustomGridRowViewInfo.Click(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton; + AShift: TShiftState): Boolean; +var + AGridRecord: TcxCustomGridRow; +begin + AGridRecord := GridRecord; + Result := inherited Click(AHitTest, AButton, AShift); + if Result and (ssDouble in AShift) and AGridRecord.ExpandOnDblClick then + AGridRecord.ToggleExpanded; +end; + +function TcxCustomGridRowViewInfo.GetBoundsForInvalidate(AItem: TcxCustomGridTableItem): TRect; +var + R: TRect; +begin + Result := inherited GetBoundsForInvalidate(AItem); + if AItem = nil then + with GridViewInfo.IndicatorViewInfo do + if Visible then + begin + R := GetRowItemBounds(GridRecord); + if R.Left < Result.Left then Result.Left := R.Left; + end; +end; + +function TcxCustomGridRowViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + if HasFooters then + Result := FFootersViewInfo.GetHitTest(P) + else + Result := nil; + if Result = nil then + begin + Result := inherited GetHitTest(P); + if (Result <> nil) and PtInRect(LevelIndentBounds[-1], P) then + begin + Result := TcxGridRowLevelIndentHitTest.Instance(P); + InitHitTest(Result); + end; + end; +end; + +function TcxCustomGridRowViewInfo.HasSeparator: Boolean; +begin + Result := SeparatorWidth <> 0; +end; + +{ TcxGridRowsViewInfo } + +destructor TcxGridRowsViewInfo.Destroy; +begin + FFilterRowViewInfo.Free; + FNewItemRowViewInfo.Free; + inherited; +end; + +function TcxGridRowsViewInfo.GetFilterRowViewInfo: TcxCustomGridRowViewInfo; +begin + Result := FFilterRowViewInfo; + if (Result <> nil) and (Result.GridRecord = nil) then + Result := nil; +end; + +function TcxGridRowsViewInfo.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxGridRowsViewInfo.GetGridLines: TcxGridLines; +begin + Result := GridViewInfo.GridLines; +end; + +function TcxGridRowsViewInfo.GetGridViewInfo: TcxGridTableViewInfo; +begin + Result := TcxGridTableViewInfo(inherited GridViewInfo); +end; + +function TcxGridRowsViewInfo.GetHeaderViewInfo: TcxGridHeaderViewInfo; +begin + Result := GridViewInfo.HeaderViewInfo; +end; + +function TcxGridRowsViewInfo.GetItem(Index: Integer): TcxCustomGridRowViewInfo; +begin + Result := TcxCustomGridRowViewInfo(inherited Items[Index]); +end; + +function TcxGridRowsViewInfo.GetNewItemRowViewInfo: TcxCustomGridRowViewInfo; +begin + Result := FNewItemRowViewInfo; + if (Result <> nil) and (Result.GridRecord = nil) then + Result := nil; +end; + +function TcxGridRowsViewInfo.GetPainterClassValue: TcxGridRowsPainterClass; +begin + Result := TcxGridRowsPainterClass(GetPainterClass); +end; + +function TcxGridRowsViewInfo.GetViewData: TcxGridViewData; +begin + Result := TcxGridViewData(inherited ViewData); +end; + +procedure TcxGridRowsViewInfo.AfterCalculate; +begin + NotifyItemsCalculationFinished; + inherited; +end; + +procedure TcxGridRowsViewInfo.AfterOffset; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].AfterRowsViewInfoOffset; + NotifyItemsCalculationFinished; + inherited; +end; + +procedure TcxGridRowsViewInfo.Calculate; + + procedure CalculateItems; + var + I: Integer; + begin + for I := 0 to FPartVisibleCount - 1 do + Items[I].MainCalculate(GetItemLeftBound(I), GetItemTopBound(I)); + end; + +var + ATopBound: Integer; +begin + CalculateConsts; + inherited; + if GridViewInfo.CalculateDown then + begin + ATopBound := Bounds.Top; + if HasFilterRow then + begin + FilterRowViewInfo.MainCalculate(ContentBounds.Left, ATopBound); + Inc(ATopBound, FilterRowViewInfo.Height); + end; + if HasNewItemRow then + NewItemRowViewInfo.MainCalculate(ContentBounds.Left, ATopBound); + end; + CalculateVisibleCount; + if GridViewInfo.CalculateDown and (FirstRecordIndex <> -1) then + CalculateItems; +end; + +function TcxGridRowsViewInfo.CalculateBounds: TRect; +begin + Result := inherited CalculateBounds; + if IsScrollable then + Dec(Result.Left, GridViewInfo.LeftPos); + Result.Right := Result.Left + RowWidth; +end; + +procedure TcxGridRowsViewInfo.CalculateConsts; +begin + FRowHeight := CalculateRowHeight; + FDataRowHeight := CalculateDataRowHeight; + FGroupRowHeight := CalculateGroupRowHeight; +end; + +function TcxGridRowsViewInfo.CalculateContentBounds: TRect; +begin + Result := inherited CalculateContentBounds; + if HasFilterRow then + Inc(Result.Top, FilterRowViewInfo.Height); + if HasNewItemRow then + Inc(Result.Top, NewItemRowViewInfo.Height); +end; + +function TcxGridRowsViewInfo.CalculateDataRowHeight: Integer; +begin + Result := FRowHeight; +end; + +function TcxGridRowsViewInfo.CalculateGroupRowDefaultHeight(AMinHeight: Boolean): Integer; +var + AParams: TcxViewParams; +begin + GridView.Styles.GetGroupParams(nil, 0, AParams); + Result := CalculateCustomGroupRowHeight(AMinHeight, AParams); +end; + +function TcxGridRowsViewInfo.CalculateGroupRowHeight: Integer; +begin + Result := GridView.OptionsView.GroupRowHeight; + if Result = 0 then + Result := CalculateGroupRowDefaultHeight(False); +end; + +function TcxGridRowsViewInfo.CalculateRestHeight(ATopBound: Integer): Integer; +begin + Result := ContentBounds.Bottom - ATopBound; + {if not GridViewInfo.IsCalculating or GridViewInfo.CalculateDown then + Result := ContentBounds.Bottom - ATopBound + else + Result := MaxInt - 100000;} +end; + +function TcxGridRowsViewInfo.CalculateRowDefaultHeight: Integer; +var + I, AFontHeight: Integer; + AParams: TcxViewParams; +begin + if GridView.VisibleColumnCount = 0 then + begin + GridView.Styles.GetContentParams(nil, nil, AParams); + Result := GridViewInfo.GetFontHeight(AParams.Font); + GetCellTextAreaSize(Result); + end + else + begin + Result := 0; + for I := 0 to HeaderViewInfo.Count - 1 do + begin + GridView.Styles.GetDataCellParams(nil, HeaderViewInfo[I].Column, AParams); + AFontHeight := HeaderViewInfo[I].Column.CalculateDefaultCellHeight(Canvas, AParams.Font); + if AFontHeight > Result then Result := AFontHeight; + end; + end; + Result := GetCellHeight(Result); +end; + +function TcxGridRowsViewInfo.CalculateRowHeight: Integer; +begin + if IsDataRowHeightAssigned then + Result := GridView.OptionsView.DataRowHeight + else + Result := CalculateRowDefaultHeight; +end; + +procedure TcxGridRowsViewInfo.CalculateVisibleCount; +var + ALastBottom, I, AHeight: Integer; +begin + inherited; + FPartVisibleCount := 0; + FIsFirstRowFullyVisible := True; + if FirstRecordIndex = -1 then Exit; + + ALastBottom := ContentBounds.Top; + for I := 0 to MaxCount - 1 do + begin + Inc(FPartVisibleCount); + FRestHeight := CalculateRestHeight(ALastBottom); + AHeight := Items[I].MaxHeight; + Inc(ALastBottom, AHeight); + if ALastBottom > ContentBounds.Bottom then Break; + Inc(FVisibleCount); + if ALastBottom = ContentBounds.Bottom then Break; + end; + + if MaxCount > 0 then + begin + if (FVisibleCount = FPartVisibleCount) and + (GridViewInfo.CalculateDown and not Items[FVisibleCount - 1].FullyVisible or + not GridViewInfo.CalculateDown and not Items[0].FullyVisible) then + Dec(FVisibleCount); + if FVisibleCount = 0 then + begin + FVisibleCount := 1; + FIsFirstRowFullyVisible := False; + end; + end; +end; + +function TcxGridRowsViewInfo.GetAutoDataCellHeight: Boolean; +begin + Result := inherited GetAutoDataCellHeight and + GridViewInfo.SupportsAutoHeight and + (not IsDataRowHeightAssigned or GridView.IsGetCellHeightAssigned); +end; + +function TcxGridRowsViewInfo.GetCommonDataRowHeight: Integer; +begin + Result := FDataRowHeight + SeparatorWidth; +end; + +function TcxGridRowsViewInfo.GetFilterRowViewInfoClass: TcxCustomGridRowViewInfoClass; +begin + Result := TcxGridFilterRowViewInfo; +end; + +function TcxGridRowsViewInfo.GetGroupBackgroundBitmap: TBitmap; +begin + Result := GridView.BackgroundBitmaps.GetBitmap(bbGroup); +end; + +function TcxGridRowsViewInfo.GetGroupRowSeparatorWidth: Integer; +begin + if GridView.OptionsView.GroupRowStyle = grsOffice11 then + Result := cxGridOffice11GroupRowSeparatorWidth + else + Result := 0; +end; + +function TcxGridRowsViewInfo.GetItemLeftBound(AIndex: Integer): Integer; +begin + Result := ContentBounds.Left; +end; + +function TcxGridRowsViewInfo.GetItemsOffset(AItemCountDelta: Integer): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Abs(AItemCountDelta) - 1 do + Inc(Result, Items[I].Height); + if AItemCountDelta > 0 then + Result := -Result; +end; + +function TcxGridRowsViewInfo.GetItemTopBound(AIndex: Integer): Integer; +begin + if AIndex = 0 then + Result := ContentBounds.Top + else + Result := Items[AIndex - 1].Bounds.Bottom; +end; + +function TcxGridRowsViewInfo.GetIsScrollable: Boolean; +begin + Result := HeaderViewInfo.IsScrollable; +end; + +function TcxGridRowsViewInfo.GetNewItemRowViewInfoClass: TcxCustomGridRowViewInfoClass; +begin + Result := TcxGridNewItemRowViewInfo; +end; + +function TcxGridRowsViewInfo.GetPainterClass: TcxCustomGridRecordsPainterClass; +begin + Result := TcxGridRowsPainter; +end; + +function TcxGridRowsViewInfo.GetRowWidth: Integer; +begin + Result := GridViewInfo.DataWidth; +end; + +function TcxGridRowsViewInfo.GetSeparatorWidth: Integer; +begin + Result := GridView.OptionsView.RowSeparatorWidth; +end; + +function TcxGridRowsViewInfo.HasFilterRow: Boolean; +begin + Result := FilterRowViewInfo <> nil; +end; + +function TcxGridRowsViewInfo.HasLastHorzGridLine(ARowViewInfo: TcxCustomGridRowViewInfo): Boolean; +begin + Result := (GridLines = glVertical) and + ((ARowViewInfo = nil) and (SeparatorWidth = 0) or + (ARowViewInfo <> nil) and not ARowViewInfo.HasSeparator); +end; + +function TcxGridRowsViewInfo.HasNewItemRow: Boolean; +begin + Result := NewItemRowViewInfo <> nil; +end; + +function TcxGridRowsViewInfo.IsFilterRowVisible: Boolean; +begin + Result := GridView.FilterRow.Visible; +end; + +function TcxGridRowsViewInfo.IsNewItemRowVisible: Boolean; +begin + Result := GridView.NewItemRow.Visible; +end; + +procedure TcxGridRowsViewInfo.NotifyItemsCalculationFinished; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].AfterRowsViewInfoCalculate; +end; + +procedure TcxGridRowsViewInfo.OffsetItem(AIndex, AOffset: Integer); +begin + Items[AIndex].DoOffset(0, AOffset); +end; + +procedure TcxGridRowsViewInfo.AfterConstruction; +begin + inherited; + if IsFilterRowVisible then + FFilterRowViewInfo := GetFilterRowViewInfoClass.Create(Self, ViewData.FilterRow); + if IsNewItemRowVisible then + FNewItemRowViewInfo := GetNewItemRowViewInfoClass.Create(Self, ViewData.NewItemRow); +end; + +function TcxGridRowsViewInfo.CalculateCustomGroupRowHeight(AMinHeight: Boolean; + AParams: TcxViewParams): Integer; +begin + Result := Max(GridViewInfo.GetFontHeight(AParams.Font), GridViewInfo.ExpandButtonSize); + GetCellTextAreaSize(Result); + if GridView.OptionsView.GroupRowStyle = grsStandard then + Result := GetCellHeight(Result) + else + begin + if not AMinHeight then + Result := 2 * Result; + Inc(Result, GroupRowSeparatorWidth); + end; +end; + +function TcxGridRowsViewInfo.CanDataRowSize: Boolean; +begin + Result := GridViewInfo.SupportsAutoHeight and GridView.OptionsCustomize.DataRowSizing; +end; + +function TcxGridRowsViewInfo.GetCellHeight(ACellContentHeight: Integer): Integer; +begin + Result := inherited GetCellHeight(ACellContentHeight); + if GridLines in [glBoth, glHorizontal] then + Inc(Result, GridViewInfo.GridLineWidth); +end; + +function TcxGridRowsViewInfo.GetDataRowCellsAreaViewInfoClass: TClass; +begin + Result := TcxGridDataRowCellsAreaViewInfo; +end; + +function TcxGridRowsViewInfo.GetFooterCellBestFitWidth(AColumn: TcxGridColumn): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + if Items[I].HasFooters then + Result := Max(Result, Items[I].FootersViewInfo.GetCellBestFitWidth(AColumn)); +end; + +function TcxGridRowsViewInfo.GetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + Result := inherited GetHitTest(P); + if Result = nil then + begin + if HasFilterRow then + Result := FilterRowViewInfo.GetHitTest(P); + if (Result = nil) and HasNewItemRow then + Result := NewItemRowViewInfo.GetHitTest(P); + end; +end; + +function TcxGridRowsViewInfo.GetRealItem(ARecord: TcxCustomGridRecord): TcxCustomGridRecordViewInfo; +begin + if ViewData.HasFilterRow and (ARecord = ViewData.FilterRow) then + Result := FilterRowViewInfo + else + if ViewData.HasNewItemRecord and ARecord.IsNewItemRecord then + Result := NewItemRowViewInfo + else + Result := inherited GetRealItem(ARecord); +end; + +function TcxGridRowsViewInfo.GetRestHeight(ATopBound: Integer): Integer; +begin + if GridViewInfo.IsCalculating then + Result := FRestHeight + else + Result := CalculateRestHeight(ATopBound); +end; + +function TcxGridRowsViewInfo.IsCellMultiLine(AItem: TcxCustomGridTableItem): Boolean; +begin + Result := inherited IsCellMultiLine(AItem) or IsDataRowHeightAssigned; +end; + +function TcxGridRowsViewInfo.IsDataRowHeightAssigned: Boolean; +begin + Result := GridViewInfo.SupportsAutoHeight and (GridView.OptionsView.DataRowHeight <> 0); +end; + +procedure TcxGridRowsViewInfo.Offset(DX, DY: Integer); +var + I: Integer; +begin + inherited; + if HasFilterRow then + FilterRowViewInfo.DoOffset(DX, 0); + if HasNewItemRow then + NewItemRowViewInfo.DoOffset(DX, 0); + for I := 0 to Count - 1 do + Items[I].DoOffset(DX, 0); +end; + +{ TcxGridTableViewInfo } + +function TcxGridTableViewInfo.GetController: TcxGridTableController; +begin + Result := TcxGridTableController(inherited Controller); +end; + +function TcxGridTableViewInfo.GetDataWidth: Integer; +begin + if FDataWidth = 0 then + FDataWidth := CalculateDataWidth; + Result := FDataWidth; +end; + +function TcxGridTableViewInfo.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxGridTableViewInfo.GetGridLineColor: TColor; +begin + Result := GridView.OptionsView.GetGridLineColor; +end; + +function TcxGridTableViewInfo.GetGridLines: TcxGridLines; +begin + Result := GridView.OptionsView.GridLines; +end; + +function TcxGridTableViewInfo.GetLeftPos: Integer; +begin + Result := Controller.LeftPos; +end; + +function TcxGridTableViewInfo.GetLevelIndentBackgroundBitmap: TBitmap; +begin + Result := RecordsViewInfo.GroupBackgroundBitmap; +end; + +function TcxGridTableViewInfo.GetLevelIndentColor(Index: Integer): TColor; +var + AParams: TcxViewParams; +begin + GridView.Styles.GetGroupParams(nil, Index, AParams); + Result := AParams.Color; +end; + +function TcxGridTableViewInfo.GetRecordsViewInfo: TcxGridRowsViewInfo; +begin + Result := TcxGridRowsViewInfo(inherited RecordsViewInfo); +end; + +function TcxGridTableViewInfo.GetViewData: TcxGridViewData; +begin + Result := TcxGridViewData(inherited ViewData); +end; + +procedure TcxGridTableViewInfo.AfterCalculating; +begin + if Visible and (RecordsViewInfo.DataRowHeight <> FPrevDataRowHeight) then + Controller.PostGridModeBufferCountUpdate; + inherited; +end; + +procedure TcxGridTableViewInfo.BeforeCalculating; +begin + inherited; + CalculateExpandButtonParams; + if Visible then + FPrevDataRowHeight := RecordsViewInfo.DataRowHeight; +end; + +procedure TcxGridTableViewInfo.CreateViewInfos; + + function GetFilterViewInfoIndex: Integer; + begin + if FilterViewInfo.Alignment = gpaTop then + Result := FHeaderViewInfo.Index + else + Result := FFooterViewInfo.Index; + end; + +begin +// inherited; - because of new item row view info in banded view + FGroupByBoxViewInfo := GetGroupByBoxViewInfoClass.Create(Self); + FHeaderViewInfo := GetHeaderViewInfoClass.Create(Self); + FFooterViewInfo := GetFooterViewInfoClass.Create(Self); + FIndicatorViewInfo := GetIndicatorViewInfoClass.Create(Self); + inherited; + FilterViewInfo.Index := GetFilterViewInfoIndex; +end; + +procedure TcxGridTableViewInfo.DestroyViewInfos(AIsRecreating: Boolean); +begin + inherited; + FreeAndNil(FIndicatorViewInfo); + FreeAndNil(FFooterViewInfo); + FreeAndNil(FHeaderViewInfo); + FreeAndNil(FGroupByBoxViewInfo); +// inherited; +end; + +{var + max: integer;} + +procedure TcxGridTableViewInfo.Calculate; +(*var + ft,lt{,i}: Integer;*) +begin + //ft := gettickcount; + +//for I := 1 to 10 do + + try + RecreateViewInfos; + CalculateParts; + ClientBounds := CalculateClientBounds; + IndicatorViewInfo.Calculate(Bounds.Left, ClientBounds.Top - HeaderViewInfo.Height); + finally + inherited; + end; + +(*if CalculateDown then +begin + lt := gettickcount; + //if lt - ft > max then max := lt - ft; + //if TcxGridLevel(GridView.Level).IsTop then + application.MainForm.Caption := + //inttostr(max); + inttostr(lt - ft); +end;*) +end; + +function TcxGridTableViewInfo.CalculateClientBounds: TRect; +begin + Result := inherited CalculateClientBounds; + Inc(Result.Left, IndicatorViewInfo.Width); +end; + +function TcxGridTableViewInfo.CalculateDataWidth: Integer; +begin + Result := HeaderViewInfo.Width; + if (Result = 0) and GridView.OptionsView.ColumnAutoWidth then + Result := ClientWidth; +end; + +procedure TcxGridTableViewInfo.CalculateExpandButtonParams; +begin + FExpandButtonIndent := 3; + FLevelIndent := FExpandButtonIndent + ExpandButtonSize + FExpandButtonIndent; +end; + +procedure TcxGridTableViewInfo.CalculateHeight(const AMaxSize: TPoint; + var AHeight: Integer; var AFullyVisible: Boolean); +begin + MainCalculate(Classes.Bounds( + cxGridInvisibleCoordinate, 0, AMaxSize.X, AMaxSize.Y)); + if VisibleRecordCount = 0 then + AHeight := GetNonRecordsAreaHeight(False) + RecordsViewInfo.DataRowHeight + else + AHeight := RecordsViewInfo.Items[RecordsViewInfo.Count - 1].Bounds.Bottom + + PartsBottomHeight; + AFullyVisible := (VisibleRecordCount = 0) or + (VisibleRecordCount = ViewData.RowCount - FirstRecordIndex) and + Controller.IsDataFullyVisible(True); + inherited; +end; + +function TcxGridTableViewInfo.CalculatePartBounds(APart: TcxCustomGridPartViewInfo): TRect; +begin + Result := inherited CalculatePartBounds(APart); + if APart.IsScrollable then + OffsetRect(Result, -LeftPos, 0); +end; + +procedure TcxGridTableViewInfo.CalculateParts; +begin + GroupByBoxViewInfo.MainCalculate; + FilterViewInfo.MainCalculate; + HeaderViewInfo.MainCalculate; + FooterViewInfo.MainCalculate; +end; + +function TcxGridTableViewInfo.CalculateVisibleEqualHeightRecordCount: Integer; +begin + Result := (Bounds.Bottom - Bounds.Top - GetNonRecordsAreaHeight(False)) div + RecordsViewInfo.CommonDataRowHeight; +end; + +procedure TcxGridTableViewInfo.CalculateWidth(const AMaxSize: TPoint; var AWidth: Integer); +begin + if GridView.OptionsView.ColumnAutoWidth then + with Site.ClientBounds do + AWidth := Right - Left + else + AWidth := IndicatorViewInfo.Width + DataWidth; + inherited; +end; + +function TcxGridTableViewInfo.DoGetHitTest(const P: TPoint): TcxCustomGridHitTest; +begin + if PtInRect(Site.ClientBounds, P) then + begin + Result := IndicatorViewInfo.GetHitTest(P); + if Result <> nil then Exit; + end; + Result := inherited DoGetHitTest(P); +end; + +function TcxGridTableViewInfo.GetDefaultGridModeBufferCount: Integer; +begin + if RecordsViewInfo.DataRowHeight = 0 then + begin + Controller.PostGridModeBufferCountUpdate; + Result := 0; + end + else + Result := Screen.Height div RecordsViewInfo.DataRowHeight + 2; +end; + +function TcxGridTableViewInfo.GetFirstItemAdditionalWidth: Integer; +begin + Result := VisualLevelCount * LevelIndent; +end; + +function TcxGridTableViewInfo.GetGridLineWidth: Integer; +begin + Result := 1; +end; + +function TcxGridTableViewInfo.GetLevelSeparatorColor: TColor; +begin + Result := GridLineColor; +end; + +function TcxGridTableViewInfo.GetNonRecordsAreaHeight(ACheckScrollBar: Boolean): Integer; +begin + Result := inherited GetNonRecordsAreaHeight(ACheckScrollBar); + with RecordsViewInfo do + begin + if HasFilterRow then + Inc(Result, FilterRowViewInfo.Height); + if HasNewItemRow then + Inc(Result, NewItemRowViewInfo.Height); + end; +end; + +function TcxGridTableViewInfo.GetScrollableAreaBoundsHorz: TRect; +begin + Result := inherited GetScrollableAreaBoundsHorz; + Dec(Result.Top, HeaderViewInfo.Height); + Inc(Result.Bottom, FooterViewInfo.Height); +end; + +function TcxGridTableViewInfo.GetScrollableAreaBoundsVert: TRect; +begin + Result := inherited GetScrollableAreaBoundsVert; + Dec(Result.Left, IndicatorViewInfo.Width); + Result.Top := RecordsViewInfo.ContentBounds.Top; +end; + +function TcxGridTableViewInfo.GetVisualLevelCount: Integer; +begin + Result := GridView.GroupedColumnCount; + if (Result <> 0) and (GridView.OptionsView.GroupRowStyle = grsOffice11) then + Dec(Result); + if GridView.IsMaster then Inc(Result); +end; + +procedure TcxGridTableViewInfo.Offset(DX, DY: Integer); +var + I: Integer; +begin + for I := 0 to PartCount - 1 do + with Parts[I] do + if IsScrollable then DoOffset(DX, 0); + inherited; +end; + +procedure TcxGridTableViewInfo.RecreateViewInfos; +begin + FDataWidth := 0; + inherited; +end; + +function TcxGridTableViewInfo.SupportsAutoHeight: Boolean; +begin + Result := True; +end; + +function TcxGridTableViewInfo.SupportsGroupSummariesAlignedWithColumns: Boolean; +begin + Result := True; +end; + +function TcxGridTableViewInfo.SupportsMultipleFooterSummaries: Boolean; +begin + Result := True; +end; + +function TcxGridTableViewInfo.GetFooterPainterClass: TcxGridFooterPainterClass; +begin + Result := TcxGridFooterPainter; +end; + +function TcxGridTableViewInfo.GetFooterViewInfoClass: TcxGridFooterViewInfoClass; +begin + Result := TcxGridFooterViewInfo; +end; + +function TcxGridTableViewInfo.GetGroupByBoxViewInfoClass: TcxGridGroupByBoxViewInfoClass; +begin + Result := TcxGridGroupByBoxViewInfo; +end; + +function TcxGridTableViewInfo.GetHeaderViewInfoClass: TcxGridHeaderViewInfoClass; +begin + Result := TcxGridHeaderViewInfo; +end; + +function TcxGridTableViewInfo.GetIndicatorViewInfoClass: TcxGridIndicatorViewInfoClass; +begin + Result := TcxGridIndicatorViewInfo; +end; + +function TcxGridTableViewInfo.GetHeaderViewInfoSpecificClass: TcxGridHeaderViewInfoSpecificClass; +begin + Result := TcxGridHeaderViewInfoSpecific; +end; + +function TcxGridTableViewInfo.GetRecordsViewInfoClass: TcxCustomGridRecordsViewInfoClass; +begin + Result := TcxGridRowsViewInfo; +end; + +function TcxGridTableViewInfo.GetCellBorders(AIsRight, AIsBottom: Boolean): TcxBorders; +begin + case GridLines of + glBoth: + Result := [bRight, bBottom]; + glNone: + Result := []; + glVertical: + Result := [bRight]; + glHorizontal: + begin + if AIsRight then + Result := [bRight] + else + Result := []; + Include(Result, bBottom); + end; + end; +end; + +function TcxGridTableViewInfo.GetCellHeight(AIndex, ACellHeight: Integer): Integer; +begin + Result := ACellHeight; +end; + +function TcxGridTableViewInfo.GetCellTopOffset(AIndex, ACellHeight: Integer): Integer; +begin + Result := 0; +end; + +function TcxGridTableViewInfo.GetOffsetBounds(AItemsOffset: Integer; out AUpdateBounds: TRect): TRect; +begin + Result := ScrollableAreaBoundsVert; + AUpdateBounds := Result; + if AItemsOffset < 0 then + begin + Inc(Result.Top, -AItemsOffset); + with RecordsViewInfo do + if VisibleCount >= 2 then + Result.Bottom := Items[VisibleCount - 2].Bounds.Bottom; + AUpdateBounds.Top := Result.Bottom + AItemsOffset; + end + else + begin + Dec(Result.Bottom, AItemsOffset); + with RecordsViewInfo do + if PartVisibleCount >= 2 then + Result.Top := Items[1].Bounds.Top; + AUpdateBounds.Bottom := Result.Top + AItemsOffset; + end; +end; + +function TcxGridTableViewInfo.GetOffsetBounds(DX, DY: Integer; out AUpdateBounds: TRect): TRect; +begin + Result := ScrollableAreaBoundsHorz; + AUpdateBounds := Result; + if DX < 0 then + begin + Inc(Result.Left, -DX); + AUpdateBounds.Left := Max(AUpdateBounds.Left, AUpdateBounds.Right + DX); + end + else + begin + Dec(Result.Right, DX); + AUpdateBounds.Right := Min(AUpdateBounds.Left + DX, AUpdateBounds.Right); + end; +end; + +function TcxGridTableViewInfo.GetVisualLevel(ALevel: Integer): Integer; +begin + Result := ALevel; + if (Result <> 0) and (Result = GridView.GroupedColumnCount) and + (GridView.OptionsView.GroupRowStyle = grsOffice11) then + Dec(Result); +end; + +function TcxGridTableViewInfo.GetNearestPopupHeight(AHeight: Integer; + AAdditionalRecord: Boolean = False): Integer; +var + ARowCount: Integer; +begin + ARowCount := (AHeight - GetNonRecordsAreaHeight(True)) div RecordsViewInfo.DataRowHeight; + if ARowCount < 1 then ARowCount := 1; + if ARowCount > ViewData.RowCount + Ord(AAdditionalRecord) then + ARowCount := ViewData.RowCount + Ord(AAdditionalRecord); + Result := GetNonRecordsAreaHeight(True) + ARowCount * RecordsViewInfo.DataRowHeight; +end; + +function TcxGridTableViewInfo.GetPopupHeight(ADropDownRowCount: Integer): Integer; +begin + Result := GetNonRecordsAreaHeight(True) + ADropDownRowCount * RecordsViewInfo.DataRowHeight; +end; + +{ TcxGridTableViewInfoCacheItem } + +procedure TcxGridTableViewInfoCacheItem.SetPreviewHeight(Value: Integer); +begin + FPreviewHeight := Value; + IsPreviewHeightAssigned := True; +end; + +procedure TcxGridTableViewInfoCacheItem.UnassignValues(AKeepMaster: Boolean); +begin + inherited; + IsPreviewHeightAssigned := False; +end; + +{ TcxGridMasterTableViewInfoCacheItem } + +destructor TcxGridMasterTableViewInfoCacheItem.Destroy; +begin + if IsDetailsSiteCachedInfoAssigned then + FreeAndNil(DetailsSiteCachedInfo); + inherited; +end; + +function TcxGridMasterTableViewInfoCacheItem.GetGridRecord: TcxGridMasterDataRow; +begin + Result := TcxGridMasterDataRow(inherited GridRecord); +end; + +function TcxGridMasterTableViewInfoCacheItem.GetIsDetailsSiteCachedInfoAssigned: Boolean; +begin + Result := DetailsSiteCachedInfo <> nil; +end; + +procedure TcxGridMasterTableViewInfoCacheItem.SetDetailsSiteFullyVisible(Value: Boolean); +begin + FDetailsSiteFullyVisible := Value; + IsDetailsSiteFullyVisibleAssigned := True; +end; + +procedure TcxGridMasterTableViewInfoCacheItem.SetDetailsSiteHeight(Value: Integer); +begin + FDetailsSiteHeight := Value; + IsDetailsSiteHeightAssigned := True; +end; + +procedure TcxGridMasterTableViewInfoCacheItem.SetDetailsSiteNormalHeight(Value: Integer); +begin + FDetailsSiteNormalHeight := Value; + IsDetailsSiteNormalHeightAssigned := True; +end; + +procedure TcxGridMasterTableViewInfoCacheItem.SetDetailsSiteWidth(Value: Integer); +begin + FDetailsSiteWidth := Value; + IsDetailsSiteWidthAssigned := True; +end; + +procedure TcxGridMasterTableViewInfoCacheItem.UnassignValues(AKeepMaster: Boolean); +begin + if FUnassigningValues then Exit; + FUnassigningValues := True; + try + inherited; + IsDetailsSiteFullyVisibleAssigned := False; + IsDetailsSiteHeightAssigned := False; + IsDetailsSiteNormalHeightAssigned := False; + IsDetailsSiteWidthAssigned := False; + if GridRecord.InternalActiveDetailGridViewExists and + (GridRecord.InternalActiveDetailGridView.ViewInfoCache <> nil) then + GridRecord.InternalActiveDetailGridView.ViewInfoCache.UnassignValues(AKeepMaster); + finally + FUnassigningValues := False; + end; +end; + +{ TcxGridColumnOptions } + +constructor TcxGridColumnOptions.Create(AItem: TcxCustomGridTableItem); +begin + inherited; + FGroupFooters := True; + FHorzSizing := True; +end; + +function TcxGridColumnOptions.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +procedure TcxGridColumnOptions.SetCellMerging(Value: Boolean); +begin + if FCellMerging <> Value then + begin + FCellMerging := Value; + Changed; + end; +end; + +procedure TcxGridColumnOptions.SetGroupFooters(Value: Boolean); +begin + if FGroupFooters <> Value then + begin + FGroupFooters := Value; + Changed(ticSize); + end; +end; + +procedure TcxGridColumnOptions.SetHorzSizing(Value: Boolean); +begin + if FHorzSizing <> Value then + begin + FHorzSizing := Value; + Changed; + end; +end; + +procedure TcxGridColumnOptions.Assign(Source: TPersistent); +begin + if Source is TcxGridColumnOptions then + with TcxGridColumnOptions(Source) do + begin + Self.CellMerging := CellMerging; + Self.GroupFooters := GroupFooters; + Self.HorzSizing := HorzSizing; + end; + inherited; +end; + +{ TcxGridRowFooterCellPos } + +type + TcxGridRowFooterCellPos = class + public + Column: TcxGridColumn; + FooterGroupLevel: Integer; + Row: TcxCustomGridRow; + SummaryItem: TcxDataSummaryItem; + constructor Create(ARow: TcxCustomGridRow; AColumn: TcxGridColumn; + AFooterGroupLevel: Integer; ASummaryItem: TcxDataSummaryItem); + end; + +constructor TcxGridRowFooterCellPos.Create(ARow: TcxCustomGridRow; AColumn: TcxGridColumn; + AFooterGroupLevel: Integer; ASummaryItem: TcxDataSummaryItem); +begin + inherited Create; + Row := ARow; + Column := AColumn; + FooterGroupLevel := AFooterGroupLevel; + SummaryItem := ASummaryItem; +end; + +{ TcxGridGroupSummaryInfo } + +type + TcxGridGroupSummaryInfo = class + public + Row: TcxGridGroupRow; + SummaryItem: TcxDataSummaryItem; + constructor Create(ARow: TcxGridGroupRow; ASummaryItem: TcxDataSummaryItem); + end; + +constructor TcxGridGroupSummaryInfo.Create(ARow: TcxGridGroupRow; ASummaryItem: TcxDataSummaryItem); +begin + inherited Create; + Row := ARow; + SummaryItem := ASummaryItem; +end; + +{ TcxGridColumnStyles } + +function TcxGridColumnStyles.GetGridViewValue: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxGridColumnStyles.GetItem: TcxGridColumn; +begin + Result := TcxGridColumn(inherited Item); +end; + +procedure TcxGridColumnStyles.SetOnGetFooterStyle(Value: TcxGridGetCellStyleEvent); +begin + if @FOnGetFooterStyle <> @Value then + begin + FOnGetFooterStyle := Value; + Item.Changed(ticProperty); + end; +end; + +procedure TcxGridColumnStyles.SetOnGetFooterStyleEx(Value: TcxGridGetFooterStyleExEvent); +begin + if @FOnGetFooterStyleEx <> @Value then + begin + FOnGetFooterStyleEx := Value; + Item.Changed(ticProperty); + end; +end; + +procedure TcxGridColumnStyles.SetOnGetFooterSummaryStyle(Value: TcxGridGetFooterSummaryStyleEvent); +begin + if @FOnGetFooterSummaryStyle <> @Value then + begin + FOnGetFooterSummaryStyle := Value; + Item.Changed(ticProperty); + end; +end; + +procedure TcxGridColumnStyles.SetOnGetGroupSummaryStyle(Value: TcxGridGetGroupSummaryStyleEvent); +begin + if @FOnGetGroupSummaryStyle <> @Value then + begin + FOnGetGroupSummaryStyle := Value; + Item.Changed(ticProperty); + end; +end; + +procedure TcxGridColumnStyles.SetOnGetHeaderStyle(Value: TcxGridGetHeaderStyleEvent); +begin + if @FOnGetHeaderStyle <> @Value then + begin + FOnGetHeaderStyle := Value; + Item.Changed(ticProperty); + end; +end; + +procedure TcxGridColumnStyles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); +begin + case Index of + isFooter: + GridView.Styles.GetFooterParams(TcxGridRowFooterCellPos(AData).Row, Item, + TcxGridRowFooterCellPos(AData).FooterGroupLevel, + TcxGridRowFooterCellPos(AData).SummaryItem, AParams); + isGroupSummary: + GridView.Styles.GetGroupSummaryParams(TcxGridGroupSummaryInfo(AData).Row, + TcxGridGroupSummaryInfo(AData).SummaryItem, AParams); + isHeader: + GridView.Styles.GetHeaderParams(Item, AParams); + else + inherited; + end; +end; + +procedure TcxGridColumnStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridColumnStyles then + with TcxGridColumnStyles(Source) do + begin + Self.Footer := Footer; + Self.GroupSummary := GroupSummary; + Self.Header := Header; + Self.OnGetFooterStyle := OnGetFooterStyle; + Self.OnGetFooterStyleEx := OnGetFooterStyleEx; + Self.OnGetFooterSummaryStyle := OnGetFooterSummaryStyle; + Self.OnGetGroupSummaryStyle := OnGetGroupSummaryStyle; + Self.OnGetHeaderStyle := OnGetHeaderStyle; + end; +end; + +procedure TcxGridColumnStyles.GetFooterParams(ARow: TcxCustomGridRow; + AFooterGroupLevel: Integer; ASummaryItem: TcxDataSummaryItem; out AParams: TcxViewParams); +var + AStyle: TcxStyle; + ARowFooterCellPos: TcxGridRowFooterCellPos; +begin + AStyle := nil; + if Assigned(FOnGetFooterStyle) then + FOnGetFooterStyle(GridView, ARow, Item, AStyle); + if Assigned(FOnGetFooterStyleEx) then + FOnGetFooterStyleEx(GridView, ARow, Item, AFooterGroupLevel, AStyle); + if Assigned(FOnGetFooterSummaryStyle) and (ASummaryItem <> nil) then + FOnGetFooterSummaryStyle(GridView, ARow, Item, AFooterGroupLevel, ASummaryItem, AStyle); + ARowFooterCellPos := TcxGridRowFooterCellPos.Create(ARow, Item, AFooterGroupLevel, ASummaryItem); + try + GetViewParams(isFooter, ARowFooterCellPos, AStyle, AParams); + finally + ARowFooterCellPos.Free; + end; +end; + +procedure TcxGridColumnStyles.GetGroupSummaryParams(ARow: TcxGridGroupRow; + ASummaryItem: TcxDataSummaryItem; out AParams: TcxViewParams); +var + AStyle: TcxStyle; + ASummaryInfo: TcxGridGroupSummaryInfo; +begin + AStyle := nil; + if (ARow <> nil) and Assigned(FOnGetGroupSummaryStyle) then + FOnGetGroupSummaryStyle(GridView, ARow, Item, ASummaryItem, AStyle); + ASummaryInfo := TcxGridGroupSummaryInfo.Create(ARow, ASummaryItem); + try + GetViewParams(isGroupSummary, ASummaryInfo, AStyle, AParams); + finally + ASummaryInfo.Free; + end; +end; + +procedure TcxGridColumnStyles.GetHeaderParams(out AParams: TcxViewParams); +var + AStyle: TcxStyle; +begin + AStyle := nil; + if Assigned(FOnGetHeaderStyle) then + FOnGetHeaderStyle(GridView, Item, AStyle); + GetViewParams(isHeader, nil, AStyle, AParams); +end; + +{ TcxGridColumnSummary } + +function TcxGridColumnSummary.GetDataController: TcxCustomDataController; +begin + Result := TcxGridTableView(GridView).FDataController; +end; + +function TcxGridColumnSummary.GetFormat(Index: TcxGridSummariesIndex): string; +begin + Result := GetSummaryItems(Index).GetDataItemFormat(Item.Index, GetSummaryItemsPosition(Index)); +end; + +function TcxGridColumnSummary.GetKind(Index: TcxGridSummariesIndex): TcxSummaryKind; +begin + Result := GetSummaryItems(Index).GetDataItemKind(Item.Index, GetSummaryItemsPosition(Index)); +end; + +function TcxGridColumnSummary.GetSortByGroupFooterSummary: Boolean; +begin + Result := GetSummaryItems(siGroup).GetDataItemSorted(Item.Index, spFooter); +end; + +function TcxGridColumnSummary.GetSortByGroupSummary: Boolean; +begin + Result := GetSummaryItems(siGroup).GetDataItemSorted(Item.Index, spGroup); +end; + +procedure TcxGridColumnSummary.SetFormat(Index: TcxGridSummariesIndex; const Value: string); +begin + GetSummaryItems(Index).SetDataItemFormat(Item.Index, GetSummaryItemsPosition(Index), Value); +end; + +procedure TcxGridColumnSummary.SetKind(Index: TcxGridSummariesIndex; Value: TcxSummaryKind); +begin + GetSummaryItems(Index).SetDataItemKind(Item.Index, GetSummaryItemsPosition(Index), Value); +end; + +procedure TcxGridColumnSummary.SetSortByGroupFooterSummary(Value: Boolean); +begin + GetSummaryItems(siGroup).SetDataItemSorted(Item.Index, spFooter, Value); +end; + +procedure TcxGridColumnSummary.SetSortByGroupSummary(Value: Boolean); +begin + GetSummaryItems(siGroup).SetDataItemSorted(Item.Index, spGroup, Value); +end; + +function TcxGridColumnSummary.GetSummaryItems(AIndex: TcxGridSummariesIndex): TcxDataSummaryItems; +begin + with DataController.Summary do + if AIndex = siFooter then + Result := FooterSummaryItems + else + Result := DefaultGroupSummaryItems; +end; + +function TcxGridColumnSummary.GetSummaryItemsPosition(AIndex: TcxGridSummariesIndex): TcxSummaryPosition; +begin + if AIndex = siGroup then + Result := spGroup + else + Result := spFooter; +end; + +procedure TcxGridColumnSummary.Assign(Source: TPersistent); +begin + if Source is TcxGridColumnSummary then + with TcxGridColumnSummary(Source) do + begin + Self.FooterFormat := FooterFormat; + Self.FooterKind := FooterKind; + Self.GroupFooterFormat := GroupFooterFormat; + Self.GroupFooterKind := GroupFooterKind; + Self.GroupFormat := GroupFormat; + Self.GroupKind := GroupKind; + Self.SortByGroupFooterSummary := SortByGroupFooterSummary; + Self.SortByGroupSummary := SortByGroupSummary; + end; + inherited; +end; + +{ TcxGridColumn } + +constructor TcxGridColumn.Create(AOwner: TComponent); +begin + inherited; + FHeaderGlyphAlignmentVert := vaCenter; +end; + +destructor TcxGridColumn.Destroy; +begin + Selected := False; + IsPreview := False; + inherited; +end; + +function TcxGridColumn.GetController: TcxGridTableController; +begin + Result := TcxGridTableController(inherited Controller); +end; + +function TcxGridColumn.GetFooterAlignmentHorz: TAlignment; +begin + if FIsFooterAlignmentHorzAssigned then + Result := FFooterAlignmentHorz + else + Result := GetDefaultValuesProvider.DefaultAlignment; +end; + +function TcxGridColumn.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxGridColumn.GetGroupSummaryAlignment: TAlignment; +begin + if FIsGroupSummaryAlignmentAssigned then + Result := FGroupSummaryAlignment + else + Result := GetDefaultValuesProvider.DefaultAlignment; +end; + +function TcxGridColumn.GetIsPreview: Boolean; +begin + Result := GridView.Preview.Column = Self; +end; + +function TcxGridColumn.GetOptions: TcxGridColumnOptions; +begin + Result := TcxGridColumnOptions(inherited Options); +end; + +function TcxGridColumn.GetStyles: TcxGridColumnStyles; +begin + Result := TcxGridColumnStyles(inherited Styles); +end; + +function TcxGridColumn.GetViewData: TcxGridViewData; +begin + Result := TcxGridViewData(inherited ViewData); +end; + +procedure TcxGridColumn.SetFooterAlignmentHorz(Value: TAlignment); +begin + if (FooterAlignmentHorz <> Value) or IsLoading then + begin + FFooterAlignmentHorz := Value; + FIsFooterAlignmentHorzAssigned := True; + Changed(ticLayout); + end; +end; + +procedure TcxGridColumn.SetGroupSummaryAlignment(Value: TAlignment); +begin + if (GroupSummaryAlignment <> Value) or IsLoading then + begin + FGroupSummaryAlignment := Value; + FIsGroupSummaryAlignmentAssigned := True; + Changed(ticLayout); + end; +end; + +procedure TcxGridColumn.SetHeaderGlyph(Value: TBitmap); +begin + FHeaderGlyph.Assign(Value); +end; + +procedure TcxGridColumn.SetHeaderGlyphAlignmentHorz(Value: TAlignment); +begin + if FHeaderGlyphAlignmentHorz <> Value then + begin + FHeaderGlyphAlignmentHorz := Value; + Changed(ticLayout); + end; +end; + +procedure TcxGridColumn.SetHeaderGlyphAlignmentVert(Value: TcxAlignmentVert); +begin + if FHeaderGlyphAlignmentVert <> Value then + begin + FHeaderGlyphAlignmentVert := Value; + Changed(ticLayout); + end; +end; + +procedure TcxGridColumn.SetIsPreview(Value: Boolean); +begin + if IsPreview <> Value then + if Value then + GridView.Preview.Column := Self + else + GridView.Preview.Column := nil; +end; + +procedure TcxGridColumn.SetOnCompareRowValuesForCellMerging(Value: TcxGridColumnCompareRowValuesEvent); +begin + if @FOnCompareRowValuesForCellMerging <> @Value then + begin + FOnCompareRowValuesForCellMerging := Value; + Changed(ticProperty); + end; +end; + +procedure TcxGridColumn.SetOnCompareValuesForCellMerging(Value: TcxGridColumnCompareValuesEvent); +begin + if @FOnCompareValuesForCellMerging <> @Value then + begin + FOnCompareValuesForCellMerging := Value; + Changed(ticProperty); + end; +end; + +procedure TcxGridColumn.SetOnCustomDrawFooterCell(Value: TcxGridColumnCustomDrawHeaderEvent); +begin + if @FOnCustomDrawFooterCell <> @Value then + begin + FOnCustomDrawFooterCell := Value; + Changed(ticProperty); + end; +end; + +procedure TcxGridColumn.SetOnCustomDrawGroupSummaryCell(Value: TcxGridGroupSummaryCellCustomDrawEvent); +begin + if @FOnCustomDrawGroupSummaryCell <> @Value then + begin + FOnCustomDrawGroupSummaryCell := Value; + Changed(ticProperty); + end; +end; + +procedure TcxGridColumn.SetOnCustomDrawHeader(Value: TcxGridColumnCustomDrawHeaderEvent); +begin + if @FOnCustomDrawHeader <> @Value then + begin + FOnCustomDrawHeader := Value; + Changed(ticProperty); + end; +end; + +procedure TcxGridColumn.SetOnHeaderClick(Value: TNotifyEvent); +begin + if @FOnHeaderClick <> @Value then + begin + FOnHeaderClick := Value; + Changed(ticProperty); + end; +end; + +procedure TcxGridColumn.SetOptions(Value: TcxGridColumnOptions); +begin + inherited Options := Value; +end; + +procedure TcxGridColumn.SetSelected(Value: Boolean); +begin + if FSelected <> Value then + if Value then + Controller.AddSelectedColumn(Self) + else + Controller.RemoveSelectedColumn(Self); +end; + +procedure TcxGridColumn.SetStyles(Value: TcxGridColumnStyles); +begin + inherited Styles := Value; +end; + +procedure TcxGridColumn.SetSummary(Value: TcxGridColumnSummary); +begin + FSummary.Assign(Value); +end; + +function TcxGridColumn.IsFooterAlignmentHorzStored: Boolean; +begin + Result := FIsFooterAlignmentHorzAssigned and + (FFooterAlignmentHorz <> GetDefaultValuesProvider.DefaultAlignment); +end; + +function TcxGridColumn.IsGroupSummaryAlignmentStored: Boolean; +begin + Result := FIsGroupSummaryAlignmentAssigned and + (FGroupSummaryAlignment <> GetDefaultValuesProvider.DefaultAlignment); +end; + +procedure TcxGridColumn.HeaderGlyphChanged(Sender: TObject); +begin + Changed(ticLayout); +end; + +function TcxGridColumn.GetStoredProperties(AProperties: TStrings): Boolean; +begin + with AProperties do + begin + Add('GroupIndex'); + Add('Width'); + end; + Result := inherited GetStoredProperties(AProperties); +end; + +procedure TcxGridColumn.GetPropertyValue(const AName: string; var AValue: Variant); +begin + if AName = 'Width' then + AValue := Width + else + if AName = 'GroupIndex' then + AValue := GroupIndex + else + inherited; +end; + +procedure TcxGridColumn.SetPropertyValue(const AName: string; const AValue: Variant); +begin + if AName = 'Width' then + Width := AValue + else + if AName = 'GroupIndex' then + GroupIndex := AValue + else + inherited; +end; + +procedure TcxGridColumn.CreateSubClasses; +begin + inherited; + FHeaderGlyph := TBitmap.Create; + FHeaderGlyph.OnChange := HeaderGlyphChanged; + FSummary := GetSummaryClass.Create(Self); +end; + +procedure TcxGridColumn.DestroySubClasses; +begin + FreeAndNil(FSummary); + FreeAndNil(FHeaderGlyph); + inherited; +end; + +function TcxGridColumn.GetOptionsClass: TcxCustomGridTableItemOptionsClass; +begin + Result := TcxGridColumnOptions; +end; + +function TcxGridColumn.GetStylesClass: TcxCustomGridTableItemStylesClass; +begin + Result := TcxGridColumnStyles; +end; + +function TcxGridColumn.GetSummaryClass: TcxGridColumnSummaryClass; +begin + Result := TcxGridColumnSummary; +end; + +procedure TcxGridColumn.AssignColumnWidths; +begin + with GridView do + if OptionsView.ColumnAutoWidth then + ViewInfo.HeaderViewInfo.AssignColumnWidths; +end; + +procedure TcxGridColumn.BestFitApplied(AFireEvents: Boolean); +begin + inherited; + if AFireEvents then + GridView.DoColumnSizeChanged(Self); +end; + +function TcxGridColumn.CalculateBestFitWidth: Integer; +var + ABorders: TcxBorders; +begin + Result := inherited CalculateBestFitWidth; + ABorders := GridView.ViewInfo.GetCellBorders(IsMostRight, False); + Inc(Result, (Ord(bLeft in ABorders) + Ord(bRight in ABorders)) * GridView.ViewInfo.GridLineWidth); + if (VisibleIndex <> -1) and GridView.Visible then + begin + if GridView.OptionsView.Header then + Result := Max(Result, GridView.ViewInfo.HeaderViewInfo[VisibleIndex].GetBestFitWidth); + if GridView.OptionsView.Footer then + Result := Max(Result, GridView.ViewInfo.FooterViewInfo.GetCellBestFitWidth(Self)); + Result := Max(Result, GridView.ViewInfo.RecordsViewInfo.GetFooterCellBestFitWidth(Self)); + end; +end; + +function TcxGridColumn.CanCellMerging: Boolean; +begin + Result := Options.CellMerging and GridView.CanCellMerging; +end; + +function TcxGridColumn.CanEdit: Boolean; +begin + if Controller.IsFilterRowFocused then + Result := CanFocus(Controller.FocusedRecord) and (FocusedCellViewInfo <> nil) + else + Result := inherited CanEdit and not CanCellMerging; +end; + +function TcxGridColumn.CanFocus(ARecord: TcxCustomGridRecord): Boolean; +begin + if ViewData.HasFilterRow and (ARecord = ViewData.FilterRow) then + Result := ActuallyVisible and CanFilter(False) + else + Result := inherited CanFocus(ARecord); +end; + +function TcxGridColumn.CanHorzSize: Boolean; +begin + Result := inherited CanHorzSize and GridView.OptionsCustomize.ColumnHorzSizing; +end; + +function TcxGridColumn.CanShowGroupFooters: Boolean; +begin + Result := Options.GroupFooters; +end; + +procedure TcxGridColumn.ForceWidth(Value: Integer); +begin + AssignColumnWidths; + inherited; + AssignColumnWidths; + Changed(ticSize); +end; + +function TcxGridColumn.GetEditValue: Variant; +begin + if Controller.IsFilterRowFocused then + begin + Result := ViewData.FilterRow.Values[Index]; + if (GridView.FilterRow.ApplyChanges = fracImmediately) and + SupportsBeginsWithFilterOperator(ViewData.FilterRow) then + Controller.RemoveBeginsWithMask(Result); + end + else + Result := inherited GetEditValue; +end; + +procedure TcxGridColumn.SetEditValue(const Value: Variant); +var + AValue: Variant; +begin + if Controller.IsFilterRowFocused then + begin + AValue := Value; + if (GridView.FilterRow.ApplyChanges = fracImmediately) and + SupportsBeginsWithFilterOperator(ViewData.FilterRow) then + Controller.AddBeginsWithMask(AValue); + ViewData.FilterRow.Values[Index] := AValue; + if not Controller.EditingController.ApplyingImmediateFiltering then + GridView.Filtering.AddFilterToMRUItems; + end + else + inherited SetEditValue(Value); +end; + +function TcxGridColumn.GetFixed: Boolean; +begin + Result := inherited GetFixed or + (Controller.ForcingWidthItem <> nil) and + Controller.IsColumnFixedDuringHorzSizing(Self); +end; + +function TcxGridColumn.GetIsBottom: Boolean; +begin + Result := True; +end; + +function TcxGridColumn.GetIsLeft: Boolean; +begin + Result := IsFirst; +end; + +function TcxGridColumn.GetIsMostBottom: Boolean; +begin + Result := IsBottom; +end; + +function TcxGridColumn.GetIsMostLeft: Boolean; +begin + Result := IsLeft; +end; + +function TcxGridColumn.GetIsMostRight: Boolean; +begin + Result := IsRight; +end; + +function TcxGridColumn.GetIsRight: Boolean; +begin + Result := IsLast; +end; + +function TcxGridColumn.GetIsTop: Boolean; +begin + Result := True; +end; + +function TcxGridColumn.GetVisible: Boolean; +begin + Result := inherited GetVisible and not IsPreview; +end; + +function TcxGridColumn.GetVisibleForCustomization: Boolean; +begin + Result := inherited GetVisibleForCustomization and not IsPreview; +end; + +function TcxGridColumn.HasFixedWidth: Boolean; +begin + Result := not Options.HorzSizing; +end; + +function TcxGridColumn.HideOnGrouping: Boolean; +begin + Result := GridView.OptionsCustomize.ColumnHidingOnGrouping; +end; + +function TcxGridColumn.IsVisibleStored: Boolean; +begin + Result := inherited IsVisibleStored and not IsPreview; +end; + +function TcxGridColumn.IsVisibleForCustomizationStored: Boolean; +begin + Result := inherited IsVisibleForCustomizationStored and not IsPreview; +end; + +function TcxGridColumn.SupportsBeginsWithFilterOperator(ARow: TcxCustomGridRow): Boolean; +var + AProperties: TcxCustomEditProperties; + AFilterHelper: TcxCustomFilterEditHelperClass; +begin + if ARow = nil then + AProperties := GetProperties + else + AProperties := GetProperties(ARow); + AFilterHelper := FilterEditsController.FindHelper(AProperties.ClassType); + Result := (AFilterHelper <> nil) and + (fcoLike in AFilterHelper.GetSupportedFilterOperators(AProperties, DataBinding.ValueTypeClass)); +end; + +{procedure TcxGridColumn.VisibleChanged; +begin + //FGridView.RefreshVisibleColumnsList; + //FGridView.RefreshCustomizationForm; +end;} + +function TcxGridColumn.GetHeaderViewInfoClass: TcxGridColumnHeaderViewInfoClass; +begin + Result := TcxGridColumnHeaderViewInfo; +end; + +procedure TcxGridColumn.DoCustomDrawFooterCell(ACanvas: TcxCanvas; + AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean); +begin + if HasCustomDrawFooterCell then + FOnCustomDrawFooterCell(GridView, ACanvas, AViewInfo, ADone); +end; + +procedure TcxGridColumn.DoCustomDrawGroupSummaryCell(ACanvas: TcxCanvas; + AViewInfo: TcxCustomGridViewCellViewInfo; var ADone: Boolean); +var + ACell: TcxGridGroupSummaryCellViewInfo; +begin + if HasCustomDrawGroupSummaryCell then + begin + ACell := TcxGridGroupSummaryCellViewInfo(AViewInfo); + FOnCustomDrawGroupSummaryCell(Self, ACanvas, ACell.RowViewInfo.GridRecord, + Self, ACell.SummaryItem, AViewInfo, ADone); + end; +end; + +procedure TcxGridColumn.DoCustomDrawHeader(ACanvas: TcxCanvas; + AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean); +begin + if HasCustomDrawHeader then + FOnCustomDrawHeader(GridView, ACanvas, AViewInfo, ADone); +end; + +procedure TcxGridColumn.DoHeaderClick; +begin + if Assigned(FOnHeaderClick) then FOnHeaderClick(Self); + GridView.DoColumnHeaderClick(Self); +end; + +function TcxGridColumn.HasCustomDrawFooterCell: Boolean; +begin + Result := Assigned(FOnCustomDrawFooterCell); +end; + +function TcxGridColumn.HasCustomDrawGroupSummaryCell: Boolean; +begin + Result := Assigned(FOnCustomDrawGroupSummaryCell); +end; + +function TcxGridColumn.HasCustomDrawHeader: Boolean; +begin + Result := Assigned(FOnCustomDrawHeader); +end; + +procedure TcxGridColumn.Assign(Source: TPersistent); +begin + if Source is TcxGridColumn then + with TcxGridColumn(Source) do + begin + Self.FooterAlignmentHorz := FooterAlignmentHorz; + Self.GroupSummaryAlignment := GroupSummaryAlignment; + Self.HeaderGlyph := HeaderGlyph; + Self.HeaderGlyphAlignmentHorz := HeaderGlyphAlignmentHorz; + Self.HeaderGlyphAlignmentVert := HeaderGlyphAlignmentVert; + Self.Summary := Summary; + Self.OnCompareRowValuesForCellMerging := OnCompareRowValuesForCellMerging; + Self.OnCompareValuesForCellMerging := OnCompareValuesForCellMerging; + Self.OnCustomDrawFooterCell := OnCustomDrawFooterCell; + Self.OnCustomDrawGroupSummaryCell := OnCustomDrawGroupSummaryCell; + Self.OnCustomDrawHeader := OnCustomDrawHeader; + Self.OnHeaderClick := OnHeaderClick; + end; + inherited; +end; + +function TcxGridColumn.DoCompareValuesForCellMerging( + ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: TcxEditValue; + ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: TcxEditValue): Boolean; +begin + Result := (AProperties1 = AProperties2) and AProperties1.CompareDisplayValues(AValue1, AValue2); + if Assigned(FOnCompareValuesForCellMerging) then + FOnCompareValuesForCellMerging(Self, AProperties1, AValue1, AProperties2, AValue2, Result); + if Assigned(FOnCompareRowValuesForCellMerging) then + FOnCompareRowValuesForCellMerging(Self, ARow1, AProperties1, AValue1, + ARow2, AProperties2, AValue2, Result); +end; + +procedure TcxGridColumn.FocusWithSelection; +begin + if not Focused then + begin + GridView.BeginUpdate; + try + Controller.ClearCellSelection; + Selected := True; + Controller.CellSelectionAnchor := Self; + finally + GridView.EndUpdate; + end; + end; + inherited; +end; + +function TcxGridColumn.GroupBy(AGroupIndex: Integer; ACanShow: Boolean = True): Boolean; +begin + Result := CanGroup; + if not Result then Exit; + GroupIndex := AGroupIndex; + if AGroupIndex = -1 then + if ACanShow and ShowOnUngrouping and WasVisibleBeforeGrouping then + Visible := True + else + else + if HideOnGrouping and CanHide then + Visible := False; +end; + +{ TcxGridTableBackgroundBitmaps } + +function TcxGridTableBackgroundBitmaps.GetBitmapStyleIndex(Index: Integer): Integer; +begin + case Index of + bbFooter: + Result := vsFooter; + bbHeader: + Result := vsHeader; + bbGroup: + Result := vsGroup; + bbGroupByBox: + Result := vsGroupByBox; + bbIndicator: + Result := vsIndicator; + bbPreview: + Result := vsPreview; + else + Result := inherited GetBitmapStyleIndex(Index); + end; +end; + +procedure TcxGridTableBackgroundBitmaps.Assign(Source: TPersistent); +begin + if Source is TcxGridTableBackgroundBitmaps then + with TcxGridTableBackgroundBitmaps(Source) do + begin + Self.Footer := Footer; + Self.Header := Header; + Self.Group := Group; + Self.GroupByBox := GroupByBox; + Self.Indicator := Indicator; + Self.Preview := Preview; + end; + inherited; +end; + +{ TcxGridTableOptionsBehavior } + +constructor TcxGridTableOptionsBehavior.Create(AGridView: TcxCustomGridView); +begin + inherited; + FColumnHeaderHints := True; + FCopyPreviewToClipboard := True; + FExpandMasterRowOnDblClick := True; +end; + +procedure TcxGridTableOptionsBehavior.SetColumnHeaderHints(Value: Boolean); +begin + if FColumnHeaderHints <> Value then + begin + FColumnHeaderHints := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridTableOptionsBehavior.SetCopyPreviewToClipboard(Value: Boolean); +begin + if FCopyPreviewToClipboard <> Value then + begin + FCopyPreviewToClipboard := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridTableOptionsBehavior.SetExpandMasterRowOnDblClick(Value: Boolean); +begin + if FExpandMasterRowOnDblClick <> Value then + begin + FExpandMasterRowOnDblClick := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridTableOptionsBehavior.Assign(Source: TPersistent); +begin + if Source is TcxGridTableOptionsBehavior then + with TcxGridTableOptionsBehavior(Source) do + begin + Self.ColumnHeaderHints := ColumnHeaderHints; + Self.CopyPreviewToClipboard := CopyPreviewToClipboard; + Self.ExpandMasterRowOnDblClick := ExpandMasterRowOnDblClick; + end; + inherited; +end; + +{ TcxGridTableFiltering } + +function TcxGridTableFiltering.GetColumnFilteredItemsList: Boolean; +begin + Result := ItemFilteredItemsList; +end; + +function TcxGridTableFiltering.GetColumnMRUItemsList: Boolean; +begin + Result := ItemMRUItemsList; +end; + +function TcxGridTableFiltering.GetColumnMRUItemsListCount: Integer; +begin + Result := ItemMRUItemsListCount; +end; + +function TcxGridTableFiltering.GetColumnPopup: TcxGridItemFilterPopupOptions; +begin + Result := ItemPopup; +end; + +procedure TcxGridTableFiltering.SetColumnFilteredItemsList(Value: Boolean); +begin + ItemFilteredItemsList := Value; +end; + +procedure TcxGridTableFiltering.SetColumnMRUItemsList(Value: Boolean); +begin + ItemMRUItemsList := Value; +end; + +procedure TcxGridTableFiltering.SetColumnMRUItemsListCount(Value: Integer); +begin + ItemMRUItemsListCount := Value; +end; + +procedure TcxGridTableFiltering.SetColumnPopup(Value: TcxGridItemFilterPopupOptions); +begin + ItemPopup := Value; +end; + +procedure TcxGridTableFiltering.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('ColumnPopupDropDownWidth', ReadItemPopupDropDownWidth, nil, True); + Filer.DefineProperty('ColumnPopupMaxDropDownItemCount', ReadItemPopupMaxDropDownCount, nil, True); +end; + +{ TcxGridTableOptionsCustomize } + +constructor TcxGridTableOptionsCustomize.Create(AGridView: TcxCustomGridView); +begin + inherited; + FColumnHidingOnGrouping := True; + FColumnHorzSizing := True; +end; + +function TcxGridTableOptionsCustomize.GetColumnFiltering: Boolean; +begin + Result := ItemFiltering; +end; + +function TcxGridTableOptionsCustomize.GetColumnGrouping: Boolean; +begin + Result := ItemGrouping; +end; + +function TcxGridTableOptionsCustomize.GetColumnHiding: Boolean; +begin + Result := ItemHiding; +end; + +function TcxGridTableOptionsCustomize.GetColumnMoving: Boolean; +begin + Result := ItemMoving; +end; + +function TcxGridTableOptionsCustomize.GetColumnSorting: Boolean; +begin + Result := ItemSorting; +end; + +function TcxGridTableOptionsCustomize.GetColumnsQuickCustomization: Boolean; +begin + Result := ItemsQuickCustomization; +end; + +function TcxGridTableOptionsCustomize.GetColumnsQuickCustomizationMaxDropDownCount: Integer; +begin + Result := ItemsQuickCustomizationMaxDropDownCount; +end; + +function TcxGridTableOptionsCustomize.GetColumnsQuickCustomizationReordering: TcxGridQuickCustomizationReordering; +begin + Result := ItemsQuickCustomizationReordering; +end; + +function TcxGridTableOptionsCustomize.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +procedure TcxGridTableOptionsCustomize.SetColumnFiltering(Value: Boolean); +begin + ItemFiltering := Value; +end; + +procedure TcxGridTableOptionsCustomize.SetColumnGrouping(Value: Boolean); +begin + ItemGrouping := Value; +end; + +procedure TcxGridTableOptionsCustomize.SetColumnHiding(Value: Boolean); +begin + ItemHiding := Value; +end; + +procedure TcxGridTableOptionsCustomize.SetColumnHidingOnGrouping(Value: Boolean); +begin + if FColumnHidingOnGrouping <> Value then + begin + FColumnHidingOnGrouping := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridTableOptionsCustomize.SetColumnHorzSizing(Value: Boolean); +begin + if FColumnHorzSizing <> Value then + begin + FColumnHorzSizing := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridTableOptionsCustomize.SetColumnMoving(Value: Boolean); +begin + ItemMoving := Value; +end; + +procedure TcxGridTableOptionsCustomize.SetColumnSorting(Value: Boolean); +begin + ItemSorting := Value; +end; + +procedure TcxGridTableOptionsCustomize.SetColumnsQuickCustomization(Value: Boolean); +begin + ItemsQuickCustomization := Value; +end; + +procedure TcxGridTableOptionsCustomize.SetColumnsQuickCustomizationMaxDropDownCount(Value: Integer); +begin + ItemsQuickCustomizationMaxDropDownCount := Value; +end; + +procedure TcxGridTableOptionsCustomize.SetColumnsQuickCustomizationReordering(Value: TcxGridQuickCustomizationReordering); +begin + ItemsQuickCustomizationReordering := Value; +end; + +procedure TcxGridTableOptionsCustomize.SetDataRowSizing(Value: Boolean); +begin + if FDataRowSizing <> Value then + begin + FDataRowSizing := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridTableOptionsCustomize.SetGroupBySorting(Value: Boolean); +begin + if FGroupBySorting <> Value then + begin + FGroupBySorting := Value; + GridView.BeginUpdate; + try + GridView.Controller.ClearGrouping; + GridView.FDataController.ClearSorting(False); + Changed(vcProperty); + finally + GridView.EndUpdate; + end; + end; +end; + +procedure TcxGridTableOptionsCustomize.SetGroupRowSizing(Value: Boolean); +begin + if FGroupRowSizing <> Value then + begin + FGroupRowSizing := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridTableOptionsCustomize.Assign(Source: TPersistent); +begin + if Source is TcxGridTableOptionsCustomize then + with TcxGridTableOptionsCustomize(Source) do + begin + Self.ColumnHidingOnGrouping := ColumnHidingOnGrouping; + Self.ColumnHorzSizing := ColumnHorzSizing; + Self.DataRowSizing := DataRowSizing; + Self.GroupBySorting := GroupBySorting; + Self.GroupRowSizing := GroupRowSizing; + end; + inherited; +end; + +{ TcxGridTableOptionsSelection } + +procedure TcxGridTableOptionsSelection.SetCellMultiSelect(Value: Boolean); +begin + if FCellMultiSelect <> Value then + begin + FCellMultiSelect := Value; + CellSelect := True; + InvertSelect := not Value; + MultiSelect := Value; + Changed(vcProperty); + end; +end; + +function TcxGridTableOptionsSelection.IsCellSelectStored: Boolean; +begin + Result := not FCellMultiSelect; +end; + +function TcxGridTableOptionsSelection.IsInvertSelectStored: Boolean; +begin + Result := not FCellMultiSelect and inherited IsInvertSelectStored; +end; + +function TcxGridTableOptionsSelection.IsMultiSelectStored: Boolean; +begin + Result := not FCellMultiSelect and inherited IsMultiSelectStored; +end; + +procedure TcxGridTableOptionsSelection.SetCellSelect(Value: Boolean); +begin + if not FCellMultiSelect or Value then + inherited; +end; + +procedure TcxGridTableOptionsSelection.SetInvertSelect(Value: Boolean); +begin + if not FCellMultiSelect or not Value then + inherited; +end; + +procedure TcxGridTableOptionsSelection.SetMultiSelect(Value: Boolean); +begin + if not FCellMultiSelect or Value then + inherited; +end; + +procedure TcxGridTableOptionsSelection.Assign(Source: TPersistent); +begin + if Source is TcxGridTableOptionsSelection then + with TcxGridTableOptionsSelection(Source) do + Self.CellMultiSelect := CellMultiSelect; + inherited; +end; + +{ TcxGridSpecialRowOptions } + +constructor TcxGridSpecialRowOptions.Create(AGridView: TcxCustomGridView); +begin + inherited; + FInfoText := DefaultInfoText; + FSeparatorColor := clDefault; + FSeparatorWidth := cxGridCustomRowSeparatorDefaultWidth; +end; + +function TcxGridSpecialRowOptions.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +procedure TcxGridSpecialRowOptions.SetInfoText(const Value: string); +begin + if FInfoText <> Value then + begin + FInfoText := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridSpecialRowOptions.SetSeparatorColor(Value: TColor); +begin + if FSeparatorColor <> Value then + begin + FSeparatorColor := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridSpecialRowOptions.SetSeparatorWidth(Value: Integer); +begin + if Value < cxGridCustomRowSeparatorMinWidth then + Value := cxGridCustomRowSeparatorMinWidth; + if FSeparatorWidth <> Value then + begin + FSeparatorWidth := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridSpecialRowOptions.SetVisible(Value: Boolean); +begin + if FVisible <> Value then + begin + FVisible := Value; + VisibleChanged; + end; +end; + +function TcxGridSpecialRowOptions.IsInfoTextStored: Boolean; +begin + Result := InfoText <> DefaultInfoText; +end; + +function TcxGridSpecialRowOptions.DefaultSeparatorColor: TColor; +begin + Result := LookAndFeelPainter.DefaultHeaderColor; +end; + +procedure TcxGridSpecialRowOptions.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridSpecialRowOptions then + with TcxGridSpecialRowOptions(Source) do + begin + Self.InfoText := InfoText; + Self.SeparatorColor := SeparatorColor; + Self.SeparatorWidth := SeparatorWidth; + Self.Visible := Visible; + end; +end; + +function TcxGridSpecialRowOptions.GetSeparatorColor: TColor; +begin + Result := FSeparatorColor; + if Result = clDefault then + Result := DefaultSeparatorColor; +end; + +{ TcxGridFilterRowOptions } + +procedure TcxGridFilterRowOptions.SetApplyChanges(Value: TcxGridFilterRowApplyChangesMode); +begin + if FApplyChanges <> Value then + begin + FApplyChanges := Value; + Changed(vcProperty); + end; +end; + +function TcxGridFilterRowOptions.DefaultInfoText: string; +begin + Result := cxGetResourceString(@scxGridFilterRowInfoText); +end; + +procedure TcxGridFilterRowOptions.VisibleChanged; +begin + GridView.ViewData.CheckFilterRow; + Changed(vcSize); +end; + +procedure TcxGridFilterRowOptions.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridFilterRowOptions then + ApplyChanges := TcxGridFilterRowOptions(Source).ApplyChanges; +end; + +{ TcxGridNewItemRowOptions } + +function TcxGridNewItemRowOptions.DefaultInfoText: string; +begin + Result := cxGetResourceString(@scxGridNewItemRowInfoText); +end; + +procedure TcxGridNewItemRowOptions.VisibleChanged; +begin + GridView.ViewData.CheckNewItemRecord; + GridView.FDataController.UseNewItemRowForEditing := Visible; +end; + +{ TcxGridTableOptionsView } + +constructor TcxGridTableOptionsView.Create(AGridView: TcxCustomGridView); +begin + inherited; + FExpandButtonsForEmptyDetails := True; + FGridLineColor := clDefault; + FGroupByBox := True; + FHeader := True; + FIndicatorWidth := cxGridDefaultIndicatorWidth; + FPrevGroupFooters := gfVisibleWhenExpanded; + FRowSeparatorColor := clDefault; +end; + +function TcxGridTableOptionsView.GetExpandButtonsForEmptyDetails: Boolean; +begin + Result := FExpandButtonsForEmptyDetails and + ((GridView.Level = nil) or TcxGridLevel(GridView.Level).Options.TabsForEmptyDetails); +end; + +function TcxGridTableOptionsView.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +function TcxGridTableOptionsView.GetHeaderAutoHeight: Boolean; +begin + Result := ItemCaptionAutoHeight; +end; + +function TcxGridTableOptionsView.GetHeaderEndEllipsis: Boolean; +begin + Result := ItemCaptionEndEllipsis; +end; + +function TcxGridTableOptionsView.GetNewItemRow: Boolean; +begin + Result := GridView.NewItemRow.Visible; +end; + +function TcxGridTableOptionsView.GetNewItemRowInfoText: string; +begin + Result := GridView.NewItemRow.InfoText; +end; + +function TcxGridTableOptionsView.GetNewItemRowSeparatorColor: TColor; +begin + Result := GridView.NewItemRow.SeparatorColor; +end; + +function TcxGridTableOptionsView.GetNewItemRowSeparatorWidth: Integer; +begin + Result := GridView.NewItemRow.SeparatorWidth; +end; + +function TcxGridTableOptionsView.GetShowColumnFilterButtons: TcxGridShowItemFilterButtons; +begin + Result := ShowItemFilterButtons; +end; + +procedure TcxGridTableOptionsView.SetColumnAutoWidth(Value: Boolean); +begin + if FColumnAutoWidth <> Value then + begin + FColumnAutoWidth := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridTableOptionsView.SetDataRowHeight(Value: Integer); +begin + CheckDataRowHeight(Value); + if FDataRowHeight <> Value then + begin + FDataRowHeight := Value; + Changed(vcSize); + GridView.Controller.DesignerModified; + end; +end; + +procedure TcxGridTableOptionsView.SetExpandButtonsForEmptyDetails(Value: Boolean); +begin + if FExpandButtonsForEmptyDetails <> Value then + begin + FExpandButtonsForEmptyDetails := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridTableOptionsView.SetFooter(Value: Boolean); +begin + if FFooter <> Value then + begin + FFooter := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridTableOptionsView.SetFooterAutoHeight(Value: Boolean); +begin + if FFooterAutoHeight <> Value then + begin + FFooterAutoHeight := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridTableOptionsView.SetFooterMultiSummaries(Value: Boolean); +begin + if FFooterMultiSummaries <> Value then + begin + FFooterMultiSummaries := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridTableOptionsView.SetGridLineColor(Value: TColor); +begin + if FGridLineColor <> Value then + begin + FGridLineColor := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridTableOptionsView.SetGridLines(Value: TcxGridLines); +begin + if FGridLines <> Value then + begin + FGridLines := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridTableOptionsView.SetGroupByBox(Value: Boolean); +begin + if FGroupByBox <> Value then + begin + FGroupByBox := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridTableOptionsView.SetGroupFooterMultiSummaries(Value: Boolean); +begin + if FGroupFooterMultiSummaries <> Value then + begin + FGroupFooterMultiSummaries := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridTableOptionsView.SetGroupFooters(Value: TcxGridGroupFootersMode); +begin + if FGroupFooters <> Value then + begin + FPrevGroupFooters := FGroupFooters; + FGroupFooters := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridTableOptionsView.SetGroupRowHeight(Value: Integer); +begin + CheckGroupRowHeight(Value); + if FGroupRowHeight <> Value then + begin + FGroupRowHeight := Value; + Changed(vcSize); + GridView.Controller.DesignerModified; + end; +end; + +procedure TcxGridTableOptionsView.SetGroupRowStyle(Value: TcxGridGroupRowStyle); +begin + if FGroupRowStyle <> Value then + begin + FGroupRowStyle := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridTableOptionsView.SetGroupSummaryLayout(Value: TcxGridGroupSummaryLayout); +begin + if FGroupSummaryLayout <> Value then + begin + FGroupSummaryLayout := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridTableOptionsView.SetHeader(Value: Boolean); +begin + if FHeader <> Value then + begin + FHeader := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridTableOptionsView.SetHeaderAutoHeight(Value: Boolean); +begin + ItemCaptionAutoHeight := Value; +end; + +procedure TcxGridTableOptionsView.SetHeaderEndEllipsis(Value: Boolean); +begin + ItemCaptionEndEllipsis := Value; +end; + +procedure TcxGridTableOptionsView.SetHeaderHeight(Value: Integer); +begin + if Value < 0 then Value := 0; + if FHeaderHeight <> Value then + begin + FHeaderHeight := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridTableOptionsView.SetIndicator(Value: Boolean); +begin + if FIndicator <> Value then + begin + FIndicator := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridTableOptionsView.SetIndicatorWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FIndicatorWidth <> Value then + begin + FIndicatorWidth := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridTableOptionsView.SetNewItemRow(Value: Boolean); +begin + GridView.NewItemRow.Visible := Value; +end; + +procedure TcxGridTableOptionsView.SetNewItemRowInfoText(const Value: string); +begin + GridView.NewItemRow.InfoText := Value; +end; + +procedure TcxGridTableOptionsView.SetNewItemRowSeparatorColor(Value: TColor); +begin + GridView.NewItemRow.SeparatorColor := Value; +end; + +procedure TcxGridTableOptionsView.SetNewItemRowSeparatorWidth(Value: Integer); +begin + GridView.NewItemRow.SeparatorWidth := Value; +end; + +procedure TcxGridTableOptionsView.SetRowSeparatorColor(Value: TColor); +begin + if FRowSeparatorColor <> Value then + begin + FRowSeparatorColor := Value; + Changed(vcLayout); + end; +end; + +procedure TcxGridTableOptionsView.SetRowSeparatorWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FRowSeparatorWidth <> Value then + begin + FRowSeparatorWidth := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridTableOptionsView.SetShowColumnFilterButtons(Value: TcxGridShowItemFilterButtons); +begin + ShowItemFilterButtons := Value; +end; + +procedure TcxGridTableOptionsView.ReadNewItemRow(Reader: TReader); +begin + NewItemRow := Reader.ReadBoolean; +end; + +procedure TcxGridTableOptionsView.ReadNewItemRowInfoText(Reader: TReader); +begin + NewItemRowInfoText := Reader.ReadString; +end; + +procedure TcxGridTableOptionsView.ReadNewItemRowSeparatorColor(Reader: TReader); +begin + if Reader.NextValue = vaIdent then + NewItemRowSeparatorColor := StringToColor(Reader.ReadIdent) + else + NewItemRowSeparatorColor := Reader.ReadInteger; +end; + +procedure TcxGridTableOptionsView.ReadNewItemRowSeparatorWidth(Reader: TReader); +begin + NewItemRowSeparatorWidth := Reader.ReadInteger; +end; + +procedure TcxGridTableOptionsView.DefineProperties(Filer: TFiler); +begin + inherited; + Filer.DefineProperty('NewItemRow', ReadNewItemRow, nil, True); + Filer.DefineProperty('NewItemRowInfoText', ReadNewItemRowInfoText, nil, True); + Filer.DefineProperty('NewItemRowSeparatorColor', ReadNewItemRowSeparatorColor, nil, True); + Filer.DefineProperty('NewItemRowSeparatorWidth', ReadNewItemRowSeparatorWidth, nil, True); +end; + +procedure TcxGridTableOptionsView.ItemCaptionAutoHeightChanged; +begin + Changed(vcLayout); +end; + +procedure TcxGridTableOptionsView.Assign(Source: TPersistent); +begin + if Source is TcxGridTableOptionsView then + with TcxGridTableOptionsView(Source) do + begin + Self.ColumnAutoWidth := ColumnAutoWidth; + Self.DataRowHeight := DataRowHeight; + Self.ExpandButtonsForEmptyDetails := ExpandButtonsForEmptyDetails; + Self.Footer := Footer; + Self.FooterAutoHeight := FooterAutoHeight; + Self.FooterMultiSummaries := FooterMultiSummaries; + Self.GridLineColor := GridLineColor; + Self.GridLines := GridLines; + Self.GroupByBox := GroupByBox; + Self.GroupFooterMultiSummaries := GroupFooterMultiSummaries; + Self.GroupFooters := GroupFooters; + Self.GroupRowHeight := GroupRowHeight; + Self.GroupRowStyle := GroupRowStyle; + Self.GroupSummaryLayout := GroupSummaryLayout; + Self.Header := Header; + Self.HeaderHeight := HeaderHeight; + Self.Indicator := Indicator; + Self.IndicatorWidth := IndicatorWidth; + Self.FPrevGroupFooters := FPrevGroupFooters; + Self.RowSeparatorColor := RowSeparatorColor; + Self.RowSeparatorWidth := RowSeparatorWidth; + end; + inherited; +end; + +function TcxGridTableOptionsView.CanShowFooterMultiSummaries: Boolean; +begin + Result := GridView.ViewInfo.SupportsMultipleFooterSummaries and FooterMultiSummaries; +end; + +function TcxGridTableOptionsView.CanShowGroupFooterMultiSummaries: Boolean; +begin + Result := GridView.ViewInfo.SupportsMultipleFooterSummaries and GroupFooterMultiSummaries; +end; + +procedure TcxGridTableOptionsView.CheckDataRowHeight(var AValue: Integer); +var + AMinValue: Integer; +begin + if AValue < 0 then AValue := 0; + if AValue > 0 then + begin + AMinValue := GridView.ViewInfo.RecordsViewInfo.CalculateRowDefaultHeight; + if AValue < AMinValue then AValue := AMinValue; + end; +end; + +procedure TcxGridTableOptionsView.CheckGroupRowHeight(var AValue: Integer); +var + AMinValue: Integer; +begin + if AValue < 0 then AValue := 0; + if AValue > 0 then + begin + AMinValue := + GridView.ViewInfo.RecordsViewInfo.CalculateGroupRowDefaultHeight(True); + if AValue < AMinValue then AValue := AMinValue; + end; +end; + +function TcxGridTableOptionsView.GetGridLineColor: TColor; +begin + Result := FGridLineColor; + if Result = clDefault then + Result := LookAndFeelPainter.DefaultGridLineColor; +end; + +function TcxGridTableOptionsView.GetGroupSummaryLayout: TcxGridGroupSummaryLayout; +begin + if GridView.ViewInfo.SupportsGroupSummariesAlignedWithColumns then + Result := FGroupSummaryLayout + else + Result := gslStandard; +end; + +function TcxGridTableOptionsView.GetRowSeparatorColor: TColor; +begin + Result := FRowSeparatorColor; + if Result = clDefault then + Result := LookAndFeelPainter.DefaultRecordSeparatorColor; +end; + +{ TcxGridPreview } + +constructor TcxGridPreview.Create(AGridView: TcxCustomGridView); +begin + inherited; + FAutoHeight := True; + FLeftIndent := cxGridPreviewDefaultLeftIndent; + FMaxLineCount := cxGridPreviewDefaultMaxLineCount; + FRightIndent := cxGridPreviewDefaultRightIndent; +end; + +function TcxGridPreview.GetActive: Boolean; +begin + Result := FVisible and (FColumn <> nil); +end; + +function TcxGridPreview.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +procedure TcxGridPreview.SetAutoHeight(Value: Boolean); +begin + if FAutoHeight <> Value then + begin + FAutoHeight := Value; + PropertyChanged; + end; +end; + +procedure TcxGridPreview.SetColumn(Value: TcxGridColumn); + + procedure ColumnVisibilityChanged(AColumn: TcxGridColumn); + begin + AColumn.VisibleChanged; + GridView.ItemVisibilityChanged(AColumn, AColumn.ActuallyVisible); + AColumn.VisibleForCustomizationChanged; + end; + +var + APrevColumn: TcxGridColumn; +begin + if (Value <> nil) and (Value.GridView <> GridView) then Value := nil; + if FColumn <> Value then + begin + APrevColumn := FColumn; + FColumn := Value; + GridView.BeginUpdate; + try + if APrevColumn <> nil then + ColumnVisibilityChanged(APrevColumn); + if FColumn <> nil then + ColumnVisibilityChanged(FColumn); + finally + GridView.EndUpdate; + end; + end; +end; + +procedure TcxGridPreview.SetLeftIndent(Value: Integer); +begin + if Value < 0 then Value := 0; + if FLeftIndent <> Value then + begin + FLeftIndent := Value; + PropertyChanged; + end; +end; + +procedure TcxGridPreview.SetMaxLineCount(Value: Integer); +begin + if Value < 0 then Value := 0; + if FMaxLineCount <> Value then + begin + FMaxLineCount := Value; + PropertyChanged; + end; +end; + +procedure TcxGridPreview.SetPlace(Value: TcxGridPreviewPlace); +begin + if FPlace <> Value then + begin + FPlace := Value; + PropertyChanged; + end; +end; + +procedure TcxGridPreview.SetRightIndent(Value: Integer); +begin + if Value < 0 then Value := 0; + if FRightIndent <> Value then + begin + FRightIndent := Value; + PropertyChanged; + end; +end; + +procedure TcxGridPreview.SetVisible(Value: Boolean); +begin + if FVisible <> Value then + begin + FVisible := Value; + Changed(vcSize); + end; +end; + +procedure TcxGridPreview.Notification(AComponent: TComponent; + AOperation: TOperation); +begin + inherited; + if (AOperation = opRemove) and (AComponent = Column) then + Column := nil; +end; + +procedure TcxGridPreview.PropertyChanged; +begin + if FVisible then + Changed(vcSize) + else + Changed(vcProperty); +end; + +procedure TcxGridPreview.Assign(Source: TPersistent); +begin + if Source is TcxGridPreview then + with TcxGridPreview(Source) do + begin + Self.AutoHeight := AutoHeight; + if not Self.GridView.AssigningSettings then + if Column <> nil then + Self.Column := TcxGridColumn(Self.GridView.FindItemByID(Column.ID)) + else + Self.Column := Column; + Self.LeftIndent := LeftIndent; + Self.MaxLineCount := MaxLineCount; + Self.Place := Place; + Self.RightIndent := RightIndent; + Self.Visible := Visible; + end; + inherited; +end; + +{ TcxGridTableViewStyles } + +function TcxGridTableViewStyles.GetGridViewValue: TcxGridTableView; +begin + Result := TcxGridTableView(inherited GridView); +end; + +procedure TcxGridTableViewStyles.SetOnGetFooterStyle(Value: TcxGridGetCellStyleEvent); +begin + if @FOnGetFooterStyle <> @Value then + begin + FOnGetFooterStyle := Value; + GridView.Changed(vcProperty); + end; +end; + +procedure TcxGridTableViewStyles.SetOnGetFooterStyleEx(Value: TcxGridGetFooterStyleExEvent); +begin + if @FOnGetFooterStyleEx <> @Value then + begin + FOnGetFooterStyleEx := Value; + GridView.Changed(vcProperty); + end; +end; + +procedure TcxGridTableViewStyles.SetOnGetFooterSummaryStyle(Value: TcxGridGetFooterSummaryStyleEvent); +begin + if @FOnGetFooterSummaryStyle <> @Value then + begin + FOnGetFooterSummaryStyle := Value; + GridView.Changed(vcProperty); + end; +end; + +procedure TcxGridTableViewStyles.SetOnGetGroupStyle(Value: TcxGridGetGroupStyleEvent); +begin + if @FOnGetGroupStyle <> @Value then + begin + FOnGetGroupStyle := Value; + GridView.Changed(vcProperty); + end; +end; + +procedure TcxGridTableViewStyles.SetOnGetGroupSummaryStyle(Value: TcxGridGetGroupSummaryStyleEvent); +begin + if @FOnGetGroupSummaryStyle <> @Value then + begin + FOnGetGroupSummaryStyle := Value; + GridView.Changed(vcProperty); + end; +end; + +procedure TcxGridTableViewStyles.SetOnGetHeaderStyle(Value: TcxGridGetHeaderStyleEvent); +begin + if @FOnGetHeaderStyle <> @Value then + begin + FOnGetHeaderStyle := Value; + GridView.Changed(vcProperty); + end; +end; + +procedure TcxGridTableViewStyles.SetOnGetPreviewStyle(Value: TcxGridGetCellStyleEvent); +begin + if @FOnGetPreviewStyle <> @Value then + begin + FOnGetPreviewStyle := Value; + GridView.Changed(vcProperty); + end; +end; + +procedure TcxGridTableViewStyles.GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); + + procedure GetGroupDefaultViewParams; + begin + with AParams, LookAndFeelPainter do + begin + inherited GetContentParams(TcxCustomGridRecord(AData), nil, AParams); + if GridView.OptionsView.GroupRowStyle = grsStandard then + begin + Color := DefaultGroupColor; + TextColor := DefaultGroupTextColor; + end + else + if AData = nil then + Color := dxOffice11GroupIndentColor + else + begin + Color := clWindow; + TextColor := dxOffice11GroupRowTextColor; + end; + end; + end; + +begin + inherited; + with AParams, LookAndFeelPainter do + case Index of + vsFooter: + begin + Color := DefaultFooterColor; + TextColor := DefaultFooterTextColor; + end; + vsGroup: + GetGroupDefaultViewParams; + vsGroupByBox: + begin + Color := DefaultGroupByBoxColor; + TextColor := DefaultGroupByBoxTextColor; + end; + vsGroupFooterSortedSummary: + if AData <> nil then + TcxGridRowFooterCellPos(AData).Column.Styles.GetFooterParams( + TcxGridRowFooterCellPos(AData).Row, + TcxGridRowFooterCellPos(AData).FooterGroupLevel, + TcxGridRowFooterCellPos(AData).SummaryItem, AParams) + else + GetFooterParams(nil, nil, -1, nil, AParams); + vsGroupSortedSummary: + if AData <> nil then + GetGroupSummaryCellContentParams(TcxGridGroupSummaryInfo(AData).Row, + TcxGridGroupSummaryInfo(AData).SummaryItem, AParams) + else + GetGroupSummaryCellContentParams(nil, nil, AParams); + vsGroupSummary: + GetRecordContentParams(TcxCustomGridRecord(AData), nil, AParams); + vsHeader, vsIndicator: + begin + Color := DefaultHeaderColor; + TextColor := DefaultHeaderTextColor; + end; + vsFilterRowInfoText, vsNewItemRowInfoText: + begin + GetContentParams(TcxCustomGridRecord(AData), nil, AParams); + TextColor := clGrayText; + end; + vsPreview: + begin + inherited GetContentParams(TcxCustomGridRecord(AData), GridView.Preview.Column, AParams); + TextColor := DefaultPreviewTextColor; + end; + end; +end; + +procedure TcxGridTableViewStyles.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridTableViewStyles then + with TcxGridTableViewStyles(Source) do + begin + Self.FilterRowInfoText := FilterRowInfoText; + Self.Footer := Footer; + Self.Group := Group; + Self.GroupByBox := GroupByBox; + Self.GroupFooterSortedSummary := GroupFooterSortedSummary; + Self.GroupSortedSummary := GroupSortedSummary; + Self.GroupSummary := GroupSummary; + Self.Header := Header; + Self.Indicator := Indicator; + Self.NewItemRowInfoText := NewItemRowInfoText; + Self.Preview := Preview; + Self.OnGetFooterStyle := OnGetFooterStyle; + Self.OnGetFooterStyleEx := OnGetFooterStyleEx; + Self.OnGetFooterSummaryStyle := OnGetFooterSummaryStyle; + Self.OnGetGroupStyle := OnGetGroupStyle; + Self.OnGetGroupSummaryStyle := OnGetGroupSummaryStyle; + Self.OnGetHeaderStyle := OnGetHeaderStyle; + Self.OnGetPreviewStyle := OnGetPreviewStyle; + end; +end; + +procedure TcxGridTableViewStyles.GetCellContentParams(ARecord: TcxCustomGridRecord; + AItem: TObject; out AParams: TcxViewParams); +begin + if (AItem is TcxDataSummaryItem) or (AItem is TcxDataSummaryItems) then + begin + if AItem is TcxDataSummaryItems then + AItem := nil; + GetGroupSummaryCellContentParams(ARecord as TcxGridGroupRow, TcxDataSummaryItem(AItem), AParams); + end + else + inherited; +end; + +procedure TcxGridTableViewStyles.GetContentParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +begin + if (AItem <> nil) and TcxGridColumn(AItem).IsPreview then + GetPreviewParams(ARecord, AItem, AParams) + else + inherited; +end; + +procedure TcxGridTableViewStyles.GetFooterCellParams(ARow: TcxCustomGridRow; + AColumn: TcxGridColumn; AFooterGroupLevel: Integer; ASummaryItem: TcxDataSummaryItem; + out AParams: TcxViewParams); +var + AFooterCellPos: TcxGridRowFooterCellPos; +begin + if (AFooterGroupLevel <> -1) and (ASummaryItem <> nil) and ASummaryItem.Sorted then + begin + AFooterCellPos := TcxGridRowFooterCellPos.Create(ARow, AColumn, AFooterGroupLevel, ASummaryItem); + try + GetViewParams(vsGroupFooterSortedSummary, AFooterCellPos, nil, AParams); + finally + AFooterCellPos.Free; + end; + end + else + AColumn.Styles.GetFooterParams(ARow, AFooterGroupLevel, ASummaryItem, AParams); +end; + +procedure TcxGridTableViewStyles.GetFooterParams(ARow: TcxCustomGridRow; + AColumn: TcxGridColumn; AFooterGroupLevel: Integer; ASummaryItem: TcxDataSummaryItem; + out AParams: TcxViewParams); +var + AStyle: TcxStyle; +begin + AStyle := nil; + if Assigned(FOnGetFooterStyle) then + FOnGetFooterStyle(GridView, ARow, AColumn, AStyle); + if Assigned(FOnGetFooterStyleEx) then + FOnGetFooterStyleEx(GridView, ARow, AColumn, AFooterGroupLevel, AStyle); + if Assigned(FOnGetFooterSummaryStyle) and (ASummaryItem <> nil) then + FOnGetFooterSummaryStyle(GridView, ARow, AColumn, AFooterGroupLevel, ASummaryItem, AStyle); + GetViewParams(vsFooter, nil, AStyle, AParams); +end; + +procedure TcxGridTableViewStyles.GetGroupParams(ARecord: TcxCustomGridRecord; + ALevel: Integer; out AParams: TcxViewParams); +var + AStyle: TcxStyle; +begin + AStyle := nil; + if Assigned(FOnGetGroupStyle) then + begin + if ARecord <> nil then ALevel := ARecord.Level; + FOnGetGroupStyle(GridView, ARecord, ALevel, AStyle); + end; + GetViewParams(vsGroup, ARecord, AStyle, AParams); +end; + +procedure TcxGridTableViewStyles.GetGroupSummaryCellContentParams(ARow: TcxGridGroupRow; + ASummaryItem: TcxDataSummaryItem; out AParams: TcxViewParams); +var + ASummaryInfo: TcxGridGroupSummaryInfo; +begin + if not FProcessingGroupSortedSummary and + (ASummaryItem <> nil) and (ASummaryItem = ARow.GroupSummaryItems.SortedSummaryItem) then + begin + FProcessingGroupSortedSummary := True; + ASummaryInfo := TcxGridGroupSummaryInfo.Create(ARow, ASummaryItem); + try + GetViewParams(vsGroupSortedSummary, ASummaryInfo, nil, AParams); + finally + ASummaryInfo.Free; + FProcessingGroupSortedSummary := False; + end; + end + else + if (ASummaryItem = nil) or (ASummaryItem.ItemLink = nil) then + GetGroupSummaryParams(ARow, ASummaryItem, AParams) + else + TcxGridColumn(ASummaryItem.ItemLink).Styles.GetGroupSummaryParams(ARow, ASummaryItem, AParams); +end; + +procedure TcxGridTableViewStyles.GetGroupSummaryCellParams(ARow: TcxGridGroupRow; + ASummaryItem: TcxDataSummaryItem; out AParams: TcxViewParams); +begin + if GridView.DrawDataCellSelected(ARow, nil) then + if ASummaryItem = nil then + GetSelectionParams(ARow, ARow.GroupSummaryItems, AParams) + else + GetSelectionParams(ARow, ASummaryItem, AParams) + else + GetGroupSummaryCellContentParams(ARow, ASummaryItem, AParams); +end; + +procedure TcxGridTableViewStyles.GetGroupSummaryParams(ARow: TcxGridGroupRow; + ASummaryItem: TcxDataSummaryItem; out AParams: TcxViewParams); +var + AStyle: TcxStyle; + AColumn: TcxGridColumn; +begin + AStyle := nil; + if (ARow <> nil) and Assigned(FOnGetGroupSummaryStyle) then + begin + if ASummaryItem = nil then + AColumn := nil + else + AColumn := ASummaryItem.ItemLink as TcxGridColumn; + FOnGetGroupSummaryStyle(GridView, ARow, AColumn, ASummaryItem, AStyle); + end; + GetViewParams(vsGroupSummary, ARow, AStyle, AParams); +end; + +procedure TcxGridTableViewStyles.GetHeaderParams(AItem: TcxGridColumn; + out AParams: TcxViewParams); +var + AStyle: TcxStyle; +begin + AStyle := nil; + if Assigned(FOnGetHeaderStyle) then + FOnGetHeaderStyle(GridView, AItem, AStyle); + GetViewParams(vsHeader, nil, AStyle, AParams); +end; + +procedure TcxGridTableViewStyles.GetPreviewParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +var + AStyle: TcxStyle; +begin + AStyle := nil; + if Assigned(FOnGetPreviewStyle) then + FOnGetPreviewStyle(GridView, ARecord, AItem, AStyle); + GetViewParams(vsPreview, ARecord, AStyle, AParams); +end; + +procedure TcxGridTableViewStyles.GetRecordContentParams(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; out AParams: TcxViewParams); +begin + if ARecord is TcxGridGroupRow then + GetGroupParams(ARecord, -1, AParams) + else + inherited; +end; + +{ TcxGridTableViewStyleSheet } + +function TcxGridTableViewStyleSheet.GetStylesValue: TcxGridTableViewStyles; +begin + Result := TcxGridTableViewStyles(GetStyles); +end; + +procedure TcxGridTableViewStyleSheet.SetStylesValue(Value: TcxGridTableViewStyles); +begin + SetStyles(Value); +end; + +class function TcxGridTableViewStyleSheet.GetStylesClass: TcxCustomStylesClass; +begin + Result := TcxGridTableViewStyles; +end; + +{ TcxGridTableSummaryGroupItemLink } + +function TcxGridTableSummaryGroupItemLink.GetColumn: TcxGridColumn; +begin + Result := TcxGridColumn(ItemLink); +end; + +procedure TcxGridTableSummaryGroupItemLink.SetColumn(Value: TcxGridColumn); +begin + ItemLink := Value; +end; + +function TcxGridTableSummaryGroupItemLink.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView((DataController as IcxCustomGridDataController).GridView); +end; + +function TcxGridTableSummaryGroupItemLink.QueryInterface(const IID: TGUID; out Obj): HResult; +const + E_NOINTERFACE = HResult($80004002); +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +function TcxGridTableSummaryGroupItemLink._AddRef: Integer; +begin + Result := -1; +end; + +function TcxGridTableSummaryGroupItemLink._Release: Integer; +begin + Result := -1; +end; + +function TcxGridTableSummaryGroupItemLink.GetObjectName: string; +begin + Result := ''; +end; + +function TcxGridTableSummaryGroupItemLink.GetProperties(AProperties: TStrings): Boolean; +begin + AProperties.Add('Column'); + Result := True; +end; + +procedure TcxGridTableSummaryGroupItemLink.GetPropertyValue(const AName: string; + var AValue: Variant); +begin + if AName = 'Column' then + if Column <> nil then + AValue := Column.GetObjectName + else + AValue := ''; +end; + +procedure TcxGridTableSummaryGroupItemLink.SetPropertyValue(const AName: string; + const AValue: Variant); +begin + if AName = 'Column' then + Column := TcxGridColumn(GridView.FindItemByObjectName(AValue)); +end; + +{ TcxGridTableSummaryItem } + +constructor TcxGridTableSummaryItem.Create(Collection: TCollection); +begin + inherited; + FVisibleForCustomization := True; +end; + +function TcxGridTableSummaryItem.GetColumn: TcxGridColumn; +begin + Result := TcxGridColumn(ItemLink); +end; + +function TcxGridTableSummaryItem.GetGridView: TcxGridTableView; +begin + Result := TcxGridTableView((DataController as IcxCustomGridDataController).GridView); +end; + +procedure TcxGridTableSummaryItem.SetColumn(Value: TcxGridColumn); +begin + ItemLink := Value; +end; + +procedure TcxGridTableSummaryItem.SetDisplayText(const Value: string); +begin + if FDisplayText <> Value then + begin + FDisplayText := Value; + GridView.Changed(vcProperty); + end; +end; + +procedure TcxGridTableSummaryItem.SetVisibleForCustomization(Value: Boolean); +begin + if FVisibleForCustomization <> Value then + begin + FVisibleForCustomization := Value; + GridView.Changed(vcProperty); + end; +end; + +function TcxGridTableSummaryItem.QueryInterface(const IID: TGUID; out Obj): HResult; +const + E_NOINTERFACE = HResult($80004002); +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +function TcxGridTableSummaryItem._AddRef: Integer; +begin + Result := -1; +end; + +function TcxGridTableSummaryItem._Release: Integer; +begin + Result := -1; +end; + +function TcxGridTableSummaryItem.GetObjectName: string; +begin + Result := ''; +end; + +function TcxGridTableSummaryItem.GetProperties(AProperties: TStrings): Boolean; +begin + AProperties.Add('Column'); + Result := False; +end; + +procedure TcxGridTableSummaryItem.GetPropertyValue(const AName: string; var AValue: Variant); +begin + if AName = 'Column' then + if Column <> nil then + AValue := Column.GetObjectName + else + AValue := ''; +end; + +procedure TcxGridTableSummaryItem.SetPropertyValue(const AName: string; const AValue: Variant); +begin + if AName = 'Column' then + Column := TcxGridColumn(GridView.FindItemByObjectName(AValue)); +end; + +function TcxGridTableSummaryItem.GetDisplayText: string; +begin + Result := DisplayText; +end; + +function TcxGridTableSummaryItem.GetVisibleForCustomization: Boolean; +begin + Result := VisibleForCustomization; +end; + +procedure TcxGridTableSummaryItem.Assign(Source: TPersistent); +begin + inherited; + if Source is TcxGridTableSummaryItem then + with TcxGridTableSummaryItem(Source) do + begin + Self.DisplayText := DisplayText; + Self.VisibleForCustomization := VisibleForCustomization; + end; +end; + +{ TcxGridTableView } + +function TcxGridTableView.GetBackgroundBitmaps: TcxGridTableBackgroundBitmaps; +begin + Result := TcxGridTableBackgroundBitmaps(inherited BackgroundBitmaps); +end; + +function TcxGridTableView.GetColumn(Index: Integer): TcxGridColumn; +begin + Result := TcxGridColumn(Items[Index]); +end; + +function TcxGridTableView.GetColumnCount: Integer; +begin + Result := ItemCount; +end; + +function TcxGridTableView.GetController: TcxGridTableController; +begin + Result := TcxGridTableController(inherited Controller); +end; + +function TcxGridTableView.GetDataController: TcxGridDataController; +begin + Result := TcxGridDataController(FDataController); +end; + +function TcxGridTableView.GetDateTimeHandling: TcxGridTableDateTimeHandling; +begin + Result := TcxGridTableDateTimeHandling(inherited DateTimeHandling); +end; + +function TcxGridTableView.GetFiltering: TcxGridTableFiltering; +begin + Result := TcxGridTableFiltering(inherited Filtering); +end; + +function TcxGridTableView.GetGroupedColumn(Index: Integer): TcxGridColumn; +begin + Result := TcxGridColumn(GroupedItems[Index]); +end; + +function TcxGridTableView.GetGroupedColumnCount: Integer; +begin + Result := GroupedItemCount; +end; + +function TcxGridTableView.GetOptionsBehavior: TcxGridTableOptionsBehavior; +begin + Result := TcxGridTableOptionsBehavior(inherited OptionsBehavior); +end; + +function TcxGridTableView.GetOptionsCustomize: TcxGridTableOptionsCustomize; +begin + Result := TcxGridTableOptionsCustomize(inherited OptionsCustomize); +end; + +function TcxGridTableView.GetOptionsData: TcxGridTableOptionsData; +begin + Result := TcxGridTableOptionsData(inherited OptionsData); +end; + +function TcxGridTableView.GetOptionsSelection: TcxGridTableOptionsSelection; +begin + Result := TcxGridTableOptionsSelection(inherited OptionsSelection); +end; + +function TcxGridTableView.GetOptionsView: TcxGridTableOptionsView; +begin + Result := TcxGridTableOptionsView(inherited OptionsView); +end; + +function TcxGridTableView.GetPainter: TcxGridTablePainter; +begin + Result := TcxGridTablePainter(inherited Painter); +end; + +function TcxGridTableView.GetStyles: TcxGridTableViewStyles; +begin + Result := TcxGridTableViewStyles(inherited Styles); +end; + +function TcxGridTableView.GetViewData: TcxGridViewData; +begin + Result := TcxGridViewData(inherited ViewData); +end; + +function TcxGridTableView.GetViewInfo: TcxGridTableViewInfo; +begin + Result := TcxGridTableViewInfo(inherited ViewInfo); +end; + +function TcxGridTableView.GetVisibleColumn(Index: Integer): TcxGridColumn; +begin + Result := TcxGridColumn(VisibleItems[Index]); +end; + +function TcxGridTableView.GetVisibleColumnCount: Integer; +begin + Result := VisibleItemCount; +end; + +procedure TcxGridTableView.SetBackgroundBitmaps(Value: TcxGridTableBackgroundBitmaps); +begin + inherited BackgroundBitmaps := Value; +end; + +procedure TcxGridTableView.SetColumn(Index: Integer; Value: TcxGridColumn); +begin + Items[Index] := Value; +end; + +procedure TcxGridTableView.SetDataController(Value: TcxGridDataController); +begin + FDataController.Assign(Value); +end; + +procedure TcxGridTableView.SetDateTimeHandling(Value: TcxGridTableDateTimeHandling); +begin + inherited DateTimeHandling := Value; +end; + +procedure TcxGridTableView.SetFiltering(Value: TcxGridTableFiltering); +begin + inherited Filtering := Value; +end; + +procedure TcxGridTableView.SetFilterRow(Value: TcxGridFilterRowOptions); +begin + FFilterRow.Assign(Value); +end; + +procedure TcxGridTableView.SetNewItemRow(Value: TcxGridNewItemRowOptions); +begin + FNewItemRow.Assign(Value); +end; + +procedure TcxGridTableView.SetOnColumnHeaderClick(Value: TcxGridColumnEvent); +begin + if @FOnColumnHeaderClick <> @Value then + begin + FOnColumnHeaderClick := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridTableView.SetOnColumnPosChanged(Value: TcxGridColumnEvent); +begin + if @FOnColumnPosChanged <> @Value then + begin + FOnColumnPosChanged := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridTableView.SetOnColumnSizeChanged(Value: TcxGridColumnEvent); +begin + if @FOnColumnSizeChanged <> @Value then + begin + FOnColumnSizeChanged := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridTableView.SetOnCustomDrawColumnHeader(Value: TcxGridColumnCustomDrawHeaderEvent); +begin + if @FOnCustomDrawColumnHeader <> @Value then + begin + FOnCustomDrawColumnHeader := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridTableView.SetOnCustomDrawFooterCell(Value: TcxGridColumnCustomDrawHeaderEvent); +begin + if @FOnCustomDrawFooterCell <> @Value then + begin + FOnCustomDrawFooterCell := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridTableView.SetOnCustomDrawGroupCell(Value: TcxGridTableCellCustomDrawEvent); +begin + if @FOnCustomDrawGroupCell <> @Value then + begin + FOnCustomDrawGroupCell := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridTableView.SetOnCustomDrawGroupSummaryCell(Value: TcxGridGroupSummaryCellCustomDrawEvent); +begin + if @FOnCustomDrawGroupSummaryCell <> @Value then + begin + FOnCustomDrawGroupSummaryCell := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridTableView.SetOnCustomDrawIndicatorCell(Value: TcxGridIndicatorCellCustomDrawEvent); +begin + if @FOnCustomDrawIndicatorCell <> @Value then + begin + FOnCustomDrawIndicatorCell := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridTableView.SetOnLeftPosChanged(Value: TNotifyEvent); +begin + if @FOnLeftPosChanged <> @Value then + begin + FOnLeftPosChanged := Value; + Changed(vcProperty); + end; +end; + +procedure TcxGridTableView.SetOptionsBehavior(Value: TcxGridTableOptionsBehavior); +begin + inherited OptionsBehavior := Value; +end; + +procedure TcxGridTableView.SetOptionsCustomize(Value: TcxGridTableOptionsCustomize); +begin + inherited OptionsCustomize := Value; +end; + +procedure TcxGridTableView.SetOptionsData(Value: TcxGridTableOptionsData); +begin + inherited OptionsData := Value; +end; + +procedure TcxGridTableView.SetOptionsSelection(Value: TcxGridTableOptionsSelection); +begin + inherited OptionsSelection := Value; +end; + +procedure TcxGridTableView.SetOptionsView(Value: TcxGridTableOptionsView); +begin + inherited OptionsView := Value; +end; + +procedure TcxGridTableView.SetPreview(Value: TcxGridPreview); +begin + FPreview.Assign(Value); +end; + +procedure TcxGridTableView.SetStyles(Value: TcxGridTableViewStyles); +begin + inherited Styles := Value; +end; + +function TcxGridTableView.GetProperties(AProperties: TStrings): Boolean; +begin + with AProperties do + begin + Add('Footer'); + Add('GroupByBox'); + Add('GroupFooters'); + Add('NewItemRow'); + end; + Result := inherited GetProperties(AProperties); +end; + +procedure TcxGridTableView.GetPropertyValue(const AName: string; var AValue: Variant); +begin + if AName = 'Footer' then + AValue := OptionsView.Footer + else + if AName = 'GroupByBox' then + AValue := OptionsView.GroupByBox + else + if AName = 'GroupFooters' then + AValue := Variant(OptionsView.GroupFooters) + else + if AName = 'NewItemRow' then + AValue := NewItemRow.Visible + else + inherited; +end; + +procedure TcxGridTableView.SetPropertyValue(const AName: string; const AValue: Variant); +begin + if AName = 'Footer' then + OptionsView.Footer := AValue + else + if AName = 'GroupByBox' then + OptionsView.GroupByBox := AValue + else + if AName = 'GroupFooters' then + if VarIsStr(AValue) then // version 4 + if AValue then + OptionsView.GroupFooters := gfVisibleWhenExpanded + else + OptionsView.GroupFooters := gfInvisible + else // version > 4 + OptionsView.GroupFooters := TcxGridGroupFootersMode((AValue)) + else + if AName = 'NewItemRow' then + NewItemRow.Visible := AValue + else + inherited; +end; + +procedure TcxGridTableView.AssignLayout(ALayoutView: TcxCustomGridView); +begin + inherited; + with (ALayoutView as TcxGridTableView).OptionsView do + begin + Self.OptionsView.DataRowHeight := DataRowHeight; + Self.OptionsView.Footer := Footer; + Self.OptionsView.GroupByBox := GroupByBox; + Self.OptionsView.GroupFooters := GroupFooters; + Self.OptionsView.GroupRowHeight := GroupRowHeight; + end; +end; + +function TcxGridTableView.GetLayoutCustomizationFormButtonCaption: string; +begin + Result := 'Columns customization'; +end; + +procedure TcxGridTableView.CreateOptions; +begin + inherited; + FFilterRow := GetFilterRowOptionsClass.Create(Self); + FNewItemRow := GetNewItemRowOptionsClass.Create(Self); + FPreview := GetPreviewClass.Create(Self); +end; + +procedure TcxGridTableView.DestroyOptions; +begin + FreeAndNil(FPreview); + FreeAndNil(FNewItemRow); + FreeAndNil(FFilterRow); + inherited; +end; + +function TcxGridTableView.CanCellMerging: Boolean; +begin + Result := not FPreview.Active and (OptionsView.RowSeparatorWidth = 0); +end; + +function TcxGridTableView.CanOffset(ARecordCountDelta: Integer): Boolean; +begin + Result := inherited CanOffset(ARecordCountDelta) and not IsMaster; +end; + +function TcxGridTableView.CanOffsetHorz: Boolean; +begin + Result := not TcxCustomGrid(Control).UpdateLocked and + (not IsMaster or (GroupedColumnCount = 0)); +end; + +procedure TcxGridTableView.DetailDataChanged(ADetail: TcxCustomGridView); +begin + inherited; + if UpdateOnDetailDataChange(ADetail) then + SizeChanged; +end; + +procedure TcxGridTableView.DoAssign(ASource: TcxCustomGridView); +begin + if ASource is TcxGridTableView then + with TcxGridTableView(ASource) do + begin + Self.OnColumnHeaderClick := OnColumnHeaderClick; + Self.OnColumnPosChanged := OnColumnPosChanged; + Self.OnColumnSizeChanged := OnColumnSizeChanged; + Self.OnCustomDrawColumnHeader := OnCustomDrawColumnHeader; + Self.OnCustomDrawFooterCell := OnCustomDrawFooterCell; + Self.OnCustomDrawGroupCell := OnCustomDrawGroupCell; + Self.OnCustomDrawGroupSummaryCell := OnCustomDrawGroupSummaryCell; + Self.OnCustomDrawIndicatorCell := OnCustomDrawIndicatorCell; + Self.OnLeftPosChanged := OnLeftPosChanged; + end; + inherited; + if ASource is TcxGridTableView then + with TcxGridTableView(ASource) do + begin + Self.FilterRow := FilterRow; + Self.NewItemRow := NewItemRow; + Self.Preview := Preview; + end; +end; + +procedure TcxGridTableView.GetItemsListForClipboard(AItems: TList; ACopyAll: Boolean); +var + I: Integer; +begin + if ACopyAll or not Controller.CellMultiSelect then + inherited GetVisibleItemsList(AItems) + else + begin + inherited; + for I := AItems.Count - 1 downto 0 do + if not TcxGridColumn(AItems[I]).Selected then + AItems.Delete(I); + end; + if OptionsBehavior.CopyPreviewToClipboard then + if FPreview.Active then AItems.Add(FPreview.Column); +end; + +function TcxGridTableView.GetResizeOnBoundsChange: Boolean; +begin + Result := inherited GetResizeOnBoundsChange or + OptionsView.ColumnAutoWidth or Preview.Active or IsMaster; +end; + +function TcxGridTableView.HasCellMerging: Boolean; +var + I: Integer; +begin + for I := 0 to VisibleColumnCount - 1 do + begin + Result := VisibleColumns[I].CanCellMerging; + if Result then Exit; + end; + Result := False; +end; + +function TcxGridTableView.IsEqualHeightRecords: Boolean; +begin + Result := inherited IsEqualHeightRecords and + not ViewInfo.RecordsViewInfo.HasLastHorzGridLine(nil) and + not Preview.Active and (GroupedColumnCount = 0) and not IsMaster; +end; + +function TcxGridTableView.IsRecordHeightDependsOnData: Boolean; +begin + Result := inherited IsRecordHeightDependsOnData or + Preview.Active and Preview.AutoHeight; +end; + +function TcxGridTableView.UpdateOnDetailDataChange(ADetail: TcxCustomGridView): Boolean; +begin + Result := not OptionsView.ExpandButtonsForEmptyDetails; +end; + +function TcxGridTableView.GetControllerClass: TcxCustomGridControllerClass; +begin + Result := TcxGridTableController; +end; + +function TcxGridTableView.GetDataControllerClass: TcxCustomDataControllerClass; +begin + Result := TcxGridDataController; +end; + +function TcxGridTableView.GetPainterClass: TcxCustomGridPainterClass; +begin + Result := TcxGridTablePainter; +end; + +function TcxGridTableView.GetViewDataClass: TcxCustomGridViewDataClass; +begin + Result := TcxGridViewData; +end; + +function TcxGridTableView.GetViewInfoClass: TcxCustomGridViewInfoClass; +begin + Result := TcxGridTableViewInfo; +end; + +function TcxGridTableView.GetBackgroundBitmapsClass: TcxCustomGridBackgroundBitmapsClass; +begin + Result := TcxGridTableBackgroundBitmaps; +end; + +function TcxGridTableView.GetDateTimeHandlingClass: TcxCustomGridTableDateTimeHandlingClass; +begin + Result := TcxGridTableDateTimeHandling; +end; + +function TcxGridTableView.GetFilteringClass: TcxCustomGridTableFilteringClass; +begin + Result := TcxGridTableFiltering; +end; + +function TcxGridTableView.GetFilterRowOptionsClass: TcxGridFilterRowOptionsClass; +begin + Result := TcxGridFilterRowOptions; +end; + +function TcxGridTableView.GetNewItemRowOptionsClass: TcxGridNewItemRowOptionsClass; +begin + Result := TcxGridNewItemRowOptions; +end; + +function TcxGridTableView.GetOptionsBehaviorClass: TcxCustomGridOptionsBehaviorClass; +begin + Result := TcxGridTableOptionsBehavior; +end; + +function TcxGridTableView.GetOptionsCustomizeClass: TcxCustomGridTableOptionsCustomizeClass; +begin + Result := TcxGridTableOptionsCustomize; +end; + +function TcxGridTableView.GetOptionsDataClass: TcxCustomGridOptionsDataClass; +begin + Result := TcxGridTableOptionsData; +end; + +function TcxGridTableView.GetOptionsSelectionClass: TcxCustomGridOptionsSelectionClass; +begin + Result := TcxGridTableOptionsSelection; +end; + +function TcxGridTableView.GetOptionsViewClass: TcxCustomGridOptionsViewClass; +begin + Result := TcxGridTableOptionsView; +end; + +function TcxGridTableView.GetPreviewClass: TcxGridPreviewClass; +begin + Result := TcxGridPreview; +end; + +function TcxGridTableView.GetStylesClass: TcxCustomGridViewStylesClass; +begin + Result := TcxGridTableViewStyles; +end; + +function TcxGridTableView.GetSummaryGroupItemLinkClass: TcxDataSummaryGroupItemLinkClass; +begin + Result := TcxGridTableSummaryGroupItemLink; +end; + +function TcxGridTableView.GetSummaryItemClass: TcxDataSummaryItemClass; +begin + Result := TcxGridTableSummaryItem; +end; + +function TcxGridTableView.GetItemClass: TcxCustomGridTableItemClass; +begin + Result := TcxGridColumn; +end; + +procedure TcxGridTableView.ItemVisibilityChanged(AItem: TcxCustomGridTableItem; + Value: Boolean); +begin + if not Value and (AItem = Controller.CellSelectionAnchor) then + Controller.CellSelectionAnchor := Controller.FocusedColumn; + inherited; +end; + +function TcxGridTableView.CalculateDataCellSelected(ARecord: TcxCustomGridRecord; + AItem: TcxCustomGridTableItem; AUseViewInfo: Boolean; + ACellViewInfo: TcxGridTableCellViewInfo): Boolean; +begin + if Controller.CellMultiSelect and TcxCustomGridRow(ARecord).SupportsCellMultiSelect then + Result := (AItem <> nil) and TcxGridColumn(AItem).Selected and + (not (ACellViewInfo is TcxGridTableDataCellViewInfo) or + not TcxGridTableDataCellViewInfo(ACellViewInfo).Editing) + else + Result := inherited CalculateDataCellSelected(ARecord, AItem, AUseViewInfo, ACellViewInfo); +end; + +procedure TcxGridTableView.DoColumnHeaderClick(AColumn: TcxGridColumn); +begin + if Assigned(FOnColumnHeaderClick) then FOnColumnHeaderClick(Self, AColumn); +end; + +procedure TcxGridTableView.DoColumnPosChanged(AColumn: TcxGridColumn); +begin + if Assigned(FOnColumnPosChanged) then FOnColumnPosChanged(Self, AColumn); +end; + +procedure TcxGridTableView.DoColumnSizeChanged(AColumn: TcxGridColumn); +begin + if Assigned(FOnColumnSizeChanged) then FOnColumnSizeChanged(Self, AColumn); +end; + +procedure TcxGridTableView.DoCustomDrawColumnHeader(ACanvas: TcxCanvas; + AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean); +begin + if HasCustomDrawColumnHeader then + FOnCustomDrawColumnHeader(Self, ACanvas, AViewInfo, ADone); +end; + +procedure TcxGridTableView.DoCustomDrawFooterCell(ACanvas: TcxCanvas; + AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean); +begin + if HasCustomDrawFooterCell then + FOnCustomDrawFooterCell(Self, ACanvas, AViewInfo, ADone); +end; + +procedure TcxGridTableView.DoCustomDrawGroupCell(ACanvas: TcxCanvas; + AViewInfo: TcxGridTableCellViewInfo; var ADone: Boolean); +begin + if HasCustomDrawGroupCell then + FOnCustomDrawGroupCell(Self, ACanvas, AViewInfo, ADone); +end; + +procedure TcxGridTableView.DoCustomDrawGroupSummaryCell(ACanvas: TcxCanvas; + AViewInfo: TcxCustomGridViewCellViewInfo; var ADone: Boolean); +var + ACell: TcxGridGroupSummaryCellViewInfo; +begin + if HasCustomDrawGroupSummaryCell then + begin + ACell := TcxGridGroupSummaryCellViewInfo(AViewInfo); + FOnCustomDrawGroupSummaryCell(Self, ACanvas, ACell.RowViewInfo.GridRecord, + ACell.Column, ACell.SummaryItem, AViewInfo, ADone); + end; +end; + +procedure TcxGridTableView.DoCustomDrawIndicatorCell(ACanvas: TcxCanvas; + AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); +begin + if HasCustomDrawIndicatorCell then + FOnCustomDrawIndicatorCell(Self, ACanvas, AViewInfo, ADone); +end; + +procedure TcxGridTableView.DoLeftPosChanged; +begin + if Assigned(FOnLeftPosChanged) then FOnLeftPosChanged(Self); +end; + +function TcxGridTableView.HasCustomDrawColumnHeader: Boolean; +begin + Result := Assigned(FOnCustomDrawColumnHeader); +end; + +function TcxGridTableView.HasCustomDrawFooterCell: Boolean; +begin + Result := Assigned(FOnCustomDrawFooterCell); +end; + +function TcxGridTableView.HasCustomDrawGroupCell: Boolean; +begin + Result := Assigned(FOnCustomDrawGroupCell); +end; + +function TcxGridTableView.HasCustomDrawGroupSummaryCell: Boolean; +begin + Result := Assigned(FOnCustomDrawGroupSummaryCell); +end; + +function TcxGridTableView.HasCustomDrawIndicatorCell: Boolean; +begin + Result := Assigned(FOnCustomDrawIndicatorCell); +end; + +function TcxGridTableView.CreateColumn: TcxGridColumn; +begin + Result := TcxGridColumn(CreateItem); +end; + +class function TcxGridTableView.CanBeLookupList: Boolean; +begin + Result := True; +end; + +{ TcxGridColumnAccess } + +class function TcxGridColumnAccess.CanCellMerging(AInstance: TcxGridColumn): Boolean; +begin + Result := AInstance.CanCellMerging; +end; + +class function TcxGridColumnAccess.CanShowGroupFooters(AInstance: TcxGridColumn): Boolean; +begin + Result := AInstance.CanShowGroupFooters; +end; + +class procedure TcxGridColumnAccess.DoCustomDrawGroupSummaryCell(AInstance: TcxGridColumn; + ACanvas: TcxCanvas; AViewInfo: TcxCustomGridViewCellViewInfo; var ADone: Boolean); +begin + AInstance.DoCustomDrawGroupSummaryCell(ACanvas, AViewInfo, ADone); +end; + +class function TcxGridColumnAccess.HasCustomDrawGroupSummaryCell(AInstance: TcxGridColumn): Boolean; +begin + Result := AInstance.HasCustomDrawGroupSummaryCell; +end; + +{ TcxGridTableViewAccess } + +class procedure TcxGridTableViewAccess.DoColumnPosChanged(AInstance: TcxGridTableView; + AColumn: TcxGridColumn); +begin + AInstance.DoColumnPosChanged(AColumn); +end; + +class procedure TcxGridTableViewAccess.DoCustomDrawGroupCell(AInstance: TcxGridTableView; + ACanvas: TcxCanvas; AViewInfo: TcxGridTableCellViewInfo; var ADone: Boolean); +begin + AInstance.DoCustomDrawGroupCell(ACanvas, AViewInfo, ADone); +end; + +class procedure TcxGridTableViewAccess.DoCustomDrawGroupSummaryCell(AInstance: TcxGridTableView; + ACanvas: TcxCanvas; AViewInfo: TcxCustomGridViewCellViewInfo; var ADone: Boolean); +begin + AInstance.DoCustomDrawGroupSummaryCell(ACanvas, AViewInfo, ADone); +end; + +class function TcxGridTableViewAccess.HasCustomDrawGroupCell(AInstance: TcxGridTableView): Boolean; +begin + Result := AInstance.HasCustomDrawGroupCell; +end; + +class function TcxGridTableViewAccess.HasCustomDrawGroupSummaryCell(AInstance: TcxGridTableView): Boolean; +begin + Result := AInstance.HasCustomDrawGroupSummaryCell; +end; + +initialization + cxGridRegisteredViews.Register(TcxGridTableView, 'Table'); + Classes.RegisterClasses([TcxGridColumn, TcxGridTableViewStyleSheet]); + +finalization + cxGridRegisteredViews.Unregister(TcxGridTableView); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridUIBandedTableHelper.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridUIBandedTableHelper.pas new file mode 100644 index 00000000..ce9966ea --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridUIBandedTableHelper.pas @@ -0,0 +1,83 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid Utils } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridUIBandedTableHelper; + +{$I cxVer.inc} + +interface + +uses + Classes, SysUtils, cxGrid, cxGridCustomView, cxGridUIHelper, + cxGridCustomTableView, cxGridUICustomTableHelper, cxGridUITableHelper; + +type + TcxGridBandedTableViewOperationHelper = class(TcxGridTableViewOperationHelper) + protected + procedure RegisterOperations; override; + procedure DoShowBands(const AParameter: TcxCustomGridOperationHelperParameters); + public + class function GetViewClass: TcxCustomGridViewClass; override; + end; + +implementation + +uses + cxGridBandedTableView; + +{ TcxGridBandedTableViewOperationHelper } + +procedure TcxGridBandedTableViewOperationHelper.RegisterOperations; +begin + inherited RegisterOperations; + RegisterOperation(GROP_SHOWBANDS,DoShowBands); +end; + +procedure TcxGridBandedTableViewOperationHelper.DoShowBands( + const AParameter: TcxCustomGridOperationHelperParameters); +begin + If AParameter.IsPerform then + (AParameter.View as TcxGridBandedTableView).OptionsView.BandHeaders := GetShowProperty(AParameter) + else SetShowProperty(AParameter, (AParameter.View as TcxGridBandedTableView).OptionsView.BandHeaders); +end; + +class function TcxGridBandedTableViewOperationHelper.GetViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridBandedTableView; +end; + +initialization + RegisterGridViewOperationHelper(TcxGridBandedTableViewOperationHelper); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridUICardHelper.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridUICardHelper.pas new file mode 100644 index 00000000..1464fc22 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridUICardHelper.pas @@ -0,0 +1,97 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid Utils } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridUICardHelper; + +{$I cxVer.inc} + +interface + +uses + Classes, SysUtils, cxGrid, cxGridCustomView, cxGridUIHelper, + cxGridCustomTableView, cxGridUICustomTableHelper, cxGridCardView; + +type + TcxGridCardViewOperationHelper = class(TcxGridCustomTableViewOperationHelper) + protected + function GetCardViewFromParameter(const AParameter: TcxCustomGridOperationHelperParameters): TcxGridCardView; + procedure RegisterOperations; override; + procedure DoLayoutDirection(const AParameter: TcxCustomGridOperationHelperParameters); + procedure DoShowColumnsCustomizing(const AParameter: TcxCustomGridOperationHelperParameters); + public + class function GetViewClass: TcxCustomGridViewClass; override; + end; + +implementation + +function TcxGridCardViewOperationHelper.GetCardViewFromParameter(const AParameter: TcxCustomGridOperationHelperParameters): TcxGridCardView; +begin + Result := AParameter.View as TcxGridCardView; +end; + +procedure TcxGridCardViewOperationHelper.RegisterOperations; +begin + inherited RegisterOperations; + RegisterOperation(GROP_LAYOUTDIRECTION, DoLayoutDirection); + RegisterOperation(GROP_SHOWCOLUMNCUSTOMIZING, DoShowColumnsCustomizing); +end; + +procedure TcxGridCardViewOperationHelper.DoLayoutDirection( + const AParameter: TcxCustomGridOperationHelperParameters); +const + BoolToLayoutDirection: Array[Boolean] of TcxGridCardViewLayoutDirection = (ldHorizontal, ldVertical); + LayoutDirectionToBool: Array[TcxGridCardViewLayoutDirection] of Boolean = (False,True); +begin + If AParameter.IsPerform then + GetCardViewFromParameter(AParameter).LayoutDirection := + BoolToLayoutDirection[GetShowProperty(AParameter)] + else + SetShowProperty(AParameter,LayoutDirectionToBool[GetCardViewFromParameter(AParameter).LayoutDirection]); +end; + +procedure TcxGridCardViewOperationHelper.DoShowColumnsCustomizing(const AParameter: TcxCustomGridOperationHelperParameters); +begin + if AParameter.IsPerform then + GetCardViewFromParameter(AParameter).Controller.Customization := GetShowProperty(AParameter) + else SetShowProperty(AParameter, GetCardViewFromParameter(AParameter).Controller.Customization); +end; + +class function TcxGridCardViewOperationHelper.GetViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridCardView; +end; + +initialization + RegisterGridViewOperationHelper(TcxGridCardViewOperationHelper); +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridUICustomTableHelper.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridUICustomTableHelper.pas new file mode 100644 index 00000000..3084ba28 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridUICustomTableHelper.pas @@ -0,0 +1,99 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid Utils } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridUICustomTableHelper; + +{$I cxVer.inc} + +interface + +uses + Classes, SysUtils, cxGrid, cxGridCustomView, cxGridUIHelper, + cxGridCustomTableView; + +type + TcxGridCustomTableViewOperationHelper = class(TcxCustomGridViewOperationHelper) + protected + procedure RegisterOperations; override; + procedure DoCopyToClipboard(const AParameter: TcxCustomGridOperationHelperParameters); + procedure DoShowEditButtons(const AParameter: TcxCustomGridOperationHelperParameters); + public + class function GetViewClass: TcxCustomGridViewClass; override; + end; + +implementation + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + cxGridTableView, DB, cxGridDBDataDefinitions; + +{ TcxGridCustomTableViewOperationHelper } +procedure TcxGridCustomTableViewOperationHelper.RegisterOperations; +begin + inherited RegisterOperations; + RegisterOperation(GROP_SHOWEDITBUTTONS, DoShowEditButtons); + RegisterOperation(GROP_COPYTOCLIPBOARD, DoCopyToClipboard); +end; + +procedure TcxGridCustomTableViewOperationHelper.DoCopyToClipboard( + const AParameter: TcxCustomGridOperationHelperParameters); +begin + TcxCustomGridTableView(AParameter.View).CopyToClipboard(False); +end; + +procedure TcxGridCustomTableViewOperationHelper.DoShowEditButtons( + const AParameter: TcxCustomGridOperationHelperParameters); +const + ShowEditButtonsToBool: Array[TcxGridShowEditButtons] of Boolean = (False, False, True); + BoolToShowEditButtons: Array[Boolean] of TcxGridShowEditButtons = (gsebNever, gsebAlways); +begin + if AParameter.IsPerform then + TcxCustomGridTableView(AParameter.View).OptionsView.ShowEditButtons := + BoolToShowEditButtons[GetShowProperty(AParameter)] + else + SetShowProperty(AParameter, + ShowEditButtonsToBool[TcxCustomGridTableView(AParameter.View).OptionsView.ShowEditButtons]); +end; + +class function TcxGridCustomTableViewOperationHelper.GetViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridTableView; +end; + +initialization + RegisterGridViewOperationHelper(TcxGridCustomTableViewOperationHelper); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridUIHelper.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridUIHelper.pas new file mode 100644 index 00000000..f3789f04 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridUIHelper.pas @@ -0,0 +1,748 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid Utils } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridUIHelper; + +{$I cxVer.inc} + +interface + +uses + Classes, SysUtils, cxGrid, cxGridCustomView; + +const + GROP_FIRST = 0; + GROP_LAST = 1; + GROP_PREV = 2; + GROP_NEXT = 3; + GROP_INSERT = 4; + GROP_DELETE = 5; + GROP_COPYTOCLIPBOARD = 6; + + GROP_SHOWCOLUMNCUSTOMIZING = 100; + GROP_SHOWGROUPINGPANEL = 101; + GROP_SHOWINDICATOR = 102; + GROP_INVERTSELECT = 103; + GROP_SHOWHEADERS = 104; + GROP_SHOWSUMMARYFOOTER = 105; + GROP_SHOWBANDS = 106; + GROP_SHOWGRID = 107; + GROP_COLUMNAUTOWIDTH = 108; + GROP_SHOWPREVIEW = 109; + GROP_SHOWEDITBUTTONS = 110; + GROP_LAYOUTDIRECTION = 111; + +type + TcxCustomGridOperationHelperParameters = class + private + FView: TcxCustomGridView; + FIsPerform: Boolean; + public + constructor Create(AView: TcxCustomGridView; AIsPerform: Boolean = True); virtual; + property View: TcxCustomGridView read FView; + property IsPerform: Boolean read FIsPerform; + end; + + TcxShowingGridOperationHelperParameters = class(TcxCustomGridOperationHelperParameters) + private + FShowing: Boolean; + public + property Showing: Boolean read FShowing write FShowing; + end; + + TcxGridOperationHelperProc = procedure(const AParameter: TcxCustomGridOperationHelperParameters) of object; + + TcxCustomGridViewOperationHelper = class + private + FList: TList; + protected + procedure RegisterOperation(AOperationIndex: Integer; const AProc: TcxGridOperationHelperProc); + procedure RegisterOperations; virtual; + function GetShowProperty(const AParameter: TcxCustomGridOperationHelperParameters): Boolean; + procedure SetShowProperty(const AParameter: TcxCustomGridOperationHelperParameters; AShow: Boolean); + + procedure DoFirst(const AParameter: TcxCustomGridOperationHelperParameters); + procedure DoLast(const AParameter: TcxCustomGridOperationHelperParameters); + procedure DoNext(const AParameter: TcxCustomGridOperationHelperParameters); + procedure DoPrev(const AParameter: TcxCustomGridOperationHelperParameters); + procedure DoInsert(const AParameter: TcxCustomGridOperationHelperParameters); + procedure DoDelete(const AParameter: TcxCustomGridOperationHelperParameters); + public + constructor Create; virtual; + destructor Destroy; override; + + class function GetViewClass: TcxCustomGridViewClass; virtual; + function IsOperationAccessible(AOperationIndex: Integer): Boolean; virtual; + function IsOperationEnabled(AView: TcxCustomGridView; AOperationIndex: Integer): Boolean; virtual; + procedure PerformOperation(AOperationIndex: Integer; const AParameter: TcxCustomGridOperationHelperParameters); virtual; + end; + + TcxCustomGridViewOperationHelperClass = class of TcxCustomGridViewOperationHelper; + + TcxCustomGridOperationHelper = class(TComponent) + private + FFocusedViewChangedNotification: TcxCustomGridNotification; + FGrid: TcxGrid; + FOnUpdateOperations: TNotifyEvent; + FOnFocusedRecordChanged: TNotifyEvent; + FOnCustomizationFormVisibleChanged: TNotifyEvent; + + function GetIsOperationAccessible(AOperationIndex: Integer): Boolean; + function GetIsOperationEnabled(AOperationIndex: Integer): Boolean; + function GetIsOperationShowing(AOperationIndex: Integer): Boolean; + procedure SetGrid(const Value: TcxGrid); + + //TODO Sender should be TObject?? + procedure DoFocusedViewChanged; + protected + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure DoUpdateOperations; dynamic; + procedure DoFocusedRecordChanged; dynamic; + procedure DoCustomizationFormVisibleChanged; dynamic; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + function FocusedView: TcxCustomGridView; + function FocusedViewClass: TcxCustomGridViewClass; + + procedure PerformOperation(AOperationIndex: Integer; const AParameters: TcxCustomGridOperationHelperParameters); + procedure PerformStarndardOperation(AOperationIndex: Integer); + procedure PerformShowingOperation(AOperationIndex: Integer; AShow: Boolean); + + property IsOperationAccessible[AOperationIndex: Integer]: Boolean read GetIsOperationAccessible; + property IsOperationEnabled[AOperationIndex: Integer]: Boolean read GetIsOperationEnabled; + property IsOperationShowing[AOperationIndex: Integer]: Boolean read GetIsOperationShowing; + public + procedure DoFirst; + procedure DoLast; + procedure DoNext; + procedure DoPrev; + procedure DoInsert; + procedure DoDelete; + procedure CopyToClipboard; + + procedure DoShowColumnCustomizing(AShow: Boolean); + procedure DoShowGroupingPanel(AShow: Boolean); + procedure DoShowHeaders(AShow: Boolean); + procedure DoShowBands(AShow: Boolean); + procedure DoShowSummaryFooter(AShow: Boolean); + procedure DoShowGrid(AShow: Boolean); + procedure DoColumnAutoWidth(AShow: Boolean); + procedure DoShowPreview(AShow: Boolean); + procedure DoShowEditButtons(AShow: Boolean); + procedure DoLayoutDirection(AShow: Boolean); + procedure DoInvertSelect(AShow: Boolean); + procedure DoShowIndicator(AShow: Boolean); + + function IsColumnsCustomizingShowing: Boolean; + function IsGroupingPanelShowing: Boolean; + function IsHeadersShowing: Boolean; + function IsBandsShowing: Boolean; + function IsSummaryFooterShowing: Boolean; + function IsGridShowing: Boolean; + function IsColumnAutoWidth: Boolean; + function IsShowPreview: Boolean; + function IsShowEditButtons: Boolean; + function IsVertLayoutDirection: Boolean; + function IsInvertSelect: Boolean; + function IsShowIndicator: Boolean; + + property Grid: TcxGrid read FGrid write SetGrid; + property OnUpdateOperations: TNotifyEvent read FOnUpdateOperations write FOnUpdateOperations; + property onFocusedRecordChanged: TNotifyEvent read FOnFocusedRecordChanged write FOnFocusedRecordChanged; + property OnCustomizationFormVisibleChanged: TNotifyEvent read FOnCustomizationFormVisibleChanged + write FOnCustomizationFormVisibleChanged; + end; + + TcxGridOperationHelper = class(TcxCustomGridOperationHelper) + published + property Grid; + property OnUpdateOperations; + end; + + procedure RegisterGridViewOperationHelper(AGridViewOperationHelperClass: TcxCustomGridViewOperationHelperClass); + procedure UnregisterGridViewOperationHelper(AGridViewOperationHelperClass: TcxCustomGridViewOperationHelperClass); + function GetGridViewOperationHelperByGridViewClass(const AGridViewClass: TcxCustomGridViewClass): TcxCustomGridViewOperationHelper; + +implementation + +uses + cxCustomData, cxGridCustomTableView; + +type + TcxCustomGridViewOperationHelperRec = record + Index: Integer; + Proc: TcxGridOperationHelperProc; + end; + + PcxCustomGridViewOperationHelperRec = ^TcxCustomGridViewOperationHelperRec; + + TcxGridNotifications = class(TcxCustomGridNotification) + private + FGridOperationHelper: TcxCustomGridOperationHelper; + protected + procedure Notify(AKind: TcxGridNotificationKind; AData: TObject; var AHandled: Boolean); override; + function NotificationKinds: TcxGridNotificationKinds; override; + end; + + procedure TcxGridNotifications.Notify(AKind: TcxGridNotificationKind; AData: TObject; + var AHandled: Boolean); + begin + case AKind of + gnkFocusedViewChanged: + FGridOperationHelper.DoFocusedViewChanged; + gnkFocusedRecordChanged, gnkRecordCountChanged: + FGridOperationHelper.DoFocusedRecordChanged; + gnkCustomization: + FGridOperationHelper.DoCustomizationFormVisibleChanged; + end; + end; + + function TcxGridNotifications.NotificationKinds: TcxGridNotificationKinds; + begin + Result := [gnkFocusedViewChanged, gnkFocusedRecordChanged, gnkRecordCountChanged, gnkCustomization]; + end; + +{ TcxCustomGridOperationHelperParameters } +constructor TcxCustomGridOperationHelperParameters.Create( + AView: TcxCustomGridView; AIsPerform: Boolean = True); +begin + inherited Create; + FView := AView; + FIsPerform := AIsPerform; +end; + +{ TcxCustomGridViewOperationHelper } +constructor TcxCustomGridViewOperationHelper.Create; +begin + inherited Create; + FList := TList.Create; + RegisterOperations; +end; + +destructor TcxCustomGridViewOperationHelper.Destroy; +var + I: Integer; +begin + for I := 0 to FList.Count - 1 do + Dispose(PcxCustomGridViewOperationHelperRec(FList[I])); + FList.Free; + inherited Destroy; +end; + +class function TcxCustomGridViewOperationHelper.GetViewClass: TcxCustomGridViewClass; +begin + Result := TcxCustomGridView; +end; + +procedure TcxCustomGridViewOperationHelper.RegisterOperation(AOperationIndex: Integer; const AProc: TcxGridOperationHelperProc); +var + ARec: PcxCustomGridViewOperationHelperRec; +begin + New(ARec); + ARec.Index := AOperationIndex; + ARec.Proc := AProc; + FList.Add(ARec); +end; + +procedure TcxCustomGridViewOperationHelper.RegisterOperations; +begin + RegisterOperation(GROP_FIRST, DoFirst); + RegisterOperation(GROP_LAST, DoLast); + RegisterOperation(GROP_NEXT, DoNext); + RegisterOperation(GROP_PREV, DoPrev); + RegisterOperation(GROP_INSERT, DoInsert); + RegisterOperation(GROP_DELETE, DoDelete); +end; + +function TcxCustomGridViewOperationHelper.IsOperationAccessible(AOperationIndex: Integer): Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to FList.Count - 1 do + if PcxCustomGridViewOperationHelperRec(FList[I]).Index = AOperationIndex then + begin + Result := True; + break; + end; +end; + +function TcxCustomGridViewOperationHelper.IsOperationEnabled(AView: TcxCustomGridView; AOperationIndex: Integer): Boolean; + + function CanDelete: Boolean; + begin + Result := dceoDelete in AView.DataController.EditOperations; + if Result and (AView is TcxCustomGridTableView) then + Result := TcxCustomGridTableView(AView).OptionsData.Deleting; + end; + + function CanInsert: Boolean; + begin + Result := dceoInsert in AView.DataController.EditOperations;; + if Result and (AView is TcxCustomGridTableView) then + Result := TcxCustomGridTableView(AView).OptionsData.Inserting; + end; + +begin + Result := True; + case AOperationIndex of + GROP_FIRST, GROP_PREV: + Result := AView.DataController.Active and not AView.DataController.IsBOF; + GROP_LAST, GROP_NEXT: + Result := AView.DataController.Active and not AView.DataController.IsEOF; + GROP_INSERT: + Result := AView.DataController.Active and CanInsert; + GROP_DELETE: + Result := AView.DataController.Active and CanDelete; + end; +end; + +procedure TcxCustomGridViewOperationHelper.PerformOperation(AOperationIndex: Integer; const AParameter: TcxCustomGridOperationHelperParameters); +var + I: Integer; +begin + for I := 0 to FList.Count - 1 do + if PcxCustomGridViewOperationHelperRec(FList[I]).Index = AOperationIndex then + begin + PcxCustomGridViewOperationHelperRec(FList[I]).Proc(AParameter); + break; + end; +end; + +function TcxCustomGridViewOperationHelper.GetShowProperty( + const AParameter: TcxCustomGridOperationHelperParameters): Boolean; +begin + if AParameter is TcxShowingGridOperationHelperParameters then + Result := (AParameter as TcxShowingGridOperationHelperParameters).Showing + else Result := False; +end; + +procedure TcxCustomGridViewOperationHelper.SetShowProperty( + const AParameter: TcxCustomGridOperationHelperParameters; AShow: Boolean); +begin + if AParameter is TcxShowingGridOperationHelperParameters then + (AParameter as TcxShowingGridOperationHelperParameters).Showing := AShow; +end; + +procedure TcxCustomGridViewOperationHelper.DoFirst(const AParameter: TcxCustomGridOperationHelperParameters); +begin + AParameter.View.DataController.GotoFirst; +end; + +procedure TcxCustomGridViewOperationHelper.DoLast(const AParameter: TcxCustomGridOperationHelperParameters); +begin + AParameter.View.DataController.GotoLast; +end; + +procedure TcxCustomGridViewOperationHelper.DoNext(const AParameter: TcxCustomGridOperationHelperParameters); +begin + AParameter.View.DataController.GotoNext; +end; + +procedure TcxCustomGridViewOperationHelper.DoPrev(const AParameter: TcxCustomGridOperationHelperParameters); +begin + AParameter.View.DataController.GotoPrev; +end; + +procedure TcxCustomGridViewOperationHelper.DoInsert(const AParameter: TcxCustomGridOperationHelperParameters); +begin + AParameter.View.DataController.Insert; +end; + +procedure TcxCustomGridViewOperationHelper.DoDelete(const AParameter: TcxCustomGridOperationHelperParameters); +begin + if AParameter.View.DataController.GetSelectedCount > 0 then + AParameter.View.DataController.DeleteSelection + else AParameter.View.DataController.DeleteFocused; +end; + +{ TcxCustomGridToolBarHelper } +constructor TcxCustomGridOperationHelper.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FFocusedViewChangedNotification := TcxGridNotifications.Create; + TcxGridNotifications(FFocusedViewChangedNotification).FGridOperationHelper := Self; +end; + +destructor TcxCustomGridOperationHelper.Destroy; +begin + Grid := nil; + FreeAndNil(FFocusedViewChangedNotification); + inherited Destroy; +end; + +procedure TcxCustomGridOperationHelper.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (AComponent = Grid) then + FGrid := nil; +end; + +procedure TcxCustomGridOperationHelper.DoUpdateOperations; +begin + if Assigned(FOnUpdateOperations) then + FOnUpdateOperations(self); +end; + +procedure TcxCustomGridOperationHelper.DoFocusedRecordChanged; +begin + if Assigned(FOnFocusedRecordChanged) then + FOnFocusedRecordChanged(self); +end; + +procedure TcxCustomGridOperationHelper.DoCustomizationFormVisibleChanged; +begin + if Assigned(FonCustomizationFormVisibleChanged) then + FonCustomizationFormVisibleChanged(self); +end; + +function TcxCustomGridOperationHelper.FocusedView: TcxCustomGridView; +begin + if Grid <> nil then + Result := Grid.FocusedView + else Result := nil; +end; + +function TcxCustomGridOperationHelper.FocusedViewClass: TcxCustomGridViewClass; +begin + if FocusedView <> nil then + Result := TcxCustomGridViewClass(FocusedView.ClassType) + else Result := nil; +end; + +procedure TcxCustomGridOperationHelper.PerformOperation(AOperationIndex: Integer; + const AParameters: TcxCustomGridOperationHelperParameters); +begin + if IsOperationEnabled[AOperationIndex] then + GetGridViewOperationHelperByGridViewClass( + FocusedViewClass).PerformOperation(AOperationIndex, AParameters); +end; + +function TcxCustomGridOperationHelper.GetIsOperationAccessible(AOperationIndex: Integer): Boolean; +var + AGridViewHelper: TcxCustomGridViewOperationHelper; +begin + if FocusedView <> nil then + begin + AGridViewHelper := GetGridViewOperationHelperByGridViewClass(FocusedViewClass); + Result := (AGridViewHelper <> nil) and AGridViewHelper.IsOperationAccessible(AOperationIndex); + end else Result := False; +end; + +function TcxCustomGridOperationHelper.GetIsOperationEnabled(AOperationIndex: Integer): Boolean; +begin + Result := IsOperationAccessible[AOperationIndex] and + GetGridViewOperationHelperByGridViewClass( + FocusedViewClass).IsOperationEnabled(FocusedView, AOperationIndex); +end; + +procedure TcxCustomGridOperationHelper.DoFocusedViewChanged; +begin + if not (csDestroying in ComponentState) and not (csDesigning in ComponentState) and + (Grid <> nil) and not (csDestroying in Grid.ComponentState) then + DoUpdateOperations; +end; + +procedure TcxCustomGridOperationHelper.SetGrid(const Value: TcxGrid); +begin + if FGrid <> Value then + begin + if (FGrid <> nil) and not (csDestroying in FGrid.ComponentState) then + begin + FGrid.RemoveFreeNotification(self); + FGrid.UnregisterNotification(FFocusedViewChangedNotification); + end; + FGrid := Value; + if FGrid <> nil then + begin + FGrid.FreeNotification(self); + FGrid.RegisterNotification(FFocusedViewChangedNotification); + end; + end; +end; + +procedure TcxCustomGridOperationHelper.PerformStarndardOperation(AOperationIndex: Integer); +var + AParameters: TcxCustomGridOperationHelperParameters; +begin + AParameters := TcxCustomGridOperationHelperParameters.Create(FocusedView); + try + PerformOperation(AOperationIndex, AParameters); + finally + AParameters.Free; + end; +end; + +procedure TcxCustomGridOperationHelper.PerformShowingOperation(AOperationIndex: Integer; AShow: Boolean); +var + AParameters: TcxShowingGridOperationHelperParameters; +begin + AParameters := TcxShowingGridOperationHelperParameters.Create(FocusedView); + AParameters.Showing := AShow; + try + PerformOperation(AOperationIndex, AParameters); + finally + AParameters.Free; + end; +end; + +function TcxCustomGridOperationHelper.GetIsOperationShowing(AOperationIndex: Integer): Boolean; +var + AParameters: TcxShowingGridOperationHelperParameters; +begin + AParameters := TcxShowingGridOperationHelperParameters.Create(FocusedView, False); + try + PerformOperation(AOperationIndex, AParameters); + Result := AParameters.Showing; + finally + AParameters.Free; + end; +end; + +procedure TcxCustomGridOperationHelper.DoFirst; +begin + PerformStarndardOperation(GROP_FIRST); +end; + +procedure TcxCustomGridOperationHelper.DoLast; +begin + PerformStarndardOperation(GROP_LAST); +end; + +procedure TcxCustomGridOperationHelper.DoNext; +begin + PerformStarndardOperation(GROP_NEXT); +end; + +procedure TcxCustomGridOperationHelper.DoPrev; +begin + PerformStarndardOperation(GROP_PREV); +end; + +procedure TcxCustomGridOperationHelper.DoInsert; +begin + PerformStarndardOperation(GROP_INSERT); +end; + +procedure TcxCustomGridOperationHelper.DoDelete; +begin + PerformStarndardOperation(GROP_DELETE); +end; + +procedure TcxCustomGridOperationHelper.CopyToClipboard; +begin + PerformStarndardOperation(GROP_COPYTOCLIPBOARD); +end; + +procedure TcxCustomGridOperationHelper.DoShowColumnCustomizing(AShow: Boolean); +begin + PerformShowingOperation(GROP_SHOWCOLUMNCUSTOMIZING, AShow); +end; + +procedure TcxCustomGridOperationHelper.DoShowGroupingPanel(AShow: Boolean); +begin + PerformShowingOperation(GROP_SHOWGROUPINGPANEL, AShow); +end; + +procedure TcxCustomGridOperationHelper.DoShowHeaders(AShow: Boolean); +begin + PerformShowingOperation(GROP_SHOWHEADERS, AShow); +end; + +procedure TcxCustomGridOperationHelper.DoShowBands(AShow: Boolean); +begin + PerformShowingOperation(GROP_SHOWBANDS, AShow); +end; + +procedure TcxCustomGridOperationHelper.DoShowSummaryFooter(AShow: Boolean); +begin + PerformShowingOperation(GROP_SHOWSUMMARYFOOTER, AShow); +end; + +procedure TcxCustomGridOperationHelper.DoShowGrid(AShow: Boolean); +begin + PerformShowingOperation(GROP_SHOWGRID, AShow); +end; + +procedure TcxCustomGridOperationHelper.DoColumnAutoWidth(AShow: Boolean); +begin + PerformShowingOperation(GROP_COLUMNAUTOWIDTH, AShow); +end; + +procedure TcxCustomGridOperationHelper.DoShowPreview(AShow: Boolean); +begin + PerformShowingOperation(GROP_SHOWPREVIEW, AShow); +end; + +procedure TcxCustomGridOperationHelper.DoShowEditButtons(AShow: Boolean); +begin + PerformShowingOperation(GROP_SHOWEDITBUTTONS, AShow); +end; + +procedure TcxCustomGridOperationHelper.DoLayoutDirection(AShow: Boolean); +begin + PerformShowingOperation(GROP_LAYOUTDIRECTION, AShow); +end; + +procedure TcxCustomGridOperationHelper.DoInvertSelect(AShow: Boolean); +begin + PerformShowingOperation(GROP_INVERTSELECT, AShow); +end; + +procedure TcxCustomGridOperationHelper.DoShowIndicator(AShow: Boolean); +begin + PerformShowingOperation(GROP_SHOWINDICATOR, AShow); +end; + +function TcxCustomGridOperationHelper.IsColumnsCustomizingShowing: Boolean; +begin + Result := IsOperationShowing[GROP_SHOWCOLUMNCUSTOMIZING]; +end; + +function TcxCustomGridOperationHelper.IsGroupingPanelShowing: Boolean; +begin + Result := IsOperationShowing[GROP_SHOWGROUPINGPANEL]; +end; + +function TcxCustomGridOperationHelper.IsHeadersShowing: Boolean; +begin + Result := IsOperationShowing[GROP_SHOWHEADERS]; +end; + +function TcxCustomGridOperationHelper.IsBandsShowing: Boolean; +begin + Result := IsOperationShowing[GROP_SHOWBANDS]; +end; + +function TcxCustomGridOperationHelper.IsSummaryFooterShowing: Boolean; +begin + Result := IsOperationShowing[GROP_SHOWSUMMARYFOOTER]; +end; + +function TcxCustomGridOperationHelper.IsGridShowing: Boolean; +begin + Result := IsOperationShowing[GROP_SHOWGRID]; +end; + +function TcxCustomGridOperationHelper.IsColumnAutoWidth: Boolean; +begin + Result := IsOperationShowing[GROP_COLUMNAUTOWIDTH]; +end; + +function TcxCustomGridOperationHelper.IsShowPreview: Boolean; +begin + Result := IsOperationShowing[GROP_SHOWPREVIEW]; +end; + +function TcxCustomGridOperationHelper.IsShowEditButtons: Boolean; +begin + Result := IsOperationShowing[GROP_SHOWEDITBUTTONS]; +end; + +function TcxCustomGridOperationHelper.IsVertLayoutDirection: Boolean; +begin + Result := IsOperationShowing[GROP_LAYOUTDIRECTION]; +end; + +function TcxCustomGridOperationHelper.IsInvertSelect: Boolean; +begin + Result := IsOperationShowing[GROP_INVERTSELECT]; +end; + +function TcxCustomGridOperationHelper.IsShowIndicator: Boolean; +begin + Result := IsOperationShowing[GROP_SHOWINDICATOR]; +end; + +var + FGridViewOperationHelperList: TList = nil; + +procedure RegisterGridViewOperationHelper(AGridViewOperationHelperClass: TcxCustomGridViewOperationHelperClass); +begin + FGridViewOperationHelperList.Add(AGridViewOperationHelperClass.Create); +end; + +procedure UnregisterGridViewOperationHelper(AGridViewOperationHelperClass: TcxCustomGridViewOperationHelperClass); +var + I: Integer; +begin + for I := 0 to FGridViewOperationHelperList.Count - 1 do + if TcxCustomGridViewOperationHelper(FGridViewOperationHelperList[I]).ClassType = AGridViewOperationHelperClass then + begin + TcxCustomGridViewOperationHelper(FGridViewOperationHelperList[I]).Free; + FGridViewOperationHelperList.Delete(I); + end; +end; + +function GetGridViewOperationHelperByGridViewClass(const AGridViewClass: TcxCustomGridViewClass): TcxCustomGridViewOperationHelper; +var + AItem: TcxCustomGridViewOperationHelper; + I: Integer; +begin + Result := nil; + for I := 0 to FGridViewOperationHelperList.Count - 1 do + begin + AItem := TcxCustomGridViewOperationHelper(FGridViewOperationHelperList[I]); + if AItem.GetViewClass = AGridViewClass then + begin + Result := AItem; + break; + end; + if AGridViewClass.InheritsFrom(AItem.GetViewClass) then + if (Result = nil) or not Result.InheritsFrom(AItem.GetViewClass) then + Result := AItem; + end; +end; + +procedure ClearGridViewOperationHelperList; +var + I: Integer; +begin + for I := 0 to FGridViewOperationHelperList.Count - 1 do + TcxCustomGridViewOperationHelper(FGridViewOperationHelperList[I]).Free; + FGridViewOperationHelperList.Clear; +end; + +initialization + FGridViewOperationHelperList := TList.Create; + RegisterGridViewOperationHelper(TcxCustomGridViewOperationHelper); + +finalization + ClearGridViewOperationHelperList; + FGridViewOperationHelperList.Free; + FGridViewOperationHelperList := nil; +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridUITableHelper.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridUITableHelper.pas new file mode 100644 index 00000000..f807517b --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridUITableHelper.pas @@ -0,0 +1,197 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid Utils } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridUITableHelper; + +{$I cxVer.inc} + +interface + +uses + Classes, SysUtils, cxGrid, cxGridCustomView, cxGridUIHelper, + cxGridCustomTableView, cxGridUICustomTableHelper; + +type + TcxGridTableViewOperationHelper = class(TcxGridCustomTableViewOperationHelper) + protected + procedure RegisterOperations; override; + procedure DoShowColumnsCustomizing(const AParameter: TcxCustomGridOperationHelperParameters); + procedure DoShowGroupingPanel(const AParameter: TcxCustomGridOperationHelperParameters); + procedure DoShowSummaryFooter(const AParameter: TcxCustomGridOperationHelperParameters); + procedure DoShowGrid(const AParameter: TcxCustomGridOperationHelperParameters); + procedure DoColumnAutoWidth(const AParameter: TcxCustomGridOperationHelperParameters); + procedure DoShowPreview(const AParameter: TcxCustomGridOperationHelperParameters); + procedure DoShowHeaders(const AParameter: TcxCustomGridOperationHelperParameters); + procedure DoShowColumnCustomize(const AParameter: TcxCustomGridOperationHelperParameters); + procedure DoInvertSelect(const AParameter: TcxCustomGridOperationHelperParameters); + procedure DoShowIndicator(const AParameter: TcxCustomGridOperationHelperParameters); + public + class function GetViewClass: TcxCustomGridViewClass; override; + function IsOperationEnabled(AView: TcxCustomGridView; AOperationIndex: Integer): Boolean; override; + end; + +implementation + +uses + cxGridTableView, cxGraphics; + +//TODO move SHow/Hide to public + +{ TcxGridTableViewOperationHelper } +procedure TcxGridTableViewOperationHelper.RegisterOperations; +begin + inherited RegisterOperations; + RegisterOperation(GROP_SHOWCOLUMNCUSTOMIZING, DoShowColumnsCustomizing); + RegisterOperation(GROP_SHOWGROUPINGPANEL, DoShowGroupingPanel); + RegisterOperation(GROP_SHOWSUMMARYFOOTER, DoShowSummaryFooter); + RegisterOperation(GROP_SHOWGRID, DoShowGrid); + RegisterOperation(GROP_COLUMNAUTOWIDTH, DoColumnAutoWidth); + RegisterOperation(GROP_SHOWPREVIEW, DoShowPreview); + RegisterOperation(GROP_SHOWHEADERS, DoShowHeaders); + RegisterOperation(GROP_SHOWCOLUMNCUSTOMIZING, DoShowColumnCustomize); + RegisterOperation(GROP_INVERTSELECT, DoInvertSelect); + RegisterOperation(GROP_SHOWINDICATOR, DoShowIndicator); +end; + +procedure TcxGridTableViewOperationHelper.DoShowColumnsCustomizing( + const AParameter: TcxCustomGridOperationHelperParameters); +begin + if AParameter.IsPerform then + (AParameter.View as TcxGridTableView).Controller.Customization := GetShowProperty(AParameter) + else SetShowProperty(AParameter, (AParameter.View as TcxGridTableView).Controller.Customization); +end; + +procedure TcxGridTableViewOperationHelper.DoShowGroupingPanel( + const AParameter: TcxCustomGridOperationHelperParameters); +begin + if AParameter.IsPerform then + (AParameter.View as TcxGridTableView).OptionsView.GroupByBox := GetShowProperty(AParameter) + else SetShowProperty(AParameter, (AParameter.View as TcxGridTableView).OptionsView.GroupByBox); +end; + +procedure TcxGridTableViewOperationHelper.DoShowSummaryFooter( + const AParameter: TcxCustomGridOperationHelperParameters); +begin + if AParameter.IsPerform then + (AParameter.View as TcxGridTableView).OptionsView.Footer := GetShowProperty(AParameter) + else SetShowProperty(AParameter, (AParameter.View as TcxGridTableView).OptionsView.Footer); +end; + +procedure TcxGridTableViewOperationHelper.DoShowGrid( + const AParameter: TcxCustomGridOperationHelperParameters); +const + GridLinesToBool: Array[TcxGridLines] of Boolean = (True, False, False, False); + BoolToGridLines: Array[Boolean] of TcxGridLines = (glNone, glBoth); +begin + if AParameter.IsPerform then + (AParameter.View as TcxGridTableView).OptionsView.GridLines := BoolToGridLines[GetShowProperty(AParameter)] + else SetShowProperty(AParameter, GridLinesToBool[(AParameter.View as TcxGridTableView).OptionsView.GridLines]); +end; + +procedure TcxGridTableViewOperationHelper.DoColumnAutoWidth( + const AParameter: TcxCustomGridOperationHelperParameters); +begin + if AParameter.IsPerform then + (AParameter.View as TcxGridTableView).OptionsView.ColumnAutoWidth := GetShowProperty(AParameter) + else SetShowProperty(AParameter, (AParameter.View as TcxGridTableView).OptionsView.ColumnAutoWidth); +end; + +procedure TcxGridTableViewOperationHelper.DoShowPreview( + const AParameter: TcxCustomGridOperationHelperParameters); +begin + if AParameter.IsPerform then + (AParameter.View as TcxGridTableView).Preview.Visible := GetShowProperty(AParameter) + else SetShowProperty(AParameter, (AParameter.View as TcxGridTableView).Preview.Visible); +end; + +procedure TcxGridTableViewOperationHelper.DoShowHeaders( + const AParameter: TcxCustomGridOperationHelperParameters); +begin + if AParameter.IsPerform then + (AParameter.View as TcxGridTableView).OptionsView.Header := GetShowProperty(AParameter) + else SetShowProperty(AParameter, (AParameter.View as TcxGridTableView).OptionsView.Header); +end; + +class function TcxGridTableViewOperationHelper.GetViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridTableView; +end; + +function TcxGridTableViewOperationHelper.IsOperationEnabled(AView: TcxCustomGridView; + AOperationIndex: Integer): Boolean; +begin + case AOperationIndex of + GROP_SHOWINDICATOR: + Result := not (AView as TcxGridTableView).ViewInfo.IndicatorViewInfo.AlwaysVisible; + GROP_SHOWPREVIEW: + Result := (AView as TcxGridTableView).Preview.Column <> nil; + else + Result := inherited IsOperationEnabled(AView, AOperationIndex); + end; +end; + +procedure TcxGridTableViewOperationHelper.DoShowColumnCustomize( + const AParameter: TcxCustomGridOperationHelperParameters); +begin + if AParameter.IsPerform then + TcxGridTableView(AParameter.View).Controller.Customization := + TcxShowingGridOperationHelperParameters(AParameter).Showing + else SetShowProperty(AParameter, + TcxGridTableView(AParameter.View).Controller.Customization); +end; + +procedure TcxGridTableViewOperationHelper.DoInvertSelect( + const AParameter: TcxCustomGridOperationHelperParameters); +begin + if AParameter.IsPerform then + TcxGridTableView(AParameter.View).OptionsSelection.InvertSelect := + TcxShowingGridOperationHelperParameters(AParameter).Showing + else SetShowProperty(AParameter, + TcxGridTableView(AParameter.View).OptionsSelection.InvertSelect); +end; + +procedure TcxGridTableViewOperationHelper.DoShowIndicator( + const AParameter: TcxCustomGridOperationHelperParameters); +begin + if AParameter.IsPerform then + TcxGridTableView(AParameter.View).OptionsView.Indicator := + TcxShowingGridOperationHelperParameters(AParameter).Showing + else SetShowProperty(AParameter, + TcxGridTableView(AParameter.View).OptionsView.Indicator); +end; + +initialization + RegisterGridViewOperationHelper(TcxGridTableViewOperationHelper); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridVer.inc b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridVer.inc new file mode 100644 index 00000000..b2c3e840 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridVer.inc @@ -0,0 +1 @@ +{$DEFINE USETABCONTROL} diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridViewLayoutEditor.dfm b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridViewLayoutEditor.dfm new file mode 100644 index 00000000..f4520c95 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridViewLayoutEditor.dfm @@ -0,0 +1,110 @@ +object cxGridViewLayoutEditor: TcxGridViewLayoutEditor + Left = 350 + Top = 204 + BorderIcons = [biSystemMenu] + Caption = 'Layout and Data Editor' + ClientHeight = 466 + ClientWidth = 692 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object pnlBottom: TPanel + Left = 0 + Top = 432 + Width = 692 + Height = 34 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + object pnlButtons: TPanel + Left = 523 + Top = 0 + Width = 169 + Height = 34 + Align = alRight + BevelOuter = bvNone + TabOrder = 2 + object btnOK: TcxButton + Left = 4 + Top = 5 + Width = 75 + Height = 24 + Caption = 'OK' + ModalResult = 1 + TabOrder = 0 + end + object btnCancel: TcxButton + Left = 89 + Top = 5 + Width = 75 + Height = 24 + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + end + object pnlLayoutCustomization: TPanel + Left = 0 + Top = 0 + Width = 153 + Height = 34 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object btnLayoutCustomization: TcxButton + Left = 8 + Top = 5 + Width = 134 + Height = 24 + TabOrder = 0 + OnClick = btnLayoutCustomizationClick + end + end + object pnlSaveOptions: TPanel + Left = 153 + Top = 0 + Width = 192 + Height = 34 + Align = alLeft + BevelOuter = bvNone + TabOrder = 1 + object chbSaveLayout: TcxCheckBox + Left = 11 + Top = 7 + Caption = 'Save layout' + State = cbsChecked + TabOrder = 0 + Width = 81 + end + object chbSaveData: TcxCheckBox + Left = 107 + Top = 7 + Caption = 'Save data' + State = cbsChecked + TabOrder = 1 + Width = 81 + end + end + end + object pnlClient: TPanel + Left = 0 + Top = 0 + Width = 692 + Height = 432 + Align = alClient + BevelOuter = bvNone + BorderWidth = 3 + Constraints.MinHeight = 200 + Constraints.MinWidth = 300 + TabOrder = 1 + end + object pmGrid: TcxGridPopupMenu + PopupMenus = <> + Left = 400 + Top = 319 + end +end diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxGridViewLayoutEditor.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridViewLayoutEditor.pas new file mode 100644 index 00000000..5ceb3baa --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxGridViewLayoutEditor.pas @@ -0,0 +1,165 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxGridViewLayoutEditor; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, ExtCtrls, StdCtrls, cxStyles, cxGridLevel, cxControls, cxGrid, + cxGridCustomView, cxGridCustomPopupMenu, cxGridPopupMenu, Menus, + cxLookAndFeelPainters, cxContainer, cxEdit, cxCheckBox, cxButtons; + +type + TcxGridViewLayoutEditor = class(TForm) + pnlBottom: TPanel; + pnlClient: TPanel; + pnlButtons: TPanel; + btnOK: TcxButton; + btnCancel: TcxButton; + pnlLayoutCustomization: TPanel; + btnLayoutCustomization: TcxButton; + pnlSaveOptions: TPanel; + chbSaveLayout: TcxCheckBox; + chbSaveData: TcxCheckBox; + pmGrid: TcxGridPopupMenu; + procedure btnLayoutCustomizationClick(Sender: TObject); + procedure FormShow(Sender: TObject); + private + FOriginalView: TcxCustomGridView; + FView: TcxCustomGridView; + function GetDataControllerSupport: IcxCustomGridDataController; + function GetViewSupport: IcxGridViewLayoutEditorSupport; + public + constructor Create(AView: TcxCustomGridView); reintroduce; virtual; + procedure Load; + procedure Save; + property DataControllerSupport: IcxCustomGridDataController read GetDataControllerSupport; + property ViewSupport: IcxGridViewLayoutEditorSupport read GetViewSupport; + end; + +function ShowGridViewEditor(AView: TcxCustomGridView): Boolean; + +implementation + +{$R *.dfm} + +uses + cxLookAndFeels, cxData; + +const + CloseButtonCaption = 'Close'; + +function ShowGridViewEditor(AView: TcxCustomGridView): Boolean; +var + AForm: TcxGridViewLayoutEditor; +begin + AForm := TcxGridViewLayoutEditor.Create(AView); + try + Result := AForm.ShowModal = mrOK; + if Result then AForm.Save; + finally + AForm.Free; + end; +end; + +{ TcxGridViewLayoutEditor } + +constructor TcxGridViewLayoutEditor.Create(AView: TcxCustomGridView); +var + AGrid: TcxGrid; +begin + inherited Create(nil); + FOriginalView := AView; + SetControlLookAndFeel(Self, lfUltraFlat, False); + + AGrid := TcxGrid.Create(Self); + AGrid.Parent := pnlClient; + AGrid.Align := alClient; + if FOriginalView.LookAndFeel <> nil then + AGrid.LookAndFeel := FOriginalView.LookAndFeel; + FView := AGrid.CreateView(TcxCustomGridViewClass(FOriginalView.ClassType)); + AGrid.Levels.Add.GridView := FView; + ActiveControl := AGrid; + + Load; +end; + +function TcxGridViewLayoutEditor.GetDataControllerSupport: IcxCustomGridDataController; +begin + Result := FOriginalView.DataController as IcxCustomGridDataController; +end; + +function TcxGridViewLayoutEditor.GetViewSupport: IcxGridViewLayoutEditorSupport; +begin + Result := FOriginalView as IcxGridViewLayoutEditorSupport; +end; + +procedure TcxGridViewLayoutEditor.Load; +begin + FView.Assign(FOriginalView); + (FView.DataController as IcxCustomGridDataController).AssignData(FOriginalView.DataController); + ViewSupport.BeforeEditLayout(FView); +end; + +procedure TcxGridViewLayoutEditor.Save; +begin + if ViewSupport.IsLayoutChangeable and chbSaveLayout.Checked then + ViewSupport.DoAssignLayout(FView); + if DataControllerSupport.IsDataChangeable and chbSaveData.Checked then + DataControllerSupport.AssignData(FView.DataController); +end; + +procedure TcxGridViewLayoutEditor.btnLayoutCustomizationClick(Sender: TObject); +begin + (FView as IcxGridViewLayoutEditorSupport).RunLayoutCustomizationForm; +end; + +procedure TcxGridViewLayoutEditor.FormShow(Sender: TObject); +begin + Caption := Caption + ' - ' + FOriginalView.Name; + pnlLayoutCustomization.Visible := ViewSupport.HasLayoutCustomizationForm; + btnLayoutCustomization.Caption := ViewSupport.GetLayoutCustomizationFormButtonCaption; + chbSaveLayout.Visible := ViewSupport.IsLayoutChangeable; + chbSaveData.Visible := DataControllerSupport.IsDataChangeable; + btnOK.Visible := ViewSupport.IsLayoutChangeable or DataControllerSupport.IsDataChangeable; + if not btnOK.Visible then + btnCancel.Caption := CloseButtonCaption; + pmGrid.Grid := TcxGrid(FView.Control); +end; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxImageComboBoxItemsEditor.dfm b/official/x.35/ExpressQuantumGrid 6/Sources/cxImageComboBoxItemsEditor.dfm new file mode 100644 index 00000000..05fc0860 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxImageComboBoxItemsEditor.dfm @@ -0,0 +1,227 @@ +object fmImageComboBoxItemsEditor: TfmImageComboBoxItemsEditor + Left = 287 + Top = 190 + AutoScroll = False + Caption = 'fmImageComboBoxItemsEditor' + ClientHeight = 266 + ClientWidth = 573 + Color = clBtnFace + Constraints.MinHeight = 300 + Constraints.MinWidth = 581 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 480 + Top = 0 + Width = 93 + Height = 266 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object Bevel1: TBevel + Left = 0 + Top = 0 + Width = 6 + Height = 266 + Align = alLeft + Shape = bsLeftLine + end + object btnAdd: TcxButton + Left = 6 + Top = 12 + Width = 83 + Height = 22 + Anchors = [akTop, akRight] + Caption = '&Add' + TabOrder = 0 + OnClick = btnAddClick + LookAndFeel.NativeStyle = True + end + object btnDelete: TcxButton + Left = 6 + Top = 76 + Width = 83 + Height = 22 + Anchors = [akTop, akRight] + Caption = '&Delete' + TabOrder = 2 + OnClick = btnDeleteClick + LookAndFeel.NativeStyle = True + end + object btnInsert: TcxButton + Left = 6 + Top = 44 + Width = 83 + Height = 22 + Anchors = [akTop, akRight] + Caption = '&Insert' + TabOrder = 1 + OnClick = btnInsertClick + LookAndFeel.NativeStyle = True + end + object btnOk: TcxButton + Left = 6 + Top = 201 + Width = 83 + Height = 22 + Anchors = [akRight, akBottom] + Caption = '&OK' + ModalResult = 1 + TabOrder = 5 + OnClick = btnOkClick + LookAndFeel.NativeStyle = True + end + object btnCancel: TcxButton + Left = 6 + Top = 233 + Width = 83 + Height = 22 + Anchors = [akRight, akBottom] + Caption = '&Cancel' + ModalResult = 2 + TabOrder = 6 + LookAndFeel.NativeStyle = True + end + object btnSelectAll: TcxButton + Left = 6 + Top = 108 + Width = 83 + Height = 22 + Anchors = [akTop, akRight] + Caption = '&Select All' + TabOrder = 3 + OnClick = btnSelectAllClick + LookAndFeel.NativeStyle = True + end + object btnValueType: TcxButton + Left = 6 + Top = 140 + Width = 83 + Height = 22 + Anchors = [akTop, akRight] + Caption = 'Set Value&Type' + TabOrder = 4 + DropDownMenu = mnuValueTypes + Kind = cxbkDropDown + LookAndFeel.NativeStyle = True + end + end + object Panel3: TPanel + Left = 0 + Top = 0 + Width = 480 + Height = 266 + Align = alClient + BevelOuter = bvNone + Caption = 'Panel3' + TabOrder = 0 + object cxgImageComboBoxItems: TcxGrid + Left = 0 + Top = 0 + Width = 480 + Height = 266 + Align = alClient + TabOrder = 0 + LookAndFeel.NativeStyle = True + object tvImageComboBoxItems: TcxGridTableView + OnKeyDown = tvImageComboBoxItemsKeyDown + NavigatorButtons.ConfirmDelete = False + OnEditKeyDown = tvImageComboBoxItemsEditKeyDown + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = <> + DataController.Summary.SummaryGroups = <> + DataController.OnRecordChanged = tvImageComboBoxItemsDataControllerRecordChanged + DataController.Data = { + 960000000F00000044617461436F6E74726F6C6C657231050000001300000054 + 6378496E746567657256616C75655479706512000000546378537472696E6756 + 616C75655479706512000000546378537472696E6756616C7565547970651200 + 0000546378537472696E6756616C75655479706513000000546378496E746567 + 657256616C756554797065010000000001010001000000300101} + OptionsBehavior.CellHints = True + OptionsBehavior.ImmediateEditor = False + OptionsBehavior.ColumnHeaderHints = False + OptionsCustomize.ColumnFiltering = False + OptionsCustomize.ColumnGrouping = False + OptionsCustomize.ColumnHidingOnGrouping = False + OptionsCustomize.ColumnMoving = False + OptionsData.DeletingConfirmation = False + OptionsData.Inserting = False + OptionsSelection.MultiSelect = True + OptionsSelection.UnselectFocusedRecordOnExit = False + OptionsView.CellEndEllipsis = True + OptionsView.ShowEditButtons = gsebAlways + OptionsView.ColumnAutoWidth = True + OptionsView.ExpandButtonsForEmptyDetails = False + OptionsView.GroupByBox = False + object clnImage: TcxGridColumn + Caption = 'Image' + DataBinding.ValueType = 'Integer' + PropertiesClassName = 'TcxImageComboBoxProperties' + Properties.Items = < + item + end> + Properties.ShowDescriptions = False + MinWidth = 36 + Options.HorzSizing = False + Width = 36 + end + object clnDescription: TcxGridColumn + Caption = 'Description' + Width = 168 + end + object clnValue: TcxGridColumn + Caption = 'Value' + PropertiesClassName = 'TcxTextEditProperties' + Width = 109 + end + object clnValueType: TcxGridColumn + Caption = 'ValueType' + PropertiesClassName = 'TcxComboBoxProperties' + Properties.DropDownListStyle = lsFixedList + Properties.ImmediatePost = True + Properties.OnEditValueChanged = clnValueTypePropertiesEditValueChanged + Width = 117 + end + object clnTag: TcxGridColumn + Caption = 'Tag' + DataBinding.ValueType = 'Integer' + PropertiesClassName = 'TcxMaskEditProperties' + Properties.MaskKind = emkRegExprEx + Properties.EditMask = '\d+' + Width = 51 + end + end + object lvImageComboBoxItems: TcxGridLevel + GridView = tvImageComboBoxItems + end + end + end + object mnuValueTypes: TPopupMenu + Left = 390 + Top = 138 + object miAdd: TMenuItem + Caption = '&Add' + OnClick = miValueTypeClick + end + object miInsert: TMenuItem + Caption = '&Insert' + end + object miDelete: TMenuItem + Caption = '&Delete' + end + object N1: TMenuItem + Caption = '-' + end + object miHelp: TMenuItem + Caption = '&Help' + end + end +end diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxImageComboBoxItemsEditor.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxImageComboBoxItemsEditor.pas new file mode 100644 index 00000000..4d79be9f --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxImageComboBoxItemsEditor.pas @@ -0,0 +1,598 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressEditors } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSEDITORS AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxImageComboBoxItemsEditor; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, + cxDataStorage, cxEdit, cxImageComboBox, cxLookAndFeels, + cxGridCustomTableView, cxGridTableView, cxControls, cxGridCustomView, + cxClasses, cxGridLevel, cxGrid, Menus, StdCtrls, ExtCtrls, cxTextEdit, + cxMaskEdit, cxDropDownEdit, cxContainer, cxGroupBox, + cxLookAndFeelPainters, cxButtons, cxCalendar, ImgList; + +type + TfmImageComboBoxItemsEditor = class(TForm) + Panel1: TPanel; + btnAdd: TcxButton; + btnDelete: TcxButton; + btnInsert: TcxButton; + mnuValueTypes: TPopupMenu; + miAdd: TMenuItem; + miInsert: TMenuItem; + miDelete: TMenuItem; + N1: TMenuItem; + miHelp: TMenuItem; + Panel3: TPanel; + cxgImageComboBoxItems: TcxGrid; + tvImageComboBoxItems: TcxGridTableView; + clnImage: TcxGridColumn; + clnValue: TcxGridColumn; + clnDescription: TcxGridColumn; + clnTag: TcxGridColumn; + lvImageComboBoxItems: TcxGridLevel; + Bevel1: TBevel; + btnOk: TcxButton; + btnCancel: TcxButton; + clnValueType: TcxGridColumn; + btnSelectAll: TcxButton; + btnValueType: TcxButton; + procedure FormCreate(Sender: TObject); + procedure btnAddClick(Sender: TObject); + procedure btnDeleteClick(Sender: TObject); + procedure btnInsertClick(Sender: TObject); + procedure btnOkClick(Sender: TObject); + procedure btnSelectAllClick(Sender: TObject); + procedure clnValueTypePropertiesEditValueChanged(Sender: TObject); + procedure miValueTypeClick(Sender: TObject); + procedure tvImageComboBoxItemsKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure tvImageComboBoxItemsDataControllerRecordChanged( + ADataController: TcxCustomDataController; ARecordIndex, + AItemIndex: Integer); + procedure tvImageComboBoxItemsEditKeyDown(Sender: TcxCustomGridTableView; + AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit; var Key: Word; + Shift: TShiftState); + private + { Private declarations } + FImageComboBoxItems: TcxImageComboBoxItems; + FImages, FLargeImages: TCustomImageList; + procedure FillGridViewRecords(AImageComboBoxItems: TcxImageComboBoxItems); + procedure FocusAndSelectRecord(ARecordIndex: Integer); + function GetVarTypeName(AVarType: Word): string; + function GetVarTypeByName(AVarTypeName: string): Word; + procedure InitNewRecord(ARecordIndex: Integer); + procedure PopulateImages(AImages, ALargeImages: TCustomImageList); + procedure PopulateValueTypeNames; + procedure SetItemValueType(ARecordIndex: Integer; AValueType: Word); + procedure SetSelectionValueType(AValueType: Word); + function ValueToValueType(var AValue: Variant; AValueType: Word): Boolean; + public + { Public declarations } + constructor Create(AItems: TcxImageComboBoxItems; + AImages, ALargeImages: TCustomImageList); reintroduce; overload; + end; + +implementation + +uses + cxVariants, TypInfo; + +{$R *.dfm} + +const + cxImageComboErrorVarTypeName = 'ERROR'; + cxImageComboNullValue = '(Null)'; + cxImageComboOleStrVarTypeName = 'OleStr'; + cxImageComboStringVarTypeName = 'String'; + cxImageComboUnknownVarTypeName = '(Unknown)'; + +var + cxImageComboVarTypeNames: array[varEmpty..{$IFDEF DELPHI6}varInt64{$ELSE}varByte{$ENDIF}] + of string = ( + 'Unassigned', // varEmpty + 'Null', // varNull + 'Smallint', // varSmallint + 'Integer', // varInteger + 'Single', // varSingle + 'Double', // varDouble + 'Currency', // varCurrency + 'Date', // varDate + 'OleStr', // varOleStr + '', // varDispatch + '', // varError + 'Boolean', // varBoolean + '', // varVariant + '', // varUnknown + '', // [varDecimal] + '', // [undefined] +{$IFDEF DELPHI6} + 'Shortint', // varShortInt +{$ELSE} + '', +{$ENDIF} + 'Byte' // varByte +{$IFDEF DELPHI6} + ,'Word', // varWord + 'LongWord', // varLongWord + 'Int64' // varInt64 +{$ENDIF} + ); + +constructor TfmImageComboBoxItemsEditor.Create(AItems: TcxImageComboBoxItems; + AImages, ALargeImages: TCustomImageList); +begin + FImageComboBoxItems := AItems; + FImages := AImages; + FLargeImages := ALargeImages; + inherited Create(Application); +end; + +procedure TfmImageComboBoxItemsEditor.FormCreate(Sender: TObject); +begin + PopulateValueTypeNames; + PopulateImages(FImages, FLargeImages); + FillGridViewRecords(FImageComboBoxItems); + clnImage.ApplyBestFit; + tvImageComboBoxItems.Controller.GoToLast(False); +end; + +procedure TfmImageComboBoxItemsEditor.btnAddClick(Sender: TObject); +begin + tvImageComboBoxItems.DataController.Post; + tvImageComboBoxItems.BeginUpdate; + try + tvImageComboBoxItems.DataController.AppendRecord; + InitNewRecord(tvImageComboBoxItems.DataController.RecordCount - 1); + finally + tvImageComboBoxItems.EndUpdate; + end; + FocusAndSelectRecord(tvImageComboBoxItems.DataController.RecordCount - 1); +end; + +procedure TfmImageComboBoxItemsEditor.btnDeleteClick(Sender: TObject); +var + AIndex: Integer; +begin + if tvImageComboBoxItems.DataController.RecordCount = 0 then + Exit; + AIndex := tvImageComboBoxItems.Controller.FocusedRecordIndex; + tvImageComboBoxItems.DataController.DeleteSelection; + if tvImageComboBoxItems.DataController.RecordCount > AIndex then + begin + tvImageComboBoxItems.Controller.FocusedRecordIndex := AIndex; + tvImageComboBoxItems.Controller.FocusedRecord.Selected := True; + end + else + tvImageComboBoxItems.Controller.GoToLast(False); +end; + +procedure TfmImageComboBoxItemsEditor.btnOkClick(Sender: TObject); + + procedure InitImageComboBoxItem(AItem: TcxImageComboBoxItem; + ARecord: TcxCustomGridRecord); + + function VarToInteger(AValue: Variant): Integer; + begin + if VarIsNull(AValue) then + Result := 0 + else + Result := AValue; + end; + + var + AValue: Variant; + AVarType: Word; + begin + AItem.Description := VarToStr(ARecord.Values[clnDescription.Index]); + AItem.Tag := VarToInteger(ARecord.Values[clnTag.Index]); + AItem.ImageIndex := VarToInteger(ARecord.Values[clnImage.Index]); + AValue := ARecord.Values[clnValue.Index]; + AVarType := GetVarTypeByName(ARecord.Values[clnValueType.Index]); + case AVarType of + varNull: + AValue := Null; + varEmpty: + VarClear(AValue); + varError: + begin + AValue := Null; + raise EVariantError.Create('Invalid value type'); + end; + else + VarCast(AValue, AValue, AVarType); + end; + AItem.Value := AValue; + end; + +var + I: Integer; +begin + FImageComboBoxItems.Clear; + for I := 0 to tvImageComboBoxItems.ViewData.RecordCount - 1 do + InitImageComboBoxItem( + FImageComboBoxItems.Add as TcxImageComboBoxItem, + tvImageComboBoxItems.ViewData.Records[I]); +end; + +procedure TfmImageComboBoxItemsEditor.btnInsertClick(Sender: TObject); + + function InsertRecordBeforeFocused: Integer; + begin + Result := tvImageComboBoxItems.DataController.InsertRecord( + tvImageComboBoxItems.Controller.FocusedRecord.Index); + end; + +var + ARecordIndex: Integer; +begin + tvImageComboBoxItems.DataController.Post; + if tvImageComboBoxItems.Controller.FocusedRecord = nil then + btnAddClick(nil) + else + begin + tvImageComboBoxItems.BeginUpdate; + try + ARecordIndex := InsertRecordBeforeFocused; + InitNewRecord(ARecordIndex); + finally + tvImageComboBoxItems.EndUpdate; + end; + FocusAndSelectRecord(ARecordIndex); + end; +end; + +procedure TfmImageComboBoxItemsEditor.btnSelectAllClick(Sender: TObject); +begin + tvImageComboBoxItems.DataController.SelectAll; +end; + +procedure TfmImageComboBoxItemsEditor.clnValueTypePropertiesEditValueChanged( + Sender: TObject); +begin + SetItemValueType(tvImageComboBoxItems.DataController.FocusedRecordIndex, + GetVarTypeByName(TcxComboBox(Sender).Text)); +end; + +procedure TfmImageComboBoxItemsEditor.miValueTypeClick(Sender: TObject); +begin + SetSelectionValueType(TMenuItem(Sender).Tag); +end; + +procedure TfmImageComboBoxItemsEditor.FillGridViewRecords( + AImageComboBoxItems: TcxImageComboBoxItems); + + function ValueToStr(AValue: Variant): string; + begin + if VarIsNull(AValue) then + Result := cxImageComboNullValue + else + case VarType(AValue) of + varBoolean: + Result := BooleanIdents[AValue = True]; + varCurrency: + Result := CurrToStr(AValue); + varDispatch: + Result := cxImageComboErrorVarTypeName; + else + Result := VarToStr(AValue); + end; + end; + + procedure InitRecord(ARecordIndex: Integer; + AImageComboBoxItem: TcxImageComboBoxItem); + var + ARec: TcxCustomGridRecord; + begin + ARec := tvImageComboBoxItems.ViewData.Records[ARecordIndex]; + tvImageComboBoxItems.BeginUpdate; + try + ARec.Values[clnImage.Index] := AImageComboBoxItem.ImageIndex; + ARec.Values[clnValue.Index] := ValueToStr(AImageComboBoxItem.Value); + ARec.Values[clnValueType.Index] := + GetVarTypeName(VarType(AImageComboBoxItem.Value)); + ARec.Values[clnDescription.Index] := AImageComboBoxItem.Description; + ARec.Values[clnTag.Index] := AImageComboBoxItem.Tag; + finally + tvImageComboBoxItems.EndUpdate; + end; + end; + +var + I: Integer; +begin + tvImageComboBoxItems.DataController.RecordCount := + AImageComboBoxItems.Count; + if tvImageComboBoxItems.DataController.RecordCount > 0 then + begin + tvImageComboBoxItems.BeginUpdate; + try + for I := 0 to tvImageComboBoxItems.DataController.RecordCount - 1 do + InitRecord(I, AImageComboBoxItems[I]) + finally + tvImageComboBoxItems.EndUpdate; + end; + end + else + begin + tvImageComboBoxItems.DataController.RecordCount := 1; + InitNewRecord(0); + end; +end; + +procedure TfmImageComboBoxItemsEditor.FocusAndSelectRecord(ARecordIndex: Integer); +begin + tvImageComboBoxItems.DataController.ClearSelection; + tvImageComboBoxItems.DataController.FocusedRecordIndex := + ARecordIndex; + tvImageComboBoxItems.Controller.FocusedRecord.Selected := True; +end; + +function TfmImageComboBoxItemsEditor.GetVarTypeName(AVarType: Word): string; +begin + AVarType := AVarType and varTypeMask; + case AVarType of + Low(cxImageComboVarTypeNames)..High(cxImageComboVarTypeNames): + Result := cxImageComboVarTypeNames[AVarType]; + varString: + Result := cxImageComboStringVarTypeName; + else + Result := cxImageComboUnknownVarTypeName; + end; +end; + +function TfmImageComboBoxItemsEditor.GetVarTypeByName(AVarTypeName: string): Word; +var + I: Integer; +begin + Result := varError; + if AVarTypeName = cxImageComboStringVarTypeName then + Result := varString + else + for I := Low(cxImageComboVarTypeNames) to High(cxImageComboVarTypeNames) do + if cxImageComboVarTypeNames[I] = AVarTypeName then + begin + Result := I; + Break; + end; +end; + +procedure TfmImageComboBoxItemsEditor.InitNewRecord(ARecordIndex: Integer); +begin + tvImageComboBoxItems.BeginUpdate; + try + SetItemValueType(ARecordIndex, varNull); + tvImageComboBoxItems.DataController.Values[ARecordIndex, clnTag.Index] := 0; + if ARecordIndex < + TcxImageComboBoxProperties(clnImage.Properties).Items.Count then + tvImageComboBoxItems.DataController.Values[ARecordIndex, clnImage.Index] := ARecordIndex + else + tvImageComboBoxItems.DataController.Values[ARecordIndex, clnImage.Index] := -1; + finally + tvImageComboBoxItems.EndUpdate; + end; +end; + +procedure TfmImageComboBoxItemsEditor.PopulateImages(AImages, ALargeImages: TCustomImageList); +var + I: Integer; + ACurrentImages: TCustomImageList; + AImageComboBoxProperties: TcxImageComboBoxProperties; +begin + if (AImages = nil) and (ALargeImages = nil) then + Exit; + AImageComboBoxProperties := TcxImageComboBoxProperties(clnImage.Properties); + AImageComboBoxProperties.Images := AImages; + AImageComboBoxProperties.LargeImages := ALargeImages; + if ALargeImages <> nil then + ACurrentImages := ALargeImages + else + ACurrentImages := AImages; + AImageComboBoxProperties.Items.Clear; + with TcxImageComboBoxItem(AImageComboBoxProperties.Items.Add) do + begin + ImageIndex := -1; + Value := -1; + end; + for I := 0 to ACurrentImages.Count - 1 do + with TcxImageComboBoxItem(AImageComboBoxProperties.Items.Add) do + begin + ImageIndex := I; + Value := I; + end; +end; + +procedure TfmImageComboBoxItemsEditor.PopulateValueTypeNames; + + procedure AddValueTypeToDropDownMenu(AValuetypeName: string; AValue: Integer); + var + AMenuItem: TMenuItem; + begin + AMenuItem := TMenuItem.Create(mnuValueTypes); + AMenuItem.Caption := AValuetypeName; + AMenuItem.OnClick := miValueTypeClick; + AMenuItem.Tag := AValue; + mnuValueTypes.Items.Add(AMenuItem); + end; + + procedure AddValueTypeToValueTypeColumn(AValuetypeName: string; AValue: Integer); + var + AComboBoxProperties: TcxComboBoxProperties; + begin + AComboBoxProperties := + TcxComboBoxProperties(clnValueType.Properties); + AComboBoxProperties.Items.AddObject(AValuetypeName, TObject(AValue)); + end; + +var + I: Integer; +begin + TcxComboBoxProperties(clnValueType.Properties).Items.Clear; + mnuValueTypes.Items.Clear; + for I := Low(cxImageComboVarTypeNames) to High(cxImageComboVarTypeNames) do + if cxImageComboVarTypeNames[I] <> '' then + begin + AddValueTypeToDropDownMenu(cxImageComboVarTypeNames[I], I); + AddValueTypeToValueTypeColumn(cxImageComboVarTypeNames[I], I); + end; + AddValueTypeToDropDownMenu(cxImageComboStringVarTypeName, varString); + AddValueTypeToValueTypeColumn(cxImageComboStringVarTypeName, varString); +end; + +procedure TfmImageComboBoxItemsEditor.SetItemValueType(ARecordIndex: Integer; AValueType: Word); +var + AValue: Variant; +begin + tvImageComboBoxItems.BeginUpdate; + try + tvImageComboBoxItems.DataController.Values[ARecordIndex, clnValueType.Index] := + GetVarTypeName(AValueType); + AValue := tvImageComboBoxItems.DataController.Values[ARecordIndex, clnValue.Index]; + ValueToValueType(AValue, AValueType); + tvImageComboBoxItems.DataController.Values[ARecordIndex, clnValue.Index] := AValue; + finally + tvImageComboBoxItems.EndUpdate; + end; +end; + +procedure TfmImageComboBoxItemsEditor.SetSelectionValueType(AValueType: Word); +var + I: Integer; +begin + tvImageComboBoxItems.BeginUpdate; + try + for I := 0 to tvImageComboBoxItems.Controller.SelectedRecordCount -1 do + SetItemValueType( + tvImageComboBoxItems.Controller.SelectedRecords[I].RecordIndex, AValueType); + finally + tvImageComboBoxItems.EndUpdate; + end; +end; + +function TfmImageComboBoxItemsEditor.ValueToValueType(var AValue: Variant; AValueType: Word): Boolean; +var + AStringValue: string; +begin + Result := True; + case AValueType of + varEmpty: + if not VarIsSoftNull(AValue) then + begin + Result := False; + VarClear(AValue); + end; + varNull: + if not VarEquals(AValue, cxImageComboNullValue) then + begin + AValue := cxImageComboNullValue; + Result := False; + end; + varString, varOleStr: + if VarEquals(AValue, cxImageComboNullValue) then + AValue := ''; + else + if Result then + try + AStringValue := VarToStr(AValue); + VarCast(AValue, AValue, AValueType); + Result := (AValueType in [varDate, varCurrency, varDouble, varBoolean]) or + (VarToStr(AValue) = AStringValue); + except + Result := False; + VarClear(AValue); + VarCast(AValue, AValue, AValueType); + end; + end; +end; + +procedure TfmImageComboBoxItemsEditor.tvImageComboBoxItemsKeyDown( + Sender: TObject; var Key: Word; Shift: TShiftState); +begin + if (Key = VK_INSERT) and (Shift = []) then + begin + btnInsertClick(Self); + Key := 0; + end; +end; + +procedure TfmImageComboBoxItemsEditor.tvImageComboBoxItemsDataControllerRecordChanged( + ADataController: TcxCustomDataController; ARecordIndex, + AItemIndex: Integer); + + function GetFocusedItemValueType: Word; + begin + Result := GetVarTypeByName(ADataController.GetValue(ARecordIndex, clnValueType.Index)); + end; + +var + AValue: Variant; +begin + if AItemIndex = clnValue.Index then + begin + ADataController.OnRecordChanged := nil; + try + AValue := clnValue.EditValue; + if VarIsSoftNull(AValue) then + ADataController.SetValue(ARecordIndex, clnValueType.Index, GetVarTypeName(varEmpty)) + else + if VarEquals(AValue, cxImageComboNullValue) then + ADataController.SetValue(ARecordIndex, clnValueType.Index, GetVarTypeName(varNull)) + else + if not ValueToValueType(AValue, GetFocusedItemValueType) then + ADataController.SetValue(ARecordIndex, clnValueType.Index, cxImageComboStringVarTypeName) + else + ADataController.SetValue(ARecordIndex, clnValue.Index, VarToStr(AValue)); + finally + ADataController.OnRecordChanged := tvImageComboBoxItemsDataControllerRecordChanged; + end; + end; +end; + +procedure TfmImageComboBoxItemsEditor.tvImageComboBoxItemsEditKeyDown( + Sender: TcxCustomGridTableView; AItem: TcxCustomGridTableItem; + AEdit: TcxCustomEdit; var Key: Word; Shift: TShiftState); +begin + tvImageComboBoxItemsKeyDown(Sender, Key, Shift); +end; + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxTableViewEditor.dfm b/official/x.35/ExpressQuantumGrid 6/Sources/cxTableViewEditor.dfm new file mode 100644 index 00000000..51dc89be --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxTableViewEditor.dfm @@ -0,0 +1,12 @@ +inherited cxTableViewEditor: TcxTableViewEditor + Caption = 'cxTableViewEditor' + PixelsPerInch = 96 + TextHeight = 13 + inherited PViewEditor: TPanel + inherited PageControl1: TcxPageControl + inherited TSItems: TcxTabSheet + Caption = ' Columns ' + end + end + end +end diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxTableViewEditor.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxTableViewEditor.pas new file mode 100644 index 00000000..80c688a9 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxTableViewEditor.pas @@ -0,0 +1,136 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxTableViewEditor; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, Menus, StdCtrls, ComCtrls, ExtCtrls, + cxViewEditor, cxCustomTableViewEditor, cxGridCustomView, cxGridTableView, + cxLookAndFeelPainters, cxButtons, cxPC, cxControls; + +type + TcxTableViewEditor = class(TcxCustomTableViewEditor); + + TcxGridTableViewStorage = class(TcxCustomGridTableViewStorage) + private + function GetFiltering: TcxGridTableFiltering; + function GetOptionsBehavior: TcxGridTableOptionsBehavior; + function GetOptionsCustomize: TcxGridTableOptionsCustomize; + function GetOptionsData: TcxGridTableOptionsData; + function GetOptionsSelection: TcxGridTableOptionsSelection; + function GetOptionsView: TcxGridTableOptionsView; + function GetPreview: TcxGridPreview; + protected + function TableView: TcxGridTableView; + public + class function GetViewClass: TcxCustomGridViewClass; override; + published + property Filtering: TcxGridTableFiltering read GetFiltering; + property OptionsBehavior: TcxGridTableOptionsBehavior read GetOptionsBehavior; + property OptionsCustomize: TcxGridTableOptionsCustomize read GetOptionsCustomize; + property OptionsData: TcxGridTableOptionsData read GetOptionsData; + property OptionsSelection: TcxGridTableOptionsSelection read GetOptionsSelection; + property OptionsView: TcxGridTableOptionsView read GetOptionsView; + property Preview: TcxGridPreview read GetPreview; + end; + +implementation + +{$R *.dfm} + +{ TcxGridTableViewStorage } + +function TcxGridTableViewStorage.GetFiltering: TcxGridTableFiltering; +begin + Result := TableView.Filtering; +end; + +function TcxGridTableViewStorage.GetOptionsBehavior: TcxGridTableOptionsBehavior; +begin + Result := TableView.OptionsBehavior; +end; + +function TcxGridTableViewStorage.GetOptionsCustomize: TcxGridTableOptionsCustomize; +begin + Result := TableView.OptionsCustomize; +end; + +function TcxGridTableViewStorage.GetOptionsData: TcxGridTableOptionsData; +begin + Result := TableView.OptionsData; +end; + +function TcxGridTableViewStorage.GetOptionsSelection: TcxGridTableOptionsSelection; +begin + Result := TableView.OptionsSelection; +end; + +function TcxGridTableViewStorage.GetOptionsView: TcxGridTableOptionsView; +begin + Result := TableView.OptionsView; +end; + +function TcxGridTableViewStorage.GetPreview: TcxGridPreview; +begin + Result := TableView.Preview; +end; + +function TcxGridTableViewStorage.TableView: TcxGridTableView; +begin + Result := inherited View as TcxGridTableView; +end; + +class function TcxGridTableViewStorage.GetViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridTableView; +end; + +initialization + RegisterViewEditorClass(TcxGridTableView, TcxTableViewEditor); + RegisterDefaultViewStorage(TcxGridTableViewStorage); + +finalization + UnregisterDefaultViewStorage(TcxGridTableViewStorage); + UnregisterViewEditorClass(TcxGridTableView, TcxTableViewEditor); + +end. + diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxVer.inc b/official/x.35/ExpressQuantumGrid 6/Sources/cxVer.inc new file mode 100644 index 00000000..a26364cc --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxVer.inc @@ -0,0 +1,172 @@ +{$B-} { Complete Boolean Evaluation } +{$R-} { Range-Checking } +{$T-} { Typed @ operator } +{$X+} { Extended syntax } +{$P+} { Open string params } +{$J+} { Writeable structured consts } +{$H+} { Use long strings by default } +{$Q-} { Overflow checking } + +{$DEFINE DXVER500} + +{$IFNDEF CLR} + {$DEFINE OLEDRAGANDDROP} + {$IFNDEF DONTUSEJPEGIMAGE} + {$DEFINE USEJPEGIMAGE} + {$ENDIF} +{$ENDIF} + +{$DEFINE EXPRESSBARS5} + +{$DEFINE VCL} + +{$IFNDEF VER80} + {$IFNDEF VER90} + {$IFNDEF VER93} + {$DEFINE DELPHI3} { Borland Delphi 3.0 } + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER110} { Borland C++Builder 3.0 } + {$DEFINE CBUILDER3} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE DELPHI4} +{$ENDIF} + +{$IFDEF VER125} { Borland C++Builder 4.0 } + {$DEFINE CBUILDER3} + {$DEFINE DELPHI4} + {$DEFINE CBUILDER4} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$IFDEF BCB} { Borland C++Builder 5.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$IFDEF BCB} { Borland C++Builder 6.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} +{$ENDIF} + +{$IFNDEF DELPHI6} + {$DEFINE MSWINDOWS} +{$ENDIF} +{$IFDEF LINUX} + {$UNDEF MSWINDOWS} +{$ENDIF} + +{$IFDEF LINUX} + {$DEFINE KYLIX1} { Borland Kylix 1 } + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF CompilerVersion >= 14} + {$DEFINE KYLIX2} { Borland Kylix 2 } + {$IFEND} + {$IF CompilerVersion >= 14.50} + {$DEFINE KYLIX3} { Borland Kylix 3 } + {$IFEND} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} { Borland Delphi.Net } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} +{$ENDIF} + +{$IFDEF VER170} { Borland Delphi 9.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} +{$ENDIF} + +{$IFDEF VER180} { Borland Delphi 10 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$IFDEF BCB} { Borland C++Builder 10 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Borland Delphi 11 //CodeGear} + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$DEFINE DELPHI11} + {$IFDEF BCB} { Borland C++Builder 11 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$DEFINE CBUILDER11} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFNDEF CLR} + {$IFNDEF BCB} + {$IFDEF DELPHI6} + {$DEFINE REGISTERSHELLCTRLS} + {$ENDIF} + {$ENDIF} + {$IFDEF DELPHI7} + {$WARN UNSAFE_CAST OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_TYPE OFF} + {$ENDIF} +{$ENDIF} + +{$IFDEF REGISTERSHELLCTRLS} + {$DEFINE REGISTERCXSHELLCTRLS} +{$ENDIF} + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxViewEditor.dfm b/official/x.35/ExpressQuantumGrid 6/Sources/cxViewEditor.dfm new file mode 100644 index 00000000..e7aa372d --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxViewEditor.dfm @@ -0,0 +1,26 @@ +object cxViewEditor: TcxViewEditor + Left = 742 + Top = 104 + Caption = 'cxViewEditor' + ClientHeight = 313 + ClientWidth = 343 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + OnKeyPress = FormKeyPress + PixelsPerInch = 96 + TextHeight = 13 + object PViewEditor: TPanel + Left = 0 + Top = 0 + Width = 343 + Height = 313 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + end +end diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxViewEditor.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxViewEditor.pas new file mode 100644 index 00000000..20dd41de --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxViewEditor.pas @@ -0,0 +1,965 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxViewEditor; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + DesignIntf, DesignMenus, +{$ELSE} + DsgnIntf, +{$ENDIF} +{$IFDEF DELPHI6} + Variants, +{$ENDIF} +{$IFNDEF NONDB} + DB, +{$ENDIF} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Menus, + Dialogs, ExtCtrls, cxLibraryReg, + cxClasses, cxStorage, cxDesignWindows, cxCustomData, cxGridCommon, cxGridCustomView; + +const + cxGridViewMenuSeparatorCaption = '-'; + +type + { TcxViewEditor } + + TcxViewEditor = class(TForm) + PViewEditor: TPanel; + procedure FormKeyPress(Sender: TObject; var Key: Char); + private + FView: TcxCustomGridView; + function GetDataController: TcxCustomDataController; + function GetOwnerForm: TComponent; + protected + procedure BeginUpdate; + function CanAddComponent: Boolean; + function CanDeleteComponent(AComponent: TComponent): Boolean; + procedure EndUpdate; + procedure GetSelectionList(AList: TList); + procedure SelectComponent(AComponent: TPersistent); + function UniqueName(AComponent: TComponent; + const ATruncateClassName: string = ScxGridPrefixName): string; virtual; + procedure UpdateDesigner; virtual; + procedure UpdateEditor; virtual; + procedure UpdateSelection; virtual; + property DataController: TcxCustomDataController read GetDataController; + public + FormEditor: TcxDesignFormEditor; + class function GetViewByObject(APersistent: TPersistent): TcxCustomGridView; virtual; + procedure SetView(Value: TcxCustomGridView; ARefreshNeeded: Boolean); + property OwnerForm: TComponent read GetOwnerForm; + property View: TcxCustomGridView read FView; + end; + + TcxViewEditorClass = class of TcxViewEditor; + + { TcxCustomGridViewStorage } + + TcxCustomGridViewStorage = class(TcxInterfacedPersistent, IcxStoredObject) + private + FView: TcxCustomGridView; + protected + // IcxStoredObject + function GetObjectName: string; + function GetProperties(AProperties: TStrings): Boolean; + procedure GetPropertyValue(const AName: string; var AValue: Variant); + procedure SetPropertyValue(const AName: string; const AValue: Variant); + property View: TcxCustomGridView read FView; + public + constructor Create(AView: TcxCustomGridView); reintroduce; virtual; + class function GetViewClass: TcxCustomGridViewClass; virtual; + end; + + TcxCustomGridViewStorageClass = class of TcxCustomGridViewStorage; + + { View Menu Provider } + + TcxGridViewMenuItem = class; + + TcxGridViewMenuItemActionEvent = procedure(Sender: TcxGridViewMenuItem) of object; + + TcxGridViewMenuItems = class + private + FItems: TList; + function GetCount: Integer; + function GetItem(Index: Integer): TcxGridViewMenuItem; + protected + procedure ClearItems; + public + constructor Create; + destructor Destroy; override; + function AddItem(const ACaption: string; AOnClick: TcxGridViewMenuItemActionEvent = nil; + AEnabled: Boolean = True; AChecked: Boolean = False; AData: TObject = nil): TcxGridViewMenuItem; + function AddSeparator: TcxGridViewMenuItem; + procedure Delete(AIndex: Integer); + procedure Prepare(AMenuItem: TMenuItem); overload; virtual; + {$IFDEF DELPHI6} + procedure Prepare(const AMenuItem: TDesignMenuItem); overload; virtual; + {$ENDIF} + procedure RemoveExcessSeparators; + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxGridViewMenuItem read GetItem; default; + end; + + TcxGridViewMenuItem = class(TcxGridViewMenuItems) + private + procedure MenuItemClick(Sender: TObject); + protected + OnAction: TcxGridViewMenuItemActionEvent; + public + Caption: string; + Checked: Boolean; + Data: TObject; + Enabled: Boolean; + constructor Create(const ACaption: string; AEnabled: Boolean; + AChecked: Boolean; AData: TObject; AOnAction: TcxGridViewMenuItemActionEvent); + procedure DoAction; + function IsSeparator: Boolean; + procedure Prepare(AMenuItem: TMenuItem); overload; override; + {$IFDEF DELPHI6} + procedure Prepare(const AMenuItem: TDesignMenuItem); overload; override; + {$ENDIF} + end; + + TcxCustomGridViewMenuProviderClass = class of TcxCustomGridViewMenuProvider; + + TcxCustomGridViewMenuProvider = class + private + FDesigner: IDesigner; + FDesignHelper: TcxDesignHelper; + FGridView: TcxCustomGridView; + FItems: TcxGridViewMenuItems; + {$IFNDEF NONDB} + FDataSourceNames: TStringList; + procedure GetDataSourceName(const S: string); + function GetDBGridView: TcxCustomGridView; + function GetViewDataSource: TDataSource; + procedure SetViewDataSource(Value: TDataSource); + {$ENDIF} + protected + procedure DesignerModified; + procedure ObjectCreated(AObject: TPersistent); + procedure SelectObject(AObject: TPersistent); + + procedure InitAdditionalItems; virtual; + procedure InitCopySettingsFromViewItem; virtual; + {$IFNDEF NONDB} + procedure InitDataBindingItems; virtual; + {$ENDIF} + procedure InitItems; virtual; + procedure InitLayoutItems; virtual; + procedure InitStructureItems; virtual; + + procedure CopySettings(Sender: TcxGridViewMenuItem); + procedure DeleteView(Sender: TcxGridViewMenuItem); + procedure EditLayoutAndData(Sender: TcxGridViewMenuItem); + procedure SetAsDefault(Sender: TcxGridViewMenuItem); + {$IFNDEF NONDB} + function GetDataSourceNames: TStringList; + procedure LinkToDataSource(Sender: TcxGridViewMenuItem); + {$ENDIF} + + {$IFNDEF NONDB} + property ViewDataSource: TDataSource read GetViewDataSource write SetViewDataSource; + property DBGridView: TcxCustomGridView read GetDBGridView; + {$ENDIF} + property Designer: IDesigner read FDesigner; + property DesignHelper: TcxDesignHelper read FDesignHelper; + public + constructor Create(AGridView: TcxCustomGridView); virtual; + destructor Destroy; override; + property GridView: TcxCustomGridView read FGridView; + property Items: TcxGridViewMenuItems read FItems; + end; + + { TcxGridViewList } + + TcxGridViewList = class + private + FDesigner: IDesigner; + FViewNames: TStringList; + function GetView(Index: Integer): TcxCustomGridView; + procedure AddViewName(const S: string); + protected + procedure GetViewNames; virtual; + public + constructor Create(ADesigner: IDesigner); + destructor Destroy; override; + function GetViewIndex(AView: TcxCustomGridView): Integer; + property Designer: IDesigner read FDesigner; + property ViewNames: TStringList read FViewNames; + property Views[Index: Integer]: TcxCustomGridView read GetView; + end; + +function GetViewEditorClass(AViewClass: TcxCustomGridViewClass): TcxViewEditorClass; +procedure RegisterViewEditorClass(AViewClass: TcxCustomGridViewClass; AViewEditorClass: TcxViewEditorClass); +procedure UnregisterViewEditorClass(AViewClass: TcxCustomGridViewClass; AViewEditorClass: TcxViewEditorClass); +function GetLinkedView(APersistent: TPersistent): TcxCustomGridView; +function IsViewLinkedToComponent(AView: TcxCustomGridView; AComponent: TComponent): Boolean; + +function GetViewTemplateRegKey: string; +procedure RegisterDefaultViewStorage(AStorageClass: TcxCustomGridViewStorageClass); +procedure UnregisterDefaultViewStorage(AStorageClass: TcxCustomGridViewStorageClass); +function GetDefaultViewStorageByViewClass(AGridView: TcxCustomGridView): TcxCustomGridViewStorage; + +procedure RestoreViewFromTemplate(const ARegPath: string; AView: TcxCustomGridView); +procedure SaveViewToTemplate(const ARegPath: string; AView: TcxCustomGridView); + +function CreateViewMenuProvider(AView: TcxCustomGridView): TcxCustomGridViewMenuProvider; +function GetViewMenuProviderClass(AView: TcxCustomGridView): TcxCustomGridViewMenuProviderClass; +procedure RegisterViewMenuProviderClass(AViewClass: TcxCustomGridViewClass; + AViewMenuProviderClass: TcxCustomGridViewMenuProviderClass); +procedure UnregisterViewMenuProviderClass(AViewClass: TcxCustomGridViewClass; + AViewMenuProviderClass: TcxCustomGridViewMenuProviderClass); + +function GetViewItemUniqueName(AView: TcxCustomGridView; AItem: TComponent; + const AItemName: string): string; + +implementation + +{$R *.dfm} + +uses +{$IFNDEF NONDB} + TypInfo, cxDBData, +{$ENDIF} + cxGrid, cxGridLevel, cxGridViewLayoutEditor; + +type + TcxDesignWindowAccess = class(TcxDesignWindow); + +var + ViewEditorClassList: TcxRegisteredClassList; + DefaultViewStorages: TList; + ViewMenuProviderClassList: TcxRegisteredClassList; + +function GetViewEditorClass(AViewClass: TcxCustomGridViewClass): TcxViewEditorClass; +begin + Result := TcxViewEditorClass(ViewEditorClassList.FindClass(AViewClass)); +end; + +procedure RegisterViewEditorClass(AViewClass: TcxCustomGridViewClass; AViewEditorClass: TcxViewEditorClass); +begin + ViewEditorClassList.Register(AViewClass, AViewEditorClass); +end; + +procedure UnregisterViewEditorClass(AViewClass: TcxCustomGridViewClass; AViewEditorClass: TcxViewEditorClass); +begin + ViewEditorClassList.Unregister(AViewClass, AViewEditorClass); +end; + +function GetLinkedView(APersistent: TPersistent): TcxCustomGridView; +var + I: Integer; + AViewEditorClass: TcxViewEditorClass; +begin + Result := nil; + for I := 0 to ViewEditorClassList.Count - 1 do + begin + AViewEditorClass := TcxViewEditorClass(ViewEditorClassList[I].RegisteredClass); + Result := AViewEditorClass.GetViewByObject(APersistent); + if Result <> nil then + Break; + end; +end; + +function IsViewLinkedToComponent(AView: TcxCustomGridView; AComponent: TComponent): Boolean; + + function CheckLevels(ALevel: TcxGridLevel): Boolean; + var + I: Integer; + begin + Result := False; + for I := 0 to ALevel.Count - 1 do + if (ALevel[I].GridView = AView) or CheckLevels(ALevel[I]) then + begin + Result := True; + Break; + end; + end; + +begin + Result := AView.GetParentComponent = AComponent; + if not Result and (AComponent is TcxCustomGrid) then // check Levels (from Repository) + Result := CheckLevels(TcxCustomGrid(AComponent).Levels); +end; + +function GetViewTemplateRegKey: string; +begin + Result := TcxDesignWindow.GetBaseRegKey + '\TcxGridViewTemplate'; +end; + +procedure RegisterDefaultViewStorage(AStorageClass: TcxCustomGridViewStorageClass); +begin + if DefaultViewStorages = nil then + DefaultViewStorages := TList.Create; + if DefaultViewStorages.IndexOf((AStorageClass)) < 0 then + DefaultViewStorages.Add((AStorageClass)); +end; + +procedure UnregisterDefaultViewStorage(AStorageClass: TcxCustomGridViewStorageClass); +begin + if DefaultViewStorages <> nil then + DefaultViewStorages.Remove((AStorageClass)); +end; + +function GetDefaultViewStorageByViewClass(AGridView: TcxCustomGridView): TcxCustomGridViewStorage; +var + I: Integer; + ACurrent, AStorageClass: TcxCustomGridViewStorageClass; +begin + Result := nil; + AStorageClass := nil; + if (DefaultViewStorages <> nil) and (AGridView <> nil) then + begin + for I := 0 to DefaultViewStorages.Count - 1 do + begin + ACurrent := TcxCustomGridViewStorageClass(DefaultViewStorages[I]); + + if AGridView.InheritsFrom(ACurrent.GetViewClass) then + if (AStorageClass = nil) or + not AStorageClass.GetViewClass.InheritsFrom(ACurrent.GetViewClass) then + AStorageClass := ACurrent; + + if (AStorageClass <> nil) and + (AStorageClass.GetViewClass = AGridView.ClassType) then + Break; + end; + end; + if AStorageClass <> nil then + Result := AStorageClass.Create(AGridView); +end; + +procedure RestoreViewFromTemplate(const ARegPath: string; AView: TcxCustomGridView); +var + AStorage: TcxStorage; + AViewStorage: TcxCustomGridViewStorage; +begin + AViewStorage := GetDefaultViewStorageByViewClass(AView); + if AViewStorage = nil then Exit; + try + AStorage := TcxStorage.Create(ARegPath{ + '\' + AViewStorage.GetObjectName}); + try + AStorage.Modes := AStorage.Modes + [smSavePublishedClassProperties]; + AStorage.RestoreFromRegistry(AViewStorage); + finally + AStorage.Free; + end; + finally + AViewStorage.Free; + end; +end; + +procedure SaveViewToTemplate(const ARegPath: string; AView: TcxCustomGridView); +var + AStorage: TcxStorage; + AViewStorage: TcxCustomGridViewStorage; +begin + AViewStorage := GetDefaultViewStorageByViewClass(AView); + if AViewStorage = nil then Exit; + try + AStorage := TcxStorage.Create(ARegPath{ + '\' + AViewStorage.GetObjectName}); + try + AStorage.Modes := AStorage.Modes + [smSavePublishedClassProperties]; + AStorage.Recreate := False; + AStorage.StoreToRegistry(AViewStorage); + finally + AStorage.Free; + end; + finally + AViewStorage.Free; + end; +end; + +function CreateViewMenuProvider(AView: TcxCustomGridView): TcxCustomGridViewMenuProvider; +var + AClass: TcxCustomGridViewMenuProviderClass; +begin + AClass := GetViewMenuProviderClass(AView); + if AClass = nil then + Result := nil + else + Result := AClass.Create(AView); +end; + +function GetViewMenuProviderClass(AView: TcxCustomGridView): TcxCustomGridViewMenuProviderClass; +begin + Result := TcxCustomGridViewMenuProviderClass(ViewMenuProviderClassList.FindClass(AView.ClassType)); +end; + +procedure RegisterViewMenuProviderClass(AViewClass: TcxCustomGridViewClass; + AViewMenuProviderClass: TcxCustomGridViewMenuProviderClass); +begin + ViewMenuProviderClassList.Register(AViewClass, AViewMenuProviderClass); +end; + +procedure UnregisterViewMenuProviderClass(AViewClass: TcxCustomGridViewClass; + AViewMenuProviderClass: TcxCustomGridViewMenuProviderClass); +begin + ViewMenuProviderClassList.Unregister(AViewClass, AViewMenuProviderClass); +end; + +function GetViewItemUniqueName(AView: TcxCustomGridView; AItem: TComponent; + const AItemName: string): string; +begin + Result := CreateUniqueName(AView.Owner{!!!}, AView, AItem, + Copy(AItem.ClassName, 1, Pos(AItemName, AItem.ClassName) - 1), ''); +end; + +{ TcxCustomGridViewStorage } + +constructor TcxCustomGridViewStorage.Create(AView: TcxCustomGridView); +begin + inherited Create(AView); + FView := AView; +end; + +class function TcxCustomGridViewStorage.GetViewClass: TcxCustomGridViewClass; +begin + Result := nil; +end; + +function TcxCustomGridViewStorage.GetObjectName: string; +begin + Result := GetViewClass.ClassName; +end; + +function TcxCustomGridViewStorage.GetProperties(AProperties: TStrings): Boolean; +begin + Result := False; +end; + +procedure TcxCustomGridViewStorage.GetPropertyValue(const AName: string; var AValue: Variant); +begin +end; + +procedure TcxCustomGridViewStorage.SetPropertyValue(const AName: string; const AValue: Variant); +begin +end; + +{ TcxViewEditor } + +class function TcxViewEditor.GetViewByObject(APersistent: TPersistent): TcxCustomGridView; +begin + Result := nil; +end; + +procedure TcxViewEditor.SetView(Value: TcxCustomGridView; ARefreshNeeded: Boolean); +begin + FView := Value; + if ARefreshNeeded then + UpdateEditor; + UpdateSelection; +end; + +procedure TcxViewEditor.BeginUpdate; +begin + FormEditor.BeginUpdate; +end; + +function TcxViewEditor.CanAddComponent: Boolean; +begin + Result := FormEditor.CanAddComponent; +end; + +function TcxViewEditor.CanDeleteComponent(AComponent: TComponent): Boolean; +begin + Result := FormEditor.CanDeleteComponent(AComponent); +end; + +procedure TcxViewEditor.EndUpdate; +begin + FormEditor.EndUpdate; +end; + +procedure TcxViewEditor.GetSelectionList(AList: TList); +begin + FormEditor.GetSelectionList(AList); +end; + +procedure TcxViewEditor.SelectComponent(AComponent: TPersistent); +begin + FormEditor.SelectComponent(AComponent); +end; + +function TcxViewEditor.UniqueName(AComponent: TComponent; + const ATruncateClassName: string = ScxGridPrefixName): string; +begin + Result := CreateUniqueName(OwnerForm, View, AComponent, ATruncateClassName, ''); +end; + +procedure TcxViewEditor.UpdateDesigner; +begin + FormEditor.Designer.Modified; +end; + +procedure TcxViewEditor.UpdateEditor; +begin +end; + +procedure TcxViewEditor.UpdateSelection; +begin +end; + +function TcxViewEditor.GetDataController: TcxCustomDataController; +begin + Result := FView.DataController; +end; + +function TcxViewEditor.GetOwnerForm: TComponent; +begin + Result := FormEditor.Component.Owner; +end; + +procedure TcxViewEditor.FormKeyPress(Sender: TObject; var Key: Char); +begin + case Key of + #13, #33..#126: + begin + if Key = #13 then Key := #0; + TcxDesignWindowAccess(FormEditor).ActivateInspector(Key); + Key := #0; + end; + end; +end; + +{ TcxGridViewMenuItems } + +constructor TcxGridViewMenuItems.Create; +begin + inherited; + FItems := TList.Create; +end; + +destructor TcxGridViewMenuItems.Destroy; +begin + ClearItems; + FItems.Free; + inherited; +end; + +function TcxGridViewMenuItems.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxGridViewMenuItems.GetItem(Index: Integer): TcxGridViewMenuItem; +begin + Result := TcxGridViewMenuItem(FItems[Index]); +end; + +procedure TcxGridViewMenuItems.ClearItems; +var + I: Integer; +begin + for I := Count - 1 downto 0 do + Delete(I); +end; + +function TcxGridViewMenuItems.AddItem(const ACaption: string; + AOnClick: TcxGridViewMenuItemActionEvent = nil; AEnabled: Boolean = True; + AChecked: Boolean = False; AData: TObject = nil): TcxGridViewMenuItem; +begin + Result := TcxGridViewMenuItem.Create(ACaption, AEnabled, AChecked, AData, AOnClick); + FItems.Add(Result); +end; + +function TcxGridViewMenuItems.AddSeparator: TcxGridViewMenuItem; +begin + Result := AddItem(cxGridViewMenuSeparatorCaption); +end; + +procedure TcxGridViewMenuItems.Delete(AIndex: Integer); +begin + Items[AIndex].Free; + FItems.Delete(AIndex); +end; + +procedure TcxGridViewMenuItems.Prepare(AMenuItem: TMenuItem); +var + I: Integer; + AChildMenuItem: TMenuItem; +begin + for I := 0 to Count - 1 do + begin + AChildMenuItem := CreateMenuItem(AMenuItem.Owner, ''); + Items[I].Prepare(AChildMenuItem); + AMenuItem.Add(AChildMenuItem); + end; +end; + +{$IFDEF DELPHI6} + +procedure TcxGridViewMenuItems.Prepare(const AMenuItem: TDesignMenuItem); +var + I: Integer; + AChildMenuItem: TDesignMenuItem; +begin + for I := 0 to Count - 1 do + begin + AChildMenuItem := AMenuItem.AddItem('', 0, False, True, Items[I].MenuItemClick); + Items[I].Prepare(AChildMenuItem); + end; +end; + +{$ENDIF} + +procedure TcxGridViewMenuItems.RemoveExcessSeparators; +var + APrevItemIsSeparator: Boolean; + I: Integer; +begin + APrevItemIsSeparator := True; + for I := Count - 1 downto 0 do + if Items[I].IsSeparator then + if APrevItemIsSeparator then + Delete(I) + else + APrevItemIsSeparator := True + else + begin + APrevItemIsSeparator := False; + Items[I].RemoveExcessSeparators; + end; +end; + +{ TcxGridViewMenuItem } + +constructor TcxGridViewMenuItem.Create(const ACaption: string; + AEnabled, AChecked: Boolean; AData: TObject; AOnAction: TcxGridViewMenuItemActionEvent); +begin + inherited Create; + Caption := ACaption; + Enabled := AEnabled; + Checked := AChecked; + Data := AData; + OnAction := AOnAction; +end; + +procedure TcxGridViewMenuItem.MenuItemClick(Sender: TObject); +begin + DoAction; +end; + +procedure TcxGridViewMenuItem.DoAction; +begin + if Assigned(OnAction) then OnAction(Self); +end; + +function TcxGridViewMenuItem.IsSeparator: Boolean; +begin + Result := Caption = cxGridViewMenuSeparatorCaption; +end; + +procedure TcxGridViewMenuItem.Prepare(AMenuItem: TMenuItem); +begin + AMenuItem.Caption := Caption; + AMenuItem.Enabled := Enabled; + AMenuItem.Checked := Checked; + if not Assigned(AMenuItem.OnClick) then + AMenuItem.OnClick := MenuItemClick; + inherited; +end; + +{$IFDEF DELPHI6} + +procedure TcxGridViewMenuItem.Prepare(const AMenuItem: TDesignMenuItem); +begin + AMenuItem.Caption := Caption; + AMenuItem.Enabled := Enabled; + AMenuItem.Checked := Checked; + inherited; +end; + +{$ENDIF} + +{ TcxCustomGridViewMenuProvider } + +constructor TcxCustomGridViewMenuProvider.Create(AGridView: TcxCustomGridView); +begin + inherited Create; + FGridView := AGridView; + FDesigner := GetObjectDesigner(GridView); + FDesignHelper := TcxDesignHelper.Create(GridView.Control); + FItems := TcxGridViewMenuItems.Create; + InitItems; + Items.RemoveExcessSeparators; +end; + +destructor TcxCustomGridViewMenuProvider.Destroy; +begin + FItems.Free; + FDesignHelper.Free; + inherited; +end; + +{$IFNDEF NONDB} + +procedure TcxCustomGridViewMenuProvider.GetDataSourceName(const S: string); +begin + FDataSourceNames.Add(S); +end; + +function TcxCustomGridViewMenuProvider.GetDBGridView: TcxCustomGridView; +begin + Result := GridView; + if not (Result.DataController is TcxDBDataController) then + Result := nil; +end; + +function TcxCustomGridViewMenuProvider.GetViewDataSource: TDataSource; +begin + Result := TcxDBDataController(DBGridView.DataController).DataSource; +end; + +procedure TcxCustomGridViewMenuProvider.SetViewDataSource(Value: TDataSource); +begin + TcxDBDataController(DBGridView.DataController).DataSource := Value; +end; + +{$ENDIF} + +procedure TcxCustomGridViewMenuProvider.DesignerModified; +begin + Designer.Modified; +end; + +procedure TcxCustomGridViewMenuProvider.ObjectCreated(AObject: TPersistent); +begin + SelectObject(AObject); + DesignerModified; +end; + +procedure TcxCustomGridViewMenuProvider.SelectObject(AObject: TPersistent); +begin + DesignHelper.SelectObject(AObject, True, False); +end; + +procedure TcxCustomGridViewMenuProvider.InitAdditionalItems; +begin + Items.AddItem('Edit Layout and Data...', EditLayoutAndData); + InitCopySettingsFromViewItem; + Items.AddItem('Set As Default', SetAsDefault); +end; + +procedure TcxCustomGridViewMenuProvider.InitCopySettingsFromViewItem; +var + AViewList: TcxGridViewList; + AItem: TcxGridViewMenuItem; + I: Integer; +begin + AViewList := TcxGridViewList.Create(Designer); + try + if AViewList.ViewNames.Count = 1 then Exit; + AItem := Items.AddItem('Copy Settings from View'); + for I := 0 to AViewList.ViewNames.Count - 1 do + if AViewList.Views[I] <> GridView then + AItem.AddItem(AViewList.ViewNames[I], CopySettings, True, False, AViewList.Views[I]); + finally + AViewList.Free; + end; +end; + +{$IFNDEF NONDB} + +procedure TcxCustomGridViewMenuProvider.InitDataBindingItems; +var + I: Integer; + AItem: TcxGridViewMenuItem; + ADataSourceNames: TStringList; + + function IsDataSourceLinked(AIndex: Integer): Boolean; + begin + Result := Designer.GetComponent(ADataSourceNames[AIndex]) = ViewDataSource; + end; + +begin + ADataSourceNames := GetDataSourceNames; + try + if ADataSourceNames.Count = 0 then Exit; + if ADataSourceNames.Count = 1 then + Items.AddItem('Link to ' + ADataSourceNames[0], LinkToDataSource, True, + IsDataSourceLinked(0), TObject(0)) + else + begin + AItem := Items.AddItem('Link to DataSource', nil, True, False); + for I := 0 to ADataSourceNames.Count - 1 do + AItem.AddItem(ADataSourceNames[I], LinkToDataSource, True, + IsDataSourceLinked(I), TObject(I)); + end; + finally + ADataSourceNames.Free; + end; +end; + +{$ENDIF} + +procedure TcxCustomGridViewMenuProvider.InitItems; +begin +{$IFNDEF NONDB} + if DBGridView <> nil then + begin + InitDataBindingItems; + Items.AddSeparator; + end; +{$ENDIF} + InitStructureItems; + Items.AddSeparator; + InitLayoutItems; + Items.AddSeparator; + InitAdditionalItems; +end; + +procedure TcxCustomGridViewMenuProvider.InitLayoutItems; +begin +end; + +procedure TcxCustomGridViewMenuProvider.InitStructureItems; +begin + Items.AddItem('Delete View', DeleteView, CanDeleteComponent(GridView.Owner, GridView)); +end; + +procedure TcxCustomGridViewMenuProvider.CopySettings(Sender: TcxGridViewMenuItem); +begin + GridView.AssignSettings(Sender.Data as TcxCustomGridView); + DesignerModified; +end; + +procedure TcxCustomGridViewMenuProvider.DeleteView(Sender: TcxGridViewMenuItem); +begin + SelectObject(GridView.Level); + GridView.Free; + DesignerModified; +end; + +procedure TcxCustomGridViewMenuProvider.EditLayoutAndData(Sender: TcxGridViewMenuItem); +begin + if ShowGridViewEditor(GridView) then + DesignerModified; +end; + +procedure TcxCustomGridViewMenuProvider.SetAsDefault(Sender: TcxGridViewMenuItem); +begin + SaveViewToTemplate(GetViewTemplateRegKey, GridView); +end; + +{$IFNDEF NONDB} + +function TcxCustomGridViewMenuProvider.GetDataSourceNames: TStringList; +begin + Result := TStringList.Create; + FDataSourceNames := Result; + Designer.GetComponentNames(GetTypeData(TypeInfo(TDataSource)), GetDataSourceName); + FDataSourceNames := nil; + Result.Sort; +end; + +procedure TcxCustomGridViewMenuProvider.LinkToDataSource(Sender: TcxGridViewMenuItem); +var + ADataSourceNames: TStringList; + ADataSource: TDataSource; +begin + ADataSourceNames := GetDataSourceNames; + try + ADataSource := TDataSource(Designer.GetComponent(ADataSourceNames[Integer(Sender.Data)])); + (DBGridView.DataController as IcxCustomGridDataController).DeleteAllItems; + ViewDataSource := ADataSource; + (DBGridView.DataController as IcxCustomGridDataController).CreateAllItems(False); + DesignerModified; + finally + ADataSourceNames.Free; + end; +end; + +{$ENDIF} + +{ TcxGridViewList } + +constructor TcxGridViewList.Create(ADesigner: IDesigner); +begin + inherited Create; + FDesigner := ADesigner; + FViewNames := TStringList.Create; + GetViewNames; + FViewNames.Sorted := True; +end; + +destructor TcxGridViewList.Destroy; +begin + FViewNames.Free; + inherited; +end; + +function TcxGridViewList.GetView(Index: Integer): TcxCustomGridView; +begin + if (0 <= Index) and (Index < ViewNames.Count) then + Result := Designer.GetComponent(ViewNames[Index]) as TcxCustomGridView + else + Result := nil; +end; + +procedure TcxGridViewList.AddViewName(const S: string); +begin + FViewNames.Add(S); +end; + +procedure TcxGridViewList.GetViewNames; +begin + ViewNames.Clear; + Designer.GetComponentNames(GetTypeData(PTypeInfo(TcxCustomGridView.ClassInfo)), AddViewName); +end; + +function TcxGridViewList.GetViewIndex(AView: TcxCustomGridView): Integer; +begin + Result := ViewNames.IndexOf(Designer.GetComponentName(AView)); +end; + +initialization + ViewEditorClassList := TcxRegisteredClassList.Create; + ViewMenuProviderClassList := TcxRegisteredClassList.Create; + RegisterViewMenuProviderClass(TcxCustomGridView, TcxCustomGridViewMenuProvider); + +finalization + UnregisterViewMenuProviderClass(TcxCustomGridView, TcxCustomGridViewMenuProvider); + FreeAndNil(ViewMenuProviderClassList); + FreeAndNil(ViewEditorClassList); + FreeAndNil(DefaultViewStorages); + +end. diff --git a/official/x.35/ExpressQuantumGrid 6/Sources/cxWWGridConverter.pas b/official/x.35/ExpressQuantumGrid 6/Sources/cxWWGridConverter.pas new file mode 100644 index 00000000..605f0792 --- /dev/null +++ b/official/x.35/ExpressQuantumGrid 6/Sources/cxWWGridConverter.pas @@ -0,0 +1,1077 @@ +{*******************************************************************} +{ } +{ Developer Express Cross Platform Component Library } +{ ExpressQuantumGrid } +{ } +{ Copyright (c) 2001-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL } +{ ACCOMPANYING VCL AND CLX CONTROLS AS PART OF AN EXECUTABLE } +{ PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} +unit cxWWGridConverter; + +interface + +{$I cxVer.inc} + +uses + Classes, SysUtils, cxConverterFactory, cxGridConverter, cxGridDBBandedTableView, cxGridCustomView, + DB, cxGraphics, cxCheckBox, Graphics, cxHyperLinkEdit, cxTextEdit, cxImage, cxSpinEdit, + StdCtrls, cxImageComboBox, cxButtonEdit, cxEdit, cxDBLookupComboBox, cxGrid, cxLookupDBGrid, + cxDropDownEdit, cxMRUEdit, cxMemo, cxCalendar, Controls, cxGridCustomTableView, cxStyles, + cxConverterUtils, cxCustomConverter; + +type + { TcxWWGridConverter } + TcxWWGridConverter = class(TcxCustomGridConverter) + private + FColor: Integer; + FFont: TFont; + FTitleColor: Integer; + FTitleFont: TFont; + function ExtractData(const AData: string; var AResultData: string; + AStartIndex: Integer; ASeparator: Char): Integer; + function GetCharCase(const ACharCase: string): TEditCharCase; + function GetcxGridView: TcxGridDBBandedTableView; + procedure GetFieldNames(AList: TStringList); + function GetFontWidth(AFont: TFont): Integer; + procedure ImportColumnCheckBox(AcxColumn: TcxGridDBBandedColumn; const AColumnData: string; + const AReadOnly: Boolean); + procedure ImportColumnCustomEdit(AcxColumn: TcxGridDBBandedColumn; const AColumnData: string); + procedure ImportColumnImage(AcxColumn: TcxGridDBBandedColumn; const AColumnData: string; + const AReadOnly: Boolean); + procedure ImportColumnRichEdit(AcxColumn: TcxGridDBBandedColumn; const AColumnData: string); + procedure ImportColumnText(AcxColumn: TcxGridDBBandedColumn; const AReadOnly: Boolean); + procedure ImportColumnUrlLink(AcxColumn: TcxGridDBBandedColumn; const AReadOnly: Boolean); + procedure ImportBands; + procedure ImportColumns; + procedure ImportGrid; + procedure ImportGridStyles; + procedure ImportWWCheckBox(AcxColumn: TcxGridDBBandedColumn; AComponent: TComponent); + procedure ImportWWComboBox(AcxColumn: TcxGridDBBandedColumn; AComponent: TComponent); + procedure ImportWWComboDlg(AcxColumn: TcxGridDBBandedColumn; AComponent: TComponent); + procedure ImportWWDateTimePicker(AcxColumn: TcxGridDBBandedColumn; AComponent: TComponent); + procedure ImportWWExpandButton(AcxColumn: TcxGridDBBandedColumn; AComponent: TComponent); + procedure ImportWWLookupCombo(AcxColumn: TcxGridDBBandedColumn; AComponent: TComponent); + procedure ImportWWLookupComboDlg(AcxColumn: TcxGridDBBandedColumn; AComponent: TComponent); + procedure ImportWWMonthCalendar(AcxColumn: TcxGridDBBandedColumn; AComponent: TComponent); + procedure ImportWWOptions; + procedure ImportWWRadioGroup(AcxColumn: TcxGridDBBandedColumn; AComponent: TComponent); + procedure ImportWWSpinEdit(AcxColumn: TcxGridDBBandedColumn; AComponent: TComponent); + procedure ImportWWTextEdit(AcxColumn: TcxGridDBBandedColumn; AComponent: TComponent); + function IsColumnDefault(const AFieldName: string): string; + function Pass(const AData: string; AStartIndex: Integer; AFieldCount: Integer; + ASeparator: Char): Integer; + protected + procedure DoRealImport; override; + procedure DoImportStyles; override; + function GetGridViewClass: TcxCustomGridViewClass; override; + property cxGridView: TcxGridDBBandedTableView read GetcxGridView; + public + class function GetSourceClassName: string; override; + end; + +implementation + +uses cxGridTableView; + +{ TcxWWGridConverter } + +class function TcxWWGridConverter.GetSourceClassName: string; +begin + Result := 'TwwDBGrid'; +end; + +procedure TcxWWGridConverter.DoRealImport; +begin + cxGridView.DataController.DataSource := GetClassProperty(nil, 'DataSource') as TDataSource; + ImportBands; + ImportColumns; + ImportGrid; +end; + +procedure TcxWWGridConverter.DoImportStyles; +begin + ImportGridStyles; +end; + +function TcxWWGridConverter.GetGridViewClass: TcxCustomGridViewClass; +begin + Result := TcxGridDBBandedTableView; +end; + +function TcxWWGridConverter.ExtractData(const AData: string; var AResultData: string; + AStartIndex: Integer; ASeparator: Char): Integer; +begin + Result := AStartIndex; + AResultData := ''; + while Result <= Length(AData) do + begin + if AData[Result] = ASeparator then + begin + Inc(Result); + Break; + end; + AResultData := AResultData + AData[Result]; + Inc(Result); + end; +end; + +function TcxWWGridConverter.GetCharCase(const ACharCase: string): TEditCharCase; +begin + if ACharCase = 'ecNormal' then + Result := ecNormal + else if ACharCase = 'ecUpperCase' then + Result := ecUpperCase + else if ACharCase = 'ecLowerCase' then + Result := ecLowerCase + else + Result := ecNormal; +end; + +function TcxWWGridConverter.GetcxGridView: TcxGridDBBandedTableView; +begin + Result := inherited cxGridView as TcxGridDBBandedTableView; +end; + +procedure TcxWWGridConverter.GetFieldNames(AList: TStringList); +var + ADataSource: TDataSource; + I: Integer; +begin + ADataSource := GetClassProperty(nil, 'DataSource') as TDataSource; + if ADataSource <> nil then + if ADataSource.DataSet <> nil then + with ADataSource.DataSet do + for I := 0 to Fields.Count - 1 do + AList.Add(Fields[I].FieldName + ';' + IntToStr(Fields[I].DisplayWidth)); +end; + +function TcxWWGridConverter.GetFontWidth(AFont: TFont): Integer; +var + APrevFont: TFont; +begin + Result := 0; + if AFont = nil then + Exit; + with Destination.Canvas do + begin + APrevFont := TFont.Create; + try + APrevFont.Assign(Font); + Canvas.Font := AFont; + Result := Canvas.TextWidth('X'); + Canvas.Font := APrevFont; + finally + APrevFont.Free; + end; + end; +end; + +procedure TcxWWGridConverter.ImportColumnCheckBox(AcxColumn: TcxGridDBBandedColumn; + const AColumnData: string; const AReadOnly: Boolean); +var + AValueChecked: string; + AValueUnchecked: string; + AIndex: Integer; +begin + AcxColumn.PropertiesClass := TcxCheckBoxProperties; + with TcxCheckBoxProperties(AcxColumn.Properties) do + begin + ReadOnly := AReadOnly; + AIndex := Pass(AColumnData, 1, 2, ';'); + AIndex := ExtractData(AColumnData, AValueChecked, AIndex, ';'); + ExtractData(AColumnData, AValueUnchecked, AIndex, ';'); + ValueChecked := AValueChecked; + ValueUnchecked := AValueUnchecked; + NullStyle := nssUnchecked; + end; +end; + +procedure TcxWWGridConverter.ImportColumnCustomEdit(AcxColumn: TcxGridDBBandedColumn; const AColumnData: string); +var + AComponentName: string; + AComponent: TComponent; + AIndex: Integer; +begin + AIndex := Pass(AColumnData, 1, 2, ';'); + ExtractData(AColumnData, AComponentName, AIndex, ';'); + ///////////////////////////////////////////////////////////////////// + //AComponent := Source.Owner.FindComponent(AComponentName); + ///////////////////////////////////////////////////////////////////// + AComponent := Designer_.GetComponent(AComponentName); + if AComponent <> nil then + begin + if AComponent.ClassName = 'TwwDBSpinEdit' then + ImportWWSpinEdit(AcxColumn, AComponent) + else if AComponent.ClassName = 'TwwDBEdit' then + ImportWWTextEdit(AcxColumn, AComponent) + else if AComponent.ClassName = 'TwwDBComboBox' then + ImportWWComboBox(AcxColumn, AComponent) + else if AComponent.ClassName = 'TwwDBComboDlg' then + ImportWWComboDlg(AcxColumn, AComponent) + else if AComponent.ClassName = 'TwwDBLookupCombo' then + ImportWWLookupCombo(AcxColumn, AComponent) + else if AComponent.ClassName = 'TwwDBLookupComboDlg' then + ImportWWLookupComboDlg(AcxColumn, AComponent) + else if AComponent.ClassName = 'TwwDBMonthCalendar' then + ImportWWMonthCalendar(AcxColumn, AComponent) + else if AComponent.ClassName = 'TwwDBDateTimePicker' then + ImportWWDateTimePicker(AcxColumn, AComponent) + else if AComponent.ClassName = 'TwwCheckBox' then + ImportWWCheckBox(AcxColumn, AComponent) + else if AComponent.ClassName = 'TwwExpandButton' then + ImportWWExpandButton(AcxColumn, AComponent) + else if AComponent.ClassName = 'TwwRadioGroup' then + ImportWWRadioGroup(AcxColumn, AComponent); + end; +end; + +procedure TcxWWGridConverter.ImportColumnImage(AcxColumn: TcxGridDBBandedColumn; + const AColumnData: string; const AReadOnly: Boolean); +var + AIndex: Integer; + AValue1: string; +begin + AcxColumn.PropertiesClass := TcxImageProperties; + with TcxImageProperties(AcxColumn.Properties) do + begin + ReadOnly := AReadOnly; + AIndex := Pass(AColumnData, 1, 2, ';'); + ExtractData(AColumnData, AValue1, AIndex, ';'); + Stretch := AValue1 = 'Stretch To Fit'; + end; +end; + +procedure TcxWWGridConverter.ImportColumnRichEdit(AcxColumn: TcxGridDBBandedColumn; + const AColumnData: string); +var + AComponentName: string; + AComponent: TComponent; + AIndex: Integer; +begin + AIndex := Pass(AColumnData, 1, 2, ';'); + ExtractData(AColumnData, AComponentName, AIndex, ';'); + ///////////////////////////////////////////////////////////////////// + //AComponent := Source.Owner.FindComponent(AComponentName); + ///////////////////////////////////////////////////////////////////// + AComponent := Designer_.GetComponent(AComponentName); + if AComponent <> nil then + begin + AcxColumn.PropertiesClass := TcxMemoProperties; + with TcxMemoProperties(AcxColumn.Properties) do + begin + Alignment := ConvertAlignment(GetEnumProperty(AComponent, 'Alignment')); + ReadOnly := GetBooleanProperty(AComponent, 'ReadOnly', ReadOnly); + AutoSelect := GetBooleanProperty(AComponent, 'AutoSelect', AutoSelect); + HideSelection := GetBooleanProperty(AComponent, 'HideSelection', HideSelection); + MaxLength := GetIntegerProperty(AComponent, 'MaxLength', MaxLength); + ScrollBars := ConvertScrollStyle(GetEnumProperty(AComponent, 'ScrollBars')); + WantReturns := GetBooleanProperty(AComponent, 'WantReturns', WantReturns); + WantTabs := GetBooleanProperty(AComponent, 'WantTabs', WantTabs); + WordWrap := GetBooleanProperty(AComponent, 'WordWrap', WordWrap); + end; + end; +end; + +procedure TcxWWGridConverter.ImportColumnText(AcxColumn: TcxGridDBBandedColumn; + const AReadOnly: Boolean); +begin + AcxColumn.PropertiesClass := TcxTextEditProperties; + with TcxTextEditProperties(AcxColumn.Properties) do + ReadOnly := AReadOnly; +end; + +procedure TcxWWGridConverter.ImportColumnUrlLink(AcxColumn: TcxGridDBBandedColumn; + const AReadOnly: Boolean); +begin + AcxColumn.PropertiesClass := TcxHyperLinkEditProperties; + with TcxHyperLinkEditProperties(AcxColumn.Properties) do + ReadOnly := AReadOnly; +end; + +procedure TcxWWGridConverter.ImportBands; +begin + cxGridView.OptionsView.BandHeaders := False; + cxGridView.Bands.Add; +end; + +procedure TcxWWGridConverter.ImportColumns; +var + AColumns: TStringList; + AColumnsNeedFree: Boolean; + AcxColumn: TcxGridDBBandedColumn; + I: Integer; + AFieldName: string; + AWidth: string; + AHeader: string; + AReadOnlyString: string; + AReadOnly: Boolean; + AColumnData: string; + AControlType: string; + AIndex: Integer; + AFontWidth: Integer; + AFieldColumns: Boolean; + ASelected: TStringList; +begin + AColumnsNeedFree := False; + ASelected := GetClassProperty(nil, 'Selected') as TStringList; + if ASelected <> nil then + begin + if ASelected.Count = 0 then + begin + AColumns := TStringList.Create; + AColumnsNeedFree := True; + GetFieldNames(AColumns); + AFieldColumns := True; + end + else + begin + AFieldColumns := False; + if cxGridView.DataController.DataSource <> nil then + AColumns := ASelected + else + begin + AColumns := TStringList.Create; + AColumnsNeedFree := True; + end; + end; + end + else + begin + AColumns := TStringList.Create; + AColumnsNeedFree := True; + GetFieldNames(AColumns); + AFieldColumns := True; + end; + try + AFontWidth := GetFontWidth(GetClassProperty(nil, 'Font') as TFont); + for I := 0 to AColumns.Count - 1 do + begin + if AFieldColumns then + begin + AIndex := ExtractData(AColumns[I], AFieldName, 1, ';'); + ExtractData(AColumns[I], AWidth, AIndex, ';'); + AHeader := AFieldName; + AReadOnly := False; + end + else + begin + AIndex := ExtractData(AColumns[I], AFieldName, 1, #9); + AIndex := ExtractData(AColumns[I], AWidth, AIndex, #9); + AIndex := ExtractData(AColumns[I], AHeader, AIndex, #9); + ExtractData(AColumns[I], AReadOnlyString, AIndex, #9); + AReadOnly := AReadOnlyString = 'T'; + end; + AcxColumn := cxGridView.CreateColumn; + AcxColumn.DataBinding.FieldName := AFieldName; + AcxColumn.Name := UniqueColumnName(AcxColumn, AcxColumn.DataBinding.FieldName); + AcxColumn.Width := StrToInt(AWidth) * AFontWidth; + AcxColumn.Caption := AHeader; + AcxColumn.HeaderAlignmentHorz := ConvertAlignment(GetEnumProperty(nil, 'TitleAlignment')); + AColumnData := IsColumnDefault(AFieldName); + if AColumnData <> '' then + begin + AIndex := Pass(AColumnData, 1, 1, ';'); + ExtractData(AColumnData, AControlType, AIndex, ';'); + if AControlType = 'Bitmap' then + ImportColumnImage(AcxColumn, AColumnData, AReadOnly) + else if AControlType = 'CheckBox' then + ImportColumnCheckBox(AcxColumn, AColumnData, AReadOnly) + else if AControlType = 'CustomEdit' then + begin + if Designer_ <> nil then + ImportColumnCustomEdit(AcxColumn, AColumnData); + end + else if AControlType = 'ImageIndex' then + else if AControlType = 'URL-Link' then + ImportColumnUrlLink(AcxColumn, AReadOnly) + else if AControlType = 'RichEdit' then + begin + if Designer_ <> nil then + ImportColumnRichEdit(AcxColumn, AColumnData); + end + end + else + if AReadOnly then + ImportColumnText(AcxColumn, AReadOnly); + AcxColumn.Position.BandIndex := 0; + end; + finally + if AColumnsNeedFree then + AColumns.Free; + end; +end; + +procedure TcxWWGridConverter.ImportGrid; +begin + ImportWWOptions; +end; + +procedure TcxWWGridConverter.ImportGridStyles; +var + AStyle: TcxCustomStyle; + AObject: TObject; + AHighligntColor: Integer; + AShadowColor: Integer; + AAlternatingRowColor: Integer; + AActiveRecordColor: Integer; +begin + FColor := GetIntegerProperty(nil, 'Color'); + FFont := GetClassProperty(nil, 'Font') as TFont; + if (FColor <> clWindow) or not DefaultFont(FFont) then + begin + AStyle := CreateStyleItem; + (AStyle as TcxStyle).Color := FColor; + (AStyle as TcxStyle).Font.Assign(FFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + cxGridView.Styles.Content := AStyle as TcxStyle; + end; + FTitleColor := GetIntegerProperty(nil, 'TitleColor'); + FTitleFont := GetClassProperty(nil, 'TitleFont') as TFont; + if (FTitleColor <> clBtnFace) or not DefaultFont(FTitleFont) then + begin + AStyle := CreateStyleItem; + (AStyle as TcxStyle).Color := FTitleColor; + (AStyle as TcxStyle).Font.Assign(FTitleFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + cxGridView.Styles.Header := AStyle as TcxStyle; + cxGridView.Styles.Footer := AStyle as TcxStyle; + cxGridView.Styles.Background := AStyle as TcxStyle; + cxGridView.Styles.Indicator := AStyle as TcxStyle; + end; + AObject := GetClassProperty(nil, 'LineColors'); + if AObject <> nil then + begin + AHighligntColor := GetIntegerProperty(AObject, 'HighlightColor'); + if AHighligntColor <> clBtnHighlight then + cxGridView.OptionsView.GridLineColor := AHighligntColor + else + begin + AShadowColor := GetIntegerProperty(AObject, 'ShadowColor'); + if AShadowColor <> clBtnShadow then + cxGridView.OptionsView.GridLineColor := AShadowColor; + end; + end; + AObject := GetClassProperty(nil, 'PaintOptions'); + if AObject <> nil then + begin + AAlternatingRowColor := GetIntegerProperty(AObject, 'AlternatingRowColor'); + if AAlternatingRowColor <> clNone then + begin + AStyle := CreateStyleItem; + (AStyle as TcxStyle).Color := AAlternatingRowColor; + (AStyle as TcxStyle).Font.Assign(FFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + cxGridView.Styles.ContentOdd := AStyle as TcxStyle; + end; + AActiveRecordColor := GetIntegerProperty(AObject, 'ActiveRecordColor'); + if AActiveRecordColor <> clNone then + begin + AStyle := CreateStyleItem; + (AStyle as TcxStyle).Color := AActiveRecordColor; + (AStyle as TcxStyle).Font.Assign(FFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + cxGridView.Styles.Selection := AStyle as TcxStyle; + end; + end; +end; + +procedure TcxWWGridConverter.ImportWWCheckBox(AcxColumn: TcxGridDBBandedColumn; AComponent: TComponent); + function GetNullStyle(const AStyle: string): TcxCheckBoxNullValueShowingStyle; + begin + if AStyle = 'cbGrayed' then + Result := nssGrayedChecked + else if AStyle = 'cbUnchecked' then + Result := nssUnchecked + else + Result := nssInactive; + end; +begin + AcxColumn.PropertiesClass := TcxCheckBoxProperties; + with TcxCheckBoxProperties(AcxColumn.Properties) do + begin + Alignment := ConvertAlignment(GetEnumProperty(AComponent, 'Alignment')); + AllowGrayed := GetBooleanProperty(AComponent, 'AllowGrayed', AllowGrayed); +// Caption := GetStringProperty(AComponent, 'Caption', Caption); + DisplayChecked := GetStringProperty(AComponent, 'DisplayValueChecked', DisplayChecked); + DisplayUnchecked := GetStringProperty(AComponent, 'DisplayValueUnchecked', DisplayUnchecked); + FullFocusRect := GetBooleanProperty(AComponent, 'ShowFocusRect', FullFocusRect); + NullStyle := GetNullStyle(GetEnumProperty(AComponent, 'NullAndBlankState')); + ReadOnly := GetBooleanProperty(AComponent, 'ReadOnly', ReadOnly); + ValueChecked := GetStringProperty(AComponent, 'ValueChecked', ValueChecked); + ValueUnchecked := GetStringProperty(AComponent, 'ValueUnchecked', ValueUnchecked); + end; +end; + +procedure TcxWWGridConverter.ImportWWComboBox(AcxColumn: TcxGridDBBandedColumn; AComponent: TComponent); +var + AwwItems: TStringList; + AValue: string; + AIndex: Integer; + + procedure ImportToImageComboBox; + var + I: Integer; + AItem: TcxImageComboBoxItem; + ADescription: string; + begin + AcxColumn.PropertiesClass := TcxImageComboBoxProperties; + with TcxImageComboBoxProperties(AcxColumn.Properties) do + begin + ReadOnly := GetBooleanProperty(AComponent, 'ReadOnly', ReadOnly); + AwwItems := GetClassProperty(AComponent, 'Items') as TStringList; + if AwwItems <> nil then + begin + for I := 0 to AwwItems.Count - 1 do + begin + AItem := Items.Add as TcxImageComboBoxItem; + AIndex := ExtractData(AwwItems[I], ADescription, 1, #9); + ExtractData(AwwItems[I], AValue, AIndex, #9); + AItem.Description := ADescription; + AItem.Value := AValue; + end; + end; + if GetEnumProperty(AComponent, 'ButtonStyle') = 'cbsCustom' then + ButtonGlyph.Assign(GetClassProperty(AComponent, 'ButtonGlyph') as TBitmap); + ImmediateDropDown := GetBooleanProperty(AComponent, 'AutoDropDown', ImmediateDropDown); + DropDownRows := GetIntegerProperty(AComponent, 'DropDownCount', DropDownRows); + end; + end; + + procedure ImportToMRUEdit; + var + I: Integer; + begin + AcxColumn.PropertiesClass := TcxMRUEditProperties; + with TcxMRUEditProperties(AcxColumn.Properties) do + begin + ReadOnly := GetBooleanProperty(AComponent, 'ReadOnly', ReadOnly); + AwwItems := GetClassProperty(AComponent, 'Items') as TStringList; + if AwwItems <> nil then + begin + for I := 0 to AwwItems.Count - 1 do + begin + AIndex := Pass(AwwItems[I], 1, 1, #9); + ExtractData(AwwItems[I], AValue, AIndex, #9); + LookupItems.Add(AValue); + end; + end; + if GetEnumProperty(AComponent, 'ButtonStyle') = 'cbsCustom' then + ButtonGlyph.Assign(GetClassProperty(AComponent, 'ButtonGlyph') as TBitmap); + ImmediateDropDown := GetBooleanProperty(AComponent, 'AutoDropDown', ImmediateDropDown); + DropDownRows := GetIntegerProperty(AComponent, 'DropDownCount', DropDownRows); + ShowEllipsis := False; + end; + end; +var + AWWHistory: TObject; +begin + AWWHistory := GetClassProperty(AComponent, 'HistoryList'); + if AWWHistory <> nil then + begin + if GetBooleanProperty(AWWHistory, 'Enabled', False) then + ImportToMRUEdit + else + ImportToImageComboBox; + end + else + ImportToImageComboBox; +end; + +procedure TcxWWGridConverter.ImportWWComboDlg(AcxColumn: TcxGridDBBandedColumn; AComponent: TComponent); +var + AButton: TcxEditButton; + AButtonStyle: string; +begin + AcxColumn.PropertiesClass := TcxButtonEditProperties; + with TcxButtonEditProperties(AcxColumn.Properties) do + begin + Buttons.Clear; + AButton := Buttons.Add; + AButton.Glyph.Assign(GetClassProperty(AComponent, 'ButtonGlyph') as TBitmap); + AButtonStyle := GetEnumProperty(AComponent, 'ButtonStyle'); + if AButtonStyle = 'cbsCustom' then + AButton.Kind := bkGlyph + else if AButtonStyle = 'cbsEllipsis' then + AButton.Kind := bkEllipsis + else if AButtonStyle = 'cbsDownArrow' then + AButton.Kind := bkDown; + AButton.Width := GetIntegerProperty(AComponent, 'ButtonWidth', AButton.Width); + CharCase := GetCharCase(GetEnumProperty(AComponent, 'CharCase')); + MaxLength := GetIntegerProperty(AComponent, 'MaxLength', MaxLength); + ReadOnly := GetBooleanProperty(AComponent, 'ReadOnly', ReadOnly); + AButton.Visible := GetBooleanProperty(AComponent, 'ShowButton', AButton.Visible); + end; +end; + +procedure TcxWWGridConverter.ImportWWDateTimePicker(AcxColumn: TcxGridDBBandedColumn; AComponent: TComponent); + function GetCalendarAlignment(const AValue: string): TAlignment; + begin + if AValue = 'wwdtaCenter' then + Result := taCenter + else if AValue = 'wwdtaLeft' then + Result := taLeftJustify + else if AValue = 'wwdtaRight' then + Result := taRightJustify + else + Result := taCenter; + end; +var + AWWCalendarAttributes: TObject; + ADateButtons: TDateButtons; + AWWOptions: TStringList; + I: Integer; +begin + AcxColumn.PropertiesClass := TcxDateEditProperties; + with TcxDateEditProperties(AcxColumn.Properties) do + begin + AWWCalendarAttributes := GetClassProperty(AComponent, 'CalendarAttributes'); + if AWWCalendarAttributes <> nil then + Alignment.Horz := GetCalendarAlignment(GetEnumProperty(AWWCalendarAttributes, 'Alignment')); + ButtonGlyph.Assign(GetClassProperty(AComponent, 'ButtonGlyph') as TBitmap); + ADateButtons := [btnClear]; + if AWWCalendarAttributes <> nil then + begin + AWWOptions := TStringList.Create; + try + EnablePropertyException; + try + GetSetProperty(AWWCalendarAttributes, 'Options', AWWOptions); + if not AWWOptions.Find('mdoNoToday', I) then + Include(ADateButtons, btnToday); + DateButtons := ADateButtons; + except + on EcxUnknownProperty do; + end; + finally + AWWOptions.Free; + DisablePropertyException; + end; + end; + end; +end; + +procedure TcxWWGridConverter.ImportWWExpandButton(AcxColumn: TcxGridDBBandedColumn; AComponent: TComponent); +begin +end; + +procedure TcxWWGridConverter.ImportWWLookupCombo(AcxColumn: TcxGridDBBandedColumn; + AComponent: TComponent); +var + AListDataSource: TDataSource; + AListTable: TObject; + AIndex: Integer; + ASelected: TStringList; + I: Integer; + AListFieldName: string; + AListFieldWidth: string; + AListFieldCaption: string; + AcxLookupColumn: TcxLookupDBGridColumn; + AWWOptions: TStringList; + AString: string; + AWWSeqSearchOptions: TStringList; +begin + AcxColumn.PropertiesClass := TcxLookupComboBoxProperties; + with TcxLookupComboBoxProperties(AcxColumn.Properties) do + begin + AListTable := GetClassProperty(AComponent, 'LookupTable'); + if AListTable <> nil then + begin + AListDataSource := TDataSource.Create(cxGridView); + AListDataSource.DataSet := AListTable as TDataSet; + ListSource := AListDataSource; + KeyFieldNames := GetStringProperty(AComponent, 'LookupField', ''); + ASelected := GetClassProperty(AComponent, 'Selected') as TStringList; + if ASelected <> nil then + begin + for I := 0 to ASelected.Count - 1 do + begin + AIndex := ExtractData(ASelected[I], AListFieldName, 1, #9); + AIndex := ExtractData(ASelected[I], AListFieldWidth, AIndex, #9); + ExtractData(ASelected[I], AListFieldCaption, AIndex, #9); + AcxLookupColumn := ListColumns.Add; + AcxLookupColumn.FieldName := AListFieldName; + AcxLookupColumn.Caption := AListFieldCaption; + AcxLookupColumn.Width := StrToInt(AListFieldWidth) * + GetFontWidth(GetClassProperty(nil, 'Font') as TFont); + end; + end; + DropDownWidth := GetIntegerProperty(AComponent, 'DropDownWidth', DropDownWidth); + if DropDownWidth = 0 then + begin + for I := 0 to ListColumns.Count - 1 do + DropDownWidth := DropDownWidth + ListColumns[I].Width; + end; + DropDownRows := GetIntegerProperty(AComponent, 'DropDownCount', DropDownRows); + if GetEnumProperty(AComponent, 'ButtonStyle') = 'cbsCustom' then + ButtonGlyph.Assign(GetClassProperty(AComponent, 'ButtonGlyph') as TBitmap); + ReadOnly := GetBooleanProperty(AComponent, 'ReadOnly', ReadOnly); + PopupAlignment := ConvertAlignment(GetEnumProperty(AComponent, 'DropDownAlignment')); + AString := GetEnumProperty(AComponent, 'Style'); + if AString = 'csDropDown' then + DropDownListStyle := lsEditList + else + DropDownListStyle := lsFixedList; + ImmediateDropDown := GetBooleanProperty(AComponent, 'AutoDropDown', ImmediateDropDown); + AWWSeqSearchOptions := TStringList.Create; + try + EnablePropertyException; + try + GetSetProperty(AComponent, 'SeqSearchOptions', AWWSeqSearchOptions); + AWWSeqSearchOptions.Sort; + IncrementalFiltering := AWWSeqSearchOptions.Find('ssoEnabled', I); + ListOptions.CaseInsensitive := not AWWSeqSearchOptions.Find('ssoCaseSensitive', I); + except + on EcxUnknownProperty do; + end; + finally + AWWSeqSearchOptions.Free; + DisablePropertyException; + end; + AWWOptions := TStringList.Create; + try + EnablePropertyException; + try + GetSetProperty(AComponent, 'Options', AWWOptions); + AWWOptions.Sort; + if AWWOptions.Find('loColLines', I) then + begin + if AWWOptions.Find('loRowLines', I) then + ListOptions.GridLines := glBoth + else + ListOptions.GridLines := glVertical; + end + else + begin + if AWWOptions.Find('loRowLines', I) then + ListOptions.GridLines := glHorizontal + else + ListOptions.GridLines := glNone; + end; + ListOptions.ShowHeader := AWWOptions.Find('loTitles', I); + except + on EcxUnknownProperty do; + end; + finally + AWWOptions.Free; + DisablePropertyException; + end; + end; + end; +end; + +procedure TcxWWGridConverter.ImportWWLookupComboDlg(AcxColumn: TcxGridDBBandedColumn; + AComponent: TComponent); +var + AListDataSource: TDataSource; + AListTable: TObject; + AIndex: Integer; + ASelected: TStringList; + I: Integer; + AListFieldName: string; + AListFieldWidth: string; + AListFieldCaption: string; + AcxLookupColumn: TcxLookupDBGridColumn; + AString: string; + AWWSeqSearchOptions: TStringList; + AWWGridOptions: TStringList; +begin + AcxColumn.PropertiesClass := TcxLookupComboBoxProperties; + with TcxLookupComboBoxProperties(AcxColumn.Properties) do + begin + AListTable := GetClassProperty(AComponent, 'LookupTable'); + if AListTable <> nil then + begin + AListDataSource := TDataSource.Create(cxGridView); + AListDataSource.DataSet := AListTable as TDataSet; + ListSource := AListDataSource; + KeyFieldNames := GetStringProperty(AComponent, 'LookupField', ''); + ASelected := GetClassProperty(AComponent, 'Selected') as TStringList; + if ASelected <> nil then + begin + for I := 0 to ASelected.Count - 1 do + begin + AIndex := ExtractData(ASelected[I], AListFieldName, 1, #9); + AIndex := ExtractData(ASelected[I], AListFieldWidth, AIndex, #9); + ExtractData(ASelected[I], AListFieldCaption, AIndex, #9); + AcxLookupColumn := ListColumns.Add; + AcxLookupColumn.FieldName := AListFieldName; + AcxLookupColumn.Caption := AListFieldCaption; + AcxLookupColumn.Width := StrToInt(AListFieldWidth) * + GetFontWidth(GetClassProperty(nil, 'Font') as TFont); + end; + end; + DropDownWidth := 0; + for I := 0 to ListColumns.Count - 1 do + DropDownWidth := DropDownWidth + ListColumns[I].Width; + if GetEnumProperty(AComponent, 'ButtonStyle') = 'cbsCustom' then + ButtonGlyph.Assign(GetClassProperty(AComponent, 'ButtonGlyph') as TBitmap); + ReadOnly := GetBooleanProperty(AComponent, 'ReadOnly', ReadOnly); + AString := GetEnumProperty(AComponent, 'Style'); + if AString = 'csDropDown' then + DropDownListStyle := lsEditList + else + DropDownListStyle := lsFixedList; + ImmediateDropDown := GetBooleanProperty(AComponent, 'AutoDropDown', ImmediateDropDown); + AWWSeqSearchOptions := TStringList.Create; + try + EnablePropertyException; + try + GetSetProperty(AComponent, 'SeqSearchOptions', AWWSeqSearchOptions); + AWWSeqSearchOptions.Sort; + IncrementalFiltering := AWWSeqSearchOptions.Find('ssoEnabled', I); + ListOptions.CaseInsensitive := not AWWSeqSearchOptions.Find('ssoCaseSensitive', I); + except + on EcxUnknownProperty do; + end; + finally + AWWSeqSearchOptions.Free; + DisablePropertyException; + end; + AWWGridOptions := TStringList.Create; + try + EnablePropertyException; + try + GetSetProperty(AComponent, 'GridOptions', AWWGridOptions); + AWWGridOptions.Sort; + if AWWGridOptions.Find('dgColLines', I) then + begin + if AWWGridOptions.Find('dgRowLines', I) then + ListOptions.GridLines := glBoth + else + ListOptions.GridLines := glVertical; + end + else + begin + if AWWGridOptions.Find('dgRowLines', I) then + ListOptions.GridLines := glHorizontal + else + ListOptions.GridLines := glNone; + end; + ListOptions.ShowHeader := AWWGridOptions.Find('dgTitles', I); + except + on EcxUnknownProperty do; + end; + finally + AWWGridOptions.Free; + DisablePropertyException; + end; + end; + end; +end; + +procedure TcxWWGridConverter.ImportWWMonthCalendar(AcxColumn: TcxGridDBBandedColumn; AComponent: TComponent); +var + AWWOptions: TStringList; + ADateButtons: TDateButtons; + I: Integer; +begin + AcxColumn.PropertiesClass := TcxDateEditProperties; + with TcxDateEditProperties(AcxColumn.Properties) do + begin + AWWOptions := TStringList.Create; + try + EnablePropertyException; + try + GetSetProperty(AComponent, 'Options', AWWOptions); + ADateButtons := [btnClear]; + if not AWWOptions.Find('mdoNoToday', I) then + Include(ADateButtons, btnToday); + DateButtons := ADateButtons; + except + on EcxUnknownProperty do; + end; + finally + AWWOptions.Free; + DisablePropertyException; + end; + DateOnError := deToday; + end; +end; + +procedure TcxWWGridConverter.ImportWWOptions; +var + AOptions: TStringList; + I: Integer; +begin + AOptions := TStringList.Create; + try + EnablePropertyException; + try + GetSetProperty(nil, 'Options', AOptions); + AOptions.Sort; + with cxGridView do + begin + OptionsBehavior.AlwaysShowEditor := AOptions.Find('dgAlwaysShowEditor', I); + OptionsData.Editing := AOptions.Find('dgEditing', I); + OptionsView.Header := AOptions.Find('dgTitles', I); + OptionsView.Indicator := AOptions.Find('dgIndicator', I); + OptionsCustomize.ColumnHorzSizing := AOptions.Find('dgColumnResize', I); + if AOptions.Find('dgColLines', I) then + begin + if AOptions.Find('dgRowLines', I) then + OptionsView.GridLines := glBoth + else + OptionsView.GridLines := glVertical; + end + else + begin + if AOptions.Find('dgRowLines', I) then + OptionsView.GridLines := glHorizontal + else + OptionsView.GridLines := glNone; + end; + OptionsBehavior.FocusCellOnTab := AOptions.Find('dgTabs', I); + OptionsSelection.CellSelect := not AOptions.Find('dgRowSelect', I); + OptionsSelection.HideSelection := not AOptions.Find('dgAlwaysShowSelection', I); + OptionsData.DeletingConfirmation := AOptions.Find('dgConfirmDelete', I); + OptionsData.CancelOnExit := AOptions.Find('dgCancelOnExit', I); + OptionsSelection.MultiSelect := AOptions.Find('dgMultiSelect', I); + OptionsView.Footer := AOptions.Find('dgShowFooter', I); + OptionsBehavior.FocusCellOnCycle := not AOptions.Find('dgTabExitsOnLastCol', I); + end; + AOptions.Clear; + GetSetProperty(nil, 'KeyOptions', AOptions); + AOptions.Sort; + with cxGridView do + begin + OptionsBehavior.GoToNextCellOnEnter := AOptions.Find('dgEnterToTab', I); + OptionsData.Deleting := AOptions.Find('dgAllowDelete', I); + OptionsData.Inserting := AOptions.Find('dgAllowInsert', I); + end; + except + on EcxUnknownProperty do; + end; + finally + AOptions.Free; + DisablePropertyException; + end; +end; + +procedure TcxWWGridConverter.ImportWWRadioGroup(AcxColumn: TcxGridDBBandedColumn; AComponent: TComponent); +var + AWWItems: TStringList; + AWWValues: TStringList; + AcxItem: TcxImageComboBoxItem; + I: Integer; +begin + AcxColumn.PropertiesClass := TcxImageComboBoxProperties; + with TcxImageComboBoxProperties(AcxColumn.Properties) do + begin + AWWItems := GetClassProperty(AComponent, 'Items') as TStringList; + AWWValues := GetClassProperty(AComponent, 'Values') as TStringList; + if (AWWItems <> nil) and (AWWValues <> nil) then + begin + for I := 0 to AWWItems.Count - 1 do + begin + AcxItem := Items.Add as TcxImageComboBoxItem; + AcxItem.Description := AWWItems[I]; + if I < AWWValues.Count then + AcxItem.Value := AWWValues[I]; + end; + end; + ReadOnly := GetBooleanProperty(AComponent, 'ReadOnly', ReadOnly); + Images := GetClassProperty(AComponent, 'GlyphImages') as TImageList; + ShowDescriptions := GetBooleanProperty(AComponent, 'ShowText', ShowDescriptions); + end; + AcxColumn.Options.ShowEditButtons := isebAlways; +end; + +procedure TcxWWGridConverter.ImportWWSpinEdit(AcxColumn: TcxGridDBBandedColumn; AComponent: TComponent); +begin + AcxColumn.PropertiesClass := TcxSpinEditProperties; + with TcxSpinEditProperties(AcxColumn.Properties) do + begin + AutoSelect := GetBooleanProperty(AComponent, 'AutoSelect', AutoSelect); + ReadOnly := GetBooleanProperty(AComponent, 'ReadOnly', ReadOnly); + MaxValue := GetFloatProperty(AComponent, 'MaxValue', MaxValue); + MinValue := GetFloatProperty(AComponent, 'MinValue', MinValue); + Increment := GetFloatProperty(AComponent, 'Increment', Increment); + end; +end; + +procedure TcxWWGridConverter.ImportWWTextEdit(AcxColumn: TcxGridDBBandedColumn; AComponent: TComponent); +begin + AcxColumn.PropertiesClass := TcxTextEditProperties; + with TcxTextEditProperties(AcxColumn.Properties) do + begin + AutoSelect := GetBooleanProperty(AComponent, 'AutoSelect', AutoSelect); + ReadOnly := GetBooleanProperty(AComponent, 'ReadOnly', ReadOnly); + CharCase := GetCharCase(GetEnumProperty(AComponent, 'CharCase')); + MaxLength := GetIntegerProperty(AComponent, 'MaxLength', MaxLength); + end; +end; + +function TcxWWGridConverter.IsColumnDefault(const AFieldName: string): string; +var + AControlType: TStringList; + ADataFieldName: string; + I: Integer; +begin + Result := ''; + AControlType := GetClassProperty(nil, 'ControlType') as TStringList; + if AControlType <> nil then + begin + for I := 0 to AControlType.Count - 1 do + begin + ExtractData(AControlType[I], ADataFieldName, 1, ';'); + if ADataFieldName = AFieldName then + begin + Result := AControlType[I]; + Break; + end; + end; + end; +end; + +function TcxWWGridConverter.Pass(const AData: string; AStartIndex: Integer; + AFieldCount: Integer; ASeparator: Char): Integer; +var + ACount: Integer; +begin + Result := AStartIndex; + ACount := 0; + while Result <= Length(AData) do + begin + if AData[Result] = ASeparator then + begin + Inc(ACount); + if ACount = AFieldCount then + begin + Inc(Result); + Break; + end; + end; + Inc(Result); + end; +end; + +initialization + ConverterFactory(cxGridGroupConverterName).RegisterConverter('WW InfoPower Grid Converter', TcxWWGridConverter); + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/EULA.txt b/official/x.35/ExpressQuantumTreeList 4/EULA.txt new file mode 100644 index 00000000..ea07361f --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/EULA.txt @@ -0,0 +1,119 @@ +DEVELOPER EXPRESS INC +ExpressQuantumTreeList 4(tm) COMPONENT SUITE +Copyright (C) 1999-2008 Developer Express Inc. + +END-USER LICENSE AGREEMENT +FOR ALL SOFTWARE COMPONENT PRODUCT(S) + +IMPORTANT- READ CAREFULLY: This DEVELOPER EXPRESS INC ("DEVEXPRESS") End-User License Agreement ("EULA") is a legal agreement between you, a developer of software applications, ("Developer End User") and DEVEXPRESS for all DEVEXPRESS products, controls, source code, demos, intermediate files, media, printed materials, and "online" or electronic documentation ("SOFTWARE COMPONENT PRODUCT(S)") contained in this installation file. + +DEVEXPRESS grants to you as an individual, a personal, nonexclusive license to install and use the SOFTWARE COMPONENT PRODUCT(S) for the sole purposes of designing, developing, testing, and deploying application programs which you create. By installing, copying, or otherwise using the SOFTWARE COMPONENT PRODUCT(S), you agree to be bound by the terms of this EULA. If you do not agree to any part of the terms of this EULA, DO NOT INSTALL, USE, EVALUATE, OR REPLICATE IN ANY MANNER, ANY PART, FILE OR PORTION OF THE SOFTWARE COMPONENT PRODUCT(S). + +All SOFTWARE COMPONENT PRODUCT(S) is licensed, not sold. If you are an individual, you must acquire an individual license for the SOFTWARE COMPONENT PRODUCT(S) from DEVEXPRESS or its authorized resellers. If you are an entity, you must acquire and assign an individual license for each Developer End User within your organization using and or developing with the SOFTWARE COMPONENT PRODUCT(S) from DEVEXPRESS or its authorized resellers. + +If the SOFTWARE COMPONENT PRODUCT(S) you have obtained is marked as a "TRIAL" or "EVALUATION," you may install one copy of the SOFTWARE COMPONENT PRODUCT(S) for testing purposes for a period of 30 calendar days from the date of installation ("Evaluation Period"). Upon expiration of the Evaluation Period, the SOFTWARE COMPONENT PRODUCT(S) must be uninstalled and all copies destroyed. + +RIGOROUS ENFORCEMENT OF INTELLECTUAL PROPERTY RIGHTS. If the licensed right of use for this SOFTWARE COMPONENT PRODUCT(S) is purchased by you with any intent to reverse engineer, decompile, create derivative works, and the exploitation or unauthorized transfer of, any DEVEXPRESS intellectual property and trade secrets, to include any exposed methods or source code where provided, no licensed right of use shall exist, and any PRODUCT(s) created as a result shall be judged illegal by definition of all applicable law. Any sale or resale of intellectual property or created derivatives so obtained will be prosecuted to the fullest extent of all local, federal and international law. + +1. GRANT OF LICENSE. + +This EULA, if legally executed as defined herein, licenses and so grants the single individual Developer End User the following rights: + +SOFTWARE COMPONENT PRODUCT(S) - Developer End User may install and use the SOFTWARE COMPONENT PRODUCT(S) on a single computer. Developer End User may also install and use the SOFTWARE COMPONENT PRODUCT(S) on a portable computer. + +2. LIMITATIONS ON REVERSE ENGINEERING, DECOMPILATION, AND DISASSEMBLY. + +You may not reverse engineer, decompile, create derivative works, translate, or disassemble the SOFTWARE COMPONENT PRODUCT(S), and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation. You agree to take all reasonable, legal and appropriate measures to prohibit the illegal dissemination of the SOFTWARE COMPONENT PRODUCT(S) or any of its constituent parts and redistributables to the fullest extent of all applicable local, US Codes and International Laws and Treaties regarding anti-circumvention, including but not limited to, the Geneva and Berne World Intellectual Property Organization (WIPO) Diplomatic Conferences. + +3. SEPARATION OF COMPONENTS. + +The SOFTWARE COMPONENT PRODUCT(S) is licensed as a single PRODUCT(s). The SOFTWARE COMPONENT PRODUCT(S) and its constituent parts and any provided redistributables may not be reverse engineered, decompiled, disassembled or separated for use on more than one computer, nor placed for distribution, sale, or resale as individual creations by Developer End User. The provision of source code, if included with the SOFTWARE COMPONENT PRODUCT(S), does not constitute transfer of any legal rights to such code, and resale or distribution of all or any portion of all source code and intellectual property will be prosecuted to the fullest extent of all applicable local, federal and international laws. All DEVEXPRESS libraries, source code, redistributables and other files remain DEVEXPRESS's exclusive property. You may not distribute any files, except those that DEVEXPRESS has expressly designated as Redistributable. + +4. RENTAL. + +You may not rent, lease, or lend the SOFTWARE COMPONENT PRODUCT(S). + +5. TRANSFER. + +You may NOT permanently or temporarily transfer ANY of your rights under this EULA to any individual or entity without prior written approval from DEVEXPRESS. Regardless of any modifications which you make and regardless of how you might compile, link, and/or package your programs, under no circumstances may the libraries, Redistributables, and/or other files of the SOFTWARE COMPONENT PRODUCT(S) (including any portions thereof) be used for developing programs by anyone other than you. Only you as the licensed Developer End User have the right to use the libraries, redistributables, or other files of the SOFTWARE COMPONENT PRODUCT(S) (or any portions thereof) for developing programs created with the SOFTWARE COMPONENT PRODUCT(S). In particular, you may not share copies of the Redistributables with other co-developers. You may not reproduce or distribute any DEVEXPRESS documentation without DEVEXPRESS's explicit permission. + +If you are an entity (Company), you must acquire and assign a license to each Developer End User within your organization using and or developing with the SOFTWARE COMPONENT PRODUCT(S). With written notification to DEVEXPRESS, Company may transfer the license obtained for a Developer End User to another Developer End User employed or otherwise engaged by Company if the initial Developer End User is no longer employed or engaged by Company or is reassigned to another function within Company and no longer develops software applications using the SOFTWARE COMPONENT PRODUCT(S). In addition, with written notification to DEVEXPRESS, Company may transfer its license of the SOFTWARE COMPONENT PRODUCT(S) to a successor Company. + +6. ROYALTY FREE REDISTRIBUTION. + +DEVEXPRESS PRODUCT(s) may include certain files ("Redistributable(s)") intended for distribution by you to the users of software applications which you create. Redistributables include, for example, those files identified in printed or on-line documentation as redistributable files, or those files preselected for deployment by an install utility provided with the SOFTWARE COMPONENT PRODUCT(S) (if any). In all circumstances, the Redistributables for the SOFTWARE COMPONENT PRODUCT(S) are only those files specifically designated as such by DEVEXPRESS. + +Subject to all of the terms and conditions in this EULA, you may reproduce and distribute copies of the Redistributables, provided that such copies are made from the original copy of the Redistributables included with the SOFTWARE COMPONENT PRODUCT(S) or modified versions of the Redistributables which are provided to you by DEVEXPRESS or those which you create. Copies of Redistributables may only be distributed with and for the sole purpose of executing application programs permitted under this EULA that you have created using the SOFTWARE COMPONENT PRODUCT(S). + +REDISTRIBUTABLES. To obtain a list of redistributables that apply under this EULA, contact support@devexpress.com + +AT NO TIME MAY DEVELOPER END USER CREATE ANY TOOL, REDISTRIBUTABLE, OR SOFTWARE COMPONENT PRODUCT(S) THAT DIRECTLY OR INDIRECTLY COMPETES WITH DEVEXPRESS SOFTWARE COMPONENT PRODUCT(S) WHICH UTILIZES ALL OR ANY PORTION OF THE SOFTWARE COMPONENT PRODUCT(S) contained within this installation. + +Distribution by the Developer End User of any design-time tools (EXE's OCX's or DLL's), executables, and source code distributed to Developer End User by DEVEXPRESS as part of this SOFTWARE COMPONENT PRODUCT(S) and not explicitly identified as a redistributable file is strictly prohibited. The Developer End User shall not develop software applications that provide an application programming interface to the SOFTWARE COMPONENT PRODUCT(S) or the SOFTWARE COMPONENT PRODUCT(S) as modified. + +The Developer End User may NOT distribute the SOFTWARE COMPONENT PRODUCT(S), in any format, to other users for development or application compilation purposes. Specifically, if Developer End User creates a control using the SOFTWARE COMPONENT PRODUCT(S) as a constituent control, Developer End User may NOT distribute the control created with the SOFTWARE COMPONENT PRODUCT(S) (in any format) to users to be used used at design time and or for ANY development purposes. + +Developer End User MAY NOT REDISTRIBUTE any SOFTWARE COMPONENT PRODUCT(s) files if using an evaluation, trial, Not for Resale, or demo version of the SOFTWARE COMPONENT PRODUCT(s). + +7. UPGRADES. + +If the SOFTWARE COMPONENT PRODUCT(S) is labeled as an upgrade, you must be properly licensed to use the SOFTWARE COMPONENT PRODUCT(S) identified by DEVEXPRESS as being eligible for the upgrade in order to use the SOFTWARE COMPONENT PRODUCT(S). A SOFTWARE COMPONENT PRODUCT(S) labeled as an upgrade replaces and/or supplements the SOFTWARE COMPONENT PRODUCT(S) that formed the basis for your eligibility for the upgrade, and together constitutes a single PRODUCT(S). You may use the resulting upgraded PRODUCT(S) only in accordance with all the terms of this EULA. + +8. COPYRIGHT. + +All title and copyrights in and to the SOFTWARE COMPONENT PRODUCT(S) (including but not limited to any copywritten images, demos, source code, intermediate files, packages, photographs, redistributables, animations, video, audio, music, text, and "applets" incorporated into the SOFTWARE COMPONENT PRODUCT(S) the accompanying printed materials, and any copies of the SOFTWARE COMPONENT PRODUCT(S)) are owned by DEVEXPRESS or its subsidiaries. The SOFTWARE COMPONENT PRODUCT(S) is protected by copyright laws and international treaty provisions and therefore, you must treat the SOFTWARE COMPONENT PRODUCT(S) like any other copyrighted material except that you may install the SOFTWARE COMPONENT PRODUCT(S) as described in this EULA. + +9. DUAL-MEDIA SOFTWARE COMPONENT PRODUCT(S). + +You may receive the SOFTWARE COMPONENT PRODUCT(S) in more than one medium. Regardless of the medium, you may use only one medium that is appropriate for your single computer. You may not loan, sell, rent, lease, or otherwise transfer in any manner the other medium to another user or entity. + +10. U.S. GOVERNMENT RESTRICTED RIGHTS. + +The Licensed Software is Commercial Computer Software provided with RESTRICTED RIGHTS under Federal Acquisition Regulations and agency supplements to them. Use, duplication or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFAR 255.227-7013 et. seq. or 252.211-7015, or subparagraphs (a) through (d) of the Commercial Computer Software Restricted Rights at FAR 52.227-19, as applicable, or similar clauses in the NASA FAR Supplement. Contractor-manufacturer is Developer Express Inc. / 6375 S. Pecos Rd Suite 118, Las Vegas NV 89120. + +11. EXPORT RESTRICTIONS. + +DEVEXPRESS expressly complies with all export restrictions imposed by the government of the United States of America. You, as Developer End User, must agree not to export or re-export the SOFTWARE COMPONENT PRODUCT(S) within any created application to any country, person, entity or end user subject to U.S.A. export restrictions. Restricted countries currently include, but are not necessarily limited to Cuba, Iran, Iraq, Libya, North Korea, Sudan, and Syria. You warrant and represent that neither the U.S.A. Bureau of Export Administration nor any other federal agency has suspended, revoked or denied your export privileges. + +12. NOTE ON JAVA SUPPORT. + +Certain SOFTWARE COMPONENT PRODUCT(S) may contain support for programs written in Java. Java technology is not fault tolerant and is not designed, manufactured, or intended for use or resale as on-line control equipment in hazardous environments requiring fail-safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines, or weapons systems, in which the failure of Java technology could lead directly to death, personal injury, or severe physical or environmental damage. + +13. DISCLAIMER OF WARRANTY. + +DEVEXPRESS expressly disclaims any warranty for the SOFTWARE COMPONENT PRODUCT(S). THE SOFTWARE COMPONENT PRODUCT(S) AND ANY RELATED DOCUMENTATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. DEVEXPRESS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY REPRESENTATIONS REGARDING THE USE, OR THE RESULTS OF THE USE, OF THE SOFTWARE COMPONENT PRODUCT(S) IN TERMS OF CORRECTNESS, ACCURACY, RELIABILITY, OR OTHERWISE. THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE COMPONENT PRODUCT(S) REMAINS WITH YOU. No oral or written information or advice given by DEVEXPRESS or its employees shall create a warranty or in any way increase the scope of this warranty. + +14. LIMITATIONS ON LIABILITY. + +To the maximum extent permitted by applicable law, in no event shall DEVEXPRESS be liable for any special, incidental, indirect, or consequential damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use the SOFTWARE COMPONENT PRODUCT(S) or the provision of or failure to provide Support Services, even if DEVEXPRESS has been advised of the possibility of such damages. + +Developer End User understands that the SOFTWARE COMPONENT PRODUCT(S) may produce inaccurate results because of a failure or fault within the SOFTWARE COMPONENT PRODUCT(S) or failure by Developer End User to properly use and or deploy the SOFTWARE COMPONENT PRODUCT(S). Developer End User assumes full and sole responsibility for any use of the SOFTWARE COMPONENT PRODUCT(S), and bears the entire risk for failures or faults within the SOFTWARE COMPONENT PRODUCT(S). You agree that regardless of the cause of failure or fault or the form of any claim, YOUR SOLE REMEDY AND DEVEXPRESS'S SOLE OBLIGATION SHALL BE GOVERNED BY THIS AGREEMENT AND IN NO EVENT SHALL DEVEXPRESS'S LIABILITY EXCEED THE PRICE PAID TO DEVEXPRESS FOR THE SOFTWARE COMPONENT PRODUCT(S). This Limited Warranty is void if failure of the SOFTWARE COMPONENT PRODUCT(S) has resulted from accident, abuse, alteration, unauthorized use or misapplication of the SOFTWARE COMPONENT PRODUCT(S). + +15. INDEMNIFICATION. + +You hereby agree to indemnify DEVEXPRESS and its officers, directors, employees, agents, and representatives from each and every demand, claim, loss, liability, or damage of any kind, including actual attorneys fees, whether in tort or contract, that it or any of them may incur by reason of, or arising out of, any claim which is made by any third party with respect to any breach or violation of this Agreement by you or any claims based on the Applications and the SOFTWARE COMPONENT PRODUCT(S) included herein. + +16. SUPPORT SERVICES. + +DEVEXPRESS may provide you with support services related to the SOFTWARE COMPONENT PRODUCT(S) ("Support Services"). Use of Support Services is governed by DEVEXPRESS policies and programs described in the user manual, in "on line" documentation and/or other DEVEXPRESS provided materials. Any supplemental SOFTWARE COMPONENT PRODUCT(S) provided to you as part of the Support Services shall be considered part of the SOFTWARE COMPONENT PRODUCT(S) and subject to the terms and conditions of this EULA. With respect to technical information you provide to DEVEXPRESS as part of the Support Services, DEVEXPRESS may use such information for its business purposes, including for SOFTWARE COMPONENT PRODUCT(s) support and development. DEVEXPRESS will not utilize such technical information in a form that personally identifies you. + +17. TERMINATION. + +Without prejudice to any other rights or remedies, DEVEXPRESS will terminate this EULA upon your failure to comply with all the terms and conditions of this EULA. In such events, you must destroy all copies of the SOFTWARE COMPONENT PRODUCT(S) and all of its component parts including any related documentation, and must remove ANY and ALL use of such technology immediately from any applications using technology contained in the SOFTWARE COMPONENT PRODUCT(S) developed by you, whether in native, altered or compiled state. + +18. TAX. + +DEVEXPRESS delivers its software electronically and does not collect sales or use tax for residents of US states in which it operates. You should confirm that your local, state, or federal government does not impose any sales or use tax on electronically delivered software. You are entirely liable for any such sales or use tax. + +19. MISCELLANEOUS. + +This EULA shall be construed, interpreted and governed by the laws of the State of Nevada, U.S.A. This EULA gives you specific legal rights; you may have others that vary from state to state and from country to country. + +This EULA may only be modified in writing signed by you and an authorized officer of DEVELOPER EXPRESS INC. If any provision of this EULA is found void or unenforceable, the remainder will remain valid and enforceable according to its terms. If any remedy provided is determined to have failed for its essential purpose, all limitations of liability and exclusions of damages set forth in the Limited Warranty shall remain in effect. + +DEVEXPRESS reserves all rights not specifically granted in this EULA. + +ACKNOWLEDGEMENTS. Developer End User acknowledges that he or she has read this Agreement, understands it, and agrees to be bound by its terms and conditions. + +Should you have any questions concerning this EULA, or if you desire to contact DEVEXPRESS for any reason, please contact us directly at us in the United States of America at 702-262-0609, or write: Developer Express Inc. Legal department / 6330 McLeod Dr Suite 1, Las Vegas NV 89120. + diff --git a/official/x.35/ExpressQuantumTreeList 4/Help/EQTreeList4.cnt b/official/x.35/ExpressQuantumTreeList 4/Help/EQTreeList4.cnt new file mode 100644 index 00000000..a28cdd58 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Help/EQTreeList4.cnt @@ -0,0 +1,89 @@ +:Base EQTreeList4.hlp +:Title ExpressQuantumTreeList Suite 4 +:Index ExpressQuantumTreeList Suite 4=EQTreeList4.hlp +1 ExpressQuantumTreeList4 +2 Introduction=IDH_bc_Introduction +2 Getting Started=Getting_Started +2 Known Issues and Important Changes List=CD_Known_Issues_and_Important_Changes_List +2 Reference +3 Units +4 cxTL Unit Overview=IDH_Unit_cxTL +4 cxDBTL Unit Overview=IDH_Unit_cxDBTL +4 cxTLData Unit Overview=IDH_Unit_cxTLData +3 cxCustomTreeListControl +4 TcxCustomTreeListControl=IDH_Class_TcxCustomTreeListControl +4 TcxCustomDataTreeList=IDH_Class_TcxCustomDataTreeList +3 cxDBTreeList +4 TcxCustomDBTreeList=IDH_Class_TcxCustomDBTreeList +4 TcxDBTreeList=IDH_Class_TcxDBTreeList +3 cxTreeList Band +4 TcxTreeListBand=IDH_Class_TcxTreeListBand +4 TcxTreeListBands=IDH_Class_TcxTreeListBands +4 TcxTreeListBandOptions=IDH_Class_TcxTreeListBandOptions +3 cxTreeList Column +4 TcxTreeListColumn=IDH_Class_TcxTreeListColumn +4 TcxDBTreeListColumn=IDH_Class_TcxDBTreeListColumn +4 TcxTreeListColumnPosition=IDH_Class_TcxTreeListColumnPosition +4 TcxTreeListColumnOptions=IDH_Class_TcxTreeListColumnOptions +4 TcxTreeListColumnSummaryFooter=IDH_Class_TcxTreeListColumnSummaryFooter +3 cxTreeList Control +4 TcxTreeList=IDH_Class_TcxTreeList +3 cxTreeList DataController +4 TcxDBTreeListDataController=IDH_Class_TcxDBTreeListDataController +4 TcxVirtualTreeListDataController=IDH_Class_TcxVirtualTreeListDataController +4 TcxTreeListCustomDataSource=IDH_Class_TcxTreeListCustomDataSource +4 TcxDBItemDataBinding=IDH_Class_TcxDBItemDataBinding +3 cxTreeList HitTest +4 TcxTreeListHitTest=IDH_Class_TcxTreeListHitTest +3 cxTreeList Node +4 TcxTreeListNode=IDH_Class_TcxTreeListNode +4 TcxTreeListDataNode=IDH_Class_TcxTreeListDataNode +4 TcxTreeListNodes=IDH_Class_TcxTreeListNodes +3 cxTreeList Options +4 TcxTreeListOptionsBehavior=IDH_Class_TcxTreeListOptionsBehavior +4 TcxTreeListOptionsCustomizing=IDH_Class_TcxTreeListOptionsCustomizing +4 TcxTreeListOptionsData=IDH_Class_TcxTreeListOptionsData +4 TcxTreeListOptionsSelection=IDH_Class_TcxTreeListOptionsSelection +4 TcxTreeListOptionsView=IDH_Class_TcxTreeListOptionsView +4 TcxDBTreeListOptionsData=IDH_Class_TcxDBTreeListOptionsData +4 TcxVirtualTreeListOptionsData=IDH_Class_TcxVirtualTreeListOptionsData +3 cxTreeList Preview +4 TcxTreeListPreview=IDH_Class_TcxTreeListPreview +3 cxVirtualTreeList +4 TcxCustomVirtualTreeList=IDH_Class_TcxCustomVirtualTreeList +4 TcxVirtualTreeList=IDH_Class_TcxVirtualTreeList +3 Miscellaneous Classes And Types +4 TcxTreeListCaption=IDH_Class_TcxTreeListCaption +4 TcxTreeListCustomizing=IDH_Class_TcxTreeListCustomizing +3 Styles +4 TcxTreeListColumnStyles=IDH_Class_TcxTreeListColumnStyles +4 TcxTreeListBandStyles=IDH_Class_TcxTreeListBandStyles +4 TcxTreeListStyles=IDH_Class_TcxTreeListStyles +4 TcxTreeListStyleSheet=IDH_Class_TcxTreeListStyleSheet +2 Base Concepts +3 Categorized Column=IDH_bc_Categorized_Column +3 Custom Draw=IDH_bc_Custom_Draw +3 Data Loading Modes=IDH_bc_Data_Loading_Modes +3 Export=IDH_bc_Export +3 Inplace Editors=IDH_bc_Inplace_Editors +3 Options=IDH_bc_Options +3 Preview=IDH_bc_Preview +3 Self-Referenced Dataset=IDH_bc_Self_Referenced_Dataset +3 TreeList Elements=TreeList_Elements +2 Resource Strings +3 ExpressQuantumTreeList: Resource Strings=IDH_bc_Resource_Strings +2 Task Based Help +3 Bands=IDH_tbh_Bands +3 Connecting to Data=IDH_tbh_Connecting_to_Data +3 Create And Delete Columns=IDH_tbh_Create_And_Delete_Columns +3 Create Summaries=IDH_tbh_Create_Summaries +3 Deleting Nodes=IDH_tbh_Deleting_Nodes +3 Implement Sorting=IDH_tbh_Implement_Sorting +3 Implementing the Drag-And-Drop Functionality=IDH_tbh_Implementing_the_Drag_And_Drop_Functionality +3 Importing ExpressQuantumTreeList3=IDH_tbh_Importing_ExpressQuantumTreeList3 +3 Obtain And Set Cell Values=IDH_tbh_Obtain_And_Set_Cell_Values +3 Selecting Nodes=IDH_tbh_Selecting_Nodes +3 Setting The cxTreeList Appearance=IDH_tbh_Setting_The_cxTreeList_Appearance +3 Unbound Mode=IDH_tbh_Unbound_Mode +3 Using Lookup Column=IDH_tbh_Using_Lookup_Column +3 Using Virtual cxTreeList=IDH_tbh_Using_Virtual_cxTreeList diff --git a/official/x.35/ExpressQuantumTreeList 4/Help/EQTreeList4.hlp b/official/x.35/ExpressQuantumTreeList 4/Help/EQTreeList4.hlp new file mode 100644 index 00000000..e95f0f75 Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Help/EQTreeList4.hlp differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC10.bpk b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC10.bpk new file mode 100644 index 00000000..42e7c642 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC10.bpk @@ -0,0 +1,181 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = cxTreeListC10.bpl +OBJFILES = cxTLStrs.obj cxExportTL4Link.obj cxTL.obj cxTLData.obj cxTLIntf.obj cxDBTL.obj \ + cxTreeListC10.obj cxTLStyleSheetPreview.obj +MAINSOURCE = cxTreeListC10.cpp +RESFILES = cxTreeListC10.res +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi vclx.bpi dbrtl.bpi cxDataC10.bpi cxLibraryC10.bpi \ + cxEditorsC10.bpi cxExportC10.bpi dxThemeC10.bpi +SPARELIBS = +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressQuantumTreeList 4 by Developer Express Inc." -aa -Tpp \ + -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC10.cpp b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC10.cpp new file mode 100644 index 00000000..06e341a6 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC10.cpp @@ -0,0 +1,30 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("cxTreeListC10.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("cxExportC10.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEUNIT("cxTLStrs.pas"); +USEUNIT("cxExportTL4Link.pas"); +USEUNIT("cxTL.pas"); +USEUNIT("cxTLData.pas"); +USEUNIT("cxTLIntf.pas"); +USEUNIT("cxDBTL.pas"); +USEUNIT("cxTLStyleSheetPreview.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC10.res b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC10.res new file mode 100644 index 00000000..606232a9 Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC10.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC11.bpk b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC11.bpk new file mode 100644 index 00000000..cac31548 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC11.bpk @@ -0,0 +1,181 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = cxTreeListC11.bpl +OBJFILES = cxTLStrs.obj cxExportTL4Link.obj cxTL.obj cxTLData.obj cxTLIntf.obj cxDBTL.obj \ + cxTreeListC11.obj cxTLStyleSheetPreview.obj +MAINSOURCE = cxTreeListC11.cpp +RESFILES = cxTreeListC11.res +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi vclx.bpi dbrtl.bpi cxDataC11.bpi cxLibraryC11.bpi \ + cxEditorsC11.bpi cxExportC11.bpi dxThemeC11.bpi +SPARELIBS = +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressQuantumTreeList 4 by Developer Express Inc." -aa -Tpp \ + -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC11.cpp b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC11.cpp new file mode 100644 index 00000000..797770df --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC11.cpp @@ -0,0 +1,30 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("cxTreeListC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("cxExportC11.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEUNIT("cxTLStrs.pas"); +USEUNIT("cxExportTL4Link.pas"); +USEUNIT("cxTL.pas"); +USEUNIT("cxTLData.pas"); +USEUNIT("cxTLIntf.pas"); +USEUNIT("cxDBTL.pas"); +USEUNIT("cxTLStyleSheetPreview.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC11.res b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC11.res new file mode 100644 index 00000000..ba1e3840 Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC11.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC5.bpk b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC5.bpk new file mode 100644 index 00000000..b90858c5 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC5.bpk @@ -0,0 +1,180 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = cxTreeListC5.bpl +OBJFILES = cxTLStrs.obj cxExportTL4Link.obj cxTL.obj cxTLData.obj cxTLIntf.obj cxDBTL.obj \ + cxTreeListC5.obj cxTLStyleSheetPreview.obj +RESFILES = cxTreeListC5.res +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +SPARELIBS = +PACKAGES = vcl50.bpi vclx50.bpi vcldb50.bpi cxDataC5.bpi cxLibraryVCLC5.bpi \ + cxEditorsC5.bpi cxExportC5.bpi dxThemeC5.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressQuantumTreeList 4 (VCL Edition) by Developer Express Inc." -aa -Tpp \ + -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC5.cpp b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC5.cpp new file mode 100644 index 00000000..3221b23e --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC5.cpp @@ -0,0 +1,29 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("cxTreeListC5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vclx50.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("cxExportC5.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEUNIT("cxTLStrs.pas"); +USEUNIT("cxExportTL4Link.pas"); +USEUNIT("cxTL.pas"); +USEUNIT("cxTLData.pas"); +USEUNIT("cxTLIntf.pas"); +USEUNIT("cxDBTL.pas"); +USEUNIT("cxTLStyleSheetPreview.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC5.res b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC5.res new file mode 100644 index 00000000..3afafc9a Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListC5.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD10.dpk b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD10.dpk new file mode 100644 index 00000000..cc8f7366 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD10.dpk @@ -0,0 +1,44 @@ +package cxTreeListD10; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumTreeList 4 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxDataD10, + cxEditorsD10, + cxExportD10, + cxLibraryD10, + dxThemeD10; + +contains + cxDBTL, + cxTL, + cxExportTL4Link, + cxTLData, + cxTLIntf, + cxTLStrs; + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD10.res b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD10.res new file mode 100644 index 00000000..b4b75594 Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD10.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD11.dpk b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD11.dpk new file mode 100644 index 00000000..4b3ba67a --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD11.dpk @@ -0,0 +1,44 @@ +package cxTreeListD11; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumTreeList 4 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxDataD11, + cxEditorsD11, + cxExportD11, + cxLibraryD11, + dxThemeD11; + +contains + cxDBTL, + cxTL, + cxExportTL4Link, + cxTLData, + cxTLIntf, + cxTLStrs; + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD11.res b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD11.res new file mode 100644 index 00000000..db19fa95 Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD11.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD5.dpk b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD5.dpk new file mode 100644 index 00000000..529c6885 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD5.dpk @@ -0,0 +1,45 @@ +package cxTreeListD5; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumTreeList 4 (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcldb50, + cxDataD5, + cxLibraryVCLD5, + cxEditorsD5, + cxExportD5, + dxThemeD5; + +contains + cxDBTL, + cxTL, + cxExportTL4Link, + cxTLData, + cxTLIntf, + cxTLStrs; + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD5.res b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD5.res new file mode 100644 index 00000000..4c1d1aa9 Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD5.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD9.dpk b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD9.dpk new file mode 100644 index 00000000..f5910d64 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD9.dpk @@ -0,0 +1,44 @@ +package cxTreeListD9; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumTreeList 4 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxDataD9, + cxEditorsD9, + cxExportD9, + cxLibraryD9, + dxThemeD9; + +contains + cxDBTL, + cxTL, + cxExportTL4Link, + cxTLData, + cxTLIntf, + cxTLStrs; + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD9.res b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD9.res new file mode 100644 index 00000000..16c97e7c Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListD9.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLC6.bpk b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLC6.bpk new file mode 100644 index 00000000..83cfbea4 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLC6.bpk @@ -0,0 +1,180 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = cxTreeListVCLC6.bpl +OBJFILES = cxTLStrs.obj cxExportTL4Link.obj cxTL.obj cxTLData.obj cxTLIntf.obj cxDBTL.obj \ + cxTreeListVCLC6.obj cxTLStyleSheetPreview.obj +RESFILES = cxTreeListVCLC6.res +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi vclx.bpi dbrtl.bpi cxDataC6.bpi cxLibraryVCLC6.bpi \ + cxEditorsVCLC6.bpi cxExportVCLC6.bpi dxThemeC6.bpi +SPARELIBS = +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressQuantumTreeList 4 (VCL Edition) by Developer Express Inc." -aa -Tpp \ + -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLC6.cpp b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLC6.cpp new file mode 100644 index 00000000..901459d1 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLC6.cpp @@ -0,0 +1,30 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("cxTreeListVCLC6.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("cxExportVCLC6.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEUNIT("cxTLStrs.pas"); +USEUNIT("cxExportTL4Link.pas"); +USEUNIT("cxTL.pas"); +USEUNIT("cxTLData.pas"); +USEUNIT("cxTLIntf.pas"); +USEUNIT("cxDBTL.pas"); +USEUNIT("cxTLStyleSheetPreview.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLC6.res b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLC6.res new file mode 100644 index 00000000..2d8f72e8 Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLC6.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLD6.dpk b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLD6.dpk new file mode 100644 index 00000000..2c9e9beb --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLD6.dpk @@ -0,0 +1,44 @@ +package cxTreeListVCLD6; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumTreeList 4 (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxDataD6, + cxEditorsVCLD6, + cxExportVCLD6, + cxLibraryVCLD6, + dxThemeD6; + +contains + cxDBTL, + cxTL, + cxExportTL4Link, + cxTLData, + cxTLIntf, + cxTLStrs; + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLD6.res b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLD6.res new file mode 100644 index 00000000..97721b60 Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLD6.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLD7.dpk b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLD7.dpk new file mode 100644 index 00000000..eca88efc --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLD7.dpk @@ -0,0 +1,44 @@ +package cxTreeListVCLD7; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumTreeList 4 (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxDataD7, + cxEditorsVCLD7, + cxExportVCLD7, + cxLibraryVCLD7, + dxThemeD7; + +contains + cxDBTL, + cxTL, + cxExportTL4Link, + cxTLData, + cxTLIntf, + cxTLStrs; + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLD7.res b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLD7.res new file mode 100644 index 00000000..7245487a Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Packages/cxTreeListVCLD7.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC10.bpk b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC10.bpk new file mode 100644 index 00000000..719cae05 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC10.bpk @@ -0,0 +1,183 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxTreeListC10.bpl +OBJFILES = cxDXTLConverter.obj cxTLConverter.obj cxTLDsgnEdtrs.obj cxTLItemsEdtr.obj \ + cxTLPredefinedStyles.obj cxTLReg.obj \ + dclcxTreeListC10.obj +MAINSOURCE = dclcxTreeListC10.cpp +RESFILES = dclcxTreeListC10.res cxTLReg.dcr +RESDEPEN = $(RESFILES) cxTLDsgnEdtrs.dfm cxTLItemsEdtr.dfm cxTLPredefinedStyles.dfm +LIBFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi vclx.bpi dbrtl.bpi cxEditorsC10.bpi \ + cxExportC10.bpi cxTreeListC10.bpi cxLibraryC10.bpi dclcxLibraryC10.bpi \ + cxDataC10.bpi dclcxEditorsC10.bpi designide.bpi +SPARELIBS = +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressQuantumTreeList 4 by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC10.cpp b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC10.cpp new file mode 100644 index 00000000..a1d63c14 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC10.cpp @@ -0,0 +1,32 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dclcxTreeListC10.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEPACKAGE("cxExportC10.bpi"); +USEPACKAGE("cxTreeListC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("dclcxLibraryC10.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEPACKAGE("dclcxEditorsC10.bpi"); +USEPACKAGE("designide.bpi"); +USEUNIT("cxDXTLConverter.pas"); +USEUNIT("cxTLConverter.pas"); +USEFORMNS("cxTLDsgnEdtrs.pas", Cxtldsgnedtrs, cxTreeListBandColumnDesigner); +USEFORMNS("cxTLItemsEdtr.pas", Cxtlitemsedtr, frmItemsEditor); +USEFORMNS("cxTLPredefinedStyles.pas", Cxtlpredefinedstyles, cxdmTreeListPredefinedStyles); /* TDataModule: DesignClass */ +USEUNIT("cxTLReg.pas"); +USERES("cxTLReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC10.res b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC10.res new file mode 100644 index 00000000..79a684bc Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC10.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC11.bpk b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC11.bpk new file mode 100644 index 00000000..6ca9c5f6 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC11.bpk @@ -0,0 +1,183 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxTreeListC11.bpl +OBJFILES = cxDXTLConverter.obj cxTLConverter.obj cxTLDsgnEdtrs.obj cxTLItemsEdtr.obj \ + cxTLPredefinedStyles.obj cxTLReg.obj \ + dclcxTreeListC11.obj +MAINSOURCE = dclcxTreeListC11.cpp +RESFILES = dclcxTreeListC11.res cxTLReg.dcr +RESDEPEN = $(RESFILES) cxTLDsgnEdtrs.dfm cxTLItemsEdtr.dfm cxTLPredefinedStyles.dfm +LIBFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi vclx.bpi dbrtl.bpi cxEditorsC11.bpi \ + cxExportC11.bpi cxTreeListC11.bpi cxLibraryC11.bpi dclcxLibraryC11.bpi \ + cxDataC11.bpi dclcxEditorsC11.bpi designide.bpi +SPARELIBS = +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressQuantumTreeList 4 by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC11.cpp b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC11.cpp new file mode 100644 index 00000000..17d3c015 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC11.cpp @@ -0,0 +1,32 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dclcxTreeListC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("cxExportC11.bpi"); +USEPACKAGE("cxTreeListC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("dclcxEditorsC11.bpi"); +USEPACKAGE("designide.bpi"); +USEUNIT("cxDXTLConverter.pas"); +USEUNIT("cxTLConverter.pas"); +USEFORMNS("cxTLDsgnEdtrs.pas", Cxtldsgnedtrs, cxTreeListBandColumnDesigner); +USEFORMNS("cxTLItemsEdtr.pas", Cxtlitemsedtr, frmItemsEditor); +USEFORMNS("cxTLPredefinedStyles.pas", Cxtlpredefinedstyles, cxdmTreeListPredefinedStyles); /* TDataModule: DesignClass */ +USEUNIT("cxTLReg.pas"); +USERES("cxTLReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC11.res b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC11.res new file mode 100644 index 00000000..a309e797 Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC11.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC5.bpk b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC5.bpk new file mode 100644 index 00000000..8d524c08 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC5.bpk @@ -0,0 +1,182 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dclcxTreeListC5.bpl +OBJFILES = cxDXTLConverter.obj cxTLConverter.obj cxTLDsgnEdtrs.obj cxTLItemsEdtr.obj \ + cxTLPredefinedStyles.obj cxTLReg.obj \ + dclcxTreeListC5.obj +RESFILES = dclcxTreeListC5.res cxTLReg.dcr +RESDEPEN = $(RESFILES) cxTLDsgnEdtrs.dfm cxTLItemsEdtr.dfm cxTLPredefinedStyles.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = +PACKAGES = vcl50.bpi vclx50.bpi vcldb50.bpi cxEditorsC5.bpi \ + cxExportC5.bpi cxTreeListC5.bpi cxLibraryVCLC5.bpi dclcxLibraryVCLC5.bpi \ + cxDataC5.bpi dclcxEditorsC5.bpi dsnide50.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd50 -LUdcldb50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressQuantumTreeList 4 (VCL Edition) by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC5.cpp b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC5.cpp new file mode 100644 index 00000000..f0c798fb --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC5.cpp @@ -0,0 +1,31 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dclcxTreeListC5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vclx50.bpi"); +USEPACKAGE("dsnide50.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("cxExportC5.bpi"); +USEPACKAGE("cxTreeListC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("dclcxLibraryVCLC5.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEPACKAGE("dclcxEditorsC5.bpi"); +USEUNIT("cxDXTLConverter.pas"); +USEUNIT("cxTLConverter.pas"); +USEFORMNS("cxTLDsgnEdtrs.pas", Cxtldsgnedtrs, cxTreeListBandColumnDesigner); +USEFORMNS("cxTLItemsEdtr.pas", Cxtlitemsedtr, frmItemsEditor); +USEFORMNS("cxTLPredefinedStyles.pas", Cxtlpredefinedstyles, cxdmTreeListPredefinedStyles); /* TDataModule: DesignClass */ +USEUNIT("cxTLReg.pas"); +USERES("cxTLReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC5.res b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC5.res new file mode 100644 index 00000000..2e508c5d Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListC5.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD10.dpk b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD10.dpk new file mode 100644 index 00000000..ab2ad6d9 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD10.dpk @@ -0,0 +1,48 @@ +package dclcxTreeListD10; + +{$R *.res} +{$R cxTLReg.dcr} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumTreeList 4 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + cxLibraryD10, + cxEditorsD10, + dclcxEditorsD10, + dxThemeD10, + cxTreeListD10; + +contains + cxTLReg, + cxTLDsgnEdtrs, + cxTLItemsEdtr, + cxTLStyleSheetPreview, + { last added units } + cxTLConverter, + cxDXTLConverter, + cxTLPredefinedStyles; + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD10.res b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD10.res new file mode 100644 index 00000000..356cf497 Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD10.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD11.dpk b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD11.dpk new file mode 100644 index 00000000..78fcf54e --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD11.dpk @@ -0,0 +1,48 @@ +package dclcxTreeListD11; + +{$R *.res} +{$R cxTLReg.dcr} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumTreeList 4 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + cxLibraryD11, + cxEditorsD11, + dclcxEditorsD11, + dxThemeD11, + cxTreeListD11; + +contains + cxTLReg, + cxTLDsgnEdtrs, + cxTLItemsEdtr, + cxTLStyleSheetPreview, + { last added units } + cxTLConverter, + cxDXTLConverter, + cxTLPredefinedStyles; + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD11.res b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD11.res new file mode 100644 index 00000000..a626ff46 Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD11.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD5.dpk b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD5.dpk new file mode 100644 index 00000000..249d59ea --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD5.dpk @@ -0,0 +1,46 @@ +package dclcxTreeListD5; + +{$R *.RES} +{$R cxTLReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressQuantumTreeList 4 (VCL Edition) by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + cxLibraryVCLD5, + dclcxEditorsD5, + cxTreeListD5; + +contains + cxTLReg, + cxTLDsgnEdtrs, + cxTLItemsEdtr, + cxTLStyleSheetPreview, + { last added units } + cxTLConverter, + cxDXTLConverter, + cxTLPredefinedStyles; + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD5.res b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD5.res new file mode 100644 index 00000000..cb561336 Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD5.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD9.dpk b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD9.dpk new file mode 100644 index 00000000..b8f1fd0e --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD9.dpk @@ -0,0 +1,48 @@ +package dclcxTreeListD9; + +{$R *.res} +{$R cxTLReg.dcr} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumTreeList 4 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + cxLibraryD9, + cxEditorsD9, + dclcxEditorsD9, + dxThemeD9, + cxTreeListD9; + +contains + cxTLReg, + cxTLDsgnEdtrs, + cxTLItemsEdtr, + cxTLStyleSheetPreview, + { last added units } + cxTLConverter, + cxDXTLConverter, + cxTLPredefinedStyles; + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD9.res b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD9.res new file mode 100644 index 00000000..c681ee0e Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListD9.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLC6.bpk b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLC6.bpk new file mode 100644 index 00000000..d4b52af1 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLC6.bpk @@ -0,0 +1,182 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxTreeListVCLC6.bpl +OBJFILES = cxDXTLConverter.obj cxTLConverter.obj cxTLDsgnEdtrs.obj cxTLItemsEdtr.obj \ + cxTLPredefinedStyles.obj cxTLReg.obj \ + dclcxTreeListVCLC6.obj +RESFILES = dclcxTreeListVCLC6.res cxTLReg.dcr +RESDEPEN = $(RESFILES) cxTLDsgnEdtrs.dfm cxTLItemsEdtr.dfm cxTLPredefinedStyles.dfm +LIBFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi vclx.bpi dbrtl.bpi cxEditorsVCLC6.bpi \ + cxExportVCLC6.bpi cxTreeListVCLC6.bpi cxLibraryVCLC6.bpi dclcxLibraryVCLC6.bpi \ + cxDataC6.bpi dclcxEditorsVCLC6.bpi designide.bpi +SPARELIBS = +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressQuantumTreeList 4 (VCL Edition) by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLC6.cpp b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLC6.cpp new file mode 100644 index 00000000..2cf137a3 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLC6.cpp @@ -0,0 +1,32 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dclcxTreeListVCLC6.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("cxExportVCLC6.bpi"); +USEPACKAGE("cxTreeListVCLC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("dclcxLibraryVCLC6.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEPACKAGE("dclcxEditorsVCLC6.bpi"); +USEPACKAGE("designide.bpi"); +USEUNIT("cxDXTLConverter.pas"); +USEUNIT("cxTLConverter.pas"); +USEFORMNS("cxTLDsgnEdtrs.pas", Cxtldsgnedtrs, cxTreeListBandColumnDesigner); +USEFORMNS("cxTLItemsEdtr.pas", Cxtlitemsedtr, frmItemsEditor); +USEFORMNS("cxTLPredefinedStyles.pas", Cxtlpredefinedstyles, cxdmTreeListPredefinedStyles); /* TDataModule: DesignClass */ +USEUNIT("cxTLReg.pas"); +USERES("cxTLReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLC6.res b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLC6.res new file mode 100644 index 00000000..e13b6490 Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLC6.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLD6.dpk b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLD6.dpk new file mode 100644 index 00000000..6782b4ae --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLD6.dpk @@ -0,0 +1,49 @@ +package dclcxTreeListVCLD6; + +{$R *.res} +{$R cxTLReg.dcr} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumTreeList 4 (VCL Edition) by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + cxLibraryVCLD6, + cxEditorsVCLD6, + dclcxEditorsVCLD6, + dxThemeD6, + cxTreeListVCLD6; + +contains + cxTLReg, + cxTLDsgnEdtrs, + cxTLItemsEdtr, + cxTLStyleSheetPreview, + { last added units } + cxTLConverter, + cxDXTLConverter, + cxTLPredefinedStyles; + + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLD6.res b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLD6.res new file mode 100644 index 00000000..b4d25888 Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLD6.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLD7.dpk b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLD7.dpk new file mode 100644 index 00000000..eab96cd2 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLD7.dpk @@ -0,0 +1,48 @@ +package dclcxTreeListVCLD7; + +{$R *.res} +{$R cxTLReg.dcr} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressQuantumTreeList 4 (VCL Edition) by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + cxLibraryVCLD7, + cxEditorsVCLD7, + dclcxEditorsVCLD7, + dxThemeD7, + cxTreeListVCLD7; + +contains + cxTLReg, + cxTLDsgnEdtrs, + cxTLItemsEdtr, + cxTLStyleSheetPreview, + { last added units } + cxTLConverter, + cxDXTLConverter, + cxTLPredefinedStyles; + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLD7.res b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLD7.res new file mode 100644 index 00000000..013b70c4 Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Packages/dclcxTreeListVCLD7.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Sources/cxDBTL.pas b/official/x.35/ExpressQuantumTreeList 4/Sources/cxDBTL.pas new file mode 100644 index 00000000..9ab7fefd --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Sources/cxDBTL.pas @@ -0,0 +1,1658 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumTreeList } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMTREELIST AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDBTL; + +{$I cxVer.inc} + +interface + +uses + SysUtils, Classes, {$IFDEF DELPHI6} Variants, {$ENDIF} cxVariants, DB, cxEdit, + cxDBEdit, cxControls, cxClasses, cxDataStorage, cxCustomData, cxDBData, cxDataUtils, + cxInplaceContainer, cxEditDBRegisteredRepositoryItems, cxTL, cxTLData, cxTLIntf; + +type + TcxCustomDBTreeList = class; + + { TcxDBTreeListDataController } + + TcxDBTreeListDataController = class(TcxDBDataController, IcxTreeListSubClass) + private + FImageIndexField: TcxDBDataField; + FImageIndexFieldName: string; + FParentKeyField: TcxDBDataField; + FParentKeyFieldNames: string; + FStateIndexField: TcxDBDataField; + FStateIndexFieldName: string; + function GetKeyField: string; + function GetKeyFieldField: TField; + function GetParentFieldField: TField; + function GetTreeList: TcxCustomDBTreeList; + procedure SetImageIndexFieldName(const Value: string); + procedure SetKeyField(const Value: string); + procedure SetParentKeyFieldNames(const Value: string); + procedure SetStateIndexFieldName(const Value: string); + protected + procedure DataScrolled(ADistance: Integer); override; + procedure DoCopyTo(AttachNode: TcxTreeListDataNode; + AttachMode: TcxTreeListNodeAttachMode; ANodes: TList); + procedure DoInitInsertingRecord(AInsertingRecordIndex: Integer); override; + function GetControl: TObject; + function GetIsKeyFieldEmpty: Boolean; + function GetItemID(AItem: TObject): Integer; override; + function GetKeyValue(ARecordIndex: Integer): Variant; + function GetParentKeyValue(ARecordIndex: Integer): Variant; + function GetUniqueKeyValue(Delta: Integer = 0): Variant; + function IsSmartLoad: Boolean; override; + procedure SetKeyFieldValue(ANode: TcxTreeListDataNode; Value: Variant); + procedure SetNodeParentValue(ANode: TcxTreeListDataNode; const Value: Variant); + procedure UpdateControl(AInfo: TcxUpdateControlInfo); override; + property IsKeyFieldEmpty: Boolean read GetIsKeyFieldEmpty; + property KeyFieldField: TField read GetKeyFieldField; + property ParentFieldField: TField read GetParentFieldField; + public + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure CreateAllItems; virtual; + procedure FocusControl(AItemIndex: Integer; var Done: Boolean); override; + function GetItem(Index: Integer): TObject; override; + function GetItemValueSource(AItemIndex: Integer): TcxDataEditValueSource; override; + procedure UpdateData; override; + procedure UpdateItemIndexes; override; + property TreeList: TcxCustomDBTreeList read GetTreeList; + published + property DataSource; + property ImageIndexFieldName: string read FImageIndexFieldName write SetImageIndexFieldName; + property ParentField: string read FParentKeyFieldNames write SetParentKeyFieldNames; + property KeyField: string read GetKeyField write SetKeyField; + property StateIndexFieldName: string read FStateIndexFieldName write SetStateIndexFieldName; + end; + + { TcxDBTreeListDefaultValuesProvider } + + TcxDBTreeListDefaultValuesProvider = class(TcxCustomDBEditDefaultValuesProvider) + public + function IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean; override; + end; + + { TcxDBItemDataBinding } + + TcxDBItemDataBinding = class(TcxCustomItemDataBinding, IUnknown, IcxTreeListSubClass) + private + function GetDataController: TcxDBTreeListDataController; + function GetField: TField; + function GetFieldName: string; + procedure SetFieldName(const AName: string); + protected + function DefaultRepositoryItem: TcxEditRepositoryItem; override; + function GetControl: TObject; + function GetDefaultCaption: string; override; + function GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; override; + function GetValueTypeClass: TcxValueTypeClass; override; + procedure Init; override; + procedure ValueTypeClassChanged; override; + // IUnknown + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall; + public + procedure Assign(Source: TPersistent); override; + property DataController: TcxDBTreeListDataController read GetDataController; + property Field: TField read GetField; + published + property FieldName: string read GetFieldName write SetFieldName; + end; + + { TcxDBTreeListColumnSummaryFooter } + + TcxDBTreeListColumnSummaryFooter = class(TcxTreeListColumnSummaryFooter, IcxTreeListSubClass) + private + function GetDataController: TcxDBTreeListDataController; + function GetFieldName: string; + function GetSummaryItem: TcxDBDataSummaryItem; + procedure SetFeldName(const Value: string); + function IsFieldNameStored: Boolean; + protected + function GetControl: TObject; + public + procedure Assign(Source: TPersistent); override; + property SummaryItem: TcxDBDataSummaryItem read GetSummaryItem; + property DataController: TcxDBTreeListDataController read GetDataController; + published + property FieldName: string read GetFieldName write SetFeldName stored IsFieldNameStored; + end; + + { TcxDBTreeListColumn } + + TcxDBTreeListColumn = class(TcxTreeListColumn) + private + function GetDataBinding: TcxDBItemDataBinding; + function GetSummaryFooter: TcxDBTreeListColumnSummaryFooter; + procedure SetDataBinding(Value: TcxDBItemDataBinding); + procedure SetSummaryFooter(Value: TcxDBTreeListColumnSummaryFooter); + protected + function GetDataBindingClass: TcxItemDataBindingClass; override; + function GetSummaryFooterClass: TcxTreeListColumnSummaryFooterClass; override; + published + property DataBinding: TcxDBItemDataBinding read GetDataBinding write SetDataBinding; + property SummaryFooter: TcxDBTreeListColumnSummaryFooter read GetSummaryFooter write SetSummaryFooter; + end; + + { TcxDBTreeListOptionsData } + + TcxDBTreeListOptionsData = class(TcxVirtualTreeListOptionsData) + private + function GetDataController: TcxDBTreeListDataController; + function GetSmartRefresh: Boolean; + function GetSyncMode: Boolean; + procedure SetSmartRefresh(Value: Boolean); + procedure SetSyncMode(Value: Boolean); + protected + procedure SetSmartLoad(Index: Integer; Value: Boolean); override; + property DataController: TcxDBTreeListDataController read GetDataController; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + published + property AutoCalcKeyValue: Boolean index 2 read GetState write SetState default False; + property CheckHasChildren: Boolean index 4 read GetState write SetState default True; + property SmartRefresh: Boolean read GetSmartRefresh write SetSmartRefresh default False; + property SyncMode: Boolean read GetSyncMode write SetSyncMode default True; + property SmartLoad; + end; + + { TcxDBTreeListLoader } + + TcxDBTreeListLoader = class(TcxDataTreeListStructureLoader) + private + FValueDefReader: TcxValueDefReader; + function GetDataController: TcxDBTreeListDataController; + function GetDataSet: TDataSet; + function GetDBTreeList: TcxCustomDBTreeList; + function GetKeyField: TField; + function GetKeyFieldName: string; + function GetParentField: TField; + function GetParentFieldName: string; + protected + FHasChildrenNodes: TList; + procedure AfterSmartLoad; override; + procedure BeforeSmartLoad; override; + procedure DoneLoading; override; + function GetImageIndexAsInteger(const AIndex: Integer; AField: TcxDBDataField): Integer; + function GetKeyValue(ARecordIndex: Integer): Variant; override; + function GetNodeImageIndex(ARecordIndex: Integer): Integer; override; + function GetNodeStateImage(ARecordIndex: Integer): Integer; override; + function GetParentKeyValue(ARecordIndex: Integer): Variant; override; + procedure InitLoadedNode(ANode: TcxTreeListDataNode); override; + procedure InitLoading; override; + function IsExistChildren(ANode: TcxTreeListDataNode): Boolean; + function IsExistKeyRoot(AParentValue: Variant): Boolean; virtual; + procedure LoadChildItems(ANode: TcxTreeListDataNode); override; + procedure LoadLevel(ANode: TcxTreeListDataNode; const AParentValue: Variant; ANewNodes: TList); + procedure LoadLevelBack(AParentValue: Variant); + procedure LoadTreeListInSmartLoadMode; override; + function NeedCheckChildren: Boolean; + property DataController: TcxDBTreeListDataController read GetDataController; + property DataSet: TDataSet read GetDataSet; + property DBTreeList: TcxCustomDBTreeList read GetDBTreeList; + property KeyField: TField read GetKeyField; + property KeyFieldName: string read GetKeyFieldName; + property ParentField: TField read GetParentField; + property ParentFieldName: string read GetParentFieldName; + property ValueDefReader: TcxValueDefReader read FValueDefReader; + end; + + { TcxCustomDBTreeList } + + TcxDBTreeListGetUniqueKeyValueEvent = procedure(Sender: TObject; var KeyValue: Variant) of object; + TcxDBTreeListInitInsertingRecordEvent = procedure(Sender: TObject; AFocusedNode: TcxTreeListDataNode; var AHandled: Boolean) of object; + + TcxCustomDBTreeList = class(TcxCustomDataTreeList) + private + FRootValue: Variant; + FOnGetUniqueKeyValue: TcxDBTreeListGetUniqueKeyValueEvent; + FOnInitInsertingRecord: TcxDBTreeListInitInsertingRecordEvent; + function GetColumn(Index: Integer): TcxDBTreeListColumn; + function GetDataController: TcxDBTreeListDataController; + function GetDataSet: TDataSet; + function GetOptionsData: TcxDBTreeListOptionsData; + function GetVisibleColumn(Index: Integer): TcxDBTreeListColumn; + procedure SetColumn(Index: Integer; Value: TcxDBTreeListColumn); + procedure SetDataController(Value: TcxDBTreeListDataController); + procedure SetOptionsData(Value: TcxDBTreeListOptionsData); + procedure SetRootValue(const Value: Variant); + procedure SetVisibleColumn(Index: Integer; Value: TcxDBTreeListColumn); + protected + procedure CreateAllItems; override; + procedure AddToDelitionList(ANode: TcxTreeListNode); override; + procedure DoClearDataSource; override; + procedure DoDeleteNode(ANode: TcxTreeListNode); override; + procedure DoDeleteNodeEntry(ANode: TcxTreeListDataNode); virtual; + function DoExecuteInitInsertingRecord(ANode: TcxTreeListDataNode): Boolean; virtual; + procedure DoMoveTo(AttachNode: TcxTreeListNode; + AttachMode: TcxTreeListNodeAttachMode; ANodes: TList; IsCopy: Boolean); override; + function GetDataControllerClass: TcxCustomDataControllerClass; override; + function GetLoaderClass: TcxDataTreeListStructureLoaderClass; override; + function GetOptionsDataClass: TcxControlOptionsDataClass; override; + function GetTreeListColumnClass: TcxTreeListColumnClass; override; + function InsertNode(IsAppend: Boolean): Boolean; override; + function IsAutoCalcKeyValue: Boolean; + function IsDataSettingsValid: Boolean; override; + function IsSmartRefresh: Boolean; + function SupportsCreateAllItems: Boolean; override; + procedure LoadListByID(const AKeyValue: Variant; AList: TList); + procedure LoadListByNode(ANode: TcxTreeListDataNode; AList: TList); + procedure UpdateNode(ANode: TcxTreeListNode); override; + property DataController: TcxDBTreeListDataController read GetDataController write SetDataController; + property DataSet: TDataSet read GetDataSet; + property Columns[Index: Integer]: TcxDBTreeListColumn read GetColumn write SetColumn; + property OptionsData: TcxDBTreeListOptionsData read GetOptionsData write SetOptionsData; + property VisibleColumns[Index: Integer]: TcxDBTreeListColumn read GetVisibleColumn write SetVisibleColumn; + property RootValue: Variant read FRootValue write SetRootValue; + property OnGetUniqueKeyValue: TcxDBTreeListGetUniqueKeyValueEvent read FOnGetUniqueKeyValue write FOnGetUniqueKeyValue; + property OnInitInsertingRecord: TcxDBTreeListInitInsertingRecordEvent read FOnInitInsertingRecord write FOnInitInsertingRecord; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + end; + + { TcxDBTreeList } + + TcxDBTreeList = class(TcxCustomDBTreeList) + public + property Customizing; + property ColumnCount; + property Columns; + property FocusedColumn; + property FocusedNode; + property HitTest; + property IsEditing; + property LevelIndentWidth; + property Nodes; + property SelectionCount; + property Selections; + property Sorted; + property SortedColumnCount; + property SortedColumns; + property TopVisibleIndex; + property TopVisibleNode; + property VisibleBandCount; + property VisibleBands; + property VisibleColumnCount; + property VisibleColumns; + property VisibleCount; + published + property Align; + property Anchors; + property Bands; + property BorderStyle; + property BufferedPaint; + property Constraints; + property Cursor; + property DataController; + property DefaultLayout; + property DefaultRowHeight; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property Font; + {$IFDEF DELPHI6} + property HelpContext; + property HelpKeyword; + property HelpType; + {$ENDIF} + property Hint; + property Images; + property LookAndFeel; + property OptionsBehavior; + property OptionsCustomizing; + property OptionsData; + property OptionsSelection; + property OptionsView; + property ParentColor; + property ParentFont; + property PopupMenu; + property Preview; + property RootValue; + property StateImages; + property Styles; + property StylesEvents; + property TabOrder; + property TabStop; + property Visible; + // TreeList events + property OnAfterSorting; + property OnAfterSummary; + property OnBandHeaderClick; + property OnBandSizeChanged; + property OnCanResize; + property OnCanSelectNode; + property OnChange; + property OnClick; + property OnCollapsed; + property OnCollapsing; + property OnColumnHeaderClick; + property OnColumnSizeChanged; + property OnCompare; + property OnConstrainedResize; + property OnSorting; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnCustomDrawBackground; + property OnCustomDrawBandHeader; + property OnCustomDrawCell; + property OnCustomDrawCellsGroup; + property OnCustomDrawFooter; + property OnCustomDrawFooterCell; + property OnCustomDrawHeader; + property OnCustomDrawHeaderCell; + property OnCustomDrawIndentCell; + property OnCustomDrawIndicatorCell; + property OnCustomDrawPreview; + property OnCustomizationFormVisibleChanged; + property OnDataChanged; + property OnDblClick; + property OnDeletion; + property OnDockDrop; + property OnDockOver; + property OnDragDrop; + property OnDragOver; + property OnEdited; + property OnEditing; + property OnEditValueChanged; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnExpanded; + property OnExpanding; + property OnFocusedColumnChanged; + property OnFocusedNodeChanged; + property OnGetNodeImageIndex; + property OnGetNodePreviewHeight; + property OnGetSiteInfo; + property OnGetUniqueKeyValue; + property OnHotTrackNode; + property OnInitEdit; + property OnInitInsertingRecord; + property OnIsGroupNode; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnLayoutChanged; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnMouseWheel; + property OnMouseWheelDown; + property OnMouseWheelUp; + property OnMoveTo; + property OnNodeChanged; + property OnResize; + property OnSelectionChanged; + property OnStartDock; + property OnStartDrag; + property OnSummary; + property OnTopRecordIndexChanged; + property OnUnDock; + end; + +implementation +type + TcxDataFieldAccess = class(TcxDBDataField); + TcxDataNodeAccess = class(TcxTreeListDataNode); + TcxDBDataProviderAccess = class(TcxDBDataProvider); + TDataSetAccess = class(TDataSet); + +function cxCompareParentNode(AItem1, AItem2: Pointer): Integer; +begin + Result := VarCompare(TcxTreeListDataNode(AItem1).ParentValue, + TcxTreeListDataNode(AItem2).ParentValue); +end; + +{ TcxDBTreeListDataController } + +destructor TcxDBTreeListDataController.Destroy; +begin + FreeAndNil(FParentKeyField); + FreeAndNil(FImageIndexField); + FreeAndNil(FStateIndexField); + inherited Destroy; +end; + +procedure TcxDBTreeListDataController.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxDBTreeListDataController then + begin + ParentField := TcxDBTreeListDataController(Source).ParentField; + KeyField := TcxDBTreeListDataController(Source).ParentField; + end; +end; + +procedure TcxDBTreeListDataController.CreateAllItems; +var + I: Integer; + ABand: TcxTreeListBand; +begin + if (DataSet = nil) or (DataSet.FieldCount = 0) then Exit; + TreeList.SetGlassCursor; + try + TreeList.BeginUpdate; + try + if TreeList.Bands.Count = 0 then + ABand := TreeList.Bands.Add + else + ABand := TreeList.Bands[0]; + for I := 0 to DataSet.FieldCount - 1 do + with TcxDBTreeListColumn(TreeList.CreateColumn(ABand)) do + begin + DataBinding.FieldName := DataSet.Fields[I].FieldName; + Visible := DataSet.Fields[I].Visible; + end; + finally + TreeList.EndUpdate; + end; + finally + TreeList.RestoreCursor; + TreeList.Modified; + end; +end; + +procedure TcxDBTreeListDataController.FocusControl(AItemIndex: Integer; var Done: Boolean); +begin + TcxDBTreeListColumn(GetItem(AItemIndex)).Editing := True; + Done := TcxDBTreeListColumn(GetItem(AItemIndex)).Editing; +end; + +function TcxDBTreeListDataController.GetItem(Index: Integer): TObject; +begin + Result := TreeList.ContainerList[Index]; +end; + +function TcxDBTreeListDataController.GetItemValueSource( + AItemIndex: Integer): TcxDataEditValueSource; +begin + with TreeList.Columns[AItemIndex] do + Result := PropertiesValue.GetEditValueSource(True); +end; + +procedure TcxDBTreeListDataController.UpdateData; +begin + TreeList.UpdateData; +end; + +procedure TcxDBTreeListDataController.UpdateItemIndexes; +begin + TreeList.UpdateIndexes; + inherited UpdateItemIndexes; +end; + +procedure TcxDBTreeListDataController.DataScrolled(ADistance: Integer); +var + ANode: TcxTreeListDataNode; +begin + inherited DataScrolled(ADistance); + if IsSmartLoad and (ADistance <> 0) then + begin + ANode := TreeList.GetNodeByRecordIndex(FindRecordIndexByKey(KeyFieldField.Value)); + if ANode <> nil then + ANode.MakeVisible + else + with TreeList do + begin + DataController.RecordCount := 0; + if FocusedNode <> nil then + FocusedNode.MakeVisible; + end; + end; +end; + +procedure TcxDBTreeListDataController.DoCopyTo(AttachNode: TcxTreeListDataNode; + AttachMode: TcxTreeListNodeAttachMode; ANodes: TList); + +type + PNodeBuffer =^TNodeBuffer; + TNodeBuffer = record + Key: Variant; + Buffer: Variant; + Items: TList; + end; + +var + I: Integer; + NewParentValue, KeyValue, Delta: Variant; + // Drag Copy + AKeyField, AParentField: TField; + AFieldList: TList; + F: TField; + BufferList: TList; + + function LoadBufferValues(const AKeyValue: Variant): PNodeBuffer; + var + I: Integer; + begin + New(Result); + Result^.Items := nil; + Result^.Key := AKeyValue; + Result^.Buffer := VarArrayCreate([0, AFieldList.Count - 1], varVariant); + for I := 0 to AFieldList.Count - 1 do + Result^.Buffer[I] := TField(AFieldList[I]).Value; + end; + + procedure LoadSubItems(PBuffer: PNodeBuffer); + var + AParentValue: Variant; + I: Integer; + begin + with DataSet do + begin + AParentValue := PBuffer^.Key; + if Locate(ParentField, AParentValue, []) then + begin + PBuffer^.Items := TList.Create; + while not EOF and (AParentField.Value = AParentValue) do + begin + PBuffer^.Items.Add(LoadBufferValues(AKeyField.Value)); + Next; + end; + for I := 0 to PBuffer^.Items.Count - 1 do + LoadSubItems(PNodeBuffer(PBuffer^.Items[I])); + end; + end; + end; + + procedure AddNewNode(PBuffer: PNodeBuffer; const AParentValue: Variant); + var + I: Integer; + Key: Variant; + begin + with DataSet do + begin + Insert; + if AKeyField.IsNull and TreeList.OptionsData.AutoCalcKeyValue then + begin + AKeyField.Value := GetUniqueKeyValue(Delta); + Inc(Delta); + end; + AParentField.Value := AParentValue; + for I := 0 to AFieldList.Count - 1 do + TField(AFieldList[I]).Value := PBuffer^.Buffer[I]; + Post; + Key := AKeyField.Value; + // add children + if PBuffer^.Items <> nil then + for I := 0 to PBuffer^.Items.Count - 1 do + AddNewNode(PBuffer^.Items[I], Key); + end; + end; + + procedure FreeBuffer(PBuffer: PNodeBuffer); + var + I: Integer; + L: TList; + begin + L := PBuffer^.Items; + if L <> nil then + begin + for I := 0 to L.Count - 1 do + FreeBuffer(L[I]); + FreeAndNil(L); + end; + Dispose(PBuffer); + end; + +begin + AParentField := TcxDataFieldAccess(FParentKeyField).Field; + AKeyField := KeyFieldField; + with DataSet do + begin + if AttachMode in [tlamAddChild, tlamAddChildFirst] then + NewParentValue := AttachNode.KeyValue + else + NewParentValue := AttachNode.ParentValue; + DisableControls; + try + // copy drag nodes + AFieldList := TList.Create; + try + // create Field List + for I := 0 to FieldCount - 1 do + begin + F := Fields[I]; + if F.FieldKind = fkLookup then + F := FindField(F.KeyFields) + else + if (F = AKeyField) or (F = AParentField) or (F.FieldKind <> fkData) then + F := nil; + if Assigned(F) and F.CanModify then + AFieldList.Add(F); + end; + if AFieldList.Count > 0 then + begin + // sort and remove dublicate + ANodes.Sort(cxCompareParentNode); + for I := ANodes.Count - 1 downto 1 do + if TcxTreeListNode(ANodes[I]).HasAsParent(TcxTreeListNode(ANodes[I - 1])) then + ANodes.Delete(I); + // make Buffer List + BufferList := TList.Create; + try + for I := 0 to ANodes.Count - 1 do + begin + KeyValue := TcxTreeListDataNode(ANodes[I]).KeyValue; + if Locate(KeyField, KeyValue, []) then + begin + BufferList.Add(LoadBufferValues(KeyValue)); + LoadSubItems(BufferList[I]); + end; + end; + // create new nodes + Delta := 0; + for I := 0 to BufferList.Count - 1 do + AddNewNode(BufferList[I], NewParentValue); + finally + for I := 0 to BufferList.Count - 1 do + FreeBuffer(PNodeBuffer(BufferList[I])); + FreeAndNil(BufferList); + end; + end; + finally + FreeAndNil(AFieldList); + end; + finally + EnableControls; + end; + end; +end; + +procedure TcxDBTreeListDataController.DoInitInsertingRecord( + AInsertingRecordIndex: Integer); +var + ANode: TcxTreeListDataNode; +begin + inherited DoInitInsertingRecord(AInsertingRecordIndex); + if IsSmartLoad and (FocusedRecordIndex >=0) then + AInsertingRecordIndex := FocusedRecordIndex; + if cxInRange(AInsertingRecordIndex, 0, TreeList.Nodes.Count - 1) then + ANode := TcxTreeListDataNode(TreeList.Nodes.Items[AInsertingRecordIndex]) + else + ANode := nil; + if not TreeList.DoExecuteInitInsertingRecord(ANode) then + if TreeList.IsAutoCalcKeyValue then + begin + KeyFieldField.Value := GetUniqueKeyValue(0); + if ANode <> nil then + ParentFieldField.Value := ANode.ParentValue + end; +end; + +function TcxDBTreeListDataController.GetControl: TObject; +begin + Result := TreeList; +end; + +function TcxDBTreeListDataController.GetIsKeyFieldEmpty: Boolean; +begin + Result := (ParentField = '') or (KeyField = ''); +end; + +function TcxDBTreeListDataController.GetItemID(AItem: TObject): Integer; +begin + if AItem is TcxTreeListColumn then + Result := TcxTreeListColumn(AItem).ItemIndex + else + Result := -1; +end; + +function TcxDBTreeListDataController.GetKeyValue(ARecordIndex: Integer): Variant; +begin + Result := GetInternalValue(ARecordIndex, inherited KeyField); +end; + +function TcxDBTreeListDataController.GetParentKeyValue(ARecordIndex: Integer): Variant; +begin + Result := GetInternalValue(ARecordIndex, FParentKeyField); +end; + +function TcxDBTreeListDataController.GetUniqueKeyValue( + Delta: Integer = 0): Variant; +var + I: Integer; +begin + Result := Null; + if Assigned(TreeList.FOnGetUniqueKeyValue) then + TreeList.FOnGetUniqueKeyValue(Self, Result) + else + if not TreeList.IsSmartLoad then + try + if not IsKeyFieldEmpty and (RecordCount > 0) then + begin + Result := GetKeyValue(0); + for I := 1 to RecordCount - 1 do + if VarCompare(GetKeyValue(I), Result) > 0 then Result := GetKeyValue(I); + end; + if VarType(Result) in [varSmallint, varInteger, varSingle, varDouble, varCurrency] then + Result := Result + 1 + Delta + else + Result := 0; + except + Result := Null; + end; +end; + +function TcxDBTreeListDataController.IsSmartLoad: Boolean; +begin + Result := TreeList.OptionsData.SmartLoad; +end; + +procedure TcxDBTreeListDataController.SetKeyFieldValue( + ANode: TcxTreeListDataNode; Value: Variant); +begin + DataSet.Edit; + if ANode <> nil then ANode.KeyValue := Value; + KeyFieldField.Value := Value; + DataSet.Post; + if TreeList.IsSmartRefresh then + DoUpdateRecord(TcxDataNodeAccess(ANode).RecordIndex); +end; + +procedure TcxDBTreeListDataController.SetNodeParentValue( + ANode: TcxTreeListDataNode; const Value: Variant); +begin + if DataSet.Locate(KeyFieldNames, ANode.KeyValue, []) then + begin + DataSet.Edit; + ANode.ParentValue := Value; + TcxDataFieldAccess(FParentKeyField).Field.Value := Value; + DataSet.Post; + if TreeList.IsSmartRefresh then + DoUpdateRecord(TcxDataNodeAccess(ANode).RecordIndex); + end; +end; + +procedure TcxDBTreeListDataController.UpdateControl( + AInfo: TcxUpdateControlInfo); +begin + TreeList.ControlUpdateData(AInfo); + if AInfo is TcxLayoutChangedInfo then + TreeList.FullRefresh; +end; + +function TcxDBTreeListDataController.GetKeyField: string; +begin + Result := KeyFieldNames; +end; + +function TcxDBTreeListDataController.GetKeyFieldField: TField; +begin + Result := TcxDataFieldAccess(inherited KeyField).Field; +end; + +function TcxDBTreeListDataController.GetParentFieldField: TField; +begin + Result := TcxDataFieldAccess(FParentKeyField).Field; +end; + +function TcxDBTreeListDataController.GetTreeList: TcxCustomDBTreeList; +begin + Result := TcxCustomDBTreeList(GetOwner) +end; + +procedure TcxDBTreeListDataController.SetImageIndexFieldName( + const Value: string); +begin + if Value <> ImageIndexFieldName then + begin + FImageIndexFieldName := Value; + UpdateInternalKeyFields(FImageIndexFieldName, FImageIndexField); + end; +end; + +procedure TcxDBTreeListDataController.SetKeyField(const Value: string); +begin + KeyFieldNames := Value; +end; + +procedure TcxDBTreeListDataController.SetParentKeyFieldNames( + const Value: string); +begin + if FParentKeyFieldNames <> Value then + begin + FParentKeyFieldNames := Value; + UpdateInternalKeyFields(FParentKeyFieldNames, FParentKeyField); + end; +end; + +procedure TcxDBTreeListDataController.SetStateIndexFieldName( + const Value: string); +begin + if Value <> FStateIndexFieldName then + begin + FStateIndexFieldName := Value; + UpdateInternalKeyFields(FStateIndexFieldName, FStateIndexField); + end; +end; + +{ TcxDBTreeListDefaultValuesProvider } + +function TcxDBTreeListDefaultValuesProvider.IsDisplayFormatDefined( + AIsCurrencyValueAccepted: Boolean): Boolean; +begin + Result := TcxDBItemDataBinding(Owner).IsDisplayFormatDefined(AIsCurrencyValueAccepted); +end; + +{ TcxDBItemDataBinding } + +procedure TcxDBItemDataBinding.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxDBItemDataBinding then + FieldName := TcxDBItemDataBinding(Source).FieldName; +end; + +function TcxDBItemDataBinding.DefaultRepositoryItem: TcxEditRepositoryItem; +begin + Result := GetDefaultEditDBRepositoryItems.GetItemByField(Field); +end; + +function TcxDBItemDataBinding.GetControl: TObject; +begin + Result := DataController.GetControl; +end; + +function TcxDBItemDataBinding.GetDefaultCaption: string; +begin + if Field <> nil then + Result := Field.DisplayName + else + Result := FieldName; +end; + +function TcxDBItemDataBinding.GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; +begin + Result := TcxDBTreeListDefaultValuesProvider; +end; + +function TcxDBItemDataBinding.GetValueTypeClass: TcxValueTypeClass; +begin + Result := GetValueTypeClassByField(Field); +end; + +procedure TcxDBItemDataBinding.Init; +begin + inherited Init; + TcxDBTreeListDefaultValuesProvider(DefaultValuesProvider).DataSource := DataController.DataSource; + TcxDBTreeListDefaultValuesProvider(DefaultValuesProvider).Field := Field; +end; + +procedure TcxDBItemDataBinding.ValueTypeClassChanged; +begin + TcxDBTreeListColumn(EditContainer).InternalPropertiesChanged; +end; + +function TcxDBItemDataBinding._AddRef: Integer; +begin + Result := -1; +end; + +function TcxDBItemDataBinding._Release: Integer; +begin + Result := -1; +end; + +function TcxDBItemDataBinding.QueryInterface( + const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := cxE_NOINTERFACE; +end; + +function TcxDBItemDataBinding.GetDataController: TcxDBTreeListDataController; +begin + Result := TcxDBTreeListDataController(inherited DataController); +end; + +function TcxDBItemDataBinding.GetField: TField; +begin + Result := DataController.GetItemField(EditContainer.ItemIndex); +end; + +function TcxDBItemDataBinding.GetFieldName: string; +begin + Result := DataController.GetItemFieldName(EditContainer.ItemIndex); +end; + +procedure TcxDBItemDataBinding.SetFieldName(const AName: string); +begin + DataController.ChangeFieldName(EditContainer.ItemIndex, AName); + Init; + ValueTypeClassChanged; +end; + +{ TcxDBTreeListColumnSummaryFooter } + +procedure TcxDBTreeListColumnSummaryFooter.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxDBTreeListColumnSummaryFooter then + FieldName := TcxDBTreeListColumnSummaryFooter(Source).FieldName; +end; + +function TcxDBTreeListColumnSummaryFooter.GetControl: TObject; +begin + Result := DataController.GetControl; +end; + +function TcxDBTreeListColumnSummaryFooter.GetDataController: TcxDBTreeListDataController; +begin + Result := TcxDBTreeListDataController(inherited DataController); +end; + +function TcxDBTreeListColumnSummaryFooter.GetFieldName: string; +begin + if IsSummaryItemValid then + Result := SummaryItem.FieldName + else + Result := ''; +end; + +function TcxDBTreeListColumnSummaryFooter.GetSummaryItem: TcxDBDataSummaryItem; +begin + Result := TcxDBDataSummaryItem(inherited SummaryItem); +end; + +procedure TcxDBTreeListColumnSummaryFooter.SetFeldName(const Value: string); +begin + if IsSummaryItemValid then + SummaryItem.FieldName := Value; + SummaryItemChanged; +end; + +function TcxDBTreeListColumnSummaryFooter.IsFieldNameStored: Boolean; +begin + Result := FieldName <> ''; +end; + +{ TcxDBTreeListOptionsData } + +constructor TcxDBTreeListOptionsData.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + CheckHasChildren := True; +end; + +procedure TcxDBTreeListOptionsData.Assign(Source: TPersistent); +begin + if Source is TcxDBTreeListOptionsData then + begin + SmartRefresh := TcxDBTreeListOptionsData(Source).SmartRefresh; + SyncMode := TcxDBTreeListOptionsData(Source).SyncMode; + end; + inherited Assign(Source); +end; + +procedure TcxDBTreeListOptionsData.SetSmartLoad(Index: Integer; Value: Boolean); +begin + with TcxCustomDBTreeList(GetOwner) do + begin + DataController.BeginUpdate; + try + if Value then + SmartRefresh := False; + inherited SetSmartLoad(Index, Value); + finally + DataController.EndUpdate; + end; + end; +end; + +function TcxDBTreeListOptionsData.GetDataController: TcxDBTreeListDataController; +begin + Result := TcxCustomDBTreeList(EditingControl).DataController; +end; + +function TcxDBTreeListOptionsData.GetSmartRefresh: Boolean; +begin + Result := DataController.DataModeController.SmartRefresh; +end; + +function TcxDBTreeListOptionsData.GetSyncMode: Boolean; +begin + Result := DataController.DataModeController.SyncMode; +end; + +procedure TcxDBTreeListOptionsData.SetSmartRefresh(Value: Boolean); +begin + if SmartRefresh <> Value then + DataController.DataModeController.SmartRefresh := Value; +end; + +procedure TcxDBTreeListOptionsData.SetSyncMode(Value: Boolean); +begin + if SyncMode <> Value then + DataController.DataModeController.SyncMode := Value; +end; + +{ TcxDBTreeListColumn } + +function TcxDBTreeListColumn.GetDataBindingClass: TcxItemDataBindingClass; +begin + Result := TcxDBItemDataBinding; +end; + +function TcxDBTreeListColumn.GetSummaryFooterClass: TcxTreeListColumnSummaryFooterClass; +begin + Result := TcxDBTreeListColumnSummaryFooter; +end; + +function TcxDBTreeListColumn.GetDataBinding: TcxDBItemDataBinding; +begin + Result := TcxDBItemDataBinding(inherited DataBinding); +end; + +procedure TcxDBTreeListColumn.SetDataBinding(Value: TcxDBItemDataBinding); +begin + DataBinding.Assign(Value); +end; + +function TcxDBTreeListColumn.GetSummaryFooter: TcxDBTreeListColumnSummaryFooter; +begin + Result := TcxDBTreeListColumnSummaryFooter(inherited SummaryFooter) +end; + +procedure TcxDBTreeListColumn.SetSummaryFooter( + Value: TcxDBTreeListColumnSummaryFooter); +begin + SummaryFooter.Assign(Value) +end; + +{ TcxDBTreeListLoader } + +procedure TcxDBTreeListLoader.AfterSmartLoad; +begin + FreeAndNil(FValueDefReader); + inherited AfterSmartLoad; +end; + +procedure TcxDBTreeListLoader.BeforeSmartLoad; +begin + with TcxDBDataProviderAccess(DataController.Provider) do + FValueDefReader := GetValueDefReaderClass.Create; + inherited BeforeSmartLoad; +end; + +procedure TcxDBTreeListLoader.DoneLoading; +begin +// DataSet.Locate(KeyFieldName, SaveKeyValue, []); + try + inherited DoneLoading; + finally + FHasChildrenNodes.Free; + end; +end; + +function TcxDBTreeListLoader.GetImageIndexAsInteger( + const AIndex: Integer; AField: TcxDBDataField): Integer; +begin + if AField = nil then + Result := -1 + else + try + Result := DataController.GetInternalValue(AIndex, AField); + except + on EVariantError do Result := -1; + end; +end; + +function TcxDBTreeListLoader.GetKeyValue(ARecordIndex: Integer): Variant; +begin + Result := DataController.GetKeyValue(ARecordIndex); +end; + +function TcxDBTreeListLoader.GetNodeImageIndex( + ARecordIndex: Integer): Integer; +begin + with DataController do + Result := GetImageIndexAsInteger(ARecordIndex, FImageIndexField); +end; + +function TcxDBTreeListLoader.GetNodeStateImage( + ARecordIndex: Integer): Integer; +begin + with DataController do + Result := GetImageIndexAsInteger(ARecordIndex, FStateIndexField); +end; + +function TcxDBTreeListLoader.GetParentKeyValue(ARecordIndex: Integer): Variant; +begin + Result := DataController.GetParentKeyValue(ARecordIndex); +end; + +procedure TcxDBTreeListLoader.InitLoadedNode(ANode: TcxTreeListDataNode); +begin + if IsSmartLoad and not IsLoadLoadingData then + TcxDataNodeAccess(ANode).RecordIndex := DataController.LoadRecord(ValueDefReader); +end; + +procedure TcxDBTreeListLoader.InitLoading; +begin + FHasChildrenNodes := TList.Create; + inherited InitLoading; +end; + +function TcxDBTreeListLoader.IsExistChildren(ANode: TcxTreeListDataNode): Boolean; +begin + Result := not NeedCheckChildren or DataSet.Locate(ParentFieldName, ANode.KeyValue, []); +end; + +function TcxDBTreeListLoader.IsExistKeyRoot(AParentValue: Variant): Boolean; +var + ARootValue: Variant; +begin + Result := False; + ARootValue := DBTreeList.RootValue; + repeat + if AParentValue = ARootValue then + begin + Result := True; + Break; + end; + if not DataSet.Locate(KeyFieldName, AParentValue, []) or + (KeyField.Value = ParentField.Value) then Break; + AParentValue := ParentField.Value; + until False; +end; + +procedure TcxDBTreeListLoader.LoadLevel(ANode: TcxTreeListDataNode; + const AParentValue: Variant; ANewNodes: TList); +var + I: Integer; + AItem: TcxTreeListDataNode; + AList: TList; +begin + if not DataSet.Locate(ParentFieldName, AParentValue, []) then Exit; + AList := TList.Create; + try + while not DataSet.EOF and (ParentField.Value = AParentValue) do + begin + AItem := LoadValues(AParentValue, KeyField.Value); + if ANewNodes <> nil then ANewNodes.Add(AItem); + if ANode = nil then AList.Add(AItem); + DataSet.Next; + end; + // load children if expanded + if ANode = nil then + begin + for I := 0 to AList.Count - 1 do + begin + AItem := TcxTreeListDataNode(AList[I]); + if AItem.Expanded then + LoadLevel(AItem, AItem.KeyValue, nil) + else + if IsExistChildren(AItem) then FHasChildrenNodes.Add(AItem); + end; + end + else + begin + ANode := TcxTreeListDataNode(ANode.GetFirstChild); + while ANode <> nil do + begin + if ANode.Expanded then + LoadLevel(ANode, ANode.KeyValue, nil) + else + if IsExistChildren(ANode) then FHasChildrenNodes.Add(ANode); + ANode := TcxTreeListDataNode(ANode.GetNextSibling); + end; + end; + finally + for I := 0 to FHasChildrenNodes.Count - 1 do + TcxTreeListDataNode(FHasChildrenNodes[I]).HasChildren := True; + FHasChildrenNodes.Clear; + AList.Free; + end; +end; + +procedure TcxDBTreeListLoader.LoadChildItems(ANode: TcxTreeListDataNode); +var + AItem: TcxTreeListNode; + AParentValue: Variant; +begin + AParentValue := ANode.KeyValue; + if not DataSet.Locate(ParentFieldName, AParentValue, []) then Exit; + while not DataSet.EOF and (ParentField.Value = ANode.KeyValue) do + begin + LoadValues(ANode, AParentValue, KeyField.Value); + DataSet.Next; + end; + AItem := ANode.GetFirstChild; + while AItem <> nil do + begin + AItem.HasChildren := IsExistChildren(TcxTreeListDataNode(AItem)); + AItem := AItem.GetNextSibling; + end; +end; + +procedure TcxDBTreeListLoader.LoadLevelBack(AParentValue: Variant); +var + I, AIndex: Integer; + ANewNodes: TList; + ANode: TcxTreeListDataNode; +begin + ANewNodes := TList.Create; + try + repeat + if FindParentNode(AParentValue, I) then + begin + LoadLevel(Loaded[I], AParentValue, nil); + Break; + end + else + begin + LoadLevel(nil, AParentValue, ANewNodes); + if not DataSet.Locate(KeyFieldName, AParentValue, []) then Break; + AParentValue := ParentField.Value; + end; + until False; + // Correct Parent + for I := 0 to ANewNodes.Count - 1 do + begin + ANode := TcxTreeListDataNode(ANewNodes[I]); + if FindParentNode(ANode.ParentValue, AIndex) and + ANode.CanMove(Loaded[AIndex], tlamAddChild) then + InternalMove(ANode, Loaded[AIndex], tlamAddChild); + end; + finally + ANewNodes.Free; + end; +end; + +procedure TcxDBTreeListLoader.LoadTreeListInSmartLoadMode; +var + I: Integer; + AKeyValue: Variant; + AParentValue: Variant; +begin + if LoadingNode = nil then + begin + AKeyValue := KeyField.Value; + AParentValue := ParentField.Value; + LoadLevel(nil, DBTreeList.RootValue, nil); + if (KeyField <> ParentField) and IsExistKeyRoot(AParentValue) and + not FindParentNode(AKeyValue, I) then + LoadLevelBack(AParentValue); + end + else + LoadChildItems(LoadingNode); +end; + +function TcxDBTreeListLoader.NeedCheckChildren: Boolean; +begin + Result := DBTreeList.OptionsData.CheckHasChildren; +end; + +function TcxDBTreeListLoader.GetDataController: TcxDBTreeListDataController; +begin + Result := TcxDBTreeListDataController(inherited DataController); +end; + +function TcxDBTreeListLoader.GetDataSet: TDataSet; +begin + Result := DataController.DataSet; +end; + +function TcxDBTreeListLoader.GetDBTreeList: TcxCustomDBTreeList; +begin + Result := TcxCustomDBTreeList(TreeList) +end; + +function TcxDBTreeListLoader.GetKeyField: TField; +begin + Result := DataController.KeyFieldField; +end; + +function TcxDBTreeListLoader.GetKeyFieldName: string; +begin + Result := DataController.KeyField; +end; + +function TcxDBTreeListLoader.GetParentField: TField; +begin + Result := DataController.ParentFieldField; +end; + +function TcxDBTreeListLoader.GetParentFieldName: string; +begin + Result := DataController.ParentField; +end; + +{ TcxCustomDBTreeList } + +constructor TcxCustomDBTreeList.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FRootValue := Integer(-1); +end; + +destructor TcxCustomDBTreeList.Destroy; +begin + BeginUpdate; + DataController.DataSource := nil; + inherited Destroy; +end; + +procedure TcxCustomDBTreeList.CreateAllItems; +begin + DataController.CreateAllItems; +end; + +procedure TcxCustomDBTreeList.AddToDelitionList(ANode: TcxTreeListNode); +begin + if not IsSmartLoad then + inherited AddToDelitionList(ANode); +end; + +procedure TcxCustomDBTreeList.DoClearDataSource; +var + ADataSource: TDataSource; +begin + ADataSource := DataController.DataSource; + DataController.DataSource := nil; + DataController.DataSource := ADataSource; +end; + +procedure TcxCustomDBTreeList.DoDeleteNode(ANode: TcxTreeListNode); +begin + if IsDestroying or SafeDelete then + begin + DoRemoveNode(ANode); + Exit; + end; + UpdateFocusedRecordPost; + if IsSmartLoad and IsDataSettingsValid then + DoDeleteNodeEntry(TcxTreeListDataNode(ANode)); + inherited DoDeleteNode(ANode); +end; + +procedure TcxCustomDBTreeList.DoDeleteNodeEntry( + ANode: TcxTreeListDataNode); +var + AList: TList; + I: Integer; +begin + if not ANode.HasChildren then + begin + if DataSet.Locate(DataController.KeyField, ANode.KeyValue, []) then + DataSet.Delete; + end + else + with DataSet do + begin + SetGlassCursor; + DisableControls; + try + AList := TList.Create; + try + if not IsSmartLoad then + LoadListByNode(ANode, AList) + else + LoadListByID(ANode.KeyValue, AList); + // Delete Nodes + for I := AList.Count - 1 downto 0 do + if Locate(DataController.KeyField, PVariant(AList[I])^, []) then Delete; + finally + for I := 0 to AList.Count - 1 do + Dispose(AList[I]); + AList.Free; + end; + finally + EnableControls; + end; + end; +end; + +function TcxCustomDBTreeList.DoExecuteInitInsertingRecord( + ANode: TcxTreeListDataNode): Boolean; +begin + Result := False; + if Assigned(FOnInitInsertingRecord) then + FOnInitInsertingRecord(Self, ANode, Result); +end; + +procedure TcxCustomDBTreeList.DoMoveTo(AttachNode: TcxTreeListNode; + AttachMode: TcxTreeListNodeAttachMode; ANodes: TList; IsCopy: Boolean); +var + I: Integer; + NewParentValue: Variant; +begin + if AttachMode in [tlamAddChild, tlamAddChildFirst] then + NewParentValue := TcxTreeListDataNode(AttachNode).KeyValue + else + NewParentValue := TcxTreeListDataNode(AttachNode).ParentValue; + if not IsCopy then + begin + inherited DoMoveTo(AttachNode, AttachMode, ANodes, IsCopy); + DataController.DataSet.DisableControls; + try + for I := 0 to ANodes.Count - 1 do + DataController.SetNodeParentValue( + TcxTreeListDataNode(ANodes.List^[I]), NewParentValue); + finally + DataController.DataSet.EnableControls; + end; + end + else + begin + BeginUpdate; + try + DataController.DoCopyTo(TcxTreeListDataNode(AttachNode), AttachMode, ANodes); + if IsSmartRefresh then DataController.UpdateItems(False); + finally + EndUpdate; + DoDataChanged; + end + end; +end; + +function TcxCustomDBTreeList.GetDataControllerClass: TcxCustomDataControllerClass; +begin + Result := TcxDBTreeListDataController; +end; + +function TcxCustomDBTreeList.GetOptionsDataClass: TcxControlOptionsDataClass; +begin + Result := TcxDBTreeListOptionsData; +end; + +function TcxCustomDBTreeList.GetLoaderClass: TcxDataTreeListStructureLoaderClass; +begin + Result := TcxDBTreeListLoader; +end; + +function TcxCustomDBTreeList.GetTreeListColumnClass: TcxTreeListColumnClass; +begin + Result := TcxDBTreeListColumn; +end; + +function TcxCustomDBTreeList.InsertNode(IsAppend: Boolean): Boolean; +begin + if IsAppend then + DataController.Append + else + DataController.Insert; + Result := True; +end; + +function TcxCustomDBTreeList.IsAutoCalcKeyValue: Boolean; +begin + Result := OptionsData.AutoCalcKeyValue and not IsSmartLoad; +end; + +function TcxCustomDBTreeList.IsDataSettingsValid: Boolean; +begin + with DataController do + Result := (DataSet <> nil) and DataSet.Active and not IsKeyFieldEmpty; +end; + +function TcxCustomDBTreeList.IsSmartRefresh: Boolean; +begin + Result := OptionsData.SmartRefresh; +end; + +function TcxCustomDBTreeList.SupportsCreateAllItems: Boolean; +begin + Result := True; +end; + +procedure TcxCustomDBTreeList.LoadListByNode( + ANode: TcxTreeListDataNode; AList: TList); +var + P: PVariant; + I: Integer; +begin + New(P); + P^ := ANode.KeyValue; + AList.Add(P); + for I := 0 to ANode.Count - 1 do + LoadListByNode(TcxTreeListDataNode(ANode[I]), AList); +end; + +procedure TcxCustomDBTreeList.LoadListByID( + const AKeyValue: Variant; AList: TList); +var + P: PVariant; + ATempList: TList; + I: Integer; +begin + New(P); + P^ := AKeyValue; + AList.Add(P); + if not DataSet.Locate(DataController.ParentField, AKeyValue, []) then Exit; + ATempList := TList.Create; + try + while not DataSet.Eof and (DataController.ParentFieldField.Value = AKeyValue) do + begin + New(P); + P^ := DataController.KeyFieldField.Value; + ATempList.Add(P); + DataSet.Next; + end; + for I := 0 to ATempList.Count - 1 do + LoadListByID(PVariant(ATempList[I])^, AList); + finally + for I := 0 to ATempList.Count - 1 do + Dispose(ATempList[I]); + ATempList.Free; + end; +end; + +procedure TcxCustomDBTreeList.UpdateNode(ANode: TcxTreeListNode); + + function IsDataChanged: Boolean; + begin + with DataController, TcxDataNodeAccess(ANode) do + Result := (VarCompare(GetKeyValue(RecordIndex), KeyValue) <> 0) or + (VarCompare(GetParentKeyValue(RecordIndex), ParentValue) <> 0); + end; + +begin + if IsFreeze then Exit; + if IsDataChanged then + DataChanged + else + inherited UpdateNode(ANode); +end; + +function TcxCustomDBTreeList.GetColumn(Index: Integer): TcxDBTreeListColumn; +begin + Result := TcxDBTreeListColumn(inherited Columns[Index]) +end; + +function TcxCustomDBTreeList.GetDataController: TcxDBTreeListDataController; +begin + Result := TcxDBTreeListDataController(inherited DataController); +end; + +function TcxCustomDBTreeList.GetDataSet: TDataSet; +begin + Result := DataController.DataSource.DataSet; +end; + +function TcxCustomDBTreeList.GetOptionsData: TcxDBTreeListOptionsData; +begin + Result := TcxDBTreeListOptionsData(inherited OptionsData); +end; + +function TcxCustomDBTreeList.GetVisibleColumn( + Index: Integer): TcxDBTreeListColumn; +begin + Result := TcxDBTreeListColumn(inherited VisibleColumns[Index]) +end; + +procedure TcxCustomDBTreeList.SetColumn( + Index: Integer; Value: TcxDBTreeListColumn); +begin + Columns[Index].Assign(Value); +end; + +procedure TcxCustomDBTreeList.SetDataController( + Value: TcxDBTreeListDataController); +begin + DataController.Assign(Value); +end; + +procedure TcxCustomDBTreeList.SetOptionsData(Value: TcxDBTreeListOptionsData); +begin + OptionsData.Assign(Value); +end; + +procedure TcxCustomDBTreeList.SetRootValue(const Value: Variant); +begin + FRootValue := Value; + DataChanged; +end; + +procedure TcxCustomDBTreeList.SetVisibleColumn( + Index: Integer; Value: TcxDBTreeListColumn); +begin + VisibleColumns[Index].Assign(Value); +end; + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Sources/cxDXTLConverter.pas b/official/x.35/ExpressQuantumTreeList 4/Sources/cxDXTLConverter.pas new file mode 100644 index 00000000..3564a356 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Sources/cxDXTLConverter.pas @@ -0,0 +1,1418 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumTreeList } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMTREELIST AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxDXTLConverter; + +{$I cxVer.inc} + +interface + +uses + SysUtils, cxConverterFactory, cxTLConverter, cxTL, cxDBTL, Classes, + cxConverterUtils, cxLookAndFeels, cxInplaceContainer, DB, cxStyles, + Graphics, cxCustomData, cxCustomConverter, cxBlobEdit, cxPropertiesConverters, + cxButtonEdit, cxCalc, cxCheckBox, cxDropDownEdit, cxCurrencyEdit, cxCalendar, + cxDBLookupComboBox, cxHyperLinkEdit, cxImage, cxImageComboBox, cxMaskEdit, cxMemo, + cxMRUEdit, cxSpinEdit, cxTextEdit, cxTimeEdit, cxVariants; + +type + TcxCustomTreeListControlAccessor = class(TcxCustomTreeListControl); + + { TcxDXCustomTLConverter } + TcxDXCustomTLConverter = class(TcxCustomTLConverter) + private + FContentColor: Integer; + FContentFont: TFont; + FcxColumnCache: TStringList; + function GetAccessor: TcxCustomTreeListControlAccessor; + procedure GetColumns(AColumns: TList); + function GetCxColumnByDxName(AName: string): TcxTreeListColumn; + procedure ImportTreeList; + protected + procedure AssignColumn(AcxColumn: TcxTreeListColumn; AdxColumn: TObject; AIndex: Integer); virtual; + procedure AssignTreeList; virtual; + procedure AssignTreeListOptions; virtual; + function ConvertColumnShowEditButtons(const AValue: string): TcxEditItemShowEditButtons; + function ConvertFixedKind(const AValue: string): TcxTreeListBandFixedKind; + function ConvertGridLines(const AValue: Boolean): TcxTreeListGridLines; + function ConvertLookAndFeelKind(const AValue: string): TcxLookAndFeelKind; + function ConvertPaintStyle(const AValue: string): TcxTreeListPaintStyle; + function ConvertShowEditButtons(const AValue: Boolean): TcxEditingControlEditShowButtons; + function ConvertTreeLineStyle(const AShowLines: Boolean; const AValue: string): TcxTreeListTreeLineStyle; + function ConvertColumnSortOrder(const AValue: string): TcxDataSortOrder; + function CreateColumn: TcxTreeListColumn; virtual; + procedure DoImportStyles; override; + procedure DoRealImport; override; + procedure ImportBands; + procedure ImportBandsWidth; + procedure ImportColumn(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); virtual; + procedure ImportColumns; + procedure ImportColumnsStyles; + procedure ImportColumnsWidth; + procedure ImportData; virtual; + procedure ImportPreview; virtual; + procedure ImportPropertiesBlobEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); + procedure ImportPropertiesButtonEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); + procedure ImportPropertiesCalcEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); + procedure ImportPropertiesCheckBox(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); + procedure ImportPropertiesComboBox(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); + procedure ImportPropertiesCurencyEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); + procedure ImportPropertiesDateEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); + procedure ImportPropertiesExLookupComboBox(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); + procedure ImportPropertiesHyperLinkEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); + procedure ImportPropertiesImage(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); + procedure ImportPropertiesImageComboBox(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); + procedure ImportPropertiesLookupComboBox(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); + procedure ImportPropertiesMaskEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); + procedure ImportPropertiesMemo(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); + procedure ImportPropertiesMRUEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); + procedure ImportPropertiesPopupEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); + procedure ImportPropertiesSpinEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); + procedure ImportPropertiesTextEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); + procedure ImportPropertiesTimeEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); + procedure ImportTreeListStyles; + property Accessor: TcxCustomTreeListControlAccessor read GetAccessor; + public + constructor Create(ADestination: TObject); override; + destructor Destroy; override; + end; + + { TcxDXTLConverter } + TcxDXTLConverter = class(TcxDXCustomTLConverter) + private + procedure AssignDXOptions; + procedure AssignDXOptionsEx; + function GetDestination: TcxTreeList; + protected + procedure AssignTreeList; override; + procedure AssignTreeListOptions; override; + function CreateColumn: TcxTreeListColumn; override; + procedure ImportColumn(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); override; + procedure ImportData; override; + public + class function GetSourceClassName: string; override; + property Destination: TcxTreeList read GetDestination; + end; + + { TcxDXDBTLConverter } + TcxDXDBTLConverter = class(TcxDXCustomTLConverter) + private + procedure AssignDXOptionsBehavior; + procedure AssignDXOptionsCustomize; + procedure AssignDXOptionsDB; + procedure AssignDXOptionsView; + function ConvertFooterKind(AValue: string): TcxSummaryKind; + function GetDestination: TcxDBTreeList; + procedure ImportColumnSummary(AcxColumn: TcxTreeListColumn; AdxColumn: TObject); + function TestColumnFieldName(AFieldName: string; AIndex: Integer): Boolean; + protected + procedure AssignColumn(AcxColumn: TcxTreeListColumn; AdxColumn: TObject; AIndex: Integer); override; + procedure AssignTreeListOptions; override; + function CreateColumn: TcxTreeListColumn; override; + procedure DoImportStyles; override; + procedure DoRealImport; override; + procedure ImportColumn(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); override; + procedure ImportPreview; override; + public + class function GetSourceClassName: string; override; + property Destination: TcxDBTreeList read GetDestination; + end; + +implementation + +uses + Controls, cxControls; + +{ TcxDXCustomTLConverter } + +constructor TcxDXCustomTLConverter.Create(ADestination: TObject); +begin + inherited Create(ADestination); + FcxColumnCache := TStringList.Create; + FcxColumnCache.Sorted := True; +end; + +destructor TcxDXCustomTLConverter.Destroy; +begin + FcxColumnCache.Free; + inherited Destroy; +end; + +procedure TcxDXCustomTLConverter.AssignColumn(AcxColumn: TcxTreeListColumn; AdxColumn: TObject; AIndex: Integer); +begin + SetTLColumnUniqueName(Destination, AcxColumn); + with AcxColumn do + begin + Caption.AlignHorz := ConvertAlignment(GetEnumProperty(AdxColumn, 'HeaderAlignment')); + Caption.Text := GetStringProperty(AdxColumn, 'Caption'); +// MinWidth := GetIntegerProperty(AdxColumn, 'MinWidth'); + Options.Customizing := not GetBooleanProperty(AdxColumn, 'DisableCustomizing'); + Options.Editing := not GetBooleanProperty(AdxColumn, 'DisableEditor'); + Options.Moving := not GetBooleanProperty(AdxColumn, 'DisableDragging'); + Options.Sizing := GetBooleanProperty(AdxColumn, 'Sizing'); + Options.TabStop := GetBooleanProperty(AdxColumn, 'TabStop'); + SortOrder := ConvertColumnSortOrder(GetEnumProperty(AdxColumn, 'Sorted')); + Position.BandIndex := GetIntegerProperty(AdxColumn, 'BandIndex'); + Position.ColIndex := GetIntegerProperty(AdxColumn, 'ColIndex'); + Position.RowIndex := GetIntegerProperty(AdxColumn, 'RowIndex'); + Tag := GetIntegerProperty(AdxColumn, 'Tag'); + Visible := GetBooleanProperty(AdxColumn, 'Visible'); +// Width := GetIntegerProperty(AdxColumn, 'Width'); + end; +end; + +procedure TcxDXCustomTLConverter.AssignTreeList; +begin + with Accessor do + begin + DefaultLayout := GetBooleanProperty(nil, 'DefaultLayout'); + Enabled := GetBooleanProperty(nil, 'Enabled'); + LookAndFeel.Kind := ConvertLookAndFeelKind(GetEnumProperty(nil, 'LookAndFeel')); + ParentColor := GetBooleanProperty(nil, 'ParentColor'); + ParentFont := GetBooleanProperty(nil, 'ParentFont'); + Tag := GetIntegerProperty(nil, 'Tag'); + OptionsBehavior.ExpandOnIncSearch := GetBooleanProperty(nil, 'AutoExpandOnSearch'); + OptionsView.BandLineCount := GetIntegerProperty(nil, 'BandRowCount'); + OptionsView.FixedSeparatorWidth := GetIntegerProperty(nil, 'FixedBandLineWidth'); + OptionsSelection.HideFocusRect := GetBooleanProperty(nil, 'HideFocusRect'); + OptionsSelection.HideSelection := GetBooleanProperty(nil, 'HideSelection'); + OptionsView.PaintStyle := ConvertPaintStyle(GetEnumProperty(nil, 'PaintStyle')); + Preview.MaxLineCount := GetIntegerProperty(nil, 'PreviewLines'); + OptionsView.ScrollBars := ConvertScrollStyle(GetEnumProperty(nil, 'ScrollBars')); + OptionsView.GridLines := ConvertGridLines(GetBooleanProperty(nil, 'ShowGrid')); + OptionsView.Bands := GetBooleanProperty(nil, 'ShowBands'); + OptionsView.Buttons := GetBooleanProperty(nil, 'ShowButtons'); + OptionsView.Footer := GetBooleanProperty(nil, 'ShowFooter'); + OptionsView.Headers := GetBooleanProperty(nil, 'ShowHeader'); + OptionsView.ShowRoot := GetBooleanProperty(nil, 'ShowRoot'); + OptionsView.SimpleCustomizeBox := GetBooleanProperty(nil, 'SimpleCustomizeBox'); + OptionsView.TreeLineStyle := ConvertTreeLineStyle(GetBooleanProperty(nil, 'ShowLines'), + GetEnumProperty(nil, 'TreeLineStyle')); + OptionsBehavior.WaitForExpandNodeTime := GetIntegerProperty(nil, 'WaitForExpandNodeTime'); + OptionsBehavior.CellHints := GetBooleanProperty(nil, 'ShowHint'); + OptionsView.CellTextMaxLineCount := GetIntegerProperty(nil, 'MaxRowLineCount'); + end; +end; + +procedure TcxDXCustomTLConverter.AssignTreeListOptions; +begin +end; + +function TcxDXCustomTLConverter.ConvertColumnShowEditButtons(const AValue: string): TcxEditItemShowEditButtons; +begin + if AValue = 'sbAlways' then + Result := eisbAlways + else if AValue = 'sbDefault' then + Result := eisbDefault + else + Result := eisbNever; +end; + +function TcxDXCustomTLConverter.ConvertFixedKind(const AValue: string): TcxTreeListBandFixedKind; +begin + if AValue = 'bfLeft' then + Result := tlbfLeft + else if AValue = 'bfRight' then + Result := tlbfRight + else + Result := tlbfNone; +end; + +function TcxDXCustomTLConverter.ConvertGridLines(const AValue: Boolean): TcxTreeListGridLines; +begin + if AValue then + Result := tlglBoth + else + Result := tlglNone; +end; + +function TcxDXCustomTLConverter.ConvertLookAndFeelKind(const AValue: string): TcxLookAndFeelKind; +begin + if AValue = 'lfFlat' then + Result := lfFlat + else if AValue = 'lfUltraFlat' then + Result := lfUltraFlat + else + Result := lfStandard; +end; + +function TcxDXCustomTLConverter.ConvertPaintStyle(const AValue: string): TcxTreeListPaintStyle; +begin + if AValue = 'psOutlook' then + Result := tlpsCategorized + else + Result := tlpsStandard; +end; + +function TcxDXCustomTLConverter.ConvertShowEditButtons(const AValue: Boolean): TcxEditingControlEditShowButtons; +begin + if AValue then + Result := ecsbAlways + else + Result := ecsbFocused; +end; + +function TcxDXCustomTLConverter.ConvertTreeLineStyle(const AShowLines: Boolean; + const AValue: string): TcxTreeListTreeLineStyle; +begin + if AShowLines then + begin + if AValue = 'tlDot' then + Result := tllsDot + else + Result := tllsSolid; + end + else + Result := tllsNone; +end; + +function TcxDXCustomTLConverter.ConvertColumnSortOrder(const AValue: string): TcxDataSortOrder; +begin + if AValue = 'csDown' then + Result := soDescending + else if AValue = 'csUp' then + Result := soAscending + else + Result := soNone; +end; + +function TcxDXCustomTLConverter.CreateColumn: TcxTreeListColumn; +begin + Result := Destination.CreateColumn; +end; + +procedure TcxDXCustomTLConverter.DoImportStyles; +begin + ImportTreeListStyles; + ImportColumnsStyles; +end; + +procedure TcxDXCustomTLConverter.DoRealImport; + + function IsBandHeaderWidth: Boolean; + var + AList: TStringList; + begin + AList := TStringList.Create; + try + GetSetProperty(nil, 'OptionsEx', AList); + Result := + GetBooleanProperty(nil, 'DefaultLayout') or + (AList.IndexOf('aoBandHeaderWidth') <> -1) or + GetBooleanProperty(nil, 'ShowBands'); + finally + AList.Free; + end; + end; + +begin + ImportBands; + ImportColumns; + ImportColumnsWidth; + ImportPreview; + ImportTreeList; + if IsBandHeaderWidth and False then + ImportBandsWidth; + ImportData; +end; + +procedure TcxDXCustomTLConverter.ImportBands; +var + ABands: TObject; + AcxBand: TcxTreeListBand; + I: Integer; +begin + ABands := GetClassProperty(nil, 'Bands'); + if ABands <> nil then + begin + if ABands is TCollection then + with TCollection(ABands) do + begin + for I := 0 to Count - 1 do + begin + AcxBand := Accessor.Bands.Add; + AcxBand.Caption.Text := GetStringProperty(Items[I], 'Caption'); + AcxBand.Caption.AlignHorz := ConvertAlignment(GetEnumProperty(Items[I], 'Alignment')); + AcxBand.Visible := GetBooleanProperty(Items[I], 'Visible'); + AcxBand.FixedKind := ConvertFixedKind(GetEnumProperty(Items[I], 'Fixed')); + AcxBand.Options.Customizing := not GetBooleanProperty(Items[I], 'DisableCustomizing'); + AcxBand.Options.Moving := not GetBooleanProperty(Items[I], 'DisableDragging'); + AcxBand.Options.OnlyOwnColumns := GetBooleanProperty(Items[I], 'OnlyOwnColumns'); + AcxBand.Options.Sizing := GetBooleanProperty(Items[I], 'Sizing'); + end; + end; + end; +end; + +procedure TcxDXCustomTLConverter.ImportBandsWidth; +var + ABands: TCollection; + I: Integer; +begin + ABands := TCollection(GetClassProperty(nil, 'Bands')); + if not (ABands is TCollection) then Exit; + for I := 0 to ABands.Count - 1 do + begin + with Accessor.Bands[I] do + begin + MinWidth := GetIntegerProperty(ABands.Items[I], 'MinWidth'); + Width := GetIntegerProperty(ABands.Items[I], 'Width'); + end; + end; +end; + +procedure TcxDXCustomTLConverter.ImportColumn(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +begin +end; + +procedure TcxDXCustomTLConverter.ImportColumns; +var + AColumns: TList; + AcxColumn: TcxTreeListColumn; + I: Integer; +begin + AColumns := TList.Create; + try + GetColumns(AColumns); + for I := 0 to AColumns.Count - 1 do + begin + AcxColumn := CreateColumn; + FcxColumnCache.AddObject(GetStringProperty(TObject(AColumns[I]), 'Name'), AcxColumn); + AssignColumn(AcxColumn, TObject(AColumns[I]), I); + ImportColumn(TObject(AColumns[I]), AcxColumn); + end; + finally + AColumns.Free; + end; +end; + +procedure TcxDXCustomTLConverter.ImportColumnsStyles; +var + AColumns: TList; + AcxColumn: TcxTreeListColumn; + I: Integer; + AColor: Integer; + AFont: TFont; + AStyle: TcxCustomStyle; +begin + AColumns := TList.Create; + try + GetColumns(AColumns); + for I := 0 to AColumns.Count - 1 do + begin + AcxColumn := GetCxColumnByDxName(GetStringProperty(TObject(AColumns[I]), 'Name')); + if AcxColumn <> nil then + begin + AColor := GetIntegerProperty(TObject(AColumns[I]), 'Color'); + AFont := GetClassProperty(TObject(AColumns[I]), 'Font') as TFont; + if (AColor <> FContentColor) or not CompareFonts(AFont, FContentFont) then + begin + AStyle := CreateStyleItem; + (AStyle as TcxStyle).Color := AColor; + (AStyle as TcxStyle).Font.Assign(AFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + AcxColumn.Styles.Content := AStyle as TcxStyle; + end; + end; + end; + finally + AColumns.Free + end; +end; + +procedure TcxDXCustomTLConverter.ImportColumnsWidth; +var + AColumns: TList; + AcxColumn: TcxTreeListColumn; + I: Integer; +begin + AColumns := TList.Create; + try + GetColumns(AColumns); + for I := 0 to AColumns.Count - 1 do + begin + AcxColumn := GetCxColumnByDxName(GetStringProperty(TObject(AColumns[I]), 'Name')); + if AcxColumn <> nil then + begin + AcxColumn.Width := GetIntegerProperty(TObject(AColumns[I]), 'Width'); + AcxColumn.MinWidth := GetIntegerProperty(TObject(AColumns[I]), 'MinWidth'); + end; + end; + finally + AColumns.Free; + end; +end; + +procedure TcxDXCustomTLConverter.ImportData; +begin +end; + +procedure TcxDXCustomTLConverter.ImportPreview; +begin +end; + +procedure TcxDXCustomTLConverter.ImportPropertiesBlobEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxBlobEditProperties; + AConverter := TcxBlobEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + AcxColumn.Options.ShowEditButtons := ConvertColumnShowEditButtons( + GetEnumProperty(AdxColumn, 'ShowButtonStyle')); + finally + AConverter.Free; + end; +end; + +procedure TcxDXCustomTLConverter.ImportPropertiesButtonEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxButtonEditProperties; + AConverter := TcxButtonEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + AcxColumn.Options.ShowEditButtons := ConvertColumnShowEditButtons( + GetEnumProperty(AdxColumn, 'ShowButtonStyle')); + finally + AConverter.Free; + end; +end; + +procedure TcxDXCustomTLConverter.ImportPropertiesCalcEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxCalcEditProperties; + AConverter := TcxCalcEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + AcxColumn.Options.ShowEditButtons := ConvertColumnShowEditButtons( + GetEnumProperty(AdxColumn, 'ShowButtonStyle')); + finally + AConverter.Free; + end; +end; + +procedure TcxDXCustomTLConverter.ImportPropertiesCheckBox(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxCheckBoxProperties; + AConverter := TcxCheckBoxPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + finally + AConverter.Free; + end; +end; + +procedure TcxDXCustomTLConverter.ImportPropertiesComboBox(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxComboBoxProperties; + AConverter := TcxComboBoxPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + AcxColumn.Options.ShowEditButtons := ConvertColumnShowEditButtons( + GetEnumProperty(AdxColumn, 'ShowButtonStyle')); + finally + AConverter.Free; + end; +end; + +procedure TcxDXCustomTLConverter.ImportPropertiesCurencyEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxCurrencyEditProperties; + AConverter := TcxCurrencyEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + finally + AConverter.Free; + end; +end; + +procedure TcxDXCustomTLConverter.ImportPropertiesDateEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxDateEditProperties; + AConverter := TcxDateEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + AcxColumn.Options.ShowEditButtons := ConvertColumnShowEditButtons( + GetEnumProperty(AdxColumn, 'ShowButtonStyle')); + finally + AConverter.Free; + end; +end; + +procedure TcxDXCustomTLConverter.ImportPropertiesExLookupComboBox(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +begin +end; + +procedure TcxDXCustomTLConverter.ImportPropertiesHyperLinkEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxHyperLinkEditProperties; + AConverter := TcxHyperLinkEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + finally + AConverter.Free; + end; +end; + +procedure TcxDXCustomTLConverter.ImportPropertiesImage(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxImageProperties; + AConverter := TcxImagePropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + finally + AConverter.Free; + end; +end; + +procedure TcxDXCustomTLConverter.ImportPropertiesImageComboBox(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxImageComboBoxProperties; + AConverter := TcxImageComboBoxPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + AcxColumn.Options.ShowEditButtons := ConvertColumnShowEditButtons( + GetEnumProperty(AdxColumn, 'ShowButtonStyle')); + finally + AConverter.Free; + end; +end; + +procedure TcxDXCustomTLConverter.ImportPropertiesLookupComboBox(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxLookupComboBoxProperties; + AConverter := TcxLookupComboBoxPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + AcxColumn.Options.ShowEditButtons := ConvertColumnShowEditButtons( + GetEnumProperty(AdxColumn, 'ShowButtonStyle')); + finally + AConverter.Free; + end; +end; + +procedure TcxDXCustomTLConverter.ImportPropertiesMaskEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxMaskEditProperties; + AConverter := TcxMaskEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + finally + AConverter.Free; + end; +end; + +procedure TcxDXCustomTLConverter.ImportPropertiesMemo(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxMemoProperties; + AConverter := TcxMemoPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + finally + AConverter.Free; + end; +end; + +procedure TcxDXCustomTLConverter.ImportPropertiesMRUEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxMRUEditProperties; + AConverter := TcxMRUEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + AcxColumn.Options.ShowEditButtons := ConvertColumnShowEditButtons( + GetEnumProperty(AdxColumn, 'ShowButtonStyle')); + finally + AConverter.Free; + end; +end; + +procedure TcxDXCustomTLConverter.ImportPropertiesPopupEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxPopupEditProperties; + AConverter := TcxPopupEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + finally + AConverter.Free; + end; +end; + +procedure TcxDXCustomTLConverter.ImportPropertiesSpinEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxSpinEditProperties; + AConverter := TcxSpinEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + AcxColumn.Options.ShowEditButtons := ConvertColumnShowEditButtons( + GetEnumProperty(AdxColumn, 'ShowButtonStyle')); + finally + AConverter.Free; + end; +end; + +procedure TcxDXCustomTLConverter.ImportPropertiesTextEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxTextEditProperties; + AConverter := TcxTextEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + finally + AConverter.Free; + end; +end; + +procedure TcxDXCustomTLConverter.ImportPropertiesTimeEdit(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +var + AConverter: TcxCustomPropertiesConverter; +begin + AcxColumn.PropertiesClass := TcxTimeEditProperties; + AConverter := TcxTimeEditPropertiesConverter.Create(AcxColumn.Properties); + try + AConverter.ImportFrom(AdxColumn); + finally + AConverter.Free; + end; +end; + +procedure TcxDXCustomTLConverter.ImportTreeListStyles; +var + AStyle: TcxCustomStyle; + AFont: TFont; + AColor: Integer; + AColor1: Integer; +begin + FContentColor := GetIntegerProperty(nil, 'Color'); + FContentFont := GetClassProperty(nil, 'Font') as TFont; + if (FContentColor <> clWindow) or not DefaultFont(FContentFont) then + begin + AStyle := CreateStyleItem; + (AStyle as TcxStyle).Color := FContentColor; + (AStyle as TcxStyle).Font.Assign(FContentFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + Accessor.Styles.Content := AStyle as TcxStyle; + Accessor.Styles.Background := AStyle as TcxStyle; + end; + AColor := GetIntegerProperty(nil, 'BandColor'); + AFont := GetClassProperty(nil, 'BandFont') as TFont; + if (AColor <> clBtnFace) or not DefaultFont(AFont) then + begin + AStyle := CreateStyleItem; + (AStyle as TcxStyle).Color := AColor; + (AStyle as TcxStyle).Font.Assign(AFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + Accessor.Styles.BandHeader := AStyle as TcxStyle; + end; + AColor := GetIntegerProperty(nil, 'HeaderColor'); + AFont := GetClassProperty(nil, 'HeaderFont') as TFont; + if (AColor <> clBtnFace) or not DefaultFont(AFont) then + begin + AStyle := CreateStyleItem; + (AStyle as TcxStyle).Color := AColor; + (AStyle as TcxStyle).Font.Assign(AFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + Accessor.Styles.ColumnHeader := AStyle as TcxStyle; + Accessor.Styles.Indicator := AStyle as TcxStyle; + end; + AColor := GetIntegerProperty(nil, 'HighlightColor'); + AColor1 := GetIntegerProperty(nil, 'HighlightTextColor'); + if (AColor <> clHighlight) or (AColor1 <> clHighlightText) then + begin + AStyle := CreateStyleItem; + (AStyle as TcxStyle).Color := AColor; + (AStyle as TcxStyle).TextColor := AColor1; + Accessor.Styles.Selection := AStyle as TcxStyle; + end; + AColor := GetIntegerProperty(nil, 'ArrowsColor'); + if AColor <> clLime then + Accessor.OptionsView.DropArrowColor := AColor; + AColor := GetIntegerProperty(nil, 'FixedBandLineColor'); + if AColor <> clWindowFrame then + Accessor.OptionsView.FixedSeparatorColor := AColor; + AColor := GetIntegerProperty(nil, 'GridLineColor'); + if AColor <> clNone then + Accessor.OptionsView.GridLineColor := AColor; + AColor := GetIntegerProperty(nil, 'TreeLineColor'); + if AColor <> clGrayText then + Accessor.OptionsView.TreeLineColor := AColor; + AFont := GetClassProperty(nil, 'PreviewFont') as TFont; + if not DefaultFont(AFont) then + begin + AStyle := CreateStyleItem; + (AStyle as TcxStyle).Font.Assign(AFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + Accessor.Styles.Preview := AStyle as TcxStyle; + end; + AColor := GetIntegerProperty(nil, 'AutoSearchColor'); + AColor1 := GetIntegerProperty(nil, 'AutoSearchTextColor'); + if (AColor <> clNone) or (AColor1 <> clNone) then + begin + AStyle := CreateStyleItem; + (AStyle as TcxStyle).Color := AColor; + (AStyle as TcxStyle).TextColor := AColor1; + Accessor.Styles.IncSearch := AStyle as TcxStyle; + end; + AColor := GetIntegerProperty(nil, 'HideSelectionColor'); + AColor1 := GetIntegerProperty(nil, 'HideSelectionTextColor'); + if (AColor <> clBtnFace) or (AColor1 <> clBtnText) then + begin + AStyle := CreateStyleItem; + (AStyle as TcxStyle).Color := AColor; + (AStyle as TcxStyle).TextColor := AColor1; + Accessor.Styles.Inactive := AStyle as TcxStyle; + end; +end; + +function TcxDXCustomTLConverter.GetAccessor: TcxCustomTreeListControlAccessor; +begin + Result := TcxCustomTreeListControlAccessor(Destination); +end; + +procedure TcxDXCustomTLConverter.GetColumns(AColumns: TList); +var + AForm: TComponent; + I: Integer; +begin + if Source is TComponent then + begin + AForm := TComponent(Source).Owner; + for I := 0 to AForm.ComponentCount - 1 do + begin + if AForm.Components[I].GetParentComponent = Source then + AColumns.Add(AForm.Components[I]); + end; + if AColumns.Count = 0 then + begin + for I := 0 to TComponent(Source).ComponentCount - 1 do + begin + if TComponent(Source).Components[I].GetParentComponent = Source then + AColumns.Add(TComponent(Source).Components[I]); + end; + end; + end; +end; + +function TcxDXCustomTLConverter.GetCxColumnByDxName(AName: string): TcxTreeListColumn; +var + I: Integer; +begin + Result := nil; + FcxColumnCache.Find(AName, I); + if I >= 0 then + Result := FcxColumnCache.Objects[I] as TcxTreeListColumn; +end; + +procedure TcxDXCustomTLConverter.ImportTreeList; +begin + AssignTreeList; + AssignTreeListOptions; +end; + +{ TcxDXTLConverter } + +class function TcxDXTLConverter.GetSourceClassName: string; +begin + Result := 'TdxTreeList'; +end; + +procedure TcxDXTLConverter.AssignTreeList; +begin + inherited AssignTreeList; + with Destination do + OptionsView.Indicator := GetBooleanProperty(nil, 'ShowIndicator'); +end; + +procedure TcxDXTLConverter.AssignTreeListOptions; +begin + AssignDXOptions; + AssignDXOptionsEx; +end; + +function TcxDXTLConverter.CreateColumn: TcxTreeListColumn; +begin + Result := Destination.CreateColumn; +end; + +procedure TcxDXTLConverter.ImportColumn(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +begin + if AdxColumn.ClassName = 'TdxTreeListColumn' then + ImportPropertiesTextEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxTreeListMaskColumn' then + ImportPropertiesMaskEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxTreeListButtonColumn' then + ImportPropertiesButtonEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxTreeListDateColumn' then + ImportPropertiesDateEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxTreeListCheckColumn' then + ImportPropertiesCheckBox(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxTreeListImageColumn' then + ImportPropertiesImageComboBox(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxTreeListSpinColumn' then + ImportPropertiesSpinEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxTreeListLookupColumn' then + ImportPropertiesLookupComboBox(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxTreeListPickColumn' then + ImportPropertiesComboBox(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxTreeListCalcColumn' then + ImportPropertiesCalcEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxTreeListBlobColumn' then + ImportPropertiesBlobEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxTreeListHyperLinkColumn' then + ImportPropertiesHyperLinkEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxTreeListTimeColumn' then + ImportPropertiesTimeEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxTreeListCurrencyColumn' then + ImportPropertiesCurencyEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxTreeListMemoColumn' then + ImportPropertiesMemo(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxTreeListGraphicColumn' then + ImportPropertiesImage(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxTreeListMRUColumn' then + ImportPropertiesMRUEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxTreeListPopupColumn' then + ImportPropertiesPopupEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxTreeListExtLookupColumn' then + ImportPropertiesExLookupComboBox(AdxColumn, AcxColumn); +end; + +type + TComponentAccess = class(TComponent); + + TcxConverterFiler = class(TFiler) + private + FHasData: Boolean; + FReadDataProc: TStreamProc; + FWriteDataProc: TStreamProc; + public + constructor CreateFor(AComponent: TObject); + procedure CreateTreeListNodes(AStream: TStream; ADest: TcxTreeList); + procedure DefineProperty(const Name: string; ReadData: TReaderProc; + WriteData: TWriterProc; HasData: Boolean); override; + procedure DefineBinaryProperty(const Name: string; AReadData, AWriteData: TStreamProc; HasData: Boolean); override; + procedure FlushBuffer; override; + property HasData: Boolean read FHasData; + property ReadDataProc: TStreamProc read FReadDataProc; + property WriteDataProc: TStreamProc read FWriteDataProc; + end; + +constructor TcxConverterFiler.CreateFor(AComponent: TObject); +begin + TComponentAccess(AComponent).DefineProperties(Self); +end; + +procedure TcxConverterFiler.CreateTreeListNodes(AStream: TStream; ADest: TcxTreeList); +var + AReader: TcxReader; + + procedure ConvertNodesData(AParent: TcxTreeListNode; AChildCount: Integer); + var + AIndex, I, ACount, AStrCount: Integer; + ANode: TcxTreeListNode; + begin + for AIndex := 0 to AChildCount - 1 do + begin + ANode := AParent.AddChild; + I := AReader.ReadInteger; + AStream.Seek(I - 24, soFromCurrent); + ANode.ImageIndex := AReader.ReadInteger; + ANode.SelectedIndex := AReader.ReadInteger; + ANode.StateIndex := AReader.ReadInteger; + ANode.Data := Pointer(AReader.ReadInteger); + ACount := AReader.ReadInteger; + AStrCount := AReader.ReadInteger; + for I := 0 to AStrCount - 1 do + ANode.Texts[I] := AReader.ReadString; + ConvertNodesData(ANode, ACount); + end; + end; + +begin + ADest.BeginUpdate; + try + AReader := TcxReader.Create(AStream); + try + ADest.Nodes.Root.DeleteChildren; + try + if AReader.ReadInteger = -1 then + ConvertNodesData(ADest.Nodes.Root, AReader.ReadInteger); + except + ADest.Nodes.Root.DeleteChildren; + raise; + end; + finally + AReader.Free; + end; + finally + ADest.EndUpdate; + end; +end; + +procedure TcxConverterFiler.DefineProperty(const Name: string; ReadData: TReaderProc; + WriteData: TWriterProc; HasData: Boolean); +begin +end; + +procedure TcxConverterFiler.DefineBinaryProperty(const Name: string; + AReadData, AWriteData: TStreamProc; HasData: Boolean); +begin + if Name <> 'Data' then Exit; + FHasData := HasData; + FReadDataProc := AReadData; + FWriteDataProc := AWriteData; +end; + +procedure TcxConverterFiler.FlushBuffer; +begin +end; + +procedure TcxDXTLConverter.ImportData; +var + AFiler: TcxConverterFiler; + AMemStream: TMemoryStream; +begin + AFiler := TcxConverterFiler.CreateFor(Source); + try + if AFiler.HasData then + begin + AMemStream := TMemoryStream.Create; + try + begin + AFiler.WriteDataProc(AMemStream); + AMemStream.Position := 0; + AFiler.CreateTreeListNodes(AMemStream, Destination); + end; + finally + AMemStream.Free; + end; + end; + finally + AFiler.Free; + end; +end; + +procedure TcxDXTLConverter.AssignDXOptions; +var + AList: TStringList; + I: Integer; +begin + AList := TStringList.Create; + try + EnablePropertyException; + try + GetSetProperty(nil, 'Options', AList); + AList.Sort; + with Destination do + begin + OptionsCustomizing.ColumnHorzSizing := AList.Find('aoColumnSizing', I); + OptionsCustomizing.ColumnMoving := AList.Find('aoColumnMoving', I); + OptionsData.Editing := AList.Find('aoEditing', I); + OptionsBehavior.GoToNextCellOnTab := AList.Find('aoTabThrough', I); + OptionsSelection.CellSelect := not AList.Find('aoRowSelect', I); + OptionsSelection.MultiSelect := AList.Find('aoMultiSelect', I); + OptionsBehavior.ImmediateEditor := AList.Find('aoImmediateEditor', I); + Preview.Visible := AList.Find('aoPreview', I); + OptionsView.CellEndEllipsis := AList.Find('aoDrawEndEllipsis', I); + OptionsView.ColumnAutoWidth := AList.Find('aoAutoWidth', I); + OptionsCustomizing.BandCustomizing := AList.Find('aoExtCustomizing', I); + OptionsCustomizing.ColumnCustomizing := OptionsCustomizing.BandCustomizing; + OptionsBehavior.Sorting := AList.Find('aoAutoSort', I); + end; + except + on EcxUnknownProperty do; + end; + finally + AList.Free; + DisablePropertyException; + end; +end; + +procedure TcxDXTLConverter.AssignDXOptionsEx; +var + AList: TStringList; + I: Integer; +begin + AList := TStringList.Create; + try + EnablePropertyException; + try + GetSetProperty(nil, 'OptionsEx', AList); + AList.Sort; + with Destination do + begin + OptionsSelection.InvertSelect := AList.Find('aoInvertSelect', I); + OptionsCustomizing.BandHorzSizing := AList.Find('aoBandSizing', I); + OptionsCustomizing.BandVertSizing := AList.Find('aoBandPanelSizing', I); + OptionsCustomizing.BandMoving := AList.Find('aoBandMoving', I); + OptionsBehavior.GoToNextCellOnEnter := AList.Find('aoEnterThrough', I); + OptionsBehavior.DragExpand := AList.Find('aoDragExpand', I); + OptionsBehavior.DragCollapse := AList.Find('aoDragCollapse', I); + OptionsView.CellAutoHeight := AList.Find('aoRowAutoHeight', I); + OptionsBehavior.ShowHourGlass := AList.Find('aoShowHourGlass', I); + OptionsCustomizing.ColumnVertSizing := AList.Find('aoHeaderPanelSizing', I); + OptionsBehavior.MultiSort := AList.Find('aoMultiSort', I); + OptionsView.ShowEditButtons := ConvertShowEditButtons(AList.Find('aoShowButtonAlways', I)); + OptionsBehavior.IncSearch := AList.Find('aoAutoSearch', I); + Preview.AutoHeight := AList.Find('aoAutoCalcPreviewLines', I); + BufferedPaint := AList.Find('aoUseBitmap', I); + end; + except + on EcxUnknownProperty do; + end; + finally + AList.Free; + DisablePropertyException; + end; +end; + +function TcxDXTLConverter.GetDestination: TcxTreeList; +begin + Result := inherited Destination as TcxTreeList; +end; + +{ TcxDXDBTLConverter } + +class function TcxDXDBTLConverter.GetSourceClassName: string; +begin + Result := 'TdxDBTreeList'; +end; + +procedure TcxDXDBTLConverter.AssignColumn(AcxColumn: TcxTreeListColumn; AdxColumn: TObject; AIndex: Integer); +begin + if AcxColumn is TcxDBTreeListColumn then + with TcxDBTreeListColumn(AcxColumn) do + DataBinding.FieldName := GetStringProperty(AdxColumn, 'FieldName'); + inherited AssignColumn(AcxColumn, AdxColumn, AIndex); + ImportColumnSummary(AcxColumn, AdxColumn); +end; + +procedure TcxDXDBTLConverter.AssignTreeListOptions; +begin + AssignDXOptionsBehavior; + AssignDXOptionsCustomize; + AssignDXOptionsDB; + AssignDXOptionsView; +end; + +function TcxDXDBTLConverter.CreateColumn: TcxTreeListColumn; +begin + Result := Destination.CreateColumn; +end; + +procedure TcxDXDBTLConverter.DoImportStyles; +var + AColor: Integer; + AFont: TFont; + AStyle: TcxCustomStyle; +begin + inherited DoImportStyles; + AColor := GetIntegerProperty(nil, 'HeaderColor'); + AFont := GetClassProperty(nil, 'Font') as TFont; + if (AColor <> clBtnFace) or not DefaultFont(AFont) then + begin + AStyle := CreateStyleItem; + (AStyle as TcxStyle).Color := AColor; + (AStyle as TcxStyle).Font.Assign(AFont); + (AStyle as TcxStyle).TextColor := (AStyle as TcxStyle).Font.Color; + Destination.Styles.Footer := AStyle as TcxStyle; + end; +end; + +procedure TcxDXDBTLConverter.DoRealImport; +begin + with Destination.DataController do + begin + DataSource := GetClassProperty(nil, 'DataSource') as TDataSource; + KeyField := GetStringProperty(nil, 'KeyField'); + ParentField := GetStringProperty(nil, 'ParentField'); + end; + inherited DoRealImport; +end; + +procedure TcxDXDBTLConverter.ImportColumn(AdxColumn: TObject; AcxColumn: TcxTreeListColumn); +begin + if AdxColumn.ClassName = 'TdxDBTreeListColumn' then + ImportPropertiesTextEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBTreeListMaskColumn' then + ImportPropertiesMaskEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBTreeListButtonColumn' then + ImportPropertiesButtonEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBTreeListDateColumn' then + ImportPropertiesDateEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBTreeListCheckColumn' then + ImportPropertiesCheckBox(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBTreeListImageColumn' then + ImportPropertiesImageComboBox(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBTreeListSpinColumn' then + ImportPropertiesSpinEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBTreeListLookupColumn' then + ImportPropertiesLookupComboBox(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBTreeListPickColumn' then + ImportPropertiesComboBox(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBTreeListCalcColumn' then + ImportPropertiesCalcEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBTreeListBlobColumn' then + ImportPropertiesBlobEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBTreeListHyperLinkColumn' then + ImportPropertiesHyperLinkEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBTreeListTimeColumn' then + ImportPropertiesTimeEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBTreeListCurrencyColumn' then + ImportPropertiesCurencyEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBTreeListMemoColumn' then + ImportPropertiesMemo(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBTreeListGraphicColumn' then + ImportPropertiesImage(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBTreeListMRUColumn' then + ImportPropertiesMRUEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBTreeListPopupColumn' then + ImportPropertiesPopupEdit(AdxColumn, AcxColumn) + else if AdxColumn.ClassName = 'TdxDBTreeListExtLookupColumn' then + ImportPropertiesExLookupComboBox(AdxColumn, AcxColumn); +end; + +procedure TcxDXDBTLConverter.ImportPreview; +var + APreviewFieldName: string; + I: Integer; +begin + APreviewFieldName := GetStringProperty(nil, 'PreviewFieldName'); + if APreviewFieldName <> '' then + begin + for I := 0 to Destination.ColumnCount do + if TestColumnFieldName(APreviewFieldName, I) then + begin + Destination.Preview.Column := Destination.Columns[I]; + Break; + end; + end; +end; + +procedure TcxDXDBTLConverter.AssignDXOptionsBehavior; +var + AList: TStringList; + I: Integer; +begin + AList := TStringList.Create; + try + EnablePropertyException; + try + GetSetProperty(nil, 'OptionsBehavior', AList); + AList.Sort; + with Destination do + begin + OptionsBehavior.IncSearch := AList.Find('etoAutoSearch', I); + OptionsBehavior.Sorting := AList.Find('etoAutoSort', I); + OptionsBehavior.DragCollapse := AList.Find('etoDragCollapse', I); + OptionsBehavior.DragExpand := AList.Find('etoDragExpand', I); + OptionsData.Editing := AList.Find('etoEditing', I); + OptionsBehavior.GoToNextCellOnEnter := AList.Find('etoEnterThrough', I); + OptionsBehavior.ImmediateEditor := AList.Find('etoImmediateEditor', I); + OptionsSelection.MultiSelect := AList.Find('etoMultiSelect', I); + OptionsBehavior.ShowHourGlass := AList.Find('etoShowHourGlass', I); + OptionsBehavior.GoToNextCellOnTab := AList.Find('etoTabThrough', I); + OptionsBehavior.AutoDragCopy := AList.Find('etoAutoDragDropCopy', I); + end; + except + on EcxUnknownProperty do; + end; + finally + AList.Free; + DisablePropertyException; + end; +end; + +procedure TcxDXDBTLConverter.AssignDXOptionsCustomize; +var + AList: TStringList; + I: Integer; +begin + AList := TStringList.Create; + try + EnablePropertyException; + try + GetSetProperty(nil, 'OptionsCustomize', AList); + AList.Sort; + with Destination do + begin + OptionsCustomizing.BandMoving := AList.Find('etoBandMoving', I); + OptionsCustomizing.BandVertSizing := AList.Find('etoBandPanelSizing', I); + OptionsCustomizing.BandHorzSizing := AList.Find('etoBandSizing', I); + OptionsCustomizing.ColumnMoving := AList.Find('etoColumnMoving', I); + OptionsCustomizing.ColumnHorzSizing := AList.Find('etoColumnSizing', I); + OptionsCustomizing.BandCustomizing := AList.Find('etoExtCustomizing', I); + OptionsCustomizing.ColumnVertSizing := AList.Find('etoHeaderPanelSizing', I); + end; + except + on EcxUnknownProperty do; + end; + finally + AList.Free; + DisablePropertyException; + end; +end; + +procedure TcxDXDBTLConverter.AssignDXOptionsDB; +var + AList: TStringList; + I: Integer; +begin + AList := TStringList.Create; + try + EnablePropertyException; + try + GetSetProperty(nil, 'OptionsDB', AList); + AList.Sort; + with Destination do + begin + OptionsData.CancelOnExit := AList.Find('etoCancelOnExit', I); + OptionsData.Deleting := AList.Find('etoCanDelete', I); + OptionsData.Inserting := AList.Find('etoCanInsert', I); + OptionsBehavior.ConfirmDelete := AList.Find('etoConfirmDelete', I); + end; + except + on EcxUnknownProperty do; + end; + finally + AList.Free; + DisablePropertyException; + end; +end; + +procedure TcxDXDBTLConverter.AssignDXOptionsView; +var + AList: TStringList; + I: Integer; +begin + AList := TStringList.Create; + try + EnablePropertyException; + try + GetSetProperty(nil, 'OptionsView', AList); + AList.Sort; + with Destination do + begin + Preview.AutoHeight := AList.Find('etoAutoCalcPreviewLines', I); + OptionsView.ColumnAutoWidth := AList.Find('etoAutoWidth', I); + OptionsView.CellEndEllipsis := AList.Find('etoDrawEndEllipsis', I); + OptionsView.Indicator := AList.Find('etoIndicator', I); + OptionsSelection.InvertSelect := AList.Find('etoInvertSelect', I); + Preview.Visible := AList.Find('etoPreview', I); + OptionsView.CellAutoHeight := AList.Find('etoRowAutoHeight', I); + OptionsSelection.CellSelect := not AList.Find('etoRowSelect', I); + OptionsView.ShowEditButtons := ConvertShowEditButtons(AList.Find('etoShowButtonAlways', I)); + BufferedPaint := AList.Find('etoUseBitmap', I); + end; + except + on EcxUnknownProperty do; + end; + finally + AList.Free; + DisablePropertyException; + end; +end; + +function TcxDXDBTLConverter.ConvertFooterKind(AValue: string): TcxSummaryKind; +begin + if AValue = 'cstAvg' then + Result := skAverage + else if AValue = 'cstCount' then + Result := skCount + else if AValue = 'cstMax' then + Result := skMax + else if AValue = 'cstMin' then + Result := skMin + else if AValue = 'cstSum' then + Result := skSum + else + Result := skNone; +end; + +function TcxDXDBTLConverter.GetDestination: TcxDBTreeList; +begin + Result := inherited Destination as TcxDBTreeList; +end; + +procedure TcxDXDBTLConverter.ImportColumnSummary(AcxColumn: TcxTreeListColumn; AdxColumn: TObject); +begin + with (AcxColumn as TcxDBTreeListColumn).SummaryFooter do + begin + Kind := ConvertFooterKind(GetEnumProperty(AdxColumn, 'SummaryFooterType')); + if Kind <> skNone then + (AcxColumn as TcxDBTreeListColumn).Options.Footer := True; + FieldName := GetStringProperty(AdxColumn, 'SummaryFooterField'); + Format := GetStringProperty(AdxColumn, 'SummaryFooterFormat'); + end; +end; + +function TcxDXDBTLConverter.TestColumnFieldName(AFieldName: string; AIndex: Integer): Boolean; +begin + Result := Destination.Columns[AIndex].DataBinding.FieldName = AFieldName; +end; + +initialization + ConverterFactory(cxTLGroupConverterName).RegisterConverter('DX TreeList Converter', TcxDXTLConverter); + ConverterFactory(cxDBTLGroupConverterName).RegisterConverter('DX DBTreeList Converter', TcxDXDBTLConverter); + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Sources/cxExportTL4Link.pas b/official/x.35/ExpressQuantumTreeList 4/Sources/cxExportTL4Link.pas new file mode 100644 index 00000000..d029ca3c --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Sources/cxExportTL4Link.pas @@ -0,0 +1,1681 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumTreeList } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMTREELIST AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxExportTL4Link; + +{$I cxVer.inc} + +interface +uses + Windows, Graphics, cxGeometry, {$IFDEF DELPHI6} Variants, {$ENDIF} + cxEdit, cxCalendar, cxCurrencyEdit, cxSpinEdit, cxCalc, cxTimeEdit, cxDataUtils, + SysUtils, Classes, cxClasses, cxGraphics, cxStyles, cxInplaceContainer, + cxTL, cxExport, cxXLSExport, cxHtmlXmlTxtExport, cxTLStrs; + +procedure cxExportTL4ToHTML(const AFileName: string; ATreeList: TcxCustomTreeListControl; + AExpand: Boolean = True; ASaveAll: Boolean = True; const AFileExt: string = 'html'); +procedure cxExportTL4ToXML(const AFileName: string; ATreeList: TcxCustomTreeListControl; + AExpand: Boolean = True; ASaveAll: Boolean = True; const AFileExt: string = 'xml'); +procedure cxExportTL4ToExcel(const AFileName: string; ATreeList: TcxCustomTreeListControl; + AExpand: Boolean = True; ASaveAll: Boolean = True; AUseNativeFormat: Boolean = True; + const AFileExt: string = 'xls'); +procedure cxExportTL4ToText(const AFileName: string; ATreeList: TcxCustomTreeListControl; + AExpand: Boolean = True; ASaveAll: Boolean = True; const ASeparator: string = ''; + const ABeginString: string = ''; const AEndString: string = ''; + const AFileExt: string = 'txt'); +procedure cxExportTL4ToFile(AFileName: string; ATreeList: TcxCustomTreeListControl; + AExportType: Integer; AExpand, ASaveAll, AUseNativeFormat: Boolean; const ASeparators: array of string; + const AFileExt: string); + +implementation + +type + TcxBandAccess = class(TcxTreeListBand); + TcxBandViewInfoAccess = class(TcxTreeListBandViewInfo); + TcxColumnAccess = class(TcxTreeListColumn); + TcxNodeAccess = class(TcxTreeListNode); + TcxTreeListAccess = class(TcxCustomTreeListControl); + TcxViewInfoAccess = class(TcxTreeListViewInfo); + TcxStylesAccess = class(TcxTreeListStyles); + TcxPropertiesAccess = class(TcxCustomEditProperties); + + { TcxTreeListNodeItarationHandler } + + TcxTreeListNodeItarationHandler = procedure(ANode: TcxTreeListNode) of object; + + TcxTreeListExportHelper = class; + + TcxTreeListMapsInfo = class; + TcxTreeListMapsInfoClass = class of TcxTreeListMapsInfo; + + TcxMapInfoHelperList = class; + + TcxInfoItemClass = class of TcxInfoItem; + + { TcxInfoItem } + + TcxTreeListCellsMap = array of array of Integer; + + TcxInfoItem = class + private + function GetProvider: IcxExportProvider; + protected + function GridLines: Boolean; + procedure RegisterStyles; virtual; + property Provider: IcxExportProvider read GetProvider; + public + AbsolutePosition: TRect; + Data: TObject; + Owner: TcxMapInfoHelperList; + Position: TRect; + constructor Create(AOwner: TcxMapInfoHelperList); virtual; + end; + + { TcxMapInfoHelperList } + + TcxMapInfoHelperList = class + private + FOwner: TObject; + function GetItem(Index: Integer): TcxInfoItem; + function GetDimension: TSize; + protected + CellsMap: TcxTreeListCellsMap; + HorzList: TList; + ItemCapacity: Integer; + ItemCount: Integer; + ItemsList: PPointerList; + VertList: TList; + procedure CalculateCellsMap; + procedure Clear; virtual; + function CreateList(const AItems: array of Pointer; ACapacity: Integer = -1): TList; + function GetOwner: TObject; virtual; + function GetProvider: IcxExportProvider; virtual; + function GridLines: Boolean; virtual; + function UseItemForFillMap(AItem: TcxInfoItem): Boolean; virtual; + property Count: Integer read ItemCount; + property Items[Index: Integer]: TcxInfoItem read GetItem; + public + constructor Create(AOwner: TObject; AItemsCount: Integer); virtual; + destructor Destroy; override; + function AddItem(const AbsolutePosition: TRect; + Data: TObject; AItemClass: TcxInfoItemClass): TcxInfoItem; + procedure Calculate; virtual; + property Dimension: TSize read GetDimension; + end; + + { TcxTreeListMapInfoList } + + TcxIndentInfoItem = class(TcxInfoItem) + private + function GetLevel: Integer; + public + property Level: Integer read GetLevel; + end; + + { TcxBandInfoItem } + + TcxBandInfoItem = class(TcxInfoItem) + private + function GetBand: TcxBandAccess; + function GetBands: Boolean; + function GetHeaderText: string; + function GetTreeList: TcxTreeListAccess; + protected + procedure RegisterStyles; override; + public + CaptionStyleIndex: Integer; + HeaderStyleIndex: Integer; + property Band: TcxBandAccess read GetBand; + property Bands: Boolean read GetBands; + property HeaderText: string read GetHeaderText; + property TreeList: TcxTreeListAccess read GetTreeList; + end; + + { TcxColumnInfoItem } + + TcxColumnInfoItem = class(TcxInfoItem) + private + function GetColumn: TcxColumnAccess; + function GetFooter: Boolean; + function GetFooterText: string; + function GetHeader: Boolean; + function GetHeaderText: string; + function GetTreeList: TcxTreeListAccess; + protected + procedure RegisterStyles; override; + public + HeaderStyleIndex: Integer; + FooterStyleIndex: Integer; + property Column: TcxColumnAccess read GetColumn; + property Footer: Boolean read GetFooter; + property FooterText: string read GetFooterText; + property Header: Boolean read GetHeader; + property HeaderText: string read GetHeaderText; + property TreeList: TcxTreeListAccess read GetTreeList; + end; + + { TcxTreeListMapInfoList } + + TcxTreeListMapInfoList = class(TcxMapInfoHelperList) + private + FBandsList: TList; + FColumnsList: TList; + FIndentsList: TList; + function GetBandCount: Integer; + function GetBandInfo(Index: Integer): TcxBandInfoItem; + function GetColumnCount: Integer; + function GetColumnInfo(Index: Integer): TcxColumnInfoItem; + function GetIndentCount: Integer; + function GetIndentInfo(Index: Integer): TcxIndentInfoItem; + function GetInfoOwner: TcxTreeListMapsInfo; + protected + function UseItemForFillMap(AItem: TcxInfoItem): Boolean; override; + function GetProvider: IcxExportProvider; override; + function GridLines: Boolean; override; + property Owner: TcxTreeListMapsInfo read GetInfoOwner; + public + constructor Create(AOwner: TObject; AItemsCount: Integer); override; + destructor Destroy; override; + procedure Calculate; override; + function CloneMap: TcxTreeListCellsMap; virtual; + property BandCount: Integer read GetBandCount; + property Bands[Index: Integer]: TcxBandInfoItem read GetBandInfo; + property ColumnCount: Integer read GetColumnCount; + property Columns[Index: Integer]: TcxColumnInfoItem read GetColumnInfo; + property IndentCount: Integer read GetIndentCount; + property Indents[Index: Integer]: TcxIndentInfoItem read GetIndentInfo; + end; + + { TcxPreviewInfo } + + TcxPreviewInfoItem = class + protected + Next: TcxPreviewInfoItem; + public + Alignment: TcxAlignText; + Node: TcxTreeListNode; + Level: Integer; + Value: Variant; + Height: Integer; + ViewParams: TcxViewParams; + constructor Create(var AFirst, ALast: TcxPreviewInfoItem); virtual; + procedure SetData(ANode: TcxTreeListNode; ALevel: Integer; AHeight: Integer; + const AValue: Variant; const AViewParams: TcxViewParams; AAlign: TcxAlignText); + end; + + { TcxTreeListMapInfo } + + TcxTreeListMapsInfo = class + private + FSize: TSize; + FMaxLevel: Integer; + FOwner: TcxTreeListExportHelper; + function GetBandLineHeight: Integer; + function GetBands: Boolean; + function GetFooter: Boolean; + function GetFooters(AColumn: TcxTreeListColumn): Boolean; + function GetGridLines: Boolean; + function GetHeaderLineHeight: Integer; + function GetHeaders: Boolean; + function GetNodeCellsCount: Integer; + function GetPreview: Boolean; + function GetPreviewAutoHeight: Boolean; + function GetProvider: IcxExportProvider; + function GetTreeList: TcxTreeListAccess; + function GetVertInc: Integer; + procedure AddColumnsFromBand(var AOfs: Integer; ABand: TcxTreeListBand); + protected + ConentCellsRowCount: Integer; + MultiEditRowCount: Integer; + TotalWidth: Integer; + PreviewList, + CurPreviewInfo, + PreviewListLast, + GroupList, + CurGroupInfo, + GroupListLast: TcxPreviewInfoItem; + Position: Integer; + HeaderInfoList: TcxTreeListMapInfoList; + HeaderMap: TcxTreeListCellsMap; + FooterMap: TcxTreeListCellsMap; + function AddGroupInfo: TcxPreviewInfoItem; + function AddPreviewInfo: TcxPreviewInfoItem; + procedure CalculateSize; + procedure CheckNodeBeforeCalculate(ANode: TcxTreeListNode); virtual; + procedure ClearList(AList: TcxPreviewInfoItem); + procedure CloneMaps; virtual; + function CountItems(AList: TcxPreviewInfoItem): Integer; + procedure CreateHeaderInfo; virtual; + procedure DoCalculate; virtual; + procedure DoWrite; virtual; + procedure DoWriteColumnWidths; virtual; + procedure DoWriteContent; virtual; + procedure DoWriteFooter; virtual; + procedure DoWriteHeader; virtual; + procedure DoWriteItem(const APosition: TRect; AStyleIndex: Integer; const AText: string); + procedure DoWriteNode(ANode: TcxTreeListNode); virtual; + procedure DoWriteNodeGroup(ANode: TcxTreeListNode; AInfo: TcxPreviewInfoItem); + procedure DoWriteNodeIndents(ANode: TcxTreeListNode; AStartPos: Integer); virtual; + procedure DoWriteNodeMultiEdit(ANode: TcxTreeListNode); virtual; + procedure DoWriteNodePreview(ANode: TcxTreeListNode; AInfo: TcxPreviewInfoItem); + procedure DoWritePreviewInfo(AInfo: TcxPreviewInfoItem); virtual; + procedure DoWriteRect(ARect: TRect; + const AParams: TcxViewParams; ABorders: TcxBorders = cxBordersAll); + procedure DoWriteUnionRect(const ARect: TRect; const AParams: TcxViewParams; + Align: TcxAlignText; ABorders: TcxBorders = cxBordersAll); + function GetDisplayText(AIndex: Integer; ANode: TcxTreeListNode; AProperties: TcxCustomEditProperties): string; + function GetDisplayValue(AIndex: Integer; ANode: TcxTreeListNode; AProperties: TcxCustomEditProperties): Variant; + function GetIndentStyle(AColor: TColor; ABorders: TcxBorders): TcxCacheCellStyle; + function GetNodeItemDisplayValue(ANode: TcxTreeListNode; AColumn: TcxTreeListColumn; var Align: TcxAlignText): Variant; + function IsGroupNode(ANode: TcxTreeListNode; var AInfo: TcxPreviewInfoItem): Boolean; + function IsHasPreview(ANode: TcxTreeListNode; var AInfo: TcxPreviewInfoItem): Boolean; + function IsNativeFormatProperties(AProperties: TcxCustomEditProperties): Boolean; + procedure ValidateMaps; virtual; + property BandLineHeight: Integer read GetBandLineHeight; + property Bands: Boolean read GetBands; + property HeaderLineHeight: Integer read GetHeaderLineHeight; + property Headers: Boolean read GetHeaders; + property GridLines: Boolean read GetGridLines; + property Footer: Boolean read GetFooter; + property Footers[AColumn: TcxTreeListColumn]: Boolean read GetFooters; + property NodeCellsCount: Integer read GetNodeCellsCount; + property Owner: TcxTreeListExportHelper read FOwner; + property Preview: Boolean read GetPreview; + property PreviewAutoHeight: Boolean read GetPreviewAutoHeight; + property Provider: IcxExportProvider read GetProvider; + property Size: TSize read FSize; + property VertInc: Integer read GetVertInc; + public + constructor Create(AOwner: TcxTreeListExportHelper); virtual; + destructor Destroy; override; + property MaxLevel: Integer read FMaxLevel; + property TreeList: TcxTreeListAccess read GetTreeList; + end; + + { TcxTreeListExportHelper } + + TcxTreeListExportHelper = class + private + FProvider: IcxExportProvider; + FExpand: Boolean; + FExportSelection: Boolean; + FIsNativeFormat: Boolean; + FSelectionList: TList; + FTreeList: TcxTreeListAccess; + function AddToSelection(ANode: TcxTreeListNode): Boolean; + procedure CreateSelectionList; + procedure SetExportSelection(Value: Boolean); + protected + MapsInfo: TcxTreeListMapsInfo; + procedure CallIterationProc(ANode: TcxTreeListNode; + AIndex: Integer; AProc: TcxTreeListNodeItarationHandler); virtual; + procedure DoCalculateTableMap; virtual; + procedure DoWriteCells; virtual; + procedure DoIterate(AProc: TcxTreeListNodeItarationHandler); + procedure DoIterateAllNodes(AProc: TcxTreeListNodeItarationHandler); virtual; + procedure DoIterateSelectionNodes(AProc: TcxTreeListNodeItarationHandler); virtual; + function GetMapsInfoClass: TcxTreeListMapsInfoClass; virtual; + public + constructor Create(ATreeList: TcxCustomTreeListControl; + AExportType: Integer; const AFileName: string); virtual; + destructor Destroy; override; + property Expand: Boolean read FExpand write FExpand; + property ExportSelection: Boolean read FExportSelection write SetExportSelection; + property IsNativeFormat: Boolean read FIsNativeFormat; + property Provider: IcxExportProvider read FProvider; + property TreeList: TcxTreeListAccess read FTreeList; + end; + +const + cxInvalidIndex = -1; + cxIndentFontName = 'Tahoma'; + cxCellBorders: array[Boolean] of TcxBorders = ([], cxBordersAll); + cxIndentStyle: TcxCacheCellStyle = + ( AlignText: catCenter; + FontStyle: []; + FontColor: 0; + FontSize: 12; + FontCharset: 0; + BrushStyle: cbsSolid); + +// todo: need move to cxExport for Delphi 4 + AlignToCxAlign: array[TAlignment] of TcxAlignText = + (catLeft, catRight, catCenter); + cxUsedBorder: TcxCellBorders = (IsDefault: False; Width: 1); + cxEmptyBorder: TcxCellBorders = (IsDefault: True; Width: 0); + +// todo: need move to cxInplaceContainer for Delphi 4 +function Supports(const Instance: IUnknown; const IID: TGUID; out Intf): Boolean; overload; +begin + Result := (Instance <> nil) and (Instance.QueryInterface(IID, Intf) = 0); +end; + +function cxNodesCompare(AItem1, AItem2: Pointer): Integer; +begin + Result := TcxTreeListNode(AItem1).AbsoluteIndex - + TcxTreeListNode(AItem2).AbsoluteIndex; +end; + +function cxCompareCoordinates(AItem1, AItem2: Pointer): Integer; +begin + Result := Integer(AItem1) - Integer(AItem2); +end; + +function cxGetCellBorders(ACol, ARow: Integer; const Bounds: TRect): TcxBorders; +begin + Result := []; + if ACol = Bounds.Left then Include(Result, bLeft); + if ARow = Bounds.Top then Include(Result, bTop); + if ACol = Bounds.Right then Include(Result, bRight); + if ARow = Bounds.Bottom then Include(Result, bBottom); +end; + +function cxCheckBorder(var ABorder: TcxCellBorders; NeedSet: Boolean; Color: Integer): Boolean; +begin + Result := NeedSet; + if NeedSet then + begin + ABorder := cxUsedBorder; + ABorder.Color := Color; + end + else + ABorder := cxEmptyBorder; +end; + +function cxSetStyleBorders(const AStyle: TcxCacheCellStyle; ACol, ARow: Integer; + const ABounds: TRect; const AColor: Integer; HasBorders: TcxBorders = cxBordersAll): TcxCacheCellStyle; +begin + Result := AStyle; + with Result, ABounds do + begin + cxCheckBorder(Borders[0], (ACol = Left) and (bLeft in HasBorders), AColor); + cxCheckBorder(Borders[1], (ARow = Top) and (bTop in HasBorders), AColor); + cxCheckBorder(Borders[2], (ACol = Right) and (bRight in HasBorders), AColor); + cxCheckBorder(Borders[3], (ARow = Bottom) and (bBottom in HasBorders), AColor); + end; +end; + +procedure cxViewParamsToCacheStyle( + AViewParams: TcxViewParams; var ACacheStyle: TcxCacheCellStyle); +begin + ACacheStyle := DefaultCellStyle; + with ACacheStyle do + begin + StrPCopy(FontName, AViewParams.Font.Name); + FontStyle := TcxFontStyles(AViewParams.Font.Style); + FontColor := ColorToRgb(AViewParams.TextColor); + FontSize := AViewParams.Font.Size; + FontCharset := AViewParams.Font.Charset; + BrushStyle := cbsSolid; + BrushBkColor := ColorToRgb(AViewParams.Color); + BrushFgColor := BrushBkColor; + end; +end; + +function cxRegisterViewParams(AViewParams: TcxViewParams; + Align: TcxAlignText; Provider: IcxExportProvider): Integer; overload; +var + AStyle: TcxCacheCellStyle; +begin + cxViewParamsToCacheStyle(AViewParams, AStyle); + AStyle.AlignText := Align; + Result := Provider.RegisterStyle(AStyle) +end; + +function cxRegisterViewParams(AViewParams: TcxViewParams; Align: TcxAlignText; + Provider: IcxExportProvider; ABorders: TcxBorders): Integer; overload; +var + I: Integer; + AStyle: TcxCacheCellStyle; +begin + cxViewParamsToCacheStyle(AViewParams, AStyle); + AStyle.AlignText := Align; + for I := 0 to 3 do + cxCheckBorder(AStyle.Borders[I], TcxBorder(I) in ABorders, cxBtnShadowColor); + Result := Provider.RegisterStyle(AStyle) +end; + +function cxCheckBorders(ACol, ARow: Integer; + const ARect: TRect; ABorders: TcxBorders): TcxBorders; +begin + Result := []; + with ARect do + begin + if (ACol = Left) and (bLeft in ABorders) then Include(Result, bLeft); + if (ARow = Top) and (bTop in ABorders) then Include(Result, bTop); + if (ACol = Right) and (bRight in ABorders) then Include(Result, bRight); + if (ARow = Bottom) and (bBottom in ABorders) then Include(Result, bBottom); + end; +end; + +function cxRegisterStyleHeader(AViewInfo: TcxtreeListViewInfoItem; + AlignHorz: TAlignment; Provider: IcxExportProvider; ABorders: TcxBorders): Integer; +var + AStyle: TcxCacheCellStyle; +begin + cxViewParamsToCacheStyle(AViewInfo.ViewParams, AStyle); + if ABorders <> [] then + AStyle := cxSetStyleBorders(AStyle, 0, 0, cxNullRect, cxBtnShadowColor, ABorders); + AStyle.AlignText := AlignToCxAlign[AlignHorz]; + Result := Provider.RegisterStyle(AStyle); +end; + +procedure cxFillMapItem(AMap: TcxTreeListCellsMap; AInfo: TcxInfoItem; + ACheckValue: Boolean = False); +var + I, J: Integer; +begin + with AInfo.Position do + begin + for I := Left to Right - 1 do + for J := Top to Bottom - 1 do + if (AMap[I, J] = 0) or not ACheckValue then AMap[I, J] := Integer(AInfo); + end; +end; + +function cxCreateMap(const ASize: TSize): TcxTreeListCellsMap; +begin + SetLength(Result, ASize.cx, ASize.cy); +end; + +{ TcxInfoItem } + +constructor TcxInfoItem.Create(AOwner: TcxMapInfoHelperList); +begin + Owner := AOwner; +end; + +function TcxInfoItem.GridLines: Boolean; +begin + Result := Owner.GridLines; +end; + +procedure TcxInfoItem.RegisterStyles; +begin +end; + +function TcxInfoItem.GetProvider: IcxExportProvider; +begin + Result := Owner.GetProvider; +end; + +{ TcxMapInfoHelperList } + +constructor TcxMapInfoHelperList.Create(AOwner: TObject; AItemsCount: Integer); +begin + FOwner := AOwner; + HorzList := CreateList([nil], AItemsCount + 1); + VertList := CreateList([nil], AItemsCount + 1); + ItemCapacity := AItemsCount; + ItemsList := AllocMem(ItemCapacity * SizeOf(Pointer)); +end; + +destructor TcxMapInfoHelperList.Destroy; +begin + try + FreeAndNil(HorzList); + FreeAndNil(VertList); + Clear; + finally + inherited Destroy; + end; +end; + +function TcxMapInfoHelperList.AddItem(const AbsolutePosition: TRect; + Data: TObject; AItemClass: TcxInfoItemClass): TcxInfoItem; +begin + Result := AItemClass.Create(Self); + Result.AbsolutePosition := AbsolutePosition; + Result.Data := Data; + ItemsList^[ItemCount] := Result; + Inc(ItemCount); + with AbsolutePosition do + begin + if HorzList.IndexOf(Pointer(Right)) = cxInvalidIndex then + HorzList.Add(Pointer(Right)); + if VertList.IndexOf(Pointer(Bottom)) = cxInvalidIndex then + VertList.Add(Pointer(Bottom)); + end; +end; + +procedure TcxMapInfoHelperList.Calculate; +var + I: Integer; + + function RealPosFromAbsPos(X1, Y1, X2, Y2: Integer): TRect; + begin + Result.Left := HorzList.IndexOf(Pointer(X1)); + Result.Top := VertList.IndexOf(Pointer(Y1)); + Result.Right := HorzList.IndexOf(Pointer(X2)); + Result.Bottom := VertList.IndexOf(Pointer(Y2)); + end; + +begin + HorzList.Sort(cxCompareCoordinates); + VertList.Sort(cxCompareCoordinates); + for I := 0 to ItemCount - 1 do + with TcxInfoItem(ItemsList^[I]), AbsolutePosition do + Position := RealPosFromAbsPos(Left, Top, Right, Bottom); + CalculateCellsMap; +end; + +procedure TcxMapInfoHelperList.Clear; +var + I: Integer; +begin + try + for I := 0 to ItemCount - 1 do + FreeAndNil(TcxInfoItem(ItemsList^[I])); + FreeMem(ItemsList); + finally + ItemCount := 0; + ItemsList := nil; + end; +end; + +procedure TcxMapInfoHelperList.CalculateCellsMap; +var + I: Integer; +begin + CellsMap := cxCreateMap(Dimension); + for I := 0 to Count - 1 do + if UseItemForFillMap(Items[I]) then cxFillMapItem(CellsMap, Items[I]); +end; + +function TcxMapInfoHelperList.CreateList( + const AItems: array of Pointer; ACapacity: Integer = -1): TList; +var + I: Integer; +begin + Result := TList.Create; + if ACapacity <> cxInvalidIndex then + Result.Capacity := ACapacity; + if Length(AItems) <> 0 then + for I := Low(AItems) to High(AItems) do Result.Add(AItems[I]); +end; + +function TcxMapInfoHelperList.GetOwner: TObject; +begin + Result := FOwner; +end; + +function TcxMapInfoHelperList.GetProvider: IcxExportProvider; +begin + Result := nil; +end; + +function TcxMapInfoHelperList.GridLines: Boolean; +begin + Result := False; +end; + +function TcxMapInfoHelperList.UseItemForFillMap(AItem: TcxInfoItem): Boolean; +begin + Result := True; +end; + +function TcxMapInfoHelperList.GetItem(Index: Integer): TcxInfoItem; +begin + Result := TcxInfoItem(ItemsList^[Index]) +end; + +function TcxMapInfoHelperList.GetDimension: TSize; +begin + Result.cx := HorzList.Count - 1; + Result.cy := VertList.Count - 1; +end; + +{ TcxTreeListMapInfoList } + +function TcxIndentInfoItem.GetLevel: Integer; +begin + Result := Integer(Data); +end; + +{ TcxBandInfoItem } + +procedure TcxBandInfoItem.RegisterStyles; +begin + with Band, TcxBandViewInfoAccess(ViewInfo) do + begin + if Self.Bands then + CaptionStyleIndex := cxRegisterStyleHeader(BandHeader, Caption.AlignHorz, + Provider, cxCellBorders[Self.GridLines]); + if Self.TreeList.OptionsView.Headers and not IsOpaque then + HeaderStyleIndex := cxRegisterViewParams(ContainerViewParams, catLeft, Provider); + end; +end; + +function TcxBandInfoItem.GetBand: TcxBandAccess; +begin + Result := TcxBandAccess(Data) +end; + +function TcxBandInfoItem.GetBands: Boolean; +begin + Result := TreeList.OptionsView.Bands; +end; + +function TcxBandInfoItem.GetHeaderText: string; +begin + Result := Band.ViewInfo.BandHeader.Text; +end; + +function TcxBandInfoItem.GetTreeList: TcxTreeListAccess; +begin + Result := TcxTreeListAccess(Band.TreeList); +end; + +{ TcxColumnInfoItem } + +procedure TcxColumnInfoItem.RegisterStyles; +begin + with Column, ViewInfo do + begin + if Self.Header then + HeaderStyleIndex := cxRegisterStyleHeader(ColumnHeader, Caption.AlignHorz, + Provider, cxCellBorders[GridLines]); + if Self.Footer then + FooterStyleIndex := cxRegisterStyleHeader(ColumnFooter, + SummaryFooter.AlignHorz, Provider, cxCellBorders[GridLines]); + end; +end; + +function TcxColumnInfoItem.GetColumn: TcxColumnAccess; +begin + Result := TcxColumnAccess(Data); +end; + +function TcxColumnInfoItem.GetFooter: Boolean; +begin + Result := TreeList.OptionsView.Footer and Column.Options.Footer; +end; + +function TcxColumnInfoItem.GetFooterText: string; +begin + Result := Column.ViewInfo.ColumnFooter.Text; +end; + +function TcxColumnInfoItem.GetHeader: Boolean; +begin + Result := TreeList.OptionsView.Headers; +end; + +function TcxColumnInfoItem.GetHeaderText: string; +begin + Result := Column.ViewInfo.ColumnHeader.Text; +end; + +function TcxColumnInfoItem.GetTreeList: TcxTreeListAccess; +begin + Result := TcxTreeListAccess(Column.TreeList); +end; + +{ TcxTreeListMapInfoList } + +constructor TcxTreeListMapInfoList.Create(AOwner: TObject; AItemsCount: Integer); +begin + inherited Create(AOwner, AItemsCount); + FBandsList := TList.Create; + FColumnsList := TList.Create; + FIndentsList := TList.Create; +end; + +destructor TcxTreeListMapInfoList.Destroy; +begin + FBandsList.Free; + FColumnsList.Free; + FIndentsList.Free; + inherited Destroy; +end; + +procedure TcxTreeListMapInfoList.Calculate; +var + I: Integer; +begin + inherited Calculate; + for I := 0 to ItemCount - 1 do + begin + if TObject(ItemsList^[I]) is TcxIndentInfoItem then + FIndentsList.Add(ItemsList^[I]) + else + if TObject(ItemsList^[I]) is TcxColumnInfoItem then + FColumnsList.Add(ItemsList^[I]) + else + if TObject(ItemsList^[I]) is TcxBandInfoItem then + FBandsList.Add(ItemsList^[I]) + end; +end; + +function TcxTreeListMapInfoList.CloneMap: TcxTreeListCellsMap; +var + I: Integer; +begin + Result := cxCreateMap(Dimension); + with Dimension do + begin + for I := 0 to cx - 1 do + Move(CellsMap[I, 0], Result[I, 0], cy * SizeOf(Integer)); + end; +end; + +function TcxTreeListMapInfoList.UseItemForFillMap(AItem: TcxInfoItem): Boolean; +begin + Result := not (AItem is TcxIndentInfoItem); +end; + +function TcxTreeListMapInfoList.GetProvider: IcxExportProvider; +begin + Result := Owner.Owner.FProvider; +end; + +function TcxTreeListMapInfoList.GridLines: Boolean; +begin + Result := Owner.GetGridLines; +end; + +function TcxTreeListMapInfoList.GetBandCount: Integer; +begin + Result := FBandsList.Count; +end; + +function TcxTreeListMapInfoList.GetBandInfo(Index: Integer): TcxBandInfoItem; +begin + Result := TcxBandInfoItem(FBandsList.List^[Index]); +end; + +function TcxTreeListMapInfoList.GetColumnCount: Integer; +begin + Result := FColumnsList.Count; +end; + +function TcxTreeListMapInfoList.GetColumnInfo(Index: Integer): TcxColumnInfoItem; +begin + Result := TcxColumnInfoItem(FColumnsList.List^[Index]); +end; + +function TcxTreeListMapInfoList.GetIndentCount: Integer; +begin + Result := FIndentsList.Count; +end; + +function TcxTreeListMapInfoList.GetIndentInfo(Index: Integer): TcxIndentInfoItem; +begin + Result := TcxIndentInfoItem(FIndentsList.List^[Index]); +end; + +function TcxTreeListMapInfoList.GetInfoOwner: TcxTreeListMapsInfo; +begin + Result := TcxTreeListMapsInfo(GetOwner); +end; + +{ TcxPreviewInfoItem } + +constructor TcxPreviewInfoItem.Create(var AFirst, ALast: TcxPreviewInfoItem); +begin + if AFirst = nil then + AFirst := Self + else + ALast.Next := Self; + ALast := Self; +end; + +procedure TcxPreviewInfoItem.SetData( + ANode: TcxTreeListNode; ALevel: Integer; AHeight: Integer; + const AValue: Variant; const AViewParams: TcxViewParams; AAlign: TcxAlignText); +begin + Alignment := AAlign; + Node := ANode; + Level := ALevel; + Value := AValue; + Height := AHeight; + ViewParams := AViewParams; +end; + +{ TcxTreeListMapInfo } + +constructor TcxTreeListMapsInfo.Create(AOwner: TcxTreeListExportHelper); +begin + FOwner := AOwner; + FMaxLevel := 0; +end; + +destructor TcxTreeListMapsInfo.Destroy; +begin + ClearList(GroupList); + ClearList(PreviewList); + HeaderInfoList.Free; + inherited Destroy; +end; + +function TcxTreeListMapsInfo.AddGroupInfo: TcxPreviewInfoItem; +begin + Result := TcxPreviewInfoItem.Create(GroupList, GroupListLast) +end; + +function TcxTreeListMapsInfo.AddPreviewInfo: TcxPreviewInfoItem; +begin + Result := TcxPreviewInfoItem.Create(PreviewList, PreviewListLast); +end; + +procedure TcxTreeListMapsInfo.CalculateSize; +begin + with HeaderInfoList.Dimension do + begin + FSize.cx := cx; + FSize.cy := (cy - 1) * (Byte(Footer) + Byte(Headers) + MultiEditRowCount); + if Bands then Inc(FSize.cy); + end; + Inc(FSize.cy, ConentCellsRowCount); +end; + +procedure TcxTreeListMapsInfo.CheckNodeBeforeCalculate(ANode: TcxTreeListNode); +var + AAlign: TcxAlignText; + AHeight, H, ALevel: Integer; + AColumn: TcxColumnAccess; + AValue: Variant; + AViewParams: TcxViewParams; + + function CheckNodePreview: Boolean; + begin + Result := False; + if Preview then + begin + AColumn := TcxColumnAccess(TreeList.Preview.Column); + AValue := GetNodeItemDisplayValue(ANode, AColumn, AAlign); + if PreviewAutoHeight and (AValue = '') then Exit; + AViewParams := TreeList.Styles.GetPreviewParams(ANode); + AHeight := TcxViewInfoAccess(TreeList.ViewInfo).PreviewHeight; + if PreviewAutoHeight then + begin + H := TotalWidth - TreeList.GetLevelIndentsWidth(ALevel, False, ANode); + H := H - (TreeList.Preview.LeftIndent + TreeList.Preview.RightIndent); + if H < 0 then H := 0; + H := TcxColumnAccess(AColumn).GetCellHeight(ANode, H, + TreeList.Preview.MaxLineCount, AViewParams.Font, AValue) + end + else + H := AHeight; + if Assigned(TreeList.OnGetNodePreviewHeight) then + TreeList.OnGetNodePreviewHeight(TreeList, ANode, AValue, H); + with TreeList.Preview do + if (H > AHeight * MaxLineCount) or (MaxLineCount = 0) then + AHeight := AHeight * MaxLineCount; + if AHeight > 0 then + begin + Inc(AHeight, VertInc); + AddPreviewInfo.SetData(ANode, ALevel + Byte(TreeList.OptionsView.ShowRoot), + AHeight, AValue, AViewParams, AAlign); + Result := True; + end; + end; + end; + + function CheckGroupNode: Boolean; + var + AAlign: TcxAlignText; + begin + Result := TreeList.DoIsGroupNode(ANode); + if not Result then Exit; + with TreeList do + begin + AColumn := TcxColumnAccess(OptionsView.GetCategorizedColumn); + TcxStylesAccess(Styles).DoGetContentParams(ANode, AColumn, AViewParams); + AValue := GetNodeItemDisplayValue(ANode, AColumn, AAlign); + AddGroupInfo.SetData(ANode, ALevel + Byte(TreeList.OptionsView.ShowRoot), + HeaderLineCount * ViewInfo.DefaultEditHeight + VertInc, AValue, AViewParams, AAlign); + end; + end; + +begin + ALevel := ANode.Level; + if ALevel > FMaxLevel then FMaxLevel := ALevel; + if CheckNodePreview then + Inc(ConentCellsRowCount); + if CheckGroupNode then + Inc(ConentCellsRowCount) + else + Inc(MultiEditRowCount); +end; + +procedure TcxTreeListMapsInfo.ClearList(AList: TcxPreviewInfoItem); +var + AItem: TcxPreviewInfoItem; +begin + while AList <> nil do + begin + AItem := AList; + AList := AList.Next; + AItem.Free; + end; +end; + +procedure TcxTreeListMapsInfo.CloneMaps; +begin + HeaderMap := HeaderInfoList.CloneMap; + if Footer then FooterMap := cxCreateMap(Size); + ValidateMaps; +end; + +function TcxTreeListMapsInfo.CountItems(AList: TcxPreviewInfoItem): Integer; +begin + Result := 0; + while (AList <> nil) and (AList.Node <> nil) do + begin + Inc(Result); + AList := AList.Next; + end; +end; + +procedure TcxTreeListMapsInfo.CreateHeaderInfo; +var + I, AOfs, IndentWidth: Integer; + + function GetIndentPosition(Index: Integer): TRect; + begin + Result := Rect(Index * IndentWidth, 1, + (Index + 1) * IndentWidth, 1 + TreeList.HeaderLineCount); + end; + +begin + AOfs := 0;; + IndentWidth := TreeList.LevelIndentWidth; + AOfs := 0;; + for I := 0 to MaxLevel - 1 do + HeaderInfoList.AddItem(GetIndentPosition(I), TObject(I), TcxIndentInfoItem); + for I := 0 to TreeList.VisibleBandCount - 1 do + AddColumnsFromBand(AOfs, TreeList.VisibleBands[I]); +end; + +procedure TcxTreeListMapsInfo.DoCalculate; +var + I: Integer; +begin + TotalWidth := 0; + for I := 0 to TreeList.VisibleBandCount - 1 do + with TreeList.VisibleBands[I] do + begin + Inc(TotalWidth, DisplayWidth); + if FixedKind <> tlbfNone then Inc(TotalWidth, 3); + end; + Owner.DoIterate(CheckNodeBeforeCalculate); + if HeaderInfoList <> nil then FreeAndNil(HeaderInfoList); + Inc(FMaxLevel, Byte(TreeList.OptionsView.ShowRoot)); + HeaderInfoList := TcxTreeListMapInfoList.Create(Self, + TreeList.VisibleColumnCount + FMaxLevel + TreeList.VisibleBandCount); + CreateHeaderInfo; + HeaderInfoList.Calculate; + CalculateSize; + CloneMaps; +end; + +procedure TcxTreeListMapsInfo.DoWrite; +begin + Provider.SetRange(Size.cx, Size.cy, False); + Position := 0; + DoWriteColumnWidths; + DoWriteHeader; + DoWriteContent; + DoWriteFooter; +end; + +procedure TcxTreeListMapsInfo.DoWriteColumnWidths; +var + AList: TList; + ALeft, ARight, I, J: Integer; +begin + AList := HeaderInfoList.HorzList; + ALeft := 0; + J := 0; + for I := 0 to AList.Count - 1 do + begin + ARight := Integer(AList.List^[I]); + if ARight = ALeft then + begin + Inc(J); + Continue; + end; + Provider.SetColumnWidth(I - J, ARight - ALeft); + ALeft := ARight; + end; +end; + +procedure TcxTreeListMapsInfo.DoWriteContent; +begin + Owner.DoIterate(DoWriteNode); +end; + +procedure TcxTreeListMapsInfo.DoWriteFooter; +var + I: Integer; +begin + if Footer then + begin + Dec(Position); + with HeaderInfoList.Dimension do + DoWriteRect(Rect(0, 1, cx, cy), TreeList.Styles.GetFooterParams); + for I := 0 to HeaderInfoList.ColumnCount - 1 do + with HeaderInfoList.Columns[I] do + if Footer then DoWriteItem(Position, FooterStyleIndex, FooterText); + end; +end; + +procedure TcxTreeListMapsInfo.DoWriteHeader; +var + I, J, DH: Integer; +begin + DH := 0; + if Bands then + begin + for I := 0 to HeaderInfoList.BandCount - 1 do + with HeaderInfoList.Bands[I] do + DoWriteItem(Position, CaptionStyleIndex, HeaderText); + end + else + begin + Dec(Position); + DH := 1; + end; + if Headers then + begin + for I := 0 to HeaderInfoList.ColumnCount - 1 do + with HeaderInfoList.Columns[I] do + DoWriteItem(Position, HeaderStyleIndex, HeaderText); + for I := 0 to HeaderInfoList.Dimension.cx - 1 do + for J := 0 to HeaderInfoList.Dimension.cy - 1 do + if HeaderInfoList.CellsMap[I, J] = 0 then + Provider.SetCellStyle(I, J - DH, TcxBandInfoItem(HeaderMap[I, J]).HeaderStyleIndex); + Inc(Position, HeaderInfoList.Dimension.cy - 1); + end; + Inc(Position, 1); +end; + +procedure TcxTreeListMapsInfo.DoWriteItem( + const APosition: TRect; AStyleIndex: Integer; const AText: string); +begin + with APosition do + begin + Provider.SetCellStyleEx(Left, Top + Position, + Bottom - Top, Right - Left, AStyleIndex); + if Length(AText) > 0 then + Provider.SetCellValue(Left, Top + Position, AText); + end; +end; + +procedure TcxTreeListMapsInfo.DoWriteNode(ANode: TcxTreeListNode); +var + AInfo: TcxPreviewInfoItem; + AStartPos: Integer; +begin + AStartPos := Position; + if Preview and (TreeList.Preview.Place = tlppTop) and IsHasPreview(ANode, AInfo) then + DoWriteNodePreview(ANode, AInfo); + if IsGroupNode(ANode, AInfo) then + DoWriteNodeGroup(ANode, AInfo) + else + DoWriteNodeMultiEdit(ANode); + if Preview and (TreeList.Preview.Place = tlppBottom) and IsHasPreview(ANode, AInfo) then + DoWriteNodePreview(ANode, AInfo); + DoWriteNodeIndents(ANode, AStartPos); +end; + +procedure TcxTreeListMapsInfo.DoWriteNodeGroup( + ANode: TcxTreeListNode; AInfo: TcxPreviewInfoItem); +begin + DoWritePreviewInfo(AInfo); +end; + +procedure TcxTreeListMapsInfo.DoWriteNodeIndents( + ANode: TcxTreeListNode; AStartPos: Integer); +var + I, ALevel, AStyle: Integer; +const + ExpandText: array[Boolean] of Char = ('+', '-'); +begin + ALevel := ANode.Level - Byte(not TreeList.OptionsView.ShowRoot); + for I := 0 to ALevel do + begin + with TreeList.Styles.GetIndentParams(ANode, I) do + AStyle := Provider.RegisterStyle(GetIndentStyle(Color, cxCellBorders[GridLines])); + if (I = ALevel) and ANode.HasChildren then + Provider.SetCellDataString(I, AStartPos, ExpandText[ANode.Expanded]); + Provider.SetCellStyleEx(I, AStartPos, Position - AStartPos, 1, AStyle); + end; +end; + +procedure TcxTreeListMapsInfo.DoWriteNodeMultiEdit(ANode: TcxTreeListNode); +var + I, J: Integer; + AParams: TcxViewParams; + ALeft: Integer; + + procedure WriteCell(AInfo: TcxColumnInfoItem); + var + R: TRect; + AValue: Variant; + AAlign: TcxAlignText; + begin + R := cxRectOffset(AInfo.Position, 0, Position); + if R.Left = 0 then R.Left := ALeft; + TcxStylesAccess(TreeList.Styles).DoGetContentParams(ANode, AInfo.Column, AParams); + AValue := GetNodeItemDisplayValue(ANode, AInfo.Column, AAlign); + Provider.SetCellValue(R.Left, R.Top, AValue); + DoWriteUnionRect(R, AParams, AAlign, cxCellBorders[GridLines]); + end; + + procedure WriteUnusedSpace(I, J: Integer; ABand: TcxBandAccess); + begin + TcxStylesAccess(TreeList.Styles).DoGetBandContentParams(ANode, ABand, AParams); + Provider.SetCellStyle(I, J, cxRegisterViewParams(AParams, catLeft, Provider, [])); + end; + +begin + Dec(Position); + try + ALeft := ANode.Level + Byte(TreeList.OptionsView.ShowRoot); + for J := 1 to HeaderInfoList.Dimension.cy - 1 do + Provider.SetRowHeight(Position + J, TreeList.DefaultRowHeight); + for I := 0 to HeaderInfoList.Dimension.cx - 1 do + for J := 1 to HeaderInfoList.Dimension.cy - 1 do + if (I > ALeft) and (HeaderInfoList.CellsMap[I, J] = 0) then + WriteUnusedSpace(I, J + Position, TcxBandInfoItem(HeaderMap[I, J]).Band); + for I := 0 to HeaderInfoList.ColumnCount - 1 do + WriteCell(HeaderInfoList.Columns[I]); + finally + Inc(Position, NodeCellsCount + 1); + end; +end; + +procedure TcxTreeListMapsInfo.DoWritePreviewInfo(AInfo: TcxPreviewInfoItem); +var + R: TRect; +begin + with AInfo do + begin + with HeaderInfoList.Dimension do + R := Rect(Level, Position, cx, Position + 1); + Provider.SetCellValue(R.Left, R.Top, Value); + Provider.SetRowHeight(Position, Height); + DoWriteUnionRect(R, ViewParams, Alignment, cxCellBorders[GridLines]); + Inc(Position); + end; +end; + +procedure TcxTreeListMapsInfo.DoWriteNodePreview( + ANode: TcxTreeListNode; AInfo: TcxPreviewInfoItem); +begin + DoWritePreviewInfo(AInfo) +end; + +procedure TcxTreeListMapsInfo.DoWriteRect(ARect: TRect; + const AParams: TcxViewParams; ABorders: TcxBorders = cxBordersAll); +var + ACellBorders: TcxBorders; + AStyleIndex, AIndex, I, J: Integer; +begin + AStyleIndex := cxRegisterViewParams(AParams, catLeft, Provider, []); + OffsetRect(ARect, 0, Position); + for I := ARect.Left to ARect.Right - 1 do + for J := ARect.Top to ARect.Bottom - 1 do + begin + AIndex := AStyleIndex; + ACellBorders := cxCheckBorders(I, J, ARect, ABorders); + if ACellBorders <> [] then + AIndex := cxRegisterViewParams(AParams, catLeft, Provider, ACellBorders); + Provider.SetCellStyle(I, J, AIndex); + end; +end; + +procedure TcxTreeListMapsInfo.DoWriteUnionRect(const ARect: TRect; + const AParams: TcxViewParams; Align: TcxAlignText; ABorders: TcxBorders = cxBordersAll); +var + AStyle: Integer; +begin + AStyle := cxRegisterViewParams(AParams, Align, Provider, ABorders); + with ARect do + Provider.SetCellStyleEx(Left, Top, Bottom - Top, Right - Left, AStyle); +end; + +function TcxTreeListMapsInfo.GetDisplayText( + AIndex: Integer; ANode: TcxTreeListNode; AProperties: TcxCustomEditProperties): string; +begin + with AProperties do + begin + if GetEditValueSource(False) = evsValue then + Result := GetDisplayText(ANode.Values[AIndex], True) + else + Result := {GetDisplayText(}ANode.Texts[AIndex]{, True)}; + end; +end; + +function TcxTreeListMapsInfo.GetDisplayValue( + AIndex: Integer; ANode: TcxTreeListNode; AProperties: TcxCustomEditProperties): Variant; +begin + if IsNativeFormatProperties(AProperties) then + Result := ANode.Values[AIndex] + else + Result := AProperties.GetDisplayText(ANode.Values[AIndex], True);// GetDisplayText(AIndex, ANode, AProperties); +end; + +function TcxTreeListMapsInfo.GetIndentStyle( + AColor: TColor; ABorders: TcxBorders): TcxCacheCellStyle; +begin + Result := cxSetStyleBorders(cxIndentStyle, 0, 0, + cxNullRect, cxBtnShadowColor, ABorders); + with Result do + begin + BrushBkColor := cxColorToRGB(AColor); + BrushFGColor := BrushBkColor; + FontColor := cxColorToRGB(TreeList.OptionsView.TreeLineColor); + end; +end; + +function TcxTreeListMapsInfo.GetNodeItemDisplayValue( + ANode: TcxTreeListNode; AColumn: TcxTreeListColumn; var Align: TcxAlignText): Variant; +var + AProp: TcxCustomEditProperties; +begin + AProp := TcxColumnAccess(AColumn).DoGetEditProperties(ANode); + if Owner.IsNativeFormat then + Result := GetDisplayValue(AColumn.ItemIndex, ANode, AProp) + else + Result := GetDisplayText(AColumn.ItemIndex, ANode, AProp); + if VarIsNull(Result) then Result := ''; + ALign := AlignToCxAlign[TcxPropertiesAccess(AProp).Alignment.Horz]; +end; + +function TcxTreeListMapsInfo.IsGroupNode( + ANode: TcxTreeListNode; var AInfo: TcxPreviewInfoItem): Boolean; +begin + if CurGroupInfo = nil then + CurGroupInfo := GroupList; + Result := (CurGroupInfo <> nil) and (CurGroupInfo.Node = ANode); + if Result then + begin + AInfo := CurGroupInfo; + CurGroupInfo := CurGroupInfo.Next; + end; +end; + +function TcxTreeListMapsInfo.IsHasPreview( + ANode: TcxTreeListNode; var AInfo: TcxPreviewInfoItem): Boolean; +begin + if CurPreviewInfo = nil then + CurPreviewInfo := PreviewList; + Result := (CurPreviewInfo <> nil) and (CurPreviewInfo.Node = ANode); + if Result then + begin + AInfo := CurPreviewInfo; + CurPreviewInfo := CurPreviewInfo.Next; + end; +end; + +function TcxTreeListMapsInfo.IsNativeFormatProperties( + AProperties: TcxCustomEditProperties): Boolean; +begin + Result := (AProperties is TcxDateEditProperties) or (AProperties is TcxCurrencyEditProperties) or + (AProperties is TcxSpinEditProperties) or (AProperties is TcxCalcEditProperties) or + (AProperties is TcxTimeEditProperties); +end; + +procedure TcxTreeListMapsInfo.ValidateMaps; +var + I: Integer; + ABand: TcxBandInfoItem; +begin + with HeaderInfoList do + begin + for I := 0 to BandCount - 1 do + begin + ABand := Bands[I]; + ABand.Position.Bottom := Dimension.cy; + cxFillMapItem(HeaderMap, ABand, True); + ABand.Position.Bottom := 1; + if Footer then cxFillMapItem(FooterMap, ABand, False); + ABand.RegisterStyles; + end; + for I := 0 to ColumnCount - 1 do + begin + if Footer then cxFillMapItem(FooterMap, Columns[I], False); + Columns[I].RegisterStyles; + end; + end; +end; + +function TcxTreeListMapsInfo.GetBandLineHeight: Integer; +begin + with TreeList do + Result := TcxViewInfoAccess(ViewInfo).BandLineHeight * OptionsView.BandLineCount; +end; + +function TcxTreeListMapsInfo.GetBands: Boolean; +begin + Result := TreeList.OptionsView.Bands; +end; + +function TcxTreeListMapsInfo.GetNodeCellsCount: Integer; +begin + Result := HeaderInfoList.Dimension.cy - 1; +end; + +function TcxTreeListMapsInfo.GetPreview: Boolean; +begin + Result := TreeList.Preview.Active; +end; + +function TcxTreeListMapsInfo.GetPreviewAutoHeight: Boolean; +begin + Result := TreeList.Preview.AutoHeight; +end; + +function TcxTreeListMapsInfo.GetProvider: IcxExportProvider; +begin + Result := Owner.Provider; +end; + +function TcxTreeListMapsInfo.GetHeaders: Boolean; +begin + Result := TreeList.OptionsView.Headers; +end; + +function TcxTreeListMapsInfo.GetFooter: Boolean; +begin + Result := TreeList.OptionsView.Footer; +end; + +function TcxTreeListMapsInfo.GetFooters(AColumn: TcxTreeListColumn): Boolean; +begin + Result := Footer and AColumn.Options.Footer; +end; + +function TcxTreeListMapsInfo.GetGridLines: Boolean; +begin + Result := TreeList.OptionsView.GridLines <> tlglNone; +end; + +function TcxTreeListMapsInfo.GetHeaderLineHeight: Integer; +begin + Result := TcxViewInfoAccess(TreeList.ViewInfo).HeaderLineHeight; +end; + +function TcxTreeListMapsInfo.GetTreeList: TcxTreeListAccess; +begin + Result := Owner.TreeList; +end; + +function TcxTreeListMapsInfo.GetVertInc: Integer; +begin + Result := 2 * Byte(TreeList.OptionsView.GridLines in [tlglVert, tlglBoth]); +end; + +procedure TcxTreeListMapsInfo.AddColumnsFromBand( + var AOfs: Integer; ABand: TcxTreeListBand); +var + I, J, ALeft, ABandWidth: Integer; + + procedure AddColumn(ALineOfs: Integer; AColumn: TcxColumnAccess); + var + R: TRect; + begin + with AColumn do + begin + R := Rect(ALeft, ALineOfs + 1, // + 1 band header offset but may be invisible + ALeft + DisplayWidth, ALineOfs + Position.LineCount + 1); + Inc(ALeft, DisplayWidth); + end; + HeaderInfoList.AddItem(R, AColumn, TcxColumnInfoItem); + end; + +begin + ABandWidth := TcxBandAccess(ABand).DisplayWidth; + for I := 0 to ABand.BandRows.Count - 1 do + begin + ALeft := AOfs; + with ABand.BandRows[I] do + begin + for J := 0 to Count - 1 do + AddColumn(LineOffset, TcxColumnAccess(Items[J])); + end; + end; + HeaderInfoList.AddItem(Rect(AOfs, 0, AOfs + ABandWidth, 1), ABand, TcxBandInfoItem); + Inc(AOfs, ABandWidth); +end; + +{ TcxTreeListExportHelper } + +constructor TcxTreeListExportHelper.Create(ATreeList: TcxCustomTreeListControl; + AExportType: Integer; const AFileName: string); + + function DefaultStyle: TcxCacheCellStyle; + begin + cxViewParamsToCacheStyle(TreeList.Styles.GetBackgroundParams, Result); + end; + +begin + FTreeList := TcxTreeListAccess(ATreeList); + TcxExport.Provider(AExportType, AFileName).GetInterface(IcxExportProvider, FProvider); + FProvider.SetDefaultStyle(DefaultStyle); + FSelectionList := TList.Create; + FSelectionList.Capacity := FTreeList.DataController.RecordCount; + MapsInfo := GetMapsInfoClass.Create(Self); +end; + +destructor TcxTreeListExportHelper.Destroy; +begin + try + MapsInfo.Free; + FSelectionList.Free; + FProvider := nil; + finally + inherited Destroy; + end; +end; + +procedure TcxTreeListExportHelper.CallIterationProc(ANode: TcxTreeListNode; + AIndex: Integer; AProc: TcxTreeListNodeItarationHandler); +var + APrevIndex: Integer; +begin + APrevIndex := TcxNodeAccess(ANode).FVisibleIndex; + TcxNodeAccess(ANode).FVisibleIndex := AIndex; + try + AProc(ANode); + finally + TcxNodeAccess(ANode).FVisibleIndex := APrevIndex; + end; +end; + +procedure TcxTreeListExportHelper.DoCalculateTableMap; +begin + MapsInfo.DoCalculate; +end; + +procedure TcxTreeListExportHelper.DoWriteCells; +begin + MapsInfo.DoWrite; + Provider.Commit; +end; + +procedure TcxTreeListExportHelper.DoIterate( + AProc: TcxTreeListNodeItarationHandler); +begin + if not Assigned(AProc) then Exit; + if ExportSelection then + DoIterateSelectionNodes(AProc) + else + DoIterateAllNodes(AProc); +end; + +procedure TcxTreeListExportHelper.DoIterateAllNodes(AProc: TcxTreeListNodeItarationHandler); +var + AIndex: Integer; + AStartNode: TcxTreeListNode; +begin + AStartNode := TreeList.Nodes.Root.GetFirstChild; + AIndex := 0; + while AStartNode <> nil do + begin + CallIterationProc(AStartNode, AIndex, AProc); + if Expand then + AStartNode := AStartNode.GetNext + else + AStartNode := AStartNode.GetNextVisible; + Inc(AIndex); + end; +end; + +procedure TcxTreeListExportHelper.DoIterateSelectionNodes( + AProc: TcxTreeListNodeItarationHandler); +var + I: Integer; +begin + for I := 0 to FSelectionList.Count - 1 do + CallIterationProc(TcxTreeListNode(FSelectionList[I]), I, AProc); +end; + +function TcxTreeListExportHelper.GetMapsInfoClass: TcxTreeListMapsInfoClass; +begin + Result := TcxTreeListMapsInfo; +end; + +function TcxTreeListExportHelper.AddToSelection(ANode: TcxTreeListNode): Boolean; +begin + Result := FSelectionList.IndexOf(ANode) <> cxInvalidIndex; + if not Result then + begin + if not ANode.IsVisible then + begin + if not Expand then + Exit + else + ANode.Expanded := True; + end; + FSelectionList.Add(ANode); + Result := True; + end; +end; + +procedure TcxTreeListExportHelper.CreateSelectionList; +var + I: Integer; + + procedure CheckListItem(ANode: TcxTreeListNode); + begin + while ANode <> nil do + begin + if ANode.Selected and AddToSelection(ANode) then + CheckListItem(ANode.GetFirstChild); + ANode := ANode.GetNext; + end; + end; + +begin + for I := 0 to TreeList.SelectionCount - 1 do + AddToSelection(TcxNodeAccess(TreeList.Selections[I]).GetRootParent); + for I := 0 to FSelectionList.Count - 1 do + CheckListItem(TcxTreeListNode(FSelectionList.List^[I])); + FSelectionList.Sort(cxNodesCompare); +end; + +procedure TcxTreeListExportHelper.SetExportSelection(Value: Boolean); +begin + FExportSelection := Value; + if Value then CreateSelectionList; +end; + +// external procedures definition + +procedure cxExportTL4ToFile(AFileName: string; ATreeList: TcxCustomTreeListControl; + AExportType: Integer; AExpand, ASaveAll, AUseNativeFormat: Boolean; + const ASeparators: array of string; const AFileExt: string); +var + I: Integer; + AIntf: IcxExportWithSeparators; +begin + if AFileExt <> '' then + AFileName := ChangeFileExt(AFileName, '.' + AFileExt); + if not ATreeList.Visible then + cxTreeListError(scxExportNotVisibleControl); + with TcxTreeListExportHelper.Create(ATreeList, AExportType, AFileName) do + try + FExpand := AExpand; + FIsNativeFormat := AUseNativeFormat; + ExportSelection := not ASaveAll; + if cxExportTL4Link.Supports(Provider, IcxExportWithSeparators, AIntf) and (Length(ASeparators) > 0) then + begin + for I := Low(ASeparators) to High(ASeparators) do + AIntf.AddSeparator(ASeparators[I]); + end; + DoCalculateTableMap; + DoWriteCells; + finally + Free; + end; +end; + +procedure cxExportTL4ToHTML(const AFileName: string; ATreeList: TcxCustomTreeListControl; + AExpand: Boolean = True; ASaveAll: Boolean = True; const AFileExt: string = 'html'); +begin + cxExportTL4ToFile(AFileName, ATreeList, cxExportToHtml, AExpand, ASaveAll, False, [], AFileExt); +end; + +procedure cxExportTL4ToXML(const AFileName: string; ATreeList: TcxCustomTreeListControl; + AExpand: Boolean = True; ASaveAll: Boolean = True; const AFileExt: string = 'xml'); +begin + cxExportTL4ToFile(AFileName, ATreeList, cxExportToXML, AExpand, ASaveAll, False, [], AFileExt); +end; + +procedure cxExportTL4ToExcel(const AFileName: string; ATreeList: TcxCustomTreeListControl; + AExpand: Boolean = True; ASaveAll: Boolean = True; AUseNativeFormat: Boolean = True; + const AFileExt: string = 'xls'); +begin + cxExportTL4ToFile(AFileName, ATreeList, cxExportToExcel, AExpand, ASaveAll, + AUseNativeFormat, [], AFileExt); +end; + +procedure cxExportTL4ToText(const AFileName: string; ATreeList: TcxCustomTreeListControl; + AExpand: Boolean = True; ASaveAll: Boolean = True; const ASeparator: string = ''; + const ABeginString: string = ''; const AEndString: string = ''; const AFileExt: string = 'txt'); +begin + cxExportTL4ToFile(AFileName, ATreeList, cxExportToText, AExpand, ASaveAll, False, + [ASeparator, ABeginString, AEndString], AFileExt); +end; + +initialization + Move(cxIndentFontName[1], cxIndentStyle.FontName[0], Length(cxIndentFontName)); + cxExportInit(TcxGetResourceStringProc(@cxGetResourceString), @ColorToRGB, True ); +end. + diff --git a/official/x.35/ExpressQuantumTreeList 4/Sources/cxTL.pas b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTL.pas new file mode 100644 index 00000000..3bba96d8 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTL.pas @@ -0,0 +1,19676 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumTreeList } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMTREELIST AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxTL; + +{$I cxVer.inc} + +interface + +uses + {$IFDEF DELPHI6} + Variants, + {$ENDIF} + Classes, SysUtils, Clipbrd, Windows, Messages, + ExtCtrls, Controls, Forms, StdCtrls, Graphics, ImgList, ComCtrls, cxControls, + cxGraphics, cxVariants, cxNavigator, cxStorage, cxClasses, cxEdit, cxListBox, + cxInplaceContainer, cxLookAndFeels, cxLookAndFeelPainters, cxData, cxDataUtils, + cxCustomData, cxStyles, cxGeometry, cxTLIntf, cxTLStrs, Math, cxLibraryConsts; + +const + cxTLMajorVersion = '4'; + // default size values for treelist items + cxTreeListDefWidth = 100; + cxTreeListDefMinWidth = 20; + // default values for treelist options view + + cxTreeListDefBandHeaderLineCount = 1; + cxTreeListDefBands = False; + cxTreeListDefFooter = False; + cxTreeListDefColumnHeaders = True; + cxTreeListDefColumnAutoWidth = False; + cxTreeListDefIndicatorWidth = 15; + cxTreeListDefSeparatorWidth = 2; + cxTreeListDefDropArrowColor = $00FF00; + + cxTreeListDefWaitExpandTime = 500; + + // preview + cxTreeListDefPreviewIndent = 5; + cxTreeListDefPreviewMaxLineCount = 3; + + // treelist styles predefined indexes + + tlcs_Header = ecs_EditContainerStylesMaxIndex + 1; + tlcs_Footer = ecs_EditContainerStylesMaxIndex + 2; + + // for band styles + tlbs_Content = 0; + tlbs_Footer = 1; + tlbs_Header = 2; + tlbs_HeaderBackground = 3; + + // for control styles + tlsv_Content = ecs_Content; + tlsv_BandBackground = ecs_EditingStylesMaxIndex + 1; + tlsv_BandContent = ecs_EditingStylesMaxIndex + 2; + tlsv_BandHeader = ecs_EditingStylesMaxIndex + 3; + tlsv_ColumnFooter = ecs_EditingStylesMaxIndex + 4; + tlsv_ColumnHeader = ecs_EditingStylesMaxIndex + 5; + tlsv_ContentEven = ecs_EditingStylesMaxIndex + 6; + tlsv_ContentOdd = ecs_EditingStylesMaxIndex + 7; + tlsv_Footer = ecs_EditingStylesMaxIndex + 8; + tlsv_HotTrack = ecs_EditingStylesMaxIndex + 12; + tlsv_IncSearch = ecs_EditingStylesMaxIndex + 9; + tlsv_Indicator = ecs_EditingStylesMaxIndex + 10; + tlsv_Preview = ecs_EditingStylesMaxIndex + 11; + + // base constants for descendants + + cxtlMaxControlStyleIndex = tlsv_Preview; + cxtlMaxColumnStyleIndex = tlcs_Footer; + cxtlMaxBandStyleIndex = tlbs_HeaderBackground; + + // base index for hitcodes bits + + tlhc_Base = 4; + tlhc_HitAtBand = tlhc_Base; + tlhc_HitAtBandContainer = tlhc_Base + 1; + tlhc_HitAtBandHeader = tlhc_Base + 2; + tlhc_HitAtButton = tlhc_Base + 3; + tlhc_HitAtColumn = tlhc_Base + 4; + tlhc_HitAtColumnHeader = tlhc_Base + 5; + tlhc_HitAtFooter = tlhc_Base + 6; + tlhc_HitAtFooterItem = tlhc_Base + 7; + tlhc_HitAtIndent = tlhc_Base + 17; + tlhc_HitAtIndicator = tlhc_Base + 8; + tlhc_HitAtNode = tlhc_Base + 9; + tlhc_HitAtNodePreview = tlhc_Base + 16; + tlhc_HitAtSeparator = tlhc_Base + 11; + tlhc_HitAtSizingHorz = tlhc_Base + 12; + tlhc_HitAtSizingVert = tlhc_Base + 13; + tlhc_HitAtImage = tlhc_Base + 14; + tlhc_HitAtStateImage = tlhc_Base + 15; + tlhc_MaxIndex = tlhc_HitAtSizingVert; + + // node state flags + tlnsFocused = $0001; + tlnsDeleting = $0002; + tlnsHasChildren = $0004; + tlnsHasData = $0008; + tlnsCollapsed = $0010; + tlnsInternalCreating = $0080; + tlnsIndexesInvalid = $1000; + tlnsRecreateList = $2000; + + // events state + tlesNone = $0000; + tlesChanged = $0001; + tlesSelection = $0002; + + // hit test and sizing constants + cxtlHitDelta = 3; + cxtlScrollDelta = 10; + cxtlSizingMarkWidth = 1; + + // overs + cxColumnTextSeparator = #9; + cxLineSeparator = #13#10; + cxTreeListScrollWidthDragInterval = 50; + cxTreeListIndentOffsetSize = 6; + cxTreeListEditCellContentOffset: TRect = (Left: 1; Top: 1; Right: 1; Bottom: 1); + cxTreeListEditCellHeightOffset = 2; + cxTreeListDragDropTextAreaOffset: TPoint = (X: 20; Y:0); + +type + EcxTreeList = class(Exception); + + TcxTreeListColumn = class; + TcxTreeListColumnViewInfo = class; + TcxTreeListColumnViewInfoClass = class of TcxTreeListColumnViewInfo; + + TcxTreeListBand = class; + TcxTreeListBands = class; + TcxTreeListBandRow = class; + TcxTreeListBandRows = class; + + TcxTreeListOptionsBehavior = class; + + TcxTreeListOptionsCustomizing = class; + TcxTreeListOptionsCustomizingClass = class of TcxTreeListOptionsCustomizing; + + TcxTreeListHitTest = class; + + TcxTreeListHeaderViewInfo = class; + + TcxTreeListBandViewInfo = class; + TcxTreeListViewInfo = class; + TcxTreeListViewInfoItem = class; + TcxTreeListNodesViewInfo = class; + TcxTreeListNodeViewInfo = class; + TcxTreeListCellsGroupViewInfo = class; + TcxTreeListEditCellViewInfo = class; + TcxCustomViewInfoItemClass = class of TcxCustomViewInfoItem; + TcxTreeListNodeViewInfoClass = class of TcxTreeListNodeViewInfo; + TcxTreeListNodesViewInfoClass = class of TcxTreeListNodesViewInfo; + TcxTreeListViewInfoItemClass = class of TcxTreeListViewInfoItem; + TcxTreeListIndentViewInfoClass = class of TcxTreeListIndentViewInfo; + TcxTreeListEditCellViewInfoClass = class of TcxTreeListEditCellViewInfo; + TcxTreeListCellsGroupViewInfoClass = class of TcxTreeListCellsGroupViewInfo; + + TcxTreeListOptionsView = class; + + TcxTreeListControlPainter = class; + + TcxTreeListNode = class; + TcxTreeListNodes = class; + TcxTreeListNodesClass = class of TcxTreeListNodes; + + TcxTreeListPreview = class; + TcxTreeListPreviewClass = class of TcxTreeListPreview; + TcxCustomTreeListControl = class; + TcxTreeListCustomizing = class; + + TcxTreeListStyles = class; + + // overriding types + PIntArray = ^TIntArray; + PPointerList = Classes.PPointerList; + + TIntArray = array[0..MaxInt div SizeOf(Integer) - 1] of Integer; + + TcxTreeListBandFixedKind = (tlbfNone, tlbfLeft, tlbfRight); + + TcxTreeListGridLines = (tlglNone, tlglHorz, tlglVert, tlglBoth); + + TcxTreeListImageIndexType = (tlitImageIndex, tlitSelectedIndex, tlitStateIndex); + TcxTreeListImageIndexes = set of TcxTreeListImageIndexType; + + TcxTreeListNodeAttachMode = (tlamAdd, tlamAddFirst, tlamAddChild, tlamAddChildFirst, tlamInsert); + TcxTreeListNodeAddMode = (tlnaAdd, tlnaAddFirst, tlnaInsert); + TcxTreeListNodeImageIndexes = array[TcxTreeListImageIndexType] of TImageIndex; + + TcxTreeListCompareFunc = function(AItem1, AItem2: TcxTreeListNode): Integer; + + TcxCachedContentParams = array[Boolean] of TcxViewParams; + + TcxTreeListFindFunc = function(ANode: TcxTreeListNode; AData: Pointer): Boolean; + + { TcxTreeListNodes} + + TcxTreeListNodes = class(TPersistent) + private + FFoundItem: TcxTreeListNode; + FFocusedIndex: Integer; + FMaxLevel: Integer; + FOwner: TcxCustomTreeListControl; + FRoot: TcxTreeListNode; + FState: Integer; + FVisibleCount: Integer; + function GetAbsoluteItem(AFindIndex: Integer): TcxTreeListNode; + function GetCount: Integer; + function GetDataController: TcxControlDataController; + function GetItem(AIndex: Integer): TcxTreeListNode; + function GetMaxLevel: Integer; + function GetNodesViewInfo: TcxTreeListNodesViewInfo; + function GetState(Index: Integer): Boolean; + function GetTopVisibleNode: TcxTreeListNode; + function GetVisibleCount: Integer; + procedure SetAbsoluteItem(Index: Integer; Value: TcxTreeListNode); + procedure SetItem(AIndex: Integer; Value: TcxTreeListNode); + procedure SetState(Index: Integer; Value: Boolean); + protected + TopIndex: Integer; + TopNode: TcxTreeListNode; + procedure CalculateInfo(IsLocked: Boolean); virtual; + procedure Changed; virtual; + procedure DoNodeChanged(ANode: TcxTreeListNode); virtual; + class function FindBetween(AFirst, ALast: TcxTreeListNode; ACount, AIndex: Integer): TcxTreeListNode; + function GetOwner: TPersistent; override; + function GetVisibleNode(var AIndex: Integer): TcxTreeListNode; virtual; + function InternalAddNode(ANode, ARelative: TcxTreeListNode; AddMethod: TcxTreeListNodeAttachMode): TcxTreeListNode; + procedure SetNodeParent(ANewNode, ANewParent: TcxTreeListNode; AMode: TcxTreeListNodeAddMode); + procedure SetTopVisibleIndex(AIndex: Integer); + property DataController: TcxControlDataController read GetDataController; + property FocusedIndex: Integer read FFocusedIndex write FFocusedIndex; + property NodesViewInfo: TcxTreeListNodesViewInfo read GetNodesViewInfo; + property State: Integer read FState write FState; + property IsInvalidState: Boolean index tlnsIndexesInvalid read GetState write SetState; + property IsInternalCreating: Boolean index tlnsInternalCreating read GetState write SetState; + public + constructor Create(AOwner: TcxCustomTreeListControl); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure Clear; + property Root: TcxTreeListNode read FRoot; + property Count: Integer read GetCount; + property AbsoluteItems[AbsoluteIndex: Integer]: TcxTreeListNode read GetAbsoluteItem write SetAbsoluteItem; + property Items[Index: Integer]: TcxTreeListNode read GetItem write SetItem; default; + property TopVisibleNode: TcxTreeListNode read GetTopVisibleNode; + property TreeList: TcxCustomTreeListControl read FOwner; + property VisibleCount: Integer read GetVisibleCount; + property MaxLevel: Integer read GetMaxLevel; + end; + + { TcxTreeListNode } + + TcxTreeListNode = class(TPersistent, IUnknown, IcxDragSizing) + private + FCount: Integer; + FData: Pointer; + FFirst: TcxTreeListNode; + FIndex: Integer; + FLast: TcxTreeListNode; + FNext: TcxTreeListNode; + FOwner: TcxTreeListNodes; + FParent: TcxTreeListNode; + FPrev: TcxTreeListNode; + FRecordIndex: Integer; + FState: Integer; + function GetAbsoluteIndex: Integer; + function GetDataController: TcxControlDataController; + function GetExpanded: Boolean; + function GetFocused: Boolean; + function GetHasChildren: Boolean; + function GetHotTrack: Boolean; + function GetIsDeleting: Boolean; + function GetIsFirst: Boolean; + function GetIsGroupNode: Boolean; + function GetIsLast: Boolean; + function GetIsVisible: Boolean; + function GetItem(AIndex: Integer): TcxTreeListNode; + function GetLevel: Integer; + function GetSelected: Boolean; + function GetNodeImageIndex(AIndex: Integer): TImageIndex; + function GetText(Index: Integer): string; + function GetTreeList: TcxCustomTreeListControl; + function GetValue(AIndex: Integer): Variant; + function GetValueCount: Integer; + function GetVisibleIndex: Integer; + procedure AdjustIndexes(ANode: TcxTreeListNode; AIndex: Integer); + procedure InternalInsert(Value: TcxTreeListNode); + procedure InternalRemove(Value: TcxTreeListNode); + procedure SetExpanded(Value: Boolean); + procedure SetFirst(Value: TcxTreeListNode); + procedure SetFocused(Value: Boolean); + procedure SetHasChildren(Value: Boolean); + procedure SetItem(AIndex: Integer; Value: TcxTreeListNode); + procedure SetLast(Value: TcxTreeListNode); + procedure SetNodeImageIndex(AIndex: Integer; Value: TImageIndex); + procedure SetParentFor(Value: TcxTreeListNode); + procedure SetText(AIndex: Integer; const AValue: string); + procedure SetSelected(Value: Boolean); + procedure SetValue(AIndex: Integer; const AValue: Variant); + protected + FImageIndexes: TcxTreeListNodeImageIndexes; + FVisibleIndex: Integer; + function AddDataControllerRecord: Integer; virtual; + procedure DoReadNodeData(AReader: TcxReader); virtual; + procedure DoWriteNodeData(AWriter: TcxWriter); virtual; + function GetIsFirstVisible: Boolean; virtual; + function GetIsLastVisible: Boolean; virtual; + function GetNextVisibleEx(IsPrev: Boolean): TcxTreeListNode; + function GetNextSiblingEx(ANode: TcxTreeListNode; AForward: Boolean): TcxTreeListNode; + function GetOwner: TPersistent; override; + function GetRootParent: TcxTreeListNode; + procedure ReadData(AStream: TStream); virtual; + procedure WriteData(AStream: TStream); virtual; + // IcxDragSizing + function CanSizing(ADirection: TcxDragSizingDirection): Boolean; + function GetSizingBoundsRect(ADirection: TcxDragSizingDirection): TRect; + function GetSizingIncrement(ADirection: TcxDragSizingDirection): Integer; + function IsDynamicUpdate: Boolean; + procedure SetSizeDelta(ADirection: TcxDragSizingDirection; ADelta: Integer); + // IUnknown + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + property DataController: TcxControlDataController read GetDataController; + property State: Integer read FState write FState; + public + constructor Create(AOwner: TcxTreeListNodes); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure AssignValues(const AValues:{$IFDEF DELPHI5} array of {$ENDIF} Variant); + function AddChild: TcxTreeListNode; virtual; + function AddChildFirst: TcxTreeListNode; virtual; + procedure AlphaSort(ARecurse: Boolean = False); + function CanCollapse: Boolean; + function CanExpand: Boolean; + function CanMove(ADest: TcxTreeListNode; AMode: TcxTreeListNodeAttachMode): Boolean; + procedure Collapse(Recurse: Boolean); + procedure CustomSort(ASortProc: TcxTreeListCompareFunc; ARecurse: Boolean = False); + procedure Delete; + procedure DeleteChildren; + function DisplayRect(AEntryOnly: Boolean): TRect; + procedure EndEdit(Cancel: Boolean); + procedure Expand(Recurse: Boolean); + function GetNext: TcxTreeListNode; + function GetNextChild(Value: TcxTreeListNode): TcxTreeListNode; + function getNextSibling: TcxTreeListNode; {GetNextSibling conflicts with C++ macro} + function GetNextVisible: TcxTreeListNode; + function GetPrev: TcxTreeListNode; + function GetPrevChild(Value: TcxTreeListNode): TcxTreeListNode; + function getPrevSibling: TcxTreeListNode; {GetPrevSibling conflicts with a C++ macro} + function GetPrevVisible: TcxTreeListNode; + function getFirstChild: TcxTreeListNode; {GetFirstChild conflicts with C++ macro} + function GetLastChild: TcxTreeListNode; + // + function HasAsParent(Value: TcxTreeListNode): Boolean; + function IndexOf(Value: TcxTreeListNode): Integer; + function InsertChild(ABeforeNode: TcxTreeListNode): TcxTreeListNode; virtual; + procedure MakeVisible; + procedure MoveTo(ADestNode: TcxTreeListNode; AMode: TcxTreeListNodeAttachMode); virtual; + procedure Repaint(ARecalculate: Boolean); virtual; + property AbsoluteIndex: Integer read GetAbsoluteIndex; + property Count: Integer read FCount; + property Data: Pointer read FData write FData; + property Deleting: Boolean read GetIsDeleting; + property Expanded: Boolean read GetExpanded write SetExpanded; + property Focused: Boolean read GetFocused write SetFocused; + property HasChildren: Boolean read GetHasChildren write SetHasChildren; + property HotTrack: Boolean read GetHotTrack; + property ImageIndex: TImageIndex index 0 read GetNodeImageIndex write SetNodeImageIndex; + property Index: Integer read FIndex; + property IsFirst: Boolean read GetIsFirst; + property IsFirstVisible: Boolean read GetIsFirstVisible; + property IsGroupNode: Boolean read GetIsGroupNode; + property IsLast: Boolean read GetIsLast; + property IsLastVisible: Boolean read GetIsLastVisible; + property IsVisible: Boolean read GetIsVisible; + property Items[Index: Integer]: TcxTreeListNode read GetItem write SetItem; default; + property Level: Integer read GetLevel; + property Owner: TcxTreeListNodes read FOwner; + property Parent: TcxTreeListNode read FParent; + property RecordIndex: Integer read FRecordIndex write FRecordIndex; + property Selected: Boolean read GetSelected write SetSelected; + property SelectedIndex: TImageIndex index 1 read GetNodeImageIndex write SetNodeImageIndex; + property StateIndex: TImageIndex index 2 read GetNodeImageIndex write SetNodeImageIndex; + property Texts[Index: Integer]: string read GetText write SetText; + property TreeList: TcxCustomTreeListControl read GetTreeList; + property ValueCount: Integer read GetValueCount; + property Values[Index: Integer]: Variant read GetValue write SetValue; + property VisibleIndex: Integer read GetVisibleIndex; + end; + + { TcxTreeListRootNode } + + TcxTreeListRootNode = class(TcxTreeListNode) + protected + function AddDataControllerRecord: Integer; override; + end; + + { TcxUnboundTreeListNode } + + TcxUnboundTreeListNode = class(TcxTreeListNode) + protected + procedure ReadData(AStream: TStream); override; + procedure WriteData(AStream: TStream); override; + public + constructor Create(AOwner: TcxTreeListNodes); override; + procedure Assign(Source: TPersistent); override; + end; + + { TcxTreeListColumnStyles } + + TcxTreeListColumnStyles = class(TcxEditContainerStyles) + private + function GetBand: TcxTreeListBand; + function GetTreeList: TcxCustomTreeListControl; + protected + ContentParams: TcxCachedContentParams; + procedure CachedContentStyleChanged; + property Band: TcxTreeListBand read GetBand; + property TreeList: TcxCustomTreeListControl read GetTreeList; + public + procedure Assign(Source: TPersistent); override; + published + property Header: TcxStyle index tlcs_Header read GetValue write SetValue; + property Footer: TcxStyle index tlcs_Footer read GetValue write SetValue; + property Content; + end; + + { TcxTreeListColumnPosition } + + TcxTreeListColumnPosition = class(TcxOwnedPersistent) + private + FBandIndex: Integer; + FColIndex: Integer; + FLineCount: Integer; + FRowIndex: Integer; + function GetBandIndex: Integer; + function GetColumn: TcxTreeListColumn; + function GetOwnerBandVisibleIndex: Integer; + function GetTreeList: TcxCustomTreeListControl; + procedure SetBandIndex(Index: Integer); + procedure SetColIndex(Value: Integer); + procedure SetLineCount(Value: Integer); + procedure SetRowIndex(Value: Integer); + protected + procedure Changed; virtual; + function GetBandFromIndex(AIndex: Integer): TcxTreeListBand; + procedure Save; virtual; + procedure Load; virtual; + property Column: TcxTreeListColumn read GetColumn; + property OwnerBandVisibleIndex: Integer read GetOwnerBandVisibleIndex; + property TreeList: TcxCustomTreeListControl read GetTreeList; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + procedure SetPosition(AColIndex, ARowIndex: Integer; IsInsertRow: Boolean = False); + procedure SetPositionEx(ABandIndex, AColIndex, ARowIndex: Integer; IsInsertRow: Boolean = False); + published + property ColIndex: Integer read FColIndex write SetColIndex; + property LineCount: Integer read FLineCount write SetLineCount default 1; + property RowIndex: Integer read FRowIndex write SetRowIndex; + property BandIndex: Integer read GetBandIndex write SetBandIndex; + end; + + TcxTreeListColumnPositionClass = class of TcxTreeListColumnPosition; + + { TcxTreeListCaption } + + TcxTreeListCaption = class(TcxOwnedPersistent) + private + FAlignHorz: TAlignment; + FAlignVert: TcxAlignmentVert; + FGlyph: TBitmap; + FGlyphAlignHorz: TAlignment; + FGlyphAlignVert: TcxAlignmentVert; + FText: string; + FTreeList: TcxCustomTreeListControl; + FState: Integer; + FViewInfo: TcxTreeListViewInfoItem; + procedure SetAlignHorz(Value: TAlignment); + procedure SetAlignVert(Value: TcxAlignmentVert); + procedure SetGlyph(Value: TBitmap); + procedure SetGlyphAlignHorz(Value: TAlignment); + procedure SetGlyphAlignVert(Value: TcxAlignmentVert); + procedure SetText(const Value: string); + protected + procedure Changed; virtual; + function GetState(Index: Integer): Boolean; + function GetText: string; virtual; + function IsTextStored: Boolean; virtual; + procedure SetState(Index: Integer; Value: Boolean); + property TreeList: TcxCustomTreeListControl read FTreeList; + public + constructor Create(AOwner: TPersistent); override; + constructor CreateEx(ATreeList: TcxCustomTreeListControl; + AOwner: TPersistent; AViewInfo: TcxTreeListViewInfoItem); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + published + property AlignHorz: TAlignment read FAlignHorz write SetAlignHorz default taLeftJustify; + property AlignVert: TcxAlignmentVert read FAlignVert write SetAlignVert default vaTop; + property Glyph: TBitmap read FGlyph write SetGlyph; + property GlyphAlignHorz: TAlignment read FGlyphAlignHorz write SetGlyphAlignHorz default taLeftJustify; + property GlyphAlignVert: TcxAlignmentVert read FGlyphAlignVert write SetGlyphAlignVert default vaTop; + property MultiLine: Boolean index 2 read GetState write SetState default False; + property ShowEndEllipsis: Boolean index 1 read GetState write SetState default True; + property Text: string read GetText write SetText stored IsTextStored; + end; + + { TcxTreeListColumnOptions } + + TcxTreeListColumnOptions = class(TcxCustomEditContainerItemOptions) + private + FState: Integer; + FHidden: Boolean; + protected + procedure Changed; override; + function GetValue(Index: Integer): Boolean; + procedure SetValue(Index: Integer; const Value: Boolean); + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; virtual; + published + property CellEndEllipsis: Boolean index 1 read GetValue write SetValue default True; + property Sizing: Boolean index 2 read GetValue write SetValue default True; + property Footer: Boolean index 3 read GetValue write SetValue default False; + property Hidden: Boolean read FHidden write FHidden default False; + property Customizing; + property Editing; + property Focusing; + property IncSearch; + property Moving; + property ShowEditButtons; + property Sorting; + property TabStop; + end; + + { TcxTreeListColumnSummaryFooter } + + TcxTreeListColumnSummaryFooter = class(TcxOwnedInterfacedPersistent) + private + FAlignHorz: TAlignment; + FAlignVert: TcxAlignmentVert; + FFormat: string; + FMultiLine: Boolean; + function GetColumn: TcxTreeListColumn; + function GetDataController: TcxCustomDataController; + function GetFormat: string; + function GetSummaryItem: TcxDataSummaryItem; + function GetSummaryKind: TcxSummaryKind; + function GetSummaryText: string; + function GetSummaryValue: Variant; + procedure SetAlignHorz(Value: TAlignment); + procedure SetAlignVert(Value: TcxAlignmentVert); + procedure SetFormat(const Value: string); + procedure SetMultiLine(Value: Boolean); + procedure SetSummaryText(const Value: string); + procedure SetSummaryValue(const Value: Variant); + procedure SetSummaryKind(Value: TcxSummaryKind); + protected + ItemIndex: Integer; + function IsFormatStored: Boolean; + function IsSummaryItemValid: Boolean; + function Summary: TcxDataSummary; + procedure SummaryItemChanged; virtual; + function SummaryItemIndex: Integer; + function SummaryItems: TcxDataFooterSummaryItems; + property DataController: TcxCustomDataController read GetDataController; + public + procedure Assign(Source: TPersistent); override; + property Column: TcxTreeListColumn read GetColumn; + property SummaryItem: TcxDataSummaryItem read GetSummaryItem; + property SummaryText: string read GetSummaryText write SetSummaryText; + property SummaryValue: Variant read GetSummaryValue write SetSummaryValue; + published + property Format: string read GetFormat write SetFormat stored IsFormatStored; + property Kind: TcxSummaryKind read GetSummaryKind write SetSummaryKind default skNone; + property AlignHorz: TAlignment read FAlignHorz write SetAlignHorz default taLeftJustify; + property AlignVert: TcxAlignmentVert read FAlignVert write SetAlignVert default vaTop; + property MultiLine: Boolean read FMultiLine write SetMultiLine default False; + end; + + TcxTreeListColumnSummaryFooterClass = class of TcxTreeListColumnSummaryFooter; + + { TcxTreeListColumn } + + TcxTreeListOnGetDisplayTextEvent = procedure(Sender: TcxTreeListColumn; + ANode: TcxTreeListNode; var Value: string) of object; + TcxTreeListGetEditPropertiesEvent = procedure(Sender: TcxTreeListColumn; + ANode: TcxTreeListNode; var EditProperties: TcxCustomEditProperties) of object; + + TcxTreeListColumn = class(TcxCustomInplaceEditContainer, IUnknown, IcxDragSizing, IcxTreeListIndexedItem, IcxStoredObject) + private + FCaption: TcxTreeListCaption; + FCalculatedWidth: Integer; + FData: Integer; + FIsWidthAssigned: Boolean; + FMinWidth: Integer; + FOnChangeName: TNotifyEvent; + FOwnerBand: TcxTreeListBand; + FPosition: TcxTreeListColumnPosition; + FSortOrder: TcxDataSortOrder; + FState: Integer; + FSummaryFooter: TcxTreeListColumnSummaryFooter; + FViewInfo: TcxTreeListColumnViewInfo; + FVisibleIndexAtBand: Integer; + FWidth: Integer; + FOnGetDisplayText: TcxTreeListOnGetDisplayTextEvent; + function GetDataBinding: TcxItemDataBinding; + function GetDisplayText(Index: Integer): string; + function GetDisplayWidth: Integer; + function GetEditingProperties: TcxTreeListGetEditPropertiesEvent; + function GetEditProperties: TcxTreeListGetEditPropertiesEvent; + function GetIndentWidth: Integer; + function GetIsFixed: Boolean; + function GetIsHidden: Boolean; + function GetIsLeft: Boolean; + function GetIsLeftMost: Boolean; + function GetIsRightMost: Boolean; + function GetIsPreview: Boolean; + function GetIsRight: Boolean; + function GetIsWidthStored: Boolean; + function GetOptions: TcxTreeListColumnOptions; + function GetOwnerBandRow: TcxTreeListBandRow; + function GetRealMinWidth: Integer; + function GetRealWidth: Integer; + function GetStyles: TcxTreeListColumnStyles; + function GetTreeList: TcxCustomTreeListControl; + function GetVisible: Boolean; + function GetVisibility: Boolean; + function GetWidth: Integer; + procedure SetCaption(Value: TcxTreeListCaption); + procedure SetDataBinding(Value: TcxItemDataBinding); + procedure SetEditingProperties(Value: TcxTreeListGetEditPropertiesEvent); + procedure SetEditProperties(Value: TcxTreeListGetEditPropertiesEvent); + procedure SetIsPreview(Value: Boolean); + procedure SetMinWidth(Value: Integer); + procedure SetOptions(Value: TcxTreeListColumnOptions); + procedure SetOwnerBand(Value: TcxTreeListBand); + procedure SetPosition(Value: TcxTreeListColumnPosition); + procedure SetSorted(Value: TcxDataSortOrder); + procedure SetStyles(Value: TcxTreeListColumnStyles); + procedure SetSummaryFooter(Value: TcxTreeListColumnSummaryFooter); + procedure SetVisible(Value: Boolean); + procedure SetWidth(Value: Integer); + protected + // container metods + procedure DoSizeChanged; virtual; + function CanInitEditing: Boolean; override; + function CanMoving: Boolean; virtual; + function CanFocus: Boolean; override; + function CanSorted: Boolean; virtual; + function GetHeaderFooterBestfitSize: Integer; virtual; + function GetOptionsClass: TcxCustomEditContainerItemOptionsClass; override; + function GetRealSortOrder: TcxDataSortOrder; virtual; + function GetState(Index: Integer): Boolean; + function GetStylesClass: TcxEditContainerStylesClass; override; + function GetSummaryFooterClass: TcxTreeListColumnSummaryFooterClass; virtual; + procedure SetEditingControl(Value: TcxEditingControl); override; + procedure SetName(const Value: TComponentName); override; + procedure SetParentComponent(Value: TComponent); override; + procedure SetState(Index: Integer; Value: Boolean); + // IcxTreeListDragSizing implementation + function CanSizing(ADirection: TcxDragSizingDirection): Boolean; virtual; + function GetAvailableMaxWidth: Integer; virtual; + function GetRealMinSize: Integer; + function GetSizingBoundsRect(ADirection: TcxDragSizingDirection): TRect; virtual; + function GetSizingIncrement(ADirection: TcxDragSizingDirection): Integer; virtual; + function IsDynamicUpdate: Boolean; virtual; + procedure SetSizeDelta(ADirection: TcxDragSizingDirection; ADelta: Integer); virtual; + // IcxTreeListIndexedItem + function GetItemIndex: Integer; + function GetVisibleIndex: Integer; + procedure SetItemIndex(Value: Integer); + procedure SetVisibleIndex(Value: Integer); + // IcxStoredObject + function GetObjectName: string; + function GetProperties(AProperties: TStrings): Boolean; virtual; + function GetPropertyIndex(const AName: string): Integer; + procedure GetPropertyValue(const AName: string; var AValue: Variant); virtual; + procedure SetPropertyValue(const AName: string; const AValue: Variant); virtual; + // column metods + procedure DoGetDisplayText(ARecordIndex: Integer; var AText: string); override; + function DoGetNodeDisplayText(ANode: TcxTreeListNode; const AValue: Variant): Variant; virtual; + function DoOnGetDisplayText(ANode: TcxTreeListNode; AsText: Boolean = False; + AValueOnly: Boolean = False): Variant; virtual; + procedure DoVisibilityChanged; virtual; + function GetCellHeight(ANode: TcxTreeListNode; AWidth, ALines: Integer; + AFont: TFont; const AValue: Variant): Integer; + function GetPositionClass: TcxTreeListColumnPositionClass; virtual; + function GetViewInfoClass: TcxTreeListColumnViewInfoClass; virtual; + function HasDataTextHandler: Boolean; override; + procedure InitAutoWidthItem(AItem: TcxAutoWidthItem); virtual; + procedure InternalSetBandOwner(ABand: TcxTreeListBand; RemoveFromOwner: Boolean); virtual; + function IsBandAssigned: Boolean; + procedure PositionChanged; + procedure UpdateIndexesBeforeRemove; + + property Data: Integer read FData write FData; + property IsFixed: Boolean read GetIsFixed; + property ViewInfo: TcxTreeListColumnViewInfo read FViewInfo; + property Controller; + property EditingControl; + property EditViewData; + property OnChangeName: TNotifyEvent read FOnChangeName write FOnChangeName; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure ApplyBestFit; + function GetParentComponent: TComponent; override; + function HasParent: Boolean; override; + procedure MakeVisible; + procedure RestoreDefaults; virtual; + procedure RestoreWidths; virtual; + property DisplayTexts[Index: Integer]: string read GetDisplayText; + property DisplayWidth: Integer read GetDisplayWidth; + property IndentWidth: Integer read GetIndentWidth; + property IsHidden: Boolean read GetIsHidden; + property IsLeft: Boolean read GetIsLeft; + property IsLeftMost: Boolean read GetIsLeftMost; + property IsRightMost: Boolean read GetIsRightMost; + property IsPreview: Boolean read GetIsPreview write SetIsPreview; + property IsRight: Boolean read GetIsRight; + property OwnerBand: TcxTreeListBand read FOwnerBand write SetOwnerBand; + property OwnerBandRow: TcxTreeListBandRow read GetOwnerBandRow; + property PropertiesValue; + property RealMinWidth: Integer read GetRealMinWidth; + property RealWidth: Integer read GetRealWidth; + property TreeList: TcxCustomTreeListControl read GetTreeList; + property Visibility: Boolean read GetVisibility; + property VisibleIndex: Integer read GetVisibleIndex; + property VisibleIndexAtBand: Integer read FVisibleIndexAtBand; + property Editing; + property EditValue; + property Focused; + property ItemIndex read GetItemIndex write SetItemIndex; + property Value; + property ValueCount; + property Values; + published + property Visible: Boolean read GetVisible write SetVisible default True; + property Caption: TcxTreeListCaption read FCaption write SetCaption; + property DataBinding: TcxItemDataBinding read GetDataBinding write SetDataBinding; + property MinWidth: Integer read FMinWidth write SetMinWidth default cxTreeListDefMinWidth; + property Options: TcxTreeListColumnOptions read GetOptions write SetOptions; + property Width: Integer read GetWidth write SetWidth stored GetIsWidthStored; + property Position: TcxTreeListColumnPosition read FPosition write SetPosition; + property SortOrder: TcxDataSortOrder read FSortOrder write SetSorted default soNone; + property Styles: TcxTreeListColumnStyles read GetStyles write SetStyles; + property SummaryFooter: TcxTreeListColumnSummaryFooter read FSummaryFooter write SetSummaryFooter; + property OnGetDisplayText: TcxTreeListOnGetDisplayTextEvent read FOnGetDisplayText write FOnGetDisplayText; + property OnGetEditingProperties: TcxTreeListGetEditPropertiesEvent read GetEditingProperties write SetEditingProperties; + property OnGetEditProperties: TcxTreeListGetEditPropertiesEvent read GetEditProperties write SetEditProperties; + property PropertiesClassName; + property Properties; + property PropertiesEvents; + property RepositoryItem; + end; + + TcxTreeListColumnClass = class of TcxTreeListColumn; + + { TcxTreeListDragAndDropObject } + + TcxTreeListDragDropInfo = class + public + DropPos: TPoint; + Accepted: Boolean; + end; + + TcxTreeListDragDropInfoClass = class of TcxTreeListDragDropInfo; + + TcxTreeListHeaderDragDropInfo = class(TcxTreeListDragDropInfo) + public + DropBand: TcxTreeListBand; + DropViewInfo: TcxTreeListHeaderViewInfo; + IsInsertRow: Boolean; + ColIndex: Integer; + RowIndex: Integer; + end; + + TcxTreeListDragAndDropObject = class(TcxCustomControlDragAndDropObject) + private + function CanDropHeaderObject: Boolean; + function GetDragBand: TcxTreeListBand; + function GetDragColumn: TcxTreeListColumn; + function GetDragItem: TObject; + function GetHitTest: TcxTreeListHitTest; + function GetPainter: TcxTreeListControlPainter; + function GetTreeList: TcxCustomTreeListControl; + procedure InitDropBandInfo; + procedure InitDropColumnInfo; + protected + ScreenArrows: TcxPlaceArrows; + DragDropInfo: TcxTreeListDragDropInfo; + PrevColIndex: Integer; + ArrowBaseLine: TRect; + procedure BeginDragAndDrop; override; + function GetDisplayRect: TRect; override; + function GetDragAndDropCursor(Accepted: Boolean): TCursor; override; + procedure ChangeArrowPos(const ABaseLine: TRect; AllowHide: Boolean); + function CheckCustomizingBox(const APos: TPoint): Boolean; + function CheckDropPos(ADragIndex, ADropIndex, DragX, DropX: Integer; + var APos: Integer; var ASide: TcxBorder; ACheckIndex: Boolean = True): Boolean; + procedure DoDrawHeaderItem(AItem: TcxTreeListHeaderViewInfo); + procedure DoDrawArrows; + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); override; + procedure DropHeaderItem; virtual; + procedure DropNodes; virtual; + procedure EndDragAndDrop(Accepted: Boolean); override; + function GetAcceptedRect: TRect; override; + function GetArrowBaseLine(const ARect: TRect; ASide: TcxBorder): TRect; + procedure GetArrowRects(out R1, R2: TRect); + function GetDragDropInfoClass: TcxTreeListDragDropInfoClass; virtual; + procedure InitDropHeaderInfo; virtual; + procedure InitDropInfo(const P: TPoint); virtual; + function IsValidForDrop(AIndex, ADropIndex: Integer; PosIsGreater: Boolean): Boolean; + procedure Paint; override; + procedure RestoreArrows; + procedure RestorePosition; + procedure StorePosition; + property DragItem: TObject read GetDragItem; + property Painter: TcxTreeListControlPainter read GetPainter; + public + destructor Destroy; override; + function IsDragBand: Boolean; + function IsDragColumn: Boolean; + property DragBand: TcxTreeListBand read GetDragBand; + property DragColumn: TcxTreeListColumn read GetDragColumn; + property HitTest: TcxTreeListHitTest read GetHitTest; + property TreeList: TcxCustomTreeListControl read GetTreeList; + end; + + { TcxTreeListCellNavigator } + + TcxTreeListCellNavigator = class(TcxCustomCellNavigator) + private + function GetCellIndex(AColumn: TcxTreeListColumn; ABandRow: TcxTreeListBandRow): Integer; + function GetFocusedNode: TcxTreeListNode; + function GetTreeList: TcxCustomTreeListControl; + function GoToNextCellInBand(AForward: Boolean; AColumn: TcxTreeListColumn; var ACellIndex: Integer): Boolean; + function GoToNextNodeCell(AForward: Boolean; ANode: TcxTreeListNode; AColumn: TcxTreeListColumn; var ACellIndex: Integer): Boolean; + protected + procedure AppendRecord(var ARowIndex, ACellIndex: Integer); + procedure CalcNextRow(AForward: Boolean; var ARowIndex, ACellIndex: Integer); override; + function GetCount(ARecordIndex: Integer): Integer; override; + function GetCellContainer(ARowIndex, ACellIndex: Integer): TcxCustomInplaceEditContainer; override; + procedure Init(var ARowIndex, ACellIndex, ARowCount: Integer); override; + function IsGroupRow(ARowIndex: Integer): Boolean; + function SelectCell(AForward, ANextRow: Boolean; + var ARowIndex, ACellIndex: Integer): TcxCustomInplaceEditContainer; override; + procedure SetFocusCell(ARowIndex, ACellIndex: Integer; AShift: TShiftState); override; + property TreeList: TcxCustomTreeListControl read GetTreeList; + property FocusedNode: TcxTreeListNode read GetFocusedNode; + public + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure Refresh; override; + end; + + { TcxTreeListController } + + TcxTreeListController = class(TcxCustomControlController) + private + function GetDataController: TcxControlDataController; + function GetFocusedNode: TcxTreeListNode; + function GetHitTest: TcxTreeListHitTest; + function GetIsControllerEvent: Boolean; + function GetOptionsBehavior: TcxTreeListOptionsBehavior; + function GetSelection: TList; + function GetSelectionAnchor: TcxTreeListNode; + function GetTreeList: TcxCustomTreeListControl; + procedure SetIsControllerEvent(Value: Boolean); + procedure SetFocusedNode(ANode: TcxTreeListNode); + protected + BlockFocusChanged: Boolean; + DragNodesList: TList; + DragColumn: TcxTreeListColumn; + DragNode: TcxTreeListNode; + ForceFocusedRecord: Integer; + ForceWidthItem: TObject; + PrevTopVisibleIndex: Integer; + PrevHotShift, CurrentShiftState: TShiftState; + IncSearchText: string; + IncSearchNode: TcxTreeListNode; + IsControllerEventRefCount: Integer; + IsDragDropProcess: Boolean; + IsInIncSearchChanging: Boolean; + IsShiftPressed: Boolean; + PrevCursor: TCursor; + ResizeDirection: TcxDragSizingDirection; + SelectionAnchorNode: TcxTreeListNode; + ShowEditOnMouseUp: Boolean; + HotTrackNode: TcxTreeListNode; + // DragDrop fields + ExpandingNode: TcxTreeListNode; + ExpandTimer: TTimer; + ScrollControllers: array[TcxBorder] of TcxAutoScrollingObject; + procedure BeforeShowEdit; override; + procedure CheckEdit; override; + function CheckAutoScrolling(const APoint: TPoint): Boolean; virtual; + procedure CheckHitItemOnMouseDown(X, Y: Integer; Shift: TShiftState); virtual; + procedure SetFocusedRecordIndex(Value: Integer); override; + // Drag drop + procedure BeforeStartDrag; override; + procedure CheckButtonTimer; virtual; + procedure DragDrop(Source: TObject; X, Y: Integer); override; + procedure DragEnter; virtual; + procedure DragLeave; virtual; + procedure DragMove(Source: TObject; const P: TPoint; var Accepted: Boolean); virtual; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); override; + procedure DropTo(ANode: TcxTreeListNode; AsChildren: Boolean); virtual; + procedure EndDrag(Target: TObject; X, Y: Integer); override; + procedure OnExpandTimer(Sender: TObject); virtual; + procedure ResetButtonTimer; + // + + procedure DoChangeColumnSortOrder(AColumn: TcxTreeListColumn; + ASortOrder: TcxDataSortOrder; AShift: TShiftState); virtual; + procedure DoNextNode(AForward: Boolean); + procedure DoNextPage(AForward: Boolean; Shift: TShiftState); override; + procedure DoShowNextPageEx(AGoForward, ASetCursor: Boolean; + AShift: TShiftState); virtual; + procedure FocusedRecordChanged(APrevFocusedRecordIndex, AFocusedRecordIndex: Integer); override; + procedure FocusedItemChanged(APrevFocusedItem: TcxCustomInplaceEditContainer); override; + function IsDragMode: Boolean; + function IsKeyForController(AKey: Word; AShift: TShiftState): Boolean; override; + function IsNodeKeyHandle(ANode: TcxTreeListNode; + var AKey: Word; Shift: TShiftState): Boolean; virtual; + function GetCellFromViewInfo(AColumn: TcxTreeListColumn; ANodeViewInfo: TcxTreeListNodeViewInfo): TcxTreeListEditCellViewInfo; virtual; + function GetCellFromViewInfoEx(AColumn: TcxTreeListColumn; ANode: TcxTreeListNode): TcxTreeListEditCellViewInfo; virtual; + function GetFocusedCellViewInfo(AEditContainer: TcxCustomInplaceEditContainer): TcxEditCellViewInfo; override; + function GetNavigatorClass: TcxCustomCellNavigatorClass; override; + function GetNode(ARecordIndex: Integer): TcxTreeListNode; + function GetResizeDirection: TcxDragSizingDirection; override; + procedure MouseLeave; override; + procedure DoCancelMode; override; + function ValidateShift(Shift: TShiftState): TShiftState; + procedure UpdateRecord(ARecordIndex: Integer); override; + // incsearch + procedure CancelIncSearching; override; + function DoSearch(AFromNode: TcxTreeListNode; AItemIndex: Integer; + const AText: string; AGoForward: Boolean): Boolean; virtual; + function GetIncSearchingItem: TcxCustomInplaceEditContainer; override; + function GetIncSearchingText: string; override; + function GetIsIncSearching: Boolean; override; + function GetNextIncSearchNode(ANode: TcxTreeListNode; AGoForward: Boolean): TcxTreeListNode; + procedure SearchCheck(AItemFound: Boolean); + procedure SearchLocate(AItem: TcxCustomInplaceEditContainer; const Value: string); override; + procedure SearchLocateNext(AItem: TcxCustomInplaceEditContainer; AForward: Boolean); override; + procedure UpdateNodeIncSearchingCell(ANode: TcxTreeListNode); + // design selection + procedure SelectionTimerHandler(ASender: TObject); + function CanCreateSelectionHelper: Boolean; + function IsObjectSelected(AObject: TPersistent): Boolean; virtual; + procedure SelectObject(AObject: TPersistent; AShift: TShiftState); virtual; + procedure UnselectObject(AObject: TPersistent); virtual; + // selection + procedure CancelSelection(KeepPrimary: Boolean = True); + procedure Select(ANode: TcxTreeListNode; Shift: TShiftState); virtual; + property IsControllerEvent: Boolean read GetIsControllerEvent write SetIsControllerEvent; + property SelectionAnchor: TcxTreeListNode read GetSelectionAnchor; + property Selection: TList read GetSelection; + property DataController: TcxControlDataController read GetDataController; + public + procedure AfterPaint; override; + procedure BeforePaint; override; + procedure BeforeMouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure BeginDragAndDrop; override; + function CanDrag(X, Y: Integer): Boolean; override; + function CanDeleteSelection: Boolean; + function CanInsertNode: Boolean; + procedure ControlFocusChanged; override; + procedure DblClick; override; + function DeleteConfirmation: Boolean; + procedure DoMouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure DoMouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure EndDragAndDrop(Accepted: Boolean); override; + function HitAtNodeEx: Boolean; + function GetCursor(X, Y: Integer): TCursor; override; + function GetDragAndDropObjectClass: TcxDragAndDropObjectClass; override; + function GetImmediateEditor: Boolean; override; + function IsDragCopy: Boolean; virtual; + function IsDestroying: Boolean; virtual; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + procedure MakeFocusedItemVisible; override; + procedure MakeFocusedRecordVisible; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); override; + procedure SetFocusedRecordItem(ARecordIndex: Integer; + AItem: TcxCustomInplaceEditContainer); override; + procedure SetHotTrackCursor(ACursor: TCursor); + procedure SetHotTrackNode(ANode: TcxTreeListNode; AShift: TShiftState); + function StartDragAndDrop(const P: TPoint): Boolean; override; + procedure UpdateHotTrackNode(AShift: TShiftState); overload; + procedure UpdateHotTrackNode(X, Y: Integer; AShift: TShiftState); overload; + property HitTest: TcxTreeListHitTest read GetHitTest; + property FocusedNode: TcxTreeListNode read GetFocusedNode write SetFocusedNode; + property OptionsBehavior: TcxTreeListOptionsBehavior read GetOptionsBehavior; + property TreeList: TcxCustomTreeListControl read GetTreeList; + end; + + { TcxTreeListHitTest } + + TcxTreeListHitTest = class(TcxCustomHitTestController) + private + FHitBand: TcxTreeListBand; + FHitColumn: TcxTreeListColumn; + FHitNode: TcxTreeListNode; + FPressedHeader: TcxTreeListHeaderViewInfo; + FSizingHitNode: TcxTreeListNode; + function CheckHitInBand(AViewInfo: TcxTreeListBandViewInfo): Boolean; + function CheckHitInColumn(AViewInfo: TcxTreeListColumnViewInfo): Boolean; + function CheckHitInNode(AViewInfo: TcxTreeListNodeViewInfo): Boolean; + function HitInGroup(AViewInfo: TcxTreeListCellsGroupViewInfo): Boolean; + function HitInGroups(AViewInfo: TcxTreeListNodeViewInfo): Boolean; + function HitInIndent(AViewInfo: TcxTreeListNodeViewInfo): Boolean; + function HitInItem(AItem: TcxCustomViewInfoItem; AState: Integer; ADelta: Integer = 0): Boolean; + function GetHitAtImages: Boolean; + function GetTreeList: TcxCustomTreeListControl; + function GetViewInfo: TcxTreeListViewInfo; + protected + FLockUpdate: Boolean; + FNewHitTestItem: TObject; + function AllowDesignMouseEvents(X, Y: Integer; AShift: TShiftState): Boolean; override; + procedure DoCalculate; override; + function Check(const ARect: TRect): Boolean; + function CheckHitInBands: Boolean; virtual; + function CheckHitInNodes: Boolean; + function GetCurrentCursor: TCursor; override; + function GetHitTestItem: TObject; virtual; + function GetState(Index: Integer): Boolean; + procedure HitTestItemChanged(APrevHitTestItem: TObject); override; + procedure SetHitState(Index: Integer; Value: Boolean); + procedure Update; virtual; + property PressedHeader: TcxTreeListHeaderViewInfo read FPressedHeader; + property SizingHitNode: TcxTreeListNode read FSizingHitNode; + property ViewInfo: TcxTreeListViewInfo read GetViewInfo; + public + function CanMoving: Boolean; virtual; + function CanSizing: Boolean; overload; + function CanSizing(var ASizeDirection: TcxDragSizingDirection): Boolean; overload; virtual; + property CurrentCursor: TCursor read GetCurrentCursor; + property HitAtBand: Boolean index tlhc_HitAtBand read GetState; + property HitAtBandContainer: Boolean index tlhc_HitAtBandContainer read GetState; + property HitAtBandHeader: Boolean index tlhc_HitAtBandHeader read GetState; + property HitAtButton: Boolean index tlhc_HitAtButton read GetState; + property HitAtColumn: Boolean index tlhc_HitAtColumn read GetState; + property HitAtColumnHeader: Boolean index tlhc_HitAtColumnHeader read GetState; + property HitAtFooter: Boolean index tlhc_HitAtFooter read GetState; + property HitAtFooterItem: Boolean index tlhc_HitAtFooterItem read GetState; + property HitAtImage: Boolean index tlhc_HitAtImage read GetState; + property HitAtImages: Boolean read GetHitAtImages; + property HitAtIndent: Boolean index tlhc_HitAtIndent read GetState; + property HitAtIndicator: Boolean index tlhc_HitAtIndicator read GetState; + property HitAtStateImage: Boolean index tlhc_HitAtStateImage read GetState; + property HitAtNode: Boolean index tlhc_HitAtNode read GetState; + property HitAtNodePreview: Boolean index tlhc_HitAtNodePreview read GetState; + property HitAtSeparator: Boolean index tlhc_HitAtSeparator read GetState; + property HitAtSizingHorz: Boolean index tlhc_HitAtSizingHorz read GetState; + property HitAtSizingVert: Boolean index tlhc_HitAtSizingVert read GetState; + property HitBand: TcxTreeListBand read FHitBand; + property HitColumn: TcxTreeListColumn read FHitColumn; + property HitNode: TcxTreeListNode read FHitNode; + property TreeList: TcxCustomTreeListControl read GetTreeList; + end; + + { TcxTreeListViewInfoItem } + + TcxTreeListSeparators = array[0..1] of TRect; + + TcxTreeListViewInfoItem = class(TcxCustomViewInfoItem, IUnknown) + private + FBrush: TBrush; + function GetBrushManager: TcxBrushCache; + function GetControlViewInfo: TcxTreeListViewInfo; + function GetHitTest: TcxTreeListHitTest; + function GetOptionsView: TcxTreeListOptionsView; + function GetPainterClass: TcxCustomLookAndFeelPainterClass; + function GetTreeList: TcxCustomTreeListControl; + protected + procedure Calculate(const ADisplayRect, AVisibleRect: TRect); virtual; + procedure DoCalculate; override; + procedure DoHorzOffset(AShift: Integer); override; + procedure DoVertOffset(AShift: Integer); override; + function ShiftItem(const AVisibleRect: TRect; DX, DY: Integer): Boolean; + // IUnknown + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + property Brush: TBrush read FBrush; + property BrushManager: TcxBrushCache read GetBrushManager; + property OptionsView: TcxTreeListOptionsView read GetOptionsView; + property ControlViewInfo: TcxTreeListViewInfo read GetControlViewInfo; + public + constructor Create(AOwner: TObject); override; + destructor Destroy; override; + property TreeList: TcxCustomTreeListControl read GetTreeList; + property HitTest: TcxTreeListHitTest read GetHitTest; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetPainterClass; + end; + + { TcxTreeListIndicatorViewInfo } + + TcxTreeListIndicatorViewInfo = class(TcxTreeListViewInfoItem) + private + FKind: TcxIndicatorKind; + FNode: TcxTreeListNode; + protected + procedure Calculate(const ADisplayRect, AVisibleRect: TRect); override; + procedure DoCalculate; override; + procedure DoVertOffset(AShift: Integer); override; + function GetControl: TcxEditingControl; override; + procedure UpdateKind(AKind: TcxIndicatorKind); + public + property Node: TcxTreeListNode read FNode; + property Kind: TcxIndicatorKind read FKind; + property TreeList; + end; + + TcxTreeListIndicatorViewInfoClass = class of TcxTreeListIndicatorViewInfo; + + { TcxTreeListFooterItemViewInfo } + + TcxTreeListFooterItemViewInfo = class(TcxTreeListViewInfoItem) + private + function GetAlignHorz: TAlignment; + function GetAlignVert: TcxAlignmentVert; + function GetBandViewInfo: TcxTreeListBandViewInfo; + function GetColumn: TcxTreeListColumnViewInfo; + function GetFooterSummary: TcxTreeListColumnSummaryFooter; + function GetMultiLine: Boolean; + function GetText: string; + function GetVisible: Boolean; + protected + procedure DoHorzOffset(DX: Integer); override; + function GetControl: TcxEditingControl; override; + property FooterSummary: TcxTreeListColumnSummaryFooter read GetFooterSummary; + public + property Column: TcxTreeListColumnViewInfo read GetColumn; + property AlignHorz: TAlignment read GetAlignHorz; + property AlignVert: TcxAlignmentVert read GetAlignVert; + property BandViewInfo: TcxTreeListBandViewInfo read GetBandViewInfo; + property MultiLine: Boolean read GetMultiLine; + property Text: string read GetText; + property Visible: Boolean read GetVisible; + property TreeList; + end; + + { TcxTreeListHeaderViewInfo } + + TcxTreeListHeaderViewInfo = class(TcxTreeListViewInfoItem, IcxDragSizing, IcxHotTrackElement) + private + FBorders: TcxBorders; + FGlyphPos: TPoint; + FNeighbors: TcxNeighbors; + FPressed: Boolean; + FState: TcxButtonState; + procedure CustomDrawEvent(var AEvent: TcxCustomDrawViewInfoItemEvent); virtual; + function GetAlignHorz: TAlignment; + function GetAlignVert: TcxAlignmentVert; + function GetBand: TcxTreeListBand; + function GetBandViewInfo: TcxTreeListBandViewInfo; virtual; + function GetButtonState: TcxButtonState; + function GetCaption: TcxTreeListCaption; virtual; + function GetGlyph: TBitmap; + function GetGlyphAlignHorz: TAlignment; + function GetGlyphAlignVert: TcxAlignmentVert; + function GetHotTrack: Boolean; + function GetState(Index: Integer): Boolean; + function GetText: string; + procedure SetPressed(Value: Boolean); + protected + FCallHintNeeded: Integer; + FSortMarkBounds: TRect; + FTextBounds: TRect; + NeedGlyphClipping: Boolean; + procedure ButtonStateChanged(APrevIsPressed, IsPressed: Boolean); virtual; + function CanDropAt(const P: TPoint): Boolean; virtual; + procedure DoCalculate; override; + procedure DoCalculateGlyphPosition; + procedure DoHorzOffset(DX: Integer); override; + function GetDisplayRect: TRect; virtual; + function GetDragSizing: IcxDragSizing; virtual; + function GetDroppingRect: TRect; virtual; + function GetControl: TcxEditingControl; override; + function GetSelected: Boolean; virtual; + function GetSortOrder: TcxDataSortOrder; virtual; + procedure InitViewParams; virtual; + procedure UpdateState; + // IcxHotTrackElement + function GetOrigin: TPoint; virtual; + function IsNeedHint(ACanvas: TcxCanvas; const P: TPoint; out AText: TCaption; + out AIsMultiLine: Boolean; out ATextRect: TRect; var IsNeedOffsetHint: Boolean): Boolean; virtual; + procedure UpdateHotTrackState(const APoint: TPoint); virtual; + property BandViewInfo: TcxTreeListBandViewInfo read GetBandViewInfo; + property Caption: TcxTreeListCaption read GetCaption; + property DragSizing: IcxDragSizing read GetDragSizing implements IcxDragSizing; + property Pressed: Boolean read FPressed write SetPressed; + property SortMarkBounds: TRect read FSortMarkBounds; + property SortOrder: TcxDataSortOrder read GetSortOrder; + public + destructor Destroy; override; + property AlignHorz: TAlignment read GetAlignHorz; + property AlignVert: TcxAlignmentVert read GetAlignVert; + property Band: TcxTreeListBand read GetBand; + property Borders: TcxBorders read FBorders; + property Glyph: TBitmap read GetGlyph; + property GlyphAlignHorz: TAlignment read GetGlyphAlignHorz; + property GlyphAlignVert: TcxAlignmentVert read GetGlyphAlignVert; + property GlyphPos: TPoint read FGlyphPos; + property ShowEndEllipsis: Boolean index 1 read GetState; + property HotTrack: Boolean read GetHotTrack; + property MultiLine: Boolean index 2 read GetState; + property Neighbors: TcxNeighbors read FNeighbors; + property Selected: Boolean read GetSelected; + property State: TcxButtonState read FState; + property Text: string read GetText; + property TextBounds: TRect read FTextBounds; + property TreeList; + end; + + { TcxTreeListColumnHeaderViewInfo } + + TcxTreeListColumnHeaderViewInfo = class(TcxTreeListHeaderViewInfo) + private + FIsUltraFlat: Boolean; + procedure CustomDrawEvent(var AEvent: TcxCustomDrawViewInfoItemEvent); override; + function GetBandViewInfo: TcxTreeListBandViewInfo; override; + function GetCaption: TcxTreeListCaption; override; + function GetColumn: TcxTreeListColumn; + protected + procedure ButtonStateChanged(APrevIsPressed, IsPressed: Boolean); override; + function CanDropAt(const P: TPoint): Boolean; override; + procedure DoCalculate; override; + function GetControl: TcxEditingControl; override; + function GetDisplayRect: TRect; override; + function GetDragSizing: IcxDragSizing; override; + function GetDroppingRect: TRect; override; + function GetSortOrder: TcxDataSortOrder; override; + procedure InitViewParams; override; + function GetSelected: Boolean; override; + property DragSizing; + public + property Column: TcxTreeListColumn read GetColumn; + property SortMarkBounds; + property SortOrder; + end; + + { TcxTreeListColumnHeaderViewInfo } + + TcxTreeListColumnViewInfo = class + private + FColumn: TcxTreeListColumn; + FColumnHeader: TcxTreeListColumnHeaderViewInfo; + FColumnFooter: TcxTreeListFooterItemViewInfo; + function GetBandViewInfo: TcxTreeListBandViewInfo; + function GetDisplayWidth: Integer; + function GetFooterCellsOffset: Integer; + function GetLineCount: Integer; + function GetOptionsView: TcxTreeListOptionsView; + function GetTreeList: TcxCustomTreeListControl; + protected + XOfs: Integer; + YOfs: Integer; + function CalcHeaderRect: TRect; + function CalcFooterRect: TRect; + procedure DoCalculate; virtual; + procedure DoHorzOffset(DX: Integer); virtual; + property DisplayWidth: Integer read GetDisplayWidth; + property FooterCellsOffset: Integer read GetFooterCellsOffset; + property LineCount: Integer read GetLineCount; + property OptionsView: TcxTreeListOptionsView read GetOptionsView; + public + constructor Create(AOwner: TcxTreeListColumn); virtual; + destructor Destroy; override; + property BandViewInfo: TcxTreeListBandViewInfo read GetBandViewInfo; + property Column: TcxTreeListColumn read FColumn; + property ColumnFooter: TcxTreeListFooterItemViewInfo read FColumnFooter; + property ColumnHeader: TcxTreeListColumnHeaderViewInfo read FColumnHeader; + property TreeList: TcxCustomTreeListControl read GetTreeList; + end; + + { TcxTreeListBandViewInfo } + + TcxTreeListBandViewInfo = class(TcxTreeListViewInfoItem) + private + FBandHeader: TcxTreeListHeaderViewInfo; + FCapacity: Integer; + FColumns: PPointerList; + FContainerViewParams: TcxViewParams; + FCount: Integer; + FFooterRect: TRect; + FFooterViewParams: TcxViewParams; + function GetBand: TcxTreeListBand; + function GetColumn(AIndex: Integer): TcxTreeListColumnViewInfo; + function GetDisplayWidth: Integer; + function GetFixed: TcxTreeListBandFixedKind; + protected + ContainerBrush: TBrush; + FooterBrush: TBrush; + IsOpaque: Boolean; + procedure CalcFooterRect; + procedure CheckOpaque; virtual; + procedure DoCalculate; override; + procedure DoCalculateColumns; + procedure DoHorzOffset(DX: Integer); override; + function GetControl: TcxEditingControl; override; + procedure SetCapacity(ACapacity: Integer); + property DisplayWidth: Integer read GetDisplayWidth; + public + constructor Create(AOwner: TObject); override; + destructor Destroy; override; + property Band: TcxTreeListBand read GetBand; + property BandHeader: TcxTreeListHeaderViewInfo read FBandHeader; + property ColumnCount: Integer read FCount; + property Columns[AIndex: Integer]: TcxTreeListColumnViewInfo read GetColumn; + property ContainerViewParams: TcxViewParams read FContainerViewParams; + property FooterViewParams: TcxViewParams read FFooterViewParams; + property Fixed: TcxTreeListBandFixedKind read GetFixed; + property FooterRect: TRect read FFooterRect; + property Opaque: Boolean read IsOpaque; + end; + + { TcxTreeListEditCellViewInfo } + + TcxTreeListEditCellViewInfo = class(TcxEditCellViewInfo) + private + function GetBand: TcxTreeListBand; + function GetControlViewInfo: TcxTreeListViewInfo; + function GetEditRect: TRect; + function GetGroup: TcxTreeListCellsGroupViewInfo; + function GetNode: TcxTreeListNode; virtual; + function GetNodesViewInfo: TcxTreeListNodesViewInfo; virtual; + function GetNodeViewInfo: TcxTreeListNodeViewInfo; virtual; + function GetTreeList: TcxCustomTreeListControl; virtual; + protected + GroupIndex: Integer; + FColumnViewInfo: TcxTreeListColumnViewInfo; + function ContentOffset: TRect; override; + function ChangedHeight(APrevHeight, ANewHeight: Integer): Boolean; override; + procedure CustomDrawEvent(var AEvent: TcxCustomDrawViewInfoItemEvent); virtual; + procedure DoHorzOffset(AShift: Integer); override; + procedure DoVertOffset(AShift: Integer); override; + function GetButtonTransparency: TcxEditButtonTransparency; override; + function GetColumn: TcxTreeListColumn; virtual; + function GetDisplayValue: Variant; override; + function GetEditContainer: TcxCustomInplaceEditContainer; override; + function GetEditViewParams: TcxViewParams; override; + function GetFocused: Boolean; override; + function GetHotTrack: Boolean; virtual; + function GetLineCount: Integer; virtual; + function GetLineOffset: Integer; virtual; + function GetRecordIndex: Integer; override; + function GetSelected: Boolean; virtual; + function GetSelectedTextColor: Integer; override; + function GetSelectedBKColor: Integer; override; + procedure GetTreeListEditCellParams(var AParams: TcxViewParams); virtual; + function GetViewInfoData: Pointer; override; + function IncSearchParams: TcxViewParams; + function IsAutoHeight: Boolean; override; + function IsEndEllipsis: Boolean; override; + function IsTransparent: Boolean; override; + procedure SetPosition(ATop, AHeight: Integer; const AClipRect: TRect); + procedure ShiftItem(DX, DY: Integer); virtual; + procedure UpdateViewInfoPosition; + property ControlViewInfo: TcxTreeListViewInfo read GetControlViewInfo; + property LineCount: Integer read GetLineCount; + property LineOffset: Integer read GetLineOffset; + property NodesViewInfo: TcxTreeListNodesViewInfo read GetNodesViewInfo; + property NodeViewInfo: TcxTreeListNodeViewInfo read GetNodeViewInfo; + public + procedure Assign(Source: TcxCustomViewInfoItem); override; + property Column: TcxTreeListColumn read GetColumn; + property EditRect: TRect read GetEditRect; + property Group: TcxTreeListCellsGroupViewInfo read GetGroup; + property Band: TcxTreeListBand read GetBand; + property Node: TcxTreeListNode read GetNode; + property Selected: Boolean read GetSelected; + property TreeList: TcxCustomTreeListControl read GetTreeList; + property HotTrack: Boolean read GetHotTrack; + end; + + { TcxTreeListGroupNodeEditViewInfo } + + TcxTreeListGroupNodeEditViewInfo = class(TcxTreeListEditCellViewInfo) + private + function GetCellRect: TRect; + protected + function ChangedHeight(APrevHeight, ANewHeight: Integer): Boolean; override; + procedure DoCalculate; override; + function GetColumn: TcxTreeListColumn; override; + procedure ShiftItem(DX, DY: Integer); override; + procedure Update; virtual; + end; + + { TcxTreeListNodePreviewViewInfo } + + TcxTreeListNodePreviewViewInfo = class(TcxTreeListEditCellViewInfo) + private + function GetPreviewRect: TRect; + protected + Preview: TcxTreeListPreview; + PreviewHeight: Integer; + function ChangedHeight(APrevHeight, ANewHeight: Integer): Boolean; override; + function CheckPreviewHeight(DH: Integer): Integer; + function ContentOffset: TRect; override; + procedure CustomDrawEvent(var AEvent: TcxCustomDrawViewInfoItemEvent); override; + procedure DoCalculate; override; + procedure DoInitPreviewSettings(APreviewOffset: Integer); virtual; + function GetButtonTransparency: TcxEditButtonTransparency; override; + function GetColumn: TcxTreeListColumn; override; + function GetHotTrack: Boolean; override; + function GetLineCount: Integer; override; + function GetLineOffset: Integer; override; + function GetMaxLineCount: Integer; override; + procedure GetTreeListEditCellParams(var AParams: TcxViewParams); override; + function IsAutoHeight: Boolean; override; + procedure ShiftItem(DX, DY: Integer); override; + procedure Update; virtual; + public + constructor Create(AOwner: TObject); override; + property Height: Integer read PreviewHeight; + end; + + TcxTreeListNodePreviewViewInfoClass = class of TcxTreeListNodePreviewViewInfo; + + { TcxTreeListCellsGroupViewInfo } + + TcxTreeListCellsGroupViewInfo = class(TcxTreeListViewInfoItem) + private + function GetBand: TcxTreeListBand; + function GetCell(Index: Integer): TcxTreeListEditCellViewInfo; + function GetCellsHeight: Integer; + function GetCount: Integer; + function GetCurrentBrush: TBrush; + function GetFixed: Boolean; + function GetNode: TcxTreeListNode; + function GetNodeViewInfo: TcxTreeListNodeViewInfo; + function GetNodesViewInfo: TcxTreeListNodesViewInfo; + procedure CalculateEditCellRect(ACell: TcxTreeListEditCellViewInfo; AMostLeftPos: Integer); + protected + IsOpaque: Boolean; + BandViewInfo: TcxTreeListBandViewInfo; + Borders: TcxBorders; + Indent: Integer; + FirstIndex, LastIndex: Integer; + procedure DoCalculate; override; + procedure DoCalculateCellsLayout; virtual; + procedure DoHorzOffset(AShift: Integer); override; + procedure DoVertOffset(AShift: Integer); override; + function GetControl: TcxEditingControl; override; + function GetHotTrack: Boolean; virtual; + function GetSelected: Boolean; virtual; + function GetGroupBitmap: TBitmap; virtual; + procedure SetSize(ATop, AHeight: Integer); virtual; + procedure ShiftGroup(DX, DY: Integer); virtual; + property CellsHeight: Integer read GetCellsHeight; + property CurrentBrush: TBrush read GetCurrentBrush; + property NodesViewInfo: TcxTreeListNodesViewInfo read GetNodesViewInfo; + property NodeViewInfo: TcxTreeListNodeViewInfo read GetNodeViewInfo; + property Fixed: Boolean read GetFixed; + public + procedure Assign(Source: TcxCustomViewInfoItem); override; + property Band: TcxTreeListBand read GetBand; + property CellCount: Integer read GetCount; + property Cells[Index: Integer]: TcxTreeListEditCellViewInfo read GetCell; + property Node: TcxTreeListNode read GetNode; + property Opaque: Boolean read IsOpaque; + property Selected: Boolean read GetSelected; + property HotTrack: Boolean read GetHotTrack; + end; + + { TcxTreeListIndentViewInfo } + + TcxTreeListLevelTreeLine = (tltVertUp, tltVertDown, tltHorz); + TcxTreeListLevelTreeLines = set of TcxTreeListLevelTreeLine; + + TcxTreeListIndentViewInfo = class(TcxTreeListViewInfoItem) + private + function GetButtonRect: TRect; + function GetIsExpanded: Boolean; + function GetNextVisible: TcxTreeListNodeViewInfo; + function GetNode: TcxTreeListNode; + function GetNodeViewInfo: TcxTreeListNodeViewInfo; + function GetNodesViewInfo: TcxTreeListNodesViewInfo; + function GetPrevVisible: TcxTreeListNodeViewInfo; + protected + IndentBorders: TcxBorders; + IndentHasImage: Boolean; + IndentHasExpandButton: Boolean; + IndentHorzTreeLine: TRect; + IndentImageIndex: Integer; + IndentStateImage: Boolean; + IndentImageList: TCustomImageList; + IndentIsLevel: Boolean; + IndentLevel: Integer; + IndentLevelNode: TcxTreeListNode; + IndentTreeLines: TcxTreeListLevelTreeLines; + IndentVertTreeLine: TRect; + procedure DoCalculate; override; + procedure DoHorzOffset(AShift: Integer); override; + procedure DoVertOffset(AShift: Integer); override; + function GetControl: TcxEditingControl; override; + procedure ShiftIndent(DX, DY: Integer); virtual; + procedure UpdateImageIndex; + property NextVisible: TcxTreeListNodeViewInfo read GetNextVisible; + property NodesViewInfo: TcxTreeListNodesViewInfo read GetNodesViewInfo; + property NodeViewInfo: TcxTreeListNodeViewInfo read GetNodeViewInfo; + property PrevVisible: TcxTreeListNodeViewInfo read GetPrevVisible; + property Brush; + public + property Borders: TcxBorders read IndentBorders; + property ButtonRect: TRect read GetButtonRect; + property HasButton: Boolean read IndentHasExpandButton; + property HasImage: Boolean read IndentHasImage; + property HorzTreeLine: TRect read IndentHorzTreeLine; + property IsExpanded: Boolean read GetIsExpanded; + property IsLevel: Boolean read IndentIsLevel; + property Level: Integer read IndentLevel; + property LevelNode: TcxTreeListNode read IndentLevelNode; + property Node: TcxTreeListNode read GetNode; + property TreeLines: TcxTreeListLevelTreeLines read IndentTreeLines; + property VertTreeLine: TRect read IndentVertTreeLine; + property ImageIndex: Integer read IndentImageIndex; + property ImageList: TCustomImageList read IndentImageList; + property ViewParams; + property TreeList; + end; + + { TcxTreeListNodeViewInfo } + + TcxTreeListNodeViewInfo = class + private + // subitems lists + FGroups: TList; + FCells: TList; + FIndents: TList; + // sub items + FIndicator: TcxTreeListIndicatorViewInfo; + FPreview: TcxTreeListNodePreviewViewInfo; + // other + FOwner: TcxTreeListNodesViewInfo; + function GetCell(Index: Integer): TcxTreeListEditCellViewInfo; + function GetCellCount: Integer; + function GetControlViewInfo: TcxTreeListViewInfo; + function GetFocusRect: TRect; + function GetGroup(Index: Integer): TcxTreeListCellsGroupViewInfo; + function GetGroupCount: Integer; + function GetHotTrack: Boolean; + function GetIndent(Index: Integer): TcxTreeListIndentViewInfo; + function GetIndentCount: Integer; + function GetIndentWidth: Integer; + function GetOptionsView: TcxTreeListOptionsView; + function GetRealHeight: Integer; + function GetTreeList: TcxCustomTreeListControl; + function GetVisibleIndex: Integer; + function GetVisibleRect(AFixed: Boolean): TRect; + function AddGroup(AInfo: TcxTreeListBandViewInfo; var AIndex, AOfs: Integer): TcxTreeListCellsGroupViewInfo; + procedure AddCell(AInfo: TcxTreeListColumnViewInfo; var AGroupIndex, AIndex: Integer); + procedure CalculateIndentInfo(AIndent: TcxTreeListIndentViewInfo; + var ANode: TcxTreeListNode; ALevel: Integer; var ALeft: Integer); + procedure UpdateContentRects; + procedure UpdateLinks; + protected + ViewInfoNode: TcxTreeListNode; + NodeCellsCalculated: Boolean; + NodeFocused: Boolean; + NodeHasButton: Boolean; + NodeHasPreview: Boolean; + NodeSelected: Boolean; + NodeVisible: Boolean; + NodeIsGroup: Boolean; + NodeIsExpanded: Boolean; + NodeBorders: TcxBorders; + NodeLevel: Integer; + NodeGroupEditViewInfo: TcxTreeListGroupNodeEditViewInfo; + NodeFocusedCell: TcxTreeListEditCellViewInfo; + NodeNextVisible: TcxTreeListNodeViewInfo; + NodePrevVisible: TcxTreeListNodeViewInfo; + // size and position variables + NodeIndentLeft: Integer; + NodeCellsRect: TRect; // cells only + NodeClipRect: TRect; // visible content only + NodeContentRect: TRect; // cells + preview + indicator + NodeCellsOffset: Integer; + NodePreviewOffset: Integer; + // FCellHeight: Integer; + CellsMaxHeight: Integer; + CellMaxHeightRefCount: Integer; + // fixed bands viewinfo variables + LeftFixedGroup: TcxTreeListCellsGroupViewInfo; + RightFixedGroup: TcxTreeListCellsGroupViewInfo; + Separators: TcxTreeListSeparators; + // position and misc. variables + Index: Integer; + Top, Left: Integer; + UnusedArea: TRect; + procedure DoCalculate; virtual; + procedure DoCalculateAutoHeights; virtual; + procedure DoCalculateCellsViewInfo; virtual; + procedure DoCalculateImageIndents(var ALeft: Integer); virtual; + function DoCalculateIndentsLayout: Integer; virtual; + procedure DoCalculateIndentsViewInfo; virtual; + procedure DoCalculateLayout; virtual; + procedure DoHorzOffset(AShift: Integer); virtual; + procedure DoVertOffset(AShift: Integer); virtual; + function GetNodeIndicatorKind: TcxIndicatorKind; virtual; + procedure Update(ARecalculate: Boolean = False); virtual; + procedure UpdateClipping; virtual; + procedure UpdateImageIndexes; virtual; + procedure UpdatePostCalculate(ATop, AIndex: Integer); virtual; + // node view info routines + procedure ReallocateData; overload; + property ControlViewInfo: TcxTreeListViewInfo read GetControlViewInfo; + property IndentWidth: Integer read GetIndentWidth; + property Owner: TcxTreeListNodesViewInfo read FOwner; + property OptionsView: TcxTreeListOptionsView read GetOptionsView; + property RealHeight: Integer read GetRealHeight; + public + constructor Create(AOwner: TcxTreeListNodesViewInfo); virtual; + destructor Destroy; override; + procedure AssignLayoutTo(ADest: TcxTreeListNodeViewInfo); virtual; + procedure Clear; + property CellCount: Integer read GetCellCount; + property Cells[Index: Integer]: TcxTreeListEditCellViewInfo read GetCell; + property ClipRect: TRect read NodeClipRect; + property ContentRect: TRect read NodeContentRect; + property Focused: Boolean read NodeFocused; + property FocusRect: TRect read GetFocusRect; + property GroupCount: Integer read GetGroupCount; + property Groups[Index: Integer]: TcxTreeListCellsGroupViewInfo read GetGroup; + property HasButton: Boolean read NodeHasButton; + property HasPreview: Boolean read NodeHasPreview; + property HotTrack: Boolean read GetHotTrack; + property IndentCount: Integer read GetIndentCount; + property Indents[Index: Integer]: TcxTreeListIndentViewInfo read GetIndent; + property Indicator: TcxTreeListIndicatorViewInfo read FIndicator; + property IsGroupNode: Boolean read NodeIsGroup; + property IsExpanded: Boolean read NodeIsExpanded; + property Level: Integer read NodeLevel; + property NextVisible: TcxTreeListNodeViewInfo read NodeNextVisible; + property Node: TcxTreeListNode read ViewInfoNode; + property Preview: TcxTreeListNodePreviewViewInfo read FPreview; + property PreviewOffset: Integer read NodePreviewOffset; + property PrevVisible: TcxTreeListNodeViewInfo read NodePrevVisible; + property Selected: Boolean read NodeSelected; + property TreeList: TcxCustomTreeListControl read GetTreeList; + property Visible: Boolean read NodeVisible; + property VisibleIndex: Integer read GetVisibleIndex; + end; + + { TcxTreeListNodesViewInfo } + + TcxTreeListNodesViewInfo = class + private + FCapacity: Integer; + FNeedSynchronize: Boolean; + FNeedUpdatePos: Boolean; + FNodesCount: Integer; + FNodes: PPointerList; + FOwner: TcxTreeListViewInfo; + FUpdatePost: Boolean; + function GetMaxVisibleIndex: Integer; + function GetNextNodeForProcess: TcxTreeListNode; + function GetNextNodeFromViewInfo(Index: Integer): TcxTreeListNode; + function GetNodeViewInfo(Index: Integer): TcxTreeListNodeViewInfo; + function GetOptionsView: TcxTreeListOptionsView; + function GetScrollWindow: Boolean; + function GetTopVisibleIndex: Integer; + function GetTreeList: TcxCustomTreeListControl; + function ProcessAddNode(var ANode: TcxTreeListNode; var IsBreak: Boolean): Integer; + protected + CheckSelectionMode: Boolean; + ClipRect: TRect; + Count: Integer; + IndentWidth: Integer; + IsAddFirst: Boolean; + IsRowAutoHeight: Boolean; + NodesBottom: Integer; + ScrollRect: TRect; + SpaceArea: TRect; + Template: TcxTreeListNodeViewInfo; + TopNode: TcxTreeListNode; + VisibleCount: Integer; + procedure Add(ANode: TcxTreeListNode; var AHeight: Integer); virtual; + function AddNode(ANode: TcxTreeListNode): TcxTreeListNodeViewInfo; + procedure BeforeShowEdit; virtual; + procedure CalculatePreviewHeight; virtual; + procedure CancelUpdatePost; + procedure ChangeDirection; + procedure ClearState; + procedure DoCalculate(AFullRecalculate: Boolean = True); virtual; + procedure DoCalculateNextPage(AGoForward: Boolean); virtual; + procedure DoCalculateShiftUp(ALineCount: Integer); virtual; + procedure DoCalculateShiftDown(ALineCount: Integer); virtual; + procedure DoHorzOffset(AShift: Integer); virtual; + procedure DoVertOffset(AShift: Integer); virtual; + function FindNodeViewInfo(ANode: TcxTreeListNode; + var AViewInfo: TcxTreeListNodeViewInfo): Boolean; + procedure FocusedRecordChanged(APrevNode, ANewNode: TcxTreeListNode); virtual; + procedure MakeNodeVisible(ANode: TcxTreeListNode); virtual; + function MoveFirstToLatest(ACheckedOne: Boolean = True): Integer; + procedure NeedUpdatePost; + procedure NeedViewInfoUpdatePost; + function PostViewInfoUpdate: Boolean; + procedure PostUpdate; + procedure ProcessNodes(ATopNode: TcxTreeListNode; ANeedLastVisible: Boolean); virtual; + procedure SetLastVisibleNode(ANode: TcxTreeListNode); virtual; + procedure SynchronizeTopNode; virtual; + procedure UpdateSelectedNodes; virtual; + procedure UpdatePostCalculate; virtual; + procedure UpdateData; virtual; + function GetGroupViewInfoItemClass: TcxTreeListCellsGroupViewInfoClass; virtual; + function GetEditCellViewInfoItemClass: TcxTreeListEditCellViewInfoClass; virtual; + function GetIndentViewInfoItemClass: TcxTreeListIndentViewInfoClass; virtual; + function GetNodePreviewViewInfoClass: TcxTreeListNodePreviewViewInfoClass; virtual; + function GetNodeViewInfoClass: TcxTreeListNodeViewInfoClass; virtual; + property ScrollWindow: Boolean read GetScrollWindow; + property MaxVisibleIndex: Integer read GetMaxVisibleIndex; + property Owner: TcxTreeListViewInfo read FOwner; + property OptionsView: TcxTreeListOptionsView read GetOptionsView; + property TopVisibleIndex: Integer read GetTopVisibleIndex; + property TreeList: TcxCustomTreeListControl read GetTreeList; + property Nodes[Index: Integer]: TcxTreeListNodeViewInfo read GetNodeViewInfo; + public + constructor Create(AOwner: TcxTreeListViewInfo); virtual; + destructor Destroy; override; + procedure Clear; + end; + + { TcxTreeListViewInfo } + + TcxTreeListViewInfo = class(TcxCustomControlViewInfo) + private + FBandCapacity: Integer; + FBandCount: Integer; + FBands: PPointerList; + FDefaultRowHeight: Integer; + FFixedBands: array[0..1] of TcxTreeListBandViewInfo; + FNodesViewInfo: TcxTreeListNodesViewInfo; + FScrollingArea: TRect; + FScrollingAreaVisible: Boolean; + FSeparators: TcxTreeListSeparators; + function GetBand(AIndex: Integer): TcxTreeListBandViewInfo; + function GetBorderSize: Integer; + function GetBrushManager: TcxBrushCache; + function GetCellsHeight: Integer; + function GetCellsOffset: Integer; + function GetContentOffset: Integer; + function GetDefaultHeight: Integer; + function GetFooterOffset: Integer; + function GetHeaderOffset: Integer; + function GetOptionsView: TcxTreeListOptionsView; + function GetTreeList: TcxCustomTreeListControl; + function GetVisibleBand(Index: Integer): TcxTreeListBandViewInfo; + function GetVisibleBandCount: Integer; + procedure SetBandCount(ACount: Integer); + procedure SetBandViewParams(ABand: TcxTreeListBand; Index: Integer); + procedure SetColumnViewParams(AColumn: TcxTreeListColumn); + // helpers function + function CalcBandRect(var ARect: TRect; + AWidth, AOfs: Integer; Fixed: TcxTreeListBandFixedKind): Integer; + procedure CalculateCellRects; + function SetHeaderSizeValue(const ViewParams: TcxViewParams; + var ASize: Integer; CheckSize: Boolean; Delta: Integer = 0): TcxViewParams; + protected + BackgroundBitmap: TBitmap; + BandLineHeight: Integer; + CellsRect: TRect; + ContentRect: TRect; + ExpandButtonSize: Integer; + FooterBitmap: TBitmap; + FooterBrush: TBrush; + FooterColor: TColor; + FooterIndicator: TcxTreeListIndicatorViewInfo; + FooterLineHeight: Integer; + FooterRect : TRect; + FooterSeparators: TcxTreeListSeparators; + GridLinesBrush: TBrush; + HeaderRect: TRect; + HeaderIndicator: TcxTreeListIndicatorViewInfo; + HeaderLineHeight: Integer; + HeaderSeparators: TcxTreeListSeparators; + IndicatorViewParams: TcxViewParams; + PreviewHeight: Integer; + PrevClientRect: TRect; + SeparatorBrush: TBrush; + TreeLineColor: TColor; + // scrolling variables + PrevHorzScrollSize: Integer; + HorzScrollInc: Integer; + HorzScrollPage: Integer; + HorzScrollPos: Integer; + HorzScrollSize: Integer; + SizingViewInfo: TcxTreeListEditCellViewInfo; + procedure CalculateDefaultHeights; override; + function CalculateDefaultEditHeight: Integer; override; + procedure CalculateDefaultViewParams; virtual; + procedure CalculateHeaderFooterViewInfo; virtual; + procedure CheckScrolling; virtual; + procedure DoCalculate; override; + procedure DoScrollHorizontal(APos: Integer); virtual; + procedure DoScrollVertical(APos: Integer); virtual; + function GetIndicatorViewInfoClass: TcxTreeListIndicatorViewInfoClass; virtual; + function GetNodesViewInfoClass: TcxTreeListNodesViewInfoClass; virtual; + procedure InvalidateRect(const ARect: TRect); + procedure UpdateSelection; override; + procedure UpdateFootersViewInfo; virtual; + property BorderSize: Integer read GetBorderSize; + property BrushManager: TcxBrushCache read GetBrushManager; + property CellsHeight: Integer read GetCellsHeight; + property CellsOffset: Integer read GetCellsOffset; + property ContentOffset: Integer read GetContentOffset; + property FooterOffset: Integer read GetFooterOffset; + property HeaderOffset: Integer read GetHeaderOffset; + property OptionsView: TcxTreeListOptionsView read GetOptionsView; + property VisibleBandCount: Integer read GetVisibleBandCount; + property VisibleBands[Index: Integer]: TcxTreeListBandViewInfo read GetVisibleBand; + public + constructor Create(AOwner: TcxEditingControl); override; + destructor Destroy; override; + procedure InvalidateScrollRect(ADirection: TcxDragSizingDirection); virtual; + property BandCount: Integer read FBandCount; + property Bands[Index: Integer]: TcxTreeListBandViewInfo read GetBand; + property DefaultHeight: Integer read GetDefaultHeight; + property DefaultRowHeight: Integer read FDefaultRowHeight; + property LeftFixedBand: TcxTreeListBandViewInfo read FFixedBands[0]; + property NodesViewInfo: TcxTreeListNodesViewInfo read FNodesViewInfo; + property RightFixedBand: TcxTreeListBandViewInfo read FFixedBands[1]; + property ScrollingArea: TRect read FScrollingArea; + property ScrollingAreaVisible: Boolean read FScrollingAreaVisible; + property TreeList: TcxCustomTreeListControl read GetTreeList; + end; + + { TcxTreeListControlPainter } + + TcxTreeListControlPainter = class(TcxCustomControlPainter) + private + function GetBackgroundBrush: TBrush; + function GetGridLinesBrush: TBrush; + function GetIsFooterVisible: Boolean; + function GetTreeList: TcxCustomTreeListControl; + function GetTreeLineColor: TColor; + function GetViewInfo: TcxTreeListViewInfo; + protected + ContentClipRegion: TcxRegion; + CurrentBitmap: TBitmap; + procedure AfterCustomDraw(AViewInfo: TcxCustomViewInfoItem); override; + procedure AfterCustomDraw(AViewInfo: TcxTreeListEditCellViewInfo); overload; + procedure BeforeCustomDraw(AViewInfo: TcxCustomViewInfoItem); override; + procedure BeforeCustomDraw(AViewInfo: TcxTreeListEditCellViewInfo); overload; + function DoCustomDrawEx(AViewInfoItem: TcxCustomViewInfoItem; + AEvent: TcxCustomDrawViewInfoItemEvent; AExclude: Boolean): Boolean; + procedure DoPaint; override; + function DoPaintBackground(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; + procedure DrawBackgroundRect(const R: TRect); virtual; + procedure DrawBandItem(AViewInfo: TcxTreeListBandViewInfo); virtual; + procedure DrawBandFooter(AViewInfo: TcxTreeListBandViewInfo); virtual; + procedure DrawCellsGroup(AViewInfo: TcxTreeListCellsGroupViewInfo); virtual; + procedure DrawEditCell(AViewInfo: TcxTreeListEditCellViewInfo; IsOpaque: Boolean); virtual; + procedure DrawExpandButton(const ARect: TRect; AExpanded: Boolean; ABitmap: TBitmap); virtual; + procedure DrawFocusRect(AViewInfo: TcxTreeListNodeViewInfo); virtual; + procedure DrawFooter; virtual; + procedure DrawFooterItem(AViewInfo: TcxTreeListFooterItemViewInfo); + procedure DrawFooterRect(const R: TRect; AViewInfo: TcxTreeListBandViewInfo); virtual; + procedure DrawHeader; virtual; + procedure DrawHeaderItem(AViewInfo: TcxTreeListHeaderViewInfo; IsOpaque: Boolean); virtual; + procedure DrawHeaderRect(const R: TRect; AViewInfo: TcxTreeListBandViewInfo); virtual; + procedure DrawImage(AViewInfo: TcxTreeListIndentViewInfo); virtual; + procedure DrawIndicator(AViewInfo: TcxTreeListIndicatorViewInfo); virtual; + procedure DrawNode(AViewInfo: TcxTreeListNodeViewInfo); virtual; + procedure DrawNodeCells(AViewInfo: TcxTreeListNodeViewInfo; + AFromIndex, AToIndex: Integer); virtual; + procedure DrawNodeIndent(AViewInfo: TcxTreeListIndentViewInfo); virtual; + procedure DrawNodePreview(AViewInfo: TcxTreeListNodePreviewViewInfo); virtual; + procedure DrawNodes; virtual; + procedure DrawRect(AViewInfo: TcxTreeListViewInfoItem); overload; + procedure DrawRect(const ARect: TRect; ABrush: TBrush; ABitmap: TBitmap = nil); overload; virtual; + procedure DrawRectWithBorders(const ARect: TRect; ABrush: TBrush; + IsOpaque: Boolean; ABorders: TcxBorders = []; ABitmap: TBitmap = nil); overload; + procedure DrawRectWithBorders(AViewInfo: TcxTreeListViewInfoItem; + IsOpaque: Boolean; ABorders: TcxBorders = []); overload; + procedure DrawSeparators(const ASeparators: TcxTreeListSeparators); virtual; + procedure DrawTreeLines(AViewInfo: TcxTreeListIndentViewInfo); virtual; + procedure ExtDrawHeader(ACanvas: TcxCanvas; + const ABounds, ATextAreaBounds: TRect; ANeighbors: TcxNeighbors; ABorders: TcxBorders; + AState: TcxButtonState; AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; + AMultiLine, AShowEndEllipsis: Boolean; const AText: string; AFont: TFont; + ATextColor, ABkColor: TColor; AOnDrawBackground: TcxDrawBackgroundEvent = nil); + function GetViewState(AIndex: Integer): Boolean; + procedure RestoreClipping; + property NodesClipping: TcxRegion read ContentClipRegion; + property Bands: Boolean index 0 read GetViewState; + property BackgroundBrush: TBrush read GetBackgroundBrush; + property Footer: Boolean index 2 read GetViewState; + property Headers: Boolean index 3 read GetViewState; + property Indicator: Boolean index 4 read GetViewState; + property IsFooterVisible: Boolean read GetIsFooterVisible; + property ShowRoot: Boolean index 5 read GetViewState; + property GridLinesBrush: TBrush read GetGridLinesBrush; + property TreeLineColor: TColor read GetTreeLineColor; + public + property TreeList: TcxCustomTreeListControl read GetTreeList; + property ViewInfo: TcxTreeListViewInfo read GetViewInfo; + end; + + { TcxTreeListBandOptions } + + TcxTreeListBandOptions = class(TcxOwnedPersistent) + private + FState: Integer; + FHidden: Boolean; + function GetState(AIndex: Integer): Boolean; + procedure SetState(AIndex: Integer; Value: Boolean); + protected + procedure Changed; virtual; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; virtual; + published + property Customizing: Boolean index 0 read GetState write SetState default True; + property Hidden: Boolean read FHidden write FHidden default False; + property Moving: Boolean index 1 read GetState write SetState default True; + property OnlyOwnColumns: Boolean index 2 read GetState write SetState default False; + property Sizing: Boolean index 3 read GetState write SetState default True; + end; + + TcxTreeListBandOptionsClass = class of TcxTreeListBandOptions; + + { TcxTreeListBandStyles } + + TcxTreeListBandStyles = class(TcxStyles) + private + function GetTreeList: TcxCustomTreeListControl; + protected + ContentParams: TcxCachedContentParams; + procedure CachedContentStyleChanged; + procedure Changed(AIndex: Integer); override; + property TreeList: TcxCustomTreeListControl read GetTreeList; + public + procedure Assign(Source: TPersistent); override; + published + property Content: TcxStyle index tlbs_Content read GetValue write SetValue; + property Footer: TcxStyle index tlbs_Footer read GetValue write SetValue; + property Header: TcxStyle index tlbs_Header read GetValue write SetValue; + property HeaderBackground: TcxStyle index tlbs_HeaderBackground read GetValue write SetValue; + end; + + { TcxTreeListBand } + + TcxTreeListBand = class(TcxInterfacedCollectionItem, IUnknown, IcxTreeListIndexedItem, IcxDragSizing, IcxStoredObject) + private + FBandRows: TcxTreeListBandRows; + FBandViewInfo: TcxTreeListBandViewInfo; + FCaption: TcxTreeListCaption; + FCalculatedWidth: Integer; + FColumns: TList; + FMinWidth: Integer; + FOptions: TcxTreeListBandOptions; + FState: Integer; + FStyles: TcxTreeListBandStyles; + FVisibleColumns: TList; + FWidth: Integer; + function GetBands: TcxTreeListBands; + function GetColumn(Index: Integer): TcxTreeListColumn; + function GetColumnCount: Integer; + function GetDisplayWidth: Integer; + function GetFixedKind: TcxTreeListBandFixedKind; + function GetIndentWidth: Integer; + function GetIsLeftMost: Boolean; + function GetIsRightMost: Boolean; + function GetItemIndex: Integer; + function GetRealWidth: Integer; + function GetTreeList: TcxCustomTreeListControl; + function GetVisible: Boolean; + function GetVisibleIndex: Integer; + function GetVisibleColumn(Index: Integer): TcxTreeListColumn; + function GetVisibleColumnCount: Integer; + procedure SetBandVisiblePos(APos: Integer); + procedure SetCaption(Value: TcxTreeListCaption); + procedure SetColumn(Index: Integer; Value: TcxTreeListColumn); + procedure SetFixedKind(Value: TcxTreeListBandFixedKind); + procedure SetItemIndex(Value: Integer); + procedure SetMinWidth(Value: Integer); + procedure SetOptions(Value: TcxTreeListBandOptions); + procedure SetStyles(Value: TcxTreeListBandStyles); + procedure SetVisible(Value: Boolean); + procedure SetVisibleColumn(Index: Integer; Value: TcxTreeListColumn); + procedure SetVisibleIndex(Value: Integer); + procedure SetWidth(Value: Integer); + protected + procedure AssignColumnWidths; + procedure InitAutoWidthItem(AItem: TcxAutoWidthItem); + function IsFixed: Boolean; + function IsOnlyOwnColumns: Boolean; + function CanDropColumnAt(const APoint: TPoint; out ARowIndex, AColIndex: Integer): Boolean; virtual; + function GetMaxDeltaWidth: Integer; + function CanMoving: Boolean; virtual; + function GetState(Index: Integer): Boolean; + function GetOptionsClass: TcxTreeListBandOptionsClass; virtual; + procedure AddColumn(AColumn: TcxTreeListColumn); + procedure RealignColumns; + procedure RemoveColumn(AColumn: TcxTreeListColumn); + procedure SetState(Index: Integer; Value: Boolean); + procedure VisibleChanged; virtual; + // IcxTreeListDragSizing implementation + function CanSizing(ADirection: TcxDragSizingDirection): Boolean; + function GetSizingBoundsRect(ADirection: TcxDragSizingDirection): TRect; virtual; + function GetSizingIncrement(ADirection: TcxDragSizingDirection): Integer; virtual; + function IsDynamicUpdate: Boolean; virtual; + procedure SetSizeDelta(ADirection: TcxDragSizingDirection; ADelta: Integer); virtual; + // IcxStoredObject + function GetObjectName: string; + function GetProperties(AProperties: TStrings): Boolean; virtual; + function GetPropertyIndex(const AName: string): Integer; + procedure GetPropertyValue(const AName: string; var AValue: Variant); virtual; + procedure SetPropertyValue(const AName: string; const AValue: Variant); virtual; + property Bands: TcxTreeListBands read GetBands; + property TreeList: TcxCustomTreeListControl read GetTreeList; + property ViewInfo: TcxTreeListBandViewInfo read FBandViewInfo; + property IndentWidth: Integer read GetIndentWidth; + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure ApplyBestFit; + procedure RestoreDefaults; virtual; + procedure RestoreWidths; + property BandRows: TcxTreeListBandRows read FBandRows; + property ColumnCount: Integer read GetColumnCount; + property Columns[Index: Integer]: TcxTreeListColumn read GetColumn write SetColumn; + property DisplayWidth: Integer read GetDisplayWidth; + property IsLeftMost: Boolean read GetIsLeftMost; + property IsRightMost: Boolean read GetIsRightMost; + property RealWidth: Integer read GetRealWidth; + property VisibleColumnCount: Integer read GetVisibleColumnCount; + property VisibleColumns[Index: Integer]: TcxTreeListColumn read GetVisibleColumn write SetVisibleColumn; + property Index; + published + property Caption: TcxTreeListCaption read FCaption write SetCaption; + property FixedKind: TcxTreeListBandFixedKind read GetFixedKind write SetFixedKind default tlbfNone; + property MinWidth: Integer read FMinWidth write SetMinWidth default cxTreeListDefMinWidth; + property Options: TcxTreeListBandOptions read FOptions write SetOptions; + property Styles: TcxTreeListBandStyles read FStyles write SetStyles; + property Visible: Boolean read GetVisible write SetVisible default True; + property Width: Integer read FWidth write SetWidth default 0; + property VisibleIndex: Integer read GetVisibleIndex write SetVisibleIndex stored False; + end; + + TcxTreeListBandClass = class of TcxTreeListBand; + + { TcxTreeListBands } + + TcxTreeListBands = class(TCollection, {$IFNDEF DELPHI6} IUnknown, {$ENDIF} IcxStoredObject, IcxStoredParent) + private + FTreeList: TcxCustomTreeListControl; + function GetItem(AIndex: Integer): TcxTreeListBand; + function GetVisibleItemEx(AIndex: Integer): TcxTreeListBand; + procedure SetItem(AIndex: Integer; Value: TcxTreeListBand); + protected + function GetOwner: TPersistent; override; + procedure RealignColumns; + procedure RefreshBandStates; virtual; + procedure Update(Item: TCollectionItem); override; + // + {$IFDEF DELPHI6} + procedure Notify(Item: TCollectionItem; Action: TCollectionNotification); override; + {$ENDIF} + + // IInterface + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + // IcxStoredObject } + function GetObjectName: string; + function GetProperties(AProperties: TStrings): Boolean; virtual; + procedure GetPropertyValue(const AName: string; var AValue: Variant); virtual; + procedure SetPropertyValue(const AName: string; const AValue: Variant); virtual; + // IcxStoredParent + function CreateChild(const AObjectName, AClassName: string): TObject; virtual; + procedure DeleteChild(const AObjectName: string; AObject: TObject); virtual; + procedure GetChildren(AChildren: TStringList); virtual; + public + constructor Create(AOwner: TcxCustomTreeListControl); virtual; + function Add: TcxTreeListBand; + function GetAbsoluteIndex(VisibleIndex: Integer): Integer; + function GetVisibleIndex(AbsoluteIndex: Integer): Integer; + procedure RestoreDefaults; virtual; + procedure RestoreWidths; virtual; + property FirstVisible: TcxTreeListBand index 0 read GetVisibleItemEx; + property Items[AIndex: Integer]: TcxTreeListBand read GetItem write SetItem; default; + property LastVisible: TcxTreeListBand index 1 read GetVisibleItemEx; + property TreeList: TcxCustomTreeListControl read FTreeList; + end; + + { TcxTreeListBandRow } + + TcxTreeListBandRow = class + private + FBandRows: TcxTreeListBandRows; + FItems: TList; + FLineCount: Integer; + FLineOffset: Integer; + function GetBand: TcxTreeListBand; + function GetCount: Integer; + function GetFirst: TcxTreeListColumn; + function GetIndex: Integer; + function GetIsFirst: Boolean; + function GetIsLast: Boolean; + function GetItem(Index: Integer): TcxTreeListColumn; + function GetItemEx(Index: Integer): TcxTreeListColumn; + function GetLast: TcxTreeListColumn; + function GetLineCount: Integer; + function GetMinWidth: Integer; + function GetTreeList: TcxCustomTreeListControl; + function GetWidth: Integer; + protected + procedure AddColumn(AColumn: TcxTreeListColumn); + procedure DoCalculateColumnsAutoWidth; + function GetRowMinWidth: Integer; + function GetMaxColumnWidth(AColumn: TcxTreeListColumn): Integer; + procedure UpdateInformation; + property Band: TcxTreeListBand read GetBand; + property TreeList: TcxCustomTreeListControl read GetTreeList; + public + constructor Create(AOwner: TcxTreeListBandRows); virtual; + destructor Destroy; override; + function IndexOf(AColumn: TcxTreeListColumn): Integer; + property BandRows: TcxTreeListBandRows read FBandRows; + property Count: Integer read GetCount; + property First: TcxTreeListColumn read GetFirst; + property Index: Integer read GetIndex; + property IsFirst: Boolean read GetIsLast; + property IsLast: Boolean read GetIsFirst; + property Items[Index: Integer]: TcxTreeListColumn read GetItem; default; + property Last: TcxTreeListColumn read GetLast; + property LineCount: Integer read GetLineCount; + property LineOffset: Integer read FLineOffset; + property MinWidth: Integer read GetMinWidth; + property Width: Integer read GetWidth; + end; + + { TcxTreeListBandRows } + + TcxTreeListBandRows = class + private + FBand: TcxTreeListBand; + FColumnsMaxWidth: Integer; + FColumnsMinWidth: Integer; + FItems: TList; + FLineCount: Integer; + function GetCount: Integer; + function GetFirst: TcxTreeListBandRow; + function GetItem(Index: Integer): TcxTreeListBandRow; + function GetItemEx(Index: Integer): TcxTreeListBandRow; + function GetLast: TcxTreeListBandRow; + function GetLeftMostMinWidth: Integer; + function GetLeftMostWidth: Integer; + function GetMinWidth: Integer; + protected + function Add: TcxTreeListBandRow; + function CalculateAvaliableMinWidth: Integer; + procedure Clear; + procedure Refresh; + procedure UpdateInformation; + public + constructor Create(AOwner: TcxTreeListBand); virtual; + destructor Destroy; override; + property Band: TcxTreeListBand read FBand; + property Count: Integer read GetCount; + property ColumnsMaxWidth: Integer read FColumnsMaxWidth; + property ColumnsMinWidth: Integer read FColumnsMinWidth; + property First: TcxTreeListBandRow read GetFirst; + property Items[Index: Integer]: TcxTreeListBandRow read GetItem; default; + property Last: TcxTreeListBandRow read GetLast; + property LeftMostMinWidth: Integer read GetLeftMostMinWidth; + property LeftMostWidth: Integer read GetLeftMostWidth; + property LineCount: Integer read FLineCount; + property MinWidth: Integer read GetMinWidth; + end; + + { TcxTreeListOptionsView } + + TcxTreeListTreeLineStyle = (tllsNone, tllsDot, tllsSolid); + TcxTreeListPaintStyle = (tlpsStandard, tlpsCategorized); + + TcxTreeListOptionsView = class(TcxControlOptionsView, IUnknown, IcxTreeListSubClass) + private + FBandLineCount: Integer; + FCategorizedColumn: TcxTreeListColumn; + FDropArrowColor: TColor; + FFixedSeparatorColor: TColor; + FFixedSeparatorWidth: Integer; + FGridLineColor: TColor; + FGridLines: TcxTreeListGridLines; + FIndicatorWidth: Integer; + FPaintStyle: TcxTreeListPaintStyle; + FState: Integer; + FTreeLineColor: TColor; + FTreeLineStyle: TcxTreeListTreeLineStyle; + function GetTreeList: TcxCustomTreeListControl; + procedure SetCategorizedColumn(Value: TcxTreeListColumn); + procedure SetColumnAutoWidth(Index: Integer; Value: Boolean); + procedure SetBandLineCount(Value: Integer); + procedure SetIndicatorWidth(Value: Integer); + procedure SetFixedSeparatorColor(Value: TColor); + procedure SetFixedSeparatorWidth(Value: Integer); + procedure SetGridLineColor(Value: TColor); + procedure SetGridLines(Value: TcxTreeListGridLines); + procedure SetHeaderSingleLine(Index: Integer; Value: Boolean); + procedure SetPaintStyle(Value: TcxTreeListPaintStyle); + procedure SetTreeLineColor(Value: TColor); + procedure SetTreeLineStyle(Value: TcxTreeListTreeLineStyle); + protected + procedure Changed; override; + function GetControl: TObject; + function GetState(AIndex: Integer): Boolean; + procedure SetState(AIndex: Integer; Value: Boolean); + // helper functions + function HasImages(ANode: TcxTreeListNode): Boolean; + function HasStateImages(ANode: TcxTreeListNode): Boolean; + function HorzIncrement: Integer; + function IsCategorizedPaint: Boolean; + function IsExtPaintStyle: Boolean; + function IsRowAutoHeight: Boolean; + function VertIncrement: Integer; + // IUnknown + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall; + property TreeList: TcxCustomTreeListControl read GetTreeList; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + function GetCategorizedColumn: TcxTreeListColumn; + procedure RestoreDefaults; virtual; + published + property BandLineCount: Integer read FBandLineCount write SetBandLineCount default cxTreeListDefBandHeaderLineCount; + property Bands: Boolean index 0 read GetState write SetState default cxTreeListDefBands; + property Buttons: Boolean index 7 read GetState write SetState default True; + property CategorizedColumn: TcxTreeListColumn read FCategorizedColumn write SetCategorizedColumn; + property ColumnAutoWidth: Boolean index 1 read GetState write SetColumnAutoWidth default cxTreeListDefColumnAutoWidth; + property DropArrowColor: TColor read FDropArrowColor write FDropArrowColor default cxTreeListDefDropArrowColor; + property ExtPaintStyle: Boolean index 12 read GetState write SetState default False; + property FixedSeparatorColor: TColor read FFixedSeparatorColor write SetFixedSeparatorColor default clDefault; + property FixedSeparatorWidth: Integer read FFixedSeparatorWidth write SetFixedSeparatorWidth default cxTreeListDefSeparatorWidth; + property Footer: Boolean index 2 read GetState write SetState default False; + property GridLineColor: TColor read FGridLineColor write SetGridLineColor default clDefault; + property GridLines: TcxTreeListGridLines read FGridLines write SetGridLines default tlglNone; + property Headers: Boolean index 3 read GetState write SetState default cxTreeListDefColumnHeaders; + property HeaderSingleLine: Boolean index 10 read GetState write SetHeaderSingleLine default False; + property Indicator: Boolean index 4 read GetState write SetState default False; + property IndicatorWidth: Integer read FIndicatorWidth write SetIndicatorWidth default cxTreeListDefIndicatorWidth; + property PaintStyle: TcxTreeListPaintStyle read FPaintStyle write SetPaintStyle default tlpsStandard; + property ShowRoot: Boolean index 5 read GetState write SetState default True; + property SimpleCustomizeBox: Boolean index 8 read GetState write SetState default False; + property TreeLineColor: TColor read FTreeLineColor write SetTreeLineColor default clDefault; + property TreeLineStyle: TcxTreeListTreeLineStyle read FTreeLineStyle write SetTreeLineStyle default tllsDot; + property UseImageIndexForSelected: Boolean index 13 read GetState write SetState default True; + property UseNodeColorForIndent: Boolean index 9 read GetState write SetState default True; + property CellAutoHeight; + property CellEndEllipsis; + property CellTextMaxLineCount; + property ScrollBars; + property ShowEditButtons; + end; + + { TcxTreeListOptionsCustomizing } + + TcxTreeListOptionsCustomizing = class(TcxOwnedPersistent) + private + FState: Integer; + function GetTreeList: TcxCustomTreeListControl; + protected + function GetState(Index: Integer): Boolean; + procedure SetState(Index: Integer; Value: Boolean); + property TreeList: TcxCustomTreeListControl read GetTreeList; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + published + property BandCustomizing: Boolean index 7 read GetState write SetState default True; + property BandHorzSizing: Boolean index 1 read GetState write SetState default True; + property BandMoving: Boolean index 2 read GetState write SetState default True; + property BandVertSizing: Boolean index 3 read GetState write SetState default True; + property ColumnCustomizing: Boolean index 4 read GetState write SetState default True; + property ColumnHorzSizing: Boolean index 5 read GetState write SetState default True; + property ColumnMoving: Boolean index 6 read GetState write SetState default True; + property ColumnVertSizing: Boolean index 8 read GetState write SetState default True; + property DynamicSizing: Boolean index 9 read GetState write SetState default False; + property RowSizing: Boolean index 10 read GetState write SetState default False; + end; + + { TcxTreeListOptionsSelection } + + TcxTreeListOptionsSelection = class(TcxOwnedPersistent) + private + FState: Integer; + function GetTreeList: TcxCustomTreeListControl; + protected + procedure Changed; virtual; + function GetSelectionState(Index: Integer): Boolean; + procedure SetSelectionState(Index: Integer; Value: Boolean); + property TreeList: TcxCustomTreeListControl read GetTreeList; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + published + property CellSelect: Boolean index 0 read GetSelectionState write SetSelectionState default True; + property HideFocusRect: Boolean index 1 read GetSelectionState write SetSelectionState default True; + property HideSelection: Boolean index 2 read GetSelectionState write SetSelectionState default False; + property InvertSelect: Boolean index 3 read GetSelectionState write SetSelectionState default True; + property MultiSelect: Boolean index 4 read GetSelectionState write SetSelectionState default False; + end; + + TcxTreeListOptionsSelectionClass = class of TcxTreeListOptionsSelection; + + { TcxTreeListOptionsBehavior } + + TcxTreeListOptionsBehavior = class(TcxControlOptionsBehavior) + private + FState: Integer; + FWaitExpandingTime: Integer; + function GetChangeDelay: Integer; + function GetIncSearchItem: TcxTreeListColumn; + function GetTreeList: TcxCustomTreeListControl; + procedure SetChangeDelay(Value: Integer); + procedure SetAutomateLeftMostIndent(Index: Integer; Value: Boolean); + procedure SetIncSearchItem(Value: TcxTreeListColumn); + protected + function GetState(Index: Integer): Boolean; + procedure SetState(Index: Integer; Value: Boolean); + property TreeList: TcxCustomTreeListControl read GetTreeList; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + published + property AutoDragCopy: Boolean index 4 read GetState write SetState default False; + property AutomateLeftMostIndent: Boolean index 9 read GetState write SetAutomateLeftMostIndent default True; + property ChangeDelay: Integer read GetChangeDelay write SetChangeDelay default 0; + property ConfirmDelete: Boolean index 6 read GetState write SetState default True; + property DragCollapse: Boolean index 0 read GetState write SetState default True; + property DragExpand: Boolean index 1 read GetState write SetState default True; + property DragFocusing: Boolean index 15 read GetState write SetState default False; + property ExpandOnDblClick: Boolean index 16 read GetState write SetState default True; + property ExpandOnIncSearch: Boolean index 2 read GetState write SetState default False; + property HotTrack: Boolean index 10 read GetState write SetState default False; + property IncSearchItem: TcxTreeListColumn read GetIncSearchItem write SetIncSearchItem default nil; + property Sorting: Boolean index 8 read GetState write SetState default True; + property MultiSort: Boolean index 7 read GetState write SetState default True; + property ShowHourGlass: Boolean index 3 read GetState write SetState default True; + property WaitForExpandNodeTime: Integer read FWaitExpandingTime write FWaitExpandingTime default cxTreeListDefWaitExpandTime; + property DragDropText; + property FocusCellOnCycle; + property IncSearch; + end; + + { TcxTreeListOptionsData } + + TcxTreeListOptionsData = class(TcxControlOptionsData) + private + FState: Integer; + function GetAnsiSort: Boolean; + function GetCaseInsensitive: Boolean; + function GetSummaryNullIgnore: Boolean; + procedure SetAnsiSort(Value: Boolean); + procedure SetCaseInsensitive(Value: Boolean); + procedure SetSummaryNullIgnore(Value: Boolean); + protected + procedure Changed; override; + function GetState(Index: Integer): Boolean; + procedure SetState(Index: Integer; Value: Boolean); + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + published + property AnsiSort: Boolean read GetAnsiSort write SetAnsiSort default False; + property CaseInsensitive: Boolean read GetCaseInsensitive write SetCaseInsensitive default False; + property Deleting: Boolean index 0 read GetState write SetState default True; + property Inserting: Boolean index 1 read GetState write SetState default False; + property SummaryNullIgnore: Boolean read GetSummaryNullIgnore write SetSummaryNullIgnore default False; + end; + + { TcxTreeListPreview } + + TcxTreeListPreviewPlace = (tlppBottom, tlppTop); + + TcxTreeListPreview = class(TcxOwnedInterfacedPersistent, IcxTreeListSubClass) + private + FAutoHeight: Boolean; + FColumn: TcxTreeListColumn; + FLeftIndent: Integer; + FMaxLineCount: Integer; + FPlace: TcxTreeListPreviewPlace; + FRightIndent: Integer; + FVisible: Boolean; + function GetActive: Boolean; + function GetTreeList: TcxCustomTreeListControl; + procedure SetAutoHeight(Value: Boolean); + procedure SetColumn(Value: TcxTreeListColumn); + procedure SetLeftIndent(Value: Integer); + procedure SetMaxLineCount(Value: Integer); + procedure SetPlace(Value: TcxTreeListPreviewPlace); + procedure SetRightIndent(Value: Integer); + procedure SetVisible(Value: Boolean); + protected + procedure Changed(ACheckActivate: Boolean); virtual; + function GetControl: TObject; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + property Active: Boolean read GetActive; + property TreeList: TcxCustomTreeListControl read GetTreeList; + published + property AutoHeight: Boolean read FAutoHeight write SetAutoHeight default True; + property Column: TcxTreeListColumn read FColumn write SetColumn; + property LeftIndent: Integer read FLeftIndent write SetLeftIndent + default cxTreeListDefPreviewMaxLineCount; + property MaxLineCount: Integer read FMaxLineCount write SetMaxLineCount + default cxTreeListDefPreviewMaxLineCount; + property Place: TcxTreeListPreviewPlace read FPlace write SetPlace default tlppBottom; + property RightIndent: Integer read FRightIndent write SetRightIndent + default cxTreeListDefPreviewIndent; + property Visible: Boolean read FVisible write SetVisible default False; + end; + + { TcxTreeListStyleSheet } + + TcxTreeListStyleSheet = class(TcxCustomStyleSheet) + private + function GetStylesValue: TcxTreeListStyles; + procedure SetStylesValue(Value: TcxTreeListStyles); + public + class function GetStylesClass: TcxCustomStylesClass; override; + published + property Styles: TcxTreeListStyles read GetStylesValue write SetStylesValue; + end; + + { TcxTreeListStyles } + + TcxtlOnGetItemStyleEvent = procedure(Sender: TObject; AItem: TObject; var AStyle: TcxStyle) of object; + + TcxtlOnGetContentStyleEvent = procedure(Sender: TObject; AItem: TObject; + ANode: TcxTreeListNode; var AStyle: TcxStyle) of object; + + TcxtlOnGetNodeIndentStyleEvent = procedure(Sender: TObject; + ANode: TcxTreeListNode; ALevel: Integer; var AStyle: TcxStyle) of object; + + TcxTreeListStyles = class(TcxCustomControlStyles) + private + FOnGetBandBackgroundStyle: TcxtlOnGetItemStyleEvent; + FOnGetBandContentStyle: TcxtlOnGetContentStyleEvent; + FOnGetBandHeaderStyle: TcxtlOnGetItemStyleEvent; + FOnGetBandFooterStyle: TcxtlOnGetItemStyleEvent; + FOnGetColumnFooterStyle: TcxtlOnGetItemStyleEvent; + FOnGetColumnHeaderStyle: TcxtlOnGetItemStyleEvent; + FOnGetContentStyle: TcxtlOnGetContentStyleEvent; + FOnGetHotTrackStyle: TcxtlOnGetContentStyleEvent; + FOnGetNodeIndentStyle: TcxtlOnGetNodeIndentStyleEvent; + FOnGetPreviewStyle: TcxtlOnGetItemStyleEvent; + function GetTreeList: TcxCustomTreeListControl; + protected + ContentParams: TcxCachedContentParams; + CachedPreviewStyle: TcxViewParams; + procedure ContentStyleChanged; virtual; + procedure DoGetContentParams(ANode: TcxTreeListNode; AColumn: TcxTreeListColumn; var AParams: TcxViewParams); virtual; + procedure DoGetBandContentParams(ANode: TcxTreeListNode; ABand: TcxTreeListBand; var AParams: TcxViewParams); virtual; + function DoGetBandContentStyle(ANode: TcxTreeListNode; ABand: TcxTreeListBand; out AStyle: TcxStyle): Boolean; + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + function GetStyleFromEvent(const AEvent: TcxtlOnGetItemStyleEvent; AItem: TObject): TcxStyle; + function SelectionFontAssigned: Boolean; + property TreeList: TcxCustomTreeListControl read GetTreeList; + public + procedure Assign(Source: TPersistent); override; + function GetBandBackgroundParams(ABand: TcxTreeListBand): TcxViewParams; + function GetBandContentParams(ABand: TcxTreeListBand; ANode: TcxTreeListNode): TcxViewParams; + function GetBandFooterParams(ABand: TcxTreeListBand): TcxViewParams; + function GetBandHeaderParams(ABand: TcxTreeListBand): TcxViewParams; + function GetColumnContentParams(AColumn: TcxTreeListColumn; IsOdd: Boolean): TcxViewParams; + function GetColumnHeaderParams(AColumn: TcxTreeListColumn): TcxViewParams; + function GetColumnFooterParams(AColumn: TcxTreeListColumn): TcxViewParams; + function GetContentParams(ANode: TcxTreeListNode; AColumn: TcxTreeListColumn): TcxViewParams; + function GetIncSearchParams: TcxViewParams; + function GetIndentParams(ANode: TcxTreeListNode; AIndent: Integer): TcxViewParams; + function GetIndicatorParams: TcxViewParams; + function GetFooterParams: TcxViewParams; + function GetPreviewParams(ANode: TcxTreeListNode): TcxViewParams; + published + property BandBackground: TcxStyle index tlsv_BandBackground read GetValue write SetValue; + property BandContent: TcxStyle index tlsv_BandContent read GetValue write SetValue; + property BandHeader: TcxStyle index tlsv_BandHeader read GetValue write SetValue; + property ColumnFooter: TcxStyle index tlsv_ColumnFooter read GetValue write SetValue; + property ColumnHeader: TcxStyle index tlsv_ColumnHeader read GetValue write SetValue; + property ContentEven: TcxStyle index tlsv_ContentEven read GetValue write SetValue; + property ContentOdd: TcxStyle index tlsv_ContentOdd read GetValue write SetValue; + property Footer: TcxStyle index tlsv_Footer read GetValue write SetValue; + property HotTrack: TcxStyle index tlsv_HotTrack read GetValue write SetValue; + property IncSearch: TcxStyle index tlsv_IncSearch read GetValue write SetValue; + property Indicator: TcxStyle index tlsv_Indicator read GetValue write SetValue; + property Preview: TcxStyle index tlsv_Preview read GetValue write SetValue; + property OnGetBandBackgroundStyle: TcxtlOnGetItemStyleEvent read FOnGetBandBackgroundStyle write FOnGetBandBackgroundStyle; + property OnGetBandContentStyle: TcxtlOnGetContentStyleEvent read FOnGetBandContentStyle write FOnGetBandContentStyle; + property OnGetBandHeaderStyle: TcxtlOnGetItemStyleEvent read FOnGetBandHeaderStyle write FOnGetBandHeaderStyle; + property OnGetBandFooterStyle: TcxtlOnGetItemStyleEvent read FOnGetBandFooterStyle write FOnGetBandFooterStyle; + property OnGetColumnFooterStyle: TcxtlOnGetItemStyleEvent read FOnGetColumnFooterStyle write FOnGetColumnFooterStyle; + property OnGetColumnHeaderStyle: TcxtlOnGetItemStyleEvent read FOnGetColumnHeaderStyle write FOnGetColumnHeaderStyle; + property OnGetContentStyle: TcxtlOnGetContentStyleEvent read FOnGetContentStyle write FOnGetContentStyle; + property OnGetNodeIndentStyle: TcxtlOnGetNodeIndentStyleEvent read FOnGetNodeIndentStyle write FOnGetNodeIndentStyle; + property OnGetHotTrackStyle: TcxtlOnGetContentStyleEvent read FOnGetHotTrackStyle write FOnGetHotTrackStyle; + property OnGetPreviewStyle: TcxtlOnGetItemStyleEvent read FOnGetPreviewStyle write FOnGetPreviewStyle; + property Background; + property Content; + property Inactive; + property Selection; + property StyleSheet; + end; + + { TcxTreeListItemsCustomizeListBox } + + TcxTreeListItemsCustomizeListBox = class(TcxListBox) + private + FAccepted: Boolean; + FDragAndDropItemIndex: Integer; + FDragAndDropObject: TcxTreeListDragAndDropObject; + FIsBandListBox: Boolean; + FMouseDownPos: TPoint; + FOrgPoint: TPoint; + FPrevCursor: TCursor; + FTreeList: TcxCustomTreeListControl; + function GetPainter: TcxCustomLookAndFeelPainterClass; + procedure WMCancelMode(var Message: TWMCancelMode); message WM_CANCELMODE; + protected + procedure BeginDrag; virtual; + procedure FocusChanged; override; + procedure DoDrawItem(AControl: TcxListBox; ACanvas: TcxCanvas; + AIndex: Integer; ARect: TRect; AState: TOwnerDrawState); virtual; + procedure DoDrawItemEx(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure EndDrag(Accepted: Boolean); virtual; + procedure FinishDrag(Accepted: Boolean); virtual; + procedure InitDragAndDropObject; virtual; + function GetItemHeight(AItem: Integer): Integer; virtual; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure MeasureItem(AControl: TcxListBox; Index: Integer; var Height: Integer); virtual; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure RefreshList; + procedure Resize; override; + property DragAndDropObject: TcxTreeListDragAndDropObject read FDragAndDropObject; + property TreeList: TcxCustomTreeListControl read FTreeList; + property Painter: TcxCustomLookAndFeelPainterClass read GetPainter; + public + constructor CreateEx(AOwner: TComponent; + ATreeList: TcxCustomTreeListControl; IsBandListBox: Boolean); + end; + + { TcxTreeListCustomizationForm } + + TcxTreeListCustomizationForm = class(TForm) + private + FCustomizingListBox: TcxTreeListItemsCustomizeListBox; + FDeactivationTimer: TTimer; + FHookTimer: TcxTimer; + FOwner: TcxTreeListCustomizing; + function GetTreeList: TcxCustomTreeListControl; + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure DeactivationTimeHandler(Sender: TObject); + procedure StartDeactivationTimer(Sender: TcxTreeListItemsCustomizeListBox); + procedure StopDeactivationTimer; + procedure HookTimerHandler(Sender: TObject); + + property HookTimer: TcxTimer read FHookTimer; + property Customizing: TcxTreeListCustomizing read FOwner; + property CustomizingListBox: TcxTreeListItemsCustomizeListBox read FCustomizingListBox; + property TreeList: TcxCustomTreeListControl read GetTreeList; + public + constructor CreateEx(AOwner: TcxTreeListCustomizing); + destructor Destroy; override; + end; + + { TcxTreeListCustomizing } + + TcxTreeListCustomizing = class(TcxOwnedInterfacedPersistent, IcxTreeListDesigner) + private + FBandListBox: TcxTreeListItemsCustomizeListBox; + FDragAndDropObject: TcxTreeListDragAndDropObject; + FForm: TcxTreeListCustomizationForm; + FHeaderListBox: TcxTreeListItemsCustomizeListBox; + FLastBandIndex: Integer; + FLastHeaderIndex: Integer; + FLastPosition: TPoint; + FLineHeight: Integer; + FPageControl: TPageControl; + FRowCount: Integer; + FTabSheetBands: TTabSheet; + FTabSheetHeaders: TTabSheet; + FTreeList: TcxCustomTreeListControl; + FVisible: Boolean; + function GetForm: TForm; + function GetVisible: Boolean; + procedure SetRowCount(Value: Integer); + procedure SetVisible(Value: Boolean); + protected + procedure AdjustControls; virtual; + procedure Activate(Sender: TObject); virtual; + procedure Close(Sender: TObject; var Action: TCloseAction); virtual; + procedure CreateControls; virtual; + procedure CreateCustomizingForm; + function IsSimpleMode: Boolean; + procedure LookAndFeelChanged; virtual; + procedure ReleaseControls; + procedure SetControlParent(AControl, AParent: TWinControl); + procedure ShowCustomizingForm; + function SizeDelta: TSize; virtual; + procedure ValidateListBox(AListBox: TcxTreeListItemsCustomizeListBox; AIndex: Integer); + procedure VisibleChanged(Sender: TObject); + procedure Update; virtual; + // IcxTreeListDesigner + procedure ComponentRemoved(Sender: TObject); virtual; + procedure Modified; virtual; + property DragAndDropObject: TcxTreeListDragAndDropObject read FDragAndDropObject write FDragAndDropObject; + property BandListBox: TcxTreeListItemsCustomizeListBox read FBandListBox; + property CustomizingPos: TPoint read FLastPosition write FLastPosition; + property HeaderListBox: TcxTreeListItemsCustomizeListBox read FHeaderListBox; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure MakeBandSheetVisible; + procedure MakeColumnSheetVisible; + property Form: TForm read GetForm; + function PtInCustomizingBox(const APoint: TPoint): Boolean; + property RowCount: Integer read FRowCount write SetRowCount default 10; + property TreeList: TcxCustomTreeListControl read FTreeList; + property Visible: Boolean read GetVisible write SetVisible; + end; + + TcxTreeListCustomizingClass = class of TcxTreeListCustomizing; + + { TcxCustomTreeListControl } + + TcxTreeListNodeChangedEvent = procedure(Sender: TObject; ANode: TcxTreeListNode) of object; + + TcxTreeListNodeChangingEvent = procedure(Sender: TObject; ANode: TcxTreeListNode; + var Allow: Boolean) of object; + + TcxTreeListMoveToEvent = procedure(Sender: TObject; AttachNode: TcxTreeListNode; + AttachMode: TcxTreeListNodeAttachMode; Nodes: TList; var IsCopy, Done: Boolean) of object; + + TcxTreeListNodeCompareEvent = procedure(Sender: TObject; + ANode1, ANode2: TcxTreeListNode; var ACompare: Integer) of object; + + TcxTreeListFocusedChangedEvent = procedure(Sender: TObject; + APrevFocusedNode, AFocusedNode: TcxTreeListNode) of object; + + TcxTreeListGetNodeImageIndexEvent = procedure(Sender: Tobject; + ANode: TcxTreeListNode; AIndexType: TcxTreeListImageIndexType; var AIndex: TImageIndex) of object; + + TcxTreeListGetPreviewTextEvent = procedure(Sender: TObject; + ANode: TcxTreeListNode; var AText: string) of object; + + TcxTreeListGetNodePreviewHeightEvent = procedure(Sender: TObject; + ANode: TcxTreeListNode; const ADisplayValue: Variant; var AHeight: Integer) of object; + + TcxTreeListIsGroupNodeEvent = procedure(Sender: TObject; + ANode: TcxTreeListNode; var IsGroup: Boolean) of object; + + TcxTreeListEditingEvent = procedure(Sender: TObject; + AColumn: TcxTreeListColumn; var Allow: Boolean) of object; + + TcxTreeListColumnChangedEvent = procedure(Sender: TObject; + AColumn: TcxTreeListColumn) of object; + + TcxTreeListBandChangedEvent = procedure(Sender: TObject; + ABand: TcxTreeListBand) of object; + + TcxTreeListFocusedColumnChanged = procedure(Sender: TObject; + APrevFocusedColumn, AFocusedColumn: TcxTreeListColumn) of object; + + TcxTreeListOnHotTrackNodeEvent = procedure(Sender: TObject; ANode: TcxTreeListNode; + AShift: TShiftState; var ACursor: TCursor) of object; + + TcxTreeListItemChangedEvent = procedure(Sender: TObject; AItem: TObject) of object; + + TcxTreeListNodeDataChangedEvent = procedure(Sender: TObject; + ANode: TcxTreeListNode; AColumn: TcxTreeListColumn) of object; + + TcxCustomDrawBackgroundEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + const R: TRect; var ADone: Boolean) of object; + + TcxCustomDrawEditCellViewInfoEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + AViewInfo: TcxTreeListEditCellViewInfo; var ADone: Boolean) of object; + + TcxCustomDrawCellsGroupViewInfoEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + AViewInfo: TcxTreeListCellsGroupViewInfo; var ADone: Boolean) of object; + + TcxCustomDrawHeaderViewInfoEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + AViewInfo: TcxTreeListHeaderViewInfo; var ADone: Boolean) of object; + + TcxCustomDrawIndentViewInfoEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + AViewInfo: TcxTreeListIndentViewInfo; var ADone: Boolean) of object; + + TcxCustomDrawIndicatorViewInfoEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + AViewInfo: TcxTreeListIndicatorViewInfo; var ADone: Boolean) of object; + + TcxCustomDrawFooterItemViewInfoEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + AViewInfo: TcxTreeListFooterItemViewInfo; var ADone: Boolean) of object; + + TcxCustomDrawBandViewInfoEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + AViewInfo: TcxTreeListBandViewInfo; var ADone: Boolean) of object; + + TcxTreeListGetNodeHeight = procedure(Sender: TcxCustomTreeListControl; + ANode: TcxTreeListNode; var AHeight: Integer) of object; + + TcxCustomTreeListControl = class(TcxExtEditingControl, IcxNavigator, IcxStoredParent, + IcxStoredObject, IcxTreeListDesignTimeOperations, IdxSkinSupport) + private + FAutoWidthController: TcxAutoWidthObject; + FBands: TcxTreeListBands; + FBandsVisibleList: TList; + FChangeImagesLink: TChangeLink; + FChangeStateImagesLink: TChangeLink; + FCheckedList: TList; + FColumnsVisibleList: TList; + FContentIndentWidth: Integer; + FCustomizing: TcxTreeListCustomizing; + FDelayTimer: TTimer; + FDefaultLayout: Boolean; + FDefaultRowHeight: Integer; + FDeletedNodes: TList; + FDesigners: TList; + FDragNode: TcxTreeListNode; + FFreezeCount: Integer; + FHeaderLineCount: Integer; + FImages: TCustomImageList; + FLevelIndentWidth: Integer; + FLockChanges: Boolean; + FNavigatorNotifier: TcxNavigatorControlNotifier; + FNodes: TcxTreeListNodes; + FNodesList: TList; + FNeedMakeVisible: Boolean; + FNeedSortPost: Boolean; + FNeedUpdateDesigners: Boolean; + FNeedRestoreSorting: Boolean; + FNeedFocusedRecordUpdatePost: Boolean; + FOptionsCustomizing: TcxTreeListOptionsCustomizing; + FOptionsSelection: TcxTreeListOptionsSelection; + FPostChanged: Boolean; + FPreview: TcxTreeListPreview; + FRealBandLineHeight: Integer; + FSafeDelete: Boolean; + FSortedColumns: TList; + FSortLocking: Integer; + FSortOrderList: TList; + FSelection: TList; + FSelectionUpdateLocked: Integer; + FStateImages: TCustomImageList; + FStoredCursor: TCursor; + FStylesEvents: TNotifyEvent; + FTopPos: Integer; + FUseGlassCursor: Integer; + FOnAfterSorting: TNotifyEvent; + FOnBandHeaderClick: TcxTreeListBandChangedEvent; + FOnBandSizeChanged: TcxTreeListItemChangedEvent; + FOnCanSelectNode: TcxTreeListNodeChangingEvent; + FOnChange: TNotifyEvent; + FOnCollapsed: TcxTreeListNodeChangedEvent; + FOnCollapsing: TcxTreeListNodeChangingEvent; + FOnColumnHeaderClick: TcxTreeListColumnChangedEvent; + FOnColumnSizeChanged: TcxTreeListItemChangedEvent; + FOnCompare: TcxTreeListNodeCompareEvent; + FOnCustomDrawBackground: TcxCustomDrawBackgroundEvent; + FOnCustomDrawBandHeader: TcxCustomDrawHeaderViewInfoEvent; + FOnCustomDrawCell: TcxCustomDrawEditCellViewInfoEvent; + FOnCustomDrawCellsGroup: TcxCustomDrawCellsGroupViewInfoEvent; + FOnCustomDrawIndicatorCell: TcxCustomDrawIndicatorViewInfoEvent; + FOnCustomDrawIndentCell: TcxCustomDrawIndentViewInfoEvent; + FOnCustomDrawFooter: TcxCustomDrawBandViewInfoEvent; + FOnCustomDrawFooterCell: TcxCustomDrawFooterItemViewInfoEvent; + FOnCustomDrawHeader: TcxCustomDrawBandViewInfoEvent; + FOnCustomDrawHeaderCell: TcxCustomDrawHeaderViewInfoEvent; + FOnCustomDrawPreview: TcxCustomDrawEditCellViewInfoEvent; + FOnCustomizationVisibleChanged: TNotifyEvent; + FOnDataChanged: TNotifyEvent; + FOnDeletion: TcxTreeListNodeChangedEvent; + FOnExpanded: TcxTreeListNodeChangedEvent; + FOnExpanding: TcxTreeListNodeChangingEvent; + FOnFocusedColumnChanged: TcxTreeListFocusedColumnChanged; + FOnFocusedNodeChanged: TcxTreeListFocusedChangedEvent; + FOnGetNodeImageIndex: TcxTreeListGetNodeImageIndexEvent; + FOnGetNodePreviewHeight: TcxTreeListGetNodePreviewHeightEvent; + FOnGetNodeHeight: TcxTreeListGetNodeHeight; + FOnHotTrackNode: TcxTreeListOnHotTrackNodeEvent; + FOnIsGroupNode: TcxTreeListIsGroupNodeEvent; + FOnLayoutChanged: TNotifyEvent; + FOnMoveTo: TcxTreeListMoveToEvent; + FOnNodeChanged: TcxTreeListNodeDataChangedEvent; + FOnSelectionChanged: TNotifyEvent; + FOnSorting: TNotifyEvent; + FOnTopRecordIndexChanged: TNotifyEvent; + function GetBands: TcxTreeListBands; + function GetBandPanelHeight: Integer; + function GetColumn(AIndex: Integer): TcxTreeListColumn; + function GetColumnCount: Integer; + function GetColumnsList: TList; + function GetController: TcxTreeListController; + function GetCount: Integer; + function GetDefaultRowHeight: Integer; + function GetFixedBandCount: Integer; + function GetFooterHeight: Integer; + function GetFocusedColumn: TcxTreeListColumn; + function GetFocusedNode: TcxTreeListNode; + function GetHeaderHeight: Integer; + function GetHeaderPanelHeight: Integer; + function GetHitTest: TcxTreeListHitTest; + function GetInplaceEditor: TcxCustomEdit; + function GetInplaceColumnIndex: Integer; + function GetIsEditing: Boolean; + function GetItem(Index: Integer): TcxTreeListNode; + function GetLastNode: TcxTreeListNode; + function GetLastVisibleNode: TcxTreeListNode; + function GetNavigatorIsActive: Boolean; + function GetOnAfterSummary: TcxAfterSummaryEvent; + function GetOnEdited: TcxTreeListColumnChangedEvent; + function GetOnEditing: TcxTreeListEditingEvent; + function GetOnEditValueChanged: TcxTreeListColumnChangedEvent; + function GetOnSummary: TcxSummaryEvent; + function GetOptionsBehavior: TcxTreeListOptionsBehavior; + function GetOptionsData: TcxTreeListOptionsData; + function GetOptionsView: TcxTreeListOptionsView; + function GetSearching: Boolean; + function GetSearchingText: string; + function GetSelection(Index: Integer): TcxtreeListNode; + function GetSelectionCount: Integer; + function GetSorted: Boolean; + function GetSortedColumnCount: Integer; + function GetSortedColumn(Index: Integer): TcxTreeListColumn; + function GetStyles: TcxTreeListStyles; + function GetSummary: TcxDataSummary; + function GetTopNode: TcxTreeListNode; + function GetTopVisibleIndex: Integer; + function GetTopVisibleNode: TcxTreeListNode; + function GetVisibleCount: Integer; + function GetViewInfo: TcxTreeListViewInfo; + function GetVisibleBand(AIndex: Integer): TcxTreeListBand; + function GetVisibleBandCount: Integer; + function GetVisibleColumn(AIndex: Integer): TcxTreeListColumn; + function GetVisibleColumnCount: Integer; + function IsDefaultRowHeightAssigned: Boolean; + procedure SetBands(Value: TcxTreeListBands); + procedure SetColumn(AIndex: Integer; Value: TcxTreeListColumn); + procedure SetDefaultRowHeight(Value: Integer); + procedure SetDefaultLayout(Value: Boolean); + procedure SetFocusedColumn(Value: TcxTreeListColumn); + procedure SetFocusedNodeProp(Value: TcxTreeListNode); + procedure SetImages(Value: TCustomImageList); + procedure SetInternalImageList(AList: TCustomImageList; var Value: TCustomImageList; ALink: TChangeLink); + procedure SetLastVisibleNode(Value: TcxTreeListNode); + procedure SetNodes(Value: TcxTreeListNodes); + procedure SetOnAfterSummary(Value: TcxAfterSummaryEvent); + procedure SetOnEdited(Value: TcxTreeListColumnChangedEvent); + procedure SetOnEditing(Value: TcxTreeListEditingEvent); + procedure SetOnEditValueChanged(Value: TcxTreeListColumnChangedEvent); + procedure SetOnSummary(Value: TcxSummaryEvent); + procedure SetOptionsBehavior(Value: TcxTreeListOptionsBehavior); + procedure SetOptionsCustomizing(Value: TcxTreeListOptionsCustomizing); + procedure SetOptionsData(Value: TcxTreeListOptionsData); + procedure SetOptionsSelection(Value: TcxTreeListOptionsSelection); + procedure SetOptionsView(Value: TcxTreeListOptionsView); + procedure SetPreview(Value: TcxTreeListPreview); + procedure SetSearchingText(const Value: string); + procedure SetSorted(Value: Boolean); + procedure SetStateImages(Value: TCustomImageList); + procedure SetStyles(Value: TcxTreeListStyles); + procedure SetTopVisibleIndex(AValue: Integer); + procedure SetTopVisibleNode(ANode: TcxTreeListNode); + procedure SetVisibleBand(Index: Integer; AValue: TcxTreeListBand); + procedure SetVisibleColumn(Index: Integer; AValue: TcxTreeListColumn); + procedure DoChangedTimer(Sender: TObject); + procedure UpdateDesignerForms; + // IcxStoredObject + function GetObjectName: string; + function GetProperties(AProperties: TStrings): Boolean; + procedure GetPropertyValue(const AName: string; var AValue: Variant); + procedure SetPropertyValue(const AName: string; const AValue: Variant); + // IcxStoredParent + function IcxStoredParent.CreateChild = StoredCreateChild; + procedure IcxStoredParent.DeleteChild = StoredDeleteChild; + procedure IcxStoredParent.GetChildren = GetStoredChildren; + // messages + procedure CMDrag(var Message: TCMDrag); message CM_DRAG; + protected + FMaxIndentWidth: Integer; + procedure AssignColumnWidths; + procedure AssignLeftMostWidths; + procedure BoundsChanged; override; + // TL procedures + function AddNode(ANode, ARelative: TcxTreeListNode; AData: Pointer; + AttachMode: TcxTreeListNodeAttachMode): TcxTreeListNode; virtual; + procedure BeforeAddNode(ANewNode, ANewParent: TcxTreeListNode; + AMode: TcxTreeListNodeAddMode); virtual; + procedure BeforeCalculate; virtual; + procedure BeforeShowingEdit; + procedure CalculateLeftMostIndentWidth; + function CanAddIndentWidth(const AIndentWidth: Integer): Boolean; virtual; + function CanColumnVisible(AColumn: TcxTreeListColumn): Boolean; virtual; + function CanMultiSelect: Boolean; virtual; + procedure CheckFocusedItem; + procedure ColumnSortOrderChanged(AColumn: TcxTreeListColumn); + procedure DoAssignNodes(Source: TcxTreeListNodes); virtual; + procedure DoBandSizeChanged(ABand: TcxTreeListBand); virtual; + procedure DoClear; virtual; + procedure DoColumnSizeChanged(AColumn: TcxTreeListColumn); virtual; + function DoCreateColumn: TcxTreeListColumn; + procedure DoDeleteSelection; + procedure AddToDelitionList(ANode: TcxTreeListNode); virtual; + procedure DoRemoveNode(ANode: TcxTreeListNode); virtual; + procedure DoCheckDeletedNode(ANode: TcxTreeListNode); virtual; + procedure DoDeleteNode(ANode: TcxTreeListNode); virtual; + procedure DoInplaceEditContainerItemRemoved(AItem: TcxCustomInplaceEditContainer); override; + procedure DoInternalMoveTo(AttachNode: TcxTreeListNode; + AttachMode: TcxTreeListNodeAttachMode; ANodes: TList; IsCopy: Boolean); + procedure DoMoveTo(AttachNode: TcxTreeListNode; + AttachMode: TcxTreeListNodeAttachMode; ANodes: TList; IsCopy: Boolean); virtual; + // doXXXX metods fire OnXXXX events + procedure DoOnAfterSorting; virtual; + procedure DoOnBandSizeChanged(ABand: TcxTreeListBand); virtual; + procedure DoOnColumnSizeChanged(AColumn: TcxTreeListColumn); virtual; + procedure DoOnCollapsed(ANode: TcxTreeListNode); virtual; + procedure DoOnCollapsing(ANode: TcxTreeListNode; var Allow: Boolean); virtual; + procedure DoOnCompare(ANode1, ANode2: TcxTreeListNode; var ACompare: Integer); virtual; + procedure DoOnCustomizationVisibleChanged; virtual; + procedure DoOnDeletion(ANode: TcxTreeListNode); virtual; + procedure DoOnExpanded(ANode: TcxTreeListNode); virtual; + procedure DoOnExpanding(ANode: TcxTreeListNode; var Allow: Boolean); virtual; + procedure DoOnGetNodeHeight(ANode: TcxTreeListNode; var AHeight: Integer); virtual; + procedure DoOnHotTrackNode(ANode: TcxTreeListNode; AShift: TShiftState; var ACursor: TCursor); virtual; + procedure DoOnIsGroupNode(ANode: TcxTreeListNode; var IsGroup: Boolean); virtual; + procedure DoOnMoveTo(AttachNode: TcxTreeListNode; AttachMode: TcxTreeListNodeAttachMode; Nodes: TList; var IsCopy, Done: Boolean); virtual; + procedure DoOnTopRecordIndexChanged; virtual; + procedure DoStartDrag(var DragObject: TDragObject); override; + // + function DoWriteHeaderToText: string; virtual; + function DoWriteNodeToText(ANode: TcxTreeListNode): string; virtual; + procedure DoWriteToClipboard(AOnlySelected: Boolean); virtual; + function DoWriteToText(AOnlySelected: Boolean; out AText: string): Boolean; + procedure DoUpdateDesignerForms; virtual; + procedure DoDeleteRecords; virtual; + procedure DoValidateDeletedNodes; virtual; + procedure DeleteSelectionList(AList: TList); virtual; + function GetCountNodeForBestFit: Integer; virtual; + function GetImageIndentWidth(AType: TcxTreeListImageIndexType): Integer; virtual; + function GetIsActive: Boolean; virtual; + function GetFixedContentSize: Integer; virtual; + function GetLevelIndentCount(ALevel: Integer; AWithImages: Boolean; ANode: TcxTreeListNode): Integer; + function GetLevelIndentsWidth(ALevel: Integer; AWithImages: Boolean; ANode: TcxTreeListNode): Integer; virtual; + function GetMaxBandWidth(ABand: TcxTreeListBand): Integer; + function GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; override; + function GetStartNodeForBestFit: TcxTreeListNode; virtual; + function HasImages: Boolean; + function ImagesIndentWidth: Integer; virtual; + function InsertNode(IsAppend: Boolean): Boolean; virtual; + procedure InternalMove(ANode, ADestNode: TcxTreeListNode; AMode: TcxTreeListNodeAttachMode); virtual; + procedure InternalCopy(ANode, ADestNode: TcxTreeListNode); virtual; + function IsMultiSelect: Boolean; + function IsCancelOperation: Boolean; virtual; + function IsSmartLoad: Boolean; virtual; + function IsNodeInserted(ANode: TcxTreeListNode): Boolean; + function IsNodeEdited(ANode: TcxTreeListNode): Boolean; + procedure MakeNodeVisible(ANode: TcxTreeListNode); virtual; + procedure OnChangeImages(Sender: TObject); virtual; + procedure SaveDragPos; virtual; + procedure RestoreDragPos; virtual; + function RealBandLineHeight: Integer; + procedure ReadData(AStream: TStream); virtual; + procedure RealignBands; virtual; + procedure RefreshVisibleIndexes; + procedure RestoreCursor; + procedure RestoreSorting; virtual; + function SkipFocusedRecordChanged: Boolean; virtual; + function SkipCancelOperation: Boolean; virtual; + procedure SetGlassCursor; + procedure SortingStateChanged(AColumn: TcxTreeListColumn; AShift: TShiftState); + procedure WriteData(AStream: TStream); virtual; + // IcxTreeListDesignTimeOperations implementation + function SupportsBandColumnEditor: Boolean; virtual; + function SupportsItemsEditor: Boolean; virtual; + function SupportsCreateAllItems: Boolean; virtual; + function GetVersion: string; virtual; + procedure CreateAllItems; virtual; + // IcxNavigator + function IcxNavigator.IsActive = GetNavigatorIsActive; + function IcxNavigator.IsEditing = GetIsEditing; + function IcxNavigator.IsBof = IsBof; + function IcxNavigator.IsEof = IsEof; + + procedure RefreshNavigatorButtons; + procedure DoAction(AButtonIndex: Integer); + function GetNotifier: TcxNavigatorControlNotifier; + function IsActionSupported(AButtonIndex: Integer): Boolean; + + function CanAppend: Boolean; + function CanEdit: Boolean; + function CanDelete: Boolean; + function CanInsert: Boolean; + + procedure ClearBookmark; + procedure GotoBookmark; + function HasData: Boolean; + function IsBookmarkAvailable: Boolean; + procedure SaveBookmark; + function UseRowIndexForNewRecord: Boolean; virtual; + // updates + procedure Freeze; + procedure UnFreeze; + function IsFreeze: Boolean; + function IsLocked: Boolean; override; + // nodes + function CreateNode: TcxTreeListNode; virtual; + function DoCanNodeCollapse(ANode: TcxTreeListNode): Boolean; virtual; + function DoCanNodeExpand(ANode: TcxTreeListNode): Boolean; virtual; + function DoCreateNode: TcxTreeListNode; + function DoGetNodeImageIndex(ANode: TcxTreeListNode; AIndex: TcxTreeListImageIndexType): TImageIndex; virtual; + function DoGetNodeValueCount: Integer; virtual; + procedure DoNodeChanged(ANode: TcxTreeListNode); virtual; + function DoIsGroupNode(ANode: TcxTreeListNode): Boolean; virtual; + procedure DoSelectAll; virtual; + procedure DoSetNodeExpanded(ANode: TcxTreeListNode; AExpanded: Boolean); virtual; + procedure DoSetNodeImageIndex(ANode: TcxTreeListNode; AIndex: TcxTreeListImageIndexType; Value: TImageIndex); virtual; +// procedure DoSetNodeSelected(ANode: TcxTreeListNode; Value: Boolean; Shift: TShiftState = []); virtual; + procedure DoSetNodeFocused(ANode: TcxTreeListNode; Value: Boolean; Shift: TShiftState = []); virtual; + procedure DoSorting; virtual; + function GetColumnById(AItemIndex: Integer): TcxTreeListColumn; + function GetNodeByID(ARecordIndex: Integer): TcxTreeListNode; + function GetSelectionsEx: TList; + // sorting + procedure CancelSortPost; + procedure DisableSorting; + procedure DoSortNodes; virtual; + procedure EnableSorting; + procedure NeedSortPost; + function IsNeedSortPost: Boolean; + procedure RecreateSortOrdersList; virtual; + + // events generation + function CheckEvent(AHasHandler: Boolean): Boolean; + + procedure DoBandHeaderClick(ABand: TcxTreeListBand); virtual; + procedure DoColumnHeaderClick(AColumn: TcxTreeListColumn); virtual; + procedure DoChanged(BlockChangedEvent: Boolean = True); virtual; + function DoCanSelectNode(ANode: TcxTreeListNode): Boolean; virtual; + procedure DoDataChangedEvent(Sender: TObject); virtual; + + procedure DoEditChanged(AItem: TcxCustomInplaceEditContainer); override; + procedure DoEdited(AItem: TcxCustomInplaceEditContainer); override; + function DoEditing(AItem: TcxCustomInplaceEditContainer): Boolean; override; + procedure DoEditValueChanged(AItem: TcxCustomInplaceEditContainer); override; + procedure DoInitEdit(AItem: TcxCustomInplaceEditContainer; AEdit: TcxCustomEdit); override; + + procedure DoFocusedItemChanged(APrevFocusedItem, + AFocusedItem: TcxCustomInplaceEditContainer); virtual; + procedure DoFocusedRecordChanged(APrevIndex, AFocusedIndex: Integer); virtual; + procedure DoLayoutChangedEvent; virtual; + procedure DoRecordChanged(Sender: TcxCustomDataController; + ARecordIndex, AItemIndex: Integer); virtual; + procedure DoSelectionChanged; virtual; + // selection + procedure BeginUpdateSelection; + procedure CancelUpdateSelection; + procedure EndUpdateSelection; + function IsSelectionLocked: Boolean; + procedure UpdateSelection; virtual; + procedure CancelFocusedRecordUpdatePost; + procedure PostUpdateFocusedRecord; + procedure UpdateFocusedRecordPost; + // used classes + function GetBandItemClass: TcxTreeListBandClass; virtual; + function GetControllerClass: TcxCustomControlControllerClass; override; + function GetControlStylesClass: TcxCustomControlStylesClass; override; + function GetHitTestControllerClass: TcxHitTestControllerClass; override; + function GetNodesClass: TcxTreeListNodesClass; virtual; + function GetOptionsCustomizingClass: TcxTreeListOptionsCustomizingClass; virtual; + function GetOptionsBehaviorClass: TcxControlOptionsBehaviorClass; override; + function GetOptionsDataClass: TcxControlOptionsDataClass; override; + function GetOptionsSelectionClass: TcxTreeListOptionsSelectionClass; virtual; + function GetOptionsViewClass: TcxControlOptionsViewClass; override; + function GetPainterClass: TcxCustomControlPainterClass; override; + function GetPreviewClass: TcxTreeListPreviewClass; virtual; + function GetTreeListColumnClass: TcxTreeListColumnClass; virtual; + function GetTreeListCustomizingClass: TcxTreeListCustomizingClass; virtual; + function GetViewInfoClass: TcxCustomControlViewInfoClass; override; + procedure UpdateColumn(ANode: TcxTreeListNode; AColumn: TcxTreeListColumn); virtual; + procedure UpdateNode(ANode: TcxTreeListNode); virtual; + // overrided methods + procedure AfterLayoutChanged; override; + procedure BeforeUpdate; override; + procedure CheckCreateDesignSelectionHelper; override; + procedure ControlUpdateData(AInfo: TcxUpdateControlInfo); override; + procedure CreateSubClasses; override; + procedure DataChanged; override; + procedure DataLayoutChanged; override; + procedure DestroySubClasses; override; + procedure DoLayoutChanged; override; + function DragDropImageDisplayRect: TRect; override; + procedure DrawDragDropImage(ADragBitmap: TBitmap; ACanvas: TcxCanvas); override; + function GetDragDropText: string; virtual; + function GetDragDropViewParams: TcxViewParams; virtual; + function GetDragObjectClass: TDragControlObjectClass; override; + function GetImageListHeight(AImageList: TCustomImageList): Integer; virtual; + procedure InitScrollBarsParameters; override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); override; + procedure ReadState(Reader: TReader); override; + procedure Updated; override; + procedure Updating; override; + // inherits for loading bug fixing + procedure AssignColumnsParams; virtual; + procedure SaveColumnsParams; virtual; + + // cxStorage implementation + procedure GetStoredChildren(AChildren: TStringList); virtual; + function GetStoredObjectName: string; virtual; + function GetStoredObjectProperties(AProperties: TStrings): Boolean; virtual; + procedure GetStoredPropertyValue(const AName: string; var AValue: Variant); virtual; + procedure RestoreTopPos; + procedure StoreTopPos; + procedure SetStoredPropertyValue(const AName: string; const AValue: Variant); virtual; + function StoredCreateChild(const AObjectName, AClassName: string): TObject; virtual; + procedure StoredDeleteChild(const AObjectName: string; AObject: TObject); virtual; + // standart control metods + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + function IsUpdating: Boolean; + procedure Loaded; override; + procedure Modified; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure SetName(const NewName: TComponentName); override; + property Bands: TcxTreeListBands read GetBands write SetBands; + property CheckedList: TList read FCheckedList write FCheckedList; + property ColumnCount: Integer read GetColumnCount; + property Columns[Index: Integer]: TcxTreeListColumn read GetColumn write SetColumn; + property ColumnsList: TList read GetColumnsList; + property Controller: TcxTreeListController read GetController; + property Customizing: TcxTreeListCustomizing read FCustomizing write FCustomizing; + property DefaultLayout: Boolean read FDefaultLayout write SetDefaultLayout default False; + property DeletedNodes: TList read FDeletedNodes write FDeletedNodes; + property Designers: TList read FDesigners; + property FixedBandCount: Integer read GetFixedBandCount; + property FocusedColumn: TcxTreeListColumn read GetFocusedColumn write SetFocusedColumn; + property HeaderLineCount: Integer read FHeaderLineCount; + property HitTest: TcxTreeListHitTest read GetHitTest; + property Images: TCustomImageList read FImages write SetImages; + property LastVisibleNode: TcxTreeListNode read GetLastVisibleNode write SetLastVisibleNode; + property LockChanges: Boolean read FLockChanges write FLockChanges; + property Nodes: TcxTreeListNodes read FNodes write SetNodes; + property NodesList: TList read FNodesList write FNodesList; + property NeedRestoreSorting: Boolean read FNeedRestoreSorting write FNeedRestoreSorting; + property OptionsBehavior: TcxTreeListOptionsBehavior read GetOptionsBehavior write SetOptionsBehavior; + property OptionsCustomizing: TcxTreeListOptionsCustomizing read FOptionsCustomizing write SetOptionsCustomizing; + property OptionsData: TcxTreeListOptionsData read GetOptionsData write SetOptionsData; + property OptionsSelection: TcxTreeListOptionsSelection read FOptionsSelection write SetOptionsSelection; + property OptionsView: TcxTreeListOptionsView read GetOptionsView write SetOptionsView; + property Preview: TcxTreeListPreview read FPreview write SetPreview; + property SafeDelete: Boolean read FSafeDelete write FSafeDelete; + property SelectionCount: Integer read GetSelectionCount; + property Selections[Index: Integer]: TcxTreeListNode read GetSelection; + property SortedColumnCount: Integer read GetSortedColumnCount; + property SortedColumns[Index: Integer]: TcxTreeListColumn read GetSortedColumn; + property SortOrderList: TList read FSortOrderList; + property StateImages: TCustomImageList read FStateImages write SetStateImages; + property StoredCursor: TCursor read FStoredCursor; + property StylesEvents: TNotifyEvent read FStylesEvents write FStylesEvents; + property TopVisibleIndex: Integer read GetTopVisibleIndex write SetTopVisibleIndex; + property TopVisibleNode: TcxTreeListNode read GetTopVisibleNode write SetTopVisibleNode; + property ViewInfo: TcxTreeListViewInfo read GetViewInfo; + property VisibleBandCount: Integer read GetVisibleBandCount; + property VisibleBands[Index: Integer]: TcxTreeListBand read GetVisibleBand write SetVisibleBand; + property VisibleColumnCount: Integer read GetVisibleColumnCount; + property VisibleColumns[Index: Integer]: TcxTreeListColumn read GetVisibleColumn write SetVisibleColumn; + property VisibleCount: Integer read GetVisibleCount; + property OnAfterSorting: TNotifyEvent read FOnAfterSorting write FOnAfterSorting; + property OnAfterSummary: TcxAfterSummaryEvent read GetOnAfterSummary write SetOnAfterSummary; + property OnBandHeaderClick: TcxTreeListBandChangedEvent read FOnBandHeaderClick write FOnBandHeaderClick; + property OnBandSizeChanged: TcxTreeListItemChangedEvent read FOnBandSizeChanged write FOnBandSizeChanged; + property OnCanSelectNode: TcxTreeListNodeChangingEvent read FOnCanSelectNode write FOnCanSelectNode; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + property OnCollapsed: TcxTreeListNodeChangedEvent read FOnCollapsed write FOnCollapsed; + property OnCollapsing: TcxTreeListNodeChangingEvent read FOnCollapsing write FOnCollapsing; + property OnColumnHeaderClick: TcxTreeListColumnChangedEvent read FOnColumnHeaderClick write FOnColumnHeaderClick; + property OnColumnSizeChanged: TcxTreeListItemChangedEvent read FOnColumnSizeChanged write FOnColumnSizeChanged; + property OnCompare: TcxTreeListNodeCompareEvent read FOnCompare write FOnCompare; + property OnCustomDrawBackground: TcxCustomDrawBackgroundEvent read FOnCustomDrawBackground write FOnCustomDrawBackground; + property OnCustomDrawBandHeader: TcxCustomDrawHeaderViewInfoEvent read FOnCustomDrawBandHeader write FOnCustomDrawBandHeader; + property OnCustomDrawCell: TcxCustomDrawEditCellViewInfoEvent read FOnCustomDrawCell write FOnCustomDrawCell; + property OnCustomDrawCellsGroup: TcxCustomDrawCellsGroupViewInfoEvent read FOnCustomDrawCellsGroup write FOnCustomDrawCellsGroup; + property OnCustomDrawFooter: TcxCustomDrawBandViewInfoEvent read FOnCustomDrawFooter write FOnCustomDrawFooter; + property OnCustomDrawFooterCell: TcxCustomDrawFooterItemViewInfoEvent read FOnCustomDrawFooterCell write FOnCustomDrawFooterCell; + property OnCustomDrawHeader: TcxCustomDrawBandViewInfoEvent read FOnCustomDrawHeader write FOnCustomDrawHeader; + property OnCustomDrawHeaderCell: TcxCustomDrawHeaderViewInfoEvent read FOnCustomDrawHeaderCell write FOnCustomDrawHeaderCell; + property OnCustomDrawIndentCell: TcxCustomDrawIndentViewInfoEvent read FOnCustomDrawIndentCell write FOnCustomDrawIndentCell; + property OnCustomDrawIndicatorCell: TcxCustomDrawIndicatorViewInfoEvent read FOnCustomDrawIndicatorCell write FOnCustomDrawIndicatorCell; + property OnCustomDrawPreview: TcxCustomDrawEditCellViewInfoEvent read FOnCustomDrawPreview write FOnCustomDrawPreview; + property OnCustomizationFormVisibleChanged: TNotifyEvent read FOnCustomizationVisibleChanged write FOnCustomizationVisibleChanged; + property OnDataChanged: TNotifyEvent read FOnDataChanged write FOnDataChanged; + property OnDeletion: TcxTreeListNodeChangedEvent read FOnDeletion write FOnDeletion; + property OnEdited: TcxTreeListColumnChangedEvent read GetOnEdited write SetOnEdited; + property OnEditing: TcxTreeListEditingEvent read GetOnEditing write SetOnEditing; + property OnEditValueChanged: TcxTreeListColumnChangedEvent read GetOnEditValueChanged write SetOnEditValueChanged; + property OnExpanded: TcxTreeListNodeChangedEvent read FOnExpanded write FOnExpanded; + property OnExpanding: TcxTreeListNodeChangingEvent read FOnExpanding write FOnExpanding; + property OnFocusedColumnChanged: TcxTreeListFocusedColumnChanged read FOnFocusedColumnChanged write FOnFocusedColumnChanged; + property OnFocusedNodeChanged: TcxTreeListFocusedChangedEvent read FOnFocusedNodeChanged write FOnFocusedNodeChanged; + property OnGetNodeHeight: TcxTreeListGetNodeHeight read FOnGetNodeHeight write FOnGetNodeHeight; + property OnGetNodeImageIndex: TcxTreeListGetNodeImageIndexEvent read FOnGetNodeImageIndex write FOnGetNodeImageIndex; + property OnGetNodePreviewHeight: TcxTreeListGetNodePreviewHeightEvent read FOnGetNodePreviewHeight write FOnGetNodePreviewHeight; + property OnHotTrackNode: TcxTreeListOnHotTrackNodeEvent read FOnHotTrackNode write FOnHotTrackNode; + property OnIsGroupNode: TcxTreeListIsGroupNodeEvent read FOnIsGroupNode write FOnIsGroupNode; + property OnLayoutChanged: TNotifyEvent read FOnLayoutChanged write FOnLayoutChanged; + property OnMoveTo: TcxTreeListMoveToEvent read FOnMoveTo write FOnMoveTo; + property OnNodeChanged: TcxTreeListNodeDataChangedEvent read FOnNodeChanged write FOnNodeChanged; + property OnSelectionChanged: TNotifyEvent read FOnSelectionChanged write FOnSelectionChanged; + property OnSorting: TNotifyEvent read FOnSorting write FOnSorting; + property OnSummary: TcxSummaryEvent read GetOnSummary write SetOnSummary; + property OnTopRecordIndexChanged: TNotifyEvent read FOnTopRecordIndexChanged write FOnTopRecordIndexChanged; + // + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure AdjustColumnsWidth; + procedure ApplyBestFit; + procedure Clear; + function CreateColumn(ABand: TcxTreeListBand = nil): TcxTreeListColumn; virtual; + procedure DeleteAllColumns; virtual; + procedure DeleteSelection; + procedure DragDrop(Source: TObject; X, Y: Integer); override; + function GetIndentWidth(IsLeftMost: Boolean): Integer; + procedure MakeDefaultLayout; virtual; + procedure FullCollapse; + procedure FullExpand; + procedure FullRefresh; virtual; + function Find(AData: Pointer; AStart: TcxTreeListNode; AExpandedOnly, AForward: Boolean; + AFilter: TcxTreeListFindFunc): TcxTreeListNode; virtual; + function FindNodeByText(const AText: string; AColumn: TcxTreeListColumn; + AStartNode: TcxTreeListNode = nil; AExpandedOnly: Boolean = False; AForward: Boolean = True): TcxTreeListNode; + procedure SelectAll; + procedure Select(Node: TcxTreeListNode; ShiftState: TShiftState = []); overload; virtual; + procedure Select(const ANodes: array of TcxTreeListNode); overload; virtual; + procedure Select(ANodes: TList); overload; virtual; + procedure SetFocusedNode(Value: TcxTreeListNode; AShift: TShiftState); + procedure SetColumnSortOrder(AColumn: TcxTreeListColumn; + ASortOrder: TcxDataSortOrder; AShift: TShiftState); + function StartDrag(DragObject: TDragObject): Boolean; override; + procedure Subselect(Node: TcxTreeListNode); virtual; + procedure Deselect(Node: TcxTreeListNode); virtual; + procedure ClearSelection(KeepPrimary: Boolean = False); virtual; + procedure ClearSorting; + function ColumnByName(const AName: string): TcxTreeListColumn; + function GetSelections(AList: TList): TcxTreeListNode; + // navigation + procedure GotoBOF; + procedure GotoEOF; + procedure GotoNext; + procedure GotoNextPage; + procedure GotoPrev; + procedure GotoPrevPage; + function IsBOF: Boolean; + function IsEOF: Boolean; + // edit control + procedure CancelEdit; + procedure HideEdit; + procedure ShowEdit; + procedure ShowEditByKey(AKey: Char); + procedure ShowEditByMouse(X, Y: Integer; AShift: TShiftState); + // storing layout + procedure RestoreFromIniFile(const AStorageName: string; AChildrenCreating: Boolean = False; + AChildrenDeleting: Boolean = False); + procedure RestoreFromRegistry(const AStorageName: string; AChildrenCreating: Boolean = False; + AChildrenDeleting: Boolean = False); + procedure RestoreFromStream(AStream: TStream; AChildrenCreating: Boolean = False; + AChildrenDeleting: Boolean = False); + procedure StoreToIniFile(AStorageName: string; AReCreate: Boolean = True); + procedure StoreToRegistry(AStorageName: string; AReCreate: Boolean = True); + procedure StoreToStream(AStream: TStream); + // searching + function FindNext(AForward: Boolean): Boolean; + procedure CancelSearching; + // positions + function CellRect(ANode: TcxTreeListNode; AColumn: TcxTreeListColumn): TRect; + function GetEditRect(ANode: TcxTreeListNode; AColumn: TcxTreeListColumn): TRect; + function GetNodeAt(X, Y: Integer): TcxTreeListNode; + // misc + procedure CopyAllToClipboard; + procedure CopySelectedToClipboard; + procedure RestoreColumnsDefaults; + procedure RestoreColumnsWidths; + property BandPanelHeight: Integer read GetBandPanelHeight; + property BorderSize; + property Count: Integer read GetCount; + property DefaultRowHeight: Integer read GetDefaultRowHeight write SetDefaultRowHeight stored IsDefaultRowHeightAssigned; + property DragNode: TcxTreeListNode read FDragNode; + property FocusedNode: TcxTreeListNode read GetFocusedNode write SetFocusedNodeProp; + property FooterPanelHeight: Integer read GetFooterHeight; + property HeaderHeight: Integer read GetHeaderHeight; + property HeaderPanelHeight: Integer read GetHeaderPanelHeight; + property InplaceColumnIndex: Integer read GetInplaceColumnIndex; + property InplaceEditor: TcxCustomEdit read GetInplaceEditor; + property IsActive: Boolean read GetIsActive; + property IsEditing: Boolean read GetIsEditing; + property Items[Index: Integer]: TcxTreeListNode read GetItem; + property LastNode: TcxTreeListNode read GetLastNode; + property LevelIndentWidth: Integer read FLevelIndentWidth write FLevelIndentWidth; + property Searching: Boolean read GetSearching; + property SearchingText: string read GetSearchingText write SetSearchingText; + property Sorted: Boolean read GetSorted write SetSorted; + property Styles: TcxTreeListStyles read GetStyles write SetStyles; + property Summary: TcxDataSummary read GetSummary; + property TopNode: TcxTreeListNode read GetTopNode; + property Color; + end; + + { TcxTreeList } + + TcxTreeList = class(TcxCustomTreeListControl) + private + FLoadingTemporaryStream: TMemoryStream; + function ExCreateNode(AParent, APrev: TcxTreeListNode; var AIndex: Integer): TcxTreeListNode; + protected + procedure DoAssignNodes(Source: TcxTreeListNodes); override; + procedure DoSetNodeImageIndex(ANode: TcxTreeListNode; + AIndex: TcxTreeListImageIndexType; Value: TImageIndex); override; + procedure DefineProperties(Filer: TFiler); override; + procedure Loaded; override; + function SupportsBandColumnEditor: Boolean; override; + function SupportsItemsEditor: Boolean; override; + procedure ReadBinaryData(AStream: TStream); + procedure ReadData(AStream: TStream); override; + procedure WriteData(AStream: TStream); override; + public + destructor Destroy; override; + function Add: TcxTreeListNode; overload; + function Add(ASibling: TcxTreeListNode; AData: Pointer = nil): TcxTreeListNode; overload; + function AddChild(AParent: TcxTreeListNode; AData: Pointer = nil): TcxTreeListNode; + function AddChildFirst(AParent: TcxTreeListNode; AData: Pointer = nil): TcxTreeListNode; + function AddFirst: TcxTreeListNode; overload; + function AddFirst(ASibling: TcxTreeListNode; AData: Pointer = nil): TcxTreeListNode; overload; + function AddNode(ANode, ARelative: TcxTreeListNode; + AData: Pointer; AttachMode: TcxTreeListNodeAttachMode): TcxTreeListNode; override; + function Insert(ASibling: TcxTreeListNode; AData: Pointer = nil): TcxTreeListNode; + function InsertEx(ANode, ASibling: TcxTreeListNode; AData: Pointer = nil): TcxTreeListNode; + procedure LoadFromFile(const AFileName: string); + procedure LoadFromStream(AStream: TStream); + procedure SaveToFile(const AFileName: string); + procedure SaveToStream(AStream: TStream); + property ColumnCount; + property Columns; + property Customizing; + property FocusedColumn; + property FocusedNode; + property HitTest; + property IsEditing; + property LevelIndentWidth; + property Nodes; + property SelectionCount; + property Selections; + property Sorted; + property SortedColumnCount; + property SortedColumns; + property TopVisibleIndex; + property TopVisibleNode; + property VisibleBandCount; + property VisibleBands; + property VisibleColumnCount; + property VisibleColumns; + property VisibleCount; + published + property Align; + property Anchors; + property Bands; + property BorderStyle; + property BufferedPaint; + property Constraints; + property Cursor; + property DefaultLayout; + property DefaultRowHeight; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property Font; + {$IFDEF DELPHI6} + property HelpContext; + property HelpKeyword; + property HelpType; + {$ENDIF} + property Hint; + property Images; + property LookAndFeel; + property OptionsBehavior; + property OptionsCustomizing; + property OptionsData; + property OptionsSelection; + property OptionsView; + property ParentColor; + property ParentFont; + property PopupMenu; + property Preview; + property StateImages; + property Styles; + property StylesEvents; + property TabOrder; + property TabStop; + property Visible; + // TreeList events + property OnAfterSorting; + property OnAfterSummary; + property OnBandHeaderClick; + property OnBandSizeChanged; + property OnCanResize; + property OnCanSelectNode; + property OnChange; + property OnClick; + property OnCollapsed; + property OnCollapsing; + property OnColumnHeaderClick; + property OnColumnSizeChanged; + property OnCompare; + property OnConstrainedResize; + property OnSorting; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnCustomDrawBackground; + property OnCustomDrawBandHeader; + property OnCustomDrawCell; + property OnCustomDrawCellsGroup; + property OnCustomDrawFooter; + property OnCustomDrawFooterCell; + property OnCustomDrawHeader; + property OnCustomDrawHeaderCell; + property OnCustomDrawIndentCell; + property OnCustomDrawIndicatorCell; + property OnCustomDrawPreview; + property OnCustomizationFormVisibleChanged; + property OnDataChanged; + property OnDblClick; + property OnDeletion; + property OnDockDrop; + property OnDockOver; + property OnDragDrop; + property OnDragOver; + property OnEdited; + property OnEditing; + property OnEditValueChanged; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnExpanded; + property OnExpanding; + property OnFocusedColumnChanged; + property OnFocusedNodeChanged; + property OnGetNodeImageIndex; + property OnGetNodePreviewHeight; + property OnGetSiteInfo; + property OnHotTrackNode; + property OnInitEdit; + property OnIsGroupNode; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnLayoutChanged; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnMouseWheel; + property OnMouseWheelDown; + property OnMouseWheelUp; + property OnMoveTo; + property OnNodeChanged; + property OnResize; + property OnSelectionChanged; + property OnStartDock; + property OnStartDrag; + property OnSummary; + property OnTopRecordIndexChanged; + property OnUnDock; + end; + +procedure cxTreeListError(const Description: string); +function cxCompareColumnsPos(AItem1, AItem2: Pointer): Integer; +function cxCompareColumnsPosEx(AItem1, AItem2: Pointer): Integer; + +var + DesignerNavigatorProc: procedure(AListener: TObject; AddListener: Boolean) of object; + +implementation + +{$R cxTL.res} + +const + cxTreeListVersion = $00040002; + + cxInvalidIndex = -1; + cxMinCapacityInc = 32; + cxMaxCapacityInc = 32768; + + cxDefaultImageIndexes: TcxTreeListNodeImageIndexes = (0, 0, -1); + + // internal column state + + tlcsVisible = $08; + + // internal band state + tlbsVisible = $00; + tlbsFixedLeft = $02; + tlbsFixedRight = $04; + tlbsAllFixed = tlbsFixedRight or tlbsFixedLeft; + + ColumnPropertiesName: array[0..11] of string = + ('Visible', 'Index', 'LineCount', 'ColIndex', 'RowIndex', + 'BandIndex', 'Caption', 'SortOrder', 'SortIndex', 'RealMinWidth', 'IsWidthAssigned', 'RealWidth'); + BandPropertiesName: array[0..4] of string = + ('Caption', 'RealMinWidth', 'RealWidth', 'Visible', 'Index'); + + GridLineBorders: array[TcxTreeListGridLines] of TcxBorders = + ([], [bTop, bBottom], [bLeft, bRight], cxBordersAll); + +type + TAllowExpandChangingFunc = function: Boolean of object; + + TcxDataControllerAccess = class(TcxDataController); + TcxItemDataBindingAccess = class(TcxItemDataBinding); + TControlAccess = class(TWinControl); + TcxEditingControllerAccess = class(TcxEditingController); + + TcxDefColorFunc = function: TColor of object; + + TcxTreeListDataSignature = packed record + Version, Size: Integer; + end; + + { TSortingManager } + + PNodesList = ^TNodesList; + TNodesList = array[0..MaxInt div SizeOf(Pointer) - 1] of TcxTreeListNode; + + PcxSortData = ^TcxSortData; + TcxSortData = record + Count: Integer; + Items: PIntArray; + end; + + PcxSortingItem = ^TcxSortingItem; + TcxSortingItem = packed record + Capacity: Integer; + Compare: TcxTreeListCompareFunc; + IsInternalCompare: Boolean; + Count: Integer; + DataController: TcxCustomDataController; + NodesList: PNodesList; + Node: TcxTreeListNode; + NeedUpdate: Boolean; + TreeList: TcxCustomTreeListControl; + SortOrderList: TList; + Recurse: Boolean; + RefCount: Integer; + end; + + TSortingManager = class + private + FList: TList; + protected + function AddItem(ANode: TcxTreeListNode; ACompare: TcxTreeListCompareFunc; + ARecurse: Boolean): PcxSortingItem; + procedure DoneItem(AItem: PcxSortingItem); + procedure InitItem(AItem: PcxSortingItem); + procedure InternalSort(AItem: PcxSortingItem); + procedure InternalSortChildren(AItem: PcxSortingItem); + procedure UpdateLinks(AItem: PcxSortingItem); + public + constructor Create; + destructor Destroy; override; + procedure Sort(ANode: TcxTreeListNode; + ACompare: TcxTreeListCompareFunc; ARecurse: Boolean = False); + end; + + { TcxTemporaryCellViewInfo } + + TcxTemporaryCellViewInfo = class(TcxTreeListEditCellViewInfo) + private + function GetNode: TcxTreeListNode; override; + function GetNodesViewInfo: TcxTreeListNodesViewInfo; override; + function GetNodeViewInfo: TcxTreeListNodeViewInfo; override; + function GetTreeList: TcxCustomTreeListControl; override; + protected + CellColumn: TcxTreeListColumn; + NodeIsFocused: Boolean; + CellNode: TcxTreeListNode; + function ContentOffset: TRect; override; + function GetButtonTransparency: TcxEditButtonTransparency; override; + function GetColumn: TcxTreeListColumn; override; + function GetEditContainer: TcxCustomInplaceEditContainer; override; + function GetFocused: Boolean; override; + function GetLineCount: Integer; override; + function GetRecordIndex: Integer; override; + function GetSelected: Boolean; override; + function IsAutoHeight: Boolean; override; + function IsEndEllipsis: Boolean; override; + public + destructor Destroy; override; + function CalculateWidth(AColumn: TcxTreeListColumn; ANode: TcxTreeListNode; + AIsFocused: Boolean; AHeight: Integer): Integer; + property Column; + property Node; + property TreeList; + end; + +var + SortingManager: TSortingManager; + +function cxFind(ATreeList: TcxCustomTreeListControl; AData: Pointer; + AStart: TcxTreeListNode; AExpandedOnly, AForward: Boolean; + AFilter: TcxTreeListFindFunc): TcxTreeListNode; + + function LoadChildren(ANode: TcxTreeListNode): Boolean; + begin + with ANode do + begin + if (FCount = 0) and HasChildren and not Expanded and not AExpandedOnly then + begin + ANode.Expanded := True; + ANode.Expanded := False; + end; + Result := (FCount <> 0) and (Expanded or not AExpandedOnly); + end; + end; + + function GetNext(ANode: TcxTreeListNode): TcxTreeListNode; + begin + Result := ANode; + if not LoadChildren(Result) then + while Result <> nil do + begin + if Result.FNext <> nil then + begin + Result := Result.FNext; + Break; + end; + while (Result <> nil) and (Result.FNext = nil) do + Result := Result.Parent; + end + else + Result := Result.FFirst; + end; + + function GetPrev(ANode: TcxTreeListNode): TcxTreeListNode; + begin + Result := ANode; + if Result.FPrev <> nil then + begin + Result := Result.FPrev; + while LoadChildren(Result) do Result := Result.FLast; + end + else + begin + Result := Result.Parent; + if Result = ATreeList.Nodes.Root then + Result := nil;; + end; + end; + +begin + Result := nil; + if AStart = nil then + AStart := ATreeList.FNodes.Root.FFirst; + ATreeList.BeginUpdate; + try + while (AStart <> nil) and (Result = nil) do + begin + if AFilter(AStart, AData) then + Result := AStart + else + begin + if AForward then + AStart := GetNext(AStart) + else + AStart := GetPrev(AStart); + end; + end; + finally + ATreeList.EndUpdate; + end; +end; + +function cxGetLatest( + ANode: TcxTreeListNode; ACheckExpanded: Boolean = True): TcxTreeListNode; +begin + Result := ANode; + if Result <> nil then + begin + if ACheckExpanded then + while (Result.FCount > 0) and (Result.FState and tlnsCollapsed = 0) do + Result := Result.FLast + else + while Result.Count > 0 do Result := Result.FLast; + end; +end; + +function cxGetState(Flags: Integer; Index: Integer): Boolean; +begin + Result := (Flags and (1 shl Index)) <> 0; +end; + +function cxHitDelta(CanSizing: Boolean): Integer; +begin + if CanSizing then + Result := cxtlHitDelta + else + Result := 0; +end; + +procedure cxRectScaleH(var ARect: TRect; AHeight: Integer); +begin + with ARect do + begin + Top := Top * AHeight; + Bottom := Top + Bottom * AHeight; + end; +end; + +procedure cxRectSetTopEx(var ARect: TRect; ATop, AHeight: Integer); overload; +begin + with ARect do + begin + Bottom := ATop + AHeight; + Top := ATop; + end; +end; + +procedure cxRectSetTopEx(var ARect: TRect; const ASrcRect: TRect); overload; +begin + ARect.Top := ASrcRect.Top; + ARect.Bottom := ASrcRect.Bottom; +end; + +procedure cxRectSetHeightEx(var ARect: TRect; const AHeight: Integer); overload; +begin + ARect.Bottom := ARect.Top + AHeight; +end; + +procedure cxRectSetHeightEx(var ARect: TRect; const ASrcRect: TRect); overload; +begin + ARect.Bottom := ARect.Top + (ASrcRect.Bottom - ASrcRect.Top); +end; + +procedure cxSetMax(var AValue: Integer; ANewValue: Integer); +begin + if AValue < ANewValue then AValue := ANewValue; +end; + +procedure cxSetMin(var AValue: Integer; ANewValue: Integer); +begin + if AValue > ANewValue then AValue := ANewValue; +end; + +function cxExcludeBorders(const ARect: TRect; ABorders: TcxBorders): TRect; +begin + Result := ARect; + with Result do + begin + Inc(Left, Byte(bLeft in ABorders)); + Inc(Top, Byte(bTop in ABorders)); + Dec(Right, Byte(bRight in ABorders)); + Dec(Bottom, Byte(bBottom in ABorders)); + end; +end; + +procedure cxGetIndexes(AList: TList; AItem: TObject; + var AFromIndex, AToIndex: Integer); +begin + AFromIndex := 0; + AToIndex := AList.Count - 1; + if AList.Last = AItem then + AToIndex := AList.IndexOf(AItem) - 1 + else + AFromIndex := AList.IndexOf(AItem) + 1; +end; + +procedure cxCalcSeparators(var ASeparators: TcxTreeListSeparators; + const AControlSeparators: TcxTreeListSeparators; const ABounds: TRect); +var + I: Integer; +begin + for I := Low(TcxTreeListSeparators) to High(TcxTreeListSeparators) do + cxRectIntersect(ASeparators[I], AControlSeparators[I], ABounds); +end; + +function cxGetNativeColor(AColor: TColor; ADefColorFunc: TcxDefColorFunc): TColor; +begin + if AColor = clDefault then + Result := ADefColorFunc + else + Result := AColor; +end; + +function cxSetState(var Flags: Integer; Index: Integer; Value: Boolean): Boolean; +begin + Result := (Flags and (1 shl Index) <> 0) <> Value; + if Result then + begin + if Value then + Flags := Flags or (1 shl Index) + else + Flags := Flags xor (1 shl Index); + end; +end; + +procedure cxValidateIntDef(var Value: Integer; AMin: Integer; AMax: Integer = MaxInt); +begin + if Value < AMin then + Value := AMin + else + if Value > AMax then + Value := AMax; +end; + +function cxValidateIntDefEx(var Value: Integer; ADefValue: Integer; + AMin: Integer; AMax: Integer = MaxInt): Boolean; +begin + cxValidateIntDef(Value, AMin, AMax); + Result := Value <> ADefValue; +end; + +function cxCheckValue(AValue, AMin, AMax: Integer): Boolean; +begin + Result := (AValue >= AMin) and (AValue < AMax); +end; + +function cxMin(AValue1, AValue2: Integer): Integer; +begin + if AValue1 > AValue2 then + Result := AValue2 + else + Result := AValue1; +end; + +function cxMax(AValue1, AValue2: Integer): Integer; +begin + if AValue1 > AValue2 then + Result := AValue1 + else + Result := AValue2; +end; + +procedure cxOffsetHorz(var Value: TRect; DX: Integer); +begin + Inc(Value.Left, DX); + Inc(Value.Right, DX); +end; + +function cxParamsCombine(AStyle: TcxStyle; HasValues: TcxStyleValues; + var AParams: TcxViewParams): TcxStyleValues; + + function SetValue(AValue: TcxStyleValue; var ASetValues: TcxStyleValues): Boolean; + begin + Result := not (AValue in HasValues) and (AValue in AStyle.AssignedValues); + if Result then Include(ASetValues, AValue); + end; + +begin + Result := HasValues; + if (AStyle = nil) or ([svColor, svFont, svTextColor, svBitmap] = HasValues) or + (csDestroying in AStyle.ComponentState) then Exit; + with AParams do + begin + if SetValue(svColor, Result) then Color := AStyle.Color; + if (AStyle.Font <> nil) and SetValue(svFont, Result) then Font := AStyle.Font; + if SetValue(svTextColor, Result) then TextColor := AStyle.TextColor; + if SetValue(svBitmap, Result) then Bitmap := AStyle.Bitmap; + end; +end; + +function cxCompareColumnsPos(AItem1, AItem2: Pointer): Integer; +begin + with TcxTreeListColumn(AItem1).Position, TcxTreeListColumn(AItem2) do + begin + Result := FRowIndex - Position.FRowIndex; + if Result = 0 then + Result := FColIndex - Position.FColIndex + end; +end; + +function cxCompareColumnsPosEx(AItem1, AItem2: Pointer): Integer; +begin + with TcxTreeListColumn(AItem1).Position, TcxTreeListColumn(AItem2) do + begin + Result := FRowIndex - Position.FRowIndex; + if Result = 0 then + Result := OwnerBandVisibleIndex - Position.OwnerBandVisibleIndex; + if Result = 0 then + Result := FColIndex - Position.FColIndex + end; +end; + +function cxCompareVisibleBands(AItem1, AItem2: Pointer): Integer; +const + AWeights: array[TcxTreeListBandFixedKind] of Integer = (0, -1, 1); +begin + with TcxTreeListBand(AItem1) do + begin + Result := AWeights[FixedKind] - AWeights[TcxTreeListBand(AItem2).FixedKind]; + if Result = 0 then + Result := Index - TcxTreeListBand(AItem2).Index; + end; +end; + +function cxIntegerListCompare(AItem1, AItem2: Pointer): Integer; +begin + Result := Integer(AItem1) - Integer(AItem2); +end; + +procedure cxCheckObjectList(AList: TList; ACount: Integer; + AItemClass: TcxCustomViewInfoItemClass; AOwner: TObject); +var + I: Integer; +begin + with AList do + begin + for I := ACount to Count - 1 do FreeAndNil(TObject(List^[I])); + I := Count; + Count := ACount; + while I < Count do + begin + List^[I] := AItemClass.Create(AOwner); + Inc(I); + end; + end; +end; + +procedure cxValidateSingleLine(APos: TcxTreeListColumnPosition); +begin + APos.FRowIndex := 0; + APos.FLineCount := 1; +end; + +procedure cxShiftEditViewInfoItem( + AViewInfo: TcxTreeListEditCellViewInfo; DX, DY: Integer); +begin + with AViewInfo do + begin + OffsetRect(CellEditRect, DX, DY);; + OffsetRect(CellContentRect, DX, DY); + OffsetRect(DisplayRect, DX, DY); + if ViewInfo <> nil then + begin + ViewInfo.Top := CellContentRect.Top; + ViewInfo.Left := CellContentRect.Left; + end; + ItemVisible := cxRectIntersect(ClipRect, DisplayRect, NodesViewInfo.ClipRect); + end; +end; + +procedure cxTreeListError(const Description: string); +begin + raise EcxTreeList.Create(Description); +end; + +procedure cxError(Condition: Boolean; + const Description: string; Args: array of const); overload; +begin + if Condition then + raise Exception.CreateFmt(Description, Args); +end; + +function cxIternalCompare(AItem: PcxSortingItem; ANode1, ANode2: TcxTreeListNode): Integer; +var + I: Integer; +begin + Result := 0; + with AItem^, TcxDataControllerAccess(DataController) do + begin + for I := 0 to SortOrderList.Count - 1 do + begin + Result := CompareRecords(ANode1.FRecordIndex, ANode2.FRecordIndex, PcxDataSortInfo(SortOrderList.List^[I])^); + if Result <> 0 then Exit; + end; + if Result = 0 then + Result := CompareEqualRecords(ANode1.FRecordIndex, ANode2.RecordIndex); + end; +end; + +function cxDoCustomCompare(AItem: PcxSortingItem; ANode1, ANode2: TcxTreeListNode): Integer; +begin + with AItem^ do + begin + if Assigned(Compare) then + Result := Compare(ANode1, ANode2) + else + TreeList.DoOnCompare(ANode1, ANode2, Result); + end; +end; + +{ TSortingManager } + +constructor TSortingManager.Create; +begin + FList := TList.Create; +end; + +destructor TSortingManager.Destroy; +begin + FreeAndNil(FList); + inherited Destroy; +end; + +procedure TSortingManager.Sort(ANode: TcxTreeListNode; + ACompare: TcxTreeListCompareFunc; ARecurse: Boolean = False); +var + AItem: PcxSortingItem; +begin + if ANode.FCount = 0 then Exit; + AItem := AddItem(ANode, ACompare, ARecurse); + InternalSort(AItem); +end; + +function TSortingManager.AddItem(ANode: TcxTreeListNode; + ACompare: TcxTreeListCompareFunc; ARecurse: Boolean): PcxSortingItem; +begin + Result := AllocMem(SizeOf(TcxSortingItem)); + FList.Add(Result); + with Result^ do + begin + TreeList := ANode.TreeList; + IsInternalCompare := not (Assigned(ACompare) or Assigned(TreeList.FOnCompare)); + Compare := ACompare; + Node := ANode; + Recurse := ARecurse; + SortOrderList := TreeList.SortOrderList; + DataController := TreeList.DataController; + end; +end; + +procedure TSortingManager.DoneItem(AItem: PcxSortingItem); +begin + with AItem^ do + begin + Dec(RefCount); + if RefCount = 0 then + begin + FreeMem(NodesList); + FList.Remove(AItem); + if NeedUpdate then + try + with Node.Owner do + begin + IsInvalidState := True; + CalculateInfo(False); + TreeList.DoLayoutChanged; + NodesViewInfo.Owner.InvalidateRect(NodesViewInfo.ClipRect); +// TreeList.MakeNodeVisible(TreeList.FocusedNode); + TreeList.DoChanged; + end; + finally + FreeMem(AItem); + end; + end; + end; +end; + +procedure TSortingManager.InitItem(AItem: PcxSortingItem); +var + I: Integer; + ANode: TcxTreeListNode; +begin + with AItem^ do + begin + Count := Node.FCount; + if Capacity <= Count then + begin + ReallocMem(NodesList, Count * SizeOf(Pointer)); + Capacity := Count; + end; + Inc(RefCount); + if Count = 0 then Exit; + ANode := Node.FFirst; + I := 0; + while I < Count do + begin + NodesList^[I] := ANode; + ANode := ANode.FNext; + Inc(I); + end; + end; +end; + +procedure TSortingManager.InternalSort(AItem: PcxSortingItem); + + procedure DoSort(L, R: Integer); + var + I, J: Integer; + TMP: TcxTreeListNode; + Mid: TcxTreeListNode; + begin + with AItem^ do + repeat + I := L; + J := R; + Mid := NodesList^[(L + R) shr 1]; + repeat + if IsInternalCompare then + begin + while cxIternalCompare(AItem, NodesList^[I], Mid) < 0 do Inc(I); + while cxIternalCompare(AItem, NodesList^[J], Mid) > 0 do Dec(J); + end + else + begin + while cxDoCustomCompare(AItem, NodesList^[I], Mid) < 0 do Inc(I); + while cxDoCustomCompare(AItem, NodesList^[J], Mid) > 0 do Dec(J); + end; + if I <= J then + begin + NeedUpdate := True; + TMP := NodesList^[I]; + NodesList^[I] := NodesList^[J]; + NodesList^[J] := TMP; + Inc(I); + Dec(J); + end; + until I > J; + if L < J then DoSort(L, J); + L := I; + until I >= R; + end; + +begin + InitItem(AItem); + try + DoSort(0, AItem.Count - 1); + UpdateLinks(AItem); + if AItem.Recurse then + InternalSortChildren(AItem); + finally + DoneItem(AItem); + end; +end; + +procedure TSortingManager.InternalSortChildren(AItem: PcxSortingItem); +var + ANeedUpdate: Boolean; + ANode: TcxTreeListNode; +begin + ANeedUpdate := False; + with AItem^ do + try + ANeedUpdate := NeedUpdate; + ANode := Node.FFirst; + while ANode <> nil do + begin + NeedUpdate := False; + AItem^.Node := ANode; + if ANode.Count > 0 then InternalSort(AItem); + ANeedUpdate := ANeedUpdate or NeedUpdate; + ANode := ANode.FNext; + end; + finally + NeedUpdate := ANeedUpdate; + end; +end; + +procedure TSortingManager.UpdateLinks(AItem: PcxSortingItem); +var + I: Integer; +begin + Dec(AItem^.Count); + with AItem^ do + begin + if (Count = 0) or not NeedUpdate then Exit; + for I := 0 to Count do + begin + with NodesList^[I] do + begin + FIndex := I; + if I > 0 then + FPrev := NodesList^[I - 1] + else + FPrev := nil; + if I < AItem^.Count then + FNext := NodesList^[I + 1] + else + FNext := nil; + FIndex := I; + end; + end; + Node.FFirst := NodesList^[0]; + Node.FLast := NodesList^[Count]; + end; +end; + +{ TcxTemporaryCellViewInfo } + +destructor TcxTemporaryCellViewInfo.Destroy; +begin + CellColumn := nil; + inherited Destroy; +end; + +function TcxTemporaryCellViewInfo.CalculateWidth(AColumn: TcxTreeListColumn; + ANode: TcxTreeListNode; AIsFocused: Boolean; AHeight: Integer): Integer; +begin + NodeIsFocused := AIsFocused; + CellNode := ANode; + CellColumn := AColumn; + Column.InitEditViewInfo(Self); + CellContentRect := cxRect(0, 0, 0, AHeight); + Result := CellColumn.GetEditWidth(Self) + + Byte(AColumn.TreeList.OptionsView.GridLines in [tlglBoth, tlglVert]) shl 1 + 2; + if Result < Column.MinWidth then + Result := Column.MinWidth; + if AColumn.IsLeftMost then + Inc(Result, AColumn.TreeList.ImagesIndentWidth); + if Result > Column.Data then + Column.Data := Result; +end; + +function TcxTemporaryCellViewInfo.ContentOffset: TRect; +begin + Result := cxNullRect; +end; + +function TcxTemporaryCellViewInfo.GetButtonTransparency: TcxEditButtonTransparency; +begin + Result := ebtNone; +end; + +function TcxTemporaryCellViewInfo.GetColumn: TcxTreeListColumn; +begin + Result := CellColumn; +end; + +function TcxTemporaryCellViewInfo.GetEditContainer: TcxCustomInplaceEditContainer; +begin + Result := CellColumn; +end; + +function TcxTemporaryCellViewInfo.GetFocused: Boolean; +begin + Result := NodeIsFocused; +end; + +function TcxTemporaryCellViewInfo.GetLineCount: Integer; +begin + Result := 1; +end; + +function TcxTemporaryCellViewInfo.GetRecordIndex: Integer; +begin + Result := CellNode.RecordIndex; +end; + +function TcxTemporaryCellViewInfo.GetSelected: Boolean; +begin + Result := False; +end; + +function TcxTemporaryCellViewInfo.IsAutoHeight: Boolean; +begin + Result := False; +end; + +function TcxTemporaryCellViewInfo.IsEndEllipsis: Boolean; +begin + Result := False; +end; + +function TcxTemporaryCellViewInfo.GetNode: TcxTreeListNode; +begin + Result := CellNode; +end; + +function TcxTemporaryCellViewInfo.GetNodesViewInfo: TcxTreeListNodesViewInfo; +begin + Result := nil; +end; + +function TcxTemporaryCellViewInfo.GetNodeViewInfo: TcxTreeListNodeViewInfo; +begin + Result := nil; +end; + +function TcxTemporaryCellViewInfo.GetTreeList: TcxCustomTreeListControl; +begin + Result := Column.TreeList; +end; + +{ TcxTreeListNodes} + +constructor TcxTreeListNodes.Create(AOwner: TcxCustomTreeListControl); +begin + FOwner := AOwner; + FRoot := TcxTreeListRootNode.Create(Self); + FRoot.FState := 0; +end; + +destructor TcxTreeListNodes.Destroy; +begin + FState := FState or tlnsDeleting; + TreeList.BeginUpdate; + try + FreeAndNil(FRoot); + finally + TreeList.CancelUpdate; + inherited Destroy; + end; +end; + +procedure TcxTreeListNodes.Assign(Source: TPersistent); +begin + if Source is TcxTreeListNodes then + TreeList.DoAssignNodes(Source as TcxTreeListNodes) + else + inherited Assign(Source); +end; + +procedure TcxTreeListNodes.Clear; +begin + if TreeList.NodesList.Count = 0 then Exit; + if not TreeList.SafeDelete and not TreeList.IsDestroying then + TreeList.UpdateFocusedRecordPost; + TreeList.BeginUpdate; + try + NodesViewInfo.Clear; + Root.DeleteChildren; + finally + TopIndex := 0; + TopNode := nil; + FState := tlnsIndexesInvalid; + TreeList.DoValidateDeletedNodes; + TreeList.EndUpdate; + end; +end; + +procedure TcxTreeListNodes.Changed; +begin + FFoundItem := nil; + IsInvalidState := True; + NodesViewInfo.TopNode := nil; + TreeList.LayoutChanged; +end; + +procedure TcxTreeListNodes.CalculateInfo(IsLocked: Boolean); + + procedure DoCalc(ANode: TcxTreeListNode; ALevel: Integer); + begin + while ANode <> nil do + begin + if ALevel > FMaxLevel then FMaxLevel := ALevel; + if TopIndex >= FVisibleCount then TopNode := ANode; + ANode.FVisibleIndex := FVisibleCount; + Inc(FVisibleCount); + with ANode do + if Expanded then DoCalc(FFirst, ALevel + 1); + ANode := ANode.FNext; + end; + end; + +begin + if not IsInvalidState and (TopNode <> nil) then Exit; + if not IsLocked then + begin + FMaxLevel := -1; + FVisibleCount := 0; + if TopIndex < 0 then TopIndex := 0; + DoCalc(FRoot.FFirst, 0); + if TopIndex > FVisibleCount then TopIndex := FVisibleCount - 1; + IsInvalidState := False + end + else + begin + FMaxLevel := 0; + FVisibleCount := -1; + TopIndex := 0; + TopNode := nil; + end; +end; + +procedure TcxTreeListNodes.DoNodeChanged(ANode: TcxTreeListNode); +begin + if ANode = nil then + Changed + else + TreeList.DoNodeChanged(ANode); +end; + +class function TcxTreeListNodes.FindBetween( + AFirst, ALast: TcxTreeListNode; ACount, AIndex: Integer): TcxTreeListNode; +begin + cxError((AIndex < 0) or (AIndex >= ACount) or (AFirst.Index > AIndex) or + (ALast.FIndex < AIndex), scxStr(@scxIndexOutOfBounds), [AIndex]); + if (ALast.Index shr 1) <= AIndex then + begin + Result := ALast; + while Result.FIndex <> AIndex do Result := Result.FPrev; + end + else + begin + Result := AFirst; + while Result.FIndex <> AIndex do Result := Result.FNext; + end; +end; + +function TcxTreeListNodes.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +function TcxTreeListNodes.GetVisibleNode(var AIndex: Integer): TcxTreeListNode; + + procedure DoSearch(AStartNode, AEndNode: TcxTreeListNode; + AFromEnd: Boolean; var ANode: TcxTreeListNode); + begin + if AFromEnd then + begin + ANode := AEndNode; + while (ANode <> nil) and (ANode.FVisibleIndex > AIndex) do + ANode := ANode.GetPrevVisible; + end + else + begin + Result := AStartNode; + while (ANode <> nil) and (ANode.FVisibleIndex < AIndex) do + Result := ANode.GetNextVisible; + end; + end; + +begin + CalculateInfo(False); + cxValidateIntDefEx(AIndex, -1, 0, VisibleCount - 1); + if TopNode = nil then + begin + TopNode := Root.FFirst; + TopIndex := 0; + end + else + if TopNode.VisibleIndex <> TopIndex then + TopIndex := TopNode.VisibleIndex; + if AIndex >= TopIndex then + DoSearch(TopNode, cxGetLatest(Root.FLast), + AIndex > ((VisibleCount + TopIndex) shr 1), Result) + else + DoSearch(Root.FFirst, TopNode, AIndex > (TopIndex shr 1), Result); + if Result = nil then + AIndex := 0 + else + AIndex := Result.FVisibleIndex; +end; + +function TcxTreeListNodes.InternalAddNode(ANode, ARelative: TcxTreeListNode; + AddMethod: TcxTreeListNodeAttachMode): TcxTreeListNode; +const + IsAddChild: array[TcxTreeListNodeAttachMode] of Boolean = + (False, False, True, True, False); + AddMode: array[TcxTreeListNodeAttachMode] of TcxTreeListNodeAddMode = + (tlnaAdd, tlnaAddFirst, tlnaAdd, tlnaAddFirst, tlnaInsert); +begin + if ANode = nil then + Result := TreeList.DoCreateNode + else + Result := ANode; + if (ARelative = nil) and (AddMethod = tlamInsert) then + AddMethod := tlamAdd; + if ARelative <> nil then + SetNodeParent(Result, ARelative, AddMode[AddMethod]) + else + SetNodeParent(Result, FRoot, AddMode[AddMethod]); + Changed; +end; + +procedure TcxTreeListNodes.SetNodeParent(ANewNode, ANewParent: TcxTreeListNode; + AMode: TcxTreeListNodeAddMode); +begin + TreeList.BeforeAddNode(ANewNode, ANewParent, AMode); + case AMode of + tlnaAdd: + ANewParent.SetLast(ANewNode); + tlnaAddFirst: + ANewParent.SetFirst(ANewNode); + tlnaInsert: + ANewNode.InternalInsert(ANewParent); + end; +end; + +procedure TcxTreeListNodes.SetTopVisibleIndex(AIndex: Integer); +begin + TopNode := GetVisibleNode(AIndex); + TopIndex := AIndex; + NodesViewInfo.TopNode := nil; + if AIndex >= 0 then + NodesViewInfo.SynchronizeTopNode; +end; + +function TcxTreeListNodes.GetAbsoluteItem(AFindIndex: Integer): TcxTreeListNode; +var + AIndex: Integer; +begin + Result := nil; + if cxInRange(AFindIndex, 0, Count - 1) then + begin + AIndex := 0; + Result := Root.FFirst; + while AFindIndex <> AIndex do + begin + Inc(AIndex); + if Result.Count > 0 then + Result := Result.FFirst + else + begin + while Result.FNext = nil do Result := Result.Parent; + Result := Result.FNext; + end; + end; + end; +end; + +function TcxTreeListNodes.GetCount: Integer; +begin + Result := TreeList.NodesList.Count; +end; + +function TcxTreeListNodes.GetDataController: TcxControlDataController; +begin + Result := TcxControlDataController(TreeList.DataController); +end; + +function TcxTreeListNodes.GetItem(AIndex: Integer): TcxTreeListNode; +begin + Result := TcxTreeListNode(TreeList.NodesList[AIndex]); +end; + +function TcxTreeListNodes.GetMaxLevel: Integer; +begin + CalculateInfo(TreeList.IsLocked); + Result := FMaxLevel; +end; + +function TcxTreeListNodes.GetState(Index: Integer): Boolean; +begin + Result := FState and Index <> 0; +end; + +function TcxTreeListNodes.GetVisibleCount: Integer; +begin + CalculateInfo(TreeList.IsLocked); + Result := FVisibleCount; +end; + +procedure TcxTreeListNodes.SetState(Index: Integer; Value: Boolean); +begin + if Value then + FState := FState or Index + else + FState := FState and not Index; +end; + +function TcxTreeListNodes.GetNodesViewInfo: TcxTreeListNodesViewInfo; +begin + Result := TreeList.ViewInfo.NodesViewInfo; +end; + +function TcxTreeListNodes.GetTopVisibleNode: TcxTreeListNode; +begin + CalculateInfo(TreeList.IsLocked); + Result := TopNode; +end; + +procedure TcxTreeListNodes.SetAbsoluteItem( + Index: Integer; Value: TcxTreeListNode); +begin + AbsoluteItems[Index].Assign(Value); +end; + +procedure TcxTreeListNodes.SetItem( + AIndex: Integer; Value: TcxTreeListNode); +begin + GetItem(AIndex).Assign(Value); +end; + +{ TcxTreeListNode } + +constructor TcxTreeListNode.Create(AOwner: TcxTreeListNodes); +begin + FOwner := AOwner; + FState := FState or tlnsCollapsed; + FillChar(FImageIndexes, SizeOf(FImageIndexes), -1); + if Owner.State and tlnsInternalCreating = 0 then + FRecordIndex := AddDataControllerRecord + else + FRecordIndex := -1; +end; + +destructor TcxTreeListNode.Destroy; +var + NeedAdjustIndexes: Boolean; +begin + TreeList.BeginUpdate; + try + if not TreeList.SafeDelete and TreeList.DataController.IsEditing then + TreeList.DataController.Post; + TreeList.DoOnDeletion(Self); + if HasChildren and (Count > 0) then + DeleteChildren; + TreeList.DoCheckDeletedNode(Self); + TreeList.DoDeleteNode(Self); + Owner.IsInvalidState := True; + NeedAdjustIndexes := FState and tlnsDeleting = 0; + FState := FState or tlnsDeleting; + if Owner.NodesViewInfo.TopNode = Self then + begin + Owner.TopNode := nil; + Owner.NodesViewInfo.TopNode := nil; + end; + if NeedAdjustIndexes then + FState := FState xor tlnsDeleting; + InternalRemove(Self); + finally + TreeList.EndUpdate; + inherited Destroy; + end; +end; + +procedure TcxTreeListNode.Assign(Source: TPersistent); +var + ANode: TcxTreeListNode; + I: Integer; +begin + if Source is TcxTreeListNode then + begin + ANode := TcxTreeListNode(Source); + FData := ANode.Data; + Focused := ANode.Focused; + HasChildren := ANode.HasChildren; + for I := 0 to ANode.ValueCount - 1 do + Values[I] := ANode.Values[I]; + end + else + inherited Assign(Source); +end; + +procedure TcxTreeListNode.AssignValues( + const AValues:{$IFDEF DELPHI5} array of {$ENDIF} Variant); +var + I, K: Integer; +begin + K := 0; +{$IFNDEF DELPHI5} + if VarType(AValues) <> varArray then Exit; + for I := 0 to Length(AValues) do +{$ELSE} + for I := Low(AValues) to High(AValues) do +{$ENDIF} + begin + if K >= ValueCount then Break; + Values[I] := AValues[I]; + Inc(K); + end; +end; + +function TcxTreeListNode.AddChild: TcxTreeListNode; +begin + Result := TreeList.AddNode(nil, Self, nil, tlamAddChild); +end; + +function TcxTreeListNode.AddChildFirst: TcxTreeListNode; +begin + Result := TreeList.AddNode(nil, Self, nil, tlamAddChildFirst); +end; + +procedure TcxTreeListNode.AlphaSort(ARecurse: Boolean = False); +begin + CustomSort(nil, ARecurse); +end; + +function TcxTreeListNode.CanCollapse: Boolean; +begin + Result := TreeList.DoCanNodeCollapse(Self); +end; + +function TcxTreeListNode.CanExpand: Boolean; +begin + Result := TreeList.DoCanNodeExpand(Self); +end; + +function TcxTreeListNode.CanMove( + ADest: TcxTreeListNode; AMode: TcxTreeListNodeAttachMode): Boolean; +begin + if (ADest = nil) or ((ADest = Self) and (AMode in [tlamAddChild, tlamAddChildFirst, tlamInsert])) or + ADest.HasAsParent(Self) then + Result := False + else + Result := True; +end; + +procedure TcxTreeListNode.Collapse(Recurse: Boolean); +var + ANode: TcxTreeListNode; +begin + if not HasChildren then Exit; + TreeList.BeginUpdate; + try + Expanded := False; + if Recurse then + begin + ANode := FFirst; + while ANode <> nil do + begin + ANode.Collapse(True); + ANode := ANode.FNext; + end; + end; + finally + TreeList.EndUpdate; + end; +end; + +procedure TcxTreeListNode.CustomSort( + ASortProc: TcxTreeListCompareFunc; ARecurse: Boolean = False); +begin + SortingManager.Sort(Self, ASortProc, ARecurse); +end; + +procedure TcxTreeListNode.Delete; +begin + if not Deleting then Free; +end; + +procedure TcxTreeListNode.DeleteChildren; +var + ANode: TcxTreeListNode; +begin + TreeList.BeginUpdate; + try + while FFirst <> nil do + begin + FFirst.FState := FFirst.FState or tlnsDeleting; + ANode := FFirst; + FFirst := FFirst.FNext; + FreeAndNil(ANode); + end; + finally + FCount := 0; + HasChildren := False; + FFirst := nil; + FLast := nil; + TreeList.EndUpdate; + end; +end; + +function TcxTreeListNode.DisplayRect(AEntryOnly: Boolean): TRect; +var + AViewInfo: TcxTreeListNodeViewInfo; +begin + if Owner.NodesViewInfo.FindNodeViewInfo(Self, AViewInfo) then + begin + if AEntryOnly then + Result := AViewInfo.NodeCellsRect + else + Result := AViewInfo.NodeContentRect; + end + else + Result := cxNullRect; +end; + +procedure TcxTreeListNode.EndEdit(Cancel: Boolean); +begin + TreeList.Controller.EditingController.HideEdit(not Cancel); +end; + +procedure TcxTreeListNode.Expand(Recurse: Boolean); +var + ANode: TcxTreeListNode; +begin + if not HasChildren then Exit; + if not TreeList.IsSmartLoad then + TreeList.BeginUpdate; + try + Expanded := True; + if Recurse then + begin + ANode := FFirst; + while ANode <> nil do + begin + ANode.Expand(True); + ANode := ANode.FNext; + end; + end; + finally + if not TreeList.IsSmartLoad then + TreeList.EndUpdate; + end; +end; + +function TcxTreeListNode.GetNextChild(Value: TcxTreeListNode): TcxTreeListNode; +begin + if Value <> nil then + Result := TcxTreeListNode(Value.FNext) + else + Result := nil; +end; + +function TcxTreeListNode.GetFirstChild: TcxTreeListNode; +begin + Result := FFirst +end; + +function TcxTreeListNode.GetLastChild: TcxTreeListNode; +begin + Result := FLast +end; + +function TcxTreeListNode.GetNext: TcxTreeListNode; +var + ANode: TcxTreeListNode; +begin + Result := FFirst; + if FCount = 0 then + begin + ANode := Self; + while ANode <> nil do + begin + if ANode.FNext <> nil then + begin + Result := ANode.FNext; + Break; + end; + while (ANode <> nil) and (ANode.FNext = nil) do ANode := ANode.Parent; + end; + end; +end; + +function TcxTreeListNode.GetNextSibling: TcxTreeListNode; +begin + Result := FNext; +end; + +function TcxTreeListNode.GetPrev: TcxTreeListNode; +begin + Result := FPrev; + if Result <> nil then + Result := cxGetLatest(Result, False) + else + Result := Parent; + if Result = Owner.Root then Result := nil; +end; + +function TcxTreeListNode.GetPrevSibling: TcxTreeListNode; +begin + Result := FPrev; +end; + +function TcxTreeListNode.GetPrevChild(Value: TcxTreeListNode): TcxTreeListNode; +begin + if Value <> nil then + Result := TcxTreeListNode(Value.FPrev) + else + Result := nil; +end; + +function TcxTreeListNode.HasAsParent(Value: TcxTreeListNode): Boolean; +var + ANode: TcxTreeListNode; +begin + Result := False; + ANode := Parent; + while (ANode <> nil) and not Result do + begin + Result := ANode = Value; + ANode := ANode.FParent; + end; +end; + +function TcxTreeListNode.IndexOf(Value: TcxTreeListNode): Integer; +begin + if Value.Parent = Self then + Result := Value.FIndex + else + Result := -1; +end; + +function TcxTreeListNode.InsertChild( + ABeforeNode: TcxTreeListNode): TcxTreeListNode; +begin + Result := TreeList.AddNode(nil, ABeforeNode, nil, tlamInsert); +end; + +procedure TcxTreeListNode.MakeVisible; +var + ANode: TcxTreeListNode; +begin + if not TreeList.FNeedMakeVisible then Exit; + if not IsVisible then + begin + TreeList.BeginUpdate; + try + ANode := FParent; + while ANode <> nil do + begin + ANode.Expanded := True; + if not ANode.Expanded then Break; + ANode := ANode.FParent; + end; + finally + TreeList.EndUpdate; + end; + end; + if IsVisible then + TreeList.MakeNodeVisible(Self); +end; + +procedure TcxTreeListNode.MoveTo( + ADestNode: TcxTreeListNode; AMode: TcxTreeListNodeAttachMode); +begin + if (ADestNode = nil) or (ADestNode = Self) then Exit; + if AMode in [tlamAdd, tlamAddFirst] then + ADestNode := ADestNode.Parent; + if not ADestNode.HasAsParent(Self) then + TreeList.InternalMove(Self, ADestNode, AMode); +end; + +procedure TcxTreeListNode.Repaint(ARecalculate: Boolean); +var + AViewInfo: TcxTreeListNodeViewInfo; +begin + with TreeList.ViewInfo do + begin + if NodesViewInfo.FindNodeViewInfo(Self, AViewInfo) then + begin + AViewInfo.Update(ARecalculate); + InvalidateRect(AViewInfo.NodeContentRect); + end; + end; +end; + +function TcxTreeListNode.AddDataControllerRecord: Integer; +begin + Result := DataController.AppendRecord; + FRecordIndex := Result; + TreeList.NodesList.Add(Self); +end; + +procedure TcxTreeListNode.DoReadNodeData(AReader: TcxReader); +begin + FState := AReader.ReadInteger; + FCount := AReader.ReadInteger; + FRecordIndex := AReader.ReadInteger; +end; + +procedure TcxTreeListNode.DoWriteNodeData(AWriter: TcxWriter); +begin + AWriter.WriteInteger(FState); + AWriter.WriteInteger(FCount); + AWriter.WriteInteger(FRecordIndex); +end; + +function TcxTreeListNode.GetNextSiblingEx( + ANode: TcxTreeListNode; AForward: Boolean): TcxTreeListNode; +begin + if AForward then + Result := ANode.FNext + else + Result := ANode.FPrev; +end; + +function TcxTreeListNode.GetIsFirstVisible: Boolean; +begin + Result := IsVisible and (Owner.Root.FFirst = Self); +end; + +function TcxTreeListNode.GetIsLastVisible: Boolean; +begin + Result := IsVisible and (GetNextVisible = nil); +end; + +function TcxTreeListNode.GetNextVisibleEx(IsPrev: Boolean): TcxTreeListNode; +begin + if IsPrev then + Result := GetPrevVisible + else + Result := GetNextVisible; +end; + +function TcxTreeListNode.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +procedure TcxTreeListNode.ReadData(AStream: TStream); +begin + AStream.ReadBuffer(FRecordIndex, SizeOf(Integer)); + AStream.ReadBuffer(FState, SizeOf(Integer)); + FCount := 0; + if FState and tlnsHasChildren <> 0 then + AStream.ReadBuffer(FCount, SizeOf(Integer)); +end; + +procedure TcxTreeListNode.WriteData(AStream: TStream); +begin + AStream.WriteBuffer(FRecordIndex, SizeOf(Integer)); + if FCount > 0 then FState := FState or tlnsHasChildren; + AStream.WriteBuffer(FState, SizeOf(Integer)); + if (FCount > 0) or (FState and tlnsHasChildren <> 0) then + AStream.WriteBuffer(FCount, SizeOf(Integer)); +end; + +function TcxTreeListNode.CanSizing( + ADirection: TcxDragSizingDirection): Boolean; +begin + with TreeList do + begin + Result := OptionsCustomizing.RowSizing and (ADirection = dsdVert); + Result := Result and not OptionsView.CellAutoHeight + end; +end; + +function TcxTreeListNode.GetSizingBoundsRect( + ADirection: TcxDragSizingDirection): TRect; +begin + Result := TreeList.ClientBounds; + with DisplayRect(False) do + begin + Result.Top := Top + TreeList.ViewInfo.DefaultEditHeight; + Result.Bottom := Result.Top + cxRectHeight(TreeList.ClientBounds); + end; +end; + +function TcxTreeListNode.GetSizingIncrement( + ADirection: TcxDragSizingDirection): Integer; +begin + Result := 1; +end; + +function TcxTreeListNode.IsDynamicUpdate: Boolean; +begin + Result := False; +end; + +procedure TcxTreeListNode.SetSizeDelta( + ADirection: TcxDragSizingDirection; ADelta: Integer); +begin + with TreeList do + DefaultRowHeight := DefaultRowHeight + ADelta; +end; + +function TcxTreeListNode.QueryInterface(const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := cxE_NOINTERFACE; +end; + +function TcxTreeListNode._AddRef: Integer; +begin + Result := -1; +end; + +function TcxTreeListNode._Release: Integer; +begin + Result := -1; +end; + +function TcxTreeListNode.GetRootParent: TcxTreeListNode; +begin + Result := Self; + while (Result.FParent <> nil) and (Result.FParent <> Owner.Root) do + Result := Result.FParent; +end; + +function TcxTreeListNode.GetAbsoluteIndex: Integer; +var + ANode: TcxTreeListNode; +begin + if Self.Parent = nil then + Result := -1 + else + begin + Result := 0; + ANode := Owner.Root.FFirst; + while ANode <> Self do + begin + Inc(Result); + if ANode.Count > 0 then + ANode := ANode.FFirst + else + begin + while ANode.FNext = nil do ANode := ANode.Parent; + ANode := ANode.FNext; + end; + end; + end; +end; + +function TcxTreeListNode.GetDataController: TcxControlDataController; +begin + Result := Owner.DataController; +end; + +function TcxTreeListNode.GetExpanded: Boolean; +begin + Result := (Count > 0) and ((FState and tlnsCollapsed) = 0); +end; + +function TcxTreeListNode.GetFocused: Boolean; +begin + Result := DataController.FocusedRecordIndex = RecordIndex; +end; + +function TcxTreeListNode.GetHasChildren: Boolean; +begin + Result := (FState and tlnsHasChildren <> 0) or (FCount > 0) +end; + +function TcxTreeListNode.GetIsDeleting: Boolean; +var + ANode: TcxTreeListNode; +begin + Result := False; + ANode := Self; + while not Result and (ANode <> nil) do + begin + Result := ANode.FState and tlnsDeleting <> 0; + ANode := ANode.Parent; + end; +end; + +function TcxTreeListNode.GetHotTrack: Boolean; +begin + Result := TreeList.Controller.HotTrackNode = Self; +end; + +function TcxTreeListNode.GetIsFirst: Boolean; +begin + Result := (FParent = nil) or (FParent.FFirst = Self); +end; + +function TcxTreeListNode.GetIsGroupNode: Boolean; +begin + Result := TreeList.DoIsGroupNode(Self); +end; + +function TcxTreeListNode.GetIsLast: Boolean; +begin + Result := (FParent = nil) or (FParent.FLast = Self); +end; + +function TcxTreeListNode.GetIsVisible: Boolean; +var + ANode: TcxTreeListNode; +begin + Result := FParent <> nil; + ANode := Self; + while Result and (ANode.FParent <> nil) and (ANode.FParent <> FOwner.Root) do + begin + Result := ANode.FParent.FState and tlnsCollapsed = 0; + ANode := ANode.FParent; + end; +end; + +function TcxTreeListNode.GetItem(AIndex: Integer): TcxTreeListNode; +begin + Result := Owner.FindBetween(FFirst, FLast, FCount, AIndex); +end; + +function TcxTreeListNode.GetLevel: Integer; +var + ANode: TcxTreeListNode; +begin + ANode := FParent; + Result := -1; + while ANode <> nil do + begin + Inc(Result); + ANode := ANode.FParent; + end; +end; + +function TcxTreeListNode.GetSelected: Boolean; +begin + if TreeList.IsMultiSelect then + Result := TreeList.FSelection.IndexOf(Self) <> cxInvalidIndex + else + Result := Focused; +end; + +function TcxTreeListNode.GetNextVisible: TcxTreeListNode; +begin + if (FCount > 0) and (FState and tlnsCollapsed = 0) then + Result := FFirst + else + begin + Result := Self; + while Result <> nil do + begin + if Result.FNext <> nil then + begin + Result := Result.FNext; + Break; + end; + Result := Result.FParent; + end; + end; +end; + +function TcxTreeListNode.GetNodeImageIndex(AIndex: Integer): TImageIndex; +begin + Result := TreeList.DoGetNodeImageIndex(Self, TcxTreeListImageIndexType(AIndex)); +end; + +function TcxTreeListNode.GetPrevVisible: TcxTreeListNode; +begin + Result := cxGetLatest(FPrev); + if (Result = nil) and (FParent <> FOwner.Root) then + Result := FParent; +end; + +function TcxTreeListNode.GetText(Index: Integer): string; +begin + Result := TreeList.Columns[Index].DisplayTexts[RecordIndex]; +end; + +function TcxTreeListNode.GetTreeList: TcxCustomTreeListControl; +begin + Result := Owner.TreeList; +end; + +function TcxTreeListNode.GetValue(AIndex: Integer): Variant; +begin + Result := DataController.Values[FRecordIndex, AIndex] +end; + +function TcxTreeListNode.GetValueCount: Integer; +begin + Result := TreeList.DoGetNodeValueCount; +end; + +function TcxTreeListNode.GetVisibleIndex: Integer; +begin + if IsVisible then + Result := FVisibleIndex + else + Result := -1; +end; + +procedure TcxTreeListNode.AdjustIndexes(ANode: TcxTreeListNode; AIndex: Integer); +begin + while ANode <> nil do + begin + ANode.FIndex := AIndex; + ANode := ANode.FNext; + Inc(AIndex); + end; +end; + +procedure TcxTreeListNode.InternalInsert(Value: TcxTreeListNode); +begin + if FParent <> nil then + InternalRemove(Self); + FPrev := Value.FPrev; + if FPrev <> nil then + FPrev.FNext := Self + else + Value.FParent.FFirst := Self; + FNext := Value; + if FNext <> nil then + FNext.FPrev := Self + else + Value.FParent.FLast := Self; + Value.FParent.SetParentFor(Self); +end; + +procedure TcxTreeListNode.InternalRemove(Value: TcxTreeListNode); +begin + if Deleting then Exit; + AdjustIndexes(Value.FNext, Value.Index); + if Value.FParent <> nil then + begin + Dec(Value.FParent.FCount); + if Value.FParent.FFirst = Value then + Value.FParent.FFirst := Value.FNext; + if Value.FParent.FLast = Value then + Value.FParent.FLast := Value.FPrev; + if Value.FParent.FCount = 0 then + Value.FParent.FState := (Value.FParent.FState and not tlnsHasChildren) or tlnsCollapsed ; + end; + if Value.FNext <> nil then + Value.FNext.FPrev := Value.FPrev; + if Value.FPrev <> nil then + Value.FPrev.FNext := Value.FNext; + Value.FPrev := nil; + Value.FNext := nil; + Value.FParent := nil; +end; + +procedure TcxTreeListNode.SetExpanded(Value: Boolean); +begin + if Value <> Expanded then + begin + Owner.IsInvalidState := True; + TreeList.DoSetNodeExpanded(Self, Value); + end; +end; + +procedure TcxTreeListNode.SetFirst(Value: TcxTreeListNode); +begin + InternalRemove(Value); + if FFirst <> nil then + begin + Value.FNext := FFirst; + FFirst.FPrev := Value; + end + else + FLast := Value; + FFirst := Value; + SetParentFor(Value); +end; + +procedure TcxTreeListNode.SetFocused(Value: Boolean); +begin + if Value <> Focused then + begin + if Value then + TreeList.Controller.FocusedRecordIndex := RecordIndex + else + DataController.FocusedRecordIndex := -1; + end; +end; + +procedure TcxTreeListNode.SetHasChildren(Value: Boolean); +begin + if HasChildren <> Value then + begin + if Value then + FState := FState or tlnsHasChildren + else + if FCount = 0 then + FState := FState and not tlnsHasChildren; + Owner.DoNodeChanged(Self); + end; +end; + +procedure TcxTreeListNode.SetItem(AIndex: Integer; Value: TcxTreeListNode); +begin + GetItem(AIndex).Assign(Value); +end; + +procedure TcxTreeListNode.SetLast(Value: TcxTreeListNode); +begin + InternalRemove(Value); + if FLast <> nil then + begin + Value.FPrev := FLast; + FLast.FNext := Value; + end + else + FFirst := Value; + FLast := Value; + SetParentFor(Value); +end; + +procedure TcxTreeListNode.SetNodeImageIndex(AIndex: Integer; Value: TImageIndex); +begin + TreeList.DoSetNodeImageIndex(Self, TcxTreeListImageIndexType(AIndex), Value); +end; + +procedure TcxTreeListNode.SetParentFor(Value: TcxTreeListNode); +begin + Value.FParent := Self; + Inc(FCount); + if Value.FPrev = nil then + AdjustIndexes(Value, 0) + else + AdjustIndexes(Value.FPrev, Value.FPrev.Index); + Owner.DoNodeChanged(nil); +end; + +procedure TcxTreeListNode.SetText(AIndex: Integer; const AValue: string); +begin + SetValue(AIndex, AValue); +end; + +procedure TcxTreeListNode.SetSelected(Value: Boolean); +begin + if (Selected <> Value) and TreeList.IsMultiSelect then + try + if not Value then + TreeList.FSelection.Remove(Self) + else + begin + if not TreeList.DoCanSelectNode(Self) then + Exit + else + TreeList.FSelection.Add(Self); + end; + TreeList.DoSelectionChanged; + finally + Repaint(True); + end; +end; + +procedure TcxTreeListNode.SetValue(AIndex: Integer; const AValue: Variant); +begin + with DataController do + begin + if (dceEdit in EditState) and (FocusedRecordIndex = RecordIndex) then + SetEditValue(AIndex, AValue, evsValue) + else + Values[RecordIndex, AIndex] := AValue; + end; +end; + +{ TcxTreeListRootNode } + +function TcxTreeListRootNode.AddDataControllerRecord: Integer; +begin + Result := -1; +end; + +{ TcxUnboundTreeListNode } + +constructor TcxUnboundTreeListNode.Create(AOwner: TcxTreeListNodes); +begin + inherited Create(AOwner); + FImageIndexes := cxDefaultImageIndexes; +end; + +procedure TcxUnboundTreeListNode.Assign(Source: TPersistent); +begin + if Source is TcxUnboundTreeListNode then + FImageIndexes := TcxUnboundTreeListNode(Source).FImageIndexes; + inherited Assign(Source); +end; + +procedure TcxUnboundTreeListNode.ReadData(AStream: TStream); +begin + inherited ReadData(AStream); + AStream.ReadBuffer(FImageIndexes, SizeOf(FImageIndexes)) +end; + +procedure TcxUnboundTreeListNode.WriteData(AStream: TStream); +begin + inherited WriteData(AStream); + AStream.WriteBuffer(FImageIndexes, SizeOf(FImageIndexes)) +end; + +{ TcxTreeListColumnStyles } + +procedure TcxTreeListColumnStyles.Assign(Source: TPersistent); +begin + if Source is TcxTreeListColumnStyles then + begin + Header := TcxTreeListColumnStyles(Source).Header; + Footer := TcxTreeListColumnStyles(Source).Footer; + end; + inherited Assign(Source); +end; + +procedure TcxTreeListColumnStyles.CachedContentStyleChanged; +var + B: Boolean; +begin + if Band <> nil then + ContentParams := Band.Styles.ContentParams + else + ContentParams := TreeList.Styles.ContentParams; + for B := False to True do + cxParamsCombine(Content, [], ContentParams[B]); +end; + +function TcxTreeListColumnStyles.GetBand: TcxTreeListBand; +begin + Result := TcxTreeListColumn(GetOwner).OwnerBand; +end; + +function TcxTreeListColumnStyles.GetTreeList: TcxCustomTreeListControl; +begin + Result := TcxCustomTreeListControl(Control); +end; + +{ TcxTreeListColumnPosition } + +constructor TcxTreeListColumnPosition.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FColIndex := 0; + FLineCount := 1; + FRowIndex := 0; +end; + +procedure TcxTreeListColumnPosition.Assign(Source: TPersistent); +begin + if Source is TcxTreeListColumnPosition then + begin + FLineCount := TcxTreeListColumnPosition(Source).FLineCount; + with TcxTreeListColumnPosition(Source) do + Self.SetPositionEx(BandIndex, FColIndex, FRowIndex); + end + else + inherited Assign(Source); +end; + +procedure TcxTreeListColumnPosition.SetPosition( + AColIndex, ARowIndex: Integer; IsInsertRow: Boolean = False); +begin + SetPositionEx(BandIndex, AColIndex, ARowIndex); +end; + +procedure TcxTreeListColumnPosition.SetPositionEx( + ABandIndex, AColIndex, ARowIndex: Integer; IsInsertRow: Boolean = False); + + procedure CheckColumnPos(AColumn: TcxTreeListColumn); + begin + with AColumn.Position do + begin + if IsInsertRow and (FRowIndex >= ARowIndex) then Inc(FRowIndex); + if (FRowIndex = ARowIndex) and (FColIndex >= AColIndex) then + Inc(FColIndex); + end; + end; + + procedure SetOwnerBand(ABand: TcxTreeListBand); + var + I: Integer; + begin + Column.OwnerBand := ABand; + if ABand <> nil then + begin + for I := 0 to ABand.VisibleColumnCount - 1 do + CheckColumnPos(ABand.VisibleColumns[I]); + end; + end; + +begin + TreeList.BeginUpdate; + try + SetOwnerBand(GetBandFromIndex(ABandIndex)); + FColIndex := AColIndex; + FRowIndex := ARowIndex; + cxValidateIntDef(FColIndex, 0); + cxValidateIntDef(FRowIndex, 0); + finally + TreeList.CancelUpdate; + Changed; + end; +end; + +procedure TcxTreeListColumnPosition.Changed; +begin + if TreeList.OptionsView.HeaderSingleLine then + cxValidateSingleLine(Self); + TreeList.LayoutChanged; +end; + +function TcxTreeListColumnPosition.GetBandFromIndex( + AIndex: Integer): TcxTreeListBand; +begin + Result := nil; + with TreeList.Bands do + begin + if not cxValidateIntDefEx(AIndex, BandIndex, -1, Count - 1) then + Result := Column.OwnerBand + else + if AIndex <> cxInvalidIndex then + Result := Column.TreeList.Bands[AIndex]; + end; +end; + +procedure TcxTreeListColumnPosition.Save; +begin + FBandIndex := BandIndex; +end; + +procedure TcxTreeListColumnPosition.Load; +begin + BandIndex := FBandIndex; +end; + +function TcxTreeListColumnPosition.GetBandIndex: Integer; +begin + if Column.OwnerBand <> nil then + Result := Column.OwnerBand.Index + else + Result := -1; +end; + +function TcxTreeListColumnPosition.GetColumn: TcxTreeListColumn; +begin + Result := TcxTreeListColumn(GetOwner); +end; + +function TcxTreeListColumnPosition.GetOwnerBandVisibleIndex: Integer; +begin + Result := BandIndex; + if BandIndex <> cxInvalidIndex then + Result := Column.OwnerBand.VisibleIndex; +end; + +function TcxTreeListColumnPosition.GetTreeList: TcxCustomTreeListControl; +begin + Result := Column.TreeList; +end; + +procedure TcxTreeListColumnPosition.SetBandIndex(Index: Integer); +begin + if BandIndex <> Index then + Column.OwnerBand := GetBandFromIndex(Index); + if [csReading, csUpdating] * Column.ComponentState <> [] then + FBandIndex := Index; +end; + +procedure TcxTreeListColumnPosition.SetColIndex(Value: Integer); +begin + if cxValidateIntDefEx(Value, FColIndex, 0) then + begin + FColIndex := Value; + Column.PositionChanged; + end; +end; + +procedure TcxTreeListColumnPosition.SetLineCount(Value: Integer); +begin + if cxValidateIntDefEx(Value, FLineCount, 1) then + begin + FLineCount := Value; + Column.PositionChanged; + end; +end; + +procedure TcxTreeListColumnPosition.SetRowIndex(Value: Integer); +begin + if cxValidateIntDefEx(Value, FRowIndex, 0) then + begin + FRowIndex := Value; + Column.PositionChanged; + end; +end; + +{ TcxTreeListCaption } + +constructor TcxTreeListCaption.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FGlyph := TBitmap.Create; +end; + +constructor TcxTreeListCaption.CreateEx(ATreeList: TcxCustomTreeListControl; + AOwner: TPersistent; AViewInfo: TcxTreeListViewInfoItem); +begin + Create(AOwner); + FTreeList := ATreeList; + FViewInfo := AViewInfo; + ShowEndEllipsis := True; +end; + +destructor TcxTreeListCaption.Destroy; +begin + FreeAndNil(FGlyph); + inherited Destroy; +end; + +procedure TcxTreeListCaption.Assign(Source: TPersistent); +begin + if Source is TcxTreeListCaption then + begin + FState := TcxTreeListCaption(Source).FState; + FAlignHorz := TcxTreeListCaption(Source).FAlignHorz; + FAlignVert := TcxTreeListCaption(Source).FAlignVert; + FText := TcxTreeListCaption(Source).Text; + FGlyphAlignHorz := TcxTreeListCaption(Source).FGlyphAlignHorz; + FGlyphAlignVert := TcxTreeListCaption(Source).FGlyphAlignVert; + Glyph := TcxTreeListCaption(Source).Glyph; + end + else + inherited Assign(Source); +end; + +procedure TcxTreeListCaption.Changed; +begin + if (FViewInfo = nil) or (TreeList = nil) or TreeList.IsLocked then Exit; + FViewInfo.DoCalculate; + FViewInfo.Invalidate; +end; + +function TcxTreeListCaption.GetState(Index: Integer): Boolean; +begin + Result := cxGetState(FState, Index); +end; + +function TcxTreeListCaption.GetText: string; +begin + Result := FText; + if (Result = '') and (GetOwner is TcxTreeListColumn) then + Result := TcxItemDataBindingAccess( + TcxTreeListColumn(GetOwner).DataBinding).GetDefaultCaption; +end; + +function TcxTreeListCaption.IsTextStored: Boolean; +begin + Result := FText <> ''; + if Result and (GetOwner is TcxTreeListColumn) then + begin + Result := FText <> TcxItemDataBindingAccess( + TcxTreeListColumn(GetOwner).DataBinding).GetDefaultCaption; + end; +end; + +procedure TcxTreeListCaption.SetState(Index: Integer; Value: Boolean); +begin + if cxSetState(FState, Index, Value) then + Changed; +end; + +procedure TcxTreeListCaption.SetAlignHorz(Value: TAlignment); +begin + if Value <> FAlignHorz then + begin + FAlignHorz := Value; + Changed; + end; +end; + +procedure TcxTreeListCaption.SetAlignVert(Value: TcxAlignmentVert); +begin + if Value <> FAlignVert then + begin + FAlignVert := Value; + Changed; + end; +end; + +procedure TcxTreeListCaption.SetGlyph(Value: TBitmap); +begin + FGlyph.Assign(Value); + Changed; +end; + +procedure TcxTreeListCaption.SetGlyphAlignHorz(Value: TAlignment); +begin + if FGlyphAlignHorz <> Value then + begin + FGlyphAlignHorz := Value; + if not FGlyph.Empty then Changed; + end; +end; + +procedure TcxTreeListCaption.SetGlyphAlignVert(Value: TcxAlignmentVert); +begin + if FGlyphAlignVert <> Value then + begin + FGlyphAlignVert := Value; + if not FGlyph.Empty then Changed; + end; +end; + +procedure TcxTreeListCaption.SetText(const Value: string); +begin + if FText <> Value then + begin + FText := Value; + Changed; + end; +end; + +{ TcxTreeListColumnOptions } + +constructor TcxTreeListColumnOptions.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + Sizing := True; + CellEndEllipsis := True; +end; + +procedure TcxTreeListColumnOptions.Assign(Source: TPersistent); +begin + if Source is TcxTreeListColumnOptions then + FState := TcxTreeListColumnOptions(Source).FState; + inherited Assign(Source); +end; + +procedure TcxTreeListColumnOptions.RestoreDefaults; +begin + Sorting := True; + Sizing := True; + Customizing := True; + Editing := True; + TabStop := True; + Focusing := True; + Moving := True; + Changed; +end; + +procedure TcxTreeListColumnOptions.Changed; +begin + with TcxTreeListColumn(GetOwner) do + if TreeList <> nil then TreeList.UpdateViewStyles; +end; + +function TcxTreeListColumnOptions.GetValue(Index: Integer): Boolean; +begin + Result := cxGetState(FState, Index); +end; + +procedure TcxTreeListColumnOptions.SetValue(Index: Integer; const Value: Boolean); +begin + if cxSetState(FState, Index, Value) then Changed; +end; + +{ TcxTreeListColumnSummaryFooter } + +procedure TcxTreeListColumnSummaryFooter.Assign(Source: TPersistent); +var + AProp: TcxTreeListColumnSummaryFooter; +begin + if Source is TcxTreeListColumnSummaryFooter then + begin + AProp := TcxTreeListColumnSummaryFooter(Source); + Kind := AProp.Kind; + Format := AProp.Format; + AlignHorz := AProp.AlignHorz; + AlignVert := AProp.AlignVert; + MultiLine := AProp.MultiLine; + end + else + inherited Assign(Source); +end; + +function TcxTreeListColumnSummaryFooter.IsFormatStored: Boolean; +begin + Result := Format <> ''; +end; + +function TcxTreeListColumnSummaryFooter.IsSummaryItemValid: Boolean; +begin + ItemIndex := SummaryItemIndex; + Result := ItemIndex <> -1; +end; + +function TcxTreeListColumnSummaryFooter.Summary: TcxDataSummary; +begin + Result := DataController.Summary; +end; + +procedure TcxTreeListColumnSummaryFooter.SummaryItemChanged; +begin + with Column.TreeList do + begin + if IsLocked then Exit; + Column.ViewInfo.FColumnFooter.DoCalculate; + if OptionsView.Footer then + ViewInfo.InvalidateRect(ViewInfo.FooterRect); + end; +end; + +function TcxTreeListColumnSummaryFooter.SummaryItemIndex: Integer; +begin + Result := SummaryItems.IndexOfItemLink(Column); +end; + +function TcxTreeListColumnSummaryFooter.SummaryItems: TcxDataFooterSummaryItems; +begin + Result := Summary.FooterSummaryItems; +end; + +function TcxTreeListColumnSummaryFooter.GetColumn: TcxTreeListColumn; +begin + Result := TcxTreeListColumn(GetOwner); +end; + +function TcxTreeListColumnSummaryFooter.GetDataController: TcxCustomDataController; +begin + Result := Column.DataController; +end; + +function TcxTreeListColumnSummaryFooter.GetFormat: string; +begin + if IsSummaryItemValid then + FFormat := SummaryItem.Format; + Result := FFormat; +end; + +function TcxTreeListColumnSummaryFooter.GetSummaryItem: TcxDataSummaryItem; +begin + if IsSummaryItemValid then + Result := SummaryItems[ItemIndex] + else + Result := nil; +end; + +function TcxTreeListColumnSummaryFooter.GetSummaryKind: TcxSummaryKind; +begin + if SummaryItem <> nil then + Result := SummaryItem.Kind + else + Result := skNone; +end; + +function TcxTreeListColumnSummaryFooter.GetSummaryText: string; +begin + if IsSummaryItemValid then + Result := Summary.FooterSummaryTexts[ItemIndex] + else + Result := ''; +end; + +function TcxTreeListColumnSummaryFooter.GetSummaryValue: Variant; +begin + if IsSummaryItemValid then + Result := Summary.FooterSummaryValues[ItemIndex] + else + Result := ''; +end; + +procedure TcxTreeListColumnSummaryFooter.SetAlignHorz(Value: TAlignment); +begin + if FAlignHorz <> Value then + begin + FAlignHorz := Value; + SummaryItemChanged; + end; +end; + +procedure TcxTreeListColumnSummaryFooter.SetAlignVert(Value: TcxAlignmentVert); +begin + if FAlignVert <> Value then + begin + FAlignVert := Value; + SummaryItemChanged; + end; +end; + +procedure TcxTreeListColumnSummaryFooter.SetFormat(const Value: string); +begin + FFormat := Value; + if IsSummaryItemValid then + SummaryItem.Format := Value; + SummaryItemChanged; +end; + +procedure TcxTreeListColumnSummaryFooter.SetMultiLine(Value: Boolean); +begin + if Value <> FMultiLine then + begin + FMultiLine := Value; + SummaryItemChanged; + end; +end; + +procedure TcxTreeListColumnSummaryFooter.SetSummaryText(const Value: string); +begin + SummaryValue := Value; + if IsSummaryItemValid then + Summary.FooterSummaryValues[ItemIndex] := Value; +end; + +procedure TcxTreeListColumnSummaryFooter.SetSummaryValue(const Value: Variant); +begin + if IsSummaryItemValid then + Summary.FooterSummaryValues[ItemIndex] := Value; + SummaryItemChanged; +end; + +procedure TcxTreeListColumnSummaryFooter.SetSummaryKind(Value: TcxSummaryKind); +begin +{ if Kind <> Value then + begin + if Value = skNone then + SummaryItem.Free + else } + begin + if not IsSummaryItemValid then + SummaryItems.Add.ItemLink := Column; + with SummaryItem do + begin + Kind := Value; + Format := FFormat; + end; + SummaryItemChanged; + end; +// end; +end; + +{ TcxTreeListColumn } + +constructor TcxTreeListColumn.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FViewInfo := GetViewInfoClass.Create(Self); + FSummaryFooter := GetSummaryFooterClass.Create(Self); + FCaption := TcxTreeListCaption.CreateEx(nil, Self, FViewInfo.FColumnHeader); + FPosition := GetPositionClass.Create(Self); + FMinWidth := cxTreeListDefMinWidth; + SetState(tlcsVisible, True); +end; + +destructor TcxTreeListColumn.Destroy; +begin + SortOrder := soNone; + if Visible then + TreeList.ViewInfo.NodesViewInfo.Clear; + if (TreeList <> nil) and not TreeList.IsDestroying then + begin + if TreeList <> nil then + TreeList.ColumnsList.Remove(Self); + if Controller.FocusedItem = Self then + Controller.FocusedItem := nil; + UpdateIndexesBeforeRemove; + OwnerBand := nil; + TreeList.DoUpdateDesignerForms; + if TreeList.Preview.Column = Self then + TreeList.Preview.Column := nil; + if TreeList.OptionsView.CategorizedColumn = Self then + TreeList.OptionsView.CategorizedColumn := nil; + end; + FreeAndNil(FCaption); + FreeAndNil(FViewInfo); + FreeAndNil(FPosition); + FreeAndNil(FSummaryFooter); + inherited Destroy; +end; + +procedure TcxTreeListColumn.Assign(Source: TPersistent); +var + AColumn: TcxTreeListColumn; +begin + TreeList.BeginUpdate; + try + inherited Assign(Source); + if Source is TcxTreeListColumn then + begin + AColumn := TcxTreeListColumn(Source); + FCalculatedWidth := AColumn.FCalculatedWidth; + FMinWidth := AColumn.FMinWidth; + FWidth := AColumn.FWidth; + Position := TcxTreeListColumn(Source).Position; + Caption := AColumn.Caption; + SortOrder := AColumn.FSortOrder; + Visible := AColumn.Visible; + end; + finally + TreeList.EndUpdate; + end; +end; + +procedure TcxTreeListColumn.ApplyBestFit; +var + ANode: TcxTreeListNode; + AIndentSize, AWidth: Integer; + AHeight, AOffset, ACount: Integer; + AIsLeftMost: Boolean; + AInfo: TcxTemporaryCellViewInfo; +begin + if (TreeList = nil) or not CanSizing(dsdHorz) then Exit; + if IsLeftMost then + TreeList.FContentIndentWidth := 0; + TreeList.HandleNeeded; + AHeight := TreeList.ViewInfo.DefaultHeight; + ANode := TreeList.GetStartNodeForBestFit; + ACount := TreeList.GetCountNodeForBestFit; + AInfo := TcxTemporaryCellViewInfo(TreeList.ViewInfo.SizingViewInfo); + AIsLeftMost := IsLeftMost; + AIndentSize := TreeList.FLevelIndentWidth; + try + TreeList.HideEdit; + while (ACount <> 0) and (ANode <> nil) do + begin + if AIsLeftMost then + AOffset := (ANode.Level + Byte(TreeList.OptionsView.ShowRoot)) * AIndentSize + else + AOffset := 0; + AWidth := AInfo.CalculateWidth(Self, ANode, True, AHeight); + if (AWidth + AOffset) > Data then + FData := AWidth + AOffset; + ANode := ANode.GetNextVisible; + Dec(ACount); + end; + AWidth := GetHeaderFooterBestfitSize; + if AWidth > Data then Data := AWidth; + SetSizeDelta(dsdHorz, Data - DisplayWidth); + finally + Data := 0; + TreeList.LayoutChanged; + TreeList.Controller.CheckEdit; + end; +end; + +function TcxTreeListColumn.GetDisplayText(Index: Integer): string; +begin + Result := VarToStr(DoOnGetDisplayText(TreeList.Controller.GetNode(Index), True)); +end; + +function TcxTreeListColumn.GetParentComponent: TComponent; +begin + Result := EditingControl; +end; + +function TcxTreeListColumn.HasParent: Boolean; +begin + Result := True; +end; + +procedure TcxTreeListColumn.MakeVisible; +var + AShift: Integer; + R: TRect; +begin + if Visibility and (OwnerBand.FixedKind = tlbfNone) then + begin + AShift := 0; + R := TreeList.ViewInfo.ScrollingArea; + if TreeList.OptionsView.Indicator and (TreeList.FixedBandCount = 0) then + Inc(R.Left, TreeList.OptionsView.IndicatorWidth); + with ViewInfo do + begin + if IsLeftMost then + begin + if (DisplayWidth > cxRectWidth(R)) and (XOfs <= R.Left) and + ((XOfs + DisplayWidth) > R.Left) then + Exit + else + AShift := 0; + end + else + if (XOfs + DisplayWidth) >= R.Right then + AShift := (XOfs + DisplayWidth) - R.Right + else + if XOfs <= R.Left then + AShift := XOfs - R.Left - OptionsView.HorzIncrement; + if (XOfs >= R.Left) and ((XOfs + DisplayWidth) <= R.Right) and not IsLeftMost then Exit; + end; + if AShift <> 0 then + begin + Inc(AShift, TreeList.ViewInfo.HorzScrollPos); + TreeList.Scroll(sbHorizontal, scPosition, AShift); + end + else + if IsLeftMost then + TreeList.Scroll(sbHorizontal, scPosition, AShift); + end; + TreeList.LayoutChanged; +end; + +procedure TcxTreeListColumn.RestoreDefaults; +begin + TreeList.BeginUpdate; + try + Options.RestoreDefaults; + SortOrder := soNone; + Caption.FAlignVert := vaTop; + Caption.FAlignHorz := taLeftJustify; + RestoreWidths; + finally + TreeList.EndUpdate; + end; +end; + +procedure TcxTreeListColumn.RestoreWidths; +begin + TreeList.BeginUpdate; + try + FMinWidth := cxTreeListDefMinWidth; + SetWidth(cxTreeListDefWidth); + finally + TreeList.EndUpdate; + end; +end; + +procedure TcxTreeListColumn.DoSizeChanged; +begin + if Visibility or TreeList.IsLocked then + TreeList.LayoutChanged; + TreeList.DoColumnSizeChanged(Self); +end; + +function TcxTreeListColumn.CanInitEditing: Boolean; +begin + with TreeList do + begin + Result := inherited CanInitEditing and ((DragAndDropState = ddsNone) or + ((DragMode <> dmAutomatic) or not HitTest.HitAtNode)); + end; +end; + +function TcxTreeListColumn.CanMoving: Boolean; +begin + Result := TreeList.OptionsCustomizing.ColumnMoving and + Options.Moving{ and (TreeList.VisibleColumnCount > 1)}; +end; + +function TcxTreeListColumn.CanSorted: Boolean; +begin + Result := not Assigned(OnGetEditProperties) and + (esoSorting in PropertiesValue.GetSupportedOperations); + if not Result then + Result := Assigned(TreeList.FOnCompare); +end; + +function TcxTreeListColumn.CanFocus: Boolean; +begin + Result := inherited CanFocus and TreeList.OptionsSelection.CellSelect; +end; + +function TcxTreeListColumn.GetRealSortOrder: TcxDataSortOrder; +begin + Result := soNone; + if CanSorted then + Result := FSortOrder; +end; + +function TcxTreeListColumn.GetHeaderFooterBestfitSize: Integer; + + function CalcSize(AViewParams: TcxViewParams; const AText: string): Integer; + begin + Result := cxTextWidth(AViewParams.Font, AText) + cxTextOffset shl 2; + end; + +var + ASize: Integer; +begin + Result := FMinWidth; + with TreeList.Styles do + begin + if TreeList.OptionsView.Headers then + begin + with Caption do + begin + ASize := CalcSize(GetColumnHeaderParams(Self), Text); + if not Glyph.Empty and (Byte(GlyphAlignHorz) < 2) then + Inc(ASize, Glyph.Width); + if ASize > Result then Result := ASize; + if SortOrder <> soNone then + Inc(Result, TreeList.LookAndFeelPainter.SortingMarkAreaSize.X); + end; + end; + if TreeList.OptionsView.Footer and Options.Footer then + begin + ASize := CalcSize(GetColumnFooterParams(Self), SummaryFooter.SummaryText); + with TreeList.LookAndFeelPainter do + Inc(ASize, (FooterCellBorderSize + FooterCellOffset) shl 1); + if ASize > Result then Result := ASize; + end; + end; +end; + +function TcxTreeListColumn.GetOptionsClass: TcxCustomEditContainerItemOptionsClass; +begin + Result := TcxTreeListColumnOptions; +end; + +function TcxTreeListColumn.GetState(Index: Integer): Boolean; +begin + Result := cxGetState(FState, Index); +end; + +function TcxTreeListColumn.GetStylesClass: TcxEditContainerStylesClass; +begin + Result := TcxTreeListColumnStyles; +end; + +function TcxTreeListColumn.GetSummaryFooterClass: TcxTreeListColumnSummaryFooterClass; +begin + Result := TcxTreeListColumnSummaryFooter; +end; + +procedure TcxTreeListColumn.SetEditingControl(Value: TcxEditingControl); +begin + if TreeList <> nil then + TreeList.ColumnsList.Remove(Self); + if not (csDestroying in ComponentState) and (Value <> nil) then + FCaption.FTreeList := TcxCustomTreeListControl(Value); + inherited SetEditingControl(Value); + if TreeList <> nil then TreeList.DoUpdateDesignerForms; +end; + +procedure TcxTreeListColumn.SetName(const Value: TComponentName); +begin + inherited SetName(Value); + if Assigned(FOnChangeName) then FOnChangeName(Self); +end; + +procedure TcxTreeListColumn.SetParentComponent(Value: TComponent); +begin + if Value is TcxEditingControl then + EditingControl := Value as TcxEditingControl + else + EditingControl := nil; +end; + +procedure TcxTreeListColumn.SetState(Index: Integer; Value: Boolean); +begin + cxSetState(FState, Index, Value) +end; + +function TcxTreeListColumn.HasDataTextHandler: Boolean; +begin + Result := Assigned(FOnGetDisplayText); +end; + +procedure TcxTreeListColumn.InitAutoWidthItem(AItem: TcxAutoWidthItem); +begin + AItem.Width := Width; + AItem.MinWidth := FMinWidth; + AItem.Fixed := not Options.Sizing or IsFixed; + AItem.AutoWidth := -1; +end; + +procedure TcxTreeListColumn.InternalSetBandOwner( + ABand: TcxTreeListBand; RemoveFromOwner: Boolean); +begin + try + if ABand = OwnerBand then Exit; + if IsBandAssigned and RemoveFromOwner then + FOwnerBand.RemoveColumn(Self); + if ABand <> nil then + ABand.AddColumn(Self); + finally + FOwnerBand := ABand; + DoVisibilityChanged; + end; +end; + +function TcxTreeListColumn.IsBandAssigned: Boolean; +begin + Result := FOwnerBand <> nil; +end; + +procedure TcxTreeListColumn.PositionChanged; +begin + if IsBandAssigned then + OwnerBand.Changed(True); +end; + +procedure TcxTreeListColumn.UpdateIndexesBeforeRemove; +var + I: Integer; + APos: TcxtreeListColumnPosition; +begin + if OwnerBand = nil then Exit; + for I := 0 to OwnerBand.ColumnCount - 1 do + begin + APos := OwnerBand.Columns[I].Position; + if (APos.RowIndex = Position.RowIndex) and (APos.FColIndex > Position.ColIndex) then + Dec(APos.FColIndex); + end; +end; + +function TcxTreeListColumn.CanSizing(ADirection: TcxDragSizingDirection): Boolean; +begin + if ADirection = dsdVert then + Result := TreeList.OptionsCustomizing.ColumnVertSizing and + not TreeList.OptionsView.HeaderSingleLine + else + Result := Options.Sizing and TreeList.OptionsCustomizing.ColumnHorzSizing; +end; + +function TcxTreeListColumn.GetAvailableMaxWidth: Integer; +var + AFromIndex, AToIndex: Integer; +begin + Result := FMinWidth; + if not Visibility then Exit; + Result := MaxInt shr 2; + if OwnerBand.Width <> 0 then + begin + Result := OwnerBand.DisplayWidth - OwnerBand.IndentWidth; + cxGetIndexes(OwnerBandRow.FItems, Self, AFromIndex, AToIndex); + with OwnerBandRow do + while AFromIndex <= AToIndex do + begin + Dec(Result, Items[AFromIndex].GetRealMinSize); + Inc(AFromIndex); + end; + end; +end; + +function TcxTreeListColumn.GetRealMinSize: Integer; +begin + if Options.Sizing then + Result := FMinWidth + else + Result := FWidth; +end; + +function TcxTreeListColumn.GetSizingBoundsRect( + ADirection: TcxDragSizingDirection): TRect; +begin + with TreeList.ViewInfo, ViewInfo.FColumnHeader do + begin + if ADirection <> dsdVert then + Result := cxRectSetLeft(ClientRect, DisplayRect.Left + GetRealMinSize, GetAvailableMaxWidth) + else + Result := cxRectSetTop(ClientRect, DisplayRect.Top + HeaderLineHeight); + end; +end; + +function TcxTreeListColumn.GetSizingIncrement( + ADirection: TcxDragSizingDirection): Integer; +begin + if ADirection = dsdHorz then + Result := 1 + else + Result := TreeList.ViewInfo.HeaderLineHeight; +end; + +function TcxTreeListColumn.IsDynamicUpdate: Boolean; +var + ADir: TcxDragSizingDirection; +begin + Result := TreeList.OptionsCustomizing.DynamicSizing and + TreeList.HitTest.CanSizing(ADir) and (ADir = dsdHorz); +end; + +procedure TcxTreeListColumn.SetSizeDelta( + ADirection: TcxDragSizingDirection; ADelta: Integer); +begin + if ADelta = 0 then Exit; + TreeList.Controller.ForceWidthItem := Self; + if ADirection = dsdHorz then + begin + TreeList.BeginUpdate; + try + TreeList.AssignColumnWidths; + Width := DisplayWidth + ADelta; + // calculate new realwidth for band + OwnerBand.BandRows.Refresh; + OwnerBand.FCalculatedWidth := OwnerBand.BandRows.ColumnsMaxWidth; + // refresh columns in band + OwnerBand.RealignColumns; + // refresh bands (may be depends on column widths) + TreeList.RealignBands; + // refresh columns in band, band width can changed after refresh bands + OwnerBand.RealignColumns; + // apply new widths + TreeList.AssignColumnWidths; + finally + TreeList.EndUpdate; + end; + end + else + Position.FLineCount := Position.LineCount + ADelta; + TreeList.Controller.ForceWidthItem := nil; + TreeList.LayoutChanged; + TreeList.Modified; +end; + +function TcxTreeListColumn.GetItemIndex: Integer; +begin + Result := inherited ItemIndex; +end; + +function TcxTreeListColumn.GetVisibleIndex: Integer; +begin + Result := TreeList.FColumnsVisibleList.IndexOf(Self) +end; + +procedure TcxTreeListColumn.SetItemIndex(Value: Integer); + + function IsIndexValid(AIndex: Integer): Boolean; + begin + Result := (AIndex >= 0) and (AIndex < TreeList.ContainerList.Count) + end; + +begin + with TreeList do + begin + BeginUpdate; + try + if IsIndexValid(ItemIndex) and IsIndexValid(Value) then + ContainerList.Exchange(ItemIndex, Value); + if VisibleIndex >= 0 then + begin + if VisibleIndex > Value then + Dec(Position.FColIndex) + else + Inc(Position.FColIndex); + end; + DataController.UpdateItemIndexes; + finally + EndUpdate; + end; + end; +end; + +procedure TcxTreeListColumn.SetVisibleIndex(Value: Integer); +begin + // todo: do nothing +end; + +function TcxTreeListColumn.GetObjectName: string; +begin + Result := Name; + if Result = '' then + Result := ClassName + IntToStr(ItemIndex); +end; + +function TcxTreeListColumn.GetProperties(AProperties: TStrings): Boolean; +var + I: Integer; +begin + for I := 0 to High(ColumnPropertiesName) do + AProperties.Add(ColumnPropertiesName[I]); + Result := True; +end; + +function TcxTreeListColumn.GetPropertyIndex(const AName: string): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to High(ColumnPropertiesName) do + begin + if AnsiCompareText(ColumnPropertiesName[I], AName) = 0 then + begin + Result := I; + Break; + end; + end; +end; + +procedure TcxTreeListColumn.GetPropertyValue( + const AName: string; var AValue: Variant); +begin + case GetPropertyIndex(AName) of + 0: AValue := Visible; + 1: AValue := ItemIndex; + 2: AValue := Position.FLineCount; + 3: AValue := Position.FColIndex; + 4: AValue := Position.FRowIndex; + 5: AValue := Position.BandIndex; + 6: AValue := Caption.Text; + 7: AValue := SortOrder; + 9: AValue := FMinWidth; + 10: AValue := FIsWidthAssigned; + 11: AValue := FWidth; + end; +end; + +procedure TcxTreeListColumn.SetPropertyValue( + const AName: string; const AValue: Variant); +begin + case GetPropertyIndex(AName) of + 0: Visible := AValue; + 1: ItemIndex := AValue; + 2: Position.FLineCount := AValue; + 3: Position.FColIndex := AValue; + 4: Position.FRowIndex := AValue; + 5: Position.BandIndex := AValue; + 6: + if Caption.Text = '' then + Caption.Text := AValue; + 7: FSortOrder := AValue; + 9: FMinWidth := AValue; + 10: FIsWidthAssigned := AValue; + 11: FWidth := AValue; + end; +end; + +procedure TcxTreeListColumn.DoGetDisplayText( + ARecordIndex: Integer; var AText: string); +begin + if (ARecordIndex >= 0) and (ARecordIndex < TreeList.FNodesList.Count) and + (ARecordIndex < DataController.RecordCount) then + begin + AText := DoGetNodeDisplayText( + TcxTreeListNode(TreeList.FNodesList[ARecordIndex]), AText); + end; +end; + +function TcxTreeListColumn.DoGetNodeDisplayText( + ANode: TcxTreeListNode; const AValue: Variant): Variant; +var + AText: string; +begin + Result := AValue; + if Assigned(OnGetDisplayText) then + begin + AText := VarToStr(Result); + OnGetDisplayText(Self, ANode, AText); + Result := AText; + end; +end; + +function TcxTreeListColumn.DoOnGetDisplayText( + ANode: TcxTreeListNode; AsText: Boolean = False; AValueOnly: Boolean = False): Variant; +var + AProperties: TcxCustomEditProperties; + AText: string; +begin + AProperties := DoGetEditProperties(ANode); + Result := GetDisplayValue(AProperties, ANode.RecordIndex); + if AValueOnly then Exit; + if Assigned(OnGetDisplayText) or AsText then + begin + if AProperties.GetEditValueSource(False) = evsValue then + begin + if AsText then + AText := AProperties.GetDisplayText(Values[ANode.RecordIndex], True) + else + AText := ''; + AText := DoGetNodeDisplayText(ANode, AText); + if (AText = '') and not AsText then + Result := Values[ANode.RecordIndex] + else + Result := AText; + end + else + Result := DoGetNodeDisplayText(ANode, Result); + end; +end; + +procedure TcxTreeListColumn.DoVisibilityChanged; +begin + if (FOwnerBand <> nil) and (TreeList <> nil) and not TreeList.IsDestroying then + begin + FOwnerBand.Changed(True); + TreeList.DoUpdateDesignerForms; + end; +end; + +function TcxTreeListColumn.GetCellHeight(ANode: TcxTreeListNode; + AWidth, ALines: Integer; AFont: TFont; const AValue: Variant): Integer; +var + ASizeProp: TcxEditSizeProperties; + AEditProp: TcxCustomEditProperties; + AViewData: TcxCustomEditViewData; +begin + ASizeProp := cxDefaultEditSizeProp; + AEditProp := DoGetEditProperties(ANode); + AViewData := nil; + try + if AEditProp = PropertiesValue then + AViewData := EditViewData + else + AViewData := AEditProp.CreateViewData(TreeList.EditStyle, True); + AViewData.Style.Font := AFont; + ASizeProp.Width := AWidth; + ASizeProp.MaxLineCount := ALines; + Result := AViewData.GetEditSize(GetControlCanvas, AValue, ASizeProp).cy; + finally + if AViewData <> EditViewData then FreeAndNil(AViewData); + end; +end; + +function TcxTreeListColumn.GetPositionClass: TcxTreeListColumnPositionClass; +begin + Result := TcxTreeListColumnPosition; +end; + +function TcxTreeListColumn.GetViewInfoClass: TcxTreeListColumnViewInfoClass; +begin + Result := TcxTreeListColumnViewInfo; +end; + +function TcxTreeListColumn.GetEditingProperties: TcxTreeListGetEditPropertiesEvent; +begin + Result := TcxTreeListGetEditPropertiesEvent(inherited OnGetEditingProperties); +end; + +function TcxTreeListColumn.GetEditProperties: TcxTreeListGetEditPropertiesEvent; +begin + Result := TcxTreeListGetEditPropertiesEvent(inherited OnGetEditProperties); +end; + +function TcxTreeListColumn.GetIndentWidth: Integer; +begin + Result := TreeList.GetIndentWidth(IsLeftMost); +end; + +function TcxTreeListColumn.GetDataBinding: TcxItemDataBinding; +begin + Result := TcxItemDataBinding(inherited DataBinding); +end; + +function TcxTreeListColumn.GetDisplayWidth: Integer; +begin + if Visibility then + Result := RealWidth + IndentWidth + else + Result := 0; +end; + +function TcxTreeListColumn.GetIsFixed: Boolean; +var + AForceWidthItem: TcxTreeListColumn; +begin + if (TreeList.Controller.ForceWidthItem is TcxTreeListColumn) then + begin + AForceWidthItem := TreeList.Controller.ForceWidthItem as TcxTreeListColumn; + Result := (AForceWidthItem.OwnerBand = OwnerBand) and ((AForceWidthItem = Self) or + (not AForceWidthItem.IsRight and (VisibleIndex < AForceWidthItem.VisibleIndex))); + end + else + Result := False; +end; + +function TcxTreeListColumn.GetIsHidden: Boolean; +begin + Result := not Visibility or IsPreview; +end; + +function TcxTreeListColumn.GetIsLeft: Boolean; +begin + Result := Visibility and (OwnerBandRow <> nil) and (OwnerBandRow.First = Self); +end; + +function TcxTreeListColumn.GetIsLeftMost: Boolean; +begin + Result := IsLeft and (OwnerBand.VisibleIndex = 0); +end; + +function TcxTreeListColumn.GetIsRightMost: Boolean; +begin + Result := IsRight and (OwnerBand.VisibleIndex = TreeList.VisibleBandCount - 1); +end; + +function TcxTreeListColumn.GetIsPreview: Boolean; +begin + Result := (TreeList <> nil) and (TreeList.Preview.Column = Self); +end; + +function TcxTreeListColumn.GetIsRight: Boolean; +begin + Result := Visibility and (OwnerBandRow.Last = Self); +end; + +function TcxTreeListColumn.GetIsWidthStored: Boolean; +begin + Result := FIsWidthAssigned; +end; + +function TcxTreeListColumn.GetStyles: TcxTreeListColumnStyles; +begin + Result := TcxTreeListColumnStyles(inherited Styles); +end; + +function TcxTreeListColumn.GetOptions: TcxTreeListColumnOptions; +begin + Result := TcxTreeListColumnOptions(inherited Options); +end; + +function TcxTreeListColumn.GetOwnerBandRow: TcxTreeListBandRow; +begin + if (OwnerBand <> nil) and (OwnerBand.BandRows.Count > 0) then + Result := OwnerBand.BandRows[Position.RowIndex] + else + Result := nil; +end; + +function TcxTreeListColumn.GetRealMinWidth: Integer; +begin + Result := FMinWidth; + if IsFixed then + Result := RealWidth; +end; + +function TcxTreeListColumn.GetRealWidth: Integer; +begin + Result := FCalculatedWidth; + if Result = 0 then + Result := Width; +end; + +function TcxTreeListColumn.GetTreeList: TcxCustomTreeListControl; +begin + Result := TcxCustomTreeListControl(EditingControl); +end; + +function TcxTreeListColumn.GetVisible: Boolean; +begin + if TreeList.CanColumnVisible(Self) then + Result := GetState(tlcsVisible) + else + Result := False; +end; + +function TcxTreeListColumn.GetVisibility: Boolean; +begin + Result := Visible and (IsBandAssigned and OwnerBand.Visible) +end; + +function TcxTreeListColumn.GetWidth: Integer; +begin + if FIsWidthAssigned then + Result := FWidth + else + Result := Max(MinWidth, cxTreeListDefWidth); +end; + +procedure TcxTreeListColumn.SetCaption(Value: TcxTreeListCaption); +begin + FCaption.Assign(Value); +end; + +procedure TcxTreeListColumn.SetDataBinding(Value: TcxItemDataBinding); +begin + DataBinding.Assign(Value); +end; + +procedure TcxTreeListColumn.SetEditingProperties( + Value: TcxTreeListGetEditPropertiesEvent); +begin + inherited OnGetEditingProperties := TcxGetEditPropertiesEvent(Value); +end; + +procedure TcxTreeListColumn.SetEditProperties( + Value: TcxTreeListGetEditPropertiesEvent); +begin + inherited OnGetEditProperties := TcxGetEditPropertiesEvent(Value); +end; + +procedure TcxTreeListColumn.SetIsPreview(Value: Boolean); +begin + if Value <> IsPreview then + begin + if Value then + TreeList.Preview.Column := Self + else + TreeList.Preview.Column := nil; + end; +end; + +procedure TcxTreeListColumn.SetMinWidth(Value: Integer); +begin + if cxValidateIntDefEx(Value, FMinWidth, 0) then + begin + FMinWidth := Value; + if FMinWidth > Width then + SetWidth(FMinWidth); + end; +end; + +procedure TcxTreeListColumn.SetOptions(Value: TcxTreeListColumnOptions); +begin + Options.Assign(Value); +end; + +procedure TcxTreeListColumn.SetOwnerBand(Value: TcxTreeListBand); +begin + InternalSetBandOwner(Value, Value <> OwnerBand) +end; + +procedure TcxTreeListColumn.SetPosition(Value: TcxTreeListColumnPosition); +begin + FPosition.Assign(Value); +end; + +procedure TcxTreeListColumn.SetSorted(Value: TcxDataSortOrder); +begin + if not Options.Sorting then + Value := soNone; + if Value <> FSortOrder then + begin + FSortOrder := Value; + with TreeList do + begin + FNeedRestoreSorting := FNeedRestoreSorting or (Value = soNone); + ColumnSortOrderChanged(Self); + end; + if CanSorted and (TreeList <> nil) and not IsDestroying then + begin + TreeList.DoSortNodes; + if not TreeList.IsLocked then + ViewInfo.ColumnHeader.Invalidate(True); + end; + TreeList.Modified; + end; +end; + +procedure TcxTreeListColumn.SetStyles(Value: TcxTreeListColumnStyles); +begin + Styles.Assign(Value); +end; + +procedure TcxTreeListColumn.SetSummaryFooter( + Value: TcxTreeListColumnSummaryFooter); +begin + FSummaryFooter.Assign(Value); +end; + +procedure TcxTreeListColumn.SetVisible(Value: Boolean); +begin + if Value <> GetState(tlcsVisible) then + begin + SetState(tlcsVisible, Value); + if FOwnerBand <> nil then + begin + if not Value then + OwnerBand.FColumns.Remove(Self) + else + if OwnerBand.FColumns.IndexOf(Self) < 0 then + OwnerBand.FColumns.Add(Self); + end; + if IsBandAssigned and OwnerBand.Visible then DoVisibilityChanged; + end; +end; + +procedure TcxTreeListColumn.SetWidth(Value: Integer); +begin + if cxValidateIntDefEx(Value, FWidth, FMinWidth) then + begin + FWidth := Value; + FIsWidthAssigned := True; + DoSizeChanged; + end; +end; + +{ TcxTreeListDragAndDropObject } + +destructor TcxTreeListDragAndDropObject.Destroy; +begin + FreeAndNil(ScreenArrows); + FreeAndNil(DragDropInfo); + inherited Destroy; +end; + +procedure TcxTreeListDragAndDropObject.BeginDragAndDrop; +begin + inherited BeginDragAndDrop; + with TreeList.ViewInfo do + begin + if ScrollingAreaVisible then + with ScrollingArea do + begin + AddAutoScrollingObject(Rect(Left, Top, Left + cxtlScrollDelta, Bottom), + sbHorizontal, scLineUp); + AddAutoScrollingObject(Rect(Right - cxtlScrollDelta, Top, Right, Bottom), + sbHorizontal, scLineDown); + end; + if IsDragColumn then + begin + if not DragColumn.Visibility then StorePosition; + if TreeList.Customizing.Visible then + TreeList.Customizing.MakeColumnSheetVisible; + end + else + if IsDragBand and TreeList.Customizing.Visible then + TreeList.Customizing.MakeBandSheetVisible; + end; +end; + +function TcxTreeListDragAndDropObject.GetDisplayRect: TRect; +begin + Result := TcxTreeListHeaderViewInfo(DragItem).GetDisplayRect; +end; + +function TcxTreeListDragAndDropObject.GetDragAndDropCursor( + Accepted: Boolean): TCursor; +begin + Result := inherited GetDragAndDropCursor(Accepted); + if not Accepted and TreeList.Customizing.Visible then + begin + if not IsDragBand or not TreeList.OptionsView.SimpleCustomizeBox and + (TreeList.VisibleColumnCount > 1) then + Result := crcxRemove; + if IsDragColumn and not DragColumn.Options.Customizing then + Result := crArrow; + end + else + if Accepted and TreeList.Customizing.Visible and + IsDragColumn and not DragColumn.Options.Customizing then + begin + if CheckCustomizingBox(DragDropInfo.DropPos) then + Result := inherited GetDragAndDropCursor(False) + else + Result := crArrow; + end; + if Result = crDefault then Result := crArrow; +end; + +procedure TcxTreeListDragAndDropObject.ChangeArrowPos(const ABaseLine: TRect; + AllowHide: Boolean); +begin + if AllowHide then + begin + if ScreenArrows <> nil then + ScreenArrows.Hide; + end + else + begin + ArrowBaseLine := ABaseLine; + DoDrawArrows; + end; +end; + +function TcxTreeListDragAndDropObject.CheckCustomizingBox( + const APos: TPoint): Boolean; +begin + with TreeList do + Result := Customizing.PtInCustomizingBox(ClientToScreen(APos)); +end; + +function TcxTreeListDragAndDropObject.CheckDropPos(ADragIndex, ADropIndex, + DragX, DropX: Integer; var APos: Integer; var ASide: TcxBorder; + ACheckIndex: Boolean = True): Boolean; +begin + if ADragIndex = -1 then Dec(ADragIndex); + APos := ADropIndex; + ASide := bRight; + if ACheckIndex then + Result := (ADragIndex <> ADropIndex) and + (ADragIndex <> (ADropIndex + cxIntOffs[DragX > DropX])) + else + Result := True; + if not Result then + APos := ADragIndex + else + if DragX <= DropX then + ASide := bLeft + else + Inc(APos); +end; + +procedure TcxTreeListDragAndDropObject.DoDrawHeaderItem( + AItem: TcxTreeListHeaderViewInfo); +var + AState: TcxButtonState; +begin + AState := AItem.FState; + AItem.FState := cxbsDefault; + try + if AItem is TcxTreeListColumnHeaderViewInfo and + not TcxTreeListColumnHeaderViewInfo(AItem).Column.Visibility then + begin + Canvas.Brush.Color := clBtnShadow; + Canvas.FillRect(TcxTreeListColumnHeaderViewInfo(AItem).GetDisplayRect); + end + else + begin + Canvas.Brush.Color := AItem.BandViewInfo.FContainerViewParams.Color; + Canvas.FillRect(AItem.BandViewInfo.DisplayRect); + end; + Painter.DrawHeaderItem(AItem, True); + finally + AItem.FState := AState; + end; +end; + +procedure TcxTreeListDragAndDropObject.DoDrawArrows; +var + APosChanged: Boolean; +begin + if ScreenArrows = nil then + ScreenArrows := TcxPlaceArrows.CreateArrows(TreeList.OptionsView.DropArrowColor, clBtnText); + if ArrowBaseLine.Left = ArrowBaseLine.Right then + APosChanged := ScreenArrows.MoveTo(ArrowBaseLine, bLeft) + else + APosChanged := ScreenArrows.MoveTo(ArrowBaseLine, bTop); + if APosChanged and DragImage.Visible then + begin + SetWindowPos(ScreenArrows.Handle, DragImage.Handle, 0, 0, 0, 0, + SWP_NOMOVE + SWP_NOSIZE + SWP_NOACTIVATE); + end; +end; + +procedure TcxTreeListDragAndDropObject.DragAndDrop( + const P: TPoint; var Accepted: Boolean); +var + ALine: TRect; +begin + TreeList.Controller.IsDragDropProcess := True; + InitDropInfo(P); + Accepted := DragDropInfo.Accepted; + ALine := ArrowBaseLine; + inherited DragAndDrop(P, Accepted); +end; + +procedure TcxTreeListDragAndDropObject.DropHeaderItem; +begin + with TcxTreeListHeaderDragDropInfo(DragDropInfo) do + begin + if not Accepted then Exit; + if IsDragColumn and ((DragColumn.OwnerBand = DropBand) or + (not DropBand.IsOnlyOwnColumns and ((DragColumn.OwnerBand = nil) or + not DragColumn.OwnerBand.IsOnlyOwnColumns))) then + with TcxTreeListColumnHeaderViewInfo(DragItem).Column do + begin + TreeList.BeginUpdate; + try + Position.SetPositionEx(DropBand.Index, ColIndex, RowIndex, IsInsertRow); + Visible := True; + finally + TreeList.EndUpdate; + end; + end + else + if IsDragBand then + begin + with TcxTreeListHeaderViewInfo(DragItem).BandViewInfo.Band do + begin + if Index < (ColIndex - 1) then + Dec(ColIndex); + cxRange(ColIndex, 0, TreeList.Bands.Count - 1); + if TreeList.FixedBandCount < TreeList.VisibleBandCount then + Index := ColIndex; + Visible := True; + end; + end; + end; +end; + +procedure TcxTreeListDragAndDropObject.DropNodes; +begin + // todo: do nothing; +end; + +procedure TcxTreeListDragAndDropObject.EndDragAndDrop(Accepted: Boolean); +var + ACanDrop: Boolean; +begin + ACanDrop := True; + if DragDropInfo <> nil then + DragDropInfo.Accepted := DragDropInfo.Accepted and not TreeList.Controller.DragCancel; + if (DragDropInfo <> nil) and not DragDropInfo.Accepted + and IsDragColumn and not DragColumn.Visibility then RestorePosition; + if not TreeList.Controller.DragCancel and (DragDropInfo <> nil) and + (DragDropInfo.Accepted or TreeList.Customizing.Visible) then + begin + if not CheckCustomizingBox(DragDropInfo.DropPos) and DragDropInfo.Accepted then + begin + DropHeaderItem; + ACanDrop := True; + end + else + begin + ACanDrop := False; + if IsDragColumn then + begin + if DragColumn.Options.Customizing and (TreeList.VisibleColumnCount > 1) then + DragColumn.Visible := False; + end + else + if not TreeList.OptionsView.SimpleCustomizeBox then + DragBand.Visible := False; + end; + end + else + TcxTreeListHeaderViewInfo(DragItem).Pressed := False; + inherited EndDragAndDrop(ACanDrop); + RestoreArrows; + TreeList.UpdateViewStyles; + TreeList.Modified; + TreeList.Customizing.Modified; +end; + +function TcxTreeListDragAndDropObject.GetAcceptedRect: TRect; +begin + Result := TcxTreeListHeaderViewInfo(DragItem).GetDroppingRect; +end; + +function TcxTreeListDragAndDropObject.GetArrowBaseLine( + const ARect: TRect; ASide: TcxBorder): TRect; +begin + with cxRectOffset(ARect, OrgOffset) do + begin + case ASide of + bLeft: + Result := cxRect(Left, Top, Left, Bottom - 1); + bTop: + Result := cxRect(Left, Top, Right - 1, Top); + bRight: + Result := cxRect(Right - 1, Top, Right - 1, Bottom - 1); + bBottom: + Result := cxRect(Left, Bottom - 1, Right - 1, Bottom - 1); + end; + end; +end; + +procedure TcxTreeListDragAndDropObject.GetArrowRects(out R1, R2: TRect); +begin + with ArrowBaseLine do + begin + if Top = Bottom then + begin + R1 := Rect(Left - 10, Top - 10, Left, Top + 10); + R2 := Rect(Right, Top - 10, Right + 10, Top + 10); + end + else + begin + R1 := Rect(Left - 10, Top - 10, Left + 10, Top); + R2 := Rect(Left - 10, Bottom, Left + 10, Bottom + 10); + end + end; +end; + +function TcxTreeListDragAndDropObject.GetDragDropInfoClass: TcxTreeListDragDropInfoClass; +begin + Result := TcxTreeListHeaderDragDropInfo +end; + +procedure TcxTreeListDragAndDropObject.InitDropHeaderInfo; +begin + HitTest.ReCalculate(DragDropInfo.DropPos); + if IsDragBand then + InitDropBandInfo + else + InitDropColumnInfo; + with DragDropInfo do + Accepted := Accepted or CheckCustomizingBox(DropPos); +end; + +procedure TcxTreeListDragAndDropObject.InitDropInfo(const P: TPoint); +begin + if DragDropInfo = nil then + DragDropInfo := GetDragDropInfoClass.Create; + DragDropInfo.DropPos := P; + InitDropHeaderInfo; +end; + +function TcxTreeListDragAndDropObject.IsDragBand: Boolean; +begin + Result := (DragItem is TcxTreeListHeaderViewInfo) and + not (DragItem is TcxTreeListColumnHeaderViewInfo) +end; + +function TcxTreeListDragAndDropObject.IsDragColumn: Boolean; +begin + Result := DragItem is TcxTreeListColumnHeaderViewInfo; +end; + +function TcxTreeListDragAndDropObject.IsValidForDrop(AIndex, ADropIndex: Integer; + PosIsGreater: Boolean): Boolean; +begin + Result := (AIndex <> ADropIndex) and + (AIndex <> (ADropIndex + cxIntOffs[PosIsGreater])) +end; + +procedure TcxTreeListDragAndDropObject.Paint; +begin + DoDrawHeaderItem(TcxTreeListHeaderViewInfo(DragItem)); +end; + +procedure TcxTreeListDragAndDropObject.RestoreArrows; +begin + if ScreenArrows <> nil then + ScreenArrows.Hide; +end; + +procedure TcxTreeListDragAndDropObject.RestorePosition; +begin + if IsDragColumn then + DragColumn.Position.FColIndex := PrevColIndex; +end; + +procedure TcxTreeListDragAndDropObject.StorePosition; +begin + if IsDragColumn then + begin + PrevColIndex := DragColumn.Position.FColIndex; + DragColumn.Position.FColIndex := -2; + end; +end; + +function TcxTreeListDragAndDropObject.CanDropHeaderObject: Boolean; +begin + with HitTest do + Result := HitAtBandHeader or HitAtBandContainer or HitAtColumnHeader +end; + +function TcxTreeListDragAndDropObject.GetDragBand: TcxTreeListBand; +begin + Result := TcxTreeListHeaderViewInfo(DragItem).Band; +end; + +function TcxTreeListDragAndDropObject.GetDragColumn: TcxTreeListColumn; +begin + Result := TcxTreeListColumnHeaderViewInfo(DragItem).Column; +end; + +function TcxTreeListDragAndDropObject.GetDragItem: TObject; +begin + Result := TreeList.Controller.DragItem; +end; + +function TcxTreeListDragAndDropObject.GetHitTest: TcxTreeListHitTest; +begin + Result := TreeList.HitTest; +end; + +function TcxTreeListDragAndDropObject.GetPainter: TcxTreeListControlPainter; +begin + Result := TcxTreeListControlPainter(TreeList.Painter); +end; + +function TcxTreeListDragAndDropObject.GetTreeList: TcxCustomTreeListControl; +begin + Result := TcxCustomTreeListControl(Control); +end; + +procedure TcxTreeListDragAndDropObject.InitDropBandInfo; +var + R: TRect; + ASide: TcxBorder; +begin + with TcxTreeListHeaderDragDropInfo(DragDropInfo) do + begin + Accepted := CanDropHeaderObject; + R := cxInvalidRect; + if Accepted then + begin + DropBand := HitTest.HitBand; + with DropBand, DropBand.ViewInfo.FBandHeader do + begin + if (DropPos.X < 30) and (VisibleIndex = 0) then + ASide := ASide; + if Accepted and (DropBand.FixedKind <> tlbfNone) then + begin + if DropBand.FixedKind = tlbfRight then + DropPos.X := DisplayRect.Left + else + DropPos.X := DisplayRect.Right + end; + if CheckDropPos(DragBand.VisibleIndex, VisibleIndex, DropPos.X, + cxRectCenter(DisplayRect).X, ColIndex, ASide) then + R := GetArrowBaseLine(ClipRect, ASide); + if ASide = bLeft then OffsetRect(R, -1, 0); + end; + end + else + ColIndex := DragBand.VisibleIndex; + ChangeArrowPos(R, not Accepted or (ColIndex = DragBand.VisibleIndex)); + if not Accepted then + begin + with TreeList do + Accepted := PtInRect(ClientBounds, DropPos) and (VisibleBandCount = 0); + if Accepted then + begin + DropBand := TreeList.Bands[0]; + ColIndex := 0; + with TreeList do + ChangeArrowPos(GetArrowBaseLine(CxRectSetHeight(ClientBounds, + RealBandLineHeight), bLeft), not Accepted or (ColIndex = DragBand.VisibleIndex)); + end; + end; + end; +end; + +procedure TcxTreeListDragAndDropObject.InitDropColumnInfo; +var + AInfo: TcxTreeListHeaderDragDropInfo; + ACanDrop: Boolean; + R: TRect; + ADisplayRect, AClipRect: TRect; + + procedure AssignPosition(AColumn: TcxTreeListColumn); + begin + AInfo.RowIndex := AColumn.Position.RowIndex; + AInfo.ColIndex := AColumn.Position.ColIndex; + end; + + procedure GetRects(AViewInfo: TcxTreeListViewInfoItem; var DisplayRect, ClipRect: TRect); + begin + DisplayRect := AViewInfo.DisplayRect; + ClipRect := AViewInfo.ClipRect; + end; + + function CheckDropAtColumn: Boolean; + var + ASide: TcxBorder; + AIndex: Integer; + begin + with HitTest, AInfo do + begin + Result := HitAtColumnHeader and ((DragColumn.OwnerBand = DropBand) or + (not DropBand.IsOnlyOwnColumns and ((DragColumn.OwnerBand = nil) or + not DragColumn.OwnerBand.IsOnlyOwnColumns))); + if not Result then Exit; + AssignPosition(HitColumn); + GetRects(HitColumn.ViewInfo.FColumnHeader, ADisplayRect, AClipRect); + AIndex := -2; + if (DragColumn.OwnerBand = DropBand) and + (DragColumn.Position.RowIndex = RowIndex) then + AIndex := DragColumn.Position.ColIndex; + Result := CheckDropPos(AIndex, ColIndex, DropPos.X, + cxRectCenter(ADisplayRect).X, ColIndex, ASide); + if Result then + R := GetArrowBaseLine(AClipRect, ASide); + end; + end; + + function GetRelativePos(Y: Integer): Integer; + begin + Result := Y; + if TreeList.OptionsView.Bands then + Dec(Result, AInfo.DropBand.ViewInfo.FBandHeader.DisplayRect.Bottom); + end; + + function CheckDropAtContainer: Boolean; + var + I, ARowHeight: Integer; + begin + with HitTest, AInfo do + begin + Result := HitAtBandContainer or ((TreeList.VisibleColumnCount = 0) and HitAtBand); + Result := Result and ((DragColumn.OwnerBand = DropBand) or (not DropBand.IsOnlyOwnColumns and + ((DragColumn.OwnerBand = nil) or not DragColumn.OwnerBand.IsOnlyOwnColumns))); + if not Result then Exit; + IsInsertRow := DropBand.VisibleColumnCount <> 0; + if IsInsertRow and TreeList.OptionsView.HeaderSingleLine or (DropViewInfo = DragItem) then + begin + Result := False; + Exit; + end; + AClipRect := DropBand.FBandViewInfo.ClipRect; + if DropBand.FBandViewInfo.OptionsView.Bands then + AClipRect.Top := DropBand.FBandViewInfo.FBandHeader.DisplayRect.Bottom; + if IsInsertRow then + begin + for I := 0 to DropBand.BandRows.Count - 1 do + begin + ARowHeight := DropBand.BandRows[I].LineCount * TreeList.ViewInfo.HeaderLineHeight; + Inc(AClipRect.Top, ARowHeight); + RowIndex := DropBand.BandRows[I].Index + 1; + if cxInRange(GetRelativePos(DropPos.Y), AClipRect.Top - ARowHeight, AClipRect.Top) then + Break; + end; + R := GetArrowBaseLine(AClipRect, bTop); + end + else + begin + cxRectSetHeightEx(AClipRect, DragColumn.ViewInfo.FColumnHeader.DisplayRect); + R := GetArrowBaseLine(AClipRect, bLeft); + end; + end; + end; + + function CheckEmptyContent(): Boolean; + begin + with TreeList do + begin + Result := (VisibleColumnCount = 0) and (VisibleBandCount > 0) and + PtInRect(ClientBounds, AInfo.DropPos); + if not Result then Exit; + R := cxRectSetHeight(GetArrowBaseLine(ClientBounds, bLeft), ViewInfo.HeaderLineHeight); + AInfo.Accepted := Result; + AInfo.DropBand := TreeList.VisibleBands[0]; + if OptionsView.Bands then + begin + with TreeList.VisibleBands[0].ViewInfo do + R := cxRectSetTop(R, ClientToScreen(FBandHeader.DisplayRect.BottomRight).Y); + end; + end; + end; + +begin + AInfo := TcxTreeListHeaderDragDropInfo(DragDropInfo); + with AInfo, HitTest do + begin + DropBand := HitBand; + Accepted := HitAtBandContainer or HitAtColumnHeader or CheckEmptyContent; + IsInsertRow := False; + AssignPosition(DragColumn); + ACanDrop := True; + ChangeArrowPos(R, not (Accepted and (CheckEmptyContent or + CheckDropAtColumn or CheckDropAtContainer) and ACanDrop)); + end; +end; + +{ TcxTreeListCellNavigator } + +function TcxTreeListCellNavigator.GetCount(ARecordIndex: Integer): Integer; +begin + if IsGroupRow(ARecordIndex) then + Result := 1 + else + Result := TreeList.VisibleColumnCount; +end; + +procedure TcxTreeListCellNavigator.CalcNextRow(AForward: Boolean; + var ARowIndex, ACellIndex: Integer); +var + AColumn: TcxTreeListColumn; + ANewRow: Integer; + ACellFound: Boolean; +begin + ACellFound := False; + if cxInRange(ACellIndex, 0, Count[ARowIndex] - 1) and not IsGroupRow(ARowIndex) then + begin + AColumn := TreeList.VisibleColumns[ACellIndex]; + ACellFound := GoToNextCellInBand(AForward, AColumn, ACellIndex); + if ACellFound then + ACellIndex := AColumn.OwnerBand.VisibleColumns[ACellIndex].VisibleIndex; + end + else + AColumn := nil; + if not ACellFound then + begin + ANewRow := ARowIndex + cxIntOffs[AForward]; + if cxInRange(ANewRow, 0, TreeList.Nodes.VisibleCount - 1) then + begin + ARowIndex := ANewRow; + GoToNextNodeCell(AForward, TreeList.Nodes.GetVisibleNode(ARowIndex), AColumn, ACellIndex); + end + else + if AForward then AppendRecord(ARowIndex, ACellIndex); + end +end; + +procedure TcxTreeListCellNavigator.AppendRecord( + var ARowIndex, ACellIndex: Integer); +begin + if [dceEdit, dceChanging] * DataController.EditState <> [] then + DataController.Post; + if dceInsert in DataController.EditState then + begin + if [dceChanging, dceModified] * DataController.EditState <> [] then + TreeList.DataController.Post + else + Exit; + end; + if TcxTreeListController(Controller).CanInsertNode then + begin + if TreeList.InsertNode(True) and TreeList.UseRowIndexForNewRecord then + ARowIndex := TreeList.Nodes.VisibleCount + 1; + end; +end; + +function TcxTreeListCellNavigator.GetCellContainer( + ARowIndex, ACellIndex: Integer): TcxCustomInplaceEditContainer; +var + AMax: Integer; +begin + if IsGroupRow(ARowIndex) then + AMax := 0 + else + AMax := TreeList.VisibleColumnCount - 1; + if not cxInRange(ACellIndex, 0, AMax) then + Result := nil + else + Result := TreeList.VisibleColumns[ACellIndex]; +end; + +procedure TcxTreeListCellNavigator.Init( + var ARowIndex, ACellIndex, ARowCount: Integer); +var + ANode: TcxTreeListNode; +begin + ARowCount := TreeList.Nodes.VisibleCount; + ANode := TcxTreeListController(Controller).FocusedNode; + if ANode <> nil then + ARowIndex := ANode.FVisibleIndex + else + ARowIndex := 0; + if TreeList.FocusedColumn <> nil then + ACellIndex := TreeList.FocusedColumn.VisibleIndex + else + ACellIndex := 0; +end; + +function TcxTreeListCellNavigator.IsGroupRow(ARowIndex: Integer): Boolean; +var + ANode: TcxTreeListNode; +begin + ANode := TreeList.Nodes.GetVisibleNode(ARowIndex); + Result := (ANode <> nil) and ANode.IsGroupNode; +end; + +function TcxTreeListCellNavigator.SelectCell(AForward, ANextRow: Boolean; + var ARowIndex, ACellIndex: Integer): TcxCustomInplaceEditContainer; +begin + if (FocusedNode <> nil) and FocusedNode.IsGroupNode then + begin + if ANextRow or TreeList.OptionsBehavior.FocusCellOnCycle then + begin + if AForward or ANextRow or (ACellIndex < 0) then + ACellIndex := Min(0, TreeList.VisibleColumnCount - 1) + else + ACellIndex := TreeList.VisibleColumnCount - 1; + if not ANextRow then + Inc(ARowIndex, cxIntOffs[AForward]); + end; + end; + Result := inherited SelectCell(AForward, ANextRow, ARowIndex, ACellIndex); +end; + +procedure TcxTreeListCellNavigator.SetFocusCell( + ARowIndex, ACellIndex: Integer; AShift: TShiftState); +var + ANode: TcxTreeListNode; + AIndex: Integer; +begin + with TreeList do + begin + ANode := Nodes.GetVisibleNode(ARowIndex); + if ANode <> nil then + AIndex := ANode.RecordIndex + else + AIndex := cxInvalidIndex; + if IsGroupRow(ARowIndex) then + Controller.SetFocusedRecordItem(AIndex, TreeList.OptionsView.GetCategorizedColumn) + else + Controller.SetFocusedRecordItem(AIndex, VisibleColumns[ACellIndex]); + end; +end; + +procedure TcxTreeListCellNavigator.KeyDown(var Key: Word; Shift: TShiftState); +var + ANode: TcxTreeListNode; +begin + TcxTreeListController(Controller).IsControllerEvent := True; + try + if TreeList.OptionsSelection.CellSelect and ([ssShift, ssCtrl] * Shift = []) then + inherited KeyDown(Key, Shift) + else + case Key of + VK_LEFT, VK_RIGHT: + begin + if TreeList.ViewInfo.HorzScrollSize <> 0 then + TreeList.ScrollContent(TcxDirection(Byte(Key = VK_RIGHT) + 1)); + Key := 0; + end; + VK_UP, VK_DOWN: + begin + if TreeList.FocusedNode <> nil then + begin + ANode := TreeList.FocusedNode.GetNextVisibleEx(Key = VK_UP); + if ANode <> nil then + TreeList.SetFocusedNode(ANode, Shift); + end; + Key := 0; + end; + end; + finally + TcxTreeListController(Controller).IsControllerEvent := False; + end; +end; + +procedure TcxTreeListCellNavigator.Refresh; +begin + inherited Refresh; +end; + +function TcxTreeListCellNavigator.GetCellIndex( + AColumn: TcxTreeListColumn; ABandRow: TcxTreeListBandRow): Integer; +begin + with AColumn.Position do + Result := ABandRow[cxMin(ColIndex, ABandRow.Count - 1)].VisibleIndexAtBand; +end; + +function TcxTreeListCellNavigator.GetFocusedNode: TcxTreeListNode; +begin + Result := TreeList.FocusedNode; +end; + +function TcxTreeListCellNavigator.GetTreeList: TcxCustomTreeListControl; +begin + Result := TcxCustomTreeListControl(TcxTreeListController(Controller).EditingControl); +end; + +function TcxTreeListCellNavigator.GoToNextCellInBand(AForward: Boolean; + AColumn: TcxTreeListColumn; var ACellIndex: Integer): Boolean; +var + ARow: Integer; +begin + ARow := AColumn.Position.RowIndex; + Inc(ARow, cxIntOffs[AForward]); + Result := False; + with AColumn.OwnerBand do + begin + if BandRows.Count > 1 then + begin + while not Result and cxInRange(ARow, 0, BandRows.Count - 1) do + begin + if BandRows[ARow].Count > 0 then + begin + ACellIndex := GetCellIndex(AColumn, BandRows[ARow]); + Result := True; + end + else + Inc(ARow, cxIntOffs[AForward]); + end; + end + else + ACellIndex := AColumn.VisibleIndex; + end; +end; + +function TcxTreeListCellNavigator.GoToNextNodeCell(AForward: Boolean; + ANode: TcxTreeListNode; AColumn: TcxTreeListColumn; var ACellIndex: Integer): Boolean; +var + ARow: Integer; +begin + Result := (ANode <> nil) and (AColumn <> nil); + if Result then + begin + if ANode.IsGroupNode then + ACellIndex := 0 + else + with AColumn.OwnerBand do + begin + ARow := cxSetValue(AForward, 0, BandRows.Count - 1); + while BandRows[ARow].Count = 0 do + Inc(ARow, cxIntOffs[AForward]); + ACellIndex := AColumn.VisibleIndex; + if ACellIndex = -1 then + ACellIndex := GetCellIndex(AColumn, BandRows[ARow]); + end; + end; +end; + +{ TcxTreeListController } + +procedure TcxTreeListController.AfterPaint; +begin + if (TreeList.DragAndDropState = ddsInProcess) and + (TreeList.Customizing.DragAndDropObject <> nil) then + TreeList.Customizing.DragAndDropObject.OwnerImageChanged + else + inherited AfterPaint; +end; + +procedure TcxTreeListController.BeforePaint; +begin + TreeList.ViewInfo.NodesViewInfo.PostUpdate; + TreeList.ViewInfo.NodesViewInfo.PostViewInfoUpdate; + if (TreeList.DragAndDropState = ddsInProcess) and + (TreeList.Customizing.DragAndDropObject <> nil) then + TreeList.Customizing.DragAndDropObject.OwnerImageChanging + else + inherited BeforePaint; + if PrevTopVisibleIndex <> TreeList.TopVisibleIndex then + begin + PrevTopVisibleIndex := TreeList.TopVisibleIndex; + TreeList.DoOnTopRecordIndexChanged; + end; +end; + +function TcxTreeListController.CheckAutoScrolling( + const APoint: TPoint): Boolean; +var + ASide: TcxBorder; +begin + Result := False; + for ASide := bLeft to bBottom do + Result := Result or ScrollControllers[ASide].Check(APoint); +end; + +procedure TcxTreeListController.CheckHitItemOnMouseDown( + X, Y: Integer; Shift: TShiftState); + + function GetNeededItem: TcxCustomInplaceEditContainer; + begin + with TreeList.HitTest do + if HitAtColumn then + Result := HitColumn + else + Result := FocusedItem + end; + +begin + IsControllerEvent := True; + try + with TreeList.HitTest do + begin + RecalculateOnMouseEvent(X, Y, Shift); + if HitTestItem is TcxTreeListHeaderViewInfo and not CanSizing() and (ssLeft in Shift) then + TcxTreeListHeaderViewInfo(HitTestItem).Pressed := not TreeList.IsDesigning + else + if HitAtButton and (ssLeft in Shift) then + begin + if TreeList.IsCancelOperation then Exit; + RecalculateOnMouseEvent(X, Y, Shift); + HitNode.Expanded := not HitNode.Expanded + end + else + if HitAtNode and not (HitAtButton or HitAtIndent) and not CanDrag(X, Y) then + begin + if not IsItemEditCell then + SetFocusedRecordItem(HitNode.RecordIndex, GetNeededItem); + end; + end; + finally + IsControllerEvent := False; + end; +end; + +procedure TcxTreeListController.CheckEdit; +begin + inherited CheckEdit; + TreeList.RefreshNavigatorButtons; +end; + +procedure TcxTreeListController.BeforeShowEdit; +begin + TreeList.ViewInfo.NodesViewInfo.BeforeShowEdit; +end; + +procedure TcxTreeListController.SetFocusedRecordIndex(Value: Integer); +begin + if not TreeList.SkipFocusedRecordChanged then + inherited SetFocusedRecordIndex(Value); +end; + +procedure TcxTreeListController.BeforeStartDrag; +begin + inherited BeforeStartDrag; + DragNodesList := TreeList.GetSelectionsEx; + if HitTest.HitAtColumn and HitTest.HitAtNode then + begin + DragColumn := HitTest.HitColumn; + DragNode := HitTest.HitNode; + end + else + begin + DragColumn := nil; + DragNode := nil; + end; +end; + +procedure TcxTreeListController.CheckButtonTimer; +var + NeedTimer: Boolean; +begin + if (ExpandingNode <> HitTest.HitNode) or not HitTest.HitAtButton then + ResetButtonTimer; + if ExpandingNode = nil then + begin + NeedTimer := HitTest.HitAtButton and + (OptionsBehavior.DragExpand and not HitTest.HitNode.Expanded) or + (OptionsBehavior.DragCollapse and HitTest.HitNode.Expanded); + if NeedTimer then + begin + ExpandTimer.Interval := OptionsBehavior.WaitForExpandNodeTime; + ExpandTimer.Enabled := True; + ExpandTimer.OnTimer := OnExpandTimer; + ExpandingNode := HitTest.HitNode; + end; + end; +end; + +procedure TcxTreeListController.DragDrop(Source: TObject; X, Y: Integer); +begin + with TreeList, HitTest do + begin + BeginUpdate; + try + if Source is TBaseDragControlObject then + Source := TBaseDragControlObject(Source).Control; + if (Source = TreeList) and HitAtNode then + DropTo(HitNode, HitAtNodePreview or HitAtColumn); + finally + EndUpdate; + end; + end; +end; + +procedure TcxTreeListController.DragEnter; + + function AddAutoScrollRegion(Kind: TScrollBarKind; + const ARect: TRect; ACode: TScrollCode): TcxAutoScrollingObject; + begin + Result := TcxControllerAutoScrollingObject.Create(Self); + Result.SetParams(ARect, Kind, ACode, 1); + end; + +begin + if ExpandTimer <> nil then Exit; + TreeList.FDragNode := TreeList.FocusedNode; + with TreeList.ViewInfo.NodesViewInfo do + begin + ScrollControllers[bTop] := AddAutoScrollRegion(sbVertical, + cxRectSetHeight(ClipRect, cxtlScrollDelta), scLineUp); + ScrollControllers[bBottom] := AddAutoScrollRegion(sbVertical, + cxRectSetTop(ClipRect, ClipRect.Bottom - cxtlScrollDelta), scLineDown); + ScrollControllers[bLeft] := AddAutoScrollRegion(sbHorizontal, + cxRectSetWidth(ClipRect, cxtlScrollDelta), scLineUp); + ScrollControllers[bRight] := AddAutoScrollRegion(sbHorizontal, + cxRectSetWidth(ClipRect, ClipRect.Right - cxtlScrollDelta, cxtlScrollDelta), scLineDown); + end; + ExpandTimer := TTimer.Create(TreeList); +end; + +procedure TcxTreeListController.DragLeave; +var + ASide: TcxBorder; +begin + for ASide := bLeft to bBottom do + FreeAndNil(ScrollControllers[ASide]); + FreeAndNil(ExpandTimer); +end; + +procedure TcxTreeListController.DragMove( + Source: TObject; const P: TPoint; var Accepted: Boolean); + + procedure ProcessDragMove; + begin + HitTest.Recalculate(P); + if HitTest.HitAtButton then + CheckButtonTimer + else + ExpandingNode := nil; + CheckAutoScrolling(P); + end; + +begin + ProcessDragMove; + HitTest.ReCalculate(P); + with TreeList.OptionsBehavior do + begin + if HitTest.HitAtNode and DragFocusing and not HitTest.HitNode.Focused then + HitTest.HitNode.Focused := True; + end; +end; + +procedure TcxTreeListController.DragOver( + Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); +begin + case State of + dsDragEnter: + DragEnter; + dsDragLeave: + DragLeave; + dsDragMove: + DragMove(Source, Point(X, Y), Accept); + end; + inherited DragOver(Source, X, Y, State, Accept); +end; + +procedure TcxTreeListController.DropTo( + ANode: TcxTreeListNode; AsChildren: Boolean); +const + AModes: array[Boolean] of TcxTreeListNodeAttachMode = (tlamInsert, tlamAddChild); +begin + if ANode <> nil then + begin + if TreeList.OptionsBehavior.DragFocusing and + (DragNodesList.IndexOf(TreeList.DragNode) = cxInvalidIndex) then + DragNodesList.Add(TreeList.DragNode); + try + TreeList.SaveDragPos; + TreeList.DoInternalMoveTo(ANode, + AModes[AsChildren], DragNodesList, TreeList.Controller.IsDragCopy); + finally + FreeAndNil(DragNodesList); + TreeList.Controller.CancelSelection; + end; + end; +end; + +procedure TcxTreeListController.EndDrag(Target: TObject; X, Y: Integer); +begin + HitTestController.ReCalculate(Point(X, Y)); + if (GetAsyncKeyState(VK_SHIFT) >= 0) and not IsCtrlPressed then + CancelSelection; + if TreeList.OptionsBehavior.AlwaysShowEditor or TreeList.OptionsBehavior.ImmediateEditor and + ((FocusedItem <> nil) and (FocusedNode <> nil)) then EditingController.ShowEdit(); + FreeAndNil(DragNodesList); +end; + +procedure TcxTreeListController.OnExpandTimer(Sender: TObject); +begin + with HitTest do + begin + ResetButtonTimer; + if HitAtNode and HitAtButton and (HitNode = ExpandingNode) then + ExpandingNode.Expanded := not ExpandingNode.Expanded + else + ExpandingNode := nil; + end; +end; + +procedure TcxTreeListController.ResetButtonTimer; +begin + if ExpandTimer <> nil then + ExpandTimer.Enabled := False; +end; + +procedure TcxTreeListController.DoChangeColumnSortOrder( + AColumn: TcxTreeListColumn; ASortOrder: TcxDataSortOrder; AShift: TShiftState); +begin + AShift := ValidateShift(AShift); + if not TreeList.OptionsBehavior.Sorting or not AColumn.Options.Sorting then Exit; + TreeList.DisableSorting; + try + TreeList.Sorted := ([ssShift, ssCtrl] * AShift <> []) and + TreeList.OptionsBehavior.MultiSort; + if ssCtrl in AShift then + AColumn.SortOrder := soNone + else + if TreeList.OptionsBehavior.Sorting then + AColumn.SortOrder := ASortOrder; + finally + TreeList.EnableSorting; + end; +end; + +procedure TcxTreeListController.DoNextNode(AForward: Boolean); +begin + if (FocusedNode <> nil) and (FocusedNode.GetNextVisibleEx(AForward) <> nil) then + FocusedNode := FocusedNode.GetNextVisibleEx(AForward); +end; + +procedure TcxTreeListController.DoNextPage(AForward: Boolean; Shift: TShiftState); +begin + DoShowNextPageEx(AForward, True, Shift); + TreeList.Controller.CheckEdit; + TreeList.Update; +end; + +procedure TcxTreeListController.DoShowNextPageEx( + AGoForward, ASetCursor: Boolean; AShift: TShiftState); + + function GetNext(ANode: TcxTreeListNode; IsNext: Boolean): TcxTreeListNode; + begin + Result := ANode; + if (ANode <> nil) and (TreeList.VisibleCount = 1) then + Result := ANode.GetNextVisibleEx(not IsNext); + end; + +begin + with TreeList do + begin + if AGoForward then + begin + if LastVisibleNode <> nil then + with LastVisibleNode do + if IsLastVisible and Focused and ASetCursor then Exit; + if ASetCursor then + begin + TopVisibleNode := GetNext(FocusedNode, True); + SetFocusedNode(LastVisibleNode, AShift) + end + else + TopVisibleNode := GetNext(LastVisibleNode, True); + end + else + begin + if TopVisibleNode <> nil then + with TopVisibleNode do + if IsFirstVisible and Focused and ASetCursor then Exit; + if ASetCursor then + begin + LastVisibleNode := GetNext(FocusedNode, False); + SetFocusedNode(TopVisibleNode, AShift) + end + else + LastVisibleNode := GetNext(TopVisibleNode, False); + end; + end; +end; + +procedure TcxTreeListController.FocusedRecordChanged( + APrevFocusedRecordIndex, AFocusedRecordIndex: Integer); +var + APrevFocusedNode, AFocusedNode: TcxTreeListNode; +begin + if not IsInIncSearchChanging and IsIncSearching then + CancelIncSearching; + TreeList.DoFocusedRecordChanged(APrevFocusedRecordIndex, AFocusedRecordIndex); + if TreeList.FNeedFocusedRecordUpdatePost then Exit; + with TcxTreeListCellNavigator(Navigator) do + begin + Refresh; + AFocusedNode := GetNode(AFocusedRecordIndex); + if (AFocusedNode <> nil) and not IsDragMode then + AFocusedNode.MakeVisible; + APrevFocusedNode := GetNode(APrevFocusedRecordIndex); + with TreeList do + begin + if DoIsGroupNode(AFocusedNode) and (VisibleColumnCount > 0) then + FocusedColumn := OptionsView.GetCategorizedColumn; + end; + TreeList.ViewInfo.NodesViewInfo.FocusedRecordChanged(APrevFocusedNode, AFocusedNode); + end; + if(TreeList.DragAndDropState = ddsNone) and not IsControllerEvent or + (CurrentShiftState * [ssCtrl, ssShift, ssLeft, ssRight] = []) then + CancelSelection + else + if (SelectionAnchorNode = nil) and (APrevFocusedNode <> nil) then + SelectionAnchorNode := APrevFocusedNode; + inherited FocusedRecordChanged(APrevFocusedRecordIndex, AFocusedRecordIndex); + AFocusedNode := GetNode(AFocusedRecordIndex); + if AFocusedNode <> nil then AFocusedNode.Repaint(False); +end; + +procedure TcxTreeListController.FocusedItemChanged( + APrevFocusedItem: TcxCustomInplaceEditContainer); +begin + inherited FocusedItemChanged(APrevFocusedItem); + UpdateRecord(DataController.FocusedRecordIndex); + TreeList.DoFocusedItemChanged(APrevFocusedItem, FocusedItem); +end; + +function TcxTreeListController.IsDragMode: Boolean; +begin + with TreeList do + Result := DragAndDropState = ddsInProcess; +end; + +function TcxTreeListController.IsKeyForController( + AKey: Word; AShift: TShiftState): Boolean; +begin + Result := (AKey = VK_ADD) or (AKey = VK_SUBTRACT) or (AKey = VK_MULTIPLY) or + (AKey = VK_HOME) or (AKey = VK_END); + Result := inherited IsKeyForController(AKey, AShift) or + ((IsEditing and (ssCtrl in AShift) and Result) or (not IsEditing and Result)); +end; + +function TcxTreeListController.IsNodeKeyHandle(ANode: TcxTreeListNode; + var AKey: Word; Shift: TShiftState): Boolean; +var + ATop: Integer; +begin + Result := True; + case AKey of + VK_SUBTRACT, VK_ADD: + if (IncSearchText = '') and (ANode <> nil) and ANode.HasChildren then + ANode.Expanded := AKey = VK_ADD + else + Result := False; + VK_MULTIPLY: + if (ANode <> nil) and ANode.HasChildren then + ANode.Expand(AKey = VK_MULTIPLY); + VK_HOME: + with TreeList do + begin + if ssCtrl in Shift then + begin + TreeList.TopVisibleIndex := 0; + TreeList.FocusedNode := TreeList.TopVisibleNode; + end + else + if VisibleColumnCount > 0 then + VisibleColumns[0].Focused := True; + end; + VK_END: + with TreeList do + begin + if ssCtrl in Shift then + begin + TopVisibleIndex := Nodes.VisibleCount - 1; + FocusedNode := LastVisibleNode; + end + else + if VisibleColumnCount > 0 then + VisibleColumns[VisibleColumnCount - 1].Focused := True; + end; + VK_DELETE: + begin + Result := (ssCtrl in Shift) and CanDeleteSelection and DeleteConfirmation; + ATop := TreeList.TopVisibleIndex; + if Result then + try + TreeList.DoDeleteSelection; + TreeList.DataController.Post; + finally + TreeList.TopVisibleIndex := ATop; + if TreeList.FocusedNode <> nil then + TreeList.FocusedNode.MakeVisible; + end; + end; + VK_INSERT: + begin + if (FocusedNode = nil) or (not CanInsertNode) then + Result := False + else + TreeList.InsertNode(ssCtrl in Shift); + end; + else + Result := False + end; +end; + +function TcxTreeListController.CanDrag(X, Y: Integer): Boolean; +begin + with TreeList.HitTest do + begin + HitPoint := Point(X, Y); + Result := not CanSizing and not TreeList.IsDesigning and not IsEditing and + (HitAtNode and HitNode.Selected and not HitAtIndent); + if Result then + TreeList.FDragNode := HitNode; + end; +end; + +procedure TcxTreeListController.BeforeMouseDown( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + + function GetNeededItem: TcxCustomInplaceEditContainer; + begin + with TreeList.HitTest do + if HitAtColumn then + Result := HitColumn + else + Result := FocusedItem + end; + +begin + IsControllerEvent := True; + try + CurrentShiftState := Shift; + if not Focused and (FocusedRecordIndex = cxInvalidIndex) then + begin + if HitTest.HitAtNode then + ForceFocusedRecord := HitTest.HitNode.RecordIndex; + if not HitTest.HitAtButton then + CheckHitItemOnMouseDown(X, Y, Shift); + if (FocusedRecordIndex <> cxInvalidIndex) and (TreeList.VisibleColumnCount > 0) then + TreeList.VisibleColumns[0].Focused := True; + end; + if Focused and OptionsBehavior.ImmediateEditor and HitTest.HitAtNode and + not HitTest.HitAtIndent and not TreeList.IsDesigning then + begin + SetFocusedRecordItem(HitTest.HitNode.RecordIndex, GetNeededItem); + BlockFocusChanged := True; + end; + finally + IsControllerEvent := False; + end; + inherited; +end; + +procedure TcxTreeListController.BeginDragAndDrop; +begin + inherited BeginDragAndDrop; + TreeList.Update; +end; + +procedure TcxTreeListController.DoMouseDown( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + if (TreeList.DragAndDropState <> ddsNone) and HitTest.CanSizing then + begin + EditingController.HideEdit(True); + Exit; + end; + IsControllerEvent := True; + try + inherited DoMouseDown(Button, Shift, X, Y); + BlockFocusChanged := False; + if CanDrag(X, Y) and HitTest.HitAtNode and IsEditing then + TreeList.DragAndDropState := ddsNone; + HitTest.ReCalculate(Point(X, Y)); + if HitAtNodeEx then + begin + if ([ssCtrl, ssShift] * Shift <> []) then + Select(HitTest.HitNode, Shift) + else + if (FocusedNode = nil) or not FocusedNode.Selected then + CancelSelection; + end; + + if TreeList.IsDesigning and (HitTest.HitTestItem is TcxTreeListHeaderViewInfo) and + not HitTest.CanSizing() and (ssLeft in Shift) then + begin + if HitTest.HitAtColumn then + SelectObject(HitTest.HitColumn, Shift) + else + SelectObject(HitTest.HitBand, Shift); + end; + if CanDrag(X, Y) and HitTest.HitAtNode and (HitTest.HitAtImages or + HitTest.HitAtIndicator or (HitTest.HitAtColumn and + not GetImmediateEditor) or HitTest.HitAtBandContainer) then; + finally + ShowEditOnMouseUp := TreeList.OptionsBehavior.ImmediateEditor and HitTest.IsItemEditCell; + IsControllerEvent := False; + end; +end; + +procedure TcxTreeListController.ControlFocusChanged; +var + AColumn: TcxTreeListColumn; + ARecordIndex: Integer; +begin + inherited ControlFocusChanged; + if ForceFocusedRecord >= 0 then Exit; + ARecordIndex := 0; + AColumn := TreeList.FocusedColumn; + with DataController, TreeList do + if (RecordCount > 0) and (FocusedRecordIndex = cxInvalidIndex) and + (VisibleColumnCount > 0) then + begin + if AColumn = nil then + AColumn := VisibleColumns[0]; + if SelectionCount > 0 then + ARecordIndex := Selections[0].RecordIndex; + SetFocusedRecordItem(ARecordIndex, AColumn); + end; +end; + +function TcxTreeListController.CanDeleteSelection: Boolean; +begin + Result := TreeList.OptionsData.Deleting and not TreeList.IsEditing; +end; + +function TcxTreeListController.CanInsertNode: Boolean; +begin + Result := TreeList.OptionsData.Inserting; + if not Result then Exit; + Result := False; + if [dceEdit, dceChanging] * DataController.EditState <> [] then + DataController.Post; + if dceInsert in DataController.EditState then + begin + if [dceChanging, dceModified] * DataController.EditState <> [] then + TreeList.DataController.Post + else + Exit; + end; + Result := ([dceInsert, dceEdit] * DataController.EditState = []); +end; + +procedure TcxTreeListController.DblClick; +var + ADir: TcxDragSizingDirection; +begin + if IsEditing and (FocusedNode <> nil) and FocusedNode.HasChildren then + EditingController.HideEdit(True); + if TreeList.IsCancelOperation then Exit; + EditingController.StopEditShowingTimer; + inherited DblClick; + TreeList.ViewInfo.IsDirty := True; + with HitTest do + begin + HitTest.Recalculate; + if HitAtNode and not HitAtButton and not IsEditing and OptionsBehavior.ExpandOnDblClick then + HitNode.Expanded := not HitNode.Expanded; + if (HitAtBandHeader or HitAtColumnHeader) and CanSizing(ADir) and (ADir = dsdHorz) then + begin + if HitAtBandHeader then + HitBand.ApplyBestFit + else + HitColumn.ApplyBestFit; + end; + end; +end; + +procedure TcxTreeListController.EndDragAndDrop(Accepted: Boolean); +begin + inherited EndDragAndDrop(Accepted); +end; + +function TcxTreeListController.DeleteConfirmation: Boolean; +begin + if TreeList.OptionsBehavior.ConfirmDelete then + Result := cxConfirmMessageBox( + scxStr(@scxTreeListDeletingFocusedConfirmationText), + scxStr(@scxTreeListDeletingConfirmationCaption)) + else + Result := True; +end; + +procedure TcxTreeListController.DoMouseUp( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + inherited; + if [ssShift, ssCtrl] * Shift <> [] then + with TreeList do + begin + if OptionsSelection.MultiSelect and not GetImmediateEditor then + EditingController.StopEditShowingTimer; + end; + if ShowEditOnMouseUp and HitTest.IsItemEditCell then + begin + if not TreeList.IsEditing then + EditingController.ShowEdit(); + ShowEditOnMouseUp := False; + end; +end; + +function TcxTreeListController.GetCursor(X, Y: Integer): TCursor; +begin + if not TreeList.IsDesigning then + begin + if Int64(Point(X, Y)) <> Int64(HitTestController.HitPoint) then + TcxTreeListHitTest(HitTestController).RecalculateOnMouseEvent(X, Y, []); + Result := TcxTreeListHitTest(HitTestController).CurrentCursor; + if Result = crDefault then + Result := inherited GetCursor(X, Y); + end + else + Result := inherited GetCursor(X, Y); +end; + +function TcxTreeListController.GetDragAndDropObjectClass: TcxDragAndDropObjectClass; +begin + DragItem := HitTest.HitTestItem; + if HitTest.CanSizing(ResizeDirection) then + begin + Result := TcxSizingDragAndDropObject; + if HitTest.HitAtNode then + DragItem := HitTest.SizingHitNode; + end + else + if HitTest.CanMoving then + Result := TcxTreeListDragAndDropObject + else + if HitTest.HitAtNode then + Result := nil + else + begin + DragItem := nil; + Result := inherited GetDragAndDropObjectClass; + end +end; + +function TcxTreeListController.GetImmediateEditor: Boolean; +begin + Result := inherited GetImmediateEditor; + if Result and TreeList.OptionsSelection.MultiSelect then + Result := [ssShift, ssCtrl] * CurrentShiftState = []; +end; + +function TcxTreeListController.HitAtNodeEx: Boolean; +begin + with HitTest do + begin + Result := TreeList.IsMultiSelect and HitAtNode and + not (HitAtButton or (HitAtIndent and not HitAtImage)); + end; +end; + +function TcxTreeListController.IsDragCopy: Boolean; +begin + Result := IsCtrlPressed and + TreeList.OptionsBehavior.AutoDragCopy; +end; + +function TcxTreeListController.IsDestroying: Boolean; +begin + Result := TreeList.IsDestroying; +end; + +procedure TcxTreeListController.KeyDown(var Key: Word; + Shift: TShiftState); + + procedure RevertExpanding; + begin + FocusedNode.Expanded := not FocusedNode.Expanded; + Key := 0; + end; + +var + AKey: Word; + APrevNode: TcxTreeListNode; + +begin + IsControllerEvent := True; + CurrentShiftState := Shift; + try + AKey := Key; + EatKeyPress := IsNodeKeyHandle(FocusedNode, Key, Shift); + if (AKey = VK_SPACE) and (FocusedNode <> nil) and + TreeList.IsMultiSelect and ([ssCtrl, ssShift] * Shift <> []) then + begin + if (ssCtrl in Shift) then + begin + FocusedNode.Selected := not FocusedNode.Selected; + if FocusedNode.Selected then + SelectionAnchorNode := FocusedNode; + end + else + Select(FocusedNode, CurrentShiftState); + Key := 0; + end; + if (TreeList.VisibleColumnCount = 1) and (FocusedNode <> nil) and (FocusedNode.HasChildren) then + begin + if ((Key = VK_LEFT) and FocusedNode.Expanded) or + ((Key = VK_RIGHT) and not FocusedNode.Expanded) then RevertExpanding; + end; + inherited KeyDown(Key, Shift); + case AKey of + VK_UP, VK_DOWN, VK_LEFT, VK_RIGHT, VK_NEXT, VK_PRIOR, VK_HOME, VK_END: + begin + if Key in [VK_NEXT, VK_PRIOR, VK_HOME, VK_END] then + begin + APrevNode := SelectionAnchorNode; + Selection.Clear; + if (SelectionAnchorNode <> nil) then + Selection.Add(SelectionAnchorNode); + Select(FocusedNode, CurrentShiftState); + SelectionAnchorNode := APrevNode; + end + else + Select(FocusedNode, CurrentShiftState); + end; + VK_MENU, VK_SHIFT, VK_CONTROL: + SetHotTrackNode(HotTrackNode, CurrentShiftState); + end; + finally + IsControllerEvent := False; + end; +end; + +procedure TcxTreeListController.KeyUp(var Key: Word; Shift: TShiftState); +begin + IsControllerEvent := True; + try + CurrentShiftState := Shift; + inherited KeyUp(Key, Shift); + case Key of + VK_MENU, VK_SHIFT, VK_CONTROL: + SetHotTrackNode(HotTrackNode, CurrentShiftState); + end; + finally + IsControllerEvent := False; + end; +end; + +procedure TcxTreeListController.MakeFocusedItemVisible; +var + AColumn: TcxTreeListColumn; +begin + AColumn := TcxTreeListColumn(FocusedItem); + if AColumn <> nil then + begin + AColumn.MakeVisible; + MakeFocusedRecordVisible; + end; +end; + +procedure TcxTreeListController.MakeFocusedRecordVisible; +begin + TreeList.MakeNodeVisible(FocusedNode); +end; + +procedure TcxTreeListController.MouseDown( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + CurrentShiftState := Shift; + inherited MouseDown(Button, Shift, X, Y); + CheckHitItemOnMouseDown(X, Y, Shift); + SetHotTrackNode(nil, []); +end; + +procedure TcxTreeListController.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + IsControllerEvent := True; + try + CurrentShiftState := Shift; + inherited MouseMove(Shift, X, Y); + UpdateHotTrackNode(X, Y, Shift); + finally + IsControllerEvent := False; + end; +end; + +procedure TcxTreeListController.MouseUp( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + IsControllerEvent := True; + try + inherited MouseUp(Button, Shift, X, Y); + with TreeList do + begin + if HitAtNodeEx and (SelectionCount > 1) and ([ssShift, ssCtrl] * Shift = []) and + (Button = mbLeft) then CancelSelection; + end; + CurrentShiftState := Shift; + with TreeList.HitTest do + if FPressedHeader <> nil then FPressedHeader.Pressed := False; + IsDragDropProcess := False; + finally + IsControllerEvent := False; + end; +end; + +procedure TcxTreeListController.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +var + AScrolled: Boolean; + + function CheckPos(APos, APage, AInc, AMax : Integer): Boolean; + begin + case AScrollCode of + scLineUp: + AScrollPos := APos - AInc; + scLineDown: + AScrollPos := APos + AInc; + scPageUp: + AScrollPos := APos - APage; + scPageDown: + AScrollPos := APos + APage; + scTop: + AScrollPos := 0; + scBottom: + AScrollPos := AMax; + scTrack: + AScrollCode := scPosition; + end; + if AScrollPos < 0 then + AScrollPos := 0 + else + if AScrollPos + APage > AMax then AScrollPos := AMax - APage; + if AScrollCode = scPosition then cxRange(AScrollPos, 0, AMax); + Result := AScrollPos <> APos; + AScrolled := AScrolled or Result; + end; + +begin + if TreeList.IsLocked or (AScrollCode = scEndScroll) then Exit; + with TreeList.ViewInfo do + begin + AScrolled := False; + if (AScrollBarKind = sbHorizontal) and CheckPos(HorzScrollPos, + Max(1, HorzScrollPage - TreeList.GetFixedContentSize), HorzScrollInc, HorzScrollSize - TreeList.GetFixedContentSize) then + begin + TreeList.HScrollBar.Position := AScrollPos; + DoScrollHorizontal(AScrollPos); + end + else + if AScrollBarKind = sbVertical then + begin + begin + if (AScrollCode in [scPageUp, scPageDown]) then + TreeList.Controller.DoShowNextPageEx(AScrollCode = scPageDown, False, []) + else + with TreeList.Nodes do + begin + if CheckPos(TopIndex, NodesViewInfo.VisibleCount, 1, VisibleCount) then + DoScrollVertical(AScrollPos - TopIndex); + end; + end; + AScrollPos := TreeList.Nodes.TopIndex; + end; + end; + inherited Scroll(AScrollBarKind, AScrollCode, AScrollPos); + UpdateHotTrackNode([]); + TreeList.DoChanged; + if AScrolled then + TreeList.Update; +end; + +procedure TcxTreeListController.SetFocusedRecordItem(ARecordIndex: Integer; + AItem: TcxCustomInplaceEditContainer); +begin + if BlockFocusChanged then Exit; + if not TreeList.Dragging and not (ssDouble in CurrentShiftState) then + inherited SetFocusedRecordItem(ARecordIndex, AItem); + HitTestController.ReCalculate; +end; + +procedure TcxTreeListController.SetHotTrackCursor(ACursor: TCursor); +begin + TreeList.Cursor := ACursor; +end; + +procedure TcxTreeListController.SetHotTrackNode( + ANode: TcxTreeListNode; AShift: TShiftState); +var + APrevNode: TcxTreeListNode; + ACursor: TCursor; +begin + if IsDestroying then Exit; + if not Focused or not TreeList.OptionsBehavior.HotTrack then ANode := nil; + if ((ANode = HotTrackNode) and (AShift = PrevHotShift)) or + TreeList.IsDesigning or TreeList.IsDestroying then Exit; + APrevNode := HotTrackNode; + HotTrackNode := ANode; + PrevHotShift := AShift; + if TreeList.OptionsBehavior.HotTrack then + begin + if APrevNode <> nil then + APrevNode.Repaint(True) + else + begin + if TreeList.FUseGlassCursor > 0 then + PrevCursor := TreeList.FStoredCursor + else + PrevCursor := TreeList.Cursor; + end; + if ANode <> nil then + begin + ANode.Repaint(True); + TreeList.DoOnHotTrackNode(ANode, AShift, ACursor); + SetHotTrackCursor(ACursor); + end + else + SetHotTrackCursor(PrevCursor); + end; +end; + +function TcxTreeListController.StartDragAndDrop(const P: TPoint): Boolean; +begin + with TreeList.HitTest do + begin + HitPoint := P; + Result := CanSizing or CanMoving and not (HitAtNode and HitNode.Selected and not HitAtIndent); + end; +end; + +procedure TcxTreeListController.UpdateHotTrackNode(AShift: TShiftState); +begin + with HitTest.HitPoint do + UpdateHotTrackNode(X, Y, AShift); +end; + +procedure TcxTreeListController.UpdateHotTrackNode(X, Y: Integer; AShift: TShiftState); +begin + HitTest.RecalculateOnMouseEvent(X, Y, AShift); + if HitTest.HitAtNode then + SetHottrackNode(HitTest.HitNode, AShift) + else + SetHottrackNode(nil, AShift); +end; + +function TcxTreeListController.GetCellFromViewInfo(AColumn: TcxTreeListColumn; + ANodeViewInfo: TcxTreeListNodeViewInfo): TcxTreeListEditCellViewInfo; + + function IsExtraCell(Condition: Boolean; ACheckedInfo: TcxTreeListEditCellViewInfo; + var AInfo: TcxTreeListEditCellViewInfo): Boolean; + begin + Result := Condition and (ACheckedInfo.Column = AColumn); + if Result then AInfo := ACheckedInfo; + end; + +begin + with ANodeViewInfo, AColumn do + begin + Result := nil; + if Visibility and not IsExtraCell(HasPreview, Preview, Result) and + not IsExtraCell(IsGroupNode, NodeGroupEditViewInfo, Result) then + begin + if VisibleIndexAtBand < Groups[Position.OwnerBandVisibleIndex].CellCount then + Result := Groups[Position.OwnerBandVisibleIndex].Cells[VisibleIndexAtBand] + else + Result := nil; + end; + end; +end; + +function TcxTreeListController.GetCellFromViewInfoEx( + AColumn: TcxTreeListColumn; ANode: TcxTreeListNode): TcxTreeListEditCellViewInfo; +var + AViewInfo: TcxTreeListNodeViewInfo; +begin + if (AColumn <> nil) and (ANode <> nil) and + TreeList.ViewInfo.NodesViewInfo.FindNodeViewInfo(ANode, AViewInfo) then + Result := GetCellFromViewInfo(AColumn, AViewInfo) + else + Result := nil +end; + +function TcxTreeListController.GetFocusedCellViewInfo( + AEditContainer: TcxCustomInplaceEditContainer): TcxEditCellViewInfo; +begin + Result := nil; + if AEditContainer = nil then Exit; + with TcxTreeListColumn(AEditContainer) do + if not Visibility or IsPreview then Exit; + Result := GetCellFromViewInfoEx(TcxTreeListColumn(AEditContainer), FocusedNode); +end; + +function TcxTreeListController.GetNavigatorClass: TcxCustomCellNavigatorClass; +begin + Result := TcxTreeListCellNavigator; +end; + +function TcxTreeListController.GetNode(ARecordIndex: Integer): TcxTreeListNode; +begin + if (ARecordIndex >= 0) and (ARecordIndex < TreeList.NodesList.Count) then + Result := TcxTreeListNode(TreeList.NodesList[ARecordIndex]) + else + Result := nil; +end; + +procedure TcxTreeListController.CancelIncSearching; +begin + if IsDestroying then Exit; + IncSearchText := ''; + inherited CancelIncSearching; + UpdateNodeIncSearchingCell(IncSearchNode); + IncSearchNode := nil; +end; + +function TcxTreeListController.DoSearch(AFromNode: TcxTreeListNode; + AItemIndex: Integer; const AText: string; AGoForward: Boolean): Boolean; + + function DoSearchNode(AForward: Boolean; var ANode: TcxTreeListNode): Boolean; + begin + ANode := AFromNode; + Result := False; + while ANode <> nil do + begin + if DataCompareText(ANode.Texts[AItemIndex], AText, True) then + begin + Result := True; + Break; + end; + ANode := GetNextIncSearchNode(ANode, AForward); + end; + end; + +var + ANode: TcxTreeListNode; + APrevFocusedNode: TcxTreeListNode; +begin + Result := DoSearchNode(AGoForward, ANode); + if not Result then + Result := DoSearchNode(not AGoForward, ANode); + APrevFocusedNode := TreeList.FocusedNode; + IsInIncSearchChanging := True; + if Result then + begin + try + if (ANode <> nil) then + begin + ANode.MakeVisible; + if ANode.IsVisible then + TreeList.FocusedNode := ANode + else + AFromNode.MakeVisible; + end; + finally + IsInIncSearchChanging := False; + end; + IncSearchNode := TreeList.FocusedNode; + UpdateNodeIncSearchingCell(TreeList.FocusedNode); + if APrevFocusedNode <> TreeList.FocusedNode then + UpdateNodeIncSearchingCell(APrevFocusedNode); + end; +end; + +function TcxTreeListController.GetIncSearchingItem: TcxCustomInplaceEditContainer; +begin + Result := TreeList.OptionsBehavior.IncSearchItem; + if Result = nil then + Result := TreeList.FocusedColumn; +end; + +function TcxTreeListController.GetIncSearchingText: string; +begin + Result := IncSearchText; +end; + +function TcxTreeListController.GetIsIncSearching: Boolean; +begin + Result := IncSearchText <> ''; +end; + +function TcxTreeListController.GetNextIncSearchNode( + ANode: TcxTreeListNode; AGoForward: Boolean): TcxTreeListNode; +begin + if ANode = nil then + Result := nil + else + if TreeList.OptionsBehavior.ExpandOnIncSearch then + begin + if AGoForward then + Result := ANode.GetNext + else + Result := ANode.GetPrev + end + else + Result := ANode.GetNextVisibleEx(not AGoForward); +end; + +procedure TcxTreeListController.SearchCheck(AItemFound: Boolean); +begin + if not AItemFound and (IncSearchNode = nil) then + CancelIncSearching + else + if not AItemFound then + IncSearchingText := Copy(IncSearchingText, 1, Length(IncSearchingText) - 1); +end; + +procedure TcxTreeListController.SearchLocate( + AItem: TcxCustomInplaceEditContainer; const Value: string); +var + ANode: TcxTreeListNode; +begin + if TreeList.FocusedNode <> nil then + ANode := TreeList.FocusedNode + else + ANode := TreeList.Nodes.Root.FFirst; + IncSearchText := Value; + if (AItem <> nil) and (ANode <> nil) then + SearchCheck(DoSearch(ANode, AItem.ItemIndex, IncSearchText, True)); +end; + +procedure TcxTreeListController.SearchLocateNext( + AItem: TcxCustomInplaceEditContainer; AForward: Boolean); +var + ANode: TcxTreeListNode; +begin + if (AItem <> nil) and (TreeList.FocusedNode <> nil) then + begin + ANode := GetNextIncSearchNode(TreeList.FocusedNode, AForward); + if ANode = nil then + ANode := TreeList.FocusedNode; + SearchCheck(DoSearch(ANode, AItem.ItemIndex, IncSearchText, AForward)); + end; +end; + +procedure TcxTreeListController.UpdateNodeIncSearchingCell( + ANode: TcxTreeListNode); +var + ANodeViewInfo: TcxTreeListNodeViewInfo; + ACellViewInfo: TcxTreeListEditCellViewInfo; +begin + if ANode <> nil then + begin + if TreeList.ViewInfo.NodesViewInfo.FindNodeViewInfo(ANode, ANodeViewInfo) then + begin + ACellViewInfo := GetCellFromViewInfo(TcxTreeListColumn(ItemForIncSearching), ANodeViewInfo); + if ACellViewInfo <> nil then ACellViewInfo.Invalidate(True); + end; + end; +end; + +procedure TcxTreeListController.SelectionTimerHandler(ASender: TObject); +begin +// for I := 0 to +end; + +function TcxTreeListController.CanCreateSelectionHelper: Boolean; +begin + Result := TreeList.IsDesigning and not TreeList.IsDestroying and not TreeList.IsLoading and + (cxDesignSelectionHelperClass <> nil) and TreeList.HandleAllocated; +end; + +function TcxTreeListController.IsObjectSelected(AObject: TPersistent): Boolean; +var + AHelper: TcxCustomDesignSelectionHelper; +begin + Result := False; + if not CanCreateSelectionHelper then Exit; + AHelper := cxDesignSelectionHelperClass.Create(TreeList); + try + Result := AHelper.IsObjectSelected(AObject); + finally + AHelper.Free; + end; +end; + +procedure TcxTreeListController.SelectObject( + AObject: TPersistent; AShift: TShiftState); +var + AHelper: TcxCustomDesignSelectionHelper; +begin + if not CanCreateSelectionHelper then Exit; + AHelper := cxDesignSelectionHelperClass.Create(TreeList); + try + AHelper.Select(AObject, AShift); + finally + AHelper.Free; + end; +end; + +procedure TcxTreeListController.UnselectObject(AObject: TPersistent); +var + AHelper: TcxCustomDesignSelectionHelper; +begin + if not CanCreateSelectionHelper then Exit; + AHelper := cxDesignSelectionHelperClass.Create(TreeList); + try + AHelper.UnselectObject(AObject); + finally + AHelper.Free; + end; +end; + +procedure TcxTreeListController.CancelSelection(KeepPrimary: Boolean = True); +begin + if TreeList.IsMultiSelect then + begin + TreeList.BeginUpdateSelection; + try + SelectionAnchorNode := nil; + Selection.Clear; + if (FocusedNode <> nil) and KeepPrimary and + (FocusedNode.RecordIndex < DataController.RecordCount) then + FocusedNode.Selected := True + finally + TreeList.EndUpdateSelection; + end; + end; +end; + +procedure TcxTreeListController.Select(ANode: TcxTreeListNode; Shift: TShiftState); + + procedure ValidateSelectionList(AIndex1, AIndex2: Integer); + var + I: Integer; + begin + if AIndex1 > AIndex2 then + ValidateSelectionList(AIndex2, AIndex1) + else + begin + I := 0; + while I < Selection.Count do + begin + if cxInRange(TcxTreeListNode(Selection.List^[I]).VisibleIndex, AIndex1, AIndex2) then + Inc(I) + else + Selection.Delete(I); + end; + end; + end; + + procedure SelectRange(AToNode: TcxTreeListNode; IsAdd: Boolean); + var + AGoToForward: Boolean; + AIndex1, AIndex2: Integer; + AFromNode: TcxTreeListNode; + begin + AFromNode := SelectionAnchor; + AIndex1 := AToNode.VisibleIndex; + AIndex2 := AFromNode.VisibleIndex; + if not IsAdd then + ValidateSelectionList(AIndex1, AIndex2); + AGoToForward := AIndex1 < AIndex2; + TreeList.BeginUpdateSelection; + try + AFromNode.Selected := True; + while AFromNode <> AToNode do + begin + AFromNode := AFromNode.GetNextVisibleEx(AGoToForward); + AFromNode.Selected := True; + end; + finally + TreeList.EndUpdateSelection; + end; + end; + +var + AShift: TShiftState; +begin + if not TreeList.IsMultiSelect then Exit; + if ANode = nil then + begin + TreeList.FocusedNode := nil; + Exit; + end; + if ANode.Selected and not (ssCtrl in Shift) and ((ANode = TreeList.TopVisibleNode) or + (ANode = TreeList.LastVisibleNode) or (TreeList.SelectionCount = 1)) then Exit; + if not ANode.IsVisible then Exit; + TreeList.BeginUpdateSelection; + try + AShift := [ssShift, ssCtrl] * Shift; + if AShift = [] then + CancelSelection + else + begin + if ssShift in AShift then + SelectRange(ANode, ssCtrl in Shift) + else + if (AShift = [ssCtrl]) and (ssLeft in Shift) then + ANode.Selected := not ANode.Selected; + if (ssCtrl in Shift) and ANode.Selected then + SelectionAnchorNode := ANode; + end; + finally + TreeList.EndUpdateSelection; + end; +end; + +function TcxTreeListController.GetResizeDirection: TcxDragSizingDirection; +begin + Result := ResizeDirection; +end; + +procedure TcxTreeListController.MouseLeave; +var + I: Integer; +begin + inherited MouseLeave; + SetHotTrackNode(nil, []); + for I := 0 to TreeList.VisibleColumnCount - 1 do + TreeList.VisibleColumns[I].ViewInfo.ColumnHeader.UpdateState; +end; + +procedure TcxTreeListController.DoCancelMode; +begin + inherited DoCancelMode; + if HitTest.FPressedHeader <> nil then + HitTest.FPressedHeader.Pressed := False; + SetHotTrackNode(nil, []); +end; + +function TcxTreeListController.ValidateShift(Shift: TShiftState): TShiftState; +begin + if IsControllerEvent then + Result := CurrentShiftState + else + Result := Shift; +end; + +procedure TcxTreeListController.UpdateRecord(ARecordIndex: Integer); +var + ANode: TcxTreeListNode; + AViewInfo: TcxTreeListNodeViewInfo; +begin + ANode := GetNode(ARecordIndex); + if (ANode <> nil) and ANode.IsVisible and + TreeList.ViewInfo.NodesViewInfo.FindNodeViewInfo(ANode, AViewInfo) then + AViewInfo.Update(True); +end; + +function TcxTreeListController.GetDataController: TcxControlDataController; +begin + Result := TcxControlDataController(TreeList.DataController); +end; + +function TcxTreeListController.GetFocusedNode: TcxTreeListNode; +begin + Result := GetNode(FocusedRecordIndex); +end; + +function TcxTreeListController.GetHitTest: TcxTreeListHitTest; +begin + Result := TreeList.HitTest; +end; + +function TcxTreeListController.GetIsControllerEvent: Boolean; +begin + Result := IsControllerEventRefCount > 0; +end; + +function TcxTreeListController.GetOptionsBehavior: TcxTreeListOptionsBehavior; +begin + Result := TreeList.OptionsBehavior; +end; + +function TcxTreeListController.GetSelection: TList; +begin + Result := TreeList.FSelection; +end; + +function TcxTreeListController.GetSelectionAnchor: TcxTreeListNode; +begin + Result := SelectionAnchorNode; + if Result = nil then + Result := FocusedNode; + while (Result <> nil) and not Result.IsVisible do + Result := Result.Parent; +end; + +function TcxTreeListController.GetTreeList: TcxCustomTreeListControl; +begin + Result := TcxCustomTreeListControl(EditingControl); +end; + +procedure TcxTreeListController.SetIsControllerEvent(Value: Boolean); +begin + if Value then + Inc(IsControllerEventRefCount) + else + Dec(IsControllerEventRefCount); +end; + +procedure TcxTreeListController.SetFocusedNode(ANode: TcxTreeListNode); +begin + if ANode <> nil then + FocusedRecordIndex := ANode.RecordIndex + else + FocusedRecordIndex := cxInvalidIndex; +end; + +{ TcxTreeListViewInfoItem } + +constructor TcxTreeListViewInfoItem.Create(AOwner: TObject); +begin + inherited Create(AOwner); + FBrush := TBrush.Create; +end; + +destructor TcxTreeListViewInfoItem.Destroy; +begin + FBrush.Free; + inherited Destroy; +end; + +procedure TcxTreeListViewInfoItem.Calculate(const ADisplayRect, AVisibleRect: TRect); +begin + CheckClipping(ADisplayRect, AVisibleRect); + DoCalculate; +end; + +procedure TcxTreeListViewInfoItem.DoHorzOffset(AShift: Integer); +begin + // do nothing +end; + +procedure TcxTreeListViewInfoItem.DoCalculate; +begin + FBrush.Color := ViewParams.Color; +end; + +procedure TcxTreeListViewInfoItem.DoVertOffset(AShift: Integer); +begin + // do nothing +end; + +function TcxTreeListViewInfoItem.ShiftItem( + const AVisibleRect: TRect; DX, DY: Integer): Boolean; +begin + Result := Visible; + CheckClipping(cxRectOffset(DisplayRect, DX, DY), AVisibleRect); + Result := Result = Visible; + if not Result and Visible then + DoCalculate; +end; + +function TcxTreeListViewInfoItem.QueryInterface(const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := cxE_NOINTERFACE; +end; + +function TcxTreeListViewInfoItem._AddRef: Integer; +begin + Result := -1; +end; + +function TcxTreeListViewInfoItem._Release: Integer; +begin + Result := -1; +end; + +function TcxTreeListViewInfoItem.GetBrushManager: TcxBrushCache; +begin + Result := TreeList.BrushCache; +end; + +function TcxTreeListViewInfoItem.GetControlViewInfo: TcxTreeListViewInfo; +begin + Result := TcxCustomTreeListControl(GetControl).ViewInfo; +end; + +function TcxTreeListViewInfoItem.GetHitTest: TcxTreeListHitTest; +begin + Result := TreeList.HitTest; +end; + +function TcxTreeListViewInfoItem.GetOptionsView: TcxTreeListOptionsView; +begin + Result := TreeList.OptionsView; +end; + +function TcxTreeListViewInfoItem.GetPainterClass: TcxCustomLookAndFeelPainterClass; +begin + Result := TreeList.LookAndFeelPainter; +end; + +function TcxTreeListViewInfoItem.GetTreeList: TcxCustomTreeListControl; +begin + Result := TcxCustomTreeListControl(GetControl); +end; + +{ TcxTreeListIndicatorViewInfo } + +procedure TcxTreeListIndicatorViewInfo.Calculate( + const ADisplayRect, AVisibleRect: TRect); +begin + if not OptionsView.Indicator then Exit; + with ADisplayRect, ControlViewInfo do + begin + CheckClipping(cxRect(BorderSize, Top, + BorderSize + OptionsView.IndicatorWidth, Bottom), AVisibleRect); + end; + if Visible then DoCalculate; +end; + +procedure TcxTreeListIndicatorViewInfo.DoCalculate; +begin + ItemViewParams := TcxTreeListViewInfo(ControlViewInfo).IndicatorViewParams; +end; + +procedure TcxTreeListIndicatorViewInfo.DoVertOffset(AShift: Integer); +begin + CheckClipping(cxRectOffset(DisplayRect, 0, AShift), + ControlViewInfo.NodesViewInfo.ClipRect); +end; + +function TcxTreeListIndicatorViewInfo.GetControl: TcxEditingControl; +begin + Result := TcxTreeListViewInfo(Owner).TreeList; +end; + +procedure TcxTreeListIndicatorViewInfo.UpdateKind(AKind: TcxIndicatorKind); +begin + if AKind <> FKind then + begin + FKind := AKind; + Invalidate; + end; +end; + +{ TcxTreeListFooterItemViewInfo } + +procedure TcxTreeListFooterItemViewInfo.DoHorzOffset(DX: Integer); +begin + ShiftItem(BandViewInfo.FooterRect, DX, 0); +end; + +function TcxTreeListFooterItemViewInfo.GetControl: TcxEditingControl; +begin + Result := Column.GetTreeList; +end; + +function TcxTreeListFooterItemViewInfo.GetAlignHorz: TAlignment; +begin + Result := FooterSummary.FAlignHorz; +end; + +function TcxTreeListFooterItemViewInfo.GetAlignVert: TcxAlignmentVert; +begin + Result := FooterSummary.FAlignVert; +end; + +function TcxTreeListFooterItemViewInfo.GetBandViewInfo: TcxTreeListBandViewInfo; +begin + Result := Column.BandViewInfo; +end; + +function TcxTreeListFooterItemViewInfo.GetColumn: TcxTreeListColumnViewInfo; +begin + Result := TcxTreeListColumnViewInfo(Owner); +end; + +function TcxTreeListFooterItemViewInfo.GetFooterSummary: TcxTreeListColumnSummaryFooter; +begin + Result := Column.Column.SummaryFooter; +end; + +function TcxTreeListFooterItemViewInfo.GetMultiLine: Boolean; +begin + Result := FooterSummary.MultiLine; +end; + +function TcxTreeListFooterItemViewInfo.GetText: string; +begin + Result := FooterSummary.SummaryText; +end; + +function TcxTreeListFooterItemViewInfo.GetVisible: Boolean; +begin + Result := inherited Visible and Column.Column.Options.Footer; +end; + +{ TcxTreeListHeaderViewInfo } + +destructor TcxTreeListHeaderViewInfo.Destroy; +begin + if (TreeList <> nil) and (TreeList.HitTest.FPressedHeader = Self) then + TreeList.HitTest.FPressedHeader := nil; + inherited Destroy; +end; + +procedure TcxTreeListHeaderViewInfo.ButtonStateChanged( + APrevIsPressed, IsPressed: Boolean); +begin + if APrevIsPressed and not IsPressed then + TreeList.DoBandHeaderClick(Band); +end; + +function TcxTreeListHeaderViewInfo.CanDropAt(const P: TPoint): Boolean; +begin + HitTest.HitPoint := P; + with HitTest do + Result := HitAtBand and + PtInRect(cxRectInflate(HitBand.ViewInfo.ClipRect, 0, 0, 0, cxtlScrollDelta), P); +end; + +procedure TcxTreeListHeaderViewInfo.DoCalculate; +begin + if not Visible then Exit; + FTextBounds := DisplayRect; + FTextBounds := cxRectInflate(DisplayRect, + -cxHeaderTextOffset, -cxHeaderTextOffset); + with LookAndFeelPainter do + begin + if SortOrder <> soNone then + begin + FSortMarkBounds := FTextBounds; + FSortMarkBounds.Left := FSortMarkBounds.Right - SortingMarkAreaSize.X; + FTextBounds.Right := FSortMarkBounds.Left - cxHeaderTextOffset; + end; + end; + InflateRect(FTextBounds, -1, 0); + DoCalculateGlyphPosition; + FBorders := cxBordersAll; + FState := GetButtonState; + inherited DoCalculate; +end; + +procedure TcxTreeListHeaderViewInfo.DoCalculateGlyphPosition; +var + AWidth, AHeight: Integer; +begin + if Glyph.Empty then Exit; + AWidth := Glyph.Width; + AHeight := Glyph.Height; + case GlyphAlignHorz of + taLeftJustify: + begin + FGlyphPos.X := FTextBounds.Left; + Inc(FTextBounds.Left, AWidth + cxHeaderTextOffset); + end; + taRightJustify: + begin + Dec(FTextBounds.Right, AWidth); + FGlyphPos.X := FTextBounds.Right; + Dec(FTextBounds.Right, cxHeaderTextOffset); + end; + taCenter: + with FTextBounds do + FGlyphPos.X := (Left + Right - AWidth) div 2; + end; + case GlyphAlignVert of + vaTop: + FGlyphPos.Y := FTextBounds.Top; + vaBottom: + FGlyphPos.Y := FTextBounds.Bottom - AHeight; + vaCenter: + with FTextBounds do + FGlyphPos.Y := (Bottom + Top - AHeight) div 2; + end; + with ClipRect do + NeedGlyphClipping := not cxInRange(FGlyphPos.X, Left, Right - AWidth) or + not cxInRange(FGlyphPos.Y, Top, Bottom - AHeight); +end; + +function TcxTreeListHeaderViewInfo.GetDisplayRect: TRect; +begin + Result := DisplayRect; +end; + +procedure TcxTreeListHeaderViewInfo.DoHorzOffset(DX: Integer); +begin + if ShiftItem(BandViewInfo.ClipRect, DX, 0) then + begin + cxOffsetHorz(FSortMarkBounds, DX); + cxOffsetHorz(FTextBounds, DX); + Inc(FGlyphPos.X, DX); + end; +end; + +function TcxTreeListHeaderViewInfo.GetDroppingRect: TRect; +begin + with ControlViewInfo, ClientRect do + Result := Rect(ContentOffset, GetBorderSize, Right, HeaderOffset); + InflateRect(Result, 0, cxtlScrollDelta); +end; + +function TcxTreeListHeaderViewInfo.GetDragSizing: IcxDragSizing; +begin + Supports(TObject(BandViewInfo.Band), IcxDragSizing, Result); +end; + +function TcxTreeListHeaderViewInfo.GetControl: TcxEditingControl; +begin + Result := BandViewInfo.TreeList; +end; + +function TcxTreeListHeaderViewInfo.GetSelected: Boolean; +begin + Result := TreeList.Controller.IsObjectSelected(Band); +end; + +function TcxTreeListHeaderViewInfo.GetSortOrder: TcxDataSortOrder; +begin + Result := soNone; +end; + +procedure TcxTreeListHeaderViewInfo.InitViewParams; +begin + ItemViewParams := TreeList.Styles.GetBandHeaderParams(Band); +end; + +procedure TcxTreeListHeaderViewInfo.UpdateState; +begin + if GetButtonState <> FState then + begin + FState := GetButtonState; + Invalidate; + end; +end; + +function TcxTreeListHeaderViewInfo.GetOrigin: TPoint; +begin + Result := DisplayRect.TopLeft; +end; + +function TcxTreeListHeaderViewInfo.IsNeedHint(ACanvas: TcxCanvas; + const P: TPoint; out AText: TCaption; out AIsMultiLine: Boolean; + out ATextRect: TRect; var IsNeedOffsetHint: Boolean): Boolean; +var + R: TRect; + AFlags: Integer; +begin + if FCallHintNeeded >= 1 then + begin + Result := False; + Exit; + end; + Inc(FCallHintNeeded); + AText := Text; + try + AFlags := cxAlignTop or cxAlignLeft or cxDontPrint; + if AIsMultiLine then + AFlags := AFlags or cxWordBreak; + ACanvas.Font := ViewParams.Font; + R := TextBounds; + ACanvas.TextExtent(Text, R, AFlags); + AIsMultiLine := MultiLine; + Result := not HitTest.CanSizing and PtInRect(TextBounds, P) and + (cxRectWidth(R) > cxRectWidth(TextBounds)) or + (cxRectHeight(R) > cxRectHeight(TextBounds)); + finally + Dec(FCallHintNeeded); + AText := Text; + ATextRect := R; + IsNeedOffsetHint := False; + end; +end; + +procedure TcxTreeListHeaderViewInfo.UpdateHotTrackState(const APoint: TPoint); +begin +end; + +procedure TcxTreeListHeaderViewInfo.CustomDrawEvent( + var AEvent: TcxCustomDrawViewInfoItemEvent); +begin + AEvent := TcxCustomDrawViewInfoItemEvent(TreeList.FOnCustomDrawBandHeader); +end; + +function TcxTreeListHeaderViewInfo.GetAlignHorz: TAlignment; +begin + Result := Caption.FAlignHorz; +end; + +function TcxTreeListHeaderViewInfo.GetAlignVert: TcxAlignmentVert; +begin + Result := Caption.FAlignVert; +end; + +function TcxTreeListHeaderViewInfo.GetBand: TcxTreeListBand; +begin + Result := BandViewInfo.Band; +end; + +function TcxTreeListHeaderViewInfo.GetBandViewInfo: TcxTreeListBandViewInfo; +begin + Result := TcxTreeListBandViewInfo(Owner); +end; + +function TcxTreeListHeaderViewInfo.GetCaption: TcxTreeListCaption; +begin + Result := BandViewInfo.Band.Caption; +end; + +function TcxTreeListHeaderViewInfo.GetButtonState: TcxButtonState; +begin + Result := cxbsDefault; + with TreeList do + begin + if Pressed then + Result := cxbsPressed + else + if GetHotTrack then Result := cxbsHot; + end; +end; + +function TcxTreeListHeaderViewInfo.GetGlyph: TBitmap; +begin + Result := Caption.Glyph; +end; + +function TcxTreeListHeaderViewInfo.GetGlyphAlignHorz: TAlignment; +begin + Result := Caption.GlyphAlignHorz; +end; + +function TcxTreeListHeaderViewInfo.GetGlyphAlignVert: TcxAlignmentVert; +begin + Result := Caption.GlyphAlignVert; +end; + +function TcxTreeListHeaderViewInfo.GetHotTrack: Boolean; +begin + Result := LookandFeelPainter.IsHeaderHotTrack and + (TreeList.DragAndDropState <> ddsInProcess) and + (TreeList.HitTest.HitTestItem = Self); + if Result then + begin + TreeList.HitTest.HitPoint := TreeList.ScreenToClient(GetMouseCursorPos); + Result := TreeList.HitTest.HitTestItem = Self; + end; +end; + +function TcxTreeListHeaderViewInfo.GetState(Index: Integer): Boolean; +begin + Result := Caption.GetState(Index); +end; + +function TcxTreeListHeaderViewInfo.GetText: string; +begin + Result := Caption.Text; +end; + +procedure TcxTreeListHeaderViewInfo.SetPressed(Value: Boolean); +begin + if (Self = nil) or (TreeList = nil) or + (TreeList.HitTest = nil) or (Value = FPressed) then Exit; + with TreeList.HitTest do + begin + FPressed := Value; + if FPressed and (FPressedHeader <> Self) then + begin + if FPressedHeader <> nil then FPressedHeader.Pressed := False; + FPressedHeader := Self; + end; + end; + ButtonStateChanged(not FPressed, Value); + UpdateState; +end; + +{ TcxTreeListColumnHeaderViewInfo } + +procedure TcxTreeListColumnHeaderViewInfo.ButtonStateChanged( + APrevIsPressed, IsPressed: Boolean); +const + ASortOrders: array[TcxDataSortOrder] of TcxDataSortOrder = + (soAscending, soDescending, soAscending); +begin + with TreeList.Controller do + begin + if APrevIsPressed and not IsPressed and not IsDragDropProcess and not IsDblClick then + DoChangeColumnSortOrder(Column, ASortOrders[Column.SortOrder], []); + if APrevIsPressed and not IsPressed and not IsDragDropProcess then + TreeList.DoColumnHeaderClick(Column); + end; +end; + +function TcxTreeListColumnHeaderViewInfo.CanDropAt(const P: TPoint): Boolean; +begin + Result := True; +end; + +procedure TcxTreeListColumnHeaderViewInfo.DoCalculate; +begin + inherited DoCalculate; + FIsUltraFlat := not OptionsView.IsExtPaintStyle and + (LookAndFeelPainterClass.HeaderBorders([nLeft, nRight]) <> cxBordersAll); + with Column do + begin + if not IsLeft then FNeighbors := [nLeft]; + if not IsRight then FNeighbors := [nRight]; + with GetDisplayRect do + begin + if (ClipRect.Left = DisplayRect.Left) and (DisplayRect.Left <> Left) then + ClipRect.Left := Left; + end; + end; +end; + +function TcxTreeListColumnHeaderViewInfo.GetControl: TcxEditingControl; +begin + Result := Column.TreeList; +end; + +function TcxTreeListColumnHeaderViewInfo.GetDisplayRect: TRect; +begin + Result := inherited GetDisplayRect; + if FIsUltraFlat and not Column.IsLeft then Dec(Result.Left); +end; + +function TcxTreeListColumnHeaderViewInfo.GetDragSizing: IcxDragSizing; +begin + Supports(TObject(Column), IcxDragSizing, Result); +end; + +function TcxTreeListColumnHeaderViewInfo.GetDroppingRect: TRect; +begin + with ControlViewInfo, ClientRect do + Result := Rect(ContentOffset, HeaderOffset, Right, CellsOffset); + InflateRect(Result, 0, cxtlScrollDelta); +end; + +function TcxTreeListColumnHeaderViewInfo.GetSortOrder: TcxDataSortOrder; +begin + Result := Column.GetRealSortOrder; +end; + +procedure TcxTreeListColumnHeaderViewInfo.InitViewParams; +begin + ItemViewParams := TreeList.Styles.GetColumnHeaderParams(Column) +end; + +function TcxTreeListColumnHeaderViewInfo.GetSelected: Boolean; +begin + Result := TreeList.Controller.IsObjectSelected(Column); +end; + +procedure TcxTreeListColumnHeaderViewInfo.CustomDrawEvent( + var AEvent: TcxCustomDrawViewInfoItemEvent); +begin + AEvent := TcxCustomDrawViewInfoItemEvent(TreeList.FOnCustomDrawHeaderCell); +end; + +function TcxTreeListColumnHeaderViewInfo.GetBandViewInfo: TcxTreeListBandViewInfo; +begin + if not Column.Visible then + Result := nil + else + Result := TcxTreeListColumnViewInfo(Owner).BandViewInfo +end; + +function TcxTreeListColumnHeaderViewInfo.GetCaption: TcxTreeListCaption; +begin + Result := Column.Caption; +end; + +function TcxTreeListColumnHeaderViewInfo.GetColumn: TcxTreeListColumn; +begin + Result := TcxTreeListColumnViewInfo(Owner).Column; +end; + +{ TcxTreeListColumnHeaderViewInfo } + +constructor TcxTreeListColumnViewInfo.Create(AOwner: TcxTreeListColumn); +begin + FColumn := AOwner; + FColumnHeader := TcxTreeListColumnHeaderViewInfo.Create(Self); + FColumnFooter := TcxTreeListFooterItemViewInfo.Create(Self); +end; + +destructor TcxTreeListColumnViewInfo.Destroy; +begin + FreeAndNil(FColumnFooter); + FreeAndNil(FColumnHeader); + inherited Destroy; +end; + +function TcxTreeListColumnViewInfo.CalcHeaderRect: TRect; +begin + with TreeList, ViewInfo, Result do + begin + Result.TopLeft := Point(XOfs, HeaderOffset + YOfs * HeaderLineHeight); + with Column.Position do + Result := cxRectSetSize(Result, DisplayWidth, LineCount * HeaderLineHeight); + end; +end; + +function TcxTreeListColumnViewInfo.CalcFooterRect: TRect; + + function GetWidth: Integer; + begin + with Column, TreeList.LookAndFeelPainter do + Result := DisplayWidth - Byte(IsLeftMost or IsRightMost) * FooterBorderSize; + end; + +begin + with TreeList, ViewInfo, LookAndFeelPainter, Result do + begin + TopLeft := Point(XOfs + Byte(Column.IsLeftMost) * FooterBorderSize, FooterCellsOffset); + Right := Left + GetWidth; + Bottom := Top + Column.Position.LineCount * FooterLineHeight; + InflateRect(Result, -FooterCellOffset, -FooterCellOffset); + end; +end; + +procedure TcxTreeListColumnViewInfo.DoCalculate; +begin + if OptionsView.Headers then + FColumnHeader.Calculate(CalcHeaderRect, BandViewInfo.ClipRect); + if OptionsView.Footer then + FColumnFooter.Calculate(CalcFooterRect, BandViewInfo.FooterRect); +end; + +procedure TcxTreeListColumnViewInfo.DoHorzOffset(DX: Integer); +begin + if OptionsView.Headers then + FColumnHeader.DoHorzOffset(DX); + if OptionsView.Footer and (TreeList.VisibleColumnCount > 0) then + FColumnFooter.DoHorzOffset(DX); + Inc(XOfs, DX); +end; + +function TcxTreeListColumnViewInfo.GetBandViewInfo: TcxTreeListBandViewInfo; +begin + Result := Column.OwnerBand.ViewInfo; +end; + +function TcxTreeListColumnViewInfo.GetDisplayWidth: Integer; +begin + Result := Column.DisplayWidth; +end; + +function TcxTreeListColumnViewInfo.GetFooterCellsOffset: Integer; +begin + with TreeList, ViewInfo, LookAndFeelPainter do + Result := FooterOffset + FooterBorderSize + YOfs * FooterLineHeight; +end; + +function TcxTreeListColumnViewInfo.GetLineCount: Integer; +begin + Result := Column.Position.LineCount; +end; + +function TcxTreeListColumnViewInfo.GetOptionsView: TcxTreeListOptionsView; +begin + Result := TreeList.OptionsView; +end; + +function TcxTreeListColumnViewInfo.GetTreeList: TcxCustomTreeListControl; +begin + Result := FColumn.TreeList; +end; + +{ TcxTreeListBandViewInfo } + +constructor TcxTreeListBandViewInfo.Create(AOwner: TObject); +begin + inherited Create(AOwner); + FBandHeader := TcxTreeListHeaderViewInfo.Create(Self); + FooterBrush := TBrush.Create; + ContainerBrush := TBrush.Create; +end; + +destructor TcxTreeListBandViewInfo.Destroy; +begin + FreeAndNil(FBandHeader); + FreeMem(FColumns); + FooterBrush.Free; + ContainerBrush.Free; + inherited Destroy; +end; + +procedure TcxTreeListBandViewInfo.CalcFooterRect; +begin + FFooterRect := ControlViewInfo.FooterRect; + FFooterRect.Left := ClipRect.Left; + FFooterRect.Right := ClipRect.Right; +end; + +procedure TcxTreeListBandViewInfo.CheckOpaque; +var + I, ALines: Integer; + + function CheckRow(ARow: TcxTreeListBandRow): Integer; + var + J: Integer; + begin + Result := MaxInt div 20; + for J := 0 to ARow.Count - 1 do + Result := cxMin(Result, ARow[J].Position.LineCount); + end; + +begin + with Band.BandRows do + begin + ALines := 0; + IsOpaque := ColumnCount > 0; + if IsOpaque then + for I := 0 to Count - 1 do Inc(ALines, CheckRow(Items[I])); + end; + IsOpaque := IsOpaque and (ALines = TreeList.HeaderLineCount); +end; + +procedure TcxTreeListBandViewInfo.DoCalculate; +var + R: TRect; +begin + if Self = nil then Exit; + ContainerBrush.Color := ContainerViewParams.Color; + FFooterViewParams := TreeList.Styles.GetBandFooterParams(Band); + FooterBrush.Color := FFooterViewParams.Color; + if OptionsView.Bands then + begin + BandHeader.ItemViewParams := ItemViewParams; + R := DisplayRect; + R.Bottom := ControlViewInfo.HeaderOffset; + BandHeader.Calculate(R, ClipRect); + end; + CalcFooterRect; + DoCalculateColumns; +end; + +procedure TcxTreeListBandViewInfo.DoCalculateColumns; +var + I, J, AOfs: Integer; + + procedure AddColumnViewInfo(AViewInfo: TcxTreeListColumnViewInfo; YOfs: Integer); + begin + AViewInfo.XOfs := AOfs; + AViewInfo.YOfs := YOfs; + FColumns[FCount] := AViewInfo; + Inc(FCount); + Inc(AOfs, AViewInfo.DisplayWidth); + AViewInfo.DoCalculate; + end; + +begin + SetCapacity(Band.FColumns.Count); + FCount := 0; + for I := 0 to Band.BandRows.Count - 1 do + begin + with Band.BandRows[I] do + begin + AOfs := DisplayRect.Left; + for J := 0 to Count - 1 do + AddColumnViewInfo(Items[J].ViewInfo, LineOffset); + end; + end; + IsOpaque := False; + CheckOpaque; +end; + +procedure TcxTreeListBandViewInfo.DoHorzOffset(DX: Integer); +var + I: Integer; +begin + if ShiftItem(ControlViewInfo.ScrollingArea, DX, 0) then + begin + CalcFooterRect; + if OptionsView.Bands then + BandHeader.DoHorzOffset(DX); + for I := 0 to ColumnCount - 1 do + Columns[I].DoHorzOffset(DX); + end; +end; + +function TcxTreeListBandViewInfo.GetControl: TcxEditingControl; +begin + Result := Band.GetTreeList; +end; + +procedure TcxTreeListBandViewInfo.SetCapacity(ACapacity: Integer); +begin + if ACapacity > FCapacity then + begin + FCapacity := ACapacity; + ReallocMem(FColumns, FCapacity * SizeOf(Pointer)); + end; + FCount := 0; +end; + +function TcxTreeListBandViewInfo.GetBand: TcxTreeListBand; +begin + Result := TcxTreeListBand(Owner); +end; + +function TcxTreeListBandViewInfo.GetColumn(AIndex: Integer): TcxTreeListColumnViewInfo; +begin + Result := TcxTreeListColumnViewInfo(FColumns^[AIndex]); +end; + +function TcxTreeListBandViewInfo.GetDisplayWidth: Integer; +begin + Result := Band.DisplayWidth; +end; + +function TcxTreeListBandViewInfo.GetFixed: TcxTreeListBandFixedKind; +begin + Result := Band.FixedKind; +end; + +{ TcxTreeListEditCellViewInfo } + +procedure TcxTreeListEditCellViewInfo.Assign(Source: TcxCustomViewInfoItem); +begin + if Source is TcxTreeListEditCellViewInfo then + begin + GroupIndex := TcxTreeListEditCellViewInfo(Source).GroupIndex; + FColumnViewInfo := TcxTreeListEditCellViewInfo(Source).FColumnViewInfo; + end; + inherited Assign(Source); +end; + +function TcxTreeListEditCellViewInfo.ContentOffset: TRect; +begin + Result := cxTreeListEditCellContentOffset; +end; + +function TcxTreeListEditCellViewInfo.ChangedHeight( + APrevHeight, ANewHeight: Integer): Boolean; +begin + Result := inherited ChangedHeight(APrevHeight, ANewHeight); + with NodeViewInfo do + begin + if Result and (APrevHeight = CellsMaxHeight) then + Dec(CellMaxHeightRefCount); + Result := Result or (ANewHeight > CellsMaxHeight) or (CellMaxHeightRefCount = 0); + end; +end; + +procedure TcxTreeListEditCellViewInfo.CustomDrawEvent( + var AEvent: TcxCustomDrawViewInfoItemEvent); +begin + AEvent := TcxCustomDrawViewInfoItemEvent(TreeList.FOnCustomDrawCell); +end; + +procedure TcxTreeListEditCellViewInfo.DoHorzOffset(AShift: Integer); +begin + ShiftItem(AShift, 0); +end; + +procedure TcxTreeListEditCellViewInfo.DoVertOffset(AShift: Integer); +begin + ShiftItem(0, AShift); +end; + +function TcxTreeListEditCellViewInfo.GetColumn: TcxTreeListColumn; +begin + if FColumnViewInfo = nil then + Result := nil + else + Result := FColumnViewInfo.FColumn; +end; + +function TcxTreeListEditCellViewInfo.GetButtonTransparency: TcxEditButtonTransparency; +var + B1: TcxEditingControlEditShowButtons; + B2: TcxEditItemShowEditButtons; + AFocused: Boolean; +begin + AFocused := Node = TreeList.FocusedNode; + B1 := TreeList.OptionsView.ShowEditButtons; + B2 := Column.Options.ShowEditButtons; + if (B2 = eisbAlways) or (B2 = eisbDefault) and + ((B1 = ecsbAlways) or (B1 = ecsbFocused) and AFocused) then + Result := ebtNone + else + Result := ebtHideInactive; +end; + +function TcxTreeListEditCellViewInfo.GetDisplayValue: Variant; +begin + Result := Column.DoOnGetDisplayText(Node, False, True); +end; + +function TcxTreeListEditCellViewInfo.GetEditContainer: TcxCustomInplaceEditContainer; +begin + if TreeList.IsDestroying then + Result := nil + else + Result := Column; +end; + +function TcxTreeListEditCellViewInfo.GetEditViewParams: TcxViewParams; +begin + GetTreeListEditCellParams(Result); + if Selected then + with ControlViewInfo.SelectionParams do + begin + Result.TextColor := TextColor; + if TreeList.Styles.SelectionFontAssigned then + Result.Font := Font; + Result.Color := Color; + end; +end; + +function TcxTreeListEditCellViewInfo.GetFocused: Boolean; +begin + Result := NodeViewInfo.Selected; +end; + +function TcxTreeListEditCellViewInfo.GetHotTrack: Boolean; +begin + Result := Node.HotTrack; +end; + +function TcxTreeListEditCellViewInfo.GetLineCount: Integer; +begin + Result := FColumnViewInfo.LineCount; +end; + +function TcxTreeListEditCellViewInfo.GetLineOffset: Integer; +begin + Result := FColumnViewInfo.YOfs; +end; + +function TcxTreeListEditCellViewInfo.GetRecordIndex: Integer; +begin + Result := Node.RecordIndex; +end; + +function TcxTreeListEditCellViewInfo.GetSelected: Boolean; +begin + Result := Focused; + with TreeList, OptionsSelection do + begin + if NodeViewInfo.Focused then + begin + if Result and CellSelect then + begin + Result := Result and ((InvertSelect and not Column.Focused) or + (not InvertSelect and Column.Focused and not Column.Editing)); + if not InvertSelect and Result then + NodeViewInfo.NodeFocusedCell := Self; + if Result and (HideSelection and not IsFocused) then + Result := False; + end + else + Result := Result and InvertSelect; + if HideSelection and not IsFocused then + Result := False; + end; + end; +end; + +function TcxTreeListEditCellViewInfo.GetSelectedTextColor: Integer; +begin + Result := IncSearchParams.TextColor; +end; + +function TcxTreeListEditCellViewInfo.GetSelectedBKColor: Integer; +begin + Result := IncSearchParams.Color +end; + +procedure TcxTreeListEditCellViewInfo.GetTreeListEditCellParams( + var AParams: TcxViewParams); +begin + TreeList.Styles.DoGetContentParams(Node, Column, AParams); +end; + +function TcxTreeListEditCellViewInfo.GetViewInfoData: Pointer; +begin + Result := Node; +end; + +function TcxTreeListEditCellViewInfo.IncSearchParams: TcxViewParams; +begin + Result := TreeList.Styles.GetIncSearchParams; + if Result.Color = clDefault then + Result.Color := inherited GetSelectedBKColor; + if Result.TextColor = clDefault then + Result.TextColor := inherited GetSelectedTextColor; +end; + +function TcxTreeListEditCellViewInfo.IsAutoHeight: Boolean; +begin + Result := NodeViewInfo.Owner.IsRowAutoHeight; +end; + +function TcxTreeListEditCellViewInfo.IsEndEllipsis: Boolean; +begin + Result := inherited IsEndEllipsis and Column.Options.CellEndEllipsis; +end; + +function TcxTreeListEditCellViewInfo.IsTransparent: Boolean; +begin + Result := inherited IsTransparent and not Selected; +end; + +procedure TcxTreeListEditCellViewInfo.SetPosition( + ATop, AHeight: Integer; const AClipRect: TRect); +begin + if not IsAutoHeight then + begin + AHeight := cxRectHeight(DisplayRect); + ATop := ATop - NodeViewInfo.Top + DisplayRect.Top; + end; + cxRectSetTopEx(DisplayRect, ATop, AHeight); + CheckClipping(DisplayRect, AClipRect); +end; + +procedure TcxTreeListEditCellViewInfo.ShiftItem(DX, DY: Integer); +begin + CheckClipping(cxRectOffset(DisplayRect, DX, DY), Group.ClipRect); + UpdateViewInfoPosition; +end; + +procedure TcxTreeListEditCellViewInfo.UpdateViewInfoPosition; +begin + if ViewInfo <> nil then + begin + ViewInfo.Top := DisplayRect.Top + Byte(bTop in Borders); + ViewInfo.Left := DisplayRect.Left + Byte(bLeft in Borders); + end; +end; + +function TcxTreeListEditCellViewInfo.GetBand: TcxTreeListBand; +begin + Result := Column.OwnerBand; +end; + +function TcxTreeListEditCellViewInfo.GetControlViewInfo: TcxTreeListViewInfo; +begin + Result := TreeList.ViewInfo; +end; + +function TcxTreeListEditCellViewInfo.GetEditRect: TRect; +begin + Result := CellEditRect; +end; + +function TcxTreeListEditCellViewInfo.GetGroup: TcxTreeListCellsGroupViewInfo; +begin + Result := NodeViewInfo.Groups[GroupIndex] +end; + +function TcxTreeListEditCellViewInfo.GetNode: TcxTreeListNode; +begin + Result := NodeViewInfo.Node; +end; + +function TcxTreeListEditCellViewInfo.GetNodesViewInfo: TcxTreeListNodesViewInfo; +begin + Result := NodeViewInfo.Owner; +end; + +function TcxTreeListEditCellViewInfo.GetNodeViewInfo: TcxTreeListNodeViewInfo; +begin + Result := TcxTreeListNodeViewInfo(Owner); +end; + +function TcxTreeListEditCellViewInfo.GetTreeList: TcxCustomTreeListControl; +begin + Result := NodeViewInfo.TreeList; +end; + +{ TcxTreeListCellsGroupViewInfo } + +procedure TcxTreeListCellsGroupViewInfo.Assign(Source: TcxCustomViewInfoItem); +begin + if Source is TcxTreeListViewInfoItem then + begin + BandViewInfo := TcxTreeListCellsGroupViewInfo(Source).BandViewInfo; + Borders := TcxTreeListCellsGroupViewInfo(Source).Borders; + Indent := TcxTreeListCellsGroupViewInfo(Source).Indent; + FirstIndex := TcxTreeListCellsGroupViewInfo(Source).FirstIndex; + LastIndex := TcxTreeListCellsGroupViewInfo(Source).LastIndex; + IsOpaque := TcxTreeListCellsGroupViewInfo(Source).IsOpaque; + end; + inherited Assign(Source); +end; + +procedure TcxTreeListCellsGroupViewInfo.DoCalculate; +begin + if not IsOpaque then inherited DoCalculate; +end; + +procedure TcxTreeListCellsGroupViewInfo.DoCalculateCellsLayout; +var + I: Integer; +begin + for I := 0 to CellCount - 1 do + CalculateEditCellRect(Cells[I], BandViewInfo.DisplayRect.Left); +end; + +procedure TcxTreeListCellsGroupViewInfo.DoHorzOffset(AShift: Integer); +begin + ShiftGroup(AShift, 0); +end; + +procedure TcxTreeListCellsGroupViewInfo.DoVertOffset(AShift: Integer); +begin + ShiftGroup(0, AShift); +end; + +function TcxTreeListCellsGroupViewInfo.GetControl: TcxEditingControl; +begin + Result := NodeViewInfo.TreeList; +end; + +function TcxTreeListCellsGroupViewInfo.GetHotTrack: Boolean; +begin + Result := NodeViewInfo.Node.HotTrack; +end; + +function TcxTreeListCellsGroupViewInfo.GetSelected: Boolean; +begin + with TreeList, OptionsSelection do + begin + Result := NodeViewInfo.Selected and InvertSelect and + ((HideSelection and Focused) or not HideSelection); + end; +end; + +function TcxTreeListCellsGroupViewInfo.GetGroupBitmap: TBitmap; +begin + if Selected then + Result := nil + else + Result := ViewParams.Bitmap; +end; + +procedure TcxTreeListCellsGroupViewInfo.SetSize(ATop, AHeight: Integer); +var + I: Integer; +begin + CheckClipping(cxRectSetTop(DisplayRect, ATop, AHeight), + NodeViewInfo.NodeClipRect); + with TcxTreeListNodeViewInfo(Owner), FCells do + begin + for I := FirstIndex to LastIndex - 1 do + TcxTreeListEditCellViewInfo(List^[I]).SetPosition( + NodeCellsOffset, CellsMaxHeight, ClipRect); + end; +end; + +procedure TcxTreeListCellsGroupViewInfo.ShiftGroup(DX, DY: Integer); +var + I: Integer; +begin + CheckClipping(cxRectOffset(DisplayRect, DX, DY), NodeViewInfo.GetVisibleRect(Fixed)); + for I := 0 to CellCount - 1 do + Cells[I].ShiftItem(DX, DY); +end; + +function TcxTreeListCellsGroupViewInfo.GetBand: TcxTreeListBand; +begin + Result := BandViewInfo.Band; +end; + +function TcxTreeListCellsGroupViewInfo.GetCell(Index: Integer): TcxTreeListEditCellViewInfo; +begin + Result := + TcxTreeListEditCellViewInfo(TcxTreeListNodeViewInfo(Owner).FCells.List^[FirstIndex + Index]); +end; + +function TcxTreeListCellsGroupViewInfo.GetCellsHeight: Integer; +begin + Result := ControlViewInfo.DefaultHeight; +end; + +function TcxTreeListCellsGroupViewInfo.GetCount: Integer; +begin + Result := LastIndex - FirstIndex; +end; + +function TcxTreeListCellsGroupViewInfo.GetCurrentBrush: TBrush; +begin + with TreeList.OptionsSelection do + begin + if Selected then + Result := ControlViewInfo.SelectionBrush + else + Result := Brush; + end; +end; + +function TcxTreeListCellsGroupViewInfo.GetFixed: Boolean; +begin + Result := Band.FixedKind <> tlbfNone; +end; + +function TcxTreeListCellsGroupViewInfo.GetNodeViewInfo: TcxTreeListNodeViewInfo; +begin + Result := TcxTreeListNodeViewInfo(Owner); +end; + +function TcxTreeListCellsGroupViewInfo.GetNodesViewInfo: TcxTreeListNodesViewInfo; +begin + Result := NodeViewInfo.Owner; +end; + +function TcxTreeListCellsGroupViewInfo.GetNode: TcxTreeListNode; +begin + Result := NodeViewInfo.Node; +end; + +procedure TcxTreeListCellsGroupViewInfo.CalculateEditCellRect( + ACell: TcxTreeListEditCellViewInfo; AMostLeftPos: Integer); +var + AOfs: Integer; +begin + with ACell, FColumnViewInfo do + begin + CellBorders := Group.Borders; + if XOfs = AMostLeftPos then + begin + AOfs := Self.DisplayRect.Left; + if CellBorders <> cxBordersAll then Exclude(CellBorders, bLeft); + end + else + AOfs := XOfs - Byte(bRight in CellBorders); + if True{not IsAutoHeight} then + begin + DisplayRect := cxRect(AOfs, YOfs, XOfs + DisplayWidth, LineCount); + cxRectScaleH(DisplayRect, Self.CellsHeight); + DisplayRect:= cxRectOffset(DisplayRect, 0, NodeViewInfo.Top); + end + else + DisplayRect := cxRect(AOfs, 0, XOfs + DisplayWidth, 1); + if YOfs > 0 then + Dec(DisplayRect.Top, OptionsView.VertIncrement) + else + Exclude(CellBorders, bTop); + end; +end; + +{ TcxTreeListIndentViewInfo } + +procedure TcxTreeListIndentViewInfo.DoCalculate; +begin + if not Visible then Exit; + if IndentTreeLines <> [] then + with DisplayRect, cxRectCenter(DisplayRect) do + begin + if tltHorz in IndentTreeLines then + IndentHorzTreeLine := cxRect(X, Y - 1, Right, Y); + if [tltVertUp, tltVertDown] * IndentTreeLines <> [] then + begin + IndentVertTreeLine := cxRect(X, Top, X + 1, Bottom); + if not (tltVertUp in IndentTreeLines) then + IndentVertTreeLine.Top := Y - 1; + if not (tltVertDown in IndentTreeLines) then + IndentVertTreeLine.Bottom := Y - 1; + end; + end; + inherited DoCalculate; +end; + +procedure TcxTreeListIndentViewInfo.DoHorzOffset(AShift: Integer); +begin + ShiftIndent(AShift, 0); +end; + +procedure TcxTreeListIndentViewInfo.DoVertOffset(AShift: Integer); +begin + ShiftIndent(0, AShift); +end; + +function TcxTreeListIndentViewInfo.GetControl: TcxEditingControl; +begin + Result := Node.TreeList; +end; + +procedure TcxTreeListIndentViewInfo.ShiftIndent(DX, DY: Integer); +begin + CheckClipping(cxRectOffset(DisplayRect, DX, DY), NodesViewInfo.ClipRect); + DoCalculate; +end; + +procedure TcxTreeListIndentViewInfo.UpdateImageIndex; +begin + with NodeViewInfo do + begin + if not IndentStateImage then + IndentImageIndex := + TreeList.DoGetNodeImageIndex(Node, TcxTreeListImageIndexType(Selected)) + else + IndentImageIndex := TreeList.DoGetNodeImageIndex(Node, tlitStateIndex); + end; + IndentHasImage := cxInRange(IndentImageIndex, 0, IndentImageList.Count - 1); + Invalidate; +end; + +function TcxTreeListIndentViewInfo.GetButtonRect: TRect; +begin + with ControlViewInfo do + begin + if HasButton then + begin + Result := cxRectCenter(DisplayRect, ExpandButtonSize, ExpandButtonSize); + OffsetRect(Result, 0, -1); + with DisplayRect do + OffsetRect(Result, Byte(not Odd(Right - Left)), Byte(not Odd(Bottom - Top))); + end + else + Result := cxInvalidRect; + end; +end; + +function TcxTreeListIndentViewInfo.GetIsExpanded: Boolean; +begin + Result := HasButton and NodeViewInfo.IsExpanded; +end; + +function TcxTreeListIndentViewInfo.GetNextVisible: TcxTreeListNodeViewInfo; +begin + Result := NodeViewInfo.NextVisible; +end; + +function TcxTreeListIndentViewInfo.GetNode: TcxTreeListNode; +begin + Result := NodeViewInfo.Node; +end; + +function TcxTreeListIndentViewInfo.GetNodeViewInfo: TcxTreeListNodeViewInfo; +begin + Result := TcxTreeListNodeViewInfo(Owner); +end; + +function TcxTreeListIndentViewInfo.GetNodesViewInfo: TcxTreeListNodesViewInfo; +begin + Result := NodeViewInfo.Owner; +end; + +function TcxTreeListIndentViewInfo.GetPrevVisible: TcxTreeListNodeViewInfo; +begin + Result := NodeViewInfo.PrevVisible; +end; + +{ TcxTreeListGroupNodeEditViewInfo } + +function TcxTreeListGroupNodeEditViewInfo.ChangedHeight( + APrevHeight, ANewHeight: Integer): Boolean; +begin + if ANewHeight < TreeList.ViewInfo.DefaultHeight then + ANewHeight := TreeList.ViewInfo.DefaultHeight; + Result := APrevHeight <> ANewHeight; +end; + +procedure TcxTreeListGroupNodeEditViewInfo.DoCalculate; +begin + CellBorders := GridLineBorders[TreeList.OptionsView.GridLines] - [bTop]; +// if TreeList.OptionsView.GridLines = tlglVert then Exclude(CellBorders, bLeft); + with NodeViewInfo do + CheckClipping(GetCellRect, NodeClipRect); + inherited DoCalculate; +end; + +function TcxTreeListGroupNodeEditViewInfo.GetColumn: TcxTreeListColumn; +begin + Result := NodeViewInfo.TreeList.OptionsView.GetCategorizedColumn; +end; + +procedure TcxTreeListGroupNodeEditViewInfo.ShiftItem(DX, DY: Integer); +begin + cxShiftEditViewInfoItem(Self, DX, DY); +end; + +procedure TcxTreeListGroupNodeEditViewInfo.Update; +begin + if not NodeViewInfo.NodeIsGroup then Exit; + Column.InitEditViewInfo(Self); + DoCalculate; +end; + +function TcxTreeListGroupNodeEditViewInfo.GetCellRect: TRect; +begin + with NodeViewInfo do + Result := cxRectSetTop(NodeCellsRect, NodeCellsOffset, CellsMaxHeight); +end; + +{ TcxTreeListNodePreviewViewInfo } + +constructor TcxTreeListNodePreviewViewInfo.Create(AOwner: TObject); +begin + inherited Create(AOwner); + Preview := TreeList.Preview; +end; + +function TcxTreeListNodePreviewViewInfo.ChangedHeight( + APrevHeight, ANewHeight: Integer): Boolean; +begin + Result := inherited ChangedHeight(APrevHeight, ANewHeight); +end; + +function TcxTreeListNodePreviewViewInfo.CheckPreviewHeight(DH: Integer): Integer; +var + ALines: Integer; +begin + if Preview.MaxLineCount = 0 then + ALines := Round(PreviewHeight / ControlViewInfo.PreviewHeight) + else + ALines := Preview.MaxLineCount; + Result := (ControlViewInfo.PreviewHeight + DH) * ALines; + if Result > PreviewHeight then Result := PreviewHeight; +end; + +function TcxTreeListNodePreviewViewInfo.ContentOffset: TRect; +begin + Result := cxTreeListEditCellContentOffset; + with Preview do + begin + Result.Left := FLeftIndent; + Result.Right := FRightIndent; + end; +end; + +procedure TcxTreeListNodePreviewViewInfo.CustomDrawEvent( + var AEvent: TcxCustomDrawViewInfoItemEvent); +begin + AEvent := TcxCustomDrawViewInfoItemEvent(TreeList.FOnCustomDrawPreview); +end; + +procedure TcxTreeListNodePreviewViewInfo.DoCalculate; +begin + if not NodeViewInfo.HasPreview then Exit; + with NodeViewInfo do + CheckClipping(GetPreviewRect, NodeClipRect); + Refresh(False); + if Visible then + Column.CalculateEditViewInfo(CellValue, Self, cxInvalidPoint); +end; + +procedure TcxTreeListNodePreviewViewInfo.DoInitPreviewSettings( + APreviewOffset: Integer); +var + DH: Integer; +begin + PreviewHeight := 0; + CellBorders := NodeViewInfo.NodeBorders; + NodeViewInfo.NodeHasPreview := TreeList.Preview.Active; + NodeViewInfo.NodePreviewOffset := APreviewOffset; + if not NodeViewInfo.NodeHasPreview then Exit; + Column.InitEditViewInfo(Self); + Include(ViewData.PaintOptions, epoAllowZeroHeight); + with ContentOffset do + DH := Byte(bBottom in Borders) + Byte(bTop in Borders) + Top + Bottom; + PreviewHeight := ControlViewInfo.PreviewHeight + DH; + if IsAutoHeight then + begin + CellContentRect := GetPreviewRect; + PreviewHeight := Column.GetEditHeight(Self); + PreviewHeight := CheckPreviewHeight(DH); + end; + with NodesViewInfo do + begin + if Assigned(TreeList.OnGetNodePreviewHeight) then + TreeList.OnGetNodePreviewHeight(TreeList, Node, DisplayValue, PreviewHeight); + if (PreviewHeight - DH) <= 0 then + begin + PreviewHeight := 0; + ItemVisible := False; + end; + end; +end; + +function TcxTreeListNodePreviewViewInfo.GetColumn: TcxTreeListColumn; +begin + Result := Preview.Column; +end; + +function TcxTreeListNodePreviewViewInfo.GetButtonTransparency: TcxEditButtonTransparency; +begin + Result := ebtHideInactive; +end; + +function TcxTreeListNodePreviewViewInfo.GetHotTrack: Boolean; +begin + Result := False; +end; + +function TcxTreeListNodePreviewViewInfo.GetLineCount: Integer; +begin + Result := Preview.MaxLineCount; +end; + +function TcxTreeListNodePreviewViewInfo.GetLineOffset: Integer; +begin + Result := 0; +end; + +function TcxTreeListNodePreviewViewInfo.GetMaxLineCount: Integer; +begin + Result := Preview.MaxLineCount; +end; + +procedure TcxTreeListNodePreviewViewInfo.GetTreeListEditCellParams( + var AParams: TcxViewParams); +begin + AParams := TreeList.Styles.GetPreviewParams(Node); +end; + +function TcxTreeListNodePreviewViewInfo.IsAutoHeight: Boolean; +begin + Result := Preview.AutoHeight; +end; + +procedure TcxTreeListNodePreviewViewInfo.ShiftItem(DX, DY: Integer); +begin + cxShiftEditViewInfoItem(Self, DX, DY); +end; + +procedure TcxTreeListNodePreviewViewInfo.Update; +begin + if not NodeViewInfo.HasPreview then Exit; + Column.InitEditViewInfo(Self); + DoCalculate; +end; + +function TcxTreeListNodePreviewViewInfo.GetPreviewRect: TRect; +begin + with NodeViewInfo do + begin + Result := cxRectSetTop(NodeContentRect, NodePreviewOffset, PreviewHeight); + if TreeList.ViewInfo.LeftFixedBand = nil then + Result.Left := NodeCellsRect.Left + else + Result.Left := NodeViewInfo.NodeIndentLeft; + end; +end; + +{ TcxTreeListNodeViewInfo } + +constructor TcxTreeListNodeViewInfo.Create(AOwner: TcxTreeListNodesViewInfo); +begin + FOwner := AOwner; + FGroups := TList.Create; + FCells := TList.Create; + FIndents := TList.Create; + FIndicator := ControlViewInfo.GetIndicatorViewInfoClass.Create(ControlViewInfo); + FPreview := FOwner.GetNodePreviewViewInfoClass.Create(Self); + NodeGroupEditViewInfo := TcxTreeListGroupNodeEditViewInfo.Create(Self); +end; + +destructor TcxTreeListNodeViewInfo.Destroy; +begin + try + FreeAndNil(NodeGroupEditViewInfo); + Clear; + FreeAndNil(FPreview); + FreeAndNil(FIndicator); + FreeAndNil(FGroups); + FreeAndNil(FIndents); + FreeAndNil(FCells); + finally + inherited Destroy; + end; +end; + +procedure TcxTreeListNodeViewInfo.AssignLayoutTo(ADest: TcxTreeListNodeViewInfo); + + procedure AssignObjectLists(ASrc, ADest: PPointerList; ACount: Integer); + var + I: Integer; + begin + for I := 0 to ACount - 1 do + TcxCustomViewInfoItem(ADest^[I]).Assign(TcxCustomViewInfoItem(ASrc^[I])); + end; + +begin + ADest.ReallocateData; + AssignObjectLists(FGroups.List, ADest.FGroups.List, FGroups.Count); + AssignObjectLists(FCells.List, ADest.FCells.List, FCells.Count); + ADest.Top := Top; + ADest.Left := Left; + ADest.NodeCellsCalculated := False; + ADest.NodeFocused := False; + ADest.NodeHasButton := False; + ADest.NodeHasPreview := False; + ADest.NodeSelected := False; + ADest.NodeVisible := False; + ADest.NodeIsExpanded := False; + ADest.NodeBorders := NodeBorders; + ADest.CellsMaxHeight := CellsMaxHeight; + ADest.NodeContentRect := NodeContentRect; + ADest.NodeCellsRect := NodeCellsRect; + ADest.NodeFocusedCell := nil; +end; + +procedure TcxTreeListNodeViewInfo.Clear; +begin + cxCheckObjectList(FGroups, 0, nil, nil); + cxCheckObjectList(FIndents, 0, nil, nil); + cxCheckObjectList(FCells, 0, nil, nil); +end; + +procedure TcxTreeListNodeViewInfo.DoCalculate; +var + I: Integer; +begin + NodeHasButton := OptionsView.Buttons and Node.HasChildren; + NodeIsGroup := TreeList.DoIsGroupNode(Node); + NodeFocused := Node.Focused; + NodeSelected := Node.Selected; + if NodeHasButton then + NodeIsExpanded := Node.Expanded + else + NodeIsExpanded := False; + NodeLevel := Node.Level; + NodeIndentLeft := DoCalculateIndentsLayout; + NodeCellsOffset := Top; + if Preview.Preview.Place = tlppTop then + begin + Preview.DoInitPreviewSettings(Top); + NodeCellsOffset := Top + Preview.PreviewHeight; + end; + if not NodeIsGroup then + begin + for I := 0 to GroupCount - 1 do + with Groups[I] do + begin + ItemViewParams := TreeList.Styles.GetBandContentParams(Band, Node); + DoCalculate; + end; + end; + if Owner.IsRowAutoHeight then DoCalculateAutoHeights; + if Preview.Preview.Place = tlppBottom then + Preview.DoInitPreviewSettings(Top + CellsMaxHeight); + cxRectSetHeightEx(NodeContentRect, RealHeight); + UpdateContentRects; + FIndicator.FKind := GetNodeIndicatorKind; +end; + +procedure TcxTreeListNodeViewInfo.DoCalculateAutoHeights; +var + I: Integer; + AIndent: Integer; +begin + CellMaxHeightRefCount := 0; + CellsMaxHeight := ControlViewInfo.DefaultEditHeight; + if not IsGroupNode then + begin + AIndent := TreeList.GetLevelIndentsWidth(Node.Level, True, Node); + for I := 0 to CellCount - 1 do + with Cells[I] do + begin + CellContentRect := cxExcludeBorders(DisplayRect, Borders); + if Column.IsLeftMost then + Inc(CellContentRect.Left, AIndent); + CellHeight := CalculateEditHeight; + if CellsMaxHeight < CellHeight then + begin + CellMaxHeightRefCount := 1; + CellsMaxHeight := CellHeight; + end + else + if CellHeight = CellsMaxHeight then Inc(CellMaxHeightRefCount); + end; + end + else + begin + with NodeGroupEditViewInfo do + CheckClipping(cxRectSetXPos(NodeCellsRect, NodeIndentLeft, NodeCellsRect.Right), NodeClipRect); + CellsMaxHeight := cxMax(NodeGroupEditViewInfo.CalculateEditHeight, CellsMaxHeight); + end; + TreeList.DoOnGetNodeHeight(Node, CellsMaxHeight); + if CellMaxHeightRefCount = 0 then Inc(CellMaxHeightRefCount); +end; + +procedure TcxTreeListNodeViewInfo.DoCalculateCellsViewInfo; +var + I: Integer; +begin + if not IsGroupNode then + for I := 0 to CellCount - 1 do Cells[I].DoCalculate + else + NodeGroupEditViewInfo.DoCalculate; + NodeCellsCalculated := True; +end; + +procedure TcxTreeListNodeViewInfo.DoCalculateImageIndents(var ALeft: Integer); + + procedure AddImageIndent(HasImages: Boolean; var Index: Integer; AType: Integer); + begin + if not HasImages then Exit; + with Indents[Index] do + begin + IndentIsLevel := False; + IndentBorders := []; + IndentImageIndex := Node.GetNodeImageIndex(AType); + IndentStateImage := AType = Byte(tlitStateIndex); + if IndentStateImage then + IndentImageList := TreeList.StateImages + else + IndentImageList := TreeList.Images; + ItemViewParams := TreeList.Styles.GetIndentParams(Self.Node, Index); + DisplayRect := Rect(ALeft - TreeList.GetImageIndentWidth( + TcxTreeListImageIndexType(AType)), Self.Top, ALeft, Self.Top + RealHeight); + Dec(ALeft, TreeList.FMaxIndentWidth); + IndentHasImage := cxInRange(IndentImageIndex, 0, IndentImageList.Count - 1); + end; + Dec(Index); + end; + +var + AIndex: Integer; +begin + AIndex := IndentCount - 1; + with OptionsView do + begin + AddImageIndent(HasImages(Node), AIndex, Byte(Node.Selected)); + AddImageIndent(HasStateImages(Node), AIndex, Byte(tlitStateIndex)); + end; +end; + +function TcxTreeListNodeViewInfo.DoCalculateIndentsLayout: Integer; +var + ANode: TcxTreeListNode; + I, AIndentCount, ANextIndentCount, ALeft: Integer; +begin + with TreeList do + begin + Result := Groups[0].DisplayRect.Left + GetLevelIndentsWidth(NodeLevel, True, Node); + AIndentCount := GetLevelIndentCount(NodeLevel, True, Node); + if AIndentCount = 0 then + begin + cxCheckObjectList(FIndents, 0, nil, nil); + Exit; + end; + cxCheckObjectList(FIndents, AIndentCount, Self.Owner.GetIndentViewInfoItemClass, Self); + Inc(NodeLevel, Byte(OptionsView.ShowRoot)); + ANextIndentCount := -1; + ANode := Node.GetNextVisible; + if ANode <> nil then + ANextIndentCount := GetLevelIndentCount(ANode.Level, True, ANode); + ANode := Node; + ALeft := Result; + DoCalculateImageIndents(ALeft); + for I := NodeLevel - 1 downto 0 do + CalculateIndentInfo(Indents[I], ANode, I, ALeft); + if OptionsView.GridLines in [tlglBoth, tlglHorz] then + begin + for I := 0 to AIndentCount - 1 do + if (I >= ANextIndentCount) then + Indents[I].IndentBorders := [bBottom] + else + Indents[I].IndentBorders := [] + end; + end; +end; + +procedure TcxTreeListNodeViewInfo.DoCalculateIndentsViewInfo; +var + I: Integer; +begin + for I := 0 to IndentCount - 1 do + Indents[I].DoCalculate; +end; + +// main calculate layout cells in nodes used for template viewinfo and +// that be assigned to another NodeViewInfo + +procedure TcxTreeListNodeViewInfo.DoCalculateLayout; +var + AOfs, I, AIndex, ACellIndex: Integer; + AMin, AMax: Integer; + APrev: TcxTreeListBandViewInfo; + + procedure DoCalculateLayoutCellsInBand(AInfo: TcxTreeListBandViewInfo); + var + I: Integer; + AGroup: TcxTreeListCellsGroupViewInfo; + AIsLeft: Boolean; + begin + if AInfo = nil then Exit; + AIsLeft := (APrev = nil) or (APrev.Fixed <> tlbfNone) or (AInfo.Fixed <> tlbfNone); + if AIsLeft then + begin + AOfs := AInfo.DisplayRect.Left; + NodeCellsRect.Left := AOfs; + end + else + Dec(AOfs); + AGroup := AddGroup(AInfo, AIndex, AOfs); + with AGroup do + begin + Borders := GridLineBorders[Self.OptionsView.GridLines]; + FirstIndex := ACellIndex; + for I := 0 to AInfo.ColumnCount - 1 do + AddCell(AInfo.Columns[I], AIndex, ACellIndex); + LastIndex := ACellIndex; + cxSetMin(Left, DisplayRect.Left); + CheckClipping(DisplayRect, GetVisibleRect(Fixed)); + DoCalculateCellsLayout; + AOfs := DisplayRect.Right; + NodeCellsRect.Right := AOfs; + Exclude(Borders, bTop); + if AInfo.Band.IsLeftMost and not (bBottom in Borders) then Exclude(Borders, bLeft); + end; + APrev := AInfo; + end; + +begin + ReallocateData; + Top := Owner.ClipRect.Top; + Left := MaxInt; + NodeContentRect := Owner.ClipRect; + if OptionsView.Indicator then + Dec(NodeContentRect.Left, OptionsView.IndicatorWidth); + with ControlViewInfo do + begin + AIndex := 0; + ACellIndex := 0; + APrev := nil; + DoCalculateLayoutCellsInBand(LeftFixedBand); + for I := 0 to BandCount - 1 do + DoCalculateLayoutCellsInBand(Bands[I]); + DoCalculateLayoutCellsInBand(RightFixedBand); + NodeBorders := Groups[0].Borders; + if bRight in Groups[GroupCount - 1].Borders then + Include(NodeBorders, bRight); + end; + if not Owner.IsRowAutoHeight then + begin + cxRectMinMaxInit(AMin, AMax); + for I := 0 to CellCount - 1 do + cxRectMinMaxHeight(Cells[I].DisplayRect, AMax, AMin); + CellsMaxHeight := AMax - AMin; + end + else + CellsMaxHeight := 0; + NodeContentRect.Right := cxMin(Owner.ClipRect.Right, NodeCellsRect.Right); +end; + +procedure TcxTreeListNodeViewInfo.DoHorzOffset(AShift: Integer); +var + I: Integer; + R: TRect; +begin + if not IsGroupNode then + begin + for I := Byte(LeftFixedGroup <> nil) to GroupCount - Byte(RightFixedGroup <> nil) - 1 do + Groups[I].DoHorzOffset(AShift); + end + else + R := NodeGroupEditViewInfo.GetCellRect; + if not Groups[GroupCount - 1].Fixed then + Inc(NodeCellsRect.Right, AShift); + if not Groups[0].Fixed then + begin + Inc(NodeCellsRect.Left, AShift); + for I := 0 to IndentCount - 1 do Indents[I].DoHorzOffset(AShift); + end; + UpdateClipping; + Preview.DoCalculate; + if IsGroupNode then + begin + with NodeGroupEditViewInfo do + begin + CheckClipping(GetCellRect, NodeContentRect); + DoCalculate; + end; + end; +end; + +procedure TcxTreeListNodeViewInfo.DoVertOffset(AShift: Integer); +var + I: Integer; +begin + if (AShift = 0) and NodeCellsCalculated then Exit; + Inc(NodePreviewOffset, AShift); + Inc(NodeCellsOffset, AShift); + OffsetRect(NodeContentRect, 0, AShift); + OffsetRect(NodeCellsRect, 0, AShift); + UpdateClipping; + if not IsGroupNode then + for I := 0 to GroupCount - 1 do + Groups[I].DoVertOffset(AShift); + for I := 0 to IndentCount - 1 do + Indents[I].DoVertOffset(AShift); + DoCalculateIndentsViewInfo; + if not IsGroupNode then + cxCalcSeparators(Separators, ControlViewInfo.FSeparators, NodeCellsRect) + else + NodeGroupEditViewInfo.ShiftItem(0, AShift); + FIndicator.Calculate(ContentRect, NodeContentRect); + Preview.DoCalculate; +end; + +function TcxTreeListNodeViewInfo.GetNodeIndicatorKind: TcxIndicatorKind; + + function IsMultiSelect: Boolean; + begin + Result := TreeList.SelectionCount > 1; + end; + +begin + Result := ikNone; + if Focused then + begin + if Selected and IsMultiSelect then + Result := ikMultiArrow + else + Result := ikArrow; + if TreeList.IsNodeEdited(Node) then + Result := ikEdit + else + if TreeList.IsNodeInserted(Node) then + Result := ikInsert + end + else + if Selected then Result := ikMultiDot; +end; + +procedure TcxTreeListNodeViewInfo.Update(ARecalculate: Boolean = False); + + function ChangeState(var APrevState: Boolean; AState, ACheckPrev: Boolean): Boolean; + begin + Result := (ACheckPrev and APrevState) or (AState <> APrevState); + APrevState := AState; + end; + +var + I: Integer; + ARecalculateOnFocusChanged, NeedUpdate: Boolean; +begin + NeedUpdate := Node.Focused; + ARecalculateOnFocusChanged := (NodeFocused <> NeedUpdate); +{$B+} + NeedUpdate := ChangeState(NodeFocused, NeedUpdate, True) or + ChangeState(NodeSelected, Node.Selected, not Owner.CheckSelectionMode); +{$B-} + ARecalculateOnFocusChanged := ARecalculate or ARecalculateOnFocusChanged; + if NeedUpdate or NodeFocused or ARecalculate then + begin + for I := 0 to IndentCount - 1 do + with Indents[I] do + begin + ItemViewParams := TreeList.Styles.GetIndentParams(Self.Node, I); + DoCalculate; + end; + NeedUpdate := False; + if not IsGroupNode then + for I := 0 to CellCount - 1 do + NeedUpdate := NeedUpdate or Cells[I].Refresh(ARecalculateOnFocusChanged) + else + NeedUpdate := NeedUpdate or NodeGroupEditViewInfo.Refresh(ARecalculateOnFocusChanged); + NeedUpdate := NeedUpdate or (HasPreview and Preview.Refresh(ARecalculateOnFocusChanged)); + if NeedUpdate then + TreeList.LayoutChanged + else + begin + UpdateImageIndexes; + Owner.Owner.InvalidateRect(NodeContentRect); + end; + end; + Indicator.FKind := GetNodeIndicatorKind; +end; + +procedure TcxTreeListNodeViewInfo.UpdateClipping; +begin + NodeClipRect := NodeCellsRect; + NodeClipRect.Right := cxMin(Owner.ClipRect.Right, NodeClipRect.Right); + NodeVisible := cxRectIntersect(NodeClipRect, NodeContentRect, Owner.ClipRect); +end; + +procedure TcxTreeListNodeViewInfo.UpdateImageIndexes; +var + AIndex: Integer; +begin + AIndex := IndentCount - 1; + while AIndex >= 0 do + with Indents[AIndex] do + begin + if not IsLevel then + UpdateImageIndex + else + Break; + Dec(AIndex) + end; +end; + +procedure TcxTreeListNodeViewInfo.UpdatePostCalculate(ATop, AIndex: Integer); +begin + Indicator.FNode := Node; + Index := AIndex; + UpdateLinks; + DoVertOffset(ATop - Top); + if not NodeCellsCalculated then + DoCalculateCellsViewInfo + else + UpdateClipping; + Top := ATop; +end; + +procedure TcxTreeListNodeViewInfo.ReallocateData; +begin + with Owner, TreeList do + begin + cxCheckObjectList(FGroups, VisibleBandCount, GetGroupViewInfoItemClass, Self); + cxCheckObjectList(FCells, VisibleColumnCount, GetEditCellViewInfoItemClass, Self); + end; +end; + +function TcxTreeListNodeViewInfo.GetCell(Index: Integer): TcxTreeListEditCellViewInfo; +begin + Result := TcxTreeListEditCellViewInfo(FCells.List^[Index]); +end; + +function TcxTreeListNodeViewInfo.GetCellCount: Integer; +begin + Result := FCells.Count; +end; + +function TcxTreeListNodeViewInfo.GetControlViewInfo: TcxTreeListViewInfo; +begin + Result := Owner.Owner; +end; + +function TcxTreeListNodeViewInfo.GetFocusRect: TRect; +begin + if Focused and (GroupCount > 0) then + begin + if NodeFocusedCell <> nil then + Result := NodeFocusedCell.CellContentRect + else + begin + Result := NodeCellsRect; + cxRectSetTopEx(Result, NodeContentRect); + Result := cxExcludeBorders(Result, NodeBorders); + end; + end + else + Result := cxInvalidRect; +end; + +function TcxTreeListNodeViewInfo.GetGroup(Index: Integer): TcxTreeListCellsGroupViewInfo; +begin + Result := TcxTreeListCellsGroupViewInfo(FGroups.List^[Index]); +end; + +function TcxTreeListNodeViewInfo.GetGroupCount: Integer; +begin + Result := FGroups.Count; +end; + +function TcxTreeListNodeViewInfo.GetIndent(Index: Integer): TcxTreeListIndentViewInfo; +begin + Result := TcxTreeListIndentViewInfo(FIndents.List^[Index]); +end; + +function TcxTreeListNodeViewInfo.GetHotTrack: Boolean; +begin + Result := Node.HotTrack; +end; + +function TcxTreeListNodeViewInfo.GetIndentCount: Integer; +begin + Result := FIndents.Count; +end; + +function TcxTreeListNodeViewInfo.GetIndentWidth: Integer; +begin + Result := Owner.IndentWidth; +end; + +function TcxTreeListNodeViewInfo.GetOptionsView: TcxTreeListOptionsView; +begin + Result := TreeList.OptionsView; +end; + +function TcxTreeListNodeViewInfo.GetRealHeight: Integer; +begin + Result := CellsMaxHeight + Byte(HasPreview) * Preview.PreviewHeight; +end; + +function TcxTreeListNodeViewInfo.GetTreeList: TcxCustomTreeListControl; +begin + Result := Owner.TreeList; +end; + +function TcxTreeListNodeViewInfo.GetVisibleIndex: Integer; +begin + Result := Node.FVisibleIndex; +end; + +function TcxTreeListNodeViewInfo.AddGroup(AInfo: TcxTreeListBandViewInfo; + var AIndex, AOfs: Integer): TcxTreeListCellsGroupViewInfo; +begin + Result := Groups[AIndex]; + Result.DisplayRect := + cxRect(AOfs, Top, AInfo.DisplayRect.Right, NodeContentRect.Bottom); + Result.BandViewInfo := AInfo; + Result.IsOpaque := AInfo.IsOpaque; + Inc(AIndex); +end; + +function TcxTreeListNodeViewInfo.GetVisibleRect(AFixed: Boolean): TRect; +begin + if AFixed then + Result := Owner.ClipRect + else + Result := Owner.ScrollRect; +end; + +procedure TcxTreeListNodeViewInfo.AddCell( + AInfo: TcxTreeListColumnViewInfo; var AGroupIndex, AIndex: Integer); +begin +// if (AIndex < 0) or (AIndex >= CellCount) then Exit; + with Cells[AIndex] do + begin + GroupIndex := AGroupIndex - 1; + FColumnViewInfo := AInfo; + end; + Inc(AIndex); +end; + +procedure TcxTreeListNodeViewInfo.CalculateIndentInfo(AIndent: TcxTreeListIndentViewInfo; + var ANode: TcxTreeListNode; ALevel: Integer; var ALeft: Integer); +begin + with AIndent do + begin + IndentLevelNode := ANode; + IndentIsLevel := True; + IndentLevel := ALevel; + IndentTreeLines := []; + IndentBorders := []; + IndentHasExpandButton := (ANode = Self.Node) and NodeHasButton; + IndentTreeLines := []; + if OptionsView.TreeLineStyle <> tllsNone then + begin + IndentTreeLines := [tltVertUp]; + if ANode = Self.Node then + Include(IndentTreeLines, tltHorz); + if ANode.FNext <> nil then + Include(IndentTreeLines, tltVertDown) + else + if ((ANode <> Self.Node) and (ANode.Parent <> Self.Node.Parent)) then + Exclude(IndentTreeLines, tltVertUp); + if (ANode = ViewInfoNode) and (ANode = ANode.Owner.Root.FFirst) then + Exclude(IndentTreeLines, tltVertUp); + end; + end; + with TreeList do + AIndent.ItemViewParams := Styles.GetIndentParams(Self.Node, ALevel); + AIndent.DisplayRect := Rect(ALeft - IndentWidth, Top, ALeft, Top + RealHeight); + Dec(ALeft, IndentWidth); + ANode := ANode.Parent; +end; + +procedure TcxTreeListNodeViewInfo.UpdateContentRects; + + procedure SetLeftMostIndent(AGroup: TcxTreeListCellsGroupViewInfo); + var + I: Integer; + begin + AGroup.SetSize(NodeCellsOffset, CellsMaxHeight); + for I := 0 to AGroup.CellCount - 1 do + with AGroup.Cells[I] do + begin + if DisplayRect.Left = AGroup.DisplayRect.Left then + DisplayRect.Left := NodeIndentLeft; + end; + AGroup.DisplayRect.Left := NodeIndentLeft; + end; + +var + I: Integer; +begin + NodeCellsRect.Left := NodeIndentLeft; + if not IsGroupNode then + begin + SetLeftMostIndent(Groups[0]); + cxRectSetTopEx(NodeCellsRect, NodeCellsOffset, CellsMaxHeight); + cxRectSetTopEx(NodeContentRect, Top, RealHeight); + for I := 1 to GroupCount - 1 do + Groups[I].SetSize(NodeCellsOffset, CellsMaxHeight); + end; + for I := 0 to IndentCount - 1 do + cxRectSetHeightEx(Indents[I].DisplayRect, RealHeight); +end; + +procedure TcxTreeListNodeViewInfo.UpdateLinks; + + function GetNodeViewInfo(AIndex: Integer): TcxTreeListNodeViewInfo; + begin + with Owner do + if (AIndex = cxInvalidIndex) or (AIndex >= Count) then + Result := nil + else + Result := Nodes[AIndex]; + end; + + function CheckFixed(AGroup: TcxTreeListCellsGroupViewInfo; + AKind: TcxTreeListBandFixedKind): TcxTreeListCellsGroupViewInfo; + begin + if AGroup.Band.FixedKind = AKind then + Result := AGroup + else + Result := nil; + end; + +begin + NodeNextVisible := GetNodeViewInfo(Index + 1); + NodePrevVisible := GetNodeViewInfo(Index - 1); + if (GroupCount > 0) and not IsGroupNode then + begin + LeftFixedGroup := CheckFixed(Groups[0], tlbfLeft); + RightFixedGroup := CheckFixed(Groups[GroupCount - 1], tlbfRight); + end; +end; + +{ TcxTreeListNodesViewInfo } + +constructor TcxTreeListNodesViewInfo.Create(AOwner: TcxTreeListViewInfo); +begin + FOwner := AOwner; +end; + +destructor TcxTreeListNodesViewInfo.Destroy; +begin + try + Clear; + FreeMem(FNodes); + finally + inherited Destroy; + end; +end; + +procedure TcxTreeListNodesViewInfo.Add(ANode: TcxTreeListNode; var AHeight: Integer); +var + AViewInfo: TcxTreeListNodeViewInfo; +begin + AViewInfo := AddNode(ANode); + if IsAddFirst and (Count > 1) then + begin + System.Move(FNodes^[0], FNodes^[1], (Count - 1) * SizeOf(Pointer)); + FNodes^[0] := AViewInfo; + end; + Template.AssignLayoutTo(AViewInfo); + with AViewInfo do + begin + AViewInfo.DoCalculate; + AHeight := RealHeight; + end; +end; + +function TcxTreeListNodesViewInfo.AddNode( + ANode: TcxTreeListNode): TcxTreeListNodeViewInfo; +var + ACapacity: Integer; +begin + if FNodesCount > Count then + Result := TcxTreeListNodeViewInfo(FNodes^[Count]) + else + begin + Result := GetNodeViewInfoClass.Create(Self); + Inc(FNodesCount); + ACapacity := + ((FNodesCount + cxMinCapacityInc) div cxMinCapacityInc) * cxMinCapacityInc; + if ACapacity > FCapacity then + begin + FCapacity := ACapacity; + ReallocMem(FNodes, FCapacity * SizeOf(Pointer)); + end; + FNodes^[Count] := Result; + end; + Result.ViewInfoNode := ANode; + Inc(Count); +end; + +procedure TcxTreeListNodesViewInfo.BeforeShowEdit; +begin + PostViewInfoUpdate; +end; + +procedure TcxTreeListNodesViewInfo.CalculatePreviewHeight; +begin + with TreeList.Preview do + begin + if Active then + begin + Self.Owner.PreviewHeight := Column.GetEditDefaultHeight( + TreeList.Styles.GetPreviewParams(TreeList.Nodes.Root.FFirst).Font); + Self.Owner.PreviewHeight := Self.Owner.PreviewHeight {* MaxLineCount}; + end; + end; +end; + +procedure TcxTreeListNodesViewInfo.CancelUpdatePost; +begin + FUpdatePost := False; +end; + +procedure TcxTreeListNodesViewInfo.ChangeDirection; +begin + IsAddFirst := not IsAddFirst; +end; + +procedure TcxTreeListNodesViewInfo.Clear; +var + I: Integer; +begin + try + for I := 0 to FNodesCount - 1 do + FreeAndNil(TObject(FNodes^[I])); + FreeMem(FNodes); + finally + FreeAndNil(Template); + if not TreeList.IsDestroying then ClearState; + TopNode := nil; + VisibleCount := 0; + Count := 0; + FNodes := nil; + FNodesCount := 0; + FCapacity := 0; + end; +end; + +procedure TcxTreeListNodesViewInfo.ClearState; +begin + IsAddFirst := False; + Count := 0; + VisibleCount := 0; + IsRowAutoHeight := OptionsView.CellAutoHeight and (TreeList.HeaderLineCount = 1); + with TreeList.Nodes do + begin + Self.TopNode := TopVisibleNode; + TopIndex := TopIndex; + end; +end; + +procedure TcxTreeListNodesViewInfo.DoCalculate(AFullRecalculate: Boolean = True); +begin + ClearState; + IndentWidth := TreeList.FLevelIndentWidth; + with Owner do + begin + ClipRect := ContentRect; + cxRectIntersect(ScrollRect, ContentRect, ScrollingArea); + end; + SpaceArea := Owner.CellsRect; + SpaceArea.Left := Owner.BorderSize; + TopNode := TreeList.Nodes.TopNode; + if (TopNode = nil) or (TreeList.VisibleBandCount = 0) or (TreeList.VisibleColumnCount = 0) then + begin + VisibleCount := 0; + Exit; + end; + CalculatePreviewHeight; + if AFullRecalculate then + begin + if Template = nil then Template := GetNodeViewInfoClass.Create(Self); + Template.DoCalculateLayout; + end; + NodesBottom := Owner.CellsRect.Top; + ProcessNodes(TopNode, True); +end; + +procedure TcxTreeListNodesViewInfo.DoCalculateNextPage(AGoForward: Boolean); +begin + TreeList.Controller.DoShowNextPageEx(AGoForward, False, []); +end; + +procedure TcxTreeListNodesViewInfo.DoHorzOffset(AShift: Integer); + + procedure DoOffsetGroup(AGroup: TcxTreeListCellsGroupViewInfo); + var + I: Integer; + begin + with AGroup do + begin + if Band.FixedKind <> tlbfNone then Exit; + OffsetRect(DisplayRect, AShift, 0); + for I := 0 to CellCount - 1 do + OffsetRect(Cells[I].DisplayRect, AShift, 0); + end; + end; + +var + I: Integer; +begin + if Count = 0 then Exit; + for I := 0 to Count - 1 do + Nodes[I].DoHorzOffset(AShift); + with Template do + for I := 0 to GroupCount - 1 do DoOffsetGroup(Groups[I]); +end; + +procedure TcxTreeListNodesViewInfo.DoCalculateShiftUp( + ALineCount: Integer); +var + I: Integer; +begin + for I := 0 to ALineCount - 1 do + Dec(NodesBottom, MoveFirstToLatest(False)); + if Count > 0 then + TopNode := Nodes[0].Node; + ProcessNodes(GetNextNodeFromViewInfo(Count - 1), True); +end; + +procedure TcxTreeListNodesViewInfo.DoCalculateShiftDown(ALineCount: Integer); +var + I: Integer; + ANode: TcxTreeListNode; + IsBreak: Boolean; +begin + IsAddFirst := True; + if ALineCount > 0 then + begin + NeedViewInfoUpdatePost; + ANode := GetNextNodeFromViewInfo(0); + for I := 1 to ALineCount do + begin + IsAddFirst := True; + IsBreak := False; + if ANode <> nil then + begin + NodesBottom := 0; + ProcessAddNode(ANode, IsBreak); + end + else + Break; + TopNode := Nodes[0].Node; + end; + end; +end; + +procedure TcxTreeListNodesViewInfo.DoVertOffset(AShift: Integer); +begin + if AShift = 0 then Exit; + if TreeList.IsLocked then + TreeList.Nodes.SetTopVisibleIndex(TopVisibleIndex + AShift) + else + begin + if Abs(AShift) >= Count then + begin + TreeList.Nodes.SetTopVisibleIndex(TopVisibleIndex + AShift); + DoCalculate(False); + Owner.InvalidateRect(ClipRect); + end + else + begin + if AShift > 0 then + begin + TreeList.Nodes.SetTopVisibleIndex(TopVisibleIndex + AShift); + DoCalculate(False); + Owner.InvalidateRect(ClipRect); + end + else + DoCalculateShiftDown(Abs(AShift)); + end; + end; +end; + +function TcxTreeListNodesViewInfo.FindNodeViewInfo( + ANode: TcxTreeListNode; var AViewInfo: TcxTreeListNodeViewInfo): Boolean; +var + AIndex: Integer; +begin + Result := ANode <> nil; + if not Result then Exit; + with ANode do + AIndex := VisibleIndex - TopVisibleIndex; + Result := (AIndex >= 0) and (AIndex < Count); + if Result then AViewInfo := Nodes[AIndex]; + Result := Result and (ANode = AViewInfo.Node); +end; + +procedure TcxTreeListNodesViewInfo.FocusedRecordChanged( + APrevNode, ANewNode: TcxTreeListNode); +var + AViewInfo: TcxTreeListNodeViewInfo; +begin + if (APrevNode <> ANewNode) and not TreeList.IsLocked then + begin + if FindNodeViewInfo(APrevNode, AViewInfo) then AViewInfo.Update; + if FindNodeViewInfo(ANewNode, AViewInfo) then AViewInfo.Update; + FNeedUpdatePos := True; + end; +end; + +procedure TcxTreeListNodesViewInfo.MakeNodeVisible(ANode: TcxTreeListNode); +var + AViewInfo: TcxTreeListNodeViewInfo; +begin + if (ANode = nil) or not ANode.IsVisible or + (FindNodeViewInfo(ANode, AViewInfo) and (AViewInfo.Index < VisibleCount)) then Exit; + if ANode.FVisibleIndex <= TopVisibleIndex then + TreeList.SetTopVisibleNode(ANode) + else + if (ANode.FVisibleIndex - TopVisibleIndex) = VisibleCount then + Owner.DoScrollVertical(1) + else + SetLastVisibleNode(ANode); +end; + +function TcxTreeListNodesViewInfo.MoveFirstToLatest( + ACheckedOne: Boolean = True): Integer; +var + AItem: Pointer; +begin + Result := 0; + if Count < 1 then Exit; + if (ACheckedOne and (Count > 1)) or not ACheckedOne then + begin + AItem := FNodes^[0]; + Dec(Count); + if Count > 0 then + begin + System.Move(FNodes^[1], FNodes^[0], Count * SizeOf(Pointer)); + FNodes^[Count] := AItem; + end; + Result := TcxTreeListNodeViewInfo(AItem).RealHeight; + end; +end; + +procedure TcxTreeListNodesViewInfo.NeedUpdatePost; +begin + FUpdatePost := True; +end; + +procedure TcxTreeListNodesViewInfo.NeedViewInfoUpdatePost; +begin + FNeedSynchronize := True; + FNeedUpdatePos := True; +end; + +function TcxTreeListNodesViewInfo.PostViewInfoUpdate: Boolean; +begin + if FNeedUpdatePos then + begin + UpdatePostCalculate; + FNeedUpdatePos := False; + TreeList.HitTest.Recalculate; + Result := True; + TreeList.DoChanged; + end + else + Result := False; +end; + +procedure TcxTreeListNodesViewInfo.PostUpdate; +begin + if FUpdatePost then UpdateSelectedNodes; +end; + +procedure TcxTreeListNodesViewInfo.ProcessNodes( + ATopNode: TcxTreeListNode; ANeedLastVisible: Boolean); +var + ANode: TcxTreeListNode; + PrevH: Integer; + IsBreak: Boolean; +begin + if (TreeList.VisibleColumnCount = 0) or (TopNode = nil) then + begin + VisibleCount := 0; + Exit; + end; + NeedViewInfoUpdatePost; + TreeList.Controller.EditingController.PostEditUpdate; + try + ANode := ATopNode; + IsBreak := False; + PrevH := 0; + repeat + while (ANode <> nil) and not IsBreak do + PrevH := ProcessAddNode(ANode, IsBreak); + if (ANode = nil) and not IsBreak then + begin + ChangeDirection; + ANode := GetNextNodeForProcess + end; + if IsBreak and ANeedLastVisible and IsAddFirst then + begin + Dec(NodesBottom, PrevH); + IsBreak := NodesBottom > ClipRect.Bottom; + MoveFirstToLatest; + ChangeDirection; + ANode := GetNextNodeForProcess; + if IsAddFirst then Break; + end; + until (ANode = nil) or IsBreak or (Count = TreeList.Nodes.VisibleCount); + VisibleCount := Count; + if IsBreak and (Count > 1) then Dec(VisibleCount); + if Count > 0 then + TopNode := Nodes[0].Node; + + finally + IsAddFirst := False; + end; +end; + +procedure TcxTreeListNodesViewInfo.SetLastVisibleNode(ANode: TcxTreeListNode); +begin + IsAddFirst := True; + NodesBottom := ClipRect.Top; + Count := 0; + VisibleCount := 0; + ProcessNodes(ANode, True); + Owner.InvalidateScrollRect(dsdVert); + UpdatePostCalculate; + SynchronizeTopNode; +end; + +procedure TcxTreeListNodesViewInfo.SynchronizeTopNode; +begin + with TreeList.Nodes do + begin + TopNode := Self.TopNode; + if TopNode <> nil then + TopIndex := TopNode.VisibleIndex; + TreeList.VScrollBar.Position := TopIndex; + if Self.VisibleCount < VisibleCount then + TreeList.VScrollBar.PageSize := Self.VisibleCount; + FNeedSynchronize := False; + end; +end; + +procedure TcxTreeListNodesViewInfo.UpdatePostCalculate; +var + I: Integer; +begin + NodesBottom := ClipRect.Top; + VisibleCount := 0; + for I := 0 to Count - 1 do + begin + with Nodes[I] do + begin + UpdatePostCalculate(NodesBottom, I); + Inc(NodesBottom, RealHeight); + SpaceArea.Top := NodesBottom; + if NodesBottom > Self.ClipRect.Bottom then Break; + Inc(VisibleCount); + end; + end; + if VisibleCount = 0 then VisibleCount := 1; + if Count > VisibleCount then Count := VisibleCount + 1; +end; + +procedure TcxTreeListNodesViewInfo.UpdateData; + + procedure CheckNodeIndicator(ANode: TcxTreeListNodeViewInfo); + begin + ANode.Indicator.UpdateKind(ANode.GetNodeIndicatorKind); + end; + +var + I: Integer; +begin + if OptionsView.Indicator then + begin + for I := 0 to Count - 1 do + CheckNodeIndicator(Nodes[I]); + end; +end; + +procedure TcxTreeListNodesViewInfo.UpdateSelectedNodes; +var + I: Integer; +begin + if not TreeList.IsLocked then + begin + CancelUpdatePost; + for I := 0 to Count - 1 do + Nodes[I].Update; + TreeList.DoChanged; + end + else + NeedUpdatePost; +end; + +function TcxTreeListNodesViewInfo.GetGroupViewInfoItemClass: TcxTreeListCellsGroupViewInfoClass; +begin + Result := TcxTreeListCellsGroupViewInfo; +end; + +function TcxTreeListNodesViewInfo.GetEditCellViewInfoItemClass: TcxTreeListEditCellViewInfoClass; +begin + Result := TcxTreeListEditCellViewInfo; +end; + +function TcxTreeListNodesViewInfo.GetIndentViewInfoItemClass: TcxTreeListIndentViewInfoClass; +begin + Result := TcxTreeListIndentViewInfo; +end; + +function TcxTreeListNodesViewInfo.GetNodePreviewViewInfoClass: TcxTreeListNodePreviewViewInfoClass; +begin + Result := TcxTreeListNodePreviewViewInfo; +end; + +function TcxTreeListNodesViewInfo.GetNodeViewInfoClass: TcxTreeListNodeViewInfoClass; +begin + Result := TcxTreeListNodeViewInfo; +end; + +function TcxTreeListNodesViewInfo.GetMaxVisibleIndex: Integer; +begin + Result := TreeList.Nodes.VisibleCount - 1; +end; + +function TcxTreeListNodesViewInfo.GetNextNodeFromViewInfo( + Index: Integer): TcxTreeListNode; +var + ANode: TcxTreeListNode; +begin + if Index < 0 then + Result := nil + else + begin + Result := Nodes[Index].Node; + ANode := Result.GetNextVisibleEx(IsAddFirst); + if ANode = nil then + begin + ChangeDirection; + Result := Nodes[0].Node; + ANode := Result.GetNextVisibleEx(IsAddFirst); + end; + Result := ANode; + end; +end; + +function TcxTreeListNodesViewInfo.GetNextNodeForProcess: TcxTreeListNode; +begin + if IsAddFirst then + Result := GetNextNodeFromViewInfo(0) + else + Result := GetNextNodeFromViewInfo(Count - 1); +end; + +function TcxTreeListNodesViewInfo.GetNodeViewInfo( + Index: Integer): TcxTreeListNodeViewInfo; +begin + Result := TcxTreeListNodeViewInfo(FNodes^[Index]); +end; + +function TcxTreeListNodesViewInfo.GetOptionsView: TcxTreeListOptionsView; +begin + Result := Owner.OptionsView; +end; + +function TcxTreeListNodesViewInfo.GetScrollWindow: Boolean; +begin + Result := False; +end; + +function TcxTreeListNodesViewInfo.GetTopVisibleIndex: Integer; +begin + if TopNode <> nil then + Result := TopNode.VisibleIndex + else + Result := TreeList.Nodes.TopIndex; +end; + +function TcxTreeListNodesViewInfo.GetTreeList: TcxCustomTreeListControl; +begin + Result := Owner.TreeList; +end; + +function TcxTreeListNodesViewInfo.ProcessAddNode( + var ANode: TcxTreeListNode; var IsBreak: Boolean): Integer; +begin + IsBreak := NodesBottom > ClipRect.Bottom; + Result := 0; + if IsBreak then Exit; + Add(ANode, Result); + Inc(NodesBottom, Result); + IsBreak := NodesBottom > ClipRect.Bottom; + ANode := ANode.GetNextVisibleEx(IsAddFirst); +end; + +{ TcxTreeListHitTest } + +function TcxTreeListHitTest.CanMoving: Boolean; +var + ADirection: TcxDragSizingDirection; +begin + Result := (HitAtBandHeader and HitBand.CanMoving) or + (HitAtColumnHeader and HitColumn.CanMoving) and not CanSizing(ADirection); +end; + +function TcxTreeListHitTest.CanSizing: Boolean; +var + ADir: TcxDragSizingDirection; +begin + Result := CanSizing(ADir); +end; + +type + TcxHotTrackControllerAccess = class(TcxHotTrackController); + +function TcxTreeListHitTest.CanSizing( + var ASizeDirection: TcxDragSizingDirection): Boolean; + + function SetValue(Condition: Boolean; ADirection: TcxDragSizingDirection): Boolean; + begin + Result := Condition; + if Result then ASizeDirection := ADirection; + end; + +var + AItem: TObject; + AIntf: IcxDragSizing; + ARect: TRect; +begin + Result := HitAtBandHeader or HitAtColumnHeader or HitAtNode; + if not Result then Exit; + if HitAtBandHeader then + FNewHitTestItem := FHitBand.ViewInfo.FBandHeader + else + if HitAtColumnHeader then + FNewHitTestItem := FHitColumn.ViewInfo.FColumnHeader; + AItem := FNewHitTestItem; + if not HitAtNode then + begin + ARect := TcxCustomViewInfoItem(FNewHitTestItem).VisibleRect; + with ARect do + begin + Result := SetValue(Abs(Right - HitX) <= cxtlHitDelta, dsdHorz) or + SetValue(Abs(Bottom - HitY) <= cxtlHitDelta, dsdVert) + end; + end + else + begin + ARect := HitNode.DisplayRect(False); + FSizingHitNode := HitNode; + if HitNode <> TreeList.TopVisibleNode then + begin + if cxInRange(HitY, ARect.Top - cxtlHitDelta, ARect.Top + cxtlHitDelta) then + begin + FSizingHitNode := HitNode.GetPrevVisible; + ARect := HitNode.DisplayRect(False); + end; + end; + AItem := FSizingHitNode; + with ARect do + Result := SetValue(cxInRange(HitY, Bottom - cxtlHitDelta * 2, + Bottom + cxtlHitDelta), dsdVert); + end; + Result := Result and Supports(AItem, IcxDragSizing, AIntf) and + AIntf.CanSizing(ASizeDirection); +end; + +function TcxTreeListHitTest.AllowDesignMouseEvents( + X, Y: Integer; AShift: TShiftState): Boolean; +begin + Result := inherited AllowDesignMouseEvents(X, Y, AShift); + Result := Result or (TreeList.DragAndDropState <> ddsNone) or HitAtBandContainer or + HitAtBandHeader or HitAtColumnHeader or CanSizing or HitAtButton; +end; + +procedure TcxTreeListHitTest.DoCalculate; +var + ADir: TcxDragSizingDirection; +const + ASizingFlags: array[TcxDragSizingDirection] of Integer = + (tlhc_HitAtSizingHorz, tlhc_HitAtSizingVert); +begin + FHitBand := nil; + FHitColumn := nil; + FHitNode := nil; + FNewHitTestItem := nil; + try + if not cxRectPtIn(TreeList.ClientBounds, HitPoint) then Exit; + with ViewInfo do + begin + NodesViewInfo.PostViewInfoUpdate; + if cxRectPtIn(FSeparators[0], HitPoint) or + cxRectPtIn(FSeparators[1], HitPoint) then SetHitState(tlhc_HitAtSeparator, True); + if not CheckHitInBands then CheckHitInNodes; + end; + if not (HitAtNode and HitAtColumn) then + begin + FNewHitTestItem := GetHitTestItem; + if CanSizing(ADir) then SetHitState(ASizingFlags[ADir], True); + end; + finally + HitTestItem := FNewHitTestItem; + end; +end; + +function TcxTreeListHitTest.Check(const ARect: TRect): Boolean; +begin + Result := cxRectPtIn(ARect, HitPoint); +end; + +function TcxTreeListHitTest.CheckHitInBands: Boolean; +var + I: Integer; +begin + with TreeList.OptionsView do + begin + Result := (HitPoint.Y <= ViewInfo.CellsOffset) or + (Footer and (HitPoint.Y >= ViewInfo.FooterRect.Top)); + end; + if Result then + with ViewInfo do + begin + Result := CheckHitInBand(LeftFixedBand) or CheckHitInBand(RightFixedBand); + if not Result then + for I := 0 to FBandCount - 1 do + if CheckHitInBand(TcxTreeListBandViewInfo(FBands^[I])) then + begin + Result := True; + Break; + end; + end; +end; + +function TcxTreeListHitTest.CheckHitInNodes: Boolean; +var + I: Integer; +begin + with ViewInfo.NodesViewInfo do + begin + Result := VisibleCount > 0; + if Result then + begin + for I := 0 to Count - 1 do + begin + Result := CheckHitInNode(Nodes[I]); + if Result then Break; + end; + end; + end; +end; + +function TcxTreeListHitTest.GetCurrentCursor: TCursor; +var + ADirection: TcxDragSizingDirection; +const + ACursors: array[Boolean, TcxDragSizingDirection] of TCursor = + ((crcxHorzSize, crcxVertSize), (crHSplit, crVSplit)); +begin + Result := inherited GetCurrentCursor; + if (TreeList.DragAndDropState = ddsInProcess) and + not (TreeList.DragAndDropObject is TcxSizingDragAndDropObject) then Exit; + if (Result = crDefault) and CanSizing(ADirection) then + Result := ACursors[TreeList.DragAndDropState <> ddsNone, ADirection]; +end; + +function TcxTreeListHitTest.GetHitTestItem: TObject; +begin + Result := nil; + if HitAtBandHeader and + cxPtInViewInfoItem(FHitBand.ViewInfo.FBandHeader, HitPoint) then + Result := FHitBand.ViewInfo.FBandHeader; + if HitAtColumnHeader and + cxPtInViewInfoItem(FHitColumn.ViewInfo.FColumnHeader, HitPoint) then + Result := FHitColumn.ViewInfo.FColumnHeader; +end; + +function TcxTreeListHitTest.GetState(Index: Integer): Boolean; +begin + Result := (HitState and (1 shl Index)) <> 0; +end; + +procedure TcxTreeListHitTest.HitTestItemChanged(APrevHitTestItem: TObject); + + procedure CheckHeader(AViewInfo: TObject); + begin + if AViewInfo is TcxTreeListHeaderViewInfo then + TcxTreeListHeaderViewInfo(AViewInfo).UpdateState; + end; + +var + AHitPoint: TPoint; +begin + if FLockUpdate then Exit; + FLockUpdate := True; + try + AHitPoint := HitPoint; + if TreeList.DragAndDropState = ddsNone then + begin + CheckHeader(APrevHitTestItem); + CheckHeader(HitTestItem); + end; + inherited HitTestItemChanged(APrevHitTestItem); + finally + HitPoint := AHitPoint; + FLockUpdate := False; + end; +end; + +procedure TcxTreeListHitTest.SetHitState(Index: Integer; Value: Boolean); +begin + if Value then + FHitState := FHitState or (1 shl Index) + else + FHitState := FHitState and not (1 shl Index); +end; + +procedure TcxTreeListHitTest.Update; +var + P: TPoint; +begin + IsMouseEvent := True; + try + HitTestItem := nil; + GetCursorPos(P); + HitPoint := TreeList.ScreenToClient(P); + finally + IsMouseEvent := False; + end; +end; + +function TcxTreeListHitTest.CheckHitInBand(AViewInfo: TcxTreeListBandViewInfo): Boolean; +var + I: Integer; +begin + Result := False; + if AViewInfo = nil then Exit; + with AViewInfo, OptionsView do + begin + I := cxHitDelta(Band.CanSizing(dsdHorz)); + with ClipRect do + Result := cxCheckValue(HitX, Left, Right + I); + if Result then + begin + SetHitState(tlhc_HitAtBand, Result); + FHitBand := AViewInfo.Band; + if Bands or Headers or Footer then + begin + if Bands and HitInItem(BandHeader, tlhc_HitAtBandHeader, I) then Exit; + for I := 0 to FCount - 1 do + if CheckHitInColumn(TcxTreeListColumnViewInfo(FColumns^[I])) then Exit; + if Headers then + SetHitState(tlhc_HitAtBandContainer, + cxCheckValue(HitY, ClipRect.Top, ClipRect.Bottom)); + if Footer then + SetHitState(tlhc_HitAtFooter, + cxCheckValue(HitY, ViewInfo.FooterOffset, ViewInfo.ClientRect.Bottom)); + end; + end; + end; +end; + +function TcxTreeListHitTest.CheckHitInColumn( + AViewInfo: TcxTreeListColumnViewInfo): Boolean; +var + ADelta: Integer; +begin + with AViewInfo, OptionsView do + begin + with Column do + ADelta := cxMax(cxHitDelta(CanSizing(dsdVert)), cxHitDelta(CanSizing(dsdHorz))); + Result := (HitInItem(ColumnFooter, tlhc_HitAtFooterItem)) or + (Headers and HitInItem(ColumnHeader, tlhc_HitAtColumnHeader, ADelta)); + if Result then + begin + FHitColumn := Column; + SetHitState(tlhc_HitAtColumn, True); + end; + end; +end; + +function TcxTreeListHitTest.CheckHitInNode( + AViewInfo: TcxTreeListNodeViewInfo): Boolean; +begin + Result := HitInIndent(AViewInfo); + if AViewInfo.IsGroupNode then + begin + if not Result and HitInItem(AViewInfo.NodeGroupEditViewInfo, tlhc_HitAtColumn) then + begin + SetHitState(tlhc_HitAtBand, True); + FHitColumn := AViewInfo.NodeGroupEditViewInfo.Column; + FNewHitTestItem := AViewInfo.NodeGroupEditViewInfo; + FHitBand := TreeList.VisibleBands[0]; + Result := True; + end + end + else + Result := Result or HitInGroups(AViewInfo) or + (AViewInfo.HasPreview and HitInItem(AViewInfo.Preview, tlhc_HitAtNodePreview)); + Result := Result or (TreeList.OptionsView.Indicator and + HitInItem(AViewInfo.Indicator, tlhc_HitAtIndicator)); + if Result then + begin + SetHitState(tlhc_HitAtNode, True); + FHitNode := AViewInfo.Node; + end; +end; + +function TcxTreeListHitTest.HitInGroup(AViewInfo: TcxTreeListCellsGroupViewInfo): Boolean; + + function CheckHitCell(ACell: TcxTreeListEditCellViewInfo): Boolean; + begin + Result := ACell.Visible and Check(ACell.ClipRect); + if Result then + begin + SetHitState(tlhc_HitAtColumn, True); + FHitColumn := ACell.Column; + FNewHitTestItem := ACell; + end; + end; + +var + I: Integer; +begin + with AViewInfo do + begin + Result := Visible and Check(ClipRect); + if Result then + begin + SetHitState(tlhc_HitAtBand, True); + FHitBand := Band; + for I := 0 to CellCount - 1 do + if CheckHitCell(Cells[I]) then Break; + end; + end; +end; + +function TcxTreeListHitTest.HitInGroups(AViewInfo: TcxTreeListNodeViewInfo): Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to AViewInfo.GroupCount - 1 do + if HitInGroup(AViewInfo.Groups[I]) then + begin + Result := True; + Break; + end; +end; + +function TcxTreeListHitTest.HitInIndent(AViewInfo: TcxTreeListNodeViewInfo): Boolean; +var + I: Integer; +begin + Result := False; + with AViewInfo do + begin + for I := 0 to IndentCount - 1 do + with Indents[I] do + begin + if Check(Indents[I].ClipRect) then + begin + SetHitState(tlhc_HitAtIndent, True); + if not IsLevel then + SetHitState(tlhc_HitAtImage + Byte(IndentStateImage), True) + else + if HasButton and Check(cxRectInflate(ButtonRect, cxtlHitDelta, cxtlHitDelta)) then + SetHitState(tlhc_HitAtButton, True); + if HitAtImage or HitAtStateImage then + SetHitState(tlhc_HitAtIndent, False); + Result := True; + Break; + end; + end; + end; +end; + +function TcxTreeListHitTest.HitInItem( + AItem: TcxCustomViewInfoItem; AState: Integer; ADelta: Integer = 0): Boolean; +begin + Result := (AItem <> nil) and AItem.Visible and + cxRectPtIn(cxRectInflate(AItem.VisibleRect, 0, 0, ADelta, ADelta), HitPoint); + if Result then SetHitState(AState, True); +end; + +function TcxTreeListHitTest.GetHitAtImages: Boolean; +begin + Result := HitAtImage or HitAtStateImage; +end; + +function TcxTreeListHitTest.GetTreeList: TcxCustomTreeListControl; +begin + Result := TcxCustomTreeListControl(Control); +end; + +function TcxTreeListHitTest.GetViewInfo: TcxTreeListViewInfo; +begin + Result := TcxTreeListViewInfo(inherited ViewInfo); +end; + +{ TcxTreeListViewInfo } + +constructor TcxTreeListViewInfo.Create(AOwner: TcxEditingControl); +begin + inherited Create(AOwner); + FooterBrush := TBrush.Create; + GridLinesBrush := TBrush.Create; + SeparatorBrush := TBrush.Create; + HeaderIndicator := GetIndicatorViewInfoClass.Create(Self); + FooterIndicator := GetIndicatorViewInfoClass.Create(Self); + FNodesViewInfo := GetNodesViewInfoClass.Create(Self); + SizingViewInfo := TcxTemporaryCellViewInfo.Create(Self); +end; + +destructor TcxTreeListViewInfo.Destroy; +begin + try + FreeAndNil(SizingViewInfo); + FreeAndNil(HeaderIndicator); + FreeAndNil(FooterIndicator); + FreeMem(FBands); + FreeAndNil(FNodesViewInfo); + finally + FooterBrush.Free; + GridLinesBrush.Free; + SeparatorBrush.Free; + inherited Destroy; + end; +end; + +procedure TcxTreeListViewInfo.InvalidateScrollRect( + ADirection: TcxDragSizingDirection); +begin + if (ADirection = dsdHorz) and ScrollingAreaVisible then + InvalidateRect(ScrollingArea) + else + if ADirection = dsdVert then + with NodesViewInfo.ClipRect do + InvalidateRect(cxRectSetTop(ClientRect, Top, Bottom - Top)); +end; + +procedure TcxTreeListViewInfo.CalculateDefaultHeights; +var + I: Integer; +begin + TreeList.Styles.ContentStyleChanged; + FooterLineHeight := 0; + if BandLineHeight <> 0 then + TreeList.FRealBandLineHeight := BandLineHeight; + HeaderLineHeight := 0; + BandLineHeight := 0; + FillChar(FFixedBands, SizeOf(FFixedBands), 0); + with TreeList do + begin + SetBandCount(VisibleBandCount); + FBandCount := 0; + for I := 0 to VisibleBandCount - 1 do SetBandViewParams(VisibleBands[I], I); + HeaderLineHeight := LookAndFeelPainter.HeaderHeight(cxTextHeight(TreeList.Font)); + if VisibleColumnCount = 0 then + TreeList.FHeaderLineCount := 0 + else + for I := 0 to VisibleColumnCount - 1 do SetColumnViewParams(VisibleColumns[I]); + HorzScrollInc := cxTextWidth(Font, 'W'); + if (VisibleBandCount > 0) then + cxSetMax(BandLineHeight, LookAndFeelPainter.HeaderHeight(cxTextHeight(TreeList.Font))); + end; + if FooterLineHeight = 0 then + with LookAndFeelPainter do + FooterLineHeight := HeaderHeight(cxTextHeight(TreeList.Font)) + FooterCellBorderSize; + inherited CalculateDefaultHeights; + if BandLineHeight <> 0 then + TreeList.FRealBandLineHeight := BandLineHeight; +end; + +function TcxTreeListViewInfo.CalculateDefaultEditHeight: Integer; + + function GetColumnEditHeight(AColumn: TcxTreeListColumn): Integer; + begin + with AColumn, Styles do + begin + Result := GetEditDefaultHeight(ContentParams[True].Font); + cxSetMax(Result, GetEditDefaultHeight(ContentParams[False].Font)); + end; + end; + +var + I: Integer; + +begin + Result := 0; + with TreeList do + begin + for I := 0 to VisibleColumnCount - 1 do + Result := cxMax(Result, GetColumnEditHeight(VisibleColumns[I])); + Inc(Result, OptionsView.VertIncrement + cxTreeListEditCellHeightOffset); + Self.FDefaultRowHeight := Result + cxTextOffset; + if Images <> nil then + cxSetMax(Result, GetImageListHeight(Images)); + if StateImages <> nil then + cxSetMax(Result, GetImageListHeight(StateImages)); + end; +end; + +procedure TcxTreeListViewInfo.CalculateDefaultViewParams; + + function GetBitmap(AStyle: TcxStyle): TBitmap; + begin + if AStyle <> nil then + Result := AStyle.Bitmap + else + Result := nil; + end; + +begin + IndicatorViewParams := TreeList.Styles.GetIndicatorParams; + with BrushManager, OptionsView, LookAndFeelPainter do + begin + Self.TreeLineColor := cxGetNativeColor(TreeLineColor, DefaultGridLineColor); + GridLinesBrush.Color := cxGetNativeColor(GridLineColor, DefaultGridLineColor); + if TreeLineColor <> clDefault then + Self.TreeLineColor := ColorToRGB(TreeLineColor); + SeparatorBrush.Color := + cxGetNativeColor(FixedSeparatorColor, DefaultFixedSeparatorColor); + BackgroundBitmap := GetBitmap(TreeList.Styles.Background); + FooterBitmap := GetBitmap(TreeList.Styles.Footer); + end; +end; + +procedure TcxTreeListViewInfo.CalculateHeaderFooterViewInfo; +var + I: Integer; + AOfs: Integer; + R: TRect; +begin + FScrollingArea := ClientRect; + AOfs := cxRectWidth(ClientRect) - cxRectWidth(PrevClientRect); + if (PrevHorzScrollSize - HorzScrollPos - HorzScrollPage) < AOfs then + begin + Dec(HorzScrollPos, AOfs); + cxValidateIntDef(HorzScrollPos, 0, PrevHorzScrollSize); + end; + R := Rect(0, BorderSize, 0, BorderSize + BandLineHeight * OptionsView.BandLineCount + + HeaderLineHeight * TreeList.HeaderLineCount);//CellsOffset); + AOfs := ContentOffset; + if LeftFixedBand = nil then Dec(AOfs, HorzScrollPos); + if OptionsView.Footer and (TreeList.VisibleColumnCount > 0) then + begin + with TreeList do + begin + FooterColor := Styles.GetFooterParams.Color; + FooterBrush.Color := FooterColor; + end; + with ClientRect, LookAndFeelPainter do + FooterRect := cxRectInflate(cxRect(ContentOffset, FooterOffset, Right, Bottom), + -FooterBorderSize, -FooterBorderSize); + end; + for I := 0 to VisibleBandCount - 1 do + with VisibleBands[I] do + begin + AOfs := CalcBandRect(R, DisplayWidth, AOfs, Fixed); + Calculate(R, ClientRect); + end; + with OptionsView do + begin + if Indicator then Inc(HorzScrollSize, IndicatorWidth); + if (TreeList.VisibleColumnCount = 0) and not Bands then HorzScrollSize := 0; + end; +end; + +procedure TcxTreeListViewInfo.CheckScrolling; +var + R: TRect; +begin + HorzScrollPage := cxRectWidth(ClientRect); + if HorzScrollSize < (HorzScrollPage + HorzScrollPos) then + HorzScrollPos := HorzScrollSize - HorzScrollPage; + if HorzScrollSize <= HorzScrollPage then + begin + HorzScrollPos := 0; + HorzScrollSize := 0; + end + else + cxValidateIntDef(HorzScrollPos, 0, HorzScrollSize - HorzScrollPage + 1); + FScrollingAreaVisible := cxRectIntersect(R, ClientRect, FScrollingArea) or + (ContentRect.Right >= ClientRect.Right); +end; + +procedure TcxTreeListViewInfo.DoCalculate; +begin + inherited DoCalculate; + IsDirty := False; + ExpandButtonSize := LookAndFeelPainter.SmallExpandButtonSize; + HorzScrollSize := 0; + FillChar(FSeparators, SizeOf(FSeparators), 0); + CalculateHeaderFooterViewInfo; + CalculateCellRects; + CheckScrolling; + PrevHorzScrollSize := HorzScrollSize; + NodesViewInfo.DoCalculate; + HeaderRect := ClientRect; + HeaderRect.Bottom := CellsOffset; + cxCalcSeparators(HeaderSeparators, FSeparators, cxRectSetHeight(ClientRect, CellsOffset)); + cxCalcSeparators(FooterSeparators, FSeparators, + cxRectInflate(cxRectSetTop(ClientRect, FooterOffset), 0, -LookAndFeelPainter.FooterBorderSize)); + HeaderIndicator.Calculate(HeaderRect, HeaderRect); + HeaderIndicator.ItemViewParams.Color := TreeList.Styles.GetIndicatorParams().Color; + FooterRect.Right := ContentRect.Right; + FooterIndicator.Calculate( + cxRectInflate(FooterRect, 0, LookAndFeelPainter.FooterBorderSize), ClientRect); + FooterIndicator.ItemViewParams := TreeList.Styles.GetIndicatorParams; + CalculateDefaultViewParams; + PrevClientRect := ClientRect; +end; + +procedure TcxTreeListViewInfo.DoScrollHorizontal(APos: Integer); +var + I: Integer; +begin + try + for I := 0 to BandCount - 1 do + Bands[I].DoHorzOffset(HorzScrollPos - APos); + NodesViewInfo.DoHorzOffset(HorzScrollPos - APos); + finally + HorzScrollPos := APos; + InvalidateScrollRect(dsdHorz); + end; +end; + +procedure TcxTreeListViewInfo.DoScrollVertical(APos: Integer); +begin + TreeList.Nodes.CalculateInfo(False); + NodesViewInfo.DoVertOffset(APos); + NodesViewInfo.NeedViewInfoUpdatePost; + InvalidateScrollRect(dsdVert); + NodesViewInfo.SynchronizeTopNode; +end; + +function TcxTreeListViewInfo.GetIndicatorViewInfoClass: TcxTreeListIndicatorViewInfoClass; +begin + Result := TcxTreeListIndicatorViewInfo; +end; + +function TcxTreeListViewInfo.GetNodesViewInfoClass: TcxTreeListNodesViewInfoClass; +begin + Result := TcxTreeListNodesViewInfo; +end; + +procedure TcxTreeListViewInfo.InvalidateRect(const ARect: TRect); +begin + with TreeList do + if not IsLocked then InvalidateRect(ARect, False); +end; + +procedure TcxTreeListViewInfo.UpdateSelection; +begin + inherited UpdateSelection; + NodesViewInfo.UpdateSelectedNodes; +end; + +procedure TcxTreeListViewInfo.UpdateFootersViewInfo; +var + I: Integer; +begin + with TreeList do + begin + for I := 0 to ColumnCount - 1 do + Columns[I].ViewInfo.FColumnFooter.Invalidate(False); + end; +end; + +function TcxTreeListViewInfo.GetBand(AIndex: Integer): TcxTreeListBandViewInfo; +begin + Result := TcxTreeListBandViewInfo(FBands^[AIndex]); +end; + +function TcxTreeListViewInfo.GetBorderSize: Integer; +begin + Result := TreeList.BorderSize; +end; + +function TcxTreeListViewInfo.GetBrushManager: TcxBrushCache; +begin + Result := TreeList.BrushCache; +end; + +function TcxTreeListViewInfo.GetCellsHeight: Integer; +begin + Result := FooterOffset - CellsOffset; +end; + +function TcxTreeListViewInfo.GetCellsOffset: Integer; +begin + with TreeList, OptionsView do + Result := HeaderOffset + Byte(Headers) * HeaderLineHeight * HeaderLineCount; +end; + +function TcxTreeListViewInfo.GetContentOffset: Integer; +begin + with OptionsView do + Result := BorderSize + Byte(Indicator) * IndicatorWidth; +end; + +function TcxTreeListViewInfo.GetDefaultHeight: Integer; +begin + Result := DefaultEditHeight; + if TreeList.FDefaultRowHeight <> 0 then + Result := TreeList.FDefaultRowHeight; +end; + +function TcxTreeListViewInfo.GetFooterOffset: Integer; +begin + with TreeList, LookAndFeelPainter do + Result := Self.ClientRect.Bottom - + Byte(OptionsView.Footer) * Byte(TreeList.VisibleColumnCount > 0) * + (HeaderLineCount * FooterLineHeight + FooterBorderSize shl 1); +end; + +function TcxTreeListViewInfo.GetHeaderOffset: Integer; +begin + with OptionsView do + Result := BorderSize + Byte(Bands) * BandLineHeight * BandLineCount; +end; + +function TcxTreeListViewInfo.GetOptionsView: TcxTreeListOptionsView; +begin + Result := TreeList.OptionsView; +end; + +function TcxTreeListViewInfo.GetTreeList: TcxCustomTreeListControl; +begin + Result := TcxCustomTreeListControl(Control) +end; + +function TcxTreeListViewInfo.GetVisibleBand(Index: Integer): TcxTreeListBandViewInfo; +begin + Result := TreeList.VisibleBands[Index].ViewInfo; +end; + +function TcxTreeListViewInfo.GetVisibleBandCount: Integer; +begin + Result := TreeList.VisibleBandCount; +end; + +procedure TcxTreeListViewInfo.SetBandCount(ACount: Integer); +begin + if ACount > FBandCapacity then + ReallocMem(FBands, ACount * SizeOf(Pointer)); + FBandCount := ACount; +end; + +procedure TcxTreeListViewInfo.SetBandViewParams( + ABand: TcxTreeListBand; Index: Integer); +begin + if ABand.FixedKind = tlbfNone then + begin + FBands^[FBandCount] := ABand.ViewInfo; + Inc(FBandCount); + end + else + FFixedBands[Byte(ABand.FixedKind) - 1] := ABand.ViewInfo; + with ABand.ViewInfo, TreeList.Styles do + begin + ItemViewParams := SetHeaderSizeValue(GetBandHeaderParams(ABand), + BandLineHeight, OptionsView.Bands); + FContainerViewParams := GetBandBackgroundParams(ABand); + end; +end; + +procedure TcxTreeListViewInfo.SetColumnViewParams(AColumn: TcxTreeListColumn); +begin + with AColumn.ViewInfo, TreeList.Styles, OptionsView do + begin + FColumnHeader.ItemViewParams := + SetHeaderSizeValue(GetColumnHeaderParams(AColumn), Self.HeaderLineHeight, Headers); + with Painter.Painter do + FColumnFooter.ItemViewParams := SetHeaderSizeValue(GetColumnFooterParams(AColumn), + Self.FooterLineHeight, Footer, FooterCellBorderSize shl 1); + end; +end; + +function TcxTreeListViewInfo.CalcBandRect(var ARect: TRect; + AWidth, AOfs: Integer; Fixed: TcxTreeListBandFixedKind): Integer; +begin + with OptionsView do + begin + Inc(HorzScrollSize, AWidth); + if Fixed = tlbfRight then + begin + Inc(AOfs, FFixedSeparatorWidth); + if AOfs > (ClientRect.Right - AWidth) then + AOfs := ClientRect.Right - AWidth; + if (LeftFixedBand <> nil) and (AOfs < FSeparators[0].Right) then + AOfs := FSeparators[0].Right; + FSeparators[1] := cxRectSetWidth(ClientRect, + AOfs - FixedSeparatorWidth, FixedSeparatorWidth); + FScrollingArea.Right := FSeparators[1].Left; + Inc(HorzScrollSize, FixedSeparatorWidth); + end; + Result := AOfs + AWidth; + ARect.Left := AOfs; + ARect.Right := Result; + if Fixed = tlbfLeft then + begin + FSeparators[0] := cxRectSetWidth(ClientRect, + Result, FixedSeparatorWidth); + Result := FSeparators[0].Right - HorzScrollPos; + FScrollingArea.Left := FSeparators[0].Right; + Inc(HorzScrollSize, FixedSeparatorWidth); + end; + end; +end; + +procedure TcxTreeListViewInfo.CalculateCellRects; + + procedure CheckBounds(ADefInfo: TcxTreeListBandViewInfo; + AIndex: Integer; var ALeft, ARight: Integer); + var + AInfo: TcxTreeListBandViewInfo; + begin + AInfo := nil; + if ADefInfo <> nil then + AInfo := ADefInfo + else + if (AIndex < FBandCount) and (AIndex <> cxInvalidIndex) then + AInfo := TcxTreeListBandViewInfo(FBands^[AIndex]); + if (AInfo <> nil) and ((ALeft > AInfo.DisplayRect.Left) or (ALeft = -1)) then + ALeft := AInfo.DisplayRect.Left; + if (AInfo <> nil) and (ARight < AInfo.DisplayRect.Right) then + ARight := AInfo.DisplayRect.Right; + end; + +begin + CellsRect := cxInvalidRect; + CheckBounds(LeftFixedBand, 0, CellsRect.Left, CellsRect.Right); + CheckBounds(RightFixedBand, FBandCount - 1, CellsRect.Left, CellsRect.Right); + CellsRect.Top := CellsOffset; + CellsRect.Bottom := FooterOffset; + ContentRect := CellsRect; + if ContentRect.Right > ClientRect.Right then + ContentRect.Right := ClientRect.Right; + FooterRect.Right := ClientRect.Right; + PreviewHeight := 0; +end; + +function TcxTreeListViewInfo.SetHeaderSizeValue(const ViewParams: TcxViewParams; + var ASize: Integer; CheckSize: Boolean; Delta: Integer = 0): TcxViewParams; +begin + Result := ViewParams; + if CheckSize then + begin + with ViewParams do + Delta := Delta shl 1 + LookAndFeelPainter.HeaderHeight(cxTextHeight(Font)); + if Delta > ASize then ASize := Delta; + end; +end; + +{ TcxTreeListControlPainter } + +procedure TcxTreeListControlPainter.AfterCustomDraw( + AViewInfo: TcxCustomViewInfoItem); +begin + if AViewInfo is TcxTreeListEditCellViewInfo then + AfterCustomDraw(TcxTreeListEditCellViewInfo(AViewInfo)) +end; + +procedure TcxTreeListControlPainter.AfterCustomDraw( + AViewInfo: TcxTreeListEditCellViewInfo); +begin + with AViewInfo.EditViewInfo do + begin + BackgroundColor := Canvas.Brush.Color; + TextColor := Canvas.Font.Color; + end; +end; + +procedure TcxTreeListControlPainter.BeforeCustomDraw( + AViewInfo: TcxCustomViewInfoItem); +begin + if AViewInfo is TcxTreeListEditCellViewInfo then + BeforeCustomDraw(TcxTreeListEditCellViewInfo(AViewInfo)) +end; + +procedure TcxTreeListControlPainter.BeforeCustomDraw( + AViewInfo: TcxTreeListEditCellViewInfo); +begin + with AViewInfo.EditViewInfo do + begin + if AViewInfo.ViewParams.Font <> nil then + begin + Canvas.Brush.Color := AViewInfo.ViewParams.Color; + if AViewInfo.EditViewInfo.Font <> nil then + Canvas.Font := AViewInfo.EditViewInfo.Font; + Canvas.Font.Color := TextColor; + end; + end; +end; + +function TcxTreeListControlPainter.DoCustomDrawEx(AViewInfoItem: TcxCustomViewInfoItem; + AEvent: TcxCustomDrawViewInfoItemEvent; AExclude: Boolean): Boolean; +begin + Result := DoCustomDraw(AViewInfoItem, AEvent); + if Result and AExclude then + Canvas.ExcludeClipRect(AViewInfoItem.VisibleRect); +end; + +procedure TcxTreeListControlPainter.DoPaint; +begin + if TreeList.IsLocked then + inherited DoPaint + else + begin + with ViewInfo, ContentRect do + begin + if Right < ClientRect.Right then + DrawBackgroundRect(cxRectSetLeft(ClientRect, Right, ClientRect.Right - Right)); + end; + if Bands or Headers then DrawHeader; + if IsFooterVisible then DrawFooter; + ContentClipRegion := Canvas.GetClipRegion; + try + DrawNodes; + finally + FreeAndNil(ContentClipRegion); + end; + end; +end; + +function TcxTreeListControlPainter.DoPaintBackground( + ACanvas: TcxCanvas; const ABounds: TRect): Boolean; +begin + Result := CurrentBitmap <> nil; + if Result then + ACanvas.FillRect(ABounds, CurrentBitmap); + CurrentBitmap := nil; +end; + +procedure TcxTreeListControlPainter.DrawBackgroundRect(const R: TRect); +var + ADone: Boolean; +begin + if cxRectIsEmpty(R) or not Canvas.RectVisible(R) then Exit; + ADone := False; + if Assigned(TreeList.FOnCustomDrawBackground) then + TreeList.FOnCustomDrawBackground(TreeList, Canvas, R, ADone); + if not ADone then + DrawRect(R, BackgroundBrush, ViewInfo.BackgroundBitmap); +end; + +procedure TcxTreeListControlPainter.DrawBandItem(AViewInfo: TcxTreeListBandViewInfo); +var + I: Integer; +begin + if not DoCustomDraw(AViewInfo, nil) then + begin + with AViewInfo do + begin + if Buffered then + DrawHeaderRect(VisibleRect, AViewInfo); + if Bands then + DrawHeaderItem(AViewInfo.BandHeader, Opaque); + if Headers then + for I := 0 to AViewInfo.ColumnCount - 1 do + DrawHeaderItem(AViewInfo.Columns[I].ColumnHeader, Opaque); + if not Buffered and not Opaque then + DrawHeaderRect(VisibleRect, AViewInfo); + end; + end; +end; + +procedure TcxTreeListControlPainter.DrawBandFooter( + AViewInfo: TcxTreeListBandViewInfo); + + procedure DoDrawBandFooterItem; + var + I: Integer; + begin + for I := 0 to AViewInfo.ColumnCount - 1 do + DrawFooterItem(AViewInfo.Columns[I].ColumnFooter); + end; + +begin + if (AViewInfo = nil) or not AViewInfo.Visible then Exit; + if Buffered then + begin + DrawFooterRect(AViewInfo.FooterRect, AViewInfo); + DoDrawBandFooterItem; + end + else + begin + DoDrawBandFooterItem; + DrawFooterRect(AViewInfo.FooterRect, AViewInfo); + end +end; + +procedure TcxTreeListControlPainter.DrawCellsGroup( + AViewInfo: TcxTreeListCellsGroupViewInfo); +var + I: Integer; +begin + with AViewInfo do + begin + if not Visible or not Canvas.RectVisible(ClipRect) then Exit; + if Buffered and not IsOpaque and not DoCustomDraw(AViewInfo, + TcxCustomDrawViewInfoItemEvent(TreeList.FOnCustomDrawCellsGroup)) then + DrawRectWithBorders(DisplayRect, CurrentBrush, Opaque, Borders, GetGroupBitmap); + for I := 0 to AViewInfo.CellCount - 1 do + DrawEditCell(Cells[I], Opaque); + if not Buffered and not IsOpaque and not DoCustomDraw(AViewInfo, + TcxCustomDrawViewInfoItemEvent(TreeList.FOnCustomDrawCellsGroup)) then + DrawRectWithBorders(DisplayRect, CurrentBrush, Opaque, Borders, GetGroupBitmap); + DrawRectWithBorders(DisplayRect, CurrentBrush, True, Borders, GetGroupBitmap); + end; +end; + +procedure TcxTreeListControlPainter.DrawEditCell( + AViewInfo: TcxTreeListEditCellViewInfo; IsOpaque: Boolean); +var + AEvent: TcxCustomDrawViewInfoItemEvent; + AFont: TFont; + ADone: Boolean; +begin + if Canvas.RectVisible(AViewInfo.DisplayRect) then + begin + ADone := False; + DrawRectWithBorders(AViewInfo.DisplayRect, nil, True, AViewInfo.Borders); + BeforeCustomDraw(AViewInfo); + if Assigned(TreeList.FOnCustomDrawCell) then + TreeList.FOnCustomDrawCell(TreeList, Canvas, AViewInfo, ADone); + AfterCustomDraw(AViewInfo); + if not ADone then + begin + if (AViewInfo.ViewParams.Bitmap <> nil) and not AViewInfo.Selected then + Canvas.FillRect(AViewInfo.ContentRect, AViewInfo.ViewParams.Bitmap); + AFont := AViewInfo.EditViewInfo.Font; + AViewInfo.EditViewInfo.Font := Canvas.Font; + AViewInfo.CustomDrawEvent(AEvent); + if not DoCustomDraw(AViewInfo, AEvent) then + AViewInfo.ViewInfo.PaintEx(Canvas); + AViewInfo.EditViewInfo.Font := AFont; + end; + if not Buffered and not IsOpaque then + Canvas.ExcludeClipRect(AViewInfo.ClipRect); + end; +end; + +procedure TcxTreeListControlPainter.DrawExpandButton( + const ARect: TRect; AExpanded: Boolean; ABitmap: TBitmap); +begin + if ABitmap <> nil then + Canvas.FillRect(ARect, ABitmap) + else + Canvas.FillRect(ARect); + Canvas.Brush.Color := TreeLineColor; + Painter.DrawSmallExpandButton(Canvas, ARect, AExpanded, TreeLineColor); +end; + +procedure TcxTreeListControlPainter.DrawFocusRect( + AViewInfo: TcxTreeListNodeViewInfo); +var + R, R1: TRect; +begin + R := AViewInfo.FocusRect; + if AViewInfo.NodeFocusedCell <> nil then + begin + if TreeList.Controller.IsEditing then Exit; + R1 := AViewInfo.NodeFocusedCell.ClipRect + end + else + R1 := AViewInfo.ContentRect; + if cxRectIntersect(R1, R, R1) then + begin + RestoreClipping; + Canvas.IntersectClipRect(R1); + try + if TreeList.IsFocused then + Self.Canvas.DrawFocusRect(R) + else + if not TreeList.OptionsSelection.HideFocusRect then + Self.Canvas.InvertFrame(R, 1); + finally + RestoreClipping; + end; + end; +end; + +procedure TcxTreeListControlPainter.DrawFooter; +var + R: TRect; + I: Integer; + ARegion: TcxRegion; +begin + ARegion := Canvas.GetClipRegion; + if Indicator then + DrawIndicator(ViewInfo.FooterIndicator); + with ViewInfo do + try + DrawSeparators(FooterSeparators); + DrawBandFooter(LeftFixedBand); + DrawBandFooter(RightFixedBand); + if (BandCount > 0) and ScrollingAreaVisible then + Canvas.IntersectClipRect(ScrollingArea); + for I := 0 to BandCount - 1 do DrawBandFooter(Bands[I]); + finally + Canvas.SetClipRegion(ARegion, roSet); + with Self.Painter do + R := cxRectInflate(ViewInfo.FooterRect, FooterBorderSize, + FooterBorderSize, 0, FooterBorderSize); + Self.Painter.DrawFooterSeparator(Canvas, + cxRectSetHeight(R, Self.Painter.FooterBorderSize)); + Self.Painter.DrawFooterBorder(Canvas, R); + R.Left := ViewInfo.ClientRect.Left; + Canvas.ExcludeClipRect(R); + end; +end; + +procedure TcxTreeListControlPainter.DrawFooterItem( + AViewInfo: TcxTreeListFooterItemViewInfo); +begin + with AViewInfo do + begin + if Visible and Canvas.RectVisible(AViewInfo.VisibleRect) then + begin + if not Buffered and not Painter.FooterDrawCellsFirst then + DrawFooterRect(ClipRect, AViewInfo.BandViewInfo); + if not DoCustomDraw(AViewInfo, + TcxCustomDrawViewInfoItemEvent(TreeList.FOnCustomDrawFooterCell)) then + begin + CurrentBitmap := ViewParams.Bitmap; + with ViewParams do + Painter.DrawFooterCell(Canvas, DisplayRect, AlignHorz, AlignVert, + MultiLine, Text, Font, TextColor, Color, DoPaintBackground); + end; + if not Buffered then Canvas.ExcludeClipRect(ClipRect); + end; + end; +end; + +procedure TcxTreeListControlPainter.DrawFooterRect( + const R: TRect; AViewInfo: TcxTreeListBandViewInfo); +var + ADone: Boolean; + R1, R2: TRect; +begin + if not (AViewInfo.Visible and Canvas.RectVisible(R)) then Exit; + ADone := False; + if Assigned(TreeList.FOnCustomDrawFooter) then + begin + R1 := AViewInfo.DisplayRect; + R2 := AViewInfo.VisibleRect; + AViewInfo.DisplayRect := cxRectSetTop(R1, R.Top); + AViewInfo.ClipRect := R; + try + TreeList.FOnCustomDrawFooter(Control, Canvas, AViewInfo, ADone); + finally + AViewInfo.DisplayRect := R1; + AViewInfo.ClipRect := R2; + end; + end; + if not ADone then + begin + Canvas.SaveClipRegion; + try + Canvas.SetClipRegion(TcxRegion.Create(R), roIntersect); + Painter.DrawFooterContent(Canvas, R, AViewInfo.FFooterViewParams); + finally + Canvas.RestoreClipRegion; + end; + end; +end; + +procedure TcxTreeListControlPainter.DrawHeader; +var + I: Integer; + ARegion: TcxRegion; + + procedure DrawEdgeBorder(AItem: TcxTreeListBandViewInfo); + begin + if not AItem.Opaque then + Canvas.FrameRect(AItem.DisplayRect, clBtnShadow, 1, [bRight]); + end; + +begin + ARegion := Canvas.GetClipRegion; + with ViewInfo do + try + if Indicator and (Self.Bands or Self.Headers) then + DrawIndicator(HeaderIndicator); + DrawSeparators(HeaderSeparators); + DrawBandItem(LeftFixedBand); + DrawBandItem(RightFixedBand); + if (BandCount > 0) and ScrollingAreaVisible then + Canvas.IntersectClipRect(ScrollingArea); + for I := 0 to BandCount - 1 do + DrawBandItem(Bands[I]); + if RightFixedBand <> nil then + DrawEdgeBorder(RightFixedBand) + else + if BandCount > 0 then + DrawEdgeBorder(Bands[BandCount - 1]) + finally + Canvas.SetClipRegion(ARegion, roSet); + Canvas.ExcludeClipRect(HeaderRect); + end; +end; + +procedure TcxTreeListControlPainter.DrawHeaderItem( + AViewInfo: TcxTreeListHeaderViewInfo; IsOpaque: Boolean); +var + AEvent: TcxCustomDrawViewInfoItemEvent; + AClipRgn: TcxRegion; +begin + if (AViewInfo = nil) or not Canvas.RectVisible(AViewInfo.ClipRect) then Exit; + with AViewInfo, LookAndFeelPainter do + begin + if not Buffered and not LookAndFeelPainter.HeaderDrawCellsFirst and + (BandViewInfo <> nil) and (BandViewInfo.ContainerBrush <> nil) then + DrawHeaderRect(ClipRect, BandViewInfo); + AViewInfo.CustomDrawEvent(AEvent); + if not DoCustomDrawEx(AViewInfo, AEvent, False) then + begin + CurrentBitmap := ViewParams.Bitmap; + with ViewParams do + ExtDrawHeader(Canvas, GetDisplayRect, TextBounds, Neighbors, Borders, State, AlignHorz, + AlignVert, MultiLine, ShowEndEllipsis, Text, Font, TextColor, Color, DoPaintBackground); + if not Glyph.Empty then + begin + AClipRgn := nil; + if NeedGlyphClipping then + begin + AClipRgn := Canvas.GetClipRegion; + Canvas.IntersectClipRect(ClipRect); + end; + Canvas.DrawGlyph(GlyphPos.X, GlyphPos.Y, Glyph); + if NeedGlyphClipping then Canvas.SetClipRegion(AClipRgn, roSet); + end; + if SortOrder <> soNone then + DrawSortingMark(Canvas, FSortMarkBounds, SortOrder = soAscending); + if State = cxbsPressed then + DrawHeaderPressed(Canvas, DisplayRect); + end; + if Selected then + begin + Canvas.DrawFocusRect(cxRectInflate(GetDisplayRect, -1, -1)); + Canvas.DrawFocusRect(cxRectInflate(GetDisplayRect, -2, -2)); + end; + if not Buffered and not IsOpaque then Canvas.ExcludeClipRect(ClipRect); + end; +end; + +procedure TcxTreeListControlPainter.DrawHeaderRect(const R: TRect; + AViewInfo: TcxTreeListBandViewInfo); +begin + if not DoCustomDraw(AViewInfo, + TcxCustomDrawViewInfoItemEvent(TreeList.FOnCustomDrawHeader)) then + begin + DrawRect(R, AViewInfo.ContainerBrush, AViewInfo.ContainerViewParams.Bitmap); + Canvas.FrameRect(R, clBtnShadow, 1, [bBottom]); + end; +end; + +procedure TcxTreeListControlPainter.DrawImage( + AViewInfo: TcxTreeListIndentViewInfo); +var + R: TRect; +begin + with AViewInfo do + begin + R := DisplayRect; + Dec(R.Right, cxTreeListIndentOffsetSize div 2); + R := cxRectCenter(R, ImageList.Width, ImageList.Height); + if not IsRectEmpty(R) then + begin + ImageList.DrawingStyle := dsTransparent; + ImageList.Draw(Canvas.Canvas, R.Left, R.Top, ImageIndex); + end; + end; +end; + +procedure TcxTreeListControlPainter.DrawIndicator( + AViewInfo: TcxTreeListIndicatorViewInfo); +var + APainter: TcxCustomLookAndFeelPainterClass; +begin + if not AViewInfo.Visible then Exit; + if not DoCustomDraw(AViewInfo, + TcxCustomDrawViewInfoItemEvent(TreeList.FOnCustomDrawIndicatorCell)) then + begin + APainter := Painter; + CurrentBitmap := AViewInfo.ViewParams.Bitmap; + if (AViewInfo = ViewInfo.HeaderIndicator) or (AViewInfo = ViewInfo.FooterIndicator) then + with AViewInfo do + ExtDrawHeader(Canvas, DisplayRect, DisplayRect, [], cxBordersAll, cxbsDefault, + taLeftJustify, vaTop, False, False, '', nil, clDefault, ViewParams.Color, + DoPaintBackground) + else + with AViewInfo do + begin + if TreeList.OptionsView.IsExtPaintStyle then + APainter.DrawIndicatorItemEx(Canvas, DisplayRect, Kind, ViewParams.Color, DoPaintBackground) + else + APainter.DrawIndicatorItem(Canvas, DisplayRect, Kind, ViewParams.Color, DoPaintBackground); + end; + end; + Canvas.ExcludeClipRect(AViewInfo.ClipRect); + if ContentClipRegion <> nil then + ContentClipRegion.Combine(TcxRegion.Create(AViewInfo.ClipRect), roSubtract); +end; + +procedure TcxTreeListControlPainter.DrawNode(AViewInfo: TcxTreeListNodeViewInfo); + + function DoDrawFixedGroup(AGroup: TcxTreeListCellsGroupViewInfo): Boolean; + begin + Result := AGroup <> nil; + if Result then DrawCellsGroup(AGroup); + end; + +var + I, AFromIndex, AToIndex: Integer; +begin + if Indicator then DrawIndicator(AViewInfo.Indicator); + if not Canvas.RectVisible(AViewInfo.ContentRect) then Exit; + for I := AViewInfo.IndentCount - 1 downto 0 do + DrawNodeIndent(AViewInfo.Indents[I]); + AFromIndex := 0; + if not AViewInfo.IsGroupNode then + begin + AToIndex := AViewInfo.GroupCount - 1; + DrawSeparators(AViewInfo.Separators); + Inc(AFromIndex, Byte(DoDrawFixedGroup(AViewInfo.LeftFixedGroup))); + Dec(AToIndex, Byte(DoDrawFixedGroup(AViewInfo.RightFixedGroup))); + end + else + AToIndex := -1; + if AViewInfo.HasPreview then + DrawNodePreview(AViewInfo.Preview); + try + DrawNodeCells(AViewInfo, AFromIndex, AToIndex); + finally + RestoreClipping; + if AViewInfo.Focused then DrawFocusRect(AViewInfo); + DrawBackgroundRect(AViewInfo.UnusedArea); + end; +end; + +procedure TcxTreeListControlPainter.DrawNodeCells( + AViewInfo: TcxTreeListNodeViewInfo; AFromIndex, AToIndex: Integer); +begin + if not AViewInfo.IsGroupNode then + begin + if Self.ViewInfo.ScrollingAreaVisible then + Canvas.IntersectClipRect(Self.ViewInfo.ScrollingArea); + while AFromIndex <= AToIndex do + begin + DrawCellsGroup(AViewInfo.Groups[AFromIndex]); + Inc(AFromIndex); + end; + end + else + DrawEditCell(AViewInfo.NodeGroupEditViewInfo, True); +end; + +procedure TcxTreeListControlPainter.DrawNodeIndent( + AViewInfo: TcxTreeListIndentViewInfo); +begin + if DoCustomDraw(AViewInfo, + TcxCustomDrawViewInfoItemEvent(TreeList.FOnCustomDrawIndentCell)) then Exit; + with AViewInfo do + begin + DrawRectWithBorders(DisplayRect, Brush, False, Borders, ViewParams.Bitmap); + if IsLevel then + begin + DrawTreeLines(AViewInfo); + if HasButton then + DrawExpandButton(ButtonRect, IsExpanded, ViewParams.Bitmap); + end + else + if HasImage then DrawImage(AViewInfo); + end; +end; + +procedure TcxTreeListControlPainter.DrawNodePreview( + AViewInfo: TcxTreeListNodePreviewViewInfo); +begin + DrawEditCell(AViewInfo, False) +end; + +procedure TcxTreeListControlPainter.DrawNodes; +var + I: Integer; +begin + with ViewInfo.NodesViewInfo do + begin + for I := 0 to Count - 1 do DrawNode(Nodes[I]); + DrawBackgroundRect(SpaceArea); + end; +end; + +procedure TcxTreeListControlPainter.DrawRect(AViewInfo: TcxTreeListViewInfoItem); +begin + with AViewInfo do DrawRect(ClipRect, Brush, ViewParams.Bitmap); +end; + +procedure TcxTreeListControlPainter.DrawRect( + const ARect: TRect; ABrush: TBrush; ABitmap: TBitmap = nil); +begin + if cxRectIsEmpty(ARect) then Exit; + if (ABitmap <> nil) and not ABitmap.Empty then + Canvas.FillRect(ARect, ABitmap) + else + begin + Canvas.Brush := ABrush; + Canvas.FillRect(ARect); + end; +end; + +procedure TcxTreeListControlPainter.DrawRectWithBorders(const ARect: TRect; + ABrush: TBrush; IsOpaque: Boolean; ABorders: TcxBorders = []; ABitmap: TBitmap = nil); +begin + with ARect do + begin + if bLeft in ABorders then + DrawRect(cxRect(Left, Top, Left + 1, Bottom), GridLinesBrush); + if bRight in ABorders then + DrawRect(cxRect(Right - 1, Top, Right, Bottom), GridLinesBrush); + if bTop in ABorders then + DrawRect(cxRect(Left, Top, Right, Top + 1), GridLinesBrush); + if bBottom in ABorders then + DrawRect(cxRect(Left, Bottom - 1, Right, Bottom), GridLinesBrush); + end; + if not IsOpaque then + DrawRect(cxExcludeBorders(ARect, ABorders), ABrush, ABitmap); +end; + +procedure TcxTreeListControlPainter.DrawRectWithBorders( + AViewInfo: TcxTreeListViewInfoItem; IsOpaque: Boolean; ABorders: TcxBorders = []); +begin + with AViewInfo do + begin + if (ABorders = []) and not IsOpaque then + DrawRect(ClipRect, Brush, ViewParams.Bitmap) + else + DrawRectWithBorders(DisplayRect, Brush, IsOpaque, ABorders, ViewParams.Bitmap); + end; +end; + +procedure TcxTreeListControlPainter.DrawSeparators(const ASeparators: TcxTreeListSeparators); +var + I: Integer; +begin + Canvas.Brush.Assign(ViewInfo.SeparatorBrush); + for I := Low(TcxTreeListSeparators) to High(TcxTreeListSeparators) do + if not cxRectIsEmpty(ASeparators[I]) then + begin + Canvas.FillRect(ASeparators[I]); + Canvas.ExcludeClipRect(ASeparators[I]); + if ContentClipRegion <> nil then + ContentClipRegion.Combine(TcxRegion.Create(ASeparators[I]), roSubtract); + end; +end; + +procedure TcxTreeListControlPainter.DrawTreeLines( + AViewInfo: TcxTreeListIndentViewInfo); + + procedure DrawTreeLine(const ARect: TRect; AColor: TColor); + begin + if TreeList.OptionsView.TreeLineStyle = tllsDot then + cxFillHalfToneRect(Canvas.Canvas, ARect, AColor, TreeLineColor) + else + begin + Canvas.Brush.Color := TreeLineColor; + Canvas.FillRect(ARect); + end; + end; + +begin + with AViewInfo, ViewParams do + begin + if [tltVertUp, tltVertDown] * TreeLines <> [] then + DrawTreeLine(IndentVertTreeLine, Color); + if tltHorz in TreeLines then + DrawTreeLine(IndentHorzTreeLine, Color); + end; +end; + +procedure TcxTreeListControlPainter.ExtDrawHeader(ACanvas: TcxCanvas; + const ABounds, ATextAreaBounds: TRect; ANeighbors: TcxNeighbors; ABorders: TcxBorders; + AState: TcxButtonState; AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; + AMultiLine, AShowEndEllipsis: Boolean; const AText: string; AFont: TFont; + ATextColor, ABkColor: TColor; AOnDrawBackground: TcxDrawBackgroundEvent = nil); +begin + if TreeList.OptionsView.IsExtPaintStyle then + Painter.DrawHeaderEx(ACanvas, ABounds, ATextAreaBounds, ANeighbors, ABorders, + AState, AAlignmentHorz, AAlignmentVert, AMultiLine, AShowEndEllipsis, AText, + AFont, ATextColor, ABkColor, AOnDrawBackground) + else + Painter.DrawHeader(ACanvas, ABounds, ATextAreaBounds, ANeighbors, ABorders, + AState, AAlignmentHorz, AAlignmentVert, AMultiLine, AShowEndEllipsis, AText, + AFont, ATextColor, ABkColor, AOnDrawBackground); +end; + +function TcxTreeListControlPainter.GetViewState(AIndex: Integer): Boolean; +begin + Result := TcxTreeListOptionsView(TreeList.OptionsView).GetState(AIndex); +end; + +procedure TcxTreeListControlPainter.RestoreClipping; +begin + Canvas.SetClipRegion(ContentClipRegion, roSet, False); +end; + +function TcxTreeListControlPainter.GetBackgroundBrush: TBrush; +begin + Result := ViewInfo.Brush; +end; + +function TcxTreeListControlPainter.GetGridLinesBrush: TBrush; +begin + Result := ViewInfo.GridLinesBrush; +end; + +function TcxTreeListControlPainter.GetTreeList: TcxCustomTreeListControl; +begin + Result := TcxCustomTreeListControl(Control); +end; + +function TcxTreeListControlPainter.GetIsFooterVisible: Boolean; +begin + Result := Footer and (TreeList.VisibleColumnCount > 0); +end; + +function TcxTreeListControlPainter.GetTreeLineColor: TColor; +begin + Result := ViewInfo.TreeLineColor; +end; + +function TcxTreeListControlPainter.GetViewInfo: TcxTreeListViewInfo; +begin + Result := TcxTreeListViewInfo(inherited ViewInfo); +end; + +{ TcxTreeListBandOptions } + +constructor TcxTreeListBandOptions.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FState := Integer($FFFFFFFF); + OnlyOwnColumns := False; +end; + +procedure TcxTreeListBandOptions.Assign(Source: TPersistent); +begin + if Source is TcxTreeListBandOptions then + begin + if FState <> TcxTreeListBandOptions(Source).FState then + begin + FState := TcxTreeListBandOptions(Source).FState; + Changed; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxTreeListBandOptions.RestoreDefaults; +begin + FState := 0; + Sizing := True; + Customizing := True; + Moving := True; + Changed; +end; + +procedure TcxTreeListBandOptions.Changed; +begin + TcxTreeListBand(GetOwner).Changed(False); +end; + +function TcxTreeListBandOptions.GetState(AIndex: Integer): Boolean; +begin + Result := cxGetState(FState, AIndex); +end; + +procedure TcxTreeListBandOptions.SetState(AIndex: Integer; Value: Boolean); +begin + if cxSetState(FState, AIndex, Value) then + Changed; +end; + +{ TcxTreeListBandStyles } + +procedure TcxTreeListBandStyles.Assign(Source: TPersistent); +var + I: Integer; +begin + if Source is TcxTreeListBandStyles then + begin + for I := tlbs_Content to tlbs_HeaderBackground do + SetValue(I, TcxTreeListBandStyles(Source).GetValue(I)); + end; + inherited Assign(Source); +end; + +function TcxTreeListBandStyles.GetTreeList: TcxCustomTreeListControl; +begin + Result := TcxTreeListBand(GetOwner).TreeList; +end; + +procedure TcxTreeListBandStyles.CachedContentStyleChanged; +var + B: Boolean; +begin + ContentParams := TreeList.Styles.ContentParams; + for B := False to True do + cxParamsCombine(Content, [], ContentParams[B]); +end; + +procedure TcxTreeListBandStyles.Changed(AIndex: Integer); +begin + inherited Changed(AIndex); + TreeList.UpdateViewStyles; +end; + +{ TcxTreeListBand } + +constructor TcxTreeListBand.Create(Collection: TCollection); +begin + TcxTreeListBands(Collection).TreeList.BeginUpdate; + inherited Create(Collection); + FVisibleColumns := TList.Create; + FBandRows := TcxTreeListBandRows.Create(Self); + FColumns := TList.Create; + FOptions := GetOptionsClass.Create(Self); + FBandViewInfo := TcxTreeListBandViewInfo.Create(Self); + FCaption := TcxTreeListCaption.CreateEx(TreeList, Self, FBandViewInfo); + FStyles := TcxTreeListBandStyles.Create(Self); + Visible := True; + RestoreWidths; + if TreeList <> nil then TreeList.DoUpdateDesignerForms; + TreeList.EndUpdate; +end; + +destructor TcxTreeListBand.Destroy; +var + I: Integer; + ATreeList: TcxCustomTreeListControl; +begin + ATreeList := TreeList; + ATreeList.BeginUpdate; + try + FreeAndNil(FCaption); + if not (TreeList.IsDestroying or TreeList.IsLoading) then + begin + if TreeList.HitTest.FPressedHeader = ViewInfo.BandHeader then + TreeList.HitTest.FPressedHeader := nil; + TreeList.ViewInfo.IsDirty := True; + Visible := False; + TreeList.Controller.UnselectObject(Self); + if Visible then + TreeList.FBandsVisibleList.Remove(Self); + for I := 0 to FColumns.Count - 1 do + TcxTreeListColumn(FColumns[I]).InternalSetBandOwner(nil, False); + end; + FreeAndNil(FBandViewInfo); + FreeAndNil(FColumns); + FreeAndNil(FOptions); + FreeAndNil(FStyles); + FreeAndNil(FBandRows); + FreeAndNil(FVisibleColumns); + TreeList.UpdateViewStyles; + finally + inherited Destroy; + ATreeList.EndUpdate; + end; +end; + +procedure TcxTreeListBand.Assign(Source: TPersistent); +var + ABand: TcxTreeListBand; +begin + if Source is TcxTreeListBand then + begin + ABand := TcxTreeListBand(Source); + FCalculatedWidth := ABand.FCalculatedWidth; + FMinWidth := ABand.MinWidth; + FWidth := ABand.FWidth; + Visible := ABand.Visible; + Options := ABand.Options; + Styles := ABand.Styles; + Caption := ABand.Caption; + FixedKind := ABand.FixedKind; + end + else + inherited Assign(Source); +end; + +procedure TcxTreeListBand.ApplyBestFit; +var + I: Integer; +begin + TreeList.HandleNeeded; + if IsLeftMost then + TreeList.FContentIndentWidth := 0; + if not CanSizing(dsdHorz) then Exit; + TreeList.BeginUpdate; + try + FWidth := 0; + TreeList.HideEdit; + for I := 0 to VisibleColumnCount - 1 do + VisibleColumns[I].ApplyBestFit; + BandRows.Refresh; + FCalculatedWidth := BandRows.ColumnsMaxWidth; + if FWidth <> 0 then + FCalculatedWidth := FWidth; + TreeList.Controller.ForceWidthItem := Self; + AssignColumnWidths; + TreeList.RealignBands; + finally + TreeList.Controller.ForceWidthItem := nil; + TreeList.EndUpdate; + end; +end; + +procedure TcxTreeListBand.RestoreDefaults; +begin + TreeList.BeginUpdate; + try + Options.RestoreDefaults; + RestoreWidths; + finally + TreeList.EndUpdate; + end; +end; + +procedure TcxTreeListBand.RestoreWidths; +begin + FMinWidth := cxTreeListDefMinWidth; + SetWidth(0); +end; + +procedure TcxTreeListBand.AssignColumnWidths; +var + I: Integer; +begin + TreeList.BeginUpdate; + try + for I := 0 to VisibleColumnCount - 1 do + VisibleColumns[I].Width := VisibleColumns[I].RealWidth; + finally + TreeList.EndUpdate; + end; +end; + +procedure TcxTreeListBand.InitAutoWidthItem(AItem: TcxAutoWidthItem); +begin + AItem.Width := Width; + if AItem.Width = 0 then + AItem.Width := BandRows.ColumnsMaxWidth; + AItem.MinWidth := cxMax(FMinWidth, BandRows.ColumnsMinWidth); + AItem.AutoWidth := -1; + AItem.Fixed := (TreeList.Controller.ForceWidthItem = Self) or not Options.Sizing; +end; + +function TcxTreeListBand.IsFixed: Boolean; +begin + Result := FixedKind <> tlbfNone; +end; + +function TcxTreeListBand.IsOnlyOwnColumns: Boolean; +begin + Result := Options.OnlyOwnColumns; +end; + +function TcxTreeListBand.CanDropColumnAt( + const APoint: TPoint; out ARowIndex, AColIndex: Integer): Boolean; +begin + Result := True; + ARowIndex := 0; + AColIndex := 0; +end; + +function TcxTreeListBand.GetMaxDeltaWidth: Integer; +begin + Result := TreeList.GetMaxBandWidth(Self) - DisplayWidth; +end; + +function TcxTreeListBand.CanMoving: Boolean; +begin + Result := (FixedKind = tlbfNone) and (TreeList.VisibleBandCount > 1) and + Options.Moving and TreeList.OptionsCustomizing.BandMoving; +end; + +function TcxTreeListBand.GetState(Index: Integer): Boolean; +begin + Result := cxGetState(FState, Index); +end; + +function TcxTreeListBand.GetOptionsClass: TcxTreeListBandOptionsClass; +begin + Result := TcxTreeListBandOptions; +end; + +procedure TcxTreeListBand.AddColumn(AColumn: TcxTreeListColumn); +begin + if FColumns.IndexOf(AColumn) = cxInvalidIndex then + begin +// if not (TreeList.IsLocked or TreeList.IsUpdating) then +// AColumn.Position.FColIndex := FColumns.Count; + FColumns.Add(AColumn); + end; + AColumn.FOwnerBand := Self; +end; + +procedure TcxTreeListBand.RealignColumns; +var + I: Integer; +begin + if not Visible then Exit; + BandRows.Refresh; + if not TreeList.OptionsView.ColumnAutoWidth then + FCalculatedWidth := BandRows.ColumnsMaxWidth; + try + for I := 0 to BandRows.Count - 1 do + BandRows[I].DoCalculateColumnsAutoWidth; + finally + BandRows.UpdateInformation; + end; +end; + +procedure TcxTreeListBand.RemoveColumn(AColumn: TcxTreeListColumn); +begin + if (FColumns <> nil) and (FColumns.Remove(AColumn) <> cxInvalidIndex) then + begin + Changed(True); + AColumn.FOwnerBand := nil; + end; +end; + +procedure TcxTreeListBand.SetState(Index: Integer; Value: Boolean); +begin + cxSetState(FState, Index, Value); +end; + +procedure TcxTreeListBand.VisibleChanged; +begin + with TreeList do + begin + BeginUpdate; + try + FixedKind := tlbfNone; + if not Self.Visible then + FBandsVisibleList.Remove(Self) + else + FBandsVisibleList.Add(Self); + finally + Self.Changed(True); + DoUpdateDesignerForms; + EndUpdate; + end; + end; +end; + +function TcxTreeListBand.CanSizing(ADirection: TcxDragSizingDirection): Boolean; +begin + with TreeList.OptionsCustomizing do + begin + if ADirection = dsdVert then + Result := BandVertSizing + else + Result := BandHorzSizing and Options.Sizing; + end +end; + +function TcxTreeListBand.GetSizingBoundsRect( + ADirection: TcxDragSizingDirection): TRect; +begin + Result := TreeList.ViewInfo.ClientRect; + InflateRect(Result, TreeList.Width, 0); +end; + +function TcxTreeListBand.GetSizingIncrement( + ADirection: TcxDragSizingDirection): Integer; +begin + if ADirection = dsdHorz then + Result := 1 + else + Result := TreeList.ViewInfo.BandLineHeight; +end; + +function TcxTreeListBand.IsDynamicUpdate: Boolean; +var + ADir: TcxDragSizingDirection; +begin + Result := TreeList.OptionsCustomizing.DynamicSizing and + TreeList.HitTest.CanSizing(ADir) and (ADir = dsdHorz); +end; + +procedure TcxTreeListBand.SetSizeDelta( + ADirection: TcxDragSizingDirection; ADelta: Integer); +begin + TreeList.Controller.ForceWidthItem := Self; + if ADirection = dsdHorz then + Width := DisplayWidth + ADelta + else + with TreeList.OptionsView do + BandLineCount := BandLineCount + ADelta; + TreeList.LayoutChanged; + TreeList.Controller.ForceWidthItem := nil; +end; + +function TcxTreeListBand.GetObjectName: string; +begin + Result := 'Band' + IntToStr(Index); +end; + +function TcxTreeListBand.GetProperties( + AProperties: TStrings): Boolean; +var + I: Integer; +begin + for I := 0 to High(BandPropertiesName) do + AProperties.Add(BandPropertiesName[I]); + Result := True; +end; + +function TcxTreeListBand.GetPropertyIndex(const AName: string): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to High(BandPropertiesName) do + if BandPropertiesName[I] = AName then + begin + Result := I; + Break; + end; +end; + +procedure TcxTreeListBand.GetPropertyValue( + const AName: string; var AValue: Variant); +begin + case GetPropertyIndex(AName) of + 0: AValue := Caption.Text; + 1: AValue := FMinWidth; + 2: AValue := FWidth; + 3: AValue := Visible; + 4: AValue := Index; + end; +end; + +procedure TcxTreeListBand.SetPropertyValue( + const AName: string; const AValue: Variant); +begin + case GetPropertyIndex(AName) of + 0: + if Caption.Text = '' then + Caption.Text := AValue; + 1: + FMinWidth := AValue; + 2: + FWidth := AValue; + 3: + Visible := AValue; + 4: + Index := AValue; + end; +end; + +function TcxTreeListBand.GetRealWidth: Integer; +begin + Result := FCalculatedWidth; + if Result = 0 then + Result := FWidth; + if Result = 0 then + Result := BandRows.ColumnsMaxWidth; + Result := Max(Result, BandRows.ColumnsMinWidth); + if Result = 0 then + Result := cxTreeListDefWidth; +end; + +function TcxTreeListBand.GetTreeList: TcxCustomTreeListControl; +begin + Result := Bands.TreeList; +end; + +function TcxTreeListBand.GetBands: TcxTreeListBands; +begin + Result := TcxTreeListBands(Collection); +end; + +function TcxTreeListBand.GetColumn(Index: Integer): TcxTreeListColumn; +var + I, AIndex: Integer; +begin + Result := nil; + AIndex := 0; + for I := 0 to TreeList.ColumnCount - 1 do + begin + Result := TreeList.Columns[I]; + if Result.OwnerBand = Self then + begin + if Index = AIndex then Break; + Inc(AIndex); + end; + end; +end; + +function TcxTreeListBand.GetColumnCount: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to TreeList.ColumnCount - 1 do + if TreeList.Columns[I].OwnerBand = Self then + Inc(Result); +end; + +function TcxTreeListBand.GetDisplayWidth: Integer; +begin + Result := FCalculatedWidth + IndentWidth; +end; + +function TcxTreeListBand.GetFixedKind: TcxTreeListBandFixedKind; +begin + Result := TcxTreeListBandFixedKind(FState shr 1 and 3); +end; + +function TcxTreeListBand.GetIndentWidth: Integer; +begin + Result := TreeList.GetIndentWidth(Bands.FirstVisible = Self); +end; + +function TcxTreeListBand.GetIsLeftMost: Boolean; +begin + Result := Visible and (Bands.FirstVisible = Self); +end; + +function TcxTreeListBand.GetIsRightMost: Boolean; +begin + Result := Visible and (Bands.LastVisible = Self); +end; + +function TcxTreeListBand.GetItemIndex: Integer; +begin + Result := Index; +end; + +function TcxTreeListBand.GetVisible: Boolean; +begin + Result := GetState(tlbsVisible); +end; + +function TcxTreeListBand.GetVisibleColumn(Index: Integer): TcxTreeListColumn; +begin + Result := TcxTreeListColumn(FVisibleColumns[Index]); +end; + +function TcxTreeListBand.GetVisibleColumnCount: Integer; +begin + Result := FVisibleColumns.Count; +end; + +function TcxTreeListBand.GetVisibleIndex: Integer; +begin + Result := TreeList.FBandsVisibleList.IndexOf(Self); +end; + +procedure TcxTreeListBand.SetBandVisiblePos(APos: Integer); +var + I: Integer; +begin + with TreeList.FBandsVisibleList do + begin + I := IndexOf(Self); + if I <> APos then + begin + Remove(Self); + if APos >= Count then + Add(Self) + else + Insert(APos, Self); + end; + end; +end; + +procedure TcxTreeListBand.SetCaption(Value: TcxTreeListCaption); +begin + FCaption.Assign(Value); +end; + +procedure TcxTreeListBand.SetColumn(Index: Integer; Value: TcxTreeListColumn); +begin + Columns[Index].Assign(Value); +end; + +procedure TcxTreeListBand.SetFixedKind(Value: TcxTreeListBandFixedKind); +begin + if (Value <> FixedKind) and Visible then + begin + FState := FState and not tlbsAllFixed; + if Value <> tlbfNone then + FState := FState or Integer(Value) shl 1; + with TreeList.FBandsVisibleList do + begin + if Value = tlbfLeft then + SetBandVisiblePos(0) + else + if Value = tlbfRight then + SetBandVisiblePos(Count - 1); + Changed(True); + end; + end; +end; + +procedure TcxTreeListBand.SetItemIndex(Value: Integer); +begin + if cxInRange(Value, 0, Bands.Count - 1) then + Index := Value; +end; + +procedure TcxTreeListBand.SetMinWidth(Value: Integer); +begin + if Value <> FMinWidth then + begin + FMinWidth := Value; + Changed(True); + end; +end; + +procedure TcxTreeListBand.SetOptions(Value: TcxTreeListBandOptions); +begin + FOptions.Assign(Value); +end; + +procedure TcxTreeListBand.SetStyles(Value: TcxTreeListBandStyles); +begin + FStyles.Assign(Value); +end; + +procedure TcxTreeListBand.SetVisibleColumn( + Index: Integer; Value: TcxTreeListColumn); +begin + VisibleColumns[Index].Assign(Value); +end; + +procedure TcxTreeListBand.SetVisible(Value: Boolean); +begin + if Value <> Visible then + begin + SetState(tlbsVisible, Value); + VisibleChanged; + end; +end; + +procedure TcxTreeListBand.SetVisibleIndex(Value: Integer); +const + ACorrectValue: array[TcxTreeListBandFixedKind] of Integer = (0, 1, -1); + + procedure ModifyList; + begin + with TreeList.FBandsVisibleList do + begin + if cxValidateIntDefEx(Value, -1, 0, Count) then + begin + Inc(Value, ACorrectValue[TcxTreeListBand(List^[Value]).FixedKind]); + if Value >= Count then + Add(Self) + else + Insert(Value, Self); + end; + end; + end; + +var + I: Integer; +begin + Inc(Value); + if Value <> VisibleIndex then + begin + if Value < 0 then + Visible := False + else + if FixedKind = tlbfNone then + begin + I := TreeList.FBandsVisibleList.Remove(Self); + if (I >= 0) and (I < Value) then Dec(Value); + ModifyList; + SetState(tlbsVisible, VisibleIndex >= 0); + Changed(True); + end; + end; +end; + +procedure TcxTreeListBand.SetWidth(Value: Integer); +begin + if (Value = 0) or (cxValidateIntDefEx(Value, FWidth, FMinWidth)) then + begin + FWidth := Value; + if TreeList.IsLocked or not Visible then Exit; + TreeList.LayoutChanged; + TreeList.DoOnBandSizeChanged(Self); + end; +end; + +{ TcxTreeListBands } + +constructor TcxTreeListBands.Create(AOwner: TcxCustomTreeListControl); +begin + inherited Create(AOwner.GetBandItemClass); + FTreeList := AOwner; +end; + +function TcxTreeListBands.Add: TcxTreeListBand; +begin + Result := TcxTreeListBand(inherited Add); + Update(nil); +end; + +function TcxTreeListBands.GetAbsoluteIndex(VisibleIndex: Integer): Integer; +begin + if (VisibleIndex >= 0) and (VisibleIndex < TreeList.FBandsVisibleList.Count) then + Result := TcxTreeListBand(TreeList.FBandsVisibleList.List[VisibleIndex]).Index + else + Result := -1; +end; + +function TcxTreeListBands.GetVisibleIndex(AbsoluteIndex: Integer): Integer; +begin + Result := TreeList.FBandsVisibleList.IndexOf(inherited GetItem(AbsoluteIndex)); +end; + +procedure TcxTreeListBands.RestoreDefaults; +var + I: Integer; +begin + TreeList.BeginUpdate; + try + for I := 0 to Count - 1 do + Items[I].RestoreDefaults; + finally + TreeList.EndUpdate; + end; +end; + +procedure TcxTreeListBands.RestoreWidths; +var + I: Integer; +begin + TreeList.BeginUpdate; + try + for I := 0 to Count - 1 do + Items[I].RestoreWidths; + finally + TreeList.EndUpdate; + end; +end; + +procedure TcxTreeListBands.RealignColumns; +var + I: Integer; +begin + TreeList.FHeaderLineCount := 0; + for I := 0 to TreeList.VisibleBandCount - 1 do + TreeList.VisibleBands[I].RealignColumns; +end; + +function TcxTreeListBands.GetOwner: TPersistent; +begin + Result := FTreeList; +end; + +procedure TcxTreeListBands.RefreshBandStates; +var + I: Integer; + ALastVisible, AFirstVisible: TcxTreeListBand; + + procedure CheckFixed(ABand: TcxTreeListBand); + begin + if (ABand = AFirstVisible) or (ABand = ALastVisible) then Exit; + ABand.FixedKind := tlbfNone; + end; + +begin + TreeList.FBandsVisibleList.Sort(cxCompareVisibleBands); + AFirstVisible := FirstVisible; + ALastVisible := LastVisible; + for I := 0 to Count - 1 do + CheckFixed(TcxTreeListBand(inherited GetItem(I))); +end; + +procedure TcxTreeListBands.Update(Item: TCollectionItem); +begin + if FTreeList = nil then Exit; + if FTreeList.Bands.Count <> 1 then + FTreeList.FDefaultLayout := False; + with FTreeList do + begin + if IsLoading or IsDestroying then Exit; + if not IsLocked then RefreshBandStates; + end; + TreeList.DoUpdateDesignerForms; + TreeList.UpdateViewStyles; +end; + +{$IFDEF DELPHI6} + +procedure TcxTreeListBands.Notify(Item: TCollectionItem; Action: TCollectionNotification); +var + I: Integer; +begin + if (Action = cnExtracting) and (TreeList <> nil) and not TreeList.IsDestroying then + begin + TreeList.FBandsVisibleList.Remove(Item); + for I := 0 to TreeList.ColumnCount - 1 do + if TreeList.Columns[I].FOwnerBand = Item then + TreeList.Columns[I].FOwnerBand := nil; + end; + inherited Notify(Item, Action); +end; + +{$ENDIF} + +// IInterface +function TcxTreeListBands.QueryInterface(const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := cxE_NOINTERFACE; +end; + +function TcxTreeListBands._AddRef: Integer; +begin + Result := -1; +end; + +function TcxTreeListBands._Release: Integer; +begin + Result := -1; +end; + +// IcxStoredObject } +function TcxTreeListBands.GetObjectName: string; +begin + Result := 'Bands'; +end; + +function TcxTreeListBands.GetProperties(AProperties: TStrings): Boolean; +begin + Result := True; +end; + +procedure TcxTreeListBands.GetPropertyValue( + const AName: string; var AValue: Variant); +begin +end; + +procedure TcxTreeListBands.SetPropertyValue( + const AName: string; const AValue: Variant); +begin +end; + +// IcxStoredParent +function TcxTreeListBands.CreateChild( + const AObjectName, AClassName: string): TObject; +begin + if AClassName = 'TcxTreeListBand' then + Result := Add + else + Result := nil; +end; + +procedure TcxTreeListBands.DeleteChild(const AObjectName: string; AObject: TObject); +begin + AObject.Free; +end; + +procedure TcxTreeListBands.GetChildren(AChildren: TStringList); +var + I: Integer; +begin + for I := 0 to Count - 1 do + AChildren.AddObject('', Items[I]); +end; + +function TcxTreeListBands.GetItem(AIndex: Integer): TcxTreeListBand; +begin + Result := TcxTreeListBand(inherited GetItem(AIndex)); +end; + +function TcxTreeListBands.GetVisibleItemEx(AIndex: Integer): TcxTreeListBand; +begin + with TreeList.FBandsVisibleList do + begin + if Count = 0 then + Result := nil + else + if AIndex = 0 then + Result := TcxTreeListBand(List^[0]) + else + Result := TcxTreeListBand(List^[Count - 1]); + end; +end; + +procedure TcxTreeListBands.SetItem(AIndex: Integer; Value: TcxTreeListBand); +begin + inherited GetItem(AIndex).Assign(Value); +end; + +{ TcxTreeListBandRow } + +constructor TcxTreeListBandRow.Create(AOwner: TcxTreeListBandRows); +begin + FBandRows := AOwner; + FItems := TList.Create; +end; + +destructor TcxTreeListBandRow.Destroy; +begin + FreeAndNil(FItems); + inherited Destroy; +end; + +function TcxTreeListBandRow.IndexOf(AColumn: TcxTreeListColumn): Integer; +begin + Result := FItems.IndexOf(AColumn); +end; + +function TcxTreeListBandRow.GetRowMinWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + Inc(Result, Items[I].GetRealMinWidth); +end; + +function TcxTreeListBandRow.GetMaxColumnWidth( + AColumn: TcxTreeListColumn): Integer; +var + I, J: Integer; +begin + Result := Band.DisplayWidth; + J := FItems.IndexOf(AColumn); + if J = Count - 1 then + for I := Count - 2 downto 0 do + Dec(Result, Items[I].GetRealMinWidth) + else + for I := 0 to Count - 1 do + begin + if I < J then + Dec(Result, Items[I].DisplayWidth) + else + if I > J then + Dec(Result, Items[I].GetRealMinWidth); + end; +end; + +procedure TcxTreeListBandRow.UpdateInformation; +var + I: Integer; +begin + FLineOffset := 0; + FLineCount := 0; + with FItems do + for I := 0 to Count - 1 do + FLineCount := cxMax(FLineCount, TcxTreeListColumn(List^[I]).Position.LineCount); +end; + +procedure TcxTreeListBandRow.AddColumn(AColumn: TcxTreeListColumn); +begin + if not AColumn.IsHidden then + begin + Band.FVisibleColumns.Add(AColumn); + FItems.Add(AColumn); + end; +end; + +procedure TcxTreeListBandRow.DoCalculateColumnsAutoWidth; +var + I: Integer; + AAutoWidth: TcxAutoWidthObject; +begin + if Count = 0 then Exit; + AAutoWidth := TcxAutoWidthObject.Create(Count); + try + AAutoWidth.AvailableWidth := Band.RealWidth; + for I := 0 to Count - 1 do + Items[I].InitAutoWidthItem(AAutoWidth.AddItem); + AAutoWidth.Calculate; + for I := 0 to Count - 1 do + Items[I].FCalculatedWidth := AAutoWidth.Items[I].AutoWidth; + finally + AAutoWidth.Free; + end; +end; + +function TcxTreeListBandRow.GetBand: TcxTreeListBand; +begin + Result := FBandRows.FBand; +end; + +function TcxTreeListBandRow.GetCount: Integer; +begin + Result := FItems.Count +end; + +function TcxTreeListBandRow.GetIsFirst: Boolean; +begin + Result := BandRows.First = Self; +end; + +function TcxTreeListBandRow.GetFirst: TcxTreeListColumn; +begin + Result := GetItemEx(0); +end; + +function TcxTreeListBandRow.GetIndex: Integer; +begin + Result := BandRows.FItems.IndexOf(Self); +end; + +function TcxTreeListBandRow.GetIsLast: Boolean; +begin + Result := BandRows.Last = Self; +end; + +function TcxTreeListBandRow.GetItem(Index: Integer): TcxTreeListColumn; +begin + Result := TcxTreeListColumn(FItems[Index]) +end; + +function TcxTreeListBandRow.GetItemEx(Index: Integer): TcxTreeListColumn; +begin + if (Index >= 0) and (Index < FItems.Count) then + Result := TcxTreeListColumn(FItems.List^[Index]) + else + Result := nil; +end; + +function TcxTreeListBandRow.GetLast: TcxTreeListColumn; +begin + Result := GetItemEx(FItems.Count - 1); +end; + +function TcxTreeListBandRow.GetLineCount: Integer; +begin + if FLineCount = 0 then + begin + Result := LineOffset; + UpdateInformation; + FLineOffset := Result; + end; + Result := FLineCount; +end; + +function TcxTreeListBandRow.GetMinWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + cxSetMax(Result, Items[I].GetRealMinSize); +end; + +function TcxTreeListBandRow.GetTreeList: TcxCustomTreeListControl; +begin + Result := FBandRows.FBand.GetTreeList; +end; + +function TcxTreeListBandRow.GetWidth: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + Inc(Result, Items[I].DisplayWidth); + if Result = 0 then + Result := Band.DisplayWidth; +end; + +{ TcxTreeListBandRows } + +constructor TcxTreeListBandRows.Create(AOwner: TcxTreeListBand); +begin + FBand := AOwner; + FItems := TList.Create; +end; + +destructor TcxTreeListBandRows.Destroy; +begin + Clear; + FreeAndNil(FItems); + inherited Destroy; +end; + +function TcxTreeListBandRows.Add: TcxTreeListBandRow; +begin + Result := TcxTreeListBandRow.Create(Self); + FItems.Add(Result); +end; + +function TcxTreeListBandRows.CalculateAvaliableMinWidth: Integer; + + function GetRowMinWidth(ARow: TcxTreeListBandRow): Integer; + var + I: Integer; + begin + Result := 0; + for I := 0 to ARow.Count - 1 do + Inc(Result, ARow[I].FMinWidth); + end; + +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + Result := cxMax(Result, GetRowMinWidth(Items[I])); +end; + +procedure TcxTreeListBandRows.Clear; +var + I: Integer; +begin + for I := 0 to FItems.Count - 1 do + FreeAndNil(TcxTreeListBandRow(FItems.List^[I])); + FItems.Clear; +end; + +procedure TcxTreeListBandRows.Refresh; + + procedure CheckColumns(AList: TList); + var + I, ARow, ACurRow: Integer; + begin + ARow := cxInvalidIndex; + ACurRow := 0; + for I := 0 to AList.Count - 1 do + with TcxTreeListColumn(AList.List^[I]) do + begin + if not Visible then Continue; + if ARow <> Position.FRowIndex then + begin + if ARow <> cxInvalidIndex then + Inc(ACurRow); + ARow := Position.FRowIndex + end; + Position.FRowIndex := ACurRow; + end; + end; + +var + ABandRow: TcxTreeListBandRow; + AColumn: TcxTreeListColumn; + I, ARow,{ ACol, }AMaxRowWidth, AMinRowWidth, AVisibleIndex: Integer; +begin + Clear; + Band.FVisibleColumns.Clear; + ABandRow := nil; + Band.FColumns.Sort(cxCompareColumnsPos); + CheckColumns(Band.FColumns); + ARow := -1; +// ACol := -1; + FColumnsMaxWidth := Band.Width; + FColumnsMinWidth := Band.FMinWidth; + AMaxRowWidth := 0; + AMinRowWidth := 0; + AVisibleIndex := 0; + for I := 0 to Band.FColumns.Count - 1 do + begin + AColumn := TcxTreeListColumn(Band.FColumns.List^[I]); +// Inc(ACol); + if AColumn.Position.FRowIndex <> ARow then + begin + Inc(ARow); + AMaxRowWidth := 0; + AMinRowWidth := 0; +// ACol := 0; + ABandRow := Add; + end; + if AColumn.Visible and not AColumn.IsPreview then + begin + Inc(AMaxRowWidth, AColumn.Width); + Inc(AMinRowWidth, AColumn.MinWidth); + FColumnsMinWidth := Max(FColumnsMinWidth, AMinRowWidth); + FColumnsMaxWidth := Max(FColumnsMaxWidth, AMaxRowWidth); + AColumn.FVisibleIndexAtBand := AVisibleIndex; + Inc(AVisibleIndex); + end; + if not Band.TreeList.IsUpdating then + begin + // AColumn.Position.FColIndex := ACol; todo: fixed B20392 + AColumn.Position.FRowIndex := ARow; + end; + if ABandRow <> nil then + ABandRow.AddColumn(AColumn); + end; + if FColumnsMaxWidth = 0 then + FColumnsMaxWidth := cxTreeListDefWidth; + if Band.Width <> 0 then + FColumnsMaxWidth := Max(FColumnsMinWidth, Band.Width); + UpdateInformation; +end; + +procedure TcxTreeListBandRows.UpdateInformation; +var + I: Integer; +begin + FLineCount := 0; + for I := 0 to Count - 1 do + begin + with Items[I] do + begin + UpdateInformation; + FLineOffset := Self.FLineCount; + Inc(Self.FLineCount, LineCount); + end; + end; + with Band.TreeList do + FHeaderLineCount := cxMax(FHeaderLineCount, LineCount); +end; + +function TcxTreeListBandRows.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxTreeListBandRows.GetFirst: TcxTreeListBandRow; +begin + Result := GetItemEx(0); +end; + +function TcxTreeListBandRows.GetItem(Index: Integer): TcxTreeListBandRow; +begin + Result := TcxTreeListBandRow(FItems[Index]); +end; + +function TcxTreeListBandRows.GetItemEx(Index: Integer): TcxTreeListBandRow; +begin + if (Index < 0) or (Index >= Count) then + Result := nil + else + Result := Items[Index]; +end; + +function TcxTreeListBandRows.GetLast: TcxTreeListBandRow; +begin + Result := GetItemEx(FItems.Count - 1); +end; + +function TcxTreeListBandRows.GetMinWidth: Integer; +var + I: Integer; +begin + Result := Band.FMinWidth; + for I := 0 to Count - 1 do + cxSetMax(Result, Items[I].MinWidth); +end; + +function TcxTreeListBandRows.GetLeftMostMinWidth: Integer; +var + I: Integer; +begin + Result := Band.FMinWidth; + for I := 0 to Count - 1 do + if Items[I].Count > 0 then + cxSetMin(Result, Items[I][0].MinWidth); +end; + +function TcxTreeListBandRows.GetLeftMostWidth: Integer; +var + I: Integer; +begin + Result := MaxInt; + for I := 0 to Count - 1 do + if Items[I].Count > 0 then + cxSetMin(Result, Items[I][0].RealWidth); + if Result = MaxInt then + Result := Band.RealWidth; +end; + +{ TcxTreeListOptionsView } + +constructor TcxTreeListOptionsView.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FIndicatorWidth := cxTreeListDefIndicatorWidth; + FBandLineCount := cxTreeListDefBandHeaderLineCount; + FFixedSeparatorColor := clDefault; + FFixedSeparatorWidth := cxTreeListDefSeparatorWidth; + FDropArrowColor := cxTreeListDefDropArrowColor; + Bands := cxTreeListDefBands; + Buttons := True; + Headers := cxTreeListDefColumnHeaders; + Footer := cxTreeListDefFooter; + FFixedSeparatorColor := clDefault; + ColumnAutoWidth := cxTreeListDefColumnAutoWidth; + FGridLineColor := clDefault; + FTreeLineColor := clDefault; + FTreeLineStyle := tllsDot; + UseNodeColorForIndent := True; + UseImageIndexForSelected := True; + ShowRoot := True; +end; + +procedure TcxTreeListOptionsView.Assign(Source: TPersistent); +var + ASource: TcxTreeListOptionsView; +begin + if Source is TcxTreeListOptionsView then + begin + ASource := TcxTreeListOptionsView(Source); + HeaderSingleLine := ASource.HeaderSingleLine; + FState := ASource.FState; + if ASource.FCategorizedColumn <> nil then + FCategorizedColumn := TreeList.Columns[ASource.FCategorizedColumn.ItemIndex] + else + FCategorizedColumn := nil; + FBandLineCount := ASource.FBandLineCount; + FIndicatorWidth := ASource.FIndicatorWidth; + FFixedSeparatorColor := ASource.FFixedSeparatorColor; + FFixedSeparatorWidth := ASource.FixedSeparatorWidth; + FGridLines := ASource.FGridLines; + FGridLineColor := ASource.GridLineColor; + FDropArrowColor := ASource.FDropArrowColor; + FPaintStyle := ASource.FPaintStyle; + FTreeLineColor := ASource.FTreeLineColor; + FTreeLineStyle := ASource.FTreeLineStyle; + end; + inherited Assign(Source); +end; + +function TcxTreeListOptionsView.GetCategorizedColumn: TcxTreeListColumn; +begin + if FCategorizedColumn <> nil then + Result := FCategorizedColumn + else + if TreeList.VisibleColumnCount > 0 then + Result := TreeList.VisibleColumns[0] + else + Result := nil; +end; + +procedure TcxTreeListOptionsView.RestoreDefaults; +begin + FState := 0; + FIndicatorWidth := cxTreeListDefIndicatorWidth; + Headers := True; +end; + +procedure TcxTreeListOptionsView.Changed; +begin + TreeList.UpdateViewStyles; +end; + +function TcxTreeListOptionsView.GetControl: TObject; +begin + Result := TreeList; +end; + +function TcxTreeListOptionsView.GetState(AIndex: Integer): Boolean; +begin + Result := cxGetState(FState, AIndex); +end; + +procedure TcxTreeListOptionsView.SetState(AIndex: Integer; Value: Boolean); +begin + if cxSetState(FState, AIndex, Value) then Changed; +end; + +function TcxTreeListOptionsView.HasImages(ANode: TcxTreeListNode): Boolean; +begin + Result := TreeList.Images <> nil; + if Result and (ANode <> nil) and (TreeList.DoGetNodeImageIndex(ANode, tlitImageIndex) < 0) then + Result := False; +end; + +function TcxTreeListOptionsView.HasStateImages(ANode: TcxTreeListNode): Boolean; +begin + Result := TreeList.StateImages <> nil; + if Result and (ANode <> nil) and (TreeList.DoGetNodeImageIndex(ANode, tlitStateIndex) < 0) then + Result := False; +end; + +function TcxTreeListOptionsView.HorzIncrement: Integer; +begin + Result := Byte(GridLines in [tlglVert, tlglBoth]) +end; + +function TcxTreeListOptionsView.IsCategorizedPaint: Boolean; +begin + Result := PaintStyle = tlpsCategorized; +end; + +function TcxTreeListOptionsView.IsExtPaintStyle: Boolean; +begin + Result := ExtPaintStyle and (GetTreeList.LookAndFeel.SkinPainter = nil); +end; + +function TcxTreeListOptionsView.IsRowAutoHeight: Boolean; +begin + Result := (TreeList.HeaderLineCount = 1) and + (CellAutoHeight or Assigned(TreeList.FOnGetNodeHeight)); +end; + +function TcxTreeListOptionsView.VertIncrement: Integer; +begin + Result := Byte(GridLines in [tlglHorz, tlglBoth]) +end; + +function TcxTreeListOptionsView._AddRef: Integer; +begin + Result := -1; +end; + +function TcxTreeListOptionsView._Release: Integer; +begin + Result := -1; +end; + +function TcxTreeListOptionsView.QueryInterface( + const IID: TGUID; out Obj): HResult; +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := cxE_NOINTERFACE; +end; + +function TcxTreeListOptionsView.GetTreeList: TcxCustomTreeListControl; +begin + Result := TcxCustomTreeListControl(EditingControl); +end; + +procedure TcxTreeListOptionsView.SetCategorizedColumn(Value: TcxTreeListColumn); +begin + FCategorizedColumn := Value; + Changed; +end; + +procedure TcxTreeListOptionsView.SetColumnAutoWidth(Index: Integer; Value: Boolean); +begin + if cxSetState(FState, Index, Value) then + Changed; +end; + +procedure TcxTreeListOptionsView.SetBandLineCount(Value: Integer); +begin + if cxValidateIntDefEx(Value, FBandLineCount, 1) then + begin + FBandLineCount := Value; + if Bands then Changed; + end; +end; + +procedure TcxTreeListOptionsView.SetIndicatorWidth(Value: Integer); +begin + if cxValidateIntDefEx(Value, FIndicatorWidth, 0) then + begin + FIndicatorWidth := Value; + if Indicator then Changed; + end; +end; + +procedure TcxTreeListOptionsView.SetFixedSeparatorColor(Value: TColor); +begin + if Value <> FFixedSeparatorColor then + begin + FFixedSeparatorColor := Value; + Changed; + end; +end; + +procedure TcxTreeListOptionsView.SetFixedSeparatorWidth(Value: Integer); +begin + if cxValidateIntDefEx(Value, FFixedSeparatorWidth, 0) then + begin + FFixedSeparatorWidth := Value; + Changed; + end; +end; + +procedure TcxTreeListOptionsView.SetGridLineColor(Value: TColor); +begin + if Value <> FGridLineColor then + begin + FGridLineColor := Value; + if GridLines <> tlglNone then Changed; + end; +end; + +procedure TcxTreeListOptionsView.SetGridLines(Value: TcxTreeListGridLines); +begin + if Value <> FGridLines then + begin + FGridLines := Value; + TreeList.UpdateViewStyles; + end; +end; + +procedure TcxTreeListOptionsView.SetHeaderSingleLine( + Index: Integer; Value: Boolean); +var + I: Integer; +begin + if Value <> HeaderSingleLine then + begin + if Value then + for I := 0 to TreeList.ColumnCount - 1 do + cxValidateSingleLine(TreeList.Columns[I].Position); + SetState(Index, Value); + end; +end; + +procedure TcxTreeListOptionsView.SetPaintStyle(Value: TcxTreeListPaintStyle); +begin + if FPaintStyle <> Value then + begin + FPaintStyle := Value; + TreeList.UpdateViewStyles; + end; +end; + +procedure TcxTreeListOptionsView.SetTreeLineColor(Value: TColor); +begin + if Value <> FTreeLineColor then + begin + FTreeLineColor := Value; + Changed; + end; +end; + +procedure TcxTreeListOptionsView.SetTreeLineStyle(Value: TcxTreeListTreeLineStyle); +begin + if Value <> FTreeLineStyle then + begin + FTreeLineStyle := Value; + Changed; + end; +end; + +{ TcxTreeListOptionsCustomizing } + +constructor TcxTreeListOptionsCustomizing.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FState := Integer($FFFFFFFF); + DynamicSizing := False; + RowSizing := False; +end; + +procedure TcxTreeListOptionsCustomizing.Assign(Source: TPersistent); +begin + if Source is TcxTreeListOptionsCustomizing then + FState := TcxTreeListOptionsCustomizing(Source).FState + else + inherited Assign(Source); +end; + +function TcxTreeListOptionsCustomizing.GetState(Index: Integer): Boolean; +begin + Result := cxGetState(FState, Index); +end; + +procedure TcxTreeListOptionsCustomizing.SetState(Index: Integer; Value: Boolean); +begin + cxSetState(FState, Index, Value); +end; + +function TcxTreeListOptionsCustomizing.GetTreeList: TcxCustomTreeListControl; +begin + Result := TcxCustomTreeListControl(GetOwner); +end; + +{ TcxTreeListOptionsSelection } + +constructor TcxTreeListOptionsSelection.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + CellSelect := True; + HideFocusRect := True; + HideSelection := False; + InvertSelect := True; + MultiSelect := False; +end; + +procedure TcxTreeListOptionsSelection.Assign(Source: TPersistent); +begin + if Source is TcxTreeListOptionsSelection then + FState := TcxTreeListOptionsSelection(Source).FState + else + inherited Assign(Source); +end; + +procedure TcxTreeListOptionsSelection.Changed; +begin + TreeList.LayoutChanged; +end; + +function TcxTreeListOptionsSelection.GetSelectionState(Index: Integer): Boolean; +begin + Result := cxGetState(FState, Index); +end; + +procedure TcxTreeListOptionsSelection.SetSelectionState(Index: Integer; Value: Boolean); +begin + if cxSetState(FState, Index, Value) then Changed; +end; + +function TcxTreeListOptionsSelection.GetTreeList: TcxCustomTreeListControl; +begin + Result := TcxCustomTreeListControl(GetOwner); +end; + +{ TcxTreeListOptionsBehavior } + +constructor TcxTreeListOptionsBehavior.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + ConfirmDelete := True; + DragCollapse := True; + DragExpand := True; + ExpandOnIncSearch := False; + ShowHourGlass := True; + Sorting := True; + MultiSort := True; + AutomateLeftMostIndent := True; + FWaitExpandingTime := cxTreeListDefWaitExpandTime; + ExpandOnDblClick := True; +end; + +procedure TcxTreeListOptionsBehavior.Assign(Source: TPersistent); +begin + if Source is TcxTreeListOptionsBehavior then + begin + FState := TcxTreeListOptionsBehavior(Source).FState; + FWaitExpandingTime := TcxTreeListOptionsBehavior(Source).FWaitExpandingTime; + end; + inherited Assign(Source); +end; + +function TcxTreeListOptionsBehavior.GetState(Index: Integer): Boolean; +begin + Result := cxGetState(FState, Index); +end; + +procedure TcxTreeListOptionsBehavior.SetState(Index: Integer; Value: Boolean); +begin + cxSetState(FState, Index, Value); +end; + +function TcxTreeListOptionsBehavior.GetChangeDelay: Integer; +begin + Result := TreeList.FDelayTimer.Interval; +end; + +function TcxTreeListOptionsBehavior.GetIncSearchItem: TcxTreeListColumn; +begin + Result := TcxTreeListColumn(inherited IncSearchItem); +end; + +function TcxTreeListOptionsBehavior.GetTreeList: TcxCustomTreeListControl; +begin + Result := TcxCustomTreeListControl(GetOwner); +end; + +procedure TcxTreeListOptionsBehavior.SetAutomateLeftMostIndent( + Index: Integer; Value: Boolean); +begin + SetState(Index, Value); +end; + +procedure TcxTreeListOptionsBehavior.SetChangeDelay(Value: Integer); +begin + if Value < 0 then Value := 0; + TreeList.FDelayTimer.Enabled := Value > 0; + TreeList.FDelayTimer.Interval := Value; +end; + +procedure TcxTreeListOptionsBehavior.SetIncSearchItem(Value: TcxTreeListColumn); +begin + inherited IncSearchItem := Value; +end; + +{ TcxTreeListOptionsData } + +constructor TcxTreeListOptionsData.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + Deleting := True; +end; + +procedure TcxTreeListOptionsData.Assign(Source: TPersistent); +begin + if Source is TcxTreeListOptionsData then + begin + FState := TcxTreeListOptionsData(Source).FState; + SummaryNullIgnore := TcxTreeListOptionsData(Source).SummaryNullIgnore; + end; + inherited Assign(Source); +end; + +procedure TcxTreeListOptionsData.Changed; +begin + inherited Changed; + TcxCustomTreeListControl(GetOwner).RefreshNavigatorButtons; +end; + +function TcxTreeListOptionsData.GetState(Index: Integer): Boolean; +begin + Result := cxGetState(FState, Index); +end; + +procedure TcxTreeListOptionsData.SetState(Index: Integer; Value: Boolean); +begin + cxSetState(FState, Index, Value); + Changed; +end; + +function TcxTreeListOptionsData.GetAnsiSort: Boolean; +begin + Result := dcoAnsiSort in + TcxCustomTreeListControl(GetOwner).DataController.Options; +end; + +function TcxTreeListOptionsData.GetCaseInsensitive: Boolean; +begin + Result := dcoCaseInsensitive in + TcxCustomTreeListControl(GetOwner).DataController.Options; +end; + +function TcxTreeListOptionsData.GetSummaryNullIgnore: Boolean; +begin + Result := soNullIgnore in + TcxCustomTreeListControl(GetOwner).DataController.Summary.Options; +end; + +procedure TcxTreeListOptionsData.SetAnsiSort(Value: Boolean); +begin + with TcxCustomTreeListControl(GetOwner).DataController do + begin + if Value then + Options := Options + [dcoAnsiSort] + else + Options := Options - [dcoAnsiSort] + end; +end; + +procedure TcxTreeListOptionsData.SetCaseInsensitive(Value: Boolean); +begin + with TcxCustomTreeListControl(GetOwner).DataController do + begin + if Value then + Options := Options + [dcoCaseInsensitive] + else + Options := Options - [dcoCaseInsensitive] + end; +end; + +procedure TcxTreeListOptionsData.SetSummaryNullIgnore(Value: Boolean); +begin + if Value then + TcxCustomTreeListControl(GetOwner).DataController.Summary.Options := [soNullIgnore] + else + TcxCustomTreeListControl(GetOwner).DataController.Summary.Options := []; +end; + +{ TcxTreeListPreview } + +constructor TcxTreeListPreview.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FAutoHeight := True; + FLeftIndent := cxTreeListDefPreviewMaxLineCount; + FMaxLineCount := cxTreeListDefPreviewMaxLineCount; + FRightIndent := cxTreeListDefPreviewIndent; +end; + +procedure TcxTreeListPreview.Assign(Source: TPersistent); +var + APreview: TcxTreeListPreview; +begin + if Source is TcxTreeListPreview then + begin + APreview := TcxTreeListPreview(Source); + AutoHeight := APreview.AutoHeight; + if APreview.Column <> nil then + Column := TreeList.Columns[APreview.Column.ItemIndex]; + LeftIndent := APreview.LeftIndent; + MaxLineCount := APreview.MaxLineCount; + Place := APreview.Place; + RightIndent := APreview.RightIndent; + Visible := APreview.Visible; + end + else + inherited Assign(Source); +end; + +procedure TcxTreeListPreview.Changed(ACheckActivate: Boolean); +begin + if not ACheckActivate or (ACheckActivate and Active) then + TreeList.UpdateViewStyles; +end; + +function TcxTreeListPreview.GetControl: TObject; +begin + Result := TreeList; +end; + +function TcxTreeListPreview.GetActive: Boolean; +begin + Result := Visible and (FColumn <> nil); +end; + +function TcxTreeListPreview.GetTreeList: TcxCustomTreeListControl; +begin + Result := TcxCustomTreeListControl(GetOwner); +end; + +procedure TcxTreeListPreview.SetAutoHeight(Value: Boolean); +begin + if Value <> FAutoHeight then + begin + FAutoHeight := Value; + Changed(True); + end; +end; + +procedure TcxTreeListPreview.SetColumn(Value: TcxTreeListColumn); +begin + if Value <> FColumn then + begin + FColumn := Value; + Changed(False); + end; +end; + +procedure TcxTreeListPreview.SetLeftIndent(Value: Integer); +begin + if cxValidateIntDefEx(Value, FLeftIndent, 0) then + begin + FLeftIndent := Value; + Changed(True) + end; +end; + +procedure TcxTreeListPreview.SetMaxLineCount(Value: Integer); +begin + if cxValidateIntDefEx(Value, FMaxLineCount, 0) then + begin + FMaxLineCount := Value; + Changed(True); + end; +end; + +procedure TcxTreeListPreview.SetPlace(Value: TcxTreeListPreviewPlace); +begin + if Value <> FPlace then + begin + FPlace := Value; + Changed(True); + end; +end; + +procedure TcxTreeListPreview.SetRightIndent(Value: Integer); +begin + if cxValidateIntDefEx(Value, FRightIndent, 0) then + begin + FRightIndent := Value; + Changed(True) + end; +end; + +procedure TcxTreeListPreview.SetVisible(Value: Boolean); +begin + if Value <> FVisible then + begin + FVisible := Value; + Changed(False); + end; +end; + +{ TcxTreeListStyleSheet } + +function TcxTreeListStyleSheet.GetStylesValue: TcxTreeListStyles; +begin + Result := TcxTreeListStyles(GetStyles) +end; + +procedure TcxTreeListStyleSheet.SetStylesValue(Value: TcxTreeListStyles); +begin + SetStyles(Value); +end; + +class function TcxTreeListStyleSheet.GetStylesClass: TcxCustomStylesClass; +begin + Result := TcxTreeListStyles; +end; + +{ TcxTreeListStyles } + +procedure TcxTreeListStyles.Assign(Source: TPersistent); +var + I: Integer; +begin + if Source is TcxTreeListStyles then + begin + for I := tlsv_BandBackground to tlsv_Preview do + SetValue(I, TcxTreeListStyles(Source).GetValue(I)); + end; + inherited Assign(Source); +end; + +function TcxTreeListStyles.GetBandBackgroundParams( + ABand: TcxTreeListBand): TcxViewParams; +begin + cxStylesToViewParams(Self, tlsv_BandBackground, nil, + [GetStyleFromEvent(FOnGetBandBackgroundStyle, ABand), + ABand.Styles.HeaderBackground, BandBackground], Result); +end; + +function TcxTreeListStyles.GetBandContentParams(ABand: TcxTreeListBand; + ANode: TcxTreeListNode): TcxViewParams; +begin + DoGetBandContentParams(ANode, ABand, Result); +end; + +function TcxTreeListStyles.GetBandHeaderParams( + ABand: TcxTreeListBand): TcxViewParams; +begin + cxStylesToViewParams(Self, tlsv_BandHeader, nil, + [GetStyleFromEvent(FOnGetBandHeaderStyle, ABand), + ABand.Styles.Header, BandHeader], Result); +end; + +function TcxTreeListStyles.GetBandFooterParams( + ABand: TcxTreeListBand): TcxViewParams; +begin + cxStylesToViewParams(Self, tlsv_Footer, nil, + [GetStyleFromEvent(FOnGetBandFooterStyle, ABand), + ABand.Styles.Footer, Footer], Result); +end; + +function TcxTreeListStyles.GetColumnContentParams( + AColumn: TcxTreeListColumn; IsOdd: Boolean): TcxViewParams; +begin + Result := AColumn.Styles.ContentParams[IsOdd]; +end; + +function TcxTreeListStyles.GetColumnHeaderParams( + AColumn: TcxTreeListColumn): TcxViewParams; +begin + cxStylesToViewParams(Self, tlsv_ColumnHeader, nil, + [GetStyleFromEvent(FOnGetColumnHeaderStyle, AColumn), + AColumn.Styles.Header, ColumnHeader], Result); +end; + +function TcxTreeListStyles.GetColumnFooterParams( + AColumn: TcxTreeListColumn): TcxViewParams; +begin + if AColumn.OwnerBand <> nil then + begin + Result := GetBandFooterParams(AColumn.OwnerBand); + cxParamsCombine(ColumnFooter, + cxParamsCombine(AColumn.Styles.Footer, [], Result), Result) ; + end + else + cxStylesToViewParams(Self, tlsv_ColumnFooter, nil, + [GetStyleFromEvent(FOnGetColumnFooterStyle, AColumn), + AColumn.Styles.Footer, ColumnFooter, Footer], Result); +end; + +function TcxTreeListStyles.GetContentParams(ANode: TcxTreeListNode; + AColumn: TcxTreeListColumn): TcxViewParams; +begin + if not ANode.IsVisible then ANode.FVisibleIndex := -1; + DoGetContentParams(ANode, AColumn, Result); +end; + +function TcxTreeListStyles.GetFooterParams: TcxViewParams; +begin + cxStylesToViewParams(Self, tlsv_Footer, nil, [Footer], Result); +end; + +function TcxTreeListStyles.GetIncSearchParams: TcxViewParams; +begin + GetViewParams(tlsv_IncSearch, nil, IncSearch, Result); +end; + +function TcxTreeListStyles.GetIndentParams( + ANode: TcxTreeListNode; AIndent: Integer): TcxViewParams; + + function GetIndentParams: TcxViewParams; + var + AStyle: TcxStyle; + begin + with TreeList.OptionsView do + begin + AIndent := ANode.Level - AIndent + Byte(ShowRoot); + if IsCategorizedPaint then + while AIndent > 0 do + begin + ANode := ANode.Parent; + Dec(AIndent); + end; + AStyle := nil; + if Assigned(FOnGetContentStyle) and (ANode <> ANode.Owner.Root) then + FOnGetContentStyle(Control, nil, ANode, AStyle); + if (UseNodeColorForIndent or (AIndent < 0)) then + begin + Result := ContentParams[Odd(ANode.FVisibleIndex)]; + cxParamsCombine(AStyle, [], Result); + end + else + cxStylesToViewParams(Self, tlsv_Content, nil, [AStyle, Content], Result); + end; + end; + +var + AStyle: TcxStyle; +begin + AStyle := nil; + Result.Bitmap := nil; + if Assigned(FOnGetNodeIndentStyle) then + FOnGetNodeIndentStyle(Control, ANode, AIndent, AStyle); + Result := GetIndentParams; + cxParamsCombine(AStyle, [], Result); +end; + +function TcxTreeListStyles.GetIndicatorParams: TcxViewParams; +begin + cxStylesToViewParams(Self, tlsv_Indicator, nil, [Indicator], Result); +end; + +function TcxTreeListStyles.GetPreviewParams(ANode: TcxTreeListNode): TcxViewParams; +var + AStyle: TcxStyle; +begin + DoGetContentParams(ANode, TreeList.Preview.Column, Result); + AStyle := GetStyleFromEvent(FOnGetPreviewStyle, ANode); + cxParamsCombine(Preview, cxParamsCombine(AStyle, [], Result), Result); +end; + +procedure TcxTreeListStyles.ContentStyleChanged; +var + I: Integer; + B: Boolean; +begin + cxStylesToViewParams(Self, tlsv_Preview, nil, [Preview], CachedPreviewStyle); + for B := False to True do + begin + cxStylesToViewParams(Self, tlsv_Content, nil, + [GetValue(tlsv_ContentEven + Byte(B)), Content], ContentParams[B]); + end; + with TreeList do + begin + for I := 0 to Bands.Count - 1 do + Bands[I].Styles.CachedContentStyleChanged; + for I := 0 to ColumnCount - 1 do + Columns[I].Styles.CachedContentStyleChanged; + end; +end; + +procedure TcxTreeListStyles.DoGetContentParams( + ANode: TcxTreeListNode; AColumn: TcxTreeListColumn; var AParams: TcxViewParams); +var + AStyle: TcxStyle; + AValues: TcxStyleValues; +begin + if AColumn <> TreeList.Preview.Column then + begin + AParams := AColumn.Styles.ContentParams[Odd(ANode.FVisibleIndex)]; + if DoGetBandContentStyle(ANode, AColumn.OwnerBand, AStyle) then + cxParamsCombine(AStyle, [], AParams); + AStyle := nil; + end + else + begin + AStyle := nil; + AParams := ContentParams[Odd(ANode.FVisibleIndex)]; + end; + if Assigned(FOnGetContentStyle) then + FOnGetContentStyle(Control, AColumn, ANode, AStyle); + cxParamsCombine(AStyle, [], AParams); + if ANode.HotTrack and (not TreeList.IsEditing or (TreeList.FocusedNode <> ANode)) then + begin + AStyle := nil; + if Assigned(FOnGetHotTrackStyle) then + FOnGetHotTrackStyle(Control, AColumn, ANode, AStyle); + AValues := cxParamsCombine(HotTrack, cxParamsCombine(AStyle, [], AParams), AParams); + if not (svTextColor in AValues) then + AParams.TextColor := clHighLightText; + end; +end; + +procedure TcxTreeListStyles.DoGetBandContentParams( + ANode: TcxTreeListNode; ABand: TcxTreeListBand; var AParams: TcxViewParams); +var + AStyle: TcxStyle; +begin + AParams := ABand.Styles.ContentParams[Odd(ANode.FVisibleIndex)]; + DoGetBandContentStyle(ANode, ABand, AStyle); + cxParamsCombine(BandContent, cxParamsCombine(AStyle, [], AParams), AParams); +end; + +function TcxTreeListStyles.DoGetBandContentStyle( + ANode: TcxTreeListNode; ABand: TcxTreeListBand; out AStyle: TcxStyle): Boolean; +begin + AStyle := nil; + if Assigned(FOnGetBandContentStyle) then + FOnGetBandContentStyle(TreeList, ABand, ANode, AStyle); + Result := AStyle <> nil; +end; + +procedure TcxTreeListStyles.GetDefaultViewParams( + Index: Integer; AData: TObject; out AParams: TcxViewParams); +begin + with TcxCustomTreeListControl(Control).LookAndFeelPainter, AParams do + begin + Bitmap := nil; + Font := TcxCustomTreeListControl(Control).Font; + case Index of + tlsv_Preview, tlsv_ContentOdd, tlsv_ContentEven, tlsv_Content: + begin + Color := DefaultContentColor; + TextColor := DefaultContentTextColor; + end; + tlsv_BandHeader, tlsv_Indicator, tlsv_ColumnHeader: + begin + Color := DefaultHeaderColor; + TextColor := DefaultHeaderTextColor; + end; + tlsv_Footer, tlsv_ColumnFooter: + begin + Color := DefaultFooterColor; + TextColor := DefaultFooterTextColor; + end; + tlsv_BandBackground: + begin + Color := DefaultHeaderBackgroundColor; + TextColor := DefaultHeaderBackgroundTextColor; + end; + tlsv_IncSearch: + begin + Color := DefaultSelectionColor; + TextColor := DefaultSelectionTextColor; + end; + else + inherited GetDefaultViewParams(Index, AData, AParams); + end; + end; +end; + +function TcxTreeListStyles.GetStyleFromEvent( + const AEvent: TcxtlOnGetItemStyleEvent; AItem: TObject): TcxStyle; +begin + Result := nil; + if Assigned(AEvent) then AEvent(Control, AItem, Result); +end; + +function TcxTreeListStyles.SelectionFontAssigned: Boolean; +begin + if TreeList.Controller.Focused or Control.Focused then + Result := (Selection <> nil) and (cxStyles.svFont in Selection.AssignedValues) + else + Result := (Inactive <> nil) and (cxStyles.svFont in Inactive.AssignedValues); +end; + +function TcxTreeListStyles.GetTreeList: TcxCustomTreeListControl; +begin + Result := TcxCustomTreeListControl(GetOwner); +end; + +{ TcxTreeListItemsCustomizeListBox } + +constructor TcxTreeListItemsCustomizeListBox.CreateEx(AOwner: TComponent; + ATreeList: TcxCustomTreeListControl; IsBandListBox: Boolean); +begin + inherited Create(AOwner); + Style.HotTrack := False; + FDragAndDropItemIndex := -1; + OnMeasureItem := MeasureItem; + InnerListBox.OnDrawItem := DoDrawItemEx; + OnDrawItem := DoDrawItem; + FTreeList := ATreeList; + FIsBandListBox := IsBandListBox; + ListStyle := lbOwnerDrawVariable; + Style.LookAndFeel.MasterLookAndFeel := ATreeList.LookAndFeel; +end; + +procedure TcxTreeListItemsCustomizeListBox.BeginDrag; +begin + SetCaptureControl(TreeList); + FPrevCursor := Screen.Cursor; + if FDragAndDropObject <> nil then Exit; + FDragAndDropObject := TcxTreeListDragAndDropObject.Create(TreeList); + InitDragAndDropObject; + TreeList.DragAndDropState := ddsStarting; + TreeList.Customizing.FDragAndDropObject := FDragAndDropObject; + FDragAndDropObject.BeginDragAndDrop; + SetCaptureControl(Self); + TreeList.Customizing.FForm.StartDeactivationTimer(Self); + FAccepted := True; +end; + +procedure TcxTreeListItemsCustomizeListBox.FocusChanged; +begin + if not IsFocused then + FinishDrag(False); + inherited FocusChanged; +end; + +procedure TcxTreeListItemsCustomizeListBox.DoDrawItem(AControl: TcxListBox; + ACanvas: TcxCanvas; AIndex: Integer; ARect: TRect; AState: TOwnerDrawState); +var + R: TRect; + ABitmap: TBitmap; + ABmpCanvas: TcxCanvas; +begin + ABitmap := cxCreateBitmap(cxRectSize(ARect)); + ABmpCanvas := TcxCanvas.Create(ABitmap.Canvas); + try + R := cxRectOffset(ARect, cxPointInvert(ARect.TopLeft)); + with TcxTreeListHeaderViewInfo(Items.Objects[AIndex]) do + begin + InitViewParams; + if Painter.HeaderDrawCellsFirst then + begin + ABmpCanvas.Brush.Color := Color; + ABmpCanvas.FillRect(R); + end; + with TcxTreeListControlPainter(TreeList.Painter) do + begin + ExtDrawHeader(ABmpCanvas, R, cxRectInflate(R, -2, -2), [], + cxBordersAll, cxbsNormal, AlignHorz, AlignVert, False, True, Text, + ViewParams.Font, ViewParams.TextColor, ViewParams.Color, nil); + end; + end; + ACanvas.Draw(ARect.Left, ARect.Top, ABitmap); + finally + ABmpCanvas.Free; + ABitmap.Free; + end; +end; + +procedure TcxTreeListItemsCustomizeListBox.DoDrawItemEx(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +begin +end; + +procedure TcxTreeListItemsCustomizeListBox.EndDrag(Accepted: Boolean); +begin + if FDragAndDropObject <> nil then + begin + TreeList.BeginUpdate; + try + try + if not Accepted then FAccepted := False; + FDragAndDropObject.EndDragAndDrop(FAccepted); + finally + FreeAndNil(FDragAndDropObject); + TreeList.Customizing.FDragAndDropObject := nil; + Screen.Cursor := FPrevCursor; + end; + finally + TreeList.DragAndDropState := ddsNone; + if not FAccepted then + TreeList.CancelUpdate + else + TreeList.EndUpdate; + end; + TreeList.Controller.EndDragAndDrop(Accepted); + end; +end; + +procedure TcxTreeListItemsCustomizeListBox.FinishDrag(Accepted: Boolean); + +begin + if FDragAndDropObject <> nil then + begin + TreeList.BeginUpdate; + try + try + if not Accepted then FAccepted := False; + with FDragAndDropObject do + DragDropInfo.Accepted := DragDropInfo.Accepted and FAccepted; + FDragAndDropObject.EndDragAndDrop(FAccepted); + finally + FreeAndNil(FDragAndDropObject); + TreeList.Customizing.FDragAndDropObject := nil; + Screen.Cursor := FPrevCursor; + end; + finally + TreeList.DragAndDropState := ddsNone; + if not FAccepted then + TreeList.CancelUpdate + else + TreeList.EndUpdate; + end; + TreeList.Controller.EndDragAndDrop(Accepted); + end; +end; + +procedure TcxTreeListItemsCustomizeListBox.InitDragAndDropObject; +var + AInfo: TcxTreeListHeaderViewInfo; +begin + FOrgPoint := Point(0, 0); + MapWindowPoint(Handle, TreeList.Handle, FOrgPoint); + AInfo := TcxTreeListHeaderViewInfo(Items.Objects[ItemIndex]); + AInfo.InitViewParams; + TreeList.Controller.DragItem := AInfo; + AInfo.DisplayRect := cxRectOffset(ItemRect(ItemIndex), + [cxPointInvert(ScreenToClient(Mouse.CursorPos)), + cxPointInvert(TreeList.ClientToScreen(Point(0, 0)))]); + AInfo.FTextBounds := cxRectInflate(AInfo.DisplayRect, -2, -2); + AInfo.ClipRect := AInfo.DisplayRect; + AInfo.ItemVisible := True; +end; + +procedure TcxTreeListItemsCustomizeListBox.MouseDown( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + if (Button = mbLeft) and (ItemAtPos(Point(X, Y), True) <> -1) then + begin + FDragAndDropItemIndex := ItemIndex; + FMouseDownPos := Point(X, Y); + end; +end; + +procedure TcxTreeListItemsCustomizeListBox.MouseMove( + Shift: TShiftState; X, Y: Integer); +begin + if (FDragAndDropItemIndex <> -1) and + (not IsPointInDragDetectArea(FMouseDownPos, X, Y) or + (ItemAtPos(Point(X, Y), True) <> FDragAndDropItemIndex)) then + begin + ItemIndex := FDragAndDropItemIndex; + BeginDrag; + FDragAndDropItemIndex := -1; + end; + if FDragAndDropObject <> nil then + begin + TreeList.DragAndDropState := ddsInProcess; + DragAndDropObject.PrevMousePos := DragAndDropObject.CurMousePos; + DragAndDropObject.CurMousePos := ClientToScreen(Point(X, Y)); + DragAndDropObject.DragAndDrop(cxPointOffset(FOrgPoint, X, Y), FAccepted); + end + else + inherited MouseMove(Shift, X, Y); +end; + +procedure TcxTreeListItemsCustomizeListBox.MouseUp( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + if DragAndDropObject <> nil then + begin + FinishDrag(True); + RefreshList; + Update; + end; + FDragAndDropItemIndex := -1; +end; + +function TcxTreeListItemsCustomizeListBox.GetItemHeight(AItem: Integer): Integer; +begin + if FIsBandListBox then + Result := TreeList.RealBandLineHeight + else + Result := TreeList.ViewInfo.HeaderLineHeight; + if Result = 0 then Result := ItemHeight; +end; + +procedure TcxTreeListItemsCustomizeListBox.KeyDown( + var Key: Word; Shift: TShiftState); +begin + inherited KeyDown(Key, Shift); + if (Key = VK_ESCAPE) and (FDragAndDropObject <> nil) then + begin + FDragAndDropObject.DragDropInfo.Accepted := False; + FinishDrag(False); + end; +end; + +procedure TcxTreeListItemsCustomizeListBox.MeasureItem(AControl: TcxListBox; + Index: Integer; var Height: Integer); +begin + Height := GetItemHeight(Index); +end; + +procedure TcxTreeListItemsCustomizeListBox.RefreshList; +var + I: Integer; + AIndex: Integer; +begin + AIndex := ItemIndex; + Items.BeginUpdate; + Items.Clear; + with FTreeList do + try + if FIsBandListBox then + begin + for I := 0 to Bands.Count - 1 do + if not Bands[I].Visible and not Bands[I].Options.Hidden then + Self.Items.AddObject('', Bands[I].ViewInfo.BandHeader); + end + else + begin + for I := 0 to ColumnCount - 1 do + if not Columns[I].Visibility and not Columns[I].Options.Hidden then + Self.Items.AddObject('', Columns[I].ViewInfo.ColumnHeader); + end; + finally + if AIndex >= Self.Items.Count then + AIndex := Self.Items.Count - 1; + ItemIndex := AIndex; + Self.Items.EndUpdate; + end; + Update; +end; + +procedure TcxTreeListItemsCustomizeListBox.Resize; +begin + inherited Resize; + InnerListBox.Invalidate +end; + +procedure TcxTreeListItemsCustomizeListBox.WMCancelMode(var Message: TWMCancelMode); +begin + inherited; + FinishDrag(False); +end; + +function TcxTreeListItemsCustomizeListBox.GetPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := TreeList.LookAndFeel.Painter; +end; + +{ TcxTreeListCustomizationForm } + +constructor TcxTreeListCustomizationForm.CreateEx(AOwner: TcxTreeListCustomizing); +begin + CreateNew(nil); + FOwner := AOwner; + FHookTimer := TcxTimer.Create(Self); + FHookTimer.Enabled := False; + FHookTimer.Interval := 10; + FHookTimer.OnTimer := HookTimerHandler; + + FDeactivationTimer := TTimer.Create(Self); + FDeactivationTimer.Enabled := False; + FDeactivationTimer.Interval := 10; +end; + +destructor TcxTreeListCustomizationForm.Destroy; +begin + FreeAndNil(FHookTimer); + FreeAndNil(FDeactivationTimer); + inherited Destroy; +end; + +function TcxTreeListCustomizationForm.GetTreeList: TcxCustomTreeListControl; +begin + Result := Customizing.TreeList; +end; + +procedure TcxTreeListCustomizationForm.CreateParams(var Params: TCreateParams); +begin + inherited; + with Params do + begin + Style := Style or WS_POPUP; + if not TreeList.IsDestroying then + WndParent := TreeList.Handle + else + WndParent := 0; + end; +end; + +procedure TcxTreeListCustomizationForm.DeactivationTimeHandler(Sender: TObject); +begin + if not Active then + begin + StopDeactivationTimer; + end; +end; + +procedure TcxTreeListCustomizationForm.StartDeactivationTimer( + Sender: TcxTreeListItemsCustomizeListBox); +begin + FCustomizingListBox := Sender; + FDeactivationTimer.Enabled := True; + FDeactivationTimer.OnTimer := DeactivationTimeHandler; +end; + +procedure TcxTreeListCustomizationForm.StopDeactivationTimer; +begin + if FCustomizingListBox <> nil then + try + FCustomizingListBox.FinishDrag(False); + FDeactivationTimer.Enabled := False; + FDeactivationTimer.OnTimer := nil; + finally + FCustomizingListBox := nil; + Invalidate; + Update; + end; +end; + +procedure TcxTreeListCustomizationForm.HookTimerHandler(Sender: TObject); +begin + if IsIconic(Application.Handle) then + Visible := False + else + if not TreeList.Visible or not IsWindowVisible(TreeList.Handle) then + Customizing.Visible := False + else + if not Visible then + begin + ShowWindow(Handle, SW_SHOWNOACTIVATE); + Visible := True; + end; +end; + +{ TcxTreeListCustomizing } + +constructor TcxTreeListCustomizing.Create(AOwner: TPersistent); +begin + FTreeList := TcxCustomTreeListControl(AOwner); + FVisible := False; + FRowCount := 10; + FLastPosition := cxPoint(-1000, -1000); +end; + +destructor TcxTreeListCustomizing.Destroy; +begin + Visible := False; + inherited Destroy; +end; + +procedure TcxTreeListCustomizing.Assign(Source: TPersistent); +begin + if Source is TcxTreeListCustomizing then + begin + RowCount := TcxTreeListCustomizing(Source).RowCount; + Visible := TcxTreeListCustomizing(Visible).Visible; + end; +end; + +procedure TcxTreeListCustomizing.MakeBandSheetVisible; +begin + Visible := True; + if FBandListBox.Parent = FTabSheetBands then + FPageControl.ActivePage := FTabSheetBands; +end; + +procedure TcxTreeListCustomizing.MakeColumnSheetVisible; +begin + Visible := True; + if FHeaderListBox.Parent = FTabSheetHeaders then + FPageControl.ActivePage := FTabSheetHeaders; +end; + +function TcxTreeListCustomizing.PtInCustomizingBox(const APoint: TPoint): Boolean; +begin + Result := Visible and (FForm <> nil) and PtInRect(FForm.BoundsRect, APoint); +end; + +procedure TcxTreeListCustomizing.AdjustControls; +var + AParent: TWinControl; +begin + with TreeList do + begin + AParent := FForm; + if not IsSimpleMode then + begin + SetControlParent(FPageControl, FForm); + SetControlParent(FTabSheetBands, FPageControl); + FTabSheetBands.PageControl := FPageControl; + SetControlParent(FBandListBox, FTabSheetBands); + if ColumnCount > 0 then + begin + SetControlParent(FTabSheetHeaders, FPageControl); + FTabSheetHeaders.PageControl := FPageControl; + AParent := FTabSheetHeaders; + end; + end; + if ColumnCount > 0 then + SetControlParent(FHeaderListBox, AParent); + end; + ShowCustomizingForm; +end; + +procedure TcxTreeListCustomizing.Activate(Sender: TObject); +begin +end; + +procedure TcxTreeListCustomizing.Close(Sender: TObject; var Action: TCloseAction); + + function CheckIndex(AListBox: TcxListBox): Integer; + begin + if (AListBox = nil) or (AListBox.Parent = nil) then + Result := -1 + else + Result := AListBox.ItemIndex; + end; + +begin + if FForm <> nil then + TcxTreeListCustomizationForm(FForm).HookTimer.Enabled := False; + FLastPosition := FForm.BoundsRect.TopLeft; + FLastHeaderIndex := CheckIndex(FHeaderListBox); + FLastBandIndex := CheckIndex(FBandListBox); + Action := caHide; + FVisible := False; + TreeList.DoOnCustomizationVisibleChanged; +end; + +procedure TcxTreeListCustomizing.CreateControls; +begin + if FForm <> nil then + begin + FForm.Show; + Exit; + end; + CreateCustomizingForm; + FForm.OnClose := Close; + FHeaderListBox := TcxTreeListItemsCustomizeListBox.CreateEx(nil, TreeList, False); + if not IsSimpleMode then + begin + FBandListBox := TcxTreeListItemsCustomizeListBox.CreateEx(nil, TreeList, True); + FPageControl := TPageControl.Create(nil); + FPageControl.HotTrack := True; + FTabSheetBands := TTabSheet.Create(FPageControl); + FTabSheetBands.Caption := cxGetResourceString(@scxBandsCaption); + FTabSheetBands.TabVisible := True; + FTabSheetHeaders := TTabSheet.Create(FPageControl); + FTabSheetHeaders.Caption := cxGetResourceString(@scxColumnsCaption); + FTabSheetBands.TabVisible := True; + end; + AdjustControls; +end; + +procedure TcxTreeListCustomizing.CreateCustomizingForm; +var + I: Integer; +const + UnusedItems: array[0..4, 0..1] of Integer = + ((7, MF_BYPOSITION), (5, MF_BYPOSITION), (SC_MAXIMIZE, MF_BYCOMMAND), + (SC_MINIMIZE, MF_BYCOMMAND), (SC_RESTORE, MF_BYCOMMAND)); +begin + FForm := TcxTreeListCustomizationForm.CreateEx(Self); + with FForm do + begin + Visible := False; + Caption := cxGetResourceString(@scxCustomizeCaption); + BorderStyle := bsSizeToolWin; + BorderIcons := [biSystemMenu]; + Font.Assign(TreeList.Font); + ClientWidth := SizeDelta.cx * cxTextWidth(Font, '0'); + FLineHeight := cxTextHeight(Font) + SizeDelta.cy; + ClientHeight := (RowCount + 1) * FLineHeight; + Color := clBtnFace; + OnActivate := Self.Activate; + OnClose := Self.Close; + OnShow := VisibleChanged; + OnHide := VisibleChanged; + for I := 0 to High(UnusedItems) do + DeleteMenu(GetSystemMenu(Handle, False), UnusedItems[I, 0], UnusedItems[I, 1]); + end; +end; + +function TcxTreeListCustomizing.IsSimpleMode: Boolean; +begin + with TreeList.OptionsView do + Result := SimpleCustomizeBox or not Bands; +end; + +procedure TcxTreeListCustomizing.LookAndFeelChanged; +begin + if FBandListBox <> nil then + FBandListBox.Invalidate; + if FHeaderListBox <> nil then + FHeaderListBox.Invalidate; + if FPageControl <> nil then + FPageControl.Invalidate; +end; + +procedure TcxTreeListCustomizing.ReleaseControls; +begin + TreeList.Designers.Remove(Self); + if FForm <> nil then + try + FLastPosition := Point(FForm.Left, FForm.Top); + FLastBandIndex := -1; + FLastHeaderIndex := -1; + FForm.Free + finally + FForm := nil; + end; +end; + +procedure TcxTreeListCustomizing.SetControlParent(AControl, AParent: TWinControl); +begin + AControl.Parent := AParent; + if AParent <> nil then + begin + AControl.Align := alClient; + TControlAccess(AControl).ParentFont := True; + TControlAccess(AControl).ParentColor := True; + Visible := True; + end; +end; + +procedure TcxTreeListCustomizing.ShowCustomizingForm; +var + R: TRect; +begin + if (CustomizingPos.X <> -1000) and (CustomizingPos.Y <> -1000) then + begin + FForm.Left := CustomizingPos.X; + FForm.Top := CustomizingPos.Y; + end + else + begin + if GetParentForm(TreeList) = nil then + R := TreeList.BoundsRect + else + R := GetParentForm(TreeList).BoundsRect; + FForm.Left := R.Right - FForm.Width; + FForm.Top := R.Bottom - FForm.Height; + if FForm.Left < 0 then FForm.Left := 0; + if FForm.Top < 0 then FForm.Top := 0; + end; + ValidateListBox(FHeaderListBox, FLastHeaderIndex); + ValidateListBox(FBandListBox, FLastBandIndex); + FForm.Show; +end; + +function TcxTreeListCustomizing.SizeDelta: TSize; +begin + Result := cxSize(28, 4); +end; + +procedure TcxTreeListCustomizing.ComponentRemoved(Sender: TObject); +begin +end; + +procedure TcxTreeListCustomizing.Modified; +begin + if (FHeaderListBox <> nil) and (FHeaderListBox.Parent <> nil) then + FHeaderListBox.RefreshList; + if (FBandListBox <> nil) and (FBandListBox.Parent <> nil) then + FBandListBox.RefreshList; +end; + +procedure TcxTreeListCustomizing.ValidateListBox( + AListBox: TcxTreeListItemsCustomizeListBox; AIndex: Integer); +begin + if (AListBox = nil) or (AListBox.Parent = nil) then Exit; + AListBox.RefreshList; + if (AIndex >= 0) and (AIndex < AListBox.Items.Count) then + AListBox.ItemIndex := AIndex; +end; + +procedure TcxTreeListCustomizing.VisibleChanged(Sender: TObject); +begin + TreeList.DoOnCustomizationVisibleChanged; +end; + +procedure TcxTreeListCustomizing.Update; +begin + if FBandListBox <> nil then FBandListBox.Invalidate; + if FHeaderListBox <> nil then FHeaderListBox.Invalidate; +end; + +function TcxTreeListCustomizing.GetForm: TForm; +begin + Result := FForm; +end; + +function TcxTreeListCustomizing.GetVisible: Boolean; +begin + Result := FVisible and ((FForm <> nil) and FForm.Visible); + FVisible := Result; +end; + +procedure TcxTreeListCustomizing.SetRowCount(Value: Integer); +begin + if Value < 2 then Value := 2; + if Value <> FRowCount then + FRowCount := Value; +end; + +procedure TcxTreeListCustomizing.SetVisible(Value: Boolean); + + function CanVisible: Boolean; + begin + with TreeList.OptionsView do + Result := ((TreeList.Bands.Count > 0) and Bands and not SimpleCustomizeBox) or + (Headers and (TreeList.ColumnCount > 0)); + end; + +begin + if Value <> FVisible then + begin + if Value and not CanVisible then Exit; + FVisible := Value; + if FForm <> nil then + TcxTreeListCustomizationForm(FForm).HookTimer.Enabled := False; + if not Value then + ReleaseControls + else + begin + CreateControls; + TreeList.Designers.Add(Self); + Form.Visible := True; + TcxTreeListCustomizationForm(FForm).HookTimer.Enabled := True; + end; + end; +end; + +{ TcxCustomTreeListControl } + +constructor TcxCustomTreeListControl.Create(AOwner: TComponent); +begin + FNodesList := TList.Create; + FDeletedNodes := TList.Create; + inherited Create(AOwner); + ControlStyle := ControlStyle + [csDisplayDragImage]; + FNeedMakeVisible := True; + Width := 250; + Height := 150; + if Assigned(DesignerNavigatorProc) then + DesignerNavigatorProc(Self, True); +end; + +destructor TcxCustomTreeListControl.Destroy; +begin + Customizing.Visible := False; + if Assigned(DesignerNavigatorProc) then + DesignerNavigatorProc(Self, False); + BeginUpdate; + try + inherited Destroy; + finally + FNodesList.Free; + FDeletedNodes.Free; + end; +end; + +procedure TcxCustomTreeListControl.AdjustColumnsWidth; +var + I: Integer; + APrevValue: Boolean; +begin + APrevValue := OptionsView.ColumnAutoWidth; + OptionsView.ColumnAutoWidth := True; + BeginUpdate; + try + for I := 0 to VisibleColumnCount - 1 do + VisibleColumns[I].Width := VisibleColumns[I].RealWidth; + for I := 0 to VisibleBandCount - 1 do + VisibleBands[I].Width := VisibleBands[I].RealWidth; + finally + EndUpdate; + end; + OptionsView.ColumnAutoWidth := APrevValue; +end; + +procedure TcxCustomTreeListControl.ApplyBestFit; +var + I: Integer; +begin + BeginUpdate; + try + FContentIndentWidth := 0; + HandleNeeded; + for I := 0 to VisibleBandCount - 1 do + VisibleBands[I].ApplyBestFit; + finally + EndUpdate; + end; +end; + +procedure TcxCustomTreeListControl.Clear; +begin + BeginUpdate; + try + DoClear; + finally + EndUpdate; + end; +end; + +procedure TcxCustomTreeListControl.DoBandSizeChanged(ABand: TcxTreeListBand); +begin + Modified; + LayoutChanged; + DoOnBandSizeChanged(ABand); +end; + +procedure TcxCustomTreeListControl.DoColumnSizeChanged(AColumn: TcxTreeListColumn); +begin + Modified; + DoOnColumnSizeChanged(AColumn); +end; + +function TcxCustomTreeListControl.DoCreateColumn: TcxTreeListColumn; +begin + Result := GetTreeListColumnClass.Create(Owner); + Result.EditingControl := Self; + Modified; +end; + +function TcxCustomTreeListControl.CreateColumn( + ABand: TcxTreeListBand = nil): TcxTreeListColumn; +begin + BeginUpdate; + try + Result := DoCreateColumn; + if ABand = nil then + begin + if Bands.Count = 0 then Bands.Add; + if VisibleBandCount > 0 then + ABand := VisibleBands[0] + else + ABand := Bands[0] + end; + if (ABand <> nil) and Result.Visible then + Result.Position.FColIndex := ABand.FColumns.Count; + Result.OwnerBand := ABand; + ViewInfo.IsDirty := True; + finally + EndUpdate; + end; +end; + +procedure TcxCustomTreeListControl.DeleteAllColumns; +begin + BeginUpdate; + try + ViewInfo.NodesViewInfo.Clear; + while ColumnCount > 0 do TObject(ContainerList.List^[0]).Free; + finally + EndUpdate; + end; +end; + +procedure TcxCustomTreeListControl.DeleteSelection; +begin + DoDeleteSelection; +end; + +procedure TcxCustomTreeListControl.DragDrop(Source: TObject; X, Y: Integer); +var + AFocusedIndex: Integer; +begin + if Source <> Self then + begin + if Assigned(OnDragDrop) then + OnDragDrop(Self, Source, X, Y); + Controller.DragDrop(Source, X, Y); + Exit; + end; + HitTest.HitPoint := Point(X, Y); + AFocusedIndex := -1; + try + if DragNode <> nil then + AFocusedIndex := DragNode.RecordIndex; + if Assigned(OnDragDrop) then + OnDragDrop(Self, Source, X, Y); + Controller.DragDrop(Source, X, Y); + if FocusedNode <> nil then + FocusedNode.MakeVisible; + finally + FDragNode := nil; + if AFocusedIndex < DataController.RecordCount then + DataController.FocusedRecordIndex := AFocusedIndex; + if FocusedNode <> nil then + FocusedNode.MakeVisible; + RestoreDragPos; + end; +end; + +function TcxCustomTreeListControl.GetIndentWidth(IsLeftMost: Boolean): Integer; +begin + if IsLeftMost then + Result := FContentIndentWidth + else + Result := 0; +end; + +procedure TcxCustomTreeListControl.MakeDefaultLayout; +var + I: Integer; +begin + BeginUpdate; + try + OptionsView.Bands := False; + while Bands.Count > 1 do + Bands[Bands.Count - 1].Free; + if Bands.Count = 0 then Bands.Add; + Bands[0].RestoreDefaults; + Bands[0].Visible := True; + for I := 0 to ColumnCount - 1 do + with Columns[I] do + begin + RestoreDefaults; + Position.BandIndex := 0; + end; + finally + EndUpdate; + Modified; + FDefaultLayout := True; + end; +end; + +procedure TcxCustomTreeListControl.FullCollapse; +begin + Nodes.Root.Collapse(True); +end; + +procedure TcxCustomTreeListControl.FullExpand; +begin + Nodes.Root.Expand(True); +end; + +procedure TcxCustomTreeListControl.FullRefresh; +begin + LayoutChanged; +end; + +function TcxCustomTreeListControl.Find(AData: Pointer; + AStart: TcxTreeListNode; AExpandedOnly, AForward: Boolean; + AFilter: TcxTreeListFindFunc): TcxTreeListNode; +begin + Result := cxFind(Self, AData, AStart, AExpandedOnly, AForward, AFilter); +end; + +type + PFindTextInfo = ^TFindTextInfo; + TFindTextInfo = record + Text: string; + Column: TcxTreeListColumn; + end; + +function FindTextFilter(ANode: TcxTreeListNode; AData: Pointer): Boolean; +begin + with PFindTextInfo(AData)^ do + Result := AnsiStrPos(PChar(ANode.Texts[Column.ItemIndex]), PChar(Text)) <> nil; +end; + +function TcxCustomTreeListControl.FindNodeByText(const AText: string; + AColumn: TcxTreeListColumn; AStartNode: TcxTreeListNode = nil; + AExpandedOnly: Boolean = False; AForward: Boolean = True): TcxTreeListNode; +var + AFindInfo: TFindTextInfo; +begin + AFindInfo.Text := AText; + AFindInfo.Column := AColumn; + Result := Find(@AFindInfo, AStartNode, AExpandedOnly, AForward, FindTextFilter) +end; + +procedure TcxCustomTreeListControl.SetFocusedNode( + Value: TcxTreeListNode; AShift: TShiftState); +var + ARecordIndex: Integer; +begin + ARecordIndex := cxInvalidIndex; + if (Value <> nil) and Value.IsVisible then + ARecordIndex := Value.RecordIndex + else + if Value <> nil then Exit; + if ARecordIndex = cxInvalidIndex then + DataController.FocusedRecordIndex := cxInvalidIndex + else + begin + if OptionsBehavior.AlwaysShowEditor then + Controller.SetFocusedRecordItem(ARecordIndex, FocusedColumn) + else + Controller.FocusedRecordIndex := ARecordIndex; + end; +end; + +procedure TcxCustomTreeListControl.SetColumnSortOrder(AColumn: TcxTreeListColumn; + ASortOrder: TcxDataSortOrder; AShift: TShiftState); +begin + Controller.DoChangeColumnSortOrder(AColumn, ASortOrder, AShift); +end; + +procedure TcxCustomTreeListControl.SelectAll; +begin + if not OptionsSelection.MultiSelect or (Nodes.Count = 0) then Exit; + BeginUpdateSelection; + try + DoSelectAll; + finally + EndUpdateSelection; + end; +end; + +procedure TcxCustomTreeListControl.CancelEdit; +begin + Controller.EditingController.HideEdit(False); +end; + +procedure TcxCustomTreeListControl.HideEdit; +begin + Controller.EditingController.HideEdit(True); +end; + +procedure TcxCustomTreeListControl.Select(Node: TcxTreeListNode; + ShiftState: TShiftState = []); +begin + Controller.Select(Node, ShiftState); +end; + +procedure TcxCustomTreeListControl.Select(const ANodes: array of TcxTreeListNode); +var + I: Integer; +begin + BeginUpdateSelection; + try + ClearSelection; + for I := Low(ANodes) to High(ANodes) do + ANodes[I].Selected := True; + finally + EndUpdateSelection; + end; +end; + +procedure TcxCustomTreeListControl.Select(ANodes: TList); +begin + BeginUpdateSelection; + if Nodes <> nil then + try + ClearSelection; + FSelection.Count := ANodes.Count; + if FSelection.Count > 0 then + System.Move(ANodes.List^, FSelection.List^[0], SizeOf(Integer) * FSelection.Count); + finally + EndUpdateSelection; + end + else + CancelUpdateSelection; +end; + +procedure TcxCustomTreeListControl.Deselect(Node: TcxTreeListNode); +begin + Node.Selected := False; +end; + +procedure TcxCustomTreeListControl.ShowEdit; +begin + if not OptionsData.Editing then Exit; + DataController.Edit; + Controller.EditingController.ShowEdit(); +end; + +procedure TcxCustomTreeListControl.ShowEditByKey(AKey: Char); +begin + BeforeShowingEdit; + with Controller do + EditingController.ShowEdit(FocusedItem, AKey); +end; + +procedure TcxCustomTreeListControl.ShowEditByMouse(X, Y: Integer; AShift: TShiftState); +begin + BeforeShowingEdit; + with Controller do + EditingController.ShowEdit(FocusedItem, AShift, X, Y); +end; + +procedure TcxCustomTreeListControl.RestoreFromIniFile(const AStorageName: string; + AChildrenCreating: Boolean = False; AChildrenDeleting: Boolean = False); +var + AStorage: TcxStorage; +begin + AStorage := TcxStorage.Create(AStorageName); + try + AStorage.NamePrefix := Name; + if AChildrenCreating then + AStorage.Modes := [smChildrenCreating]; + if AChildrenDeleting then + AStorage.Modes := AStorage.Modes + [smChildrenDeleting]; + BeginUpdate; + try + AStorage.UseInterfaceOnly := True; + AStorage.RestoreFromIni(Self); + finally + EndUpdate; + end; + finally + AStorage.Free; + end; +end; + +procedure TcxCustomTreeListControl.RestoreFromRegistry(const AStorageName: string; + AChildrenCreating: Boolean = False; AChildrenDeleting: Boolean = False); +var + AStorage: TcxStorage; +begin + AStorage := TcxStorage.Create(AStorageName); + try + AStorage.UseInterfaceOnly := True; + AStorage.NamePrefix := Name; + if AChildrenCreating then + AStorage.Modes := [smChildrenCreating]; + if AChildrenDeleting then + AStorage.Modes := AStorage.Modes + [smChildrenDeleting]; + BeginUpdate; + try + AStorage.RestoreFromRegistry(Self); + finally + EndUpdate; + end; + finally + AStorage.Free; + end; +end; + +procedure TcxCustomTreeListControl.RestoreFromStream(AStream: TStream; + AChildrenCreating: Boolean = False; AChildrenDeleting: Boolean = False); +var + AStorage: TcxStorage; +begin + AStorage := TcxStorage.Create(AStream); + try + AStorage.UseInterfaceOnly := True; + AStorage.NamePrefix := Name; + if AChildrenCreating then + AStorage.Modes := [smChildrenCreating]; + if AChildrenDeleting then + AStorage.Modes := AStorage.Modes + [smChildrenDeleting]; + BeginUpdate; + try + AStorage.RestoreFromStream(Self); + finally + EndUpdate; + end; + finally + AStorage.Free; + end; +end; + +procedure TcxCustomTreeListControl.StoreToIniFile(AStorageName: string; + AReCreate: Boolean = True); +var + AStorage: TcxStorage; +begin + AStorage := TcxStorage.Create(AStorageName); + try + AStorage.UseInterfaceOnly := True; + AStorage.NamePrefix := Name; + AStorage.ReCreate := AReCreate; + AStorage.StoreToIni(Self); + finally + AStorage.Free; + end; +end; + +procedure TcxCustomTreeListControl.StoreToRegistry(AStorageName: string; + AReCreate: Boolean = True); +var + AStorage: TcxStorage; +begin + AStorage := TcxStorage.Create(AStorageName); + try + AStorage.UseInterfaceOnly := True; + AStorage.NamePrefix := Name; + AStorage.ReCreate := AReCreate; + AStorage.StoreToRegistry(Self); + finally + AStorage.Free; + end; +end; + +procedure TcxCustomTreeListControl.StoreToStream(AStream: TStream); +var + AStorage: TcxStorage; +begin + AStorage := TcxStorage.Create(AStream); + try + AStorage.UseInterfaceOnly := True; + AStorage.NamePrefix := Name; + AStorage.StoreToStream(Self); + finally + AStorage.Free; + end; +end; + +function TcxCustomTreeListControl.CellRect( + ANode: TcxTreeListNode; AColumn: TcxTreeListColumn): TRect; +var + AInfo: TcxTreeListEditCellViewInfo; +begin + AInfo := Controller.GetCellFromViewInfoEx(AColumn, ANode); + if AInfo <> nil then + Result := AInfo.ClipRect + else + Result := cxInvalidRect; +end; + +// searching +function TcxCustomTreeListControl.FindNext(AForward: Boolean): Boolean; +var + ANode: TcxTreeListNode; +const + ALocateKeys: array[Boolean] of Word = (VK_UP, VK_DOWN); +begin + if Searching then + begin + ANode := FocusedNode; + Controller.IncSearchKeyDown(ALocateKeys[AForward], [ssCtrl]); + end + else + ANode := nil; + Result := ANode <> FocusedNode; +end; + +procedure TcxCustomTreeListControl.CancelSearching; +begin + Controller.CancelIncSearching; +end; + +function TcxCustomTreeListControl.GetEditRect( + ANode: TcxTreeListNode; AColumn: TcxTreeListColumn): TRect; +var + AInfo: TcxTreeListEditCellViewInfo; +begin + AInfo := Controller.GetCellFromViewInfoEx(AColumn, ANode); + if AInfo <> nil then + Result := AInfo.EditRect + else + Result := cxInvalidRect; +end; + +function TcxCustomTreeListControl.GetNodeAt( + X, Y: Integer): TcxTreeListNode; +begin + HitTest.ReCalculate(cxPoint(X, Y)); + if HitTest.HitAtNode then + Result := HitTest.HitNode + else + Result := nil; +end; + +procedure TcxCustomTreeListControl.CopyAllToClipboard; +begin + DoWriteToClipboard(False); +end; + +procedure TcxCustomTreeListControl.CopySelectedToClipboard; +begin + DoWriteToClipboard(True); +end; + +procedure TcxCustomTreeListControl.RestoreColumnsDefaults; +var + I: Integer; +begin + BeginUpdate; + try + for I := 0 to ColumnCount - 1 do + Columns[I].RestoreDefaults; + RestoreColumnsWidths; + finally + EndUpdate; + end; +end; + +procedure TcxCustomTreeListControl.RestoreColumnsWidths; +var + I: Integer; +begin + BeginUpdate; + try + for I := 0 to ColumnCount - 1 do + Columns[I].RestoreDefaults; + finally + EndUpdate; + end; +end; + +procedure TcxCustomTreeListControl.Subselect(Node: TcxTreeListNode); +begin + if not CanMultiSelect then + cxTreeListError(scxStr(@scxMultiSelectRequired)) + else + Node.Selected := True; +end; + +procedure TcxCustomTreeListControl.ClearSelection(KeepPrimary: Boolean = False); +begin + Controller.CancelSelection(KeepPrimary) +end; + +procedure TcxCustomTreeListControl.ClearSorting; +begin + Sorted := False; +end; + +function TcxCustomTreeListControl.ColumnByName( + const AName: string): TcxTreeListColumn; +var + I: Integer; +begin + Result := nil; + for I := 0 to ColumnCount - 1 do + if CompareText(Columns[I].Name, AName) = 0 then + begin + Result := Columns[I]; + Break; + end; +end; + +function TcxCustomTreeListControl.GetSelections(AList: TList): TcxTreeListNode; +begin + AList.Clear; + if IsMultiSelect then + begin + AList.Count := FSelection.Count; + if FSelection.Count > 0 then + Move(FSelection.List^, AList.List^, FSelection.Count * SizeOf(Integer)); + end + else + AList.Add(FocusedNode); + Result := FocusedNode; +end; + +procedure TcxCustomTreeListControl.GotoBOF; +begin + FocusedNode := Nodes.Root.GetFirstChild; +end; + +procedure TcxCustomTreeListControl.GotoEOF; +begin + FocusedNode := cxGetLatest(Nodes.Root.GetLastChild); +end; + +procedure TcxCustomTreeListControl.GotoNext; +begin + if not IsEOF and (FocusedNode <> nil) then + FocusedNode := FocusedNode.GetNextVisible; +end; + +procedure TcxCustomTreeListControl.GotoNextPage; +begin + Controller.DoNextPage(True, []); +end; + +procedure TcxCustomTreeListControl.GotoPrev; +begin + if not IsBOF and (FocusedNode <> nil) then + FocusedNode := FocusedNode.GetPrevVisible; +end; + +procedure TcxCustomTreeListControl.GotoPrevPage; +begin + Controller.DoNextPage(False, []); +end; + +function TcxCustomTreeListControl.IsBOF: Boolean; +begin + Result := (FocusedNode <> nil) and (FocusedNode.GetPrevVisible = nil); +end; + +function TcxCustomTreeListControl.IsEOF: Boolean; +begin + Result := (FocusedNode <> nil) and (FocusedNode.GetNextVisible = nil); +end; + +procedure TcxCustomTreeListControl.AfterLayoutChanged; +begin + with ViewInfo.NodesViewInfo do + try + if FNeedSynchronize then + begin + SynchronizeTopNode; + FNeedSynchronize := False; + end; + finally + if IsNeedSortPost then DoSortNodes; + inherited AfterLayoutChanged; + DoLayoutChangedEvent; + end; +end; + +procedure TcxCustomTreeListControl.BeforeUpdate; +begin + DoValidateDeletedNodes; + if IsLocked then Exit; + PostUpdateFocusedRecord; + RestoreTopPos; +end; + +procedure TcxCustomTreeListControl.CheckCreateDesignSelectionHelper; +begin +end; + +procedure TcxCustomTreeListControl.ControlUpdateData( + AInfo: TcxUpdateControlInfo); +var + ANode: TcxTreeListNode; +begin + if AInfo is TcxUpdateRecordInfo then + CancelSearching; + if AInfo is TcxDataChangedInfo then + begin + with TcxDataChangedInfo(AInfo) do + begin + if (Kind in [dcField, dcRecord]) and not IsEditing then + begin + ANode := Nodes.Items[RecordIndex]; + if Kind = dcField then + UpdateColumn(ANode, Columns[ItemIndex]) + else + UpdateNode(ANode); + AInfo := nil; + end; + end; + end; + inherited ControlUpdateData(AInfo); + if not IsLocked then + begin + ViewInfo.NodesViewInfo.UpdateData; + ViewInfo.UpdateFootersViewInfo; + end; + RefreshNavigatorButtons; +end; + +procedure TcxCustomTreeListControl.UpdateColumn( + ANode: TcxTreeListNode; AColumn: TcxTreeListColumn); +begin + UpdateNode(ANode); +end; + +procedure TcxCustomTreeListControl.UpdateNode(ANode: TcxTreeListNode); +var + AViewInfo: TcxTreeListNodeViewInfo; +begin + if ViewInfo.NodesViewInfo.FindNodeViewInfo(ANode, AViewInfo) then + begin + AViewInfo.Update(True); + if Sorted then + begin + DoSorting; + try + ANode.Parent.AlphaSort(False); + if ANode.Focused then ANode.MakeVisible; + finally + DoOnAfterSorting; + end; + end; + end; +end; + +procedure TcxCustomTreeListControl.CreateSubClasses; +begin + inherited CreateSubClasses; + FNavigatorNotifier := TcxNavigatorControlNotifier.Create; + FSortedColumns := TList.Create; + FDesigners := TList.Create; + FSelection := TList.Create; + FOptionsCustomizing := GetOptionsCustomizingClass.Create(Self); + FOptionsSelection := GetOptionsSelectionClass.Create(Self); + FNodes := GetNodesClass.Create(Self); + FPreview := GetPreviewClass.Create(Self); + FBandsVisibleList := TList.Create; + FBands := TcxTreeListBands.Create(Self); + FColumnsVisibleList := TList.Create; + FSortOrderList := TList.Create; + FChangeImagesLink := TChangeLink.Create; + FChangeImagesLink.OnChange := OnChangeImages; + FChangeStateImagesLink := TChangeLink.Create; + FChangeStateImagesLink.OnChange := OnChangeImages; + FCustomizing := GetTreeListCustomizingClass.Create(Self); + TcxDataControllerAccess(DataController).OnRecordChanged := DoRecordChanged; + TcxDataControllerAccess(DataController).OnDataChanged := DoDataChangedEvent; + FDelayTimer := TTimer.Create(Self); + FDelayTimer.Enabled := False; + FDelayTimer.Interval := 0; + FDelayTimer.OnTimer := DoChangedTimer; +end; + +procedure TcxCustomTreeListControl.DataChanged; +begin + inherited DataChanged; + DoSortNodes; +end; + +procedure TcxCustomTreeListControl.DataLayoutChanged; +begin + inherited DataLayoutChanged; +end; + +procedure TcxCustomTreeListControl.DestroySubClasses; +var + I: Integer; +begin + UpdateDesignerForms; + BeginUpdate; + try + for I := 0 to FSortOrderList.Count - 1 do + Dispose(PcxDataSortInfo(FSortOrderList.List^[I])); + FreeAndNil(FNavigatorNotifier); + FreeAndNil(FNodes); + FreeAndNil(FColumnsVisibleList); + FreeAndNil(FBandsVisibleList); + FreeAndNil(FSortOrderList); + FreeAndNil(FAutoWidthController); + FreeAndNil(FPreview); + DeleteAllColumns; + FreeAndNil(FBands); + FreeAndNil(FOptionsCustomizing); + FreeAndNil(FOptionsSelection); + FreeAndNil(FChangeImagesLink); + FreeAndNil(FChangeStateImagesLink); + FreeAndNil(FCustomizing); + FreeAndNil(FSortedColumns); + finally + FreeAndNil(FSelection); + FreeAndNil(FDesigners); + FOptionsCustomizing.Free; + inherited DestroySubClasses; + end; +end; + +procedure TcxCustomTreeListControl.DoLayoutChanged; +begin + Bands.RefreshBandStates; + Bands.Changed; + FHeaderLineCount := 0; + PostUpdateFocusedRecord; + Controller.HotTrackNode := nil; + RestoreCursor; + ViewInfo.NodesViewInfo.CancelUpdatePost; + RefreshVisibleIndexes; + FMaxIndentWidth := LookAndFeelPainter.SmallExpandButtonSize + + cxTreeListIndentOffsetSize; + if Images <> nil then + cxSetMax(FMaxIndentWidth, Images.Width + cxTreeListIndentOffsetSize div 2); + if StateImages <> nil then + cxSetMax(FMaxIndentWidth, StateImages.Width + cxTreeListIndentOffsetSize div 2); + FLevelIndentWidth := FMaxIndentWidth; + BeforeCalculate; + Nodes.CalculateInfo(False); + RealignBands; + AssignLeftMostWidths; + inherited DoLayoutChanged; + CheckFocusedItem; + UpdateDesignerForms; + Controller.ForceFocusedRecord := -1; +end; + +procedure TcxCustomTreeListControl.InitScrollBarsParameters; +begin + if IsLocked then Exit; + with ViewInfo do + begin + SetScrollBarInfo(sbHorizontal, 0, HorzScrollSize, HorzScrollInc, + cxRectWidth(ClientBounds), HorzScrollPos, True, True); + with Self.Nodes do + SetScrollBarInfo(sbVertical, 0, VisibleCount - 1, 1, Self.VisibleCount, + TopVisibleIndex, VisibleCount > Self.VisibleCount{) and (Self.VisibleCount > 0)}, True); + end; +end; + +procedure TcxCustomTreeListControl.LookAndFeelChanged( + Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); +begin + HideEdit; + ViewInfo.NodesViewInfo.Clear; + inherited LookAndFeelChanged(Sender, AChangedValues); +end; + +procedure TcxCustomTreeListControl.ReadState(Reader: TReader); +begin + SaveColumnsParams; + inherited ReadState(Reader); + AssignColumnsParams; +end; + +procedure TcxCustomTreeListControl.Updated; +begin + inherited Updated; + BeginUpdate; + try + AssignColumnsParams; + finally + EndUpdate; + end; +end; + +procedure TcxCustomTreeListControl.Updating; +begin + SaveColumnsParams; + inherited Updating; +end; + +procedure TcxCustomTreeListControl.AssignColumnsParams; +var + I: Integer; +begin + for I := 0 to ColumnCount - 1 do + Columns[I].Position.Load; +end; + +procedure TcxCustomTreeListControl.SaveColumnsParams; +var + I: Integer; +begin + for I := 0 to ColumnCount - 1 do + Columns[I].Position.Save; +end; + +function TcxCustomTreeListControl.DragDropImageDisplayRect: TRect; +begin + with GetDragDropViewParams do + begin + Result := inherited DragDropImageDisplayRect; + Result.Bottom := cxTextHeight(Font); + Result.Right := VisibleColumns[0].DisplayWidth; + Result := cxRectOffset(Result, [ScreenToClient(GetMouseCursorPos), + cxTreeListDragDropTextAreaOffset]); + Result := cxRectInflate(Result, cxTextOffset, cxTextOffset); + end; +end; + +procedure TcxCustomTreeListControl.DrawDragDropImage( + ADragBitmap: TBitmap; ACanvas: TcxCanvas); +var + R: TRect; +begin + cxApplyViewParams(ACanvas, GetDragDropViewParams); + R := Rect(0, 0, ADragBitmap.Width, ADragBitmap.Height); + ACanvas.FillRect(R); + ACanvas.FrameRect(R, clBlack, 1, cxBordersAll); + ACanvas.Brush.Style := bsClear; + ACanvas.DrawTexT(GetDragDropText, cxTextRect(R), + cxAlignLeft or cxAlignVCenter or cxSingleLine); +end; + +function TcxCustomTreeListControl.GetDragDropText: string; +begin + Result := FDragNode.Texts[VisibleColumns[0].ItemIndex]; +end; + +function TcxCustomTreeListControl.GetDragDropViewParams: TcxViewParams; +begin + Styles.DoGetContentParams(FDragNode, VisibleColumns[0], Result); + with Styles.GetSelectionParams do + begin + Result.Color := Color; + if Styles.SelectionFontAssigned then + Result.Font := Font; + Result.TextColor := TextColor; + end; +end; + +function TcxCustomTreeListControl.GetImageListHeight( + AImageList: TCustomImageList): Integer; +begin + Result := AImageList.Height; +end; + +function TcxCustomTreeListControl.GetDragObjectClass: TDragControlObjectClass; +begin + Result := nil; +end; + +function TcxCustomTreeListControl.StartDrag(DragObject: TDragObject): Boolean; +begin + Result := DragNode <> nil; +{ HitTest.HitPoint := ScreenToClient(GetMouseCursorPos); + with HitTest do + Result := HitAtNode and HitNode.Selected and not HitAtIndent;} +end; + +procedure TcxCustomTreeListControl.GetStoredChildren(AChildren: TStringList); +var + I: Integer; +begin + AChildren.AddObject('', Bands); + for I := 0 to ColumnCount - 1 do + AChildren.AddObject('', Columns[I]); +end; + +function TcxCustomTreeListControl.GetStoredObjectName: string; +begin + Result := Name; +end; + +function TcxCustomTreeListControl.GetStoredObjectProperties( + AProperties: TStrings): Boolean; +begin + Result := True; +end; + +procedure TcxCustomTreeListControl.GetStoredPropertyValue( + const AName: string; var AValue: Variant); +begin +end; + +procedure TcxCustomTreeListControl.RestoreTopPos; +begin + if FTopPos <> -1 then + begin + Nodes.CalculateInfo(False); + Nodes.TopIndex := 0; + Nodes.TopNode := Nodes.Root.FFirst; + Nodes.TopNode := Nodes.GetVisibleNode(FTopPos); + Nodes.TopIndex := FTopPos; + FTopPos := -1; + end; +end; + +procedure TcxCustomTreeListControl.StoreTopPos; +begin + FTopPos := Nodes.TopIndex; +end; + +procedure TcxCustomTreeListControl.SetStoredPropertyValue( + const AName: string; const AValue: Variant); +begin +end; + +function TcxCustomTreeListControl.StoredCreateChild( + const AObjectName, AClassName: string): TObject; +begin + if AClassName = GetTreeListColumnClass.ClassName then + begin + Result := CreateColumn; + TcxTreeListColumn(Result).Name := AObjectName; + end + else + Result := nil; +end; + +procedure TcxCustomTreeListControl.StoredDeleteChild( + const AObjectName: string; AObject: TObject); +begin +end; + +procedure TcxCustomTreeListControl.GetChildren( + Proc: TGetChildProc; Root: TComponent); + + procedure DoStore(AColumn: TcxTreeListColumn); + begin + if AColumn.Owner = Root then + Proc(AColumn); + end; + +var + I: Integer; +begin + inherited GetChildren(Proc, Root); + RefreshVisibleIndexes; + for I := 0 to ColumnCount - 1 do DoStore(Columns[I]); +end; + +function TcxCustomTreeListControl.IsUpdating: Boolean; +begin + Result := csUpdating in ComponentState; +end; + +procedure TcxCustomTreeListControl.Loaded; +begin + inherited Loaded; + if FocusedNode <> nil then + FocusedNode.MakeVisible; + DataChanged; + RestoreCursor; +end; + +procedure TcxCustomTreeListControl.Modified; +begin + if HandleAllocated then + inherited Modified; + FDefaultLayout := False; +end; + +procedure TcxCustomTreeListControl.Notification( + AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if Operation = opRemove then + begin + if AComponent = Images then Images := nil; + if AComponent = StateImages then StateImages := nil; + end; +end; + +procedure TcxCustomTreeListControl.SetName(const NewName: TComponentName); +begin + inherited SetName(NewName); + UpdateDesignerForms; +end; + +procedure TcxCustomTreeListControl.AssignColumnWidths; +var + I: Integer; +begin + for I := 0 to VisibleBandCount - 1 do + VisibleBands[I].AssignColumnWidths; +end; + +procedure TcxCustomTreeListControl.AssignLeftMostWidths; +var + I: Integer; +begin + if CanAddIndentWidth(FContentIndentWidth) then + begin + for I := 0 to VisibleColumnCount - 1 do + if VisibleColumns[I].IsLeftMost then + VisibleColumns[I].FWidth := VisibleColumns[I].DisplayWidth; + for I := 0 to VisibleBandCount - 1 do + with VisibleBands[I] do + if IsLeftMost then + begin + FCalculatedWidth := DisplayWidth; + if FWidth <> 0 then + FWidth := FCalculatedWidth; + RealignColumns; + end; + FContentIndentWidth := 0; + RealignBands; + end; +end; + +procedure TcxCustomTreeListControl.BoundsChanged; +begin + inherited; +end; + +function TcxCustomTreeListControl.AddNode(ANode, ARelative: TcxTreeListNode; + AData: Pointer; AttachMode: TcxTreeListNodeAttachMode): TcxTreeListNode; +begin + Result := Nodes.InternalAddNode(ANode, ARelative, AttachMode); + Result.FData := AData; +end; + +procedure TcxCustomTreeListControl.BeforeAddNode( + ANewNode, ANewParent: TcxTreeListNode; AMode: TcxTreeListNodeAddMode); +begin +end; + +function TcxCustomTreeListControl.CanAddIndentWidth( + const AIndentWidth: Integer): Boolean; +begin + Result := not OptionsBehavior.AutomateLeftMostIndent and + (AIndentWidth <> 0) and not OptionsView.ColumnAutoWidth; +end; + +function TcxCustomTreeListControl.CanColumnVisible( + AColumn: TcxTreeListColumn): Boolean; +begin + Result := True; +end; + +function TcxCustomTreeListControl.CanMultiSelect: Boolean; +begin + Result := OptionsSelection.MultiSelect; +end; + +procedure TcxCustomTreeListControl.BeforeCalculate; +begin +end; + +procedure TcxCustomTreeListControl.BeforeShowingEdit; +begin + with Controller do + SetFocusedRecordItem(FocusedRecordIndex, FocusedItem); +end; + +procedure TcxCustomTreeListControl.CalculateLeftMostIndentWidth; +begin + FContentIndentWidth := 0; + if (Nodes.VisibleCount > 0) and (VisibleBandCount > 0) then + with VisibleBands[0] do + begin + FContentIndentWidth := Max(0, GetLevelIndentsWidth(Nodes.MaxLevel, True, nil) + + BandRows.LeftMostMinWidth - BandRows.LeftMostWidth); + end; +end; + +procedure TcxCustomTreeListControl.CheckFocusedItem; +var + ANode: TcxTreeListNode; + ARecordIndex: Integer; + AItem: TcxTreeListColumn; +begin + if (ChangesCount <> 1) or (Controller.FocusedRecordIndex = cxInvalidIndex) then Exit; + ANode := FocusedNode; + if ANode = nil then + ANode := Nodes.Root.GetFirstChild; + if (ANode <> nil) then + while (ANode.FParent <> nil) and not ANode.IsVisible do ANode := ANode.FParent; + if ANode <> nil then + ARecordIndex := ANode.RecordIndex + else + ARecordIndex := cxInvalidIndex; + AItem := FocusedColumn; + if OptionsSelection.CellSelect and (VisibleColumnCount > 0) and + (((AItem = nil) or AItem.IsHidden)) then + begin + if DoIsGroupNode(ANode) and (OptionsView.CategorizedColumn <> nil) then + AItem := OptionsView.CategorizedColumn + else + AItem := VisibleColumns[0]; + end; + with Controller do + if (AItem <> FocusedItem) or (ARecordIndex <> FocusedRecordIndex) and not IsDragMode then + Controller.SetFocusedRecordItem(ARecordIndex, AItem); +end; + +procedure TcxCustomTreeListControl.ColumnSortOrderChanged( + AColumn: TcxTreeListColumn); +begin + if AColumn.GetRealSortOrder = soNone then + FSortedColumns.Remove(AColumn) + else + if FSortedColumns.IndexOf(AColumn) = cxInvalidIndex then + FSortedColumns.Add(AColumn); +end; + +procedure TcxCustomTreeListControl.DoAssignNodes(Source: TcxTreeListNodes); +begin + // todo: do nothing +end; + +procedure TcxCustomTreeListControl.DoClear; +begin + Nodes.Clear; +end; + +procedure TcxCustomTreeListControl.DoDeleteSelection; +var + AList: TList; +begin + AList := GetSelectionsEx; + BeginUpdate; + try + DeleteSelectionList(AList); + finally + FreeAndNil(AList); + EndUpdate; + end; +end; + +procedure TcxCustomTreeListControl.AddToDelitionList(ANode: TcxTreeListNode); +begin + FDeletedNodes.Add(Pointer(ANode.RecordIndex)); +end; + +procedure TcxCustomTreeListControl.DoRemoveNode(ANode: TcxTreeListNode); +begin + if not SafeDelete and cxInRange(ANode.RecordIndex, 0, FNodesList.Count - 1) then + begin + FNodesList.List^[ANode.RecordIndex] := nil; + AddToDelitionList(ANode); + end; + if HitTest.FHitNode = ANode then + HitTest.FHitNode := nil; + FSelection.Remove(ANode); + if FCheckedList <> nil then + FCheckedList.Remove(ANode); + if LockUpdate = 0 then + DoValidateDeletedNodes; +end; + +procedure TcxCustomTreeListControl.DoCheckDeletedNode(ANode: TcxTreeListNode); + + function Validate(var ACheckedNode: TcxTreeListNode): Boolean; + begin + Result := ACheckedNode = ANode; + if Result then + ACheckedNode := nil; + end; + +begin + if Validate(Controller.IncSearchNode) then + Controller.CancelIncSearching; + Validate(Controller.HotTrackNode); + Validate(Controller.SelectionAnchorNode); +end; + +procedure TcxCustomTreeListControl.DoDeleteNode(ANode: TcxTreeListNode); +begin + if IsDestroying or SafeDelete then Exit; + UpdateFocusedRecordPost; + DoRemoveNode(ANode); +end; + +procedure TcxCustomTreeListControl.DoInplaceEditContainerItemRemoved( + AItem: TcxCustomInplaceEditContainer); +begin + TcxTreeListColumn(AItem).OwnerBand := nil; + inherited DoInplaceEditContainerItemRemoved(AItem); +end; + +procedure TcxCustomTreeListControl.DoInternalMoveTo(AttachNode: TcxTreeListNode; + AttachMode: TcxTreeListNodeAttachMode; ANodes: TList; IsCopy: Boolean); + + function CheckNodesList: Boolean; + var + I: Integer; + begin + I := 0; + while I < ANodes.Count do + begin + if TcxTreeListNode(ANodes[I]).CanMove(AttachNode, AttachMode) then + Inc(I) + else + ANodes.Delete(I); + end; + Result := ANodes.Count > 0; + end; + +var + IsDone: Boolean; +begin + IsDone := False; + if IsCopy and (AttachMode = tlamInsert) then + AttachNode := AttachNode.Parent; + if not CheckNodesList then Exit; + DoOnMoveTo(AttachNode, AttachMode, ANodes, IsCopy, IsDone); + if not IsDone then + begin + Freeze; + try + DoMoveTo(AttachNode, AttachMode, ANodes, IsCopy); + finally + UnFreeze; + end; + end; +end; + +procedure TcxCustomTreeListControl.DoMoveTo(AttachNode: TcxTreeListNode; + AttachMode: TcxTreeListNodeAttachMode; ANodes: TList; IsCopy: Boolean); +var + I: Integer; +begin + with ANodes do + begin + for I := Count - 1 downto 0 do + begin + if IsCopy then + InternalCopy(TcxTreeListNode(List^[I]), AttachNode) + else + InternalMove(TcxTreeListNode(List^[I]), AttachNode, AttachMode); + end; + end; +end; + +procedure TcxCustomTreeListControl.DoOnAfterSorting; +begin + if Assigned(FOnAfterSorting) then FOnAfterSorting(Self); +end; + +procedure TcxCustomTreeListControl.DoOnBandSizeChanged(ABand: TcxTreeListBand); +begin + if Assigned(FOnBandSizeChanged) then + FOnBandSizeChanged(Self, ABand); +end; + +procedure TcxCustomTreeListControl.DoOnColumnSizeChanged( + AColumn: TcxTreeListColumn); +begin + if Assigned(FOnColumnSizeChanged) then + FOnColumnSizeChanged(Self, AColumn); +end; + +procedure TcxCustomTreeListControl.DoOnCollapsed(ANode: TcxTreeListNode); +begin + if Assigned(FOnCollapsed) then + FOnCollapsed(Self, ANode); +end; + +procedure TcxCustomTreeListControl.DoOnCollapsing( + ANode: TcxTreeListNode; var Allow: Boolean); +begin + if Assigned(FOnCollapsing) then + FOnCollapsing(Self, ANode, Allow); +end; + +procedure TcxCustomTreeListControl.DoOnCompare( + ANode1, ANode2: TcxTreeListNode; var ACompare: Integer); +begin + ACompare := 1; + if Assigned(FOnCompare) then + FOnCompare(Self, ANode1, ANode2, ACompare); +end; + +procedure TcxCustomTreeListControl.DoOnCustomizationVisibleChanged; +begin + if Assigned(FOnCustomizationVisibleChanged) then + FOnCustomizationVisibleChanged(Self); +end; + +procedure TcxCustomTreeListControl.DoOnDeletion(ANode: TcxTreeListNode); +begin + if Assigned(FOnDeletion) then + FOnDeletion(Self, ANode); +end; + +procedure TcxCustomTreeListControl.DoOnExpanded(ANode: TcxTreeListNode); +begin + if Assigned(FOnExpanded) then + FOnExpanded(Self, ANode); +end; + +procedure TcxCustomTreeListControl.DoOnExpanding( + ANode: TcxTreeListNode; var Allow: Boolean); +begin + if Assigned(FOnExpanding) then + FOnExpanding(Self, ANode, Allow); +end; + +procedure TcxCustomTreeListControl.DoOnGetNodeHeight( + ANode: TcxTreeListNode; var AHeight: Integer); +begin + if Assigned(FOnGetNodeHeight) then + FOnGetNodeHeight(Self, ANode, AHeight) +end; + +procedure TcxCustomTreeListControl.DoOnHotTrackNode( + ANode: TcxTreeListNode; AShift: TShiftState; var ACursor: TCursor); +begin + ACursor := Cursor; + if Assigned(FOnHotTrackNode) then + FOnHotTrackNode(Self, ANode, AShift, ACursor); +end; + +procedure TcxCustomTreeListControl.DoOnMoveTo(AttachNode: TcxTreeListNode; + AttachMode: TcxTreeListNodeAttachMode; Nodes: TList; var IsCopy, Done: Boolean); +begin + if Assigned(FOnMoveTo) then + FOnMoveTo(Self, AttachNode, AttachMode, Nodes, IsCopy, Done); +end; + +procedure TcxCustomTreeListControl.DoOnIsGroupNode( + ANode: TcxTreeListNode; var IsGroup: Boolean); +begin + if Assigned(FOnIsGroupNode) then + FOnIsGroupNode(Self, ANode, IsGroup); +end; + +procedure TcxCustomTreeListControl.DoOnTopRecordIndexChanged; +begin + if Assigned(FOnTopRecordIndexChanged) then + FOnTopRecordIndexChanged(Self); +end; + +procedure TcxCustomTreeListControl.DoStartDrag(var DragObject: TDragObject); +begin + if DragMode = dmManual then + DragPos := ScreenToClient(GetMouseCursorPos); + if HitTest.HitNode = nil then + HitTest.FHitNode := FDragNode; + inherited DoStartDrag(DragObject); +end; + +function TcxCustomTreeListControl.DoWriteHeaderToText: string; +var + I: Integer; +begin + Result := ''; + for I := 0 to VisibleColumnCount - 1 do + begin + if Result <> '' then + Result := Result + cxColumnTextSeparator; + Result := Result + VisibleColumns[I].Caption.Text; + end; +end; + +function TcxCustomTreeListControl.DoWriteNodeToText(ANode: TcxTreeListNode): string; +var + I: Integer; +begin + Result := ''; + for I := 0 to VisibleColumnCount - 1 do + begin + if Result <> '' then + Result := Result + cxColumnTextSeparator; + Result := Result + VisibleColumns[I].DisplayTexts[ANode.RecordIndex]; + end; +end; + +procedure TcxCustomTreeListControl.DoWriteToClipboard(AOnlySelected: Boolean); +var + AText: string; +begin + if DoWriteToText(AOnlySelected, AText) then + ClipBoard.AsText := AText +end; + +function TcxCustomTreeListControl.DoWriteToText(AOnlySelected: Boolean; out AText: string): Boolean; +var + ANode: TcxTreeListNode; +begin + ANode := Nodes.Root.GetFirstChild; + if OptionsView.Headers then + AText := DoWriteHeaderToText + else + AText := ''; + while ANode <> nil do + begin + if not AOnlySelected or ANode.Selected then + AText := AText + cxLineSeparator + DoWriteNodeToText(ANode); + ANode := ANode.GetNext; + end; + Result := AText <> ''; +end; + +procedure TcxCustomTreeListControl.DoUpdateDesignerForms; +begin + if FNeedUpdateDesigners and (IsLocked and not IsDestroying) then Exit; + FNeedUpdateDesigners := True; + if IsDestroying or not IsLocked then + UpdateDesignerForms; +end; + +procedure TcxCustomTreeListControl.DoDeleteRecords; +begin + if FDeletedNodes.Count <> 0 then + begin + DataController.Cancel; + TcxDataControllerAccess(DataController).DeleteRecords(FDeletedNodes) + end; +end; + +procedure TcxCustomTreeListControl.DoValidateDeletedNodes; +var + I, ACount: Integer; +begin + ACount := FDeletedNodes.Count; + if ACount = 0 then Exit; + BeginUpdate; + try + FNodesList.Pack; + FDeletedNodes.Sort(cxIntegerListCompare); + for I := Integer(FDeletedNodes[0]) to FNodesList.Count - 1 do + TcxTreeListNode(FNodesList.List^[I]).RecordIndex := I; + if not FSafeDelete then DoDeleteRecords; + finally + FDeletedNodes.Clear; + EndUpdate; + end; +end; + +procedure TcxCustomTreeListControl.DeleteSelectionList(AList: TList); +var + I: Integer; +begin + FCheckedList := AList; + try + I := -1; + while AList.Count > 0 do + try + I := AList.Count; + TcxTreeListNode(AList.List^[AList.Count - 1]).Free; + finally + if I = AList.Count then AList.Delete(I - 1); + I := AList.Count; + end + finally + FCheckedList := nil; + end; +end; + +function TcxCustomTreeListControl.GetCountNodeForBestFit: Integer; +begin + Result := -1; +end; + +function TcxCustomTreeListControl.GetImageIndentWidth( + AType: TcxTreeListImageIndexType): Integer; +begin + Result := FMaxIndentWidth; +end; + +function TcxCustomTreeListControl.GetIsActive: Boolean; +begin + Result := Controller.Focused; +end; + +function TcxCustomTreeListControl.GetFixedContentSize: Integer; +begin + Result := 0; + if (Bands.FirstVisible <> nil) and (Bands.FirstVisible.FixedKind = tlbfLeft) then + Inc(Result, Bands.FirstVisible.DisplayWidth); + if (Bands.LastVisible <> nil) and (Bands.LastVisible.FixedKind = tlbfRight) then + Inc(Result, Bands.LastVisible.DisplayWidth); +end; + +function TcxCustomTreeListControl.GetLevelIndentCount( + ALevel: Integer; AWithImages: Boolean; ANode: TcxTreeListNode): Integer; +begin + Result := ALevel + Byte(OptionsView.ShowRoot); + if AWithImages then + Result := Result + Byte((Images <> nil) and (DoGetNodeImageIndex(ANode, tlitImageIndex) >= 0)); + if (StateImages <> nil) and (DoGetNodeImageIndex(ANode, tlitStateIndex) >= 0) then + Inc(Result); +end; + +function TcxCustomTreeListControl.GetLevelIndentsWidth(ALevel: Integer; + AWithImages: Boolean; ANode: TcxTreeListNode): Integer; +begin + Result := GetLevelIndentCount(ALevel, AWithImages, ANode) * FLevelIndentWidth; +end; + +function TcxCustomTreeListControl.GetMaxBandWidth(ABand: TcxTreeListBand): Integer; +var + I, J: Integer; +begin + if not OptionsView.ColumnAutoWidth then + Result := MaxInt + else + begin + Result := cxRectWidth(ClientBounds) - + FixedBandCount * OptionsView.FixedSeparatorWidth - + OptionsView.IndicatorWidth * Byte(OptionsView.Indicator); + J := FBandsVisibleList.IndexOf(ABand); + if J = FBandsVisibleList.Count - 1 then + for I := VisibleBandCount - 2 downto 0 do + Dec(Result, VisibleBands[I].BandRows.ColumnsMinWidth) + else + begin + for I := 0 to VisibleBandCount - 1 do + if I < J then + Dec(Result, VisibleBands[I].DisplayWidth) + else + if I > J then + Dec(Result, VisibleBands[I].BandRows.ColumnsMinWidth); + end; + end; +end; + +function TcxCustomTreeListControl.GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; +begin + Result := mwskVertical; +end; + +function TcxCustomTreeListControl.GetStartNodeForBestFit: TcxTreeListNode; +begin + Result := Nodes.Root.GetFirstChild; +end; + +function TcxCustomTreeListControl.HasImages: Boolean; +begin + Result := (StateImages <> nil) or (Images <> nil); +end; + +function TcxCustomTreeListControl.ImagesIndentWidth: Integer; +begin + Result := 0; + if StateImages <> nil then + Inc(Result, FLevelIndentWidth); + if Images <> nil then + Inc(Result, FLevelIndentWidth); +end; + +function TcxCustomTreeListControl.InsertNode(IsAppend: Boolean): Boolean; +var + ANode, AttachNode: TcxTreeListNode; +const + AMode: array[Boolean] of TcxTreeListNodeAttachMode = (tlamAdd, tlamInsert); +begin + AttachNode := FocusedNode; + Result := False; + if AttachNode <> nil then + begin + if IsAppend and (AttachNode.Parent.Parent = nil) then + AttachNode := nil; + BeginUpdate; + try + ANode := AddNode(nil, AttachNode, nil, AMode[IsAppend]); + Result := ANode <> nil; + if Result then ANode.Focused := True; + finally + EndUpdate; + end; + end + else + if IsAppend then + AddNode(nil, nil, nil, tlamAdd).Focused := True; +end; + +procedure TcxCustomTreeListControl.InternalMove( + ANode, ADestNode: TcxTreeListNode; AMode: TcxTreeListNodeAttachMode); +begin + if (ANode = nil) or (ADestNode = nil) or ADestNode.HasAsParent(ANode) or + ((ADestNode = ANode.Parent) and (AMode = tlamAddChild)) or (ANode = ADestNode) then Exit; + Nodes.InternalAddNode(ANode, ADestNode, AMode); +end; + +procedure TcxCustomTreeListControl.InternalCopy( + ANode, ADestNode: TcxTreeListNode); +var + I: Integer; + ANewNode: TcxTreeListNode; +begin + ANewNode := AddNode(nil, ADestNode, nil, tlamAddChild); + for I := 0 to ANode.ValueCount - 1 do + ANewNode.Values[I] := ANode.Values[I]; + ANewNode.FState := ANode.FState; + ANewNode.Data := ANode.Data; + ANode := ANode.GetFirstChild; + while ANode <> nil do + begin + InternalCopy(ANode, ANewNode); + ANode := ANode.FNext; + end; +end; + +function TcxCustomTreeListControl.IsMultiSelect: Boolean; +begin + Result := OptionsSelection.MultiSelect; +end; + +function TcxCustomTreeListControl.IsCancelOperation: Boolean; +var + AIndex: Integer; +begin + Result := not SafeDelete and not SkipCancelOperation; + if not Result then Exit; + AIndex := DataController.RecordCount; + DataController.Post; + Result := DataController.RecordCount <> AIndex; +end; + +function TcxCustomTreeListControl.IsSmartLoad: Boolean; +begin + Result := False; +end; + +function TcxCustomTreeListControl.IsNodeInserted(ANode: TcxTreeListNode): Boolean; +begin + Result := dceInsert in DataController.EditState; +end; + +function TcxCustomTreeListControl.IsNodeEdited(ANode: TcxTreeListNode): Boolean; +begin + Result := dceEdit in DataController.EditState; +end; + +procedure TcxCustomTreeListControl.MakeNodeVisible(ANode: TcxTreeListNode); +var + AIndex: Integer; + IsInvalidValid: Boolean; +begin + if (ANode <> nil) and (ANode.IsVisible) then + begin + IsInvalidValid := Nodes.IsInvalidState and IsLocked; + AIndex := Nodes.TopIndex; + Nodes.CalculateInfo(False); + if not IsInvalidValid {and not IsLocked} then + ViewInfo.NodesViewInfo.MakeNodeVisible(ANode) + else + begin + Nodes.TopIndex := 0; + Nodes.TopNode := Nodes.Root.FFirst; + Nodes.TopNode := Nodes.GetVisibleNode(AIndex); + Nodes.TopIndex := AIndex; + ANode.MakeVisible; + StoreTopPos; + end; + end; +end; + +procedure TcxCustomTreeListControl.RefreshVisibleIndexes; + + procedure AddToVisibleList(AColumn: TcxTreeListColumn); + begin + if AColumn.Visibility and not AColumn.IsPreview then + FColumnsVisibleList.Add(AColumn); + end; + +var + I: Integer; +begin + FBandsVisibleList.Sort(cxCompareVisibleBands); + FColumnsVisibleList.Clear; + with ColumnsList do + begin + FColumnsVisibleList.Capacity := Count; +// todo :// sizing +// for I := 0 to Bands.Count - 1 do +// if Bands[I].Visible then Bands[I].RebuildRows; + for I := 0 to Count - 1 do + AddToVisibleList(TcxTreeListColumn(List^[I])); + end; + FColumnsVisibleList.Sort(cxCompareColumnsPosEx); +end; + +procedure TcxCustomTreeListControl.RestoreCursor; +begin + if FUseGlassCursor = 1 then + begin + Dec(FUseGlassCursor); + Screen.Cursor := FStoredCursor; + end; +end; + +procedure TcxCustomTreeListControl.RestoreSorting; +begin +end; + +procedure TcxCustomTreeListControl.SetGlassCursor; +begin + with TcxTreeListOptionsBehavior(OptionsBehavior) do + if (FUseGlassCursor > 0) or not ShowHourGlass then Exit; + FUseGlassCursor := 1; + if OptionsBehavior.HotTrack and (Controller.HotTrackNode <> nil) then + FStoredCursor := Controller.PrevCursor + else + FStoredCursor := Screen.Cursor; + Screen.Cursor := crHourGlass; +end; + +function TcxCustomTreeListControl.SkipFocusedRecordChanged: Boolean; +begin + Result := False; +end; + +function TcxCustomTreeListControl.SkipCancelOperation: Boolean; +begin + Result := True; +end; + +procedure TcxCustomTreeListControl.SortingStateChanged( + AColumn: TcxTreeListColumn; AShift: TShiftState); +begin +end; + +procedure TcxCustomTreeListControl.OnChangeImages(Sender: TObject); +begin + UpdateViewStyles; +end; + +procedure TcxCustomTreeListControl.SaveDragPos; +begin +end; + +procedure TcxCustomTreeListControl.RestoreDragPos; +begin +end; + +function TcxCustomTreeListControl.RealBandLineHeight: Integer; +begin + Result := FRealBandLineHeight; +end; + +procedure TcxCustomTreeListControl.ReadData(AStream: TStream); +var + ASignature: TcxTreeListDataSignature; +begin + AStream.ReadBuffer(ASignature, SizeOf(ASignature)); + with ASignature do + if (Size <> AStream.Size) then + cxTreeListError(scxStr(@scxInvalidStreamFormat)); + AStream.Position := SizeOf(ASignature); +end; + +procedure TcxCustomTreeListControl.RealignBands; +var + AAutoWidth: TcxAutoWidthObject; + I: Integer; +begin + CalculateLeftMostIndentWidth; + Bands.RealignColumns; + if OptionsView.ColumnAutoWidth then + begin + AAutoWidth := TcxAutoWidthObject.Create(VisibleBandCount); + try + with OptionsView do + AAutoWidth.AvailableWidth := cxRectWidth(ClientBounds) - FContentIndentWidth - + FixedBandCount * FixedSeparatorWidth - IndicatorWidth * Byte(Indicator); + for I := 0 to VisibleBandCount - 1 do + VisibleBands[I].InitAutoWidthItem(AAutoWidth.AddItem); + AAutoWidth.Calculate; + for I := 0 to VisibleBandCount - 1 do + VisibleBands[I].FCalculatedWidth := AAutoWidth.Items[I].AutoWidth; + finally + AAutoWidth.Free; + end; + end; + Bands.RealignColumns; +end; + +procedure TcxCustomTreeListControl.WriteData(AStream: TStream); +var + ASignature: TcxTreeListDataSignature; +begin + ASignature.Version := cxTreeListVersion; + ASignature.Size := AStream.Size; + AStream.Position := 0; + AStream.WriteBuffer(ASignature, SizeOf(ASignature)); +end; + +function TcxCustomTreeListControl.SupportsBandColumnEditor: Boolean; +begin + Result := False; +end; + +function TcxCustomTreeListControl.SupportsItemsEditor: Boolean; +begin + Result := False; +end; + +function TcxCustomTreeListControl.SupportsCreateAllItems: Boolean; +begin + Result := False; +end; + +function TcxCustomTreeListControl.GetVersion: string; +begin + Result := cxTLMajorVersion + '.' + IntToStr(dxBuildNumber); +end; + +procedure TcxCustomTreeListControl.CreateAllItems; +begin +end; + +// IcxNavigator +procedure TcxCustomTreeListControl.RefreshNavigatorButtons; +begin + if not (IsLoading or IsDestroying) and (FNavigatorNotifier <> nil) then + FNavigatorNotifier.RefreshNavigatorButtons; +end; + +procedure TcxCustomTreeListControl.DoAction(AButtonIndex: Integer); +begin + case AButtonIndex of + NBDI_FIRST: + GotoBOF; + NBDI_PRIORPAGE: + GotoPrevPage; + NBDI_PRIOR: + GotoPrev; + NBDI_NEXT: + GotoNext; + NBDI_NEXTPAGE: + GotoNextPage; + NBDI_LAST: + GotoEOF; + NBDI_INSERT: + if FocusedNode <> nil then + AddNode(nil, FocusedNode, nil, tlamInsert).Focused := True + else + AddNode(nil, Nodes.Root, nil, tlamAdd).Focused := True; + NBDI_APPEND: + if FocusedNode <> nil then + AddNode(nil, FocusedNode.Parent, nil, tlamAdd).Focused := True + else + AddNode(nil, Nodes.Root, nil, tlamAdd).Focused := True; + NBDI_DELETE: + Self.DeleteSelection; + NBDI_EDIT: + ShowEdit; + NBDI_POST: + begin + DataController.PostEditingData; + DataController.Post; + end; + NBDI_CANCEL: + begin + DataController.Cancel; + TcxEditingControllerAccess(Controller.EditingController).UpdateEditValue; + end; + NBDI_REFRESH: + DataController.Refresh; + NBDI_SAVEBOOKMARK: + SaveBookmark; + NBDI_GOTOBOOKMARK: + GotoBookmark; + end; +end; + +function TcxCustomTreeListControl.GetNotifier: TcxNavigatorControlNotifier; +begin + Result := FNavigatorNotifier; +end; + +function TcxCustomTreeListControl.IsActionSupported(AButtonIndex: Integer): Boolean; +begin + Result := AButtonIndex in [NBDI_FIRST..NBDI_GOTOBOOKMARK]; +end; + +function TcxCustomTreeListControl.CanAppend: Boolean; +begin + Result := CanInsert; +end; + +function TcxCustomTreeListControl.CanEdit: Boolean; +begin + Result := OptionsData.Editing and (HasData or CanInsert) and not IsEditing; +end; + +function TcxCustomTreeListControl.CanDelete: Boolean; +begin + Result := OptionsData.Deleting and HasData; +end; + +function TcxCustomTreeListControl.CanInsert: Boolean; +begin + Result := OptionsData.Inserting and ((FocusedNode <> nil) or not HasData); +end; + +procedure TcxCustomTreeListControl.ClearBookmark; +begin + DataController.ClearBookmark; +end; + +procedure TcxCustomTreeListControl.GotoBookmark; +begin + DataController.GotoBookmark; +end; + +function TcxCustomTreeListControl.HasData: Boolean; +begin + Result := (VisibleColumnCount > 0) and (Nodes.Count > 0); +end; + +function TcxCustomTreeListControl.IsBookmarkAvailable: Boolean; +begin + Result := DataController.IsBookmarkAvailable and HasData; +end; + +procedure TcxCustomTreeListControl.SaveBookmark; +begin + DataController.SaveBookmark; +end; + +function TcxCustomTreeListControl.UseRowIndexForNewRecord: Boolean; +begin + Result := True; +end; + +procedure TcxCustomTreeListControl.Freeze; +begin + Inc(FFreezeCount); +end; + +function TcxCustomTreeListControl.IsLocked: Boolean; +begin + Result := inherited IsLocked or (FFreezeCount <> 0) or + (csUpdating in ComponentState); +end; + +function TcxCustomTreeListControl.IsFreeze: Boolean; +begin + Result := FFreezeCount > 0; +end; + +procedure TcxCustomTreeListControl.UnFreeze; +begin + Dec(FFreezeCount); + if FFreezeCount = 0 then + begin + BeforeUpdate; + LayoutChanged; + end; +end; + +function TcxCustomTreeListControl.CreateNode: TcxTreeListNode; +begin + Result := TcxUnboundTreeListNode.Create(Nodes); +end; + +function TcxCustomTreeListControl.DoCanNodeCollapse( + ANode: TcxTreeListNode): Boolean; +begin + Result := ANode.HasChildren; + if Result then + DoOnCollapsing(ANode, Result); +end; + +function TcxCustomTreeListControl.DoCanNodeExpand( + ANode: TcxTreeListNode): Boolean; +begin + Result := ANode.HasChildren and not IsCancelOperation; + if Result then + DoOnExpanding(ANode, Result); +end; + +function TcxCustomTreeListControl.DoCreateNode: TcxTreeListNode; +begin + BeginUpdate; + try + DoValidateDeletedNodes; + Result := CreateNode; + finally + NeedSortPost; + EndUpdate; + end; +end; + +function TcxCustomTreeListControl.DoGetNodeImageIndex( + ANode: TcxTreeListNode; AIndex: TcxTreeListImageIndexType): TImageIndex; +begin + LockChanges := True; + try + if ANode = nil then + Result := -1 + else + begin + Result := ANode.FImageIndexes[AIndex]; + if (AIndex = tlitSelectedIndex) and (Result = -1) and OptionsView.UseImageIndexForSelected then + Result := ANode.FImageIndexes[tlitImageIndex]; + if Assigned(OnGetNodeImageIndex) then + OnGetNodeImageIndex(Self, ANode, AIndex, Result); + end; + finally + LockChanges := False; + end; +end; + +function TcxCustomTreeListControl.DoGetNodeValueCount: Integer; +begin + Result := ColumnCount; +end; + +procedure TcxCustomTreeListControl.DoNodeChanged( + ANode: TcxTreeListNode); +begin + LayoutChanged; +end; + +function TcxCustomTreeListControl.DoIsGroupNode( + ANode: TcxTreeListNode): Boolean; +begin + Result := False; + if (ANode <> nil) and (OptionsView.PaintStyle = tlpsCategorized) then + begin + Result := ANode.HasChildren; + DoOnIsGroupNode(ANode, Result); + end; +end; + +procedure TcxCustomTreeListControl.DoSelectAll; +var + ANode: TcxTreeListNode; +begin + ANode := Nodes.Root.FFirst; + if ANode <> nil then FSelection.Clear; + FSelection.Capacity := Nodes.VisibleCount + 1; + while ANode <> nil do + begin + if DoCanSelectNode(ANode) then + FSelection.Add(ANode); + ANode := ANode.GetNext + end; +end; + +procedure TcxCustomTreeListControl.DoSetNodeExpanded( + ANode: TcxTreeListNode; AExpanded: Boolean); + + procedure DoChanging(AAllowFunc: TAllowExpandChangingFunc; + APostEvent: TcxTreeListNodeChangedEvent; AState: Integer); + begin + if AAllowFunc then + begin + FPostChanged := True; + ANode.FState := AState; + if ANode.FCount > 0 then + ANode.FState := ANode.FState or tlnsHasChildren + else + ANode.FState := ANode.FState and not tlnsHasChildren; + if @APostEvent = @FOnExpanded then + DoOnExpanded(ANode) + else + DoOnCollapsed(ANode); + if Assigned(APostEvent) then APostEvent(Self, ANode); + Nodes.IsInvalidState := True; + LayoutChanged; + end; + end; + +const + AExpandedState = tlnsCollapsed or tlnsHasChildren; +begin + if IsCancelOperation then Exit; + StoreTopPos; +// Controller.EditingController.StopEditShowingTimer; + FNeedMakeVisible := False; + if (ANode.Expanded <> AExpanded) and ANode.HasChildren then + begin + if AExpanded then + DoChanging(ANode.CanExpand, FOnExpanded, ANode.FState and not AExpandedState) + else + DoChanging(ANode.CanCollapse, FOnCollapsed, ANode.FState or AExpandedState); + end; + FNeedMakeVisible := True; +end; + +procedure TcxCustomTreeListControl.DoSetNodeImageIndex( + ANode: TcxTreeListNode; AIndex: TcxTreeListImageIndexType; Value: TImageIndex); +begin +end; + +procedure TcxCustomTreeListControl.DoSetNodeFocused( + ANode: TcxTreeListNode; Value: Boolean; Shift: TShiftState = []); +begin + if Value then + FocusedNode := ANode + else + if ANode.Focused then FocusedNode := nil; +end; + +procedure TcxCustomTreeListControl.DoSorting; +begin + if Assigned(FOnSorting) then FOnSorting(Self); +end; + +function TcxCustomTreeListControl.GetColumnById( + AItemIndex: Integer): TcxTreeListColumn; +begin + if cxInRange(AItemIndex, 0, ColumnCount - 1) then + Result := Columns[AItemIndex] + else + Result := nil; +end; + +function TcxCustomTreeListControl.GetNodeByID( + ARecordIndex: Integer): TcxTreeListNode; +begin + if cxInRange(ARecordIndex, 0, FNodesList.Count - 1) then + Result := FNodesList.List^[ARecordIndex] + else + Result := nil; +end; + +function TcxCustomTreeListControl.GetSelectionsEx: TList; +begin + Result := TList.Create; + GetSelections(Result); + if (FocusedNode <> nil) and not FocusedNode.Selected then + Result.Add(FocusedNode); +end; + +procedure TcxCustomTreeListControl.CancelSortPost; +begin + FNeedSortPost := False; +end; + +procedure TcxCustomTreeListControl.DisableSorting; +begin + Inc(FSortLocking); +end; + +procedure TcxCustomTreeListControl.DoSortNodes; +begin + if (FSortLocking = 0) and not IsDestroying and + (DataController.RecordCount = FNodesList.Count) then + begin + DoSorting; + try + CancelSortPost; + if Sorted then + try + RecreateSortOrdersList; + finally + Nodes.Root.AlphaSort(True); + end + else + if FNeedRestoreSorting then + begin + FNeedRestoreSorting := False; + RestoreSorting; + end; + finally + DoOnAfterSorting; + end; + end; +end; + +procedure TcxCustomTreeListControl.EnableSorting; +begin + Dec(FSortLocking); + if FSortLocking = 0 then DoSortNodes; +end; + +procedure TcxCustomTreeListControl.NeedSortPost; +begin + FNeedSortPost := True; +end; + +procedure TcxCustomTreeListControl.BeginUpdateSelection; +begin + Inc(FSelectionUpdateLocked); +end; + +procedure TcxCustomTreeListControl.CancelUpdateSelection; +begin + Dec(FSelectionUpdateLocked); +end; + +procedure TcxCustomTreeListControl.EndUpdateSelection; +begin + Dec(FSelectionUpdateLocked); + if FSelectionUpdateLocked = 0 then UpdateSelection; +end; + +procedure TcxCustomTreeListControl.UpdateSelection; +begin + ViewInfo.NodesViewInfo.CheckSelectionMode := True; + try + ViewInfo.UpdateSelection; + finally + ViewInfo.NodesViewInfo.CheckSelectionMode := False; + DoSelectionChanged; + end; +end; + +procedure TcxCustomTreeListControl.CancelFocusedRecordUpdatePost; +begin + FNeedFocusedRecordUpdatePost := False; +end; + +procedure TcxCustomTreeListControl.PostUpdateFocusedRecord; +var + ANode: TcxTreeListNode; +begin + try + if (ViewInfo.NodesViewInfo.Count <> 0) and FNeedFocusedRecordUpdatePost then + begin + ANode := Nodes.GetVisibleNode(Nodes.FFocusedIndex); + if ANode <> nil then + begin + ANode.MakeVisible; + ANode.Focused := True; + end; + end; + finally + CancelFocusedRecordUpdatePost; + end; +end; + +procedure TcxCustomTreeListControl.UpdateFocusedRecordPost; +begin + if IsDestroying then Exit; + if not FNeedFocusedRecordUpdatePost and (FocusedNode <> nil) then + begin + FNeedFocusedRecordUpdatePost := True; + FNodes.FFocusedIndex := FocusedNode.VisibleIndex; + end; +end; + +function TcxCustomTreeListControl.IsSelectionLocked: Boolean; +begin + Result := FSelectionUpdateLocked <> 0; +end; + +function TcxCustomTreeListControl.IsNeedSortPost: Boolean; +begin + Result := FNeedSortPost; +end; + +procedure TcxCustomTreeListControl.RecreateSortOrdersList; + + procedure AddSortInfo(AColumn: TcxTreeListColumn); + var + ASortInfo: PcxDataSortInfo; + begin + if AColumn.GetRealSortOrder = soNone then Exit; + New(PcxDataSortInfo(ASortInfo)); + with ASortInfo^ do + begin + Field := TcxDataControllerAccess(DataController).Fields[AColumn.ItemIndex]; + SortOrder := AColumn.GetRealSortOrder; + end; + FSortOrderList.Add(ASortInfo); + end; + +var + I: Integer; +begin + for I := 0 to SortOrderList.Count - 1 do + Dispose(PcxDataSortInfo(SortOrderList.List^[I])); + FSortOrderList.Clear; + for I := 0 to SortedColumnCount - 1 do + AddSortInfo(SortedColumns[I]); +end; + +function TcxCustomTreeListControl.CheckEvent(AHasHandler: Boolean): Boolean; +begin + FPostChanged := True; + Result := AHasHandler; +end; + +procedure TcxCustomTreeListControl.DoBandHeaderClick(ABand: TcxTreeListBand); +begin + if CheckEvent(Assigned(FOnBandHeaderClick)) then + FOnBandHeaderClick(Self, ABand); +end; + +procedure TcxCustomTreeListControl.DoColumnHeaderClick(AColumn: TcxTreeListColumn); +begin + if CheckEvent(Assigned(FOnColumnHeaderClick)) then + FOnColumnHeaderClick(Self, AColumn); +end; + +procedure TcxCustomTreeListControl.DoChanged(BlockChangedEvent: Boolean = True); +begin + if BlockChangedEvent and (OptionsBehavior.ChangeDelay > 0) then Exit; + try + if FPostChanged and CheckEvent(Assigned(FOnChange)) then + FOnChange(Self); + finally + FPostChanged := False; + end; +end; + +function TcxCustomTreeListControl.DoCanSelectNode(ANode: TcxTreeListNode): Boolean; +begin + Result := True; + if IsMultiSelect and (ANode <> nil) and CheckEvent(Assigned(FOnCanSelectNode)) then + FOnCanSelectNode(Self, ANode, Result); +end; + +procedure TcxCustomTreeListControl.DoDataChangedEvent(Sender: TObject); +begin + if CheckEvent(Assigned(FOnDataChanged)) then + FOnDataChanged(Self); +end; + +procedure TcxCustomTreeListControl.DoEditChanged( + AItem: TcxCustomInplaceEditContainer); +begin + CheckEvent(False); + inherited DoEditChanged(AItem); +end; + +procedure TcxCustomTreeListControl.DoEdited( + AItem: TcxCustomInplaceEditContainer); +begin + CheckEvent(False); + inherited DoEdited(AItem); +end; + +function TcxCustomTreeListControl.DoEditing( + AItem: TcxCustomInplaceEditContainer): Boolean; +begin + CheckEvent(False); + Result := inherited DoEditing(AItem); +end; + +procedure TcxCustomTreeListControl.DoEditValueChanged( + AItem: TcxCustomInplaceEditContainer); +begin + CheckEvent(False); + inherited DoEditValueChanged(AItem); +end; + +procedure TcxCustomTreeListControl.DoInitEdit( + AItem: TcxCustomInplaceEditContainer; AEdit: TcxCustomEdit); +begin + CheckEvent(False); + inherited DoInitEdit(AItem, AEdit); +end; + +procedure TcxCustomTreeListControl.DoFocusedItemChanged( + APrevFocusedItem, AFocusedItem: TcxCustomInplaceEditContainer); +begin + if CheckEvent(Assigned(FOnFocusedColumnChanged)) then + FOnFocusedColumnChanged(Self, + TcxTreeListColumn(APrevFocusedItem), TcxTreeListColumn(AFocusedItem)); +end; + +procedure TcxCustomTreeListControl.DoFocusedRecordChanged( + APrevIndex, AFocusedIndex: Integer); +begin + if CheckEvent(Assigned(FOnFocusedNodeChanged)) then + FOnFocusedNodeChanged(Self, GetNodeByID(APrevIndex), GetNodeByID(AFocusedIndex)); + if not OptionsSelection.MultiSelect then DoSelectionChanged; +end; + +procedure TcxCustomTreeListControl.DoLayoutChangedEvent; +begin + if CheckEvent(Assigned(FOnLayoutChanged)) then + FOnLayoutChanged(Self); +end; + +procedure TcxCustomTreeListControl.DoRecordChanged( + Sender: TcxCustomDataController; ARecordIndex, AItemIndex: Integer); +begin + if CheckEvent(Assigned(FOnNodeChanged)) then + FOnNodeChanged(Self, GetNodeByID(ARecordIndex), GetColumnById(AItemIndex)); +end; + +procedure TcxCustomTreeListControl.DoSelectionChanged; +begin + if CheckEvent(Assigned(FOnSelectionChanged)) and not IsSelectionLocked then + FOnSelectionChanged(Self); +end; + +function TcxCustomTreeListControl.GetBandItemClass: TcxTreeListBandClass; +begin + Result := TcxTreeListBand; +end; + +function TcxCustomTreeListControl.GetControllerClass: TcxCustomControlControllerClass; +begin + Result := TcxTreeListController; +end; + +function TcxCustomTreeListControl.GetControlStylesClass: TcxCustomControlStylesClass; +begin + Result := TcxTreeListStyles; +end; + +function TcxCustomTreeListControl.GetHitTestControllerClass: TcxHitTestControllerClass; +begin + Result := TcxTreeListHitTest; +end; + +function TcxCustomTreeListControl.GetNodesClass: TcxTreeListNodesClass; +begin + Result := TcxTreeListNodes; +end; + +function TcxCustomTreeListControl.GetOptionsViewClass: TcxControlOptionsViewClass; +begin + Result := TcxTreeListOptionsView; +end; + +function TcxCustomTreeListControl.GetOptionsCustomizingClass: + TcxTreeListOptionsCustomizingClass; +begin + Result := TcxTreeListOptionsCustomizing; +end; + +function TcxCustomTreeListControl.GetOptionsBehaviorClass: TcxControlOptionsBehaviorClass; +begin + Result := TcxTreeListOptionsBehavior; +end; + +function TcxCustomTreeListControl.GetOptionsDataClass: TcxControlOptionsDataClass; +begin + Result := TcxTreeListOptionsData; +end; + +function TcxCustomTreeListControl.GetOptionsSelectionClass: TcxTreeListOptionsSelectionClass; +begin + Result := TcxTreeListOptionsSelection; +end; + +function TcxCustomTreeListControl.GetPainterClass: TcxCustomControlPainterClass; +begin + Result := TcxTreeListControlPainter; +end; + +function TcxCustomTreeListControl.GetPreviewClass: TcxTreeListPreviewClass; +begin + Result := TcxTreeListPreview; +end; + +function TcxCustomTreeListControl.GetTreeListColumnClass: TcxTreeListColumnClass; +begin + Result := TcxTreeListColumn; +end; + +function TcxCustomTreeListControl.GetTreeListCustomizingClass: TcxTreeListCustomizingClass; +begin + Result := TcxTreeListCustomizing; +end; + +function TcxCustomTreeListControl.GetViewInfoClass: TcxCustomControlViewInfoClass; +begin + Result := TcxTreeListViewInfo; +end; + +function TcxCustomTreeListControl.GetOnAfterSummary: TcxAfterSummaryEvent; +begin + Result := DataController.Summary.OnAfterSummary; +end; + +function TcxCustomTreeListControl.GetOnEditing: TcxTreeListEditingEvent; +begin + Result := TcxTreeListEditingEvent(inherited OnEditing); +end; + +function TcxCustomTreeListControl.GetOnEdited: TcxTreeListColumnChangedEvent; +begin + Result := TcxTreeListColumnChangedEvent(inherited OnEdited); +end; + +function TcxCustomTreeListControl.GetOnEditValueChanged: TcxTreeListColumnChangedEvent; +begin + Result := TcxTreeListColumnChangedEvent(inherited OnEditValueChanged); +end; + +function TcxCustomTreeListControl.GetOnSummary: TcxSummaryEvent; +begin + Result := DataController.Summary.FooterSummaryItems.OnSummary; +end; + +function TcxCustomTreeListControl.GetSearching: Boolean; +begin + Result := Controller.IsIncSearching; +end; + +function TcxCustomTreeListControl.GetSearchingText: string; +begin + Result := Controller.IncSearchText +end; + +function TcxCustomTreeListControl.GetBands: TcxTreeListBands; +begin + Result := FBands; +end; + +function TcxCustomTreeListControl.GetBandPanelHeight: Integer; +begin + with OptionsView do + Result := ViewInfo.BandLineHeight * BandLineCount * Byte(Bands); +end; + +function TcxCustomTreeListControl.GetColumn( + AIndex: Integer): TcxTreeListColumn; +begin + Result := TcxTreeListColumn(ColumnsList[AIndex]); +end; + +function TcxCustomTreeListControl.GetColumnCount: Integer; +begin + Result := ColumnsList.Count; +end; + +function TcxCustomTreeListControl.GetColumnsList: TList; +begin + Result := inherited ContainerList; +end; + +function TcxCustomTreeListControl.GetController: TcxTreeListController; +begin + Result := TcxTreeListController(inherited Controller); +end; + +function TcxCustomTreeListControl.GetCount: Integer; +begin + Result := Nodes.Root.Count; +end; + +function TcxCustomTreeListControl.GetDefaultRowHeight: Integer; +begin + Result := FDefaultRowHeight; + if Result = 0 then + Result := ViewInfo.DefaultEditHeight; +end; + +function TcxCustomTreeListControl.GetFixedBandCount: Integer; +begin + if VisibleBandCount <> 0 then + with Bands do + begin + Result := Byte(FirstVisible.FixedKind = tlbfLeft) + + Byte(LastVisible.FixedKind = tlbfRight); + end + else + Result := 0; +end; + +function TcxCustomTreeListControl.GetFooterHeight: Integer; +begin + Result := cxRectHeight(ViewInfo.FooterRect); +end; + +function TcxCustomTreeListControl.GetFocusedColumn: TcxTreeListColumn; +begin + Result := TcxTreeListColumn(Controller.FocusedItem); +end; + +function TcxCustomTreeListControl.GetFocusedNode: TcxTreeListNode; +begin + Result := Controller.FocusedNode; +end; + +function TcxCustomTreeListControl.GetHeaderHeight: Integer; +begin + with OptionsView do + Result := Byte(Headers) * HeaderLineCount * ViewInfo.HeaderLineHeight; +end; + +function TcxCustomTreeListControl.GetHeaderPanelHeight: Integer; +begin + Result := HeaderHeight + BandPanelHeight; +end; + +function TcxCustomTreeListControl.GetHitTest: TcxTreeListHitTest; +begin + Result := TcxTreeListHitTest(Controller.HitTestController); +end; + +function TcxCustomTreeListControl.GetLastNode: TcxTreeListNode; +begin + Result := cxGetLatest(Nodes.Root.GetLastChild, False); +end; + +function TcxCustomTreeListControl.GetLastVisibleNode: TcxTreeListNode; +var + I: Integer; +begin + I := VisibleCount - 1; + Result := TopVisibleNode; + while (I > 0) and (Result <> nil) do + begin + Result := Result.GetNextVisible; + Dec(I); + end; +end; + +function TcxCustomTreeListControl.GetNavigatorIsActive: Boolean; +begin + Result := DataController.Active; +end; + +function TcxCustomTreeListControl.GetInplaceColumnIndex: Integer; +begin + if IsEditing then + Result := Controller.EditingController.EditingItem.ItemIndex + else + Result := -1; +end; + +function TcxCustomTreeListControl.GetInplaceEditor: TcxCustomEdit; +begin + if IsEditing then + Result := Controller.EditingController.Edit + else + Result := nil; +end; + +function TcxCustomTreeListControl.GetIsEditing: Boolean; +begin + Result := Controller.IsEditing; +end; + +function TcxCustomTreeListControl.GetItem(Index: Integer): TcxTreeListNode; +begin + Result := Nodes.Root.Items[Index]; +end; + +function TcxCustomTreeListControl.GetOptionsBehavior: TcxTreeListOptionsBehavior; +begin + Result := TcxTreeListOptionsBehavior(inherited OptionsBehavior); +end; + +function TcxCustomTreeListControl.GetOptionsData: TcxTreeListOptionsData; +begin + Result := TcxTreeListOptionsData(inherited OptionsData); +end; + +function TcxCustomTreeListControl.GetOptionsView: TcxTreeListOptionsView; +begin + Result := TcxTreeListOptionsView(inherited OptionsView); +end; + +function TcxCustomTreeListControl.GetSelection(Index: Integer): TcxTreeListNode; +begin + if (Index = 0) and not OptionsSelection.MultiSelect and (FocusedNode <> nil) then + Result := FocusedNode + else + Result := TcxTreeListNode(FSelection[Index]); +end; + +function TcxCustomTreeListControl.GetSelectionCount: Integer; +begin + Result := FSelection.Count; + if not OptionsSelection.MultiSelect and (FocusedNode <> nil) then + Result := 1; +end; + +function TcxCustomTreeListControl.GetSortedColumnCount: Integer; +begin + Result := FSortedColumns.Count; +end; + +function TcxCustomTreeListControl.GetSortedColumn( + Index: Integer): TcxTreeListColumn; +begin + Result := TcxTreeListColumn(FSortedColumns[Index]); +end; + +function TcxCustomTreeListControl.GetStyles: TcxTreeListStyles; +begin + Result := TcxTreeListStyles(inherited Styles); +end; + +function TcxCustomTreeListControl.GetSummary: TcxDataSummary; +begin + Result := DataController.Summary; +end; + +function TcxCustomTreeListControl.GetSorted: Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to ColumnCount - 1 do + if Columns[I].GetRealSortOrder <> soNone then + begin + Result := True; + Break; + end; +end; + +function TcxCustomTreeListControl.GetTopNode: TcxTreeListNode; +begin + Result := Nodes.Root.GetFirstChild; +end; + +function TcxCustomTreeListControl.GetTopVisibleIndex: Integer; +begin + Result := ViewInfo.NodesViewInfo.TopVisibleIndex; +end; + +function TcxCustomTreeListControl.GetTopVisibleNode: TcxTreeListNode; +begin + Result := ViewInfo.NodesViewInfo.TopNode; + if Result = nil then + Result := Nodes.TopNode; +end; + +function TcxCustomTreeListControl.GetVisibleCount: Integer; +begin + with ViewInfo.NodesViewInfo do + begin + if TopNode <> nil then + Result := VisibleCount + else + Result := -1; + end; +end; + +function TcxCustomTreeListControl.GetViewInfo: TcxTreeListViewInfo; +begin + Result := TcxTreeListViewInfo(inherited ViewInfo); +end; + +function TcxCustomTreeListControl.GetVisibleBand( + AIndex: Integer): TcxTreeListBand; +var + I: Integer; +begin + I := Bands.GetAbsoluteIndex(AIndex); + if I <> - 1 then + Result := Bands.GetItem(I) + else + Result := nil; +end; + +function TcxCustomTreeListControl.GetVisibleBandCount: Integer; +begin + Result := FBandsVisibleList.Count; +end; + +function TcxCustomTreeListControl.GetVisibleColumn( + AIndex: Integer): TcxTreeListColumn; +begin + Result := TcxTreeListColumn(FColumnsVisibleList[AIndex]) +end; + +function TcxCustomTreeListControl.GetVisibleColumnCount: Integer; +begin + Result := FColumnsVisibleList.Count; +end; + +function TcxCustomTreeListControl.IsDefaultRowHeightAssigned: Boolean; +begin + Result := FDefaultRowHeight <> 0; +end; + +procedure TcxCustomTreeListControl.SetBands(Value: TcxTreeListBands); +begin + FBands.Assign(Value); +end; + +procedure TcxCustomTreeListControl.SetColumn( + AIndex: Integer; Value: TcxTreeListColumn); +begin + TcxTreeListColumn(ColumnsList[AIndex]).Assign(Value); +end; + +procedure TcxCustomTreeListControl.SetDefaultRowHeight(Value: Integer); +begin + if Value < 0 then Value := 0; + with ViewInfo do + begin + if (DefaultEditHeight > 0) and (Value < DefaultEditHeight) then + Value := DefaultEditHeight; + end; + FDefaultRowHeight := Value; + LayoutChanged; + Modified; +end; + +procedure TcxCustomTreeListControl.SetDefaultLayout(Value: Boolean); +begin + if Value <> FDefaultLayout then + begin + FDefaultLayout := Value; + if Value then + MakeDefaultLayout; + end; +end; + +procedure TcxCustomTreeListControl.SetFocusedColumn(Value: TcxTreeListColumn); +begin + if (Value <> nil) and Value.Visibility then + Controller.FocusedItem := Value + else + if Value = nil then + Controller.FocusedItem := Value; +end; + +procedure TcxCustomTreeListControl.SetFocusedNodeProp(Value: TcxTreeListNode); +begin + SetFocusedNode(Value, []); +end; + +procedure TcxCustomTreeListControl.SetImages(Value: TCustomImageList); +begin + SetInternalImageList(Value, FImages, FChangeImagesLink); +end; + +procedure TcxCustomTreeListControl.SetInternalImageList( + AList: TCustomImageList; var Value: TCustomImageList; ALink: TChangeLink); +begin + Freeze; + try + cxSetImageList(AList, Value, ALink, Self); + finally + UnFreeze; + end; +end; + +procedure TcxCustomTreeListControl.SetLastVisibleNode(Value: TcxTreeListNode); +begin + if (Value <> nil) and Value.IsVisible then + ViewInfo.NodesViewInfo.SetLastVisibleNode(Value); +end; + +procedure TcxCustomTreeListControl.SetNodes(Value: TcxTreeListNodes); +begin + FNodes.Assign(Value); +end; + +procedure TcxCustomTreeListControl.SetOnAfterSummary(Value: TcxAfterSummaryEvent); +begin + DataController.Summary.OnAfterSummary := Value; +end; + +procedure TcxCustomTreeListControl.SetOnEdited(Value: TcxTreeListColumnChangedEvent); +begin + inherited OnEdited := TcxecItemEvent(Value); +end; + +procedure TcxCustomTreeListControl.SetOnEditing(Value: TcxTreeListEditingEvent); +begin + inherited OnEditing := TcxecEditingEvent(Value); +end; + +procedure TcxCustomTreeListControl.SetOnEditValueChanged( + Value: TcxTreeListColumnChangedEvent); +begin + inherited OnEditValueChanged := TcxecItemEvent(Value); +end; + +procedure TcxCustomTreeListControl.SetOnSummary(Value: TcxSummaryEvent); +begin + DataController.Summary.FooterSummaryItems.OnSummary := Value; +end; + +procedure TcxCustomTreeListControl.SetOptionsBehavior( + Value: TcxTreeListOptionsBehavior); +begin + inherited OptionsBehavior := Value; +end; + +procedure TcxCustomTreeListControl.SetOptionsCustomizing( + Value: TcxTreeListOptionsCustomizing); +begin + FOptionsCustomizing.Assign(Value); +end; + +procedure TcxCustomTreeListControl.SetOptionsData(Value: TcxTreeListOptionsData); +begin + inherited OptionsData := Value; +end; + +procedure TcxCustomTreeListControl.SetOptionsView(Value: TcxTreeListOptionsView); +begin + inherited OptionsView := Value; +end; + +procedure TcxCustomTreeListControl.SetOptionsSelection( + Value: TcxTreeListOptionsSelection); +begin + FOptionsSelection.Assign(Value); +end; + +procedure TcxCustomTreeListControl.SetPreview(Value: TcxTreeListPreview); +begin + FPreview.Assign(Value); +end; + +procedure TcxCustomTreeListControl.SetSearchingText(const Value: string); +begin + if Value = '' then + CancelSearching + else + Controller.IncSearchingText := Value +end; + +procedure TcxCustomTreeListControl.SetSorted(Value: Boolean); +var + I: Integer; +begin + if not Value then + begin + for I := 0 to ColumnCount - 1 do + Columns[I].SortOrder := soNone; + end; +end; + +procedure TcxCustomTreeListControl.SetStateImages(Value: TCustomImageList); +begin + SetInternalImageList(Value, FStateImages, FChangeStateImagesLink); +end; + +procedure TcxCustomTreeListControl.SetStyles(Value: TcxTreeListStyles); +begin + Styles.Assign(Value); +end; + +procedure TcxCustomTreeListControl.SetTopVisibleIndex(AValue: Integer); +begin + if IsLocked then + begin + Nodes.TopIndex := AValue; + Nodes.TopNode := Nodes.GetVisibleNode(AValue); + ViewInfo.DoCalculate; + end + else + if cxValidateIntDefEx(AValue, TopVisibleIndex, 0, Nodes.VisibleCount - 1) then + ViewInfo.DoScrollVertical(AValue - TopVisibleIndex); +end; + +procedure TcxCustomTreeListControl.SetTopVisibleNode(ANode: TcxTreeListNode); +begin + Nodes.CalculateInfo(False); + if (ANode <> nil) and ANode.IsVisible then + SetTopVisibleIndex(ANode.VisibleIndex); +end; + +procedure TcxCustomTreeListControl.SetVisibleBand( + Index: Integer; AValue: TcxTreeListBand); +begin + VisibleBands[Index].Assign(AValue); +end; + +procedure TcxCustomTreeListControl.SetVisibleColumn( + Index: Integer; AValue: TcxTreeListColumn); +begin + TcxTreeListColumn(FColumnsVisibleList[Index]).Assign(AValue); +end; + +procedure TcxCustomTreeListControl.DoChangedTimer(Sender: TObject); +begin + if not IsDestroying and not IsLoading then + DoChanged(False); +end; + +procedure TcxCustomTreeListControl.UpdateDesignerForms; +var + AIntf: IcxTreeListDesigner; + I: Integer; +begin + if not FNeedUpdateDesigners then Exit; + for I := 0 to Designers.Count - 1 do + if Supports(TObject(Designers[I]), IcxTreeListDesigner, AIntf) then + begin + if IsDestroying then + AIntf.ComponentRemoved(Self) + else + AIntf.Modified; + end; + FNeedUpdateDesigners := False; +end; + +function TcxCustomTreeListControl.GetObjectName: string; +begin + Result := GetStoredObjectName; +end; + +function TcxCustomTreeListControl.GetProperties(AProperties: TStrings): Boolean; +begin + Result := GetStoredObjectProperties(AProperties); +end; + +procedure TcxCustomTreeListControl.GetPropertyValue( + const AName: string; var AValue: Variant); +begin + GetStoredPropertyValue(AName, AValue); +end; + +procedure TcxCustomTreeListControl.SetPropertyValue( + const AName: string; const AValue: Variant); +begin + SetStoredPropertyValue(AName, AValue); +end; + +procedure TcxCustomTreeListControl.CMDrag(var Message: TCMDrag); +const + AcceptedCursors: array[Boolean] of TCursor = (crDrag, crDragCopy); +begin + DragCursor := AcceptedCursors[Controller.IsDragCopy]; + inherited; +end; + +{ TcxTreeList } + +destructor TcxTreeList.Destroy; +begin + inherited Destroy; +end; + +function TcxTreeList.Add: TcxTreeListNode; +begin + Result := Add(nil); +end; + +function TcxTreeList.Add(ASibling: TcxTreeListNode; + AData: Pointer = nil): TcxTreeListNode; +begin + if ASibling <> nil then + ASibling := ASibling.Parent; + Result := AddNode(nil, ASibling, AData, tlamAdd); +end; + +function TcxTreeList.AddChild(AParent: TcxTreeListNode; + AData: Pointer = nil): TcxTreeListNode; +begin + Result := AddNode(nil, AParent, AData, tlamAddChild); +end; + +function TcxTreeList.AddChildFirst(AParent: TcxTreeListNode; + AData: Pointer = nil): TcxTreeListNode; +begin + Result := AddNode(nil, AParent, AData, tlamAddChildFirst); +end; + +function TcxTreeList.AddFirst: TcxTreeListNode; +begin + Result := AddFirst(nil); +end; + +function TcxTreeList.AddFirst(ASibling: TcxTreeListNode; // need test??? + AData: Pointer = nil): TcxTreeListNode; +begin + if ASibling <> nil then + ASibling := ASibling.Parent; + Result := AddNode(nil, ASibling, AData, tlamAddFirst); +end; + +function TcxTreeList.AddNode(ANode, ARelative: TcxTreeListNode; + AData: Pointer; AttachMode: TcxTreeListNodeAttachMode): TcxTreeListNode; +begin + Result := inherited AddNode(ANode, ARelative, AData, AttachMode); +end; + +function TcxTreeList.Insert(ASibling: TcxTreeListNode; + AData: Pointer = nil): TcxTreeListNode; +begin + Result := AddNode(nil, ASibling, AData, tlamInsert); +end; + +function TcxTreeList.InsertEx(ANode, ASibling: TcxTreeListNode; + AData: Pointer = nil): TcxTreeListNode; +begin + Result := AddNode(ANode, ASibling, AData, tlamInsert); +end; + +procedure TcxTreeList.LoadFromFile(const AFileName: string); +var + AFileStream: TFileStream; +begin + AFileStream := TFileStream.Create(AFileName, fmOpenRead or fmShareDenyNone); + try + LoadFromStream(AFileStream); + finally + FreeAndNil(AFileStream); + end; +end; + +procedure TcxTreeList.LoadFromStream(AStream: TStream); +begin + SetGlassCursor; + try + ReadData(AStream); + finally + RestoreCursor; + end; +end; + +procedure TcxTreeList.SaveToFile(const AFileName: string); +var + AFileStream: TFileStream; +begin + AFileStream := TFileStream.Create(AFileName, fmCreate); + try + SaveToStream(AFileStream); + finally + FreeAndNil(AFileStream); + end; +end; + +procedure TcxTreeList.SaveToStream(AStream: TStream); +var + ASignature: TcxTreeListDataSignature; +begin + AStream.WriteBuffer(ASignature, SizeOf(ASignature)); + DataController.SaveToStream(AStream); + WriteData(AStream); +end; + +procedure TcxTreeList.DoAssignNodes(Source: TcxTreeListNodes); +var + AStream: TMemoryStream; +begin + if Source.TreeList is TcxTreeList then + begin + AStream := TMemoryStream.Create; + try + TcxTreeList(Source.TreeList).SaveToStream(AStream); + AStream.Position := 0; + LoadFromStream(AStream); + finally + FreeAndNil(AStream); + end; + end; +end; + +procedure TcxTreeList.DoSetNodeImageIndex(ANode: TcxTreeListNode; + AIndex: TcxTreeListImageIndexType; Value: TImageIndex); +begin + if ANode = nil then Exit; + TcxUnboundTreeListNode(ANode).FImageIndexes[AIndex] := Value; + if not LockChanges then DoNodeChanged(ANode); +end; + +procedure TcxTreeList.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineBinaryProperty('Data', ReadBinaryData, SaveToStream, Nodes.Count > 0); +end; + +procedure TcxTreeList.Loaded; +begin + if FLoadingTemporaryStream <> nil then + begin + LoadFromStream(FLoadingTemporaryStream); + FreeAndNil(FLoadingTemporaryStream); + end; + inherited Loaded; + if (TopVisibleNode <> nil) and (FocusedNode = nil) then + TopVisibleNode.Focused := True; +end; + +function TcxTreeList.SupportsBandColumnEditor: Boolean; +begin + Result := True; +end; + +function TcxTreeList.SupportsItemsEditor: Boolean; +begin + Result := True; +end; + +procedure TcxTreeList.ReadData(AStream: TStream); + + procedure DoReadNodesData; + var + AIndex: Integer; + ANewNode, ANode, ARoot: TcxTreeListNode; + begin + ARoot := Nodes.Root; + ANode := ARoot; + AStream.ReadBuffer(ARoot.FCount, SizeOf(Integer)); + if ARoot.FCount = 0 then Exit; + AIndex := 0; + repeat + ANewNode := ExCreateNode(ANode, ANode.FLast, AIndex); + ANewNode.ReadData(AStream); + NodesList.List^[ANewNode.RecordIndex] := ANewNode; + if ANewNode.FCount > 0 then + begin + ANode := ANewNode; + AIndex := 0; + Continue; + end + else + while ANewNode.FParent <> nil do + begin + ANode := ANewNode.FParent; + AIndex := ANode.FLast.FIndex + 1; + if AIndex < ANode.Count then + Break + else + ANewNode := ANode; + end; + until (ANode = ARoot) and (AIndex = ANode.Count); + end; + +begin + inherited ReadData(AStream); + BeginUpdate; + try + Nodes.Clear; + Nodes.IsInternalCreating := True; + Nodes.IsInvalidState := True; + try + DataController.LoadFromStream(AStream); + NodesList.Count := DataController.RecordCount; + DoReadNodesData; + except + Nodes.Clear; + raise; + end; + finally + Nodes.IsInternalCreating := False; + EndUpdate; + end; +end; + +procedure TcxTreeList.ReadBinaryData(AStream: TStream); +var + ASignature: TcxTreeListDataSignature; +begin + AStream.ReadBuffer(ASignature, SizeOf(ASignature)); + with ASignature do + if {(Version and cxTreeListVersion = 0) or} (Size <> AStream.Size) then + cxTreeListError(scxStr(@scxInvalidStreamFormat)); + if FLoadingTemporaryStream = nil then + FLoadingTemporaryStream := TMemoryStream.Create; + AStream.Position := 0; + FLoadingTemporaryStream.CopyFrom(AStream, ASignature.Size); + FLoadingTemporaryStream.Position := 0; +end; + +procedure TcxTreeList.WriteData(AStream: TStream); + + procedure DoWriteNodesData; + var + ANode, ARoot: TcxTreeListNode; + begin + ARoot := Nodes.Root; + ANode := ARoot.GetFirstChild; + AStream.WriteBuffer(Nodes.Root.FCount, SizeOf(Integer)); + while ANode <> nil do + begin + ANode.WriteData(AStream); + if ANode.FCount > 0 then + ANode := ANode.GetFirstChild + else + begin + while (ANode <> nil)and (ANode.FNext = nil)do ANode := ANode.FParent; + if ANode <> nil then ANode := ANode.FNext; + end; + end; + end; + +begin + DoWriteNodesData; + inherited WriteData(AStream); +end; + +function TcxTreeList.ExCreateNode(AParent, APrev: TcxTreeListNode; + var AIndex: Integer): TcxTreeListNode; +begin + Result := DoCreateNode; + Result.FParent := AParent; + if APrev <> nil then + APrev.FNext := Result + else + AParent.FFirst := Result; + Result.FIndex := AIndex; + Result.FPrev := APrev; + AParent.FLast := Result; + Inc(AIndex); +end; + +initialization + SortingManager := TSortingManager.Create; + Classes.RegisterClass(TcxTreeListStyleSheet); + +finalization + FreeAndNil(SortingManager); + Classes.UnRegisterClass(TcxTreeListStyleSheet); + +end. + diff --git a/official/x.35/ExpressQuantumTreeList 4/Sources/cxTL.res b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTL.res new file mode 100644 index 00000000..071c538b Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTL.res differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLConverter.pas b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLConverter.pas new file mode 100644 index 00000000..7929d7be --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLConverter.pas @@ -0,0 +1,126 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumTreeList } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMTREELIST AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxTLConverter; + +{$I cxVer.inc} + +interface + +uses + cxTLDsgnEdtrs, + cxConverterFactory, cxTL, cxStyles; + +type + TcxCustomTLConverterClass = class of TcxCustomTLConverter; + TcxStylesAccessor = class(TcxStyles); + TcxCustomTreeListControlAccessor = class(TcxCustomTreeListControl); + + { TcxCustomTLConverter } + TcxCustomTLConverter = class(TcxCustomConverterWithStyles) + private + procedure ClearStyles; + procedure ClearTL; + function GetAccessor: TcxCustomTreeListControlAccessor; + function GetDestination: TcxCustomTreeListControl; + protected + procedure ClearItems; + procedure DoImport; override; + procedure DoRealImport; virtual; + procedure SetTLColumnUniqueName(ATreeList: TcxCustomTreeListControl; AColumn: TcxTreeListColumn); + property Accessor: TcxCustomTreeListControlAccessor read GetAccessor; + public + property Destination: TcxCustomTreeListControl read GetDestination; + end; + +const + cxTLGroupConverterName = 'TreeList Converters'; + cxDBTLGroupConverterName = 'DBTreeList Converters'; + +implementation + +{ TcxCustomTLConverter } + +procedure TcxCustomTLConverter.ClearItems; +begin + Accessor.Clear; +end; + +procedure TcxCustomTLConverter.DoImport; +begin + Destination.BeginUpdate; + try + ClearTL; + DoRealImport; + finally + Destination.EndUpdate; + end; + inherited DoImport; +end; + +procedure TcxCustomTLConverter.DoRealImport; +begin +end; + +procedure TcxCustomTLConverter.SetTLColumnUniqueName(ATreeList: TcxCustomTreeListControl; + AColumn: TcxTreeListColumn); +begin + SetColumnUniqueName(ATreeList, AColumn); +end; + +procedure TcxCustomTLConverter.ClearStyles; +var + I: Integer; +begin + for I := 0 to cxtlMaxControlStyleIndex do + TcxStylesAccessor(Destination.Styles).SetValue(I, nil); +end; + +procedure TcxCustomTLConverter.ClearTL; +begin + Accessor.DeleteAllColumns; + Accessor.Bands.Clear; + ClearStyles; +end; + +function TcxCustomTLConverter.GetAccessor: TcxCustomTreeListControlAccessor; +begin + Result := TcxCustomTreeListControlAccessor(Destination); +end; + +function TcxCustomTLConverter.GetDestination: TcxCustomTreeListControl; +begin + Result := inherited Destination as TcxCustomTreeListControl; +end; + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLData.pas b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLData.pas new file mode 100644 index 00000000..56fe4b98 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLData.pas @@ -0,0 +1,1453 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumTreeList } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMTREELIST AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxTLData; + +{$I cxVer.inc} + +interface +uses + Classes, SysUtils, + Windows, Messages, + {$IFDEF DELPHI6} Variants, {$ENDIF} cxVariants, cxControls, cxClasses, + cxData, cxCustomData, cxInplaceContainer, cxTL, cxTLIntf, cxTLStrs; + +type + TcxCustomDataTreeList = class; + TcxTreeListDataNode = class; + + { TcxTreeListCustomDataSource } + + TcxTreeListCustomDataSource = class(TcxCustomDataSource) + protected + procedure DeleteNode(AParentHandle: TcxDataRecordHandle); + procedure DeleteChildItems(AParentHandle: TcxDataRecordHandle); virtual; + function GetChildCount(AParentHandle: TcxDataRecordHandle): Integer; virtual; + function GetChildRecordHandle(AParentHandle: TcxDataRecordHandle; + AChildIndex: Integer): TcxDataRecordHandle; virtual; + function GetHandleFromNode(ANode: TcxTreeListDataNode): TcxDataRecordHandle; + function GetKeyValue(ARecordHandle: TcxDataRecordHandle): Variant; virtual; + function GetParentKeyValue(ARecordHandle: TcxDataRecordHandle): Variant; virtual; + function GetRootRecordHandle: TcxDataRecordHandle; virtual; + procedure NodeMoveTo(ARecordHandle, AttachRecordHandle: TcxDataRecordHandle; + AttachMode: TcxTreeListNodeAttachMode; IsCopy: Boolean); virtual; + end; + + { TcxVirtualTreeListDataController } + + TcxVirtualTreeListDataController = class(TcxControlDataController) + private + function GetCustomDataSource: TcxTreeListCustomDataSource; + function GetRecordHandle(var ARecordHandle: TcxDataRecordHandle): Boolean; + function GetTreeList: TcxCustomDataTreeList; + procedure SetCustomDataSource(Value: TcxTreeListCustomDataSource); + protected + function GetKeyValue(ARecordIndex: Integer): Variant; + function GetParentKeyValue(ARecordIndex: Integer): Variant; + function IsSmartLoad: Boolean; override; + procedure NodesMoveTo(AttachNode: TcxTreeListDataNode; + AttachMode: TcxTreeListNodeAttachMode; ANodes: TList; IsCopy: Boolean); + public + property TreeList: TcxCustomDataTreeList read GetTreeList; + property CustomDataSource: TcxTreeListCustomDataSource read GetCustomDataSource write SetCustomDataSource; + end; + + { TcxTreeListDataNode } + + TcxTreeListDataNode = class(TcxTreeListNode) + private + FKeyValue: Variant; + FParentValue: Variant; + protected + function AddDataControllerRecord: Integer; override; + property RecordIndex; + public + function AddChild: TcxTreeListNode; override; + function AddChildFirst: TcxTreeListNode; override; + function InsertChild(ABeforeNode: TcxTreeListNode): TcxTreeListNode; override; + property KeyValue: Variant read FKeyValue write FKeyValue; + property ParentValue: Variant read FParentValue write FParentValue; + end; + + { TcxDataTreeListStructureLoader } + + TcxDataTreeListStructureLoader = class + private + function GetDataController: TcxCustomDataController; + function GetLoadedNode(Index: Integer): TcxTreeListDataNode; + function GetRoot: TcxTreeListNode; + procedure SetLoadedNode(Index: Integer; Value: TcxTreeListDataNode); + protected + InSmartLoadMode: Boolean; + IsLoading: Boolean; + IsLoadLoadingData: Boolean; + LoadingNode: TcxTreeListDataNode; + LoadedList: TList; + ExpandedKeysList: TList; + TreeList: TcxCustomDataTreeList; + IsRefresh: Boolean; + // nodes handling procedures + function Add: TcxTreeListDataNode; + function AddChild(AParent: TcxTreeListNode): TcxTreeListDataNode; + function AddNodeToList(ANode: TcxTreeListDataNode; ARecordIndex: Integer = -1): TcxTreeListDataNode; virtual; + procedure AfterSmartLoad; virtual; + procedure AssignNodeImages(ANode: TcxTreeListDataNode); + procedure BeforeSmartLoad; virtual; + function GetKeyValue(ARecordIndex: Integer): Variant; virtual; + function GetNodeImageIndex(ARecordIndex: Integer): Integer; virtual; + function GetNodeStateImage(ARecordIndex: Integer): Integer; virtual; + function GetParentKeyValue(ARecordIndex: Integer): Variant; virtual; + procedure InternalMove(ANode, ADestNode: TcxTreeListNode; AMode: TcxTreeListNodeAttachMode); + function IsSmartLoad: Boolean; + // loading procedures + procedure CheckHasChildren(ANode: TcxTreeListDataNode); virtual; + procedure DoneLoading; virtual; + procedure InitLoading; virtual; + procedure InitLoadedNode(ANode: TcxTreeListDataNode); virtual; + function IsKeyExpanded(const AKeyValue: Variant; var ANode: TcxTreeListDataNode): Boolean; + function IsNodeExpanded(const AKeyValue: Variant): Boolean; + function FindParentNode(const AParentKeyValue: Variant; var Index: Integer): Boolean; + procedure LoadChildItems(AParentNode: TcxTreeListDataNode); virtual; abstract; + procedure LoadTreeList; virtual; + procedure LoadTreeListInLoadAllRecordsMode; virtual; + procedure LoadTreeListInSmartLoadMode; virtual; abstract; + function LoadValues(const AParentValue, AKeyValue: Variant): TcxTreeListDataNode; overload; + function LoadValues(AParentNode: TcxTreeListDataNode; const AParentValue, AKeyValue: Variant): TcxTreeListDataNode; overload; + property DataController: TcxCustomDataController read GetDataController; + property Loaded[Index: Integer]: TcxTreeListDataNode read GetLoadedNode write SetLoadedNode; + property Root: TcxTreeListNode read GetRoot; + public + constructor Create(AOwner: TcxCustomDataTreeList); + procedure DoLoadTreeList(ALoadingNode: TcxTreeListDataNode); + end; + + TcxDataTreeListStructureLoaderClass = class of TcxDataTreeListStructureLoader; + + { TcxVirtualTreeListLoader } + + TcxVirtualTreeListLoader = class(TcxDataTreeListStructureLoader) + private + function GetDataController: TcxVirtualTreeListDataController; + function GetDataSource: TcxTreeListCustomDataSource; + protected + procedure CheckHasChildren(ANode: TcxTreeListDataNode); override; + function GetKeyValue(ARecordIndex: Integer): Variant; override; + function GetParentKeyValue(ARecordIndex: Integer): Variant; override; + procedure LoadChildItems(AParentNode: TcxTreeListDataNode); override; + procedure LoadTreeListInSmartLoadMode; override; + property DataController: TcxVirtualTreeListDataController read GetDataController; + property DataSource: TcxTreeListCustomDataSource read GetDataSource; + end; + + { TcxVirtualTreeListOptionsData } + + TcxVirtualTreeListOptionsData = class(TcxTreeListOptionsData) + protected + procedure SetSmartLoad(Index: Integer; Value: Boolean); virtual; + published + property SmartLoad: Boolean index 3 read GetState write SetSmartLoad default False; + end; + + { TcxCustomDataTreeList } + + TcxCustomDataTreeList = class(TcxCustomTreeListControl) + private + FIsDataChanging: Boolean; + function GetOptionsData: TcxVirtualTreeListOptionsData; + procedure SetOptionsData(Value: TcxVirtualTreeListOptionsData); + protected + DragKeyValue: Variant; + Loader: TcxDataTreeListStructureLoader; + function CreateNode: TcxTreeListNode; override; + procedure CreateSubClasses; override; + procedure DataChanged; override; + function DoCanNodeExpand(ANode: TcxTreeListNode): Boolean; override; + procedure DoClear; override; + procedure DoClearDataSource; virtual; + procedure DoDataChanged; virtual; + procedure DestroySubClasses; override; + procedure DestroyNodes; virtual; + function GetOptionsDataClass: TcxControlOptionsDataClass; override; + function GetNodeByRecordIndex(AIndex: Integer): TcxTreeListDataNode; + function IsDataChangedBusy: Boolean; virtual; + function IsSmartLoad: Boolean; override; + procedure RestoreSorting; override; + function SkipFocusedRecordChanged: Boolean; override; + function SkipCancelOperation: Boolean; override; + // IcxTreeListDesignTimeOperations implementation + function SupportsBandColumnEditor: Boolean; override; + // nodes handling procedure + function InsertNode(IsAppend: Boolean): Boolean; override; + // loading structure procedures + function GetLoaderClass: TcxDataTreeListStructureLoaderClass; virtual; + function IsDataSettingsValid: Boolean; virtual; // for DB IsKeyFieldEmpty + procedure LoadTreeList(ALoadingNode: TcxTreeListDataNode); virtual; + procedure RecreateLoader; + function UseRowIndexForNewRecord: Boolean; override; + // dragdrop + procedure SaveDragPos; override; + procedure RestoreDragPos; override; + + property IsDataChanging: Boolean read FIsDataChanging write FIsDataChanging; + property OptionsData: TcxVirtualTreeListOptionsData read GetOptionsData write SetOptionsData; + public + procedure FullRefresh; override; + function FindNodeByKeyValue(const AKeyValue: Variant; + AColumn: TcxTreeListColumn; AStartNode: TcxTreeListNode = nil; + AExpandedOnly: Boolean = False; AForward: Boolean = True): TcxTreeListNode; + end; + + { TcxCustomVirtualTreeList } + + TcxCustomVirtualTreeList = class(TcxCustomDataTreeList) + private + function GetDataController: TcxVirtualTreeListDataController; + function GetDataSource: TcxTreeListCustomDataSource; + procedure SetDataSource(Value: TcxTreeListCustomDataSource); + protected + procedure AddToDelitionList(ANode: TcxTreeListNode); override; + procedure DoDeleteRecords; override; + procedure DoMoveTo(AttachNode: TcxTreeListNode; + AttachMode: TcxTreeListNodeAttachMode; ANodes: TList; IsCopy: Boolean); override; + function GetDataControllerClass: TcxCustomDataControllerClass; override; + function GetLoaderClass: TcxDataTreeListStructureLoaderClass; override; + function IsCancelOperation: Boolean; override; + function IsDataSettingsValid: Boolean; override; + property DataController: TcxVirtualTreeListDataController read GetDataController; + public + function HandleFromNode(ANode: TcxTreeListNode): TcxDataRecordHandle; virtual; + function NodeFromHandle(ARecordHandle: TcxDataRecordHandle): TcxTreeListNode; virtual; + property CustomDataSource: TcxTreeListCustomDataSource read GetDataSource write SetDataSource; + end; + + { TcxVirtualTreeList } + + TcxVirtualTreeList = class(TcxCustomVirtualTreeList) + public + property ColumnCount; + property Columns; + property Customizing; + property DataController; + property FocusedColumn; + property FocusedNode; + property HitTest; + property IsEditing; + property LevelIndentWidth; + property Nodes; + property SelectionCount; + property Selections; + property Sorted; + property SortedColumnCount; + property SortedColumns; + property TopVisibleIndex; + property TopVisibleNode; + property VisibleBandCount; + property VisibleBands; + property VisibleColumnCount; + property VisibleColumns; + property VisibleCount; + published + property Align; + property Anchors; + property Bands; + property BorderStyle; + property BufferedPaint; + property Constraints; + property Cursor; + property DefaultLayout; + property DefaultRowHeight; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property Font; + {$IFDEF DELPHI6} + property HelpContext; + property HelpKeyword; + property HelpType; + {$ENDIF} + property Hint; + property Images; + property LookAndFeel; + property OptionsBehavior; + property OptionsCustomizing; + property OptionsData; + property OptionsSelection; + property OptionsView; + property ParentColor; + property ParentFont; + property PopupMenu; + property Preview; + property StateImages; + property Styles; + property StylesEvents; + property TabOrder; + property TabStop; + property Visible; + // TreeList events + property OnAfterSorting; + property OnAfterSummary; + property OnBandHeaderClick; + property OnBandSizeChanged; + property OnCanResize; + property OnCanSelectNode; + property OnChange; + property OnClick; + property OnCollapsed; + property OnCollapsing; + property OnColumnHeaderClick; + property OnColumnSizeChanged; + property OnCompare; + property OnConstrainedResize; + property OnSorting; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnCustomDrawBackground; + property OnCustomDrawBandHeader; + property OnCustomDrawCell; + property OnCustomDrawCellsGroup; + property OnCustomDrawFooter; + property OnCustomDrawFooterCell; + property OnCustomDrawHeader; + property OnCustomDrawHeaderCell; + property OnCustomDrawIndentCell; + property OnCustomDrawIndicatorCell; + property OnCustomDrawPreview; + property OnCustomizationFormVisibleChanged; + property OnDataChanged; + property OnDblClick; + property OnDeletion; + property OnDockDrop; + property OnDockOver; + property OnDragDrop; + property OnDragOver; + property OnEdited; + property OnEditing; + property OnEditValueChanged; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnExpanded; + property OnExpanding; + property OnFocusedColumnChanged; + property OnFocusedNodeChanged; + property OnGetNodeImageIndex; + property OnGetNodePreviewHeight; + property OnGetSiteInfo; + property OnHotTrackNode; + property OnInitEdit; + property OnIsGroupNode; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnLayoutChanged; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnMouseWheel; + property OnMouseWheelDown; + property OnMouseWheelUp; + property OnMoveTo; + property OnNodeChanged; + property OnResize; + property OnSelectionChanged; + property OnStartDock; + property OnStartDrag; + property OnSummary; + property OnTopRecordIndexChanged; + property OnUnDock; + end; + +const + cxNullRecordHandle: TcxDataRecordHandle = TcxDataRecordHandle(-1); + +implementation + +type + TcxEditContainerAccess = class(TcxCustomInplaceEditContainer); + TcxNodeAccess = class(TcxTreeListNode); + TcxNodesAccess = class(TcxTreeListNodes); + TcxDataControllerAccess = class(TcxCustomDataController); + +function cxCompareDataNodesByKeyValue(Item1, Item2: Pointer): Integer; +begin + with TcxTreeListDataNode(Item1) do + begin + Result := VarCompare(KeyValue, TcxTreeListDataNode(Item2).KeyValue); + if Result = 0 then + Result := VarCompare(ParentValue, TcxTreeListDataNode(Item2).ParentValue); + end; +end; + +function cxKeyValues(Item1, Item2: Pointer): Integer; +begin + Result := VarCompare(PVariant(Item1)^, PVariant(Item2)^); +end; + +{ TcxTreeListCustomDataSource } + +procedure TcxTreeListCustomDataSource.DeleteNode( + AParentHandle: TcxDataRecordHandle); +begin + DeleteChildItems(AParentHandle); + DeleteRecord(AParentHandle); +end; + +procedure TcxTreeListCustomDataSource.DeleteChildItems( + AParentHandle: TcxDataRecordHandle); +var + I: Integer; + AItemHandle: TcxDataRecordHandle; +begin + for I := GetChildCount(AParentHandle) - 1 downto 0 do + begin + AItemHandle := GetChildRecordHandle(AParentHandle, I); + try + DeleteChildItems(AItemHandle); + finally + DeleteRecord(AItemHandle); + end; + end; +end; + +function TcxTreeListCustomDataSource.GetChildCount( + AParentHandle: TcxDataRecordHandle): Integer; +begin + Result := 0; +end; + +function TcxTreeListCustomDataSource.GetChildRecordHandle( + AParentHandle: TcxDataRecordHandle; AChildIndex: Integer): TcxDataRecordHandle; +begin + Result := cxNullRecordHandle; +end; + +function TcxTreeListCustomDataSource.GetHandleFromNode( + ANode: TcxTreeListDataNode): TcxDataRecordHandle; +begin + if ANode = nil then + Result := GetRootRecordHandle + else + Result := GetRecordHandleByIndex(TcxNodeAccess(ANode).RecordIndex) +end; + +function TcxTreeListCustomDataSource.GetKeyValue(ARecordHandle: TcxDataRecordHandle): Variant; +begin + Result := Null; +end; + +procedure TcxTreeListCustomDataSource.NodeMoveTo( + ARecordHandle, AttachRecordHandle: TcxDataRecordHandle; + AttachMode: TcxTreeListNodeAttachMode; IsCopy: Boolean); +begin +end; + +function TcxTreeListCustomDataSource.GetParentKeyValue( + ARecordHandle: TcxDataRecordHandle): Variant; +begin + Result := Null; +end; + +function TcxTreeListCustomDataSource.GetRootRecordHandle: TcxDataRecordHandle; +begin + Result := cxNullRecordHandle; +end; + +{ TcxVirtualTreeListDataController } + +function TcxVirtualTreeListDataController.GetKeyValue(ARecordIndex: Integer): Variant; +begin + if GetRecordHandle(TcxDataRecordHandle(ARecordIndex)) then + Result := CustomDataSource.GetKeyValue(TcxDataRecordHandle(ARecordIndex)) + else + Result := Null; +end; + +function TcxVirtualTreeListDataController.GetParentKeyValue(ARecordIndex: Integer): Variant; +begin + if GetRecordHandle(TcxDataRecordHandle(ARecordIndex)) then + Result := CustomDataSource.GetParentKeyValue(TcxDataRecordHandle(ARecordIndex)) + else + Result := Null; +end; + +function TcxVirtualTreeListDataController.IsSmartLoad: Boolean; +begin + Result := TreeList.OptionsData.SmartLoad and + (CustomDataSource <> nil) and (CustomDataSource.GetRecordCount = 0); +end; + +procedure TcxVirtualTreeListDataController.NodesMoveTo(AttachNode: TcxTreeListDataNode; + AttachMode: TcxTreeListNodeAttachMode; ANodes: TList; IsCopy: Boolean); + + function GetRecordIndex(Index: Integer): Integer; + begin + Result := TcxTreeListDataNode(ANodes.List^[Index]).RecordIndex; + end; + +var + I: Integer; + AMovedHandle, AttachHandle: TcxDataRecordHandle; +begin + if CustomDataSource <> nil then + begin + BeginUpdate; + try + CustomDataSource.CurrentProvider := Provider; + AttachHandle := CustomDataSource.GetRecordHandleByIndex(AttachNode.RecordIndex); + for I := 0 to ANodes.Count - 1 do + begin + AMovedHandle := CustomDataSource.GetRecordHandleByIndex(GetRecordIndex(I)); + CustomDataSource.NodeMoveTo(AMovedHandle, AttachHandle, AttachMode, IsCopy); + end; + CustomDataSource.DataChanged; + finally + EndUpdate; + end; + end; +end; + +function TcxVirtualTreeListDataController.GetCustomDataSource: TcxTreeListCustomDataSource; +begin + Result := TcxTreeListCustomDataSource(inherited CustomDataSource); +end; + +function TcxVirtualTreeListDataController.GetRecordHandle( + var ARecordHandle: TcxDataRecordHandle): Boolean; +begin + Result := CustomDataSource <> nil; + if Result then + begin + CustomDataSource.CurrentProvider := Provider; + ARecordHandle := CustomDataSource.GetRecordHandleByIndex(Integer(ARecordHandle)); + end; +end; + +function TcxVirtualTreeListDataController.GetTreeList: TcxCustomDataTreeList; +begin + Result := TcxCustomDataTreeList(GetOwner); +end; + +procedure TcxVirtualTreeListDataController.SetCustomDataSource(Value: TcxTreeListCustomDataSource); +begin + inherited CustomDataSource := Value; +end; + +{ TcxTreeListDataNode } + +function TcxTreeListDataNode.AddChild: TcxTreeListNode; +begin + raise EcxTreeList.Create(scxOperationNotSupported); +end; + +function TcxTreeListDataNode.AddChildFirst: TcxTreeListNode; +begin + raise EcxTreeList.Create(scxOperationNotSupported); +end; + +function TcxTreeListDataNode.InsertChild( + ABeforeNode: TcxTreeListNode): TcxTreeListNode; +begin + raise EcxTreeList.Create(scxOperationNotSupported); +end; + +function TcxTreeListDataNode.AddDataControllerRecord: Integer; +begin + Result := inherited AddDataControllerRecord; +end; + +{ TcxDataTreeListStructureLoader } + +constructor TcxDataTreeListStructureLoader.Create(AOwner: TcxCustomDataTreeList); +begin + TreeList := AOwner; +end; + +procedure TcxDataTreeListStructureLoader.DoLoadTreeList( + ALoadingNode: TcxTreeListDataNode); +begin + if IsLoading or IsRefresh then + begin + IsRefresh := False; + Exit; + end; + DataController.BeginUpdate; + try + if (ALoadingNode = nil) and IsSmartLoad and InSmartLoadMode then + begin + InSmartLoadMode := False; + Exit; + end; + IsLoadLoadingData := not IsRefresh and IsSmartLoad and ((DataController.RecordCount <> 0) and (ALoadingNode = nil)); + IsLoading := True; + LoadingNode := ALoadingNode; + InitLoading; + TcxNodesAccess(TreeList.Nodes).IsInternalCreating := True; + try + LoadTreeList; + finally + TreeList.SafeDelete := True; + DoneLoading; + end; + finally + TreeList.SafeDelete := False; + TcxNodesAccess(TreeList.Nodes).IsInternalCreating := False; + InSmartLoadMode := IsSmartLoad and not IsLoadLoadingData; + IsLoadLoadingData := False; + DataController.EndUpdate; + InSmartLoadMode := False; + IsLoading := False; + end; +end; + +function TcxDataTreeListStructureLoader.Add: TcxTreeListDataNode; +begin + Result := TcxTreeListDataNode(TreeList.AddNode(nil, nil, nil, tlamAdd)); +end; + +function TcxDataTreeListStructureLoader.AddChild( + AParent: TcxTreeListNode): TcxTreeListDataNode; +begin + Result := TcxTreeListDataNode(TreeList.AddNode(nil, AParent, nil, tlamAddChild)); +end; + +function TcxDataTreeListStructureLoader.AddNodeToList( + ANode: TcxTreeListDataNode; ARecordIndex: Integer = -1): TcxTreeListDataNode; +begin + if ARecordIndex >= 0 then + begin + ANode.RecordIndex := ARecordIndex; + AssignNodeImages(ANode); + end; + TreeList.NodesList.Add(ANode); + Result := ANode; +end; + +procedure TcxDataTreeListStructureLoader.InternalMove( + ANode, ADestNode: TcxTreeListNode; AMode: TcxTreeListNodeAttachMode); +begin + TreeList.InternalMove(ANode, ADestNode, AMode); +end; + +function TcxDataTreeListStructureLoader.IsSmartLoad: Boolean; +begin + Result := TcxDataControllerAccess(DataController).IsSmartLoad; +end; + +procedure TcxDataTreeListStructureLoader.CheckHasChildren( + ANode: TcxTreeListDataNode); +begin +end; + +procedure TcxDataTreeListStructureLoader.DoneLoading; + + procedure DoExpandExpandedNodes; + var + PrevCount, I: Integer; + ANode: TcxTreeListDataNode; + begin + repeat + PrevCount := ExpandedKeysList.Count; + for I := 0 to ExpandedKeysList.Count - 1 do + if IsKeyExpanded(PVariant(ExpandedKeysList.List[I])^, ANode) then + begin + if (ANode.Count = 0) then LoadChildItems(ANode); + Dispose(PVariant(ExpandedKeysList.List^[I])); + ExpandedKeysList.Delete(I); + ANode.Expanded := True; + Break; + end; + until PrevCount = ExpandedKeysList.Count; + end; + +var + I: Integer; +begin + try + if (ExpandedKeysList <> nil) and (ExpandedKeysList.Count > 0) then + begin + LoadedList.Sort(cxCompareDataNodesByKeyValue); + DoExpandExpandedNodes; + end; + finally + if ExpandedKeysList <> nil then + begin + for I := 0 to ExpandedKeysList.Count - 1 do + Dispose(PVariant(ExpandedKeysList.List^[I])); + FreeAndNil(ExpandedKeysList); + end; + FreeAndNil(LoadedList); + if IsSmartLoad then AfterSmartLoad; + end; +end; + +procedure TcxDataTreeListStructureLoader.InitLoading; +var + I: Integer; + AKeyPtr: PVariant; +begin + if IsSmartLoad then + BeforeSmartLoad; + if LoadingNode = nil then + try + TreeList.ViewInfo.NodesViewInfo.Clear; + ExpandedKeysList := TList.Create; + LoadedList := TList.Create; + if DataController.RecordCount > 0 then + LoadedList.Capacity := DataController.RecordCount; + if TreeList.NodesList.Count > 0 then + begin + ExpandedKeysList.Capacity := TreeList.NodesList.Count; + for I := 0 to TreeList.NodesList.Count - 1 do + with TcxTreeListDataNode(TreeList.NodesList.List^[I]) do + begin + if Expanded then + begin + New(AKeyPtr); + AKeyPtr^ := KeyValue; + ExpandedKeysList.Add(AKeyPtr); + end; + end; + ExpandedKeysList.Sort(cxKeyValues); + end; + finally + TreeList.DestroyNodes; + end; +end; + +procedure TcxDataTreeListStructureLoader.InitLoadedNode(ANode: TcxTreeListDataNode); +begin +end; + +function TcxDataTreeListStructureLoader.IsKeyExpanded( + const AKeyValue: Variant; var ANode: TcxTreeListDataNode): Boolean; +var + L, H, I, C: Integer; +begin + Result := False; + if (LoadedList = nil) or (LoadedList.Count = 0) then Exit; + L := 0; + H := LoadedList.Count - 1; + while L <= H do + begin + I := (L + H) shr 1; + ANode := TcxTreeListDataNode(LoadedList.List^[I]); + C := VarCompare(ANode.KeyValue, AKeyValue); + Result := C = 0; + if not Result then + begin + if C < 0 then + L := I + 1 + else + H := I - 1; + end + else + Break; + end; +end; + +function TcxDataTreeListStructureLoader.IsNodeExpanded( + const AKeyValue: Variant): Boolean; +var + L, H, I, C: Integer; +begin + Result := False; + if (ExpandedKeysList = nil) or (ExpandedKeysList.Count = 0) then Exit; + L := 0; + H := ExpandedKeysList.Count - 1; + while (L <= H) and not Result do + begin + I := (L + H) shr 1; + C := VarCompare(PVariant(ExpandedKeysList.List^[I])^, AKeyValue); + if C = 0 then + Result := True + else + if C < 0 then + L := I + 1 + else + H := I - 1; + end; +end; + +function TcxDataTreeListStructureLoader.FindParentNode( + const AParentKeyValue: Variant; var Index: Integer): Boolean; +var + L, H, I, C: Integer; +begin + Result := False; + L := 0; + H := LoadedList.Count - 1; + while L <= H do + begin + I := (L + H) shr 1; + C := VarCompare(TcxTreeListDataNode(LoadedList.List^[I]).KeyValue, AParentKeyValue); + if C < 0 then + L := I + 1 + else + begin + H := I - 1; + if C = 0 then + begin + Result := True; + L := I; + end; + end; + end; + Index := L; +end; + +procedure TcxDataTreeListStructureLoader.AfterSmartLoad; +begin + if not IsLoadLoadingData then + TcxDataControllerAccess(DataController).EndSmartLoad; +end; + +procedure TcxDataTreeListStructureLoader.AssignNodeImages( + ANode: TcxTreeListDataNode); +begin + with ANode do + begin + if RecordIndex >= 0 then + begin + FImageIndexes[tlitImageIndex] := GetNodeImageIndex(RecordIndex); + FImageIndexes[tlitStateIndex] := GetNodeStateImage(RecordIndex); + end; + end; +end; + +procedure TcxDataTreeListStructureLoader.BeforeSmartLoad; +begin + if not IsLoadLoadingData then + TcxDataControllerAccess(DataController).BeginSmartLoad; +end; + +function TcxDataTreeListStructureLoader.GetKeyValue( + ARecordIndex: Integer): Variant; +begin + Result := Null; +end; + +function TcxDataTreeListStructureLoader.GetNodeImageIndex( + ARecordIndex: Integer): Integer; +begin + Result := -1; +end; + +function TcxDataTreeListStructureLoader.GetNodeStateImage( + ARecordIndex: Integer): Integer; +begin + Result := -1; +end; + +function TcxDataTreeListStructureLoader.GetParentKeyValue( + ARecordIndex: Integer): Variant; +begin + Result := -1; +end; + +procedure TcxDataTreeListStructureLoader.LoadTreeListInLoadAllRecordsMode; +var + I, Index: Integer; + ANode, APrevNode, ADestNode: TcxTreeListDataNode; +begin + with DataController do + begin + for I := 0 to RecordCount - 1 do + begin + ANode := LoadValues(GetParentKeyValue(I), GetKeyValue(I)); + ANode.RecordIndex := I; + AssignNodeImages(ANode); + CheckHasChildren(ANode); + end; + ANode := TcxTreeListDataNode(TreeList.Nodes.Root.GetLastChild); + while ANode <> nil do + begin + APrevNode := TcxTreeListDataNode(ANode.GetPrevSibling); + if FindParentNode(ANode.FParentValue, Index) then + begin + ADestNode := Self.Loaded[Index]; + if ANode.CanMove(ADestNode, tlamAddChild) then + TreeList.InternalMove(ANode, ADestNode, tlamAddChild); + end; + ANode := APrevNode; + end; + end; +end; + +procedure TcxDataTreeListStructureLoader.LoadTreeList; +begin + if IsSmartLoad and ((LoadingNode <> nil) or not IsLoadLoadingData) then + LoadTreeListInSmartLoadMode + else + LoadTreeListInLoadAllRecordsMode; +end; + +function TcxDataTreeListStructureLoader.LoadValues( + const AParentValue, AKeyValue: Variant): TcxTreeListDataNode; + + function GetParent: TcxTreeListDataNode; + var + AIndex: Integer; + begin + Result := nil; + if FindParentNode(AParentValue, AIndex) then + Result := TcxTreeListDataNode(LoadedList.List^[AIndex]); + end; + +begin + Result := LoadValues(GetParent, AParentValue, AKeyValue); + if Result.RecordIndex >= 0 then + AssignNodeImages(Result); +end; + +function TcxDataTreeListStructureLoader.LoadValues(AParentNode: TcxTreeListDataNode; + const AParentValue, AKeyValue: Variant): TcxTreeListDataNode; +var + AIndex: Integer; +begin + Result := AddChild(AParentNode); + AddNodeToList(Result); + Result.FKeyValue := AKeyValue; + Result.FParentValue := AParentValue; + InitLoadedNode(Result); + if (LoadedList <> nil) and not FindParentNode(AKeyValue, AIndex) then + LoadedList.Insert(AIndex, Result); + AssignNodeImages(Result); +end; + +function TcxDataTreeListStructureLoader.GetDataController: TcxCustomDataController; +begin + Result := TreeList.DataController; +end; + +function TcxDataTreeListStructureLoader.GetLoadedNode( + Index: Integer): TcxTreeListDataNode; +begin + Result := TcxTreeListDataNode(LoadedList.List^[Index]); +end; + +function TcxDataTreeListStructureLoader.GetRoot: TcxTreeListNode; +begin + Result := TreeList.Nodes.Root; +end; + +procedure TcxDataTreeListStructureLoader.SetLoadedNode( + Index: Integer; Value: TcxTreeListDataNode); +begin + LoadedList.List^[Index] := Value; +end; + +{ TcxVirtualTreeListLoader } + +procedure TcxVirtualTreeListLoader.CheckHasChildren(ANode: TcxTreeListDataNode); +begin + if IsSmartLoad and (ANode.Count = 0) then + begin + with DataSource, ANode do + HasChildren := GetChildCount(GetRecordHandleByIndex(RecordIndex)) <> 0; + end; +end; + +function TcxVirtualTreeListLoader.GetKeyValue( + ARecordIndex: Integer): Variant; +begin + Result := DataController.GetKeyValue(ARecordIndex); +end; + +function TcxVirtualTreeListLoader.GetParentKeyValue( + ARecordIndex: Integer): Variant; +begin + Result := DataController.GetParentKeyValue(ARecordIndex); +end; + +procedure TcxVirtualTreeListLoader.LoadChildItems( + AParentNode: TcxTreeListDataNode); +var + I: Integer; + AParentValue: Variant; + AParentHandle: TcxDataRecordHandle; + + procedure AddNewNode(AHandle: TcxDataRecordHandle); + var + ANode: TcxTreeListDataNode; + begin + ANode := AddNodeToList(AddChild(AParentNode), DataController.LoadRecord(AHandle)); + ANode.ParentValue := AParentValue; + ANode.KeyValue := DataSource.GetKeyValue(AHandle); + ANode.HasChildren := DataSource.GetChildCount(AHandle) > 0; + if IsNodeExpanded(ANode.KeyValue) then + begin + LoadChildItems(ANode); + ANode.Expanded := True; + end; + end; + +begin + with DataSource do + begin + AParentHandle := GetHandleFromNode(AParentNode); + AParentValue := GetKeyValue(AParentHandle); + for I := 0 to GetChildCount(AParentHandle) - 1 do + AddNewNode(GetChildRecordHandle(AParentHandle, I)); + end; +end; + +procedure TcxVirtualTreeListLoader.LoadTreeListInSmartLoadMode; +begin + LoadChildItems(LoadingNode); +end; + +function TcxVirtualTreeListLoader.GetDataController: TcxVirtualTreeListDataController; +begin + Result := TcxVirtualTreeListDataController(inherited DataController); +end; + +function TcxVirtualTreeListLoader.GetDataSource: TcxTreeListCustomDataSource; +begin + Result := TcxCustomVirtualTreeList(TreeList).CustomDataSource; +end; + +{ TcxVirtualTreeListOptionsData } + +procedure TcxVirtualTreeListOptionsData.SetSmartLoad( + Index: Integer; Value: Boolean); +begin + if SmartLoad <> Value then + begin + SetState(Index, Value); + with TcxCustomDataTreeList(GetOwner) do + begin + if DataController <> nil then + TcxDataControllerAccess(DataController).RestructData; + end; + end; +end; + +{ TcxCustomDataTreeList } + +function TcxCustomDataTreeList.CreateNode: TcxTreeListNode; +begin + Result := TcxTreeListDataNode.Create(Nodes); +end; + +procedure TcxCustomDataTreeList.CreateSubClasses; +begin + RecreateLoader; + inherited CreateSubClasses; +end; + +procedure TcxCustomDataTreeList.DataChanged; + + function SkipDataChangedNotification: Boolean; + begin + Result := IsLoading or IsDestroying; + with Loader do + Result := Result or (IsLoading and InSmartLoadMode) + end; + +begin + FIsDataChanging := True; + try + if not SkipDataChangedNotification then + DoDataChanged + else + Loader.InSmartLoadMode := False; + finally + FIsDataChanging := False; + end; +end; + +function TcxCustomDataTreeList.DoCanNodeExpand( + ANode: TcxTreeListNode): Boolean; +begin + Result := inherited DoCanNodeExpand(ANode); + if Result and IsSmartLoad and (ANode.Count = 0) and not Loader.IsLoading then + begin + LoadTreeList(TcxTreeListDataNode(ANode)); + ANode.HasChildren := ANode.Count > 0; + Result := ANode.HasChildren; + end; +end; + +procedure TcxCustomDataTreeList.DoClear; +begin + DoClearDataSource; + inherited DoClear; +end; + +procedure TcxCustomDataTreeList.DoClearDataSource; +begin + DataController.CustomDataSource := nil; +end; + +procedure TcxCustomDataTreeList.DoDataChanged; +begin + FIsDataChanging := True; + try + if not IsDataSettingsValid then + DestroyNodes + else + begin + LoadTreeList(nil); + inherited DataChanged; + end; + finally + LayoutChanged; + end; +end; + +procedure TcxCustomDataTreeList.DestroySubClasses; +begin + inherited DestroySubClasses; + FreeAndNil(Loader); +end; + +procedure TcxCustomDataTreeList.DestroyNodes; +var + ATopIndex: Integer; +begin + SafeDelete := True; + ATopIndex := TcxNodesAccess(Nodes).TopIndex; + try + Nodes.Clear; + DeletedNodes.Clear; + finally + NodesList.Clear; + TcxNodesAccess(Nodes).TopIndex := ATopIndex; + SafeDelete := False; + end; +end; + +function TcxCustomDataTreeList.GetOptionsDataClass: TcxControlOptionsDataClass; +begin + Result := TcxVirtualTreeListOptionsData; +end; + +function TcxCustomDataTreeList.GetNodeByRecordIndex( + AIndex: Integer): TcxTreeListDataNode; +begin + if cxInRange(AIndex, 0, NodesList.Count - 1) then + Result := TcxTreeListDataNode(NodesList.List[AIndex]) + else + Result := nil; +end; + +function TcxCustomDataTreeList.SkipFocusedRecordChanged: Boolean; +begin + Result := IsDataChangedBusy; +end; + +function TcxCustomDataTreeList.SkipCancelOperation: Boolean; +begin + Result := IsDataChangedBusy; +end; + +function TcxCustomDataTreeList.IsDataChangedBusy: Boolean; +begin + Result := Loader.IsLoading or FIsDataChanging; +end; + +procedure TcxCustomDataTreeList.RestoreSorting; +var + C, I: Integer; + FIsExpanded: PByteArray; + ATopIndex: Integer; +const + AExpandedState = tlnsCollapsed{ or tlnsHasChildren}; +begin + C := Nodes.Count; + GetMem(FIsExpanded, C); + ATopIndex := TcxNodesAccess(Nodes).TopIndex; + try + BeginUpdate; + try + for I := 0 to Nodes.Count - 1 do + FIsExpanded^[I] := Byte(Nodes.Items[I].Expanded); + DestroyNodes; + finally + try + DataChanged; + if C > Nodes.Count then + C := Nodes.Count; + // restore expanding + for I := 0 to C - 1 do + begin + with TcxNodeAccess(NodesList.List^[I]) do + begin + if Boolean(FIsExpanded^[I]) then + State := State and not AExpandedState + else + State := State or AExpandedState + end; + end; + finally + TcxNodesAccess(Nodes).TopIndex := ATopIndex; + EndUpdate; + if FocusedNode <> nil then FocusedNode.MakeVisible; + end; + end; + finally + FreeMem(FIsExpanded); + end; +end; + +function TcxCustomDataTreeList.SupportsBandColumnEditor: Boolean; +begin + Result := True; +end; + +function TcxCustomDataTreeList.InsertNode(IsAppend: Boolean): Boolean; +begin + if IsAppend then + DataController.Append + else + DataController.Insert; + Result := True; +end; + +function TcxCustomDataTreeList.GetLoaderClass: TcxDataTreeListStructureLoaderClass; +begin + Result := TcxDataTreeListStructureLoader; +end; + +function TcxCustomDataTreeList.IsDataSettingsValid: Boolean; +begin + Result := (DataController.RecordCount > 0) or IsSmartLoad; +end; + +function TcxCustomDataTreeList.IsSmartLoad: Boolean; +begin + Result := TcxDataControllerAccess(DataController).IsSmartLoad; +end; + +procedure TcxCustomDataTreeList.LoadTreeList(ALoadingNode: TcxTreeListDataNode); +begin + SetGlassCursor; + try + Freeze; + try + NodesList.Pack; + if not IsDataSettingsValid then + DestroyNodes + else + Loader.DoLoadTreeList(ALoadingNode); + finally + if ALoadingNode = nil then RestoreCursor; + UnFreeze; + if not IsLocked and (FocusedNode <> nil) and (ALoadingNode = nil) then + FocusedNode.MakeVisible; + LayoutChanged; + end; + except + RestoreCursor; + raise; + end; +end; + +procedure TcxCustomDataTreeList.FullRefresh; +begin + BeginUpdate; + try + DestroyNodes; + DataController.RecordCount := 0; + LoadTreeList(nil); + finally + Loader.IsRefresh := True; + EndUpdate; + Loader.IsRefresh := False; + DataController.UpdateItems(False); + end; +end; + +function FindKeyFilter(ANode: TcxTreeListDataNode; AKey: PVariant): Boolean; +begin + Result := VarCompare(ANode.FKeyValue, AKey^) = 0; +end; + +function TcxCustomDataTreeList.FindNodeByKeyValue(const AKeyValue: Variant; + AColumn: TcxTreeListColumn; AStartNode: TcxTreeListNode = nil; + AExpandedOnly: Boolean = False; AForward: Boolean = True): TcxTreeListNode; +begin + Result := Find(@AKeyValue, AStartNode, AExpandedOnly, + AForward, TcxTreeListFindFunc(@FindKeyFilter)); +end; + +procedure TcxCustomDataTreeList.RecreateLoader; +begin + try + FreeAndNil(Loader); + finally + Loader := GetLoaderClass.Create(Self); + end; +end; + +function TcxCustomDataTreeList.UseRowIndexForNewRecord: Boolean; +begin + Result := False; +end; + +procedure TcxCustomDataTreeList.SaveDragPos; +begin + if DragNode <> nil then + DragKeyValue := TcxTreeListDataNode(DragNode).KeyValue + else + DragKeyValue := Null; +end; + +procedure TcxCustomDataTreeList.RestoreDragPos; +var + I: Integer; +begin + if not VarIsNull(DragKeyValue) then + begin + for I := 0 to NodesList.Count - 1 do + with TcxTreeListDataNode(NodesList.List^[I]) do + if VarEquals(DragKeyValue, KeyValue) then + begin + Focused := True; + MakeVisible; + Exit; + end; + end; +end; + +function TcxCustomDataTreeList.GetOptionsData: TcxVirtualTreeListOptionsData; +begin + Result := TcxVirtualTreeListOptionsData(inherited OptionsData); +end; + +procedure TcxCustomDataTreeList.SetOptionsData( + Value: TcxVirtualTreeListOptionsData); +begin + OptionsData.Assign(Value); +end; + +{ TcxCustomVirtualTreeList } + +function TcxCustomVirtualTreeList.HandleFromNode( + ANode: TcxTreeListNode): TcxDataRecordHandle; +begin + Result := CustomDataSource.GetHandleFromNode(TcxTreeListDataNode(ANode)); +end; + +function TcxCustomVirtualTreeList.NodeFromHandle( + ARecordHandle: TcxDataRecordHandle): TcxTreeListNode; +begin + with CustomDataSource do + Result := GetNodeByRecordIndex(GetRecordIndexByHandle(ARecordHandle)); +end; + +procedure TcxCustomVirtualTreeList.AddToDelitionList(ANode: TcxTreeListNode); +begin + if not IsSmartLoad or not ANode.Deleting then + DeletedNodes.Add(Pointer(TcxNodeAccess(ANode).RecordIndex)); +end; + +procedure TcxCustomVirtualTreeList.DoDeleteRecords; +var + I: Integer; +begin + if IsSmartLoad then + begin + DataController.BeginUpdate; + with DeletedNodes do + try + for I := 0 to DeletedNodes.Count - 1 do + List^[I] := CustomDataSource.GetRecordHandleByIndex(Integer(List^[I])); + for I := 0 to DeletedNodes.Count - 1 do + CustomDataSource.DeleteNode(List^[I]); + finally + Clear; + DataController.EndUpdate; + end; + end + else + inherited DoDeleteRecords; +end; + +procedure TcxCustomVirtualTreeList.DoMoveTo(AttachNode: TcxTreeListNode; + AttachMode: TcxTreeListNodeAttachMode; ANodes: TList; IsCopy: Boolean); +begin + if IsSmartLoad and (AttachMode = tlamAddChild) and (AttachNode <> nil) then + Loader.DoLoadTreeList(TcxTreeListDataNode(AttachNode)); + DataController.NodesMoveTo( + TcxTreeListDataNode(AttachNode), AttachMode, ANodes, IsCopy); +end; + +function TcxCustomVirtualTreeList.GetDataControllerClass: TcxCustomDataControllerClass; +begin + Result := TcxVirtualTreeListDataController; +end; + +function TcxCustomVirtualTreeList.GetLoaderClass: TcxDataTreeListStructureLoaderClass; +begin + Result := TcxVirtualTreeListLoader; +end; + +function TcxCustomVirtualTreeList.IsCancelOperation: Boolean; +begin + if Loader.IsLoading then + Result := False + else + Result := inherited IsCancelOperation; +end; + +function TcxCustomVirtualTreeList.IsDataSettingsValid: Boolean; +begin + with DataController do + Result := (CustomDataSource <> nil) and inherited IsDataSettingsValid; +end; + +function TcxCustomVirtualTreeList.GetDataController: TcxVirtualTreeListDataController; +begin + Result := TcxVirtualTreeListDataController(inherited DataController); +end; + +function TcxCustomVirtualTreeList.GetDataSource: TcxTreeListCustomDataSource; +begin + Result := DataController.CustomDataSource; + if Result <> nil then + Result.CurrentProvider := DataController.Provider; +end; + +procedure TcxCustomVirtualTreeList.SetDataSource( + Value: TcxTreeListCustomDataSource); +begin + DataController.CustomDataSource := Value; +end; + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLDsgnEdtrs.dfm b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLDsgnEdtrs.dfm new file mode 100644 index 00000000..0d2fac56 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLDsgnEdtrs.dfm @@ -0,0 +1,307 @@ +object cxTreeListBandColumnDesigner: TcxTreeListBandColumnDesigner + Left = 480 + Top = 171 + Width = 386 + Height = 317 + HorzScrollBar.Range = 5 + VertScrollBar.Range = 42 + AutoScroll = False + BorderIcons = [biSystemMenu] + Caption = 'TreeListDesigner' + Color = clBtnFace + Constraints.MinHeight = 281 + Constraints.MinWidth = 361 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 0 + Height = 283 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + end + object PageControl: TPageControl + Left = 0 + Top = 0 + Width = 378 + Height = 283 + ActivePage = tsColumns + Align = alClient + TabOrder = 1 + OnChange = PageControlChange + object tsBands: TTabSheet + Caption = ' Bands ' + object Panel12: TPanel + Left = 257 + Top = 0 + Width = 113 + Height = 246 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btnBAdd: TcxButton + Left = 5 + Top = 8 + Width = 105 + Height = 22 + Caption = '&Add' + TabOrder = 0 + OnClick = BandTabButtonsClick + end + object btnBDel: TcxButton + Tag = 1 + Left = 5 + Top = 40 + Width = 105 + Height = 22 + Caption = '&Delete' + TabOrder = 1 + OnClick = BandTabButtonsClick + end + object btnBMoveU: TcxButton + Tag = 2 + Left = 5 + Top = 72 + Width = 105 + Height = 22 + Caption = 'Move &Up ' + TabOrder = 2 + OnClick = BandTabButtonsClick + end + object btnBMoveD: TcxButton + Tag = 3 + Left = 5 + Top = 104 + Width = 105 + Height = 22 + Caption = 'Move Dow&n' + TabOrder = 3 + OnClick = BandTabButtonsClick + end + object btnBResD: TcxButton + Tag = 4 + Left = 5 + Top = 136 + Width = 105 + Height = 22 + Caption = 'Rest&ore Defaults' + TabOrder = 4 + OnClick = BandTabButtonsClick + end + object btnBResW: TcxButton + Tag = 5 + Left = 5 + Top = 168 + Width = 105 + Height = 22 + Caption = 'Restore &Widths' + TabOrder = 5 + OnClick = BandTabButtonsClick + end + end + object lbxBands: TListBox + Left = 0 + Top = 0 + Width = 257 + Height = 246 + Align = alClient + DragMode = dmAutomatic + ItemHeight = 16 + MultiSelect = True + PopupMenu = pmBands + TabOrder = 1 + OnClick = BandsListClick + OnKeyDown = lbxKeyDown + end + end + object tsColumns: TTabSheet + Caption = ' Columns ' + object pnButtons: TPanel + Left = 257 + Top = 0 + Width = 113 + Height = 255 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btnCAdd: TcxButton + Left = 5 + Top = 8 + Width = 105 + Height = 22 + Caption = '&Add' + TabOrder = 0 + OnClick = ColumnsEventHandle + end + object btnCDel: TcxButton + Tag = 1 + Left = 5 + Top = 40 + Width = 105 + Height = 22 + Caption = '&Delete' + TabOrder = 1 + OnClick = ColumnsEventHandle + end + object btnCMoveU: TcxButton + Tag = 2 + Left = 5 + Top = 72 + Width = 105 + Height = 22 + Caption = 'Move &Up ' + TabOrder = 2 + OnClick = ColumnsEventHandle + end + object btnCMoveD: TcxButton + Tag = 3 + Left = 5 + Top = 104 + Width = 105 + Height = 22 + Caption = 'Move Dow&n' + TabOrder = 3 + OnClick = ColumnsEventHandle + end + object btnCResD: TcxButton + Tag = 4 + Left = 5 + Top = 136 + Width = 105 + Height = 22 + Caption = 'Rest&ore Defaults' + TabOrder = 4 + OnClick = ColumnsEventHandle + end + object btnCResW: TcxButton + Tag = 5 + Left = 5 + Top = 168 + Width = 105 + Height = 22 + Caption = 'Restore &Widths' + TabOrder = 5 + OnClick = ColumnsEventHandle + end + object btnCreateAllFields: TcxButton + Tag = 6 + Left = 5 + Top = 200 + Width = 105 + Height = 22 + Caption = 'Create all &fields' + TabOrder = 6 + OnClick = ColumnsEventHandle + end + end + object lbxColumns: TListBox + Left = 0 + Top = 0 + Width = 257 + Height = 255 + Align = alClient + DragMode = dmAutomatic + ItemHeight = 13 + MultiSelect = True + PopupMenu = pmColumns + TabOrder = 1 + OnClick = ColumnsListClick + OnKeyDown = lbxKeyDown + end + end + end + object pmColumns: TPopupMenu + Left = 228 + Top = 6 + object mnuCAdd: TMenuItem + Caption = '&Add...' + ShortCut = 45 + OnClick = ColumnsEventHandle + end + object mnuCDel: TMenuItem + Tag = 1 + Caption = '&Delete' + ShortCut = 46 + OnClick = ColumnsEventHandle + end + object mnuCMoveU: TMenuItem + Tag = 2 + Caption = 'Move &Up' + OnClick = ColumnsEventHandle + end + object mnuCMoveD: TMenuItem + Tag = 3 + Caption = 'Move Dow&n' + OnClick = ColumnsEventHandle + end + object mnuCResD: TMenuItem + Tag = 4 + Caption = 'Rest&ore Defaults' + OnClick = ColumnsEventHandle + end + object mnuCResW: TMenuItem + Tag = 5 + Caption = 'Restore &Widths' + OnClick = ColumnsEventHandle + end + object mnuCreateAllFields: TMenuItem + Tag = 6 + Caption = 'Create all fields' + OnClick = ColumnsEventHandle + end + object mnuCSelectAll: TMenuItem + Tag = 8 + Caption = 'Select All' + ShortCut = 16449 + OnClick = ColumnsEventHandle + end + end + object pmBands: TPopupMenu + Left = 194 + Top = 6 + object mnuBAdd: TMenuItem + Caption = '&Add' + ShortCut = 45 + OnClick = BandTabButtonsClick + end + object mnuBDel: TMenuItem + Tag = 1 + Caption = '&Delete' + ShortCut = 46 + OnClick = BandTabButtonsClick + end + object mnuBMoveU: TMenuItem + Tag = 2 + Caption = 'Move &Up' + OnClick = BandTabButtonsClick + end + object mnuBMoveD: TMenuItem + Tag = 3 + Caption = 'Move Dow&n' + OnClick = BandTabButtonsClick + end + object mnuBResD: TMenuItem + Tag = 4 + Caption = 'Rest&ore Defaults' + OnClick = BandTabButtonsClick + end + object mnuBResW: TMenuItem + Caption = 'Restore &Width' + end + object mnuBSelectAll: TMenuItem + Tag = 8 + Caption = 'Select All' + ShortCut = 16449 + OnClick = BandTabButtonsClick + end + end +end diff --git a/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLDsgnEdtrs.pas b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLDsgnEdtrs.pas new file mode 100644 index 00000000..10395c2f --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLDsgnEdtrs.pas @@ -0,0 +1,607 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumTreeList } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMTREELIST AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxTLDsgnEdtrs; + +{$I cxVer.inc} + +interface + +uses + Classes, SysUtils, +{$IFDEF DELPHI5} + DesignConst, //DesignEditors, +{$ENDIF} +{$IFDEF DELPHI6} + DesignIntf, ComponentDesigner, +{$ELSE} + DsgnWnds, DsgnIntf, LibIntf, +{$ENDIF} + Windows, Messages, + cxDesignWindows, Forms, Controls, ComCtrls, Graphics, Dialogs, Menus, StdCtrls, + ExtCtrls, cxControls, cxButtons, cxClasses, cxLookAndFeelPainters, cxTLIntf, + cxTLStrs, cxInplaceContainer, cxTL, cxDBTL, cxLookAndFeels; + +type + TcxTreeListAccess = class(TcxCustomTreeListControl); + + TcxTreeListBandColumnDesigner = class(TcxDesignFormEditor, IcxTreeListDesigner) + Panel2: TPanel; + PageControl: TPageControl; + tsBands: TTabSheet; + Panel12: TPanel; + lbxBands: TListBox; + tsColumns: TTabSheet; + pnButtons: TPanel; + lbxColumns: TListBox; + pmColumns: TPopupMenu; + mnuCAdd: TMenuItem; + pmBands: TPopupMenu; + btnBAdd: TcxButton; + btnCreateAllFields: TcxButton; + mnuCSelectAll: TMenuItem; + btnBDel: TcxButton; + btnBMoveU: TcxButton; + btnBMoveD: TcxButton; + btnBResD: TcxButton; + btnBResW: TcxButton; + btnCAdd: TcxButton; + btnCDel: TcxButton; + btnCMoveU: TcxButton; + btnCMoveD: TcxButton; + btnCResD: TcxButton; + btnCResW: TcxButton; + mnuBAdd: TMenuItem; + mnuBDel: TMenuItem; + mnuBMoveU: TMenuItem; + mnuBMoveD: TMenuItem; + mnuBResD: TMenuItem; + mnuBResW: TMenuItem; + mnuCDel: TMenuItem; + mnuCMoveU: TMenuItem; + mnuCMoveD: TMenuItem; + mnuCResD: TMenuItem; + mnuCResW: TMenuItem; + mnuCreateAllFields: TMenuItem; + mnuBSelectAll: TMenuItem; + procedure BandTabButtonsClick(Sender: TObject); + procedure ColumnsListClick(Sender: TObject); + procedure ColumnsEventHandle(Sender: TObject); + procedure BandsListClick(Sender: TObject); + procedure lbxKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure PageControlChange(Sender: TObject); + private + FDisableSelection: Boolean; + function GetTreeList: TcxTreeListAccess; + protected + // new metods + procedure AddListItem(AListBox: TListBox; AProc: TNotifyEvent); + procedure DeleteSelectedItems(AListBox: TListBox; AProc: TNotifyEvent); + procedure ChangeNameHandler(Sender: TObject); + procedure GetSelection(AListBox: TListBox; AList: TList); + procedure InitControls; + procedure FillLists; + procedure ListBoxSelectionChanged(AListBox: TListBox; + const AButtons: array of TButton; const AMenuItems: array of TMenuItem); + procedure MoveBy(AListBox: TListBox; AProc: TNotifyEvent; AIncr: Integer); + procedure MoveDownListItem(AListBox: TListBox; AProc: TNotifyEvent); + procedure MoveUpListItem(AListBox: TListBox; AProc: TNotifyEvent); + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure SelectAll(AListBox: TListBox; AProc: TNotifyEvent); + procedure SelectItem; + procedure SelectSelectedItems(AListBox: TListBox); + procedure SetListBoxSelection(AList: TListBox; ASelection: Boolean); + procedure UnSelectAll; + + // IcxTreeListDesigner + procedure ComponentRemoved(Sender: TObject); + procedure Modified; + property TreeList: TcxTreeListAccess read GetTreeList; + public + destructor Destroy; override; + procedure Activate; override; + procedure InitFormEditor; override; + procedure SetVisibleSheetIndex(AIndex: Integer); + end; + +procedure SetColumnsUniqueName(ATreeList: TcxCustomTreeListControl); +procedure SetColumnUniqueName(ATreeList: TcxCustomTreeListControl; AColumn: TcxTreeListColumn); + +implementation + +{$R *.dfm} + +type + TcxControlAccess = class(TcxControl); + TcxColumnAccess = class(TcxTreeListColumn); + +procedure SetColumnUniqueName(ATreeList: TcxCustomTreeListControl; AColumn: TcxTreeListColumn); +var + AFieldName: string; +begin + if AColumn.Name <> '' then Exit; + if AColumn is TcxDBTreeListColumn then + AFieldName := TcxDBTreeListColumn(AColumn).DataBinding.FieldName + else + AFieldName := ''; + AColumn.Name := CreateUniqueName(ATreeList.Owner, ATreeList, AColumn, '', AFieldName); +end; + +procedure SetColumnsUniqueName(ATreeList: TcxCustomTreeListControl); +var + I: Integer; +begin + with TcxTreeListAccess(ATreeList) do + for I := 0 to ColumnCount - 1 do SetColumnUniqueName(ATreeList, Columns[I]); +end; + +{ TcxTreeListBandColumnDesigner } + +destructor TcxTreeListBandColumnDesigner.Destroy; +var + I: Integer; +begin + if (TreeList <> nil) and (not TreeList.IsDestroying) then + begin + for I := 0 to TreeList.ColumnCount - 1 do + TcxColumnAccess(TreeList.Columns[I]).OnChangeName := nil; + end; + inherited Destroy; +end; + +procedure TcxTreeListBandColumnDesigner.Activate; +begin + inherited Activate; + Constraints.MinHeight := Height; + Constraints.MinWidth := Width; + FillLists; +end; + +procedure TcxTreeListBandColumnDesigner.InitFormEditor; + + procedure SetShortCuts; + begin + mnuBMoveU.ShortCut := ShortCut(VK_UP, [ssCtrl]); + mnuBMoveD.ShortCut := ShortCut(VK_DOWN, [ssCtrl]); + mnuCMoveU.ShortCut := ShortCut(VK_UP, [ssCtrl]); + mnuCMoveD.ShortCut := ShortCut(VK_DOWN, [ssCtrl]); + end; + +begin + inherited InitFormEditor; + FillLists; + btnCreateAllFields.Visible := Component is TcxDBTreeList; + mnuCreateAllFields.Visible := Component is TcxDBTreeList; + SetShortCuts; +end; + +procedure TcxTreeListBandColumnDesigner.SetVisibleSheetIndex(AIndex: Integer); +begin +{$IFDEF DELPHI5} + PageControl.ActivePageIndex := AIndex; +{$ELSE} + PageControl.ActivePage := PageControl.Pages[AIndex]; +{$ENDIF} +end; + +procedure TcxTreeListBandColumnDesigner.ComponentRemoved(Sender: TObject); +begin +end; + +procedure TcxTreeListBandColumnDesigner.Modified; +begin + Designer.Modified; +end; + +function TcxTreeListBandColumnDesigner.GetTreeList: TcxTreeListAccess; +begin + if Component is TcxCustomTreeListControl then + Result := TcxTreeListAccess(Component) + else + Result := nil; +end; + +procedure TcxTreeListBandColumnDesigner.BandTabButtonsClick(Sender: TObject); +begin + TreeList.BeginUpdate; + try + case (Sender as TComponent).Tag of + 0: + begin + TreeList.Bands.Add; + AddListItem(lbxBands, BandsListClick); + end; + 1: + DeleteSelectedItems(lbxBands, BandsListClick); + 2: + MoveUpListItem(lbxBands, BandsListClick); + 3: + MoveDownListItem(lbxBands, BandsListClick); + 4: + TreeList.Bands.RestoreDefaults; + 5: + TreeList.Bands.RestoreWidths; + 8: + SelectAll(lbxBands, BandsListClick); + end; + finally + TreeList.EndUpdate; + end; +end; + +procedure TcxTreeListBandColumnDesigner.ColumnsEventHandle(Sender: TObject); +begin + TreeList.BeginUpdate; + try + case (Sender as TComponent).Tag of + 0: + begin + SetColumnUniqueName(TreeList, TreeList.CreateColumn); + AddListItem(lbxColumns, ColumnsListClick); + end; + 1: + DeleteSelectedItems(lbxColumns, ColumnsListClick); + 2: + MoveUpListItem(lbxColumns, ColumnsListClick); + 3: + MoveDownListItem(lbxColumns, ColumnsListClick); + 4: + TreeList.RestoreColumnsDefaults; + 5: + TreeList.RestoreColumnsWidths; + 6: + begin + if Component is TcxDBTreeList then + (Component as TcxDBTreeList).DataController.CreateAllItems; + SetColumnsUniqueName(TreeList); + AddListItem(lbxColumns, ColumnsListClick); + end; + 8: + SelectAll(lbxColumns, ColumnsListClick); + end; + finally + TreeList.EndUpdate; + end; +end; + +procedure TcxTreeListBandColumnDesigner.AddListItem(AListBox: TListBox; AProc: TNotifyEvent); +begin + with AListBox do + begin + Items.BeginUpdate; + FDisableSelection := True; + try + FillLists; + Selected[Items.Count - 1] := True; + ItemIndex := Items.Count - 1; + AListBox.SetFocus; + finally + FDisableSelection := False; + Items.EndUpdate; + end; + AProc(AListBox); + Modified; + end; +end; + +procedure TcxTreeListBandColumnDesigner.ChangeNameHandler(Sender: TObject); +var + AIndex: Integer; +begin + AIndex := lbxColumns.Items.IndexOfObject(Sender); + if AIndex <> -1 then + lbxColumns.Items[AIndex] := TComponent(Sender).Name; +end; + +procedure TcxTreeListBandColumnDesigner.DeleteSelectedItems( + AListBox: TListBox; AProc: TNotifyEvent); +var + I, AOldIndex: Integer; + AList: TList; +begin + if AListBox.SelCount = 0 then Exit; + AOldIndex := AListBox.ItemIndex; + AList := TList.Create; + try + GetSelection(AListBox, AList); + AListBox.Items.BeginUpdate; + FDisableSelection := True; + try + UnSelectAll; + SelectItem; + for I := 0 to AList.Count - 1 do + TObject(AList[I]).Free; + FillLists; + if AOldIndex >= AListBox.Items.Count then + AOldIndex := AListBox.Items.Count - 1; + if (AOldIndex <> -1) and (AListBox.Items.Count > 0) then + AListBox.Selected[AOldIndex] := True; + AListBox.SetFocus; + finally + FDisableSelection := False; + AListBox.Items.EndUpdate; + end; + AProc(AListBox); + Modified; + finally + AList.Free; + end; +end; + +procedure TcxTreeListBandColumnDesigner.GetSelection( + AListBox: TListBox; AList: TList); +var + I: Integer; +begin + with AListBox do + begin + for I := 0 to Items.Count - 1 do + if Selected[I] and (Items.Objects[I] <> nil) then + AList.Add(Items.Objects[I]); + end; +end; + +procedure TcxTreeListBandColumnDesigner.InitControls; +var + AMasterLookAndFeel: TcxLookAndFeel; + + procedure DoCheckSubControls(AComponent: TComponent); + var + I: Integer; + begin + for I := 0 to AComponent.ComponentCount - 1 do + begin + if AComponent.Components[I] is TcxControl then + with TcxControlAccess(AComponent.Components[I]) do + LookAndFeel.MasterLookAndFeel := AMasterLookAndFeel; + DoCheckSubControls(AComponent.Components[I]); + end; + end; + +begin + AMasterLookAndFeel := TreeList.LookAndFeel; + DoCheckSubControls(Self); +end; + +procedure TcxTreeListBandColumnDesigner.MoveBy( + AListBox: TListBox; AProc: TNotifyEvent; AIncr: Integer); +var + AIntf: IcxTreeListIndexedItem; + AIndex, I, AOldIndex: Integer; +begin + if AListBox.SelCount = 0 then Exit; + AListBox.Items.BeginUpdate; + FDisableSelection := True; + try + AOldIndex := 0; + for I := 0 to AListBox.Items.Count - 1 do + if AListBox.Selected[I] then + begin + if Supports(AListBox.Items.Objects[I], IcxTreeListIndexedItem, AIntf) then + begin + AIndex := AIntf.GetItemIndex; + AIntf.SetItemIndex(AIndex + AIncr); + end; + AOldIndex := I + AIncr; + end; + FillLists; + if AOldIndex < 0 then AOldIndex := 0; + if AOldIndex >= AListBox.Items.Count then + AOldIndex := AListBox.Items.Count - 1; + if (AOldIndex <> -1) and (AListBox.Items.Count > 0) then + AListBox.Selected[AOldIndex] := True; + finally + FDisableSelection := False; + AListBox.Items.EndUpdate; + end; + AProc(AListBox); + Modified; +end; + +procedure TcxTreeListBandColumnDesigner.MoveDownListItem( + AListBox: TListBox; AProc: TNotifyEvent); +begin + MoveBy(AListBox, AProc, 1); +end; + +procedure TcxTreeListBandColumnDesigner.MoveUpListItem( + AListBox: TListBox; AProc: TNotifyEvent); +begin + MoveBy(AListBox, AProc, -1); +end; + +procedure TcxTreeListBandColumnDesigner.Notification(AComponent: TComponent; Operation: TOperation); +var + I: Integer; +begin + inherited Notification(AComponent, Operation); + if (csDestroying in ComponentState) or (TreeList = nil) or TreeList.IsDestroying then Exit; + if Operation = opRemove then + begin + I := lbxColumns.Items.IndexOfObject(AComponent); + if I <> -1 then + begin + lbxColumns.Items.Delete(I); + UnselectAll; + end; + end; +end; + +procedure TcxTreeListBandColumnDesigner.FillLists; +var + I: Integer; +begin + // Bands + lbxBands.Items.BeginUpdate; + try + lbxBands.Items.Clear; + with TreeList do + begin + for I := 0 to Bands.Count - 1 do + lbxBands.Items.AddObject(IntToStr(I) + ' - ' + Bands[I].ClassName, Bands[I]); + end; + finally + lbxBands.Items.EndUpdate; + end; + // Columns + lbxColumns.Items.BeginUpdate; + try + lbxColumns.Items.Clear; + with TreeList do + begin + for I := 0 to ColumnCount - 1 do + begin + lbxColumns.Items.AddObject(Columns[I].Name, Columns[I]); + TcxColumnAccess(Columns[I]).OnChangeName := ChangeNameHandler; + TreeList.Columns[I].FreeNotification(Self); + end; + end; + finally + lbxColumns.Items.EndUpdate; + end; + // select component + SelectItem; + Modified; +end; + +procedure TcxTreeListBandColumnDesigner.ListBoxSelectionChanged( + AListBox: TListBox; const AButtons: array of TButton; + const AMenuItems: array of TMenuItem); + + procedure SetState(AIndex: Integer; AEnabled: Boolean); + begin + AButtons[AIndex].Enabled := AEnabled; + if AMenuItems[AIndex] <> nil then + AMenuItems[AIndex].Enabled := AEnabled; + end; + +var + I: Integer; +begin + if FDisableSelection then Exit; + SelectSelectedItems(AListBox); + for I := Low(AButtons) to High(AButtons) do + begin + if I in [0, 1] then + SetState(I, AListBox.Items.Count > 0) + else + SetState(I, AListBox.SelCount > 0) + end; + Modified; +end; + +procedure TcxTreeListBandColumnDesigner.SelectAll(AListBox: TListBox; AProc: TNotifyEvent); +begin + AListBox.Items.BeginUpdate; + try + SetListBoxSelection(AListBox, True); + AListBox.SetFocus; + finally + AListBox.Items.EndUpdate; + AProc(AListBox); + end; +end; + +procedure TcxTreeListBandColumnDesigner.SelectItem; +begin + if PageControl.ActivePage.TabIndex = 0 then + BandsListClick(lbxBands) + else + ColumnsListClick(lbxColumns); +end; + +procedure TcxTreeListBandColumnDesigner.SelectSelectedItems(AListBox: TListBox); +var + AList: TList; +begin + AList := TList.Create; + try + GetSelection(AListBox, AList); + if AListBox = lbxColumns then + AList.Sort(cxCompareColumnsPos); + if AList.Count > 0 then + SetSelectionList(AList); + finally + AList.Free; + end; +end; + +procedure TcxTreeListBandColumnDesigner.SetListBoxSelection( + AList: TListBox; ASelection: Boolean); +var + I: Integer; +begin + AList.Items.BeginUpdate; + try + for I := 0 to AList.Items.Count - 1 do + AList.Selected[I] := ASelection; + finally + AList.Items.EndUpdate; + end; +end; + +procedure TcxTreeListBandColumnDesigner.UnSelectAll; +begin + SetListBoxSelection(lbxBands, False); + SetListBoxSelection(lbxColumns, False); +end; + +procedure TcxTreeListBandColumnDesigner.ColumnsListClick(Sender: TObject); +begin + ListBoxSelectionChanged(lbxColumns, + [btnCResD, btnCResW, btnCDel, btnCMoveU, btnCMoveD], + [mnuCResD, mnuCResW, mnuCDel, mnuCMoveU, mnuCMoveD]); +end; + +procedure TcxTreeListBandColumnDesigner.BandsListClick(Sender: TObject); +begin + ListBoxSelectionChanged(lbxBands, + [btnBResD, btnBResW, btnBDel, btnBMoveU, btnBMoveD], + [mnuBResD, mnuBResW, mnuBDel, mnuBMoveU, mnuBMoveD]); +end; + +procedure TcxTreeListBandColumnDesigner.lbxKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if Key = VK_RETURN then ActivateInspector(#0); +end; + +procedure TcxTreeListBandColumnDesigner.PageControlChange(Sender: TObject); +begin + SelectItem; +end; + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLIntf.pas b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLIntf.pas new file mode 100644 index 00000000..21d39433 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLIntf.pas @@ -0,0 +1,109 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumTreeList } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMTREELIST AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxTLIntf; + +{$I cxVer.inc} + +interface + +uses + Classes; + +type + + { IcxTreeListDesignTimeOperations } + + IcxTreeListDesignTimeOperations = interface + ['{9EC47E18-A921-4E5C-94F0-9995E8C5D8CB}'] + function SupportsBandColumnEditor: Boolean; + function SupportsItemsEditor: Boolean; + function SupportsCreateAllItems: Boolean; + // + function GetVersion: string; + procedure CreateAllItems; + procedure DeleteAllColumns; + end; + + { IcxTreeListOperations } + + IcxTreeListOperations = interface + ['{DFEC8B61-5B7A-4A91-8C27-E6AA6DC47301}'] + function SupportCustomizingBox: Boolean; + procedure HideCustomizingBox; + procedure ShowCustomizingBox; + end; + + { IcxTreeListDesigner } + + IcxTreeListDesigner = interface + ['{E051005C-9F9C-42B5-AD08-B406655872CC}'] + procedure ComponentRemoved(Sender: TObject); + procedure Modified; + end; + + { IcxTreeListIndexedItem } + + IcxTreeListIndexedItem = interface + ['{2FE52E12-14A4-443F-8B26-3ADB55C078AB}'] + function GetItemIndex: Integer; + function GetVisibleIndex: Integer; + procedure SetItemIndex(Value: Integer); + procedure SetVisibleIndex(Value: Integer); + property ItemIndex: Integer read GetItemIndex write SetItemIndex; + property VisibleIndex: Integer read GetVisibleIndex write SetVisibleIndex; + end; + +// { IcxTreeListDataController } +// +// IcxTreeListDataController = interface +// ['{22BAF765-FEE2-4A50-85BA-DF74A4F52E58}'] +// function GetKeyValue(ARecordIndex: Integer): Variant; +// function GetParentKeyValue(ARecordIndex: Integer): Variant; +// end; + +// function GetKeyValue(ARecordIndex: Integer): Variant; +// function GetParentKeyValue(ARecordIndex: Integer): Variant; + + { IcxTreeListSubClass } + + IcxTreeListSubClass = interface + ['{FC2BC45F-C395-4029-AB35-907F495CDC5B}'] + function GetControl: TObject; + end; + +implementation + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLItemsEdtr.dfm b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLItemsEdtr.dfm new file mode 100644 index 00000000..6a21ae0e --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLItemsEdtr.dfm @@ -0,0 +1,346 @@ +object frmItemsEditor: TfrmItemsEditor + Left = 243 + Top = 174 + Width = 485 + Height = 374 + Anchors = [akLeft, akTop, akBottom] + BorderIcons = [biSystemMenu] + Caption = 'Items Editor' + Color = clBtnFace + Constraints.MinHeight = 374 + Constraints.MinWidth = 476 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Scaled = False + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 477 + Height = 304 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Panel3: TPanel + Left = 368 + Top = 0 + Width = 109 + Height = 304 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btnNewItem: TcxButton + Tag = 4 + Left = 10 + Top = 8 + Width = 90 + Height = 22 + Anchors = [akTop, akRight] + Caption = '&New Item' + TabOrder = 0 + OnClick = cxButtonPress + end + object btnNewSubItem: TcxButton + Tag = 5 + Left = 10 + Top = 40 + Width = 90 + Height = 22 + Anchors = [akTop, akRight] + Caption = 'New &SubItem' + TabOrder = 1 + OnClick = cxButtonPress + end + object btnDelete: TcxButton + Tag = 6 + Left = 10 + Top = 72 + Width = 90 + Height = 22 + Anchors = [akTop, akRight] + Caption = '&Delete' + TabOrder = 2 + OnClick = cxButtonPress + end + object Panel5: TPanel + Left = 0 + Top = 100 + Width = 109 + Height = 204 + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + TabOrder = 3 + object gbIndexes: TGroupBox + Left = 10 + Top = 7 + Width = 91 + Height = 94 + Anchors = [akTop, akRight] + Caption = 'Image Indexes' + TabOrder = 0 + object Label1: TLabel + Left = 8 + Top = 24 + Width = 29 + Height = 13 + Caption = 'Image' + end + object Label2: TLabel + Left = 8 + Top = 48 + Width = 42 + Height = 13 + Caption = 'Selected' + end + object Label3: TLabel + Left = 8 + Top = 72 + Width = 25 + Height = 13 + Caption = 'State' + end + object edtImage: TcxTextEdit + Left = 59 + Top = 19 + Width = 24 + Height = 21 + TabOrder = 0 + Text = '0' + OnExit = edtImageExit + OnKeyDown = edtImageKeyDown + end + object edtSelected: TcxTextEdit + Tag = 1 + Left = 59 + Top = 43 + Width = 24 + Height = 21 + TabOrder = 1 + Text = '0' + OnExit = edtImageExit + OnKeyDown = edtImageKeyDown + end + object edtState: TcxTextEdit + Tag = 2 + Left = 59 + Top = 67 + Width = 24 + Height = 21 + TabOrder = 2 + Text = '-1' + OnExit = edtImageExit + OnKeyDown = edtImageKeyDown + end + end + object gbDefaultIndexes: TGroupBox + Left = 10 + Top = 108 + Width = 92 + Height = 94 + Anchors = [akTop, akRight] + Caption = 'Default Indexes' + TabOrder = 1 + object Label4: TLabel + Left = 8 + Top = 24 + Width = 29 + Height = 13 + Caption = 'Image' + end + object Label5: TLabel + Left = 8 + Top = 48 + Width = 42 + Height = 13 + Caption = 'Selected' + end + object Label6: TLabel + Left = 8 + Top = 72 + Width = 25 + Height = 13 + Caption = 'State' + end + object edtDefImage: TcxTextEdit + Left = 59 + Top = 19 + Width = 24 + Height = 21 + TabOrder = 0 + Text = '0' + end + object edtDefSelected: TcxTextEdit + Tag = 1 + Left = 59 + Top = 43 + Width = 24 + Height = 21 + TabOrder = 1 + Text = '0' + end + object edtDefState: TcxTextEdit + Tag = 2 + Left = 59 + Top = 67 + Width = 24 + Height = 21 + TabOrder = 2 + Text = '-1' + end + end + end + end + object Panel6: TPanel + Left = 0 + Top = 0 + Width = 368 + Height = 304 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + object Panel7: TPanel + Left = 0 + Top = 0 + Width = 368 + Height = 8 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + end + object Panel10: TPanel + Left = 0 + Top = 8 + Width = 8 + Height = 294 + Align = alLeft + BevelOuter = bvNone + TabOrder = 1 + end + object cxTreeList1: TcxTreeList + Left = 8 + Top = 8 + Width = 360 + Height = 294 + Align = alClient + Bands = < + item + Caption.Text = 'Band + 1' + end> + BufferedPaint = False + DragMode = dmAutomatic + OptionsBehavior.AutomateLeftMostIndent = False + OptionsSelection.HideFocusRect = False + OptionsSelection.InvertSelect = False + OptionsSelection.MultiSelect = True + OptionsView.GridLines = tlglBoth + OptionsView.PaintStyle = tlpsCategorized + PopupMenu = mnuEditItems + Preview.Visible = True + TabOrder = 2 + OnDragOver = cxTreeList1DragOver + object cxTreeList1cxTreeListColumn1: TcxTreeListColumn + DataBinding.ValueType = 'String' + Position.ColIndex = 0 + Position.RowIndex = 0 + Position.BandIndex = 0 + end + end + object Panel8: TPanel + Left = 0 + Top = 302 + Width = 368 + Height = 2 + Align = alBottom + BevelOuter = bvNone + TabOrder = 3 + end + end + end + object Panel2: TPanel + Left = 0 + Top = 304 + Width = 477 + Height = 36 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object btnCustomize: TcxButton + Left = 8 + Top = 6 + Width = 90 + Height = 22 + Anchors = [akLeft, akBottom] + Caption = 'C&ustomize' + TabOrder = 0 + OnClick = cxButtonPress + end + object Panel4: TPanel + Left = 250 + Top = 0 + Width = 227 + Height = 36 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object btnOk: TcxButton + Tag = 1 + Left = 28 + Top = 6 + Width = 90 + Height = 22 + Anchors = [akRight, akBottom] + Caption = '&Ok' + ModalResult = 1 + TabOrder = 0 + end + object btnCancel: TcxButton + Tag = 2 + Left = 128 + Top = 6 + Width = 90 + Height = 22 + Anchors = [akRight, akBottom] + Caption = '&Cancel' + ModalResult = 2 + TabOrder = 1 + end + end + end + object mnuEditItems: TPopupMenu + Left = 296 + Top = 8 + object NewItem1: TMenuItem + Tag = 4 + Caption = '&New Item' + OnClick = cxButtonPress + end + object NewSubItem1: TMenuItem + Tag = 5 + Caption = 'New &SubItem' + OnClick = cxButtonPress + end + object Delete1: TMenuItem + Tag = 6 + Caption = '&Delete' + OnClick = cxButtonPress + end + object N1: TMenuItem + Caption = '-' + OnClick = cxButtonPress + end + object Customize1: TMenuItem + Caption = 'C&ustomize' + OnClick = cxButtonPress + end + end + object cxLookAndFeelController1: TcxLookAndFeelController + Left = 328 + Top = 8 + end +end diff --git a/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLItemsEdtr.pas b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLItemsEdtr.pas new file mode 100644 index 00000000..97dd30f2 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLItemsEdtr.pas @@ -0,0 +1,344 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumTreeList } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMTREELIST AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxTLItemsEdtr; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, cxStyles, cxLookAndFeelPainters, cxMaskEdit, cxSpinEdit, + cxContainer, cxEdit, cxTextEdit, StdCtrls, cxButtons, cxControls, + cxLookAndFeels, cxInplaceContainer, cxTL, cxTLStrs, cxTLIntf, Menus, + ExtCtrls, cxGraphics, cxCustomData; + +type + TcxTreeListAccess = class(TcxTreeList); + + TfrmItemsEditor = class(TForm, IcxTreeListDesigner) + Panel1: TPanel; + mnuEditItems: TPopupMenu; + NewItem1: TMenuItem; + NewSubItem1: TMenuItem; + Delete1: TMenuItem; + N1: TMenuItem; + Customize1: TMenuItem; + Panel2: TPanel; + btnCustomize: TcxButton; + Panel3: TPanel; + btnNewItem: TcxButton; + btnNewSubItem: TcxButton; + btnDelete: TcxButton; + cxLookAndFeelController1: TcxLookAndFeelController; + Panel4: TPanel; + btnOk: TcxButton; + btnCancel: TcxButton; + Panel5: TPanel; + gbIndexes: TGroupBox; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + edtImage: TcxTextEdit; + edtSelected: TcxTextEdit; + edtState: TcxTextEdit; + gbDefaultIndexes: TGroupBox; + Label4: TLabel; + Label5: TLabel; + Label6: TLabel; + edtDefImage: TcxTextEdit; + edtDefSelected: TcxTextEdit; + edtDefState: TcxTextEdit; + Panel6: TPanel; + Panel7: TPanel; + Panel10: TPanel; + cxTreeList1: TcxTreeList; + Panel8: TPanel; + cxTreeList1cxTreeListColumn1: TcxTreeListColumn; + procedure cxButtonPress(Sender: TObject); + procedure edtImageExit(Sender: TObject); + procedure edtImageKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure cxTreeList1DragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + private + procedure AssignDataToTreeList; + function GetTreeList: TcxTreeListAccess; + protected + procedure DoOnChangeTreeList(Sender: TObject); + procedure DoSetImageIndex(Sender: TcxTextEdit); + function GetValue(Sender: TcxTextEdit): Integer; + // IcxTreeListDesigner + procedure ComponentRemoved(Sender: TObject); + procedure Modified; + property TreeList: TcxTreeListAccess read GetTreeList; + public + Control: TcxTreeList; + procedure Activated; + function ShowModal: Integer; override; + end; + + function cxShowTreeListItemsEditor(AControl: TcxTreeList): Boolean; + +implementation + +type + TcxTLAccess = class(TcxTreeList); + +{$R *.dfm} + +function cxShowTreeListItemsEditor(AControl: TcxTreeList): Boolean; +begin + with TfrmItemsEditor.Create(nil) do + try + Control := AControl; + Result := ShowModal = mrOk; + if Result then AssignDataToTreeList; + finally + Free; + end; +end; + +function TfrmItemsEditor.ShowModal: Integer; +begin + Activated; + Result := inherited ShowModal; +end; + +procedure TfrmItemsEditor.Activated; +var + I: Integer; +begin + cxLookAndFeelController1.NativeStyle := TreeList.LookAndFeel.NativeStyle; + cxLookAndFeelController1.Kind := TreeList.LookAndFeel.Kind; + with TcxTreeListAccess(cxTreeList1) do + begin + DeleteAllColumns; + BeginUpdate; + try + Bands := TreeList.Bands; + for I := 0 to TreeList.ColumnCount - 1 do + DoCreateColumn.Assign(TreeList.Columns[I]); + Font := TreeList.Font; + Styles := TreeList.Styles; + OptionsCustomizing := TreeList.OptionsCustomizing; + OptionsView := TreeList.OptionsView; + OptionsBehavior := TreeList.OptionsBehavior; + OptionsSelection := TreeList.OptionsSelection; + OptionsSelection.CellSelect := True; + OptionsData.Editing := True; + Nodes.Assign(TreeList.Nodes); + Images := TreeList.Images; + StateImages := TreeList.StateImages; + Preview := TreeList.Preview; + finally + EndUpdate; + end; + cxTreeList1.OnChange := DoOnChangeTreeList; + cxTreeList1.OnSelectionChanged := DoOnChangeTreeList; + end; +end; + +procedure TfrmItemsEditor.DoOnChangeTreeList(Sender: TObject); + + procedure SetValues(const I1, I2, I3: string); + begin + edtImage.Text := I1; + edtSelected.Text := I2; + edtState.Text := I3; + end; + +begin + if cxTreeList1.FocusedNode <> nil then + with cxTreeList1.FocusedNode do + SetValues(IntToStr(ImageIndex), IntToStr(SelectedIndex), IntToStr(StateIndex)) + else + SetValues(edtDefImage.Text, edtDefSelected.Text, edtDefState.Text); +end; + +procedure TfrmItemsEditor.DoSetImageIndex(Sender: TcxTextEdit); +var + AIndex: Integer; + I: Integer; + AList: TList; + ANode: TcxTreeListNode; + AType: TcxTreeListImageIndexType; +begin + AIndex := GetValue(Sender); + AType := TcxTreeListImageIndexType(Sender.Tag); + cxTreeList1.BeginUpdate; + try + AList := TList.Create; + try + ANode := cxTreeList1.GetSelections(AList); + for I := 0 to AList.Count - 1 do + TcxTLAccess(cxTreeList1).DoSetNodeImageIndex( + TcxTreeListNode(AList.List^[I]), AType, AIndex); + TcxTLAccess(cxTreeList1).DoSetNodeImageIndex(ANode, AType, AIndex); + finally + AList.Free; + end; + finally + cxTreeList1.EndUpdate; + end; +end; + +function TfrmItemsEditor.GetValue(Sender: TcxTextEdit): Integer; +var + ACode: Integer; +begin + Val(Sender.Text, Result, ACode); + if ACode <> 0 then Result := -1; + Sender.Text := IntToStr(Result); +end; + +procedure TfrmItemsEditor.ComponentRemoved(Sender: TObject); +begin +end; + +procedure TfrmItemsEditor.Modified; +begin + +end; + +procedure TfrmItemsEditor.AssignDataToTreeList; +var + I: Integer; +begin + TreeList.BeginUpdate; + try + TreeList.Nodes.Clear; + for I := 0 to cxTreeList1.Bands.Count - 1 do + TreeList.Bands[I] := cxTreeList1.Bands[I]; + for I := 0 to cxTreeList1.ColumnCount - 1 do + TreeList.Columns[I] := cxTreeList1.Columns[I]; + TreeList.Nodes := cxTreeList1.Nodes; + finally + TreeList.EndUpdate; + TreeList.Modified; + end; +end; + +function TfrmItemsEditor.GetTreeList: TcxTreeListAccess; +begin + Result := TcxTreeListAccess(Control); +end; + +procedure TfrmItemsEditor.cxButtonPress(Sender: TObject); + + procedure CheckAdd(ANode: TcxTreeListNode); + begin + if ANode <> nil then + begin + cxTreeList1.BeginUpdate; + try + ANode.ImageIndex := GetValue(edtDefImage); + ANode.SelectedIndex := GetValue(edtDefSelected); + ANode.StateIndex := GetValue(edtDefState); + ANode.MakeVisible; + ANode.Focused := True; + finally + cxTreeList1.EndUpdate; + end; + end; + end; + +var + ATag: Integer; + AParentNode, ANode: TcxTreeListNode; + +begin + ATag := (Sender as TComponent).Tag; + ANode := cxTreeList1.FocusedNode; + if ANode <> nil then + AParentNode := ANode.Parent + else + AParentNode := nil; + case ATag of + 0: + cxTreeList1.Customizing.Visible := True; + 1: + begin + AssignDataToTreeList; + Close; + end; + 2: + Close; + 3:; + 4: + if AParentNode = nil then + CheckAdd(cxTreeList1.Add) + else + CheckAdd(AParentNode.AddChild); + 5: + if ANode = nil then + CheckAdd(cxTreeList1.Add) + else + CheckAdd(ANode.AddChild); + 6: + begin + if ANode <> nil then + begin + if ANode.GetPrev <> nil then + ANode := ANode.GetPrev + else + ANode := ANode.GetNext; + end; + TcxTreeListAccess(cxTreeList1).DoDeleteSelection; + if ANode <> nil then ANode.Focused := True; + end; + end; +end; + +procedure TfrmItemsEditor.edtImageExit(Sender: TObject); +begin + DoSetImageIndex(Sender as TcxTextEdit); +end; + +procedure TfrmItemsEditor.edtImageKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if Key = VK_RETURN then + DoSetImageIndex(Sender as TcxTextEdit); +end; + +procedure TfrmItemsEditor.cxTreeList1DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); +begin + Accept := cxTreeList1.HitTest.HitAtNode; +end; + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLPredefinedStyles.dfm b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLPredefinedStyles.dfm new file mode 100644 index 00000000..6e706267 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLPredefinedStyles.dfm @@ -0,0 +1,4001 @@ +object cxdmTreeListPredefinedStyles: TcxdmTreeListPredefinedStyles + OldCreateOrder = False + Left = 311 + Top = 194 + Height = 259 + Width = 315 + object StyleRepository: TcxStyleRepository + Left = 216 + Top = 48 + object cxStyle1: TcxStyle + AssignedValues = [svColor] + Color = 15451300 + end + object cxStyle2: TcxStyle + AssignedValues = [svColor] + Color = 15451300 + end + object cxStyle3: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12937777 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle4: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12937777 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle5: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16247513 + TextColor = clBlack + end + object cxStyle6: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16445924 + TextColor = clBlack + end + object cxStyle7: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 15850688 + TextColor = clBlack + end + object cxStyle8: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12937777 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle9: TcxStyle + AssignedValues = [svColor] + Color = 15451300 + end + object cxStyle10: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBlack + end + object cxStyle11: TcxStyle + AssignedValues = [svColor] + Color = 15451300 + end + object cxStyle12: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 16711164 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -9 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = clSilver + end + object cxStyle13: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 12937777 + TextColor = clWhite + end + object cxStyle14: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8894686 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle15: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8894686 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle16: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15136253 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [] + TextColor = 7346457 + end + object cxStyle17: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9818092 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [] + TextColor = clBlack + end + object cxStyle18: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8036607 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [] + TextColor = clBlack + end + object cxStyle19: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8894686 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle20: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4159924 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle21: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8894686 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial Narrow' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle22: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clOlive + end + object cxStyle23: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 2179167 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle24: TcxStyle + AssignedValues = [svColor] + Color = 14149876 + end + object cxStyle25: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9157775 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle26: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9157775 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle27: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle28: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9234160 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle29: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11788021 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle30: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9157775 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle31: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6989624 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle32: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9157775 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle33: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clSilver + end + object cxStyle34: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4615972 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle35: TcxStyle + AssignedValues = [svColor] + Color = 13164490 + end + object cxStyle36: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13271182 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle37: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13271182 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle38: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle39: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 16775416 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle40: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 16443110 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial' + Font.Style = [] + TextColor = clBlack + end + object cxStyle41: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13271182 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle42: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14252010 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle43: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13271182 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle44: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsItalic] + TextColor = clPurple + end + object cxStyle45: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9509542 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle46: TcxStyle + AssignedValues = [svColor] + Color = 14528184 + end + object cxStyle47: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6908265 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle48: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6908265 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle49: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle50: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle51: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15461355 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle52: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6908265 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle53: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6447714 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle54: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6908265 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle55: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clSilver + end + object cxStyle56: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle57: TcxStyle + AssignedValues = [svColor] + Color = clSilver + end + object cxStyle58: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5337222 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle59: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5337222 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle60: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle61: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10862530 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle62: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13820129 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle63: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5337222 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle64: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7904931 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle65: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10862530 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle66: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15134192 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsItalic] + TextColor = clMaroon + end + object cxStyle67: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6392205 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle68: TcxStyle + AssignedValues = [svColor] + Color = 14674410 + end + object cxStyle69: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle70: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle71: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle72: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12307669 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle73: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14542570 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle74: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle75: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9413547 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle76: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12307669 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle77: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clTeal + end + object cxStyle78: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7572117 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle79: TcxStyle + AssignedValues = [svColor] + Color = 8421440 + end + object cxStyle80: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11055248 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle81: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7897176 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle82: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle83: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 11055248 + TextColor = clBlack + end + object cxStyle84: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14211272 + TextColor = clBlack + end + object cxStyle85: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7897176 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle86: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9345127 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle87: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10397571 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle88: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = 7897176 + end + object cxStyle89: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7897176 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle90: TcxStyle + AssignedValues = [svColor, svFont] + Color = 7897176 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + end + object cxStyle91: TcxStyle + AssignedValues = [svColor, svFont] + Color = 7897176 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + end + object cxStyle92: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13140618 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Garamond' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle93: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13140105 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Garamond' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle94: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Garamond' + Font.Style = [] + TextColor = clBlack + end + object cxStyle95: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14264494 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Garamond' + Font.Style = [fsItalic] + TextColor = clBlack + end + object cxStyle96: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15521240 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Garamond' + Font.Style = [fsItalic] + TextColor = clBlack + end + object cxStyle97: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13339026 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle98: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12876163 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle99: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14264494 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle100: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 11619930 + end + object cxStyle101: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11619930 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle102: TcxStyle + AssignedValues = [svColor] + Color = 15851746 + end + object cxStyle103: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3841470 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle104: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5680843 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle105: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle106: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11458790 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle107: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14150898 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle108: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3443881 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle109: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8044502 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle110: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11458790 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle111: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle112: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4630214 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle113: TcxStyle + AssignedValues = [svColor] + Color = clWhite + end + object cxStyle114: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9016398 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle115: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9016398 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle116: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14213320 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle117: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12107912 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle118: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14213320 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle119: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9016398 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle120: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8488544 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle121: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12107912 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle122: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14213320 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clNavy + end + object cxStyle123: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6053956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle124: TcxStyle + AssignedValues = [svColor] + Color = 14475461 + end + object cxStyle125: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9476264 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle126: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9476264 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle127: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160664 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle128: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10266296 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle129: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14476524 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle130: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9476264 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle131: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6321567 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 13160664 + end + object cxStyle132: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9476264 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle133: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160664 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsItalic] + TextColor = 6307912 + end + object cxStyle134: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4210816 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 13160664 + end + object cxStyle135: TcxStyle + AssignedValues = [svColor] + Color = 9476264 + end + object cxStyle136: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10343916 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle137: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10343916 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle138: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle139: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10343916 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle140: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13626101 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle141: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10343916 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle142: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8825791 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle143: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10343916 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle144: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 3122647 + end + object cxStyle145: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5341849 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle146: TcxStyle + AssignedValues = [svColor] + Color = clWhite + end + object cxStyle147: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9072727 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle148: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10124385 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle149: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle150: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11639171 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle151: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14273729 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle152: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9401434 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle153: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9927006 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle154: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11639171 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle155: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 8217935 + end + object cxStyle156: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8217935 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle157: TcxStyle + AssignedValues = [svColor] + Color = 11639171 + end + object cxStyle158: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12935220 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle159: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12935220 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle160: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clBlack + end + object cxStyle161: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12935220 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clBlack + end + object cxStyle162: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clNavy + end + object cxStyle163: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12935220 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clBlack + end + object cxStyle164: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7895258 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clWhite + end + object cxStyle165: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12935220 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle166: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle167: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 202 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clWhite + end + object cxStyle168: TcxStyle + AssignedValues = [svColor] + Color = clWhite + end + object cxStyle169: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle170: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle171: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15461375 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle172: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15461375 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle173: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15461375 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle174: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle175: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8289995 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle176: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clBlack + end + object cxStyle177: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 7364767 + end + object cxStyle178: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5855675 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle179: TcxStyle + AssignedValues = [svColor] + Color = clWhite + end + object cxStyle180: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clMaroon + end + object cxStyle181: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clMaroon + end + object cxStyle182: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15461375 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [] + TextColor = clBlack + end + object cxStyle183: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15461375 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [] + TextColor = clBlack + end + object cxStyle184: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [] + TextColor = clBlack + end + object cxStyle185: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12103888 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle186: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9211088 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle187: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12103888 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clBlack + end + object cxStyle188: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 7364768 + end + object cxStyle189: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5855675 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle190: TcxStyle + AssignedValues = [svColor] + Color = clWhite + end + object cxStyle191: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13154717 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle192: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13154717 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle193: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle194: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13154717 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle195: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14933198 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle196: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13154717 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle197: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11441772 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle198: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13154717 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle199: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 9928789 + end + object cxStyle200: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9928789 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle201: TcxStyle + AssignedValues = [svColor] + Color = 15591908 + end + object cxStyle202: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11126946 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clTeal + end + object cxStyle203: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11126946 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clTeal + end + object cxStyle204: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle205: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11126946 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle206: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13886416 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle207: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11126946 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle208: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8170097 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle209: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11126946 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle210: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsItalic] + TextColor = 6592345 + end + object cxStyle211: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6592345 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle212: TcxStyle + AssignedValues = [svColor] + Color = 15725290 + end + object cxStyle213: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11504771 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle214: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11504771 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle215: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle216: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle217: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle218: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11504771 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle219: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13746093 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle220: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle221: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clGray + end + object cxStyle222: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12625805 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle223: TcxStyle + AssignedValues = [svColor] + Color = 14671839 + end + object cxStyle224: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8421440 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle225: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle226: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle227: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle228: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle229: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8421440 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle230: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10197760 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle231: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle232: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14803425 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsItalic] + TextColor = clTeal + end + object cxStyle233: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle234: TcxStyle + AssignedValues = [svColor] + Color = 8421440 + end + object cxStyle235: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4175028 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle236: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6342856 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle237: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle238: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10542814 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle239: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13692654 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle240: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4175028 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle241: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 43690 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle242: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10542814 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle243: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clOlive + end + object cxStyle244: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clOlive + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle245: TcxStyle + AssignedValues = [svColor] + Color = 13101807 + end + object cxStyle246: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle247: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle248: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle249: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle250: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle251: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle252: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11403264 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle253: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle254: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clNavy + end + object cxStyle255: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle256: TcxStyle + AssignedValues = [svColor] + Color = clSilver + end + object cxStyle257: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle258: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle259: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle260: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14671839 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle261: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle262: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle263: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11730944 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle264: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle265: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clNavy + end + object cxStyle266: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle267: TcxStyle + AssignedValues = [svColor] + Color = clSilver + end + object cxStyle268: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle269: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle270: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle271: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle272: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle273: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle274: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10171663 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle275: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle276: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 6956042 + end + object cxStyle277: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle278: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle279: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle280: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle281: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle282: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle283: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle284: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10434063 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle285: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle286: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 6956042 + end + object cxStyle287: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle288: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle289: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle290: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clYellow + end + object cxStyle291: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle292: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle293: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle294: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4210907 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle295: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle296: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = -1 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle297: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 206 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle298: TcxStyle + AssignedValues = [svColor] + Color = clSilver + end + object cxStyle299: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle300: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle301: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clYellow + end + object cxStyle302: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle303: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle304: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle305: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4671452 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle306: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle307: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle308: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 206 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle309: TcxStyle + AssignedValues = [svColor] + Color = clSilver + end + object cxStyle310: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle311: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clYellow + end + object cxStyle312: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle313: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle314: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle315: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clYellow + end + object cxStyle316: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9109503 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle317: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle318: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clYellow + end + object cxStyle319: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clYellow + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle320: TcxStyle + AssignedValues = [svColor] + Color = clBlack + end + object cxStyle321: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle322: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clYellow + end + object cxStyle323: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle324: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle325: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle326: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clYellow + end + object cxStyle327: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8257535 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle328: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle329: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clYellow + end + object cxStyle330: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clYellow + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle331: TcxStyle + AssignedValues = [svColor] + Color = clWhite + end + object cxStyle332: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle333: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle334: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle335: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle336: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle337: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle338: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11534512 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle339: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle340: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clPurple + end + object cxStyle341: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clPurple + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle342: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle343: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle344: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle345: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle346: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle347: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle348: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11141290 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle349: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle350: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clPurple + end + object cxStyle351: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clPurple + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle352: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle353: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle354: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle355: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle356: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15658734 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle357: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle358: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4802889 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle359: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle360: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle361: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle362: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle363: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle364: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle365: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle366: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15658734 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle367: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle368: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3355443 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle369: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle370: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle371: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object TreeListStyleSheetDevExpress: TcxTreeListStyleSheet + Caption = 'DevExpress' + Styles.Background = cxStyle1 + Styles.Content = cxStyle5 + Styles.Inactive = cxStyle9 + Styles.Selection = cxStyle13 + Styles.BandBackground = cxStyle2 + Styles.BandHeader = cxStyle3 + Styles.ColumnHeader = cxStyle4 + Styles.ContentEven = cxStyle6 + Styles.ContentOdd = cxStyle7 + Styles.Footer = cxStyle8 + Styles.IncSearch = cxStyle10 + Styles.Indicator = cxStyle11 + Styles.Preview = cxStyle12 + BuiltIn = True + end + object TreeListStyleSheetUserFormat1: TcxTreeListStyleSheet + Caption = 'UserFormat1' + Styles.Content = cxStyle16 + Styles.Inactive = cxStyle20 + Styles.Selection = cxStyle23 + Styles.BandBackground = cxStyle24 + Styles.BandHeader = cxStyle14 + Styles.ColumnHeader = cxStyle15 + Styles.ContentEven = cxStyle17 + Styles.ContentOdd = cxStyle18 + Styles.Footer = cxStyle19 + Styles.Indicator = cxStyle21 + Styles.Preview = cxStyle22 + BuiltIn = True + end + object TreeListStyleSheetUserFormat2: TcxTreeListStyleSheet + Caption = 'UserFormat2' + Styles.Content = cxStyle27 + Styles.Inactive = cxStyle31 + Styles.Selection = cxStyle34 + Styles.BandBackground = cxStyle35 + Styles.BandHeader = cxStyle25 + Styles.ColumnHeader = cxStyle26 + Styles.ContentEven = cxStyle28 + Styles.ContentOdd = cxStyle29 + Styles.Footer = cxStyle30 + Styles.Indicator = cxStyle32 + Styles.Preview = cxStyle33 + BuiltIn = True + end + object TreeListStyleSheetUserFormat3: TcxTreeListStyleSheet + Caption = 'UserFormat3' + Styles.Content = cxStyle38 + Styles.Inactive = cxStyle42 + Styles.Selection = cxStyle45 + Styles.BandBackground = cxStyle46 + Styles.BandHeader = cxStyle36 + Styles.ColumnHeader = cxStyle37 + Styles.ContentEven = cxStyle39 + Styles.ContentOdd = cxStyle40 + Styles.Footer = cxStyle41 + Styles.Indicator = cxStyle43 + Styles.Preview = cxStyle44 + BuiltIn = True + end + object TreeListStyleSheetUserFormat4: TcxTreeListStyleSheet + Caption = 'UserFormat4' + Styles.Content = cxStyle49 + Styles.Inactive = cxStyle53 + Styles.Selection = cxStyle56 + Styles.BandBackground = cxStyle57 + Styles.BandHeader = cxStyle47 + Styles.ColumnHeader = cxStyle48 + Styles.ContentEven = cxStyle50 + Styles.ContentOdd = cxStyle51 + Styles.Footer = cxStyle52 + Styles.Indicator = cxStyle54 + Styles.Preview = cxStyle55 + BuiltIn = True + end + object TreeListStyleSheetBrick: TcxTreeListStyleSheet + Caption = 'Brick' + Styles.Content = cxStyle60 + Styles.Inactive = cxStyle64 + Styles.Selection = cxStyle67 + Styles.BandBackground = cxStyle68 + Styles.BandHeader = cxStyle58 + Styles.ColumnHeader = cxStyle59 + Styles.ContentEven = cxStyle61 + Styles.ContentOdd = cxStyle62 + Styles.Footer = cxStyle63 + Styles.Indicator = cxStyle65 + Styles.Preview = cxStyle66 + BuiltIn = True + end + object TreeListStyleSheetDesert: TcxTreeListStyleSheet + Caption = 'Desert' + Styles.Content = cxStyle71 + Styles.Inactive = cxStyle75 + Styles.Selection = cxStyle78 + Styles.BandBackground = cxStyle79 + Styles.BandHeader = cxStyle69 + Styles.ColumnHeader = cxStyle70 + Styles.ContentEven = cxStyle72 + Styles.ContentOdd = cxStyle73 + Styles.Footer = cxStyle74 + Styles.Indicator = cxStyle76 + Styles.Preview = cxStyle77 + BuiltIn = True + end + object TreeListStyleSheetEggplant: TcxTreeListStyleSheet + Caption = 'Eggplant' + Styles.Content = cxStyle82 + Styles.Inactive = cxStyle86 + Styles.Selection = cxStyle89 + Styles.BandBackground = cxStyle80 + Styles.BandHeader = cxStyle91 + Styles.ColumnFooter = cxStyle90 + Styles.ColumnHeader = cxStyle81 + Styles.ContentEven = cxStyle83 + Styles.ContentOdd = cxStyle84 + Styles.Footer = cxStyle85 + Styles.Indicator = cxStyle87 + Styles.Preview = cxStyle88 + BuiltIn = True + end + object TreeListStyleSheetLilac: TcxTreeListStyleSheet + Caption = 'Lilac' + Styles.Content = cxStyle94 + Styles.Inactive = cxStyle98 + Styles.Selection = cxStyle101 + Styles.BandBackground = cxStyle102 + Styles.BandHeader = cxStyle92 + Styles.ColumnHeader = cxStyle93 + Styles.ContentEven = cxStyle95 + Styles.ContentOdd = cxStyle96 + Styles.Footer = cxStyle97 + Styles.Indicator = cxStyle99 + Styles.Preview = cxStyle100 + BuiltIn = True + end + object TreeListStyleSheetMaple: TcxTreeListStyleSheet + Caption = 'Maple' + Styles.Content = cxStyle105 + Styles.Inactive = cxStyle109 + Styles.Selection = cxStyle112 + Styles.BandBackground = cxStyle113 + Styles.BandHeader = cxStyle103 + Styles.ColumnHeader = cxStyle104 + Styles.ContentEven = cxStyle106 + Styles.ContentOdd = cxStyle107 + Styles.Footer = cxStyle108 + Styles.Indicator = cxStyle110 + Styles.Preview = cxStyle111 + BuiltIn = True + end + object TreeListStyleSheetMarineHighColor: TcxTreeListStyleSheet + Caption = 'Marine (high color)' + Styles.Content = cxStyle116 + Styles.Inactive = cxStyle120 + Styles.Selection = cxStyle123 + Styles.BandBackground = cxStyle124 + Styles.BandHeader = cxStyle114 + Styles.ColumnHeader = cxStyle115 + Styles.ContentEven = cxStyle117 + Styles.ContentOdd = cxStyle118 + Styles.Footer = cxStyle119 + Styles.Indicator = cxStyle121 + Styles.Preview = cxStyle122 + BuiltIn = True + end + object TreeListStyleSheetPlumHighColor: TcxTreeListStyleSheet + Caption = 'Plum (high color)' + Styles.Content = cxStyle127 + Styles.Inactive = cxStyle131 + Styles.Selection = cxStyle134 + Styles.BandBackground = cxStyle135 + Styles.BandHeader = cxStyle125 + Styles.ColumnHeader = cxStyle126 + Styles.ContentEven = cxStyle128 + Styles.ContentOdd = cxStyle129 + Styles.Footer = cxStyle130 + Styles.Indicator = cxStyle132 + Styles.Preview = cxStyle133 + BuiltIn = True + end + object TreeListStyleSheetPumpkinLarge: TcxTreeListStyleSheet + Caption = 'Pumpkin (large)' + Styles.Content = cxStyle138 + Styles.Inactive = cxStyle142 + Styles.Selection = cxStyle145 + Styles.BandBackground = cxStyle146 + Styles.BandHeader = cxStyle136 + Styles.ColumnHeader = cxStyle137 + Styles.ContentEven = cxStyle139 + Styles.ContentOdd = cxStyle140 + Styles.Footer = cxStyle141 + Styles.Indicator = cxStyle143 + Styles.Preview = cxStyle144 + BuiltIn = True + end + object TreeListStyleSheetRainyDay: TcxTreeListStyleSheet + Caption = 'Rainy Day' + Styles.Content = cxStyle149 + Styles.Inactive = cxStyle153 + Styles.Selection = cxStyle156 + Styles.BandBackground = cxStyle157 + Styles.BandHeader = cxStyle147 + Styles.ColumnHeader = cxStyle148 + Styles.ContentEven = cxStyle150 + Styles.ContentOdd = cxStyle151 + Styles.Footer = cxStyle152 + Styles.Indicator = cxStyle154 + Styles.Preview = cxStyle155 + BuiltIn = True + end + object TreeListStyleSheetRedWhiteBlueVGA: TcxTreeListStyleSheet + Caption = 'Red, White, and Blue (VGA)' + Styles.Content = cxStyle160 + Styles.Inactive = cxStyle164 + Styles.Selection = cxStyle167 + Styles.BandBackground = cxStyle168 + Styles.BandHeader = cxStyle158 + Styles.ColumnHeader = cxStyle159 + Styles.ContentEven = cxStyle161 + Styles.ContentOdd = cxStyle162 + Styles.Footer = cxStyle163 + Styles.Indicator = cxStyle165 + Styles.Preview = cxStyle166 + BuiltIn = True + end + object TreeListStyleSheetRose: TcxTreeListStyleSheet + Caption = 'Rose' + Styles.Content = cxStyle171 + Styles.Inactive = cxStyle175 + Styles.Selection = cxStyle178 + Styles.BandBackground = cxStyle179 + Styles.BandHeader = cxStyle169 + Styles.ColumnHeader = cxStyle170 + Styles.ContentEven = cxStyle172 + Styles.ContentOdd = cxStyle173 + Styles.Footer = cxStyle174 + Styles.Indicator = cxStyle176 + Styles.Preview = cxStyle177 + BuiltIn = True + end + object TreeListStyleSheetRoseLarge: TcxTreeListStyleSheet + Caption = 'Rose (large)' + Styles.Content = cxStyle182 + Styles.Inactive = cxStyle186 + Styles.Selection = cxStyle189 + Styles.BandBackground = cxStyle190 + Styles.BandHeader = cxStyle180 + Styles.ColumnHeader = cxStyle181 + Styles.ContentEven = cxStyle183 + Styles.ContentOdd = cxStyle184 + Styles.Footer = cxStyle185 + Styles.Indicator = cxStyle187 + Styles.Preview = cxStyle188 + BuiltIn = True + end + object TreeListStyleSheetSlate: TcxTreeListStyleSheet + Caption = 'Slate' + Styles.Content = cxStyle193 + Styles.Inactive = cxStyle197 + Styles.Selection = cxStyle200 + Styles.BandBackground = cxStyle201 + Styles.BandHeader = cxStyle191 + Styles.ColumnHeader = cxStyle192 + Styles.ContentEven = cxStyle194 + Styles.ContentOdd = cxStyle195 + Styles.Footer = cxStyle196 + Styles.Indicator = cxStyle198 + Styles.Preview = cxStyle199 + BuiltIn = True + end + object TreeListStyleSheetSpruce: TcxTreeListStyleSheet + Caption = 'Spruce' + Styles.Content = cxStyle204 + Styles.Inactive = cxStyle208 + Styles.Selection = cxStyle211 + Styles.BandBackground = cxStyle212 + Styles.BandHeader = cxStyle202 + Styles.ColumnHeader = cxStyle203 + Styles.ContentEven = cxStyle205 + Styles.ContentOdd = cxStyle206 + Styles.Footer = cxStyle207 + Styles.Indicator = cxStyle209 + Styles.Preview = cxStyle210 + BuiltIn = True + end + object TreeListStyleSheetStormVGA: TcxTreeListStyleSheet + Caption = 'Storm (VGA)' + Styles.Content = cxStyle215 + Styles.Inactive = cxStyle219 + Styles.Selection = cxStyle222 + Styles.BandBackground = cxStyle223 + Styles.BandHeader = cxStyle213 + Styles.ColumnHeader = cxStyle214 + Styles.ContentEven = cxStyle216 + Styles.ContentOdd = cxStyle217 + Styles.Footer = cxStyle218 + Styles.Indicator = cxStyle220 + Styles.Preview = cxStyle221 + BuiltIn = True + end + object TreeListStyleSheetTealVGA: TcxTreeListStyleSheet + Caption = 'Teal (VGA)' + Styles.Content = cxStyle226 + Styles.Inactive = cxStyle230 + Styles.Selection = cxStyle233 + Styles.BandBackground = cxStyle234 + Styles.BandHeader = cxStyle224 + Styles.ColumnHeader = cxStyle225 + Styles.ContentEven = cxStyle227 + Styles.ContentOdd = cxStyle228 + Styles.Footer = cxStyle229 + Styles.Indicator = cxStyle231 + Styles.Preview = cxStyle232 + BuiltIn = True + end + object TreeListStyleSheetWheat: TcxTreeListStyleSheet + Caption = 'Wheat' + Styles.Content = cxStyle237 + Styles.Inactive = cxStyle241 + Styles.Selection = cxStyle244 + Styles.BandBackground = cxStyle245 + Styles.BandHeader = cxStyle235 + Styles.ColumnHeader = cxStyle236 + Styles.ContentEven = cxStyle238 + Styles.ContentOdd = cxStyle239 + Styles.Footer = cxStyle240 + Styles.Indicator = cxStyle242 + Styles.Preview = cxStyle243 + BuiltIn = True + end + object TreeListStyleSheetWindowsClassic: TcxTreeListStyleSheet + Caption = 'Windows Classic' + Styles.Content = cxStyle248 + Styles.Inactive = cxStyle252 + Styles.Selection = cxStyle255 + Styles.BandBackground = cxStyle256 + Styles.BandHeader = cxStyle246 + Styles.ColumnHeader = cxStyle247 + Styles.ContentEven = cxStyle249 + Styles.ContentOdd = cxStyle250 + Styles.Footer = cxStyle251 + Styles.Indicator = cxStyle253 + Styles.Preview = cxStyle254 + BuiltIn = True + end + object TreeListStyleSheetWindowsClassicLarge: TcxTreeListStyleSheet + Caption = 'Windows Classic (large)' + Styles.Content = cxStyle259 + Styles.Inactive = cxStyle263 + Styles.Selection = cxStyle266 + Styles.BandBackground = cxStyle267 + Styles.BandHeader = cxStyle257 + Styles.ColumnHeader = cxStyle258 + Styles.ContentEven = cxStyle260 + Styles.ContentOdd = cxStyle261 + Styles.Footer = cxStyle262 + Styles.Indicator = cxStyle264 + Styles.Preview = cxStyle265 + BuiltIn = True + end + object TreeListStyleSheetWindowsStandard: TcxTreeListStyleSheet + Caption = 'Windows Standard' + Styles.Content = cxStyle270 + Styles.Inactive = cxStyle274 + Styles.Selection = cxStyle277 + Styles.BandHeader = cxStyle268 + Styles.ColumnHeader = cxStyle269 + Styles.ContentEven = cxStyle271 + Styles.ContentOdd = cxStyle272 + Styles.Footer = cxStyle273 + Styles.Indicator = cxStyle275 + Styles.Preview = cxStyle276 + BuiltIn = True + end + object TreeListStyleSheetWindowsStandardLarge: TcxTreeListStyleSheet + Caption = 'Windows Standard (large)' + Styles.Content = cxStyle280 + Styles.Inactive = cxStyle284 + Styles.Selection = cxStyle287 + Styles.BandHeader = cxStyle278 + Styles.ColumnHeader = cxStyle279 + Styles.ContentEven = cxStyle281 + Styles.ContentOdd = cxStyle282 + Styles.Footer = cxStyle283 + Styles.Indicator = cxStyle285 + Styles.Preview = cxStyle286 + BuiltIn = True + end + object TreeListStyleSheetHighContrast1: TcxTreeListStyleSheet + Caption = 'High Contrast #1' + Styles.Content = cxStyle290 + Styles.Inactive = cxStyle294 + Styles.Selection = cxStyle297 + Styles.BandBackground = cxStyle298 + Styles.BandHeader = cxStyle288 + Styles.ColumnHeader = cxStyle289 + Styles.ContentEven = cxStyle291 + Styles.ContentOdd = cxStyle292 + Styles.Footer = cxStyle293 + Styles.Indicator = cxStyle295 + Styles.Preview = cxStyle296 + BuiltIn = True + end + object TreeListStyleSheetHighContrast1Large: TcxTreeListStyleSheet + Caption = 'High Contrast #1 (large)' + Styles.Content = cxStyle301 + Styles.Inactive = cxStyle305 + Styles.Selection = cxStyle308 + Styles.BandBackground = cxStyle309 + Styles.BandHeader = cxStyle299 + Styles.ColumnHeader = cxStyle300 + Styles.ContentEven = cxStyle302 + Styles.ContentOdd = cxStyle303 + Styles.Footer = cxStyle304 + Styles.Indicator = cxStyle306 + Styles.Preview = cxStyle307 + BuiltIn = True + end + object TreeListStyleSheetHighContrast2: TcxTreeListStyleSheet + Caption = 'High Contrast #2' + Styles.Content = cxStyle312 + Styles.Inactive = cxStyle316 + Styles.Selection = cxStyle319 + Styles.BandBackground = cxStyle320 + Styles.BandHeader = cxStyle310 + Styles.ColumnHeader = cxStyle311 + Styles.ContentEven = cxStyle313 + Styles.ContentOdd = cxStyle314 + Styles.Footer = cxStyle315 + Styles.Indicator = cxStyle317 + Styles.Preview = cxStyle318 + BuiltIn = True + end + object TreeListStyleSheetHighContrast2Large: TcxTreeListStyleSheet + Caption = 'High Contrast #2 (large)' + Styles.Content = cxStyle323 + Styles.Inactive = cxStyle327 + Styles.Selection = cxStyle330 + Styles.BandBackground = cxStyle331 + Styles.BandHeader = cxStyle321 + Styles.ColumnHeader = cxStyle322 + Styles.ContentEven = cxStyle324 + Styles.ContentOdd = cxStyle325 + Styles.Footer = cxStyle326 + Styles.Indicator = cxStyle328 + Styles.Preview = cxStyle329 + BuiltIn = True + end + object TreeListStyleSheetHighContrastBlack: TcxTreeListStyleSheet + Caption = 'High Contrast Black' + Styles.Content = cxStyle334 + Styles.Inactive = cxStyle338 + Styles.Selection = cxStyle341 + Styles.BandHeader = cxStyle332 + Styles.ColumnHeader = cxStyle333 + Styles.ContentEven = cxStyle335 + Styles.ContentOdd = cxStyle336 + Styles.Footer = cxStyle337 + Styles.Indicator = cxStyle339 + Styles.Preview = cxStyle340 + BuiltIn = True + end + object TreeListStyleSheetHighContrastBlackLarge: TcxTreeListStyleSheet + Caption = 'High Contrast Black (large)' + Styles.Content = cxStyle344 + Styles.Inactive = cxStyle348 + Styles.Selection = cxStyle351 + Styles.BandHeader = cxStyle342 + Styles.ColumnHeader = cxStyle343 + Styles.ContentEven = cxStyle345 + Styles.ContentOdd = cxStyle346 + Styles.Footer = cxStyle347 + Styles.Indicator = cxStyle349 + Styles.Preview = cxStyle350 + BuiltIn = True + end + object TreeListStyleSheetHighContrastWhite: TcxTreeListStyleSheet + Caption = 'High Contrast White' + Styles.Content = cxStyle354 + Styles.Inactive = cxStyle358 + Styles.Selection = cxStyle361 + Styles.BandHeader = cxStyle352 + Styles.ColumnHeader = cxStyle353 + Styles.ContentEven = cxStyle355 + Styles.ContentOdd = cxStyle356 + Styles.Footer = cxStyle357 + Styles.Indicator = cxStyle359 + Styles.Preview = cxStyle360 + BuiltIn = True + end + object TreeListStyleSheetHighContrastWhiteLarge: TcxTreeListStyleSheet + Caption = 'High Contrast White (large)' + Styles.Content = cxStyle364 + Styles.Inactive = cxStyle368 + Styles.Selection = cxStyle371 + Styles.BandHeader = cxStyle362 + Styles.ColumnHeader = cxStyle363 + Styles.ContentEven = cxStyle365 + Styles.ContentOdd = cxStyle366 + Styles.Footer = cxStyle367 + Styles.Indicator = cxStyle369 + Styles.Preview = cxStyle370 + BuiltIn = True + end + end +end diff --git a/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLPredefinedStyles.pas b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLPredefinedStyles.pas new file mode 100644 index 00000000..056757d4 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLPredefinedStyles.pas @@ -0,0 +1,505 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumTreeList } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMTREELIST AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxTLPredefinedStyles; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, cxStyles, cxClasses, cxTL, Forms; + +type + TcxdmTreeListPredefinedStyles = class(TDataModule) + StyleRepository: TcxStyleRepository; + cxStyle1: TcxStyle; + cxStyle2: TcxStyle; + cxStyle3: TcxStyle; + cxStyle4: TcxStyle; + cxStyle5: TcxStyle; + cxStyle6: TcxStyle; + cxStyle7: TcxStyle; + cxStyle8: TcxStyle; + cxStyle9: TcxStyle; + cxStyle10: TcxStyle; + cxStyle11: TcxStyle; + cxStyle12: TcxStyle; + cxStyle13: TcxStyle; + cxStyle14: TcxStyle; + cxStyle15: TcxStyle; + cxStyle16: TcxStyle; + cxStyle17: TcxStyle; + cxStyle18: TcxStyle; + cxStyle19: TcxStyle; + cxStyle20: TcxStyle; + cxStyle21: TcxStyle; + cxStyle22: TcxStyle; + cxStyle23: TcxStyle; + cxStyle24: TcxStyle; + cxStyle25: TcxStyle; + cxStyle26: TcxStyle; + cxStyle27: TcxStyle; + cxStyle28: TcxStyle; + cxStyle29: TcxStyle; + cxStyle30: TcxStyle; + cxStyle31: TcxStyle; + cxStyle32: TcxStyle; + cxStyle33: TcxStyle; + cxStyle34: TcxStyle; + cxStyle35: TcxStyle; + cxStyle36: TcxStyle; + cxStyle37: TcxStyle; + cxStyle38: TcxStyle; + cxStyle39: TcxStyle; + cxStyle40: TcxStyle; + cxStyle41: TcxStyle; + cxStyle42: TcxStyle; + cxStyle43: TcxStyle; + cxStyle44: TcxStyle; + cxStyle45: TcxStyle; + cxStyle46: TcxStyle; + cxStyle47: TcxStyle; + cxStyle48: TcxStyle; + cxStyle49: TcxStyle; + cxStyle50: TcxStyle; + cxStyle51: TcxStyle; + cxStyle52: TcxStyle; + cxStyle53: TcxStyle; + cxStyle54: TcxStyle; + cxStyle55: TcxStyle; + cxStyle56: TcxStyle; + cxStyle57: TcxStyle; + cxStyle58: TcxStyle; + cxStyle59: TcxStyle; + cxStyle60: TcxStyle; + cxStyle61: TcxStyle; + cxStyle62: TcxStyle; + cxStyle63: TcxStyle; + cxStyle64: TcxStyle; + cxStyle65: TcxStyle; + cxStyle66: TcxStyle; + cxStyle67: TcxStyle; + cxStyle68: TcxStyle; + cxStyle69: TcxStyle; + cxStyle70: TcxStyle; + cxStyle71: TcxStyle; + cxStyle72: TcxStyle; + cxStyle73: TcxStyle; + cxStyle74: TcxStyle; + cxStyle75: TcxStyle; + cxStyle76: TcxStyle; + cxStyle77: TcxStyle; + cxStyle78: TcxStyle; + cxStyle79: TcxStyle; + cxStyle80: TcxStyle; + cxStyle81: TcxStyle; + cxStyle82: TcxStyle; + cxStyle83: TcxStyle; + cxStyle84: TcxStyle; + cxStyle85: TcxStyle; + cxStyle86: TcxStyle; + cxStyle87: TcxStyle; + cxStyle88: TcxStyle; + cxStyle89: TcxStyle; + cxStyle90: TcxStyle; + cxStyle91: TcxStyle; + cxStyle92: TcxStyle; + cxStyle93: TcxStyle; + cxStyle94: TcxStyle; + cxStyle95: TcxStyle; + cxStyle96: TcxStyle; + cxStyle97: TcxStyle; + cxStyle98: TcxStyle; + cxStyle99: TcxStyle; + cxStyle100: TcxStyle; + cxStyle101: TcxStyle; + cxStyle102: TcxStyle; + cxStyle103: TcxStyle; + cxStyle104: TcxStyle; + cxStyle105: TcxStyle; + cxStyle106: TcxStyle; + cxStyle107: TcxStyle; + cxStyle108: TcxStyle; + cxStyle109: TcxStyle; + cxStyle110: TcxStyle; + cxStyle111: TcxStyle; + cxStyle112: TcxStyle; + cxStyle113: TcxStyle; + cxStyle114: TcxStyle; + cxStyle115: TcxStyle; + cxStyle116: TcxStyle; + cxStyle117: TcxStyle; + cxStyle118: TcxStyle; + cxStyle119: TcxStyle; + cxStyle120: TcxStyle; + cxStyle121: TcxStyle; + cxStyle122: TcxStyle; + cxStyle123: TcxStyle; + cxStyle124: TcxStyle; + cxStyle125: TcxStyle; + cxStyle126: TcxStyle; + cxStyle127: TcxStyle; + cxStyle128: TcxStyle; + cxStyle129: TcxStyle; + cxStyle130: TcxStyle; + cxStyle131: TcxStyle; + cxStyle132: TcxStyle; + cxStyle133: TcxStyle; + cxStyle134: TcxStyle; + cxStyle135: TcxStyle; + cxStyle136: TcxStyle; + cxStyle137: TcxStyle; + cxStyle138: TcxStyle; + cxStyle139: TcxStyle; + cxStyle140: TcxStyle; + cxStyle141: TcxStyle; + cxStyle142: TcxStyle; + cxStyle143: TcxStyle; + cxStyle144: TcxStyle; + cxStyle145: TcxStyle; + cxStyle146: TcxStyle; + cxStyle147: TcxStyle; + cxStyle148: TcxStyle; + cxStyle149: TcxStyle; + cxStyle150: TcxStyle; + cxStyle151: TcxStyle; + cxStyle152: TcxStyle; + cxStyle153: TcxStyle; + cxStyle154: TcxStyle; + cxStyle155: TcxStyle; + cxStyle156: TcxStyle; + cxStyle157: TcxStyle; + cxStyle158: TcxStyle; + cxStyle159: TcxStyle; + cxStyle160: TcxStyle; + cxStyle161: TcxStyle; + cxStyle162: TcxStyle; + cxStyle163: TcxStyle; + cxStyle164: TcxStyle; + cxStyle165: TcxStyle; + cxStyle166: TcxStyle; + cxStyle167: TcxStyle; + cxStyle168: TcxStyle; + cxStyle169: TcxStyle; + cxStyle170: TcxStyle; + cxStyle171: TcxStyle; + cxStyle172: TcxStyle; + cxStyle173: TcxStyle; + cxStyle174: TcxStyle; + cxStyle175: TcxStyle; + cxStyle176: TcxStyle; + cxStyle177: TcxStyle; + cxStyle178: TcxStyle; + cxStyle179: TcxStyle; + cxStyle180: TcxStyle; + cxStyle181: TcxStyle; + cxStyle182: TcxStyle; + cxStyle183: TcxStyle; + cxStyle184: TcxStyle; + cxStyle185: TcxStyle; + cxStyle186: TcxStyle; + cxStyle187: TcxStyle; + cxStyle188: TcxStyle; + cxStyle189: TcxStyle; + cxStyle190: TcxStyle; + cxStyle191: TcxStyle; + cxStyle192: TcxStyle; + cxStyle193: TcxStyle; + cxStyle194: TcxStyle; + cxStyle195: TcxStyle; + cxStyle196: TcxStyle; + cxStyle197: TcxStyle; + cxStyle198: TcxStyle; + cxStyle199: TcxStyle; + cxStyle200: TcxStyle; + cxStyle201: TcxStyle; + cxStyle202: TcxStyle; + cxStyle203: TcxStyle; + cxStyle204: TcxStyle; + cxStyle205: TcxStyle; + cxStyle206: TcxStyle; + cxStyle207: TcxStyle; + cxStyle208: TcxStyle; + cxStyle209: TcxStyle; + cxStyle210: TcxStyle; + cxStyle211: TcxStyle; + cxStyle212: TcxStyle; + cxStyle213: TcxStyle; + cxStyle214: TcxStyle; + cxStyle215: TcxStyle; + cxStyle216: TcxStyle; + cxStyle217: TcxStyle; + cxStyle218: TcxStyle; + cxStyle219: TcxStyle; + cxStyle220: TcxStyle; + cxStyle221: TcxStyle; + cxStyle222: TcxStyle; + cxStyle223: TcxStyle; + cxStyle224: TcxStyle; + cxStyle225: TcxStyle; + cxStyle226: TcxStyle; + cxStyle227: TcxStyle; + cxStyle228: TcxStyle; + cxStyle229: TcxStyle; + cxStyle230: TcxStyle; + cxStyle231: TcxStyle; + cxStyle232: TcxStyle; + cxStyle233: TcxStyle; + cxStyle234: TcxStyle; + cxStyle235: TcxStyle; + cxStyle236: TcxStyle; + cxStyle237: TcxStyle; + cxStyle238: TcxStyle; + cxStyle239: TcxStyle; + cxStyle240: TcxStyle; + cxStyle241: TcxStyle; + cxStyle242: TcxStyle; + cxStyle243: TcxStyle; + cxStyle244: TcxStyle; + cxStyle245: TcxStyle; + cxStyle246: TcxStyle; + cxStyle247: TcxStyle; + cxStyle248: TcxStyle; + cxStyle249: TcxStyle; + cxStyle250: TcxStyle; + cxStyle251: TcxStyle; + cxStyle252: TcxStyle; + cxStyle253: TcxStyle; + cxStyle254: TcxStyle; + cxStyle255: TcxStyle; + cxStyle256: TcxStyle; + cxStyle257: TcxStyle; + cxStyle258: TcxStyle; + cxStyle259: TcxStyle; + cxStyle260: TcxStyle; + cxStyle261: TcxStyle; + cxStyle262: TcxStyle; + cxStyle263: TcxStyle; + cxStyle264: TcxStyle; + cxStyle265: TcxStyle; + cxStyle266: TcxStyle; + cxStyle267: TcxStyle; + cxStyle268: TcxStyle; + cxStyle269: TcxStyle; + cxStyle270: TcxStyle; + cxStyle271: TcxStyle; + cxStyle272: TcxStyle; + cxStyle273: TcxStyle; + cxStyle274: TcxStyle; + cxStyle275: TcxStyle; + cxStyle276: TcxStyle; + cxStyle277: TcxStyle; + cxStyle278: TcxStyle; + cxStyle279: TcxStyle; + cxStyle280: TcxStyle; + cxStyle281: TcxStyle; + cxStyle282: TcxStyle; + cxStyle283: TcxStyle; + cxStyle284: TcxStyle; + cxStyle285: TcxStyle; + cxStyle286: TcxStyle; + cxStyle287: TcxStyle; + cxStyle288: TcxStyle; + cxStyle289: TcxStyle; + cxStyle290: TcxStyle; + cxStyle291: TcxStyle; + cxStyle292: TcxStyle; + cxStyle293: TcxStyle; + cxStyle294: TcxStyle; + cxStyle295: TcxStyle; + cxStyle296: TcxStyle; + cxStyle297: TcxStyle; + cxStyle298: TcxStyle; + cxStyle299: TcxStyle; + cxStyle300: TcxStyle; + cxStyle301: TcxStyle; + cxStyle302: TcxStyle; + cxStyle303: TcxStyle; + cxStyle304: TcxStyle; + cxStyle305: TcxStyle; + cxStyle306: TcxStyle; + cxStyle307: TcxStyle; + cxStyle308: TcxStyle; + cxStyle309: TcxStyle; + cxStyle310: TcxStyle; + cxStyle311: TcxStyle; + cxStyle312: TcxStyle; + cxStyle313: TcxStyle; + cxStyle314: TcxStyle; + cxStyle315: TcxStyle; + cxStyle316: TcxStyle; + cxStyle317: TcxStyle; + cxStyle318: TcxStyle; + cxStyle319: TcxStyle; + cxStyle320: TcxStyle; + cxStyle321: TcxStyle; + cxStyle322: TcxStyle; + cxStyle323: TcxStyle; + cxStyle324: TcxStyle; + cxStyle325: TcxStyle; + cxStyle326: TcxStyle; + cxStyle327: TcxStyle; + cxStyle328: TcxStyle; + cxStyle329: TcxStyle; + cxStyle330: TcxStyle; + cxStyle331: TcxStyle; + cxStyle332: TcxStyle; + cxStyle333: TcxStyle; + cxStyle334: TcxStyle; + cxStyle335: TcxStyle; + cxStyle336: TcxStyle; + cxStyle337: TcxStyle; + cxStyle338: TcxStyle; + cxStyle339: TcxStyle; + cxStyle340: TcxStyle; + cxStyle341: TcxStyle; + cxStyle342: TcxStyle; + cxStyle343: TcxStyle; + cxStyle344: TcxStyle; + cxStyle345: TcxStyle; + cxStyle346: TcxStyle; + cxStyle347: TcxStyle; + cxStyle348: TcxStyle; + cxStyle349: TcxStyle; + cxStyle350: TcxStyle; + cxStyle351: TcxStyle; + cxStyle352: TcxStyle; + cxStyle353: TcxStyle; + cxStyle354: TcxStyle; + cxStyle355: TcxStyle; + cxStyle356: TcxStyle; + cxStyle357: TcxStyle; + cxStyle358: TcxStyle; + cxStyle359: TcxStyle; + cxStyle360: TcxStyle; + cxStyle361: TcxStyle; + cxStyle362: TcxStyle; + cxStyle363: TcxStyle; + cxStyle364: TcxStyle; + cxStyle365: TcxStyle; + cxStyle366: TcxStyle; + cxStyle367: TcxStyle; + cxStyle368: TcxStyle; + cxStyle369: TcxStyle; + cxStyle370: TcxStyle; + cxStyle371: TcxStyle; + TreeListStyleSheetDevExpress: TcxTreeListStyleSheet; + TreeListStyleSheetUserFormat1: TcxTreeListStyleSheet; + TreeListStyleSheetUserFormat2: TcxTreeListStyleSheet; + TreeListStyleSheetUserFormat3: TcxTreeListStyleSheet; + TreeListStyleSheetUserFormat4: TcxTreeListStyleSheet; + TreeListStyleSheetBrick: TcxTreeListStyleSheet; + TreeListStyleSheetDesert: TcxTreeListStyleSheet; + TreeListStyleSheetEggplant: TcxTreeListStyleSheet; + TreeListStyleSheetLilac: TcxTreeListStyleSheet; + TreeListStyleSheetMaple: TcxTreeListStyleSheet; + TreeListStyleSheetMarineHighColor: TcxTreeListStyleSheet; + TreeListStyleSheetPlumHighColor: TcxTreeListStyleSheet; + TreeListStyleSheetPumpkinLarge: TcxTreeListStyleSheet; + TreeListStyleSheetRainyDay: TcxTreeListStyleSheet; + TreeListStyleSheetRedWhiteBlueVGA: TcxTreeListStyleSheet; + TreeListStyleSheetRose: TcxTreeListStyleSheet; + TreeListStyleSheetRoseLarge: TcxTreeListStyleSheet; + TreeListStyleSheetSlate: TcxTreeListStyleSheet; + TreeListStyleSheetSpruce: TcxTreeListStyleSheet; + TreeListStyleSheetStormVGA: TcxTreeListStyleSheet; + TreeListStyleSheetTealVGA: TcxTreeListStyleSheet; + TreeListStyleSheetWheat: TcxTreeListStyleSheet; + TreeListStyleSheetWindowsClassic: TcxTreeListStyleSheet; + TreeListStyleSheetWindowsClassicLarge: TcxTreeListStyleSheet; + TreeListStyleSheetWindowsStandard: TcxTreeListStyleSheet; + TreeListStyleSheetWindowsStandardLarge: TcxTreeListStyleSheet; + TreeListStyleSheetHighContrast1: TcxTreeListStyleSheet; + TreeListStyleSheetHighContrast1Large: TcxTreeListStyleSheet; + TreeListStyleSheetHighContrast2: TcxTreeListStyleSheet; + TreeListStyleSheetHighContrast2Large: TcxTreeListStyleSheet; + TreeListStyleSheetHighContrastBlack: TcxTreeListStyleSheet; + TreeListStyleSheetHighContrastBlackLarge: TcxTreeListStyleSheet; + TreeListStyleSheetHighContrastWhite: TcxTreeListStyleSheet; + TreeListStyleSheetHighContrastWhiteLarge: TcxTreeListStyleSheet; + public + { Public declarations } + end; + +implementation + +{$R *.dfm} + +uses + cxStyleSheetsLoad, Dialogs; + +type + TcxTreeListPredefinedStyleSheets = class(TcxPredefinedStyleSheets) + private + FData: TcxdmTreeListPredefinedStyles; + protected + procedure AddStyleSheets; override; + public + constructor Create; override; + destructor Destroy; override; + end; + +{ TcxTreeListPredefinedStyleSheets } + +constructor TcxTreeListPredefinedStyleSheets.Create; +begin + inherited Create; + FData := TcxdmTreeListPredefinedStyles.Create(nil); + AddStyleSheets; +end; + +destructor TcxTreeListPredefinedStyleSheets.Destroy; +begin + FData.Free; + inherited Destroy; +end; + +procedure TcxTreeListPredefinedStyleSheets.AddStyleSheets; +var + I: Integer; +begin + with FData.StyleRepository do + for I := 0 to StyleSheetCount - 1 do + AddStyleSheet(StyleSheets[I]); +end; + +initialization + RegisterPredefinedStyleSheets(TcxTreeListPredefinedStyleSheets); + +finalization + UnregisterPredefinedStyleSheets(TcxTreeListPredefinedStyleSheets); + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLReg.dcr b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLReg.dcr new file mode 100644 index 00000000..cdc31291 Binary files /dev/null and b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLReg.dcr differ diff --git a/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLReg.pas b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLReg.pas new file mode 100644 index 00000000..8a8f054a --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLReg.pas @@ -0,0 +1,443 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumTreeList } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMTREELIST AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxTLReg; + +{$I cxVer.inc} + +interface +uses + Classes, SysUtils, TypInfo, +{$IFDEF DELPHI6} + Types, DesignIntf, DesignEditors, VCLEditors, +{$ELSE} + DsgnWnds, DsgnIntf, +{$ENDIF} +{$IFNDEF DELPHI5} + cxInplaceContainer, +{$ENDIF} + cxImportDialog, cxTLConverter, cxdxTLConverter, + Forms, DB, cxDesignWindows, cxPropEditors, cxClasses, cxControls, cxLibraryReg, + cxEditPropEditors, cxEdit, cxStyles, + cxTL, cxTLData, cxDBTL, cxTLStrs, cxTLIntf, cxTLDsgnEdtrs, + cxTLItemsEdtr, cxTLPredefinedStyles, cxTLStyleSheetPreview; + +procedure Register; + +implementation +type + TcxTreeListAccess = class(TcxCustomTreeListControl); + TcxDBTreeListAccess = class(TcxCustomDBTreeList); + + TcxColumnAccess = class(TcxTreeListColumn); + + { TcxTreeListComponentEditor } + + TcxTreeListComponentEditor = class(TcxComponentEditor) + protected + FItems: TStringList; + procedure ItemsNeeded; virtual; + protected + function GetProductMajorVersion: string; override; + function GetProductName: string; override; + function InternalGetVerb(AIndex: Integer): string; override; + function InternalGetVerbCount: Integer; override; + procedure InternalExecuteVerb(AIndex: Integer); override; + public + destructor Destroy; override; + end; + + { TcxstStylesEventsProperty } + + TcxTreeListStylesEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + + { TcxDBTreeListFieldNameProperty } + + TcxDBTreeListFieldNameProperty = class(TFieldNameProperty) + protected + function GetTreeList: TcxDBTreeListAccess; + public + function GetDataSource: TDataSource; override; + end; + + { TcxTreeListColumnProperty } + + TcxTreeListColumnProperty = class(TComponentProperty) + protected + function GetTreeList: TcxTreeListAccess; + public + procedure GetValues(Proc: TGetStrProc); override; + end; + +const + UnitNamePrefix = '' ; + ImportStr = 'Import...'; + ComponentDescription = 'ExpressQuantumTreeList'; + InternetAddress = 'www.devexpress.com'; + +procedure ShowItemsDesigner(AEditor: TcxTreeListComponentEditor; ASheetIndex: Integer); +var + ADesigner: TcxTreeListBandColumnDesigner; +begin + ADesigner := TcxTreeListBandColumnDesigner(ShowFormEditorClass(AEditor.Designer, + AEditor.Component, TcxTreeListBandColumnDesigner)); + ADesigner.SetVisibleSheetIndex(ASheetIndex); +end; + +function cxDoGetTreeList(ASubClass: TObject): TObject; +var + AIntf: IcxTreeListSubClass; +begin + if Supports(ASubClass, IcxTreeListSubClass, AIntf) then + Result := AIntf.GetControl + else + raise EAbort.Create(''); +end; + +{ TcxTreeListComponentEditor } + +destructor TcxTreeListComponentEditor.Destroy; +begin + FreeAndNil(FItems); + inherited Destroy; +end; + +procedure TcxTreeListComponentEditor.ItemsNeeded; +var + AIntf: IcxTreeListDesignTimeOperations; +begin + if FItems = nil then + FItems := TStringList.Create() + else + FItems.Clear; + if Supports(Component, IcxTreeListDesignTimeOperations, AIntf) then + begin + if AIntf.SupportsBandColumnEditor then + begin + FItems.Add(scxStr(@scxColumns)); + FItems.Add(scxStr(@scxBands)); + end; + if AIntf.SupportsItemsEditor then + FItems.Add(scxStr(@scxItems)) + else + if AIntf.SupportsCreateAllItems then + begin + FItems.Add(scxStr(@scxCreateAllItems)); + FItems.Add(scxStr(@scxDeleteAllItems)); + end; + FItems.Add(ImportStr); + end; +end; + +function TcxTreeListComponentEditor.GetProductMajorVersion: string; +begin + Result := cxTLMajorVersion; +end; + +function TcxTreeListComponentEditor.GetProductName: string; +begin + Result := ComponentDescription; +end; + +function TcxTreeListComponentEditor.InternalGetVerb(AIndex: Integer): string; +begin + Result := FItems[AIndex] +end; + +function TcxTreeListComponentEditor.InternalGetVerbCount: Integer; +begin + ItemsNeeded; + Result := FItems.Count; +end; + +procedure TcxTreeListComponentEditor.InternalExecuteVerb(AIndex: Integer); +var + AIntf: IcxTreeListDesignTimeOperations; +const + Invert: array[Boolean] of Byte = (1, 0); +begin + if FItems.IndexOf(ImportStr) = AIndex then + begin + if Component is TcxDBTreeList then + ShowImportDialog(Designer, Component, cxDBTLGroupConverterName) + else if Component is TcxTreeList then + ShowImportDialog(Designer, Component, cxTLGroupConverterName); + Exit; + end; + if Supports(Component, IcxTreeListDesignTimeOperations, AIntf) then + begin + if Component is TcxCustomTreeListControl then + begin + if AIndex in [0..1] then + begin + if AIntf.SupportsBandColumnEditor then + ShowItemsDesigner(Self, Invert[AIndex = 1]); + end + else + if AIntf.SupportsItemsEditor and (AIndex = 2) then + cxShowTreeListItemsEditor(TcxTreeList(Component)) + else + if AIntf.SupportsCreateAllItems then + begin + if AIndex = 2 then + begin + AIntf.CreateAllItems; + SetColumnsUniqueName(TcxCustomTreeListControl(Component)); + end + else + AIntf.DeleteAllColumns; + Designer.Modified; + end; + end; + end; +end; + +{ TcxTreeListStylesEventsProperty } + +function TcxTreeListStylesEventsProperty.GetInstance: TPersistent; +begin + Result := TcxCustomTreeListControl(GetComponent(0)).Styles; +end; + + { TcxDBTreeListFieldNameProperty } + +function TcxDBTreeListFieldNameProperty.GetDataSource: TDataSource; +begin + Result := GetTreeList.DataController.DataSource; +end; + +function TcxDBTreeListFieldNameProperty.GetTreeList: TcxDBTreeListAccess; +begin + Result := TcxDBTreeListAccess(cxDoGetTreeList(GetComponent(0))); +end; + +{ TcxTreeListColumnProperty } + +function TcxTreeListColumnProperty.GetTreeList: TcxTreeListAccess; +begin + Result := TcxTreeListAccess(cxDoGetTreeList(GetComponent(0))) +end; + +procedure TcxTreeListColumnProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + with GetTreeList do + begin + for I := 0 to ColumnCount - 1 do + Proc(Columns[I].Name) + end; +end; + +{$IFDEF DELPHI6} + +type + TcxTreeListSelectionEditor = class(TSelectionEditor) + protected + ComponentsList: TStringList; + public + procedure AddComponent(const Name: string); + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + +procedure TcxTreeListSelectionEditor.AddComponent(const Name: string); +begin + ComponentsList.Add(Name); +end; + +procedure TcxTreeListSelectionEditor.RequiresUnits(Proc: TGetStrProc); + + procedure AddColumnUnitName(AProperties: TcxCustomEditProperties); + begin + if AProperties <> nil then + Proc(UnitNamePrefix + GetTypeData(PTypeinfo(AProperties.ClassType.ClassInfo))^.UnitName); + end; + +var + AComponent: TComponent; + I: Integer; +begin + inherited RequiresUnits(Proc); + Proc(UnitNamePrefix + 'cxGraphics'); + Proc(UnitNamePrefix + 'cxCustomData'); + Proc(UnitNamePrefix + 'cxStyles'); + Proc(UnitNamePrefix + 'cxTL'); + ComponentsList := TStringList.Create; + try + Designer.GetComponentNames(GetTypeData(PTypeInfo(TcxTreeListColumn.ClassInfo)), AddComponent); + for I := 0 to ComponentsList.Count - 1 do + begin + AComponent := Designer.GetComponent(ComponentsList[I]); + if AComponent is TcxTreeListColumn then + begin + AddColumnUnitName(TcxTreeListColumn(AComponent).Properties); + AddColumnUnitName(TcxColumnAccess(AComponent).PropertiesValue); + end; + end; + finally + ComponentsList.Free; + end; +end; + +{$ENDIF} + +type + TcxDesignSelectionListener = class(TcxIUnknownObject{$IFDEF DELPHI6}, IDesignNotification{$ENDIF}) + protected + Listeners: TList; + // IDesignNotification + procedure ItemDeleted(const ADesigner: IDesigner; AItem: TPersistent); + procedure ItemInserted(const ADesigner: IDesigner; AItem: TPersistent); + procedure ItemsModified(const ADesigner: IDesigner); + procedure SelectionChanged(const ADesigner: IDesigner; const ASelection: IDesignerSelections); + procedure DesignerOpened(const ADesigner: IDesigner; AResurrecting: Boolean); + procedure DesignerClosed(const ADesigner: IDesigner; AGoingDormant: Boolean); + public + constructor Create; virtual; + destructor Destroy; override; + procedure AddListener(AListener: TObject; AddListener: Boolean); + end; + +constructor TcxDesignSelectionListener.Create; +begin + Listeners := TList.Create; +{$IFDEF DELPHI6} + RegisterDesignNotification(Self); +{$ENDIF} + DesignerNavigatorProc := AddListener; +end; + +destructor TcxDesignSelectionListener.Destroy; +begin + DesignerNavigatorProc := nil; + Listeners.Clear; +{$IFDEF DELPHI6} + UnRegisterDesignNotification(Self); +{$ENDIF} + FreeAndNil(Listeners); + inherited Destroy; +end; + +procedure TcxDesignSelectionListener.AddListener( + AListener: TObject; AddListener: Boolean); +begin + Listeners.Remove(AListener); + if AddListener then + Listeners.Add(AListener); +end; + +procedure TcxDesignSelectionListener.ItemDeleted( + const ADesigner: IDesigner; AItem: TPersistent); +begin +end; + +procedure TcxDesignSelectionListener.ItemInserted( + const ADesigner: IDesigner; AItem: TPersistent); +begin +end; + +procedure TcxDesignSelectionListener.ItemsModified( + const ADesigner: IDesigner); +begin +end; + +procedure TcxDesignSelectionListener.SelectionChanged( + const ADesigner: IDesigner; const ASelection: IDesignerSelections); +var + I: Integer; +begin + for I := 0 to Listeners.Count - 1 do + TcxCustomTreeListControl(Listeners[I]).Invalidate; +end; + +procedure TcxDesignSelectionListener.DesignerOpened( + const ADesigner: IDesigner; AResurrecting: Boolean); +begin +end; + +procedure TcxDesignSelectionListener.DesignerClosed( + const ADesigner: IDesigner; AGoingDormant: Boolean); +begin +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterComponents('Dev Express', [TcxTreeList, TcxDBTreeList, TcxVirtualTreeList]); + RegisterClasses([TcxTreeListColumn, TcxDBTreeListColumn, TcxTreeListBands, TcxTreeListBand, TcxTreeListStyleSheet]); + RegisterNoIcon([TcxTreeListColumn, TcxDBTreeListColumn, TcxTreeListStyleSheet]); + RegisterComponentEditor(TcxCustomTreeListControl, TcxTreeListComponentEditor); + RegisterPropertyEditor(TypeInfo(TcxTreeListColumn), TcxTreeListPreview, + 'Column', TcxTreeListColumnProperty); + RegisterPropertyEditor(TypeInfo(TcxTreeListColumn), TcxTreeListOptionsView, + 'CategorizedColumn', TcxTreeListColumnProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomTreeListControl, + 'StylesEvents', TcxTreeListStylesEventsProperty); + + RegisterPropertyEditor(TypeInfo(string), TcxDBItemDataBinding, + 'FieldName', TcxDBTreeListFieldNameProperty); + RegisterPropertyEditor(TypeInfo(string), TcxDBTreeListColumnSummaryFooter, + 'FieldName', TcxDBTreeListFieldNameProperty); + RegisterPropertyEditor(TypeInfo(string), TcxDBTreeListDataController, + 'KeyField', TcxDBTreeListFieldNameProperty); + RegisterPropertyEditor(TypeInfo(string), TcxDBTreeListDataController, + 'ParentField', TcxDBTreeListFieldNameProperty); + RegisterPropertyEditor(TypeInfo(string), TcxDBTreeListDataController, + 'ImageIndexFieldName', TcxDBTreeListFieldNameProperty); + RegisterPropertyEditor(TypeInfo(string), TcxDBTreeListDataController, + 'StateIndexFieldName', TcxDBTreeListFieldNameProperty); +{$IFDEF DELPHI6} + RegisterSelectionEditor(TcxCustomTreeListControl, TcxTreeListSelectionEditor); +{$ENDIF} +end; + +var + DesignSelectionListener: TcxDesignSelectionListener; + +initialization + DesignSelectionListener := TcxDesignSelectionListener.Create; + RegisterStyleSheetClass(TcxTreeListStyleSheet); + +finalization + UnRegisterStyleSheetClass(TcxTreeListStyleSheet); + DesignSelectionListener.Free; + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLStrs.pas b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLStrs.pas new file mode 100644 index 00000000..9bb84073 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLStrs.pas @@ -0,0 +1,84 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumTreeList } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMTREELIST AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxTLStrs; + +{$I cxVer.inc} + +interface +uses + cxClasses; + +resourcestring + scxIndexOutOfBounds = 'Index %d out of bounds'; + scxInvalidStreamFormat = 'Invalid stream format'; + scxMultiSelectRequired = 'Multi select required'; + + // designers constants + + scxDesignerCaption = 'TreeListDesigner editing - '; + scxBands = 'Bands...'; + scxColumns = 'Columns...'; + scxCreateAllItems = 'Create all columns'; + scxDeleteAllItems = 'Delete all columns'; + scxItems = 'Items editor...'; + + // customizing box + + scxCustomizeCaption = 'Customize'; + scxColumnsCaption = ' Columns '; + scxBandsCaption = ' Bands '; + + scxInvalidIntegerValue = 'Invalid integer value'; + scxOperationNotSupported = 'Operation is not supported'; + + scxTreeListDeletingFocusedConfirmationText = 'Delete record(s)?'; + scxTreeListDeletingConfirmationCaption = 'Confirm'; + + scxExportNotVisibleControl = 'Control must be visible for export'; + + function scxStr(AResString: Pointer): string; + +implementation + +function scxStr(AResString: Pointer): string; +begin + Result := cxGetResourceString(AResString); +end; + +initialization + scxStr(@scxBands) + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLStyleSheetPreview.pas b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLStyleSheetPreview.pas new file mode 100644 index 00000000..f01a3090 --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Sources/cxTLStyleSheetPreview.pas @@ -0,0 +1,188 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressQuantumTreeList } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMTREELIST AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxTLStyleSheetPreview; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, + Classes, Controls, SysUtils, cxStyles, cxTL, cxCustomData; + +resourcestring + cxTextDescription = 'ABC'; + cxPreviewDescription = 'Check the preview style'; + +implementation + +uses + cxStyleSheetEditor, cxClasses; + +type + TcxTreeListStyleSheetEditorPreview = class(TcxStyleSheetEditorPreview) + private + FTreeList: TcxTreeList; + protected + procedure CreateData; + procedure CreateColumns; + procedure CreateNodes; + procedure SetOptions; + property TreeList: TcxTreeList read FTreeList; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function Control: TWinControl; override; + class function GetStyleSheetClass: TcxCustomStyleSheetClass; override; + procedure SetStyleSheet(AStyleSheet: TcxCustomStyleSheet); override; + end; + +{ TcxTreeListStyleSheetEditorPreview } + +constructor TcxTreeListStyleSheetEditorPreview.Create(AOwner: TComponent); +begin + FTreeList := TcxTreeList.Create(AOwner); + CreateData; +end; + +destructor TcxTreeListStyleSheetEditorPreview.Destroy; +begin + FTreeList.Free; + inherited Destroy; +end; + +function TcxTreeListStyleSheetEditorPreview.Control: TWinControl; +begin + Result := FTreeList; +end; + +class function TcxTreeListStyleSheetEditorPreview.GetStyleSheetClass: TcxCustomStyleSheetClass; +begin + Result := TcxTreeListStyleSheet; +end; + +procedure TcxTreeListStyleSheetEditorPreview.SetStyleSheet( + AStyleSheet: TcxCustomStyleSheet); +begin + TreeList.Styles.StyleSheet := AStyleSheet; +end; + +procedure TcxTreeListStyleSheetEditorPreview.CreateData; +begin + TreeList.BeginUpdate; + try + CreateColumns; + TreeList.Bands[0].Caption.Text := 'Band 0'; + TreeList.Bands[0].Caption.AlignHorz := taCenter; + CreateNodes; + SetOptions; + finally + TreeList.EndUpdate; + end; +end; + +procedure TcxTreeListStyleSheetEditorPreview.CreateColumns; +var + I: Integer; + AColumn: TcxTreeListColumn; +const + AColumnDataType: array[0..3] of string = + ('String', 'Currency', 'Date', 'String'); +begin + for I := 0 to High(AColumnDataType) do + begin + AColumn := TreeList.CreateColumn(); + with AColumn do + begin + Caption.Text := AColumnDataType[I]; + Caption.AlignHorz := taCenter; + Caption.AlignVert := vaCenter; + DataBinding.ValueType := AColumnDataType[I]; + Options.Footer := True; + end; + end; + TreeList.Columns[1].SummaryFooter.Kind := skSum; + TreeList.Preview.Column := AColumn; +end; + +procedure TcxTreeListStyleSheetEditorPreview.CreateNodes; +var + I: Integer; + ANode: TcxTreeListNode; +begin + ANode := nil; + for I := 0 to 10 do + begin + if ((I mod 2) = 0) or ((I mod 3) = 0) then + ANode := TreeList.AddChild(ANode) + else + ANode := TreeList.Add(nil); + ANode.Values[0] := cxTextDescription; + ANode.Values[1] := (I + 1) * 100; + ANode.Values[2] := Date - I; + ANode.Values[3] := cxPreviewDescription; + end; + TreeList.FullExpand; +end; + +procedure TcxTreeListStyleSheetEditorPreview.SetOptions; +begin + with TreeList.OptionsView do + begin + Bands := True; + Indicator := True; + Headers := True; + Footer := True; + ColumnAutoWidth := True; + end; + with TreeList.OptionsData do + begin + Deleting := False; + Editing := False; + Inserting := False; + end; + TreeList.OptionsBehavior.IncSearch := True; + TreeList.Preview.AutoHeight := False; + TreeList.Preview.Visible := True; +end; + +initialization + RegisterStyleSheetEditorPreview(TcxTreeListStyleSheetEditorPreview); + +finalization + UnregisterStyleSheetEditorPreview(TcxTreeListStyleSheetEditorPreview); + +end. diff --git a/official/x.35/ExpressQuantumTreeList 4/Sources/cxVer.inc b/official/x.35/ExpressQuantumTreeList 4/Sources/cxVer.inc new file mode 100644 index 00000000..a26364cc --- /dev/null +++ b/official/x.35/ExpressQuantumTreeList 4/Sources/cxVer.inc @@ -0,0 +1,172 @@ +{$B-} { Complete Boolean Evaluation } +{$R-} { Range-Checking } +{$T-} { Typed @ operator } +{$X+} { Extended syntax } +{$P+} { Open string params } +{$J+} { Writeable structured consts } +{$H+} { Use long strings by default } +{$Q-} { Overflow checking } + +{$DEFINE DXVER500} + +{$IFNDEF CLR} + {$DEFINE OLEDRAGANDDROP} + {$IFNDEF DONTUSEJPEGIMAGE} + {$DEFINE USEJPEGIMAGE} + {$ENDIF} +{$ENDIF} + +{$DEFINE EXPRESSBARS5} + +{$DEFINE VCL} + +{$IFNDEF VER80} + {$IFNDEF VER90} + {$IFNDEF VER93} + {$DEFINE DELPHI3} { Borland Delphi 3.0 } + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER110} { Borland C++Builder 3.0 } + {$DEFINE CBUILDER3} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE DELPHI4} +{$ENDIF} + +{$IFDEF VER125} { Borland C++Builder 4.0 } + {$DEFINE CBUILDER3} + {$DEFINE DELPHI4} + {$DEFINE CBUILDER4} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$IFDEF BCB} { Borland C++Builder 5.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$IFDEF BCB} { Borland C++Builder 6.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} +{$ENDIF} + +{$IFNDEF DELPHI6} + {$DEFINE MSWINDOWS} +{$ENDIF} +{$IFDEF LINUX} + {$UNDEF MSWINDOWS} +{$ENDIF} + +{$IFDEF LINUX} + {$DEFINE KYLIX1} { Borland Kylix 1 } + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF CompilerVersion >= 14} + {$DEFINE KYLIX2} { Borland Kylix 2 } + {$IFEND} + {$IF CompilerVersion >= 14.50} + {$DEFINE KYLIX3} { Borland Kylix 3 } + {$IFEND} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} { Borland Delphi.Net } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} +{$ENDIF} + +{$IFDEF VER170} { Borland Delphi 9.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} +{$ENDIF} + +{$IFDEF VER180} { Borland Delphi 10 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$IFDEF BCB} { Borland C++Builder 10 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Borland Delphi 11 //CodeGear} + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$DEFINE DELPHI11} + {$IFDEF BCB} { Borland C++Builder 11 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$DEFINE CBUILDER11} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFNDEF CLR} + {$IFNDEF BCB} + {$IFDEF DELPHI6} + {$DEFINE REGISTERSHELLCTRLS} + {$ENDIF} + {$ENDIF} + {$IFDEF DELPHI7} + {$WARN UNSAFE_CAST OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_TYPE OFF} + {$ENDIF} +{$ENDIF} + +{$IFDEF REGISTERSHELLCTRLS} + {$DEFINE REGISTERCXSHELLCTRLS} +{$ENDIF} + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} diff --git a/official/x.35/ExpressScheduler 3/EULA.txt b/official/x.35/ExpressScheduler 3/EULA.txt new file mode 100644 index 00000000..a8bd5685 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/EULA.txt @@ -0,0 +1,119 @@ +DEVELOPER EXPRESS INC +ExpressScheduler 3(tm) COMPONENT SUITE +Copyright (C) 2003-2008 Developer Express Inc. + +END-USER LICENSE AGREEMENT +FOR ALL SOFTWARE COMPONENT PRODUCT(S) + +IMPORTANT- READ CAREFULLY: This DEVELOPER EXPRESS INC ("DEVEXPRESS") End-User License Agreement ("EULA") is a legal agreement between you, a developer of software applications, ("Developer End User") and DEVEXPRESS for all DEVEXPRESS products, controls, source code, demos, intermediate files, media, printed materials, and "online" or electronic documentation ("SOFTWARE COMPONENT PRODUCT(S)") contained in this installation file. + +DEVEXPRESS grants to you as an individual, a personal, nonexclusive license to install and use the SOFTWARE COMPONENT PRODUCT(S) for the sole purposes of designing, developing, testing, and deploying application programs which you create. By installing, copying, or otherwise using the SOFTWARE COMPONENT PRODUCT(S), you agree to be bound by the terms of this EULA. If you do not agree to any part of the terms of this EULA, DO NOT INSTALL, USE, EVALUATE, OR REPLICATE IN ANY MANNER, ANY PART, FILE OR PORTION OF THE SOFTWARE COMPONENT PRODUCT(S). + +All SOFTWARE COMPONENT PRODUCT(S) is licensed, not sold. If you are an individual, you must acquire an individual license for the SOFTWARE COMPONENT PRODUCT(S) from DEVEXPRESS or its authorized resellers. If you are an entity, you must acquire and assign an individual license for each Developer End User within your organization using and or developing with the SOFTWARE COMPONENT PRODUCT(S) from DEVEXPRESS or its authorized resellers. + +If the SOFTWARE COMPONENT PRODUCT(S) you have obtained is marked as a "TRIAL" or "EVALUATION," you may install one copy of the SOFTWARE COMPONENT PRODUCT(S) for testing purposes for a period of 30 calendar days from the date of installation ("Evaluation Period"). Upon expiration of the Evaluation Period, the SOFTWARE COMPONENT PRODUCT(S) must be uninstalled and all copies destroyed. + +RIGOROUS ENFORCEMENT OF INTELLECTUAL PROPERTY RIGHTS. If the licensed right of use for this SOFTWARE COMPONENT PRODUCT(S) is purchased by you with any intent to reverse engineer, decompile, create derivative works, and the exploitation or unauthorized transfer of, any DEVEXPRESS intellectual property and trade secrets, to include any exposed methods or source code where provided, no licensed right of use shall exist, and any PRODUCT(s) created as a result shall be judged illegal by definition of all applicable law. Any sale or resale of intellectual property or created derivatives so obtained will be prosecuted to the fullest extent of all local, federal and international law. + +1. GRANT OF LICENSE. + +This EULA, if legally executed as defined herein, licenses and so grants the single individual Developer End User the following rights: + +SOFTWARE COMPONENT PRODUCT(S) - Developer End User may install and use the SOFTWARE COMPONENT PRODUCT(S) on a single computer. Developer End User may also install and use the SOFTWARE COMPONENT PRODUCT(S) on a portable computer. + +2. LIMITATIONS ON REVERSE ENGINEERING, DECOMPILATION, AND DISASSEMBLY. + +You may not reverse engineer, decompile, create derivative works, translate, or disassemble the SOFTWARE COMPONENT PRODUCT(S), and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation. You agree to take all reasonable, legal and appropriate measures to prohibit the illegal dissemination of the SOFTWARE COMPONENT PRODUCT(S) or any of its constituent parts and redistributables to the fullest extent of all applicable local, US Codes and International Laws and Treaties regarding anti-circumvention, including but not limited to, the Geneva and Berne World Intellectual Property Organization (WIPO) Diplomatic Conferences. + +3. SEPARATION OF COMPONENTS. + +The SOFTWARE COMPONENT PRODUCT(S) is licensed as a single PRODUCT(s). The SOFTWARE COMPONENT PRODUCT(S) and its constituent parts and any provided redistributables may not be reverse engineered, decompiled, disassembled or separated for use on more than one computer, nor placed for distribution, sale, or resale as individual creations by Developer End User. The provision of source code, if included with the SOFTWARE COMPONENT PRODUCT(S), does not constitute transfer of any legal rights to such code, and resale or distribution of all or any portion of all source code and intellectual property will be prosecuted to the fullest extent of all applicable local, federal and international laws. All DEVEXPRESS libraries, source code, redistributables and other files remain DEVEXPRESS's exclusive property. You may not distribute any files, except those that DEVEXPRESS has expressly designated as Redistributable. + +4. RENTAL. + +You may not rent, lease, or lend the SOFTWARE COMPONENT PRODUCT(S). + +5. TRANSFER. + +You may NOT permanently or temporarily transfer ANY of your rights under this EULA to any individual or entity without prior written approval from DEVEXPRESS. Regardless of any modifications which you make and regardless of how you might compile, link, and/or package your programs, under no circumstances may the libraries, Redistributables, and/or other files of the SOFTWARE COMPONENT PRODUCT(S) (including any portions thereof) be used for developing programs by anyone other than you. Only you as the licensed Developer End User have the right to use the libraries, redistributables, or other files of the SOFTWARE COMPONENT PRODUCT(S) (or any portions thereof) for developing programs created with the SOFTWARE COMPONENT PRODUCT(S). In particular, you may not share copies of the Redistributables with other co-developers. You may not reproduce or distribute any DEVEXPRESS documentation without DEVEXPRESS's explicit permission. + +If you are an entity (Company), you must acquire and assign a license to each Developer End User within your organization using and or developing with the SOFTWARE COMPONENT PRODUCT(S). With written notification to DEVEXPRESS, Company may transfer the license obtained for a Developer End User to another Developer End User employed or otherwise engaged by Company if the initial Developer End User is no longer employed or engaged by Company or is reassigned to another function within Company and no longer develops software applications using the SOFTWARE COMPONENT PRODUCT(S). In addition, with written notification to DEVEXPRESS, Company may transfer its license of the SOFTWARE COMPONENT PRODUCT(S) to a successor Company. + +6. ROYALTY FREE REDISTRIBUTION. + +DEVEXPRESS PRODUCT(s) may include certain files ("Redistributable(s)") intended for distribution by you to the users of software applications which you create. Redistributables include, for example, those files identified in printed or on-line documentation as redistributable files, or those files preselected for deployment by an install utility provided with the SOFTWARE COMPONENT PRODUCT(S) (if any). In all circumstances, the Redistributables for the SOFTWARE COMPONENT PRODUCT(S) are only those files specifically designated as such by DEVEXPRESS. + +Subject to all of the terms and conditions in this EULA, you may reproduce and distribute copies of the Redistributables, provided that such copies are made from the original copy of the Redistributables included with the SOFTWARE COMPONENT PRODUCT(S) or modified versions of the Redistributables which are provided to you by DEVEXPRESS or those which you create. Copies of Redistributables may only be distributed with and for the sole purpose of executing application programs permitted under this EULA that you have created using the SOFTWARE COMPONENT PRODUCT(S). + +REDISTRIBUTABLES. To obtain a list of redistributables that apply under this EULA, contact support@devexpress.com + +AT NO TIME MAY DEVELOPER END USER CREATE ANY TOOL, REDISTRIBUTABLE, OR SOFTWARE COMPONENT PRODUCT(S) THAT DIRECTLY OR INDIRECTLY COMPETES WITH DEVEXPRESS SOFTWARE COMPONENT PRODUCT(S) WHICH UTILIZES ALL OR ANY PORTION OF THE SOFTWARE COMPONENT PRODUCT(S) contained within this installation. + +Distribution by the Developer End User of any design-time tools (EXE's OCX's or DLL's), executables, and source code distributed to Developer End User by DEVEXPRESS as part of this SOFTWARE COMPONENT PRODUCT(S) and not explicitly identified as a redistributable file is strictly prohibited. The Developer End User shall not develop software applications that provide an application programming interface to the SOFTWARE COMPONENT PRODUCT(S) or the SOFTWARE COMPONENT PRODUCT(S) as modified. + +The Developer End User may NOT distribute the SOFTWARE COMPONENT PRODUCT(S), in any format, to other users for development or application compilation purposes. Specifically, if Developer End User creates a control using the SOFTWARE COMPONENT PRODUCT(S) as a constituent control, Developer End User may NOT distribute the control created with the SOFTWARE COMPONENT PRODUCT(S) (in any format) to users to be used used at design time and or for ANY development purposes. + +Developer End User MAY NOT REDISTRIBUTE any SOFTWARE COMPONENT PRODUCT(s) files if using an evaluation, trial, Not for Resale, or demo version of the SOFTWARE COMPONENT PRODUCT(s). + +7. UPGRADES. + +If the SOFTWARE COMPONENT PRODUCT(S) is labeled as an upgrade, you must be properly licensed to use the SOFTWARE COMPONENT PRODUCT(S) identified by DEVEXPRESS as being eligible for the upgrade in order to use the SOFTWARE COMPONENT PRODUCT(S). A SOFTWARE COMPONENT PRODUCT(S) labeled as an upgrade replaces and/or supplements the SOFTWARE COMPONENT PRODUCT(S) that formed the basis for your eligibility for the upgrade, and together constitutes a single PRODUCT(S). You may use the resulting upgraded PRODUCT(S) only in accordance with all the terms of this EULA. + +8. COPYRIGHT. + +All title and copyrights in and to the SOFTWARE COMPONENT PRODUCT(S) (including but not limited to any copywritten images, demos, source code, intermediate files, packages, photographs, redistributables, animations, video, audio, music, text, and "applets" incorporated into the SOFTWARE COMPONENT PRODUCT(S) the accompanying printed materials, and any copies of the SOFTWARE COMPONENT PRODUCT(S)) are owned by DEVEXPRESS or its subsidiaries. The SOFTWARE COMPONENT PRODUCT(S) is protected by copyright laws and international treaty provisions and therefore, you must treat the SOFTWARE COMPONENT PRODUCT(S) like any other copyrighted material except that you may install the SOFTWARE COMPONENT PRODUCT(S) as described in this EULA. + +9. DUAL-MEDIA SOFTWARE COMPONENT PRODUCT(S). + +You may receive the SOFTWARE COMPONENT PRODUCT(S) in more than one medium. Regardless of the medium, you may use only one medium that is appropriate for your single computer. You may not loan, sell, rent, lease, or otherwise transfer in any manner the other medium to another user or entity. + +10. U.S. GOVERNMENT RESTRICTED RIGHTS. + +The Licensed Software is Commercial Computer Software provided with RESTRICTED RIGHTS under Federal Acquisition Regulations and agency supplements to them. Use, duplication or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFAR 255.227-7013 et. seq. or 252.211-7015, or subparagraphs (a) through (d) of the Commercial Computer Software Restricted Rights at FAR 52.227-19, as applicable, or similar clauses in the NASA FAR Supplement. Contractor-manufacturer is Developer Express Inc. / 6375 S. Pecos Rd Suite 118, Las Vegas NV 89120. + +11. EXPORT RESTRICTIONS. + +DEVEXPRESS expressly complies with all export restrictions imposed by the government of the United States of America. You, as Developer End User, must agree not to export or re-export the SOFTWARE COMPONENT PRODUCT(S) within any created application to any country, person, entity or end user subject to U.S.A. export restrictions. Restricted countries currently include, but are not necessarily limited to Cuba, Iran, Iraq, Libya, North Korea, Sudan, and Syria. You warrant and represent that neither the U.S.A. Bureau of Export Administration nor any other federal agency has suspended, revoked or denied your export privileges. + +12. NOTE ON JAVA SUPPORT. + +Certain SOFTWARE COMPONENT PRODUCT(S) may contain support for programs written in Java. Java technology is not fault tolerant and is not designed, manufactured, or intended for use or resale as on-line control equipment in hazardous environments requiring fail-safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines, or weapons systems, in which the failure of Java technology could lead directly to death, personal injury, or severe physical or environmental damage. + +13. DISCLAIMER OF WARRANTY. + +DEVEXPRESS expressly disclaims any warranty for the SOFTWARE COMPONENT PRODUCT(S). THE SOFTWARE COMPONENT PRODUCT(S) AND ANY RELATED DOCUMENTATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. DEVEXPRESS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY REPRESENTATIONS REGARDING THE USE, OR THE RESULTS OF THE USE, OF THE SOFTWARE COMPONENT PRODUCT(S) IN TERMS OF CORRECTNESS, ACCURACY, RELIABILITY, OR OTHERWISE. THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE COMPONENT PRODUCT(S) REMAINS WITH YOU. No oral or written information or advice given by DEVEXPRESS or its employees shall create a warranty or in any way increase the scope of this warranty. + +14. LIMITATIONS ON LIABILITY. + +To the maximum extent permitted by applicable law, in no event shall DEVEXPRESS be liable for any special, incidental, indirect, or consequential damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use the SOFTWARE COMPONENT PRODUCT(S) or the provision of or failure to provide Support Services, even if DEVEXPRESS has been advised of the possibility of such damages. + +Developer End User understands that the SOFTWARE COMPONENT PRODUCT(S) may produce inaccurate results because of a failure or fault within the SOFTWARE COMPONENT PRODUCT(S) or failure by Developer End User to properly use and or deploy the SOFTWARE COMPONENT PRODUCT(S). Developer End User assumes full and sole responsibility for any use of the SOFTWARE COMPONENT PRODUCT(S), and bears the entire risk for failures or faults within the SOFTWARE COMPONENT PRODUCT(S). You agree that regardless of the cause of failure or fault or the form of any claim, YOUR SOLE REMEDY AND DEVEXPRESS'S SOLE OBLIGATION SHALL BE GOVERNED BY THIS AGREEMENT AND IN NO EVENT SHALL DEVEXPRESS'S LIABILITY EXCEED THE PRICE PAID TO DEVEXPRESS FOR THE SOFTWARE COMPONENT PRODUCT(S). This Limited Warranty is void if failure of the SOFTWARE COMPONENT PRODUCT(S) has resulted from accident, abuse, alteration, unauthorized use or misapplication of the SOFTWARE COMPONENT PRODUCT(S). + +15. INDEMNIFICATION. + +You hereby agree to indemnify DEVEXPRESS and its officers, directors, employees, agents, and representatives from each and every demand, claim, loss, liability, or damage of any kind, including actual attorneys fees, whether in tort or contract, that it or any of them may incur by reason of, or arising out of, any claim which is made by any third party with respect to any breach or violation of this Agreement by you or any claims based on the Applications and the SOFTWARE COMPONENT PRODUCT(S) included herein. + +16. SUPPORT SERVICES. + +DEVEXPRESS may provide you with support services related to the SOFTWARE COMPONENT PRODUCT(S) ("Support Services"). Use of Support Services is governed by DEVEXPRESS policies and programs described in the user manual, in "on line" documentation and/or other DEVEXPRESS provided materials. Any supplemental SOFTWARE COMPONENT PRODUCT(S) provided to you as part of the Support Services shall be considered part of the SOFTWARE COMPONENT PRODUCT(S) and subject to the terms and conditions of this EULA. With respect to technical information you provide to DEVEXPRESS as part of the Support Services, DEVEXPRESS may use such information for its business purposes, including for SOFTWARE COMPONENT PRODUCT(s) support and development. DEVEXPRESS will not utilize such technical information in a form that personally identifies you. + +17. TERMINATION. + +Without prejudice to any other rights or remedies, DEVEXPRESS will terminate this EULA upon your failure to comply with all the terms and conditions of this EULA. In such events, you must destroy all copies of the SOFTWARE COMPONENT PRODUCT(S) and all of its component parts including any related documentation, and must remove ANY and ALL use of such technology immediately from any applications using technology contained in the SOFTWARE COMPONENT PRODUCT(S) developed by you, whether in native, altered or compiled state. + +18. TAX. + +DEVEXPRESS delivers its software electronically and does not collect sales or use tax for residents of US states in which it operates. You should confirm that your local, state, or federal government does not impose any sales or use tax on electronically delivered software. You are entirely liable for any such sales or use tax. + +19. MISCELLANEOUS. + +This EULA shall be construed, interpreted and governed by the laws of the State of Nevada, U.S.A. This EULA gives you specific legal rights; you may have others that vary from state to state and from country to country. + +This EULA may only be modified in writing signed by you and an authorized officer of DEVELOPER EXPRESS INC. If any provision of this EULA is found void or unenforceable, the remainder will remain valid and enforceable according to its terms. If any remedy provided is determined to have failed for its essential purpose, all limitations of liability and exclusions of damages set forth in the Limited Warranty shall remain in effect. + +DEVEXPRESS reserves all rights not specifically granted in this EULA. + +ACKNOWLEDGEMENTS. Developer End User acknowledges that he or she has read this Agreement, understands it, and agrees to be bound by its terms and conditions. + +Should you have any questions concerning this EULA, or if you desire to contact DEVEXPRESS for any reason, please contact us directly at us in the United States of America at 702-262-0609, or write: Developer Express Inc. Legal department / 6330 McLeod Dr Suite 1, Las Vegas NV 89120. + diff --git a/official/x.35/ExpressScheduler 3/Help/ExpressScheduler3.cnt b/official/x.35/ExpressScheduler 3/Help/ExpressScheduler3.cnt new file mode 100644 index 00000000..fc4e6c59 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Help/ExpressScheduler3.cnt @@ -0,0 +1,145 @@ +:Base ExpressScheduler3.hlp +:Title ExpressScheduler Suite 3 +:Index ExpressScheduler Suite 3=ExpressScheduler3.hlp +1 ExpressScheduler Suite 3 +2 What's New in v3=CD_What_s_New_in_v3 +2 What's New in v2=CD_What_s_New_in_v2 +2 Known Issues and Important Changes List=CD_Known_Issues_and_Important_Changes_List +2 Concepts +3 Scheduler +4 The Scheduler Control's Elements=The_Scheduler_Control_s_Elements +4 Scheduling Area=Scheduling_Area +4 Date Navigator=Date_Navigator +4 Control Box=Control_Box +4 Customizing The Scheduler's Appearance +5 Custom Drawing=Custom_Drawing +5 Styles=Styles +3 User Event +4 About The User Event=About_The_User_Activity +4 Applying The Recurrence Pattern=Applying_The_Recurrence_Pattern +4 Grouping User Events=Grouping_Schedules +4 Customizing Event and Event recurrence dialogs=Customizing_Event_and_Event_recurrence_dialogs +3 Persisting Data +4 Aggregate Storage=CD_Aggregate_Storage +4 Bound Mode=Bound_Mode +4 Unbound Mode=Unbound_Mode +4 Handling Raw Data=Handling_Raw_Data +2 How To... +3 Add a custom label to the event's editor and popup menu=CD_How_to_add_a_custom_label_to_the_event_s_editor_and_popup_menu +3 Change the time ruler's time format=CD_How_to_change_the_time_ruler_s_time_format +3 Customize the work time for each day=CD_How_to_customize_the_work_time_for_each_day +3 Determine the time block under the mouse pointer=CD_How_to_determine_the_time_block_under_the_mouse_pointer +3 Determine the time interval selected by an end-user=CD_How_to_determine_the_time_interval_selected_by_an_end_user +3 Display the number of events for a particular day within month view cells=CD_How_to_display_the_number_of_events_for_a_particular_day_within_month_view_cells +3 Draw a custom glyph within an event=CD_How_to_draw_a_custom_glyph_within_an_event +3 Enable drag-and-drop operations between a data grid and a scheduler=CD_How_to_enable_drag-and-drop_operations_between_a_data_grid_and_a_scheduler +3 Prevent more than one event from being dragged at a time=CD_How_to_prevent_more_than_one_event_from_being_dragged_at_a_time +3 Programmatically add an empty event and invoke the event editor for it=CD_How_to_programmatically_add_an_empty_event_and_invoke_the_event_editor_for_it +3 Aggregate Scheduler +4 How to Bind Multiple Scheduler Storages to a Scheduler at Design-Time=CD_How_to_Bind_Multiple_Scheduler_Storages_to_a_Scheduler_at_Design_Time +4 How to Bind Multiple Scheduler Storages to a Scheduler in Code=CD_How_to_Bind_Multiple_Scheduler_Storages_to_a_Scheduler_in_Code +3 Gantt View +4 How to Create Tasks in Gantt View in Code=CD_How_to_Create_Tasks_in_Gantt_View_in_Code +3 TcxSchedulerHolidays Component +4 How to Add Holidays to a Scheduler at Design-Time=CD_How_to_Add_Holidays_to_a_Scheduler_at_Design_Time +3 TcxSchedulerGridConnection Component +4 How to Bind a Scheduler to an ExpressQuantumGrid Using the TcxSchedulerGridConnection=CD_How_to_Bind_a_Scheduler_to_an_ExpressQuantumGrid_Using_the_TcxSchedulerGridConnection +2 Reference +3 Units +4 cxScheduler=IDH_Unit_cxScheduler +4 cxSchedulerAggregateStorage=IDH_Unit_cxSchedulerAggregateStorage>Main +4 cxSchedulerCustomControls=IDH_Unit_cxSchedulerCustomControls +4 cxSchedulerCustomResourceView=IDH_Unit_cxSchedulerCustomResourceView +4 cxSchedulercxGridConnection=IDH_Unit_cxSchedulercxGridConnection>Main +4 cxSchedulerDateNavigator=IDH_Unit_cxSchedulerDateNavigator +4 cxSchedulerDayView=IDH_Unit_cxSchedulerDayView +4 cxSchedulerDBStorage=IDH_Unit_cxSchedulerDBStorage +4 cxSchedulerDialogs=IDH_Unit_cxSchedulerDialogs +4 cxSchedulerGanttView=IDH_Unit_cxSchedulerGanttView>Main +4 cxSchedulerHolidays=IDH_Unit_cxSchedulerHolidays>Main +4 cxSchedulerOutlookExchange=IDH_Unit_cxSchedulerOutlookExchange +4 cxSchedulerStorage=IDH_Unit_cxSchedulerStorage +4 cxSchedulerTimeGridView=IDH_Unit_cxSchedulerTimeGridView +4 cxSchedulerUtils=IDH_Unit_cxSchedulerUtils +4 cxSchedulerWeekView=IDH_Unit_cxSchedulerWeekView +4 cxSchedulerYearView=IDH_Unit_cxSchedulerYearView +4 cxDateNavigator=IDH_Unit_cxDateNavigator +3 ExpressScheduler Controls +4 TcxScheduler=IDH_Class_TcxScheduler +4 TcxDateNavigator=IDH_Class_TcxDateNavigator +3 Scheduler Structure +4 TcxScheduler=IDH_Class_TcxScheduler +4 Scheduling Area +5 TcxSchedulerCustomView=IDH_Class_TcxSchedulerCustomView +5 Time Views +6 TcxSchedulerDayView=IDH_Class_TcxSchedulerDayView +6 TcxSchedulerGanttView=IDH_Class_TcxSchedulerGanttView>Main +6 TcxSchedulerTimeGridView=IDH_Class_TcxSchedulerTimeGridView +6 TcxSchedulerWeekView=IDH_Class_TcxSchedulerWeekView +6 TcxSchedulerWeeksView=IDH_Class_TcxSchedulerWeeksView +6 TcxSchedulerYearView=IDH_Class_TcxSchedulerYearView +4 Date Navigator +5 TcxSchedulerDateNavigator=IDH_Class_TcxSchedulerDateNavigator +4 Control Box +5 TcxSchedulerControlBox=IDH_Class_TcxSchedulerControlBox +3 User Event +4 TcxSchedulerAggregateStorageEvent=IDH_Class_TcxSchedulerAggregateStorageEvent>Main +4 TcxSchedulerControlEvent=IDH_Class_TcxSchedulerControlEvent +4 TcxSchedulerEvent=IDH_Class_TcxSchedulerEvent +4 TcxSchedulerEventConflictsInfo=IDH_Class_TcxSchedulerEventConflictsInfo +4 TcxSchedulerEventImageItem=IDH_Class_TcxSchedulerEventImageItem +4 TcxSchedulerEventImages=IDH_Class_TcxSchedulerEventImages +4 TcxSchedulerEventLabel=IDH_Class_TcxSchedulerEventLabel +4 TcxSchedulerEventLabels=IDH_Class_TcxSchedulerEventLabels +4 TcxSchedulerEventRecurrenceInfo=IDH_Class_TcxSchedulerEventRecurrenceInfo +3 Scheduler Storage +4 TcxSchedulerAggregateStorage=IDH_Class_TcxSchedulerAggregateStorage>Main +4 TcxSchedulerDBStorage=IDH_Class_TcxSchedulerDBStorage +4 TcxSchedulerStorage=IDH_Class_TcxSchedulerStorage +3 Popup Menus +4 TcxSchedulerContentPopupMenu=IDH_Class_TcxSchedulerContentPopupMenu +4 TcxSchedulerEventPopupMenu=IDH_Class_TcxSchedulerEventPopupMenu +4 TcxSchedulerGridBuildInPopupMenu=IDH_Class_TcxSchedulerGridBuildInPopupMenu>Main +4 TcxSchedulerTimeRulerPopupMenu=IDH_Class_TcxSchedulerTimeRulerPopupMenu +3 Options +4 TcxSchedulerOptionsBehavior=IDH_Class_TcxSchedulerOptionsBehavior>Main +4 TcxSchedulerOptionsCustomize=IDH_Class_TcxSchedulerOptionsCustomize +4 TcxSchedulerEventOperations=IDH_Class_TcxSchedulerEventOperations +4 TcxSchedulerOptionsView=IDH_Class_TcxSchedulerOptionsView +3 Hit Test +4 TcxSchedulerSubControlHitTest=IDH_Class_TcxSchedulerSubControlHitTest +4 TcxSchedulerDateNavigatorHitTest=IDH_Class_TcxSchedulerDateNavigatorHitTest +4 TcxSchedulerViewHitTest=IDH_Class_TcxSchedulerViewHitTest +4 TcxSchedulerCustomResourceView=IDH_Class_TcxSchedulerCustomResourceView +4 TcxSchedulerDayViewHitTest=IDH_Class_TcxSchedulerDayViewHitTest +4 TcxSchedulerGanttViewHitTest=IDH_Class_TcxSchedulerGanttViewHitTest>Main +4 TcxSchedulerTimeGridViewHitTest=IDH_Class_TcxSchedulerTimeGridViewHitTest +4 TcxSchedulerYearViewHitTest=IDH_Class_TcxSchedulerYearViewHitTest +3 Styles +4 TcxSchedulerStyles=IDH_Class_TcxSchedulerStyles +4 TcxSchedulerDateNavigatorStyles=IDH_Class_TcxSchedulerDateNavigatorStyles +4 TcxSchedulerDayViewStyles=IDH_Class_TcxSchedulerDayViewStyles +4 TcxSchedulerGanttViewEventStyle=IDH_Type_TcxSchedulerGanttViewEventStyle>Main +4 TcxSchedulerTimeGridViewStyles=IDH_Class_TcxSchedulerTimeGridViewStyles +4 TcxSchedulerYearViewStyles=IDH_Class_TcxSchedulerYearViewStyles +3 Utils +4 TcxSchedulerDateList=IDH_Class_TcxSchedulerDateList +4 TcxSchedulerDateTimeHelper=IDH_Class_TcxSchedulerDateTimeHelper +4 TcxSchedulerOccurrenceCalculator=IDH_Class_TcxSchedulerOccurrenceCalculator +4 TcxSchedulerEventConflictsInfo=IDH_Class_TcxSchedulerEventConflictsInfo +3 Routines +4 cxRecurrenceInfoDataToString=IDH_cxSchedulerStorage_cxRecurrenceInfoDataToString +4 cxSchedulerExportToOutlook=IDH_cxSchedulerOutlookExchange_cxSchedulerExportToOutlook +4 cxSchedulerImportFromOutlook=IDH_cxSchedulerOutlookExchange_cxSchedulerImportFromOutlook +4 cxSchedulerSynchronizeOutlookWithStorage=IDH_cxSchedulerOutlookExchange_cxSchedulerSynchronizeOutlookWithStorage +4 cxSchedulerSynchronizeStorageWithOutlook=IDH_cxSchedulerOutlookExchange_cxSchedulerSynchronizeStorageWithOutlook +4 cxShowEventEditor=IDH_cxSchedulerDialogs_cxShowEventEditor +4 cxShowHolidaysEditor=IDH_cxSchedulerDialogs_cxShowHolidaysEditor>Main +4 cxShowGoToDateDialog=IDH_cxSchedulerDialogs_cxShowGoToDateDialog +4 cxShowRecurrenceEditor=IDH_cxSchedulerDialogs_cxShowRecurrenceEditor +4 cxShowResourcesLayoutEditor=IDH_cxSchedulerDialogs_cxShowResourcesLayoutEditor +4 cxShowTaskDependencyEditor=IDH_cxSchedulerDialogs_cxShowTaskDependencyEditor>Main +4 cxStringToRecurrenceInfoData=IDH_cxSchedulerStorage_cxStringToRecurrenceInfoData +4 cxGetRecurrenceDescriptionString=IDH_cxSchedulerStorage_cxGetRecurrenceDescriptionString +4 cxMinutesToText=IDH_cxSchedulerUtils_cxMinutesToText +4 cxTextToMinutes=IDH_cxSchedulerUtils_cxTextToMinutes diff --git a/official/x.35/ExpressScheduler 3/Help/ExpressScheduler3.hlp b/official/x.35/ExpressScheduler 3/Help/ExpressScheduler3.hlp new file mode 100644 index 00000000..5a9f29ce Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Help/ExpressScheduler3.hlp differ diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerC11.bpk b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerC11.bpk new file mode 100644 index 00000000..1a25d999 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerC11.bpk @@ -0,0 +1,192 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = cxSchedulerC11.bpl +OBJFILES = cxScheduler.obj cxSchedulerAggregateStorage.obj cxSchedulerCustomControls.obj cxSchedulerCustomResourceView.obj \ + cxSchedulerDateNavigator.obj cxSchedulerDayView.obj cxSchedulerDBStorage.obj cxSchedulerDialogs.obj \ + cxSchedulerEventEditor.obj cxSchedulerGoToDateDialog.obj cxSchedulerRecurrenceEditor.obj \ + cxSchedulerRecurrenceSelectionDialog.obj cxSchedulerResourcesLayoutEditor.obj \ + cxSchedulerReminderWindow.obj cxSchedulerTimeGridView.obj cxSchedulerYearView.obj \ + cxSchedulerStorage.obj cxSchedulerStrs.obj cxSchedulerUtils.obj cxSchedulerWeekView.obj \ + cxDateNavigator.obj cxSchedulerOutlookExchange.obj cxExportSchedulerLink.obj \ + cxSchedulerC11.obj cxSchedulerHolidays.obj cxSchedulerHolidaysLocationHolidayEditor.obj \ + cxSchedulerHolidaysEditor.obj cxSchedulerHolidaysLocationEditor.obj cxSchedulerGanttView.obj cxSchedulerTaskDependencyEditor.obj +MAINSOURCE = cxSchedulerC11.cpp +RESFILES = cxSchedulerC11.res +RESDEPEN = $(RESFILES) cxSchedulerEventEditor.dfm cxSchedulerGoToDateDialog.dfm \ + cxSchedulerRecurrenceEditor.dfm cxSchedulerRecurrenceSelectionDialog.dfm \ + cxSchedulerResourcesLayoutEditor.dfm cxSchedulerReminderWindow.dfm \ + cxSchedulerHolidaysLocationHolidayEditor.dfm \ + cxSchedulerHolidaysEditor.dfm cxSchedulerHolidaysLocationEditor.dfm cxSchedulerTaskDependencyEditor.dfm +LIBFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi vclx.bpi dbrtl.bpi cxDataC11.bpi cxLibraryC11.bpi \ + cxEditorsC11.bpi cxExtEditorsC11.bpi cxExportC11.bpi dxThemeC11.bpi +SPARELIBS = +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressScheduler 3 by Developer Express Inc." -aa -Tpp \ + -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerC11.cpp b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerC11.cpp new file mode 100644 index 00000000..655a9425 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerC11.cpp @@ -0,0 +1,54 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("cxSchedulerC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("cxExtEditorsC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("cxExportC11.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEUNIT("cxScheduler.pas"); +USEUNIT("cxSchedulerAggregateStorage.pas"); +USEUNIT("cxSchedulerCustomControls.pas"); +USEUNIT("cxSchedulerCustomResourceView.pas"); +USEUNIT("cxSchedulerDateNavigator.pas"); +USEUNIT("cxSchedulerDayView.pas"); +USEUNIT("cxSchedulerDBStorage.pas"); +USEUNIT("cxSchedulerDialogs.pas"); +USEUNIT("cxSchedulerEventEditor.pas"); +USEUNIT("cxSchedulerGoToDateDialog.pas"); +USEUNIT("cxSchedulerRecurrenceEditor.pas"); +USEUNIT("cxSchedulerRecurrenceSelectionDialog.pas"); +USEUNIT("cxSchedulerResourcesLayoutEditor.pas"); +USEUNIT("cxSchedulerStorage.pas"); +USEUNIT("cxSchedulerStrs.pas"); +USEUNIT("cxSchedulerUtils.pas"); +USEUNIT("cxExportSchedulerLink.pas"); +USEUNIT("cxSchedulerReminderWindow.pas"); +USEUNIT("cxSchedulerTimeGridView.pas"); +USEUNIT("cxSchedulerYearView.pas"); +USEUNIT("cxSchedulerWeekView.pas"); +USEUNIT("cxSchedulerOutlookExchange.pas"); +USEUNIT("cxDateNavigator.pas"); +USEUNIT("cxSchedulerHolidaysLocationHolidayEditor.pas"); +USEUNIT("cxSchedulerHolidays.pas"); +USEUNIT("cxSchedulerHolidaysEditor.pas"); +USEUNIT("cxSchedulerHolidaysLocationEditor.pas"); +USEUNIT("cxSchedulerGanttView.pas"); +USEUNIT("cxSchedulerTaskDependencyEditor.pas"); + +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerC11.res b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerC11.res new file mode 100644 index 00000000..28d35241 Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerC11.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD10.dpk b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD10.dpk new file mode 100644 index 00000000..ebbe654a --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD10.dpk @@ -0,0 +1,68 @@ +package cxSchedulerD10; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressScheduler 3 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxDataD10, + cxEditorsD10, + cxExtEditorsD10, + cxExportD10, + cxLibraryD10, + dxThemeD10; + +contains + cxScheduler, + cxSchedulerAggregateStorage, + cxSchedulerCustomControls, + cxSchedulerCustomResourceView, + cxSchedulerDateNavigator, + cxSchedulerDayView, + cxSchedulerDBStorage, + cxSchedulerDialogs, + cxSchedulerEventEditor, + cxSchedulerGoToDateDialog, + cxSchedulerRecurrenceEditor, + cxSchedulerGanttView, + cxSchedulerRecurrenceSelectionDialog, + cxSchedulerResourcesLayoutEditor, + cxSchedulerStorage, + cxSchedulerStrs, + cxSchedulerUtils, + cxExportSchedulerLink, + cxSchedulerOutlookExchange, + cxDateNavigator, + cxSchedulerReminderWindow, + cxSchedulerTimeGridView, + cxSchedulerYearView, + cxSchedulerWeekView, + cxSchedulerHolidaysLocationHolidayEditor, + cxSchedulerHolidays, + cxSchedulerHolidaysEditor, + cxSchedulerHolidaysLocationEditor, + cxSchedulerTaskDependencyEditor; + +end. diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD10.res b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD10.res new file mode 100644 index 00000000..0f53174d Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD10.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD11.dpk b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD11.dpk new file mode 100644 index 00000000..c3ce55b6 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD11.dpk @@ -0,0 +1,68 @@ +package cxSchedulerD11; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressScheduler 3 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxDataD11, + cxEditorsD11, + cxExtEditorsD11, + cxExportD11, + cxLibraryD11, + dxThemeD11; + +contains + cxScheduler, + cxSchedulerAggregateStorage, + cxSchedulerCustomControls, + cxSchedulerCustomResourceView, + cxSchedulerDateNavigator, + cxSchedulerDayView, + cxSchedulerDBStorage, + cxSchedulerDialogs, + cxSchedulerEventEditor, + cxSchedulerGoToDateDialog, + cxSchedulerRecurrenceEditor, + cxSchedulerRecurrenceSelectionDialog, + cxSchedulerResourcesLayoutEditor, + cxSchedulerStorage, + cxSchedulerStrs, + cxSchedulerUtils, + cxExportSchedulerLink, + cxSchedulerOutlookExchange, + cxDateNavigator, + cxSchedulerReminderWindow, + cxSchedulerTimeGridView, + cxSchedulerYearView, + cxSchedulerWeekView, + cxSchedulerGanttView, + cxSchedulerHolidaysLocationHolidayEditor, + cxSchedulerHolidays, + cxSchedulerHolidaysEditor, + cxSchedulerHolidaysLocationEditor, + cxSchedulerTaskDependencyEditor; + +end. diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD11.res b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD11.res new file mode 100644 index 00000000..1ff42080 Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD11.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD7.dpk b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD7.dpk new file mode 100644 index 00000000..1d44cbf2 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD7.dpk @@ -0,0 +1,68 @@ +package cxSchedulerD7; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressScheduler 3 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxDataD7, + cxEditorsVCLD7, + cxExtEditorsVCLD7, + cxExportVCLD7, + cxLibraryVCLD7, + dxThemeD7; + +contains + cxScheduler, + cxSchedulerAggregateStorage, + cxSchedulerCustomControls, + cxSchedulerCustomResourceView, + cxSchedulerDateNavigator, + cxSchedulerDayView, + cxSchedulerDBStorage, + cxSchedulerDialogs, + cxSchedulerEventEditor, + cxSchedulerGoToDateDialog, + cxSchedulerRecurrenceEditor, + cxSchedulerRecurrenceSelectionDialog, + cxSchedulerResourcesLayoutEditor, + cxSchedulerStorage, + cxSchedulerStrs, + cxSchedulerUtils, + cxExportSchedulerLink, + cxSchedulerOutlookExchange, + cxDateNavigator, + cxSchedulerReminderWindow, + cxSchedulerTimeGridView, + cxSchedulerYearView, + cxSchedulerWeekView, + cxSchedulerGanttView, + cxSchedulerHolidaysLocationHolidayEditor, + cxSchedulerHolidays, + cxSchedulerHolidaysEditor, + cxSchedulerHolidaysLocationEditor, + cxSchedulerTaskDependencyEditor; + +end. diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD7.res b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD7.res new file mode 100644 index 00000000..f1d259ba Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD7.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD9.dpk b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD9.dpk new file mode 100644 index 00000000..5fc14e8c --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD9.dpk @@ -0,0 +1,68 @@ +package cxSchedulerD9; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressScheduler 3 by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxDataD9, + cxEditorsD9, + cxExtEditorsD9, + cxExportD9, + cxLibraryD9, + dxThemeD9; + +contains + cxScheduler, + cxSchedulerAggregateStorage, + cxSchedulerCustomControls, + cxSchedulerCustomResourceView, + cxSchedulerDateNavigator, + cxSchedulerDayView, + cxSchedulerDBStorage, + cxSchedulerDialogs, + cxSchedulerEventEditor, + cxSchedulerGoToDateDialog, + cxSchedulerRecurrenceEditor, + cxSchedulerRecurrenceSelectionDialog, + cxSchedulerResourcesLayoutEditor, + cxSchedulerStorage, + cxSchedulerStrs, + cxSchedulerUtils, + cxExportSchedulerLink, + cxSchedulerOutlookExchange, + cxDateNavigator, + cxSchedulerReminderWindow, + cxSchedulerTimeGridView, + cxSchedulerYearView, + cxSchedulerWeekView, + cxSchedulerGanttView, + cxSchedulerHolidaysLocationHolidayEditor, + cxSchedulerHolidays, + cxSchedulerHolidaysEditor, + cxSchedulerHolidaysLocationEditor, + cxSchedulerTaskDependencyEditor; + +end. diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD9.res b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD9.res new file mode 100644 index 00000000..635aa364 Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerD9.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridC11.bpk b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridC11.bpk new file mode 100644 index 00000000..52e691ef --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridC11.bpk @@ -0,0 +1,197 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = cxSchedulerGridC11.bpl +OBJFILES = cxSchedulerGridC11.obj cxSchedulercxGridConnection.obj +RESFILES = cxSchedulerGridC11.res +MAINSOURCE = cxSchedulerGridC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = dxThemeC11.bpi cxEditorsC11.bpi cxExportC11.bpi cxLibraryC11.bpi \ + cxDataC11.bpi rtl.bpi vcl.bpi dbrtl.bpi vcldb.bpi cxExtEditorsC11.bpi \ + cxPageControlC11.bpi cxGridC11.bpi cxSchedulerC11.bpi +SPARELIBS = rtl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) \ + -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressScheduler 3 connection to ExpressQuantumGrid by Developer Express Inc." -aa \ + -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridC11.cpp b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridC11.cpp new file mode 100644 index 00000000..abb768f4 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridC11.cpp @@ -0,0 +1,32 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("cxSchedulerGridC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("cxExportC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("cxExtEditorsC11.bpi"); +USEPACKAGE("cxPageControlC11.bpi"); +USEPACKAGE("cxGridC11.bpi"); +USEPACKAGE("cxSchedulerC11.bpi"); +USEUNIT("cxSchedulercxGridConnection.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridC11.res b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridC11.res new file mode 100644 index 00000000..48728142 Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridC11.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD10.dpk b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD10.dpk new file mode 100644 index 00000000..5a0db5a7 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD10.dpk @@ -0,0 +1,37 @@ +package cxSchedulerGridD10; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressScheduler 3 connection to ExpressQuantumGrid by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxSchedulerD10, + cxGridD10; + +contains + cxSchedulercxGridConnection; + + +end. diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD10.res b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD10.res new file mode 100644 index 00000000..9945afb4 Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD10.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD11.dpk b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD11.dpk new file mode 100644 index 00000000..4da83a08 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD11.dpk @@ -0,0 +1,37 @@ +package cxSchedulerGridD11; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressScheduler 3 connection to ExpressQuantumGrid by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxSchedulerD11, + cxGridD11; + +contains + cxSchedulercxGridConnection; + + +end. diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD11.res b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD11.res new file mode 100644 index 00000000..5786bde8 Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD11.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD6.dpk b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD6.dpk new file mode 100644 index 00000000..a1fa7d86 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD6.dpk @@ -0,0 +1,37 @@ +package cxSchedulerGridD6; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressScheduler 3 connection to ExpressQuantumGrid by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxSchedulerD6, + cxGridD6; + +contains + cxSchedulercxGridConnection; + + +end. diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD6.res b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD6.res new file mode 100644 index 00000000..46fb42cd Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD6.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD7.dpk b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD7.dpk new file mode 100644 index 00000000..701f6c61 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD7.dpk @@ -0,0 +1,37 @@ +package cxSchedulerGridD7; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressScheduler 3 connection to ExpressQuantumGrid by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxSchedulerD7, + cxGridD7; + +contains + cxSchedulercxGridConnection; + + +end. diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD7.res b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD7.res new file mode 100644 index 00000000..cd10e98d Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD7.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD9.dpk b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD9.dpk new file mode 100644 index 00000000..941eccc2 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD9.dpk @@ -0,0 +1,37 @@ +package cxSchedulerGridD9; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressScheduler 3 connection to ExpressQuantumGrid by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + cxSchedulerD9, + cxGridD9; + +contains + cxSchedulercxGridConnection; + + +end. diff --git a/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD9.res b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD9.res new file mode 100644 index 00000000..e94d89ee Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/cxSchedulerGridD9.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerC11.bpk b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerC11.bpk new file mode 100644 index 00000000..24bbcbe9 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerC11.bpk @@ -0,0 +1,181 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxSchedulerC11.bpl +OBJFILES = cxSchedulerReg.obj dclcxSchedulerC11.obj +MAINSOURCE = dclcxSchedulerC11.cpp +RESFILES = dclcxSchedulerC11.res cxSchedulerReg.dcr +RESDEPEN = $(RESFILES) +LIBFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi vclx.bpi dbrtl.bpi cxEditorsC11.bpi \ + cxExportC11.bpi cxSchedulerC11.bpi cxLibraryC11.bpi dclcxLibraryC11.bpi \ + cxDataC11.bpi dclcxEditorsC11.bpi designide.bpi +SPARELIBS = +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressScheduler 3 by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerC11.cpp b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerC11.cpp new file mode 100644 index 00000000..c85c6a6a --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerC11.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dclcxSchedulerC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("cxExportC11.bpi"); +USEPACKAGE("cxSchedulerC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("dclcxEditorsC11.bpi"); +USEPACKAGE("designide.bpi"); +USEUNIT("cxSchedulerReg.pas"); +USERES("cxSchedulerReg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerC11.res b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerC11.res new file mode 100644 index 00000000..f64ef18e Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerC11.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD10.dpk b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD10.dpk new file mode 100644 index 00000000..db6afb47 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD10.dpk @@ -0,0 +1,39 @@ +package dclcxSchedulerD10; + +{$R *.res} +{$R cxSchedulerReg.dcr} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressScheduler 3 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dclcxLibraryD10, + dclcxEditorsD10, + cxSchedulerD10; + +contains + cxSchedulerReg; + +end. diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD10.res b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD10.res new file mode 100644 index 00000000..28c22894 Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD10.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD11.dpk b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD11.dpk new file mode 100644 index 00000000..1d4d1de3 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD11.dpk @@ -0,0 +1,39 @@ +package dclcxSchedulerD11; + +{$R *.res} +{$R cxSchedulerReg.dcr} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressScheduler 3 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dclcxLibraryD11, + dclcxEditorsD11, + cxSchedulerD11; + +contains + cxSchedulerReg; + +end. diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD11.res b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD11.res new file mode 100644 index 00000000..f5f93413 Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD11.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD7.dpk b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD7.dpk new file mode 100644 index 00000000..cf043666 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD7.dpk @@ -0,0 +1,39 @@ +package dclcxSchedulerD7; + +{$R *.res} +{$R cxSchedulerReg.dcr} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressScheduler 3 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dclcxLibraryVCLD7, + dclcxEditorsVCLD7, + cxSchedulerD7; + +contains + cxSchedulerReg; + +end. diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD7.res b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD7.res new file mode 100644 index 00000000..45294b94 Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD7.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD9.dpk b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD9.dpk new file mode 100644 index 00000000..2956d262 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD9.dpk @@ -0,0 +1,39 @@ +package dclcxSchedulerD9; + +{$R *.res} +{$R cxSchedulerReg.dcr} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressScheduler 3 by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dclcxLibraryD9, + dclcxEditorsD9, + cxSchedulerD9; + +contains + cxSchedulerReg; + +end. diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD9.res b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD9.res new file mode 100644 index 00000000..f107583b Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerD9.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridC11.bpk b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridC11.bpk new file mode 100644 index 00000000..97b4d920 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridC11.bpk @@ -0,0 +1,196 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxSchedulerGridC11.bpl +OBJFILES = dclcxSchedulerGridC11.obj cxSchedulercxGridConnectionReg.obj +RESFILES = dclcxSchedulerGridC11.res +MAINSOURCE = dclcxSchedulerGridC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = cxDataC11.bpi cxEditorsC11.bpi cxGridC11.bpi dclcxGridC11.bpi dclcxLibraryC11.bpi designide.bpi rtl.bpi vcl.bpi \ + dbrtl.bpi vcldb.bpi cxLibraryC11.bpi cxExtEditorsC11.bpi cxPageControlC11.bpi dxThemeC11.bpi cxSchedulerC11.bpi \ + dclcxEditorsC11.bpi dclcxSchedulerC11.bpi +SPARELIBS = rtl.lib vcl.lib dclcxLibraryC11.lib CXLIBRARYC11.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) +LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;"$(SEARCHPATH)";$(LIBDIR) +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I$(BCB)\include -I$(BCB)\include\vcl -I"$(SEARCHPATH)";$(LIBDIR) -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressScheduler 3 connection to ExpressQuantumGrid by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridC11.cpp b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridC11.cpp new file mode 100644 index 00000000..1192ea30 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridC11.cpp @@ -0,0 +1,35 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dclcxSchedulerGridC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("vcldb.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("cxExtEditorsC11.bpi"); +USEPACKAGE("cxGridC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("cxSchedulerC11.bpi"); +USEPACKAGE("dclcxEditorsC11.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEPACKAGE("dclcxSchedulerC11.bpi"); +USEPACKAGE("cxPageControlC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEUNIT("cxSchedulercxGridConnectionReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridC11.res b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridC11.res new file mode 100644 index 00000000..0e643d15 Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridC11.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD10.dpk b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD10.dpk new file mode 100644 index 00000000..b606287a --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD10.dpk @@ -0,0 +1,39 @@ +package dclcxSchedulerGridD10; + +{$R *.res} +{$R cxSchedulerReg.dcr} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressScheduler 3 connection to ExpressQuantumGrid by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + cxSchedulerGridD10, + dclcxSchedulerD10; + +contains + cxSchedulercxGridConnectionReg; + + +end. diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD10.res b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD10.res new file mode 100644 index 00000000..fc7862f4 Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD10.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD11.dpk b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD11.dpk new file mode 100644 index 00000000..06aa82e3 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD11.dpk @@ -0,0 +1,39 @@ +package dclcxSchedulerGridD11; + +{$R *.res} +{$R cxSchedulerReg.dcr} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressScheduler 3 connection to ExpressQuantumGrid by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + cxSchedulerGridD11, + dclcxSchedulerD11; + +contains + cxSchedulercxGridConnectionReg; + + +end. diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD11.res b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD11.res new file mode 100644 index 00000000..8ae04496 Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD11.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD6.dpk b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD6.dpk new file mode 100644 index 00000000..110ce415 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD6.dpk @@ -0,0 +1,39 @@ +package dclcxSchedulerGridD6; + +{$R *.res} +{$R cxSchedulerReg.dcr} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressScheduler 3 connection to ExpressQuantumGrid by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + cxSchedulerGridD6, + dclcxSchedulerD6; + +contains + cxSchedulercxGridConnectionReg; + + +end. diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD6.res b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD6.res new file mode 100644 index 00000000..b158dabe Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD6.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD7.dpk b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD7.dpk new file mode 100644 index 00000000..0bf6415d --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD7.dpk @@ -0,0 +1,39 @@ +package dclcxSchedulerGridD7; + +{$R *.res} +{$R cxSchedulerReg.dcr} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressScheduler 3 connection to ExpressQuantumGrid by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + cxSchedulerGridD7, + dclcxSchedulerD7; + +contains + cxSchedulercxGridConnectionReg; + + +end. diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD7.res b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD7.res new file mode 100644 index 00000000..f07a61d3 Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD7.res differ diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD9.dpk b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD9.dpk new file mode 100644 index 00000000..21968a77 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD9.dpk @@ -0,0 +1,39 @@ +package dclcxSchedulerGridD9; + +{$R *.res} +{$R cxSchedulerReg.dcr} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressScheduler 3 connection to ExpressQuantumGrid by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + cxSchedulerGridD9, + dclcxSchedulerD9; + +contains + cxSchedulercxGridConnectionReg; + + +end. diff --git a/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD9.res b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD9.res new file mode 100644 index 00000000..bf7cceee Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Packages/dclcxSchedulerGridD9.res differ diff --git a/official/x.35/ExpressScheduler 3/Sources/cxDateNavigator.pas b/official/x.35/ExpressScheduler 3/Sources/cxDateNavigator.pas new file mode 100644 index 00000000..cef79062 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxDateNavigator.pas @@ -0,0 +1,1218 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxDateNavigator; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, Classes, Controls, Graphics, cxContainer, cxGeometry, + cxControls, cxSchedulerUtils, cxSchedulerStorage, cxSchedulerCustomControls, + Math, cxSchedulerDateNavigator, cxSchedulerDayView, cxDateUtils; + +type + TcxCustomDateNavigator = class; + + { TcxInnerDateNavigator } + + TcxInnerDateNavigator = class(TcxCustomScheduler, IUnknown, IcxContainerInnerControl) + private + FPrevDate: TDateTime; + FPrevCopyDragDrop: Boolean; + // IcxContainerInnerControl + function GetControl: TWinControl; + function GetControlContainer: TcxContainer; + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + procedure WMKillFocus(var Message: TWMKillFocus); message WM_KILLFOCUS; + procedure WMSetFocus(var Message: TWMSetFocus); message WM_SETFOCUS; + protected + FSelAnchor, FSelStart: Integer; + FContainer: TcxCustomDateNavigator; + procedure CalcLayout; override; + function CanDrag(X, Y: Integer): Boolean; override; + function CanSelectPeriod: Boolean; override; + procedure CheckSplittersVisibilityChanging; override; + procedure Click; override; + function CreateDefaultView: TcxSchedulerCustomView; override; + function CreateDateNavigator: TcxSchedulerCustomDateNavigator; override; + procedure DateNavigatorSelectionChanged; override; + procedure DblClick; override; + function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; override; + procedure DoStartDrag(var DragObject: TDragObject); override; + procedure DragCanceled; override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); override; + function GetDesignHitTest(X, Y: Integer; Shift: TShiftState): Boolean; override; + function GetOnShowDateHint: TcxSchedulerShowDateHintEvent; override; + function HitAtDate(X, Y: Integer): Boolean; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure WndProc(var Message: TMessage); override; + procedure SetSelection(ADelta: Integer); + procedure SetSelectionDays(ADate: Integer; ACheckEnd: Boolean); + property Container: TcxCustomDateNavigator read FContainer; + public + constructor Create(AOwner: TComponent); override; + procedure DragDrop(Source: TObject; X, Y: Integer); override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + function UpdateAction(Action: TBasicAction): Boolean; override; +{$IFDEF DELPHI5} + function CanFocus: Boolean; override; +{$ENDIF} + property Align; + property Anchors; + property BorderStyle; + property Color; + property Ctl3D; + property Cursor; + property Enabled; + property Font; + property ParentColor; + property ParentCtl3D; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property TabOrder; + property TabStop default True; + property Visible; + property OnClick; + property OnEnter; + property OnExit; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnDblClick; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + end; + + { TcxCustomDateNavigator } + + TcxCustomDateNavigator = class(TcxContainer, IUnknown, IcxSchedulerStorageListener, + IcxExternalDateNavigatorListener) + private + FInnerDateNavigator: TcxInnerDateNavigator; + FIsExitProcessing: Boolean; + FLockUpdate: Integer; + FScheduler: TcxCustomScheduler; + FStorage: TcxCustomSchedulerStorage; + FUnlimitedSelection: Boolean; + function GetActualStartOfWeek: TDay; + function GetBorderStyle: TcxControlBorderStyle; + function GetColCount: Integer; + function GetCustomDrawBackground: TcxSchedulerDateNavigatorCustomDrawBackgroundEvent; + function GetCustomDrawDayCaption: TcxSchedulerDateNavigatorCustomDrawDayCaptionEvent; + function GetCustomDrawDayNumber: TcxSchedulerDateNavigatorCustomDrawDayNumberEvent; + function GetCustomDrawContent: TcxSchedulerDateNavigatorCustomDrawContentEvent; + function GetCustomDrawHeader: TcxSchedulerDateNavigatorCustomDrawHeaderEvent; + function GetDate: TDateTime; + function GetDateNavigator: TcxSchedulerDateNavigator; + function GetEventDays: TcxSchedulerDateList; + function GetFirstDate: TDateTime; + function GetFirstWeekOfYear: TcxFirstWeekOfYear; + function GetFont: TFont; + function GetHitTest: TcxSchedulerDateNavigatorHitTest; + function GetHolidayColor: TColor; + function GetLastDate: TDateTime; + function GetPeriodChanged: TcxSchedulerPeriodChangedEvent; + function GetRealFirstDate: TDateTime; + function GetRealLastDate: TDateTime; + function GetRowCount: Integer; + function GetSelectedDays: TcxSchedulerDateList; + function GetSelectionChanged: TcxSchedulerPeriodChangedEvent; + function GetSelectionIsWeeks: Boolean; + function GetSelectPeriod: Boolean; + function GetShowDatesContainingEventsInBold: Boolean; + function GetShowDatesContainingHolidaysInColor: Boolean; + function GetShowWeekNumbers: Boolean; + function GetStartOfWeek: TcxStartOfWeek; + function GetStyles: TcxSchedulerDateNavigatorStyles; + procedure SetBorderStyle(AValue: TcxControlBorderStyle); + procedure SetColCount(AValue: Integer); + procedure SetCustomDrawBackground(AValue: TcxSchedulerDateNavigatorCustomDrawBackgroundEvent); + procedure SetCustomDrawDayCaption(AValue: TcxSchedulerDateNavigatorCustomDrawDayCaptionEvent); + procedure SetCustomDrawDayNumber(AValue: TcxSchedulerDateNavigatorCustomDrawDayNumberEvent); + procedure SetCustomDrawContent(AValue: TcxSchedulerDateNavigatorCustomDrawContentEvent); + procedure SetCustomDrawHeader(AValue: TcxSchedulerDateNavigatorCustomDrawHeaderEvent); + procedure SetDate(AValue: TDateTime); + procedure SetFirstDate(AValue: TDateTime); + procedure SetFirstWeekOfYear(AValue: TcxFirstWeekOfYear); + procedure SetFont(AValue: TFont); + procedure SetHolidayColor(AValue: TColor); + procedure SetPeriodChanged(AValue: TcxSchedulerPeriodChangedEvent); + procedure SetRowCount(AValue: Integer); + procedure SetScheduler(AValue: TcxCustomScheduler); + procedure SetSelectionChanged(AValue: TcxSchedulerPeriodChangedEvent); + procedure SetSelectionIsWeeks(AValue: Boolean); + procedure SetSelectPeriod(AValue: Boolean); + procedure SetShowDatesContainingEventsInBold(AValue: Boolean); + procedure SetShowDatesContainingHolidaysInColor(AValue: Boolean); + procedure SetShowWeekNumbers(AValue: Boolean); + procedure SetStartOfWeek(AValue: TcxStartOfWeek); + procedure SetStorage(AValue: TcxCustomSchedulerStorage); + procedure SetStyles(AValue: TcxSchedulerDateNavigatorStyles); + procedure SetUnlimitedSelection(AValue: Boolean); + + procedure IcxExternalDateNavigatorListener.StorageChanged = SchedulerStorageChanged; + protected + function CanDrag(X, Y: Integer): Boolean; override; + function CanSelectPeriod: Boolean; + procedure DateNavigatorSelectionChanged; virtual; + procedure DoExit; override; + procedure DefineProperties(Filer: TFiler); override; + function GetActualStorage: TcxCustomSchedulerStorage; + procedure Loaded; override; + function NeedsScrollBars: Boolean; override; + procedure UpdateStorage; + + // IcxExternalDateNavigatorListener + procedure SchedulerStorageChanged; + procedure SchedulerChanged; + procedure SchedulerRemoved; + + // IcxSchedulerStorageListener + procedure StorageChanged(Sender: TObject); virtual; + procedure StorageRemoved(Sender: TObject); virtual; + + property BorderStyle: TcxControlBorderStyle read GetBorderStyle write SetBorderStyle default cxcbsDefault; + property ColCount: Integer read GetColCount write SetColCount default 1; + property DateNavigator: TcxSchedulerDateNavigator read GetDateNavigator; + property DragMode default dmAutomatic; + property EventDays: TcxSchedulerDateList read GetEventDays; + property FirstWeekOfYear: TcxFirstWeekOfYear + read GetFirstWeekOfYear write SetFirstWeekOfYear default fwySystem; + property Font: TFont read GetFont write SetFont; + property HitTest: TcxSchedulerDateNavigatorHitTest read GetHitTest; + property HolidayColor: TColor read GetHolidayColor write SetHolidayColor default clRed; + property ParentFont default False; + property RowCount: Integer read GetRowCount write SetRowCount default 1; + property Scheduler: TcxCustomScheduler read FScheduler write SetScheduler; + property SelectedDays: TcxSchedulerDateList read GetSelectedDays; + property ShowDatesContainingEventsInBold: Boolean + read GetShowDatesContainingEventsInBold write SetShowDatesContainingEventsInBold default True; + property ShowDatesContainingHolidaysInColor: Boolean + read GetShowDatesContainingHolidaysInColor write SetShowDatesContainingHolidaysInColor default False; + property ShowWeekNumbers: Boolean read GetShowWeekNumbers write SetShowWeekNumbers default True; + property StartOfWeek: TcxStartOfWeek read GetStartOfWeek write SetStartOfWeek default swSystem; + property Storage: TcxCustomSchedulerStorage read FStorage write SetStorage; + property Styles: TcxSchedulerDateNavigatorStyles read GetStyles write SetStyles; + + property OnPeriodChanged: TcxSchedulerPeriodChangedEvent read GetPeriodChanged write SetPeriodChanged; + property OnSelectionChanged: TcxSchedulerPeriodChangedEvent read GetSelectionChanged write SetSelectionChanged; + property OnCustomDrawBackground: TcxSchedulerDateNavigatorCustomDrawBackgroundEvent + read GetCustomDrawBackground write SetCustomDrawBackground; + property OnCustomDrawContent: TcxSchedulerDateNavigatorCustomDrawContentEvent + read GetCustomDrawContent write SetCustomDrawContent; + property OnCustomDrawDayNumber: TcxSchedulerDateNavigatorCustomDrawDayNumberEvent + read GetCustomDrawDayNumber write SetCustomDrawDayNumber; + property OnCustomDrawDayCaption: TcxSchedulerDateNavigatorCustomDrawDayCaptionEvent + read GetCustomDrawDayCaption write SetCustomDrawDayCaption; + property OnCustomDrawHeader: TcxSchedulerDateNavigatorCustomDrawHeaderEvent + read GetCustomDrawHeader write SetCustomDrawHeader; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function ExecuteAction(Action: TBasicAction): Boolean; override; + function UpdateAction(Action: TBasicAction): Boolean; override; + function CalcSize(AColCount, ARowCount: Integer): TRect; + procedure LayoutChanged; + procedure SetFocus; override; + property ActualStartOfWeek: TDay read GetActualStartOfWeek; + property Date: TDateTime read GetDate write SetDate; + property FirstDate: TDateTime read GetFirstDate write SetFirstDate; + property InnerDateNavigator: TcxInnerDateNavigator read FInnerDateNavigator; + property LastDate: TDateTime read GetLastDate; + property RealFirstDate: TDateTime read GetRealFirstDate; + property RealLastDate: TDateTime read GetRealLastDate; + property SelectionIsWeeks: Boolean read GetSelectionIsWeeks write SetSelectionIsWeeks; + property SelectPeriod: Boolean read GetSelectPeriod write SetSelectPeriod default True; + property UnlimitedSelection: Boolean read FUnlimitedSelection write SetUnlimitedSelection default False; + end; + + { TcxDateNavigator } + + TcxDateNavigator = class(TcxCustomDateNavigator) + public + property ColCount; + property EventDays; + property HitTest; + property RowCount; + property SelectedDays; + published + property Align; + property Anchors; + property BorderStyle; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property FirstWeekOfYear; + property Font; + property HolidayColor; + property LookAndFeel; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property Scheduler; + property SelectPeriod; + property ShowDatesContainingEventsInBold; + property ShowDatesContainingHolidaysInColor; + property ShowWeekNumbers; + property StartOfWeek; + property Storage; + property Styles; + property TabOrder; + property TabStop; + property UnlimitedSelection; + property Visible; + + property OnClick; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnCustomDrawBackground; + property OnCustomDrawContent; + property OnCustomDrawDayCaption; + property OnCustomDrawDayNumber; + property OnCustomDrawHeader; + property OnPeriodChanged; + property OnSelectionChanged; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnMouseWheel; + property OnMouseWheelDown; + property OnMouseWheelUp; + property OnResize; + property OnStartDock; + property OnStartDrag; + end; + +implementation + +uses + SysUtils, cxClasses, cxEdit, cxScrollBar {$IFDEF DELPHI6} ,DateUtils {$ENDIF}; + +type + TcxDateNavigatorAccess = class(TcxSchedulerDateNavigator); + TcxCustomSchedulerAccess = class(TcxCustomScheduler); + +function DateCompare(AItem1, AItem2: Pointer): Integer; +begin + Result := Integer(AItem2) - Integer(AItem1); +end; + +{ TcxInnerDateNavigator } + +constructor TcxInnerDateNavigator.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FSelAnchor := NullDate; + CurrentView.CanShow := False; + ControlBox.Visible := False; + BorderStyle := cxcbsDefault; + ControlStyle := ControlStyle + [csDoubleClicks]; + ParentColor := False; + OptionsView.ShowEventsWithoutResource := True; + OptionsView.GroupingKind := gkNone; +end; + +procedure TcxInnerDateNavigator.DragDrop(Source: TObject; X, Y: Integer); +begin + try + if Container <> nil then + begin + Container.DragDrop(Source, Left + X, Top + Y); + if Container.DragMode <> dmAutomatic then Exit; + end; + if (Source is TcxSchedulerDragObject) and HitAtDate(X, Y) then + TcxSchedulerDragObject(Source).DropToDateNavigator(DateNavigator); + finally + TcxDateNavigatorAccess(DateNavigator).Controller.DragDate := NullDate; + end; +end; + +function TcxInnerDateNavigator.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action); +end; + +function TcxInnerDateNavigator.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action); +end; + +{$IFDEF DELPHI5} +function TcxInnerDateNavigator.CanFocus: Boolean; +begin + Result := Container.CanFocusEx; +end; +{$ENDIF} + +procedure TcxInnerDateNavigator.CalcLayout; +begin + DateNavigator.Bounds := ClientBounds; +end; + +function TcxInnerDateNavigator.CanDrag(X, Y: Integer): Boolean; +begin + Result := False; +end; + +function TcxInnerDateNavigator.CanSelectPeriod: Boolean; +begin + if Container <> nil then + Result := Container.CanSelectPeriod + else + Result := True; +end; + +procedure TcxInnerDateNavigator.CheckSplittersVisibilityChanging; +begin +end; + +procedure TcxInnerDateNavigator.Click; +begin + inherited Click; + if Container <> nil then + Container.Click; +end; + +function TcxInnerDateNavigator.CreateDefaultView: TcxSchedulerCustomView; +begin + Result := TcxSchedulerDayView.Create(Self); +end; + +function TcxInnerDateNavigator.CreateDateNavigator: TcxSchedulerCustomDateNavigator; +begin + Result := TcxSchedulerDateNavigator.Create(Self); +end; + +procedure TcxInnerDateNavigator.DateNavigatorSelectionChanged; +begin + if Container <> nil then + begin + Container.DateNavigatorSelectionChanged; + if Container.Scheduler <> nil then + inherited DateNavigatorSelectionChanged; + end; +end; + +procedure TcxInnerDateNavigator.DblClick; +begin + inherited DblClick; + if Container <> nil then + Container.DblClick; +end; + +function TcxInnerDateNavigator.DoMouseWheel(Shift: TShiftState; + WheelDelta: Integer; MousePos: TPoint): Boolean; +begin + Result := (Container <> nil) and Container.DoMouseWheel(Shift, + WheelDelta, MousePos); + if not Result then + inherited DoMouseWheel(Shift, WheelDelta, MousePos); +end; + +procedure TcxInnerDateNavigator.DoStartDrag(var DragObject: TDragObject); +begin + FPrevDate := NullDate; + FPrevCopyDragDrop := IsCopyDragDrop; + inherited; +end; + +procedure TcxInnerDateNavigator.DragCanceled; +begin + TcxDateNavigatorAccess(DateNavigator).Controller.DragDate := NullDate; + Invalidate; +end; + +procedure TcxInnerDateNavigator.DragOver(Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); +var + AAccept, ACopyDragDrop: Boolean; + ADate: TDateTime; +begin + AAccept := HitAtDate(X, Y); + if AAccept and (Source is TcxSchedulerDragObject) then + begin + ADate := TcxSchedulerDateNavigator(DateNavigator).HitTest.Time; + ACopyDragDrop := IsCopyDragDrop; + if (ADate <> FPrevDate) or (ACopyDragDrop <> FPrevCopyDragDrop) then + begin + TcxSchedulerDragObject(Source).CalculateConflictsForDateNavigator(DateNavigator); + FPrevDate := ADate; + FPrevCopyDragDrop := ACopyDragDrop; + end; + AAccept := not TcxSchedulerDragObject(Source).HasConflicts; + end; + if Container <> nil then + Container.DragOver(Source, Left + X, Top + Y, State, Accept); + if Container.DragMode = dmAutomatic then + begin + if not Accept and AAccept and Assigned(Container.OnDragOver) then + AAccept := False; + Accept := AAccept or Accept; + end; + UpdateDateNavigatorDragging(State <> dsDragLeave); +end; + +function TcxInnerDateNavigator.GetDesignHitTest(X, Y: Integer; + Shift: TShiftState): Boolean; +begin + Result := GetAsyncKeyState(VK_MENU) < 0; +end; + +function TcxInnerDateNavigator.GetOnShowDateHint: TcxSchedulerShowDateHintEvent; +begin + Result := nil; + if (FContainer <> nil) and (FContainer.Scheduler <> nil) then + Result := TcxCustomSchedulerAccess(FContainer.Scheduler).OnShowDateHint; +end; + +function TcxInnerDateNavigator.HitAtDate(X, Y: Integer): Boolean; +begin + with TcxSchedulerDateNavigator(DateNavigator).HitTest do + begin + HitPoint := Point(X, Y); + Result := HitAtTime; + end; +end; + +procedure TcxInnerDateNavigator.KeyDown(var Key: Word; Shift: TShiftState); +const + AShift: array[Boolean] of Integer = (1, -1); +begin + if Container <> nil then + Container.KeyDown(Key, Shift); + if Key <> 0 then + inherited KeyDown(Key, Shift); + if (ssShift in Shift) and (Key in [VK_LEFT..VK_DOWN]) and (FSelAnchor = NullDate) then + begin + FSelStart := Trunc(SelectedDays[0]); + FSelAnchor := FSelStart; + end; + case Key of + VK_LEFT, VK_RIGHT: + begin + if (ssShift in Shift) and TcxDateNavigatorAccess(DateNavigator).SelectPeriod then + SetSelectionDays(FSelAnchor - AShift[Key = VK_RIGHT], Key = VK_RIGHT) + else + SetSelection(AShift[Key = VK_RIGHT]); + Invalidate; + end; + VK_UP, VK_DOWN: + begin + if (ssShift in Shift) and TcxDateNavigatorAccess(DateNavigator).SelectPeriod then + SetSelectionDays(FSelAnchor - AShift[Key = VK_DOWN] * 7, Key = VK_DOWN) + else + SetSelection(AShift[Key = VK_DOWN] * 7); + Invalidate; + end; + end; + Container.LayoutChanged; +end; + +procedure TcxInnerDateNavigator.KeyPress(var Key: Char); +begin + if Key = Char(VK_TAB) then + Key := #0; + if Container <> nil then + Container.KeyPress(Key); + if Word(Key) = VK_RETURN then + Key := #0; + if Key <> #0 then + inherited KeyPress(Key); +end; + +procedure TcxInnerDateNavigator.KeyUp(var Key: Word; Shift: TShiftState); +begin + if Key = VK_TAB then + Key := 0; + if Container <> nil then + Container.KeyUp(Key, Shift); + if Key <> 0 then + inherited KeyUp(Key, Shift); +end; + +procedure TcxInnerDateNavigator.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + FSelAnchor := NullDate; + inherited MouseDown(Button, Shift, X, Y); + if Container <> nil then + with Container do + begin + InnerControlMouseDown := True; + try + MouseDown(Button, Shift, X + Self.Left, Y + Self.Top); + finally + InnerControlMouseDown := False; + end; + end; +end; + +procedure TcxInnerDateNavigator.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + if Container <> nil then + Container.MouseMove(Shift, X + Left, Y + Top); +end; + +procedure TcxInnerDateNavigator.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + if Container <> nil then + Container.MouseUp(Button, Shift, X + Left, Y + Top); +end; + +procedure TcxInnerDateNavigator.SetSelection(ADelta: Integer); +begin + if FSelAnchor <> NullDate then + begin + SelectedDays.Clear; + SelectedDays.Add(FSelAnchor - ADelta); + FSelAnchor := NullDate; + TcxDateNavigatorAccess(DateNavigator).UpdateSelection; + end + else + TcxDateNavigatorAccess(DateNavigator).ScrollSelection(ADelta) +end; + +procedure TcxInnerDateNavigator.SetSelectionDays( + ADate: Integer; ACheckEnd: Boolean); + + function WeekOf(ADate: TDateTime): Word; + var + AYear, ADay: Word; + begin + DecodeDateWeek(ADate, AYear, Result, ADay); + end; + +var + I: Integer; +begin + if not Container.UnlimitedSelection then + begin + if (TcxDateNavigatorAccess(DateNavigator).SelectionIsWeeks and + (WeekOf(Max(FSelStart, ADate)) - WeekOf(Min(FSelStart, ADate)) > cxMaxWeekCount)) or + (not TcxDateNavigatorAccess(DateNavigator).SelectionIsWeeks and + (Max(FSelStart, ADate) - Min(FSelStart, ADate) > 14)) then Exit; + end; + FSelAnchor := ADate; + SelectedDays.Clear; + for I := Min(FSelStart, FSelAnchor) to Max(FSelStart, FSelAnchor) do + SelectedDays.Add(I); + TcxDateNavigatorAccess(DateNavigator).UpdateSelection; + if (SelectedDays[SelectedDays.Count - 1] = ADate) then + while (ADate > TcxDateNavigatorAccess(DateNavigator).LastDate) do + TcxDateNavigatorAccess(DateNavigator).FirstDate := TcxDateNavigatorAccess(DateNavigator).FirstDate + 31; + TcxDateNavigatorAccess(DateNavigator).DoSelectionChangedEvent; +end; + +procedure TcxInnerDateNavigator.WndProc(var Message: TMessage); +begin + if (Container <> nil) and Container.InnerControlMenuHandler(Message) then + Exit; + +{$IFNDEF DELPHI5} + if Message.Msg = WM_RBUTTONDOWN then + begin + Container.LockPopupMenu(True); + try + inherited WndProc(Message); + finally + Container.LockPopupMenu(False); + end; + Exit; + end; +{$ENDIF} + + { if Container <> nil then + if ((Message.Msg = WM_LBUTTONDOWN) or (Message.Msg = WM_LBUTTONDBLCLK)) and + (Container.DragMode = dmAutomatic) and not Container.IsDesigning then + begin + Container.BeginAutoDrag; + Exit; + end;} + + inherited WndProc(Message); +end; + +function TcxInnerDateNavigator.GetControl: TWinControl; +begin + Result := Self; +end; + +function TcxInnerDateNavigator.GetControlContainer: TcxContainer; +begin + Result := FContainer; +end; + +procedure TcxInnerDateNavigator.WMGetDlgCode(var Message: TWMGetDlgCode); +begin + inherited; + if Container <> nil then + with Message do + begin + Result := Result or DLGC_WANTCHARS; + if GetKeyState(VK_CONTROL) >= 0 then + Result := Result or DLGC_WANTTAB; + end; +end; + +procedure TcxInnerDateNavigator.WMKillFocus(var Message: TWMKillFocus); +begin + inherited; + if (Container <> nil) and not Container.IsDestroying then + Container.FocusChanged; +end; + +procedure TcxInnerDateNavigator.WMSetFocus(var Message: TWMSetFocus); +begin + inherited; + if (Container <> nil) and not Container.IsDestroying and not(csDestroying in ComponentState) + and (Message.FocusedWnd <> Container.Handle) then + Container.FocusChanged; +end; + +{ TcxCustomDateNavigator } + +constructor TcxCustomDateNavigator.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + DragMode := dmAutomatic; + ParentFont := False; + LookAndFeel.MasterLookAndFeel := nil; + FInnerDateNavigator := TcxInnerDateNavigator.Create(Self); + with FInnerDateNavigator do + begin + FContainer := Self; + LookAndFeel.MasterLookAndFeel := Self.LookAndFeel; + Parent := Self; + end; + InnerControl := FInnerDateNavigator; + with CalcSize(1, 1) do + begin + Width := Right; + Height := Bottom; + end; + Style.Font := FInnerDateNavigator.Font; + Style.BorderStyle := cbsNone; + Style.HotTrack := False; + Style.TransparentBorder := False; +end; + +destructor TcxCustomDateNavigator.Destroy; +begin + Storage := nil; + Scheduler := nil; + FreeAndNil(FInnerDateNavigator); + inherited Destroy; +end; + +function TcxCustomDateNavigator.ExecuteAction(Action: TBasicAction): Boolean; +begin + Result := inherited ExecuteAction(Action); +end; + +function TcxCustomDateNavigator.UpdateAction(Action: TBasicAction): Boolean; +begin + Result := inherited UpdateAction(Action); +end; + +function TcxCustomDateNavigator.CalcSize(AColCount, ARowCount: Integer): TRect; +begin + with TcxDateNavigatorAccess(DateNavigator) do + begin + DoLayoutChanged; + Result := Rect(0, 0, GetMonthSize.CX * AColCount, GetMonthSize.CY * ARowCount); + end; + with GetBorderExtent do + begin + Inc(Result.Right, Left + Right); + Inc(Result.Bottom, Bottom + Top); + end; +end; + +procedure TcxCustomDateNavigator.LayoutChanged; +begin + FInnerDateNavigator.LayoutChanged; +end; + +procedure TcxCustomDateNavigator.SetFocus; +begin + if not IsDesigning then + inherited SetFocus; +end; + +function TcxCustomDateNavigator.CanDrag(X, Y: Integer): Boolean; +begin + Result := False; +end; + +function TcxCustomDateNavigator.CanSelectPeriod: Boolean; +begin + if Scheduler <> nil then + Result := TcxDateNavigatorAccess(FScheduler.DateNavigator).CanMultiSelect + else + Result := True; +end; + +procedure TcxCustomDateNavigator.DateNavigatorSelectionChanged; +begin + if Assigned(FScheduler) and (FLockUpdate = 0) then + begin + Inc(FLockUpdate); + try + TcxSchedulerDateNavigator(FScheduler.DateNavigator).AssignProperties( + TcxSchedulerDateNavigator(FInnerDateNavigator.DateNavigator)); + finally + TcxDateNavigatorAccess(FScheduler.DateNavigator).MakeSelectionVisible; + Dec(FLockUpdate); + end; + end; +end; + +procedure TcxCustomDateNavigator.DoExit; +begin + if IsDestroying or FIsExitProcessing then + Exit; + FIsExitProcessing := True; + try + inherited DoExit; + finally + FIsExitProcessing := False; + end; +end; + +procedure TcxCustomDateNavigator.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + with FInnerDateNavigator do DefineProperties(Filer); +end; + +function TcxCustomDateNavigator.GetActualStorage: TcxCustomSchedulerStorage; +begin + Result := FStorage; + if Scheduler <> nil then + Result := Scheduler.Storage; +end; + +procedure TcxCustomDateNavigator.Loaded; +begin + inherited Loaded; + FInnerDateNavigator.Loaded; +end; + +function TcxCustomDateNavigator.NeedsScrollBars: Boolean; +begin + Result := False; +end; + +procedure TcxCustomDateNavigator.UpdateStorage; +begin + FInnerDateNavigator.Storage := GetActualStorage; + UnlimitedSelection := UnlimitedSelection; +end; + +procedure TcxCustomDateNavigator.SchedulerStorageChanged; +begin + UpdateStorage; +end; + +procedure TcxCustomDateNavigator.SchedulerChanged; +begin + if FLockUpdate <> 0 then Exit; + Inc(FLockUpdate); + try + TcxSchedulerDateNavigator(InnerDateNavigator.DateNavigator + ).AssignProperties(TcxSchedulerDateNavigator(FScheduler.DateNavigator)); + InnerDateNavigator.FullRefresh; + finally + TcxDateNavigatorAccess(InnerDateNavigator.DateNavigator).MakeSelectionVisible; + Dec(FLockUpdate); + Update; + end; +end; + +procedure TcxCustomDateNavigator.SchedulerRemoved; +begin + FScheduler := nil; + UpdateStorage; +end; + +procedure TcxCustomDateNavigator.StorageChanged(Sender: TObject); +begin +end; + +procedure TcxCustomDateNavigator.StorageRemoved(Sender: TObject); +begin + FStorage := nil; +end; + +function TcxCustomDateNavigator.GetActualStartOfWeek: TDay; +begin + Result := FInnerDateNavigator.OptionsView.ActualStartOfWeek; +end; + +function TcxCustomDateNavigator.GetBorderStyle: TcxControlBorderStyle; +begin + Result := FInnerDateNavigator.BorderStyle; +end; + +function TcxCustomDateNavigator.GetColCount: Integer; +begin + Result := DateNavigator.ColCount; +end; + +function TcxCustomDateNavigator.GetCustomDrawBackground: TcxSchedulerDateNavigatorCustomDrawBackgroundEvent; +begin + Result := DateNavigator.OnCustomDrawBackground; +end; + +function TcxCustomDateNavigator.GetCustomDrawDayCaption: TcxSchedulerDateNavigatorCustomDrawDayCaptionEvent; +begin + Result := DateNavigator.OnCustomDrawDayCaption; +end; + +function TcxCustomDateNavigator.GetCustomDrawDayNumber: TcxSchedulerDateNavigatorCustomDrawDayNumberEvent; +begin + Result := DateNavigator.OnCustomDrawDayNumber; +end; + +function TcxCustomDateNavigator.GetCustomDrawContent: TcxSchedulerDateNavigatorCustomDrawContentEvent; +begin + Result := DateNavigator.OnCustomDrawContent; +end; + +function TcxCustomDateNavigator.GetCustomDrawHeader: TcxSchedulerDateNavigatorCustomDrawHeaderEvent; +begin + Result := DateNavigator.OnCustomDrawHeader; +end; + +function TcxCustomDateNavigator.GetDate: TDateTime; +begin + Result := DateNavigator.Date; +end; + +function TcxCustomDateNavigator.GetDateNavigator: TcxSchedulerDateNavigator; +begin + Result := TcxSchedulerDateNavigator(FInnerDateNavigator.DateNavigator); +end; + +function TcxCustomDateNavigator.GetEventDays: TcxSchedulerDateList; +begin + Result := FInnerDateNavigator.EventDays; +end; + +function TcxCustomDateNavigator.GetFirstDate: TDateTime; +begin + Result := DateNavigator.FirstDate; +end; + +function TcxCustomDateNavigator.GetFirstWeekOfYear: TcxFirstWeekOfYear; +begin + Result := DateNavigator.FirstWeekOfYear; +end; + +function TcxCustomDateNavigator.GetFont: TFont; +begin + Result := Style.Font; +end; + +function TcxCustomDateNavigator.GetHitTest: TcxSchedulerDateNavigatorHitTest; +begin + Result := DateNavigator.HitTest; +end; + +function TcxCustomDateNavigator.GetHolidayColor: TColor; +begin + Result := DateNavigator.HolidayColor; +end; + +function TcxCustomDateNavigator.GetLastDate: TDateTime; +begin + Result := DateNavigator.LastDate; +end; + +function TcxCustomDateNavigator.GetPeriodChanged: TcxSchedulerPeriodChangedEvent; +begin + Result := DateNavigator.OnPeriodChanged; +end; + +function TcxCustomDateNavigator.GetRealFirstDate: TDateTime; +begin + Result := DateNavigator.RealFirstDate; +end; + +function TcxCustomDateNavigator.GetRealLastDate: TDateTime; +begin + Result := DateNavigator.RealLastDate; +end; + +function TcxCustomDateNavigator.GetRowCount: Integer; +begin + Result := DateNavigator.RowCount; +end; + +function TcxCustomDateNavigator.GetSelectionChanged: TcxSchedulerPeriodChangedEvent; +begin + Result := DateNavigator.OnSelectionChanged; +end; + +function TcxCustomDateNavigator.GetSelectionIsWeeks: Boolean; +begin + Result := DateNavigator.SelectionIsWeeks; +end; + +function TcxCustomDateNavigator.GetSelectPeriod: Boolean; +begin + Result := DateNavigator.SelectPeriod; +end; + +function TcxCustomDateNavigator.GetShowDatesContainingEventsInBold: Boolean; +begin + Result := DateNavigator.ShowDatesContainingEventsInBold; +end; + +function TcxCustomDateNavigator.GetShowDatesContainingHolidaysInColor: Boolean; +begin + Result := DateNavigator.ShowDatesContainingHolidaysInColor; +end; + +function TcxCustomDateNavigator.GetSelectedDays: TcxSchedulerDateList; +begin + Result := FInnerDateNavigator.SelectedDays; +end; + +function TcxCustomDateNavigator.GetShowWeekNumbers: Boolean; +begin + Result := DateNavigator.ShowWeekNumbers; +end; + +function TcxCustomDateNavigator.GetStartOfWeek: TcxStartOfWeek; +begin + Result := FInnerDateNavigator.OptionsView.StartOfWeek; +end; + +function TcxCustomDateNavigator.GetStyles: TcxSchedulerDateNavigatorStyles; +begin + Result := DateNavigator.Styles; +end; + +procedure TcxCustomDateNavigator.SetBorderStyle(AValue: TcxControlBorderStyle); +begin + FInnerDateNavigator.BorderStyle := AValue; +end; + +procedure TcxCustomDateNavigator.SetColCount(AValue: Integer); +begin + DateNavigator.ColCount := AValue; +end; + +procedure TcxCustomDateNavigator.SetCustomDrawBackground( + AValue: TcxSchedulerDateNavigatorCustomDrawBackgroundEvent); +begin + DateNavigator.OnCustomDrawBackground := AValue; +end; + +procedure TcxCustomDateNavigator.SetCustomDrawDayCaption( + AValue: TcxSchedulerDateNavigatorCustomDrawDayCaptionEvent); +begin + DateNavigator.OnCustomDrawDayCaption := AValue; +end; + +procedure TcxCustomDateNavigator.SetCustomDrawDayNumber( + AValue: TcxSchedulerDateNavigatorCustomDrawDayNumberEvent); +begin + DateNavigator.OnCustomDrawDayNumber := AValue; +end; + +procedure TcxCustomDateNavigator.SetCustomDrawContent( + AValue: TcxSchedulerDateNavigatorCustomDrawContentEvent); +begin + DateNavigator.OnCustomDrawContent := AValue; +end; + +procedure TcxCustomDateNavigator.SetCustomDrawHeader( + AValue: TcxSchedulerDateNavigatorCustomDrawHeaderEvent); +begin + DateNavigator.OnCustomDrawHeader := AValue; +end; + +procedure TcxCustomDateNavigator.SetDate(AValue: TDateTime); +begin + DateNavigator.Date := AValue; +end; + +procedure TcxCustomDateNavigator.SetFirstDate(AValue: TDateTime); +begin + DateNavigator.FirstDate := AValue; +end; + +procedure TcxCustomDateNavigator.SetFirstWeekOfYear(AValue: TcxFirstWeekOfYear); +begin + DateNavigator.FirstWeekOfYear := AValue; +end; + +procedure TcxCustomDateNavigator.SetFont(AValue: TFont); +begin + Style.Font.Assign(AValue); +end; + +procedure TcxCustomDateNavigator.SetHolidayColor(AValue: TColor); +begin + DateNavigator.HolidayColor := AValue; +end; + +procedure TcxCustomDateNavigator.SetPeriodChanged( + AValue: TcxSchedulerPeriodChangedEvent); +begin + DateNavigator.OnPeriodChanged := AValue; +end; + +procedure TcxCustomDateNavigator.SetRowCount(AValue: Integer); +begin + DateNavigator.RowCount := AValue; +end; + +procedure TcxCustomDateNavigator.SetScheduler( + AValue: TcxCustomScheduler); +begin + if AValue = FScheduler then Exit; + if FScheduler <> nil then + TcxInnerDateNavigator(FScheduler).RemoveListener(Self); + FScheduler := AValue; + if FScheduler <> nil then + begin + TcxInnerDateNavigator(FScheduler).AddListener(Self); + LookAndFeel.MasterLookAndFeel := TcxInnerDateNavigator(FScheduler).LookAndFeel; + SchedulerChanged; + end + else + LookAndFeel.MasterLookAndFeel := nil; + UpdateStorage; +// DateNavigatorSelectionChanged; +end; + +procedure TcxCustomDateNavigator.SetSelectionChanged( + AValue: TcxSchedulerPeriodChangedEvent); +begin + DateNavigator.OnSelectionChanged := AValue; +end; + +procedure TcxCustomDateNavigator.SetSelectionIsWeeks(AValue: Boolean); +begin + DateNavigator.SelectionIsWeeks := AValue; +end; + +procedure TcxCustomDateNavigator.SetSelectPeriod(AValue: Boolean); +begin + DateNavigator.SelectPeriod := AValue; +end; + +procedure TcxCustomDateNavigator.SetShowDatesContainingEventsInBold( + AValue: Boolean); +begin + DateNavigator.ShowDatesContainingEventsInBold := AValue; +end; + +procedure TcxCustomDateNavigator.SetShowDatesContainingHolidaysInColor(AValue: Boolean); +begin + DateNavigator.ShowDatesContainingHolidaysInColor := AValue; +end; + +procedure TcxCustomDateNavigator.SetShowWeekNumbers(AValue: Boolean); +begin + DateNavigator.ShowWeekNumbers := AValue; +end; + +procedure TcxCustomDateNavigator.SetStartOfWeek( + AValue: TcxStartOfWeek); +begin + FInnerDateNavigator.OptionsView.StartOfWeek := AValue; +end; + +procedure TcxCustomDateNavigator.SetStorage( + AValue: TcxCustomSchedulerStorage); +begin + if FStorage <> AValue then + begin + if FStorage <> nil then + FStorage.RemoveListener(Self); + FStorage := AValue; + if FStorage <> nil then + FStorage.AddListener(Self); + end; + UpdateStorage; +end; + +procedure TcxCustomDateNavigator.SetStyles( + AValue: TcxSchedulerDateNavigatorStyles); +begin + DateNavigator.Styles := AValue; +end; + +procedure TcxCustomDateNavigator.SetUnlimitedSelection(AValue: Boolean); +begin + FUnlimitedSelection := AValue; + TcxDateNavigatorAccess(DateNavigator).UnlimitedSelection := AValue and (Scheduler = nil); +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxExportSchedulerLink.pas b/official/x.35/ExpressScheduler 3/Sources/cxExportSchedulerLink.pas new file mode 100644 index 00000000..087b36f6 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxExportSchedulerLink.pas @@ -0,0 +1,451 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxExportSchedulerLink; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, SysUtils, Graphics, {$IFDEF DELPHI6} Variants, {$ENDIF} cxDataUtils, + cxDateUtils, cxClasses, cxGraphics, cxStyles, cxGeometry, cxSchedulerCustomControls, + Math, cxSchedulerUtils, cxSchedulerStorage, cxSchedulerStrs, cxExport, cxXLSExport, + cxHtmlXmlTxtExport; + +procedure cxExportSchedulerToHTML(const AFileName: string; AScheduler: TcxCustomScheduler; AsTable: Boolean = False; + AShowDialog: Boolean = False; const AHeader: string = 'Event %d'; const AStart: TDateTime = NullDate; + const AFinish: TDateTime = NullDate; const AFileExt: string = 'html'); +procedure cxExportSchedulerToXML(const AFileName: string; AScheduler: TcxCustomScheduler; AsTable: Boolean = False; + AShowDialog: Boolean = False; const AHeader: string = 'Event %d'; const AStart: TDateTime = NullDate; + const AFinish: TDateTime = NullDate; const AFileExt: string = 'xml'); +procedure cxExportSchedulerToExcel(const AFileName: string; AScheduler: TcxCustomScheduler; AsTable: Boolean = False; + AShowDialog: Boolean = False; const AHeader: string = 'Event %d'; const AStart: TDateTime = NullDate; + const AFinish: TDateTime = NullDate; const AFileExt: string = 'xls'); +procedure cxExportSchedulerToText(const AFileName: string; AScheduler: TcxCustomScheduler; AsTable: Boolean = False; + AShowDialog: Boolean = False; const AHeader: string = 'Event %d'; const AStart: TDateTime = NullDate; + const AFinish: TDateTime = NullDate; const ASeparator: string = ''; + const ABeginString: string = ''; const AEndString: string = ''; const AFileExt: string = 'txt'); + +// general export method interface +procedure cxExportSchedulerToFile(AFileName: string; AScheduler: TcxCustomScheduler; AsTable, + AShowDialog: Boolean; const AHeader: string; AStart, AFinish: TDateTime; + AExportType: Integer; const ASeparators: array of string; const AFileExt: string); + +type + // IcxNameExportProvider + IcxNameExportProvider = interface + ['{FC69194E-E3C7-41F4-98AE-5948813210AE}'] + procedure SetName(const AName: string); + procedure SetRangeName(const AName: string; const ARange: TRect); + end; + + {TcxSchedulerExportHelper } + + TcxSchedulerExportHelper = class + private + FEvents: TcxSchedulerFilteredEventList; + FFinish: TDateTime; + FNameProvider: IcxNameExportProvider; + FHeader: string; + FProvider: IcxExportProvider; + FStart: TDateTime; + protected + HasHeader: Boolean; + CaptionStyle: Integer; + Font: TFont; + MaxCaptionWidth: Integer; + MaxDataWidth: Integer; + RowHeight: Integer; + procedure CalculateLayout; virtual; + procedure DoExport; virtual; + procedure ExportEvent(AEvent: TcxSchedulerEvent; AIndex: Integer; var ARow: Integer); virtual; + procedure ExportEvents; virtual; + function RegisterCellStyle(AColor, AFontColor: TColor; AFontStyle: TcxFontStyles; + ABorders, ABoldBorders: TcxBorders; AAlignText: TcxAlignText = catLeft): Integer; + procedure TextWidth(const AString: string; AWordBreak: Boolean; var AWidth, AHeight: Integer); + public + constructor Create(AScheduler: TcxCustomScheduler; const AStart, AFinish: TDateTime; + AExportType: Integer; const AFileName: string); virtual; + destructor Destroy; override; + property Events: TcxSchedulerFilteredEventList read FEvents; + property Finish: TDateTime read FFinish; + property NameProvider: IcxNameExportProvider read FNameProvider; + property Provider: IcxExportProvider read FProvider; + property Start: TDateTime read FStart; + property Header: string read FHeader; + end; + + { TcxSchedulerTableExportHelper } + + TcxSchedulerTableExportHelper = class(TcxSchedulerExportHelper) + protected + Style: Integer; + procedure CalculateLayout; override; + procedure DoExport; override; + procedure ExportEvent(AEvent: TcxSchedulerEvent; AIndex: Integer; var ARow: Integer); override; + end; + + TcxSchedulerExportHelperClass = class of TcxSchedulerExportHelper; + +const + SchedulerExportHelpers: array[Boolean] of TcxSchedulerExportHelperClass = + (TcxSchedulerExportHelper, TcxSchedulerTableExportHelper); + YesNoStrs: array[Boolean] of Pointer = (@secxNo, @secxYes); + States: array[0..3] of Pointer = (@scxFree, @scxTentative, @scxBusy, @scxOutOfOffice); + MaxColumnWidth: Integer = 20; + +implementation + +const + NecessaryFields: array[0..21] of Pointer = + (@secxSubject, @secxStartDate, @secxStartTime, @secxEndDate, @secxEndTime, @secxAlldayevent, + @secxReminderonoff, @secxReminderDate, @secxReminderTime, @secxMeetingOrganizer, + @secxRequiredAttendees, @secxOptionalAttendees, @secxMeetingResources, @secxBillingInformation, + @secxCategories, @secxDescription, @secxLocation, @secxMileage, @secxPriority, @secxPrivate, + @secxSensitivity, @secxShowtimeas); + +type + TcxDateNavigatorAccess = class(TcxSchedulerCustomDateNavigator); + +{ TcxSchedulerExportHelper } + +constructor TcxSchedulerExportHelper.Create(AScheduler: TcxCustomScheduler; + const AStart, AFinish: TDateTime; AExportType: Integer; const AFileName: string); +begin + FEvents := TcxSchedulerFilteredEventList.Create; + TcxExport.Provider(AExportType, AFileName).GetInterface( + IcxExportProvider, FProvider); + Supports(Provider, IcxNameExportProvider, FNameProvider); + FStart := AStart; + FFinish := AFinish; + AScheduler.Storage.GetEvents(FEvents, AStart, AFinish); + Provider.SetDefaultStyle(DefaultCellStyle); + Font := TFont.Create; + Font.Name := DefaultCellStyle.FontName; + Font.Size := DefaultCellStyle.FontSize; + MaxCaptionWidth := 100; + MaxDataWidth := 100; + TextWidth('00/00/00 00:00', False, MaxDataWidth, RowHeight); +end; + +destructor TcxSchedulerExportHelper.Destroy; +begin + FEvents.Free; + try + Font.Free; + FProvider := nil; + finally + inherited Destroy; + end; +end; + +procedure TcxSchedulerExportHelper.CalculateLayout; +begin + if Events.Count = 0 then Exit; + HasHeader := FHeader <> ''; + Provider.SetRange(2, Events.Count * (8 + Byte(HasHeader)), False); +end; + +procedure TcxSchedulerExportHelper.DoExport; +begin + CalculateLayout; + ExportEvents; + Provider.SetColumnWidth(0, Min(MaxColumnWidth, MaxCaptionWidth)); + Provider.SetColumnWidth(1, Min(MaxColumnWidth, MaxDataWidth)); + Provider.Commit; +end; + +procedure TcxSchedulerExportHelper.ExportEvent( + AEvent: TcxSchedulerEvent; AIndex: Integer; var ARow: Integer); + + procedure WriteSingleRow(const ACaption: string; const AData: Variant; ABorders: TcxBorders); + begin + TextWidth(ACaption, False, MaxCaptionWidth, RowHeight); + TextWidth(VarToStr(AData), True, MaxDataWidth, RowHeight); + Provider.SetRowHeight(ARow, RowHeight); + Provider.SetCellStyle(0, ARow, RegisterCellStyle(clDefault, + clDefault, [cfsBold], cxBordersAll, ABorders)); + Provider.SetCellStyle(1, ARow, RegisterCellStyle(clDefault, + clDefault, [], cxBordersAll, ABorders - [bLeft])); + Provider.SetCellValue(0, ARow, ACaption); + Provider.SetCellValue(1, ARow, AData); + Inc(ARow); + end; + +const + ATopRowBorders: array[Boolean] of TcxBorders = + ([bLeft, bTop, bRight], [bLeft, bRight]); + +begin + if HasHeader then + begin + Provider.SetCellUnion(0, ARow, 1, 2); + Provider.SetCellStyleEx(0, ARow, 1, 2, RegisterCellStyle(clDefault, + clDefault, [cfsBold], cxBordersAll, [bRight, bLeft, bTop], catCenter)); + Provider.SetCellValue(0, ARow, Format(Header, [AIndex])); + Inc(ARow); + end; + WriteSingleRow(cxGetResourceString(@secxSubject), + AEvent.Caption, ATopRowBorders[HasHeader]); + WriteSingleRow(cxGetResourceString(@secxLocation), + AEvent.Location, [bLeft, bRight]); + WriteSingleRow(cxGetResourceString(@secxDescription), + AEvent.Message, [bLeft, bRight]); + WriteSingleRow(cxGetResourceString(@secxAllDay), + cxGetResourceString(YesNoStrs[AEvent.AllDayEvent]), [bLeft, bRight]); + WriteSingleRow(cxGetResourceString(@secxStart), AEvent.Start, [bLeft, bRight]); + WriteSingleRow(cxGetResourceString(@secxFinish), AEvent.Finish, [bLeft, bRight]); + WriteSingleRow(cxGetResourceString(@secxState), + cxGetResourceString(States[Min(3, AEvent.State)]), [bLeft, bBottom, bRight]); +{ WriteSingleRow(cxGetResourceString(@secxReminder), + cxGetResourceString(YesNoStrs[AEvent.Reminder]), [bLeft, bBottom, bRight]);} + Provider.SetCellStyle(0, ARow, RegisterCellStyle(clDefault, clDefault, [], [], [])); + Provider.SetCellStyle(1, ARow, RegisterCellStyle(clDefault, clDefault, [], [], [])); + Inc(ARow); +end; + +procedure TcxSchedulerExportHelper.ExportEvents; +var + I, ARow: Integer; +begin + if Events.Count = 0 then Exit; + ARow := 0; + for I := 0 to Events.Count - 1 do + ExportEvent(Events[I], I, ARow); +end; + +function TcxSchedulerExportHelper.RegisterCellStyle(AColor, AFontColor: TColor; + AFontStyle: TcxFontStyles; ABorders, ABoldBorders: TcxBorders; AAlignText: TcxAlignText = catLeft): Integer; +var + AStyle: TcxCacheCellStyle; + ASide: TcxBorder; +begin + AStyle := DefaultCellStyle; + AStyle.FontStyle := AFontStyle; + AStyle.AlignText := AAlignText; + if AColor <> clDefault then + begin + AStyle.BrushStyle := cbsSolid; + AStyle.BrushBkColor := ColorToRgb(AColor); + end; + if AFontColor <> clDefault then + AStyle.FontColor := AFontColor; + for ASide := bLeft to bBottom do + with AStyle.Borders[Integer(ASide)] do + begin + IsDefault := not (ASide in ABorders); + if not IsDefault then + begin + if ASide in ABoldBorders then + Width := 2 + else + Width := 1; + end; + end; + Result := Provider.RegisterStyle(AStyle); +end; + +procedure TcxSchedulerExportHelper.TextWidth(const AString: string; + AWordBreak: Boolean; var AWidth, AHeight: Integer); +var + R: TRect; +const + AFlags: array[Boolean] of Integer = ( + DT_CALCRECT or DT_LEFT or DT_WORDBREAK or DT_NOPREFIX, + DT_CALCRECT or DT_LEFT or DT_NOPREFIX); +begin + with TcxScreenCanvas.Create do + try + R := Rect(0, 0, AWidth, 0); + Font := Self.Font; + if not AWordBreak then + Font.Style := [fsBold]; + Windows.DrawText(Handle, PChar(AString), Length(AString), R, AFlags[AWordBreak]); + AWidth := Max(AWidth, R.Right - R.Left); + AHeight := Max(TextHeight('Wg') + 4, R.Bottom - R.Top + 4); + finally + Free; + end; +end; + +{ TcxSchedulerTableExportHelper } + +procedure TcxSchedulerTableExportHelper.CalculateLayout; +begin + HasHeader := FHeader <> ''; + Provider.SetRange(Length(NecessaryFields), Events.Count + 1 , False); +end; + +procedure TcxSchedulerTableExportHelper.DoExport; +var + I: Integer; +begin + CalculateLayout; + Style := RegisterCellStyle(clDefault, clDefault, + [cfsBold], cxBordersAll, [], catCenter); + if FNameProvider <> nil then + begin + FNameProvider.SetName('Calendar'); + FNameProvider.SetRangeName('Calendar', Rect(0, 0, Length(NecessaryFields) - 1, Events.Count)); + end; + for I := 0 to Length(NecessaryFields) - 1 do + begin + Provider.SetCellStyle(I, 0, Style); + Provider.SetCellValue(I, 0, cxGetResourceString(NecessaryFields[I])); + Provider.SetColumnWidth(I, Min(MaxColumnWidth, 120)); + end; + Style := RegisterCellStyle(clDefault, clDefault, [], cxBordersAll, []); + ExportEvents; + Provider.Commit; +end; + +procedure TcxSchedulerTableExportHelper.ExportEvent( + AEvent: TcxSchedulerEvent; AIndex: Integer; var ARow: Integer); +var + ACol: Integer; + ARTime: TDateTime; + + procedure WriteItem(const AData: Variant); + begin + Provider.SetCellStyle(ACol, ARow, Style); + Provider.SetCellValue(ACol, ARow, AData); + Inc(ACol); + end; + +const + AStates: array[0..3] of Integer = (3, 1, 2, 4); +begin + if ARow = 0 then // for fields header + Inc(ARow); + ACol := 0; + ARTime := 0;//AEvent.Start - AEvent.ReminderTime * MinuteToTime; + WriteItem(AEvent.Caption); // Subject + WriteItem(VarToDateTime(DateOf(AEvent.Start))); // StartDate + WriteItem(VarToDateTime(TimeOf(AEvent.Start))); // StartTime + WriteItem(VarToDateTime(DateOf(AEvent.Finish)));// EndDate + WriteItem(VarToDateTime(TimeOf(AEvent.Finish)));// EndTime + WriteItem(AEvent.AllDayEvent); // Alldayevent + WriteItem(False{AEvent.Reminder}); // Reminderonoff + WriteItem(VarToDateTime(DateOf(ARTime))); // ReminderDate + WriteItem(VarToDateTime(TimeOf(ARTime))); // ReminderTime + WriteItem(''); // MeetingOrganizer + WriteItem(''); // RequiredAttendees + WriteItem(''); // OptionalAttendees + WriteItem(''); // MeetingResources + WriteItem(''); // BillingInformation + WriteItem(''); // Categories, + WriteItem(AEvent.Message); // Description + WriteItem(AEvent.Location); // Location + WriteItem(''); // Mileage + WriteItem(secxNormal); // Priority + WriteItem(False); // Private + WriteItem(secxNormal); // Sensitivity + WriteItem(AStates[Min(3, AEvent.State)]); // Showtimeas + Inc(ARow); +end; + +// external procedures definition + +procedure cxExportSchedulerToFile(AFileName: string; AScheduler: TcxCustomScheduler; + AsTable, AShowDialog: Boolean; const AHeader: string; AStart, AFinish: TDateTime; + AExportType: Integer; const ASeparators: array of string; const AFileExt: string); +var + I: Integer; + AIntf: IcxExportWithSeparators; +begin + if AFileExt <> '' then + AFileName := ChangeFileExt(AFileName, '.' + AFileExt); + if (AScheduler.Storage = nil) then + cxSchedulerError(secxExportStorageInvalid); + if (AStart = NullDate) or (AFinish = NullDate) then + begin + AStart := TcxDateNavigatorAccess(AScheduler.DateNavigator).GetRealFirstDate; + AFinish := TcxDateNavigatorAccess(AScheduler.DateNavigator).GetRealLastDate; + if AShowDialog then + begin + // todo: use dialog for select period + end; + end; + with SchedulerExportHelpers[AsTable].Create(AScheduler, AStart, AFinish, AExportType, AFileName) do + try + FHeader := AHeader; + if Supports(Provider, IcxExportWithSeparators, AIntf) and (Length(ASeparators) > 0) then + begin + for I := Low(ASeparators) to High(ASeparators) do + AIntf.AddSeparator(ASeparators[I]); + end; + DoExport; + finally + Free; + end; +end; + +procedure cxExportSchedulerToHTML(const AFileName: string; AScheduler: TcxCustomScheduler; + AsTable: Boolean = False; AShowDialog: Boolean = False; const AHeader: string = 'Event %d'; + const AStart: TDateTime = NullDate; const AFinish: TDateTime = NullDate; const AFileExt: string = 'html'); +begin + cxExportSchedulerToFile(AFileName, AScheduler, AsTable, AShowDialog, AHeader, + AStart, AFinish, cxExportToHtml, [], AFileExt); +end; + +procedure cxExportSchedulerToXML(const AFileName: string; AScheduler: TcxCustomScheduler; + AsTable: Boolean = False; AShowDialog: Boolean = False; const AHeader: string = 'Event %d'; + const AStart: TDateTime = NullDate; const AFinish: TDateTime = NullDate; const AFileExt: string = 'xml'); +begin + cxExportSchedulerToFile(AFileName, AScheduler, AsTable, AShowDialog, AHeader, + AStart, AFinish, cxExportToXML, [], AFileExt); +end; + +procedure cxExportSchedulerToExcel(const AFileName: string; AScheduler: TcxCustomScheduler; + AsTable: Boolean = False; AShowDialog: Boolean = False; const AHeader: string = 'Event %d'; + const AStart: TDateTime = NullDate; const AFinish: TDateTime = NullDate; const AFileExt: string = 'xls'); +begin + cxExportSchedulerToFile(AFileName, AScheduler, AsTable, AShowDialog, AHeader, + AStart, AFinish, cxExportToExcel, [], AFileExt); +end; + +procedure cxExportSchedulerToText(const AFileName: string; AScheduler: TcxCustomScheduler; + AsTable: Boolean = False; AShowDialog: Boolean = False; const AHeader: string = 'Event %d'; + const AStart: TDateTime = NullDate; const AFinish: TDateTime = NullDate; const ASeparator: string = ''; + const ABeginString: string = ''; const AEndString: string = ''; const AFileExt: string = 'txt'); +begin + cxExportSchedulerToFile(AFileName, AScheduler, AsTable, AShowDialog, AHeader, + AStart, AFinish, cxExportToText, [ASeparator, ABeginString, AEndString], AFileExt); +end; + +initialization + cxExportInit(TcxGetResourceStringProc(@cxGetResourceString), @ColorToRGB, True ); + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxScheduler.pas b/official/x.35/ExpressScheduler 3/Sources/cxScheduler.pas new file mode 100644 index 00000000..95adf0f7 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxScheduler.pas @@ -0,0 +1,837 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxScheduler; + +{$I cxVer.inc} + +interface + +uses + Windows, Controls, ImgList, +{$IFDEF DELPHI6} + DateUtils, Types, +{$ENDIF} + cxGraphics, cxDateUtils, cxSchedulerUtils, + cxSchedulerStorage, cxSchedulerCustomControls, cxSchedulerCustomResourceView, + cxSchedulerDayView, cxSchedulerWeekView, cxSchedulerDateNavigator, Classes, + cxSchedulerGanttView, cxSchedulerTimeGridView, cxSchedulerYearView; + +type + + { TcxScheduler } + + TcxSchedulerInitEventImages = procedure (Sender: TcxCustomScheduler; + AEvent: TcxSchedulerControlEvent; AImages: TcxSchedulerEventImages) of object; + + TcxScheduler = class(TcxCustomScheduler, IUnknown, IcxSchedulerCommonViewItemsPainter, IcxSchedulerEventImages) + private + FDateNavigatorEvents: TNotifyEvent; + FIsSelectionValidated: Boolean; + FViewDay: TcxSchedulerDayView; + FViewGantt: TcxSchedulerGanttView; + FViewTimeGrid: TcxSchedulerTimeGridView; + FViewWeek: TcxSchedulerWeekView; + FViewWeeks: TcxSchedulerWeeksView; + FViewYear: TcxSchedulerYearView; + FOnCustomDrawBackground: TcxSchedulerCustomDrawBackgroundEvent; + FOnCustomDrawButton: TcxSchedulerCustomDrawButtonEvent; + FOnCustomDrawContent: TcxSchedulerCustomDrawContentEvent; + FOnCustomDrawDayHeader: TcxSchedulerCustomDrawDayHeaderEvent; + FOnCustomDrawEvent: TcxSchedulerCustomDrawEventEvent; + FOnCustomDrawGroupSeparator: TcxSchedulerCustomDrawGroupSeparatorEvent; + FOnCustomDrawNavigationButton: TcxSchedulerCustomDrawNavigationButtonEvent; + FOnCustomDrawResourceHeader: TcxSchedulerCustomDrawResourceHeaderEvent; + FOnInitEventImages: TcxSchedulerInitEventImages; + FViewDayEvents: TNotifyEvent; + FViewTimeGridEvents: TNotifyEvent; + FViewYearEvents: TNotifyEvent; + function GetDateNavigator: TcxSchedulerDateNavigator; + procedure SetDateNavigator(AValue: TcxSchedulerDateNavigator); + procedure SetViewDay(AValue: TcxSchedulerDayView); + procedure SetViewGantt(AValue: TcxSchedulerGanttView); + procedure SetViewTimeGrid(AValue: TcxSchedulerTimeGridView); + procedure SetViewWeek(AValue: TcxSchedulerWeekView); + procedure SetViewWeeks(AValue: TcxSchedulerWeeksView); + procedure SetViewYear(AValue: TcxSchedulerYearView); + // read/write + procedure ReadSplittersData(AStream: TStream); + procedure WriteSplittersData(AStream: TStream); + procedure ReadStoredClientBounds(AStream: TStream); + procedure WriteStoredClientBounds(AStream: TStream); + protected + procedure DefineProperties(Filer: TFiler); override; + // IcxSchedulerCommonViewItemsPainter + procedure DoCustomDrawBackground( + AViewInfo: TcxSchedulerBackgroundCellViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawButton( + AViewInfo: TcxSchedulerMoreEventsButtonViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawContent( + AViewInfo: TcxSchedulerContentCellViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawDayHeader( + AViewInfo: TcxSchedulerDayHeaderCellViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawEvent( + AViewInfo: TcxSchedulerEventCellViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawGroupSeparator( + AViewInfo: TcxSchedulerGroupSeparatorCellViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawNavigationButton( + AViewInfo: TcxSchedulerContentNavigationButtonViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawResourceHeader( + AViewInfo: TcxSchedulerHeaderCellViewInfo; var ADone: Boolean); virtual; + function HasCustomDrawGroupSeparator: Boolean; + function HasCustomDrawResourceHeader: Boolean; + // IcxSchedulerEventImages + procedure DoInitEventImages(AEvent: TcxSchedulerControlEvent; + AImages: TcxSchedulerEventImages); virtual; + function GetImages: TCustomImageList; virtual; + function SupportEventImages: Boolean; virtual; + // layout + function GetProperties(AProperties: TStrings): Boolean; override; + procedure GetPropertyValue(const AName: string; var AValue: Variant); override; + procedure SetPropertyValue(const AName: string; const AValue: Variant); override; + + function CreateDateNavigator: TcxSchedulerCustomDateNavigator; override; + function CreateDefaultView: TcxSchedulerCustomView; override; + function CreateViewDay: TcxSchedulerDayView; virtual; + function CreateViewGantt: TcxSchedulerGanttView; virtual; + function CreateViewTimeGrid: TcxSchedulerTimeGridView; virtual; + function CreateViewWeek: TcxSchedulerWeekView; virtual; + function CreateViewWeeks: TcxSchedulerWeeksView; virtual; + function CreateViewYear: TcxSchedulerYearView; virtual; + procedure CreateSubClasses; override; + procedure DateNavigatorSelectionChanged; override; + function GetNextView(AView: TcxSchedulerCustomView): TcxSchedulerCustomView; override; + procedure SetCurrentView(AView: TcxSchedulerCustomView); override; + procedure SynchronizeVisibleDays; override; + procedure UpdateEventsCache(ACheckDaysInterval: Boolean); override; + function UpdateView(AView: TcxSchedulerCustomView): Boolean; + procedure ValidateSelection(ASelection: TcxSchedulerDateList); override; + procedure ValidateWeekDays(ASaveWeekCount: Boolean = False); + public + function GoToDate(ADate: TDateTime): Boolean; override; + function GoToDate(ADate: TDateTime; AViewMode: TcxSchedulerViewMode): Boolean; overload; override; + procedure SelectDays(const AStartDay, AFinishDay: TDateTime; AsDays: Boolean = False); overload; virtual; + procedure SelectDays(ASelection: TcxSchedulerDateList; AsDays: Boolean = False); overload; virtual; + procedure SelectDays(const ASelection: array of TDateTime; AsDays: Boolean = False); overload; virtual; + procedure SelectWorkDays(const AWeekDate: TDateTime); + published + property DateNavigator: TcxSchedulerDateNavigator read GetDateNavigator write SetDateNavigator; + property ViewDay: TcxSchedulerDayView read FViewDay write SetViewDay; + property ViewGantt: TcxSchedulerGanttView read FViewGantt write SetViewGantt; + property ViewTimeGrid: TcxSchedulerTimeGridView read FViewTimeGrid write SetViewTimeGrid; + property ViewWeek: TcxSchedulerWeekView read FViewWeek write SetViewWeek; + property ViewWeeks: TcxSchedulerWeeksView read FViewWeeks write SetViewWeeks; + property ViewYear: TcxSchedulerYearView read FViewYear write SetViewYear; + + property OnCustomDrawBackground: TcxSchedulerCustomDrawBackgroundEvent read FOnCustomDrawBackground write FOnCustomDrawBackground; + property OnCustomDrawButton: TcxSchedulerCustomDrawButtonEvent read FOnCustomDrawButton write FOnCustomDrawButton; + property OnCustomDrawContent: TcxSchedulerCustomDrawContentEvent read FOnCustomDrawContent write FOnCustomDrawContent; + property OnCustomDrawDayHeader: TcxSchedulerCustomDrawDayHeaderEvent read FOnCustomDrawDayHeader write FOnCustomDrawDayHeader; + property OnCustomDrawEvent: TcxSchedulerCustomDrawEventEvent read FOnCustomDrawEvent write FOnCustomDrawEvent; + property OnCustomDrawGroupSeparator: TcxSchedulerCustomDrawGroupSeparatorEvent read FOnCustomDrawGroupSeparator write FOnCustomDrawGroupSeparator; + property OnCustomDrawResourceHeader: TcxSchedulerCustomDrawResourceHeaderEvent read FOnCustomDrawResourceHeader write FOnCustomDrawResourceHeader; + property OnInitEventImages: TcxSchedulerInitEventImages read FOnInitEventImages write FOnInitEventImages; + // derived properties and events + property Align; + property Anchors; + {$IFDEF DELPHI6} + property BevelEdges; + property BevelInner; + property BevelOuter; + property BevelKind; + property BevelWidth; + property BorderWidth; + {$ENDIF} + property BorderStyle; + property ContentPopupMenu; + property Constraints; + property ControlBox; + property DialogsLookAndFeel; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property EventImages; + property EventOperations; + property EventPopupMenu; + property Font; + property LookAndFeel; + property OptionsBehavior; + property OptionsCustomize; + property OptionsView; + property ParentFont; + property PopupMenu; + property ResourceNavigator; + property ShowHint; + property Storage; + property Styles; + property TabOrder; + property TabStop; + property Visible; + //events + property OnAfterDragEvent; + property OnAfterEditing; + property OnAfterSizingEvent; + property OnBeforeDeleting; + property OnBeforeDragEvent; + property OnBeforeEditing; + property OnBeforeSizingEvent; + property OnCanShowView; + property OnClick; + property OnContextPopup; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnEventSelectionChanged; + property OnFirstVisibleResourceChanged; + property OnGetEventDisplayText; + property OnGetEventEditProperties; + property OnGetEventHintText; + property OnInitEdit; + property OnIsWorkTime; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnLayoutChanged; + property OnMoreEventsButtonClick; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnMouseWheel; + property OnMouseWheelDown; + property OnMouseWheelUp; + property OnNavigationButtonClick; + property OnResize; + property OnStartDock; + property OnStartDrag; + property OnSelectionChanged; + property OnScaleScroll; + property OnShowDateHint; + property OnViewTypeChanged; + //nested events + property DateNavigatorEvents: TNotifyEvent read FDateNavigatorEvents write FDateNavigatorEvents; + property ViewDayEvents: TNotifyEvent read FViewDayEvents write FViewDayEvents; + property ViewTimeGridEvents: TNotifyEvent read FViewTimeGridEvents write FViewTimeGridEvents; + property ViewYearEvents: TNotifyEvent read FViewYearEvents write FViewYearEvents; + end; + +implementation + +uses + SysUtils; + +{ TcxScheduler } + +function TcxScheduler.GoToDate(ADate: TDateTime): Boolean; +begin + Result := True; + DateNavigator.BeginUpdate; + try + if SelectedDays.IndexOf(ADate) <> -1 then Exit; + if SelectedDays.Count = 0 then + SelectedDays.Add(Date); + SelectedDays.ShiftPeriod(ADate - SelectedDays[0]); + if ViewWeek.Active or ViewWeeks.Active then + ValidateWeekDays(True) + else + if CurrentView is TcxSchedulerTimeGridView then + TcxSchedulerTimeGridView(CurrentView).VisibleStart := SelectedDays[0]; + UpdateView(CurrentView); + DateNavigator.Refresh; + finally + DateNavigator.EndUpdate; + end; +end; + +function TcxScheduler.GoToDate(ADate: TDateTime; AViewMode: + TcxSchedulerViewMode): Boolean; + + procedure SelectMonth; + var + I, AYear, AMonth, ADay: Word; + AStart: TDateTime; + begin + DecodeDate(ADate, AYear, AMonth, ADay); + AStart := EncodeDate(AYear, AMonth, 1); + for I := 0 to DaysPerMonth(AYear, AMonth) - 1 do + SelectedDays.Add(AStart + I + Integer(OptionsView.ActualStartOfWeek)); + ValidateWeekDays; + end; + +begin + DateNavigator.BeginUpdate; + try + SelectedDays.Clear; + DateNavigator.SelectionIsWeeks := AViewMode in [vmWeek, vmMonth]; + case AViewMode of + vmDay, vmWeek: + begin + SelectedDays.Add(ADate); + if AViewMode = vmDay then + Result := UpdateView(ViewDay) + else + Result := UpdateView(ViewWeek); + end; + vmMonth: + begin + SelectMonth; + Result := UpdateView(ViewWeeks); + end; + else + SelectWorkDays(ADate); + Result := UpdateView(ViewDay); + end; + finally + SynchronizeVisibleDays; + DateNavigator.Refresh; + DateNavigator.EndUpdate; + end; +end; + +procedure TcxScheduler.SelectDays(const AStartDay, AFinishDay: TDateTime; + AsDays: Boolean = False); +var + I: Integer; +begin + SelectedDays.Clear; + //DELPHI8! check Trunc(AStartDay) + for I := Trunc(AStartDay) to Trunc(AFinishDay) do + SelectedDays.Add(I); + SelectDays(SelectedDays, AsDays); +end; + +procedure TcxScheduler.SelectDays( + ASelection: TcxSchedulerDateList; AsDays: Boolean = False); +var + I: Integer; +begin + DateNavigator.BeginUpdate; + try + if ASelection <> SelectedDays then + SelectedDays.Assign(ASelection); + SelectedDays.Sort(cxCompareDates); + if SelectedDays.Count = 0 then + SelectedDays.Add(Date); + I := 1; + while I < (ASelection.Count - 1) do + begin + if ASelection[I] = ASelection[I - 1] then + ASelection.Delete(I) + else + Inc(I) + end; + AsDays := AsDays and (ASelection.Count < 14); + if not AsDays then + begin + ValidateWeekDays; + DateNavigator.SelectionIsWeeks := True; + end + else + DateNavigator.SelectionIsWeeks := False; + FIsSelectionValidated := True; + ValidateSelection(SelectedDays); + finally + DateNavigator.EndUpdate; + end; +end; + +procedure TcxScheduler.SelectDays(const ASelection: array of TDateTime; + AsDays: Boolean = False); +var + I: Integer; + AList: TcxSchedulerDateList; +begin + AList := TcxSchedulerDateList.Create; + try + for I := Low(ASelection) to High(ASelection) do + AList.Add(ASelection[I]); + if AList.Count = 0 then + AList.Add(Date); + SelectDays(AList, AsDays); + finally + AList.Free; + end; +end; + +procedure TcxScheduler.SelectWorkDays(const AWeekDate: TDateTime); +const + ConvertTable: array[1..7] of TDay = (dMonday, dTuesday, dWednesday, dThursday, + dFriday, dSaturday, dSunday); +var + AYear, AWeek, AWeekDay: Word; + ADay: TDay; + I, ADaysDiff: Integer; + AStartWeek: TDateTime; +begin + ViewDay.Active := True; + DecodeDateWeek(AWeekDate, AYear, AWeek, AWeekDay); + ADay := ConvertTable[AWeekDay]; + ADaysDiff := Ord(ADay) - Ord(StartOfWeek); + if ADaysDiff >= 0 then + AStartWeek := AWeekDate - ADaysDiff + else + AStartWeek := AWeekDate - (ADaysDiff + 7); + ADay := ConvertTable[DayOfTheWeek(AStartWeek)]; + SelectedDays.Clear; + for I := 1 to 7 do + begin + if ADay in OptionsView.WorkDays then + SelectedDays.Add(AStartWeek); + if ADay < dSaturday then + Inc(ADay) + else + ADay := dSunday; + AStartWeek := AStartWeek + 1; + end; + SelectDays(SelectedDays, True) +end; + +procedure TcxScheduler.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineBinaryProperty('Splitters', ReadSplittersData, WriteSplittersData, True); + Filer.DefineBinaryProperty('StoredClientBounds', ReadStoredClientBounds, WriteStoredClientBounds, True); +end; + +procedure TcxScheduler.DoCustomDrawBackground( + AViewInfo: TcxSchedulerBackgroundCellViewInfo; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawBackground) then + FOnCustomDrawBackground(CurrentView, Canvas, AViewInfo, ADone); +end; + +procedure TcxScheduler.DoCustomDrawButton( + AViewInfo: TcxSchedulerMoreEventsButtonViewInfo; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawButton) then + FOnCustomDrawButton(CurrentView, Canvas, AViewInfo, ADone); +end; + +procedure TcxScheduler.DoCustomDrawContent( + AViewInfo: TcxSchedulerContentCellViewInfo; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawContent) then + FOnCustomDrawContent(CurrentView, Canvas, AViewInfo, ADone); +end; + +procedure TcxScheduler.DoCustomDrawDayHeader( + AViewInfo: TcxSchedulerDayHeaderCellViewInfo; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawDayHeader) then + FOnCustomDrawDayHeader(CurrentView, Canvas, AViewInfo, ADone); +end; + +procedure TcxScheduler.DoCustomDrawEvent( + AViewInfo: TcxSchedulerEventCellViewInfo; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawEvent) and Assigned(AViewInfo.Event) then + FOnCustomDrawEvent(CurrentView, Canvas, AViewInfo, ADone); +end; + +procedure TcxScheduler.DoCustomDrawGroupSeparator( + AViewInfo: TcxSchedulerGroupSeparatorCellViewInfo; var ADone: Boolean); +begin + if HasCustomDrawGroupSeparator then + FOnCustomDrawGroupSeparator(CurrentView, Canvas, AViewInfo, ADone); +end; + +procedure TcxScheduler.DoCustomDrawNavigationButton( + AViewInfo: TcxSchedulerContentNavigationButtonViewInfo; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawNavigationButton) then + FOnCustomDrawNavigationButton(CurrentView, Canvas, AViewInfo, ADone); +end; + +procedure TcxScheduler.DoCustomDrawResourceHeader( + AViewInfo: TcxSchedulerHeaderCellViewInfo; var ADone: Boolean); +begin + if HasCustomDrawResourceHeader then + FOnCustomDrawResourceHeader(CurrentView, Canvas, AViewInfo, ADone); +end; + +function TcxScheduler.HasCustomDrawGroupSeparator: Boolean; +begin + Result := Assigned(FOnCustomDrawGroupSeparator); +end; + +function TcxScheduler.HasCustomDrawResourceHeader: Boolean; +begin + Result := Assigned(FOnCustomDrawResourceHeader); +end; + +procedure TcxScheduler.DoInitEventImages(AEvent: TcxSchedulerControlEvent; + AImages: TcxSchedulerEventImages); +begin + if Assigned(FOnInitEventImages) then + FOnInitEventImages(Self, AEvent, AImages); +end; + +function TcxScheduler.GetImages: TCustomImageList; +begin + Result := EventImages; +end; + +function TcxScheduler.SupportEventImages: Boolean; +begin + Result := Assigned(FOnInitEventImages); +end; + +function TcxScheduler.GetProperties(AProperties: TStrings): Boolean; +begin + Result := inherited GetProperties(AProperties); + if CurrentView.Active then + AProperties.Add('View'); +end; + +procedure TcxScheduler.GetPropertyValue(const AName: string; + var AValue: Variant); +begin + inherited GetPropertyValue(AName, AValue); + if (AName = 'View') and CurrentView.Active then + begin + if CurrentView = ViewDay then + AValue := 0 + else + if CurrentView = ViewWeek then + AValue := 1 + else + if CurrentView = ViewWeeks then + AValue := 2 + else + if CurrentView = ViewTimeGrid then + AValue := 3 + else + if CurrentView = ViewYear then + AValue := 4 + + end; +end; + +procedure TcxScheduler.SetPropertyValue(const AName: string; + const AValue: Variant); +begin + inherited SetPropertyValue(AName, AValue); + if (AName = 'View') and CurrentView.Active then + begin + DateNavigator.BeginUpdate; + try + if AValue = 0 then + ViewDay.Active := True + else + if (AValue = 1) or (AValue = 2) then + begin + if AValue = 1 then + ViewWeek.Active := True + else + if AValue = 2 then + ViewWeeks.Active := True; + ValidateWeekDays(True); + end + else + if AValue = 3 then + ViewTimeGrid.Active := True + else + if AValue = 4 then + ViewYear.Active := True + finally + DateNavigator.EndUpdate; + end; + end; +end; + +function TcxScheduler.CreateDateNavigator: TcxSchedulerCustomDateNavigator; +begin + Result := TcxSchedulerDateNavigator.Create(Self); +end; + +function TcxScheduler.CreateDefaultView: TcxSchedulerCustomView; +begin + Result := FViewDay; +end; + +function TcxScheduler.CreateViewGantt: TcxSchedulerGanttView; +begin + Result := TcxSchedulerGanttView.Create(Self); +end; + +function TcxScheduler.CreateViewTimeGrid: TcxSchedulerTimeGridView; +begin + Result := TcxSchedulerTimeGridView.Create(Self); +end; + +function TcxScheduler.CreateViewDay: TcxSchedulerDayView; +begin + Result := TcxSchedulerDayView.Create(Self); +end; + +function TcxScheduler.CreateViewWeek: TcxSchedulerWeekView; +begin + Result := TcxSchedulerWeekView.Create(Self); +end; + +function TcxScheduler.CreateViewWeeks: TcxSchedulerWeeksView; +begin + Result := TcxSchedulerWeeksView.Create(Self); +end; + +function TcxScheduler.CreateViewYear: TcxSchedulerYearView; +begin + Result := TcxSchedulerYearView.Create(Self); +end; + +procedure TcxScheduler.CreateSubClasses; +begin + FViewDay := CreateViewDay; + FViewGantt := CreateViewGantt; + FViewTimeGrid := CreateViewTimeGrid; + FViewWeek := CreateViewWeek; + FViewWeeks := CreateViewWeeks; + FViewYear := CreateViewYear; + inherited CreateSubClasses; +end; + +procedure TcxScheduler.DateNavigatorSelectionChanged; +begin + if not (cfViewValid in ControlFlags) then Exit; + try + if CanDeactivateOnSelectionChanged(CurrentView) then + begin + if DateNavigator.SelectionIsWeeks then + begin + if SelectedDays.Count >= 14 then + ViewWeeks.Active := True + else + ViewWeek.Active := True + end + else + ViewDay.Active := True; + end + else + SelectedDaysChanged(CurrentView); + finally + FullRefresh; + end; +end; + +function TcxScheduler.GetNextView( + AView: TcxSchedulerCustomView): TcxSchedulerCustomView; +begin + Result := FViewWeek; + if (AView = FViewWeek) and FViewWeeks.CanShow then + Result := FViewWeeks + else + if not FViewWeek.CanShow or (AView = FViewWeek) then + begin + if AView <> FViewDay then + Result := FViewDay + else + Result := FViewWeeks; + end; +end; + +procedure TcxScheduler.SetCurrentView(AView: TcxSchedulerCustomView); +begin + inherited SetCurrentView(AView); +end; + +procedure TcxScheduler.SynchronizeVisibleDays; +var + ADate: TDateTime; +begin + if SelectedDays.Count = 0 then + SelectedDays.Add(Date); + if CurrentView = ViewWeek then + begin + ADate := SelectedDays[0]; + SelectedDays.Clear; + SelectedDays.Add(ADate); + end; + SelectDays(SelectedDays, (CurrentView = ViewDay) or + (CurrentView = ViewTimeGrid) or (CurrentView = ViewYear)); + inherited SynchronizeVisibleDays; +end; + +procedure TcxScheduler.UpdateEventsCache(ACheckDaysInterval: Boolean); +begin + inherited UpdateEventsCache(ACheckDaysInterval); + EventList.Sort(TcxCompareEventsProc(@cxCompareSchedulerControlEvents)); +end; + +function TcxScheduler.UpdateView(AView: TcxSchedulerCustomView): Boolean; +var + ADate: TDateTime; +begin + ADate := SelectedDays[0]; + if ViewYear.Active then + AView.Active := True; + if (ADate < DateNavigator.FirstDate) or (ADate > DateNavigator.LastDate) then + DateNavigator.FirstDate := ADate; + if AView.Active then + AView.Refresh + else + AView.Active := True; + Result := AView.Active; +end; + +procedure TcxScheduler.ValidateSelection(ASelection: TcxSchedulerDateList); +begin + if not FIsSelectionValidated then + begin + FIsSelectionValidated := True; + SelectDays(ASelection, (CurrentView = ViewDay) or (CurrentView = ViewYear) or + (CurrentView = ViewTimeGrid) or (SelectedDays.Count = 1)); + end + else + begin + FIsSelectionValidated := False; + inherited ValidateSelection(ASelection); + end; +end; + +procedure TcxScheduler.ValidateWeekDays(ASaveWeekCount: Boolean = False); +var + I, J, AWeekCount: Integer; + ADate: TDateTime; + AWeeks: TcxSchedulerDateList; + AYear, APrevYear, AWeek, APrevWeek, AWeekDay: Word; +begin + AWeekCount := SelectedDays.Count div 7; + if AWeekCount = 0 then Inc(AWeekCount); + AWeeks := TcxSchedulerDateList.Create; + try + APrevYear := 0; + APrevWeek := 0; + for I := 0 to SelectedDays.Count - 1 do + begin + DecodeDateWeek(SelectedDays[I] + 1 - Byte(StartOfWeek), AYear, AWeek, AWeekDay); + if (AYear <> APrevYear) or (AWeek <> APrevWeek) then + begin + APrevYear := AYear; + APrevWeek := AWeek; + AWeeks.Add(EncodeDateWeek(AYear, AWeek, 1) - 1); + end; + end; + SelectedDays.Clear; + for I := 0 to AWeeks.Count - 1 do + begin + if ASaveWeekCount and (I = AWeekCount) then break; + ADate := AWeeks[I]; + for J := 0 to 6 do + SelectedDays.Add(ADate + J + Byte(StartOfWeek)); + end; + finally + AWeeks.Free; + end; +end; + +function TcxScheduler.GetDateNavigator: TcxSchedulerDateNavigator; +begin + Result := TcxSchedulerDateNavigator(inherited DateNavigator); +end; + +procedure TcxScheduler.SetDateNavigator(AValue: TcxSchedulerDateNavigator); +begin + DateNavigator.Assign(AValue); +end; + +procedure TcxScheduler.SetViewDay(AValue: TcxSchedulerDayView); +begin + FViewDay.Assign(AValue); +end; + +procedure TcxScheduler.SetViewGantt(AValue: TcxSchedulerGanttView); +begin + FViewGantt.Assign(AValue); +end; + +procedure TcxScheduler.SetViewTimeGrid(AValue: TcxSchedulerTimeGridView); +begin + FViewTimeGrid.Assign(AValue); +end; + +procedure TcxScheduler.SetViewWeek(AValue: TcxSchedulerWeekView); +begin + FViewWeeks.Assign(AValue); +end; + +procedure TcxScheduler.SetViewWeeks(AValue: TcxSchedulerWeeksView); +begin + FViewWeek.Assign(AValue); +end; + +procedure TcxScheduler.SetViewYear(AValue: TcxSchedulerYearView); +begin + FViewYear.Assign(AValue); +end; + +procedure TcxScheduler.ReadSplittersData(AStream: TStream); +var + R: TRect; +begin + AStream.Read(R, SizeOf(R)); + HorzSplitter.Bounds := R; + AStream.Read(R, SizeOf(R)); + VertSplitter.Bounds := R; +end; + +procedure TcxScheduler.WriteSplittersData(AStream: TStream); +var + R: TRect; +begin + R := HorzSplitter.Bounds; + AStream.Write(R, SizeOf(R)); + R := VertSplitter.Bounds; + AStream.Write(R, SizeOf(R)); +end; + +procedure TcxScheduler.ReadStoredClientBounds(AStream: TStream); +begin + AStream.Read(FStoredClientBounds, SizeOf(FStoredClientBounds)); +end; + +procedure TcxScheduler.WriteStoredClientBounds(AStream: TStream); +var + R: TRect; +begin + R := ClientBounds; + AStream.Write(R, SizeOf(R)); +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxScheduler.res b/official/x.35/ExpressScheduler 3/Sources/cxScheduler.res new file mode 100644 index 00000000..7e7fe68d Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Sources/cxScheduler.res differ diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerAggregateStorage.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerAggregateStorage.pas new file mode 100644 index 00000000..0b4ee821 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerAggregateStorage.pas @@ -0,0 +1,970 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerAggregateStorage; + +{$I cxVer.inc} + +interface + +uses + Classes, cxClasses, Controls, cxSchedulerStorage, cxSchedulerHolidays, + cxSchedulerUtils, cxCustomData; + +type + + TcxSchedulerStorageLinks = class; + TcxSchedulerAggregateStorage = class; + + TcxSchedulerStorageLinkClass = class of TcxSchedulerStorageLink; + + { TcxSchedulerStorageLink } + + TcxSchedulerStorageLink = class(TCollectionItem) + private + FStorage: TcxCustomSchedulerStorage; + function GetAggregateStorage: TcxSchedulerAggregateStorage; + function GetDefault: Boolean; + function GetLinks: TcxSchedulerStorageLinks; + procedure SetDefault(AValue: Boolean); + procedure SetStorage(AValue: TcxCustomSchedulerStorage); + public + destructor Destroy; override; + + procedure Assign(Source: TPersistent); override; + + property AggregateStorage: TcxSchedulerAggregateStorage read GetAggregateStorage; + property Links: TcxSchedulerStorageLinks read GetLinks; + published + property Default: Boolean read GetDefault write SetDefault default False; + property Storage: TcxCustomSchedulerStorage read FStorage write SetStorage; + end; + + { TcxSchedulerStorageLinks } + + TcxSchedulerStorageLinks = class(TCollection) + private + FAggregateStorage: TcxSchedulerAggregateStorage; + FDefaultLink: TcxSchedulerStorageLink; + function GetDefaultStorage: TcxCustomSchedulerStorage; + function GetItem(AIndex: Integer): TcxSchedulerStorageLink; + procedure SetDefaultLink(AValue: TcxSchedulerStorageLink); + procedure SetItem(AIndex: Integer; AValue: TcxSchedulerStorageLink); + protected + function GetItemLinkClass: TcxSchedulerStorageLinkClass; virtual; + procedure Update(Item: TCollectionItem); override; + public + constructor CreateEx(AOwner: TcxSchedulerAggregateStorage); virtual; + + function AddStorageLink(AStorage: TcxCustomSchedulerStorage): TcxSchedulerStorageLink; + function GetStorageLinkIndex(AStorage: TcxCustomSchedulerStorage): Integer; + procedure PopulateHolidays(AList: TList); + + property AggregateStorage: TcxSchedulerAggregateStorage read FAggregateStorage; + property DefaultLink: TcxSchedulerStorageLink read FDefaultLink write SetDefaultLink; + property DefaultStorage: TcxCustomSchedulerStorage read GetDefaultStorage; + property Items[AIndex: Integer]: TcxSchedulerStorageLink read GetItem write SetItem; default; + end; + + { TcxSchedulerAggregateStorageEvent } + + TcxSchedulerAggregateStorageEvent = class(TcxSchedulerEvent) + private + FSourceEvent: TcxSchedulerEvent; + function GetStorage: TcxSchedulerAggregateStorage; + protected + MappedID: Integer; + MappedParentID: Integer; + procedure CheckParentID; + function GetParentID: Variant; override; + function GetValueByIndex(AIndex: Integer): Variant; override; + procedure SetSourceEvent(AValue: TcxSchedulerEvent); + procedure SetValue(AField: TcxCustomSchedulerStorageField; const AValue: Variant); override; + public + procedure DeleteExceptions; override; + procedure RemoveRecurrence; override; + + property SourceEvent: TcxSchedulerEvent read FSourceEvent; + property Storage: TcxSchedulerAggregateStorage read GetStorage; + end; + + { TcxSchedulerAggregateStorageDataSource } + + TcxSchedulerAggregateStorageDataSource = class(TcxCustomDataSource) + private + FStorage: TcxSchedulerAggregateStorage; + protected + function GetRecordCount: Integer; override; + function GetRecordId(ARecordHandle: TcxDataRecordHandle): Variant; override; + function GetRecordHandle(ARecordIndex: Integer): TcxDataRecordHandle; override; + function GetValue(ARecordHandle: TcxDataRecordHandle; AItemHandle: TcxDataItemHandle): Variant; override; + function IsRecordIdSupported: Boolean; override; + procedure SetValue(ARecordHandle: TcxDataRecordHandle; AItemHandle: TcxDataItemHandle; const AValue: Variant); override; + public + constructor Create(AStorage: TcxSchedulerAggregateStorage); virtual; + + property Storage: TcxSchedulerAggregateStorage read FStorage; + end; + + { TcxSchedulerAggregateStorage } + + TcxSchedulerEventInsertingEvent = procedure(Sender: TcxSchedulerAggregateStorage; + AEvent: TcxSchedulerEvent; var AStorage: TcxCustomSchedulerStorage) of object; + + TcxSchedulerAggregateStorage = class(TcxCustomSchedulerStorage, IcxSchedulerStorageListener) + private + FCounter: Integer; + FLinks: TcxSchedulerStorageLinks; + FProvider: TcxSchedulerAggregateStorageDataSource; + FSynchronizing: Boolean; + FOnEventInserting: TcxSchedulerEventInsertingEvent; + function CanRefresh: Boolean; + function GetCustomFields: TcxSchedulerStorageFields; + procedure SetCustomFields(const AValue: TcxSchedulerStorageFields); + protected + function CreateDataProvider: TcxSchedulerAggregateStorageDataSource; virtual; + procedure DestroyDataProvider; + procedure DoDeleteEvent(const ARecordIndex: Integer); override; + procedure DoEventInserting(AEvent: TcxSchedulerEvent; out AStorage: TcxCustomSchedulerStorage); virtual; + procedure DoRefresh; override; + function GetEventClass: TcxSchedulerEventClass; override; + function GetMappedID(ASource: TcxSchedulerEvent): Integer; + function GetRecordID(const ARecordIndex: Integer): Variant; override; + function InternalAddEvent(AEvent: TcxSchedulerEvent): TcxSchedulerAggregateStorageEvent; virtual; + function IsDesigning: Boolean; + function IsDestroining: Boolean; + procedure PopulateEvents(var AList: TList); virtual; + procedure PostEvent(AEvent: TcxSchedulerEvent); override; + procedure SendNotification(AIsRemoved: Boolean = False); override; + procedure SynchronizeEventsWithRecords; override; + + // IcxSchedulerStorageListener & IcxSchedulerStorageListener2 + procedure StorageChanged(Sender: TObject); + procedure StorageRemoved(Sender: TObject); + + property Provider: TcxSchedulerAggregateStorageDataSource read FProvider; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + procedure Assign(Source: TPersistent); override; + procedure Clear; override; + function createEvent: TcxSchedulerEvent; override; + procedure GenerateHolidayEvents(const AResourceID: Variant); override; + function GetHolidayNamesByDate(ADate: TDate; var ANames: string; + AOnlyVisible: Boolean = True): Boolean; override; + function IsActive: Boolean; override; + procedure PopulateHolidayDates(AList: TcxSchedulerDateList; AStart, AFinish: TDate; + AOnlyVisible: Boolean = True; AClearList: Boolean = True); override; + published + property CustomFields: TcxSchedulerStorageFields read GetCustomFields write SetCustomFields; + property Reminders; + property Resources; + property Links: TcxSchedulerStorageLinks read FLinks write FLinks; + property OnEventInserting: TcxSchedulerEventInsertingEvent read + FOnEventInserting write FOnEventInserting; + property OnEventIntersect; + end; + +implementation + +uses + SysUtils, Variants, Types, cxVariants; + +type + + TcxSyncObject = class(TList) + public + IsSource: Boolean; + Link: TObject; + Source: TObject; + IsUnique: Boolean; + end; + + TcxSynchronizer = class(TcxObjectList) + private + function GetItem(AIndex: Integer): TcxSyncObject; + protected + function Add(ALink, ASource: TObject; AIsSource: Boolean): TcxSyncObject; + public + procedure AddItems(AEvents: TList); + procedure AddSources(AEvents: TList); + procedure Synchronize; + + property Items[AIndex: Integer]: TcxSyncObject read GetItem; + end; + + +function cxCompareSyncObjects(AItem1, AItem2: TcxSyncObject): Integer; +begin + Result := Integer(AItem1.Source) - Integer(AItem2.Source); + if Result = 0 then + Result := Integer(AItem2.IsSource) - Integer(AItem1.IsSource); +end; + +function cxCompareEventsByIndex(AEvent1, AEvent2: TcxSchedulerEvent): Integer; +begin + Result := Integer(AEvent1) - Integer(AEvent2); + if Result <> 0 then + begin + if AEvent1 = nil then + Result := 1 + else + if AEvent2 = nil then + Result := -1 + else + Result := AEvent1.RecordIndex - AEvent2.RecordIndex; + end; +end; + +{ TcxSynchronizer } + +procedure TcxSynchronizer.AddItems(AEvents: TList); +var + I: Integer; + AEvent: TcxSchedulerAggregateStorageEvent; +begin + for I := 0 to AEvents.Count - 1 do + begin + AEvent := TcxSchedulerAggregateStorageEvent(AEvents.List^[I]); + Add(AEvent, AEvent.SourceEvent, False); + end; +end; + +procedure TcxSynchronizer.AddSources(AEvents: TList); +var + I: Integer; +begin + for I := 0 to AEvents.Count - 1 do + Add(AEvents.List^[I], AEvents.List^[I], True); +end; + +function TcxSynchronizer.Add(ALink, ASource: TObject; AIsSource: Boolean): TcxSyncObject; +begin + Result := TcxSyncObject.Create; + Result.Link := ALink; + Result.Source := ASource; + Result.IsSource := AIsSource; + inherited Add(Result); +end; + +{$B-} + +procedure TcxSynchronizer.Synchronize; +var + I: Integer; + AItem: TcxSyncObject; +begin + Sort(@cxCompareSyncObjects); + for I := 0 to Count - 1 do + begin + AItem := Items[I]; + if AItem.IsSource then + AItem.IsUnique := (I = (Count - 1)) or (AItem.Source <> Items[I + 1].Source) + else + AItem.IsUnique := (I = 0) or (AItem.Source <> Items[I - 1].Source); + end; +end; + +function TcxSynchronizer.GetItem(AIndex: Integer): TcxSyncObject; +begin + Result := TcxSyncObject(List^[AIndex]); +end; + +function cxCompareEvents(AItem1, AItem2: Integer): Integer; +begin + Result := AItem1 - AItem2; +end; + +procedure cxMakeUniqueList(AList: TList); +var + I: Integer; +begin + AList.Sort(@cxCompareEvents); + for I := AList.Count - 1 downto 1 do + if AList[I] = AList[I - 1] then + AList.Delete(I); +end; + +{ TcxSchedulerStorageLink } + +destructor TcxSchedulerStorageLink.Destroy; +begin + if Default then + Links.DefaultLink := nil; + Storage := nil; + inherited Destroy; +end; + +procedure TcxSchedulerStorageLink.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerStorageLink then + with Source as TcxSchedulerStorageLink do + begin + Self.Storage := Storage; + Self.Default := Default; + end + else + inherited Assign(Source); +end; + +function TcxSchedulerStorageLink.GetAggregateStorage: TcxSchedulerAggregateStorage; +begin + Result := Links.AggregateStorage; +end; + +function TcxSchedulerStorageLink.GetDefault: Boolean; +begin + Result := Links.DefaultLink = Self; +end; + +function TcxSchedulerStorageLink.GetLinks: TcxSchedulerStorageLinks; +begin + Result := inherited Collection as TcxSchedulerStorageLinks; +end; + +procedure TcxSchedulerStorageLink.SetDefault(AValue: Boolean); +begin + if AValue then + Links.DefaultLink := Self; +end; + +procedure TcxSchedulerStorageLink.SetStorage(AValue: TcxCustomSchedulerStorage); +begin + if (Links.GetStorageLinkIndex(AValue) = -1) and + (AValue <> AggregateStorage) then + begin + AggregateStorage.BeginUpdate; + try + if FStorage <> nil then + FStorage.RemoveListener(AggregateStorage); + FStorage := AValue; + if FStorage <> nil then + FStorage.AddListener(AggregateStorage); + Changed(True); + finally + AggregateStorage.EndUpdate; + end; + end; +end; + +{ TcxSchedulerStorageLinks } + +constructor TcxSchedulerStorageLinks.CreateEx(AOwner: TcxSchedulerAggregateStorage); +begin + Create(GetItemLinkClass); + FAggregateStorage := AOwner; +end; + +function TcxSchedulerStorageLinks.AddStorageLink( + AStorage: TcxCustomSchedulerStorage): TcxSchedulerStorageLink; +begin + Result := nil; + if GetStorageLinkIndex(AStorage) < 0 then + begin + Result := Add as TcxSchedulerStorageLink; + Result.Storage := AStorage; + end; +end; + +function TcxSchedulerStorageLinks.GetStorageLinkIndex( + AStorage: TcxCustomSchedulerStorage): Integer; +begin + if AStorage <> nil then + for Result := 0 to Count - 1 do + if Items[Result].Storage = AStorage then Exit; + Result := -1; +end; + +procedure TcxSchedulerStorageLinks.PopulateHolidays(AList: TList); +var + I: Integer; +begin + for I := 0 to Count - 1 do + with Items[I] do + begin + if (Storage <> nil) then + if Storage is TcxSchedulerAggregateStorage then + TcxSchedulerAggregateStorage(Storage).Links.PopulateHolidays(AList) + else + if Storage.Holidays <> nil then + AList.Add(Storage.Holidays); + end; + cxMakeUniqueList(AList); +end; + +function TcxSchedulerStorageLinks.GetItemLinkClass: TcxSchedulerStorageLinkClass; +begin + Result := TcxSchedulerStorageLink; +end; + +procedure TcxSchedulerStorageLinks.Update(Item: TCollectionItem); +var + I: Integer; +begin + inherited Update(Item); + if Count > 0 then + begin + if (FDefaultLink = nil) or (FDefaultLink.Storage = nil) then + begin + for I := 0 to Count - 1 do + if Items[I].Storage <> nil then + begin + FDefaultLink := Items[I]; + Break; + end; + end; + end; + AggregateStorage.StorageChanged(nil); +end; + +function TcxSchedulerStorageLinks.GetDefaultStorage: TcxCustomSchedulerStorage; +begin + if FDefaultLink <> nil then + Result := FDefaultLink.Storage + else + Result := nil; +end; + +function TcxSchedulerStorageLinks.GetItem(AIndex: + Integer): TcxSchedulerStorageLink; +begin + Result := TcxSchedulerStorageLink(inherited Items[AIndex]); +end; + +procedure TcxSchedulerStorageLinks.SetDefaultLink( + AValue: TcxSchedulerStorageLink); +begin + if (AValue = nil) or (AValue.Storage <> nil) then + FDefaultLink := AValue; + Changed; +end; + +procedure TcxSchedulerStorageLinks.SetItem(AIndex: Integer; + AValue: TcxSchedulerStorageLink); +begin + Items[AIndex].Assign(AValue); +end; + +{ TcxSchedulerAggregateStorageEvent } + +procedure TcxSchedulerAggregateStorageEvent.DeleteExceptions; +begin + SourceEvent.DeleteExceptions; +end; + +procedure TcxSchedulerAggregateStorageEvent.RemoveRecurrence; +begin + SourceEvent.RemoveRecurrence; +end; + +procedure TcxSchedulerAggregateStorageEvent.CheckParentID; +begin + if (MappedParentID = -1) and (SourceEvent.Pattern <> nil) then + MappedParentID := Storage.GetMappedID(SourceEvent.Pattern); +end; + +function TcxSchedulerAggregateStorageEvent.GetParentID: Variant; +begin + Result := MappedParentID; +end; + +function TcxSchedulerAggregateStorageEvent.GetValueByIndex(AIndex: Integer): Variant; +begin + if (SourceEvent = nil) and IsEditing then + begin + if (AIndex = TcxSchedulerAggregateStorage(Storage).FParentIDField.Index) and + (EventType in [etCustom, etException]) and + ((FPattern <> nil) or (ParentID >= 0)) then + begin + if FPattern <> nil then + Result := TcxSchedulerAggregateStorageEvent(FPattern).SourceEvent.ID + else + Result := TcxSchedulerAggregateStorageEvent(Storage.GetEventByID(ParentID)).SourceEvent.ID; + end + else + Result := FEditValues[AIndex] + end + else + Result := inherited GetValueByIndex(AIndex); +end; + +procedure TcxSchedulerAggregateStorageEvent.SetSourceEvent(AValue: TcxSchedulerEvent); +begin + FSourceEvent := AValue; +end; + +procedure TcxSchedulerAggregateStorageEvent.SetValue(AField: TcxCustomSchedulerStorageField; + const AValue: Variant); +begin + if IsEditing and + (AField = TcxSchedulerAggregateStorage(Storage).FParentIDField) then + MappedParentID := AValue + else + inherited SetValue(AField, AValue); +end; + +function TcxSchedulerAggregateStorageEvent.GetStorage: TcxSchedulerAggregateStorage; +begin + Result := TcxSchedulerAggregateStorage(inherited Storage); +end; + +{ TcxSchedulerAggregateStorageDataSource } + +constructor TcxSchedulerAggregateStorageDataSource.Create(AStorage: TcxSchedulerAggregateStorage); +begin + FStorage := AStorage; +end; + +function TcxSchedulerAggregateStorageDataSource.GetRecordCount: Integer; +begin + Result := Storage.EventCount; +end; + +function TcxSchedulerAggregateStorageDataSource.GetRecordId( + ARecordHandle: TcxDataRecordHandle): Variant; +begin + Result := TcxSchedulerAggregateStorageEvent(ARecordHandle).MappedID; +end; + +function TcxSchedulerAggregateStorageDataSource.GetRecordHandle( + ARecordIndex: Integer): TcxDataRecordHandle; +begin + Result := Storage.FEventsList[ARecordIndex]; +end; + +function TcxSchedulerAggregateStorageDataSource.GetValue( + ARecordHandle: TcxDataRecordHandle; AItemHandle: TcxDataItemHandle): Variant; +begin + with TcxSchedulerAggregateStorageEvent(ARecordHandle).SourceEvent do + Result := Values[Integer(AItemHandle)]; +end; + +function TcxSchedulerAggregateStorageDataSource.IsRecordIdSupported: Boolean; +begin + Result := True; +end; + +procedure TcxSchedulerAggregateStorageDataSource.SetValue( + ARecordHandle: TcxDataRecordHandle; AItemHandle: TcxDataItemHandle; const AValue: Variant); +begin + with TcxSchedulerAggregateStorageEvent(ARecordHandle).SourceEvent do + Values[Integer(AItemHandle)] := AValue; +end; + +{ TcxSchedulerAggregateStorage } + +constructor TcxSchedulerAggregateStorage.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FLinks := TcxSchedulerStorageLinks.CreateEx(Self); + FProvider := CreateDataProvider; + DataController.CustomDataSource := FProvider; +end; + +destructor TcxSchedulerAggregateStorage.Destroy; +begin + DestroyDataProvider; + FLinks.Free; + inherited Destroy; +end; + +procedure TcxSchedulerAggregateStorage.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerAggregateStorage then + Links.Assign(TcxSchedulerAggregateStorage(Source).Links); + inherited Assign(Source); +end; + +procedure TcxSchedulerAggregateStorage.Clear; +var + I: Integer; +begin + BeginUpdate; + try + for I := 0 to Links.Count - 1 do + if Links[I].Storage <> nil then + Links[I].Storage.Clear; + finally + EndUpdate; + end; +end; + +function TcxSchedulerAggregateStorage.createEvent: TcxSchedulerEvent; +begin + Result := inherited createEvent; + Inc(FCounter); + with TcxSchedulerAggregateStorageEvent(Result) do + begin + MappedID := FCounter; + MappedParentID := -2; + end; +end; + +procedure TcxSchedulerAggregateStorage.GenerateHolidayEvents(const AResourceID: Variant); +var + AHolidaysList: TList; + I: Integer; +begin + AHolidaysList := TList.Create; + try + Links.PopulateHolidays(AHolidaysList); + for I := 0 to AHolidaysList.Count - 1 do + GenerateHolidayEventsBySchedulerHolidays(AResourceID, TcxSchedulerHolidays(AHolidaysList[I])); + finally + AHolidaysList.Free; + end; +end; + +function TcxSchedulerAggregateStorage.GetHolidayNamesByDate(ADate: TDate; var ANames: string; + AOnlyVisible: Boolean = True): Boolean; +var + I: Integer; + AHolidaysList: TList; +begin + AHolidaysList := TList.Create; + try + Links.PopulateHolidays(AHolidaysList); + for I := 0 to AHolidaysList.Count - 1 do + TcxSchedulerHolidays(AHolidaysList.Items[I]).GetHolidayNamesByDate(ADate, ANames, AOnlyVisible); + finally + FreeAndNil(AHolidaysList); + Result := ANames <> ''; + end; +end; + +function TcxSchedulerAggregateStorage.IsActive: Boolean; +begin + Result := (Links <> nil) and (Links.Count > 0) and (Links.DefaultStorage <> nil) and + (Links.DefaultStorage.IsActive or Assigned(FOnEventInserting)); +end; + +procedure TcxSchedulerAggregateStorage.PopulateHolidayDates(AList: TcxSchedulerDateList; + AStart, AFinish: TDate; AOnlyVisible: Boolean = True; AClearList: Boolean = True); + + procedure AddHolidays(AHolidays: TcxSchedulerHolidays); + begin + AHolidays.PopulateHolidayDates(AList, AStart, AFinish, AOnlyVisible, False); + end; + +var + AHolidaysList: TList; + I: Integer; +begin + AHolidaysList := TList.Create; + try + Links.PopulateHolidays(AHolidaysList); + if AClearList then + AList.Clear; + for I := 0 to AHolidaysList.Count - 1 do + AddHolidays(AHolidaysList[I]); + finally + FreeAndNil(AHolidaysList); + end; +end; + +procedure TcxSchedulerAggregateStorage.DoDeleteEvent(const ARecordIndex: Integer); +begin + if (ARecordIndex >= 0) and (ARecordIndex < EventCount) then + begin + if Events[ARecordIndex] = LastEditedEvent then + FLastEditedEvent := nil; + TcxSchedulerAggregateStorageEvent(Events[ARecordIndex]).SourceEvent.Delete; + end; +end; + +procedure TcxSchedulerAggregateStorage.DoEventInserting(AEvent: TcxSchedulerEvent; + out AStorage: TcxCustomSchedulerStorage); +begin + if (AEvent.EventType in [etCustom, etException]) and + ((AEvent.Pattern <> nil) or (AEvent.ParentID >= 0)) then + begin + if AEvent.Pattern <> nil then + AStorage := TcxSchedulerAggregateStorageEvent(AEvent.Pattern).SourceEvent.Storage + else + AStorage := TcxSchedulerAggregateStorageEvent(GetEventByID(AEvent.ParentID)).SourceEvent.Storage; + Exit; + end; + AStorage := Links.DefaultStorage; + if Assigned(FOnEventInserting) then + FOnEventInserting(Self, AEvent, AStorage); +end; + +procedure TcxSchedulerAggregateStorage.DoRefresh; +begin + if CanRefresh then + inherited DoRefresh; +end; + +function TcxSchedulerAggregateStorage.CreateDataProvider: TcxSchedulerAggregateStorageDataSource; +begin + Result := TcxSchedulerAggregateStorageDataSource.Create(Self); +end; + +procedure TcxSchedulerAggregateStorage.DestroyDataProvider; +begin + DataController.CustomDataSource := nil; + FreeAndNil(FProvider); +end; + +function TcxSchedulerAggregateStorage.GetEventClass: + TcxSchedulerEventClass; +begin + Result := TcxSchedulerAggregateStorageEvent; +end; + +function TcxSchedulerAggregateStorage.GetMappedID(ASource: TcxSchedulerEvent): Integer; +var + I: Integer; +begin + Result := -2; + if ASource = nil then Exit; + for I := EventCount - 1 downto 0 do + with TcxSchedulerAggregateStorageEvent(FEventsList[I]) do + if SourceEvent = ASource then + begin + Result := MappedID; + Break; + end; +end; + +function TcxSchedulerAggregateStorage.GetRecordID( + const ARecordIndex: Integer): Variant; +begin + Result := TcxSchedulerAggregateStorageEvent(Events[ARecordIndex]).MappedID; +end; + +function TcxSchedulerAggregateStorage.InternalAddEvent( + AEvent: TcxSchedulerEvent): TcxSchedulerAggregateStorageEvent; +begin + Inc(FCounter); + Result := GetEventClass.Create(Self, -1) as TcxSchedulerAggregateStorageEvent; + Result.FSourceEvent := AEvent; + Result.MappedID := FCounter; + Result.SetRecordIndex(FEventsList.Add(Result)); + Result.MappedParentID := GetMappedID(AEvent.Pattern); +end; + +function TcxSchedulerAggregateStorage.IsDesigning: Boolean; +begin + Result := csDesigning in ComponentState; +end; + +function TcxSchedulerAggregateStorage.IsDestroining: Boolean; +begin + Result := csDestroying in ComponentState; +end; + +procedure TcxSchedulerAggregateStorage.PopulateEvents(var AList: TList); + + procedure PopulateStorageEvents(AStorage: TcxCustomSchedulerStorage); + var + AIndex: Integer; + begin + if AStorage = nil then Exit; + for AIndex := 0 to AStorage.EventCount - 1 do + AList.Add(AStorage.Events[AIndex]); + end; + +var + ALinkIndex: Integer; +begin + AList.Clear; + if Links = nil then + Exit; + for ALinkIndex := 0 to Links.Count - 1 do + PopulateStorageEvents(Links[ALinkIndex].Storage); +end; + +procedure TcxSchedulerAggregateStorage.PostEvent(AEvent: TcxSchedulerEvent); +var + ASource: TcxSchedulerEvent; + AStorage: TcxCustomSchedulerStorage; + APattern: TcxSchedulerEvent; +begin + if TcxSchedulerAggregateStorageEvent(AEvent).IsNewEvent then + begin + BeginUpdate; + try + FNewEvents.Remove(AEvent); + if not IsDestroying then + begin + APattern := nil; + if AEvent.Pattern <> nil then + APattern := AEvent.Pattern + else + if AEvent.ParentID >= 0 then + APattern := GetEventByID(AEvent.ParentID); + DoEventInserting(AEvent, AStorage); + if AStorage <> nil then + begin + ASource := AStorage.createEvent; + ASource.Assign(AEvent); + if APattern <> nil then + begin + ASource.ParentID := TcxSchedulerAggregateStorageEvent(APattern).SourceEvent.ID; + TcxSchedulerAggregateStorageEvent(ASource).FPattern := TcxSchedulerAggregateStorageEvent(APattern).SourceEvent; + TcxSchedulerAggregateStorageEvent(AEvent).MappedParentID := APattern.ID; + end; + TcxSchedulerAggregateStorageEvent(AEvent).SetSourceEvent(ASource); + AEvent.EndEditing; + with TcxSchedulerAggregateStorageEvent(AEvent) do + SetRecordIndex(FEventsList.Add(AEvent)); + ASource.Post; + end + else + AEvent.Free; + end; + finally + EndUpdate; + end; + end; +end; + +procedure TcxSchedulerAggregateStorage.SendNotification(AIsRemoved: Boolean = False); +begin + if AIsRemoved or IsDestroining or CanRefresh then + inherited SendNotification(AIsRemoved); +end; + +procedure TcxSchedulerAggregateStorage.SynchronizeEventsWithRecords; +var + AEvents: TList; + I, ADeletedCount: Integer; + ASynchronizer: TcxSynchronizer; +begin + if FSynchronizing then Exit; + ADeletedCount := 0; + AEvents := TList.Create; + try + PopulateEvents(AEvents); + ASynchronizer := TcxSynchronizer.Create; + try + ASynchronizer.Capacity := AEvents.Count + EventCount; + ASynchronizer.AddItems(FEventsList.List); + ASynchronizer.AddSources(AEvents); + ASynchronizer.Synchronize; + for I := 0 to ASynchronizer.Count - 1 do + with ASynchronizer.Items[I] do + begin + if IsUnique then + begin + if IsSource then + InternalAddEvent(TcxSchedulerEvent(Source)) + else + begin + if FEventsList.List.List^[TcxSchedulerEvent(Link).RecordIndex] = FLastEditedEvent then + FLastEditedEvent := nil; + FEventsList.List.List^[TcxSchedulerEvent(Link).RecordIndex] := nil; + TcxSchedulerAggregateStorageEvent(Link).FIsDeletion := True; + Link.Free; + Inc(ADeletedCount); + end + end + end; + finally + ASynchronizer.Free; + end; + finally + AEvents.Free; + end; + if ADeletedCount > 0 then + begin + FEventsList.Sort(@cxCompareEventsByIndex); + FEventsList.List.Count := FEventsList.List.Count - ADeletedCount; + end; + for I := 0 to FEventsList.Count - 1 do + with TcxSchedulerAggregateStorageEvent(FEventsList[I]) do + begin + SetRecordIndex(I); + FPattern := nil; + CheckParentID; + end; +end; + +// IcxSchedulerStorageListener +procedure TcxSchedulerAggregateStorage.StorageChanged(Sender: TObject); +begin + SynchronizeEventsWithRecords; + FSynchronizing := True; + try + Provider.DataChanged; + finally + FSynchronizing := False; + SendNotification(); + end; +end; + +procedure TcxSchedulerAggregateStorage.StorageRemoved(Sender: TObject); +var + AIndex: Integer; +begin + TcxCustomSchedulerStorage(Sender).RemoveListener(Self); + AIndex := Links.GetStorageLinkIndex(TcxCustomSchedulerStorage(Sender)); + if AIndex >= 0 then + begin + Links[AIndex].FStorage := nil; + if Links.DefaultLink = Links[AIndex] then + Links.DefaultLink := nil; + end; + if not IsDestroying then + FullRefresh; +end; + +function TcxSchedulerAggregateStorage.CanRefresh: Boolean; +var + I: Integer; +begin + Result := True; + if Links <> nil then + for I := 0 to Links.Count - 1 do + if Links[I].Storage <> nil then + begin + Result := Result and (FieldCount = Links[I].Storage.FieldCount); + if not Result then + Break; + end; +end; + +function TcxSchedulerAggregateStorage.GetCustomFields: TcxSchedulerStorageFields; +begin + Result := TcxSchedulerStorageFields(inherited CustomFields); +end; + +procedure TcxSchedulerAggregateStorage.SetCustomFields(const AValue: TcxSchedulerStorageFields); +begin + CustomFields.Assign(AValue); +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerCustomControls.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerCustomControls.pas new file mode 100644 index 00000000..8d35671e --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerCustomControls.pas @@ -0,0 +1,11760 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerCustomControls; + +{$I cxVer.inc} + +interface +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Classes, SysUtils, Windows, Messages, Forms, StdCtrls, Controls, Graphics, ImgList, + cxControls, Math, cxGraphics, cxGeometry, cxLookAndFeels, cxLookAndFeelPainters, + cxFormats, cxSchedulerUtils, cxSchedulerStorage, cxStyles, cxClasses, cxEdit, + cxDateUtils, ExtCtrls, Menus, cxStorage, cxTextEdit, cxNavigator, cxVariants, + Clipbrd; + +const + LastAvailableDate = $2D2462; + + // resize bitmap capacity + cxSizeDelta = 32; + + // + cxDefaultTimeScale = 30; + + //hittest codes + //base class + htcControl = $0; + htcTime = $1; + //custom viewinfo + htcResource = $2; + + // style indexes + cxcsBackground = 0; + cxcsContent = 1; + cxcsEvent = 2; + cxcsGroupSeparator = 3; + cxcsDayHeader = 4; + cxcsSelection = 5; + cxcsHSplitter = 6; + cxcsVSplitter = 7; + cxcsResourceHeader = 8; + cxcsMaxValue = cxcsResourceHeader; + // for PS + cxcsSchedulerStyleFirst = cxcsBackground; + cxcsSchedulerStyleLast = cxcsMaxValue; + + // default property values + cxDefaultSchedulerHeight = 250; + cxDefaultSchedulerWidth = 350; + cxDefaultSplitterWidth = 5; + cxDefaultGroupSeparatorWidth = 11; + cxDefaultResourcesPerPage = 0; + + // minimal property values + cxMinSplitterWidth = 3; + + // hint timings + cxscMinHintWidth: Integer = 150; + cxscMaxHintWidth: Integer = 1000; + + // + cxScrollInterval = 25; + cxScrollZoneSize = 10; + // + cxNavigatorStartTimer = 300; + + // navigator's buttons + cxSchedulerFirstButton = 0; + cxSchedulerPrevPageButton = 1; + cxSchedulerPrevButton = 2; + cxSchedulerNextButton = 3; + cxSchedulerNextPageButton = 4; + cxSchedulerLastButton = 5; + cxSchedulerShowMoreResourcesButton = 6; + cxSchedulerShowFewerResourcesButton = 7; + + cxSchedulerNavigatorVisibility: array[0..7] of Boolean = + (True, False, False, False, False, True, True, True); + + SCF_SCHEDULERCLIPBOARDFORMAT = 'ExpressScheduler 2.0'; + +type + TcxCustomScheduler = class; + + TcxSchedulerSubControl = class; + TcxSchedulerSubControlController = class; + TcxSchedulerSubControlHitTest = class; + TcxSchedulerSubControlPainter = class; + TcxSchedulerSubControlViewInfo = class; + TcxSchedulerSplitter = class; + TcxSchedulerStyles = class; + // popup menus + TcxSchedulerContentPopupMenu = class; + TcxSchedulerEventPopupMenu = class; + + TcxSchedulerViewController = class; + TcxSchedulerCustomView = class; + TcxSchedulerCustomViewClass = class of TcxSchedulerCustomView; + TcxSchedulerCustomViewViewInfo = class; + TcxDragHelper = class; + TcxDragEventHelper = class; + TcxEventSizingHelper = class; + TcxSchedulerCustomDateNavigator = class; + + TcxSchedulerNavigatorButton = class; + TcxSchedulerResourceNavigator = class; + + TcxSchedulerOptionsView = class; + + TcxSchedulerHintController = class; + + TcxControlFlag = (cfInvalidLayout, cfLocked, cfImageValid, cfViewValid); + TcxControlFlags = set of TcxControlFlag; + + TcxSchedulerSplitterKind = (skHorizontal, skVertical); + TcxSchedulerViewPosition = (vpRight, vpLeft, vpTop, vpBottom); + + TcxSchedulerGroupingKind = (gkDefault, gkNone, gkByDate, gkByResource); + TcxSchedulerViewMode = (vmDay, vmWeek, vmMonth, vmWorkWeek); + + TcxOnDeleteEventFunc = function (AEvent: TcxSchedulerControlEvent): Boolean of object; + TcxSchedulerDragAndDropObject = class; + + TcxSchedulerContentPopupMenuItem = (cpmiNewEvent, cpmiNewAllDayEvent, + cpmiNewReccuringEvent, cpmiToday, cpmiGoToDate, cpmiGoToThisDay, cpmiResourcesLayout); + TcxSchedulerContentPopupMenuItems = set of TcxSchedulerContentPopupMenuItem; + + { TcxSchedulerEventEditInfo } + + TcxSchedulerEventEditInfo = class + public + AllowDelete: Boolean; + AllowHiddenEvents: Boolean; + BiasTime: TDateTime; + Intersection: Boolean; + Event: TcxSchedulerControlEvent; + ForcePatternEditing: Boolean; + LookAndFeel: TcxLookAndFeel; + OnDeleteFunc: TcxOnDeleteEventFunc; + ReadOnly: Boolean; + Recurrence: Boolean; + RecurrenceButton: Boolean; + ShowResources: Boolean; + ShowTaskComplete: Boolean; + end; + + { TcxSchedulerSubControl } + + TcxSchedulerSubControl = class(TPersistent) + private + FCanvas: TcxCanvas; + FController: TcxSchedulerSubControlController; + FCursor: TCursor; + FHeight: Integer; + FHitTest: TcxSchedulerSubControlHitTest; + FLeft: Integer; + FPainter: TcxSchedulerSubControlPainter; + FScheduler: TcxCustomScheduler; + FTop: Integer; + FViewInfo: TcxSchedulerSubControlViewInfo; + FVisible: Boolean; + FWidth: Integer; + {$IFNDEF DEBUGPAINT} + function GetBitmap: TBitmap; + {$ENDIF} + function GetBottom: Integer; + function GetBounds: TRect; + function GetDateTimeHelperClass: TcxSchedulerDateTimeHelperClass; + function GetIsScrollingContent: Boolean; + function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; + function GetPainterHelperClass: TcxSchedulerPainterHelperClass; + function GetRight: Integer; + function GetStyles: TcxSchedulerStyles; + procedure InternalSetBounds(const AValue: TRect); + procedure SetBottom(const Value: Integer); + procedure SetHeight(AValue: Integer); + procedure SetLeft(AValue: Integer); + procedure SetRight(Value: Integer); + procedure SetTop(AValue: Integer); + procedure SetVisible(AValue: Boolean); + procedure SetWidth(AValue: Integer); + protected + // store interface + procedure GetProperties(AProperties: TStrings); virtual; + procedure GetPropertyValue(const AName: string; var AValue: Variant); virtual; + procedure SetPropertyValue(const AName: string; const AValue: Variant); virtual; + // + function AllowDesignHitTest(X, Y: Integer; AShift: TShiftState): Boolean; virtual; + procedure BoundsChanged; virtual; + procedure CalculateViewInfo; virtual; + function CanCapture(const APoint: TPoint): Boolean; virtual; + procedure Changed; virtual; + function CreateController: TcxSchedulerSubControlController; virtual; + function CreateHitTest: TcxSchedulerSubControlHitTest; virtual; + function CreatePainter: TcxSchedulerSubControlPainter; virtual; + function CreateViewInfo: TcxSchedulerSubControlViewInfo; virtual; + + procedure BoundsChanging; virtual; + procedure CreateSubClasses; virtual; + procedure DestroySubClasses; virtual; + procedure DoBeforeMouseDown(AButton: TMouseButton; AShift: TShiftState; X, Y: Integer); + procedure DoCancelMode; virtual; + procedure DoLayoutChanged; virtual; + procedure DoMouseDown(AButton: TMouseButton; AShift: TShiftState; X, Y: Integer); virtual; + procedure DoMouseMove(AShift: TShiftState; X, Y: Integer); + procedure DoMouseUp(AButton: TMouseButton; AShift: TShiftState; X, Y: Integer); + procedure DoPaint; virtual; + procedure DoScaleScroll; virtual; + procedure FormatChanged; virtual; + function GetClientRect: TRect; virtual; + function GetOwner: TPersistent; override; + function GetHScrollBarBounds: TRect; virtual; + function GetScrollBar(AKind: TScrollBarKind): TcxControlScrollBar; + function GetSizeGripBounds: TRect; virtual; + function GetStartOfWeek: TDay; virtual; + function GetVScrollBarBounds: TRect; virtual; + procedure InitScrollBarsParameters; virtual; + function IsSpecialPaint: Boolean; virtual; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); virtual; + procedure MousePositionChanged(var X, Y: Integer); + procedure Notification(AComponent: TComponent; Operation: TOperation); virtual; + procedure Paint; + procedure PeriodChanged; virtual; + procedure SetScrollBarInfo(AScrollBarKind: TScrollBarKind; + AMin, AMax, AStep, APage, APos: Integer; AAllowShow, AAllowHide: Boolean); + procedure VisibleChanged; virtual; + + property Canvas: TcxCanvas read FCanvas; + {$IFNDEF DEBUGPAINT} + property Bitmap: TBitmap read GetBitmap; + {$ENDIF} + property Bottom: Integer read GetBottom write SetBottom; + property ClientRect: TRect read GetClientRect; + property Controller: TcxSchedulerSubControlController read FController; + property Cursor: TCursor read FCursor write FCursor; + property DateTimeHelper: TcxSchedulerDateTimeHelperClass read GetDateTimeHelperClass; + property HitTest: TcxSchedulerSubControlHitTest read FHitTest; + property IsScrollingContent: Boolean read GetIsScrollingContent; + property Left: Integer read FLeft write SetLeft; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter; + property Painter: TcxSchedulerSubControlPainter read FPainter; + property PainterHelper: TcxSchedulerPainterHelperClass read GetPainterHelperClass; + property Right: Integer read GetRight write SetRight; + property Scheduler: TcxCustomScheduler read FScheduler; + property StartOfWeek: TDay read GetStartOfWeek; + property Styles: TcxSchedulerStyles read GetStyles; + property Top: Integer read FTop write SetTop; + property ViewInfo: TcxSchedulerSubControlViewInfo read FViewInfo; + property Visible: Boolean read FVisible write SetVisible; + public + constructor Create(AOwner: TcxCustomScheduler); virtual; + destructor Destroy; override; + procedure Invalidate; + procedure InvalidateRect(const ARect: TRect); + procedure LayoutChanged; + procedure Refresh; + procedure Repaint; + procedure RepaintRect(const ARect: TRect); + function ScreenToClient(const APos: TPoint): TPoint; + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); + + property Bounds: TRect read GetBounds write InternalSetBounds; + property Height: Integer read FHeight write SetHeight; + property Width: Integer read FWidth write SetWidth; + end; + + { TcxSchedulerSubControlController } + + TcxSchedulerSubControlController = class(TcxIUnknownObject) + private + FCanProcessMouseMove: Boolean; + FOwner: TcxSchedulerSubControl; + function GetHitTest: TcxSchedulerSubControlHitTest; + function GetStartOfWeek: TDay; + protected + // drag'n'drop + procedure BeginDragAndDrop; virtual; + function CanDrag(X, Y: Integer): Boolean; virtual; + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); virtual; + procedure DragDrop(Source: TObject; X, Y: Integer); virtual; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); virtual; + procedure EndDrag(Target: TObject; X, Y: Integer); virtual; + procedure EndDragAndDrop(Accepted: Boolean); virtual; + function GetDragAndDropObjectClass: TcxDragAndDropObjectClass; virtual; + procedure StartDrag(var DragObject: TDragObject); virtual; + function StartDragAndDrop(const P: TPoint): Boolean; virtual; + // virtuals + procedure BeforeMouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); virtual; + procedure DoCancelMode; virtual; + function GetCursor(X, Y: Integer): TCursor; virtual; + procedure KeyDown(var Key: Word; Shift: TShiftState); virtual; + procedure KeyPress(var Key: Char); virtual; + procedure KeyUp(var Key: Word; Shift: TShiftState); virtual; + procedure MouseEnter; virtual; + procedure MouseLeave; virtual; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); virtual; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); virtual; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); virtual; + procedure Reset; virtual; + + property CanProcessMouseMove: Boolean read FCanProcessMouseMove; + public + constructor Create(AOwner: TcxSchedulerSubControl); virtual; + + property HitTest: TcxSchedulerSubControlHitTest read GetHitTest; + property Owner: TcxSchedulerSubControl read FOwner; + property StartOfWeek: TDay read GetStartOfWeek; + end; + + { TcxSchedulerSubControlHitTest } + + TcxSchedulerSubControlHitTest = class + private + FOwner: TcxSchedulerSubControl; + FHitPoint: TPoint; + function GetPosValue(AIndex: Integer): Integer; + function GetScheduler: TcxCustomScheduler; + procedure SetHitPoint(const APoint: TPoint); + procedure SetPosValue(AIndex, AValue: Integer); + protected + FTime: TDateTime; + Flags: Int64; + procedure Clear; virtual; + procedure DoCalculate; virtual; + function GetBitState(AIndex: Integer): Boolean; + function GetMaskState(AMask: Integer): Boolean; + function GetMaskStateEx(AMask: Integer): Boolean; + procedure SetBitState(AIndex: Integer; AValue: Boolean); + procedure SetMaskState(AMask: Integer; AValue: Boolean); + property Owner: TcxSchedulerSubControl read FOwner; + property Scheduler: TcxCustomScheduler read GetScheduler; + public + constructor Create(AOwner: TcxSchedulerSubControl); virtual; + destructor Destroy; override; + procedure Recalculate; + + property HitPoint: TPoint read FHitPoint write SetHitPoint; + property HitX: Integer index 0 read GetPosValue write SetPosValue; + property HitY: Integer index 1 read GetPosValue write SetPosValue; + property HitAtControl: Boolean index htcControl read GetBitState; + property HitAtTime: Boolean index htcTime read GetBitState; + property Time: TDateTime read FTime; + end; + + { TcxSchedulerSubControlPainter } + + TcxSchedulerSubControlPainter = class + private + FOwner: TcxSchedulerSubControl; + {$IFNDEF DEBUGPAINT} + function GetBitmap: TBitmap; + {$ENDIF} + function GetCanvas: TcxCanvas; + function GetViewInfo: TcxSchedulerSubControlViewInfo; + protected + property Owner: TcxSchedulerSubControl read FOwner; + property ViewInfo: TcxSchedulerSubControlViewInfo read GetViewInfo; + public + constructor Create(AOwner: TcxSchedulerSubControl); virtual; + procedure AfterPaint; virtual; + procedure BeforePaint; virtual; + procedure InitializePainter; virtual; + procedure Paint; virtual; + + property Canvas: TcxCanvas read GetCanvas; + {$IFNDEF DEBUGPAINT} + property Bitmap: TBitmap read GetBitmap; + {$ENDIF} + end; + + { TcxSchedulerSubControlViewInfo } + + TcxSchedulerSubControlViewInfo = class + private + FOwner: TcxSchedulerSubControl; + function GetDateTimeHelperClass: TcxSchedulerDateTimeHelperClass; + function GetDefaultFont: TFont; + function GetIsSchedulerCreated: Boolean; + function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; + function GetPainterHelperClass: TcxSchedulerPainterHelperClass; + function GetStyles: TcxSchedulerStyles; + protected + FBounds: TRect; + procedure AfterCalculate; virtual; + procedure Clear; virtual; + procedure DoCalculate; virtual; + function GetBounds: TRect; virtual; + + property DateTimeHelper: TcxSchedulerDateTimeHelperClass read GetDateTimeHelperClass; + property DefaultFont: TFont read GetDefaultFont; + property IsSchedulerCreated: Boolean read GetIsSchedulerCreated; + property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter; + property Bounds: TRect read FBounds; + property Owner: TcxSchedulerSubControl read FOwner; + property PainterHelper: TcxSchedulerPainterHelperClass read GetPainterHelperClass; + property Styles: TcxSchedulerStyles read GetStyles; + public + constructor Create(AOwner: TcxSchedulerSubControl); virtual; + procedure Calculate; virtual; + end; + + { TcxSchedulerBackground } + + TcxSchedulerBackground = class(TcxSchedulerSubControl) + protected + function IsSpecialPaint: Boolean; override; + end; + + { TcxSchedulerControlBox } + + TcxSchedulerControlBox = class(TcxSchedulerSubControl) + private + FContainer: TWinControl; + FControlAlign: TAlign; + FControlParent: TWinControl; + FControlRect: TRect; + FControl: TControl; + FViewParams: TcxViewParams; + procedure RestorePosition; + procedure SetControl(AValue: TControl); + procedure StorePosition; + protected + // store interface + procedure GetProperties(AProperties: TStrings); override; + procedure GetPropertyValue(const AName: string; var AValue: Variant); override; + procedure SetPropertyValue(const AName: string; const AValue: Variant); override; + // + procedure BoundsChanged; override; + function CreateWndContainerControl: TWinControl; virtual; + procedure DoPaint; override; + procedure DoLayoutChanged; override; + function HasAsParent(AValue: TControl): Boolean; + procedure VisibleChanged; override; + + property ViewParams: TcxViewParams read FViewParams; + public + constructor Create(AOwner: TcxCustomScheduler); override; + procedure Assign(Source: TPersistent); override; + + property Container: TWinControl read FContainer; + property Height; + property Width; + published + property Control: TControl read FControl write SetControl; + property Visible default True; + end; + + { TcxSchedulerSplitterController } + + TcxSchedulerSplitterController = class(TcxSchedulerSubControlController) + private + FHitPoint: TPoint; + FPrevInvertRect: TRect; + FPrevRect: TRect; + FSaveKeyboardListener: TcxSchedulerSubControl; + FSizingBoundsRect: TRect; + FStartBounds: TRect; + FScreenCanvasClipRect: TRect; + function GetDrawClipRect: TRect; + function GetHorzSizingRect(const P: TPoint): TRect; + function GetScheduler: TcxCustomScheduler; + function GetScreenOffset: TPoint; + function GetSplitter: TcxSchedulerSplitter; + function GetVertSizingRect(const P: TPoint): TRect; + procedure SetHorzBounds(var R: TRect); + procedure SetHorzDelta(ADelta: Integer); + procedure SetVertBounds(var R: TRect); + procedure SetVertDelta(ADelta: Integer); + protected + // override + procedure DoCancelMode; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + // methods + procedure DrawInvertRect(const R: TRect); + procedure EraseInvertRect; + function GetMonthSize: TSize; + function GetOwnerMousePos(X, Y: Integer): TPoint; + function GetSizingBoundsRect: TRect; + function GetSizingIncrement: Integer; + function GetSizingRect(const P: TPoint): TRect; + procedure InvertRect(ACanvas: TcxCanvas; R: TRect); + function IsIntegralSizing: Boolean; + function IsDynamicUpdate: Boolean; + procedure SetSizeDelta(ADelta: Integer); + procedure UpdateSizing(const R: TRect); + + property Scheduler: TcxCustomScheduler read GetScheduler; + property ScreenCanvasClipRect: TRect read FScreenCanvasClipRect; + property ScreenOffset: TPoint read GetScreenOffset; + property SizingBoundsRect: TRect read FSizingBoundsRect; + property Splitter: TcxSchedulerSplitter read GetSplitter; + end; + + { TcxSchedulerSplitterHitTest } + + TcxSchedulerSplitterHitTest = class(TcxSchedulerSubControlHitTest) + private + function GetSplitter: TcxSchedulerSplitter; + public + property Splitter: TcxSchedulerSplitter read GetSplitter; + end; + + { TcxSchedulerSplitter } + + TcxSchedulerSplitter = class(TcxSchedulerBackground) + private + FKind: TcxSchedulerSplitterKind; + FViewParams: TcxViewParams; + function GetHitTest: TcxSchedulerSplitterHitTest; + protected + function AllowDesignHitTest(X, Y: Integer; AShift: TShiftState): Boolean; override; + function CreateController: TcxSchedulerSubControlController; override; + function CreateHitTest: TcxSchedulerSubControlHitTest; override; + procedure DoLayoutChanged; override; + procedure DoPaint; override; + procedure SetKind(AKind: TcxSchedulerSplitterKind); virtual; + procedure UpdateCursor; + + property HitTest: TcxSchedulerSplitterHitTest read GetHitTest; + property ViewParams: TcxViewParams read FViewParams; + public + property Kind: TcxSchedulerSplitterKind read FKind; + end; + + { TcxSchedulerNavigatorButton } + + TcxSchedulerNavigatorButtonClickEvent = procedure(Sender: TcxSchedulerResourceNavigator; + AButton: TcxSchedulerNavigatorButton; var AHandled: Boolean) of object; + + TcxSchedulerNavigatorButton = class(TCollectionItem) + private + FCommand: Integer; + FEnabled: Boolean; + FHint: string; + FImageIndex: Integer; + FVisible: Boolean; + function GetScheduler: TcxCustomScheduler; + procedure SetEnabled(AValue: Boolean); + procedure SetImageIndex(AValue: Integer); + procedure SetVisible(AValue: Boolean); + function IsHintStored: Boolean; + function IsEnabledStored: Boolean; + function IsVisibleStored: Boolean; + protected + FBounds: TRect; + FRotated: Boolean; + FState: TcxButtonState; + FVisibleIndex: Integer; + procedure Changed; virtual; + procedure Click; virtual; + function GetDisplayName: string; override; + function GetHintText: string; + procedure Draw(APainter: TcxCustomLookAndFeelPainterClass; ACanvas: TcxCanvas); virtual; + function GetActualImageIndex: Integer; virtual; + function GetActualImageList: TCustomImageList; virtual; + function GetState(ACanDisabled: Boolean = True): TcxButtonState; + function GetIsStandard: Boolean; virtual; + + property Command: Integer read FCommand write FCommand; + public + constructor Create(Collection: TCollection); override; + procedure Assign(Source: TPersistent); override; + + property ActualImageIndex: Integer read GetActualImageIndex; + property ActualImageList: TCustomImageList read GetActualImageList; + property Bounds: TRect read FBounds; + property Enabled: Boolean read FEnabled write SetEnabled stored IsEnabledStored; + property Rotated: Boolean read FRotated; + property Scheduler: TcxCustomScheduler read GetScheduler; + property IsStandard: Boolean read GetIsStandard; + property State: TcxButtonState read FState; + property VisibleIndex: Integer read FVisibleIndex; + published + property Hint: string read FHint write FHint stored IsHintStored; + property ImageIndex: Integer read FImageIndex write SetImageIndex default -1; + property Visible: Boolean read FVisible write SetVisible stored IsVisibleStored; + end; + + { TcxSchedulerNavigatorCustomButton } + + TcxSchedulerNavigatorCustomButton = class(TcxSchedulerNavigatorButton) + published + property Enabled; + end; + + TcxSchedulerNavigatorButtonClass = class of TcxSchedulerNavigatorButton; + + { TcxSchedulerNavigatorCustomButtons } + + TcxSchedulerNavigatorCustomButtons = class(TCollection) + private + FOwner: TPersistent; + FScheduler: TcxCustomScheduler; + function GetItem(AIndex: Integer): TcxSchedulerNavigatorCustomButton; + function GetVisibleCount: Integer; + procedure SetItem(AIndex: Integer; AValue: TcxSchedulerNavigatorCustomButton); + protected + function GetOwner: TPersistent; override; + procedure Update(Item: TCollectionItem); override; + + property Scheduler: TcxCustomScheduler read FScheduler; + public + constructor CreateEx(AOwner: TPersistent; AItemClass: TCollectionItemClass); virtual; + + property VisibleCount: Integer read GetVisibleCount; + property Items[AIndex: Integer]: TcxSchedulerNavigatorCustomButton read GetItem write SetItem; default; + end; + + { TcxSchedulerNavigatorButtons } + + TcxSchedulerNavigatorButtons = class(TPersistent) + private + FButtons: TcxSchedulerNavigatorCustomButtons; + FOwner: TcxSchedulerResourceNavigator; + function GetButtonByIndex(AIndex: Integer): TcxSchedulerNavigatorButton; + procedure SetButtonByIndex(AIndex: Integer; AValue: TcxSchedulerNavigatorButton); + protected + function AddButton(ACommand: Integer; AVisible: Boolean = True): TcxSchedulerNavigatorButton; + procedure CreateButtons; virtual; + function GetOwner: TPersistent; override; + public + constructor Create(AOwner: TcxSchedulerResourceNavigator); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + property Buttons: TcxSchedulerNavigatorCustomButtons read FButtons; + property ResourceNavigator: TcxSchedulerResourceNavigator read FOwner; + published + property First: TcxSchedulerNavigatorButton index cxSchedulerFirstButton read GetButtonByIndex write SetButtonByIndex; + property PrevPage: TcxSchedulerNavigatorButton index cxSchedulerPrevPageButton read GetButtonByIndex write SetButtonByIndex; + property Prev: TcxSchedulerNavigatorButton index cxSchedulerPrevButton read GetButtonByIndex write SetButtonByIndex; + property Next: TcxSchedulerNavigatorButton index cxSchedulerNextButton read GetButtonByIndex write SetButtonByIndex; + property NextPage: TcxSchedulerNavigatorButton index cxSchedulerNextPageButton read GetButtonByIndex write SetButtonByIndex; + property Last: TcxSchedulerNavigatorButton index cxSchedulerLastButton read GetButtonByIndex write SetButtonByIndex; + property ShowFewerResources: TcxSchedulerNavigatorButton index cxSchedulerShowFewerResourcesButton read GetButtonByIndex write SetButtonByIndex; + property ShowMoreResources: TcxSchedulerNavigatorButton index cxSchedulerShowMoreResourcesButton read GetButtonByIndex write SetButtonByIndex; + end; + + { TcxSchedulerResourceNavigatorController } + + TcxSchedulerResourceNavigatorController = class(TcxSchedulerSubControlController) + private + FHotTrackButton: TcxSchedulerNavigatorButton; + function GetHintController: TcxSchedulerHintController; + function GetResourceNavigator: TcxSchedulerResourceNavigator; + procedure SetHotTrackButton(Value: TcxSchedulerNavigatorButton); + protected + procedure BeforeMouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure CheckButtonDown(Button: TMouseButton; Shift: TShiftState); virtual; + function GetHotTrackButton(ACanDisabled: Boolean = True): TcxSchedulerNavigatorButton; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(AShift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseEnter; override; + procedure MouseLeave; override; + + property HintController: TcxSchedulerHintController read GetHintController; + property HotTrackButton: TcxSchedulerNavigatorButton read FHotTrackButton write SetHotTrackButton; + property ResourceNavigator: TcxSchedulerResourceNavigator read GetResourceNavigator; + end; + + { TcxSchedulerResourceNavigatorHitTest } + + TcxSchedulerResourceNavigatorHitTest = class(TcxSchedulerSubControlHitTest) + private + function GetCurrentButton(AButtons: TcxSchedulerNavigatorCustomButtons): TcxSchedulerNavigatorButton; + function GetHitAtButton: Boolean; + function GetHitButton: TcxSchedulerNavigatorButton; + function GetResourceNavigator: TcxSchedulerResourceNavigator; + public + property HitAtButton: Boolean read GetHitAtButton; + property HitButton: TcxSchedulerNavigatorButton read GetHitButton; + property ResourceNavigator: TcxSchedulerResourceNavigator read GetResourceNavigator; + end; + + { TcxSchedulerResourceNavigator } + + TcxSchedulerNavigatorCustomDrawButtonEvent = procedure(Sender: TcxSchedulerResourceNavigator; + ACanvas: TcxCanvas; AButton: TcxSchedulerNavigatorButton; var ADone: Boolean) of object; + + TcxSchedulerNavigatorVisibilityMode = (snvNever, snvAlways, snvAuto); + + TcxSchedulerResourceNavigator = class(TcxSchedulerSubControl) + private + FButtons: TcxSchedulerNavigatorButtons; + FButtonImages: TCustomImageList; + FCustomButtons: TcxSchedulerNavigatorCustomButtons; + FShowButtons: Boolean; + FTimer: TTimer; + FScrollBarKind: TScrollBarKind; + FVisibility: TcxSchedulerNavigatorVisibilityMode; + FOnButtonClick: TcxSchedulerNavigatorButtonClickEvent; + FOnCustomDrawButton: TcxSchedulerNavigatorCustomDrawButtonEvent; + function GetFirstVisibleResourceIndex: Integer; + function GetHitTest: TcxSchedulerResourceNavigatorHitTest; + function GetItem(AIndex: Integer): TcxSchedulerNavigatorButton; + function GetItemCount: Integer; + function GetResourceCount: Integer; + function GetResourcesPerPage: Integer; + function GetVisibleButtonCount: Integer; + procedure SetButtonImages(Value: TCustomImageList); + procedure SetButtons(Value: TcxSchedulerNavigatorButtons); + procedure SetCustomButtons(Value: TcxSchedulerNavigatorCustomButtons); + procedure SetFirstVisibleResourceIndex(AValue: Integer); + procedure SetResourcesPerPage(AValue: Integer); + procedure SetShowButtons(AValue: Boolean); + procedure SetVisibility(AValue: TcxSchedulerNavigatorVisibilityMode); + function IsCustomButtonsStored: Boolean; + protected + FPressedButton: TcxSchedulerNavigatorButton; + FVisibleButtonCount: Integer; + procedure BoundsChanged; override; + procedure ButtonClickHandler(AButton: TcxSchedulerNavigatorButton); virtual; + procedure CalculateBounds; virtual; + procedure CheckButtonsState; virtual; + procedure Click(Sender: TcxSchedulerNavigatorButton); + function CreateController: TcxSchedulerSubControlController; override; + function CreateHitTest: TcxSchedulerSubControlHitTest; override; + function CreateButtons: TcxSchedulerNavigatorCustomButtons; virtual; + function CreateStandardButtons: TcxSchedulerNavigatorButtons; virtual; + function DoCustomDrawButton(AButton: TcxSchedulerNavigatorButton): Boolean; virtual; + function DoOnClick(Sender: TcxSchedulerNavigatorButton): Boolean; virtual; + procedure DoPaint; override; + procedure FirstVisibleResourceChanged; + function GetCustomButtonClass: TcxSchedulerNavigatorButtonClass; virtual; + function GetScrollerHint: string; + procedure InitScrollBarsParameters; override; + procedure InvalidateButton(AButton: TcxSchedulerNavigatorButton); + procedure Scroll(AScrollCode: TScrollCode; var AScrollPos: Integer); virtual; + // + function ActualCountPerPage: Integer; + function ActualFirstResourceIndex: Integer; + function ButtonSize: TSize; + function MeasureHeight: Integer; virtual; + function MeasureWidth: Integer; virtual; + + property FirstVisibleResourceIndex: Integer read GetFirstVisibleResourceIndex write SetFirstVisibleResourceIndex; + property HitTest: TcxSchedulerResourceNavigatorHitTest read GetHitTest; + property ResourcesPerPage: Integer read GetResourcesPerPage write SetResourcesPerPage; + property Timer: TTimer read FTimer; + public + constructor Create(AOwner: TcxCustomScheduler); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function NeedScrollBar: Boolean; virtual; + + property ItemCount: Integer read GetItemCount; + property Items[Index: Integer]: TcxSchedulerNavigatorButton read GetItem; + property ResourceCount: Integer read GetResourceCount; + property Scheduler; + property ScrollBarKind: TScrollBarKind read FScrollBarKind; + property VisibleButtonCount: Integer read FVisibleButtonCount; + published + property ButtonImages: TCustomImageList read FButtonImages write SetButtonImages; + property Buttons: TcxSchedulerNavigatorButtons read FButtons write SetButtons; + property CustomButtons: TcxSchedulerNavigatorCustomButtons read FCustomButtons write SetCustomButtons stored IsCustomButtonsStored; + property ShowButtons: Boolean read FShowButtons write SetShowButtons default True; + property Visibility: TcxSchedulerNavigatorVisibilityMode read FVisibility write SetVisibility default snvAuto; + property OnButtonClick: TcxSchedulerNavigatorButtonClickEvent read FOnButtonClick write FOnButtonClick; + property OnCustomDrawButton: TcxSchedulerNavigatorCustomDrawButtonEvent read FOnCustomDrawButton write FOnCustomDrawButton; + end; + + { TcxSchedulerOptionsData } + + TcxSchedulerEventOperations = class(TPersistent) + private + FScheduler: TcxCustomScheduler; + FCreating: Boolean; + FDeleting: Boolean; + FDialogEditing: Boolean; + FDialogShowing: Boolean; + FInplaceEditing: Boolean; + FIntersection: Boolean; + FMoving: Boolean; + FMovingBetweenResources: Boolean; + FReadOnly: Boolean; + FRecurrence: Boolean; + FSharingBetweenResources: Boolean; + FSizing: Boolean; + function GetCreating: Boolean; + function GetCreatingStored: Boolean; + function GetDeleting: Boolean; + function GetDeletingStored: Boolean; + function GetDialogEditing: Boolean; + function GetDialogEditingStored: Boolean; + function GetInplaceEditing: Boolean; + function GetInplaceEditingStored: Boolean; + function GetMoving: Boolean; + function GetMovingBetweenResources: Boolean; + function GetMovingBetweenResourcesStored: Boolean; + function GetMovingStored: Boolean; + function GetSizing: Boolean; + function GetSizingStored: Boolean; + protected + function GetOwner: TPersistent; override; + + property Scheduler: TcxCustomScheduler read FScheduler; + public + constructor Create(AOwner: TcxCustomScheduler); virtual; + procedure Assign(Source: TPersistent); override; + published + property Creating: Boolean + read GetCreating write FCreating stored GetCreatingStored; + property Deleting: Boolean + read GetDeleting write FDeleting stored GetDeletingStored; + property DialogEditing: Boolean + read GetDialogEditing write FDialogEditing stored GetDialogEditingStored; + property DialogShowing: Boolean read FDialogShowing write FDialogShowing default True; + property InplaceEditing: Boolean + read GetInplaceEditing write FInplaceEditing stored GetInplaceEditingStored; + property Intersection: Boolean read FIntersection write FIntersection default True; + property MovingBetweenResources: Boolean + read GetMovingBetweenResources write FMovingBetweenResources + stored GetMovingBetweenResourcesStored; + property Moving: Boolean + read GetMoving write FMoving stored GetMovingStored; + property ReadOnly: Boolean read FReadOnly write FReadOnly default False; + property Recurrence: Boolean read FRecurrence write FRecurrence default True; + property SharingBetweenResources: Boolean read FSharingBetweenResources write FSharingBetweenResources default False; + property Sizing: Boolean read GetSizing write FSizing stored GetSizingStored; + end; + + { TcxSchedulerOptionsCustomize } + + TcxSchedulerOptionsCustomize = class(TPersistent) + private + FControlsSizing: Boolean; + FDynamicSizing: Boolean; + FIntegralSizing: Boolean; + FScheduler: TcxCustomScheduler; + procedure SetControlsSizing(AValue: Boolean); + procedure SetIntegralSizing(AValue: Boolean); + protected + procedure Changed; virtual; + function GetOwner: TPersistent; override; + public + constructor Create(AOwner: TcxCustomScheduler); virtual; + procedure Assign(Source: TPersistent); override; + + property Scheduler: TcxCustomScheduler read FScheduler; + published + property ControlsSizing: Boolean read FControlsSizing write SetControlsSizing default True; + property DynamicSizing: Boolean read FDynamicSizing write FDynamicSizing default False; + property IntegralSizing: Boolean read FIntegralSizing write SetIntegralSizing default True; + end; + + { TcxSchedulerResourceHeaders } + + TcxSchedulerHeaderImagePosition = (ipLeft, ipTop, ipRight, ipBottom); + + TcxSchedulerResourceHeaders = class(TPersistent) + private + FHeight: Integer; + FImagePosition: TcxSchedulerHeaderImagePosition; + FMultilineCaptions: Boolean; + FOwner: TcxSchedulerOptionsView; + FRotateCaptions: Boolean; + procedure SetHeight(AValue: Integer); + procedure SetImagePosition(AValue: TcxSchedulerHeaderImagePosition); + procedure SetMultilineCaptions(AValue: Boolean); + procedure SetRotateCations(AValue: Boolean); + function IsImagePositionStored: Boolean; + protected + procedure Changed; + function GetOwner: TPersistent; override; + property Owner: TcxSchedulerOptionsView read FOwner; + public + constructor Create(AOwner: TcxSchedulerOptionsView); virtual; + procedure Assign(Source: TPersistent); override; + published + property Height: Integer read FHeight write SetHeight default 0; + property MultilineCaptions: Boolean read FMultilineCaptions write SetMultilineCaptions default False; + property ImagePosition: TcxSchedulerHeaderImagePosition read FImagePosition write SetImagePosition stored IsImagePositionStored; + property RotateCaptions: Boolean read FRotateCaptions write SetRotateCations default True; + end; + + { TcxSchedulerOptionsView } + + TcxSchedulerOptionsView = class(TPersistent) + private + FActualStartOfWeek: TDay; + FAdditionalTimeZoneDaylightSaving: Boolean; + FCurrentTimeZoneDaylightSaving: Boolean; + FDayBorderColor: TColor; + FEventBorderColor: TColor; + FEventHeight: Integer; + FGroupingKind: TcxSchedulerGroupingKind; + FGroupSeparatorWidth: Integer; + FHideSelection: Boolean; + FHorzSplitterWidth: Integer; + FHotTrack: Boolean; + FResourceHeaders: TcxSchedulerResourceHeaders; + FResourcesPerPage: Integer; + FScheduler: TcxCustomScheduler; + FShowAdditionalTimeZone: Boolean; + FShowEventsWithoutResource: Boolean; + FShowHints: Boolean; + FShowNavigationButtons: Boolean; + FStartOfWeek: TcxStartOfWeek; + FTimeZoneLabels: array[0..1] of string; + FTimeZones: array[0..1] of Integer; + FVertSplitterWidth: Integer; + FViewPosition: TcxSchedulerViewPosition; + FWorkDays: TDays; + FWorkFinish: TTime; + FWorkFinishAssigned: Boolean; + FWorkStart: TTime; + FWorkStartAssigned: Boolean; + function GetDateTimeHelperClass: TcxSchedulerDateTimeHelperClass; + function GetRotateResourceCaptions: Boolean; + function GetTimeZone(AIndex: Integer): Integer; + function GetTimeZoneLabel(AIndex: Integer): string; + function IsTimeZoneLabelStored(AIndex: Integer): Boolean; + procedure SetATZDaylightSaving(AValue: Boolean); + procedure SetCTZDaylightSaving(AValue: Boolean); + procedure SetDayBorderColor(AValue: TColor); + procedure SetEventBorderColor(AValue: TColor); + procedure SetEventHeight(AValue: Integer); + procedure SetGroupingKind(AValue: TcxSchedulerGroupingKind); + procedure SetGroupSeparatorWidth(AValue: Integer); + procedure SetHideSelection(AValue: Boolean); + procedure SetHorzSplitterWidth(AValue: Integer); + procedure SetResourceHeaders(AValue: TcxSchedulerResourceHeaders); + procedure SetResourcesPerPage(AValue: Integer); + procedure SetRotateResourceCaptions(AValue: Boolean); + procedure SetShowAdditionalTimeZone(AValue: Boolean); + procedure SetShowEventsWithoutResource(AValue: Boolean); + procedure SetShowNavigationButtons(AValue: Boolean); + procedure SetSplitterWidth(AValue: Integer; var AWidth: Integer); + procedure SetStartOfWeek(AValue: TcxStartOfWeek); + procedure SetTimeZone(AIndex, AValue: Integer); + procedure SetTimeZoneLabel(AIndex: Integer; const AValue: string); + procedure SetVertSplitterWidth(AValue: Integer); + procedure SetViewPosition(AValue: TcxSchedulerViewPosition); + procedure SetWorkDays(AValue: TDays); + procedure SetWorkFinish(AValue: TTime); + procedure SetWorkStart(AValue: TTime); + // + procedure ReadWorkFinish(AReader: TReader); + procedure ReadWorkStart(AReader: TReader); + procedure WriteWorkFinish(AWriter: TWriter); + procedure WriteWorkStart(AWriter: TWriter); + protected + procedure CalculateActualStartOfWeek; + procedure Changed; virtual; + procedure DefineProperties(Filer: TFiler); override; + function GetOwner: TPersistent; override; + function IsWorkDaysStored: Boolean; + function IsWorkTime(AResourceItem: TcxSchedulerStorageResourceItem; const ADateTime: TDateTime): Boolean; + + property DateTimeHelper: TcxSchedulerDateTimeHelperClass read GetDateTimeHelperClass; + property HotTrack: Boolean read FHotTrack write FHotTrack default False;//True; + public + constructor Create(AOwner: TcxCustomScheduler); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + property ActualStartOfWeek: TDay read FActualStartOfWeek; + property Scheduler: TcxCustomScheduler read FScheduler; + published + property AdditionalTimeZone: Integer index 0 read GetTimeZone write SetTimeZone default -1; + property AdditionalTimeZoneDaylightSaving: Boolean read FAdditionalTimeZoneDaylightSaving write SetATZDaylightSaving default False; + property AdditionalTimeZoneLabel: string index 0 read GetTimeZoneLabel write SetTimeZoneLabel stored IsTimeZoneLabelStored; + property CurrentTimeZone: Integer index 1 read GetTimeZone write SetTimeZone default -1; + property CurrentTimeZoneDaylightSaving: Boolean read FCurrentTimeZoneDaylightSaving write SetCTZDaylightSaving default False; + property CurrentTimeZoneLabel: string index 1 read GetTimeZoneLabel write SetTimeZoneLabel stored IsTimeZoneLabelStored; + property DayBorderColor: TColor read FDayBorderColor write SetDayBorderColor default clDefault; + property EventBorderColor: TColor read FEventBorderColor write SetEventBorderColor default clBlack; + property EventHeight: Integer read FEventHeight write SetEventHeight default 0; + property GroupingKind: TcxSchedulerGroupingKind read FGroupingKind write SetGroupingKind default gkDefault; + property GroupSeparatorWidth: Integer read FGroupSeparatorWidth write SetGroupSeparatorWidth default cxDefaultGroupSeparatorWidth; + property HideSelection: Boolean read FHideSelection write SetHideSelection default False; + property HorzSplitterWidth: Integer read FHorzSplitterWidth write SetHorzSplitterWidth default cxDefaultSplitterWidth; + property ResourceHeaders: TcxSchedulerResourceHeaders read FResourceHeaders write SetResourceHeaders; + property ResourcesPerPage: Integer read FResourcesPerPage write SetResourcesPerPage default cxDefaultResourcesPerPage; + property RotateResourceCaptions: Boolean read GetRotateResourceCaptions write SetRotateResourceCaptions default True; + property ShowAdditionalTimeZone: Boolean read FShowAdditionalTimeZone write SetShowAdditionalTimeZone default False; + property ShowEventsWithoutResource: Boolean read FShowEventsWithoutResource write SetShowEventsWithoutResource default False; + property ShowHints: Boolean read FShowHints write FShowHints default True; + property ShowNavigationButtons: Boolean read FShowNavigationButtons write SetShowNavigationButtons default True; + property StartOfWeek: TcxStartOfWeek read FStartOfWeek write SetStartOfWeek default swSystem; + property VertSplitterWidth: Integer read FVertSplitterWidth write SetVertSplitterWidth default cxDefaultSplitterWidth; + property ViewPosition: TcxSchedulerViewPosition read FViewPosition write SetViewPosition default vpLeft; + property WorkDays: TDays read FWorkDays write SetWorkDays stored IsWorkDaysStored; + property WorkFinish: TTime read FWorkFinish write SetWorkFinish stored False; + property WorkStart: TTime read FWorkStart write SetWorkStart stored False; + end; + + { TcxSchedulerViewHitTest } + + TcxEventDragKind = (edkNone, edkEventDragRect, edkMoveEvent, edkResizeStart, edkResizeEnd); + + TcxSchedulerViewHitTest = class(TcxSchedulerSubControlHitTest) + private + function GetHitAtEvent: Boolean; + function GetNeedShowHint: Boolean; + protected + FNeedShowHint: Boolean; + FEventBounds: TRect; + FResource: TcxSchedulerStorageResourceItem; + procedure Clear; override; + function GetHitEvent: TcxSchedulerControlEvent; virtual; + property NeedShowHint: Boolean read GetNeedShowHint; + public + function GetDragKind: TcxEventDragKind; virtual; + + property HitAtEvent: Boolean read GetHitAtEvent; + property HitAtResource: Boolean index htcResource read GetBitState; + property Event: TcxSchedulerControlEvent read GetHitEvent; + property Resource: TcxSchedulerStorageResourceItem read FResource; + end; + + { TcxSchedulerEditController } + + TcxSchedulerEditController = class + private + FEdit: TcxCustomEdit; + FEditData: TcxCustomEditData; + FEditDate: TDateTime; + FEditList: TcxInplaceEditList; + FEditProperties: TcxCustomEditProperties; + FEditResource: TcxSchedulerStorageResourceItem; + FEvent: TcxSchedulerControlEvent; + FFocused: Boolean; + FIsEditing: Boolean; + FIsNewEvent: Boolean; + FOwner: TcxCustomScheduler; + function CanAccept: Boolean; + function GetController: TcxSchedulerViewController; + function GetEditVisible: Boolean; + function GetView: TcxSchedulerCustomView; + procedure SetEditVisible(Value: Boolean); + protected + function GetEditRect(var R: TRect; const ADate: TDateTime; + AResource: TcxSchedulerStorageResourceItem; AMakeVisible: Boolean = False): Boolean; virtual; + procedure EditAfterKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); virtual; + procedure EditExit(Sender: TObject); virtual; + procedure EditKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); virtual; + procedure EditKeyPress(Sender: TObject; var Key: Char); virtual; + procedure EditKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); virtual; + procedure EditPostEditValue(Sender: TObject); virtual; + function InitEdit(AEvent: TcxSchedulerControlEvent): Boolean; virtual; + function IsKeyForControl(var AKey: Word; Shift: TShiftState): Boolean; virtual; + procedure PrepareEdit(AEdit: TcxCustomEdit); virtual; + + property EditProperties: TcxCustomEditProperties read FEditProperties; + property EditData: TcxCustomEditData read FEditData; + property Event: TcxSchedulerControlEvent read FEvent; + public + constructor Create(AOwner: TcxCustomScheduler); virtual; + destructor Destroy; override; + procedure Activate(AEvent: TcxSchedulerControlEvent); overload; + procedure Activate(AEvent: TcxSchedulerControlEvent; const APos: TPoint; AShift: TShiftState); overload; + procedure Activate(AEvent: TcxSchedulerControlEvent; Key: Char); overload; + procedure CloseEdit(Accepted: Boolean); virtual; + procedure DeleteEvent(AEvent: TcxSchedulerControlEvent); + procedure Init(const AEditDate: TDateTime; + AResource: TcxSchedulerStorageResourceItem; AIsNewEvent: Boolean = False); + procedure UpdateEdit; virtual; + procedure UpdateValue; virtual; + + property Controller: TcxSchedulerViewController read GetController; + property Edit: TcxCustomEdit read FEdit; + property EditVisible: Boolean read GetEditVisible write SetEditVisible; + property Focused: Boolean read FFocused write FFocused; + property IsEditing: Boolean read FIsEditing; + property Scheduler: TcxCustomScheduler read FOwner; + property View: TcxSchedulerCustomView read GetView; + end; + + { TcxSchedulerViewNavigation } + + TcxSchedulerViewNavigation = class + private + FView: TcxSchedulerCustomView; + function GetResourceNavigator: TcxSchedulerResourceNavigator; + function GetScheduler: TcxCustomScheduler; + function GetSelAnchor: TDateTime; + function GetSelRealStart: TDateTime; + function GetSelFinish: TDateTime; + function GetSelResource: TcxSchedulerStorageResourceItem; + function GetSelStart: TDateTime; + function GetTimeIncrement: TDateTime; + function GetVisibleResource(AIndex: Integer): TcxSchedulerStorageResourceItem; + function GetVisibleResourceCount: Integer; + protected + FCurrentAnchor: TDateTime; + FCurrentResource: TcxSchedulerStorageResourceItem; + FShift: TShiftState; + procedure DoKeyDown(var AKey: Word; AShift: TShiftState); virtual; + function IsKeyNavigation(var AKey: Word; AShift: TShiftState): Boolean; virtual; + function IsSingleLine: Boolean; + function GetResourceItem: TcxSchedulerStorageResourceItem; virtual; + procedure KeyDown(var AKey: Word; AShift: TShiftState); virtual; + procedure ReplaceDate(ADate: TDateTime; AResource: TcxSchedulerStorageResourceItem = nil); + public + constructor Create(AView: TcxSchedulerCustomView); + procedure CheckSelection; + procedure ReplaceSelParams(const ASelStart, ASelFinish: TDateTime); overload; + procedure ReplaceSelParams(const ASelStart, ASelFinish: TDateTime; + AResource: TcxSchedulerStorageResourceItem); overload; + procedure ReplaceSelParams(AResource: TcxSchedulerStorageResourceItem); overload; + function ScrollResources(AGoForward: Boolean): Boolean; + function ScrollResourcesCycled(AGoForward: Boolean; var AResource: TcxSchedulerStorageResourceItem): Boolean; + function ScrollResourcesEx(AGoForward: Boolean; var AResource: TcxSchedulerStorageResourceItem): Boolean; virtual; + procedure SetSelAnchor(const Anchor: TDateTime; AShift: TShiftState); overload; + procedure SetSelAnchor(const Anchor: TDateTime; AShift: TShiftState; + AResource: TcxSchedulerStorageResourceItem); overload; + procedure ValidateSelection(var ASelStart, ASelFinish: TDateTime; + var AResource: TcxSchedulerStorageResourceItem); virtual; + + property ResourceNavigator: TcxSchedulerResourceNavigator read GetResourceNavigator; + property SelAnchor: TDateTime read GetSelAnchor; + property SelFinish: TDateTime read GetSelFinish; + property SelRealStart: TDateTime read GetSelRealStart; + property SelResource: TcxSchedulerStorageResourceItem read GetSelResource; + property SelStart: TDateTime read GetSelStart; + property Scheduler: TcxCustomScheduler read GetScheduler; + property TimeIncrement: TDateTime read GetTimeIncrement; + property View: TcxSchedulerCustomView read FView; + property VisibleResourceCount: Integer read GetVisibleResourceCount; + property VisibleResources[AIndex: Integer]: TcxSchedulerStorageResourceItem read GetVisibleResource; + end; + + { TcxSchedulerViewController } + + TcxSchedulerViewController = class(TcxSchedulerSubControlController) + private + FEditShowingTimer: TTimer; + FEditShowingTimerItem: TcxSchedulerControlEvent; + FDragEventHelper: TcxDragEventHelper; + FDragEvent: TcxSchedulerControlEvent; + FDragKind: TcxEventDragKind; + FNavigation: TcxSchedulerViewNavigation; + FStartDragFlags: Int64; + FStartDragHitTime: TDateTime; + FStartDragResource: TcxSchedulerStorageResourceItem; + procedure EditShowingTimerHandler(Sender: TObject); + function GetEditController: TcxSchedulerEditController; + function GetHitTest: TcxSchedulerViewHitTest; + function GetIsEditing: Boolean; + function GetNavigatorTimer: TTimer; + function GetScheduler: TcxCustomScheduler; + function GetView: TcxSchedulerCustomView; + procedure ShowEventEditor(AEvent: TcxSchedulerControlEvent); + procedure StartEditShowingTimer(AEvent: TcxSchedulerControlEvent); + procedure StopEditShowingTimer; + protected + DragAndDropObject: TcxSchedulerDragAndDropObject; + FDownScrollArea: TRect; + FBeforeFocusedEvent: TcxSchedulerControlEvent; + FStartSelAnchor: TDateTime; + FUpScrollArea: TRect; + procedure BeforeMouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure CancelScroll; virtual; + function CanDrag(X, Y: Integer): Boolean; override; + procedure CheckOpenInplaceEditorOnMouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); virtual; + procedure CheckScrolling(const APos: TPoint); virtual; + procedure CheckScrollOnDragOver(const P: TPoint; State: TDragState); + procedure CheckUpdateEventBounds; + procedure CloseInplaceEdit; + function ConsiderHiddenEvents: Boolean; virtual; + function CreateDragEventHelper: TcxDragEventHelper; virtual; + function CreateNavigation: TcxSchedulerViewNavigation; virtual; + function CreateResizeEventHelper: TcxEventSizingHelper; virtual; + procedure DoSchedulerDragOver(const P: TPoint; AState: TDragState; + var AAccept: Boolean); + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); override; + procedure EndDrag(Target: TObject; X, Y: Integer); override; + function GetDragAndDropObjectClass: TcxDragAndDropObjectClass; override; + function GetResourceReadOnly: Boolean; + function IsCaptionAvailable: Boolean; + function IsCopyDragDrop: Boolean; + function IsDragOperation: Boolean; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure RecreateNavigation; + procedure SelectNextEvent(AForward: Boolean); virtual; + procedure StartDrag(var DragObject: TDragObject); override; + function StartDragAndDrop(const P: TPoint): Boolean; override; + procedure SyncEventSelection(AEvent: TcxSchedulerControlEvent); virtual; + procedure UnselectEvents; + procedure UpdateEventSelection(AEvent: TcxSchedulerControlEvent; + Button: TMouseButton; Shift: TShiftState); + + // resource scrolling on event drag + procedure CheckNavigatorScrollArea(const APoint: TPoint); virtual; + procedure DoneNavigatorScrollArea; virtual; + procedure InitNavigatorScrollArea; virtual; + procedure NavigatorTimerHandler(Sender: TObject); virtual; + function PtInArea(const ARect: TRect; const P: TPoint; IsUpArea: Boolean): Boolean; + + property EditController: TcxSchedulerEditController read GetEditController; + property DragEventHelper: TcxDragEventHelper read FDragEventHelper; + property HitTest: TcxSchedulerViewHitTest read GetHitTest; + property NavigatorTimer: TTimer read GetNavigatorTimer; + property View: TcxSchedulerCustomView read GetView; + public + constructor Create(AOwner: TcxSchedulerSubControl); override; + destructor Destroy; override; + function CanCreateEventUsingDialog: Boolean; virtual; + function CanCreateEventUsingInplaceEdit: Boolean; virtual; + function CanEditEvent(AEvent: TcxSchedulerControlEvent; AInplace: Boolean): Boolean; virtual; + function CanShowEventDialog: Boolean; virtual; + procedure DeleteSelectedEvents; + function IsEventEditing(AEvent: TcxSchedulerControlEvent; AResource: TcxSchedulerStorageResourceItem): Boolean; + procedure SelectSingleEvent(AEvent: TcxSchedulerControlEvent; ADate: TDateTime; AMakeVisible: Boolean = True); + + property DragEvent: TcxSchedulerControlEvent read FDragEvent; + property DragKind: TcxEventDragKind read FDragKind; + property IsEditing: Boolean read GetIsEditing; + property Navigation: TcxSchedulerViewNavigation read FNavigation; + property Scheduler: TcxCustomScheduler read GetScheduler; + property StartDragFlags: Int64 read FStartDragFlags; + property StartDragHitTime: TDateTime read FStartDragHitTime; + property StartDragResource: TcxSchedulerStorageResourceItem read FStartDragResource; + end; + + { TcxDragHelper } + + TcxSchedulerDragOverDestination = (dodView, dodControlBox, dodDateNavigator, dodOther); + + TcxDragHelper = class + private + FActualHitTime: TDateTime; + FAcceptedChanged: Boolean; + FDestination: TcxSchedulerDragOverDestination; + FSaveCursor: TCursor; + FScheduler: TcxCustomScheduler; + function GetActualHitTime: TDateTime; + function GetController: TcxSchedulerViewController; + function GetDateNavigator: TcxSchedulerCustomDateNavigator; + function GetEvents: TcxSchedulerCachedEventList; + function GetHitTest: TcxSchedulerViewHitTest; + protected + FHasConflicts: Boolean; + FPrevAccepted: Boolean; + FPrevHitFlags: Int64; + FPrevHitTime: TDateTime; + FPrevHitResource: TcxSchedulerStorageResourceItem; + FStartHitTime: TDateTime; + FStartHitFlags: Int64; + FStartResource: TcxSchedulerStorageResourceItem; + // virtuals + procedure BeginDrag; virtual; + procedure CalculateConflicts; + procedure CalculateDestination; + function CanUpdateEventState(AEvent: TcxSchedulerControlEvent): Boolean; + procedure CheckAccepted(var Accepted: Boolean); virtual; + procedure CheckEventState(AEvent: TcxSchedulerControlEvent); + procedure DragOver(const P: TPoint; State: TDragState; var Accepted: Boolean); virtual; + procedure EndDrag(Accepted: Boolean); virtual; + function GetOriginHitTestMask: Int64; virtual; + procedure GetOriginState; virtual; + function HasChangedState: Boolean; virtual; + function IsAtOrigin: Boolean; virtual; + function IsShowResources: Boolean; + function IsValidTime: Boolean; virtual; + procedure RefreshCurrentView; virtual; + procedure SetSelection; virtual; + procedure UpdateHelperState(Accepted: Boolean); virtual; + + property SaveCursor: TCursor read FSaveCursor; + public + constructor Create(AScheduler: TcxCustomScheduler); virtual; + + property ActualHitTime: TDateTime read FActualHitTime; + property Controller: TcxSchedulerViewController read GetController; + property DateNavigator: TcxSchedulerCustomDateNavigator read GetDateNavigator; + property Destination: TcxSchedulerDragOverDestination read FDestination; + property Events: TcxSchedulerCachedEventList read GetEvents; + property HasConflicts: Boolean read FHasConflicts; + property HitTest: TcxSchedulerViewHitTest read GetHitTest; + property Scheduler: TcxCustomScheduler read FScheduler; + end; + + { TcxDragEventHelper } + + TcxSchedulerDragObject = class(TcxDragControlObject) + private + FUseInternalCursors: Boolean; + function GetDragEventHelper: TcxDragEventHelper; + function GetDragEvents: TcxSchedulerFilteredEventList; + function GetHasConflicts: Boolean; + function GetScheduler: TcxCustomScheduler; + protected + procedure Finished(Target: TObject; X, Y: Integer; Accepted: Boolean); override; + function GetDragCursor(Accepted: Boolean; X, Y: Integer): TCursor; override; + public + constructor Create(AControl: TControl); override; + procedure CalculateConflictsForDateNavigator(ADateNavigator: TcxSchedulerCustomDateNavigator); + procedure DropToDateNavigator(ADateNavigator: TcxSchedulerCustomDateNavigator); + + property DragEventHelper: TcxDragEventHelper read GetDragEventHelper; + property DragEvents: TcxSchedulerFilteredEventList read GetDragEvents; + property HasConflicts: Boolean read GetHasConflicts; + property Scheduler: TcxCustomScheduler read GetScheduler; + end; + + TcxDragEventHelper = class(TcxDragHelper) + private + FDragObject: TDragObject; + function GetClones: TcxSchedulerFilteredEventList; + function GetViewInfo: TcxSchedulerCustomViewViewInfo; + protected + FPrevIsDragCopy: Boolean; + FTarget: TObject; + procedure ApplyChanges; virtual; + procedure BeginDrag; override; + procedure CheckAccepted(var Accepted: Boolean); override; + procedure CheckVisibility(Accepted: Boolean); + procedure DragOver(const P: TPoint; State: TDragState; var Accepted: Boolean); override; + procedure EndDrag(Accepted: Boolean); override; + procedure DateNavigatorEndDrag; + function GetClonesVisible(Accepted: Boolean): Boolean; virtual; + function GetIsDragCopy: Boolean; virtual; + procedure GetOriginState; override; + function GetSourcesVisible(Accepted: Boolean): Boolean; virtual; + function HasChangedState: Boolean; override; + function IsValidNavigatorDate: Boolean; virtual; + function IsValidTime: Boolean; override; + procedure PrepareClones; + procedure ProcessDateNavigator(ADateNavigator: TcxSchedulerCustomDateNavigator); + procedure SetSelection; override; + procedure Update(Accepted: Boolean = True); + procedure UpdateClones; + procedure UpdateHelperState(Accepted: Boolean); override; + //datenavigator processing + procedure UpdateDateNavigatorClones(ADateNavigator: TcxSchedulerCustomDateNavigator); virtual; + procedure UpdateDateNavigator(var Accepted: Boolean); virtual; + //current view processing + procedure UpdateViewClones; virtual; + procedure UpdateViewClonesResources; + procedure UpdateViewClonesTime; virtual; + + property Clones: TcxSchedulerFilteredEventList read GetClones; + property DragObject: TDragObject read FDragObject; + property IsDragCopy: Boolean read GetIsDragCopy; + property ViewInfo: TcxSchedulerCustomViewViewInfo read GetViewInfo; + end; + + { TcxEventSizingHelper } + + TcxEventSizingHelper = class(TcxDragHelper) + private + function GetEvent: TcxSchedulerControlEvent; + function GetHitTest: TcxSchedulerViewHitTest; + protected + procedure BeginDrag; override; + procedure DragOver(const P: TPoint; State: TDragState; var Accepted: Boolean); override; + procedure EndDrag(Accepted: Boolean); override; + function GetDragCursor(Accepted: Boolean): TCursor; virtual; + function IsValidTime: Boolean; override; + // Event handling + procedure CalcAllDayEvent; virtual; + function GetFinishTime: TDateTime; virtual; + function GetStartTime: TDateTime; virtual; + procedure UpdateEventBounds; virtual; + + property Event: TcxSchedulerControlEvent read GetEvent; + property HitTest: TcxSchedulerViewHitTest read GetHitTest; + end; + + { TcxSchedulerDragAndDropObject } + + TcxSchedulerDragAndDropObject = class(TcxDragAndDropObject) + private + FSizingHelper: TcxEventSizingHelper; + FScheduler: TcxCustomScheduler; + function GetController: TcxSchedulerViewController; + function GetHitTest: TcxSchedulerViewHitTest; + protected + procedure BeginDragAndDrop; override; + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); override; + procedure EndDragAndDrop(Accepted: Boolean); override; + function GetDragAndDropCursor(Accepted: Boolean): TCursor; override; + public + constructor Create(AControl: TcxControl); override; + destructor Destroy; override; + + property Controller: TcxSchedulerViewController read GetController; + property SizingHelper: TcxEventSizingHelper read FSizingHelper; + property HitTest: TcxSchedulerViewHitTest read GetHitTest; + property Scheduler: TcxCustomScheduler read FScheduler; + end; + + { TcxSchedulerHintController } + + TcxSchedulerHintController = class(TcxIUnknownObject, IUnknown, + IcxMouseTrackingCaller) + protected + FAutoHide: Boolean; + FHintWindow: THintWindow; + FOwner: TcxCustomScheduler; + FHintFlags: Integer; + FHintRect: TRect; + FHintText: string; + FLockHint: Boolean; + FShowing: Boolean; + FTimer: TTimer; + FViewMode: Boolean; + // IcxMouseTrackingCaller + procedure MouseLeave; + // methods + function CanShowHint: Boolean; virtual; + procedure CheckHintClass; + procedure HideHint; virtual; + procedure ShowHint; virtual; + procedure StartHideHintTimer; + procedure StartShowHintTimer; + procedure StopTimer; + procedure TimerHandler(Sender: TObject); + public + constructor Create(AOwner: TcxCustomScheduler); virtual; + destructor Destroy; override; + procedure Activate(const AHintRect: TRect; + const AHintText: string; AImmediateHint: Boolean = False; + AAutoHide: Boolean = True); virtual; + function CalcHintRect(AMaxWidth: Integer; + const AHintText: string; AFlags: Integer): TRect; + procedure Hide; + procedure Reset; + property Scheduler: TcxCustomScheduler read FOwner; + property ViewMode: Boolean read FViewMode write FViewMode; + property Showing: Boolean read FShowing; + end; + + { TcxSchedulerEventHitTestController } + + TcxSchedulerEventHitTestController = class + private + function GetHintController: TcxSchedulerHintController; + function GetHitTest: TcxSchedulerViewHitTest; + protected + FOwner: TcxCustomScheduler; + FPrevHintEvent: TcxSchedulerControlEvent; + public + constructor Create(AOwner: TcxCustomScheduler); virtual; + procedure HideEventHint; + procedure MouseMove(X, Y: Integer; AShift: TShiftState); virtual; + + property HitTest: TcxSchedulerViewHitTest read GetHitTest; + property HintController: TcxSchedulerHintController read GetHintController; + property Scheduler: TcxCustomScheduler read FOwner; + end; + + { TcxSchedulerCustomView } + + TcxSchedulerCustomView = class(TcxSchedulerSubControl) + private + FCalculatedHintBounds: Boolean; + FCanShow: Boolean; + function GetActive: Boolean; + function GetCanShow: Boolean; + function GetController: TcxSchedulerViewController; + function GetDragCloneEventList: TcxSchedulerFilteredEventList; + function GetEventList: TcxSchedulerCachedEventList; + function GetHitTest: TcxSchedulerViewHitTest; + function GetOptionsView: TcxSchedulerOptionsView; + function GetResources: TcxSchedulerStorageResourceItems; + function GetSelectedDays: TcxSchedulerDateList; + function GetWorkDays: TDays; + function GetWorkFinish: TDateTime; + function GetWorkStart: TDateTime; + procedure SetActive(AValue: Boolean); + procedure SetCanShow(AValue: Boolean); + protected + function CanDeactivateOnDateNavigatorSelectionChange: Boolean; virtual; + function CanSelectPeriod: Boolean; virtual; + function CheckEventsVisibility: Boolean; virtual; + function CreateController: TcxSchedulerSubControlController; override; + function CreateHitTest: TcxSchedulerSubControlHitTest; override; + procedure DateChanged; virtual; + procedure DeactivateView; virtual; + procedure DoLayoutChanged; override; + function DoShowPopupMenu(X, Y: Integer): Boolean; virtual; + function EventContentSelected(AEvent: TcxSchedulerControlEvent): Boolean; virtual; + function GetClientRect: TRect; override; + function GetControlCanvas: TcxCanvas; virtual; + function GetDateOffset: Integer; + function GetDragObjectClass: TDragControlObjectClass; virtual; + function GetGroupingKind: TcxSchedulerGroupingKind; virtual; + function GetHScrollBarBounds: TRect; override; + function GetEditRectForEvent(AEvent: TcxSchedulerControlEvent; + const ADate: TDateTime; AResource: TcxSchedulerStorageResourceItem): TRect; virtual; + function GetEditStyle(AEvent: TcxSchedulerControlEvent): TcxCustomEditStyle; virtual; + function GetEditProperties(AEvent: TcxSchedulerControlEvent): TcxCustomEditProperties; virtual; + function GetEditWithSingleLineEditor(AEvent: TcxSchedulerControlEvent): Boolean; virtual; + function GetEventHintText(AEvent: TcxSchedulerControlEvent): string; virtual; + function GetEventVisibility(AEvent: TcxSchedulerControlEvent): Boolean; virtual; + function GetFirstVisibleDate: TDateTime; virtual; + function GetFirstVisibleTime: TDateTime; virtual; + function GetLastVisibleDate: TDateTime; virtual; + function GetLastVisibleTime: TDateTime; virtual; + function GetSchedulerLookAndFeel(ADialogs: Boolean = False): TcxLookAndFeel; + function GetScrollTimeHint: string; virtual; + function GetSizeGripBounds: TRect; override; + function GetTimeIncrement: TDateTime; virtual; + function GetVScrollBarBounds: TRect; override; + function GetViewContentRect: TRect; virtual; + function GetVisibleDaysRange: Integer; virtual; + procedure InitEventBySelectedTime(AEvent: TcxSchedulerEvent; AllDay: Boolean; + ARecurrence: Boolean; AInplaceEditing: Boolean); virtual; + function IsAllDaySelection: Boolean; + function IsDayView: Boolean; virtual; + function IsInplaceEditingEnabled: Boolean; virtual; + function IsShowResources: Boolean; virtual; + function IsWorkTime(AResourceItem: TcxSchedulerStorageResourceItem; const ADateTime: TDateTime): Boolean; + procedure MakeEventVisible(AEvent: TcxSchedulerControlEvent; + const ADate: TDateTime; AResource: TcxSchedulerStorageResourceItem); virtual; + procedure PeriodChanged; override; + procedure Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); virtual; + procedure ScrollSelectedDays(AScrollDelta: Integer); overload; virtual; + procedure ScrollSelectedDays(AForward: Boolean; + ANeedDate: TDateTime; AIsByPage: Boolean); overload; virtual; + procedure ScrollVisibleDays(AScrollUp: Boolean); virtual; + procedure SelectedDaysChanged; virtual; + function ShowTaskComplete: Boolean; virtual; + procedure TimeChanged; virtual; + procedure UpdateDateNavigatorSelection; + procedure ValidateContentPopupMenuItems(var AItems: TcxSchedulerContentPopupMenuItems); virtual; + procedure ValidateSelectionFinishTime(var ADateTime: TDateTime); virtual; + procedure VisibleChanged; override; + // hint + procedure HideHintOnScroll(AScrollCode: TScrollCode); virtual; + procedure ShowHintOnScroll(const ADate: TDateTime); overload; virtual; + procedure ShowHintOnScroll(const AHintText: string; AScrollBarKind: TScrollBarKind); overload; virtual; + + property CalculatedHintBounds: Boolean read FCalculatedHintBounds; + property Controller: TcxSchedulerViewController read GetController; + property EventList: TcxSchedulerCachedEventList read GetEventList; + property FirstVisibleTime: TDateTime read GetFirstVisibleTime; + property LastVisibleTime: TDateTime read GetLastVisibleTime; + property OptionsView: TcxSchedulerOptionsView read GetOptionsView; + property Resources: TcxSchedulerStorageResourceItems read GetResources; + property WorkDays: TDays read GetWorkDays; + property WorkStart: TDateTime read GetWorkStart; + property WorkFinish: TDateTime read GetWorkFinish; + public + constructor Create(AOwner: TcxCustomScheduler); override; + procedure Assign(Source: TPersistent); override; + + property Active: Boolean read GetActive write SetActive default False; + property CanShow: Boolean read GetCanShow write SetCanShow default True; + property DragCloneEventList: TcxSchedulerFilteredEventList read GetDragCloneEventList; + property FirstVisibleDate: TDateTime read GetFirstVisibleDate; + property HitTest: TcxSchedulerViewHitTest read GetHitTest; + property LastVisibleDate: TDateTime read GetLastVisibleDate; + property SelectedDays: TcxSchedulerDateList read GetSelectedDays; + property StartOfWeek; + end; + + { TcxSchedulerCustomViewViewInfo } + + TcxSchedulerCustomViewViewInfo = class(TcxSchedulerSubControlViewInfo) + private + function GetResourceNavigator: TcxSchedulerResourceNavigator; + function GetScheduler: TcxCustomScheduler; + protected + FEvents: TcxSchedulerCachedEventList; + FSelectedDays: TcxSchedulerDateList; + procedure CheckResourceNavigator; virtual; + function DoGetEventDisplayText(AEvent: TcxSchedulerControlEvent): string; virtual; + function DoSchedulerMoreEventsButtonClick: Boolean; + function DoSchedulerNavigationButtonClick: Boolean; + function GetEventHint(AEvent: TcxSchedulerControlEvent): string; + function GetResourceScrollBarKind: TScrollBarKind; virtual; + function GetSchedulerEventsList: TcxSchedulerCachedEventList; + procedure SetEventsVisibility(AShowSources, AShowClones: Boolean; + AForceRepaint: Boolean = False); virtual; + + property Events: TcxSchedulerCachedEventList read FEvents; + property ResourceNavigator: TcxSchedulerResourceNavigator read GetResourceNavigator; + property Scheduler: TcxCustomScheduler read GetScheduler; + property SelectedDays: TcxSchedulerDateList read FSelectedDays; + end; + + { TcxSchedulerCustomDataNavigator } + + IcxExternalDateNavigatorListener = interface + ['{32293211-4D89-4383-A95C-23B95C3A783D}'] + procedure StorageChanged; + procedure SchedulerChanged; + procedure SchedulerRemoved; + end; + + TcxSchedulerCustomDateNavigator = class(TcxSchedulerSubControl) + private + FLockCount: Integer; + FPrevColCount: Integer; + FPrevRowCount: Integer; + FSaveRealFirstDate: TDateTime; + FSaveRealLastDate: TDateTime; + FSaveSelectionList: TcxSchedulerDateList; + function GetEventDays: TcxSchedulerDateList; + function GetHintController: TcxSchedulerHintController; + function GetHolidayDays: TcxSchedulerDateList; + protected + FSavedSize: TSize; + procedure BoundsChanging; override; + procedure BoundsChanged; override; + function CanMultiSelect: Boolean; virtual; + procedure CheckSizes; virtual; abstract; + procedure CheckChanges; virtual; + procedure CheckCurrentDate; virtual; + procedure ClearDragging; virtual; abstract; + procedure DoPeriodChangedEvent; virtual; abstract; + procedure DoSelectionChangedEvent; virtual; abstract; + procedure DoScrollSelection(AForward: Boolean; ANeedDate: TDateTime; AIsByPage: Boolean); overload; virtual; abstract; + procedure DoScrollSelection(AScrollDelta: Integer); overload; virtual; abstract; + procedure GetCalendarDimension(out AColCount, ARowCount: Integer); virtual; abstract; + function GetMonthSize: TSize; virtual; + function GetSelection: TcxSchedulerDateList; virtual; + function GetShowDatesContainingEventsInBold: Boolean; virtual; abstract; + function GetShowDatesContainingHolidaysInColor: Boolean; virtual; abstract; + function GetRealFirstDate: TDateTime; virtual; abstract; + function GetRealLastDate: TDateTime; virtual; abstract; + function IsSchedulerLocked: Boolean; + procedure Loaded; virtual; + procedure MakeSelectionVisible; virtual; abstract; + procedure PeriodChanged; override; + procedure SaveSize; + procedure SaveState; virtual; + procedure ScrollSelection(AForward: Boolean; ANeedDate: TDateTime; AIsByPage: Boolean); overload; + procedure ScrollSelection(AScrollDelta: Integer); overload; + procedure SetIntegralSizes; virtual; abstract; + procedure UpdateDragging; virtual; abstract; + procedure UpdateSelection; virtual; abstract; + + property EventDays: TcxSchedulerDateList read GetEventDays; + property HintController: TcxSchedulerHintController read GetHintController; + property HolidayDays: TcxSchedulerDateList read GetHolidayDays; + public + constructor Create(AOwner: TcxCustomScheduler); override; + destructor Destroy; override; + procedure BeginUpdate; + procedure CancelUpdates; + procedure EndUpdate; + end; + + { TcxSchedulerClipboardController } + + TcxSchedulerClipboardController = class + private + FScheduler: TcxCustomScheduler; + FStream: TMemoryStream; + FStreamReader: TcxReader; + FStreamWriter: TcxWriter; + function GetStorage: TcxCustomSchedulerStorage; + procedure RegisterClipboardFormat; + protected + procedure CalculateAnchorForResource(AEvents: TcxSchedulerFilteredEventList; + const AResourceID: Variant; var Anchor: TDateTime); + procedure DeleteSelectedEvents; virtual; + function GetClipboard: TClipboard; virtual; + function GetClipboardToStream: Boolean; + function GetSelectionAsStream: Boolean; + function GetStreamAsEvents(AEvents: TcxSchedulerFilteredEventList; var Anchor: TDateTime): Boolean; + procedure InsertEvents(AEvents: TcxSchedulerFilteredEventList; Anchor: TDateTime); + function KeyDown(var AKey: Word; AShift: TShiftState): Boolean; + function KeyPress(var AKey: Char): Boolean; + procedure RestoreEvent(var AEvent: TcxSchedulerControlEvent); + procedure SaveEvent(AEvent: TcxSchedulerControlEvent); + procedure SetStreamToClipboard; + function ValidateStream: Boolean; + + property Stream: TMemoryStream read FStream; + property StreamReader: TcxReader read FStreamReader; + property StreamWriter: TcxWriter read FStreamWriter; + public + constructor Create(AScheduler: TcxCustomScheduler); virtual; + destructor Destroy; override; + function CanCopy: Boolean; virtual; + function CanPaste: Boolean; virtual; + procedure Copy; + procedure Cut; + procedure Paste; + + property Clipboard: TClipboard read GetClipboard; + property Scheduler: TcxCustomScheduler read FScheduler; + property Storage: TcxCustomSchedulerStorage read GetStorage; + end; + + { IcxSchedulerStylesAdapter } + + IcxSchedulerStylesAdapter = interface + ['{0BFEA90D-0CE8-4ED1-88E8-71A3396186F3}'] + function GetContentParams(const ADateTime: TDateTime; + AResource: TcxSchedulerStorageResourceItem): TcxViewParams; overload; + function GetContentParams(const ADateTime: TDateTime; ALightColor: Boolean; + AResource: TcxSchedulerStorageResourceItem): TcxViewParams; overload; + function GetDayHeaderParams(const ADateTime: TDateTime): TcxViewParams; + function GetEventParams(AEvent: TcxSchedulerEvent): TcxViewParams; + function GetResourceHeaderParams(AResource: TcxSchedulerStorageResourceItem): TcxViewParams; + // hard style + function GetDayHeaderStyle: TcxStyle; + function GetResourceHeaderStyle: TcxStyle; + end; + + { TcxSchedulerStyles } + + TcxSchedulerOnGetDayHeaderStyleEvent = procedure(Sender: TObject; + const ADate: TDateTime; var AStyle: TcxStyle) of object; + TcxSchedulerOnGetResourceHeaderStyleEvent = procedure(Sender: TObject; + AResource: TcxSchedulerStorageResourceItem; var AStyle: TcxStyle) of object; + TcxSchedulerOnGetContentStyleEvent = procedure(Sender: TObject; + AResource: TcxSchedulerStorageResourceItem; const ADateTime: TDateTime; + var AStyle: TcxStyle) of object; + TcxSchedulerOnGetEventStyleEvent = procedure(Sender: TObject; + AEvent: TcxSchedulerEvent; var AStyle: TcxStyle) of object; + + TcxSchedulerStyles = class(TcxStyles, IcxSchedulerStylesAdapter) + private + FScheduler: TcxCustomScheduler; + FOnGetContentStyle: TcxSchedulerOnGetContentStyleEvent; + FOnGetDayHeaderStyle: TcxSchedulerOnGetDayHeaderStyleEvent; + FOnGetEventStyle: TcxSchedulerOnGetEventStyleEvent; + FOnGetResourceHeaderStyle: TcxSchedulerOnGetResourceHeaderStyleEvent; + function GetPainter: TcxCustomLookAndFeelPainterClass; + function GetPainterHelperClass: TcxSchedulerPainterHelperClass; + function GetResources: TcxSchedulerStorageResourceItems; + protected + procedure Changed(AIndex: Integer); override; + + function EventContentSelected(AEvent: TcxSchedulerControlEvent): Boolean; + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + + // IcxSchedulerStylesAdapter + function GetDayHeaderStyle: TcxStyle; + function GetEventParams(AEvent: TcxSchedulerEvent): TcxViewParams; + function GetResourceHeaderStyle: TcxStyle; + + property Painter: TcxCustomLookAndFeelPainterClass read GetPainter; + property PainterHelper: TcxSchedulerPainterHelperClass read GetPainterHelperClass; + property Resources: TcxSchedulerStorageResourceItems read GetResources; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + function GetBackgroundParams: TcxViewParams; + function GetContentParams(const ADateTime: TDateTime; AResource: TcxSchedulerStorageResourceItem = nil): TcxViewParams; overload; + function GetContentParams(const ADateTime: TDateTime; ALightColor: Boolean; AResource: TcxSchedulerStorageResourceItem = nil): TcxViewParams; overload; + function GetDayHeaderParams(const ADate: TDateTime): TcxViewParams; + function GetGroupSeparatorParams: TcxViewParams; + function GetResourceHeaderParams(AResource: TcxSchedulerStorageResourceItem): TcxViewParams; + function GetSelectionParams: TcxViewParams; + function GetSplitterParams(AKind: TcxSchedulerSplitterKind): TcxViewParams; + function GetEventContentParams(AEvent: TcxSchedulerEvent): TcxViewParams; + function IsEventStyleAssigned(AEvent: TcxSchedulerEvent): Boolean; + // define colors functions + property Scheduler: TcxCustomScheduler read FScheduler; + published + property Background: TcxStyle index cxcsBackground read GetValue write SetValue; + property Content: TcxStyle index cxcsContent read GetValue write SetValue; + property Event: TcxStyle index cxcsEvent read GetValue write SetValue; + property GroupSeparator: TcxStyle index cxcsGroupSeparator read GetValue write SetValue; + property DayHeader: TcxStyle index cxcsDayHeader read GetValue write SetValue; + property HorzSplitter: TcxStyle index cxcsHSplitter read GetValue write SetValue; + property ResourceHeader: TcxStyle index cxcsResourceHeader read GetValue write SetValue; + property Selection: TcxStyle index cxcsSelection read GetValue write SetValue; + property VertSplitter: TcxStyle index cxcsVSplitter read GetValue write SetValue; + + property OnGetContentStyle: TcxSchedulerOnGetContentStyleEvent read FOnGetContentStyle write FOnGetContentStyle; + property OnGetDayHeaderStyle: TcxSchedulerOnGetDayHeaderStyleEvent read FOnGetDayHeaderStyle write FOnGetDayHeaderStyle; + property OnGetEventStyle: TcxSchedulerOnGetEventStyleEvent read FOnGetEventStyle write FOnGetEventStyle; + property OnGetResourceHeaderStyle: TcxSchedulerOnGetResourceHeaderStyleEvent read FOnGetResourceHeaderStyle write FOnGetResourceHeaderStyle; + end; + + { TcxSchedulerOptionsBehavior } + + TcxSchedulerOptionsBehavior = class(TPersistent) + private + FHotTrack: Boolean; + FOwner: TcxCustomScheduler; + FSelectOnRightClick: Boolean; + protected + function GetOwner: TPersistent; override; + public + constructor Create(AOwner: TcxCustomScheduler); + + procedure Assign(Source: TPersistent); override; + published + property SelectOnRightClick: Boolean read FSelectOnRightClick + write FSelectOnRightClick default False; + property HotTrack: Boolean read FHotTrack write FHotTrack default True; + end; + + { TcxCustomScheduler } + + TcxSchedulerCanShowViewEvent = procedure(Sender: TObject; + AView: TcxSchedulerCustomView; var Allow: Boolean) of object; + TcxSchedulerGetEventEditPropertiesEvent = procedure(Sender: TObject; + AEvent: TcxSchedulerControlEvent; var AProperties: TcxCustomEditProperties) of object; + TcxSchedulerGetEventText = procedure(Sender: TObject; + AEvent: TcxSchedulerControlEvent; var AText: string) of object; + TcxSchedulerInitEditEvent = procedure(Sender: TObject; AEdit: TcxCustomEdit) of object; + TcxSchedulerViewTypeChangedEvent = procedure(Sender: TObject; + APrevView, ANewView: TcxSchedulerCustomView) of object; + TcxSchedulerIsWorkTimeEvent = procedure(Sender: TObject; AResource: TcxSchedulerStorageResourceItem; + const ATime: TDateTime; var AIsWork: Boolean) of object; + TcxSchedulerBeforeDeleting = procedure (Sender: TcxCustomScheduler; + AEvent: TcxSchedulerControlEvent; var Allow: Boolean) of object; + TcxSchedulerBeforeDragEvent = procedure (Sender: TcxCustomScheduler; + AEvent: TcxSchedulerControlEvent; X, Y: Integer; var Allow: Boolean) of object; + TcxSchedulerBeforeEditing = procedure (Sender: TcxCustomScheduler; + AEvent: TcxSchedulerControlEvent; AInplace: Boolean; var Allow: Boolean) of object; + TcxSchedulerAfterDragEvent = procedure (Sender: TcxCustomScheduler; + Target: TObject; X, Y: Integer; var Accept: Boolean) of object; + TcxSchedulerBeforeSizingEvent = procedure (Sender: TcxCustomScheduler; + AEvent: TcxSchedulerControlEvent; X, Y: Integer; var Allow: Boolean) of object; + TcxSchedulerAfterSizingEvent = procedure (Sender: TcxCustomScheduler; + AEvent: TcxSchedulerControlEvent; X, Y: Integer; var Accept: Boolean) of object; + TcxSchedulerAfterEditing = procedure (Sender: TcxCustomScheduler; + AEvent: TcxSchedulerControlEvent) of object; + TcxSchedulerMoreEventsButtonClickEvent = procedure (Sender: TcxCustomScheduler; + var AHandled: Boolean) of object; + TcxSchedulerNavigationButtonClickEvent = procedure (Sender: TcxCustomScheduler; + var AHandled: Boolean) of object; + TcxSchedulerScaleScrollEvent = procedure (Sender: TcxCustomScheduler; + AStartDateTime, AFinishDateTime: TDateTime) of object; + TcxSchedulerEventSelectionChangedEvent = procedure (Sender: TcxCustomScheduler; + AEvent: TcxSchedulerControlEvent) of object; + TcxSchedulerShowDateHintEvent = procedure (Sender: TObject; const ADate: TDateTime; + var AHintText: string; var AAllow: Boolean) of object; + + TcxCustomScheduler = class(TcxControl, + IcxSchedulerStorageListener, + IcxFormatControllerListener, + IcxFormatControllerListener2, + IcxStoredObject, IdxSkinSupport) + private + FActiveControl: TcxSchedulerSubControl; + FAligningSubControls: Boolean; + FBackground: TcxSchedulerSubControl; + {$IFNDEF DEBUGPAINT} + FBitmap: TBitmap; + FBitmapCanvas: TcxCanvas; + {$ENDIF} + FBoundsChanging: Boolean; + FCanModified: Boolean; + FCanvas: TcxCanvas; + FCaptureControl: TcxSchedulerSubControl; + FClipboardController: TcxSchedulerClipboardController; + FContentPopupMenu: TcxSchedulerContentPopupMenu; + FContentPopupMenuEvents: TNotifyEvent; + FControlBox: TcxSchedulerControlBox; + FControlFlags: TcxControlFlags; + FCurrentView: TcxSchedulerCustomView; + FDateNavigator: TcxSchedulerCustomDateNavigator; + FDefaultProperties: TcxCustomEditProperties; + FDialogsLookAndFeel: TcxLookAndFeel; + FEditController: TcxSchedulerEditController; + FEditStyle: TcxCustomEditStyle; + FEventDays: TcxSchedulerDateList; + FEventEditInfo: TcxSchedulerEventEditInfo; + FEventHitTestController: TcxSchedulerEventHitTestController; + FEventImages: TCustomImageList; + FEventList: TcxSchedulerCachedEventList; + FEventOperations: TcxSchedulerEventOperations; + FEventPopupMenu: TcxSchedulerEventPopupMenu; + FEventPopupMenuEvents: TNotifyEvent; + FFirstVisibleResourceIndex: Integer; + FHintController: TcxSchedulerHintController; + FHolidayDays: TcxSchedulerDateList; + FHorzSplitter: TcxSchedulerSplitter; + FHorzSplitterShowing: Boolean; + FIsDragCanceled: Boolean; + FKeyboardListener: TcxSchedulerSubControl; + FListeners: TInterfaceList; + FLockCount: Integer; + FLockRefresh: Integer; + FOnInitEdit: TcxSchedulerInitEditEvent; + FOptionsBehavior: TcxSchedulerOptionsBehavior; + FOptionsCustomize: TcxSchedulerOptionsCustomize; + FOptionsView: TcxSchedulerOptionsView; + FPrevBounds: TRect; + FPrevCopyDragDrop: Boolean; + FPrevMousePos: TPoint; + FResourceNavigator: TcxSchedulerResourceNavigator; + FResourceNavigatorEvents: TNotifyEvent; + FSelectedDays: TcxSchedulerDateList; + FSelFinish: TDateTime; + FSelResource: TcxSchedulerStorageResourceItem; + FSelStart: TDateTime; + FStorage: TcxCustomSchedulerStorage; + FStoringName: string; + FStyles: TcxSchedulerStyles; + FStylesEvents: TNotifyEvent; + FSubControls: TList; + FSubControlsCreated: Boolean; + FTextEditProperties: TcxTextEditProperties; + FVertSplitter: TcxSchedulerSplitter; + FVertSplitterShowing: Boolean; + FVisibleChangedCount: Integer; + FUpdateTimeTimer: TTimer; + FOnAfterDragEvent: TcxSchedulerAfterDragEvent; + FOnAfterEditing: TcxSchedulerAfterEditing; + FOnAfterSizingEvent: TcxSchedulerAfterSizingEvent; + FOnBeforeDeleting: TcxSchedulerBeforeDeleting; + FOnBeforeDragEvent: TcxSchedulerBeforeDragEvent; + FOnBeforeEditing: TcxSchedulerBeforeEditing; + FOnBeforeSizingEvent: TcxSchedulerBeforeSizingEvent; + FOnCanShowView: TcxSchedulerCanShowViewEvent; + FOnEventSelectionChanged: TcxSchedulerEventSelectionChangedEvent; + FOnFirstVisibleResourceChanged: TNotifyEvent; + FOnGetEventDisplayText: TcxSchedulerGetEventText; + FOnGetEventEditProperties: TcxSchedulerGetEventEditPropertiesEvent; + FOnGetEventHintText: TcxSchedulerGetEventText; + FOnIsWorkTime: TcxSchedulerIsWorkTimeEvent; + FOnLayoutChanged: TNotifyEvent; + FOnMoreEventsButtonClick: TcxSchedulerMoreEventsButtonClickEvent; + FOnNavigationButtonClick: TcxSchedulerNavigationButtonClickEvent; + FOnSelectionChanged: TNotifyEvent; + FOnScaleScroll: TcxSchedulerScaleScrollEvent; + FOnShowDateHint: TcxSchedulerShowDateHintEvent; + FOnViewTypeChanged: TcxSchedulerViewTypeChangedEvent; + procedure CreateUpdateTimeTimer; + function GetActiveHitTest: TcxSchedulerSubControlHitTest; + function GetCaptureControl: TcxSchedulerSubControl; + function GetCaptureController: TcxSchedulerSubControlController; + function GetSelectedEventCount: Integer; + function GetSelectedEvent(AIndex: Integer): TcxSchedulerControlEvent; + function GetSelFinish: TDateTime; + function GetSelStart: TDateTime; + function GetIsDynamicUpdate: Boolean; + function GetStartOfWeek: TDay; + function GetStorageActive: Boolean; + function GetStorageValid: Boolean; + function GetSubControl(AIndex: Integer): TcxSchedulerSubControl; + function GetSubControlCount: Integer; + function GetVisibleEventCount: Integer; + function GetVisibleEvent(AIndex: Integer): TcxSchedulerControlEvent; + procedure InitEventBySelection(AEvent: TcxSchedulerEvent; + AllDay: Boolean; ARecurrence: Boolean; AInplaceEditing: Boolean); + procedure SetCaptureControl(AValue: TcxSchedulerSubControl); + procedure SetContentPopupMenu(AValue: TcxSchedulerContentPopupMenu); + procedure SetControlBox(AValue: TcxSchedulerControlBox); + procedure SetDialogsLookAndFeel(AValue: TcxLookAndFeel); + procedure SetEventImages(AValue: TCustomImageList); + procedure SetEventOperations(AValue: TcxSchedulerEventOperations); + procedure SetEventPopupMenu(AValue: TcxSchedulerEventPopupMenu); + procedure SetFirstVisibleResourceIndex(AValue: Integer); + procedure SetOptionsBehavior(AValue: TcxSchedulerOptionsBehavior); + procedure SetOptionsCustomize(AValue: TcxSchedulerOptionsCustomize); + procedure SetOptionsView(AValue: TcxSchedulerOptionsView); + procedure SetResourceNavigator(AValue: TcxSchedulerResourceNavigator); + procedure SetStyles(AValue: TcxSchedulerStyles); + procedure SetStorage(AValue: TcxCustomSchedulerStorage); + procedure UpdateTimeHandler(Sender: TObject); + procedure WMCancelMode(var Message: TWMCancelMode); message WM_CANCELMODE; + procedure WMSetCursor(var Message: TWMSetCursor); message WM_SETCURSOR; + procedure WMTimeChange(var Message: TWMTimeChange); message WM_TIMECHANGE; + procedure ReadSelectionData(AReader: TReader); + procedure WriteSelectionData(AWriter: TWriter); + protected + FStoredClientBounds: TRect; + // IcxSchedulerStorageListener + procedure StorageChanged(Sender: TObject); + procedure StorageRemoved(Sender: TObject); + // IcxFormatControllerListener + procedure DoStartOfWeekChanged(AOldStartOfWeek, ANewStartOfWeek: TDay); virtual; + procedure FormatChanged; virtual; + // IcxFormatControllerListener2 + procedure TimeChanged; + // IcxStoredObject + function GetObjectName: string; virtual; + function GetProperties(AProperties: TStrings): Boolean; virtual; + procedure GetPropertyValue(const AName: string; var AValue: Variant); virtual; + procedure SetPropertyValue(const AName: string; const AValue: Variant); virtual; + // from TControl + procedure AlignControls(AControl: TControl; var Rect: TRect); override; + procedure DefineProperties(Filer: TFiler); override; + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + // IcxExternalDateNavigatorListener + procedure AddListener(AListener: IcxExternalDateNavigatorListener); + procedure NotififySchedulerChanged; + procedure NotififySchedulerRemoved; + procedure NotififyStorageChanged; + procedure RemoveListener(AListener: IcxExternalDateNavigatorListener); + + // methods + + //layout + procedure AlignSubControls(Sender: TcxSchedulerSubControl = nil); virtual; + procedure BoundsChanged; override; + procedure CalcHorizontalSplitterBounds; virtual; + procedure CalcVerticalSplitterBounds; virtual; + procedure CalcLayout; virtual; + procedure CalcLayoutViewRight; virtual; + procedure CalcLayoutViewLeft; virtual; + procedure CalcLayoutViewTop; virtual; + procedure CalcLayoutViewBottom; virtual; + procedure CalcSplittersBounds; + procedure CheckHorzSplitterBounds; + procedure CheckSplittersVisibilityChanging; virtual; + function IsHorzSplitterVisible: Boolean; virtual; + function IsVertSplitterVisible: Boolean; virtual; + procedure UpdateControlsBoundsOnHorzSplitterShowing; + procedure UpdateControlsBoundsOnVertSplitterShowing; + + function CanDeactivateOnSelectionChanged(AView: TcxSchedulerCustomView): Boolean; virtual; + function CanIntersect(AEvent: TcxSchedulerControlEvent): Boolean; virtual; + function CanModified: Boolean; virtual; + function CanSelectPeriod: Boolean; virtual; + function CanShowEventDialog: Boolean; + function CreateBackground: TcxSchedulerSubControl; virtual; + function CreateClipboardController: TcxSchedulerClipboardController; virtual; + function CreateContentPopupMenu: TcxSchedulerContentPopupMenu; virtual; + function CreateControlBox: TcxSchedulerControlBox; virtual; + function CreateDateNavigator: TcxSchedulerCustomDateNavigator; virtual; + function CreateDefaultView: TcxSchedulerCustomView; virtual; + function CreateDefaultEditProperties: TcxCustomEditProperties; virtual; + function CreateEditController: TcxSchedulerEditController; virtual; + function CreateEventHitTestController: TcxSchedulerEventHitTestController; virtual; + function CreateEventList: TcxSchedulerCachedEventList; virtual; + function CreateEventOperations: TcxSchedulerEventOperations; virtual; + function CreateEventPopupMenu: TcxSchedulerEventPopupMenu; virtual; + function CreateHintController: TcxSchedulerHintController; virtual; + function CreateOptionsCustomize: TcxSchedulerOptionsCustomize; virtual; + function CreateOptionsView: TcxSchedulerOptionsView; virtual; + function CreateResourceNavigator: TcxSchedulerResourceNavigator; virtual; + function CreateSplitter(AKind: TcxSchedulerSplitterKind): TcxSchedulerSplitter; virtual; + function CreateStyles: TcxSchedulerStyles; virtual; + procedure CreateSubClasses; virtual; + procedure DateNavigatorSelectionChanged; virtual; + procedure DestroySubClasses; virtual; + procedure DoAfterDragEvent(Target: TObject; X, Y: Integer; var Accept: Boolean); virtual; + procedure DoAfterEditing(AEvent: TcxSchedulerControlEvent); virtual; + procedure DoAfterSizingEvent(AEvent: TcxSchedulerControlEvent; X, Y: Integer; var Accept: Boolean); virtual; + function DoBeforeDeleting(AEvent: TcxSchedulerControlEvent): Boolean; virtual; + function DoBeforeDragEvent(AEvent: TcxSchedulerControlEvent; X, Y: Integer): Boolean; virtual; + function DoBeforeEditing(AEvent: TcxSchedulerControlEvent; AInplace: Boolean): Boolean; virtual; + function DoBeforeSizingEvent(AEvent: TcxSchedulerControlEvent; X, Y: Integer): Boolean; virtual; + procedure DoCalculateLayout(AControl: TcxSchedulerSubControl); virtual; + procedure DoCancelMode; override; + procedure DoControllerReset(AControl: TcxSchedulerSubControl); virtual; + procedure DoCreateEventUsingInplaceEdit(AKey: Char = #0); virtual; + procedure DoEventSelectionChanged(AEvent: TcxSchedulerControlEvent); + procedure DoFirstVisibleResourceChanged; virtual; + procedure DoGetEventDisplayText(AEvent: TcxSchedulerControlEvent; var AText: string); virtual; + procedure DoGetEventEditProperties(AEvent: TcxSchedulerControlEvent; var AProperties: TcxCustomEditProperties); virtual; + procedure DoHitTestRecalculate(AControl: TcxSchedulerSubControl); virtual; + procedure DoInitEdit(AEdit: TcxCustomEdit); virtual; + function DoIsWorkTime(AResourceItem: TcxSchedulerStorageResourceItem; const ADateTime: TDateTime): Boolean; + procedure DoCanShowView(AView: TcxSchedulerCustomView; var Allow: Boolean); virtual; + procedure DoLayoutChanged; virtual; + procedure DoLayoutChangedEvent; virtual; + function DoMoreEventsButtonClick: Boolean; virtual; + function DoNavigationButtonClick: Boolean; virtual; + procedure DoSelectionChanged; virtual; + procedure DoScaleScroll; virtual; + function DoShowDateHint(const ADate: TDateTime; var AHintText: string): Boolean; virtual; + function DoShowPopupMenu(AMenu: TComponent; X, Y: Integer): Boolean; override; + procedure DoViewTypeChanged(ANewView: TcxSchedulerCustomView); virtual; + procedure DoUpdateTime; virtual; + procedure DragCanceled; override; + procedure DrawSplitters; virtual; + procedure FirstVisibleResourceChanged; virtual; + procedure FontChanged; override; + procedure FocusChanged; override; + function GetClientBounds: TRect; override; + function GetControlCanvas: TcxCanvas; + function GetControlFromPoint(const APoint: TPoint): TcxSchedulerSubControl; virtual; + function GetCursor(X, Y: Integer): TCursor; override; + function GetDateTimeHelper: TcxSchedulerDateTimeHelperClass; virtual; + function GetDateNavigatorLoadedSize: TSize; + function GetDesignHitTest(X, Y: Integer; Shift: TShiftState): Boolean; override; + function GetEventEditInfo(AEvent: TcxSchedulerControlEvent; + ARecurrence: Boolean = False; AReadOnly: Boolean = False): TcxSchedulerEventEditInfo; + function GetEventHintText(AEvent: TcxSchedulerControlEvent): string; virtual; + function GetEventUserHintText(AEvent: TcxSchedulerControlEvent; var AText: string): Boolean; virtual; + function GetHScrollBarBounds: TRect; override; + function GetInternalCanvas: TcxCanvas; virtual; + function GetIsLocked: Boolean; virtual; + function GetNextView(AView: TcxSchedulerCustomView): TcxSchedulerCustomView; virtual; + function GetOnShowDateHint: TcxSchedulerShowDateHintEvent; virtual; + function GetPainterHelper: TcxSchedulerPainterHelperClass; virtual; + function GetSizeGripBounds: TRect; override; + function GetTimeBias: Double; virtual; + function GetVScrollBarBounds: TRect; override; + function HasConflict(AStartDrag: Boolean): Boolean; + function HasResources: Boolean; + procedure InitControl; override; + procedure InitScrollBarsParameters; override; + procedure InternalDeleteEvent(AEvent: TcxSchedulerControlEvent; AIgnoreRecurring: Boolean); + procedure InternalDeleteSelectedEvents(AForceDelete, ACheckReadOnly: Boolean); + procedure InternalPaint(const AClipRect: TRect); + function IsViewAtLeft: Boolean; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + procedure Loaded; override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); override; + procedure LockUpdateChanged(ALocking: Boolean); virtual; + procedure Modified; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseLeave(AControl: TControl); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + function NeedShowHint(AEvent: TcxSchedulerControlEvent; var AHintText: string; + AllowShow: Boolean): Boolean; virtual; + procedure Paint; override; + procedure PeriodChanged; virtual; + procedure RemoveSubControl(AControl: TcxSchedulerSubControl); + procedure ReplaceSelParams(ASelStart, ASelFinish: TDateTime; + AResource: TcxSchedulerStorageResourceItem); virtual; + procedure Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); override; + procedure SelectedDaysChanged(AView: TcxSchedulerCustomView); + procedure SetCurrentView(AView: TcxSchedulerCustomView); virtual; + procedure SubControlAdd(AControl: TcxSchedulerSubControl); + procedure SubControlRemove(AControl: TcxSchedulerSubControl); + procedure SynchronizeVisibleDays; virtual; + procedure UpdateDateNavigatorDragging(Accept: Boolean); + procedure UpdateEventsCache(ACheckDaysInterval: Boolean); virtual; + procedure ValidateSelection(ASelection: TcxSchedulerDateList); virtual; + procedure ValidateState; + procedure ViewVisibleChanged(AView: TcxSchedulerCustomView); virtual; + function VisibleGroupingKind: TcxSchedulerGroupingKind; + // drag'n'drop support + function CanDrag(X, Y: Integer): Boolean; override; + procedure DoEndDrag(Target: TObject; X, Y: Integer); override; + procedure DoStartDrag(var DragObject: TDragObject); override; + procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); override; + procedure EndDragAndDrop(Accepted: Boolean); override; + function GetDragAndDropObjectClass: TcxDragAndDropObjectClass; override; + function GetDragObjectClass: TDragControlObjectClass; override; + function StartDragAndDrop(const P: TPoint): Boolean; override; + + property Background: TcxSchedulerSubControl read FBackground; + {$IFNDEF DEBUGPAINT} + property Bitmap: TBitmap read FBitmap; + property BitmapCanvas: TcxCanvas read FBitmapCanvas; + {$ENDIF} + property AligningSubControls: Boolean read FAligningSubControls; + property BoundsChanging: Boolean read FBoundsChanging; + property Canvas: TcxCanvas read FCanvas; + property Capture: TcxSchedulerSubControl read GetCaptureControl write SetCaptureControl; + property CaptureController: TcxSchedulerSubControlController read GetCaptureController; + property ClipboardController: TcxSchedulerClipboardController read FClipboardController; + property ControlFlags: TcxControlFlags read FControlFlags write FControlFlags; + property DefaultProperties: TcxCustomEditProperties read FDefaultProperties; + property DialogsLookAndFeel: TcxLookAndFeel read FDialogsLookAndFeel write SetDialogsLookAndFeel; + property EditController: TcxSchedulerEditController read FEditController; + property EditStyle: TcxCustomEditStyle read FEditStyle; //remove to EditingController + property EventHitTestController: TcxSchedulerEventHitTestController read FEventHitTestController write FEventHitTestController; + property EventList: TcxSchedulerCachedEventList read FEventList; + property HintController: TcxSchedulerHintController read FHintController; + property HorzSplitter: TcxSchedulerSplitter read FHorzSplitter; + property IsDragCanceled: Boolean read FIsDragCanceled; + property IsDynamicUpdate: Boolean read GetIsDynamicUpdate; + property IsLocked: Boolean read GetIsLocked; + property KeyboardListener: TcxSchedulerSubControl read FKeyboardListener write FKeyboardListener; + property LockCount: Integer read FLockCount; + property PainterHelper: TcxSchedulerPainterHelperClass read GetPainterHelper; + property ParentFont default False; + property StartOfWeek: TDay read GetStartOfWeek; + property StorageActive: Boolean read GetStorageActive; + property StorageValid: Boolean read GetStorageValid; + property SubControlCount: Integer read GetSubControlCount; + property SubControlsCreated: Boolean read FSubControlsCreated; + property SubControls[Index: Integer]: TcxSchedulerSubControl read GetSubControl; + property VertSplitter: TcxSchedulerSplitter read FVertSplitter; + property DragMode default dmAutomatic; + property BorderStyle default cxcbsDefault; + + property OnAfterDragEvent: TcxSchedulerAfterDragEvent read FOnAfterDragEvent write FOnAfterDragEvent; + property OnAfterEditing: TcxSchedulerAfterEditing read FOnAfterEditing write FOnAfterEditing; + property OnAfterSizingEvent: TcxSchedulerAfterSizingEvent read FOnAfterSizingEvent write FOnAfterSizingEvent; + property OnBeforeDeleting: TcxSchedulerBeforeDeleting read FOnBeforeDeleting write FOnBeforeDeleting; + property OnBeforeDragEvent: TcxSchedulerBeforeDragEvent read FOnBeforeDragEvent write FOnBeforeDragEvent; + property OnBeforeEditing: TcxSchedulerBeforeEditing read FOnBeforeEditing write FOnBeforeEditing; + property OnBeforeSizingEvent: TcxSchedulerBeforeSizingEvent read FOnBeforeSizingEvent write FOnBeforeSizingEvent; + property OnCanShowView: TcxSchedulerCanShowViewEvent read FOnCanShowView write FOnCanShowView; + property OnEventSelectionChanged: TcxSchedulerEventSelectionChangedEvent read FOnEventSelectionChanged write FOnEventSelectionChanged; + property OnFirstVisibleResourceChanged: TNotifyEvent read FOnFirstVisibleResourceChanged write FOnFirstVisibleResourceChanged; + property OnGetEventDisplayText: TcxSchedulerGetEventText read FOnGetEventDisplayText write FOnGetEventDisplayText; + property OnGetEventHintText: TcxSchedulerGetEventText read FOnGetEventHintText write FOnGetEventHintText; + property OnGetEventEditProperties: TcxSchedulerGetEventEditPropertiesEvent read FOnGetEventEditProperties write FOnGetEventEditProperties; + property OnInitEdit: TcxSchedulerInitEditEvent read FOnInitEdit write FOnInitEdit; + property OnIsWorkTime: TcxSchedulerIsWorkTimeEvent read FOnIsWorkTime write FOnIsWorkTime; + property OnLayoutChanged: TNotifyEvent read FOnLayoutChanged write FOnLayoutChanged; + property OnMoreEventsButtonClick: TcxSchedulerMoreEventsButtonClickEvent read FOnMoreEventsButtonClick write FOnMoreEventsButtonClick; + property OnNavigationButtonClick: TcxSchedulerNavigationButtonClickEvent read FOnNavigationButtonClick write FOnNavigationButtonClick; + property OnScaleScroll: TcxSchedulerScaleScrollEvent read FOnScaleScroll write FOnScaleScroll; + property OnSelectionChanged: TNotifyEvent read FOnSelectionChanged write FOnSelectionChanged; + property OnShowDateHint: TcxSchedulerShowDateHintEvent read GetOnShowDateHint write FOnShowDateHint; + property OnViewTypeChanged: TcxSchedulerViewTypeChangedEvent read FOnViewTypeChanged write FOnViewTypeChanged; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure BeginUpdate; + procedure CopyToClipboard; + procedure CreateEventUsingDialog(AllDay: Boolean = False; ARecurrence: Boolean = False); virtual; + procedure CreateEventUsingInplaceEdit; + procedure CutToClipboard; + procedure DeleteEvent(AEvent: TcxSchedulerControlEvent); virtual; + procedure DeleteSelectedEvents(ACheckReadOnly: Boolean = True); + procedure DragDrop(Source: TObject; X, Y: Integer); override; + procedure EditEventUsingDialog(AEvent: TcxSchedulerControlEvent; + ACheckReadOnly: Boolean = True; AForcePatternEditing: Boolean = False); + procedure EditEventUsingInplaceEdit(AEvent: TcxSchedulerControlEvent); + procedure EndUpdate; + procedure FullRefresh; virtual; + function GoToDate(ADate: TDateTime): Boolean; overload; virtual; + function GoToDate(ADate: TDateTime; AViewMode: TcxSchedulerViewMode): Boolean; overload; virtual; + procedure LayoutChanged; + procedure MakeEventVisible(AEvent: TcxSchedulerControlEvent; + const ADate: TDateTime = NullDate; AResource: TcxSchedulerStorageResourceItem = nil); + procedure MakeResourceVisible(AResource: TcxSchedulerStorageResourceItem); + procedure PasteFromClipboard; + procedure SelectEvent(AEvent: TcxSchedulerControlEvent; AShift: TShiftState = []); + procedure SelectTime(const ASelStart, ASelFinish: TDateTime; + AResource: TcxSchedulerStorageResourceItem); + procedure UnselectEvents; + procedure ValidateFirstVisibleResourceIndex; + // store/load + procedure RestoreFromIniFile(const AStorageName: string; ARestoreResources: Boolean = True); + procedure RestoreFromRegistry(const AStorageName: string; ARestoreResources: Boolean = True); + procedure RestoreFromStream(AStream: TStream; ARestoreResources: Boolean = True); + procedure StoreToIniFile(const AStorageName: string; AReCreate: Boolean = True; AStoreResources: Boolean = True); + procedure StoreToRegistry(const AStorageName: string; AReCreate: Boolean = True; AStoreResources: Boolean = True); + procedure StoreToStream(AStream: TStream; AStoreResources: Boolean = True); + + property ActiveHitTest: TcxSchedulerSubControlHitTest read GetActiveHitTest; + property Color; + property ContentPopupMenu: TcxSchedulerContentPopupMenu read FContentPopupMenu write SetContentPopupMenu; + property ControlBox: TcxSchedulerControlBox read FControlBox write SetControlBox; + property CurrentView: TcxSchedulerCustomView read FCurrentView write SetCurrentView; + property DateNavigator: TcxSchedulerCustomDateNavigator read FDateNavigator; + property DateTimeHelper: TcxSchedulerDateTimeHelperClass read GetDateTimeHelper; + property EventDays: TcxSchedulerDateList read FEventDays; + property EventImages: TCustomImageList read FEventImages write SetEventImages; + property EventOperations: TcxSchedulerEventOperations read FEventOperations write SetEventOperations; + property EventPopupMenu: TcxSchedulerEventPopupMenu read FEventPopupMenu write SetEventPopupMenu; + property FirstVisibleResourceIndex: Integer read FFirstVisibleResourceIndex write SetFirstVisibleResourceIndex default 0; + property HolidayDays: TcxSchedulerDateList read FHolidayDays; + property OptionsBehavior: TcxSchedulerOptionsBehavior read FOptionsBehavior write SetOptionsBehavior; + property OptionsCustomize: TcxSchedulerOptionsCustomize read FOptionsCustomize write SetOptionsCustomize; + property OptionsView: TcxSchedulerOptionsView read FOptionsView write SetOptionsView; + property ResourceNavigator: TcxSchedulerResourceNavigator read FResourceNavigator write SetResourceNavigator; + property SelectedDays: TcxSchedulerDateList read FSelectedDays; + property SelectedEventCount: Integer read GetSelectedEventCount; + property SelectedEvents[Index: Integer]: TcxSchedulerControlEvent read GetSelectedEvent; + property SelFinish: TDateTime read GetSelFinish; + property SelResource: TcxSchedulerStorageResourceItem read FSelResource; + property SelStart: TDateTime read GetSelStart; + property Storage: TcxCustomSchedulerStorage read FStorage write SetStorage; + property StoringName: string read FStoringName write FStoringName; + property Styles: TcxSchedulerStyles read FStyles write SetStyles; + property VisibleEventCount: Integer read GetVisibleEventCount; + property VisibleEvents[AIndex: Integer]: TcxSchedulerControlEvent read GetVisibleEvent; + property TabStop default True; + property Font; + published + property StylesEvents: TNotifyEvent read FStylesEvents write FStylesEvents; + property ResourceNavigatorEvents: TNotifyEvent read FResourceNavigatorEvents write FResourceNavigatorEvents; + property ContentPopupMenuEvents: TNotifyEvent read FContentPopupMenuEvents write FContentPopupMenuEvents; + property EventPopupMenuEvents: TNotifyEvent read FEventPopupMenuEvents write FEventPopupMenuEvents; + end; + + { TcxSchedulerPopupMenu } + + TcxSchedulerPopupMenu = class(TPersistent) + private + FScheduler: TcxCustomScheduler; + FPopupMenu: TComponent; + FInternalMenu: TPopupMenu; + FUseBuiltInPopupMenu: Boolean; + function GetRoot: TMenuItem; + procedure SetPopupMenu(const Value: TComponent); + protected + function AddValidSeparator(AOwner: TMenuItem): TMenuItem; + procedure CreateInternalMenu; + procedure CreateItems; virtual; + function CreateSeparator(AOwner: TMenuItem): TMenuItem; + function CreateSubItem(AOwner: TMenuItem; const ACaption: string; ACommand: Integer = -1; + AImageIndex: Integer = -1; AEnabled: Boolean = True; AChecked: Boolean = False): TMenuItem; + procedure DoExecute(ACommand: Integer); virtual; + function DoOnClick(ACommand: Integer): Boolean; virtual; + function DoOnPopup: Boolean; virtual; + procedure ExecuteCommand(ACommand: Integer); + function FindItemByCommand(AOwnerItem: TMenuItem; ACommand: Integer): TMenuItem; + function IsValidCommand(ACommand: Integer): Boolean; virtual; + procedure Notification(AComponent: TComponent; Operation: TOperation); + procedure OnItemClickHandler(Sender: TObject); + function Storage: TcxCustomSchedulerStorage; + + property InternalMenu: TPopupMenu read FInternalMenu; + property Root: TMenuItem read GetRoot; + public + constructor Create(AScheduler: TcxCustomScheduler); virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function Popup(X, Y: Integer): Boolean; virtual; + + property Scheduler: TcxCustomScheduler read FScheduler; + published + property PopupMenu: TComponent read FPopupMenu write SetPopupMenu; + property UseBuiltInPopupMenu: Boolean read FUseBuiltInPopupMenu write FUseBuiltInPopupMenu default True; + end; + + { TcxSchedulerCustomContentPopupMenu } + + TcxSchedulerCustomContentPopupMenu = class(TcxSchedulerPopupMenu) + private + FNewID: Integer; + FAllDayID: Integer; + FReccurenceID: Integer; + protected + function CanCreateEvent: Boolean; + procedure CreateNewEventItems(ANew, AllDay, AReccurence: Boolean; + ANewID, AllDayID, AReccurenceID: Integer); + procedure DoExecute(ACommand: Integer); override; + public + constructor Create(AScheduler: TcxCustomScheduler); override; + end; + + { TcxSchedulerContentPopupMenu } + + TcxSchedulerContentPopupMenuPopupEvent = procedure (Sender: TcxSchedulerContentPopupMenu; + ABuiltInMenu: TPopupMenu; var AHandled: Boolean) of object; + TcxSchedulerContentPopupMenuClickEvent = procedure (Sender: TcxSchedulerContentPopupMenu; + AItem: TcxSchedulerContentPopupMenuItem; var AHandled: Boolean) of object; + + TcxSchedulerContentPopupMenu = class(TcxSchedulerCustomContentPopupMenu) + private + FActualItems: TcxSchedulerContentPopupMenuItems; + FItems: TcxSchedulerContentPopupMenuItems; + FSavedDate: TDateTime; + FOnPopup: TcxSchedulerContentPopupMenuPopupEvent; + FOnClick: TcxSchedulerContentPopupMenuClickEvent; + procedure CreateGoToThisDayItem; + protected + procedure CreateItems; override; + procedure DoExecute(ACommand: Integer); override; + function DoOnClick(ACommand: Integer): Boolean; override; + function DoOnPopup: Boolean; override; + function IsValidCommand(ACommand: Integer): Boolean; override; + + property ActualItems: TcxSchedulerContentPopupMenuItems read FActualItems; + public + constructor Create(AScheduler: TcxCustomScheduler); override; + procedure Assign(Source: TPersistent); override; + procedure Execute(AItem: TcxSchedulerContentPopupMenuItem); + function GetMenuItem(AItem: TcxSchedulerContentPopupMenuItem): TMenuItem; + published + property Items: TcxSchedulerContentPopupMenuItems + read FItems write FItems default [cpmiNewEvent, cpmiNewAllDayEvent, + cpmiNewReccuringEvent, cpmiToday, cpmiGoToDate, cpmiGoToThisDay, + cpmiResourcesLayout]; + property PopupMenu; + property UseBuiltInPopupMenu; + + property OnClick: TcxSchedulerContentPopupMenuClickEvent read FOnClick write FOnClick; + property OnPopup: TcxSchedulerContentPopupMenuPopupEvent read FOnPopup write FOnPopup; + end; + + { TcxSchedulerEventPopupMenu } + + TcxSchedulerEventPopupMenuItem = (epmiOpen, epmiEditSeries, + epmiShowTimeAs, epmiLabel, epmiDelete); + TcxSchedulerEventPopupMenuItems = set of TcxSchedulerEventPopupMenuItem; + + TcxSchedulerEventPopupMenuPopupEvent = procedure (Sender: TcxSchedulerEventPopupMenu; + ABuiltInMenu: TPopupMenu; var AHandled: Boolean) of object; + TcxSchedulerEventPopupMenuClickEvent = procedure (Sender: TcxSchedulerEventPopupMenu; + AItem: TcxSchedulerEventPopupMenuItem; ASubItemIndex: Integer; + var AHandled: Boolean) of object; + + TcxSchedulerEventPopupMenu = class(TcxSchedulerPopupMenu) + private + FEvent: TcxSchedulerControlEvent; + FItems: TcxSchedulerEventPopupMenuItems; + FOnPopup: TcxSchedulerEventPopupMenuPopupEvent; + FOnClick: TcxSchedulerEventPopupMenuClickEvent; + procedure CreateDeleteItem; + procedure CreateLabelItems; + procedure CreateTimeItems; + function GetCommand(AItem: TcxSchedulerEventPopupMenuItem; + ASubItemIndex: Integer): Integer; + function CanEdit: Boolean; + function GetEvent: TcxSchedulerControlEvent; + procedure UnpackCommand(ACommand: Integer; + out AItem: TcxSchedulerEventPopupMenuItem; out ASubItemIndex: Integer); + protected + procedure CreateItems; override; + procedure DoExecute(ACommand: Integer); override; + function DoOnClick(ACommand: Integer): Boolean; override; + function DoOnPopup: Boolean; override; + function IsValidCommand(ACommand: Integer): Boolean; override; + procedure SetEventLabelColor(AColor: Integer); + procedure SetEventState(AState: Integer); + public + constructor Create(AScheduler: TcxCustomScheduler); override; + procedure Assign(Source: TPersistent); override; + function GetMenuItem(AItem: TcxSchedulerEventPopupMenuItem; + ASubItemIndex: Integer = -1): TMenuItem; + property Event: TcxSchedulerControlEvent read FEvent; + published + property Items: TcxSchedulerEventPopupMenuItems + read FItems write FItems default [epmiOpen, epmiEditSeries, + epmiShowTimeAs, epmiLabel, epmiDelete]; + property PopupMenu; + property UseBuiltInPopupMenu; + + property OnClick: TcxSchedulerEventPopupMenuClickEvent read FOnClick write FOnClick; + property OnPopup: TcxSchedulerEventPopupMenuPopupEvent read FOnPopup write FOnPopup; + end; + +function IsHeaderEvent(AEvent: TcxSchedulerEvent): Boolean; + +var + CF_SCHEDULERDATA: Integer; + +implementation + +uses +{$IFDEF DELPHI6} + DateUtils, Variants, +{$ENDIF} + cxSchedulerDialogs, cxMemo, cxSchedulerStrs, + cxSchedulerRecurrenceSelectionDialog, cxLibraryConsts; + +const + EventContentColors: array[Boolean] of TColor = (clWindow, clWhite); + EditStartChars = [#8, #13, ^V, ^X, #32..#255]; + +function IsHeaderEvent(AEvent: TcxSchedulerEvent): Boolean; +begin + Result := AEvent.AllDayEvent or (AEvent.Duration >= 1); +end; + +{ TcxSchedulerSubControl } + +constructor TcxSchedulerSubControl.Create( + AOwner: TcxCustomScheduler); +begin + FScheduler := AOwner; + FVisible := True; + CreateSubClasses; + FCursor := crDefault; + Scheduler.SubControlAdd(Self); +end; + +destructor TcxSchedulerSubControl.Destroy; +begin + DestroySubClasses; + Scheduler.SubControlRemove(Self); + inherited Destroy; +end; + +procedure TcxSchedulerSubControl.Invalidate; +begin + InvalidateRect(ClientRect); +end; + +procedure TcxSchedulerSubControl.InvalidateRect( + const ARect: TRect); +begin + Scheduler.InvalidateRect(cxRectOffset(ARect, Left, Top), False); + Exclude(Scheduler.FControlFlags, cfImageValid); +end; + +procedure TcxSchedulerSubControl.LayoutChanged; +begin + FCanvas := Scheduler.FCanvas; + if not Visible then + ViewInfo.Clear + else + Painter.InitializePainter; + if not Visible or (Controller = nil) then Exit; + Exclude(Scheduler.FControlFlags, cfImageValid); + Controller.Reset; + DoLayoutChanged; + if not Scheduler.AligningSubControls then + begin + HitTest.Recalculate; + Invalidate; + end; +end; + +procedure TcxSchedulerSubControl.Refresh; +begin + LayoutChanged; +end; + +procedure TcxSchedulerSubControl.Repaint; +begin + Invalidate; + Scheduler.Update; +end; + +procedure TcxSchedulerSubControl.RepaintRect(const ARect: TRect); +begin + InvalidateRect(ARect); + Scheduler.Update; +end; + +function TcxSchedulerSubControl.ScreenToClient(const APos: TPoint): TPoint; +begin + Result := Scheduler.ScreenToClient(APos); + Dec(Result.X, Left); + Dec(Result.Y, Top); +end; + +procedure TcxSchedulerSubControl.SetBounds( + ALeft, ATop, AWidth, AHeight: Integer); +begin + if (ALeft <> FLeft) or (ATop <> FTop) or (AWidth <> FWidth) or + (AHeight <> FHeight) then + begin + BoundsChanging; + FLeft := ALeft; + FTop := ATop; + FWidth := AWidth; + FHeight := AHeight; + BoundsChanged; + end; +end; + +procedure TcxSchedulerSubControl.GetProperties(AProperties: TStrings); +begin +end; + +procedure TcxSchedulerSubControl.GetPropertyValue(const AName: string; + var AValue: Variant); +begin +end; + +procedure TcxSchedulerSubControl.SetPropertyValue(const AName: string; + const AValue: Variant); +begin +end; + +function TcxSchedulerSubControl.AllowDesignHitTest( + X, Y: Integer; AShift: TShiftState): Boolean; +begin + MousePositionChanged(X, Y); + Result := False; +end; + +procedure TcxSchedulerSubControl.BoundsChanged; +begin + Scheduler.AlignSubControls(Self); + Changed; +end; + +procedure TcxSchedulerSubControl.CalculateViewInfo; +begin + ViewInfo.Calculate; +end; + +function TcxSchedulerSubControl.CanCapture( + const APoint: TPoint): Boolean; +begin + Result := Visible and cxRectPtIn(Bounds, APoint); +end; + +procedure TcxSchedulerSubControl.Changed; +begin + Scheduler.LayoutChanged; +end; + +function TcxSchedulerSubControl.CreateController: TcxSchedulerSubControlController; +begin + Result := TcxSchedulerSubControlController.Create(Self); +end; + +function TcxSchedulerSubControl.CreateHitTest: TcxSchedulerSubControlHitTest; +begin + Result := TcxSchedulerSubControlHitTest.Create(Self); +end; + +function TcxSchedulerSubControl.CreatePainter: TcxSchedulerSubControlPainter; +begin + Result := TcxSchedulerSubControlPainter.Create(Self); +end; + +function TcxSchedulerSubControl.CreateViewInfo: TcxSchedulerSubControlViewInfo; +begin + Result := TcxSchedulerSubControlViewInfo.Create(Self); +end; + +procedure TcxSchedulerSubControl.BoundsChanging; +begin +end; + +procedure TcxSchedulerSubControl.CreateSubClasses; +begin + FViewInfo := CreateViewInfo; + FHitTest := CreateHitTest; + FController := CreateController; + FPainter := CreatePainter; +end; + +procedure TcxSchedulerSubControl.DestroySubClasses; +begin + FPainter.Free; + FHitTest.Free; + FController.Free; + FViewInfo.Free; +end; + +procedure TcxSchedulerSubControl.DoBeforeMouseDown(AButton: TMouseButton; + AShift: TShiftState; X, Y: Integer); +begin + MousePositionChanged(X, Y); + Controller.BeforeMouseDown(AButton, AShift, X, Y); +end; + +procedure TcxSchedulerSubControl.DoCancelMode; +begin + Mouse.Capture := 0; +end; + +procedure TcxSchedulerSubControl.DoLayoutChanged; +begin + CalculateViewInfo; +end; + +procedure TcxSchedulerSubControl.DoMouseDown( + AButton: TMouseButton; AShift: TShiftState; X, Y: Integer); +begin + MousePositionChanged(X, Y); + Controller.MouseDown(AButton, AShift, X, Y); +end; + +procedure TcxSchedulerSubControl.DoMouseMove( + AShift: TShiftState; X, Y: Integer); +begin + MousePositionChanged(X, Y); + Controller.MouseMove(AShift, X, Y); +end; + +procedure TcxSchedulerSubControl.DoMouseUp( + AButton: TMouseButton; AShift: TShiftState; X, Y: Integer); +begin + MousePositionChanged(X, Y); + Controller.MouseUp(AButton, AShift, X, Y); +end; + +procedure TcxSchedulerSubControl.DoPaint; +var + AClipRgn: TcxRegion; +begin + AClipRgn := Canvas.GetClipRegion; + Canvas.IntersectClipRect(ClientRect); + Painter.BeforePaint; + Painter.Paint; + Painter.AfterPaint; + Canvas.SetClipRegion(AClipRgn, roSet); +end; + +procedure TcxSchedulerSubControl.DoScaleScroll; +begin + Scheduler.DoScaleScroll; +end; + +procedure TcxSchedulerSubControl.FormatChanged; +begin +end; + +function TcxSchedulerSubControl.GetClientRect: TRect; +begin + Result := cxRectBounds(0, 0, FWidth, FHeight); +end; + +function TcxSchedulerSubControl.GetOwner: TPersistent; +begin + Result := FScheduler; +end; + +function TcxSchedulerSubControl.GetHScrollBarBounds: TRect; +begin + Result := cxNullRect; +end; + +function TcxSchedulerSubControl.GetScrollBar( + AKind: TScrollBarKind): TcxControlScrollBar; +begin + if AKind = sbHorizontal then + Result := Scheduler.HScrollBar + else + Result := Scheduler.VScrollBar; +end; + +function TcxSchedulerSubControl.GetSizeGripBounds: TRect; +begin + Result := cxNullRect; +end; + +function TcxSchedulerSubControl.GetStartOfWeek: TDay; +begin + Result := Scheduler.OptionsView.ActualStartOfWeek; +end; + +function TcxSchedulerSubControl.GetVScrollBarBounds: TRect; +begin + Result := cxNullRect; +end; + +procedure TcxSchedulerSubControl.InitScrollBarsParameters; +begin +end; + +function TcxSchedulerSubControl.IsSpecialPaint: Boolean; +begin + Result := False; +end; + +procedure TcxSchedulerSubControl.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin +end; + +procedure TcxSchedulerSubControl.MousePositionChanged( + var X, Y: Integer); +begin + Dec(X, FLeft); + Dec(Y, FTop); + HitTest.HitPoint := cxPoint(X, Y); +end; + +procedure TcxSchedulerSubControl.Notification(AComponent: TComponent; + Operation: TOperation); +begin +end; + +procedure TcxSchedulerSubControl.Paint; +var + ASavePos: TPoint; +begin + if not Visible or cxRectIsEmpty(Bounds) then Exit; + ASavePos := Canvas.WindowOrg; + Canvas.WindowOrg := cxPoint(-Left, -Top); + try + DoPaint; + finally + Canvas.WindowOrg := ASavePos; + end; +end; + +procedure TcxSchedulerSubControl.PeriodChanged; +begin + Scheduler.PeriodChanged; +end; + +procedure TcxSchedulerSubControl.SetScrollBarInfo( + AScrollBarKind: TScrollBarKind; AMin, AMax, AStep, APage, APos: Integer; + AAllowShow, AAllowHide: Boolean); +begin + Scheduler.SetScrollBarInfo(AScrollBarKind, AMin, AMax, + AStep, APage, APos, AAllowShow and Visible, AAllowHide); +end; + +procedure TcxSchedulerSubControl.VisibleChanged; +begin + Scheduler.AlignSubControls(Self); + Changed; +end; + +function TcxSchedulerSubControl.GetBottom: Integer; +begin + Result := FTop + FHeight; +end; + +{$IFNDEF DEBUGPAINT} +function TcxSchedulerSubControl.GetBitmap: TBitmap; +begin + Result := Scheduler.FBitmap; +end; +{$ENDIF} + +function TcxSchedulerSubControl.GetBounds: TRect; +begin + Result := cxRectBounds(FLeft, FTop, FWidth, FHeight); +end; + +function TcxSchedulerSubControl.GetDateTimeHelperClass: TcxSchedulerDateTimeHelperClass; +begin + Result := Scheduler.DateTimeHelper; +end; + +function TcxSchedulerSubControl.GetIsScrollingContent: Boolean; +begin + Result := Scheduler.IsScrollingContent; +end; + +function TcxSchedulerSubControl.GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := Scheduler.LookAndFeelPainter; +end; + +function TcxSchedulerSubControl.GetPainterHelperClass: TcxSchedulerPainterHelperClass; +begin + Result := Scheduler.PainterHelper; +end; + +function TcxSchedulerSubControl.GetRight: Integer; +begin + Result := FLeft + FWidth; +end; + +function TcxSchedulerSubControl.GetStyles: TcxSchedulerStyles; +begin + Result := Scheduler.Styles; +end; + +procedure TcxSchedulerSubControl.InternalSetBounds(const AValue: TRect); +begin + SetBounds(AValue.Left, AValue.Top, AValue.Right - AValue.Left, + AValue.Bottom - AValue.Top); +end; + +procedure TcxSchedulerSubControl.SetBottom(const Value: Integer); +begin + InternalSetBounds(cxRectSetBottom(Bounds, Value)); +end; + +procedure TcxSchedulerSubControl.SetHeight(AValue: Integer); +begin + SetBounds(FLeft, FTop, FWidth, AValue); +end; + +procedure TcxSchedulerSubControl.SetLeft(AValue: Integer); +begin + SetBounds(AValue, FTop, FWidth, FHeight); +end; + +procedure TcxSchedulerSubControl.SetRight(Value: Integer); +begin + InternalSetBounds(cxRectSetRight(Bounds, Value)); +end; + +procedure TcxSchedulerSubControl.SetTop(AValue: Integer); +begin + SetBounds(FLeft, AValue, FWidth, FHeight); +end; + +procedure TcxSchedulerSubControl.SetVisible( + AValue: Boolean); +begin + if AValue <> FVisible then + begin + FVisible := AValue; + VisibleChanged; + end; +end; + +procedure TcxSchedulerSubControl.SetWidth(AValue: Integer); +begin + SetBounds(FLeft, FTop, AValue, FHeight); +end; + +{ TcxSchedulerSubControlController } + +constructor TcxSchedulerSubControlController.Create( + AOwner: TcxSchedulerSubControl); +begin + FOwner := AOwner; +end; + +procedure TcxSchedulerSubControlController.BeginDragAndDrop; +begin +end; + +function TcxSchedulerSubControlController.CanDrag( + X, Y: Integer): Boolean; +begin + Result := False; +end; + +procedure TcxSchedulerSubControlController.DragAndDrop( + const P: TPoint; var Accepted: Boolean); +begin +end; + +procedure TcxSchedulerSubControlController.DragDrop( + Source: TObject; X, Y: Integer); +begin +end; + +procedure TcxSchedulerSubControlController.DragOver( + Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); +begin + Accept := False; +end; + +procedure TcxSchedulerSubControlController.EndDrag( + Target: TObject; X, Y: Integer); +begin +end; + +procedure TcxSchedulerSubControlController.EndDragAndDrop( + Accepted: Boolean); +begin +end; + +function TcxSchedulerSubControlController.GetDragAndDropObjectClass: TcxDragAndDropObjectClass; +begin + Result := nil; +end; + +procedure TcxSchedulerSubControlController.StartDrag( + var DragObject: TDragObject); +begin +end; + +function TcxSchedulerSubControlController.StartDragAndDrop( + const P: TPoint): Boolean; +begin + Result := False; +end; + +procedure TcxSchedulerSubControlController.BeforeMouseDown( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FCanProcessMouseMove := Button = mbLeft; +end; + +procedure TcxSchedulerSubControlController.DoCancelMode; +begin + FCanProcessMouseMove := False; +end; + +function TcxSchedulerSubControlController.GetCursor( + X, Y: Integer): TCursor; +begin + Result := Owner.Cursor; +end; + +procedure TcxSchedulerSubControlController.KeyDown( + var Key: Word; Shift: TShiftState); +begin +end; + +procedure TcxSchedulerSubControlController.KeyPress( + var Key: Char); +begin +end; + +procedure TcxSchedulerSubControlController.KeyUp( + var Key: Word; Shift: TShiftState); +begin +end; + +procedure TcxSchedulerSubControlController.MouseEnter; +begin +end; + +procedure TcxSchedulerSubControlController.MouseLeave; +begin +end; + +procedure TcxSchedulerSubControlController.MouseDown( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin +end; + +procedure TcxSchedulerSubControlController.MouseMove( + Shift: TShiftState; X, Y: Integer); +begin +end; + +procedure TcxSchedulerSubControlController.MouseUp( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + if Button = mbLeft then + FCanProcessMouseMove := False; +end; + +procedure TcxSchedulerSubControlController.Reset; +begin +end; + +function TcxSchedulerSubControlController.GetHitTest: TcxSchedulerSubControlHitTest; +begin + Result := Owner.HitTest; +end; + +function TcxSchedulerSubControlController.GetStartOfWeek: TDay; +begin + Result := Owner.StartOfWeek; +end; + +{ TcxSchedulerSubControlHitTest } + +constructor TcxSchedulerSubControlHitTest.Create( + AOwner: TcxSchedulerSubControl); +begin + FOwner := AOwner; +end; + +destructor TcxSchedulerSubControlHitTest.Destroy; +begin + inherited Destroy; +end; + +procedure TcxSchedulerSubControlHitTest.Recalculate; +begin + if Scheduler.HandleAllocated then + DoCalculate; +end; + +procedure TcxSchedulerSubControlHitTest.Clear; +begin + Flags := 0; + FTime := NullDate; +end; + +procedure TcxSchedulerSubControlHitTest.DoCalculate; +begin + Clear; + SetBitState(htcControl, cxRectPtIn(Owner.Bounds, + cxPointOffset(HitPoint, Owner.Left, Owner.Top))); +end; + +function TcxSchedulerSubControlHitTest.GetBitState( + AIndex: Integer): Boolean; +begin + Result := (Flags and (1 shl AIndex)) <> 0 +end; + +function TcxSchedulerSubControlHitTest.GetMaskState( + AMask: Integer): Boolean; +begin + Result := Flags and AMask = AMask; +end; + +function TcxSchedulerSubControlHitTest.GetMaskStateEx( + AMask: Integer): Boolean; +begin + Result := Flags and AMask <> 0; +end; + +procedure TcxSchedulerSubControlHitTest.SetBitState( + AIndex: Integer; AValue: Boolean); +begin + if AValue then + Flags := Flags or (1 shl AIndex) + else + Flags := Flags and not (1 shl AIndex); +end; + +procedure TcxSchedulerSubControlHitTest.SetMaskState( + AMask: Integer; AValue: Boolean); +begin + if AValue then + Flags := Flags or AMask + else + Flags := Flags and not AMask; +end; + +function TcxSchedulerSubControlHitTest.GetPosValue( + AIndex: Integer): Integer; +begin + Result := cxPointGetItem(FHitPoint, AIndex); +end; + +function TcxSchedulerSubControlHitTest.GetScheduler: TcxCustomScheduler; +begin + Result := FOwner.FScheduler; +end; + +procedure TcxSchedulerSubControlHitTest.SetHitPoint( + const APoint: TPoint); +begin + FHitPoint := APoint; + Recalculate; +end; + +procedure TcxSchedulerSubControlHitTest.SetPosValue( + AIndex, AValue: Integer); +begin + FHitPoint := cxPointReplaceItem(FHitPoint, AIndex, AValue); + Recalculate; +end; + +{ TcxSchedulerSubControlPainter } + +constructor TcxSchedulerSubControlPainter.Create( + AOwner: TcxSchedulerSubControl); +begin + FOwner := AOwner; +end; + +procedure TcxSchedulerSubControlPainter.AfterPaint; +begin +end; + +procedure TcxSchedulerSubControlPainter.BeforePaint; +begin +end; + +procedure TcxSchedulerSubControlPainter.InitializePainter; +begin +end; + +procedure TcxSchedulerSubControlPainter.Paint; +begin +end; + +{$IFNDEF DEBUGPAINT} +function TcxSchedulerSubControlPainter.GetBitmap: TBitmap; +begin + Result := FOwner.Bitmap; +end; +{$ENDIF} + +function TcxSchedulerSubControlPainter.GetCanvas: TcxCanvas; +begin + Result := FOwner.FCanvas; +end; + +function TcxSchedulerSubControlPainter.GetViewInfo: TcxSchedulerSubControlViewInfo; +begin + Result := Owner.ViewInfo; +end; + +{ TcxSchedulerSubControlViewInfo } + +constructor TcxSchedulerSubControlViewInfo.Create( + AOwner: TcxSchedulerSubControl); +begin + FOwner := AOwner; +end; + +procedure TcxSchedulerSubControlViewInfo.Calculate; +begin + if not IsSchedulerCreated then Exit; + FBounds := GetBounds; + Clear; + DoCalculate; + AfterCalculate; +end; + +procedure TcxSchedulerSubControlViewInfo.AfterCalculate; +begin +end; + +procedure TcxSchedulerSubControlViewInfo.Clear; +begin +end; + +procedure TcxSchedulerSubControlViewInfo.DoCalculate; +begin +end; + +function TcxSchedulerSubControlViewInfo.GetBounds: TRect; +begin + Result := Owner.ClientRect; +end; + +function TcxSchedulerSubControlViewInfo.GetDateTimeHelperClass: TcxSchedulerDateTimeHelperClass; +begin + Result := Owner.DateTimeHelper; +end; + +function TcxSchedulerSubControlViewInfo.GetDefaultFont: TFont; +begin + Result := Owner.Scheduler.Font; +end; + +function TcxSchedulerSubControlViewInfo.GetIsSchedulerCreated: Boolean; +begin + Result := Owner.Scheduler.FSubControlsCreated; +end; + +function TcxSchedulerSubControlViewInfo.GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := Owner.Scheduler.LookAndFeelPainter; +end; + +function TcxSchedulerSubControlViewInfo.GetPainterHelperClass: TcxSchedulerPainterHelperClass; +begin + Result := Owner.PainterHelper; +end; + +function TcxSchedulerSubControlViewInfo.GetStyles: TcxSchedulerStyles; +begin + Result := Owner.Styles; +end; + +type + TContainer = class(TWinControl) + protected + procedure CreateParams(var Params: TCreateParams); override; + public + constructor Create(AOwner: TComponent); override; + end; + +{ TContainer } + +constructor TContainer.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := ControlStyle + [csAcceptsControls] + [csNoDesignVisible]; + Visible := False; + TabStop := False; +end; + +procedure TContainer.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + begin + Style := WS_CHILD or WS_CLIPCHILDREN or WS_CLIPSIBLINGS; + ExStyle := WS_EX_CONTROLPARENT; + WindowClass.Style := CS_DBLCLKS; + end; +end; + +{ TcxSchedulerBackground } + +function TcxSchedulerBackground.IsSpecialPaint: Boolean; +begin + Result := True; +end; + +{ TcxSchedulerControlBox } + +constructor TcxSchedulerControlBox.Create(AOwner: TcxCustomScheduler); +begin + inherited Create(AOwner); + FContainer := CreateWndContainerControl; +end; + +procedure TcxSchedulerControlBox.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerControlBox then + with TcxSchedulerControlBox(Source) do + begin + Self.Control := Control; + Self.Visible := Visible; + end + else inherited Assign(Source); +end; + +function TcxSchedulerControlBox.HasAsParent( + AValue: TControl): Boolean; +var + AParent: TWinControl; +begin + Result := False; + AParent := Scheduler; + while not Result and (AParent <> nil) do + begin + Result := AValue = AParent; + AParent := AParent.Parent; + end; +end; + +procedure TcxSchedulerControlBox.VisibleChanged; +begin + FContainer.Visible := Visible; + inherited VisibleChanged; +end; + +procedure TcxSchedulerControlBox.DoLayoutChanged; +begin + FViewParams := Styles.GetBackgroundParams; + inherited DoLayoutChanged; +end; + +procedure TcxSchedulerControlBox.GetProperties(AProperties: TStrings); +begin + if Scheduler.DateNavigator.Visible then Exit; + AProperties.Add('DNWidth'); +end; + +procedure TcxSchedulerControlBox.GetPropertyValue(const AName: string; + var AValue: Variant); +begin + if Scheduler.DateNavigator.Visible then Exit; + if AName = 'DNWidth' then + AValue := Width +end; + +procedure TcxSchedulerControlBox.SetPropertyValue(const AName: string; + const AValue: Variant); +begin + if Scheduler.DateNavigator.Visible then Exit; + if AName = 'DNWidth' then + begin + Scheduler.DateNavigator.Width := AValue; + Scheduler.DateNavigator.DoLayoutChanged; + Width := AValue; + end; +end; + +procedure TcxSchedulerControlBox.BoundsChanged; +begin + FContainer.BoundsRect := Bounds; + inherited BoundsChanged; + FContainer.Update; +end; + +function TcxSchedulerControlBox.CreateWndContainerControl: TWinControl; +begin + Result := TContainer.Create(Scheduler); + Result.Parent := Scheduler; +end; + +procedure TcxSchedulerControlBox.DoPaint; +begin + Canvas.FillRect(ClientRect, ViewParams); +end; + +procedure TcxSchedulerControlBox.RestorePosition; +begin + if (FControl = nil) or + (csDestroying in Control.ComponentState) then Exit; + Control.RemoveFreeNotification(Scheduler); + Control.Align := FControlAlign; + Control.Parent := FControlParent; + Control.BoundsRect := FControlRect; +end; + +procedure TcxSchedulerControlBox.SetControl( + AValue: TControl); +begin + if HasAsParent(AValue) then Exit; + if FControl <> AValue then + begin + RestorePosition; + FControl := AValue; + StorePosition; + FContainer.BoundsRect := Bounds; + FContainer.Visible := Visible and (Control <> nil); + Changed; + end + else + FContainer.Visible := False; +end; + +procedure TcxSchedulerControlBox.StorePosition; +begin + if Control = nil then Exit; + FControlAlign := Control.Align; + FControlParent := Control.Parent; + FControlRect := Control.BoundsRect; + Control.FreeNotification(Scheduler); + Control.Parent := FContainer; + Control.Align := alClient; +end; + +{ TcxSchedulerSplitterController } + +procedure TcxSchedulerSplitterController.DoCancelMode; +begin + EraseInvertRect; + Scheduler.FCaptureControl := nil; + Scheduler.FKeyboardListener := FSaveKeyboardListener; +end; + +procedure TcxSchedulerSplitterController.KeyDown(var Key: Word; + Shift: TShiftState); +begin + if Scheduler.OptionsCustomize.ControlsSizing and Scheduler.IsDragCanceled then + begin + DoCancelMode; + Mouse.Capture := 0; + end; +end; + +procedure TcxSchedulerSplitterController.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + if Scheduler.OptionsCustomize.ControlsSizing and (ssLeft in Shift) then + begin + FSaveKeyboardListener := Scheduler.KeyboardListener; + Scheduler.KeyboardListener := Splitter; + FHitPoint := GetOwnerMousePos(X, Y); + FStartBounds := Splitter.Bounds; + FSizingBoundsRect := GetSizingBoundsRect; + FScreenCanvasClipRect := GetDrawClipRect; + if not IsDynamicUpdate then + begin + Scheduler.Update; //force repaint before on-screen drawing + DrawInvertRect(FStartBounds); + end; + FPrevRect := FStartBounds; + end; +end; + +procedure TcxSchedulerSplitterController.MouseMove(Shift: TShiftState; + X, Y: Integer); +var + R: TRect; +begin + if not Scheduler.OptionsCustomize.ControlsSizing or + (Scheduler.CaptureController <> Self) or Scheduler.IsLocked then Exit; + R := GetSizingRect(GetOwnerMousePos(X, Y)); + if not cxRectIsEqual(R, FPrevRect) then + begin + if IsDynamicUpdate then + UpdateSizing(R) + else + DrawInvertRect(R); + FPrevRect := R; + end; +end; + +procedure TcxSchedulerSplitterController.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + if not Scheduler.OptionsCustomize.ControlsSizing then Exit; + Scheduler.KeyboardListener := FSaveKeyboardListener; + EraseInvertRect; + UpdateSizing(GetSizingRect(GetOwnerMousePos(X, Y))); +end; + +procedure TcxSchedulerSplitterController.DrawInvertRect(const R: TRect); +var + Temp: TRect; + AOffset: TPoint; + ACanvas: TcxCanvas; +begin + if not cxRectIsEmpty(FPrevInvertRect) and cxRectIntersect(Temp, R, FPrevInvertRect) then + begin + SubtractRect(FPrevInvertRect, FPrevInvertRect, Temp); + SubtractRect(Temp, R, Temp); + end + else + Temp := R; + AOffset := ScreenOffset; + ACanvas := TcxScreenCanvas.Create; + InvertRect(ACanvas, cxRectOffset(FPrevInvertRect, AOffset)); + InvertRect(ACanvas, cxRectOffset(Temp, AOffset)); + ACanvas.Free; + FPrevInvertRect := R; +end; + +procedure TcxSchedulerSplitterController.EraseInvertRect; +var + ACanvas: TcxCanvas; +begin + if cxRectIsEmpty(FPrevInvertRect) then Exit; + ACanvas := TcxScreenCanvas.Create; + InvertRect(ACanvas, cxRectOffset(FPrevInvertRect, ScreenOffset)); + FPrevInvertRect := cxNullRect; + ACanvas.Free; +end; + +function TcxSchedulerSplitterController.GetMonthSize: TSize; +begin + Result := Scheduler.DateNavigator.GetMonthSize; +end; + +function TcxSchedulerSplitterController.GetOwnerMousePos(X, Y: Integer): TPoint; +begin + Result := cxPoint(X + Owner.Bounds.Left, Y + Owner.Bounds.Top); +end; + +function TcxSchedulerSplitterController.GetSizingBoundsRect: TRect; +begin + Result := Scheduler.ClientBounds; + if Splitter.Kind = skHorizontal then + SetVertBounds(Result) + else + SetHorzBounds(Result); +end; + +function TcxSchedulerSplitterController.GetSizingIncrement: Integer; +begin + if not IsIntegralSizing then + Result := 1 + else + if Splitter.Kind = skVertical then + Result := GetMonthSize.cx + else + Result := GetMonthSize.cy; +end; + +function TcxSchedulerSplitterController.GetSizingRect(const P: TPoint): TRect; +begin + if Splitter.Kind = skHorizontal then + Result := GetVertSizingRect(P) + else + Result := GetHorzSizingRect(P); + with SizingBoundsRect do + begin + if Result.Left < Left then + Result := cxRectSetLeft(Result, Left); + if Result.Top < Top then + Result := cxRectSetTop(Result, Top); + if Result.Right > Right then + Result := cxRectSetRight(Result, Right); + if Result.Bottom > Bottom then + Result := cxRectSetBottom(Result, Bottom); + end; +end; + +procedure TcxSchedulerSplitterController.InvertRect(ACanvas: TcxCanvas; + R: TRect); +begin + if cxRectIsEmpty(R) then Exit; + if Splitter.Kind = skHorizontal then + begin + R.Left := Max(R.Left, ScreenCanvasClipRect.Left); + R.Right := Min(R.Right, ScreenCanvasClipRect.Right); + end + else + begin + R.Top := Max(R.Top, ScreenCanvasClipRect.Top); + R.Bottom := Min(R.Bottom, ScreenCanvasClipRect.Bottom); + end; + if not cxRectIsEmpty(R) then + ACanvas.InvertRect(R); +end; + +function TcxSchedulerSplitterController.IsIntegralSizing: Boolean; +begin + Result := Scheduler.OptionsCustomize.IntegralSizing; +end; + +function TcxSchedulerSplitterController.IsDynamicUpdate: Boolean; +begin + Result := Scheduler.IsDynamicUpdate; +end; + +procedure TcxSchedulerSplitterController.SetSizeDelta(ADelta: Integer); +begin + if Splitter.Kind = skHorizontal then + SetVertDelta(ADelta) + else + SetHorzDelta(ADelta); + Scheduler.Modified; +end; + +procedure TcxSchedulerSplitterController.UpdateSizing(const R: TRect); + + function GetDelta: Integer; + begin + if Splitter.Kind = skHorizontal then + Result := Splitter.Top - R.Top + else + Result := Splitter.Left - R.Left; + end; + +var + ADelta: Integer; +begin + ADelta := GetDelta; + if ADelta <> 0 then + begin + SetSizeDelta(ADelta); + if IsDynamicUpdate then + Scheduler.Update; + Scheduler.DateNavigator.SaveSize; + end; +end; + +function TcxSchedulerSplitterController.GetDrawClipRect: TRect; +var + AParent: TControl; + R: TRect; +begin + with Scheduler do + begin + Result := cxRectOffset(ClientBounds, ClientToScreen(cxNullPoint)); + AParent := Parent; + end; + while AParent <> nil do + begin + R := cxRectOffset(AParent.ClientRect, AParent.ClientOrigin); + if AParent.Parent <> nil then + cxRectOffset(R, AParent.ClientToScreen(cxNullPoint)); + cxRectIntersect(Result, Result, R); + AParent := AParent.Parent; + end; +end; + +function TcxSchedulerSplitterController.GetHorzSizingRect( + const P: TPoint): TRect; +var + AStep, ANewPos: Integer; +begin + AStep := GetSizingIncrement; + ANewPos := FStartBounds.Left - Round((FHitPoint.X - P.X) / AStep) * AStep; + Result := cxRectSetLeft(FStartBounds, ANewPos); +end; + +function TcxSchedulerSplitterController.GetScheduler: TcxCustomScheduler; +begin + Result := Owner.Scheduler; +end; + +function TcxSchedulerSplitterController.GetScreenOffset: TPoint; +begin + Result := Scheduler.ClientToScreen(cxNullPoint); +end; + +function TcxSchedulerSplitterController.GetSplitter: TcxSchedulerSplitter; +begin + Result := TcxSchedulerSplitter(inherited Owner); +end; + +function TcxSchedulerSplitterController.GetVertSizingRect( + const P: TPoint): TRect; +var + AStep, ANewPos: Integer; +begin + AStep := GetSizingIncrement; + ANewPos := FStartBounds.Top - Round((FHitPoint.Y - P.Y) / AStep) * AStep; + Result := cxRectSetTop(FStartBounds, ANewPos); +end; + +procedure TcxSchedulerSplitterController.SetHorzBounds(var R: TRect); +var + W: Integer; +begin + W := ((R.Right - R.Left - Splitter.Width) div GetMonthSize.cx) * + GetMonthSize.cx + Splitter.Width; + if Scheduler.IsViewAtLeft then + begin + if IsIntegralSizing then + R.Left := R.Right - W; + Dec(R.Right, GetMonthSize.cx); + end + else + begin + if IsIntegralSizing then + R.Right := R.Left + W; + Inc(R.Left, GetMonthSize.cx); + end; +end; + +procedure TcxSchedulerSplitterController.SetHorzDelta(ADelta: Integer); +begin + with Scheduler do + begin + case OptionsView.ViewPosition of + vpLeft: + DateNavigator.Width := DateNavigator.Width + ADelta; + else + DateNavigator.Width := DateNavigator.Width - ADelta; + end; + end; +end; + +procedure TcxSchedulerSplitterController.SetVertBounds(var R: TRect); +begin + if IsIntegralSizing then + R.Bottom := R.Top + ((R.Bottom - R.Top - Splitter.Height) div GetMonthSize.cy) * + GetMonthSize.cy + Splitter.Height; + Inc(R.Top, GetMonthSize.cy); +end; + +procedure TcxSchedulerSplitterController.SetVertDelta(ADelta: Integer); +begin + with Scheduler do + begin + case OptionsView.ViewPosition of + vpLeft, vpRight, vpBottom: + DateNavigator.Height := DateNavigator.Height - ADelta; + vpTop: + DateNavigator.Height := DateNavigator.Height + ADelta; + end; + end; +end; + +{ TcxSchedulerSplitterHitTest } + +function TcxSchedulerSplitterHitTest.GetSplitter: TcxSchedulerSplitter; +begin + Result := TcxSchedulerSplitter(Owner); +end; + +{ TcxSchedulerSplitter } + +function TcxSchedulerSplitter.AllowDesignHitTest( + X, Y: Integer; AShift: TShiftState): Boolean; +begin + Result := True; +end; + +function TcxSchedulerSplitter.CreateController: TcxSchedulerSubControlController; +begin + Result := TcxSchedulerSplitterController.Create(Self); +end; + +function TcxSchedulerSplitter.CreateHitTest: TcxSchedulerSubControlHitTest; +begin + Result := TcxSchedulerSplitterHitTest.Create(Self); +end; + +procedure TcxSchedulerSplitter.DoLayoutChanged; +begin + FViewParams := Styles.GetSplitterParams(Kind); + inherited DoLayoutChanged; +end; + +procedure TcxSchedulerSplitter.DoPaint; +begin + LookAndFeelPainter.DrawSchedulerSplitterBorder(Canvas, ClientRect, + ViewParams, Kind = skHorizontal); +end; + +function TcxSchedulerSplitter.GetHitTest: TcxSchedulerSplitterHitTest; +begin + Result := TcxSchedulerSplitterHitTest(inherited HitTest); +end; + +procedure TcxSchedulerSplitter.UpdateCursor; +const + Cursors: array[TcxSchedulerSplitterKind] of TCursor = ( + crSchedulerVertSplit, crSchedulerHorzSplit); +begin + if Scheduler.OptionsCustomize.ControlsSizing then + Cursor := Cursors[Kind] + else + Cursor := crDefault; +end; + +procedure TcxSchedulerSplitter.SetKind(AKind: TcxSchedulerSplitterKind); +begin + FKind := AKind; + UpdateCursor; +end; + +{ TcxSchedulerNavigatorButton } + +constructor TcxSchedulerNavigatorButton.Create(Collection: TCollection); +begin + inherited Create(Collection); + FEnabled := True; + FCommand := -1; + FImageIndex := -1; + FVisible := True +end; + +procedure TcxSchedulerNavigatorButton.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerNavigatorButton then + with TcxSchedulerNavigatorButton(Source) do + begin + Self.Enabled := FEnabled; + Self.Hint := FHint; + Self.FCommand := FCommand; + Self.FImageIndex := FImageIndex; + Self.FVisible := FVisible; + end + else + inherited Assign(Source); +end; + +procedure TcxSchedulerNavigatorButton.Changed; +begin + if (Scheduler <> nil) and (Scheduler.ResourceNavigator <> nil) and + Scheduler.ResourceNavigator.NeedScrollBar then Scheduler.LayoutChanged; +end; + +procedure TcxSchedulerNavigatorButton.Click; +begin + Scheduler.ResourceNavigator.Click(Self); +end; + +function TcxSchedulerNavigatorButton.GetDisplayName: string; +begin + Result := GetHintText; + if Result = '' then + Result := ClassName; +end; + +function TcxSchedulerNavigatorButton.GetHintText: string; +const + InternalHint: array[0..7] of Pointer = + (@scxFirstButtonHint, @scxPrevPageButtonHint, @scxPrevButtonHint, + @scxNextButtonHint, @scxNextPageButtonHint, @scxLastButtonHint, + @scxShowMoreResourcesButtonHint, @scxShowFewerResourcesButtonHint); +begin + Result := Hint; + if (Result = '') and IsStandard then + Result := cxGetResourceString(InternalHint[Command]); +end; + +procedure TcxSchedulerNavigatorButton.Draw( + APainter: TcxCustomLookAndFeelPainterClass; ACanvas: TcxCanvas); +var + AGlyphRect: TRect; + AImages: TCustomImageList; + AImageIndex: Integer; +begin + APainter.DrawSchedulerNavigatorButton(ACanvas, Bounds, State); + AImages := GetActualImageList; + AImageIndex := GetActualImageIndex; + if (AImages <> nil) and (AImageIndex >=0) then + begin + AGlyphRect := cxRectCenter(Bounds, cxSize(AImages.Width, AImages.Height)); + if State = cxbsPressed then OffsetRect(AGlyphRect, 1, 1); + ACanvas.SaveState; + try + APainter.DrawNavigatorGlyph(ACanvas, AImages, AImageIndex, Command, + AGlyphRect, Enabled, not IsStandard or (ImageIndex >= 0)); + finally + ACanvas.RestoreState; + end; + end; +end; + +function TcxSchedulerNavigatorButton.GetState( + ACanDisabled: Boolean = True): TcxButtonState; +var + ANavigator: TcxSChedulerResourceNavigator; +begin + if not Enabled and ACanDisabled then + Result := cxbsDisabled + else + begin + ANavigator := Scheduler.ResourceNavigator; + if PtInRect(FBounds, ANavigator.ScreenToClient(GetMouseCursorPos)) and Application.Active then + begin + if ANavigator.FPressedButton = Self then + Result := cxbsPressed + else + Result := cxbsHot + end + else + Result := cxbsNormal; + end; +end; + +function TcxSchedulerNavigatorButton.GetActualImageIndex: Integer; +const + AImageIndexMap: array[0..7] of Integer = (NBDI_FIRST, NBDI_PRIORPAGE, + NBDI_PRIOR, NBDI_NEXT, NBDI_NEXTPAGE, NBDI_LAST, NBDI_INSERT, NBDI_DELETE); +begin + if IsStandard and (ImageIndex < 0) then + begin + Result := AImageIndexMap[Command]; + if FRotated and (Result < 6) then + Inc(Result, NavigatorButtonCount); + end + else + Result := ImageIndex; +end; + +function TcxSchedulerNavigatorButton.GetActualImageList: TCustomImageList; +begin + if IsStandard and (ImageIndex < 0) then + Result := NavigatorImages + else + Result := Scheduler.ResourceNavigator.ButtonImages; +end; + +function TcxSchedulerNavigatorButton.GetIsStandard: Boolean; +begin + Result := (Command >= cxSchedulerFirstButton) and + (Command <= cxSchedulerShowFewerResourcesButton); +end; + +function TcxSchedulerNavigatorButton.GetScheduler: TcxCustomScheduler; +begin + if GetOwner <> nil then + Result := TcxSchedulerNavigatorCustomButtons(GetOwner).Scheduler + else + Result := nil; +end; + +procedure TcxSchedulerNavigatorButton.SetEnabled(AValue: Boolean); +begin + if AValue <> FEnabled then + begin + FEnabled := AValue; + Scheduler.ResourceNavigator.InvalidateButton(Self); + end; +end; + +procedure TcxSchedulerNavigatorButton.SetImageIndex(AValue: Integer); +begin + AValue := Max(-1, AValue); + if AValue <> FImageIndex then + begin + FImageIndex := AValue; + Changed; + end; +end; + +procedure TcxSchedulerNavigatorButton.SetVisible(AValue: Boolean); +begin + if AValue <> FVisible then + begin + FVisible := AValue; + Changed; + end; +end; + +function TcxSchedulerNavigatorButton.IsHintStored: Boolean; +begin + Result := FHint <> ''; +end; + +function TcxSchedulerNavigatorButton.IsEnabledStored: Boolean; +begin + Result := not IsStandard and not Enabled; +end; + +function TcxSchedulerNavigatorButton.IsVisibleStored: Boolean; +begin + if not IsStandard then + Result := not Visible + else + Result := Visible <> cxSchedulerNavigatorVisibility[Command]; +end; + +{ TcxSchedulerNavigatorCustomButtons } + +constructor TcxSchedulerNavigatorCustomButtons.CreateEx( + AOwner: TPersistent; AItemClass: TCollectionItemClass); +begin + FOwner := AOwner; + inherited Create(AItemClass); +end; + +function TcxSchedulerNavigatorCustomButtons.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +procedure TcxSchedulerNavigatorCustomButtons.Update( + Item: TCollectionItem); +begin + if (Scheduler <> nil) and not Scheduler.IsLocked then + Scheduler.LayoutChanged; +end; + +function TcxSchedulerNavigatorCustomButtons.GetItem( + AIndex: Integer): TcxSchedulerNavigatorCustomButton; +begin + Result := TcxSchedulerNavigatorCustomButton(inherited Items[AIndex]); +end; + +function TcxSchedulerNavigatorCustomButtons.GetVisibleCount: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + if Items[I].Visible then Inc(Result); +end; + +procedure TcxSchedulerNavigatorCustomButtons.SetItem( + AIndex: Integer; AValue: TcxSchedulerNavigatorCustomButton); +begin + Items[AIndex].Assign(AValue); +end; + +{ TcxSchedulerNavigatorButtons } + +constructor TcxSchedulerNavigatorButtons.Create( + AOwner: TcxSchedulerResourceNavigator); +begin + FOwner := AOwner; + FButtons := TcxSchedulerNavigatorCustomButtons.CreateEx(AOwner, + TcxSchedulerNavigatorButton); + FButtons.FScheduler := FOwner.Scheduler; + CreateButtons; +end; + +destructor TcxSchedulerNavigatorButtons.Destroy; +begin + FButtons.Free; + inherited Destroy; +end; + +procedure TcxSchedulerNavigatorButtons.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerNavigatorButtons then + FButtons.Assign(TcxSchedulerNavigatorButtons(Source).Buttons) + else + inherited Assign(Source); +end; + +function TcxSchedulerNavigatorButtons.AddButton( + ACommand: Integer; AVisible: Boolean = True): TcxSchedulerNavigatorButton; +begin + Result := TcxSchedulerNavigatorButton(Buttons.Add); + Result.FCommand := ACommand; + Result.Visible := cxSchedulerNavigatorVisibility[ACommand]; +end; + +procedure TcxSchedulerNavigatorButtons.CreateButtons; +begin + AddButton(cxSchedulerFirstButton, True); + AddButton(cxSchedulerPrevPageButton); + AddButton(cxSchedulerPrevButton); + AddButton(cxSchedulerNextButton); + AddButton(cxSchedulerNextPageButton); + AddButton(cxSchedulerLastButton, True); + AddButton(cxSchedulerShowMoreResourcesButton); + AddButton(cxSchedulerShowFewerResourcesButton); +end; + +function TcxSchedulerNavigatorButtons.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +function TcxSchedulerNavigatorButtons.GetButtonByIndex( + AIndex: Integer): TcxSchedulerNavigatorButton; +var + I: Integer; +begin + Result := nil; + for I := 0 to Buttons.Count - 1 do + begin + Result := Buttons[I]; + if Result.Command = AIndex then Break; + end; +end; + +procedure TcxSchedulerNavigatorButtons.SetButtonByIndex( + AIndex: Integer; AValue: TcxSchedulerNavigatorButton); +begin + GetButtonByIndex(AIndex).Assign(AValue); +end; + +{ TcxSchedulerResourceNavigatorController } + +procedure TcxSchedulerResourceNavigatorController.BeforeMouseDown( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + HintController.HideHint; + inherited BeforeMouseDown(Button, Shift, X, Y); +end; + +procedure TcxSchedulerResourceNavigatorController.CheckButtonDown( + Button: TMouseButton; Shift: TShiftState); +var + APressed: Boolean; +begin + HintController.ViewMode := False; + APressed := (Button = mbLeft) or (ssLeft in Shift); + if not APressed then + ResourceNavigator.FPressedButton := nil; + if APressed and (ResourceNavigator.FPressedButton = nil) then + ResourceNavigator.FPressedButton := GetHotTrackButton; + ResourceNavigator.Invalidate; +end; + +function TcxSchedulerResourceNavigatorController.GetHotTrackButton( + ACanDisabled: Boolean = True): TcxSchedulerNavigatorButton; +var + I: Integer; +begin + Result := nil; + for I := 0 to ResourceNavigator.ItemCount - 1 do + if ResourceNavigator.Items[I].GetState(ACanDisabled) = cxbsHot then + begin + Result := ResourceNavigator.Items[I]; + Break; + end; +end; + +procedure TcxSchedulerResourceNavigatorController.MouseDown( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + CheckButtonDown(Button, Shift); + inherited MouseDown(Button, Shift, X, Y); +end; + +procedure TcxSchedulerResourceNavigatorController.MouseMove( + AShift: TShiftState; X, Y: Integer); +begin + HotTrackButton := GetHotTrackButton(False); + if ssLeft in AShift then + CheckButtonDown(mbLeft, AShift) + else + CheckButtonDown(mbRight, AShift); +end; + +procedure TcxSchedulerResourceNavigatorController.MouseUp( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + with ResourceNavigator do + begin + if (FPressedButton <> nil) and (FPressedButton.GetState = cxbsPressed) then + FPressedButton.Click; + end; + CheckButtonDown(mbRight, Shift); + inherited MouseUp(Button, Shift, X, Y); +end; + +procedure TcxSchedulerResourceNavigatorController.MouseEnter; +begin + HotTrackButton := nil; + ResourceNavigator.Invalidate; +end; + +procedure TcxSchedulerResourceNavigatorController.MouseLeave; +begin + HotTrackButton := nil; + ResourceNavigator.Invalidate; +end; + +function TcxSchedulerResourceNavigatorController.GetHintController: TcxSchedulerHintController; +begin + Result := Owner.Scheduler.HintController; +end; + +function TcxSchedulerResourceNavigatorController.GetResourceNavigator: TcxSchedulerResourceNavigator; +begin + Result := TcxSchedulerResourceNavigator(Owner); +end; + +procedure TcxSchedulerResourceNavigatorController.SetHotTrackButton( + Value: TcxSchedulerNavigatorButton); +var + AHintText: string; + AImmediate: Boolean; +begin + if Value <> FHotTrackButton then + begin + AImmediate := (FHotTrackButton <> nil) and HintController.Showing; + FHotTrackButton := Value; + if HotTrackButton <> nil then + begin + AHintText := HotTrackButton.GetHintText; + if AHintText <> '' then + begin + HintController.Activate(HintController.CalcHintRect( + cxscMaxHintWidth, AHintText, cxAlignBottom), AHintText, AImmediate); + end; + end + else + begin + HintController.Hide; + HintController.ViewMode := True; + end; + end; +end; + +{ TcxSchedulerResourceNavigatorHitTest } + +function TcxSchedulerResourceNavigatorHitTest.GetCurrentButton(AButtons: TcxSchedulerNavigatorCustomButtons): TcxSchedulerNavigatorButton; +var + I: Integer; +begin + Result := nil; + for I := 0 to AButtons.Count - 1 do + if cxRectPtIn(AButtons[I].Bounds, HitPoint) then + begin + Result := AButtons[I]; + Exit; + end; +end; + +function TcxSchedulerResourceNavigatorHitTest.GetHitAtButton: Boolean; +begin + Result := GetHitButton <> nil; +end; + +function TcxSchedulerResourceNavigatorHitTest.GetHitButton: TcxSchedulerNavigatorButton; +begin + with TcxSchedulerResourceNavigator(Owner) do + begin + Result := GetCurrentButton(Buttons.Buttons); + if not Assigned(Result) then + Result := GetCurrentButton(CustomButtons); + end; +end; + +function TcxSchedulerResourceNavigatorHitTest.GetResourceNavigator: TcxSchedulerResourceNavigator; +begin + Result := TcxSchedulerResourceNavigator(Owner); +end; + +{ TcxSchedulerResourceNavigator } + +constructor TcxSchedulerResourceNavigator.Create(AOwner: TcxCustomScheduler); +begin + inherited Create(AOwner); + FTimer := TTimer.Create(Scheduler); + FButtons := CreateStandardButtons; + FCustomButtons := CreateButtons; + FCustomButtons.FScheduler := Scheduler; + FShowButtons := True; + FVisibility := snvAuto; +end; + +destructor TcxSchedulerResourceNavigator.Destroy; +begin + FTimer.Free; + FButtons.Free; + FCustomButtons.Free; + inherited Destroy; +end; + +procedure TcxSchedulerResourceNavigator.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerResourceNavigator then + with TcxSchedulerResourceNavigator(Source) do + begin + Self.FShowButtons := FShowButtons; + Self.FVisibility := FVisibility; + Self.FButtonImages := FButtonImages; + Self.Buttons := Buttons; + end; + inherited Assign(Source); +end; + +function TcxSchedulerResourceNavigator.NeedScrollBar: Boolean; +begin + Result := Visibility <> snvNever; + if (Scheduler.CurrentView = nil) or (Scheduler.CurrentView.GetGroupingKind = gkNone) then + Result := False; + if not Result or (Visibility = snvAlways) then Exit; + Result := (ResourceCount > 0) and (ResourcesPerPage > 0); +end; + +procedure TcxSchedulerResourceNavigator.BoundsChanged; +begin +end; + +procedure TcxSchedulerResourceNavigator.ButtonClickHandler( + AButton: TcxSchedulerNavigatorButton); +var + APrevIndex: Integer; +begin + APrevIndex := FirstVisibleResourceIndex; + case AButton.Command of + cxSchedulerFirstButton: + FirstVisibleResourceIndex := 0; + cxSchedulerPrevPageButton: + FirstVisibleResourceIndex := FirstVisibleResourceIndex - ResourcesPerPage; + cxSchedulerPrevButton: + FirstVisibleResourceIndex := FirstVisibleResourceIndex - 1; + cxSchedulerNextButton: + FirstVisibleResourceIndex := FirstVisibleResourceIndex + 1; + cxSchedulerNextPageButton: + FirstVisibleResourceIndex := FirstVisibleResourceIndex + ResourcesPerPage; + cxSchedulerLastButton: + FirstVisibleResourceIndex := ResourceCount; + cxSchedulerShowMoreResourcesButton: + ResourcesPerPage := ResourcesPerPage + 1; + cxSchedulerShowFewerResourcesButton: + ResourcesPerPage := ResourcesPerPage - 1; + end; + if APrevIndex <> FirstVisibleResourceIndex then + Scheduler.FirstVisibleResourceChanged; +end; + +procedure TcxSchedulerResourceNavigator.CalculateBounds; +var + R: TRect; +begin + if Scheduler.CurrentView = nil then Exit; + R := Scheduler.CurrentView.Bounds; + if ScrollBarKind = sbHorizontal then + begin + R.Top := R.Bottom - Scheduler.HScrollBar.Height; + R.Right := R.Left + MeasureWidth; + end + else + begin + R.Top := R.Bottom - MeasureHeight; + R.Left := R.Right - Scheduler.VScrollBar.Width; + if Scheduler.SizeGrip.Visible then + OffsetRect(R, 0, -Scheduler.SizeGrip.Height); + end; + Bounds := R; +end; + +procedure TcxSchedulerResourceNavigator.CheckButtonsState; +var + I: Integer; + AButton: TcxSchedulerNavigatorButton; +begin + for I := 0 to Buttons.Buttons.Count - 1 do + begin + AButton := Buttons.Buttons[I]; + case AButton.Command of + cxSchedulerFirstButton, cxSchedulerPrevPageButton, cxSchedulerPrevButton: + AButton.Enabled := (ResourcesPerPage > 0) and (FirstVisibleResourceIndex > 0); + cxSchedulerNextButton, cxSchedulerNextPageButton, cxSchedulerLastButton: + AButton.Enabled := (ResourcesPerPage > 0) and + (FirstVisibleResourceIndex + ResourcesPerPage < ResourceCount); + cxSchedulerShowMoreResourcesButton: + AButton.Enabled := (ResourcesPerPage > 0) and + (ResourcesPerPage < ResourceCount) and (ResourceCount > 1); + cxSchedulerShowFewerResourcesButton: + AButton.Enabled := (ResourcesPerPage > 1) and (ResourceCount > 1); + end; + end; +end; + +procedure TcxSchedulerResourceNavigator.Click( + Sender: TcxSchedulerNavigatorButton); +begin + if not DoOnClick(Sender) and Sender.IsStandard then + ButtonClickHandler(Sender); +end; + +function TcxSchedulerResourceNavigator.CreateController: TcxSchedulerSubControlController; +begin + Result := TcxSchedulerResourceNavigatorController.Create(Self); +end; + +function TcxSchedulerResourceNavigator.CreateHitTest: TcxSchedulerSubControlHitTest; +begin + Result := TcxSchedulerResourceNavigatorHitTest.Create(Self); +end; + +function TcxSchedulerResourceNavigator.CreateButtons: TcxSchedulerNavigatorCustomButtons; +begin + Result := TcxSchedulerNavigatorCustomButtons.CreateEx(Self, GetCustomButtonClass); +end; + +function TcxSchedulerResourceNavigator.CreateStandardButtons: TcxSchedulerNavigatorButtons; +begin + Result := TcxSchedulerNavigatorButtons.Create(Self); +end; + +function TcxSchedulerResourceNavigator.DoCustomDrawButton( + AButton: TcxSchedulerNavigatorButton): Boolean; +begin + Result := False; + if Assigned(FOnCustomDrawButton) then + OnCustomDrawButton(Self, Canvas, AButton, Result); +end; + +function TcxSchedulerResourceNavigator.DoOnClick( + Sender: TcxSchedulerNavigatorButton): Boolean; +begin + Result := False; + if Assigned(FOnButtonClick) then + FOnButtonClick(Self, Sender, Result); +end; + +procedure TcxSchedulerResourceNavigator.DoPaint; +var + R: TRect; + ASize: TSize; + I, AIndex: Integer; + AButton: TcxSchedulerNavigatorButton; +begin + FVisibleButtonCount := GetVisibleButtonCount; + if VisibleButtonCount = 0 then Exit; + CheckButtonsState; + Canvas.Brush.Color := LookAndFeelPainter.DefaultSchedulerNavigatorColor; + Canvas.FillRect(ClientRect); + + ASize := ButtonSize; + AIndex := 0; + R := Rect(0, 0, ASize.cx, ASize.cy); + if ScrollBarKind <> sbHorizontal then + OffsetRect(R, (VisibleButtonCount - 1) * ASize.cx, 0); + for I := 0 to ItemCount - 1 do + begin + AButton := Items[I]; + if AButton.Visible then + begin + AButton.FVisibleIndex := AIndex; + AButton.FBounds := LookAndFeelPainter.AdjustGroupButtonDisplayRect( + R, AIndex, VisibleButtonCount); + AButton.FRotated := ScrollBarKind <> sbHorizontal; + if AButton.FRotated then + AButton.FBounds := Rect(0, ASize.cx * AIndex, ASize.cy, ASize.cx * (AIndex + 1)) + else + AButton.FBounds := Rect(ASize.cx * AIndex, 0, ASize.cx * (AIndex + 1), ASize.cy); + OffsetRect(R, (Byte(ScrollBarKind = sbHorizontal) * 2 - 1) * ASize.cx, 0); + AButton.FState := AButton.GetState; + + if not DoCustomDrawButton(AButton) then + AButton.Draw(LookAndFeelPainter, Canvas); + + Inc(AIndex); + end + else + begin + AButton.FBounds := cxNullRect; + AButton.FVisibleIndex := -1; + end; + end; +end; + +procedure TcxSchedulerResourceNavigator.FirstVisibleResourceChanged; +begin + CheckButtonsState; +end; + +function TcxSchedulerResourceNavigator.GetCustomButtonClass: TcxSchedulerNavigatorButtonClass; +begin + Result := TcxSchedulerNavigatorCustomButton; +end; + +function TcxSchedulerResourceNavigator.GetScrollerHint: string; +var + AIndex1, AIndex2: Integer; + AResources: TcxSchedulerStorageResourceItems; +begin + AIndex1 := Max(0, FirstVisibleResourceIndex); + AIndex2 := Min(FirstVisibleResourceIndex + ResourcesPerPage - 1, ResourceCount - 1); + AResources := Scheduler.Storage.Resources.ResourceItems; + Result := AResources.VisibleResources[AIndex1].Name; + if AIndex2 > AIndex1 then + Result := Result + ' - ' + AResources.VisibleResources[AIndex2].Name; +end; + +procedure TcxSchedulerResourceNavigator.InitScrollBarsParameters; +begin + inherited Visible := NeedScrollBar; + if not NeedScrollBar then + SetScrollBarInfo(ScrollBarKind, 0, 1, 1, 0, 1, False, True) + else + begin + if (ResourcesPerPage = 0) or (ResourceCount = 0) then + SetScrollBarInfo(ScrollBarKind, 0, 0, 1, 1, 0, True, Visibility = snvAuto) + else + SetScrollBarInfo(ScrollBarKind, 0, ResourceCount - 1, 1, + ResourcesPerPage, FirstVisibleResourceIndex, True, False); + CalculateBounds; + end; +end; + +procedure TcxSchedulerResourceNavigator.InvalidateButton( + AButton: TcxSchedulerNavigatorButton); +begin + if AButton.Visible and (AButton.GetState <> AButton.State) then + InvalidateRect(AButton.Bounds); +end; + +procedure TcxSchedulerResourceNavigator.Scroll( + AScrollCode: TScrollCode; var AScrollPos: Integer); +var + AFirstResourceChanged: Boolean; +begin + Scheduler.CurrentView.HideHintOnScroll(AScrollCode); + if AScrollCode = scEndScroll then Exit; + if not (AScrollCode in [scPosition, scTrack]) then + AScrollPos := FirstVisibleResourceIndex; + case AScrollCode of + scLineUp: + Dec(AScrollPos, 1); + scLineDown: + Inc(AScrollPos, 1); + scPageUp: + Dec(AScrollPos, ResourcesPerPage); + scPageDown: + Inc(AScrollPos, ResourcesPerPage); + scTop: + AScrollPos := 0; + scBottom: + AScrollPos := ResourceCount; + end; + if (AScrollPos + ResourcesPerPage) > (ResourceCount - 1) then + AScrollPos := ResourceCount - ResourcesPerPage; + if AScrollPos < 0 then + AScrollPos := 0; + if (AScrollPos <> FirstVisibleResourceIndex) or (AScrollCode = scTrack) then + begin + AFirstResourceChanged := AScrollPos <> FirstVisibleResourceIndex; + Scheduler.FFirstVisibleResourceIndex := AScrollPos; + if AScrollCode = scTrack then + Scheduler.CurrentView.ShowHintOnScroll(GetScrollerHint, ScrollBarKind); + if ScrollBarKind = sbHorizontal then + Scheduler.HScrollBar.Position := AScrollPos + else + Scheduler.VScrollBar.Position := AScrollPos; + Scheduler.CurrentView.Refresh; + if AFirstResourceChanged then + Scheduler.FirstVisibleResourceChanged; + end; +end; + +function TcxSchedulerResourceNavigator.ActualCountPerPage: Integer; +begin + if ResourcesPerPage = 0 then + Result := Max(0, ResourceCount) + else + Result := Min(ResourcesPerPage, ResourceCount - 1); +end; + +function TcxSchedulerResourceNavigator.ActualFirstResourceIndex: Integer; +begin + Result := Max(0, FirstVisibleResourceIndex); + Result := Min(Result - 1, ResourceCount); +end; + +function TcxSchedulerResourceNavigator.ButtonSize: TSize; +begin + if ScrollBarKind = sbHorizontal then + begin + Result.cx := (Scheduler.HScrollBar.Height + cxTextOffset); + Result.cy := Scheduler.HScrollBar.Height {+ Scheduler.BorderSize}; + end + else + begin + Result.cx := (Scheduler.VScrollBar.Width + cxTextOffset); + Result.cy := Scheduler.VScrollBar.Width {+ Scheduler.BorderSize}; + end; +end; + +function TcxSchedulerResourceNavigator.MeasureHeight: Integer; +begin + Result := GetVisibleButtonCount * ButtonSize.cx; +end; + +function TcxSchedulerResourceNavigator.MeasureWidth: Integer; +begin + Result := GetVisibleButtonCount * ButtonSize.cx; +end; + +function TcxSchedulerResourceNavigator.GetVisibleButtonCount: Integer; +begin + if ShowButtons then + Result := Buttons.Buttons.VisibleCount + CustomButtons.VisibleCount + else + Result := 0; +end; + +function TcxSchedulerResourceNavigator.GetItemCount: Integer; +begin + Result := Buttons.Buttons.Count + CustomButtons.Count; +end; + +function TcxSchedulerResourceNavigator.GetFirstVisibleResourceIndex: Integer; +begin + Result := Scheduler.FirstVisibleResourceIndex; +end; + +function TcxSchedulerResourceNavigator.GetHitTest: TcxSchedulerResourceNavigatorHitTest; +begin + Result := TcxSchedulerResourceNavigatorHitTest(inherited HitTest); +end; + +function TcxSchedulerResourceNavigator.GetItem(AIndex: Integer): TcxSchedulerNavigatorButton; +begin + if AIndex < Buttons.Buttons.Count then + Result := Buttons.Buttons[AIndex] + else + Result := CustomButtons[AIndex - Buttons.Buttons.Count]; +end; + +function TcxSchedulerResourceNavigator.GetResourceCount: Integer; +begin + with Scheduler do + begin + if (CurrentView <> nil) and (CurrentView.Resources <> nil) then + Result := CurrentView.Resources.VisibleResourceCount + else + Result := 0; + end; +end; + +function TcxSchedulerResourceNavigator.GetResourcesPerPage: Integer; +begin + Result := Scheduler.OptionsView.ResourcesPerPage; +end; + +procedure TcxSchedulerResourceNavigator.SetCustomButtons( + Value: TcxSchedulerNavigatorCustomButtons); +begin + FCustomButtons.Assign(Value); +end; + +procedure TcxSchedulerResourceNavigator.SetButtonImages(Value: TCustomImageList); +begin + FButtonImages := Value; + Scheduler.LayoutChanged; +end; + +procedure TcxSchedulerResourceNavigator.SetButtons( + Value: TcxSchedulerNavigatorButtons); +begin + FButtons.Assign(Value); +end; + +procedure TcxSchedulerResourceNavigator.SetResourcesPerPage(AValue: Integer); +begin + Scheduler.OptionsView.ResourcesPerPage := AValue; +end; + +procedure TcxSchedulerResourceNavigator.SetShowButtons(AValue: Boolean); +begin + if AValue <> FShowButtons then + begin + FShowButtons := AValue; + Scheduler.LayoutChanged; + end; +end; + +procedure TcxSchedulerResourceNavigator.SetFirstVisibleResourceIndex(AValue: Integer); +begin + Scheduler.FirstVisibleResourceIndex := AValue; +end; + +procedure TcxSchedulerResourceNavigator.SetVisibility( + AValue: TcxSchedulerNavigatorVisibilityMode); +begin + if AValue <> FVisibility then + begin + FVisibility := AValue; + Changed; + end; +end; + +function TcxSchedulerResourceNavigator.IsCustomButtonsStored: Boolean; +begin + Result := CustomButtons.Count > 0; +end; + +{ TcxSchedulerEventOperations } + +constructor TcxSchedulerEventOperations.Create( + AOwner: TcxCustomScheduler); +begin + FScheduler := AOwner; + FCreating := True; + FDeleting := True; + FDialogEditing := True; + FDialogShowing := True; + FInplaceEditing := True; + FIntersection := True; + FMoving := True; + FMovingBetweenResources := True; + FReadOnly := False; + FRecurrence := True; + FSizing := True; +end; + +procedure TcxSchedulerEventOperations.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerEventOperations then + with TcxSchedulerEventOperations(Source) do + begin + Self.FCreating := FCreating; + Self.FDeleting := FDeleting; + Self.FDialogEditing := FDialogEditing; + Self.FDialogShowing := FDialogShowing; + Self.FInplaceEditing := FInplaceEditing; + Self.FMoving := FMoving; + Self.FMovingBetweenResources := FMovingBetweenResources; + Self.FReadOnly := FReadOnly; + Self.FRecurrence := FRecurrence; + Self.FSharingBetweenResources := FSharingBetweenResources; + Self.FSizing := FSizing; + Self.FIntersection := FIntersection; + end + else + inherited Assign(Source); +end; + +function TcxSchedulerEventOperations.GetOwner: TPersistent; +begin + Result := FScheduler; +end; + +function TcxSchedulerEventOperations.GetCreating: Boolean; +begin + Result := not FReadOnly and FCreating; +end; + +function TcxSchedulerEventOperations.GetCreatingStored: Boolean; +begin + Result := not (FReadOnly or FCreating); +end; + +function TcxSchedulerEventOperations.GetDeleting: Boolean; +begin + Result := not FReadOnly and FDeleting; +end; + +function TcxSchedulerEventOperations.GetDeletingStored: Boolean; +begin + Result := not (FReadOnly or FDeleting); +end; + +function TcxSchedulerEventOperations.GetDialogEditing: Boolean; +begin + Result := not FReadOnly and FDialogEditing; +end; + +function TcxSchedulerEventOperations.GetDialogEditingStored: Boolean; +begin + Result := not (FReadOnly or FDialogEditing); +end; + +function TcxSchedulerEventOperations.GetInplaceEditing: Boolean; +begin + Result := not FReadOnly and FInplaceEditing; +end; + +function TcxSchedulerEventOperations.GetInplaceEditingStored: Boolean; +begin + Result := not (FReadOnly or FInplaceEditing); +end; + +function TcxSchedulerEventOperations.GetMoving: Boolean; +begin + Result := not FReadOnly and FMoving; +end; + +function TcxSchedulerEventOperations.GetMovingBetweenResources: Boolean; +begin + Result := not FReadOnly and FMovingBetweenResources; +end; + +function TcxSchedulerEventOperations.GetMovingBetweenResourcesStored: Boolean; +begin + Result := not (FReadOnly or FMovingBetweenResources); +end; + +function TcxSchedulerEventOperations.GetMovingStored: Boolean; +begin + Result := not (FReadOnly or FMoving); +end; + +function TcxSchedulerEventOperations.GetSizing: Boolean; +begin + Result := not FReadOnly and FSizing; +end; + +function TcxSchedulerEventOperations.GetSizingStored: Boolean; +begin + Result := not (FReadOnly or FSizing); +end; + +{ TcxSchedulerOptionsCustomize } + +constructor TcxSchedulerOptionsCustomize.Create( + AOwner: TcxCustomScheduler); +begin + FScheduler := AOwner; + FControlsSizing := True; + FIntegralSizing := True; +end; + +procedure TcxSchedulerOptionsCustomize.Assign(Source: TPersistent); +var + ASourceOptionsCustomize: TcxSchedulerOptionsCustomize; +begin + if Source is TcxSchedulerOptionsCustomize then + begin + ASourceOptionsCustomize := TcxSchedulerOptionsCustomize(Source); + FControlsSizing := ASourceOptionsCustomize.ControlsSizing; + FDynamicSizing := ASourceOptionsCustomize.DynamicSizing; + IntegralSizing := ASourceOptionsCustomize.IntegralSizing; + end + else + inherited Assign(Source); +end; + +procedure TcxSchedulerOptionsCustomize.Changed; +begin + FScheduler.LayoutChanged; +end; + +function TcxSchedulerOptionsCustomize.GetOwner: TPersistent; +begin + Result := FScheduler; +end; + +procedure TcxSchedulerOptionsCustomize.SetControlsSizing(AValue: Boolean); +begin + FControlsSizing := AValue; + Scheduler.HorzSplitter.UpdateCursor; + Scheduler.VertSplitter.UpdateCursor; +end; + +procedure TcxSchedulerOptionsCustomize.SetIntegralSizing(AValue: Boolean); +begin + if AValue <> FIntegralSizing then + begin + FIntegralSizing := AValue; + if AValue then + Scheduler.DateNavigator.SetIntegralSizes; + Changed; + end; +end; + +{ TcxSchedulerResourceHeaders } + +constructor TcxSchedulerResourceHeaders.Create(AOwner: TcxSchedulerOptionsView); +begin + FRotateCaptions := True; + FOwner := AOwner; +end; + +procedure TcxSchedulerResourceHeaders.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerResourceHeaders then + begin + FHeight := TcxSchedulerResourceHeaders(Source).FHeight; + FImagePosition := TcxSchedulerResourceHeaders(Source).FImagePosition; + FMultilineCaptions := TcxSchedulerResourceHeaders(Source).FMultilineCaptions; + FRotateCaptions := TcxSchedulerResourceHeaders(Source).FRotateCaptions; + end + else + inherited; +end; + +procedure TcxSchedulerResourceHeaders.Changed; +begin + FOwner.Changed; +end; + +function TcxSchedulerResourceHeaders.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +procedure TcxSchedulerResourceHeaders.SetHeight(AValue: Integer); +begin + if AValue <> FHeight then + begin + FHeight := AValue; + Changed; + end; +end; + +procedure TcxSchedulerResourceHeaders.SetImagePosition( + AValue: TcxSchedulerHeaderImagePosition); +begin + if AValue <> FImagePosition then + begin + FImagePosition := AValue; + Changed; + end; +end; + +procedure TcxSchedulerResourceHeaders.SetMultilineCaptions(AValue: Boolean); +begin + if AValue <> FMultilineCaptions then + begin + FMultilineCaptions := AValue; + + Changed; + end; +end; + +procedure TcxSchedulerResourceHeaders.SetRotateCations(AValue: Boolean); +begin + if AValue <> FRotateCaptions then + begin + FRotateCaptions := AValue; + Changed; + end; +end; + +function TcxSchedulerResourceHeaders.IsImagePositionStored: Boolean; +begin + Result := FImagePosition <> ipLeft; +end; + +{ TcxSchedulerOptionsView } + +constructor TcxSchedulerOptionsView.Create( + AOwner: TcxCustomScheduler); +begin + FScheduler := AOwner; + FTimeZones[0] := -1; + FTimeZones[1] := -1; + FDayBorderColor := clDefault; + FEventHeight := 0; + FEventBorderColor := clBlack; + FGroupSeparatorWidth := cxDefaultGroupSeparatorWidth; + FHorzSplitterWidth := cxDefaultSplitterWidth; + FVertSplitterWidth := cxDefaultSplitterWidth; + FHideSelection := False; + FHotTrack := False; //for the next version True; + FResourceHeaders := TcxSchedulerResourceHeaders.Create(Self); + FWorkDays := DateTimeHelper.WorkDays; + FStartOfWeek := swSystem; + CalculateActualStartOfWeek; + FWorkFinish := DateTimeHelper.WorkFinish; + FWorkStart := DateTimeHelper.WorkStart; + FViewPosition := vpLeft; + FResourcesPerPage := cxDefaultResourcesPerPage; + ShowHints := True; + ShowNavigationButtons := True; +end; + +destructor TcxSchedulerOptionsView.Destroy; +begin + FResourceHeaders.Free; + inherited Destroy; +end; + +procedure TcxSchedulerOptionsView.Assign( + Source: TPersistent); +var + AItem: Integer; + ASourceOptionsView: TcxSchedulerOptionsView; +begin + if Source is TcxSchedulerOptionsView then + begin + ASourceOptionsView := TcxSchedulerOptionsView(Source); + for AItem := 0 to 1 do + begin + FTimeZones[AItem] := ASourceOptionsView.FTimeZones[AItem]; + FTimeZoneLabels[AItem] := ASourceOptionsView.FTimeZoneLabels[AItem]; + end; + FResourcesPerPage := ASourceOptionsView.FResourcesPerPage; + FDayBorderColor := ASourceOptionsView.DayBorderColor; + FEventBorderColor := ASourceOptionsView.EventBorderColor; + FEventHeight := ASourceOptionsView.EventHeight; + FGroupingKind := ASourceOptionsView.FGroupingKind; + FGroupSeparatorWidth := ASourceOptionsView.FGroupSeparatorWidth; + FHideSelection := ASourceOptionsView.HideSelection; + FHorzSplitterWidth := ASourceOptionsView.FHorzSplitterWidth; + FHotTrack := ASourceOptionsView.HotTrack; + FResourceHeaders.Assign(ASourceOptionsView.ResourceHeaders); + FShowHints := ASourceOptionsView.ShowHints; + FShowNavigationButtons := ASourceOptionsView.FShowNavigationButtons; + FVertSplitterWidth := ASourceOptionsView.FVertSplitterWidth; + FViewPosition := ASourceOptionsView.ViewPosition; + FWorkDays := ASourceOptionsView.WorkDays; + FWorkFinish := ASourceOptionsView.WorkFinish; + FWorkStart := ASourceOptionsView.WorkStart; + end + else + inherited Assign(Source); +end; + +procedure TcxSchedulerOptionsView.CalculateActualStartOfWeek; +begin + if FStartOfWeek = swSystem then + FActualStartOfWeek := TDay(DateTimeHelper.StartOfWeek) + else + FActualStartOfWeek := TDay(Pred(FStartOfWeek)); +end; + +procedure TcxSchedulerOptionsView.Changed; +begin + Scheduler.LayoutChanged; +end; + +procedure TcxSchedulerOptionsView.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('WorkStart', ReadWorkStart, WriteWorkStart, FWorkStartAssigned); + Filer.DefineProperty('WorkFinish', ReadWorkFinish, WriteWorkFinish, FWorkFinishAssigned); +end; + +function TcxSchedulerOptionsView.GetOwner: TPersistent; +begin + Result := FScheduler; +end; + +function TcxSchedulerOptionsView.IsWorkDaysStored: Boolean; +begin + Result := FWorkDays <> DateTimeHelper.WorkDays; +end; + +function TcxSchedulerOptionsView.IsWorkTime(AResourceItem: TcxSchedulerStorageResourceItem; + const ADateTime: TDateTime): Boolean; +var + AWorkDays: TDays; + AWorkFinish: TTime; + AWorkStart: TTime; +begin + if Assigned(AResourceItem) then + begin + AWorkDays := AResourceItem.WorkDays; + AWorkFinish := AResourceItem.WorkFinish; + AWorkStart := AResourceItem.WorkStart; + end + else + begin + AWorkDays := WorkDays; + AWorkStart := WorkStart; + AWorkFinish := WorkFinish; + end; + + Result := (TDay(DayOfWeek(ADateTime) - 1) in AWorkDays); + if Result then + begin + if AWorkStart < AWorkFinish then + Result := ((DateTimeHelper.RoundTime(TimeOf(ADateTime)) >= AWorkStart) and + (DateTimeHelper.RoundTime(TimeOf(ADateTime)) < AWorkFinish)) + else + Result := ((DateTimeHelper.RoundTime(TimeOf(ADateTime)) >= AWorkStart) or + (DateTimeHelper.RoundTime(TimeOf(ADateTime)) < AWorkFinish)) + end; +end; + +function TcxSchedulerOptionsView.GetDateTimeHelperClass: TcxSchedulerDateTimeHelperClass; +begin + Result := Scheduler.DateTimeHelper; +end; + +function TcxSchedulerOptionsView.GetRotateResourceCaptions: Boolean; +begin + Result := FResourceHeaders.RotateCaptions; +end; + +function TcxSchedulerOptionsView.GetTimeZone( + AIndex: Integer): Integer; +begin + Result := FTimeZones[AIndex]; + if (Result < 0) or (Result >= DateTimeHelper.TimeZoneCount) then + Result := -1; +end; + +function TcxSchedulerOptionsView.GetTimeZoneLabel( + AIndex: Integer): string; +begin + Result := FTimeZoneLabels[AIndex]; +end; + +function TcxSchedulerOptionsView.IsTimeZoneLabelStored( + AIndex: Integer): Boolean; +begin + Result := FTimeZoneLabels[AIndex] <> ''; +end; + +procedure TcxSchedulerOptionsView.SetATZDaylightSaving(AValue: Boolean); +begin + if AValue <> FAdditionalTimeZoneDaylightSaving then + begin + FAdditionalTimeZoneDaylightSaving := AValue; + Scheduler.FullRefresh; + end; +end; + +procedure TcxSchedulerOptionsView.SetCTZDaylightSaving(AValue: Boolean); +begin + if AValue <> FCurrentTimeZoneDaylightSaving then + begin + FCurrentTimeZoneDaylightSaving := AValue; + Scheduler.FullRefresh; + end; +end; + +procedure TcxSchedulerOptionsView.SetDayBorderColor(AValue: TColor); +begin + if AValue <> FDayBorderColor then + begin + FDayBorderColor := AValue; + Changed; + end; +end; + +procedure TcxSchedulerOptionsView.SetEventBorderColor(AValue: TColor); +begin + if AValue <> FEventBorderColor then + begin + FEventBorderColor := AValue; + Changed; + end; +end; + +procedure TcxSchedulerOptionsView.SetEventHeight(AValue: Integer); +begin + if AValue < 0 then AValue := 0; + if AValue <> FEventHeight then + begin + FEventHeight := AValue; + Changed; + end; +end; + +procedure TcxSchedulerOptionsView.SetGroupingKind( + AValue: TcxSchedulerGroupingKind); +begin + if FGroupingKind <> AValue then + begin + FGroupingKind := AValue; + Changed; + end; +end; + +procedure TcxSchedulerOptionsView.SetGroupSeparatorWidth( + AValue: Integer); +begin + FGroupSeparatorWidth := Max(0, AValue); + Changed; +end; + +procedure TcxSchedulerOptionsView.SetHideSelection(AValue: Boolean); +begin + if FHideSelection <> AValue then + begin + FHideSelection := AValue; + Changed; + end; +end; + +procedure TcxSchedulerOptionsView.SetHorzSplitterWidth(AValue: Integer); +begin + SetSplitterWidth(AValue, FHorzSplitterWidth); +end; + +procedure TcxSchedulerOptionsView.SetResourceHeaders( + AValue: TcxSchedulerResourceHeaders); +begin + FResourceHeaders.Assign(AValue) +end; + +procedure TcxSchedulerOptionsView.SetRotateResourceCaptions(AValue: Boolean); +begin + ResourceHeaders.RotateCaptions := AValue; +end; + +procedure TcxSchedulerOptionsView.SetResourcesPerPage( + AValue: Integer); +begin + AValue := Max(AValue, 0); + if AValue <> FResourcesPerPage then + begin + FResourcesPerPage := AValue; + Changed; + end; +end; + +procedure TcxSchedulerOptionsView.SetShowAdditionalTimeZone(AValue: Boolean); +begin + if FShowAdditionalTimeZone <> AValue then + begin + FShowAdditionalTimeZone := AValue; + Changed; + end; +end; + +procedure TcxSchedulerOptionsView.SetShowEventsWithoutResource( + AValue: Boolean); +begin + if AValue <> FShowEventsWithoutResource then + begin + FShowEventsWithoutResource := AValue; + Scheduler.FullRefresh; + end; +end; + +procedure TcxSchedulerOptionsView.SetShowNavigationButtons(AValue: Boolean); +begin + if AValue <> FShowNavigationButtons then + begin + FShowNavigationButtons := AValue; + Changed; + end; +end; + +procedure TcxSchedulerOptionsView.SetSplitterWidth( + AValue: Integer; var AWidth: Integer); +begin + AValue := Max(AValue, cxMinSplitterWidth); + if AValue <> AWidth then + begin + AWidth := AValue; + Changed; + end; +end; + +procedure TcxSchedulerOptionsView.SetStartOfWeek(AValue: TcxStartOfWeek); +var + AOldActualValue: TDay; +begin + if AValue <> FStartOfWeek then + begin + FStartOfWeek := AValue; + AOldActualValue := ActualStartOfWeek; + CalculateActualStartOfWeek; + if not Scheduler.IsLoading then + Scheduler.DoStartOfWeekChanged(AOldActualValue, ActualStartOfWeek); + end; +end; + +procedure TcxSchedulerOptionsView.SetTimeZone( + AIndex, AValue: Integer); +begin + AValue := Max(Min(AValue, DateTimeHelper.TimeZoneCount - 1), -1); + if AValue <> FTimeZones[AIndex] then + begin + FTimeZones[AIndex] := AValue; + Scheduler.FullRefresh; + end; +end; + +procedure TcxSchedulerOptionsView.SetTimeZoneLabel( + AIndex: Integer; const AValue: string); +begin + if AValue <> FTimeZoneLabels[AIndex] then + begin + FTimeZoneLabels[AIndex] := AValue; + Changed; + end; +end; + +procedure TcxSchedulerOptionsView.SetVertSplitterWidth(AValue: Integer); +begin + SetSplitterWidth(AValue, FVertSplitterWidth); +end; + +procedure TcxSchedulerOptionsView.SetViewPosition( + AValue: TcxSchedulerViewPosition); +begin + if AValue <> FViewPosition then + begin + FViewPosition := AValue; + Changed; + end; +end; + +procedure TcxSchedulerOptionsView.SetWorkDays(AValue: TDays); +begin + if AValue <> FWorkDays then + begin + FWorkDays := AValue; + Scheduler.PeriodChanged; + end; +end; + +procedure TcxSchedulerOptionsView.SetWorkFinish(AValue: TTime); +begin + if AValue <> FWorkFinish then + begin + FWorkFinish := DateTimeHelper.RoundTime(AValue); + FWorkFinishAssigned := FWorkFinish <> DateTimeHelper.WorkFinish; + Scheduler.PeriodChanged; + end; +end; + +procedure TcxSchedulerOptionsView.SetWorkStart(AValue: TTime); +begin + if AValue <> FWorkStart then + begin + FWorkStart := DateTimeHelper.RoundTime(AValue); + FWorkStartAssigned := FWorkStart <> DateTimeHelper.WorkStart; + Scheduler.PeriodChanged; + end; +end; + +procedure TcxSchedulerOptionsView.ReadWorkFinish(AReader: TReader); +begin + FWorkFinish := AReader.ReadFloat; +end; + +procedure TcxSchedulerOptionsView.ReadWorkStart(AReader: TReader); +begin + FWorkStart := AReader.ReadFloat; +end; + +procedure TcxSchedulerOptionsView.WriteWorkFinish(AWriter: TWriter); +begin + AWriter.WriteFloat(FWorkFinish); +end; + +procedure TcxSchedulerOptionsView.WriteWorkStart(AWriter: TWriter); +begin + AWriter.WriteFloat(FWorkStart); +end; + +{ TcxSchedulerViewHitTest } + +function TcxSchedulerViewHitTest.GetDragKind: TcxEventDragKind; +begin + Result := edkNone; +end; + +procedure TcxSchedulerViewHitTest.Clear; +begin + inherited Clear; + FNeedShowHint := False; + FTime := NullDate; +end; + +function TcxSchedulerViewHitTest.GetHitEvent: TcxSchedulerControlEvent; +begin + Result := nil; +end; + +function TcxSchedulerViewHitTest.GetHitAtEvent: Boolean; +begin + Result := Event <> nil; +end; + +function TcxSchedulerViewHitTest.GetNeedShowHint: Boolean; +var + AText: string; +begin + Result := FNeedShowHint or (HitAtEvent and Scheduler.NeedShowHint(Event, AText, False)); +end; + +{ TcxDragHelper } + +constructor TcxDragHelper.Create(AScheduler: TcxCustomScheduler); +begin + FScheduler := AScheduler; + BeginDrag; +end; + +procedure TcxDragHelper.BeginDrag; +begin + FSaveCursor := Scheduler.DragCursor; + GetOriginState; + FPrevAccepted := True; +end; + +procedure TcxDragHelper.CalculateConflicts; +begin + FHasConflicts := Scheduler.HasConflict(False); +end; + +procedure TcxDragHelper.CalculateDestination; +var + P: TPoint; +begin + FDestination := dodOther; + with Scheduler do + begin + P := ScreenToClient(GetMouseCursorPos); + if CurrentView.Visible and + cxRectPtIn(cxRectOffset(CurrentView.ViewInfo.Bounds, CurrentView.Bounds.TopLeft), P) then + FDestination := dodView + else + if DateNavigator.Visible and cxRectPtIn(DateNavigator.Bounds, P) then + begin + FDestination := dodDateNavigator; + DateNavigator.MousePositionChanged(P.X, P.Y); + end + else + if ControlBox.Visible and cxRectPtIn(ControlBox.Bounds, P) then + FDestination := dodControlBox; + end; +end; + +function TcxDragHelper.CanUpdateEventState( + AEvent: TcxSchedulerControlEvent): Boolean; +begin + with AEvent.Source do + Result := State = cxOriginalEventStates[AllDayEvent]; +end; + +procedure TcxDragHelper.CheckAccepted(var Accepted: Boolean); +begin + Accepted := Accepted and (Destination <> dodOther) and IsValidTime; +end; + +procedure TcxDragHelper.CheckEventState(AEvent: TcxSchedulerControlEvent); +var + ANewState: Integer; +begin + if CanUpdateEventState(AEvent) then + begin + ANewState := cxOriginalEventStates[AEvent.AllDayEvent]; + if AEvent.State <> ANewState then + AEvent.State := ANewState; + end; +end; + +procedure TcxDragHelper.DragOver(const P: TPoint; State: TDragState; + var Accepted: Boolean); +begin + CalculateDestination; + FActualHitTime := GetActualHitTime; + CheckAccepted(Accepted); + FAcceptedChanged := Accepted <> FPrevAccepted; +end; + +procedure TcxDragHelper.EndDrag(Accepted: Boolean); +begin +end; + +function TcxDragHelper.GetOriginHitTestMask: Int64; +const + Mask = 1 shl htcControl; +begin + Result := Mask; +end; + +procedure TcxDragHelper.GetOriginState; +begin + with Controller do + begin + FStartHitFlags := StartDragFlags and GetOriginHitTestMask; + FStartHitTime := StartDragHitTime; + FStartResource := StartDragResource; + end; + FPrevHitTime := FStartHitTime; + FPrevHitFlags := FStartHitFlags; + FPrevHitResource := FStartResource; +end; + +function TcxDragHelper.HasChangedState: Boolean; +begin + with HitTest do + Result := FAcceptedChanged or + (FPrevHitFlags <> (Flags and GetOriginHitTestMask)) or + (IsValidTime and (FPrevHitTime <> GetActualHitTime)) or + (HitAtResource and (FPrevHitResource <> Resource)); +end; + +function TcxDragHelper.IsAtOrigin: Boolean; +begin + with HitTest do + begin + Result := (FStartHitFlags = (Flags and GetOriginHitTestMask)) and + (Controller.StartDragHitTime = Time); + if Result and IsShowResources then + Result := HitAtResource and (FStartResource = Resource); + end; +end; + +function TcxDragHelper.IsShowResources: Boolean; +begin + Result := Scheduler.CurrentView.IsShowResources; +end; + +function TcxDragHelper.IsValidTime: Boolean; +begin + Result := HitTest.HitAtTime; +end; + +procedure TcxDragHelper.RefreshCurrentView; +begin + Scheduler.CurrentView.Refresh; +end; + +procedure TcxDragHelper.SetSelection; +begin + Controller.SyncEventSelection(Controller.DragEvent); +end; + +procedure TcxDragHelper.UpdateHelperState(Accepted: Boolean); +begin + with HitTest do + begin + FPrevHitFlags := Flags and GetOriginHitTestMask; + FPrevHitTime := GetActualHitTime; + FPrevHitResource := Resource; + end; + FPrevAccepted := Accepted; +end; + +function TcxDragHelper.GetActualHitTime: TDateTime; +begin + if Destination = dodDateNavigator then + Result := DateNavigator.HitTest.Time + else + Result := HitTest.Time; +end; + +function TcxDragHelper.GetController: TcxSchedulerViewController; +begin + Result := Scheduler.CurrentView.Controller; +end; + +function TcxDragHelper.GetDateNavigator: TcxSchedulerCustomDateNavigator; +begin + Result := Scheduler.DateNavigator; +end; + +function TcxDragHelper.GetEvents: TcxSchedulerCachedEventList; +begin + Result := Scheduler.EventList; +end; + +function TcxDragHelper.GetHitTest: TcxSchedulerViewHitTest; +begin + Result := Scheduler.CurrentView.HitTest; +end; + +{ TcxSchedulerDragObject} + +constructor TcxSchedulerDragObject.Create(AControl: TControl); +begin + inherited Create(AControl); + FUseInternalCursors := (Control is TcxCustomScheduler) and + (Scheduler.DragCursor = crDrag); +end; + +procedure TcxSchedulerDragObject.DropToDateNavigator( + ADateNavigator: TcxSchedulerCustomDateNavigator); +begin + if not ADateNavigator.HitTest.HitAtTime then Exit; + DragEventHelper.ProcessDateNavigator(ADateNavigator); +end; + +procedure TcxSchedulerDragObject.CalculateConflictsForDateNavigator( + ADateNavigator: TcxSchedulerCustomDateNavigator); +begin + with DragEventHelper do + begin + UpdateDateNavigatorClones(ADateNavigator); + CalculateConflicts; + end; +end; + +procedure TcxSchedulerDragObject.Finished( + Target: TObject; X, Y: Integer; Accepted: Boolean); +begin + if not Accepted and (Target is TcxCustomScheduler) and (Target <> Scheduler) then + TcxCustomScheduler(Target).DragCanceled; + inherited Finished(Target, X, Y, Accepted); +end; + +function TcxSchedulerDragObject.GetDragCursor(Accepted: Boolean; X, Y: Integer): TCursor; + + function CanAcceptEvent: Boolean; + begin + with DragEventHelper do + Result := not HasConflicts and FPrevAccepted; + end; + +var + R: TRect; +begin + if Assigned(DragEventHelper) and Accepted and FUseInternalCursors then + begin + GetWindowRect(Scheduler.Handle, R); + if CanAcceptEvent or not cxRectPtIn(R, X, Y) then + if Scheduler.IsCopyDragDrop then + Result := crSchedulerCopyEvent + else + Result := crSchedulerMoveEvent + else + Result := crNoDrop + end + else + Result := inherited GetDragCursor(Accepted, X, Y); +end; + +function TcxSchedulerDragObject.GetDragEventHelper: TcxDragEventHelper; +begin + Result := Scheduler.CurrentView.Controller.DragEventHelper; +end; + +function TcxSchedulerDragObject.GetDragEvents: TcxSchedulerFilteredEventList; +begin + Result := Scheduler.EventList.Clones; +end; + +function TcxSchedulerDragObject.GetHasConflicts: Boolean; +begin + Result := (DragEventHelper <> nil) and DragEventHelper.HasConflicts; +end; + +function TcxSchedulerDragObject.GetScheduler: TcxCustomScheduler; +begin + Result := TcxCustomScheduler(Control); +end; + +{ TcxDragEventHelper } + +procedure TcxDragEventHelper.ApplyChanges; +begin + SetSelection; + Events.PostClones(FPrevIsDragCopy); +end; + +procedure TcxDragEventHelper.BeginDrag; +begin + inherited BeginDrag; + PrepareClones; + CheckVisibility(True); +end; + +procedure TcxDragEventHelper.CheckAccepted(var Accepted: Boolean); + + function CanMoveBetweenResources: Boolean; + var + AResource: TcxSchedulerStorageResourceItem; + begin + AResource := HitTest.Resource; + Result := (FStartResource = AResource) or + (Scheduler.EventOperations.MovingBetweenResources and + ((AResource = nil) or not AResource.ReadOnly)); + end; + +begin + inherited CheckAccepted(Accepted); + if not Accepted or (Destination = dodControlBox) then Exit; + if (Destination = dodView) and IsShowResources and HitTest.HitAtResource and + not CanMoveBetweenResources then Accepted := False; + if DateNavigator.Visible then + UpdateDateNavigator(Accepted); +end; + +procedure TcxDragEventHelper.CheckVisibility(Accepted: Boolean); +begin + Inc(Scheduler.FLockRefresh); + try + Events.AlwaysShowSelectedEvent := not Accepted or (Destination <> dodView); + ViewInfo.SetEventsVisibility(GetSourcesVisible(Accepted), + GetClonesVisible(Accepted), True); + finally + Dec(Scheduler.FLockRefresh); + end; +end; + +procedure TcxDragEventHelper.DragOver(const P: TPoint; State: TDragState; + var Accepted: Boolean); +var + ANeedUpdate: Boolean; +begin + inherited DragOver(P, State, Accepted); + ANeedUpdate := HasChangedState or (State in [dsDragLeave, dsDragEnter]); + if Accepted and ANeedUpdate then + begin + Accepted := DragObject.Dropped or (State <> dsDragLeave); + if Accepted then + UpdateClones; + end; + if ANeedUpdate then + begin + CalculateConflicts; + CheckVisibility(Accepted); + if State = dsDragLeave then + Scheduler.UpdateDateNavigatorDragging(False) + end; + Controller.CheckScrollOnDragOver(P, State); +end; + +procedure TcxDragEventHelper.EndDrag(Accepted: Boolean); +begin + try + Events.AlwaysShowSelectedEvent := False; + CalculateDestination; + CheckAccepted(Accepted); + Controller.CancelScroll; + Scheduler.DragCursor := SaveCursor; + FPrevIsDragCopy := IsDragCopy; + if Accepted and IsValidTime and not (IsAtOrigin and not FPrevIsDragCopy) then + begin + UpdateClones; + CalculateConflicts; + if not HasConflicts then + begin + Scheduler.DoAfterDragEvent(FTarget, HitTest.HitX, HitTest.HitY, Accepted); + if Accepted then + ApplyChanges; + end; + end; + finally + Events.CancelClones; + DateNavigatorEndDrag; + Scheduler.FullRefresh; + end; +end; + +procedure TcxDragEventHelper.DateNavigatorEndDrag; +begin + if DateNavigator.Visible then + DateNavigator.Controller.DoCancelMode; +end; + +function TcxDragEventHelper.GetClonesVisible(Accepted: Boolean): Boolean; +begin + Result := Accepted and ((Destination = dodView) and not (IsAtOrigin and not IsDragCopy)); +end; + +function TcxDragEventHelper.GetIsDragCopy: Boolean; +begin + Result := Scheduler.IsCopyDragDrop; +end; + +procedure TcxDragEventHelper.GetOriginState; +begin + inherited GetOriginState; + FPrevIsDragCopy := IsDragCopy; +end; + +function TcxDragEventHelper.GetSourcesVisible(Accepted: Boolean): Boolean; +begin + Result := not Accepted or + ((Destination in [dodDateNavigator, dodControlBox]) or IsAtOrigin or IsDragCopy); +end; + +function TcxDragEventHelper.HasChangedState: Boolean; +begin + Result := inherited HasChangedState or (FPrevIsDragCopy <> IsDragCopy); +end; + +function TcxDragEventHelper.IsValidNavigatorDate: Boolean; +begin + Result := (Destination = dodDateNavigator) and DateNavigator.HitTest.HitAtTime; +end; + +function TcxDragEventHelper.IsValidTime: Boolean; +begin + Result := HitTest.HitAtTime or IsValidNavigatorDate; +end; + +procedure TcxDragEventHelper.PrepareClones; +var + I: Integer; + AEvent: TcxSchedulerControlEvent; + AResource, ADragEventResource: TcxSchedulerStorageResourceItem; +begin + ADragEventResource := Controller.DragEvent.GetResourceItem; + for I := Events.Selection.Count - 1 downto 0 do + begin + AEvent := Events.Selection.Items[I]; + AResource := AEvent.GetResourceItem; + if IsShowResources and (AResource <> nil) and (AResource <> ADragEventResource) then + Events.Selection.Add(AEvent, [ssCtrl]); + end; + Events.CreateClones; +end; + +procedure TcxDragEventHelper.ProcessDateNavigator( + ADateNavigator: TcxSchedulerCustomDateNavigator); +begin + try + UpdateDateNavigatorClones(ADateNavigator); + finally + Events.PostClones(IsDragCopy); + end; +end; + +procedure TcxDragEventHelper.SetSelection; +var + I: Integer; + AEvent: TcxSchedulerControlEvent; +begin + for I := 0 to Clones.Count - 1 do + begin + AEvent := Clones[I]; + if AEvent.Source = Controller.DragEvent then + Controller.SyncEventSelection(AEvent); + end; +end; + +procedure TcxDragEventHelper.Update(Accepted: Boolean = True); +begin + DragOver(ViewInfo.Owner.ScreenToClient(GetMouseCursorPos), dsDragMove, Accepted); +end; + +procedure TcxDragEventHelper.UpdateHelperState(Accepted: Boolean); +begin + inherited UpdateHelperState(Accepted); + FPrevIsDragCopy := IsDragCopy; +end; + +procedure TcxDragEventHelper.UpdateClones; +begin + if Destination = dodView then + UpdateViewClones + else + if Destination = dodDateNavigator then + UpdateDateNavigatorClones(DateNavigator); +end; + +procedure TcxDragEventHelper.UpdateDateNavigatorClones( + ADateNavigator: TcxSchedulerCustomDateNavigator); +var + ADelta: TDateTime; + I: Integer; +begin + ADelta := ADateNavigator.HitTest.Time - DateOf(Controller.DragEvent.{Source.}Start); + for I := 0 to Clones.Count - 1 do + with Clones[I] do + begin + State := Source.State; + AllDayEvent := Source.AllDayEvent; + Duration := Source.Duration; + MoveTo(Source.Start + ADelta); + ResourceID := Source.ResourceID; + end; +end; + +procedure TcxDragEventHelper.UpdateDateNavigator(var Accepted: Boolean); +var + P: TPoint; +begin + P := Scheduler.ScreenToClient(GetMouseCursorPos); + with DateNavigator do + begin + MousePositionChanged(P.X, P.Y); + if HitTest.HitAtControl then + Accepted := HitTest.HitAtTime; + UpdateDragging; + end; +end; + +procedure TcxDragEventHelper.UpdateViewClones; +begin + UpdateViewClonesResources; + UpdateViewClonesTime; +end; + +procedure TcxDragEventHelper.UpdateViewClonesResources; +var + I: Integer; + AResource: TcxSchedulerStorageResourceItem; +begin + with HitTest do + begin + if HitAtResource then + AResource := Resource + else + AResource := FStartResource; + end; + if AResource <> nil then + begin + for I := 0 to Clones.Count - 1 do + with Clones[I] do + if not VarIsNull(Source.ResourceID) and + (not Source.Shared or Source.IsSharedWithResource(AResource)) then + ReplaceResourceID(AResource.ResourceID); + end; +end; + +procedure TcxDragEventHelper.UpdateViewClonesTime; +begin +end; + +function TcxDragEventHelper.GetClones: TcxSchedulerFilteredEventList; +begin + Result := Scheduler.EventList.Clones; +end; + +function TcxDragEventHelper.GetViewInfo: TcxSchedulerCustomViewViewInfo; +begin + Result := TcxSchedulerCustomViewViewInfo(Scheduler.CurrentView.ViewInfo); +end; + +{ TcxSchedulerEditController } + +constructor TcxSchedulerEditController.Create(AOwner: TcxCustomScheduler); +begin + FOwner := AOwner; + FEditList := TcxInplaceEditList.Create; +end; + +destructor TcxSchedulerEditController.Destroy; +begin + CloseEdit(False); + FEditList.Free; + inherited Destroy; +end; + +procedure TcxSchedulerEditController.Activate( + AEvent: TcxSchedulerControlEvent); +begin + if InitEdit(AEvent) then + FEdit.Activate(FEditData); +end; + +procedure TcxSchedulerEditController.Activate( + AEvent: TcxSchedulerControlEvent; const APos: TPoint; AShift: TShiftState); +begin + if InitEdit(AEvent) then + FEdit.ActivateByMouse(AShift, APos.X, APos.Y, FEditData); +end; + +procedure TcxSchedulerEditController.Activate( + AEvent: TcxSchedulerControlEvent; Key: Char); +begin + if InitEdit(AEvent) then + FEdit.ActivateByKey(Key, FEditData); +end; + +procedure TcxSchedulerEditController.CloseEdit(Accepted: Boolean); + + function IsDataRefreshing: Boolean; + begin + Result := Scheduler.FLockRefresh > 0; + end; + +begin + if not IsEditing then Exit; + FIsEditing := False; + FFocused := False; + try + if not (Scheduler.IsDestroying or IsDataRefreshing) then + begin + if Accepted and CanAccept then + begin + if not FEdit.Deactivate then raise EAbort.Create(''); + UpdateValue; + if Event.Source = nil then + Event.MoveTo(Event.Start + Scheduler.GetTimeBias); + Scheduler.EventList.PostEvent(Event); + Scheduler.SetFocus; + end + else + begin + if FIsNewEvent then + begin + DeleteEvent(Event); + FEvent := nil; + end; + Scheduler.FullRefresh; + end; + end; + finally + FEdit.Parent := nil; + FEdit := nil; + FreeAndNil(FEditData); + FIsNewEvent := False; + if not Scheduler.IsDestroying then + begin + Scheduler.DoAfterEditing(Scheduler.EventList.LastEditedEvent); + if not IsDataRefreshing then + Scheduler.CurrentView.Refresh; + end; + FEvent := nil; + end; +end; + +procedure TcxSchedulerEditController.Init(const AEditDate: TDateTime; + AResource: TcxSchedulerStorageResourceItem; AIsNewEvent: Boolean = False); +begin + FEditDate := DateOf(AEditDate); + FEditResource := AResource; + FIsNewEvent := AIsNewEvent; +end; + +procedure TcxSchedulerEditController.DeleteEvent(AEvent: TcxSchedulerControlEvent); +begin + Scheduler.EventList.DeleteEvent(AEvent); + if Scheduler.CurrentView <> nil then + Scheduler.CurrentView.Refresh; +end; + +procedure TcxSchedulerEditController.UpdateEdit; +var + R: TRect; +begin + if not IsEditing then Exit; + if GetEditRect(R, FEditDate, FEditResource) then + begin + FEdit.BoundsRect := R; + FEdit.Visible := True; + end + else + FEdit.Visible := False; + FEdit.EditValue := FEvent.Caption; +end; + +procedure TcxSchedulerEditController.UpdateValue; +begin + if (FEdit <> nil) and FEdit.EditModified then + begin + FEdit.ValidateEdit(True); + FEvent.Caption := FEdit.EditValue; + end; +end; + +function TcxSchedulerEditController.GetEditRect(var R: TRect; + const ADate: TDateTime; AResource: TcxSchedulerStorageResourceItem; + AMakeVisible: Boolean = False): Boolean; +begin + Scheduler.MakeEventVisible(Event, ADate, AResource); + with Scheduler.CurrentView do + R := cxRectOffset(GetEditRectForEvent(Event, ADate, AResource), Bounds.TopLeft); + Result := not cxRectIsEmpty(R); +end; + +procedure TcxSchedulerEditController.EditAfterKeyDown( + Sender: TObject; var Key: Word; Shift: TShiftState); +begin + if IsKeyForControl(Key, Shift) then + begin + Scheduler.SetFocus; + CloseEdit(True); + end; +end; + +procedure TcxSchedulerEditController.EditExit(Sender: TObject); +begin + if IsEditing then CloseEdit(True); +end; + +procedure TcxSchedulerEditController.EditKeyDown( + Sender: TObject; var Key: Word; Shift: TShiftState); +begin + if IsKeyForControl(Key, Shift) then + begin + CloseEdit(Key <> VK_ESCAPE); + Scheduler.SetFocus; + end; + if Assigned(Scheduler.OnKeyDown) then + Scheduler.OnKeyDown(Scheduler, Key, Shift); +end; + +procedure TcxSchedulerEditController.EditKeyPress( + Sender: TObject; var Key: Char); +begin + if Assigned(Scheduler.OnKeyPress) then + Scheduler.OnKeyPress(Scheduler, Key); +end; + +procedure TcxSchedulerEditController.EditKeyUp( + Sender: TObject; var Key: Word; Shift: TShiftState); +begin + if Assigned(Scheduler.OnKeyUp) then + Scheduler.OnKeyUp(Scheduler, Key, Shift); +end; + +procedure TcxSchedulerEditController.EditPostEditValue(Sender: TObject); +begin + UpdateValue; +end; + +function TcxSchedulerEditController.InitEdit( + AEvent: TcxSchedulerControlEvent): Boolean; +var + R: TRect; +begin + Result := False; + if AEvent = nil then Exit; + if IsEditing then + begin + if FEvent = AEvent then + begin + UpdateValue; + UpdateEdit; + end + else + CloseEdit(True); + Exit; + end; + FIsEditing := False; + FEvent := AEvent; +{ Controller.SelectSingleEvent(AEvent, NullDate, False); } + if not (Scheduler.DoBeforeEditing(AEvent, True) and + GetEditRect(R, FEditDate, FEditResource, True)) then Exit; + Scheduler.EventList.BeforeEditing(FEvent, True); + Scheduler.DoGetEventEditProperties(Event, FEditProperties); + FEdit := FEditList.GetEdit(EditProperties); + Result := FEdit <> nil; + if not Result then Exit; + FIsEditing := True; + PrepareEdit(FEdit); + if FIsEditing then + Scheduler.CurrentView.Refresh; +end; + +function TcxSchedulerEditController.IsKeyForControl( + var AKey: Word; Shift: TShiftState): Boolean; +begin + Result := (AKey = VK_TAB) or (AKey = VK_ESCAPE) or (AKey = VK_RETURN); +end; + +procedure TcxSchedulerEditController.PrepareEdit(AEdit: TcxCustomEdit); +const + VertAlignments: array[Boolean] of TcxEditVertAlignment = (taTopJustify, taVCenter); +var + R: TRect; + AVisible: Boolean; +begin + FFocused := True; + with FEdit do + begin + Visible := False; + AVisible := GetEditRect(R, FEditDate, FEditResource); + InternalProperties.Alignment.Vert := VertAlignments[View.GetEditWithSingleLineEditor(Event)]; + BoundsRect := R; + Parent := Scheduler; + EditValue := FEvent.Caption; + OnAfterKeyDown := EditAfterKeyDown; + OnExit := EditExit; + OnKeyDown := EditKeyDown; + OnKeyPress := EditKeyPress; + OnKeyUp := EditKeyUp; + OnPostEditValue := EditPostEditValue; + Style.Init(Scheduler.Styles.GetEventContentParams(Event)); + Visible := AVisible; + end; + Scheduler.DoInitEdit(FEdit); +end; + +function TcxSchedulerEditController.CanAccept: Boolean; +begin + Result := FEdit.EditModified or FIsNewEvent; +end; + +function TcxSchedulerEditController.GetController: TcxSchedulerViewController; +begin + Result := View.Controller; +end; + +function TcxSchedulerEditController.GetEditVisible: Boolean; +begin + Result := IsEditing and FEdit.Visible; +end; + +function TcxSchedulerEditController.GetView: TcxSchedulerCustomView; +begin + Result := Scheduler.CurrentView; +end; + +procedure TcxSchedulerEditController.SetEditVisible(Value: Boolean); +begin + if not IsEditing then Exit; + if Value <> EditVisible then + begin + FEdit.Visible := Value; + UpdateEdit; + end; +end; + +{ TcxSchedulerViewNavigation } + +constructor TcxSchedulerViewNavigation.Create( + AView: TcxSchedulerCustomView); +begin + FView := AView; +end; + +procedure TcxSchedulerViewNavigation.CheckSelection; +begin + with Scheduler do + Self.ValidateSelection(FSelStart, FSelFinish, FSelResource); +end; + +procedure TcxSchedulerViewNavigation.ReplaceSelParams( + const ASelStart, ASelFinish: TDateTime); +begin + ReplaceSelParams(ASelStart, ASelFinish, GetResourceItem); +end; + +procedure TcxSchedulerViewNavigation.ReplaceSelParams( + const ASelStart, ASelFinish: TDateTime; AResource: TcxSchedulerStorageResourceItem); +begin + Scheduler.ReplaceSelParams(ASelStart, ASelFinish, AResource); +end; + +procedure TcxSchedulerViewNavigation.ReplaceSelParams( + AResource: TcxSchedulerStorageResourceItem); +begin + Scheduler.ReplaceSelParams(SelStart, SelFinish, AResource); +end; + +function TcxSchedulerViewNavigation.ScrollResources(AGoForward: Boolean): Boolean; +const + ACode: array[Boolean] of TScrollCode = (scLineUp, scLineDown); +var + APos: Integer; +begin + with ResourceNavigator do + begin + if not AGoForward then + Result := FirstVisibleResourceIndex > 0 + else + Result := (ResourcesPerPage <> 0) and ((ResourcesPerPage + FirstVisibleResourceIndex) < VisibleResourceCount); + if Result then + begin + APos := FirstVisibleResourceIndex; + Scroll(ACode[AGoForward], APos); + end; + end; +end; + +function TcxSchedulerViewNavigation.ScrollResourcesEx( + AGoForward: Boolean; var AResource: TcxSchedulerStorageResourceItem): Boolean; +begin + Result := ScrollResources(AGoForward); + if Result then + begin + if not AGoForward then + AResource := VisibleResources[ResourceNavigator.FirstVisibleResourceIndex] + else + with ResourceNavigator do + AResource := VisibleResources[ResourcesPerPage + FirstVisibleResourceIndex - 1]; + end; +end; + +function TcxSchedulerViewNavigation.ScrollResourcesCycled( + AGoForward: Boolean; var AResource: TcxSchedulerStorageResourceItem): Boolean; +begin + Result := False; + if AGoForward and (ResourceNavigator.FirstVisibleResourceIndex > 0) then + begin + ResourceNavigator.FirstVisibleResourceIndex := 0; + AResource := VisibleResources[0]; + Result := True; + end + else + if not AGoForward and (ResourceNavigator.FirstVisibleResourceIndex = 0) then + begin + AResource := VisibleResources[VisibleResourceCount - 1]; + ResourceNavigator.FirstVisibleResourceIndex := + VisibleResourceCount - ResourceNavigator.ResourcesPerPage; + Result := True; + end; +end; + +procedure TcxSchedulerViewNavigation.SetSelAnchor( + const Anchor: TDateTime; AShift: TShiftState); +begin + SetSelAnchor(Anchor, AShift, SelResource); +end; + +procedure TcxSchedulerViewNavigation.SetSelAnchor( + const Anchor: TDateTime; AShift: TShiftState; + AResource: TcxSchedulerStorageResourceItem); +var + APrevSelResource: TObject; + APrevSelStart, APrevSelFinish: TDateTime; + + procedure StoreSelection; + begin + with Scheduler do + begin + APrevSelResource := SelResource; + APrevSelStart := SelStart; + APrevSelFinish := SelFinish; + end; + end; + + function NeedUpdateOnMouseAction: Boolean; + begin + with Scheduler do + Result := (ssLeft in AShift) and ((SelResource <> APrevSelResource) or + (SelStart <> APrevSelStart) or (SelFinish <> APrevSelFinish)); + end; + +begin + StoreSelection; + if not (ssShift in AShift) or (AResource <> SelResource) then + Scheduler.ReplaceSelParams(Anchor, Anchor, AResource) + else + Scheduler.ReplaceSelParams(Scheduler.FSelStart, Anchor, AResource); + if NeedUpdateOnMouseAction then + View.LayoutChanged; +end; + +procedure TcxSchedulerViewNavigation.ValidateSelection(var ASelStart, + ASelFinish: TDateTime; var AResource: TcxSchedulerStorageResourceItem); +begin +end; + +procedure TcxSchedulerViewNavigation.DoKeyDown( + var AKey: Word; AShift: TShiftState); +begin + Scheduler.BeginUpdate; + try + FCurrentAnchor := SelAnchor; + FCurrentResource := SelResource; + FShift := AShift; + KeyDown(AKey, AShift); + Scheduler.LayoutChanged; + finally + Scheduler.EndUpdate; + end; +end; + +function TcxSchedulerViewNavigation.IsKeyNavigation( + var AKey: Word; AShift: TShiftState): Boolean; +begin + Result := (AKey = VK_UP) or (AKey = VK_DOWN) or (AKey = VK_Next) or + (AKey = VK_Prior) or (AKey = VK_Left) or (AKey = VK_Right) or + (AKey = VK_Home) or (AKey = VK_End); +end; + +function TcxSchedulerViewNavigation.IsSingleLine: Boolean; +begin + Result := TimeOf(Abs(Scheduler.FSelStart - + Scheduler.FSelFinish)) <= View.GetTimeIncrement; +end; + +function TcxSchedulerViewNavigation.GetResourceItem: TcxSchedulerStorageResourceItem; +begin + Result := nil; +end; + +procedure TcxSchedulerViewNavigation.KeyDown(var AKey: Word; AShift: TShiftState); +begin +end; + +procedure TcxSchedulerViewNavigation.ReplaceDate( + ADate: TDateTime; AResource: TcxSchedulerStorageResourceItem); +begin + if ADate >= LastAvailableDate then Exit; + if AResource = nil then + AResource := SelResource; + with Scheduler do + begin + ADate := ADate - DateOf(FSelFinish); + ReplaceSelParams(FSelStart + ADate, FSelFinish + ADate, AResource); + end; +end; + +function TcxSchedulerViewNavigation.GetResourceNavigator: TcxSchedulerResourceNavigator; +begin + Result := Scheduler.ResourceNavigator; +end; + +function TcxSchedulerViewNavigation.GetScheduler: TcxCustomScheduler; +begin + Result := View.Scheduler; +end; + +function TcxSchedulerViewNavigation.GetSelAnchor: TDateTime; +begin + Result := Scheduler.FSelFinish +end; + +function TcxSchedulerViewNavigation.GetSelRealStart: TDateTime; +begin + Result := Scheduler.FSelStart; +end; + +function TcxSchedulerViewNavigation.GetSelFinish: TDateTime; +begin + Result := Max(Scheduler.FSelFinish, Scheduler.FSelStart); +end; + +function TcxSchedulerViewNavigation.GetSelResource: TcxSchedulerStorageResourceItem; +begin + Result := Scheduler.SelResource; +end; + +function TcxSchedulerViewNavigation.GetSelStart: TDateTime; +begin + Result := Min(Scheduler.FSelFinish, Scheduler.FSelStart); +end; + +function TcxSchedulerViewNavigation.GetTimeIncrement: TDateTime; +begin + Result := View.GetTimeIncrement; +end; + +function TcxSchedulerViewNavigation.GetVisibleResource( + AIndex: Integer): TcxSchedulerStorageResourceItem; +begin + if Scheduler.StorageValid then + Result := Scheduler.Storage.Resources.ResourceItems.VisibleResources[AIndex] + else + Result := nil; +end; + +function TcxSchedulerViewNavigation.GetVisibleResourceCount: Integer; +begin + if Scheduler.StorageValid then + Result := Scheduler.Storage.Resources.ResourceItems.VisibleResourceCount + else + Result := 0; +end; + +{ TcxSchedulerViewController } + +constructor TcxSchedulerViewController.Create(AOwner: TcxSchedulerSubControl); +begin + inherited Create(AOwner); + FNavigation := CreateNavigation; +end; + +destructor TcxSchedulerViewController.Destroy; +begin + FNavigation.Free; + inherited Destroy; +end; + +function TcxSchedulerViewController.CanCreateEventUsingDialog: Boolean; +begin + with Scheduler.EventOperations do + Result := Scheduler.StorageActive and CanShowEventDialog and Creating and + DialogEditing and not GetResourceReadOnly; +end; + +function TcxSchedulerViewController.CanCreateEventUsingInplaceEdit: Boolean; +begin + with Scheduler.EventOperations do + Result := Scheduler.StorageActive and Creating and InplaceEditing and + not GetResourceReadOnly and IsCaptionAvailable and (Scheduler.SelectedEventCount = 0); +end; + +function TcxSchedulerViewController.CanEditEvent( + AEvent: TcxSchedulerControlEvent; AInplace: Boolean): Boolean; +begin + with Scheduler.EventOperations do + begin + if AInplace then + Result := InplaceEditing and IsCaptionAvailable and View.IsInplaceEditingEnabled + else + Result := DialogEditing and DialogShowing; + end; + Result := Result and (AEvent <> nil); + if AInplace and Result then + Result := not AEvent.ReadOnly; +end; + +function TcxSchedulerViewController.CanShowEventDialog: Boolean; +begin + Result := Scheduler.EventOperations.DialogShowing and + Assigned(cxEventEditorClass); +end; + +procedure TcxSchedulerViewController.DeleteSelectedEvents; +begin + StopEditShowingTimer; + Scheduler.InternalDeleteSelectedEvents(False, True); +end; + +function TcxSchedulerViewController.IsEventEditing( + AEvent: TcxSchedulerControlEvent; AResource: TcxSchedulerStorageResourceItem): Boolean; +begin + Result := IsEditing and (EditController.Event = AEvent) and + (EditController.FEditResource = AResource); +end; + +procedure TcxSchedulerViewController.SelectSingleEvent( + AEvent: TcxSchedulerControlEvent; ADate: TDateTime; AMakeVisible: Boolean = True); +begin + if AMakeVisible then View.MakeEventVisible(AEvent, ADate, nil); + Scheduler.EventList.Selection.Add(AEvent, []); +end; + +procedure TcxSchedulerViewController.BeforeMouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited BeforeMouseDown(Button, Shift, X, Y); + StopEditShowingTimer; + Scheduler.HintController.Hide; + if not CanProcessMouseMove then Exit; + HitTest.HitPoint := Point(X, Y); + FDragKind := HitTest.GetDragKind; + if DragKind <> edkNone then + begin + CloseInplaceEdit; + FDragEvent := HitTest.Event; + if FDragEvent.IsClone and (FDragEvent.Source <> nil) then + FDragEvent := TcxSchedulerControlEvent(FDragEvent.Source); + FStartDragHitTime := HitTest.Time; + FStartDragFlags := HitTest.Flags; + FStartDragResource := HitTest.Resource; + end; +end; + +procedure TcxSchedulerViewController.CancelScroll; +begin +end; + +function TcxSchedulerViewController.CanDrag(X, Y: Integer): Boolean; +begin + Result := (DragKind in [edkEventDragRect, edkMoveEvent]) and HitTest.HitAtTime; + if Result then + begin + if Scheduler.EventList.Selection.IsSelected(DragEvent) and not Scheduler.HasConflict(True) then + Result := Scheduler.DoBeforeDragEvent(DragEvent, X, Y) + else + begin + Result := False; + SendMessage(Scheduler.Handle, WM_CANCELMODE, 0, 0); + end; + end; +end; + +procedure TcxSchedulerViewController.CheckOpenInplaceEditorOnMouseUp( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + AEvent: TcxSchedulerControlEvent; +begin + if (HitTest.HitAtEvent and (HitTest.Event = FBeforeFocusedEvent)) and (Button = mbLeft) and + ([ssShift, ssCtrl] * Shift = []) and not (DragKind in [edkResizeStart, edkResizeEnd]) then + begin + AEvent := HitTest.Event; + if cxRectPtIn(View.GetEditRectForEvent(AEvent, DateOf(HitTest.Time), + HitTest.Resource), X, Y) and CanEditEvent(AEvent, True) then + begin + EditController.Init(HitTest.Time, HitTest.Resource); + StartEditShowingTimer(AEvent); + end; + end; + FBeforeFocusedEvent := nil; +end; + +procedure TcxSchedulerViewController.CheckScrolling( + const APos: TPoint); +begin +end; + +procedure TcxSchedulerViewController.CheckScrollOnDragOver( + const P: TPoint; State: TDragState); +begin + if State <> dsDragLeave then + CheckScrolling(P) + else + CancelScroll; +end; + +procedure TcxSchedulerViewController.CheckUpdateEventBounds; +var + ASizingHelper: TcxEventSizingHelper; +begin + if (Scheduler.DragAndDropState = ddsInProcess) and + (Scheduler.DragAndDropObject is TcxSchedulerDragAndDropObject) then + begin + ASizingHelper := TcxSchedulerDragAndDropObject(Scheduler.DragAndDropObject).SizingHelper; + if ASizingHelper <> nil then + ASizingHelper.UpdateEventBounds; + end; +end; + +procedure TcxSchedulerViewController.CloseInplaceEdit; +begin + if EditController.IsEditing then + begin + EditController.CloseEdit(True); + HitTest.Recalculate; + end; +end; + +function TcxSchedulerViewController.CreateResizeEventHelper: TcxEventSizingHelper; +begin + Result := TcxEventSizingHelper.Create(Scheduler); +end; + +function TcxSchedulerViewController.ConsiderHiddenEvents: Boolean; +begin + Result := True; +end; + +function TcxSchedulerViewController.CreateDragEventHelper: TcxDragEventHelper; +begin + Result := TcxDragEventHelper.Create(Scheduler); +end; + +function TcxSchedulerViewController.CreateNavigation: TcxSchedulerViewNavigation; +begin + Result := TcxSchedulerViewNavigation.Create(View); +end; + +procedure TcxSchedulerViewController.DoSchedulerDragOver(const P: TPoint; + AState: TDragState; var AAccept: Boolean); +begin + if Assigned(Scheduler.OnDragOver) then + Scheduler.OnDragOver(DragEvent, DragEvent, P.X, P.Y, AState, AAccept); +end; + +procedure TcxSchedulerViewController.DragOver(Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); +var + P: TPoint; +begin + Owner.MousePositionChanged(X, Y); + P := cxPoint(X, Y); + if Assigned(DragEventHelper) then + begin + if State = dsDragMove then + CheckNavigatorScrollArea(P); + if Accept then + DragEventHelper.DragOver(P, State, Accept); + DragEventHelper.UpdateHelperState(Accept); + end; + CheckScrollOnDragOver(P, State); +end; + +procedure TcxSchedulerViewController.EndDrag(Target: TObject; X, Y: Integer); +var + APos: TPoint; +begin + DoneNavigatorScrollArea; + if Assigned(DragEventHelper) then + try + APos := Scheduler.ScreenToClient(GetMouseCursorPos); + Owner.MousePositionChanged(APos.X, APos.Y); + FDragEventHelper.FTarget := Target; + FDragEventHelper.EndDrag(not Scheduler.IsDragCanceled); + finally + FreeAndNil(FDragEventHelper); + end; +end; + +function TcxSchedulerViewController.GetDragAndDropObjectClass: TcxDragAndDropObjectClass; +begin + Result := TcxSchedulerDragAndDropObject; +end; + +function TcxSchedulerViewController.GetResourceReadOnly: Boolean; +begin + with Scheduler do + Result := not StorageValid or + ((SelResource <> nil) and SelResource.ReadOnly) or + ((Storage.ResourceCount > 0) and ((SelResource = nil) and not OptionsView.ShowEventsWithoutResource)); +end; + +function TcxSchedulerViewController.IsCaptionAvailable: Boolean; +begin + Result := Scheduler.StorageValid and Scheduler.Storage.IsCaptionAvailable; +end; + +function TcxSchedulerViewController.IsCopyDragDrop: Boolean; +begin + Result := Scheduler.IsCopyDragDrop; +end; + +function TcxSchedulerViewController.IsDragOperation: Boolean; +begin + Result := Scheduler.Dragging or (Scheduler.DragAndDropState <> ddsNone); +end; + +procedure TcxSchedulerViewController.KeyDown( + var Key: Word; Shift: TShiftState); +begin + if View.Active and not EditController.IsEditing then + begin + if Navigation.IsKeyNavigation(Key, Shift) then + begin + Scheduler.BeginUpdate; + try + UnselectEvents; + Navigation.DoKeyDown(Key, Shift); + finally + Scheduler.EndUpdate; + Scheduler.Update; + end; + end; + case Key of + VK_ESCAPE: + if Scheduler.CaptureController = Self then + UnselectEvents; + VK_TAB: + SelectNextEvent(not (ssShift in Shift)); + VK_DELETE, VK_INSERT: + if not Scheduler.ClipboardController.KeyDown(Key, Shift) and (Key = VK_DELETE) then + DeleteSelectedEvents; + VK_SHIFT: + FStartSelAnchor := Scheduler.FSelStart; + end; + end; + inherited KeyDown(Key, Shift); +end; + +procedure TcxSchedulerViewController.KeyPress(var Key: Char); +var + AEvent: TcxSchedulerControlEvent; +begin + with Scheduler do + begin + if IsLocked or not StorageActive or GetResourceReadOnly or + Scheduler.ClipboardController.KeyPress(Key) then Exit; + if Key in EditStartChars then + begin + if Key = #13 then + begin + if SelectedEventCount > 0 then + begin + AEvent := SelectedEvents[SelectedEventCount - 1]; + if CanShowEventDialog then + EditEventUsingDialog(AEvent); + end + else + begin + if CanCreateEventUsingInplaceEdit then + CreateEventUsingInplaceEdit + else + if CanCreateEventUsingDialog then + CreateEventUsingDialog; + end; + end + else + if CanCreateEventUsingInplaceEdit then + DoCreateEventUsingInplaceEdit(Key); + end; + end; +end; + +procedure TcxSchedulerViewController.MouseDown( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + AEvent: TcxSchedulerControlEvent; +begin + CloseInplaceEdit; + if HitTest.HitAtEvent then + begin + AEvent := HitTest.Event; + FBeforeFocusedEvent := AEvent; + UpdateEventSelection(AEvent, Button, Shift); + if Shift = [ssLeft, ssDouble] then + ShowEventEditor(AEvent) + else + View.Refresh; + end + else + if Button = mbLeft then + begin + UnselectEvents; + if HitTest.HitAtTime then + begin + FStartSelAnchor := HitTest.Time; + if HitTest.Resource = nil then + Navigation.SetSelAnchor(HitTest.Time, Shift) + else + Navigation.SetSelAnchor(HitTest.Time, Shift, HitTest.Resource); + if (Shift = [ssLeft, ssDouble]) and CanCreateEventUsingDialog then + Scheduler.CreateEventUsingDialog; + end; + end; + inherited MouseDown(Button, Shift, X, Y); +end; + +procedure TcxSchedulerViewController.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + if CanProcessMouseMove and (ssLeft in Shift) and not EditController.IsEditing then + begin + if (DragKind = edkNone) and HitTest.HitAtTime then + begin + if Navigation.SelResource = HitTest.Resource then + begin +// fix: AB15749 +// if FStartSelAnchor <> NullDate then +// Scheduler.FSelStart := FStartSelAnchor; + Navigation.SetSelAnchor(HitTest.Time, [ssShift] + Shift) + end + else + Navigation.SetSelAnchor(Scheduler.FSelStart, [ssShift] + Shift); + end; + end; +end; + +procedure TcxSchedulerViewController.MouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + CheckOpenInplaceEditorOnMouseUp(Button, Shift, X, Y); + FStartSelAnchor := NullDate; + FDragKind := edkNone; +end; + +procedure TcxSchedulerViewController.RecreateNavigation; +begin + FNavigation.Free; + FNavigation := CreateNavigation; + FNavigation.CheckSelection; +end; + +procedure TcxSchedulerViewController.SelectNextEvent(AForward: Boolean); + + procedure GetNextSelectedIndex(var AIndex: Integer); + begin + if AForward then + Inc(AIndex) + else + Dec(AIndex); + end; + +var + I, ASelectedIndex: Integer; +begin + if Scheduler.EventList.Count = 0 then + Exit; + with Scheduler do + begin + ASelectedIndex := -1; + for I := 0 to EventList.Count - 1 do + if EventList[I].Selected then + ASelectedIndex := I; + GetNextSelectedIndex(ASelectedIndex); + if ASelectedIndex < -1 then + ASelectedIndex := EventList.Count - 1; + while (ASelectedIndex < EventList.Count) and (ASelectedIndex >= 0) and + not CurrentView.GetEventVisibility(EventList[ASelectedIndex]) do + GetNextSelectedIndex(ASelectedIndex); + if (ASelectedIndex < EventList.Count) and (ASelectedIndex >= 0) then + SelectSingleEvent(EventList[ASelectedIndex], NullDate) + else + UnselectEvents; + CurrentView.Refresh; + end; +end; + +procedure TcxSchedulerViewController.StartDrag(var DragObject: TDragObject); +begin + InitNavigatorScrollArea; + FDragEventHelper := CreateDragEventHelper; + if FDragEventHelper <> nil then + FDragEventHelper.FDragObject := DragObject; +end; + +function TcxSchedulerViewController.StartDragAndDrop(const P: TPoint): Boolean; +begin + Result := (DragKind in [edkResizeStart, edkResizeEnd]) and + Scheduler.DoBeforeSizingEvent(DragEvent, P.X, P.Y); +end; + +procedure TcxSchedulerViewController.SyncEventSelection( + AEvent: TcxSchedulerControlEvent); +begin + if View.GetTimeIncrement = 1 then + Scheduler.ReplaceSelParams(DateOf(AEvent.Start), + DateOf(AEvent.Finish) - Byte(AEvent.AllDayEvent or + (TimeOf(AEvent.Finish) = 0)) * View.GetTimeIncrement, AEvent.GetResourceItem) + else + begin + if AEvent.Start <> AEvent.Finish then + Scheduler.ReplaceSelParams(AEvent.Start, + AEvent.Finish - View.GetTimeIncrement, AEvent.GetResourceItem) + else + Scheduler.ReplaceSelParams(AEvent.Start, + AEvent.Finish, AEvent.GetResourceItem); + end; +end; + +procedure TcxSchedulerViewController.UnselectEvents; +begin + Scheduler.UnselectEvents +end; + +procedure TcxSchedulerViewController.UpdateEventSelection( + AEvent: TcxSchedulerControlEvent; Button: TMouseButton; Shift: TShiftState); +begin + if AEvent = nil then Exit; + with Scheduler.EventList.Selection do + if (Button = mbRight) and (Shift * [ssCtrl, ssShift] <> [])then + begin + if not IsSelected(AEvent) then + Add(AEvent, [ssCtrl]); + end + else + Add(AEvent, Shift); + SyncEventSelection(AEvent); +end; + +procedure TcxSchedulerViewController.CheckNavigatorScrollArea(const APoint: TPoint); +var + ACode: TScrollCode; +begin + if PtInArea(FUpScrollArea, APoint, False) then + ACode := scLineDown + else + if PtInArea(FDownScrollArea, APoint, True) then + ACode := scLineUp + else + ACode := scEndScroll; + NavigatorTimer.Tag := Byte(ACode); + if not NavigatorTimer.Enabled then + NavigatorTimer.Interval := cxNavigatorStartTimer; + NavigatorTimer.Enabled := ACode <> scEndScroll; +end; + +procedure TcxSchedulerViewController.DoneNavigatorScrollArea; +begin + NavigatorTimer.OnTimer := nil; + FUpScrollArea := cxNullRect; + FDownScrollArea := cxNullRect; +end; + +procedure TcxSchedulerViewController.InitNavigatorScrollArea; +begin + if Scheduler.ResourceNavigator.NeedScrollBar then + begin + FUpScrollArea := TcxSchedulerCustomView(Owner).GetViewContentRect; + FDownScrollArea := FUpScrollArea; + if Scheduler.ResourceNavigator.ScrollBarKind = sbHorizontal then + begin + FUpScrollArea.Left := FUpScrollArea.Right - cxScrollZoneSize; + FDownScrollArea.Right := FDownScrollArea.Left + cxScrollZoneSize; + end + else + begin + FDownScrollArea.Bottom := FDownScrollArea.Top + cxScrollZoneSize; + FUpScrollArea.Top := FUpScrollArea.Bottom - cxScrollZoneSize; + end; + NavigatorTimer.OnTimer := NavigatorTimerHandler; + end +end; + +procedure TcxSchedulerViewController.NavigatorTimerHandler(Sender: TObject); +var + APos: Integer; + APoint: TPoint; + ACode: TScrollCode; +begin + APoint := cxPointOffset(Scheduler.ScreenToClient(GetMouseCursorPos), + -View.Left, -View.Top); + if not PtInRect(View.ClientRect, APoint) then Exit; + ACode := TScrollCode(NavigatorTimer.Tag); + APos := Scheduler.ResourceNavigator.FirstVisibleResourceIndex; + Scheduler.ResourceNavigator.Scroll(ACode, APos); + if DragEventHelper <> nil then + DragEventHelper.Update; + Scheduler.Update; +end; + +function TcxSchedulerViewController.PtInArea( + const ARect: TRect; const P: TPoint; IsUpArea: Boolean): Boolean; +var + AHorz: Boolean; +begin + if not PtInRect(View.ClientRect, P) then + begin + Result := False; + Exit; + end; + Result := PtInRect(ARect, P); + if not Result then + begin + AHorz := Scheduler.ResourceNavigator.ScrollBarKind = sbHorizontal; + if IsUpArea then + Result := (AHorz and (P.X < ARect.Left)) or + (not AHorz and (P.Y < ARect.Top)) + else + Result := (AHorz and (P.X > ARect.Right)) or + (not AHorz and (P.Y > ARect.Bottom)) + end; +end; + +procedure TcxSchedulerViewController.EditShowingTimerHandler(Sender: TObject); +begin + StopEditShowingTimer; + EditController.Activate(FEditShowingTimerItem); +end; + +function TcxSchedulerViewController.GetHitTest: TcxSchedulerViewHitTest; +begin + Result := View.HitTest; +end; + +function TcxSchedulerViewController.GetEditController: TcxSchedulerEditController; +begin + Result := Scheduler.EditController; +end; + +function TcxSchedulerViewController.GetIsEditing: Boolean; +begin + Result := EditController.IsEditing; +end; + +function TcxSchedulerViewController.GetNavigatorTimer: TTimer; +begin + Result := Scheduler.ResourceNavigator.Timer; +end; + +function TcxSchedulerViewController.GetScheduler: TcxCustomScheduler; +begin + Result := Owner.Scheduler; +end; + +function TcxSchedulerViewController.GetView: TcxSchedulerCustomView; +begin + Result := TcxSchedulerCustomView(inherited Owner); +end; + +procedure TcxSchedulerViewController.ShowEventEditor( + AEvent: TcxSchedulerControlEvent); +begin + StopEditShowingTimer; + if CanShowEventDialog then + Scheduler.EditEventUsingDialog(AEvent); +end; + +procedure TcxSchedulerViewController.StartEditShowingTimer( + AEvent: TcxSchedulerControlEvent); +begin + StopEditShowingTimer; + FEditShowingTimerItem := AEvent; + FEditShowingTimer := TTimer.Create(nil); + FEditShowingTimer.Interval := GetDblClickInterval; + FEditShowingTimer.OnTimer := EditShowingTimerHandler; +end; + +procedure TcxSchedulerViewController.StopEditShowingTimer; +begin + FreeAndNil(FEditShowingTimer); +end; + +{ TcxEventSizingHelper } + +procedure TcxEventSizingHelper.BeginDrag; +begin + inherited BeginDrag; + if IsValidTime then + begin + UpdateEventBounds; + CalculateConflicts; + end; +end; + +procedure TcxEventSizingHelper.DragOver(const P: TPoint; + State: TDragState; var Accepted: Boolean); +begin + Accepted := IsValidTime; + if HasChangedState and Accepted then + begin + UpdateEventBounds; + CalculateConflicts; + end; + Controller.CheckScrolling(P); +end; + +procedure TcxEventSizingHelper.EndDrag(Accepted: Boolean); +begin + if Accepted and not HasConflicts then + begin + SetSelection; + Events.PostEvent(Event); + end + else + Scheduler.FullRefresh; +end; + +function TcxEventSizingHelper.GetDragCursor(Accepted: Boolean): TCursor; +const + Cursors: array[Boolean] of TCursor = (crNoDrop, crSchedulerHorzResize); +begin + Result := Cursors[not HasConflicts]; +end; + +function TcxEventSizingHelper.IsValidTime: Boolean; +begin + with HitTest do + Result := HitAtTime and (not HitAtResource or (FStartResource = Resource)); +end; + +procedure TcxEventSizingHelper.CalcAllDayEvent; +begin +end; + +function TcxEventSizingHelper.GetFinishTime: TDateTime; +begin + Result := HitTest.Time; +end; + +function TcxEventSizingHelper.GetStartTime: TDateTime; +begin + Result := HitTest.Time; +end; + +procedure TcxEventSizingHelper.UpdateEventBounds; +var + AValue: TDateTime; +begin + CalcAllDayEvent; + case Controller.DragKind of + edkResizeStart: + begin + AValue := GetStartTime; + if AValue > Event.Finish - Ord(Event.AllDayEvent) then + AValue := Event.Finish - Ord(Event.AllDayEvent); + Event.Start := AValue; + end; + edkResizeEnd: + begin + AValue := GetFinishTime; + if AValue < Event.Start then + AValue := Event.Start; + Event.Finish := AValue + Ord(Event.AllDayEvent); + end; + end; + RefreshCurrentView; +end; + +function TcxEventSizingHelper.GetEvent: TcxSchedulerControlEvent; +begin + Result := TcxSchedulerViewController(Controller).DragEvent; +end; + +function TcxEventSizingHelper.GetHitTest: TcxSchedulerViewHitTest; +begin + Result := TcxSchedulerViewHitTest(inherited HitTest); +end; + +{ TcxSchedulerDragAndDropObject } + +constructor TcxSchedulerDragAndDropObject.Create(AControl: TcxControl); +begin + inherited Create(AControl); + FScheduler := AControl as TcxCustomScheduler; + Controller.DragAndDropObject := Self; +end; + +destructor TcxSchedulerDragAndDropObject.Destroy; +begin + Controller.DragAndDropObject := nil; + inherited Destroy; +end; + +procedure TcxSchedulerDragAndDropObject.BeginDragAndDrop; +begin + inherited BeginDragAndDrop; + FSizingHelper := Controller.CreateResizeEventHelper; +end; + +procedure TcxSchedulerDragAndDropObject.DragAndDrop(const P: TPoint; + var Accepted: Boolean); +var + AP: TPoint; +begin + if Assigned(FSizingHelper) then + begin + AP := P; + Controller.Owner.MousePositionChanged(AP.X, AP.Y); + HitTest.HitPoint := AP; + SizingHelper.DragOver(AP, dsDragMove, Accepted); + SizingHelper.UpdateHelperState(Accepted); + end; + inherited DragAndDrop(P, Accepted); +end; + +procedure TcxSchedulerDragAndDropObject.EndDragAndDrop(Accepted: Boolean); +var + AP: TPoint; +begin + if Assigned(SizingHelper) then + try + AP := CurMousePos; + Controller.Owner.MousePositionChanged(AP.X, AP.Y); + HitTest.HitPoint := AP; + Scheduler.DoAfterSizingEvent(SizingHelper.Event, AP.X, AP.Y, Accepted); + SizingHelper.EndDrag(Accepted); + finally + FreeAndNil(FSizingHelper); + end; + inherited EndDragAndDrop(Accepted); +end; + +function TcxSchedulerDragAndDropObject.GetController: TcxSchedulerViewController; +begin + Result := FScheduler.CurrentView.Controller; +end; + +function TcxSchedulerDragAndDropObject.GetDragAndDropCursor( + Accepted: Boolean): TCursor; +begin + if Assigned(FSizingHelper) then + Result := SizingHelper.GetDragCursor(Accepted) + else + Result := inherited GetDragAndDropCursor(Accepted); +end; + +function TcxSchedulerDragAndDropObject.GetHitTest: TcxSchedulerViewHitTest; +begin + Result := FScheduler.CurrentView.HitTest; +end; + +{ TcxSchedulerHintController } + +constructor TcxSchedulerHintController.Create(AOwner: TcxCustomScheduler); +begin + FOwner := AOwner; + FTimer := TTimer.Create(nil); + FTimer.Enabled := False; + FTimer.OnTimer := TimerHandler; + FHintWindow := HintWindowClass.Create(nil); +end; + +destructor TcxSchedulerHintController.Destroy; +begin + Hide; + FreeAndNil(FTimer); + FreeAndNil(FHintWindow); + inherited Destroy; +end; + +procedure TcxSchedulerHintController.Activate(const AHintRect: TRect; + const AHintText: string; AImmediateHint: Boolean = False; AAutoHide: Boolean = True); +begin + Hide; + FHintText := AHintText; + FHintRect := AHintRect; + FAutoHide := AAutoHide; + if AImmediateHint then + ShowHint + else + StartShowHintTimer; +end; + +function TcxSchedulerHintController.CalcHintRect(AMaxWidth: Integer; + const AHintText: string; AFlags: Integer): TRect; +begin + CheckHintClass; + FHintFlags := AFlags; + Result := FHintWindow.CalcHintRect(AMaxWidth, AHintText, nil); +end; + +procedure TcxSchedulerHintController.Hide; +begin + HideHint; +end; + +procedure TcxSchedulerHintController.Reset; +begin + Hide; +end; + +procedure TcxSchedulerHintController.MouseLeave; +begin + Scheduler.MouseLeave(Scheduler); +end; + +function TcxSchedulerHintController.CanShowHint: Boolean; +begin + Result := not FLockHint and Application.Active and Scheduler.OptionsView.ShowHints; +end; + +procedure TcxSchedulerHintController.CheckHintClass; +begin + if FHintWindow.ClassType <> HintWindowClass then + begin + FHintWindow.Free; + FHintWindow := HintWindowClass.Create(nil); + end; +end; + +procedure TcxSchedulerHintController.HideHint; +begin + StopTimer; + if not Showing then Exit; + EndMouseTracking(Self); + FHintWindow.Hide; + ShowWindow(FHintWindow.Handle, SW_HIDE); //MUST USE ShowWindow - WIN32 BUG + FShowing := False; +end; + +procedure TcxSchedulerHintController.ShowHint; +begin + HideHint; + if not CanShowHint then Exit; + CheckHintClass; + FHintWindow.Color := clInfoBk; + with GetMouseCursorPos do + begin + if FAutoHide then + begin + FHintRect := cxRectOffset(FHintRect, X, Y); + if FHintFlags and cxAlignRight = cxAlignRight then + FHintRect := cxRectSetRight(FHintRect, X); + if FHintFlags and cxAlignBottom = cxAlignBottom then + FHintRect := cxRectSetTop(FHintRect, Y + cxGetCursorSize.cy); + end; + end; + FHintWindow.ActivateHint(FHintRect, FHintText); + BeginMouseTracking(Scheduler, Scheduler.ClientBounds, Self); + FShowing := True; + if FAutoHide then StartHideHintTimer; +end; + +procedure TcxSchedulerHintController.StartHideHintTimer; +begin + FTimer.Tag := 0; + FTimer.Interval := Application.HintHidePause; + FTimer.Enabled := True; +end; + +procedure TcxSchedulerHintController.StartShowHintTimer; +begin + FTimer.Tag := 1; + FTimer.Interval := Max(Application.HintShortPause, 1); + FTimer.Enabled := True; +end; + +procedure TcxSchedulerHintController.StopTimer; +begin + FTimer.Enabled := False; +end; + +procedure TcxSchedulerHintController.TimerHandler(Sender: TObject); +begin + if FTimer.Tag = 0 then + HideHint + else + ShowHint; +end; + +{ TcxSchedulerEventHitTestController } + +constructor TcxSchedulerEventHitTestController.Create( + AOwner: TcxCustomScheduler); +begin + FOwner := AOwner; +end; + +procedure TcxSchedulerEventHitTestController.HideEventHint; +begin + if FPrevHintEvent <> nil then + begin + HintController.HideHint; + FPrevHintEvent := nil; + end; +end; + +procedure TcxSchedulerEventHitTestController.MouseMove( + X, Y: Integer; AShift: TShiftState); +var + R: TRect; + AHintText: string; +begin + if Scheduler.IsDesigning then Exit; + HitTest.HitPoint := Point(X, Y); + if ((ssLeft in AShift) or not HitTest.HitAtEvent) {and HintController.ViewMode} then + begin + HideEventHint; + Exit; + end; + if HitTest.HitAtEvent and (FPrevHintEvent <> HitTest.Event) then + begin + HitTest.FNeedShowHint := Scheduler.NeedShowHint(HitTest.Event, AHintText, HitTest.NeedShowHint); + if HitTest.NeedShowHint then + begin + FPrevHintEvent := HitTest.Event; + R := HintController.CalcHintRect(Max(cxscMinHintWidth, + cxRectWidth(HitTest.FEventBounds)), AHintText, cxAlignBottom); + HintController.Activate(R, AHintText); + end + else + HideEventHint; + if Scheduler.OptionsView.HotTrack then + Scheduler.CurrentView.InvalidateRect(HitTest.FEventBounds); + end; +end; + +function TcxSchedulerEventHitTestController.GetHintController: TcxSchedulerHintController; +begin + Result := Scheduler.HintController; +end; + +function TcxSchedulerEventHitTestController.GetHitTest: TcxSchedulerViewHitTest; +begin + Result := Scheduler.CurrentView.HitTest; +end; + +{ TcxSchedulerCustomView } + +constructor TcxSchedulerCustomView.Create(AOwner: TcxCustomScheduler); +begin + inherited Create(AOwner); + FVisible := False; + FCanShow := True; +end; + +procedure TcxSchedulerCustomView.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerCustomView then + with TcxSchedulerCustomView(Source) do + begin + Self.CanShow := CanShow; + Self.Active := Active; + end; + inherited Assign(Source); +end; + +function TcxSchedulerCustomView.CanDeactivateOnDateNavigatorSelectionChange: Boolean; +begin + Result := True; +end; + +function TcxSchedulerCustomView.CanSelectPeriod: Boolean; +begin + Result := True; +end; + +function TcxSchedulerCustomView.CheckEventsVisibility: Boolean; +begin + Result := True; +end; + +function TcxSchedulerCustomView.CreateController: TcxSchedulerSubControlController; +begin + Result := TcxSchedulerViewController.Create(Self); +end; + +function TcxSchedulerCustomView.CreateHitTest: TcxSchedulerSubControlHitTest; +begin + Result := TcxSchedulerViewHitTest.Create(Self); +end; + +procedure TcxSchedulerCustomView.DateChanged; +begin + Refresh; +end; + +procedure TcxSchedulerCustomView.DeactivateView; +begin +end; + +procedure TcxSchedulerCustomView.DoLayoutChanged; +begin + TcxSchedulerCustomViewViewInfo(ViewInfo).FSelectedDays := Scheduler.SelectedDays; + TcxSchedulerCustomViewViewInfo(ViewInfo).FEvents := Scheduler.EventList; + inherited DoLayoutChanged; + Scheduler.UpdateScrollBars; +end; + +function TcxSchedulerCustomView.DoShowPopupMenu(X, Y: Integer): Boolean; +begin + Result := False; +end; + +function TcxSchedulerCustomView.EventContentSelected( + AEvent: TcxSchedulerControlEvent): Boolean; +begin + Result := True; +end; + +function TcxSchedulerCustomView.GetClientRect: TRect; +begin + Result := inherited GetClientRect; + if Scheduler.HScrollBarVisible then + Dec(Result.Bottom, Scheduler.HScrollBar.Height); + if Scheduler.VScrollBarVisible then + Dec(Result.Right, Scheduler.VScrollBar.Width); +end; + +function TcxSchedulerCustomView.GetControlCanvas: TcxCanvas; +begin + Result := Scheduler.GetInternalCanvas; +end; + +function TcxSchedulerCustomView.GetDateOffset: Integer; +begin + Result := 1 - Ord(OptionsView.ActualStartOfWeek); +end; + +function TcxSchedulerCustomView.GetDragObjectClass: TDragControlObjectClass; +begin + Result := TcxSchedulerDragObject; +end; + +function TcxSchedulerCustomView.GetGroupingKind: TcxSchedulerGroupingKind; +begin + Result := gkNone; +end; + +function TcxSchedulerCustomView.GetHScrollBarBounds: TRect; +begin + Result := ClientRect; + Result.Top := Result.Bottom; + Result.Bottom := Result.Top + Scheduler.HScrollBar.Height; + OffsetRect(Result, Bounds.Left, Bounds.Top); + with Scheduler.ResourceNavigator do + begin + if NeedScrollBar and (ScrollBarKind = sbHorizontal) then + Inc(Result.Left, MeasureWidth); + end; +end; + +function TcxSchedulerCustomView.GetEditRectForEvent( + AEvent: TcxSchedulerControlEvent; const ADate: TDateTime; + AResource: TcxSchedulerStorageResourceItem): TRect; +begin + Result := cxNullRect; +end; + +function TcxSchedulerCustomView.GetEditStyle( + AEvent: TcxSchedulerControlEvent): TcxCustomEditStyle; +begin + Result := Scheduler.EditStyle; +end; + +function TcxSchedulerCustomView.GetEditProperties( + AEvent: TcxSchedulerControlEvent): TcxCustomEditProperties; +begin + Scheduler.DoGetEventEditProperties(AEvent, Result); +end; + +function TcxSchedulerCustomView.GetEditWithSingleLineEditor( + AEvent: TcxSchedulerControlEvent): Boolean; +begin + Result := True; +end; + +function TcxSchedulerCustomView.GetEventHintText(AEvent: TcxSchedulerControlEvent): string; +begin + Result := Scheduler.GetEventHintText(AEvent); +end; + +function TcxSchedulerCustomView.GetEventVisibility( + AEvent: TcxSchedulerControlEvent): Boolean; +begin + Result := False; +end; + +function TcxSchedulerCustomView.GetFirstVisibleDate: TDateTime; +begin + if SelectedDays.Count = 0 then + Result := Date + else + Result := Integer(SelectedDays.First) +end; + +function TcxSchedulerCustomView.GetFirstVisibleTime: TDateTime; +begin + Result := 0; +end; + +function TcxSchedulerCustomView.GetLastVisibleDate: TDateTime; +begin + if SelectedDays.Count = 0 then + Result := Date + else + Result := Integer(SelectedDays.Last) +end; + +function TcxSchedulerCustomView.GetLastVisibleTime: TDateTime; +begin + Result := 1 - 1 / 24 / 60; +end; + +function TcxSchedulerCustomView.GetSizeGripBounds: TRect; +begin + with Result do + begin + Left := Scheduler.VScrollBar.Left; + Right := Left + Scheduler.VScrollBar.Width; + Top := Scheduler.HScrollBar.Top; + Bottom := Top + Scheduler.HScrollBar.Height; + end; +end; + +function TcxSchedulerCustomView.GetSchedulerLookAndFeel( + ADialogs: Boolean = False): TcxLookAndFeel; +begin + if ADialogs then + Result := Scheduler.DialogsLookAndFeel + else + Result := Scheduler.LookAndFeel; +end; + +function TcxSchedulerCustomView.GetScrollTimeHint: string; +var + H, M, S, MS: Word; +begin + DecodeTime(GetFirstVisibleTime, H, M, S, MS); + Result := Format('%.2d:%.2d', [H, M]); + DecodeTime(GetLastVisibleTime, H, M, S, MS); + Result := Result + ' - ' + Format('%.2d:%.2d', [H, M]); +end; + +function TcxSchedulerCustomView.GetTimeIncrement: TDateTime; +begin + Result := 1; +end; + +function TcxSchedulerCustomView.GetVScrollBarBounds: TRect; +begin + Result := ClientRect; + Result.Left := Result.Right; + Result.Right := Result.Left + Scheduler.VScrollBar.Width; + OffsetRect(Result, Bounds.Left, Bounds.Top); + with Scheduler.ResourceNavigator do + begin + if NeedScrollBar and (ScrollBarKind = sbVertical) then + Dec(Result.Bottom, MeasureHeight); + end; +end; + +function TcxSchedulerCustomView.GetViewContentRect: TRect; +begin + Result := ClientRect; +end; + +function TcxSchedulerCustomView.GetVisibleDaysRange: Integer; +begin + Result := 31; +end; + +procedure TcxSchedulerCustomView.InitEventBySelectedTime( + AEvent: TcxSchedulerEvent; AllDay: Boolean; + ARecurrence: Boolean; AInplaceEditing: Boolean); +var + AIsAllDaySelection: Boolean; +begin + AIsAllDaySelection := IsAllDaySelection; + AEvent.Start := Scheduler.SelStart; + AEvent.AllDayEvent := AllDay or AIsAllDaySelection; + if AllDay and not AIsAllDaySelection then + AEvent.Finish := DateOf(Scheduler.SelFinish) + 1 + else + AEvent.Finish := Scheduler.SelFinish; +end; + +function TcxSchedulerCustomView.IsAllDaySelection: Boolean; +var + AStart, AFinish, H, M, S, MS: Word; +begin + if DateOf(Scheduler.SelFinish - Scheduler.SelStart) >= 1 then + begin + DecodeTime(Scheduler.SelStart, H, M, S, MS); + AStart := H * 60 + M; + DecodeTime(Scheduler.SelFinish, H, M, S, MS); + AFinish := H * 60 + M; + Result := (AStart = 0) and (AFinish = 0); + end + else + Result := False; +end; + +function TcxSchedulerCustomView.IsDayView: Boolean; +begin + Result := False; +end; + +function TcxSchedulerCustomView.IsInplaceEditingEnabled: Boolean; +begin + Result := True; +end; + +function TcxSchedulerCustomView.IsShowResources: Boolean; +begin + Result := Scheduler.HasResources; +end; + +function TcxSchedulerCustomView.IsWorkTime( + AResourceItem: TcxSchedulerStorageResourceItem; + const ADateTime: TDateTime): Boolean; +begin + Result := Scheduler.DoIsWorkTime(AResourceItem, ADateTime); +end; + +procedure TcxSchedulerCustomView.MakeEventVisible( + AEvent: TcxSchedulerControlEvent; const ADate: TDateTime; + AResource: TcxSchedulerStorageResourceItem); +begin +end; + +procedure TcxSchedulerCustomView.PeriodChanged; +begin + Scheduler.ValidateSelection(SelectedDays); +end; + +procedure TcxSchedulerCustomView.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +begin + DoScaleScroll; + if AScrollBarKind = sbHorizontal then + Scheduler.HScrollBar.Position := AScrollPos + else + Scheduler.VScrollBar.Position := AScrollPos; +end; + +procedure TcxSchedulerCustomView.ScrollSelectedDays(AScrollDelta: Integer); +begin + Scheduler.DateNavigator.ScrollSelection(AScrollDelta); +end; + +procedure TcxSchedulerCustomView.ScrollSelectedDays(AForward: Boolean; + ANeedDate: TDateTime; AIsByPage: Boolean); +begin + Scheduler.DateNavigator.ScrollSelection(AForward, ANeedDate, AIsByPage); +end; + +procedure TcxSchedulerCustomView.ScrollVisibleDays( + AScrollUp: Boolean); +begin +end; + +procedure TcxSchedulerCustomView.SelectedDaysChanged; +begin +end; + +function TcxSchedulerCustomView.ShowTaskComplete: Boolean; +begin + Result := False; +end; + +procedure TcxSchedulerCustomView.TimeChanged; +begin +end; + +procedure TcxSchedulerCustomView.UpdateDateNavigatorSelection; +begin + Scheduler.DateNavigator.MakeSelectionVisible; +end; + +procedure TcxSchedulerCustomView.ValidateContentPopupMenuItems( + var AItems: TcxSchedulerContentPopupMenuItems); +begin +end; + +procedure TcxSchedulerCustomView.ValidateSelectionFinishTime( + var ADateTime: TDateTime); +begin +end; + +procedure TcxSchedulerCustomView.VisibleChanged; +begin + if Visible and not CanShow then + Visible := False + else + Scheduler.ViewVisibleChanged(Self) +end; + +procedure TcxSchedulerCustomView.HideHintOnScroll(AScrollCode: TScrollCode); +begin + Scheduler.HintController.HideHint; + if AScrollCode = scEndScroll then + FCalculatedHintBounds := False; +end; + +procedure TcxSchedulerCustomView.ShowHintOnScroll(const ADate: TDateTime); +begin + with Scheduler.ResourceNavigator do + begin + if NeedScrollBar and (ScrollBarKind = sbHorizontal) then + ShowHintOnScroll(DateTimeToStr(ADate), sbVertical) + else + ShowHintOnScroll(DateTimeToStr(ADate), sbHorizontal); + end; +end; + +procedure TcxSchedulerCustomView.ShowHintOnScroll( + const AHintText: string; AScrollBarKind: TScrollBarKind); +var + R: TRect; +begin + with Scheduler do + begin + R := HintController.CalcHintRect(cxscMinHintWidth, AHintText, cxAlignRight); + if not CalculatedHintBounds then + begin + if AScrollBarKind = sbVertical then + begin + R := cxRectSetRight(R, ClientToScreen(VScrollBar.BoundsRect.TopLeft).X - 5); + R := cxRectSetTop(R, GetMouseCursorPos.Y); + end + else + begin + R := cxRectSetBottom(R, ClientToScreen(HScrollBar.BoundsRect.TopLeft).Y - 5); + R := cxRectSetLeft(R, GetMouseCursorPos.X); + end; + end + else R := cxRectCenter(HintController.FHintRect, R.Right, R.Bottom); + HintController.Activate(R, AHintText, True, False); + end; + FCalculatedHintBounds := True; +end; + +function TcxSchedulerCustomView.GetActive: Boolean; +begin + Result := Visible; +end; + +function TcxSchedulerCustomView.GetCanShow: Boolean; +begin + Result := FCanShow; + Scheduler.DoCanShowView(Self, Result); +end; + +function TcxSchedulerCustomView.GetController: TcxSchedulerViewController; +begin + Result := TcxSchedulerViewController(inherited Controller); +end; + +function TcxSchedulerCustomView.GetDragCloneEventList: TcxSchedulerFilteredEventList; +begin + if Assigned(Controller.DragEventHelper) then + Result := Scheduler.EventList.Clones + else + Result := nil; +end; + +function TcxSchedulerCustomView.GetEventList: TcxSchedulerCachedEventList; +begin + Result := Scheduler.EventList; +end; + +function TcxSchedulerCustomView.GetHitTest: TcxSchedulerViewHitTest; +begin + Result := TcxSchedulerViewHitTest(inherited HitTest); +end; + +function TcxSchedulerCustomView.GetSelectedDays: TcxSchedulerDateList; +begin + Result := Scheduler.SelectedDays +end; + +function TcxSchedulerCustomView.GetOptionsView: TcxSchedulerOptionsView; +begin + Result := Scheduler.OptionsView; +end; + +function TcxSchedulerCustomView.GetResources: TcxSchedulerStorageResourceItems; +begin + if Scheduler.StorageValid then + Result := Scheduler.Storage.Resources.ResourceItems + else + Result := nil; +end; + +function TcxSchedulerCustomView.GetWorkDays: TDays; +begin + Result := OptionsView.WorkDays; +end; + +function TcxSchedulerCustomView.GetWorkFinish: TDateTime; +begin + Result := OptionsView.WorkFinish; +end; + +function TcxSchedulerCustomView.GetWorkStart: TDateTime; +begin + Result := OptionsView.WorkStart; +end; + +procedure TcxSchedulerCustomView.SetActive(AValue: Boolean); +begin + Visible := FCanShow and AValue; +end; + +procedure TcxSchedulerCustomView.SetCanShow(AValue: Boolean); +begin + if FCanShow <> AValue then + begin + FCanShow := AValue; + if not AValue then + Visible := False + else + begin + if not Scheduler.CurrentView.Visible then + Visible := True; + Changed; + end; + end; +end; + +{ TcxSchedulerCustomViewViewInfo } + +procedure TcxSchedulerCustomViewViewInfo.CheckResourceNavigator; +begin + ResourceNavigator.FScrollBarKind := GetResourceScrollBarKind; + ResourceNavigator.InitScrollBarsParameters; +end; + +function TcxSchedulerCustomViewViewInfo.GetResourceScrollBarKind: TScrollBarKind; +begin + Result := sbHorizontal; +end; + +function TcxSchedulerCustomViewViewInfo.DoGetEventDisplayText( + AEvent: TcxSchedulerControlEvent): string; +begin + Scheduler.DoGetEventDisplayText(AEvent, Result); +end; + +function TcxSchedulerCustomViewViewInfo.DoSchedulerMoreEventsButtonClick: Boolean; +begin + Result := Scheduler.DoMoreEventsButtonClick; +end; + +function TcxSchedulerCustomViewViewInfo.DoSchedulerNavigationButtonClick: Boolean; +begin + Result := Scheduler.DoNavigationButtonClick; +end; + +function TcxSchedulerCustomViewViewInfo.GetEventHint( + AEvent: TcxSchedulerControlEvent): string; +begin + Result := Scheduler.GetEventHintText(AEvent); +end; + +function TcxSchedulerCustomViewViewInfo.GetSchedulerEventsList: TcxSchedulerCachedEventList; +begin + Result := Scheduler.EventList; +end; + +procedure TcxSchedulerCustomViewViewInfo.SetEventsVisibility( + AShowSources, AShowClones: Boolean; AForceRepaint: Boolean = False); +begin +end; + +function TcxSchedulerCustomViewViewInfo.GetResourceNavigator: TcxSchedulerResourceNavigator; +begin + Result := Scheduler.ResourceNavigator; +end; + +function TcxSchedulerCustomViewViewInfo.GetScheduler: TcxCustomScheduler; +begin + Result := Owner.Scheduler; +end; + +{ TcxSchedulerCustomDataNavigator } + +constructor TcxSchedulerCustomDateNavigator.Create( + AOwner: TcxCustomScheduler); +begin + inherited Create(AOwner); + FSaveSelectionList := TcxSchedulerDateList.Create; +end; + +destructor TcxSchedulerCustomDateNavigator.Destroy; +begin + FSaveSelectionList.Free; + inherited Destroy; +end; + +procedure TcxSchedulerCustomDateNavigator.BeginUpdate; +begin + if FLockCount = 0 then + SaveState; + Inc(FLockCount); +end; + +procedure TcxSchedulerCustomDateNavigator.CancelUpdates; +begin + FLockCount := 0; +end; + +procedure TcxSchedulerCustomDateNavigator.EndUpdate; +begin + Dec(FLockCount); + if FLockCount <= 0 then + begin + FLockCount := 0; + CheckChanges; + end; +end; + +procedure TcxSchedulerCustomDateNavigator.BoundsChanging; +begin + BeginUpdate; + GetCalendarDimension(FPrevColCount, FPrevRowCount); +end; + +procedure TcxSchedulerCustomDateNavigator.BoundsChanged; +var + AColCount, ARowCount: Integer; +begin + inherited BoundsChanged; + if not Scheduler.BoundsChanging and Scheduler.SubControlsCreated then + begin + GetCalendarDimension(AColCount, ARowCount); + if AColCount * ARowCount <> FPrevColCount * FPrevRowCount then + Scheduler.FullRefresh; + end; + EndUpdate; +end; + +function TcxSchedulerCustomDateNavigator.CanMultiSelect: Boolean; +begin + Result := (Scheduler.CurrentView = nil) or + Scheduler.CurrentView.CanSelectPeriod; + if Result then + Result := Scheduler.CanSelectPeriod; +end; + +procedure TcxSchedulerCustomDateNavigator.CheckChanges; +var + I: Integer; + ACallEvent: Boolean; +begin + if (FSaveRealFirstDate <> GetRealFirstDate) or (FSaveRealLastDate <> GetRealLastDate) then + DoPeriodChangedEvent; + GetSelection.Changed := False; + ACallEvent := GetSelection.Count <> FSaveSelectionList.Count; + if not ACallEvent then + for I := 0 to FSaveSelectionList.Count - 1 do + if FSaveSelectionList[I] <> GetSelection[I] then + begin + ACallEvent := True; + break; + end; + if ACallEvent then + DoSelectionChangedEvent; + SaveState; +end; + +procedure TcxSchedulerCustomDateNavigator.CheckCurrentDate; +begin +end; + +function TcxSchedulerCustomDateNavigator.GetMonthSize: TSize; +begin + Result := cxNullSize; +end; + +function TcxSchedulerCustomDateNavigator.GetSelection: TcxSchedulerDateList; +begin + Result := Scheduler.SelectedDays; +end; + +function TcxSchedulerCustomDateNavigator.IsSchedulerLocked: Boolean; +begin + Result := Scheduler.AligningSubControls or Scheduler.IsLocked or + not Scheduler.HandleAllocated; +end; + +procedure TcxSchedulerCustomDateNavigator.Loaded; +begin + FSavedSize := Scheduler.GetDateNavigatorLoadedSize; +end; + +procedure TcxSchedulerCustomDateNavigator.PeriodChanged; +begin + Scheduler.DateNavigatorSelectionChanged; +end; + +procedure TcxSchedulerCustomDateNavigator.SaveSize; +begin + FSavedSize := cxSize(Width, Height); +end; + +procedure TcxSchedulerCustomDateNavigator.SaveState; +begin + FSaveSelectionList.Assign(GetSelection); + FSaveRealFirstDate := GetRealFirstDate; + FSaveRealLastDate := GetRealLastDate; +end; + +procedure TcxSchedulerCustomDateNavigator.ScrollSelection(AForward: Boolean; + ANeedDate: TDateTime; AIsByPage: Boolean); +begin + BeginUpdate; + try + DoScrollSelection(AForward, ANeedDate, AIsByPage); + finally + EndUpdate; + end; +end; + +procedure TcxSchedulerCustomDateNavigator.ScrollSelection(AScrollDelta: Integer); +begin + BeginUpdate; + try + DoScrollSelection(AScrollDelta); + finally + EndUpdate; + end; +end; + +function TcxSchedulerCustomDateNavigator.GetEventDays: TcxSchedulerDateList; +begin + Result := Scheduler.EventDays; +end; + +function TcxSchedulerCustomDateNavigator.GetHintController: TcxSchedulerHintController; +begin + Result := Scheduler.HintController; +end; + +function TcxSchedulerCustomDateNavigator.GetHolidayDays: TcxSchedulerDateList; +begin + Result := Scheduler.HolidayDays; +end; + +{ TcxSchedulerClipboardController } + +constructor TcxSchedulerClipboardController.Create(AScheduler: TcxCustomScheduler); +begin + RegisterClipboardFormat; + FScheduler := AScheduler; + FStream := TMemoryStream.Create; + FStreamReader := TcxReader.Create(FStream); + FStreamWriter := TcxWriter.Create(FStream); +end; + +destructor TcxSchedulerClipboardController.Destroy; +begin + FStream.Free; + FStreamReader.Free; + FStreamWriter.Free; + inherited Destroy; +end; + +function TcxSchedulerClipboardController.CanCopy: Boolean; +begin + Result := Scheduler.SelectedEventCount > 0; +end; + +function TcxSchedulerClipboardController.CanPaste: Boolean; +begin + Result := GetClipboardToStream; + if Result then + Result := ValidateStream; +end; + +procedure TcxSchedulerClipboardController.Copy; +begin + Clipboard.Clear; + try + if GetSelectionAsStream then + SetStreamToClipboard; + finally + Stream.Clear; + end; +end; + +procedure TcxSchedulerClipboardController.Cut; +begin + Copy; + if Scheduler.EventOperations.Deleting then + DeleteSelectedEvents; +end; + +procedure TcxSchedulerClipboardController.Paste; +var + AEvents: TcxSchedulerFilteredEventList; + Anchor: TDateTime; +begin + if GetClipboardToStream then + begin + AEvents := TcxSchedulerFilteredEventList.Create; + try + if GetStreamAsEvents(AEvents, Anchor) then + InsertEvents(AEvents, Anchor); + finally + AEvents.Free; + end; + end; +end; + +procedure TcxSchedulerClipboardController.DeleteSelectedEvents; +begin + Scheduler.DeleteSelectedEvents; +end; + +function TcxSchedulerClipboardController.GetClipboard: TClipboard; +begin + Result := Clipbrd.Clipboard; +end; + +function TcxSchedulerClipboardController.GetClipboardToStream: Boolean; +var + AData: THandle; + ADataPtr: Pointer; +begin + Result := IsClipboardFormatAvailable(CF_SCHEDULERDATA); + if not Result then Exit; + Clipboard.Open; + try + AData := GetClipboardData(CF_SCHEDULERDATA); + if AData = 0 then Exit; + ADataPtr := GlobalLock(AData); + Result := ADataPtr <> nil; + if not Result then Exit; + try + Stream.Size := GlobalSize(AData); + Stream.Position := 0; + Stream.Write(ADataPtr^, Stream.Size); + finally + GlobalUnlock(AData); + end; + finally + Clipboard.Close; + end; +end; + +function TcxSchedulerClipboardController.GetSelectionAsStream: Boolean; +var + I: Integer; + Anchor: TDateTime; +begin + Stream.Clear; + Result := Scheduler.SelectedEventCount > 0; + if not Result then Exit; + StreamWriter.WriteInteger(0); + StreamWriter.WriteInteger(Scheduler.SelectedEventCount); + Anchor := MaxInt; + for I := 0 to Scheduler.SelectedEventCount - 1 do + begin + if Anchor > Scheduler.SelectedEvents[I].Start then + Anchor := Scheduler.SelectedEvents[I].Start; + end; + StreamWriter.WriteDateTime(Anchor); + for I := 0 to Scheduler.SelectedEventCount - 1 do + SaveEvent(Scheduler.SelectedEvents[I]); + Stream.Position := 0; + StreamWriter.WriteInteger(Stream.Size); +end; + +function TcxSchedulerClipboardController.GetStreamAsEvents( + AEvents: TcxSchedulerFilteredEventList; var Anchor: TDateTime): Boolean; +var + ACount: Integer; + AEvent: TcxSchedulerControlEvent; +begin + Result := ValidateStream; + if Result then + try + ACount := StreamReader.ReadInteger; + Anchor := StreamReader.ReadDateTime; + while Stream.Position <> Stream.Size do + begin + RestoreEvent(AEvent); + AEvents.Add(AEvent); + end; + Result := (AEvents.Count > 0) and (AEvents.Count = ACount); + finally + Stream.Clear; + end; +end; + +procedure TcxSchedulerClipboardController.CalculateAnchorForResource( + AEvents: TcxSchedulerFilteredEventList; + const AResourceID: Variant; var Anchor: TDateTime); +var + I: Integer; + ANewAnchor: TDateTime; +begin + ANewAnchor := MaxInt; + for I := 0 to AEvents.Count - 1 do + if AEvents[I].IsSharedWithResource(AResourceID) and (ANewAnchor > AEvents[I].Start) then + ANewAnchor := AEvents[I].Start; + if ANewAnchor <> MaxInt then + Anchor := ANewAnchor; +end; + +procedure TcxSchedulerClipboardController.InsertEvents( + AEvents: TcxSchedulerFilteredEventList; Anchor: TDateTime); +var + I: Integer; + AEvent: TcxSchedulerControlEvent; + AllDayDuration: Boolean; + IsDifferenceResources: Boolean; +begin + if not Scheduler.EventOperations.Creating then Exit; + IsDifferenceResources := False; + for I := 1 to AEvents.Count - 1 do + begin + IsDifferenceResources := not VarEquals(AEvents[I - 1].ResourceID, AEvents[I].ResourceID); + if IsDifferenceResources then Break; + end; + if IsDifferenceResources and (Scheduler.SelResource <> nil) then + CalculateAnchorForResource(AEvents, Scheduler.SelResource.ResourceID, Anchor); + Anchor := Scheduler.SelStart - Anchor; + AllDayDuration := Round(Frac(Anchor) / MinuteToTime) = 0; + Storage.BeginUpdate; + try + for I := 0 to AEvents.Count - 1 do + begin + AEvent := AEvents[I]; + AEvent.MoveTo(AEvent.Start + Anchor); + AEvent.EventType := etNone; + if AEvent.AllDayEvent and not AllDayDuration then + begin + AEvent.AllDayEvent := False; + AEvent.Start := Scheduler.SelStart; + AEvent.Duration := 30 * MinuteToTime; + if AEvent.State = tlsFree then + AEvent.State := tlsBusy; + end; + if not IsDifferenceResources or (Scheduler.SelResource = nil) then + begin + if Scheduler.SelResource = nil then + AEvent.ResourceID := Null + else + AEvent.ResourceID := Scheduler.SelResource.ResourceID; + end; + if Scheduler.CanIntersect(AEvent) then + Storage.createEvent.Assign(AEvent) + end; + finally + Storage.EndUpdate; + end; +end; + +function TcxSchedulerClipboardController.KeyDown( + var AKey: Word; AShift: TShiftState): Boolean; +begin + Result := False; + case AKey of + VK_INSERT: + if [ssShift, ssCtrl] * AShift <> [] then + begin + if ssShift in AShift then + Paste + else + if ssCtrl in AShift then + Copy; + Result := True; + end; + VK_DELETE: + if ssShift in AShift then + begin + Cut; + Result := True; + end; + end; +end; + +function TcxSchedulerClipboardController.KeyPress(var AKey: Char): Boolean; +begin + Result := AKey in [^C, ^X, ^V]; + if Result then + begin + case AKey of + ^C: + Copy; + ^X: + Cut; + ^V: + Paste; + end; + AKey := #0; + end; +end; + +procedure TcxSchedulerClipboardController.RestoreEvent( + var AEvent: TcxSchedulerControlEvent); +var + I, ACount, ALastPos: Integer; +begin + ALastPos := StreamReader.ReadInteger; + if ALastPos <= Stream.Size then + begin + AEvent := TcxSchedulerControlEvent.Create(Storage); + ACount := StreamReader.ReadInteger; + if ACount > AEvent.ValueCount then + ACount := AEvent.ValueCount; + for I := 0 to ACount - 1 do + AEvent.Values[I] := StreamReader.ReadVariant; + AEvent.IsDataValid := False; + end; + Stream.Position := ALastPos; +end; + +procedure TcxSchedulerClipboardController.SaveEvent( + AEvent: TcxSchedulerControlEvent); +var + I, APos: Integer; +begin + APos := Stream.Position; + StreamWriter.WriteInteger(APos); + StreamWriter.WriteInteger(AEvent.ValueCount); + for I := 0 to AEvent.ValueCount - 1 do + StreamWriter.WriteVariant(AEvent.Values[I]); + Stream.Position := APos; + StreamWriter.WriteInteger(Stream.Size); + Stream.Position := Stream.Size; +end; + +procedure TcxSchedulerClipboardController.SetStreamToClipboard; +var + Data: THandle; + DataPtr: Pointer; +begin + if Stream.Size = 0 then Exit; + Clipboard.Open; + try + Data := GlobalAlloc(GMEM_MOVEABLE + GMEM_DDESHARE, Stream.Size); + try + DataPtr := GlobalLock(Data); + try + Stream.Position := 0; + Stream.ReadBuffer(DataPtr^, Stream.Size); + SetClipboardData(CF_SCHEDULERDATA, Data); + finally + GlobalUnlock(Data); + end; + except + GlobalFree(Data); + raise; + end; + finally + Clipboard.Close; + end; +end; + +function TcxSchedulerClipboardController.ValidateStream: Boolean; +var + APos, ACount, ASavedCount: Integer; +begin + Stream.Position := 0; + Result := (Stream.Size > SizeOf(Integer) * 2 + SizeOf(TDateTime)) and + (StreamReader.ReadInteger = Stream.Size); + if not Result then Exit; + ASavedCount := StreamReader.ReadInteger; + ACount := 0; + StreamReader.ReadDateTime; + while Stream.Position < (Stream.Size - SizeOf(Integer)) do + begin + APos := StreamReader.ReadInteger; + if APos <= Stream.Size then + begin + Stream.Position := APos; + Inc(ACount); + end + else + Break; + end; + Result := ASavedCount = ACount; + if Result then + Stream.Position := SizeOf(Integer); +end; + +function TcxSchedulerClipboardController.GetStorage: TcxCustomSchedulerStorage; +begin + Result := Scheduler.Storage; +end; + +procedure TcxSchedulerClipboardController.RegisterClipboardFormat; +begin + CF_SCHEDULERDATA := Windows.RegisterClipboardFormat(SCF_SCHEDULERCLIPBOARDFORMAT); +end; + +{ TcxSchedulerStyles } + +constructor TcxSchedulerStyles.Create(AOwner: TPersistent); +begin + if AOwner is TcxCustomScheduler then + FScheduler := TcxCustomScheduler(AOwner); + inherited Create(AOwner); + BitmapInViewParams := True; +end; + +procedure TcxSchedulerStyles.Assign(Source: TPersistent); +var + I: Integer; +begin + if Source is TcxSchedulerStyles then + begin + for I := 0 to cxcsMaxValue do + SetValue(I, TcxSchedulerStyles(Source).GetValue(I)) + end; + inherited Assign(Source); +end; + +function TcxSchedulerStyles.GetBackgroundParams: TcxViewParams; +begin + GetViewParams(cxcsBackground, nil, nil, Result); +end; + +function TcxSchedulerStyles.GetContentParams(const ADateTime: TDateTime; + AResource: TcxSchedulerStorageResourceItem = nil): TcxViewParams; +begin + Result := GetContentParams( + ADateTime, Scheduler.DoIsWorkTime(AResource, ADateTime), AResource); +end; + +function TcxSchedulerStyles.GetContentParams(const ADateTime: TDateTime; + ALightColor: Boolean; AResource: TcxSchedulerStorageResourceItem = nil): TcxViewParams; +var + AStyle: TcxStyle; +begin + AStyle := nil; + if Assigned(FOnGetContentStyle) then + FOnGetContentStyle(Scheduler, AResource, ADateTime, AStyle); + GetViewParams(cxcsContent, AResource, AStyle, Result); + Result.Color := PainterHelper.GetContentColor(Result.Color, ALightColor); +end; + +function TcxSchedulerStyles.GetEventContentParams( + AEvent: TcxSchedulerEvent): TcxViewParams; +var + AStyle: TcxStyle; +begin + AStyle := nil; + if Assigned(OnGetEventStyle) then + OnGetEventStyle(Scheduler, AEvent, AStyle); + GetViewParams(cxcsEvent, AEvent, AStyle, Result); +end; + +function TcxSchedulerStyles.IsEventStyleAssigned( + AEvent: TcxSchedulerEvent): Boolean; +var + AStyle: TcxStyle; +begin + Result := (AEvent.LabelColor <> clDefault) or (Event <> nil); + if not Result and Assigned(FOnGetEventStyle) then + begin + AStyle := nil; + FOnGetEventStyle(Scheduler, AEvent, AStyle); + Result := AStyle <> nil; + end; +end; + +function TcxSchedulerStyles.GetDayHeaderParams( + const ADate: TDateTime): TcxViewParams; +var + AStyle: TcxStyle; +begin + AStyle := nil; + if Assigned(FOnGetDayHeaderStyle) then + FOnGetDayHeaderStyle(Scheduler, ADate, AStyle); + GetViewParams(cxcsDayHeader, Pointer(Trunc(ADate)), AStyle, Result); +end; + +function TcxSchedulerStyles.GetGroupSeparatorParams: TcxViewParams; +begin + GetViewParams(cxcsGroupSeparator, nil, nil, Result); +end; + +function TcxSchedulerStyles.GetResourceHeaderParams( + AResource: TcxSchedulerStorageResourceItem): TcxViewParams; +var + AStyle: TcxStyle; +begin + AStyle := nil; + if Assigned(FOnGetResourceHeaderStyle) then + FOnGetResourceHeaderStyle(Scheduler, AResource, AStyle); + GetViewParams(cxcsResourceHeader, nil, AStyle, Result); +end; + +function TcxSchedulerStyles.GetSplitterParams( + AKind: TcxSchedulerSplitterKind): TcxViewParams; +begin + GetViewParams(cxcsHSplitter + Byte(AKind), nil, nil, Result); +end; + +function TcxSchedulerStyles.GetSelectionParams: TcxViewParams; +begin + GetViewParams(cxcsSelection, nil, nil, Result); +end; + +procedure TcxSchedulerStyles.Changed(AIndex: Integer); +begin + inherited Changed(AIndex); + if GetOwner is TcxCustomScheduler then + begin + Scheduler.DateNavigator.CheckSizes; + Scheduler.LookAndFeelChanged(Scheduler.LookAndFeel, []); + end; +end; + +function TcxSchedulerStyles.EventContentSelected( + AEvent: TcxSchedulerControlEvent): Boolean; +begin + Result := AEvent.Selected and not (Scheduler.EditController.Event = AEvent) and + Scheduler.CurrentView.EventContentSelected(AEvent); +end; + +procedure TcxSchedulerStyles.GetDefaultViewParams( + Index: Integer; AData: TObject; out AParams: TcxViewParams); +var + AEvent: TcxSchedulerControlEvent; + ASelected: Boolean; +begin + AParams.Bitmap := nil; + AParams.Font := Scheduler.Font; + AParams.TextColor := AParams.Font.Color; + AParams.Color := Scheduler.Color; + case Index of + cxcsDayHeader, cxcsResourceHeader: + begin + AParams.Color := Painter.DefaultHeaderColor; + AParams.TextColor := Painter.DefaultHeaderTextColor; + end; + cxcsBackground: + begin + AParams.Color := Painter.DefaultSchedulerBackgroundColor; + AParams.TextColor := Painter.DefaultSchedulerTextColor; + end; + cxcsContent: + begin + AParams.Color := Painter.DefaultSchedulerViewContentColor; + if AData <> nil then + begin + AParams.Color := Resources[TcxSchedulerStorageResourceItem(AData).Index].Color; + if AParams.Color = clDefault then + AParams.Color := PainterHelper.GetResourceContentColor( + TcxSchedulerStorageResourceItem(AData).Index); + end; + AParams.TextColor := Painter.DefaultSchedulerViewTextColor; + end; + cxcsSelection: + begin + AParams.Color := Painter.DefaultSelectionColor; + AParams.TextColor := Painter.DefaultSchedulerViewSelectedTextColor; + end; + cxcsHSplitter, cxcsVSplitter: + AParams.Color := Painter.DefaultSchedulerControlColor; + cxcsGroupSeparator: + AParams.Color := Painter.DefaultHeaderColor; + cxcsEvent: + begin + if AData <> nil then + begin + AEvent := TcxSchedulerControlEvent(AData); + ASelected := EventContentSelected(AEvent); + if (AEvent.LabelColor = clDefault) or ASelected then + begin + if ASelected then + begin + with GetSelectionParams do + begin + AParams.Color := Color; + AParams.TextColor := TextColor; + AParams.Font := Font; + end; + end + else + begin + AParams.Color := EventContentColors[AEvent.AllDayEvent or (AEvent.Duration >= 1)]; + with GetContentParams(NullDate) do + begin + AParams.TextColor := TextColor; + AParams.Font := Font; + end; + end; + end + else + begin + AParams.Color := AEvent.LabelColor; + with GetContentParams(NullDate) do + begin + AParams.TextColor := TextColor; + AParams.Font := Font; + end; + end; + end; + end; + end; +end; + +function TcxSchedulerStyles.GetDayHeaderStyle: TcxStyle; +begin + Result := DayHeader; +end; + +function TcxSchedulerStyles.GetEventParams(AEvent: TcxSchedulerEvent): TcxViewParams; +begin + Result := GetEventContentParams(AEvent); +end; + +function TcxSchedulerStyles.GetResourceHeaderStyle: TcxStyle; +begin + Result := ResourceHeader; +end; + +function TcxSchedulerStyles.GetPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := Scheduler.LookAndFeelPainter; +end; + +function TcxSchedulerStyles.GetPainterHelperClass: TcxSchedulerPainterHelperClass; +begin + Result := Scheduler.PainterHelper +end; + +function TcxSchedulerStyles.GetResources: TcxSchedulerStorageResourceItems; +begin + Result := Scheduler.CurrentView.Resources; +end; + +{ TcxSchedulerOptionsBehavior } + +constructor TcxSchedulerOptionsBehavior.Create(AOwner: TcxCustomScheduler); +begin + FOwner := AOwner; + FHotTrack := True; + FSelectOnRightClick := False; +end; + +procedure TcxSchedulerOptionsBehavior.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerOptionsBehavior then + with (Source as TcxSchedulerOptionsBehavior) do + begin + Self.SelectOnRightClick := SelectOnRightClick; + Self.HotTrack := HotTrack; + end; +end; + +function TcxSchedulerOptionsBehavior.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +{ TcxCustomScheduler } + +constructor TcxCustomScheduler.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FDialogsLookAndFeel := TcxLookAndFeel.Create(Self); + FDialogsLookAndFeel.MasterLookAndFeel := LookAndFeel; + FListeners := TInterfaceList.Create; + Color := clBtnFace; + ParentFont := False; + Font.Name := 'Tahoma'; + Keys := [kAll, kArrows, kChars, kTab]; + BeginUpdate; + SetBounds(0, 0, cxDefaultSchedulerWidth, cxDefaultSchedulerHeight); + FSubControls := TList.Create; +{$IFNDEF DEBUGPAINT} + FBitmap := TBitmap.Create; + FBitmap.PixelFormat := pf24Bit; + FBitmapCanvas := TcxCanvas.Create(FBitmap.Canvas); +{$ENDIF} + FCanvas := GetControlCanvas; + FStoredClientBounds := ClientBounds; + FResourceNavigator := CreateResourceNavigator; + CreateSubClasses; + FBackground := CreateBackground; + FSubControlsCreated := True; + BorderStyle := cxcbsDefault; + EndUpdate; + DragMode := dmAutomatic; + cxFormatController.AddListener(Self); + FOptionsBehavior := TcxSchedulerOptionsBehavior.Create(Self); +end; + +destructor TcxCustomScheduler.Destroy; +begin + cxFormatController.RemoveListener(Self); + FSubControlsCreated := False; + Storage := nil; + DestroySubClasses; + while SubControlCount > 0 do + SubControls[0].Free; + FSubControls.Free; +{$IFNDEF DEBUGPAINT} + FBitmapCanvas.Free; + FBitmap.Free; +{$ENDIF} + NotififySchedulerRemoved; + FListeners.Free; + FreeAndNil(FDialogsLookAndFeel); + FreeAndNil(FOptionsBehavior); + inherited Destroy; +end; + +procedure TcxCustomScheduler.BeginUpdate; +begin + Inc(FLockCount); + Include(FControlFlags, cfLocked); + LockUpdateChanged(True); +end; + +procedure TcxCustomScheduler.CopyToClipboard; +begin + ClipboardController.Copy; +end; + +procedure TcxCustomScheduler.CreateEventUsingDialog(AllDay: Boolean = False; + ARecurrence: Boolean = False); +var + AModified: Boolean; + AEvent: TcxSchedulerControlEvent; +begin + if not StorageActive then Exit; + AEvent := TcxSchedulerControlEvent.Create(Storage); + EditController.FFocused := True; + try + InitEventBySelection(AEvent, AllDay, ARecurrence, False); + if DoBeforeEditing(AEvent, False) then + begin + EventList.BeforeEditing(AEvent, False); + cxShowEventEditorEx(GetEventEditInfo(AEvent, ARecurrence), AModified); + DoAfterEditing(EventList.LastEditedEvent); + end + finally + AEvent.Free; + EditController.FFocused := False; + end; +end; + +procedure TcxCustomScheduler.CreateEventUsingInplaceEdit; +begin + DoCreateEventUsingInplaceEdit; +end; + +procedure TcxCustomScheduler.CutToClipboard; +begin + ClipboardController.Cut; +end; + +procedure TcxCustomScheduler.DeleteEvent(AEvent: TcxSchedulerControlEvent); +begin + if not StorageActive or (AEvent = nil) or not EventOperations.Deleting or + AEvent.ReadOnly then Exit; + InternalDeleteEvent(AEvent, False); +end; + +procedure TcxCustomScheduler.DeleteSelectedEvents( + ACheckReadOnly: Boolean = True); +begin + if StorageActive then + InternalDeleteSelectedEvents(True, ACheckReadOnly); +end; + +procedure TcxCustomScheduler.EditEventUsingDialog( + AEvent: TcxSchedulerControlEvent; ACheckReadOnly: Boolean = True; + AForcePatternEditing: Boolean = False); +var + AReadOnly, AModified: Boolean; +begin + if (AEvent = nil) or not StorageActive or (cxEventEditorClass = nil) or + not DoBeforeEditing(AEvent, False) then Exit; + AReadOnly := ACheckReadOnly and + (not CurrentView.Controller.CanEditEvent(AEvent, False) or AEvent.ReadOnly); + EditController.FFocused := True; + try + EventList.BeforeEditing(AEvent, False); + GetEventEditInfo(AEvent, False, AReadOnly); + FEventEditInfo.AllowDelete := EventOperations.Deleting; + FEventEditInfo.ForcePatternEditing := AForcePatternEditing; + FEventEditInfo.OnDeleteFunc := DoBeforeDeleting; + cxShowEventEditorEx(FEventEditInfo, AModified); + DoAfterEditing(EventList.LastEditedEvent); + finally + EditController.FFocused := False; + end; +end; + +procedure TcxCustomScheduler.EditEventUsingInplaceEdit( + AEvent: TcxSchedulerControlEvent); +begin + if (AEvent = nil) or not StorageActive then Exit; + if CanFocusEx then + begin + SetFocus; + EditController.Activate(AEvent); + end; +end; + +procedure TcxCustomScheduler.DragDrop( + Source: TObject; X, Y: Integer); +begin + inherited DragDrop(Source, X, Y); + CaptureController.DragDrop(Source, X, Y); +end; + +procedure TcxCustomScheduler.EndUpdate; +begin + LockUpdateChanged(False); + Dec(FLockCount); + if FLockCount = 0 then + begin + Exclude(FControlFlags, cfLocked); + if cfInvalidLayout in FControlFlags then + begin + Exclude(FControlFlags, cfInvalidLayout); + LayoutChanged; + end; + end; +end; + +function TcxCustomScheduler.GoToDate(ADate: TDateTime): Boolean; +begin + Result := False; +end; + +function TcxCustomScheduler.GoToDate(ADate: TDateTime; + AViewMode: TcxSchedulerViewMode): Boolean; +begin + if ADate = NullDate then + Result := False + else + begin + FSelectedDays.Clear; + FSelectedDays.Add(ADate); + CurrentView.PeriodChanged; + Result := True; + end; +end; + +procedure TcxCustomScheduler.FullRefresh; +begin + if IsDestroying then Exit; + Inc(FLockRefresh); + try + UpdateEventsCache(False); + LayoutChanged; + finally + Dec(FLockRefresh); + end; +end; + +procedure TcxCustomScheduler.LayoutChanged; +begin + if IsLocked or IsLoading or IsDestroying or not HandleAllocated then + Include(FControlFlags, cfInvalidLayout) + else + begin + if EditController <> nil then + EditController.CloseEdit(True); + Exclude(FControlFlags, cfImageValid); + if CurrentView.Visible and not CurrentView.CanShow then + CurrentView.Visible := False; + AlignSubControls; + if not (cfViewValid in FControlFlags) then + begin + SynchronizeVisibleDays; + UpdateEventsCache(False); + end; + DoLayoutChanged; + Exclude(FControlFlags, cfInvalidLayout); + UpdateScrollBars; + NotififySchedulerChanged; + end; + Invalidate; +end; + +procedure TcxCustomScheduler.MakeEventVisible( + AEvent: TcxSchedulerControlEvent; const ADate: TDateTime = NullDate; + AResource: TcxSchedulerStorageResourceItem = nil); +var + AEventDate: TDateTime; +begin + if AResource = nil then + AResource := AEvent.GetResourceItem; + MakeResourceVisible(AResource); + AEventDate := ADate; + if AEventDate = NullDate then + AEventDate := DateOf(AEvent.Start); + CurrentView.MakeEventVisible(AEvent, AEventDate, AResource); +end; + +procedure TcxCustomScheduler.MakeResourceVisible( + AResource: TcxSchedulerStorageResourceItem); +var + AVisibleIndex, I: Integer; +begin + if (AResource = nil) or not AResource.Visible or + (OptionsView.ResourcesPerPage = 0) then Exit; + AVisibleIndex := -1; + with Storage.Resources.ResourceItems do + begin + for I := 0 to VisibleResourceCount - 1 do + if AResource = VisibleResources[I] then + begin + AVisibleIndex := I; + Break; + end; + end; + if AVisibleIndex < FirstVisibleResourceIndex then + FirstVisibleResourceIndex := AVisibleIndex + else + if AVisibleIndex >= (FirstVisibleResourceIndex + OptionsView.ResourcesPerPage) then + FirstVisibleResourceIndex := Max(AVisibleIndex - (OptionsView.ResourcesPerPage - 1), 0); +end; + +procedure TcxCustomScheduler.PasteFromClipboard; +begin + ClipboardController.Paste; +end; + +procedure TcxCustomScheduler.SelectEvent( + AEvent: TcxSchedulerControlEvent; AShift: TShiftState = []); +begin + EventList.Selection.Add(AEvent, AShift); + if not IsLocked then + CurrentView.Refresh; +end; + +procedure TcxCustomScheduler.SelectTime(const ASelStart, + ASelFinish: TDateTime; AResource: TcxSchedulerStorageResourceItem); +begin + if DateTimeHelper.RoundTime(Abs(ASelStart - ASelFinish)) <= CurrentView.GetTimeIncrement then + ReplaceSelParams(ASelStart, ASelStart, AResource) + else + ReplaceSelParams(ASelStart, (ASelFinish - CurrentView.GetTimeIncrement), AResource); + LayoutChanged; +end; + +procedure TcxCustomScheduler.UnselectEvents; +begin + if EventList.Selection.Count = 0 then Exit; + EventList.Selection.Clear; + CurrentView.LayoutChanged; +end; + +procedure TcxCustomScheduler.RestoreFromIniFile(const AStorageName: string; + ARestoreResources: Boolean = True); +var + AStorage: TcxStorage; +begin + AStorage := TcxStorage.Create(AStorageName); + try + BeginUpdate; + try + AStorage.RestoreFromIni(Self); + if ARestoreResources and HasResources then + begin + Storage.InitRestore; + try + AStorage.RestoreFromIni(Storage.Resources); + finally + Storage.DoneRestore; + end; + end; + finally + EndUpdate; + end; + finally + AStorage.Free; + end; +end; + +procedure TcxCustomScheduler.RestoreFromRegistry(const AStorageName: string; + ARestoreResources: Boolean = True); +var + AStorage: TcxStorage; +begin + AStorage := TcxStorage.Create(AStorageName); + try + BeginUpdate; + try + AStorage.RestoreFromRegistry(Self); + if ARestoreResources and HasResources then + begin + Storage.InitRestore; + try + AStorage.RestoreFromRegistry(Storage.Resources); + finally + Storage.DoneRestore; + end; + end; + finally + EndUpdate; + end; + finally + AStorage.Free; + end; +end; + +procedure TcxCustomScheduler.RestoreFromStream(AStream: TStream; + ARestoreResources: Boolean = True); +var + AStorage: TcxStorage; +begin + AStorage := TcxStorage.Create(AStream); + try + BeginUpdate; + try + AStorage.RestoreFromStream(Self); + if ARestoreResources and HasResources then + begin + Storage.InitRestore; + try + AStorage.RestoreFromStream(Storage.Resources); + finally + Storage.DoneRestore; + end; + end; + finally + EndUpdate; + end; + finally + AStorage.Free; + end; +end; + +procedure TcxCustomScheduler.StoreToIniFile(const AStorageName: string; + AReCreate: Boolean = True; AStoreResources: Boolean = True); +var + AStorage: TcxStorage; +begin + AStorage := TcxStorage.Create(AStorageName); + try + BeginUpdate; + try + AStorage.ReCreate := ARecreate; + AStorage.StoreToIni(Self); + AStorage.ReCreate := False; + if AStoreResources and HasResources then + AStorage.StoreToIni(Storage.Resources); + finally + EndUpdate; + end; + finally + AStorage.Free; + end; +end; + +procedure TcxCustomScheduler.StoreToRegistry(const AStorageName: string; + AReCreate: Boolean = True; AStoreResources: Boolean = True); +var + AStorage: TcxStorage; +begin + AStorage := TcxStorage.Create(AStorageName); + try + BeginUpdate; + try + AStorage.ReCreate := ARecreate; + AStorage.StoreToRegistry(Self); + AStorage.ReCreate := False; + if AStoreResources and HasResources then + AStorage.StoreToRegistry(Storage.Resources); + finally + EndUpdate; + end; + finally + AStorage.Free; + end; +end; + +procedure TcxCustomScheduler.StoreToStream(AStream: TStream; + AStoreResources: Boolean = True); +var + AStorage: TcxStorage; +begin + AStorage := TcxStorage.Create(AStream); + try + BeginUpdate; + try + AStorage.StoreToStream(Self); + AStorage.ReCreate := False; + if AStoreResources and HasResources then + AStorage.StoreToStream(Storage.Resources); + finally + EndUpdate; + end; + finally + AStorage.Free; + end; +end; + +procedure TcxCustomScheduler.AlignControls(AControl: TControl; var Rect: TRect); +begin +end; + +procedure TcxCustomScheduler.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('Selection', ReadSelectionData, WriteSelectionData, + (FSelectedDays.Count > 1) or (SelectedDays[0] <> Date)); +end; + +procedure TcxCustomScheduler.GetChildren( + Proc: TGetChildProc; Root: TComponent); +begin + inherited GetChildren(Proc, Root); + if ControlBox.Control <> nil then + Proc(ControlBox.Control); +end; + +procedure TcxCustomScheduler.Notification( + AComponent: TComponent; Operation: TOperation); +var + I: Integer; +begin + inherited Notification(AComponent, Operation); + if not IsDestroying and FSubControlsCreated then + begin + if Operation = opRemove then + begin + if AComponent = ControlBox.Control then + begin + FCanModified := False; + ControlBox.Control := nil; + end; + if AComponent = EventImages then + EventImages := nil; + end; + ContentPopupMenu.Notification(AComponent, Operation); + EventPopupMenu.Notification(AComponent, Operation); + for I := 0 to SubControlCount - 1 do + SubControls[I].Notification(AComponent, Operation); + end; +end; + +procedure TcxCustomScheduler.AddListener( + AListener: IcxExternalDateNavigatorListener); +begin + if FListeners.IndexOf(AListener) = -1 then + FListeners.Add(AListener); +end; + +procedure TcxCustomScheduler.NotififySchedulerChanged; +var + I: Integer; +begin + for I := 0 to FListeners.Count - 1 do + (FListeners[I] as IcxExternalDateNavigatorListener).SchedulerChanged; +end; + +procedure TcxCustomScheduler.NotififySchedulerRemoved; +var + I: Integer; +begin + for I := 0 to FListeners.Count - 1 do + (FListeners[I] as IcxExternalDateNavigatorListener).SchedulerRemoved; +end; + +procedure TcxCustomScheduler.NotififyStorageChanged; +var + I: Integer; +begin + for I := 0 to FListeners.Count - 1 do + (FListeners[I] as IcxExternalDateNavigatorListener).StorageChanged; +end; + + +procedure TcxCustomScheduler.RemoveListener( + AListener: IcxExternalDateNavigatorListener); +begin + FListeners.Remove(AListener); +end; + +////////////////////////////// LAYOUT ////////////////////////////////////////// + +procedure TcxCustomScheduler.AlignSubControls( + Sender: TcxSchedulerSubControl = nil); +begin + if FAligningSubControls or IsLoading or not FSubControlsCreated then Exit; + FAligningSubControls := True; + try + CheckSplittersVisibilityChanging; + CalcLayout; + finally + FAligningSubControls := False; + end; +end; + +procedure TcxCustomScheduler.BoundsChanged; +begin + FBoundsChanging := True; + Include(FControlFlags, cfLocked); + try + {$IFNDEF DEBUGPAINT} + if ((FBitmap.Width < Width) or ((FBitmap.Width - Width) > cxSizeDelta)) or + ((FBitmap.Height < Height) or ((FBitmap.Height - Height) > cxSizeDelta)) then + begin + FBitmap.Width := (Width div cxSizeDelta + 1) * cxSizeDelta; + FBitmap.Height := (Height div cxSizeDelta + 1) * cxSizeDelta; + end; + {$ENDIF} + if not (IsLoading or IsDestroying) and EditController.IsEditing then + CurrentView.Controller.CloseInplaceEdit; + inherited BoundsChanged; + AlignSubControls; + FPrevBounds := ClientBounds; + finally + Exclude(FControlFlags, cfLocked); + LayoutChanged; + FBoundsChanging := False; + end; +end; + +procedure TcxCustomScheduler.CalcVerticalSplitterBounds; +var + R: TRect; +begin + R := ClientBounds; + case OptionsView.ViewPosition of + vpRight: + FVertSplitter.Bounds := cxRectSetLeft(R, R.Left + DateNavigator.Width, OptionsView.VertSplitterWidth); + vpLeft: + FVertSplitter.Bounds := cxRectSetRight(R, R.Right - DateNavigator.Width, OptionsView.VertSplitterWidth); + vpTop: + begin + R.Top := R.Bottom - DateNavigator.Height; + FVertSplitter.Bounds := cxRectSetLeft(R, R.Left + DateNavigator.Width, OptionsView.VertSplitterWidth); + end; + vpBottom: + begin + R.Bottom := R.Top + DateNavigator.Height; + FVertSplitter.Bounds := cxRectSetLeft(R, R.Left + DateNavigator.Width, OptionsView.VertSplitterWidth); + end; + end; +end; + +procedure TcxCustomScheduler.CalcLayout; +begin + CalcSplittersBounds; + case OptionsView.ViewPosition of + vpRight: CalcLayoutViewRight; + vpLeft: CalcLayoutViewLeft; + vpTop: CalcLayoutViewTop; + vpBottom: CalcLayoutViewBottom; + end; +end; + +procedure TcxCustomScheduler.CalcHorizontalSplitterBounds; +var + R: TRect; +begin + R := ClientBounds; + case OptionsView.ViewPosition of + vpRight: + begin + R.Right := R.Left + DateNavigator.Width; + FHorzSplitter.Bounds := cxRectSetTop(R, R.Top + DateNavigator.Height, OptionsView.HorzSplitterWidth); + end; + vpLeft: + begin + R.Left := R.Right - DateNavigator.Width; + FHorzSplitter.Bounds := cxRectSetTop(R, R.Top + DateNavigator.Height, OptionsView.HorzSplitterWidth); + end; + vpTop: + FHorzSplitter.Bounds := cxRectSetBottom(R, R.Bottom - DateNavigator.Height, OptionsView.HorzSplitterWidth); + vpBottom: + FHorzSplitter.Bounds := cxRectSetTop(R, R.Top + DateNavigator.Height, OptionsView.HorzSplitterWidth); + end; +end; + +procedure TcxCustomScheduler.CalcSplittersBounds; +begin + if IsVertSplitterVisible then + CalcVerticalSplitterBounds; + if IsHorzSplitterVisible then + CalcHorizontalSplitterBounds; +end; + +procedure TcxCustomScheduler.CalcLayoutViewRight; +var + R: TRect; +begin + R := ClientBounds; + if IsVertSplitterVisible then + begin + if DateNavigator.Visible then + begin + R.Right := R.Left + DateNavigator.Width; + if IsHorzSplitterVisible then + R.Bottom := R.Top + DateNavigator.Height; + DateNavigator.Bounds := R; + end; + if ControlBox.Visible then + begin + R.Bottom := ClientBounds.Bottom; + R.Right := R.Left + DateNavigator.Width; + if IsHorzSplitterVisible then + R.Top := DateNavigator.Bottom + OptionsView.HorzSplitterWidth; + ControlBox.Bounds := R; + end; + R.Top := ClientBounds.Top; + R.Left := R.Right + OptionsView.VertSplitterWidth; + R.BottomRight := ClientBounds.BottomRight; + end; + CurrentView.Bounds := R +end; + +procedure TcxCustomScheduler.CalcLayoutViewLeft; +var + R: TRect; +begin + R := ClientBounds; + if IsVertSplitterVisible then + begin + if DateNavigator.Visible then + begin + R.Left := R.Right - DateNavigator.Width; + if IsHorzSplitterVisible then + R.Bottom := R.Top + DateNavigator.Height; + DateNavigator.Bounds := R; + end; + if ControlBox.Visible then + begin + R.Bottom := ClientBounds.Bottom; + R.Left := R.Right - DateNavigator.Width; + if IsHorzSplitterVisible then + R.Top := DateNavigator.Bottom + OptionsView.HorzSplitterWidth; + ControlBox.Bounds := R; + end; + R.TopLeft := ClientBounds.TopLeft; + R.Right := ClientBounds.Right - (OptionsView.VertSplitterWidth + DateNavigator.Width); + R.Bottom := ClientBounds.Bottom; + end; + CurrentView.Bounds := R +end; + +procedure TcxCustomScheduler.CalcLayoutViewTop; +var + R: TRect; +begin + R := ClientBounds; + if IsHorzSplitterVisible then + begin + R.Top := R.Bottom - DateNavigator.Height; + if DateNavigator.Visible then + begin + if IsVertSplitterVisible then + R.Right := R.Left + DateNavigator.Width; + DateNavigator.Bounds := R; + end; + if ControlBox.Visible then + begin + R.Right := ClientBounds.Right; + if IsVertSplitterVisible then + R.Left := ClientBounds.Left + DateNavigator.Width + OptionsView.VertSplitterWidth + else + R.Left := ClientBounds.Left; + ControlBox.Bounds := R; + end; + R.TopLeft := ClientBounds.TopLeft; + R.Bottom := ClientBounds.Bottom - (DateNavigator.Height + OptionsView.HorzSplitterWidth); + R.Right := ClientBounds.Right; + end; + CurrentView.Bounds := R +end; + +procedure TcxCustomScheduler.CalcLayoutViewBottom; +var + R: TRect; +begin + R := ClientBounds; + if IsHorzSplitterVisible then + begin + R.Bottom := R.Top + DateNavigator.Height; + if DateNavigator.Visible then + begin + if IsVertSplitterVisible then + R.Right := R.Left + DateNavigator.Width; + DateNavigator.Bounds := R; + end; + if ControlBox.Visible then + begin + R.Right := ClientBounds.Right; + if IsVertSplitterVisible then + R.Left := ClientBounds.Left + DateNavigator.Width + OptionsView.VertSplitterWidth + else + R.Left := ClientBounds.Left; + ControlBox.Bounds := R; + end; + R.Left := ClientBounds.Left; + R.Top := R.Bottom + OptionsView.HorzSplitterWidth; + R.BottomRight := ClientBounds.BottomRight; + end; + CurrentView.Bounds := R +end; + +procedure TcxCustomScheduler.CheckHorzSplitterBounds; +var + R: TRect; +begin + //todo: + R := FHorzSplitter.Bounds; + if IsVertSplitterVisible then + begin + if IsViewAtLeft then + begin + R.Left := FVertSplitter.Right; + R.Right := ClientBounds.Right; + end + else + begin + R.Left := ClientBounds.Left; + R.Right := FVertSplitter.Left; + end + end + else + begin + R.Left := ClientBounds.Left; + R.Right := ClientBounds.Right; + end; + FHorzSplitter.Bounds := cxRectSetHeight(R, OptionsView.HorzSplitterWidth); +end; + +procedure TcxCustomScheduler.CheckSplittersVisibilityChanging; //1 +begin + FVertSplitterShowing := not FVertSplitter.Visible and IsVertSplitterVisible; + if FVertSplitterShowing then + UpdateControlsBoundsOnVertSplitterShowing; + FVertSplitter.Visible := IsVertSplitterVisible; + + FHorzSplitterShowing := not FHorzSplitter.Visible and IsHorzSplitterVisible; + if FHorzSplitterShowing then + UpdateControlsBoundsOnHorzSplitterShowing; + FHorzSplitter.Visible := IsHorzSplitterVisible; +end; + +function TcxCustomScheduler.IsHorzSplitterVisible: Boolean; //1 +begin + if OptionsView.ViewPosition in [vpLeft, vpRight] then + Result := DateNavigator.Visible and ControlBox.Visible + else + Result := DateNavigator.Visible or ControlBox.Visible; +end; + +function TcxCustomScheduler.IsVertSplitterVisible: Boolean; //1 +begin + if OptionsView.ViewPosition in [vpLeft, vpRight] then + Result := CurrentView.Visible and (DateNavigator.Visible or ControlBox.Visible) + else + Result := DateNavigator.Visible and ControlBox.Visible; +end; + +procedure TcxCustomScheduler.UpdateControlsBoundsOnHorzSplitterShowing; +var + R: TRect; +begin + //todo: + CheckHorzSplitterBounds; + case OptionsView.ViewPosition of + vpRight, vpLeft: + begin + R := DateNavigator.Bounds; + R.Top := ClientBounds.Top; + R.Bottom := FHorzSplitter.Top; + DateNavigator.Bounds := R; + R.Top := FHorzSplitter.Bottom; + R.Bottom := ClientBounds.Bottom; + ControlBox.Bounds := R; + end; + vpTop: ; + vpBottom: + begin + R := ClientBounds; + R.Bottom := FHorzSplitter.Bottom; + R.Right := FVertSplitter.Left; + DateNavigator.Bounds := R; + R.Left := FVertSplitter.Right; + R.Right := ClientBounds.Right; + ControlBox.Bounds := R; + end; + end; +end; + +procedure TcxCustomScheduler.UpdateControlsBoundsOnVertSplitterShowing; +var + R: TRect; +begin + //todo: + CheckHorzSplitterBounds; + FVertSplitter.Width := OptionsView.VertSplitterWidth; + R := ClientBounds; + if IsViewAtLeft then + begin + R.Right := FVertSplitter.Left; + CurrentView.Bounds := R; + R := DateNavigator.Bounds; + R.Left := FVertSplitter.Right; + R.Right := ClientBounds.Right; + end + else + begin + R.Left := FVertSplitter.Right; + CurrentView.Bounds := R; + R := DateNavigator.Bounds; + R.Left := ClientBounds.Left; + R.Right := FVertSplitter.Left; + end; + DateNavigator.Bounds := R; + R.Top := ControlBox.Bounds.Top; + R.Bottom := ClientBounds.Bottom; + ControlBox.Bounds := R; +end; + +/////////////////////////////////////////////////////////////////////////////////////////// + +function TcxCustomScheduler.CanSelectPeriod: Boolean; +begin + Result := True; +end; + +function TcxCustomScheduler.CanShowEventDialog: Boolean; +begin + Result := CurrentView.Controller.CanShowEventDialog; +end; + +function TcxCustomScheduler.CanDeactivateOnSelectionChanged(AView: TcxSchedulerCustomView): Boolean; +begin + Result := (AView <> nil) and AView.CanDeactivateOnDateNavigatorSelectionChange; +end; + +function TcxCustomScheduler.CanIntersect(AEvent: TcxSchedulerControlEvent): Boolean; +begin + Result := EventOperations.Intersection or + not AEvent.Conflicts(OptionsView.ShowEventsWithoutResource or not HasResources); +end; + +function TcxCustomScheduler.CanModified: Boolean; +begin + Result := FCanModified; +end; + +function TcxCustomScheduler.CreateBackground: TcxSchedulerSubControl; +begin + Result := TcxSchedulerBackground.Create(Self); +end; + +function TcxCustomScheduler.CreateClipboardController: TcxSchedulerClipboardController; +begin + Result := TcxSchedulerClipboardController.Create(Self); +end; + +function TcxCustomScheduler.CreateContentPopupMenu: TcxSchedulerContentPopupMenu; +begin + Result := TcxSchedulerContentPopupMenu.Create(Self); +end; + +function TcxCustomScheduler.CreateControlBox: TcxSchedulerControlBox; +begin + Result := TcxSchedulerControlBox.Create(Self) +end; + +function TcxCustomScheduler.CreateDateNavigator: TcxSchedulerCustomDateNavigator; +begin + Result := nil; +end; + +function TcxCustomScheduler.CreateDefaultView: TcxSchedulerCustomView; +begin + Result := nil; +end; + +function TcxCustomScheduler.CreateDefaultEditProperties: TcxCustomEditProperties; +begin + Result := TcxMemoProperties.Create(Self); +end; + +function TcxCustomScheduler.CreateEditController: TcxSchedulerEditController; +begin + Result := TcxSchedulerEditController.Create(Self); +end; + +function TcxCustomScheduler.CreateEventHitTestController: TcxSchedulerEventHitTestController; +begin + Result := TcxSchedulerEventHitTestController.Create(Self); +end; + +function TcxCustomScheduler.CreateEventList: TcxSchedulerCachedEventList; +begin + Result := TcxSchedulerCachedEventList.Create; + Result.Selection.OnEventSelectionChanged := DoEventSelectionChanged; +end; + +function TcxCustomScheduler.CreateEventOperations: TcxSchedulerEventOperations; +begin + Result := TcxSchedulerEventOperations.Create(Self); +end; + +function TcxCustomScheduler.CreateEventPopupMenu: TcxSchedulerEventPopupMenu; +begin + Result := TcxSchedulerEventPopupMenu.Create(Self); +end; + +function TcxCustomScheduler.CreateHintController: TcxSchedulerHintController; +begin + Result := TcxSchedulerHintController.Create(Self); +end; + +function TcxCustomScheduler.CreateOptionsCustomize: TcxSchedulerOptionsCustomize; +begin + Result := TcxSchedulerOptionsCustomize.Create(Self); +end; + +function TcxCustomScheduler.CreateOptionsView: TcxSchedulerOptionsView; +begin + Result := TcxSchedulerOptionsView.Create(Self); +end; + +function TcxCustomScheduler.CreateResourceNavigator: TcxSchedulerResourceNavigator; +begin + Result := TcxSchedulerResourceNavigator.Create(Self); +end; + +function TcxCustomScheduler.CreateSplitter( + AKind: TcxSchedulerSplitterKind): TcxSchedulerSplitter; +begin + Result := TcxSchedulerSplitter.Create(Self); + Result.SetKind(AKind); +end; + +function TcxCustomScheduler.CreateStyles: TcxSchedulerStyles; +begin + Result := TcxSchedulerStyles.Create(Self); +end; + +procedure TcxCustomScheduler.CreateSubClasses; +begin + FClipboardController := CreateClipboardController; + FEventEditInfo := TcxSchedulerEventEditInfo.Create; + FTextEditProperties := TcxTextEditProperties.Create(Self); + FEventHitTestController := CreateEventHitTestController; + FHintController := CreateHintController; + FEditController := CreateEditController; + FEditStyle := TcxCustomEditStyle.Create(Self, True); + FDefaultProperties := TcxMemoProperties.Create(Self); + FEventList := CreateEventList; + + FEventDays := TcxSchedulerDateList.Create; + FHolidayDays := TcxSchedulerDateList.Create; + FSelectedDays := TcxSchedulerDateList.Create; + FSelectedDays.Add(Date); + FStyles := CreateStyles; + FEventOperations := CreateEventOperations; + FOptionsCustomize := CreateOptionsCustomize; + FOptionsView := CreateOptionsView; + // subcontrols + FControlBox := CreateControlBox; + FDateNavigator := CreateDateNavigator; + // this order + FVertSplitter := CreateSplitter(skVertical); + FHorzSplitter := CreateSplitter(skHorizontal); + // view + FCurrentView := CreateDefaultView; + FCurrentView.Visible := True; + // popups + FContentPopupMenu := CreateContentPopupMenu; + FEventPopupMenu := CreateEventPopupMenu; + CreateUpdateTimeTimer; +end; + +procedure TcxCustomScheduler.DateNavigatorSelectionChanged; +begin + if not (cfViewValid in FControlFlags) then Exit; + Exclude(FControlFlags, cfViewValid); + PeriodChanged; + Modified; +end; + +procedure TcxCustomScheduler.DestroySubClasses; +begin + FClipboardController.Free; + FEditController.Free; + FEventHitTestController.Free; + FUpdateTimeTimer.Free; + FContentPopupMenu.Free; + FEventPopupMenu.Free; + FEventOperations.Free; + FEventList.Free; + FEventDays.Free; + FHolidayDays.Free; + FOptionsCustomize.Free; + FOptionsView.Free; + FStyles.Free; + FSelectedDays.Free; + FEditStyle.Free; + FDefaultProperties.Free; + FTextEditProperties.Free; + FHintController.Free; + FEventEditInfo.Free; +end; + +procedure TcxCustomScheduler.DoAfterDragEvent(Target: TObject; + X, Y: Integer; var Accept: Boolean); +begin + if Assigned(FOnAfterDragEvent) then + FOnAfterDragEvent(Self, Target, X, Y, Accept); +end; + +procedure TcxCustomScheduler.DoAfterEditing(AEvent: TcxSchedulerControlEvent); +begin + if Assigned(FOnAfterEditing) then + FOnAfterEditing(Self, AEvent); +end; + +procedure TcxCustomScheduler.DoAfterSizingEvent( + AEvent: TcxSchedulerControlEvent; X, Y: Integer; var Accept: Boolean); +begin + if Assigned(FOnAfterSizingEvent) then + FOnAfterSizingEvent(Self, AEvent, X, Y, Accept); +end; + +function TcxCustomScheduler.DoBeforeDeleting( + AEvent: TcxSchedulerControlEvent): Boolean; +begin + Result := True; + if Assigned(FOnBeforeDeleting) then + FOnBeforeDeleting(Self, AEvent, Result); +end; + +function TcxCustomScheduler.DoBeforeDragEvent( + AEvent: TcxSchedulerControlEvent; X, Y: Integer): Boolean; +begin + Result := True; + if Assigned(FOnBeforeDragEvent) then + FOnBeforeDragEvent(Self, AEvent, X, Y, Result); +end; + +function TcxCustomScheduler.DoBeforeEditing( + AEvent: TcxSchedulerControlEvent; AInplace: Boolean): Boolean; +begin + Result := (AEvent.Source <> nil) or CanIntersect(AEvent); + if Result and Assigned(FOnBeforeEditing) then + FOnBeforeEditing(Self, AEvent, AInplace, Result); +end; + +function TcxCustomScheduler.DoBeforeSizingEvent( + AEvent: TcxSchedulerControlEvent; X, Y: Integer): Boolean; +begin + Result := True; + if Assigned(FOnBeforeSizingEvent) then + FOnBeforeSizingEvent(Self, AEvent, X, Y, Result); +end; + +procedure TcxCustomScheduler.DoCalculateLayout( + AControl: TcxSchedulerSubControl); +begin + AControl.LayoutChanged; +end; + +procedure TcxCustomScheduler.DoCancelMode; +begin + if FCaptureControl <> nil then + FCaptureControl.Controller.DoCancelMode; + FCaptureControl := nil; +end; + +procedure TcxCustomScheduler.DoControllerReset( + AControl: TcxSchedulerSubControl); +begin + AControl.Controller.Reset; +end; + +procedure TcxCustomScheduler.DoCreateEventUsingInplaceEdit( + AKey: Char = #0); +var + AControlEvent: TcxSchedulerControlEvent; +begin + if not StorageActive then Exit; + AControlEvent := EventList.CreateEvent; + InitEventBySelection(AControlEvent, False, False, True); + if AControlEvent.Source <> nil then + AControlEvent.MoveTo(AControlEvent.Start + GetTimeBias); + EventList.Sort(@cxCompareSchedulerControlEvents); + CurrentView.Refresh; + EditController.Init(SelStart, SelResource, True); + if AKey = #0 then + EditController.Activate(AControlEvent) + else + EditController.Activate(AControlEvent, AKey); + if not EditController.IsEditing then + EditController.DeleteEvent(AControlEvent); +end; + +procedure TcxCustomScheduler.DoEventSelectionChanged( + AEvent: TcxSchedulerControlEvent); +begin + if Assigned(FOnEventSelectionChanged) then + FOnEventSelectionChanged(Self, AEvent); +end; + +procedure TcxCustomScheduler.DoFirstVisibleResourceChanged; +begin + if Assigned(FOnFirstVisibleResourceChanged) then + FOnFirstVisibleResourceChanged(Self); +end; + +procedure TcxCustomScheduler.DoGetEventDisplayText( + AEvent: TcxSchedulerControlEvent; var AText: string); +begin + AText := AEvent.Caption; + if Assigned(FOnGetEventDisplayText) then + FOnGetEventDisplayText(Self, AEvent, AText); +end; + +procedure TcxCustomScheduler.DoGetEventEditProperties( + AEvent: TcxSchedulerControlEvent; var AProperties: TcxCustomEditProperties); +begin + if CurrentView.GetEditWithSingleLineEditor(AEvent) then + AProperties := FTextEditProperties + else + AProperties := DefaultProperties; + if Assigned(OnGetEventEditProperties) then + begin + OnGetEventEditProperties(Self, AEvent, AProperties); + if AProperties = nil then + AProperties := DefaultProperties; + end; +end; + +procedure TcxCustomScheduler.DoHitTestRecalculate( + AControl: TcxSchedulerSubControl); +begin + AControl.Controller.HitTest.Recalculate; +end; + +procedure TcxCustomScheduler.DoInitEdit(AEdit: TcxCustomEdit); +begin + if Assigned(FOnInitEdit) then + FOnInitEdit(Self, AEdit); +end; + +function TcxCustomScheduler.DoIsWorkTime( + AResourceItem: TcxSchedulerStorageResourceItem; const ADateTime: TDateTime): Boolean; +begin + Result := OptionsView.IsWorkTime(AResourceItem, ADateTime); + if Assigned(FOnIsWorkTime) then + FOnIsWorkTime(Self, AResourceItem, ADateTime, Result); +end; + +procedure TcxCustomScheduler.DoLayoutChanged; +var + I: Integer; +begin + FCanvas := GetControlCanvas; + for I := 0 to FSubControls.Count - 1 do + SubControls[I].LayoutChanged; + UpdateScrollBars; + DoLayoutChangedEvent; +end; + +procedure TcxCustomScheduler.DoLayoutChangedEvent; +begin + if Assigned(FOnLayoutChanged) then + FOnLayoutChanged(Self); +end; + +function TcxCustomScheduler.DoMoreEventsButtonClick: Boolean; +begin + Result := False; + if Assigned(FOnMoreEventsButtonClick) then + FOnMoreEventsButtonClick(Self, Result); +end; + +function TcxCustomScheduler.DoNavigationButtonClick: Boolean; +begin + Result := False; + if Assigned(FOnNavigationButtonClick) then + FOnNavigationButtonClick(Self, Result); +end; + +procedure TcxCustomScheduler.DoCanShowView( + AView: TcxSchedulerCustomView; var Allow: Boolean); +begin + if Assigned(FOnCanShowView) then + FOnCanShowView(Self, AView, Allow); +end; + +procedure TcxCustomScheduler.DoSelectionChanged; +begin + if Assigned(FOnSelectionChanged) then + FOnSelectionChanged(Self); +end; + +procedure TcxCustomScheduler.DoScaleScroll; +begin + if Assigned(OnScaleScroll) then + with CurrentView do + OnScaleScroll(Self, GetFirstVisibleDate + GetFirstVisibleTime, + GetLastVisibleDate + GetLastVisibleTime); +end; + +function TcxCustomScheduler.DoShowDateHint(const ADate: TDateTime; var AHintText: string): Boolean; +var + AOnShowDateHint: TcxSchedulerShowDateHintEvent; +begin + Result := False; + if not FOptionsView.ShowHints then + Exit; + Result := (Storage <> nil) and Storage.GetHolidayNamesByDate(ADate, AHintText); + AOnShowDateHint := OnShowDateHint; + if Assigned(AOnShowDateHint) then + AOnShowDateHint(Self, ADate, AHintText, Result); + Result := Result and (AHintText <> ''); +end; + +function TcxCustomScheduler.DoShowPopupMenu(AMenu: TComponent; + X, Y: Integer): Boolean; +begin + with CurrentView do + Result := Visible and cxRectPtIn(ViewInfo.Bounds, ScreenToClient(cxPoint(X, Y))) and + DoShowPopupMenu(X, Y); + if not Result then + Result := inherited DoShowPopupMenu(AMenu, X, Y); +end; + +procedure TcxCustomScheduler.DoViewTypeChanged( + ANewView: TcxSchedulerCustomView); +begin + if Assigned(FOnViewTypeChanged) then + FOnViewTypeChanged(Self, FCurrentView, ANewView); +end; + +procedure TcxCustomScheduler.DoUpdateTime; +begin + if not FSubControlsCreated or not HandleAllocated then Exit; + if CurrentView.Visible then + CurrentView.DateChanged; + if DateNavigator.Visible then + DateNavigator.CheckCurrentDate; +end; + +procedure TcxCustomScheduler.DragCanceled; +begin + FIsDragCanceled := True; +end; + +procedure TcxCustomScheduler.DrawSplitters; +begin + if OptionsView.ViewPosition in [vpLeft, vpRight] then + begin + FVertSplitter.Paint; + FHorzSplitter.Paint; + end + else + begin + FHorzSplitter.Paint; + FVertSplitter.Paint; + end; +end; + +procedure TcxCustomScheduler.FirstVisibleResourceChanged; +begin + ResourceNavigator.FirstVisibleResourceChanged; + DoFirstVisibleResourceChanged; +end; + +procedure TcxCustomScheduler.FontChanged; +begin + BeginUpdate; + if not IsLoading and FSubControlsCreated then + DateNavigator.SetIntegralSizes; + inherited FontChanged; + LayoutChanged; + EndUpdate; +end; + +function TcxCustomScheduler.GetClientBounds: TRect; +begin + Result := GetBounds; + InflateRect(Result, -BorderSize, -BorderSize); +end; + +procedure TcxCustomScheduler.FocusChanged; +begin + if IsDestroying then Exit; + if OptionsView.HideSelection and not EditController.Focused then + begin + if (CurrentView <> nil) and CurrentView.Visible then + CurrentView.Refresh; + if DateNavigator.Visible then + DateNavigator.Refresh; + end; + inherited FocusChanged; + if not Focused then + HintController.HideHint; +end; + +function TcxCustomScheduler.GetControlCanvas: TcxCanvas; +begin +{$IFDEF DEBUGPAINT} + Result := inherited Canvas +{$ELSE} + Result := FBitmapCanvas; +{$ENDIF} +end; + +function TcxCustomScheduler.GetControlFromPoint( + const APoint: TPoint): TcxSchedulerSubControl; +var + I: Integer; +begin + Result := Background; + for I := 0 to SubControlCount - 1 do + if SubControls[I].CanCapture(APoint) then + begin + Result := SubControls[I]; + Break; + end; +end; + +function TcxCustomScheduler.GetCursor( + X, Y: Integer): TCursor; +begin + Result := crDefault; + if not IsDesigning then + Result := GetControlFromPoint(cxPoint(X, Y)).Controller.GetCursor(X, Y); + if Result = crDefault then + Result := inherited GetCursor(X, Y); +end; + +function TcxCustomScheduler.GetDateTimeHelper: TcxSchedulerDateTimeHelperClass; +begin + Result := cxSchedulerUtils.DateTimeHelper; +end; + +function TcxCustomScheduler.GetDateNavigatorLoadedSize: TSize; +begin + if IsViewAtLeft then + Result.cx := FStoredClientBounds.Right - VertSplitter.Right + else + Result.cx := VertSplitter.Left - FStoredClientBounds.Left; + Result.cy := HorzSplitter.Top - FStoredClientBounds.Top; +end; + +function TcxCustomScheduler.GetDesignHitTest( + X, Y: Integer; Shift: TShiftState): Boolean; +begin + Result := inherited GetDesignHitTest(X, Y, Shift); + if not Result then + begin + Result := Capture.AllowDesignHitTest(X, Y, Shift); + if not Result then + Result := GetControlFromPoint(cxPoint(X, Y)).AllowDesignHitTest(X, Y, Shift); + end; +end; + +function TcxCustomScheduler.GetEventEditInfo(AEvent: TcxSchedulerControlEvent; + ARecurrence: Boolean = False; AReadOnly: Boolean = False): TcxSchedulerEventEditInfo; +begin + Result := FEventEditInfo; + Result.Event := AEvent; + Result.AllowHiddenEvents := OptionsView.ShowEventsWithoutResource or not HasResources; + Result.LookAndFeel := DialogsLookAndFeel; + Result.Intersection := EventOperations.Intersection; + Result.ReadOnly := AReadOnly; + Result.RecurrenceButton := EventOperations.Recurrence; + Result.Recurrence := ARecurrence; + Result.ForcePatternEditing := ARecurrence; + Result.BiasTime := GetTimeBias; + Result.ShowResources := EventOperations.SharingBetweenResources; + Result.ShowTaskComplete := CurrentView.ShowTaskComplete; +end; + +function TcxCustomScheduler.GetEventHintText( + AEvent: TcxSchedulerControlEvent): string; +begin + Result := AEvent.Caption; + if not AEvent.AllDayEvent then + begin + with DateTimeHelper do + Result := TimeToStr(AEvent.Start) + '-' + TimeToStr(AEvent.Finish) + ' ' + Result; + end; + GetEventUserHintText(AEvent, Result); +end; + +function TcxCustomScheduler.GetEventUserHintText(AEvent: TcxSchedulerControlEvent; + var AText: string): Boolean; +begin + Result := Assigned(FOnGetEventHintText); + if Result then + FOnGetEventHintText(Self, AEvent, AText); +end; + +function TcxCustomScheduler.GetHScrollBarBounds: TRect; +begin + Result := CurrentView.GetHScrollBarBounds; +end; + +function TcxCustomScheduler.GetInternalCanvas: TcxCanvas; +begin + Result := inherited Canvas; +end; + +function TcxCustomScheduler.GetIsLocked: Boolean; +begin + Result := cfLocked in FControlFlags; +end; + +function TcxCustomScheduler.GetNextView( + AView: TcxSchedulerCustomView): TcxSchedulerCustomView; +begin + Result := AView; +end; + +function TcxCustomScheduler.GetOnShowDateHint: TcxSchedulerShowDateHintEvent; +begin + Result := FOnShowDateHint; +end; + +function TcxCustomScheduler.GetPainterHelper: TcxSchedulerPainterHelperClass; +begin + Result := TcxSchedulerPainterHelper; +end; + +function TcxCustomScheduler.GetSizeGripBounds: TRect; +begin + Result := CurrentView.GetSizeGripBounds; +end; + +function TcxCustomScheduler.GetTimeBias: Double; +begin + Result := 0; + if StorageValid then + begin + with DateTimeHelper do + Result := TimeZoneBias(OptionsView.CurrentTimeZone) - TimeZoneBias(CurrentTimeZone); + end; +end; + +function TcxCustomScheduler.GetVScrollBarBounds: TRect; +begin + Result := CurrentView.GetVScrollBarBounds; +end; + +function TcxCustomScheduler.HasConflict(AStartDrag: Boolean): Boolean; +begin + if EventOperations.Intersection then + Result := False + else + Result := EventList.HasConflict(IsCopyDragDrop, AStartDrag); +end; + +function TcxCustomScheduler.HasResources: Boolean; +begin + Result := (Storage <> nil) and (Storage.ResourceCount > 0); +end; + +procedure TcxCustomScheduler.InitControl; +begin + inherited InitControl; + if not IsLoading and OptionsCustomize.IntegralSizing then + DateNavigator.SetIntegralSizes; +end; + +procedure TcxCustomScheduler.InitScrollBarsParameters; +begin + CurrentView.InitScrollBarsParameters; +end; + +procedure TcxCustomScheduler.InternalDeleteEvent(AEvent: TcxSchedulerControlEvent; + AIgnoreRecurring: Boolean); +var + ADeleteOccurrence: Boolean; +begin + if not DoBeforeDeleting(AEvent) then Exit; + if not AIgnoreRecurring and AEvent.IsRecurring then + begin + if cxShowRecurrenceSelectionDialog(AEvent, rsmDeleting, + DialogsLookAndFeel, ADeleteOccurrence) then + if ADeleteOccurrence then + AEvent.Delete + else + AEvent.Pattern.Delete; + end + else + AEvent.Delete; +end; + +procedure TcxCustomScheduler.InternalDeleteSelectedEvents(AForceDelete, ACheckReadOnly: Boolean); +var + I, AIndex, ACount: Integer; + AEvent: TcxSchedulerControlEvent; + ASelectedIDs: array of Variant; + + procedure GetSelection; + var + I: Integer; + begin + SetLength(ASelectedIDs, SelectedEventCount); + for I := 0 to SelectedEventCount - 1 do + ASelectedIDs[I] := SelectedEvents[I].ID; + end; + + function GetIndexOfID(const AID: Variant): Integer; + begin + for Result := 0 to High(ASelectedIDs) do + if VarEquals(AID, ASelectedIDs[Result]) then Exit; + Result := -1; + end; + + procedure DeleteIDByIndex(AIndex: Integer); + var + I: Integer; + begin + for I := AIndex + 1 to High(ASelectedIDs) do + ASelectedIDs[I - 1] := ASelectedIDs[I]; + SetLength(ASelectedIDs, Length(ASelectedIDs) - 1); + end; + +begin + GetSelection; + if AForceDelete then + BeginUpdate; + ACount := 0; + try + while ACount <> SelectedEventCount do + begin + ACount := SelectedEventCount; + for I := 0 to ACount - 1 do + begin + AEvent := SelectedEvents[I]; + AIndex := GetIndexOfID(AEvent.ID); + if AIndex >= 0 then + begin + DeleteIDByIndex(AIndex); + if not AForceDelete then + DeleteEvent(AEvent) + else + if not (ACheckReadOnly and AEvent.ReadOnly) then + InternalDeleteEvent(AEvent, True); + if ACount <> SelectedEventCount then break; + end; + end; + end; + finally + SetLength(ASelectedIDs, 0); + if AForceDelete then + EndUpdate; + end; +end; + +procedure TcxCustomScheduler.InternalPaint(const AClipRect: TRect); +var + I: Integer; + ACanvas: TcxCanvas; + AControl: TcxSchedulerSubControl; +begin + ACanvas := GetControlCanvas; + SelectClipRgn(ACanvas.Handle, 0); + if BorderStyle = cxcbsDefault then + begin + LookAndFeelPainter.DrawSchedulerBorder(ACanvas, Bounds); + ACanvas.IntersectClipRect(ClientBounds); + end; + if ResourceNavigator.Visible and cxRectIsEqual(AClipRect, ResourceNavigator.Bounds) then + ResourceNavigator.Paint + else + begin + ACanvas.SaveClipRegion; + try + if not IsRectEmpty(AClipRect) then + ACanvas.IntersectClipRect(AClipRect); + for I := 0 to SubControlCount - 1 do + begin + AControl := SubControls[I]; + if not AControl.IsSpecialPaint then + AControl.Paint; + end; + DrawSplitters; + finally + ACanvas.RestoreClipRegion; + end; + end; +end; + +function TcxCustomScheduler.IsViewAtLeft: Boolean; +begin + Result := OptionsView.ViewPosition = vpLeft; +end; + +procedure TcxCustomScheduler.KeyDown( + var Key: Word; Shift: TShiftState); +begin + inherited KeyDown(Key, Shift); + if KeyboardListener <> nil then + KeyboardListener.Controller.KeyDown(Key, Shift) + else + CurrentView.Controller.KeyDown(Key, Shift); +end; + +procedure TcxCustomScheduler.KeyPress(var Key: Char); +begin + inherited KeyPress(Key); + if KeyboardListener <> nil then + KeyboardListener.Controller.KeyPress(Key) + else + CurrentView.Controller.KeyPress(Key); +end; + +procedure TcxCustomScheduler.KeyUp( + var Key: Word; Shift: TShiftState); +begin + inherited KeyUp(Key, Shift); + if KeyboardListener <> nil then + KeyboardListener.Controller.KeyUp(Key, Shift) + else + CurrentView.Controller.KeyUp(Key, Shift); +end; + +procedure TcxCustomScheduler.Loaded; +begin + inherited Loaded; + DateNavigator.Loaded; + ControlBox.Width := DateNavigator.Width; + if CurrentView <> nil then + CurrentView.VisibleChanged; + FullRefresh; +end; + +procedure TcxCustomScheduler.LockUpdateChanged( + ALocking: Boolean); +begin +end; + +procedure TcxCustomScheduler.LookAndFeelChanged( + Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); +var + I: Integer; +begin + for I := 0 to SubControlCount - 1 do + SubControls[I].LookAndFeelChanged(Sender, AChangedValues); + inherited LookAndFeelChanged(Sender, AChangedValues); + LayoutChanged; +end; + +procedure TcxCustomScheduler.Modified; +begin + if not FBoundsChanging and CanModified then + inherited Modified; +end; + +procedure TcxCustomScheduler.MouseDown( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FPrevMousePos := cxInvalidPoint; + FActiveControl := GetControlFromPoint(cxPoint(X, Y)); + Capture := FActiveControl; + Capture.DoBeforeMouseDown(Button, Shift, X, Y); + inherited MouseDown(Button, Shift, X, Y); + FCaptureControl := FActiveControl; //can be changed on BeginDrag + Capture.DoMouseDown(Button, Shift, X, Y); +end; + +procedure TcxCustomScheduler.MouseLeave(AControl: TControl); +begin + inherited MouseLeave(AControl); + if FActiveControl <> nil then + FActiveControl.Controller.MouseLeave; + FActiveControl := nil; + if CurrentView <> nil then + CurrentView.HitTest.SetHitPoint(Point(0, 0)); +end; + +procedure TcxCustomScheduler.MouseMove( + Shift: TShiftState; X, Y: Integer); +var + FPrevControl: TcxSchedulerSubControl; +begin + if (FPrevMousePos.X = X) and (FPrevMousePos.Y = Y) then Exit; + FPrevMousePos := cxPoint(X, Y); + FPrevControl := FActiveControl; + FActiveControl := FCaptureControl; + if FActiveControl = nil then + FActiveControl := GetControlFromPoint(cxPoint(X, Y)); + FActiveControl.DoMouseMove(Shift, X, Y); + inherited MouseMove(Shift, X, Y); + if OptionsView.HotTrack or OptionsView.ShowHints then + begin + CurrentView.MousePositionChanged(X, Y); + if (ssLeft in Shift) and not CurrentView.HitTest.HitAtControl and (FSelStart <> FSelFinish) then + begin + ReplaceSelParams(FSelStart, FSelStart, FSelResource); + CurrentView.Refresh; + end; + EventHitTestController.MouseMove(X, Y, Shift); + end; + if (FPrevControl <> FActiveControl) and (FPrevControl <> nil) then + FPrevControl.Controller.MouseLeave; +end; + +procedure TcxCustomScheduler.MouseUp( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + Capture.DoMouseUp(Button, Shift, X, Y); + Capture := nil; + EventHitTestController.MouseMove(X, Y, Shift); +end; + +function TcxCustomScheduler.NeedShowHint(AEvent: TcxSchedulerControlEvent; + var AHintText: string; AllowShow: Boolean): Boolean; +begin + if CurrentView <> nil then + AHintText := CurrentView.GetEventHintText(AEvent) + else + AHintText := GetEventHintText(AEvent); + Result := (Length(AHintText) > 0) and + (Assigned(FOnGetEventHintText) or AllowShow); +end; + +procedure TcxCustomScheduler.Paint; +var + R: TRect; +begin + if IsLoading then Exit; +{$IFNDEF DEBUGPAINT} + if not (cfImageValid in FControlFlags) then +{$ELSE} + GdiSetBatchLimit(1); +{$ENDIF} + begin + if (GetClipBox(inherited Canvas.Handle, R) = 0) or not + cxRectIsEqual(R, ResourceNavigator.Bounds) // todo: bug with redrawing + then + R := cxNullRect; + InternalPaint(R); + Include(FControlFlags, cfImageValid); + end; +{$IFNDEF DEBUGPAINT} + BitBlt(inherited Canvas.Handle, 0, 0, Width, + Height, BitmapCanvas.Handle, 0, 0, SRCCOPY); +{$ENDIF} + FCanModified := True; +end; + +procedure TcxCustomScheduler.PeriodChanged; +begin + FullRefresh; + DateNavigator.DoPeriodChangedEvent; +end; + +procedure TcxCustomScheduler.RemoveSubControl( + AControl: TcxSchedulerSubControl); +begin + if (FSubControls.Remove(AControl) <> -1) and not IsDestroying then + begin + LayoutChanged; + if Capture = AControl then + Capture := nil; + end; +end; + +procedure TcxCustomScheduler.ReplaceSelParams(ASelStart, ASelFinish: TDateTime; + AResource: TcxSchedulerStorageResourceItem); +begin + with DateTimeHelper do + begin + if (FSelResource <> AResource) or (FSelStart <> RoundTime(ASelStart)) or + (FSelFinish <> RoundTime(ASelFinish)) then + begin + FSelResource := AResource; + FSelStart := RoundTime(ASelStart); + FSelFinish := RoundTime(ASelFinish); + DoSelectionChanged; + end; + end; +end; + +procedure TcxCustomScheduler.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +begin + if EditController.IsEditing then Exit; + if ResourceNavigator.NeedScrollBar and (AScrollBarKind = ResourceNavigator.ScrollBarKind) then + ResourceNavigator.Scroll(AScrollCode, AScrollPos) + else + begin + CurrentView.Scroll(AScrollBarKind, AScrollCode, AScrollPos); + DoScaleScroll; + end; +end; + +procedure TcxCustomScheduler.SelectedDaysChanged(AView: TcxSchedulerCustomView); +begin + if AView <> nil then + AView.SelectedDaysChanged; +end; + +procedure TcxCustomScheduler.SetCurrentView( + AView: TcxSchedulerCustomView); +begin + if (AView <> nil) and (AView.Scheduler = Self) then + begin + if Assigned(FCurrentView) then + FCurrentView.DeactivateView; + FCurrentView := AView; + end; +end; + +procedure TcxCustomScheduler.SubControlAdd( + AControl: TcxSchedulerSubControl); +begin + FSubControls.Add(AControl); + LayoutChanged; +end; + +procedure TcxCustomScheduler.SubControlRemove( + AControl: TcxSchedulerSubControl); +begin + FSubControls.Remove(AControl); + LayoutChanged; +end; + +procedure TcxCustomScheduler.SynchronizeVisibleDays; +begin + Include(FControlFlags, cfViewValid); +end; + +procedure TcxCustomScheduler.UpdateDateNavigatorDragging(Accept: Boolean); +begin + if not DateNavigator.Visible then Exit; + if Accept then + DateNavigator.UpdateDragging + else + DateNavigator.ClearDragging; +end; + +procedure TcxCustomScheduler.UpdateEventsCache( + ACheckDaysInterval: Boolean); +var + AStart, AFinish: TDateTime; +begin + CurrentView.Controller.CloseInplaceEdit; + if not StorageValid then + begin + FreeAndNil(FEventList); + FEventList := CreateEventList; + end; + FEventList.TimeZone := OptionsView.CurrentTimeZone; + FEventList.ShowEventsWithoutResource := OptionsView.ShowEventsWithoutResource or + (VisibleGroupingKind = gkNone); + AStart := Min(CurrentView.FirstVisibleDate, DateNavigator.GetRealFirstDate) + - CurrentView.GetVisibleDaysRange; + AFinish := Max(CurrentView.LastVisibleDate, DateNavigator.GetRealLastDate) + + CurrentView.GetVisibleDaysRange; + if ACheckDaysInterval and (AStart >= EventList.Start) and + (AFinish <= EventList.Finish) then Exit; + FEventList.BeforeUpdate; + FEventList.SelStart := CurrentView.FirstVisibleDate - 7; + FEventList.SelFinish := CurrentView.LastVisibleDate + 7; + FEventList.UseTimeRange := CurrentView.CheckEventsVisibility; + if StorageValid then + Storage.GetEvents(FEventList, AStart, AFinish); + FEventDays.Clear; + FHolidayDays.Clear; + if DateNavigator.GetShowDatesContainingEventsInBold then + FEventList.ExtractUsedDays(FEventDays); + if (Storage <> nil) then + Storage.PopulateHolidayDates(FHolidayDays, FEventList.Start, FEventList.Finish); + if (FEventList.Selection.Count > 0) and (CurrentView <> nil) then + CurrentView.Controller.FDragEvent := FEventList.Selection[0] + else + CurrentView.Controller.FDragEvent := nil; +end; + +procedure TcxCustomScheduler.ValidateFirstVisibleResourceIndex; +begin + if (OptionsView.ResourcesPerPage = 0) and (FFirstVisibleResourceIndex <> 0) then + begin + FFirstVisibleResourceIndex := 0; + FirstVisibleResourceChanged; + end + else + if FFirstVisibleResourceIndex + OptionsView.ResourcesPerPage > ResourceNavigator.ResourceCount then + begin + FFirstVisibleResourceIndex := Max(0, ResourceNavigator.ResourceCount - + OptionsView.ResourcesPerPage); + end; +end; + +procedure TcxCustomScheduler.ValidateSelection( + ASelection: TcxSchedulerDateList); +begin + DateNavigator.UpdateSelection; +end; + +procedure TcxCustomScheduler.ValidateState; +var + AIsLocked: Boolean; +begin + AIsLocked := cfLocked in FControlFlags; + if cfInvalidLayout in FControlFlags then + try + LayoutChanged; + finally + FControlFlags := []; + if AIsLocked then + FControlFlags := [cfLocked]; + end; +end; + +procedure TcxCustomScheduler.ViewVisibleChanged( + AView: TcxSchedulerCustomView); +begin + Exclude(FControlFlags, cfViewValid); + if FVisibleChangedCount = 0 then + DateNavigator.BeginUpdate; + Inc(FVisibleChangedCount); + try + if AView.Visible and (CurrentView <> AView) then + begin + CurrentView.Visible := False; + DoViewTypeChanged(AView); + CurrentView := AView; + end + else + if not FCurrentView.Visible and (FVisibleChangedCount = 1) then + GetNextView(FCurrentView).Visible := True; + finally + Dec(FVisibleChangedCount); + if FVisibleChangedCount = 0 then + begin + AlignSubControls; + LayoutChanged; + DateNavigator.EndUpdate; + end; + end; + Modified; +end; + +function TcxCustomScheduler.VisibleGroupingKind: TcxSchedulerGroupingKind; +var + I, C: Integer; +begin + Result := CurrentView.GetGroupingKind; + C := 0; + if HasResources then + begin + for I := 0 to Storage.ResourceCount - 1 do + if Storage.Resources.ResourceItems[I].Visible then Inc(C); + end; + if C = 0 then + Result := gkNone + else + if Result = gkDefault then + Result := gkByResource; +end; + +function TcxCustomScheduler.CanDrag(X, Y: Integer): Boolean; +begin + Result := inherited CanDrag(X, Y) and not IsDesigning and + CaptureController.CanDrag(X, Y); +end; + +procedure TcxCustomScheduler.DoEndDrag( + Target: TObject; X, Y: Integer); +begin + CaptureController.EndDrag(Target, X, Y); + inherited DoEndDrag(Target, X, Y); + Capture := nil; +end; + +procedure TcxCustomScheduler.DoStartDrag( + var DragObject: TDragObject); +begin + FIsDragCanceled := False; + inherited DoStartDrag(DragObject); + CaptureController.StartDrag(DragObject); +end; + +procedure TcxCustomScheduler.DragAndDrop( + const P: TPoint; var Accepted: Boolean); +begin + inherited DragAndDrop(P, Accepted); + CaptureController.DragAndDrop(P, Accepted); +end; + +procedure TcxCustomScheduler.DragOver( + Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); +var + AAccept, ACopyDragDrop: Boolean; + AControl: TcxSchedulerSubControl; +begin + ACopyDragDrop := IsCopyDragDrop; + if State <> dsDragMove then + FPrevMousePos := cxInvalidPoint + else + if (FPrevMousePos.X = X) and (FPrevMousePos.Y = Y) and (FPrevCopyDragDrop = ACopyDragDrop) then + Exit + else + FPrevMousePos := cxPoint(X, Y); + if not Dragging then + begin + AControl := GetControlFromPoint(Point(X, Y)); + if AControl <> nil then + SetCaptureControl(AControl); + end; + AAccept := Accept and (DragMode = dmAutomatic); + inherited DragOver(Source, X, Y, State, Accept); + if not Assigned(OnDragOver) then Accept := AAccept; + CaptureController.DragOver(Source, X, Y, State, Accept); + FPrevCopyDragDrop := ACopyDragDrop; +end; + +procedure TcxCustomScheduler.EndDragAndDrop( + Accepted: Boolean); +begin + inherited EndDragAndDrop(Accepted); + CaptureController.EndDragAndDrop(Accepted); +end; + +function TcxCustomScheduler.GetDragAndDropObjectClass: TcxDragAndDropObjectClass; +begin + Result := CaptureController.GetDragAndDropObjectClass; +end; + +function TcxCustomScheduler.GetDragObjectClass: TDragControlObjectClass; +begin + Result := CurrentView.GetDragObjectClass; +end; + +function TcxCustomScheduler.StartDragAndDrop( + const P: TPoint): Boolean; +begin + Result := CaptureController.StartDragAndDrop(P) +end; + +// IcxSchedulerStorageListener +procedure TcxCustomScheduler.StorageChanged(Sender: TObject); +begin + FullRefresh; +end; + +procedure TcxCustomScheduler.StorageRemoved(Sender: TObject); +begin + CurrentView.Controller.CloseInplaceEdit; + FStorage.RemoveListener(Self); + FStorage := nil; + LayoutChanged; +end; + +// IcxFormatControllerListener +procedure TcxCustomScheduler.DoStartOfWeekChanged( + AOldStartOfWeek, ANewStartOfWeek: TDay); +var + I, ADelta: Integer; +begin + ADelta := Ord(ANewStartOfWeek) - Ord(AOldStartOfWeek); + if (ADelta <> 0) and not CurrentView.IsDayView then + begin + for I := 0 to SelectedDays.Count - 1 do + SelectedDays[I] := SelectedDays[I] + ADelta; + end; + OptionsView.CalculateActualStartOfWeek; + FullRefresh; +end; + +procedure TcxCustomScheduler.FormatChanged; +var + I: Integer; +begin + if DateTimeHelper <> nil then DateTimeHelper.Refresh; + if OptionsView.StartOfWeek = swSystem then + DoStartOfWeekChanged(OptionsView.ActualStartOfWeek, + TDay(DateTimeHelper.StartOfWeek)) + else + begin + for I := 0 to SubControlCount - 1 do + SubControls[I].FormatChanged; + FullRefresh; + end; +end; + +// IcxFormatControllerListener2 +procedure TcxCustomScheduler.TimeChanged; +begin + DoUpdateTime; +end; + +// IcxStoredObject +function TcxCustomScheduler.GetObjectName: string; +begin + if FStoringName <> '' then + Result := FStoringName + else + Result := Name; +end; + +function TcxCustomScheduler.GetProperties(AProperties: TStrings): Boolean; +var + I: Integer; +begin + AProperties.Add('SelectedDayCount'); + AProperties.Add('ResourcesPerPage'); + for I := 0 to SubControlCount - 1 do + SubControls[I].GetProperties(AProperties); + Result := True; +end; + +procedure TcxCustomScheduler.GetPropertyValue(const AName: string; + var AValue: Variant); +var + I: Integer; +begin + if AName = 'SelectedDayCount' then + AValue := SelectedDays.Count + else + if AName = 'ResourcesPerPage' then + AValue := OptionsView.ResourcesPerPage + else + for I := 0 to SubControlCount - 1 do + SubControls[I].GetPropertyValue(AName, AValue); +end; + +procedure TcxCustomScheduler.SetPropertyValue(const AName: string; + const AValue: Variant); +var + I: Integer; + ADate: TDateTime; +begin + if AName = 'SelectedDayCount' then + begin + SelectedDays.Clear; + ADate := Date; + for I := 0 to Min(Max(AValue - 1, 0), 41) do + SelectedDays.Add(ADate + I); + end + else + if AName = 'ResourcesPerPage' then + OptionsView.ResourcesPerPage := AValue + else + for I := 0 to SubControlCount - 1 do + SubControls[I].SetPropertyValue(AName, AValue); +end; + +procedure TcxCustomScheduler.CreateUpdateTimeTimer; +begin + FUpdateTimeTimer := TTimer.Create(nil); + FUpdateTimeTimer.Interval := 60 * 1000; + FUpdateTimeTimer.OnTimer := UpdateTimeHandler; +end; + +function TcxCustomScheduler.GetActiveHitTest: TcxSchedulerSubControlHitTest; +var + AControl: TcxSchedulerSubControl; + APos: TPoint; +begin + if (FActiveControl <> nil) and (FCaptureControl = nil) then + Result := FActiveControl.HitTest + else + begin + APos := ScreenToClient(GetMouseCursorPos); + AControl := GetControlFromPoint(APos); + if AControl = Background then + Result := nil + else + begin + AControl.MousePositionChanged(APos.X, APos.Y); + Result := AControl.HitTest; + end; + end; +end; + +function TcxCustomScheduler.GetCaptureControl: TcxSchedulerSubControl; +begin + Result := FCaptureControl; + if FCaptureControl = nil then + Result := Background; +end; + +function TcxCustomScheduler.GetCaptureController: TcxSchedulerSubControlController; +begin + Result := Capture.Controller; +end; + +function TcxCustomScheduler.GetSelectedEventCount: Integer; +begin + Result := EventList.Selection.Count; +end; + +function TcxCustomScheduler.GetSelectedEvent( + AIndex: Integer): TcxSchedulerControlEvent; +begin + Result := EventList.Selection[AIndex] +end; + +function TcxCustomScheduler.GetSelFinish: TDateTime; +begin + Result := Max(FSelStart, FSelFinish); + Result := DateTimeHelper.RoundTime(Result + CurrentView.GetTimeIncrement); + CurrentView.ValidateSelectionFinishTime(Result); +end; + +function TcxCustomScheduler.GetSelStart: TDateTime; +begin + Result := Min(FSelStart, FSelFinish); +end; + +function TcxCustomScheduler.GetIsDynamicUpdate: Boolean; +begin + Result := OptionsCustomize.DynamicSizing and not IsDesigning; +end; + +function TcxCustomScheduler.GetStartOfWeek: TDay; +begin + Result := OptionsView.ActualStartOfWeek; +end; + +function TcxCustomScheduler.GetStorageActive: Boolean; +begin + Result := (FStorage <> nil) and FStorage.IsActive; +end; + +function TcxCustomScheduler.GetStorageValid: Boolean; +begin + Result := FStorage <> nil; +end; + +function TcxCustomScheduler.GetSubControl( + AIndex: Integer): TcxSchedulerSubControl; +begin + Result := TcxSchedulerSubControl(FSubControls[AIndex]) +end; + +function TcxCustomScheduler.GetSubControlCount: Integer; +begin + Result := FSubControls.Count; +end; + +function TcxCustomScheduler.GetVisibleEventCount: Integer; +begin + Result := EventList.Count; +end; + +function TcxCustomScheduler.GetVisibleEvent( + AIndex: Integer): TcxSchedulerControlEvent; +begin + Result := EventList[AIndex]; +end; + +procedure TcxCustomScheduler.InitEventBySelection( + AEvent: TcxSchedulerEvent; AllDay: Boolean; + ARecurrence: Boolean; AInplaceEditing: Boolean); +const + States: array[Boolean] of Byte = (tlsBusy, tlsFree); +begin + if SelResource <> nil then + AEvent.ResourceID := SelResource.ResourceID; + CurrentView.InitEventBySelectedTime(AEvent, AllDay, ARecurrence, AInplaceEditing); + AEvent.State := States[AEvent.AllDayEvent]; +end; + +procedure TcxCustomScheduler.SetCaptureControl( + AValue: TcxSchedulerSubControl); +begin + if FCaptureControl <> AValue then + begin + CaptureController.DoCancelMode; + FCaptureControl := AValue; + end; +end; + +procedure TcxCustomScheduler.SetContentPopupMenu( + AValue: TcxSchedulerContentPopupMenu); +begin + FContentPopupMenu.Assign(AValue); +end; + +procedure TcxCustomScheduler.SetControlBox( + AValue: TcxSchedulerControlBox); +begin + FControlBox.Assign(AValue); +end; + +procedure TcxCustomScheduler.SetDialogsLookAndFeel( + AValue: TcxLookAndFeel); +begin + FDialogsLookAndFeel := AValue; +end; + +procedure TcxCustomScheduler.SetEventImages(AValue: TCustomImageList); +begin + if AValue <> FEventImages then + begin + if FEventImages <> nil then FEventImages.RemoveFreeNotification(Self); + FEventImages := AValue; + if FEventImages <> nil then FEventImages.FreeNotification(Self); + end; +end; + +procedure TcxCustomScheduler.SetEventOperations( + AValue: TcxSchedulerEventOperations); +begin + FEventOperations.Assign(AValue); +end; + +procedure TcxCustomScheduler.SetEventPopupMenu( + AValue: TcxSchedulerEventPopupMenu); +begin + FEventPopupMenu.Assign(AValue); +end; + +procedure TcxCustomScheduler.SetFirstVisibleResourceIndex(AValue: Integer); +begin + AValue := Max(0, AValue); + if AValue <> FFirstVisibleResourceIndex then + begin + FFirstVisibleResourceIndex := AValue; + if CurrentView <> nil then + CurrentView.LayoutChanged; + end; +end; + +procedure TcxCustomScheduler.SetOptionsBehavior(AValue: TcxSchedulerOptionsBehavior); +begin + if AValue <> FOptionsBehavior then + FOptionsBehavior.Assign(AValue); +end; + +procedure TcxCustomScheduler.SetOptionsCustomize( + AValue: TcxSchedulerOptionsCustomize); +begin + FOptionsCustomize.Assign(AValue); +end; + +procedure TcxCustomScheduler.SetOptionsView( + AValue: TcxSchedulerOptionsView); +begin + FOptionsView.Assign(AValue); +end; + +procedure TcxCustomScheduler.SetStorage( + AValue: TcxCustomSchedulerStorage); +begin + if FStorage <> AValue then + begin + if CurrentView <> nil then + CurrentView.Controller.CloseInplaceEdit; + FreeAndNil(FEventList); + FEventList := CreateEventList; + if FStorage <> nil then + FStorage.RemoveListener(Self); + FStorage := AValue; + if FStorage <> nil then + FStorage.AddListener(Self); + FullRefresh; + NotififyStorageChanged; + end; +end; + +procedure TcxCustomScheduler.SetResourceNavigator( + AValue: TcxSchedulerResourceNavigator); +begin + FResourceNavigator.Assign(AValue); +end; + +procedure TcxCustomScheduler.SetStyles( + AValue: TcxSchedulerStyles); +begin + FStyles.Assign(AValue); +end; + +procedure TcxCustomScheduler.UpdateTimeHandler(Sender: TObject); +begin + if CurrentView.Visible then + CurrentView.TimeChanged; + if DateNavigator.Visible then + DateNavigator.CheckCurrentDate; +end; + +procedure TcxCustomScheduler.WMCancelMode(var Message: TWMCancelMode); +begin + FIsDragCanceled := True; + try + inherited; + finally + FIsDragCanceled := False; + end; +end; + +procedure TcxCustomScheduler.WMSetCursor(var Message: TWMSetCursor); +var + P: TPoint; + ACursor: TCursor; +begin + ACursor := crDefault; + P := ScreenToClient(GetMouseCursorPos); + if IsDesigning and (DragAndDropState = ddsNone) and GetDesignHitTest(P.X, P.Y, [ssLeft]) then + ACursor := GetControlFromPoint(P).Controller.GetCursor(P.X, P.Y); + if ACursor <> crDefault then + SetCursor(Screen.Cursors[ACursor]) + else + inherited; +end; + +procedure TcxCustomScheduler.WMTimeChange(var Message: TWMTimeChange); +begin + DoUpdateTime; + Message.Result := 0; +end; + +procedure TcxCustomScheduler.ReadSelectionData(AReader: TReader); +var + I: Integer; +begin + FSelectedDays.Count := AReader.ReadInteger and $FF; + for I := 0 to FSelectedDays.Count - 1 do + FSelectedDays[I] := Date + I; +end; + +procedure TcxCustomScheduler.WriteSelectionData(AWriter: TWriter); +begin + AWriter.WriteInteger(FSelectedDays.Count); +end; + +{ TcxSchedulerPopupMenu } + +constructor TcxSchedulerPopupMenu.Create( + AScheduler: TcxCustomScheduler); +begin + FScheduler := AScheduler; + FUseBuiltInPopupMenu := True; +end; + +destructor TcxSchedulerPopupMenu.Destroy; +begin + PopupMenu := nil; + FreeAndNil(FInternalMenu); + inherited Destroy; +end; + +procedure TcxSchedulerPopupMenu.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerPopupMenu then + begin + PopupMenu := TcxSchedulerPopupMenu(Source).PopupMenu; + UseBuiltInPopupMenu := TcxSchedulerPopupMenu(Source).UseBuiltInPopupMenu; + end; +end; + +function TcxSchedulerPopupMenu.AddValidSeparator(AOwner: TMenuItem): TMenuItem; +begin + if AOwner.Count > 0 then + Result := CreateSeparator(AOwner) + else + Result := nil +end; + +procedure TcxSchedulerPopupMenu.CreateInternalMenu; +begin + FreeAndNil(FInternalMenu); + FInternalMenu := TPopupMenu.Create(nil); + FInternalMenu.Images := MenuImages; + CreateItems; +end; + +procedure TcxSchedulerPopupMenu.CreateItems; +begin +end; + +function TcxSchedulerPopupMenu.CreateSeparator(AOwner: TMenuItem): TMenuItem; +begin + Result := CreateSubItem(AOwner, '-'); +end; + +function TcxSchedulerPopupMenu.CreateSubItem( + AOwner: TMenuItem; const ACaption: string; ACommand: Integer = -1; + AImageIndex: Integer = -1; AEnabled: Boolean = True; AChecked: Boolean = False): TMenuItem; +begin + Result := TMenuItem.Create(nil); + Result.Caption := ACaption; + Result.Enabled := AEnabled; + Result.ImageIndex := AImageIndex; + Result.Checked := AChecked; + Result.Tag := ACommand; + Result.OnClick := OnItemClickHandler; + AOwner.Add(Result); +end; + +procedure TcxSchedulerPopupMenu.DoExecute(ACommand: Integer); +begin +end; + +function TcxSchedulerPopupMenu.DoOnClick(ACommand: Integer): Boolean; +begin + Result := False; +end; + +function TcxSchedulerPopupMenu.DoOnPopup: Boolean; +begin + Result := False; +end; + +procedure TcxSchedulerPopupMenu.ExecuteCommand(ACommand: Integer); +begin + if IsValidCommand(ACommand) and not DoOnClick(ACommand) then + DoExecute(ACommand); +end; + +function TcxSchedulerPopupMenu.FindItemByCommand(AOwnerItem: TMenuItem; + ACommand: Integer): TMenuItem; +var + I: Integer; +begin + Result := nil; + if (InternalMenu = nil) or (AOwnerItem = nil) then Exit; + with AOwnerItem do + for I := 0 to Count - 1 do + if (Items[I].Tag = Ord(ACommand)) and (Items[I].Caption <> '-') then + begin + Result := Items[I]; + system.Break; + end; +end; + +function TcxSchedulerPopupMenu.IsValidCommand(ACommand: Integer): Boolean; +begin + Result := True; +end; + +procedure TcxSchedulerPopupMenu.Notification(AComponent: TComponent; + Operation: TOperation); +begin + if (Operation = opRemove) and (AComponent = PopupMenu) then + PopupMenu := nil; +end; + +function TcxSchedulerPopupMenu.Popup(X, Y: Integer): Boolean; +begin + with Scheduler.HintController do + begin + HideHint; + FLockHint := True; + end; + try + CreateInternalMenu; + Result := DoOnPopup; + if not Result then + begin + if UseBuiltInPopupMenu then + Result := ShowPopupMenu(Scheduler, FInternalMenu, X, Y) + else + Result := ShowPopupMenu(Scheduler, FPopupMenu, X, Y); + end; + finally + Scheduler.HintController.FLockHint := False; + end; +end; + +procedure TcxSchedulerPopupMenu.OnItemClickHandler(Sender: TObject); +begin + if Sender is TComponent then + ExecuteCommand(TComponent(Sender).Tag); +end; + +function TcxSchedulerPopupMenu.Storage: TcxCustomSchedulerStorage; +begin + Result := Scheduler.Storage; +end; + +function TcxSchedulerPopupMenu.GetRoot: TMenuItem; +begin + Result := FInternalMenu.Items; +end; + +procedure TcxSchedulerPopupMenu.SetPopupMenu(const Value: TComponent); +begin + if FPopupMenu <> Value then + begin + if (FPopupMenu <> nil) and not (csDestroying in FPopupMenu.ComponentState) then + FPopupMenu.RemoveFreeNotification(Scheduler); + FPopupMenu := Value; + if FPopupMenu <> nil then + FPopupMenu.FreeNotification(Scheduler); + end; +end; + +{ TcxSchedulerCustomContentPopupMenu } + +constructor TcxSchedulerCustomContentPopupMenu.Create( + AScheduler: TcxCustomScheduler); +begin + inherited Create(AScheduler); + FNewID := -1; + FAllDayID := -1; + FReccurenceID := -1; +end; + +function TcxSchedulerCustomContentPopupMenu.CanCreateEvent: Boolean; +begin + Result := Scheduler.CurrentView.Controller.CanCreateEventUsingDialog; +end; + +procedure TcxSchedulerCustomContentPopupMenu.CreateNewEventItems(ANew, + AllDay, AReccurence: Boolean; ANewID, AllDayID, AReccurenceID: Integer); +var + AEnabled: Boolean; +begin + AEnabled := CanCreateEvent; + if ANew then + begin + CreateSubItem(Root, cxGetResourceString(@scxpmNewEvent), + ANewID, 2, AEnabled); + FNewID := ANewID; + end; + if AllDay then + begin + CreateSubItem(Root, cxGetResourceString(@scxpmNewAllDayEvent), + AllDayID, -1, AEnabled); + FAllDayID := AllDayID; + end; + if Scheduler.StorageActive and Storage.IsRecurrenceAvailable and + AReccurence and Scheduler.EventOperations.Recurrence then + begin + CreateSubItem(Root, cxGetResourceString(@scxpmNewRecurringEvent), + AReccurenceID, 3, AEnabled); + FReccurenceID := AReccurenceID; + end; + AddValidSeparator(Root); +end; + +procedure TcxSchedulerCustomContentPopupMenu.DoExecute(ACommand: Integer); +begin + if ACommand <> -1 then + begin + if ACommand = FNewID then + Scheduler.CreateEventUsingDialog + else if ACommand = FAllDayID then + Scheduler.CreateEventUsingDialog(True) + else if ACommand = FReccurenceID then + Scheduler.CreateEventUsingDialog(False, True); + end; +end; + +{ TcxSchedulerContentPopupMenu } + +constructor TcxSchedulerContentPopupMenu.Create( + AScheduler: TcxCustomScheduler); +begin + inherited Create(AScheduler); + FItems := [cpmiNewEvent, cpmiNewAllDayEvent, cpmiNewReccuringEvent, + cpmiToday, cpmiGoToDate, cpmiGoToThisDay, cpmiResourcesLayout]; +end; + +procedure TcxSchedulerContentPopupMenu.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerContentPopupMenu then + begin + Items := TcxSchedulerContentPopupMenu(Source).Items; + OnClick := TcxSchedulerContentPopupMenu(Source).OnClick; + OnPopup := TcxSchedulerContentPopupMenu(Source).OnPopup; + end; +end; + +procedure TcxSchedulerContentPopupMenu.Execute( + AItem: TcxSchedulerContentPopupMenuItem); +begin + ExecuteCommand(Ord(AItem)); +end; + +function TcxSchedulerContentPopupMenu.GetMenuItem( + AItem: TcxSchedulerContentPopupMenuItem): TMenuItem; +begin + Result := FindItemByCommand(Root, Ord(AItem)); +end; + +procedure TcxSchedulerContentPopupMenu.CreateItems; +begin + FActualItems := FItems; + if Scheduler.CurrentView <> nil then + Scheduler.CurrentView.ValidateContentPopupMenuItems(FActualItems); + CreateNewEventItems(cpmiNewEvent in ActualItems, cpmiNewAllDayEvent in ActualItems, + cpmiNewReccuringEvent in ActualItems, Ord(cpmiNewEvent), Ord(cpmiNewAllDayEvent), + Ord(cpmiNewReccuringEvent)); + CreateGoToThisDayItem; + if cpmiToday in ActualItems then + CreateSubItem(Root, cxGetResourceString(@scxpmToday), Ord(cpmiToday)); + if cpmiGoToDate in ActualItems then + CreateSubItem(Root, cxGetResourceString(@scxpmGoToDate), Ord(cpmiGoToDate)); + if (cpmiResourcesLayout in ActualItems) and Scheduler.CurrentView.IsShowResources then + begin + AddValidSeparator(Root); + CreateSubItem(Root, cxGetResourceString(@scxpmResourcesLayout), Ord(cpmiResourcesLayout)); + end; +end; + +procedure TcxSchedulerContentPopupMenu.DoExecute(ACommand: Integer); +var + ADate: TDateTime; + AViewMode: TcxSchedulerViewMode; +begin + case ACommand of + Ord(cpmiNewEvent), Ord(cpmiNewAllDayEvent), Ord(cpmiNewReccuringEvent): + inherited DoExecute(ACommand); + Ord(cpmiResourcesLayout): + cxShowResourcesLayoutEditor(Scheduler.Storage, Scheduler.DialogsLookAndFeel); + Ord(cpmiGoToThisDay): + Scheduler.GoToDate(FSavedDate, vmDay); + Ord(cpmiToday): + Scheduler.GoToDate(Date); + Ord(cpmiGoToDate): + begin + ADate := DateOf(Scheduler.SelStart); + if cxShowGoToDateDialog(Scheduler, Scheduler.DialogsLookAndFeel, ADate, AViewMode) then + Scheduler.GoToDate(ADate, AViewMode); + end; + end; +end; + +function TcxSchedulerContentPopupMenu.DoOnClick(ACommand: Integer): Boolean; +begin + Result := False; + if Assigned(FOnClick) then + FOnClick(Self, TcxSchedulerContentPopupMenuItem(ACommand), Result); +end; + +function TcxSchedulerContentPopupMenu.DoOnPopup: Boolean; +begin + Result := False; + if Assigned(FOnPopup) then + FOnPopup(Self, InternalMenu, Result); +end; + +function TcxSchedulerContentPopupMenu.IsValidCommand( + ACommand: Integer): Boolean; +begin + Result := (ACommand >= Ord(cpmiNewEvent)) and (ACommand <= Ord(cpmiResourcesLayout)); +end; + +procedure TcxSchedulerContentPopupMenu.CreateGoToThisDayItem; +var + AItem: TMenuItem; +begin + if (cpmiGoToThisDay in ActualItems) and not Scheduler.CurrentView.IsDayView then + begin + AItem := CreateSubItem(Root, cxGetResourceString(@scxpmGotoThisDay), Ord(cpmiGoToThisDay)); + AItem.Enabled := Scheduler.ActiveHitTest.HitAtTime; + if AItem.Enabled then + FSavedDate := Scheduler.ActiveHitTest.Time; + end; +end; + +{ TcxSchedulerEventPopupMenu } + +constructor TcxSchedulerEventPopupMenu.Create( + AScheduler: TcxCustomScheduler); +begin + inherited Create(AScheduler); + FItems := [epmiOpen, epmiEditSeries, epmiShowTimeAs, epmiLabel, epmiDelete]; +end; + +procedure TcxSchedulerEventPopupMenu.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerEventPopupMenu then + begin + Items := TcxSchedulerEventPopupMenu(Source).Items; + OnClick := TcxSchedulerEventPopupMenu(Source).OnClick; + OnPopup := TcxSchedulerEventPopupMenu(Source).OnPopup; + end; +end; + +procedure TcxSchedulerEventPopupMenu.CreateItems; + + function GetEditEnabled: Boolean; + begin + Result := (Event <> nil) and Scheduler.CanShowEventDialog; + end; + +begin + FEvent := GetEvent; + if epmiOpen in Items then + CreateSubItem(Root, cxGetResourceString(@scxpmOpen), Ord(epmiOpen)).Enabled := + GetEditEnabled; + if (epmiEditSeries in Items) and (Event <> nil) and (Event.EventType <> etNone) then + CreateSubItem(Root, cxGetResourceString(@scxpmEditSeries), Ord(epmiEditSeries), 8).Enabled := + GetEditEnabled; + if Items * [epmiLabel, epmiShowTimeAs] <> [] then + AddValidSeparator(Root); + CreateTimeItems; + CreateLabelItems; + CreateDeleteItem; +end; + +procedure TcxSchedulerEventPopupMenu.DoExecute(ACommand: Integer); +begin + case ACommand of + Ord(epmiOpen): + Scheduler.EditEventUsingDialog(Event); + Ord(epmiEditSeries): + Scheduler.EditEventUsingDialog(Event, True, True); + Ord(epmiDelete): + Scheduler.InternalDeleteSelectedEvents(False, True); + 10..13: + SetEventState(ACommand - 10); + else + if (ACommand >= 20) and (ACommand < 20 + EventLabels.Count) then + SetEventLabelColor(EventLabels[ACommand - 20].Color); + end; +end; + +function TcxSchedulerEventPopupMenu.DoOnClick(ACommand: Integer): Boolean; +var + AItem: TcxSchedulerEventPopupMenuItem; + ASubItemIndex: Integer; +begin + Result := False; + UnpackCommand(ACommand, AItem, ASubItemIndex); + if Assigned(FOnClick) then + FOnClick(Self, AItem, ASubItemIndex, Result); +end; + +function TcxSchedulerEventPopupMenu.DoOnPopup: Boolean; +begin + Result := False; + if Assigned(FOnPopup) then + FOnPopup(Self, InternalMenu, Result); +end; + +function TcxSchedulerEventPopupMenu.GetMenuItem( + AItem: TcxSchedulerEventPopupMenuItem; ASubItemIndex: Integer = -1): TMenuItem; +begin + Result := FindItemByCommand(Root, Ord(AItem)); + if Result <> nil then + begin + if (AItem = epmiLabel) and (ASubItemIndex in [0..10]) then + Result := FindItemByCommand(Result, ASubItemIndex + 20) + else + if (AItem = epmiShowTimeAs) and (ASubItemIndex in [0..3]) then + Result := FindItemByCommand(Result, ASubItemIndex + 10) + end; +end; + +function TcxSchedulerEventPopupMenu.IsValidCommand( + ACommand: Integer): Boolean; +begin + Result := (ACommand >= Ord(epmiOpen)) and (ACommand <= Ord(epmiDelete)) or + (ACommand in [20..20 + EventLabels.Count - 1]) or //Label + (ACommand in [10..13]); //TimeLine +end; + +procedure TcxSchedulerEventPopupMenu.SetEventLabelColor(AColor: Integer); +begin + if Event = nil then Exit; + if Event.EventType = etOccurrence then + Event.Pattern.LabelColor := AColor + else + Event.Source.LabelColor := AColor; +end; + +procedure TcxSchedulerEventPopupMenu.SetEventState(AState: Integer); +begin + if Event = nil then Exit; + Event.State := AState; + Scheduler.EventList.PostEvent(Event); +end; + +procedure TcxSchedulerEventPopupMenu.CreateDeleteItem; + + function CanDelete: Boolean; + var + I: Integer; + begin + with Scheduler do + begin + Result := EventOperations.Deleting; + if Result then + begin + for I := 0 to SelectedEventCount - 1 do + if not SelectedEvents[I].ReadOnly then + Exit; + Result := False; + end; + end; + end; + +begin + if epmiDelete in Items then + begin + AddValidSeparator(Root); + CreateSubItem(Root, cxGetResourceString(@scxpmDelete), Ord(epmiDelete), 10).Enabled := CanDelete; + end; +end; + +procedure TcxSchedulerEventPopupMenu.CreateLabelItems; +var + AOwner: TMenuItem; + I: Integer; + + function GetColorChecked(AColor: TColor): Boolean; + begin + if Event = nil then + Result := False + else + Result := ColorToRgb(Event.LabelColor) = ColorToRgb(AColor); + end; + + procedure CreateEventColorItem(ALabel: TcxSchedulerEventLabel); + var + AChecked: Boolean; + AItem: TMenuItem; + begin + AChecked := GetColorChecked(ALabel.Color); + AItem := CreateSubItem(AOwner, ALabel.Caption, + GetCommand(epmiLabel, ALabel.Index), -1, CanEdit, AChecked); + AItem.Default := AChecked; + EventLabels.Images.GetBitmap(ALabel.Index, AItem.Bitmap); + end; + +begin + if not (epmiLabel in Items) or not Scheduler.StorageActive or + not Storage.IsLabelColorAvailable or (EventLabels.Count = 0) then Exit; + AOwner := CreateSubItem(Root, cxGetResourceString(@scxpmLabel), Ord(epmiLabel)); + //label colors + CreateEventColorItem(EventLabels[0]); + if EventLabels.Count > 1 then + begin + CreateSeparator(AOwner); + for I := 1 to EventLabels.Count - 1 do + CreateEventColorItem(EventLabels[I]); + end; +end; + +procedure TcxSchedulerEventPopupMenu.CreateTimeItems; +var + AOwner: TMenuItem; + ACanSetNonFree: Boolean; + + function GetTimeLineChecked(AIndex: Integer): Boolean; + begin + if Event = nil then + Result := False + else + Result := Integer(Event.State) = AIndex; + end; + + function CanSetNonFree: Boolean; + var + APrevState: Integer; + begin + if Event = nil then + begin + Result := False; + Exit; + end; + APrevState := Event.State; + Event.State := tlsBusy; + try + Result := Scheduler.CanIntersect(Event); + finally + Event.State := APrevState; + end; + end; + + procedure CreateTimeLineItem(const ACaption: string; AIndex: Integer); + var + AChecked: Boolean; + begin + AChecked := GetTimeLineChecked(AIndex); + CreateSubItem(AOwner, ACaption, GetCommand(epmiShowTimeAs, AIndex), AIndex, + CanEdit and ((AIndex = 0) or (ACanSetNonFree)), AChecked).Default := AChecked; + end; + +begin + if not (epmiShowTimeAs in Items) or not Scheduler.StorageActive or + not Storage.IsStateAvailable then Exit; + AOwner := CreateSubItem(Root, cxGetResourceString(@scxpmShowTimeAs), Ord(epmiShowTimeAs)); + AOwner.SubMenuImages := TimeLinePatterns; + // TimeLine styles + ACanSetNonFree := CanSetNonFree; + CreateTimeLineItem(cxGetResourceString(@scxpmFree), 0); + CreateTimeLineItem(cxGetResourceString(@scxpmTentative), 1); + CreateTimeLineItem(cxGetResourceString(@scxpmBusy), 2); + CreateTimeLineItem(cxGetResourceString(@scxpmOutOfOffice), 3); +end; + +function TcxSchedulerEventPopupMenu.GetCommand( + AItem: TcxSchedulerEventPopupMenuItem; ASubItemIndex: Integer): Integer; +begin + Result := Ord(AItem); + case AItem of + epmiShowTimeAs: + if (ASubItemIndex >= 0) and (ASubItemIndex <= 3) then + Result := 10 + ASubItemIndex; + epmiLabel: + if (ASubItemIndex >= 0) and (ASubItemIndex < EventLabels.Count) then + Result := 20 + ASubItemIndex; + end; +end; + +function TcxSchedulerEventPopupMenu.CanEdit: Boolean; +begin + Result := (Event <> nil) and not Event.ReadOnly and + not Scheduler.EventOperations.ReadOnly; +end; + +function TcxSchedulerEventPopupMenu.GetEvent: TcxSchedulerControlEvent; +begin + with Scheduler.EventList.Selection do + begin + if Count = 1 then + Result := Items[0] + else + Result := nil; + end; +end; + +procedure TcxSchedulerEventPopupMenu.UnpackCommand(ACommand: Integer; + out AItem: TcxSchedulerEventPopupMenuItem; out ASubItemIndex: Integer); +begin + AItem := epmiOpen; + ASubItemIndex := -1; + if not IsValidCommand(ACommand) then Exit; + if ACommand in [20..20 + EventLabels.Count - 1] then + begin + AItem := epmiLabel; + ASubItemIndex := ACommand - 20; + end + else + if ACommand in [10..13] then + begin + AItem := epmiShowTimeAs; + ASubItemIndex := ACommand - 10; + end + else + AItem := TcxSchedulerEventPopupMenuItem(ACommand); +end; + +end. + diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerCustomResourceView.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerCustomResourceView.pas new file mode 100644 index 00000000..784611b9 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerCustomResourceView.pas @@ -0,0 +1,6977 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerCustomResourceView; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Windows, Graphics, SysUtils, StdCtrls, Classes, Forms, Controls, Contnrs, + cxClasses, cxGraphics, +{$IFDEF DELPHI6} + DateUtils, Variants, +{$ENDIF} cxGeometry, Math, cxStyles, cxEdit, cxContainer, + cxSchedulerStorage, cxSchedulerUtils, cxSchedulerCustomControls, cxLookAndFeelPainters, + cxDateUtils, ImgList, cxEditUtils, cxSchedulerStrs, cxLookAndFeels; + +const + // default values + cxTimeLineWidth: Integer = 7; + cxEventImagesOffset = 1; + cxEventBorderWidth = 1; + + cxHitDelta: Integer = 4; + + // hittest constants + htcButton = $3; + htcContainer = $4; + htcTimeRuler = $5; + htcTimeZoneLabel = $6; + htcContent = $7; + htcDayHeader = $8; + htcGroupSeparator = $9; + htcResourceHeader = $10; + htcNavigationButton = $16; + +type + TcxSchedulerCustomViewInfoItem = class; + TcxSchedulerCustomResourceViewViewInfo = class; + TcxSchedulerCustomResourceViewHitTest = class; + TcxSchedulerBackgroundCellViewInfo = class; + TcxSchedulerContentCellViewInfo = class; + TcxSchedulerDayHeaderCellViewInfo = class; + TcxSchedulerEventCellViewInfo = class; + TcxSchedulerExternalPainter = class; + TcxSchedulerGroupSeparatorCellViewInfo = class; + TcxSchedulerHeaderCellViewInfo = class; + TcxSchedulerMoreEventsButtonViewInfo = class; + TcxSchedulerResourceViewInfo = class; + TcxCustomResourceViewAdapter = class; + TcxSchedulerEventLayoutBuilder = class; + TcxSchedulerEventImages = class; + TcxSchedulerContentNavigationButtonViewInfo = class; + TcxSchedulerCachedImage = class; + + TcxSchedulerContentNavigationButtonKind = (nbkPrevious, nbkNext); + TcxSchedulerColumnPositionInResource = (cprIndefinite, cprFirst, cprLast, cprSingle); + + // custom draw event types definition + + TcxSchedulerCustomDrawBackgroundEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + AViewInfo: TcxSchedulerBackgroundCellViewInfo; var ADone: Boolean) of object; + + TcxSchedulerCustomDrawButtonEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + AViewInfo: TcxSchedulerMoreEventsButtonViewInfo; var ADone: Boolean) of object; + + TcxSchedulerCustomDrawDayHeaderEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + AViewInfo: TcxSchedulerDayHeaderCellViewInfo; var ADone: Boolean) of object; + + TcxSchedulerCustomDrawNavigationButtonEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + AViewInfo: TcxSchedulerContentNavigationButtonViewInfo; var ADone: Boolean) of object; + + TcxSchedulerCustomDrawResourceHeaderEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + AViewInfo: TcxSchedulerHeaderCellViewInfo; var ADone: Boolean) of object; + + TcxSchedulerCustomDrawContentEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + AViewInfo: TcxSchedulerContentCellViewInfo; var ADone: Boolean) of object; + + TcxSchedulerCustomDrawEventEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + AViewInfo: TcxSchedulerEventCellViewInfo; var ADone: Boolean) of object; + + TcxSchedulerCustomDrawGroupSeparatorEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + AViewInfo: TcxSchedulerGroupSeparatorCellViewInfo; var ADone: Boolean) of object; + + { IcxSchedulerCommonViewItemsPainter } + + IcxSchedulerCommonViewItemsPainter = interface + ['{0702AB17-C2F1-479D-B809-C3B972F8A334}'] + procedure DoCustomDrawBackground( + AViewInfo: TcxSchedulerBackgroundCellViewInfo; var ADone: Boolean); + procedure DoCustomDrawButton( + AViewInfo: TcxSchedulerMoreEventsButtonViewInfo; var ADone: Boolean); + procedure DoCustomDrawContent( + AViewInfo: TcxSchedulerContentCellViewInfo; var ADone: Boolean); + procedure DoCustomDrawDayHeader( + AViewInfo: TcxSchedulerDayHeaderCellViewInfo; var ADone: Boolean); + procedure DoCustomDrawEvent( + AViewInfo: TcxSchedulerEventCellViewInfo; var ADone: Boolean); + procedure DoCustomDrawGroupSeparator( + AViewInfo: TcxSchedulerGroupSeparatorCellViewInfo; var ADone: Boolean); + procedure DoCustomDrawNavigationButton( + AViewInfo: TcxSchedulerContentNavigationButtonViewInfo; var ADone: Boolean); + procedure DoCustomDrawResourceHeader( + AViewInfo: TcxSchedulerHeaderCellViewInfo; var ADone: Boolean); + //cached paint + function HasCustomDrawGroupSeparator: Boolean; + function HasCustomDrawResourceHeader: Boolean; + end; + + { IcxSchedulerEventImages } + + IcxSchedulerEventImages = interface + ['{4C5A8F8B-5356-4D2B-9972-507A7D60954A}'] + procedure DoInitEventImages(AEvent: TcxSchedulerControlEvent; + AImages: TcxSchedulerEventImages); + function GetImages: TCustomImageList; + function SupportEventImages: Boolean; + end; + + { TcxSchedulerViewInfoCellList } + + TcxSchedulerCustomDrawItemProc = procedure( + AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean) of object; + + TcxSchedulerViewInfoCellList = class(TList) + private + function GetItem(AIndex: Integer): TcxSchedulerCustomViewInfoItem; + public + function CalculateHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest): Boolean; + procedure Clear; override; + procedure Draw(ACanvas: TcxCanvas; ADrawItemProc: TcxSchedulerCustomDrawItemProc); + + property Items[Index: Integer]: TcxSchedulerCustomViewInfoItem read GetItem; default; + end; + + { TcxSchedulerCustomViewInfoItem } + + TcxSchedulerCustomViewInfoItem = class + private + FCache: TcxSchedulerCachedImage; + function GetBitmap: TBitmap; + function GetColor: TColor; + function GetDateTimeHelper: TcxSchedulerDateTimeHelperClass; + function GetHeight: Integer; + function GetPainterHelper: TcxSchedulerPainterHelperClass; + function GetTextColor: TColor; + function GetWidth: Integer; + procedure SetBitmap(AValue: TBitmap); + procedure SetColor(AValue: TColor); + procedure SetTextColor(AValue: TColor); + protected + FBackgroundDrawing: Boolean; + FBorders: TcxBorders; + FBounds: TRect; + FCanvas: TcxCanvas; + FClipRect: TRect; + FClipRgn: TcxRegion; + FClipRef: Integer; + FDateTime: TDateTime; + FDayBorderColor: TColor; + FDisplayText: string; + FExternalPainter: TcxSchedulerExternalPainter; + FHasClipping: Boolean; + FPainter: TcxCustomLookAndFeelPainterClass; + FSavedClipRgn: TcxRegion; + FTransparent: Boolean; + FViewParams: TcxViewParams; + FVisible: Boolean; + procedure CalculateCellBounds(const ABounds, AVisibleRect: TRect); + procedure ClippingCreate(AHasClipping: Boolean); virtual; + procedure ClippingRestore; + procedure DoDraw; virtual; abstract; + function DrawBackground(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; virtual; + procedure DrawFrame(const ARect: TRect; ABorders: TcxBorders = []; + ABorderColor: TColor = clDefault; ALineWidth: Integer = 1); + procedure DrawRect(const ARect: TRect; ABorders: TcxBorders = []; + ABorderColor: TColor = clDefault; ALineWidth: Integer = 1); + procedure DrawText(const ARect: TRect; const AText: string; + AFlags: Integer; AFont: TFont = nil; AColor: TColor = clDefault); + function GetFont: TFont; virtual; + function GetHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest; var ABreak: Boolean): Boolean; virtual; + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); virtual; + procedure RotateBitmap(ABitmap: TBitmap; ARotationAngle: TcxRotationAngle; AFlipHorizontally: Boolean = False); + // custom draw support + procedure AfterCustomDraw(ACanvas: TcxCanvas); virtual; + procedure BeforeCustomDraw(ACanvas: TcxCanvas); virtual; + procedure UpdateCachedImage(const AViewParams: TcxViewParams); virtual; + + + property Cache: TcxSchedulerCachedImage read FCache write FCache; + + // class item settings + property DateTimeHelper: TcxSchedulerDateTimeHelperClass read GetDateTimeHelper; + property DisplayText: string read FDisplayText write FDisplayText; + property PainterHelper: TcxSchedulerPainterHelperClass read GetPainterHelper; + property ExternalPainter: TcxSchedulerExternalPainter read FExternalPainter; + public + constructor Create(APainter: TcxCustomLookAndFeelPainterClass; + const ABounds, AVisibleRect: TRect; const AViewParams: TcxViewParams); virtual; + destructor Destroy; override; + procedure Draw(ACanvas: TcxCanvas); virtual; + + property Borders: TcxBorders read FBorders write FBorders; + property Bounds: TRect read FBounds; + property Bitmap: TBitmap read GetBitmap write SetBitmap; + property Canvas: TcxCanvas read FCanvas; + property ClipRect: TRect read FClipRect; + property Color: TColor read GetColor write SetColor; + property Font: TFont read GetFont; + property Height: Integer read GetHeight; + property Painter: TcxCustomLookAndFeelPainterClass read FPainter; + property TextColor: TColor read GetTextColor write SetTextColor; + property Transparent: Boolean read FTransparent write FTransparent; + property ViewParams: TcxViewParams read FViewParams; + property Visible: Boolean read FVisible; + property Width: Integer read GetWidth; + end; + + { TcxSchedulerBackgroundCellViewInfo } + + TcxSchedulerBackgroundCellViewInfo = class(TcxSchedulerCustomViewInfoItem) + protected + procedure DoDraw; override; + end; + + TcxSchedulerCustomViewInfoItemClass = class of TcxSchedulerCustomViewInfoItem; + + { TcxSchedulerCustomResourceViewInfoItem } + + TcxSchedulerCustomResourceViewInfoItem = class(TcxSchedulerCustomViewInfoItem) + private + FIsResourceAssigned: Boolean; + FTimeFinish: TDateTime; + FResource: TcxSchedulerResourceViewInfo; + protected + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + + property DateTime: TDateTime read FDateTime write FDateTime; + property IsResourceAssigned: Boolean read FIsResourceAssigned; + property Resource: TcxSchedulerResourceViewInfo read FResource write FResource; + property TimeFinish: TDateTime read FTimeFinish; + end; + + { TcxSchedulerHeaderCellViewInfo } + + TcxSchedulerHeaderCellViewInfo = class(TcxSchedulerCustomResourceViewInfoItem) + protected + DisplayBounds: TRect; + FAlignHorz: TAlignment; + FAlignVert: TcxAlignmentVert; + FAutoHeight: Boolean; + FButtonState: TcxButtonState; + FDrawRotatedBackground: Boolean; + FImageIndex: Integer; + FImagePosition: TcxSchedulerHeaderImagePosition; + FImages: TCustomImageList; + FImageRectAssigned: Boolean; + FImageRect: TRect; + FIsResourceHeader: Boolean; + FMultiLine: Boolean; + FNeighbors: TcxNeighbors; + FRotateBitmap: TcxBitmap; + FRotateHeader: Boolean; + FRotateText: Boolean; + FSelected: Boolean; + FSelectionBitmap: TcxBitmap; + FSelectionColor: TColor; + FSelectionRect: TRect; + FSelectionTextColor: TColor; + FShowEndEllipsis: Boolean; + FTextRect: TRect; + procedure CheckNeighbor(APrevCell: TcxSchedulerHeaderCellViewInfo); + function CheckSelection: Boolean; virtual; + procedure DoDraw; override; + procedure DrawCaption(ACanvas: TcxCanvas = nil); + procedure DrawHorizontalHeader; virtual; + function DrawRotateBackground(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; virtual; + procedure DrawSelection; virtual; + procedure DrawVerticalHeader; virtual; + function GetTextOutcxFlags: Integer; + function GetTextOutFlags: Integer; + function HasImage: Boolean; + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + procedure TextOut(ACanvas: TcxCanvas; const AText: string; R: TRect); + procedure ValidateSelection; + public + constructor Create(APainter: TcxCustomLookAndFeelPainterClass; + const ABounds, AVisibleRect: TRect; const AViewParams: TcxViewParams); override; + destructor Destroy; override; + procedure Calculate(const AText: string); virtual; + procedure CalculateImageLayout; + + property AlignHorz: TAlignment read FAlignHorz write FAlignHorz; + property AlignVert: TcxAlignmentVert read FAlignVert write FAlignVert; + property AutoHeight: Boolean read FAutoHeight; + property DateTime: TDateTime read FDateTime write FDateTime; + property ImageIndex: Integer read FImageIndex; + property ImagePosition: TcxSchedulerHeaderImagePosition read FImagePosition; + property ImageRect: TRect read FImageRect; + property Images: TCustomImageList read FImages; + property IsResourceHeader: Boolean read FIsResourceHeader; + property MultiLine: Boolean read FMultiLine write FMultiLine; + property Neighbors: TcxNeighbors read FNeighbors write FNeighbors; + property RotateHeader: Boolean read FRotateHeader write FRotateHeader; + property RotateText: Boolean read FRotateText write FRotateText; + property Selected: Boolean read FSelected write FSelected; + property SelectionColor: TColor read FSelectionColor write FSelectionColor; + property SelectionTextColor: TColor read FSelectionTextColor write FSelectionTextColor; + property ShowEndEllipsis: Boolean read FShowEndEllipsis write FShowEndEllipsis; + property TextRect: TRect read FTextRect; + property Bounds; + property DisplayText; + property Painter; + property Resource; + end; + + { TcxSchedulerDayHeaderCellViewInfo } + + TcxSchedulerDayHeaderCellViewInfo = class(TcxSchedulerHeaderCellViewInfo) + private + FCompressed: Boolean; + protected + function CheckSelection: Boolean; override; + function DrawBackground(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; override; + procedure DrawHorizontalHeader; override; + public + function ConvertDateToDisplayText(AType: Integer = 0): Integer; virtual; + + property Compressed: Boolean read FCompressed write FCompressed; + end; + + { TcxSchedulerWeekDayHeaderCellViewInfo } + + TcxSchedulerWeekDayHeaderCellViewInfo = class(TcxSchedulerDayHeaderCellViewInfo) + protected + function GetDayText(AType: Integer): string; + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + public + function ConvertDateToDisplayText(AType: Integer = 0): Integer; override; + end; + + { TcxSchedulerContainerCellViewInfo } + + TcxSchedulerContainerCellViewInfo = class(TcxSchedulerCustomResourceViewInfoItem) + protected + FLineCount: Integer; + FSelected: Boolean; + procedure DoDraw; override; + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + public + property LineCount: Integer read FLineCount write FLineCount; + property DateTime; + property Resource; + property Selected: Boolean read FSelected write FSelected; + end; + + { TcxSchedulerTimeRulerCellViewInfo } + + TcxSchedulerTimeRulerCellViewInfo = class(TcxSchedulerCustomViewInfoItem) + private + FLastVisibleHour: Boolean; + function GetBoundsRect(AType: Boolean): TRect; + function GetDisplayText(AType: Boolean): string; + function GetHasAdditionalTimeZone: Boolean; + protected + FAdditionalTimeZone: Integer; + FAdditionalTimeZoneBiasDelta: Integer; + FBounds: array[Boolean] of TRect; + FDisplayTexts: array[Boolean] of string; + FHour: Integer; + FLargeFont: TFont; + FLineCount: Integer; + FShowMinutes: Boolean; + FTimeZone: Integer; + procedure CalculateDisplayInfo; + procedure DoDraw; override; + procedure DrawTimeZone(const ABounds: TRect; const AText: string; AIsCurrent: Boolean); virtual; + procedure DrawTimeZoneLabel(const ABounds: TRect; const AText: string; ABorders: TcxBorders); virtual; + procedure DrawCurrentTime(const AStart: TDateTime; ABounds: TRect); + function GetAdditionalTime: TDateTime; + function GetTimeDisplayText(const ATime: TDateTime): string; + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + // + procedure AfterCustomDraw(ACanvas: TcxCanvas); override; + public + class function CalculateWidth(ATimeZoneCount, ALineCount: Integer; AFont1, AFont2: TFont): Integer; + procedure Calculate(const ALabel1, ALabel2: string; ATimeZone, AAdditionalTimeZone: Integer; + AAdditionalTimeZoneBiasDelta: Integer); overload; virtual; + procedure Calculate(AHour, ALineCount: Integer; ATimeZone, AAdditionalTimeZone: Integer; + ALargeFont: TFont; AAdditionalTimeZoneBiasDelta: Integer); overload; virtual; + procedure SetBottom(AValue: Integer); + + property AdditionalTimeZone: Integer read FAdditionalTimeZone; + property Bounds[ACurrentTimeZone: Boolean]: TRect read GetBoundsRect; + property DisplayTexts[ACurrentTimeZone: Boolean]: string read GetDisplayText; + property HasAdditionalTimeZone: Boolean read GetHasAdditionalTimeZone; + property Hour: Integer read FHour; + property LargeFont: TFont read FLargeFont; + property LastVisibleHour: Boolean read FLastVisibleHour write FLastVisibleHour; + property LineCount: Integer read FLineCount; + property ShowMinutes: Boolean read FShowMinutes write FShowMinutes; + property TimeZone: Integer read FTimeZone; + end; + + { TcxSchedulerContentCellViewInfo } + + TcxSchedulerContentCellViewInfo = class(TcxSchedulerCustomResourceViewInfoItem) + protected + FBorderColor: TColor; + FDontPrint: Boolean; + FLineCount: Integer; + FShowTimeLine: Boolean; + FTimeEvent: TcxSchedulerEventCellViewInfo; + FTimeLineBorders: TcxBorders; + FTimeLineParams: TcxViewParams; + procedure DoDraw; override; + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + public + constructor Create(APainter: TcxCustomLookAndFeelPainterClass; + const ABounds, AVisibleRect: TRect; const AViewParams: TcxViewParams); override; + procedure SetTime(const ATimeStart, ATimeFinish: TDateTime); + + property BorderColor: TColor read FBorderColor write FBorderColor; + property DontPrint: Boolean read FDontPrint write FDontPrint; + property LineCount: Integer read FLineCount write FLineCount; + property ShowTimeLine: Boolean read FShowTimeLine write FShowTimeLine; + property TimeEvent: TcxSchedulerEventCellViewInfo read FTimeEvent write FTimeEvent; + property TimeLineBorders: TcxBorders read FTimeLineBorders write FTimeLineBorders; + property TimeLineParams: TcxViewParams read FTimeLineParams write FTimeLineParams; + property TimeStart: TDateTime read FDateTime; + property TimeFinish; + property Resource; + end; + + TcxSchedulerContentCellViewInfoClass = class of TcxSchedulerContentCellViewInfo; + + { TcxSchedulerBackgroundSlotCellViewInfo } + + TcxSchedulerBackgroundSlotCellViewInfo = class(TcxSchedulerContentCellViewInfo) + protected + procedure DoDraw; override; + public + property DisplayText; + end; + + { TcxSchedulerMonthDayContentCellViewInfo } + + TcxSchedulerMonthDayContentCellViewInfo = class(TcxSchedulerContentCellViewInfo) + private + FSelected: Boolean; + FSelectionColor: TColor; + FSelectionTextColor: TColor; + function GetIsToday: Boolean; + procedure SetSmallTextFont(AFont: TFont); + protected + FTextRect: TRect; + FSmallFont: Boolean; + FSmallFontCreated: Boolean; + FSmallTextFont: TFont; + procedure DoDraw; override; + function GetLongDisplayText: string; virtual; + property IsToday: Boolean read GetIsToday; + public + destructor Destroy; override; + procedure SetContentState(AsDayOfMonth: Boolean; ASelected: Boolean; + ATextHeight: Integer; const ASelectionParams: TcxViewParams); + function UpdateSelection(ASelected: Boolean): Boolean; + + property DisplayText; + property SmallFont: Boolean read FSmallFont; + property SmallTextFont: TFont read FSmallTextFont write SetSmallTextFont; + property Selected: Boolean read FSelected; + property SelectionColor: TColor read FSelectionColor write FSelectionColor; + property SelectionTextColor: TColor read FSelectionTextColor write FSelectionTextColor; + end; + + TcxSchedulerEventImagesLayout = (eilAuto, eilHorizontal, eilVertical); + + { TcxSchedulerEventViewData } + + TcxSchedulerEventViewData = class + public + AlwaysShowTime: Boolean; + AutoHeight: Boolean; + Bitmap: TBitmap; + BorderColor: TColor; + Bounds: TRect; + Canvas: TcxCanvas; + Caption: string; + ContentFinish: TDateTime; + ContentStart: TDateTime; + DrawAsProgress: Boolean; + DrawShadows: Boolean; + EditProperties: TcxCustomEditProperties; + EditStyle: TcxCustomEditStyle; + Event: TcxSchedulerControlEvent; + ExternalPainter: TcxSchedulerExternalPainter; + GetEventHint: function(AEvent: TcxSchedulerControlEvent): string of object; + ImagesLayout: TcxSchedulerEventImagesLayout; + LineHeight: Integer; + MaxHeight: Integer; + Painter: TcxCustomLookAndFeelPainterClass; + Resource: TcxSchedulerResourceViewInfo; + ShowAllDayEventsInContentArea: Boolean; + ShowFinishTime: Boolean; + ShowStartTime: Boolean; + ShowTimeAsClock: Boolean; + ShowTimeLine: Boolean; + StartLine: Integer; + TaskComplete: Integer; + TaskStatus: TcxSchedulerEventTaskStatus; + TimeLineParams: TcxViewParams; + ViewParams: TcxViewParams; + VisibleRect: TRect; + end; + + { TcxSchedulerEventCellViewInfo } + + TcxSchedulerEventCellViewInfo = class(TcxSchedulerCustomViewInfoItem) + private + FEventFinish: TDateTime; + FEventStart: TDateTime; + FIsHeaderEvent: Boolean; + function CalculateMessageHeight(const R: TRect): Integer; + function GetBorderColor: TColor; + function GetCaption: string; + function GetCaptionBounds(const R: TRect): TRect; + function GetContentFinish: TDateTime; + function GetContentStart: TDateTime; + function GetEvent: TcxSchedulerControlEvent; + function GetHint: string; + function GetIsHeaderEvent: Boolean; + function GetMessage: string; + function GetResourceInfo: TcxSchedulerResourceViewInfo; + function GetResourceItem: TcxSchedulerStorageResourceItem; + function GetSelected: Boolean; + function GetShowingState(AIndex: Integer): Boolean; + procedure SetBorderColor(AValue: TColor); + protected + FCaptionRect: TRect; + FEditViewInfo: TcxCustomEditViewInfo; + FFinishRect: TRect; + FFinishText: string; + FHidden: Boolean; + FImages: TcxSchedulerEventImages; + FMessageRect: TRect; + FHint: string; + FHintAssigned: Boolean; + FHintNeeded: Boolean; + FHintNeededCalculated: Boolean; + FSeparatorColor: TColor; + FShowMessage: Boolean; + FStartRect: TRect; + FStartText: string; + FEventTimeRect: TRect; + FTimeLineRect: TRect; + FIsDetailCaption: Boolean; + FIsDetailInfo: Boolean; + ViewData: TcxSchedulerEventViewData; + procedure AssignEditStyle(AEditStyle: TcxCustomEditStyle); + procedure BeforeCustomDraw(ACanvas: TcxCanvas); override; + procedure Calculate; + procedure CalculateBorders; virtual; + procedure CalculateCaptions; virtual; + procedure CalculateDetailInfo; virtual; + procedure CalculateNeedHint; + procedure CalculateEditViewInfo; + procedure CalculateShowTimeAsClock; virtual; + //items layout + + function CalculateAutoLayoutImagesAutoHeight(AVisibleImages: TList): Integer; + function CalculateHorizontalImagesAutoHeight: Integer; + procedure CalculateMessageAutoLayout(var AHeight: Integer); + function CalculateVerticalImagesAutoHeight: Integer; + + procedure CalculateItemsLayout; virtual; + procedure CalculateDetailViewEventLayout; + procedure CalculateHeaderEventLayout; + procedure CalculateNonDetailEventLayout; + procedure CalculateEventTimeAsClockLayout(const ABounds: TRect; + const ACaptionWidth, AImagesWidth: Integer; var ALeft: Integer); virtual; + procedure CalculateEventTimeAsTextLayout(const ABounds: TRect; + const ACaptionWidth, AImagesWidth: Integer; var ALeft: Integer); virtual; + function CalculateNonDetailEventImages(const ACaptionWidth: Integer; + out AImagesWidth: Integer): TRect; virtual; + function CalculateSingleLineImages(const ABounds: TRect; ARightLimit: Integer = 0): Integer; + function SetItemRect(AShowItem: Boolean; const ABounds: TRect; + AVertOffset: Integer; var APos: Integer): TRect; + //time visibility + procedure CalculateEventTimeVisibility; virtual; + procedure CalculateDetailEventTimeVisibility; virtual; + procedure CalculateNonDetailEventTimeVisibility; virtual; + procedure CalculateVisibility; virtual; + function CanAutoHideStandardImages: Boolean; virtual; + function CanShowHint: Boolean; virtual; + + procedure DoDraw; override; + procedure DrawCaption; + procedure DrawContent; virtual; + procedure DrawImages; + procedure DrawMessageSeparator; + procedure DrawTime; + function GetCaptionAutoHeight(const R: TRect): Integer; + function GetEditingRect: TRect; virtual; + function GetForceShowClockInHeaderEvent: Boolean; virtual; + function GetHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest; var ABreak: Boolean): Boolean; override; + function GetImagesBounds: TRect; + function GetImagesVerticalOffset(AImageHeight: Integer; AIsAbsolute: Boolean): Integer; + function GetMessageRect(const ACaptionRect: TRect; AHasImages: Boolean): TRect; + function HasReminder: Boolean; virtual; + procedure Initialize; virtual; + //hittest + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + procedure InitHitTestForHorzEvent(AHitTest: TcxSchedulerCustomResourceViewHitTest); + + procedure InitStandardEventImages; + function IsHorzSizing: Boolean; virtual; + function IsNeedDrawTime: Boolean; virtual; + function IsTimeLineVisible: Boolean; virtual; + function TruncTime(const ATime: TDateTime): TDateTime; + + property EventFinish: TDateTime read FEventFinish; + property EventStart: TDateTime read FEventStart; + property IsHeaderEvent: Boolean read FIsHeaderEvent; + property IsDetailCaption: Boolean read FIsDetailCaption; + public + constructor Create(AViewData: TcxSchedulerEventViewData); reintroduce; virtual; + destructor Destroy; override; + + procedure Draw(ACanvas: TcxCanvas; ABitmap: TBitmap); reintroduce; overload; + procedure DrawState(ACanvas: TcxCanvas; const ARect: TRect; ABorders: TcxBorders; ABorderColor: TColor); overload; + function MeasureHeight(ACanvas: TcxCanvas): Integer; virtual; + procedure MoveTo(X, Y: Integer); virtual; + + property BorderColor: TColor read GetBorderColor write SetBorderColor; + property Caption: string read GetCaption; + property CaptionRect: TRect read FCaptionRect; + property ClipRect: TRect read FClipRect; + property ClipRgn: TcxRegion read FClipRgn write FClipRgn; + property ContentFinish: TDateTime read GetContentFinish; + property ContentStart: TDateTime read GetContentStart; + property EditingRect: TRect read GetEditingRect; + property EditViewInfo: TcxCustomEditViewInfo read FEditViewInfo; + property Event: TcxSchedulerControlEvent read GetEvent; + property EventTimeRect: TRect read FEventTimeRect; + property EventViewData: TcxSchedulerEventViewData read ViewData; + property FinishRect: TRect read FFinishRect; + property FinishText: string read FFinishText; + property Hidden: Boolean read FHidden write FHidden; + property Hint: string read GetHint; + property Images: TcxSchedulerEventImages read FImages; + property IsDetailInfo: Boolean read FIsDetailInfo; + property Message: string read GetMessage; + property MessageRect: TRect read FMessageRect; + property ResourceInfo: TcxSchedulerResourceViewInfo read GetResourceInfo; + property ResourceItem: TcxSchedulerStorageResourceItem read GetResourceItem; + property Selected: Boolean read GetSelected; + property SeparatorColor: TColor read FSeparatorColor write FSeparatorColor; + property ShowFinishTime: Boolean index 0 read GetShowingState; + property ShowMessage: Boolean read FShowMessage; + property ShowStartTime: Boolean index 1 read GetShowingState; + property ShowTimeAsClock: Boolean index 2 read GetShowingState; + property ShowTimeLine: Boolean index 3 read GetShowingState; + property StartRect: TRect read FStartRect; + property StartText: string read FStartText; + property TimeLineRect: TRect read FTimeLineRect write FTimeLineRect; + property Visible: Boolean read FVisible; + end; + + { TcxSchedulerMoreEventsButtonViewInfo } + + TcxSchedulerMoreEventsButtonClick = procedure (Sender: TcxSchedulerMoreEventsButtonViewInfo) of object; + + TcxSchedulerMoreEventsButtonViewInfoClass = class of TcxSchedulerMoreEventsButtonViewInfo; + + TcxSchedulerMoreEventsButtonViewInfo = class(TcxSchedulerCustomResourceViewInfoItem) + protected + FEvent: TcxSchedulerEvent; + FIsDown: Boolean; + FOnClick: TcxSchedulerMoreEventsButtonClick; + procedure DoDraw; override; + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + property OnClick: TcxSchedulerMoreEventsButtonClick read FOnClick write FOnClick; + public + procedure Click; virtual; + + property Event: TcxSchedulerEvent read FEvent write FEvent; + property IsDown: Boolean read FIsDown; + property DateTime; + property Resource; + end; + + { TcxSchedulerContentNavigationButtonViewInfo } + + TcxSchedulerContentNavigationButtonClick = procedure (Sender: TcxSchedulerContentNavigationButtonViewInfo) of object; + + TcxSchedulerContentNavigationButtonViewInfo = class(TcxSchedulerCustomResourceViewInfoItem) + private + FArrowRect: TRect; + FCaption: string; + FHitTest: TcxSchedulerCustomResourceViewHitTest; + FInterval: TDateTime; + FKind: TcxSchedulerContentNavigationButtonKind; + FOnClick: TcxSchedulerContentNavigationButtonClick; + FTextRect: TRect; + function GetEnabled: Boolean; + protected + procedure DoDraw; override; + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + property Enabled: Boolean read GetEnabled; + property OnClick: TcxSchedulerContentNavigationButtonClick read FOnClick write FOnClick; + public + procedure Click; virtual; + property ArrowRect: TRect read FArrowRect; + property Caption: string read FCaption write FCaption; + property Interval: TDateTime read FInterval write FInterval; + property Kind: TcxSchedulerContentNavigationButtonKind read FKind write FKind; + property TextRect: TRect read FTextRect; + end; + + { TcxSchedulerGroupSeparatorCellViewInfo } + + TcxSchedulerGroupSeparatorCellViewInfo = class(TcxSchedulerCustomViewInfoItem) + private + FDrawRotatedBackground: Boolean; + FRotated: Boolean; + function DrawRotateBackground(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; + protected + FRotateBitmap: TcxBitmap; + procedure DoDraw; override; + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + public + destructor Destroy; override; + property Rotated: Boolean read FRotated write FRotated; + end; + + { TcxSchedulerResourceViewInfo } + + TcxSchedulerResourceViewInfo = class + protected + FCaption: string; + FColor: TColor; + FImageIndex: Integer; + FImagePosition: TcxSchedulerHeaderImagePosition; + FImages: TCustomImageList; + FResourceID: Variant; + FResourceItem: TcxSchedulerStorageResourceItem; + FTextRect: TRect; + FVisibleEventCount: Integer; + public + constructor Create(AResource: TcxSchedulerStorageResourceItem); virtual; + + property Caption: string read FCaption; + property Color: TColor read FColor; + property ImageIndex: Integer read FImageIndex; + property ImagePosition: TcxSchedulerHeaderImagePosition read FImagePosition; + property Images: TCustomImageList read FImages; + property ResourceID: Variant read FResourceID; + property ResourceItem: TcxSchedulerStorageResourceItem read FResourceItem; + property TextRect: TRect read FTextRect write FTextRect; + property VisibleEventCount: Integer read FVisibleEventCount write FVisibleEventCount; + end; + + { TcxSchedulerExternalPainter } + + TcxSchedulerExternalPainter = class(TInterfacedObject, IcxSchedulerCommonViewItemsPainter) + private + FCommonPainter: IcxSchedulerCommonViewItemsPainter; + FPainter: TcxCustomLookAndFeelPainterClass; + function GetPainterHelper: TcxSchedulerPainterHelperClass; + protected + property PainterHelper: TcxSchedulerPainterHelperClass read GetPainterHelper; + public + // IcxSchedulerCommonViewItemsPainter + procedure DoCustomDrawBackground( + AViewInfo: TcxSchedulerBackgroundCellViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawButton( + AViewInfo: TcxSchedulerMoreEventsButtonViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawContent( + AViewInfo: TcxSchedulerContentCellViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawDayHeader( + AViewInfo: TcxSchedulerDayHeaderCellViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawEvent( + AViewInfo: TcxSchedulerEventCellViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawGroupSeparator( + AViewInfo: TcxSchedulerGroupSeparatorCellViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawNavigationButton( + AViewInfo: TcxSchedulerContentNavigationButtonViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawResourceHeader( + AViewInfo: TcxSchedulerHeaderCellViewInfo; var ADone: Boolean); virtual; + function HasCustomDrawGroupSeparator: Boolean; + function HasCustomDrawResourceHeader: Boolean; + // + function NeedDrawSelection: Boolean; virtual; + function DrawCurrentTimeFirst: Boolean; virtual; + // + procedure DrawAllDayArea(ACanvas: TcxCanvas; const ARect: TRect; + ABorderColor: TColor; ABorders: TcxBorders; AViewParams: TcxViewParams; + ASelected: Boolean; ATransparent: Boolean); virtual; + procedure DrawCurrentTime(ACanvas: TcxCanvas; AColor: TColor; AStart: TDateTime; + ABounds: TRect); virtual; + procedure DrawEvent(AViewInfo: TcxSchedulerEventCellViewInfo); virtual; + procedure DrawEventAsProgress(AViewInfo: TcxSchedulerEventCellViewInfo); virtual; + procedure DrawEventAsProgressText(AViewInfo: TcxSchedulerEventCellViewInfo; + AContent: TRect; AProgressRect: TRect; const AText: string); virtual; + procedure DrawTimeGridCurrentTime(ACanvas: TcxCanvas; AColor: TColor; + const ATimeLineRect: TRect); virtual; + procedure DrawTimeGridHeader(ACanvas: TcxCanvas; ABorderColor: TColor; + AViewInfo: TcxSchedulerCustomViewInfoItem; ABorders: TcxBorders; + ASelected: Boolean); virtual; + procedure DrawTimeLine(ACanvas: TcxCanvas; const ARect: TRect; + AViewParams: TcxViewParams; ABorders: TcxBorders; + ABorderColor: TColor); virtual; + procedure DrawTimeRulerBackground(ACanvas: TcxCanvas; const ARect: TRect; + ABorders: TcxBorders; AViewParams: TcxViewParams; ATransparent: Boolean); virtual; + procedure DrawShadow(ACanvas: TcxCanvas; const ARect, AVisibleRect: TRect; + ABuffer: TBitmap); virtual; + function MoreButtonSize(ASize: TSize): TSize; virtual; + property Painter: TcxCustomLookAndFeelPainterClass read FPainter write FPainter; + property CommonPainter: IcxSchedulerCommonViewItemsPainter read FCommonPainter write FCommonPainter; + end; + + TcxSchedulerExternalPainterClass = class of TcxSchedulerExternalPainter; + + { TcxSchedulerCustomResourceView } + + TcxSchedulerCustomResourceView = class(TcxSchedulerCustomView) + private + FAdapter: TcxCustomResourceViewAdapter; + FExternalPainter: TcxSchedulerExternalPainter; + FGroupingKind: TcxSchedulerGroupingKind; + FEventImagesLayout: TcxSchedulerEventImagesLayout; + FShowEndTime: Boolean; + FShowTimeAsClock: Boolean; + FOnCustomDrawBackground: TcxSchedulerCustomDrawBackgroundEvent; + FOnCustomDrawButton: TcxSchedulerCustomDrawButtonEvent; + FOnCustomDrawContent: TcxSchedulerCustomDrawContentEvent; + FOnCustomDrawDayHeader: TcxSchedulerCustomDrawDayHeaderEvent; + FOnCustomDrawEvent: TcxSchedulerCustomDrawEventEvent; + FOnCustomDrawGroupSeparator: TcxSchedulerCustomDrawGroupSeparatorEvent; + FOnCustomDrawNavigationButton: TcxSchedulerCustomDrawNavigationButtonEvent; + FOnCustomDrawResourceHeader: TcxSchedulerCustomDrawResourceHeaderEvent; + procedure CheckSelectOnRightClick; + function GetViewInfo: TcxSchedulerCustomResourceViewViewInfo; + function IsRelevantSelection(out ATime: TDateTime; out AResource: TcxSchedulerStorageResourceItem): Boolean; + procedure SetEventImagesLayout(const AValue: TcxSchedulerEventImagesLayout); + procedure SetShowEndTime(const AValue: Boolean); + procedure SetShowTimeAsClock(const AValue: Boolean); + protected + procedure CalculateViewInfo; override; + procedure CheckGroupingKind(AStyle: TcxSchedulerGroupingKind; + var ActuallyStyle: TcxSchedulerGroupingKind); virtual; + function CreateController: TcxSchedulerSubControlController; override; + function CreateHitTest: TcxSchedulerSubControlHitTest; override; + function CreateViewAdapter: TcxCustomResourceViewAdapter; virtual; + procedure CreateSubClasses; override; + procedure DestroySubClasses; override; + procedure DoCustomDrawBackground( + AViewInfo: TcxSchedulerBackgroundCellViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawButton( + AViewInfo: TcxSchedulerMoreEventsButtonViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawContent( + AViewInfo: TcxSchedulerContentCellViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawDayHeader( + AViewInfo: TcxSchedulerDayHeaderCellViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawEvent( + AViewInfo: TcxSchedulerEventCellViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawGroupSeparator( + AViewInfo: TcxSchedulerGroupSeparatorCellViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawNavigationButton( + AViewInfo: TcxSchedulerContentNavigationButtonViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawResourceHeader( + AViewInfo: TcxSchedulerHeaderCellViewInfo; var ADone: Boolean); virtual; + procedure DoLayoutChanged; override; + procedure DoMouseDown(AButton: TMouseButton; AShift: TShiftState; X, Y: Integer); override; + function DoShowPopupMenu(X, Y: Integer): Boolean; override; + function FindEventViewInfo(AEvent: TcxSchedulerEvent; const ADate: TDateTime; + AResource: TcxSchedulerStorageResourceItem; var AViewInfo: TcxSchedulerEventCellViewInfo): Boolean; + function GetCommonViewItemsPainter: IcxSchedulerCommonViewItemsPainter; virtual; + function GetCompressWeekEnd: Boolean; virtual; + function GetEditRectForEvent(AEvent: TcxSchedulerControlEvent; const ADate: TDateTime; + AResource: TcxSchedulerStorageResourceItem): TRect; override; + function GetEventHintText(AEvent: TcxSchedulerControlEvent): string; override; + function GetEventVisibility(AEvent: TcxSchedulerControlEvent): Boolean; override; + function GetGroupingKind: TcxSchedulerGroupingKind; override; + function HasCustomDrawGroupSeparator: Boolean; + function HasCustomDrawResourceHeader: Boolean; + procedure InitScrollBarsParameters; override; + function IsShowResources: Boolean; override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); override; + procedure Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); override; + procedure SetGroupingKind(AValue: TcxSchedulerGroupingKind); virtual; + + property Adapter: TcxCustomResourceViewAdapter read FAdapter write FAdapter; + property EventImagesLayout: TcxSchedulerEventImagesLayout read FEventImagesLayout write SetEventImagesLayout; + property ExternalPainter: TcxSchedulerExternalPainter read FExternalPainter; + property ShowEndTime: Boolean read FShowEndTime write SetShowEndTime default True; + property ShowTimeAsClock: Boolean read FShowTimeAsClock write SetShowTimeAsClock default False; + property ViewInfo: TcxSchedulerCustomResourceViewViewInfo read GetViewInfo; + + property OnCustomDrawBackground: TcxSchedulerCustomDrawBackgroundEvent read FOnCustomDrawBackground write FOnCustomDrawBackground; + property OnCustomDrawButton: TcxSchedulerCustomDrawButtonEvent read FOnCustomDrawButton write FOnCustomDrawButton; + property OnCustomDrawContent: TcxSchedulerCustomDrawContentEvent read FOnCustomDrawContent write FOnCustomDrawContent; + property OnCustomDrawDayHeader: TcxSchedulerCustomDrawDayHeaderEvent read FOnCustomDrawDayHeader write FOnCustomDrawDayHeader; + property OnCustomDrawEvent: TcxSchedulerCustomDrawEventEvent read FOnCustomDrawEvent write FOnCustomDrawEvent; + property OnCustomDrawGroupSeparator: TcxSchedulerCustomDrawGroupSeparatorEvent read FOnCustomDrawGroupSeparator write FOnCustomDrawGroupSeparator; + property OnCustomDrawNavigationButton: TcxSchedulerCustomDrawNavigationButtonEvent read FOnCustomDrawNavigationButton write FOnCustomDrawNavigationButton; + property OnCustomDrawResourceHeader: TcxSchedulerCustomDrawResourceHeaderEvent read FOnCustomDrawResourceHeader write FOnCustomDrawResourceHeader; + public + constructor Create(AOwner: TcxCustomScheduler); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure InitializePainter; virtual; + procedure FinilizePainter; virtual; + + property GroupingKind: TcxSchedulerGroupingKind read FGroupingKind write SetGroupingKind default gkDefault; + end; + + { TcxCustomResourceViewAdapter } + + TcxCustomResourceViewAdapter = class(TcxIUnknownObject) + private + FView: TcxSchedulerCustomResourceView; + + function GetCells: TcxObjectList; + function GetContentLineHeight: Integer; + function GetPainterHelper: TcxSchedulerPainterHelperClass; + function GetResourceNavigator: TcxSchedulerResourceNavigator; + function GetResources: TcxSchedulerStorageResourceItems; + function GetScheduler: TcxCustomScheduler; + function GetViewInfo: TcxSchedulerCustomResourceViewViewInfo; + + protected + function CanCalculate: Boolean; virtual; + function GetActualStart: TDateTime; virtual; + function GetActualFinish: TDateTime; virtual; + function GetCompressWeekends: Boolean; virtual; + function GetDontPrintFreeTime: Boolean; virtual; + function GetDontPrintWeekEnds: Boolean; virtual; + function GetHideSelection: Boolean; virtual; + function GetIsPrinting: Boolean; virtual; + function GetPageBounds: TRect; virtual; + function GetPagesPerWeek: Byte; virtual; + function GetPrimaryPage: Boolean; virtual; + function GetPrintExactlyOneMonth: Boolean; virtual; + function GetPrintRange(Index: Integer): TDateTime; virtual; + function GetStylesAdapter: IcxSchedulerStylesAdapter; virtual; + function GetView: TcxSchedulerCustomResourceView; virtual; + + procedure AfterCalculatePage; virtual; + procedure BeforeCalculatePage; virtual; + procedure DoInitialize(var ASelectedDays: TcxSchedulerDateList; + var AEvents: TcxSchedulerCachedEventList); virtual; + function GetPageHeaderText: string; virtual; + procedure Store; virtual; + procedure Restore; virtual; + + property Scheduler: TcxCustomScheduler read GetScheduler; + property PainterHelper: TcxSchedulerPainterHelperClass read GetPainterHelper; + property ResourceNavigator: TcxSchedulerResourceNavigator read GetResourceNavigator; + property ViewInfo: TcxSchedulerCustomResourceViewViewInfo read GetViewInfo; + public + constructor Create(AView: TcxSchedulerCustomResourceView); virtual; + + procedure Calculate; overload; + + procedure GetPageResources(AResources: TcxObjectList); virtual; + procedure GetPageDays(APageIndex: Integer; ADays: TcxSchedulerDateList); + procedure Invalidate; virtual; + + property ActualStart: TDateTime read GetActualStart; + property ActualFinish: TDateTime read GetActualFinish; + property Cells: TcxObjectList read GetCells; + property ContentLineHeight: Integer read GetContentLineHeight; + property DontPrintFreeTime: Boolean read GetDontPrintFreeTime; + property DontPrintWeekEnd: Boolean read GetDontPrintWeekEnds; + property IsPrinting: Boolean read GetIsPrinting; + property PagesPerWeek: Byte read GetPagesPerWeek; + property PrintExactlyOneMonth: Boolean read GetPrintExactlyOneMonth; + property PrintFrom: TDateTime index 0 read GetPrintRange; + property PrintTo: TDateTime index 1 read GetPrintRange; + property Resources: TcxSchedulerStorageResourceItems read GetResources; + property StylesAdapter: IcxSchedulerStylesAdapter read GetStylesAdapter; + property View: TcxSchedulerCustomResourceView read GetView write FView; + end; + + TcxCustomResourceViewAdapterClass = class of TcxCustomResourceViewAdapter; + + { TcxSchedulerEventImages } + + TcxSchedulerEventImageType = (eitReminder, eitRecurrence, eitCustomOccurrence, eitCustom); + + { TcxSchedulerEventImageItem } + + TcxSchedulerEventImageItem = class(TCollectionItem) + private + FAutoHide: Boolean; + FImageType: TcxSchedulerEventImageType; + FImageIndex: Integer; + FImages: TCustomImageList; + FVisible: Boolean; + function GetHeight: Integer; + function GetWidth: Integer; + protected + FBounds: TRect; + FHidden: Boolean; + public + constructor Create(Collection: TCollection); override; + + property AutoHide: Boolean read FAutoHide write FAutoHide; + property Bounds: TRect read FBounds; + property Height: Integer read GetHeight; + property ImageIndex: Integer read FImageIndex; + property ImageType: TcxSchedulerEventImageType read FImageType; + property Images: TCustomImageList read FImages; + property Visible: Boolean read FVisible write FVisible; + property Width: Integer read GetWidth; + end; + + { TcxSchedulerEventImages } + + TcxSchedulerEventImages = class(TCollection) + private + FForceVisibleHeight: Integer; + FForceVisibleWidth: Integer; + FImages: TCustomImageList; + FLayout: TcxSchedulerEventImagesLayout; + FItemHeight: Integer; + FItemWidth: Integer; + FTotalVisibleHeight: Integer; + FTotalVisibleWidth: Integer; + FTotalVisibleImageCount: Integer; + FVisibleImageCount: Integer; + function GetImageItem(AIndex: Integer): TcxSchedulerEventImageItem; + protected + function Calculate(const R: TRect): Integer; + procedure CalculateForCols(AVisibleImages: TList; const ATopLeft: TPoint; AColCount: Integer); + function CalculateImages(const R: TRect): Integer; + function CalculateSingleColumnImages(const R: TRect): Integer; + function CalculateSingleLineImages(const R: TRect; ARightLimit: Integer = 0): Integer; + function Offset(ADeltaX, ADeltaY: Integer): Integer; + function CreateVisibleList: TList; + procedure Init(AImages: TCustomImageList); + procedure SetItemBounds(AItem: TcxSchedulerEventImageItem; ALeft, ATop: Integer); + + property ItemHeight: Integer read FItemHeight; + property ItemWidth: Integer read FItemWidth; + property ForceVisibleHeight: Integer read FForceVisibleHeight; + property ForceVisibleWidth: Integer read FForceVisibleWidth; + property TotalVisibleHeight: Integer read FTotalVisibleHeight; + property TotalVisibleWidth: Integer read FTotalVisibleWidth; + property TotalVisibleImageCount: Integer read FTotalVisibleImageCount; + property VisibleImageCount: Integer read FVisibleImageCount; + public + constructor Create(ALayout: TcxSchedulerEventImagesLayout); + function Add(AImageIndex: Integer; AutoHide: Boolean = True): TcxSchedulerEventImageItem; + function AddStandardImage(AImageType: TcxSchedulerEventImageType; + AutoHide: Boolean = True): TcxSchedulerEventImageItem; + + property Items[Index: Integer]: TcxSchedulerEventImageItem read GetImageItem; default; + property Layout: TcxSchedulerEventImagesLayout read FLayout write FLayout; + end; + + { TcxSchedulerCachedImage } + + TcxSchedulerCachedImage = class + private + FImage: TcxBitmap; + public + constructor Create; + destructor Destroy; override; + procedure Invalidate; + function IsValid(AItem: TcxSchedulerCustomViewInfoItem): Boolean; virtual; + procedure Update(AItem: TcxSchedulerCustomViewInfoItem); virtual; + + property Image: TcxBitmap read FImage; + end; + + { TcxSchedulerResourceHeaderCachedImage } + + TcxSchedulerResourceHeaderCachedImage = class(TcxSchedulerCachedImage) + private + FDisplayText: string; + FDateTime: TDateTime; + FResourceItem: TcxSchedulerStorageResourceItem; + public + function IsValid(AItem: TcxSchedulerCustomViewInfoItem): Boolean; override; + procedure Update(AItem: TcxSchedulerCustomViewInfoItem); override; + end; + + { TcxSchedulerResourceHeaderCachedImageList } + + TcxSchedulerResourceHeaderCachedImageList = class(TcxObjectList) + public + function Add(AItem: TcxSchedulerHeaderCellViewInfo): TcxSchedulerResourceHeaderCachedImage; + function GetCacheForItem(AItem: TcxSchedulerHeaderCellViewInfo): TcxSchedulerResourceHeaderCachedImage; + end; + + { TcxSchedulerImageCacheManager } + + TcxSchedulerImageCacheManager = class + private + FResourceHeaders: TcxSchedulerResourceHeaderCachedImageList; + FSeparator: TcxSchedulerCachedImage; + public + constructor Create; virtual; + destructor Destroy; override; + procedure Invalidate; virtual; + + property ResourceHeaders: TcxSchedulerResourceHeaderCachedImageList read FResourceHeaders; + property Separator: TcxSchedulerCachedImage read FSeparator; + end; + + { TcxSchedulerCustomResourceViewViewInfo } + + TcxSchedulerCustomResourceViewViewInfo = class(TcxSchedulerCustomViewViewInfo) + private + FButtonBounds: TRect; + FButtonTextRect: TRect; + FButtonArrowRect: TRect; + FContentNavigationIntervals: TObjectList; + FContentNavigationWithoutResources: Boolean; + FEventWithoutResourceCount: Integer; + FImageCacheManager: TcxSchedulerImageCacheManager; + FOldHitContentNavigationButton: TcxSchedulerContentNavigationButtonViewInfo; + procedure AddContentNavigationIntervalItem(AResourceIndex: Variant); + procedure ClearContentNavigationIntervals; + function GetClones: TcxSchedulerEventList; + function GetCorrectColumnHeight(AColumnRect: TRect): Integer; + function GetDay(AIndex: Integer): TDateTime; + function GetDayCount: Integer; + function GetShowEventsWithoutResource: Boolean; + function GetGroupByDate: Boolean; + function GetGroupByResource: Boolean; + function GetGroupingKind: TcxSchedulerGroupingKind; + function GetHasSeparator: Boolean; + function GetHasVisibleBounds: Boolean; + function GetHiddenSelection: Boolean; + function GetMinResourceHeight: Integer; + function GetMoreEventsButtonCount(AResourceIndex: Integer): Integer; + function GetResource(AIndex: Integer): TcxSchedulerResourceViewInfo; + function GetResourceCaption(AIndex: Integer): string; + function GetResourceCount: Integer; + function GetResourceHeaders: TcxSchedulerResourceHeaders; + function GetPrintRange(Index: Integer): TDateTime; + function GetSeparatorWidth: Integer; + function GetView: TcxSchedulerCustomResourceView; + function IsDrawButtons: Boolean; + procedure SetContentNavigationButtonsIntervals; + procedure SetHitContentNavigationButton(AButton: TcxSchedulerContentNavigationButtonViewInfo; + AHitTest: TcxSchedulerCustomResourceViewHitTest); + protected + FAdapter: TcxCustomResourceViewAdapter; + FButtons: TcxSchedulerViewInfoCellList; + FCanSelected: Boolean; + FCells: TcxObjectList; + FContentCells: TcxSchedulerViewInfoCellList; + FContentFontHeight: Integer; + FContentLineHeight: Integer; + FDayBorderColor: TColor; + FDayHeaderCells: TcxSchedulerViewInfoCellList; + FDayHeaderHeight: Integer; + FEventCells: TcxSchedulerViewInfoCellList; + FEventImages: IcxSchedulerEventImages; + FGroupSeparatorCells: TcxSchedulerViewInfoCellList; + FGroupSeparatorParams: TcxViewParams; + FGroupingKind: TcxSchedulerGroupingKind; + FHasVisibleBounds: Boolean; + FHeaderContainerCells: TcxSchedulerViewInfoCellList; + FHideClones: Boolean; + FHideSelection: Boolean; + FHideSource: Boolean; + FNavigationButtons: TcxSchedulerViewInfoCellList; + FResources: TcxObjectList; + FResourceBounds: array of TRect; + FResourceHeaderCells: TcxSchedulerViewInfoCellList; + FResourceHeaderHeight: Integer; + FResourceImages: TCustomImageList; + FSelectionParams: TcxViewParams; + FSelStart: TDateTime; + FSelFinish: TDateTime; + FSelResource: TcxSchedulerResourceViewInfo; + FStylesAdapter: IcxSchedulerStylesAdapter; + FTimeLineParams: TcxViewParams; + // for page splitting + FPageBounds: TRect; + FPagesPerWeek: Byte; + FPrimaryPage: Boolean; + FPrintWeekEnds: Boolean; + FUseResourceImages: Boolean; + ScreenCanvas: TcxCanvas; + + function AddBackgroundSlot(const ABounds: TRect; ABorders: TcxBorders; + const AText: string = ''): TcxSchedulerBackgroundSlotCellViewInfo; virtual; + function AddButton(ABounds: TRect; const ADateTime: TDateTime; + AIsDown: Boolean; AEvent: TcxSchedulerEvent): TcxSchedulerMoreEventsButtonViewInfo; virtual; + function AddContentCell(const ARect: TRect; const AStart, AFinish: TDateTime; + AResourceIndex: Integer): TcxSchedulerContentCellViewInfo; virtual; + procedure AddContentNavigationButton(const AColumnRect: TRect; AResourceIndex: Integer; + AColumnPositionInResource: TcxSchedulerColumnPositionInResource); + function AddDayHeader(const ADate: TDateTime; const ABounds: TRect; + AResourceIndex: Integer): TcxSchedulerDayHeaderCellViewInfo; overload; virtual; + function AddDayHeader(const ADate: TDateTime; ATop, ALeft, ARight: Integer; + AResourceIndex: Integer): TcxSchedulerDayHeaderCellViewInfo; overload; + function AddEventCell( + AViewData: TcxSchedulerEventViewData; AImmediateCalculate: Boolean = True): TcxSchedulerEventCellViewInfo; virtual; + function AddGroupHorzSeparator(APos: Integer): TcxSchedulerGroupSeparatorCellViewInfo; virtual; + function AddGroupSeparator(const ABounds: TRect): TcxSchedulerGroupSeparatorCellViewInfo; virtual; + function AddGroupVertSeparator(APos: Integer): TcxSchedulerGroupSeparatorCellViewInfo; virtual; + procedure AddResourceBounds(AResourceIndex: Integer; const ABounds: TRect); + function AddResourceHeader(const AIndex: Integer; + const ABounds: TRect): TcxSchedulerHeaderCellViewInfo; virtual; + procedure AfterCalculate; override; + function AreThereEventsInVisibleInterval(AResourceIndex: Integer): Boolean; + procedure AssignResourceID(ACell: TcxSchedulerCustomResourceViewInfoItem; AIndex: Integer); + procedure CalculateContentNavigationButtons; virtual; + procedure CalculateMetrics; virtual; + procedure CalculateNavigationButtonParams(AColumnRect: TRect; AKind: TcxSchedulerContentNavigationButtonKind; + out AButtonWidth: Integer); + procedure CalculateResourceHeadersAutoHeight(AWidth: Integer); virtual; + function CalculateResourceHeaderWidth: Integer; virtual; + + function CanCacheGroupSeparator(AItem: TcxSchedulerGroupSeparatorCellViewInfo): Boolean; virtual; + function CanCacheResourceHeader(AItem: TcxSchedulerHeaderCellViewInfo): Boolean; virtual; + + procedure Clear; override; + procedure ClearResourceBounds; + function ContentCellClass: TcxSchedulerContentCellViewInfoClass; virtual; + procedure CreateCellInstance(AClass: TcxSchedulerCustomViewInfoItemClass; + const ABounds: TRect; const AViewParams: TcxViewParams; var Instance); overload; + procedure CreateCellInstance(AClass: TcxSchedulerCustomViewInfoItemClass; + const ABounds, AVisibleBounds: TRect; const AViewParams: TcxViewParams; var Instance); overload; + function CreateEventViewData(AEvent: TcxSchedulerControlEvent; const ABounds: TRect; + const AStart, AFinish: TDateTime; AResource: TcxSchedulerResourceViewInfo): TcxSchedulerEventViewData; virtual; + function CreateEventCellViewInfo(AViewData: TcxSchedulerEventViewData): TcxSchedulerEventCellViewInfo; virtual; + function CreateImageCacheManager: TcxSchedulerImageCacheManager; virtual; + procedure DoCalculate; override; + procedure DoContentNavigationButtonClick(Sender: TcxSchedulerContentNavigationButtonViewInfo); virtual; + procedure DoMoreEventsButtonClick(Sender: TcxSchedulerMoreEventsButtonViewInfo); virtual; + procedure ExtractResources; virtual; + function GetBounds: TRect; override; + function GetContentNavigationInterval(AContentNavigationButton: TcxSchedulerContentNavigationButtonViewInfo): TDateTime; + function GetContentParams(const ATime: TDateTime; + AResource: TcxSchedulerResourceViewInfo): TcxViewParams; virtual; + function GetDayHeaderHeight: Integer; virtual; + function GetEventForResourceCount(AResourceIndex: Integer; out AResourceID: Variant): Integer; virtual; + function GetEventWithoutResourceCount: Integer; virtual; + function GetMoreEventButtonClass: TcxSchedulerMoreEventsButtonViewInfoClass; virtual; + function GetResourceHeaderWidth: Integer; + function GetResourceImagesSize: TSize; virtual; + function GetResourcesContentWidth: Integer; virtual; + function GetSelectionParams(const AParams: TcxViewParams): TcxViewParams; + function GetSeparatorCount: Integer; virtual; + function GetTimeLineParams: TcxViewParams; virtual; + function GetFontHeight(AStyle: TcxStyle): Integer; overload; + function GetFontHeight(const AParams: TcxViewParams): Integer; overload; + function GetPageHeaderText: string; virtual; + function GetResourceItemByIndex(AIndex: Integer): TcxSchedulerStorageResourceItem; + function GetResourceViewInfoByItem(AItem: TcxSchedulerStorageResourceItem): TcxSchedulerResourceViewInfo; + function HasStorage: Boolean; + function HasVisibleEvents: Boolean; virtual; + procedure HideCloneEventsOnDragDrop; + procedure HideSourceEventsOnDragDrop; + procedure HotTrackNavigationButtons(AHitTest: TcxSchedulerCustomResourceViewHitTest); + function IsTimeSelected(ATime: TDateTime; AResource: TObject): Boolean; virtual; + function IsValidNavigationButtonsPlace(const AResourceRect: TRect): Boolean; + procedure MakeTimeVisible(const ATime: TDateTime); virtual; + function NavigationButtonOffset(AKind: TcxSchedulerContentNavigationButtonKind; + AResourceIndex: Integer): Integer; virtual; + procedure OnContentNavigationButtonClick(Sender: TcxSchedulerContentNavigationButtonViewInfo); + procedure OnMoreEventsButtonClick(Sender: TcxSchedulerMoreEventsButtonViewInfo); + procedure ProcessDateToDisplayText(ArrangeByType: Boolean = False); virtual; + procedure ProcessCheckBorders(AList: TcxSchedulerViewInfoCellList; + AHasCommonArea: Boolean; ANeighbors: TcxNeighbors = []; + AExcludeBorders: TcxBorders = []; AAddBorders: TcxBorders = []); + procedure ReturnVisibleInterval(var AStart, AEnd: TDateTime); virtual; + function SetAdapter(Adapter: TcxCustomResourceViewAdapter): TcxCustomResourceViewAdapter; + procedure SetResourceHasVisibleEvent(AEvent: TcxSchedulerControlEvent); + procedure SetResourceTextRect(AResource: TcxSchedulerStorageResourceItem; const ARect: TRect); + + property ImageCacheManager: TcxSchedulerImageCacheManager read FImageCacheManager; + property View: TcxSchedulerCustomResourceView read GetView; + public + constructor Create(AOwner: TcxSchedulerSubControl); override; + destructor Destroy; override; + procedure Calculate; override; + procedure CalculateHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); virtual; + procedure InitScrollBarsParameters; virtual; + procedure ScrollHorizontal(AScrollCode: TScrollCode; var AScrollPos: Integer); virtual; + procedure ScrollVertical(AScrollCode: TScrollCode; var AScrollPos: Integer); virtual; + procedure SetEventsVisibility(AShowSources, AShowClones: Boolean; AForceRepaint: Boolean = False); override; + + property Adapter: TcxCustomResourceViewAdapter read FAdapter; + property Buttons: TcxSchedulerViewInfoCellList read FButtons; + property CanSelected: Boolean read FCanSelected; + property Clones: TcxSchedulerEventList read GetClones; + property ContentCells: TcxSchedulerViewInfoCellList read FContentCells; + property ContentLineHeight: Integer read FContentLineHeight; + property DayCount: Integer read GetDayCount; + property DayHeaderCells: TcxSchedulerViewInfoCellList read FDayHeaderCells; + property DayHeaderHeight: Integer read GetDayHeaderHeight; + property Days[Index: Integer]: TDateTime read GetDay; + property EventCells: TcxSchedulerViewInfoCellList read FEventCells; + property ShowEventsWithoutResource: Boolean read GetShowEventsWithoutResource; + property GroupByDate: Boolean read GetGroupByDate; + property GroupByResource: Boolean read GetGroupByResource; + property GroupSeparatorCells: TcxSchedulerViewInfoCellList read FGroupSeparatorCells; + property GroupSeparatorParams: TcxViewParams read FGroupSeparatorParams; + property GroupingKind: TcxSchedulerGroupingKind read FGroupingKind; + property HasSeparator: Boolean read GetHasSeparator; + property HasVisibleBounds: Boolean read FHasVisibleBounds; + property HeaderContainerCells: TcxSchedulerViewInfoCellList read FHeaderContainerCells; + property HideSelection: Boolean read FHideSelection; + property NavigationButtons: TcxSchedulerViewInfoCellList read FNavigationButtons; + property PagesPerWeek: Byte read FPagesPerWeek; + property PrimaryPage: Boolean read FPrimaryPage; + property PrintFrom: TDateTime index 0 read GetPrintRange; + property PrintTo: TDateTime index 1 read GetPrintRange; + property PrintWeekEnds: Boolean read FPrintWeekEnds; + property Resources[AIndex: Integer]: TcxSchedulerResourceViewInfo read GetResource; + property ResourceCaptions[AIndex: Integer]: string read GetResourceCaption; + property ResourceCount: Integer read GetResourceCount; + property ResourceHeaders: TcxSchedulerResourceHeaders read GetResourceHeaders; + property ResourceHeaderCells: TcxSchedulerViewInfoCellList read FResourceHeaderCells; + property ResourceHeaderHeight: Integer read FResourceHeaderHeight; + property ResourceImages: TCustomImageList read FResourceImages; + property SelFinish: TDateTime read FSelFinish; + property SelResource: TcxSchedulerResourceViewInfo read FSelResource; + property SelStart: TDateTime read FSelStart; + property SeparatorWidth: Integer read GetSeparatorWidth; + property StylesAdapter: IcxSchedulerStylesAdapter read FStylesAdapter; + property HiddenSelection: Boolean read GetHiddenSelection; + property UseResourceImages: Boolean read FUseResourceImages; + end; + + { TcxSchedulerCustomResourceViewNavigation } + + TcxSchedulerCustomResourceViewNavigation = class(TcxSchedulerViewNavigation) + private + function GetIsFirstResource: Boolean; + function GetIsLastResource: Boolean; + function GetGroupingKind: TcxSchedulerGroupingKind; + function GetResourceObject: TcxSchedulerResourceViewinfo; + function GetViewInfo: TcxSchedulerCustomResourceViewViewInfo; + protected + function GetNextResource(AGoToForward: Boolean): TcxSchedulerStorageResourceItem; + function GetResourceItem: TcxSchedulerStorageResourceItem; override; + function GetResourceFromViewInfo(AInfo: TcxSchedulerResourceViewInfo): TcxSchedulerStorageResourceItem; + function RoundTime(const ADateTime: TDateTime): TDateTime; + public + procedure ValidateSelection(var ASelStart, ASelFinish: TDateTime; + var AResource: TcxSchedulerStorageResourceItem); override; + property IsFirstResource: Boolean read GetIsFirstResource; + property IsLastResource: Boolean read GetIsLastResource; + property GroupingKind: TcxSchedulerGroupingKind read GetGroupingKind; + property ResourceItem: TcxSchedulerStorageResourceItem read GetResourceItem; + property ResourceObject: TcxSchedulerResourceViewInfo read GetResourceObject; + property ViewInfo: TcxSchedulerCustomResourceViewViewInfo read GetViewInfo; + end; + + { TcxSchedulerCustomResourceViewController } + + TcxSchedulerCustomResourceViewController = class(TcxSchedulerViewController) + private + FCalculatedHintBounds: Boolean; + FHintText: string; + FNavigationButtonClicked: Boolean; + function GetHintController: TcxSchedulerHintController; + function GetHitTest: TcxSchedulerCustomResourceViewHitTest; + function GetView: TcxSchedulerCustomResourceView; + protected + function CreateNavigation: TcxSchedulerViewNavigation; override; + function GetCursor(X, Y: Integer): TCursor; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseLeave; override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + // hint + function GetDayHeaderDate: TDateTime; virtual; + procedure InternalHideHint; + procedure InternalShowHint(P: TPoint; const AHintText: string); + function NeedShowDayHeaderHint: Boolean; virtual; + function ShowHint: Boolean; virtual; + procedure ShowDayHeaderHint; virtual; + + property HintController: TcxSchedulerHintController read GetHintController; + property HitTest: TcxSchedulerCustomResourceViewHitTest read GetHitTest; + property NavigationButtonClicked: Boolean read FNavigationButtonClicked write FNavigationButtonClicked; + property View: TcxSchedulerCustomResourceView read GetView; + end; + + { TcxSchedulerCustomResourceViewHitTest } + + TcxSchedulerCustomResourceViewHitTest = class(TcxSchedulerViewHitTest) + private + function GetContentCell: TcxSchedulerContentCellViewInfo; + function GetHitContentNavigationButton: TcxSchedulerContentNavigationButtonViewInfo; + function GetHeaderCell: TcxSchedulerHeaderCellViewInfo; + function GetView: TcxSchedulerCustomResourceView; + protected + FButton: TcxSchedulerMoreEventsButtonViewInfo; + FContentNavigationButton: TcxSchedulerContentNavigationButtonViewInfo; + FDragKind: TcxEventDragKind; + FEventCell: TcxSchedulerEventCellViewInfo; + FHitObject: TObject; + FTimeZone: Integer; + function CanMoveEvent(AEvent: TcxSchedulerControlEvent): Boolean; virtual; + function CanResizeEvent(AEvent: TcxSchedulerControlEvent): Boolean; virtual; + procedure Clear; override; + procedure DoCalculate; override; + function GetHitEvent: TcxSchedulerControlEvent; override; + procedure SetHitTime(AItemFlag: Integer; const ATime: TDateTime); virtual; + procedure SetResource(AResource: TcxSchedulerResourceViewInfo); + procedure ValidateDragKind; virtual; + + property View: TcxSchedulerCustomResourceView read GetView; + property HitAtTimeZoneLabel: Boolean index htcTimeZoneLabel read GetBitState; + property HitContentNavigationButton: TcxSchedulerContentNavigationButtonViewInfo read GetHitContentNavigationButton; + property TimeZone: Integer read FTimeZone; + public + function GetDragKind: TcxEventDragKind; override; + procedure SetDragKind(AValue: TcxEventDragKind); + + property Button: TcxSchedulerMoreEventsButtonViewInfo read FButton; + property ContentCell: TcxSchedulerContentCellViewInfo read GetContentCell; + property ContentNavigationButton: TcxSchedulerContentNavigationButtonViewInfo read FContentNavigationButton; property EventCell: TcxSchedulerEventCellViewInfo read FEventCell; + property HeaderCell: TcxSchedulerHeaderCellViewInfo read GetHeaderCell; + property HitAtButton: Boolean index htcButton read GetBitState; + property HitAtContent: Boolean index htcContent read GetBitState; + property HitAtContentNavigationButton: Boolean index htcNavigationButton read GetBitState; + property HitAtDayHeader: Boolean index htcDayHeader read GetBitState; + property HitAtGroupSeparator: Boolean index htcGroupSeparator read GetBitState; + property HitAtResourceHeader: Boolean index htcResourceHeader read GetBitState; + end; + + { TcxSchedulerCustomViewPainter } + + TcxSchedulerCustomViewPainter = class(TcxSchedulerSubControlPainter) + private + function GetView: TcxSchedulerCustomResourceView; + protected + FPainter: IcxSchedulerCommonViewItemsPainter; + procedure DrawBackgroundCell(AItem: TcxSchedulerBackgroundCellViewInfo); virtual; + procedure DrawButtonCell(AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); virtual; + procedure DrawContentCell(AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); virtual; + procedure DrawEventCell(AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); virtual; + procedure DrawGroupSeparatorCell(AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); virtual; + procedure DrawHeaderCell(AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); virtual; + procedure DrawResourceHeaderCell(AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); virtual; + public + constructor Create(AOwner: TcxSchedulerSubControl); override; + procedure InitializePainter; override; + procedure Paint; override; + + property Painter: IcxSchedulerCommonViewItemsPainter read FPainter; + property View: TcxSchedulerCustomResourceView read GetView; + end; + + { TcxSchedulerEventPlace } + + TcxSchedulerEventPlace = class + public + ColFinish: Integer; + ColStart: Integer; + Resource: TObject; + Data: TObject; + Event: TcxSchedulerEvent; + LineFinish: Integer; + LineStart: Integer; + procedure AlignPosition(APlace: TcxSchedulerEventPlace); + function IntersectHorz(APlace: TcxSchedulerEventPlace): Boolean; + function IntersectVert(APlace: TcxSchedulerEventPlace): Boolean; + procedure ResetPosition; + end; + + { TcxSchedulerEventLayoutBuilder } + + TcxSchedulerEventLayoutBuilderGetEventPlaceProc = function(Sender: TcxSchedulerEventLayoutBuilder; + AEvent: TcxSchedulerControlEvent; out AStartCol, AFinishCol: Integer; out ALineCount: Integer): Boolean of object; + + TcxSchedulerEventLayoutBuilder = class + private + FEventPlaces: TcxObjectList; + function GetEventPlace(AIndex: Integer): TcxSchedulerEventPlace; + function GetEventPlaceCount: Integer; + public + constructor Create; virtual; + destructor Destroy; override; + function AddEventPlace(AEvent: TcxSchedulerEvent; + AStartCol, AFinishCol: Integer; ALineCount: Integer = 1; AResource: TObject = nil): TcxSchedulerEventPlace; + procedure Clear; + procedure Calculate; virtual; + procedure CalculateEx(AEventsList: TcxSchedulerFilteredEventList; + APlaceInfoProc: TcxSchedulerEventLayoutBuilderGetEventPlaceProc); + property EventPlaceCount: Integer read GetEventPlaceCount; + property EventPlaces[Index: Integer]: TcxSchedulerEventPlace read GetEventPlace; + property EventPlacesList: TcxObjectList read FEventPlaces; + end; + +var + ExternalPainterClass: TcxSchedulerExternalPainterClass = TcxSchedulerExternalPainter; + +function MakeTextOutcxFlags(AlignHorz: TAlignment; + AlignVert: TcxAlignmentVert; AMultiline: Boolean = False): Integer; + +implementation + +uses + cxDrawTextUtils, cxLibraryConsts, cxVariants, cxSchedulerDateNavigator, cxControls; + +type + TcxCustomEditStyleAccess = class(TcxCustomEditStyle); + TcxCustomSchedulerAccess = class(TcxCustomScheduler); + TcxDateNavigatorAccess = class(TcxSchedulerDateNavigator); + +const + ContentNavigationButtonWidth = 24; + ContentNavigationButtonHeight = 172; + ContentNavigationButtonReducedHeight = 32; + MultiLines: array[Boolean] of Integer = (0, cxWordBreak); + cxDrawTextFlags: array[Boolean] of Cardinal = ( + cxAlignLeft or cxAlignVCenter or cxSingleLine, + cxAlignLeft or cxAlignTop or cxWordBreak or cxDontBreakChars); + +function MakeTextOutcxFlags(AlignHorz: TAlignment; + AlignVert: TcxAlignmentVert; AMultiline: Boolean = False): Integer; +begin + Result := cxAlignmentsHorz[AlignHorz] or cxDontBreakChars or + cxAlignmentsVert[AlignVert] or MultiLines[AMultiline]; +end; + +function MakeRect(ALeft, ATop: Integer; ASize: TSize): TRect; +begin + Result.Left := ALeft; + Result.Top := ATop; + Result.Right := ALeft + ASize.cx; + Result.Bottom := ATop + ASize.cy; +end; + +function GetTrueMultilineTextHeight(ACanvas: TcxCanvas; const S: string; ABounds: TRect): Integer; +var + ARowCount: Integer; + ATextFlags: Cardinal; + ATextParams: TcxTextParams; + ATextRows: TcxTextRows; +begin + ABounds.Bottom := 30000; + ATextFlags := CXTO_CALCROWCOUNT or CXTO_LEFT or CXTO_TOP or CXTO_WORDBREAK or CXTO_EDITCONTROL; + ATextParams := cxCalcTextParams(ACanvas.Canvas, ATextFlags); + cxMakeTextRows(ACanvas.Canvas, PChar(S), ABounds, ATextParams, ATextRows, ARowCount); + Result := ATextParams.RowHeight * Max(ARowCount, 1); + ATextRows := nil; +end; + +{ TcxSchedulerViewInfoCellList } + +function TcxSchedulerViewInfoCellList.CalculateHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest): Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to Count - 1 do + if Items[I].GetHitTest(AHitTest, Result) and Result then Exit; +end; + +procedure TcxSchedulerViewInfoCellList.Clear; +var + I: Integer; +begin + for I := Count - 1 downto 0 do + Items[I].Free; + inherited Clear; +end; + +procedure TcxSchedulerViewInfoCellList.Draw( + ACanvas: TcxCanvas; ADrawItemProc: TcxSchedulerCustomDrawItemProc); +var + I: Integer; + ADone: Boolean; + AItem: TcxSchedulerCustomViewInfoItem; + ASavedFont: TFont; +begin + for I := 0 to Count - 1 do + begin + AItem := Items[I]; + if AItem.FVisible and not cxRectIsEmpty(AItem.Bounds) then + begin + ASavedFont := AItem.FViewParams.Font; + AItem.BeforeCustomDraw(ACanvas); + ADone := False; + AItem.FCanvas := ACanvas; + if AItem.FHasClipping then + begin + AItem.ClippingCreate(AItem.FHasClipping); + ADrawItemProc(AItem, ADone); + AItem.ClippingRestore; + end + else + ADrawItemProc(AItem, ADone); + AItem.AfterCustomDraw(ACanvas); + if not ADone then + AItem.Draw(ACanvas); + AItem.FViewParams.Font := ASavedFont; + end; + end; +// need Optimize if custom draw not supported do not need +// custom draw canvas preparation + +// SelectClipRgn(ACanvas.Handle, 0); +// TODO: draw and custom draw events +end; + +function TcxSchedulerViewInfoCellList.GetItem( + AIndex: Integer): TcxSchedulerCustomViewInfoItem; +begin + Result := List^[AIndex]; +end; + +{ TcxSchedulerCustomViewInfoItem } + +constructor TcxSchedulerCustomViewInfoItem.Create( + APainter: TcxCustomLookAndFeelPainterClass; + const ABounds, AVisibleRect: TRect; const AViewParams: TcxViewParams); +begin + FPainter := APainter; + FDateTime := NullDate; + FViewParams := AViewParams; + CalculateCellBounds(ABounds, AVisibleRect); +end; + +destructor TcxSchedulerCustomViewInfoItem.Destroy; +begin + FClipRgn.Free; + inherited Destroy; +end; + +procedure TcxSchedulerCustomViewInfoItem.Draw(ACanvas: TcxCanvas); +var + ATransparent: Boolean; + APrevCanvas: TcxCanvas; + APrevParams: TcxViewParams; +begin + if not FVisible then Exit; + ATransparent := Transparent; + APrevCanvas := FCanvas; + ACanvas.GetParams(APrevParams); + if Cache <> nil then + begin + if not Cache.IsValid(Self) then + begin + Cache.Update(Self); + UpdateCachedImage(APrevParams); + end; + ACanvas.Draw(Bounds.Left, Bounds.Top, Cache.Image); + end + else + begin + FCanvas := ACanvas; + DoDraw; + end; + ACanvas.SetParams(APrevParams); + FCanvas := APrevCanvas; + Transparent := ATransparent; +end; + +procedure TcxSchedulerCustomViewInfoItem.CalculateCellBounds( + const ABounds, AVisibleRect: TRect); +begin + FBounds := ABounds; + FVisible := cxRectIntersect(FClipRect, ABounds, AVisibleRect); + FHasClipping := FVisible and not cxRectIsEqual(FClipRect, ABounds); +end; + +procedure TcxSchedulerCustomViewInfoItem.ClippingCreate(AHasClipping: Boolean); +begin + Inc(FClipRef); + if not AHasClipping or (FClipRef > 1) then Exit; + if FClipRgn = nil then + FClipRgn := TcxRegion.Create(FClipRect); + FSavedClipRgn := Canvas.GetClipRegion; + Canvas.SetClipRegion(FClipRgn, roSet, False); +end; + +procedure TcxSchedulerCustomViewInfoItem.ClippingRestore; +begin + Dec(FClipRef); + if (FClipRef = 0) and (FSavedClipRgn <> nil) then + begin + Canvas.SetClipRegion(FSavedClipRgn, roSet, True); + FSavedClipRgn := nil; + end; +end; + +function TcxSchedulerCustomViewInfoItem.DrawBackground( + ACanvas: TcxCanvas; const ABounds: TRect): Boolean; +begin + Result := Transparent or Assigned(Bitmap) and not Bitmap.Empty; + if Result and not Transparent then + ACanvas.FillRect(ABounds, Bitmap); +end; + +procedure TcxSchedulerCustomViewInfoItem.DrawFrame( + const ARect: TRect; ABorders: TcxBorders = []; + ABorderColor: TColor = clDefault; ALineWidth: Integer = 1); +begin + Canvas.FrameRect(ARect, ABorderColor, ALineWidth, ABorders); +end; + +procedure TcxSchedulerCustomViewInfoItem.DrawRect( + const ARect: TRect; ABorders: TcxBorders = []; + ABorderColor: TColor = clDefault; ALineWidth: Integer = 1); +begin + if Transparent then + Canvas.FrameRect(ARect, ABorderColor, ALineWidth, ABorders) + else + Canvas.FillRect(ARect, FViewParams, ABorders, ABorderColor, ALineWidth); +end; + +procedure TcxSchedulerCustomViewInfoItem.DrawText( + const ARect: TRect; const AText: string; AFlags: Integer; AFont: TFont = nil; AColor: TColor = clDefault); +begin + if AFont = nil then + Canvas.Font := FViewParams.Font + else + Canvas.Font := AFont; + if AColor <> clDefault then + Canvas.Font.Color := AColor; + Canvas.Brush.Style := bsClear; + Canvas.DrawTexT(AText, ARect, AFlags); +end; + +function TcxSchedulerCustomViewInfoItem.GetFont: TFont; +begin + Result := FViewParams.Font; +end; + +function TcxSchedulerCustomViewInfoItem.GetHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest; var ABreak: Boolean): Boolean; +begin + Result := FVisible and PtInRect(FClipRect, AHitTest.HitPoint); + ABreak := Result; + if Result then + InitHitTest(AHitTest); +end; + +procedure TcxSchedulerCustomViewInfoItem.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + AHitTest.FHitObject := Self; +end; + +procedure TcxSchedulerCustomViewInfoItem.RotateBitmap( + ABitmap: TBitmap; ARotationAngle: TcxRotationAngle; AFlipHorizontally: Boolean = False); +var + PDest, PDestStart: ^DWORD; + PSource, PSourceStart: ^DWord; + PBuffer: Pointer; + XSource, YSource: Integer; + LineCopyingDirection: Integer; + TempVar: Integer; +begin + if ABitmap.Empty then Exit; + case ARotationAngle of + ra0: + if AFlipHorizontally then + begin + with ABitmap do + begin + GetMem(PBuffer, Width * 4); + for YSource := 0 to Height - 1 do + begin + PSourceStart := ScanLine[YSource]; + PSource := PSourceStart; + Inc(PSource, Width - 1); + PDest := PBuffer; + for XSource := 0 to Width - 1 do + begin + PDest^ := PSource^; + Inc(PDest); + Dec(PSource); + end; + Move(PBuffer^, PSourceStart^, Width * 4); + end; + end; + FreeMem(PBuffer); + end; + raPlus90, raMinus90: + + with ABitmap do + begin + GetMem(PBuffer, Width * Height * 4); + + LineCopyingDirection := 0; + PDestStart := PBuffer; + case ARotationAngle of + raPlus90: + begin + Inc(PDestStart, Height * (Width - 1)); + LineCopyingDirection := 1; + end; + raMinus90: + begin + Inc(PDestStart, Height - 1); + LineCopyingDirection := -1; + end; + end; + + for YSource := 0 to Height - 1 do + begin + PSource := ScanLine[YSource]; + PDest := PDestStart; + if AFlipHorizontally then + begin + Inc(PSource, Width - 1); + for XSource := 0 to Width - 1 do + begin + PDest^ := PSource^; + Dec(PDest, Height * LineCopyingDirection); + Dec(PSource); + end + end + else + for XSource := 0 to Width - 1 do + begin + PDest^ := PSource^; + Dec(PDest, Height * LineCopyingDirection); + Inc(PSource); + end; + Inc(PDestStart, LineCopyingDirection); + end; + + TempVar := Width; + Width := Height; + Height := TempVar; + if Width = Height then + begin + Width := Width + 1; + Width := Width - 1; + end; + + PDest := PBuffer; + for YSource := 0 to Height - 1 do + begin + Move(PDest^, ScanLine[YSource]^, Width * 4); + Inc(PDest, Width); + end; + + FreeMem(PBuffer); + end; + + end; +end; + +// custom draw support +procedure TcxSchedulerCustomViewInfoItem.AfterCustomDraw(ACanvas: TcxCanvas); +begin + ACanvas.GetParams(FViewParams); +end; + +procedure TcxSchedulerCustomViewInfoItem.BeforeCustomDraw(ACanvas: TcxCanvas); +begin + ACanvas.SetParams(FViewParams); +end; + +procedure TcxSchedulerCustomViewInfoItem.UpdateCachedImage( + const AViewParams: TcxViewParams); +begin + if Transparent then + BitBlt(Cache.Image.Canvas.Handle, 0, 0, Width, Height, Canvas.Handle, + Bounds.Left, Bounds.Top, srcCopy); + FCanvas := Cache.Image.cxCanvas; + Canvas.SetParams(AViewParams); + Canvas.WindowOrg := Bounds.TopLeft; + DoDraw; + Canvas.WindowOrg := cxNullPoint; +end; + +function TcxSchedulerCustomViewInfoItem.GetBitmap: TBitmap; +begin + Result := FViewParams.Bitmap; +end; + +function TcxSchedulerCustomViewInfoItem.GetColor: TColor; +begin + Result := FViewParams.Color; +end; + +function TcxSchedulerCustomViewInfoItem.GetDateTimeHelper: TcxSchedulerDateTimeHelperClass; +begin + Result := cxSchedulerUtils.DateTimeHelper; +end; + +function TcxSchedulerCustomViewInfoItem.GetHeight: Integer; +begin + Result := Bounds.Bottom - Bounds.Top; +end; + +function TcxSchedulerCustomViewInfoItem.GetPainterHelper: TcxSchedulerPainterHelperClass; +begin + Result := TcxSchedulerHelpersFactory.PainterHelperClass; +end; + +function TcxSchedulerCustomViewInfoItem.GetTextColor: TColor; +begin + Result := FViewParams.TextColor; +end; + +function TcxSchedulerCustomViewInfoItem.GetWidth: Integer; +begin + Result := Bounds.Right - Bounds.Left; +end; + +procedure TcxSchedulerCustomViewInfoItem.SetBitmap( + AValue: TBitmap); +begin + FViewParams.Bitmap := AValue; +end; + +procedure TcxSchedulerCustomViewInfoItem.SetColor( + AValue: TColor); +begin + FViewParams.Color := AValue; +end; + +procedure TcxSchedulerCustomViewInfoItem.SetTextColor( + AValue: TColor); +begin + FViewParams.TextColor := AValue; +end; + +{ TcxSchedulerBackgroundCellViewInfo } + +procedure TcxSchedulerBackgroundCellViewInfo.DoDraw; +begin + DrawRect(Bounds, Borders, clBtnShadow); +end; + +{ TcxSchedulerCustomResourceViewInfoItem } + +procedure TcxSchedulerCustomResourceViewInfoItem.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + if IsResourceAssigned then + begin + AHitTest.SetResource(FResource); + AHitTest.SetBitState(htcResource, True); + end; +end; + +{ TcxSchedulerHeaderCellViewInfo } + +constructor TcxSchedulerHeaderCellViewInfo.Create( + APainter: TcxCustomLookAndFeelPainterClass; + const ABounds, AVisibleRect: TRect; const AViewParams: TcxViewParams); +begin + inherited Create(APainter, ABounds, AVisibleRect, AViewParams); + FImageIndex := -1; + FButtonState := cxbsDefault; + FAlignHorz := taCenter; + FAlignVert := vaCenter; + FBorders := cxBordersAll; + FTextRect := cxRectInflate(FBounds, -cxTextOffset, 0); +end; + +destructor TcxSchedulerHeaderCellViewInfo.Destroy; +begin + FSelectionBitmap.Free; + FRotateBitmap.Free; + inherited Destroy; +end; + +procedure TcxSchedulerHeaderCellViewInfo.Calculate(const AText: string); +begin + FDisplayText := AText; +end; + +procedure TcxSchedulerHeaderCellViewInfo.CalculateImageLayout; +const + Alignments: array[TcxSchedulerHeaderImagePosition] of TAlignment = + (taLeftJustify, taCenter, taRightJustify, taCenter); +var + ATopLeft: TPoint; + ATextSize, AImageSize: TSize; + ABounds: TRect; +begin + FImageRectAssigned := HasImage; + if not FImageRectAssigned then + begin + FTextRect := cxRectInflate(PainterHelper.ExcludeBorders(Bounds, Borders), -cxTextOffset, 0); + if not HasImage and RotateHeader then + begin + if RotateText then + FTextRect := MakeRect(0, 0, cxSize(Height, Width)) + else + FTextRect := MakeRect(0, 0, cxSize(Width, Height)); + InflateRect(FTextRect, -(cxTextOffset + 1), -(cxTextOffset + 1)); + end; + DisplayBounds := FTextRect; + Exit; + end; + FTextRect := cxTextRect(PainterHelper.ExcludeBorders(Bounds, Borders)); + FAlignHorz := Alignments[ImagePosition]; + FAlignVert := vaTop; + MultiLine := AutoHeight; + // calculate text and image extents + AImageSize := cxSize(Images.Width, Images.Height); + if RotateHeader and RotateText then + begin + AImageSize := cxSize(Images.Height, Images.Width); + ABounds := MakeRect(0, 0, cxSize(Height - 2, Width - 2)); + FTextRect := cxTextRect(ABounds); + end + else + begin + ABounds := Bounds; + if RotateHeader then + begin + OffsetRect(ABounds, -ABounds.Left, -ABounds.Top); + FTextRect := cxTextRect(ABounds); + end; + end; + DisplayBounds := cxRectInflate(ABounds, -1, -1); + if AutoHeight and (ImagePosition in [ipLeft, ipRight]) then + Dec(FTextRect.Right, AImageSize.cx + cxTextOffset * 2); + if Length(DisplayText) > 0 then + begin +// Canvas.Font.Assign(Font); +// Canvas.TextExtent(DisplayText, FTextRect, GetTextOutcxFlags); + FTextRect.Right := FTextRect.Left + cxRectWidth(Resource.FTextRect); + FTextRect.Bottom := FTextRect.Top + cxRectHeight(Resource.FTextRect); + end + else + FTextRect := cxNullRect; + ATextSize := cxRectSize(FTextRect); + ATopLeft := cxPointOffset(cxRectCenter(ABounds), 1, -1 + Byte(RotateHeader)); + if ImagePosition in [ipLeft, ipRight] then + begin + Dec(ATopLeft.X, (AImageSize.cx + ATextSize.cx + cxTextOffset) div 2); + FTextRect := MakeRect(ATopLeft.X, ATopLeft.y - ATextSize.cy div 2, ATextSize); + FImageRect := MakeRect(ATopLeft.X, ATopLeft.y - AImageSize.cy div 2, AImageSize); + end + else + begin + Dec(ATopLeft.Y, (AImageSize.cy + ATextSize.cy + cxTextOffset) div 2); + FTextRect := MakeRect(ATopLeft.x - ATextSize.cx div 2, ATopLeft.y, ATextSize); + FImageRect := MakeRect(ATopLeft.x - AImageSize.cx div 2, ATopLeft.y, AImageSize); + end; + // calculate text bounds + if Length(DisplayText) > 0 then + begin + case ImagePosition of + ipLeft: + OffsetRect(FTextRect, AImageSize.cx + cxTextOffset, 0); + ipTop: + OffsetRect(FTextRect, 0, AImageSize.cy + cxTextOffset); + ipRight: + OffsetRect(FImageRect, ATextSize.cx + cxTextOffset, 0); + ipBottom: + OffsetRect(FImageRect, 0, ATextSize.cy + cxTextOffset); + end; + end; +end; + +procedure TcxSchedulerHeaderCellViewInfo.CheckNeighbor( + APrevCell: TcxSchedulerHeaderCellViewInfo); +begin + if (APrevCell = nil) or (APrevCell.RotateHeader <> RotateHeader) then Exit; + if (RotateHeader and (APrevCell.Bounds.Bottom <> Bounds.Top)) or + (not RotateHeader and (APrevCell.Bounds.Right <> Bounds.Left)) then + Exclude(APrevCell.FBorders, bRight); +end; + +function TcxSchedulerHeaderCellViewInfo.CheckSelection: Boolean; +begin + Result := False; +end; + +procedure TcxSchedulerHeaderCellViewInfo.DoDraw; +begin + ValidateSelection; + CalculateImageLayout; + FBackgroundDrawing := False; + if RotateText or RotateHeader then + DrawVerticalHeader + else + DrawHorizontalHeader; +end; + +procedure TcxSchedulerHeaderCellViewInfo.DrawCaption(ACanvas: TcxCanvas = nil); +var + ABitmap: TBitmap; + ARgn: TcxRegion; +begin + if ACanvas = nil then + ACanvas := Canvas; + ARgn := ACanvas.GetClipRegion; + try + ACanvas.Brush.Style := bsClear; + ACanvas.IntersectClipRect(DisplayBounds); + ACanvas.Font := Font; + ACanvas.Font.Color := TextColor; + ACanvas.DrawTexT(DisplayText, TextRect, GetTextOutcxFlags); + if FImageRectAssigned and HasImage then + begin + if not RotateText then + ACanvas.DrawImage(Images, FImageRect.Left, FImageRect.Top, ImageIndex) + else + begin //todo: + ABitmap := TBitmap.Create; + try + ABitmap.Width := Images.Width; + ABitmap.Height := Images.Height; + RotateBitmap(ABitmap, raMinus90); + BitBlt(ABitmap.Canvas.Handle, 0, 0, Images.Height, Images.Width, ACanvas.Handle, + FImageRect.Left, FImageRect.Top, srcCopy); + RotateBitmap(ABitmap, raPlus90); + Images.Draw(ABitmap.Canvas, 0, 0, ImageIndex{$IFDEF DELPHI6}, dsNormal, itImage {$ENDIF}); + RotateBitmap(ABitmap, raMinus90); + ACanvas.Draw(FImageRect.Left, FImageRect.Top, ABitmap); + finally + ABitmap.Free; + end; + end; + end; + finally + ACanvas.SetClipRegion(ARgn, roSet); + end; +end; + +procedure TcxSchedulerHeaderCellViewInfo.DrawHorizontalHeader; +begin + if not Transparent then + Painter.DrawHeader(Canvas, Bounds, TextRect, Neighbors, Borders, + FButtonState, AlignHorz, AlignVert, MultiLine, ShowEndEllipsis, '', + Font, TextColor, Color, DrawBackground, not (nRight in Neighbors)); + if not FBackgroundDrawing and Selected then + DrawSelection; + if DisplayText <> '' then + DrawCaption; +end; + +function TcxSchedulerHeaderCellViewInfo.DrawRotateBackground( + ACanvas: TcxCanvas; const ABounds: TRect): Boolean; +begin + Result := FDrawRotatedBackground; +end; + +procedure TcxSchedulerHeaderCellViewInfo.DrawSelection; +begin + if FSelectionBitmap = nil then + FSelectionBitmap := TcxBitmap.CreateSize(Bounds) + else + FSelectionBitmap.SetSize(Width, Height); + cxBitBlt(FSelectionBitmap.Canvas.Handle, Canvas.Handle, cxRect(0, 0, Width, Height), Bounds.TopLeft, SRCCOPY); + cxAlphaBlend(FSelectionBitmap, cxRectOffset(FSelectionRect, -Bounds.Left, -Bounds.Top), ColorToRgb(SelectionColor)); + cxBitBlt(Canvas.Handle, FSelectionBitmap.Canvas.Handle, Bounds, cxNullPoint, SRCCOPY); +end; + +procedure TcxSchedulerHeaderCellViewInfo.DrawVerticalHeader; + + procedure CreateRotatedBitmap; + begin + FRotateBitmap := TcxBitmap.CreateSize(Bounds, pf32bit); + FRotateBitmap.Canvas.Lock; + if Transparent then + begin + BitBlt(FRotateBitmap.Canvas.Handle, 0, 0, FRotateBitmap.Width, + FRotateBitmap.Height, Canvas.Handle, Bounds.Left, Bounds.Top, srcCopy); + end; + FRotateBitmap.cxCanvas.WindowOrg := Bounds.TopLeft; + end; + +var + R: TRect; +begin + if FRotateBitmap = nil then + begin + CreateRotatedBitmap; + FDrawRotatedBackground := DrawBackground(FRotateBitmap.cxCanvas, Bounds); + + RotateBitmap(FRotateBitmap, raPlus90, True); + + R := cxRect(0, 0, FRotateBitmap.Width, FRotateBitmap.Height); + if not Transparent then + Painter.DrawHeader(FRotateBitmap.cxCanvas, R, cxRectInflate(R, -cxTextOffset, -cxTextOffset), + Neighbors, Borders, cxbsNormal, taCenter, vaCenter, False, False, '', + Font, TextColor, Color, DrawRotateBackground); + + if RotateText then + begin + RotateBitmap(FRotateBitmap, ra0, True); + DrawCaption(FRotateBitmap.cxCanvas); + RotateBitmap(FRotateBitmap, raPlus90); + end + else + begin + RotateBitmap(FRotateBitmap, raPlus90, True); + R.BottomRight := cxPoint(R.Bottom, R.Right); + DrawCaption(FRotateBitmap.cxCanvas); + end; + end; + Canvas.Draw(Bounds.Left, Bounds.Top, FRotateBitmap); +end; + +function TcxSchedulerHeaderCellViewInfo.GetTextOutcxFlags: Integer; +begin + Result := MakeTextOutcxFlags(AlignHorz, AlignVert, AutoHeight); +end; + +function TcxSchedulerHeaderCellViewInfo.GetTextOutFlags: Integer; +const + Horz: array[TAlignment] of Integer = + (CXTO_LEFT, CXTO_RIGHT, CXTO_CENTER_HORIZONTALLY); + Vert: array[TcxAlignmentVert] of Integer = + (CXTO_TOP, CXTO_BOTTOM, CXTO_CENTER_VERTICALLY); +begin + Result := CXTO_PREVENT_LEFT_EXCEED or CXTO_PREVENT_TOP_EXCEED or + Horz[AlignHorz] or Vert[AlignVert] + CXTO_SINGLELINE; + if AutoHeight then + begin + Result := CXTO_PREVENT_LEFT_EXCEED or CXTO_PREVENT_TOP_EXCEED or + Horz[AlignHorz] or Vert[AlignVert] or CXTO_WORDBREAK; + end; +end; + +function TcxSchedulerHeaderCellViewInfo.HasImage: Boolean; +begin + Result := ImageIndex >=0 +end; + +procedure TcxSchedulerHeaderCellViewInfo.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + inherited InitHitTest(AHitTest); + if IsResourceAssigned then + AHitTest.SetBitState(htcResourceHeader, True); + if DateTime <> NullDate then + AHitTest.SetHitTime(htcDayHeader, DateTime); +end; + +procedure TcxSchedulerHeaderCellViewInfo.TextOut(ACanvas: TcxCanvas; + const AText: string; R: TRect); +begin + if Length(AText) = 0 then Exit; + if not FImageRectAssigned then + R := cxRectInflate(R, -1, -(cxTextOffset + 1)); + with ACanvas.Canvas do + begin + Font := FViewParams.Font; + Font.Color := FViewParams.TextColor; + cxTextOut(Handle, PChar(AText), R, GetTextOutFlags); + end; +end; + +procedure TcxSchedulerHeaderCellViewInfo.ValidateSelection; +begin + if CheckSelection and (Date = DateOf(FDateTime)) then + FButtonState := cxbsHot; + if Selected then + begin + if Selected then + TextColor := FSelectionTextColor; + FSelectionRect := PainterHelper.ExcludeBorders(Bounds, Borders); + if FButtonState = cxbsHot then + begin + FSelectionRect.Left := Max(FSelectionRect.Left, FSelectionRect.Right - + PainterHelper.TextWidth(Font, DisplayText) - cxTextOffset * 2); + end; + end; +end; + +{ TcxSchedulerDayHeaderCellViewInfo } + +function TcxSchedulerDayHeaderCellViewInfo.ConvertDateToDisplayText( + AType: Integer = 0): Integer; +begin + Result := AType - 1; + repeat + Inc(Result); + if cxRectWidth(FTextRect) <= 0 then Exit; + FDisplayText := DateTimeHelper.DayToStr(FDateTime, Result, Compressed); + until (Result = DateTimeHelper.DayToStrFormatCount - 1) or + (cxTextWidth(Font, DisplayText) <= cxRectWidth(FTextRect) - cxTextOffset); +end; + +function TcxSchedulerDayHeaderCellViewInfo.CheckSelection: Boolean; +begin + Result := True; +end; + +function TcxSchedulerDayHeaderCellViewInfo.DrawBackground( + ACanvas: TcxCanvas; const ABounds: TRect): Boolean; +var + R: TRect; +begin + FBackgroundDrawing := True; + Result := inherited DrawBackground(ACanvas, ABounds); + if Result then Exit; + R := PainterHelper.ExcludeBorders(Bounds, Borders); + if FButtonState = cxbsHot then + PainterHelper.DrawGradientRect(Canvas, Color, R); + if Selected then + Canvas.FillRect(FSelectionRect, SelectionColor); + Result := (FButtonState = cxbsHot) or Selected; +end; + +procedure TcxSchedulerDayHeaderCellViewInfo.DrawHorizontalHeader; +begin + if Selected and not (FButtonState = cxbsHot) then + begin + Color := FSelectionColor; + TextColor := FSelectionTextColor; + end; + inherited DrawHorizontalHeader; +end; + +{ TcxSchedulerWeekDayHeaderCellViewInfo } + +function TcxSchedulerWeekDayHeaderCellViewInfo.ConvertDateToDisplayText( + AType: Integer = 0): Integer; +begin + Result := AType - 1; + repeat + Inc(Result); + FDisplayText := GetDayText(Result); + until (Result = 3) or (cxTextWidth(Font, DisplayText) <= cxRectWidth(FTextRect)); + if (DateOf(FDateTime) + 1) > 7 then + Result := 0; +end; + +procedure TcxSchedulerWeekDayHeaderCellViewInfo.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + inherited InitHitTest(AHitTest); + AHitTest.SetBitState(htcTime, False); +end; + +function TcxSchedulerWeekDayHeaderCellViewInfo.GetDayText( + AType: Integer): string; +var + ADay: Integer; +begin + //DELPHI8! check Trunc() + ADay := Trunc(FDateTime) + 1; + if ADay > 7 then + begin + case AType of + 0: + Result := LongDayNames[7]+ '/' + LongDayNames[1]; + 1: + Result := ShortDayNames[7]+ '/' + ShortDayNames[1]; + else + Result := AnsiUpperCase(LongDayNames[7][1]+ '/' + LongDayNames[1][1]); + end; + end + else + case AType of + 0: + Result := LongDayNames[ADay]; + 1: + Result := ShortDayNames[ADay]; + else + Result := AnsiUpperCase(LongDayNames[ADay][1]); + end; +end; + +{ TcxSchedulerContainerCellViewInfo } + +procedure TcxSchedulerContainerCellViewInfo.DoDraw; +begin + FExternalPainter.DrawAllDayArea(Canvas, Bounds, FDayBorderColor, Borders, + ViewParams, Selected, Transparent); +end; + +procedure TcxSchedulerContainerCellViewInfo.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + inherited InitHitTest(AHitTest); + AHitTest.FHitObject := Self; + AHitTest.SetHitTime(htcContainer, DateTime); +end; + +{ TcxSchedulerTimeRulerCellViewInfo } + +procedure TcxSchedulerTimeRulerCellViewInfo.Calculate( + const ALabel1, ALabel2: string; ATimeZone, AAdditionalTimeZone: Integer; + AAdditionalTimeZoneBiasDelta: Integer); +begin + Calculate(-1, 1, ATimeZone, AAdditionalTimeZone, nil, AAdditionalTimeZoneBiasDelta); + FDisplayTexts[True] := ALabel1; + FDisplayTexts[False] := ALabel2; +end; + +procedure TcxSchedulerTimeRulerCellViewInfo.Calculate(AHour, ALineCount: Integer; + ATimeZone, AAdditionalTimeZone: Integer; ALargeFont: TFont; + AAdditionalTimeZoneBiasDelta: Integer); +begin + FHour := AHour; + FLineCount := ALineCount; + FAdditionalTimeZone := AAdditionalTimeZone; + FAdditionalTimeZoneBiasDelta := AAdditionalTimeZoneBiasDelta; + FTimeZone := ATimeZone; + FLargeFont := ALargeFont; + if FVisible then + CalculateDisplayInfo; +end; + +procedure TcxSchedulerTimeRulerCellViewInfo.SetBottom(AValue: Integer); +begin + FClipRect.Bottom := AValue; +end; + +class function TcxSchedulerTimeRulerCellViewInfo.CalculateWidth( + ATimeZoneCount, ALineCount: Integer; AFont1, AFont2: TFont): Integer; +begin + if ALineCount = 1 then + Result := TcxSchedulerPainterHelper.TextWidth(AFont1, ' 24:PM') + else + begin + Result := TcxSchedulerPainterHelper.TextWidth(AFont1, ' 24') + + cxTextWidth(AFont2, 'pm') + cxTextOffset; + end; + Inc(Result, cxTextOffset shl 2); + if ATimeZoneCount > 1 then + Result := Result shl 1; +end; + +procedure TcxSchedulerTimeRulerCellViewInfo.CalculateDisplayInfo; +begin + FBounds[True] := inherited Bounds; + FDateTime := Hour * HourToTime; + if Hour >= 0 then + FDisplayTexts[True] := GetTimeDisplayText(FDateTime); + FBounds[False] := inherited Bounds; + if HasAdditionalTimeZone then + begin + FBounds[True].Left := cxRectCenter(inherited Bounds).X; + FBounds[False].Right := FBounds[True].Left; + if Hour >= 0 then + FDisplayTexts[False] := GetTimeDisplayText(GetAdditionalTime); + end; +end; + +procedure TcxSchedulerTimeRulerCellViewInfo.DoDraw; +var + ACurrentTimeZone: Boolean; +const + ABorders: array[Boolean] of TcxBorders = ([bBottom], [bBottom, bRight]); +begin + ClippingCreate(FHasClipping); + for ACurrentTimeZone := not HasAdditionalTimeZone to True do + begin + if Hour >= 0 then + DrawTimeZone(Bounds[ACurrentTimeZone], DisplayTexts[ACurrentTimeZone], + ACurrentTimeZone) + else + DrawTimeZoneLabel(Bounds[ACurrentTimeZone], + DisplayTexts[ACurrentTimeZone], ABorders[ACurrentTimeZone]); + end; + ClippingRestore; +end; + +procedure TcxSchedulerTimeRulerCellViewInfo.DrawTimeZoneLabel( + const ABounds: TRect; const AText: string; ABorders: TcxBorders); +begin + FExternalPainter.DrawTimeRulerBackground(Canvas, ABounds, ABorders, ViewParams, + Transparent); + DrawText(cxTextRect(ABounds), AText, cxAlignBottom or cxAlignLeft, Font, TextColor); +end; + +procedure TcxSchedulerTimeRulerCellViewInfo.DrawTimeZone( + const ABounds: TRect; const AText: string; AIsCurrent: Boolean); +var + J, LH: Integer; + S: string; + R, R1, TextR: TRect; +const + cxRightCenterAlign: Integer = cxAlignVCenter or cxAlignRight or cxDontClip; + cxRightTopAlign: Integer = cxAlignTop or cxAlignRight or cxDontClip; +begin + LH := cxRectHeight(inherited Bounds) div LineCount; + FExternalPainter.DrawTimeRulerBackground(Canvas, ABounds, [bRight], ViewParams, + Transparent); + R := cxRectSetHeight(ABounds, LH); + R.Left := (R.Left + R.Right) div 2 + cxTextOffset shl 1; + Dec(R.Right, 6); + for J := 0 to LineCount - 2 do + begin + Canvas.FrameRect(R, clBtnShadow, 1, [bBottom]); + OffsetRect(R, 0, LH); + end; + Canvas.Brush.Style := bsClear; + TextR := cxRectInflate(PainterHelper.ExcludeBorders(ABounds, + [bRight, bBottom]), -5, -cxTextOffset); + if AIsCurrent and FExternalPainter.DrawCurrentTimeFirst then + DrawCurrentTime(FDateTime, ABounds); + if LineCount > 1 then + begin + J := Length(AText); + DrawText(Rect(TextR.Left, TextR.Top, R.Left - cxTextOffset, TextR.Bottom), + Copy(AText, 1, J - 3), cxRightTopAlign, LargeFont, TextColor); + R1 := Rect(R.Left, TextR.Top, TextR.Right, TextR.Top + LH - 3); + DrawText(R1, Copy(AText, J - 1, 2), cxAlignCenter, Font, TextColor); + if ShowMinutes and AIsCurrent then + for J := 1 to LineCount - 1 do + begin + OffsetRect(R1, 0, LH); + S := IntToStr(MulDiv(60, J, LineCount)); + if Length(S) < 2 then + S := '0' + S; + DrawText(R1, S, cxAlignCenter, Font, TextColor); + end; + end + else + DrawText(TextR, AText, cxRightCenterAlign, Font, TextColor); + if AIsCurrent and not FExternalPainter.DrawCurrentTimeFirst then + DrawCurrentTime(FDateTime, ABounds); + R.Left := ABounds.Left + 5; + if (Hour <> 23) and not LastVisibleHour then + DrawFrame(R, [bBottom], clBtnShadow) + else + DrawFrame(ABounds, [bBottom], clBtnShadow); +end; + +procedure TcxSchedulerTimeRulerCellViewInfo.DrawCurrentTime( + const AStart: TDateTime; ABounds: TRect); +begin + FExternalPainter.DrawCurrentTime(Canvas, Color, AStart, ABounds); + Canvas.Brush.Style := bsClear; +end; + +function TcxSchedulerTimeRulerCellViewInfo.GetAdditionalTime: TDateTime; +begin + Result := DateTimeHelper.ConvertToAnotherTimeZone( + (Hour + FAdditionalTimeZoneBiasDelta / MinsPerHour) * HourToTime + Date, + TimeZone, AdditionalTimeZone); +end; + +function TcxSchedulerTimeRulerCellViewInfo.GetTimeDisplayText( + const ATime: TDateTime): string; +var + APos: Integer; +begin + Result := DateTimeHelper.HourToStr(ATime); + if LineCount > 1 then + begin + APos := Pos(TimeSeparator, Result); + if APos = 0 then + APos := Pos(' ', Result); + if APos = 0 then + APos := Length(Result) - 2; + Result := Copy(Result, 1, APos - 1) + ' ' + AnsiLowerCase(Copy(Result, APos + 1, 2)); + end; +end; + +procedure TcxSchedulerTimeRulerCellViewInfo.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +var + LH: Integer; + ACurrentTimeZone: Boolean; + ATime, ATimePerLine: TDateTime; +begin + inherited InitHitTest(AHitTest); + if Hour >= 0 then + begin + LH := cxRectHeight(inherited Bounds) div FLineCount; + ATimePerLine := 60 / FLineCount * MinuteToTime; + ATime := (AHitTest.HitY - inherited Bounds.Top) div LH * ATimePerLine + FHour * HourToTime; + AHitTest.SetHitTime(htcTimeRuler, ATime); + end + else + AHitTest.SetBitState(htcTimeZoneLabel, True); + for ACurrentTimeZone := not HasAdditionalTimeZone to True do + if PtInRect(Bounds[ACurrentTimeZone], AHitTest.HitPoint) then + begin + if ACurrentTimeZone then + AHitTest.FTimeZone := TimeZone + else + AHitTest.FTimeZone := AdditionalTimeZone; + end; +end; + +procedure TcxSchedulerTimeRulerCellViewInfo.AfterCustomDraw(ACanvas: TcxCanvas); +begin + FViewParams.TextColor := ACanvas.Font.Color; + FViewParams.Color := ACanvas.Brush.Color; +end; + +function TcxSchedulerTimeRulerCellViewInfo.GetBoundsRect( + AType: Boolean): TRect; +begin + Result := FBounds[AType]; +end; + +function TcxSchedulerTimeRulerCellViewInfo.GetDisplayText( + AType: Boolean): string; +begin + Result := FDisplayTexts[AType]; +end; + +function TcxSchedulerTimeRulerCellViewInfo.GetHasAdditionalTimeZone: Boolean; +begin + Result := AdditionalTimeZone >= 0; +end; + +{ TcxSchedulerContentCellViewInfo } + +constructor TcxSchedulerContentCellViewInfo.Create( + APainter: TcxCustomLookAndFeelPainterClass; + const ABounds, AVisibleRect: TRect; const AViewParams: TcxViewParams); +begin + inherited Create(APainter, ABounds, AVisibleRect, AViewParams); + FTimeLineBorders := [bLeft, bRight]; + BorderColor := clDefault; +end; + +procedure TcxSchedulerContentCellViewInfo.SetTime( + const ATimeStart, ATimeFinish: TDateTime); +begin + FDateTime := ATimeStart; + FTimeFinish := ATimeFinish; +end; + +procedure TcxSchedulerContentCellViewInfo.DoDraw; +var + R: TRect; +begin + if BorderColor = clDefault then + BorderColor := FDayBorderColor; + if FShowTimeLine then + begin + R := Bounds; + Inc(R.Left, cxTimeLineWidth); + DrawRect(R, Borders, BorderColor); + R := cxRectSetRight(R, R.Left, cxTimeLineWidth); + if FTimeEvent = nil then + FExternalPainter.DrawTimeLine(Canvas, R, FTimeLineParams, FTimeLineBorders, + FTimeLineParams.TextColor) + else + FTimeEvent.DrawState(Canvas, R, FTimeLineBorders, FTimeLineParams.TextColor); + end + else + DrawRect(Bounds, Borders, BorderColor); +end; + +procedure TcxSchedulerContentCellViewInfo.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + inherited InitHitTest(AHitTest); + AHitTest.SetHitTime(htcContent, FDateTime); + AHitTest.FHitObject := Self; +end; + +{ TcxSchedulerBackgroundSlotCellViewInfo } + +procedure TcxSchedulerBackgroundSlotCellViewInfo.DoDraw; +begin + inherited DoDraw; +end; + +{ TcxSchedulerMonthDayContentCellViewInfo } + +destructor TcxSchedulerMonthDayContentCellViewInfo.Destroy; +begin + if FSmallFontCreated then + FreeAndNil(FSmallTextFont); + inherited Destroy; +end; + +procedure TcxSchedulerMonthDayContentCellViewInfo.SetContentState( + AsDayOfMonth: Boolean; ASelected: Boolean; + ATextHeight: Integer; const ASelectionParams: TcxViewParams); +begin + FSelectionColor := ASelectionParams.Color; + FSelectionTextColor := ASelectionParams.TextColor; + FTextRect := PainterHelper.ExcludeBorders(Bounds, Borders); + if AsDayOfMonth then + FDisplayText := IntToStr(DayOf(TimeStart)) + else + FDisplayText := GetLongDisplayText; + FSelected := ASelected; + FTextRect.Bottom := Min(FTextRect.Bottom, FTextRect.Top + ATextHeight); + if not SmallFont then + FTextRect.Left := Max(FTextRect.Left, + FTextRect.Right - PainterHelper.TextWidth(Font, DisplayText)) - cxTextOffset * 2 + else + begin + if FSmallTextFont = nil then + begin + SmallTextFont := TFont.Create; + FSmallFontCreated := True; + FSmallTextFont.Assign(Font); + FSmallTextFont.Size := Round(Font.Size * 2 / 3); + end; + FTextRect.Left := Max(FTextRect.Left, FTextRect.Right - + PainterHelper.TextWidth(FSmallTextFont, DisplayText)) - cxTextOffset; + end; +end; + +function TcxSchedulerMonthDayContentCellViewInfo.UpdateSelection(ASelected: Boolean): Boolean; +begin + Result := FSelected <> ASelected; + if Result then + FSelected := ASelected; +end; + +procedure TcxSchedulerMonthDayContentCellViewInfo.DoDraw; +const + TextFlags = CXTO_PREVENT_LEFT_EXCEED or CXTO_PREVENT_TOP_EXCEED or + CXTO_CENTER_VERTICALLY or CXTO_RIGHT; +var + R: TRect; + AColor: Integer; +begin + inherited DoDraw; + if DisplayText <> '' then + begin + R := PainterHelper.ExcludeBorders(Bounds, Borders); + R.Bottom := FTextRect.Bottom; + if not Transparent and IsToday then + PainterHelper.DrawGradientRect(Canvas, Color, R); + if Selected then + begin + Inc(R.Top); + InflateRect(R, -1, 0); + Canvas.SetBrushColor(SelectionColor); + if not IsToday then + Canvas.FillRect(R) + else + begin + R := FTextRect; + R.Left := Max(Bounds.Left, (R.Left - cxTextOffset * 2)); + Inc(R.Bottom); + InflateRect(R, -1, -1); + Canvas.FillRect(R); + end; + end; + if SmallFont then + Canvas.Font := SmallTextFont + else + Canvas.Font := Font; + if Selected then + AColor := SelectionTextColor + else + AColor := TextColor; + Canvas.Brush.Style := bsClear; + AColor := Windows.SetTextColor(Canvas.Handle, ColorToRgb(AColor)); + cxTextOut(Canvas.Handle, PChar(DisplayText), + FTextRect, TextFlags, 0, 0, cxTextOffset + 1); + Windows.SetTextColor(Canvas.Handle, AColor); + end; +end; + +function TcxSchedulerMonthDayContentCellViewInfo.GetLongDisplayText: string; +begin + Result := LongMonthNames[MonthOf(TimeStart)] + ', ' + IntToStr(DayOf(TimeStart)); + if cxTextWidth(Font, Result) >= (cxRectWidth(FTextRect) div 2) then + Result := ShortMonthNames[MonthOf(TimeStart)] + ' ' + IntToStr(DayOf(TimeStart)); +end; + +function TcxSchedulerMonthDayContentCellViewInfo.GetIsToday: Boolean; +begin + Result := Date = TimeStart; +end; + +procedure TcxSchedulerMonthDayContentCellViewInfo.SetSmallTextFont(AFont: TFont); +begin + if FSmallFontCreated then + FreeAndNil(FSmallFont); + FSmallTextFont := AFont; +end; + +{ TcxSchedulerEventCellViewInfo } + +constructor TcxSchedulerEventCellViewInfo.Create( + AViewData: TcxSchedulerEventViewData); +begin + inherited Create(AViewData.Painter, AViewData.Bounds, + AViewData.VisibleRect, AViewData.ViewParams); + FExternalPainter := AViewData.ExternalPainter; + ViewData := AViewData; + FSeparatorColor := clBtnShadow; + FCanvas := AViewData.Canvas; + FImages := TcxSchedulerEventImages.Create(AViewData.ImagesLayout); + Initialize; +end; + +destructor TcxSchedulerEventCellViewInfo.Destroy; +begin + ViewData.Free; + FImages.Free; + FEditViewInfo.Free; + inherited Destroy; +end; + +procedure TcxSchedulerEventCellViewInfo.Draw( + ACanvas: TcxCanvas; ABitmap: TBitmap); +begin + ViewData.Bitmap := ABitmap; + inherited Draw(ACanvas); +end; + +procedure TcxSchedulerEventCellViewInfo.DrawState(ACanvas: TcxCanvas; + const ARect: TRect; ABorders: TcxBorders; ABorderColor: TColor); +begin + PainterHelper.DrawState(ACanvas, ARect, Event.State, ABorders, ABorderColor); +end; + +function TcxSchedulerEventCellViewInfo.MeasureHeight(ACanvas: TcxCanvas): Integer; +var + L: TList; +begin + Canvas.Font := Font; + FIsHeaderEvent := GetIsHeaderEvent; + CalculateVisibility; + FCaptionRect := cxRectInflate(Bounds, -(cxTextOffset + 1), -(cxTextOffset + 1)); + L := Images.CreateVisibleList; + try + case Images.Layout of + eilHorizontal: + Result := CalculateHorizontalImagesAutoHeight; + eilVertical: + Result := CalculateVerticalImagesAutoHeight; + else //eilAuto:; + Result := CalculateAutoLayoutImagesAutoHeight(L); + end; + finally + L.Free; + end; + Result := Max(ViewData.LineHeight, Result); +end; + +procedure TcxSchedulerEventCellViewInfo.MoveTo(X, Y: Integer); + + procedure ShiftRect(var R: TRect); + begin + if not cxRectIsEmpty(R) then OffsetRect(R, X, Y); + end; + +var + I: Integer; +begin + ShiftRect(ViewData.Bounds); + CalculateCellBounds(ViewData.Bounds, ViewData.VisibleRect); + if not Visible or Hidden then Exit; + ShiftRect(FCaptionRect); + ShiftRect(FFinishRect); + ShiftRect(FMessageRect); + ShiftRect(FStartRect); + ShiftRect(FEventTimeRect); + ShiftRect(FTimeLineRect); + if FShowMessage then + CalculateEditViewInfo; + for I := 0 to Images.Count - 1 do + ShiftRect(Images[0].FBounds); +end; + +procedure TcxSchedulerEventCellViewInfo.AssignEditStyle( + AEditStyle: TcxCustomEditStyle); +var + AStyle: TcxCustomEditStyleAccess; +begin + AStyle := TcxCustomEditStyleAccess(AEditStyle); + AStyle.FAssignedValues := AStyle.FAssignedValues - + [svFont] + [svColor, svButtonTransparency]; + AStyle.StyleData.Font := Font; + AStyle.StyleData.Color := Color; + AStyle.StyleData.FontColor := TextColor; + AStyle.ButtonTransparency := ebtHideInactive; + AStyle.Changed; +end; + +procedure TcxSchedulerEventCellViewInfo.BeforeCustomDraw(ACanvas: TcxCanvas); +begin + FViewParams := ViewData.ViewParams; + inherited BeforeCustomDraw(ACanvas); +end; + +procedure TcxSchedulerEventCellViewInfo.Calculate; +begin + Canvas.Font := Font; + CalculateItemsLayout; +end; + +procedure TcxSchedulerEventCellViewInfo.CalculateBorders; +begin +end; + +procedure TcxSchedulerEventCellViewInfo.CalculateCaptions; +begin + FStartText := DateTimeHelper.TimeToStr(EventStart); + FFinishText := DateTimeHelper.TimeToStr(EventFinish); +end; + +procedure TcxSchedulerEventCellViewInfo.CalculateDetailInfo; +begin + FIsDetailInfo := ViewData.AutoHeight or (not IsHeaderEvent and + ((TimeOf(ContentFinish) <> 0) or (TimeOf(ContentStart) <> 0))); + FIsDetailCaption := FIsDetailInfo and not IsHeaderEvent; + FShowMessage := IsDetailInfo and (Length(Message) > 0); +end; + +procedure TcxSchedulerEventCellViewInfo.CalculateNeedHint; +var + R: TRect; +begin + if FHintNeededCalculated then Exit; + FHintNeeded := CanShowHint; + if not FHintNeeded then + begin + R := FCaptionRect; + Canvas.TextExtent(Hint, R, cxDrawTextFlags[IsDetailCaption]); + FHintNeeded := (FCaptionRect.Right < R.Right) or (FCaptionRect.Bottom < R.Bottom); + end; + FHintNeededCalculated := True; +end; + +procedure TcxSchedulerEventCellViewInfo.CalculateEditViewInfo; +var + AProperties: TcxCustomEditProperties; + AEditViewData: TcxCustomEditViewData; +begin + if not ViewData.AutoHeight then + begin + FMessageRect := GetMessageRect(CaptionRect, Images.VisibleImageCount > 0); + FCaptionRect.Bottom := Min(FMessageRect.Top, Bounds.Bottom - cxTextOffset); + end; + if cxRectIsEmpty(FMessageRect) then + begin + FShowMessage := False; + Exit; + end; + if FEditViewInfo = nil then + FEditViewInfo := TcxCustomEditViewInfo(ViewData.EditProperties.GetViewInfoClass.Create); + AProperties := ViewData.EditProperties; + AEditViewData := AProperties.CreateViewData(ViewData.EditStyle, True); + try + Include(AEditViewData.PaintOptions, epoAutoHeight); + AssignEditStyle(ViewData.EditStyle); + AEditViewData.ContentOffset := cxSimpleRect; + AEditViewData.EditValueToDrawValue(Canvas, Message, FEditViewInfo); + AEditViewData.CalculateEx(Canvas, FMessageRect, + cxInvalidPoint, cxmbNone, [], FEditViewInfo, False); + finally + AEditViewData.Free; + end; +end; + +procedure TcxSchedulerEventCellViewInfo.CalculateShowTimeAsClock; +begin + ViewData.ShowTimeAsClock := IsHeaderEvent or + (ViewData.ShowTimeAsClock and not IsDetailInfo); +end; + +function TcxSchedulerEventCellViewInfo.CalculateAutoLayoutImagesAutoHeight( + AVisibleImages: TList): Integer; + + function GetEventTextsHeight(const AWidth: Integer): Integer; + var + R: TRect; + begin + R := cxRect(0, 0, AWidth, MaxInt); + Result := GetCaptionAutoHeight(R) + 2 * cxTextOffset; + if ShowMessage then + begin + Inc(R.Right, 3); + Inc(Result, CalculateMessageHeight(R) + 1); + end; + end; + + function GetColCountForRowCount(ARowCount: Integer): Integer; + begin + Result := Images.TotalVisibleImageCount div ARowCount; + if (Images.TotalVisibleImageCount mod ARowCount) > 0 then + Inc(Result); + Result := Max(1, Result); + end; +var + I, ANewColCount, ACaptionWidth, ASpaceWidth, AImagesHeight, + AImagesWidth, AImagesColCount, AImagesRowCount, + ATextsHeight: Integer; +begin + ASpaceWidth := cxRectWidth(Bounds) - 2 * cxTextOffset; + ACaptionWidth := Canvas.TextWidth(Caption); + if (Images.TotalVisibleImageCount < 2) or + (ASpaceWidth >= Images.TotalVisibleWidth + cxEventImagesGap + ACaptionWidth) then + begin + Result := CalculateHorizontalImagesAutoHeight; + Exit; + end; + AImagesWidth := 0; + AImagesRowCount := 1; + AImagesColCount := 0; + for I := 1 to Images.TotalVisibleImageCount do + begin + AImagesRowCount := I; + AImagesHeight := Min(Images.TotalVisibleImageCount, (AImagesRowCount + 1)) * + (Images.ItemHeight + cxEventImagesGap) + 4; + ANewColCount := GetColCountForRowCount(AImagesRowCount); + if ANewColCount <> AImagesColCount then + begin + AImagesColCount := ANewColCount; + AImagesWidth := AImagesColCount * (Images.ItemWidth + cxEventImagesGap) + 1; + if ASpaceWidth <= AImagesWidth then Continue; + ATextsHeight := GetEventTextsHeight(ASpaceWidth - AImagesWidth); + if ATextsHeight < AImagesHeight then Break; + end + else Continue; + end; + Result := AImagesRowCount * (Images.ItemHeight + cxEventImagesGap) + 1; + Images.CalculateForCols(AVisibleImages, + cxPointOffset(Bounds.TopLeft, cxEventImagesOffset + cxEventBorderWidth, + cxEventImagesOffset + cxEventBorderWidth), AImagesColCount); + Inc(FCaptionRect.Left, AImagesWidth); + CalculateMessageAutoLayout(Result); +end; + +function TcxSchedulerEventCellViewInfo.CalculateHorizontalImagesAutoHeight: Integer; +var + ARightLimit, ACaptionWidth, ACaptionHeight, AMessageHeight, ASpaceWidth, + AMessageTop, AImagesWidth: Integer; + AImagesRect, R: TRect; +begin + Result := Images.ItemHeight + cxTextOffset; + ASpaceWidth := cxRectWidth(Bounds) - 2 * cxTextOffset; + ACaptionWidth := Canvas.TextWidth(Caption); + AImagesRect := cxRectInflate(Bounds, -cxTextOffset, -cxTextOffset); + if Images.ForceVisibleWidth + cxEventImagesGap >= ASpaceWidth then + begin + FCaptionRect := cxNullRect; + Images.CalculateSingleLineImages(AImagesRect); + AMessageTop := Bounds.Top + cxTextOffset + Result + cxEventImagesGap; + end + else + begin + ARightLimit := 0; + if not (Images.TotalVisibleWidth + cxEventImagesGap + ACaptionWidth <= ASpaceWidth) then + begin + R := FCaptionRect; + R.Left := Min(AImagesRect.Left + Images.TotalVisibleWidth, R.Right - 1); + Canvas.TextExtent(Caption, R, cxWordBreak or cxDontBreakChars); + if R.Right > FCaptionRect.Right then + begin + ACaptionWidth := cxRectWidth(R); + Dec(AImagesRect.Right, ACaptionWidth); + ARightLimit := Bounds.Right - cxTextOffset - cxRectWidth(R); + end; + end; + AImagesWidth := Images.CalculateSingleLineImages(AImagesRect, ARightLimit); + if AImagesWidth > 0 then Inc(AImagesWidth); + Inc(FCaptionRect.Left, AImagesWidth); + ACaptionHeight := GetCaptionAutoHeight(CaptionRect); + FCaptionRect.Bottom := FCaptionRect.Top + ACaptionHeight; + Result := Max(Result, ACaptionHeight + 2 * cxTextOffset); + AMessageTop := FCaptionRect.Top + Result; + end; + if FShowMessage then + begin + FMessageRect := cxRect(Bounds.Left + cxEventImagesGap, AMessageTop - 1, Bounds.Right - 1, 0); + AMessageHeight := CalculateMessageHeight(FMessageRect); + FMessageRect.Bottom := FMessageRect.Top + AMessageHeight; + Inc(Result, AMessageHeight + 1); + CalculateEditViewInfo; + end; +end; + +procedure TcxSchedulerEventCellViewInfo.CalculateMessageAutoLayout(var AHeight: Integer); +var + ACaptionHeight, AMessageHeight, AMessageTop: Integer; +begin + if not cxRectIsEmpty(CaptionRect) then + begin + ACaptionHeight := GetCaptionAutoHeight(CaptionRect); + FCaptionRect.Bottom := CaptionRect.Top + ACaptionHeight; + Inc(ACaptionHeight, 2 * cxTextOffset); + AHeight := Max(AHeight, ACaptionHeight); + if FShowMessage then + begin + AMessageTop := FCaptionRect.Top + ACaptionHeight - 1; + FMessageRect := cxRect(FCaptionRect.Left - 2, AMessageTop, Bounds.Right - 1, 0); + AMessageHeight := CalculateMessageHeight(FMessageRect); + FMessageRect.Bottom := FMessageRect.Top + AMessageHeight; + AHeight := Max(AHeight, ACaptionHeight + AMessageHeight); + CalculateEditViewInfo; + end; + end + else FShowMessage := False; +end; + +function TcxSchedulerEventCellViewInfo.CalculateVerticalImagesAutoHeight: Integer; +var + AImagesRect: TRect; +begin + Result := Images.ItemHeight + cxTextOffset; + if Images.TotalVisibleHeight > 0 then + begin + AImagesRect := cxRectInflate(Bounds, -cxTextOffset, -cxTextOffset); + AImagesRect.Bottom := AImagesRect.Top + Images.TotalVisibleHeight; + if (cxRectWidth(AImagesRect) > Images.ItemWidth + cxEventImagesGap) or + (Images.ForceVisibleHeight > 0) then + begin + Inc(FCaptionRect.Left, Images.ItemWidth + cxTextOffset); + Result := Images.TotalVisibleHeight + cxEventImagesGap; + end; + Images.CalculateSingleColumnImages(AImagesRect); + end; + CalculateMessageAutoLayout(Result); +end; + +procedure TcxSchedulerEventCellViewInfo.CalculateItemsLayout; +begin + if IsDetailInfo then + CalculateDetailViewEventLayout + else + CalculateHeaderEventLayout; +end; + +procedure TcxSchedulerEventCellViewInfo.CalculateDetailViewEventLayout; +var + AImagesWidth: Integer; +begin + FCaptionRect := cxRectInflate(Bounds, -cxTextOffset, -(cxTextOffset + 1)); + AImagesWidth := Images.Calculate(GetImagesBounds); + Images.Offset(0, GetImagesVerticalOffset(Images.ItemHeight, False)); + Inc(FCaptionRect.Left, AImagesWidth + cxEventImagesGap); + if FShowMessage then CalculateEditViewInfo; +end; + +procedure TcxSchedulerEventCellViewInfo.CalculateHeaderEventLayout; +var + ACaptionRect: TRect; + ALeft, AWidth, AImagesWidth, ACaptionWidth, AVertOffset: Integer; + ACanShowClock: Boolean; + R: TRect; + + procedure CalculateCaption; + var + R: TRect; + begin + InflateRect(ACaptionRect, -cxTextOffset, 0); + R := cxRectSetLeft(cxRectInflate(Bounds, -1, -1), 0, + cxRectWidth(ACaptionRect) - (ACaptionWidth + cxTextOffset)); + AImagesWidth := Images.CalculateSingleLineImages(R); + if AImagesWidth <> 0 then Inc(AImagesWidth, cxTextOffset); + AWidth := AImagesWidth + ACaptionWidth; + end; + +begin + FCaptionRect := cxRectInflate(Bounds, -cxTextOffset, -1); + R := cxRect(0, 0, EventImages.Width, EventImages.Height); + AVertOffset := GetImagesVerticalOffset(R.Bottom, True); + ACaptionWidth := Canvas.TextWidth(ViewData.Caption); + ACaptionRect := FCaptionRect; + ACanShowClock := cxRectWidth(ACaptionRect) >= EventImages.Width + cxEventImagesGap; + if ShowStartTime and ACanShowClock then + begin + FStartRect := cxRectOffset(R, Bounds.Left + (cxEventBorderWidth + cxEventImagesOffset), AVertOffset); + ACaptionRect.Left := FStartRect.Right; + end; + if ShowFinishTime and ACanShowClock then + begin + FFinishRect := cxRectOffset(R, Bounds.Right - R.Right - (cxEventBorderWidth + cxEventImagesOffset), AVertOffset); + ACaptionRect.Right := FFinishRect.Left; + end; + CalculateCaption; + if (ShowStartTime or ShowFinishTime) and + (ACaptionWidth + Images.TotalVisibleWidth > cxRectWidth(ACaptionRect)) and + not GetForceShowClockInHeaderEvent then + begin + FStartRect := cxEmptyRect; + FFinishRect := cxEmptyRect; + ViewData.ShowStartTime := False; + ViewData.ShowFinishTime := False; + ACaptionRect := FCaptionRect; + CalculateCaption; + end; + with ACaptionRect do + ALeft := Max(Left + ((Right - Left - AWidth) div 2), ACaptionRect.Left); + Images.Offset(ALeft, GetImagesVerticalOffset(Images.ItemHeight, False)); + ACaptionRect.Left := ALeft + AImagesWidth; + FCaptionRect := ACaptionRect; +end; + +procedure TcxSchedulerEventCellViewInfo.CalculateNonDetailEventLayout; +var + R: TRect; + ALeft, ACaptionWidth, AImagesWidth: Integer; +begin + FCaptionRect := cxRectInflate(Bounds, -cxTextOffset, -1); + ALeft := CaptionRect.Left; + ACaptionWidth := Canvas.TextWidth(ViewData.Caption); + R := CalculateNonDetailEventImages(ACaptionWidth, AImagesWidth); + if ShowFinishTime or ShowStartTime then + begin + if ShowTimeAsClock then + CalculateEventTimeAsClockLayout(R, ACaptionWidth, AImagesWidth, ALeft) + else + CalculateEventTimeAsTextLayout(R, ACaptionWidth, AImagesWidth, ALeft); + end; + AImagesWidth := Images.Offset(ALeft - FCaptionRect.Left, + GetImagesVerticalOffset(Images.ItemHeight, False)); + if AImagesWidth > 0 then Inc(AImagesWidth); + Inc(ALeft, AImagesWidth + cxEventImagesOffset); + FCaptionRect.Left := ALeft; +end; + +procedure TcxSchedulerEventCellViewInfo.CalculateEventTimeAsClockLayout( + const ABounds: TRect; const ACaptionWidth, AImagesWidth: Integer; var ALeft: Integer); +var + R: TRect; + AVertOffset: Integer; +begin + R := cxRectBounds(0, 0, TcxSchedulerPainterHelper.IconsWidth, + TcxSchedulerPainterHelper.IconsHeight); + AVertOffset := GetImagesVerticalOffset(R.Bottom, True); + FStartRect := SetItemRect(ShowStartTime, R, AVertOffset, ALeft); + FFinishRect := SetItemRect(ShowFinishTime, R, AVertOffset, ALeft); + Inc(ALeft); +end; + +procedure TcxSchedulerEventCellViewInfo.CalculateEventTimeAsTextLayout( + const ABounds: TRect; const ACaptionWidth, AImagesWidth: Integer; var ALeft: Integer); +var + ASpaceWidth, AWidth: Integer; + R: TRect; +begin + ASpaceWidth := cxRectWidth(ABounds) - AImagesWidth; + with Canvas.TextExtent('00:00') do + R := cxRectBounds(ABounds.Left, 0, CX, CY); + if not Is24HourTimeFormat then + R := cxRectSetWidth(R, Max(Canvas.TextWidth('00:00' + TimeAMString), + Canvas.TextWidth('00:00' + TimePMString))); + AWidth := cxRectWidth(R); + if ASpaceWidth >= AWidth then + begin + FStartRect := cxRect(ALeft, FCaptionRect.Top, ALeft + AWidth, FCaptionRect.Bottom); + Inc(AWidth, Canvas.TextWidth('0') div 2); + Inc(ALeft, AWidth); + Dec(ASpaceWidth, AWidth); + if ShowFinishTime and (ASpaceWidth >= AWidth) then + begin + FFinishRect := cxRectOffset(FStartRect, AWidth, 0); + Inc(ALeft, AWidth); + end; + end; +end; + +function TcxSchedulerEventCellViewInfo.CalculateNonDetailEventImages( + const ACaptionWidth: Integer; out AImagesWidth: Integer): TRect; +begin + Result := GetImagesBounds; + AImagesWidth := CalculateSingleLineImages(Result); +end; + +function TcxSchedulerEventCellViewInfo.CalculateSingleLineImages( + const ABounds: TRect; ARightLimit: Integer = 0): Integer; +begin + Result := Images.CalculateSingleLineImages(ABounds, ARightLimit); +end; + +function TcxSchedulerEventCellViewInfo.SetItemRect(AShowItem: Boolean; + const ABounds: TRect; AVertOffset: Integer; var APos: Integer): TRect; +begin + Result := cxNullRect; + if AShowItem then + begin + if ((APos + cxRectWidth(ABounds)) <= cxRectCenter(FBounds).X) then + begin + Result := cxRectOffset(ABounds, APos, AVertOffset); + APos := Result.Right + cxTextOffset; + end; + end +end; + +procedure TcxSchedulerEventCellViewInfo.CalculateEventTimeVisibility; +begin + if IsDetailInfo then + CalculateDetailEventTimeVisibility + else + CalculateNonDetailEventTimeVisibility; +end; + +procedure TcxSchedulerEventCellViewInfo.CalculateDetailEventTimeVisibility; +begin + ViewData.ShowFinishTime := (IsDetailCaption and ViewData.AlwaysShowTime) or + ((ViewData.ContentFinish > EventFinish) and (ViewData.ContentStart <> EventFinish)) or + (ViewData.ContentStart < EventStart); + ViewData.ShowStartTime := ViewData.ShowFinishTime; +end; + +procedure TcxSchedulerEventCellViewInfo.CalculateNonDetailEventTimeVisibility; +begin + if Event.AllDayEvent then + begin + ViewData.ShowFinishTime := False; + ViewData.ShowStartTime := False; + end + else + begin + ViewData.ShowFinishTime := (ViewData.ContentFinish >= EventFinish) and + (ViewData.ShowFinishTime or (Event.Duration >= 1)); + ViewData.ShowStartTime := (ContentStart <= EventStart); + end; +end; + +procedure TcxSchedulerEventCellViewInfo.CalculateVisibility; +begin + if ViewData.ShowTimeLine then + begin + if Selected then + FVisible := cxRectIntersect(FClipRect, cxRectInflate(Bounds, 0, cxTimeLineWidth), ViewData.VisibleRect); + end + else + FVisible := FVisible and (FClipRect.Bottom = FBounds.Bottom); + CalculateDetailInfo; + CalculateShowTimeAsClock; + CalculateEventTimeVisibility; + CalculateBorders; +end; + +function TcxSchedulerEventCellViewInfo.CanAutoHideStandardImages: Boolean; +begin + Result := False; +end; + +function TcxSchedulerEventCellViewInfo.CanShowHint: Boolean; +begin + Result := not Event.AllDayEvent and not IsDetailInfo and + (cxRectIsEmpty(FinishRect) or cxRectIsEmpty(StartRect)); +end; + +procedure TcxSchedulerEventCellViewInfo.DoDraw; +begin + if FHidden then Exit; + ClippingCreate(True); + DrawContent; + ClippingRestore; +end; + +procedure TcxSchedulerEventCellViewInfo.DrawCaption; +begin + if cxRectIsEmpty(FCaptionRect) or (ViewData.Caption = '') then Exit; + Canvas.Brush.Style := bsClear; + Canvas.DrawText(ViewData.Caption, FCaptionRect, cxDrawTextFlags[IsDetailCaption]); + Canvas.Brush.Style := bsSolid; +end; + +procedure TcxSchedulerEventCellViewInfo.DrawContent; +begin + if ViewData.DrawAsProgress then + ExternalPainter.DrawEventAsProgress(Self) + else + begin + ExternalPainter.DrawEvent(Self); + if not Event.IsEditing then + DrawImages; + if IsNeedDrawTime then + DrawTime; + DrawCaption; + if FShowMessage then + begin + FEditViewInfo.Transparent := True; + FEditViewInfo.TextColor := TextColor; + FEditViewInfo.PaintEx(Canvas); + DrawMessageSeparator; + end; + end; +end; + +procedure TcxSchedulerEventCellViewInfo.DrawImages; +var + I: Integer; + ASaveRgn: TcxRegion; +begin + with Images do + begin + if Count = 0 then Exit; + ASaveRgn := Canvas.GetClipRegion; + Canvas.IntersectClipRect(cxRectInflate(Bounds, -1, -1)); + for I := 0 to Count - 1 do + with Items[I] do + if Visible and not FHidden then + begin + Images.DrawingStyle := dsTransparent; + Canvas.DrawImage(Images, Bounds.Left, Bounds.Top, ImageIndex); + end; + Canvas.SetClipRegion(ASaveRgn, roSet); + end; +end; + +procedure TcxSchedulerEventCellViewInfo.DrawMessageSeparator; +var + R: TRect; +begin + R := cxRectInflate(MessageRect, -(1 + Byte(not ShowTimeLine)), 1, -2, 0); + Canvas.FrameRect(R, SeparatorColor, 1, [bTop]); +end; + +procedure TcxSchedulerEventCellViewInfo.DrawTime; +const + RightJustify = cxAlignRight or cxAlignVCenter or cxSingleLine; +begin + if ShowTimeAsClock then + begin + if ShowStartTime then + PainterHelper.DrawClock(Canvas, FStartRect, Event.Start, FViewParams); + if ShowFinishTime then + PainterHelper.DrawClock(Canvas, FFinishRect, Event.Finish, FViewParams); + end + else + begin + DrawText(FStartRect, FStartText, RightJustify); + DrawText(FFinishRect, FFinishText, RightJustify); + end; +end; + +function TcxSchedulerEventCellViewInfo.GetCaptionAutoHeight(const R: TRect): Integer; +begin + if (Caption <> '') and not cxRectIsEmpty(CaptionRect) then + Result := GetTrueMultilineTextHeight(Canvas, ViewData.Caption, R) + else + Result := Canvas.FontHeight(Font); +end; + +function TcxSchedulerEventCellViewInfo.GetEditingRect: TRect; +begin + cxRectIntersect(Result, PainterHelper.ExcludeBorders(Bounds, Borders), FClipRect); + with Result do + begin + if IsDetailCaption then + begin + Inc(Left, cxTextOffset - Byte(bLeft in Borders)); + Dec(Right); + end + else + Inc(Left); + end; +end; + +function TcxSchedulerEventCellViewInfo.GetForceShowClockInHeaderEvent: Boolean; +begin + Result := True; +end; + +function TcxSchedulerEventCellViewInfo.GetHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest; var ABreak: Boolean): Boolean; +begin + Result := inherited GetHittest(AHitTest, ABreak); + Result := Result and not Hidden; + if Result and not Hidden and ShowTimeLine and Selected then + ABreak := not PtInRect(CaptionRect, AHitTest.HitPoint) and not + PtInRect(MessageRect, AHitTest.HitPoint) + else + ABreak := False; +end; + +function TcxSchedulerEventCellViewInfo.GetImagesBounds: TRect; +begin + with Bounds do + Result := cxRect(Left + cxEventBorderWidth + cxEventImagesOffset - Byte(ViewData.ShowTimeLine), + Top + cxEventBorderWidth, + (Left + Right - cxTextOffset) div 2, + Bottom - (cxEventBorderWidth + cxEventImagesOffset)); +end; + +function TcxSchedulerEventCellViewInfo.GetImagesVerticalOffset( + AImageHeight: Integer; AIsAbsolute: Boolean): Integer; +begin + Result := cxEventImagesOffset; + if not FIsDetailCaption then + Result := Max(Result, (cxRectHeight(Bounds) - 2 * cxEventBorderWidth - AImageHeight) div 2); + if AIsAbsolute then + Inc(Result, Bounds.Top + cxEventBorderWidth); +end; + +function TcxSchedulerEventCellViewInfo.GetMessageRect(const ACaptionRect: TRect; + AHasImages: Boolean): TRect; +var + ACaptionBottom: Integer; + R: TRect; +begin + if not cxRectIsEmpty(ACaptionRect) then + begin + R := GetCaptionBounds(ACaptionRect); + ACaptionBottom := R.Bottom + cxTextOffset; //bottom text offset + end + else + ACaptionBottom := Bounds.Top + cxTextOffset; + if AHasImages then + ACaptionBottom := Max(ACaptionBottom, Bounds.Top + Images.ItemHeight); + Inc(ACaptionBottom); //horz line + Result.Top := ACaptionBottom; + Result.Bottom := Bounds.Bottom; + Result.Right := Bounds.Right - 1; + if Images.Layout = eilHorizontal then + Result.Left := Bounds.Left + cxEventBorderWidth + else + Result.Left := R.Left - cxTextOffset; +end; + +function TcxSchedulerEventCellViewInfo.HasReminder: Boolean; +begin + with Event do + begin + Result := Storage.Reminders.Active and Storage.IsReminderAvailable and Reminder; + if Result and (ResourceItem <> nil) and Storage.IsReminderByResourceAvailable then + Result := HasReminderForResourceID(ResourceItem.ResourceID); + end; +end; + +procedure TcxSchedulerEventCellViewInfo.Initialize; +begin + FBorders := cxBordersAll; + FEventStart := TruncTime(Event.Start); + FEventFinish := TruncTime(Event.Finish); + FIsHeaderEvent := GetIsHeaderEvent; + FStartRect := cxNullRect; + FFinishRect := cxNullRect; + FTimeLineRect := cxNullRect; + ViewData.ShowTimeLine := ViewData.ShowTimeLine and IsTimeLineVisible; + InitStandardEventImages; + CalculateVisibility; + CalculateCaptions; +end; + +procedure TcxSchedulerEventCellViewInfo.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + AHitTest.FEventCell := Self; + AHitTest.FEventBounds := FClipRect; + AHitTest.FDragKind := edkMoveEvent; + CalculateNeedHint; + AHitTest.FNeedShowHint := FHintNeeded; +end; + +procedure TcxSchedulerEventCellViewInfo.InitHitTestForHorzEvent( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + if (bLeft in Borders) and ((AHitTest.HitX - Bounds.Left) <= cxHitDelta) then + AHitTest.FDragKind := edkResizeStart + else + if (bRight in Borders) and ((Bounds.Right - AHitTest.HitX) <= cxHitDelta) then + AHitTest.FDragKind := edkResizeEnd; +end; + +procedure TcxSchedulerEventCellViewInfo.InitStandardEventImages; +var + AutoHide: Boolean; +begin + AutoHide := CanAutoHideStandardImages; + with Event do + begin + if HasReminder then + Images.AddStandardImage(eitReminder, AutoHide); + case EventType of + etOccurrence: Images.AddStandardImage(eitRecurrence, AutoHide); + etCustom: Images.AddStandardImage(eitCustomOccurrence, AutoHide); + end; + end; +end; + +function TcxSchedulerEventCellViewInfo.IsHorzSizing: Boolean; +begin + Result := True; +end; + +function TcxSchedulerEventCellViewInfo.IsNeedDrawTime: Boolean; +begin + Result := ViewData.ShowFinishTime or ViewData.ShowStartTime; +end; + +function TcxSchedulerEventCellViewInfo.IsTimeLineVisible: Boolean; +begin + Result := False; +end; + +function TcxSchedulerEventCellViewInfo.TruncTime( + const ATime: TDateTime): TDateTime; +begin + Result := DateTimeHelper.RoundTime(ATime); +end; + +function TcxSchedulerEventCellViewInfo.GetContentFinish: TDateTime; +begin + Result := ViewData.ContentFinish; +end; + +function TcxSchedulerEventCellViewInfo.CalculateMessageHeight(const R: TRect): Integer; + + function CreateEditViewData: TcxCustomEditViewData; + begin + with ViewData do + Result := EditProperties.CreateViewData(EditStyle, True); + end; + +var + AEditViewData: TcxCustomEditViewData; + ASize: TcxEditSizeProperties; +begin + AEditViewData := CreateEditViewData; + try + AssignEditStyle(ViewData.EditStyle); + AEditViewData.ContentOffset := cxSimpleRect; + ASize.MaxLineCount := 0; + ASize.Height := -1; + ASize.Width := cxRectWidth(R); + Result := AEditViewData.GetEditSize(Canvas, Message, ASize).cy; + finally + AEditViewData.Free; + end; +end; + +function TcxSchedulerEventCellViewInfo.GetBorderColor: TColor; +begin + Result := ViewData.BorderColor; +end; + +function TcxSchedulerEventCellViewInfo.GetCaption: string; +begin + Result := ViewData.Caption; +end; + +function TcxSchedulerEventCellViewInfo.GetCaptionBounds(const R: TRect): TRect; +begin + Result := R; + if Length(ViewData.Caption) > 0 then + Canvas.TextExtent(ViewData.Caption, Result, cxDrawTextFlags[IsDetailCaption]) + else + Canvas.TextExtent('Wg', Result, cxDrawTextFlags[IsDetailCaption]); +end; + +function TcxSchedulerEventCellViewInfo.GetContentStart: TDateTime; +begin + Result := ViewData.ContentStart; +end; + +function TcxSchedulerEventCellViewInfo.GetEvent: TcxSchedulerControlEvent; +begin + Result := ViewData.Event; +end; + +function TcxSchedulerEventCellViewInfo.GetHint: string; +begin + if not FHintAssigned then + FHint := ViewData.GetEventHint(Event); + FHintAssigned := True; + Result := FHint; +end; + +function TcxSchedulerEventCellViewInfo.GetIsHeaderEvent: Boolean; +begin + Result := Event.AllDayEvent or ((Event.Finish - Event.Start) >= 1); +end; + +function TcxSchedulerEventCellViewInfo.GetMessage: string; +begin + Result := Event.Message; +end; + +function TcxSchedulerEventCellViewInfo.GetResourceInfo: TcxSchedulerResourceViewInfo; +begin + Result := ViewData.Resource; +end; + +function TcxSchedulerEventCellViewInfo.GetResourceItem: TcxSchedulerStorageResourceItem; +begin + Result := nil; + if ResourceInfo <> nil then + Result := ResourceInfo.ResourceItem; +end; + +function TcxSchedulerEventCellViewInfo.GetSelected: Boolean; +begin + Result := Event.Selected; +end; + +function TcxSchedulerEventCellViewInfo.GetShowingState( + AIndex: Integer): Boolean; +begin + case AIndex of + 0: Result := ViewData.ShowFinishTime; + 1: Result := ViewData.ShowStartTime; + 2: Result := ViewData.ShowTimeAsClock; + 3: Result := ViewData.ShowTimeLine; + else + Result := False; + end; +end; + +procedure TcxSchedulerEventCellViewInfo.SetBorderColor(AValue: TColor); +begin + ViewData.BorderColor := AValue; +end; + +{ TcxSchedulerMoreEventsButtonViewInfo } + +procedure TcxSchedulerMoreEventsButtonViewInfo.Click; +begin + if Assigned(FOnClick) then + FOnClick(Self); +end; + +procedure TcxSchedulerMoreEventsButtonViewInfo.DoDraw; +begin + MoreEventButtonGlyphs.DrawingStyle := dsTransparent; + Canvas.DrawImage(MoreEventButtonGlyphs, Bounds.Left, Bounds.Top, Byte(not IsDown)); +end; + +procedure TcxSchedulerMoreEventsButtonViewInfo.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + inherited InitHitTest(AHitTest); + AHitTest.SetBitState(htcButton, True); + AHitTest.FButton := Self; + if Int(DateTime) > 0 then + AHitTest.SetHitTime(htcTime, Int(DateTime)); +end; + +{ TcxSchedulerContentNavigationButtonViewInfo } + +procedure TcxSchedulerContentNavigationButtonViewInfo.Click; +begin + if Enabled and Assigned(FOnClick) then + FOnClick(Self); +end; + +procedure TcxSchedulerContentNavigationButtonViewInfo.DoDraw; +var + AState: TcxButtonState; +begin + if Enabled then + begin + if (FHitTest <> nil) and (FHitTest.FContentNavigationButton = Self) then + AState := cxbsHot + else + AState := cxbsNormal; + end + else + AState := cxbsDisabled; + Painter.DrawSchedulerNavigationButton(Canvas, Bounds, Kind = nbkNext, + AState, Caption, TextRect, ArrowRect); +end; + +procedure TcxSchedulerContentNavigationButtonViewInfo.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + if Enabled then + begin + FHitTest := AHitTest; + inherited InitHitTest(AHitTest); + AHitTest.SetBitState(htcNavigationButton, True); + AHitTest.FContentNavigationButton := Self; + end; +end; + +function TcxSchedulerContentNavigationButtonViewInfo.GetEnabled: Boolean; +begin + Result := Abs(Interval) < cxMaxDateTime; +end; + +{ TcxSchedulerGroupSeparatorCellViewInfo } + +destructor TcxSchedulerGroupSeparatorCellViewInfo.Destroy; +begin + FreeAndNil(FRotateBitmap); + inherited Destroy; +end; + +procedure TcxSchedulerGroupSeparatorCellViewInfo.DoDraw; + + procedure CreateRotatedBitmap; + begin + FRotateBitmap := TcxBitmap.CreateSize(Bounds, pf32bit); + FRotateBitmap.Canvas.Lock; + end; + +begin + if not Rotated then + Painter.DrawHeader(Canvas, Bounds, Bounds, [nRight, nLeft], cxBordersAll, cxbsNormal, + taLeftJustify, vaCenter, False, False, '', nil, clNone, Color, DrawBackground) + else + begin + if FRotateBitmap = nil then + begin + CreateRotatedBitmap; + FRotateBitmap.cxCanvas.WindowOrg := Bounds.TopLeft; + FDrawRotatedBackground := DrawBackground(FRotateBitmap.cxCanvas, Bounds); + + RotateBitmap(FRotateBitmap, raPlus90, True); + + Painter.DrawHeader(FRotateBitmap.cxCanvas, Rect(0, 0, FRotateBitmap.Width, + FRotateBitmap.Height), cxNullRect, [nRight, nLeft], cxBordersAll, + cxbsNormal, taCenter, vaCenter, False, False, '', nil, clNone, Color, + DrawRotateBackground); + + RotateBitmap(FRotateBitmap, raPlus90, True); + end; + Canvas.Draw(Bounds.Left, Bounds.Top, FRotateBitmap); + end; +end; + +procedure TcxSchedulerGroupSeparatorCellViewInfo.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + AHitTest.SetBitState(htcGroupSeparator, True); +end; + +function TcxSchedulerGroupSeparatorCellViewInfo.DrawRotateBackground( + ACanvas: TcxCanvas; const ABounds: TRect): Boolean; +begin + Result := FDrawRotatedBackground; +end; + +{ TcxSchedulerResourceViewInfo } + +constructor TcxSchedulerResourceViewInfo.Create( + AResource: TcxSchedulerStorageResourceItem); +begin + FResourceItem := AResource; + FColor := AResource.Color; + FResourceID := AResource.ResourceID; + FCaption := AResource.Resources.GetResourceName(FResourceItem); + FImages := AResource.Resources.Images; + FImageIndex := AResource.ActualImageIndex; +end; + +{ TcxSchedulerExternalPainter } + +procedure TcxSchedulerExternalPainter.DoCustomDrawBackground( + AViewInfo: TcxSchedulerBackgroundCellViewInfo; var ADone: Boolean); +begin + if FCommonPainter <> nil then + FCommonPainter.DoCustomDrawBackground(AViewInfo, ADone); +end; + +procedure TcxSchedulerExternalPainter.DoCustomDrawButton( + AViewInfo: TcxSchedulerMoreEventsButtonViewInfo; var ADone: Boolean); +begin + if FCommonPainter <> nil then + FCommonPainter.DoCustomDrawButton(AViewInfo, ADone); +end; + +procedure TcxSchedulerExternalPainter.DoCustomDrawContent( + AViewInfo: TcxSchedulerContentCellViewInfo; var ADone: Boolean); +begin + if FCommonPainter <> nil then + FCommonPainter.DoCustomDrawContent(AViewInfo, ADone); +end; + +procedure TcxSchedulerExternalPainter.DoCustomDrawDayHeader( + AViewInfo: TcxSchedulerDayHeaderCellViewInfo; var ADone: Boolean); +begin + if FCommonPainter <> nil then + FCommonPainter.DoCustomDrawDayHeader(AViewInfo, ADone); +end; + +procedure TcxSchedulerExternalPainter.DoCustomDrawEvent( + AViewInfo: TcxSchedulerEventCellViewInfo; var ADone: Boolean); +begin + if FCommonPainter <> nil then + FCommonPainter.DoCustomDrawEvent(AViewInfo, ADone); +end; + +procedure TcxSchedulerExternalPainter.DoCustomDrawGroupSeparator( + AViewInfo: TcxSchedulerGroupSeparatorCellViewInfo; var ADone: Boolean); +begin + if FCommonPainter <> nil then + FCommonPainter.DoCustomDrawGroupSeparator(AViewInfo, ADone); +end; + +procedure TcxSchedulerExternalPainter.DoCustomDrawNavigationButton( + AViewInfo: TcxSchedulerContentNavigationButtonViewInfo; var ADone: Boolean); +begin + if FCommonPainter <> nil then + FCommonPainter.DoCustomDrawNavigationButton(AViewInfo, ADone); +end; + +procedure TcxSchedulerExternalPainter.DoCustomDrawResourceHeader( + AViewInfo: TcxSchedulerHeaderCellViewInfo; var ADone: Boolean); +begin + if FCommonPainter <> nil then + FCommonPainter.DoCustomDrawResourceHeader(AViewInfo, ADone); +end; + +function TcxSchedulerExternalPainter.HasCustomDrawGroupSeparator: Boolean; +begin + Result := (FCommonPainter <> nil) and + FCommonPainter.HasCustomDrawGroupSeparator; +end; + +function TcxSchedulerExternalPainter.HasCustomDrawResourceHeader: Boolean; +begin + Result := (FCommonPainter <> nil) and + FCommonPainter.HasCustomDrawResourceHeader; +end; + +procedure TcxSchedulerExternalPainter.DrawAllDayArea(ACanvas: TcxCanvas; + const ARect: TRect; ABorderColor: TColor; ABorders: TcxBorders; + AViewParams: TcxViewParams; ASelected: Boolean; ATransparent: Boolean); +begin + if ATransparent then + ACanvas.FrameRect(ARect, ABorderColor, 1, ABorders) + else + ACanvas.FillRect(ARect, AViewParams, ABorders, ABorderColor, 1); +end; + +procedure TcxSchedulerExternalPainter.DrawCurrentTime(ACanvas: TcxCanvas; + AColor: TColor; AStart: TDateTime; ABounds: TRect); +var + Y: Integer; + ANow: TDateTime; +begin + ANow := TimeOf(Now) - TimeOf(AStart); + if (ANow < 0) or (ANow >= HourToTime) then Exit; + Y := Round(ABounds.Top + (ANow * cxRectHeight(ABounds)) / HourToTime); + Dec(Y, 3); + Dec(ABounds.Right); + if Y < ABounds.Top then + Y := ABounds.Top; + PainterHelper.DrawGradientRect(ACanvas, AColor, cxRectSetTop(ABounds, Y - 6, 6)); +end; + +function TcxSchedulerExternalPainter.NeedDrawSelection: Boolean; +begin + Result := True; +end; + +function TcxSchedulerExternalPainter.DrawCurrentTimeFirst: Boolean; +begin + Result := True; +end; + +procedure TcxSchedulerExternalPainter.DrawEvent( + AViewInfo: TcxSchedulerEventCellViewInfo); +begin + with AViewInfo do + DrawRect(Bounds, Borders, ViewData.BorderColor); +end; + +procedure TcxSchedulerExternalPainter.DrawEventAsProgress( + AViewInfo: TcxSchedulerEventCellViewInfo); +var + AContent: TRect; + AProgressRect: TRect; +begin + with AViewInfo do + begin + AContent := cxRectContent(Bounds, Painter.SchedulerEventProgressOffsets); + AProgressRect := AContent; + AProgressRect.Right := AProgressRect.Left + + Trunc(ViewData.TaskComplete / 100 * cxRectWidth(AProgressRect)); + Painter.DrawSchedulerEventProgress(Canvas, Bounds, AProgressRect, ViewParams, + Transparent); + Canvas.Brush.Style := bsClear; + Canvas.Font.Color := Painter.ProgressBarTextColor; + DrawEventAsProgressText(AViewInfo, AContent, AProgressRect, + IntToStr(ViewData.TaskComplete) + '%'); + end; +end; + +procedure TcxSchedulerExternalPainter.DrawEventAsProgressText( + AViewInfo: TcxSchedulerEventCellViewInfo; AContent: TRect; AProgressRect: TRect; + const AText: string); + + procedure DrawInvertedText(ACanvas: TcxCanvas; const AText: string; + const ATextRect: TRect); + var + ACopyMode: Integer; + ATextBmp: TBitmap; + ATextDeltaX, ATextDeltaY: Integer; + ATextSavedBmp: TBitmap; + begin + ATextBmp := TBitmap.Create; + ATextSavedBmp := TBitmap.Create; + try + ATextBmp.Width := ACanvas.TextWidth(AText); + ATextBmp.Height := ACanvas.TextHeight(AText); + ATextSavedBmp.Width := ATextBmp.Width; + ATextSavedBmp.Height := ATextBmp.Height; + ATextDeltaX := (ATextRect.Left + ATextRect.Right - ATextBmp.Width) div 2; + ATextDeltaY := (ATextRect.Top + ATextRect.Bottom - ATextBmp.Height) div 2; + ATextBmp.Canvas.Font := ACanvas.Font; + ATextBmp.Canvas.Font.Color := clBlack; + ATextBmp.Canvas.Brush.Color := clWhite; + ATextBmp.Canvas.FillRect(ATextBmp.Canvas.ClipRect); + ATextBmp.Canvas.TextOut(0, 0, AText); + ACopyMode := ACanvas.CopyMode; + try + BitBlt(ATextSavedBmp.Canvas.Handle, 0, 0, ATextBmp.Width, ATextBmp.Height, + ACanvas.Handle, ATextDeltaX, ATextDeltaY, SRCCOPY); + BitBlt(ATextBmp.Canvas.Handle, 0, 0, ATextBmp.Width, ATextBmp.Height, + ACanvas.Handle, ATextDeltaX, ATextDeltaY, DSTINVERT); + ACanvas.Canvas.TextOut(ATextDeltaX, ATextDeltaY, AText); + ACanvas.CopyMode := cmSrcCopy; + ACanvas.Draw(ATextDeltaX, ATextDeltaY, ATextSavedBmp); + ACanvas.CopyMode := cmSrcInvert; + ACanvas.Draw(ATextDeltaX, ATextDeltaY, ATextBmp); + finally + ACanvas.CopyMode := ACopyMode; + end; + finally + ATextSavedBmp.Free; + ATextBmp.Free; + end; + end; + +begin + if cxRectIntersect(AContent, AProgressRect) then + DrawInvertedText(AViewInfo.Canvas, AText, AContent) + else + cxDrawText(AViewInfo.Canvas.Handle, AText, AContent, DT_CENTER or + DT_VCENTER or DT_SINGLELINE); +end; + +procedure TcxSchedulerExternalPainter.DrawTimeGridCurrentTime(ACanvas: TcxCanvas; + AColor: TColor; const ATimeLineRect: TRect); +begin + ACanvas.FillRect(ATimeLineRect, AColor); +end; + +procedure TcxSchedulerExternalPainter.DrawTimeGridHeader(ACanvas: TcxCanvas; + ABorderColor: TColor; AViewInfo: TcxSchedulerCustomViewInfoItem; + ABorders: TcxBorders; ASelected: Boolean); +begin + with AViewInfo do + DrawRect(Bounds, Borders, ABorderColor); +end; + +procedure TcxSchedulerExternalPainter.DrawTimeLine(ACanvas: TcxCanvas; + const ARect: TRect; AViewParams: TcxViewParams; ABorders: TcxBorders; + ABorderColor: TColor); +begin + ACanvas.FillRect(ARect, AViewParams, ABorders, ABorderColor); +end; + +procedure TcxSchedulerExternalPainter.DrawTimeRulerBackground(ACanvas: TcxCanvas; + const ARect: TRect; ABorders: TcxBorders; AViewParams: TcxViewParams; + ATransparent: Boolean); +begin + if ATransparent then + ACanvas.FrameRect(ARect, clBtnShadow, 1, ABorders) + else + ACanvas.FillRect(ARect, AViewParams, ABorders, clBtnShadow, 1); +end; + +procedure TcxSchedulerExternalPainter.DrawShadow(ACanvas: TcxCanvas; + const ARect, AVisibleRect: TRect; ABuffer: TBitmap); +begin + PainterHelper.DrawShadow(ACanvas, ARect, AVisibleRect, ABuffer); +end; + +function TcxSchedulerExternalPainter.GetPainterHelper: TcxSchedulerPainterHelperClass; +begin + Result := SchedulerHelpersFactory.PainterHelperClass; +end; + +function TcxSchedulerExternalPainter.MoreButtonSize(ASize: TSize): TSize; +begin + Result := ASize; +end; + +{ TcxSchedulerCustomResourceView } + +constructor TcxSchedulerCustomResourceView.Create( + AOwner: TcxCustomScheduler); +begin + inherited Create(AOwner); + FShowEndTime := True; + InitializePainter; +end; + +destructor TcxSchedulerCustomResourceView.Destroy; +begin + FinilizePainter; + inherited Destroy; +end; + +procedure TcxSchedulerCustomResourceView.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerCustomResourceView then + begin + ShowEndTime := TcxSchedulerCustomResourceView(Source).ShowEndTime; + ShowTimeAsClock := TcxSchedulerCustomResourceView(Source).ShowTimeAsClock; + FGroupingKind := TcxSchedulerCustomResourceView(Source).GroupingKind; + end; + inherited Assign(Source); +end; + +procedure TcxSchedulerCustomResourceView.InitializePainter; +begin + if FExternalPainter = nil then + FExternalPainter := ExternalPainterClass.Create; +end; + +procedure TcxSchedulerCustomResourceView.FinilizePainter; +begin + FExternalPainter := nil; +end; + +procedure TcxSchedulerCustomResourceView.CalculateViewInfo; +begin + Adapter.Calculate; +end; + +procedure TcxSchedulerCustomResourceView.CheckGroupingKind( + AStyle: TcxSchedulerGroupingKind; var ActuallyStyle: TcxSchedulerGroupingKind); +begin + ActuallyStyle := AStyle; +end; + +function TcxSchedulerCustomResourceView.CreateController: TcxSchedulerSubControlController; +begin + Result := TcxSchedulerCustomResourceViewController.Create(Self); +end; + +function TcxSchedulerCustomResourceView.CreateHitTest: TcxSchedulerSubControlHitTest; +begin + Result := TcxSchedulerCustomResourceViewHitTest.Create(Self); +end; + +function TcxSchedulerCustomResourceView.CreateViewAdapter: TcxCustomResourceViewAdapter; +begin + Result := TcxCustomResourceViewAdapter.Create(Self); +end; + +procedure TcxSchedulerCustomResourceView.CreateSubClasses; +begin + inherited CreateSubClasses; + FAdapter := CreateViewAdapter; + ViewInfo.FAdapter := FAdapter; +end; + +procedure TcxSchedulerCustomResourceView.DestroySubClasses; +var + Adapter: TObject; +begin + Adapter := ViewInfo.FAdapter; + inherited DestroySubClasses; + Adapter.Free; +end; + +procedure TcxSchedulerCustomResourceView.DoCustomDrawBackground( + AViewInfo: TcxSchedulerBackgroundCellViewInfo; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawBackground) then + FOnCustomDrawBackground(Self, Canvas, AViewInfo, ADone); +end; + +procedure TcxSchedulerCustomResourceView.DoCustomDrawButton( + AViewInfo: TcxSchedulerMoreEventsButtonViewInfo; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawButton) then + FOnCustomDrawButton(Self, Canvas, AViewInfo, ADone); +end; + +procedure TcxSchedulerCustomResourceView.DoCustomDrawContent( + AViewInfo: TcxSchedulerContentCellViewInfo; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawContent) then + FOnCustomDrawContent(Self, Canvas, AViewInfo, ADone); +end; + +procedure TcxSchedulerCustomResourceView.DoCustomDrawDayHeader( + AViewInfo: TcxSchedulerDayHeaderCellViewInfo; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawDayHeader) then + FOnCustomDrawDayHeader(Self, Canvas, AViewInfo, ADone); +end; + +procedure TcxSchedulerCustomResourceView.DoCustomDrawEvent( + AViewInfo: TcxSchedulerEventCellViewInfo; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawEvent) then + FOnCustomDrawEvent(Self, Canvas, AViewInfo, ADone); +end; + +procedure TcxSchedulerCustomResourceView.DoCustomDrawGroupSeparator( + AViewInfo: TcxSchedulerGroupSeparatorCellViewInfo; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawGroupSeparator) then + FOnCustomDrawGroupSeparator(Self, Canvas, AViewInfo, ADone); +end; + +procedure TcxSchedulerCustomResourceView.DoCustomDrawNavigationButton( + AViewInfo: TcxSchedulerContentNavigationButtonViewInfo; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawNavigationButton) then + FOnCustomDrawNavigationButton(Self, Canvas, AViewInfo, ADone); +end; + +procedure TcxSchedulerCustomResourceView.DoCustomDrawResourceHeader( + AViewInfo: TcxSchedulerHeaderCellViewInfo; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawResourceHeader) then + FOnCustomDrawResourceHeader(Self, Canvas, AViewInfo, ADone); +end; + +procedure TcxSchedulerCustomResourceView.DoLayoutChanged; +begin + inherited DoLayoutChanged; + if Active then + begin + if (ViewInfo.GroupingKind = gkNone) and (Scheduler.SelResource <> nil) then + with Controller.Navigation do + ReplaceSelParams(SelStart, SelFinish, nil) + else + if (ViewInfo.GroupingKind <> gkNone) and (Scheduler.SelResource = nil) then + with Controller.Navigation do + ReplaceSelParams(SelStart, SelFinish, VisibleResources[0]); + end; +end; + +procedure TcxSchedulerCustomResourceView.DoMouseDown(AButton: TMouseButton; AShift: TShiftState; X, Y: Integer); +begin + inherited DoMouseDown(AButton, AShift, X, Y); + if AButton = mbRight then + CheckSelectOnRightClick; +end; + +function TcxSchedulerCustomResourceView.DoShowPopupMenu(X, Y: Integer): Boolean; +var + ATime: TDateTime; + AResource: TcxSchedulerStorageResourceItem; + ASelectOnRightClick: Boolean; +begin + Result := False; + if HitTest.HitAtEvent then + Result := not Controller.IsEditing and Scheduler.EventPopupMenu.Popup(X, Y) + else + begin + ASelectOnRightClick := Scheduler.OptionsBehavior.SelectOnRightClick; + if not ASelectOnRightClick or + (IsRelevantSelection(ATime, AResource) and ASelectOnRightClick) then + Result := Scheduler.ContentPopupMenu.Popup(X, Y); + end; +end; + +function TcxSchedulerCustomResourceView.FindEventViewInfo(AEvent: TcxSchedulerEvent; + const ADate: TDateTime; AResource: TcxSchedulerStorageResourceItem; + var AViewInfo: TcxSchedulerEventCellViewInfo): Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to ViewInfo.EventCells.Count - 1 do + begin + AViewInfo := TcxSchedulerEventCellViewInfo(ViewInfo.EventCells[I]); + if AViewInfo.Event = AEvent then + begin + Result := True; + with AViewInfo do + begin + if (AResource = nil) or (ResourceItem = AResource) then + if (ADate = NullDate) or ((DateOf(ContentStart) = ADate) or (IsHeaderEvent and + (ADate >= DateOf(ContentStart)) and (ADate < DateOf(ContentFinish)))) then Break; + end; + end; + end; +end; + +function TcxSchedulerCustomResourceView.GetCommonViewItemsPainter: IcxSchedulerCommonViewItemsPainter; +var + ACustomPainter: IcxSchedulerCommonViewItemsPainter; +begin + if not Supports(TObject(Scheduler), IcxSchedulerCommonViewItemsPainter, ACustomPainter) then + ACustomPainter := nil; + InitializePainter; + ExternalPainter.Painter := LookAndFeelPainter; + ExternalPainter.CommonPainter := ACustomPainter; + Result := ExternalPainter; +end; + +function TcxSchedulerCustomResourceView.GetCompressWeekEnd: Boolean; +begin + Result := False; +end; + +function TcxSchedulerCustomResourceView.GetEditRectForEvent( + AEvent: TcxSchedulerControlEvent; const ADate: TDateTime; + AResource: TcxSchedulerStorageResourceItem): TRect; +var + AViewInfo: TcxSchedulerEventCellViewInfo; +begin + if FindEventViewInfo(AEvent, ADate, AResource, AViewInfo) then + Result := AViewInfo.EditingRect + else + Result := inherited GetEditRectForEvent(AEvent, ADate, AResource); +end; + +procedure TcxSchedulerCustomResourceView.InitScrollBarsParameters; +begin + ViewInfo.InitScrollBarsParameters; +end; + +function TcxSchedulerCustomResourceView.GetEventHintText(AEvent: TcxSchedulerControlEvent): string; +var + AViewInfo: TcxSchedulerEventCellViewInfo; +begin + if FindEventViewInfo(AEvent, NullDate, nil, AViewInfo) then + Result := AViewInfo.Hint + else + Result := inherited GetEventHintText(AEvent); +end; + +function TcxSchedulerCustomResourceView.GetEventVisibility( + AEvent: TcxSchedulerControlEvent): Boolean; +var + AViewInfo: TcxSchedulerEventCellViewInfo; +begin + Result := FindEventViewInfo(AEvent, NullDate, nil, AViewInfo) +end; + +function TcxSchedulerCustomResourceView.GetGroupingKind: TcxSchedulerGroupingKind; +begin + Result := GroupingKind; + if Result = gkDefault then + Result := OptionsView.GroupingKind; +end; + +function TcxSchedulerCustomResourceView.HasCustomDrawGroupSeparator: Boolean; +begin + Result := Assigned(FOnCustomDrawGroupSeparator) or + ExternalPainter.HasCustomDrawGroupSeparator; +end; +function TcxSchedulerCustomResourceView.HasCustomDrawResourceHeader: Boolean; +begin + Result := Assigned(FOnCustomDrawResourceHeader) or + ExternalPainter.HasCustomDrawResourceHeader; +end; + +function TcxSchedulerCustomResourceView.IsShowResources: Boolean; +var + AKind: TcxSchedulerGroupingKind; +begin + Result := inherited IsShowResources; + if Result then + begin + AKind := GroupingKind; + if AKind = gkDefault then + AKind := OptionsView.GroupingKind; + Result := AKind <> gkNone; + end; +end; + +procedure TcxSchedulerCustomResourceView.LookAndFeelChanged( + Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); +begin + ViewInfo.ImageCacheManager.Invalidate; +end; + +procedure TcxSchedulerCustomResourceView.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +begin + if AScrollBarKind = sbHorizontal then + ViewInfo.ScrollHorizontal(AScrollCode, AScrollPos) + else + ViewInfo.ScrollVertical(AScrollCode, AScrollPos); + inherited Scroll(AScrollBarKind, AScrollCode, AScrollPos); +end; + +procedure TcxSchedulerCustomResourceView.SetGroupingKind( + AValue: TcxSchedulerGroupingKind); +begin + CheckGroupingKind(AValue, AValue); + if (FGroupingKind <> AValue) then + begin + FGroupingKind := AValue; + LayoutChanged; + end; +end; + +procedure TcxSchedulerCustomResourceView.CheckSelectOnRightClick; +var + ATime: TDateTime; + AResource: TcxSchedulerStorageResourceItem; +begin + if Scheduler.OptionsBehavior.SelectOnRightClick and not IsRelevantSelection(ATime, AResource) then + begin + if AResource <> nil then + Scheduler.SelectTime(ATime, ATime, AResource) + else + Scheduler.SelectTime(ATime, ATime, Scheduler.SelResource) + end; +end; + +function TcxSchedulerCustomResourceView.GetViewInfo: TcxSchedulerCustomResourceViewViewInfo; +begin + Result := TcxSchedulerCustomResourceViewViewInfo(inherited ViewInfo); +end; + +function TcxSchedulerCustomResourceView.IsRelevantSelection(out ATime: TDateTime; out AResource: TcxSchedulerStorageResourceItem): Boolean; +begin + ATime := HitTest.Time; + if ATime < 1 then + ATime := ATime + DateOf(Scheduler.SelStart); + AResource := HitTest.Resource; + Result := ((ATime >= Scheduler.SelStart) and (ATime < Scheduler.SelFinish)) and + ((Scheduler.SelResource = AResource) or (AResource = nil)); +end; + +procedure TcxSchedulerCustomResourceView.SetEventImagesLayout( + const AValue: TcxSchedulerEventImagesLayout); +begin + if FEventImagesLayout <> AValue then + begin + FEventImagesLayout := AValue; + LayoutChanged; + end; +end; + +procedure TcxSchedulerCustomResourceView.SetShowEndTime( + const AValue: Boolean); +begin + if FShowEndTime <> AValue then + begin + FShowEndTime := AValue; + LayoutChanged; + end; +end; + +procedure TcxSchedulerCustomResourceView.SetShowTimeAsClock( + const AValue: Boolean); +begin + if FShowTimeAsClock <> AValue then + begin + FShowTimeAsClock := AValue; + LayoutChanged; + end; +end; + +{ TcxCustomResourceViewAdapter } + +constructor TcxCustomResourceViewAdapter.Create( + AView: TcxSchedulerCustomResourceView); +begin + FView := AView; +end; + +procedure TcxCustomResourceViewAdapter.Calculate; +var + FPrevAdapter: TcxCustomResourceViewAdapter; +begin + FPrevAdapter := FView.ViewInfo.SetAdapter(Self); + FPrevAdapter.Store; + try + BeforeCalculatePage; + FView.ViewInfo.Calculate; + AfterCalculatePage; + finally + FView.ViewInfo.SetAdapter(FPrevAdapter); + if (FPrevAdapter <> Self) and FView.Active then + begin + FPrevAdapter.Restore; + FView.ViewInfo.Calculate; + end; + FView.ViewInfo.FStylesAdapter := nil; + end; +end; + +procedure TcxCustomResourceViewAdapter.GetPageResources( + AResources: TcxObjectList); +var + ACount, I: Integer; + AResourceViewInfo: TcxSchedulerResourceViewInfo; +begin + if Resources = nil then Exit; + Scheduler.ValidateFirstVisibleResourceIndex; + ACount := Resources.VisibleResourceCount; + with Scheduler.OptionsView do + begin + if (ResourcesPerPage > 0) and (ACount > ResourcesPerPage) then + ACount := ResourcesPerPage; + end; + for I := 0 to ACount - 1 do + begin + AResourceViewInfo := TcxSchedulerResourceViewInfo.Create( + Resources.VisibleResources[Scheduler.FirstVisibleResourceIndex + I]); + AResources.Add(AResourceViewInfo); + end; +end; + +procedure TcxCustomResourceViewAdapter.GetPageDays( + APageIndex: Integer; ADays: TcxSchedulerDateList); +begin +end; + +procedure TcxCustomResourceViewAdapter.Invalidate; +begin +end; + +function TcxCustomResourceViewAdapter.CanCalculate: Boolean; +begin + Result := View.Active; +end; + +function TcxCustomResourceViewAdapter.GetActualStart: TDateTime; +begin + Result := PrintFrom; +end; + +function TcxCustomResourceViewAdapter.GetActualFinish: TDateTime; +begin + Result := PrintTo; +end; + +function TcxCustomResourceViewAdapter.GetCompressWeekends: Boolean; +begin + Result := View.GetCompressWeekEnd; +end; + +function TcxCustomResourceViewAdapter.GetDontPrintFreeTime: Boolean; +begin + Result := False; +end; + +function TcxCustomResourceViewAdapter.GetDontPrintWeekEnds: Boolean; +begin + Result := False; +end; + +function TcxCustomResourceViewAdapter.GetHideSelection: Boolean; +begin + Result := View.OptionsView.HideSelection and not View.Scheduler.IsFocused; +end; + +function TcxCustomResourceViewAdapter.GetIsPrinting: Boolean; +begin + Result := False; +end; + +function TcxCustomResourceViewAdapter.GetPageBounds: TRect; +begin + Result := View.ClientRect; +end; + +function TcxCustomResourceViewAdapter.GetPagesPerWeek: Byte; +begin + Result := 1; +end; + +function TcxCustomResourceViewAdapter.GetPrimaryPage: Boolean; +begin + Result := True; +end; + +function TcxCustomResourceViewAdapter.GetPrintExactlyOneMonth: Boolean; +begin + Result := False; +end; + +function TcxCustomResourceViewAdapter.GetPrintRange( + Index: Integer): TDateTime; +begin + Result := NullDate; +end; + +function TcxCustomResourceViewAdapter.GetStylesAdapter: IcxSchedulerStylesAdapter; +begin + Result := FView.Styles; +end; + +function TcxCustomResourceViewAdapter.GetView: TcxSchedulerCustomResourceView; +begin + Result := FView; +end; + +procedure TcxCustomResourceViewAdapter.AfterCalculatePage; +begin +end; + +procedure TcxCustomResourceViewAdapter.BeforeCalculatePage; +begin +end; + +procedure TcxCustomResourceViewAdapter.DoInitialize( + var ASelectedDays: TcxSchedulerDateList; var AEvents: TcxSchedulerCachedEventList); +begin + ASelectedDays := View.Scheduler.SelectedDays; + AEvents := ViewInfo.GetSchedulerEventsList; +end; + +function TcxCustomResourceViewAdapter.GetPageHeaderText: string; +begin + Result := ViewInfo.GetPageHeaderText; +end; + +procedure TcxCustomResourceViewAdapter.Store; +begin +end; + +procedure TcxCustomResourceViewAdapter.Restore; +begin +end; + +function TcxCustomResourceViewAdapter.GetCells: TcxObjectList; +begin + Result := ViewInfo.FCells; +end; + +function TcxCustomResourceViewAdapter.GetContentLineHeight: Integer; +var + AEventHeight, AIconHeight: Integer; + AImages: TCustomImageList; +begin + with View do + begin + AEventHeight := OptionsView.EventHeight; + AImages := Scheduler.EventImages; + end; + with ViewInfo do + begin + Result := GetFontHeight(StylesAdapter.GetEventParams(nil)) + 2 * cxTextOffset; + if AEventHeight = 0 then + begin + if AImages <> nil then + AIconHeight := Max(PainterHelper.IconsHeight, AImages.Height) + else + AIconHeight := PainterHelper.IconsHeight; + Result := Max(AIconHeight + cxTextOffset + 2 * cxEventImagesOffset, Result); + end + else + Result := Max(AEventHeight, Result); + end; +end; + +function TcxCustomResourceViewAdapter.GetPainterHelper: TcxSchedulerPainterHelperClass; +begin + Result := TcxSchedulerHelpersFactory.PainterHelperClass; +end; + +function TcxCustomResourceViewAdapter.GetResourceNavigator: TcxSchedulerResourceNavigator; +begin + Result := View.Scheduler.ResourceNavigator; +end; + +function TcxCustomResourceViewAdapter.GetResources: TcxSchedulerStorageResourceItems; +begin + Result := View.Resources; +end; + +function TcxCustomResourceViewAdapter.GetScheduler: TcxCustomScheduler; +begin + Result := View.Scheduler; +end; + +function TcxCustomResourceViewAdapter.GetViewInfo: TcxSchedulerCustomResourceViewViewInfo; +begin + Result := View.ViewInfo; +end; + +{ TcxSchedulerEventImageItem } + +constructor TcxSchedulerEventImageItem.Create(Collection: TCollection); +begin + inherited Create(Collection); + FAutoHide := True; + FImageIndex := -1; + FVisible := True; +end; + +function TcxSchedulerEventImageItem.GetHeight: Integer; +begin + Result := Images.Height; +end; + +function TcxSchedulerEventImageItem.GetWidth: Integer; +begin + Result := Images.Width; +end; + +{ TcxSchedulerEventImages } + +constructor TcxSchedulerEventImages.Create( + ALayout: TcxSchedulerEventImagesLayout); +begin + inherited Create(TcxSchedulerEventImageItem); + FLayout := ALayout; + FItemHeight := EventImages.Height; + FItemWidth := EventImages.Width; +end; + +function TcxSchedulerEventImages.Add(AImageIndex: Integer; + AutoHide: Boolean = True): TcxSchedulerEventImageItem; +begin + if (FImages = nil) or ((AImageIndex < 0) or (AImageIndex >= FImages.Count)) then + begin + Result := nil; + Exit; + end; + Result := TcxSchedulerEventImageItem(inherited Add); + Result.FImageIndex := AImageIndex; + Result.AutoHide := AutoHide; + Result.FImageType := eitCustom; + Result.FImages := FImages; +end; + +function TcxSchedulerEventImages.AddStandardImage( + AImageType: TcxSchedulerEventImageType; + AutoHide: Boolean = True): TcxSchedulerEventImageItem; +const + Indexes: array[TcxSchedulerEventImageType] of TImageIndex = (4, 2, 3, -1); +begin + Result := TcxSchedulerEventImageItem(inherited Add); + Result.AutoHide := AutoHide; + Result.FImageType := AImageType; + Result.FImages := EventImages; + Result.FImageIndex := Indexes[AImageType]; +end; + +function TcxSchedulerEventImages.Calculate(const R: TRect): Integer; +begin + case FLayout of + eilAuto: Result := CalculateImages(R); + eilHorizontal: Result := CalculateSingleLineImages(R); + else + Result := CalculateSingleColumnImages(R); + end; +end; + +procedure TcxSchedulerEventImages.CalculateForCols(AVisibleImages: TList; + const ATopLeft: TPoint; AColCount: Integer); +var + ARow, ACol, AIndex: Integer; +begin + AIndex := 0; + ACol := 0; + ARow := 0; + while AIndex < TotalVisibleImageCount do + begin + SetItemBounds(TcxSchedulerEventImageItem(AVisibleImages[AIndex]), + ATopLeft.X + ACol * (ItemWidth + cxEventImagesGap), + ATopLeft.Y + ARow * (ItemHeight + cxEventImagesGap)); + if ACol = AColCount - 1 then + begin + ACol := 0; + Inc(ARow); + end + else Inc(ACol); + Inc(AIndex); + end; +end; + +function TcxSchedulerEventImages.CalculateImages(const R: TRect): Integer; +var + I, AWidth, AHeight, ACount, ARows, AColIndex, + ARowIndex: Integer; + L: TList; + RS: TSize; + + procedure CheckAutoHideItems; + var + I: Integer; + AItem: TcxSchedulerEventImageItem; + begin + if ACount >= L.Count then Exit; + for I := L.Count - 1 downto 0 do + begin + AItem := TcxSchedulerEventImageItem(L[I]); + if AItem.AutoHide then + begin + AItem.FHidden := True; + L.Delete(I); + if ACount >= L.Count then break; + end; + end; + end; + +begin + AHeight := ItemHeight + cxEventImagesGap; + RS := cxRectSize(R); + ARows := Max(1, RS.cy div AHeight); + if ARows = 1 then + begin + Result := CalculateSingleLineImages(R); + Exit; + end; + Result := 0; + L := CreateVisibleList; + try + if L.Count = 0 then Exit; + AWidth := ItemWidth + cxEventImagesGap; + ACount := Max(1, RS.cx div AWidth) * ARows; + CheckAutoHideItems; + AColIndex := 0; + ARowIndex := 0; + for I := 0 to L.Count - 1 do + begin + SetItemBounds(TcxSchedulerEventImageItem(L[I]), + R.Left + AColIndex * AWidth, + R.Top + ARowIndex * AHeight); + Result := Max(Result, (AColIndex + 1) * AWidth); + Inc(ARowIndex); + if ARowIndex = ARows then + begin + Inc(AColIndex); + ARowIndex := 0; + end; + end; + FVisibleImageCount := L.Count; + finally + L.Free; + end; +end; + +function TcxSchedulerEventImages.CalculateSingleLineImages(const R: TRect; ARightLimit: Integer = 0): Integer; +var + I, ALeft, AImageWidth, ATotalWidth, ARectWidth: Integer; + L: TList; + AItem: TcxSchedulerEventImageItem; + + procedure CheckAutoHideItems; + var + I: Integer; + AItem: TcxSchedulerEventImageItem; + begin + if ARectWidth >= ATotalWidth then Exit; + if ARightLimit > 0 then + ARectWidth := Min(ARightLimit, Max(ARectWidth, ForceVisibleWidth)); + for I := L.Count - 1 downto 0 do + begin + AItem := TcxSchedulerEventImageItem(L.List^[I]); + if AItem.AutoHide then + begin + AItem.FHidden := True; + Dec(ATotalWidth, AImageWidth); + L.Delete(I); + if ARectWidth >= ATotalWidth then break; + end; + end; + end; + +begin + Result := 0; + L := CreateVisibleList; + try + if L.Count = 0 then Exit; + ATotalWidth := TotalVisibleWidth; + ARectWidth := R.Right - R.Left; + AImageWidth := ItemWidth + cxEventImagesGap; + CheckAutoHideItems; + ALeft := R.Left; + for I := 0 to L.Count - 1 do + begin + AItem := TcxSchedulerEventImageItem(L.List^[I]); + SetItemBounds(AItem, ALeft, R.Top); + Inc(ALeft, AImageWidth); + Inc(Result, AImageWidth); + end; + FVisibleImageCount := L.Count; + finally + L.Free; + end; +end; + +function TcxSchedulerEventImages.CalculateSingleColumnImages(const R: TRect): Integer; +var + I, ATop, AWidth, AHeight, ATotalHeight: Integer; + RS: TSize; + L: TList; + + procedure CheckAutoHideItems; + var + I: Integer; + AItem: TcxSchedulerEventImageItem; + begin + if RS.cy + cxEventImagesGap >= ATotalHeight then Exit; + for I := L.Count - 1 downto 0 do + begin + AItem := TcxSchedulerEventImageItem(L.List^[I]); + if AItem.AutoHide then + begin + AItem.FHidden := True; + Dec(ATotalHeight, AHeight); + L.Delete(I); + if RS.cy + cxEventImagesGap >= ATotalHeight then break; + end; + end; + end; + + function CanAutoHideAllItems: Boolean; + var + I: Integer; + begin + Result := True; + for I := 0 to L.Count - 1 do + if not TcxSchedulerEventImageItem(L.List^[I]).AutoHide then + begin + Result := False; + break; + end; + end; + +begin + Result := 0; + L := CreateVisibleList; + try + if L.Count = 0 then Exit; + ATotalHeight := TotalVisibleHeight; + RS := cxRectSize(R); + AWidth := ItemWidth + cxEventImagesGap; + if (RS.cx < AWidth) and CanAutoHideAllItems then Exit; + AHeight := ItemHeight + cxEventImagesGap; + CheckAutoHideItems; + if L.Count = 0 then Exit; + Result := AWidth; + ATop := R.Top; + for I := 0 to L.Count - 1 do + begin + SetItemBounds(TcxSchedulerEventImageItem(L.List^[I]), R.Left, ATop); + Inc(ATop, AHeight); + end; + FVisibleImageCount := L.Count; + finally + L.Free; + end; +end; + +function TcxSchedulerEventImages.CreateVisibleList: TList; +var + I: Integer; + AItem: TcxSchedulerEventImageItem; +begin + FVisibleImageCount := 0; + FForceVisibleHeight := 0; + FForceVisibleWidth := 0; + FTotalVisibleImageCount := 0; + Result := TList.Create; + for I := 0 to Count - 1 do + begin + AItem := Items[I]; + if AItem.Visible then + begin + Inc(FTotalVisibleImageCount); + if not AItem.AutoHide then + begin + Inc(FForceVisibleHeight, ItemHeight + cxEventImagesGap); + Inc(FForceVisibleWidth, ItemWidth + cxEventImagesGap); + end; + AItem.FHidden := False; + Result.Add(AItem); + end + else AItem.FHidden := True; + end; + FTotalVisibleWidth := (ItemWidth + cxEventImagesGap) * Result.Count; + FTotalVisibleHeight := (ItemHeight + cxEventImagesGap) * Result.Count; +end; + +procedure TcxSchedulerEventImages.Init(AImages: TCustomImageList); +begin + FVisibleImageCount := 0; + FImages := AImages; + if (FImages <> nil) then + begin + if FImages.Height > FItemHeight then FItemHeight := FImages.Height; + if FImages.Width > FItemWidth then FItemWidth := FImages.Width; + end; +end; + +function TcxSchedulerEventImages.Offset(ADeltaX, ADeltaY: Integer): Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + with Items[I] do + begin + if not FHidden then + begin + FBounds := cxRectOffset(FBounds, ADeltaX, ADeltaY); + Inc(Result, ItemWidth + cxEventImagesGap); + end; + end; +end; + +procedure TcxSchedulerEventImages.SetItemBounds( + AItem: TcxSchedulerEventImageItem; ALeft, ATop: Integer); +begin + Inc(ALeft, Max(0, (ItemWidth - AItem.Width) div 2)); + Inc(ATop, Max(0, (ItemHeight - AItem.Height) div 2)); + AItem.FBounds := cxRectBounds(ALeft, ATop, AItem.Width, AItem.Height); +end; + +function TcxSchedulerEventImages.GetImageItem( + AIndex: Integer): TcxSchedulerEventImageItem; +begin + Result := TcxSchedulerEventImageItem(inherited Items[AIndex]); +end; + +{ TcxSchedulerCachedImage } + +constructor TcxSchedulerCachedImage.Create; +begin + inherited; + FImage := TcxBitmap.Create; +end; + +destructor TcxSchedulerCachedImage.Destroy; +begin + FreeAndNil(FImage); + inherited Destroy; +end; + +procedure TcxSchedulerCachedImage.Invalidate; +begin + Image.SetSize(0, 0); +end; + +function TcxSchedulerCachedImage.IsValid(AItem: TcxSchedulerCustomViewInfoItem): Boolean; +begin + Result := (Image.Width = AItem.Width) and (Image.Height = AItem.Height); +end; + +procedure TcxSchedulerCachedImage.Update(AItem: TcxSchedulerCustomViewInfoItem); +begin + if not cxRectIsEmpty(AItem.Bounds) then + begin + Image.SetSize(AItem.Width, AItem.Height); + Image.cxCanvas.Canvas.Lock; + end; +end; + +{ TcxSchedulerResourceHeaderCachedImage } + +function TcxSchedulerResourceHeaderCachedImage.IsValid(AItem: TcxSchedulerCustomViewInfoItem): Boolean; +begin + Result := inherited IsValid(AItem); + if Result then + begin + Result := (TcxSchedulerHeaderCellViewInfo(AItem).DisplayText = FDisplayText) and + (TcxSchedulerHeaderCellViewInfo(AItem).DateTime = FDateTime); + end; +end; + +procedure TcxSchedulerResourceHeaderCachedImage.Update(AItem: TcxSchedulerCustomViewInfoItem); +begin + inherited Update(AItem); + FDisplayText := TcxSchedulerHeaderCellViewInfo(AItem).DisplayText; + FDateTime := TcxSchedulerHeaderCellViewInfo(AItem).DateTime; +end; + +{ TcxSchedulerResourceHeaderCachedImageList } + +function TcxSchedulerResourceHeaderCachedImageList.Add(AItem: TcxSchedulerHeaderCellViewInfo): TcxSchedulerResourceHeaderCachedImage; +begin + Result := TcxSchedulerResourceHeaderCachedImage.Create; + if AItem.Resource <> nil then + Result.FResourceItem := AItem.Resource.ResourceItem; + inherited Add(Result); +end; + +function TcxSchedulerResourceHeaderCachedImageList.GetCacheForItem( + AItem: TcxSchedulerHeaderCellViewInfo): TcxSchedulerResourceHeaderCachedImage; + + function GetResourceItem(AItem: TcxSchedulerHeaderCellViewInfo): TcxSchedulerStorageResourceItem; + begin + if AItem.Resource = nil then + Result := nil + else + Result := AItem.Resource.ResourceItem; + end; + +var + I: Integer; + ACachedItem: TcxSchedulerResourceHeaderCachedImage; +begin + Result := nil; + for I := 0 to Count - 1 do + begin + ACachedItem := TcxSchedulerResourceHeaderCachedImage(Items[I]); + if ACachedItem.FResourceItem = GetResourceItem(AItem) then + begin + Result := ACachedItem; + Break; + end; + end; + if Result = nil then + Result := Add(AItem); +end; + +{ TcxSchedulerImageCacheManager } + +constructor TcxSchedulerImageCacheManager.Create; +begin + FResourceHeaders := TcxSchedulerResourceHeaderCachedImageList.Create; + FSeparator := TcxSchedulerCachedImage.Create; +end; + +destructor TcxSchedulerImageCacheManager.Destroy; +begin + FResourceHeaders.Free; + FSeparator.Free; + inherited Destroy; +end; + +procedure TcxSchedulerImageCacheManager.Invalidate; +begin + ResourceHeaders.Clear; + Separator.Invalidate; +end; + +{ TcxSchedulerCustomResourceViewViewInfo } + +constructor TcxSchedulerCustomResourceViewViewInfo.Create( + AOwner: TcxSchedulerSubControl); +begin + inherited Create(AOwner); + FCells := TcxObjectList.Create; + FResources := TcxObjectList.Create; + FGroupSeparatorCells := TcxSchedulerViewInfoCellList.Create; + FButtons := TcxSchedulerViewInfoCellList.Create; + FNavigationButtons := TcxSchedulerViewInfoCellList.Create; + FContentCells := TcxSchedulerViewInfoCellList.Create; + FEventCells := TcxSchedulerViewInfoCellList.Create; + FDayHeaderCells := TcxSchedulerViewInfoCellList.Create; + FResourceHeaderCells := TcxSchedulerViewInfoCellList.Create; + FHeaderContainerCells := TcxSchedulerViewInfoCellList.Create; + FCells.Add(FEventCells); + FCells.Add(FGroupSeparatorCells); + FCells.Add(FDayHeaderCells); + FCells.Add(FResourceHeaderCells); + FCells.Add(FContentCells); + FCells.Add(FHeaderContainerCells); + // cache + FImageCacheManager := CreateImageCacheManager; +end; + +destructor TcxSchedulerCustomResourceViewViewInfo.Destroy; +begin + FreeAndNil(FImageCacheManager); + FEventImages := nil; + FResources.Free; + FButtons.Free; + FNavigationButtons.Free; + FCells.Free; + FreeAndNil(FContentNavigationIntervals); + inherited Destroy; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.Calculate; +begin + if ScreenCanvas = nil then + ScreenCanvas := TcxScreenCanvas.Create; + try + Supports(TObject(View.Scheduler), IcxSchedulerEventImages, FEventImages); + FPrimaryPage := Adapter.GetPrimaryPage; + Adapter.DoInitialize(FSelectedDays, FEvents); + FHasVisibleBounds := GetHasVisibleBounds; + FPrintWeekEnds := not Adapter.DontPrintWeekEnd; + FPagesPerWeek := Adapter.PagesPerWeek; + FPageBounds := Adapter.GetPageBounds; + FCanSelected := not Adapter.GetHideSelection; + inherited Calculate; + finally + FreeAndNil(ScreenCanvas); + end; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.CalculateHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + FEventCells.CalculateHitTest(AHitTest); + if not FNavigationButtons.CalculateHitTest(AHitTest) then + if not FDayHeaderCells.CalculateHitTest(AHitTest) then + if not FResourceHeaderCells.CalculateHitTest(AHitTest) then + if not FHeaderContainerCells.CalculateHitTest(AHitTest) then + if not FButtons.CalculateHitTest(AHitTest) then + if not FContentCells.CalculateHitTest(AHitTest) then + FGroupSeparatorCells.CalculateHitTest(AHitTest); + if AHitTest.HitAtButton and AHitTest.HitAtEvent then + begin + AHitTest.FHitObject := nil; + AHitTest.FEventCell := nil; + end; + HotTrackNavigationButtons(AHitTest); +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.InitScrollBarsParameters; +begin + CheckResourceNavigator; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.ScrollHorizontal( + AScrollCode: TScrollCode; var AScrollPos: Integer); +begin +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.ScrollVertical( + AScrollCode: TScrollCode; var AScrollPos: Integer); +begin +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.SetEventsVisibility( + AShowSources, AShowClones: Boolean; AForceRepaint: Boolean = False); +var + ARepaint: Boolean; +begin + ARepaint := AForceRepaint or (FHideSource <> not AShowSources) or + (FHideClones <> not AShowClones); + FHideSource := not AShowSources; + FHideClones := not AShowClones; + if ARepaint then View.Refresh; +end; + +function TcxSchedulerCustomResourceViewViewInfo.AddButton( + ABounds: TRect; const ADateTime: TDateTime; + AIsDown: Boolean; AEvent: TcxSchedulerEvent): TcxSchedulerMoreEventsButtonViewInfo; +var + AMoreButtonSize: TSize; +begin + ABounds := cxRectInflate(ABounds, -cxTextOffset, -cxTextOffset); + AMoreButtonSize := View.ExternalPainter.MoreButtonSize( + Size(PainterHelper.MoreButtonWidth, PainterHelper.MoreButtonHeight)); + + ABounds.Left := ABounds.Right - AMoreButtonSize.cx; + if AIsDown then + ABounds.Top := ABounds.Bottom - AMoreButtonSize.cy + else + ABounds.Bottom := ABounds.Top + AMoreButtonSize.cy; + if DateOf(ADateTime) = 0 then + CreateCellInstance(GetMoreEventButtonClass, ABounds, + Styles.GetBackgroundParams, Result) + else + CreateCellInstance(GetMoreEventButtonClass, ABounds, + GetContentParams(ADateTime, nil), Result); + Result.FIsDown := AIsDown; + Result.FDateTime := ADateTime; + Result.FOnClick := OnMoreEventsButtonClick; + Result.Event := AEvent; + FButtons.Add(Result); +end; + +function TcxSchedulerCustomResourceViewViewInfo.AddBackgroundSlot(const ABounds: TRect; + ABorders: TcxBorders; const AText: string = ''): TcxSchedulerBackgroundSlotCellViewInfo; +begin + CreateCellInstance(TcxSchedulerBackgroundSlotCellViewInfo, ABounds, + Styles.GetBackgroundParams, Result); + Result.FBorders := ABorders; + AssignResourceID(Result, -1); + ContentCells.Add(Result); +end; + +function TcxSchedulerCustomResourceViewViewInfo.AddContentCell(const ARect: TRect; + const AStart, AFinish: TDateTime; AResourceIndex: Integer): TcxSchedulerContentCellViewInfo; +begin + CreateCellInstance(ContentCellClass, ARect, + GetContentParams(AStart, Resources[AResourceIndex]), Result); + Result.SetTime(AStart, AFinish); + AssignResourceID(Result, AResourceIndex); + ContentCells.Add(Result); +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.AddContentNavigationButton( + const AColumnRect: TRect; AResourceIndex: Integer; + AColumnPositionInResource: TcxSchedulerColumnPositionInResource); + + procedure AddAppointedButton(AKind: TcxSchedulerContentNavigationButtonKind); + const + AButtonTexts: array[TcxSchedulerContentNavigationButtonKind] of pointer = + (@scxPrevAppointment, @scxNextAppointment); + var + AButton: TcxSchedulerContentNavigationButtonViewInfo; + AWidth, AButtonOffset: Integer; + begin + CalculateNavigationButtonParams(AColumnRect, AKind, AWidth); + + AButtonOffset := NavigationButtonOffset(AKind, AResourceIndex); + OffsetRect(FButtonBounds, AButtonOffset, 0); + CreateCellInstance(TcxSchedulerContentNavigationButtonViewInfo, FButtonBounds, + Styles.GetBackgroundParams, AButton); + AButton.FOnClick := OnContentNavigationButtonClick; + AssignResourceID(AButton, AResourceIndex); + AButton.FKind := AKind; + OffsetRect(FButtonTextRect, AButtonOffset, 0); + AButton.FTextRect := FButtonTextRect; + OffsetRect(FButtonArrowRect, AButtonOffset, 0); + AButton.FArrowRect := FButtonArrowRect; + AButton.Caption := cxGetResourceString(AButtonTexts[AKind]); + FNavigationButtons.Add(AButton); + AddContentNavigationIntervalItem(AResourceIndex); + end; + +var + AColumnHeight: Integer; +begin + if Adapter.IsPrinting then Exit; + + AColumnHeight := GetCorrectColumnHeight(AColumnRect); + if Scheduler.OptionsView.ShowNavigationButtons and + not AreThereEventsInVisibleInterval(AResourceIndex) and + (AColumnPositionInResource <> cprIndefinite) and + (AColumnHeight > ContentNavigationButtonReducedHeight) then + begin + case AColumnPositionInResource of + cprFirst: AddAppointedButton(nbkPrevious); + cprLast: AddAppointedButton(nbkNext); + cprSingle: + begin + AddAppointedButton(nbkPrevious); + AddAppointedButton(nbkNext); + end; + end; + end; +end; + +function TcxSchedulerCustomResourceViewViewInfo.AddDayHeader( + const ADate: TDateTime; const ABounds: TRect; + AResourceIndex: Integer): TcxSchedulerDayHeaderCellViewInfo; +begin + CreateCellInstance(TcxSchedulerDayHeaderCellViewInfo, ABounds, + StylesAdapter.GetDayHeaderParams(ADate), Result); + Result.DateTime := ADate; + AssignResourceID(Result, AResourceIndex); + FDayHeaderCells.Add(Result); +end; + +function TcxSchedulerCustomResourceViewViewInfo.AddDayHeader( + const ADate: TDateTime; ATop, ALeft, ARight: Integer; + AResourceIndex: Integer): TcxSchedulerDayHeaderCellViewInfo; +begin + Result := AddDayHeader(ADate, + cxRect(ALeft, ATop, ARight, ATop + FDayHeaderHeight), AResourceIndex); +end; + +function TcxSchedulerCustomResourceViewViewInfo.AddEventCell( + AViewData: TcxSchedulerEventViewData; + AImmediateCalculate: Boolean = True): TcxSchedulerEventCellViewInfo; +begin + Result := CreateEventCellViewInfo(AViewData); + if (FEventImages <> nil) and FEventImages.SupportEventImages then + begin + Result.Images.Init(FEventImages.GetImages); + FEventImages.DoInitEventImages(AViewData.Event, Result.Images); + end; + if AImmediateCalculate then Result.Calculate; + EventCells.Add(Result); + SetResourceHasVisibleEvent(AViewData.Event); +end; + +function TcxSchedulerCustomResourceViewViewInfo.AddGroupHorzSeparator( + APos: Integer): TcxSchedulerGroupSeparatorCellViewInfo; +begin + Result := AddGroupSeparator(cxRectSetTop(Bounds, APos, SeparatorWidth)); + if Result <> nil then + Result.Rotated := True; + if CanCacheGroupSeparator(Result) then + Result.Cache := ImageCacheManager.Separator; +end; + +function TcxSchedulerCustomResourceViewViewInfo.AddGroupSeparator( + const ABounds: TRect): TcxSchedulerGroupSeparatorCellViewInfo; +begin + Result := nil; + if not HasSeparator then Exit; + CreateCellInstance(TcxSchedulerGroupSeparatorCellViewInfo, ABounds, + FGroupSeparatorParams, Result); + GroupSeparatorCells.Add(Result); +end; + +function TcxSchedulerCustomResourceViewViewInfo.AddGroupVertSeparator( + APos: Integer): TcxSchedulerGroupSeparatorCellViewInfo; +begin + Result := AddGroupSeparator(cxRectSetLeft(Bounds, APos, SeparatorWidth)); +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.AddResourceBounds( + AResourceIndex: Integer; const ABounds: TRect); +begin + if Length(FResourceBounds) <> ResourceCount then + SetLength(FResourceBounds, ResourceCount); + FResourceBounds[AResourceIndex] := ABounds; +end; + +function TcxSchedulerCustomResourceViewViewInfo.AddResourceHeader( + const AIndex: Integer; const ABounds: TRect): TcxSchedulerHeaderCellViewInfo; +begin + CreateCellInstance(TcxSchedulerHeaderCellViewInfo, ABounds, + StylesAdapter.GetResourceHeaderParams(GetResourceItemByIndex(AIndex)), Result); + if AIndex >= 0 then + begin + Result.FDisplayText := ResourceCaptions[AIndex]; + AssignResourceID(Result, AIndex); + with Resources[AIndex] do + begin + Result.FAutoHeight := ResourceHeaders.MultilineCaptions; + Result.FImageIndex := ImageIndex; + Result.FImagePosition := ImagePosition; + Result.FImages := Images; + end; + end; + ResourceHeaderCells.Add(Result); + Result.FIsResourceHeader := True; + if CanCacheResourceHeader(Result) then + Result.Cache := ImageCacheManager.ResourceHeaders.GetCacheForItem(Result); +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.AfterCalculate; +begin + inherited AfterCalculate; + if FHideClones then + HideCloneEventsOnDragDrop; + if FHideSource then + HideSourceEventsOnDragDrop; + SetContentNavigationButtonsIntervals; +end; + +function TcxSchedulerCustomResourceViewViewInfo.AreThereEventsInVisibleInterval( + AResourceIndex: Integer): Boolean; +var + AResourceID: Variant; +begin + Result := (((GetGroupingKind = gkNone) or (AResourceIndex < 0)) + and (HasVisibleEvents or (GetMoreEventsButtonCount(-1) <> 0))) or + ((GetGroupingKind <> gkNone) and (AResourceIndex >= 0) and + ((GetEventForResourceCount(AResourceIndex, AResourceID) <> 0) or + (GetEventWithoutResourceCount <> 0))); +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.AssignResourceID( + ACell: TcxSchedulerCustomResourceViewInfoItem; AIndex: Integer); +begin + if AIndex >= 0 then + ACell.Resource := Resources[AIndex]; + ACell.FIsResourceAssigned := AIndex >= 0; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.CalculateContentNavigationButtons; +var + AResourceIndex: Integer; +begin + if IsDrawButtons then + begin + if ResourceCount > 0 then + for AResourceIndex := 0 to ResourceCount - 1 do + AddContentNavigationButton(FResourceBounds[AResourceIndex], AResourceIndex, + cprSingle) + else + AddContentNavigationButton(Bounds, -1, cprSingle); + end; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.CalculateMetrics; +begin + FHideSelection := View.OptionsView.HideSelection and not View.Scheduler.IsFocused; + FGroupSeparatorParams := Styles.GetGroupSeparatorParams; + FTimeLineParams := GetTimeLineParams; + FSelectionParams := Styles.GetSelectionParams; + FContentLineHeight := Adapter.GetContentLineHeight; + FContentFontHeight := cxTextHeight(StylesAdapter.GetContentParams(Now, nil).Font) + cxTextOffset * 2; + FDayHeaderHeight := + LookAndFeelPainter.HeaderHeight(GetFontHeight(StylesAdapter.GetDayHeaderStyle)); + FResourceHeaderHeight := + LookAndFeelPainter.HeaderHeight(GetFontHeight(StylesAdapter.GetResourceHeaderStyle)); + FUseResourceImages := HasStorage and View.Scheduler.Storage.Resources.AreImagesUsed; + if HasStorage then + FResourceImages := View.Scheduler.Storage.Resources.Images + else + FResourceImages := nil; + if HasStorage then + begin + if ResourceHeaders.Height <> 0 then + FResourceHeaderHeight := ResourceHeaders.Height; + CalculateResourceHeadersAutoHeight(GetResourceHeaderWidth - cxTextOffset * 3); + if ResourceHeaders.Height <> 0 then + FResourceHeaderHeight := ResourceHeaders.Height; + end; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.CalculateNavigationButtonParams( + AColumnRect: TRect; AKind: TcxSchedulerContentNavigationButtonKind; + out AButtonWidth: Integer); +var + AHeight, AMiddle: Integer; + AIsCollapsed: Boolean; +begin + AIsCollapsed := Round(ContentNavigationButtonHeight * 1.5) >= + GetCorrectColumnHeight(AColumnRect); + if AIsCollapsed then + AHeight := ContentNavigationButtonReducedHeight + else + AHeight := ContentNavigationButtonHeight; + + AMiddle := (AColumnRect.Top + AColumnRect.Bottom) div 2; + case AKind of + nbkPrevious: FButtonBounds := Rect(AColumnRect.Left, AMiddle - AHeight div 2, + AColumnRect.Left + ContentNavigationButtonWidth, AMiddle + AHeight div 2); + nbkNext: FButtonBounds := Rect(AColumnRect.Right - ContentNavigationButtonWidth, + AMiddle - AHeight div 2, AColumnRect.Right, AMiddle + AHeight div 2); + else + FButtonBounds := cxNullRect; + end; + + with View.Canvas do + LookAndFeelPainter.CalculateSchedulerNavigationButtonRects( + AKind = nbkNext, AIsCollapsed, TextExtent(scxPrevAppointment), + TextExtent(scxNextAppointment), FButtonBounds, FButtonTextRect, + FButtonArrowRect); + AButtonWidth := FButtonBounds.Right - FButtonBounds.Left; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.CalculateResourceHeadersAutoHeight( + AWidth: Integer); + + function CalculateResourceHeight(AResource: TcxSchedulerStorageResourceItem; + AWidth: Integer): Integer; + var + R: TRect; + AFont: TFont; + AText: string; + AHasImage: Boolean; + begin + AFont := Styles.GetResourceHeaderParams(AResource).Font; + AHasImage := UseResourceImages and (AResource.ActualImageIndex >= 0); + if AHasImage and (ResourceHeaders.ImagePosition in [ipLeft, ipRight]) then + AWidth := Max(0, AWidth - (GetResourceImagesSize.cx + cxTextOffset * 2)); + R := Rect(0, 0, Max(AWidth, 2), 0); + AText := AResource.Resources.GetResourceName(AResource); + ScreenCanvas.Font.Assign(AFont); + ScreenCanvas.TextExtent(AText, R, + MakeTextOutcxFlags(taLeftJustify, vaCenter, ResourceHeaders.MultilineCaptions)); + Result := R.Bottom - R.Top + cxTextOffset * 3; + SetResourceTextRect(AResource, R); + if AHasImage then + begin + if (ResourceHeaders.ImagePosition in [ipTop, ipBottom]) then + Inc(Result, GetResourceImagesSize.cy + cxTextOffset * 4) + else + Result := Max(Result, GetResourceImagesSize.cy + cxTextOffset * 3); + end; + end; + +var + I: Integer; +begin + AWidth := Max(0, AWidth); + for I := 0 to Adapter.Resources.VisibleResourceCount - 1 do + FResourceHeaderHeight := Max(FResourceHeaderHeight, CalculateResourceHeight( + Adapter.Resources.VisibleResources[I], AWidth)); +end; + +function TcxSchedulerCustomResourceViewViewInfo.CalculateResourceHeaderWidth: Integer; +var + I: Integer; + AWidth: Integer; + + function CalculateWidth(AResource: TcxSchedulerStorageResourceItem): Integer; + var + R: TRect; + AText: string; + AHasImage: Boolean; + AViewParams: TcxViewParams; + begin + AViewParams := StylesAdapter.GetResourceHeaderParams(AResource); + Result := 0; + AHasImage := AResource.ActualImageIndex >= 0; + AText := AResource.Resources.GetResourceName(AResource); + if Length(AText) > 0 then + begin + R := Rect(0, 0, FResourceHeaderHeight, AWidth); + if AHasImage and (ResourceHeaders.ImagePosition in [ipTop, ipBottom]) then + Dec(R.Bottom, ResourceImages.Height + cxTextOffset * 3); + ScreenCanvas.Font.Assign(AViewParams.Font); + ScreenCanvas.TextExtent(AText, R, MakeTextOutcxFlags(taLeftJustify, + vaCenter, ResourceHeaders.MultilineCaptions)); + Result := R.Right - R.Left + cxTextOffset * 3; + SetResourceTextRect(AResource, R); + if AHasImage and (ResourceHeaders.ImagePosition in [ipTop, ipBottom]) then + Result := Max(Result, ResourceImages.Width + cxTextOffset * 4); + end; + if AHasImage and (ResourceHeaders.ImagePosition in [ipLeft, ipRight]) then + Inc(Result, ResourceImages.Width + cxTextOffset * 4); + end; + +begin + AWidth := GetResourceHeaderWidth - cxTextOffset * 3; + Result := FResourceHeaderHeight; + for I := 0 to Adapter.Resources.VisibleResourceCount - 1 do + Result := Max(Result, CalculateWidth(Adapter.Resources.VisibleResources[I])); +end; + +function TcxSchedulerCustomResourceViewViewInfo.CanCacheGroupSeparator( + AItem: TcxSchedulerGroupSeparatorCellViewInfo): Boolean; +begin + Result := AItem.Rotated and (AItem.Bitmap = nil) and not View.HasCustomDrawGroupSeparator; +end; + +function TcxSchedulerCustomResourceViewViewInfo.CanCacheResourceHeader( + AItem: TcxSchedulerHeaderCellViewInfo): Boolean; +begin + Result := (AItem.Bitmap = nil) and not View.HasCustomDrawResourceHeader; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.Clear; +begin + FResources.Clear; + GroupSeparatorCells.Clear; + Buttons.Clear; + NavigationButtons.Clear; + ContentCells.Clear; + EventCells.Clear; + DayHeaderCells.Clear; + ResourceHeaderCells.Clear; + HeaderContainerCells.Clear; + ClearResourceBounds; + ClearContentNavigationIntervals; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.ClearResourceBounds; +var + I: Integer; +begin + for I := 0 to Length(FResourceBounds) - 1 do + FResourceBounds[I] := cxNullRect; +end; + +function TcxSchedulerCustomResourceViewViewInfo.ContentCellClass: TcxSchedulerContentCellViewInfoClass; +begin + Result := TcxSchedulerContentCellViewInfo +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.CreateCellInstance( + AClass: TcxSchedulerCustomViewInfoItemClass; const ABounds: TRect; + const AViewParams: TcxViewParams; var Instance); +begin + CreateCellInstance(AClass, ABounds, Bounds, AViewParams, Instance); +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.CreateCellInstance( + AClass: TcxSchedulerCustomViewInfoItemClass; const ABounds, + AVisibleBounds: TRect; const AViewParams: TcxViewParams; var Instance); +begin + Pointer(Instance) := AClass.Create(LookAndFeelPainter, + ABounds, AVisibleBounds, AViewParams); + TcxSchedulerCustomViewInfoItem(Instance).FDayBorderColor := FDayBorderColor; + TcxSchedulerCustomViewInfoItem(Instance).FExternalPainter := View.ExternalPainter; +end; + +function TcxSchedulerCustomResourceViewViewInfo.CreateEventViewData( + AEvent: TcxSchedulerControlEvent; const ABounds: TRect; + const AStart, AFinish: TDateTime; AResource: TcxSchedulerResourceViewInfo): TcxSchedulerEventViewData; +var + ALocation: string; +begin + Result := TcxSchedulerEventViewData.Create; + Result.Bounds := ABounds; + Result.VisibleRect := Bounds; + Result.Canvas := View.Canvas; + Result.ContentStart := DateTimeHelper.RoundTime(AStart); + Result.ExternalPainter := View.ExternalPainter; +{$IFNDEF DEBUGPAINT} + Result.Bitmap := View.Bitmap; +{$ENDIF} + Result.GetEventHint := GetEventHint; + Result.BorderColor := View.OptionsView.EventBorderColor; + Result.ContentFinish := DateTimeHelper.RoundTime(AFinish); + Result.Event := AEvent; + Result.ShowTimeAsClock := View.ShowTimeAsClock; + Result.TimeLineParams := FTimeLineParams; + Result.ShowFinishTime := View.ShowEndTime; + Result.Painter := LookAndFeelPainter; + Result.ViewParams := StylesAdapter.GetEventParams(AEvent); + Result.EditProperties := View.GetEditProperties(AEvent); + Result.EditStyle := View.GetEditStyle(AEvent); + Result.Resource := AResource; + if (AEvent <> nil) and AEvent.Shared and (AResource <> nil) then + AEvent.LockResource(AResource.ResourceID); + Result.Caption := DoGetEventDisplayText(AEvent); + AEvent.UnlockResource; + Result.ImagesLayout := View.EventImagesLayout; + Result.DrawAsProgress := False; + Result.TaskComplete := AEvent.TaskComplete; + Result.TaskStatus := AEvent.TaskStatus; + ALocation := Trim(AEvent.Location); + if ALocation <> '' then + Result.Caption := Result.Caption + ' (' + ALocation + ')'; + Result.LineHeight := FContentLineHeight; +end; + +function TcxSchedulerCustomResourceViewViewInfo.CreateEventCellViewInfo( + AViewData: TcxSchedulerEventViewData): TcxSchedulerEventCellViewInfo; +begin + Result := TcxSchedulerEventCellViewInfo.Create(AViewData); +end; + +function TcxSchedulerCustomResourceViewViewInfo.CreateImageCacheManager: TcxSchedulerImageCacheManager; +begin + Result := TcxSchedulerImageCacheManager.Create; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.DoCalculate; +begin + FDayBorderColor := View.OptionsView.DayBorderColor; + if FDayBorderColor = clDefault then + FDayBorderColor := clWindowText; + FEventWithoutResourceCount := 0; + ExtractResources; + FGroupingKind := GetGroupingKind; + if FGroupingKind = gkNone then + FResources.Clear; + if SelectedDays.Count = 0 then + SelectedDays.Add(Date); + with View.Controller.Navigation do + Self.FSelResource := GetResourceViewInfoByItem(SelResource); + if (FSelResource = nil) and (ResourceCount > 0) then + FSelResource := Resources[0]; + CalculateMetrics; + View.Controller.Navigation.CheckSelection; + with View.Controller.Navigation do + begin + Self.FSelStart := DateTimeHelper.RoundTime(Min(SelStart, SelFinish)); + Self.FSelFinish := DateTimeHelper.RoundTime(Max(SelStart, SelFinish)); + end; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.DoContentNavigationButtonClick( + Sender: TcxSchedulerContentNavigationButtonViewInfo); +begin + TcxCustomSchedulerAccess(Scheduler).PeriodChanged; + TcxDateNavigatorAccess(Scheduler.DateNavigator).MakeSelectionVisible; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.DoMoreEventsButtonClick( + Sender: TcxSchedulerMoreEventsButtonViewInfo); +begin +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.ExtractResources; +var + I: Integer; +begin + Adapter.GetPageResources(FResources); + for I := 0 to FResources.Count - 1 do + Resources[I].FImagePosition := ResourceHeaders.ImagePosition; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetBounds: TRect; +begin + Result := FPageBounds; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetContentNavigationInterval( + AContentNavigationButton: TcxSchedulerContentNavigationButtonViewInfo): TDateTime; + + function GetContentNavigationInfo(AIndex: Integer): TcxSchedulerContentNavigationInfo; + begin + Result := TcxSchedulerContentNavigationInfo(FContentNavigationIntervals[AIndex]); + end; + + function GetInterval(AIndex: Integer): TDateTime; + begin + if AContentNavigationButton.Kind = nbkPrevious then + Result := - GetContentNavigationInfo(AIndex).FIntervalBefore + else + Result := GetContentNavigationInfo(AIndex).FIntervalAfter; + end; + +var + I: Integer; +begin + Result := cxMaxDateTime; + if AContentNavigationButton.Resource = nil then + Result := GetInterval(0) + else + for I := 0 to FContentNavigationIntervals.Count - 1 do + if VarEqualsSoft(GetContentNavigationInfo(I).FResourceID, + AContentNavigationButton.Resource.ResourceID) then + begin + Result := GetInterval(I); + Break; + end; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetContentParams( + const ATime: TDateTime; AResource: TcxSchedulerResourceViewInfo): TcxViewParams; +begin + if AResource = nil then + Result := StylesAdapter.GetContentParams(ATime, nil) + else + Result := StylesAdapter.GetContentParams(ATime, AResource.ResourceItem) +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetDayHeaderHeight: Integer; +begin + Result := FDayHeaderHeight; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetEventForResourceCount( + AResourceIndex: Integer; out AResourceID: Variant): Integer; +begin + Result := Resources[AResourceIndex].VisibleEventCount + + GetMoreEventsButtonCount(AResourceIndex); + AResourceID := Resources[AResourceIndex].ResourceID; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetEventWithoutResourceCount: Integer; +begin + Result := FEventWithoutResourceCount; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetMoreEventButtonClass: TcxSchedulerMoreEventsButtonViewInfoClass; +begin + Result := TcxSchedulerMoreEventsButtonViewInfo; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetResourceHeaderWidth: Integer; +begin + Result := GetResourcesContentWidth; + if ResourceCount > 0 then + Result := Max(0, (Result - SeparatorWidth * GetSeparatorCount) div ResourceCount); +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetResourceImagesSize: TSize; +begin + if ResourceImages = nil then + Result := TSize(cxNullSize) + else + Result := cxSize(ResourceImages.Width, ResourceImages.Height); +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetResourcesContentWidth: Integer; +begin + Result := FBounds.Bottom - FBounds.Top - FDayHeaderHeight; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetTimeLineParams: TcxViewParams; +begin + Result := StylesAdapter.GetContentParams(NullDate, nil) +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetSelectionParams( + const AParams: TcxViewParams): TcxViewParams; +begin + Result := AParams; + if View.Scheduler.Focused or not HideSelection then + begin + Result := FSelectionParams; + Result.Bitmap := nil; + end; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetSeparatorCount: Integer; +begin + Result := ResourceCount - 1; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetFontHeight( + AStyle: TcxStyle): Integer; +begin + if (AStyle = nil) or not (cxStyles.svFont in AStyle.AssignedValues) then + Result := PainterHelper.TextHeight(DefaultFont) + else + Result := PainterHelper.TextHeight(AStyle.Font); +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetFontHeight( + const AParams: TcxViewParams): Integer; +begin + Result := PainterHelper.TextHeight(AParams.Font); +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetPageHeaderText: string; +begin + Result := FormatDateTime(LongDateFormat, Days[0]); + if Days[0] <> Days[DayCount - 1] then + Result := Result + ' - ' + FormatDateTime(LongDateFormat, Days[DayCount - 1]); +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetResourceItemByIndex( + AIndex: Integer): TcxSchedulerStorageResourceItem; +begin + Result := nil; + if AIndex >= 0 then + Result := Resources[AIndex].ResourceItem; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetResourceViewInfoByItem( + AItem: TcxSchedulerStorageResourceItem): TcxSchedulerResourceViewInfo; +var + I: Integer; +begin + Result := nil; + for I := 0 to ResourceCount - 1 do + if Resources[I].ResourceItem = AItem then + Result := Resources[I]; +end; + +function TcxSchedulerCustomResourceViewViewInfo.HasStorage: Boolean; +begin + Result := View.Scheduler.Storage <> nil; +end; + +function TcxSchedulerCustomResourceViewViewInfo.HasVisibleEvents: Boolean; +begin + Result := EventCells.Count <> 0; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.ProcessCheckBorders( + AList: TcxSchedulerViewInfoCellList; AHasCommonArea: Boolean; + ANeighbors: TcxNeighbors = []; AExcludeBorders: TcxBorders = []; + AAddBorders: TcxBorders = []); +var + I: Integer; + DrawCommonBorders: Boolean; + ACell, APrevCell: TcxSchedulerHeaderCellViewInfo; +begin + DrawCommonBorders := + LookAndFeelPainter.HeaderBorders([nLeft..nBottom]) = cxBordersAll; + APrevCell := nil; + for I := 0 to AList.Count - 1 do + begin + ACell := TcxSchedulerHeaderCellViewInfo(AList[I]); + ACell.FNeighbors := [nLeft, nRight]; + if (I = 0) and not ACell.RotateHeader then + begin + Exclude(ACell.FNeighbors, nLeft); + if AHasCommonArea then + Include(ACell.FNeighbors, nBottom); + end; + ACell.FNeighbors := ACell.FNeighbors + ANeighbors; + ACell.FBorders := LookAndFeelPainter.HeaderBorders(ACell.FNeighbors); + if not DrawCommonBorders then + begin + ACell.CheckNeighbor(APrevCell); + ACell.FBorders := ACell.FBorders - AExcludeBorders + AAddBorders; + end; + if I = (AList.Count - 1) then + begin + Exclude(ACell.FBorders, bRight); + Exclude(ACell.FNeighbors, nRight); + end; + APrevCell := ACell; + end; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.ReturnVisibleInterval( + var AStart, AEnd: TDateTime); + + function IsDescreteSelection: Boolean; + var + I: Integer; + begin + Result := False; + I := 0; + while not Result and (I < SelectedDays.Count - 1) do + begin + Result := SelectedDays[I] + 1 <> SelectedDays[I + 1]; + Inc(I); + end; + end; + +begin + AStart := SelectedDays[0]; + if IsDescreteSelection then + AEnd := AStart + else + AEnd := SelectedDays[SelectedDays.Count - 1]; +end; + +function TcxSchedulerCustomResourceViewViewInfo.SetAdapter( + Adapter: TcxCustomResourceViewAdapter): TcxCustomResourceViewAdapter; +begin + Result := FAdapter; + FAdapter := Adapter; + FStylesAdapter := FAdapter.GetStylesAdapter; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.SetResourceHasVisibleEvent( + AEvent: TcxSchedulerControlEvent); +var + AResourceIndex: Integer; + AResourceFound: Boolean; +begin + AResourceFound := False; + for AResourceIndex := 0 to ResourceCount - 1 do + if AEvent.IsSharedWithResource(Resources[AResourceIndex].ResourceID) then + begin + Resources[AResourceIndex].VisibleEventCount := + Resources[AResourceIndex].VisibleEventCount + 1; + AResourceFound := True; + end; + if not AResourceFound then + Inc(FEventWithoutResourceCount); +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.SetResourceTextRect( + AResource: TcxSchedulerStorageResourceItem; const ARect: TRect); +var + I: Integer; +begin + for I := 0 to ResourceCount - 1 do + if Resources[I].ResourceItem = AResource then + begin + Resources[I].FTextRect := ARect; + Break; + end; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.ProcessDateToDisplayText( + ArrangeByType: Boolean = False); +var + I: Integer; + AType: Integer; +begin + AType := 0; + for I := 0 to FDayHeaderCells.Count - 1 do + AType := Max(TcxSchedulerDayHeaderCellViewInfo( + FDayHeaderCells[I]).ConvertDateToDisplayText, AType); + if ArrangeByType and (AType > 0) then + begin + for I := 0 to FDayHeaderCells.Count - 1 do + TcxSchedulerDayHeaderCellViewInfo( + FDayHeaderCells[I]).ConvertDateToDisplayText(AType); + end; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.HideCloneEventsOnDragDrop; +var + I: Integer; + AEventCell: TcxSchedulerEventCellViewInfo; +begin + for I := 0 to EventCells.Count - 1 do + begin + AEventCell := TcxSchedulerEventCellViewInfo(EventCells[I]); + if Events.Clones.IndexOf(AEventCell.Event) <> -1 then + AEventCell.Hidden := True; + end; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.HideSourceEventsOnDragDrop; +var + I, J: Integer; + AEventCell: TcxSchedulerEventCellViewInfo; +begin + for I := 0 to EventCells.Count - 1 do + begin + AEventCell := TcxSchedulerEventCellViewInfo(EventCells[I]); + for J := 0 to Events.Clones.Count - 1 do + if TcxSchedulerControlEvent(Events.Clones[J]).Source = AEventCell.Event then + begin + AEventCell.Hidden := True; + Break; + end; + end; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.HotTrackNavigationButtons( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +var + ANavigationButton: TcxSchedulerContentNavigationButtonViewInfo; +begin + if Scheduler.OptionsBehavior.HotTrack then + ANavigationButton := AHitTest.HitContentNavigationButton + else + ANavigationButton := nil; + SetHitContentNavigationButton(ANavigationButton, AHitTest); +end; + +function TcxSchedulerCustomResourceViewViewInfo.IsTimeSelected( + ATime: TDateTime; AResource: TObject): Boolean; +begin + ATime := DateTimeHelper.RoundTime(ATime); + Result := not HideSelection and ((AResource = FSelResource) and + (ATime >= SelStart) and (ATime <= SelFinish)); + Result := Result and CanSelected; +end; + +function TcxSchedulerCustomResourceViewViewInfo.IsValidNavigationButtonsPlace( + const AResourceRect: TRect): Boolean; +var + AButtonWidth1, AButtonWidth2: Integer; +begin + CalculateNavigationButtonParams(AResourceRect, nbkPrevious, AButtonWidth1); + CalculateNavigationButtonParams(AResourceRect, nbkNext, AButtonWidth2); + Result := AButtonWidth1 + AButtonWidth2 <= AResourceRect.Right - AResourceRect.Left; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.MakeTimeVisible( + const ATime: TDateTime); +begin +end; + +function TcxSchedulerCustomResourceViewViewInfo.NavigationButtonOffset( + AKind: TcxSchedulerContentNavigationButtonKind; + AResourceIndex: Integer): Integer; +begin + Result := 0; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.OnContentNavigationButtonClick( + Sender: TcxSchedulerContentNavigationButtonViewInfo); +begin + if not DoSchedulerNavigationButtonClick then + DoContentNavigationButtonClick(Sender); +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.OnMoreEventsButtonClick( + Sender: TcxSchedulerMoreEventsButtonViewInfo); +begin + if not DoSchedulerMoreEventsButtonClick then + DoMoreEventsButtonClick(Sender); +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.AddContentNavigationIntervalItem( + AResourceIndex: Variant); +var + AResourceID: Variant; + I: Integer; + AnAlreadyExists: Boolean; +begin + if AResourceIndex > -1 then + AResourceID := Resources[AResourceIndex].ResourceID + else + begin + AResourceID := 0; + FContentNavigationWithoutResources := True; + end; + AnAlreadyExists := False; + I := 0; + while not AnAlreadyExists and (I < FContentNavigationIntervals.Count) do + begin + AnAlreadyExists := VarEqualsSoft(TcxSchedulerContentNavigationInfo( + FContentNavigationIntervals[I]).FResourceID, AResourceID); + Inc(I); + end; + if not AnAlreadyExists then + FContentNavigationIntervals.Add(TcxSchedulerContentNavigationInfo.Create(AResourceID)); +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.ClearContentNavigationIntervals; +begin + if FContentNavigationIntervals = nil then + FContentNavigationIntervals := TObjectList.Create + else + FContentNavigationIntervals.Clear; + FContentNavigationWithoutResources := False; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetClones: TcxSchedulerEventList; +begin + Result := View.EventList.Clones; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetCorrectColumnHeight( + AColumnRect: TRect): Integer; +begin + Result := Min(AColumnRect.Bottom - AColumnRect.Top, GetMinResourceHeight); +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetDay(AIndex: Integer): TDateTime; +begin + Result := Integer(SelectedDays.List^[AIndex]); +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetDayCount: Integer; +begin + Result := SelectedDays.Count; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetShowEventsWithoutResource: Boolean; +begin + Result := View.OptionsView.ShowEventsWithoutResource or (FGroupingKind = gkNone); +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetGroupByDate: Boolean; +begin + Result := GroupingKind = gkByDate; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetGroupByResource: Boolean; +begin + Result := GroupingKind = gkByResource; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetGroupingKind: TcxSchedulerGroupingKind; +begin + Result := View.GroupingKind; + if Result = gkDefault then + Result := View.OptionsView.GroupingKind; + if ResourceCount = 0 then + Result := gkNone + else + if Result = gkDefault then + Result := gkByResource; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetHasSeparator: Boolean; +begin + Result := (SeparatorWidth > 0) and (GroupingKind <> gkNone); +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetHasVisibleBounds: Boolean; +begin + Result := (PrintFrom <> NullDate) and (PrintTo <> NullDate) +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetHiddenSelection: Boolean; +begin + Result := View.Controller.IsEditing or (Events.Selection.Count > 0); +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetMinResourceHeight: Integer; +var + I, AResourceHeight: Integer; +begin + Result := MaxInt; + if Length(FResourceBounds) = ResourceCount then + for I := 0 to ResourceCount - 1 do + begin + AResourceHeight := FResourceBounds[I].Bottom - FResourceBounds[I].Top; + if (AResourceHeight <> 0) and (Result > AResourceHeight) then + Result := AResourceHeight; + end; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetMoreEventsButtonCount( + AResourceIndex: Integer): Integer; + + function IsButtonWithoutResources( + AButton: TcxSchedulerMoreEventsButtonViewInfo): Boolean; + var + I: Integer; + begin + Result := True; + I := 0; + while (I < ResourceCount) and Result do + begin + if AButton.Event.IsSharedWithResource(Resources[I].ResourceID) then + Result := False; + Inc(I); + end; + end; + +var + I: Integer; +begin + Result := 0; + for I := 0 to Buttons.Count - 1 do + if (Buttons[I] is TcxSchedulerMoreEventsButtonViewInfo) and + ((AResourceIndex = -1) or + TcxSchedulerMoreEventsButtonViewInfo(Buttons[I]).Event.IsSharedWithResource( + Resources[AResourceIndex].ResourceID) or + IsButtonWithoutResources(TcxSchedulerMoreEventsButtonViewInfo(Buttons[I]))) + then + Inc(Result); +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetResource( + AIndex: Integer): TcxSchedulerResourceViewInfo; +begin + if AIndex < 0 then + Result := nil + else + Result := TcxSchedulerResourceViewInfo(FResources[AIndex]); +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetResourceCaption( + AIndex: Integer): string; +begin + Result := Resources[AIndex].Caption; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetResourceCount: Integer; +begin + Result := FResources.Count; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetResourceHeaders: TcxSchedulerResourceHeaders; +begin + Result := View.OptionsView.ResourceHeaders; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetPrintRange( + Index: Integer): TDateTime; +begin + Result := Adapter.GetPrintRange(Index) +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetSeparatorWidth: Integer; +begin + Result := View.OptionsView.GroupSeparatorWidth; +end; + +function TcxSchedulerCustomResourceViewViewInfo.GetView: TcxSchedulerCustomResourceView; +begin + Result := TcxSchedulerCustomResourceView(Owner); +end; + +function TcxSchedulerCustomResourceViewViewInfo.IsDrawButtons: Boolean; +var + I: Integer; +begin + Result := True; + I := 0; + if ResourceCount > 0 then + while (I < ResourceCount) and Result do + begin + Result := IsValidNavigationButtonsPlace(FResourceBounds[I]); + Inc(I); + end + else + Result := IsValidNavigationButtonsPlace(Bounds); +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.SetContentNavigationButtonsIntervals; + + procedure FillContentNavigationIntervals; + var + ACalculator: TcxSchedulerContentNavigationCalculator; + AStart, AFinish: TDateTime; + begin + ReturnVisibleInterval(AStart, AFinish); + ACalculator := TcxSchedulerContentNavigationCalculator.Create; + try + ACalculator.FindNavigationIntervals(Scheduler.Storage, + FContentNavigationIntervals, AStart, AFinish, + FContentNavigationWithoutResources, ShowEventsWithoutResource); + finally + ACalculator.Free; + end; + end; + +var + I: Integer; + AContentNavigationButton: TcxSchedulerContentNavigationButtonViewInfo; +begin + FillContentNavigationIntervals; + for I := 0 to FNavigationButtons.Count - 1 do + begin + AContentNavigationButton := TcxSchedulerContentNavigationButtonViewInfo(FNavigationButtons[I]); + AContentNavigationButton.Interval := GetContentNavigationInterval(AContentNavigationButton); + end; +end; + +procedure TcxSchedulerCustomResourceViewViewInfo.SetHitContentNavigationButton( + AButton: TcxSchedulerContentNavigationButtonViewInfo; + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + if FOldHitContentNavigationButton <> AButton then + begin + if AButton <> nil then + View.RepaintRect(AButton.Bounds); + if FOldHitContentNavigationButton <> nil then + begin + if AHitTest.FContentNavigationButton = FOldHitContentNavigationButton then + AHitTest.FContentNavigationButton := nil; + View.RepaintRect(FOldHitContentNavigationButton.Bounds); + end; + FOldHitContentNavigationButton := AButton; + end; +end; + +{ TcxSchedulerCustomResourceViewNavigation } + +procedure TcxSchedulerCustomResourceViewNavigation.ValidateSelection( + var ASelStart, ASelFinish: TDateTime; + var AResource: TcxSchedulerStorageResourceItem); +begin + AResource := ResourceItem; +end; + +function TcxSchedulerCustomResourceViewNavigation.GetNextResource( + AGoToForward: Boolean): TcxSchedulerStorageResourceItem; +var + AIndex: Integer; +begin + Result := ResourceItem; + AIndex := ViewInfo.FResources.IndexOf(ResourceObject) + Byte(AGoToForward) * 2 - 1; + if (AIndex < 0) or (AIndex >= ViewInfo.FResources.Count) then Exit; + Result := ViewInfo.GetResourceItemByIndex(AIndex); +end; + +function TcxSchedulerCustomResourceViewNavigation.GetResourceItem: TcxSchedulerStorageResourceItem; +begin + Result := nil; + if ResourceObject <> nil then + Result := ResourceObject.ResourceItem; +end; + +function TcxSchedulerCustomResourceViewNavigation.GetResourceFromViewInfo( + AInfo: TcxSchedulerResourceViewInfo): TcxSchedulerStorageResourceItem; +begin + Result := nil; + if AInfo <> nil then + Result := AInfo.ResourceItem; +end; + +function TcxSchedulerCustomResourceViewNavigation.RoundTime( + const ADateTime: TDateTime): TDateTime; +begin + Result := DateTimeHelper.RoundTime(ADateTime); +end; + +function TcxSchedulerCustomResourceViewNavigation.GetIsFirstResource: Boolean; +begin + Result := ViewInfo.FResources.IndexOf(ResourceObject) <= 0; +end; + +function TcxSchedulerCustomResourceViewNavigation.GetIsLastResource: Boolean; +begin + Result := ViewInfo.FResources.IndexOf(ResourceObject) = + (ViewInfo.FResources.Count - 1); +end; + +function TcxSchedulerCustomResourceViewNavigation.GetGroupingKind: TcxSchedulerGroupingKind; +begin + Result := ViewInfo.FGroupingKind; +end; + +function TcxSchedulerCustomResourceViewNavigation.GetResourceObject: TcxSchedulerResourceViewinfo; +begin + Result := ViewInfo.FSelResource; +end; + +function TcxSchedulerCustomResourceViewNavigation.GetViewInfo: TcxSchedulerCustomResourceViewViewInfo; +begin + Result := TcxSchedulerCustomResourceView(View).ViewInfo; +end; + +{ TcxSchedulerCustomResourceViewController } + +function TcxSchedulerCustomResourceViewController.CreateNavigation: TcxSchedulerViewNavigation; +begin + Result := TcxSchedulerCustomResourceViewNavigation.Create(View); +end; + +function TcxSchedulerCustomResourceViewController.GetCursor(X, Y: Integer): TCursor; +const + Cursors: array[Boolean] of TCursor = (crSchedulerVertResize, crSchedulerHorzResize); +begin + with HitTest do + case GetDragKind of + edkEventDragRect: + Result := crSchedulerSplitAll; + edkResizeStart, edkResizeEnd: + Result := Cursors[EventCell.IsHorzSizing]; + else + Result := inherited GetCursor(X, Y); + end; +end; + +procedure TcxSchedulerCustomResourceViewController.MouseDown( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + NavigationButtonClicked := HitTest.HitAtContentNavigationButton; + if HitTest.HitAtButton then + Exclude(Shift, ssDouble); + inherited MouseDown(Button, Shift, X, Y); + if HitTest.HitAtButton then + HitTest.Button.Click; + InternalHideHint; +end; + +procedure TcxSchedulerCustomResourceViewController.MouseLeave; +begin + inherited MouseLeave; + InternalHideHint; + NavigationButtonClicked := False; +end; + +procedure TcxSchedulerCustomResourceViewController.MouseMove(Shift: TShiftState; X, Y: Integer); +begin + if not NavigationButtonClicked then + inherited MouseMove(Shift, X, Y); + ShowHint; +end; + +procedure TcxSchedulerCustomResourceViewController.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + if HitTest.HitAtContentNavigationButton then + HitTest.ContentNavigationButton.Click; + InternalHideHint; + NavigationButtonClicked := False; +end; + +function TcxSchedulerCustomResourceViewController.GetDayHeaderDate: TDateTime; +begin + Result := HitTest.Time; +end; + +procedure TcxSchedulerCustomResourceViewController.InternalHideHint; +begin + HintController.Hide; + FCalculatedHintBounds := False; +end; + +procedure TcxSchedulerCustomResourceViewController.InternalShowHint(P: TPoint; const AHintText: string); +var + R: TRect; +begin + if (not FCalculatedHintBounds) then + begin + FHintText := AHintText; + R := HintController.CalcHintRect(cxscMinHintWidth, AHintText, cxAlignRight); + OffsetRect(R, P.X, P.Y + cxGetCursorSize.cy); + HintController.Activate(R, AHintText, True, False); + FCalculatedHintBounds := True; + end; +end; + +function TcxSchedulerCustomResourceViewController.NeedShowDayHeaderHint: Boolean; +var + AGroupingKind: TcxSchedulerGroupingKind; + AGroupByDate: Boolean; +begin + AGroupingKind := View.GetGroupingKind; + AGroupByDate := AGroupingKind in [gkByDate, gkDefault]; + Result := Scheduler.OptionsView.ShowHints and HitTest.HitAtDayHeader and + (HitTest.HitAtTime) and ((AGroupByDate and + not HitTest.HitAtResourceHeader) or not AGroupByDate); +end; + +function TcxSchedulerCustomResourceViewController.ShowHint: Boolean; +begin + Result := NeedShowDayHeaderHint; + if Result then + ShowDayHeaderHint + else + begin + Result := HitTest.NeedShowHint; + if not Result then + InternalHideHint; + end; +end; + +procedure TcxSchedulerCustomResourceViewController.ShowDayHeaderHint; +var + AHintText: string; + ADate: TDateTime; +begin + AHintText := ''; + ADate := GetDayHeaderDate; + if TcxCustomSchedulerAccess(Scheduler).DoShowDateHint(ADate, AHintText) then + begin + if AnsiCompareText(AHintText, FHintText) <> 0 then + InternalHideHint; + InternalShowHint(GetMouseCursorPos, AHintText); + end + else + InternalHideHint; +end; + +function TcxSchedulerCustomResourceViewController.GetHintController: TcxSchedulerHintController; +begin + Result := TcxCustomSchedulerAccess(Scheduler).HintController; +end; + +function TcxSchedulerCustomResourceViewController.GetHitTest: TcxSchedulerCustomResourceViewHitTest; +begin + Result := TcxSchedulerCustomResourceViewHitTest(inherited HitTest); +end; + +function TcxSchedulerCustomResourceViewController.GetView: TcxSchedulerCustomResourceView; +begin + Result := TcxSchedulerCustomResourceView(inherited View); +end; + +{ TcxSchedulerCustomResourceViewHitTest } + +function TcxSchedulerCustomResourceViewHitTest.GetDragKind: TcxEventDragKind; +begin + ValidateDragKind; + Result := FDragKind; +end; + +procedure TcxSchedulerCustomResourceViewHitTest.SetDragKind( + AValue: TcxEventDragKind); +begin + FDragKind := AValue; + ValidateDragKind; +end; + +function TcxSchedulerCustomResourceViewHitTest.CanMoveEvent( + AEvent: TcxSchedulerControlEvent): Boolean; +var + AResource: TcxSchedulerStorageResourceItem; +begin + Result := Scheduler.EventOperations.Moving; + if Result then + begin + AResource := AEvent.GetResourceItem; + Result := (AResource = nil) or not AResource.ReadOnly; + end; +end; + +function TcxSchedulerCustomResourceViewHitTest.CanResizeEvent( + AEvent: TcxSchedulerControlEvent): Boolean; +var + AResource: TcxSchedulerStorageResourceItem; +begin + Result := Scheduler.EventOperations.Sizing; + if Result then + begin + AResource := AEvent.GetResourceItem; + Result := (AResource = nil) or not AResource.ReadOnly; + end; +end; + +procedure TcxSchedulerCustomResourceViewHitTest.Clear; +begin + FDragKind := edkNone; + FEventCell := nil; + FResource := nil; + FHitObject := nil; + inherited Clear; +end; + +procedure TcxSchedulerCustomResourceViewHitTest.DoCalculate; +begin + inherited DoCalculate; + if HitAtControl then + View.ViewInfo.CalculateHitTest(Self); +end; + +function TcxSchedulerCustomResourceViewHitTest.GetHitEvent: TcxSchedulerControlEvent; +begin + Result := inherited GetHitEvent; + if FEventCell <> nil then + Result := FEventCell.Event; +end; + +procedure TcxSchedulerCustomResourceViewHitTest.SetHitTime( + AItemFlag: Integer; const ATime: TDateTime); +begin + SetBitState(AItemFlag, True); + SetBitState(htcTime, True); + FTime := ATime; +end; + +procedure TcxSchedulerCustomResourceViewHitTest.SetResource( + AResource: TcxSchedulerResourceViewInfo); +begin + if AResource = nil then + FResource := nil + else + FResource := AResource.ResourceItem; +end; + +procedure TcxSchedulerCustomResourceViewHitTest.ValidateDragKind; +begin + if (Event = nil) or ((FDragKind in [edkEventDragRect, edkMoveEvent]) and not CanMoveEvent(Event)) or + ((FDragKind in [edkResizeStart, edkResizeEnd]) and not CanResizeEvent(Event)) then + FDragKind := edkNone; +end; + +function TcxSchedulerCustomResourceViewHitTest.GetContentCell: TcxSchedulerContentCellViewInfo; +begin + if HitAtContent then + Result := TcxSchedulerContentCellViewInfo(FHitObject) + else + Result := nil; +end; + +function TcxSchedulerCustomResourceViewHitTest.GetHitContentNavigationButton: TcxSchedulerContentNavigationButtonViewInfo; +begin + if GetBitState(htcNavigationButton) then + Result := FContentNavigationButton + else + Result := nil; +end; + +function TcxSchedulerCustomResourceViewHitTest.GetHeaderCell: TcxSchedulerHeaderCellViewInfo; +begin + if HitAtDayHeader or HitAtResourceHeader then + Result := TcxSchedulerHeaderCellViewInfo(FHitObject) + else + Result := nil; +end; + +function TcxSchedulerCustomResourceViewHitTest.GetView: TcxSchedulerCustomResourceView; +begin + Result := TcxSchedulerCustomResourceView(inherited Owner); +end; + +{ TcxSchedulerCustomViewPainter } + +constructor TcxSchedulerCustomViewPainter.Create( + AOwner: TcxSchedulerSubControl); +begin + inherited Create(AOwner); + FPainter := View.GetCommonViewItemsPainter; +end; + +procedure TcxSchedulerCustomViewPainter.InitializePainter; +begin + FPainter := View.GetCommonViewItemsPainter; +end; + +procedure TcxSchedulerCustomViewPainter.Paint; +begin +end; + +procedure TcxSchedulerCustomViewPainter.DrawBackgroundCell( + AItem: TcxSchedulerBackgroundCellViewInfo); +var + ADone: Boolean; +begin + if AItem = nil then Exit; + ADone := False; + AItem.BeforeCustomDraw(Canvas); + if Painter <> nil then + Painter.DoCustomDrawBackground(AItem, ADone); + if not ADone then + View.DoCustomDrawBackground(AItem, ADone); + AItem.AfterCustomDraw(Canvas); + if not ADone then + AItem.Draw(Canvas); +end; + +procedure TcxSchedulerCustomViewPainter.DrawButtonCell( + AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); +begin + if AItem is TcxSchedulerMoreEventsButtonViewInfo then + begin + if Painter <> nil then + Painter.DoCustomDrawButton(TcxSchedulerMoreEventsButtonViewInfo(AItem), ADone); + if not ADone then + View.DoCustomDrawButton(TcxSchedulerMoreEventsButtonViewInfo(AItem), ADone); + end + else + begin + if Painter <> nil then + Painter.DoCustomDrawNavigationButton(TcxSchedulerContentNavigationButtonViewInfo(AItem), ADone); + if not ADone then + View.DoCustomDrawNavigationButton(TcxSchedulerContentNavigationButtonViewInfo(AItem), ADone); + end; +end; + +procedure TcxSchedulerCustomViewPainter.DrawContentCell( + AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); +begin + if Painter <> nil then + Painter.DoCustomDrawContent(TcxSchedulerContentCellViewInfo(AItem), ADone); + if not ADone then + View.DoCustomDrawContent(TcxSchedulerContentCellViewInfo(AItem), ADone); +end; + +procedure TcxSchedulerCustomViewPainter.DrawEventCell( + AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); +begin + with TcxSchedulerEventCellViewInfo(AItem) do + if Hidden or not Visible then Exit; + if Painter <> nil then + Painter.DoCustomDrawEvent(TcxSchedulerEventCellViewInfo(AItem), ADone); + if not ADone then + View.DoCustomDrawEvent(TcxSchedulerEventCellViewInfo(AItem), ADone); +end; + +procedure TcxSchedulerCustomViewPainter.DrawHeaderCell( + AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); +begin + if Painter <> nil then + Painter.DoCustomDrawDayHeader(TcxSchedulerDayHeaderCellViewInfo(AItem), ADone); + if not ADone then + View.DoCustomDrawDayHeader(TcxSchedulerDayHeaderCellViewInfo(AItem), ADone); +end; + +procedure TcxSchedulerCustomViewPainter.DrawGroupSeparatorCell( + AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); +begin + if Painter <> nil then + Painter.DoCustomDrawGroupSeparator(TcxSchedulerGroupSeparatorCellViewInfo(AItem), ADone); + if not ADone then + View.DoCustomDrawGroupSeparator(TcxSchedulerGroupSeparatorCellViewInfo(AItem), ADone); +end; + +procedure TcxSchedulerCustomViewPainter.DrawResourceHeaderCell( + AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); +begin + if Painter <> nil then + Painter.DoCustomDrawResourceHeader(TcxSchedulerHeaderCellViewInfo(AItem), ADone); + if not ADone then + View.DoCustomDrawResourceHeader(TcxSchedulerHeaderCellViewInfo(AItem), ADone); +end; + +function TcxSchedulerCustomViewPainter.GetView: TcxSchedulerCustomResourceView; +begin + Result := TcxSchedulerCustomResourceView(Owner); +end; + +{ TcxSchedulerEventPlace } + +procedure TcxSchedulerEventPlace.AlignPosition(APlace: TcxSchedulerEventPlace); +begin + LineFinish := APlace.LineFinish + 1 + (LineFinish - LineStart); + LineStart := APlace.LineFinish + 1; +end; + +function TcxSchedulerEventPlace.IntersectHorz(APlace: TcxSchedulerEventPlace): Boolean; +begin + Result := (APlace.Resource = Resource) and (APlace.ColFinish >= ColStart) and + (APlace.ColStart <= ColFinish); +end; + +function TcxSchedulerEventPlace.IntersectVert(APlace: TcxSchedulerEventPlace): Boolean; +begin + Result := (APlace.Resource = Resource) and (APlace.LineFinish >= LineStart) and + (APlace.LineStart <= LineFinish); +end; + +procedure TcxSchedulerEventPlace.ResetPosition; +begin + LineFinish := LineFinish - LineStart; + LineStart := 0; +end; + +function cxCompareEventPlaces(AEventPlace1, AEventPlace2: TcxSchedulerEventPlace): Integer; +var + AAllDay1, AAllDay2: Boolean; + AEvent1, AEvent2: TcxSchedulerEvent; +begin + Result := Integer(AEventPlace1.Resource) - Integer(AEventPlace2.Resource); + if Result <> 0 then Exit; + AEvent1 := AEventPlace1.Event; + AEvent2 := AEventPlace2.Event; + AAllDay1 := AEvent1.AllDayEvent or (AEvent1.Duration >= 1); + AAllDay2 := AEvent2.AllDayEvent or (AEvent2.Duration >= 1); + Result := Byte(AAllDay2) - Byte(AAllDay1); + if Result <> 0 then Exit; + + if AEventPlace1.ColStart < AEventPlace2.ColStart then + Result := -1 + else + if AEventPlace1.ColStart > AEventPlace2.ColStart then + Result := 1 + else + if AEventPlace1.ColFinish > AEventPlace2.ColFinish then + Result := -1 + else + if AEventPlace1.ColFinish < AEventPlace2.ColFinish then + Result := 1 + else + if AEvent1.Start < AEvent2.Start then + Result := -1 + else + if AEvent1.Start > AEvent2.Start then + Result := 1 + else + if AEvent1.Finish > AEvent2.Finish then + Result := -1 + else + if AEvent1.Finish < AEvent2.Finish then + Result := 1 + else + if AEvent1.RecordIndex < AEvent2.RecordIndex then + Result := -1 + else + if AEvent1.RecordIndex > AEvent2.RecordIndex then + Result := 1 + else + Result := 0; +end; + +{ TcxSchedulerEventLayoutBuilder } + +constructor TcxSchedulerEventLayoutBuilder.Create; +begin + FEventPlaces := TcxObjectList.Create; +end; + +destructor TcxSchedulerEventLayoutBuilder.Destroy; +begin + FreeAndNil(FEventPlaces); + inherited Destroy; +end; + +function TcxSchedulerEventLayoutBuilder.AddEventPlace(AEvent: TcxSchedulerEvent; + AStartCol, AFinishCol: Integer; ALineCount: Integer = 1; AResource: TObject = nil): TcxSchedulerEventPlace; +begin + Result := TcxSchedulerEventPlace.Create; + Result.ColStart := AStartCol; + Result.ColFinish := AFinishCol; + Result.Event := AEvent; + Result.LineFinish := ALineCount - 1; + Result.Resource := AResource; + FEventPlaces.Add(Result); +end; + +procedure TcxSchedulerEventLayoutBuilder.Clear; +begin + FEventPlaces.Clear; +end; + +procedure TcxSchedulerEventLayoutBuilder.Calculate; +var + I, J, K: Integer; + ACurPlace: TcxSchedulerEventPlace; +begin + FEventPlaces.Sort(TListSortCompare(@cxCompareEventPlaces)); + for I := 1 to EventPlaceCount - 1 do + begin + J := I; + K := I; + ACurPlace := EventPlaces[I]; + repeat + Dec(J); + if ACurPlace.IntersectHorz(EventPlaces[J]) then K := J; + until J = 0; + ACurPlace.ResetPosition; + J := K; + while J < I do + begin + if ACurPlace.IntersectHorz(EventPlaces[J]) and ACurPlace.IntersectVert(EventPlaces[J]) then + begin + ACurPlace.AlignPosition(EventPlaces[J]); + J := K; + end + else + Inc(J); + end; + end; +end; + +procedure TcxSchedulerEventLayoutBuilder.CalculateEx(AEventsList: TcxSchedulerFilteredEventList; + APlaceInfoProc: TcxSchedulerEventLayoutBuilderGetEventPlaceProc); +var + AEvent: TcxSchedulerControlEvent; + I, AStartCol, AFinishCol, ALineCount: Integer; +begin + Clear; + for I := 0 to AEventsList.Count - 1 do + begin + AEvent := AEventsList[I]; + ALineCount := 1; + if APlaceInfoProc(Self, AEventsList[I], AStartCol, AFinishCol, ALineCount) then + AddEventPlace(AEvent, AStartCol, AFinishCol, ALineCount); + end; + Calculate; +end; + +function TcxSchedulerEventLayoutBuilder.GetEventPlace(AIndex: Integer): TcxSchedulerEventPlace; +begin + Result := TcxSchedulerEventPlace(FEventPlaces.List^[AIndex]); +end; + +function TcxSchedulerEventLayoutBuilder.GetEventPlaceCount: Integer; +begin + Result := FEventPlaces.Count; +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerDBStorage.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerDBStorage.pas new file mode 100644 index 00000000..4c899aef --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerDBStorage.pas @@ -0,0 +1,1104 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerDBStorage; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, SysUtils, Graphics, DB, cxDB, cxDBData, cxSchedulerStorage, + cxCustomData, cxDataStorage, cxDataUtils; + +type + TcxSchedulerDBStorage = class; + TcxFieldName = type string; + + { TcxSchedulerDBStorageDataController } + + TcxSchedulerDBStorageDataController = class(TcxDBDataController) + private + function GetStorage: TcxSchedulerDBStorage; + protected + procedure UpdateControl(AInfo: TcxUpdateControlInfo); override; + property Storage: TcxSchedulerDBStorage read GetStorage; + public + function GetItem(Index: Integer): TObject; override; + function GetItemValueSource(AItemIndex: Integer): TcxDataEditValueSource; override; + function GetItemID(AItem: TObject): Integer; override; + procedure UpdateData; override; + procedure UpdateItemIndexes; override; + end; + + { TcxSchedulerDBStorageField } + + TcxSchedulerDBStorageField = class(TcxCustomSchedulerStorageField) + private + function GetDataController: TcxSchedulerDBStorageDataController; + function GetDataSource: TDataSource; + function GetFieldName: string; + procedure SetFieldName(const AValue: string); + protected + function GetDisplayName: string; override; + function GetIsActive: Boolean; override; + + property DataController: TcxSchedulerDBStorageDataController read GetDataController; + public + procedure Assign(Source: TPersistent); override; + + property DataSource: TDataSource read GetDataSource; + published + property FieldName: string read GetFieldName write SetFieldName; + end; + + { TcxSchedulerDBStorageFields } + + TcxSchedulerDBStorageFields = class(TcxCustomSchedulerStorageFields) + private + function GetItem(AIndex: Integer): TcxSchedulerDBStorageField; + procedure SetItem(AIndex: Integer; const AValue: TcxSchedulerDBStorageField); + protected + function FindFieldByName(const AName: string): TcxCustomSchedulerStorageField; override; + public + function Add: TcxSchedulerDBStorageField; + function ItemByFieldName(const AFieldName: string): TcxSchedulerDBStorageField; + + property Items[Index: Integer]: TcxSchedulerDBStorageField read GetItem write SetItem; + end; + + { TcxSchedulerDBStorageFieldNames } + + TcxSchedulerDBStorageFieldNames = class(TPersistent) + private + FOwner: TcxSchedulerDBStorage; + function GetDataController: TcxSchedulerDBStorageDataController; + function GetKeyFieldName: TcxFieldName; + procedure SetKeyFieldName(const AValue: TcxFieldName); + protected + function GetFieldName(AIndex: Integer): TcxFieldName; + function GetOwner: TPersistent; override; + procedure SetFieldName(AIndex: Integer; const AValue: TcxFieldName); + property ReminderTime: TcxFieldName index 10 read GetFieldName write SetFieldName; + public + constructor Create(AOwner: TcxSchedulerDBStorage); virtual; + procedure Assign(Source: TPersistent); override; + + property Storage: TcxSchedulerDBStorage read FOwner; + property DataController: TcxSchedulerDBStorageDataController read GetDataController; + published + property ActualFinish: TcxFieldName index 15 read GetFieldName write SetFieldName; + property ActualStart: TcxFieldName index 16 read GetFieldName write SetFieldName; + property Caption: TcxFieldName index 0 read GetFieldName write SetFieldName; + property EventType: TcxFieldName index 1 read GetFieldName write SetFieldName; + property Finish: TcxFieldName index 2 read GetFieldName write SetFieldName; + property ID: TcxFieldName read GetKeyFieldName write SetKeyFieldName; + property LabelColor: TcxFieldName index 3 read GetFieldName write SetFieldName; + property Location: TcxFieldName index 4 read GetFieldName write SetFieldName; + property Message: TcxFieldName index 5 read GetFieldName write SetFieldName; + property Options: TcxFieldName index 6 read GetFieldName write SetFieldName; + property ParentID: TcxFieldName index 7 read GetFieldName write SetFieldName; + property RecurrenceIndex: TcxFieldName index 8 read GetFieldName write SetFieldName; + property RecurrenceInfo: TcxFieldName index 9 read GetFieldName write SetFieldName; + property ReminderDate: TcxFieldName index 10 read GetFieldName write SetFieldName; + property ReminderMinutesBeforeStart: TcxFieldName index 11 read GetFieldName write SetFieldName; + property ReminderResourcesData: TcxFieldName index 21 read GetFieldName write SetFieldName; + property ResourceID: TcxFieldName index 12 read GetFieldName write SetFieldName; + property Start: TcxFieldName index 13 read GetFieldName write SetFieldName; + property State: TcxFieldName index 14 read GetFieldName write SetFieldName; + property TaskCompleteField: TcxFieldName index 17 read GetFieldName write SetFieldName; + property TaskIndexField: TcxFieldName index 18 read GetFieldName write SetFieldName; + property TaskLinksField: TcxFieldName index 19 read GetFieldName write SetFieldName; + property TaskStatusField: TcxFieldName index 20 read GetFieldName write SetFieldName; + end; + + { TcxSchedulerDBStorageResourceDataController } + + TcxSchedulerDBStorageResourceDataController = class(TcxDBDataController) + protected + procedure UpdateControl(AInfo: TcxUpdateControlInfo); override; + public + function GetItem(AIndex: Integer): TObject; override; + end; + + { TcxSchedulerDBStorageResources } + + TcxSchedulerDBStorageResources = class(TcxSchedulerStorageResources) + private + FDataController: TcxSchedulerDBStorageResourceDataController; + FDataItems: TcxSchedulerStorageResourceItems; + FResourceColorField: TcxDBDataField; + FResourceColorFieldName: TcxFieldName; + FResourceIDField: TcxDBDataField; + FResourceIDFieldName: TcxFieldName; + FResourceImageIndexField: TcxDBDataField; + FResourceImageIndexFieldName: TcxFieldName; + FResourceNameField: TcxDBDataField; + FResourceNameFieldName: TcxFieldName; + function GetDataSource: TDataSource; + procedure SetDataSource(AValue: TDataSource); + procedure SetResourceColorFieldName(const AValue: TcxFieldName); + procedure SetResourceIDFieldName(const AValue: TcxFieldName); + procedure SetResourceImageIndexFieldName(const AValue: TcxFieldName); + procedure SetResourceNameFieldName(const AValue: TcxFieldName); + protected + function CreateDataController: TcxSchedulerDBStorageResourceDataController; virtual; + function GetResourceItems: TcxSchedulerStorageResourceItems; override; + function GetValueDef(ARecordIndex: Integer; AField: TcxDBDataField; + const DefValue: Variant): Variant; + procedure InitDataItem(AItem: TcxSchedulerStorageResourceItem; AIndex: Integer); virtual; + procedure SetInternalFieldName(var AFieldName: TcxFieldName; const AValue: TcxFieldName; var AField: TcxDBDataField); + procedure UpdateResourceItems; virtual; + property DataController: TcxSchedulerDBStorageResourceDataController read FDataController; + property ResourceColorField: TcxDBDataField read FResourceColorField; + property ResourceIDField: TcxDBDataField read FResourceIDField; + property ResourceImageIndexField: TcxDBDataField read FResourceImageIndexField; + property ResourceNameField: TcxDBDataField read FResourceNameField; + public + constructor Create(AOwner: TcxCustomSchedulerStorage); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + property DataItems: TcxSchedulerStorageResourceItems read FDataItems; + published + property DataSource: TDataSource read GetDataSource write SetDataSource; + property ResourceColor: TcxFieldName read FResourceColorFieldName write SetResourceColorFieldName; + property ResourceID: TcxFieldName read FResourceIDFieldName write SetResourceIDFieldName; + property ResourceImageIndex: TcxFieldName read FResourceImageIndexFieldName write SetResourceImageIndexFieldName; + property ResourceName: TcxFieldName read FResourceNameFieldName write SetResourceNameFieldName; + property Images; + property Items; + property OnGetResourceImageIndex; + property OnGetResourceName; + end; + + TcxSchedulerGetEventGeneratedIDEvent = procedure(Sender: TcxSchedulerDBStorage; + AEvent: TcxSchedulerEvent; var EventID: Variant) of object; + + { TcxSchedulerDBStorage } + + TcxSchedulerDBStorage = class(TcxCustomSchedulerStorage) + private + FFieldNames: TcxSchedulerDBStorageFieldNames; + FGenerateGUIDForID: Boolean; + FOnGetEventGeneratedID: TcxSchedulerGetEventGeneratedIDEvent; + function GetDataController: TcxSchedulerDBStorageDataController; + function GetDataSet: TDataSet; + function GetDataSource: TDataSource; + function GetCustomFields: TcxSchedulerDBStorageFields; + function GetResources: TcxSchedulerDBStorageResources; + function GetSmartRefresh: Boolean; + procedure SetDataSource(AValue: TDataSource); + procedure SetCustomFields(const AValue: TcxSchedulerDBStorageFields); + procedure SetFieldNames(AValue: TcxSchedulerDBStorageFieldNames); + procedure SetResources(AValue: TcxSchedulerDBStorageResources); + procedure SetSmartRefresh(AValue: Boolean); + protected + FIDField: TField; + function ActualTimeRangeAvailable: Boolean; override; + procedure AddRecord; override; + function CreateFieldNames: TcxSchedulerDBStorageFieldNames; virtual; + function CreateFields: TcxCustomSchedulerStorageFields; override; + function CreateResources: TcxSchedulerStorageResources; override; + procedure CreateSubClasses; override; + procedure DestroySubClasses; override; + function DoGetEventGeneratedID(AEvent: TcxSchedulerEvent; const AEventID: Variant): Variant; virtual; + function GetDataControllerClass: TcxCustomDataControllerClass; override; + function GetIDField: TField; + function GetField(AIndex: Integer): TField; + function GetFieldValueBeforePost(ARecordIndex, AFieldIndex: Integer): Variant; override; + function GetFieldValueTypeClass(AField: TcxCustomSchedulerStorageField): TcxValueTypeClass; override; + function GetFocusedRecordID(ARecordIndex: Integer): Variant; override; + function IsDataSettingsValid: Boolean; override; + function IsFieldValid(AField: TcxCustomSchedulerStorageField): Boolean; + function MakeFocused(AEvent: TcxSchedulerEvent): Boolean; + procedure PostEvent(AEvent: TcxSchedulerEvent); override; + procedure PostEditingData(AEvent: TcxSchedulerEvent); override; + procedure SetFieldValueBeforePost(ARecordIndex, AFieldIndex: Integer; const AValue: Variant); override; + procedure SetValue(ARecordIndex, AItemIndex: Integer; const AValue: Variant); override; + + procedure BeginUpdateDataController; override; + procedure EndUpdateDataController; override; + + property DataController: TcxSchedulerDBStorageDataController read GetDataController; + property DataSet: TDataSet read GetDataSet; + property IDField: TField read GetIDField; + public + procedure Assign(Source: TPersistent); override; + function CheckRequiredFields: Boolean; override; + procedure Clear; override; + function IsActive: Boolean; override; + function IsCaptionAvailable: Boolean; override; + function IsLabelColorAvailable: Boolean; override; + function IsLocationAvailable: Boolean; override; + function IsMessageAvailable: Boolean; override; + function IsRecurrenceAvailable: Boolean; override; + function IsReminderAvailable: Boolean; override; + function IsReminderByResourceAvailable: Boolean; override; + function IsStateAvailable: Boolean; override; + procedure PostEvents; override; + procedure UpdateItems; + + published + property GenerateGUIDForID: Boolean read FGenerateGUIDForID write FGenerateGUIDForID default False; + property Reminders; + property Resources: TcxSchedulerDBStorageResources read GetResources write SetResources; + property SmartRefresh: Boolean read GetSmartRefresh write SetSmartRefresh default False; + property CustomFields: TcxSchedulerDBStorageFields read GetCustomFields write SetCustomFields; + property Holidays; + property DataSource: TDataSource read GetDataSource write SetDataSource; + property FieldNames: TcxSchedulerDBStorageFieldNames read FFieldNames write SetFieldNames; + property OnEventDeleted; + property OnEventInserted; + property OnEventIntersect; + property OnEventModified; + property OnFilterEvent; + property OnGetEventGeneratedID: TcxSchedulerGetEventGeneratedIDEvent read FOnGetEventGeneratedID write FOnGetEventGeneratedID; + end; + +implementation + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + cxVariants, cxSchedulerStrs, cxSchedulerUtils; + +type + TcxCustomDataFieldAccess = class(TcxCustomDataField); + + +{$IFNDEF DELPHI6} +function CoCreateGuid(out guid: TGUID): HResult; stdcall; + external 'ole32.dll' name 'CoCreateGuid'; + +function StringFromCLSID(const clsid: TGUID; out psz: PWideChar): HResult; stdcall; + external 'ole32.dll' name 'StringFromCLSID'; + +procedure CoTaskMemFree(pv: Pointer); stdcall; + external 'ole32.dll' name 'CoTaskMemFree'; + +function CreateGUID(out Guid: TGUID): HResult; +begin + Result := CoCreateGuid(Guid); +end; + +function GUIDToString(const GUID: TGUID): string; +var + P: PWideChar; +begin + if not Succeeded(StringFromCLSID(GUID, P)) then + raise EAbort.Create(''); + Result := P; + CoTaskMemFree(P); +end; +{$ENDIF} + +function CreateGUIDForID: string; +var + G: TGUID; +begin + CreateGUID(G); + Result := GUIDToString(G); +end; + +function CheckAndSetFieldValue(AField: TField; const AValue: Variant): Boolean; +begin + Result := (AField <> nil) and ((VarType(AField.Value) <> VarType(AValue)) or + VarIsSoftNull(AField.Value) or not VarEqualsSoft(AField.Value, AValue)); + if Result then + SetFieldValue(AField, AValue); +end; + +{ TcxSchedulerDBStorageDataController } + +function TcxSchedulerDBStorageDataController.GetItem( + Index: Integer): TObject; +begin + Result := Storage.FFields[Index]; +end; + +function TcxSchedulerDBStorageDataController.GetItemValueSource( + AItemIndex: Integer): TcxDataEditValueSource; +begin + Result := evsValue; +end; + +function TcxSchedulerDBStorageDataController.GetItemID( + AItem: TObject): Integer; +begin + if AItem is TcxCustomSchedulerStorageField then + Result := TcxCustomSchedulerStorageField(AItem).Index + else + Result := -1; +end; + +procedure TcxSchedulerDBStorageDataController.UpdateData; +begin + Storage.UpdateData; +end; + +procedure TcxSchedulerDBStorageDataController.UpdateItemIndexes; +begin + Storage.UpdateItemIndexes; + inherited UpdateItemIndexes; +end; + +procedure TcxSchedulerDBStorageDataController.UpdateControl( + AInfo: TcxUpdateControlInfo); +begin + Storage.UpdateControl(AInfo); +end; + +function TcxSchedulerDBStorageDataController.GetStorage: TcxSchedulerDBStorage; +begin + Result := TcxSchedulerDBStorage(GetOwner) +end; + +{ TcxSchedulerDBStorageField } + +procedure TcxSchedulerDBStorageField.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerDBStorageField then + FieldName := TcxSchedulerDBStorageField(Source).FieldName; +end; + +function TcxSchedulerDBStorageField.GetDisplayName: string; +begin + Result := FieldName; + if Result = '' then + Result := inherited GetDisplayName; +end; + +function TcxSchedulerDBStorageField.GetIsActive: Boolean; +begin + Result := TcxSchedulerDBStorage(Storage).IsActive and + TcxSchedulerDBStorage(Storage).IsFieldValid(Self); +end; + +function TcxSchedulerDBStorageField.GetDataController: TcxSchedulerDBStorageDataController; +begin + Result := TcxSchedulerDBStorageDataController(inherited DataController); +end; + +function TcxSchedulerDBStorageField.GetDataSource: TDataSource; +begin + Result := DataController.DataSource; +end; + +function TcxSchedulerDBStorageField.GetFieldName: string; +begin + Result := DataController.GetItemFieldName(Index); +end; + +procedure TcxSchedulerDBStorageField.SetFieldName( + const AValue: string); +begin + TcxSchedulerDBStorageDataController(DataController).ChangeFieldName(Index, AValue); +end; + +{ TcxSchedulerDBStorageFields } + +function TcxSchedulerDBStorageFields.Add: TcxSchedulerDBStorageField; +begin + Result := TcxSchedulerDBStorageField(inherited Add) +end; + +function TcxSchedulerDBStorageFields.ItemByFieldName( + const AFieldName: string): TcxSchedulerDBStorageField; +begin + Result := TcxSchedulerDBStorageField(FindFieldByName(AFieldName)); +end; + +function TcxSchedulerDBStorageFields.FindFieldByName( + const AName: string): TcxCustomSchedulerStorageField; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := TcxSchedulerStorageField(inherited Items[I]); + if AnsiSameText(AName, TcxSchedulerDBStorageField(Result).FieldName) then Exit; + end; + Result := nil; +end; + +function TcxSchedulerDBStorageFields.GetItem( + AIndex: Integer): TcxSchedulerDBStorageField; +begin + Result := TcxSchedulerDBStorageField(inherited Items[AIndex]) +end; + +procedure TcxSchedulerDBStorageFields.SetItem( + AIndex: Integer; const AValue: TcxSchedulerDBStorageField); +begin + Items[AIndex].Assign(AValue); +end; + +{ TcxSchedulerDBStorageFieldNames } + +constructor TcxSchedulerDBStorageFieldNames.Create( + AOwner: TcxSchedulerDBStorage); +begin + FOwner := AOwner; +end; + +procedure TcxSchedulerDBStorageFieldNames.Assign( + Source: TPersistent); +var + I: Integer; +begin + if Source is TcxSchedulerDBStorageFieldNames then + begin + for I := 0 to Storage.InternalFields.Count - 1 do + SetFieldName(I, TcxSchedulerDBStorageFieldNames(Source).GetFieldName(I)); + end; +end; + +function TcxSchedulerDBStorageFieldNames.GetDataController: TcxSchedulerDBStorageDataController; +begin + Result := FOwner.DataController; +end; + +function TcxSchedulerDBStorageFieldNames.GetFieldName( + AIndex: Integer): TcxFieldName; +begin + Result := TcxSchedulerDBStorageField( + Storage.InternalFields.Items[AIndex]).FieldName; +end; + +function TcxSchedulerDBStorageFieldNames.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +procedure TcxSchedulerDBStorageFieldNames.SetFieldName( + AIndex: Integer; const AValue: TcxFieldName); +begin + TcxSchedulerDBStorageField( + Storage.InternalFields.Items[AIndex]).FieldName := AValue; +end; + +function TcxSchedulerDBStorageFieldNames.GetKeyFieldName: TcxFieldName; +begin + Result := DataController.KeyFieldNames; +end; + +procedure TcxSchedulerDBStorageFieldNames.SetKeyFieldName( + const AValue: TcxFieldName); +begin + DataController.KeyFieldNames := AValue; + Storage.FIDField := nil; +end; + +{ TcxSchedulerDBStorageResourceDataController } + +function TcxSchedulerDBStorageResourceDataController.GetItem( + AIndex: Integer): TObject; +begin + Result := nil; +end; + +procedure TcxSchedulerDBStorageResourceDataController.UpdateControl( + AInfo: TcxUpdateControlInfo); +begin + if (AInfo is TcxDataChangedInfo) or (AInfo is TcxUpdateRecordInfo) then + TcxSchedulerDBStorage(GetOwner).Resources.UpdateResourceItems; +end; + +{ TcxSchedulerDBStorageResources } + +constructor TcxSchedulerDBStorageResources.Create( + AOwner: TcxCustomSchedulerStorage); +begin + inherited Create(AOwner); + FDataController := CreateDataController; + FDataItems := CreateItems; +end; + +destructor TcxSchedulerDBStorageResources.Destroy; +begin + FDataItems.Free; + FreeAndNil(FResourceColorField); + FreeAndNil(FResourceIDField); + FreeAndNil(FResourceImageIndexField); + FreeAndNil(FResourceNameField); + FreeAndNil(FDataController); + inherited Destroy; +end; + +procedure TcxSchedulerDBStorageResources.Assign( + Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerDBStorageResources then + begin + DataSource := TcxSchedulerDBStorageResources(Source).DataSource; + ResourceColor := TcxSchedulerDBStorageResources(Source).ResourceColor; + ResourceID := TcxSchedulerDBStorageResources(Source).ResourceID; + ResourceImageIndex := TcxSchedulerDBStorageResources(Source).ResourceImageIndex; + ResourceName := TcxSchedulerDBStorageResources(Source).ResourceName; + end; +end; + +function TcxSchedulerDBStorageResources.CreateDataController: TcxSchedulerDBStorageResourceDataController; +begin + Result := TcxSchedulerDBStorageResourceDataController.Create(Storage); +end; + +function TcxSchedulerDBStorageResources.GetResourceItems: TcxSchedulerStorageResourceItems; +begin + if DataItems.Count > 0 then + Result := DataItems + else + Result := Items; +end; + +procedure TcxSchedulerDBStorageResources.InitDataItem( + AItem: TcxSchedulerStorageResourceItem; AIndex: Integer); +begin + AItem.ResourceID := GetValueDef(AIndex, ResourceIDField, Null); + AItem.ImageIndex := GetValueDef(AIndex, ResourceImageIndexField, -1); + AItem.Name := GetValueDef(AIndex, ResourceNameField, ''); + AItem.Color := GetValueDef(AIndex, ResourceColorField, clDefault); +end; + +function TcxSchedulerDBStorageResources.GetValueDef(ARecordIndex: Integer; + AField: TcxDBDataField; const DefValue: Variant): Variant; +begin + if AField <> nil then + begin + Result := DataController.GetInternalValue(ARecordIndex, AField); + if VarIsNull(Result) then + Result := DefValue + end + else + Result := DefValue +end; + +procedure TcxSchedulerDBStorageResources.SetInternalFieldName( + var AFieldName: TcxFieldName; const AValue: TcxFieldName; + var AField: TcxDBDataField); +begin + if AFieldName <> AValue then + begin + AFieldName := AValue; + DataController.UpdateInternalKeyFields(AValue, AField); + end; +end; + +procedure TcxSchedulerDBStorageResources.UpdateResourceItems; +var + I, J: Integer; + APrevItems: TcxSchedulerStorageResourceItems; +begin + APrevItems := FDataItems; + FDataItems := CreateItems; + try + for I := 0 to DataController.RecordCount - 1 do + InitDataItem(FDataItems.Add, I); + for I := 0 to FDataItems.Count - 1 do + for J := 0 to APrevItems.Count - 1 do + if VarEquals(FDataItems[I].ResourceID, APrevItems[J].ResourceID) then + with FDataItems[I] do + begin + Assign(APrevItems[J]); + ResourceID := GetValueDef(I, ResourceIDField, ResourceID); + ImageIndex := GetValueDef(I, ResourceImageIndexField, -1); + Name := GetValueDef(I, ResourceNameField, Name); + Color := GetValueDef(I, ResourceColorField, Color); + end; + finally + APrevItems.Free; + Changed; + end; +end; + +function TcxSchedulerDBStorageResources.GetDataSource: TDataSource; +begin + Result := DataController.DataSource; +end; + +procedure TcxSchedulerDBStorageResources.SetDataSource( + AValue: TDataSource); +begin + DataController.DataSource := AValue; +end; + +procedure TcxSchedulerDBStorageResources.SetResourceColorFieldName( + const AValue: TcxFieldName); +begin + SetInternalFieldName(FResourceColorFieldName, AValue, FResourceColorField); +end; + +procedure TcxSchedulerDBStorageResources.SetResourceIDFieldName( + const AValue: TcxFieldName); +begin + SetInternalFieldName(FResourceIDFieldName, AValue, FResourceIDField); +end; + +procedure TcxSchedulerDBStorageResources.SetResourceImageIndexFieldName( + const AValue: TcxFieldName); +begin + SetInternalFieldName(FResourceImageIndexFieldName, AValue, FResourceImageIndexField); +end; + +procedure TcxSchedulerDBStorageResources.SetResourceNameFieldName( + const AValue: TcxFieldName); +begin + SetInternalFieldName(FResourceNameFieldName, AValue, FResourceNameField); +end; + +{ TcxSchedulerDBStorage } + +procedure TcxSchedulerDBStorage.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerDBStorage then + begin + FieldNames := TcxSchedulerDBStorage(Source).FieldNames; + DataSource := TcxSchedulerDBStorage(Source).DataSource; + end; + inherited Assign(Source); +end; + +function TcxSchedulerDBStorage.CheckRequiredFields: Boolean; +var + S: string; +begin + Result := IsDataSettingsValid; + if not Result then + begin + S := ''; + if (FieldNames.ID = '') then + S := S + ' · ID'#13#10; + if not IsFieldValid(FEventTypeField) then + S := S + ' · EventType'#13#10; + if not IsFieldValid(FStartField) then + S := S + ' · Start'#13#10; + if not IsFieldValid(FFinishField) then + S := S + ' · Finish'#13#10; + if not IsFieldValid(FOptionsField) then + S := S + ' · Options'#13#10; + + + cxSchedulerError(scxRequiredFieldsNeeded, [S]); + end; +end; + +procedure TcxSchedulerDBStorage.Clear; +begin + DataController.BeginUpdate; + try + DataController.Cancel; + if IsActive then + begin + DataSet.DisableControls; + try + while DataSet.RecordCount > 0 do + DataSet.Delete; + finally + DataSet.EnableControls; + end; + DataController.RecordCount := 0; + end; + finally + DataController.EndUpdate; + end; +end; + +function TcxSchedulerDBStorage.IsActive: Boolean; +begin + Result := (DataSource <> nil) and (DataSet <> nil) and + DataSet.Active +end; + +function TcxSchedulerDBStorage.IsCaptionAvailable: Boolean; +begin + Result := IsFieldValid(FCaptionField); +end; + +function TcxSchedulerDBStorage.IsLabelColorAvailable: Boolean; +begin + Result := IsFieldValid(FLabelColorField); +end; + +function TcxSchedulerDBStorage.IsLocationAvailable: Boolean; +begin + Result := IsFieldValid(FLocationField); +end; + +function TcxSchedulerDBStorage.IsMessageAvailable: Boolean; +begin + Result := IsFieldValid(FMessageField); +end; + +function TcxSchedulerDBStorage.IsRecurrenceAvailable: Boolean; +begin + Result := IsFieldValid(FRecurrenceInfoField) and + IsFieldValid(FRecurrenceIndexField); +end; + +function TcxSchedulerDBStorage.IsReminderAvailable: Boolean; +begin + Result := IsFieldValid(FReminderMinutesBeforeStartField); +end; + +function TcxSchedulerDBStorage.IsReminderByResourceAvailable: Boolean; +begin + Result := IsReminderAvailable and IsFieldValid(FReminderResourcesData); +end; + +function TcxSchedulerDBStorage.IsStateAvailable: Boolean; +begin + Result := IsFieldValid(FStateField); +end; + +procedure TcxSchedulerDBStorage.PostEvents; +var + APrevState: Boolean; +begin + if not IsActive or (FNewEvents.Count = 0) then Exit; + APrevState := SmartRefresh; + SmartRefresh := False; + DataSet.DisableControls; + try + BeginUpdate; + try + while FNewEvents.Count <> 0 do FNewEvents.Last.Post; + finally + EndUpdate; + end; + finally + DataSet.EnableControls; + SmartRefresh := APrevState; + end; +end; + +procedure TcxSchedulerDBStorage.UpdateItems; +begin + DataController.UpdateItems(False); +end; + +procedure TcxSchedulerDBStorage.BeginUpdateDataController; +begin + Inc(LockCount); + if not SmartRefresh then + DataSet.DisableControls; +end; + +procedure TcxSchedulerDBStorage.EndUpdateDataController; +begin + Dec(LockCount); + if not SmartRefresh then + DataSet.EnableControls + else + if LockCount = 0 then FullRefresh; +end; + +function TcxSchedulerDBStorage.ActualTimeRangeAvailable: Boolean; +begin + Result := inherited ActualTimeRangeAvailable and + IsFieldValid(FActualFinishField) and IsFieldValid(FActualStartField); +end; + +procedure TcxSchedulerDBStorage.AddRecord; +begin + if not SmartRefresh then + DataSet.Append + else + DataController.Append; +end; + +function TcxSchedulerDBStorage.CreateFieldNames: TcxSchedulerDBStorageFieldNames; +begin + Result := TcxSchedulerDBStorageFieldNames.Create(Self); +end; + +function TcxSchedulerDBStorage.CreateFields: TcxCustomSchedulerStorageFields; +begin + Result := TcxSchedulerDBStorageFields.Create(TcxSchedulerDBStorageField); +end; + +function TcxSchedulerDBStorage.CreateResources: TcxSchedulerStorageResources; +begin + Result := TcxSchedulerDBStorageResources.Create(Self); +end; + +procedure TcxSchedulerDBStorage.CreateSubClasses; +begin + inherited CreateSubClasses; + FFieldNames := CreateFieldNames; +end; + +procedure TcxSchedulerDBStorage.DestroySubClasses; +begin + inherited DestroySubClasses; + FFieldNames.Free; +end; + +function TcxSchedulerDBStorage.DoGetEventGeneratedID(AEvent: TcxSchedulerEvent; + const AEventID: Variant): Variant; +begin + Result := AEventID; + if Assigned(FOnGetEventGeneratedID) then + FOnGetEventGeneratedID(Self, AEvent, Result); +end; + +function TcxSchedulerDBStorage.GetDataControllerClass: TcxCustomDataControllerClass; +begin + Result := TcxSchedulerDBStorageDataController; +end; + +function TcxSchedulerDBStorage.GetField( + AIndex: Integer): TField; +begin + Result := DataController.GetItemField(AIndex); +end; + +function TcxSchedulerDBStorage.GetIDField: TField; +begin + if FIDField = nil then + FIDField := DataSet.FieldByName(FieldNames.ID); + Result := FIDField; +end; + +function TcxSchedulerDBStorage.GetFieldValueBeforePost( + ARecordIndex, AFieldIndex: Integer): Variant; +var + AField: TField; +begin + AField := GetField(AFieldIndex); + if (AField <> nil) then + Result := GetFieldValue(AField) + else + Result := Null; +end; + +function TcxSchedulerDBStorage.GetFieldValueTypeClass( + AField: TcxCustomSchedulerStorageField): TcxValueTypeClass; +begin + if (AField = nil) and (IDField <> nil) then + Result := GetValueTypeClassByField(IDField) + else + Result := inherited GetFieldValueTypeClass(AField) +end; + +function TcxSchedulerDBStorage.GetFocusedRecordID(ARecordIndex: Integer): Variant; +begin + Result := GetIDField.Value; +end; + +function TcxSchedulerDBStorage.IsDataSettingsValid: Boolean; +begin + Result := IsActive and (FieldNames.ID <> '') {and IsFieldValid(FParentIDField)} and + IsFieldValid(FEventTypeField) and IsFieldValid(FOptionsField) and + IsFieldValid(FStartField) and IsFieldValid(FFinishField); +end; + +function TcxSchedulerDBStorage.IsFieldValid( + AField: TcxCustomSchedulerStorageField): Boolean; +begin + Result := GetField(AField.Index) <> nil; +end; + +procedure TcxSchedulerDBStorage.SetFieldValueBeforePost( + ARecordIndex, AFieldIndex: Integer; const AValue: Variant); +begin + if SmartRefresh then + with DataController do + begin + if not VarEqualsSoft(GetEditValue(AFieldIndex, evsValue), AValue) then + SetEditValue(AFieldIndex, AValue, evsValue) + end + else + begin + CheckAndSetFieldValue(GetField(AFieldIndex), AValue); + DataController.Values[ARecordIndex, AFieldIndex] := AValue; + end; +end; + +procedure TcxSchedulerDBStorage.SetValue( + ARecordIndex, AItemIndex: Integer; const AValue: Variant); +begin + SetFieldValue(DataController.GetItemField(AItemIndex), AValue); +end; + +function TcxSchedulerDBStorage.MakeFocused( + AEvent: TcxSchedulerEvent): Boolean; +begin + if SmartRefresh then + begin + DataController.FocusedRecordIndex := AEvent.RecordIndex; + Result := AEvent.RecordIndex = DataController.FocusedRecordIndex; + end + else + begin + Result := VarEquals(AEvent.ID, GetIDField.Value); + if not Result then + begin + DataSet.Locate(FieldNames.ID, AEvent.ID, []); + Result := VarEquals(AEvent.ID, GetIDField.Value); + end; + end; +end; + +procedure TcxSchedulerDBStorage.PostEvent(AEvent: TcxSchedulerEvent); +var + AIndex: Integer; +begin + if not CheckRequiredFields then + begin + AEvent.Free; + Exit; + end; + BeginUpdate; + try + try + AIndex := FNewEvents.Remove(AEvent); + if AIndex <> -1 then + begin + FEventsList.Add(AEvent); + SetEventRecordInfo(AEvent, -1, Null); + if DoEventInserted(AEvent) then Exit; + AddRecord; + AEvent.EndEditing; + end; + except + FEventsList.Remove(AEvent); + AEvent.Free; + DataController.Cancel; + raise; + end; + finally + EndUpdate; + end; +end; + +procedure TcxSchedulerDBStorage.PostEditingData( + AEvent: TcxSchedulerEvent); +var + AEventID: Variant; + AFieldIndex: Integer; +begin + FIDField := nil; + if DoEventModified(AEvent) or not IsDataSettingsValid then Exit; + if (AEvent.RecordIndex <> -1) and (not DataController.IsEditing or + (AEvent.RecordIndex <> DataController.EditingRecordIndex)) then + begin + if not MakeFocused(AEvent) then Exit; + DataController.Edit; + end; + for AFieldIndex := 0 to AEvent.ValueCount - 1 do + SetPostFieldValue(AEvent, AFieldIndex); + if AEvent.RecordIndex = - 1 then + begin + if GenerateGUIDForID then + begin + AEventID := CreateGUIDForID; + IDField.Value := AEventID; + end; + if not SmartRefresh then + DataSet.Post + else + DataController.Post; + if not GenerateGUIDForID then + AEventID := DoGetEventGeneratedID(AEvent, IDField.Value); + SetEventRecordInfo(AEvent, -1, AEventID); + end + else + DataController.Post; +end; + +function TcxSchedulerDBStorage.GetDataController: TcxSchedulerDBStorageDataController; +begin + Result := TcxSchedulerDBStorageDataController(inherited DataController); +end; + +function TcxSchedulerDBStorage.GetDataSet: TDataSet; +begin + Result := DataSource.DataSet; +end; + +function TcxSchedulerDBStorage.GetDataSource: TDataSource; +begin + Result := TcxSchedulerDBStorageDataController(DataController).DataSource; +end; + +function TcxSchedulerDBStorage.GetCustomFields: TcxSchedulerDBStorageFields; +begin + Result := TcxSchedulerDBStorageFields(inherited CustomFields); +end; + +function TcxSchedulerDBStorage.GetResources: TcxSchedulerDBStorageResources; +begin + Result := TcxSchedulerDBStorageResources(inherited Resources); +end; + +function TcxSchedulerDBStorage.GetSmartRefresh: Boolean; +begin + Result := DataController.DataModeController.SmartRefresh; +end; + +procedure TcxSchedulerDBStorage.SetDataSource( + AValue: TDataSource); +begin + DataController.DataSource := AValue; +end; + +procedure TcxSchedulerDBStorage.SetCustomFields( + const AValue: TcxSchedulerDBStorageFields); +begin + CustomFields.Assign(AValue); +end; + +procedure TcxSchedulerDBStorage.SetFieldNames( + AValue: TcxSchedulerDBStorageFieldNames); +begin + FFieldNames.Assign(AValue); +end; + +procedure TcxSchedulerDBStorage.SetResources( + AValue: TcxSchedulerDBStorageResources); +begin + Resources.Assign(AValue); +end; + +procedure TcxSchedulerDBStorage.SetSmartRefresh(AValue: Boolean); +begin + if SmartRefresh <> AValue then + DataController.DataModeController.SmartRefresh := AValue; +end; + +end. + + diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerDateNavigator.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerDateNavigator.pas new file mode 100644 index 00000000..80f2f52c --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerDateNavigator.pas @@ -0,0 +1,3353 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerDateNavigator; + +{$I cxVer.Inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, +{$ELSE} + MultiMon, +{$ENDIF} + Windows, SysUtils, Classes, Controls, Graphics, ExtCtrls, + cxSchedulerCustomControls, cxSchedulerUtils, cxContainer, cxClasses, + cxGraphics, cxLookAndFeelPainters, cxStyles, cxControls, cxDateUtils; + +const + // hit test codes + htcCalendar = 2; + htcDayCaptions = 3; + htcMonthName = 4; + htcNextMonth = 5; + htcPrevMonth = 6; + htcWeekSelectionBar = 7; + + // style indexes + cxdnBackground = 0; + cxdnContent = 1; + cxdnHeader = 2; + cxdnSelection = 3; + //for PS + cxcsDateNavigatorFirst = cxdnBackground; + cxcsDateNavigatorLast = cxdnSelection; + + cxDaysCalendarMaxColCount = 8; + cxMaxMonthViewInfoDays = 6 * 7; + cxMaxWeekCount = 6; + +type + TcxSchedulerDateNavigatorDayNumberViewInfo = class; + TcxSchedulerDateNavigatorMonthHeaderViewInfo = class; + TcxSchedulerDateNavigatorMonthContentViewInfo = class; + TcxSchedulerDateNavigatorMonthViewInfo = class; + TcxSchedulerDateNavigatorViewInfo = class; + TcxSchedulerDateNavigator = class; + TcxSchedulerDateNavigatorViewInfoClass = class of TcxSchedulerDateNavigatorViewInfo; + TcxCustomSchedulerAccess = class(TcxCustomScheduler); + + { TcxSchedulerDateNavigatorPainter } + + TcxSchedulerDateNavigatorPainter = class(TcxSchedulerSubControlPainter) + private + FHeaderParams: TcxViewParams; //for callback procedure + FDateNavigator: TcxSchedulerDateNavigator; + FHeaderTransparent: Boolean; + procedure CheckDrawFrame(const ABounds: TRect; ADate: TDateTime); + function DrawHeaderBackground(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; + protected + procedure DoDrawDayCaptions(AViewInfo: TcxSchedulerDateNavigatorMonthContentViewInfo); virtual; + procedure DoDrawDayNumbers(AViewInfo: TcxSchedulerDateNavigatorMonthContentViewInfo); virtual; + procedure DoDrawMonthContent(AViewInfo: TcxSchedulerDateNavigatorMonthContentViewInfo); virtual; + procedure DoDrawMonthHeader(AViewInfo: TcxSchedulerDateNavigatorMonthHeaderViewInfo); virtual; + procedure DrawBackground; virtual; + procedure DrawDayNumber(ADayInfo: TcxSchedulerDateNavigatorDayNumberViewInfo); + procedure DrawMonthHeader(AViewInfo: TcxSchedulerDateNavigatorMonthHeaderViewInfo); virtual; + procedure DrawSeparators(AViewInfo: TcxSchedulerDateNavigatorMonthContentViewInfo); virtual; + procedure DrawWeekNumbers(AViewInfo: TcxSchedulerDateNavigatorMonthContentViewInfo); virtual; + property DateNavigator: TcxSchedulerDateNavigator read FDateNavigator; + public + constructor Create(AOwner: TcxSchedulerSubControl); override; + procedure Paint; override; + end; + + TcxSchedulerDateNavigatorPainterClass = class of TcxSchedulerDateNavigatorPainter; + + { TcxSchedulerDateNavigatorCaptionViewInfo } + + TcxSchedulerDateNavigatorCaptionViewInfo = class + private + FBounds: TRect; + FSaveParams: TcxViewParams; + FText: string; + FTransparent: Boolean; + FViewParams: TcxViewParams; + protected + procedure RestoreParams; + procedure SaveParams(ATransparent: Boolean); + + property Text: string read FText write FText; + property Transparent: Boolean read FTransparent write FTransparent; + public + property Bounds: TRect read FBounds; + property ViewParams: TcxViewParams read FViewParams write FViewParams; + end; + + { TcxSchedulerDateNavigatorDayNumberViewInfo } + + TcxSchedulerDateNavigatorDayNumberViewInfo = class(TcxSchedulerDateNavigatorCaptionViewInfo) + private + FBold: Boolean; + FDate: TDateTime; + FGrayed: Boolean; + FHoliday: Boolean; + FSelected: Boolean; + FSelectionSideBounds: TRect; + public + property Bold: Boolean read FBold write FBold; + property Bounds; + property Date: TDateTime read FDate; + property Grayed: Boolean read FGrayed; + property Holiday: Boolean read FHoliday; + property Selected: Boolean read FSelected; + property SelectionSideBounds: TRect read FSelectionSideBounds; + property Text; + property Transparent; + property ViewParams; + end; + + { TcxSchedulerDateNavigatorDayCaptionViewInfo } + + TcxSchedulerDateNavigatorDayCaptionViewInfo = class(TcxSchedulerDateNavigatorCaptionViewInfo) + private + FIndex: Byte; + public + property Bounds; + property Index: Byte read FIndex; + property Text; + property Transparent; + property ViewParams; + end; + + { TcxSchedulerDateNavigatorMonthHeaderViewInfo } + + TcxSchedulerDateNavigatorMonthHeaderViewInfo = class(TcxSchedulerDateNavigatorCaptionViewInfo) + private + FArrows: TcxHeaderArrows; + FNeighbors: TcxNeighbors; + FOwner: TcxSchedulerDateNavigatorMonthViewInfo; + FMonthNameBounds: TRect; + function GetCalendar: TcxCustomCalendarTable; + function GetEra: Integer; + function GetMonth: Integer; + function GetMonthNameBounds: TRect; + function GetYear: Integer; + protected + procedure Calculate(const ABounds: TRect); virtual; + public + constructor Create(AOwner: TcxSchedulerDateNavigatorMonthViewInfo); + property Arrows: TcxHeaderArrows read FArrows; + property Bounds; + property Calendar: TcxCustomCalendarTable read GetCalendar; + property Era: Integer read GetEra; + property Month: Integer read GetMonth; + property Neighbors: TcxNeighbors read FNeighbors; + property MonthNameBounds: TRect read FMonthNameBounds; + property Owner: TcxSchedulerDateNavigatorMonthViewInfo read FOwner; + property Text; + property Transparent; + property ViewParams; + property Year: Integer read GetYear; + end; + + { TcxSchedulerDateNavigatorMonthContentViewInfo } + + TcxSchedulerDateNavigatorMonthContentViewInfo = class + private + FBounds: TRect; + FCol: Integer; + FRow: Integer; + FDate: TcxDateTime; + FDateNavigator: TcxSchedulerDateNavigator; + FDays: array[0..cxMaxMonthViewInfoDays - 1] of TcxSchedulerDateNavigatorDayNumberViewInfo; + FDayCount: Integer; + FDayCaptions: array[0..6] of TcxSchedulerDateNavigatorDayCaptionViewInfo; + FFont: TFont; + FFontCharset: TFontCharset; + FHorzSeparatorBound: TRect; + FOwner: TcxSchedulerDateNavigatorMonthViewInfo; + FSaveParams: TcxViewParams; + FSelectedParams: TcxViewParams; + FTransparent: Boolean; + FVertSeparatorBound: TRect; + FViewInfo: TcxSchedulerDateNavigatorViewInfo; + FViewParams: TcxViewParams; + FWeekBounds: array[0..5] of TRect; + FWeekCount: Integer; + FWeekTexts: array[0..5] of string; + FWeekSelectionBarBounds: TRect; + procedure CreateDayInfos; + procedure CreateDayCaptionInfos; + procedure DestroyDayInfos; + procedure DestroyDayCaptionInfos; + function GetCalendar: TcxCustomCalendarTable; + function GetDayCaptionInfo(Index: Byte): TcxSchedulerDateNavigatorDayCaptionViewInfo; + function GetDayRectFromColAndRow(ACol, ARow: Integer): TRect; + function GetDayNumberViewInfo(Index: Byte): TcxSchedulerDateNavigatorDayNumberViewInfo; + function GetEra: Integer; + function GetGrayed(ADate: TDateTime): Boolean; + function GetMonth: Integer; + function GetSelectionSideBounds(const ADayBounds: TRect; ACol: Integer): TRect; + function GetYear: Integer; + function IsValidDayIndex(Index: Byte): Boolean; + function IsValidDayCaptionIndex(Index: Byte): Boolean; + function IsValidWeekIndex(Index: Byte): Boolean; + procedure SetWeekText(Index: Byte; const Value: string); + protected + procedure CalcAndAddDayInfo(ADate: TDateTime; const ABounds: TRect; + const ASelectionSideBounds: TRect); + procedure Calculate(ACol, ARow: Integer; ADate: TcxDateTime); virtual; + procedure CalcDays; virtual; + procedure CalcDayCaptions; virtual; + procedure CalcParams; virtual; + procedure CalcSeparatorsBound; virtual; + function GetDateViewParams(ADate: TDateTime; ASelected: Boolean): TcxViewParams; virtual; + function GetDayText(ADate: TDateTime): string; virtual; + function GetDayCaptionText(Index: Byte): string; virtual; + function GetWeekBound(Index: Byte): TRect; virtual; + function GetWeekText(Index: Byte): string; virtual; + procedure RestoreParams; + procedure SaveParams; + procedure UpdateElementsAfterCustomDraw(ACanvas: TcxCanvas); + + property Calendar: TcxCustomCalendarTable read GetCalendar; + property DateNavigator: TcxSchedulerDateNavigator read FDateNavigator; + property Font: TFont read FFont; + property FontCharset: TFontCharset read FFontCharset; + property Owner: TcxSchedulerDateNavigatorMonthViewInfo read FOwner; + property ViewInfo: TcxSchedulerDateNavigatorViewInfo read FViewInfo; + property WeekSelectionBarBounds: TRect read FWeekSelectionBarBounds; + public + constructor Create(AOwner: TcxSchedulerDateNavigatorMonthViewInfo); virtual; + destructor Destroy; override; + + property Bounds: TRect read FBounds; + property Col: Integer read FCol; + property DayCount: Integer read FDayCount; + property Days[Index: Byte]: TcxSchedulerDateNavigatorDayNumberViewInfo read GetDayNumberViewInfo; + property DayCaptions[Index: Byte]: TcxSchedulerDateNavigatorDayCaptionViewInfo read GetDayCaptionInfo; + property Era: Integer read GetEra; + property HorzSeparatorBound: TRect read FHorzSeparatorBound; + property Month: Integer read GetMonth; + property Row: Integer read FRow; + property SelectedParams: TcxViewParams read FSelectedParams; + property Transparent: Boolean read FTransparent write FTransparent; + property VertSeparatorBound: TRect read FVertSeparatorBound; + property ViewParams: TcxViewParams read FViewParams; + property WeekCount: Integer read FWeekCount; + property WeekBounds[Index: Byte]: TRect read GetWeekBound; + property WeekTexts[Index: Byte]: string read GetWeekText write SetWeekText; + property Year: Integer read GetYear; + end; + + { TcxSchedulerDateNavigatorMonthViewInfo } + + TcxSchedulerDateNavigatorMonthViewInfo = class + private + FBounds: TRect; + FCol: Integer; + FDate: TcxDateTime; + FRow: Integer; + FContent: TcxSchedulerDateNavigatorMonthContentViewInfo; + FHeader: TcxSchedulerDateNavigatorMonthHeaderViewInfo; + FOwner: TcxSchedulerDateNavigatorViewInfo; + function GetEra: Integer; + function GetMonth: Integer; + function GetYear: Integer; + protected + procedure Calculate(ACol, ARow: Integer; ADate: TcxDateTime); virtual; + function GetHeaderArrows: TcxHeaderArrows; + function GetHeaderNeighbors: TcxNeighbors; + + property Owner: TcxSchedulerDateNavigatorViewInfo read FOwner; + public + constructor Create(AOwner: TcxSchedulerDateNavigatorViewInfo); virtual; + destructor Destroy; override; + + property Bounds: TRect read FBounds; + property Col: Integer read FCol; + property Content: TcxSchedulerDateNavigatorMonthContentViewInfo read FContent; + property Era: Integer read GetEra; + property Header: TcxSchedulerDateNavigatorMonthHeaderViewInfo read FHeader; + property Month: Integer read GetMonth; + property Row: Integer read FRow; + property Year: Integer read GetYear; + end; + + { TcxSchedulerDateNavigatorViewInfo } + + TcxSchedulerDateNavigatorViewInfo = class(TcxSchedulerSubControlViewInfo) + private + FCalendarBounds: TRect; + FColCount: Integer; + FColWidth: Integer; + FContentParams: TcxViewParams; + FDayCaptionsHeight: Integer; + FHeaderBorderSize: Integer; + FHeaderHeight: Integer; + FHeaderParams: TcxViewParams; + FMonthSize: TSize; + FMonthViewInfoList: TList; + FOwner: TcxSchedulerDateNavigator; + FRowCount: Integer; + FRowHeight: Integer; + FSelectedParams: TcxViewParams; + FSideWidth: Integer; + procedure DestroyMonthViewInfoList; + function GetCalendar: TcxCustomCalendarTable; + function GetMonthViewInfo(ACol, ARow: Integer): TcxSchedulerDateNavigatorMonthViewInfo; + protected + procedure DoCalculate; override; + procedure CalculateCalendarBounds; + procedure CalculateInternalSizes; + procedure CalculateMonthViewInfos; + procedure CalculateViewParams; + procedure CheckMonthViewInfoCount; + function GetCol(X: Integer): Integer; + function GetHeaderRect(ACol, ARow: Integer): TRect; + function GetInternalRect(ACol, ARow: Integer): TRect; + function GetLeftArrowRect: TRect; + function GetMonthRect(ACol, ARow: Integer): TRect; + function GetRightArrowRect: TRect; + function GetRow(Y: Integer): Integer; + + property Calendar: TcxCustomCalendarTable read GetCalendar; + property CalendarBounds: TRect read FCalendarBounds; + property ColCount: Integer read FColCount; + property ColWidth: Integer read FColWidth; + property ContentParams: TcxViewParams read FContentParams; + property DayCaptionsHeight: Integer read FDayCaptionsHeight; + property HeaderBorderSize: Integer read FHeaderBorderSize; + property HeaderHeight: Integer read FHeaderHeight; + property HeaderParams: TcxViewParams read FHeaderParams; + property Owner: TcxSchedulerDateNavigator read FOwner; + property RowCount: Integer read FRowCount; + property RowHeight: Integer read FRowHeight; + property SelectedParams: TcxViewParams read FSelectedParams; + property SideWidth: Integer read FSideWidth; + public + constructor Create(AOwner: TcxSchedulerSubControl); override; + destructor Destroy; override; + property MonthSize: TSize read FMonthSize; + property MonthViewInfo[ACol, ARow: Integer]: TcxSchedulerDateNavigatorMonthViewInfo read GetMonthViewInfo; + end; + + { TcxSchedulerDateNavigatorStyles } + + TcxSchedulerDateNavigatorStyles = class(TcxStyles) + private + function GetDateNavigator: TcxSchedulerDateNavigator; + protected + procedure Changed(AIndex: Integer); override; + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + function GetBackgroundParams: TcxViewParams; + function GetContentParams: TcxViewParams; + function GetHeaderParams: TcxViewParams; + function GetSelectionParams: TcxViewParams; + property DateNavigator: TcxSchedulerDateNavigator read GetDateNavigator; + published + property Background: TcxStyle index cxdnBackground read GetValue write SetValue; + property Content: TcxStyle index cxdnContent read GetValue write SetValue; + property Header: TcxStyle index cxdnHeader read GetValue write SetValue; + property Selection: TcxStyle index cxdnSelection read GetValue write SetValue; + end; + + { TcxSchedulerDateNavigatorHitTest } + + TcxSchedulerDateNavigatorHitTest = class(TcxSchedulerSubControlHitTest) + private + FHitDate: TDateTime; + FMonthViewInfo: TcxSchedulerDateNavigatorMonthViewInfo; + function GetDatesBounds: TRect; + function GetFirstWeekSelectableDate: TDateTime; + function GetOwner: TcxSchedulerDateNavigator; + function GetViewInfo: TcxSchedulerDateNavigatorViewInfo; + protected + procedure Clear; override; + procedure DoCalculate; override; + procedure CalcMonth; virtual; + function CheckDayCaptions: Boolean; + function CheckMonthHeader: Boolean; + function CheckWeekSelectionBar: Boolean; + + property Owner: TcxSchedulerDateNavigator read GetOwner; + property ViewInfo: TcxSchedulerDateNavigatorViewInfo read GetViewInfo; + public + property HitAtCalendar: Boolean index htcCalendar read GetBitState; + property HitAtDayCaptions: Boolean index htcDayCaptions read GetBitState; + property HitAtMonthName: Boolean index htcMonthName read GetBitState; + property HitAtNextMonth: Boolean index htcNextMonth read GetBitState; + property HitAtPrevMonth: Boolean index htcPrevMonth read GetBitState; + property HitAtTime; + property HitAtWeekSelectionBar: Boolean index htcWeekSelectionBar read GetBitState; + property HitDate: TDateTime read FHitDate; + property MonthViewInfo: TcxSchedulerDateNavigatorMonthViewInfo read FMonthViewInfo; + property Time; + end; + + { TcxSchedulerDateNavigatorController } + + TcxSchedulerDateNavigatorController = class(TcxSchedulerSubControlController) + private + FCalculatedHintBounds: Boolean; + FDragDate: TDateTime; + FExtSelect: Boolean; + FHintText: string; + FIgnoreMouseMove: Boolean; + FSaveSelectionIsWeeks: Boolean; + FSaveSelectionList: TcxSchedulerDateList; + FSelFinish: TDateTime; + FSelStart: TDateTime; + FSingleSelection: Boolean; + FTimer: TTimer; + FUnselect: Boolean; + function GetHitTest: TcxSchedulerDateNavigatorHitTest; + function GetOwner: TcxSchedulerDateNavigator; + function GetViewInfo: TcxSchedulerDateNavigatorViewInfo; + procedure SetDragDate(const Value: TDateTime); + procedure StartTimer(AFuture: Boolean); + procedure StopTimer; + procedure TimerProc(Sender: TObject); + protected + //overriden + procedure DoCancelMode; override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); override; + function GetCursor(X, Y: Integer): TCursor; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseLeave; override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + // hint + procedure HideHint; virtual; + procedure ShowHint; virtual; + //methods + procedure CalculateSelection(AConcatenate: Boolean); virtual; + procedure ProcessSelectionOnMouseDown(AShift: TShiftState); + procedure ProcessSelectionOnMouseMove(AShift: TShiftState); + + property HitTest: TcxSchedulerDateNavigatorHitTest read GetHitTest; + property Owner: TcxSchedulerDateNavigator read GetOwner; + property ViewInfo: TcxSchedulerDateNavigatorViewInfo read GetViewInfo; + public + constructor Create(AOwner: TcxSchedulerSubControl); override; + destructor Destroy; override; + property DragDate: TDateTime read FDragDate write SetDragDate; + end; + + TcxSchedulerPeriodChangedEvent = procedure(Sender: TObject; + const AStart, AFinish: TDateTime) of object; + + TcxSchedulerDateNavigatorCustomDrawBackgroundEvent = procedure (Sender: TObject; + ACanvas: TcxCanvas; const ABounds: TRect; var AViewParams: TcxViewParams; + var ADone: Boolean) of object; + TcxSchedulerDateNavigatorCustomDrawDayNumberEvent = procedure (Sender: TObject; + ACanvas: TcxCanvas; AViewInfo: TcxSchedulerDateNavigatorDayNumberViewInfo; + var ADone: Boolean) of object; + TcxSchedulerDateNavigatorCustomDrawDayCaptionEvent = procedure (Sender: TObject; + ACanvas: TcxCanvas; AViewInfo: TcxSchedulerDateNavigatorDayCaptionViewInfo; + var ADone: Boolean) of object; + TcxSchedulerDateNavigatorCustomDrawContentEvent = procedure (Sender: TObject; + ACanvas: TcxCanvas; AViewInfo: TcxSchedulerDateNavigatorMonthContentViewInfo; + var ADone: Boolean) of object; + TcxSchedulerDateNavigatorCustomDrawHeaderEvent = procedure (Sender: TObject; + ACanvas: TcxCanvas; AViewInfo: TcxSchedulerDateNavigatorMonthHeaderViewInfo; + var ADone: Boolean) of object; + + TcxSchedulerDateNavigator = class(TcxSchedulerCustomDateNavigator) + private + FActualFirstWeekOfYear: TcxFirstWeekOfYear; + FCalendar: TcxCustomCalendarTable; + FFirstDate: TDateTime; + FFirstWeekOfYear: TcxFirstWeekOfYear; + FHolidayColor: TColor; + FLastDate: TDateTime; + FListBox: TcxCustomPopupWindow; + FListBoxDelta: Integer; + FRealFirstDate: TDateTime; + FRealLastDate: TDateTime; + FSelectionIsWeeks: Boolean; + FSelectPeriod: Boolean; + FShowDatesContainingEventsInBold: Boolean; + FShowDatesContainingHolidaysInColor: Boolean; + FShowWeekNumbers: Boolean; + FStyles: TcxSchedulerDateNavigatorStyles; + FToday: TDateTime; + FUnlimitedSelection: Boolean; + // custom draw + FOnCustomDrawBackground: TcxSchedulerDateNavigatorCustomDrawBackgroundEvent; + FOnCustomDrawContent: TcxSchedulerDateNavigatorCustomDrawContentEvent; + FOnCustomDrawDayCaption: TcxSchedulerDateNavigatorCustomDrawDayCaptionEvent; + FOnCustomDrawDayNumber: TcxSchedulerDateNavigatorCustomDrawDayNumberEvent; + FOnCustomDrawHeader: TcxSchedulerDateNavigatorCustomDrawHeaderEvent; + FOnPeriodChanged: TcxSchedulerPeriodChangedEvent; + FOnSelectionChanged: TcxSchedulerPeriodChangedEvent; + function GetActualFirstWeekOfYear: TcxFirstWeekOfYear; + function GetColCount: Integer; + function GetController: TcxSchedulerDateNavigatorController; + function GetDate: TDateTime; + function GetHitTest: TcxSchedulerDateNavigatorHitTest; + function GetLastDate: TDateTime; + function GetRowCount: Integer; + function GetSelectPeriod: Boolean; + function GetViewInfo: TcxSchedulerDateNavigatorViewInfo; + procedure SetColCount(Value: Integer); + procedure SetDate(Value: TDateTime); + procedure SetFirstWeekOfYear(Value: TcxFirstWeekOfYear); + procedure SetHolidayColor(AValue: TColor); + procedure SetRowCount(Value: Integer); + procedure SetSelectPeriod(Value: Boolean); + procedure SetShowDatesContainingEventsInBold(Value: Boolean); + procedure SetShowDatesContainingHolidaysInColor(Value: Boolean); + procedure SetShowWeekNumbers(Value: Boolean); + procedure SetStyles(const Value: TcxSchedulerDateNavigatorStyles); + procedure SetUnlimitedSelection(Value: Boolean); + protected + IsLocked: Boolean; + // store interface + procedure GetProperties(AProperties: TStrings); override; + procedure GetPropertyValue(const AName: string; var AValue: Variant); override; + procedure SetPropertyValue(const AName: string; const AValue: Variant); override; + // + function AllowDesignHitTest(X, Y: Integer; Shift: TShiftState): Boolean; override; + procedure BoundsChanged; override; + function CanCalculateViewInfo: Boolean; + procedure CheckSizes; override; + procedure CheckCurrentDate; override; + procedure ClearDragging; override; + procedure CreateSubClasses; override; + function CreateController: TcxSchedulerSubControlController; override; + function CreateHitTest: TcxSchedulerSubControlHitTest; override; + function CreatePainter: TcxSchedulerSubControlPainter; override; + function CreateViewInfo: TcxSchedulerSubControlViewInfo; override; + procedure DestroySubClasses; override; + procedure DoLayoutChanged; override; + //methods + function CanDrawSelectionSide: Boolean; + procedure CheckSelectionBounds; virtual; + procedure DoSelectionChanged; virtual; + procedure DoPeriodChangedEvent; override; + procedure DoSelectionChangedEvent; override; + procedure DoScrollSelection(AScrollDelta: Integer); override; + procedure DoScrollSelection(AForward: Boolean; + ANeedDate: TDateTime; AIsByPage: Boolean); override; + procedure EnsureSelectionVisible; + procedure GetCalendarDimension(out AColCount, ARowCount: Integer); override; + function IsDateSelected(ADate: TDateTime): Boolean; virtual; + function IsDateHasEvent(ADate: TDateTime): Boolean; virtual; + function IsDateHasHoliday(ADate: TDateTime): Boolean; virtual; + procedure Loaded; override; + procedure FormatChanged; override; + function GetMonthSize: TSize; override; + function GetRealFirstDate: TDateTime; override; + function GetRealLastDate: TDateTime; override; + function GetShowDatesContainingEventsInBold: Boolean; override; + function GetShowDatesContainingHolidaysInColor: Boolean; override; + procedure MakeSelectionVisible; override; + procedure RefreshDays; + procedure SetFirstDate(Value: TDateTime); virtual; + procedure ShowMonthPopup(AMonthInfo: TcxSchedulerDateNavigatorMonthViewInfo); virtual; + procedure StepToPast; + procedure StepToFuture; + procedure UpdateCalculatedValues; virtual; + procedure UpdateDragging; override; + procedure UpdateLastDates; + procedure UpdateSelection; override; + procedure VisibleChanged; override; + // support custom draw + procedure AfterCustomDraw(ACanvas: TcxCanvas; var AParams: TcxViewParams); virtual; + procedure BeforeCustomDraw(ACanvas: TcxCanvas; const AParams: TcxViewParams); virtual; + function DoCustomDrawBackground(ACanvas: TcxCanvas; + const ABounds: TRect; var AViewParams: TcxViewParams): Boolean; virtual; + function DoCustomDrawDayNumber(ACanvas: TcxCanvas; + ADayInfo: TcxSchedulerDateNavigatorDayNumberViewInfo): Boolean; virtual; + function DoCustomDrawDayCaption(ACanvas: TcxCanvas; + ADayCaptionInfo: TcxSchedulerDateNavigatorDayCaptionViewInfo): Boolean; virtual; + function DoCustomDrawContent(ACanvas: TcxCanvas; + AViewInfo: TcxSchedulerDateNavigatorMonthContentViewInfo): Boolean; virtual; + function DoCustomDrawHeader(ACanvas: TcxCanvas; + AViewInfo: TcxSchedulerDateNavigatorMonthHeaderViewInfo): Boolean; virtual; + + property Calendar: TcxCustomCalendarTable read FCalendar; + property Controller: TcxSchedulerDateNavigatorController read GetController; + property UnlimitedSelection: Boolean read FUnlimitedSelection write SetUnlimitedSelection; + property ViewInfo: TcxSchedulerDateNavigatorViewInfo read GetViewInfo; + public + constructor Create(AOwner: TcxCustomScheduler); override; + destructor Destroy; override; + + procedure AssignProperties(ASource: TcxSchedulerDateNavigator); virtual; + procedure SetIntegralSizes; override; + + property ActualFirstWeekOfYear: TcxFirstWeekOfYear read FActualFirstWeekOfYear; + property Date: TDateTime read GetDate write SetDate; + property FirstDate: TDateTime read FFirstDate write SetFirstDate; + property HitTest: TcxSchedulerDateNavigatorHitTest read GetHitTest; + property LastDate: TDateTime read FLastDate; + property RealFirstDate: TDateTime read FRealFirstDate; + property RealLastDate: TDateTime read FRealLastDate; + property SelectionIsWeeks: Boolean read FSelectionIsWeeks write FSelectionIsWeeks; + property SelectionList: TcxSchedulerDateList read GetSelection; + property SelectPeriod: Boolean read GetSelectPeriod write SetSelectPeriod; + published + property ColCount: Integer read GetColCount write SetColCount default 1; + property FirstWeekOfYear: TcxFirstWeekOfYear + read FFirstWeekOfYear write SetFirstWeekOfYear default fwySystem; + property HolidayColor: TColor read FHolidayColor write SetHolidayColor default clRed; + property RowCount: Integer read GetRowCount write SetRowCount default 1; + property ShowDatesContainingEventsInBold: Boolean + read FShowDatesContainingEventsInBold write SetShowDatesContainingEventsInBold default True; + property ShowDatesContainingHolidaysInColor: Boolean + read FShowDatesContainingHolidaysInColor write SetShowDatesContainingHolidaysInColor default False; + property ShowWeekNumbers: Boolean read FShowWeekNumbers write SetShowWeekNumbers default True; + property Styles: TcxSchedulerDateNavigatorStyles read FStyles write SetStyles; + property Visible default True; + + property OnCustomDrawBackground: TcxSchedulerDateNavigatorCustomDrawBackgroundEvent + read FOnCustomDrawBackground write FOnCustomDrawBackground; + property OnCustomDrawDayCaption: TcxSchedulerDateNavigatorCustomDrawDayCaptionEvent + read FOnCustomDrawDayCaption write FOnCustomDrawDayCaption; + property OnCustomDrawDayNumber: TcxSchedulerDateNavigatorCustomDrawDayNumberEvent + read FOnCustomDrawDayNumber write FOnCustomDrawDayNumber; + property OnCustomDrawContent: TcxSchedulerDateNavigatorCustomDrawContentEvent + read FOnCustomDrawContent write FOnCustomDrawContent; + property OnCustomDrawHeader: TcxSchedulerDateNavigatorCustomDrawHeaderEvent + read FOnCustomDrawHeader write FOnCustomDrawHeader; + property OnPeriodChanged: TcxSchedulerPeriodChangedEvent read FOnPeriodChanged + write FOnPeriodChanged; + property OnSelectionChanged: TcxSchedulerPeriodChangedEvent read FOnSelectionChanged + write FOnSelectionChanged; + end; + +implementation + +uses +{$IFDEF DELPHI6} + DateUtils, +{$ENDIF} + cxGeometry, Forms, cxFormats, cxLibraryConsts; + +const + cxDateStartNavigatorTime = 400; + cxDateNavigatorTime = 200; + cxdnTextFlags = cxSingleLine + cxAlignVCenter + cxAlignRight; + +function Max(A, B: Integer): Integer; +begin + if A > B then Result := A else Result := B; +end; + +function Min(A, B: Integer): Integer; +begin + if A < B then Result := A else Result := B; +end; + +function ChangeMonthByCalendar(ADate: TDateTime; AFirstDay: Boolean; + Delta: Integer; ACalendar: TcxCustomCalendarTable): TDateTime; +var + AConvertDate: TcxDateTime; +begin + Result := NullDate; + if ACalendar = nil then + Exit; + AConvertDate := ACalendar.FromDateTime(ACalendar.AddMonths(ADate, Delta)); + if AFirstDay then + AConvertDate.Day := 1 + else + AConvertDate.Day := ACalendar.GetDaysInMonth(AConvertDate.Year, AConvertDate.Month); + Result := Trunc(ACalendar.ToDateTime(AConvertDate)); +end; + +function CheckDay(ADate: TcxDateTime; ACalenadr: TcxCustomCalendarTable): Integer; +begin + with ADate do + if Day < 1 then Result := 1 + else + if Day > ACalenadr.GetDaysInMonth(Era, Year, Month) then + Result := ACalenadr.GetDaysInMonth(Era, Year, Month) + else Result := Day; +end; + +function ColOfDate(ADate: TDateTime; StartOfWeek: TcxDayOfWeek): Integer; +begin + Result := DayOfWeek(ADate) - StartOfWeek - 1; + if Result < 0 then Inc(Result, 7); +end; + +type + + { TcxSchedulerMonthListBox } + + TcxSchedulerMonthListBox = class(TcxCustomPopupWindow) + private + FOwner: TcxSchedulerDateNavigator; + FOrigin: TPoint; + FTopDate: TDateTime; + FItemHeight: Integer; + FItemIndex: Integer; + FItems: TStrings; + FTimer: TTimer; + FSign: Integer; + function GetDate: TDateTime; + function GetViewInfo: TcxSchedulerDateNavigatorViewInfo; + procedure SetItemIndex(Value: Integer); + procedure SetTopDate(Value: TDateTime); + procedure DoTimer(Sender: TObject); + protected + function CalculatePosition: TPoint; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure DoShowed; override; + procedure FontChanged; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure Paint; override; + property ItemHeight: Integer read FItemHeight; + property ItemIndex: Integer read FItemIndex write SetItemIndex; + property Items: TStrings read FItems; + property Owner: TcxSchedulerDateNavigator read FOwner; + property TopDate: TDateTime read FTopDate write SetTopDate; + property ViewInfo: TcxSchedulerDateNavigatorViewInfo read GetViewInfo; + public + procedure BeforeDestruction; override; + constructor Create(AOwner: TcxSchedulerDateNavigator); reintroduce; + procedure CloseUp; override; + procedure SetupMonth(R: TRect; ADate: TDateTime); + property Date: TDateTime read GetDate; + end; + +function GetDesktopRect: TRect; +begin +{$IFDEF DELPHI6} + Result := Screen.DesktopRect; +{$ELSE} + with Result do + begin + Top := GetSystemMetrics(SM_YVIRTUALSCREEN); + Left := GetSystemMetrics(SM_XVIRTUALSCREEN); + Bottom := Top + GetSystemMetrics(SM_CYVIRTUALSCREEN); + Right := Left + GetSystemMetrics(SM_CXVIRTUALSCREEN); + end; +{$ENDIF} +end; + +constructor TcxSchedulerMonthListBox.Create(AOwner: TcxSchedulerDateNavigator); +begin + inherited Create(AOwner.Scheduler); + OwnerParent := AOwner.Scheduler.Parent; + FOwner := AOwner; + IsTopMost := True; + CaptureFocus := False; + ControlStyle := [csCaptureMouse, csOpaque]; + FTopDate := NullDate; + FTimer := TTimer.Create(nil); + FTimer.Enabled := False; + FTimer.Interval := 200; + FTimer.OnTimer := DoTimer; + Adjustable := False; + BorderStyle := pbsFlat; +end; + +procedure TcxSchedulerMonthListBox.BeforeDestruction; +begin + FTimer.Free; + FTimer := nil; + inherited BeforeDestruction; +end; + +procedure TcxSchedulerMonthListBox.CloseUp; +var + ADate: TDateTime; +begin + FTimer.Enabled := False; + if GetCaptureControl = Self then SetCaptureControl(nil); + inherited; + ADate := GetDate; + with Owner do + begin + if ADate <> NullDate then + FirstDate := ChangeMonthByCalendar(ADate, True, -FListBoxDelta, Calendar); + Controller.DoCancelMode; + end; + Owner.EndUpdate; +end; + +procedure TcxSchedulerMonthListBox.SetupMonth(R: TRect; ADate: TDateTime); +begin + Font.Assign(ViewInfo.ContentParams.Font); + FontChanged; + R.TopLeft := Owner.Scheduler.ClientToScreen(R.TopLeft); + R.BottomRight := Owner.Scheduler.ClientToScreen(R.BottomRight); + R := cxRectOffset(R, Owner.Bounds.TopLeft); + TopDate := ADate; + FOrigin.X := Max(GetDesktopRect.Left, + (R.Left + R.Right) div 2 - Width div 2); + FOrigin.Y := Max(GetDesktopRect.Top, + (R.Top + R.Bottom) div 2 - Height div 2); + FItemIndex := 3; +end; + +function TcxSchedulerMonthListBox.GetDate: TDateTime; +begin + if ItemIndex = -1 then + Result := NullDate + else + Result := ChangeMonthByCalendar(TopDate, True, ItemIndex, Owner.Calendar); +end; + +function TcxSchedulerMonthListBox.GetViewInfo: TcxSchedulerDateNavigatorViewInfo; +begin + Result := Owner.ViewInfo; +end; + +procedure TcxSchedulerMonthListBox.SetItemIndex(Value: Integer); +var + PrevItemIndex: Integer; + + procedure InvalidateItemRect(Index: Integer); + var + R: TRect; + begin + if Index = -1 then Exit; + with R do + begin + Left := BorderWidths[bLeft]; + Top := Index * ItemHeight + BorderWidths[bTop]; + Right := Width - BorderWidths[bRight]; + Bottom := Top + ItemHeight; + end; + InvalidateRect(Handle, @R, False); + end; + +begin + if not HandleAllocated then Exit; + if FItemIndex <> Value then + begin + PrevItemIndex := FItemIndex; + FItemIndex := Value; + InvalidateItemRect(PrevItemIndex); + InvalidateItemRect(FItemIndex); + end; +end; + +procedure TcxSchedulerMonthListBox.SetTopDate(Value: TDateTime); +begin + if FTopDate <> Value then + begin + FTopDate := Value; + Repaint; + end; +end; + +procedure TcxSchedulerMonthListBox.DoTimer(Sender: TObject); +begin + TopDate := ChangeMonthByCalendar(TopDate, True, FSign, Owner.Calendar); +end; + +function TcxSchedulerMonthListBox.CalculatePosition: TPoint; +begin + Result.X := Min(cxRectWidth(GetDesktopRect) - Width, FOrigin.X); + Result.Y := Min(cxRectHeight(GetDesktopRect) - Height, FOrigin.Y); +end; + +procedure TcxSchedulerMonthListBox.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + WindowClass.Style := WindowClass.Style or CS_SAVEBITS; +end; + +procedure TcxSchedulerMonthListBox.DoShowed; +begin + SetCaptureControl(Self); +end; + +procedure TcxSchedulerMonthListBox.FontChanged; +begin + Canvas.Font.Assign(Font); + FItemHeight := ViewInfo.HeaderHeight - 2; + SetBounds(Left, Top, + BorderWidths[bLeft] + BorderWidths[bRight] + 6 * ViewInfo.ColWidth, + BorderWidths[bTop] + BorderWidths[bBottom] + 7 * FItemHeight); +end; + +procedure TcxSchedulerMonthListBox.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); +begin + CloseUp; + inherited MouseUp(Button, Shift, X, Y); +end; + +procedure TcxSchedulerMonthListBox.MouseMove(Shift: TShiftState; X, Y: Integer); +const + Times: array[0..3] of UINT = (500, 250, 100, 50); +var + Delta: Integer; + Interval: Integer; +begin + if cxRectPtIn(ClientRect, X, Y) then + begin + FTimer.Enabled := False; + ItemIndex := Y div ItemHeight; + end + else + begin + ItemIndex := -1; + if Y < 0 then Delta := Y + else + if Y >= ClientHeight then + Delta := 1 + Y - ClientHeight + else + begin + FTimer.Enabled := False; + Exit; + end; + FSign := Delta div Abs(Delta); + Interval := Abs(Delta) div ItemHeight; + if Interval > 3 then Interval := 3; + if not FTimer.Enabled or (Times[Interval] <> FTimer.Interval) then + begin + FTimer.Interval := Times[Interval]; + FTimer.Enabled := True; + end; + end; +end; + +procedure TcxSchedulerMonthListBox.Paint; +const + Colors: array[Boolean] of TColor = (clWindow, clWindowText); +var + I: Integer; + ADate: TDateTime; + R: TRect; + S: string; +begin + Canvas.FrameRect(ClientRect, clBlack); + ADate := TopDate; + with R do + begin + Left := BorderWidths[bLeft]; + Top := BorderWidths[bTop]; + Right := Width - BorderWidths[bRight]; + Bottom := Top + ItemHeight; + end; + for I := 0 to 6 do + begin + with Canvas do + begin + if I = ItemIndex then + begin + Font.Color := ViewInfo.SelectedParams.TextColor; + Brush.Color := ViewInfo.SelectedParams.Color; + FillRect(R); + end + else + begin + Font.Color := ViewInfo.ContentParams.TextColor; + FillRect(R, ViewInfo.ContentParams); + end; + S := cxGetLocalMonthYear(ADate, Owner.Calendar); + Canvas.Brush.Style := bsClear; + Inc(R.Right); // synchronize with header + DrawText(S, R, cxAlignCenter or cxSingleLine, True); + Dec(R.Right); + Canvas.Brush.Style := bsSolid; + end; + ADate := Owner.Calendar.AddMonths(ADate, 1); + OffsetRect(R, 0, ItemHeight); + end; +end; + +{ TcxSchedulerDateNavigatorController } + +constructor TcxSchedulerDateNavigatorController.Create(AOwner: TcxSchedulerSubControl); +begin + inherited Create(AOwner); + FSaveSelectionList := TcxSchedulerDateList.Create; +end; + +destructor TcxSchedulerDateNavigatorController.Destroy; +begin + StopTimer; + FSaveSelectionList.Free; + inherited Destroy; +end; + +procedure TcxSchedulerDateNavigatorController.DoCancelMode; +begin + inherited DoCancelMode; + StopTimer; + FIgnoreMouseMove := False; + FSingleSelection := False; + FDragDate := NullDate; + Screen.Cursor := crDefault; + Owner.RefreshDays; +end; + +procedure TcxSchedulerDateNavigatorController.DragOver( + Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); +begin + Accept := Accept and HitTest.HitAtTime; +end; + +function TcxSchedulerDateNavigatorController.GetCursor(X, Y: Integer): TCursor; +begin + if Owner.SelectPeriod and HitTest.HitAtWeekSelectionBar then + Result := crCalendarMirrorArrow + else + Result := crDefault; +end; + +procedure TcxSchedulerDateNavigatorController.MouseDown( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + + procedure ProcessHeader; + begin + with HitTest do + begin + if HitAtPrevMonth then + begin + Owner.StepToPast; + StartTimer(False); + end + else if HitAtNextMonth then + begin + Owner.StepToFuture; + StartTimer(True); + end + else if HitAtMonthName then + Owner.ShowMonthPopup(MonthViewInfo); + end; + end; + +begin + HideHint; + FIgnoreMouseMove := False; + FSingleSelection := False; + FSaveSelectionIsWeeks := False; + if Button = mbLeft then + begin + Owner.CancelUpdates; // for a possible changed capture + Owner.BeginUpdate; + FExtSelect := Owner.SelectPeriod and (ssCtrl in Shift); + FUnselect := FExtSelect; + FSaveSelectionList.Assign(Owner.SelectionList); + if not (ssDouble in Shift) then + ProcessSelectionOnMouseDown(Shift); + ProcessHeader; + end; +end; + +procedure TcxSchedulerDateNavigatorController.MouseLeave; +begin + inherited MouseLeave; + DoCancelMode; + HideHint; +end; + +procedure TcxSchedulerDateNavigatorController.MouseMove( + Shift: TShiftState; X, Y: Integer); +begin + if FIgnoreMouseMove or (FTimer <> nil) then Exit; + if CanProcessMouseMove and (ssLeft in Shift) then + ProcessSelectionOnMouseMove(Shift); + if (Owner.Scheduler <> nil) and + not Owner.Scheduler.IsDesigning then + ShowHint; +end; + +procedure TcxSchedulerDateNavigatorController.MouseUp( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + DoCancelMode; + if Button = mbLeft then + begin + if (Owner.SelectionList.Count > 0) and + cxRectPtIn(ViewInfo.GetInternalRect(ViewInfo.GetCol(X), ViewInfo.GetRow(Y)), X, Y) then + begin + if Owner.SelectionList[Owner.SelectionList.Count - 1] < Owner.FirstDate then + Owner.StepToPast; + if Owner.SelectionList[0] > Owner.LastDate then + Owner.StepToFuture; + end; + Owner.DoSelectionChanged; + Owner.EndUpdate; + end; +end; + +procedure TcxSchedulerDateNavigatorController.HideHint; +begin + Owner.HintController.Hide; + FCalculatedHintBounds := False; +end; + +procedure TcxSchedulerDateNavigatorController.ShowHint; +var + R: TRect; + AHintText: string; + ACursor: TPoint; +begin + if (HitTest.HitDate = NullDate) or + (Owner.Scheduler = nil) or + not Owner.Scheduler.OptionsView.ShowHints then + begin + HideHint; + Exit; + end; + with Owner do + begin + AHintText := ''; + if TcxCustomSchedulerAccess(Scheduler).DoShowDateHint(HitTest.HitDate, AHintText) then + begin + if AnsiCompareText(AHintText, FHintText) <> 0 then + HideHint; + if (not FCalculatedHintBounds) then + begin + FHintText := AHintText; + R := HintController.CalcHintRect(cxscMinHintWidth, AHintText, cxAlignRight); + ACursor := GetMouseCursorPos; + OffsetRect(R, ACursor.X, ACursor.Y + cxGetCursorSize.cy); + HintController.Activate(R, AHintText, True, False); + FCalculatedHintBounds := True; + end; + end + else + HideHint; + end; +end; + +procedure TcxSchedulerDateNavigatorController.CalculateSelection(AConcatenate: Boolean); + + procedure GetBoundParameters(out AStart, AFinish, AMax, AMin: Integer); + begin + //DELPHI8! check Trunc() + AStart := Trunc(FSelStart); + AFinish := Trunc(FSelFinish); + if Owner.SelectionIsWeeks then + begin + if AStart < AFinish then + begin + Dec(AStart, ColOfDate(AStart, Byte(StartOfWeek))); + Inc(AFinish, 6 - ColOfDate(AFinish, Byte(StartOfWeek))); + end + else + begin + Dec(AFinish, ColOfDate(AFinish, Byte(StartOfWeek))); + Inc(AStart, 6 - ColOfDate(AStart, Byte(StartOfWeek))); + end; + AMax := cxMaxWeekCount * 7; + AMin := 7; + end + else + begin + AMax := 14; + AMin := 1; + end; + if Owner.UnlimitedSelection then + AMax := MaxInt; + end; + +var + AIndex, ADelta, AStart, AFinish, AMax, AMin: Integer; +begin + GetBoundParameters(AStart, AFinish, AMax, AMin); + if FUnselect and (Owner.SelectionList.Count <= AMin) then Exit; + Owner.SelectionList.Clear; + if AConcatenate then Owner.SelectionList.Assign(FSaveSelectionList); + ADelta := 2 * Byte(AStart < AFinish) - 1; + while (AStart <> AFinish + ADelta) do + begin + AIndex := Owner.SelectionList.IndexOf(AStart); + if AIndex < 0 then + begin + if not FUnselect and (Owner.SelectionList.Count < AMax) then + Owner.SelectionList.Add(AStart); + end + else + if FUnselect and (Owner.SelectionList.Count > AMin) then + Owner.SelectionList.Delete(AIndex); + Inc(AStart, ADelta); + end; + Owner.RefreshDays; +end; + +procedure TcxSchedulerDateNavigatorController.ProcessSelectionOnMouseDown( + AShift: TShiftState); + + procedure SelectDate(ADate: TDateTime); + begin + with Owner.SelectionList do + begin + if (ExistDate(ADate) and FUnselect and (Count = 1)) or + (FExtSelect and ((Count > 14) and not Owner.UnlimitedSelection)) then + begin + FIgnoreMouseMove := True; + Exit; + end; + end; + FSelStart := ADate; + FSelFinish := ADate; + Owner.SelectionIsWeeks := False; + CalculateSelection(FExtSelect); + end; + + procedure SelectWeek(ADate: TDateTime); + begin + if not Owner.SelectPeriod or (Owner.SelectionIsWeeks and FUnselect and + (Owner.SelectionList.Count = 7)) then Exit; + if not Owner.SelectionIsWeeks then + begin + FUnselect := False; + Owner.SelectionList.Clear; + end; + FSaveSelectionIsWeeks := Owner.SelectionIsWeeks; + FSelStart := ADate; + FSelFinish := FSelStart + 6; + CalculateSelection(FExtSelect and Owner.SelectionIsWeeks); + Owner.SelectionIsWeeks := True; + end; + +var + ADate: TDateTime; +begin + ADate := HitTest.Time; + if ADate = NullDate then Exit; + FUnselect := FUnselect and Owner.SelectionList.ExistDate(ADate); + if Owner.SelectPeriod and (ssShift in AShift) then + begin + FSelStart := Owner.SelectionList[0]; + FSelFinish := ADate; + Owner.SelectionIsWeeks := HitTest.HitAtWeekSelectionBar or (Owner.SelectionList.Count > 14); + CalculateSelection(not Owner.SelectionIsWeeks); + end + else + if HitTest.HitAtTime then + SelectDate(ADate) + else if HitTest.HitAtWeekSelectionBar then + SelectWeek(ADate) + else if HitTest.HitAtControl and not HitTest.HitAtCalendar then + begin + FSingleSelection := True; + SelectDate(ADate); + end; + if not (ssLeft in AShift) then + Owner.DoSelectionChanged; +end; + +procedure TcxSchedulerDateNavigatorController.ProcessSelectionOnMouseMove( + AShift: TShiftState); + + procedure ProcessDate(ADate: TDateTime); + begin + if FSingleSelection then + begin + FSelStart := ADate; + FSelFinish := ADate; + CalculateSelection(FExtSelect); + end + else + if ADate <> FSelFinish then + begin + FSelFinish := ADate; + if not Owner.SelectPeriod then FSelStart := FSelFinish; + //DELPHI8! check Trunc() + if not FExtSelect and + (Abs(Trunc(FSelStart) - Trunc(ADate)) + 1 > cxDaysCalendarMaxColCount) then + Owner.SelectionIsWeeks := True; + CalculateSelection(FExtSelect and not Owner.SelectionIsWeeks); + end; + end; + + procedure ProcessWeek(ADate: TDateTime); + begin + if Owner.SelectionIsWeeks and Owner.SelectPeriod and (ADate <> FSelFinish) then + begin + FSelFinish := ADate; + CalculateSelection(FExtSelect and FSaveSelectionIsWeeks); + end; + end; + +begin + if not HitTest.HitAtControl then + begin + FSelFinish := NullDate; + Owner.SelectionList.Assign(FSaveSelectionList); + Owner.RefreshDays; + end + else if HitTest.HitAtTime then + ProcessDate(HitTest.Time) + else if HitTest.HitAtWeekSelectionBar then + ProcessWeek(HitTest.Time); +end; + +function TcxSchedulerDateNavigatorController.GetHitTest: TcxSchedulerDateNavigatorHitTest; +begin + Result := TcxSchedulerDateNavigatorHitTest(inherited HitTest); +end; + +function TcxSchedulerDateNavigatorController.GetOwner: TcxSchedulerDateNavigator; +begin + Result := TcxSchedulerDateNavigator(inherited Owner); +end; + +function TcxSchedulerDateNavigatorController.GetViewInfo: TcxSchedulerDateNavigatorViewInfo; +begin + Result := Owner.ViewInfo; +end; + +procedure TcxSchedulerDateNavigatorController.SetDragDate(const Value: TDateTime); +begin + if FDragDate <> Value then + begin + FDragDate := Value; + Owner.Invalidate; + end; +end; + +procedure TcxSchedulerDateNavigatorController.StartTimer(AFuture: Boolean); +begin + if Assigned(FTimer) or (GetCapture <> Owner.Scheduler.Handle) then Exit; + FTimer := TTimer.Create(nil); + FTimer.Interval := cxDateStartNavigatorTime; + FTimer.Tag := Ord(AFuture); + FTimer.OnTimer := TimerProc; +end; + +procedure TcxSchedulerDateNavigatorController.StopTimer; +begin + FreeAndNil(FTimer); +end; + +procedure TcxSchedulerDateNavigatorController.TimerProc(Sender: TObject); +var + P: TPoint; +begin + P := Owner.Scheduler.ScreenToClient(GetMouseCursorPos); + Owner.MousePositionChanged(P.X, P.Y); + case TTimer(Sender).Tag of + 0: if HitTest.HitAtPrevMonth then + Owner.StepToPast; + else + if HitTest.HitAtNextMonth then + Owner.StepToFuture; + end; + FTimer.Interval := cxDateNavigatorTime; + Owner.RefreshDays; +end; + +{ TcxSchedulerDateNavigator } + +constructor TcxSchedulerDateNavigator.Create(AOwner: TcxCustomScheduler); +var + AConvertDate: TcxDateTime; +begin + inherited Create(AOwner); + FRealFirstDate := NullDate; + FRealLastDate := NullDate; + FCalendar := cxGetLocalCalendar; + FToday := SysUtils.Date; + AConvertDate := FCalendar.FromDateTime(FToday); + AConvertDate.Day := 1; + FFirstDate := FCalendar.ToDateTime(AConvertDate); + FFirstWeekOfYear := fwySystem; + FActualFirstWeekOfYear := GetActualFirstWeekOfYear; + FHolidayColor := clRed; + FShowDatesContainingEventsInBold := True; + FShowDatesContainingHolidaysInColor := False; + FSelectPeriod := True; + FShowWeekNumbers := True; + UpdateCalculatedValues; + ColCount := 1; + RowCount := 1; +end; + +destructor TcxSchedulerDateNavigator.Destroy; +begin + FreeAndNil(FCalendar); + inherited Destroy; +end; + +procedure TcxSchedulerDateNavigator.AssignProperties( + ASource: TcxSchedulerDateNavigator); +begin + SelectionList.Assign(ASource.SelectionList); + FSelectionIsWeeks := ASource.SelectionIsWeeks; + FRealFirstDate := ASource.RealFirstDate; + FRealLastDate := ASource.RealLastDate; + FToday := ASource.FToday; + FFirstDate := ASource.FFirstDate; + FActualFirstWeekOfYear := ASource.ActualFirstWeekOfYear; + FHolidayColor := HolidayColor; + FShowDatesContainingEventsInBold := ASource.ShowDatesContainingEventsInBold; + FShowDatesContainingHolidaysInColor := ASource.ShowDatesContainingHolidaysInColor; + FSelectPeriod := ASource.FSelectPeriod; + UpdateLastDates; + PeriodChanged; +end; + +procedure TcxSchedulerDateNavigator.SetIntegralSizes; +begin + ViewInfo.CalculateInternalSizes; + SetBounds(Left, Top, + ColCount * ViewInfo.MonthSize.cx, + RowCount * ViewInfo.MonthSize.cy); +end; + +procedure TcxSchedulerDateNavigator.GetProperties(AProperties: TStrings); +begin + if not Visible then Exit; + with AProperties do + begin + if Scheduler.OptionsCustomize.IntegralSizing then + begin + Add('DNColCount'); + Add('DNRowCount'); + end + else + begin + Add('DNWidth'); + Add('DNHeight'); + end; + end; +end; + +procedure TcxSchedulerDateNavigator.GetPropertyValue(const AName: string; + var AValue: Variant); +begin + if not Visible then Exit; + if AName = 'DNColCount' then + AValue := ColCount + else + if AName = 'DNRowCount' then + AValue := RowCount + else + if AName = 'DNWidth' then + AValue := Width + else + if AName = 'DNHeight' then + AValue := Height +end; + +procedure TcxSchedulerDateNavigator.SetPropertyValue(const AName: string; + const AValue: Variant); +begin + if not Visible then Exit; + if Scheduler.OptionsCustomize.IntegralSizing then + begin + if AName = 'DNColCount' then + ColCount := AValue + else + if AName = 'DNRowCount' then + RowCount := AValue + end + else + begin + if AName = 'DNWidth' then + Width := AValue + else + if AName = 'DNHeight' then + Height := AValue; + end; +end; + +function TcxSchedulerDateNavigator.AllowDesignHitTest(X, Y: Integer; + Shift: TShiftState): Boolean; +begin + inherited AllowDesignHitTest(X, Y, Shift); + Result := HitTest.HitAtCalendar; + if Result then + begin + Result := HitTest.HitAtTime or HitTest.HitAtWeekSelectionBar or + HitTest.HitAtMonthName or HitTest.HitAtNextMonth or HitTest.HitAtPrevMonth; + end; +end; + +procedure TcxSchedulerDateNavigator.BoundsChanged; +begin + ViewInfo.CalculateInternalSizes; + ViewInfo.CalculateCalendarBounds; + inherited BoundsChanged; +end; + +function TcxSchedulerDateNavigator.CanCalculateViewInfo: Boolean; +begin + Result := Visible and not IsSchedulerLocked; +end; + +procedure TcxSchedulerDateNavigator.CheckSizes; +begin + if Scheduler.OptionsCustomize.IntegralSizing then + SetIntegralSizes + else + begin + ViewInfo.CalculateInternalSizes; + SetBounds(Left, Top, + Max(ViewInfo.MonthSize.cx, FSavedSize.cx), + Max(ViewInfo.MonthSize.cy, FSavedSize.cy)); + end; +end; + +procedure TcxSchedulerDateNavigator.CheckCurrentDate; +begin + if FToday <> SysUtils.Date then + Refresh; +end; + +procedure TcxSchedulerDateNavigator.ClearDragging; +begin + Controller.DragDate := NullDate; +end; + +procedure TcxSchedulerDateNavigator.CreateSubClasses; +begin + inherited CreateSubClasses; + FStyles := TcxSchedulerDateNavigatorStyles.Create(Self); + FListBox := TcxSchedulerMonthListBox.Create(Self); +end; + +function TcxSchedulerDateNavigator.CreateController: TcxSchedulerSubControlController; +begin + Result := TcxSchedulerDateNavigatorController.Create(Self); +end; + +function TcxSchedulerDateNavigator.CreateHitTest: TcxSchedulerSubControlHitTest; +begin + Result := TcxSchedulerDateNavigatorHitTest.Create(Self); +end; + +function TcxSchedulerDateNavigator.CreatePainter: TcxSchedulerSubControlPainter; +begin + Result := TcxSchedulerDateNavigatorPainter.Create(Self); +end; + +function TcxSchedulerDateNavigator.CreateViewInfo: TcxSchedulerSubControlViewInfo; +begin + Result := TcxSchedulerDateNavigatorViewInfo.Create(Self); +end; + +procedure TcxSchedulerDateNavigator.DestroySubClasses; +begin + FreeAndNil(FStyles); + inherited DestroySubClasses; + FreeAndNil(FListBox); +end; + +procedure TcxSchedulerDateNavigator.DoLayoutChanged; +begin + try + BeginUpdate; + try + UpdateCalculatedValues; + ViewInfo.Calculate; + finally + EndUpdate; + end; + except + on EConvertError do FirstDate := FirstDate - 31; + end; +end; + +function TcxSchedulerDateNavigator.CanDrawSelectionSide: Boolean; +begin + Result := not ShowWeekNumbers and SelectionIsWeeks; +end; + +procedure TcxSchedulerDateNavigator.CheckSelectionBounds; +var + ASelectionCount: Integer; + AFirstSelectedDate: TDateTime; + + procedure ShiftSelection(AForward: Boolean); + var + ADate: TDateTime; + I: Integer; + AConvertDate: TcxDateTime; + begin + if AForward then + ADate := LastDate + else + ADate := FirstDate; + AConvertDate := Calendar.FromDateTime(ADate); + if SelectionIsWeeks then + ADate := ADate - ColOfDate(ADate, Byte(StartOfWeek)) + else + begin + AConvertDate.Day := GetDateElement(AFirstSelectedDate, deDay, Calendar); + AConvertDate.Day := CheckDay(AConvertDate, Calendar); + ADate := Calendar.ToDateTime(AConvertDate); + end; + SelectionList.Clear; + for I := 0 to ASelectionCount - 1 do + begin + SelectionList.Add(ADate); + ADate := ADate + 1; + end; + end; + +begin + ASelectionCount := SelectionList.Count; + if ASelectionCount > 0 then + begin + AFirstSelectedDate := SelectionList[0]; + if (AFirstSelectedDate < FirstDate) then + ShiftSelection(False) + else + if AFirstSelectedDate > LastDate then + ShiftSelection(True); + end; +end; + +procedure TcxSchedulerDateNavigator.DoSelectionChanged; +begin + if IsLocked then Exit; + IsLocked := True; + try + SelectionList.Changed := False; + PeriodChanged; + finally + IsLocked := False; + end; +end; + +procedure TcxSchedulerDateNavigator.DoPeriodChangedEvent; +begin + if Assigned(FOnPeriodChanged) then + FOnPeriodChanged(Self, RealFirstDate, RealLastDate); +end; + +procedure TcxSchedulerDateNavigator.DoSelectionChangedEvent; +begin + if Assigned(FOnSelectionChanged) then + FOnSelectionChanged(Self, SelectionList[0], SelectionList[SelectionList.Count - 1]); +end; + +procedure TcxSchedulerDateNavigator.DoScrollSelection(AScrollDelta: Integer); +begin + if AScrollDelta = 0 then Exit; + IsLocked := True; + try + while AScrollDelta <> 0 do + begin + ScrollSelection(AScrollDelta < 0, NullDate, False); + Inc(AScrollDelta, Byte(AScrollDelta < 0) * 2 - 1); + end; + finally + IsLocked := False; + DoSelectionChanged; + end; +end; + +procedure TcxSchedulerDateNavigator.DoScrollSelection(AForward: Boolean; + ANeedDate: TDateTime; AIsByPage: Boolean); + + procedure ScrollWeeks; + var + I, J, ANumPass: Integer; + ADate: TDateTime; + begin + if AIsByPage then + ANumPass := SelectionList.Count div 7 + else + ANumPass := 1; + for J := 1 to ANumPass do + if AForward then + begin + ADate := SelectionList[SelectionList.Count - 1] + 1; + for I := 0 to 6 do + begin + SelectionList.Add(ADate + I); + SelectionList.Delete(0); + end + end + else + begin + ADate := SelectionList[0] - 7; + for I := 0 to 6 do + begin + SelectionList.Add(ADate + I); + SelectionList.Delete(SelectionList.Count - 1); + end; + end; + end; + + procedure ScrollDays; + begin + if AForward then + begin + SelectionList.Add(SelectionList[SelectionList.Count - 1] + 1); + SelectionList.Delete(0); + end + else + begin + SelectionList.Add(SelectionList[0] - 1); + SelectionList.Delete(SelectionList.Count - 1); + end; + end; + +begin + if (SelectionList.Count = 0) or SelectionList.ExistDate(ANeedDate) then Exit; + if SelectionIsWeeks then + ScrollWeeks + else + ScrollDays; + EnsureSelectionVisible; +end; + +procedure TcxSchedulerDateNavigator.EnsureSelectionVisible; +var + AMinDate, AMaxDate: TDateTime; +begin + if SelectionList.Count = 0 then Exit; + if SelectionIsWeeks then + begin + AMinDate := RealFirstDate; + AMaxDate := RealLastDate; + end + else + begin + AMinDate := FirstDate; + AMaxDate := LastDate; + end; + if SelectionList[0] > AMaxDate then + FirstDate := RealLastDate + else + if SelectionList[0] < AMinDate then + FirstDate := RealFirstDate + else + DoSelectionChanged; +end; + +procedure TcxSchedulerDateNavigator.GetCalendarDimension( + out AColCount, ARowCount: Integer); +begin + AColCount := ColCount; + ARowCount := RowCount; +end; + +function TcxSchedulerDateNavigator.IsDateSelected(ADate: TDateTime): Boolean; +begin + Result := SelectionList.ExistDate(ADate); +end; + +function TcxSchedulerDateNavigator.IsDateHasEvent(ADate: TDateTime): Boolean; +begin + Result := ShowDatesContainingEventsInBold and EventDays.ExistDate(ADate); +end; + +function TcxSchedulerDateNavigator.IsDateHasHoliday(ADate: TDateTime): Boolean; +begin + Result := HolidayDays.ExistDate(ADate); +end; + +procedure TcxSchedulerDateNavigator.Loaded; +begin + inherited Loaded; + ViewInfo.CalculateInternalSizes; + SetBounds(Left, Top, + Max(ViewInfo.MonthSize.cx, FSavedSize.cx), + Max(ViewInfo.MonthSize.cy, FSavedSize.cy)); + //force update layout + BoundsChanged; +end; + +procedure TcxSchedulerDateNavigator.FormatChanged; +begin + FActualFirstWeekOfYear := GetActualFirstWeekOfYear; + RefreshDays; +end; + +function TcxSchedulerDateNavigator.GetMonthSize: TSize; +begin + Result := ViewInfo.MonthSize; +end; + +function TcxSchedulerDateNavigator.GetShowDatesContainingEventsInBold: Boolean; +begin + Result := FShowDatesContainingEventsInBold; +end; + +function TcxSchedulerDateNavigator.GetShowDatesContainingHolidaysInColor: Boolean; +begin + Result := FShowDatesContainingHolidaysInColor; +end; + +procedure TcxSchedulerDateNavigator.MakeSelectionVisible; +begin + if SelectionList.Count = 0 then Exit; + if (SelectionList[0] < FirstDate) or (SelectionList[0] > LastDate) then + FirstDate := SelectionList[0]; +end; + +procedure TcxSchedulerDateNavigator.RefreshDays; +begin + if CanCalculateViewInfo then + begin + ViewInfo.CalculateMonthViewInfos; + Invalidate; + end; +end; + +procedure TcxSchedulerDateNavigator.SetFirstDate(Value: TDateTime); +begin + //DELPHI8! check + Value := DateOf(Value) - (GetDateElement(Value, deDay, Calendar) - 1); + if FFirstDate <> Value then + begin + BeginUpdate; + FFirstDate := Value; + UpdateCalculatedValues; + UpdateLastDates; + CheckSelectionBounds; + ViewInfo.Calculate; + DoSelectionChanged; + EndUpdate; + Invalidate; + end; +end; + +procedure TcxSchedulerDateNavigator.ShowMonthPopup( + AMonthInfo: TcxSchedulerDateNavigatorMonthViewInfo); +begin + if AMonthInfo = nil then Exit; + FListBoxDelta := AMonthInfo.Row * ColCount + AMonthInfo.Col; + TcxSchedulerMonthListBox(FListBox).SetupMonth( + AMonthInfo.Header.MonthNameBounds, ChangeMonthByCalendar(FirstDate, + True, FListBoxDelta - 3, Calendar)); + FListBox.Popup(FListBox) +end; + +procedure TcxSchedulerDateNavigator.StepToPast; +begin + FirstDate := Calendar.AddMonths(FirstDate, -1); +end; + +procedure TcxSchedulerDateNavigator.StepToFuture; +begin + if LastDate >= LastAvailableDate then Exit; + FirstDate := Calendar.AddMonths(FirstDate, 1); +end; + +procedure TcxSchedulerDateNavigator.UpdateCalculatedValues; +begin + FToday := SysUtils.Date; + FRealFirstDate := GetRealFirstDate; +end; + +procedure TcxSchedulerDateNavigator.UpdateLastDates; +begin + FLastDate := GetLastDate; + FRealLastDate := GetRealLastDate; +end; + +procedure TcxSchedulerDateNavigator.UpdateDragging; +var + ADate: TDateTime; +begin + with HitTest do + begin + if HitAtTime then ADate := Time else ADate := NullDate; + Controller.DragDate := ADate; + end; +end; + +procedure TcxSchedulerDateNavigator.UpdateSelection; +var + ADate: TDateTime; +begin + if SelectionList.Count > 0 then + begin + if SelectionIsWeeks and ((SelectionList.Count div 7) <= cxMaxWeekCount) then + ADate := SelectionList[SelectionList.Count div 2] + else + ADate := SelectionList[0] + end + else + begin + ADate := FToday; + SelectionList.Add(FToday) + end; + if (ADate < FirstDate) or (ADate > LastDate) then + FirstDate := ADate; + DoSelectionChanged; +end; + +procedure TcxSchedulerDateNavigator.VisibleChanged; +var + X, Y: Integer; +begin + inherited VisibleChanged; + if Visible then + begin + if Scheduler.OptionsCustomize.IntegralSizing then + begin + X := ColCount; + Y := RowCount; + inherited VisibleChanged; + ColCount := X; + RowCount := Y; + end + else + begin + X := Width; + Y := Height; + inherited VisibleChanged; + Width := X; + Height := Y; + end; + end + else + inherited VisibleChanged; +end; + +procedure TcxSchedulerDateNavigator.AfterCustomDraw(ACanvas: TcxCanvas; + var AParams: TcxViewParams); +begin + with ACanvas do + begin + AParams.Color := Brush.Color; + AParams.Font := Font; + AParams.TextColor := Font.Color; + end; +end; + +procedure TcxSchedulerDateNavigator.BeforeCustomDraw(ACanvas: TcxCanvas; + const AParams: TcxViewParams); +begin + with ACanvas do + begin + Brush.Color := AParams.Color; + Font := AParams.Font; + Font.Color := AParams.TextColor; + end; +end; + +function TcxSchedulerDateNavigator.DoCustomDrawBackground(ACanvas: TcxCanvas; + const ABounds: TRect; var AViewParams: TcxViewParams): Boolean; +begin + Result := False; + if Assigned(FOnCustomDrawBackground) then + begin + BeforeCustomDraw(ACanvas, AViewParams); + FOnCustomDrawBackground(Self, ACanvas, ABounds, AViewParams, Result); + if not Result then + AfterCustomDraw(ACanvas, AViewParams); + end; +end; + +function TcxSchedulerDateNavigator.DoCustomDrawDayNumber(ACanvas: TcxCanvas; ADayInfo: TcxSchedulerDateNavigatorDayNumberViewInfo): Boolean; +begin + Result := False; + if Assigned(FOnCustomDrawDayNumber) then + begin + BeforeCustomDraw(ACanvas, ADayInfo.FViewParams); + FOnCustomDrawDayNumber(Self, ACanvas, ADayInfo, Result); + if not Result then + AfterCustomDraw(ACanvas, ADayInfo.FViewParams); + end; +end; + +function TcxSchedulerDateNavigator.DoCustomDrawDayCaption(ACanvas: TcxCanvas; + ADayCaptionInfo: TcxSchedulerDateNavigatorDayCaptionViewInfo): Boolean; +begin + Result := False; + if Assigned(FOnCustomDrawDayCaption) then + begin + BeforeCustomDraw(ACanvas, ADayCaptionInfo.ViewParams); + FOnCustomDrawDayCaption(Self, ACanvas, ADayCaptionInfo, Result); + if not Result then + AfterCustomDraw(ACanvas, ADayCaptionInfo.FViewParams); + end; +end; + +function TcxSchedulerDateNavigator.DoCustomDrawContent(ACanvas: TcxCanvas; + AViewInfo: TcxSchedulerDateNavigatorMonthContentViewInfo): Boolean; +begin + Result := False; + if Assigned(FOnCustomDrawContent) then + begin + BeforeCustomDraw(ACanvas, AViewInfo.ViewParams); + FOnCustomDrawContent(Self, ACanvas, AViewInfo, Result); + if not Result then + begin + AfterCustomDraw(ACanvas, AViewInfo.FViewParams); + AViewInfo.UpdateElementsAfterCustomDraw(ACanvas); + end; + end; +end; + +function TcxSchedulerDateNavigator.DoCustomDrawHeader(ACanvas: TcxCanvas; + AViewInfo: TcxSchedulerDateNavigatorMonthHeaderViewInfo): Boolean; +begin + Result := False; + if Assigned(FOnCustomDrawHeader) then + begin + BeforeCustomDraw(ACanvas, AViewInfo.ViewParams); + FOnCustomDrawHeader(Self, ACanvas, AViewInfo, Result); + if not Result then + AfterCustomDraw(ACanvas, AViewInfo.FViewParams); + end; +end; + +function TcxSchedulerDateNavigator.GetActualFirstWeekOfYear: TcxFirstWeekOfYear; +begin + if FFirstWeekOfYear = fwySystem then + Result := TcxFirstWeekOfYear( + StrToInt(GetLocaleChar(GetUserDefaultLCID, LOCALE_IFIRSTWEEKOFYEAR, '0')) + 1) + else + Result := FFirstWeekOfYear; +end; + +function TcxSchedulerDateNavigator.GetColCount: Integer; +begin + Result := ViewInfo.ColCount; +end; + +function TcxSchedulerDateNavigator.GetController: TcxSchedulerDateNavigatorController; +begin + Result := TcxSchedulerDateNavigatorController(inherited Controller); +end; + +function TcxSchedulerDateNavigator.GetDate: TDateTime; +begin + if SelectionList.Count = 0 then + Result := NullDate + else + Result := SelectionList[0]; +end; + +function TcxSchedulerDateNavigator.GetHitTest: TcxSchedulerDateNavigatorHitTest; +begin + Result := TcxSchedulerDateNavigatorHitTest(inherited HitTest); +end; + +function TcxSchedulerDateNavigator.GetLastDate: TDateTime; +begin + Result := ChangeMonthByCalendar(FirstDate, False, ColCount * RowCount - 1, Calendar); +end; + +function TcxSchedulerDateNavigator.GetRowCount: Integer; +begin + Result := ViewInfo.RowCount; +end; + +function TcxSchedulerDateNavigator.GetRealFirstDate: TDateTime; +begin + Result := FCalendar.GetFirstDayOfWeek(FFirstDate, StartOfWeek); + if (Result = FFirstDate) then + Result := Result - 7; +end; + +function TcxSchedulerDateNavigator.GetRealLastDate: TDateTime; +var + Year, Month, Day: Word; + ACol: Integer; +begin + Result := FLastDate; + DecodeDate(Result, Year, Month, Day); + ACol := ColOfDate(EncodeDate(Year, Month, 1), Byte(StartOfWeek)); + Result := Result + 6 * 7 - DaysPerMonth(Year, Month) - ACol; + if (ACol = 0) and (ColCount * RowCount = 1) then Result := Result - 7; +end; + +function TcxSchedulerDateNavigator.GetSelectPeriod: Boolean; +begin + Result := FSelectPeriod and CanMultiSelect; +end; + +function TcxSchedulerDateNavigator.GetViewInfo: TcxSchedulerDateNavigatorViewInfo; +begin + Result := TcxSchedulerDateNavigatorViewInfo(inherited ViewInfo); +end; + +procedure TcxSchedulerDateNavigator.SetColCount(Value: Integer); +begin + if Value < 1 then Value := 1; + if ColCount <> Value then + begin + ViewInfo.FColCount := Value; + ViewInfo.CalculateInternalSizes; + Width := Value * ViewInfo.MonthSize.cx; + end; +end; + +procedure TcxSchedulerDateNavigator.SetDate(Value: TDateTime); +begin + if Value <> NullDate then + begin + SelectionList.Clear; + SelectionList.Add(Value); + if (Value < FirstDate) or (Value > LastDate) then + FirstDate := Value; + SelectionIsWeeks := False; + RefreshDays; + end; +end; + +procedure TcxSchedulerDateNavigator.SetFirstWeekOfYear( + Value: TcxFirstWeekOfYear); +begin + if Value <> FFirstWeekOfYear then + begin + FFirstWeekOfYear := Value; + FActualFirstWeekOfYear := GetActualFirstWeekOfYear; + if ShowWeekNumbers then + RefreshDays; + end; +end; + +procedure TcxSchedulerDateNavigator.SetHolidayColor(AValue: TColor); +begin + if AValue <> FHolidayColor then + begin + FHolidayColor := AValue; + RefreshDays; + end; +end; + +procedure TcxSchedulerDateNavigator.SetRowCount(Value: Integer); +begin + if Value < 1 then Value := 1; + if RowCount <> Value then + begin + ViewInfo.FRowCount := Value; + ViewInfo.CalculateInternalSizes; + Height := Value * ViewInfo.MonthSize.cy; + end; +end; + +procedure TcxSchedulerDateNavigator.SetSelectPeriod(Value: Boolean); +begin + if FSelectPeriod <> Value then + begin + FSelectPeriod := Value; + if not Value then + Date := Date; + end; +end; + +procedure TcxSchedulerDateNavigator.SetShowDatesContainingEventsInBold(Value: Boolean); +begin + if FShowDatesContainingEventsInBold <> Value then + begin + FShowDatesContainingEventsInBold := Value; + RefreshDays; + end; +end; + +procedure TcxSchedulerDateNavigator.SetShowDatesContainingHolidaysInColor(Value: Boolean); +begin + if FShowDatesContainingHolidaysInColor <> Value then + begin + FShowDatesContainingHolidaysInColor := Value; + RefreshDays; + end; +end; + +procedure TcxSchedulerDateNavigator.SetShowWeekNumbers(Value: Boolean); +begin + if FShowWeekNumbers <> Value then + begin + FShowWeekNumbers := Value; + RefreshDays; + end; +end; + +procedure TcxSchedulerDateNavigator.SetStyles( + const Value: TcxSchedulerDateNavigatorStyles); +begin + FStyles.Assign(Value); +end; + +procedure TcxSchedulerDateNavigator.SetUnlimitedSelection(Value: Boolean); +var + ADate: TDateTime; +begin + if FUnlimitedSelection <> Value then + begin + FUnlimitedSelection := Value; + ADate := Date; + SelectionList.Clear; + if ADate <> NullDate then + SelectionList.Add(ADate); + LayoutChanged; + end; +end; + +{ TcxSchedulerDateNavigatorPainter } + +constructor TcxSchedulerDateNavigatorPainter.Create(AOwner: TcxSchedulerSubControl); +begin + inherited Create(AOwner); + FDateNavigator := TcxSchedulerDateNavigator(AOwner); +end; + +procedure TcxSchedulerDateNavigatorPainter.Paint; +var + I, J: Integer; + AMonthInfo: TcxSchedulerDateNavigatorMonthViewInfo; +begin + Canvas.FillRect(DateNavigator.ViewInfo.CalendarBounds, + DateNavigator.Styles.GetContentParams); + for I := 0 to DateNavigator.ColCount - 1 do + for J := 0 to DateNavigator.RowCount - 1 do + begin + AMonthInfo := DateNavigator.ViewInfo.MonthViewInfo[I, J]; + DoDrawMonthContent(AMonthInfo.Content); + DoDrawMonthHeader(AMonthInfo.Header); + DoDrawDayCaptions(AMonthInfo.Content); + DoDrawDayNumbers(AMonthInfo.Content); + DrawSeparators(AMonthInfo.Content); + if DateNavigator.ShowWeekNumbers then + DrawWeekNumbers(AMonthInfo.Content); + end; + Canvas.ExcludeClipRect(DateNavigator.ViewInfo.CalendarBounds); + DrawBackground; +end; + +procedure TcxSchedulerDateNavigatorPainter.DoDrawDayCaptions( + AViewInfo: TcxSchedulerDateNavigatorMonthContentViewInfo); +var + I: Integer; + AInfo: TcxSchedulerDateNavigatorDayCaptionViewInfo; +begin + for I := 0 to 6 do + begin + AInfo := AViewInfo.DayCaptions[I]; + AInfo.SaveParams(AViewInfo.Transparent); + if not DateNavigator.DoCustomDrawDayCaption(Canvas, AInfo) then + begin + cxApplyViewParams(Canvas, AInfo.ViewParams); + if not AInfo.Transparent then + Canvas.FillRect(AInfo.Bounds, AInfo.ViewParams); + Canvas.Brush.Style := bsClear; + Canvas.DrawText(AInfo.Text, cxRectOffset(AInfo.Bounds, -2, 0), cxdnTextFlags); + Canvas.Brush.Style := bsSolid; + end; + AInfo.RestoreParams; + end; +end; + +procedure TcxSchedulerDateNavigatorPainter.DoDrawDayNumbers( + AViewInfo: TcxSchedulerDateNavigatorMonthContentViewInfo); +var + I: Integer; + ADayInfo: TcxSchedulerDateNavigatorDayNumberViewInfo; +begin + for I := 0 to AViewInfo.FDayCount - 1 do + begin + ADayInfo := AViewInfo.FDays[I]; + ADayInfo.SaveParams(AViewInfo.Transparent and not ADayInfo.Selected); + if not DateNavigator.DoCustomDrawDayNumber(Canvas, ADayInfo) then + DrawDayNumber(ADayInfo); + ADayInfo.RestoreParams; + end; +end; + +procedure TcxSchedulerDateNavigatorPainter.DoDrawMonthContent( + AViewInfo: TcxSchedulerDateNavigatorMonthContentViewInfo); +begin + AViewInfo.SaveParams; + if not DateNavigator.DoCustomDrawContent(Canvas, AViewInfo) then + // use owner's bounds + Canvas.FillRect(AViewInfo.Owner.Bounds, AViewInfo.ViewParams); + AViewInfo.RestoreParams; +end; + +procedure TcxSchedulerDateNavigatorPainter.DoDrawMonthHeader( + AViewInfo: TcxSchedulerDateNavigatorMonthHeaderViewInfo); +begin + AViewInfo.SaveParams(False); + if not DateNavigator.DoCustomDrawHeader(Canvas, AViewInfo) then + begin + FHeaderTransparent := AViewInfo.Transparent; + DrawMonthHeader(AViewInfo); + end; + AViewInfo.RestoreParams; +end; + +procedure TcxSchedulerDateNavigatorPainter.DrawDayNumber( + ADayInfo: TcxSchedulerDateNavigatorDayNumberViewInfo); +begin + cxApplyViewParams(Canvas, ADayInfo.ViewParams); + with Canvas do + begin + if DateNavigator.ShowDatesContainingEventsInBold then + begin + if ADayInfo.Bold then + Font.Style := Font.Style + [fsBold] + else + Font.Style := Font.Style - [fsBold]; + end; + if DateNavigator.ShowDatesContainingHolidaysInColor and + ADayInfo.Holiday then + Font.Color := DateNavigator.HolidayColor; + if not ADayInfo.Transparent then + begin + FillRect(ADayInfo.Bounds, ADayInfo.ViewParams); + if not cxRectIsEmpty(ADayInfo.SelectionSideBounds) then + FillRect(ADayInfo.SelectionSideBounds); + end; + CheckDrawFrame(ADayInfo.Bounds, ADayInfo.Date); + Brush.Style := bsClear; + DrawText(ADayInfo.Text, cxRectOffset(ADayInfo.Bounds, -2, 0), cxdnTextFlags); + Brush.Style := bsSolid; + end; +end; + +procedure TcxSchedulerDateNavigatorPainter.DrawBackground; +var + AViewParams: TcxViewParams; +begin + with DateNavigator do + begin + AViewParams := Styles.GetBackgroundParams; + if not DoCustomDrawBackground(Canvas, ClientRect, AViewParams) then + Canvas.FillRect(ClientRect, AViewParams); + end; +end; + +procedure TcxSchedulerDateNavigatorPainter.DrawMonthHeader( + AViewInfo: TcxSchedulerDateNavigatorMonthHeaderViewInfo); +begin + FHeaderParams := AViewInfo.ViewParams; + DateNavigator.LookAndFeelPainter.DrawMonthHeader(Canvas, AViewInfo.Bounds, + AViewInfo.Text, AViewInfo.Neighbors, FHeaderParams, AViewInfo.Arrows, + DateNavigator.ViewInfo.SideWidth, DrawHeaderBackground); +end; + +procedure TcxSchedulerDateNavigatorPainter.DrawSeparators( + AViewInfo: TcxSchedulerDateNavigatorMonthContentViewInfo); +begin + with Canvas do + begin + SetBrushColor(clBtnShadow); + FillRect(AViewInfo.HorzSeparatorBound); + if DateNavigator.ShowWeekNumbers then + begin + FillRect(cxRectSetWidth(AViewInfo.VertSeparatorBound, 1)); + SetBrushColor(clBtnHighlight); + FillRect(cxRectSetWidth(AViewInfo.VertSeparatorBound, + AViewInfo.VertSeparatorBound.Left + 1, 1)); + end; + end; +end; + +procedure TcxSchedulerDateNavigatorPainter.DrawWeekNumbers( + AViewInfo: TcxSchedulerDateNavigatorMonthContentViewInfo); +var + I: Integer; +begin + with Canvas do + begin + Brush.Style := bsClear; + Font := AViewInfo.ViewParams.Font; + Font.Color := AViewInfo.ViewParams.TextColor; + Font.Size := MulDiv(AViewInfo.ViewParams.Font.Size, 2, 3); + with AViewInfo do + for I := 0 to FWeekCount - 1 do + DrawText(FWeekTexts[I], FWeekBounds[I], cxdnTextFlags); + Brush.Style := bsSolid; + Font.Size := AViewInfo.ViewParams.Font.Size; + end; +end; + +procedure TcxSchedulerDateNavigatorPainter.CheckDrawFrame( + const ABounds: TRect; ADate: TDateTime); +begin + if ADate = DateNavigator.Controller.DragDate then + Canvas.FrameRect(ABounds, clWindowText, 2) + else + if ADate = DateNavigator.FToday then + begin + Canvas.SetBrushColor(clMaroon); + Canvas.FrameRect(ABounds); + end; +end; + +function TcxSchedulerDateNavigatorPainter.DrawHeaderBackground(ACanvas: TcxCanvas; + const ABounds: TRect): Boolean; +begin + Result := True; + if not FHeaderTransparent then + ACanvas.FillRect(ABounds, FHeaderParams); +end; + +{ TcxSchedulerDateNavigatorCaptionViewInfo } + +procedure TcxSchedulerDateNavigatorCaptionViewInfo.RestoreParams; +begin + FViewParams := FSaveParams; +end; + +procedure TcxSchedulerDateNavigatorCaptionViewInfo.SaveParams(ATransparent: Boolean); +begin + FSaveParams := FViewParams; + FTransparent := ATransparent; +end; + +{ TcxSchedulerDateNavigatorMonthHeaderViewInfo } + +constructor TcxSchedulerDateNavigatorMonthHeaderViewInfo.Create( + AOwner: TcxSchedulerDateNavigatorMonthViewInfo); +begin + inherited Create; + FOwner := AOwner; +end; + +procedure TcxSchedulerDateNavigatorMonthHeaderViewInfo.Calculate(const ABounds: TRect); +var + ADate: TcxDateTime; +begin + ADate.Era := Era; + ADate.Year := Year; + ADate.Month := Month; + with ADate do + begin + Day := 1; + Hours := 0; + Minutes := 0; + Seconds := 0; + Milliseconds := 0; + end; + FBounds := ABounds; + FText := cxGetLocalMonthYear(Calendar.ToDateTime(ADate), Calendar); + FArrows := Owner.GetHeaderArrows; + FNeighbors := Owner.GetHeaderNeighbors; + FMonthNameBounds := GetMonthNameBounds; + FViewParams := Owner.Owner.HeaderParams; + FTransparent := False; +end; + +function TcxSchedulerDateNavigatorMonthHeaderViewInfo.GetCalendar: TcxCustomCalendarTable; +begin + Result := Owner.Owner.Calendar; +end; + +function TcxSchedulerDateNavigatorMonthHeaderViewInfo.GetEra: Integer; +begin + Result := Owner.Era; +end; + +function TcxSchedulerDateNavigatorMonthHeaderViewInfo.GetMonth: Integer; +begin + Result := Owner.Month; +end; + +function TcxSchedulerDateNavigatorMonthHeaderViewInfo.GetMonthNameBounds: TRect; +begin + Result := Bounds; + with Result do + begin + Inc(Left, Owner.Owner.ColWidth); + Dec(Right, Owner.Owner.ColWidth); + Dec(Bottom); + Inc(Top); + end; +end; + +function TcxSchedulerDateNavigatorMonthHeaderViewInfo.GetYear: Integer; +begin + Result := Owner.Year; +end; + +{ TcxSchedulerDateNavigatorMonthContentViewInfo } + +constructor TcxSchedulerDateNavigatorMonthContentViewInfo.Create( + AOwner: TcxSchedulerDateNavigatorMonthViewInfo); +begin + inherited Create; + FOwner := AOwner; + FViewInfo := AOwner.Owner; + FDateNavigator := AOwner.Owner.Owner; + FFont := TFont.Create; + CreateDayInfos; + CreateDayCaptionInfos; +end; + +destructor TcxSchedulerDateNavigatorMonthContentViewInfo.Destroy; +begin + DestroyDayCaptionInfos; + DestroyDayInfos; + FFont.Free; + inherited Destroy; +end; + +procedure TcxSchedulerDateNavigatorMonthContentViewInfo.CalcAndAddDayInfo(ADate: TDateTime; + const ABounds: TRect; const ASelectionSideBounds: TRect); +var + ASelected: Boolean; +begin + ASelected := DateNavigator.IsDateSelected(ADate); + with FDays[FDayCount] do + begin + FBold := DateNavigator.IsDateHasEvent(ADate); + FHoliday := DateNavigator.IsDateHasHoliday(ADate); + FBounds := ABounds; + FDate := ADate; + FGrayed := GetGrayed(ADate); + FSelected := ASelected; + if ASelected and DateNavigator.CanDrawSelectionSide then + FSelectionSideBounds := ASelectionSideBounds + else + FSelectionSideBounds := cxNullRect; + FText := cxDayNumberToLocalFormatStr(ADate); + FViewParams := GetDateViewParams(ADate, ASelected); + if FGrayed then FViewParams.TextColor := clGrayText; + end; + Inc(FDayCount); +end; + +procedure TcxSchedulerDateNavigatorMonthContentViewInfo.Calculate( + ACol, ARow: Integer; ADate: TcxDateTime); +begin + FBounds := ViewInfo.GetInternalRect(ACol, ARow); + FRow := ARow; + FCol := ACol; + FDate := ADate; + CalcParams; + CalcDayCaptions; + CalcDays; + with FWeekSelectionBarBounds do + begin + Left := Bounds.Left; + Top := Bounds.Top + ViewInfo.DayCaptionsHeight; + Right := Left + ViewInfo.SideWidth; + Bottom := Top + ViewInfo.RowHeight * FWeekCount; + end; + CalcSeparatorsBound; +end; + +procedure TcxSchedulerDateNavigatorMonthContentViewInfo.CalcDays; +var + R: TRect; + I, J, ADayBase, ADaysPerMonth: Integer; + ADate, ADateBase: TDateTime; + AHasDate: Boolean; + + procedure CheckCalcWeekNumber(const R: TRect); + begin + if DateNavigator.ShowWeekNumbers then + begin + FWeekBounds[FWeekCount] := cxRect(R.Left - ViewInfo.SideWidth, + R.Top - 1, R.Left - 3, R.Bottom); + FWeekTexts[FWeekCount] := IntToStr(Calendar.GetWeekNumber(ADate, DateNavigator.StartOfWeek, DateNavigator.FActualFirstWeekOfYear)); + end; + Inc(FWeekCount); + end; + + function GetDate(out ADate: TDateTime): Boolean; + var + ACurDay: Integer; + begin + ACurDay := ADayBase + J * 7 + I; + Result := not ((ACurDay < 1) and (FCol + FRow <> 0) or + (ACurDay > ADaysPerMonth) and ((FCol <> ViewInfo.ColCount - 1) or + (FRow <> ViewInfo.RowCount - 1))); + ADate := ADateBase + ACurDay; + end; + +var + ACalDate: TcxDateTime; +begin + FDayCount := 0; + FWeekCount := 0; + with ACalDate do + begin + Era := FDate.Era; + Year := FDate.Year; + Month := FDate.Month; + Day := 1; + Hours := 0; + Minutes := 0; + Seconds := 0; + Milliseconds := 0; + end; + ADateBase := GetCalendar.ToDateTime(ACalDate) - 1; + ADayBase := 1 - ColOfDate(ADateBase + 1, Byte(DateNavigator.StartOfWeek)); + if (ADayBase = 1) and (FCol + FRow = 0) then Dec(ADayBase, 7); + ADaysPerMonth := Calendar.GetDaysInMonth(ACalDate.Year, ACalDate.Month); + for I := 0 to 6 do + for J := 0 to 5 do + begin + AHasDate := GetDate(ADate); + R := GetDayRectFromColAndRow(I, J); + if (I = 0) and not ((J = 5) and not AHasDate) then + CheckCalcWeekNumber(R); + if AHasDate then + CalcAndAddDayInfo(ADate, R, GetSelectionSideBounds(R, I)); + end; +end; + +procedure TcxSchedulerDateNavigatorMonthContentViewInfo.CalcDayCaptions; +var + I: Integer; + R: TRect; +begin + with R do + begin + Top := Bounds.Top; + Bottom := Top + ViewInfo.DayCaptionsHeight - 2; + Right := Bounds.Left + ViewInfo.SideWidth; + end; + for I := 0 to 6 do + begin + with R do + begin + Left := Right; + Right := Left + ViewInfo.ColWidth; + end; + FDayCaptions[I].FBounds := R; + FDayCaptions[I].FIndex := I; + FDayCaptions[I].FText := GetDayCaptionText(I); + FDayCaptions[I].FViewParams := ViewParams; + end; +end; + +procedure TcxSchedulerDateNavigatorMonthContentViewInfo.CalcParams; +begin + FViewParams := ViewInfo.ContentParams; + FSelectedParams := ViewInfo.SelectedParams; + FFontCharset := FViewParams.Font.Charset; + if FFontCharset = DEFAULT_CHARSET then + FFontCharset := GetDefFontCharset; +end; + +procedure TcxSchedulerDateNavigatorMonthContentViewInfo.CalcSeparatorsBound; +begin + with FHorzSeparatorBound do + begin + Left := Bounds.Left + ViewInfo.SideWidth; + Right := Bounds.Right - ViewInfo.SideWidth + 1; + Top := Bounds.Top + ViewInfo.DayCaptionsHeight - 2; + Bottom := Top + 1; + end; + if DateNavigator.ShowWeekNumbers then + begin + with FVertSeparatorBound do + begin + Left := WeekSelectionBarBounds.Right; + Right := Left + 2; + Top := WeekSelectionBarBounds.Top - 1; + Bottom := WeekSelectionBarBounds.Bottom; + end + end + else + FVertSeparatorBound := cxNullRect; +end; + +function TcxSchedulerDateNavigatorMonthContentViewInfo.GetDateViewParams(ADate: TDateTime; + ASelected: Boolean): TcxViewParams; +begin + if ASelected then + Result := SelectedParams + else + Result := ViewParams; +end; + +function TcxSchedulerDateNavigatorMonthContentViewInfo.GetDayCaptionText(Index: Byte): string; +var + ADayIndex: Integer; +begin + if IsValidDayCaptionIndex(Index) then + begin + ADayIndex := Byte(DateNavigator.StartOfWeek) + Index; + if ADayIndex > 7 then + Dec(ADayIndex, 7) + else + if ADayIndex <= 0 then + Inc(ADayIndex, 7); + Result := cxGetDayOfWeekName(ADayIndex, FFontCharset); + end + else + Result := ''; +end; + +function TcxSchedulerDateNavigatorMonthContentViewInfo.GetWeekBound(Index: Byte): TRect; +begin + if IsValidWeekIndex(Index) then + Result := FWeekBounds[Index] + else + Result := cxNullRect; +end; + +function TcxSchedulerDateNavigatorMonthContentViewInfo.GetDayText(ADate: TDateTime): string; +begin + if ADate <> NullDate then + Result := IntToStr(GetDateElement(ADate, deDay, Calendar)) + else + Result := ''; +end; + +function TcxSchedulerDateNavigatorMonthContentViewInfo.GetWeekText(Index: Byte): string; +begin + if IsValidWeekIndex(Index) then + Result := FWeekTexts[Index] + else + Result := ''; +end; + +procedure TcxSchedulerDateNavigatorMonthContentViewInfo.RestoreParams; +begin + FViewParams := FSaveParams; +end; + +procedure TcxSchedulerDateNavigatorMonthContentViewInfo.SaveParams; +begin + FTransparent := False; + FSaveParams := FViewParams; +end; + +procedure TcxSchedulerDateNavigatorMonthContentViewInfo.UpdateElementsAfterCustomDraw( + ACanvas: TcxCanvas); +var + I: Integer; +begin + FFont.Assign(ACanvas.Font); + for I := 0 to 6 do + with FDayCaptions[I] do + begin + FViewParams.Color := Self.ViewParams.Color; + FViewParams.TextColor := Self.ViewParams.TextColor; + FViewParams.Font := FFont; + end; + for I := 0 to FDayCount - 1 do + with FDays[I] do + if not Selected then + begin + if not Grayed then + FViewParams.TextColor := Self.ViewParams.TextColor; + FViewParams.Color := Self.ViewParams.Color; + FViewParams.Font := FFont; + end; +end; + +procedure TcxSchedulerDateNavigatorMonthContentViewInfo.CreateDayInfos; +var + I: Integer; +begin + for I := 0 to cxMaxMonthViewInfoDays - 1 do + FDays[I] := TcxSchedulerDateNavigatorDayNumberViewInfo.Create; +end; + +procedure TcxSchedulerDateNavigatorMonthContentViewInfo.CreateDayCaptionInfos; +var + I: Integer; +begin + for I := 0 to 6 do + FDayCaptions[I] := TcxSchedulerDateNavigatorDayCaptionViewInfo.Create; +end; + +procedure TcxSchedulerDateNavigatorMonthContentViewInfo.DestroyDayInfos; +var + I: Integer; +begin + for I := 0 to cxMaxMonthViewInfoDays - 1 do + FDays[I].Free; + FDayCount := 0; +end; + +procedure TcxSchedulerDateNavigatorMonthContentViewInfo.DestroyDayCaptionInfos; +var + I: Integer; +begin + for I := 0 to 6 do + FDayCaptions[I].Free; +end; + +function TcxSchedulerDateNavigatorMonthContentViewInfo.GetCalendar: TcxCustomCalendarTable; +begin + Result := DateNavigator.Calendar; +end; + +function TcxSchedulerDateNavigatorMonthContentViewInfo.GetDayCaptionInfo( + Index: Byte): TcxSchedulerDateNavigatorDayCaptionViewInfo; +begin + if IsValidDayCaptionIndex(Index) then + Result := FDayCaptions[Index] + else + Result := nil; +end; + +function TcxSchedulerDateNavigatorMonthContentViewInfo.GetDayRectFromColAndRow( + ACol, ARow: Integer): TRect; +begin + with Result do + begin + Left := Bounds.Left + ViewInfo.SideWidth + ACol * ViewInfo.ColWidth + 2; + Top := Bounds.Top + ViewInfo.DayCaptionsHeight + ARow * ViewInfo.RowHeight; + Right := Left + ViewInfo.ColWidth; + Bottom := Top + ViewInfo.RowHeight; + end; +end; + +function TcxSchedulerDateNavigatorMonthContentViewInfo.GetDayNumberViewInfo( + Index: Byte): TcxSchedulerDateNavigatorDayNumberViewInfo; +begin + if IsValidDayIndex(Index) then + Result := FDays[Index] + else + begin + Result.Text := ''; + FillChar(Result, SizeOf(Result), 0); + end; +end; + +function TcxSchedulerDateNavigatorMonthContentViewInfo.GetEra: Integer; +begin + Result := FDate.Era; +end; + +function TcxSchedulerDateNavigatorMonthContentViewInfo.GetGrayed(ADate: TDateTime): Boolean; +begin + Result := (ADate < DateNavigator.FirstDate) and (FCol + FRow = 0) or + (ADate > DateNavigator.LastDate) and (FCol = ViewInfo.ColCount - 1) and + (FRow = ViewInfo.RowCount - 1); +end; + +function TcxSchedulerDateNavigatorMonthContentViewInfo.GetMonth: Integer; +begin + Result := FDate.Month; +end; + +function TcxSchedulerDateNavigatorMonthContentViewInfo.GetSelectionSideBounds( + const ADayBounds: TRect; ACol: Integer): TRect; +begin + if ((ACol = 0) or (ACol = 6)) and not DateNavigator.ShowWeekNumbers then + begin + Result := ADayBounds; + with Result do + if ACol = 0 then + begin + Right := Left; + Left := Right - ViewInfo.ColWidth div 2; + end + else + begin + Left := Right; + Right := Left + ViewInfo.ColWidth div 2; + end; + end + else Result := cxNullRect; +end; + +function TcxSchedulerDateNavigatorMonthContentViewInfo.GetYear: Integer; +begin + Result := FDate.Year; +end; + +function TcxSchedulerDateNavigatorMonthContentViewInfo.IsValidDayIndex(Index: Byte): Boolean; +begin + Result := Index < FDayCount; +end; + +function TcxSchedulerDateNavigatorMonthContentViewInfo.IsValidDayCaptionIndex(Index: Byte): Boolean; +begin + Result := Index in [0..6]; +end; + +function TcxSchedulerDateNavigatorMonthContentViewInfo.IsValidWeekIndex(Index: Byte): Boolean; +begin + Result := Index < FWeekCount; +end; + +procedure TcxSchedulerDateNavigatorMonthContentViewInfo.SetWeekText(Index: Byte; const Value: string); +begin + if IsValidWeekIndex(Index) then + FWeekTexts[Index] := Value; +end; + +{ TcxSchedulerDateNavigatorMonthViewInfo } + +constructor TcxSchedulerDateNavigatorMonthViewInfo.Create( + AOwner: TcxSchedulerDateNavigatorViewInfo); +begin + inherited Create; + FOwner := AOwner; + FHeader := TcxSchedulerDateNavigatorMonthHeaderViewInfo.Create(Self); + FContent := TcxSchedulerDateNavigatorMonthContentViewInfo.Create(Self); +end; + +destructor TcxSchedulerDateNavigatorMonthViewInfo.Destroy; +begin + FContent.Free; + FHeader.Free; + inherited Destroy; +end; + +procedure TcxSchedulerDateNavigatorMonthViewInfo.Calculate(ACol, ARow: Integer; + ADate: TcxDateTime); +begin + FBounds := Owner.GetMonthRect(ACol, ARow); + FRow := ARow; + FCol := ACol; + FDate := ADate; + Header.Calculate(Owner.GetHeaderRect(ACol, ARow)); + Content.Calculate(ACol, ARow, ADate); +end; + +function TcxSchedulerDateNavigatorMonthViewInfo.GetHeaderArrows: TcxHeaderArrows; +const + Arrows: array[Boolean, Boolean] of TcxHeaderArrows = + ((haNone, haRight), (haLeft, haBoth)); +begin + if Row = 0 then + Result := Arrows[Col = 0, Col = Owner.ColCount - 1] + else + Result := haNone; +end; + +function TcxSchedulerDateNavigatorMonthViewInfo.GetHeaderNeighbors: TcxNeighbors; +begin + if Owner.ColCount = 1 then + Result := [] + else if Col = 0 then + Result := [nRight] + else if Col = Owner.ColCount - 1 then + Result := [nLeft] + else + Result := [nLeft, nRight]; +end; + +function TcxSchedulerDateNavigatorMonthViewInfo.GetEra: Integer; +begin + Result := FDate.Era; +end; + +function TcxSchedulerDateNavigatorMonthViewInfo.GetMonth: Integer; +begin + Result := FDate.Month; +end; + +function TcxSchedulerDateNavigatorMonthViewInfo.GetYear: Integer; +begin + Result := FDate.Year; +end; + +{ TcxSchedulerDateNavigatorStyles } + +constructor TcxSchedulerDateNavigatorStyles.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + BitmapInViewParams := True; +end; + +procedure TcxSchedulerDateNavigatorStyles.Assign(Source: TPersistent); +var + I: Integer; +begin + if Source is TcxSchedulerDateNavigatorStyles then + begin + for I := cxdnBackground to cxdnSelection do + SetValue(I, TcxSchedulerDateNavigatorStyles(Source).GetValue(I)) + end; + inherited Assign(Source); +end; + +procedure TcxSchedulerDateNavigatorStyles.Changed(AIndex: Integer); +begin + DateNavigator.CheckSizes; + DateNavigator.Refresh; +end; + +function TcxSchedulerDateNavigatorStyles.GetBackgroundParams: TcxViewParams; +begin + GetViewParams(cxdnBackground, nil, nil, Result); +end; + +function TcxSchedulerDateNavigatorStyles.GetContentParams: TcxViewParams; +begin + GetViewParams(cxdnContent, nil, nil, Result); +end; + +function TcxSchedulerDateNavigatorStyles.GetHeaderParams: TcxViewParams; +begin + GetViewParams(cxdnHeader, nil, nil, Result); +end; + +function TcxSchedulerDateNavigatorStyles.GetSelectionParams: TcxViewParams; +begin + GetViewParams(cxdnSelection, nil, nil, Result); +end; + +procedure TcxSchedulerDateNavigatorStyles.GetDefaultViewParams( + Index: Integer; AData: TObject; out AParams: TcxViewParams); + + function Painter: TcxCustomLookAndFeelPainterClass; + begin + Result := DateNavigator.LookAndFeelPainter; + end; + +begin + AParams.Bitmap := nil; + AParams.Font := DateNavigator.Scheduler.Font; + case Index of + cxdnHeader: + begin + AParams.Color := Painter.DefaultHeaderColor; + AParams.TextColor := Painter.DefaultHeaderTextColor; + end; + cxdnBackground, cxdnContent: + begin + AParams.Color := Painter.DefaultSchedulerBackgroundColor; + AParams.TextColor := Painter.DefaultSchedulerTextColor; + end; + cxdnSelection: + begin + AParams.Font := GetContentParams.Font; + AParams.Color := Painter.DefaultDateNavigatorSelectionColor; + AParams.TextColor := Painter.DefaultDateNavigatorSelectionTextColor; + end; + end; +end; + +function TcxSchedulerDateNavigatorStyles.GetDateNavigator: TcxSchedulerDateNavigator; +begin + Result := TcxSchedulerDateNavigator(inherited Owner); +end; + +{ TcxSchedulerDateNavigatorHitTest } + +procedure TcxSchedulerDateNavigatorHitTest.Clear; +begin + inherited Clear; + FTime := NullDate; + FHitDate := NullDate; + FMonthViewInfo := nil; +end; + +procedure TcxSchedulerDateNavigatorHitTest.DoCalculate; +var + ACol, ARow: Integer; +begin + inherited DoCalculate; + if cxRectPtIn(ViewInfo.CalendarBounds, HitPoint) then + begin + SetBitState(htcCalendar, True); + ACol := ViewInfo.GetCol(HitX); + ARow := ViewInfo.GetRow(HitY); + FTime := ChangeMonthByCalendar(Owner.FirstDate, True, + ARow * ViewInfo.ColCount + ACol, Owner.Calendar); + FMonthViewInfo := ViewInfo.MonthViewInfo[ACol, ARow]; + CalcMonth; + end; +end; + +procedure TcxSchedulerDateNavigatorHitTest.CalcMonth; +var + R: TRect; + ADate: TDateTime; + AFirstWeekSelectableDate: TDateTime; +begin + if CheckMonthHeader or CheckWeekSelectionBar or CheckDayCaptions then Exit; + R := GetDatesBounds; + if cxRectPtIn(R, HitPoint) then + begin + AFirstWeekSelectableDate := GetFirstWeekSelectableDate; + SetBitState(htcTime, True); + ADate := AFirstWeekSelectableDate + + ((HitY - R.Top) div ViewInfo.RowHeight) * 7 + ((HitX - R.Left) div ViewInfo.ColWidth); + FHitDate := DateOf(ADate); + if (ADate < FTime) and (MonthViewInfo.Col + MonthViewInfo.Row > 0) then Exit; + FTime := FTime + DaysPerMonth(MonthViewInfo.Year, MonthViewInfo.Month) - 1; + if (ADate > FTime) and not ((MonthViewInfo.Col = Owner.ColCount - 1) and + (MonthViewInfo.Row = Owner.RowCount - 1)) then Exit; + FTime := ADate; + end; +end; + +function TcxSchedulerDateNavigatorHitTest.CheckDayCaptions: Boolean; +var + R: TRect; +begin + R := MonthViewInfo.Bounds; + with R do + begin + Inc(Left, ViewInfo.SideWidth); + Dec(Right, ViewInfo.SideWidth); + Bottom := Top + ViewInfo.DayCaptionsHeight; + end; + Result := cxRectPtIn(R, HitPoint); + if Result then + SetBitState(htcDayCaptions, True); +end; + +function TcxSchedulerDateNavigatorHitTest.CheckMonthHeader: Boolean; +begin + Result := False; + if cxRectPtIn(MonthViewInfo.Header.MonthNameBounds, HitPoint) then + begin + SetBitState(htcMonthName, True); + Result := True; + end + else + if cxRectPtIn(ViewInfo.GetLeftArrowRect, HitPoint) then + begin + SetBitState(htcPrevMonth, True); + Result := True; + end + else + if cxRectPtIn(ViewInfo.GetRightArrowRect, HitPoint) then + begin + SetBitState(htcNextMonth, True); + Result := True; + end; +end; + +function TcxSchedulerDateNavigatorHitTest.CheckWeekSelectionBar: Boolean; +var + AContent: TcxSchedulerDateNavigatorMonthContentViewInfo; +begin + AContent := MonthViewInfo.Content; + Result := cxRectPtIn(AContent.WeekSelectionBarBounds, HitPoint); + if Result then + begin + SetBitState(htcWeekSelectionBar, True); + FTime := GetFirstWeekSelectableDate + + ((HitY - AContent.WeekSelectionBarBounds.Top) div ViewInfo.RowHeight) * 7; + end; +end; + +function TcxSchedulerDateNavigatorHitTest.GetDatesBounds: TRect; +begin + Result := MonthViewInfo.Content.Bounds; + with Result do + begin + Inc(Top, ViewInfo.DayCaptionsHeight); + Inc(Left, ViewInfo.SideWidth + 2); + Dec(Right, ViewInfo.SideWidth); + end; +end; + +function TcxSchedulerDateNavigatorHitTest.GetFirstWeekSelectableDate: TDateTime; +begin + Result := FTime - ColOfDate(FTime, Byte(Owner.StartOfWeek)); + if (MonthViewInfo.Col + MonthViewInfo.Row = 0) and + (ColOfDate(Owner.FirstDate, Byte(Owner.StartOfWeek)) = 0) then + Result := Result - 7; +end; + +function TcxSchedulerDateNavigatorHitTest.GetOwner: TcxSchedulerDateNavigator; +begin + Result := TcxSchedulerDateNavigator(inherited Owner); +end; + +function TcxSchedulerDateNavigatorHitTest.GetViewInfo: TcxSchedulerDateNavigatorViewInfo; +begin + Result := Owner.ViewInfo; +end; + +{ TcxSchedulerDateNavigatorViewInfo } + +constructor TcxSchedulerDateNavigatorViewInfo.Create(AOwner: TcxSchedulerSubControl); +begin + inherited Create(AOwner); + FOwner := TcxSchedulerDateNavigator(AOwner); + FMonthViewInfoList := TList.Create; +end; + +destructor TcxSchedulerDateNavigatorViewInfo.Destroy; +begin + DestroyMonthViewInfoList; + inherited Destroy; +end; + +procedure TcxSchedulerDateNavigatorViewInfo.DoCalculate; +begin + CalculateInternalSizes; + CalculateCalendarBounds; + if Owner.CanCalculateViewInfo then + begin + CheckMonthViewInfoCount; + CalculateMonthViewInfos; + end; +end; + +procedure TcxSchedulerDateNavigatorViewInfo.CalculateCalendarBounds; +begin + FCalendarBounds := Owner.ClientRect; + FColCount := Max(1, Min(cxDaysCalendarMaxColCount, Owner.Width div MonthSize.cx)); + FRowCount := Max(1, Owner.Height div MonthSize.cy); + FCalendarBounds := cxRect(0, 0, ColCount * MonthSize.cx, RowCount * MonthSize.cy); + FCalendarBounds := cxRectOffset(FCalendarBounds, + (Owner.Width - cxRectWidth(CalendarBounds)) div 2, + (Owner.Height - cxRectHeight(CalendarBounds)) div 2); + if FCalendarBounds.Left < 0 then + FCalendarBounds := cxRectSetLeft(FCalendarBounds, 0); + if FCalendarBounds.Top < 0 then + FCalendarBounds := cxRectSetTop(FCalendarBounds, 0); + Owner.UpdateLastDates; +end; + +procedure TcxSchedulerDateNavigatorViewInfo.CalculateInternalSizes; +var + ASymbolSize: TSize; +begin + CalculateViewParams; + FHeaderBorderSize := LookAndFeelPainter.ButtonBorderSize; + FHeaderBorderSize := 1; + ASymbolSize := cxTextExtent(ContentParams.Font, '0'); + FColWidth := 3 * ASymbolSize.cx - 1; + FSideWidth := 2 * ASymbolSize.cx; + FRowHeight := ASymbolSize.cy + 2; + FDayCaptionsHeight := FRowHeight + 1; + FHeaderHeight := cxTextHeight(HeaderParams.Font) + 5; + FMonthSize.cx := (2 * FSideWidth + 7 * FColWidth); + FMonthSize.cy := (FHeaderHeight + FDayCaptionsHeight + 6 * FRowHeight + 1); +end; + +procedure TcxSchedulerDateNavigatorViewInfo.CalculateMonthViewInfos; +var + I, J: Integer; + ADate: TcxDateTime; +begin + ADate := Calendar.FromDateTime(Owner.FirstDate); + for J := 0 to RowCount - 1 do + for I := 0 to ColCount - 1 do + if MonthViewInfo[I, J] <> nil then + begin + MonthViewInfo[I, J].Calculate(I, J, ADate); + ADate := Calendar.FromDateTime(Calendar.AddMonths(ADate, 1)); + end; +end; + +procedure TcxSchedulerDateNavigatorViewInfo.CalculateViewParams; +begin + with Owner.Styles do + begin + FContentParams := GetContentParams; + FHeaderParams := GetHeaderParams; + FSelectedParams := GetSelectionParams; + end; +end; + +procedure TcxSchedulerDateNavigatorViewInfo.CheckMonthViewInfoCount; +var + I, ACount: Integer; +begin + ACount := RowCount * ColCount; + for I := FMonthViewInfoList.Count - 1 downto ACount do + begin + TcxSchedulerDateNavigatorMonthViewInfo(FMonthViewInfoList[I]).Free; + FMonthViewInfoList.Delete(I); + end; + for I := FMonthViewInfoList.Count to ACount - 1 do + FMonthViewInfoList.Add(TcxSchedulerDateNavigatorMonthViewInfo.Create(Self)); +end; + +function TcxSchedulerDateNavigatorViewInfo.GetCol(X: Integer): Integer; +begin + Result := (X - CalendarBounds.Left) div MonthSize.cx; +end; + +function TcxSchedulerDateNavigatorViewInfo.GetHeaderRect(ACol, ARow: Integer): TRect; +begin + with MonthSize do + Result := cxRectOffset(cxRect(0, 0, cx, FHeaderHeight), + CalendarBounds.Left + ACol * cx, CalendarBounds.Top + ARow * cy); +end; + +function TcxSchedulerDateNavigatorViewInfo.GetInternalRect(ACol, ARow: Integer): TRect; +begin + with MonthSize do + Result := cxRectOffset(cxRect(0, FHeaderHeight, cx, cy), + CalendarBounds.Left + ACol * cx, CalendarBounds.Top + ARow * cy); +end; + +function TcxSchedulerDateNavigatorViewInfo.GetLeftArrowRect: TRect; +begin + Result := cxRectBounds(CalendarBounds.Left + 1, CalendarBounds.Top + 1, + FColWidth - 2, FHeaderHeight - 2); +end; + +function TcxSchedulerDateNavigatorViewInfo.GetMonthRect( + ACol, ARow: Integer): TRect; +begin + with MonthSize do + Result := cxRectOffset(cxRect(0, 0, cx, cy), + CalendarBounds.Left + ACol * cx, CalendarBounds.Top + ARow * cy); +end; + +function TcxSchedulerDateNavigatorViewInfo.GetRightArrowRect: TRect; +begin + Result := cxRectBounds(CalendarBounds.Right - FColWidth, + CalendarBounds.Top + HeaderBorderSize, FColWidth - HeaderBorderSize, + FHeaderHeight - HeaderBorderSize); +end; + +function TcxSchedulerDateNavigatorViewInfo.GetRow(Y: Integer): Integer; +begin + Result := (Y - CalendarBounds.Top) div MonthSize.cy; +end; + +procedure TcxSchedulerDateNavigatorViewInfo.DestroyMonthViewInfoList; +var + I: Integer; +begin + for I := 0 to FMonthViewInfoList.Count - 1 do + TcxSchedulerDateNavigatorMonthViewInfo(FMonthViewInfoList[I]).Free; + FreeAndNil(FMonthViewInfoList); +end; + +function TcxSchedulerDateNavigatorViewInfo.GetCalendar: TcxCustomCalendarTable; +begin + Result := Owner.Calendar; +end; + +function TcxSchedulerDateNavigatorViewInfo.GetMonthViewInfo( + ACol, ARow: Integer): TcxSchedulerDateNavigatorMonthViewInfo; +begin + if (ARow < 0) or (ARow >= RowCount) or (ACol < 0) or (ACol >= ColCount) or + ((ARow * ColCount + ACol) >= FMonthViewInfoList.Count) then + Result := nil + else + Result := TcxSchedulerDateNavigatorMonthViewInfo( + FMonthViewInfoList[ARow * ColCount + ACol]); +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerDayView.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerDayView.pas new file mode 100644 index 00000000..1277d9cd --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerDayView.pas @@ -0,0 +1,4098 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerDayView; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, DateUtils, +{$ENDIF} + Windows, Forms, Classes, SysUtils, Math, StdCtrls, Graphics, Controls, + ExtCtrls, cxControls, cxGraphics, cxStyles, cxGeometry, Menus, + cxLookAndFeelPainters, cxSchedulerCustomControls, cxSchedulerCustomResourceView, + cxSchedulerUtils, cxSchedulerStorage, cxSchedulerStrs, cxEdit; + +const + + cxcsHeaderContainer = 0; + cxcsSelectedHeaderContainer = 1; + cxcsTimeLine = 2; + cxcsTimeRuler = 3; + cxcsMaxDayViewValue = cxcsTimeRuler; + //for PS + cxcsDayViewStyleFirst = cxcsHeaderContainer; + cxcsDayViewStyleLast = cxcsMaxDayViewValue; + + cxSchedulerAllDayEventContainerMaxLineCount: Integer = 0; + +type + TcxSchedulerDayViewViewInfo = class; + TcxEventLayoutInfo = class; + TcxCalculateEventLayout = class; + TcxSchedulerDayViewHitTest = class; + TcxSchedulerDayViewController = class; + TcxSchedulerTimeRulerPopupMenu = class; + + TcxSchedulerAllDayAreaScrollBar = (adsbDefault, adsbNever, adsbAlways); + + IcxSchedulerTimeRulerParams = interface + ['{FEAA09ED-8FE1-4968-9BCB-0FC26B13A391}'] + function GetTimeRulerParams: TcxViewParams; + end; + + { TcxSchedulerDayViewStyles } + + TcxSchedulerDayViewStyles = class(TcxStyles) + private + FScheduler: TcxCustomScheduler; + function GetPainter: TcxCustomLookAndFeelPainterClass; + protected + procedure Changed(AIndex: Integer); override; + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + property Painter: TcxCustomLookAndFeelPainterClass read GetPainter; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + function GetHeaderContainerParams(const ADate: TDateTime; + AResource: TcxSchedulerStorageResourceItem; ASelected: Boolean): TcxViewParams; + function GetTimeRulerParams: TcxViewParams; + function GetTimeLineParams: TcxViewParams; + // define colors functions + property Scheduler: TcxCustomScheduler read FScheduler; + published + property HeaderContainer: TcxStyle index cxcsHeaderContainer read GetValue write SetValue; + property SelectedHeaderContainer: TcxStyle index cxcsSelectedHeaderContainer read GetValue write SetValue; + property TimeLine: TcxStyle index cxcsTimeLine read GetValue write SetValue; + property TimeRuler: TcxStyle index cxcsTimeRuler read GetValue write SetValue; + end; + + { TcxSchedulerDayView } + + TcxSchedulerCustomDrawContainerEvent = procedure(Sender: TObject; + ACanvas: TcxCanvas; AViewInfo: TcxSchedulerContainerCellViewInfo; var ADone: Boolean) of object; + TcxSchedulerCustomDrawTimeRulerEvent = procedure(Sender: TObject; + ACanvas: TcxCanvas; AViewInfo: TcxSchedulerTimeRulerCellViewInfo; var ADone: Boolean) of object; + + TcxSchedulerDayView = class(TcxSchedulerCustomResourceView) + private + FAllDayAreaScrollBar: TcxSchedulerAllDayAreaScrollBar; + FAllDayScrollBar: TcxControlScrollBar; + FAlwaysShowEventTime: Boolean; + FAutoContentHeight: Boolean; + FDayHeaderArea: Boolean; + FEventShadows: Boolean; + FHeaderContainer: Boolean; + FShowAllDayEventsInContentArea: Boolean; + FStyles: TcxSchedulerDayViewStyles; + FTimeRulerMinutes: Boolean; + FTimeRulerPopupMenu: TcxSchedulerTimeRulerPopupMenu; + FTimeScale: Integer; + FWorkTimeOnly: Boolean; + FOnCustomDrawContainer: TcxSchedulerCustomDrawContainerEvent; + FOnCustomDrawTimeRuler: TcxSchedulerCustomDrawTimeRulerEvent; + procedure DoAllDayScroll(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer); + function GetHitTest: TcxSchedulerDayViewHitTest; + function GetViewInfo: TcxSchedulerDayViewViewInfo; + procedure InitAllDayScrollBar; + procedure SetAlwaysShowEventTime(AValue: Boolean); + procedure SetAutoContentHeight(AValue: Boolean); + procedure SetEventShadows(AValue: Boolean); + procedure SetHeaderContainer(AValue: Boolean); + procedure SetAllDayAreaScrollBar(AValue: TcxSchedulerAllDayAreaScrollBar); + procedure SetDayHeaderArea(AValue: Boolean); + procedure SetShowAllDayEventsInContentArea(AValue: Boolean); + procedure SetStyles(AValue: TcxSchedulerDayViewStyles); + procedure SetTimeRulerMinutes(AValue: Boolean); + procedure SetTimeRulerPopupMenu(AValue: TcxSchedulerTimeRulerPopupMenu); + procedure SetTimeScale(AValue: Integer); + procedure SetWorkTimeOnly(AValue: Boolean); + protected + procedure DeactivateView; override; + // store interface + procedure GetProperties(AProperties: TStrings); override; + procedure GetPropertyValue(const AName: string; var AValue: Variant); override; + procedure SetPropertyValue(const AName: string; const AValue: Variant); override; + // + procedure CreateSubClasses; override; + procedure DestroySubClasses; override; + function CreateController: TcxSchedulerSubControlController; override; + function CreateHitTest: TcxSchedulerSubControlHitTest; override; + function CreatePainter: TcxSchedulerSubControlPainter; override; + function CreateStyles: TcxSchedulerDayViewStyles; virtual; + function CreateTimeRulerPopupMenu: TcxSchedulerTimeRulerPopupMenu; virtual; + function CreateViewAdapter: TcxCustomResourceViewAdapter; override; + function CreateViewInfo: TcxSchedulerSubControlViewInfo; override; + procedure DoCustomDrawContainer(ACell: TcxSchedulerContainerCellViewInfo; var ADone: Boolean); virtual; + procedure DoCustomDrawTimeRuler(ACell: TcxSchedulerTimeRulerCellViewInfo; var ADone: Boolean); virtual; + function DoShowPopupMenu(X, Y: Integer): Boolean; override; + function EventContentSelected(AEvent: TcxSchedulerControlEvent): Boolean; override; + function GetEditWithSingleLineEditor(AEvent: TcxSchedulerControlEvent): Boolean; override; + function GetFirstVisibleTime: TDateTime; override; + function GetLastVisibleTime: TDateTime; override; + function GetTimeIncrement: TDateTime; override; + function GetViewContentRect: TRect; override; + function IsDayView: Boolean; override; + procedure MakeEventVisible(AEvent: TcxSchedulerControlEvent; const ADate: TDateTime; + AResource: TcxSchedulerStorageResourceItem); override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); override; + procedure ScrollVisibleDays(AScrollUp: Boolean); override; + + procedure TimeChanged; override; + procedure VisibleChanged; override; + + property AllDayScrollBar: TcxControlScrollBar read FAllDayScrollBar; + property ViewInfo: TcxSchedulerDayViewViewInfo read GetViewInfo; + public + constructor Create(AOwner: TcxCustomScheduler); override; + destructor Destroy; override; + + procedure Assign(Source: TPersistent); override; + procedure MakeWorkTimeVisible; + + property HitTest: TcxSchedulerDayViewHitTest read GetHitTest; + property Scheduler; + property WorkDays; + property WorkStart; + property WorkFinish; + published + property CanShow; //before active + property Active; + property AllDayAreaScrollBar: TcxSchedulerAllDayAreaScrollBar + read FAllDayAreaScrollBar write SetAllDayAreaScrollBar default adsbDefault; + property AlwaysShowEventTime: Boolean read FAlwaysShowEventTime write SetAlwaysShowEventTime default False; + property AutoContentHeight: Boolean read FAutoContentHeight write SetAutoContentHeight default False; + property DayHeaderArea: Boolean read FDayHeaderArea write SetDayHeaderArea default True; + property EventImagesLayout default eilAuto; + property EventShadows: Boolean read FEventShadows write SetEventShadows default True; + property GroupingKind; + property HeaderContainer: Boolean read FHeaderContainer write SetHeaderContainer default True; + property ShowAllDayEventsInContentArea: Boolean read FShowAllDayEventsInContentArea + write SetShowAllDayEventsInContentArea default False; + property Styles: TcxSchedulerDayViewStyles read FStyles write SetStyles; + property TimeRulerMinutes: Boolean read FTimeRulerMinutes write SetTimeRulerMinutes default False; + property TimeRulerPopupMenu: TcxSchedulerTimeRulerPopupMenu read FTimeRulerPopupMenu write SetTimeRulerPopupMenu; + property TimeScale: Integer read FTimeScale write SetTimeScale default cxDefaultTimeScale; + property WorkTimeOnly: Boolean read FWorkTimeOnly write SetWorkTimeOnly default False; + property OnCustomDrawContainer: TcxSchedulerCustomDrawContainerEvent read FOnCustomDrawContainer write FOnCustomDrawContainer; + property OnCustomDrawTimeRuler: TcxSchedulerCustomDrawTimeRulerEvent read FOnCustomDrawTimeRuler write FOnCustomDrawTimeRuler; + end; + + { TcxSchedulerDayViewAdapter } + + TcxSchedulerDayViewAdapter = class(TcxCustomResourceViewAdapter) + protected + FTopIndex: Integer; + function GetPrintRange(Index: Integer): TDateTime; override; + procedure Store; override; + procedure Restore; override; + end; + + { TcxSchedulerDayViewEventCellViewInfo } + + TcxSchedulerDayViewEventCellViewInfo = class(TcxSchedulerEventCellViewInfo) + protected + procedure CalculateCaptions; override; + procedure CalculateEventTimeVisibility; override; + procedure CalculateDetailInfo; override; + procedure CalculateShowTimeAsClock; override; + procedure CalculateItemsLayout; override; + procedure CalculateNonDetailEventTimeVisibility; override; + procedure CalculateTimeLineParams; + function CanShowHint: Boolean; override; + procedure DrawContent; override; + procedure DrawSelection; + procedure DrawShadow; + procedure DrawState; overload; + function GetEditingRect: TRect; override; + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + function IsHorzSizing: Boolean; override; + function IsNeedDrawTime: Boolean; override; + function IsShowHeaderEventsInContentArea: Boolean; + function IsTimeLineVisible: Boolean; override; + end; + + { TcxSchedulerDayViewViewInfo } + + TcxSchedulerDayViewViewInfo = class(TcxSchedulerCustomResourceViewViewInfo) + private + function GetAllDayEventMaxCount: Integer; + function GetAutoHeight: Boolean; + function GetColumnInGroup: Integer; + function GetContentHeight: Integer; + function GetController: TcxSchedulerDayViewController; + function GetDayView: TcxSchedulerDayView; + function GetGroupCount: Integer; + function GetHeaderContainer: Boolean; + function GetPrintRowCount: Integer; + function GetLinePerHour: Integer; + function NeedAllDayScrollBar: Boolean; + procedure SetLargeFont(AFont: TFont); + protected + Builder: TcxSchedulerEventLayoutBuilder; + FAdditionalTimeZone: Integer; + FAdditionalTimeZoneBiasDelta: Integer; + FBackground: TcxSchedulerBackgroundCellViewInfo; + FColCount: Integer; + FContentOffset: Integer; + FCurrentTimeZone: Integer; + FDayRowCount: Integer; + FEventLayout: TcxCalculateEventLayout; + FHeaderLineCount: Integer; + FHeaderLineHeight: Integer; + FHeaderOffsetLeft: Integer; + FAllDayTopIndex: Integer; + FIsContainerSelected: Boolean; + FLargeFont: TFont; + FPrintStartRow: Integer; + FPrintFinishRow: Integer; + FRowCount: Integer; + FTimeRulerCells: TcxSchedulerViewInfoCellList; + FTopIndex: Integer; + FTimeScale: Integer; + FUnusedRowCount: Integer; + FVisibleRowCount: Integer; + function AddContentCell(const ARect: TRect; const AStart, AFinish: TDateTime; + AResourceIndex: Integer): TcxSchedulerContentCellViewInfo; override; + procedure AddContainerCell(AColumn: Integer; const ABounds: TRect); + procedure AddHeaderContainerEvent(APlace: TcxSchedulerEventPlace); + procedure AddHeaderContainerEventPlace(AEvent: TcxSchedulerControlEvent; var AColIndex: Integer); + procedure AddMoreEventsButton(const ARowIndex: Integer; AIsTop: Boolean; AEvent: TcxSchedulerEvent); + procedure CalculateAllDayScrollBar; + procedure CalculateBackground; virtual; + procedure CalculateContent; virtual; + procedure CalculateContentNavigationButtons; override; + procedure CalculateEvents; virtual; + procedure CalculateEventsForColumn(AIndex: Integer; + AContainer: TcxSchedulerContainerCellViewInfo; AEvents: TcxSchedulerEventList); virtual; + procedure CalculateHeaderEvents; virtual; + procedure CalculateHeaderEventsPlace; + procedure CalculateHeaderLineCount; + procedure CalculateHeaders; virtual; + procedure CalculateMetrics; override; + procedure CalculateMetricsForPrinting; + procedure CalculateDisplayRows; + procedure CalculateTimeLine; virtual; + procedure CalculateTimeZoneBiasDelta; + procedure CalculateVisibleRows; + procedure CalculateUnusedRowCount; + function CheckDisplayRows(var AStartRow, AFinishRow: Integer): Boolean; + procedure CheckEventRowsVisibility(AEvent: TcxSchedulerControlEvent; + AStartRow, AFinishRow: Integer); + procedure Clear; override; + function CreateContentEventViewData(AEventInfo: TcxEventLayoutInfo; + AResource: TcxSchedulerResourceViewInfo): TcxSchedulerEventViewData; + function CreateHeaderEventViewData(AEvent: TcxSchedulerControlEvent; const ABounds: TRect; + const AStart, AFinish: TDateTime; AResource: TcxSchedulerResourceViewInfo): TcxSchedulerEventViewData; + function CreateEventCellViewInfo(AViewData: TcxSchedulerEventViewData): TcxSchedulerEventCellViewInfo; override; + function CreateEventLayout: TcxCalculateEventLayout; virtual; + procedure DoCalculate; override; + procedure DoContentNavigationButtonClick(Sender: TcxSchedulerContentNavigationButtonViewInfo); override; + procedure DoMoreEventsButtonClick(Sender: TcxSchedulerMoreEventsButtonViewInfo); override; + procedure ExtractEvents(ASource, ADest: TcxSchedulerEventList; AIndex: Integer); + function GetContentParams(const ATime: TDateTime; + AResource: TcxSchedulerResourceViewInfo): TcxViewParams; override; + function GetColumnDate(AIndex: Integer): Integer; + function GetColumnPositionInResource(AColumnIndex, AResourceIndex: Integer): TcxSchedulerColumnPositionInResource; + function GetColumnResource(AIndex: Integer): TcxSchedulerResourceViewInfo; + function GetColumnResourceIndex(AIndex: Integer): Integer; + function GetContainer(AIndex: Integer): TcxSchedulerContainerCellViewInfo; virtual; + function GetContainerCount: Integer; virtual; + function GetDayHeaderHeight: Integer; override; + procedure GetHeaderEventInfo(AColStart, AColFinish: Integer; + out ALeft, ARight: Integer; out AStart, AFinish: TDateTime); + function GetEventColumnRow(const ATime: TDateTime; AColIndex: Integer; AStart: Boolean): Integer; + function GetEventSlotDisplayText(AEvent: TcxSchedulerControlEvent): string; + function GetTimeLineParams: TcxViewParams; override; + function GetTimeRulerParams: TcxViewParams; + function GetTimeRow(const ATime: TDateTime; AIsStart: Boolean): Integer; + function GetResourcesContentWidth: Integer; override; + function GetRowTime(AColumn, ARow: Integer): TDateTime; + function GetSeparatorCount: Integer; override; + function IsColumnEvent(AEvent: TcxSchedulerEvent; AIndex: Integer; IsHeaderEvent: Boolean): Boolean; + function IsContainerSelected(AResource: TcxSchedulerStorageResourceItem; ADate: TDateTime): Boolean; + function IsEventVisible(AEvent: TcxSchedulerEvent): Boolean; overload; + function IsEventVisible(var AStartRow, AStopRow: Integer): Boolean; overload; + function IsHourVisible(AIndex: Integer): Boolean; + function IsRowVisible(AIndex: Integer): Boolean; + procedure MakeTimeVisible(const ATime: TDateTime); override; + function NavigationButtonOffset(AKind: TcxSchedulerContentNavigationButtonKind; + AResourceIndex: Integer): Integer; override; + procedure SetColumnTimeLineStyle(AViewInfo: TcxSchedulerEventCellViewInfo; AColIndex: Integer); + + property ColCount: Integer read FColCount; + property ColumnInGroup: Integer read GetColumnInGroup; + property ContainerCount: Integer read GetContainerCount; + property Containers[AIndex: Integer]: TcxSchedulerContainerCellViewInfo read GetContainer; + property Controller: TcxSchedulerDayViewController read GetController; + property GroupCount: Integer read GetGroupCount; + public + constructor Create(AOwner: TcxSchedulerSubControl); override; + destructor Destroy; override; + procedure CalculateHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + procedure InitScrollBarsParameters; override; + procedure ScrollVertical(AScrollCode: TScrollCode; var AScrollPos: Integer); override; + procedure AllDayScroll(AScrollCode: TScrollCode; var AScrollPos: Integer); + + property AllDayTopIndex: Integer read FAllDayTopIndex; + property AutoHeight: Boolean read GetAutoHeight; + property Background: TcxSchedulerBackgroundCellViewInfo read FBackground; + property ContentHeight: Integer read GetContentHeight; + property DayView: TcxSchedulerDayView read GetDayView; + property HeaderContainer: Boolean read GetHeaderContainer; + property HeaderContainerCells: TcxSchedulerViewInfoCellList read FHeaderContainerCells; + property HeaderLineHeight: Integer read FHeaderLineHeight; + property LargeFont: TFont read FLargeFont write SetLargeFont; + property LinePerHour: Integer read GetLinePerHour; + property PrintRowCount: Integer read GetPrintRowCount; + property PrintFinishRow: Integer read FPrintFinishRow; + property PrintStartRow: Integer read FPrintStartRow; + property TimeScale: Integer read FTimeScale; + property TimeRulerCells: TcxSchedulerViewInfoCellList read FTimeRulerCells; + property TopIndex: Integer read FTopIndex; + property UnusedRowCount: Integer read FUnusedRowCount; + property VisibleRowCount: Integer read FVisibleRowCount; + end; + + { TcxSchedulerDayViewHitTest } + + TcxSchedulerDayViewHitTest = class(TcxSchedulerCustomResourceViewHitTest) + private + function GetContainerCell: TcxSchedulerContainerCellViewInfo; + function GetTimeRulerCell: TcxSchedulerTimeRulerCellViewInfo; + public + property ContainerCell: TcxSchedulerContainerCellViewInfo read GetContainerCell; + property HitAtContainer: Boolean index htcContainer read GetBitState; + property HitAtTimeRuler: Boolean index htcTimeRuler read GetBitState; + property TimeRulerCell: TcxSchedulerTimeRulerCellViewInfo read GetTimeRulerCell; + property HitAtTimeZoneLabel; + property TimeZone; + end; + + { TcxDayViewDragEventHelper } + + TcxDayViewDragEventHelper = class(TcxDragEventHelper) + private + FStartInHeader: Boolean; + function GetController: TcxSchedulerDayViewController; + function GetHitTest: TcxSchedulerDayViewHitTest; + function GetShowHeaderContainer: Boolean; + protected + function GetOriginHitTestMask: Int64; override; + procedure GetOriginState; override; + function IsAtOrigin: Boolean; override; + function InHeader: Boolean; virtual; + procedure SetCloneEventsTimeDelta(AStart, ACurrent: TDateTime; AInHeader: Boolean); + procedure UpdateViewClonesTime; override; + procedure UpdateEventStates; + + property Controller: TcxSchedulerDayViewController read GetController; + property HitTest: TcxSchedulerDayViewHitTest read GetHitTest; + property ShowHeaderContainer: Boolean read GetShowHeaderContainer; + end; + + { TcxDayViewEventSizing } + + TcxDayViewEventSizing = class(TcxEventSizingHelper) + private + FFixedBoundTime: TDateTime; + function GetController: TcxSchedulerDayViewController; + function GetHitTest: TcxSchedulerDayViewHitTest; + protected + function GetDragCursor(Accepted: Boolean): TCursor; override; + function GetOriginHitTestMask: Int64; override; + // Event handling + procedure CalcAllDayEvent; override; + function GetFinishTime: TDateTime; override; + procedure GetOriginState; override; + function GetSizingTime: TDateTime; + function GetStartTime: TDateTime; override; + + property Controller: TcxSchedulerDayViewController read GetController; + property HitTest: TcxSchedulerDayViewHitTest read GetHitTest; + end; + + { TcxSchedulerDayNavigation } + + TcxSchedulerDayNavigation = class(TcxSchedulerCustomResourceViewNavigation) + private + function GetDayView: TcxSchedulerDayView; + function GetSelectedDays: TcxSchedulerDateList; + function GetViewInfo: TcxSchedulerDayViewViewInfo; + protected + FSelRow: Integer; + function ColCount: Integer; + procedure DoNextColumn(AGoToNext: Boolean; AColumn: Integer; + const ATime: TDateTime; AResource: TcxSchedulerStorageResourceItem); virtual; + function DoNextPage(AGoForward: Boolean; var ATime: TDateTime; + var AResource: TcxSchedulerStorageResourceItem): Boolean; virtual; + function GetColumnByDate(const ADate: TDateTime; AResource: TObject): Integer; + function GetColumnDate(AColumn: Integer): TDateTime; + function GetColumnResource(AColumn: Integer): TcxSchedulerStorageResourceItem; + function GetRowTime(const ARow: Integer; AFinish: Boolean = False): TDateTime; + function GetTimeRow(const ATime: TDateTime): Integer; + function IsResourceNavigation(AGoToNext: Boolean; + AColumn: Integer; const ATime: TDateTime): Boolean; + public + procedure KeyDown(var AKey: Word; AShift: TShiftState); override; + procedure ValidateSelection(var ASelStart, ASelFinish: TDateTime; + var AResource: TcxSchedulerStorageResourceItem); override; + function ValidateTimeVisibility(var ADateTime: TDateTime): TDateTime; + + property DayView: TcxSchedulerDayView read GetDayView; + property SelectedDays: TcxSchedulerDateList read GetSelectedDays; + property ViewInfo: TcxSchedulerDayViewViewInfo read GetViewInfo; + end; + + { TcxSchedulerDayViewController } + + TcxSchedulerDayViewController = class(TcxSchedulerCustomResourceViewController) + private + FLockScrolling: Boolean; + FTimer: TTimer; + function GetDragEventHelper: TcxDayViewDragEventHelper; + function GetHitTest: TcxSchedulerDayViewHitTest; + function GetTimeRulerTime: TDateTime; + function GetView: TcxSchedulerDayView; + function GetViewInfo: TcxSchedulerDayViewViewInfo; + protected + FIsEditingBeforeMouseDown: Boolean; + FScrollAreaRects: TList; + procedure BeforeMouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure CancelScroll; override; + procedure CheckDragDropScrolling(const P: TPoint); + procedure CheckScrolling(const APos: TPoint); override; + procedure CheckTimeRulerTime; + function CreateDragEventHelper: TcxDragEventHelper; override; + function CreateNavigation: TcxSchedulerViewNavigation; override; + function CreateResizeEventHelper: TcxEventSizingHelper; override; + procedure InitTimer(AllowStart: Boolean; AScrollCode: TScrollCode); virtual; + + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure OnTimer(Sender: TObject); virtual; + procedure SelectNextEvent(AForward: Boolean); override; + // + procedure CheckNavigatorScrollArea(const APoint: TPoint); override; + procedure DoneNavigatorScrollArea; override; + procedure InitNavigatorScrollArea; override; + + property DragEventHelper: TcxDayViewDragEventHelper read GetDragEventHelper; + property HitTest: TcxSchedulerDayViewHitTest read GetHitTest; + property View: TcxSchedulerDayView read GetView; + property ViewInfo: TcxSchedulerDayViewViewInfo read GetViewInfo; + public + constructor Create(AOwner: TcxSchedulerSubControl); override; + destructor Destroy; override; + end; + + { TcxSchedulerDayViewPainter } + + TcxSchedulerDayViewPainter = class(TcxSchedulerCustomViewPainter) + private + function GetView: TcxSchedulerDayView; + function GetViewInfo: TcxSchedulerDayViewViewInfo; + protected + procedure DrawContainerCell(AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); virtual; + procedure DrawDayViewEventCell(AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); virtual; + procedure DrawTimeRulerCell(AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); virtual; + public + procedure Paint; override; + + property View: TcxSchedulerDayView read GetView; + property ViewInfo: TcxSchedulerDayViewViewInfo read GetViewInfo; + end; + + { TcxEventLayoutInfo } + + TcxEventLayoutInfo = class + private + protected + ColStart, ColEnd, ColCount: Integer; + Event: TcxSchedulerControlEvent; + FDisplayRect: TRect; + FFinishTime: TDateTime; + FStartTime: TDateTime; + IsBreakEvent: Boolean; + RowCount: Integer; + StartRow, StopRow: Integer; + function ShadowSize: Integer; + procedure CalculateDisplayRect(AWidth, ARowHeight: Integer); + procedure CalculateTimes(const ADate: TDateTime; AScale, AOfs: Integer); + public + constructor Create(AEvent: TcxSchedulerControlEvent; + const ADate: TDateTime; AScale: Integer); virtual; + + property DisplayRect: TRect read FDisplayRect; + property Finish: TDateTime read FFinishTime; + property Start: TDateTime read FStartTime; + end; + + { TcxCalculateEventLayout } + + TcxCalculateEventLayout = class(TList) + private + FDate: TDateTime; + FLeft: Integer; + FRowHeight: Integer; + FTimeScale: Integer; + FTop: Integer; + FWidth: Integer; + function GetInfo(AIndex: Integer): TcxEventLayoutInfo; + protected + FViewInfo: TcxSchedulerDayViewViewInfo; + procedure CalculateColCount(AInfo: TcxEventLayoutInfo); virtual; + procedure CalculateColEnd(AInfo: TcxEventLayoutInfo); virtual; + procedure CalculateColStart(AInfo: TcxEventLayoutInfo; AIndex: Integer); virtual; + function CreateEventInfo(AEvent: TcxSchedulerControlEvent): TcxEventLayoutInfo; + function Intersect(AInfo1, AInfo2: TcxEventLayoutInfo): Boolean; + procedure SetColCount(AInfo: TcxEventLayoutInfo); + public + procedure Add(AEvent: TcxSchedulerControlEvent); + procedure Calculate; + procedure Clear; override; + procedure SetParams(const ADate: TDateTime; ATimeScale, ARowHeight: Integer; + ALeft, ATop, AWidth: Integer); + + property Date: TDateTime read FDate write FDate; + property Infos[Index: Integer]: TcxEventLayoutInfo read GetInfo; + property Left: Integer read FLeft; + property RowHeight: Integer read FRowHeight; + property TimeScale: Integer read FTimeScale; + property Top: Integer read FTop; + property Width: Integer read FWidth; + end; + + { TcxSchedulerTimeRulerPopupMenu } + + TcxSchedulerTimeRulerPopupMenuItem = (rpmiNewEvent, rpmiNewAllDayEvent, + rpmiNewReccuringEvent, rpmi60min, rpmi30min, rpmi15min, rpmi10min, + rpmi6min, rpmi5min); + TcxSchedulerTimeRulerPopupMenuItems = set of TcxSchedulerTimeRulerPopupMenuItem; + + TcxSchedulerTimeRulerPopupMenuPopupEvent = procedure ( + Sender: TcxSchedulerTimeRulerPopupMenu; ABuiltInMenu: TPopupMenu; + var AHandled: Boolean) of object; + TcxSchedulerTimeRulerPopupMenuClickEvent = procedure ( + Sender: TcxSchedulerTimeRulerPopupMenu; + AItem: TcxSchedulerTimeRulerPopupMenuItem; var AHandled: Boolean) of object; + + TcxSchedulerTimeRulerPopupMenu = class(TcxSchedulerCustomContentPopupMenu) + private + FItems: TcxSchedulerTimeRulerPopupMenuItems; + FOnPopup: TcxSchedulerTimeRulerPopupMenuPopupEvent; + FOnClick: TcxSchedulerTimeRulerPopupMenuClickEvent; + function GetDayView: TcxSchedulerDayView; + protected + procedure CreateItems; override; + procedure DoExecute(ACommand: Integer); override; + function DoOnClick(ACommand: Integer): Boolean; override; + function DoOnPopup: Boolean; override; + function IsValidCommand(ACommand: Integer): Boolean; override; + + property DayView: TcxSchedulerDayView read GetDayView; + public + constructor Create(AScheduler: TcxCustomScheduler); override; + procedure Assign(Source: TPersistent); override; + procedure Execute(AItem: TcxSchedulerTimeRulerPopupMenuItem); + function GetMenuItem(AItem: TcxSchedulerTimeRulerPopupMenuItem): TMenuItem; + published + property Items: TcxSchedulerTimeRulerPopupMenuItems + read FItems write FItems default [rpmiNewEvent, rpmiNewAllDayEvent, + rpmiNewReccuringEvent, rpmi60min, rpmi30min, rpmi15min, rpmi10min, + rpmi6min, rpmi5min]; + property PopupMenu; + property UseBuiltInPopupMenu; + + property OnClick: TcxSchedulerTimeRulerPopupMenuClickEvent read FOnClick write FOnClick; + property OnPopup: TcxSchedulerTimeRulerPopupMenuPopupEvent read FOnPopup write FOnPopup; + end; + +implementation + +uses + cxDateUtils, cxClasses, cxScrollBar, cxLibraryConsts; + +const + cxMinutesPerDay = 24 * 60; + RulerScales: array[0..5] of Integer = (60, 30, 15, 10, 6, 5); + +function GetTimeMinutes(const ATime: TDateTime): Integer; +var + H, M, S, MS: Word; +begin + DecodeTime(ATime, H, M, S, MS); + Result := H * 60 + M; +end; + +{ TcxSchedulerDayViewStyles } + +constructor TcxSchedulerDayViewStyles.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FScheduler := TcxSchedulerDayView(GetOwner).Scheduler; + BitmapInViewParams := True; +end; + +procedure TcxSchedulerDayViewStyles.Assign(Source: TPersistent); +var + I: Integer; +begin + if Source is TcxSchedulerDayViewStyles then + begin + for I := 0 to cxcsMaxDayViewValue do + SetValue(I, TcxSchedulerDayViewStyles(Source).GetValue(I)) + end; + inherited Assign(Source); +end; + +procedure TcxSchedulerDayViewStyles.Changed(AIndex: Integer); +begin + TcxSchedulerDayView(GetOwner).Refresh; +end; + +procedure TcxSchedulerDayViewStyles.GetDefaultViewParams(Index: Integer; + AData: TObject; out AParams: TcxViewParams); +begin + AParams.Bitmap := nil; + AParams.Font := Scheduler.Font; + AParams.TextColor := clBlack; + AParams.Color := Scheduler.Color; + case Index of + cxcsHeaderContainer: + begin + AParams.Color := Painter.DefaultHeaderBackgroundColor; + AParams.TextColor := Painter.DefaultHeaderBackgroundTextColor; + end; + cxcsSelectedHeaderContainer: + begin + AParams.Color := Painter.DefaultContentColor; + AParams.TextColor := Painter.DefaultContentTextColor; + end; + cxcsTimeLine: + begin + AParams.Color := clWhite; + AParams.TextColor := Scheduler.OptionsView.DayBorderColor; + if AParams.TextColor = clDefault then + AParams.TextColor := clWindowText; + end; + cxcsTimeRuler: + begin + AParams.Color := Painter.DefaultHeaderColor; + AParams.TextColor := Painter.DefaultHeaderTextColor; + end; + end; +end; + +function TcxSchedulerDayViewStyles.GetHeaderContainerParams( + const ADate: TDateTime; AResource: TcxSchedulerStorageResourceItem; + ASelected: Boolean): TcxViewParams; +begin + GetViewParams(cxcsHeaderContainer + Byte(ASelected), nil, nil, Result); +end; + +function TcxSchedulerDayViewStyles.GetTimeLineParams: TcxViewParams; +begin + GetViewParams(cxcsTimeLine, nil, nil, Result); +end; + +function TcxSchedulerDayViewStyles.GetTimeRulerParams: TcxViewParams; +begin + GetViewParams(cxcsTimeRuler, nil, nil, Result); +end; + +function TcxSchedulerDayViewStyles.GetPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := TcxSchedulerDayView(GetOwner).LookAndFeelPainter; +end; + +//procedures +function cxCompareTime(const ATime1, ATime2: TDateTime): Integer; +begin + Result := 0; + if ATime1 < ATime2 then + Result := -1 + else + if ATime1 > ATime2 then + Result := 1; +end; + +function cxCompareButtons(AItem1, AItem2: TcxSchedulerMoreEventsButtonViewInfo): Integer; +begin + Result := Byte(AItem1 <> nil) - Byte(AItem2 <> nil); + if Result = 0 then + Result := Byte(not AItem1.IsDown) - Byte(not AItem2.IsDown); + if Result = 0 then + begin + if AItem1.IsDown then + Result := cxCompareTime(AItem1.DateTime, AItem2.DateTime) + else + Result := cxCompareTime(AItem2.DateTime, AItem1.DateTime) + end; +end; + +function cxCompareEventViewInfoOrders( + AInfo1, AInfo2: TcxSchedulerEventCellViewInfo): Integer; +var + AAllDay1, AAllDay2: Boolean; + AEvent1, AEvent2: TcxSchedulerEvent; +begin + Result := Byte(AInfo2.Visible) - Byte(AInfo1.Visible); + if Result = 0 then + Result := Byte(AInfo1.Selected) - Byte(AInfo2.Selected); + if Result = 0 then + Result := Byte(AInfo2.Hidden) - Byte(AInfo1.Hidden); + if Result = 0 then + begin + AEvent1 := AInfo1.Event; + AEvent2 := AInfo2.Event; + AAllDay1 := AEvent1.AllDayEvent or (AEvent1.Duration >= 1); + AAllDay2 := AEvent2.AllDayEvent or (AEvent2.Duration >= 1); + Result := Byte(AAllDay2) - Byte(AAllDay1); + if Result <> 0 then Exit; + if AEvent1.Start < AEvent2.Start then + Result := -1 + else + if AEvent1.Start > AEvent2.Start then + Result := 1 + else + if AEvent1.Finish > AEvent2.Finish then + Result := -1 + else + if AEvent1.Finish < AEvent2.Finish then + Result := 1 + else + Result := 0; + end; +end; + +{ TcxEventLayoutInfo } + +constructor TcxEventLayoutInfo.Create(AEvent: TcxSchedulerControlEvent; + const ADate: TDateTime; AScale: Integer); +var + AFinish: Integer; +begin + Event := AEvent; + AFinish := Round(TimeOf(Event.Finish) / MinuteToTime); + StartRow := Round(TimeOf(AEvent.Start) / MinuteToTime) div AScale; + StopRow := AFinish div AScale; + if (StopRow <> StartRow) and (AFinish mod AScale = 0) then + Dec(StopRow); + + if DateOf(Event.Start) <> DateOf(Event.Finish) then + begin + if DateOf(ADate) = DateOf(Event.Start) then + StopRow := cxMinutesPerDay div AScale - 1 + else + StartRow := 0; + end; + IsBreakEvent := (StopRow = cxMinutesPerDay div AScale - 1); +end; + +function TcxEventLayoutInfo.ShadowSize: Integer; +begin + Result := TcxSchedulerPainterHelper.ShadowSize; +end; + +procedure TcxEventLayoutInfo.CalculateDisplayRect( + AWidth, ARowHeight: Integer); +begin + FDisplayRect := Rect(MulDiv(AWidth, ColStart, ColCount), StartRow * ARowHeight, + MulDiv(AWidth, ColEnd, ColCount) - ShadowSize, (StopRow + 1) * ARowHeight + Byte(IsBreakEvent)); +end; + +procedure TcxEventLayoutInfo.CalculateTimes( + const ADate: TDateTime; AScale, AOfs: Integer); +begin + FFinishTime := ADate + (StopRow + 1 + AOfs) * AScale * MinuteToTime; + FStartTime := ADate + (StartRow + AOfs)* AScale * MinuteToTime; +end; + +{ TcxCalculateEventLayout } + +procedure TcxCalculateEventLayout.Add(AEvent: TcxSchedulerControlEvent); +var + AEventInfo: TcxEventLayoutInfo; +begin + AEventInfo := CreateEventInfo(AEvent); + if AEventInfo <> nil then + inherited Add(AEventInfo); +end; + +procedure TcxCalculateEventLayout.Calculate; +var + I: Integer; + AInfo: TcxEventLayoutInfo; +begin + for I := 0 to Count - 1 do + begin + AInfo := Infos[I]; + CalculateColCount(AInfo); + CalculateColStart(AInfo, I); + SetColCount(AInfo); + end; + // Find ColEnd for events + for I := 0 to Count - 1 do + CalculateColEnd(Infos[I]); + for I := 0 to Count - 1 do + begin + AInfo := Infos[I]; + AInfo.StartRow := Max(0, AInfo.StartRow - FViewInfo.PrintStartRow); + AInfo.StopRow := Min(FViewInfo.FRowCount, AInfo.StopRow - FViewInfo.PrintStartRow); + AInfo.CalculateDisplayRect(FWidth, FRowHeight); + OffsetRect(AInfo.FDisplayRect, Left, Top - Byte(FViewInfo.Adapter.IsPrinting)); + AInfo.CalculateTimes(FDate, FTimeScale, FViewInfo.PrintStartRow); + end; +end; + +procedure TcxCalculateEventLayout.Clear; +var + I: Integer; +begin + for I := Count - 1 downto 0 do + Infos[I].Free; + inherited Clear; +end; + +procedure TcxCalculateEventLayout.SetParams(const ADate: TDateTime; + ATimeScale, ARowHeight: Integer; ALeft, ATop, AWidth: Integer); +begin + FDate := ADate; + FTimeScale := ATimeScale; + FRowHeight := ARowHeight; + FLeft := ALeft; + FTop := ATop; + FWidth := AWidth; +end; + +procedure TcxCalculateEventLayout.CalculateColCount( + AInfo: TcxEventLayoutInfo); +var + I, J: Integer; +begin + for I := AInfo.StartRow to AInfo.StopRow do + begin + AInfo.ColEnd := 0; + for J := 0 to Count - 1 do + if (I >= Infos[J].StartRow) and (I <= Infos[J].StopRow) then + Inc(AInfo.ColEnd); + if AInfo.ColCount < AInfo.ColEnd then + AInfo.ColCount := AInfo.ColEnd; + end; +end; + +procedure TcxCalculateEventLayout.CalculateColEnd( + AInfo: TcxEventLayoutInfo); +var + I: Integer; + AEventInfo: TcxEventLayoutInfo; +begin + AInfo.ColEnd := AInfo.ColCount; + for I := 0 to Count - 1 do + begin + AEventInfo := Infos[I]; + if (AEventInfo.ColStart > AInfo.ColStart) and + (AEventInfo.ColStart < AInfo.ColEnd) and Intersect(AInfo, AEventInfo) then + begin + AInfo.ColEnd := AEventInfo.ColStart; + if AInfo.ColEnd = AInfo.ColStart + 1 then Break; + end; + end; +end; + +procedure TcxCalculateEventLayout.CalculateColStart( + AInfo: TcxEventLayoutInfo; AIndex: Integer); +var + I: Integer; +begin + repeat + AInfo.ColEnd := AInfo.ColStart; + for I := AIndex - 1 downto 0 do + if (Infos[I].ColStart = AInfo.ColStart) and Intersect(Infos[I], AInfo) then + begin + Inc(AInfo.ColStart); + Break; + end; + until (AInfo.ColStart = AInfo.ColEnd) or (AInfo.ColStart = (AInfo.ColCount - 1)); +end; + +function TcxCalculateEventLayout.CreateEventInfo( + AEvent: TcxSchedulerControlEvent): TcxEventLayoutInfo; +begin + Result := TcxEventLayoutInfo.Create(AEvent, FDate, FTimeScale); + with FViewInfo do + if HasVisibleBounds and not IsEventVisible(Result.StartRow, Result.StopRow) then + FreeAndNil(Result); +end; + +function TcxCalculateEventLayout.Intersect( + AInfo1, AInfo2: TcxEventLayoutInfo): Boolean; +begin + Result := (AInfo1.StartRow <= AInfo2.StopRow) and + (AInfo2.StartRow <= AInfo1.StopRow); +end; + +procedure TcxCalculateEventLayout.SetColCount( + AInfo: TcxEventLayoutInfo); +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + if (Infos[I].ColCount < AInfo.ColCount) and Intersect(Infos[I], AInfo) then + begin + Infos[I].ColCount := AInfo.ColCount; + SetColCount(Infos[I]); + end; + end; +end; + +function TcxCalculateEventLayout.GetInfo( + AIndex: Integer): TcxEventLayoutInfo; +begin + Result := TcxEventLayoutInfo(List^[AIndex]); +end; + +{ TcxSchedulerDayView } + +constructor TcxSchedulerDayView.Create(AOwner: TcxCustomScheduler); +begin + inherited Create(AOwner); + FAllDayAreaScrollBar := adsbDefault; + FDayHeaderArea := True; + FTimeScale := cxDefaultTimeScale; + FHeaderContainer := True; + EventImagesLayout := eilAuto; + FEventShadows := True; + FShowAllDayEventsInContentArea := False; + InitAllDayScrollBar; +end; + +destructor TcxSchedulerDayView.Destroy; +begin + FreeAndNil(FAllDayScrollBar); + inherited Destroy; +end; + +procedure TcxSchedulerDayView.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerDayView then + begin + with Source as TcxSchedulerDayView do + begin + Self.FAllDayAreaScrollBar := AllDayAreaScrollBar; + Self.FAlwaysShowEventTime := AlwaysShowEventTime; + Self.FDayHeaderArea := DayHeaderArea; + Self.FHeaderContainer := HeaderContainer; + Self.FTimeRulerMinutes := TimeRulerMinutes; + Self.FEventShadows := EventShadows; + Self.FShowAllDayEventsInContentArea := ShowAllDayEventsInContentArea; + Self.FTimeScale := TimeScale; + Self.TimeRulerPopupMenu := TimeRulerPopupMenu; + Self.FWorkTimeOnly := WorkTimeOnly; + end; + end; + inherited Assign(Source); +end; + +procedure TcxSchedulerDayView.MakeWorkTimeVisible; +begin + if Visible then + begin + if WorkTimeOnly then + ViewInfo.FTopIndex := 0 + else + ViewInfo.FTopIndex := Round(WorkStart / MinuteToTime) div TimeScale; + end; +end; + +procedure TcxSchedulerDayView.DeactivateView; +begin + AllDayScrollBar.Visible := False; + inherited; +end; + +procedure TcxSchedulerDayView.GetProperties(AProperties: TStrings); +begin + inherited GetProperties(AProperties); + AProperties.Add('TimeScale') +end; + +procedure TcxSchedulerDayView.GetPropertyValue(const AName: string; + var AValue: Variant); +begin + inherited GetPropertyValue(AName, AValue); + if AName = 'TimeScale' then + AValue := TimeScale; +end; + +procedure TcxSchedulerDayView.SetPropertyValue(const AName: string; + const AValue: Variant); +begin + inherited SetPropertyValue(AName, AValue); + if AName = 'TimeScale' then + TimeScale := AValue; +end; + +procedure TcxSchedulerDayView.CreateSubClasses; +begin + FStyles := CreateStyles; + inherited CreateSubClasses; + FTimeRulerPopupMenu := CreateTimeRulerPopupMenu; +end; + +procedure TcxSchedulerDayView.DestroySubClasses; +begin + FTimeRulerPopupMenu.Free; + inherited DestroySubClasses; + FStyles.Free; +end; + +function TcxSchedulerDayView.CreateController: TcxSchedulerSubControlController; +begin + Result := TcxSchedulerDayViewController.Create(Self); +end; + +function TcxSchedulerDayView.CreateHitTest: TcxSchedulerSubControlHitTest; +begin + Result := TcxSchedulerDayViewHitTest.Create(Self); +end; + +function TcxSchedulerDayView.CreatePainter: TcxSchedulerSubControlPainter; +begin + Result := TcxSchedulerDayViewPainter.Create(Self); +end; + +function TcxSchedulerDayView.CreateStyles: TcxSchedulerDayViewStyles; +begin + Result := TcxSchedulerDayViewStyles.Create(Self); +end; + +function TcxSchedulerDayView.CreateTimeRulerPopupMenu: TcxSchedulerTimeRulerPopupMenu; +begin + Result := TcxSchedulerTimeRulerPopupMenu.Create(Scheduler); +end; + +function TcxSchedulerDayView.CreateViewAdapter: TcxCustomResourceViewAdapter; +begin + Result := TcxSchedulerDayViewAdapter.Create(Self); +end; + +function TcxSchedulerDayView.CreateViewInfo: TcxSchedulerSubControlViewInfo; +begin + Result := TcxSchedulerDayViewViewInfo.Create(Self); +end; + +procedure TcxSchedulerDayView.DoCustomDrawContainer( + ACell: TcxSchedulerContainerCellViewInfo; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawContainer) then + FOnCustomDrawContainer(Self, Canvas, ACell, ADone); +end; + +procedure TcxSchedulerDayView.DoCustomDrawTimeRuler( + ACell: TcxSchedulerTimeRulerCellViewInfo; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawTimeRuler) then + FOnCustomDrawTimeRuler(Self, Canvas, ACell, ADone); +end; + +function TcxSchedulerDayView.DoShowPopupMenu(X, Y: Integer): Boolean; +begin + if HitTest.HitAtTimeRuler then + Result := TimeRulerPopupMenu.Popup(X, Y) + else + Result := inherited DoShowPopupMenu(X, Y); +end; + +function TcxSchedulerDayView.EventContentSelected( + AEvent: TcxSchedulerControlEvent): Boolean; +begin + Result := (AEvent.AllDayEvent or (AEvent.Duration >= 1)) and + not ShowAllDayEventsInContentArea; +end; + +function TcxSchedulerDayView.GetEditWithSingleLineEditor( + AEvent: TcxSchedulerControlEvent): Boolean; +begin + Result := IsHeaderEvent(AEvent) and + not ShowAllDayEventsInContentArea; +end; + +function TcxSchedulerDayView.GetFirstVisibleTime: TDateTime; +begin + Result := ViewInfo.TopIndex * TimeScale / 24 / 60; + if WorkTimeOnly then + Result := Result + Scheduler.OptionsView.WorkStart; +end; + +function TcxSchedulerDayView.GetLastVisibleTime: TDateTime; +begin + Result := GetFirstVisibleTime + (ViewInfo.VisibleRowCount - 1) * TimeScale / 24 / 60; +end; + +function TcxSchedulerDayView.GetTimeIncrement: TDateTime; +begin + Result := TimeOf(TimeScale * MinuteToTime); +end; + +function TcxSchedulerDayView.GetViewContentRect: TRect; +begin + Result := inherited GetViewContentRect; + Result.Left := ViewInfo.FHeaderOffsetLeft; +end; + +function TcxSchedulerDayView.IsDayView: Boolean; +begin + Result := True; +end; + +procedure TcxSchedulerDayView.MakeEventVisible(AEvent: TcxSchedulerControlEvent; + const ADate: TDateTime; AResource: TcxSchedulerStorageResourceItem); +var + I, DH: Integer; + R, R1: TRect; + AViewInfo: TcxSchedulerEventCellViewInfo; +begin + if Visible and AEvent.AllDayEvent or (AEvent.Duration >= 1) then Exit; + for I := 0 to 1 do + begin + if FindEventViewInfo(AEvent, ADate, AResource, AViewInfo) and + not AViewInfo.Hidden then + begin + if not AViewInfo.Visible then + DH := ViewInfo.GetTimeRow(AViewInfo.ContentStart, True) + else + begin + DH := 0; + R := AViewInfo.Bounds; + R1 := AViewInfo.ClipRect; + if cxRectIsEqual(R, R1) then Exit; + if R.Top < R1.Top then + DH := (R.Top - R1.Top) div ViewInfo.FContentLineHeight + else + if (I = 0) and (R.Bottom > R1.Bottom) then + DH := (R.Bottom - R1.Bottom) div ViewInfo.FContentLineHeight; + Inc(DH, ViewInfo.FTopIndex); + end; + if ViewInfo.FTopIndex <> DH then + begin + ViewInfo.FTopIndex := DH; + LayoutChanged; + end; + end + else + begin + ViewInfo.FTopIndex := ViewInfo.GetTimeRow(AEvent.Start, True); + LayoutChanged; + end; + end; +end; + +procedure TcxSchedulerDayView.Notification(AComponent: TComponent; + Operation: TOperation); +begin + TimeRulerPopupMenu.Notification(AComponent, Operation); +end; + +procedure TcxSchedulerDayView.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +begin + HideHintOnScroll(AScrollCode); + if AScrollCode = scEndScroll then + Exit; + inherited Scroll(AScrollBarKind, AScrollCode, AScrollPos); + if AScrollCode = scTrack then + ShowHintOnScroll(GetScrollTimeHint, AScrollBarKind); +end; + +procedure TcxSchedulerDayView.ScrollVisibleDays(AScrollUp: Boolean); +begin + ScrollSelectedDays(Byte(AScrollUp) * 2 - 1); +end; + +procedure TcxSchedulerDayView.TimeChanged; +begin + Invalidate; +end; + +procedure TcxSchedulerDayView.VisibleChanged; +begin + MakeWorkTimeVisible; + inherited VisibleChanged; +end; + +procedure TcxSchedulerDayView.DoAllDayScroll(Sender: TObject; + ScrollCode: TScrollCode; var ScrollPos: Integer); +begin + ViewInfo.AllDayScroll(ScrollCode, ScrollPos); +end; + +function TcxSchedulerDayView.GetHitTest: TcxSchedulerDayViewHitTest; +begin + Result := TcxSchedulerDayViewHitTest(inherited HitTest); +end; + +function TcxSchedulerDayView.GetViewInfo: TcxSchedulerDayViewViewInfo; +begin + Result := TcxSchedulerDayViewViewInfo(inherited ViewInfo) +end; + +procedure TcxSchedulerDayView.InitAllDayScrollBar; +begin + FAllDayScrollBar := TcxControlScrollBar.Create(nil); + FAllDayScrollBar.Parent := Scheduler; + FAllDayScrollBar.LookAndFeel.MasterLookAndFeel := GetSchedulerLookAndFeel; + FAllDayScrollBar.OnScroll := DoAllDayScroll; +end; + +procedure TcxSchedulerDayView.SetAlwaysShowEventTime(AValue: Boolean); +begin + if AValue <> FAlwaysShowEventTime then + begin + FAlwaysShowEventTime := AValue; + Changed; + end; +end; + +procedure TcxSchedulerDayView.SetAutoContentHeight(AValue: Boolean); +begin + if AValue <> FAutoContentHeight then + begin + FAutoContentHeight := AValue; + Changed; + end; +end; + +procedure TcxSchedulerDayView.SetEventShadows(AValue: Boolean); +begin + if AValue <> FEventShadows then + begin + FEventShadows := AValue; + Changed; + end; +end; + +procedure TcxSchedulerDayView.SetHeaderContainer(AValue: Boolean); +begin + if AValue <> FHeaderContainer then + begin + FHeaderContainer := AValue; + Changed; + end; +end; + +procedure TcxSchedulerDayView.SetAllDayAreaScrollBar(AValue: + TcxSchedulerAllDayAreaScrollBar); +begin + if AValue <> FAllDayAreaScrollBar then + begin + FAllDayAreaScrollBar := AValue; + Changed; + end; +end; + +procedure TcxSchedulerDayView.SetDayHeaderArea( + AValue: Boolean); +begin + if AValue <> FDayHeaderArea then + begin + FDayHeaderArea := AValue; + Changed; + end; +end; + +procedure TcxSchedulerDayView.SetTimeRulerMinutes(AValue: Boolean); +begin + if AValue <> FTimeRulerMinutes then + begin + FTimeRulerMinutes := AValue; + Changed; + end; +end; + +procedure TcxSchedulerDayView.SetShowAllDayEventsInContentArea(AValue: Boolean); +begin + if AValue <> FShowAllDayEventsInContentArea then + begin + FShowAllDayEventsInContentArea := AValue; + Changed; + end; +end; + +procedure TcxSchedulerDayView.SetStyles(AValue: TcxSchedulerDayViewStyles); +begin + FStyles.Assign(AValue); +end; + +procedure TcxSchedulerDayView.SetTimeRulerPopupMenu( + AValue: TcxSchedulerTimeRulerPopupMenu); +begin + FTimeRulerPopupMenu.Assign(AValue); +end; + +procedure TcxSchedulerDayView.SetTimeScale( + AValue: Integer); +begin + AValue := Min(60, Max(5, AValue)); + AValue := 60 div Max(1, 60 div AValue); + if AValue <> FTimeScale then + begin + while 60 mod AValue <> 0 do Inc(AValue); + FTimeScale := AValue; + MakeWorkTimeVisible; + Refresh; + end; +end; + +procedure TcxSchedulerDayView.SetWorkTimeOnly(AValue: Boolean); +begin + if AValue <> FWorkTimeOnly then + begin + FWorkTimeOnly := AValue; + if (ViewInfo <> nil) then + ViewInfo.FTopIndex := 0; + Changed; + end; +end; + +{ TcxSchedulerDayViewAdapter } + +function TcxSchedulerDayViewAdapter.GetPrintRange(Index: Integer): TDateTime; +begin + with TcxSchedulerDayView(View) do + begin + if not WorkTimeOnly then + Result := inherited GetPrintRange(Index) + else + begin + if Index = 0 then + Result := TimeOf(WorkStart) + else + Result := TimeOf(WorkFinish); + end; + end; +end; + +procedure TcxSchedulerDayViewAdapter.Store; +begin + FTopIndex := TcxSchedulerDayViewViewInfo(ViewInfo).FTopIndex; +end; + +procedure TcxSchedulerDayViewAdapter.Restore; +begin + TcxSchedulerDayViewViewInfo(ViewInfo).FTopIndex := FTopIndex; +end; + +{ TcxSchedulerDayViewEventCellViewInfo } + +procedure TcxSchedulerDayViewEventCellViewInfo.CalculateCaptions; +begin + if IsDetailInfo and ShowStartTime then + begin + inherited CalculateCaptions; //todo: optimization - check with PS + if EventStart <> EventFinish then + ViewData.Caption := StartText + '-' + FinishText + ' ' + ViewData.Caption + else + ViewData.Caption := StartText + ' ' + ViewData.Caption; + end; +end; + +procedure TcxSchedulerDayViewEventCellViewInfo.CalculateEventTimeVisibility; +begin + inherited CalculateEventTimeVisibility; + if ShowTimeAsClock and ViewData.ShowFinishTime then + ViewData.ShowFinishTime := ViewData.ContentFinish > EventFinish; + if ShowTimeAsClock and ViewData.ShowStartTime then + ViewData.ShowStartTime := ViewData.ContentStart < EventStart; +end; + +procedure TcxSchedulerDayViewEventCellViewInfo.CalculateDetailInfo; +begin + FIsDetailInfo := ViewData.AutoHeight or (not IsHeaderEvent and + ((TimeOf(ContentFinish) <> 0) or (TimeOf(ContentStart) <> 0))) or + IsShowHeaderEventsInContentArea; + FIsDetailCaption := FIsDetailInfo and not IsHeaderEvent or + IsShowHeaderEventsInContentArea; + FShowMessage := IsDetailInfo and (Length(Message) > 0); +end; + +procedure TcxSchedulerDayViewEventCellViewInfo.CalculateShowTimeAsClock; +begin + ViewData.ShowTimeAsClock := (IsHeaderEvent and not IsShowHeaderEventsInContentArea) or + (ViewData.ShowTimeAsClock and not IsDetailInfo); +end; + +procedure TcxSchedulerDayViewEventCellViewInfo.CalculateItemsLayout; +begin + if ViewData.ShowTimeLine then Inc(FBounds.Left, cxTimeLineWidth); + inherited CalculateItemsLayout; + if ViewData.ShowTimeLine then + begin + CalculateTimeLineParams; + Exclude(FBorders, bLeft); + end; +end; + +procedure TcxSchedulerDayViewEventCellViewInfo.CalculateNonDetailEventTimeVisibility; +begin + if Event.AllDayEvent and + not IsShowHeaderEventsInContentArea then + begin + ViewData.ShowFinishTime := False; + ViewData.ShowStartTime := False; + end + else + begin + ViewData.ShowFinishTime := (ViewData.ContentFinish >= EventFinish) and + (ViewData.ShowFinishTime or (Event.Duration >= 1)); + ViewData.ShowStartTime := (ContentStart <= EventStart); + end; +end; + +procedure TcxSchedulerDayViewEventCellViewInfo.CalculateTimeLineParams; +var + LTime: Double; + AStart, AFinish: TDateTime; + ATop, AHeight: Integer; +begin + AStart := Max(Event.Start, ContentStart); + AFinish := Min(Event.Finish, ContentFinish); + if (ContentFinish - ContentStart) <= 0 then + begin + AHeight := 0; + ATop := 0; + end + else + begin + LTime := (cxRectHeight(FBounds) - 2) / (ContentFinish - ContentStart); + ATop := Round((AStart - ContentStart) * LTime) + 1; + AHeight := Round((AFinish - ContentStart) * LTime + 1) - ATop; + end; + Inc(ATop, FBounds.Top); + FTimeLineRect := cxRectSetRight(FBounds, FBounds.Left, cxTimeLineWidth); + FEventTimeRect := cxRectBounds(FTimeLineRect.Left, ATop, cxTimeLineWidth, AHeight); +end; + +function TcxSchedulerDayViewEventCellViewInfo.CanShowHint: Boolean; +begin + Result := inherited CanShowHint and not IsShowHeaderEventsInContentArea; +end; + +procedure TcxSchedulerDayViewEventCellViewInfo.DrawContent; +begin + inherited DrawContent; + if ShowTimeLine then + begin + if not cxRectIsEmpty(TimeLineRect) then + DrawState; + DrawShadow; + DrawSelection; + end; +end; + +procedure TcxSchedulerDayViewEventCellViewInfo.DrawSelection; +var + R: TRect; +begin + if ShowTimeLine and Selected and FExternalPainter.NeedDrawSelection then + begin + R := cxRectSetTop(Bounds, Bounds.Top - cxTimeLineWidth + 1, cxTimeLineWidth); + Dec(R.Left, cxTimeLineWidth); + PainterHelper.DrawState(Canvas, R, Event.State, cxBordersAll, ViewData.BorderColor); + R := cxRectSetTop(R, Bounds.Bottom - 1); + PainterHelper.DrawState(Canvas, R, Event.State, cxBordersAll, ViewData.BorderColor); + end; +end; + +procedure TcxSchedulerDayViewEventCellViewInfo.DrawShadow; +var + R: TRect; +begin + if (ViewData.DrawShadows) and (ViewData.Bitmap <> nil) and + not Hidden and not Selected and ShowTimeLine then + begin + R := Bounds; + Dec(R.Left, cxTimeLineWidth); + with ViewData do + ExternalPainter.DrawShadow(Canvas, R, VisibleRect, Bitmap); + end; +end; + +procedure TcxSchedulerDayViewEventCellViewInfo.DrawState; +begin + Canvas.FillRect(FTimeLineRect, ViewData.TimeLineParams, cxBordersAll, + ViewData.BorderColor); + PainterHelper.DrawState(Canvas, FEventTimeRect, Event.State, [bLeft, bRight], + ViewData.BorderColor); +end; + +function TcxSchedulerDayViewEventCellViewInfo.GetEditingRect: TRect; +begin + Result := inherited GetEditingRect; + if IsDetailCaption then + Inc(Result.Top); +end; + +procedure TcxSchedulerDayViewEventCellViewInfo.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + inherited InitHitTest(AHitTest); + if IsDetailInfo then + begin + if ShowTimeLine and PtInRect(FTimeLineRect, AHitTest.HitPoint) then + AHitTest.SetDragKind(edkEventDragRect) + else + begin + if (AHitTest.HitY - Bounds.Top) <= cxHitDelta then + AHitTest.SetDragKind(edkResizeStart) + else + if (Bounds.Bottom - AHitTest.HitY) <= cxHitDelta then + AHitTest.SetDragKind(edkResizeEnd); + end; + end + else + if IsHeaderEvent and not IsShowHeaderEventsInContentArea then + begin + if (bLeft in Borders) and ((AHitTest.HitX - Bounds.Left) <= cxHitDelta) then + AHitTest.SetDragKind(edkResizeStart) + else + if (bRight in Borders) and ((Bounds.Right - AHitTest.HitX) <= cxHitDelta) then + AHitTest.SetDragKind(edkResizeEnd); + end; +end; + +function TcxSchedulerDayViewEventCellViewInfo.IsHorzSizing: Boolean; +begin + Result := IsHeaderEvent and not IsShowHeaderEventsInContentArea; +end; + +function TcxSchedulerDayViewEventCellViewInfo.IsNeedDrawTime: Boolean; +begin + if IsDetailInfo then + Result := False + else + Result := inherited IsNeedDrawTime; +end; + +function TcxSchedulerDayViewEventCellViewInfo.IsShowHeaderEventsInContentArea: Boolean; +begin + Result := ViewData.ShowAllDayEventsInContentArea; +end; + +function TcxSchedulerDayViewEventCellViewInfo.IsTimeLineVisible: Boolean; +begin + Result := not IsHeaderEvent or IsShowHeaderEventsInContentArea; +end; + +{ TcxSchedulerDayViewViewInfo } + +constructor TcxSchedulerDayViewViewInfo.Create( + AOwner: TcxSchedulerSubControl); +begin + inherited Create(AOwner); + Builder := TcxSchedulerEventLayoutBuilder.Create; + FLargeFont := TFont.Create; + FTimeRulerCells := TcxSchedulerViewInfoCellList.Create; + FCells.Insert(1, FTimeRulerCells); + FAllDayTopIndex := 0; +end; + +destructor TcxSchedulerDayViewViewInfo.Destroy; +begin + Builder.Free; + FBackground.Free; + FLargeFont.Free; + inherited Destroy; +end; + +procedure TcxSchedulerDayViewViewInfo.CalculateHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + inherited CalculateHitTest(AHitTest); + TimeRulerCells.CalculateHitTest(AHitTest); +end; + +procedure TcxSchedulerDayViewViewInfo.InitScrollBarsParameters; +begin + if (FVisibleRowCount = 0) or (FVisibleRowCount >= FRowCount) or + (cxRectWidth(Bounds) <= 0) then + DayView.SetScrollBarInfo(sbVertical, 0, 2, 1, 1, 0, False, True) + else + DayView.SetScrollBarInfo(sbVertical, 0, FRowCount - 1, 1, + FVisibleRowCount, TopIndex, True, True); + inherited InitScrollBarsParameters; +end; + +procedure TcxSchedulerDayViewViewInfo.ScrollVertical( + AScrollCode: TScrollCode; var AScrollPos: Integer); +begin + if not (AScrollCode in [scPosition, scTrack]) then + AScrollPos := TopIndex; + case AScrollCode of + scLineUp: + Dec(AScrollPos, 1); + scLineDown: + Inc(AScrollPos, 1); + scPageUp: + Dec(AScrollPos, VisibleRowCount); + scPageDown: + Inc(AScrollPos, VisibleRowCount); + scTop: + AScrollPos := 0; + scBottom: + AScrollPos := FRowCount; + end; + if AScrollPos + VisibleRowCount > (FRowCount - 1) then + AScrollPos := FRowCount - VisibleRowCount; + if AScrollPos < 0 then + AScrollPos := 0; + if FTopIndex <> AScrollPos then + begin + FTopIndex := AScrollPos; + DayView.LayoutChanged; + AScrollPos := FTopIndex; + end; +end; + +procedure TcxSchedulerDayViewViewInfo.AllDayScroll(AScrollCode: TScrollCode; var AScrollPos: Integer); +begin + if not NeedAllDayScrollBar then + Exit; + if not (AScrollCode in [scPosition, scTrack]) then + AScrollPos := FAllDayTopIndex; + case AScrollCode of + scLineUp: + Dec(AScrollPos, 1); + scLineDown: + Inc(AScrollPos, 1); + scPageUp: + Dec(AScrollPos, 1); + scPageDown: + Inc(AScrollPos, 1); + scTop: + AScrollPos := 0; + scBottom: + AScrollPos := DayView.AllDayScrollBar.Max; + end; + AScrollPos := Max(AScrollPos, DayView.AllDayScrollBar.Min); + AScrollPos := Min(AScrollPos, DayView.AllDayScrollBar.Max); + if FAllDayTopIndex <> AScrollPos then + begin + FAllDayTopIndex := AScrollPos; + DayView.LayoutChanged; + end; +end; + +function TcxSchedulerDayViewViewInfo.AddContentCell( + const ARect: TRect; const AStart, AFinish: TDateTime; + AResourceIndex: Integer): TcxSchedulerContentCellViewInfo; +var + R: TRect; + P: TcxViewParams; +begin + R := Bounds; + R.Top := FContentOffset; + if cxRectIntersect(R, ARect) then + P := GetContentParams(AStart, Resources[AResourceIndex]) + else + FillChar(P, SizeOf(P), 0); + CreateCellInstance(ContentCellClass, ARect, R, P, Result); + Result.SetTime(AStart, AFinish); + AssignResourceID(Result, AResourceIndex); + ContentCells.Add(Result); +end; + +procedure TcxSchedulerDayViewViewInfo.AddContainerCell( + AColumn: Integer; const ABounds: TRect); +var + ACell: TcxSchedulerContainerCellViewInfo; + AParams: TcxViewParams; + ASelected: Boolean; + AResource: TcxSchedulerStorageResourceItem; + ADate: TDateTime; +begin + ADate := GetColumnDate(AColumn); + AResource := GetResourceItemByIndex(GetColumnResourceIndex(AColumn)); + ASelected := IsContainerSelected(AResource, ADate); + AParams := DayView.Styles.GetHeaderContainerParams(ADate, AResource, ASelected); + CreateCellInstance(TcxSchedulerContainerCellViewInfo, ABounds, AParams, ACell); + ACell.DateTime := ADate; + ACell.Selected := ASelected; + AssignResourceID(ACell, GetColumnResourceIndex(AColumn)); + Inc(AColumn); + if (AColumn = FColCount) or (HasSeparator and (GroupingKind <> gkNone) and + (AColumn mod ColumnInGroup = 0)) then + ACell.Borders := [bBottom] + else + ACell.Borders := [bBottom, bRight]; + if HasVisibleBounds and (AColumn = FColCount) then + ACell.Borders := [bBottom, bRight]; + FHeaderContainerCells.Add(ACell); +end; + +procedure TcxSchedulerDayViewViewInfo.AddHeaderContainerEvent( + APlace: TcxSchedulerEventPlace); +var + I, ATop: Integer; + ABounds: TRect; + AStart, AFinish: TDateTime; + ACell: TcxSchedulerEventCellViewInfo; +begin + if APlace.LineStart >= FHeaderLineCount then Exit; + ATop := Bounds.Top + DayHeaderHeight + FResourceHeaderHeight * Byte(GroupingKind <> gkNone); + GetHeaderEventInfo(APlace.ColStart, APlace.ColFinish, + ABounds.Left, ABounds.Right, AStart, AFinish); + ABounds.Top := ATop + cxTextOffset; + ABounds.Bottom := ATop + FHeaderLineHeight + cxTextOffset; + OffsetRect(ABounds, 0, APlace.LineStart * (FHeaderLineHeight + cxTextOffset)); + if (APlace.ColFinish >= FColCount - 1) and NeedAllDayScrollBar then + Dec(ABounds.Right, DayView.AllDayScrollBar.Width); + ACell := AddEventCell(CreateHeaderEventViewData( + TcxSchedulerControlEvent(APlace.Event), ABounds, + AStart, AFinish, GetColumnResource(APlace.ColStart))); + if not ACell.Event.IsClone then + for I := APlace.ColStart to APlace.ColFinish do + SetColumnTimeLineStyle(ACell, I); +end; + +procedure TcxSchedulerDayViewViewInfo.AddHeaderContainerEventPlace( + AEvent: TcxSchedulerControlEvent; var AColIndex: Integer); +var + I, J: Integer; + ADate: TDateTime; +begin + J := AColIndex; + ADate := GetColumnDate(J); + for I := AColIndex + 1 to FColCount - 1 do + if IsColumnEvent(AEvent, I, True) and (GetColumnDate(I) > ADate) then + J := I + else + Break; + Builder.AddEventPlace(AEvent, AColIndex, J); + AColIndex := J + 1; +end; + +procedure TcxSchedulerDayViewViewInfo.AddMoreEventsButton( + const ARowIndex: Integer; AIsTop: Boolean; AEvent: TcxSchedulerEvent); +var + R: TRect; +begin + R := Bounds; + R.Top := FContentOffset; + R.Right := FHeaderOffsetLeft; + AddButton(R, ARowIndex / FRowCount, not AIsTop, AEvent); +end; + +procedure TcxSchedulerDayViewViewInfo.CalculateAllDayScrollBar; + + function GetRectHeight(const ARect: TRect): Integer; + begin + Result := ARect.Bottom - ARect.Top; + end; + +var + AHeaderBounds, AGroupBounds: TRect; + AVisible: Boolean; +begin + with DayView.AllDayScrollBar do + begin + AVisible := GetHeaderContainer and NeedAllDayScrollBar; + if AVisible then + begin + Kind := sbVertical; + Min := 0; + Max := Math.Max(Min, GetAllDayEventMaxCount - FHeaderLineCount); + Position := Math.Min(Max, FAllDayTopIndex); + FAllDayTopIndex := Position; + AGroupBounds := cxRectSetHeight(Bounds, Byte(GroupByResource) * FResourceHeaderHeight + + Byte(GroupByDate) * DayHeaderHeight); + AHeaderBounds := cxRectSetTop(Bounds, AGroupBounds.Bottom, + Byte(GroupByDate) * FResourceHeaderHeight + Byte(not GroupByDate) * DayHeaderHeight); + Left := AHeaderBounds.Right - Width + 1; + Top := GetRectHeight(AHeaderBounds) + + GetRectHeight(AGroupBounds) + 1; + Height := FContentOffset - Top; + Enabled := Max > Min; + end; + Visible := AVisible; + if not AVisible or not Enabled then + FAllDayTopIndex := 0; + end; +end; + +procedure TcxSchedulerDayViewViewInfo.CalculateBackground; + + procedure CreateBackgroundCell(const ABounds: TRect); + begin + if ABounds.Top < ABounds.Bottom then + begin + CreateCellInstance(TcxSchedulerBackgroundCellViewInfo, ABounds, + Styles.GetBackgroundParams, FBackground); + FBackground.Borders := [bTop]; + end; + end; + + procedure CreateBackgroundCellSlots(const ABounds: TRect); + var + R: TRect; + AEventIndex, I, J, K: Integer; + AEvent: TcxSchedulerControlEvent; + ASlot: TcxSchedulerBackgroundSlotCellViewInfo; + const + ABorders: array[Boolean] of TcxBorders = ([bRight, bTop], [bTop]); + begin + if ABounds.Top >= ABounds.Bottom then Exit; + TcxSchedulerTimeRulerCellViewInfo( + TimeRulerCells[TimeRulerCells.Count - 1]).SetBottom(ABounds.Top); + for J := -1 to ColCount - 1 do + begin + for I := 0 to UnusedRowCount - 1 do + begin + R := cxRectSetTop(ABounds, ABounds.Top + + I * FContentLineHeight, FContentLineHeight); + if J = -1 then + R.Right := FHeaderOffsetLeft + else + with GetContainer(J) do + R := cxRectSetLeft(R, Bounds.Left, cxRectWidth(Bounds)); + if J = ColCount - 1 then Dec(R.Right); + ASlot := AddBackgroundSlot(R, ABorders[J = ColCount - 1], IntToStr(I)); + if J >= 0 then + begin + AEventIndex := 0; + for K := 0 to Events.Count - 1 do + begin + AEvent := Events[K]; + if (IsColumnEvent(AEvent, J, False) or + (IsColumnEvent(AEvent, J, True) and DayView.ShowAllDayEventsInContentArea)) + and not IsEventVisible(AEvent) then + begin + if AEventIndex = I then + begin + ASlot.DisplayText := GetEventSlotDisplayText(AEvent); + Break; + end; + Inc(AEventIndex); + end; + end; + end; + end; + end; + end; + +var + R: TRect; +begin + FreeAndNil(FBackground); + if AutoHeight and not HasVisibleBounds then Exit; + R := Bounds; + if Adapter.IsPrinting then + begin + R.Top := FContentOffset + (PrintFinishRow - PrintStartRow + 1) * FContentLineHeight; + CreateBackgroundCellSlots(R); + end + else + begin + R.Top := FContentOffset + FRowCount * FContentLineHeight; + CreateBackgroundCell(R); + end; +end; + +procedure TcxSchedulerDayViewViewInfo.CalculateContent; +var + I, J: Integer; + ACell: TcxSchedulerContentCellViewInfo; + AColor: TColor; + ARect, ABounds: TRect; + AIndex: Integer; + AResource: TcxSchedulerStorageResourceItem; +begin + ABounds := Bounds; + ABounds.TopLeft := Point(FHeaderOffsetLeft, FContentOffset); + for I := 0 to FColCount - 1 do + begin + AIndex := GetColumnResourceIndex(I); + AResource := GetResourceItemByIndex(AIndex); + AColor := StylesAdapter.GetContentParams(GetColumnDate(I), True, AResource).Color; + ARect := cxRectSetTop(Containers[I].Bounds, ABounds.Top, ContentLineHeight); + if HasVisibleBounds and not Adapter.IsPrinting then + OffsetRect(ARect, 0, -FTopIndex * ContentLineHeight); + if not Adapter.IsPrinting then + begin + if (ColumnInGroup > 1) or ((ColumnInGroup = 1) and (DayView.OptionsView.GroupSeparatorWidth = 0)) then + begin + if (I + 1) mod ColumnInGroup <> 0 then + Dec(ARect.Right, 1); + if ((I mod ColumnInGroup > 0) or not HasSeparator) then + Dec(ARect.Left); + end; + end; + for J := 0 to FDayRowCount - 1 do + if IsRowVisible(J) then + begin + ACell := AddContentCell(ARect, GetRowTime(I, J), GetRowTime(I, J + 1), AIndex); + ACell.Borders := []; + if I = 0 then + ACell.TimeLineBorders := [bRight]; + if HasSeparator and (I mod ColumnInGroup = 0) then + ACell.TimeLineBorders := ACell.TimeLineBorders * + LookAndFeelPainter.HeaderBorders([nLeft]); + ACell.ShowTimeLine := True; + if Adapter.IsPrinting and (I < (FColCount - 1)) then + ACell.Borders := [bRight]; + if not Adapter.IsPrinting or (J <> PrintFinishRow) then + ACell.Borders := ACell.Borders + [bBottom]; + ACell.BorderColor := PainterHelper.GetSeparatorColor( + AColor, (J + 1) mod LinePerHour = 0, DayView.IsWorkTime(AResource, ACell.TimeStart)); + ACell.TimeLineParams := DayView.Styles.GetTimeLineParams; + OffsetRect(ARect, 0, FContentLineHeight); + end; + end; +end; + +procedure TcxSchedulerDayViewViewInfo.CalculateContentNavigationButtons; + + function LineInLine(ADistance1, ADistance2: Integer): Boolean; + begin + Result := ADistance1 <= ADistance2; + end; + + function GetContainerWidth(AContainerID: Integer): Integer; + begin + Result := Containers[AContainerID].Bounds.Right - + Containers[AContainerID].Bounds.Left; + end; + + function GetResourceWidth(AContainerID: Integer; out TheSameResource: Boolean): Integer; + var + I, AResourceCount: Integer; + begin + Result := MaxInt; + TheSameResource := True; + AResourceCount := Max(ResourceCount, 1); + if (DayCount <> 0) and (AContainerID mod DayCount = 0) then + begin + TheSameResource := False; + Result := GetContainerWidth(AContainerID); + I := AContainerID + 1; + while (I < DayCount * AResourceCount) and (I mod DayCount <> 0) do + begin + Inc(Result, GetContainerWidth(I)); + Inc(I); + end; + end; + end; + + function IsValidButtonPlace(AContainerID: Integer; + AColumnPosition: TcxSchedulerColumnPositionInResource; + const AColumnRect: TRect): Boolean; + var + AButtonWidth1, AButtonWidth2, AResourceWidth, AColumnWidth: Integer; + AKind: TcxSchedulerContentNavigationButtonKind; + ANewColumnRect: TRect; + TheSameResource: Boolean; + begin + Result := True; + AColumnWidth := AColumnRect.Right - AColumnRect.Left; + if FColCount = ResourceCount then + begin + CalculateNavigationButtonParams(AColumnRect, nbkPrevious, AButtonWidth1); + CalculateNavigationButtonParams(AColumnRect, nbkNext, AButtonWidth2); + if GroupByDate and (AContainerID < ResourceCount - 1) then + Inc(AButtonWidth2); + Result := LineInLine(AButtonWidth1 + AButtonWidth2, AColumnWidth); + end + else + if GroupByDate then + begin + case AColumnPosition of + cprFirst: AKind := nbkPrevious; + cprLast: AKind := nbkNext; + else + raise Exception.Create(''); + end; + CalculateNavigationButtonParams(AColumnRect, AKind, AButtonWidth1); + Result := LineInLine(AButtonWidth1, AColumnWidth); + end + else + begin + AResourceWidth := GetResourceWidth(AContainerID, TheSameResource); + if not TheSameResource then + begin + if GroupByResource then + ANewColumnRect := cxRectSetWidth(AColumnRect, AResourceWidth) + else + ANewColumnRect := AColumnRect; + CalculateNavigationButtonParams(ANewColumnRect, nbkPrevious, AButtonWidth1); + CalculateNavigationButtonParams(ANewColumnRect, nbkNext, AButtonWidth2); + Result := LineInLine(AButtonWidth1 + AButtonWidth2, AResourceWidth); + end; + end; + end; + +type + TStorageItem = record + AIndex: Integer; + AColumnPosition: TcxSchedulerColumnPositionInResource; + AColumnRect: TRect; + end; + +var + I, AIndex: Integer; + AColumnPosition: TcxSchedulerColumnPositionInResource; + AColumnRect, ABounds: TRect; + ADrawButtons: Boolean; + AStorage: array of TStorageItem; +begin + SetLength(AStorage, FColCount); + I := 0; + ADrawButtons := True; + while ADrawButtons and (I < FColCount) do + begin + AIndex := GetColumnResourceIndex(I); + AColumnPosition := GetColumnPositionInResource(I, AIndex); + AStorage[I].AColumnPosition := AColumnPosition; + if AColumnPosition <> cprIndefinite then + begin + ABounds := Containers[I].Bounds; + AColumnRect := cxRectSetHeight(ABounds, ABounds.Bottom - ABounds.Top + + VisibleRowCount * ContentLineHeight); + ADrawButtons := IsValidButtonPlace(I, AColumnPosition, AColumnRect); + AStorage[I].AIndex := AIndex; + AStorage[I].AColumnRect := AColumnRect; + end; + Inc(I); + end; + + if ADrawButtons then + for I := 0 to FColCount - 1 do + if AStorage[I].AColumnPosition <> cprIndefinite then + AddContentNavigationButton(AStorage[I].AColumnRect, AStorage[I].AIndex, + AStorage[I].AColumnPosition); +end; + +procedure TcxSchedulerDayViewViewInfo.CalculateEvents; +var + I: Integer; + AList: TcxSchedulerEventList; + AContainer: TcxSchedulerContainerCellViewInfo; +begin + AList := TcxSchedulerEventList.Create; + try + for I := 0 to ContainerCount - 1 do + begin + AContainer := Containers[I]; + // for source events + AList.Clear; + ExtractEvents(Events, AList, I); + CalculateEventsForColumn(I, AContainer, AList); + // for clones + AList.Clear; + ExtractEvents(Events.Clones, AList, I); + CalculateEventsForColumn(I, AContainer, AList); + end; + finally + AList.Free; + end; +end; + +procedure TcxSchedulerDayViewViewInfo.CalculateEventsForColumn(AIndex: Integer; + AContainer: TcxSchedulerContainerCellViewInfo; AEvents: TcxSchedulerEventList); +var + ATop, I: Integer; + AViewData: TcxSchedulerEventViewData; + AInfo: TcxEventLayoutInfo; +begin + if AEvents.Count = 0 then Exit; + FEventLayout.Clear; + I := Byte(((AIndex mod ColumnInGroup <> 0) or not HasSeparator) and not (ColCount = 1)); + ATop := FContentOffset; + if not Adapter.IsPrinting then + Dec(ATop, TopIndex * FContentLineHeight); + FEventLayout.SetParams(DateOf(AContainer.DateTime), TimeScale, + FContentLineHeight, AContainer.Bounds.Left - I, ATop, cxRectWidth(AContainer.Bounds)); + for I := 0 to AEvents.Count - 1 do + FEventLayout.Add(TcxSchedulerControlEvent(AEvents[I])); + FEventLayout.Calculate; + for I := 0 to FEventLayout.Count - 1 do + begin + AInfo := FEventLayout.Infos[I]; + CheckEventRowsVisibility(AInfo.Event, AInfo.StartRow, AInfo.StopRow + 1); + AViewData := CreateContentEventViewData(AInfo, AContainer.Resource); + if AViewData <> nil then + begin + if Adapter.IsPrinting and (FColCount > 1) then + if (AIndex mod ColumnInGroup > 0) or ((ColumnInGroup = 1) and + (DayView.OptionsView.GroupSeparatorWidth = 0)) then + OffsetRect(AViewData.Bounds, 1, 0); + AViewData.DrawShadows := DayView.EventShadows; + AddEventCell(AViewData); + end; + end; +end; + +procedure TcxSchedulerDayViewViewInfo.CalculateHeaderEvents; +var + I: Integer; +begin + for I := 0 to Builder.EventPlaceCount - 1 do + AddHeaderContainerEvent(Builder.EventPlaces[I]); +end; + +procedure TcxSchedulerDayViewViewInfo.CalculateHeaderEventsPlace; +var + I, J: Integer; +begin + if not HeaderContainer or DayView.ShowAllDayEventsInContentArea then Exit; + for I := 0 to Events.AbsoluteCount - 1 do + begin + J := 0; + while J < FColCount do + begin + if IsColumnEvent(Events.AbsoluteItems[I], J, True) then + AddHeaderContainerEventPlace(Events.AbsoluteItems[I], J) + else + Inc(J); + end; + end; + Builder.Calculate; +end; + +procedure TcxSchedulerDayViewViewInfo.CalculateHeaderLineCount; + + procedure CheckEventPlace; + var + I: Integer; + AMaxCount: Integer; + begin + AMaxCount := GetAllDayEventMaxCount; + for I := 0 to Builder.EventPlaceCount - 1 do + with Builder.EventPlaces[I] do + if not Assigned(TcxSchedulerControlEvent(Event).Source) then + begin + if FAllDayTopIndex > LineFinish then + FAllDayTopIndex := LineFinish + else + if (FAllDayTopIndex + FHeaderLineCount - 1) < LineFinish then + FAllDayTopIndex := LineFinish - FHeaderLineCount + 1; + end; + for I := 0 to Builder.EventPlaceCount - 1 do + with Builder.EventPlaces[I] do + begin + Dec(LineFinish, FAllDayTopIndex); + Dec(LineStart, FAllDayTopIndex); + if LineFinish < 0 then + Inc(LineFinish, AMaxCount + 1); + if LineStart < 0 then + Inc(LineStart, AMaxCount + 1); + end; + end; + +var + I: Integer; +begin + if not HeaderContainer then + begin + FHeaderLineCount := 0; + Exit; + end; + CalculateHeaderEventsPlace; + FHeaderLineCount := 1; + for I := 0 to Builder.EventPlaceCount - 1 do + FHeaderLineCount := Max(Builder.EventPlaces[I].LineFinish + 1, FHeaderLineCount); + if cxSchedulerAllDayEventContainerMaxLineCount = 0 then + I := (Bounds.Bottom - Bounds.Top - DayHeaderHeight - + FResourceHeaderHeight) div FContentLineHeight div 2 + else + I := cxSchedulerAllDayEventContainerMaxLineCount; + FHeaderLineCount := Min(FHeaderLineCount, Max(1, I)); + if NeedAllDayScrollBar then + CheckEventPlace; +end; + +procedure TcxSchedulerDayViewViewInfo.CalculateHeaders; +var + I, J, W: Integer; + AHeaderBounds, AGroupBounds: TRect; +const + ANeighbors: array[TcxSchedulerGroupingKind, 0..1] of TcxNeighbors = + (([], []), ([], []), ([nTop], []), ([], [nTop])); +begin + AGroupBounds := cxRectSetHeight(Bounds, Byte(GroupByResource) * FResourceHeaderHeight + + Byte(GroupByDate) * DayHeaderHeight); + AHeaderBounds := cxRectSetTop(Bounds, AGroupBounds.Bottom, + Byte(GroupByDate) * FResourceHeaderHeight + Byte(not GroupByDate) * DayHeaderHeight); + W := Bounds.Right - FHeaderOffsetLeft - (GroupCount - 1) * SeparatorWidth; + for I := 0 to GroupCount - 1 do + begin + AGroupBounds.Left := MulDiv(W, I, GroupCount) + FHeaderOffsetLeft + SeparatorWidth * I; + AGroupBounds.Right := MulDiv(W, I + 1, GroupCount) + FHeaderOffsetLeft + SeparatorWidth * I; + for J := 0 to ColumnInGroup - 1 do + begin + AHeaderBounds.Left := AGroupBounds.Left + + MulDiv(cxRectWidth(AGroupBounds), J, ColumnInGroup); + AHeaderBounds.Right := AGroupBounds.Left + + MulDiv(cxRectWidth(AGroupBounds), J + 1, ColumnInGroup); + if GroupByDate then + AddResourceHeader(J, AHeaderBounds).DateTime := + GetColumnDate(I * ColumnInGroup + J) + else + AddDayHeader(GetColumnDate(I * ColumnInGroup + J), AHeaderBounds, + GetColumnResourceIndex(I * ColumnInGroup + J)); + AddContainerCell(I * ColumnInGroup + J, + cxRectSetTop(AHeaderBounds, Bounds.Top, FContentOffset - Bounds.Top)); + end; + if GroupByResource then + AddResourceHeader(I, AGroupBounds) + else + if GroupByDate then + AddDayHeader(Days[I], AGroupBounds, -1); + if HasSeparator then AddGroupVertSeparator(AGroupBounds.Right); + end; + ProcessCheckBorders(ResourceHeaderCells, False, ANeighbors[GroupingKind, 0]); + ProcessDateToDisplayText(True); + ProcessCheckBorders(DayHeaderCells, False, ANeighbors[GroupingKind, 1]); +end; + +procedure TcxSchedulerDayViewViewInfo.CalculateMetrics; + + function GetExtraContentOffset: Integer; + begin + if HeaderContainer then + Result := cxTextOffset + FHeaderLineCount * (FHeaderLineHeight + cxTextOffset) + else + Result := 0; + end; + +begin + inherited CalculateMetrics; + FHeaderLineHeight := FContentLineHeight; + FAdditionalTimeZone := -1; + FCurrentTimeZone := DayView.OptionsView.CurrentTimeZone; + if FCurrentTimeZone = -1 then + FCurrentTimeZone := DayView.DateTimeHelper.CurrentTimeZone; + if DayView.OptionsView.ShowAdditionalTimeZone then + begin + FAdditionalTimeZone := DayView.OptionsView.AdditionalTimeZone; + if FAdditionalTimeZone = -1 then + FAdditionalTimeZone := DayView.DateTimeHelper.CurrentTimeZone; + end; + FColCount := DayCount; + if GroupingKind <> gkNone then + FColCount := FColCount * ResourceCount; + LargeFont := GetTimeRulerParams.Font; + CalculateHeaderLineCount; + CalculateVisibleRows; + FVisibleRowCount := Max(1, ContentHeight div FContentLineHeight); + if not Adapter.IsPrinting then + begin + if AutoHeight and (FVisibleRowCount > (FRowCount + FHeaderLineCount)) then + FContentLineHeight := (ContentHeight - GetExtraContentOffset) div FRowCount; + + FContentOffset := FContentOffset + GetExtraContentOffset; + FVisibleRowCount := Min(FRowCount, Max(1, ContentHeight div FContentLineHeight)); + if AutoHeight or (ContentHeight div FContentLineHeight < FRowCount) then + Inc(FContentOffset, ContentHeight - FContentLineHeight * FVisibleRowCount); + end; + if not HeaderContainer then + FDayHeaderHeight := FContentOffset - Byte(GroupingKind <> gkNone) * FResourceHeaderHeight; + while (FTopIndex > 0) and ((FTopIndex + FVisibleRowCount) > FRowCount) do + Dec(FTopIndex); + CalculateAllDayScrollBar; +end; + +procedure TcxSchedulerDayViewViewInfo.CalculateMetricsForPrinting; +var + AContentHeight: Integer; + HeightAdjusted: Boolean; +begin + FContentOffset := Byte(GroupingKind <> gkNone) * + FResourceHeaderHeight * Byte(ResourceCount >= 1) + + FHeaderLineCount * (FHeaderLineHeight + cxTextOffset) + cxTextOffset; + if (GroupingKind = gkByResource) or (SelectedDays.Count > 1) then + Inc(FContentOffset, DayHeaderHeight); + CalculateUnusedRowCount; + FTimeScale := DayView.TimeScale; + AContentHeight := Bounds.Bottom - Bounds.Top - FContentOffset; + HeightAdjusted := AContentHeight < FContentLineHeight; + while not HeightAdjusted do + begin + CalculateDisplayRows; + FTopIndex := PrintStartRow; + HeightAdjusted := AContentHeight >= FContentLineHeight * PrintRowCount; + if not HeightAdjusted then + begin + if FTimeScale < 60 then + begin + FTimeScale := FTimeScale * 2; + while 60 mod FTimeScale <> 0 do Inc(FTimeScale); + end + else + if UnusedRowCount > 0 then + Dec(FUnusedRowCount) + else + Break; + end; + end; + CalculateDisplayRows; + if HeightAdjusted then + begin + FContentLineHeight := AContentHeight div PrintRowCount; + Inc(FContentOffset, AContentHeight - FContentLineHeight * PrintRowCount); + end; +end; + +procedure TcxSchedulerDayViewViewInfo.CalculateDisplayRows; + + function GetTimeRow(ATime: TDateTime; IsFinish: Boolean): Integer; + begin + Result := Round(ATime / MinuteToTime); + Result := Result div FTimeScale - Byte(IsFinish) + + Byte(IsFinish and (Result mod FTimeScale <> 0)) + end; + +begin + FDayRowCount := cxMinutesPerDay div TimeScale; + if HasVisibleBounds then + begin + FPrintStartRow := GetTimeRow(PrintFrom, False); + FPrintFinishRow := Max(FPrintStartRow, GetTimeRow(PrintTo, True)); + end + else + begin + FPrintStartRow := 0; + FPrintFinishRow := FDayRowCount - 1; + end; + FRowCount := FPrintFinishRow - FPrintStartRow + 1; +end; + +procedure TcxSchedulerDayViewViewInfo.CalculateTimeLine; +var + ABounds, R: TRect; + AOfs, I, AHour: Integer; + AViewParams: TcxViewParams; + ACommonCell, ARulerCell: TcxSchedulerTimeRulerCellViewInfo; +begin + R := cxRectSetTop(Bounds, FContentOffset); + AViewParams := GetTimeRulerParams; + FHeaderOffsetLeft := R.Left + TcxSchedulerTimeRulerCellViewInfo.CalculateWidth( + 1 + Byte(FAdditionalTimeZone >= 0), LinePerHour, AViewParams.Font, LargeFont); + R.Right := FHeaderOffsetLeft; + CalculateTimeZoneBiasDelta; + // add common area + CreateCellInstance(TcxSchedulerTimeRulerCellViewInfo, + cxRectSetTop(R, 0, R.Top), AViewParams, ACommonCell); + ACommonCell.Calculate(DayView.OptionsView.CurrentTimeZoneLabel, + DayView.OptionsView.AdditionalTimeZoneLabel, FCurrentTimeZone, + FAdditionalTimeZone, FAdditionalTimeZoneBiasDelta); + // add ruler cells + AOfs := FPrintStartRow * FContentLineHeight - FContentOffset; + if not Adapter.IsPrinting then + Inc(AOfs, TopIndex * FContentLineHeight); + R := cxRectSetTop(R, 0, LinePerHour * FContentLineHeight); + ABounds := Bounds; + ABounds.Top := FContentOffset; + ABounds.Bottom := Min(FContentOffset + FRowCount * FContentLineHeight, Bounds.Bottom); + FTimeRulerCells.Add(ACommonCell); + I := 0; + while I < FDayRowCount do + begin + if IsRowVisible(I) then + begin + AHour := I div LinePerHour; + CreateCellInstance(TcxSchedulerTimeRulerCellViewInfo, + cxRectSetTop(R, R.Bottom * AHour - AOfs), ABounds, AViewParams, ARulerCell); + ARulerCell.ShowMinutes := DayView.TimeRulerMinutes; + ARulerCell.Calculate(AHour, LinePerHour, FCurrentTimeZone, + FAdditionalTimeZone, LargeFont, FAdditionalTimeZoneBiasDelta); + ARulerCell.LastVisibleHour := not IsHourVisible(AHour + 1); + FTimeRulerCells.Add(ARulerCell); + I := (AHour + 1) * LinePerHour; + end + else + Inc(I); + end; +end; + +procedure TcxSchedulerDayViewViewInfo.CalculateTimeZoneBiasDelta; + + function GetDaylightBiasDelta(ATimeZone: Integer): Integer; + begin + with TcxSchedulerDateTimeHelper do + begin + Result := TimeZoneDaylightBias(Integer(SelectedDays.First), ATimeZone); + if Result = 0 then + Result := TimeZoneDaylightBias(Integer(SelectedDays.Last), ATimeZone); + end; + end; + +begin + FAdditionalTimeZoneBiasDelta := 0; + with DayView.OptionsView do + begin + if CurrentTimeZoneDaylightSaving then + FAdditionalTimeZoneBiasDelta := GetDaylightBiasDelta(FCurrentTimeZone); + if AdditionalTimeZoneDaylightSaving then + Dec(FAdditionalTimeZoneBiasDelta, GetDaylightBiasDelta(FAdditionalTimeZone)); + end; +end; + +procedure TcxSchedulerDayViewViewInfo.CalculateVisibleRows; +begin + if not Adapter.IsPrinting then + begin + FTimeScale := DayView.TimeScale; + CalculateDisplayRows; + FContentOffset := DayHeaderHeight + Byte(GroupingKind <> gkNone) * FResourceHeaderHeight; + if HeaderContainer then + Inc(FContentOffset, cxTextOffset); + end + else + CalculateMetricsForPrinting; +end; + +procedure TcxSchedulerDayViewViewInfo.CalculateUnusedRowCount; +var + I, J: Integer; + AEvent: TcxSchedulerEvent; + AColRowCount: Integer; +begin + FUnusedRowCount := 3; + for I := 0 to ColCount - 1 do + begin + AColRowCount := 0; + for J := 0 to Events.Count - 1 do + begin + AEvent := Events[J]; + if (IsColumnEvent(AEvent, I, False) or + (IsColumnEvent(AEvent, I, True) and + DayView.ShowAllDayEventsInContentArea)) and + not IsEventVisible(AEvent) then + Inc(AColRowCount); + end; + FUnusedRowCount := Max(FUnusedRowCount, AColRowCount); + end; +end; + +procedure TcxSchedulerDayViewViewInfo.Clear; +begin + inherited Clear; + FTimeRulerCells.Clear; +end; + +function TcxSchedulerDayViewViewInfo.CheckDisplayRows( + var AStartRow, AFinishRow: Integer): Boolean; +begin + Result := not HasVisibleBounds or ((AStartRow <= PrintFinishRow) and + (PrintStartRow <= AFinishRow)); + if Result then + begin + AStartRow := Max(AStartRow, PrintStartRow); + AFinishRow := Min(AFinishRow, PrintFinishRow); + end; +end; + +procedure TcxSchedulerDayViewViewInfo.CheckEventRowsVisibility( + AEvent: TcxSchedulerControlEvent; AStartRow, AFinishRow: Integer); +begin + if Adapter.IsPrinting then Exit; + if AStartRow < FTopIndex then + AddMoreEventsButton(AStartRow, True, AEvent); + if (AFinishRow > (FTopIndex + VisibleRowCount)) then + begin + if AFinishRow <= FRowCount then + AddMoreEventsButton(AFinishRow, False, AEvent) + else + if AStartRow > (FTopIndex + VisibleRowCount) then + AddMoreEventsButton(AStartRow, False, AEvent); + end; +end; + +procedure TcxSchedulerDayViewViewInfo.DoCalculate; +begin + Builder.Clear; + if Adapter.IsPrinting then + Inc(FBounds.Right); + FEventLayout := CreateEventLayout; + inherited DoCalculate; + with DayView.Scheduler do + begin + FIsContainerSelected := (GetTimeMinutes(SelFinish) = 0) and + (GetTimeMinutes(SelStart) = 0); + end; + try + CalculateTimeLine; + CalculateHeaders; + CalculateContent; + CalculateEvents; + CalculateHeaderEvents; + CalculateBackground; + CalculateContentNavigationButtons; + finally + FEventLayout.Free; + FButtons.Sort(TListSortCompare(@cxCompareButtons)); + if FEventCells.Count > 1 then + FEventCells.Sort(TListSortCompare(@cxCompareEventViewInfoOrders)); + end; +end; + +procedure TcxSchedulerDayViewViewInfo.DoContentNavigationButtonClick( + Sender: TcxSchedulerContentNavigationButtonViewInfo); + + procedure ShowEvent(ANavigationButtonKind: TcxSchedulerContentNavigationButtonKind); + var + I: Integer; + ATime, AEventTime: TDateTime; + AButton: TcxSchedulerMoreEventsButtonViewInfo; + + procedure SaveButton(AMoreButton: TcxSchedulerMoreEventsButtonViewInfo); + begin + ATime := AEventTime; + AButton := AMoreButton; + end; + + var + AEventStart: TDateTime; + begin + AButton := nil; + if ANavigationButtonKind = nbkPrevious then + ATime := -1 + else + ATime := cxMaxDateTime; + for I := 0 to Buttons.Count - 1 do + if Buttons[I] is TcxSchedulerMoreEventsButtonViewInfo then + begin + AEventStart := TcxSchedulerMoreEventsButtonViewInfo(Buttons[I]).Event.Start; + AEventTime := AEventStart - Trunc(AEventStart); + if ANavigationButtonKind = nbkPrevious then + begin + if ATime < AEventTime then + SaveButton(TcxSchedulerMoreEventsButtonViewInfo(Buttons[I])); + end + else + if ATime > AEventTime then + SaveButton(TcxSchedulerMoreEventsButtonViewInfo(Buttons[I])); + end; + if AButton <> nil then + AButton.Click; + end; +var + ANavigationButtonKind: TcxSchedulerContentNavigationButtonKind; +begin + ANavigationButtonKind := Sender.Kind; + SelectedDays.ShiftPeriod(Sender.Interval); + inherited DoContentNavigationButtonClick(Sender); + ShowEvent(ANavigationButtonKind); +end; + +procedure TcxSchedulerDayViewViewInfo.DoMoreEventsButtonClick( + Sender: TcxSchedulerMoreEventsButtonViewInfo); +var + ARow: Integer; + ADateTime: TDateTime; +begin + ARow := Min(FRowCount, Max(0, Round(Sender.DateTime * FRowCount))); + if not Sender.IsDown then + FTopIndex := ARow + else + FTopIndex := Max(0, ARow - VisibleRowCount); + with Controller.Navigation do + begin + ADateTime := DateOf(SelStart) + TimeOf(Sender.DateTime); + ReplaceSelParams(ADateTime, ADateTime); + end; + View.LayoutChanged; +end; + +function TcxSchedulerDayViewViewInfo.CreateContentEventViewData( + AEventInfo: TcxEventLayoutInfo; AResource: TcxSchedulerResourceViewInfo): TcxSchedulerEventViewData; +begin + if (AEventInfo.DisplayRect.Bottom <= FContentOffset) or + (AEventInfo.DisplayRect.Top >= Bounds.Bottom) then + Result := nil + else + begin + Result := CreateEventViewData(AEventInfo.Event, + AEventInfo.DisplayRect, AEventInfo.Start, AEventInfo.Finish, AResource); + Result.AlwaysShowTime := DayView.AlwaysShowEventTime; + Result.VisibleRect.TopLeft := Point(FHeaderOffsetLeft, FContentOffset); + Result.ShowTimeLine := True; + Result.ShowAllDayEventsInContentArea := DayView.ShowAllDayEventsInContentArea; + end; +end; + +function TcxSchedulerDayViewViewInfo.CreateHeaderEventViewData( + AEvent: TcxSchedulerControlEvent; const ABounds: TRect; + const AStart, AFinish: TDateTime; AResource: TcxSchedulerResourceViewInfo): TcxSchedulerEventViewData; +begin + Result := CreateEventViewData(AEvent, ABounds, AStart, AFinish, AResource); + Result.VisibleRect := cxRect(FHeaderOffsetLeft, DayHeaderHeight, + Bounds.Right, FContentOffset); + Result.ShowTimeLine := False; +end; + +function TcxSchedulerDayViewViewInfo.CreateEventCellViewInfo( + AViewData: TcxSchedulerEventViewData): TcxSchedulerEventCellViewInfo; +begin + Result := TcxSchedulerDayViewEventCellViewInfo.Create(AViewData); +end; + +function TcxSchedulerDayViewViewInfo.CreateEventLayout: TcxCalculateEventLayout; +begin + Result := TcxCalculateEventLayout.Create; + Result.FViewInfo := Self; +end; + +procedure TcxSchedulerDayViewViewInfo.ExtractEvents( + ASource, ADest: TcxSchedulerEventList; AIndex: Integer); +var + I: Integer; +begin + for I := 0 to ASource.Count - 1 do + if (IsColumnEvent(ASource[I], AIndex, False)) or + (IsColumnEvent(ASource[I], AIndex, True) and + DayView.ShowAllDayEventsInContentArea) then + ADest.Add(ASource[I]); +end; + +function TcxSchedulerDayViewViewInfo.GetContentParams(const ATime: TDateTime; + AResource: TcxSchedulerResourceViewInfo): TcxViewParams; +begin + Result := inherited GetContentParams(ATime, AResource); + if not HiddenSelection and not FIsContainerSelected and IsTimeSelected(ATime, AResource) then + Result := GetSelectionParams(Result); +end; + +function TcxSchedulerDayViewViewInfo.GetColumnDate( + AIndex: Integer): Integer; +begin + if GroupingKind = gkByDate then + AIndex := AIndex div ResourceCount + else + if GroupingKind = gkByResource then + AIndex := AIndex mod DayCount; + Result := Integer(SelectedDays.List^[AIndex]) +end; + +function TcxSchedulerDayViewViewInfo.GetColumnPositionInResource(AColumnIndex, + AResourceIndex: Integer): TcxSchedulerColumnPositionInResource; +begin + Result := cprIndefinite; + if ResourceCount > 0 then + begin + if FColCount = ResourceCount then + Result := cprSingle + else + case GroupingKind of + gkByDate: + begin + if AColumnIndex = AResourceIndex then + Result := cprFirst + else + if AColumnIndex > FColCount - 1 - ResourceCount then + Result := cprLast; + end; + gkByResource: + begin + if AColumnIndex = DayCount * AResourceIndex then + Result := cprFirst + else + if AColumnIndex = DayCount * (AResourceIndex + 1) - 1 then + Result := cprLast; + end; + end; + end + else + if FColCount = 1 then + Result := cprSingle + else + if AColumnIndex = 0 then + Result := cprFirst + else + if AColumnIndex = FColCount - 1 then + Result := cprLast; +end; + +function TcxSchedulerDayViewViewInfo.GetColumnResource( + AIndex: Integer): TcxSchedulerResourceViewInfo; +begin + Result := Resources[GetColumnResourceIndex(AIndex)]; +end; + +function TcxSchedulerDayViewViewInfo.GetColumnResourceIndex( + AIndex: Integer): Integer; +begin + Result := -1; + if ResourceCount > 0 then + begin + if GroupingKind = gkByDate then + Result := AIndex mod ResourceCount + else + if GroupingKind = gkByResource then + Result := AIndex div DayCount; + end; +end; + +function TcxSchedulerDayViewViewInfo.GetContainer( + AIndex: Integer): TcxSchedulerContainerCellViewInfo; +begin + Result := TcxSchedulerContainerCellViewInfo(HeaderContainerCells[AIndex]); +end; + +function TcxSchedulerDayViewViewInfo.GetContainerCount: Integer; +begin + Result := HeaderContainerCells.Count; +end; + +function TcxSchedulerDayViewViewInfo.GetDayHeaderHeight: Integer; +begin + Result := inherited GetDayHeaderHeight; + if ((SelectedDays.Count = 1) and Adapter.IsPrinting and (GroupingKind <> gkByResource)) or + not DayView.DayHeaderArea then + Result := 0; +end; + +function TcxSchedulerDayViewViewInfo.GetEventSlotDisplayText( + AEvent: TcxSchedulerControlEvent): string; +begin + Result := DoGetEventDisplayText(AEvent); + with DateTimeHelper do + begin + Result := TimeToStr(AEvent.Start) + '-' + TimeToStr(AEvent.Finish) + ' ' + Result; + end; +end; + +function TcxSchedulerDayViewViewInfo.GetEventColumnRow( + const ATime: TDateTime; AColIndex: Integer; AStart: Boolean): Integer; + + function GetTimeRowEx: Integer; + var + ARow: Integer; + begin + ARow := Round(TimeOf(ATime) / MinuteToTime); + Result := ARow div TimeScale; + if not AStart then + Result := Result - Byte((ARow mod TimeScale) <= (TimeScale / 2)); + Result := Max(0, Min(FRowCount - 1, Result - FPrintStartRow)); + end; + +begin + if AStart and (ATime <= GetColumnDate(AColIndex)) then + Result := 0 + else + if not AStart and (ATime >= GetColumnDate(AColIndex)) then + begin + if HasVisibleBounds then + Result := FRowCount - 1 + else + Result := VisibleRowCount - 1 + end + else + begin + if HasVisibleBounds then + Result := GetTimeRowEx + else + Result := Min(VisibleRowCount, GetTimeRowEx - TopIndex); + if AStart then + Result := Max(0, Result); + end; +end; + +procedure TcxSchedulerDayViewViewInfo.GetHeaderEventInfo(AColStart, AColFinish: Integer; + out ALeft, ARight: Integer; out AStart, AFinish: TDateTime); +begin + with Containers[AColStart] do + begin + ALeft := Bounds.Left + cxTextOffset; + AStart := DateTime; + end; + with Containers[AColFinish] do + begin + ARight := Bounds.Right - cxTextOffset - 1; + AFinish := DateTime + 1; + end; +end; + +function TcxSchedulerDayViewViewInfo.GetTimeLineParams: TcxViewParams; +begin + Result := DayView.Styles.GetTimeLineParams; +end; + +function TcxSchedulerDayViewViewInfo.GetTimeRulerParams: TcxViewParams; +var + AIntf: IcxSchedulerTimeRulerParams; +begin + if Supports(StylesAdapter, IcxSchedulerTimeRulerParams, AIntf) then + Result := AIntf.GetTimeRulerParams + else + Result := DayView.Styles.GetTimeRulerParams; +end; + +function TcxSchedulerDayViewViewInfo.GetTimeRow( + const ATime: TDateTime; AIsStart: Boolean): Integer; +var + ACount: Double; +begin + ACount := Min(FRowCount - 1, + TimeOf(ATime) / MinuteToTime / TimeScale - FPrintStartRow); + Result := Round(ACount); + if not AIsStart and (TimeOf(ACount) = 0) then + Dec(Result); +end; + +function TcxSchedulerDayViewViewInfo.GetResourcesContentWidth: Integer; +var + AFont: TFont; +begin + AFont := GetTimeRulerParams.Font; + LargeFont := AFont; + Result := (Bounds.Right - Bounds.Top) - TcxSchedulerTimeRulerCellViewInfo.CalculateWidth( + 1 + Byte(FAdditionalTimeZone >= 0), 60 div DayView.TimeScale, AFont, LargeFont); + if GroupByDate then + Result := Result div DayCount; +end; + +function TcxSchedulerDayViewViewInfo.GetRowTime( + AColumn, ARow: Integer): TDateTime; +begin + Result := GetColumnDate(AColumn) + (ARow * TimeScale) * MinuteToTime; +end; + +function TcxSchedulerDayViewViewInfo.GetSeparatorCount: Integer; +begin + Result := inherited GetSeparatorCount; + if GroupByDate then + Result := DayCount - 1; +end; + +function TcxSchedulerDayViewViewInfo.IsColumnEvent(AEvent: TcxSchedulerEvent; + AIndex: Integer; IsHeaderEvent: Boolean): Boolean; +begin + Result := AEvent.IsDayEvent(GetColumnDate(AIndex)) and + (IsHeaderEvent = (AEvent.AllDayEvent or (AEvent.Duration >= 1))); + if Result then + Result := AEvent.IsResourceEvent(GetResourceItemByIndex( + GetColumnResourceIndex(AIndex)), ShowEventsWithoutResource); +end; + +function TcxSchedulerDayViewViewInfo.IsContainerSelected( + AResource: TcxSchedulerStorageResourceItem; ADate: TDateTime): Boolean; +begin + Result := False; + with DayView.Scheduler do + begin + if SelectedEventCount > 0 then Exit; + if (AResource = SelResource) and (DateOf(ADate + 1) <= DateOf(SelFinish)) then + begin + if DateOf(ADate) > DateOf(SelStart) then + Result := True + else + Result := (DateOf(ADate) = DateOf(SelStart)) and + (GetTimeMinutes(SelStart) = 0); + end; + end; + Result := Result and CanSelected; +end; + +function TcxSchedulerDayViewViewInfo.IsEventVisible( + AEvent: TcxSchedulerEvent): Boolean; +begin + Result := (TimeOf(AEvent.Start) <= PrintTo) and (TimeOf(AEvent.Finish) >= PrintFrom); +end; + +function TcxSchedulerDayViewViewInfo.IsEventVisible( + var AStartRow, AStopRow: Integer): Boolean; +begin + Result := (AStopRow >= PrintStartRow) and (AStartRow <= PrintFinishRow); + if Result then + begin + AStopRow := Min(PrintFinishRow, AStopRow); + AStartRow := Max(PrintStartRow, AStartRow); + end; +end; + +function TcxSchedulerDayViewViewInfo.IsHourVisible(AIndex: Integer): Boolean; +begin + Result := not HasVisibleBounds or ((PrintStartRow div LinePerHour <= AIndex) and + (AIndex <= PrintFinishRow div LinePerHour)); +end; + +function TcxSchedulerDayViewViewInfo.IsRowVisible(AIndex: Integer): Boolean; +begin + if not HasVisibleBounds then + Result := (AIndex >= FTopIndex) and (AIndex <= FTopIndex + FVisibleRowCount) + else + Result := (AIndex >= PrintStartRow) and (AIndex <= PrintFinishRow); +end; + +procedure TcxSchedulerDayViewViewInfo.MakeTimeVisible( + const ATime: TDateTime); +var + ARow: Integer; +begin + ARow := GetTimeRow(ATime, True); + if (ARow < FTopIndex) or (ARow >= (FTopIndex + VisibleRowCount)) then + begin + if ARow < FTopIndex then + FTopIndex := ARow + else + FTopIndex := Max(0, (ARow + 1) - VisibleRowCount); + end; +end; + +function TcxSchedulerDayViewViewInfo.NavigationButtonOffset( + AKind: TcxSchedulerContentNavigationButtonKind; + AResourceIndex: Integer): Integer; +begin + if (AKind = nbkNext) and GroupByDate and + (AResourceIndex < ResourceCount - 1) then + Result := -1 + else + Result := 0; +end; + +procedure TcxSchedulerDayViewViewInfo.SetColumnTimeLineStyle( + AViewInfo: TcxSchedulerEventCellViewInfo; AColIndex: Integer); +var + ACell: TcxSchedulerContentCellViewInfo; + I, AOfs, StartRow, StopRow: Integer; +begin + AOfs := (ContentCells.Count div ColCount) * AColIndex; + StartRow := GetEventColumnRow(AViewInfo.Event.Start, AColIndex, True) + AOfs; + StopRow := GetEventColumnRow(AViewInfo.Event.Finish - 1, AColIndex, False) + AOfs; + for I := StartRow to StopRow do + if I < ContentCells.Count then + begin + ACell := TcxSchedulerContentCellViewInfo(ContentCells[I]); + if ACell.TimeEvent = nil then + ACell.TimeEvent := AViewInfo; + end; +end; + +function TcxSchedulerDayViewViewInfo.GetAllDayEventMaxCount: Integer; +var + I, J: Integer; + ACount: Integer; +begin + Result := 0; + for J := 0 to FColCount - 1 do + begin + ACount := 0; + for I := 0 to Builder.EventPlaceCount - 1 do + if (Builder.EventPlaces[I].ColStart <= J) and (Builder.EventPlaces[I].ColFinish >= J) and + not DayView.ShowAllDayEventsInContentArea then + Inc(ACount); + Result := Max(Result, ACount); + end; +end; + +function TcxSchedulerDayViewViewInfo.GetAutoHeight: Boolean; +begin + Result := DayView.AutoContentHeight or Adapter.IsPrinting; +end; + +function TcxSchedulerDayViewViewInfo.GetColumnInGroup: Integer; +begin + Result := DayCount; + if GroupingKind = gkByDate then + Result := ResourceCount; +end; + +function TcxSchedulerDayViewViewInfo.GetContentHeight: Integer; +begin + Result := Bounds.Bottom - FContentOffset; +end; + +function TcxSchedulerDayViewViewInfo.GetController: TcxSchedulerDayViewController; +begin + Result := TcxSchedulerDayViewController(DayView.Controller); +end; + +function TcxSchedulerDayViewViewInfo.GetDayView: TcxSchedulerDayView; +begin + Result := TcxSchedulerDayView(Owner); +end; + +function TcxSchedulerDayViewViewInfo.GetGroupCount: Integer; +begin + if GroupingKind = gkByDate then + Result := DayCount + else + if GroupingKind = gkByResource then + Result := ResourceCount + else + Result := 1; +end; + +function TcxSchedulerDayViewViewInfo.GetHeaderContainer: Boolean; +begin + Result := DayView.HeaderContainer; +end; + +function TcxSchedulerDayViewViewInfo.GetPrintRowCount: Integer; +begin + Result := FPrintFinishRow - FPrintStartRow + UnusedRowCount + 1; +end; + +function TcxSchedulerDayViewViewInfo.GetLinePerHour: Integer; +begin + Result := 60 div TimeScale; +end; + +function TcxSchedulerDayViewViewInfo.NeedAllDayScrollBar: Boolean; +begin + Result := False; + if not DayView.Active then + Exit; + case DayView.AllDayAreaScrollBar of + adsbNever: + Result := False; + adsbAlways: + Result := True; + else + Result := (FHeaderLineCount < GetAllDayEventMaxCount); + end; +end; + +procedure TcxSchedulerDayViewViewInfo.SetLargeFont(AFont: TFont); +begin + FLargeFont.Assign(AFont); + FLargeFont.Size := AFont.Size * 2; +end; + +{ TcxSchedulerDayViewHitTest } + +function TcxSchedulerDayViewHitTest.GetContainerCell: TcxSchedulerContainerCellViewInfo; +begin + if HitAtContainer then + Result := TcxSchedulerContainerCellViewInfo(FHitObject) + else + Result := nil; +end; + +function TcxSchedulerDayViewHitTest.GetTimeRulerCell: TcxSchedulerTimeRulerCellViewInfo; +begin + if HitAtTimeRuler then + Result := TcxSchedulerTimeRulerCellViewInfo(FHitObject) + else + Result := nil; +end; + +{ TcxDayViewDragEventHelper } + +function TcxDayViewDragEventHelper.GetOriginHitTestMask: Int64; +const + Mask = (1 shl htcControl) or (1 shl htcDayHeader) or (1 shl htcTimeRuler) + or (1 shl htcContainer) or (1 shl htcContent); +begin + Result := Mask; +end; + +procedure TcxDayViewDragEventHelper.GetOriginState; +begin + inherited GetOriginState; + FStartInHeader := FStartHitFlags and (1 shl htcContainer) <> 0; +end; + +function TcxDayViewDragEventHelper.IsAtOrigin: Boolean; +begin + Result := inherited IsAtOrigin or + (((not ShowHeaderContainer and HitTest.HitAtDayHeader) or (FStartInHeader and InHeader)) and + (Controller.StartDragHitTime = HitTest.Time) and + ((FStartResource = nil) or (FStartResource = HitTest.Resource))); + +end; + +function TcxDayViewDragEventHelper.InHeader: Boolean; +begin + with HitTest do + Result := ShowHeaderContainer and (HitAtDayHeader or HitAtContainer); +end; + +procedure TcxDayViewDragEventHelper.SetCloneEventsTimeDelta(AStart, ACurrent: TDateTime; + AInHeader: Boolean); +var + I: Integer; + ADelta: TDateTime; +begin + for I := 0 to Clones.Count - 1 do + begin + with Clones[I] do + begin + AllDayEvent := AInHeader and (Source.AllDayEvent or (Source.Duration < 1)); + if AInHeader then + begin + ADelta := DateOf(AStart) - DateOf(ACurrent); + if not IsHeaderEvent(Source) then + begin + Duration := 1; + MoveTo(DateOf(Source.Start) - ADelta); + end + else + begin + Duration := Source.Duration; + MoveTo(Source.Start - ADelta); + end; + end + else + if not IsHeaderEvent(Source) or + Controller.View.ShowAllDayEventsInContentArea then + begin + Duration := Source.Duration; + MoveTo(Source.Start - (AStart - ACurrent)); + end + else + begin + Duration := cxHalfHour; + MoveTo(ACurrent); + end; + end; + end; +end; + +procedure TcxDayViewDragEventHelper.UpdateViewClonesTime; +begin + with HitTest do + begin + if HitAtTimeRuler then + // correct event's times + SetCloneEventsTimeDelta(Controller.StartDragHitTime, + DateOf(Controller.StartDragHitTime) + Time, False) + else + SetCloneEventsTimeDelta(Controller.StartDragHitTime, Time, InHeader); + end; + UpdateEventStates; +end; + +procedure TcxDayViewDragEventHelper.UpdateEventStates; +var + I: Integer; +begin + for I := 0 to Clones.Count - 1 do + CheckEventState(Clones[I]); +end; + +function TcxDayViewDragEventHelper.GetController: TcxSchedulerDayViewController; +begin + Result := TcxSchedulerDayViewController(inherited Controller); +end; + +function TcxDayViewDragEventHelper.GetHitTest: TcxSchedulerDayViewHitTest; +begin + Result := TcxSchedulerDayViewHitTest(inherited HitTest); +end; + +function TcxDayViewDragEventHelper.GetShowHeaderContainer: Boolean; +begin + Result := TcxSchedulerDayView(HitTest.View).HeaderContainer; +end; + +{ TcxDayViewEventSizing } + +function TcxDayViewEventSizing.GetDragCursor(Accepted: Boolean): TCursor; +const + Cursors: array[Boolean] of TCursor = (crSchedulerVertResize, + crSchedulerHorzResize); +begin + if HasConflicts then + Result := crNoDrop + else + Result := Cursors[IsHeaderEvent(Event) and HitTest.HitAtContainer]; +end; + +function TcxDayViewEventSizing.GetOriginHitTestMask: Int64; +const + Mask = (1 shl htcControl) or (1 shl htcDayHeader) or (1 shl htcTimeRuler) + or (1 shl htcContainer) or (1 shl htcContent); +begin + Result := Mask; +end; + +procedure TcxDayViewEventSizing.CalcAllDayEvent; +begin + with Event do + begin + AllDayEvent := (HitTest.HitAtContainer or (TimeOf(GetSizingTime) = 0)) and + (Source.AllDayEvent or (TimeOf(FFixedBoundTime) = 0)); + if Controller.DragKind = edkResizeStart then + Finish := FFixedBoundTime + else + Start := FFixedBoundTime; + end; +end; + +function TcxDayViewEventSizing.GetFinishTime: TDateTime; +begin + Result := HitTest.Time; + if HitTest.HitAtTimeRuler then + Result := Result + DateOf(Event.Finish) + else + if HitTest.HitAtContent then + Result := Result + + TcxSchedulerDayView(Scheduler.CurrentView).TimeScale * MinuteToTime + else + if (Controller.DragKind = edkResizeEnd) and not Event.AllDayEvent and + HitTest.HitAtContainer and (TimeOf(Result) = 0) then Result := Result + 1; +end; + +procedure TcxDayViewEventSizing.GetOriginState; +begin + inherited GetOriginState; + with Event do + begin + if Controller.DragKind = edkResizeStart then + FFixedBoundTime := Finish + else + FFixedBoundTime := Start; + end; +end; + +function TcxDayViewEventSizing.GetSizingTime: TDateTime; +begin + if Controller.DragKind = edkResizeStart then + Result := GetStartTime + else + Result := GetFinishTime; +end; + +function TcxDayViewEventSizing.GetStartTime: TDateTime; +begin + Result := HitTest.Time; + if HitTest.HitAtTimeRuler then + Result := Result + DateOf(Event.Start); +end; + +function TcxDayViewEventSizing.GetController: TcxSchedulerDayViewController; +begin + Result := TcxSchedulerDayViewController(inherited Controller); +end; + +function TcxDayViewEventSizing.GetHitTest: TcxSchedulerDayViewHitTest; +begin + Result := TcxSchedulerDayViewHitTest(inherited HitTest); +end; + +{ TcxSchedulerDayNavigation } + +procedure TcxSchedulerDayNavigation.KeyDown( + var AKey: Word; AShift: TShiftState); +var + ATime, ATimeDelta: TDateTime; +begin + FSelRow := GetTimeRow(FCurrentAnchor); + ATime := DateOf(FCurrentAnchor); + ATimeDelta := 0; + case AKey of + VK_UP: + begin + if FSelRow = 0 then + Exit + else + ATimeDelta := GetRowTime(FSelRow - 1); + end; + VK_DOWN: + begin + if FSelRow >= ViewInfo.FRowCount - 1 then + Exit + else + ATimeDelta := GetRowTime(FSelRow + 1); + end; + VK_HOME: + if not (ssCtrl in AShift) or DayView.WorkTimeOnly then + ATimeDelta := TimeOf(DayView.WorkStart); + VK_END: + begin + if (ssCtrl in AShift) and not DayView.WorkTimeOnly then + ATimeDelta := 1 - DayView.GetTimeIncrement + else + ATimeDelta := TimeOf(DayView.WorkFinish) - DayView.GetTimeIncrement; + end; + VK_LEFT, VK_RIGHT: + begin + DoNextColumn(AKey = VK_RIGHT, GetColumnByDate(ATime, ResourceObject), + ATime, FCurrentResource); + Exit; + end; + VK_NEXT, VK_PRIOR: + if not DoNextPage(AKey = VK_NEXT, ATime, FCurrentResource) then Exit; + end; + ATime := ATime + ATimeDelta; + ViewInfo.MakeTimeVisible(ATime); + SetSelAnchor(ATime, AShift, FCurrentResource); +end; + +procedure TcxSchedulerDayNavigation.ValidateSelection(var ASelStart, + ASelFinish: TDateTime; var AResource: TcxSchedulerStorageResourceItem); +var + I: Integer; + AStart, AFinish, ADate: TDateTime; +begin + inherited ValidateSelection(ASelStart, ASelFinish, AResource); + if DayView.WorkTimeOnly and ((TimeOf(ASelStart) <> 0) or + (TimeOf(ASelFinish + ViewInfo.DayView.GetTimeIncrement) <> 0)) then + begin + ASelStart := ValidateTimeVisibility(ASelStart); + ASelFinish := ValidateTimeVisibility(ASelFinish); + end; + AStart := DateOf(Min(ASelFinish, ASelStart)); + AFinish := DateOf(Max(ASelFinish, ASelStart)); + for I := 0 to ViewInfo.DayCount - 1 do + begin + ADate := ViewInfo.Days[I]; + if (ADate >= AStart) and (ADate <= AFinish) then Exit + end; + ASelFinish := GetColumnDate(0) + TimeOf(ASelFinish); + ASelStart := ASelFinish; +end; + +function TcxSchedulerDayNavigation.ValidateTimeVisibility( + var ADateTime: TDateTime): TDateTime; +begin + Result := DateOf(ADateTime) + Min(DayView.WorkFinish, + Max(DayView.WorkStart, TimeOf(ADateTime))); +end; + +function TcxSchedulerDayNavigation.ColCount: Integer; +begin + Result := ViewInfo.ColCount; +end; + +procedure TcxSchedulerDayNavigation.DoNextColumn(AGoToNext: Boolean; AColumn: Integer; + const ATime: TDateTime; AResource: TcxSchedulerStorageResourceItem); +const + AColInc: array[Boolean] of Integer = (-1, 1); +begin + if IsResourceNavigation(AGoToNext, AColumn, ATime) then Exit; + if ((AGoToNext and (AColumn = ColCount - 1)) or (not AGoToNext and (AColumn = 0))) then + begin + DayView.ScrollVisibleDays(not AGoToNext); + ReplaceDate(ATime + AColInc[AGoToNext], GetColumnResource(AColumn)); + end + else + begin + Inc(AColumn, AColInc[AGoToNext]); + if (AResource <> GetColumnResource(AColumn)) then + ReplaceDate(GetColumnDate(AColumn), GetColumnResource(AColumn)) + else + if not (ssShift in FShift) then + ReplaceDate(GetColumnDate(AColumn), GetColumnResource(AColumn)) + else + SetSelAnchor(GetColumnDate(AColumn) + TimeOf(FCurrentAnchor), FShift, AResource); + end; +end; + +function TcxSchedulerDayNavigation.DoNextPage(AGoForward: Boolean; + var ATime: TDateTime; var AResource: TcxSchedulerStorageResourceItem): Boolean; +var + ARow: Integer; +begin + if AGoForward then + Result := FSelRow < (ViewInfo.FRowCount - 1) + else + Result := FSelRow > 0; + if Result then + begin + if AGoForward then + begin + ARow := Min(FSelRow + ViewInfo.VisibleRowCount, ViewInfo.FRowCount - 1); + ViewInfo.FTopIndex := Min(ViewInfo.FTopIndex + ViewInfo.VisibleRowCount, + ViewInfo.FRowCount - 1) + end + else + begin + ARow := Max(0, FSelRow - ViewInfo.VisibleRowCount); + ViewInfo.FTopIndex := Max(0, ViewInfo.FTopIndex - ViewInfo.VisibleRowCount); + end; + ATime := ATime + GetRowTime(ARow); + end; +end; + +function TcxSchedulerDayNavigation.GetColumnByDate( + const ADate: TDateTime; AResource: TObject): Integer; +begin + for Result := 0 to ViewInfo.ColCount - 1 do + with ViewInfo do + begin + if (GetColumnDate(Result) >= DateOf(ADate)) and + (GetColumnResource(Result) = AResource) then Exit; + end; + Result := 0; +end; + +function TcxSchedulerDayNavigation.GetColumnDate(AColumn: Integer): TDateTime; +begin + Result := ViewInfo.GetColumnDate(AColumn); +end; + +function TcxSchedulerDayNavigation.GetColumnResource( + AColumn: Integer): TcxSchedulerStorageResourceItem; +begin + Result := GetResourceFromViewInfo(ViewInfo.Containers[AColumn].Resource); +end; + +function TcxSchedulerDayNavigation.GetRowTime( + const ARow: Integer; AFinish: Boolean = False): TDateTime; +begin + Result := RoundTime((ARow + ViewInfo.PrintStartRow + + Byte(AFinish)) * DayView.TimeScale * MinuteToTime); +end; + +function TcxSchedulerDayNavigation.GetTimeRow(const ATime: TDateTime): Integer; +begin + Result := ViewInfo.GetTimeRow(ATime, True); +end; + +function TcxSchedulerDayNavigation.IsResourceNavigation(AGoToNext: Boolean; + AColumn: Integer; const ATime: TDateTime): Boolean; + + function GetActualDate(AIsFirst: Boolean): TDateTime; + begin + if AIsFirst then + Result := Integer(ViewInfo.SelectedDays.First) + else + Result := Integer(ViewInfo.SelectedDays.Last); + end; + +var + AResource: TcxSchedulerStorageResourceItem; +begin + Result := True; + if ViewInfo.GroupByResource and ((AGoToNext and (AColumn = ColCount - 1)) or + (not AGoToNext and (AColumn = 0))) then + begin + if ScrollResourcesEx(AGoToNext, AResource) then + begin + ReplaceDate(GetActualDate(AGoToNext), AResource); + Exit; + end; + end + else + if ViewInfo.GroupByDate and ((IsLastResource and AGoToNext) or + (IsFirstResource and not AGotoNext)) then + begin + if ScrollResourcesEx(AGoToNext, AResource) then + begin + ReplaceSelParams(AResource); + Exit; + end + else + if not ((AGoToNext and (AColumn = ColCount - 1)) or + (not AGoToNext and (AColumn = 0))) and ScrollResourcesCycled(AGoToNext, AResource) then + ReplaceSelParams(AResource); + end; + Result := False; +end; + +function TcxSchedulerDayNavigation.GetDayView: TcxSchedulerDayView; +begin + Result := ViewInfo.DayView; +end; + +function TcxSchedulerDayNavigation.GetSelectedDays: TcxSchedulerDateList; +begin + Result := ViewInfo.SelectedDays; +end; + +function TcxSchedulerDayNavigation.GetViewInfo: TcxSchedulerDayViewViewInfo; +begin + Result := TcxSchedulerDayViewViewInfo(inherited ViewInfo); +end; + +{ TcxSchedulerDayViewController } + +constructor TcxSchedulerDayViewController.Create( + AOwner: TcxSchedulerSubControl); +begin + inherited Create(AOwner); + FTimer := TTimer.Create(nil); + FScrollAreaRects := TList.Create; +end; + +destructor TcxSchedulerDayViewController.Destroy; +begin + FScrollAreaRects.Free; + FTimer.Free; + inherited Destroy; +end; + +procedure TcxSchedulerDayViewController.BeforeMouseDown( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FIsEditingBeforeMouseDown := IsEditing; + inherited BeforeMouseDown(Button, Shift, X, Y); +end; + +procedure TcxSchedulerDayViewController.CancelScroll; +begin + InitTimer(False, scEndScroll); +end; + +procedure TcxSchedulerDayViewController.CheckDragDropScrolling(const P: TPoint); +var + AAccepted: Boolean; +begin + if DragEventHelper <> nil then + begin + AAccepted := True; + DoSchedulerDragOver(P, dsDragMove, AAccepted); + AAccepted := AAccepted and cxRectPtIn(View.ViewInfo.Bounds, P); + DragEventHelper.DragOver(P, dsDragMove, AAccepted); + DragEventHelper.UpdateHelperState(AAccepted); + end; +end; + +procedure TcxSchedulerDayViewController.CheckScrolling(const APos: TPoint); +var + ACanScroll: Boolean; + AScrollCode: TScrollCode; + R: TRect; +begin + if FLockScrolling then Exit; + R := ViewInfo.Bounds; + R.Top := ViewInfo.FContentOffset; + ACanScroll := cxRectPtIn(R, APos); + AScrollCode := TScrollCode(FTimer.Tag); + if (APos.Y >= R.Top) and (APos.Y < (R.Top + cxScrollZoneSize)) then + AScrollCode := scLineUp + else + if (APos.Y < R.Bottom) and (APos.Y >= (R.Bottom - cxScrollZoneSize)) then + AScrollCode := scLineDown + else + ACanScroll := False; + if (ACanScroll <> FTimer.Enabled) or (Integer(AScrollCode) <> FTimer.Tag) then + InitTimer(ACanScroll, AScrollCode); +end; + +procedure TcxSchedulerDayViewController.CheckTimeRulerTime; +begin + if HitTest.HitAtTime and HitTest.HitAtTimeRuler and (DragEventHelper = nil) then + HitTest.SetHitTime(htcTime, DateOf(Navigation.SelAnchor) + TimeOf(HitTest.Time)); +end; + +function TcxSchedulerDayViewController.CreateDragEventHelper: TcxDragEventHelper; +begin + Result := TcxDayViewDragEventHelper.Create(Scheduler); +end; + +function TcxSchedulerDayViewController.CreateNavigation: TcxSchedulerViewNavigation; +begin + Result := TcxSchedulerDayNavigation.Create(View); +end; + +function TcxSchedulerDayViewController.CreateResizeEventHelper: TcxEventSizingHelper; +begin + Result := TcxDayViewEventSizing.Create(Scheduler); +end; + +procedure TcxSchedulerDayViewController.InitTimer( + AllowStart: Boolean; AScrollCode: TScrollCode); +begin + if AllowStart and FIsEditingBeforeMouseDown then + begin + FIsEditingBeforeMouseDown := False; + AllowStart := False; + end; + if not AllowStart then + FTimer.OnTimer := nil + else + FTimer.OnTimer := OnTimer; + FTimer.Enabled := AllowStart; + FTimer.Interval := cxScrollInterval; + FTimer.Tag := Integer(AScrollCode); +end; + +procedure TcxSchedulerDayViewController.MouseDown( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + if (Button = mbLeft) and (DragKind = edkNone) and not HitTest.HitAtEvent then + begin + FLockScrolling := False; + CloseInplaceEdit; + UnselectEvents; + if HitTest.HitAtContainer and not HitTest.HitAtDayHeader then + begin + FLockScrolling := True; + with HitTest.ContainerCell do + begin + Navigation.ReplaceSelParams(DateTime, DateTime + 1 - Navigation.TimeIncrement, HitTest.Resource); + FStartSelAnchor := DateTime - Navigation.TimeIncrement; + end; + if (Shift = [ssLeft, ssDouble]) and CanCreateEventUsingDialog then + Scheduler.CreateEventUsingDialog + else + View.Refresh; + Exit; + end + else + if HitTest.HitAtTimeRuler then + begin + HitTest.SetHitTime(htcTime, GetTimeRulerTime); + FLockScrolling := HitTest.HitAtButton; + end; + end; + inherited MouseDown(Button, Shift, X, Y); +end; + +procedure TcxSchedulerDayViewController.MouseMove( + Shift: TShiftState; X, Y: Integer); +var + AStart, AFinish: TDateTime; +begin + CheckTimeRulerTime; + if CanProcessMouseMove and (ssLeft in Shift) and (DragKind = edkNone) then + begin + if HitTest.HitAtContainer and not HitTest.HitAtDayHeader then + begin + InitTimer(False, scEndScroll); + AStart := DateOf(Navigation.SelRealStart); + AFinish := HitTest.ContainerCell.DateTime; + HitTest.SetBitState(htcTime, False); + HitTest.SetBitState(htcContainer, False); + if Navigation.SelResource = HitTest.Resource then + begin + if AFinish >= AStart then + Navigation.ReplaceSelParams(AStart, AFinish + 1 - Navigation.TimeIncrement) + else + Navigation.ReplaceSelParams(AStart + 1 - Navigation.TimeIncrement, AFinish); + end + else + Navigation.ReplaceSelParams(AStart, AStart + 1 - Navigation.TimeIncrement, + Navigation.SelResource); + View.Refresh; + Exit; + end + else + if HitTest.HitAtTimeRuler then + begin + Navigation.SetSelAnchor(GetTimeRulerTime, [ssShift] + Shift); + CheckScrolling(cxPoint(X, Y)); + Exit; + end; + end; + CheckDragDropScrolling(cxPoint(X, Y)); + inherited MouseMove(Shift, X, Y); + if CanProcessMouseMove and (ssLeft in Shift) then + CheckScrolling(cxPoint(X, Y)); +end; + +procedure TcxSchedulerDayViewController.MouseUp( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FLockScrolling := False; + CancelScroll; + inherited MouseUp(Button, Shift, X, Y); +end; + +procedure TcxSchedulerDayViewController.OnTimer(Sender: TObject); + + function GetShiftState: TShiftState; + const + Buttons: array[Boolean] of Integer = (VK_LBUTTON, VK_RBUTTON); + begin + Result := []; + if GetAsyncKeyState(Buttons[GetSystemMetrics(SM_SWAPBUTTON) <> 0]) < 0 then + Include(Result, ssLeft); + if GetAsyncKeyState(VK_CONTROL) < 0 then + Include(Result, ssCtrl); + end; + +var + APos: Integer; + AMousePos: TPoint; + AShift: TShiftState; +begin + AShift := GetShiftState; + if not (ssLeft in AShift) then + begin + CancelScroll; + SetCaptureControl(nil); + end + else + begin + APos := ViewInfo.FTopIndex; + ViewInfo.ScrollVertical(TScrollCode(FTimer.Tag), APos); + AMousePos := View.ScreenToClient(GetMouseCursorPos); + MouseMove(AShift, AMousePos.X, AMousePos.Y); + if (DragKind in [edkResizeStart, edkResizeEnd]) then + CheckUpdateEventBounds; + end; +end; + +procedure TcxSchedulerDayViewController.SelectNextEvent(AForward: Boolean); +var + ASelectedIndex: Integer; + I: Integer; + AAllDayTopIndex: Integer; + AEventInHeaderIndex: Integer; + AToDown: Boolean; + + function GetEventInHeaderIndex(AEvent: TcxSchedulerEvent): Integer; + var + I: Integer; + AMaxCount: Integer; + begin + Result := -1; + AMaxCount := ViewInfo.GetAllDayEventMaxCount; + for I := 0 to ViewInfo.Builder.EventPlaceCount - 1 do + if ViewInfo.Builder.EventPlaces[I].Event = AEvent then + begin + Result := ViewInfo.Builder.EventPlaces[I].LineStart + AAllDayTopIndex; + if Result > AMaxCount then + Result := Result - AMaxCount - 1; + Break; + end; + end; + + procedure GetNextSelectedIndex(var AIndex: Integer); + begin + if AForward then + Inc(AIndex) + else + Dec(AIndex); + end; + +begin + if View.EventList.Count = 0 then + Exit; + if not ViewInfo.NeedAllDayScrollBar then + begin + inherited SelectNextEvent(AForward); + Exit; + end; + ASelectedIndex := -1; + for I := 0 to View.EventList.Count - 1 do + if View.EventList[I].Selected then + begin + ASelectedIndex := I; + Break; + end; + GetNextSelectedIndex(ASelectedIndex); + if ASelectedIndex < -1 then + ASelectedIndex := View.EventList.Count - 1; + if (ASelectedIndex < View.EventList.Count) and + (ASelectedIndex >= 0) then + begin + AAllDayTopIndex := ViewInfo.AllDayTopIndex; + AEventInHeaderIndex := GetEventInHeaderIndex(View.EventList[ASelectedIndex]); + while ((ASelectedIndex < View.EventList.Count) and (ASelectedIndex >= 0)) and + (not View.GetEventVisibility(View.EventList[ASelectedIndex]) and (AEventInHeaderIndex = -1)) do + begin + GetNextSelectedIndex(ASelectedIndex); + AEventInHeaderIndex := GetEventInHeaderIndex(View.EventList[ASelectedIndex]); + end; + if (ASelectedIndex < View.EventList.Count) and + (ASelectedIndex >= 0) then + begin + SelectSingleEvent(View.EventList[ASelectedIndex], NullDate); + if AEventInHeaderIndex <> -1 then + begin + AToDown := AEventInHeaderIndex > ViewInfo.AllDayTopIndex; + while not View.GetEventVisibility(View.EventList[ASelectedIndex]) do + begin + if AToDown then + ViewInfo.AllDayScroll(scLineDown, AAllDayTopIndex) + else + ViewInfo.AllDayScroll(scLineUp, AAllDayTopIndex); + if AEventInHeaderIndex = ViewInfo.AllDayTopIndex then + Break; + end; + end; + end + else + UnselectEvents; + end + else + UnselectEvents; + View.Refresh; +end; + +procedure TcxSchedulerDayViewController.CheckNavigatorScrollArea( + const APoint: TPoint); + + function CheckArea(const ARect: TRect; AIsUpArea: Boolean): Boolean; + var + R: TRect; + DW, I: Integer; + begin + Result := PtInArea(ARect, APoint, AIsUpArea); + if not Result and (FScrollAreaRects.Count > 0) then + begin + DW := View.OptionsView.GroupSeparatorWidth div 2; + for I := 0 to FScrollAreaRects.Count - 1 do + begin + if I mod 2 <> Byte(AIsUpArea) then Continue; + if not AIsUpArea then + R := cxRectSetLeft(ARect, Integer(FScrollAreaRects[I]) - DW, cxScrollZoneSize) + else + R := cxRectSetRight(ARect, Integer(FScrollAreaRects[I]) + DW + 1, cxScrollZoneSize); + Result := PtInRect(R, APoint); + if Result then Break; + end; + end; + end; + +var + ACode: TScrollCode; +begin + if CheckArea(FUpScrollArea, False) then + ACode := scLineDown + else + if CheckArea(FDownScrollArea, True) then + ACode := scLineUp + else + ACode := scEndScroll; + NavigatorTimer.Tag := Byte(ACode); + if not NavigatorTimer.Enabled then + NavigatorTimer.Interval := cxNavigatorStartTimer; + NavigatorTimer.Enabled := ACode <> scEndScroll; +end; + +procedure TcxSchedulerDayViewController.DoneNavigatorScrollArea; +begin + FScrollAreaRects.Clear; + inherited DoneNavigatorScrollArea; +end; + +procedure TcxSchedulerDayViewController.InitNavigatorScrollArea; +var + I: Integer; +begin + FScrollAreaRects.Clear; + if ViewInfo.GroupingKind = gkByDate then + begin + for I := 0 to ViewInfo.GroupSeparatorCells.Count - 1 do + with ViewInfo.GroupSeparatorCells[I] do + begin + FScrollAreaRects.Add(Pointer(Bounds.Left)); + FScrollAreaRects.Add(Pointer(Bounds.Right)); + end; + end; + inherited InitNavigatorScrollArea; +end; + +function TcxSchedulerDayViewController.GetDragEventHelper: TcxDayViewDragEventHelper; +begin + Result := TcxDayViewDragEventHelper(inherited DragEventHelper); +end; + +function TcxSchedulerDayViewController.GetHitTest: TcxSchedulerDayViewHitTest; +begin + Result := View.HitTest; +end; + +function TcxSchedulerDayViewController.GetTimeRulerTime: TDateTime; +begin + Result := TimeOf(HitTest.Time) + DateOf(Navigation.SelAnchor); +end; + +function TcxSchedulerDayViewController.GetView: TcxSchedulerDayView; +begin + Result := TcxSchedulerDayView(inherited View); +end; + +function TcxSchedulerDayViewController.GetViewInfo: TcxSchedulerDayViewViewInfo; +begin + Result := View.ViewInfo; +end; + +{ TcxSchedulerDayViewPainter } + +procedure TcxSchedulerDayViewPainter.Paint; +begin + inherited Paint; + ViewInfo.ContentCells.Draw(Canvas, DrawContentCell); + ViewInfo.HeaderContainerCells.Draw(Canvas, DrawContainerCell); + ViewInfo.EventCells.Draw(Canvas, DrawDayViewEventCell); + ViewInfo.ResourceHeaderCells.Draw(Canvas, DrawResourceHeaderCell); + ViewInfo.GroupSeparatorCells.Draw(Canvas, DrawGroupSeparatorCell); + ViewInfo.DayHeaderCells.Draw(Canvas, DrawHeaderCell); + ViewInfo.TimeRulerCells.Draw(Canvas, DrawTimeRulerCell); + ViewInfo.Buttons.Draw(Canvas, DrawButtonCell); + ViewInfo.NavigationButtons.Draw(Canvas, DrawButtonCell); + DrawBackgroundCell(ViewInfo.Background); +end; + +procedure TcxSchedulerDayViewPainter.DrawContainerCell( + AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); +begin + View.DoCustomDrawContainer( + TcxSchedulerContainerCellViewInfo(AItem), ADone); +end; + +procedure TcxSchedulerDayViewPainter.DrawDayViewEventCell( + AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); +begin + DrawEventCell(AItem, ADone); +end; + +procedure TcxSchedulerDayViewPainter.DrawTimeRulerCell( + AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); +begin + View.DoCustomDrawTimeRuler( + TcxSchedulerTimeRulerCellViewInfo(AItem), ADone); +end; + +function TcxSchedulerDayViewPainter.GetView: TcxSchedulerDayView; +begin + Result := ViewInfo.DayView; +end; + +function TcxSchedulerDayViewPainter.GetViewInfo: TcxSchedulerDayViewViewInfo; +begin + Result := TcxSchedulerDayViewViewInfo(inherited ViewInfo); +end; + +{ TcxSchedulerTimeRulerPopupMenu } + +constructor TcxSchedulerTimeRulerPopupMenu.Create( + AScheduler: TcxCustomScheduler); +begin + inherited Create(AScheduler); + FItems := [rpmiNewEvent, rpmiNewAllDayEvent, rpmiNewReccuringEvent, rpmi60min, + rpmi30min, rpmi15min, rpmi10min, rpmi6min, rpmi5min]; +end; + +procedure TcxSchedulerTimeRulerPopupMenu.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerTimeRulerPopupMenu then + begin + Items := TcxSchedulerTimeRulerPopupMenu(Source).Items; + OnClick := TcxSchedulerTimeRulerPopupMenu(Source).OnClick; + OnPopup := TcxSchedulerTimeRulerPopupMenu(Source).OnPopup; + end; +end; + +procedure TcxSchedulerTimeRulerPopupMenu.Execute( + AItem: TcxSchedulerTimeRulerPopupMenuItem); +begin + ExecuteCommand(Ord(AItem)); +end; + +function TcxSchedulerTimeRulerPopupMenu.GetMenuItem( + AItem: TcxSchedulerTimeRulerPopupMenuItem): TMenuItem; +begin + Result := FindItemByCommand(Root, Ord(AItem)); +end; + +procedure TcxSchedulerTimeRulerPopupMenu.CreateItems; + + function GetChecked(ACommand: Integer): Boolean; + var + AIndex: Integer; + begin + Result := False; + AIndex := ACommand - Ord(rpmi60min); + if (AIndex < 0) or (AIndex > 5) then Exit; + Result := DayView.TimeScale = RulerScales[AIndex]; + end; + + procedure CreateRulerItem(const ACaption: string; + AItem: TcxSchedulerTimeRulerPopupMenuItem); + var + ACommand: Integer; + begin + if AItem in Items then + begin + ACommand := Ord(AItem); + CreateSubItem(Root, ACaption, ACommand, -1, True, GetChecked(ACommand)); + end; + end; + +begin + CreateNewEventItems(rpmiNewEvent in FItems, rpmiNewAllDayEvent in FItems, + rpmiNewReccuringEvent in FItems, Ord(rpmiNewEvent), Ord(rpmiNewAllDayEvent), + Ord(rpmiNewReccuringEvent)); + if Items * [rpmi60min, rpmi30min, rpmi15min, rpmi10min, rpmi6min, rpmi5min] <> [] then + begin + AddValidSeparator(Root); + CreateRulerItem(cxGetResourceString(@scxpm60Minutes), rpmi60min); + CreateRulerItem(cxGetResourceString(@scxpm30Minutes), rpmi30min); + CreateRulerItem(cxGetResourceString(@scxpm15Minutes), rpmi15min); + CreateRulerItem(cxGetResourceString(@scxpm10Minutes), rpmi10min); + CreateRulerItem(cxGetResourceString(@scxpm6Minutes), rpmi6min); + CreateRulerItem(cxGetResourceString(@scxpm5Minutes), rpmi5min); + end; +end; + +procedure TcxSchedulerTimeRulerPopupMenu.DoExecute(ACommand: Integer); +var + AIndex: Integer; +begin + if ACommand in [Ord(rpmiNewEvent), Ord(rpmiNewAllDayEvent), Ord(rpmiNewReccuringEvent)] then + inherited DoExecute(ACommand) + else + begin + AIndex := ACommand - Ord(rpmi60min); + if AIndex in [0..5] then + DayView.TimeScale := RulerScales[AIndex]; + end; +end; + +function TcxSchedulerTimeRulerPopupMenu.DoOnClick( + ACommand: Integer): Boolean; +begin + Result := False; + if Assigned(FOnClick) then + FOnClick(Self, TcxSchedulerTimeRulerPopupMenuItem(ACommand), Result); +end; + +function TcxSchedulerTimeRulerPopupMenu.DoOnPopup: Boolean; +begin + Result := False; + if Assigned(FOnPopup) then + FOnPopup(Self, InternalMenu, Result); +end; + +function TcxSchedulerTimeRulerPopupMenu.IsValidCommand( + ACommand: Integer): Boolean; +begin + Result := (ACommand >= Ord(rpmiNewEvent)) and (ACommand <= Ord(rpmi5min)); +end; + +function TcxSchedulerTimeRulerPopupMenu.GetDayView: TcxSchedulerDayView; +begin + Result := Scheduler.CurrentView as TcxSchedulerDayView; +end; + +end. + diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerDialogs.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerDialogs.pas new file mode 100644 index 00000000..198ffcf7 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerDialogs.pas @@ -0,0 +1,424 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerDialogs; + +{$I cxVer.inc} + +interface + +uses + Classes, Controls, Forms, cxLookAndFeels, cxSchedulerStorage, + StdCtrls, cxSchedulerEventEditor, cxSchedulerRecurrenceEditor, + cxSchedulerCustomControls, cxSchedulerRecurrenceSelectionDialog, + cxSchedulerReminderWindow, cxDropDownEdit, cxSchedulerHolidays, + cxSchedulerHolidaysEditor, cxSchedulerHolidaysLocationHolidayEditor, + cxSchedulerHolidaysLocationEditor, cxSchedulerTaskDependencyEditor; + +// editors for scheduler events +function cxShowEventEditorEx(AEventInfo: TcxSchedulerEventEditInfo; + var AModified: Boolean): Boolean; + +function cxShowEventEditor(AEvent: TcxSchedulerControlEvent; + ALookAndFeel: TcxLookAndFeel; ARecurrence: Boolean; var AModified: Boolean; + AReadOnly: Boolean = False; AllowDelete: Boolean = True; + ARecurrenceButton: Boolean = True; + AOnDeleteFunc: TcxOnDeleteEventFunc = nil; + AForcePatternEditing: Boolean = False; + ABiasTime: TDateTime = 0; AShowResources: Boolean = False): Boolean; +function cxShowRecurrenceEditor(AEvent: TcxSchedulerControlEvent; + ALookAndFeel: TcxLookAndFeel; out AModified: Boolean; + AReadOnly: Boolean = False; AConfirmLossOfExceptions: Boolean = True; + AIsInternalActivation: Boolean = False): Boolean; + +procedure cxShowResourcesLayoutEditor(AStorage: TcxCustomSchedulerStorage; + ALookAndFeel: TcxLookAndFeel); +function cxShowRecurrenceSelectionDialog(AEvent: TcxSchedulerEvent; + AMode: TcxRecurrenceSelectionMode; ALookAndFeel: TcxLookAndFeel; + out AOccurrence: Boolean): Boolean; +function cxShowGoToDateDialog(AScheduler: TcxCustomScheduler; + ALookAndFeel: TcxLookAndFeel; var ADate: TDateTime; + out AViewMode: TcxSchedulerViewMode): Boolean; + +function cxGetLabelGrowDelta(ALabel: TLabel): Integer; +procedure cxComboBoxPopulateWithTimeIntervals(ACombo: TcxComboBox); +procedure cxComboBoxSetNearestTimeInterval(ACombo: TcxComboBox; AMinutes: Integer); +procedure cxComboBoxCaretToEnd(AComboBox: TcxComboBox); + +// Holidays Editors + +function cxShowHolidaysEditor(var AHolidays: TcxSchedulerHolidays; + ALookAndFeel: TcxLookAndFeel): Boolean; +function cxShowHolidaysLocationHolidayEditor(var ALocationHoliday: TcxSchedulerHolidaysLocationHoliday; + ALookAndFeel: TcxLookAndFeel): Boolean; +function cxShowHolidaysLocationEditor(var ALocation: TcxSchedulerHolidaysLocation; + ALookAndFeel: TcxLookAndFeel): Boolean; + +// TaskTaskDependencyEditor + +procedure cxShowTaskDependencyEditor(AItemLink: TcxSchedulerEventItemLink; ALookAndFeel: TcxLookAndFeel); + +const + cxEventEditorClass: TcxSchedulerEventEditorClass = TcxSchedulerEventEditor; + cxRecurrenceEventEditorClass: TcxSchedulerRecurrenceEventEditorClass = TcxSchedulerRecurrenceEventEditor; + cxReminderFormClass: TcxSchedulerReminderFormClass = TcxSchedulerReminderForm; + cxHolidayEditorClass: TcxSchedulerHolidaysEditorClass = TcxSchedulerHolidaysEditor; + cxTaskDependencyEditorClass: TcxSchedulerTaskDependencyEditorClass = TcxSchedulerTaskDependencyEditor; + + UseSchedulerColorInDialogs: Boolean = True; + +implementation + +uses + Windows, Messages, SysUtils, cxClasses, cxGraphics, cxControls, cxEdit, + cxButtons, cxRadioGroup, cxContainer, cxSchedulerResourcesLayoutEditor, + cxSchedulerGoToDateDialog, cxSchedulerUtils; + +type + TcxControlAccess = class(TcxControl); + TcxContainerAccess = class(TcxContainer); + TcxSchedulerHolidaysAccess = class(TcxSchedulerHolidays); + +function cxGetLabelGrowDelta(ALabel: TLabel): Integer; +var + R: TRect; +begin + with TcxScreenCanvas.Create do + try + R := cxEmptyRect; + R.Right := ALabel.Width; + Font.Assign(ALabel.Font); + TextExtent(ALabel.Caption, R, cxWordBreak); + finally + Free; + end; + Result := R.Bottom - ALabel.Height; + if Result < 0 then + Result := 0 + else + ALabel.Height := ALabel.Height + Result; +end; + +procedure cxComboBoxPopulateWithTimeIntervals(ACombo: TcxComboBox); +var + I: Integer; +begin + with ACombo.Properties.Items do + begin + BeginUpdate; + try + for I := Low(ComboBoxTimeIntervals) to High(ComboBoxTimeIntervals) do + AddObject(cxGetResourceString(ComboBoxTimeIntervals[I].P), TObject(ComboBoxTimeIntervals[I].M)); + finally + EndUpdate; + end; + end; +end; + +procedure cxComboBoxSetNearestTimeInterval(ACombo: TcxComboBox; AMinutes: Integer); + + function GetMinutes(I: Integer): Integer; + begin + Result := Integer(ACombo.Properties.Items.Objects[I]); + end; + +var + I, ACount, ADeltaPrev, ADelta: Integer; +begin + ADeltaPrev := Abs(GetMinutes(0) - AMinutes); + ACount := ACombo.Properties.Items.Count; + for I := 1 to ACount - 1 do + begin + ADelta := Abs(GetMinutes(I) - AMinutes); + if ADelta > ADeltaPrev then + begin + ACombo.SelectedItem := I - 1; + Exit; + end; + ADeltaPrev := ADelta; + end; + ACombo.SelectedItem := ACount - 1; +end; + +procedure cxComboBoxCaretToEnd(AComboBox: TcxComboBox); +begin + PostMessage(AComboBox.InnerControl.Handle, EM_SETSEL, 4096, 4096); +end; + +function IsStorageValid(AStorage: TcxCustomSchedulerStorage): Boolean; +begin + Result := (AStorage <> nil) and AStorage.IsActive; +end; + +function IsEventValid(AEvent: TcxSchedulerControlEvent): Boolean; +begin + Result := (AEvent <> nil) and IsStorageValid(AEvent.Storage); +end; + +// showing editor functions + +function cxShowEventEditorEx(AEventInfo: TcxSchedulerEventEditInfo; + var AModified: Boolean): Boolean; +var + AEditor: TcxSchedulerCustomEventEditor; + AEvent: TcxSchedulerControlEvent; + AOccurrence: Boolean; + APatternEvent: TcxSchedulerControlEvent; +begin + Result := False; + AEvent := AEventInfo.Event; + if not IsEventValid(AEvent) or (cxEventEditorClass = nil) then Exit; + if AEvent.IsRecurring and not AEventInfo.ForcePatternEditing then + begin + if not cxShowRecurrenceSelectionDialog(AEvent, rsmOpen, + AEventInfo.LookAndFeel, AOccurrence) then Exit; + AEventInfo.ForcePatternEditing := not AOccurrence; + end; + if AEventInfo.Recurrence and (AEvent.Source = nil) then + begin + AEvent.EventType := etPattern; + AEventInfo.ForcePatternEditing := True; + end; + if AEventInfo.ForcePatternEditing and (AEvent.Pattern <> nil) then + begin + APatternEvent := TcxSchedulerControlEvent.Create(AEvent.Pattern); + AEvent := APatternEvent; + end + else + APatternEvent := nil; + if AEvent.RecordIndex <> -1 then AEvent.BeginEditing; + AEditor := cxEventEditorClass.CreateEx(AEvent); + try + SetControlLookAndFeel(AEditor, AEventInfo.LookAndFeel); + AEditor.ShowResources := AEventInfo.ShowResources; + AEditor.ShowTaskComplete := AEventInfo.ShowTaskComplete; + AEditor.ForceSeries := AEventInfo.ForcePatternEditing; + AEditor.RecurrenceActivate := AEventInfo.Recurrence; + AEditor.Intersection := AEventInfo.Intersection; + AEditor.AllowDelete := AEventInfo.AllowDelete and (AEvent.Source <> nil); + AEditor.AllowHiddenEvents := AEventInfo.AllowHiddenEvents; + AEditor.AllowRecurrence := AEventInfo.RecurrenceButton and Assigned(cxRecurrenceEventEditorClass) and + AEvent.Storage.IsRecurrenceAvailable; + AEditor.ReadOnly := AEventInfo.ReadOnly; + AEditor.OnDeleteFunc := AEventInfo.OnDeleteFunc; + AEditor.BiasTime := AEventInfo.BiasTime; + Result := AEditor.ShowModal = mrOk; + AModified := AEditor.Modified; + finally + AEditor.Release; + APatternEvent.Free; + end; +end; + +function cxShowEventEditor(AEvent: TcxSchedulerControlEvent; + ALookAndFeel: TcxLookAndFeel; ARecurrence: Boolean; var AModified: Boolean; + AReadOnly: Boolean = False; AllowDelete: Boolean = True; + ARecurrenceButton: Boolean = True; AOnDeleteFunc: TcxOnDeleteEventFunc = nil; + AForcePatternEditing: Boolean = False; ABiasTime: TDateTime = 0; AShowResources: Boolean = False): Boolean; +var + AEventEditInfo: TcxSchedulerEventEditInfo; +begin + AEventEditInfo := TcxSchedulerEventEditInfo.Create; + try + AEventEditInfo.Event := AEvent; + AEventEditInfo.LookAndFeel := ALookAndFeel; + AEventEditInfo.Recurrence := ARecurrence; + AEventEditInfo.ReadOnly := AReadOnly; + AEventEditInfo.AllowDelete := AllowDelete; + AEventEditInfo.RecurrenceButton := ARecurrenceButton; + AEventEditInfo.OnDeleteFunc := AOnDeleteFunc; + AEventEditInfo.ForcePatternEditing := AForcePatternEditing; + AEventEditInfo.BiasTime := ABiasTime; + AEventEditInfo.ShowResources := AShowResources; + Result := cxShowEventEditorEx(AEventEditInfo, AModified); + finally + AEventEditInfo.Free; + end; +end; + +function cxShowRecurrenceEditor(AEvent: TcxSchedulerControlEvent; + ALookAndFeel: TcxLookAndFeel; out AModified: Boolean; + AReadOnly: Boolean = False; AConfirmLossOfExceptions: Boolean = True; + AIsInternalActivation: Boolean = False): Boolean; +var + AEditor: TcxSchedulerCustomRecurrenceEventEditor; +begin + Result := False; + if not IsEventValid(AEvent) or (cxRecurrenceEventEditorClass = nil) then Exit; + AEditor := cxRecurrenceEventEditorClass.CreateEx(AEvent); + try + SetControlLookAndFeel(AEditor, ALookAndFeel); + AEditor.IsInternalActivation := AIsInternalActivation; + AEditor.ReadOnly := AReadOnly; + AEditor.NeedCheckLossOfExceptions := AConfirmLossOfExceptions; + Result := AEditor.ShowModal = mrOk; + AModified := AEditor.Modified; + finally + AEditor.Release; + end; +end; + +procedure cxShowResourcesLayoutEditor(AStorage: TcxCustomSchedulerStorage; + ALookAndFeel: TcxLookAndFeel); +var + AEditor: TfmResourcesLayoutEditor; +begin + if not IsStorageValid(AStorage) or (AStorage.ResourceCount = 0) then Exit; + AEditor := TfmResourcesLayoutEditor.Create(nil); + try + SetControlLookAndFeel(AEditor, ALookAndFeel); + AEditor.Storage := AStorage; + AEditor.ShowModal; + finally + AEditor.Release; + end; +end; + +function cxShowRecurrenceSelectionDialog(AEvent: TcxSchedulerEvent; + AMode: TcxRecurrenceSelectionMode; ALookAndFeel: TcxLookAndFeel; + out AOccurrence: Boolean): Boolean; +var + ADialog: TfmRecurrenceSelectionForm; +begin + Result := False; + if AEvent = nil then Exit; + ADialog := TfmRecurrenceSelectionForm.CreateEx(AEvent, AMode); + try + SetControlLookAndFeel(ADialog, ALookAndFeel); + Result := ADialog.ShowModal = mrOk; + if Result then + AOccurrence := ADialog.rbOccurrence.Checked; + finally + ADialog.Free; + end; +end; + +function cxShowGoToDateDialog(AScheduler: TcxCustomScheduler; + ALookAndFeel: TcxLookAndFeel; var ADate: TDateTime; + out AViewMode: TcxSchedulerViewMode): Boolean; +var + ADialog: TfmGoToDateForm; +begin + ADialog := TfmGoToDateForm.CreateEx(AScheduler, ADate); + try + SetControlLookAndFeel(ADialog, ALookAndFeel); + Result := ADialog.ShowModal = mrOk; + AViewMode := ADialog.GetViewMode; + if Result then + ADate := ADialog.deDate.Date; + finally + ADialog.Free; + end; +end; + +// Holidays Editors + +function cxShowHolidaysEditor(var AHolidays: TcxSchedulerHolidays; + ALookAndFeel: TcxLookAndFeel): Boolean; +var + AEditor: TfmHolidaysEditor; +begin + AEditor := cxHolidayEditorClass.Create(nil); + try + SetControlLookAndFeel(AEditor, ALookAndFeel); + AEditor.Holidays := AHolidays; + AEditor.ShowModal; + Result := AEditor.Saved; + if Result then + TcxSchedulerHolidaysAccess(AHolidays).SendNotification; + finally + AEditor.Free; + end; +end; + +function cxShowHolidaysLocationHolidayEditor(var ALocationHoliday: TcxSchedulerHolidaysLocationHoliday; + ALookAndFeel: TcxLookAndFeel): Boolean; +var + AEditor: TfmHolidaysLocationHolidayEditor; +begin + AEditor := TfmHolidaysLocationHolidayEditor.Create(nil); + try + SetControlLookAndFeel(AEditor, ALookAndFeel); + AEditor.LocationHoliday := ALocationHoliday; + Result := AEditor.ShowModal = mrOk; + finally + AEditor.Free; + end; +end; + +function cxShowHolidaysLocationEditor(var ALocation: TcxSchedulerHolidaysLocation; + ALookAndFeel: TcxLookAndFeel): Boolean; +var + AEditor: TfmHolidaysLocationEditor; +begin + AEditor := TfmHolidaysLocationEditor.Create(nil); + try + SetControlLookAndFeel(AEditor, ALookAndFeel); + AEditor.Location := ALocation; + Result := AEditor.ShowModal = mrOk; + finally + AEditor.Free; + end; +end; + +procedure cxShowTaskDependencyEditor(AItemLink: TcxSchedulerEventItemLink; + ALookAndFeel: TcxLookAndFeel); +var + AEditor: TfmSchedulerTaskDependencyEditor; + AEvent: TcxSchedulerEvent; +begin + AEditor := cxTaskDependencyEditorClass.Create(nil); + try + SetControlLookAndFeel(AEditor, ALookAndFeel); + with AEditor do + begin + LinkRelation := AItemLink.Relation; + AEvent := AItemLink.Event; + EventFrom := AEvent; + EventTo := AItemLink.Link; + end; + if AEditor.ShowModal = mrOk then + if AEditor.IsDelete then + AItemLink.Free + else + begin + AItemLink.Relation := AEditor.LinkRelation; + AEvent.UpdateTaskLinks; + end; + finally + AEditor.Free; + end; +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerEventEditor.dfm b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerEventEditor.dfm new file mode 100644 index 00000000..20b55bb7 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerEventEditor.dfm @@ -0,0 +1,543 @@ +object cxSchedulerEventEditorForm: TcxSchedulerEventEditorForm + Left = 313 + Top = 267 + AutoScroll = False + ClientHeight = 415 + ClientWidth = 450 + Color = clBtnFace + Constraints.MinHeight = 410 + Constraints.MinWidth = 458 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + KeyPreview = True + OldCreateOrder = False + Position = poScreenCenter + OnActivate = FormActivate + OnCloseQuery = FormCloseQuery + OnKeyDown = FormKeyDown + PixelsPerInch = 96 + TextHeight = 13 + object pnlButtons: TPanel + Left = 0 + Top = 377 + Width = 450 + Height = 38 + Align = alBottom + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 0 + object pnlThreeButtons: TPanel + Left = 0 + Top = 0 + Width = 340 + Height = 38 + Align = alClient + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 0 + object btnOk: TcxButton + Left = 15 + Top = 7 + Width = 95 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object btnCancel: TcxButton + Left = 125 + Top = 7 + Width = 95 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + object btnDelete: TcxButton + Left = 235 + Top = 7 + Width = 95 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Delete' + TabOrder = 2 + OnClick = btnDeleteClick + end + end + object pnlRecurrence: TPanel + Left = 340 + Top = 0 + Width = 110 + Height = 38 + Align = alRight + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 1 + object btnRecurrence: TcxButton + Left = 5 + Top = 7 + Width = 95 + Height = 23 + Caption = '&Recurrence' + TabOrder = 0 + OnClick = btnRecurrenceClick + end + end + end + object pnlInformation: TPanel + Left = 0 + Top = 0 + Width = 450 + Height = 41 + Align = alTop + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 8 + object Bevel6: TBevel + Left = 11 + Top = 33 + Width = 429 + Height = 7 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object btnFindTime: TcxButton + Left = 320 + Top = 8 + Width = 120 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Find available time' + TabOrder = 0 + OnClick = btnFindTimeClick + end + object cxGroupBox1: TcxGroupBox + Left = 13 + Top = 8 + Alignment = alCenterCenter + Anchors = [akLeft, akTop, akRight] + ParentBackground = False + ParentColor = False + Style.Color = clInfoBk + Style.TransparentBorder = False + TabOrder = 1 + Height = 23 + Width = 298 + object lbInformation: TLabel + Left = 4 + Top = 4 + Width = 290 + Height = 15 + AutoSize = False + Caption = 'Conflicts with another event in your schedule.' + end + end + end + object pnlCaption: TPanel + Left = 0 + Top = 41 + Width = 450 + Height = 65 + Align = alTop + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 1 + object lbSubject: TLabel + Left = 16 + Top = 13 + Width = 40 + Height = 13 + Caption = 'Subject:' + FocusControl = teSubject + end + object lbLocation: TLabel + Left = 16 + Top = 38 + Width = 44 + Height = 13 + Caption = 'Location:' + FocusControl = teLocation + end + object lbLabel: TLabel + Left = 239 + Top = 38 + Width = 29 + Height = 13 + Anchors = [akTop, akRight] + Caption = 'La&bel:' + FocusControl = icbLabel + end + object teSubject: TcxTextEdit + Left = 72 + Top = 9 + Anchors = [akLeft, akTop, akRight] + Properties.OnChange = OnChanged + TabOrder = 0 + Width = 369 + end + object teLocation: TcxTextEdit + Left = 72 + Top = 34 + Anchors = [akLeft, akTop, akRight] + Properties.OnChange = OnChanged + TabOrder = 1 + Width = 145 + end + object icbLabel: TcxImageComboBox + Left = 272 + Top = 34 + Anchors = [akTop, akRight] + Properties.Items = <> + Properties.OnChange = OnChanged + TabOrder = 2 + Width = 169 + end + end + object pnlTime: TPanel + Left = 0 + Top = 106 + Width = 450 + Height = 67 + Align = alTop + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 2 + object Bevel4: TBevel + Left = 11 + Top = 0 + Width = 429 + Height = 8 + Anchors = [akLeft, akTop, akRight] + Shape = bsTopLine + end + object lbStartTime: TLabel + Left = 16 + Top = 15 + Width = 51 + Height = 13 + Caption = 'Start time:' + FocusControl = deStart + end + object lbEndTime: TLabel + Left = 16 + Top = 40 + Width = 45 + Height = 13 + Caption = 'End time:' + FocusControl = deEnd + end + object deStart: TcxDateEdit + Left = 96 + Top = 11 + Properties.DateButtons = [btnToday] + Properties.InputKind = ikStandard + Properties.OnChange = OnChanged + Properties.OnEditValueChanged = StartDateChanged + TabOrder = 0 + Width = 121 + end + object teStart: TcxTimeEdit + Left = 224 + Top = 11 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = OnEventTimeChanged + TabOrder = 1 + Width = 78 + end + object deEnd: TcxDateEdit + Left = 96 + Top = 36 + Properties.DateButtons = [btnToday] + Properties.InputKind = ikStandard + Properties.OnChange = OnChanged + TabOrder = 2 + Width = 121 + end + object teEnd: TcxTimeEdit + Left = 224 + Top = 36 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = OnEventTimeChanged + TabOrder = 3 + Width = 78 + end + object cbAllDayEvent: TcxCheckBox + Left = 320 + Top = 12 + Caption = 'All day event' + Properties.OnChange = cbAllDayEventPropertiesChange + TabOrder = 4 + Width = 121 + end + end + object pnlRecurrenceInfo: TPanel + Left = 0 + Top = 213 + Width = 450 + Height = 40 + Align = alTop + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 4 + object Bevel7: TBevel + Left = 11 + Top = 0 + Width = 429 + Height = 8 + Anchors = [akLeft, akTop, akRight] + Shape = bsTopLine + end + object lbRecurrence: TLabel + Left = 16 + Top = 15 + Width = 59 + Height = 13 + Caption = 'Recurrence:' + end + object lbRecurrencePattern: TLabel + Left = 88 + Top = 16 + Width = 353 + Height = 13 + Anchors = [akLeft, akTop, akRight] + AutoSize = False + Caption = 'PatternInfo' + WordWrap = True + end + end + object pnlPlaceHolder: TPanel + Left = 0 + Top = 296 + Width = 450 + Height = 43 + Align = alTop + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 6 + object pnlReminder: TPanel + Left = 0 + Top = 4 + Width = 224 + Height = 39 + Align = alLeft + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 0 + object cbReminder: TcxCheckBox + Left = 11 + Top = 9 + Caption = 'Reminder:' + Properties.OnChange = OnChanged + State = cbsChecked + TabOrder = 0 + OnClick = cbReminderClick + Width = 81 + end + object cbReminderMinutesBeforeStart: TcxComboBox + Left = 96 + Top = 8 + Properties.ImmediateDropDown = False + Properties.ImmediatePost = True + Properties.IncrementalSearch = False + Properties.OnChange = OnChanged + Properties.OnPopup = cbReminderMinutesBeforeStartPropertiesPopup + Properties.OnValidate = cbReminderMinutesBeforeStartPropertiesValidate + TabOrder = 1 + Width = 121 + end + end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 450 + Height = 4 + Align = alTop + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 1 + object Bevel3: TBevel + Left = 11 + Top = 0 + Width = 439 + Height = 4 + Anchors = [akLeft, akTop, akRight] + Shape = bsTopLine + end + end + object pnlShowTimeAs: TPanel + Left = 224 + Top = 4 + Width = 281 + Height = 39 + Align = alLeft + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 2 + object lbShowTimeAs: TLabel + Left = 16 + Top = 12 + Width = 67 + Height = 13 + Caption = 'Show time as:' + FocusControl = icbShowTimeAs + end + object icbShowTimeAs: TcxImageComboBox + Left = 96 + Top = 8 + Properties.Items = <> + Properties.OnChange = OnEventTimeChanged + TabOrder = 0 + Width = 121 + end + end + end + object pnlMessage: TPanel + Left = 0 + Top = 339 + Width = 450 + Height = 38 + Align = alClient + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 7 + object Bevel2: TBevel + Left = 11 + Top = 0 + Width = 429 + Height = 9 + Anchors = [akLeft, akTop, akRight] + Shape = bsTopLine + end + object Bevel1: TBevel + Left = 11 + Top = 30 + Width = 429 + Height = 7 + Anchors = [akLeft, akRight, akBottom] + Shape = bsBottomLine + end + object meMessage: TcxMemo + Left = 10 + Top = 12 + Anchors = [akLeft, akTop, akRight, akBottom] + Properties.OnChange = OnChanged + TabOrder = 0 + Height = 12 + Width = 431 + end + end + object pnlResource: TPanel + Left = 0 + Top = 253 + Width = 450 + Height = 43 + Align = alTop + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 5 + object lbResource: TLabel + Left = 16 + Top = 17 + Width = 62 + Height = 13 + Caption = 'Resource(s):' + end + object Bevel5: TBevel + Left = 11 + Top = -4 + Width = 429 + Height = 7 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object cbResources: TcxCheckComboBox + Left = 96 + Top = 13 + Anchors = [akLeft, akTop, akRight] + Properties.DropDownAutoWidth = False + Properties.EditValueFormat = cvfIndices + Properties.Items = <> + Properties.OnChange = OnResourceIDChanged + TabOrder = 0 + Width = 346 + end + end + object pnlTaskComplete: TPanel + Left = 0 + Top = 173 + Width = 450 + Height = 40 + Align = alTop + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 3 + object Bevel8: TBevel + Left = 11 + Top = 0 + Width = 429 + Height = 8 + Anchors = [akLeft, akTop, akRight] + Shape = bsTopLine + end + object lbTaskComplete: TLabel + Left = 16 + Top = 15 + Width = 72 + Height = 13 + Caption = 'Task complete:' + FocusControl = seTaskComplete + end + object lbTaskStatus: TLabel + Left = 240 + Top = 15 + Width = 59 + Height = 13 + Caption = 'Task status:' + FocusControl = cbxTaskStatus + end + object seTaskComplete: TcxSpinEdit + Left = 96 + Top = 11 + Properties.AssignedValues.EditFormat = True + Properties.AssignedValues.MinValue = True + Properties.Increment = 25.000000000000000000 + Properties.LargeIncrement = 25.000000000000000000 + Properties.MaxValue = 100.000000000000000000 + Properties.OnChange = seTaskCompleteChange + Properties.OnEditValueChanged = seTaskCompleteChange + TabOrder = 0 + Width = 121 + end + object cbxTaskStatus: TcxComboBox + Left = 320 + Top = 11 + Properties.DropDownListStyle = lsFixedList + Properties.OnChange = cbxTaskStatusChange + Properties.OnEditValueChanged = cbxTaskStatusChange + TabOrder = 1 + Width = 121 + end + end +end diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerEventEditor.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerEventEditor.pas new file mode 100644 index 00000000..2451b898 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerEventEditor.pas @@ -0,0 +1,1199 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerEventEditor; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls, cxTextEdit, cxMemo, cxImageComboBox, cxCalendar, + cxTimeEdit, cxLookAndFeelPainters, cxDropDownEdit, cxCheckBox, + cxSpinEdit, cxMaskEdit, cxControls, cxContainer, cxEdit, cxButtons, + cxSchedulerStorage, cxLookAndFeels, cxSchedulerCustomControls, + cxCheckComboBox, cxGroupBox, Menus, cxGraphics; + +type + + { TcxSchedulerCustomEditorForm } + + TcxSchedulerCustomEditorForm = class(TForm) + private + FEvent: TcxSchedulerControlEvent; + FIsInternalActivation: Boolean; + FReadOnly: Boolean; + function GetStorage: TcxCustomSchedulerStorage; + protected + FModified: Boolean; + FIsCreation: Boolean; + procedure ApplyChanges; virtual; + function GetFormColor: TColor; virtual; + procedure InitializeControls; virtual; + procedure LoadEventValuesIntoControls; virtual; + procedure LoadValuesIntoTimeControls(const AStart, AFinish: TDateTime; AllDayEvent: Boolean); virtual; + + procedure SetReadOnly(AValue: Boolean); virtual; + procedure UpdateEventValuesFromControls; virtual; + + property Storage: TcxCustomSchedulerStorage read GetStorage; + public + constructor CreateEx(AEvent: TcxSchedulerControlEvent); virtual; + function ShowModal: Integer; override; + + property Event: TcxSchedulerControlEvent read FEvent; + property IsInternalActivation: Boolean read FIsInternalActivation write FIsInternalActivation; + property Modified: Boolean read FModified; + property ReadOnly: Boolean read FReadOnly write SetReadOnly; + end; + + { TcxSchedulerCustomEventEditor } + + TcxSchedulerCustomEventEditor = class(TcxSchedulerCustomEditorForm) + private + FAllowDelete: Boolean; + FAllowHiddenEvents: Boolean; + FAllowRecurrence: Boolean; + FBiasTime: TDateTime; + FDeleteSeries: Boolean; + FDeleteExceptions: Boolean; + FForceSeries: Boolean; + FHasStorageEvent: Boolean; + FIntersection: Boolean; + FRecurrenceActivate: Boolean; + FPatternStart: TDateTime; + FPatternFinish: TDateTime; + FRecurrenceInfo: TcxSchedulerEventRecurrenceInfo; + FSavedFinish: TDateTime; + FSavedResourceID: Variant; + FSavedStart: TDateTime; + FSavedState: Integer; + FSetTimeRef: Integer; + FShowResources: Boolean; + FShowTaskComplete: Boolean; + FOnDeleteFunc: TcxOnDeleteEventFunc; + protected + function CheckIntersection: Boolean; virtual; + procedure DeleteEvent; virtual; + function FindAvailableTime: Boolean; virtual; + procedure GetEditingEventTime(var AStart, AFinish: TDateTime; var AState: Integer); virtual; abstract; + function GetResourcesPanelVisible: Boolean; virtual; + procedure PostEvent; virtual; + procedure SaveChanges; virtual; + procedure SaveResourceID; virtual; + procedure SetAllowDelete(AValue: Boolean); virtual; + procedure SetAllowRecurrence(AValue: Boolean); virtual; + procedure SetIntersection(AValue: Boolean); virtual; + // + procedure ApplyEventTime; + procedure RestoreEventTime; + procedure SetEventTime; + + property DeleteExceptions: Boolean read FDeleteExceptions write FDeleteExceptions; + property DeleteSeries: Boolean read FDeleteSeries write FDeleteSeries; + property HasStorageEvent: Boolean read FHasStorageEvent; + property Storage; + property PatternStart: TDateTime read FPatternStart; + property PatternFinish: TDateTime read FPatternFinish; + property RecurrenceInfo: TcxSchedulerEventRecurrenceInfo read FRecurrenceInfo; + public + constructor CreateEx(AEvent: TcxSchedulerControlEvent); override; + destructor Destroy; override; + + property AllowDelete: Boolean read FAllowDelete write SetAllowDelete; + property AllowHiddenEvents: Boolean read FAllowHiddenEvents write FAllowHiddenEvents; + property AllowRecurrence: Boolean read FAllowRecurrence write SetAllowRecurrence; + property BiasTime: TDateTime read FBiasTime write FBiasTime; + property Event; + property ForceSeries: Boolean read FForceSeries write FForceSeries; + property Intersection: Boolean read FIntersection write SetIntersection; + property Modified: Boolean read FModified; + property RecurrenceActivate: Boolean read FRecurrenceActivate write FRecurrenceActivate; + property ReadOnly; + property ShowResources: Boolean read FShowResources write FShowResources; + property ShowTaskComplete: Boolean read FShowTaskComplete write FShowTaskComplete; + property OnDeleteFunc: TcxOnDeleteEventFunc read FOnDeleteFunc write FOnDeleteFunc; + end; + + { TcxSchedulerEventEditorForm } + + TcxSchedulerEventEditorForm = class(TcxSchedulerCustomEventEditor) + Bevel1: TBevel; + Bevel5: TBevel; + Bevel6: TBevel; + btnCancel: TcxButton; + btnDelete: TcxButton; + btnOk: TcxButton; + btnRecurrence: TcxButton; + cbAllDayEvent: TcxCheckBox; + cbReminder: TcxCheckBox; + cbReminderMinutesBeforeStart: TcxComboBox; + cbResources: TcxCheckComboBox; + btnFindTime: TcxButton; + cxGroupBox1: TcxGroupBox; + deEnd: TcxDateEdit; + deStart: TcxDateEdit; + icbLabel: TcxImageComboBox; + icbShowTimeAs: TcxImageComboBox; + lbEndTime: TLabel; + lbInformation: TLabel; + lbLabel: TLabel; + lbLocation: TLabel; + lbResource: TLabel; + lbShowTimeAs: TLabel; + lbStartTime: TLabel; + lbSubject: TLabel; + meMessage: TcxMemo; + pnlButtons: TPanel; + pnlCaption: TPanel; + pnlInformation: TPanel; + pnlMessage: TPanel; + pnlRecurrence: TPanel; + pnlPlaceHolder: TPanel; + pnlResource: TPanel; + pnlThreeButtons: TPanel; + pnlTime: TPanel; + teEnd: TcxTimeEdit; + teLocation: TcxTextEdit; + teStart: TcxTimeEdit; + teSubject: TcxTextEdit; + pnlReminder: TPanel; + Panel1: TPanel; + pnlShowTimeAs: TPanel; + pnlRecurrenceInfo: TPanel; + Bevel7: TBevel; + lbRecurrence: TLabel; + lbRecurrencePattern: TLabel; + pnlTaskComplete: TPanel; + Bevel8: TBevel; + lbTaskComplete: TLabel; + seTaskComplete: TcxSpinEdit; + cbxTaskStatus: TcxComboBox; + lbTaskStatus: TLabel; + procedure OnChanged(Sender: TObject); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + procedure FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure FormActivate(Sender: TObject); + procedure cbAllDayEventPropertiesChange(Sender: TObject); + procedure StartDateChanged(Sender: TObject); + procedure cbReminderClick(Sender: TObject); + procedure cbReminderMinutesBeforeStartPropertiesValidate( + Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; + var Error: Boolean); + procedure cbReminderMinutesBeforeStartPropertiesPopup(Sender: TObject); + procedure OnEventTimeChanged(Sender: TObject); + procedure btnRecurrenceClick(Sender: TObject); + procedure OnResourceIDChanged(Sender: TObject); + procedure btnFindTimeClick(Sender: TObject); + procedure btnDeleteClick(Sender: TObject); + procedure seTaskCompleteChange(Sender: TObject); + procedure cbxTaskStatusChange(Sender: TObject); + private + FNeedCheckLossOfExceptions: Boolean; + FRecurrenceInfoHeight: Integer; + function GetEventName: string; + protected + FDuration: TDateTime; + FIsUpdating: Boolean; + procedure ApplyChanges; override; + function CheckIntersection: Boolean; override; + function CheckTimeRange(var AStart, AFinish: TDateTime): Boolean; virtual; + procedure CheckVisible; virtual; + procedure ClearModifiedFlag; virtual; + procedure GetEditingEventTime(var AStart, AFinish: TDateTime; var AState: Integer); override; + function GetFormColor: TColor; override; + function GetRecurrenceDescription: string; virtual; + procedure InitializeControls; override; + procedure InitLabelColor; + procedure InitReminderPanel; + procedure InitResources; + procedure InitShowTimeAsPanel; + procedure InitTaskCompletePanel; + procedure LoadEventValuesIntoControls; override; + procedure LoadValuesIntoTimeControls(const AStart, AFinish: TDateTime; AllDayEvent: Boolean); override; + function IsValid: Boolean; virtual; + procedure RefreshRecurrenceInfo; virtual; + procedure SaveResourceID; override; + procedure SetActiveControl; virtual; + procedure SetAllowDelete(AValue: Boolean); override; + procedure SetAllowRecurrence(AValue: Boolean); override; + procedure SetCaptions; virtual; + procedure SetReadOnly(AValue: Boolean); override; + procedure SetReminderMinutesBeforeStart; virtual; + procedure UpdateEventValuesFromControls; override; + public + constructor CreateEx(AEvent: TcxSchedulerControlEvent); override; + function ShowModal: Integer; override; + + property AllowDelete; + property AllowRecurrence; + property BiasTime; + property Event; + property EventName: string read GetEventName; + property ForceSeries; + property Modified; + property RecurrenceActivate; + property ReadOnly; + property OnDeleteFunc; + end; + + TcxSchedulerEventEditor = TcxSchedulerEventEditorForm; //workaround for Delphi 2005 + + TcxSchedulerEventEditorClass = class of TcxSchedulerCustomEventEditor; + +implementation + +uses + cxClasses, cxSchedulerStrs, cxSchedulerUtils, cxSchedulerDialogs, Variants, + DateUtils, cxDateUtils, cxVariants, cxSchedulerRecurrenceSelectionDialog, Math; + +{$R *.dfm} + +{ TcxSchedulerCustomEditorForm } + +constructor TcxSchedulerCustomEditorForm.CreateEx( + AEvent: TcxSchedulerControlEvent); +begin + inherited Create(nil); + FIsCreation := True; + FEvent := AEvent; + InitializeControls; + LoadEventValuesIntoControls; + FModified := False; + FIsCreation := False; +end; + +procedure TcxSchedulerCustomEditorForm.ApplyChanges; +begin +end; + +function TcxSchedulerCustomEditorForm.GetFormColor: TColor; +begin + Result := clBtnFace; +end; + +function TcxSchedulerCustomEditorForm.GetStorage: TcxCustomSchedulerStorage; +begin + Result := Event.Storage; +end; + +procedure TcxSchedulerCustomEditorForm.InitializeControls; +begin +end; + +procedure TcxSchedulerCustomEditorForm.LoadEventValuesIntoControls; +begin +end; + +procedure TcxSchedulerCustomEditorForm.LoadValuesIntoTimeControls( + const AStart, AFinish: TDateTime; AllDayEvent: Boolean); +begin +end; + +procedure TcxSchedulerCustomEditorForm.SetReadOnly(AValue: Boolean); +begin + FReadOnly := AValue; +end; + +function TcxSchedulerCustomEditorForm.ShowModal: Integer; +begin + if UseSchedulerColorInDialogs then + Color := GetFormColor; + cxDialogsMetricsStore.InitDialog(Self); + Result := inherited ShowModal; + cxDialogsMetricsStore.StoreMetrics(Self); + ApplyChanges; +end; + +procedure TcxSchedulerCustomEditorForm.UpdateEventValuesFromControls; +begin +end; + +{ TcxSchedulerCustomEventEditor } + +constructor TcxSchedulerCustomEventEditor.CreateEx( + AEvent: TcxSchedulerControlEvent); +begin + FIntersection := True; + inherited CreateEx(AEvent); + FHasStorageEvent := not ((AEvent.Source = nil) or (AEvent.EventType = etOccurrence)); + FRecurrenceInfo := TcxSchedulerEventRecurrenceInfo.Create(AEvent); + if Event.Pattern <> nil then + begin + FPatternStart := Event.Pattern.Start; + FPatternFinish := Event.Pattern.Finish; + FRecurrenceInfo.Assign(Event.Pattern.RecurrenceInfo); + end + else + begin + FPatternStart := Event.Start; + FPatternFinish := Event.Finish; + FRecurrenceInfo.Assign(Event.RecurrenceInfo); + end; +end; + +destructor TcxSchedulerCustomEventEditor.Destroy; +begin + FRecurrenceInfo.Free; + inherited Destroy; +end; + +function TcxSchedulerCustomEventEditor.CheckIntersection: Boolean; +begin + Result := Intersection; + if not Result then + begin + SetEventTime; + try + Event.SkipExceptions := FDeleteExceptions; + Result := not Event.Conflicts(AllowHiddenEvents) + finally + RestoreEventTime; + end; + end; +end; + +procedure TcxSchedulerCustomEventEditor.DeleteEvent; +begin + if FDeleteSeries then + Event.Pattern.Delete + else + Event.Delete; +end; + +function TcxSchedulerCustomEventEditor.FindAvailableTime: Boolean; +var + AStart, AFinish: TDateTime; +begin + SetEventTime; + try + Result := Storage.FindAvailableTime(Event, AllowHiddenEvents, AStart, AFinish); + if Result then + LoadValuesIntoTimeControls(AStart, AFinish, Event.AllDayEvent); + finally + RestoreEventTime; + end; + if Result and (Event.EventType = etPattern) then + ApplyEventTime; +end; + +function TcxSchedulerCustomEventEditor.GetResourcesPanelVisible: Boolean; +begin + Result := FShowResources; +end; + +procedure TcxSchedulerCustomEventEditor.PostEvent; + + function GetStorageEvent: TcxSchedulerEvent; + begin + if not FHasStorageEvent then + Result := Storage.CreateEvent + else + Result := Event.Source; + end; + + procedure CheckDeleteException; + begin + if FDeleteExceptions and (Event.Pattern <> nil) then + Event.Pattern.DeleteExceptions; + end; + + function ChangeType(ADest, ASource: TcxSchedulerEvent; AType: TcxEventType; + AEndEditing: Boolean = True): TcxSchedulerEvent; + begin + Result := ADest; + Result.BeginEditing; + if ASource <> nil then + Result.Assign(ASource); + Result.EventType := AType; + if AEndEditing then + Result.EndEditing; + end; + +begin + CheckDeleteException; + if not FModified and (Event.Source <> nil) then + begin + Event.Start := Event.Start - BiasTime; + Event.Finish := Event.Finish - BiasTime; + Exit; + end; + if Event.IsRecurring then + begin + if ForceSeries then + begin + if Event.Pattern <> nil then + ChangeType(Event.Pattern, Event, etPattern) + else + ChangeType(GetStorageEvent, Event, etPattern); + end + else + with ChangeType(GetStorageEvent, Event, etCustom, False) do + try + ParentID := Event.Pattern.ID; + finally + EndEditing; + end; + end + else + if Event.Pattern <> nil then + ChangeType(Event.Pattern, Event, Event.EventType) + else + ChangeType(GetStorageEvent, Event, etNone); +end; + +procedure TcxSchedulerCustomEventEditor.SaveChanges; +var + AStorage: TcxCustomSchedulerStorage; +begin +// if not Modified and (Event.Source <> nil) then Exit; + AStorage := Storage; + AStorage.BeginUpdate; + try + UpdateEventValuesFromControls; + Event.UpdateTaskTime; + PostEvent; + finally + AStorage.EndUpdate; + end; +end; + +procedure TcxSchedulerCustomEventEditor.SaveResourceID; +begin +end; + +procedure TcxSchedulerCustomEventEditor.SetAllowDelete( + AValue: Boolean); +begin + FAllowDelete := AValue; +end; + +procedure TcxSchedulerCustomEventEditor.SetAllowRecurrence( + AValue: Boolean); +begin + FAllowRecurrence := AValue; +end; + +procedure TcxSchedulerCustomEventEditor.SetIntersection(AValue: Boolean); +begin + if AValue <> FIntersection then + begin + FIntersection := AValue; + CheckIntersection; + end; +end; + +procedure TcxSchedulerCustomEventEditor.ApplyEventTime; +var + AStart, AFinish: TDateTime; + AState: Integer; +begin + GetEditingEventTime(AStart, AFinish, AState); + Event.State := AState; + Event.Start := AStart; + Event.Finish := AFinish; + if ShowResources then + SaveResourceID; +end; + +procedure TcxSchedulerCustomEventEditor.RestoreEventTime; +begin + Dec(FSetTimeRef); + if FSetTimeRef = 0 then + begin + Event.State := FSavedState; + Event.Start := FSavedStart; + Event.Finish := FSavedFinish; + Event.ResourceID := FSavedResourceID; + end; +end; + +procedure TcxSchedulerCustomEventEditor.SetEventTime; +begin + Inc(FSetTimeRef); + if FSetTimeRef = 1 then + begin + FSavedState := Event.State; + FSavedStart := Event.Start; + FSavedFinish := Event.Finish; + FSavedResourceID := Event.ResourceID; + ApplyEventTime; + end; +end; + +{ TcxSchedulerEventEditor } + +constructor TcxSchedulerEventEditorForm.CreateEx(AEvent: TcxSchedulerControlEvent); +begin + inherited CreateEx(AEvent); + FNeedCheckLossOfExceptions := (AEvent.Pattern <> nil) and AEvent.Pattern.HasExceptions; + FDuration := AEvent.Duration; + pnlInformation.Visible := False; + ClearModifiedFlag; +end; + +function TcxSchedulerEventEditorForm.ShowModal: Integer; +begin + FRecurrenceInfoHeight := pnlRecurrenceInfo.Height; + CheckVisible; + SetActiveControl; + Result := inherited ShowModal; +end; + +procedure TcxSchedulerEventEditorForm.SaveResourceID; +var + I: Integer; +begin + Event.ResourceID := Null; + for I := 0 to cbResources.Properties.Items.Count - 1 do + if cbResources.States[I] = cbsChecked then + Event.ShareWithResource(Storage.ResourceIDs[cbResources.Properties.Items[I].Tag]); +end; + +procedure TcxSchedulerEventEditorForm.SetActiveControl; +begin + if (Event.Source = nil) and teSubject.CanFocus then + ActiveControl := teSubject + else + if meMessage.CanFocus then + ActiveControl := meMessage + else + if deStart.CanFocus then + ActiveControl := deStart; +end; + +procedure TcxSchedulerEventEditorForm.SetAllowDelete(AValue: Boolean); +begin + inherited; + btnDelete.Enabled := AValue; +end; + +procedure TcxSchedulerEventEditorForm.SetAllowRecurrence(AValue: Boolean); +begin + inherited; + pnlRecurrence.Visible := AValue; +end; + +procedure TcxSchedulerEventEditorForm.ApplyChanges; +begin + case ModalResult of + mrAbort: + DeleteEvent; + mrOk: + SaveChanges; + mrCancel: + begin + Event.Cancel; + FModified := False; + Storage.FullRefresh; + end; + end; +end; + +function TcxSchedulerEventEditorForm.CheckIntersection: Boolean; +begin + Result := inherited CheckIntersection; + pnlInformation.Visible := not Result; + btnOk.Enabled := Result; +end; + +function TcxSchedulerEventEditorForm.CheckTimeRange(var AStart, AFinish: TDateTime): Boolean; +var + AEventStart, AEventFinish: TDateTime; +begin + Event.GetValidTaskTimeRange(AStart, AFinish); + AEventStart := deStart.Date + teStart.Time; + AEventFinish := deEnd.Date + teEnd.Time; + Result := (AStart <= AEventStart) and (AFinish >= AEventFinish); +end; + +procedure TcxSchedulerEventEditorForm.CheckVisible; +var + ATimeVisible: Boolean; +begin + if FIsCreation then Exit; + pnlTaskComplete.Visible := ShowTaskComplete; + pnlResource.Visible := GetResourcesPanelVisible; + ATimeVisible := (Event.EventType = etNone) or + ((Event.EventType in [etOccurrence, etCustom]) and not ForceSeries); + if ATimeVisible then + begin + pnlTime.Visible := True; + pnlRecurrenceInfo.Visible := False; + end + else + if Assigned(cxGetRecurrenceDescriptionStringProc) then + begin + RefreshRecurrenceInfo; + pnlRecurrenceInfo.Visible := True; + pnlTime.Visible := False; + end; + teStart.Time := TimeOf(Event.Start); + teEnd.Time := TimeOf(Event.Finish); + teStart.Visible := not cbAllDayEvent.Checked; + teEnd.Visible := not cbAllDayEvent.Checked; + CheckIntersection; +end; + +procedure TcxSchedulerEventEditorForm.ClearModifiedFlag; + + procedure CheckComponent(AComponent: TComponent); + begin + if AComponent is TcxCustomEdit then + TcxCustomEdit(AComponent).EditModified := False; + end; + +var + I: Integer; +begin + for I := 0 to ComponentCount - 1 do + CheckComponent(Components[I]); + FModified := False; +end; + +procedure TcxSchedulerEventEditorForm.GetEditingEventTime( + var AStart, AFinish: TDateTime; var AState: Integer); +begin + AStart := deStart.Date + teStart.Time + BiasTime; + AFinish := deEnd.Date + teEnd.Time + Ord(cbAllDayEvent.Checked) + BiasTime; + AState := icbShowTimeAs.ItemIndex; +end; + +function TcxSchedulerEventEditorForm.GetFormColor: TColor; +begin + Result := teLocation.Style.LookAndFeel.Painter.DefaultSchedulerControlColor; +end; + +function TcxSchedulerEventEditorForm.GetRecurrenceDescription: string; +begin + Result := cxGetRecurrenceDescriptionStringProc(Event.RecurrenceInfo, True); +end; + +procedure TcxSchedulerEventEditorForm.InitializeControls; +begin + InitReminderPanel; + InitShowTimeAsPanel; + InitLabelColor; + InitTaskCompletePanel; + SetCaptions; + teStart.Properties.Use24HourFormat := Is24HourTimeFormat; + teEnd.Properties.Use24HourFormat := Is24HourTimeFormat; +end; + +procedure TcxSchedulerEventEditorForm.InitReminderPanel; +begin + pnlReminder.Visible := Storage.IsReminderAvailable and Storage.Reminders.Active; + if pnlReminder.Visible then + cxComboBoxPopulateWithTimeIntervals(cbReminderMinutesBeforeStart); +end; + +procedure TcxSchedulerEventEditorForm.InitResources; +var + I, J, AResourceIndex: Integer; + AResource: TcxSchedulerStorageResourceItem; +begin + AResourceIndex := -1; + with cbResources.Properties.Items do + begin + BeginUpdate; + Clear; + J := 0; + for I := 0 to Storage.ResourceCount - 1 do + begin + AResource := Storage.Resources.ResourceItems[I]; + if VarIsNull(AResource.ResourceID) or VarIsEmpty(AResource.ResourceID) then + Continue; + if (not AResource.Visible or AResource.ReadOnly) and + not Event.IsSharedWithResource(AResource) then + Continue; + with TcxCheckComboBoxItem(Add) do + begin + Description := AResource.DisplayName; + Enabled := not AResource.ReadOnly; + Tag := I; + end; + cbResources.States[J] := TcxCheckBoxState( + Event.IsSharedWithResource(AResource.ResourceID)); + Inc(J); + end; + EndUpdate; + end; + cbResources.ItemIndex := AResourceIndex; +end; + +procedure TcxSchedulerEventEditorForm.InitShowTimeAsPanel; +const + ATimeTypes: array[0..3] of Pointer = (@scxFree, @scxTentative, @scxBusy, + @scxOutOfOffice); +var + I: Integer; + AItem: TcxImageComboboxItem; +begin + for I := 0 to 3 do + begin + AItem := TcxImageComboboxItem(icbShowTimeAs.Properties.Items.Add); + AItem.Description := cxGetResourceString(ATimeTypes[I]); + AItem.ImageIndex := I; + AItem.Value := I; + end; + icbShowTimeAs.Properties.Images := TimeLinePatterns; +end; + +procedure TcxSchedulerEventEditorForm.InitTaskCompletePanel; +var + AStatus: TcxSchedulerEventTaskStatus; +begin + if pnlTaskComplete.Visible then + seTaskComplete.Value := Event.TaskComplete; + with cbxTaskStatus.Properties do + begin + BeginUpdate; + try + Items.Clear; + for AStatus := tsNotStarted to tsDeferred do + Items.Add(cxGetResourceString(sEventTaskStatus[Integer(AStatus)])); + finally + EndUpdate(True); + cbxTaskStatus.ItemIndex := Integer(Event.TaskStatus); + end; + end; +end; + +function TcxSchedulerEventEditorForm.IsValid: Boolean; +var + AStart, AFinish: TDateTime; +begin + Result := not (DateTimeHelper.RoundTime(deStart.Date + teStart.Time) > + DateTimeHelper.RoundTime(deEnd.Date + teEnd.Time)); + if not Result then + begin + MessageDlg(cxGetResourceString(@scxWrongTimeBounds), mtWarning, [mbOk], 0); + if deEnd.CanFocusEx then + ActiveControl := deEnd; + end + else + begin + Result := CheckTimeRange(AStart, AFinish); + if not Result then + MessageDlg(Format(cxGetResourceString(@scxTaskWrongTimeBounds), + [cxDateTimeToText(AStart), cxDateTimeToText(AFinish)]), mtWarning, [mbOk], 0); + if deStart.CanFocusEx then + ActiveControl := deStart; + end; +end; + +procedure TcxSchedulerEventEditorForm.RefreshRecurrenceInfo; +var + ADelta: Integer; +begin + if Assigned(cxGetRecurrenceDescriptionStringProc) then + begin + lbRecurrencePattern.Caption := GetRecurrenceDescription; + ADelta := cxGetLabelGrowDelta(lbRecurrencePattern); + if ADelta > 0 then + pnlRecurrenceInfo.Height := FRecurrenceInfoHeight + ADelta; + end; +end; + +procedure TcxSchedulerEventEditorForm.LoadEventValuesIntoControls; +begin + teSubject.Text := Event.Caption; + teSubject.Enabled := Storage.IsCaptionAvailable; + + teLocation.Text := Event.Location; + teLocation.Enabled := Storage.IsLocationAvailable; + + icbLabel.Enabled := Storage.IsLabelColorAvailable and (EventLabels.Count > 0); + icbLabel.ItemIndex := EventLabels.IndexOfColor(Event.LabelColor); + + meMessage.Text := Event.Message; + meMessage.Enabled := Storage.IsMessageAvailable; + + LoadValuesIntoTimeControls(Event.Start, Event.Finish, Event.AllDayEvent); + + icbShowTimeAs.ItemIndex := Integer(Event.State); + icbShowTimeAs.Enabled := Storage.IsStateAvailable; + + cbReminder.Checked := Event.Reminder; + cbReminderMinutesBeforeStart.Text := cxMinutesToTextProc(Event.ReminderMinutesBeforeStart); + cbReminderMinutesBeforeStart.Enabled := cbReminder.Checked; + + InitResources; +end; + +procedure TcxSchedulerEventEditorForm.LoadValuesIntoTimeControls( + const AStart, AFinish: TDateTime; AllDayEvent: Boolean); +begin + deStart.Date := DateOf(AStart); + teStart.Time := TimeOf(AStart); + deEnd.Date := DateOf(AFinish) - Ord(AllDayEvent); + teEnd.Time := TimeOf(AFinish); + cbAllDayEvent.Checked := AllDayEvent; +end; + +procedure TcxSchedulerEventEditorForm.InitLabelColor; +var + I: Integer; + AItem: TcxImageComboboxItem; +begin + icbLabel.Enabled := Storage.IsLabelColorAvailable and (EventLabels.Count > 0); + for I := 0 to EventLabels.Count - 1 do + begin + AItem := TcxImageComboboxItem(icbLabel.Properties.Items.Add); + AItem.Description := EventLabels[I].Caption; + AItem.ImageIndex := I; + AItem.Value := EventLabels[I].Color; + end; + icbLabel.Properties.Images := EventLabels.Images; +end; + +procedure TcxSchedulerEventEditorForm.SetCaptions; +begin + Caption := cxGetResourceString(@scxEvent) + ' - ' + EventName; + // events + lbInformation.Caption := cxGetResourceString(@scxEventsConflict); + lbResource.Caption := cxGetResourceString(@scxResource); + lbSubject.Caption := cxGetResourceString(@scxSubject); + lbLocation.Caption := cxGetResourceString(@scxLocation); + lbLabel.Caption := cxGetResourceString(@scxLabel); + lbShowTimeAs.Caption := cxGetResourceString(@scxShowTimeAs); + lbStartTime.Caption := cxGetResourceString(@scxStartTime); + lbEndTime.Caption := cxGetResourceString(@scxEndTime); + cbAllDayEvent.Caption := cxGetResourceString(@scxAllDayEvent); + cbReminder.Caption := cxGetResourceString(@scxReminder); + lbRecurrence.Caption := cxGetResourceString(@scxRecurrenceLabel); + lbTaskComplete.Caption := cxGetResourceString(@scxTaskComplete); + lbTaskStatus.Caption := cxGetResourceString(@scxTaskStatus); + // buttons + btnFindTime.Caption := cxGetResourceString(@scxFindAvailableTime); + btnOk.Caption := cxGetResourceString(@scxOk); + btnCancel.Caption := cxGetResourceString(@scxCancel); + btnDelete.Caption := cxGetResourceString(@scxDelete); + btnRecurrence.Caption := cxGetResourceString(@scxRecurrence); + btnRecurrence.Enabled := Storage.IsRecurrenceAvailable; +end; + +procedure TcxSchedulerEventEditorForm.UpdateEventValuesFromControls; +begin + if teSubject.EditModified then + Event.Caption := teSubject.Text; + if teLocation.EditModified then + Event.Location := teLocation.Text; + if meMessage.EditModified then + Event.Message := meMessage.Text; + if (Event.EventType = etNone) or not ForceSeries then + begin + Event.Start := deStart.Date + teStart.Time + BiasTime; + Event.Finish := deEnd.Date + teEnd.Time + Ord(cbAllDayEvent.Checked) + BiasTime; + if cbAllDayEvent.EditModified then + Event.AllDayEvent := cbAllDayEvent.Checked; + end; + if icbShowTimeAs.EditModified then + Event.State := icbShowTimeAs.ItemIndex; + if icbLabel.EditModified and (icbLabel.ItemIndex <> -1) then + Event.LabelColor := EventLabels[icbLabel.ItemIndex].Color; + if pnlResource.Visible and cbResources.EditModified then + SaveResourceID; + if pnlReminder.Visible then + begin + if cbReminder.EditModified then + Event.Reminder := cbReminder.Checked; + if cbReminderMinutesBeforeStart.EditModified then + SetReminderMinutesBeforeStart; + end; +end; + +function TcxSchedulerEventEditorForm.GetEventName: string; +begin + Result := cxGetResourceString(@scxUntitled); + if Event.Caption <> '' then + Result := Event.Caption; +end; + +procedure TcxSchedulerEventEditorForm.OnChanged(Sender: TObject); +begin + FModified := True; + CheckIntersection; +end; + +procedure TcxSchedulerEventEditorForm.FormCloseQuery(Sender: TObject; + var CanClose: Boolean); +var + AMsgRes: Integer; +begin + CanClose := (ModalResult = mrOk) or not Modified or + ((ModalResult = mrCancel) and not btnOk.Enabled); + if not CanClose then + begin + if ModalResult = mrAbort then + CanClose := MessageDlg(cxGetResourceString(@scxDeleteConfirmation), + mtWarning, [mbYes, mbNo], 0) = mrYes + else + if ModalResult = mrCancel then + begin + AMsgRes := MessageDlg(cxGetResourceString(@scxExitConfirmation), + mtWarning, [mbYes, mbNo, mbCancel], 0); + CanClose := AMsgRes in [mrYes, mrNo]; + if AMsgRes = mrYes then + begin + if (Event.Pattern <> nil) and (Event.EventType = etNone) then + Event.Pattern.DeleteExceptions; + ModalResult := mrOk; + end; + end; + if not CanClose then + ModalResult := mrNone; + end; + if ModalResult = mrOk then + CanClose := IsValid; +end; + +procedure TcxSchedulerEventEditorForm.FormKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if (Key = VK_ESCAPE) and not HasOpenedPopupWindow(ActiveControl) then + begin + ModalResult := mrCancel; + Key := 0; + end; +end; + +procedure TcxSchedulerEventEditorForm.FormActivate(Sender: TObject); +begin + OnActivate := nil; + if RecurrenceActivate then + btnRecurrenceClick(nil); +end; + +procedure TcxSchedulerEventEditorForm.cbAllDayEventPropertiesChange( + Sender: TObject); +var + ACanCorrect: Boolean; +begin + ACanCorrect := icbShowTimeAs.ItemIndex = cxOriginalEventStates[Event.AllDayEvent]; + Event.AllDayEvent := cbAllDayEvent.Checked; + if ACanCorrect then + begin + icbShowTimeAs.ItemIndex := cxOriginalEventStates[Event.AllDayEvent]; + icbShowTimeAs.EditModified := True; + end; + FModified := True; + CheckVisible; +end; + +procedure TcxSchedulerEventEditorForm.StartDateChanged(Sender: TObject); +begin + OnChanged(nil); + deEnd.Date := deStart.Date + DateOf(FDuration) - Ord(cbAllDayEvent.Checked); + FDuration := (DateOf(deEnd.Date) + TimeOf(teEnd.Time)) - + (DateOf(deStart.Date) + TimeOf(teStart.Time)) + Ord(cbAllDayEvent.Checked); +end; + +procedure TcxSchedulerEventEditorForm.SetReadOnly(AValue: Boolean); +begin + if FReadOnly <> AValue then + begin + pnlCaption.Enabled := not AValue; + pnlReminder.Enabled := not AValue; + pnlTime.Enabled := not AValue; + pnlResource.Enabled := not AValue; + meMessage.Properties.ReadOnly := AValue; + btnCancel.Enabled := not AValue; + btnDelete.Enabled := not AValue and btnDelete.Enabled; + icbShowTimeAs.Enabled := not AValue; + icbLabel.Enabled := not AValue; + FReadOnly := AValue; + end; +end; + +procedure TcxSchedulerEventEditorForm.SetReminderMinutesBeforeStart; +var + AMinutes: Integer; +begin + if cxTextToMinutesProc(cbReminderMinutesBeforeStart.Text, AMinutes) then + Event.ReminderMinutesBeforeStart := AMinutes; +end; + +procedure TcxSchedulerEventEditorForm.cbReminderClick(Sender: TObject); +begin + FModified := True; + cbReminderMinutesBeforeStart.Enabled := cbReminder.Checked; +end; + +procedure TcxSchedulerEventEditorForm.cbReminderMinutesBeforeStartPropertiesValidate( + Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; + var Error: Boolean); +var + AMinutes: Integer; +begin + Error := not cxTextToMinutesProc(VarToStr(DisplayValue), AMinutes); + if not Error then + begin + DisplayValue := cxMinutesToTextProc(AMinutes); + cxComboBoxCaretToEnd(TcxComboBox(Sender)); + end + else + ErrorText := cxGetResourceString(@scxInvalidNumber); +end; + +procedure TcxSchedulerEventEditorForm.cbReminderMinutesBeforeStartPropertiesPopup( + Sender: TObject); +var + AMinutes: Integer; + AText: string; +begin + AText := cbReminderMinutesBeforeStart.Text; + if cxTextToMinutesProc(AText, AMinutes) then + begin + cbReminderMinutesBeforeStart.Text := cxMinutesToTextProc(AMinutes); + cbReminderMinutesBeforeStart.EditModified := not SameText(AText, cbReminderMinutesBeforeStart.Text); + cxComboBoxCaretToEnd(cbReminderMinutesBeforeStart); + cxComboBoxSetNearestTimeInterval(cbReminderMinutesBeforeStart, AMinutes); + end; +end; + +procedure TcxSchedulerEventEditorForm.OnEventTimeChanged(Sender: TObject); +begin + OnChanged(Sender); + CheckIntersection; +end; + +procedure TcxSchedulerEventEditorForm.btnRecurrenceClick(Sender: TObject); +var + AModified: Boolean; + ADateTime: TDateTime; +begin + AModified := False; + if (Event.EventType = etNone) then + begin + Event.AllDayEvent := cbAllDayEvent.Checked; + Event.Start := deStart.Date + teStart.Time; + Event.Finish := deEnd.Date + teEnd.Time + Ord(cbAllDayEvent.Checked); + end + else + begin + Event.Start := PatternStart; + Event.Finish := PatternFinish; + end; + Event.RecurrenceInfo.Assign(RecurrenceInfo); + if cxShowRecurrenceEditor(Event, icbShowTimeAs.Style.LookAndFeel, AModified, + ReadOnly, FNeedCheckLossOfExceptions, True) then + begin + cbAllDayEvent.Checked := Event.AllDayEvent; + FPatternStart := Event.Start; + FPatternFinish := Event.Finish; + FRecurrenceInfo.Assign(Event.RecurrenceInfo); + ADateTime := Event.Start - BiasTime; + deStart.Date := DateOf(ADateTime); + teStart.Time := TimeOf(ADateTime); + ADateTime := Event.Finish - (Ord(Event.AllDayEvent) + BiasTime); + deEnd.Date := DateOf(ADateTime); + teEnd.Time := TimeOf(ADateTime); + DeleteExceptions := True; + FNeedCheckLossOfExceptions := False; + FForceSeries := True; + end + else + DeleteExceptions := DeleteExceptions or ((Event.Pattern <> nil) and (Event.EventType = etNone)); + FModified := not ReadOnly and (FModified or AModified); + CheckVisible; +end; + +procedure TcxSchedulerEventEditorForm.OnResourceIDChanged(Sender: TObject); +begin + FModified := True; + CheckIntersection; +end; + +procedure TcxSchedulerEventEditorForm.btnDeleteClick(Sender: TObject); +var + AOccurrence: Boolean; +begin + if not Assigned(FOnDeleteFunc) or FOnDeleteFunc(Event) then + begin + if (Event.Pattern <> nil) and Event.IsRecurring then + if not ForceSeries then + begin + if not cxShowRecurrenceSelectionDialog(Event, rsmDeleting, btnOk.LookAndFeel, + AOccurrence) then Exit; + DeleteSeries := not AOccurrence; + end + else + DeleteSeries := True; + ModalResult := mrAbort; + end; +end; + +procedure TcxSchedulerEventEditorForm.btnFindTimeClick(Sender: TObject); +begin + if not FindAvailableTime then + MessageBox(0, PChar(cxGetResourceString(@scxNoAvailableFreeTime)), nil, MB_ICONINFORMATION or MB_OK); + CheckIntersection; + if pnlRecurrenceInfo.Visible then + RefreshRecurrenceInfo; +end; + +procedure TcxSchedulerEventEditorForm.seTaskCompleteChange( + Sender: TObject); +begin + FModified := True; + Event.TaskComplete := seTaskComplete.Value; + FIsUpdating := True; + try + cbxTaskStatus.ItemIndex := Integer(Event.TaskStatus); + finally + FIsUpdating := False; + end; +end; + +procedure TcxSchedulerEventEditorForm.cbxTaskStatusChange( + Sender: TObject); +begin + FModified := True; + if FIsUpdating then Exit; + FIsUpdating := True; + try + Event.TaskStatus := TcxSchedulerEventTaskStatus(cbxTaskStatus.ItemIndex); + seTaskComplete.Value := Event.TaskComplete; + finally + FIsUpdating := False; + end; +end; + +initialization + RegisterClass(TBevel); + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerGanttView.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerGanttView.pas new file mode 100644 index 00000000..ac5fdac6 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerGanttView.pas @@ -0,0 +1,2216 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerGanttView; + +{$I cxVer.inc} + +interface + +uses + Types, Forms, Windows, SysUtils, StdCtrls, Classes, Math, Controls, Graphics, + cxScrollBar, cxLookAndFeelPainters, cxSchedulerCustomControls, cxSchedulerStorage, + cxSchedulerCustomResourceView, cxSchedulerUtils, cxSchedulerStrs, cxDateUtils, + cxClasses, cxDrawTextUtils, cxSchedulerTimeGridView, cxGraphics, cxGeometry, + cxControls; + +const + // hittest constants + htcLink = $15; + htcExpandButton = $17; + +type + TcxSchedulerGanttView = class; + TcxSchedulerGanttViewController = class; + TcxSchedulerGanttViewViewInfo = class; + + TcxSchedulerGanttViewEventStyle = (esDefault, esProgress); + + { TcxSchedulerGanttViewEventLayoutBuilder } + + TcxSchedulerGanttViewEventLayoutBuilder = class(TcxSchedulerEventLayoutBuilder) + public + procedure Calculate; override; + end; + + { TcxSchedulerGanttViewLinkViewInfo } + + TcxSchedulerGanttViewLinkLines = array of TRect; + + TcxSchedulerGanttViewLinkViewInfo = class(TcxSchedulerCustomViewInfoItem) + private + FArrowDirection: TcxArrowDirection; + FArrowRect: TRect; + FClipRect: TRect; + FEventItemLink: TcxSchedulerEventItemLink; + FFinishEventViewInfo: TcxSchedulerEventCellViewInfo; + FHint: string; + FLines: TcxSchedulerGanttViewLinkLines; + FStartEventViewInfo: TcxSchedulerEventCellViewInfo; + FViewInfo: TcxSchedulerGanttViewViewInfo; + function GetArrowDirection(const AArrowStart, AArrowFinish: TPoint): TcxArrowDirection; + function GetFinishPoint(const AStartRect, AFinishRect: TRect): TPoint; + function GetIsHot: Boolean; + function GetRelation: TcxSchedulerEventRelation; + function GetStartPoint(const AStartRect: TRect): TPoint; + protected + function GetHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest; var ABreak: Boolean): Boolean; override; + procedure AfterCustomDraw(ACanvas: TcxCanvas); override; + procedure BeforeCustomDraw(ACanvas: TcxCanvas); override; + procedure Calculate(AStartRect: TRect; AFinishRect: TRect); virtual; + procedure CalculateArrowRect(const AArrowStart, AArrowFinish: TPoint); virtual; + procedure CalculateBounds; virtual; + procedure SetClipRegion(ACanvas: TcxCanvas); + + property FinishEventViewInfo: TcxSchedulerEventCellViewInfo read FFinishEventViewInfo; + property StartEventViewInfo: TcxSchedulerEventCellViewInfo read FStartEventViewInfo; + property ClipRect: TRect read FClipRect; + public + procedure Initialize(AViewInfo: TcxSchedulerGanttViewViewInfo; + AStartEventViewInfo, AFinishEventViewInfo: TcxSchedulerEventCellViewInfo; + AEventItemLink: TcxSchedulerEventItemLink); virtual; + procedure Draw(ACanvas: TcxCanvas); override; + + property ArrowDirection: TcxArrowDirection read FArrowDirection; + property ArrowRect: TRect read FArrowRect; + property EventItemLink: TcxSchedulerEventItemLink read FEventItemLink; + property Hint: string read FHint; + property IsHot: Boolean read GetIsHot; + property Lines: TcxSchedulerGanttViewLinkLines read FLines; + property Relation: TcxSchedulerEventRelation read GetRelation; + property ViewInfo: TcxSchedulerGanttViewViewInfo read FViewInfo; + end; + + { TcxSchedulerGanttViewExpandButtonViewInfo } + + TcxSchedulerGanttViewExpandButtonViewInfo = class(TcxSchedulerCustomViewInfoItem) + private + FEvent: TcxSchedulerControlEvent; + FExpanded: Boolean; + protected + procedure DoClick; + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + public + procedure Draw(ACanvas: TcxCanvas); override; + property Event: TcxSchedulerControlEvent read FEvent; + property Expanded: Boolean read FExpanded; + end; + + { TcxSchedulerGanttViewTotalProgressViewInfo } + + TcxSchedulerGanttViewTotalProgressViewInfo = class + private + FContentArea: TRect; + FDrawAsPolyline: Boolean; + FLineColor: TColor; + FPoints: array of TPoint; + FProgressNodes: array of TPoint; + FTimeLineRect: TRect; + FViewInfo: TcxSchedulerGanttViewViewInfo; + function FindUncompliteEventBeforeLine(const ALine: TRect; + AResource: TcxSchedulerStorageResourceItem; var AViewInfo: TcxSchedulerEventCellViewInfo): Boolean; + function GetTimeLineApproximateRect: TRect; + function GetTimeLineRect: TRect; + function GetUncompliteEventPoint(const ALine: TRect; var P: TPoint; + AResource: TcxSchedulerStorageResourceItem): Boolean; + public + constructor Create(AViewInfo: TcxSchedulerGanttViewViewInfo); virtual; + procedure Calculate; virtual; + procedure CalculatePolyline; + procedure Draw(ACanvas: TcxCanvas); + procedure DrawProgressNodes(ACanvas: TcxCanvas); + property ContentArea: TRect read FContentArea; + property DrawAsPolyline: Boolean read FDrawAsPolyline; + property LineColor: TColor read FLineColor; + property TimeLineRect: TRect read FTimeLineRect; + property ViewInfo: TcxSchedulerGanttViewViewInfo read FViewInfo; + end; + + { TcxSchedulerGanttViewViewInfo } + + TcxSchedulerGanttViewViewInfo = class(TcxSchedulerTimeGridViewViewInfo) + private + FExpandButtons: TcxSchedulerViewInfoCellList; + FHotLink: TcxSchedulerGanttViewLinkViewInfo; + FLinks: TcxSchedulerViewInfoCellList; + FTotalProgressViewInfo: TcxSchedulerGanttViewTotalProgressViewInfo; + FVisibleEventEnumerationList: TcxObjectList; + FVisibleEventWithoutResourceCount: Integer; + function GetGanttView: TcxSchedulerGanttView; + function GetIsHotTrackEnabled: Boolean; + function GetLinkViewParams: TcxViewParams; + function GetVisibleEventEnumeration(AIndex: Integer): TcxSchedulerResourceViewInfo; + procedure SetHotLink(AHotLink: TcxSchedulerGanttViewLinkViewInfo); + protected + procedure AddEventForCalculation(ABuilder: TcxSchedulerEventLayoutBuilder; + AEvent: TcxSchedulerControlEvent; AResourceIndex: Integer); override; + procedure CalculateExpandButtonViewInfos; + procedure CheckEventVisibility(ACell: TcxSchedulerEventCellViewInfo; AIndex: Integer); override; + procedure Clear; override; + function CreateEventViewData(AEvent: TcxSchedulerControlEvent; + const ABounds: TRect; const AStart: TDateTime; const AFinish: TDateTime; + AResource: TcxSchedulerResourceViewInfo): TcxSchedulerEventViewData; override; + function CreateLayoutBuilder: TcxSchedulerEventLayoutBuilder; override; + function CreateLinkItemViewInfo(AEventViewInfo: TcxSchedulerEventCellViewInfo; + AEventItemLink: TcxSchedulerEventItemLink; + out ALinkItem: TcxSchedulerGanttViewLinkViewInfo): Boolean; + procedure DoCalculate; override; + function FindEventViewInfoBySource(AEvent: TcxSchedulerEvent; + const ADate: TDateTime; AResource: TcxSchedulerStorageResourceItem; + var AViewInfo: TcxSchedulerEventCellViewInfo): Boolean; + function GetEventBounds(AEvent: TcxSchedulerControlEvent; AResource: TcxSchedulerStorageResourceItem; out AEventRect: TRect): Boolean; + function GetEventForResourceCount(AResourceIndex: Integer; out AResourceID: Variant): Integer; override; + function GetEventWithoutResourceCount: Integer; override; + function GetIndentBetweenLines: Integer; override; + function GetNeedShowCurrentTime: Boolean; override; + function HasVisibleEvents: Boolean; override; + function IsEventCollapsed(AEvent: TcxSchedulerEvent; AHidden: Boolean): Boolean; + function IsTaskLinksExpanded(ATaskLinks: TcxSchedulerEventLinks): Boolean; + function NavigationButtonOffset(AKind: TcxSchedulerContentNavigationButtonKind; + AResourceIndex: Integer): Integer; override; + // Links + procedure CreateLinks; virtual; + procedure RecreateLinks; virtual; + property ExpandButtons: TcxSchedulerViewInfoCellList read FExpandButtons; + public + constructor Create(AOwner: TcxSchedulerSubControl); override; + destructor Destroy; override; + procedure CalculateHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + + property HotLink: TcxSchedulerGanttViewLinkViewInfo read FHotLink write SetHotLink; + property Links: TcxSchedulerViewInfoCellList read FLinks; + property LinkViewParams: TcxViewParams read GetLinkViewParams; + property TotalProgressViewInfo: TcxSchedulerGanttViewTotalProgressViewInfo read FTotalProgressViewInfo; + property View: TcxSchedulerGanttView read GetGanttView; + property VisibleEventEnumerationList[AIndex: Integer]: TcxSchedulerResourceViewInfo read GetVisibleEventEnumeration; + end; + + { TcxSchedulerGanttViewPainter } + + TcxSchedulerGanttViewPainter = class(TcxSchedulerTimeGridViewPainter) + private + function GetView: TcxSchedulerGanttView; + function GetViewInfo: TcxSchedulerGanttViewViewInfo; + procedure DoDrawExpandButton(AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); + procedure DoDrawLinkItem(AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); + public + procedure Paint; override; + property View: TcxSchedulerGanttView read GetView; + property ViewInfo: TcxSchedulerGanttViewViewInfo read GetViewInfo; + end; + + { TcxSchedulerGanttViewHitTest } + + TcxSchedulerGanttViewHitTest = class(TcxSchedulerTimeGridViewHitTest) + private + function GetHitAtEventDraggingArea: Boolean; + function GetHitExpandButton: TcxSchedulerGanttViewExpandButtonViewInfo; + function GetHitLink: TcxSchedulerGanttViewLinkViewInfo; + function GetView: TcxSchedulerGanttView; + protected + FCalcEventDraggingArea: Boolean; + FEventDraggingArea: TRect; + property View: TcxSchedulerGanttView read GetView; + property HitExpandButton: TcxSchedulerGanttViewExpandButtonViewInfo read GetHitExpandButton; + property HitLink: TcxSchedulerGanttViewLinkViewInfo read GetHitLink; + public + property HitAtEventDraggingArea: Boolean read GetHitAtEventDraggingArea; + property HitAtExpandButton: Boolean index htcExpandButton read GetBitState; + property HitAtLink: Boolean index htcLink read GetBitState; + end; + + { TcxGanttDragEventHelper } + + TcxSchedulerEventDragMode = (sedmNone, sedmMoveTo, sedmTaskLinkTo); + + TcxSchedulerGanttDragObject = class(TcxSchedulerDragObject) + private + FDragGroupedTaskLinks: Boolean; + function GetController: TcxSchedulerGanttViewController; + protected + function GetDragCursor(Accepted: Boolean; X, Y: Integer): TCursor; override; + property Controller: TcxSchedulerGanttViewController read GetController; + public + constructor Create(AControl: TControl); override; + property DragGroupedTaskLinks: Boolean read FDragGroupedTaskLinks write FDragGroupedTaskLinks; + end; + + TcxGanttDragEventHelper = class(TcxTimeGridDragEventHelper) + private + function GetController: TcxSchedulerGanttViewController; + function GetDragObject: TcxSchedulerGanttDragObject; + function GetHitTest: TcxSchedulerGanttViewHitTest; + function GetViewInfo: TcxSchedulerGanttViewViewInfo; + protected + procedure ApplyChanges; override; + procedure ApplyTaskLinks; virtual; + function CanDragTo(ADeltaTime: TDateTime): Boolean; virtual; + procedure DragOver(const P: TPoint; State: TDragState; var Accepted: Boolean); override; + procedure InternalApplyTaskLink(AEvent: TcxSchedulerControlEvent); virtual; + function IsAtOrigin: Boolean; override; + procedure PrepareGroupedTaskLinks; virtual; + procedure UpdateViewClonesTime; override; + + property Controller: TcxSchedulerGanttViewController read GetController; + property DragObject: TcxSchedulerGanttDragObject read GetDragObject; + property HitTest: TcxSchedulerGanttViewHitTest read GetHitTest; + property ViewInfo: TcxSchedulerGanttViewViewInfo read GetViewInfo; + end; + + { TcxGanttEventSizing } + + TcxGanttEventSizing = class(TcxTimeGridEventSizing) + protected + function CanResize: Boolean; virtual; + procedure DragOver(const P: TPoint; State: TDragState; var Accepted: Boolean); override; + function IsValidTime: Boolean; override; + end; + + { TcxSchedulerGanttViewController } + + TcxSchedulerGanttViewController = class(TcxSchedulerTimeGridViewController) + private + FEventDragMode: TcxSchedulerEventDragMode; + FTimerScrollBarKind: TScrollBarKind; + FDragEventClipRect: TRect; + procedure CalcDragEventClipRect; + function GetDragEventHelper: TcxGanttDragEventHelper; + function GetEventHintData(var AHint: string): Boolean; + function GetHitTest: TcxSchedulerGanttViewHitTest; + function GetLinkHintData(var AHint: string): Boolean; + function GetView: TcxSchedulerGanttView; + function GetViewInfo: TcxSchedulerGanttViewViewInfo; + procedure InternalPaintDraggingLink(const AStart, AFinish: TPoint); + procedure SetEventDragMode(AValue: TcxSchedulerEventDragMode); + protected + FPrevDragPoint: TPoint; + FStartDragPoint: TPoint; + procedure CheckScrolling(const APos: TPoint); override; + procedure CheckTaskLinkDrawOnScroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode); virtual; + function ConsiderHiddenEvents: Boolean; override; + function CreateDragEventHelper: TcxDragEventHelper; override; + function CreateResizeEventHelper: TcxEventSizingHelper; override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); override; + procedure EndDrag(Target: TObject; X, Y: Integer); override; + procedure EraseDraggingLink; virtual; + function GetDragEventClipRect: TRect; virtual; + procedure InitTimer(AllowStart: Boolean; AScrollCode: TScrollCode); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure OnTimer(Sender: TObject); override; + procedure PaintDraggingLink(const P: TPoint); virtual; + procedure Scrolling(AScrollCode: TScrollCode; var AScrollPos: Integer); override; + function ShowHint: Boolean; override; + procedure StartDrag(var DragObject: TDragObject); override; + procedure UpdateDraggingLink(const P: TPoint); virtual; + procedure UpdateEventDragMode; + + property DragEventHelper: TcxGanttDragEventHelper read GetDragEventHelper; + property EventDragMode: TcxSchedulerEventDragMode read FEventDragMode write SetEventDragMode; + property HitTest: TcxSchedulerGanttViewHitTest read GetHitTest; + property View: TcxSchedulerGanttView read GetView; + property ViewInfo: TcxSchedulerGanttViewViewInfo read GetViewInfo; + end; + + { TcxSchedulerGanttView } + + TcxSchedulerGanttView = class(TcxSchedulerTimeGridView) + private + FEventsStyle: TcxSchedulerGanttViewEventStyle; + FLinkLineColor: TColor; + FShowExpandButtons: Boolean; + FShowTotalProgressLine: Boolean; + FTotalProgressLineColor: TColor; + function GetController: TcxSchedulerGanttViewController; + function GetHitTest: TcxSchedulerGanttViewHitTest; + function GetViewInfo: TcxSchedulerGanttViewViewInfo; + procedure SetEventsStyle(AValue: TcxSchedulerGanttViewEventStyle); + procedure SetLinkLineColor(AColor: TColor); + procedure SetShowExpandButtons(AValue: Boolean); + procedure SetShowTotalProgressLine(AValue: Boolean); + procedure SetTotalProgressLineColor(AValue: TColor); + protected + function CheckEventsVisibility: Boolean; override; + function CreateController: TcxSchedulerSubControlController; override; + function CreateHitTest: TcxSchedulerSubControlHitTest; override; + function CreatePainter: TcxSchedulerSubControlPainter; override; + function CreateViewInfo: TcxSchedulerSubControlViewInfo; override; + function GetDragObjectClass: TDragControlObjectClass; override; + function GetEventHintText(AEvent: TcxSchedulerControlEvent): string; override; + function IsInplaceEditingEnabled: Boolean; override; + function ShowTaskComplete: Boolean; override; + procedure ValidateContentPopupMenuItems(var AItems: TcxSchedulerContentPopupMenuItems); override; + + property Controller: TcxSchedulerGanttViewController read GetController; + property EventDetailInfo; + property ViewInfo: TcxSchedulerGanttViewViewInfo read GetViewInfo; + public + constructor Create(AOwner: TcxCustomScheduler); override; + property HitTest: TcxSchedulerGanttViewHitTest read GetHitTest; + published + property EventsStyle: TcxSchedulerGanttViewEventStyle read FEventsStyle write SetEventsStyle default esDefault; + property LinkLineColor: TColor read FLinkLineColor write SetLinkLineColor default clNavy; + property ShowExpandButtons: Boolean read FShowExpandButtons write SetShowExpandButtons default False; + property ShowTotalProgressLine: Boolean read FShowTotalProgressLine write SetShowTotalProgressLine default False; + property TotalProgressLineColor: TColor read FTotalProgressLineColor write SetTotalProgressLineColor default clRed; + end; + +implementation + +uses + cxLibraryConsts, cxSchedulerDialogs, cxVariants; + +const + LinkLineOffset = 5; + ProgressNodeRadius = 4; + +type + TcxCustomSchedulerAccess = class(TcxCustomScheduler); + TcxSchedulerEventAccess = class(TcxSchedulerEvent); + TcxSchedulerControlEventAccess = class(TcxSchedulerControlEvent); + TcxSchedulerEventCellViewInfoAccess = class(TcxSchedulerEventCellViewInfo); + TcxSchedulerHintControllerAccess = class(TcxSchedulerHintController); + TcxSchedulerTimeGridResourceScrollAccess = class(TcxSchedulerTimeGridResourceScroll); + TcxSchedulerCustomDateNavigatorAccess = class(TcxSchedulerCustomDateNavigator); + +function cxGanttViewCompareEventPlaces(AEventPlace1: TcxSchedulerEventPlace; + AEventPlace2: TcxSchedulerEventPlace): Integer; + + function CheckClone(AEvent1, AEvent2: TcxSchedulerControlEvent; + var ASign: Integer): Boolean; + begin + if AEvent1.IsClone and (AEvent1.Source = AEvent2) then + ASign := 1 + else + if AEvent2.IsClone and (AEvent2.Source = AEvent1) then + ASign := -1 + else + ASign := 0; + Result := ASign <> 0; + end; + +var + AEvent1: TcxSchedulerControlEvent; + AEvent2: TcxSchedulerControlEvent; +begin + Result := Integer(AEventPlace1.Resource) - Integer(AEventPlace2.Resource); + if Result = 0 then + begin + AEvent1 := TcxSchedulerControlEvent(AEventPlace1.Event); + AEvent2 := TcxSchedulerControlEvent(AEventPlace2.Event); + if AEvent1.Pattern <> nil then + AEvent1 := TcxSchedulerControlEvent(AEvent1.Pattern); + if AEvent2.Pattern <> nil then + AEvent2 := TcxSchedulerControlEvent(AEvent2.Pattern); + Result := AEvent1.TaskIndex - AEvent2.TaskIndex; + if Result <> 0 then + begin + if AEvent1.TaskIndex = -1 then Result := 1; + if AEvent2.TaskIndex = -1 then Result := -1; + end + else + if not CheckClone(AEvent1, AEvent2, Result) and + (AEvent1.TaskIndex = -1) then + begin + Result := AEvent1.RecordIndex - AEvent2.RecordIndex; + if Result <> 0 then + begin + if AEvent1.RecordIndex < 0 then Result := 1; + if AEvent2.RecordIndex < 0 then Result := -1; + end; + end; + end; +end; + +{ TcxSchedulerGanttView } + +constructor TcxSchedulerGanttView.Create(AOwner: TcxCustomScheduler); +begin + inherited Create(AOwner); + FLinkLineColor := clNavy; + FTotalProgressLineColor := clRed; +end; + +function TcxSchedulerGanttView.CheckEventsVisibility: Boolean; +begin + Result := False; +end; + +function TcxSchedulerGanttView.CreateController: TcxSchedulerSubControlController; +begin + Result := TcxSchedulerGanttViewController.Create(Self); +end; + +function TcxSchedulerGanttView.CreateHitTest: TcxSchedulerSubControlHitTest; +begin + Result := TcxSchedulerGanttViewHitTest.Create(Self); +end; + +function TcxSchedulerGanttView.CreatePainter: TcxSchedulerSubControlPainter; +begin + Result := TcxSchedulerGanttViewPainter.Create(Self); +end; + +function TcxSchedulerGanttView.CreateViewInfo: TcxSchedulerSubControlViewInfo; +begin + Result := TcxSchedulerGanttViewViewInfo.Create(Self); +end; + +function TcxSchedulerGanttView.GetDragObjectClass: TDragControlObjectClass; +begin + Result := TcxSchedulerGanttDragObject; +end; + +function TcxSchedulerGanttView.GetEventHintText( + AEvent: TcxSchedulerControlEvent): string; +begin + Result := Format(cxGetResourceString(@scxGanttEventHint), [AEvent.Caption, + AEvent.TaskComplete, cxDateToStr(AEvent.Start), cxDateToStr(AEvent.Finish)]); +end; + +function TcxSchedulerGanttView.IsInplaceEditingEnabled: Boolean; +begin + Result := EventsStyle <> esProgress; +end; + +function TcxSchedulerGanttView.ShowTaskComplete: Boolean; +begin + Result := True; +end; + +procedure TcxSchedulerGanttView.ValidateContentPopupMenuItems( + var AItems: TcxSchedulerContentPopupMenuItems); +begin + if not (Scales.MinorUnit in [suHour, suDay]) then + Exclude(AItems, cpmiToday); + AItems := AItems - [cpmiGoToDate, cpmiGoToThisDay]; +end; + +function TcxSchedulerGanttView.GetController: TcxSchedulerGanttViewController; +begin + Result := TcxSchedulerGanttViewController(inherited Controller); +end; + +function TcxSchedulerGanttView.GetHitTest: TcxSchedulerGanttViewHitTest; +begin + Result := TcxSchedulerGanttViewHitTest(inherited HitTest); +end; + +function TcxSchedulerGanttView.GetViewInfo: TcxSchedulerGanttViewViewInfo; +begin + Result := TcxSchedulerGanttViewViewInfo(inherited ViewInfo); +end; + +procedure TcxSchedulerGanttView.SetEventsStyle(AValue: TcxSchedulerGanttViewEventStyle); +begin + if AValue <> EventsStyle then + begin + FEventsStyle := AValue; + Changed; + end; +end; + +procedure TcxSchedulerGanttView.SetLinkLineColor(AColor: TColor); +begin + if AColor <> LinkLineColor then + begin + FLinkLineColor := AColor; + Changed; + end; +end; + +procedure TcxSchedulerGanttView.SetShowExpandButtons(AValue: Boolean); +begin + if AValue <> ShowExpandButtons then + begin + FShowExpandButtons := AValue; + Changed; + end; +end; + +procedure TcxSchedulerGanttView.SetShowTotalProgressLine(AValue: Boolean); +begin + if ShowTotalProgressLine <> AValue then + begin + FShowTotalProgressLine := AValue; + Changed; + end; +end; + +procedure TcxSchedulerGanttView.SetTotalProgressLineColor(AValue: TColor); +begin + if TotalProgressLineColor <> AValue then + begin + FTotalProgressLineColor := AValue; + Changed; + end; +end; + +{ TcxSchedulerGanttViewLinkItemViewInfo } + +procedure TcxSchedulerGanttViewLinkViewInfo.Initialize( + AViewInfo: TcxSchedulerGanttViewViewInfo; + AStartEventViewInfo, AFinishEventViewInfo: TcxSchedulerEventCellViewInfo; + AEventItemLink: TcxSchedulerEventItemLink); +begin + FViewInfo := AViewInfo; + FFinishEventViewInfo := AFinishEventViewInfo; + FStartEventViewInfo := AStartEventViewInfo; + FEventItemLink := AEventItemLink; + FHint := Format(cxGetResourceString(@scxLinkHint), [ + cxGetResourceString(sEventRelations[Integer(Relation)]), + cxGetResourceString(sEventRelationsShort[Integer(Relation)]), + StartEventViewInfo.Caption, FinishEventViewInfo.Caption]); + Calculate(AStartEventViewInfo.Bounds, AFinishEventViewInfo.Bounds); + CalculateBounds; +end; + +procedure TcxSchedulerGanttViewLinkViewInfo.AfterCustomDraw(ACanvas: TcxCanvas); +begin + // nothing to do +end; + +procedure TcxSchedulerGanttViewLinkViewInfo.BeforeCustomDraw(ACanvas: TcxCanvas); +begin + ACanvas.Brush.Style := bsSolid; + ACanvas.SetBrushColor(ViewParams.Color); + ACanvas.Pen.Color := ViewParams.Color; +end; + +procedure TcxSchedulerGanttViewLinkViewInfo.Calculate( + AStartRect: TRect; AFinishRect: TRect); + + function GetValidRect(const P1, P2: TPoint): TRect; + begin + if P1.X = P2.X then + Result := Rect(P1.X, Min(P1.Y, P2.Y), P1.X + 1, Max(P1.Y, P2.Y) + 1) + else + Result := Rect(Min(P1.X, P2.X), P2.Y, Max(P1.X, P2.X) + 1, P2.Y + 1); + end; + + function GetLineXOffset(const R, R1: TRect): Integer; + begin + Result := Min(Abs(R.Right - R1.Left), Abs(R1.Right - R.Left)); + if Result > LinkLineOffset then + Result := LinkLineOffset; + end; + + procedure AddLine(const P1, P2: TPoint; var ALineNumber: Integer); + begin + if ALineNumber >= Length(FLines) then + SetLength(FLines, ALineNumber + 1); + FLines[ALineNumber] := GetValidRect(P1, P2); + Inc(ALineNumber); + end; + + procedure InitializePoints(var AStart, AFinish: TPoint; var ALineNumber: Integer); + var + AOffset: Integer; + P: TPoint; + R: TRect; + begin + R := AStartRect; + P := GetStartPoint(AStartRect); + AOffset := GetLineXOffset(AStartRect, AFinishRect); + InflateRect(AStartRect, AOffset, AOffset); + AStart := GetStartPoint(AStartRect); + AddLine(P, AStart, ALineNumber); + P := GetFinishPoint(R, AFinishRect); + if (Relation = trFinishToStart) and (AFinishRect.Left >= R.Right) then + InflateRect(AFinishRect, 0, 2 * LinkLineOffset) + else + InflateRect(AFinishRect, 2 * LinkLineOffset, 0); + AFinish := GetFinishPoint(R, AFinishRect); + AddLine(AFinish, P, ALineNumber); + CalculateArrowRect(AFinish, P); + end; + + function GetNextPoint(var APoint: TPoint; AFinishPoint: TPoint; + AXOffset: Integer; var ALineNumber: Integer): Boolean; + var + P: TPoint; + R: TRect; + begin + Result := True; + P := APoint; + P.X := APoint.X + AXOffset; + if cxRectIntersect(R, AStartRect, GetValidRect(APoint, P)) and + (R.Right - R.Left > 1) then + begin + P := APoint; + Result := P.Y <> AFinishPoint.Y; + if Relation in [trFinishToFinish, trStartToStart] then + P.Y := AFinishPoint.Y + else + if AFinishPoint.Y > P.Y then + P.Y := AStartRect.Bottom + 1 + else + P.Y := AStartRect.Top - 1; + end; + AddLine(APoint, P, ALineNumber); + APoint := P; + end; + +var + AFinishPoint: TPoint; + ALineNumber: Integer; + P: TPoint; +begin + ALineNumber := 0; + SetLength(FLines, 10); + InitializePoints(P, AFinishPoint, ALineNumber); + while GetNextPoint(P, AFinishPoint, AFinishPoint.X - P.X, ALineNumber) and + (P.X <> AFinishPoint.X) do ; + AddLine(P, AFinishPoint, ALineNumber); + SetLength(FLines, ALineNumber); +end; + +procedure TcxSchedulerGanttViewLinkViewInfo.CalculateArrowRect( + const AArrowStart, AArrowFinish: TPoint); +begin + FArrowDirection := GetArrowDirection(AArrowStart, AArrowFinish); + case ArrowDirection of + adUp: + FArrowRect := Rect(AArrowStart.X - LinkLineOffset + 1, AArrowFinish.Y, + AArrowStart.X + LinkLineOffset, AArrowStart.Y - LinkLineOffset); + adDown: + FArrowRect := Rect(AArrowStart.X - LinkLineOffset + 1, + AArrowStart.Y + LinkLineOffset, AArrowStart.X + LinkLineOffset, + AArrowFinish.Y); + adLeft: + FArrowRect := Rect(AArrowFinish.X, AArrowStart.Y - LinkLineOffset, + AArrowStart.X - LinkLineOffset, AArrowFinish.Y + LinkLineOffset); + adRight: + FArrowRect := Rect(AArrowStart.X + LinkLineOffset, + AArrowFinish.Y - LinkLineOffset, AArrowFinish.X, AArrowFinish.Y + LinkLineOffset); + end; +end; + +procedure TcxSchedulerGanttViewLinkViewInfo.CalculateBounds; +var + R: TRect; + K, I: Integer; + ALines: TcxSchedulerGanttViewLinkLines; +begin + FClipRect := ViewInfo.GetEventClipRect(StartEventViewInfo); + K := 0; + SetLength(ALines, Length(FLines)); + for I := 0 to High(Lines) do + if cxRectIntersect(R, FLines[I], FClipRect) then + begin + ALines[K] := R; + Inc(K); + end; + SetLength(ALines, K); + FLines := ALines; + R := ArrowRect; + for I := 0 to High(Lines) do + R := cxRectUnion(R, Lines[I]); + InflateRect(R, 3, 3); // todo: valid redraw after hot link + FBounds := R; +end; + +function TcxSchedulerGanttViewLinkViewInfo.GetArrowDirection( + const AArrowStart, AArrowFinish: TPoint): TcxArrowDirection; +begin + if AArrowStart.X = AArrowFinish.X then + if AArrowStart.Y > AArrowFinish.Y then + Result := adUp + else + Result := adDown + else + if AArrowStart.X > AArrowFinish.X then + Result := adLeft + else + Result := adRight; +end; + +function TcxSchedulerGanttViewLinkViewInfo.GetFinishPoint( + const AStartRect, AFinishRect: TRect): TPoint; +begin + Result.Y := (AFinishRect.Bottom + AFinishRect.Top) div 2; + case Relation of + trFinishToStart, trStartToStart: + begin + Result.X := AFinishRect.Left; + if (Relation = trFinishToStart) and (AStartRect.Right <= AFinishRect.Left) then + if AStartRect.Top >= Result.Y then + Result.Y := AFinishRect.Bottom + else + Result.Y := AFinishRect.Top; + end; + + trFinishToFinish, trStartToFinish: + Result.X := AFinishRect.Right; + end; +end; + +function TcxSchedulerGanttViewLinkViewInfo.GetHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest; var ABreak: Boolean): Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to Length(FLines) - 1 do + begin + Result := PtInRect(cxRectInflate(FLines[I], 1, 1), AHitTest.HitPoint); + if Result then + begin + with TcxSchedulerGanttViewHitTest(AHitTest) do + begin + SetBitState(htcLink, True); + FHitObject := Self; + ABreak := True; + end; + Break; + end; + end; +end; + +function TcxSchedulerGanttViewLinkViewInfo.GetIsHot: Boolean; +begin + Result := ViewInfo.HotLink = Self; +end; + +function TcxSchedulerGanttViewLinkViewInfo.GetStartPoint( + const AStartRect: TRect): TPoint; +begin + Result.Y := (AStartRect.Bottom + AStartRect.Top) div 2; + Result.X := AStartRect.Right; + if Relation in [trStartToStart, trStartToFinish] then + Result.X := AStartRect.Left; +end; + +function TcxSchedulerGanttViewLinkViewInfo.GetRelation: TcxSchedulerEventRelation; +begin + Result := EventItemLink.Relation; +end; + +procedure TcxSchedulerGanttViewLinkViewInfo.SetClipRegion(ACanvas: TcxCanvas); +var + I: Integer; +begin + ACanvas.SetClipRegion(TcxRegion.Create(ClipRect), roSet); + for I := 0 to ViewInfo.NavigationButtons.Count - 1 do + with ViewInfo.NavigationButtons.Items[I] do + ACanvas.SetClipRegion(TcxRegion.Create(Bounds), roSubtract); + ACanvas.ExcludeClipRect(StartEventViewInfo.Bounds); + ACanvas.ExcludeClipRect(FinishEventViewInfo.Bounds); +end; + +procedure TcxSchedulerGanttViewLinkViewInfo.Draw(ACanvas: TcxCanvas); + + function CheckRect(const R: TRect): TRect; + begin + Result := R; + if IsHot then + InflateRect(Result, 1, 1); + end; + +var + AArrowPoints: TcxArrowPoints; + I: Integer; +begin + ACanvas.SaveClipRegion; + try + SetClipRegion(ACanvas); + TcxCustomLookAndFeelPainter.CalculateArrowPoints(CheckRect(ArrowRect), + AArrowPoints, ArrowDirection, True, LinkLineOffset + Byte(IsHot) * 2); + ACanvas.Polygon(AArrowPoints); + for I := 0 to Length(FLines) - 1 do + ACanvas.FillRect(CheckRect(FLines[I])); + finally + ACanvas.RestoreClipRegion; + end; +end; + +{ TcxSchedulerGanttViewPainter } + +procedure TcxSchedulerGanttViewPainter.DoDrawExpandButton( + AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); +begin + // nothing to do +end; + +procedure TcxSchedulerGanttViewPainter.DoDrawLinkItem( + AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); +begin + // nothing to do +end; + +function TcxSchedulerGanttViewPainter.GetView: TcxSchedulerGanttView; +begin + Result := inherited View as TcxSchedulerGanttView; +end; + +function TcxSchedulerGanttViewPainter.GetViewInfo: TcxSchedulerGanttViewViewInfo; +begin + Result := TcxSchedulerGanttViewViewInfo(inherited ViewInfo); +end; + +procedure TcxSchedulerGanttViewPainter.Paint; +begin + inherited Paint; + ViewInfo.Links.Draw(Canvas, DoDrawLinkItem); + ViewInfo.ExpandButtons.Draw(Canvas, DoDrawExpandButton); + if View.ShowTotalProgressLine then + ViewInfo.TotalProgressViewInfo.Draw(Canvas); + View.Controller.EraseDraggingLink; +end; + +{ TcxSchedulerGanttViewHitTest } + +function TcxSchedulerGanttViewHitTest.GetHitAtEventDraggingArea: Boolean; + + function GetEventDraggingArea: TRect; + var + ADragEvent: TcxSchedulerControlEvent; + R: TRect; + begin + Result := cxNullRect; + ADragEvent := View.Controller.DragEvent; + if (View.Controller.DragEventHelper = nil) or (ADragEvent = nil) or (ADragEvent.Source = nil) or + (View = nil) or (View.ViewInfo = nil) then + Exit; + if View.ViewInfo.GetEventBounds(ADragEvent, Resource, R) then + begin + Result := View.ViewInfo.Bounds; + Result.Top := R.Top; + Result.Bottom := R.Bottom; + FCalcEventDraggingArea := True; + end; + end; + +begin + if not FCalcEventDraggingArea then + FEventDraggingArea := GetEventDraggingArea; + Result := PtInRect(FEventDraggingArea, HitPoint); +end; + +function TcxSchedulerGanttViewHitTest.GetHitExpandButton: TcxSchedulerGanttViewExpandButtonViewInfo; +begin + if FHitObject is TcxSchedulerGanttViewExpandButtonViewInfo then + Result := TcxSchedulerGanttViewExpandButtonViewInfo(FHitObject) + else + Result := nil +end; + +function TcxSchedulerGanttViewHitTest.GetHitLink: TcxSchedulerGanttViewLinkViewInfo; +begin + if FHitObject is TcxSchedulerGanttViewLinkViewInfo then + Result := TcxSchedulerGanttViewLinkViewInfo(FHitObject) + else + Result := nil; +end; + +function TcxSchedulerGanttViewHitTest.GetView: TcxSchedulerGanttView; +begin + Result := TcxSchedulerGanttView(inherited Owner); +end; + +{ TcxSchedulerGanttDragObject } + +constructor TcxSchedulerGanttDragObject.Create(AControl: TControl); +begin + inherited Create(AControl); + DragGroupedTaskLinks := True; +end; + +function TcxSchedulerGanttDragObject.GetDragCursor(Accepted: Boolean; X, Y: Integer): TCursor; +const + ACursors: array [Boolean] of TCursor = (crNoDrop, crTaskLink); +var + ACursor: Boolean; +begin + if Controller.EventDragMode <> sedmTaskLinkTo then + Result := inherited GetDragCursor(Accepted, X, Y) + else + begin + ACursor := Controller.DragEvent = nil; + ACursor := not ACursor and (((Controller.HitTest.Resource <> nil) and + (Scheduler.Storage.ResourceCount > 0) and + (Controller.DragEvent.ResourceID = Controller.HitTest.Resource.ResourceID)) or + (Scheduler.Storage.ResourceCount = 0)); + ACursor := ACursor and not ((Controller.HitTest.Event <> nil) and (not Controller.DragEvent.Source.CanLink(Controller.HitTest.Event.Source))); + Result := ACursors[ACursor]; + end; +end; + +function TcxSchedulerGanttDragObject.GetController: TcxSchedulerGanttViewController; +begin + Result := TcxSchedulerGanttViewController(DragEventHelper.Controller); +end; + +{ TcxGanttDragEventHelper } + +procedure TcxGanttDragEventHelper.ApplyChanges; +begin + if Controller.EventDragMode <> sedmTaskLinkTo then + inherited ApplyChanges + else + ApplyTaskLinks; +end; + +procedure TcxGanttDragEventHelper.ApplyTaskLinks; +var + I: Integer; +begin + for I := 0 to Clones.Count - 1 do + InternalApplyTaskLink(TcxSchedulerControlEvent(TcxSchedulerControlEvent(Clones[I]).Source)); +end; + +function TcxGanttDragEventHelper.CanDragTo(ADeltaTime: TDateTime): Boolean; + + function EventInClones(AEvent: TcxSchedulerEvent): TcxSchedulerControlEvent; + var + I: Integer; + begin + Result := nil; + for I := 0 to Clones.Count - 1 do + begin + if AEvent = TcxSchedulerControlEvent(Clones[I].Source).Source then + begin + Result := Clones[I]; + Break; + end; + end; + end; + + function CanMoving(AClone: TcxSchedulerControlEvent): Boolean; + var + AStartTime, AFinishTime: TDateTime; + ANewTime: TDateTime; + I: Integer; + ARelation: TcxSchedulerEventRelation; + begin + Result := (AClone.TaskStatus = tsComplete) or (AClone.TaskLinkOwners.Count = 0); + if not Result then + begin + ANewTime := AClone.Source.Start - ADeltaTime; + for I := 0 to AClone.TaskLinkOwners.Count - 1 do + begin + AStartTime := MinDateTime; + AFinishTime := MaxDateTime; + if not AClone.GetTaskLinkOwnerRelation(AClone.TaskLinkOwners[I], ARelation) then + Continue; + TcxSchedulerEventAccess(AClone).GetValidTaskTimeRangeByRelation(ARelation, AClone.TaskLinkOwners[I], AStartTime, AFinishTime); + if EventInClones(AClone.TaskLinkOwners[I]) <> nil then + begin + if AStartTime <> MinDateTime then + AStartTime := AStartTime - ADeltaTime; + if AFinishTime <> MaxDateTime then + AFinishTime := AFinishTime - ADeltaTime; + end; + Result := (AStartTime <= ANewTime) and (AFinishTime >= (ANewTime + AClone.Duration)); + if not Result then Break; + end; + end; + end; + +var + I: Integer; +begin + Result := True; + for I := 0 to Clones.Count - 1 do + begin + Result := Result and CanMoving(Clones[I]); + if not Result then Break; + end; +end; + +procedure TcxGanttDragEventHelper.DragOver(const P: TPoint; + State: TDragState; var Accepted: Boolean); +var + ADeltaTime: TDateTime; +begin + if Controller.EventDragMode <> sedmTaskLinkTo then + inherited DragOver(P, State, Accepted); + + case Destination of + dodView: + ADeltaTime := Controller.StartDragHitTime - HitTest.Time; + dodDateNavigator: + ADeltaTime := Controller.StartDragHitTime - TcxSchedulerCustomDateNavigatorAccess(DateNavigator).HitTest.Time; + else + ADeltaTime := MinDateTime; + end; + Accepted := (Accepted or HitTest.HitAtExpandButton or HitTest.HitAtLink) and (CanDragTo(ADeltaTime) or + (Controller.EventDragMode = sedmTaskLinkTo)); +end; + +procedure TcxGanttDragEventHelper.InternalApplyTaskLink(AEvent: TcxSchedulerControlEvent); + + function CreateCustom(APattern: TcxSchedulerEvent; ADate: TDateTime): TcxSchedulerEvent; + begin + Result := APattern.GetOccurrence(ADate); + if Result <> nil then + begin + Result.EventType := etCustom; + Result.Post; + end; + end; + +var + AHitEvent, ADragEvent: TcxSchedulerEvent; + AHitEventPattern, ADragEventPattern: TcxSchedulerEvent; + AHitEventDate, ADragEventDate: TDateTime; + ADragEventType: TcxEventType; +begin + if (HitTest.Event <> nil) and (HitTest.Event.Source <> nil) and + not HitTest.Event.IsClone and AEvent.CanLink(HitTest.Event.Source) and + (Scheduler.Storage <> nil) then + begin + Scheduler.Storage.BeginUpdate; + try + AHitEvent := HitTest.Event; + AHitEventDate := AHitEvent.Start; + AHitEventPattern := AHitEvent.Pattern; + ADragEvent := AEvent; + ADragEventType := AEvent.EventType; + ADragEventDate := AEvent.Start; + ADragEventPattern := ADragEvent.Pattern; + if AHitEvent.EventType = etOccurrence then + AHitEvent := CreateCustom(AHitEventPattern, AHitEventDate) + else + AHitEvent := TcxSchedulerControlEvent(AHitEvent).Source; + if ADragEventType = etOccurrence then + ADragEvent := CreateCustom(ADragEventPattern, ADragEventDate); + if ADragEvent <> nil then + ADragEvent.TaskLinks.Add(AHitEvent, trFinishToStart); + finally + Scheduler.Storage.EndUpdate; + end; + end; +end; + +function TcxGanttDragEventHelper.IsAtOrigin: Boolean; +begin + Result := inherited IsAtOrigin and (Controller.EventDragMode <> sedmTaskLinkTo); +end; + +procedure TcxGanttDragEventHelper.PrepareGroupedTaskLinks; + + function GetControlEvent(ASource: TcxSchedulerEvent): TcxSchedulerControlEvent; + var + I: Integer; + begin + Result := nil; + for I := 0 to Events.Count - 1 do + if Events[I].Source = ASource then + begin + Result := Events[I]; + Break; + end; + end; + + procedure AddClones(ALinksHeaderEvent: TcxSchedulerEvent); + var + I: Integer; + AEvent: TcxSchedulerControlEvent; + begin + for I := 0 to ALinksHeaderEvent.TaskLinks.Count - 1 do + begin + if (ALinksHeaderEvent.TaskLinks[I].Link = nil) or + (ALinksHeaderEvent.TaskLinks[I].Link.TaskLinkOwners.Count > 1) then Continue; + AEvent := GetControlEvent(ALinksHeaderEvent.TaskLinks[I].Link); + if AEvent = nil then Continue; + Events.Selection.Add(AEvent, [ssCtrl]); + AddClones(ALinksHeaderEvent.TaskLinks[I].Link); + end; + end; + +var + I: Integer; +begin + if not DragObject.DragGroupedTaskLinks then Exit; + for I := 0 to DragObject.DragEvents.Count - 1 do + if not ViewInfo.IsTaskLinksExpanded(DragObject.DragEvents[I].TaskLinks) then + AddClones(DragObject.DragEvents[I]); + Events.CreateClones; +end; + +procedure TcxGanttDragEventHelper.UpdateViewClonesTime; +var + I: Integer; + ADelta: TDateTime; +begin + ADelta := Controller.StartDragHitTime - HitTest.Time; + if not CanDragTo(ADelta) then + Exit; + for I := 0 to Clones.Count - 1 do + with TcxSchedulerControlEventAccess(Clones[I]) do + InternalMoveTo(Source.Start - ADelta); + CorrectAllDayEventProperty; +end; + +function TcxGanttDragEventHelper.GetController: TcxSchedulerGanttViewController; +begin + Result := TcxSchedulerGanttViewController(inherited Controller); +end; + +function TcxGanttDragEventHelper.GetDragObject: TcxSchedulerGanttDragObject; +begin + Result := TcxSchedulerGanttDragObject(inherited DragObject); +end; + +function TcxGanttDragEventHelper.GetHitTest: TcxSchedulerGanttViewHitTest; +begin + Result := TcxSchedulerGanttViewHitTest(inherited HitTest); +end; + +function TcxGanttDragEventHelper.GetViewInfo: TcxSchedulerGanttViewViewInfo; +begin + Result := TcxSchedulerGanttViewViewInfo(inherited ViewInfo); +end; + +{ TcxGanttEventSizing } + +function TcxGanttEventSizing.CanResize: Boolean; +var + AStartTime, AFinishTime: TDateTime; +begin + TcxSchedulerControlEvent(Event).GetValidTaskTimeRange(AStartTime, AFinishTime); + Result := (HitTest.Time >= AStartTime) and (HitTest.Time < AFinishTime); +end; + +procedure TcxGanttEventSizing.DragOver(const P: TPoint; State: TDragState; var Accepted: Boolean); +begin + inherited DragOver(P, State, Accepted); + FHasConflicts := not Accepted; +end; + +function TcxGanttEventSizing.IsValidTime: Boolean; +begin + Result := inherited IsValidTime and CanResize; +end; + +{ TcxSchedulerGanttViewController } + +procedure TcxSchedulerGanttViewController.CheckScrolling(const APos: TPoint); +var + ACanScroll: Boolean; + AScrollCode: TScrollCode; + R: TRect; +begin + if DragEvent = nil then + begin + inherited CheckScrolling(APos); + Exit; + end; + R := GetDragEventClipRect; + FPos := APos; + ACanScroll := True; + AScrollCode := TScrollCode(Timer.Tag); + if APos.X < (R.Left + cxScrollZoneSize) then + begin + AScrollCode := scLineUp; + R.Right := R.Left + cxScrollZoneSize; + FTimerScrollBarKind := sbHorizontal; + end + else + begin + if APos.X >= (R.Right - cxScrollZoneSize) then + begin + AScrollCode := scLineDown; + R.Left := R.Right - cxScrollZoneSize; + FTimerScrollBarKind := sbHorizontal; + end + else + begin + if APos.Y >= (R.Bottom - cxScrollZoneSize) then + begin + AScrollCode := scLineDown; + R.Top := R.Bottom - cxScrollZoneSize; + FTimerScrollBarKind := sbVertical; + end + else + begin + if APos.Y < (R.Top + cxScrollZoneSize) then + begin + AScrollCode := scLineUp; + R.Bottom := R.Top + cxScrollZoneSize; + FTimerScrollBarKind := sbVertical; + end + else + ACanScroll := False; + end; + end; + end; + ACanScroll := ACanScroll and cxRectPtIn(R, APos); + if (ACanScroll <> Timer.Enabled) or (Integer(AScrollCode) <> Timer.Tag) then + InitTimer(ACanScroll, AScrollCode); +end; + +procedure TcxSchedulerGanttViewController.CheckTaskLinkDrawOnScroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode); +var + ADelta: Integer; +begin + EraseDraggingLink; + if EventDragMode = sedmTaskLinkTo then + begin + ADelta := 0; + case AScrollCode of + scLineDown, scPageDown: + ADelta := -1; + scLineUp, scPageUp: + ADelta := 1; + end; + if ADelta <> 0 then + begin + case AScrollBarKind of + sbHorizontal: + begin + ADelta := ADelta * ViewInfo.FColumnWidth; + Inc(FStartDragPoint.X, ADelta); + end; + sbVertical: + begin + ADelta := ADelta * (ViewInfo.FEventRowHeight); + Inc(FStartDragPoint.Y, ADelta); + end; + end; + end; + end; + PaintDraggingLink(HitTest.HitPoint); +end; + +function TcxSchedulerGanttViewController.ConsiderHiddenEvents: Boolean; +begin + Result := False; +end; + +function TcxSchedulerGanttViewController.CreateDragEventHelper: TcxDragEventHelper; +begin + Result := TcxGanttDragEventHelper.Create(Scheduler); +end; + +function TcxSchedulerGanttViewController.CreateResizeEventHelper: TcxEventSizingHelper; +begin + Result := TcxGanttEventSizing.Create(Scheduler); +end; + +procedure TcxSchedulerGanttViewController.DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); +var + ADragMode: TcxSchedulerEventDragMode; +begin + ADragMode := EventDragMode; + EraseDraggingLink; + UpdateEventDragMode; + inherited DragOver(Source, X, Y, State, Accept); + if ADragMode = sedmTaskLinkTo then + PaintDraggingLink(HitTest.HitPoint); +end; + +procedure TcxSchedulerGanttViewController.EndDrag(Target: TObject; X, Y: Integer); +begin + inherited EndDrag(Target, X, Y); + EraseDraggingLink; + EventDragMode := sedmNone; + HitTest.FCalcEventDraggingArea := False; + HitTest.FEventDraggingArea := cxNullRect; +end; + +procedure TcxSchedulerGanttViewController.EraseDraggingLink; +begin + if EventDragMode <> sedmTaskLinkTo then Exit; + InternalPaintDraggingLink(FStartDragPoint, FPrevDragPoint); + FPrevDragPoint := FStartDragPoint; +end; + +function TcxSchedulerGanttViewController.GetDragEventClipRect: TRect; +begin + Result := FDragEventClipRect; +end; + +function TcxSchedulerGanttViewController.GetLinkHintData(var AHint: string): Boolean; +begin + Result := HitTest.HitAtLink and (HitTest.HitLink <> nil); + if Result then + AHint := HitTest.HitLink.Hint; +end; + +procedure TcxSchedulerGanttViewController.InitTimer(AllowStart: Boolean; AScrollCode: TScrollCode); +begin + inherited InitTimer(AllowStart, AScrollCode); + if not AllowStart then + FPrevDragPoint := FStartDragPoint; +end; + +procedure TcxSchedulerGanttViewController.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + if (Button = mbLeft) and HitTest.HitAtExpandButton then + HitTest.HitExpandButton.DoClick + else + if (Button = mbLeft) and HitTest.HitAtLink then + cxShowTaskDependencyEditor(HitTest.HitLink.FEventItemLink, View.GetSchedulerLookAndFeel(True)) + else + inherited MouseDown(Button, Shift, X, Y); +end; + +procedure TcxSchedulerGanttViewController.OnTimer(Sender: TObject); +begin + inherited OnTimer(Sender); + FPrevDragPoint := FStartDragPoint; +end; + +procedure TcxSchedulerGanttViewController.PaintDraggingLink(const P: TPoint); +begin + if EventDragMode <> sedmTaskLinkTo then Exit; + InternalPaintDraggingLink(FStartDragPoint, P); + FPrevDragPoint := P; +end; + +procedure TcxSchedulerGanttViewController.Scrolling(AScrollCode: TScrollCode; var AScrollPos: Integer); +var + ADelta: Integer; + AResourceIndex: Integer; + ALastScrollPos: Integer; +begin + if FTimerScrollBarKind = sbHorizontal then + begin + CheckTaskLinkDrawOnScroll(FTimerScrollBarKind, AScrollCode); + View.Scroll(FTimerScrollBarKind, AScrollCode, AScrollPos); + end + else + begin + if DragEvent = nil then Exit; + ADelta := 0; + case AScrollCode of + scLineUp: + ADelta := -1; + scLineDown: + ADelta := 1; + end; + if ViewInfo.ResourceCount = 0 then + AResourceIndex := 0 + else + AResourceIndex := DragEvent.GetResourceItem.Index; + if AResourceIndex >= 0 then + begin + ALastScrollPos := AScrollPos; + AScrollPos := -TcxSchedulerTimeGridResourceScrollAccess(ViewInfo.ResourceViewShift[AResourceIndex]).FShift + ADelta; + if (AScrollPos >= 0) and (AScrollPos <= ViewInfo.GetResourceScrollBarMax(AResourceIndex)) then + begin + CheckTaskLinkDrawOnScroll(FTimerScrollBarKind, AScrollCode); + ViewInfo.DoResourceVerticalScroll(ViewInfo.ResourceViewShift[AResourceIndex].ScrollBar, AScrollCode, AScrollPos); + end + else + begin + EraseDraggingLink; + AScrollPos := ALastScrollPos; + end; + end; + end; +end; + +function TcxSchedulerGanttViewController.ShowHint: Boolean; +var + AHintText: string; +begin + Result := GetLinkHintData(AHintText) or GetEventHintData(AHintText); + if Result then + begin + if not SameText(TcxSchedulerHintControllerAccess(HintController).FHintText, + AHintText) + then + InternalHideHint; + InternalShowHint(GetMouseCursorPos, AHintText); + end + else + Result := inherited ShowHint; +end; + +procedure TcxSchedulerGanttViewController.StartDrag(var DragObject: TDragObject); +begin + FEventDragMode := sedmNone; + FStartDragPoint := HitTest.HitPoint; + FPrevDragPoint := FStartDragPoint; + HitTest.FCalcEventDraggingArea := False; + HitTest.FEventDraggingArea := cxNullRect; + CalcDragEventClipRect; + inherited StartDrag(DragObject); + DragEventHelper.PrepareGroupedTaskLinks; +end; + +procedure TcxSchedulerGanttViewController.UpdateDraggingLink(const P: TPoint); +begin + EraseDraggingLink; + PaintDraggingLink(P); +end; + +procedure TcxSchedulerGanttViewController.UpdateEventDragMode; +begin + if (EventDragMode = sedmNone) and not DragEventHelper.IsAtOrigin then + EventDragMode := sedmMoveTo; + if (EventDragMode <> sedmTaskLinkTo) and not IsCopyDragDrop and not HitTest.HitAtEventDraggingArea and + ((EventDragMode = sedmNone) or (HitTest.HitAtEvent and (HitTest.Event.Source <> DragEvent))) then + EventDragMode := sedmTaskLinkTo; +end; + +procedure TcxSchedulerGanttViewController.CalcDragEventClipRect; +var + AViewInfo: TcxSchedulerEventCellViewInfo; +begin + if (DragEvent <> nil) and + ViewInfo.FindEventViewInfoBySource(DragEvent.Source, DateOf(DragEvent.Start), DragEvent.GetResourceItem, AViewInfo) then + FDragEventClipRect := ViewInfo.GetEventClipRect(AViewInfo) + else + FDragEventClipRect := cxEmptyRect; +end; + +function TcxSchedulerGanttViewController.GetDragEventHelper: TcxGanttDragEventHelper; +begin + Result := TcxGanttDragEventHelper(inherited DragEventHelper); +end; + +function TcxSchedulerGanttViewController.GetEventHintData(var AHint: string): Boolean; +var + AEvent: TcxSchedulerControlEvent; +begin + Result := (EventDragMode = sedmNone) and HitTest.HitAtEvent; + if Result then + begin + AEvent := HitTest.Event; + AHint := View.GetEventHintText(AEvent); + TcxCustomSchedulerAccess(Scheduler).GetEventUserHintText(AEvent, AHint); + end; +end; + +function TcxSchedulerGanttViewController.GetHitTest: TcxSchedulerGanttViewHitTest; +begin + Result := View.HitTest; +end; + +function TcxSchedulerGanttViewController.GetView: TcxSchedulerGanttView; +begin + Result := TcxSchedulerGanttView(inherited View); +end; + +function TcxSchedulerGanttViewController.GetViewInfo: TcxSchedulerGanttViewViewInfo; +begin + Result := View.ViewInfo; +end; + +procedure TcxSchedulerGanttViewController.InternalPaintDraggingLink(const AStart, AFinish: TPoint); +begin + if (AStart.X = AFinish.X) and (AStart.Y = AFinish.Y) then + Exit; + with View.GetControlCanvas do + begin + SaveClipRegion; + try + SetClipRegion(TcxRegion.Create(GetDragEventClipRect), roSet); + Pen.Mode := pmNotXor; + Pen.Style := psSolid; + Pen.Color := View.LinkLineColor; + MoveTo(AStart.X, AStart.Y); + LineTo(AFinish.X, AFinish.Y); + finally + RestoreClipRegion; + end; + end; +end; + +procedure TcxSchedulerGanttViewController.SetEventDragMode(AValue: TcxSchedulerEventDragMode); +var + I: Integer; +begin + if AValue = FEventDragMode then Exit; + if AValue = sedmTaskLinkTo then + begin + for I := 0 to DragEventHelper.Clones.Count -1 do + with DragEventHelper.Clones[I] do + begin + MoveTo(Source.Start); + ResourceID := Source.ResourceID; + end; + View.Refresh; + FPrevDragPoint := FStartDragPoint; + end; + FEventDragMode := AValue; +end; + +{ TcxSchedulerGanttViewEventLayoutBuilder } + +procedure TcxSchedulerGanttViewEventLayoutBuilder.Calculate; +var + AEventPlace: TcxSchedulerEventPlace; + AIndex: Integer; + ALastResource: Integer; + I: Integer; + + function FindStartOfRecurrence(AEventPlace: TcxSchedulerEventPlace; + out AIndex: Integer): Boolean; + var + AMin: Integer; + APlace: TcxSchedulerEventPlace; + I: Integer; + begin + Result := False; + if AEventPlace.Event.Pattern <> nil then + begin + AMin := MAXINT; + for I := 0 to EventPlaceCount - 1 do + begin + APlace := EventPlaces[I]; + if (APlace.Event.Pattern = AEventPlace.Event.Pattern) and + (APlace.Event.RecurrenceIndex < AMin) and + (((I > 0) and (APlace.LineStart > 0)) or (I = 0)) then + begin + AMin := APlace.Event.RecurrenceIndex; + Result := APlace <> AEventPlace; + if Result then + AIndex := APlace.LineStart; + end; + end; + end; + end; + + function GetTaskIndex(AEventPlace: TcxSchedulerEventPlace): Integer; + begin + if ALastResource <> Integer(AEventPlace.Resource) then + begin + ALastResource := Integer(AEventPlace.Resource); + AIndex := 0; + end; + if not FindStartOfRecurrence(AEventPlace, AIndex) then + AIndex := Max(AEventPlace.Event.TaskIndex, AIndex); + Result := AIndex; + Inc(AIndex); + end; + +begin + EventPlacesList.Sort(TListSortCompare(@cxGanttViewCompareEventPlaces)); + ALastResource := -1; + AIndex := 0; + for I := 0 to EventPlaceCount - 1 do + begin + AEventPlace := EventPlaces[I]; + AEventPlace.LineStart := GetTaskIndex(AEventPlace); + AEventPlace.LineFinish := AEventPlace.LineStart; + end; +end; + +{ TcxSchedulerGanttViewExpandButtonViewInfo } + +procedure TcxSchedulerGanttViewExpandButtonViewInfo.Draw(ACanvas: TcxCanvas); +begin + Painter.DrawExpandButton(ACanvas, Bounds, Expanded); +end; + +procedure TcxSchedulerGanttViewExpandButtonViewInfo.DoClick; +begin + with Event.TaskLinks do + Expanded := not Expanded; +end; + +procedure TcxSchedulerGanttViewExpandButtonViewInfo.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + inherited InitHitTest(AHitTest); + TcxSchedulerGanttViewHitTest(AHitTest).SetBitState(htcExpandButton, True); +end; + +{ TcxSchedulerGanttViewTotalProgressViewInfo } + +constructor TcxSchedulerGanttViewTotalProgressViewInfo.Create( + AViewInfo: TcxSchedulerGanttViewViewInfo); +begin + FViewInfo := AViewInfo; +end; + +procedure TcxSchedulerGanttViewTotalProgressViewInfo.Calculate; +begin + FDrawAsPolyline := ViewInfo.View.EventsStyle = esProgress; + FLineColor := ViewInfo.View.TotalProgressLineColor; + FTimeLineRect := GetTimeLineRect; + FContentArea := ViewInfo.Bounds; + Inc(FContentArea.Left, ViewInfo.ResourceHeaderWidth); + if DrawAsPolyline then + CalculatePolyline; +end; + +procedure TcxSchedulerGanttViewTotalProgressViewInfo.CalculatePolyline; +var + ANodeIndex: Integer; + APointIndex: Integer; + AVisibleLineCount: Integer; + I: Integer; + R: TRect; + + procedure AddPoint(X, Y: Integer); + begin + FPoints[APointIndex] := Point(X, Y); + Inc(APointIndex); + end; + + procedure AddPointsByResource(const ALine, ABounds: TRect; + AResource: TcxSchedulerStorageResourceItem); + var + APoint: TPoint; + ATop: Integer; + begin + ATop := ABounds.Top; + while ATop < ABounds.Bottom do + begin + AddPoint(ALine.Left, ATop); + Inc(ATop, ViewInfo.IndentBetweenLines); + if GetUncompliteEventPoint(Rect(ALine.Left, ATop, ALine.Right, + ATop + ViewInfo.ContentLineHeight), APoint, AResource) + then + begin + AddPoint(ALine.Left, ATop); + AddPoint(APoint.X, ATop + ViewInfo.ContentLineHeight div 2); + FProgressNodes[ANodeIndex] := Point(APoint.X, + ATop + ViewInfo.ContentLineHeight div 2); + Inc(ANodeIndex); + end; + Inc(ATop, ViewInfo.ContentLineHeight); + end; + AddPoint(ALine.Left, ABounds.Bottom); + end; + +begin + APointIndex := 0; + ANodeIndex := 0; + AVisibleLineCount := (1 + cxRectHeight(ViewInfo.Bounds) div ViewInfo.FEventRowHeight); + SetLength(FPoints, 3 * AVisibleLineCount); + SetLength(FProgressNodes, AVisibleLineCount); + AddPoint(TimeLineRect.Left, TimeLineRect.Top); + if ViewInfo.ResourceCount = 0 then + begin + R := ViewInfo.Bounds; + R.Top := ViewInfo.ScalesHeight; + AddPointsByResource(TimeLineRect, R, nil); + end + else + for I := 0 to ViewInfo.ResourceCount - 1 do + begin + AddPointsByResource(TimeLineRect, ViewInfo.ResourceHeaderCells.Items[I + 1].Bounds, + ViewInfo.Resources[I].ResourceItem); + end; + SetLength(FPoints, APointIndex); + SetLength(FProgressNodes, ANodeIndex); +end; + +procedure TcxSchedulerGanttViewTotalProgressViewInfo.Draw(ACanvas: TcxCanvas); +var + I: Integer; +begin + ACanvas.SaveClipRegion; + try + ACanvas.SetClipRegion(TcxRegion.Create(ContentArea), roSet); + for I := 0 to ViewInfo.NavigationButtons.Count - 1 do + with ViewInfo.NavigationButtons.Items[I] do + ACanvas.SetClipRegion(TcxRegion.Create(Bounds), roSubtract); + for I := 0 to ViewInfo.GroupSeparatorCells.Count - 1 do + ACanvas.ExcludeClipRect(ViewInfo.GroupSeparatorCells.Items[I].Bounds); + if DrawAsPolyline then + begin + ACanvas.Pen.Color := LineColor; + ACanvas.Polyline(FPoints); + DrawProgressNodes(ACanvas); + end + else + ACanvas.FillRect(TimeLineRect, LineColor); + finally + ACanvas.RestoreClipRegion; + end; +end; + +procedure TcxSchedulerGanttViewTotalProgressViewInfo.DrawProgressNodes( + ACanvas: TcxCanvas); +var + I: Integer; + R: TRect; +begin + ACanvas.Brush.Color := LineColor; + for I := 0 to High(FProgressNodes) do + begin + R.TopLeft := FProgressNodes[I]; + R.BottomRight := FProgressNodes[I]; + InflateRect(R, ProgressNodeRadius, ProgressNodeRadius); + ACanvas.Canvas.Ellipse(R); + end; +end; + +function TcxSchedulerGanttViewTotalProgressViewInfo.FindUncompliteEventBeforeLine( + const ALine: TRect; AResource: TcxSchedulerStorageResourceItem; + var AViewInfo: TcxSchedulerEventCellViewInfo): Boolean; +var + AEventViewInfo: TcxSchedulerEventCellViewInfo; + I: Integer; + R: TRect; +begin + Result := False; + for I := 0 to ViewInfo.EventCells.Count - 1 do + begin + AEventViewInfo := TcxSchedulerEventCellViewInfo(ViewInfo.EventCells.Items[I]); + R := AEventViewInfo.Bounds; + if (AResource = nil) or (AResource = AEventViewInfo.ResourceItem) then + if (R.Left <= ALine.Left) and (R.Top >= ALine.Top) and (R.Bottom <= ALine.Bottom) then + if (AEventViewInfo.Event.TaskComplete < 100) and not AEventViewInfo.Hidden then + begin + AViewInfo := AEventViewInfo; + Result := True; + Break; // todo: need find nearest event (not first!) + end; + end; +end; + +function TcxSchedulerGanttViewTotalProgressViewInfo.GetTimeLineApproximateRect: TRect; +var + AVisibleStart: TDateTime; +begin + AVisibleStart := ViewInfo.View.VisibleStart; + if Now > AVisibleStart then + begin + Result := ViewInfo.Bounds; + Inc(Result.Left, ViewInfo.ResourceHeaderWidth); + Inc(Result.Left, Trunc((Now - AVisibleStart) * + (Result.Right - Result.Left) / (ViewInfo.FLastVisibleTime - AVisibleStart))); + Result.Right := Result.Left; + end + else + Result := cxEmptyRect; +end; + +function TcxSchedulerGanttViewTotalProgressViewInfo.GetTimeLineRect: TRect; +var + ACell: TcxSchedulerTimeGridSelectionBarCell; + AItem: TcxSchedulerCustomViewInfoItem; + I: Integer; +begin + Result := cxEmptyRect; + for I := 0 to ViewInfo.TimeLineCells.Count - 1 do + begin + AItem := ViewInfo.TimeLineCells.Items[I]; + if AItem is TcxSchedulerTimeGridSelectionBarCell then + begin + ACell := TcxSchedulerTimeGridSelectionBarCell(AItem); + if ACell.IsCurrentTimeCell then + begin + Result := ACell.TimeLineRect; + Break; + end; + end; + end; + if IsRectEmpty(Result) then + Result := GetTimeLineApproximateRect; +end; + +function TcxSchedulerGanttViewTotalProgressViewInfo.GetUncompliteEventPoint( + const ALine: TRect; var P: TPoint; + AResource: TcxSchedulerStorageResourceItem): Boolean; +var + AEventViewInfo: TcxSchedulerEventCellViewInfo; + R: TRect; +begin + Result := FindUncompliteEventBeforeLine(ALine, AResource, AEventViewInfo); + if Result then + begin + R := cxRectContent(AEventViewInfo.Bounds, + ViewInfo.View.ExternalPainter.Painter.SchedulerEventProgressOffsets); + P := Point(Min(ALine.Left, R.Left + Trunc((R.Right - R.Left) * + AEventViewInfo.Event.TaskComplete / 100)), (ALine.Top + ALine.Bottom) div 2); + end; +end; + +{ TcxSchedulerGanttViewViewInfo } + +constructor TcxSchedulerGanttViewViewInfo.Create(AOwner: TcxSchedulerSubControl); +begin + inherited Create(AOwner); + FExpandButtons := TcxSchedulerViewInfoCellList.Create; + FLinks := TcxSchedulerViewInfoCellList.Create; + FTotalProgressViewInfo := TcxSchedulerGanttViewTotalProgressViewInfo.Create(Self); + FVisibleEventEnumerationList := TcxObjectList.Create; + FCells.Add(FExpandButtons); + FCells.Add(FLinks); +end; + +destructor TcxSchedulerGanttViewViewInfo.Destroy; +begin + FreeAndNil(FTotalProgressViewInfo); + FreeAndNil(FVisibleEventEnumerationList); + inherited Destroy; +end; + +procedure TcxSchedulerGanttViewViewInfo.AddEventForCalculation( + ABuilder: TcxSchedulerEventLayoutBuilder; AEvent: TcxSchedulerControlEvent; + AResourceIndex: Integer); +begin + if not IsEventCollapsed(AEvent, False) then + inherited AddEventForCalculation(ABuilder, AEvent, AResourceIndex); +end; + +procedure TcxSchedulerGanttViewViewInfo.CalculateExpandButtonViewInfos; + + function CalculateButtonBounds(const AEventRect: TRect): TRect; + var + ASize: Integer; + begin + ASize := LookAndFeelPainter.ExpandButtonSize; + Result.Left := AEventRect.Right - ASize; + Result.Top := (AEventRect.Top + AEventRect.Bottom - ASize) div 2; + Result.Bottom := Result.Top + ASize; + Result.Right := AEventRect.Right; + OffsetRect(Result, 3, 0); + end; + +var + AButtonViewInfo: TcxSchedulerGanttViewExpandButtonViewInfo; + AEventCell: TcxSchedulerEventCellViewInfo; + I: Integer; +begin + if not FShowLinks then Exit; + FExpandButtons.Clear; + if View.ShowExpandButtons then + for I := 0 to EventCells.Count - 1 do + begin + AEventCell := TcxSchedulerEventCellViewInfo(EventCells.Items[I]); + if AEventCell.Event.TaskLinks = nil then Continue; + if not AEventCell.Hidden and (AEventCell.Event.NonExceptionLinkCount > 0) then + begin + CreateCellInstance(TcxSchedulerGanttViewExpandButtonViewInfo, + CalculateButtonBounds(AEventCell.Bounds), LinkViewParams, AButtonViewInfo); + AButtonViewInfo.FExpanded := IsTaskLinksExpanded(AEventCell.Event.TaskLinks); + AButtonViewInfo.FEvent := AEventCell.Event; + FExpandButtons.Add(AButtonViewInfo); + end; + end; +end; + +procedure TcxSchedulerGanttViewViewInfo.CalculateHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + if (View.Controller.DragEventHelper <> nil) or + ((View.Controller.DragAndDropObject <> nil) and (View.Controller.DragAndDropObject.SizingHelper <> nil)) or + not (ExpandButtons.CalculateHitTest(AHitTest) or Links.CalculateHitTest(AHitTest)) then + inherited CalculateHitTest(AHitTest); + if GetIsHotTrackEnabled then + HotLink := TcxSchedulerGanttViewHitTest(AHitTest).HitLink + else + HotLink := nil; +end; + +procedure TcxSchedulerGanttViewViewInfo.CheckEventVisibility( + ACell: TcxSchedulerEventCellViewInfo; AIndex: Integer); +begin + if not ACell.Hidden and IsEventCollapsed(ACell.Event, False) then + begin + ACell.Free; + FEventCells.Delete(AIndex); + end; +end; + +procedure TcxSchedulerGanttViewViewInfo.Clear; +begin + inherited Clear; + FVisibleEventEnumerationList.Clear; + FVisibleEventWithoutResourceCount := 0; +end; + +function TcxSchedulerGanttViewViewInfo.CreateEventViewData( + AEvent: TcxSchedulerControlEvent; const ABounds: TRect; const AStart: TDateTime; + const AFinish: TDateTime; AResource: TcxSchedulerResourceViewInfo): TcxSchedulerEventViewData; + + procedure IncreaseVisibleEventCounter; + var + AResourceIndex: Integer; + AResourceFound: Boolean; + begin + AResourceFound := False; + for AResourceIndex := 0 to ResourceCount - 1 do + if AEvent.IsSharedWithResource(VisibleEventEnumerationList[AResourceIndex].ResourceID) then + begin + VisibleEventEnumerationList[AResourceIndex].VisibleEventCount := + VisibleEventEnumerationList[AResourceIndex].VisibleEventCount + 1; + AResourceFound := True; + end; + if not AResourceFound then + Inc(FVisibleEventWithoutResourceCount); + end; + +begin + Result := inherited CreateEventViewData(AEvent, ABounds, AStart, AFinish, AResource); + Result.DrawAsProgress := View.EventsStyle = esProgress; + if (AEvent.Start < FLastVisibleTime) and + (AEvent.Finish > View.VisibleStart) then + IncreaseVisibleEventCounter; +end; + +function TcxSchedulerGanttViewViewInfo.CreateLayoutBuilder: TcxSchedulerEventLayoutBuilder; +begin + Result := TcxSchedulerGanttViewEventLayoutBuilder.Create; +end; + +function TcxSchedulerGanttViewViewInfo.CreateLinkItemViewInfo( + AEventViewInfo: TcxSchedulerEventCellViewInfo; + AEventItemLink: TcxSchedulerEventItemLink; + out ALinkItem: TcxSchedulerGanttViewLinkViewInfo): Boolean; +var + AFinishViewInfo: TcxSchedulerEventCellViewInfo; +begin + Result := AEventItemLink.Link <> nil; + if Result then + begin + Result := FindEventViewInfoBySource(AEventItemLink.Link, AEventItemLink.Link.Start, + AEventViewInfo.ResourceItem, AFinishViewInfo); + if Result then + begin + CreateCellInstance(TcxSchedulerGanttViewLinkViewInfo, AEventViewInfo.Bounds, + AEventViewInfo.Bounds, LinkViewParams, ALinkItem); + ALinkItem.Initialize(Self, AEventViewInfo, AFinishViewInfo, AEventItemLink); + end; + end; +end; + +procedure TcxSchedulerGanttViewViewInfo.CreateLinks; +var + AEventViewInfo: TcxSchedulerEventCellViewInfo; + ALinkItem: TcxSchedulerGanttViewLinkViewInfo; + ALinkIndex: Integer; + ATaskLinks: TcxSchedulerEventLinks; + I: Integer; +begin + if not FShowLinks then Exit; + for I := 0 to EventCells.Count - 1 do + begin + AEventViewInfo := TcxSchedulerEventCellViewInfo(EventCells.Items[I]); + ATaskLinks := AEventViewInfo.Event.TaskLinks; + if (ATaskLinks = nil) or not IsTaskLinksExpanded(ATaskLinks) then Continue; + for ALinkIndex := 0 to ATaskLinks.Count - 1 do + if CreateLinkItemViewInfo(AEventViewInfo, ATaskLinks.ItemLinks[ALinkIndex], + ALinkItem) + then + FLinks.Add(ALinkItem); + end; +end; + +procedure TcxSchedulerGanttViewViewInfo.DoCalculate; +begin + Adapter.GetPageResources(FVisibleEventEnumerationList); + inherited DoCalculate; + CalculateExpandButtonViewInfos; + if View.ShowTotalProgressLine then + TotalProgressViewInfo.Calculate; + RecreateLinks; +end; + +function TcxSchedulerGanttViewViewInfo.FindEventViewInfoBySource( + AEvent: TcxSchedulerEvent; const ADate: TDateTime; + AResource: TcxSchedulerStorageResourceItem; + var AViewInfo: TcxSchedulerEventCellViewInfo): Boolean; +var + ATempViewInfo: TcxSchedulerEventCellViewInfo; + I: Integer; +begin + AViewInfo := nil; + for I := 0 to EventCells.Count - 1 do + begin + ATempViewInfo := TcxSchedulerEventCellViewInfo(EventCells.Items[I]); + if ATempViewInfo.Event.IsOrigin(AEvent) then + if (AResource = nil) or (ATempViewInfo.ResourceItem = AResource) then + begin + AViewInfo := ATempViewInfo; + with TcxSchedulerEventCellViewInfoAccess(ATempViewInfo) do + if (ADate = NullDate) or ((DateOf(ContentStart) = ADate) or + (IsHeaderEvent and (ADate >= DateOf(ContentStart)) and + (ADate < DateOf(ContentFinish)))) + then + Break; + end; + end; + Result := AViewInfo <> nil; +end; + +function TcxSchedulerGanttViewViewInfo.GetEventBounds(AEvent: TcxSchedulerControlEvent; AResource: TcxSchedulerStorageResourceItem; out AEventRect: TRect): Boolean; +var + I: Integer; + ATempViewInfo: TcxSchedulerEventCellViewInfo; +begin + Result := False; + for I := 0 to EventCells.Count - 1 do + begin + ATempViewInfo := TcxSchedulerEventCellViewInfo(EventCells.Items[I]); + Result := (ATempViewInfo.Event = AEvent) and (ATempViewInfo.ResourceItem = AResource); + if Result then + begin + AEventRect := ATempViewInfo.Bounds; + Break; + end; + end; +end; + +function TcxSchedulerGanttViewViewInfo.GetEventForResourceCount( + AResourceIndex: Integer; out AResourceID: Variant): Integer; +var + I: Integer; + AFound: Boolean; +begin + Result := inherited GetEventForResourceCount(AResourceIndex, AResourceID); + AFound := False; + I := 0; + while (I < ResourceCount) and not AFound do + begin + if VarEquals(VisibleEventEnumerationList[I].ResourceID, AResourceID) then + begin + Result := VisibleEventEnumerationList[I].VisibleEventCount; + AFound := True; + end; + Inc(I); + end; +end; + +function TcxSchedulerGanttViewViewInfo.GetEventWithoutResourceCount: Integer; +begin + Result := FVisibleEventWithoutResourceCount; +end; + +function TcxSchedulerGanttViewViewInfo.GetGanttView: TcxSchedulerGanttView; +begin + Result := TcxSchedulerGanttView(inherited View); +end; + +function TcxSchedulerGanttViewViewInfo.GetIndentBetweenLines: Integer; +begin + Result := 3 * LinkLineOffset; +end; + +function TcxSchedulerGanttViewViewInfo.GetNeedShowCurrentTime: Boolean; +begin + Result := not View.ShowTotalProgressLine; +end; + +function TcxSchedulerGanttViewViewInfo.GetIsHotTrackEnabled: Boolean; +begin + Result := View.Scheduler.OptionsBehavior.HotTrack and (View.Controller.EventDragMode = sedmNone); +end; + +function TcxSchedulerGanttViewViewInfo.GetLinkViewParams: TcxViewParams; +begin + Result.Bitmap := nil; + Result.Color := View.LinkLineColor; + Result.Font := Scheduler.Font; + Result.TextColor := View.LinkLineColor; +end; + +function TcxSchedulerGanttViewViewInfo.GetVisibleEventEnumeration( + AIndex: Integer): TcxSchedulerResourceViewInfo; +begin + if (FVisibleEventEnumerationList <> nil) and + (AIndex < FVisibleEventEnumerationList.Count) then + Result := TcxSchedulerResourceViewInfo(FVisibleEventEnumerationList[AIndex]) + else + Result := nil; +end; + +function TcxSchedulerGanttViewViewInfo.HasVisibleEvents: Boolean; +var + AResourceIndex, AEventCount: Integer; +begin + AEventCount := 0; + for AResourceIndex := 0 to ResourceCount - 1 do + Inc(AEventCount, VisibleEventEnumerationList[AResourceIndex].VisibleEventCount); + Result := AEventCount + GetEventWithoutResourceCount <> 0; +end; + +function TcxSchedulerGanttViewViewInfo.IsEventCollapsed(AEvent: TcxSchedulerEvent; + AHidden: Boolean): Boolean; +var + AOwnerEvent: TcxSchedulerEvent; + I: Integer; +begin + Result := AHidden; + if Result or (AEvent.TaskLinkOwners = nil) then Exit; + for I := 0 to AEvent.TaskLinkOwners.Count - 1 do + begin + AOwnerEvent := AEvent.TaskLinkOwners.Items[I]; + Result := IsEventCollapsed(AOwnerEvent, + not IsTaskLinksExpanded(AOwnerEvent.TaskLinks)); + if not Result then + Break; + end; +end; + +function TcxSchedulerGanttViewViewInfo.IsTaskLinksExpanded( + ATaskLinks: TcxSchedulerEventLinks): Boolean; +begin + Result := not View.ShowExpandButtons or ATaskLinks.Expanded; +end; + +function TcxSchedulerGanttViewViewInfo.NavigationButtonOffset( + AKind: TcxSchedulerContentNavigationButtonKind; + AResourceIndex: Integer): Integer; +begin + AResourceIndex := Max(AResourceIndex, 0); + if (AKind = nbkNext) and + (TcxSchedulerTimeGridResourceScroll(ResourceViewShift[AResourceIndex]).ScrollBar <> nil) then + Result := -TcxSchedulerTimeGridResourceScroll(ResourceViewShift[AResourceIndex]).ScrollBar.Width + else + Result := 0; +end; + +procedure TcxSchedulerGanttViewViewInfo.RecreateLinks; +begin + Links.Clear; + CreateLinks; +end; + +procedure TcxSchedulerGanttViewViewInfo.SetHotLink( + AHotLink: TcxSchedulerGanttViewLinkViewInfo); + + function GetRefreshRect(AOldLink, ANewLink: TcxSchedulerGanttViewLinkViewInfo): TRect; + begin + if ANewLink = nil then + Result := AOldLink.ClipRect + else + Result := ANewLink.ClipRect; + end; + +var + AOldLink: TcxSchedulerGanttViewLinkViewInfo; +begin + if HotLink <> AHotLink then + begin + AOldLink := HotLink; + FHotLink := AHotLink; + View.RepaintRect(GetRefreshRect(AOldLink, HotLink)); + end; +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerGoToDateDialog.dfm b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerGoToDateDialog.dfm new file mode 100644 index 00000000..44a9fc1c --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerGoToDateDialog.dfm @@ -0,0 +1,78 @@ +object fmGoToDateForm: TfmGoToDateForm + Left = 160 + Top = 234 + BorderStyle = bsDialog + Caption = 'fmGoToDateForm' + ClientHeight = 90 + ClientWidth = 336 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poMainFormCenter + PixelsPerInch = 96 + TextHeight = 13 + object cxGroupBox1: TcxGroupBox + Left = 8 + Top = 4 + Alignment = alCenterCenter + TabOrder = 0 + Height = 77 + Width = 213 + object lbDate: TLabel + Left = 10 + Top = 20 + Width = 31 + Height = 13 + Caption = 'lbDate' + FocusControl = deDate + Transparent = True + end + object lbShowIn: TLabel + Left = 10 + Top = 48 + Width = 44 + Height = 13 + Caption = 'lbShowIn' + FocusControl = cbShowIn + Transparent = True + end + object deDate: TcxDateEdit + Left = 80 + Top = 16 + Properties.DateButtons = [btnToday] + TabOrder = 0 + Width = 121 + end + object cbShowIn: TcxComboBox + Left = 80 + Top = 44 + Properties.DropDownListStyle = lsFixedList + TabOrder = 1 + Width = 121 + end + end + object btnOk: TcxButton + Left = 232 + Top = 8 + Width = 95 + Height = 25 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TcxButton + Left = 232 + Top = 42 + Width = 95 + Height = 25 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end +end diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerGoToDateDialog.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerGoToDateDialog.pas new file mode 100644 index 00000000..1d2e4570 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerGoToDateDialog.pas @@ -0,0 +1,161 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerGoToDateDialog; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, {$IFDEF DELPHI6} Variants, {$ENDIF} Classes, Graphics, + Controls, Forms, Dialogs, cxLookAndFeelPainters, StdCtrls, cxButtons, cxDropDownEdit, + cxTextEdit, cxMaskEdit, cxCalendar, cxControls, cxContainer, cxEdit, + cxGroupBox, cxSchedulerCustomControls, cxGraphics, Menus; + +type + TfmGoToDateForm = class(TForm) + cxGroupBox1: TcxGroupBox; + lbDate: TLabel; + lbShowIn: TLabel; + deDate: TcxDateEdit; + cbShowIn: TcxComboBox; + btnOk: TcxButton; + btnCancel: TcxButton; + protected + procedure FillCombo(AScheduler: TcxCustomScheduler); + function GetFormColor: TColor; + procedure SetCaptions; + public + constructor CreateEx(AScheduler: TcxCustomScheduler; ADate: TDateTime); virtual; + function GetViewMode: TcxSchedulerViewMode; + function ShowModal: Integer; override; + end; + +implementation + +uses + cxSchedulerStrs, cxDateUtils, cxClasses, cxScheduler, cxSchedulerDialogs; + +{$R *.dfm} + +{ TfmGoToDateForm } + +constructor TfmGoToDateForm.CreateEx(AScheduler: TcxCustomScheduler; ADate: TDateTime); +begin + Create(Application); + if ADate = NullDate then ADate := Date; + deDate.Date := ADate; + SetCaptions; + FillCombo(AScheduler); +end; + +function TfmGoToDateForm.GetViewMode: TcxSchedulerViewMode; +begin + with cbShowIn do + begin + if ItemIndex < 0 then + Result := vmDay + else + Result := TcxSchedulerViewMode(Properties.Items.Objects[ItemIndex]); + end; +end; + +function TfmGoToDateForm.ShowModal: Integer; +begin + if UseSchedulerColorInDialogs then + Color := GetFormColor; + cxDialogsMetricsStore.InitDialog(Self); + Result := inherited ShowModal; + cxDialogsMetricsStore.StoreMetrics(Self); +end; + +procedure TfmGoToDateForm.FillCombo(AScheduler: TcxCustomScheduler); +var + AItemIndex: Integer; +begin + AItemIndex := 0; + with cbShowIn, Properties.Items do + begin + BeginUpdate; + try + if AScheduler is TcxScheduler then + with TcxScheduler(AScheduler) do + begin + if ViewDay.CanShow then + AddObject(cxGetResourceString(@scxDayCalendar), Pointer(0)); + if ViewWeek.CanShow then + begin + AddObject(cxGetResourceString(@scxWeekCalendar), Pointer(1)); + if ViewWeek.Active then AItemIndex := Count - 1; + end; + if ViewWeeks.CanShow then + begin + AddObject(cxGetResourceString(@scxMonthCalendar), Pointer(2)); + if ViewWeeks.Active then AItemIndex := Count - 1; + end; + if ViewDay.CanShow then + AddObject(cxGetResourceString(@scxWorkWeekCalendar), Pointer(3)); + end + else + begin + AddObject(cxGetResourceString(@scxDayCalendar), Pointer(0)); + AddObject(cxGetResourceString(@scxWeekCalendar), Pointer(1)); + AddObject(cxGetResourceString(@scxMonthCalendar), Pointer(2)); + AddObject(cxGetResourceString(@scxWorkWeekCalendar), Pointer(3)); + end; + finally + EndUpdate; + if Count > 0 then ItemIndex := AItemIndex else Enabled := False; + end; + end; +end; + +function TfmGoToDateForm.GetFormColor: TColor; +begin + Result := deDate.Style.LookAndFeel.Painter.DefaultSchedulerControlColor; +end; + +procedure TfmGoToDateForm.SetCaptions; +begin + Caption := cxGetResourceString(@scxGoToDateDialogCaption); + // time + lbDate.Caption := cxGetResourceString(@scxDate); + lbShowIn.Caption := cxGetResourceString(@scxShowIn); + // buttons + btnOk.Caption := cxGetResourceString(@scxOk); + btnCancel.Caption := cxGetResourceString(@scxCancel); +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidays.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidays.pas new file mode 100644 index 00000000..8a9c2ec8 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidays.pas @@ -0,0 +1,1093 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDataController } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDATACONTROLLER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerHolidays; + +{$I cxVer.inc} + +interface + +uses + Messages, Windows, Variants, Classes, cxClasses, Controls, cxControls, + cxDateUtils, cxSchedulerUtils, cxCustomData, SysUtils; + +type + + { TcxSchedulerLocationHoliday } + + TcxSchedulerHolidaysLocations = class; + TcxSchedulerHolidaysLocation = class; + TcxSchedulerHolidaysLocationHoliday = class; + + TcxSchedulerHolidays = class; + + TcxSchedulerHolidaysLocationHoliday = class(TCollectionItem) + private + FDate: TDateTime; + FName: string; + FVisible: Boolean; + function GetIsVisible: Boolean; + function GetLocation: TcxSchedulerHolidaysLocation; + procedure SetDate(const AValue: TDateTime); + procedure SetName(const AValue: string); + procedure SetVisible(AValue: Boolean); + protected + function GetDisplayText: string; virtual; + function IsDateHoliday(const ADate: TDate; AOnlyVisible: Boolean): Boolean; + function IsHolidayInRange(const AStart, AFinish: TDate; AOnlyVisible: Boolean): Boolean; + function ToString: string; virtual; + public + constructor Create(Collection: TCollection); override; + procedure Assign(Source: TPersistent); override; + + property DisplayText: string read GetDisplayText; + property IsVisible: Boolean read GetIsVisible; + property Location: TcxSchedulerHolidaysLocation read GetLocation; + published + property Date: TDateTime read FDate write SetDate; + property Name: string read FName write SetName; + property Visible: Boolean read FVisible write SetVisible default True; + end; + + { TcxSchedulerHolidaysLocation } + + TcxSchedulerHolidaysLocation = class(TCollectionItem) + private + FHolidays: TCollection; + FName: string; + FVisible: Boolean; + function GetCount: Integer; + function GetHoliday(AIndex: Integer): TcxSchedulerHolidaysLocationHoliday; + function GetLocations: TcxSchedulerHolidaysLocations; + procedure SetHoliday(AIndex: Integer; AValue: TcxSchedulerHolidaysLocationHoliday); + procedure SetName(const AValue: string); + procedure SetVisible(AValue: Boolean); + procedure ReadData(AReader: TReader); virtual; + procedure WriteData(AWriter: TWriter); virtual; + protected + procedure DefineProperties(Filer: TFiler); override; + function ToString: string; virtual; + + property HolidaysList: TCollection read FHolidays; + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + + procedure Assign(Source: TPersistent); override; + function AddHoliday(const AName: string; const ADate: TDateTime): TcxSchedulerHolidaysLocationHoliday; overload; virtual; + procedure Clear; + procedure Delete(AIndex: Integer); + function PopulateHolidayDates(const AName: string; var AList: TcxSchedulerDateList): Boolean; + function Find(const AName: string; const ADate: TDateTime): TcxSchedulerHolidaysLocationHoliday; overload; virtual; + procedure Sort(ASortOrder: TcxDataSortOrder; ASortByDate: Boolean); + + property Count: Integer read GetCount; + property Holidays[AIndex: Integer]: TcxSchedulerHolidaysLocationHoliday read GetHoliday write SetHoliday; default; + property Locations: TcxSchedulerHolidaysLocations read GetLocations; + published + property Name: string read FName write SetName; + property Visible: Boolean read FVisible write SetVisible default False; + end; + + { TcxSchedulerHolidaysLocations } + + TcxSchedulerHolidaysLocations = class(TCollection) + private + FOwner: TcxSchedulerHolidays; + function GetItem(AIndex: Integer): TcxSchedulerHolidaysLocation; + function GetOwnerHolidays: TcxSchedulerHolidays; + procedure SetItem(AIndex: Integer; AValue: TcxSchedulerHolidaysLocation); + protected + function GetOwner: TPersistent; override; + procedure Update(Item: TCollectionItem); override; + public + constructor Create(AOwner: TcxSchedulerHolidays); reintroduce; overload; + destructor Destroy; override; + + procedure Assign(Source: TPersistent); override; + function Add(const AName: string): TcxSchedulerHolidaysLocation; + function GetLocationByName(const AName: string): TcxSchedulerHolidaysLocation; + procedure Sort(ASortOrder: TcxDataSortOrder); + + property Items[AIndex: Integer]: TcxSchedulerHolidaysLocation read GetItem write SetItem; default; + property OwnerHolidays: TcxSchedulerHolidays read GetOwnerHolidays; + end; + + { IcxSchedulerHolidaysListener } + + IcxSchedulerHolidaysListener = interface + ['{0FE58B1C-71C0-4ED0-9A10-12074CE13EA3}'] + procedure HolidaysChanged(Sender: TObject); + procedure HolidaysRemoved(Sender: TObject); + end; + + { TcxSchedulerHolidays } + + TcxSchedulerHolidaysImportExportHolidayEvent = procedure (ASender: TcxSchedulerHolidays; + AHoliday: TcxSchedulerHolidaysLocationHoliday; var Accept: Boolean) of object; + TcxSchedulerHolidaysImportUnknownDateEvent = procedure (ASender: TcxSchedulerHolidays; + var AYear, AMonth, ADay: Word; const ATypeCalendar: Word; var Accept: Boolean) of object; + + TcxSchedulerHolidays = class(TComponent) + private + FLocations: TcxSchedulerHolidaysLocations; + FLockCount: Integer; + FListeners: TInterfaceList; + FOnExportHoliday: TcxSchedulerHolidaysImportExportHolidayEvent; + FOnImportHoliday: TcxSchedulerHolidaysImportExportHolidayEvent; + FOnImportUnknownDate: TcxSchedulerHolidaysImportUnknownDateEvent; + function GetCount: Integer; + function GetItem(AIndex: Integer): TcxSchedulerHolidaysLocationHoliday; + function GetIsDestroying: Boolean; + function GetIsLoading: Boolean; + function GetIsUpdatingMode: Boolean; + procedure GetHolidaysIndex(AIndex: Integer; out ALocationIndex, AHolidayIndex: Integer); + function GetStringPart(const S: string; var APos: Integer; ACheckDateSeparator: Boolean = True): string; + procedure SetLocations(const AValue: TcxSchedulerHolidaysLocations); + protected + procedure Changed; virtual; + function CheckStreamFormat(AStream: TStream): Boolean; virtual; + function DoExportHoliday(AHoliday: TcxSchedulerHolidaysLocationHoliday): Boolean; virtual; + function DoImportHoliday(AHoliday: TcxSchedulerHolidaysLocationHoliday): Boolean; virtual; + function DoImportUnknownDate(var AYear, AMonth, ADay: Word; + const ATypeCalendar: Word): Boolean; virtual; + procedure SendNotification(AIsRemoved: Boolean = False); virtual; + function TryCreateFromStream(AStream: TStream; + out ALocations: TcxSchedulerHolidaysLocations): Boolean; virtual; + function TryStringToHoliday(const S: string; ALocation: TcxSchedulerHolidaysLocation): Boolean; + function TryStringToLocation(const S: string; ALocations: TcxSchedulerHolidaysLocations): Boolean; + function TryStrToIntW(const S: string; out AValue: Word): Boolean; + + property IsDestroying: Boolean read GetIsDestroying; + property IsLoading: Boolean read GetIsLoading; + property IsUpdatingMode: Boolean read GetIsUpdatingMode; + property Listeners: TInterfaceList read FListeners; + property LockCount: Integer read FLockCount write FLockCount; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + function AddHoliday(const ALocationName, AHolidayName: string; const ADate: TDateTime): TcxSchedulerHolidaysLocationHoliday; + procedure AddListener(AListener: IcxSchedulerHolidaysListener); + function AddLocation(const AName: string): TcxSchedulerHolidaysLocation; overload; virtual; + procedure Assign(Source: TPersistent); override; + procedure BeginUpdate; + procedure Clear; virtual; + procedure EndUpdate; + function GetHolidayNamesByDate(const ADate: TDate; + var ANames: string; AOnlyVisible: Boolean = True): Boolean; virtual; + procedure LoadFromFile(const AFileName: string); virtual; + procedure LoadFromStream(AStream: TStream); virtual; + procedure PopulateHolidayDates(AList: TcxSchedulerDateList; const AStart, AFinish: TDate; + AOnlyVisible: Boolean = True; AClearList: Boolean = True); virtual; + procedure RemoveListener(AListener: IcxSchedulerHolidaysListener); + procedure SaveToFile(const AFileName: string); virtual; + procedure SaveToStream(var AStream: TStream); virtual; + + property Count: Integer read GetCount; + property Items[AIndex: Integer]: TcxSchedulerHolidaysLocationHoliday read GetItem; default; + published + property Locations: TcxSchedulerHolidaysLocations read + FLocations write SetLocations; + property OnExportHoliday: TcxSchedulerHolidaysImportExportHolidayEvent + read FOnExportHoliday write FOnExportHoliday; + property OnImportHoliday: TcxSchedulerHolidaysImportExportHolidayEvent + read FOnImportHoliday write FOnImportHoliday; + property OnImportUnknownDate: TcxSchedulerHolidaysImportUnknownDateEvent + read FOnImportUnknownDate write FOnImportUnknownDate; + end; + +implementation + +uses + DateUtils, cxSchedulerStrs; + +type + TcxSchedulerHolidaysCollection = class(TCollection) + private + FOwner: TPersistent; + protected + function GetOwner: TPersistent; override; + public + procedure Assign(Source: TPersistent); override; + end; + +const + CRLF = #13#10; + cxDateSeparator = '/'; + cxUnicodePrefix = #$FF#$FE; + + cxStartLocationName = '['; + cxStopLocationName = ']'; + cxDateFormat = 'yyyy/MM/dd'; + + cxSeparatorHolidayPart = ','; + cxHolidaysFormat: TFormatSettings = (DateSeparator: cxDateSeparator; ShortDateFormat: 'yyyy/MM/dd'); + +{ TcxSchedulerHolidaysCollection } + +procedure TcxSchedulerHolidaysCollection.Assign(Source: TPersistent); +var + I: Integer; +begin + if Source is TcxSchedulerHolidaysCollection then + with TcxSchedulerHolidaysCollection(Source) do + begin + Self.BeginUpdate; + try + Self.Clear; + for I := 0 to Count - 1 do + Self.Add.Assign(Items[I]); + finally + Self.EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +function TcxSchedulerHolidaysCollection.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +function cxCompareHolidays( + AItem1, AItem2: TcxSchedulerHolidaysLocationHoliday): Integer; +begin + Result := AnsiCompareText(AItem1.Name, AItem2.Name) +end; + +function cxCompareHolidaysByDate( + AItem1, AItem2: TcxSchedulerHolidaysLocationHoliday): Integer; +begin + Result := 0; + if AItem1.Date <> AItem2.Date then + begin + if AItem1.Date - AItem2.Date > 0 then + Result := 1 + else + Result := -1; + end; +end; + +function cxCompareLocations( + AItem1, AItem2: TcxSchedulerHolidaysLocation): Integer; +begin + Result := AnsiCompareText(AItem1.Name, AItem2.Name); +end; + +procedure SortCollection(ACollection: TCollection; + ACompare: TListSortCompare; AIsAscending: Boolean); +var + I, J, C: Integer; +begin + for I := 0 to ACollection.Count - 1 do + for J := I + 1 to ACollection.Count - 1 do + begin + C := ACompare(ACollection.Items[I], ACollection.Items[J]); + if not AIsAscending then + C := -C; + if C > 0 then + ACollection.Items[J].Index := I; + end; +end; + +{ TcxSchedulerHolidaysLocationHoliday } + +constructor TcxSchedulerHolidaysLocationHoliday.Create(Collection: TCollection); +begin + inherited Create(Collection); + FVisible := True; +end; + +procedure TcxSchedulerHolidaysLocationHoliday.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerHolidaysLocationHoliday then + with Source as TcxSchedulerHolidaysLocationHoliday do + begin + Self.Date := Date; + Self.Name := Name; + Self.Visible := Visible; + Self.Changed(True); + end + else + inherited Assign(Source); +end; + +function TcxSchedulerHolidaysLocationHoliday.GetDisplayText: string; +begin + Result := Name; + if Location <> nil then + Result := Result + ' (' + Location.Name + ')'; +end; + +function TcxSchedulerHolidaysLocationHoliday.IsDateHoliday( + const ADate: TDate; AOnlyVisible: Boolean): Boolean; +begin + Result := (not AOnlyVisible or IsVisible) and (ADate = Date) and (Name <> ''); +end; + +function TcxSchedulerHolidaysLocationHoliday.IsHolidayInRange( + const AStart, AFinish: TDate; AOnlyVisible: Boolean): Boolean; +begin + Result := (not AOnlyVisible or IsVisible) and + (Date >= AStart) and (Date <= AFinish); +end; + +function TcxSchedulerHolidaysLocationHoliday.ToString: string; +begin + Result := Name + ',' + cxDateToStr(Date, cxHolidaysFormat); +end; + +function TcxSchedulerHolidaysLocationHoliday.GetIsVisible: Boolean; +begin + Result := Visible; + if Location <> nil then + Result := Result and Location.Visible; +end; + +function TcxSchedulerHolidaysLocationHoliday.GetLocation: TcxSchedulerHolidaysLocation; +begin + Result := TcxSchedulerHolidaysLocation(Collection.Owner); +end; + +procedure TcxSchedulerHolidaysLocationHoliday.SetDate(const AValue: TDateTime); +begin + if AValue <> FDate then + begin + FDate := AValue; + Changed(True); + end; +end; + +procedure TcxSchedulerHolidaysLocationHoliday.SetName(const AValue: string); +begin + if AValue <> FName then + begin + FName := AValue; + Changed(True); + end; +end; + +procedure TcxSchedulerHolidaysLocationHoliday.SetVisible(AValue: Boolean); +begin + if AValue <> FVisible then + begin + FVisible := AValue; + Changed(True); + end; +end; + +{ TcxSchedulerHolidaysLocation } + +constructor TcxSchedulerHolidaysLocation.Create(Collection: TCollection); +begin + inherited Create(Collection); + FHolidays := TcxSchedulerHolidaysCollection.Create(TcxSchedulerHolidaysLocationHoliday); + TcxSchedulerHolidaysCollection(FHolidays).FOwner := Self; + FVisible := False; +end; + +destructor TcxSchedulerHolidaysLocation.Destroy; +begin + FHolidays.Free; + inherited Destroy; +end; + +procedure TcxSchedulerHolidaysLocation.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerHolidaysLocation then + with Source as TcxSchedulerHolidaysLocation do + begin + Self.Name := Name; + Self.Visible := Visible; + Self.HolidaysList.Assign(HolidaysList); + Self.Changed(True); + end + else + inherited Assign(Source); +end; + +function TcxSchedulerHolidaysLocation.AddHoliday(const AName: string; + const ADate: TDateTime): TcxSchedulerHolidaysLocationHoliday; +begin + Result := HolidaysList.Add as TcxSchedulerHolidaysLocationHoliday; + Result.Name := AName; + Result.Date := ADate; +end; + +procedure TcxSchedulerHolidaysLocation.Clear; +begin + FHolidays.Clear; + Changed(True); +end; + +procedure TcxSchedulerHolidaysLocation.Delete(AIndex: Integer); +begin + FHolidays.Items[AIndex].Free; +end; + +function TcxSchedulerHolidaysLocation.PopulateHolidayDates( + const AName: string; var AList: TcxSchedulerDateList): Boolean; +var + I: Integer; +begin + AList.Clear; + for I := 0 to Count - 1 do + if AnsiCompareText(AName, Holidays[I].Name) = 0 then + AList.Add(Holidays[I].Date); + Result := AList.Count > 0; +end; + +function TcxSchedulerHolidaysLocation.Find( + const AName: string; const ADate: TDateTime): TcxSchedulerHolidaysLocationHoliday; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Holidays[I]; + if (AnsiCompareText(Result.Name, AName) = 0) and (Result.Date = ADate) then + Exit; + end; + Result := nil; +end; + +procedure TcxSchedulerHolidaysLocation.Sort( + ASortOrder: TcxDataSortOrder; ASortByDate: Boolean); +begin + if ASortOrder <> soNone then + begin + if not ASortByDate then + SortCollection(HolidaysList, @cxCompareHolidays, ASortOrder = soAscending) + else + SortCollection(HolidaysList, @cxCompareHolidaysByDate, ASortOrder = soAscending); + end; +end; + +procedure TcxSchedulerHolidaysLocation.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('Holidays', ReadData, WriteData, Count > 0); +end; + +function TcxSchedulerHolidaysLocation.ToString: string; +begin + Result := cxStartLocationName + Name + cxStopLocationName; +end; + +function TcxSchedulerHolidaysLocation.GetCount: Integer; +begin + Result := FHolidays.Count; +end; + +function TcxSchedulerHolidaysLocation.GetHoliday( + AIndex: Integer): TcxSchedulerHolidaysLocationHoliday; +begin + Result := TcxSchedulerHolidaysLocationHoliday(FHolidays.Items[AIndex]); +end; + +function TcxSchedulerHolidaysLocation.GetLocations: TcxSchedulerHolidaysLocations; +begin + Result := TcxSchedulerHolidaysLocations(Collection); +end; + +procedure TcxSchedulerHolidaysLocation.SetHoliday(AIndex: Integer; + AValue: TcxSchedulerHolidaysLocationHoliday); +begin + TcxSchedulerHolidaysLocationHoliday(FHolidays.Items[AIndex]).Assign(AValue); +end; + +procedure TcxSchedulerHolidaysLocation.SetName(const AValue: string); +begin + if FName <> AValue then + begin + FName := AValue; + Changed(True); + end; +end; + +procedure TcxSchedulerHolidaysLocation.SetVisible(AValue: Boolean); +begin + if FVisible <> AValue then + begin + FVisible := AValue; + Changed(True); + end; +end; + +procedure TcxSchedulerHolidaysLocation.ReadData(AReader: TReader); +begin + if AReader.NextValue = vaCollection then + begin + AReader.ReadValue; + AReader.ReadCollection(FHolidays); + end; +end; + +procedure TcxSchedulerHolidaysLocation.WriteData(AWriter: TWriter); +begin + AWriter.WriteCollection(FHolidays); +end; + +{ TcxSchedulerHolidaysLocations } + +constructor TcxSchedulerHolidaysLocations.Create(AOwner: TcxSchedulerHolidays); +begin + inherited Create(TcxSchedulerHolidaysLocation); + FOwner := AOwner; +end; + +destructor TcxSchedulerHolidaysLocations.Destroy; +begin + Clear; + inherited Destroy; +end; + +procedure TcxSchedulerHolidaysLocations.Assign(Source: TPersistent); +var + I: Integer; +begin + if Source is TcxSchedulerHolidaysLocations then + with Source as TcxSchedulerHolidaysLocations do + begin + Self.BeginUpdate; + try + for I := 0 to Count - 1 do + Self.Add(Items[I].Name).Assign(Items[I]); + finally + Self.EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +function TcxSchedulerHolidaysLocations.Add( + const AName: string): TcxSchedulerHolidaysLocation; +begin + Result := TcxSchedulerHolidaysLocation.Create(Self); + Result.Name := AName; +end; + +function TcxSchedulerHolidaysLocations.GetLocationByName( + const AName: string): TcxSchedulerHolidaysLocation; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Items[I]; + if AnsiCompareText(Result.Name, AName) = 0 then + Exit; + end; + Result := nil; +end; + +procedure TcxSchedulerHolidaysLocations.Sort(ASortOrder: TcxDataSortOrder); +begin + SortCollection(Self, @cxCompareLocations, ASortOrder = soAscending); +end; + +function TcxSchedulerHolidaysLocations.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +procedure TcxSchedulerHolidaysLocations.Update(Item: TCollectionItem); +begin + if (OwnerHolidays <> nil) then + OwnerHolidays.Changed; +end; + +function TcxSchedulerHolidaysLocations.GetItem( + AIndex: Integer): TcxSchedulerHolidaysLocation; +begin + Result := TcxSchedulerHolidaysLocation(inherited Items[AIndex]); +end; + +function TcxSchedulerHolidaysLocations.GetOwnerHolidays: TcxSchedulerHolidays; +begin + Result := TcxSchedulerHolidays(GetOwner); +end; + +procedure TcxSchedulerHolidaysLocations.SetItem(AIndex: Integer; + AValue: TcxSchedulerHolidaysLocation); +begin + Items[AIndex].Assign(AValue); +end; + +{ TcxSchedulerHolidays } + +constructor TcxSchedulerHolidays.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FLocations := TcxSchedulerHolidaysLocations.Create(Self); + FListeners := TInterfaceList.Create(); +end; + +destructor TcxSchedulerHolidays.Destroy; +begin + SendNotification(True); + FreeAndNil(FLocations); + FListeners.Free; + inherited Destroy; +end; + +procedure TcxSchedulerHolidays.Changed; +begin + if LockCount = 0 then + SendNotification(); +end; + +function TcxSchedulerHolidays.CheckStreamFormat(AStream: TStream): Boolean; +var + S: string; + APos: Integer; +begin + Result := AStream.Size > Length(cxUnicodePrefix); + APos := AStream.Position; + if Result then + begin + SetLength(S, Length(cxUnicodePrefix)); + AStream.Read(S[1], Length(cxUnicodePrefix)); + Result := S = cxUnicodePrefix; + end; + if not Result then + AStream.Position := APos; +end; + +function TcxSchedulerHolidays.DoExportHoliday( + AHoliday: TcxSchedulerHolidaysLocationHoliday): Boolean; +begin + Result := True; + if Assigned(FOnExportHoliday) then + FOnExportHoliday(Self, AHoliday, Result); +end; + +function TcxSchedulerHolidays.DoImportHoliday( + AHoliday: TcxSchedulerHolidaysLocationHoliday): Boolean; +begin + Result := True; + if Assigned(FOnImportHoliday) then + FOnImportHoliday(Self, AHoliday, Result); +end; + +function TcxSchedulerHolidays.DoImportUnknownDate(var AYear, AMonth, ADay: Word; + const ATypeCalendar: Word): Boolean; +begin + Result := False; + if Assigned(FOnImportUnknownDate) then + FOnImportUnknownDate(Self, AYear, AMonth, ADay, ATypeCalendar, Result); +end; + +function TcxSchedulerHolidays.AddHoliday(const ALocationName, + AHolidayName: string; const ADate: TDateTime): TcxSchedulerHolidaysLocationHoliday; +var + ALocation: TcxSchedulerHolidaysLocation; +begin + Result := nil; + ALocation := Locations.GetLocationByName(ALocationName); + if ALocation <> nil then + Result := ALocation.AddHoliday(AHolidayName, ADate); +end; + +procedure TcxSchedulerHolidays.AddListener(AListener: IcxSchedulerHolidaysListener); +begin + if FListeners.IndexOf(AListener) = -1 then + FListeners.Add(AListener); +end; + +function TcxSchedulerHolidays.AddLocation( + const AName: string): TcxSchedulerHolidaysLocation; +begin + Result := FLocations.Add(AName); +end; + +procedure TcxSchedulerHolidays.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerHolidays then + with Source as TcxSchedulerHolidays do + begin + Self.BeginUpdate; + try + Self.Clear; + Self.Locations := Locations; + finally + Self.EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxSchedulerHolidays.BeginUpdate; +begin + Inc(FLockCount); +end; + +procedure TcxSchedulerHolidays.Clear; +begin + FLocations.Clear; +end; + +procedure TcxSchedulerHolidays.EndUpdate; +begin + Dec(FLockCount); + Changed; +end; + +function TcxSchedulerHolidays.GetHolidayNamesByDate(const ADate: TDate; + var ANames: string; AOnlyVisible: Boolean = True): Boolean; +var + I, J: Integer; + ALocation: TcxSchedulerHolidaysLocation; +begin + for I := 0 to Locations.Count - 1 do + begin + ALocation := Locations[I]; + if AOnlyVisible and not Locations[I].Visible then Continue; + for J := 0 to ALocation.Count - 1 do + begin + if ALocation[J].IsDateHoliday(ADate, AOnlyVisible) then + begin + if Length(ANames) > 0 then + ANames := ANames + CRLF; + ANames := ANames + ALocation[J].DisplayText; + end; + end; + end; + Result := ANames <> ''; +end; + +procedure TcxSchedulerHolidays.LoadFromFile(const AFileName: string); +var + AStream: TStream; +begin + AStream := TFileStream.Create(AFileName, fmOpenRead or fmShareDenyWrite); + try + LoadFromStream(AStream); + finally + FreeAndNil(AStream); + end; +end; + +procedure TcxSchedulerHolidays.LoadFromStream(AStream: TStream); +var + ALocations: TcxSchedulerHolidaysLocations; +begin + if CheckStreamFormat(AStream) and TryCreateFromStream(AStream, ALocations) then + try + ShowHourglassCursor; + try + BeginUpdate; + try + Clear; + Locations := ALocations; + finally + EndUpdate; + end + finally + HideHourglassCursor; + end; + finally + ALocations.Free; + end + else + cxSchedulerError(cxGetResourceString(@scxOutlookFormatMismatch)); +end; + +procedure TcxSchedulerHolidays.PopulateHolidayDates(AList: TcxSchedulerDateList; + const AStart, AFinish: TDate; AOnlyVisible: Boolean = True; AClearList: Boolean = True); +var + I, J: Integer; + ALocation: TcxSchedulerHolidaysLocation; +begin + if AClearList then + AList.Clear; + for I := 0 to Locations.Count - 1 do + begin + ALocation := Locations[I]; + if not ALocation.Visible and AOnlyVisible then Continue; + for J := 0 to ALocation.Count - 1 do + if ALocation.Holidays[J].IsHolidayInRange(AStart, AFinish, AOnlyVisible) then + AList.Add(ALocation.Holidays[J].Date); + end; +end; + +procedure TcxSchedulerHolidays.RemoveListener(AListener: IcxSchedulerHolidaysListener); +begin + FListeners.Remove(AListener); +end; + +procedure TcxSchedulerHolidays.SaveToFile(const AFileName: string); +var + AStream: TStream; +begin + AStream := TFileStream.Create(AFileName, fmCreate or fmOpenWrite); + try + SaveToStream(AStream); + finally + AStream.Free; + end; +end; + +procedure TcxSchedulerHolidays.SaveToStream(var AStream: TStream); +var + I, J: Integer; + ALocation: TcxSchedulerHolidaysLocation; + AExportList: TStringList; + ADataAsString: Widestring; +begin + for I := 0 to Locations.Count - 1 do + begin + ALocation := Locations[I]; + AExportList := TStringList.Create; + try + for J := 0 to ALocation.Count - 1 do + if DoExportHoliday(ALocation.Holidays[J]) then + AExportList.Add(ALocation.Holidays[J].ToString); + if AExportList.Count > 0 then + ADataAsString := ADataAsString + ALocation.ToString + ' ' + + IntToStr(AExportList.Count) + CRLF + AExportList.Text; + finally + AExportList.Free + end; + end; + if Length(ADataAsString) > 0 then + begin + AStream.Write(cxUnicodePrefix[1], Length(cxUnicodePrefix)); + AStream.Write(ADataAsString[1], Length(ADataAsString) * 2); + end; +end; + +procedure TcxSchedulerHolidays.SendNotification(AIsRemoved: Boolean = False); +var + I: Integer; + AIntf: IcxSchedulerHolidaysListener; +begin + for I := Listeners.Count - 1 downto 0 do + if Supports(Listeners[I], IcxSchedulerHolidaysListener, AIntf) then + begin + if AIsRemoved then + AIntf.HolidaysRemoved(Self) + else + if not IsUpdatingMode then + AIntf.HolidaysChanged(Self); + end; +end; + +function TcxSchedulerHolidays.TryCreateFromStream(AStream: TStream; + out ALocations: TcxSchedulerHolidaysLocations): Boolean; +var + I: Integer; + ADataAsText: WideString; + AHolidaysList: TStringList; +begin + Result := True; + ALocations := TcxSchedulerHolidaysLocations.Create(nil); + try + SetLength(ADataAsText, (AStream.Size - AStream.Position) div 2); + AStream.Read(ADataAsText[1], AStream.Size - AStream.Position); + AHolidaysList := TStringList.Create; + try + AHolidaysList.Text := ADataAsText; + for I := 0 to AHolidaysList.Count - 1 do + if TryStringToLocation(AHolidaysList[I], ALocations) or ((ALocations.Count > 0) and + TryStringToHoliday(AHolidaysList[I], ALocations[ALocations.Count - 1])) then + else + Result := False; + finally + AHolidaysList.Free; + end; + except + ALocations.Free; + raise; + end; +end; + +function TcxSchedulerHolidays.TryStringToHoliday( + const S: string; ALocation: TcxSchedulerHolidaysLocation): Boolean; +var + ADate: TDate; + APart, AName: string; + AYear, AMonth, ADay: Word; + ACalendar, ACurPos: Integer; + AHoliday: TcxSchedulerHolidaysLocationHoliday; +begin + Result := (ALocation <> nil) and (S <> ''); + if not Result then + begin + Result := True; + Exit; + end; + ADate := NullDate; + ACalendar := CAL_GREGORIAN; + ACurPos := Length(S); + APart := GetStringPart(S, ACurPos, False); + if Pos(cxDateSeparator, APart) <= 0 then + begin + Result := Result and TryStrToInt(APart, ACalendar); + APart := GetStringPart(S, ACurPos, False); + end; + AName := GetStringPart(S, ACurPos, False); + if ACalendar in [CAL_GREGORIAN, CAL_HIJRI, CAL_HEBREW] then + ADate := cxStrToDate(APart, cxHolidaysFormat, ACalendar) + else + begin + ACurPos := Length(APart); + if not TryStrToIntW(GetStringPart(APart, ACurPos), ADay) or + not TryStrToIntW(GetStringPart(APart, ACurPos), AMonth) or + not TryStrToIntW(GetStringPart(APart, ACurPos), AYear) then + cxSchedulerError(cxGetResourceString(@scxOutlookFormatMismatch)) + else + begin + if DoImportUnknownDate(AYear, AMonth, ADay, ACalendar) then + ADate := EncodeDate(AYear, AMonth, ADay) + end; + end; + if Result then + begin + AHoliday := ALocation.AddHoliday(AName, ADate); + if not DoImportHoliday(AHoliday) then + AHoliday.Free; + end; +end; + +function TcxSchedulerHolidays.TryStringToLocation( + const S: string; ALocations: TcxSchedulerHolidaysLocations): Boolean; +var + AStartPos, AEndPos: Integer; +begin + AStartPos := Pos(cxStartLocationName, S); + AEndPos := Pos(cxStopLocationName, S); + Result := (ALocations <> nil) and (AStartPos > 0) and (AEndPos > AStartPos); + if Result then + Result := ALocations.Add(Copy(S, AStartPos + 1, AEndPos - AStartPos - 1)) <> nil; +end; + +function TcxSchedulerHolidays.TryStrToIntW(const S: string; out AValue: Word): Boolean; +var + I: Integer; +begin + Result := TryStrToInt(S, I); + AValue := I; +end; + +function TcxSchedulerHolidays.GetCount: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Locations.Count - 1 do + Inc(Result, Locations[I].Count); +end; + +function TcxSchedulerHolidays.GetItem(AIndex: Integer): TcxSchedulerHolidaysLocationHoliday; +var + I, J: Integer; +begin + GetHolidaysIndex(AIndex, I, J); + Result := Locations[I].Holidays[J]; +end; + +function TcxSchedulerHolidays.GetIsDestroying: Boolean; +begin + Result := csDestroying in ComponentState; +end; + +function TcxSchedulerHolidays.GetIsLoading: Boolean; +begin + Result := csLoading in ComponentState; +end; + +function TcxSchedulerHolidays.GetIsUpdatingMode: Boolean; +begin + Result := IsDestroying or IsLoading or (LockCount > 0); +end; + +procedure TcxSchedulerHolidays.GetHolidaysIndex(AIndex: Integer; + out ALocationIndex, AHolidayIndex: Integer); +var + I: Integer; + ACount: Integer; +begin + ACount := 0; + for I := 0 to Locations.Count - 1 do + begin + if AIndex < (ACount + Locations[I].Count) then + begin + ALocationIndex := I; + AHolidayIndex := AIndex - ACount; + Break; + end + else + Inc(ACount, Locations[I].Count); + end; +end; + +function TcxSchedulerHolidays.GetStringPart(const S: string; + var APos: Integer; ACheckDateSeparator: Boolean = True): string; +var + L: Integer; + ASeparators: set of Char; +begin + Result := ''; + if ACheckDateSeparator then + ASeparators := [cxDateSeparator, cxSeparatorHolidayPart] + else + ASeparators := [cxSeparatorHolidayPart]; + if (APos > Length(S)) or (APos <= 0) then Exit; + while (APos > 0) and (S[APos] in ASeparators) or (S[APos] = ' ') do Dec(APos); + L := APos; + while (APos > 0) and not (S[APos] in ASeparators) do Dec(APos); + if APos < L then + begin + Result := Copy(S, APos + 1, L - APos); + Dec(APos); + end; +end; + +procedure TcxSchedulerHolidays.SetLocations( + const AValue: TcxSchedulerHolidaysLocations); +begin + BeginUpdate; + try + FLocations.Assign(AValue); + finally + EndUpdate; + end; +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidaysEditor.dfm b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidaysEditor.dfm new file mode 100644 index 00000000..9fc9d896 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidaysEditor.dfm @@ -0,0 +1,214 @@ +object fmHolidaysEditor: TfmHolidaysEditor + Left = 380 + Top = 223 + ActiveControl = clbLocations + BorderStyle = bsDialog + Caption = 'fmHolidaysEditor' + ClientHeight = 414 + ClientWidth = 716 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object btnImport: TcxButton + Left = 8 + Top = 8 + Width = 112 + Height = 23 + Caption = 'btnImport' + TabOrder = 3 + OnClick = btnImportClick + end + object gbAddedHolidays: TcxGroupBox + Left = 8 + Top = 175 + Caption = 'Added holidays' + TabOrder = 7 + Height = 200 + Width = 700 + object lbxAllAddedHolidays: TcxListBox + Left = 8 + Top = 16 + Width = 684 + Height = 174 + Align = alCustom + Anchors = [akLeft, akTop, akRight, akBottom] + ItemHeight = 16 + ListStyle = lbOwnerDrawFixed + ParentFont = False + TabOrder = 0 + end + end + object gbLocations: TcxGroupBox + Left = 8 + Top = 39 + Caption = 'Locations' + Style.TransparentBorder = True + TabOrder = 5 + Height = 130 + Width = 302 + object clbLocations: TcxCheckListBox + Left = 8 + Top = 16 + Width = 195 + Height = 106 + Align = alCustom + AllowDblClickToggle = False + Anchors = [akLeft, akTop, akRight, akBottom] + Items = <> + ParentFont = False + Style.Font.Charset = DEFAULT_CHARSET + Style.Font.Color = clWindowText + Style.Font.Height = -11 + Style.Font.Name = 'Tahoma' + Style.Font.Style = [] + Style.IsFontAssigned = True + TabOrder = 0 + OnClick = clbLocationsClick + OnClickCheck = clbLocationsClickCheck + OnDblClick = clbLocationsDblClick + OnEditValueChanged = clbLocationsClick + OnKeyDown = clbLocationsKeyDown + end + object btnLocationAdd: TcxButton + Left = 209 + Top = 16 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Add' + TabOrder = 1 + OnClick = btnLocationClick + end + object btnLocationEdit: TcxButton + Tag = 1 + Left = 209 + Top = 45 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Edit' + TabOrder = 2 + OnClick = btnLocationClick + end + object btnLocationDelete: TcxButton + Tag = 2 + Left = 209 + Top = 74 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Delete' + TabOrder = 3 + OnClick = btnLocationClick + end + end + object gbHolidays: TcxGroupBox + Left = 318 + Top = 39 + Caption = 'Holidays' + TabOrder = 6 + Height = 130 + Width = 390 + object clbHolidays: TcxCheckListBox + Left = 8 + Top = 16 + Width = 283 + Height = 106 + Align = alCustom + AllowDblClickToggle = False + Anchors = [akLeft, akTop, akRight, akBottom] + EditValueFormat = cvfStatesString + Items = <> + ParentFont = False + Style.Font.Charset = DEFAULT_CHARSET + Style.Font.Color = clWindowText + Style.Font.Height = -11 + Style.Font.Name = 'Tahoma' + Style.Font.Style = [] + Style.IsFontAssigned = True + TabOrder = 0 + OnClickCheck = clbHolidaysClickCheck + OnDblClick = clbHolidaysDblClick + OnKeyDown = clbHolidaysKeyDown + end + object btnHolidaysAdd: TcxButton + Left = 297 + Top = 16 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Add' + TabOrder = 1 + OnClick = btnHolidaysClick + end + object btnHolidaysDelete: TcxButton + Tag = 2 + Left = 297 + Top = 74 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Delete' + TabOrder = 3 + OnClick = btnHolidaysClick + end + object btnHolidaysEdit: TcxButton + Tag = 1 + Left = 297 + Top = 45 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Edit' + TabOrder = 2 + OnClick = btnHolidaysClick + end + end + object btnOk: TcxButton + Left = 443 + Top = 383 + Width = 85 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + OnClick = btnOkClick + end + object btnCancel: TcxButton + Left = 533 + Top = 383 + Width = 85 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + object btnApply: TcxButton + Left = 623 + Top = 383 + Width = 85 + Height = 23 + Caption = 'Apply' + TabOrder = 2 + OnClick = btnApplyClick + end + object btnExport: TcxButton + Left = 128 + Top = 8 + Width = 112 + Height = 23 + Caption = 'btnExport' + TabOrder = 4 + OnClick = btnExportClick + end +end diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidaysEditor.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidaysEditor.pas new file mode 100644 index 00000000..0659e986 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidaysEditor.pas @@ -0,0 +1,622 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDataController } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDATACONTROLLER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerHolidaysEditor; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, Menus, cxLookAndFeelPainters, cxEdit, cxGroupBox, cxListBox, + cxControls, cxContainer, cxCheckListBox, StdCtrls, cxButtons, + cxSchedulerHolidays, cxCheckBox, cxLookAndFeels, cxShellBrowserDialog, cxGraphics, + cxDateUtils; + +type + TfmHolidaysEditor = class(TForm) + btnImport: TcxButton; + gbAddedHolidays: TcxGroupBox; + gbHolidays: TcxGroupBox; + btnHolidaysAdd: TcxButton; + btnHolidaysEdit: TcxButton; + btnHolidaysDelete: TcxButton; + clbHolidays: TcxCheckListBox; + lbxAllAddedHolidays: TcxListBox; + btnOk: TcxButton; + btnCancel: TcxButton; + btnApply: TcxButton; + btnExport: TcxButton; + gbLocations: TcxGroupBox; + clbLocations: TcxCheckListBox; + btnLocationAdd: TcxButton; + btnLocationEdit: TcxButton; + btnLocationDelete: TcxButton; + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure clbLocationsClick(Sender: TObject); + procedure clbLocationsClickCheck(Sender: TObject; AIndex: Integer; + APrevState, ANewState: TcxCheckBoxState); + procedure clbHolidaysClickCheck(Sender: TObject; AIndex: Integer; + APrevState, ANewState: TcxCheckBoxState); + procedure btnImportClick(Sender: TObject); + procedure btnApplyClick(Sender: TObject); + procedure btnLocationClick(Sender: TObject); + procedure btnHolidaysClick(Sender: TObject); + procedure clbLocationsKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure clbHolidaysKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure btnOkClick(Sender: TObject); + procedure clbLocationsDblClick(Sender: TObject); + procedure clbHolidaysDblClick(Sender: TObject); + procedure btnExportClick(Sender: TObject); + private + FHolidays: TcxSchedulerHolidays; + FModify: Boolean; + FOwnerHolidays: TcxSchedulerHolidays; + FSaved: Boolean; + FCalendar: TcxCustomCalendarTable; + procedure CheckHolideyItemIndex; + function GetHolidayIndex: Integer; + procedure SetHolidays(const AValue: TcxSchedulerHolidays); + function GetLocationIndex: Integer; + protected + procedure ChangeHoliday(ANew: Boolean); virtual; + procedure ChangeLocation(ANew: Boolean); virtual; + procedure CheckButtonsState(ACanEnabled: Boolean = True); virtual; + procedure DeleteHoliday; virtual; + procedure DeleteLocation; virtual; + procedure DoExport; virtual; + procedure DoImport; virtual; + procedure InitControls; virtual; + function Save: Boolean; virtual; + procedure SetCaptions; + procedure PopulateLists; + procedure UpdateAddedHolidays; overload; + procedure UpdateAddedHolidays(ALocationIndex: Integer); overload; + procedure UpdateHolidays(ALocationIndex: Integer); + + property HolidayIndex: Integer read GetHolidayIndex; + property LocationIndex: Integer read GetLocationIndex; + public + function ShowModal: Integer; override; + + property Holidays: TcxSchedulerHolidays read FHolidays + write SetHolidays; + property Modify: Boolean read FModify; + property Saved: Boolean read FSaved; + end; + + TcxSchedulerHolidaysEditor = TfmHolidaysEditor; + TcxSchedulerHolidaysEditorClass = class of TcxSchedulerHolidaysEditor; + +implementation + +uses + cxSchedulerStrs, cxClasses, cxSchedulerDialogs, Math, cxSchedulerUtils, + cxCustomData; + +{$R *.dfm} + +type + TcxCollectionAccess = class(TCollection); + +{ TfmHolidaysEditor } + +function TfmHolidaysEditor.ShowModal: Integer; +begin + cxDialogsMetricsStore.InitDialog(Self); + InitControls; + Result := inherited ShowModal; + cxDialogsMetricsStore.StoreMetrics(Self); +end; + +procedure TfmHolidaysEditor.ChangeHoliday(ANew: Boolean); +var + ALocationHoliday: TcxSchedulerHolidaysLocationHoliday; +begin + if (clbLocations.Count = 0) or + (not ANew and (clbHolidays.Count = 0)) then + Exit; + if not ANew then + begin + CheckHolideyItemIndex; + ALocationHoliday := FHolidays.Locations[LocationIndex].Holidays[HolidayIndex]; + end + else + ALocationHoliday := FHolidays.AddHoliday(FHolidays.Locations[LocationIndex].Name, '', Date); + if cxShowHolidaysLocationHolidayEditor(ALocationHoliday, clbLocations.LookAndFeel) then + begin + ALocationHoliday.Location.Sort(soAscending, False); + UpdateHolidays(LocationIndex); + if FHolidays.Locations[LocationIndex].Visible then + UpdateAddedHolidays; + clbHolidays.ItemIndex := ALocationHoliday.Index; + FModify := True; + CheckButtonsState; + end + else + if ANew then + ALocationHoliday.Free; +end; + +procedure TfmHolidaysEditor.ChangeLocation(ANew: Boolean); +var + ALocation: TcxSchedulerHolidaysLocation; +begin + if not ANew and + ((clbLocations.Count = 0) or (LocationIndex < 0) or + (LocationIndex >= clbLocations.Count)) then + Exit; + if not ANew then + ALocation := FHolidays.Locations[LocationIndex] + else + ALocation := TcxSchedulerHolidaysLocation.Create(FHolidays.Locations); + if cxShowHolidaysLocationEditor(ALocation, clbLocations.LookAndFeel) then + begin + FHolidays.Locations.Sort(soAscending); + PopulateLists; + FModify := True; + CheckButtonsState; + clbLocations.ItemIndex := ALocation.Index; + if ANew then + UpdateHolidays(clbLocations.ItemIndex); + end + else + if ANew then + ALocation.Free; +end; + +procedure TfmHolidaysEditor.CheckButtonsState(ACanEnabled: Boolean = True); +begin + btnApply.Enabled := FModify and ACanEnabled;; + btnLocationAdd.Enabled := ACanEnabled; + btnCancel.Enabled := ACanEnabled; + btnExport.Enabled := ACanEnabled; + btnImport.Enabled := ACanEnabled; + clbHolidays.Enabled := ACanEnabled; + clbLocations.Enabled := ACanEnabled; + lbxAllAddedHolidays.Enabled := ACanEnabled; + + if clbLocations.Count > 0 then + begin + btnLocationEdit.Enabled := True and ACanEnabled; + btnLocationDelete.Enabled := True and ACanEnabled; + btnHolidaysAdd.Enabled := True and ACanEnabled; + end + else + begin + btnLocationEdit.Enabled := False; + btnLocationDelete.Enabled := False; + btnHolidaysAdd.Enabled := False; + end; + if clbHolidays.Count > 0 then + begin + btnHolidaysEdit.Enabled := True and ACanEnabled; + btnHolidaysDelete.Enabled := True and ACanEnabled; + end + else + begin + btnHolidaysEdit.Enabled := False; + btnHolidaysDelete.Enabled := False; + end; +end; + +procedure TfmHolidaysEditor.DeleteHoliday; +var + ANeedUpdate: Boolean; + AIndex: Integer; +begin + if (clbHolidays.Count = 0) then + Exit; + CheckHolideyItemIndex; + AIndex := HolidayIndex; + ANeedUpdate := FHolidays.Locations[LocationIndex].Holidays[AIndex].IsVisible; + FHolidays.Locations[LocationIndex].Delete(AIndex); + clbHolidays.DeleteSelected; + if AIndex >= clbHolidays.Count then + AIndex := clbHolidays.Count - 1; + UpdateHolidays(LocationIndex); + clbHolidays.ItemIndex := AIndex; + if ANeedUpdate then + UpdateAddedHolidays; + FModify := True; + CheckButtonsState; +end; + +procedure TfmHolidaysEditor.DeleteLocation; +var + ANeedUpdate: Boolean; + AIndex: Integer; +begin + if (LocationIndex < 0) or + (LocationIndex >= clbLocations.Count) then + Exit; + AIndex := clbLocations.ItemIndex; + FHolidays.Locations.Delete(AIndex); + ANeedUpdate := clbLocations.Items[AIndex].Checked; + clbLocations.DeleteSelected; + if AIndex >= clbLocations.Count then + AIndex := clbLocations.Count - 1; + if clbLocations.Count <> 0 then + begin + clbLocations.ItemIndex := AIndex; + UpdateHolidays(LocationIndex); + end + else + clbHolidays.Clear; + if ANeedUpdate then + UpdateAddedHolidays; + FModify := True; + CheckButtonsState; +end; + +procedure TfmHolidaysEditor.DoExport; +var + AExportDialog: TSaveDialog; +begin + AExportDialog := TSaveDialog.Create(Self); + try + AExportDialog.Filter := '(*.hol)|*.hol'; + AExportDialog.DefaultExt := '*.hol'; + if AExportDialog.Execute then + begin + Cursor := crHourGlass; + CheckButtonsState(False); + try + FHolidays.SaveToFile(AExportDialog.FileName); + finally + Cursor := crDefault; + CheckButtonsState; + end; + end; + finally + FreeAndNil(AExportDialog); + end; +end; + +procedure TfmHolidaysEditor.DoImport; +var + AImportDialog: TOpenDialog; +begin + AImportDialog := TOpenDialog.Create(Self); + try + AImportDialog.Filter := '(*.hol)|*.hol'; + if AImportDialog.Execute then + begin + CheckButtonsState(False); + Cursor := crHourGlass; + try + clbLocations.Clear; + clbHolidays.Clear; + lbxAllAddedHolidays.Clear; + FHolidays.Clear; + FHolidays.LoadFromFile(AImportDialog.FileName); + FHolidays.Locations.Sort(soAscending); + PopulateLists; + FModify := True; + finally + Cursor := crDefault; + CheckButtonsState; + end; + end; + finally + FreeAndNil(AImportDialog); + end; +end; + +procedure TfmHolidaysEditor.InitControls; +begin + if UseSchedulerColorInDialogs then + Color := btnCancel.LookAndFeel.Painter.DefaultSchedulerControlColor; + SetCaptions; + PopulateLists; + clbLocations.ItemIndex := 0; + lbxAllAddedHolidays.ItemIndex := 0; + UpdateHolidays(0); + clbHolidays.ItemIndex := 0; + FModify := False; + CheckButtonsState; +end; + +function TfmHolidaysEditor.Save: Boolean; +begin + Result := False; + if not FModify or (FOwnerHolidays = nil) then + Exit; + FOwnerHolidays.Assign(FHolidays); + FSaved := True; + FModify := False; + Result := True; +end; + +procedure TfmHolidaysEditor.SetCaptions; +begin + Caption := cxGetResourceString(@scxHolidaysEditorCaption); + btnCancel.Caption := cxGetResourceString(@scxCancel); + btnOk.Caption := cxGetResourceString(@scxOk); + btnApply.Caption := cxGetResourceString(@scxApply); + btnImport.Caption := cxGetResourceString(@scxImport); + btnExport.Caption := cxGetResourceString(@scxExport); + + btnLocationAdd.Caption := cxGetResourceString(@scxAdd1); + btnLocationEdit.Caption := cxGetResourceString(@scxEdit1); + btnLocationDelete.Caption := cxGetResourceString(@scxDelete1); + + btnHolidaysAdd.Caption := cxGetResourceString(@scxAdd1); + btnHolidaysEdit.Caption := cxGetResourceString(@scxEdit1); + btnHolidaysDelete.Caption := cxGetResourceString(@scxDelete1); + + gbLocations.Caption := cxGetResourceString(@scxLocationsGroupBox); + gbHolidays.Caption := cxGetResourceString(@scxHolidaysGroupBox); + gbAddedHolidays.Caption := cxGetResourceString(@scxAddedHolidaysGroupBox); +end; + +procedure TfmHolidaysEditor.PopulateLists; +var + I: Integer; + AChecked: Boolean; +begin + clbLocations.Items.BeginUpdate; + lbxAllAddedHolidays.Items.BeginUpdate; + try + clbLocations.Clear; + lbxAllAddedHolidays.Clear; + if FHolidays.Locations.Count = 0 then + Exit; + for I := 0 to FHolidays.Locations.Count - 1 do + begin + with clbLocations.Items.Add do + begin + Text := FHolidays.Locations[I].Name; + ItemObject := FHolidays.Locations[I]; + end; + AChecked := FHolidays.Locations[I].Visible; + clbLocations.Items[I].Checked := AChecked; + if AChecked then + UpdateAddedHolidays(I); + end; + finally + clbLocations.Items.EndUpdate; + lbxAllAddedHolidays.Items.EndUpdate; + end; +end; + +procedure TfmHolidaysEditor.UpdateAddedHolidays; +var + I: Integer; +begin + lbxAllAddedHolidays.Items.BeginUpdate; + try + lbxAllAddedHolidays.Clear; + for I := 0 to clbLocations.Count - 1 do + if clbLocations.Items[I].Checked then + UpdateAddedHolidays(I); + finally + lbxAllAddedHolidays.Items.EndUpdate; + end; +end; + +procedure TfmHolidaysEditor.UpdateAddedHolidays(ALocationIndex: Integer); +var + I: Integer; +begin + lbxAllAddedHolidays.Items.BeginUpdate; + try + with FHolidays.Locations[ALocationIndex] do + for I := 0 to Count - 1 do + if Holidays[I].Visible then + lbxAllAddedHolidays.AddItem(FHolidays.Locations[ALocationIndex].Name + ' - ' + + Holidays[I].Name + ' ' + cxDateToLocalFormatStr(Holidays[I].Date), Holidays[I]); + finally + lbxAllAddedHolidays.Items.EndUpdate; + end; +end; + +procedure TfmHolidaysEditor.UpdateHolidays(ALocationIndex: Integer); +var + I: Integer; +begin + if (ALocationIndex < 0) or + (ALocationIndex >= clbLocations.Count) then + Exit; + clbHolidays.Items.BeginUpdate; + clbHolidays.Clear; + try + with FHolidays.Locations[ALocationIndex] do + for I := 0 to Count - 1 do + begin + with clbHolidays.Items.Add do + begin + Text := Holidays[I].Name + ' ' + cxDateToLocalFormatStr(Holidays[I].Date); + ItemObject := Holidays[I]; + end; + clbHolidays.Items[I].Checked := Holidays[I].Visible; + end; + finally + clbHolidays.Items.EndUpdate; + end; +end; + +procedure TfmHolidaysEditor.CheckHolideyItemIndex; +begin + clbHolidays.ItemIndex := Max(Min(clbHolidays.Count, HolidayIndex), 0); +end; + +function TfmHolidaysEditor.GetHolidayIndex: Integer; +begin + Result := clbHolidays.ItemIndex; +end; + +procedure TfmHolidaysEditor.SetHolidays(const AValue: TcxSchedulerHolidays); +begin + FHolidays.Assign(AValue); + with FHolidays do + begin + OnExportHoliday := AValue.OnExportHoliday; + OnImportHoliday := AValue.OnImportHoliday; + OnImportUnknownDate := AValue.OnImportUnknownDate; + Locations.Sort(soAscending); + end; + FOwnerHolidays := AValue; +end; + +function TfmHolidaysEditor.GetLocationIndex: Integer; +begin + Result := clbLocations.ItemIndex; +end; + +procedure TfmHolidaysEditor.FormCreate(Sender: TObject); +begin + FHolidays := TcxSchedulerHolidays.Create(nil); + FSaved := False; + FCalendar := cxGetLocalCalendar; +end; + +procedure TfmHolidaysEditor.FormDestroy(Sender: TObject); +begin + FreeAndNil(FHolidays); + FreeAndNil(FCalendar); +end; + +procedure TfmHolidaysEditor.clbLocationsClick(Sender: TObject); +begin + if Visible and (TcxCollectionAccess(clbLocations.Items).UpdateCount = 0) then + UpdateHolidays(LocationIndex); +end; + +procedure TfmHolidaysEditor.clbLocationsClickCheck(Sender: TObject; + AIndex: Integer; APrevState, ANewState: TcxCheckBoxState); +begin + FHolidays.Locations[AIndex].Visible := clbLocations.Items[AIndex].Checked; + UpdateAddedHolidays; + FModify := True; + CheckButtonsState; +end; + +procedure TfmHolidaysEditor.clbHolidaysClickCheck(Sender: TObject; + AIndex: Integer; APrevState, ANewState: TcxCheckBoxState); +begin + FHolidays.Locations[LocationIndex].Holidays[AIndex].Visible := + clbHolidays.Items[AIndex].Checked; + if FHolidays.Locations[LocationIndex].Visible then + UpdateAddedHolidays; + FModify := True; + CheckButtonsState; +end; + +procedure TfmHolidaysEditor.btnImportClick(Sender: TObject); +begin + DoImport; +end; + +procedure TfmHolidaysEditor.btnApplyClick(Sender: TObject); +begin + Save; + CheckButtonsState; +end; + +procedure TfmHolidaysEditor.btnLocationClick(Sender: TObject); +begin + if Sender is TcxButton then + begin + if not (Sender as TcxButton).Enabled then + Exit; + case (Sender as TcxButton).Tag of + 0, 1: // Add, Edit + ChangeLocation((Sender as TcxButton).Tag = 0); + 2: // Delete + DeleteLocation; + end; + end; +end; + +procedure TfmHolidaysEditor.btnHolidaysClick(Sender: TObject); +begin + if Sender is TcxButton then + begin + if not (Sender as TcxButton).Enabled then + Exit; + case (Sender as TcxButton).Tag of + 0, 1: // Add, Edit + ChangeHoliday((Sender as TcxButton).Tag = 0); + 2: // Delete + DeleteHoliday; + end; + end; +end; + +procedure TfmHolidaysEditor.clbLocationsKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + case Key of + VK_RETURN: ChangeLocation(False); + VK_INSERT: ChangeLocation(True); + VK_DELETE: DeleteLocation; + end; +end; + +procedure TfmHolidaysEditor.clbHolidaysKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + case Key of + VK_RETURN: ChangeHoliday(False); + VK_INSERT: ChangeHoliday(True); + VK_DELETE: DeleteHoliday; + end; +end; + +procedure TfmHolidaysEditor.btnOkClick(Sender: TObject); +begin + Save; +end; + +procedure TfmHolidaysEditor.clbLocationsDblClick(Sender: TObject); +begin + btnLocationClick(btnLocationEdit); +end; + +procedure TfmHolidaysEditor.clbHolidaysDblClick(Sender: TObject); +begin + ChangeHoliday(False); +end; + +procedure TfmHolidaysEditor.btnExportClick(Sender: TObject); +begin + DoExport; +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidaysLocationEditor.dfm b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidaysLocationEditor.dfm new file mode 100644 index 00000000..9a5c2668 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidaysLocationEditor.dfm @@ -0,0 +1,52 @@ +object fmHolidaysLocationEditor: TfmHolidaysLocationEditor + Left = 617 + Top = 345 + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'fmHolidaysLocationEditor' + ClientHeight = 68 + ClientWidth = 314 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object lbName: TcxLabel + Left = 6 + Top = 10 + Caption = 'lbName' + end + object teName: TcxTextEdit + Left = 96 + Top = 8 + Properties.OnChange = teLocationPropertiesChange + TabOrder = 1 + Width = 210 + end + object btnOK: TcxButton + Left = 128 + Top = 37 + Width = 85 + Height = 23 + Caption = 'btnOK' + Default = True + ModalResult = 1 + TabOrder = 2 + OnClick = btnOKClick + end + object btnCancel: TcxButton + Left = 221 + Top = 37 + Width = 85 + Height = 23 + Cancel = True + Caption = 'btnCancel' + ModalResult = 2 + TabOrder = 3 + end +end diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidaysLocationEditor.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidaysLocationEditor.pas new file mode 100644 index 00000000..09e6ed01 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidaysLocationEditor.pas @@ -0,0 +1,146 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDataController } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDATACONTROLLER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerHolidaysLocationEditor; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, Menus, cxLookAndFeelPainters, StdCtrls, cxButtons, cxTextEdit, + cxControls, cxContainer, cxEdit, cxLabel, cxSchedulerHolidays, cxLookAndFeels; + +type + TfmHolidaysLocationEditor = class(TForm) + btnOK: TcxButton; + btnCancel: TcxButton; + teName: TcxTextEdit; + lbName: TcxLabel; + procedure FormCreate(Sender: TObject); + procedure teLocationPropertiesChange(Sender: TObject); + procedure btnOKClick(Sender: TObject); + private + FLocation: TcxSchedulerHolidaysLocation; + FModify: Boolean; + procedure SetLocation(const AValue: TcxSchedulerHolidaysLocation); + protected + procedure CheckButtonsState; + procedure InitControls; virtual; + function Save: Boolean; virtual; + procedure SetCaptions; + public + function ShowModal: Integer; override; + + property Location: TcxSchedulerHolidaysLocation read + FLocation write SetLocation; + property Modify: Boolean read FModify; + end; + +implementation + +uses + cxSchedulerStrs, cxClasses, cxSchedulerDialogs, cxSchedulerUtils; + +{$R *.dfm} + +function TfmHolidaysLocationEditor.ShowModal: Integer; +begin + cxDialogsMetricsStore.InitDialog(Self); + InitControls; + CheckButtonsState; + Result := inherited ShowModal; + cxDialogsMetricsStore.StoreMetrics(Self); +end; + +procedure TfmHolidaysLocationEditor.CheckButtonsState; +begin + btnOK.Enabled := FModify and (Length(teName.Text) > 0) and + (FLocation.Locations.GetLocationByName(teName.Text) = nil); +end; + +procedure TfmHolidaysLocationEditor.FormCreate(Sender: TObject); +begin + FModify := False; +end; + +procedure TfmHolidaysLocationEditor.InitControls; +begin + if UseSchedulerColorInDialogs then + Color := btnCancel.LookAndFeel.Painter.DefaultSchedulerControlColor; + SetCaptions; + teName.Text := FLocation.Name; + FModify := False; + CheckButtonsState; +end; + +function TfmHolidaysLocationEditor.Save: Boolean; +begin + Result := False; + if not FModify then + Exit; + Result := True; + FLocation.Name := teName.Text; + FModify := False; + CheckButtonsState; +end; + +procedure TfmHolidaysLocationEditor.SetCaptions; +begin + Caption := cxGetResourceString(@scxHolidaysLocationEditorCaption); + btnCancel.Caption := cxGetResourceString(@scxCancel); + btnOk.Caption := cxGetResourceString(@scxOk); + lbName.Caption := cxGetResourceString(@scxLocationName); +end; + +procedure TfmHolidaysLocationEditor.SetLocation( + const AValue: TcxSchedulerHolidaysLocation); +begin + FLocation := AValue; +end; + +procedure TfmHolidaysLocationEditor.teLocationPropertiesChange( + Sender: TObject); +begin + FModify := True; + CheckButtonsState; +end; + +procedure TfmHolidaysLocationEditor.btnOKClick(Sender: TObject); +begin + Save; +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidaysLocationHolidayEditor.dfm b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidaysLocationHolidayEditor.dfm new file mode 100644 index 00000000..c9cc63eb --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidaysLocationHolidayEditor.dfm @@ -0,0 +1,64 @@ +object fmHolidaysLocationHolidayEditor: TfmHolidaysLocationHolidayEditor + Left = 695 + Top = 316 + ActiveControl = teName + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'fmHolidaysLocationHolidayEditor' + ClientHeight = 97 + ClientWidth = 320 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object lbName: TcxLabel + Left = 6 + Top = 10 + Caption = 'lbName' + end + object teName: TcxTextEdit + Left = 112 + Top = 8 + Properties.OnChange = ValueChange + TabOrder = 1 + Width = 200 + end + object btnOk: TcxButton + Left = 133 + Top = 66 + Width = 85 + Height = 23 + Caption = 'btnOk' + ModalResult = 1 + TabOrder = 3 + OnClick = btnOkClick + end + object btnCancel: TcxButton + Left = 226 + Top = 66 + Width = 85 + Height = 23 + Cancel = True + Caption = 'btnCancel' + ModalResult = 2 + TabOrder = 5 + end + object lbDate: TcxLabel + Left = 6 + Top = 38 + Caption = 'lbDate' + end + object deDate: TcxDateEdit + Left = 112 + Top = 37 + Properties.OnChange = ValueChange + Properties.OnEditValueChanged = ValueChange + TabOrder = 2 + Width = 200 + end +end diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidaysLocationHolidayEditor.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidaysLocationHolidayEditor.pas new file mode 100644 index 00000000..f07e5a15 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerHolidaysLocationHolidayEditor.pas @@ -0,0 +1,148 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressDataController } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSDATACONTROLLER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerHolidaysLocationHolidayEditor; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, cxTextEdit, cxControls, cxContainer, cxEdit, cxLabel, cxCheckBox, + Menus, cxLookAndFeelPainters, StdCtrls, cxButtons, + cxSchedulerHolidays, cxLookAndFeels, cxMaskEdit, cxDropDownEdit, + cxCalendar; + +type + TfmHolidaysLocationHolidayEditor = class(TForm) + lbName: TcxLabel; + teName: TcxTextEdit; + btnOk: TcxButton; + btnCancel: TcxButton; + lbDate: TcxLabel; + deDate: TcxDateEdit; + procedure btnOkClick(Sender: TObject); + procedure ValueChange(Sender: TObject); + private + FLocationHoliday: TcxSchedulerHolidaysLocationHoliday; + procedure SetLocationHoliday(AValue: TcxSchedulerHolidaysLocationHoliday); + protected + procedure CheckButtonsState; + procedure InitControls; virtual; + function Save: Boolean; virtual; + procedure SetCaptions; + public + function ShowModal: Integer; override; + + property LocationHoliday: TcxSchedulerHolidaysLocationHoliday read + FLocationHoliday write SetLocationHoliday; + end; + +implementation + +uses + cxSchedulerStrs, cxClasses, cxSchedulerDialogs, DateUtils, cxSchedulerUtils, + cxDateUtils; + +{$R *.dfm} + +type + TcxDateEditAccess = class(TcxDateEdit); + +{ TfmHolidaysLocationHolidayEditor } + +function TfmHolidaysLocationHolidayEditor.ShowModal: Integer; +begin + cxDialogsMetricsStore.InitDialog(Self); + InitControls; + CheckButtonsState; + Result := inherited ShowModal; + cxDialogsMetricsStore.StoreMetrics(Self); +end; + +procedure TfmHolidaysLocationHolidayEditor.CheckButtonsState; +begin + btnOk.Enabled := (Length(teName.Text) > 0) and + (TcxDateEditAccess(deDate).DisplayValue <> '') and (deDate.Date <> NullDate) and + (LocationHoliday.Location.Find(teName.Text, deDate.Date) = nil); +end; + +procedure TfmHolidaysLocationHolidayEditor.InitControls; +begin + if UseSchedulerColorInDialogs then + Color := btnCancel.LookAndFeel.Painter.DefaultSchedulerControlColor; + SetCaptions; + teName.Text := FLocationHoliday.Name; + deDate.Date := FLocationHoliday.Date; + CheckButtonsState; +end; + +function TfmHolidaysLocationHolidayEditor.Save: Boolean; +begin + Result := True; + with FLocationHoliday do + begin + Name := teName.Text; + Date := deDate.Date; + end; +end; + +procedure TfmHolidaysLocationHolidayEditor.SetCaptions; +begin + Caption := cxGetResourceString(@scxHolidaysLocationHolidayEditorCaption); + btnCancel.Caption := cxGetResourceString(@scxCancel); + btnOk.Caption := cxGetResourceString(@scxOk); + + lbName.Caption := cxGetResourceString(@scxHolidayName); + lbDate.Caption := cxGetResourceString(@scxHolidayDate); +end; + +procedure TfmHolidaysLocationHolidayEditor.SetLocationHoliday( + AValue: TcxSchedulerHolidaysLocationHoliday); +begin + FLocationHoliday := AValue; +end; + +procedure TfmHolidaysLocationHolidayEditor.btnOkClick(Sender: TObject); +begin + Save; +end; + +procedure TfmHolidaysLocationHolidayEditor.ValueChange(Sender: TObject); +begin + CheckButtonsState; +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerOutlookExchange.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerOutlookExchange.pas new file mode 100644 index 00000000..369fa3c8 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerOutlookExchange.pas @@ -0,0 +1,1445 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerOutlookExchange; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + Classes, cxSchedulerStorage, ComObj, cxClasses, cxDateUtils; + +type + TcxSchedulerExchangeProgressProc = procedure(ACurrent, ACount: Integer; var Abort: Boolean); + TcxAcceptEventExportFunc = function(AEvent: TcxSchedulerEvent): Boolean; + TcxAcceptAppointmentItemImportFunc = function(const AppointmentItem: OleVariant): Boolean; + TcxAppointmentItemToEventProc = procedure(const AppointmentItem: OleVariant; AEvent: TcxSchedulerEvent); + TcxEventToAppointmentItemProc = procedure(AEvent: TcxSchedulerEvent; const AppointmentItem: OleVariant); + + { TcxAppointmentInfo } + + TcxAppointmentInfo = class + private + FAppointmentItem: OleVariant; + FEntryID: string; + public + constructor Create(const AAppointmentItem: OleVariant); + + property AppointmentItem: OleVariant read FAppointmentItem; + property EntryID: string read FEntryID; + end; + + { TcxAppointmentEntryIDList } + + TcxAppointmentEntryIDList = class(TcxObjectList) + private + function GetItems(Index: Integer): TcxAppointmentInfo; + public + procedure Add(const AppointmentItem: OleVariant); + function ExtractAppointmentItem(AIndex: Integer): OleVariant; + function FindEntryID(const AEntryID: string; var Index: Integer): Boolean; + function IndexOfEntryID(const AEntryID: string): Integer; + procedure Populate(ACalendarFolder: OleVariant); + + property Items[Index: Integer]: TcxAppointmentInfo read GetItems; default; + end; + + { TcxEventInfo } + + TcxEventInfo = class + private + FEvent: TcxSchedulerEvent; + FEntryID: string; + public + constructor Create(AEvent: TcxSchedulerEvent; AEntryIDField: TcxCustomSchedulerStorageField); + + property Event: TcxSchedulerEvent read FEvent; + property EntryID: string read FEntryID; + end; + + { TcxEventEntryIDList } + + TcxEventEntryIDList = class(TcxObjectList) + private + function GetItems(Index: Integer): TcxEventInfo; + public + procedure Add(AEvent: TcxSchedulerEvent; AEntryIDField: TcxCustomSchedulerStorageField); + procedure DeleteEvent(AEvent: TcxSchedulerEvent); + function ExtractEvent(AIndex: Integer): TcxSchedulerEvent; + function FindEntryID(const AEntryID: string; var Index: Integer): Boolean; + function IndexOfEntryID(const AEntryID: string): Integer; + procedure Populate(AStorage: TcxCustomSchedulerStorage; + AEntryIDField: TcxCustomSchedulerStorageField); + + property Items[Index: Integer]: TcxEventInfo read GetItems; default; + end; + + { TcxOutlookExchange } + + TcxOutlookExchange = class + private + FCalendarFolder: OleVariant; + FOleInitialized: Boolean; + FOutlookApp: OleVariant; + FStorage: TcxCustomSchedulerStorage; + FWasCreated: Boolean; + FOnAcceptAppointmentItem: TcxAcceptAppointmentItemImportFunc; + FOnAcceptEvent: TcxAcceptEventExportFunc; + FOnConvertAppointmentItemToEvent: TcxAppointmentItemToEventProc; + FOnConvertEventToAppointmentItem: TcxEventToAppointmentItemProc; + FOnProgress: TcxSchedulerExchangeProgressProc; + function GetAllDayEvent(const AppointmentItem: OleVariant): Boolean; + function GetDaysOfWeekFromMask(AMask: Integer): TDays; + function GetDayTypeFromMask(AMask: Integer): TcxDayType; + function GetMaskFromDaysOfWeek(ADays: TDays): Integer; + function GetMaskFromDayType(ADayType: TcxDayType): Integer; + protected + function CanAcceptAppointmentItem(const AppointmentItem: OleVariant): Boolean; + function CanAcceptEvent(AEvent: TcxSchedulerEvent): Boolean; + function CanImportAppointmentItem(const AppointmentItem: OleVariant): Boolean; virtual; + procedure ConvertAppointmentItemToEvent(const AppointmentItem: OleVariant; + AEvent: TcxSchedulerEvent); + procedure ConvertEventToAppointmentItem(AEvent: TcxSchedulerEvent; + const AppointmentItem: OleVariant); + procedure ImportRecurrenceChain(APatternEvent: TcxSchedulerEvent; + const ARecurrencePattern: OleVariant); + procedure CheckRecurrencePatternExceptions( + const ARecurrencePattern: OleVariant; + APatternEvent: TcxSchedulerEvent); + procedure ExportRecurrenceChain(APatternEvent: TcxSchedulerEvent; const AppointmentItem: OleVariant); + + function GetIsValid: Boolean; virtual; + function InitOleObject: Boolean; + procedure PostRecurrenceExeption(AOccurrence: TcxSchedulerEvent); virtual; + function RoundTime(ATime: TDateTime; ASaveDate: Boolean): TDateTime; virtual; + procedure SetAppointmentItemRecurrence( + const ARecurrencePattern: OleVariant; AEvent: TcxSchedulerEvent); + procedure SetupAppointmentItemInfo(const AppointmentItem: OleVariant; + const AEvent: TcxSchedulerEvent; ASetTime: Boolean = True); + procedure SetupEventInfo(AEvent: TcxSchedulerEvent; + const AppointmentItem: OleVariant); + procedure SetupEventRecurrenceInfo(AEvent: TcxSchedulerEvent; + const ARecurrencePattern: OleVariant); + procedure UpdateAppointmentItem(const AppointmentItem: OleVariant; + AEvent: TcxSchedulerEvent); virtual; + procedure UpdateEvent(AEvent: TcxSchedulerEvent; + const AppointmentItem: OleVariant; APostData: Boolean = True); virtual; + procedure UpdateEventWithRecurrenceInfo(AEvent: TcxSchedulerEvent; + const AppointmentItem: OleVariant); + function DoProgress(ACurrent, ACount: Integer): Boolean; + + property CalendarFolder: OleVariant read FCalendarFolder; + property IsValid: Boolean read GetIsValid; + property OutlookApp: OleVariant read FOutlookApp; + property Storage: TcxCustomSchedulerStorage read FStorage; + public + constructor Create(AStorage: TcxCustomSchedulerStorage); virtual; + destructor Destroy; override; + procedure ExportEventToOutlook(AEvent: TcxSchedulerEvent); + procedure ExportToOutlook; + procedure ImportAppointmentItemFromOutlook(const AppointmentItem: OleVariant); + procedure ImportFromOutlook; + + property OnAcceptAppointmentItem: TcxAcceptAppointmentItemImportFunc + read FOnAcceptAppointmentItem write FOnAcceptAppointmentItem; + property OnAcceptEvent: TcxAcceptEventExportFunc + read FOnAcceptEvent write FOnAcceptEvent; + property OnConvertAppointmentItemToEvent: TcxAppointmentItemToEventProc + read FOnConvertAppointmentItemToEvent write FOnConvertAppointmentItemToEvent; + property OnConvertEventToAppointmentItem: TcxEventToAppointmentItemProc + read FOnConvertEventToAppointmentItem write FOnConvertEventToAppointmentItem; + property OnProgress: TcxSchedulerExchangeProgressProc + read FOnProgress write FOnProgress; + end; + + { TcxOutlookSynchronize } + + TcxOutlookSynchronize = class(TcxOutlookExchange) + private + FEntryIDField: TcxCustomSchedulerStorageField; + protected + procedure DeleteUnsynchronizedAppointments(AEntryIDs: TcxAppointmentEntryIDList); + procedure DeleteUnsynchronizedEvents(AEntryIDs: TcxEventEntryIDList); + function GetEntryIDFromEvent(AEvent: TcxSchedulerEvent): string; + function GetIsValid: Boolean; override; + function IsEqualRecurrencePattern(const AppointmentItem: OleVariant; + AEvent: TcxSchedulerEvent): Boolean; + procedure PostRecurrenceExeption(AOccurrence: TcxSchedulerEvent); override; + procedure PurgeDeletedOccurrences(APatternEvent: TcxSchedulerEvent; + AEntryIDs: TcxEventEntryIDList); + procedure UpdateAppointmentItem(const AppointmentItem: OleVariant; + AEvent: TcxSchedulerEvent); override; + procedure UpdateExistingAppointmentItem(const AppointmentItem: OleVariant; + AEvent: TcxSchedulerEvent); + procedure UpdateExistingEvent(AEvent: TcxSchedulerEvent; + const AppointmentItem: OleVariant; AEntryIDs: TcxEventEntryIDList); + procedure UpdateEvent(AEvent: TcxSchedulerEvent; + const AppointmentItem: OleVariant; APostData: Boolean = True); override; + procedure SynchronizeRecurrenceChainWithOutlook( + APatternEvent: TcxSchedulerEvent; const ARecurrencePattern: OleVariant; + AEntryIDs: TcxEventEntryIDList); + public + procedure SynchronizeWithOutlook(ADeleteUnsynchronizedEvents: Boolean = False); + procedure SynchronizeWithStorage(ADeleteUnsynchronizedAppointments: Boolean = False); + + property EntryIDField: TcxCustomSchedulerStorageField + read FEntryIDField write FEntryIDField; + end; + +procedure cxSchedulerExportToOutlook(AStorage: TcxCustomSchedulerStorage; + AcceptFunc: TcxAcceptEventExportFunc = nil; + AConvertProc: TcxEventToAppointmentItemProc = nil; + AProgressProc: TcxSchedulerExchangeProgressProc = nil); + +procedure cxSchedulerImportFromOutlook(AStorage: TcxCustomSchedulerStorage; + AcceptFunc: TcxAcceptAppointmentItemImportFunc = nil; + AConvertProc: TcxAppointmentItemToEventProc = nil; + AProgressProc: TcxSchedulerExchangeProgressProc = nil); + +procedure cxSchedulerSynchronizeOutlookWithStorage(AStorage: TcxCustomSchedulerStorage; + AppointmentItemIDField: TcxCustomSchedulerStorageField; + ADeleteUnsynchronizedAppointments: Boolean = False; + AcceptFunc: TcxAcceptEventExportFunc = nil; + AConvertProc: TcxEventToAppointmentItemProc = nil; + AProgressProc: TcxSchedulerExchangeProgressProc = nil); + +procedure cxSchedulerSynchronizeStorageWithOutlook(AStorage: TcxCustomSchedulerStorage; + AppointmentItemIDField: TcxCustomSchedulerStorageField; + ADeleteUnsynchronizedEvents: Boolean = False; + AcceptFunc: TcxAcceptAppointmentItemImportFunc = nil; + AConvertProc: TcxAppointmentItemToEventProc = nil; + AProgressProc: TcxSchedulerExchangeProgressProc = nil); + +implementation + +uses + Windows, SysUtils, cxSchedulerUtils, cxVariants, Forms; + +const + olFolderCalendar = $00000009; + olAppointmentItem = $00000001; + + //recurrence + olRecursDaily = $00000000; + olRecursWeekly = $00000001; + olRecursMonthly = $00000002; + olRecursMonthNth = $00000003; + olRecursYearly = $00000005; + olRecursYearNth = $00000006; + + // Constants for enum OlDaysOfWeek + olSunday = $00000001; + olMonday = $00000002; + olTuesday = $00000004; + olWednesday = $00000008; + olThursday = $00000010; + olFriday = $00000020; + olSaturday = $00000040; + olWeekDay = olMonday + olTuesday + olWednesday + olThursday + olFriday; + olWeekEndDay = olSunday + olSaturday; + olEveryDay = olWeekDay + olWeekEndDay; + + // Constants for enum OlBusyStatus + olFree = $00000000; + olTentative = $00000001; + olBusy = $00000002; + olOutOfOffice = $00000003; + + scxOutlookApp = 'outlook.application'; + scxNameSpace = 'MAPI'; + + NullEntryID = '0000000000000000000000000000000000000000'; + +{ TcxAppointmentInfo } + +constructor TcxAppointmentInfo.Create(const AAppointmentItem: OleVariant); +begin + FAppointmentItem := AAppointmentItem; + FEntryID := UpperCase(AAppointmentItem.EntryID); +end; + +{ TcxAppointmentEntryIDList } + +procedure TcxAppointmentEntryIDList.Add(const AppointmentItem: OleVariant); +begin + inherited Add(TcxAppointmentInfo.Create(AppointmentItem)); +end; + +function TcxAppointmentEntryIDList.ExtractAppointmentItem( + AIndex: Integer): OleVariant; +var + AppointmentInfo: TcxAppointmentInfo; +begin + AppointmentInfo := Items[AIndex]; + Result := AppointmentInfo.AppointmentItem; + AppointmentInfo.Free; + Delete(AIndex); +end; + +function TcxAppointmentEntryIDList.FindEntryID(const AEntryID: string; var Index: Integer): Boolean; +var + L, H, I, C: Integer; +begin + Result := False; + if Length(AEntryID) = 0 then Exit; + L := 0; + H := Count - 1; + while L <= H do + begin + I := (L + H) shr 1; + C := CompareStr(Items[I].EntryID, AEntryID); + if C < 0 then L := I + 1 else + begin + H := I - 1; + if C = 0 then + begin + Result := True; + L := I; + end; + end; + end; + Index := L; +end; + +function TcxAppointmentEntryIDList.IndexOfEntryID(const AEntryID: string): Integer; +begin + if not FindEntryID(AEntryID, Result) then + Result := -1; +end; + +function CompareAppointments(Item1, Item2: Pointer): Integer; +begin + Result := CompareStr(TcxAppointmentInfo(Item1).EntryID, TcxAppointmentInfo(Item2).EntryID); +end; + +procedure TcxAppointmentEntryIDList.Populate(ACalendarFolder: OleVariant); +var + I: Integer; +begin + Capacity := ACalendarFolder.Items.Count; + for I := 1 to ACalendarFolder.Items.Count do + Add(ACalendarFolder.Items(I)); + Sort(CompareAppointments); +end; + +function TcxAppointmentEntryIDList.GetItems(Index: Integer): TcxAppointmentInfo; +begin + Result := TcxAppointmentInfo(List^[Index]); +end; + +{ TcxEventInfo } + +constructor TcxEventInfo.Create(AEvent: TcxSchedulerEvent; AEntryIDField: TcxCustomSchedulerStorageField); +begin + FEvent := AEvent; + if AEvent.EventType in [etNone, etPattern] then + FEntryID := Trim(VarToStr(AEvent.GetCustomFieldValue(AEntryIDField))) + else + FEntryID := NullEntryID; +end; + +{ TcxEventEntryIDList } + +procedure TcxEventEntryIDList.Add(AEvent: TcxSchedulerEvent; + AEntryIDField: TcxCustomSchedulerStorageField); +begin + inherited Add(TcxEventInfo.Create(AEvent, AEntryIDField)); +end; + +procedure TcxEventEntryIDList.DeleteEvent(AEvent: TcxSchedulerEvent); +var + I: Integer; +begin + for I := 0 to Count - 1 do + if Items[I].Event = AEvent then + begin + Items[I].Free; + Delete(I); + break; + end; +end; + +function TcxEventEntryIDList.ExtractEvent(AIndex: Integer): TcxSchedulerEvent; +var + AEventInfo: TcxEventInfo; +begin + AEventInfo := Items[AIndex]; + Result := AEventInfo.Event; + AEventInfo.Free; + Delete(AIndex); +end; + +function TcxEventEntryIDList.FindEntryID(const AEntryID: string; + var Index: Integer): Boolean; +var + L, H, I, C: Integer; +begin + Result := False; + if Length(AEntryID) = 0 then Exit; + L := 0; + H := Count - 1; + while L <= H do + begin + I := (L + H) shr 1; + C := CompareStr(Items[I].EntryID, AEntryID); + if C < 0 then L := I + 1 else + begin + H := I - 1; + if C = 0 then + begin + Result := True; + L := I; + end; + end; + end; + Index := L; +end; + +function TcxEventEntryIDList.IndexOfEntryID( + const AEntryID: string): Integer; +begin + if not FindEntryID(AEntryID, Result) then + Result := -1; +end; + +function CompareEvents(Item1, Item2: Pointer): Integer; +begin + Result := CompareStr(TcxEventInfo(Item1).EntryID, TcxEventInfo(Item2).EntryID); +end; + +procedure TcxEventEntryIDList.Populate(AStorage: TcxCustomSchedulerStorage; + AEntryIDField: TcxCustomSchedulerStorageField); +var + I: Integer; +begin + Capacity := AStorage.EventCount; + for I := 0 to AStorage.EventCount - 1 do + Add(AStorage.Events[I], AEntryIDField); + Sort(CompareEvents); +end; + +function TcxEventEntryIDList.GetItems(Index: Integer): TcxEventInfo; +begin + Result := TcxEventInfo(List^[Index]); +end; + +{ TcxOutlookExchange } + +constructor TcxOutlookExchange.Create(AStorage: TcxCustomSchedulerStorage); +begin + inherited Create; + FStorage := AStorage; + FOleInitialized := InitOleObject; +end; + +destructor TcxOutlookExchange.Destroy; +begin + if FWasCreated then + FOutlookApp := Unassigned; + inherited Destroy; +end; + +procedure TcxOutlookExchange.ExportEventToOutlook(AEvent: TcxSchedulerEvent); +var + AppointmentItem: OleVariant; +begin + if AEvent.EventType in [etNone, etPattern] then + begin + AppointmentItem := OutlookApp.CreateItem(olAppointmentItem); + SetupAppointmentItemInfo(AppointmentItem, AEvent); + if AEvent.IsRecurring then + ExportRecurrenceChain(AEvent, AppointmentItem) + else + UpdateAppointmentItem(AppointmentItem, AEvent); + end; +end; + +procedure TcxOutlookExchange.ExportToOutlook; +var + AEvent: TcxSchedulerEvent; + I, ACount: Integer; +begin + if not IsValid then Exit; + Storage.BeginUpdate; + try + ACount := Storage.EventCount; + for I := 0 to ACount - 1 do + begin + AEvent := Storage.Events[I]; + if CanAcceptEvent(AEvent) then + ExportEventToOutlook(AEvent); + if not DoProgress(I + 1, ACount) then + Break; + Application.ProcessMessages; + end; + finally + Storage.EndUpdate; + end; +end; + +procedure TcxOutlookExchange.ImportAppointmentItemFromOutlook( + const AppointmentItem: OleVariant); +var + AEvent: TcxSchedulerEvent; + ARecurrencePattern: OleVariant; +begin + AEvent := Storage.CreateEvent; + SetupEventInfo(AEvent, AppointmentItem); + if AppointmentItem.IsRecurring then + begin + ARecurrencePattern := AppointmentItem.GetRecurrencePattern; + UpdateEventWithRecurrenceInfo(AEvent, AppointmentItem); + ImportRecurrenceChain(AEvent, ARecurrencePattern); + end + else + UpdateEvent(AEvent, AppointmentItem); +end; + +procedure TcxOutlookExchange.ImportFromOutlook; +var + I, ACount: Integer; + AppointmentItem: OleVariant; +begin + if not IsValid then Exit; + ACount := CalendarFolder.Items.Count; + for I := 1 to ACount do + begin + AppointmentItem := CalendarFolder.Items(I); + if CanImportAppointmentItem(AppointmentItem) and CanAcceptAppointmentItem(AppointmentItem) then + ImportAppointmentItemFromOutlook(AppointmentItem); + if not DoProgress(I, ACount) then + Break; + Application.ProcessMessages; + end; +end; + +function TcxOutlookExchange.CanAcceptAppointmentItem( + const AppointmentItem: OleVariant): Boolean; +begin + Result := not Assigned(FOnAcceptAppointmentItem) or + FOnAcceptAppointmentItem(AppointmentItem); +end; + +function TcxOutlookExchange.CanAcceptEvent(AEvent: TcxSchedulerEvent): Boolean; +begin + Result := not Assigned(FOnAcceptEvent) or FOnAcceptEvent(AEvent); +end; + +function TcxOutlookExchange.CanImportAppointmentItem( + const AppointmentItem: OleVariant): Boolean; +begin + Result := not (AppointmentItem.IsRecurring and not Storage.IsRecurrenceAvailable); +end; + +procedure TcxOutlookExchange.ConvertAppointmentItemToEvent( + const AppointmentItem: OleVariant; AEvent: TcxSchedulerEvent); +begin + if Assigned(FOnConvertAppointmentItemToEvent) then + FOnConvertAppointmentItemToEvent(AppointmentItem, AEvent); +end; + +procedure TcxOutlookExchange.ConvertEventToAppointmentItem( + AEvent: TcxSchedulerEvent; const AppointmentItem: OleVariant); +begin + if Assigned(FOnConvertEventToAppointmentItem) then + FOnConvertEventToAppointmentItem(AEvent, AppointmentItem); +end; + +procedure TcxOutlookExchange.ImportRecurrenceChain( + APatternEvent: TcxSchedulerEvent; const ARecurrencePattern: OleVariant); +const + ExceptionType: array[Boolean] of TcxEventType = (etCustom, etException); +var + I: Integer; + AException: OleVariant; + ADeleted: Boolean; + AOccurrence: TcxSchedulerEvent; +begin + for I := 1 to ARecurrencePattern.Exceptions.Count do + begin + AException := ARecurrencePattern.Exceptions.Item(I); + ADeleted := AException.Deleted; + if not ADeleted and not CanAcceptAppointmentItem(AException.AppointmentItem) then + continue; + AOccurrence := Storage.CreateOccurrence(APatternEvent, + AException.OriginalDate, ExceptionType[ADeleted]); + if not ADeleted then + begin + SetupEventInfo(AOccurrence, AException.AppointmentItem); + UpdateEvent(AOccurrence, AException.AppointmentItem); + end + else + PostRecurrenceExeption(AOccurrence); + end; +end; + +procedure TcxOutlookExchange.SetupEventRecurrenceInfo(AEvent: TcxSchedulerEvent; + const ARecurrencePattern: OleVariant); +var + AType, AInterval: Integer; + ADate: TDateTime; +begin + AEvent.EventType := etPattern; + ADate := ARecurrencePattern.PatternStartDate; + if not AEvent.AllDayEvent then + ADate := ADate + RoundTime(ARecurrencePattern.StartTime, False); + AEvent.RecurrenceInfo.Start := ADate; + if ARecurrencePattern.NoEndDate then + AEvent.RecurrenceInfo.Count := -1 + else + begin + ADate := ARecurrencePattern.PatternEndDate; + if not AEvent.AllDayEvent then + ADate := ADate + RoundTime(ARecurrencePattern.EndTime, False); + AEvent.RecurrenceInfo.Finish := ADate; + AEvent.RecurrenceInfo.Count := ARecurrencePattern.Occurrences; + end; + AType := ARecurrencePattern.RecurrenceType; + case AType of + olRecursDaily: + begin + AEvent.RecurrenceInfo.Recurrence := cxreDaily; + AEvent.RecurrenceInfo.DayType := cxdtEveryDay; + AEvent.RecurrenceInfo.Periodicity := ARecurrencePattern.Interval; + end; + olRecursWeekly: + begin + AInterval := ARecurrencePattern.Interval; + if AInterval = 0 then + begin + AEvent.RecurrenceInfo.Recurrence := cxreDaily; + AEvent.RecurrenceInfo.DayType := cxdtWeekDay; + end + else + begin + AEvent.RecurrenceInfo.Recurrence := cxreWeekly; + AEvent.RecurrenceInfo.Periodicity := AInterval; + end; + AEvent.RecurrenceInfo.OccurDays := + GetDaysOfWeekFromMask(ARecurrencePattern.DayOfWeekMask); + end; + olRecursMonthly: + begin + AEvent.RecurrenceInfo.DayType := cxdtDay; + AEvent.RecurrenceInfo.Recurrence := cxreMonthly; + AEvent.RecurrenceInfo.Periodicity := ARecurrencePattern.Interval; + AEvent.RecurrenceInfo.DayNumber := ARecurrencePattern.DayOfMonth + end; + olRecursMonthNth: + begin + AEvent.RecurrenceInfo.DayType := GetDayTypeFromMask(ARecurrencePattern.DayOfWeekMask); + AEvent.RecurrenceInfo.Recurrence := cxreMonthly; + AEvent.RecurrenceInfo.Periodicity := ARecurrencePattern.Interval; + AEvent.RecurrenceInfo.DayNumber := ARecurrencePattern.Instance; + end; + olRecursYearly: + begin + AEvent.RecurrenceInfo.DayType := cxdtDay; + AEvent.RecurrenceInfo.Recurrence := cxreYearly; + AEvent.RecurrenceInfo.Periodicity := ARecurrencePattern.MonthOfYear; + AEvent.RecurrenceInfo.DayNumber := ARecurrencePattern.DayOfMonth + end; + olRecursYearNth: + begin + AEvent.RecurrenceInfo.DayType := GetDayTypeFromMask(ARecurrencePattern.DayOfWeekMask); + AEvent.RecurrenceInfo.Recurrence := cxreYearly; + AEvent.RecurrenceInfo.Periodicity := ARecurrencePattern.MonthOfYear; + AEvent.RecurrenceInfo.DayNumber := ARecurrencePattern.Instance; + end; + end; +end; + +function TcxOutlookExchange.GetIsValid: Boolean; +begin + Result := (FStorage <> nil) and FOleInitialized; +end; + +{$HINTS OFF} +function TcxOutlookExchange.InitOleObject: Boolean; +var + ANameSpace: OleVariant; +begin + Result := False; + FWasCreated := False; + try + FOutlookApp := GetActiveOleObject(scxOutlookApp); + Result := True; + except + FOutlookApp := CreateOleObject(scxOutlookApp); + FWasCreated := True; + Result := True; + end; + if Result then + begin + ANameSpace := OutlookApp.GetNamespace(scxNameSpace); + FCalendarFolder := ANameSpace.GetDefaultFolder(olFolderCalendar); + end; +end; +{$HINTS ON} + +procedure TcxOutlookExchange.PostRecurrenceExeption( + AOccurrence: TcxSchedulerEvent); +begin + AOccurrence.Post; +end; + +function TcxOutlookExchange.RoundTime(ATime: TDateTime; ASaveDate: Boolean): TDateTime; +begin + if ASaveDate then + Result := DateTimeHelper.RoundTime(ATime) + else + Result := DateTimeHelper.RoundTime(TimeOf(ATime)); +end; + +procedure TcxOutlookExchange.UpdateAppointmentItem( + const AppointmentItem: OleVariant; AEvent: TcxSchedulerEvent); +begin + ConvertEventToAppointmentItem(AEvent, AppointmentItem); + try + AppointmentItem.Save; + except + end; +end; + +procedure TcxOutlookExchange.UpdateEvent(AEvent: TcxSchedulerEvent; + const AppointmentItem: OleVariant; APostData: Boolean = True); +begin + ConvertAppointmentItemToEvent(AppointmentItem, AEvent); + if APostData then AEvent.Post; +end; + +procedure TcxOutlookExchange.UpdateEventWithRecurrenceInfo(AEvent: TcxSchedulerEvent; + const AppointmentItem: OleVariant); +begin + AEvent.BeginEditing; + try + SetupEventRecurrenceInfo(AEvent, AppointmentItem.GetRecurrencePattern); + UpdateEvent(AEvent, AppointmentItem, False); + finally + AEvent.EndEditing; + end; + AEvent.Post; +end; + +function TcxOutlookExchange.DoProgress(ACurrent, ACount: Integer): Boolean; +var + Abort: Boolean; +begin + Abort := False; + if Assigned(FOnProgress) then + FOnProgress(ACurrent, ACount, Abort); + Result := not Abort; +end; + +procedure TcxOutlookExchange.CheckRecurrencePatternExceptions( + const ARecurrencePattern: OleVariant; + APatternEvent: TcxSchedulerEvent); +var + I: Integer; + AEvent: TcxSchedulerEvent; + AppointmentItem: OleVariant; +begin + with APatternEvent.GetRecurrenceChain do + try + for I := 0 to Count - 1 do + begin + AEvent := Items[I]; + try + AppointmentItem := ARecurrencePattern.GetOccurrence(AEvent.GetOriginalDate); + if AEvent.EventType = etException then + AppointmentItem.Delete + else + if (AEvent.EventType = etCustom) and CanAcceptEvent(AEvent) then + begin + SetupAppointmentItemInfo(AppointmentItem, AEvent); + UpdateAppointmentItem(AppointmentItem, AEvent); + end; + except + end; + end; + finally + Free; + end; +end; + +procedure TcxOutlookExchange.ExportRecurrenceChain( + APatternEvent: TcxSchedulerEvent; const AppointmentItem: OleVariant); +var + ARecurrencePattern: OleVariant; +begin + if APatternEvent.EventType = etPattern then + begin + ARecurrencePattern := AppointmentItem.GetRecurrencePattern; + SetAppointmentItemRecurrence(ARecurrencePattern, APatternEvent); + UpdateAppointmentItem(AppointmentItem, APatternEvent); + CheckRecurrencePatternExceptions(ARecurrencePattern, APatternEvent); + end; +end; + +procedure TcxOutlookExchange.SetAppointmentItemRecurrence( + const ARecurrencePattern: OleVariant; AEvent: TcxSchedulerEvent); +begin + with AEvent.RecurrenceInfo do + begin + ARecurrencePattern.PatternStartDate := DateOf(AEvent.Start); + ARecurrencePattern.StartTime := RoundTime(AEvent.Start, False); + ARecurrencePattern.EndTime := RoundTime(AEvent.Finish, False); + case Recurrence of + cxreDaily: + begin + if DayType = cxdtEveryDay then + begin + ARecurrencePattern.RecurrenceType := olRecursDaily; + ARecurrencePattern.Interval := Periodicity; + end + else + if DayType = cxdtWeekDay then + begin + ARecurrencePattern.RecurrenceType := olRecursWeekly; + ARecurrencePattern.DayOfWeekMask := olWeekDay; + end; + end; + cxreWeekly: + begin + ARecurrencePattern.RecurrenceType := olRecursWeekly; + ARecurrencePattern.DayOfWeekMask := GetMaskFromDaysOfWeek(OccurDays); + ARecurrencePattern.Interval := Periodicity; + end; + cxreMonthly: + begin + if DayType = cxdtDay then + begin + ARecurrencePattern.RecurrenceType := olRecursMonthly; + ARecurrencePattern.DayOfMonth := DayNumber; + ARecurrencePattern.Interval := Periodicity; + end + else + begin + ARecurrencePattern.RecurrenceType := olRecursMonthNth; + ARecurrencePattern.Interval := Periodicity; + ARecurrencePattern.DayOfWeekMask := GetMaskFromDayType(DayType); + ARecurrencePattern.Instance := DayNumber; + end; + end; + cxreYearly: + begin + if DayType = cxdtDay then + begin + ARecurrencePattern.RecurrenceType := olRecursYearly; + ARecurrencePattern.DayOfMonth := DayNumber; + ARecurrencePattern.MonthOfYear := Periodicity; + end + else + begin + ARecurrencePattern.RecurrenceType := olRecursYearNth; + ARecurrencePattern.MonthOfYear := Periodicity; + ARecurrencePattern.DayOfWeekMask := GetMaskFromDayType(DayType); + ARecurrencePattern.Instance := DayNumber; + end; + end; + end; + if Count = -1 then + ARecurrencePattern.NoEndDate := True + else + if Count = 0 then + ARecurrencePattern.PatternEndDate := Finish + else + ARecurrencePattern.Occurrences := Count; + end; +end; + +function TcxOutlookExchange.GetAllDayEvent(const AppointmentItem: OleVariant): Boolean; +var + ARecurrencePattern: OleVariant; +begin + Result := AppointmentItem.AllDayEvent; + if Result then + begin + if AppointmentItem.IsRecurring then + begin + ARecurrencePattern := AppointmentItem.GetRecurrencePattern; + if Integer(ARecurrencePattern.RecurrenceType) in + [olRecursMonthly, olRecursMonthNth, olRecursYearly, olRecursYearNth] then + begin + Result := (RoundTime(ARecurrencePattern.StartTime, False) = 0) and + (RoundTime(ARecurrencePattern.EndTime, False) = 0); + end; + end; + end; +end; + +function TcxOutlookExchange.GetDaysOfWeekFromMask(AMask: Integer): TDays; +var + I: Integer; +begin + Result := []; + for I := 0 to 6 do + if (1 shl I) and AMask <> 0 then + Include(Result, TDay(I)); +end; + +function TcxOutlookExchange.GetDayTypeFromMask(AMask: Integer): TcxDayType; +begin + case AMask of + olSunday : Result := cxdtSunday; + olMonday : Result := cxdtMonday; + olTuesday : Result := cxdtTuesday; + olWednesday : Result := cxdtWednesday; + olThursday: Result := cxdtThursday; + olFriday: Result := cxdtFriday; + olSaturday: Result := cxdtSaturday; + olWeekDay : Result := cxdtWeekDay; + olWeekEndDay: Result := cxdtWeekEndDay; + else + Result := cxdtEveryDay; + end; +end; + +function TcxOutlookExchange.GetMaskFromDaysOfWeek(ADays: TDays): Integer; +var + I: TDay; +begin + Result := 0; + for I := dSunday to dSaturday do + if I in ADays then + Result := Result or (1 shl Ord(I)); +end; + +function TcxOutlookExchange.GetMaskFromDayType(ADayType: TcxDayType): Integer; +const + Masks: array[TcxDayType] of Byte = (olEveryDay, olEveryDay, olWeekDay, + olWeekEndDay, olSunday, olMonday, olTuesday, olWednesday, olThursday, + olFriday, olSaturday); +begin + Result := Masks[ADayType]; +end; + +{ TcxOutlookSynchronize } + +procedure TcxOutlookSynchronize.SynchronizeWithOutlook( + ADeleteUnsynchronizedEvents: Boolean = False); +var + I, AIndex, ACount: Integer; + AppointmentItem: OleVariant; + AEvent: TcxSchedulerEvent; + AEntryIDs: TcxEventEntryIDList; +begin + if not IsValid then Exit; + AEntryIDs := TcxEventEntryIDList.Create; + try + AEntryIDs.Populate(Storage, EntryIDField); + ACount := CalendarFolder.Items.Count; + for I := 1 to ACount do + begin + AppointmentItem := CalendarFolder.Items(I); + if CanImportAppointmentItem(AppointmentItem) and CanAcceptAppointmentItem(AppointmentItem) then + begin + if AEntryIDs.FindEntryID(AppointmentItem.EntryID, AIndex) then + begin + AEvent := AEntryIDs.ExtractEvent(AIndex); + UpdateExistingEvent(AEvent, AppointmentItem, AEntryIDs); + end + else + ImportAppointmentItemFromOutlook(AppointmentItem); + end; + if not DoProgress(I, ACount) then + Exit; + Application.ProcessMessages; + end; + if ADeleteUnsynchronizedEvents then + DeleteUnsynchronizedEvents(AEntryIDs); + finally + AEntryIDs.Free; + end; +end; + +procedure TcxOutlookSynchronize.SynchronizeWithStorage( + ADeleteUnsynchronizedAppointments: Boolean = False); +var + AppointmentItem: OleVariant; + AEntryIDs: TcxAppointmentEntryIDList; + AEvent: TcxSchedulerEvent; + I, AIndex, ACount: Integer; +begin + if not IsValid then Exit; + AEntryIDs := TcxAppointmentEntryIDList.Create; + try + AEntryIDs.Populate(CalendarFolder); + Storage.BeginUpdate; + try + ACount := Storage.EventCount; + for I := 0 to ACount - 1 do + begin + AEvent := Storage.Events[I]; + if CanAcceptEvent(AEvent) then + begin + if AEntryIDs.FindEntryID(GetEntryIDFromEvent(AEvent), AIndex) then + begin + AppointmentItem := AEntryIDs.ExtractAppointmentItem(AIndex); + UpdateExistingAppointmentItem(AppointmentItem, AEvent); + end + else + ExportEventToOutlook(AEvent); + end; + if not DoProgress(I + 1, ACount) then + Exit; + Application.ProcessMessages; + end; + if ADeleteUnsynchronizedAppointments then + DeleteUnsynchronizedAppointments(AEntryIDs); + finally + Storage.EndUpdate; + end; + finally + AEntryIDs.Free; + end; +end; + +procedure TcxOutlookSynchronize.UpdateAppointmentItem( + const AppointmentItem: OleVariant; AEvent: TcxSchedulerEvent); +var + AEntryID: OleVariant; +begin + ConvertEventToAppointmentItem(AEvent, AppointmentItem); + try + AppointmentItem.Save; + AEntryID := AppointmentItem.EntryID; + if not VarEqualsSoft(AEvent.GetCustomFieldValue(EntryIDField), AEntryID) then + begin + AEvent.SetCustomFieldValue(EntryIDField, AEntryID); + AEvent.Post; + end; + except + end; +end; + +procedure TcxOutlookSynchronize.UpdateExistingAppointmentItem( + const AppointmentItem: OleVariant; AEvent: TcxSchedulerEvent); +begin + if AppointmentItem.IsRecurring then + AppointmentItem.ClearRecurrencePattern; + SetupAppointmentItemInfo(AppointmentItem, AEvent); + if AEvent.IsRecurring then + ExportRecurrenceChain(AEvent, AppointmentItem) + else + UpdateAppointmentItem(AppointmentItem, AEvent); +end; + +procedure TcxOutlookSynchronize.SynchronizeRecurrenceChainWithOutlook( + APatternEvent: TcxSchedulerEvent; + const ARecurrencePattern: OleVariant; + AEntryIDs: TcxEventEntryIDList); +var + I, J: Integer; + AppointmentItem: OleVariant; + AException: OleVariant; + AOccurrence: TcxSchedulerEvent; + AOriginalDate: TDateTime; + ARecurrenceChain: TcxSchedulerEventList; +begin + PurgeDeletedOccurrences(APatternEvent, AEntryIDs); + ARecurrenceChain := APatternEvent.GetRecurrenceChain; + try + for I := 1 to ARecurrencePattern.Exceptions.Count do + begin + AException := ARecurrencePattern.Exceptions.Item(I); + AOriginalDate := DateOf(AException.OriginalDate); + AOccurrence := nil; + for J := 0 to ARecurrenceChain.Count - 1 do + begin + if DateOf(ARecurrenceChain[J].GetOriginalDate) = AOriginalDate then + begin + AOccurrence := ARecurrenceChain[J]; + AEntryIDs.DeleteEvent(AOccurrence); + ARecurrenceChain.Delete(J); + break; + end; + end; + if not AException.Deleted then + begin + AppointmentItem := AException.AppointmentItem; + if not CanAcceptAppointmentItem(AppointmentItem) then + continue; + if AOccurrence = nil then + AOccurrence := Storage.CreateOccurrence(APatternEvent, AOriginalDate, etCustom); + SetupEventInfo(AOccurrence, AppointmentItem); + ConvertAppointmentItemToEvent(AppointmentItem, AOccurrence); + AOccurrence.Post; + end + else + begin + if AOccurrence = nil then + AOccurrence := APatternEvent.GetOccurrence(AOriginalDate); + if AOccurrence <> nil then + begin + AOccurrence.EventType := etException; + PostRecurrenceExeption(AOccurrence); + end; + end; + end; + for I := 0 to ARecurrenceChain.Count - 1 do + begin + AOccurrence := ARecurrenceChain[I]; + AEntryIDs.DeleteEvent(AOccurrence); + AOccurrence.EventType := etNone; + AOccurrence.Delete; + end; + finally + ARecurrenceChain.Free; + end; +end; + +procedure TcxOutlookSynchronize.UpdateExistingEvent(AEvent: TcxSchedulerEvent; + const AppointmentItem: OleVariant; AEntryIDs: TcxEventEntryIDList); +var + ARecurrencePattern: OleVariant; +begin + SetupEventInfo(AEvent, AppointmentItem); + if AppointmentItem.IsRecurring then + begin + ARecurrencePattern := AppointmentItem.GetRecurrencePattern; + if AEvent.IsRecurring then + begin + if not IsEqualRecurrencePattern(AppointmentItem, AEvent) then + AEvent.DeleteExceptions; + UpdateEventWithRecurrenceInfo(AEvent, AppointmentItem); + SynchronizeRecurrenceChainWithOutlook(AEvent, ARecurrencePattern, AEntryIDs); + end + else + begin + UpdateEventWithRecurrenceInfo(AEvent, AppointmentItem); + ImportRecurrenceChain(AEvent, AppointmentItem.GetRecurrencePattern); + end; + end + else + begin + AEvent.RemoveRecurrence; + UpdateEvent(AEvent, AppointmentItem); + end; +end; + +procedure TcxOutlookSynchronize.UpdateEvent(AEvent: TcxSchedulerEvent; + const AppointmentItem: OleVariant; APostData: Boolean = True); +var + AEntryID: string; +begin + if AEvent.EventType in [etPattern, etNone] then + AEntryID := AppointmentItem.EntryID + else + AEntryID := NullEntryID; + AEvent.SetCustomFieldValue(EntryIDField, AEntryID); + inherited UpdateEvent(AEvent, AppointmentItem, APostData); +end; + +procedure TcxOutlookSynchronize.DeleteUnsynchronizedAppointments( + AEntryIDs: TcxAppointmentEntryIDList); +var + I: Integer; +begin + for I := 0 to AEntryIDs.Count - 1 do + try + AEntryIDs[I].AppointmentItem.Delete; + except + end; +end; + +procedure TcxOutlookSynchronize.DeleteUnsynchronizedEvents( + AEntryIDs: TcxEventEntryIDList); +var + I: Integer; + AEvent: TcxSchedulerEvent; +begin + Storage.BeginUpdate; + try + for I := 0 to AEntryIDs.Count - 1 do + begin + AEvent := AEntryIDs[I].Event; + AEvent.EventType := etNone; + AEvent.Delete; + end; + finally + Storage.EndUpdate; + end; +end; + +function TcxOutlookSynchronize.GetEntryIDFromEvent( + AEvent: TcxSchedulerEvent): string; +begin + Result := UpperCase(VarToStr(AEvent.GetCustomFieldValue(EntryIDField))) +end; + +function TcxOutlookSynchronize.GetIsValid: Boolean; +begin + Result := inherited GetIsValid and (FEntryIDField <> nil) +end; + +procedure TcxOutlookSynchronize.PostRecurrenceExeption( + AOccurrence: TcxSchedulerEvent); +begin + AOccurrence.SetCustomFieldValue(EntryIDField, NullEntryID); + AOccurrence.Post; +end; + +procedure TcxOutlookSynchronize.PurgeDeletedOccurrences( + APatternEvent: TcxSchedulerEvent; AEntryIDs: TcxEventEntryIDList); +var + AEvent: TcxSchedulerEvent; + L: TcxSchedulerEventList; + I: Integer; +begin + Storage.BeginUpdate; + try + L := APatternEvent.GetRecurrenceChain; + try + for I := 0 to L.Count - 1 do + begin + AEvent := L[I]; + if AEvent.EventType = etException then + begin + AEntryIDs.DeleteEvent(AEvent); + AEvent.Delete; + end; + end; + finally + L.Free; + end; + finally + Storage.EndUpdate; + end; +end; + +function TcxOutlookSynchronize.IsEqualRecurrencePattern( + const AppointmentItem: OleVariant; AEvent: TcxSchedulerEvent): Boolean; +var + ARecurrencePattern: OleVariant; +begin + with AEvent do + begin + Result := (AllDayEvent = GetAllDayEvent(AppointmentItem)) and + (RoundTime(Start, True) = RoundTime(AppointmentItem.Start, True)) and + (RoundTime(Finish, True) = RoundTime(AppointmentItem.End, True)); + end; + if Result then + begin + ARecurrencePattern := AppointmentItem.GetRecurrencePattern; + with AEvent.RecurrenceInfo do + begin + Result := (ARecurrencePattern.PatternStartDate = DateOf(AEvent.Start)) and + (RoundTime(ARecurrencePattern.StartTime, False) = RoundTime(AEvent.Start, False)) and + (RoundTime(ARecurrencePattern.EndTime, False) = RoundTime(AEvent.Finish, False)); + if not Result then Exit; + case Recurrence of + cxreDaily: + if DayType = cxdtEveryDay then + Result := (ARecurrencePattern.RecurrenceType = olRecursDaily) and + (ARecurrencePattern.Interval = Periodicity) + else + if DayType = cxdtWeekDay then + Result := (ARecurrencePattern.RecurrenceType = olRecursWeekly) and + (ARecurrencePattern.DayOfWeekMask = olWeekDay) + else + Result := False; //unknown status + cxreWeekly: + Result := (ARecurrencePattern.RecurrenceType = olRecursWeekly) and + (ARecurrencePattern.DayOfWeekMask = GetMaskFromDaysOfWeek(OccurDays)) and + (ARecurrencePattern.Interval = Periodicity); + cxreMonthly: + if DayType = cxdtDay then + Result := (ARecurrencePattern.RecurrenceType = olRecursMonthly) and + (ARecurrencePattern.DayOfMonth = DayNumber) and + (ARecurrencePattern.Interval = Periodicity) + else + Result := (ARecurrencePattern.RecurrenceType = olRecursMonthNth) and + (ARecurrencePattern.Interval = Periodicity) and + (ARecurrencePattern.DayOfWeekMask = GetMaskFromDayType(DayType)) and + (ARecurrencePattern.Instance = DayNumber); + cxreYearly: + if DayType = cxdtDay then + Result := (ARecurrencePattern.RecurrenceType = olRecursYearly) and + (ARecurrencePattern.DayOfMonth = DayNumber) and + (ARecurrencePattern.MonthOfYear = Periodicity) + else + Result := (ARecurrencePattern.RecurrenceType = olRecursYearNth) and + (ARecurrencePattern.MonthOfYear = Periodicity) and + (ARecurrencePattern.DayOfWeekMask = GetMaskFromDayType(DayType)) and + (ARecurrencePattern.Instance = DayNumber); + end; + if Result then + begin + if Count = -1 then + Result := ARecurrencePattern.NoEndDate + else + if Count = 0 then + Result := (ARecurrencePattern.PatternEndDate = DateOf(Finish)) + else + Result := (ARecurrencePattern.Occurrences = Count); + end; + end; + end; +end; + +//moved to the end because a bug in the delphi parser + +procedure TcxOutlookExchange.SetupAppointmentItemInfo(const AppointmentItem: OleVariant; + const AEvent: TcxSchedulerEvent; ASetTime: Boolean = True); +var + AControlEvent: TcxSchedulerControlEvent; +begin + AControlEvent := TcxSchedulerControlEvent.Create(AEvent); + try + with AControlEvent do + begin + if AEvent.EventType = etCustom then + Pattern := AEvent.Pattern + else + Pattern := nil; + if ASetTime then + begin + AppointmentItem.AllDayEvent := AllDayEvent; + AppointmentItem.Start := Start; + AppointmentItem.End := Finish; + end; + AppointmentItem.Subject := Caption; + AppointmentItem.Body := Message; + AppointmentItem.BusyStatus := State; + AppointmentItem.Location := Location; + AppointmentItem.ReminderSet := Reminder; + if Reminder then + AppointmentItem.ReminderMinutesBeforeStart := ReminderMinutesBeforeStart; + end; + finally + AControlEvent.Free; + end; +end; + +procedure TcxOutlookExchange.SetupEventInfo(AEvent: TcxSchedulerEvent; + const AppointmentItem: OleVariant); +begin + with AEvent do + begin + BeginEditing; + try + AllDayEvent := GetAllDayEvent(AppointmentItem); + Start := AppointmentItem.Start; + Finish := AppointmentItem.End; + Caption := AppointmentItem.Subject; + Message := AppointmentItem.Body; + State := AppointmentItem.BusyStatus; + Location := AppointmentItem.Location; + Reminder := AppointmentItem.ReminderSet; + if Reminder then + ReminderMinutesBeforeStart := AppointmentItem.ReminderMinutesBeforeStart; + finally + EndEditing; + end; + end; +end; + +// import/export/synchronization + +procedure cxSchedulerExportToOutlook(AStorage: TcxCustomSchedulerStorage; + AcceptFunc: TcxAcceptEventExportFunc = nil; + AConvertProc: TcxEventToAppointmentItemProc = nil; + AProgressProc: TcxSchedulerExchangeProgressProc = nil); +begin + with TcxOutlookExchange.Create(AStorage) do + try + OnAcceptEvent := AcceptFunc; + OnConvertEventToAppointmentItem := AConvertProc; + OnProgress := AProgressProc; + ExportToOutlook; + finally + Free; + end; +end; + +procedure cxSchedulerImportFromOutlook(AStorage: TcxCustomSchedulerStorage; + AcceptFunc: TcxAcceptAppointmentItemImportFunc = nil; + AConvertProc: TcxAppointmentItemToEventProc = nil; + AProgressProc: TcxSchedulerExchangeProgressProc = nil); +begin + with TcxOutlookExchange.Create(AStorage) do + try + OnAcceptAppointmentItem := AcceptFunc; + OnConvertAppointmentItemToEvent := AConvertProc; + OnProgress := AProgressProc; + ImportFromOutlook; + finally + Free; + end; +end; + +procedure cxSchedulerSynchronizeOutlookWithStorage(AStorage: TcxCustomSchedulerStorage; + AppointmentItemIDField: TcxCustomSchedulerStorageField; + ADeleteUnsynchronizedAppointments: Boolean = False; + AcceptFunc: TcxAcceptEventExportFunc = nil; + AConvertProc: TcxEventToAppointmentItemProc = nil; + AProgressProc: TcxSchedulerExchangeProgressProc = nil); +begin + with TcxOutlookSynchronize.Create(AStorage) do + try + EntryIDField := AppointmentItemIDField; + OnAcceptEvent := AcceptFunc; + OnConvertEventToAppointmentItem := AConvertProc; + OnProgress := AProgressProc; + SynchronizeWithStorage(ADeleteUnsynchronizedAppointments); + finally + Free; + end; +end; + +procedure cxSchedulerSynchronizeStorageWithOutlook(AStorage: TcxCustomSchedulerStorage; + AppointmentItemIDField: TcxCustomSchedulerStorageField; + ADeleteUnsynchronizedEvents: Boolean = False; + AcceptFunc: TcxAcceptAppointmentItemImportFunc = nil; + AConvertProc: TcxAppointmentItemToEventProc = nil; + AProgressProc: TcxSchedulerExchangeProgressProc = nil); +begin + with TcxOutlookSynchronize.Create(AStorage) do + try + EntryIDField := AppointmentItemIDField; + OnAcceptAppointmentItem := AcceptFunc; + OnConvertAppointmentItemToEvent := AConvertProc; + OnProgress := AProgressProc; + SynchronizeWithOutlook(ADeleteUnsynchronizedEvents); + finally + Free; + end; +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerRecurrenceEditor.dfm b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerRecurrenceEditor.dfm new file mode 100644 index 00000000..933d4716 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerRecurrenceEditor.dfm @@ -0,0 +1,628 @@ +object cxSchedulerRecurrenceEventEditorForm: TcxSchedulerRecurrenceEventEditorForm + Left = 277 + Top = 263 + ActiveControl = teStart + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'Event recurrence' + ClientHeight = 330 + ClientWidth = 483 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + KeyPreview = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object btnOk: TcxButton + Left = 68 + Top = 298 + Width = 85 + Height = 23 + Caption = '&Ok' + Default = True + TabOrder = 0 + OnClick = btnOkClick + end + object btnCancel: TcxButton + Left = 172 + Top = 298 + Width = 85 + Height = 23 + Cancel = True + Caption = '&Cancel' + ModalResult = 2 + TabOrder = 1 + end + object btnRemove: TcxButton + Left = 276 + Top = 298 + Width = 121 + Height = 23 + Caption = '&Remove recurrence' + Enabled = False + ModalResult = 3 + TabOrder = 2 + end + object gbTime: TcxGroupBox + Left = 8 + Top = 6 + Caption = 'Event time' + TabOrder = 3 + Height = 50 + Width = 466 + object lbStart: TLabel + Left = 14 + Top = 21 + Width = 28 + Height = 13 + Caption = 'Start:' + FocusControl = teStart + Transparent = True + end + object lbEnd: TLabel + Left = 144 + Top = 21 + Width = 22 + Height = 13 + Caption = 'End:' + FocusControl = teEnd + Transparent = True + end + object lbDuration: TLabel + Left = 264 + Top = 21 + Width = 45 + Height = 13 + Caption = 'Duration:' + FocusControl = cbDuration + Transparent = True + end + object teStart: TcxTimeEdit + Left = 52 + Top = 17 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = DoChange + Properties.OnEditValueChanged = StartTimeChanged + TabOrder = 0 + Width = 78 + end + object teEnd: TcxTimeEdit + Left = 174 + Top = 17 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = DoChange + Properties.OnEditValueChanged = EndTimeChanged + TabOrder = 1 + Width = 78 + end + object cbDuration: TcxComboBox + Left = 323 + Top = 17 + Properties.ImmediateDropDown = False + Properties.ImmediatePost = True + Properties.IncrementalSearch = False + Properties.OnChange = DoChange + Properties.OnPopup = cbDurationPropertiesPopup + Properties.OnValidate = cbDurationPropertiesValidate + TabOrder = 2 + Width = 129 + end + end + object gbPattern: TcxGroupBox + Left = 8 + Top = 60 + Caption = 'Recurrence pattern' + TabOrder = 4 + Height = 127 + Width = 466 + object pnlYearly: TcxGroupBox + Left = 94 + Top = 18 + Align = alCustom + PanelStyle.Active = True + PanelStyle.OfficeBackgroundKind = pobkStyleColor + Style.BorderStyle = ebsNone + TabOrder = 0 + Visible = False + Height = 107 + Width = 370 + object lbOf: TLabel + Left = 243 + Top = 36 + Width = 10 + Height = 13 + Caption = 'of' + end + object cbMonths1: TcxComboBox + Tag = 11589716 + Left = 262 + Top = 32 + Properties.DropDownListStyle = lsFixedList + Properties.OnChange = cbWeek1PropertiesChange + TabOrder = 0 + Width = 90 + end + object meDayOfMonth: TcxMaskEdit + Tag = 11588656 + Left = 155 + Top = 3 + Properties.MaskKind = emkRegExpr + Properties.EditMask = '\d{0,4}' + Properties.MaxLength = 0 + Properties.OnChange = cbMonthsPropertiesChange + TabOrder = 1 + OnExit = ValidateNumber + Width = 32 + end + object cbMonths: TcxComboBox + Tag = 11588656 + Left = 60 + Top = 3 + Properties.DropDownListStyle = lsFixedList + Properties.OnChange = cbMonthsPropertiesChange + TabOrder = 2 + Width = 90 + end + object cbWeek1: TcxComboBox + Tag = 11589716 + Left = 60 + Top = 32 + Properties.DropDownListStyle = lsFixedList + Properties.OnChange = cbWeek1PropertiesChange + TabOrder = 3 + Width = 65 + end + object rbEvery1: TcxRadioButton + Left = 2 + Top = 6 + Width = 57 + Height = 17 + Caption = 'Every' + Checked = True + TabOrder = 4 + TabStop = True + OnClick = DoChange + end + object rbThe1: TcxRadioButton + Left = 2 + Top = 35 + Width = 49 + Height = 17 + Caption = 'The' + TabOrder = 5 + end + object cbDay1: TcxComboBox + Tag = 11589716 + Left = 130 + Top = 32 + Properties.DropDownListStyle = lsFixedList + Properties.DropDownRows = 10 + Properties.OnChange = cbWeek1PropertiesChange + TabOrder = 6 + Width = 103 + end + end + object pnlMonthly: TcxGroupBox + Left = 94 + Top = 18 + Align = alCustom + PanelStyle.Active = True + PanelStyle.OfficeBackgroundKind = pobkStyleColor + Style.BorderStyle = ebsNone + TabOrder = 1 + Visible = False + Height = 107 + Width = 370 + object lbMonths: TLabel + Left = 174 + Top = 7 + Width = 43 + Height = 13 + Caption = 'month(s)' + end + object lbMonths1: TLabel + Left = 311 + Top = 36 + Width = 43 + Height = 13 + Caption = 'month(s)' + end + object lbOfEvery: TLabel + Left = 92 + Top = 7 + Width = 41 + Height = 13 + Caption = 'of every' + end + object lbOfEvery1: TLabel + Left = 226 + Top = 36 + Width = 41 + Height = 13 + Caption = 'of every' + end + object cbWeek: TcxComboBox + Tag = 11534460 + Left = 53 + Top = 32 + Properties.DropDownListStyle = lsFixedList + Properties.OnChange = SetTheRadioButtonChecked + TabOrder = 0 + Width = 65 + end + object meNumOfDay: TcxMaskEdit + Tag = 11533468 + Left = 53 + Top = 3 + Properties.MaskKind = emkRegExpr + Properties.EditMask = '\d{0,4}' + Properties.MaxLength = 0 + Properties.OnChange = SetDayRadioButtonChecked + TabOrder = 1 + OnExit = ValidateNumber + Width = 32 + end + object meNumMonth: TcxMaskEdit + Tag = 11533468 + Left = 139 + Top = 3 + Properties.MaskKind = emkRegExpr + Properties.EditMask = '\d{0,4}' + Properties.MaxLength = 0 + Properties.OnChange = SetDayRadioButtonChecked + TabOrder = 2 + OnExit = ValidateNumber + Width = 32 + end + object meNumMonth1: TcxMaskEdit + Tag = 11534460 + Left = 273 + Top = 32 + Properties.MaskKind = emkRegExpr + Properties.EditMask = '\d{0,4}' + Properties.MaxLength = 0 + Properties.OnChange = SetTheRadioButtonChecked + TabOrder = 3 + OnExit = ValidateNumber + Width = 32 + end + object rbDay: TcxRadioButton + Left = 2 + Top = 6 + Width = 50 + Height = 17 + Caption = 'Day' + Checked = True + TabOrder = 4 + TabStop = True + OnClick = DoChange + end + object rbThe: TcxRadioButton + Left = 2 + Top = 35 + Width = 49 + Height = 17 + Caption = 'The' + TabOrder = 5 + OnClick = DoChange + end + object cbDay: TcxComboBox + Tag = 11534460 + Left = 121 + Top = 32 + Properties.DropDownListStyle = lsFixedList + Properties.DropDownRows = 10 + Properties.OnChange = SetTheRadioButtonChecked + TabOrder = 6 + Width = 96 + end + end + object pnlWeekly: TcxGroupBox + Left = 94 + Top = 18 + Align = alCustom + PanelStyle.Active = True + PanelStyle.OfficeBackgroundKind = pobkStyleColor + Style.BorderStyle = ebsNone + TabOrder = 2 + Visible = False + Height = 107 + Width = 370 + object lbRecurEvery: TLabel + Left = 4 + Top = 7 + Width = 59 + Height = 13 + Caption = 'Recur every' + FocusControl = meNumOfWeek + end + object lbWeeksOn: TLabel + Left = 117 + Top = 7 + Width = 57 + Height = 13 + Caption = 'week(s) on:' + end + object cbDayOfWeek4: TcxCheckBox + Tag = 4 + Left = 268 + Top = 38 + Caption = 'Wednesday' + Properties.OnChange = DoChange + TabOrder = 0 + Width = 90 + end + object meNumOfWeek: TcxMaskEdit + Left = 74 + Top = 3 + Properties.MaskKind = emkRegExpr + Properties.EditMask = '\d{0,4}' + Properties.MaxLength = 0 + Properties.OnChange = DoChange + TabOrder = 1 + OnExit = ValidateNumber + Width = 32 + end + object cbDayOfWeek2: TcxCheckBox + Tag = 2 + Left = 90 + Top = 38 + Caption = 'Monday' + Properties.OnChange = DoChange + TabOrder = 2 + Width = 90 + end + object cbDayOfWeek3: TcxCheckBox + Tag = 3 + Left = 179 + Top = 38 + Caption = 'Tuesday' + Properties.OnChange = DoChange + TabOrder = 3 + Width = 90 + end + object cbDayOfWeek5: TcxCheckBox + Tag = 5 + Left = 1 + Top = 62 + Caption = 'Thursday' + Properties.OnChange = DoChange + TabOrder = 4 + Width = 90 + end + object cbDayOfWeek6: TcxCheckBox + Tag = 6 + Left = 90 + Top = 62 + Caption = 'Friday' + Properties.OnChange = DoChange + TabOrder = 5 + Width = 90 + end + object cbDayOfWeek7: TcxCheckBox + Tag = 7 + Left = 179 + Top = 62 + Caption = 'Saturday' + Properties.OnChange = DoChange + TabOrder = 6 + Width = 90 + end + object cbDayOfWeek1: TcxCheckBox + Tag = 1 + Left = 1 + Top = 38 + Caption = 'Sunday' + Properties.OnChange = DoChange + TabOrder = 7 + Width = 90 + end + end + object pnlDaily: TcxGroupBox + Left = 94 + Top = 18 + Align = alCustom + PanelStyle.Active = True + PanelStyle.OfficeBackgroundKind = pobkStyleColor + Style.BorderStyle = ebsNone + TabOrder = 3 + Visible = False + Height = 107 + Width = 370 + object lbDay: TLabel + Left = 115 + Top = 7 + Width = 18 + Height = 13 + Caption = 'day' + end + object rbEvery: TcxRadioButton + Left = 2 + Top = 6 + Width = 66 + Height = 17 + Caption = 'Every' + Checked = True + TabOrder = 0 + TabStop = True + OnClick = DoChange + end + object meDay: TcxMaskEdit + Left = 74 + Top = 3 + Properties.MaskKind = emkRegExpr + Properties.EditMask = '\d{0,4}' + Properties.MaxLength = 0 + Properties.OnChange = meDayPropertiesChange + TabOrder = 1 + OnExit = ValidateNumber + Width = 32 + end + object rbEveryWeekday: TcxRadioButton + Left = 2 + Top = 35 + Width = 113 + Height = 17 + Caption = 'Every weekday' + TabOrder = 2 + OnClick = rbEveryWeekdayClick + end + end + object pnlPeriodicity: TcxGroupBox + Left = 2 + Top = 18 + PanelStyle.Active = True + PanelStyle.OfficeBackgroundKind = pobkStyleColor + Style.BorderStyle = ebsNone + TabOrder = 4 + Height = 107 + Width = 93 + object Bevel1: TBevel + Left = 90 + Top = 8 + Width = 3 + Height = 93 + Shape = bsLeftLine + end + object rbYearly: TcxRadioButton + Tag = 3 + Left = 8 + Top = 80 + Width = 80 + Height = 17 + Caption = 'Yearly' + TabOrder = 0 + OnClick = SelectPeriodicityClick + end + object rbWeekly: TcxRadioButton + Tag = 1 + Left = 8 + Top = 32 + Width = 80 + Height = 17 + Caption = 'Weekly' + TabOrder = 1 + OnClick = SelectPeriodicityClick + end + object rbMonthly: TcxRadioButton + Tag = 2 + Left = 8 + Top = 56 + Width = 80 + Height = 17 + Caption = 'Monthly' + TabOrder = 2 + OnClick = SelectPeriodicityClick + end + object rbDaily: TcxRadioButton + Left = 8 + Top = 8 + Width = 80 + Height = 17 + Caption = 'Daily' + Checked = True + TabOrder = 3 + TabStop = True + OnClick = SelectPeriodicityClick + end + end + end + object gbRange: TcxGroupBox + Left = 8 + Top = 191 + Caption = 'Range of recurrence' + TabOrder = 5 + Height = 97 + Width = 466 + object lbStart1: TLabel + Left = 16 + Top = 28 + Width = 28 + Height = 13 + Caption = 'Start:' + FocusControl = deStart + Transparent = True + end + object lbOccurrences: TLabel + Left = 332 + Top = 44 + Width = 58 + Height = 13 + Caption = 'occurrences' + Transparent = True + end + object deStart: TcxDateEdit + Left = 56 + Top = 24 + Properties.DateButtons = [btnToday] + Properties.InputKind = ikStandard + Properties.OnChange = DoChange + Properties.OnEditValueChanged = deStartPropertiesEditValueChanged + TabOrder = 0 + Width = 135 + end + object rbNoEndDate: TcxRadioButton + Left = 216 + Top = 16 + Width = 113 + Height = 17 + Caption = 'No end date' + Checked = True + TabOrder = 1 + TabStop = True + OnClick = rbNoEndDateClick + Transparent = True + end + object rbEndAfter: TcxRadioButton + Left = 216 + Top = 43 + Width = 73 + Height = 17 + Caption = 'End after:' + TabOrder = 2 + OnClick = DoChange + Transparent = True + end + object rbEndBy: TcxRadioButton + Left = 216 + Top = 70 + Width = 73 + Height = 17 + Caption = 'End by:' + TabOrder = 3 + OnClick = DoChange + Transparent = True + end + object deEndBy: TcxDateEdit + Tag = 11453468 + Left = 292 + Top = 66 + Properties.DateButtons = [btnToday] + Properties.InputKind = ikStandard + Properties.OnChange = deEndByPropertiesChange + Properties.OnEditValueChanged = deEndByPropertiesEditValueChanged + TabOrder = 5 + Width = 135 + end + object meEndAfter: TcxMaskEdit + Tag = 11452416 + Left = 292 + Top = 39 + Properties.MaskKind = emkRegExpr + Properties.EditMask = '\d{0,4}' + Properties.MaxLength = 0 + Properties.OnChange = meEndAfterPropertiesChange + Properties.OnEditValueChanged = meEndAfterPropertiesEditValueChanged + TabOrder = 4 + OnExit = meEndAfterExit + Width = 32 + end + end +end diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerRecurrenceEditor.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerRecurrenceEditor.pas new file mode 100644 index 00000000..1713802e --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerRecurrenceEditor.pas @@ -0,0 +1,1214 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerRecurrenceEditor; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls, cxStyles, cxGraphics, cxEdit, cxControls, + cxContainer, cxTextEdit, cxMaskEdit, cxDropDownEdit, cxCalendar, + ComCtrls, cxLookAndFeelPainters, cxButtons, cxCheckBox, cxRadioGroup, + cxSpinEdit, cxTimeEdit, cxGroupBox, cxSchedulerStorage, cxLookAndFeels, + cxSchedulerUtils, cxDateUtils, cxSchedulerEventEditor, Menus; + +type + + { TcxSchedulerCustomRecurrenceEventEditor } + + TcxSchedulerCustomRecurrenceEventEditor = class(TcxSchedulerCustomEditorForm) + private + FNeedCheckLossOfExceptions: Boolean; + procedure SetNeedCheckLossOfExceptions(AValue: Boolean); + protected + procedure SaveChanges; virtual; + public + constructor CreateEx(AEvent: TcxSchedulerControlEvent); override; + + property NeedCheckLossOfExceptions: Boolean read FNeedCheckLossOfExceptions write SetNeedCheckLossOfExceptions; + end; + + { TcxSchedulerRecurrenceEventEditor } + + TcxSchedulerRecurrenceEventEditorForm = class(TcxSchedulerCustomRecurrenceEventEditor) + gbTime: TcxGroupBox; + lbStart: TLabel; + lbEnd: TLabel; + teStart: TcxTimeEdit; + teEnd: TcxTimeEdit; + gbPattern: TcxGroupBox; + Bevel1: TBevel; + rbDaily: TcxRadioButton; + rbWeekly: TcxRadioButton; + rbMonthly: TcxRadioButton; + rbYearly: TcxRadioButton; + lbOfEvery: TLabel; + lbMonths: TLabel; + lbOfEvery1: TLabel; + lbMonths1: TLabel; + rbDay: TcxRadioButton; + rbThe: TcxRadioButton; + cbWeek: TcxComboBox; + cbDay: TcxComboBox; + lbWeeksOn: TLabel; + lbRecurEvery: TLabel; + cbDayOfWeek1: TcxCheckBox; + cbDayOfWeek2: TcxCheckBox; + cbDayOfWeek3: TcxCheckBox; + cbDayOfWeek4: TcxCheckBox; + cbDayOfWeek5: TcxCheckBox; + cbDayOfWeek6: TcxCheckBox; + cbDayOfWeek7: TcxCheckBox; + lbOf: TLabel; + rbEvery1: TcxRadioButton; + rbThe1: TcxRadioButton; + cbMonths: TcxComboBox; + cbWeek1: TcxComboBox; + cbDay1: TcxComboBox; + cbMonths1: TcxComboBox; + rbEvery: TcxRadioButton; + rbEveryWeekday: TcxRadioButton; + gbRange: TcxGroupBox; + lbStart1: TLabel; + lbOccurrences: TLabel; + deStart: TcxDateEdit; + rbNoEndDate: TcxRadioButton; + rbEndAfter: TcxRadioButton; + rbEndBy: TcxRadioButton; + deEndBy: TcxDateEdit; + btnOk: TcxButton; + btnCancel: TcxButton; + btnRemove: TcxButton; + lbDay: TLabel; + meDay: TcxMaskEdit; + meNumOfWeek: TcxMaskEdit; + meNumMonth1: TcxMaskEdit; + meNumMonth: TcxMaskEdit; + meDayOfMonth: TcxMaskEdit; + meEndAfter: TcxMaskEdit; + meNumOfDay: TcxMaskEdit; + lbDuration: TLabel; + cbDuration: TcxComboBox; + pnlDaily: TcxGroupBox; + pnlWeekly: TcxGroupBox; + pnlMonthly: TcxGroupBox; + pnlYearly: TcxGroupBox; + pnlPeriodicity: TcxGroupBox; + procedure SelectPeriodicityClick(Sender: TObject); + procedure meEndAfterPropertiesChange(Sender: TObject); + procedure deEndByPropertiesChange(Sender: TObject); + procedure rbNoEndDateClick(Sender: TObject); + procedure meEndAfterExit(Sender: TObject); + procedure ValidateNumber(Sender: TObject); + procedure meDayPropertiesChange(Sender: TObject); + procedure rbEveryWeekdayClick(Sender: TObject); + procedure SetDayRadioButtonChecked(Sender: TObject); + procedure SetTheRadioButtonChecked(Sender: TObject); + procedure deStartPropertiesEditValueChanged(Sender: TObject); + procedure DoChange(Sender: TObject); + procedure cbMonthsPropertiesChange(Sender: TObject); + procedure cbWeek1PropertiesChange(Sender: TObject); + procedure btnOkClick(Sender: TObject); + procedure deEndByPropertiesEditValueChanged(Sender: TObject); + procedure meEndAfterPropertiesEditValueChanged(Sender: TObject); + procedure cbDurationPropertiesPopup(Sender: TObject); + procedure cbDurationPropertiesValidate(Sender: TObject; + var DisplayValue: Variant; var ErrorText: TCaption; + var Error: Boolean); + procedure EndTimeChanged(Sender: TObject); + procedure StartTimeChanged(Sender: TObject); + private + FLocked: Boolean; + procedure CheckViewRecurrence; + procedure FillDays; + procedure FillMonths; + procedure FillWeeks; + function GetActivePattern: TcxRecurrence; + function GetRecurrenceInfo: TcxSchedulerEventRecurrenceInfo; + function GetDayOfWeekIndex: Integer; + function GetMonthIndex: Integer; + function GetNumber(const S: string): Integer; + function GetWeekIndex: Integer; + function GetCurrentDuration: TDateTime; + function IsValidDailyPattern: Boolean; + function IsValidMonthlyPattern: Boolean; + function IsValidWeeklyPattern: Boolean; + function IsValidYearlyPattern: Boolean; + procedure ResetDailyTab; + procedure ResetMonthlyTab; + procedure ResetWeeklyTab; + procedure ResetYearlyTab; + procedure SelectDaysOfWeek(ADays: TDays); + procedure SetActivePattern(Value: TcxRecurrence); + procedure SetDailyPatternFromEvent; + procedure SetDateWithoutChangeEvent(AEdit: TcxDateEdit; ADate: TDateTime); + procedure SetItemIndexWithoutChangeEvent(AEdit: TcxComboBox; AIndex: Integer); + procedure SetMonthlyPatternFromEvent; + procedure SetPatternFromEvent; + procedure SetTextWithoutChangeEvent(AEdit: TcxCustomMaskEdit; const AText: string); + procedure SetTimeWithoutChangeEvent(AEdit: TcxTimeEdit; ATime: TDateTime); + procedure SetupDaysOfWeek; + procedure SetWeeklyPatternFromEvent; + procedure SetYearlyPatternFromEvent; + protected + procedure ApplyChanges; override; + function CheckLostExceptions: Boolean; + procedure FillCombos; virtual; + + function GetFormColor: TColor; override; + function GetRecurrenceInfoValidStatus: TcxRecurrenceValidStatus; + procedure InitializeControls; override; + function IsValid: Boolean; + procedure LoadEventValuesIntoControls; override; + procedure SaveEvent(AEvent: TcxSchedulerControlEvent); + procedure SaveRecurrenceInfo(AInfo: TcxSchedulerEventRecurrenceInfo); virtual; + procedure SaveDailyParams(AInfo: TcxSchedulerEventRecurrenceInfo); + procedure SaveWeeklyParams(AInfo: TcxSchedulerEventRecurrenceInfo); + procedure SaveMonthlyParams(AInfo: TcxSchedulerEventRecurrenceInfo); + procedure SaveYearlyParams(AInfo: TcxSchedulerEventRecurrenceInfo); + procedure SetCaptions; virtual; + procedure SetEndAfter; + procedure SetEndDate; + procedure SetEventRecurrenceFinish; + procedure SetReadOnly(AValue: Boolean); override; + procedure UpdateDuration; + procedure UpdateEventValuesFromControls; override; + procedure UpdateRange; + + property ActivePattern: TcxRecurrence read GetActivePattern write SetActivePattern; + property Info: TcxSchedulerEventRecurrenceInfo read GetRecurrenceInfo; + property Locked: Boolean read FLocked write FLocked; + public + property Event; + property Modified; + property NeedCheckLossOfExceptions; + property ReadOnly; + end; + + TcxSchedulerRecurrenceEventEditor = TcxSchedulerRecurrenceEventEditorForm; //workaround for Delphi 2005 + + TcxSchedulerRecurrenceEventEditorClass = class of TcxSchedulerCustomRecurrenceEventEditor; + +implementation + +uses + cxSchedulerStrs, cxClasses, {$IFDEF DELPHI6}Variants, DateUtils, {$ENDIF} cxSchedulerDialogs; + +{$R *.dfm} + +function cxDayTypeFromType(AIndex: Integer): TcxDayType; +begin + if AIndex < 0 then AIndex := 0; + Inc(AIndex); + if AIndex >= Byte(cxdtSaturday) then + Result := cxdtSaturday + else + Result := TcxDayType(AIndex); +end; + +function cxDayNumberFromRange(AIndex: Integer): Integer; +begin + Result := AIndex + 1; +end; + +{ TcxSchedulerCustomRecurrenceEventEditor } + +constructor TcxSchedulerCustomRecurrenceEventEditor.CreateEx( + AEvent: TcxSchedulerControlEvent); +begin + inherited CreateEx(AEvent); + FNeedCheckLossOfExceptions := (Event.Pattern <> nil) and Event.Pattern.HasExceptions; +end; + +procedure TcxSchedulerCustomRecurrenceEventEditor.SaveChanges; +begin + Event.EventType := etPattern; + if Event.Pattern = nil then + FModified := True; + UpdateEventValuesFromControls; +end; + +procedure TcxSchedulerCustomRecurrenceEventEditor.SetNeedCheckLossOfExceptions( + AValue: Boolean); +begin + FNeedCheckLossOfExceptions := FNeedCheckLossOfExceptions and AValue; +end; + +{ TcxSchedulerRecurrenceEventEditor } + +procedure TcxSchedulerRecurrenceEventEditorForm.SelectPeriodicityClick( + Sender: TObject); +begin + if Locked then Exit; + CheckViewRecurrence; + ActivePattern := TcxRecurrence(TcxRadioButton(Sender).Tag); +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.ApplyChanges; +begin + case ModalResult of + mrOk: + if not ReadOnly then + SaveChanges; + mrAbort: + begin + if not IsInternalActivation and (Event.Pattern <> nil) then + Event.Pattern.DeleteExceptions; + Event.EventType := etNone; + FModified := True; + end; + mrCancel: + if (Event.Source = nil) and (Event.EventType <> etPattern) then + Event.EventType := etNone; + end; +end; + +function TcxSchedulerRecurrenceEventEditorForm.CheckLostExceptions: Boolean; +begin + Result := not FNeedCheckLossOfExceptions or + (MessageDlg(cxGetResourceString(@scxConfirmLostExceptions), mtWarning, [mbOK, mbCancel], 0) = mrOk); +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.FillCombos; +begin + cxComboBoxPopulateWithTimeIntervals(cbDuration); + FillDays; + FillMonths; + FillWeeks; +end; + +function TcxSchedulerRecurrenceEventEditorForm.GetFormColor: TColor; +begin + Result := teStart.Style.LookAndFeel.Painter.DefaultSchedulerControlColor; +end; + +function TcxSchedulerRecurrenceEventEditorForm.GetRecurrenceInfoValidStatus: TcxRecurrenceValidStatus; +var + AEvent: TcxSchedulerControlEvent; +begin + AEvent := TcxSchedulerControlEvent.Create(Event.Storage); + try + SaveEvent(AEvent); + AEvent.EventType := etPattern; + Result := AEvent.RecurrenceInfo.GetValidStatus; + finally + AEvent.Free; + end; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.InitializeControls; +begin + SetCaptions; + FillCombos; + teStart.Properties.Use24HourFormat := Is24HourTimeFormat; + teEnd.Properties.Use24HourFormat := Is24HourTimeFormat; +end; + +function TcxSchedulerRecurrenceEventEditorForm.IsValid: Boolean; +begin + case ActivePattern of + cxreDaily: + Result := IsValidDailyPattern; + cxreWeekly: + Result := IsValidWeeklyPattern; + cxreMonthly: + Result := IsValidMonthlyPattern; + else //cxreYearly + Result := IsValidYearlyPattern; + end; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.LoadEventValuesIntoControls; +begin + FLocked := True; + teStart.Time := TimeOf(Event.Start); + teEnd.Time := TimeOf(Event.Finish); + cbDuration.Text := cxMinutesToTextProc(Round(Event.Duration / MinuteToTime)); + + SetDateWithoutChangeEvent(deStart, DateOf(Event.Start)); + SetPatternFromEvent; + SetEventRecurrenceFinish; + FLocked := False; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SaveEvent( + AEvent: TcxSchedulerControlEvent); +begin + if AEvent <> Event then + AEvent.Assign(Event); + SaveRecurrenceInfo(AEvent.RecurrenceInfo); +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SaveRecurrenceInfo( + AInfo: TcxSchedulerEventRecurrenceInfo); +var + AStart, AFinish: TDateTime; +begin + AStart := deStart.Date + teStart.Time; + AFinish := AStart + GetCurrentDuration; + //correct event time + with AInfo.Event do + begin + AllDayEvent := (TimeOf(AStart) = 0) and (TimeOf(AFinish) = 0) and (AFinish - AStart >= 1); + Start := AStart; + Finish := AFinish; + end; + + AInfo.Recurrence := ActivePattern; + if rbNoEndDate.Checked then + AInfo.Count := -1 + else if rbEndAfter.Checked then + AInfo.Count := GetNumber(meEndAfter.Text) + else + begin + AInfo.Count := 0; + AInfo.Finish := deEndBy.Date; + end; + case ActivePattern of + cxreDaily: SaveDailyParams(AInfo); + cxreWeekly: SaveWeeklyParams(AInfo); + cxreMonthly: SaveMonthlyParams(AInfo); + cxreYearly: SaveYearlyParams(AInfo); + end; + if not Locked then + AInfo.Validate; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SaveDailyParams( + AInfo: TcxSchedulerEventRecurrenceInfo); +begin + if rbEvery.Checked then + begin + AInfo.DayType := cxdtEveryDay; + AInfo.Periodicity := GetNumber(meDay.Text); + end + else + begin + AInfo.DayType := cxdtWeekDay; + AInfo.Periodicity := 1; + end; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SaveWeeklyParams( + AInfo: TcxSchedulerEventRecurrenceInfo); + + procedure Check(ACheckBox: TcxCheckBox; var AOccurDays: TDays); + begin + if ACheckBox.Checked then + Include(AOccurDays, TDay(ACheckBox.Tag - 1)); + end; + +var + AOccurDays: TDays; +begin + AInfo.Periodicity := GetNumber(meNumOfWeek.Text); + AOccurDays := []; + Check(cbDayOfWeek1, AOccurDays); + Check(cbDayOfWeek2, AOccurDays); + Check(cbDayOfWeek3, AOccurDays); + Check(cbDayOfWeek4, AOccurDays); + Check(cbDayOfWeek5, AOccurDays); + Check(cbDayOfWeek6, AOccurDays); + Check(cbDayOfWeek7, AOccurDays); + AInfo.OccurDays := AOccurDays; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SaveMonthlyParams( + AInfo: TcxSchedulerEventRecurrenceInfo); +begin + if rbDay.Checked then + begin + AInfo.DayType := cxdtDay; + AInfo.DayNumber := GetNumber(meNumOfDay.Text); + AInfo.Periodicity := GetNumber(meNumMonth.Text);; + end + else + begin + AInfo.DayType := cxDayTypeFromType(cbDay.ItemIndex); + AInfo.DayNumber := cxDayNumberFromRange(cbWeek.ItemIndex); + AInfo.Periodicity := GetNumber(meNumMonth1.Text); + end; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SaveYearlyParams( + AInfo: TcxSchedulerEventRecurrenceInfo); +begin + if rbEvery1.Checked then + begin + AInfo.DayType := cxdtDay; + AInfo.Periodicity := cbMonths.ItemIndex + 1; + AInfo.DayNumber := GetNumber(meDayOfMonth.Text); + end + else + begin + AInfo.DayType := cxDayTypeFromType(cbDay1.ItemIndex); + AInfo.DayNumber := cxDayNumberFromRange(cbWeek1.ItemIndex); + AInfo.Periodicity := cbMonths1.ItemIndex + 1; + end; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SetCaptions; +begin + Caption := cxGetResourceString(@scxRecurrenceCaption); + // time + gbTime.Caption := cxGetResourceString(@scxEventTime); + lbStart.Caption := cxGetResourceString(@scxStart); + lbEnd.Caption := cxGetResourceString(@scxEnd); + lbDuration.Caption := cxGetResourceString(@scxDuration); + // pattern + gbPattern.Caption := cxGetResourceString(@scxRecurrencePattern); + rbDaily.Caption := cxGetResourceString(@scxDaily); + rbWeekly.Caption := cxGetResourceString(@scxWeekly); + rbMonthly.Caption := cxGetResourceString(@scxMonthly); + rbYearly.Caption := cxGetResourceString(@scxYearly); + // daily + rbEvery.Caption := cxGetResourceString(@scxEvery); + rbEveryWeekday.Caption := cxGetResourceString(@scxEveryWeekDay); + lbDay.Caption := cxGetResourceString(@scxDay1); + // weekly + lbRecurEvery.Caption := cxGetResourceString(@scxRecurEvery); + lbWeeksOn.Caption := cxGetResourceString(@scxWeeksOn); + SetupDaysOfWeek; + // mothly + lbOfEvery.Caption := cxGetResourceString(@scxOfEvery); + lbOfEvery1.Caption := lbOfEvery.Caption; + lbMonths.Caption := cxGetResourceString(@scxMonths); + lbMonths1.Caption := lbMonths.Caption; + rbDay.Caption := cxGetResourceString(@scxDay); + rbThe.Caption := cxGetResourceString(@scxThe); + // yearly + rbEvery1.Caption := rbEvery.Caption; + rbThe1.Caption := rbThe.Caption; + lbOf.Caption := cxGetResourceString(@scxOf); + // range of recurrence + gbRange.Caption := cxGetResourceString(@scxRangeOfRecurrence); + lbStart1.Caption := cxGetResourceString(@scxStart1); + rbNoEndDate.Caption := cxGetResourceString(@scxNoEndDate); + rbEndAfter.Caption := cxGetResourceString(@scxEndAfter); + rbEndBy.Caption := cxGetResourceString(@scxEndBy); + lbOccurrences.Caption := cxGetResourceString(@scxOccurences); + // buttons + btnOk.Caption := cxGetResourceString(@scxOk); + btnCancel.Caption := cxGetResourceString(@scxCancel); + btnRemove.Caption := cxGetResourceString(@scxRemoveRecur); +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SetEndAfter; +var + ACount: Integer; + AEvent: TcxSchedulerControlEvent; +begin + AEvent := TcxSchedulerControlEvent.Create(Event.Storage); + try + SaveEvent(AEvent); + with TcxSchedulerOccurrenceCalculator.Create(AEvent, 0, 0) do + try + ACount := GetOccurrenceCount(deEndBy.Date + TimeOf(teEnd.Time)); + finally + Free; + end; + finally + AEvent.Free; + end; + if ACount < 1 then + ACount := 1; + SetTextWithoutChangeEvent(meEndAfter, IntToStr(ACount)); +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SetEndDate; +var + ADate: TDateTime; + AEvent: TcxSchedulerControlEvent; +begin + AEvent := TcxSchedulerControlEvent.Create(Event.Storage); + try + SaveEvent(AEvent); + AEvent.RecurrenceInfo.Count := GetNumber(meEndAfter.Text); + ADate := AEvent.RecurrenceInfo.GetEndDate; + finally + AEvent.Free; + end; + SetDateWithoutChangeEvent(deEndBy, ADate); +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SetEventRecurrenceFinish; +var + ACount: Integer; +begin + with TcxSchedulerOccurrenceCalculator.Create(Event, 0, 0) do + try + ACount := Info.Count; + if ACount < 0 then ACount := 10; + if ACount > 0 then + begin + if Info.Count < 0 then + rbNoEndDate.Checked := True + else + rbEndAfter.Checked := True; + CalcOccurrence(ACount); + SetDateWithoutChangeEvent(deEndBy, DateOf(OccurrenceStart)); + end + else + begin + rbEndBy.Checked := True; + SetDateWithoutChangeEvent(deEndBy, DateOf(Info.Finish)); + ACount := GetOccurrenceCount(Info.Finish); + if ACount < 1 then ACount := 1; + end; + SetTextWithoutChangeEvent(meEndAfter, IntToStr(ACount)); + finally + Free; + end; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SetReadOnly( + AValue: Boolean); +begin + inherited; + gbTime.Enabled := not AValue; + gbPattern.Enabled := not AValue; + gbRange.Enabled := not AValue; + btnCancel.Enabled := not AValue; + btnRemove.Enabled := not AValue; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.UpdateDuration; +var + ADuration: TDateTime; +begin + ADuration := DateOf(GetCurrentDuration) + (teEnd.Time - teStart.Time); + if ADuration < 0 then ADuration := ADuration + 1; + SetTextWithoutChangeEvent(cbDuration, cxMinutesToTextProc(Round(ADuration / MinuteToTime))); +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.UpdateEventValuesFromControls; +begin + SaveEvent(Event); + Event.Finish := Event.Start + GetCurrentDuration; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.UpdateRange; +begin + if rbEndBy.Checked then + SetEndAfter + else + SetEndDate; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.CheckViewRecurrence; +begin + if rbDaily.Checked then + ResetDailyTab; + if rbWeekly.Checked then + ResetWeeklyTab; + if rbMonthly.Checked then + ResetMonthlyTab; + if rbYearly.Checked then + ResetYearlyTab; + pnlDaily.Visible := rbDaily.Checked; + pnlWeekly.Visible := rbWeekly.Checked; + pnlMonthly.Visible := rbMonthly.Checked; + pnlYearly.Visible := rbYearly.Checked; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.FillDays; +var + S: TStrings; + I: Integer; +begin + S := cbDay.Properties.Items; + S.BeginUpdate; + try + S.Add(cxGetResourceString(@scxDay1)); + S.Add(cxGetResourceString(@scxWeekday)); + S.Add(cxGetResourceString(@scxWeekendday)); + for I := 1 to 7 do + S.Add(LongDayNames[I]); + finally + S.EndUpdate; + end; + cbDay1.Properties.Items.Assign(S); +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.FillMonths; +var + S: TStrings; + I: Integer; +begin + S := cbMonths.Properties.Items; + S.BeginUpdate; + try + for I := 1 to 12 do + S.Add(LongMonthNames[I]); + finally + S.EndUpdate; + end; + cbMonths1.Properties.Items.Assign(S); +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.FillWeeks; +var + S: TStrings; + I: Integer; +begin + S := cbWeek.Properties.Items; + S.BeginUpdate; + try + for I := 0 to 4 do + S.Add(cxGetResourceString(sRangeNames[I])); + finally + S.EndUpdate; + end; + cbWeek1.Properties.Items.Assign(S); +end; + +function TcxSchedulerRecurrenceEventEditorForm.GetActivePattern: TcxRecurrence; +begin + if rbDaily.Checked then + Result := cxreDaily + else + if rbWeekly.Checked then + Result := cxreWeekly + else + if rbMonthly.Checked then + Result := cxreMonthly + else + Result := cxreYearly; +end; + +function TcxSchedulerRecurrenceEventEditorForm.GetRecurrenceInfo: TcxSchedulerEventRecurrenceInfo; +begin + Result := Event.RecurrenceInfo; +end; + +function TcxSchedulerRecurrenceEventEditorForm.GetDayOfWeekIndex: Integer; +begin + Result := DayOfWeek(Info.Start) + 2; +end; + +function TcxSchedulerRecurrenceEventEditorForm.GetMonthIndex: Integer; +begin + Result := MonthOf(Info.Start) - 1; +end; + +function TcxSchedulerRecurrenceEventEditorForm.GetNumber(const S: string): Integer; +begin + Result := StrToIntDef(Trim(S), 1); +end; + +function TcxSchedulerRecurrenceEventEditorForm.GetWeekIndex: Integer; +var + Y, M, D: Word; +begin + DecodeDate(Info.Start, Y, M, D); + Result := D div 7; +end; + +function TcxSchedulerRecurrenceEventEditorForm.GetCurrentDuration: TDateTime; +var + AMinutes: Integer; +begin + if cxTextToMinutesProc(cbDuration.Text, AMinutes) then + Result := AMinutes * MinuteToTime + else + Result := Event.Duration; +end; + +function TcxSchedulerRecurrenceEventEditorForm.IsValidDailyPattern: Boolean; +begin + Result := GetNumber(meDay.Text) >= 1; + if not Result then + begin + ActiveControl := meDay; + Exit; + end; +end; + +function TcxSchedulerRecurrenceEventEditorForm.IsValidMonthlyPattern: Boolean; +begin + Result := False; + if not GetNumber(meNumOfDay.Text) in [1..31] then + begin + ActiveControl := meNumOfDay; + Exit; + end; + if GetNumber(meNumMonth.Text) < 1 then + begin + ActiveControl := meNumMonth; + Exit; + end; + if GetNumber(meNumMonth1.Text) < 1 then + begin + ActiveControl := meNumMonth1; + Exit; + end; + Result := True; +end; + +function TcxSchedulerRecurrenceEventEditorForm.IsValidWeeklyPattern: Boolean; +begin + Result := False; + if GetNumber(meNumOfWeek.Text) < 1 then + begin + ActiveControl := meNumOfWeek; + Exit; + end; + if not (cbDayOfWeek1.Checked or cbDayOfWeek2.Checked or + cbDayOfWeek3.Checked or cbDayOfWeek4.Checked or cbDayOfWeek5.Checked or + cbDayOfWeek6.Checked or cbDayOfWeek7.Checked) then + begin + ActiveControl := cbDayOfWeek1; + Exit; + end; + Result := True; +end; + +function TcxSchedulerRecurrenceEventEditorForm.IsValidYearlyPattern: Boolean; +var + ADay: Integer; +begin + ADay := GetNumber(meDayOfMonth.Text); + Result := (ADay >=1) and (ADay <= DaysPerMonth(2000, cbMonths.ItemIndex + 1)); + if not Result then + ActiveControl := meDayOfMonth; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.ResetDailyTab; +begin + SetTextWithoutChangeEvent(meDay, '1'); + rbEvery.Checked := True; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.ResetMonthlyTab; +begin + SetTextWithoutChangeEvent(meNumOfDay, IntToStr(DayOf(Info.Start))); + SetTextWithoutChangeEvent(meNumMonth, '1'); + SetTextWithoutChangeEvent(meNumMonth1, '1'); + cbWeek.ItemIndex := GetWeekIndex; + cbDay.ItemIndex := GetDayOfWeekIndex; + rbDay.Checked := True; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.ResetWeeklyTab; +begin + SetTextWithoutChangeEvent(meNumOfWeek, '1'); + SelectDaysOfWeek([TDay(DayOfWeek(Info.Start) - 1)]); +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.ResetYearlyTab; +begin + cbDay1.ItemIndex := GetDayOfWeekIndex; + meDayOfMonth.Text := IntToStr(DayOf(Info.Start)); + cbWeek1.ItemIndex := GetWeekIndex; + cbMonths.ItemIndex := GetMonthIndex; + cbMonths1.ItemIndex := GetMonthIndex; + rbEvery1.Checked := True; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SelectDaysOfWeek(ADays: TDays); + + procedure Check(ACheckBox: TcxCheckBox); + begin + ACheckBox.Checked := TDay(ACheckBox.Tag - 1) in ADays; + end; + +begin + Check(cbDayOfWeek1); + Check(cbDayOfWeek2); + Check(cbDayOfWeek3); + Check(cbDayOfWeek4); + Check(cbDayOfWeek5); + Check(cbDayOfWeek6); + Check(cbDayOfWeek7); +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SetActivePattern( + Value: TcxRecurrence); +begin + UpdateRange; + FModified := True; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SetDailyPatternFromEvent; +begin + rbDaily.Checked := True; + CheckViewRecurrence; + if Info.DayType = cxdtWeekDay then + begin + rbEveryWeekday.Checked := True; + SetTextWithoutChangeEvent(meDay, '1'); + end + else + begin + rbEvery.Checked := True; + SetTextWithoutChangeEvent(meDay, IntToStr(Info.Periodicity)); + end; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SetDateWithoutChangeEvent( + AEdit: TcxDateEdit; ADate: TDateTime); +var + AOnChange, AOnEditValueChanged: TNotifyEvent; +begin + AOnChange := AEdit.Properties.OnChange; + AOnEditValueChanged := AEdit.Properties.OnEditValueChanged; + AEdit.Properties.OnChange := nil; + AEdit.Properties.OnEditValueChanged := nil; + AEdit.Date := ADate; + AEdit.Properties.OnChange := AOnChange; + AEdit.Properties.OnEditValueChanged := AOnEditValueChanged; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SetItemIndexWithoutChangeEvent( + AEdit: TcxComboBox; AIndex: Integer); +var + AOnChange: TNotifyEvent; +begin + AOnChange := AEdit.Properties.OnChange; + AEdit.Properties.OnChange := nil; + AEdit.ItemIndex := AIndex; + AEdit.Properties.OnChange := AOnChange; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SetMonthlyPatternFromEvent; +var + AType: TcxDayType; + ANum: Integer; +begin + rbMonthly.Checked := True; + CheckViewRecurrence; + AType := Info.DayType; + if AType = cxdtDay then + begin + rbDay.Checked := True; + SetTextWithoutChangeEvent(meNumOfDay, IntToStr(Info.DayNumber)); + SetTextWithoutChangeEvent(meNumMonth, IntToStr(Info.Periodicity)); + end + else + begin + rbThe.Checked := True; + SetTextWithoutChangeEvent(meNumMonth1, IntToStr(Info.Periodicity)); + ANum := Info.DayNumber; + if Integer(AType) >= 1 then Dec(Byte(AType)); + SetItemIndexWithoutChangeEvent(cbWeek, ANum - 1); + SetItemIndexWithoutChangeEvent(cbDay, Byte(AType)); + end; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SetPatternFromEvent; +begin + ActivePattern := Info.Recurrence; + case Info.Recurrence of + cxreDaily: SetDailyPatternFromEvent; + cxreWeekly: SetWeeklyPatternFromEvent; + cxreMonthly: SetMonthlyPatternFromEvent; + cxreYearly: SetYearlyPatternFromEvent; + end; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SetupDaysOfWeek; + + procedure SetDayCheckBox(ACheck: TcxCheckBox); + var + AIndex: Integer; + begin + AIndex := ACheck.Tag; + Inc(AIndex, TcxSchedulerDateTimeHelper.StartOfWeek); + if AIndex > 7 then Dec(AIndex, 7); + ACheck.Caption := LongDayNames[AIndex]; + ACheck.Tag := AIndex; + end; + +begin + SetDayCheckBox(cbDayOfWeek1); + SetDayCheckBox(cbDayOfWeek2); + SetDayCheckBox(cbDayOfWeek3); + SetDayCheckBox(cbDayOfWeek4); + SetDayCheckBox(cbDayOfWeek5); + SetDayCheckBox(cbDayOfWeek6); + SetDayCheckBox(cbDayOfWeek7); +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SetTextWithoutChangeEvent( + AEdit: TcxCustomMaskEdit; const AText: string); +var + AOnChange, AOnEditValueChanged: TNotifyEvent; + AOnValidate: TcxEditValidateEvent; +begin + AOnChange := AEdit.Properties.OnChange; + AOnEditValueChanged := AEdit.Properties.OnEditValueChanged; + AOnValidate := AEdit.Properties.OnValidate; + AEdit.Properties.OnChange := nil; + AEdit.Properties.OnEditValueChanged := nil; + AEdit.Text := AText; + AEdit.Properties.OnChange := AOnChange; + AEdit.Properties.OnEditValueChanged := AOnEditValueChanged; + AEdit.Properties.OnValidate := AOnValidate; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SetTimeWithoutChangeEvent( + AEdit: TcxTimeEdit; ATime: TDateTime); +var + AOnChange, AOnEditValueChanged: TNotifyEvent; + AOnValidate: TcxEditValidateEvent; +begin + AOnChange := AEdit.Properties.OnChange; + AOnEditValueChanged := AEdit.Properties.OnEditValueChanged; + AOnValidate := AEdit.Properties.OnValidate; + AEdit.Properties.OnChange := nil; + AEdit.Properties.OnEditValueChanged := nil; + AEdit.Time := ATime; + AEdit.Properties.OnChange := AOnChange; + AEdit.Properties.OnEditValueChanged := AOnEditValueChanged; + AEdit.Properties.OnValidate := AOnValidate; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SetWeeklyPatternFromEvent; +begin + rbWeekly.Checked := True; + CheckViewRecurrence; + meNumOfWeek.Text := IntToStr(Info.Periodicity); + if Event.IsRecurring and (Event.Source <> nil) then + SelectDaysOfWeek(Info.OccurDays) + else + SelectDaysOfWeek([TDay(DayOfWeek(Event.Start) - 1)]); +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SetYearlyPatternFromEvent; +var + AType: TcxDayType; + ANum: Integer; +begin + rbYearly.Checked := True; + CheckViewRecurrence; + AType := Info.DayType; + ANum := Info.DayNumber; + if AType = cxdtDay then + begin + rbEvery1.Checked := True; + cbMonths.ItemIndex := Info.Periodicity - 1; + SetTextWithoutChangeEvent(meDayOfMonth, IntToStr(ANum)); + end + else + begin + rbThe1.Checked := True; + cbMonths1.ItemIndex := Info.Periodicity - 1; + if Integer(AType) >= 1 then Dec(Byte(AType)); + SetItemIndexWithoutChangeEvent(cbWeek1, ANum - 1); + SetItemIndexWithoutChangeEvent(cbDay1, Byte(AType)); + end; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.meEndAfterPropertiesChange( + Sender: TObject); +begin + rbEndAfter.Checked := True; + FModified := True; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.deEndByPropertiesChange( + Sender: TObject); +begin + rbEndBy.Checked := True; + FModified := True; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.rbNoEndDateClick( + Sender: TObject); +begin + meEndAfter.Text := '10'; + SetEndDate; + FModified := True; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.meEndAfterExit( + Sender: TObject); +begin + ValidateNumber(Sender); + SetEndDate; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.ValidateNumber( + Sender: TObject); +begin + with TcxMaskEdit(Sender) do + begin + if GetNumber(Text) <= 0 then + begin + MessageDlg(cxGetResourceString(@scxInvalidNumber), mtError, [mbOK], 0); + Text := '1'; + end + else + Text := IntToStr(GetNumber(Text)); + end; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.meDayPropertiesChange( + Sender: TObject); +begin + rbEvery.Checked := True; + FModified := True; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.rbEveryWeekdayClick( + Sender: TObject); +begin + SetTextWithoutChangeEvent(meDay, '1'); + FModified := True; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SetDayRadioButtonChecked( + Sender: TObject); +begin + rbDay.Checked := True; + FModified := True; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.SetTheRadioButtonChecked( + Sender: TObject); +begin + rbThe.Checked := True; + FModified := True; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.deStartPropertiesEditValueChanged( + Sender: TObject); +begin + Event.MoveTo(deStart.Date + teStart.Time); + UpdateRange; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.DoChange(Sender: TObject); +begin + FModified := True; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.cbMonthsPropertiesChange( + Sender: TObject); +begin + rbEvery1.Checked := True; + FModified := True; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.cbWeek1PropertiesChange( + Sender: TObject); +begin + rbThe1.Checked := True; + FModified := True; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.btnOkClick(Sender: TObject); +begin + if IsValid then + begin + case GetRecurrenceInfoValidStatus of + rvsValid: + if CheckLostExceptions then + ModalResult := mrOk; + rvsReplaceOccurrenceDate: + if CheckLostExceptions and (MessageDlg(Format(cxGetResourceString(@scxReplaceOccurrenceDate), + [meNumOfDay.Text]), mtWarning, [mbOK,mbCancel], 0) = mrOk) then ModalResult := mrOk; + rvsInvalidDuration: + MessageDlg(cxGetResourceString(@scxInvalidRecurrenceDuration), mtWarning, [mbOK], 0); + else + MessageDlg(cxGetResourceString(@scxWrongPattern), mtWarning, [mbOK], 0); + end + end + else + MessageDlg(cxGetResourceString(@scxWrongPattern), mtWarning, [mbOK], 0); +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.deEndByPropertiesEditValueChanged( + Sender: TObject); +begin + if Locked then Exit; + SetEndAfter; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.meEndAfterPropertiesEditValueChanged( + Sender: TObject); +begin + if Locked then Exit; + SetEndDate; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.cbDurationPropertiesPopup( + Sender: TObject); +var + AMinutes: Integer; + AText: string; +begin + AText := cbDuration.Text; + if cxTextToMinutesProc(AText, AMinutes) then + begin + cbDuration.Text := cxMinutesToTextProc(AMinutes); + cbDuration.EditModified := not SameText(AText, cbDuration.Text); + cxComboBoxCaretToEnd(cbDuration); + cxComboBoxSetNearestTimeInterval(cbDuration, AMinutes); + end; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.cbDurationPropertiesValidate( + Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; + var Error: Boolean); +var + AMinutes: Integer; +begin + Error := not cxTextToMinutesProc(VarToStr(DisplayValue), AMinutes); + if not Error then + begin + DisplayValue := cxMinutesToTextProc(AMinutes); + cxComboBoxCaretToEnd(TcxComboBox(Sender)); + SetTimeWithoutChangeEvent(teEnd, TimeOf(teStart.Time + AMinutes * MinuteToTime)); + end + else + ErrorText := cxGetResourceString(@scxInvalidNumber); +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.EndTimeChanged( + Sender: TObject); +begin + UpdateDuration; +end; + +procedure TcxSchedulerRecurrenceEventEditorForm.StartTimeChanged( + Sender: TObject); +begin + SetTimeWithoutChangeEvent(teEnd, TimeOf(teStart.Time + GetCurrentDuration)); +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerRecurrenceSelectionDialog.dfm b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerRecurrenceSelectionDialog.dfm new file mode 100644 index 00000000..eca276b6 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerRecurrenceSelectionDialog.dfm @@ -0,0 +1,87 @@ +object fmRecurrenceSelectionForm: TfmRecurrenceSelectionForm + Left = 217 + Top = 476 + BorderStyle = bsDialog + Caption = 'fmRecurrenceSelectionForm' + ClientHeight = 143 + ClientWidth = 261 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poMainFormCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object lbMessage: TLabel + Left = 67 + Top = 8 + Width = 186 + Height = 44 + AutoSize = False + Caption = 'lbMessage' + Transparent = True + WordWrap = True + end + object Image: TImage + Left = 8 + Top = 4 + Width = 49 + Height = 49 + Center = True + end + object pnlControls: TPanel + Left = 0 + Top = 59 + Width = 261 + Height = 84 + Align = alBottom + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 0 + object btnCancel: TcxButton + Left = 136 + Top = 53 + Width = 90 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 0 + end + object rbSeries: TcxRadioButton + Left = 56 + Top = 25 + Width = 193 + Height = 17 + Caption = 'rbSeries' + TabOrder = 1 + Transparent = True + end + object rbOccurrence: TcxRadioButton + Left = 56 + Top = 2 + Width = 201 + Height = 17 + Caption = 'rbOccurrence' + Checked = True + TabOrder = 2 + TabStop = True + Transparent = True + end + object btnOk: TcxButton + Left = 36 + Top = 53 + Width = 90 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 3 + end + end +end diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerRecurrenceSelectionDialog.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerRecurrenceSelectionDialog.pas new file mode 100644 index 00000000..42e3db3d --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerRecurrenceSelectionDialog.pas @@ -0,0 +1,142 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerRecurrenceSelectionDialog; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, {$IFDEF DELPHI6} Variants, {$ENDIF} Classes, + Graphics, Controls, Forms, Dialogs, cxLookAndFeelPainters, ExtCtrls, StdCtrls, + cxButtons, cxRadioGroup, cxSchedulerStorage, Menus; + +type + { TfmRecurrenceSelection } + + TcxRecurrenceSelectionMode = (rsmOpen, rsmDeleting); + + TfmRecurrenceSelectionForm = class(TForm) + lbMessage: TLabel; + rbOccurrence: TcxRadioButton; + rbSeries: TcxRadioButton; + btnOk: TcxButton; + btnCancel: TcxButton; + Image: TImage; + pnlControls: TPanel; + procedure FormCreate(Sender: TObject); + private + FEvent: TcxSchedulerEvent; + FMode: TcxRecurrenceSelectionMode; + protected + procedure DoShow; override; + function GetFormColor: TColor; virtual; + procedure SetCaptions; virtual; + + property Event: TcxSchedulerEvent read FEvent; + property Mode: TcxRecurrenceSelectionMode read FMode; + public + constructor CreateEx(AEvent: TcxSchedulerEvent; + AMode: TcxRecurrenceSelectionMode); virtual; + end; + +implementation + +uses + cxGraphics, cxSchedulerStrs, cxClasses, cxSchedulerDialogs; + +{$R *.dfm} + +{ TfmRecurrenceSelection } + +constructor TfmRecurrenceSelectionForm.CreateEx(AEvent: TcxSchedulerEvent; + AMode: TcxRecurrenceSelectionMode); +begin + Create(Application); + FEvent := AEvent; + FMode := AMode; + Image.Picture.Icon.Handle := LoadIcon(0, IDI_EXCLAMATION); + SetCaptions; +end; + +procedure TfmRecurrenceSelectionForm.DoShow; +begin + if UseSchedulerColorInDialogs then + Color := GetFormColor; +end; + +function TfmRecurrenceSelectionForm.GetFormColor: TColor; +begin + Result := btnOk.LookAndFeel.Painter.DefaultSchedulerControlColor; +end; + +procedure TfmRecurrenceSelectionForm.SetCaptions; +var + AEventCaption: string; +begin + AEventCaption := '"' + Event.Caption + '" '; + if Mode = rsmOpen then + begin + Caption := cxGetResourceString(@scxEditTypeDialogCaption); + lbMessage.Caption := AEventCaption + + cxGetResourceString(@scxEditRecurringEventDescription); + rbOccurrence.Caption := cxGetResourceString(@scxEditTypeOccurrenceLabel); + rbSeries.Caption := cxGetResourceString(@scxEditTypeSeriesLabel); + end + else + begin + Caption := cxGetResourceString(@scxDeleteTypeDialogCaption); + lbMessage.Caption := AEventCaption + + cxGetResourceString(@scxDeleteRecurringEventDescription); + rbOccurrence.Caption := cxGetResourceString(@scxDeleteTypeOccurrenceLabel); + rbSeries.Caption := cxGetResourceString(@scxDeleteTypeSeriesLabel); + end; + btnOk.Caption := cxGetResourcestring(@scxOk); + btnCancel.Caption := cxGetResourcestring(@scxCancel); +end; + +procedure TfmRecurrenceSelectionForm.FormCreate(Sender: TObject); +var + ADelta: Integer; +begin + ADelta := cxGetLabelGrowDelta(lbMessage); + if ADelta > 0 then + begin + Height := Height + ADelta; + pnlControls.Top := pnlControls.Top + ADelta; + end; +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerReg.dcr b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerReg.dcr new file mode 100644 index 00000000..6660ae58 Binary files /dev/null and b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerReg.dcr differ diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerReg.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerReg.pas new file mode 100644 index 00000000..e4664d37 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerReg.pas @@ -0,0 +1,765 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerReg; + +{$I cxVer.inc} + +interface + +uses + Classes, SysUtils, Menus, + Types, DesignIntf, DesignEditors, DesignMenus, VCLEditors, + cxDesignWindows, cxEditPropEditors, cxPropEditors, cxControls, DB, cxDataStorage, + cxDateUtils, cxSchedulerStorage, cxSchedulerDBStorage, cxSchedulerUtils, + cxSchedulerStrs, cxSchedulerDialogs, cxScheduler, cxStyles, cxSchedulerDateNavigator, + cxSchedulerCustomResourceView, cxSchedulerWeekView, cxSchedulerYearView, + cxSchedulerTimeGridView, cxDateNavigator, ImgList, Controls, cxSchedulerHolidays, + cxSchedulerAggregateStorage; + +procedure Register; + +function cxSchedulerComponentEditor: TComponentEditorClass; + +implementation + +uses + Windows, ShellApi, cxSchedulerCustomControls, cxSchedulerDayView, cxSchedulerGanttView, + cxLibraryReg; + +const + cxSchedulerMajorVersion = '3'; + scxSchedulerDescription = 'ExpressScheduler'; + scxSchedulerActiveView = 'Active view'; + scxStorageDescription = 'ExpressSchedulerStorage'; + scxEventsEditor = 'Events editor...'; + scxDefault = 'System'; + scxHolidaysEditor = 'Edit...'; + + ViewNames: array[0..5] of string = + ('Day', 'Week', 'Weeks', 'Year', 'TimeGrid', 'Gantt'); + ViewClasses: array[0..5] of TClass = + (TcxSchedulerDayView, TcxSchedulerWeekView, TcxSchedulerWeeksView, + TcxSchedulerYearView, TcxSchedulerTimeGridView, TcxSchedulerGanttView); + +type + + { TcxSchedulerComponentsEditor } + + TcxSchedulerComponentsEditor = class(TcxComponentEditor) + protected + procedure ActiveViewClick(Sender: TObject); + function CanSelectActiveView: Boolean; + function GetViewByIndex(AIndex: Integer): TcxSchedulerCustomResourceView; + + function GetProductMajorVersion: string; override; + function GetProductName: string; override; + function InternalGetVerb(AIndex: Integer): string; override; + function InternalGetVerbCount: Integer; override; + public + procedure PrepareItem(Index: Integer; + const AItem: TDesignMenuItem); override; + end; + + { TcxSchedulerHolidayComponentsEditor } + + TcxSchedulerHolidayComponentsEditor = class(TcxSchedulerComponentsEditor) + protected + procedure InternalExecuteVerb(AIndex: Integer); override; + function InternalGetVerb(AIndex: Integer): string; override; + function InternalGetVerbCount: Integer; override; + end; + + { TcxSchedulerDBStorageFieldProperty } + + TcxSchedulerDBStorageFieldProperty = class(TFieldNameProperty) + public + function GetDataSource: TDataSource; override; + end; + + { TcxSchedulerDBStorageFieldNameProperty } + + TcxSchedulerDBStorageFieldNameProperty = class(TFieldNameProperty) + public + function GetDataSource: TDataSource; override; + end; + + { TcxSchedulerDBStorageResourceFieldNameProperty } + + TcxSchedulerDBStorageResourceFieldNameProperty = class(TFieldNameProperty) + public + function GetDataSource: TDataSource; override; + end; + + { TcxSchedulerStylesEventsProperty } + + TcxSchedulerStylesEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + + { TcxSchedulerContentPopupMenuEventsProperty } + + TcxSchedulerContentPopupMenuEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + + { TcxSchedulerEventPopupMenuEventsProperty } + + TcxSchedulerEventPopupMenuEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + + { TcxSchedulerStorageResourcesEventsProperty } + + TcxSchedulerStorageResourcesEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + + { TcxSchedulerStorageRemindersEventsProperty } + + TcxSchedulerStorageRemindersEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + + { TcxSchedulerNavigatorEventsProperty } + + TcxSchedulerNavigatorEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + + { TcxSchedulerDateNavigatorEventsProperty } + + TcxSchedulerDateNavigatorEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + + { TcxSchedulerViewDayEventsProperty } + + TcxSchedulerViewDayEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + + { TcxSchedulerTimeZoneProperty } + + TcxSchedulerTimeZoneProperty = class(TIntegerProperty) + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + { TcxSchedulerTimeScaleProperty } + + TcxSchedulerTimeScaleProperty = class(TIntegerProperty) + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + { TcxSchedulerViewYearEventsProperty } + + TcxSchedulerViewYearEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + + { TcxSchedulerViewYearScaleProperty } + + TcxSchedulerViewYearScaleProperty = class(TIntegerProperty) + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + { TcxSchedulerViewTimeGridEventsProperty } + + TcxSchedulerViewTimeGridEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + + { TcxSchedulerViewTimeGridStylesEventsProperty } + + TcxSchedulerViewTimeGridStylesEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + + { TcxSchedulerStorageResourceImageIndexProperty } + + TcxSchedulerStorageResourceImageIndexProperty = class(TImageIndexProperty) + public + function GetImages: TCustomImageList; override; + end; + + { TcxSchedulerHolidayPropertyEditor } + + TcxSchedulerHolidayPropertyEditor = class(TClassProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + +function cxShowSchedulerHolidaysComponentEditor(AHolidays: TcxSchedulerHolidays): Boolean; +begin + Result := cxShowHolidaysEditor(AHolidays, nil); +end; + +{ TcxSchedulerComponentsEditor } + +procedure TcxSchedulerComponentsEditor.PrepareItem(Index: Integer; + const AItem: TDesignMenuItem); +var + I: Integer; + + function GetItemChecked(AIndex: Integer): Boolean; + begin + Result := (TcxScheduler(Component).CurrentView <> nil) and + (TcxScheduler(Component).CurrentView.InheritsFrom(ViewClasses[AIndex])); + end; + +begin + inherited; + if (Index <> 0) or not CanSelectActiveView then Exit; + for I := 0 to High(ViewNames) do + AItem.AddItem(ViewNames[I], 0, GetViewByIndex(I).Active, + GetViewByIndex(I).CanShow, ActiveViewClick); +end; + +procedure TcxSchedulerComponentsEditor.ActiveViewClick(Sender: TObject); +begin + GetViewByIndex((Sender as TMenuItem).MenuIndex).Active := True; +end; + +function TcxSchedulerComponentsEditor.CanSelectActiveView: Boolean; +begin + Result := Component is TcxScheduler; +end; + +function TcxSchedulerComponentsEditor.GetViewByIndex(AIndex: Integer): TcxSchedulerCustomResourceView; +begin + case AIndex of + 0: + Result := TcxScheduler(Component).ViewDay; + 1: + Result := TcxScheduler(Component).ViewWeek; + 2: + Result := TcxScheduler(Component).ViewWeeks; + 3: + Result := TcxScheduler(Component).ViewYear; + 4: + Result := TcxScheduler(Component).ViewTimeGrid; + 5: + Result := TcxScheduler(Component).ViewGantt; + else + Result := nil; + end; +end; + +function TcxSchedulerComponentsEditor.GetProductMajorVersion: string; +begin + Result := cxSchedulerMajorVersion; +end; + +function TcxSchedulerComponentsEditor.GetProductName: string; +begin + Result := scxSchedulerDescription; +end; + +function TcxSchedulerComponentsEditor.InternalGetVerb(AIndex: Integer): string; +begin + case AIndex of + 0: Result := scxSchedulerActiveView; + else + Result := inherited InternalGetVerb(AIndex); + end; +end; + +function TcxSchedulerComponentsEditor.InternalGetVerbCount: Integer; +begin + if CanSelectActiveView then + Result := 1 + else + Result := 0; +end; + +{ TcxSchedulerHolidayComponentsEditor } + +procedure TcxSchedulerHolidayComponentsEditor.InternalExecuteVerb(AIndex: Integer); +begin + if (AIndex = 0) and + cxShowSchedulerHolidaysComponentEditor((GetComponent as TcxSchedulerHolidays)) then + Designer.Modified + else + inherited InternalExecuteVerb(AIndex); +end; + +function TcxSchedulerHolidayComponentsEditor.InternalGetVerb(AIndex: Integer): string; +begin + Result := scxHolidaysEditor; +end; + +function TcxSchedulerHolidayComponentsEditor.InternalGetVerbCount: Integer; +begin + Result := 1; +end; + +{ TcxSchedulerDBStorageFieldProperty } + +function TcxSchedulerDBStorageFieldProperty.GetDataSource: TDataSource; +begin + Result := TcxSchedulerDBStorageField(GetComponent(0)).DataSource; +end; + +{ TcxSchedulerDBStorageFieldNameProperty } + +function TcxSchedulerDBStorageFieldNameProperty.GetDataSource: TDataSource; +begin + Result := TcxSchedulerDBStorageFieldNames(GetComponent(0)).Storage.DataSource; +end; + +{ TcxSchedulerDBStorageResourceFieldNameProperty } + +function TcxSchedulerDBStorageResourceFieldNameProperty.GetDataSource: TDataSource; +begin + Result := TcxSchedulerDBStorageResources(GetComponent(0)).DataSource; +end; + +{ TcxSchedulerTimeZoneProperty } + +function TcxSchedulerTimeZoneProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes; + Result := Result - [paReadOnly, paSubProperties] + [paValueList, paRevertable]; +end; + +function TcxSchedulerTimeZoneProperty.GetValue: string; +var + AIndex: Integer; +begin + AIndex := GetOrdValue; + if (AIndex < 0) or (AIndex >= DateTimeHelper.TimeZoneCount) then + Result := scxDefault + else + Result := DateTimeHelper.TimeZoneInfo(AIndex).Display; +end; + +procedure TcxSchedulerTimeZoneProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; + AList: TStringList; +begin + Proc(scxDefault); + AList := TStringList.Create; + try + for I := 0 to DateTimeHelper.TimeZoneCount - 1 do + AList.Add(DateTimeHelper.TimeZoneInfo(I).Display); + AList.Sort; + for I := 0 to AList.Count - 1 do + Proc(AList[I]); + finally + AList.Free; + end; +end; + +procedure TcxSchedulerTimeZoneProperty.SetValue(const Value: string); +var + AIndex: Integer; +begin + if (Value = '') or (Value = scxDefault) then + AIndex := -1 + else + begin + AIndex := DateTimeHelper.TimeZoneCount - 1; + while AIndex >= 0 do + begin + if AnsiCompareText(DateTimeHelper.TimeZoneInfo(AIndex).Display, Value) = 0 then + Break + else + Dec(AIndex); + end; + end; + SetOrdValue(AIndex); +end; + +{ TcxSchedulerTimeScaleProperty } + +function TcxSchedulerTimeScaleProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes; + Result := Result - [paReadOnly, paSubProperties] + [paValueList, paRevertable]; +end; + +function TcxSchedulerTimeScaleProperty.GetValue: string; +begin + Result := IntToStr(GetOrdValue) + ' ' + scxMinutes; +end; + +procedure TcxSchedulerTimeScaleProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +const + AValues: array[0..5] of Integer = (60, 30, 15, 10, 6, 5); +begin + for I := 0 to High(AValues) do + Proc(IntToStr(AValues[I]) + ' ' + scxMinutes); +end; + +procedure TcxSchedulerTimeScaleProperty.SetValue(const Value: string); +var + I: Integer; + S: string; + ATime, ACode: Integer; +begin + S := ''; + for I := 1 to Length(Value) do + if Value[I] in ['0'..'9'] then + S := S + Value[I] + else + Break; + if S = '' then S := '60'; + Val(S, ATime, ACode); + if ACode <> 0 then + ATime := 60; + SetOrdValue(ATime); +end; + +{ TcxSchedulerStylesEventsProperty } + +function TcxSchedulerStylesEventsProperty.GetInstance: TPersistent; +begin + if (GetComponent(0) is TcxCustomScheduler) then + Result := TcxCustomScheduler(GetComponent(0)).Styles + else + Result := nil; +end; + +{ TcxSchedulerContentPopupMenuEventsProperty } + +function TcxSchedulerContentPopupMenuEventsProperty.GetInstance: TPersistent; +begin + if (GetComponent(0) is TcxCustomScheduler) then + Result := TcxCustomScheduler(GetComponent(0)).ContentPopupMenu + else + Result := nil; +end; + +{ TcxSchedulerEventPopupMenuEventsProperty } + +function TcxSchedulerEventPopupMenuEventsProperty.GetInstance: TPersistent; +begin + if (GetComponent(0) is TcxCustomScheduler) then + Result := TcxCustomScheduler(GetComponent(0)).EventPopupMenu + else + Result := nil; +end; + +{ TcxSchedulerStorageResourcesEventsProperty } + +function TcxSchedulerStorageResourcesEventsProperty.GetInstance: TPersistent; +begin + if (GetComponent(0) is TcxCustomSchedulerStorage) then + Result := TcxCustomSchedulerStorage(GetComponent(0)).Resources + else + Result := nil; +end; + +{ TcxSchedulerStorageRemindersEventsProperty } + +function TcxSchedulerStorageRemindersEventsProperty.GetInstance: TPersistent; +begin + if (GetComponent(0) is TcxCustomSchedulerStorage) then + Result := TcxCustomSchedulerStorage(GetComponent(0)).Reminders + else + Result := nil; +end; + +{ TcxSchedulerNavigatorEventsProperty } + +function TcxSchedulerNavigatorEventsProperty.GetInstance: TPersistent; +begin + if (GetComponent(0) is TcxCustomScheduler) then + Result := TcxCustomScheduler(GetComponent(0)).ResourceNavigator + else + Result := nil; +end; + +{ TcxSchedulerDateNavigatorEventsProperty } + +function TcxSchedulerDateNavigatorEventsProperty.GetInstance: TPersistent; +begin + if (GetComponent(0) is TcxScheduler) then + Result := TcxScheduler(GetComponent(0)).DateNavigator + else + Result := nil; +end; + +{ TcxSchedulerViewDayEventsProperty } + +function TcxSchedulerViewDayEventsProperty.GetInstance: TPersistent; +begin + if (GetComponent(0) is TcxScheduler) then + Result := TcxScheduler(GetComponent(0)).ViewDay + else + Result := nil; +end; + +{ TcxSchedulerViewYearEventsProperty } + +function TcxSchedulerViewYearEventsProperty.GetInstance: TPersistent; +begin + if (GetComponent(0) is TcxScheduler) then + Result := TcxScheduler(GetComponent(0)).ViewYear + else + Result := nil; +end; + +{ TcxSchedulerViewYearScaleProperty } + +function TcxSchedulerViewYearScaleProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes; + Result := Result - [paReadOnly, paSubProperties] + [paValueList, paRevertable]; +end; + +function TcxSchedulerViewYearScaleProperty.GetValue: string; +begin + case GetOrdValue of + 12: Result := scxFullYear; + 6: Result := scxHalfYear; + 3: Result := scxQuarter; + end; +end; + +procedure TcxSchedulerViewYearScaleProperty.GetValues(Proc: TGetStrProc); +begin + Proc(scxFullYear); + Proc(scxHalfYear); + Proc(scxQuarter); +end; + +procedure TcxSchedulerViewYearScaleProperty.SetValue(const Value: string); +begin + if Value = scxFullYear then + SetOrdValue(12) + else + if Value = scxHalfYear then + SetOrdValue(6) + else + SetOrdValue(3); +end; + +{ TcxSchedulerViewTimeGridEventsProperty } + +function TcxSchedulerViewTimeGridEventsProperty.GetInstance: TPersistent; +begin + if (GetComponent(0) is TcxScheduler) then + Result := TcxScheduler(GetComponent(0)).ViewTimeGrid + else + Result := nil; +end; + +{ TcxSchedulerViewTimeGridStylesEventsProperty } + +function TcxSchedulerViewTimeGridStylesEventsProperty.GetInstance: TPersistent; +begin + if (GetComponent(0) is TcxSchedulerTimeGridView) then + Result := TcxSchedulerTimeGridView(GetComponent(0)).Styles + else + Result := nil; +end; + +{ TcxSchedulerStorageResourceImageIndexProperty } + +function TcxSchedulerStorageResourceImageIndexProperty.GetImages: TCustomImageList; +begin + if (GetComponent(0) is TcxSchedulerStorageResourceItem) then + Result := TcxSchedulerStorageResourceItem(GetComponent(0)).Resources.Images + else + Result := nil; +end; + +{ TcxSchedulerHolidayPropertyEditor } + +procedure TcxSchedulerHolidayPropertyEditor.Edit; +begin + if cxShowSchedulerHolidaysComponentEditor((GetComponent(0) as TcxSchedulerHolidays)) then + Designer.Modified; +end; + +function TcxSchedulerHolidayPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paDialog, paReadOnly]; +end; + +type + TcxSchedulerSelectionEditor = class(TSelectionEditor) + protected + ComponentsList: TStringList; + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + + TcxDateNavigatorSelectionEditor = class(TSelectionEditor) + protected + ComponentsList: TStringList; + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + +procedure TcxSchedulerSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + Proc('Menus'); + Proc('cxStyles'); + Proc('cxGraphics'); + Proc('cxEdit'); + Proc('cxScheduler'); + Proc('cxSchedulerStorage'); + Proc('cxSchedulerCustomControls'); + Proc('cxSchedulerCustomResourceView'); + Proc('cxSchedulerDayView'); + Proc('cxSchedulerDateNavigator'); + Proc('cxSchedulerHolidays'); + Proc('cxSchedulerTimeGridView'); + Proc('cxSchedulerUtils'); + Proc('cxSchedulerWeekView'); + Proc('cxSchedulerYearView'); + Proc('cxSchedulerGanttView'); +end; + +procedure TcxDateNavigatorSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + Proc('cxStyles'); + Proc('cxGraphics'); + Proc('cxSchedulerStorage'); + Proc('cxSchedulerCustomControls'); + Proc('cxSchedulerDateNavigator'); +end; + +function cxSchedulerComponentEditor: TComponentEditorClass; +begin + Result := TcxSchedulerComponentsEditor; +end; + +procedure Register; +begin + RegisterComponents('Dev Express', [TcxSchedulerAggregateStorage, TcxSchedulerStorage, TcxSchedulerDBStorage, + TcxScheduler, TcxDateNavigator, TcxSchedulerHolidays]); + RegisterClasses([TcxSchedulerStorageField, TcxSchedulerDBStorageField]); + RegisterComponentEditor(TcxCustomScheduler, TcxSchedulerComponentsEditor); + RegisterComponentEditor(TcxCustomSchedulerStorage, TcxSchedulerComponentsEditor); + RegisterComponentEditor(TcxCustomDateNavigator, TcxSchedulerComponentsEditor); + RegisterComponentEditor(TcxSchedulerHolidays, TcxSchedulerHolidayComponentsEditor); + + RegisterPropertyEditor(TypeInfo(string), TcxSchedulerStorageField, + 'ValueType', TcxValueTypeProperty); + + // data base field names property editors + RegisterPropertyEditor(TypeInfo(string), TcxSchedulerDBStorageField, + 'FieldName', TcxSchedulerDBStorageFieldProperty); + RegisterPropertyEditor(TypeInfo(TcxFieldName), TcxSchedulerDBStorageFieldNames, + '', TcxSchedulerDBStorageFieldNameProperty); + RegisterPropertyEditor(TypeInfo(TcxFieldName), TcxSchedulerDBStorageResources, + '', TcxSchedulerDBStorageResourceFieldNameProperty); + + RegisterPropertyEditor(TypeInfo(TcxSchedulerHolidaysLocations), TcxSchedulerHolidays, + 'Locations', TcxSchedulerHolidayPropertyEditor); + + RegisterPropertyEditor(TypeInfo(Boolean), TcxSchedulerOptionsView, + 'RotateResourceCaptions', nil); + + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomScheduler, + 'StylesEvents', TcxSchedulerStylesEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxScheduler, + 'DateNavigatorEvents', TcxSchedulerDateNavigatorEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxScheduler, + 'ViewDayEvents', TcxSchedulerViewDayEventsProperty); + + RegisterPropertyEditor(TypeInfo(TImageIndex), TcxSchedulerStorageResourceItem, + 'ImageIndex', TcxSchedulerStorageResourceImageIndexProperty); + + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomSchedulerStorage, + 'ResourcesEvents', TcxSchedulerStorageResourcesEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomSchedulerStorage, + 'RemindersEvents', TcxSchedulerStorageRemindersEventsProperty); + + // day view property editors + RegisterPropertyEditor(TypeInfo(Integer), TcxSchedulerOptionsView, + 'CurrentTimeZone', TcxSchedulerTimeZoneProperty); + RegisterPropertyEditor(TypeInfo(Integer), TcxSchedulerOptionsView, + 'AdditionalTimeZone', TcxSchedulerTimeZoneProperty); + RegisterPropertyEditor(TypeInfo(Integer), TcxSchedulerDayView, + 'TimeScale', TcxSchedulerTimeScaleProperty); + + // timegrid view + RegisterPropertyEditor(TypeInfo(Integer), TcxSchedulerTimeGridViewScales, + 'TimeStep', TcxSchedulerTimeScaleProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxScheduler, + 'ViewTimeGridEvents', TcxSchedulerViewTimeGridEventsProperty); + + // year view + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxScheduler, + 'ViewYearEvents', TcxSchedulerViewYearEventsProperty); + RegisterPropertyEditor(TypeInfo(Integer), TcxSchedulerYearView, + 'Scale', TcxSchedulerViewYearScaleProperty); + + //popups + RegisterPropertyEditor(TypeInfo(TComponent), TcxSchedulerPopupMenu, + 'PopupMenu', TcxControlPopupMenuProperty); + + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomScheduler, + 'ResourceNavigatorEvents', TcxSchedulerNavigatorEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomScheduler, + 'ContentPopupMenuEvents', TcxSchedulerContentPopupMenuEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomScheduler, + 'EventPopupMenuEvents', TcxSchedulerEventPopupMenuEventsProperty); + + RegisterSelectionEditor(TcxCustomScheduler, TcxSchedulerSelectionEditor); + RegisterSelectionEditor(TcxDateNavigator, TcxDateNavigatorSelectionEditor); +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerReminderWindow.dfm b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerReminderWindow.dfm new file mode 100644 index 00000000..bfbed77c --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerReminderWindow.dfm @@ -0,0 +1,129 @@ +object cxSchedulerReminderForm: TcxSchedulerReminderForm + Left = 288 + Top = 89 + ActiveControl = lvItems + AutoScroll = False + BorderIcons = [biSystemMenu, biMinimize] + BorderStyle = bsSingle + ClientHeight = 294 + ClientWidth = 456 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + KeyPreview = True + OldCreateOrder = False + OnKeyDown = FormKeyDown + PixelsPerInch = 96 + TextHeight = 13 + object pbImage: TPaintBox + Left = 10 + Top = 10 + Width = 16 + Height = 16 + Visible = False + OnPaint = DrawIcon + end + object lbEventCaption: TLabel + Left = 32 + Top = 10 + Width = 409 + Height = 15 + Anchors = [akLeft, akTop, akRight] + AutoSize = False + end + object lbEventStartTime: TLabel + Left = 32 + Top = 32 + Width = 3 + Height = 13 + end + object lvItems: TcxListView + Left = 9 + Top = 76 + Width = 437 + Height = 129 + Anchors = [akLeft, akTop, akRight] + ColumnClick = False + Columns = < + item + Width = 290 + end + item + Width = 120 + end> + HideSelection = False + MultiSelect = True + ReadOnly = True + RowSelect = True + Style.HotTrack = False + TabOrder = 0 + ViewStyle = vsReport + OnDblClick = lvItemsDblClick + OnKeyDown = lvItemsKeyDown + OnSelectItem = lvItemsSelectItem + end + object btnDismissAll: TcxButton + Left = 9 + Top = 212 + Width = 90 + Height = 23 + Caption = 'Dismiss &All' + Enabled = False + TabOrder = 1 + OnClick = ButtonClick + end + object btnOpenItem: TcxButton + Tag = 1 + Left = 256 + Top = 212 + Width = 90 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Open Item' + Enabled = False + TabOrder = 2 + OnClick = ButtonClick + end + object btnDismiss: TcxButton + Tag = 2 + Left = 355 + Top = 212 + Width = 90 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Dismiss' + Enabled = False + TabOrder = 3 + OnClick = ButtonClick + end + object cbSnoozeTime: TcxComboBox + Left = 9 + Top = 263 + Anchors = [akLeft, akTop, akRight] + Enabled = False + Properties.DropDownListStyle = lsFixedList + TabOrder = 4 + Width = 338 + end + object btnSnooze: TcxButton + Tag = 3 + Left = 355 + Top = 262 + Width = 90 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Snooze' + Default = True + Enabled = False + TabOrder = 5 + OnClick = ButtonClick + end + object tmUpdate: TTimer + Enabled = False + Interval = 30000 + OnTimer = tmUpdateTimer + end +end diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerReminderWindow.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerReminderWindow.pas new file mode 100644 index 00000000..257abc77 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerReminderWindow.pas @@ -0,0 +1,733 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerReminderWindow; + +{$I cxVer.Inc} + +interface + +uses + Types, Windows, Messages, SysUtils, Classes, Controls, Graphics, ExtCtrls, Forms, + StdCtrls, cxLookAndFeels, cxSchedulerStorage, cxListView, cxButtons, ComCtrls, + cxDropDownEdit, cxLookAndFeelPainters, cxEdit, cxTextEdit, cxMaskEdit, + cxControls, cxContainer, cxClasses, Menus, cxGraphics, cxSchedulerUtils; + +const + WM_REDRAWHEADER = WM_DX + 1; + cxDefaultResourceNameColumnWidth: Word = 120; + +type + { TcxSchedulerReminderFormItem } + + TcxSchedulerReminderFormItem = class(TcxSchedulerReminderEventID) + protected + ResourceID: Variant; + ReminderDate: TDateTime; + public + constructor Create(AReminder: TcxSchedulerReminder); + function Equals(AReminder: TcxSchedulerReminder): Boolean; + end; + + { TcxSchedulerReminderForm } + + TcxReminderFormLayoutData = array[0..2] of Integer; + + TcxSchedulerReminderForm = class(TcxSchedulerCustomReminderForm, + IUnknown, + IcxDialogMetricsInfoData + ) + btnDismiss: TcxButton; + btnDismissAll: TcxButton; + btnOpenItem: TcxButton; + btnSnooze: TcxButton; + cbSnoozeTime: TcxComboBox; + lbEventCaption: TLabel; + lbEventStartTime: TLabel; + lvItems: TcxListView; + pbImage: TPaintBox; + tmUpdate: TTimer; + procedure ButtonClick(Sender: TObject); + procedure DrawIcon(Sender: TObject); + procedure lvItemsSelectItem(Sender: TObject; Item: TListItem; + Selected: Boolean); + procedure lvItemsDblClick(Sender: TObject); + procedure tmUpdateTimer(Sender: TObject); + procedure lvItemsKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + private + FLayoutData: TcxReminderFormLayoutData; + FAdvanceCount: Integer; + FSelections: TcxObjectList; + function GetFocusedReminder: TcxSchedulerReminder; + function GetVisibleReminder(Index: Integer): TcxSchedulerReminder; + function GetVisibleReminderCount: Integer; + procedure SynchronizeSelection; + procedure WMRedrawHeader(var Msg: TMsg); message WM_REDRAWHEADER; + protected + //IcxDialogMetricsInfoData + function GetInfoData: Pointer; virtual; + function GetInfoDataSize: Integer; virtual; + procedure SetInfoData(AData: Pointer); virtual; + + function AddReminder(AReminder: TcxSchedulerReminder): TListItem; + procedure AddReminderInfo(AReminder: TcxSchedulerReminder; AItem: TListItem; const ADueInText: string); + function AddSnoozeAdvanceTime(const AText: string; AMinutes: Integer): Integer; + function AddSnoozeTime(const AText: string; AMinutes: Integer): Integer; + procedure CheckColumnCaptions; + procedure CheckColumnCount; virtual; + procedure CheckFormPosition; override; + procedure CreateSnoozeAdvanceTimeItems; virtual; + procedure DismissEvents(All: Boolean); + procedure DoShow; override; + function GetDueInColumnIndex: Integer; + function GetImageIndexForReminder(AReminder: TcxSchedulerReminder): Integer; virtual; + function GetMaxAdvanceMinutes: Integer; + function GetResourceNameForReminder(AReminder: TcxSchedulerReminder): string; virtual; + function GetShowResourceColumn: Boolean; virtual; + function GetSnoozeTime: TDateTime; virtual; + procedure LayoutChanged; override; + procedure SnoozeEvents; + procedure OpenFocusedEvent; + procedure RefreshSelectedInfo; virtual; + procedure ResetAdvanceCount; + procedure RestoreSelection; override; + procedure SaveSelection; override; + procedure SetupCaptions; virtual; + procedure UpdateDueTimeTexts; + procedure UpdateReminderList; override; + procedure UpdateSelectionCaptions; override; + procedure UpdateSnoozeComboBox; virtual; + + property AdvanceCount: Integer read FAdvanceCount; + property VisibleReminderCount: Integer read GetVisibleReminderCount; + property VisibleReminders[Index: Integer]: TcxSchedulerReminder read GetVisibleReminder; + public + constructor Create(AReminders: TcxSchedulerReminders); override; + destructor Destroy; override; + end; + +implementation + +{$R *.DFM} + +uses + cxSchedulerStrs, cxSchedulerDialogs, CommCtrl, Math, cxDateUtils, cxVariants; + +{ TcxSchedulerReminderFormItem } + +constructor TcxSchedulerReminderFormItem.Create(AReminder: TcxSchedulerReminder); +begin + inherited Create(AReminder.Event); + ResourceID := AReminder.ResourceID; + ReminderDate := AReminder.ReminderDate; +end; + +function TcxSchedulerReminderFormItem.Equals(AReminder: TcxSchedulerReminder): Boolean; +begin + Result := SameEvent(AReminder.Event) and (ReminderDate = AReminder.ReminderDate) and + VarEquals(ResourceID, AReminder.ResourceID); +end; + +{ TcxSchedulerReminderForm } + +constructor TcxSchedulerReminderForm.Create( + AReminders: TcxSchedulerReminders); +begin + inherited Create(AReminders); + Icon.Handle := LoadIcon(hInstance, 'REMINDERBELL'); + lvItems.SmallImages := MenuImages; +end; + +destructor TcxSchedulerReminderForm.Destroy; +begin + FSelections.Free; + inherited Destroy; +end; + +//IcxDialogMetricsInfoData +function TcxSchedulerReminderForm.GetInfoData: Pointer; +var + I: Integer; +begin + FillChar(FLayoutData, SizeOf(FLayoutData), 0); + for I := 0 to lvItems.Columns.Count - 1 do + FLayoutData[I] := lvItems.Columns[I].Width; + Result := @FLayoutData; +end; + +function TcxSchedulerReminderForm.GetInfoDataSize: Integer; +begin + Result := SizeOf(FLayoutData); +end; + +procedure TcxSchedulerReminderForm.SetInfoData(AData: Pointer); +var + I: Integer; +begin + lvItems.Items.BeginUpdate; + try + CheckColumnCount; + for I := 0 to lvItems.Columns.Count - 1 do + if TcxReminderFormLayoutData(AData^)[I] <> 0 then + lvItems.Columns[I].Width := TcxReminderFormLayoutData(AData^)[I]; + finally + lvItems.Items.EndUpdate; + end; +end; + +function TcxSchedulerReminderForm.AddReminder(AReminder: TcxSchedulerReminder): TListItem; +begin + Result := lvItems.Items.Add; + with Result do + begin + Data := AReminder; + Caption := AReminder.Event.Caption; + ImageIndex := GetImageIndexForReminder(AReminder); + end; +end; + + +procedure TcxSchedulerReminderForm.AddReminderInfo( + AReminder: TcxSchedulerReminder; AItem: TListItem; const ADueInText: string); +begin + with AItem do + begin + if GetShowResourceColumn then + SubItems.Add(GetResourceNameForReminder(AReminder)); + SubItems.Add(ADueInText); + end; +end; + +function TcxSchedulerReminderForm.AddSnoozeAdvanceTime(const AText: string; + AMinutes: Integer): Integer; +begin + Result := AddSnoozeTime(AText, AMinutes); + Inc(FAdvanceCount); +end; + +function TcxSchedulerReminderForm.AddSnoozeTime(const AText: string; + AMinutes: Integer): Integer; +begin + Result := cbSnoozeTime.Properties.Items.AddObject(AText, TObject(AMinutes)); +end; + +procedure TcxSchedulerReminderForm.CheckColumnCaptions; +begin + lvItems.Columns[0].Caption := cxGetResourceString(@scxrSubject); + if GetShowResourceColumn then + lvItems.Columns[1].Caption := cxGetResourceString(@scxResource); + lvItems.Columns[1 + GetDueInColumnIndex].Caption := cxGetResourceString(@scxrDueIn); +end; + +procedure TcxSchedulerReminderForm.CheckColumnCount; +begin + if (lvItems.Columns.Count = 2) and GetShowResourceColumn then + begin + lvItems.Columns.Add.Width := lvItems.Column[1].Width; + lvItems.Column[1].Width := cxDefaultResourceNameColumnWidth; + Width := Width + cxDefaultResourceNameColumnWidth; + end + else if (lvItems.Columns.Count = 3) and not GetShowResourceColumn then + begin + Width := Width - cxDefaultResourceNameColumnWidth; + lvItems.Column[1].Free; + end; + CheckColumnCaptions; +end; + +procedure TcxSchedulerReminderForm.CheckFormPosition; +begin + CheckColumnCount; + inherited CheckFormPosition; +end; + +procedure TcxSchedulerReminderForm.CreateSnoozeAdvanceTimeItems; +var + AMaxAdvanceTime: Integer; +begin + if lvItems.SelCount = 1 then + begin + AMaxAdvanceTime := GetMaxAdvanceMinutes; + if AMaxAdvanceTime > 15 then + AddSnoozeAdvanceTime(cxGetResourceString(@scxAdvance15m), 15); + if AMaxAdvanceTime > 10 then + AddSnoozeAdvanceTime(cxGetResourceString(@scxAdvance10m), 10); + if AMaxAdvanceTime > 5 then + cbSnoozeTime.ItemIndex := AddSnoozeAdvanceTime(cxGetResourceString(@scxAdvance5m), 5); + if AMaxAdvanceTime > 0 then + AddSnoozeAdvanceTime(cxGetResourceString(@scxAdvance0h), 0); + end; +end; + +procedure TcxSchedulerReminderForm.DismissEvents(All: Boolean); +var + I: Integer; +begin + with Reminders do + begin + if All then + DismissAll + else + begin + Storage.BeginUpdate; + try + for I := 0 to lvItems.Items.Count - 1 do + if lvItems.Items[I].Selected then + VisibleReminders[I].Dismiss; + finally + Storage.EndUpdate; + end; + end; + end; +end; + +procedure TcxSchedulerReminderForm.DoShow; +begin + CheckColumnCount; + SetupCaptions; + lbEventCaption.Font.Style := lbEventCaption.Font.Style + [fsBold]; + inherited DoShow; + with lvItems do if Items.Count > 0 then Selected := Items[Items.Count - 1]; + btnOpenItem.Visible := OpenEventSupported; + RefreshSelectedInfo; + //force repaint header + PostMessage(Handle, WM_REDRAWHEADER, 0, 0); + tmUpdate.Enabled := True; +end; + +function TcxSchedulerReminderForm.GetDueInColumnIndex: Integer; +begin + Result := Ord(GetShowResourceColumn); +end; + +function TcxSchedulerReminderForm.GetImageIndexForReminder( + AReminder: TcxSchedulerReminder): Integer; +begin + if AReminder.Event.EventType <> etNone then + Result := 3 + else + Result := 2; +end; + +function TcxSchedulerReminderForm.GetMaxAdvanceMinutes: Integer; +var + I: Integer; + ANow, AStart: TDateTime; +begin + ANow := Now; + Result := 0; + for I := 0 to lvItems.Items.Count - 1 do + begin + if lvItems.Items[I].Selected then + begin + AStart := TcxSchedulerReminder(lvItems.Items[I].Data).Event.Start; + Result := Max(Trunc((AStart - ANow) * MinsPerDay), Result); + end; + end; +end; + +function TcxSchedulerReminderForm.GetResourceNameForReminder( + AReminder: TcxSchedulerReminder): string; +begin + Result := Storage.Resources.GetResourceNameByID(AReminder.ResourceID); +end; + +function TcxSchedulerReminderForm.GetShowResourceColumn: Boolean; +begin + Result := Reminders.IsReminderByResourceAvailable and + Reminders.ShowResourcesInReminderWindow; +end; + +function TcxSchedulerReminderForm.GetSnoozeTime: TDateTime; +begin + with cbSnoozeTime do + begin + if ItemIndex >= 0 then + Result := Integer(Properties.Items.Objects[ItemIndex]) * MinuteToTime + else + Result := 5 * MinuteToTime; + end; +end; + +procedure TcxSchedulerReminderForm.LayoutChanged; +begin + lvItems.Items.BeginUpdate; + try + SaveSelection; + CheckColumnCount; + UpdateReminderList; + RestoreSelection; + finally + lvItems.Items.EndUpdate; + end; +end; + +procedure TcxSchedulerReminderForm.SnoozeEvents; +var + I: Integer; + AIsAdvanceTime: Boolean; + ASnoozeTime: TDateTime; +begin + AIsAdvanceTime := (lvItems.SelCount = 1) and (cbSnoozeTime.ItemIndex < AdvanceCount); + ASnoozeTime := GetSnoozeTime; + if AIsAdvanceTime then + TcxSchedulerReminder(lvItems.Selected.Data).Snooze(-ASnoozeTime) + else + with Reminders do + begin + Storage.BeginUpdate; + try + for I := 0 to lvItems.Items.Count - 1 do + if lvItems.Items[I].Selected then VisibleReminders[I].Snooze(ASnoozeTime); + finally + Storage.EndUpdate; + end; + end; +end; + +procedure TcxSchedulerReminderForm.OpenFocusedEvent; +var + AReminder: TcxSchedulerReminder; +begin + AReminder := GetFocusedReminder; + if AReminder <> nil then + OpenEvent(AReminder.Event); +end; + +procedure TcxSchedulerReminderForm.RefreshSelectedInfo; +var + AEnabled: Boolean; +begin + if IsLocked then Exit; + AEnabled := lvItems.SelCount > 0; + btnDismiss.Enabled := AEnabled; + btnDismissAll.Enabled := lvItems.Items.Count > 0;; + btnOpenItem.Enabled := lvItems.SelCount = 1; + btnSnooze.Enabled := AEnabled; + cbSnoozeTime.Enabled := AEnabled; + pbImage.Visible := AEnabled; + pbImage.Invalidate; + UpdateSelectionCaptions; +end; + +procedure TcxSchedulerReminderForm.ResetAdvanceCount; +begin + FAdvanceCount := 0; +end; + +procedure TcxSchedulerReminderForm.RestoreSelection; +begin + with lvItems.Items do + begin + BeginUpdate; + try + UpdateReminderList; + SynchronizeSelection; + finally + EndUpdate; + end; + end; + FreeAndNil(FSelections); + RefreshSelectedInfo; +end; + +procedure TcxSchedulerReminderForm.SaveSelection; +var + I: Integer; +begin + FreeAndNil(FSelections); + with lvItems do + begin + if SelCount = 0 then Exit; + FSelections := TcxObjectList.Create; + for I := 0 to Items.Count - 1 do + if Items[I].Selected then + FSelections.Add(TcxSchedulerReminderFormItem.Create(Items[I].Data)); + end; +end; + +procedure TcxSchedulerReminderForm.SetupCaptions; +begin + CheckColumnCaptions; + btnDismissAll.Caption := cxGetResourceString(@scxrDismissAllButton); + btnOpenItem.Caption := cxGetResourceString(@scxrOpenItemButton); + btnDismiss.Caption := cxGetResourceString(@scxrDismissButton); + btnSnooze.Caption := cxGetResourceString(@scxrSnoozeButton); +end; + +procedure TcxSchedulerReminderForm.UpdateDueTimeTexts; +var + I, AColumnIndex: Integer; + ANow: TDateTime; +begin + ANow := Now; + lvItems.Items.BeginUpdate; + try + AColumnIndex := GetDueInColumnIndex; + for I := 0 to VisibleReminderCount - 1 do + lvItems.Items[I].SubItems[AColumnIndex] := Reminders.GetEventDueTimeText(VisibleReminders[I], ANow); + finally + lvItems.Items.EndUpdate; + end; +end; + +procedure TcxSchedulerReminderForm.UpdateReminderList; +var + I: Integer; + AReminder: TcxSchedulerReminder; + ANow: TDateTime; + AItem: TListItem; +begin + ANow := Now; + with lvItems.Items do + begin + BeginUpdate; + try + Clear; + for I := 0 to Reminders.Count - 1 do + begin + AReminder := Reminders[I]; + AItem := AddReminder(AReminder); + AddReminderInfo(AReminder, AItem, Reminders.GetEventDueTimeText(AReminder, ANow)); + end; + finally + EndUpdate; + end; + end; +end; + +procedure TcxSchedulerReminderForm.ButtonClick(Sender: TObject); +begin + if Sender is TcxButton then + case TcxButton(Sender).Tag of + 0: DismissEvents(True); + 1: OpenFocusedEvent; + 2: DismissEvents(False); + 3: SnoozeEvents; + end; +end; + +procedure TcxSchedulerReminderForm.DrawIcon(Sender: TObject); +begin + if lvItems.SelCount = 1 then + MenuImages.Draw(pbImage.Canvas, + (pbImage.Width - MenuImages.Width) div 2, + (pbImage.Height - MenuImages.Height) div 2, + GetImageIndexForReminder(lvItems.Selected.Data)); +end; + +procedure TcxSchedulerReminderForm.lvItemsSelectItem(Sender: TObject; + Item: TListItem; Selected: Boolean); +begin + if csDestroying in ComponentState then Exit; +{$IFDEF DELPHI6} + if not Item.Deleting then +{$ENDIF} + RefreshSelectedInfo; +end; + +function TcxSchedulerReminderForm.GetFocusedReminder: TcxSchedulerReminder; +begin + if lvItems.SelCount = 1 then + Result := TcxSchedulerReminder(lvItems.Selected.Data) + else + Result := nil; +end; + +function TcxSchedulerReminderForm.GetVisibleReminder( + Index: Integer): TcxSchedulerReminder; +begin + with lvItems do + if (Index >= 0) and (Index < Items.Count) then + Result := TcxSchedulerReminder(Items[Index].Data) + else + Result := nil; +end; + +function TcxSchedulerReminderForm.GetVisibleReminderCount: Integer; +begin + Result := lvItems.Items.Count; +end; + +procedure TcxSchedulerReminderForm.SynchronizeSelection; +var + I, J: Integer; + AItem: TcxSchedulerReminderFormItem; +begin + if (FSelections = nil) or (VisibleReminderCount = 0) then Exit; + for I := 0 to FSelections.Count - 1 do + begin + AItem := TcxSchedulerReminderFormItem(FSelections[I]); + for J := 0 to VisibleReminderCount - 1 do + if AItem.Equals(VisibleReminders[J]) then + lvItems.Items[J].Selected := True; + end; + with lvItems do + begin + if SelCount = 0 then + Items[Items.Count - 1].Selected := True; + Items[Items.Count - 1].Focused := True; + end; +end; + +procedure TcxSchedulerReminderForm.WMRedrawHeader(var Msg: TMsg); +var + AHeader: HWND; +begin + AHeader := ListView_GetHeader(lvItems.InnerListView.Handle); + Windows.InvalidateRect(AHeader, nil, True); +end; + +procedure TcxSchedulerReminderForm.UpdateSelectionCaptions; + + function GetValidCaption(const ACaption: string): string; + const + Ellipsis = '...'; + var + ATotalWidth: Integer; + begin + Result := ACaption; + ATotalWidth := lbEventCaption.Width; + with TcxScreenCanvas.Create do + try + Font.Assign(lbEventCaption.Font); + if TextWidth(Result) > ATotalWidth then + begin + Dec(ATotalWidth, TextWidth(Ellipsis)); + while (Length(Result) > 0) and (TextWidth(Result) > ATotalWidth) do + Delete(Result, Length(Result), 1); + Result := Result + Ellipsis; + end; + finally + Free; + end; + end; + +var + AEvent: TcxSchedulerEvent; +begin + if lvItems.SelCount = 1 then + begin + AEvent := TcxSchedulerReminder(lvItems.Selected.Data).Event; + lbEventCaption.Caption := GetValidCaption(AEvent.Caption); + lbEventStartTime.Caption := + Format(cxGetResourceString(@scxrStartTime), [FormatDateTime('dddddd t', AEvent.Start)]); + end + else + begin + lbEventCaption.Caption := ''; + lbEventStartTime.Caption := + Format(cxGetResourceString(@scxrSelected), [lvItems.SelCount]); + end; + UpdateSnoozeComboBox; + inherited UpdateSelectionCaptions; +end; + +procedure TcxSchedulerReminderForm.UpdateSnoozeComboBox; +const + SnoozeTimes: array[1..15] of record P: Pointer; M: Integer end = ( + (P: @scxTime5m; M: 5), + (P: @scxTime10m; M: 10), + (P: @scxTime15m; M: 15), + (P: @scxTime30m; M: 30), + (P: @scxTime1h; M: MinsPerHour), + (P: @scxTime2h; M: 2 * MinsPerHour), + (P: @scxTime4h; M: 4 * MinsPerHour), + (P: @scxTime8h; M: 8 * MinsPerHour), + (P: @scxTime12h; M: 12 * MinsPerHour), + (P: @scxTime1d; M: MinsPerDay), + (P: @scxTime2d; M: 2 * MinsPerDay), + (P: @scxTime3d; M: 3 * MinsPerDay), + (P: @scxTime4d; M: 4 * MinsPerDay), + (P: @scxTime1w; M: MinsPerWeek), + (P: @scxTime2w; M: 2 * MinsPerWeek)); +var + I: Integer; +begin + ResetAdvanceCount; + cbSnoozeTime.Properties.Items.BeginUpdate; + try + cbSnoozeTime.Properties.Items.Clear; + cbSnoozeTime.ItemIndex := -1; + if lvItems.SelCount = 1 then + CreateSnoozeAdvanceTimeItems; + for I := Low(SnoozeTimes) to High(SnoozeTimes) do + AddSnoozeTime(cxGetResourceString(SnoozeTimes[I].P), SnoozeTimes[I].M); + if cbSnoozeTime.ItemIndex = -1 then cbSnoozeTime.ItemIndex := 1; + finally + cbSnoozeTime.Properties.Items.EndUpdate; + end; +end; + +procedure TcxSchedulerReminderForm.lvItemsDblClick(Sender: TObject); +begin + OpenFocusedEvent; +end; + +procedure TcxSchedulerReminderForm.tmUpdateTimer(Sender: TObject); +begin + if not IsLocked then + UpdateDueTimeTexts; +end; + +procedure TcxSchedulerReminderForm.lvItemsKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if Key = VK_DELETE then + begin + with lvItems do + begin + if SelCount > 0 then + DismissEvents(False) + else + if Items.Count > 0 then + begin + Items[Items.Count - 1].Selected := True; + Items[Items.Count - 1].Focused := True; + end; + end; + end; +end; + +procedure TcxSchedulerReminderForm.FormKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if (Key = VK_ESCAPE) and not HasOpenedPopupWindow(ActiveControl) then + Close; +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerResourcesLayoutEditor.dfm b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerResourcesLayoutEditor.dfm new file mode 100644 index 00000000..dd44f00f --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerResourcesLayoutEditor.dfm @@ -0,0 +1,90 @@ +object fmResourcesLayoutEditor: TfmResourcesLayoutEditor + Left = 249 + Top = 230 + ActiveControl = clbResources + AutoScroll = False + BorderIcons = [biSystemMenu] + Caption = 'Resource editor' + ClientHeight = 227 + ClientWidth = 301 + Color = clBtnFace + Constraints.MinHeight = 160 + Constraints.MinWidth = 220 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object btnClose: TcxButton + Left = 210 + Top = 196 + Width = 85 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Close' + ModalResult = 2 + TabOrder = 0 + end + object btnUp: TcxButton + Left = 210 + Top = 8 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Up' + TabOrder = 1 + OnClick = BtnClick + end + object btnDown: TcxButton + Tag = 1 + Left = 210 + Top = 40 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Down' + TabOrder = 2 + OnClick = BtnClick + end + object clbResources: TcxCheckListBox + Left = 8 + Top = 8 + Width = 195 + Height = 212 + Anchors = [akLeft, akTop, akRight, akBottom] + EditValueFormat = cvfIndices + Items = <> + TabOrder = 5 + OnClick = clbResourcesClick + OnDragOver = clbResourcesDragOver + OnEditValueChanged = clbResourcesEditValueChanged + OnKeyDown = clbResourcesKeyDown + OnMouseDown = clbResourcesMouseDown + end + object btnSelectAll: TcxButton + Tag = 2 + Left = 210 + Top = 72 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Select all' + TabOrder = 3 + OnClick = BtnClick + end + object btnSelectNone: TcxButton + Tag = 3 + Left = 210 + Top = 104 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Select none' + TabOrder = 4 + OnClick = BtnClick + end +end diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerResourcesLayoutEditor.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerResourcesLayoutEditor.pas new file mode 100644 index 00000000..d5bf18a4 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerResourcesLayoutEditor.pas @@ -0,0 +1,253 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerResourcesLayoutEditor; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, {$IFDEF DELPHI6} Variants, {$ENDIF} Classes, Graphics, + Controls, Forms, Dialogs, cxLookAndFeelPainters, StdCtrls, cxButtons, cxCheckListBox, + cxControls, cxContainer, cxEdit, cxGroupBox, cxSchedulerStorage, + cxSchedulerCustomControls, Menus; + +type + TfmResourcesLayoutEditor = class(TForm) + clbResources: TcxCheckListBox; + btnClose: TcxButton; + btnUp: TcxButton; + btnDown: TcxButton; + btnSelectAll: TcxButton; + btnSelectNone: TcxButton; + procedure clbResourcesDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure clbResourcesMouseDown(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + procedure clbResourcesClick(Sender: TObject); + procedure BtnClick(Sender: TObject); + procedure clbResourcesKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure clbResourcesEditValueChanged(Sender: TObject); + private + FDragItem: Integer; + FStorage: TcxCustomSchedulerStorage; + protected + procedure CheckButtons; + procedure CheckSelectButtons; + procedure FillList; + procedure InitControls; virtual; + procedure SelectResources(ASelectAll: Boolean); + procedure SetCaptions; + procedure SwapItems(AOldItem, ANewItem: Integer); + public + function ShowModal: Integer; override; + property Storage: TcxCustomSchedulerStorage read FStorage write FStorage; + end; + +implementation + +uses + cxSchedulerDialogs, cxLookAndFeels, cxSchedulerStrs, cxClasses; + +{$R *.dfm} + +procedure TfmResourcesLayoutEditor.CheckButtons; +begin + with clbResources do + begin + btnUp.Enabled := ItemIndex > 0; + btnDown.Enabled := (ItemIndex >= 0) and (ItemIndex < Items.Count - 1); + end; +end; + +procedure TfmResourcesLayoutEditor.CheckSelectButtons; +var + I: Integer; +begin + btnSelectAll.Enabled := False; + btnSelectNone.Enabled := False; + for I := 0 to clbResources.Count - 1 do + begin + btnSelectAll.Enabled := btnSelectAll.Enabled or not clbResources.Items[I].Checked; + btnSelectNone.Enabled := btnSelectNone.Enabled or clbResources.Items[I].Checked; + if btnSelectAll.Enabled and btnSelectNone.Enabled then + Exit; + end; +end; + +procedure TfmResourcesLayoutEditor.FillList; +var + I: Integer; + AResource: TcxSchedulerStorageResourceItem; +begin + clbResources.Items.BeginUpdate; + try + clbResources.Items.Clear; + clbResources.Images := Storage.Resources.Images; + for I := 0 to Storage.ResourceCount - 1 do + with clbResources.Items.Add do + begin + Text := Storage.ResourceNames[I]; + AResource := Storage.Resources.ResourceItems[I]; + ItemObject := AResource; + Checked := AResource.Visible; + ImageIndex := AResource.ActualImageIndex; + end; + finally + clbResources.Items.EndUpdate; + end; +end; + +procedure TfmResourcesLayoutEditor.InitControls; +begin + if UseSchedulerColorInDialogs then + Color := btnClose.LookAndFeel.Painter.DefaultSchedulerControlColor; + SetCaptions; + FillList; + clbResources.ItemIndex := 0; + CheckButtons; + CheckSelectButtons; +end; + +procedure TfmResourcesLayoutEditor.SelectResources(ASelectAll: Boolean); +var + I: Integer; +begin + for I := 0 to clbResources.Count - 1 do + with clbResources.Items[I] do + begin + Checked := ASelectAll; + TcxSchedulerStorageResourceItem(ItemObject).Visible := Checked; + end; + btnSelectAll.Enabled := not ASelectAll; + btnSelectNone.Enabled := ASelectAll; +end; + +procedure TfmResourcesLayoutEditor.SetCaptions; +begin + Caption := cxGetResourceString(@scxResourceLayoutCaption); + btnClose.Caption := cxGetResourceString(@scxClose); + btnDown.Caption := cxGetResourceString(@scxDown); + btnUp.Caption := cxGetResourceString(@scxUp); + btnSelectAll.Caption := cxGetResourceString(@scxSelectAll); + btnSelectNone.Caption := cxGetResourceString(@scxSelectNone); +end; + +procedure TfmResourcesLayoutEditor.SwapItems(AOldItem, ANewItem: Integer); +begin + FStorage.Resources.ResourceItems[AOldItem].Index := ANewItem; + clbResources.Items[AOldItem].Index := ANewItem; + clbResources.ItemIndex := ANewItem; + CheckButtons; +end; + +function TfmResourcesLayoutEditor.ShowModal: Integer; +begin + cxDialogsMetricsStore.InitDialog(Self); + InitControls; + Result := inherited ShowModal; + cxDialogsMetricsStore.StoreMetrics(Self); +end; + +procedure TfmResourcesLayoutEditor.clbResourcesDragOver(Sender, + Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); +var + AItem: Integer; +begin + AItem := clbResources.ItemAtPos(Point(X, Y), True); + if (AItem <> -1) and (FDragItem <> AItem) then + begin + SwapItems(FDragItem, AItem); + FDragItem := AItem; + end; +end; + +procedure TfmResourcesLayoutEditor.clbResourcesMouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FDragItem := clbResources.ItemAtPos(Point(X, Y), True); + if (FDragItem <> -1) and (clbResources.CheckAtPos(Point(X, Y)) = -1) then + clbResources.BeginDrag(False); +end; + +procedure TfmResourcesLayoutEditor.clbResourcesClick(Sender: TObject); +begin + CheckButtons; +end; + +procedure TfmResourcesLayoutEditor.BtnClick(Sender: TObject); +begin + with TcxButton(Sender) do + begin + if Enabled then + case Tag of + 0: + SwapItems(clbResources.ItemIndex, clbResources.ItemIndex - 1); + 1: + SwapItems(clbResources.ItemIndex, clbResources.ItemIndex + 1); + 2: + SelectResources(True); + 3: + SelectResources(False); + end; + end; + ActiveControl := clbResources; +end; + +procedure TfmResourcesLayoutEditor.clbResourcesKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if ssCtrl in Shift then + begin + if Key = VK_UP then BtnClick(btnUp); + if Key = VK_DOWN then BtnClick(btnDown); + Key := 0; + end; +end; + +procedure TfmResourcesLayoutEditor.clbResourcesEditValueChanged( + Sender: TObject); +var + AIndex: Integer; +begin + AIndex := clbResources.ItemIndex; + if AIndex < 0 then Exit; + with clbResources.Items[AIndex] do + TcxSchedulerStorageResourceItem(ItemObject).Visible := Checked; + CheckSelectButtons; +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerStorage.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerStorage.pas new file mode 100644 index 00000000..d4c87630 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerStorage.pas @@ -0,0 +1,9514 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerStorage; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Variants, DateUtils, +{$ENDIF} + Classes, SysUtils, Windows, Forms, Math, Graphics, Contnrs, cxClasses, cxCustomData, + cxDataStorage, cxDateUtils, cxDataUtils, cxSchedulerUtils, cxVariants, cxStorage, + ExtCtrls, cxLookAndFeels, Controls, ImgList, cxFormats, cxSchedulerHolidays, cxDataConsts; + +const + // Options flag masks + omAllDayEvent = $0001; + omEnabled = $0002; + omReminder = $0004; + omCollapsed = $0008; + + // Time line state + tlsFree = 0; + tlsTentative = 1; + tlsBusy = 2; + tlsOutOfOffice = 3; + + cxDefaultEventDuration: TDateTime = 0.0034722222222; + cxMaxDate = 767010; //Dec 31 3999 + + cxInvalidRecordIndex = -MaxInt; + ReminderRefreshInterval: Double = MinuteToTime / 2; + +type + TcxSchedulerControlEventID = class; + TcxCustomSchedulerStorage = class; + + TcxSchedulerStorage = class; + TcxSchedulerEvent = class; + TcxSchedulerEventRecurrenceInfo = class; + TcxSchedulerControlEvent = class; + TcxSchedulerCachedEventList = class; + TcxSchedulerOccurrenceCalculator = class; + TcxSchedulerEventList = class; + TcxSchedulerFilteredEventList = class; + TcxSchedulerStorageResources = class; + TcxSchedulerStorageResourceItem = class; + + TcxCustomSchedulerStorageClass = class of TcxCustomSchedulerStorage; + TcxSchedulerCachedEventListClass = class of TcxSchedulerCachedEventList; + TcxSchedulerStorageResourcesClass = class of TcxSchedulerStorageResources; + TcxSchedulerStorageResourceItemClass = class of TcxSchedulerStorageResourceItem; + + //reminders + TcxSchedulerReminders = class; + TcxSchedulerReminder = class; + TcxSchedulerReminderClass = class of TcxSchedulerReminder; + TcxSchedulerEventConflictsInfo = class; + + TcxEventType = (etNone, etPattern, etOccurrence, etException, etCustom); + TcxRecurrence = (cxreDaily, cxreWeekly, cxreMonthly, cxreYearly); + TcxRecurrenceValidStatus = (rvsValid, rvsReplaceOccurrenceDate, rvsInvalidPattern, + rvsInvalidDuration); + + TcxDayType = (cxdtDay, cxdtEveryDay, cxdtWeekDay, cxdtWeekEndDay, cxdtSunday, + cxdtMonday, cxdtTuesday, cxdtWednesday, cxdtThursday, cxdtFriday, cxdtSaturday); + + TcxCompareEventsProc = function(AEvent1, AEvent2: TcxSchedulerEvent): Integer; + TcxGetRecurrenceDescriptionStringProc = function( + ARecurrenceInfo: TcxSchedulerEventRecurrenceInfo; + AFullDescription: Boolean = False): string; + + TcxSchedulerReminderDueTimeElement = (dteMinute, dteHour, dteDay, dteWeek); + + TcxSchedulerReminderDueTimeKind = (dtkNow, dtkOverdue, dtkActual); + + TcxSchedulerReminderDueTimeInfo = record + DueKind: TcxSchedulerReminderDueTimeKind; + Element: TcxSchedulerReminderDueTimeElement; + ElementValue: Integer; + Minutes: Integer; + end; + + TcxSchedulerReminderResource = packed record + DismissDate: TDateTime; + ResourceID: Variant; + ReminderDate: TDateTime; + end; + + TcxSchedulerReminderResources = array of TcxSchedulerReminderResource; + + TcxSchedulerReminderResourcesData = packed record + Version: Byte; + Resources: TcxSchedulerReminderResources; + end; + + TcxDueTimeInfoToTextProc = function ( + const AInfo: TcxSchedulerReminderDueTimeInfo): string; + + { IcxSchedulerStorageListener } + + IcxSchedulerStorageListener = interface + ['{87E0EBF3-F68A-4A51-8EA3-850D3819FBAB}'] + procedure StorageChanged(Sender: TObject); + procedure StorageRemoved(Sender: TObject); + end; + + { IcxSchedulerSelectionAdapter } + + IcxSchedulerSelectionAdapter = interface + ['{68B007E5-1057-40DE-BDA4-0D72F3780CC7}'] + procedure Add(AEvent: TcxSchedulerControlEvent; Shift: TShiftState); + procedure Clear; + function IsSelected(AEvent: TcxSchedulerControlEvent): Boolean; + procedure Update; + end; + + { TcxSchedulerStorageDataController } + + TcxSchedulerStorageDataController = class(TcxCustomDataController) + private + function GetStorage: TcxCustomSchedulerStorage; + protected + procedure UpdateControl(AInfo: TcxUpdateControlInfo); override; + function UseRecordID: Boolean; override; + + property Storage: TcxCustomSchedulerStorage read GetStorage; + public + function GetItem(Index: Integer): TObject; override; + function GetItemValueSource(AItemIndex: Integer): TcxDataEditValueSource; override; + function GetItemID(AItem: TObject): Integer; override; + procedure UpdateData; override; + procedure UpdateItemIndexes; override; + end; + + TcxSchedulerStorageDataControllerClass = class of TcxCustomDataController; + + { TcxCustomSchedulerStorageField } + + TcxCustomSchedulerStorageField = class(TCollectionItem) + private + FIndex: Integer; + FIsUnique: Boolean; + FName: string; + function IsValueTypeStored: Boolean; + function GetDataController: TcxCustomDataController; + function GetStorage: TcxCustomSchedulerStorage; + function GetValue(AIndex: Integer): Variant; + function GetValueCount: Integer; + function GetValueType: string; + function GetValueTypeClass: TcxValueTypeClass; + procedure SetName(const AValue: string); + procedure SetValue(AIndex: Integer; const AValue: Variant); + procedure SetValueType(const AValue: string); + procedure SetValueTypeClass(AValue: TcxValueTypeClass); virtual; + protected + function GetDisplayName: string; override; + function GetIsActive: Boolean; virtual; + + property DataController: TcxCustomDataController read GetDataController; + property IsUnique: Boolean read FIsUnique; + property Name: string read FName write SetName; + property Storage: TcxCustomSchedulerStorage read GetStorage; + property ValueCount: Integer read GetValueCount; + property Values[ARecordIndex: Integer]: Variant read GetValue write SetValue; + property ValueType: string read GetValueType write SetValueType stored IsValueTypeStored; + property ValueTypeClass: TcxValueTypeClass read GetValueTypeClass write SetValueTypeClass; + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + property Index: Integer read FIndex; + end; + + TcxSchedulerStorageFieldClass = class of TcxCustomSchedulerStorageField; + + { TcxSchedulerStorageField } + + TcxSchedulerStorageField = class(TcxCustomSchedulerStorageField) + public + property ValueCount; + property Values; + property ValueTypeClass; + published + property Index; + property Name; + property ValueType; + end; + + { TcxCustomSchedulerStorageFields } + + TcxCustomSchedulerStorageFields = class(TCollection) + private + FOwner: TPersistent; + function GetStorage: TcxCustomSchedulerStorage; + protected + function FindFieldByName(const AName: string): TcxCustomSchedulerStorageField; virtual; + function GetOwner: TPersistent; override; + procedure Update(Item: TCollectionItem); override; + public + property Storage: TcxCustomSchedulerStorage read GetStorage; + end; + + TcxSchedulerStorageFieldsClass = class of TcxCustomSchedulerStorageFields; + + { TcxSchedulerStorageFields } + + TcxSchedulerStorageFields = class(TcxCustomSchedulerStorageFields) + private + function GetItem(AIndex: Integer): TcxSchedulerStorageField; + procedure SetItem(AIndex: Integer; AValue: TcxSchedulerStorageField); + public + function Add: TcxSchedulerStorageField; + function ItemByName(const AName: string): TcxSchedulerStorageField; + + property Items[Index: Integer]: TcxSchedulerStorageField read GetItem write SetItem; + property Storage; + end; + + { TcxSchedulerEventRecurrenceInfo } + + TcxSchedulerEventRecurrenceInfoData = packed record + Count: Integer; + DayNumber: Integer; + DayType: TcxDayType; + Finish: TDateTime; + OccurDays: TDays; + Periodicity: Integer; + Recurrence: TcxRecurrence; + Start: TDateTime; + YearPeriodicity: Integer; + Reserved1: Byte; + DismissDate: Integer; + end; + + TcxSchedulerEventRecurrenceInfo = class(TPersistent) + private + FOwner: TcxSchedulerEvent; + function GetCount: Integer; + function GetDayNumber: Integer; + function GetDayType: TcxDayType; + function GetDismissDate: TDateTime; + function GetFinish: TDateTime; + function GetIsInfinity: Boolean; + function GetOccurDays: TDays; + function GetPeriodicity: Integer; + function GetRecurrence: TcxRecurrence; + function GetStart: TDateTime; + function GetStorage: TcxCustomSchedulerStorage; + function GetYearPeriodicity: Integer; + procedure SetCount(const AValue: Integer); + procedure SetDayNumber(const AValue: Integer); + procedure SetDayType(const AValue: TcxDayType); + procedure SetDismissDate(const AValue: TDateTime); + procedure SetFinish(AValue: TDateTime); + procedure SetOccurDays(const AValue: TDays); + procedure SetPeriodicity(const AValue: Integer); + procedure SetRecurrence(const AValue: TcxRecurrence); + procedure SetStart(const AValue: TDateTime); + procedure SetYearPeriodicity(const AValue: Integer); + protected + procedure AssignDefaultValues; virtual; + function GetData: TcxSchedulerEventRecurrenceInfoData; + function GetOccurrences(AList: TcxSchedulerFilteredEventList; const AStart, AFinish: TDateTime): Boolean; + function GetOwner: TPersistent; override; + function GetValue(var AValue: string): Boolean; + procedure SetDataItem(AOffset: Pointer; ASize: Integer; const AValue); + procedure SetValue(const AValue: string); + // validate + function GetDailyPatternStatus: TcxRecurrenceValidStatus; + function GetMonthlyPatternStatus: TcxRecurrenceValidStatus; + function GetWeeklyPatternStatus: TcxRecurrenceValidStatus; + function GetYearlyPatternStatus: TcxRecurrenceValidStatus; + + property Storage: TcxCustomSchedulerStorage read GetStorage; + public + constructor Create(AOwner: TcxSchedulerEvent); virtual; + procedure Assign(Source: TPersistent); override; + function GetEndDate: TDateTime; + function GetValidStatus: TcxRecurrenceValidStatus; + procedure Validate; + + property Count: Integer read GetCount write SetCount; + property DayNumber: Integer read GetDayNumber write SetDayNumber; + property DayType: TcxDayType read GetDayType write SetDayType; + property DismissDate: TDateTime read GetDismissDate write SetDismissDate; + property Event: TcxSchedulerEvent read FOwner; + property Finish: TDateTime read GetFinish write SetFinish; + property IsInfinity: Boolean read GetIsInfinity; + property OccurDays: TDays read GetOccurDays write SetOccurDays; + property Periodicity: Integer read GetPeriodicity write SetPeriodicity; + property Recurrence: TcxRecurrence read GetRecurrence write SetRecurrence; + property Start: TDateTime read GetStart write SetStart; + property YearPeriodicity: Integer read GetYearPeriodicity write SetYearPeriodicity; + end; + + TcxSchedulerEventRecurrenceInfoClass = class of TcxSchedulerEventRecurrenceInfo; + + { TcxSchedulerEventItemLink } + + TcxSchedulerEventRelation = (trFinishToStart, trStartToStart, trFinishToFinish, trStartToFinish); + + TcxSchedulerEventItemLink = class(TCollectionItem) + private + FLink: TcxSchedulerEvent; + FLinkRecurrenceIndex: Integer; + FRelation: TcxSchedulerEventRelation; + function GetEvent: TcxSchedulerEvent; + function GetStorage: TcxCustomSchedulerStorage; + procedure SetLink(AValue: TcxSchedulerEvent); + procedure SetRelation(AValue: TcxSchedulerEventRelation); + protected + function CheckLinked(AEvent: TcxSchedulerEvent): Boolean; overload; + function CheckLinked(const ID: Variant; ARecurrenceIndex: Integer): Boolean; overload; + function GetData: Variant; virtual; + procedure SetData(const AData: Variant); virtual; + procedure UpdateLink; virtual; + + property Storage: TcxCustomSchedulerStorage read GetStorage; + public + constructor Create(Collection: TCollection); override; + function GetRelationAsText: string; + + property Event: TcxSchedulerEvent read GetEvent; + property Link: TcxSchedulerEvent read FLink write SetLink; + property LinkRecurrenceIndex: Integer read FLinkRecurrenceIndex; + property Relation: TcxSchedulerEventRelation read FRelation write SetRelation; + end; + + { TcxSchedulerEventLinks } + + TcxSchedulerEventLinks = class(TCollection) + private + FEvent: TcxSchedulerEvent; + function GetExpanded: Boolean; + function GetItemLink(AIndex: Integer): TcxSchedulerEventItemLink; + procedure SetExpanded(AValue: Boolean); + procedure SetItemLink(AIndex: Integer; AValue: TcxSchedulerEventItemLink); + protected + function GetDisplayText: string; virtual; + function GetOwner: TPersistent; override; + procedure RemoveLink(ALink: TcxSchedulerEvent); virtual; + procedure Update(Item: TCollectionItem); override; + public + function Add(AEvent: TcxSchedulerEvent; ARelation: TcxSchedulerEventRelation = trStartToFinish): TcxSchedulerEventItemLink; overload; + function IsEventLinked(AEvent: TcxSchedulerEvent): Boolean; + + property DisplayText: string read GetDisplayText; + property Event: TcxSchedulerEvent read FEvent; + property Expanded: Boolean read GetExpanded write SetExpanded; + property ItemLinks[Index: Integer]: TcxSchedulerEventItemLink read GetItemLink write SetItemLink; default; + end; + + TcxSchedulerEventTaskStatus = (tsNotStarted, tsInProgress, tsComplete, tsWaiting, tsDeferred); + + { TcxSchedulerEvent } + + TcxSchedulerEvent = class(TPersistent) + private + FIsModified: Boolean; + FLink: TcxSchedulerEvent; + FSkipExceptions: Boolean; + FStorage: TcxCustomSchedulerStorage; + FPrevTaskComplete: Integer; + FRecurrenceInfo: TcxSchedulerEventRecurrenceInfo; + function GetActualFinish: Integer; + function GetActualStart: Integer; + function GetAllDayEvent: Boolean; + function GetCaption: string; + function GetDuration: TDateTime; + function GetEditValue(AIndex: Integer): Variant; + function GetEnabled: Boolean; + function GetEventType: TcxEventType; + function GetFinish: TDateTime; + function GetID: Variant; + function GetIsEditing: Boolean; + function GetIsNewEvent: Boolean; + function GetLabelColor: Integer; + function GetLocation: string; + function Getmessage: string; {GetMessage conflicts with C++ macro} + function GetOptionsFlag: Integer; + function GetReadOnly: Boolean; + function GetRecurrenceIndex: Integer; + function GetReminder: Boolean; + function GetReminderDate: TDateTime; + function GetReminderMinutesBeforeStart: Integer; + function GetReminderResourcesData: TcxSchedulerReminderResourcesData; + function GetResourceID: Variant; + function GetResourceIDCount: Integer; + function GetResourceIDs(Index: Integer): Variant; + function GetShared: Boolean; + function GetStart: TDateTime; + function GetState: Integer; + function GetTaskComplete: Integer; + function GetTaskIndex: Integer; + function GetTaskStatus: TcxSchedulerEventTaskStatus; + function GetValueCount: Integer; + procedure InternalSetTaskComplete(const AValue: Integer; AUpdateTaskStatus: Boolean = True); + procedure InternalSetTaskStatus(AValue: TcxSchedulerEventTaskStatus; AUpdateTaskComplete: Boolean = True); + procedure SetAllDayEvent(const AValue: Boolean); + procedure SetCaption(const AValue: string); + procedure SetDuration(const AValue: TDateTime); + procedure SetEditValue(AIndex: Integer; const AValue: Variant); + procedure SetEnabled(const AValue: Boolean); + procedure SetEventType(AValue: TcxEventType); + procedure SetFinish(const AValue: TDateTime); + procedure SetLabelColor(const AValue: Integer); + procedure SetLocation(const AValue: string); + procedure SetMessage(const AValue: string); + function SetOptionsFlag(const AMask: Integer; AValue: Boolean): Boolean; + procedure SetParentID(const AValue: Variant); + procedure SetRecurrenceIndex(const AValue: Integer); + procedure SetRecurrenceInfo(AValue: TcxSchedulerEventRecurrenceInfo); + procedure SetReminder(const AValue: Boolean); + procedure SetReminderDate(AValue: TDateTime); + procedure SetReminderMinutesBeforeStart(const AValue: Integer); + procedure SetReminderResourcesData(const AValue: TcxSchedulerReminderResourcesData); + procedure SetResourceID(const AValue: Variant); + procedure SetStart(const AValue: TDateTime); + procedure SetState(const AValue: Integer); + procedure SetTaskComplete(const AValue: Integer); + procedure SetTaskIndex(const AValue: Integer); + procedure SetTaskStatus(AValue: TcxSchedulerEventTaskStatus); + protected + FEditCount: Integer; + FEditValues: array of Variant; + FPattern: TcxSchedulerEvent; + FRecordIndex: Integer; + FIndex: Integer; + FIsDataValid: Boolean; + FIsDeletion: Boolean; + FFinish, FStart: Double; + FStartDate: Integer; + FOptions: Integer; + FSavedID: Variant; + FTaskLinks: TcxSchedulerEventLinks; + FTaskLinkOwners: TcxSchedulerEventList; + procedure AssignDefaultValues; virtual; + procedure CalculateActualTimeRange; + procedure CalculateActualTimeRangePost; + function CanMoveTo(ANewTime: TDateTime): Boolean; virtual; + procedure CheckLinksOnChangeEventType(ANewEventType: TcxEventType); virtual; + procedure CheckRecurrenceLink(AEvent: TcxSchedulerEvent); + procedure CheckRecurrenceLinkEx(AEvent: TcxSchedulerEvent); + function CheckTimeRange(const AStartDate, AFinishDate: Integer): Boolean; + function CreateRecurrenceInfo: TcxSchedulerEventRecurrenceInfo; virtual; + function CreateReminderResourcesData: TcxSchedulerReminderResourcesData; + function CreateTaskLinks: TcxSchedulerEventLinks; virtual; + function CreateTaskLinkOwners: TcxSchedulerEventList; virtual; + function GetIsFreeState: Boolean; virtual; + function GetOccurrenceByIndex(AIndex: Integer; var AOccurrence: TcxSchedulerEvent): Boolean; + function GetOwner: TPersistent; override; + function GetParentID: Variant; virtual; + function GetRecurrenceInfoValue(var AValue: string): Boolean; virtual; + procedure GetStartFinishTime(var AStart, AFinish: TDateTime); + function GetTaskLinks: TcxSchedulerEventLinks; virtual; + function GetTaskLinkOwners: TcxSchedulerEventList; virtual; + function GetTaskCompleteDuration: TDateTime; virtual; + function GetValueByIndex(AIndex: Integer): Variant; virtual; + function GetValueDef(AField: TcxCustomSchedulerStorageField; const ADefValue: Variant): Variant; + procedure InitTaskLinks; virtual; + procedure InternalMoveTo(const AStartTime: TDateTime); virtual; + procedure Modified; + procedure PostEditingData; + procedure RefreshTaskLinks; + procedure RemoveTaskLink(ALink: TcxSchedulerEvent); virtual; + procedure ResetReminderResourcesData; + procedure SetActualTimeRange(const ActualStart, ActualFinish: TDateTime); + procedure SetRecordIndex(const AIndex: Integer); + procedure SetRecurrenceInfoValue(const AValue: string); virtual; + procedure SetValue(AField: TcxCustomSchedulerStorageField; const AValue: Variant); virtual; + procedure SetValueByIndex(AIndex: Integer; const AValue: Variant); virtual; + procedure TaskLinksChanged(Sender: TcxSchedulerEventLinks); virtual; + function TimeBias: Double; virtual; + procedure UpdateTemporaryData; + + property IsFreeState: Boolean read GetIsFreeState; + property IsModified: Boolean read FIsModified write FIsModified; + property IsNewEvent: Boolean read GetIsNewEvent; + property Link: TcxSchedulerEvent read FLink; + property ReminderResourcesData: TcxSchedulerReminderResourcesData read GetReminderResourcesData write SetReminderResourcesData; + public + constructor Create(AStorage: TcxCustomSchedulerStorage); overload; virtual; + constructor Create(AStorage: TcxCustomSchedulerStorage; ARecordIndex: Integer); overload; virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure AssignAttributes(ASource: TcxSchedulerEvent; AUseSourceTime: Boolean = True); virtual; + procedure BeginEditing; virtual; + procedure Cancel; + function CanLink(AEvent: TcxSchedulerEvent): Boolean; virtual; + function Conflicts(AExceptEventsWithoutResources: Boolean): Boolean; + function CreateConflictsInfo(AExceptEventsWithoutResources: Boolean): TcxSchedulerEventConflictsInfo; + procedure Delete; virtual; + procedure DeleteExceptions; virtual; + procedure EndEditing; virtual; + function GetOccurrence(ADate: TDateTime): TcxSchedulerEvent; + function GetOriginalDate: TDateTime; + function GetResourceItem: TcxSchedulerStorageResourceItem; + function GetRecurrenceChain: TcxSchedulerEventList; + function GetTaskLinkOwnerRelation(ATaskLinkOwner: TcxSchedulerEvent; var ARelation: TcxSchedulerEventRelation): Boolean; virtual; + procedure GetValidTaskTimeRange(var AStart, AFinish: TDateTime); virtual; + procedure GetValidTaskTimeRangeByRelation(const ARelation: TcxSchedulerEventRelation; AEvent: TcxSchedulerEvent; var AStart, AFinish: TDateTime); virtual; + function HasExceptions: Boolean; + function HasReminderForResourceID(const AResourceID: Variant): Boolean; + function IsDayEvent(ADate: Integer): Boolean; overload; + function IsDayEvent(const ADate: TDateTime): Boolean; overload; + function IsRecurring: Boolean; + function IsResourceEvent(AResource: TcxSchedulerStorageResourceItem; + AllowUnassigned: Boolean): Boolean; + procedure MoveTo(const AStartTime: TDateTime); + procedure Post; + procedure RemoveRecurrence; virtual; + procedure UpdateTaskTime; virtual; + procedure UpdateTaskLinks; virtual; + // resource sharing + procedure ShareWithResource(AResourceItem: TcxSchedulerStorageResourceItem); overload; + procedure ShareWithResource(AResourceID: Variant); overload; + function IsSharedWithResource(AResourceItem: TcxSchedulerStorageResourceItem): Boolean; overload; + function IsSharedWithResource(AResourceID: Variant): Boolean; overload; + procedure UnshareWithResource(AResourceItem: TcxSchedulerStorageResourceItem); overload; + procedure UnshareWithResource(AResourceID: Variant); overload; + procedure ReplaceResourceID(AResourceID: Variant); + //custom fields routines + function GetCustomFieldValueByIndex(AIndex: Integer): Variant; + function GetCustomFieldValueByName(const AName: String): Variant; + function GetCustomFieldValue(ACustomField: TcxCustomSchedulerStorageField): Variant; + procedure SetCustomFieldValueByIndex(AIndex: Integer; const AValue: Variant); + procedure SetCustomFieldValueByName(const AName: string; const AValue: Variant); + procedure SetCustomFieldValue(ACustomField: TcxCustomSchedulerStorageField; const AValue: Variant); + + property ActualStart: Integer read GetActualStart; + property ActualFinish: Integer read GetActualFinish; + property AllDayEvent: Boolean read GetAllDayEvent write SetAllDayEvent; + property Caption: string read GetCaption write SetCaption; + property Duration: TDateTime read GetDuration write SetDuration; + property EditValues[Index: Integer]: Variant read GetEditValue write SetEditValue; + property Enabled: Boolean read GetEnabled write SetEnabled; + property EventType: TcxEventType read GetEventType write SetEventType; + property Finish: TDateTime read GetFinish write SetFinish; + property ID: Variant read GetID; + property IsEditing: Boolean read GetIsEditing; + property LabelColor: Integer read GetLabelColor write SetLabelColor; + property Location: string read GetLocation write SetLocation; + property Message: string read Getmessage write SetMessage; + property ParentID: Variant read GetParentID write SetParentID; + property Pattern: TcxSchedulerEvent read FPattern; + property ReadOnly: Boolean read GetReadOnly; + property RecordIndex: Integer read FRecordIndex; + property RecurrenceIndex: Integer read GetRecurrenceIndex write SetRecurrenceIndex; + property RecurrenceInfo: TcxSchedulerEventRecurrenceInfo read FRecurrenceInfo write SetRecurrenceInfo; + property Reminder: Boolean read GetReminder write SetReminder; + property ReminderDate: TDateTime read GetReminderDate write SetReminderDate; + property ReminderMinutesBeforeStart: Integer read GetReminderMinutesBeforeStart write SetReminderMinutesBeforeStart; + property ResourceID: Variant read GetResourceID write SetResourceID; + property ResourceIDCount: Integer read GetResourceIDCount; + property ResourceIDs[Index: Integer]: Variant read GetResourceIDs; + property Shared: Boolean read GetShared; + property SkipExceptions: Boolean read FSkipExceptions write FSkipExceptions; + property Start: TDateTime read GetStart write SetStart; + property State: Integer read GetState write SetState; + property Storage: TcxCustomSchedulerStorage read FStorage; + property TaskComplete: Integer read GetTaskComplete write SetTaskComplete; + property TaskIndex: Integer read GetTaskIndex write SetTaskIndex; + property TaskLinks: TcxSchedulerEventLinks read GetTaskLinks; + property TaskLinkOwners: TcxSchedulerEventList read GetTaskLinkOwners; + property TaskStatus: TcxSchedulerEventTaskStatus read GetTaskStatus write SetTaskStatus; + property ValueCount: Integer read GetValueCount; + property Values[Index: Integer]: Variant read GetValueByIndex write SetValueByIndex; + end; + + { TcxSchedulerControlEvent } + + TcxSchedulerControlEvent = class(TcxSchedulerEvent) + private + FIsClone: Boolean; + FIsEditing: Boolean; + FIsSource: Boolean; + FLockedResource: Variant; + FSelectionAdapter: IcxSchedulerSelectionAdapter; + FSource: TcxSchedulerEvent; + FTimeBias: Double; + FValues: array of Variant; + function GetNonExceptionLinkCount: Integer; + function GetSelected: Boolean; + procedure SetSelected(AValue: Boolean); + protected + function CanMoveTo(ANewTime: TDateTime): Boolean; override; + procedure CheckLinksOnChangeEventType(ANewEventType: TcxEventType); override; + procedure ClearValues; + function CreateTaskLinks: TcxSchedulerEventLinks; override; + function GetTaskLinks: TcxSchedulerEventLinks; override; + function GetTaskLinkOwners: TcxSchedulerEventList; override; + function GetValueByIndex(AIndex: Integer): Variant; override; + procedure SetValueByIndex(AIndex: Integer; const AValue: Variant); override; + function TimeBias: Double; override; + + property SelectionAdapter: IcxSchedulerSelectionAdapter read FSelectionAdapter write FSelectionAdapter; + public + constructor Create(AStorage: TcxCustomSchedulerStorage); overload; override; + constructor Create(ASource: TcxSchedulerEvent); reintroduce; overload; + constructor Create(ASource: TcxSchedulerEvent; const AStart, AFinish: TDateTime); reintroduce; overload; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure BeginEditing; override; + procedure Delete; override; + procedure EndEditing; override; + function GetTaskLinkOwnerRelation(ATaskLinkOwner: TcxSchedulerEvent; var ARelation: TcxSchedulerEventRelation): Boolean; override; + procedure GetValidTaskTimeRange(var AStart, AFinish: TDateTime); override; + function IsOrigin(AEvent: TcxSchedulerEvent): Boolean; virtual; + procedure lockResource(const ALockedResource: Variant); + procedure unlockResource; + procedure UpdateTaskTime; override; + procedure UpdateTaskLinks; override; + + property IsClone: Boolean read FIsClone; + property IsDataValid: Boolean read FIsDataValid write FIsDataValid; + property IsEditing: Boolean read FIsEditing; + property IsSource: Boolean read FIsSource; + property NonExceptionLinkCount: Integer read GetNonExceptionLinkCount; + property Pattern: TcxSchedulerEvent read FPattern write FPattern; + property Selected: Boolean read GetSelected write SetSelected; + property Source: TcxSchedulerEvent read FSource; + end; + + TcxSchedulerEventClass = class of TcxSchedulerEvent; + + TcxSchedulerGetResourceNameEvent = procedure(Sender: TObject; + AResource: TcxSchedulerStorageResourceItem; var AResourceName: string) of object; + + TcxSchedulerGetResourceImageIndexEvent = procedure(Sender: TObject; + AResource: TcxSchedulerStorageResourceItem; var AImageIndex: TImageIndex) of object; + + { TcxSchedulerStorageResourceItems } + + TcxSchedulerStorageResourceItems = class(TCollection) + private + FOwner: TcxSchedulerStorageResources; + function GetItem(AIndex: Integer): TcxSchedulerStorageResourceItem; + function GetStorage: TcxCustomSchedulerStorage; + procedure SetItem(AIndex: Integer; AValue: TcxSchedulerStorageResourceItem); + function GetVisibleResource(AIndex: Integer): TcxSchedulerStorageResourceItem; + function GetVisibleResourceCount: Integer; + protected + function GetOwner: TPersistent; override; + procedure Update(Item: TCollectionItem); override; + property Resources: TcxSchedulerStorageResources read FOwner; + property Storage: TcxCustomSchedulerStorage read GetStorage; + public + constructor Create(AOwner: TcxSchedulerStorageResources; AItemClass: TcxSchedulerStorageResourceItemClass); virtual; + function Add: TcxSchedulerStorageResourceItem; + property Items[Index: Integer]: TcxSchedulerStorageResourceItem read GetItem write SetItem; default; + property VisibleResourceCount: Integer read GetVisibleResourceCount; + property VisibleResources[Index: Integer]: TcxSchedulerStorageResourceItem read GetVisibleResource; + end; + + { TcxSchedulerStorageResourceItem } + + TcxSchedulerStorageResourceItem = class(TCollectionItem) + private + FColor: TColor; + FImageIndex: TImageIndex; + FName: string; + FReadOnly: Boolean; + FResourceID: Variant; + FVisible: Boolean; + FWorkDays: TDays; + FWorkFinish: TTime; + FWorkFinishAssigned: Boolean; + FWorkStart: TTime; + FWorkStartAssigned: Boolean; + function GetActualImageIndex: TImageIndex; + function GetResources: TcxSchedulerStorageResources; + function IsWorkDaysStored: Boolean; + procedure ReadWorkFinish(AReader: TReader); + procedure ReadWorkStart(AReader: TReader); + procedure WriteWorkFinish(AWriter: TWriter); + procedure WriteWorkStart(AWriter: TWriter); + protected + procedure DefineProperties(Filer: TFiler); override; + // methods TList.Sort + function GetDisplayName: string; override; + procedure SetColor(const AValue: TColor); virtual; + procedure SetImageIndex(const AValue: TImageIndex); virtual; + procedure SetName(const AValue: string); virtual; + procedure SetResourceID(const AValue: Variant); virtual; + procedure SetVisible(const AValue: Boolean); virtual; + procedure SetWorkDays(AValue: TDays); virtual; + procedure SetWorkFinish(const AValue: TTime); virtual; + procedure SetWorkStart(const AValue: TTime); virtual; + public + constructor Create(Collection: TCollection); override; + procedure Assign(Source: TPersistent); override; + + property ActualImageIndex: TImageIndex read GetActualImageIndex; + property Resources: TcxSchedulerStorageResources read GetResources; + published + property Color: TColor read FColor write SetColor default clDefault; + property ImageIndex: TImageIndex read FImageIndex write SetImageIndex default -1; + property Name: string read FName write SetName; + property ReadOnly: Boolean read FReadOnly write FReadOnly default False; + property ResourceID: Variant read FResourceID write SetResourceID; + property Visible: Boolean read FVisible write SetVisible default True; + property WorkFinish: TTime read FWorkFinish write SetWorkFinish stored False; + property WorkStart: TTime read FWorkStart write SetWorkStart stored False; + property WorkDays: TDays read FWorkDays write SetWorkDays stored IsWorkDaysStored; + end; + + { TcxSchedulerStorageResources } + + TcxSchedulerStorageResources = class(TcxInterfacedPersistent, IcxStoredObject) + private + FImages: TCustomImageList; + FItems: TcxSchedulerStorageResourceItems; + FOwner: TcxCustomSchedulerStorage; + FRestoringItems: TList; + FOnGetResourceImageIndex: TcxSchedulerGetResourceImageIndexEvent; + FOnGetResourceName: TcxSchedulerGetResourceNameEvent; + function GetAreImagesUsed: Boolean; + procedure SetImages(AValue: TCustomImageList); + procedure SetItems(AValue: TcxSchedulerStorageResourceItems); + protected + function DecodePropertyName(const AName: string; var ASubValue: string): Integer; + // IcxStoredObject + function GetObjectName: string; + function GetProperties(AProperties: TStrings): Boolean; + procedure GetPropertyValue(const AName: string; var AValue: Variant); + procedure SetPropertyValue(const AName: string; const AValue: Variant); + // methods + procedure Changed; virtual; + function CreateItems: TcxSchedulerStorageResourceItems; virtual; + procedure DoneRestore; + function DoGetResourceImageIndex(AItem: TcxSchedulerStorageResourceItem): TImageIndex; virtual; + function DoGetResourceName(AItem: TcxSchedulerStorageResourceItem): string; virtual; + function GetOwner: TPersistent; override; + function GetResourceItems: TcxSchedulerStorageResourceItems; virtual; + procedure InitRestore; + + property Storage: TcxCustomSchedulerStorage read FOwner; + public + constructor Create(AOwner: TcxCustomSchedulerStorage); reintroduce; virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function GetResourceName(AResource: TcxSchedulerStorageResourceItem): string; + function GetResourceNameByID(const AResource: Variant): string; + + property AreImagesUsed: Boolean read GetAreImagesUsed; + property ResourceItems: TcxSchedulerStorageResourceItems read GetResourceItems; + published + property Images: TCustomImageList read FImages write SetImages; + property Items: TcxSchedulerStorageResourceItems read FItems write SetItems; + property OnGetResourceImageIndex: TcxSchedulerGetResourceImageIndexEvent read FOnGetResourceImageIndex write FOnGetResourceImageIndex; + property OnGetResourceName: TcxSchedulerGetResourceNameEvent read FOnGetResourceName write FOnGetResourceName; + end; + + TcxSchedulerNotificationEvent = procedure(Sender: TObject; + AEvent: TcxSchedulerEvent; var AHandled: Boolean) of object; + + TcxSchedulerFilterEventEvent = procedure (Sender: TcxCustomSchedulerStorage; + AEvent: TcxSchedulerEvent; var Accept: Boolean) of object; + + { TcxSchedulerEventConflictsInfo } + + TcxSchedulerEventConflictsInfo = class + private + FExceptEventsWithoutResources: Boolean; + FConflictEvents: TcxSchedulerFilteredEventList; + FExcludedEvent: TcxSchedulerEvent; + FEvent: TcxSchedulerEvent; + FStorage: TcxCustomSchedulerStorage; + FTimeRanges: TcxSchedulerTimeRanges; + function GetHasConflicts: Boolean; + function GetHasFreeTime: Boolean; + protected + ExcludedEventID: TcxSchedulerControlEventID; + EventID: TcxSchedulerControlEventID; + Start, Finish: TDateTime; + ResourceID: Variant; + procedure AddRange(AStart, AFinish: TDateTime); + procedure CheckFreeTimeRanges; + procedure CheckIntersectionWithEvents; + procedure CheckSomeIntersection; + function ExcludeFromCalculate(AEvent: TcxSchedulerEvent): Boolean; + procedure ExpandRange(AEvent: TcxSchedulerEvent; var AIndex: Integer; var ALastPosition: TDateTime); + procedure Init(AStorage: TcxCustomSchedulerStorage; AExceptEventsWithoutResources: Boolean; AResourceID: Variant; + const AStart, AFinish: TDateTime); + function IntersectEvents(ACheckedEvent: TcxSchedulerEvent): Boolean; overload; + function IntersectEvents(AEvent1, AEvent2: TcxSchedulerEvent): Boolean; overload; + function IntersectTime(const AStart, AFinish: TDateTime): Boolean; overload; + function IntersectTime(const AStart, AFinish, AStart1, AFinish1: TDateTime): Boolean; overload; + function IsSameEvent(ACheckedEvent: TcxSchedulerEvent): Boolean; + function IsSameSeries(AEvent1, AEvent2: TcxSchedulerEvent): Boolean; + public + constructor Create(AEvent: TcxSchedulerEvent; AExceptEventsWithoutResources: Boolean); overload; virtual; + constructor Create(AEvent: TcxSchedulerEvent; AExceptEventsWithoutResources: Boolean; + const AStart, AFinish: TDateTime); overload; virtual; + constructor Create(AStorage: TcxCustomSchedulerStorage; AExceptEventsWithoutResources: Boolean; const AStart, AFinish: TDateTime; + AResourceID: Variant; AExcludedEvent: TcxSchedulerEvent = nil); overload; virtual; + destructor Destroy; override; + procedure Calculate(ACalculateFreeTime: Boolean = True); virtual; + + property ConflictEvents: TcxSchedulerFilteredEventList read FConflictEvents; + property ExceptEventsWithoutResources: Boolean read FExceptEventsWithoutResources; + property Event: TcxSchedulerEvent read FEvent; + property HasConflicts: Boolean read GetHasConflicts; + property HasFreeTime: Boolean read GetHasFreeTime; + property Storage: TcxCustomSchedulerStorage read FStorage; + property TimeRanges: TcxSchedulerTimeRanges read FTimeRanges; + end; + + TcxSchedulerEventConflictsInfoClass = class of TcxSchedulerEventConflictsInfo; + + { TcxCustomSchedulerStorage } + + TcxSchedulerEventIntersectEvent = procedure(Sender: TcxCustomSchedulerStorage; AEvent1, AEvent2: TcxSchedulerEvent; + var Allow: Boolean) of object; + + TcxCustomSchedulerStorage = class(TComponent, IcxSchedulerHolidaysListener) + private + FCustomFields: TcxCustomSchedulerStorageFields; + FDataController: TcxCustomDataController; + FEditor: TForm; + FHolidays: TcxSchedulerHolidays; + FInternalFields: TcxCustomSchedulerStorageFields; + FIsChanged: Boolean; + FIsLoading: Boolean; + FIsModified: Boolean; + FIsDeletion: Boolean; + FInternalUpdate: Boolean; + FListeners: TInterfaceList; + FReminders: TcxSchedulerReminders; + FResources: TcxSchedulerStorageResources; + FRemindersEvents: TNotifyEvent; + FResourcesEvents: TNotifyEvent; + FStoreUsingGlobalTime: Boolean; + FStoringName: string; + FUpdateRemindersTimer: TTimer; + FUseActualTimeRange: Boolean; + FOnEventDeleted: TcxSchedulerNotificationEvent; + FOnEventInserted: TcxSchedulerNotificationEvent; + FOnEventIntersect: TcxSchedulerEventIntersectEvent; + FOnEventModified: TcxSchedulerNotificationEvent; + FOnFilterEvent: TcxSchedulerFilterEventEvent; + function GetDataField(AIndex: Integer): TcxCustomSchedulerStorageField; + function GetEvent(AIndex: Integer): TcxSchedulerEvent; + function GetEventCount: Integer; + function GetField(AIndex: Integer): TcxCustomSchedulerStorageField; + function GetFieldCount: Integer; + function GetInternalFieldCount: Integer; + function GetIsDestroying: Boolean; + function GetIsLoading: Boolean; + function GetIsLocked: Boolean; + function GetIsUpdatingMode: Boolean; + function GetResourceCount: Integer; + function GetResourceID(AIndex: Integer): Variant; + function GetResourceName(AIndex: Integer): string; + procedure SetEvent(AIndex: Integer; AValue: TcxSchedulerEvent); + procedure SetHolidays(AValue: TcxSchedulerHolidays); + procedure SetOnFilterEvent(AValue: TcxSchedulerFilterEventEvent); + procedure SetReminders(AValue: TcxSchedulerReminders); + procedure SetResources(AValue: TcxSchedulerStorageResources); + procedure SetStoreUsingGlobalTime(AValue: Boolean); + procedure StartUpdateRemindersTimer; + procedure StopUpdateRemindersTimer; + procedure UpdateReminders; + procedure UpdateRemindersTimerEvent(Sender: TObject); + protected + EventsIndex: TList; + FDeletedRecords: TList; + FEventsList: TcxSchedulerEventList; + FFields: TList; + FLastEditedEvent: TcxSchedulerEvent; + FNewEvents: TcxSchedulerEventList; + LockCount: Integer; + TimeBias: Double; + // internal fields + FActualFinishField: TcxCustomSchedulerStorageField; + FActualStartField: TcxCustomSchedulerStorageField; + FCaptionField: TcxCustomSchedulerStorageField; + FEventTypeField: TcxCustomSchedulerStorageField; + FFinishField: TcxCustomSchedulerStorageField; + FLabelColorField: TcxCustomSchedulerStorageField; + FLocationField: TcxCustomSchedulerStorageField; + FMessageField: TcxCustomSchedulerStorageField; + FOptionsField: TcxCustomSchedulerStorageField; + FParentIDField: TcxCustomSchedulerStorageField; + FRecurrenceIndexField: TcxCustomSchedulerStorageField; + FRecurrenceInfoField: TcxCustomSchedulerStorageField; + FReminderDateField: TcxCustomSchedulerStorageField; + FReminderMinutesBeforeStartField: TcxCustomSchedulerStorageField; + FResourceIDField: TcxCustomSchedulerStorageField; + FStartField: TcxCustomSchedulerStorageField; + FStateField: TcxCustomSchedulerStorageField; + // additional for tasks + FTaskCompleteField: TcxCustomSchedulerStorageField; + FTaskIndexField: TcxCustomSchedulerStorageField; + FTaskLinksField: TcxCustomSchedulerStorageField; + FTaskStatusField: TcxCustomSchedulerStorageField; + // additional for reminders + FReminderResourcesData: TcxCustomSchedulerStorageField; + function ActualTimeRangeAvailable: Boolean; virtual; + procedure AddInternalField(var AField: TcxCustomSchedulerStorageField; + AValueType: TcxValueTypeClass; AIsUnique: Boolean = True); + procedure AddRecord; virtual; + procedure CancelEvent(AEvent: TcxSchedulerEvent); virtual; + function CanGetValueFromPattern(AIndex: Integer): Boolean; virtual; + procedure Changed; virtual; + procedure CreateDefaultFields; virtual; + function CreateFields: TcxCustomSchedulerStorageFields; virtual; + procedure CreateHolidayEvent(const ACaption: string; const ADate: TDateTime; AResourceID: Variant); virtual; + function CreateReminders: TcxSchedulerReminders; virtual; + function CreateResources: TcxSchedulerStorageResources; virtual; + procedure CreateSubClasses; virtual; + procedure CreateVersion3Fields; + procedure DestroySubClasses; virtual; + procedure DestroyVersion3Fields; + procedure DoDeleteEvent(const ARecordIndex: Integer); virtual; + procedure DoDestroyEvent(AEvent: TcxSchedulerEvent); virtual; + function DoEventDeleted(AEvent: TcxSchedulerEvent): Boolean; virtual; + function DoEventInserted(AEvent: TcxSchedulerEvent): Boolean; virtual; + function DoEventIntersect(AEvent1, AEvent2: TcxSchedulerEvent): Boolean; virtual; + function DoEventModified(AEvent: TcxSchedulerEvent): Boolean; virtual; + function DoFilterEvent(AEvent: TcxSchedulerEvent): Boolean; virtual; + procedure DoRefresh; virtual; + procedure GenerateHolidayEventsBySchedulerHolidays(const AResourceID: Variant; AHolidays: TcxSchedulerHolidays); virtual; + function GetDataControllerClass: TcxCustomDataControllerClass; virtual; + function GetEventClass: TcxSchedulerEventClass; virtual; + function GetEventStoredID(AEvent: TcxSchedulerEvent): Variant; + function GetFieldValueBeforePost(ARecordIndex, AFieldIndex: Integer): Variant; virtual; + function GetFieldValueTypeClass(AField: TcxCustomSchedulerStorageField): TcxValueTypeClass; virtual; + function GetFocusedRecordID(ARecordIndex: Integer): Variant; virtual; + function GetParentForm: TForm; + function GetRecordID(const ARecordIndex: Integer): Variant; virtual; + function GetValue(ARecordIndex, AItemIndex: Integer): Variant; virtual; + function HasEventIntersect(AEvent1, AEvent2: TcxSchedulerEvent): Boolean; virtual; + procedure ItemAdded(AItem: TcxCustomSchedulerStorageField); + procedure ItemRemoved(AItem: TcxCustomSchedulerStorageField); + function IsDataSettingsValid: Boolean; virtual; + procedure LayoutChanged; virtual; + procedure Loaded; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure PostEvent(AEvent: TcxSchedulerEvent); virtual; + procedure PostEditingData(AEvent: TcxSchedulerEvent); virtual; + procedure SendNotification( + AIsRemoved: Boolean = False); virtual; + procedure SetEventRecordInfo(AEvent: TcxSchedulerEvent; ARecordIndex: Integer; const AEventID: Variant); virtual; + procedure SetFieldValueBeforePost(ARecordIndex, AFieldIndex: Integer; const AValue: Variant); virtual; + procedure SetPostFieldValue(AEvent: TcxSchedulerEvent; AFieldIndex: Integer); virtual; + procedure SetValue(ARecordIndex, AItemIndex: Integer; const AValue: Variant); virtual; + procedure SynchronizeEventsWithRecords; virtual; + procedure UpdateControl(AInfo: TcxUpdateControlInfo); virtual; + procedure UpdateData; virtual; + procedure UpdateItemIndexes; + + procedure BeginUpdateDataController; virtual; + procedure EndUpdateDataController; virtual; + + property DataController: TcxCustomDataController read FDataController; + property DataFields[Index: Integer]: TcxCustomSchedulerStorageField read GetDataField; + property Editor: TForm read FEditor write FEditor; + property CustomFields: TcxCustomSchedulerStorageFields read FCustomFields; + property InternalFields: TcxCustomSchedulerStorageFields read FInternalFields; + property InternalFieldCount: Integer read GetInternalFieldCount; + property IsChanged: Boolean read FIsChanged write FIsChanged; + property IsDeletion: Boolean read FIsDeletion write FIsDeletion; + property IsDestroying: Boolean read GetIsDestroying; + property IsLoading: Boolean read GetIsLoading; + property IsLocked: Boolean read GetIsLocked; + property IsModified: Boolean read FIsModified; + property IsUpdatingMode: Boolean read GetIsUpdatingMode; + property LastEditedEvent: TcxSchedulerEvent read FLastEditedEvent; + property Listeners: TInterfaceList read FListeners; + property OnEventDeleted: TcxSchedulerNotificationEvent read FOnEventDeleted write FOnEventDeleted; + property OnEventInserted: TcxSchedulerNotificationEvent read FOnEventInserted write FOnEventInserted; + property OnEventIntersect: TcxSchedulerEventIntersectEvent read FOnEventIntersect write FOnEventIntersect; + property OnEventModified: TcxSchedulerNotificationEvent read FOnEventModified write FOnEventModified; + property OnFilterEvent: TcxSchedulerFilterEventEvent read FOnFilterEvent write SetOnFilterEvent; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure AddListener(AListener: IcxSchedulerStorageListener); + procedure BeginUpdate; + procedure CalculateEventActualTimeRanges; + function CheckRequiredFields: Boolean; virtual; + function createEvent: TcxSchedulerEvent; virtual;{CreateEvent conflicts with C++ macro} + function CreateOccurrence(APattern: TcxSchedulerEvent; const ADate: TDateTime; + AType: TcxEventType): TcxSchedulerEvent; + procedure Clear; virtual; + procedure DoneRestore; + procedure EndUpdate; + function FindAvailableAllDay(var AStart, AFinish: TDateTime; + AResourceID: Variant; AExceptEventsWithoutResources: Boolean; ADuration: TDateTime = 0): Boolean; + function FindAvailableTime(var AStart, AFinish: TDateTime; AllDay: Boolean; AResourceID: Variant; + AExceptEventsWithoutResources: Boolean; ADuration: TDateTime = 0; AExcludedEvent: TcxSchedulerEvent = nil): Boolean; overload; + function FindAvailableTime(AEvent: TcxSchedulerEvent; + AExceptEventsWithoutResources: Boolean; var AStart, AFinish: TDateTime): Boolean; overload; + procedure FullRefresh; + procedure GenerateHolidayEvents(const AResourceID: Variant); virtual; + function GetEventByID(const AID: Variant): TcxSchedulerEvent; + function GetEvents(AList: TcxSchedulerFilteredEventList; + const AStart, AFinish: TDateTime): Boolean; overload; + function GetEvents(AList: TcxSchedulerFilteredEventList; + const AStart, AFinish: TDateTime; const AResourceID: Variant): Boolean; overload; + function GetFieldByName(const AName: string): TcxCustomSchedulerStorageField; + function GetHolidayNamesByDate(ADate: TDate; var ANames: string; + AOnlyVisible: Boolean = True): Boolean; virtual; + function GetReminderEvents(ADateTime: TDateTime; + AList: TcxSchedulerFilteredEventList): Boolean; + procedure InitRestore; + function IsActive: Boolean; virtual; + function IsCaptionAvailable: Boolean; virtual; + function IsLabelColorAvailable: Boolean; virtual; + function IsLocationAvailable: Boolean; virtual; + function IsMessageAvailable: Boolean; virtual; + function IsRecurrenceAvailable: Boolean; virtual; + function IsReminderByResourceAvailable: Boolean; virtual; + function IsReminderAvailable: Boolean; virtual; + function IsStateAvailable: Boolean; virtual; + procedure PopulateHolidayDates(AList: TcxSchedulerDateList; AStart, AFinish: TDate; + AOnlyVisible: Boolean = True; AClearList: Boolean = True); virtual; + procedure PostEvents; virtual; + procedure RemoveListener(AListener: IcxSchedulerStorageListener); + + // IcxSchedulerHolidaysListener + procedure HolidaysChanged(Sender: TObject); + procedure HolidaysRemoved(Sender: TObject); + + property EventCount: Integer read GetEventCount; + property Events[Index: Integer]: TcxSchedulerEvent read GetEvent write SetEvent; + property FieldCount: Integer read GetFieldCount; + property Fields[Index: Integer]: TcxCustomSchedulerStorageField read GetField; + property Holidays: TcxSchedulerHolidays read FHolidays write + SetHolidays; + property InternalUpdate: Boolean read FInternalUpdate; + property Reminders: TcxSchedulerReminders read FReminders write SetReminders; + property ResourceCount: Integer read GetResourceCount; + property ResourceIDs[Index: Integer]: Variant read GetResourceID; + property ResourceNames[Index: Integer]: string read GetResourceName; + property Resources: TcxSchedulerStorageResources read FResources write SetResources; + property StoringName: string read FStoringName write FStoringName; + property Values[ARecordIndex, AFieldIndex: Integer]: Variant read GetValue write SetValue; + published + property UseActualTimeRange: Boolean read FUseActualTimeRange write FUseActualTimeRange default False; + property StoreUsingGlobalTime: Boolean read FStoreUsingGlobalTime write SetStoreUsingGlobalTime default False; + property RemindersEvents: TNotifyEvent read FRemindersEvents write FRemindersEvents; + property ResourcesEvents: TNotifyEvent read FResourcesEvents write FResourcesEvents; + end; + + { TcxSchedulerStorage } + + TcxSchedulerStorage = class(TcxCustomSchedulerStorage) + private + function GetCustomFields: TcxSchedulerStorageFields; + procedure SetCustomFields(const AValue: TcxSchedulerStorageFields); + protected + procedure DefineProperties(Filer: TFiler); override; + public + procedure Assign(Source: TPersistent); override; + procedure SaveToFile(const AFileName: string); + procedure SaveToStream(AStream: TStream); virtual; + procedure LoadFromFile(const AFileName: string); + procedure LoadFromStream(AStream: TStream); virtual; + published + property CustomFields: TcxSchedulerStorageFields read GetCustomFields write SetCustomFields; + property Holidays; + property Reminders; + property Resources; + property OnEventDeleted; + property OnEventInserted; + property OnEventIntersect; + property OnEventModified; + property OnFilterEvent; + end; + + { TcxSchedulerControlEventID } + + TcxSchedulerControlEventID = class + public + ID, ParentID: Variant; + RecurrenceIndex: Integer; + constructor Create(AEvent: TcxSchedulerEvent); + function SameEvent(AEvent: TcxSchedulerEvent): Boolean; + function Equals(AValue: TcxSchedulerControlEventID): Boolean; + end; + + { TcxSchedulerEventSelection } + + TcxEventSelectionChangedEvent = procedure (AEvent: TcxSchedulerControlEvent) of object; + + TcxSchedulerEventSelection = class(TcxIUnknownObject, IcxSchedulerSelectionAdapter) + private + FOnEventSelectionChanged: TcxEventSelectionChangedEvent; + function GetCount: Integer; + function GetItem(AIndex: Integer): TcxSchedulerControlEvent; + function GetKey(AIndex: Integer): TcxSchedulerControlEventID; + function GetKeyCount: Integer; + protected + FKeys: TList; + FEvents: TList; + FSourceEvents: TcxSchedulerEventList; + procedure ClearKeys; + function CreateItem(AEvent: TcxSchedulerControlEvent): TcxSchedulerControlEventID; + procedure DoEventSelectionChanged(AEvent: TcxSchedulerControlEvent); + function KeyIndexOf(AEvent: TcxSchedulerControlEvent): Integer; + function IndexOf(AEvent: TcxSchedulerControlEvent): Integer; + procedure InternalClear; + procedure ReplaceSelection; + + property KeyCount: Integer read GetKeyCount; + property Keys[Index: Integer]: TcxSchedulerControlEventID read GetKey; + public + constructor Create(ASourceEvents: TcxSchedulerEventList); virtual; + destructor Destroy; override; + procedure Add(AEvent: TcxSchedulerControlEvent; AShift: TShiftState); + procedure Clear; + function IsSelected(AEvent: TcxSchedulerControlEvent): Boolean; + procedure Select(AEvent: TcxSchedulerEvent); + procedure Update; + + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxSchedulerControlEvent read GetItem; default; + property OnEventSelectionChanged: TcxEventSelectionChangedEvent + read FOnEventSelectionChanged write FOnEventSelectionChanged; + end; + + { TcxSchedulerEventList } + + TcxSchedulerEventList = class + private + FItems: TList; + function GetCount: Integer; + function GetFirst: TcxSchedulerEvent; + function GetEvent(AIndex: Integer): TcxSchedulerEvent; + function GetLast: TcxSchedulerEvent; + protected + procedure EventAdded(AEvent: TcxSchedulerEvent); virtual; + procedure DoClear(AFreeItems: Boolean); virtual; + public + constructor Create; virtual; + destructor Destroy; override; + procedure Assign(ASource: TcxSchedulerEventList{$IFDEF DELPHI6}; + AOperator: TListAssignOp = laCopy {$ENDIF}); virtual; + function Add(AEvent: TcxSchedulerEvent): Integer; virtual; + procedure Clear; + procedure Delete(AIndex: Integer); + procedure DestroyItems; + function Remove(AEvent: TcxSchedulerEvent): Integer; + function IndexOf(AEvent: TcxSchedulerEvent): Integer; + procedure Sort(ACompare: TcxCompareEventsProc); virtual; + property Count: Integer read GetCount; + property First: TcxSchedulerEvent read GetFirst; + property Items[Index: Integer]: TcxSchedulerEvent read GetEvent; default; + property Last: TcxSchedulerEvent read GetLast; + property List: TList read FItems; + end; + + { TcxSchedulerFilteredEventList } + + TcxSchedulerFilteredEventList = class(TcxSchedulerEventList) + private + FFinish: TDateTime; + FNow: TDateTime; + FReminderEventsOnly: Boolean; + FStart: TDateTime; + FStorage: TcxCustomSchedulerStorage; + function GetEvent(AIndex: Integer): TcxSchedulerControlEvent; + protected + function AddEvent(AEvent: TcxSchedulerEvent): TcxSchedulerControlEvent; + function AddOccurrence(ACalculator: TcxSchedulerOccurrenceCalculator): TcxSchedulerControlEvent; + procedure Changed; virtual; + procedure CheckEvent(AEvent: TcxSchedulerEvent; const AResourceID: Variant); virtual; + function CheckEventTimeRange: Boolean; virtual; + procedure CheckRecurrenceEvent(AEvent: TcxSchedulerEvent; const AResourceID: Variant); + procedure CheckSimpleEvent(AEvent: TcxSchedulerEvent; const AResourceID: Variant); + function CreateControlEvent(AEvent: TcxSchedulerEvent): TcxSchedulerControlEvent; virtual; + procedure Init(const AStart, AFinish: TDateTime; AStorage: TcxCustomSchedulerStorage); virtual; + function NeedAddOccurenceForReminder(AReminderStart: TDateTime; AEvent: TcxSchedulerEvent): Boolean; + + property Now: TDateTime read FNow; + public + destructor Destroy; override; + property Finish: TDateTime read FFinish; + property ReminderEventsOnly: Boolean read FReminderEventsOnly; + property Start: TDateTime read FStart; + property Storage: TcxCustomSchedulerStorage read FStorage; + property Items[AIndex: Integer]: TcxSchedulerControlEvent read GetEvent; default; + property Count; + end; + + { TcxSchedulerCachedEventList } + + TcxSchedulerCachedEventList = class(TcxSchedulerFilteredEventList, IUnknown, + IcxSchedulerSelectionAdapter) + private + FAbsoluteItems: TList; + FAlwaysShowSelectedEvent: Boolean; + FClones: TcxSchedulerFilteredEventList; + FNewEvent: TcxSchedulerEvent; + FSelStart: TDateTime; + FSelFinish: TDateTime; + FSelection: TcxSchedulerEventSelection; + FShowEventsWithoutResource: Boolean; + FTimeBias: Double; + FTimeZone: Integer; + FUseTimeRange: Boolean; + function GetAbsoluteCount: Integer; + function GetAbsoluteItem(AIndex: Integer): TcxSchedulerControlEvent; + function GetAbsoluteCountInternal: Integer; + function GetAbsoluteItemInternal(AIndex: Integer): TcxSchedulerControlEvent; + function GetItem(AIndex: Integer): TcxSchedulerControlEvent; + procedure SetSelFinish(const AValue: TDateTime); + procedure SetSelStart(const AValue: TDateTime); + // IcxSchedulerSelectionAdapter + procedure IcxSchedulerSelectionAdapter.Add = SelectionAdd; + procedure IcxSchedulerSelectionAdapter.Clear = SelectionClear; + procedure IcxSchedulerSelectionAdapter.Update = SelectionUpdate; + protected + FBeforePostCount: Integer; + FChangeRef: Integer; + FExpandedTimeRange: Boolean; + FHasClones: Boolean; + FSavedIndex: Integer; + FSavedPatternID, FSavedSourceID: Variant; + FMinNecessaryDate: TDateTime; + FMaxNecessaryDate: TDateTime; + // IUnknown + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + // + procedure Changed; override; + procedure CheckEvent(AEvent: TcxSchedulerEvent; const AResourceID: Variant); override; + function CheckEventTimeRange: Boolean; override; + function CheckEventVisibility(AEvent: TcxSchedulerEvent; AIncludeUnassigned: Boolean): Boolean; + function CreateControlEvent(AEvent: TcxSchedulerEvent): TcxSchedulerControlEvent; override; + function CreateCloneList: TcxSchedulerFilteredEventList; virtual; + function CreateSelection: TcxSchedulerEventSelection; virtual; + procedure DoClear(AFreeItems: Boolean); override; + procedure EventAdded(AEvent: TcxSchedulerEvent); override; + procedure Init(const AStart, AFinish: TDateTime; AStorage: TcxCustomSchedulerStorage); override; + procedure InternalPost(AEvent: TcxSchedulerControlEvent; ACopy: Boolean); + function IsDayNoneEmpty(ADay: Integer): Boolean; + function IsIntersect(AEvent1, AEvent2: TcxSchedulerEvent): Boolean; + function IsSelected(AEvent: TcxSchedulerControlEvent): Boolean; virtual; + procedure PopulateAbsoluteItems; + procedure PostCloneForRecurrenceEvent(AEvent: TcxSchedulerControlEvent; ACopy: Boolean); virtual; + procedure PostCloneForSimpleEvent(AEvent: TcxSchedulerControlEvent; + ACopy: Boolean; AType: TcxEventType); virtual; + procedure PostNewEvent(AEvent: TcxSchedulerControlEvent); + procedure SelectionAdd(AEvent: TcxSchedulerControlEvent; Shift: TShiftState); virtual; + procedure SelectionClear; virtual; + procedure SelectionUpdate; virtual; + public + constructor Create; override; + destructor Destroy; override; + procedure BeforeEditing(AEvent: TcxSchedulerControlEvent; AIsInplace: Boolean); + procedure BeforeUpdate; + procedure DeleteEvent(AEvent: TcxSchedulerControlEvent); + procedure CalculateClonesRange(var AMinDate, AMaxDate: TDateTime); + function CalculateNecessaryDate(var AMinDate, AMaxDate: TDateTime): Boolean; + procedure CalculateSelectionRange(var AMinDate, AMaxDate: TDateTime); + procedure CancelClones; + function CreateEvent: TcxSchedulerControlEvent; + function CreateClones: TcxSchedulerEventList; + procedure ExtractEvents(const ADate: TDateTime; AList: TcxSchedulerEventList); + procedure ExtractUsedDays(AList: TcxSchedulerDateList); + function HasConflict(IsDragCopy: Boolean; AStartDrag: Boolean): Boolean; + function HasIntersection(AEvent: TcxSchedulerControlEvent): Boolean; overload; + function HasIntersection(AList: TList): Boolean; overload; + function HasIntersection(AList1, AList2: TcxSchedulerEventList; AExcludeEquals: Boolean): Boolean; overload; + function LastEditedEvent: TcxSchedulerControlEvent; + procedure PostClones(ACopy: Boolean); + procedure PostEvent(AEvent: TcxSchedulerControlEvent); + procedure Sort(ACompare: TcxCompareEventsProc); override; + // + property AbsoluteCount: Integer read GetAbsoluteCount; + property AbsoluteItems[Index: Integer]: TcxSchedulerControlEvent read GetAbsoluteItem; + property AlwaysShowSelectedEvent: Boolean read FAlwaysShowSelectedEvent write FAlwaysShowSelectedEvent; + property TimeZone: Integer read FTimeZone write FTimeZone; + property Clones: TcxSchedulerFilteredEventList read FClones; + property ShowEventsWithoutResource: Boolean read FShowEventsWithoutResource write FShowEventsWithoutResource; + property SelStart: TDateTime read FSelStart write SetSelStart; + property SelFinish: TDateTime read FSelFinish write SetSelFinish; + property Selection: TcxSchedulerEventSelection read FSelection; + property Items[Index: Integer]: TcxSchedulerControlEvent read GetItem; default; + property UseTimeRange: Boolean read FUseTimeRange write FUseTimeRange; + end; + + { TcxSchedulerOccuranceCalculator } + + TcxSchedulerOccurrenceCalculator = class + protected + FActualStart: TDateTime; + FCalcForReminders: Boolean; + FDate: Integer; + FDay: Word; + FDayNumber: Integer; + FDayType: TcxDayType; + FEvent: TcxSchedulerEvent; + FFinishDate: TDateTime; + FIndex: Integer; + FMonth: Word; + FOccurDays: TDays; + FOccurrenceFinish: TDateTime; + FOccurrenceStart: TDateTime; + FPeriodicity: Integer; + FRecurCount: Integer; + FRecurrence: TcxRecurrence; + FStartOfWeek: Integer; + FVisibleFinish: TDateTime; + FVisibleStart: TDateTime; + FWeekStart: Integer; + FWorkDays: TDays; + FYear: Word; + FYearPeriodicity: Integer; + // + FOccurence: TcxSchedulerControlEvent; + FOccurencePos: Integer; + procedure CalcFirstDate; + procedure CalcNextDate; + function GetCertainDay(const ADate, ANumber: Integer; ADayType: TcxDayType): Integer; + function GetDayForMonth: Integer; virtual; + function GetDayFromOccurDays(const APrevDate, APeriodicity: Integer): Integer; + function GetSomeDay(const ADate, ANumber: Integer; AWeekEnd: Boolean): Integer; + procedure InitTimes; + function IsValidOccurrence: Boolean; + public + constructor Create(AEvent: TcxSchedulerEvent; const AStart, AFinish: TDateTime; + ACalcForReminders: Boolean = False); + procedure CalcOccurrence(AIndex: Integer); + procedure CalcNearestOccurrenceIntervals(AStart, AFinish: TDateTime; + var AnIntervalBefore, AnIntervalAfter: TDateTime); + function GetNextOccurrence: Boolean; virtual; + function GetOccurrenceCount(AEndDate: TDateTime): Integer; + property Event: TcxSchedulerEvent read FEvent; + property Index: Integer read FIndex; + property OccurrenceFinish: TDateTime read FOccurrenceFinish; + property OccurrenceStart: TDateTime read FOccurrenceStart; + property StartOfWeek: Integer read FStartOfWeek; + property VisibleFinish: TDateTime read FVisibleFinish; + property VisibleStart: TDateTime read FVisibleStart; + property WorkDays: TDays read FWorkDays write FWorkDays; + end; + + { TcxSchedulerContentNavigationInfo } + + TcxSchedulerContentNavigationInfo = class + public + FResourceID: Variant; + FIntervalBefore: TDateTime; + FIntervalAfter: TDateTime; + constructor Create(AResourceID: Variant); + end; + + { TcxSchedulerContentNavigationCalculator } + + TcxSchedulerContentNavigationCalculator = class + private + class procedure CalcAppointmentIntervals(AnEvent: TcxSchedulerEvent; + AInfo: TcxSchedulerContentNavigationInfo; AStart, AFinish: TDateTime); + class procedure CalcIntervals(AnEvent: TcxSchedulerEvent; + AInfo: TcxSchedulerContentNavigationInfo; AStart, AFinish: TDateTime); + class procedure CalcPatternIntervals(AnEvent: TcxSchedulerEvent; + AInfo: TcxSchedulerContentNavigationInfo; AStart, AFinish: TDateTime); + class procedure ChangeResourceNavigationIntervals( + AContentNavigationInfo: TObjectList); + class function IsEventSharedWithAnyResource(AStorage: TcxCustomSchedulerStorage; + AnEventIndex: Integer; ConsiderVisibility: Boolean): Boolean; + public + class procedure FindNavigationIntervals(AStorage: TcxCustomSchedulerStorage; + AContentNavigationInfo: TObjectList; AStart, AFinish: TDateTime; + AWithoutResources: Boolean; AShowEventsWithoutResource: Boolean); + end; + + { TcxSchedulerCustomReminderForm } + + TcxSchedulerCustomReminderForm = class(TForm) + private + FReminders: TcxSchedulerReminders; + function GetStorage: TcxCustomSchedulerStorage; + protected + procedure CheckFormPosition; virtual; + procedure CreateParams(var Params: TCreateParams); override; + procedure DoClose(var Action: TCloseAction); override; + procedure DoShow; override; + procedure FlashCaption; + function GetFormColor: TColor; virtual; + function IsLocked: Boolean; virtual; + procedure LayoutChanged; virtual; + procedure OpenEvent(AEvent: TcxSchedulerControlEvent); virtual; + function OpenEventSupported: Boolean; virtual; + procedure RestoreSelection; virtual; + procedure SaveSelection; virtual; + procedure ShowInactive; + procedure UpdateReminderList; virtual; + procedure UpdateSelectionCaptions; virtual; + + property Reminders: TcxSchedulerReminders read FReminders; + property Storage: TcxCustomSchedulerStorage read GetStorage; + public + constructor Create(AReminders: TcxSchedulerReminders); reintroduce; virtual; + destructor Destroy; override; + end; + + TcxSchedulerReminderFormClass = class of TcxSchedulerCustomReminderForm; + + { TcxSchedulerReminderEventID } + + TcxSchedulerReminderEventID = class(TcxSchedulerControlEventID) + protected + Values: array of Variant; + public + constructor Create(AEvent: TcxSchedulerControlEvent); + destructor Destroy; override; + function SameEvent(AEvent: TcxSchedulerControlEvent): Boolean; + end; + + { TcxSchedulerEventReminders } + + TcxSchedulerEventReminders = class + private + FInvalid: Boolean; + public + EventID: TcxSchedulerReminderEventID; + Reminders: array of TcxSchedulerReminder; + constructor Create(AEvent: TcxSchedulerControlEvent); + destructor Destroy; override; + procedure AddReminder(AReminder: TcxSchedulerReminder); + function Find(AReminderDate: TDateTime; const AResourceID: Variant): TcxSchedulerReminder; + procedure FreeReminderByIndex(AIndex: Integer); + procedure FreeReminders; + procedure Invalidate; + function IsValid: Boolean; + procedure RemoveInvalidReminders; + procedure Validate; + end; + + { TcxSchedulerEventRemindersList } + + TcxSchedulerEventRemindersList = class(TcxObjectList) + private + function GetItem(AIndex: Integer): TcxSchedulerEventReminders; {$IFDEF DELPHI9} inline; {$ENDIF} + public + function CreateEventReminders(AEvent: TcxSchedulerControlEvent): TcxSchedulerEventReminders; + function FindForEvent(AEvent: TcxSchedulerControlEvent): TcxSchedulerEventReminders; + procedure Invalidate; + procedure Remove(AEventReminders: TcxSchedulerEventReminders); + procedure RemoveInvalidItems; + + property Items[Index: Integer]: TcxSchedulerEventReminders read GetItem; + end; + + { TcxSchedulerReminder } + + TcxSchedulerReminder = class + private + FEvent: TcxSchedulerControlEvent; + FEventReminders: TcxSchedulerEventReminders; + FOwner: TcxSchedulerReminders; + FReminderDate: TDateTime; + FResourceID: Variant; + FInvalid: Boolean; + function GetResourcesData: TcxSchedulerReminderResourcesData; + protected + procedure ClearReminder; + procedure DismissEvent; virtual; + procedure DismissEventForResource; virtual; + procedure DoDismiss; virtual; + procedure DoSnooze(var ASnoozeTime: TDateTime); virtual; + procedure SetData(const AResourceID: Variant; AReminderDate: TDateTime); + procedure SnoozeEvent(const ASnoozeTime: TDateTime); virtual; + procedure SnoozeEventForResource(const ATime: TDateTime); virtual; + procedure Validate(AEvent: TcxSchedulerControlEvent); + + property EventReminders: TcxSchedulerEventReminders read FEventReminders; + property Invalid: Boolean read FInvalid write FInvalid; + public + constructor Create(AOwner: TcxSchedulerReminders; + AEvent: TcxSchedulerControlEvent); virtual; + destructor Destroy; override; + procedure Dismiss; + procedure Snooze(ASnoozeTime: TDateTime); + property Event: TcxSchedulerControlEvent read FEvent; + property Owner: TcxSchedulerReminders read FOwner; + property ResourceID: Variant read FResourceID; + property ReminderDate: TDateTime read FReminderDate; + end; + + { TcxSchedulerReminderList } + + TcxSchedulerReminderList = class(TList) + private + FClearing: Boolean; + function GetItem(Index: Integer): TcxSchedulerReminder; {$IFDEF DELPHI9} inline; {$ENDIF} + public + procedure Clear; override; + + property Clearing: Boolean read FClearing; + property Items[Index: Integer]: TcxSchedulerReminder read GetItem; default; + end; + + { TcxSchedulerReminders } + + TcxSchedulerReminderEvent = procedure (Sender: TcxSchedulerReminders; + AReminder: TcxSchedulerReminder; var AHandled: Boolean) of object; + TcxSchedulerRemindersEvent = procedure (Sender: TcxSchedulerReminders) of object; + TcxSchedulerGetEventDueTimeTextEvent = procedure ( + Sender: TcxSchedulerReminders; AReminder: TcxSchedulerReminder; + const ADueTimeInfo: TcxSchedulerReminderDueTimeInfo; var AText: string) of object; + TcxSchedulerGetReminderWindowCaption = procedure (Sender: TcxSchedulerReminders; + var ACaption: string) of object; + TcxSchedulerSnoozeReminderEvent = procedure (Sender: TcxSchedulerReminders; + AReminder: TcxSchedulerReminder; var ASnoozeTime: TDateTime; var AHandled: Boolean) of object; + TcxSchedulerReminderOpenEvent = procedure (Sender: TcxSchedulerReminders; + AEvent: TcxSchedulerControlEvent) of object; + + TcxSchedulerReminders = class(TcxInterfacedPersistent, + IcxFormatControllerListener, + IcxFormatControllerListener2, + IdxSkinSupport) + private + FActive: Boolean; + FDefaultMinutesBeforeStart: Integer; + FDefaultReminder: Boolean; + FEvents: TcxSchedulerFilteredEventList; + FEventRemindersList: TcxSchedulerEventRemindersList; + FItems: TcxSchedulerReminderList; + FReminderWindowLookAndFeel: TcxLookAndFeel; + FNeedCloseWindow: Boolean; + FNeedRestoreSelection: Boolean; + FNeedShowWindow: Boolean; + FReminderByResource: Boolean; + FReminderWindow: TcxSchedulerCustomReminderForm; + FShowResourcesInReminderWindow: Boolean; + FStorage: TcxCustomSchedulerStorage; + FUpdateEventsTimer: TTimer; + FUpdateRemindersTimer: TTimer; + FUpdatingReminderList: Boolean; + FUseReminderWindow: Boolean; + FOnAlertReminder: TcxSchedulerReminderEvent; + FOnDismissReminder: TcxSchedulerReminderEvent; + FOnGetEventDueTimeText: TcxSchedulerGetEventDueTimeTextEvent; + FOnOpenEvent: TcxSchedulerReminderOpenEvent; + FOnSnoozeReminder: TcxSchedulerSnoozeReminderEvent; + //reminder window events + FOnGetReminderWindowCaption: TcxSchedulerGetReminderWindowCaption; + FOnHideReminderWindow: TcxSchedulerRemindersEvent; + FOnShowReminderWindow: TcxSchedulerRemindersEvent; + procedure CreateTimers; + function GetCount: Integer; + function GetItem(Index: Integer): TcxSchedulerReminder; + procedure SetActive(AValue: Boolean); + procedure SetDefaultMinutesBeforeStart(AValue: Integer); + procedure SetReminderByResource(AValue: Boolean); + procedure SetReminderWindowLookAndFeel(AValue: TcxLookAndFeel); + procedure SetShowResourcesInReminderWindow(AValue: Boolean); + procedure StartReminder; + procedure StopReminder; + procedure UpdateReminderWindow; + procedure OnUpdateEventsTimer(Sender: TObject); + procedure OnUpdateRemindersTimer(Sender: TObject); + protected + //IcxFormatControllerListener + procedure FormatChanged; + //IcxFormatControllerListener2 + procedure TimeChanged; + + procedure AddReminder(AEvent: TcxSchedulerControlEvent; + const AResourceID: Variant; AReminderDate: TDateTime; + var AEventReminders: TcxSchedulerEventReminders); + procedure AddReminderToEventReminders(AReminder: TcxSchedulerReminder; + var AEventReminders: TcxSchedulerEventReminders); + + procedure CheckAddReminder(AEvent: TcxSchedulerControlEvent; + const AResourceID: Variant; AReminderDate: TDateTime; + var AEventReminders: TcxSchedulerEventReminders); + procedure CheckAddReminders(AEvent: TcxSchedulerControlEvent; AEventReminders: TcxSchedulerEventReminders); + procedure CheckRemindersForEvent(AEvent: TcxSchedulerControlEvent); + function CreateReminderWindow: TcxSchedulerCustomReminderForm; virtual; + function DoAlertReminder(AReminder: TcxSchedulerReminder): Boolean; virtual; + function DoDismissReminder(AReminder: TcxSchedulerReminder): Boolean; virtual; + procedure DoGetEventDueTimeText(AReminder: TcxSchedulerReminder; + const ADueTimeInfo: TcxSchedulerReminderDueTimeInfo; var AText: string); + procedure DoGetReminderWindowCaption(var ACaption: string); virtual; + procedure DoOpenEvent(AEvent: TcxSchedulerControlEvent); virtual; + function DoSnoozeReminder(AReminder: TcxSchedulerReminder; var ASnoozeTime: TDateTime): Boolean; virtual; + procedure DoHideReminderWindow; virtual; + procedure DoShowReminderWindow; virtual; + + function GetFirstReminderTimeForEvent(AEvent: TcxSchedulerEvent; ANow: TDateTime): TDateTime; + function GetNextPopulateEventsCacheTime(ANow: TDateTime; AIsLocked: Boolean): TDateTime; virtual; + function GetNextRefreshRemindersTime(ANow: TDateTime; AIsLocked: Boolean): TDateTime; virtual; + function GetNow: TDateTime; virtual; + function GetReminderClass: TcxSchedulerReminderClass; virtual; + function GetReminderResourcesFromEvent(AEvent: TcxSchedulerControlEvent; AGetFromPattern: Boolean): TcxSchedulerReminderResources; + function GetReminderWindowCaption: string; + + function IsNeedAddToReminders(AEvent: TcxSchedulerControlEvent; + const AReminderDate: TDateTime): Boolean; virtual; + function PopulateEventsCache: Boolean; virtual; + procedure RefreshReminders; virtual; + procedure RemoveEventReminders(AReminder: TcxSchedulerReminder); + procedure StopTimers; virtual; + procedure UpdateReminderList; virtual; + procedure UpdateTimer(ATimer: TTimer; AInterval: TDateTime); + procedure ValidateReminderList; + procedure ValidateRemindersForEvent(AEventReminders: TcxSchedulerEventReminders; + AEvent: TcxSchedulerControlEvent); + + property Events: TcxSchedulerFilteredEventList read FEvents; + property NeedCloseWindow: Boolean read FNeedCloseWindow; + property NeedRestoreSelection: Boolean read FNeedRestoreSelection write FNeedRestoreSelection; + property NeedShowWindow: Boolean read FNeedShowWindow; + property UpdateEventsTimer: TTimer read FUpdateEventsTimer; + property UpdateRemindersTimer: TTimer read FUpdateRemindersTimer; + property UpdatingReminderList: Boolean read FUpdatingReminderList; + public + constructor Create(AStorage: TcxCustomSchedulerStorage); reintroduce; virtual; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + + procedure DismissAll; + procedure SnoozeAll(ASnoozeTime: TDateTime); + + function GetEventDueTimeText(AReminder: TcxSchedulerReminder; + ATime: TDateTime): string; + function HasReminders: Boolean; + procedure HideReminderWindow; + function IsLocked: Boolean; virtual; + function IsReminderByResourceAvailable: Boolean; + function IsReminderWindowShown: Boolean; + procedure Refresh; + procedure ShowReminderWindow; + + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxSchedulerReminder read GetItem; default; + property ReminderWindow: TcxSchedulerCustomReminderForm read FReminderWindow; + property Storage: TcxCustomSchedulerStorage read FStorage; + published + property Active: Boolean read FActive write SetActive default True; + property DefaultMinutesBeforeStart: Integer + read FDefaultMinutesBeforeStart write SetDefaultMinutesBeforeStart default 15; + property DefaultReminder: Boolean read FDefaultReminder write FDefaultReminder default False; + property ReminderByResource: Boolean read FReminderByResource write SetReminderByResource default False; + property ReminderWindowLookAndFeel: TcxLookAndFeel read FReminderWindowLookAndFeel write SetReminderWindowLookAndFeel; + property ShowResourcesInReminderWindow: Boolean read FShowResourcesInReminderWindow write SetShowResourcesInReminderWindow default True; + property UseReminderWindow: Boolean read FUseReminderWindow write FUseReminderWindow default True; + // events + property OnAlertReminder: TcxSchedulerReminderEvent + read FOnAlertReminder write FOnAlertReminder; + property OnDismissReminder: TcxSchedulerReminderEvent + read FOnDismissReminder write FOnDismissReminder; + property OnOpenEvent: TcxSchedulerReminderOpenEvent + read FOnOpenEvent write FOnOpenEvent; + property OnSnoozeReminder: TcxSchedulerSnoozeReminderEvent + read FOnSnoozeReminder write FOnSnoozeReminder; + + property OnHideReminderWindow: TcxSchedulerRemindersEvent + read FOnHideReminderWindow write FOnHideReminderWindow; + property OnShowReminderWindow: TcxSchedulerRemindersEvent + read FOnShowReminderWindow write FOnShowReminderWindow; + + property OnGetEventDueTimeText: TcxSchedulerGetEventDueTimeTextEvent + read FOnGetEventDueTimeText write FOnGetEventDueTimeText; + property OnGetReminderWindowCaption: TcxSchedulerGetReminderWindowCaption + read FOnGetReminderWindowCaption write FOnGetReminderWindowCaption; + end; + +procedure cxCheckDaysList(AList: TList; var AStartDay, AFinishDay: Integer); +function cxGetRecurrenceDescriptionString(ARecurrenceInfo: TcxSchedulerEventRecurrenceInfo; + AFullDescription: Boolean = False): string; +function cxRecurrenceInfoDataToString(const AData: TcxSchedulerEventRecurrenceInfoData): string; +function cxStringToRecurrenceInfoData(const S: string): TcxSchedulerEventRecurrenceInfoData; +function cxMinutesToDueTimeInfo(AMinutes: Integer): TcxSchedulerReminderDueTimeInfo; +function cxDueTimeInfoToText(const AInfo: TcxSchedulerReminderDueTimeInfo): string; + +function cxCompareSchedulerControlEvents( + AEvent1, AEvent2: TcxSchedulerControlEvent): Integer; + +function cxFieldValueToVariant(const AValue: Variant): Variant; +function cxVariantToFieldValue(const AValue: Variant): Variant; +function cxReminderResourcesDataToFieldValue(const AValue: TcxSchedulerReminderResourcesData): Variant; +function cxFieldValueToReminderResourcesData(const AValue: Variant): TcxSchedulerReminderResourcesData; + +function cxTaskLinksToFieldValue(ALinks: TcxSchedulerEventLinks): Variant; +procedure cxFieldValueToTaskLinks(const AValue: Variant; ALinks: TcxSchedulerEventLinks); + +function GetStreamVersion(const AStream: TStream; + var AFieldCount: Integer; ACustomFieldCount: Integer = 0): Double; + +const + cxGetRecurrenceDescriptionStringProc: TcxGetRecurrenceDescriptionStringProc = + cxGetRecurrenceDescriptionString; + cxDueTimeInfoToTextProc: TcxDueTimeInfoToTextProc = cxDueTimeInfoToText; + cxSchedulerEventConflictsInfoClass: TcxSchedulerEventConflictsInfoClass = + TcxSchedulerEventConflictsInfo; + + cxMaxCheckedDuration: Integer = 30;// div 2; todo: + cxOriginalEventStates: array[Boolean] of Byte = (tlsBusy, tlsFree); + +implementation + +uses + cxSchedulerStrs, cxSchedulerDialogs, cxSchedulerReminderWindow, Messages; + +type + TFlashWindowExProc = function (var pfwi: FLASHWINFO): BOOL; stdcall; + PRestoringItem = ^TRestoringItem; + TRestoringItem = record + Item: TcxSchedulerStorageResourceItem; + Index: Integer; + Visible: Boolean; + WorkDays: TDays; + WorkFinish: TTime; + WorkStart: TTime; + end; + +const + DefInfoData: TcxSchedulerEventRecurrenceInfoData = + (Count: 10; DayNumber: 1; DayType: cxdtDay; Finish: -1; + OccurDays: []; Periodicity: 1; Recurrence: cxreDaily; + Start: 0; YearPeriodicity: 1); + + PatternValidStatus: array[Boolean] of TcxRecurrenceValidStatus = + (rvsInvalidPattern, rvsValid); + + FlashWindowExProc: TFlashWindowExProc = nil; + + scxSchedulerSignature = 'dxScheduler'; + cxSchedulerStreamVersion: Double = 3.0; + cxReminderResourcesDataVersion = 3; + + +function cxSchedulerStorageFieldsCompare(AItem1, AItem2: TcxCustomSchedulerStorageField): Integer; +begin + Result := AItem1.FIndex - AItem2.FIndex; +end; + +function WorkDaysToInteger(ADay: TDays): Integer; +var + AIndex: TDay; +begin + Result := 0; + for AIndex := Low(TDay) to High(TDay) do + if AIndex in ADay then + Result := Result or (1 shl Integer(AIndex)); +end; + +function IntegerToWorkDays(AValue: Integer): TDays; +var + AIndex: TDay; +begin + Result := []; + for AIndex := Low(TDay) to High(TDay) do + if (AValue shr Integer(AIndex)) and 1 <> 0 then + Result := Result + [AIndex] +end; + +function VarEqualsSoftEx(const V1, V2: Variant): Boolean; +begin + Result := not VarIsEmpty(V1) and not VarIsEmpty(V2) and + (VarEquals(V1, V2){ or VarIsNull(V1) or VarIsNull(V2)}); +end; + +function VarIsEmptyEx(const V: Variant): Boolean; +begin + Result := VarIsEmpty(V) or VarIsNull(V) or (VarIsStr(V) and (V = '')) +end; + +function cxCompareEventsByID(AEvent1, AEvent2: TcxSchedulerEvent): Integer; +begin + Result := VarCompare(AEvent1.FSavedID, AEvent2.FSavedID); +end; + +function cxIntSortProc(P1, P2: Pointer): Integer; +begin + Result := Integer(P1) - Integer(P2); +end; + +function cxCompareSelectionKeys(AItem1, AItem2: TcxSchedulerControlEventID): Integer; +begin + Result := VarCompare(AItem1.ID, AItem2.ID); + if Result = 0 then + Result := VarCompare(AItem1.ParentID, AItem2.ParentID); + if Result = 0 then + Result := AItem1.RecurrenceIndex - AItem2.RecurrenceIndex; +end; + +procedure cxCheckDaysList(AList: TList; var AStartDay, AFinishDay: Integer); +begin + AList.Sort(cxIntSortProc); + AStartDay := Integer(AList[0]); + AFinishDay := Integer(AList[AList.Count - 1]); +end; + +function cxGetRecurrenceDescriptionString( + ARecurrenceInfo: TcxSchedulerEventRecurrenceInfo; + AFullDescription: Boolean = False): string; +const + Weeks: array[1..5] of string = ('first', 'second', 'third', 'fourth', 'last'); + Days: array[cxdtEveryDay..cxdtWeekEndDay] of string = ('day', 'weekday', 'weekend day'); + EveryDays: array[Boolean] of string = ('every %d days', 'every day'); + EveryMonths1: array[Boolean] of string = ('day %d of every %d months', 'day %d of every month'); + EveryMonths2: array[Boolean] of string = ('the %s %s of every %d months', 'the %s %s of every month'); + + procedure GetDateParts(out ADayStr, AWeekStr: string); + begin + with ARecurrenceInfo do + begin + if DayNumber in [1..5] then AWeekStr := Weeks[DayNumber] else AWeekStr := ''; + if DayType in [cxdtEveryDay..cxdtWeekEndDay] then + ADayStr := Days[DayType] + else + ADayStr := LongDayNames[Ord(DayType) - Ord(cxdtSunday) + 1]; + end; + end; + + function OccurDaysToString: string; + var + ADay: TDay; + ACount, ASaveCount: Integer; + begin + Result := ''; + ACount := 0; + for ADay := Low(TDay) to High(TDay) do + if ADay in ARecurrenceInfo.OccurDays then Inc(ACount); + ASaveCount := ACount; + for ADay := Low(TDay) to High(TDay) do + if ADay in ARecurrenceInfo.OccurDays then + if ASaveCount = 1 then + begin + Result := LongDayNames[Ord(ADay) + 1]; + Exit; + end + else + begin + Dec(ACount); + if ACount > 1 then + Result := Result + LongDayNames[Ord(ADay) + 1] + ', ' + else if ACount = 1 then + Result := Result + LongDayNames[Ord(ADay) + 1] + ' ' + else + Result := Result + 'and ' + LongDayNames[Ord(ADay) + 1]; + end; + end; + + function GetTimeBounds(APattern: TcxSchedulerEvent): string; + begin + if APattern.AllDayEvent and (APattern.Duration = 1) then Exit; + Result := ' from ' + FormatDateTime('t', APattern.Start); + if APattern.Duration < 1 then + Result := Result + ' to ' + FormatDateTime('t', APattern.Finish) + else + Result := Result + ' for ' + cxMinutesToTextProc(Round(APattern.Duration / MinuteToTime)); + end; + + function GetDateBounds(APattern: TcxSchedulerEvent): string; + begin + Result := ' effective ' + FormatDateTime('ddddd', ARecurrenceInfo.Start); + if ARecurrenceInfo.Count >= 0 then + Result := Result + ' until ' + FormatDateTime('ddddd', ARecurrenceInfo.GetEndDate); + end; + +var + ADayStr, AWeekStr, AMonthStr: string; + APattern: TcxSchedulerEvent; +begin + Result := ''; + if not Assigned(ARecurrenceInfo) or not ARecurrenceInfo.Event.IsRecurring then Exit; + with ARecurrenceInfo do + begin + case Recurrence of + cxreDaily: + if DayType = cxdtWeekDay then + Result := 'every weekday' + else + Result := Format(EveryDays[Periodicity = 1], [Periodicity]); + cxreWeekly: + if Periodicity = 1 then + Result := 'every ' + OccurDaysToString + else + Result := Format('every %d weeks on %s', [Periodicity, OccurDaysToString]); + cxreMonthly: + if DayType = cxdtDay then + Result := Format(EveryMonths1[Periodicity = 1], [DayNumber, Periodicity]) + else + begin + GetDateParts(ADayStr, AWeekStr); + Result := Format(EveryMonths2[Periodicity = 1], [AWeekStr, ADayStr, Periodicity]); + end; + cxreYearly: + begin + if Periodicity in [1..12] then + AMonthStr := LongMonthNames[Periodicity] + else + AMonthStr := ''; + if DayType = cxdtDay then + Result := Format('every %s %d', [AMonthStr, DayNumber]) + else + begin + GetDateParts(ADayStr, AWeekStr); + Result := Format('the %s %s of %s', [AWeekStr, ADayStr, AMonthStr]); + end; + end; + end; + if Event.EventType = etPattern then + APattern := Event + else + begin + APattern := Event.Pattern; + if APattern = nil then + APattern := Event; + end; + if AFullDescription then + Result := 'Occurs ' + Result + GetDateBounds(APattern) + GetTimeBounds(APattern) + '.' + else + Result := Result + GetTimeBounds(APattern); + end; +end; + +function cxRecurrenceInfoDataToString(const AData: TcxSchedulerEventRecurrenceInfoData): string; +begin + SetLength(Result, SizeOf(AData)); + Move(AData, Result[1], SizeOf(AData)); +end; + +function cxStringToRecurrenceInfoData(const S: string): TcxSchedulerEventRecurrenceInfoData; +begin + if Length(S) = SizeOf(TcxSchedulerEventRecurrenceInfoData) then + Move(S[1], Result, SizeOf(TcxSchedulerEventRecurrenceInfoData)) + else + Result := DefInfoData; +end; + +function cxMinutesToDueTimeInfo(AMinutes: Integer): TcxSchedulerReminderDueTimeInfo; +const + MinsPerWeek = MinsPerDay * DaysPerWeek; +begin + with Result do + begin + if AMinutes = 0 then + begin + DueKind := dtkNow; + Minutes := 0; + Element := dteMinute; + ElementValue := 0; + Exit; + end; + if AMinutes < 0 then + DueKind := dtkOverdue + else + DueKind := dtkActual; + AMinutes := Abs(AMinutes); + Minutes := AMinutes; + case AMinutes of + 1..MinsPerHour - 1: + begin + Element := dteMinute; + ElementValue := AMinutes; + end; + MinsPerHour..MinsPerDay - 1: + begin + Element := dteHour; + ElementValue := AMinutes div MinsPerHour; + end; + MinsPerDay..MinsPerWeek - 1: + begin + Element := dteDay; + ElementValue := AMinutes div MinsPerDay; + end + else + begin + Element := dteWeek; + ElementValue := AMinutes div MinsPerWeek; + end + end; + end; +end; + +function cxDueTimeInfoToText(const AInfo: TcxSchedulerReminderDueTimeInfo): string; +const + PluralPostfix: array[Boolean] of string = ('', 's'); + ElementNames: array[TcxSchedulerReminderDueTimeElement] of string = + ('minute', 'hour', 'day', 'week'); + DueInFormatTexts: array[Boolean] of string = ('%d %s%s', '%d %s%s overdue'); +begin + with AInfo do + begin + if DueKind = dtkNow then + Result := 'Now' + else + Result := Format(DueInFormatTexts[DueKind = dtkOverdue], + [ElementValue, ElementNames[Element], PluralPostfix[ElementValue > 1]]); + end; +end; + +function cxCompareSchedulerControlEvents( + AEvent1, AEvent2: TcxSchedulerControlEvent): Integer; +var + AAllDay1, AAllDay2: Boolean; +begin + AAllDay1 := AEvent1.AllDayEvent or (AEvent1.Duration >= 1); + AAllDay2 := AEvent2.AllDayEvent or (AEvent2.Duration >= 1); + Result := Byte(AAllDay2) - Byte(AAllDay1); + if Result <> 0 then Exit; + if AEvent1.Start < AEvent2.Start then + Result := -1 + else + if AEvent1.Start > AEvent2.Start then + Result := 1 + else + if AEvent1.Finish > AEvent2.Finish then + Result := -1 + else + if AEvent1.Finish < AEvent2.Finish then + Result := 1 + else + if AEvent1.RecordIndex < AEvent2.RecordIndex then + Result := -1 + else + if AEvent1.RecordIndex > AEvent2.RecordIndex then + Result := 1 + else + Result := 0; +end; + +function cxFindEvent(AList: TList; const ID: Variant; var AEvent: TcxSchedulerEvent): Boolean; +var + L, H, I, C: Integer; +begin + Result := False; + L := 0; + H := AList.Count - 1; + while L <= H do + begin + I := (L + H) shr 1; + AEvent := TcxSchedulerEvent(AList.List^[I]); + C := VarCompare(AEvent.FSavedID, ID); + if C < 0 then + L := I + 1 + else + begin + H := I - 1; + if C = 0 then + begin + Result := True; + AList.Delete(I); + Break; + end; + end; + end; +end; + +{ TcxSchedulerStorageDataController } + +function TcxSchedulerStorageDataController.GetItem(Index: Integer): TObject; +begin + Result := Storage.FFields.List^[Index]; +end; + +function TcxSchedulerStorageDataController.GetItemValueSource( + AItemIndex: Integer): TcxDataEditValueSource; +begin + Result := evsValue; +end; + +function TcxSchedulerStorageDataController.GetItemID(AItem: TObject): Integer; +begin + if AItem is TcxCustomSchedulerStorageField then + Result := TcxCustomSchedulerStorageField(AItem).FIndex + else + Result := -1; +end; + +procedure TcxSchedulerStorageDataController.UpdateData; +begin + Storage.UpdateData; +end; + +procedure TcxSchedulerStorageDataController.UpdateItemIndexes; +begin + Storage.UpdateItemIndexes; + inherited UpdateItemIndexes; +end; + +procedure TcxSchedulerStorageDataController.UpdateControl( + AInfo: TcxUpdateControlInfo); +begin + Storage.UpdateControl(AInfo); +end; + +function TcxSchedulerStorageDataController.UseRecordID: Boolean; +begin + Result := True; +end; + +function TcxSchedulerStorageDataController.GetStorage: TcxCustomSchedulerStorage; +begin + Result := TcxCustomSchedulerStorage(GetOwner) +end; + +{ TcxCustomSchedulerStorageField } + +constructor TcxCustomSchedulerStorageField.Create(Collection: TCollection); +begin + inherited Create(Collection); + Storage.ItemAdded(Self); + ValueTypeClass := TcxStringValueType; +end; + +destructor TcxCustomSchedulerStorageField.Destroy; +var + AStorage: TcxCustomSchedulerStorage; +begin + AStorage := Storage; + Collection := nil; + AStorage.ItemRemoved(Self); + inherited Destroy; +end; + +procedure TcxCustomSchedulerStorageField.Assign(Source: TPersistent); +begin + if Source is TcxCustomSchedulerStorageField then + ValueTypeClass := TcxCustomSchedulerStorageField(Source).ValueTypeClass + else + inherited Assign(Source); +end; + +function TcxCustomSchedulerStorageField.GetDisplayName: string; +begin + Result := FName; + if Result = '' then + Result := inherited GetDisplayName; +end; + +function TcxCustomSchedulerStorageField.GetIsActive: Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerStorageField.IsValueTypeStored: Boolean; +begin + Result := ValueTypeClass <> TcxStringValueType; +end; + +function TcxCustomSchedulerStorageField.GetDataController: TcxCustomDataController; +begin + Result := Storage.DataController; +end; + +function TcxCustomSchedulerStorageField.GetStorage: TcxCustomSchedulerStorage; +begin + Result := TcxCustomSchedulerStorageFields(Collection).Storage; +end; + +function TcxCustomSchedulerStorageField.GetValue( + AIndex: Integer): Variant; +begin + Result := Storage.Values[AIndex, FIndex]; +end; + +function TcxCustomSchedulerStorageField.GetValueCount: Integer; +begin + Result := Storage.EventCount; +end; + +function TcxCustomSchedulerStorageField.GetValueType: string; +begin + if ValueTypeClass = nil then + Result := '' + else + Result := ValueTypeClass.Caption; +end; + +function TcxCustomSchedulerStorageField.GetValueTypeClass: TcxValueTypeClass; +begin + Result := Storage.DataController.GetItemValueTypeClass(Index); +end; + +procedure TcxCustomSchedulerStorageField.SetName( + const AValue: string); +begin + if FName <> AValue then + begin + FName := AValue; + Changed(True); + end; +end; + +procedure TcxCustomSchedulerStorageField.SetValue( + AIndex: Integer; const AValue: Variant); +begin + Storage.Values[AIndex, FIndex] := AValue; +end; + +procedure TcxCustomSchedulerStorageField.SetValueType( + const AValue: string); +begin + if ValueType <> AValue then + ValueTypeClass := cxValueTypeClassList.ItemByCaption(AValue); +end; + +procedure TcxCustomSchedulerStorageField.SetValueTypeClass( + AValue: TcxValueTypeClass); +begin + Storage.DataController.ChangeValueTypeClass(Index, AValue); +end; + +{ TcxCustomSchedulerStorageFields } + +function TcxCustomSchedulerStorageFields.FindFieldByName(const AName: string): TcxCustomSchedulerStorageField; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := TcxCustomSchedulerStorageField(inherited Items[I]); + if AnsiSameText(AName, Result.Name) then Exit; + end; + Result := nil; +end; + +function TcxCustomSchedulerStorageFields.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +procedure TcxCustomSchedulerStorageFields.Update(Item: TCollectionItem); +begin + inherited Update(Item); + Storage.Changed; +end; + +function TcxCustomSchedulerStorageFields.GetStorage: TcxCustomSchedulerStorage; +begin + Result := TcxCustomSchedulerStorage(GetOwner); +end; + +{ TcxSchedulerStorageFields } + +function TcxSchedulerStorageFields.Add: TcxSchedulerStorageField; +begin + Result := TcxSchedulerStorageField(inherited Add); +end; + +function TcxSchedulerStorageFields.ItemByName( + const AName: string): TcxSchedulerStorageField; +begin + Result := TcxSchedulerStorageField(FindFieldByName(AName)); +end; + +function TcxSchedulerStorageFields.GetItem( + AIndex: Integer): TcxSchedulerStorageField; +begin + Result := TcxSchedulerStorageField(inherited Items[AIndex]); +end; + +procedure TcxSchedulerStorageFields.SetItem( + AIndex: Integer; AValue: TcxSchedulerStorageField); +begin + inherited Items[AIndex].Assign(AValue); +end; + +{ TcxSchedulerEventRecurrenceInfo } + +constructor TcxSchedulerEventRecurrenceInfo.Create( + AOwner: TcxSchedulerEvent); +begin + FOwner := AOwner; +end; + +procedure TcxSchedulerEventRecurrenceInfo.Assign(Source: TPersistent); +var + S: string; +begin + if Source is TcxSchedulerEventRecurrenceInfo then + begin + if TcxSchedulerEventRecurrenceInfo(Source).GetValue(S) then + SetValue(S) + else + SetValue(''); + end + else + inherited Assign(Source); +end; + +function TcxSchedulerEventRecurrenceInfo.GetEndDate: TDateTime; +begin + if Count > 0 then + with TcxSchedulerOccurrenceCalculator.Create(FOwner, 0, 0) do + try + CalcOccurrence(Self.Count); + Result := DateOf(OccurrenceStart); + finally + Free; + end + else + if Count = 0 then + Result := Finish + else + Result := NullDate; +end; + +function TcxSchedulerEventRecurrenceInfo.GetValidStatus: TcxRecurrenceValidStatus; + + function IntersectOccurrences(APrevFinish, AStart: TDateTime): Boolean; + begin + if FOwner.AllDayEvent then + Result := DateOf(AStart) < DateOf(APrevFinish) + else + Result := AStart < APrevFinish; + end; + +var + AEdge, AFinish: TDateTime; +begin + if not FOwner.IsRecurring then + begin + Result := rvsValid; + Exit; + end; + case Recurrence of + cxreDaily: Result := GetDailyPatternStatus; + cxreWeekly: Result := GetWeeklyPatternStatus; + cxreMonthly: Result := GetMonthlyPatternStatus; + else Result := GetYearlyPatternStatus; + end; + if Result = rvsInvalidPattern then Exit; + with TcxSchedulerOccurrenceCalculator.Create(FOwner, + FOwner.RecurrenceInfo.Start, cxMaxDate) do + try + // find a first occurrence + if GetNextOccurrence then + begin + if FOwner.RecurrenceInfo.Count = 1 then Exit; + AFinish := OccurrenceFinish; + AEdge := OccurrenceStart + 14; //two weeks + repeat + if not GetNextOccurrence then Exit; + if IntersectOccurrences(AFinish, OccurrenceStart) then + begin + Result := rvsInvalidDuration; + Exit; + end; + AFinish := OccurrenceFinish; + until not (Recurrence in [cxreDaily, cxreWeekly]) or (OccurrenceStart > AEdge); + end + else + Result := rvsInvalidDuration; + finally + Free; + end; +end; + +procedure TcxSchedulerEventRecurrenceInfo.Validate; +begin + with TcxSchedulerOccurrenceCalculator.Create(FOwner, + FOwner.RecurrenceInfo.Start, cxMaxDate) do + try + if GetNextOccurrence then + FOwner.MoveTo(OccurrenceStart) + else + cxSchedulerError(cxGetResourceString(@scxWrongPattern)); + finally + Free; + end; +end; + +procedure TcxSchedulerEventRecurrenceInfo.AssignDefaultValues; +begin + Count := -1; + DayNumber := 1; + DayType := cxdtDay; + Finish := -1; + OccurDays := [TDay(DayOfWeek(Event.Start) - 1)]; + Periodicity := 1; + Recurrence := cxreWeekly; + YearPeriodicity := 1; +end; + +function TcxSchedulerEventRecurrenceInfo.GetData: TcxSchedulerEventRecurrenceInfoData; +var + S: string; +begin + if GetValue(S) then + Result := cxStringToRecurrenceInfoData(S) + else + Result := DefInfoData; +end; + +function TcxSchedulerEventRecurrenceInfo.GetOccurrences( + AList: TcxSchedulerFilteredEventList; const AStart, AFinish: TDateTime): Boolean; +var + ActualStart: TDateTime; +begin + ActualStart := AStart; + if not (FOwner.EventType in [etPattern, etNone]) and (FOwner.Pattern <> nil) then + ActualStart := FOwner.Pattern.Start; + AList.Init(Trunc(ActualStart), AFinish, Storage); + if (FOwner.EventType = etPattern) or FOwner.SkipExceptions then + begin + AList.FReminderEventsOnly := False; + AList.CheckEvent(FOwner, Null); + AList.Changed; + end; + Result := AList.Count > 0; +end; + +function TcxSchedulerEventRecurrenceInfo.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +function TcxSchedulerEventRecurrenceInfo.GetValue( + var AValue: string): Boolean; +begin + Result := FOwner.GetRecurrenceInfoValue(AValue); +end; + +procedure TcxSchedulerEventRecurrenceInfo.SetDataItem( + AOffset: Pointer; ASize: Integer; const AValue); +var + S: string; +begin + Dec(Integer(AOffset), Integer(@DefInfoData)); + if not GetValue(S) then + S := cxRecurrenceInfoDataToString(DefInfoData); + Move(AValue, S[1 + Integer(AOffset)], ASize); + SetValue(S); +end; + +procedure TcxSchedulerEventRecurrenceInfo.SetValue( + const AValue: string); +begin + FOwner.SetRecurrenceInfoValue(AValue); +end; + +function TcxSchedulerEventRecurrenceInfo.GetDailyPatternStatus: TcxRecurrenceValidStatus; +begin + if DayType = cxdtEveryDay then + Result := PatternValidStatus[Periodicity > 0] + else + Result := PatternValidStatus[(DayType = cxdtWeekDay) and (Periodicity = 1)] +end; + +function TcxSchedulerEventRecurrenceInfo.GetMonthlyPatternStatus: TcxRecurrenceValidStatus; +begin + if DayType = cxdtDay then + begin + Result := PatternValidStatus[(Periodicity > 0) and (DayNumber in [1..31])]; + if (Result = rvsValid) and (DayNumber in [29..31]) then + Result := rvsReplaceOccurrenceDate; + end + else + Result := PatternValidStatus[Periodicity > 0]; +end; + +function TcxSchedulerEventRecurrenceInfo.GetWeeklyPatternStatus: TcxRecurrenceValidStatus; +begin + Result := PatternValidStatus[(Periodicity > 0) and (OccurDays <> [])] +end; + +function TcxSchedulerEventRecurrenceInfo.GetYearlyPatternStatus: TcxRecurrenceValidStatus; +begin + if DayType = cxdtDay then + Result := PatternValidStatus[(Periodicity in [1..12]) and + (DayNumber >=1) and (DayNumber <= DaysPerMonth(2000, Periodicity))] + else + Result := PatternValidStatus[(Periodicity in [1..12])]; +end; + +function TcxSchedulerEventRecurrenceInfo.GetCount: Integer; +begin + Result := GetData.Count; +end; + +function TcxSchedulerEventRecurrenceInfo.GetDayNumber: Integer; +begin + Result := GetData.DayNumber; +end; + +function TcxSchedulerEventRecurrenceInfo.GetDayType: TcxDayType; +begin + Result := GetData.DayType; +end; + +function TcxSchedulerEventRecurrenceInfo.GetDismissDate: TDateTime; +begin + Result := GetData.DismissDate; +end; + +function TcxSchedulerEventRecurrenceInfo.GetFinish: TDateTime; +begin + Result := GetData.Finish - FOwner.TimeBias; +end; + +function TcxSchedulerEventRecurrenceInfo.GetIsInfinity: Boolean; +begin + with GetData do + Result := (Count = 0) and (Finish = -1); +end; + +function TcxSchedulerEventRecurrenceInfo.GetOccurDays: TDays; +begin + Result := GetData.OccurDays; +end; + +function TcxSchedulerEventRecurrenceInfo.GetPeriodicity: Integer; +begin + Result := GetData.Periodicity; +end; + +function TcxSchedulerEventRecurrenceInfo.GetRecurrence: TcxRecurrence; +begin + Result := GetData.Recurrence; +end; + +function TcxSchedulerEventRecurrenceInfo.GetStart: TDateTime; +begin + Result := DateOf(FOwner.Start); +end; + +function TcxSchedulerEventRecurrenceInfo.GetStorage: TcxCustomSchedulerStorage; +begin + Result := FOwner.Storage; +end; + +function TcxSchedulerEventRecurrenceInfo.GetYearPeriodicity: Integer; +begin + Result := GetData.YearPeriodicity; +end; + +procedure TcxSchedulerEventRecurrenceInfo.SetCount( + const AValue: Integer); +begin + SetDataItem(@DefInfoData.Count, SizeOf(Integer), AValue);; +end; + +procedure TcxSchedulerEventRecurrenceInfo.SetDayNumber( + const AValue: Integer); +begin + SetDataItem(@DefInfoData.DayNumber, SizeOf(Integer), AValue);; +end; + +procedure TcxSchedulerEventRecurrenceInfo.SetDayType( + const AValue: TcxDayType); +begin + SetDataItem(@DefInfoData.DayType, SizeOf(TcxDayType), AValue);; +end; + +procedure TcxSchedulerEventRecurrenceInfo.SetDismissDate( + const AValue: TDateTime); +var + ADate: Integer; +begin + ADate := Trunc(AValue); + SetDataItem(@DefInfoData.DismissDate, SizeOf(Integer), ADate); +end; + +procedure TcxSchedulerEventRecurrenceInfo.SetFinish( + AValue: TDateTime); +begin + AValue := DateTimeHelper.RoundTime(AValue) + FOwner.TimeBias; + SetDataItem(@DefInfoData.Finish, SizeOf(AValue), AValue); +end; + +procedure TcxSchedulerEventRecurrenceInfo.SetOccurDays( + const AValue: TDays); +begin + SetDataItem(@DefInfoData.OccurDays, SizeOf(TDays), AValue);; +end; + +procedure TcxSchedulerEventRecurrenceInfo.SetPeriodicity( + const AValue: Integer); +begin + SetDataItem(@DefInfoData.Periodicity, SizeOf(Integer), AValue); +end; + +procedure TcxSchedulerEventRecurrenceInfo.SetRecurrence( + const AValue: TcxRecurrence); +begin + SetDataItem(@DefInfoData.Recurrence, SizeOf(TcxRecurrence), AValue); +end; + +procedure TcxSchedulerEventRecurrenceInfo.SetStart( + const AValue: TDateTime); +begin + FOwner.MoveTo(AValue); +end; + +procedure TcxSchedulerEventRecurrenceInfo.SetYearPeriodicity( + const AValue: Integer); +begin + SetDataItem(@DefInfoData.YearPeriodicity, SizeOf(Integer), AValue); +end; + +{ TcxSchedulerEventItemLink } + +constructor TcxSchedulerEventItemLink.Create(Collection: TCollection); +begin + inherited Create(Collection); + FLinkRecurrenceIndex := -1; +end; + +function TcxSchedulerEventItemLink.GetRelationAsText: string; +begin + Result := '(' + cxGetResourceString(sEventRelations[Integer(Relation)]) + ')'; +end; + +function TcxSchedulerEventItemLink.CheckLinked( + AEvent: TcxSchedulerEvent): Boolean; +begin + Result := AEvent = Link; +end; + +function TcxSchedulerEventItemLink.CheckLinked( + const ID: Variant; ARecurrenceIndex: Integer): Boolean; +begin + Result := (Link <> nil) and VarEqualsSoft(Link.ID, ID); + if Result and Link.IsRecurring then + Result := (ARecurrenceIndex = ARecurrenceIndex); +end; + +function TcxSchedulerEventItemLink.GetData: Variant; +begin + Result := VarArrayCreate([0, 2], varVariant); + Result[0] := Relation; + if Link <> nil then + Result[1] := Link.ID + else + Result[1] := Null; + Result[2] := LinkRecurrenceIndex; +end; + +procedure TcxSchedulerEventItemLink.SetData(const AData: Variant); +var + ACandidate: TcxSchedulerEvent; +begin + Relation := AData[0]; + FLink := nil; + if not VarIsNull(AData[1]) and (Storage <> nil) then + begin + ACandidate := Storage.GetEventByID(AData[1]); + if (ACandidate <> nil) and Event.CanLink(ACandidate) then + begin + ACandidate.TaskLinkOwners.Add(Event); + FLink := ACandidate; + end; + end; + FLinkRecurrenceIndex := AData[2]; +end; + +procedure TcxSchedulerEventItemLink.UpdateLink; +begin + if (Link = nil) or (Event = nil) then Exit; + case Relation of + trFinishToStart: + if Event.Finish > Link.Start then + Link.MoveTo(Event.Finish); + trStartToStart: + if Event.Start > Link.Start then + Link.MoveTo(Event.Start); + trFinishToFinish: + if Event.Finish < Link.Finish then + Link.MoveTo(Event.Finish - Link.Duration); + trStartToFinish: + if Event.Start < Link.Finish then + Link.MoveTo(Event.Start - Link.Duration); + end; +end; + +function TcxSchedulerEventItemLink.GetEvent: TcxSchedulerEvent; +begin + Result := TcxSchedulerEventLinks(Collection).Event; +end; + +function TcxSchedulerEventItemLink.GetStorage: TcxCustomSchedulerStorage; +begin + Result := Event.Storage; +end; + +procedure TcxSchedulerEventItemLink.SetLink(AValue: TcxSchedulerEvent); +begin + if (FLink = AValue) or not Event.CanLink(AValue) then Exit; + FLink := AValue; + Changed(True); +end; + +procedure TcxSchedulerEventItemLink.SetRelation(AValue: TcxSchedulerEventRelation); +begin + if AValue = Relation then Exit; + FRelation := AValue; + Changed(True); +end; + +{ TcxSchedulerEventLinks } + +function TcxSchedulerEventLinks.Add(AEvent: TcxSchedulerEvent; + ARelation: TcxSchedulerEventRelation = trStartToFinish): TcxSchedulerEventItemLink; +begin + Result := nil; + if Event.CanLink(AEvent) then + begin + BeginUpdate; + try + Result := inherited Add as TcxSchedulerEventItemLink; + Result.FLink := AEvent; + Result.FRelation := ARelation; + finally + EndUpdate; + end; + if AEvent.TaskLinkOwners.IndexOf(Event) = -1 then + AEvent.TaskLinkOwners.Add(Event); + Event.UpdateTaskLinks; + end; +end; + +function TcxSchedulerEventLinks.IsEventLinked(AEvent: TcxSchedulerEvent): Boolean; +var + AID: Variant; + I, ARecurrenceIndex: Integer; +begin + Result := False; + if AEvent = nil then Exit; + for I := 0 to Count - 1 do + begin + if AEvent.RecordIndex < 0 then + Result := ItemLinks[I].CheckLinked(AEvent) + else + begin + AID := AEvent.ID; + ARecurrenceIndex := AEvent.RecurrenceIndex; + Result := ItemLinks[I].CheckLinked(AEvent.ID, ARecurrenceIndex); + end; + if Result then Break; + end; +end; + +function TcxSchedulerEventLinks.GetDisplayText: string; +var + I: Integer; + AText: string; +begin + Result := ''; + for I := 0 to Count - 1 do + begin + AText := VarToStr(ItemLinks[I].ID); + if (Result <> '') and (AText <> '') then + Result := Result + ListSeparator; + Result := Result + AText; + end; +end; + +function TcxSchedulerEventLinks.GetOwner: TPersistent; +begin + Result := FEvent; +end; + +procedure TcxSchedulerEventLinks.RemoveLink(ALink: TcxSchedulerEvent); +var + I: Integer; +begin + BeginUpdate; + try + for I := Count - 1 downto 0 do + if ItemLinks[I].Link = ALink then + ItemLinks[I].Free; + finally + EndUpdate; + end; +end; + +procedure TcxSchedulerEventLinks.Update(Item: TCollectionItem); +begin + inherited; + Event.TaskLinksChanged(Self); +end; + +function TcxSchedulerEventLinks.GetItemLink(AIndex: Integer): TcxSchedulerEventItemLink; +begin + Result := TcxSchedulerEventItemLink(inherited Items[AIndex]); +end; + +procedure TcxSchedulerEventLinks.SetItemLink(AIndex: Integer; AValue: TcxSchedulerEventItemLink); +begin + ItemLinks[AIndex].Assign(AValue); +end; + +function TcxSchedulerEventLinks.GetExpanded: Boolean; +begin + Result := Event.GetOptionsFlag and omCollapsed = 0; +end; + +procedure TcxSchedulerEventLinks.SetExpanded(AValue: Boolean); +begin + if Event.SetOptionsFlag(omCollapsed, not AValue) then + Event.TaskLinksChanged(Self); +end; + +{ TcxSchedulerEvent } + +constructor TcxSchedulerEvent.Create( + AStorage: TcxCustomSchedulerStorage); +begin + Create(AStorage, -1); + BeginEditing; + AssignDefaultValues; +end; + +constructor TcxSchedulerEvent.Create( + AStorage: TcxCustomSchedulerStorage; ARecordIndex: Integer); +begin + FStorage := AStorage; + FRecordIndex := ARecordIndex; + FRecurrenceInfo := CreateRecurrenceInfo; + FRecurrenceInfo.FOwner := Self; + FTaskLinks := CreateTaskLinks; + FTaskLinkOwners := CreateTaskLinkOwners; + FPrevTaskComplete := 0; + if FTaskLinks <> nil then + FTaskLinks.FEvent := Self; +end; + +destructor TcxSchedulerEvent.Destroy; +begin + FTaskLinks.Free; + FTaskLinkOwners.Free; + FStorage.DoDestroyEvent(Self); + FRecurrenceInfo.Free; + inherited Destroy; +end; + +procedure TcxSchedulerEvent.Assign(Source: TPersistent); +var + I: Integer; +begin + if Source is TcxSchedulerEvent then + begin + BeginEditing; + try + FPattern := TcxSchedulerEvent(Source).FPattern; + for I := 0 to ValueCount - 1 do + SetValueByIndex(I, TcxSchedulerEvent(Source).GetValueByIndex(I)); + if EventType = etNone then + FPattern := nil; + Start := TcxSchedulerEvent(Source).Start; + Finish := TcxSchedulerEvent(Source).Finish; + //must be the last + ReminderResourcesData := TcxSchedulerEvent(Source).ReminderResourcesData; + finally + FIsDataValid := False; + EndEditing; + end; + end; +end; + +procedure TcxSchedulerEvent.AssignAttributes( + ASource: TcxSchedulerEvent; AUseSourceTime: Boolean = True); +begin + BeginEditing; + try + if AUseSourceTime then + begin + Start := ASource.Start; + Finish := ASource.Finish; + end; + Caption := ASource.Caption; + Message := ASource.Message; + State := ASource.State; + LabelColor := ASource.LabelColor; + ResourceID := ASource.ResourceID; + finally + EndEditing; + end; +end; + +procedure TcxSchedulerEvent.ShareWithResource( + AResourceItem: TcxSchedulerStorageResourceItem); +begin + if (AResourceItem = nil) then Exit; + ShareWithResource(AResourceItem.ResourceID); +end; + +procedure TcxSchedulerEvent.ShareWithResource(AResourceID: Variant); +var + ASharedResources: Variant; +begin + if IsSharedWithResource(AResourceID) or VarIsNull(AResourceID) or + VarIsEmpty(AResourceID) then Exit; + ASharedResources := ResourceID; + if not VarIsArray(ASharedResources) then + ASharedResources := VarListArrayCreate(ASharedResources); + if VarIsNull(ASharedResources[0]) then + ASharedResources[0] := AResourceID + else + VarListArrayAddValue(ASharedResources, AResourceID); + ResourceID := ASharedResources; +end; + +function TcxSchedulerEvent.IsSharedWithResource( + AResourceItem: TcxSchedulerStorageResourceItem): Boolean; +begin + Result := False; + if VarIsNull(ResourceID) or (AResourceItem = nil) then Exit; + Result := IsSharedWithResource(AResourceItem.ResourceID); +end; + +function TcxSchedulerEvent.IsSharedWithResource(AResourceID: Variant): Boolean; +var + I: Integer; + AResources: Variant; + + function CheckSimpleID(AResID: Variant): Boolean; + var + I: Integer; + begin + if not VarIsArray(AResourceID) then + Result := VarEqualsSoftEx(AResID, AResourceID) + else + begin + Result := False; + for I := VarArrayLowBound(AResourceID, 1) to VarArrayHighBound(AResourceID, 1) do + if VarEqualsSoftEx(AResID, AResourceID[I]) then + begin + Result := True; + Break; + end; + end; + end; + +begin + Result := False; + AResources := ResourceID; + if not VarIsArray(AResources) then + Result := CheckSimpleID(AResources) + else + for I := VarArrayLowBound(AResources, 1) to VarArrayHighBound(AResources, 1) do + begin + Result := CheckSimpleID(AResources[I]); + if Result then Break; + end; +end; + +procedure TcxSchedulerEvent.UnshareWithResource( + AResourceItem: TcxSchedulerStorageResourceItem); +begin + if not IsSharedWithResource(AResourceItem) then Exit; + UnshareWithResource(AResourceItem.ResourceID); +end; + +procedure TcxSchedulerEvent.UnshareWithResource(AResourceID: Variant); +var + I, C: Integer; + ASharedResources: Variant; + ANewSharedResources: Variant; +begin + if not VarIsArray(ResourceID) and VarEquals(ResourceID, AResourceID) then + begin + ResourceID := Null; + Exit; + end + else + begin + ASharedResources := ResourceID; + C := VarArrayHighBound(ResourceID, 1) - VarArrayLowBound(ResourceID, 1); + if C = 0 then + ANewSharedResources := Null + else + begin + ANewSharedResources := VarArrayCreate([0, C - 1], varVariant); + C := 0; + for I := VarArrayLowBound(ResourceID, 1) to VarArrayHighBound(ResourceID, 1) do + if not VarEquals(AResourceID, ASharedResources[I]) then + begin + ANewSharedResources[C] := ASharedResources[I]; + Inc(C); + end; + end; + ResourceID := ANewSharedResources; + end; +end; + +procedure TcxSchedulerEvent.ReplaceResourceID(AResourceID: Variant); +begin + if Shared then + ShareWithResource(AResourceID) + else + ResourceID := AResourceID; +end; + +procedure TcxSchedulerEvent.BeginEditing; +var + I: Integer; +begin + if not IsEditing then + begin + SetLength(FEditValues, ValueCount); + for I := 0 to ValueCount - 1 do + FEditValues[I] := GetValueByIndex(I); + end; + Inc(FEditCount); +end; + +procedure TcxSchedulerEvent.Cancel; +begin + IsModified := False; + if FEditCount = 1 then + begin + if FEditCount = 0 then + SetLength(FEditValues, 0); + Storage.CancelEvent(Self); + end + else + Dec(FEditCount); +end; + +procedure TcxSchedulerEvent.EndEditing; +begin + if FEditCount = 0 then Exit; + try + if (FEditCount = 1) and not IsNewEvent then + PostEditingData; + finally + Dec(FEditCount); + if FEditCount = 0 then + SetLength(FEditValues, 0); + end; +end; + +procedure TcxSchedulerEvent.Delete; +begin + if Self = nil then Exit; + case EventType of + etCustom: + EventType := etException; + etOccurrence: + begin + Storage.BeginUpdate; + try + with Storage.CreateEvent do + begin + Assign(Self); + ParentID := Self.ID; + EventType := etException; + end; + finally + Storage.EndUpdate; + end; + end; + else + Storage.DoDeleteEvent(FIndex); + end; +end; + +procedure TcxSchedulerEvent.DeleteExceptions; +var + ALink: TcxSchedulerEvent; +begin + if not HasExceptions then Exit; + Storage.BeginUpdate; + try + while FLink <> nil do + begin + ALink := FLink.FLink; + Storage.DoDeleteEvent(FLink.FIndex); + FLink := ALink; + end; + finally + Storage.EndUpdate; + end; +end; + +function TcxSchedulerEvent.HasExceptions: Boolean; +begin + Result := (EventType = etPattern) and (Link <> nil); +end; + +function TcxSchedulerEvent.HasReminderForResourceID(const AResourceID: Variant): Boolean; +var + I: Integer; + AReminderResources: TcxSchedulerReminderResources; +begin + AReminderResources := nil; //to avoid Delphi6 warning + Result := Reminder; + if Result and not VarIsNull(ResourceID) then + begin + if Shared then + begin + Result := False; + AReminderResources := ReminderResourcesData.Resources; + for I := Low(AReminderResources) to High(AReminderResources) do + if VarEquals(AReminderResources[I].ResourceID, AResourceID) then + begin + Result := True; + Break; + end; + end + else + Result := VarEquals(ResourceID, AResourceID); + end; +end; + +function TcxSchedulerEvent.Conflicts(AExceptEventsWithoutResources: Boolean): Boolean; +var + AFinish: TDateTime; +begin + Result := False; + if IsFreeState then Exit; + AFinish := Finish; + if (EventType = etPattern) or SkipExceptions then + AFinish := Finish + cxMaxCheckedDuration; + with cxSchedulerEventConflictsInfoClass.Create(Self, AExceptEventsWithoutResources, Start, AFinish) do + try + Result := HasConflicts; + finally + Free; + end; +end; + +function TcxSchedulerEvent.CreateConflictsInfo( + AExceptEventsWithoutResources: Boolean): TcxSchedulerEventConflictsInfo; +begin + Result := cxSchedulerEventConflictsInfoClass.Create(Self, AExceptEventsWithoutResources); +end; + +function TcxSchedulerEvent.GetCustomFieldValueByIndex(AIndex: Integer): Variant; +begin + Result := GetValueDef(TcxCustomSchedulerStorageField(Storage.CustomFields.Items[AIndex]), Null); +end; + +function TcxSchedulerEvent.GetCustomFieldValueByName( + const AName: String): Variant; +var + AField: TcxCustomSchedulerStorageField; +begin + AField := Storage.CustomFields.FindFieldByName(AName); + if AField <> nil then + Result := GetValueDef(AField, Null) + else + cxSchedulerError(scxInvalidFieldName); +end; + +function TcxSchedulerEvent.GetCustomFieldValue( + ACustomField: TcxCustomSchedulerStorageField): Variant; +begin + if (ACustomField <> nil) and (ACustomField.Storage = Storage) then + Result := GetValueByIndex(ACustomField.Index) + else + cxSchedulerError(scxInvalidCustomField); +end; + +procedure TcxSchedulerEvent.SetCustomFieldValueByIndex(AIndex: Integer; + const AValue: Variant); +begin + SetValueByIndex(TcxCustomSchedulerStorageField(Storage.CustomFields.Items[AIndex]).Index, AValue); +end; + +procedure TcxSchedulerEvent.SetCustomFieldValueByName(const AName: string; + const AValue: Variant); +var + AField: TcxCustomSchedulerStorageField; +begin + AField := Storage.CustomFields.FindFieldByName(AName); + if AField <> nil then + SetValueByIndex(AField.Index, AValue) + else + cxSchedulerError(scxInvalidFieldName); +end; + +procedure TcxSchedulerEvent.SetCustomFieldValue( + ACustomField: TcxCustomSchedulerStorageField; const AValue: Variant); +begin + if (ACustomField <> nil) and (ACustomField.Storage = Storage) then + SetValueByIndex(ACustomField.Index, AValue) + else + cxSchedulerError(scxInvalidCustomField); +end; + +function TcxSchedulerEvent.GetOccurrence(ADate: TDateTime): TcxSchedulerEvent; +var + ACalculator: TcxSchedulerOccurrenceCalculator; + ALink: TcxSchedulerEvent; + AOriginalDate: TDateTime; +begin + Result := nil; + if EventType <> etPattern then Exit; + ADate := DateOf(ADate); + ALink := FLink; + while ALink <> nil do + begin + AOriginalDate := DateOf(ALink.GetOriginalDate); + if AOriginalDate = ADate then + begin + Result := ALink; + Exit; + end + else + if AOriginalDate > ADate then + break + else + ALink := ALink.FLink; + end; + ACalculator := TcxSchedulerOccurrenceCalculator.Create(Self, Start, ADate + 1); + try + while ACalculator.GetNextOccurrence do + begin + AOriginalDate := DateOf(ACalculator.OccurrenceStart); + if AOriginalDate > ADate then + break + else + if AOriginalDate = ADate then + begin + Result := Storage.createEvent; + Result.Assign(Self); + Result.Start := ACalculator.OccurrenceStart; + Result.Finish := ACalculator.OccurrenceFinish; + Result.RecurrenceIndex := ACalculator.Index; + Result.EventType := etOccurrence; + Result.ParentID := ID; + Result.FPattern := Self; + break; + end; + end; + finally + ACalculator.Free; + end; +end; + +function TcxSchedulerEvent.GetOriginalDate: TDateTime; +begin + if EventType in [etCustom, etException] then + begin + with TcxSchedulerOccurrenceCalculator.Create(Pattern, 0, 0) do + try + CalcOccurrence(Self.RecurrenceIndex + 1); + Result := OccurrenceStart; + finally + Free; + end; + end + else + Result := Start; +end; + +function TcxSchedulerEvent.GetResourceItem: TcxSchedulerStorageResourceItem; +var + I: Integer; +begin + for I := 0 to Storage.ResourceCount - 1 do + begin + Result := Storage.Resources.ResourceItems[I]; + if IsResourceEvent(Result, False) then + Exit; + end; + Result := nil; +end; + +function TcxSchedulerEvent.GetRecurrenceChain: TcxSchedulerEventList; +var + ALink: TcxSchedulerEvent; +begin + Result := TcxSchedulerEventList.Create; + if EventType = etPattern then + begin + ALink := Link; + while ALink <> nil do + begin + Result.Add(ALink); + ALink := ALink.Link; + end; + end; +end; + +function TcxSchedulerEvent.GetTaskLinkOwnerRelation(ATaskLinkOwner: TcxSchedulerEvent; var ARelation: TcxSchedulerEventRelation): Boolean; +var + I: Integer; +begin + Result := False; + if (ATaskLinkOwner = nil) or (ATaskLinkOwner.TaskLinks = nil) then Exit; + for I := 0 to ATaskLinkOwner.TaskLinks.Count - 1 do + if ATaskLinkOwner.TaskLinks.ItemLinks[I].Link = Self then + begin + Result := True; + ARelation := ATaskLinkOwner.TaskLinks.ItemLinks[I].Relation; + Break; + end; +end; + +procedure TcxSchedulerEvent.GetValidTaskTimeRange(var AStart, AFinish: TDateTime); +var + I: Integer; + ARelation: TcxSchedulerEventRelation; +begin + AStart := MinDateTime; + AFinish := MaxDateTime; + if (TaskStatus = tsComplete) or (TaskLinkOwners = nil) then + Exit; + for I := 0 to TaskLinkOwners.Count - 1 do + if GetTaskLinkOwnerRelation(TaskLinkOwners[I], ARelation) then + GetValidTaskTimeRangeByRelation(ARelation, TaskLinkOwners[I], AStart, AFinish); +end; + +procedure TcxSchedulerEvent.GetValidTaskTimeRangeByRelation(const ARelation: TcxSchedulerEventRelation; AEvent: TcxSchedulerEvent; var AStart, AFinish: TDateTime); +begin + if AEvent = nil then Exit; + case ARelation of + trFinishToStart: + AStart := Max(AStart, AEvent.Finish - GetTaskCompleteDuration); + trStartToStart: + AStart := Max(AStart, AEvent.Start - GetTaskCompleteDuration); + trFinishToFinish: + AFinish := Min(AFinish, AEvent.Finish); + trStartToFinish: + AFinish := Min(AFinish, AEvent.Start); + end; +end; + +function TcxSchedulerEvent.IsDayEvent(ADate: Integer): Boolean; +begin + Result := False; + if not FIsDataValid then + UpdateTemporaryData; + if FFinish > ADate then + Result := (FStartDate <= ADate) + else + if FFinish = ADate then + Result := FStartDate = ADate; +end; + +function TcxSchedulerEvent.IsDayEvent(const ADate: TDateTime): Boolean; +begin + Result := IsDayEvent(Integer(Trunc(ADate))); +end; + +function TcxSchedulerEvent.IsRecurring: Boolean; +begin + Result := EventType in [etPattern..etCustom]; +end; + +function TcxSchedulerEvent.IsResourceEvent( + AResource: TcxSchedulerStorageResourceItem; AllowUnassigned: Boolean): Boolean; +begin + Result := (AResource = nil) or (AllowUnassigned and VarIsNull(ResourceID)) or + IsSharedWithResource(AResource.ResourceID); +end; + +procedure TcxSchedulerEvent.MoveTo(const AStartTime: TDateTime); +begin + if not CanMoveTo(AStartTime) then + Exit; + InternalMoveTo(AStartTime); + UpdateTaskLinks; +end; + +procedure TcxSchedulerEvent.Post; +begin + if (FEditCount = 1) and IsNewEvent then + FStorage.PostEvent(Self); +end; + +procedure TcxSchedulerEvent.RemoveRecurrence; +begin + if EventType = etPattern then + begin + DeleteExceptions; + EventType := etNone; + end; +end; + +procedure TcxSchedulerEvent.UpdateTaskTime; +var + AStart, AFinish: TDateTime; +begin + GetValidTaskTimeRange(AStart, AFinish); + if Start < AStart then + MoveTo(AStart); + if Finish > AFinish then + MoveTo(AFinish - Duration); +end; + +procedure TcxSchedulerEvent.UpdateTaskLinks; +var + I: Integer; +begin + if TaskLinks = nil then Exit; + for I := 0 to TaskLinks.Count - 1 do + with TaskLinks.ItemLinks[I] do + begin + if (Link = nil) or (Link.TaskStatus = tsComplete) then Continue; + Link.UpdateTaskTime; + end; +end; + +procedure TcxSchedulerEvent.AssignDefaultValues; +begin + AllDayEvent := False; + Caption := ''; + Enabled := True; + EventType := etNone; + LabelColor := clDefault; + Location := ''; + Message := ''; + RecurrenceIndex := -1; + + Reminder := Storage.Reminders.DefaultReminder; + ReminderMinutesBeforeStart := Storage.Reminders.DefaultMinutesBeforeStart; + + Start := Now; + Finish := Start + cxDefaultEventDuration; + State := tlsBusy; + RecurrenceInfo.AssignDefaultValues; +end; + +procedure TcxSchedulerEvent.CalculateActualTimeRange; +var + AStart, AFinish: TDateTime; + ALink: TcxSchedulerEvent; +begin + if not Storage.ActualTimeRangeAvailable then Exit; + if EventType = etPattern then + begin + AStart := RecurrenceInfo.Start; + AFinish := RecurrenceInfo.Finish; + with TcxSchedulerOccurrenceCalculator.Create(Self, RecurrenceInfo.Start, cxMaxDate) do + try + if not RecurrenceInfo.IsInfinity then + while GetNextOccurrence do + begin + AStart := Min(AStart, OccurrenceStart); + AFinish := Max(AFinish, OccurrenceFinish); + end + else + AFinish := cxMaxDate; + finally + Free; + end; + ALink := Link; + while ALink <> nil do + begin + AStart := Min(AStart, ALink.Start); + AFinish := Max(AFinish, ALink.Finish); + ALink := ALink.Link; + end; + end + else + begin + AStart := Start; + AFinish := Finish; + if Pattern <> nil then + begin + AStart := Min(AStart, Pattern.Start); + AFinish := Max(AFinish, Pattern.Finish); + end; + end; + SetActualTimeRange(AStart, AFinish); +end; + +procedure TcxSchedulerEvent.CalculateActualTimeRangePost; +begin + if not Storage.ActualTimeRangeAvailable then Exit; + if (EventType in [etCustom, etException]) and (Pattern <> nil) then + begin + Pattern.CheckRecurrenceLinkEx(Self); + Pattern.CalculateActualTimeRange; + end; +end; + +function TcxSchedulerEvent.CanLink(AEvent: TcxSchedulerEvent): Boolean; + + function IsEventLinked(AHeaderEvent: TcxSchedulerEvent): Boolean; + var + I: Integer; + begin + Result := (AHeaderEvent = nil) or (AHeaderEvent = Self); + if Result then Exit; + for I := 0 to AHeaderEvent.TaskLinks.Count - 1 do + begin + if (AHeaderEvent.TaskLinks[I].Link = nil) then + Continue; + Result := Result or (Self = AHeaderEvent.TaskLinks[I].Link) or IsEventLinked(AHeaderEvent.TaskLinks[I].Link); + if Result then Break; + end; + end; + +begin + Result := (AEvent <> nil) and IsSharedWithResource(AEvent.ResourceID) and + not IsEventLinked(AEvent) and (AEvent.TaskLinkOwners.IndexOf(Self) = -1); +end; + +function TcxSchedulerEvent.CanMoveTo(ANewTime: TDateTime): Boolean; +var + AStartTime, AFinishTime: TDateTime; +begin + Result := TaskStatus = tsComplete; + if not Result then + begin + GetValidTaskTimeRange(AStartTime, AFinishTime); + Result := (AStartTime <= ANewTime) and (AFinishTime >= (ANewTime + Duration)); + end; +end; + +procedure TcxSchedulerEvent.CheckLinksOnChangeEventType(ANewEventType: TcxEventType); +var + I: Integer; +begin + if ANewEventType <> etNone then + begin + if FTaskLinks <> nil then FTaskLinks.Clear; + if (TaskLinkOwners <> nil) then + for I := TaskLinkOwners.Count - 1 downto 0 do + if TaskLinkOwners[I] <> nil then + TaskLinkOwners[I].RemoveTaskLink(Self); + end; +end; + +procedure TcxSchedulerEvent.CheckRecurrenceLink(AEvent: TcxSchedulerEvent); +begin + if (AEvent.EventType in [etCustom, etException]) and VarEquals(ID, AEvent.ParentID) then + begin + AEvent.FPattern := Self; + AEvent.FLink := FLink; + FLink := AEvent; + end; +end; + +procedure TcxSchedulerEvent.CheckRecurrenceLinkEx(AEvent: TcxSchedulerEvent); +var + ALink: TcxSchedulerEvent; +begin + if AEvent.Link <> nil then Exit; + ALink := FLink; + while (ALink <> nil) and (ALink <> AEvent) do + ALink := ALink.Link; + if ALink = nil then + begin + AEvent.FLink := Link; + FLink := AEvent; + end; +end; + +function TcxSchedulerEvent.CheckTimeRange( + const AStartDate, AFinishDate: Integer): Boolean; +begin + Result := (ActualStart <= AFinishDate) and (ActualFinish >= AStartDate); +end; + +function TcxSchedulerEvent.CreateTaskLinks: TcxSchedulerEventLinks; +begin + Result := TcxSchedulerEventLinks.Create(TcxSchedulerEventItemLink); +end; + +function TcxSchedulerEvent.CreateTaskLinkOwners: TcxSchedulerEventList; +begin + Result := TcxSchedulerEventList.Create(); +end; + +function TcxSchedulerEvent.CreateRecurrenceInfo: TcxSchedulerEventRecurrenceInfo; +begin + Result := TcxSchedulerEventRecurrenceInfo.Create(Self); +end; + +function TcxSchedulerEvent.CreateReminderResourcesData: TcxSchedulerReminderResourcesData; +var + ACount, I: Integer; + AReminderDate, ADismissDate: TDateTime; +begin + Result.Version := 3; + AReminderDate := ReminderDate; + ADismissDate := RecurrenceInfo.DismissDate; + ACount := ResourceIDCount; + SetLength(Result.Resources, ACount); + for I := 0 to ACount - 1 do + with Result.Resources[I] do + begin + DismissDate := ADismissDate; + ResourceID := ResourceIDs[I]; + ReminderDate := AReminderDate; + end; +end; + +function TcxSchedulerEvent.GetIsFreeState: Boolean; +begin + Result := State = tlsFree; +end; + +function TcxSchedulerEvent.GetOccurrenceByIndex( + AIndex: Integer; var AOccurrence: TcxSchedulerEvent): Boolean; +begin + Result := False; + if (FLink = nil) or SkipExceptions then Exit; + AOccurrence := FLink; + while (AOccurrence <> nil) and (AOccurrence.RecurrenceIndex <> AIndex) do + AOccurrence := AOccurrence.FLink; + Result := (AOccurrence <> nil) and (AOccurrence.RecurrenceIndex = AIndex); +end; + +function TcxSchedulerEvent.GetOwner: TPersistent; +begin + Result := FStorage; +end; + +function TcxSchedulerEvent.GetRecurrenceInfoValue( + var AValue: string): Boolean; +begin + AValue := GetValueDef(FStorage.FRecurrenceInfoField, ''); + Result := AValue <> ''; +end; + +procedure TcxSchedulerEvent.GetStartFinishTime(var AStart, AFinish: TDateTime); +begin + AStart := Start; + AFinish := Finish; +end; + +function TcxSchedulerEvent.GetTaskLinks: TcxSchedulerEventLinks; +begin + Result := FTaskLinks; +end; + +function TcxSchedulerEvent.GetTaskLinkOwners: TcxSchedulerEventList; +begin + Result := FTaskLinkOwners; +end; + +function TcxSchedulerEvent.GetTaskCompleteDuration: TDateTime; +begin + Result := Duration * TaskComplete / 100; +end; + +function TcxSchedulerEvent.GetValueByIndex(AIndex: Integer): Variant; +begin + Result := FStorage.GetValue(RecordIndex, AIndex); + if (Pattern <> nil) and (Pattern <> Self) and VarIsNull(Result) and Storage.CanGetValueFromPattern(AIndex) then + Result := Pattern.GetValueByIndex(AIndex); +end; + +function TcxSchedulerEvent.GetValueDef( + AField: TcxCustomSchedulerStorageField; const ADefValue: Variant): Variant; +begin + if not IsEditing then + Result := GetValueByIndex(AField.Index) + else + Result := FEditValues[AField.Index]; + if VarType(Result) in [varNull, varEmpty] then + Result := ADefValue; +end; + +procedure TcxSchedulerEvent.InitTaskLinks; +begin + FTaskLinks.Clear; + FTaskLinkOwners.Clear; +end; + +procedure TcxSchedulerEvent.InternalMoveTo(const AStartTime: TDateTime); +var + ADuration: Double; +begin + BeginEditing; + try + ADuration := Duration; + Start := AStartTime; + Duration := ADuration; + finally + EndEditing; + end; +end; + +procedure TcxSchedulerEvent.Modified; +begin + FIsModified := True; +end; + +procedure TcxSchedulerEvent.PostEditingData; +var + ACount: Integer; +begin + if IsModified then + begin + ACount := Storage.DataController.RecordCount; + Storage.FLastEditedEvent := Self; + Storage.BeginUpdate; + try + CalculateActualTimeRange; + if FRecordIndex <> cxInvalidRecordIndex then + FStorage.PostEditingData(Self); + finally + if Storage.DataController.RecordCount < ACount then + FRecordIndex := cxInvalidRecordIndex; + CalculateActualTimeRangePost; + Storage.EndUpdate; + end; + end; +end; + +procedure TcxSchedulerEvent.RefreshTaskLinks; +begin + cxFieldValueToTaskLinks(GetValueDef(FStorage.FTaskLinksField, Null), TaskLinks); +end; + +procedure TcxSchedulerEvent.RemoveTaskLink(ALink: TcxSchedulerEvent); +begin + if TaskLinks <> nil then + TaskLinks.RemoveLink(ALink); +end; + +procedure TcxSchedulerEvent.ResetReminderResourcesData; +begin + if Storage.IsReminderByResourceAvailable then + begin + if Reminder and Shared then + SetValue(Storage.FReminderResourcesData, cxReminderResourcesDataToFieldValue(CreateReminderResourcesData)) + else + SetValue(Storage.FReminderResourcesData, Null); + end; +end; + +procedure TcxSchedulerEvent.SetActualTimeRange( + const ActualStart, ActualFinish: TDateTime); +begin + SetValue(FStorage.FActualStartField, Integer(Trunc(ActualStart + TimeBias))); + SetValue(FStorage.FActualFinishField, Integer(Trunc(ActualFinish + TimeBias))); +end; + +procedure TcxSchedulerEvent.SetRecordIndex( + const AIndex: Integer); +begin + if AIndex <> -1 then + FSavedID := FStorage.GetRecordID(AIndex) + else + FSavedID := Null; + FIsDataValid := False; + FRecordIndex := AIndex; + FLink := nil; +end; + +procedure TcxSchedulerEvent.SetRecurrenceInfoValue( + const AValue: string); +begin + SetValue(FStorage.FRecurrenceInfoField, AValue); +end; + +procedure TcxSchedulerEvent.SetValue( + AField: TcxCustomSchedulerStorageField; const AValue: Variant); +begin + SetValueByIndex(AField.Index, AValue); +end; + +procedure TcxSchedulerEvent.SetValueByIndex( + AIndex: Integer; const AValue: Variant); +var + ACount: Integer; + APrevValue: Variant; +begin + if IsEditing then + APrevValue := FEditValues[AIndex] + else + APrevValue := GetValueByIndex(AIndex); + if (VarType(APrevValue) = VarType(AValue)) and VarEquals(AValue, APrevValue) then Exit; + Modified; + ACount := Storage.DataController.RecordCount; + BeginEditing; + try + FEditValues[AIndex] := AValue + finally + EndEditing; + end; + if Storage.DataController.RecordCount <> ACount then + FRecordIndex := cxInvalidRecordIndex; +end; + +procedure TcxSchedulerEvent.TaskLinksChanged(Sender: TcxSchedulerEventLinks); +begin + if (Sender = FTaskLinks) and not Storage.IsUpdatingMode then + SetValue(FStorage.FTaskLinksField, cxTaskLinksToFieldValue(TaskLinks)); +end; + +function TcxSchedulerEvent.TimeBias: Double; +begin + Result := Storage.TimeBias; +end; + +procedure TcxSchedulerEvent.UpdateTemporaryData; +begin + FStart := TDateTime(GetValueDef(FStorage.FStartField, 0)) - TimeBias; + FFinish := TDateTime(GetValueDef(FStorage.FFinishField, 0)) - TimeBias; + if (FPattern <> nil) and (EventType <> etPattern) then + FOptions := GetValueDef(FStorage.FOptionsField, FPattern.GetOptionsFlag) + else + FOptions := GetValueDef(FStorage.FOptionsField, 0); + FStartDate := Trunc(FStart); + FIsDataValid := True; +end; + +function TcxSchedulerEvent.GetActualFinish: Integer; +begin + Result := Integer(GetValueDef(FStorage.FActualFinishField, 0)); +end; + +function TcxSchedulerEvent.GetActualStart: Integer; +begin + Result := Integer(GetValueDef(FStorage.FActualStartField, 0)); +end; + +function TcxSchedulerEvent.GetAllDayEvent: Boolean; +begin + Result := (GetOptionsFlag and omAllDayEvent) <> 0; +end; + +function TcxSchedulerEvent.GetCaption: string; +begin + Result := GetValueDef(FStorage.FCaptionField, ''); +end; + +function TcxSchedulerEvent.GetDuration: TDateTime; +begin + Result := DateTimeHelper.RoundTime(Finish - Start); +end; + +function TcxSchedulerEvent.GetEditValue(AIndex: Integer): Variant; +begin + if IsEditing then + Result := FEditValues[AIndex] + else + Result := Null; +end; + +function TcxSchedulerEvent.GetEnabled: Boolean; +begin + Result := (GetOptionsFlag and omEnabled) <> 0; +end; + +function TcxSchedulerEvent.GetEventType: TcxEventType; +begin + Result := GetValueDef(FStorage.FEventTypeField, etNone); +end; + +function TcxSchedulerEvent.GetFinish: TDateTime; +begin + if not FIsDataValid then + UpdateTemporaryData; + Result := FFinish; +end; + +function TcxSchedulerEvent.GetID: Variant; +begin + Result := FStorage.GetRecordId(RecordIndex); +end; + +function TcxSchedulerEvent.GetIsNewEvent: Boolean; +begin + Result := (FRecordIndex = -1) and + (FStorage.FNewEvents.IndexOf(Self) <> - 1); +end; + +function TcxSchedulerEvent.GetIsEditing: Boolean; +begin + Result := FEditCount > 0; +end; + +function TcxSchedulerEvent.GetLabelColor: Integer; +begin + Result := GetValueDef(FStorage.FLabelColorField, clDefault); +end; + +function TcxSchedulerEvent.GetLocation: string; +begin + Result := GetValueDef(FStorage.FLocationField, ''); +end; + +function TcxSchedulerEvent.Getmessage: string; +begin + Result := GetValueDef(FStorage.FMessageField, ''); +end; + +function TcxSchedulerEvent.GetOptionsFlag: Integer; +begin + if not FIsDataValid then + UpdateTemporaryData; + Result := FOptions; +end; + +function TcxSchedulerEvent.GetParentID: Variant; +begin + Result := GetValueDef(FStorage.FParentIDField, Integer(-2)); +end; + +function TcxSchedulerEvent.GetReadOnly: Boolean; +begin + Result := (GetResourceItem <> nil) and GetResourceItem.ReadOnly; +end; + +function TcxSchedulerEvent.GetRecurrenceIndex: Integer; +begin + Result := GetValueDef(FStorage.FRecurrenceIndexField, 0) +end; + +function TcxSchedulerEvent.GetReminder: Boolean; +begin + Result := (GetOptionsFlag and omReminder) <> 0; +end; + +function TcxSchedulerEvent.GetReminderDate: TDateTime; +var + AValue: Variant; +begin + if not IsEditing then + AValue := GetValueByIndex(FStorage.FReminderDateField.Index) + else + AValue := FEditValues[FStorage.FReminderDateField.Index]; + if VarType(AValue) in [varNull, varEmpty] then + Result := Start + else + Result := TDateTime(AValue) - TimeBias; +end; + +function TcxSchedulerEvent.GetReminderMinutesBeforeStart: Integer; +begin + Result := GetValueDef(FStorage.FReminderMinutesBeforeStartField, Integer(-2)); +end; + +function TcxSchedulerEvent.GetReminderResourcesData: TcxSchedulerReminderResourcesData; +begin + Result := cxFieldValueToReminderResourcesData(GetValueDef(FStorage.FReminderResourcesData, Null)); +end; + +function TcxSchedulerEvent.GetResourceID: Variant; +begin + Result := GetValueDef(FStorage.FResourceIDField, Null); + if VarType(Result) = varString then + Result := cxFieldValueToVariant(Result); +end; + +function TcxSchedulerEvent.GetResourceIDCount: Integer; +var + AResources: Variant; +begin + AResources := ResourceID; + if VarIsNull(AResources) then + begin + Result := 0; + Exit; + end; + if VarIsArray(AResources) then + Result := VarArrayHighBound(AResources, 1) - VarArrayLowBound(AResources, 1) + 1 + else + Result := 1; +end; + +function TcxSchedulerEvent.GetResourceIDs(Index: Integer): Variant; +var + AResources: Variant; +begin + AResources := ResourceID; + if VarIsArray(AResources) then + Result := AResources[Index] + else + Result := AResources; +end; + +function TcxSchedulerEvent.GetShared: Boolean; +begin + Result := VarIsArray(ResourceID) and ((VarArrayHighBound(ResourceID, 1) - + VarArrayLowBound(ResourceID, 1)) > 0); +end; + +function TcxSchedulerEvent.GetStart: TDateTime; +begin + if not FIsDataValid then + UpdateTemporaryData; + Result := FStart; +end; + +function TcxSchedulerEvent.GetState: Integer; +begin + Result := GetValueDef(FStorage.FStateField, 0); +end; + +function TcxSchedulerEvent.GetTaskIndex: Integer; +begin + Result := GetValueDef(FStorage.FTaskIndexField, -1); +end; + +function TcxSchedulerEvent.GetTaskComplete: Integer; +begin + Result := GetValueDef(FStorage.FTaskCompleteField, 0); +end; + +function TcxSchedulerEvent.GetTaskStatus: TcxSchedulerEventTaskStatus; +var + AStatus: Integer; +begin + AStatus := GetValueDef(FStorage.FTaskStatusField, 0); + if (AStatus < 0) or (Integer(AStatus) > Integer(High(TcxSchedulerEventTaskStatus))) then + Result := tsNotStarted + else + Result := TcxSchedulerEventTaskStatus(AStatus); +end; + +function TcxSchedulerEvent.GetValueCount: Integer; +begin + Result := FStorage.FieldCount; +end; + +procedure TcxSchedulerEvent.InternalSetTaskComplete(const AValue: Integer; AUpdateTaskStatus: Boolean = True); +begin + if TaskComplete = AValue then Exit; + if (AValue = 100) and (TaskComplete <> 100) then + FPrevTaskComplete := TaskComplete + else + if AValue = 0 then + FPrevTaskComplete := 0; + SetValue(FStorage.FTaskCompleteField, AValue); + if AUpdateTaskStatus then + begin + if AValue = 100 then + InternalSetTaskStatus(tsComplete, False) + else + if (AValue = 0) and not (TaskStatus in [tsWaiting, tsDeferred]) then + InternalSetTaskStatus(tsNotStarted, False) + else + InternalSetTaskStatus(tsInProgress, False); + end; + Post; + UpdateTaskTime; +end; + +procedure TcxSchedulerEvent.InternalSetTaskStatus(AValue: TcxSchedulerEventTaskStatus; AUpdateTaskComplete: Boolean = True); +begin + if TaskStatus = AValue then Exit; + SetValue(FStorage.FTaskStatusField, AValue); + if AUpdateTaskComplete then + case AValue of + tsNotStarted: + InternalSetTaskComplete(0, False); + tsComplete: + InternalSetTaskComplete(100, False); + else + InternalSetTaskComplete(FPrevTaskComplete, False); + end; +end; + +procedure TcxSchedulerEvent.SetAllDayEvent(const AValue: Boolean); +begin + if SetOptionsFlag(omAllDayEvent, AValue) then + begin + if AValue then + begin + Start := DateOf(Start); + if DateOf(Finish) <= Start then + Finish := Start + 1 + else + Finish := DateOf(Finish) + end + else + begin + Start := DateOf(Start) + cxTime8AM; + Finish := DateOf(Finish) + cxTime8AM + cxHalfHour; + end; + end; +end; + +procedure TcxSchedulerEvent.SetCaption(const AValue: string); +begin + SetValue(FStorage.FCaptionField, AValue); +end; + +procedure TcxSchedulerEvent.SetDuration(const AValue: TDateTime); +begin + Finish := Start + DateTimeHelper.RoundTime(AValue); +end; + +procedure TcxSchedulerEvent.SetEditValue(AIndex: Integer; + const AValue: Variant); +begin + if not IsEditing then Exit; + FEditValues[AIndex] := AValue; +end; + +procedure TcxSchedulerEvent.SetEnabled(const AValue: Boolean); +begin + SetOptionsFlag(omEnabled, AValue); +end; + +procedure TcxSchedulerEvent.SetEventType(AValue: TcxEventType); +var + AResetRecurrence: Boolean; +begin + CheckLinksOnChangeEventType(AValue); + AResetRecurrence := FStorage.IsRecurrenceAvailable; + if not AResetRecurrence then + AValue := etNone; + AResetRecurrence := AResetRecurrence and (AValue = etNone) and + (AValue <> EventType); + SetValue(FStorage.FEventTypeField, AValue); + if AResetRecurrence then + RecurrenceInfo.AssignDefaultValues; +end; + +procedure TcxSchedulerEvent.SetFinish(const AValue: TDateTime); +begin + FFinish := DateTimeHelper.RoundTime(AValue); + SetValue(FStorage.FFinishField, FFinish + TimeBias); +end; + +procedure TcxSchedulerEvent.SetLabelColor(const AValue: Integer); +begin + SetValue(FStorage.FLabelColorField, AValue); +end; + +procedure TcxSchedulerEvent.SetLocation(const AValue: string); +begin + SetValue(FStorage.FLocationField, AValue); +end; + +procedure TcxSchedulerEvent.SetMessage(const AValue: string); +begin + SetValue(FStorage.FMessageField, AValue); +end; + +function TcxSchedulerEvent.SetOptionsFlag(const AMask: Integer; + AValue: Boolean): Boolean; +begin + if not FIsDataValid then + UpdateTemporaryData; + Result := (FOptions and AMask = AMask) <> AValue; + if AValue then + FOptions := FOptions or AMask + else + FOptions := FOptions and not AMask; + SetValue(FStorage.FOptionsField, FOptions); +end; + +procedure TcxSchedulerEvent.SetParentID(const AValue: Variant); +begin + SetValue(FStorage.FParentIDField, AValue); +end; + +procedure TcxSchedulerEvent.SetRecurrenceIndex(const AValue: Integer); +begin + SetValue(FStorage.FRecurrenceIndexField, AValue); +end; + +procedure TcxSchedulerEvent.SetRecurrenceInfo( + AValue: TcxSchedulerEventRecurrenceInfo); +begin + FRecurrenceInfo.Assign(AValue); +end; + +procedure TcxSchedulerEvent.SetReminder(const AValue: Boolean); +begin + SetOptionsFlag(omReminder, AValue); + ResetReminderResourcesData; +end; + +procedure TcxSchedulerEvent.SetReminderDate(AValue: TDateTime); +begin + SetValue(FStorage.FReminderDateField, AValue + TimeBias); + ResetReminderResourcesData; +end; + +procedure TcxSchedulerEvent.SetReminderMinutesBeforeStart(const AValue: Integer); +begin + if ReminderMinutesBeforeStart <> AValue then + begin + ReminderDate := FStart - MinuteToTime * AValue; + ResetReminderResourcesData; + end; + SetValue(FStorage.FReminderMinutesBeforeStartField, AValue); +end; + +procedure TcxSchedulerEvent.SetReminderResourcesData(const AValue: TcxSchedulerReminderResourcesData); +begin + SetValue(FStorage.FReminderResourcesData, cxReminderResourcesDataToFieldValue(AValue)); +end; + +procedure TcxSchedulerEvent.SetResourceID(const AValue: Variant); +begin + SetValue(FStorage.FResourceIDField, cxVariantToFieldValue(AValue)); + ResetReminderResourcesData; +end; + +procedure TcxSchedulerEvent.SetStart(const AValue: TDateTime); +begin + FStart := DateTimeHelper.RoundTime(AValue); + FStartDate := Trunc(FStart); + SetValue(FStorage.FStartField, FStart + TimeBias); + ReminderDate := FStart - MinuteToTime * ReminderMinutesBeforeStart; + RecurrenceInfo.DismissDate := DateOf(ReminderDate) - 1; +end; + +procedure TcxSchedulerEvent.SetState(const AValue: Integer); +begin + SetValue(FStorage.FStateField, AValue); +end; + +procedure TcxSchedulerEvent.SetTaskComplete(const AValue: Integer); +begin + InternalSetTaskComplete(AValue); +end; + +procedure TcxSchedulerEvent.SetTaskIndex(const AValue: Integer); +begin + SetValue(FStorage.FTaskIndexField, AValue); +end; + +procedure TcxSchedulerEvent.SetTaskStatus(AValue: TcxSchedulerEventTaskStatus); +begin + InternalSetTaskStatus(AValue); +end; + +{ TcxSchedulerControlEvent } + +constructor TcxSchedulerControlEvent.Create( + AStorage: TcxCustomSchedulerStorage); +begin + FStorage := AStorage; + SetLength(FValues, AStorage.FieldCount); + ClearValues; + SetRecordIndex(-1); + FRecurrenceInfo := CreateRecurrenceInfo; + FRecurrenceInfo.FOwner := Self; + AssignDefaultValues; +end; + +constructor TcxSchedulerControlEvent.Create(ASource: TcxSchedulerEvent); +begin + SetLength(FValues, ASource.ValueCount); + ClearValues; + inherited Create(ASource.FStorage); + FIsClone := ASource is TcxSchedulerControlEvent; + SetRecordIndex(ASource.RecordIndex); + FSource := ASource; + FLink := ASource.FLink; + Assign(ASource); +end; + +constructor TcxSchedulerControlEvent.Create( + ASource: TcxSchedulerEvent; const AStart, AFinish: TDateTime); +begin + Create(ASource); + Start := AStart; + Finish := AFinish; +end; + +destructor TcxSchedulerControlEvent.Destroy; +begin + if FIsClone and (Source is TcxSchedulerControlEvent) then + TcxSchedulerControlEvent(Source).FIsSource := False; + SetLength(FValues, 0); + inherited Destroy; +end; + +procedure TcxSchedulerControlEvent.Assign(Source: TPersistent); + + function GetPattern: TcxSchedulerEvent; + begin + if IsClone then + Result := TcxSchedulerEvent(Source).FPattern + else + if TcxSchedulerEvent(Source).EventType = etPattern then + Result := TcxSchedulerEvent(Source) + else + Result := nil; + end; + +var + I: Integer; +begin + if Source is TcxSchedulerEvent then + begin + for I := 0 to ValueCount - 1 do + FValues[I] := TcxSchedulerEvent(Source).GetValueByIndex(I); + FIsDataValid := False; + FPattern := GetPattern; + end; +end; + +procedure TcxSchedulerControlEvent.BeginEditing; +begin + // do nothing for +end; + +procedure TcxSchedulerControlEvent.Delete; +begin + if EventType = etOccurrence then + inherited Delete + else + if Source <> nil then + Source.Delete; +end; + +procedure TcxSchedulerControlEvent.EndEditing; +begin +end; + +function TcxSchedulerControlEvent.GetTaskLinkOwnerRelation(ATaskLinkOwner: TcxSchedulerEvent; var ARelation: TcxSchedulerEventRelation): Boolean; +begin + if Source <> nil then + Result := Source.GetTaskLinkOwnerRelation(ATaskLinkOwner, ARelation) + else + Result := inherited GetTaskLinkOwnerRelation(ATaskLinkOwner, ARelation); +end; + +procedure TcxSchedulerControlEvent.GetValidTaskTimeRange(var AStart, AFinish: TDateTime); +begin + if Source <> nil then + Source.GetValidTaskTimeRange(AStart, AFinish) + else + inherited GetValidTaskTimeRange(AStart, AFinish); +end; + +function TcxSchedulerControlEvent.IsOrigin(AEvent: TcxSchedulerEvent): Boolean; +begin + if IsClone then + Result := TcxSchedulerControlEvent(Source).IsOrigin(AEvent) + else + Result := Source = AEvent; +end; + +procedure TcxSchedulerControlEvent.lockResource(const ALockedResource: Variant); +begin + FLockedResource := ALockedResource; +end; + +procedure TcxSchedulerControlEvent.unlockResource; +begin + FLockedResource := Null; +end; + +procedure TcxSchedulerControlEvent.UpdateTaskTime; +begin + if Source <> nil then + Source.UpdateTaskTime + else + inherited UpdateTaskTime; +end; + +procedure TcxSchedulerControlEvent.UpdateTaskLinks; +begin + // Don't delete!!! +end; + +function TcxSchedulerControlEvent.CanMoveTo(ANewTime: TDateTime): Boolean; +begin + Result := (Source <> nil) and Source.CanMoveTo(ANewTime); +end; + +procedure TcxSchedulerControlEvent.CheckLinksOnChangeEventType(ANewEventType: TcxEventType); +begin + // don't delete +end; + +procedure TcxSchedulerControlEvent.ClearValues; +var + I: Integer; +begin + for I := 0 to Length(FValues) - 1 do + FValues[I] := Null; + unlockResource; +end; + +function TcxSchedulerControlEvent.CreateTaskLinks: TcxSchedulerEventLinks; +begin + Result := nil; +end; + +function TcxSchedulerControlEvent.GetTaskLinks: TcxSchedulerEventLinks; +begin + if Source <> nil then + Result := Source.TaskLinks + else + Result := inherited GetTaskLinks; +end; + +function TcxSchedulerControlEvent.GetTaskLinkOwners: TcxSchedulerEventList; +begin + if Source <> nil then + Result := Source.TaskLinkOwners + else + Result := inherited GetTaskLinkOwners; +end; + +function TcxSchedulerControlEvent.GetValueByIndex( + AIndex: Integer): Variant; +begin + Result := FValues[AIndex]; + if (Pattern <> nil) and VarIsNull(Result) and Storage.CanGetValueFromPattern(AIndex) then + Result := Pattern.GetValueByIndex(AIndex); + if (AIndex = FStorage.FResourceIDField.Index) and not VarIsNull(FLockedResource) then + Result := FLockedResource; +end; + +procedure TcxSchedulerControlEvent.SetValueByIndex( + AIndex: Integer; const AValue: Variant); +begin + Modified; + FValues[AIndex] := AValue; +end; + +function TcxSchedulerControlEvent.TimeBias: Double; +begin + Result := FTimeBias; +end; + +function TcxSchedulerControlEvent.GetNonExceptionLinkCount: Integer; +var + I: Integer; +begin + Result := 0; + if TaskLinks = nil then Exit; + for I := 0 to TaskLinks.Count - 1 do + if (TaskLinks[I].Link <> nil) and (TaskLinks[I].Link.EventType <> etException) then + Inc(Result); +end; + +function TcxSchedulerControlEvent.GetSelected: Boolean; +begin + if SelectionAdapter <> nil then + Result := SelectionAdapter.IsSelected(Self) + else + begin + if Source = nil then + Result := True + else + Result := FIsClone; + end; +end; + +procedure TcxSchedulerControlEvent.SetSelected(AValue: Boolean); +begin + if (AValue <> GetSelected) and (SelectionAdapter <> nil) then + SelectionAdapter.Add(Self, [ssCtrl]); +end; + +{ TcxSchedulerStorageResourceItems } + +constructor TcxSchedulerStorageResourceItems.Create( + AOwner: TcxSchedulerStorageResources; + AItemClass: TcxSchedulerStorageResourceItemClass); +begin + FOwner := AOwner; + inherited Create(AItemClass); +end; + +function TcxSchedulerStorageResourceItems.Add: TcxSchedulerStorageResourceItem; +begin + Result := TcxSchedulerStorageResourceItem(inherited Add); +end; + +function TcxSchedulerStorageResourceItems.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +procedure TcxSchedulerStorageResourceItems.Update(Item: TCollectionItem); +begin + inherited Update(Item); + Storage.Changed; +end; + +function TcxSchedulerStorageResourceItems.GetItem( + AIndex: Integer): TcxSchedulerStorageResourceItem; +begin + Result := TcxSchedulerStorageResourceItem(inherited Items[AIndex]); +end; + +function TcxSchedulerStorageResourceItems.GetStorage: TcxCustomSchedulerStorage; +begin + Result := FOwner.Storage; +end; + +procedure TcxSchedulerStorageResourceItems.SetItem( + AIndex: Integer; AValue: TcxSchedulerStorageResourceItem); +begin + Items[AIndex].Assign(AValue); +end; + +function TcxSchedulerStorageResourceItems.GetVisibleResource( + AIndex: Integer): TcxSchedulerStorageResourceItem; +var + I: Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + if GetItem(I).Visible then + begin + if AIndex = 0 then + begin + Result := GetItem(I); + Break; + end; + Dec(AIndex); + end; +end; + +function TcxSchedulerStorageResourceItems.GetVisibleResourceCount: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + if GetItem(I).Visible then Inc(Result); +end; + +{ TcxSchedulerStorageResourceItem } + +constructor TcxSchedulerStorageResourceItem.Create(Collection: TCollection); +begin + FColor := clDefault; + FImageIndex := -1; + FVisible := True; + FReadOnly := False; + FWorkDays := DateTimeHelper.WorkDays; + FWorkFinish := DateTimeHelper.WorkFinish; + FWorkStart := DateTimeHelper.WorkStart; + inherited Create(Collection); +end; + +procedure TcxSchedulerStorageResourceItem.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerStorageResourceItem then + begin + FColor := TcxSchedulerStorageResourceItem(Source).FColor; + FImageIndex := TcxSchedulerStorageResourceItem(Source).FImageIndex; + FName := TcxSchedulerStorageResourceItem(Source).FName; + FReadOnly := TcxSchedulerStorageResourceItem(Source).FReadOnly; + FResourceID := TcxSchedulerStorageResourceItem(Source).FResourceID; + FVisible := TcxSchedulerStorageResourceItem(Source).FVisible; + end + else + inherited Assign(Source); +end; + +procedure TcxSchedulerStorageResourceItem.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('WorkStart', ReadWorkStart, WriteWorkStart, FWorkStartAssigned); + Filer.DefineProperty('WorkFinish', ReadWorkFinish, WriteWorkFinish, FWorkFinishAssigned); +end; + +function TcxSchedulerStorageResourceItem.GetDisplayName: string; +begin + Result := TcxSchedulerStorageResourceItems(Collection). + Resources.DoGetResourceName(Self); +end; + +procedure TcxSchedulerStorageResourceItem.SetName( + const AValue: string); +begin + if AValue = FName then Exit; + FName := AValue; + Changed(True); +end; + +procedure TcxSchedulerStorageResourceItem.SetColor( + const AValue: TColor); +begin + FColor := AValue; + Changed(True); +end; + +procedure TcxSchedulerStorageResourceItem.SetImageIndex( + const AValue: TImageIndex); +begin + FImageIndex := AValue; + Changed(True); +end; + +procedure TcxSchedulerStorageResourceItem.SetResourceID( + const AValue: Variant); +begin + FResourceID := AValue; + Changed(True); +end; + +procedure TcxSchedulerStorageResourceItem.SetVisible(const AValue: Boolean); +begin + FVisible := AValue; + Changed(True); +end; + +procedure TcxSchedulerStorageResourceItem.SetWorkStart(const AValue: TTime); +begin + if AValue <> FWorkStart then + begin + FWorkStart := DateTimeHelper.RoundTime(AValue); + FWorkStartAssigned := FWorkStart <> DateTimeHelper.WorkStart; + Changed(True); + end; +end; + +procedure TcxSchedulerStorageResourceItem.SetWorkDays(AValue: TDays); +begin + if AValue <> FWorkDays then + begin + FWorkDays := AValue; + Changed(True); + end; +end; + +procedure TcxSchedulerStorageResourceItem.SetWorkFinish(const AValue: TTime); +begin + if AValue <> FWorkFinish then + begin + FWorkFinish := DateTimeHelper.RoundTime(AValue); + FWorkFinishAssigned := FWorkFinish <> DateTimeHelper.WorkFinish; + Changed(True); + end; +end; + +function TcxSchedulerStorageResourceItem.GetActualImageIndex: TImageIndex; +begin + Result := Resources.DoGetResourceImageIndex(Self); + if (Resources.Images = nil) or (Resources.Images.Count <= Result) then + Result := -1; +end; + +function TcxSchedulerStorageResourceItem.GetResources: TcxSchedulerStorageResources; +begin + Result := TcxSchedulerStorageResourceItems(Collection).Resources; +end; + +function TcxSchedulerStorageResourceItem.IsWorkDaysStored: Boolean; +begin + Result := FWorkDays <> DateTimeHelper.WorkDays; +end; + +procedure TcxSchedulerStorageResourceItem.ReadWorkFinish(AReader: TReader); +begin + FWorkFinish := AReader.ReadFloat; +end; + +procedure TcxSchedulerStorageResourceItem.ReadWorkStart(AReader: TReader); +begin + FWorkStart := AReader.ReadFloat; +end; + +procedure TcxSchedulerStorageResourceItem.WriteWorkFinish(AWriter: TWriter); +begin + AWriter.WriteFloat(FWorkFinish); +end; + +procedure TcxSchedulerStorageResourceItem.WriteWorkStart(AWriter: TWriter); +begin + AWriter.WriteFloat(FWorkStart); +end; + +{ TcxSchedulerStorageResources } + +constructor TcxSchedulerStorageResources.Create( + AOwner: TcxCustomSchedulerStorage); +begin + FOwner := AOwner; + inherited Create(AOwner); + FItems := CreateItems; +end; + +destructor TcxSchedulerStorageResources.Destroy; +begin + FItems.Free; + inherited Destroy; +end; + +procedure TcxSchedulerStorageResources.Assign( + Source: TPersistent); +begin + if Source is TcxSchedulerStorageResources then + begin + FItems.Assign(TcxSchedulerStorageResources(Source).Items); + FImages := TcxSchedulerStorageResources(Source).Images; + end + else + inherited; +end; + +function TcxSchedulerStorageResources.GetResourceName( + AResource: TcxSchedulerStorageResourceItem): string; +begin + Result := DoGetResourceName(AResource); +end; + +function TcxSchedulerStorageResources.GetResourceNameByID(const AResource: Variant): string; +var + I: Integer; + AResourceItem: TcxSchedulerStorageResourceItem; +begin + Result := ''; + if VarIsEmptyEx(AResource) then Exit; + for I := 0 to ResourceItems.Count - 1 do + begin + AResourceItem := ResourceItems[I]; + if VarEqualsSoft(AResource, AResourceItem.ResourceID) then + begin + Result := DoGetResourceName(AResourceItem); + Break; + end; + end; +end; + +function TcxSchedulerStorageResources.GetObjectName: string; +begin + if Storage.StoringName <> '' then + Result := Storage.StoringName + else + Result := Storage.Name; +end; + +function TcxSchedulerStorageResources.DecodePropertyName(const AName: string; + var ASubValue: string): Integer; +begin + Result := StrToIntDef('$' + Copy(AName, 9, 8), -1); + ASubValue := Copy(AName, 17, Length(AName) - 16); +end; + +function TcxSchedulerStorageResources.GetProperties( + AProperties: TStrings): Boolean; +var + I: Integer; + APropertyName: string; +begin + Result := ResourceItems.Count > 0; + for I := 0 to ResourceItems.Count - 1 do + with ResourceItems[I] do + begin + APropertyName := 'Resource' + IntToHex(I, 8); + AProperties.Add(APropertyName); + AProperties.Add(APropertyName + 'WorkStart'); + AProperties.Add(APropertyName + 'WorkFinish'); + AProperties.Add(APropertyName + 'WorkDays'); + end; +end; + +procedure TcxSchedulerStorageResources.GetPropertyValue(const AName: string; + var AValue: Variant); +var + AItem: TcxSchedulerStorageResourceItem; + ASubValue: string; +begin + if ResourceItems.Count = 0 then Exit; + if Pos('Resource', AName) = 1 then + begin + AItem := TcxSchedulerStorageResourceItem( + ResourceItems.FindItemID(DecodePropertyName(AName, ASubValue))); + if AItem <> nil then + begin + if SameText(ASubValue, 'WorkStart') then + AValue := AItem.WorkStart + else + if SameText(ASubValue, 'WorkFinish') then + AValue := AItem.WorkFinish + else + if SameText(ASubValue, 'WorkDays') then + AValue := WorkDaysToInteger(AItem.WorkDays) + else + AValue := ((AItem.Index and $FFFF) shl 1) or Ord(AItem.Visible); + end; + end; +end; + +procedure TcxSchedulerStorageResources.SetPropertyValue(const AName: string; + const AValue: Variant); +var + AItem: TcxSchedulerStorageResourceItem; + ASubValue: string; + P: PRestoringItem; + + function GetRestoreItem(AItem: TcxSchedulerStorageResourceItem): PRestoringItem; + var + I: Integer; + begin + for I := 0 to FRestoringItems.Count - 1 do + if AItem = PRestoringItem(FRestoringItems.Items[I])^.Item then + begin + Result := PRestoringItem(FRestoringItems.Items[I]); + Exit; + end; + New(Result); + Result^.WorkDays := DateTimeHelper.WorkDays; + Result^.WorkFinish := DateTimeHelper.WorkFinish; + Result^.WorkStart := DateTimeHelper.WorkStart; + Result^.Item := AItem; + FRestoringItems.Add(Result); + end; + +begin + if ResourceItems.Count = 0 then Exit; + if Pos('Resource', AName) = 1 then + begin + AItem := TcxSchedulerStorageResourceItem(ResourceItems.FindItemID( + DecodePropertyName(AName, ASubValue))); + if AItem <> nil then + begin + P := GetRestoreItem(AItem); + if SameText(ASubValue, 'WorkStart') then + P^.WorkStart := AValue + else + if SameText(ASubValue, 'WorkFinish') then + P^.WorkFinish := AValue + else + if SameText(ASubValue, 'WorkDays') then + P^.WorkDays := IntegerToWorkDays(AValue) + else + begin + P^.Index := (AValue shr 1) and $FFFFFFF; + P^.Visible := Boolean(AValue and 1); + end; + end; + end; +end; + +procedure TcxSchedulerStorageResources.Changed; +begin + Storage.Changed; +end; + +function TcxSchedulerStorageResources.CreateItems: TcxSchedulerStorageResourceItems; +begin + Result := TcxSchedulerStorageResourceItems.Create( + Self, TcxSchedulerStorageResourceItem); +end; + +function CompareRestoringItems(Item1, Item2: Pointer): Integer; +begin + Result := PRestoringItem(Item1).Index - PRestoringItem(Item2).Index; +end; + +procedure TcxSchedulerStorageResources.DoneRestore; +var + I: Integer; + P: PRestoringItem; +begin + FRestoringItems.Sort(CompareRestoringItems); + Storage.BeginUpdate; + try + for I := 0 to FRestoringItems.Count - 1 do + begin + P := FRestoringItems[I]; + P.Item.Index := P.Index; + P.Item.Visible := P.Visible; + P.Item.WorkFinish := P.WorkFinish; + P.Item.WorkStart := P.WorkStart; + P.Item.WorkDays := P.WorkDays; + Dispose(P); + end; + finally + Storage.EndUpdate; + FreeAndNil(FRestoringItems); + end; +end; + +function TcxSchedulerStorageResources.DoGetResourceImageIndex( + AItem: TcxSchedulerStorageResourceItem): TImageIndex; +begin + Result := AItem.ImageIndex; + if Assigned(FOnGetResourceImageIndex) then + FOnGetResourceImageIndex(Storage, AItem, Result); +end; + +function TcxSchedulerStorageResources.DoGetResourceName( + AItem: TcxSchedulerStorageResourceItem): string; +begin + Result := ''; + if AItem <> nil then + Result := AItem.Name; + if Assigned(FOnGetResourceName) then + FOnGetResourceName(Storage, AItem, Result); +end; + +function TcxSchedulerStorageResources.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +function TcxSchedulerStorageResources.GetResourceItems: TcxSchedulerStorageResourceItems; +begin + Result := Items; +end; + +procedure TcxSchedulerStorageResources.InitRestore; +begin + FRestoringItems := TList.Create; +end; + +function TcxSchedulerStorageResources.GetAreImagesUsed: Boolean; +var + I: Integer; +begin + Result := (Images <> nil); + if Result then + begin + Result := False; + for I := 0 to ResourceItems.Count - 1 do + begin + Result := Result or (ResourceItems[I].ActualImageIndex >= 0); + if Result then Break; + end; + end; +end; + +procedure TcxSchedulerStorageResources.SetImages(AValue: TCustomImageList); +begin + if AValue <> FImages then + begin + if FImages <> nil then + FImages.RemoveFreeNotification(Storage); + FImages := AValue; + if FImages <> nil then + FImages.FreeNotification(Storage); + Changed; + end; +end; + +procedure TcxSchedulerStorageResources.SetItems( + AValue: TcxSchedulerStorageResourceItems); +begin + FItems.Assign(AValue); +end; + +function cxCompareConflictEvents(AEvent1, AEvent2: TcxSchedulerEvent): Integer; +begin + if AEvent1.Start = AEvent2.Start then + Result := 0 + else + if AEvent1.Start < AEvent2.Start then + Result := -1 + else + Result := 1; +end; + +function cxCompareConflictEventsEx(AEvent1, AEvent2: TcxSchedulerEvent): Integer; +begin + if AEvent1 = AEvent2 then + Result := 0 + else + if AEvent1.Finish <= AEvent2.Start then + Result := -1 + else + if AEvent1.Start = AEvent2.Start then + Result := 0 + else + Result := 1; +end; + +{ TcxSchedulerEventConflictsInfo } + +constructor TcxSchedulerEventConflictsInfo.Create( + AEvent: TcxSchedulerEvent; AExceptEventsWithoutResources: Boolean); +begin + FEvent := AEvent; + Init(AEvent.Storage, AExceptEventsWithoutResources, AEvent.ResourceID, NullDate, NullDate); + Calculate; +end; + +constructor TcxSchedulerEventConflictsInfo.Create(AEvent: TcxSchedulerEvent; + AExceptEventsWithoutResources: Boolean; const AStart, AFinish: TDateTime); +begin + FEvent := AEvent; + Init(AEvent.Storage, AExceptEventsWithoutResources, AEvent.ResourceID, AStart, AFinish); + Calculate(False); +end; + +constructor TcxSchedulerEventConflictsInfo.Create( + AStorage: TcxCustomSchedulerStorage; AExceptEventsWithoutResources: Boolean; + const AStart, AFinish: TDateTime; AResourceID: Variant; AExcludedEvent: TcxSchedulerEvent = nil); +begin + Init(AStorage, AExceptEventsWithoutResources, AResourceID, AStart, AFinish); + FExcludedEvent := AExcludedEvent; + if AExcludedEvent <> nil then + ExcludedEventID := TcxSchedulerControlEventID.Create(AExcludedEvent); + Calculate; +end; + +destructor TcxSchedulerEventConflictsInfo.Destroy; +begin + ExcludedEventID.Free; + FConflictEvents.Free; + FTimeRanges.Free; + inherited Destroy; +end; + +procedure TcxSchedulerEventConflictsInfo.Init( + AStorage: TcxCustomSchedulerStorage; AExceptEventsWithoutResources: Boolean; + AResourceID: Variant; const AStart, AFinish: TDateTime); +begin + Start := AStart; + Finish := AFinish; + FStorage := AStorage; + FExceptEventsWithoutResources := AExceptEventsWithoutResources; + FConflictEvents := TcxSchedulerFilteredEventList.Create; + FTimeRanges := TcxSchedulerTimeRanges.CreateEx(Self); + ResourceID := AResourceID; +end; + +procedure TcxSchedulerEventConflictsInfo.AddRange(AStart, AFinish: TDateTime); +begin + AStart := Min(Finish, Max(AStart, Start)); + AFinish := Max(Start, Min(AFinish, Finish)); + with DateTimeHelper do + begin + if (RoundTime(AStart) <> RoundTime(AFinish)) and (AFinish > AStart) then + FTimeRanges.Add(AStart, AFinish); + end; +end; + +procedure TcxSchedulerEventConflictsInfo.Calculate( + ACalculateFreeTime: Boolean = True); +begin + FConflictEvents.DestroyItems; + FTimeRanges.Clear; + if (FEvent <> nil) and ACalculateFreeTime then + begin + Start := FEvent.Start; + Finish := FEvent.Finish; + EventID := TcxSchedulerControlEventID.Create(FEvent); + end; + try + if (FEvent = nil) or not FEvent.IsFreeState then + begin + Storage.GetEvents(FConflictEvents, Start - 1, Finish + 1, ResourceID); + if ACalculateFreeTime then + begin + FConflictEvents.Sort(cxCompareConflictEvents); + CheckIntersectionWithEvents + end + else + begin + FConflictEvents.Sort(cxCompareConflictEventsEx); + CheckSomeIntersection; + end; + end; + if ACalculateFreeTime then + CheckFreeTimeRanges; + finally + EventID.Free; + end; +end; + +procedure TcxSchedulerEventConflictsInfo.CheckFreeTimeRanges; +var + I: Integer; + AStart, AFinish: TDateTime; +begin + if not HasConflicts then + AddRange(Start, Finish) + else + begin + I := 0; + AStart := Start; + AFinish := Finish; + while I < ConflictEvents.Count do + begin + AFinish := ConflictEvents[I].Start; + AddRange(AStart, AFinish); + ExpandRange(ConflictEvents[I], I, AFinish); + AStart := AFinish; + end; + AddRange(AStart, Finish); + end; +end; + +procedure TcxSchedulerEventConflictsInfo.CheckIntersectionWithEvents; +var + I: Integer; +begin + for I := FConflictEvents.Count - 1 downto 0 do + begin + if ExcludeFromCalculate(FConflictEvents[I]) then + begin + FConflictEvents[I].Free; + FConflictEvents.Delete(I); + end; + end; +end; + +procedure TcxSchedulerEventConflictsInfo.CheckSomeIntersection; +var + I, J: Integer; + AEvent, ACheckedEvent: TcxSchedulerEvent; + AList: TcxSchedulerFilteredEventList; + AHasIntersection: Boolean; +begin + AList := TcxSchedulerFilteredEventList.Create; + try + if Event.SkipExceptions or (Event.EventType = etPattern) then + Event.RecurrenceInfo.GetOccurrences(AList, Start, Finish) + else + AList.Add(TcxSchedulerControlEvent.Create(Event)); + // delete equals + for I := FConflictEvents.Count - 1 downto 0 do + begin + AEvent := FConflictEvents[I]; + if AEvent.IsFreeState or IsSameEvent(AEvent) or IsSameSeries(FEvent, AEvent) then + begin + AEvent.Free; + FConflictEvents.Delete(I); + end; + end; + // + AHasIntersection := False; + for I := 0 to AList.Count - 1 do + begin + if AHasIntersection then Break; + AEvent := AList[I]; + for J := 0 to FConflictEvents.Count - 1 do + begin + ACheckedEvent := FConflictEvents[J]; + AHasIntersection := IntersectEvents(AEvent, ACheckedEvent); + if AHasIntersection and not ExceptEventsWithoutResources then + AHasIntersection := not VarIsNull(ACheckedEvent.ResourceID); + if ExceptEventsWithoutResources and AHasIntersection then + AHasIntersection := VarIsEmptyEx(ACheckedEvent.ResourceID) or VarIsEmptyEx(AEvent.ResourceID) or + (ACheckedEvent.IsSharedWithResource(AEvent.ResourceID) or + AEvent.IsSharedWithResource(ACheckedEvent.ResourceID)) + else + AHasIntersection := AHasIntersection and (ACheckedEvent.IsSharedWithResource(AEvent.ResourceID) or + AEvent.IsSharedWithResource(ACheckedEvent.ResourceID)); + AHasIntersection := AHasIntersection and Storage.HasEventIntersect(FEvent, ACheckedEvent); + if AHasIntersection then Break; + end; + end; + if not AHasIntersection then + FConflictEvents.DoClear(True); + finally + AList.Free; + end; +end; + +function TcxSchedulerEventConflictsInfo.ExcludeFromCalculate(AEvent: TcxSchedulerEvent): Boolean; +begin + Result := AEvent.IsFreeState or not IntersectEvents(AEvent); + if not Result and (ExcludedEventID <> nil) then + Result := ExcludedEventID.SameEvent(AEvent); +end; + +procedure TcxSchedulerEventConflictsInfo.ExpandRange(AEvent: TcxSchedulerEvent; + var AIndex: Integer; var ALastPosition: TDateTime); +var + ACheckedEvent: TcxSchedulerEvent; + ARangeStart, ARangeFinish: TDateTime; +begin + ARangeStart := AEvent.Start; + ARangeFinish := AEvent.Finish; + while AIndex < ConflictEvents.Count do + begin + ACheckedEvent := ConflictEvents[AIndex]; + if IntersectTime(ARangeStart, ARangeFinish, + ACheckedEvent.Start, ACheckedEvent.Finish) then + begin + ARangeStart := Min(ARangeStart, ACheckedEvent.Start); + ARangeFinish := Max(ARangeFinish, ACheckedEvent.Finish); + end + else + Break; + Inc(AIndex); + end; + ALastPosition := ARangeFinish; +end; + +function TcxSchedulerEventConflictsInfo.IntersectEvents( + ACheckedEvent: TcxSchedulerEvent): Boolean; +begin + Result := IntersectTime(ACheckedEvent.Start, ACheckedEvent.Finish); + if Result and not ExceptEventsWithoutResources then + Result := not VarIsNull(ACheckedEvent.ResourceID); + if Result and (FEvent <> nil) then + Result := ACheckedEvent.IsSharedWithResource(ResourceID) and not IsSameEvent(ACheckedEvent); + if Result and (FEvent <> nil) then + Result := not IsSameSeries(ACheckedEvent, FEvent); + if Result and (FExcludedEvent <> nil) then + Result := not IsSameSeries(ACheckedEvent, FExcludedEvent); +end; + +function TcxSchedulerEventConflictsInfo.IntersectEvents( + AEvent1, AEvent2: TcxSchedulerEvent): Boolean; +begin + Result := IntersectTime(AEvent1.Start, AEvent1.Finish, + AEvent2.Start, AEvent2.Finish); +end; + +function TcxSchedulerEventConflictsInfo.IntersectTime( + const AStart, AFinish: TDateTime): Boolean; +begin + Result := IntersectTime(AStart, AFinish, Start, Finish); +end; + +function TcxSchedulerEventConflictsInfo.IntersectTime( + const AStart, AFinish, AStart1, AFinish1: TDateTime): Boolean; +begin + Result := (AStart < AFinish1) and (AStart1 < AFinish); +end; + +function TcxSchedulerEventConflictsInfo.IsSameEvent( + ACheckedEvent: TcxSchedulerEvent): Boolean; +begin + Result := (EventID <> nil) and EventID.SameEvent(ACheckedEvent); +end; + +function TcxSchedulerEventConflictsInfo.IsSameSeries( + AEvent1, AEvent2: TcxSchedulerEvent): Boolean; +begin + Result := AEvent1.RecordIndex = AEvent2.RecordIndex; + if (AEvent1.RecordIndex < 0) or (AEvent2.RecordIndex < 0) then Exit; + if not Result then + Result := VarEquals(AEvent1.ID, AEvent2.ID); + if not Result and (AEvent1.EventType <> etNone) then + Result := VarEquals(AEvent1.ParentID, AEvent2.ID); + if not Result and (AEvent2.EventType <> etNone) then + Result := VarEquals(AEvent1.ID, AEvent2.ParentID); + if not Result and (AEvent1.EventType <> etNone) and (AEvent2.EventType <> etNone) then + Result := VarEquals(AEvent1.ParentID, AEvent2.ParentID); +end; + +function TcxSchedulerEventConflictsInfo.GetHasConflicts: Boolean; +begin + Result := FConflictEvents.Count > 0; +end; + +function TcxSchedulerEventConflictsInfo.GetHasFreeTime: Boolean; +begin + Result := FTimeRanges.Count > 0; +end; + +{ TcxCustomSchedulerStorage } + +constructor TcxCustomSchedulerStorage.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + EventsIndex := TList.Create; + FIsLoading := True; + CreateSubClasses; + FIsLoading := False; +end; + +destructor TcxCustomSchedulerStorage.Destroy; +begin + StopUpdateRemindersTimer; + EventsIndex.Free; + SendNotification(True); + DestroySubClasses; + Holidays := nil; + inherited Destroy; +end; + +procedure TcxCustomSchedulerStorage.Assign( + Source: TPersistent); +begin + if Source is TcxCustomSchedulerStorage then + begin + Resources := TcxCustomSchedulerStorage(Source).Resources; + CustomFields.Assign(TcxCustomSchedulerStorage(Source).CustomFields); + InternalFields.Assign(TcxCustomSchedulerStorage(Source).InternalFields); + end; +end; + +procedure TcxCustomSchedulerStorage.AddListener( + AListener: IcxSchedulerStorageListener); +begin + if FListeners.IndexOf(AListener) = -1 then + FListeners.Add(AListener); +end; + +procedure TcxCustomSchedulerStorage.BeginUpdate; +begin + BeginUpdateDataController; +end; + +procedure TcxCustomSchedulerStorage.Clear; +begin + BeginUpdate; + try + while EventCount > 0 do + Events[0].Delete; + finally + EndUpdate; + end; +end; + +procedure TcxCustomSchedulerStorage.DoneRestore; +begin + if ResourceCount > 0 then + Resources.DoneRestore +end; + +procedure TcxCustomSchedulerStorage.CalculateEventActualTimeRanges; +var + I: Integer; +begin + if not ActualTimeRangeAvailable then Exit; + BeginUpdate; + try + for I := 0 to EventCount - 1 do + Events[I].CalculateActualTimeRange; + finally + EndUpdate; + end; +end; + +function TcxCustomSchedulerStorage.CheckRequiredFields: Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerStorage.CreateEvent: TcxSchedulerEvent; +begin + Result := GetEventClass.Create(Self); + FNewEvents.Add(Result); +end; + +function TcxCustomSchedulerStorage.CreateOccurrence(APattern: TcxSchedulerEvent; + const ADate: TDateTime; AType: TcxEventType): TcxSchedulerEvent; +var + ACalculator: TcxSchedulerOccurrenceCalculator; + AOccurrence: TcxSchedulerEvent; +begin + Result := nil; + if not (AType in [etCustom, etException]) or (APattern.EventType <> etPattern) then Exit; + ACalculator := TcxSchedulerOccurrenceCalculator.Create(APattern, APattern.Start, ADate + 7); + try + while ACalculator.GetNextOccurrence do + begin + if APattern.GetOccurrenceByIndex(ACalculator.Index, AOccurrence) then + Continue + else + if DateOf(ACalculator.OccurrenceStart) > DateOf(ADate) then + Break + else + if DateOf(ACalculator.OccurrenceStart) = DateOf(ADate) then + begin + Result := CreateEvent; + Result.Assign(APattern); + Result.Start := ACalculator.OccurrenceStart; + Result.Finish := ACalculator.OccurrenceFinish; + Result.RecurrenceIndex := ACalculator.Index; + Result.EventType := AType; + Result.ParentID := APattern.ID; + Result.FPattern := APattern; + Break; + end; + end; + finally + ACalculator.Free; + end; +end; + +procedure TcxCustomSchedulerStorage.EndUpdate; +begin + FInternalUpdate := True; + try + try + if LockCount = 1 then + begin + PostEvents; + if FDeletedRecords.Count > 0 then + TcxSchedulerStorageDataController(DataController).DeleteRecords(FDeletedRecords); + FDeletedRecords.Count := 0; + end; + finally + EndUpdateDataController; + end; + if FIsChanged then + Changed; + finally + FInternalUpdate := False; + end; +end; + +function TcxCustomSchedulerStorage.FindAvailableAllDay( + var AStart, AFinish: TDateTime; AResourceID: Variant; + AExceptEventsWithoutResources: Boolean; ADuration: TDateTime = 0): Boolean; +var + I, J: Integer; + AList: TcxSchedulerFilteredEventList; + AStartDay: TDateTime; +begin + Result := False; + AStartDay := EncodeTime(0, 0, 1, 0); + if ADuration = 0 then + ADuration := Max(1, Trunc(AFinish) - Trunc(AStart)); + AList := TcxSchedulerFilteredEventList.Create; + try + for I := Trunc(AStart) to Trunc(AStart) + cxMaxCheckedDuration do + begin + Result := not GetEvents(AList, I + AStartDay, I + ADuration - AStartDay, AResourceID); + if not Result then + begin + Result := True; + for J := 0 to AList.Count - 1 do + Result := Result and AList[J].IsFreeState; + end; + if Result then + begin + AStart := I; + AFinish := AStart + ADuration; + Break; + end; + end; + finally + AList.Free; + end; +end; + +function TcxCustomSchedulerStorage.FindAvailableTime( + var AStart, AFinish: TDateTime; AllDay: Boolean; + AResourceID: Variant; AExceptEventsWithoutResources: Boolean; ADuration: TDateTime = 0; + AExcludedEvent: TcxSchedulerEvent = nil): Boolean; +var + I: Integer; + AInfo: TcxSchedulerEventConflictsInfo; +begin + if ADuration = 0 then + ADuration := AFinish - AStart; + if AllDay then + Result := FindAvailableAllDay(AStart, AFinish, AResourceID, AExceptEventsWithoutResources, ADuration) + else + begin + AInfo := TcxSchedulerEventConflictsInfo.Create(Self, AExceptEventsWithoutResources, Trunc(AStart), + Trunc(AFinish) + cxMaxCheckedDuration, AResourceID, AExcludedEvent); + try + Result := AInfo.HasFreeTime; + for I := 0 to AInfo.TimeRanges.Count - 1 do + if (AInfo.TimeRanges[I].Duration >= ADuration) and + (DateTimeHelper.RoundTime(AInfo.TimeRanges[I].Finish - ADuration) >= AStart) then + begin + if AInfo.TimeRanges[I].Start > AStart then + AStart := AInfo.TimeRanges[I].Start; + AFinish := AStart + ADuration; + Result := True; + Break; + end; + finally + AInfo.Free; + end; + end; +end; + +function TcxCustomSchedulerStorage.FindAvailableTime(AEvent: TcxSchedulerEvent; + AExceptEventsWithoutResources: Boolean; var AStart, AFinish: TDateTime): Boolean; +var + I: Integer; + S: TDateTime; + AInfo: TcxSchedulerEventConflictsInfo; +begin + Result := AEvent.Conflicts(AExceptEventsWithoutResources); + S := AEvent.Start; + AEvent.GetStartFinishTime(AStart, AFinish); + if Result then + begin + if AEvent.EventType <> etPattern then + begin + AFinish := AFinish + cxMaxCheckedDuration; + Result := FindAvailableTime(AStart, AFinish, AEvent.AllDayEvent, + AEvent.ResourceID, AExceptEventsWithoutResources, AEvent.Duration, AEvent); + end + else + begin + AEvent.BeginEditing; + try + AInfo := cxSchedulerEventConflictsInfoClass.Create(Self, AExceptEventsWithoutResources, + Trunc(AEvent.Start), Trunc(AEvent.Finish) + 1, AEvent.ResourceID); + try + Result := False; + for I := 1 to 24 * 6 do + begin + AEvent.MoveTo(AStart + I * 10 * MinuteToTime); + if not AEvent.Conflicts(AExceptEventsWithoutResources) then + begin + AEvent.GetStartFinishTime(AStart, AFinish); + Result := True; + Break; + end; + end; + finally + AInfo.Free; + end; + finally + AEvent.MoveTo(S); + AEvent.Cancel; + end; + end; + end +end; + +procedure TcxCustomSchedulerStorage.FullRefresh; +begin + if IsUpdatingMode then Exit; + FIsLoading := True; + try + DoRefresh; + finally + FIsLoading := False; + SendNotification; + end; +end; + +procedure TcxCustomSchedulerStorage.GenerateHolidayEvents(const AResourceID: Variant); +begin + GenerateHolidayEventsBySchedulerHolidays(AResourceID, Holidays); +end; + +function TcxCustomSchedulerStorage.GetEventByID(const AID: Variant): TcxSchedulerEvent; +var + I: Integer; +begin + Result := nil; + for I := 0 to EventCount - 1 do + if VarEquals(AID, Events[I].ID) then + begin + Result := Events[I]; + break; + end; +end; + +function TcxCustomSchedulerStorage.GetEvents( + AList: TcxSchedulerFilteredEventList; + const AStart, AFinish: TDateTime): Boolean; +begin + Result := GetEvents(AList, AStart, AFinish, Null); +end; + +function TcxCustomSchedulerStorage.GetEvents( + AList: TcxSchedulerFilteredEventList; const AStart, AFinish: TDateTime; + const AResourceID: Variant): Boolean; +var + I, J, C: Integer; + AEvent: TcxSchedulerEvent; + AStartDate, AFinishDate: Integer; +begin + AList.Init(AStart, AFinish, Self); + AList.FReminderEventsOnly := False; + AStartDate := Trunc(AStart); + AFinishDate := Trunc(AFinish) + 1; + for I := 0 to EventCount - 1 do + begin + AEvent := Events[I]; + if not ActualTimeRangeAvailable or AEvent.CheckTimeRange(AStartDate, AFinishDate) then + begin + if not VarIsArray(AResourceID) then + AList.CheckEvent(AEvent, AResourceID) + else + begin + C := AList.Count; + for J := VarArrayLowBound(AResourceID, 1) to VarArrayHighBound(AResourceID, 1) do + begin + AList.CheckEvent(AEvent, AResourceID[J]); + if AList.Count <> C then Break; + end; + end; + end; + end; + AList.Changed; + Result := AList.Count > 0; +end; + +function TcxCustomSchedulerStorage.GetFieldByName( + const AName: string): TcxCustomSchedulerStorageField; +begin + Result := CustomFields.FindFieldByName(AName); +end; + +function TcxCustomSchedulerStorage.GetHolidayNamesByDate(ADate: TDate; var ANames: string; + AOnlyVisible: Boolean = True): Boolean; +begin + Result := (Holidays <> nil) and + Holidays.GetHolidayNamesByDate(ADate, ANames, AOnlyVisible); +end; + +function TcxCustomSchedulerStorage.GetReminderEvents( + ADateTime: TDateTime; AList: TcxSchedulerFilteredEventList): Boolean; +var + I: Integer; +begin + AList.Init(NullDate, ADateTime, Self); + AList.FReminderEventsOnly := True; + AList.FNow := Reminders.GetNow; + for I := 0 to EventCount - 1 do + AList.CheckEvent(Events[I], Null); + AList.Changed; + Result := AList.Count > 0; +end; + +procedure TcxCustomSchedulerStorage.PopulateHolidayDates(AList: TcxSchedulerDateList; + AStart, AFinish: TDate; AOnlyVisible: Boolean = True; AClearList: Boolean = True); +begin + if AList <> nil then + begin + if AClearList then + AList.Clear; + if Holidays <> nil then + Holidays.PopulateHolidayDates(AList, AStart, AFinish, AOnlyVisible, AClearList); + end; +end; + +procedure TcxCustomSchedulerStorage.PostEvents; +begin + if not IsActive or (FNewEvents.Count = 0) then Exit; + BeginUpdate; + try + while FNewEvents.Count <> 0 do FNewEvents.Last.Post; + finally + EndUpdate; + end; +end; + +procedure TcxCustomSchedulerStorage.InitRestore; +begin + if ResourceCount > 0 then + Resources.InitRestore; +end; + +function TcxCustomSchedulerStorage.IsActive: Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerStorage.IsCaptionAvailable: Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerStorage.IsLabelColorAvailable: Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerStorage.IsLocationAvailable: Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerStorage.IsMessageAvailable: Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerStorage.IsRecurrenceAvailable: Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerStorage.IsReminderByResourceAvailable: Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerStorage.IsReminderAvailable: Boolean; +begin + Result := True; +end; + +function TcxCustomSchedulerStorage.IsStateAvailable: Boolean; +begin + Result := True; +end; + +procedure TcxCustomSchedulerStorage.BeginUpdateDataController; +begin + Inc(LockCount); + DataController.BeginUpdate; +end; + +procedure TcxCustomSchedulerStorage.EndUpdateDataController; +begin + Dec(LockCount); + DataController.EndUpdate; +end; + +function TcxCustomSchedulerStorage.GetFieldValueTypeClass( + AField: TcxCustomSchedulerStorageField): TcxValueTypeClass; +begin + if AField = nil then + Result := TcxIntegerValueType + else + Result := DataController.GetItemValueTypeClass(AField.Index); +end; + +procedure TcxCustomSchedulerStorage.RemoveListener( + AListener: IcxSchedulerStorageListener); +begin + FListeners.Remove(AListener); +end; + +// IcxSchedulerHolidaysListener +procedure TcxCustomSchedulerStorage.HolidaysChanged(Sender: TObject); +begin + LayoutChanged; +end; + +procedure TcxCustomSchedulerStorage.HolidaysRemoved(Sender: TObject); +begin + FHolidays.RemoveListener(Self); + FHolidays := nil; + LayoutChanged; +end; + +function TcxCustomSchedulerStorage.ActualTimeRangeAvailable: Boolean; +begin + Result := UseActualTimeRange; +end; + +procedure TcxCustomSchedulerStorage.AddInternalField( + var AField: TcxCustomSchedulerStorageField; AValueType: TcxValueTypeClass; + AIsUnique: Boolean = True); +begin + AField := TcxCustomSchedulerStorageField(InternalFields.Add); + AField.ValueTypeClass := AValueType; + AField.FIsUnique := AIsUnique; +end; + +procedure TcxCustomSchedulerStorage.AddRecord; +begin + DataController.AppendRecord; +end; + +procedure TcxCustomSchedulerStorage.CancelEvent(AEvent: TcxSchedulerEvent); +begin + Dec(AEvent.FEditCount); + if (AEvent.FEditCount = 0) and AEvent.IsNewEvent then + AEvent.Free; + Changed; +end; + +function TcxCustomSchedulerStorage.CanGetValueFromPattern( + AIndex: Integer): Boolean; +begin + Result := AIndex in [ + FCaptionField.Index, + FLabelColorField.Index, + FLocationField.Index, + FMessageField.Index, + FOptionsField.Index, + FReminderMinutesBeforeStartField.Index, + FStateField.Index, + FReminderDateField.Index, + FReminderResourcesData.Index]; + Result := Result or (AIndex >= InternalFieldCount); +end; + +procedure TcxCustomSchedulerStorage.Changed; +begin + FIsChanged := IsLocked; + if not IsLocked then + SendNotification; +end; + +procedure TcxCustomSchedulerStorage.CreateDefaultFields; +begin + AddInternalField(FCaptionField, TcxStringValueType); + AddInternalField(FEventTypeField, TcxIntegerValueType); + AddInternalField(FFinishField, TcxDateTimeValueType); + AddInternalField(FLabelColorField, TcxIntegerValueType); + AddInternalField(FLocationField, TcxStringValueType); + AddInternalField(FMessageField, TcxStringValueType); + AddInternalField(FOptionsField, TcxIntegerValueType); + AddInternalField(FParentIDField, TcxIntegerValueType); + AddInternalField(FRecurrenceIndexField, TcxIntegerValueType, False); + AddInternalField(FRecurrenceInfoField, TcxVariantValueType, False); + AddInternalField(FReminderDateField, TcxDateTimeValueType); + AddInternalField(FReminderMinutesBeforeStartField, TcxIntegerValueType); + AddInternalField(FResourceIDField, TcxVariantValueType, False); + AddInternalField(FStartField, TcxDateTimeValueType); + AddInternalField(FStateField, TcxIntegerValueType); + AddInternalField(FActualFinishField, TcxIntegerValueType, False); + AddInternalField(FActualStartField, TcxIntegerValueType, False); + // Version 3 fields + CreateVersion3Fields; +end; + +function TcxCustomSchedulerStorage.CreateFields: TcxCustomSchedulerStorageFields; +begin + Result := TcxSchedulerStorageFields.Create(TcxSchedulerStorageField); +end; + +procedure TcxCustomSchedulerStorage.CreateHolidayEvent(const ACaption: string; + const ADate: TDateTime; AResourceID: Variant); +begin + with createEvent do + begin + Caption := ACaption; + Start := ADate; + Finish := Start + 1; + AllDayEvent := True; + State := tlsFree; + ResourceID := AResourceID; + Post; + end; +end; + +function TcxCustomSchedulerStorage.CreateReminders: TcxSchedulerReminders; +begin + Result := TcxSchedulerReminders.Create(Self); +end; + +function TcxCustomSchedulerStorage.CreateResources: TcxSchedulerStorageResources; +begin + Result := TcxSchedulerStorageResources.Create(Self); +end; + +procedure TcxCustomSchedulerStorage.CreateSubClasses; +begin + FDeletedRecords := TList.Create; + FResources := CreateResources; + FInternalFields := CreateFields; + FInternalFields.FOwner := Self; + FCustomFields := CreateFields; + FCustomFields.FOwner := Self; + FFields := TList.Create; + FNewEvents := TcxSchedulerEventList.Create; + FEventsList := TcxSchedulerEventList.Create; + FListeners := TInterfaceList.Create(); + FDataController := GetDataControllerClass.Create(Self); + FReminders := CreateReminders; + CreateDefaultFields; +end; + +procedure TcxCustomSchedulerStorage.CreateVersion3Fields; +var + I: Integer; +begin + AddInternalField(FTaskCompleteField, TcxIntegerValueType, False); + AddInternalField(FTaskIndexField, TcxIntegerValueType, False); + AddInternalField(FTaskLinksField, TcxVariantValueType, False); + AddInternalField(FTaskStatusField, TcxIntegerValueType, False); + AddInternalField(FReminderResourcesData, TcxVariantValueType, False); + if CustomFields.Count > 0 then + begin + for I := 0 to InternalFields.Count - 1 do + TcxCustomSchedulerStorageField(InternalFields.Items[I]).FIndex := I; + for I := 0 to CustomFields.Count - 1 do + TcxCustomSchedulerStorageField(CustomFields.Items[I]).FIndex := I + InternalFields.Count; + FFields.Sort(@cxSchedulerStorageFieldsCompare); + DataController.UpdateItemIndexes; + end; +end; + +procedure TcxCustomSchedulerStorage.DestroySubClasses; +begin + FReminders.Free; + try + FCustomFields.Clear; + FInternalFields.Clear; + FEventsList.DestroyItems; + FNewEvents.DestroyItems; + FDeletedRecords.Free; + finally + FDataController.Free; + FNewEvents.Free; + FEventsList.Free; + FCustomFields.Free; + FInternalFields.Free; + FFields.Free; + FResources.Free; + FreeAndNil(FEditor); + FListeners.Free; + end; +end; + +procedure TcxCustomSchedulerStorage.DestroyVersion3Fields; + + procedure DeleteField(var AField: TcxCustomSchedulerStorageField); + begin + try + FInternalFields.Delete(AField.Index) + finally + AField := nil; + end; + end; + +begin + DeleteField(FTaskCompleteField); + DeleteField(FTaskIndexField); + DeleteField(FTaskLinksField); + DeleteField(FTaskStatusField); + DeleteField(FReminderResourcesData); +end; + +procedure TcxCustomSchedulerStorage.DoDeleteEvent( + const ARecordIndex: Integer); +var + I: Integer; + AParentEvent, AChildEvent: TcxSchedulerEvent; + AEventsChain: TcxSchedulerEventList; +begin + AParentEvent := FEventsList[ARecordIndex]; + if AParentEvent = LastEditedEvent then + FLastEditedEvent := nil; + if IsUpdatingMode or IsDeletion or DoEventDeleted(AParentEvent) then Exit; + IsDeletion := True; + BeginUpdate; + FDeletedRecords.Add(Pointer(AParentEvent.RecordIndex)); + try + AEventsChain := AParentEvent.GetRecurrenceChain; + try + for I := 0 to AEventsChain.Count - 1 do + begin + AChildEvent := AEventsChain[I]; + DoEventDeleted(AChildEvent); //ignore Allow parameter for the database integrity + FDeletedRecords.Add(Pointer(AChildEvent.RecordIndex)); + AChildEvent.Free; + end; + AParentEvent.Free; + finally + AEventsChain.Free; + end; + finally + for I := ARecordIndex to FEventsList.Count - 1 do + TcxSchedulerEvent(FEventsList.FItems.List^[I]).FIndex := I; + IsDeletion := False; + EndUpdate; + end; +end; + +procedure TcxCustomSchedulerStorage.DoDestroyEvent( + AEvent: TcxSchedulerEvent); +begin + if not AEvent.FIsDeletion then + begin + FEventsList.Remove(AEvent); + FNewEvents.Remove(AEvent); + end; +end; + +function TcxCustomSchedulerStorage.DoEventDeleted( + AEvent: TcxSchedulerEvent): Boolean; +begin + Result := False; + if AEvent = LastEditedEvent then + FLastEditedEvent := nil; + if Assigned(FOnEventDeleted) then + FOnEventDeleted(Self, AEvent, Result); +end; + +function TcxCustomSchedulerStorage.DoEventInserted( + AEvent: TcxSchedulerEvent): Boolean; +begin + Result := False; + if Assigned(FOnEventInserted) then + FOnEventInserted(Self, AEvent, Result); +end; + +function TcxCustomSchedulerStorage.DoEventIntersect(AEvent1, + AEvent2: TcxSchedulerEvent): Boolean; +begin + Result := False; + if Assigned(FOnEventIntersect) then + FOnEventIntersect(Self, AEvent1, AEvent2, Result); +end; + +function TcxCustomSchedulerStorage.DoEventModified( + AEvent: TcxSchedulerEvent): Boolean; +begin + Result := False; + with AEvent do + begin + if IsModified and Assigned(FOnEventModified) then + FOnEventModified(Self, AEvent, Result); + end; +end; + +function TcxCustomSchedulerStorage.DoFilterEvent(AEvent: TcxSchedulerEvent): Boolean; +begin + Result := True; + if Assigned(FOnFilterEvent) then + FOnFilterEvent(Self, AEvent, Result); +end; + +procedure TcxCustomSchedulerStorage.DoRefresh; +var + I, J: Integer; + AEvent: TcxSchedulerEvent; +begin + Reminders.StopTimers; + if LockCount > 0 then Exit; + SynchronizeEventsWithRecords; + for I := 0 to EventCount - 1 do + begin + AEvent := Events[I]; + AEvent.FIndex := I; + AEvent.TaskLinkOwners.Clear; + if AEvent.EventType = etPattern then + begin + AEvent.FLink := nil; + for J := 0 to EventCount - 1 do + if J <> I then + AEvent.CheckRecurrenceLink(Events[J]); + end; + end; + for I := 0 to EventCount - 1 do + Events[I].InitTaskLinks; + for I := 0 to EventCount - 1 do + Events[I].RefreshTaskLinks; + if Reminders.Active then + StartUpdateRemindersTimer; +end; + +procedure TcxCustomSchedulerStorage.GenerateHolidayEventsBySchedulerHolidays(const AResourceID: Variant; + AHolidays: TcxSchedulerHolidays); +var + I: Integer; +begin + if (AHolidays = nil) or + (AHolidays.Count = 0) then + Exit; + BeginUpdate; + try + for I := 0 to AHolidays.Count - 1 do + if AHolidays[I].IsVisible then + CreateHolidayEvent(AHolidays[I].DisplayText, + DateOf(AHolidays[I].Date), AResourceID); + finally + EndUpdate; + end; +end; + +function TcxCustomSchedulerStorage.GetDataControllerClass: TcxCustomDataControllerClass; +begin + Result := TcxSchedulerStorageDataController; +end; + +function TcxCustomSchedulerStorage.GetEventStoredID(AEvent: TcxSchedulerEvent): Variant; +begin + Result := AEvent.FSavedID; +end; + +function TcxCustomSchedulerStorage.GetFieldValueBeforePost( + ARecordIndex, AFieldIndex: Integer): Variant; +begin + Result := Values[ARecordIndex, AFieldIndex]; +end; + +function TcxCustomSchedulerStorage.GetFocusedRecordID(ARecordIndex: Integer): Variant; +begin + Result := DataController.GetRecordId(ARecordIndex); +end; + +function TcxCustomSchedulerStorage.GetEventClass: TcxSchedulerEventClass; +begin + Result := TcxSchedulerEvent; +end; + +function TcxCustomSchedulerStorage.GetParentForm: TForm; +var + AOwner: TComponent; +begin + AOwner := Owner; + while not (AOwner is TForm) and (AOwner <> nil) do + AOwner := AOwner.Owner; + Result := TForm(AOwner); +end; + +function TcxCustomSchedulerStorage.GetRecordID( + const ARecordIndex: Integer): Variant; +begin + if ARecordIndex >= DataController.RecordCount then + Result := Null + else + Result := DataController.GetRecordID(ARecordIndex); +end; + +function TcxCustomSchedulerStorage.GetValue( + ARecordIndex, AItemIndex: Integer): Variant; +begin + if ARecordIndex = cxInvalidRecordIndex then + Result := Null + else + begin + if DataController.IsEditing and (ARecordIndex = DataController.EditingRecordIndex) then + Result := DataController.GetEditValue(AItemIndex, evsValue) + else + Result := DataController.Values[ARecordIndex, AItemIndex]; + end; +end; + +function TcxCustomSchedulerStorage.HasEventIntersect(AEvent1, + AEvent2: TcxSchedulerEvent): Boolean; +begin + Result := not DoEventIntersect(AEvent1, AEvent2); +end; + +procedure TcxCustomSchedulerStorage.ItemAdded( + AItem: TcxCustomSchedulerStorageField); +begin + if FFields.IndexOf(AItem) = -1 then + try + AItem.FIndex := FFields.Add(AItem); + DataController.AddItem(AItem); + finally + DataController.UpdateItemIndexes; + LayoutChanged; + end; +end; + +procedure TcxCustomSchedulerStorage.ItemRemoved( + AItem: TcxCustomSchedulerStorageField); +begin + if FFields.Remove(AItem) <> -1 then + try + DataController.RemoveItem(AItem); + finally + UpdateItemIndexes; + LayoutChanged; + end; +end; + +function TcxCustomSchedulerStorage.IsDataSettingsValid: Boolean; +begin + Result := True; +end; + +procedure TcxCustomSchedulerStorage.LayoutChanged; +begin + SendNotification; +end; + +procedure TcxCustomSchedulerStorage.Loaded; +begin + inherited Loaded; + DataController.Loaded; + FullRefresh; +end; + +procedure TcxCustomSchedulerStorage.Notification( + AComponent: TComponent; Operation: TOperation); +begin + if (Resources <> Nil) and (Operation = opRemove)and (AComponent = Resources.Images) then + Resources.Images := nil; + inherited Notification(AComponent, Operation); +end; + +procedure TcxCustomSchedulerStorage.PostEvent( + AEvent: TcxSchedulerEvent); +var + ARecordIndex: Integer; +begin + BeginUpdate; + try + if AEvent.IsNewEvent then + begin + FNewEvents.Remove(AEvent); + FEventsList.Add(AEvent); + if DoEventInserted(AEvent) then Exit; + if CheckRequiredFields then + begin + ARecordIndex := DataController.RecordCount; + AddRecord; + if ARecordIndex < DataController.RecordCount then + begin + AEvent.SetRecordIndex(ARecordIndex); + AEvent.EndEditing; + AEvent.FSavedID := GetFocusedRecordID(ARecordIndex); + end; + end + else + AEvent.Free; + end; + finally + EndUpdate; + end; +end; + +procedure TcxCustomSchedulerStorage.PostEditingData( + AEvent: TcxSchedulerEvent); +var + AFieldIndex: Integer; +begin + if DoEventModified(AEvent) then Exit; + BeginUpdateDataController; + try + for AFieldIndex := 0 to AEvent.ValueCount - 1 do + SetPostFieldValue(AEvent, AFieldIndex); + finally + EndUpdateDataController; + end; +end; + +procedure TcxCustomSchedulerStorage.SendNotification( + AIsRemoved: Boolean = False); +var + I: Integer; + AIntf: IcxSchedulerStorageListener; +begin + if LockCount <> 0 then Exit; + for I := Listeners.Count - 1 downto 0 do + if Supports(Listeners[I], IcxSchedulerStorageListener, AIntf) then + begin + if AIsRemoved then + AIntf.StorageRemoved(Self) + else + if not IsUpdatingMode then + begin + FIsChanged := False; + AIntf.StorageChanged(Self); + end; + end; +end; + +procedure TcxCustomSchedulerStorage.SetEventRecordInfo(AEvent: TcxSchedulerEvent; + ARecordIndex: Integer; const AEventID: Variant); +begin + AEvent.SetRecordIndex(ARecordIndex); + AEvent.FSavedID := AEventID; +end; + +procedure TcxCustomSchedulerStorage.SetFieldValueBeforePost( + ARecordIndex, AFieldIndex: Integer; const AValue: Variant); +begin + Values[ARecordIndex, AFieldIndex] := AValue; +end; + +procedure TcxCustomSchedulerStorage.SetPostFieldValue(AEvent: TcxSchedulerEvent; + AFieldIndex: Integer); +var + AEventValue, APatternValue, AStoredValue: Variant; +begin + AEventValue := AEvent.FEditValues[AFieldIndex]; + if (AEvent.Pattern <> nil) and (AEvent.EventType = etCustom) and CanGetValueFromPattern(AFieldIndex) then + begin + APatternValue := Values[AEvent.Pattern.RecordIndex, AFieldIndex]; + AStoredValue := GetFieldValueBeforePost(AEvent.RecordIndex, AFieldIndex); + if not VarEquals(AEventValue, APatternValue) or + (not VarEquals(AEventValue, AStoredValue) and not VarIsNull(AStoredValue)) then + SetFieldValueBeforePost(AEvent.RecordIndex, AFieldIndex, AEventValue); + end + else + SetFieldValueBeforePost(AEvent.RecordIndex, AFieldIndex, AEventValue); +end; + +procedure TcxCustomSchedulerStorage.SetValue( + ARecordIndex, AItemIndex: Integer; + const AValue: Variant); +begin + if ARecordIndex <> cxInvalidRecordIndex then + DataController.Values[ARecordIndex, AItemIndex] := AValue; +end; + +procedure TcxCustomSchedulerStorage.SynchronizeEventsWithRecords; +var + ID: Variant; + AEvent: TcxSchedulerEvent; + IndexList, DestList: TList; + I, ACount: Integer; +begin + if not IsDataSettingsValid then + ACount := 0 + else + ACount := DataController.RecordCount; + IndexList := FEventsList.FItems; + IndexList.Sort(TListSortCompare(@cxCompareEventsByID)); + DestList := TList.Create; + try + FEventsList.FItems := DestList; + DestList.Count := ACount; + for I := 0 to ACount - 1 do + begin + ID := DataController.GetRecordID(I); + if not cxFindEvent(IndexList, ID, AEvent) then + AEvent := GetEventClass.Create(Self, I); + AEvent.SetRecordIndex(I); + AEvent.FPattern := nil; + DestList[I] := AEvent; + end; + for I := 0 to IndexList.Count - 1 do + begin + if FLastEditedEvent = IndexList.List^[I] then + FLastEditedEvent := nil; + TObject(IndexList.List^[I]).Free; + end; + finally + IndexList.Free; + end; +end; + +procedure TcxCustomSchedulerStorage.UpdateControl( + AInfo: TcxUpdateControlInfo); +begin + if (AInfo is TcxDataChangedInfo) or (AInfo is TcxUpdateRecordInfo) then + FullRefresh; +end; + +procedure TcxCustomSchedulerStorage.UpdateData; +begin +end; + +procedure TcxCustomSchedulerStorage.UpdateItemIndexes; +var + I: Integer; +begin + for I := 0 to FieldCount - 1 do + TcxCustomSchedulerStorageField(FFields[I]).FIndex := I; + SendNotification; +end; + +function TcxCustomSchedulerStorage.GetDataField( + AIndex: Integer): TcxCustomSchedulerStorageField; +begin + Result := TcxCustomSchedulerStorageField(FFields[AIndex]); +end; + +function TcxCustomSchedulerStorage.GetEvent( + AIndex: Integer): TcxSchedulerEvent; +begin + Result := FEventsList[AIndex]; +end; + +function TcxCustomSchedulerStorage.GetEventCount: Integer; +begin + Result := FEventsList.Count; +end; + +function TcxCustomSchedulerStorage.GetField(AIndex: Integer): TcxCustomSchedulerStorageField; +begin + Result := TcxCustomSchedulerStorageField(FFields[AIndex]); +end; + +function TcxCustomSchedulerStorage.GetFieldCount: Integer; +begin + Result := FFields.Count +end; + +function TcxCustomSchedulerStorage.GetInternalFieldCount: Integer; +begin + Result := FInternalFields.Count; +end; + +function TcxCustomSchedulerStorage.GetIsDestroying: Boolean; +begin + Result := csDestroying in ComponentState; +end; + +function TcxCustomSchedulerStorage.GetIsLoading: Boolean; +begin + Result := csLoading in ComponentState; +end; + +function TcxCustomSchedulerStorage.GetIsLocked: Boolean; +begin + Result := DataController.LockCount > 0 +end; + +function TcxCustomSchedulerStorage.GetIsUpdatingMode: Boolean; +begin + Result := FIsLoading or IsLoading or IsDestroying; +end; + +function TcxCustomSchedulerStorage.GetResourceCount: Integer; +begin + Result := Resources.ResourceItems.Count; +end; + +function TcxCustomSchedulerStorage.GetResourceID(AIndex: Integer): Variant; +begin + Result := Resources.ResourceItems[AIndex].ResourceID; +end; + +function TcxCustomSchedulerStorage.GetResourceName(AIndex: Integer): string; +begin + Result := Resources.ResourceItems[AIndex].DisplayName; +end; + +procedure TcxCustomSchedulerStorage.SetEvent( + AIndex: Integer; AValue: TcxSchedulerEvent); +begin + Events[AIndex].Assign(AValue); +end; + +procedure TcxCustomSchedulerStorage.SetHolidays(AValue: TcxSchedulerHolidays); +begin + if AValue <> FHolidays then + begin + if FHolidays <> nil then + begin + FHolidays.RemoveListener(Self); + end; + FHolidays := AValue; + if FHolidays <> nil then + begin + FHolidays.AddListener(Self); + end; + FullRefresh; + end; +end; + +procedure TcxCustomSchedulerStorage.SetOnFilterEvent( + AValue: TcxSchedulerFilterEventEvent); +begin + if @FOnFilterEvent <> @AValue then + begin + FOnFilterEvent := AValue; + SendNotification; + end; +end; + +procedure TcxCustomSchedulerStorage.SetReminders( + AValue: TcxSchedulerReminders); +begin + FReminders.Assign(AValue); +end; + +procedure TcxCustomSchedulerStorage.SetResources( + AValue: TcxSchedulerStorageResources); +begin + FResources.Assign(AValue); +end; + +procedure TcxCustomSchedulerStorage.SetStoreUsingGlobalTime(AValue: Boolean); +begin + if StoreUsingGlobalTime <> AValue then + begin + FStoreUsingGlobalTime := AValue; + if AValue then + begin + with DateTimeHelper do + TimeBias := TimeZoneBias(CurrentTimeZone) + end + else + TimeBias := 0; + Changed; + end; +end; + +procedure TcxCustomSchedulerStorage.StartUpdateRemindersTimer; +begin + if (FUpdateRemindersTimer <> nil) or + (not Reminders.Active or (csDesigning in ComponentState)) then Exit; + FUpdateRemindersTimer := TTimer.Create(nil); + FUpdateRemindersTimer.Interval := 50; + FUpdateRemindersTimer.OnTimer := UpdateRemindersTimerEvent; +end; + +procedure TcxCustomSchedulerStorage.StopUpdateRemindersTimer; +begin + FreeAndNil(FUpdateRemindersTimer); +end; + +procedure TcxCustomSchedulerStorage.UpdateReminders; +begin + StopUpdateRemindersTimer; + with Reminders do if Active then Refresh; +end; + +procedure TcxCustomSchedulerStorage.UpdateRemindersTimerEvent( + Sender: TObject); +begin + UpdateReminders; +end; + +{ TcxSchedulerStorage } + +procedure TcxSchedulerStorage.Assign(Source: TPersistent); +var + AMemStream: TMemoryStream; +begin + if Source is TcxSchedulerStorage then + begin + AMemStream := TMemoryStream.Create; + try + TcxSchedulerStorage(Source).SaveToStream(AMemStream); + AMemStream.Position := 0; + LoadFromStream(AMemStream); + finally + AMemStream.Free; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxSchedulerStorage.SaveToFile( + const AFileName: string); +var + AStream: TFileStream; +begin + AStream := TFileStream.Create(AFileName, fmCreate); + try + SaveToStream(AStream); + finally + AStream.Free; + end; +end; + +procedure TcxSchedulerStorage.SaveToStream(AStream: TStream); +begin + WriteStringProc(AStream, scxSchedulerSignature); + AStream.WriteBuffer(cxSchedulerStreamVersion, SizeOf(cxSchedulerStreamVersion)); + DataController.SaveToStream(AStream); +end; + +procedure TcxSchedulerStorage.LoadFromFile(const AFileName: string); +var + AStream: TFileStream; +begin + AStream := TFileStream.Create(AFileName, fmOpenRead); + try + LoadFromStream(AStream); + finally + AStream.Free; + end; +end; + +procedure TcxSchedulerStorage.LoadFromStream( + AStream: TStream); +var + C: Integer; + AVersion: Double; + AMemStream: TMemoryStream; +begin + AMemStream := TMemoryStream.Create; + BeginUpdate; + try + SaveToStream(AMemStream); + try + DataController.RecordCount := 0; + DataController.Post; + AVersion := GetStreamVersion(AStream, C, CustomFields.Count); + if AVersion < 0 then + cxSchedulerError(cxGetResourceString(@cxSDataInvalidStreamFormat)); + try + if AVersion < 3.0 then + DestroyVersion3Fields; + DataController.LoadFromStream(AStream); + finally + if AVersion < 3.0 then + CreateVersion3Fields; + end; + except + Clear; + DataController.LoadFromStream(AMemStream); + raise; + end; + finally + AMemStream.Free; + if IsUpdatingMode then + DoRefresh; + EndUpdate; + end; +end; + +procedure TcxSchedulerStorage.DefineProperties( + Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineBinaryProperty('BinaryData', LoadFromStream, + SaveToStream, DataController.RecordCount > 0); +end; + +function TcxSchedulerStorage.GetCustomFields: TcxSchedulerStorageFields; +begin + Result := TcxSchedulerStorageFields(inherited CustomFields) +end; + +procedure TcxSchedulerStorage.SetCustomFields( + const AValue: TcxSchedulerStorageFields); +begin + CustomFields.Assign(AValue); +end; + +{ TcxSchedulerControlEventID } + +constructor TcxSchedulerControlEventID.Create(AEvent: TcxSchedulerEvent); +begin + if AEvent.RecordIndex <> -1 then + begin + ID := AEvent.ID; + ParentID := AEvent.ParentID; + RecurrenceIndex := AEvent.RecurrenceIndex + end + else + begin + ID := Null; + ParentID := Null; + RecurrenceIndex := -1; + end; +end; + +function TcxSchedulerControlEventID.SameEvent(AEvent: TcxSchedulerEvent): Boolean; +begin + Result := VarEquals(AEvent.ID, ID) and VarEquals(AEvent.ParentID, ParentID) and + (AEvent.RecurrenceIndex = RecurrenceIndex); +end; + +function TcxSchedulerControlEventID.Equals(AValue: TcxSchedulerControlEventID): Boolean; +begin + Result := (AValue = Self) or VarEquals(AValue.ID, ID) and + VarEquals(AValue.ParentID, ParentID) and (AValue.RecurrenceIndex = RecurrenceIndex); +end; + +{ TcxSchedulerEventSelection } + +constructor TcxSchedulerEventSelection.Create( + ASourceEvents: TcxSchedulerEventList); +begin + FKeys := TList.Create; + FEvents := TList.Create; + FSourceEvents := ASourceEvents; +end; + +destructor TcxSchedulerEventSelection.Destroy; +begin + InternalClear; + FEvents.Free; + FKeys.Free; + inherited Destroy; +end; + +procedure TcxSchedulerEventSelection.Add( + AEvent: TcxSchedulerControlEvent; AShift: TShiftState); +var + AIndex: Integer; + ASelected: Boolean; +begin + ASelected := (AEvent <> nil) and AEvent.Selected; + if (AEvent = nil) or ([ssShift, ssCtrl] * AShift = []) then + InternalClear; + if AEvent <> nil then + try + AIndex := KeyIndexOf(AEvent); + if (ssCtrl in AShift) and (AIndex >= 0) then + begin + Keys[AIndex].Free; + FKeys.Delete(AIndex); + end + else + if AIndex < 0 then + FKeys.Add(CreateItem(AEvent)); + finally + Update; + if ASelected <> AEvent.Selected then + DoEventSelectionChanged(AEvent); + end; +end; + +procedure TcxSchedulerEventSelection.Clear; +begin + if Count = 0 then Exit; + InternalClear; + DoEventSelectionChanged(nil); +end; + +function TcxSchedulerEventSelection.IsSelected( + AEvent: TcxSchedulerControlEvent): Boolean; +begin + Result := KeyIndexOf(AEvent) >= 0; +end; + +procedure TcxSchedulerEventSelection.Select(AEvent: TcxSchedulerEvent); +begin + InternalClear; + FKeys.Add(TcxSchedulerControlEventID.Create(AEvent)); + DoEventSelectionChanged(nil); +end; + +procedure TcxSchedulerEventSelection.Update; +begin + FKeys.Sort(TListSortCompare(@cxCompareSelectionKeys)); + ReplaceSelection; +end; + +procedure TcxSchedulerEventSelection.ClearKeys; +var + I: Integer; +begin + for I := FKeys.Count - 1 downto 0 do + TObject(FKeys.List^[I]).Free; + FKeys.Clear; +end; + +function TcxSchedulerEventSelection.CreateItem( + AEvent: TcxSchedulerControlEvent): TcxSchedulerControlEventID; +begin + Result := TcxSchedulerControlEventID.Create(AEvent); +end; + +procedure TcxSchedulerEventSelection.DoEventSelectionChanged( + AEvent: TcxSchedulerControlEvent); +begin + if Assigned(FOnEventSelectionChanged) then + FOnEventSelectionChanged(AEvent); +end; + +function TcxSchedulerEventSelection.KeyIndexOf( + AEvent: TcxSchedulerControlEvent): Integer; +var + I, L, R, C: Integer; + AItemForSearch: TcxSchedulerControlEventID; +begin + Result := -1; + L := 0; + R := KeyCount - 1; + if R < L then Exit; + AItemForSearch := CreateItem(AEvent); + try + while L <= R do + begin + I := (L + R) shr 1; + C := cxCompareSelectionKeys(Keys[I], AItemForSearch); + if C < 0 then + L := I + 1 + else + begin + R := I - 1; + if C = 0 then + begin + Result := I; + Break; + end; + end; + end; + finally + AItemForSearch.Free; + end; +end; + +function TcxSchedulerEventSelection.IndexOf( + AEvent: TcxSchedulerControlEvent): Integer; +begin + Result := FEvents.IndexOf(AEvent); +end; + +procedure TcxSchedulerEventSelection.InternalClear; +begin + ClearKeys; + FEvents.Clear; +end; + +procedure TcxSchedulerEventSelection.ReplaceSelection; +var + AIndex, I: Integer; +begin + FEvents.Clear; + for I := 0 to FSourceEvents.Count - 1 do + begin + AIndex := KeyIndexOf(TcxSchedulerControlEvent(FSourceEvents[I])); + if AIndex <> -1 then FEvents.Add(FSourceEvents[I]); + end; + ClearKeys; + for I := 0 to FEvents.Count - 1 do + FKeys.Add(CreateItem(TcxSchedulerControlEvent(FEvents[I]))); + FKeys.Sort(TListSortCompare(@cxCompareSelectionKeys)); +end; + +function TcxSchedulerEventSelection.GetCount: Integer; +begin + Result := FEvents.Count; +end; + +function TcxSchedulerEventSelection.GetItem( + AIndex: Integer): TcxSchedulerControlEvent; +begin + Result := TcxSchedulerControlEvent(FEvents.List^[AIndex]) +end; + +function TcxSchedulerEventSelection.GetKey( + AIndex: Integer): TcxSchedulerControlEventID; +begin + Result := FKeys.List^[AIndex]; +end; + +function TcxSchedulerEventSelection.GetKeyCount: Integer; +begin + Result := FKeys.Count; +end; + +{ TcxSchedulerEventList } + +constructor TcxSchedulerEventList.Create; +begin + FItems := TList.Create; +end; + +destructor TcxSchedulerEventList.Destroy; +begin + FItems.Free; + inherited Destroy; +end; + +procedure TcxSchedulerEventList.Assign(ASource: TcxSchedulerEventList{$IFDEF DELPHI6}; + AOperator: TListAssignOp = laCopy {$ENDIF}); +{$IFNDEF DELPHI6} +var + I: Integer; +{$ENDIF} +begin + if ASource = nil then Exit; +{$IFDEF DELPHI6} + FItems.Assign(ASource.FItems, AOperator, nil); +{$ELSE} + FItems.Clear; + FItems.Capacity := ASource.FItems.Capacity; + for I := 0 to ASource.FItems.Count - 1 do + FItems.Add(ASource.FItems.List^[I]); +{$ENDIF} +end; + +function TcxSchedulerEventList.Add( + AEvent: TcxSchedulerEvent): Integer; +begin + Result := FItems.Add(AEvent); + EventAdded(AEvent); +end; + +procedure TcxSchedulerEventList.Clear; +begin + DoClear(False); +end; + +procedure TcxSchedulerEventList.Delete(AIndex: Integer); +begin + FItems.Delete(AIndex); +end; + +procedure TcxSchedulerEventList.DestroyItems; +begin + DoClear(True); +end; + +function TcxSchedulerEventList.Remove( + AEvent: TcxSchedulerEvent): Integer; +begin + Result := FItems.Remove(AEvent); +end; + +function TcxSchedulerEventList.IndexOf( + AEvent: TcxSchedulerEvent): Integer; +begin + Result := FItems.IndexOf(AEvent); +end; + +procedure TcxSchedulerEventList.Sort( + ACompare: TcxCompareEventsProc); +begin + FItems.Sort(@ACompare); +end; + +procedure TcxSchedulerEventList.EventAdded( + AEvent: TcxSchedulerEvent); +begin +end; + +procedure TcxSchedulerEventList.DoClear(AFreeItems: Boolean); +var + I: Integer; +begin + if AFreeItems then + for I := FItems.Count - 1 downto 0 do + with Items[I] do + begin + FIsDeletion := True; + Free; + end; + FItems.Clear; +end; + +function TcxSchedulerEventList.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxSchedulerEventList.GetFirst: TcxSchedulerEvent; +begin + Result := TcxSchedulerEvent(FItems.First); +end; + +function TcxSchedulerEventList.GetEvent( + AIndex: Integer): TcxSchedulerEvent; +begin + Result := TcxSchedulerEvent(FItems.List^[AIndex]); +end; + +function TcxSchedulerEventList.GetLast: TcxSchedulerEvent; +begin + Result := TcxSchedulerEvent(FItems.Last); +end; + +{ TcxSchedulerFilteredEventList } + +destructor TcxSchedulerFilteredEventList.Destroy; +begin + DestroyItems; + inherited Destroy; +end; + +function TcxSchedulerFilteredEventList.AddEvent( + AEvent: TcxSchedulerEvent): TcxSchedulerControlEvent; +begin + Result := CreateControlEvent(AEvent); + Add(Result); +end; + +function TcxSchedulerFilteredEventList.AddOccurrence( + ACalculator: TcxSchedulerOccurrenceCalculator): TcxSchedulerControlEvent; +var + AReminderStart: TDateTime; +begin + Result := nil; + if ReminderEventsOnly and not ACalculator.Event.Reminder then Exit; + begin + if ReminderEventsOnly then + begin + AReminderStart := ACalculator.OccurrenceStart - + ACalculator.Event.ReminderMinutesBeforeStart * MinuteToTime; + if NeedAddOccurenceForReminder(AReminderStart, ACalculator.Event) then + begin + if (ACalculator.FOccurence <> nil) and (DateOf(AReminderStart) < DateOf(FNow)) then + begin + FreeAndNil(ACalculator.FOccurence); + Delete(ACalculator.FOccurencePos); + end; + ACalculator.FOccurencePos := Count; + Result := AddEvent(ACalculator.Event); + ACalculator.FOccurence := Result; + end; + end + else + if (ACalculator.OccurrenceStart <= Finish) and (ACalculator.OccurrenceFinish >= Start) then + Result := AddEvent(ACalculator.Event); + if Result = nil then Exit; + if ACalculator.Event.RecordIndex >= 0 then + Result.ParentID := ACalculator.Event.ID; + Result.Start := ACalculator.OccurrenceStart - Result.TimeBias + Storage.TimeBias; + Result.Finish := ACalculator.OccurrenceFinish - Result.TimeBias + Storage.TimeBias; + Result.RecurrenceIndex := ACalculator.Index; + Result.EventType := etOccurrence; + Result.FPattern := ACalculator.Event; + Result.FOptions := ACalculator.Event.FOptions; + Result.ReminderDate := ACalculator.Event.ReminderDate; + end; + if (Result <> nil) and not Storage.DoFilterEvent(Result) then + begin + if ACalculator.FOccurence = Result then + ACalculator.FOccurence := nil; + FreeAndNil(Result); + Delete(Count - 1); + end; +end; + +procedure TcxSchedulerFilteredEventList.Changed; +begin +end; + +procedure TcxSchedulerFilteredEventList.CheckEvent( + AEvent: TcxSchedulerEvent; const AResourceID: Variant); +begin + if AEvent.EventType in [etNone, etCustom] then + CheckSimpleEvent(AEvent, AResourceID) + else + if (AEvent.EventType = etPattern) or AEvent.SkipExceptions then + CheckRecurrenceEvent(AEvent, AResourceID); +end; + +function TcxSchedulerFilteredEventList.CheckEventTimeRange: Boolean; +begin + Result := True; +end; + +procedure TcxSchedulerFilteredEventList.CheckRecurrenceEvent( + AEvent: TcxSchedulerEvent; const AResourceID: Variant); +var + AOccurrence: TcxSchedulerEvent; + ACalculator: TcxSchedulerOccurrenceCalculator; +begin + ACalculator := TcxSchedulerOccurrenceCalculator.Create(AEvent, AEvent.Start, FFinish, + ReminderEventsOnly); + try + while ACalculator.GetNextOccurrence do + begin + if not AEvent.GetOccurrenceByIndex(ACalculator.Index, AOccurrence) then + if VarIsNull(AResourceID) or AEvent.IsSharedWithResource(AResourceID) then + AddOccurrence(ACalculator); + end; + finally + ACalculator.Free; + end; +end; + +procedure TcxSchedulerFilteredEventList.CheckSimpleEvent( + AEvent: TcxSchedulerEvent; const AResourceID: Variant); +begin + if not Storage.DoFilterEvent(AEvent) then Exit; + if VarIsNull(AResourceID) or AEvent.IsSharedWithResource(AResourceID) then + begin + if FReminderEventsOnly then + begin + if AEvent.Reminder and (AEvent.ReminderDate <= Finish) then + AddEvent(AEvent).FPattern := AEvent.FPattern; + end + else + if not CheckEventTimeRange or ((AEvent.Start <= Finish) and (AEvent.Finish >= Start)) then + AddEvent(AEvent).FPattern := AEvent.FPattern; + end; +end; + +function TcxSchedulerFilteredEventList.CreateControlEvent( + AEvent: TcxSchedulerEvent): TcxSchedulerControlEvent; +begin + Result := TcxSchedulerControlEvent.Create(AEvent); + Result.FTimeBias := AEvent.TimeBias; + Result.FLink := AEvent.FLink; +end; + +procedure TcxSchedulerFilteredEventList.Init( + const AStart, AFinish: TDateTime; AStorage: TcxCustomSchedulerStorage); +begin + DestroyItems; + FStart := AStart; + FFinish := AFinish; + FStorage := AStorage; +end; + +function TcxSchedulerFilteredEventList.NeedAddOccurenceForReminder( + AReminderStart: TDateTime; AEvent: TcxSchedulerEvent): Boolean; +begin + Result := (AReminderStart > AEvent.RecurrenceInfo.DismissDate) and + (AReminderStart < Finish); +end; + +function TcxSchedulerFilteredEventList.GetEvent( + AIndex: Integer): TcxSchedulerControlEvent; +begin + Result := TcxSchedulerControlEvent(FItems.List^[AIndex]) +end; + +{ TcxSchedulerCachedEventList } + +constructor TcxSchedulerCachedEventList.Create; +begin + inherited Create; + FAbsoluteItems := TList.Create; + FSelection := CreateSelection; + FClones := CreateCloneList; + FShowEventsWithoutResource := True; + FTimeZone := -1; + FUseTimeRange := True; +end; + +destructor TcxSchedulerCachedEventList.Destroy; +begin + FreeAndNil(FClones); + FreeAndNil(FSelection); + FreeAndNil(FAbsoluteItems); + inherited Destroy; +end; + +procedure TcxSchedulerCachedEventList.BeforeEditing( + AEvent: TcxSchedulerControlEvent; AIsInplace: Boolean); + + function GetEventID(AEvent: TcxSchedulerEvent): Variant; + begin + Result := Null; + if AEvent <> nil then + Result := AEvent.ID; + end; + +begin + AEvent.FIsEditing := AIsInplace; + FSavedPatternID := GetEventID(AEvent.Pattern); + FSavedSourceID := GetEventID(AEvent.Source); + FSavedIndex := AEvent.RecurrenceIndex; +end; + +procedure TcxSchedulerCachedEventList.BeforeUpdate; +begin + FExpandedTimeRange := CalculateNecessaryDate( + FMinNecessaryDate, FMaxNecessaryDate); +end; + +procedure TcxSchedulerCachedEventList.DeleteEvent( + AEvent: TcxSchedulerControlEvent); +begin + if (AEvent.Source <> nil) or (AEvent.EventType = etOccurrence) then + AEvent.Delete + else + begin + FItems.Remove(AEvent); + FAbsoluteItems.Remove(AEvent); + AEvent.Free; + end; +end; + +procedure TcxSchedulerCachedEventList.CalculateClonesRange( + var AMinDate, AMaxDate: TDateTime); +var + I: Integer; +begin + if Clones.Count = 0 then Exit; + AMinDate := Clones[0].Start; + AMaxDate := Clones[0].Finish; + for I := 1 to Clones.Count - 1 do + begin + AMinDate := Min(AMinDate, Clones[I].Start); + AMaxDate := Max(AMaxDate, Clones[I].Finish); + end; +end; + +function TcxSchedulerCachedEventList.CalculateNecessaryDate( + var AMinDate, AMaxDate: TDateTime): Boolean; +var + AMin, AMax: TDateTime; +begin + Result := (Clones.Count > 0) or (Selection.Count > 0); + if not Result then Exit; + if Clones.Count > 0 then + CalculateClonesRange(AMinDate, AMaxDate); + if Selection.Count > 0 then + CalculateSelectionRange(AMin, AMax) + else + Exit; + if Clones.Count > 0 then + begin + AMinDate := Min(AMinDate, AMin); + AMaxDate := Max(AMaxDate, AMax); + end + else + begin + AMinDate := AMin; + AMaxDate := AMax; + end; +end; + +procedure TcxSchedulerCachedEventList.CalculateSelectionRange( + var AMinDate, AMaxDate: TDateTime); +var + I: Integer; +begin + if Selection.Count = 0 then Exit; + AMinDate := Selection.Items[0].Start; + AMaxDate := Selection.Items[0].Finish; + for I := 1 to Selection.Count - 1 do + begin + AMinDate := Min(AMinDate, Selection.Items[I].Start); + AMaxDate := Max(AMaxDate, Selection.Items[I].Finish); + end; +end; + +procedure TcxSchedulerCachedEventList.CancelClones; +begin + FHasClones := False; + FClones.DestroyItems; + Changed; +end; + +function TcxSchedulerCachedEventList.CreateEvent: TcxSchedulerControlEvent; +begin + Storage.FLastEditedEvent := nil; + Result := TcxSchedulerControlEvent.Create(Storage); + Result.FIsSource := True; + FItems.Add(Result); + FAbsoluteItems.Add(Result); +end; + +function TcxSchedulerCachedEventList.CreateClones: TcxSchedulerEventList; +var + I: Integer; + AEvent: TcxSchedulerControlEvent; +begin + FClones.DestroyItems; + for I := 0 to Selection.Count - 1 do + begin + AEvent := CreateControlEvent(Selection.Items[I]); + Selection.Items[I].FIsSource := True; + AEvent.FIsClone := True; + AEvent.FPattern := AEvent.Source.FPattern; + FClones.Add(AEvent); + end; + Result := FClones; + FHasClones := FClones.Count > 0; + FExpandedTimeRange := CalculateNecessaryDate(FMinNecessaryDate, FMaxNecessaryDate); + Changed; +end; + +procedure TcxSchedulerCachedEventList.ExtractEvents( + const ADate: TDateTime; AList: TcxSchedulerEventList); +var + I: Integer; + AEvent: TcxSchedulerEvent; +begin + AList.Clear; + for I := 0 to AbsoluteCount - 1 do + begin + AEvent := AbsoluteItems[I]; + if AEvent.IsDayEvent(ADate) and (AList.IndexOf(AEvent) = -1) then + AList.Add(AEvent); + end; +end; + +procedure TcxSchedulerCachedEventList.ExtractUsedDays(AList: TcxSchedulerDateList); +var + I: Integer; +begin + AList.Count := 0; + for I := Trunc(FStart) to Trunc(FFinish) do + if IsDayNoneEmpty(I) then + AList.AddEx(I); +end; + +function TcxSchedulerCachedEventList.HasConflict(IsDragCopy: Boolean; AStartDrag: Boolean): Boolean; +begin + if AStartDrag then + Result := (Selection.Count > 1) and HasIntersection(Selection.FEvents) + else + if (Selection.Count = 1) and (Clones.Count = 0) then + Result := HasIntersection(Selection[0]) + else + Result := HasIntersection(Self, Clones, not IsDragCopy); +end; + +function TcxSchedulerCachedEventList.HasIntersection(AEvent: TcxSchedulerControlEvent): Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to FItems.Count - 1 do + begin + if FItems[I] = AEvent then Continue; + Result := IsIntersect(TcxSchedulerControlEvent(FItems[I]), AEvent); + if Result then Exit; + end; +end; + +function TcxSchedulerCachedEventList.HasIntersection(AList: TList): Boolean; +var + I, J: Integer; +begin + Result := False; + for I := 0 to AList.Count - 1 do + for J := 0 to AList.Count - 1 do + begin + Result := (I <> J) and IsIntersect( + TcxSchedulerEvent(AList[I]), TcxSchedulerEvent(AList[J])); + if Result then Exit; + end; +end; + +function TcxSchedulerCachedEventList.HasIntersection( + AList1, AList2: TcxSchedulerEventList; AExcludeEquals: Boolean): Boolean; +var + I, J: Integer; +begin + Result := False; + for I := 0 to AList1.Count - 1 do + for J := 0 to AList2.Count - 1 do + begin + if AExcludeEquals and (AList1[I] = TcxSchedulerControlEvent(AList2[J]).Source) then Continue; + Result := IsIntersect(AList1[I], AList2[J]); + if Result then Exit; + end; +end; + +function TcxSchedulerCachedEventList.LastEditedEvent: TcxSchedulerControlEvent; + + function FindByEvent(ASource: TcxSchedulerEvent): TcxSchedulerControlEvent; + var + I: Integer; + begin + Result := nil; + for I := 0 to AbsoluteCount - 1 do + if AbsoluteItems[I].Source = ASource then + begin + Result := AbsoluteItems[I]; + if Result.RecurrenceIndex = FSavedIndex then Exit; + end; + end; + + function FindByID(AID: Variant; ActualValue: TcxSchedulerControlEvent): TcxSchedulerControlEvent; + var + I: Integer; + begin + Result := ActualValue; + if (ActualValue <> nil) or VarIsNull(AID) then Exit; + for I := 0 to AbsoluteCount - 1 do + if VarEqualsSoft(AbsoluteItems[I].ID, AID) then + begin + Result := AbsoluteItems[I]; + if Result.RecurrenceIndex = FSavedIndex then Exit; + end; + end; + +var + ASource: TcxSchedulerEvent; +begin + ASource := nil; + if VarIsNull(FSavedPatternID) and VarIsNull(FSavedSourceID) or + ((Storage.LastEditedEvent <> nil) and (Storage.LastEditedEvent.EventType <> etNone)) then + ASource := Storage.LastEditedEvent; + Result := FindByID(FSavedPatternID, + FindByID(FSavedSourceID, FindByEvent(ASource))); +end; + +procedure TcxSchedulerCachedEventList.PostClones(ACopy: Boolean); +var + I: Integer; +begin + Storage.BeginUpdate; + try + for I := 0 to FClones.Count - 1 do + InternalPost(TcxSchedulerControlEvent(FClones[I]), ACopy); + finally + Selection.Clear; + CancelClones; + Storage.EndUpdate; + end; +end; + +procedure TcxSchedulerCachedEventList.PostEvent( + AEvent: TcxSchedulerControlEvent); +begin + FBeforePostCount := Count; + try + AEvent.FIsEditing := False; + if AEvent.Source = nil then + PostNewEvent(AEvent) + else + if AEvent.EventType in [etNone, etCustom] then + PostCloneForSimpleEvent(AEvent, False, AEvent.EventType) + else + if AEvent.EventType = etOccurrence then + PostCloneForSimpleEvent(AEvent, True, etCustom) + except + FNewEvent := nil; + Storage.SendNotification(False); + raise; + end; +end; + +procedure TcxSchedulerCachedEventList.Sort(ACompare: TcxCompareEventsProc); +begin + inherited Sort(ACompare); + FAbsoluteItems.Sort(TListSortCompare(@ACompare)); +end; + +procedure TcxSchedulerCachedEventList.Changed; +begin + if FChangeRef <> 0 then Exit; + Inc(FChangeRef); + PopulateAbsoluteItems; + if (Count > FBeforePostCount) and (FNewEvent <> nil) then + begin + Selection.ClearKeys; + Selection.Select(FNewEvent); + end; + FNewEvent := nil; + Selection.Update; + if FHasClones then + begin + CreateClones; + PopulateAbsoluteItems; + end; + inherited Changed; + Dec(FChangeRef); +end; + +procedure TcxSchedulerCachedEventList.CheckEvent( + AEvent: TcxSchedulerEvent; const AResourceID: Variant); +begin + if CheckEventVisibility(AEvent, ShowEventsWithoutResource) then + inherited CheckEvent(AEvent, AResourceID); +end; + +function TcxSchedulerCachedEventList.CheckEventTimeRange: Boolean; +begin + Result := UseTimeRange; +end; + +function TcxSchedulerCachedEventList.CheckEventVisibility( + AEvent: TcxSchedulerEvent; AIncludeUnassigned: Boolean): Boolean; +var + I: Integer; + AItems: TcxSchedulerStorageResourceItems; +begin + Result := VarIsNull(AEvent.ResourceID); + if Result and AIncludeUnassigned then + Exit + else + begin + AItems := Storage.Resources.ResourceItems; + Result := AItems.Count = 0; + for I := 0 to AItems.Count - 1 do + if AItems[I].Visible and AEvent.IsResourceEvent(AItems[I], False) then + begin + Result := True; + Exit; + end; + end; +end; + +function TcxSchedulerCachedEventList.CreateControlEvent( + AEvent: TcxSchedulerEvent): TcxSchedulerControlEvent; +begin + Result := inherited CreateControlEvent(AEvent); + Result.FTimeBias := FTimeBias; +end; + +function TcxSchedulerCachedEventList.CreateCloneList: TcxSchedulerFilteredEventList; +begin + Result := TcxSchedulerFilteredEventList.Create; +end; + +function TcxSchedulerCachedEventList.CreateSelection: TcxSchedulerEventSelection; +begin + Result := TcxSchedulerEventSelection.Create(Self); +end; + +procedure TcxSchedulerCachedEventList.DoClear(AFreeItems: Boolean); +begin + if FClones <> nil then + FClones.DestroyItems; + inherited DoClear(True); +end; + +procedure TcxSchedulerCachedEventList.EventAdded( + AEvent: TcxSchedulerEvent); +begin + TcxSchedulerControlEvent(AEvent).SelectionAdapter := Self; + inherited EventAdded(AEvent); +end; + +procedure TcxSchedulerCachedEventList.Init( + const AStart, AFinish: TDateTime; AStorage: TcxCustomSchedulerStorage); +begin + FHasClones := (FClones <> nil) and (FClones.Count > 0); + if FExpandedTimeRange then + inherited Init(Min(AStart, FMinNecessaryDate), Max(AFinish, FMaxNecessaryDate), AStorage) + else + inherited Init(AStart, AFinish, AStorage); + with DateTimeHelper do + begin + if Storage.StoreUsingGlobalTime then + FTimeBias := TimeZoneBias(FTimeZone) + else + FTimeBias := TimeZoneBias(FTimeZone) - TimeZoneBias(CurrentTimeZone); + end; +end; + +procedure TcxSchedulerCachedEventList.InternalPost( + AEvent: TcxSchedulerControlEvent; ACopy: Boolean); +begin + if AEvent.EventType = etNone then + PostCloneForSimpleEvent(AEvent, ACopy, etNone) + else + PostCloneForRecurrenceEvent(AEvent, ACopy); +end; + +function TcxSchedulerCachedEventList.IsDayNoneEmpty(ADay: Integer): Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to Count - 1 do + begin + Result := Items[I].IsDayEvent(ADay); + if Result then Break; + end; +end; + +function TcxSchedulerCachedEventList.IsIntersect( + AEvent1, AEvent2: TcxSchedulerEvent): Boolean; +begin + Result := not (AEvent1.IsFreeState or AEvent2.IsFreeState); + if Result then + Result := (((AEvent1.Start < AEvent2.Finish) and (AEvent2.Start < AEvent1.Finish)) or + ((AEvent2.Start < AEvent1.Finish) and (AEvent1.Start < AEvent2.Finish))); + if Result then + Result := (VarIsNull(AEvent2.ResourceID) or AEvent1.IsSharedWithResource(AEvent2.ResourceID)) or + (VarIsNull(AEvent1.ResourceID) or AEvent2.IsSharedWithResource(AEvent1.ResourceID)); + Result := Result and Storage.HasEventIntersect(AEvent2, AEvent1); +end; + +function TcxSchedulerCachedEventList.IsSelected( + AEvent: TcxSchedulerControlEvent): Boolean; +begin + Result := AEvent.IsClone or (Selection.IsSelected(AEvent) and + (AlwaysShowSelectedEvent or (FClones.Count = 0))); +end; + +procedure TcxSchedulerCachedEventList.PopulateAbsoluteItems; +var + I: Integer; + AEvent: TcxSchedulerEvent; +begin + FAbsoluteItems.Count := 0; + FAbsoluteItems.Capacity := GetAbsoluteCountInternal; + for I := 0 to GetAbsoluteCountInternal - 1 do + begin + AEvent := GetAbsoluteItemInternal(I); + if not CheckEventTimeRange or ((AEvent.Start <= SelFinish) and (SelStart <= AEvent.Finish)) then + FAbsoluteItems.Add(GetAbsoluteItemInternal(I)); + end; +end; + +procedure TcxSchedulerCachedEventList.PostCloneForRecurrenceEvent( + AEvent: TcxSchedulerControlEvent; ACopy: Boolean); +const + ANewType: array[Boolean] of TcxEventType = (etCustom, etNone); +begin + if not ACopy and (AEvent.EventType = etOccurrence) then + PostCloneForSimpleEvent(AEvent, True, etCustom) + else + PostCloneForSimpleEvent(AEvent, ACopy, ANewType[ACopy]); +end; + +procedure TcxSchedulerCachedEventList.PostCloneForSimpleEvent( + AEvent: TcxSchedulerControlEvent; ACopy: Boolean; AType: TcxEventType); +var + AStorageEvent: TcxSchedulerEvent; +begin + AEvent.EventType := AType; + if ACopy then + begin + if AEvent.IsClone then + TcxSchedulerControlEvent(AEvent.Source).FSource := Storage.CreateEvent + else + AEvent.FSource := Storage.CreateEvent; + end; + if AEvent.IsClone then + AStorageEvent := TcxSchedulerControlEvent(AEvent.Source).Source + else + AStorageEvent := AEvent.Source; + AStorageEvent.FPattern := AEvent.FPattern; + AStorageEvent.BeginEditing; + try + AStorageEvent.Assign(AEvent); + AStorageEvent.MoveTo(AEvent.Start + AEvent.TimeBias - Storage.TimeBias); + if AType <> etNone then + AStorageEvent.ParentID := AEvent.Pattern.ID; + finally + AStorageEvent.EndEditing; + AStorageEvent.Post; + end; +end; + +procedure TcxSchedulerCachedEventList.PostNewEvent( + AEvent: TcxSchedulerControlEvent); +begin + AEvent.FTimeBias := -FTimeBias; + FBeforePostCount := Count - 1; + FNewEvent := Storage.CreateEvent; + try + FNewEvent.Assign(AEvent); + FNewEvent.Post; + except + FNewEvent := nil; + raise; + end; +end; + +procedure TcxSchedulerCachedEventList.SelectionAdd( + AEvent: TcxSchedulerControlEvent; Shift: TShiftState); +begin + Selection.Add(AEvent, Shift); +end; + +procedure TcxSchedulerCachedEventList.SelectionClear; +begin + Selection.Clear; +end; + +procedure TcxSchedulerCachedEventList.SelectionUpdate; +begin + Selection.Update; +end; + +function TcxSchedulerCachedEventList._AddRef: Integer; +begin + Result := -1; +end; + +function TcxSchedulerCachedEventList._Release: Integer; +begin + Result := -1; +end; + +function TcxSchedulerCachedEventList.QueryInterface( + const IID: TGUID; out Obj): HResult; +const + E_NOINTERFACE = HResult($80004002); +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +function TcxSchedulerCachedEventList.GetAbsoluteCount: Integer; +begin + Result := FAbsoluteItems.Count; +end; + +function TcxSchedulerCachedEventList.GetAbsoluteItem( + AIndex: Integer): TcxSchedulerControlEvent; +begin + Result := TcxSchedulerControlEvent(FAbsoluteItems.List^[AIndex]) +end; + +function TcxSchedulerCachedEventList.GetAbsoluteCountInternal: Integer; +begin + Result := Count + FClones.Count; +end; + +function TcxSchedulerCachedEventList.GetAbsoluteItemInternal( + AIndex: Integer): TcxSchedulerControlEvent; +begin + if AIndex >= Count then + Result := TcxSchedulerControlEvent(FClones.Items[AIndex - Count]) + else + Result := Items[AIndex]; +end; + +function TcxSchedulerCachedEventList.GetItem( + AIndex: Integer): TcxSchedulerControlEvent; +begin + Result := TcxSchedulerControlEvent(FItems.List^[AIndex]) +end; + +procedure TcxSchedulerCachedEventList.SetSelFinish(const AValue: TDateTime); +begin + FSelFinish := AValue; + if FExpandedTimeRange then + FSelFinish := Max(FSelFinish, FMaxNecessaryDate); +end; + +procedure TcxSchedulerCachedEventList.SetSelStart(const AValue: TDateTime); +begin + FSelStart := AValue; + if FExpandedTimeRange then + FSelStart := Min(FSelStart, FMinNecessaryDate); +end; + +{ TcxSchedulerOccurrenceCalculator } + +constructor TcxSchedulerOccurrenceCalculator.Create( + AEvent: TcxSchedulerEvent; const AStart, AFinish: TDateTime; + ACalcForReminders: Boolean = False); +begin + FCalcForReminders := ACalcForReminders; + FWorkDays := DateTimeHelper.WorkDays; + FStartOfWeek := DateTimeHelper.StartOfWeek; + FEvent := AEvent; + FVisibleStart := AStart; + FVisibleFinish := AFinish; + FRecurCount := FEvent.RecurrenceInfo.Count; + InitTimes; + FDayNumber := FEvent.RecurrenceInfo.DayNumber; + FDayType := FEvent.RecurrenceInfo.DayType; + FOccurDays := FEvent.RecurrenceInfo.OccurDays; + FPeriodicity := FEvent.RecurrenceInfo.Periodicity; + FRecurrence := Event.RecurrenceInfo.Recurrence; + FYearPeriodicity := Event.RecurrenceInfo.YearPeriodicity; +end; + +procedure TcxSchedulerOccurrenceCalculator.CalcOccurrence(AIndex: Integer); +begin + InitTimes; + FFinishDate := cxMaxDate; + FRecurCount := -1; + while (AIndex > 0) and GetNextOccurrence do + Dec(AIndex); +end; + +procedure TcxSchedulerOccurrenceCalculator.CalcNearestOccurrenceIntervals( + AStart, AFinish: TDateTime; var AnIntervalBefore, AnIntervalAfter: TDateTime); + + function OccurrenceExists: Boolean; + var + AOccurence: TcxSchedulerEvent; + begin + Result := not (FEvent.GetOccurrenceByIndex(FIndex, AOccurence) and + (AOccurence.EventType in [etException, etCustom])); + end; + +begin + InitTimes; + AnIntervalBefore := cxMaxDateTime; + while GetNextOccurrence and (FOccurrenceFinish < AStart) do + if IsValidOccurrence and OccurrenceExists then + AnIntervalBefore := AStart - FOccurrenceStart; + AnIntervalAfter := cxMaxDateTime; + if IsValidOccurrence then + begin + InitTimes; + while GetNextOccurrence and (FOccurrenceStart <= AFinish) do; + if IsValidOccurrence and (FOccurrenceStart > AFinish) then + begin + if OccurrenceExists then + AnIntervalAfter := FOccurrenceStart - AFinish + else + begin + while GetNextOccurrence and not OccurrenceExists do; + if IsValidOccurrence then + AnIntervalAfter := FOccurrenceStart - AFinish; + end; + end; + end; +end; + +function TcxSchedulerOccurrenceCalculator.GetNextOccurrence: Boolean; +begin + FDate := Trunc(FOccurrenceStart); + case FRecurrence of + cxreWeekly: + begin + FWeekStart := FDate - (DayOfWeek(FDate) - 1) + StartOfWeek; + if FWeekStart > FDate then Dec(FWeekStart, 7); + end; + cxreMonthly: + DecodeDate(FDate, FYear, FMonth, FDay); + cxreYearly: + begin + DecodeDate(FDate, FYear, FMonth, FDay); + FMonth := FPeriodicity; + end; + end; + repeat + //DELPHI8! check Trunc() + if (FIndex = - 1) then + CalcFirstDate + else + CalcNextDate; + FOccurrenceFinish := FDate + (FOccurrenceFinish - DateOf(FOccurrenceStart)); + FOccurrenceStart := FDate + TimeOf(FOccurrenceStart); + Inc(FIndex); + until (not FCalcForReminders and (DateOf(FOccurrenceStart) >= DateOf(FVisibleStart))) or + (FCalcForReminders and (DateOf(FOccurrenceStart) >= DateOf(FActualStart))); + Result := IsValidOccurrence; +end; + +function TcxSchedulerOccurrenceCalculator.GetOccurrenceCount( + AEndDate: TDateTime): Integer; +begin + Result := 0; + FFinishDate := AEndDate; + FIndex := -1; + FRecurCount := -1; + while GetNextOccurrence do + Inc(Result); +end; + +procedure TcxSchedulerOccurrenceCalculator.CalcFirstDate; +begin + //DELPHI8! check Trunc() + FDate := Trunc(FActualStart); + case FRecurrence of + cxreDaily: + if FDayType in [cxdtWeekDay, cxdtWeekEndDay] then + FDate := GetSomeDay(FDate, 1, FDayType = cxdtWeekEndDay); + cxreWeekly: + begin + FWeekStart := FDate - (DayOfWeek(FDate) - 1) + StartOfWeek; + if FWeekStart > FDate then Dec(FWeekStart, 7); + FDate := GetDayFromOccurDays(FDate - 1, 1); + end; + cxreMonthly: + begin + DecodeDate(FDate, FYear, FMonth, FDay); + FDate := GetDayForMonth; + end; + cxreYearly: + begin + DecodeDate(FDate, FYear, FMonth, FDay); + FMonth := FPeriodicity; + FDate := GetDayForMonth; + if FDate < DateOf(FOccurrenceStart) then + begin + Inc(FYear); + FDate := GetDayForMonth; + end; + end; + end; +end; + +procedure TcxSchedulerOccurrenceCalculator.CalcNextDate; +var + ADay: Word; +begin + case FRecurrence of + cxreDaily: + if FDayType = cxdtEveryDay then + Inc(FDate, FPeriodicity) + else + FDate := GetSomeDay(FDate + 1, 1, FDayType = cxdtWeekEndDay); + cxreWeekly: + FDate := GetDayFromOccurDays(FDate, FPeriodicity); + cxreMonthly: + begin + IncAMonth(FYear, FMonth, ADay, FPeriodicity); + FDate := GetDayForMonth; + end; + cxreYearly: + begin + Inc(FYear, FYearPeriodicity); + FDate := GetDayForMonth; + end; + end; +end; + +function TcxSchedulerOccurrenceCalculator.GetCertainDay( + const ADate, ANumber: Integer; ADayType: TcxDayType): Integer; +var + AYear, AMonth, ADay: Word; + AOffset: Integer; +begin + DecodeDate(ADate, AYear, AMonth, ADay); + AOffset := Ord(ADayType) - Ord(cxdtSunDay) - (DayOfWeek(ADate - ADay + 1) - 1); + if AOffset < 0 then Inc(AOffset, 7); + Inc(AOffset, (ANumber - 1) * 7); + if AOffset > DaysInAMonth(AYear, AMonth) - 1 then Dec(AOffset, 7); + Result := ADate - ADay + 1 + AOffset; +end; + +function TcxSchedulerOccurrenceCalculator.GetDayForMonth: Integer; + + function GetADay(const ADate: Integer; ACondition: Boolean): Integer; + begin + if ACondition then + Result := ADate + DaysInAMonth(FYear, FMonth) + else + Result := ADate + FDayNumber; + end; + +begin + Result := Trunc(EncodeDate(FYear, FMonth, 1)) - 1; + case FDayType of + cxdtDay: + Result := GetADay(Result, FDayNumber > DaysInAMonth(FYear, FMonth)); + cxdtEveryDay: + Result := GetADay(Result, FDayNumber = 5); + cxdtWeekDay, cxdtWeekEndDay: + Result := GetSomeDay(Result + 1, FDayNumber, FDayType = cxdtWeekEndDay); + cxdtSunday..cxdtSaturday: + Result := GetCertainDay(Result + 1, FDayNumber, FDayType); + end; +end; + +function TcxSchedulerOccurrenceCalculator.GetDayFromOccurDays( + const APrevDate, APeriodicity: Integer): Integer; +var + ADelta: Integer; + ADay: TDay; +begin + repeat + for ADelta := 0 to 6 do + begin + ADay := TDay(StartOfWeek + ADelta - 7 * Byte(StartOfWeek + ADelta > 6)); + if ADay in FOccurDays then + begin + Result := FWeekStart + ADelta; + if Result > APrevDate then Exit; + end; + end; + Inc(FWeekStart, 7 * APeriodicity); + until False; +end; + +function TcxSchedulerOccurrenceCalculator.GetSomeDay( + const ADate, ANumber: Integer; AWeekEnd: Boolean): Integer; +var + AYear, AMonth, ADay: Word; + I: Integer; +begin + if ANumber = 5 then + begin + DecodeDate(ADate, AYear, AMonth, ADay); + Result := ADate - ADay + DaysInAMonth(AYear, AMonth); + while not (AWeekEnd xor (TDay(DayOfWeek(Result) - 1) in WorkDays)) do + Dec(Result); + end + else + begin + Result := ADate; + I := 1; + repeat + while not (AWeekEnd xor (TDay(DayOfWeek(Result) - 1) in WorkDays)) do + Inc(Result); + if ANumber = I then Break; + Inc(Result); + Inc(I); + until False; + end; +end; + +procedure TcxSchedulerOccurrenceCalculator.InitTimes; +begin + if FRecurCount = 0 then + FFinishDate := FEvent.RecurrenceInfo.Finish + else + FFinishDate := VisibleFinish; + FOccurrenceStart := FEvent.Start; + FOccurrenceFinish := FOccurrenceStart + FEvent.Duration; + if (FEvent.EventType <> etPattern) and (FEvent.Pattern <> nil) then + begin + FOccurrenceStart := FEvent.Pattern.Start; + FOccurrenceFinish := FOccurrenceStart + FEvent.Pattern.Duration; + end; + FActualStart := FOccurrenceStart; + FIndex := -1; +end; + +function TcxSchedulerOccurrenceCalculator.IsValidOccurrence: Boolean; +begin + Result := ((FRecurCount > 0) and (FIndex < FRecurCount)) or + ((FRecurCount <= 0) and + ((DateOf(FOccurrenceStart) <= FFinishDate) or + (FCalcForReminders and (DateOf(FOccurrenceStart) - 14 <= FFinishDate)))); +end; + +{ TcxSchedulerContentNavigationInfo } + +constructor TcxSchedulerContentNavigationInfo.Create(AResourceID: Variant); +begin + FResourceID := AResourceID; + FIntervalBefore := cxMaxDateTime; + FIntervalAfter := cxMaxDateTime; +end; + +{ TcxSchedulerContentNavigationCalculator } + +class procedure TcxSchedulerContentNavigationCalculator.FindNavigationIntervals( + AStorage: TcxCustomSchedulerStorage; + AContentNavigationInfo: TObjectList; AStart, AFinish: TDateTime; + AWithoutResources: Boolean; AShowEventsWithoutResource: Boolean); + + procedure ProcessEventsWithoutResource(AnEventIndex: Integer); + begin + if AShowEventsWithoutResource and + not IsEventSharedWithAnyResource(AStorage, AnEventIndex, False) or + (AStorage.ResourceCount = 0) then + CalcIntervals(AStorage.FEventsList[AnEventIndex], + TcxSchedulerContentNavigationInfo(AContentNavigationInfo[AContentNavigationInfo.Count - 1]), + AStart, AFinish); + end; + + procedure WithResources; + var + AnEventIndex, AResourceIndex, AResourceInfoCount: Integer; + begin + for AnEventIndex := 0 to AStorage.FEventsList.Count - 1 do + begin + AResourceIndex := 0; + AResourceInfoCount := AContentNavigationInfo.Count - IfThen(AShowEventsWithoutResource, 1); + while AResourceIndex < AResourceInfoCount do + begin + if AStorage.FEventsList[AnEventIndex].IsSharedWithResource( + TcxSchedulerContentNavigationInfo(AContentNavigationInfo[AResourceIndex]).FResourceID) then + CalcIntervals(AStorage.FEventsList[AnEventIndex], + TcxSchedulerContentNavigationInfo(AContentNavigationInfo[AResourceIndex]), + AStart, AFinish); + Inc(AResourceIndex); + end; + ProcessEventsWithoutResource(AnEventIndex); + end; + end; + + procedure WithoutResources; + var + AnEventIndex: Integer; + begin + for AnEventIndex := 0 to AStorage.FEventsList.Count - 1 do + begin + if IsEventSharedWithAnyResource(AStorage, AnEventIndex, True) then + CalcIntervals(AStorage.FEventsList[AnEventIndex], + TcxSchedulerContentNavigationInfo(AContentNavigationInfo[0]), + AStart, AFinish); + ProcessEventsWithoutResource(AnEventIndex); + end; + end; + +begin + if (AStorage = nil) or (AContentNavigationInfo = nil) then + Exit; + if AShowEventsWithoutResource or + (AContentNavigationInfo.Count = 0) and (AStorage.ResourceCount = 0) then + AContentNavigationInfo.Add(TcxSchedulerContentNavigationInfo.Create(0)); + if not AWithoutResources then + WithResources + else + WithoutResources; + if AShowEventsWithoutResource then + begin + ChangeResourceNavigationIntervals(AContentNavigationInfo); + AContentNavigationInfo.Delete(AContentNavigationInfo.Count - 1); + end; +end; + +class procedure TcxSchedulerContentNavigationCalculator.CalcAppointmentIntervals( + AnEvent: TcxSchedulerEvent; AInfo: TcxSchedulerContentNavigationInfo; + AStart, AFinish: TDateTime); +var + ANewInterval: TDateTime; +begin + if AnEvent.Start < AStart then + ANewInterval := AStart - AnEvent.Start + else + ANewInterval := cxMaxDateTime; + AInfo.FIntervalBefore := Min(AInfo.FIntervalBefore, ANewInterval); + + if AFinish < AnEvent.Start then + ANewInterval := AnEvent.Start - AFinish + else + ANewInterval := cxMaxDateTime; + AInfo.FIntervalAfter := Min(AInfo.FIntervalAfter, ANewInterval); +end; + +class procedure TcxSchedulerContentNavigationCalculator.CalcIntervals( + AnEvent: TcxSchedulerEvent; AInfo: TcxSchedulerContentNavigationInfo; + AStart, AFinish: TDateTime); +begin + case AnEvent.EventType of + etNone: CalcAppointmentIntervals(AnEvent, AInfo, AStart, AFinish); + etOccurrence, etCustom: + if AnEvent.Pattern <> nil then + CalcAppointmentIntervals(AnEvent, AInfo, AStart, AFinish); + etPattern: CalcPatternIntervals(AnEvent, AInfo, AStart, AFinish); + end; +end; + +class procedure TcxSchedulerContentNavigationCalculator.CalcPatternIntervals( + AnEvent: TcxSchedulerEvent; AInfo: TcxSchedulerContentNavigationInfo; + AStart, AFinish: TDateTime); +var + AOccurrenceCalculator: TcxSchedulerOccurrenceCalculator; + ANewIntervalAfter, ANewIntervalBefore: TDateTime; +begin + AOccurrenceCalculator := + TcxSchedulerOccurrenceCalculator.Create(AnEvent, DateOf(cxMinDateTime), cxMaxDate); + try + AOccurrenceCalculator.CalcNearestOccurrenceIntervals(AStart, AFinish, + ANewIntervalBefore, ANewIntervalAfter); + finally + AOccurrenceCalculator.Free; + end; + AInfo.FIntervalBefore := Min(AInfo.FIntervalBefore, ANewIntervalBefore); + AInfo.FIntervalAfter := Min(AInfo.FIntervalAfter, ANewIntervalAfter); +end; + +class procedure TcxSchedulerContentNavigationCalculator.ChangeResourceNavigationIntervals( + AContentNavigationInfo: TObjectList); +var + I: Integer; + ABefore, AnAfter: TDateTime; +begin + ABefore := TcxSchedulerContentNavigationInfo( + AContentNavigationInfo[AContentNavigationInfo.Count - 1]).FIntervalBefore; + AnAfter := TcxSchedulerContentNavigationInfo( + AContentNavigationInfo[AContentNavigationInfo.Count - 1]).FIntervalAfter; + for I := 0 to AContentNavigationInfo.Count - 2 do + begin + TcxSchedulerContentNavigationInfo(AContentNavigationInfo[I]).FIntervalBefore := + Min(TcxSchedulerContentNavigationInfo(AContentNavigationInfo[I]).FIntervalBefore, + ABefore); + TcxSchedulerContentNavigationInfo(AContentNavigationInfo[I]).FIntervalAfter := + Min(TcxSchedulerContentNavigationInfo(AContentNavigationInfo[I]).FIntervalAfter, + AnAfter); + end; +end; + +class function TcxSchedulerContentNavigationCalculator.IsEventSharedWithAnyResource( + AStorage: TcxCustomSchedulerStorage; AnEventIndex: Integer; + ConsiderVisibility: Boolean): Boolean; +var + AResourceIndex: Integer; + AnEvent: TcxSchedulerEvent; +begin + AnEvent := AStorage.FEventsList[AnEventIndex]; + AResourceIndex := 0; + Result := False; + while not Result and (AResourceIndex < AStorage.ResourceCount) do + begin + Result := AnEvent.IsSharedWithResource(AStorage.ResourceIDs[AResourceIndex]) and + (not ConsiderVisibility or AStorage.Resources.Items[AResourceIndex].Visible); + Inc(AResourceIndex); + end; +end; + +{ TcxSchedulerCustomReminderForm } + +constructor TcxSchedulerCustomReminderForm.Create( + AReminders: TcxSchedulerReminders); +begin + inherited Create(nil); + FReminders := AReminders; +end; + +destructor TcxSchedulerCustomReminderForm.Destroy; +begin + Reminders.FReminderWindow := nil; + inherited Destroy; +end; + +procedure TcxSchedulerCustomReminderForm.CheckFormPosition; +var + X, Y: Integer; + ACenterForm: TCustomForm; +begin + if Position = poScreenCenter then + begin + X := (Screen.Width - Width) div 2; + Y := (Screen.Height - Height) div 2; + if X < Screen.DesktopLeft then + X := Screen.DesktopLeft; + if Y < Screen.DesktopTop then + Y := Screen.DesktopTop; + SetBounds(X, Y, Width, Height); + end + else if Position in [poMainFormCenter, poOwnerFormCenter] then + begin + ACenterForm := Application.MainForm; + if (Position = poOwnerFormCenter) and (Owner is TCustomForm) then + ACenterForm := TCustomForm(Owner); + if Assigned(ACenterForm) then + begin + X := ((ACenterForm.Width - Width) div 2) + ACenterForm.Left; + Y := ((ACenterForm.Height - Height) div 2) + ACenterForm.Top; + end + else + begin + X := (Screen.Width - Width) div 2; + Y := (Screen.Height - Height) div 2; + end; + if X < 0 then X := 0; + if Y < 0 then Y := 0; + SetBounds(X, Y, Width, Height); + end + else if Position = poDesktopCenter then + begin + X := ((Screen.DesktopWidth div 2) + Screen.DesktopLeft - (Width div 2)); + Y := ((Screen.DesktopHeight div 2) + Screen.DesktopTop - (Height div 2)); + if X < Screen.DesktopLeft then X := Screen.DesktopLeft; + if Y < Screen.DesktopTop then Y := Screen.DesktopTop; + SetBounds(X, Y, Width, Height); + end; +end; + +procedure TcxSchedulerCustomReminderForm.CreateParams( + var Params: TCreateParams); +begin + inherited CreateParams(Params); + Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW; +end; + +procedure TcxSchedulerCustomReminderForm.DoClose(var Action: TCloseAction); +begin + inherited DoClose(Action); + if Action = caHide then Action := caFree; + Reminders.DoHideReminderWindow; + cxDialogsMetricsStore.StoreMetrics(Self); +end; + +procedure TcxSchedulerCustomReminderForm.DoShow; +begin + SetControlLookAndFeel(Self, Reminders.ReminderWindowLookAndFeel); + if UseSchedulerColorInDialogs then + Color := GetFormColor; + UpdateReminderList; + inherited DoShow; + Reminders.DoShowReminderWindow; +end; + +procedure TcxSchedulerCustomReminderForm.FlashCaption; +var + AFlashInfo: TFlashWInfo; +begin + if Assigned(FlashWindowExProc) then + begin + AFlashInfo.cbSize := SizeOf(TFlashWInfo); + AFlashInfo.hwnd := Handle; + AFlashInfo.uCount := 1; + AFlashInfo.dwFlags := FLASHW_ALL; + AFlashInfo.dwTimeout := 1000; + FlashWindowExProc(AFlashInfo); + end + else + FlashWindow(Handle, True); +end; + +function TcxSchedulerCustomReminderForm.GetFormColor: TColor; +begin + Result := Reminders.ReminderWindowLookAndFeel.Painter.DefaultSchedulerControlColor; +end; + +function TcxSchedulerCustomReminderForm.IsLocked: Boolean; +begin + Result := (csDestroying in ComponentState) or + (Reminders.Storage.ComponentState * [csLoading, csDestroying] <> []) + or Reminders.NeedRestoreSelection or Reminders.IsLocked; +end; + +procedure TcxSchedulerCustomReminderForm.LayoutChanged; +begin +end; + +procedure TcxSchedulerCustomReminderForm.OpenEvent( + AEvent: TcxSchedulerControlEvent); +begin + Reminders.DoOpenEvent(AEvent); +end; + +function TcxSchedulerCustomReminderForm.OpenEventSupported: Boolean; +begin + Result := Assigned(Reminders.FOnOpenEvent); +end; + +procedure TcxSchedulerCustomReminderForm.RestoreSelection; +begin +end; + +procedure TcxSchedulerCustomReminderForm.SaveSelection; +begin +end; + +procedure TcxSchedulerCustomReminderForm.ShowInactive; +begin + if not Visible then + begin + cxDialogsMetricsStore.InitDialog(Self); + CheckFormPosition; + if Application.Active then + begin + ShowWindow(Handle, SW_SHOWNA); + Visible := True; + end + else + Show; + end + else + ShowWindow(Handle, SW_SHOWNA); + FlashCaption; +end; + +procedure TcxSchedulerCustomReminderForm.UpdateReminderList; +begin +end; + +procedure TcxSchedulerCustomReminderForm.UpdateSelectionCaptions; +begin + Caption := Reminders.GetReminderWindowCaption; +end; + +function TcxSchedulerCustomReminderForm.GetStorage: TcxCustomSchedulerStorage; +begin + Result := Reminders.Storage; +end; + +{ TcxSchedulerReminderEventID } + +constructor TcxSchedulerReminderEventID.Create(AEvent: TcxSchedulerControlEvent); +var + I: Integer; +begin + SetLength(Values, AEvent.ValueCount); + for I := Low(Values) to High(Values) do + begin + if AEvent.Storage.Fields[I].IsUnique then + Values[I] := AEvent.Values[I] + else + Values[I] := Null; + end; + ID := AEvent.FSavedID; + ParentID := AEvent.ParentID; + RecurrenceIndex := AEvent.RecurrenceIndex; +end; + +destructor TcxSchedulerReminderEventID.Destroy; +begin + Values := nil; + inherited Destroy; +end; + +function TcxSchedulerReminderEventID.SameEvent( + AEvent: TcxSchedulerControlEvent): Boolean; +var + I: Integer; +begin + Result := inherited SameEvent(AEvent); + if Result then + for I := Low(Values) to High(Values) do + if AEvent.Storage.Fields[I].IsUnique and not VarEquals(AEvent.Values[I], Values[I]) then + begin + Result := False; + Break; + end; +end; + +{ TcxSchedulerEventReminders } + +constructor TcxSchedulerEventReminders.Create(AEvent: TcxSchedulerControlEvent); +begin + inherited Create; + EventID := TcxSchedulerReminderEventID.Create(AEvent); +end; + +destructor TcxSchedulerEventReminders.Destroy; +begin + Reminders := nil; + EventID.Free; + inherited Destroy; +end; + +procedure TcxSchedulerEventReminders.AddReminder(AReminder: TcxSchedulerReminder); +begin + SetLength(Reminders, Length(Reminders) + 1); + Reminders[High(Reminders)] := AReminder; + AReminder.FEventReminders := Self; +end; + +function TcxSchedulerEventReminders.Find(AReminderDate: TDateTime; + const AResourceID: Variant): TcxSchedulerReminder; +var + I: Integer; + AReminder: TcxSchedulerReminder; +begin + Result := nil; + for I := Low(Reminders) to High(Reminders) do + begin + AReminder := Reminders[I]; + if (AReminder.ReminderDate = AReminderDate) and VarEquals(AReminder.ResourceID, AResourceID) then + begin + Result := AReminder; + Break; + end; + end; +end; + +procedure TcxSchedulerEventReminders.FreeReminderByIndex(AIndex: Integer); +var + I: Integer; +begin + Reminders[AIndex].Free; + for I := AIndex + 1 to High(Reminders) do + Reminders[I - 1] := Reminders[I]; + SetLength(Reminders, Length(Reminders) - 1); +end; + +procedure TcxSchedulerEventReminders.FreeReminders; +var + I: Integer; +begin + for I := Low(Reminders) to High(Reminders) do + Reminders[I].Free; + Reminders := nil; +end; + +procedure TcxSchedulerEventReminders.Invalidate; +var + I: Integer; +begin + FInvalid := True; + for I := Low(Reminders) to High(Reminders) do + Reminders[I].Invalid := True; +end; + +function TcxSchedulerEventReminders.IsValid: Boolean; +begin + Result := not FInvalid and (Length(Reminders) > 0); +end; + +procedure TcxSchedulerEventReminders.RemoveInvalidReminders; +var + I: Integer; +begin + for I := High(Reminders) downto Low(Reminders) do + if Reminders[I].Invalid then + FreeReminderByIndex(I); +end; + +procedure TcxSchedulerEventReminders.Validate; +begin + RemoveInvalidReminders; + FInvalid := False; +end; + +{ TcxSchedulerEventRemindersList } + +function TcxSchedulerEventRemindersList.CreateEventReminders( + AEvent: TcxSchedulerControlEvent): TcxSchedulerEventReminders; +begin + Result := TcxSchedulerEventReminders.Create(AEvent); + Add(Result); +end; + +function TcxSchedulerEventRemindersList.FindForEvent( + AEvent: TcxSchedulerControlEvent): TcxSchedulerEventReminders; +var + I: Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + if Items[I].EventID.SameEvent(AEvent) then + begin + Result := Items[I]; + Break; + end; +end; + +procedure TcxSchedulerEventRemindersList.Invalidate; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].Invalidate; +end; + +procedure TcxSchedulerEventRemindersList.Remove(AEventReminders: TcxSchedulerEventReminders); +begin + AEventReminders.FreeReminders; + inherited Remove(AEventReminders); +end; + +procedure TcxSchedulerEventRemindersList.RemoveInvalidItems; +var + I: Integer; +begin + for I := Count - 1 downto 0 do + if not Items[I].IsValid then + Remove(Items[I]); +end; + +function TcxSchedulerEventRemindersList.GetItem(AIndex: Integer): TcxSchedulerEventReminders; +begin + Result := TcxSchedulerEventReminders(inherited Items[AIndex]); +end; + +{ TcxSchedulerReminder } + +constructor TcxSchedulerReminder.Create( + AOwner: TcxSchedulerReminders; + AEvent: TcxSchedulerControlEvent); +begin + inherited Create; + FOwner := AOwner; + FEvent := AEvent; +end; + +destructor TcxSchedulerReminder.Destroy; +begin + with Owner.FItems do if not Clearing then Remove(Self); + inherited Destroy; +end; + +procedure TcxSchedulerReminder.Dismiss; +begin + DoDismiss; +end; + +procedure TcxSchedulerReminder.Snooze(ASnoozeTime: TDateTime); +begin + DoSnooze(ASnoozeTime); +end; + +procedure TcxSchedulerReminder.ClearReminder; +begin + if Event.EventType in [etCustom, etNone] then + Event.Source.Reminder := False + else + Event.Pattern.RecurrenceInfo.DismissDate := DateOf(Event.Start) + 1; + Event.Reminder := False; +end; + +procedure TcxSchedulerReminder.DismissEvent; +begin + if Owner.IsReminderByResourceAvailable and Event.Shared then + DismissEventForResource + else + ClearReminder; +end; + +procedure TcxSchedulerReminder.DismissEventForResource; +var + AData: TcxSchedulerReminderResourcesData; + AReminderResources, ANewReminderResources: TcxSchedulerReminderResources; + I, J, AIndex: Integer; +begin + AData := GetResourcesData; + AReminderResources := AData.Resources; + for I := Low(AReminderResources) to High(AReminderResources) do + if VarEqualsSoftEx(AReminderResources[I].ResourceID, ResourceID) then + begin + if Event.EventType in [etCustom, etNone, etPattern] then + begin + if Length(AReminderResources) > 1 then + begin + SetLength(ANewReminderResources, Length(AReminderResources) - 1); + AIndex := 0; + for J := Low(AReminderResources) to High(AReminderResources) do + if I <> J then + begin + ANewReminderResources[AIndex] := AReminderResources[J]; + Inc(AIndex); + end; + AData.Resources := ANewReminderResources; + Event.Source.ReminderResourcesData := AData; + Event.Reminder := False; + end + else + ClearReminder; + end + else + begin + AData.Resources[I].DismissDate := DateOf(Event.Start) + 1; + Event.Pattern.ReminderResourcesData := AData; + Event.Reminder := False; + end; + Break; + end; +end; + +procedure TcxSchedulerReminder.DoDismiss; +begin + if not Owner.DoDismissReminder(Self) then + DismissEvent; +end; + +procedure TcxSchedulerReminder.DoSnooze(var ASnoozeTime: TDateTime); +begin + if not Owner.DoSnoozeReminder(Self, ASnoozeTime) then + SnoozeEvent(ASnoozeTime); +end; + +procedure TcxSchedulerReminder.SetData(const AResourceID: Variant; AReminderDate: TDateTime); +begin + FReminderDate := AReminderDate; + FResourceID := AResourceID; +end; + +procedure TcxSchedulerReminder.SnoozeEvent(const ASnoozeTime: TDateTime); +var + ATime: TDateTime; +begin + if ASnoozeTime > 0 then + ATime := DateTimeHelper.RoundTime(Owner.GetNow + Max(ASnoozeTime, MinuteToTime)) + else + begin + ATime := DateTimeHelper.RoundTime(Event.Start + ASnoozeTime); + if ATime <= Owner.GetNow then Exit; + end; + if Owner.IsReminderByResourceAvailable and Event.Shared then + SnoozeEventForResource(ATime) + else + begin + if Event.EventType in [etCustom, etNone] then + Event.Source.ReminderDate := ATime + else + begin + Event.Pattern.BeginEditing; + Event.Pattern.ReminderDate := ATime; + Event.Pattern.RecurrenceInfo.DismissDate := DateOf(ATime) - MinuteToTime; + Event.Pattern.EndEditing; + Event.Pattern.Post; + end; + Event.ReminderDate := ATime; + end; +end; + +procedure TcxSchedulerReminder.SnoozeEventForResource(const ATime: TDateTime); +var + AData: TcxSchedulerReminderResourcesData; + I: Integer; +begin + AData := GetResourcesData; + for I := Low(AData.Resources) to High(AData.Resources) do + if VarEqualsSoftEx(AData.Resources[I].ResourceID, ResourceID) then + begin + AData.Resources[I].ReminderDate := ATime; + AData.Resources[I].DismissDate := DateOf(ATime) - MinuteToTime; + if Event.EventType in [etCustom, etNone] then + Event.Source.ReminderResourcesData := AData + else + Event.Pattern.ReminderResourcesData := AData; + Event.ReminderDate := ATime; + Break; + end; +end; + +procedure TcxSchedulerReminder.Validate(AEvent: TcxSchedulerControlEvent); +begin + FInvalid := False; + FEvent := AEvent; +end; + +function TcxSchedulerReminder.GetResourcesData: TcxSchedulerReminderResourcesData; +begin + if Event.EventType = etOccurrence then + Result := Event.Pattern.ReminderResourcesData + else + Result := Event.Source.ReminderResourcesData; +end; + +{ TcxSchedulerReminderList } + +procedure TcxSchedulerReminderList.Clear; +var + I: Integer; +begin + FClearing := True; + try + for I := 0 to Count - 1 do Items[I].Free; + inherited Clear; + finally + FClearing := False; + end; +end; + +function TcxSchedulerReminderList.GetItem( + Index: Integer): TcxSchedulerReminder; +begin + Result := inherited Items[Index]; +end; + +{ TcxSchedulerReminders } + +constructor TcxSchedulerReminders.Create(AStorage: TcxCustomSchedulerStorage); +begin + inherited Create(AStorage); + FStorage := AStorage; + FDefaultMinutesBeforeStart := 15; + FUseReminderWindow := True; + FReminderWindowLookAndFeel := TcxLookAndFeel.Create(nil); + FEvents := TcxSchedulerFilteredEventList.Create; + FItems := TcxSchedulerReminderList.Create; + FEventRemindersList := TcxSchedulerEventRemindersList.Create; + FShowResourcesInReminderWindow := True; + CreateTimers; + Active := True; + cxFormatController.AddListener(Self); +end; + +destructor TcxSchedulerReminders.Destroy; +begin + cxFormatController.RemoveListener(Self); + FUpdateEventsTimer.Free; + FUpdateRemindersTimer.Free; + FreeAndNil(FReminderWindow); + FReminderWindowLookAndFeel.Free; + FEventRemindersList.Free; + FItems.Free; + FEvents.Free; + inherited Destroy; +end; + +procedure TcxSchedulerReminders.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerReminders then + with TcxSchedulerReminders(Source) do + begin + Self.Active := Active; + Self.DefaultReminder := DefaultReminder; + Self.DefaultMinutesBeforeStart := DefaultMinutesBeforeStart; + Self.ReminderByResource := ReminderByResource; + Self.ReminderWindowLookAndFeel := ReminderWindowLookAndFeel; + Self.ShowResourcesInReminderWindow := ShowResourcesInReminderWindow; + Self.UseReminderWindow := UseReminderWindow; + end; +end; + +procedure TcxSchedulerReminders.DismissAll; +var + I: Integer; +begin + if not HasReminders then Exit; + Storage.BeginUpdate; + try + for I := Count - 1 downto 0 do + Items[I].Dismiss; + finally + Storage.EndUpdate; + end; +end; + +procedure TcxSchedulerReminders.SnoozeAll(ASnoozeTime: TDateTime); +var + I: Integer; +begin + if not HasReminders then Exit; + Storage.BeginUpdate; + try + for I := Count - 1 downto 0 do + Items[I].Snooze(ASnoozeTime); + finally + Storage.EndUpdate; + end; +end; + +function TcxSchedulerReminders.GetEventDueTimeText( + AReminder: TcxSchedulerReminder; ATime: TDateTime): string; +var + ADueTimeInfo: TcxSchedulerReminderDueTimeInfo; + AMinutes: Integer; +begin + AMinutes := Trunc((AReminder.Event.Start - ATime) * MinsPerDay); + ADueTimeInfo := cxMinutesToDueTimeInfo(AMinutes); + if Assigned(cxDueTimeInfoToTextProc) then + Result := cxDueTimeInfoToTextProc(ADueTimeInfo) + else + Result := cxDueTimeInfoToText(ADueTimeInfo); + DoGetEventDueTimeText(AReminder, ADueTimeInfo, Result); +end; + +function TcxSchedulerReminders.HasReminders: Boolean; +begin + Result := FItems.Count > 0; +end; + +procedure TcxSchedulerReminders.HideReminderWindow; +begin + if IsReminderWindowShown then + ReminderWindow.Close; +end; + +function TcxSchedulerReminders.IsLocked: Boolean; +begin + with Storage do + Result := FIsLoading or (ComponentState * [csDesigning, csDestroying, csLoading] <> []) or IsLocked; +end; + +function TcxSchedulerReminders.IsReminderByResourceAvailable: Boolean; +begin + Result := ReminderByResource and Storage.IsReminderByResourceAvailable; +end; + +function TcxSchedulerReminders.IsReminderWindowShown: Boolean; +begin + Result := (ReminderWindow <> nil) and + not (csDestroying in ReminderWindow.ComponentState) and ReminderWindow.Showing; +end; + +procedure TcxSchedulerReminders.Refresh; +begin + if PopulateEventsCache then + RefreshReminders; +end; + +procedure TcxSchedulerReminders.FormatChanged; +begin +end; + +procedure TcxSchedulerReminders.TimeChanged; +begin + Refresh; +end; + +procedure TcxSchedulerReminders.AddReminder( + AEvent: TcxSchedulerControlEvent; const AResourceID: Variant; + AReminderDate: TDateTime; var AEventReminders: TcxSchedulerEventReminders); +var + AReminder: TcxSchedulerReminder; +begin + AReminder := GetReminderClass.Create(Self, AEvent); + AReminder.SetData(AResourceID, AReminderDate); + if not DoAlertReminder(AReminder) then + begin + FItems.Add(AReminder); + AddReminderToEventReminders(AReminder, AEventReminders); + FNeedShowWindow := UseReminderWindow; + end + else + AReminder.Free; +end; + +procedure TcxSchedulerReminders.AddReminderToEventReminders( + AReminder: TcxSchedulerReminder; + var AEventReminders: TcxSchedulerEventReminders); +begin + if AEventReminders = nil then + AEventReminders := FEventRemindersList.CreateEventReminders(AReminder.Event); + AEventReminders.AddReminder(AReminder); +end; + +procedure TcxSchedulerReminders.CheckAddReminder(AEvent: TcxSchedulerControlEvent; + const AResourceID: Variant; AReminderDate: TDateTime; + var AEventReminders: TcxSchedulerEventReminders); +begin + if IsNeedAddToReminders(AEvent, AReminderDate) then + AddReminder(AEvent, AResourceID, AReminderDate, AEventReminders); +end; + +procedure TcxSchedulerReminders.CheckAddReminders( + AEvent: TcxSchedulerControlEvent; AEventReminders: TcxSchedulerEventReminders); +var + I: Integer; + AIsOccurrence: Boolean; + AReminderResources: TcxSchedulerReminderResources; +begin + AReminderResources := nil; + if IsReminderByResourceAvailable and AEvent.Shared then + begin + AIsOccurrence := AEvent.EventType = etOccurrence; + AReminderResources := GetReminderResourcesFromEvent(AEvent, AIsOccurrence); + for I := Low(AReminderResources) to High(AReminderResources) do + with AReminderResources[I] do + begin + if not AIsOccurrence or (DateOf(GetNow) > DismissDate) then + CheckAddReminder(AEvent, ResourceID, ReminderDate, AEventReminders); + end; + end + else + CheckAddReminder(AEvent, AEvent.ResourceID, AEvent.ReminderDate, AEventReminders); +end; + +procedure TcxSchedulerReminders.CheckRemindersForEvent(AEvent: TcxSchedulerControlEvent); +var + AEventReminders: TcxSchedulerEventReminders; +begin + AEventReminders := FEventRemindersList.FindForEvent(AEvent); + if AEventReminders = nil then + CheckAddReminders(AEvent, AEventReminders) + else + ValidateRemindersForEvent(AEventReminders, AEvent); +end; + +function TcxSchedulerReminders.CreateReminderWindow: TcxSchedulerCustomReminderForm; +begin + if Assigned(cxReminderFormClass) then + Result := cxReminderFormClass.Create(Self) + else + Result := TcxSchedulerReminderForm.Create(Self); +end; + +function TcxSchedulerReminders.DoAlertReminder( + AReminder: TcxSchedulerReminder): Boolean; +begin + Result := False; + if Assigned(FOnAlertReminder) then + FOnAlertReminder(Self, AReminder, Result); +end; + +function TcxSchedulerReminders.DoDismissReminder( + AReminder: TcxSchedulerReminder): Boolean; +begin + Result := False; + if Assigned(FOnDismissReminder) then + FOnDismissReminder(Self, AReminder, Result); +end; + +procedure TcxSchedulerReminders.DoGetEventDueTimeText(AReminder: TcxSchedulerReminder; + const ADueTimeInfo: TcxSchedulerReminderDueTimeInfo; var AText: string); +begin + if Assigned(FOnGetEventDueTimeText) then + FOnGetEventDueTimeText(Self, AReminder, ADueTimeInfo, AText); +end; + +procedure TcxSchedulerReminders.DoGetReminderWindowCaption( + var ACaption: string); +begin + if Assigned(FOnGetReminderWindowCaption) then + FOnGetReminderWindowCaption(Self, ACaption); +end; + +procedure TcxSchedulerReminders.DoOpenEvent( + AEvent: TcxSchedulerControlEvent); +begin + if Assigned(FOnOpenEvent) then + FOnOpenEvent(Self, AEvent); +end; + +function TcxSchedulerReminders.DoSnoozeReminder( + AReminder: TcxSchedulerReminder; var ASnoozeTime: TDateTime): Boolean; +begin + Result := False; + if Assigned(FOnSnoozeReminder) then + FOnSnoozeReminder(Self, AReminder, ASnoozeTime, Result); +end; + +procedure TcxSchedulerReminders.DoHideReminderWindow; +begin + if Assigned(FOnHideReminderWindow) then + FOnHideReminderWindow(Self); +end; + +procedure TcxSchedulerReminders.DoShowReminderWindow; +begin + if Assigned(FOnShowReminderWindow) then + FOnShowReminderWindow(Self); +end; + +function TcxSchedulerReminders.GetFirstReminderTimeForEvent( + AEvent: TcxSchedulerEvent; ANow: TDateTime): TDateTime; +var + I: Integer; + AReminderResources: TcxSchedulerReminderResources; +begin + AReminderResources := nil; + if not (IsReminderByResourceAvailable and AEvent.Shared) then + Result := AEvent.ReminderDate + else + begin + AReminderResources := AEvent.ReminderResourcesData.Resources; + if Length(AReminderResources) = 0 then + Result := AEvent.ReminderDate + else + begin + Result := AReminderResources[Low(AReminderResources)].ReminderDate; + for I := Low(AReminderResources) + 1 to High(AReminderResources) do + if AReminderResources[I].ReminderDate > ANow then + Result := Min(Result, AReminderResources[I].ReminderDate); + end; + end; +end; + +function TcxSchedulerReminders.GetNextPopulateEventsCacheTime( + ANow: TDateTime; AIsLocked: Boolean): TDateTime; +begin + if not AIsLocked then + Result := DateOf(ANow) + 1 {one day lookaround} + else + Result := ANow + SecondToTime; {repeat in one second} +end; + +function TcxSchedulerReminders.GetNextRefreshRemindersTime( + ANow: TDateTime; AIsLocked: Boolean): TDateTime; +var + I: Integer; + AReminderDate: TDateTime; +begin + Result := ANow; + if not AIsLocked then + begin + Result := Result + ReminderRefreshInterval; + for I := 0 to Events.Count - 1 do + begin + AReminderDate := GetFirstReminderTimeForEvent(Events[I].Source, ANow); + if AReminderDate > ANow then + Result := Min(AReminderDate, Result); + end; + end; + Result := Max(Result, ANow + SecondToTime); +end; + +function TcxSchedulerReminders.GetNow: TDateTime; +begin + Result := Now; +end; + +function TcxSchedulerReminders.GetReminderClass: TcxSchedulerReminderClass; +begin + Result := TcxSchedulerReminder; +end; + +function TcxSchedulerReminders.GetReminderResourcesFromEvent( + AEvent: TcxSchedulerControlEvent; AGetFromPattern: Boolean): TcxSchedulerReminderResources; +begin + if AGetFromPattern then + Result := AEvent.Pattern.ReminderResourcesData.Resources + else + Result := AEvent.ReminderResourcesData.Resources; +end; + +function TcxSchedulerReminders.GetReminderWindowCaption: string; +begin + if Count = 1 then + Result := cxGetResourceString(@scxrCaptionReminder) + else + Result := Format(cxGetResourceString(@scxrCaptionReminders), [Count]); + DoGetReminderWindowCaption(Result); +end; + +function TcxSchedulerReminders.IsNeedAddToReminders( + AEvent: TcxSchedulerControlEvent; const AReminderDate: TDateTime): Boolean; +var + AEventStart, ANow: TDateTime; +begin + ANow := GetNow; + Result := AReminderDate <= ANow; + if Result and (AEvent.EventType = etOccurrence) then + begin + AEventStart := AEvent.Start; + Result := not ((DateOf(ANow) = DateOf(AEventStart)) and + (AEventStart - AEvent.ReminderMinutesBeforeStart * MinuteToTime > ANow)); + end; +end; + +function TcxSchedulerReminders.PopulateEventsCache: Boolean; +var + ANow, ANextTime: TDateTime; +begin + Result := not IsLocked; + ANow := GetNow; + ANextTime := GetNextPopulateEventsCacheTime(ANow, not Result); + if Result then + begin + if IsReminderWindowShown then + begin + ReminderWindow.SaveSelection; + NeedRestoreSelection := True; + end; + Storage.GetReminderEvents(DateOf(ANextTime), Events); + end; + UpdateTimer(UpdateEventsTimer, ANextTime - ANow); +end; + +procedure TcxSchedulerReminders.RefreshReminders; +var + ANow, ANextTime: TDateTime; + AIsLocked: Boolean; +begin + ANow := GetNow; + AIsLocked := IsLocked; + ANextTime := GetNextRefreshRemindersTime(ANow, AIsLocked); + if not AIsLocked then + UpdateReminderList; + UpdateTimer(UpdateRemindersTimer, ANextTime - ANow); +end; + +procedure TcxSchedulerReminders.RemoveEventReminders( + AReminder: TcxSchedulerReminder); +begin + if AReminder.EventReminders = nil then + AReminder.Free + else + FEventRemindersList.Remove(AReminder.EventReminders); +end; + +procedure TcxSchedulerReminders.StopTimers; +begin + FUpdateEventsTimer.Enabled := False; + FUpdateRemindersTimer.Enabled := False; +end; + +procedure TcxSchedulerReminders.ValidateReminderList; +var + AIndex: Integer; + AEvent: TcxSchedulerControlEvent; + ACurrentPattern: TcxSchedulerEvent; + ANow: TDateTime; +begin + FNeedShowWindow := False; + FNeedCloseWindow := FItems.Count > 0; + FEventRemindersList.Invalidate; + //need the countdown loop to ensure that the next occurrences (if exist) + //from the current chain are already in the list (FItems) + //ACurrentPattern := nil; + AIndex := Events.Count - 1; + ANow := GetNow; + while AIndex >= 0 do + begin + AEvent := Events[AIndex]; + if (AEvent.EventType = etOccurrence) and (AEvent.ReminderDate < ANow) then + begin + CheckRemindersForEvent(AEvent); + //skip occurrences for a current pattern + ACurrentPattern := AEvent.Pattern; + Dec(AIndex); + while AIndex >= 0 do + begin + AEvent := Events[AIndex]; + if not AEvent.IsRecurring or (ACurrentPattern <> AEvent.Pattern) then + Break; + if (AEvent.EventType <> etOccurrence) then + CheckRemindersForEvent(AEvent); + Dec(AIndex); + end; + Continue; + end + else + CheckRemindersForEvent(AEvent); + Dec(AIndex); + end; + FEventRemindersList.RemoveInvalidItems; + FNeedCloseWindow := FNeedCloseWindow and (FItems.Count = 0); +end; + +procedure TcxSchedulerReminders.ValidateRemindersForEvent( + AEventReminders: TcxSchedulerEventReminders; + AEvent: TcxSchedulerControlEvent); + + procedure ValidateResourceReminder(AEventReminders: TcxSchedulerEventReminders; + AEvent: TcxSchedulerControlEvent; const AResourceID: Variant; + AReminderDate: TDateTime); + var + AReminder: TcxSchedulerReminder; + begin + AReminder := AEventReminders.Find(AReminderDate, AResourceID); + if AReminder = nil then + CheckAddReminder(AEvent, AResourceID, AReminderDate, AEventReminders) + else + if IsNeedAddToReminders(AEvent, AReminderDate) then + AReminder.Validate(AEvent); + end; + +var + I: Integer; + AReminderResources: TcxSchedulerReminderResources; + AIsOccurrence: Boolean; +begin + AReminderResources := nil; //to avoid Delphi6 warning + if IsReminderByResourceAvailable and AEvent.Shared then + begin + AIsOccurrence := AEvent.EventType = etOccurrence; + AReminderResources := GetReminderResourcesFromEvent(AEvent, AIsOccurrence); + for I := Low(AReminderResources) to High(AReminderResources) do + with AReminderResources[I] do + begin + if not AIsOccurrence or (DateOf(GetNow) > DismissDate) then + ValidateResourceReminder(AEventReminders, AEvent, ResourceID, ReminderDate); + end; + end + else + ValidateResourceReminder(AEventReminders, AEvent, AEvent.ResourceID, AEvent.ReminderDate); + AEventReminders.Validate; +end; + +procedure TcxSchedulerReminders.UpdateReminderList; +var + ARestoreSelection: Boolean; +begin + if IsLocked or UpdatingReminderList then Exit; + FUpdatingReminderList := True; + try + ValidateReminderList; + ARestoreSelection := NeedRestoreSelection; + NeedRestoreSelection := False; + if IsReminderWindowShown then + begin + if NeedCloseWindow then + HideReminderWindow + else + begin + if NeedShowWindow and not ARestoreSelection then + begin + ReminderWindow.SaveSelection; + ARestoreSelection := True; + end; + if ARestoreSelection then + ReminderWindow.RestoreSelection; + end; + if NeedShowWindow then + ReminderWindow.FlashCaption; + end + else + if NeedShowWindow then ShowReminderWindow; + finally + FUpdatingReminderList := False; + end; +end; + +procedure TcxSchedulerReminders.UpdateTimer(ATimer: TTimer; + AInterval: TDateTime); +begin + if Active then + begin + ATimer.Enabled := False; + ATimer.Interval := Trunc(AInterval * MSecsPerDay); + ATimer.Enabled := True; + end; +end; + +procedure TcxSchedulerReminders.CreateTimers; +begin + FUpdateEventsTimer := TTimer.Create(nil); + FUpdateEventsTimer.Enabled := False; + FUpdateEventsTimer.OnTimer := OnUpdateEventsTimer; + FUpdateRemindersTimer := TTimer.Create(nil); + FUpdateRemindersTimer.Enabled := False; + FUpdateRemindersTimer.OnTimer := OnUpdateRemindersTimer; +end; + +function TcxSchedulerReminders.GetCount: Integer; +begin + Result := FItems.Count; +end; + +function TcxSchedulerReminders.GetItem( + Index: Integer): TcxSchedulerReminder; +begin + if (Index >= 0) and (Index < Count) then Result := FItems[Index] else Result := nil; +end; + +procedure TcxSchedulerReminders.SetActive(AValue: Boolean); +begin + if FActive <> AValue then + begin + FActive := AValue; + if AValue then + StartReminder + else + StopReminder; + Storage.SendNotification; + end; +end; + +procedure TcxSchedulerReminders.SetDefaultMinutesBeforeStart(AValue: Integer); +begin + FDefaultMinutesBeforeStart := Max(0, AValue); +end; + +procedure TcxSchedulerReminders.SetReminderByResource(AValue: Boolean); +begin + if FReminderByResource <> AValue then + begin + FReminderByResource := AValue; + Refresh; + UpdateReminderWindow; + end; +end; + +procedure TcxSchedulerReminders.SetReminderWindowLookAndFeel( + AValue: TcxLookAndFeel); +begin + FReminderWindowLookAndFeel.Assign(AValue); +end; + +procedure TcxSchedulerReminders.SetShowResourcesInReminderWindow(AValue: Boolean); +begin + if FShowResourcesInReminderWindow <> AValue then + begin + FShowResourcesInReminderWindow := AValue; + UpdateReminderWindow; + end; +end; + +procedure TcxSchedulerReminders.ShowReminderWindow; +begin + if ReminderWindow = nil then + FReminderWindow := CreateReminderWindow; + UpdateReminderList; + ReminderWindow.ShowInactive; +end; + +procedure TcxSchedulerReminders.StartReminder; +begin + if (csDesigning in Storage.ComponentState) then Exit; + FUpdateEventsTimer.Enabled := True; + FUpdateRemindersTimer.Enabled := True; + Refresh; +end; + +procedure TcxSchedulerReminders.StopReminder; +begin + StopTimers; + HideReminderWindow; + FEventRemindersList.Clear; + FItems.Clear; + FEvents.Clear; +end; + +procedure TcxSchedulerReminders.UpdateReminderWindow; +begin + if IsReminderWindowShown then + ReminderWindow.LayoutChanged; +end; + +procedure TcxSchedulerReminders.OnUpdateEventsTimer(Sender: TObject); +begin + Refresh; +end; + +procedure TcxSchedulerReminders.OnUpdateRemindersTimer(Sender: TObject); +begin + RefreshReminders; +end; + +var + User32Lib: HMODULE; + TempStream: TMemoryStream; + TempWriter: TcxWriter; + TempReader: TcxReader; + +function cxVariantToFieldValue(const AValue: Variant): Variant; +var + S: string; +begin + if VarIsArray(AValue) and (VarArrayHighBound(AValue, 1) > 0) then + begin + TempStream.Clear; + TempWriter.WriteInteger(varArray or varVariant); + TempWriter.WriteInteger(0); + TempWriter.WriteVariant(AValue); + TempStream.Position := SizeOf(Integer); + TempWriter.WriteInteger(TempStream.Size); + SetLength(S, TempStream.Size); + if TempStream.Size > 0 then + Move(TempStream.Memory^, S[1], TempStream.Size); + Result := S; + end + else + if VarIsArray(AValue) then + begin + Result := AValue[0]; + if VarIsArray(Result) then + Result := cxVariantToFieldValue(Result); + end + else + Result := AValue; +end; + +function cxFieldValueToVariant(const AValue: Variant): Variant; +var + S: string; +begin + if VarType(AValue) = varString then + begin + S := VarToStr(AValue); + if Length(S) > SizeOf(Integer) * 2 then + begin + TempStream.Clear; + TempStream.Size := Length(S); + Move(S[1], TempStream.Memory^, TempStream.Size); + if (TempReader.ReadInteger = (varArray or varVariant)) and (TempReader.ReadInteger = TempStream.Size) then + begin + Result := TempReader.ReadVariant; + Exit; + end; + end + end; + Result := AValue; +end; + +function cxReminderResourcesDataToFieldValue(const AValue: TcxSchedulerReminderResourcesData): Variant; +var + S: string; + I: Integer; +begin + if Length(AValue.Resources) = 0 then + begin + Result := Null; + Exit; + end; + TempStream.Clear; + TempWriter.WriteByte(AValue.Version); + TempWriter.WriteInteger(Length(AValue.Resources)); + TempWriter.WriteInteger(0); + for I := Low(AValue.Resources) to High(AValue.Resources) do + with AValue.Resources[I] do + begin + TempWriter.WriteDateTime(DismissDate); + TempWriter.WriteVariant(ResourceID); + TempWriter.WriteDateTime(ReminderDate); + end; + TempStream.Position := SizeOf(Integer) + SizeOf(Byte); + TempWriter.WriteInteger(TempStream.Size); + SetLength(S, TempStream.Size); + if TempStream.Size > 0 then + Move(TempStream.Memory^, S[1], TempStream.Size); + Result := S; +end; + +function cxFieldValueToReminderResourcesData(const AValue: Variant): TcxSchedulerReminderResourcesData; +var + S: string; + ACount, I: Integer; +begin + Result.Version := 0; + Result.Resources := nil; + if VarType(AValue) = varString then + begin + S := VarToStr(AValue); + if Length(S) > SizeOf(Integer) + SizeOf(Byte) then + begin + TempStream.Clear; + TempStream.Size := Length(S); + Move(S[1], TempStream.Memory^, TempStream.Size); + Result.Version := TempReader.ReadByte; + ACount := TempReader.ReadInteger; + if (Result.Version = 3) and (ACount > 0) and (TempReader.ReadInteger = TempStream.Size) then + begin + SetLength(Result.Resources, ACount); + for I := 0 to ACount - 1 do + with Result.Resources[I] do + begin + DismissDate := TempReader.ReadDateTime; + ResourceID := TempReader.ReadVariant; + ReminderDate := TempReader.ReadDateTime; + end; + end; + end + end; +end; + +function cxTaskLinksToFieldValue(ALinks: TcxSchedulerEventLinks): Variant; +var + I: Integer; + ADataArray: Variant; +begin + if ALinks.Count = 0 then + begin + Result := Null; + Exit; + end; + ADataArray := VarArrayCreate([0, ALinks.Count - 1], varVariant); + for I := 0 to ALinks.Count - 1 do + ADataArray[I] := ALinks[I].GetData; + Result := cxVariantToFieldValue(ADataArray); +end; + +procedure cxFieldValueToTaskLinks(const AValue: Variant; ALinks: TcxSchedulerEventLinks); +var + I, L, H: Integer; + ADataValue: Variant; +begin + if VarIsNull(AValue) and (ALinks.Count = 0) then Exit; + ALinks.BeginUpdate; + try + ALinks.Clear; + ADataValue := cxFieldValueToVariant(AValue); + if VarIsArray(ADataValue) then + begin + L := VarArrayLowBound(ADataValue, 1); + H := VarArrayHighBound(ADataValue, 1); + if (H - L + 1 = 3) and not VarIsArray(ADataValue[0]) then + begin + if ALinks.Event.Storage.GetEventByID(ADataValue[1]) <> nil then + TcxSchedulerEventItemLink(ALinks.Add).SetData(ADataValue); + end + else + for I := L to H do + if ALinks.Event.Storage.GetEventByID(ADataValue[I][1]) <> nil then + TcxSchedulerEventItemLink(ALinks.Add).SetData(ADataValue[I]); + end; + finally + ALinks.EndUpdate; + end; +end; + +function GetStreamVersion(const AStream: TStream; + var AFieldCount: Integer; ACustomFieldCount: Integer = 0): Double; + + function TryRead(const AOriginal: string; + var ABuffer; const ABufferSize: Integer): Boolean; + var + L: Integer; + ACandidate: string; + begin + Result := (AStream.Size - AStream.Position) > + (Length(AOriginal) + SizeOf(L)); + if Result then + AStream.Read(L, SizeOf(L)); + Result := L = Length(AOriginal); + if Result then + begin + SetLength(ACandidate, L); + AStream.ReadBuffer(ACandidate[1], L); + Result := ACandidate = AOriginal; + end; + if Result then + AStream.ReadBuffer(ABuffer, ABufferSize); + end; + +var + APos: Integer; +begin + Result := 0; + APos := AStream.Position; + if not TryRead(scxSchedulerSignature, Result, SizeOf(Result)) then + begin + AStream.Position := APos; + if TryRead('DataController1', AFieldCount, SizeOf(AFieldCount)) then + begin + if (AFieldCount - ACustomFieldCount) = 15 then + Result := 1 + else + if (AFieldCount - ACustomFieldCount) = 17 then + Result := 2 + else + Result := 3; + end; + end + else + begin + APos := AStream.Position; + if not TryRead('DataController1', AFieldCount, SizeOf(AFieldCount)) then + Result := -1; + end; + AStream.Position := APos; +end; + +initialization + TempStream := TMemoryStream.Create; + TempWriter := TcxWriter.Create(TempStream); + TempReader := TcxReader.Create(TempStream); + // + User32Lib := LoadLibrary(user32); + FlashWindowExProc := GetProcAddress(User32Lib, 'FlashWindowEx'); + +finalization + TempStream.Free; + TempWriter.Free; + TempReader.Free; + // + FreeLibrary(User32Lib); + +end. + + + diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerStrs.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerStrs.pas new file mode 100644 index 00000000..43e9e108 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerStrs.pas @@ -0,0 +1,464 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerStrs; + +{$I cxVer.inc} + +interface + +resourcestring + scxUntitledEvent = 'Untitled event'; + + scxVertical = 'Vertical'; + scxHorizontal = 'Horizontal'; + scxTimeGrid = 'TimeGrid'; + + scxMinute = 'Minute'; + scxMinutes = 'Minutes'; + scxHour = 'Hour'; + scxHours = 'Hours'; + scxOneDay = 'One day'; + + // Navigation buttons + scxNextAppointment = 'Next appointment'; + scxPrevAppointment = 'Previous appointment'; + + // dialogs constants + scxDeleteRecurringEventDescription = 'is a recurring event. Do you want to delete only this occurrence or the series?'; + scxEditRecurringEventDescription = 'is a recurring event. Do you want to open only this occurrence or the series?'; + + scxGoToDateDialogCaption = 'Go To Date'; + scxDeleteTypeDialogCaption = 'Confirm Delete'; + scxDeleteTypeOccurrenceLabel = 'Delete this occurrence'; + scxDeleteTypeSeriesLabel = 'Delete the series'; + scxEditTypeDialogCaption = 'Open Recurring Item'; + scxEditTypeOccurrenceLabel = 'Open this occurrence'; + scxEditTypeSeriesLabel = 'Open the series'; + + scxExitConfirmation = 'Do you want to save changes?'; + scxDeleteConfirmation= 'This item has been changed. Are you sure you want to delete it?'; + scxWrongTimeBounds = 'The end date you entered occurs before the start date.'; + scxWrongPattern = 'The recurrence pattern is not valid.'; + scxReplaceOccurrenceDate = 'Some months have fewer than %s days. For these months, the occurrence will fall on the last day of the month.'; + scxInvalidRecurrenceDuration = 'The duration of the event must be shorter than how frequently it occurs. ' + + 'Shorten the duration, or change the recurrence pattern in the Recurrence dialog box.'; + scxConfirmLostExceptions = 'Any exceptions associated with this recurring event will be lost. Is this OK?'; + scxInvalidNumber = 'You must enter a valid number.'; + scxNoAvailableFreeTime = 'No free time is available.'; + + scxEvent = 'Event'; + scxUntitled = 'Untitled'; + + scxNoneEvent = 'simple event'; + scxRecurrenceEvent = 'recurrence event'; + scxExceptionEvent = 'exception event'; + scxOccurenceEvent = 'occurence event'; + + scxAdd = '&Add'; + scxEdit = '&Edit'; + scxDelete = '&Delete'; + scxRecurrence = '&Recurrence'; + + scxDate = '&Date:'; + scxShowIn = '&Show in:'; + scxDayCalendar = 'Day Calendar'; + scxWeekCalendar = 'Week Calendar'; + scxMonthCalendar = 'Month Calendar'; + scxWorkWeekCalendar = 'Work Week Calendar'; + + scxEventsConflict = 'Conflicts with another event in your schedule.'; + scxResource = 'Resource'; + scxSubject = '&Subject:'; + scxLocation = '&Location:'; + scxLabel = 'La&bel:'; + scxStartTime = 'S&tart time:'; + scxEndTime = '&End time:'; + scxAllDayEvent = '&All day event'; + scxRecurrenceLabel = 'Recurrence:'; + + scxReminder = 'Reminder:'; + scxShowTimeAs = 'Sho&w time as:'; + + scxSuffixMinute = 'minute'; + scxSuffixMinutes = 'minutes'; + scxSuffixHour = 'hour'; + scxSuffixHours = 'hours'; + scxSuffixDay = 'day'; + scxSuffixDays = 'days'; + scxSuffixWeek = 'week'; + scxSuffixWeeks = 'weeks'; + + scxBusy = 'Busy'; + scxFree = 'Free'; + scxTentative = 'Tentative'; + scxOutOfOffice = 'Out of office'; + + scxRecurrenceCaption = 'Event recurrence'; + scxEventTime = ' Event time '; + scxRecurrencePattern = ' Recurrence pattern '; + scxRangeOfRecurrence = ' Range of recurrence '; + scxStart = '&Start:'; + scxStart1 = 'S&tart:'; + scxEnd = '&End:'; + scxDuration = 'D&uration:'; + // Pattern + scxDaily = '&Daily'; + scxWeekly = '&Weekly'; + scxQuarterly = '&Quarterly'; + scxMonthly = '&Monthly'; + scxYearly = '&Yearly'; + // daily + scxEvery = 'E&very'; + scxEveryWeekDay = 'Every wee&kday'; + scxDays = 'day(s)'; + // weekly + scxWeeksOn = 'week(s) on:'; + scxRecurEvery = 'Rec&ur every'; + //monthly + scxOfEvery = 'of every'; + scxMonths = 'month(s)'; + // yearly + scxThe = 'T&he'; + scxOf = 'of'; + + // Task links + + scxTaskComplete = 'Task co&mplete:'; + scxTaskStatus = 'Task status'; + scxTaskDependencyEditorCaption = 'Task Dependency'; + scxTaskWrongTimeBounds = 'A new date must be entered within the period of %s - %s.'; + scxFinishToFinishLong = 'Finish-to-Finish (FF)'; + scxFinishToStartLong = 'Finish-to-Start (FS)'; + scxFrom = 'From:'; + scxStartToFinishLong = 'Start-to-Finish (SF)'; + scxStartToStartLong = 'Start-to-Start (SS)'; + scxTo = 'To:'; + scxType = '&Type:'; + + // other + scxFirst = 'first'; + scxSecond = 'second'; + scxThird = 'third'; + scxFourth = 'fourth'; + scxLast = 'last'; + scxDay = 'D&ay'; + scxDay1 = 'day'; + scxWeekday = 'weekday'; + scxWeekendday = 'weekend day'; + scxNoEndDate = '&No end date'; + scxEndAfter = 'End a&fter:'; + scxEndBy = 'End &by:'; + scxOccurences = 'occurrences'; + + // buttons + scxAdd1 = 'Add'; + scxApply = '&Apply'; + scxFindAvailableTime = 'Find available time'; + scxOk = '&OK'; + scxCancel = '&Cancel'; + scxClose = '&Close'; + scxDown = '&Down'; + scxDelete1 = 'Delete'; + scxEdit1 = 'Edit'; + scxImport = '&Import'; + scxExport = '&Export'; + scxRemoveRecur = '&Remove recurrence'; + scxSelectAll = 'Select &all'; + scxSelectNone = 'Select &none'; + scxUp = '&Up'; + // + scxResourceLayoutCaption = 'Resources layout editor'; + + // popup menu resources + scxpmNewEvent = '&New Event'; + scxpmNewAllDayEvent = 'New All Day &Event'; + scxpmNewRecurringEvent = 'New &Recurring Event'; + scxpmToday = 'T&oday'; + scxpmGotoThisDay = 'Go to This &Day'; + scxpmGoToDate = 'Go &to Date...'; + scxpmResourcesLayout = 'Resources layout editor...'; + + // for event + scxpmOpen = '&Open'; + scxpmEditSeries = 'Edit Se&ries'; + scxpmShowTimeAs = 'S&how Time As'; + scxpmDelete = '&Delete'; + scxpmFree = '&Free'; + scxpmTentative = '&Tentative'; + scxpmBusy = '&Busy'; + scxpmOutOfOffice = '&Out of Office'; + scxpmLabel = '&Label'; + + // event label captions + scxEventLabelNone = 'None'; + scxEventLabel0 = 'Important'; + scxEventLabel1 = 'Business'; + scxEventLabel2 = 'Personal'; + scxEventLabel3 = 'Vacation'; + scxEventLabel4 = 'Must Attend'; + scxEventLabel5 = 'Travel Required'; + scxEventLabel6 = 'Needs Preparation'; + scxEventLabel7 = 'Birthday'; + scxEventLabel8 = 'Anniversary'; + scxEventLabel9 = 'Phone Call'; + + // for time ruler menu items + scxpmTimeZone = 'Chan&ge Time Zone'; + scxpm60Minutes = '6&0 Minutes'; + scxpm30Minutes = '&30 Minutes'; + scxpm15Minutes = '&15 Minutes'; + scxpm10Minutes = '10 &Minutes'; + scxpm6Minutes = '&6 Minutes'; + scxpm5Minutes = '&5 Minutes'; + + // for year view scale menu items + scxpmFullYear = '&Full Year'; + scxpmHalfYear = '&Half-Year'; + scxpmQuarter = '&Quarter'; + + // year view scales + scxFullYear = 'Full Year'; + scxHalfYear = 'Half-Year'; + scxQuarter = 'Quarter'; + scxHalfYearShort = 'H'; + scxQuarterShort = 'Q'; + + //navigator hints + scxFirstButtonHint = 'First Resource'; + scxPrevPageButtonHint = 'Previous Page'; + scxPrevButtonHint = 'Previous Resource'; + scxNextButtonHint = 'Next Resource'; + scxNextPageButtonHint = 'Next Page'; + scxLastButtonHint = 'Last Resource'; + scxShowMoreResourcesButtonHint = 'Show More Resources'; + scxShowFewerResourcesButtonHint = 'Show Fewer Resources'; + + //for reminder + scxrCaptionReminder = '1 Reminder'; + scxrCaptionReminders = '%d Reminders'; + scxrDismissButton = '&Dismiss'; + scxrDismissAllButton = 'Dismiss &All'; + scxrDueIn = 'Due in'; + scxrOpenItemButton = '&Open Item'; + scxrSnoozeButton = '&Snooze'; + scxrSubject = 'Subject'; + scxrSnoozeLabel = '&Snooze'; + scxrSelected = '%d reminders are selected'; + scxrStartTime = 'Start time: %s'; + + // time + scxTime0m = '0 minutes'; + scxTime5m = '5 minutes'; + scxTime10m = '10 minutes'; + scxTime15m = '15 minutes'; + scxTime20m = '20 minutes'; + scxTime30m = '30 minutes'; + scxTime1h = '1 hour'; + scxTime2h = '2 hours'; + scxTime3h = '3 hours'; + scxTime4h = '4 hours'; + scxTime5h = '5 hours'; + scxTime6h = '6 hours'; + scxTime7h = '7 hours'; + scxTime8h = '8 hours'; + scxTime9h = '9 hours'; + scxTime10h = '10 hours'; + scxTime11h = '11 hours'; + scxTime12h = '12 hours'; + scxTime18h = '18 hours'; + scxTime1d = '1 day'; + scxTime2d = '2 days'; + scxTime3d = '3 days'; + scxTime4d = '4 days'; + scxTime1w = '1 week'; + scxTime2w = '2 weeks'; + // advance time + scxAdvance0h = '0 hours before start'; + scxAdvance5m = '5 minutes before start'; + scxAdvance10m = '10 minutes before start'; + scxAdvance15m = '15 minutes before start'; + + // for export + + secxExportStorageInvalid = 'Storage not assigned'; + + // card field names + + secxYes = 'Yes'; + secxNo = 'No'; + secxSubject = 'Subject'; + secxLocation = 'Location'; + secxDescription = 'Description'; + secxAllDay = 'All day'; + secxStart = 'Start'; + secxFinish = 'Finish'; + secxState = 'State'; + secxReminder = 'Reminder'; + + // table fields + + secxStartDate = 'StartDate'; + secxStartTime = 'StartTime'; + secxEndDate = 'EndDate'; + secxEndTime = 'EndTime'; + secxAlldayevent = 'Alldayevent'; + secxReminderonoff = 'Reminderonoff'; + secxReminderDate = 'ReminderDate'; + secxReminderTime = 'ReminderTime'; + secxMeetingOrganizer = 'MeetingOrganizer'; + secxRequiredAttendees = 'RequiredAttendees'; + secxOptionalAttendees = 'OptionalAttendees'; + secxMeetingResources = 'MeetingResources'; + secxBillingInformation = 'BillingInformation'; + secxCategories = 'Categories'; + secxMileage = 'Mileage'; + secxPriority = 'Priority'; + secxPrivate = 'Private'; + secxSensitivity = 'Sensitivity'; + secxShowtimeas = 'Showtimeas'; + + secxNormal = 'Normal'; + + // storage + scxRequiredFieldsNeeded = 'The following required fields'#13#10'%sare not assigned!'; + scxInvalidFieldName = 'Invalid field name'; + scxInvalidCustomField = 'Invalid custom field'; + + // Event fields + scxAllDayEventField = 'All Day Event'; + scxIDField = 'ID'; + scxActualFinishField = 'Actual Finish'; + scxActualStartField = 'Actual Start'; + scxCaptionField = 'Caption'; + scxEnabledField = 'Enabled'; + scxEventTypeField = 'Type'; + scxFinishField = 'Finish'; + scxLabelField = 'Label'; + scxLocationField = 'Location'; + scxMessageField = 'Message'; + scxParentIDField = 'ParentID'; + scxRecurrenceField = 'Recurrence Pattern'; + scxRecurrenceIndexField = 'Recurrence Index'; + scxReminderDateField = 'ReminderDate'; + scxReminderField = 'Reminder'; + scxReminderMinutesBeforeStartField = 'Reminder Minutes Before Start'; + scxResourceField = 'Resource'; + scxStartField = 'Start'; + scxStateField = 'State'; + scxTaskCompleteField = 'Task Complete'; + scxTaskLinksField = 'Task Links'; + scxTaskStatusField = 'Task Status'; + + // status + scxNotStarted = 'Not Started'; + scxInProgress = 'In Progress'; + scxComplete = 'Complete'; + scxWaiting = 'Waiting'; + scxDeferred = 'Deferred'; + + // Event task relations + + scxFinishToStart = 'Finish-To-Start'; + scxStartToStart = 'Start-To-Start'; + scxFinishToFinish = 'Finish-To-Finish'; + scxStartToFinish = 'Start-To-Finish '; + + scxFinishToStartShort = 'FS'; + scxStartToStartShort = 'SS'; + scxFinishToFinishShort = 'FF'; + scxStartToFinishShort = 'SF'; + + scxGanttEventHint = 'Task: %s'#13#10'Complete: %d %%'#13#10'Start: %s'#13#10'Finish: %s'; + scxLinkHint = 'Task Link: %s (%s)'#13#10'From: %s'#13#10'To: %s'; + + // + + scxCompleteDisplayFormat = '0 %'; + + scxNone = 'Simple Event'; + scxPattern = 'Recurrence Pattern'; + scxOccurrence= 'Simple Occurence'; + scxException = 'Exception Occurrence'; + scxCustom = 'Custom Occurrence'; + + // Holidays + + scxHolidaysEditorCaption = 'Holidays editor'; + scxLocationsGroupBox = 'Locations'; + scxHolidaysGroupBox = 'Holidays'; + scxAddedHolidaysGroupBox = 'Added holidays'; + scxLocationName = 'Name:'; + scxHolidaysLocationEditorCaption = 'Location editor'; + scxHolidayName = 'Name:'; + scxHolidayDate = 'Date:'; + scxHolidaysLocationHolidayEditorCaption = 'Holiday editor'; + scxOutlookFormatMismatch = 'Holiday format mismatch'; + +const + sRangeNames: array[0..4] of Pointer = + (@scxFirst, @scxSecond, @scxThird, @scxFourth, @scxLast); + sDayNames: array [0..9] of string = + (scxDay, scxWeekday, scxWeekendday, '', '', '', '', '', '', ''); + sEventLabelCaptions: array[0..10] of Pointer = ( + @scxEventLabelNone, @scxEventLabel0, @scxEventLabel1, @scxEventLabel2, + @scxEventLabel3, @scxEventLabel4, @scxEventLabel5, @scxEventLabel6, + @scxEventLabel7, @scxEventLabel8, @scxEventLabel9); + sEventRelations: array[0..3] of Pointer = ( + @scxFinishToStart, @scxStartToStart, @scxFinishToFinish, @scxStartToFinish); + sEventRelationsShort: array[0..3] of Pointer = ( + @scxFinishToStartShort, @scxStartToStartShort, @scxFinishToFinishShort, + @scxStartToFinishShort); + sEventTaskStatus: array[0..4] of Pointer = + (@scxNotStarted, @scxInProgress, @scxComplete, @scxWaiting, @scxDeferred); + +procedure cxSchedulerInitStrings; + +implementation + +uses + SysUtils; + +procedure cxSchedulerInitStrings; +var + I: Integer; +begin + for I := 1 to 7 do + sDayNames[2 + I] := LongDayNames[I]; +end; + +initialization + cxSchedulerInitStrings; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerTaskDependencyEditor.dfm b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerTaskDependencyEditor.dfm new file mode 100644 index 00000000..eb50f282 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerTaskDependencyEditor.dfm @@ -0,0 +1,118 @@ +object fmSchedulerTaskDependencyEditor: TfmSchedulerTaskDependencyEditor + Left = 494 + Top = 254 + AutoScroll = False + BorderIcons = [biSystemMenu] + Caption = 'fmSchedulerTaskDependencyEditor' + ClientHeight = 120 + ClientWidth = 292 + Color = clBtnFace + Constraints.MinHeight = 154 + Constraints.MinWidth = 300 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poOwnerFormCenter + OnKeyDown = FormKeyDown + PixelsPerInch = 96 + TextHeight = 13 + object cxGroupBox1: TcxGroupBox + Left = 0 + Top = 0 + Align = alClient + PanelStyle.Active = True + Style.BorderStyle = ebsNone + TabOrder = 0 + Height = 120 + Width = 292 + object lbTo: TcxLabel + Left = 8 + Top = 35 + Caption = 'lbTo' + Transparent = True + end + object lbType: TcxLabel + Left = 8 + Top = 60 + Caption = 'lbType' + FocusControl = cbTypeRelation + Transparent = True + end + object lbToName: TcxLabel + Left = 70 + Top = 35 + AutoSize = False + Caption = 'lbToName' + Properties.ShowAccelChar = False + Style.TransparentBorder = False + Transparent = True + Height = 17 + Width = 214 + end + object lbFromName: TcxLabel + Left = 70 + Top = 8 + AutoSize = False + Caption = 'lbFromName' + Properties.ShowAccelChar = False + Style.TransparentBorder = False + Transparent = True + Height = 17 + Width = 214 + end + object cbTypeRelation: TcxComboBox + Left = 70 + Top = 60 + Anchors = [akLeft, akTop, akRight] + Properties.DropDownListStyle = lsFixedList + Properties.OnChange = cbTypeRelationPropertiesChange + TabOrder = 3 + OnKeyDown = FormKeyDown + Width = 214 + end + object btnOk: TcxButton + Left = 106 + Top = 89 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'btnOk' + Default = True + ModalResult = 1 + TabOrder = 4 + OnKeyDown = FormKeyDown + end + object btnDelete: TcxButton + Left = 13 + Top = 89 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'btnDelete' + ModalResult = 1 + TabOrder = 5 + OnClick = btnDeleteClick + OnKeyDown = FormKeyDown + end + object btnCancel: TcxButton + Left = 199 + Top = 89 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'btnCancel' + ModalResult = 2 + TabOrder = 6 + OnKeyDown = FormKeyDown + end + object lbFrom: TcxLabel + Left = 8 + Top = 8 + Caption = 'lbFrom' + Transparent = True + end + end +end diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerTaskDependencyEditor.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerTaskDependencyEditor.pas new file mode 100644 index 00000000..66573080 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerTaskDependencyEditor.pas @@ -0,0 +1,137 @@ +unit cxSchedulerTaskDependencyEditor; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, cxSchedulerStorage, cxGraphics, cxTextEdit, cxMaskEdit, + cxDropDownEdit, cxControls, cxContainer, cxEdit, cxLabel, Menus, + cxLookAndFeelPainters, StdCtrls, cxButtons, cxGroupBox; + +type + TfmSchedulerTaskDependencyEditor = class(TForm) + lbFrom: TcxLabel; + lbTo: TcxLabel; + lbType: TcxLabel; + cbTypeRelation: TcxComboBox; + btnCancel: TcxButton; + btnOk: TcxButton; + btnDelete: TcxButton; + lbFromName: TcxLabel; + lbToName: TcxLabel; + cxGroupBox1: TcxGroupBox; + procedure cbTypeRelationPropertiesChange(Sender: TObject); + procedure btnDeleteClick(Sender: TObject); + procedure FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + private + FIsDelete: Boolean; + FEventFrom: TcxSchedulerEvent; + FEventTo: TcxSchedulerEvent; + FIsModified: Boolean; + FLinkRelation: TcxSchedulerEventRelation; + procedure CheckButtonState; + procedure SetLinkRelation(AValue: TcxSchedulerEventRelation); + protected + function GetEventStr(const AEvent: TcxSchedulerEvent): string; virtual; + procedure InitControls; virtual; + procedure SetCaptions; + public + function ShowModal: Integer; override; + + property IsDelete: Boolean read FIsDelete; + property EventFrom: TcxSchedulerEvent read FEventFrom write FEventFrom; + property EventTo: TcxSchedulerEvent read FEventTo write FEventTo; + property IsModified: Boolean read FIsModified; + property LinkRelation: TcxSchedulerEventRelation read FLinkRelation write SetLinkRelation; + end; + +TcxSchedulerTaskDependencyEditor = TfmSchedulerTaskDependencyEditor; +TcxSchedulerTaskDependencyEditorClass = class of TcxSchedulerTaskDependencyEditor; + +implementation + +uses + cxSchedulerStrs; + +{$R *.dfm} + +function TfmSchedulerTaskDependencyEditor.ShowModal: Integer; +begin + FIsModified := False; + InitControls; + FIsDelete := False; + Result := inherited ShowModal; +end; + +function TfmSchedulerTaskDependencyEditor.GetEventStr(const AEvent: TcxSchedulerEvent): string; +begin + Result := AEvent.Caption; +end; + +procedure TfmSchedulerTaskDependencyEditor.InitControls; +begin + with cbTypeRelation.ActiveProperties.Items do + begin + Clear; + Add(scxFinishToStartLong); + Add(scxStartToStartLong); + Add(scxFinishToFinishLong); + Add(scxStartToFinishLong); + end; + cbTypeRelation.ItemIndex := Integer(LinkRelation); + SetCaptions; + FIsModified := False; + CheckButtonState; +end; + +procedure TfmSchedulerTaskDependencyEditor.SetCaptions; +begin + Self.Caption := scxTaskDependencyEditorCaption; + btnOk.Caption := scxOk; + btnCancel.Caption := scxCancel; + btnDelete.Caption := scxDelete; + lbFrom.Caption := scxFrom; + lbTo.Caption := scxTo; + lbType.Caption := scxType; + lbFromName.Caption := cxGetStringAdjustedToWidth(lbFromName.Style.Font, GetEventStr(FEventFrom), lbFromName.ClientWidth); + lbToName.Caption := cxGetStringAdjustedToWidth(lbToName.Style.Font, GetEventStr(FEventTo), lbToName.ClientWidth); +end; + +procedure TfmSchedulerTaskDependencyEditor.CheckButtonState; +begin + btnOk.Enabled := IsModified; +end; + +procedure TfmSchedulerTaskDependencyEditor.SetLinkRelation(AValue: TcxSchedulerEventRelation); +begin + if AValue <> FLinkRelation then + begin + FLinkRelation := AValue; + FIsModified := True; + CheckButtonState; + end; +end; + +procedure TfmSchedulerTaskDependencyEditor.cbTypeRelationPropertiesChange(Sender: TObject); +begin + LinkRelation := TcxSchedulerEventRelation(cbTypeRelation.ItemIndex); + CheckButtonState; +end; + +procedure TfmSchedulerTaskDependencyEditor.btnDeleteClick(Sender: TObject); +begin + FIsDelete := True; +end; + +procedure TfmSchedulerTaskDependencyEditor.FormKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if Key = VK_ESCAPE then + begin + ModalResult := mrCancel; + Key := 0; + end; +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerTimeGridView.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerTimeGridView.pas new file mode 100644 index 00000000..787ab1f1 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerTimeGridView.pas @@ -0,0 +1,3719 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerTimeGridView; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, DateUtils, +{$ENDIF} + Windows, Forms, Classes, Math, StdCtrls, Graphics, Controls, ExtCtrls, Contnrs, + cxControls, cxEdit, cxGraphics, cxStyles, cxGeometry, Menus, + cxLookAndFeelPainters, cxSchedulerCustomControls, cxSchedulerCustomResourceView, + cxSchedulerUtils, cxSchedulerStorage, cxSchedulerStrs, cxDateUtils, cxClasses, + cxDrawTextUtils, SysUtils, dxOffice11, cxScrollBar; + +const + htcMajorScale = $11; + htcMajorSeparator = $12; + htcMinorScale = $13; + htcSelectionBar = $14; + + cxHorzEventIndent = 2; + + cxMinutesPerDay = 60 * 24; + cxMinHourScale = 5; + cxMaxHourScale = 60; + cxMinColumnWidth = 15; + + cxDefaultMinorUnitWidth = 50; + + cxMinSelectionBarHeight = 5; + + // TimeGrid styles + cxcsMajorScale = 0; + cxcsMajorScaleUnitSeparator = 1; + cxcsMinorScale = 3; + cxcsSelectionBar = 2; + cxcsMaxTimeGridStyle = cxcsSelectionBar; + +type + TcxSchedulerTimeGridView = class; + TcxSchedulerTimeGridViewViewInfo = class; + TcxSchedulerTimeGridSelectionBarCell = class; + TcxSchedulerTimeGridMinorScaleCell = class; + TcxSchedulerTimeGridMajorScaleCell = class; + TcxSchedulerTimeBuilder = class; + TcxSchedulerTimeGridViewHitTest = class; + TcxSchedulerTimeGridMoreEventsButtonViewInfo = class; + TcxSchedulerTimeGridScrollBar = class; + TcxSchedulerTimeGridResourceScroll = class; + // + TcxSchedulerTimeGridScaleUnit = (suHour, suDay, suWeek, suMonth, suQuarter, suYear); + TcxSchedulerTimeGridScaleUnits = set of TcxSchedulerTimeGridScaleUnit; + TcxSchedulerTimeGridScaleTextType = (sttUnknown, sttShort, sttMiddle, sttLong); + + { TcxCustomWeekViewDragEventHelper } + + TcxTimeGridDragEventHelper = class(TcxDragEventHelper) + private + function GetHitTest: TcxSchedulerTimeGridViewHitTest; + protected + procedure CorrectAllDayEventProperty; + function IsValidTime: Boolean; override; + procedure UpdateViewClonesTime; override; + + property HitTest: TcxSchedulerTimeGridViewHitTest read GetHitTest; + end; + + { TcxTimeGridEventSizing } + + TcxTimeGridEventSizing = class(TcxEventSizingHelper) + private + function GetTimeBuilder: TcxSchedulerTimeBuilder; + function GetHitTest: TcxSchedulerTimeGridViewHitTest; + protected + function IsValidTime: Boolean; override; + procedure UpdateEventBounds; override; + + property HitTest: TcxSchedulerTimeGridViewHitTest read GetHitTest; + property TimeBuilder: TcxSchedulerTimeBuilder read GetTimeBuilder; + end; + + { TcxSchedulerTimeGridViewController } + + TcxSchedulerTimeGridViewController = class(TcxSchedulerCustomResourceViewController) + private + FTimer: TTimer; + function GetHitTest: TcxSchedulerTimeGridViewHitTest; + function GetView: TcxSchedulerTimeGridView; + function GetViewInfo: TcxSchedulerTimeGridViewViewInfo; + protected + FPos: TPoint; + FIsEditingBeforeMouseDown: Boolean; + function CreateDragEventHelper: TcxDragEventHelper; override; + function CreateNavigation: TcxSchedulerViewNavigation; override; + function CreateResizeEventHelper: TcxEventSizingHelper; override; + // todo: scrolling timer (need move to CustomResourceView), and optimize day view + procedure BeforeMouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure CancelScroll; override; + procedure CheckScrolling(const APos: TPoint); override; + procedure InitTimer(AllowStart: Boolean; AScrollCode: TScrollCode); virtual; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure Scrolling(AScrollCode: TScrollCode; var AScrollPos: Integer); virtual; + procedure SyncEventSelection(AEvent: TcxSchedulerControlEvent); override; + procedure OnTimer(Sender: TObject); virtual; + + property HitTest: TcxSchedulerTimeGridViewHitTest read GetHitTest; + property Timer: TTimer read FTimer; + property View: TcxSchedulerTimeGridView read GetView; + property ViewInfo: TcxSchedulerTimeGridViewViewInfo read GetViewInfo; + public + constructor Create(AOwner: TcxSchedulerSubControl); override; + destructor Destroy; override; + end; + + { TcxSchedulerTimeGridViewNavigation } + + TcxSchedulerTimeGridViewNavigation = class(TcxSchedulerCustomResourceViewNavigation) + private + function GetTimeBuilder: TcxSchedulerTimeBuilder; + function GetView: TcxSchedulerTimeGridView; + function GetViewInfo: TcxSchedulerTimeGridViewViewInfo; + protected + property TimeBuilder: TcxSchedulerTimeBuilder read GetTimeBuilder; + property View: TcxSchedulerTimeGridView read GetView; + property ViewInfo: TcxSchedulerTimeGridViewViewInfo read GetViewInfo; + public + procedure KeyDown(var AKey: Word; AShift: TShiftState); override; + procedure ValidateSelection(var ASelStart, ASelFinish: TDateTime; + var AResource: TcxSchedulerStorageResourceItem); override; + end; + + { TcxSchedulerTimeGridViewStyles } + + TcxSchedulerGetScaleItemStyleEvent = procedure(Sender: TObject; + const ADateTime: TDateTime; var AStyle: TcxStyle) of object; + + TcxSchedulerTimeGridViewStyles = class(TcxStyles) + private + FScheduler: TcxCustomScheduler; + FOnGetMajorScaleParams: TcxSchedulerGetScaleItemStyleEvent; + FOnGetMinorScaleParams: TcxSchedulerGetScaleItemStyleEvent; + FOnGetSelectionBarParams: TcxSchedulerGetScaleItemStyleEvent; + function GetTimeGrid: TcxSchedulerTimeGridView; + protected + procedure Changed(AIndex: Integer); override; + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + function GetSelectionBarParamsEx(const ADateTime: TDateTime; ASelected: Boolean): TcxViewParams; virtual; + function IsTimeSelected(const ADateTime: TDateTime): Boolean; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + // time grid visual parameters + function GetMajorScaleParams(const ADateTime: TDateTime): TcxViewParams; + function GetMajorScaleUnitSeparatorParams: TcxViewParams; + function GetMinorScaleParams(const ADateTime: TDateTime): TcxViewParams; + function GetSelectionBarParams(const ADateTime: TDateTime): TcxViewParams; + + property Scheduler: TcxCustomScheduler read FScheduler; + property TimeGrid: TcxSchedulerTimeGridView read GetTimeGrid; + published + property MajorScale: TcxStyle index cxcsMajorScale read GetValue write SetValue; + property MajorScaleUnitSeparator: TcxStyle index cxcsMajorScaleUnitSeparator read GetValue write SetValue; + property MinorScale: TcxStyle index cxcsMinorScale read GetValue write SetValue; + property SelectionBar: TcxStyle index cxcsSelectionBar read GetValue write SetValue; + property OnGetMajorScaleParams: TcxSchedulerGetScaleItemStyleEvent read FOnGetMajorScaleParams write FOnGetMajorScaleParams; + property OnGetMinorScaleParams: TcxSchedulerGetScaleItemStyleEvent read FOnGetMinorScaleParams write FOnGetMinorScaleParams; + property OnGetSelectionBarParams: TcxSchedulerGetScaleItemStyleEvent read FOnGetSelectionBarParams write FOnGetSelectionBarParams; + end; + + { TcxSchedulerTimeGridViewScales } + + TcxSchedulerTimeGridViewScales = class(TPersistent) + private + FMajor: Boolean; + FMajorUnit: TcxSchedulerTimeGridScaleUnit; + FMajorUnitSeparatorWidth: Integer; + FMinor: Boolean; + FMinorUnit: TcxSchedulerTimeGridScaleUnit; + FMinorUnitWidth: Integer; + FOwner: TcxSchedulerTimeGridView; + FTimeStep: Integer; + function GetScheduler: TcxCustomScheduler; + procedure SetMajor(AValue: Boolean); + procedure SetMajorUnit(AValue: TcxSchedulerTimeGridScaleUnit); + procedure SetMajorUnitSeparatorWidth(AValue: Integer); + procedure SetMinor(AValue: Boolean); + procedure SetMinorUnit(AValue: TcxSchedulerTimeGridScaleUnit); + procedure SetMinorUnitWidth(AValue: Integer); + procedure SetTimeStep(AValue: Integer); + protected + procedure Changed; virtual; + function GetOwner: TPersistent; override; + public + constructor Create(AOwner: TcxSchedulerTimeGridView); virtual; + procedure Assign(Source: TPersistent); override; + + property Scheduler: TcxCustomScheduler read GetScheduler; + property TimeGrid: TcxSchedulerTimeGridView read FOwner; + published + property Major: Boolean read FMajor write SetMajor default True; + property MajorUnit: TcxSchedulerTimeGridScaleUnit read FMajorUnit write SetMajorUnit default suDay; + property MajorUnitSeparatorWidth: Integer read FMajorUnitSeparatorWidth write SetMajorUnitSeparatorWidth default cxDefaultSplitterWidth; + property Minor: Boolean read FMinor write SetMinor default True; + property MinorUnit: TcxSchedulerTimeGridScaleUnit read FMinorUnit write SetMinorUnit default suHour; + property MinorUnitWidth: Integer read FMinorUnitWidth write SetMinorUnitWidth default cxDefaultMinorUnitWidth; + property TimeStep: Integer read FTimeStep write SetTimeStep default 30; + end; + + { TcxSchedulerTimeGridViewHitTest } + + TcxSchedulerTimeGridViewHitTest = class(TcxSchedulerCustomResourceViewHitTest) + protected + function HitAtScale: Boolean; + public + property HitAtMajorScale: Boolean index htcMajorScale read GetBitState; + property HitAtMajorSeparator: Boolean index htcMajorSeparator read GetBitState; + property HitAtMinorScale: Boolean index htcMinorScale read GetBitState; + property HitAtSelectionBar: Boolean index htcSelectionBar read GetBitState; + end; + + { TcxSchedulerTimeGridView } + + TcxSchedulerCustomDrawMajorUnitEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + AViewInfo: TcxSchedulerTimeGridMajorScaleCell; var ADone: Boolean) of object; + TcxSchedulerCustomDrawMinorUnitEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + AViewInfo: TcxSchedulerTimeGridMinorScaleCell; var ADone: Boolean) of object; + TcxSchedulerCustomDrawSelectionBarEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; + AViewInfo: TcxSchedulerTimeGridSelectionBarCell; var ADone: Boolean) of object; + + TcxSchedulerTimeGridViewGetUnitDisplayTextEvent = procedure(Sender: TcxSchedulerTimeGridView; + const AStart, AFinish: TDateTime; ATextType: TcxSchedulerTimeGridScaleTextType; var AText: string) of object; + + TcxSchedulerTimeGridView = class(TcxSchedulerCustomResourceView) + private + FEventMaxLineCount: Integer; + FScales: TcxSchedulerTimeGridViewScales; + FEventDetailInfo: Boolean; + FShowMoreEventsButton: Boolean; + FShowResourceScrollBar: Boolean; + FSnapEventsToTimeSlots: Boolean; + FStyles: TcxSchedulerTimeGridViewStyles; + FVisibleFinish: TDateTime; + FVisibleStart: TDateTime; + FWorkDaysOnly: Boolean; + FWorkTimeOnly: Boolean; + FOnCustomDrawMajorUnit: TcxSchedulerCustomDrawMajorUnitEvent; + FOnCustomDrawMinorUnit: TcxSchedulerCustomDrawMinorUnitEvent; + FOnCustomDrawSelectionBar: TcxSchedulerCustomDrawSelectionBarEvent; + FOnGetMajorUnitDisplayText: TcxSchedulerTimeGridViewGetUnitDisplayTextEvent; + FOnGetMinorUnitDisplayText: TcxSchedulerTimeGridViewGetUnitDisplayTextEvent; + function GetHitTest: TcxSchedulerTimeGridViewHitTest; + function GetViewInfo: TcxSchedulerTimeGridViewViewInfo; + procedure SetEventMaxLineCount(AValue: Integer); + procedure SetScales(AValue: TcxSchedulerTimeGridViewScales); + procedure SetShowMoreEventsButton(AValue: Boolean); + procedure SetShowResourceScrollBar(AValue: Boolean); + procedure SetEventDetailInfo(AValue: Boolean); + procedure SetSnapEventsToTimeSlots(AValue: Boolean); + procedure SetStyles(AValue: TcxSchedulerTimeGridViewStyles); + procedure SetVisibleStart(AValue: TDateTime); + procedure SetWorkDaysOnly(AValue: Boolean); + procedure SetWorkTimeOnly(AValue: Boolean); + protected + FLockSelectionUpdate: Boolean; + FScrollPosition: Integer; + FScrollUpdateLocked: Boolean; + ScaleTextType: TcxSchedulerTimeGridScaleTextType; + function CanDeactivateOnDateNavigatorSelectionChange: Boolean; override; + function CanSelectPeriod: Boolean; override; + procedure Changed; override; + procedure CheckRefresh; + function CreateController: TcxSchedulerSubControlController; override; + function CreateHitTest: TcxSchedulerSubControlHitTest; override; + function CreatePainter: TcxSchedulerSubControlPainter; override; + function CreateScales: TcxSchedulerTimeGridViewScales; virtual; + function CreateStyles: TcxSchedulerTimeGridViewStyles; virtual; + function CreateViewAdapter: TcxCustomResourceViewAdapter; override; + function CreateViewInfo: TcxSchedulerSubControlViewInfo; override; + procedure DeactivateView; override; + procedure DoDrawSelectionBarCell(AItem: TcxSchedulerTimeGridSelectionBarCell; var ADone: Boolean); virtual; + procedure DoDrawTimeLineCell(AItem: TcxSchedulerTimeGridMinorScaleCell; var ADone: Boolean); virtual; + procedure DoDrawTimeLineHeaderCell(AItem: TcxSchedulerTimeGridMajorScaleCell; var ADone: Boolean); virtual; + procedure DoGetMajorUnitDisplayText(const AStart, AFinish: TDateTime; + ATextType: TcxSchedulerTimeGridScaleTextType; var AText: string); virtual; + procedure DoGetMinorUnitDisplayText(const AStart, AFinish: TDateTime; + ATextType: TcxSchedulerTimeGridScaleTextType; var AText: string); virtual; + function GetCompressWeekEnd: Boolean; override; + function GetEditWithSingleLineEditor(AEvent: TcxSchedulerControlEvent): Boolean; override; + function GetFirstVisibleDate: TDateTime; override; + function GetFirstVisibleTime: TDateTime; override; + function GetLastVisibleDate: TDateTime; override; + function GetLastVisibleTime: TDateTime; override; + function GetScrollTimeHint: string; override; + function GetTimeIncrement: TDateTime; override; + function GetViewContentRect: TRect; override; + procedure InitScrollBarsParameters; override; + function IsSnapEventsToTimeSlots: Boolean; + procedure MakeEventVisible(AEvent: TcxSchedulerControlEvent; + const ADate: TDateTime; AResource: TcxSchedulerStorageResourceItem); override; + procedure ScaleChanged; virtual; + procedure Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); override; + procedure SelectedDaysChanged; override; + procedure UpdateDateNavigatorSelection; + procedure ValidateSelectionFinishTime(var ADateTime: TDateTime); override; + procedure VisibleChanged; override; + // + property ViewInfo: TcxSchedulerTimeGridViewViewInfo read GetViewInfo; + public + constructor Create(AOwner: TcxCustomScheduler); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function GetMajorUnitDisplayText(const AStart, AFinish: TDateTime; + ATextType: TcxSchedulerTimeGridScaleTextType): string; + function GetMinorUnitDisplayText(const AStart, AFinish: TDateTime; + ATextType: TcxSchedulerTimeGridScaleTextType): string; + + property HitTest: TcxSchedulerTimeGridViewHitTest read GetHitTest; + property VisibleFinish: TDateTime read FVisibleFinish; + property VisibleStart: TDateTime read FVisibleStart write SetVisibleStart; + published + property Active; + property EventImagesLayout default eilAuto; + property EventMaxLineCount: Integer read FEventMaxLineCount write SetEventMaxLineCount default 0; + property Scales: TcxSchedulerTimeGridViewScales read FScales write SetScales; + property ShowMoreEventsButton: Boolean read FShowMoreEventsButton write SetShowMoreEventsButton default True; + property ShowResourceScrollBar: Boolean read FShowResourceScrollBar write SetShowResourceScrollBar default True; + property Styles: TcxSchedulerTimeGridViewStyles read FStyles write SetStyles; + property EventDetailInfo: Boolean read FEventDetailInfo write SetEventDetailInfo default False; + property ShowTimeAsClock; + property SnapEventsToTimeSlots: Boolean read FSnapEventsToTimeSlots write SetSnapEventsToTimeSlots default True; + property WorkDaysOnly: Boolean read FWorkDaysOnly write SetWorkDaysOnly default False; + property WorkTimeOnly: Boolean read FWorkTimeOnly write SetWorkTimeOnly default False; + property OnCustomDrawMajorUnit: TcxSchedulerCustomDrawMajorUnitEvent read FOnCustomDrawMajorUnit write FOnCustomDrawMajorUnit; + property OnCustomDrawMinorUnit: TcxSchedulerCustomDrawMinorUnitEvent read FOnCustomDrawMinorUnit write FOnCustomDrawMinorUnit; + property OnCustomDrawSelectionBar: TcxSchedulerCustomDrawSelectionBarEvent read FOnCustomDrawSelectionBar write FOnCustomDrawSelectionBar; + property OnGetMajorUnitDisplayText: TcxSchedulerTimeGridViewGetUnitDisplayTextEvent read FOnGetMajorUnitDisplayText write FOnGetMajorUnitDisplayText; + property OnGetMinorUnitDisplayText: TcxSchedulerTimeGridViewGetUnitDisplayTextEvent read FOnGetMinorUnitDisplayText write FOnGetMinorUnitDisplayText; + end; + + { TcxSchedulerTimeBuilder } + + TcxSchedulerTimeBuilder = class + protected + CheckTime: Boolean; + CheckDays: Boolean; + MajorUnit: TcxSchedulerTimeGridScaleUnit; + MinorUnit: TcxSchedulerTimeGridScaleUnit; + TimeScale: Integer; + ScaleUnit: TDateTime; + WorkDays: TDays; + WorkFinish: TDateTime; + WorkStart: TDateTime; + function CalculateDateTime(const ADateTime: TDateTime; AInc: Integer): TDateTime; + function CalculateScaleUnit(const AScaleUnit: Integer): Integer; + procedure CalculateWorkTime(AIsWorkTimeOnly: Boolean; var AWorkStart, AWorkFinish: TDateTime); + procedure CalculateWorkDays(AIsWorkDaysOnly: Boolean; var AWorkDays: TDays); + function RoundTime(const ADateTime: TDateTime): TDateTime; + function ValidateStartTime(const ADateTime: TDateTime): TDateTime; + procedure ValidateTime(var ADateTime: TDateTime; AGoForward: Boolean; AInc: Integer = 1); + procedure ValidateUnits(var AMajorUnit, AMinorUnit: TcxSchedulerTimeGridScaleUnit); + public + procedure CalculateActualStart(var ActualStart, AVisibleStart: TDateTime; + var AStartIndex: Integer); + procedure CheckWorkDays(var ADateTime: TDateTime; AGoForward: Boolean); + function Dec(const ADateTime: TDateTime): TDateTime; + function Inc(const ADateTime: TDateTime): TDateTime; + procedure Initialize(AView: TcxSchedulerTimeGridView; AWorkTimeOnly, AWorkDaysOnly: Boolean); + function IsPeriodChanged(const AFirst, ANext: TDateTime): Boolean; + function TimeCorrected(var AStart, AFinish: TDateTime; AGoForward: Boolean = True): Boolean; + function TimeMode: Boolean; + procedure ValidateVisibleStart(var ADateTime: TDateTime); + end; + + { TcxSchedulerTimeGridViewEventCellViewInfo } + + TcxSchedulerTimeGridViewEventCellViewInfo = class(TcxSchedulerEventCellViewInfo) + protected + procedure CalculateCaptions; override; + procedure CalculateDetailInfo; override; + procedure CalculateEventTimeAsClockLayout(const ABounds: TRect; + const ACaptionWidth, AImagesWidth: Integer; var ALeft: Integer); override; + procedure CalculateEventTimeVisibility; override; + function CalculateNonDetailEventImages(const ACaptionWidth: Integer; + out AImagesWidth: Integer): TRect; override; + procedure CalculateItemsLayout; override; + procedure CalculateShowTimeAsClock; override; + function GetEditingRect: TRect; override; + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + end; + + { IcxSchedulerTimeGridViewAdapter } + + IcxSchedulerTimeGridViewAdapter = interface + ['{A1808B72-237C-41D0-B864-BE8E24894F22}'] + function GetLineOffset: Integer; + function GetShowResourceHeaders: Boolean; + function GetShowLinks: Boolean; + function GetShowScales: Boolean; + function GetWorkDaysOnly: Boolean; + function GetWorkTimeOnly: Boolean; + end; + + { TcxSchedulerTimeGridViewAdapter } + + TcxSchedulerTimeGridViewAdapter = class(TcxCustomResourceViewAdapter, IcxSchedulerTimeGridViewAdapter) + protected + FVisibleStart: TDateTime; + function GetLineOffset: Integer; + function GetPrintRange(Index: Integer): TDateTime; override; + function GetShowLinks: Boolean; + function GetShowResourceHeaders: Boolean; + function GetShowScales: Boolean; + function GetWorkDaysOnly: Boolean; + function GetWorkTimeOnly: Boolean; + procedure Store; override; + procedure Restore; override; + end; + + { TcxSchedulerTimeGridViewViewInfo } + + TcxSchedulerTimeGridViewViewInfo = class(TcxSchedulerCustomResourceViewViewInfo) + private + FResourceViewShift: TcxObjectList; + procedure CalculateResourceViewShifts(ABuilder: TcxSchedulerEventLayoutBuilder); + procedure ClearMoreEventButtons; + function GetGroupCount: Integer; + function GetGroupLineCount(AIndex: Integer): Integer; + function GetResourceHeight: Integer; + function GetResourceViewShift(Index: Integer): TcxSchedulerTimeGridResourceScroll; + function GetTimeGridView: TcxSchedulerTimeGridView; + function GetVisibleLineCount(AResourceIndex: Integer): Integer; + procedure PrepareMoreEventButtons; + // calculate scales items + procedure CalculateMajorScale; + procedure CalculateMinorScale; + procedure CalculateSelectionBar; + protected + FActualStartTime: TDateTime; + FColumnCount: Integer; + FColumnsInMinorUnit: Integer; + FColumnWidth: Integer; + FEventMinSize: Integer; + FEventRowHeight: Integer; + FFirstVisibleIndex: Integer; + FLastVisibleTime: TDateTime; + FLineOffset: Integer; + FMajorScaleHeight: Integer; + FMajorTextType: TcxSchedulerTimeGridScaleTextType; + FMinorScaleHeight: Integer; + FMinorTextType: TcxSchedulerTimeGridScaleTextType; + FPrintResourceHeaders: Boolean; + FPrintScales: Boolean; + FResourceHeaderWidth: Integer; + FScales: TcxSchedulerTimeGridViewScales; + FScalesBounds: TRect; + FScalesHeight: Integer; + FScaleUnit: TDateTime; + FSelectionBarHeight: Integer; + FSeparatorWidth: Integer; + FShowLinks: Boolean; + FTimeBuilder: TcxSchedulerTimeBuilder; + FTimeLineCells: TcxSchedulerViewInfoCellList; + FVisibleColumnCount: Integer; + FWorkTimeOnly: Boolean; + FWorkDaysOnly: Boolean; + procedure AddEventForCalculation(ABuilder: TcxSchedulerEventLayoutBuilder; + AEvent: TcxSchedulerControlEvent; AResourceIndex: Integer); virtual; + function AddEventViewInfo(APlace: TcxSchedulerEventPlace; AResourceIndex: Integer; + const AStart, AFinish: TDateTime): TcxSchedulerEventCellViewInfo; + procedure AddMajorScaleCell(ABounds: TRect; const AStart, AFinish: TDateTime); virtual; + procedure AddMajorSeparator(var ALeft: Integer); + procedure AddMinorScaleCell(const ABounds: TRect; const AStart, AFinish: TDateTime); virtual; + function AddSelectionBarCell(const ABounds: TRect; + const AStart, AFinish: TDateTime): TcxSchedulerTimeGridSelectionBarCell; virtual; + procedure AddTimeLineItem(AClass: TcxSchedulerCustomViewInfoItemClass; const ABounds: TRect; + AType: Byte; const AStart, AFinish: TDateTime; const AViewParams: TcxViewParams; var Instance); + procedure AdjustTextType; + procedure CalculateContentCells; virtual; + procedure CalculateEventPosition(AEvent: TcxSchedulerControlEvent; + AColIndex: Integer; out AStartX, AFinishX: Integer; out AStart, AFinish: TDateTime); + procedure CalculateEvents; virtual; + procedure CalculateMetrics; override; + procedure CalculateResourceBounds; + procedure CalculateResourceHeaderCells; virtual; + procedure CalculateResourceHeadersAutoHeight(AWidth: Integer); override; + procedure CalculateResourceTopBottom(AResourceIndex: Integer; var ABounds: TRect); + procedure CalculateScales; virtual; + procedure CalculateScalesHeight; + procedure CheckEventVisibility(ACell: TcxSchedulerEventCellViewInfo; AIndex: Integer); virtual; + function CheckFinishTime(const ATime: TDateTime; AUnit: TcxSchedulerTimeGridScaleUnit): TDateTime; virtual; + procedure Clear; override; + function CreateEventCellViewInfo(AViewData: TcxSchedulerEventViewData): TcxSchedulerEventCellViewInfo; override; + function CreateLayoutBuilder: TcxSchedulerEventLayoutBuilder; virtual; + procedure DoCalculate; override; + procedure DoContentNavigationButtonClick(Sender: TcxSchedulerContentNavigationButtonViewInfo); override; + procedure DoResourceVerticalScroll(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer); + procedure DoTimeGridMoreEventsButtonClick(Sender: TcxSchedulerMoreEventsButtonViewInfo); + function IsColumnEvent(AEvent: TcxSchedulerControlEvent; AColumnIndex: Integer): Boolean; + function IsEventVisible(AEvent: TcxSchedulerControlEvent): Boolean; virtual; + function GetActualPos(const APos: Integer; const ATime, AStart, AFinish: TDateTime ): Integer; virtual; + function GetContentParams(const ATime: TDateTime; + AResource: TcxSchedulerResourceViewInfo): TcxViewParams; override; + function GetEventClipRect(AEventViewInfo: TcxSchedulerEventCellViewInfo): TRect; + function GetIndentBetweenLines: Integer; virtual; + procedure GetItemInfo(AIndex1, AIndex2, ATop, AHeight: Integer; + var ABounds: TRect; var AStart, AFinish: TDateTime); + function GetNeedShowCurrentTime: Boolean; virtual; + function GetMoreEventButtonClass: TcxSchedulerMoreEventsButtonViewInfoClass; override; + function GetResourceScrollBarMax(I: Integer): Integer; + function GetResourceImagesSize: TSize; override; + function GetResourcesContentWidth: Integer; override; + function GetResourceScrollBarKind: TScrollBarKind; override; + function GetStyleFont(AStyle: TcxStyle): TFont; + procedure MakeTimeVisible(const ATime: TDateTime); override; + function MeasureFontHeight(AStyle: TcxStyle; AHeight: Integer; Borders: TcxBorders): Integer; + procedure Realign(APlace: TcxSchedulerEventPlace); + procedure ReturnVisibleInterval(var AStart, AEnd: TDateTime); override; + procedure RestoreScrollInfo; + procedure StoreScrollInfo; + procedure ValidateStartTime; + + property ResourceViewShift[Index: Integer]: TcxSchedulerTimeGridResourceScroll read GetResourceViewShift; + property ResourceViewShiftList: TcxObjectList read FResourceViewShift; + public + constructor Create(AOwner: TcxSchedulerSubControl); override; + destructor Destroy; override; + procedure CalculateHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + + property ActualStartTime: TDateTime read FActualStartTime; + property ColumnCount: Integer read FColumnCount; + property ColumnWidth: Integer read FColumnWidth; + property FirstVisibleIndex: Integer read FFirstVisibleIndex; + property IndentBetweenLines: Integer read GetIndentBetweenLines; + property GroupCount: Integer read GetGroupCount; + property GroupLineCount[Index: Integer]: Integer read GetGroupLineCount; + property MajorTextType: TcxSchedulerTimeGridScaleTextType read FMajorTextType; + property MinorTextType: TcxSchedulerTimeGridScaleTextType read FMinorTextType; + property Scales: TcxSchedulerTimeGridViewScales read FScales; + property ScalesHeight: Integer read FScalesHeight; + property ScaleUnit: TDateTime read FScaleUnit; + property TimeBuilder: TcxSchedulerTimeBuilder read FTimeBuilder; + property TimeLineCells: TcxSchedulerViewInfoCellList read FTimeLineCells; + property ResourceHeaderWidth: Integer read FResourceHeaderWidth; + property View: TcxSchedulerTimeGridView read GetTimeGridView; + property VisibleColumnCount: Integer read FVisibleColumnCount; + property WorkDaysOnly: Boolean read FWorkDaysOnly; + property WorkTimeOnly: Boolean read FWorkTimeOnly; + end; + + { TcxSchedulerTimeGridScaleCell } + + TcxSchedulerTimeGridScaleCell = class(TcxSchedulerCustomViewInfoItem) + private + FAlignHorz: TAlignment; + FAlignVert: TcxAlignmentVert; + FBorderColor: TColor; + protected + FTimeFinish: TDateTime; + ItemType: Integer; + property AlignHorz: TAlignment read FAlignHorz write FAlignHorz; + property AlignVert: TcxAlignmentVert read FAlignVert write FAlignVert; + property BorderColor: TColor read FBorderColor write FBorderColor; + property TimeFinish: TDateTime read FTimeFinish; + property TimeStart: TDateTime read FDateTime; + public + constructor Create(APainter: TcxCustomLookAndFeelPainterClass; + const ABounds, AVisibleRect: TRect; const AViewParams: TcxViewParams); override; + end; + + { TcxSchedulerTimeGridMinorScaleCell } + + TcxSchedulerTimeGridMinorScaleCell = class(TcxSchedulerTimeGridScaleCell) + protected + FHideDisplayText: Boolean; + FTextBounds: TRect; + procedure Calculate; virtual; + procedure DoDraw; override; + procedure DrawContent; + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + public + property AlignHorz; + property AlignVert; + property BorderColor; + property DisplayText; + property TimeFinish; + property TimeStart; + property TextBounds: TRect read FTextBounds; + end; + + { TcxSchedulerTimeGridMajorScaleCell } + + TcxSchedulerTimeGridMajorScaleCell = class(TcxSchedulerTimeGridMinorScaleCell) + protected + FRightIndent: Integer; + procedure Calculate; override; + procedure DoDraw; override; + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + public + property DisplayText; + property HideDisplayText: Boolean read FHideDisplayText write FHideDisplayText; + property RightIndent: Integer read FRightIndent; + end; + + { TcxSchedulerTimeGridSelectionBarCell } + + TcxSchedulerTimeGridSelectionBarCell = class(TcxSchedulerTimeGridMinorScaleCell) + protected + FIsCurrentTimeCell: Boolean; + FSelected: Boolean; + FShowCurrentTime: Boolean; + FTimeLineRect: TRect; + FViewHeight: Integer; + procedure Calculate; override; + procedure CalculateTimeLineParams(ANeedShowCurrentTime: Boolean); + procedure DoDraw; override; + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + + property ViewHeight: Integer read FViewHeight; + public + property IsCurrentTimeCell: Boolean read FIsCurrentTimeCell; + property Selected: Boolean read FSelected; + property ShowCurrentTime: Boolean read FShowCurrentTime; + property TimeLineRect: TRect read FTimeLineRect; + end; + + { TcxSchedulerMajorSeparatorCellViewInfo } + + TcxSchedulerMajorSeparatorCellViewInfo = class(TcxSchedulerGroupSeparatorCellViewInfo) + protected + FContentBounds: TRect; + procedure DoDraw; override; + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + public + property ContentBounds: TRect read FContentBounds; + end; + + { TcxSchedulerTimeGridViewPainter } + + TcxSchedulerTimeGridViewPainter = class(TcxSchedulerCustomViewPainter) + private + FView: TcxSchedulerTimeGridView; + function GetViewInfo: TcxSchedulerTimeGridViewViewInfo; + protected + procedure DrawTimeLineCellItem(AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); virtual; + // + public + procedure Paint; override; + property View: TcxSchedulerTimeGridView read FView; + property ViewInfo: TcxSchedulerTimeGridViewViewInfo read GetViewInfo; + end; + + { TcxSchedulerTimeGridMoreEventsButton } + + TcxSchedulerTimeGridMoreEventsButtonViewInfo = class(TcxSchedulerMoreEventsButtonViewInfo) + private + FDelta: Integer; + FResourceIndex: Integer; + FValidDelta: Boolean; + public + property Delta: Integer read FDelta write FDelta; + property ResourceIndex: Integer read FResourceIndex write FResourceIndex; + property ValidDelta: Boolean read FValidDelta write FValidDelta; + end; + + { TcxSchedulerTimeGridScrollBar } + + TcxSchedulerTimeGridScrollBar = class(TcxControlScrollBar) + private + FResourceIndex: Integer; + public + property ResourceIndex: Integer read FResourceIndex; + end; + + { TcxSchedulerTimeGridResourceScroll } + + TcxSchedulerTimeGridResourceScroll = class + private + FData: Integer; + FEventMaxLine: Integer; + FMoreEventButtons: array of TcxSchedulerMoreEventsButtonViewInfo; + FScrollBar: TcxSchedulerTimeGridScrollBar; + protected + FShift: Integer; + procedure ClearMoreEventButtons; + procedure SetEventMaxLine(AValue: Integer); + procedure Store(AClear: Boolean); + procedure Restore; + public + destructor Destroy; override; + procedure CreateScrollBar(AResourceBounds: TRect; + ATimeGridView: TcxSchedulerTimeGridView; AResourceIndex, ARange, APosition: Integer); + + property ScrollBar: TcxSchedulerTimeGridScrollBar read FScrollBar; + end; + +const + ValidMinorUnits: array[TcxSchedulerTimeGridScaleUnit] of TcxSchedulerTimeGridScaleUnits = + ([], [suHour], [suDay], [suDay], [suDay, suMonth], [suDay, suMonth, suQuarter]); + + // unit caption text formats + + WeekTextFormats: array[TcxSchedulerTimeGridScaleTextType] of string = + ('mmmm dd, yyyy', 'mmm dd, yy', 'mmmm dd, yy', 'mmmm dd, yyyy'); + MonthTextFormats: array[TcxSchedulerTimeGridScaleTextType] of string = + ('mmmm, yyyy', 'mm, yy', 'mmm, yy', 'mmmm, yyyy'); + QuarterTextFormats: array[TcxSchedulerTimeGridScaleTextType, 0..3] of string = + (('Q1{ ''yy}', 'Q2{ ''yy}', 'Q3{ ''yy}', 'Q4{ ''yy}'), + ('Q1{ ''yy}', 'Q2{ ''yy}', 'Q3{ ''yy}', 'Q4{ ''yy}'), + ('Q1{ ''yyyy}', 'Q2{ ''yyyy}', 'Q3 ''{yyyy}', 'Q4{ ''yyyy}'), + ('1st Quarter{, yyyy}', '2nd Quarter{, yyyy}', + '3rd Quarter{, yyyy}', '4th Quarter{, yyyy}')); + YearTextFormats: array[0..1] of string = ('yyyy', 'yy'); + +implementation + +const + DefaultBorders = [bRight, bBottom]; + Direction: array[Boolean] of Integer = (-1, 1); + + ScrollMaxPos: Integer = 50; + ScrollPage: Integer = 5; + +function cxTimeLineCellsCompare(ACell1, ACell2: TcxSchedulerTimeGridMinorScaleCell): Integer; +begin + Result := ACell2.Bounds.Top - ACell1.Bounds.Top; + if Result = 0 then + Result := ACell2.Bounds.Left - ACell1.Bounds.Left; +end; + +function GetQuarterAsText(ATextType: TcxSchedulerTimeGridScaleTextType; + const ADateTime: TDateTime; AIncludeYear: Boolean = False): string; +var + I, J, K: Integer; + AYear: string; + ValidYearFormat: Boolean; +const + UnusedChars = [' ', '''', ',', '_']; +begin + Result := QuarterTextFormats[ATextType, (MonthOf(ADateTime) - 1) div 3]; + I := Pos('{', Result); + J := Pos('}', Result); + ValidYearFormat := (I > 0) and (J > 0) and (J > I); + if ValidYearFormat then + begin + if AIncludeYear then + begin + Delete(Result, J, 1); + Delete(Result, I, 1); + for K := 0 to High(YearTextFormats) do + begin + I := Pos(YearTextFormats[K], Result); + if I = 0 then Continue; + AYear := FormatDateTime(YearTextFormats[K], ADateTime); + Delete(Result, I, Length(YearTextFormats[K])); + Insert(AYear, Result, I); + Break; + end + end + else + Delete(Result, I, J - I + 1); + end; +end; + +function GetMinorCellDisplayText(ATextType: TcxSchedulerTimeGridScaleTextType; + AScale, AMajorScale: TcxSchedulerTimeGridScaleUnit; const AStart, AFinish: TDateTime): string; +begin + case AScale of + suHour: + Result := DateTimeHelper.HourToStr(TimeOf(AStart)); + suDay: + begin + if ATextType in [sttLong, sttUnknown] then + Result := DateTimeHelper.DateToLongDateStr(AStart) + else + if AMajorScale <= suMonth then + Result := FormatDateTime('d ddd', AStart) + else + Result := FormatDateTime('d/m', AStart); + end; + suWeek: + Result := GetMinorCellDisplayText(ATextType, suDay, AMajorScale, AStart, AStart) + '-' + + GetMinorCellDisplayText(ATextType, suDay, AMajorScale, AFinish, AFinish); + suMonth: + Result := LongMonthNames[MonthOf(AStart)];// + suQuarter: + Result := GetQuarterAsText(ATextType, AStart); + suYear: + Result := IntToStr(YearOf(AStart)); + else + Result := ''; + end; +end; + +function GetMajorCellDisplayText(ATextType: TcxSchedulerTimeGridScaleTextType; + AScale: TcxSchedulerTimeGridScaleUnit; const AStart, AFinish: TDateTime): string; +begin + case AScale of + suDay: + if ATextType = sttLong then + Result := DateTimeHelper.DateToLongDateStr(AStart) + else + Result := DateTimeHelper.DateToLongDateStr(AStart); + suWeek: + Result := FormatDateTime(WeekTextFormats[ATextType], AStart) + + ' - ' + FormatDateTime(WeekTextFormats[ATextType], AFinish); + suMonth: + Result := FormatDateTime(MonthTextFormats[ATextType], AStart); + suQuarter: + Result := GetQuarterAsText(ATextType, AStart, True); + suYear: + Result := GetMinorCellDisplayText(ATextType, suYear, suYear, AStart, AFinish); + else + Result := ''; + end; +end; + +{ TcxTimeGridDragEventHelper } + +procedure TcxTimeGridDragEventHelper.CorrectAllDayEventProperty; +var + I: Integer; + AEvent: TcxSchedulerControlEvent; + ASaveStart, ASaveFinish: TDateTime; + AllDay: Boolean; +begin + for I := 0 to Clones.Count - 1 do + begin + AEvent := Clones[I]; + with AEvent do + begin + AllDay := (TimeOf(Start) = 0) and (TimeOf(Finish) = 0) and (Duration >= 1); + if AllDay <> AllDayEvent then + begin + if AllDayEvent then + begin + ASaveStart := Start; + ASaveFinish := Finish; + AllDayEvent := False; + Start := ASaveStart; + Finish := ASaveFinish; + end + else + AllDayEvent := True; + CheckEventState(AEvent); + end; + end; + end; +end; + +function TcxTimeGridDragEventHelper.GetHitTest: TcxSchedulerTimeGridViewHitTest; +begin + Result := TcxSchedulerTimeGridViewHitTest(inherited HitTest); +end; + +function TcxTimeGridDragEventHelper.IsValidTime: Boolean; +begin + Result := not HitTest.HitAtMajorScale and inherited IsValidTime; +end; + +procedure TcxTimeGridDragEventHelper.UpdateViewClonesTime; +var + I: Integer; + ADelta: TDateTime; +begin + ADelta := Controller.StartDragHitTime - HitTest.Time; + for I := 0 to Clones.Count - 1 do + with Clones[I] do + MoveTo(Source.Start - ADelta); + CorrectAllDayEventProperty; +end; + +{ TcxTimeGridEventSizing } + +function TcxTimeGridEventSizing.IsValidTime: Boolean; +begin + Result := not HitTest.HitAtMajorScale and inherited IsValidTime; +end; + +procedure TcxTimeGridEventSizing.UpdateEventBounds; +var + AllDayEvent: Boolean; + ATime, ASaveTime: TDateTime; +begin + ATime := HitTest.Time; + if Controller.DragKind = edkResizeStart then + begin + ATime := Min(ATime, Event.Finish); + AllDayEvent := (TimeOf(Event.Finish) = 0) and (TimeOf(ATime) = 0) and + (Event.Duration >= 1); + if AllDayEvent <> Event.AllDayEvent then + begin + if Event.AllDayEvent then + begin + ASaveTime := Event.Finish; + Event.AllDayEvent := AllDayEvent; + Event.Finish := ASaveTime; + end + else + Event.AllDayEvent := True; + CheckEventState(Event); + end; + Event.Start := ATime; + end + else + begin + ATime := Max(Event.Start, TimeBuilder.Inc(ATime)); + AllDayEvent := (TimeOf(Event.Start) = 0) and (TimeOf(ATime) = 0) and + (Event.Duration >= 1); + if AllDayEvent <> Event.AllDayEvent then + begin + if Event.AllDayEvent then + begin + ASaveTime := Event.Start; + Event.AllDayEvent := AllDayEvent; + Event.Start := ASaveTime; + end + else + Event.AllDayEvent := True; + CheckEventState(Event); + end; + Event.Finish := ATime; + end; + RefreshCurrentView; +end; + +function TcxTimeGridEventSizing.GetHitTest: TcxSchedulerTimeGridViewHitTest; +begin + Result := TcxSchedulerTimeGridViewHitTest(inherited HitTest); +end; + +function TcxTimeGridEventSizing.GetTimeBuilder: TcxSchedulerTimeBuilder; +begin + Result := TcxSchedulerTimeGridView(Scheduler.CurrentView).ViewInfo.TimeBuilder; +end; + +{ TcxSchedulerTimeGridViewController } + +constructor TcxSchedulerTimeGridViewController.Create(AOwner: TcxSchedulerSubControl); +begin + inherited Create(AOwner); + FTimer := TTimer.Create(nil); + FTimer.Enabled := False; +end; + +destructor TcxSchedulerTimeGridViewController.Destroy; +begin + FTimer.Free; + inherited Destroy; +end; + +function TcxSchedulerTimeGridViewController.CreateDragEventHelper: TcxDragEventHelper; +begin + Result := TcxTimeGridDragEventHelper.Create(Scheduler); +end; + +function TcxSchedulerTimeGridViewController.CreateNavigation: TcxSchedulerViewNavigation; +begin + Result := TcxSchedulerTimeGridViewNavigation.Create(View); +end; + +function TcxSchedulerTimeGridViewController.CreateResizeEventHelper: TcxEventSizingHelper; +begin + Result := TcxTimeGridEventSizing.Create(Scheduler); +end; + +procedure TcxSchedulerTimeGridViewController.BeforeMouseDown( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FIsEditingBeforeMouseDown := IsEditing; + inherited BeforeMouseDown(Button, Shift, X, Y); +end; + +procedure TcxSchedulerTimeGridViewController.CancelScroll; +begin + InitTimer(False, scEndScroll); +end; + +procedure TcxSchedulerTimeGridViewController.CheckScrolling(const APos: TPoint); +var + ACanScroll: Boolean; + AScrollCode: TScrollCode; + R: TRect; +begin + R := ViewInfo.Bounds; + Inc(R.Top, ViewInfo.FScalesHeight); + Inc(R.Left, ViewInfo.FResourceHeaderWidth); + FPos := APos; + ACanScroll := cxRectPtIn(R, APos); + AScrollCode := TScrollCode(Timer.Tag); + if APos.X < (R.Left + cxScrollZoneSize) then + AScrollCode := scLineUp + else + if APos.X >= (R.Right - cxScrollZoneSize) then + AScrollCode := scLineDown + else + ACanScroll := False; + if (ACanScroll <> Timer.Enabled) or (Integer(AScrollCode) <> Timer.Tag) then + InitTimer(ACanScroll, AScrollCode); +end; + +procedure TcxSchedulerTimeGridViewController.InitTimer( + AllowStart: Boolean; AScrollCode: TScrollCode); +begin + if AllowStart and FIsEditingBeforeMouseDown then + begin + FIsEditingBeforeMouseDown := False; + AllowStart := False; + end; + if not AllowStart then + Timer.OnTimer := nil + else + Timer.OnTimer := OnTimer; + Timer.Enabled := AllowStart; + Timer.Interval := cxScrollInterval; + Timer.Tag := Integer(AScrollCode); +end; + +procedure TcxSchedulerTimeGridViewController.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseDown(Button, Shift, X, Y); + if CanProcessMouseMove and (Button = mbLeft) and not NavigationButtonClicked then + CheckScrolling(cxPoint(X, Y)) +end; + +procedure TcxSchedulerTimeGridViewController.MouseMove( + Shift: TShiftState; X, Y: Integer); +begin + if (DragKind = edkNone) and HitTest.HitAtScale and HitTest.HitAtTime then + HitTest.FResource := Scheduler.SelResource; + inherited MouseMove(Shift, X, Y); + if CanProcessMouseMove and (ssLeft in Shift) and not NavigationButtonClicked then + CheckScrolling(cxPoint(X, Y)) +end; + +procedure TcxSchedulerTimeGridViewController.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); +end; + +procedure TcxSchedulerTimeGridViewController.Scrolling(AScrollCode: TScrollCode; var AScrollPos: Integer); +begin + View.Scroll(sbHorizontal, AScrollCode, AScrollPos); +end; + +procedure TcxSchedulerTimeGridViewController.SyncEventSelection( + AEvent: TcxSchedulerControlEvent); +var + AStart, AFinish: TDateTime; + AViewInfo: tcxSchedulerEventCellViewInfo; +begin + if HitTest.HitAtEvent and (HitTest.EventCell <> nil) and (HitTest.Event = AEvent) then + AViewInfo := HitTest.EventCell + else + if not View.FindEventViewInfo(AEvent.Source, AEvent.Start, AEvent.GetResourceItem, AViewInfo) then + AViewInfo := nil; + if AViewInfo <> nil then + begin + AStart := AViewInfo.ContentStart; + AFinish := AViewInfo.ContentFinish - View.GetTimeIncrement; + if View.WorkDaysOnly then + ViewInfo.TimeBuilder.CheckWorkDays(AFinish, False); + TcxSchedulerTimeGridViewNavigation(Navigation).ReplaceSelParams( + AStart, AFinish, AEvent.GetResourceItem); + end + else + inherited SyncEventSelection(AEvent); +end; + +procedure TcxSchedulerTimeGridViewController.OnTimer(Sender: TObject); + + function GetShiftState: TShiftState; + const + Buttons: array[Boolean] of Integer = (VK_LBUTTON, VK_RBUTTON); + begin + Result := []; + if GetAsyncKeyState(Buttons[GetSystemMetrics(SM_SWAPBUTTON) <> 0]) < 0 then + Include(Result, ssLeft); + if GetAsyncKeyState(VK_CONTROL) < 0 then + Include(Result, ssCtrl); + end; + +var + APos: Integer; + AShift: TShiftState; +begin + AShift := GetShiftState; + if not (ssLeft in AShift) then + begin + CancelScroll; + SetCaptureControl(nil); + end + else + begin + APos := View.FScrollPosition; + Scrolling(TScrollCode(Timer.Tag), APos); + MouseMove(AShift, FPos.X, FPos.Y); + if (DragKind in [edkResizeStart, edkResizeEnd]) then + CheckUpdateEventBounds; + end; +end; + +function TcxSchedulerTimeGridViewController.GetHitTest: TcxSchedulerTimeGridViewHitTest; +begin + Result := TcxSchedulerTimeGridViewHitTest(inherited HitTest); +end; + +function TcxSchedulerTimeGridViewController.GetView: TcxSchedulerTimeGridView; +begin + Result := TcxSchedulerTimeGridView(inherited View); +end; + +function TcxSchedulerTimeGridViewController.GetViewInfo: TcxSchedulerTimeGridViewViewInfo; +begin + Result := View.ViewInfo; +end; + +{ TcxSchedulerTimeGridViewNavigation } + +procedure TcxSchedulerTimeGridViewNavigation.KeyDown( + var AKey: Word; AShift: TShiftState); +var + AFinish: TDateTime; +begin + case AKey of + VK_LEFT, VK_RIGHT: + with TimeBuilder do + begin + AFinish := CalculateDateTime(FCurrentAnchor, Direction[AKey = VK_RIGHT]); + if CheckTime and (((AFinish > SelAnchor) and (RoundTime(TimeOf(AFinish)) = WorkFinish)) or + IsPeriodChanged(AFinish, FCurrentAnchor)) then + AFinish := CalculateDateTime(AFinish, Direction[AKey = VK_RIGHT]); + TimeBuilder.CheckWorkDays(AFinish, AKey = VK_RIGHT); + ViewInfo.MakeTimeVisible(AFinish); + SetSelAnchor(AFinish, AShift, FCurrentResource); + end; + VK_HOME: + SetSelAnchor(View.VisibleStart, AShift, FCurrentResource); + VK_END: + SetSelAnchor(View.VisibleFinish, AShift, FCurrentResource); + VK_UP, VK_DOWN: + if not (ssShift in AShift) and (GetNextResource(AKey = VK_DOWN) <> FCurrentResource) then + SetSelAnchor(FCurrentAnchor, AShift, GetNextResource(AKey = VK_DOWN)) + else + if ScrollResourcesEx(AKey = VK_DOWN, FCurrentResource) then + ReplaceSelParams(FCurrentResource); + end; + View.CheckRefresh; +end; + +procedure TcxSchedulerTimeGridViewNavigation.ValidateSelection( + var ASelStart, ASelFinish: TDateTime; + var AResource: TcxSchedulerStorageResourceItem); + +begin + if ASelStart = NullDate then + begin + ASelStart := View.VisibleStart; + ASelFinish := ASelStart; + end; + TimeBuilder.ValidateTime(ASelStart, True, 0); + TimeBuilder.ValidateTime(ASelFinish, True, 0); + TimeBuilder.CheckWorkDays(ASelStart, True); + TimeBuilder.CheckWorkDays(ASelFinish, True); +end; + +function TcxSchedulerTimeGridViewNavigation.GetTimeBuilder: TcxSchedulerTimeBuilder; +begin + Result := ViewInfo.TimeBuilder; +end; + +function TcxSchedulerTimeGridViewNavigation.GetView: TcxSchedulerTimeGridView; +begin + Result := TcxSchedulerTimeGridView(inherited View); +end; + +function TcxSchedulerTimeGridViewNavigation.GetViewInfo: TcxSchedulerTimeGridViewViewInfo; +begin + Result := View.ViewInfo; +end; + +{ TcxSchedulerTimeGridViewStyles } + +constructor TcxSchedulerTimeGridViewStyles.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FScheduler := TimeGrid.Scheduler; + BitmapInViewParams := True; +end; + +procedure TcxSchedulerTimeGridViewStyles.Assign(Source: TPersistent); +var + I: Integer; +begin + if Source is TcxSchedulerTimeGridViewStyles then + for I := 0 to cxcsMaxTimeGridStyle do + SetValue(I, TcxSchedulerTimeGridViewStyles(Source).GetValue(I)); + inherited Assign(Source); +end; + +function TcxSchedulerTimeGridViewStyles.GetMajorScaleParams( + const ADateTime: TDateTime): TcxViewParams; +var + AStyle: TcxStyle; +begin + AStyle := nil; + if Assigned(FOnGetMajorScaleParams) then + FOnGetMajorScaleParams(TimeGrid, ADateTime, AStyle); + GetViewParams(cxcsMajorScale, nil, AStyle, Result); +end; + +function TcxSchedulerTimeGridViewStyles.GetMajorScaleUnitSeparatorParams: TcxViewParams; +begin + GetViewParams(cxcsMajorScaleUnitSeparator, nil, nil, Result); +end; + +function TcxSchedulerTimeGridViewStyles.GetMinorScaleParams( + const ADateTime: TDateTime): TcxViewParams; +var + AStyle: TcxStyle; +begin + AStyle := nil; + if Assigned(FOnGetMinorScaleParams) then + FOnGetMinorScaleParams(TimeGrid, ADateTime, AStyle); + GetViewParams(cxcsMinorScale, nil, AStyle, Result); +end; + +function TcxSchedulerTimeGridViewStyles.GetSelectionBarParams( + const ADateTime: TDateTime): TcxViewParams; +begin + Result := GetSelectionBarParamsEx(ADateTime, IsTimeSelected(ADateTime)); +end; + +procedure TcxSchedulerTimeGridViewStyles.Changed(AIndex: Integer); +begin + inherited Changed(AIndex); + TimeGrid.ScaleChanged; +end; + +procedure TcxSchedulerTimeGridViewStyles.GetDefaultViewParams( + Index: Integer; AData: TObject; out AParams: TcxViewParams); +var + APainter: TcxCustomLookAndFeelPainterClass; +begin + AParams.Bitmap := nil; + AParams.Font := Scheduler.Font; + AParams.TextColor := clBlack; + APainter := TimeGrid.LookAndFeelPainter; + case Index of + cxcsSelectionBar: + begin + if Boolean(AData) then + AParams.Color := Scheduler.Styles.GetSelectionParams.Color + else + AParams.Color := APainter.DefaultTimeGridSelectionBarColor; + end; + cxcsMajorScaleUnitSeparator, cxcsMajorScale: + begin + AParams.Color := APainter.DefaultTimeGridMajorScaleColor; + AParams.TextColor := APainter.DefaultTimeGridMajorScaleTextColor; + end; + cxcsMinorScale: + begin + AParams.Color := APainter.DefaultTimeGridMinorScaleColor; + AParams.TextColor := APainter.DefaultTimeGridMinorScaleTextColor; + end; + end; +end; + +function TcxSchedulerTimeGridViewStyles.GetSelectionBarParamsEx( + const ADateTime: TDateTime; ASelected: Boolean): TcxViewParams; +var + AStyle: TcxStyle; +begin + AStyle := nil; + if Assigned(FOnGetSelectionBarParams) then + FOnGetSelectionBarParams(TimeGrid, ADateTime, AStyle); + GetViewParams(cxcsSelectionBar, TObject(ASelected), AStyle, Result); +end; + +function TcxSchedulerTimeGridViewStyles.IsTimeSelected( + const ADateTime: TDateTime): Boolean; +begin + with TimeGrid.ViewInfo do + Result := IsTimeSelected(ADateTime, FSelResource); +end; + +function TcxSchedulerTimeGridViewStyles.GetTimeGrid: TcxSchedulerTimeGridView; +begin + Result := TcxSchedulerTimeGridView(inherited GetOwner); +end; + +{ TcxSchedulerTimeGridViewScales } + +constructor TcxSchedulerTimeGridViewScales.Create( + AOwner: TcxSchedulerTimeGridView); +begin + FOwner := AOwner; + Major := True; + MajorUnitSeparatorWidth := cxDefaultSplitterWidth; + MajorUnit := suDay; + Minor := True; + MinorUnit := suHour; + MinorUnitWidth := cxDefaultMinorUnitWidth; + TimeStep := 30; +end; + +procedure TcxSchedulerTimeGridViewScales.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerTimeGridViewScales then + with TcxSchedulerTimeGridViewScales(Source) do + begin + Self.FMajor := FMajor; + Self.FMajorUnitSeparatorWidth := FMajorUnitSeparatorWidth; + Self.FMajorUnit := FMajorUnit; + Self.FMinor := FMinor; + Self.FMinorUnit := FMinorUnit; + Self.FMinorUnitWidth := FMinorUnitWidth; + Self.FTimeStep := FTimeStep; + end + else + inherited Assign(Source); +end; + +procedure TcxSchedulerTimeGridViewScales.Changed; +begin + TimeGrid.ScaleChanged; +end; + +function TcxSchedulerTimeGridViewScales.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +function TcxSchedulerTimeGridViewScales.GetScheduler: TcxCustomScheduler; +begin + Result := FOwner.Scheduler; +end; + +procedure TcxSchedulerTimeGridViewScales.SetMajor(AValue: Boolean); +begin + if AValue <> FMajor then + begin + FMajor := AValue; + Changed; + end; +end; + +procedure TcxSchedulerTimeGridViewScales.SetMajorUnitSeparatorWidth(AValue: Integer); +begin + AValue := Max(0, AValue); + if AValue <> FMajorUnitSeparatorWidth then + begin + FMajorUnitSeparatorWidth := AValue; + Changed; + end; +end; + +procedure TcxSchedulerTimeGridViewScales.SetMajorUnit(AValue: TcxSchedulerTimeGridScaleUnit); +begin + if AValue <> FMajorUnit then + begin + FMajorUnit := AValue; + Changed; + end; +end; + +procedure TcxSchedulerTimeGridViewScales.SetMinor(AValue: Boolean); +begin + if AValue <> FMinor then + begin + FMinor := AValue; + Changed; + end; +end; + +procedure TcxSchedulerTimeGridViewScales.SetMinorUnit(AValue: TcxSchedulerTimeGridScaleUnit); +begin + if AValue <> FMinorUnit then + begin + FMinorUnit := AValue; + Changed; + end; +end; + +procedure TcxSchedulerTimeGridViewScales.SetMinorUnitWidth(AValue: Integer); +begin + AValue := Max(cxMinColumnWidth, AValue); + if AValue <> FMinorUnitWidth then + begin + FMinorUnitWidth := AValue; + Changed; + end; +end; + +procedure TcxSchedulerTimeGridViewScales.SetTimeStep(AValue: Integer); +begin + if AValue <> FTimeStep then + begin + FTimeStep := Max(cxMinHourScale, Min(cxMaxHourScale, AValue)); + while cxMaxHourScale mod FTimeStep <> 0 do Inc(FTimeStep); + Changed; + end; +end; + +{ TcxSchedulerTimeGridViewHitTest } + +function TcxSchedulerTimeGridViewHitTest.HitAtScale: Boolean; +begin + Result := HitAtMajorScale or HitAtSelectionBar or HitAtMinorScale; +end; + +{ TcxSchedulerTimeGridView } + +constructor TcxSchedulerTimeGridView.Create(AOwner: TcxCustomScheduler); +begin + inherited Create(AOwner); + FVisibleStart := NullDate; + FScales := CreateScales; + FStyles := CreateStyles; + EventImagesLayout := eilAuto; + FScrollPosition := (ScrollMaxPos - ScrollPage) div 2; + FShowMoreEventsButton := True; + FShowResourceScrollBar := True; + FSnapEventsToTimeSlots := True; +end; + +destructor TcxSchedulerTimeGridView.Destroy; +begin + FScales.Free; + FStyles.Free; + inherited Destroy; +end; + +procedure TcxSchedulerTimeGridView.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerTimeGridView then + with TcxSchedulerTimeGridView(Source) do + begin + Self.FScales.Assign(FScales); + Self.FStyles.Assign(FStyles); + Self.FShowMoreEventsButton := FShowMoreEventsButton; + Self.FShowResourceScrollBar := FShowResourceScrollBar; + Self.FWorkDaysOnly := FWorkDaysOnly; + Self.FWorkTimeOnly := FWorkTimeOnly; + end; + inherited Assign(Source); +end; + +function TcxSchedulerTimeGridView.GetMajorUnitDisplayText( + const AStart, AFinish: TDateTime; ATextType: TcxSchedulerTimeGridScaleTextType): string; +begin + Result := GetMajorCellDisplayText(ATextType, Scales.MajorUnit, AStart, AFinish); + DoGetMajorUnitDisplayText(AStart, AFinish, ATextType, Result); +end; + +function TcxSchedulerTimeGridView.GetMinorUnitDisplayText( + const AStart, AFinish: TDateTime; ATextType: TcxSchedulerTimeGridScaleTextType): string; +begin + Result := GetMinorCellDisplayText(ATextType, Scales.MinorUnit, + Scales.MajorUnit, AStart, AFinish); + DoGetMinorUnitDisplayText(AStart, AFinish, ATextType, Result); +end; + +function TcxSchedulerTimeGridView.CanDeactivateOnDateNavigatorSelectionChange: Boolean; +begin + Result := False; +end; + +function TcxSchedulerTimeGridView.CanSelectPeriod: Boolean; +begin + Result := False; +end; + +procedure TcxSchedulerTimeGridView.Changed; +begin + inherited Changed; +end; + +procedure TcxSchedulerTimeGridView.CheckRefresh; +begin + if (FirstVisibleDate < EventList.SelStart) or (LastVisibleDate >= EventList.SelFinish) then + Scheduler.FullRefresh; +end; + +function TcxSchedulerTimeGridView.CreateController: TcxSchedulerSubControlController; +begin + Result := TcxSchedulerTimeGridViewController.Create(Self); +end; + +function TcxSchedulerTimeGridView.CreateHitTest: TcxSchedulerSubControlHitTest; +begin + Result := TcxSchedulerTimeGridViewHitTest.Create(Self); +end; + +function TcxSchedulerTimeGridView.CreatePainter: TcxSchedulerSubControlPainter; +begin + Result := TcxSchedulerTimeGridViewPainter.Create(Self); +end; + +function TcxSchedulerTimeGridView.CreateScales: TcxSchedulerTimeGridViewScales; +begin + Result := TcxSchedulerTimeGridViewScales.Create(Self); +end; + +function TcxSchedulerTimeGridView.CreateStyles: TcxSchedulerTimeGridViewStyles; +begin + Result := TcxSchedulerTimeGridViewStyles.Create(Self); +end; + +function TcxSchedulerTimeGridView.CreateViewAdapter: TcxCustomResourceViewAdapter; +begin + Result := TcxSchedulerTimeGridViewAdapter.Create(Self); +end; + +function TcxSchedulerTimeGridView.CreateViewInfo: TcxSchedulerSubControlViewInfo; +begin + Result := TcxSchedulerTimeGridViewViewInfo.Create(Self); +end; + +procedure TcxSchedulerTimeGridView.DeactivateView; +begin + inherited DeactivateView; + ViewInfo.ResourceViewShiftList.Clear; +end; + +procedure TcxSchedulerTimeGridView.DoDrawSelectionBarCell( + AItem: TcxSchedulerTimeGridSelectionBarCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawSelectionBar) then + OnCustomDrawSelectionBar(Self, Canvas, AItem, ADone); +end; + +procedure TcxSchedulerTimeGridView.DoDrawTimeLineCell( + AItem: TcxSchedulerTimeGridMinorScaleCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawMinorUnit) then + FOnCustomDrawMinorUnit(Self, Canvas, AItem, ADone); +end; + +procedure TcxSchedulerTimeGridView.DoDrawTimeLineHeaderCell( + AItem: TcxSchedulerTimeGridMajorScaleCell; var ADone: Boolean); +begin + if Assigned(FOnCustomDrawMajorUnit) then + FOnCustomDrawMajorUnit(Self, Canvas, AItem, ADone); +end; + +procedure TcxSchedulerTimeGridView.DoGetMajorUnitDisplayText( + const AStart, AFinish: TDateTime; + ATextType: TcxSchedulerTimeGridScaleTextType; var AText: string); +begin + if Assigned(FOnGetMajorUnitDisplayText) then + FOnGetMajorUnitDisplayText(Self, AStart, AFinish, ATextType, AText); +end; + +procedure TcxSchedulerTimeGridView.DoGetMinorUnitDisplayText( + const AStart, AFinish: TDateTime; + ATextType: TcxSchedulerTimeGridScaleTextType; var AText: string); +begin + if Assigned(FOnGetMinorUnitDisplayText) then + FOnGetMinorUnitDisplayText(Self, AStart, AFinish, ATextType, AText); +end; + +function TcxSchedulerTimeGridView.GetCompressWeekEnd: Boolean; +begin + Result := False; +end; + +function TcxSchedulerTimeGridView.GetEditWithSingleLineEditor( + AEvent: TcxSchedulerControlEvent): Boolean; +begin + Result := not EventDetailInfo; +end; + +function TcxSchedulerTimeGridView.GetFirstVisibleDate: TDateTime; +begin + Result := DateOf(VisibleStart); + if (VisibleStart = NullDate) and (SelectedDays.Count > 0) then + Result := SelectedDays[0] - 7; +end; + +function TcxSchedulerTimeGridView.GetFirstVisibleTime: TDateTime; +begin + Result := TimeOf(VisibleStart); +end; + +function TcxSchedulerTimeGridView.GetLastVisibleDate: TDateTime; +begin + if (FVisibleFinish = 0) and (VisibleStart > 0) then + Result := VisibleStart + GetTimeIncrement + else + Result := DateOf(VisibleFinish); + if (VisibleStart = NullDate) and (SelectedDays.Count > 0) then + Result := SelectedDays[0] + 7; +end; + +function TcxSchedulerTimeGridView.GetLastVisibleTime: TDateTime; +begin + Result := TimeOf(VisibleFinish); +end; + +function TcxSchedulerTimeGridView.GetScrollTimeHint: string; +var + H, M, S, MS: Word; + Y, D: Word; +begin + DecodeDate(FirstVisibleDate, Y, M, D); + Result := Format('%.2d.%.2d.%.4d', [D, M, Y]); + DecodeTime(FirstVisibleTime, H, M, S, MS); + Result := Result + ' ' + Format('%.2d:%.2d', [H, M]); + + DecodeDate(LastVisibleDate, Y, M, D); + Result := Result + ' - ' + Format('%.2d.%.2d.%.4d', [D, M, Y]); + DecodeTime(LastVisibleTime, H, M, S, MS); + Result := Result + ' ' + Format('%.2d:%.2d', [H, M]); +end; + +function TcxSchedulerTimeGridView.GetTimeIncrement: TDateTime; +begin + Result := inherited GetTimeIncrement; + if Scales.MinorUnit = suHour then + Result := Scales.TimeStep * MinuteToTime; +end; + +function TcxSchedulerTimeGridView.GetViewContentRect: TRect; +begin + Result := inherited GetViewContentRect; +end; + +procedure TcxSchedulerTimeGridView.InitScrollBarsParameters; +var + Position: Integer; +begin + inherited InitScrollBarsParameters; + Position := Min(Max(FScrollPosition, 0), ScrollMaxPos - 1); + SetScrollBarInfo(sbHorizontal, 0, ScrollMaxPos, 1, ScrollPage, Position, True, True); +end; + +function TcxSchedulerTimeGridView.IsSnapEventsToTimeSlots: Boolean; +begin + Result := SnapEventsToTimeSlots or (Scales.MinorUnit <> suHour); +end; + +procedure TcxSchedulerTimeGridView.MakeEventVisible( + AEvent: TcxSchedulerControlEvent; const ADate: TDateTime; + AResource: TcxSchedulerStorageResourceItem); +begin + ViewInfo.MakeTimeVisible(AEvent.Start); + LayoutChanged; +end; + +procedure TcxSchedulerTimeGridView.ScaleChanged; +var + AStart: TDateTime; +begin + if (Scales = nil) or (ViewInfo = nil) then Exit; + ScaleTextType := sttUnknown; + if VisibleStart <> NullDate then + begin + AStart := Scheduler.SelStart; + ViewInfo.TimeBuilder.Initialize(Self, WorkTimeOnly, WorkDaysOnly); + ViewInfo.TimeBuilder.ValidateVisibleStart(AStart); + ViewInfo.TimeBuilder.ValidateTime(AStart, False); + Controller.Navigation.ReplaceSelParams(AStart, AStart, Scheduler.SelResource); + end; + Changed; +end; + +procedure TcxSchedulerTimeGridView.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +var + AStartTime: TDateTime; +begin + if FVisibleStart = NullDate then + FVisibleStart := SelectedDays[0]; + AStartTime := VisibleStart; + FScrollUpdateLocked := AScrollCode <> scEndScroll; + case AScrollCode of + scLineDown, scLineUp: + with ViewInfo.TimeBuilder do + begin + System.Inc(FScrollPosition, Direction[AScrollCode = scLineDown]); + AStartTime := CalculateDateTime(AStartTime, Direction[AScrollCode = scLineDown]); + if CheckTime and (RoundTime(TimeOf(AStartTime)) = WorkFinish) then + AStartTime := CalculateDateTime(AStartTime, Direction[AScrollCode = scLineDown]); + end; + scPageUp, scPageDown: + begin + AStartTime := ViewInfo.TimeBuilder.CalculateDateTime(AStartTime, + Direction[AScrollCode = scPageDown] * ViewInfo.VisibleColumnCount); + System.Inc(FScrollPosition, Direction[AScrollCode = scLineDown] * ViewInfo.VisibleColumnCount); + end; + scBottom, scTop, scPosition, scTrack: + if AScrollPos <> FScrollPosition then + begin + AStartTime := ViewInfo.TimeBuilder.CalculateDateTime(AStartTime, + AScrollPos - FScrollPosition); + with ViewInfo.TimeBuilder do + begin + if CheckTime and (RoundTime(TimeOf(AStartTime)) = WorkFinish) then + AStartTime := CalculateDateTime(AStartTime, Direction[AScrollPos - FScrollPosition > 0]); + end; + FScrollPosition := AScrollPos; + end; + end; + VisibleStart := DateTimeHelper.RoundTime(AStartTime); + if IsScrollingContent or (AScrollCode = scEndScroll) then + AScrollPos := Max(Min(FScrollPosition, ScrollMaxPos - (ScrollPage * 2 - 1)), ScrollPage); + if IsScrollingContent then + GetScrollBar(sbHorizontal).Position := AScrollPos; + FScrollPosition := AScrollPos; + CheckRefresh; + HideHintOnScroll(AScrollCode); + if AScrollCode = scTrack then + ShowHintOnScroll(GetScrollTimeHint, AScrollBarKind); +end; + +procedure TcxSchedulerTimeGridView.SelectedDaysChanged; +var + ADate: TDateTime; +begin + if SelectedDays.Count > 0 then + begin + ADate := SelectedDays[0]; + ViewInfo.TimeBuilder.ValidateTime(ADate, True, 0); + ViewInfo.TimeBuilder.CheckWorkDays(ADate, True); + VisibleStart := ADate; + if not FLockSelectionUpdate then + Controller.Navigation.ReplaceSelParams( + NullDate, NullDate, Scheduler.SelResource); + Changed; + end; +end; + +procedure TcxSchedulerTimeGridView.UpdateDateNavigatorSelection; +var + AStart: TDateTime; +begin + AStart := FVisibleStart; + inherited UpdateDateNavigatorSelection; + VisibleStart := AStart; +end; + +procedure TcxSchedulerTimeGridView.ValidateSelectionFinishTime( + var ADateTime: TDateTime); +var + Y, M, D: Word; +begin + if Scales.MinorUnit < suDay then Exit; + DecodeDate(ADateTime, Y, M, D); + case Scales.MinorUnit of + suDay: + ADateTime := EncodeDate(Y, M, D); + suWeek: + ADateTime := Trunc(ADateTime) - (DayOfTheWeek(ADateTime) - 1) + 6; + suMonth: + ADateTime := EncodeDate(Y, M, DaysPerMonth(Y, M)); + suQuarter: + begin + M := ((M - 1) div 3 + 1) * 3; + ADateTime := EncodeDate(Y, M, DaysPerMonth(Y, M)); + end; + suYear: + ADateTime := EncodeDate(Y, 12, 31); + end; + if Scales.MinorUnit > suDay then + ADateTime := ADateTime + 1; +end; + +procedure TcxSchedulerTimeGridView.VisibleChanged; +begin + inherited; + if not Visible then + FVisibleStart := NullDate; +end; + +function TcxSchedulerTimeGridView.GetHitTest: TcxSchedulerTimeGridViewHitTest; +begin + Result := TcxSchedulerTimeGridViewHitTest(inherited HitTest); +end; + +function TcxSchedulerTimeGridView.GetViewInfo: TcxSchedulerTimeGridViewViewInfo; +begin + Result := TcxSchedulerTimeGridViewViewInfo(inherited ViewInfo); +end; + +procedure TcxSchedulerTimeGridView.SetSnapEventsToTimeSlots(AValue: Boolean); +begin + if FSnapEventsToTimeSlots <> AValue then + begin + FSnapEventsToTimeSlots := AValue; + Changed; + end; +end; + +procedure TcxSchedulerTimeGridView.SetEventMaxLineCount(AValue: Integer); +begin + AValue := Max(0, AValue); + if AValue <> FEventMaxLineCount then + begin + FEventMaxLineCount := AValue; + Changed; + end; +end; + +procedure TcxSchedulerTimeGridView.SetScales( + AValue: TcxSchedulerTimeGridViewScales); +begin + FScales.Assign(AValue); + Changed; +end; + +procedure TcxSchedulerTimeGridView.SetShowMoreEventsButton(AValue: Boolean); +begin + if FShowMoreEventsButton <> AValue then + begin + FShowMoreEventsButton := AValue; + Changed; + end; +end; + +procedure TcxSchedulerTimeGridView.SetShowResourceScrollBar(AValue: Boolean); +begin + if FShowResourceScrollBar <> AValue then + begin + FShowResourceScrollBar := AValue; + Changed; + end; +end; + +procedure TcxSchedulerTimeGridView.SetEventDetailInfo(AValue: Boolean); +begin + if AValue <> FEventDetailInfo then + begin + FEventDetailInfo := AValue; + Changed; + end; +end; + +procedure TcxSchedulerTimeGridView.SetStyles( + AValue: TcxSchedulerTimeGridViewStyles); +begin + FStyles.Assign(AValue); + Changed; +end; + +procedure TcxSchedulerTimeGridView.SetVisibleStart(AValue: TDateTime); +begin + if AValue <> FVisibleStart then + begin + Scheduler.DateNavigator.BeginUpdate; + try + FVisibleStart := AValue; + if Controller.Navigation.SelStart = 0 then + Controller.Navigation.ReplaceSelParams(NullDate, NullDate, Scheduler.SelResource); + UpdateDateNavigatorSelection; + Changed; + finally + Scheduler.DateNavigator.EndUpdate; + end; + end; +end; + +procedure TcxSchedulerTimeGridView.SetWorkDaysOnly(AValue: Boolean); +begin + if AValue <> FWorkDaysOnly then + begin + FWorkDaysOnly := AValue; + Changed; + end; +end; + +procedure TcxSchedulerTimeGridView.SetWorkTimeOnly(AValue: Boolean); +begin + if AValue <> FWorkTimeOnly then + begin + FWorkTimeOnly := AValue; + Changed; + end; +end; + +{ TcxSchedulerTimeGridViewEventCellViewInfo } + +procedure TcxSchedulerTimeGridViewEventCellViewInfo.CalculateCaptions; +begin + if (ShowFinishTime or ShowStartTime) and ViewData.AutoHeight then + begin + inherited CalculateCaptions; + if EventStart <> EventFinish then + ViewData.Caption := StartText + '-' + FinishText + ' ' + ViewData.Caption + else + ViewData.Caption := StartText + ' ' + ViewData.Caption; + end + else + if not ShowTimeAsClock then + inherited CalculateCaptions; +end; + +procedure TcxSchedulerTimeGridViewEventCellViewInfo.CalculateDetailInfo; +begin + FIsDetailInfo := ViewData.AutoHeight; + FIsDetailCaption := FIsDetailInfo; + FShowMessage := IsDetailInfo and (Length(Message) > 0); +end; + +procedure TcxSchedulerTimeGridViewEventCellViewInfo.CalculateEventTimeAsClockLayout( + const ABounds: TRect; const ACaptionWidth, AImagesWidth: Integer; var ALeft: Integer); +var + ASpaceWidth, AIconsWidth, AVertOffset: Integer; + R: TRect; +begin + AIconsWidth := TcxSchedulerPainterHelper.IconsWidth; + R := cxRectBounds(0, 0, AIconsWidth, TcxSchedulerPainterHelper.IconsHeight); + AVertOffset := GetImagesVerticalOffset(R.Bottom, True); + ASpaceWidth := cxRectWidth(CaptionRect) - (ACaptionWidth + AImagesWidth + cxEventImagesOffset); + if ASpaceWidth > AIconsWidth then + begin + FStartRect := SetItemRect(ShowStartTime, R, AVertOffset, ALeft); + Dec(ASpaceWidth, AIconsWidth + cxEventImagesGap); + if ASpaceWidth > AIconsWidth then + FFinishRect := SetItemRect(ShowFinishTime, R, AVertOffset, ALeft); + Inc(ALeft); + end; +end; + +procedure TcxSchedulerTimeGridViewEventCellViewInfo.CalculateEventTimeVisibility; +begin + if Event.AllDayEvent then + begin + ViewData.ShowFinishTime := False; + ViewData.ShowStartTime := False; + end + else + if IsHeaderEvent then + begin + ViewData.ShowFinishTime := (TimeOf(EventFinish) <> 0) and (ContentFinish <> EventFinish); + ViewData.ShowStartTime := (TimeOf(EventStart) <> 0) and (ContentStart <> EventStart); + end + else + begin + ViewData.ShowFinishTime := (ContentFinish <> EventFinish) or (ContentStart <> EventStart); + ViewData.ShowStartTime := ViewData.ShowFinishTime; + end; +end; + +function TcxSchedulerTimeGridViewEventCellViewInfo.CalculateNonDetailEventImages( + const ACaptionWidth: Integer; out AImagesWidth: Integer): TRect; +begin + Result := cxRectInflate(Bounds, -cxEventBorderWidth, 0); + Inc(Result.Left, cxEventImagesOffset); + Inc(Result.Top, cxEventImagesOffset); + Result.Right := Result.Right - ACaptionWidth; + AImagesWidth := CalculateSingleLineImages(Result, CaptionRect.Right); +end; + +procedure TcxSchedulerTimeGridViewEventCellViewInfo.CalculateItemsLayout; +begin + if not ViewData.AutoHeight then + begin + if Event.AllDayEvent then + CalculateHeaderEventLayout + else + CalculateNonDetailEventLayout; + end; +end; + +procedure TcxSchedulerTimeGridViewEventCellViewInfo.CalculateShowTimeAsClock; +begin + ViewData.ShowTimeAsClock := ViewData.ShowTimeAsClock and not ViewData.AutoHeight; +end; + +function TcxSchedulerTimeGridViewEventCellViewInfo.GetEditingRect: TRect; +begin + Result := inherited GetEditingRect; + Inc(Result.Top, Byte(ViewData.AutoHeight)); +end; + +procedure TcxSchedulerTimeGridViewEventCellViewInfo.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + inherited InitHitTest(AHitTest); + InitHitTestForHorzEvent(AHitTest); +end; + +{ TcxSchedulerTimeGridViewAdapter } + +function TcxSchedulerTimeGridViewAdapter.GetLineOffset: Integer; +begin + Result := 0; +end; + +function TcxSchedulerTimeGridViewAdapter.GetPrintRange(Index: Integer): TDateTime; +begin + Result := TcxSchedulerTimeGridView(View).FVisibleStart; + if Index <> 0 then + Result := TcxSchedulerTimeGridView(View).FVisibleFinish; +end; + +function TcxSchedulerTimeGridViewAdapter.GetShowLinks: Boolean; +begin + Result := True; +end; + +function TcxSchedulerTimeGridViewAdapter.GetShowResourceHeaders: Boolean; +begin + Result := True; +end; + +function TcxSchedulerTimeGridViewAdapter.GetShowScales: Boolean; +begin + Result := True; +end; + +function TcxSchedulerTimeGridViewAdapter.GetWorkDaysOnly: Boolean; +begin + Result := TcxSchedulerTimeGridView(View).WorkDaysOnly; +end; + +function TcxSchedulerTimeGridViewAdapter.GetWorkTimeOnly: Boolean; +begin + Result := TcxSchedulerTimeGridView(View).WorkTimeOnly; +end; + +procedure TcxSchedulerTimeGridViewAdapter.Store; +begin + FVisibleStart := TcxSchedulerTimeGridView(View).FVisibleStart; + TcxSchedulerTimeGridView(View).ViewInfo.StoreScrollInfo; +end; + +procedure TcxSchedulerTimeGridViewAdapter.Restore; +begin + TcxSchedulerTimeGridView(View).FVisibleStart := FVisibleStart; + TcxSchedulerTimeGridView(View).ViewInfo.RestoreScrollInfo; +end; + +{ TcxSchedulerTimeGridViewViewInfo } + +constructor TcxSchedulerTimeGridViewViewInfo.Create(AOwner: TcxSchedulerSubControl); +begin + inherited Create(AOwner); + FTimeLineCells := TcxSchedulerViewInfoCellList.Create(); + FCells.Add(FTimeLineCells); + FTimeBuilder := TcxSchedulerTimeBuilder.Create(); + FResourceViewShift := TcxObjectList.Create; +end; + +destructor TcxSchedulerTimeGridViewViewInfo.Destroy; +begin + FreeAndNil(FTimeBuilder); + FreeAndNil(FResourceViewShift); + inherited Destroy; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.CalculateHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + if not NavigationButtons.CalculateHitTest(AHitTest) then + if not FTimeLineCells.CalculateHitTest(AHitTest) then + inherited CalculateHitTest(AHitTest); + HotTrackNavigationButtons(AHitTest); +end; + +procedure TcxSchedulerTimeGridViewViewInfo.AddEventForCalculation( + ABuilder: TcxSchedulerEventLayoutBuilder; AEvent: TcxSchedulerControlEvent; + AResourceIndex: Integer); + + procedure AddEventPlace(const AStartCol, AFinishCol: Integer; + const AStart, AFinish: TDateTime); + var + APlace: TcxSchedulerEventPlace; + begin + APlace := ABuilder.AddEventPlace(AEvent, + AStartCol, AFinishCol, 1, TObject(AResourceIndex)); + APlace.Data := AddEventViewInfo(APlace, AResourceIndex, AStart, AFinish); + end; + +var + I: Integer; + AItem: TcxSchedulerStorageResourceItem; + AStart, AFinish: TDateTime; + AStartCol, AFinishCol: Integer; +const + Delta = 100; +begin + AItem := nil; + if AResourceIndex < ResourceCount then + AItem := GetResourceItemByIndex(AResourceIndex); + if not AEvent.IsResourceEvent(AItem, ShowEventsWithoutResource) or not IsEventVisible(AEvent) then Exit; + if not Adapter.IsPrinting and ((AEvent.Finish <= View.VisibleStart) and not IsColumnEvent(AEvent, + FirstVisibleIndex)) or (AEvent.Start >= FLastVisibleTime) then + begin + if not View.CheckEventsVisibility then + if AEvent.Start >= FLastVisibleTime then + AddEventPlace(Bounds.Right + Delta, Bounds.Right + Delta + 1, AEvent.Start, AEvent.Finish) + else + AddEventPlace(-Delta - 1, -Delta, AEvent.Start, AEvent.Finish); + Exit; + end; + if Adapter.IsPrinting then + I := 0 + else + I := FirstVisibleIndex; + while I < FColumnCount do + begin + if IsColumnEvent(AEvent, I) then + begin + CalculateEventPosition(AEvent, I, AStartCol, AFinishCol, AStart, AFinish); + AddEventPlace(AStartCol, AFinishCol, AStart, AFinish); + Break; + end; + Inc(I); + end; +end; + +function TcxSchedulerTimeGridViewViewInfo.AddEventViewInfo( + APlace: TcxSchedulerEventPlace; AResourceIndex: Integer; + const AStart, AFinish: TDateTime): TcxSchedulerEventCellViewInfo; +var + I: Integer; + ABounds, AVisibleBounds: TRect; + AResource: TcxSchedulerResourceViewInfo; + AViewData: TcxSchedulerEventViewData; +begin + AVisibleBounds := Rect(ResourceHeaderWidth, ScalesHeight, + Bounds.Right, Bounds.Bottom); + if Integer(APlace.Resource) < ResourceCount then + begin + AResource := Resources[Integer(APlace.Resource)]; + with ResourceHeaderCells[1 + Integer(APlace.Resource)] do + begin + AVisibleBounds.Top := Bounds.Top; + AVisibleBounds.Bottom := Bounds.Bottom; + end; + end + else + AResource := nil; + ABounds := cxRect(APlace.ColStart, AVisibleBounds.Top + IndentBetweenLines, + APlace.ColFinish, AVisibleBounds.Top + IndentBetweenLines + FContentLineHeight); + if Adapter.IsPrinting then + Inc(ABounds.Left); + AViewData := CreateEventViewData(TcxSchedulerControlEvent(APlace.Event), + ABounds, AStart, AFinish, AResource); + AViewData.VisibleRect := AVisibleBounds; + AViewData.AutoHeight := View.EventDetailInfo; + AViewData.ShowTimeAsClock := AViewData.ShowTimeAsClock and not Adapter.IsPrinting; + Result := AddEventCell(AViewData, not AViewData.AutoHeight); + if View.EventDetailInfo then + begin + I := Result.MeasureHeight(View.Canvas); + APlace.LineFinish := (I div ContentLineHeight) - 1; + if (I mod ContentLineHeight > 0) then Inc(APlace.LineFinish); + if View.EventMaxLineCount > 0 then + APlace.LineFinish := Min(View.EventMaxLineCount, APlace.LineFinish + 1) - 1; + end; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.AddMajorScaleCell( + ABounds: TRect; const AStart, AFinish: TDateTime); +var + AItem: TcxSchedulerTimeGridMajorScaleCell; +begin + if ABounds.Left > ResourceHeaderWidth then + Dec(ABounds.Left); + Inc(ABounds.Right, FSeparatorWidth); + AddTimeLineItem(TcxSchedulerTimeGridMajorScaleCell, ABounds, 0, + AStart, AFinish, View.Styles.GetMajorScaleParams(AStart), AItem); + AItem.FDisplayText := View.GetMajorUnitDisplayText(AStart, + CheckFinishTime(AFinish, Scales.MajorUnit), FMajorTextType); + AItem.FBorders := [bBottom]; + AItem.FRightIndent := FSeparatorWidth; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.AddMajorSeparator( + var ALeft: Integer); +var + ARect: TRect; + ACell: TcxSchedulerMajorSeparatorCellViewInfo; +begin + Dec(ALeft); + ARect := Rect(ALeft, Bounds.Top, + ALeft + FSeparatorWidth, Bounds.Bottom); + CreateCellInstance(TcxSchedulerMajorSeparatorCellViewInfo, + cxRectInflate(ARect, -1, 0), Bounds, View.Styles.GetMajorScaleUnitSeparatorParams, ACell); + Inc(ARect.Top, FMajorScaleHeight); + ACell.FContentBounds := ARect; + Inc(ALeft, FSeparatorWidth); + FGroupSeparatorCells.Insert(0, ACell); +end; + +procedure TcxSchedulerTimeGridViewViewInfo.AddMinorScaleCell(const ABounds: TRect; + const AStart, AFinish: TDateTime); +var + AItem: TcxSchedulerTimeGridMinorScaleCell; +begin + AddTimeLineItem(TcxSchedulerTimeGridMinorScaleCell, ABounds, 1, AStart, AFinish, + View.Styles.GetMinorScaleParams(AStart), AItem); + AItem.Borders := [bBottom]; + if Adapter.IsPrinting or (Scales.MajorUnitSeparatorWidth = 0) and (Scales.MajorUnit = suDay) then + begin + if TimeBuilder.IsPeriodChanged(AFinish, TimeBuilder.CalculateDateTime(AFinish, 2)) then + AItem.Borders := [bBottom, bRight]; + end; + AItem.FDisplayText := View.GetMinorUnitDisplayText(AStart, + CheckFinishTime(AFinish, Scales.MinorUnit), FMajorTextType); +end; + +function TcxSchedulerTimeGridViewViewInfo.AddSelectionBarCell(const ABounds: TRect; + const AStart, AFinish: TDateTime): TcxSchedulerTimeGridSelectionBarCell; +begin + AddTimeLineItem(TcxSchedulerTimeGridSelectionBarCell, ABounds, 2, AStart, AFinish, + View.Styles.GetSelectionBarParams(AStart), Result); + Result.FSelected := View.Styles.IsTimeSelected(AStart); + Result.Borders := DefaultBorders; + Result.FViewHeight := View.Height; + Result.CalculateTimeLineParams(GetNeedShowCurrentTime); +end; + +procedure TcxSchedulerTimeGridViewViewInfo.AddTimeLineItem( + AClass: TcxSchedulerCustomViewInfoItemClass; const ABounds: TRect; AType: Byte; + const AStart, AFinish: TDateTime; const AViewParams: TcxViewParams; var Instance); +var + ACell: TcxSchedulerTimeGridMinorScaleCell; +begin + CreateCellInstance(AClass, ABounds, FScalesBounds, AViewParams, Instance); + ACell := TcxSchedulerTimeGridMinorScaleCell(Instance); + ACell.ItemType := AType; + ACell.FTimeFinish := AFinish; + if AStart = AFinish then + ACell.FTimeFinish := TimeBuilder.Inc(AStart); + ACell.FDateTime := AStart; + ACell.FVisible := ACell.FVisible and (ABounds.Bottom > ABounds.Top); + FTimeLineCells.Add(TcxSchedulerTimeGridMinorScaleCell(Instance)); + if not ACell.Visible and Adapter.IsPrinting and (AClass = TcxSchedulerTimeGridSelectionBarCell) then + begin + if cxRectIntersect(cxRectInflate(ABounds, 0, 1), cxRectInflate(FScalesBounds, 0, 1)) then + ACell.FVisible := True; + end; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.AdjustTextType; +var + I: Integer; + ATextAdjusted: Boolean; + ACell: TcxSchedulerTimeGridMinorScaleCell; + + procedure CheckScale(var ATextType: TcxSchedulerTimeGridScaleTextType); + const + RevertTypes: array[TcxSchedulerTimeGridScaleTextType] of TcxSchedulerTimeGridScaleTextType = + (sttLong, sttUnknown, sttShort, sttMiddle); + var + S: string; + begin + if ACell.ItemType = 0 then + S := View.GetMajorUnitDisplayText(ACell.TimeStart, + CheckFinishTime(ACell.TimeFinish, Scales.MajorUnit), ATextType) + else + S := View.GetMinorUnitDisplayText(ACell.TimeStart, + CheckFinishTime(ACell.TimeFinish, Scales.MinorUnit), ATextType); + ACell.DisplayText := S; + if (ATextType <> sttShort) and + (cxTextWidth(ACell.Font, S) > (cxRectWidth(ACell.Bounds) - cxTextOffset * 2)) then + begin + ATextType := RevertTypes[ATextType]; + ATextAdjusted := False; + end; + end; + +begin + FMajorTextType := sttUnknown; + FMinorTextType := sttUnknown; + repeat + ATextAdjusted := True; + for I := 0 to TimeLineCells.Count - 1 do + begin + ACell := TcxSchedulerTimeGridMinorScaleCell(TimeLineCells.List^[I]); + case ACell.ItemType of + 0: + CheckScale(FMajorTextType); + 1: + CheckScale(FMinorTextType); + end; + if not ATextAdjusted then Break; + end; + until ATextAdjusted; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.CalculateContentCells; +var + R: TRect; + I, J, ID: Integer; + AColor: TColor; + ACell: TcxSchedulerTimeGridSelectionBarCell; + AContentCell: TcxSchedulerContentCellViewInfo; + AResource: TcxSchedulerStorageResourceItem; +begin + R := Bounds; + for I := 0 to Max(ResourceCount - 1, 0) do + begin + AResource := nil; + if I <= (ResourceCount - 1) then + begin + ID := I; + AResource := Resources[I].ResourceItem; + R := ResourceHeaderCells[I + 1].Bounds + end + else + begin + R.Top := FScalesHeight; + ID := -1; + end; + for J := 0 to ColumnCount - 1 do + begin + ACell := TcxSchedulerTimeGridSelectionBarCell(TimeLineCells.List^[J]); + if not ACell.Visible then Continue; + AColor := StylesAdapter.GetContentParams(ACell.TimeStart, True, AResource).Color; + R.Left := ACell.Bounds.Left; + R.Right := ACell.Bounds.Right; + AContentCell := AddContentCell(R, ACell.TimeStart, ACell.TimeFinish, ID); + AContentCell.Borders := [bRight]; + if FColumnsInMinorUnit > 1 then + AContentCell.BorderColor := PainterHelper.GetSeparatorColor(AColor, + (J + 1) mod FColumnsInMinorUnit = 0, View.IsWorkTime(AResource, ACell.TimeFinish)) + else + AContentCell.BorderColor := PainterHelper.GetSeparatorColor(AColor, True, + View.IsWorkTime(AResource, ACell.TimeStart)) + end; + end; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.CalculateEventPosition( + AEvent: TcxSchedulerControlEvent; AColIndex: Integer; + out AStartX, AFinishX: Integer; out AStart, AFinish: TDateTime); + +var + EventStart, EventFinish, AFirst, ALast: TDateTime; + + procedure CalculateForward; + begin + ALast := AFinish; + while AEvent.Finish > ALast do + begin + AFirst := ALast; + TimeBuilder.ValidateTime(AFirst, True); + ALast := TimeBuilder.Inc(AFirst); + if TimeBuilder.CheckTime and TimeBuilder.IsPeriodChanged(AFirst, ALast) and + (EventFinish > ALast) then Inc(AFinishX, FSeparatorWidth - 1); + TimeBuilder.TimeCorrected(AFirst, ALast); + if (EventFinish >= AFirst) then + begin + AFinish := ALast; + AFinishX := AFinishX + FColumnWidth; + end; + if not View.IsSnapEventsToTimeSlots and (EventFinish <= ALast) then + AFinishX := GetActualPos(AFinishX - FColumnWidth, AEvent.Finish, AFirst, ALast); + if TimeBuilder.IsPeriodChanged(AFirst, ALast) and (EventFinish > ALast) then + Inc(AFinishX, FSeparatorWidth - 1); + end; + end; + + procedure CalculateBackward; + begin + AFirst := AStart; + ALast := AFirst; + if not View.IsSnapEventsToTimeSlots and (EventStart >= AFirst) then + begin + AStartX := GetActualPos(AStartX, EventStart, AFirst, TimeBuilder.Inc(AFirst)); + Exit; + end; + while AEvent.Start < AFirst do + begin + ALast := AFirst; + TimeBuilder.ValidateTime(ALast, False); + AFirst := TimeBuilder.Dec(ALast); + TimeBuilder.TimeCorrected(AFirst, ALast, False); + if (EventStart <= AFirst) or ((EventStart > AFirst) and (EventStart < ALast)) then + begin + AStart := AFirst; + AStartX := AStartX - FColumnWidth; + end; + if not View.IsSnapEventsToTimeSlots and (EventStart >= AFirst) then + AStartX := GetActualPos(AStartX, EventStart, AFirst, ALast); + if TimeBuilder.IsPeriodChanged(AFirst, ALast) and (EventStart <= AFirst) then + Dec(AStartX, FSeparatorWidth); + end; + end; + +begin + with TcxSchedulerTimeGridSelectionBarCell(FTimeLineCells.List^[AColIndex]) do + begin + AStartX := Bounds.Left; + AFinishX := Bounds.Left; + AStart := TimeStart; + AFinish := TimeStart; + if AEvent.Duration < 1*MinuteToTime then + begin + AFinishX := Bounds.Right; + AFinish := TimeFinish; + end; + end; + EventStart := DateTimeHelper.RoundTime(AEvent.Start); + EventFinish := DateTimeHelper.RoundTime(AEvent.Finish); + CalculateForward; + CalculateBackward; + // correct bounds by indent + if not View.IsSnapEventsToTimeSlots then + begin + Inc(AStartX); + AFinishX := Max(AFinishX, AStartX + FEventMinSize) + end + else + begin + Inc(AStartX, cxHorzEventIndent - 1); + Dec(AFinishX, cxHorzEventIndent); + end; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.CalculateEvents; +var + AEventIndex, AResourceIndex: Integer; + ABuilder: TcxSchedulerEventLayoutBuilder; +begin + ABuilder := CreateLayoutBuilder; + try + ABuilder.Clear; + for AResourceIndex := 0 to Max(ResourceCount - 1, 0) do + for AEventIndex := 0 to Events.AbsoluteCount - 1 do + AddEventForCalculation(ABuilder, Events.AbsoluteItems[AEventIndex], AResourceIndex); + ABuilder.Calculate; + CalculateResourceViewShifts(ABuilder); + for AEventIndex := 0 to ABuilder.EventPlaceCount - 1 do + Realign(ABuilder.EventPlaces[AEventIndex]); + for AEventIndex := EventCells.Count - 1 downto 0 do + CheckEventVisibility(TcxSchedulerEventCellViewInfo( + EventCells.List^[AEventIndex]), AEventIndex); + finally + ABuilder.Free; + end; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.CalculateMetrics; +begin + inherited CalculateMetrics; + if Adapter.IsPrinting or (Scales.FMajorUnitSeparatorWidth = 0) then + FSeparatorWidth := 1 + else + FSeparatorWidth := Scales.FMajorUnitSeparatorWidth + 2; + if (ResourceCount > 0) and FPrintResourceHeaders then + FResourceHeaderWidth := FResourceHeaderHeight + else + FResourceHeaderWidth := 0; + ValidateStartTime; + CalculateScalesHeight; + if TimeBuilder.MinorUnit = suHour then + FColumnsInMinorUnit := 60 div Scales.TimeStep + else + FColumnsInMinorUnit := 1; + FColumnWidth := Max(Scales.MinorUnitWidth div FColumnsInMinorUnit, 1); + with Bounds do + FScalesBounds := Rect(Left + FResourceHeaderWidth, Top, Right, Top + FScalesHeight); + FEventMinSize := cxTextWidth(Scheduler.Font, 'Wg'); +end; + +procedure TcxSchedulerTimeGridViewViewInfo.CalculateResourceBounds; +var + I: Integer; + R: TRect; +begin + R := FBounds; + R.Left := ResourceHeaderWidth; + for I := 0 to ResourceCount - 1 do + begin + CalculateResourceTopBottom(I, R); + AddResourceBounds(I, R); + end; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.CalculateResourceHeaderCells; +var + R: TRect; + I: Integer; + AHeader: TcxSchedulerHeaderCellViewInfo; +begin + if ResourceCount = 0 then Exit; + R := cxRectSetWidth(FBounds, ResourceHeaderWidth); + AddResourceHeader(-1, cxRectSetSize(Bounds, ResourceHeaderWidth, FScalesHeight)); + for I := 0 to ResourceCount - 1 do + begin + CalculateResourceTopBottom(I, R); + AHeader := AddResourceHeader(I, R); + AHeader.RotateText := View.Scheduler.OptionsView.RotateResourceCaptions; + AHeader.RotateHeader := True; + if I < ResourceCount - 1 then + AddGroupHorzSeparator(R.Bottom); + end; + ProcessCheckBorders(ResourceHeaderCells, True, [], []); +end; + +procedure TcxSchedulerTimeGridViewViewInfo.CalculateResourceHeadersAutoHeight( + AWidth: Integer); +begin + if not ResourceHeaders.RotateCaptions then + FResourceHeaderHeight := CalculateResourceHeaderWidth + else + inherited CalculateResourceHeadersAutoHeight(AWidth); + FResourceHeaderWidth := FResourceHeaderHeight; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.CalculateResourceTopBottom( + AResourceIndex: Integer; var ABounds: TRect); +var + H: Integer; +begin + H := GetResourceHeight; + ABounds.Top := MulDiv(H, AResourceIndex, ResourceCount); + ABounds.Bottom := MulDiv(H, AResourceIndex + 1, ResourceCount); + OffsetRect(ABounds, 0, SeparatorWidth * AResourceIndex + FScalesHeight); +end; + +procedure TcxSchedulerTimeGridViewViewInfo.CalculateScales; +var + I: Integer; +begin + CalculateSelectionBar; + CalculateMinorScale; + CalculateMajorScale; + FEventRowHeight := FContentLineHeight + IndentBetweenLines; + if View.ScaleTextType = sttUnknown then + begin + AdjustTextType; + View.ScaleTextType := FMajorTextType; + end; + for I := 0 to TimeLineCells.Count - 1 do + TcxSchedulerTimeGridMinorScaleCell(TimeLineCells[I]).Calculate; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.CalculateScalesHeight; +begin + if not FPrintScales then + begin + FMajorScaleHeight := 0; + FMinorScaleHeight := 0; + FSelectionBarHeight := 0; + end + else + begin + FMajorScaleHeight := MeasureFontHeight(View.Styles.MajorScale, -1, [bBottom]); + if not Scales.Major then + FMajorScaleHeight := 0; + FMinorScaleHeight := MeasureFontHeight(View.Styles.MinorScale, -1, [bBottom]); + if not Scales.Minor then + FMinorScaleHeight := 0; + FSelectionBarHeight := MeasureFontHeight(View.Styles.SelectionBar, -1, [bBottom]); + FSelectionBarHeight := Max(cxMinSelectionBarHeight, Round(FSelectionBarHeight / 1.5)); + end; + FScalesHeight := FMajorScaleHeight + FMinorScaleHeight + FSelectionBarHeight; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.CheckEventVisibility( + ACell: TcxSchedulerEventCellViewInfo; AIndex: Integer); +begin + if ACell.Hidden then + begin + ACell.Free; + FEventCells.Delete(AIndex); + end; +end; + +function TcxSchedulerTimeGridViewViewInfo.CheckFinishTime( + const ATime: TDateTime; AUnit: TcxSchedulerTimeGridScaleUnit): TDateTime; +begin + Result := ATime; +{ if not View.WorkDaysOnly and (AUnit in [suWeek]) then + Result := Result - 1;} +end; + +procedure TcxSchedulerTimeGridViewViewInfo.Clear; +begin + inherited Clear; + FTimeLineCells.Clear; +end; + +function TcxSchedulerTimeGridViewViewInfo.CreateEventCellViewInfo( + AViewData: TcxSchedulerEventViewData): TcxSchedulerEventCellViewInfo; +begin + Result := TcxSchedulerTimeGridViewEventCellViewInfo.Create(AViewData); +end; + +function TcxSchedulerTimeGridViewViewInfo.CreateLayoutBuilder: TcxSchedulerEventLayoutBuilder; +begin + Result := TcxSchedulerEventLayoutBuilder.Create; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.DoCalculate; +var + AIntf: IcxSchedulerTimeGridViewAdapter; +begin + Supports(Adapter, IcxSchedulerTimeGridViewAdapter, AIntf); + FShowLinks := AIntf.GetShowLinks; + FWorkTimeOnly := AIntf.GetWorkTimeOnly; + FWorkDaysOnly := AIntf.GetWorkDaysOnly; + FPrintResourceHeaders := AIntf.GetShowResourceHeaders; + FPrintScales := AIntf.GetShowScales; + FLineOffset := AIntf.GetLineOffset; + AIntf := nil; + View.FVisibleStart := Adapter.PrintFrom; + FTimeBuilder.Initialize(View, WorkTimeOnly, WorkDaysOnly); + FScales := View.Scales; + inherited DoCalculate; + CalculateResourceHeaderCells; + CalculateScales; + CalculateContentCells; + CalculateEvents; + CalculateResourceBounds; + CalculateContentNavigationButtons; + View.FLockSelectionUpdate := True; + try + View.UpdateDateNavigatorSelection; + finally + View.FLockSelectionUpdate := False; + end; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.DoContentNavigationButtonClick( + Sender: TcxSchedulerContentNavigationButtonViewInfo); +begin + View.VisibleStart := View.VisibleStart + Sender.Interval; + inherited DoContentNavigationButtonClick(Sender); +end; + +procedure TcxSchedulerTimeGridViewViewInfo.DoResourceVerticalScroll( + Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer); +begin + GetResourceViewShift(TcxSchedulerTimeGridScrollBar(Sender).ResourceIndex).FShift := + -ScrollPos; + View.Changed; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.DoTimeGridMoreEventsButtonClick( + Sender: TcxSchedulerMoreEventsButtonViewInfo); +var + ATimeGridButtonViewInfo: TcxSchedulerTimeGridMoreEventsButtonViewInfo; +begin + ATimeGridButtonViewInfo := TcxSchedulerTimeGridMoreEventsButtonViewInfo(Sender); + Inc(GetResourceViewShift(ATimeGridButtonViewInfo.ResourceIndex).FShift, + ATimeGridButtonViewInfo.Delta); + View.Changed; +end; + +function TcxSchedulerTimeGridViewViewInfo.IsColumnEvent( + AEvent: TcxSchedulerControlEvent; AColumnIndex: Integer): Boolean; +var + AFinish, AStart: TDateTime; +begin + Result := False; + AStart := TcxSchedulerTimeGridSelectionBarCell(FTimeLineCells.List^[AColumnIndex]).TimeStart; + AFinish := TcxSchedulerTimeGridSelectionBarCell(FTimeLineCells.List^[AColumnIndex]).TimeFinish; + if Scales.MinorUnit = suDay then + Result := AEvent.IsDayEvent(AStart) + else + if Scales.MinorUnit > suDay then + Result := (AEvent.Finish > AStart) and (AEvent.Start < AFinish) + else + if AEvent.Finish = AEvent.Start then + Result := (AEvent.Start >= AStart) and (AEvent.Start < AFinish) + else + begin + if AEvent.Finish > AStart then + Result := {(AEvent.Start <= AStart) or + (AEvent.Finish <= AFinish) todo: } AEvent.Start < AFinish + else + if AEvent.Finish = AStart then + Result := AEvent.Start = AStart; + end; +end; + +function TcxSchedulerTimeGridViewViewInfo.IsEventVisible( + AEvent: TcxSchedulerControlEvent): Boolean; +var + I: Integer; +begin + Result := True; + if TcxSchedulerTimeGridViewController(View.Controller).ConsiderHiddenEvents or + (Events.Clones.Count = 0) or (not FHideClones and not FHideSource) then Exit; + if AEvent.IsClone then + Result := not FHideClones + else + if FHideSource then + begin + Result := True; + for I := 0 to Events.Clones.Count - 1 do + if TcxSchedulerControlEvent(Events.Clones[I]).Source = AEvent then + begin + Result := False; + Break; + end; + end; +end; + +function TcxSchedulerTimeGridViewViewInfo.GetActualPos( + const APos: Integer; const ATime, AStart, AFinish: TDateTime): Integer; +begin + Result := APos; + if DateTimeHelper.RoundTime(ATime) >= DateTimeHelper.RoundTime(AFinish) then + Inc(Result, FColumnWidth) + else + if (ATime > AStart) and (ATime < AFinish) then + Result := APos + Round((ATime - AStart) * FColumnWidth / (AFinish - AStart)); +end; + +function TcxSchedulerTimeGridViewViewInfo.GetContentParams(const ATime: TDateTime; + AResource: TcxSchedulerResourceViewInfo): TcxViewParams; +begin + Result := inherited GetContentParams(ATime, AResource); + if not HiddenSelection and IsTimeSelected(ATime, AResource) then + Result := GetSelectionParams(Result); +end; + +function TcxSchedulerTimeGridViewViewInfo.GetEventClipRect( + AEventViewInfo: TcxSchedulerEventCellViewInfo): TRect; +var + I: Integer; + AResourceInfo: TcxSchedulerResourceViewInfo; +begin + AResourceInfo := AEventViewInfo.ResourceInfo; + Result := Rect(ResourceHeaderWidth, ScalesHeight, Bounds.Right, Bounds.Bottom); + if AResourceInfo <> nil then + begin + for I := 0 to ResourceCount - 1 do + if Resources[I].ResourceItem = AResourceInfo.ResourceItem then + begin + with ResourceHeaderCells[I + 1].Bounds do + Result := cxRectSetYPos(Result, Top, Bottom); + Exit; + end; + Result := cxInvalidRect; + end; +end; + +function TcxSchedulerTimeGridViewViewInfo.GetIndentBetweenLines: Integer; +begin + Result := cxTextOffset; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.GetItemInfo(AIndex1, AIndex2, + ATop, AHeight: Integer; var ABounds: TRect; var AStart, AFinish: TDateTime); +begin + AIndex2 := Min(ColumnCount - 1, AIndex2); + AIndex1 := Min(ColumnCount - 1, AIndex1); + with TcxSchedulerTimeGridSelectionBarCell(FTimeLineCells[AIndex1]) do + begin + ABounds.Left := Bounds.Left; + AStart := TimeStart; + end; + ABounds.Top := ATop; + ABounds.Bottom := ATop + AHeight; + with TcxSchedulerTimeGridSelectionBarCell(FTimeLineCells[AIndex2]) do + begin + ABounds.Right := Bounds.Right; + AFinish := TimeStart{Finish}; // todo: !!!!!!!!!!!!!!!! + end; +end; + +function TcxSchedulerTimeGridViewViewInfo.GetNeedShowCurrentTime: Boolean; +begin + Result := True; +end; + +function TcxSchedulerTimeGridViewViewInfo.GetMoreEventButtonClass: TcxSchedulerMoreEventsButtonViewInfoClass; +begin + Result := TcxSchedulerTimeGridMoreEventsButtonViewInfo; +end; + +function TcxSchedulerTimeGridViewViewInfo.GetResourceScrollBarMax(I: Integer): Integer; +begin + Result := -1; + if (I < 0) or (I >= FResourceViewShift.Count) then + Exit; + if ResourceViewShift[I].FScrollBar <> nil then + Result := ResourceViewShift[I].FScrollBar.Max +end; + +function TcxSchedulerTimeGridViewViewInfo.GetResourceImagesSize: TSize; +begin + if ResourceImages = nil then + Result := TSize(cxNullSize) + else + Result := cxSize(ResourceImages.Height, ResourceImages.Width); +end; + +function TcxSchedulerTimeGridViewViewInfo.GetResourcesContentWidth: Integer; +begin + CalculateScalesHeight; + Result := (Bounds.Bottom - Bounds.Top) - FScalesHeight; +end; + +function TcxSchedulerTimeGridViewViewInfo.GetResourceScrollBarKind: TScrollBarKind; +begin + Result := sbVertical; +end; + +function TcxSchedulerTimeGridViewViewInfo.GetStyleFont(AStyle: TcxStyle): TFont; +begin + if (AStyle <> nil) and (cxStyles.svFont in AStyle.AssignedValues) then + Result := AStyle.Font + else + Result := View.Scheduler.Font; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.MakeTimeVisible( + const ATime: TDateTime); +var + APos: Integer; + AFinish: TDateTime; +begin + if ATime < View.VisibleStart then + View.FVisibleStart := ATime + else + if ATime > View.VisibleFinish then + begin + APos := Bounds.Right - FResourceHeaderWidth; + View.FVisibleStart := ATime; + while APos > Bounds.Left do + begin + TimeBuilder.CheckWorkDays(View.FVisibleStart, False); + AFinish := View.FVisibleStart; + Dec(APos, FColumnWidth); + if TimeBuilder.IsPeriodChanged(View.FVisibleStart, AFinish) then + if (APos - FColumnWidth) >= (Bounds.Left + FSeparatorWidth) then + Dec(APos, FSeparatorWidth); + if (APos - FColumnWidth) > Bounds.Left then + begin + View.FVisibleStart := TimeBuilder.Dec(AFinish); + TimeBuilder.TimeCorrected(View.FVisibleStart, AFinish, False); + end + else + Break; + end; + end; +end; + +function TcxSchedulerTimeGridViewViewInfo.MeasureFontHeight( + AStyle: TcxStyle; AHeight: Integer; Borders: TcxBorders): Integer; +begin + Result := AHeight; + if Result = -1 then + Result := cxTextHeight(GetStyleFont(AStyle)) + cxTextOffset * 2; + if bTop in Borders then Inc(Result); + if bBottom in Borders then Inc(Result); +end; + +procedure TcxSchedulerTimeGridViewViewInfo.Realign(APlace: TcxSchedulerEventPlace); + + function GetButton(AColumnIndex: Integer; + IsDown: Boolean): TcxSchedulerMoreEventsButtonViewInfo; + begin + Result := GetResourceViewShift(Integer( + APlace.Resource)).FMoreEventButtons[AColumnIndex * 2 + IfThen(IsDown, 1)]; + end; + + function GetMoreButtonHeight: Integer; + begin + Result := View.ExternalPainter.MoreButtonSize( + Size(PainterHelper.MoreButtonWidth, PainterHelper.MoreButtonHeight)).cy; + end; + + procedure AddMoreEventButton(AnEventLineIndex, ALineCount: Integer; R: TRect; + ADateTime: TDateTime; IsVisible: Boolean); + var + AColumnIndex, ADelta: Integer; + ADownDirection, CanChangeDelta: Boolean; + AButton: TcxSchedulerTimeGridMoreEventsButtonViewInfo; + begin + AColumnIndex := R.Left div FColumnWidth; + if (AColumnIndex < 0) or (AColumnIndex * 2 >= + Length(GetResourceViewShift(Integer( + APlace.Resource)).FMoreEventButtons)) then + Exit; + ADelta := 0; + CanChangeDelta := False; + ADownDirection := False; + if AnEventLineIndex < 0 then + begin + ADelta := -AnEventLineIndex; + R.Bottom := R.Top + GetMoreButtonHeight; + CanChangeDelta := Abs(AnEventLineIndex) <= ALineCount - 1; + end + else + if AnEventLineIndex >= ALineCount then + begin + ADelta := -(AnEventLineIndex - ALineCount + 1); + ADownDirection := True; + R.Top := R.Bottom - GetMoreButtonHeight; + CanChangeDelta := AnEventLineIndex - ALineCount + 1 <= ALineCount - 1; + end; + if ADelta <> 0 then + begin + AButton := GetButton(AColumnIndex, ADownDirection) as TcxSchedulerTimeGridMoreEventsButtonViewInfo; + if AButton = nil then + begin + AButton := AddButton(R, ADateTime, ADownDirection, APlace.Event) as TcxSchedulerTimeGridMoreEventsButtonViewInfo; + AButton.FVisible := IsVisible; + AButton.Delta := ADelta; + AButton.ResourceIndex := Integer(APlace.Resource); + AButton.OnClick :=DoTimeGridMoreEventsButtonClick; + GetResourceViewShift(Integer( + APlace.Resource)).FMoreEventButtons[AColumnIndex * 2 + IfThen( + ADownDirection, 1)] := AButton; + end + else + if CanChangeDelta and ((Abs(AButton.Delta) < Abs(ADelta)) or not AButton.ValidDelta) then + AButton.Delta := ADelta; + AButton.ValidDelta := CanChangeDelta; + end; + end; + +var + AEventRect, AButtonRect, AClipRect: TRect; + ACell: TcxSchedulerTimeGridViewEventCellViewInfo; + ALineCount, AnEventLineIndex: Integer; + AViewData: TcxSchedulerEventViewData; +begin + ALineCount := GetVisibleLineCount(Integer(APlace.Resource)); + AnEventLineIndex := APlace.LineStart + + GetResourceViewShift(Integer(APlace.Resource)).FShift - FLineOffset; + + ACell := TcxSchedulerTimeGridViewEventCellViewInfo(APlace.Data); + AViewData := ACell.EventViewData; + + AViewData.Bounds.Bottom := AViewData.VisibleRect.Top + + (APlace.LineFinish - APlace.LineStart + 1) * FEventRowHeight; + if not View.IsSnapEventsToTimeSlots then + Dec(AViewData.Bounds.Left); + ACell.MoveTo(0, AnEventLineIndex * FEventRowHeight); + if ((0 > AnEventLineIndex) or (AnEventLineIndex >= ALineCount)) and + TcxSchedulerTimeGridView(Owner).ShowMoreEventsButton then + begin + AEventRect := AViewData.Bounds; + while AEventRect.Left < 0 do + Inc(AEventRect.Left, FColumnWidth); + AButtonRect := AEventRect; + AButtonRect.Right := AButtonRect.Left + FColumnWidth; + AButtonRect.Bottom := AViewData.VisibleRect.Bottom; + AButtonRect.Top := AViewData.VisibleRect.Top; + AClipRect := GetEventClipRect(ACell); + while AEventRect.Right > AButtonRect.Left do + begin + if (AButtonRect.Left >= AClipRect.Left) and (AButtonRect.Right <= AClipRect.Right) then + begin + AddMoreEventButton(AnEventLineIndex, ALineCount, AButtonRect, ACell.Event.Start, + (AViewData.VisibleRect.Bottom - AViewData.VisibleRect.Top) div 2 >= + GetMoreButtonHeight); + end; + OffsetRect(AButtonRect, FColumnWidth, 0); + end; + ACell.Hidden := True; + end; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.ReturnVisibleInterval( + var AStart, AEnd: TDateTime); +begin + AStart := View.VisibleStart; + AEnd := AStart; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.RestoreScrollInfo; +var + I: Integer; +begin + for I := 0 to FResourceViewShift.Count - 1 do + ResourceViewShift[I].Restore; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.StoreScrollInfo; +var + I: Integer; +begin + if FResourceViewShift = nil then Exit; + for I := 0 to FResourceViewShift.Count - 1 do + ResourceViewShift[I].Store(Adapter.IsPrinting); +end; + +procedure TcxSchedulerTimeGridViewViewInfo.ValidateStartTime; +begin + if View.FVisibleStart = NullDate then + begin + View.FVisibleStart := Days[0]; + if not Adapter.IsPrinting then + View.Controller.Navigation.ReplaceSelParams( + NullDate, NullDate, View.Scheduler.SelResource) + end; + FActualStartTime := FTimeBuilder.ValidateStartTime(Adapter.ActualStart); + FTimeBuilder.CalculateActualStart(FActualStartTime, + View.FVisibleStart, FFirstVisibleIndex); + if not Adapter.IsPrinting then + begin + SelectedDays.Clear; + SelectedDays.Add(View.FVisibleStart); + TcxSchedulerTimeGridViewAdapter(Adapter).FVisibleStart := View.FVisibleStart; + end; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.CalculateResourceViewShifts( + ABuilder: TcxSchedulerEventLayoutBuilder); + + function GetResourceBounds(AIndex: Integer): TRect; + var + I: Integer; + begin + Result := cxNullRect; + for I := 0 to ABuilder.EventPlaceCount - 1 do + if Integer(ABuilder.EventPlaces[I].Resource) = AIndex then + begin + Result := TcxSchedulerTimeGridViewEventCellViewInfo( + ABuilder.EventPlaces[I].Data).EventViewData.VisibleRect; + Break; + end; + end; + + procedure PrepareResourceViewShifts; + var + I: Integer; + begin + if (ResourceCount > 0) and (FResourceViewShift.Count <> ResourceCount) or + (ResourceCount = 0) and (FResourceViewShift.Count <> 1) then + FResourceViewShift.Clear; + for I := FResourceViewShift.Count to Max(0, ResourceCount - 1) do + FResourceViewShift.Add(TcxSchedulerTimeGridResourceScroll.Create) + end; + + procedure CalculateEventMaxLines; + var + AResourceIndex, I: Integer; + begin + for I := 0 to FResourceViewShift.Count - 1 do + GetResourceViewShift(I).FEventMaxLine := 0; + for I := 0 to ABuilder.EventPlaceCount - 1 do + begin + AResourceIndex := Integer(ABuilder.EventPlaces[I].Resource); + GetResourceViewShift(AResourceIndex).SetEventMaxLine( + ABuilder.EventPlaces[I].LineStart); + end; + end; + +var + I, AVisibleLineCount: Integer; + AResourceViewShift: TcxSchedulerTimeGridResourceScroll; +begin + PrepareResourceViewShifts; + CalculateEventMaxLines; + PrepareMoreEventButtons; + + for I := 0 to FResourceViewShift.Count - 1 do + begin + AVisibleLineCount := GetVisibleLineCount(I); + AResourceViewShift := GetResourceViewShift(I); + if AResourceViewShift.FEventMaxLine < AVisibleLineCount then + begin + AResourceViewShift.FShift := 0; + FreeAndNil(GetResourceViewShift(I).FScrollBar); + end + else + if TcxSchedulerTimeGridView(Owner).ShowResourceScrollBar then + AResourceViewShift.CreateScrollBar(GetResourceBounds(I), Self.GetTimeGridView, I, + AResourceViewShift.FEventMaxLine - GetVisibleLineCount(I) + 1, -AResourceViewShift.FShift) + else + FreeAndNil(GetResourceViewShift(I).FScrollBar); + end; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.ClearMoreEventButtons; +var + I: Integer; +begin + for I := 0 to FResourceViewShift.Count - 1 do + GetResourceViewShift(I).ClearMoreEventButtons; +end; + +function TcxSchedulerTimeGridViewViewInfo.GetGroupCount: Integer; +begin + Result := FResourceViewShift.Count; +end; + +function TcxSchedulerTimeGridViewViewInfo.GetGroupLineCount( + AIndex: Integer): Integer; +begin + Result := Max(2, ResourceViewShift[AIndex].FEventMaxLine); +end; + +function TcxSchedulerTimeGridViewViewInfo.GetResourceHeight: Integer; +begin + Result := FBounds.Bottom - FBounds.Top - + SeparatorWidth * (ResourceCount - 1) - FScalesHeight; +end; + +function TcxSchedulerTimeGridViewViewInfo.GetResourceViewShift( + Index: Integer): TcxSchedulerTimeGridResourceScroll; +begin + if ResourceCount = 0 then + Index := 0; + Result := TcxSchedulerTimeGridResourceScroll(FResourceViewShift[Index]); +end; + +function TcxSchedulerTimeGridViewViewInfo.GetTimeGridView: TcxSchedulerTimeGridView; +begin + Result := TcxSchedulerTimeGridView(inherited View); +end; + +function TcxSchedulerTimeGridViewViewInfo.GetVisibleLineCount(AResourceIndex: Integer): Integer; +begin + if ResourceHeaderCells.Count > 0 then + with ResourceHeaderCells[1 + AResourceIndex] do + Result := (Bounds.Bottom - Bounds.Top) div FEventRowHeight + else + Result := (Bounds.Bottom - ScalesHeight) div FEventRowHeight; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.PrepareMoreEventButtons; +var + I: Integer; +begin + ClearMoreEventButtons; + for I := 0 to FResourceViewShift.Count - 1 do + SetLength(GetResourceViewShift(I).FMoreEventButtons, ColumnCount * 2); +end; + +procedure TcxSchedulerTimeGridViewViewInfo.CalculateMajorScale; +var + R: TRect; + AIndex, I: Integer; + AStart, AFinish, APrevFinish: TDateTime; + ACell: TcxSchedulerTimeGridMajorScaleCell; +begin + AIndex := 0; + AStart := ActualStartTime; + ACell := nil; + for I := 1 to ColumnCount do + begin + AFinish := TcxSchedulerTimeGridSelectionBarCell(FTimeLineCells[I]).TimeStart; + if TimeBuilder.IsPeriodChanged(AStart, AFinish) or (I = ColumnCount) then + begin + APrevFinish := AFinish; + GetItemInfo(AIndex, I - 1, FBounds.Top, FMajorScaleHeight, R, AStart, AFinish); + AddMajorScaleCell(R, AStart, AFinish); + ACell := TcxSchedulerTimeGridMajorScaleCell(FTimeLineCells.Last); + AStart := APrevFinish; + AIndex := I; + end; + end; + if ACell <> nil then + Inc(ACell.FBounds.Right, Bounds.Right - Bounds.Left); +end; + +procedure TcxSchedulerTimeGridViewViewInfo.CalculateMinorScale; +var + R: TRect; + AIndex, ATop, I: Integer; + AStart, AFinish: TDateTime; +begin + AIndex := 0; + ATop := FBounds.Top + FMajorScaleHeight; + for I := 1 to ColumnCount do + if (I mod FColumnsInMinorUnit = 0) or (I = ColumnCount) then + begin + GetItemInfo(AIndex, I - 1, ATop, FMinorScaleHeight, R, AStart, AFinish); + AddMinorScaleCell(R, AStart, AFinish); + AIndex := I; + end; +end; + +procedure TcxSchedulerTimeGridViewViewInfo.CalculateSelectionBar; +var + ASelBounds: TRect; + ALeft, AIndex: Integer; + AActualFinish, AStart, AFinish: TDateTime; +begin + AIndex := 0; + AStart := ActualStartTime; + ALeft := Bounds.Left + FResourceHeaderWidth - FColumnWidth * FirstVisibleIndex; + ASelBounds := cxRectSetBottom(Bounds, Bounds.Top + FScalesHeight, FSelectionBarHeight); + FVisibleColumnCount := 0; + repeat + AFinish := TimeBuilder.Inc(AStart); + AActualFinish := AFinish; + if TimeBuilder.MinorUnit = suHour then + AActualFinish := TimeBuilder.RoundTime(AStart + View.GetTimeIncrement); + if TimeBuilder.TimeCorrected(AStart, AFinish) then + AddMajorSeparator(ALeft); + ASelBounds := cxRectSetLeft(ASelBounds, ALeft, FColumnWidth); + if (FVisibleColumnCount = 0) and (Bounds.Right > ALeft) then + View.FVisibleStart := AStart; + AddSelectionBarCell(ASelBounds, AStart, AActualFinish); + if (AIndex >= FirstVisibleIndex) and ((ALeft + FColumnWidth) <= Bounds.Right) then + Inc(FVisibleColumnCount); + if (FVisibleColumnCount = 1) or (ASelBounds.Right <= Bounds.Right) then + View.FVisibleFinish := AStart; + FLastVisibleTime := AFinish; + Inc(ALeft, FColumnWidth); + Inc(AIndex); + if (AIndex > FirstVisibleIndex) and TimeBuilder.IsPeriodChanged(AStart, AFinish) then + AddMajorSeparator(ALeft); + AStart := AFinish; + until ALeft >= Bounds.Right; + FColumnCount := FTimeLineCells.Count; + FVisibleColumnCount := Max(FVisibleColumnCount, 1); +end; + +{ TcxSchedulerTimeGridScaleCell } + +constructor TcxSchedulerTimeGridScaleCell.Create( + APainter: TcxCustomLookAndFeelPainterClass; + const ABounds, AVisibleRect: TRect; const AViewParams: TcxViewParams); +begin + inherited Create(APainter, ABounds, AVisibleRect, AViewParams); + FBorderColor := clBtnShadow; +end; + +{ TcxSchedulerTimeGridMinorScaleCell } + +procedure TcxSchedulerTimeGridMinorScaleCell.Calculate; +begin + FTextBounds := Bounds; +end; + +procedure TcxSchedulerTimeGridMinorScaleCell.DoDraw; +begin + DrawContent; + if (MinuteOf(TimeFinish) = 0) or (bRight in Borders) then + Canvas.FrameRect(Bounds, clBtnShadow, 1, [bRight]) + else + begin + Canvas.FrameRect(Rect(Bounds.Left, Bounds.Bottom - cxTextOffset * 2, + Bounds.Right, Bounds.Bottom - 1), clBtnShadow, 1, [bRight]) + end; +end; + +procedure TcxSchedulerTimeGridMinorScaleCell.DrawContent; +const + Horz: array[TAlignment] of Integer = + (CXTO_LEFT, CXTO_RIGHT, CXTO_CENTER_HORIZONTALLY); + Vert: array[TcxAlignmentVert] of Integer = + (CXTO_TOP, CXTO_BOTTOM, CXTO_CENTER_VERTICALLY); +var + R: TRect; + AFlags: Integer; + ASelected: Boolean; +begin + if Self is TcxSchedulerTimeGridSelectionBarCell then + ASelected := TcxSchedulerTimeGridSelectionBarCell(Self).Selected + else + ASelected := False; + FExternalPainter.DrawTimeGridHeader(Canvas, BorderColor, Self, Borders, ASelected); + if not FHideDisplayText and (DisplayText <> '') then + begin + R := cxTextRect(PainterHelper.ExcludeBorders(FTextBounds, Borders)); + AFlags := Horz[AlignHorz] or Vert[AlignVert]; + SetBkMode(Canvas.Handle, Windows.Transparent); + cxTextOut(Canvas.Handle, PChar(DisplayText), R, AFlags); + end; +end; + +procedure TcxSchedulerTimeGridMinorScaleCell.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + inherited InitHitTest(AHitTest); + TcxSchedulerTimeGridViewHitTest(AHitTest).SetHitTime(htcMinorScale, TimeStart); +end; + +{ TcxSchedulerTimeGridMajorScaleCell } + +procedure TcxSchedulerTimeGridMajorScaleCell.Calculate; +var + W: Integer; +begin + inherited Calculate; + Dec(FTextBounds.Right, RightIndent); + FTextBounds.Left := Max(Bounds.Left, ClipRect.Left); + W := cxTextWidth(Font, FDisplayText) + cxTextOffset; + if (Bounds.Left < ClipRect.Left) and (W >= cxRectWidth(FTextBounds)) then + begin + FAlignHorz := taRightJustify; + FHideDisplayText := (cxRectWidth(FTextBounds) / W) < 0.5; + end; +end; + +procedure TcxSchedulerTimeGridMajorScaleCell.DoDraw; +begin + DrawContent; +end; + +procedure TcxSchedulerTimeGridMajorScaleCell.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + inherited InitHitTest(AHitTest); + TcxSchedulerTimeGridViewHitTest(AHitTest).SetHitTime(htcMajorScale, TimeStart); +end; + +{ TcxSchedulerTimeGridSelectionBarCell } + +procedure TcxSchedulerTimeGridSelectionBarCell.Calculate; +begin +end; + +procedure TcxSchedulerTimeGridSelectionBarCell.CalculateTimeLineParams( + ANeedShowCurrentTime: Boolean); +var + ACurrentTime: TDateTime; + ALeft: Integer; +begin + ACurrentTime := Now; + FIsCurrentTimeCell := (ACurrentTime >= TimeStart) and (ACurrentTime < TimeFinish); + FShowCurrentTime := ANeedShowCurrentTime and IsCurrentTimeCell; + if IsCurrentTimeCell then + begin + ALeft := Bounds.Left + Trunc((Bounds.Right - Bounds.Left) * + (ACurrentTime - TimeStart) / (TimeFinish - TimeStart)); + FTimeLineRect := Rect(ALeft - 1, Bounds.Top, ALeft + 1, ViewHeight); + end; +end; + +procedure TcxSchedulerTimeGridSelectionBarCell.DoDraw; +begin + DrawContent; + if ShowCurrentTime then + FExternalPainter.DrawTimeGridCurrentTime(Canvas, + dxOffice11SelectedDownColor2, TimeLineRect); +end; + +procedure TcxSchedulerTimeGridSelectionBarCell.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + inherited InitHitTest(AHitTest); + TcxSchedulerTimeGridViewHitTest(AHitTest).SetHitTime(htcSelectionBar, TimeStart); +end; + +{ TcxSchedulerMajorSeparatorCellViewInfo } + +procedure TcxSchedulerMajorSeparatorCellViewInfo.DoDraw; +begin + Canvas.FillRect(Bounds, ViewParams); + Canvas.FrameRect(ContentBounds, Painter.DefaultSchedulerBorderColor, + 1, [bLeft, bRight]); +end; + +procedure TcxSchedulerMajorSeparatorCellViewInfo.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + inherited InitHitTest(AHitTest); + TcxSchedulerTimeGridViewHitTest(AHitTest).SetBitState(htcMajorSeparator, True); +end; + +{ TcxSchedulerTimeGridViewPainter } + +procedure TcxSchedulerTimeGridViewPainter.Paint; +begin + FView := inherited View as TcxSchedulerTimeGridView; + ViewInfo.ContentCells.Draw(Canvas, DrawContentCell); + ViewInfo.DayHeaderCells.Draw(Canvas, DrawHeaderCell); + ViewInfo.TimeLineCells.Draw(Canvas, DrawTimeLineCellItem); + ViewInfo.ResourceHeaderCells.Draw(Canvas, DrawResourceHeaderCell); + ViewInfo.GroupSeparatorCells.Draw(Canvas, DrawGroupSeparatorCell); + ViewInfo.EventCells.Draw(Canvas, DrawEventCell); + ViewInfo.Buttons.Draw(Canvas, DrawButtonCell); + ViewInfo.NavigationButtons.Draw(Canvas, DrawButtonCell); +end; + +procedure TcxSchedulerTimeGridViewPainter.DrawTimeLineCellItem( + AItem: TcxSchedulerCustomViewInfoItem; var ADone: Boolean); +begin + case TcxSchedulerTimeGridMinorScaleCell(AItem).ItemType of + 0: + View.DoDrawTimeLineHeaderCell(TcxSchedulerTimeGridMajorScaleCell(AItem), ADone); + 1: + View.DoDrawTimeLineCell(TcxSchedulerTimeGridMinorScaleCell(AItem), ADone); + 2: + View.DoDrawSelectionBarCell(TcxSchedulerTimeGridSelectionBarCell(AItem), ADone); + end; +end; + +function TcxSchedulerTimeGridViewPainter.GetViewInfo: TcxSchedulerTimeGridViewViewInfo; +begin + Result := TcxSchedulerTimeGridViewViewInfo(inherited ViewInfo); +end; + +{ TcxSchedulerTimeBuilder } + +procedure TcxSchedulerTimeBuilder.CalculateActualStart( + var ActualStart, AVisibleStart: TDateTime; var AStartIndex: Integer); +var + AStart: TDateTime; +begin + AStartIndex := 0; + AVisibleStart := ValidateStartTime(AVisibleStart); + AStart := ActualStart; + while not IsPeriodChanged(Dec(ActualStart), AStart) do + ActualStart := Dec(ActualStart); + AStart := ActualStart; + while AStart < AVisibleStart do + begin + AStart := Inc(AStart); + AStartIndex := AStartIndex + 1; + end; +end; + +procedure TcxSchedulerTimeBuilder.CheckWorkDays(var ADateTime: TDateTime; AGoForward: Boolean); +begin + if MinorUnit > suDay then Exit; + while CheckDays and not (TDay(DayOfWeek(ADateTime) - 1) in WorkDays) do + ADateTime := ADateTime + Byte(AGoForward) * 2 - 1; +end; + +function TcxSchedulerTimeBuilder.Dec(const ADateTime: TDateTime): TDateTime; +begin + Result := CalculateDateTime(ADateTime, -1); +end; + +function TcxSchedulerTimeBuilder.Inc(const ADateTime: TDateTime): TDateTime; +begin + Result := CalculateDateTime(ADateTime, 1); +end; + +function TcxSchedulerTimeBuilder.IsPeriodChanged( + const AFirst, ANext: TDateTime): Boolean; +begin + Result := False; + case MajorUnit of + suDay: + Result := DayOf(AFirst) - DayOf(ANext) <> 0; + suWeek: + Result := WeekOf(AFirst) - WeekOf(ANext) <> 0; + suMonth: + Result := MonthOf(AFirst) - MonthOf(ANext) <> 0; + suQuarter: + Result := (MonthOf(AFirst) - 1) div 3 - (MonthOf(ANext) - 1) div 3 <> 0; + suYear: + Result := YearOf(AFirst) - YearOf(ANext) <> 0; + end; +end; + +procedure TcxSchedulerTimeBuilder.Initialize(AView: TcxSchedulerTimeGridView; + AWorkTimeOnly, AWorkDaysOnly: Boolean); +begin + ValidateUnits(AView.Scales.FMajorUnit, AView.Scales.FMinorUnit); + MajorUnit := AView.Scales.MajorUnit; + MinorUnit := AView.Scales.MinorUnit; + TimeScale := CalculateScaleUnit(AView.Scales.TimeStep); + WorkFinish := AView.WorkFinish; + WorkStart := AView.WorkStart; + WorkDays := AView.WorkDays; + CalculateWorkTime(AWorkTimeOnly, WorkStart, WorkFinish); + CalculateWorkDays(AWorkDaysOnly, WorkDays); +end; + +function TcxSchedulerTimeBuilder.TimeCorrected( + var AStart, AFinish: TDateTime; AGoForward: Boolean = True): Boolean; +begin + Result := CheckTime and IsPeriodChanged(AStart, AFinish); + if Result then + begin + if AGoForward then + begin + AStart := AFinish; + AFinish := Inc(AStart) + end + else + begin + AStart := Dec(AStart); + AFinish := AStart; + end; + end; +end; + +function TcxSchedulerTimeBuilder.TimeMode: Boolean; +begin + Result := (MajorUnit = suDay) and (MinorUnit = suHour) +end; + +function TcxSchedulerTimeBuilder.CalculateDateTime( + const ADateTime: TDateTime; AInc: Integer): TDateTime; +var + ATimeInc: Integer; +begin + Result := ADateTime; + ATimeInc := 1; + if MinorUnit = suHour then + begin + Result := Result + AInc * TimeScale * MinuteToTime; + if (ATimeInc = 1) and CheckTime and (Abs(Trunc(ADateTime) - Trunc(Result)) >= 1) then + ATimeInc := 0; + end + else + if MinorUnit <= suWeek then + Result := IncDay(Result, AInc * TimeScale) + else + if MinorUnit > suWeek then + Result := StartOfTheMonth(IncMonth(Result, AInc * TimeScale)); + ValidateTime(Result, AInc > 0, ATimeInc); + CheckWorkDays(Result, AInc > 0); + Result := RoundTime(Result); +end; + +function TcxSchedulerTimeBuilder.CalculateScaleUnit(const AScaleUnit: Integer): Integer; +const + TimeScales: array[TcxSchedulerTimeGridScaleUnit] of Integer = + (1, 1, 7, 1, 3, 12); +begin + Result := AScaleUnit; + if not TimeMode then + Result := TimeScales[MinorUnit]; +end; + +procedure TcxSchedulerTimeBuilder.CalculateWorkTime(AIsWorkTimeOnly: Boolean; + var AWorkStart, AWorkFinish: TDateTime); +begin + if not AIsWorkTimeOnly or not TimeMode then + begin + WorkFinish := EncodeTime(23, 59, 59, 0); + WorkStart := 0; + end; + CheckTime := (TimeOf(WorkStart) > 0) or + (TimeOf(WorkFinish) < EncodeTime(23, 59, 59, 0)) and (MinorUnit = suHour); + WorkFinish := RoundTime(WorkFinish); + WorkStart := RoundTime(WorkStart); +end; + +procedure TcxSchedulerTimeBuilder.CalculateWorkDays( + AIsWorkDaysOnly: Boolean; var AWorkDays: TDays); +const + FullWeek = [dSunday..dSaturday]; +begin + if not AIsWorkDaysOnly then + WorkDays := FullWeek; + CheckDays := FullWeek * WorkDays <> FullWeek; +end; + +function TcxSchedulerTimeBuilder.RoundTime(const ADateTime: TDateTime): TDateTime; +begin + Result := DateTimeHelper.RoundTime(ADateTime); +end; + +function TcxSchedulerTimeBuilder.ValidateStartTime( + const ADateTime: TDateTime): TDateTime; +begin + Result := ADateTime; + if CheckTime then + begin + if (RoundTime(TimeOf(Result)) > WorkFinish) then + Result := Trunc(Result) + WorkFinish + else + if (RoundTime(TimeOf(Result)) < WorkStart) then + Result := Trunc(Result) + WorkStart + end; + ValidateVisibleStart(Result); +end; + +procedure TcxSchedulerTimeBuilder.ValidateTime( + var ADateTime: TDateTime; AGoForward: Boolean; AInc: Integer = 1); +begin + if CheckTime and ((RoundTime(TimeOf(ADateTime)) > WorkFinish) or + (RoundTime(TimeOf(ADateTime)) < WorkStart)) then + begin + if (AInc = 0) and AGoForward and (RoundTime(TimeOf(ADateTime)) > WorkFinish) then + AInc := 1; + if AGoForward then + ADateTime := RoundTime(Trunc(ADateTime) + AInc + WorkStart) + else + ADateTime := RoundTime(Trunc(ADateTime) - AInc + WorkFinish); + end; +end; + +procedure TcxSchedulerTimeBuilder.ValidateUnits( + var AMajorUnit, AMinorUnit: TcxSchedulerTimeGridScaleUnit); +var + AUnit: TcxSchedulerTimeGridScaleUnit; + AValidUnits: TcxSchedulerTimeGridScaleUnits; +begin + if AMajorUnit = suHour then + AMajorUnit := suDay; + AValidUnits := ValidMinorUnits[AMajorUnit]; + if not (AMinorUnit in AValidUnits) then + begin + for AUnit := suHour to suYear do + if AUnit in AValidUnits then + begin + AMinorUnit := AUnit; + Break; + end; + end; +end; + +procedure TcxSchedulerTimeBuilder.ValidateVisibleStart( + var ADateTime: TDateTime); +begin + case MinorUnit of + suHour: + begin + ADateTime := Trunc(ADateTime) + (Round(TimeOf(ADateTime) / + MinuteToTime) div TimeScale * TimeScale) * MinuteToTime; + end; + suDay: + ADateTime := Trunc(ADateTime); + suWeek: + begin + ADateTime := Trunc(ADateTime); + while Byte(DayOfWeek(ADateTime)) <> 1 do ADateTime := ADateTime - 1; + end; + suMonth: + ADateTime := StartOfTheMonth(ADateTime); + suQuarter: + begin + ADateTime := StartOfTheMonth(ADateTime); + while (MonthOf(ADateTime) - 1) mod 3 <> 0 do + ADateTime := IncMonth(ADateTime, -1); + end; + suYear: + ADateTime := StartOfTheYear(ADateTime); + end; +end; + +{ TcxSchedulerTimeGridResourceScroll } + +destructor TcxSchedulerTimeGridResourceScroll.Destroy; +begin + FScrollBar.Free; + inherited Destroy; +end; + +procedure TcxSchedulerTimeGridResourceScroll.CreateScrollBar( + AResourceBounds: TRect; ATimeGridView: TcxSchedulerTimeGridView; + AResourceIndex, ARange, APosition: Integer); +var + AHeight: Integer; +begin + if FScrollBar = nil then + begin + FScrollBar := TcxSchedulerTimeGridScrollBar.Create(nil); + FScrollBar.Kind := sbVertical; + FScrollBar.LookAndFeel.MasterLookAndFeel := ATimeGridView.GetSchedulerLookAndFeel(); + end; + FScrollBar.FResourceIndex := AResourceIndex; + FScrollBar.Min := 0; + FScrollBar.Max := ARange; + FScrollBar.Position := APosition; + FScrollBar.LargeChange := ATimeGridView.ViewInfo.GetVisibleLineCount(AResourceIndex); + AHeight := AResourceBounds.Bottom - AResourceBounds.Top - 1; + FScrollBar.SetBounds(AResourceBounds.Right - GetScrollBarSize.cx + 1, + AResourceBounds.Top + 2, GetScrollBarSize.cx, AHeight); + FScrollBar.Visible := AHeight > 0; + FScrollBar.OnScroll := ATimeGridView.ViewInfo.DoResourceVerticalScroll; + FScrollBar.Parent := ATimeGridView.Scheduler; +end; + +procedure TcxSchedulerTimeGridResourceScroll.ClearMoreEventButtons; +var + I, ALength: Integer; +begin + ALength := Length(FMoreEventButtons); + for I := 0 to ALength - 1 do + FMoreEventButtons[I] := nil; +end; + +procedure TcxSchedulerTimeGridResourceScroll.SetEventMaxLine(AValue: Integer); +begin + FEventMaxLine := Max(FEventMaxLine, AValue); +end; + +procedure TcxSchedulerTimeGridResourceScroll.Store(AClear: Boolean); +begin + FData := FShift; + if AClear then + FShift := 0; +end; + +procedure TcxSchedulerTimeGridResourceScroll.Restore; +begin + FShift := FData; +end; + +end. + diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerUtils.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerUtils.pas new file mode 100644 index 00000000..1e98a21c --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerUtils.pas @@ -0,0 +1,1976 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerUtils; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Classes, Windows, SysUtils, Registry, {$IFDEF DELPHI6} DateUtils, {$ENDIF} Controls, Graphics, + Math, ImgList, cxGraphics, cxGeometry, cxStyles, cxLookAndFeels, cxLookAndFeelPainters, + dxOffice11, Forms, cxDateUtils, cxSchedulerStrs; + +const + // icons + rcClockIndex = 0; + rcRecurrenceIndex = rcClockIndex + 2; + rcBellIndex = rcRecurrenceIndex + 2; + + // date time + Is24HourTimeFormat: Boolean = True; + HourToTime = (MinsPerHour * SecsPerMin * MSecsPerSec) / MSecsPerDay; + MinuteToTime = (SecsPerMin * MSecsPerSec) / MSecsPerDay; + SecondToTime = MSecsPerSec / MSecsPerDay; + + cxHalfHour = 30 * MinuteToTime; + cxTime8AM = 8 * HourToTime; + + MinsPerWeek = MinsPerDay * DaysPerWeek; + + EventLabelColors: array[0..10] of TColor = (clDefault, $8496FC, $E49E84, + $64DEA4, $D4E6E4, $74B6FC, $F4EE84, $84CED4, $F4A6C4, $C4CEA4, $74E6FC); + + ComboBoxTimeIntervals: array[1..25] of record P: Pointer; M: Integer end = ( + (P: @scxTime0m; M: 0), + (P: @scxTime5m; M: 5), + (P: @scxTime10m; M: 10), + (P: @scxTime15m; M: 15), + (P: @scxTime20m; M: 20), + (P: @scxTime30m; M: 30), + (P: @scxTime1h; M: MinsPerHour), + (P: @scxTime2h; M: 2 * MinsPerHour), + (P: @scxTime3h; M: 3 * MinsPerHour), + (P: @scxTime4h; M: 4 * MinsPerHour), + (P: @scxTime5h; M: 5 * MinsPerHour), + (P: @scxTime6h; M: 6 * MinsPerHour), + (P: @scxTime7h; M: 7 * MinsPerHour), + (P: @scxTime8h; M: 8 * MinsPerHour), + (P: @scxTime9h; M: 9 * MinsPerHour), + (P: @scxTime10h; M: 10 * MinsPerHour), + (P: @scxTime11h; M: 11 * MinsPerHour), + (P: @scxTime12h; M: 12 * MinsPerHour), + (P: @scxTime18h; M: 18 * MinsPerHour), + (P: @scxTime1d; M: MinsPerDay), + (P: @scxTime2d; M: 2 * MinsPerDay), + (P: @scxTime3d; M: 3 * MinsPerDay), + (P: @scxTime4d; M: 4 * MinsPerDay), + (P: @scxTime1w; M: MinsPerWeek), + (P: @scxTime2w; M: 2 * MinsPerWeek) + ); + + sMinutePluralNames: array[Boolean] of Pointer = (@scxSuffixMinute, @scxSuffixMinutes); + sHourPluralNames: array[Boolean] of Pointer = (@scxSuffixHour, @scxSuffixHours); + sDayPluralNames: array[Boolean] of Pointer = (@scxSuffixDay, @scxSuffixDays); + sWeekPluralNames: array[Boolean] of Pointer = (@scxSuffixWeek, @scxSuffixWeeks); + + cxEventImagesGap = 1; + +type + TcxStartOfWeek = (swSystem, swSunday, swMonday, swTuesday, swWednesday, + swThursday, swFriday, swSaturday); + + EcxScheduler = class(Exception); + + TcxDayOfWeek = 0..6; + + { TcxTZIField } + + TcxTZIField = packed record + Bias: LongInt; + StandardBias: LongInt; + DaylightBias: LongInt; + StandardDate: TSystemTime; + DaylightDate: TSystemTime; + end; + + { TcxTimeZoneInformation } + + TcxTimeZoneInformation = record + Display: Widestring; + StandardName: Widestring; + DaylightName: Widestring; + Index: Integer; + MapId: string; + TZI: TcxTZIField; + end; + + TSchedulerResourceColor = ( + srcMinorNonWorkTimeSeparator, srcMajorNonWorkTimeSeparator, + srcMinorWorkTimeSeparator, srcMajorWorkTimeSeparator, + srcNonWorkTime, srcWorkTime); + + TcxSchedulerResourceColors = array[TSchedulerResourceColor] of TColor; + + { TcxSchedulerDateTimeHelper } + + TcxSchedulerDateTimeHelper = class + protected + // time zone info + class function CheckTimeIndex(const AIndex: Integer): Integer; + class function cxTZInfoToTZInfo(const AInfo: TcxTimeZoneInformation): TTimeZoneInformation; + class function TZInfoTocxTZInfo(const AInfo: TTimeZoneInformation): TcxTimeZoneInformation; + class function GetIs24HourTimeFormat: Boolean; virtual; + class procedure InitTimeZoneInformation; + class procedure ReadTimeZoneInfoFromRegistry( + ARegistry: TRegistry; out AInfo: TcxTimeZoneInformation); + class procedure RefreshDateInformation; + class procedure RetrieveStartOfWeek; + // system initialization + class procedure InitSchedulerDateTimeSystem; virtual; + class procedure DoneSchedulerDateSystem; virtual; + public + // time zone conversion + class function ConvertToAnotherTimeZone(const ADateTime: TDateTime; + ATimeZone, ANextTimeZone: Integer): TDateTime; + class function ConvertToGlobalTime( + const ADateTime: TDateTime; ATimeZone: Integer = -1): TDateTime; virtual; + class function ConvertToLocalTime( + const ADateTime: TDateTime; ATimeZone: Integer = -1): TDateTime; virtual; + class function CurrentTimeZone: Integer; virtual; + class function IsDaylightDateTime(ATimeZone: Integer; ADateTime: TDateTime): Boolean; + class function TimeZoneBias(AIndex: Integer): TDateTime; virtual; + class function TimeZoneCount: Integer; virtual; + class function TimeZoneDaylightBias(ADateTime: TDateTime; ATimeZone: Integer): Integer; virtual; + class function TimeZoneInfo(AIndex: Integer): TcxTimeZoneInformation; virtual; + // datetime to string conversion + class function DateToLongDateStr(ADate: TDateTime): string; virtual; + class function DayToStr(const ADate: TDateTime; AFormat: Integer; ACompressed: Boolean): string; virtual; + class function DayToStrFormatCount: Integer; virtual; + class function HourToStr(const ATime: TDateTime): string; virtual; + class function MonthYearToStr(AMonth, AYear: Integer): string; virtual; + class function TimeToStr(const ATime: TDateTime): string; virtual; + + // get time constant list + class procedure Refresh; virtual; + class procedure FillAdvanceStrings(AStrings: TStrings); virtual; + + // system constants + class function StartOfWeek: Integer; virtual; + class function WorkDays: TDays; virtual; + class function WorkFinish: TDateTime; virtual; + class function WorkStart: TDateTime; virtual; + class function TimeAMString: string; virtual; + class function TimePMString: string; virtual; + + // misc. date time routines + class procedure IncMonth(var AYear, AMonth, ADay: Word; ANumberOfMonths: Integer = 1); + class function Intersect(const AStart, AFinish, AStart1, AFinish1: TDateTime): Boolean; + class function IsFreeTime(const ADateTime: TDateTime; AWorkDays: TDays; + const AWorkStart, AWorkFinish: TDateTime): Boolean; + class function IsOddMonth(const ADate: TDateTime): Boolean; + class function IsWeekEnd(const ADate: TDateTime; AWorkDays: TDays): Boolean; + class function IsWeeksFull(const AStartDate, AEndDate: TDateTime): Boolean; + class function RoundTime(const ADateTime: TDateTime): TDateTime; virtual; + class function WeekCount(const AStart, AFinish: TDateTime): Integer; + end; + + TcxSchedulerDateTimeHelperClass = class of TcxSchedulerDateTimeHelper; + + { TcxSchedulerPainterHelper } + + TcxSchedulerPainterHelper = class + protected + class procedure CreateStateBrushes; + class procedure DrawClockLine(ACanvas: TcxCanvas; + const ATime, ATimePerCircle, ARadius, XC, YC: Integer); + class procedure DrawShadowLine(ACanvas: TcxCanvas; ABuffer: TBitmap; + const ALeft, ATop, ALength: Integer; AVisibleRect: TRect; AIsRight: Boolean); virtual; + class procedure FreeStateBrushes; + class function GetColorValue(AColor: TColor; ALightValue: Integer): TColor; virtual; + class procedure GetShadowValue(var APixel: TRGBTriple; const Alpha: Double); virtual; + class procedure GetResourceColors(AColor: TColor; out AResourceColors: TcxSchedulerResourceColors); virtual; + class function GetResourceStream(const AResName: string): TMemoryStream; + class procedure InitCachedColors(AColor: TColor; out AColors: TcxSchedulerResourceColors); virtual; + // system initialization + class procedure InitSchedulerGraphics; virtual; + class procedure FreeSchedulerGraphics; virtual; + public + class procedure DrawClock(ACanvas: TcxCanvas; const ARect: TRect; + AHour, AMinute: Word; const AViewParams: TcxViewParams); overload; + class procedure DrawClock(ACanvas: TcxCanvas; const ARect: TRect; ATime: TDateTime; + const AViewParams: TcxViewParams); overload; + class procedure DrawGradientRect(ACanvas: TcxCanvas; + AStartColor: TColor; const ARect: TRect); + class procedure DrawIcon(ACanvas: TcxCanvas; const R: TRect; AIndex: Integer); overload; + class procedure DrawIcon(ACanvas: TcxCanvas; const R: TRect; AIndex: Integer; + const AViewParams: TcxViewParams; AIsTransparent: Boolean); overload; + class procedure DrawShadow(ACanvas: TcxCanvas; + const ARect, AVisibleRect: TRect; ABuffer: TBitmap); virtual; + class procedure DrawState(ACanvas: TcxCanvas; R: TRect; + AState: Integer; ABorders: TcxBorders = []; ABorderColor: TColor = clBlack); + class function ExcludeBorders(const ARect: TRect; + ABorders: TcxBorders; ABorderSize: Integer = 1): TRect; + class function GetContentColor(AResourceColor: Integer; AIsWorkTime: Boolean): TColor; + class function GetResourceContentColor(AResourceIndex: Integer): TColor; + class function GetSeparatorColor(const AResourceColor: Integer; + AIsHourSeparator, AIsWorkTime: Boolean): TColor; + class function IconsWidth: Integer; + class function IconsHeight: Integer; + class function IncludeBorders(const ARect: TRect; + ABorders: TcxBorders; ABorderSize: Integer = 1): TRect; + class procedure InitStyle(AStyle: TcxStyle; const AResName: string; + AGraphicClass: TGraphicClass); + class function LoadGraphic(ABitmap: TBitmap; const AResName: string; + AGraphicClass: TGraphicClass): Boolean; + class function LoadImages(AWidth, AHeight: Integer; const AResName: string; + AHasPalette: Boolean = False; AHasTransparent: Boolean = True): TImageList; + class function MoreButtonHeight: Integer; + class function MoreButtonWidth: Integer; + class function ShadowSize: Integer; + class function TextHeight(AFont: TFont): Integer; + class function TextWidth(AFont: TFont; const AText: string): Integer; + end; + + TcxSchedulerPainterHelperClass = class of TcxSchedulerPainterHelper; + + { TcxSchedulerHelpersFactory } + + TcxSchedulerHelpersFactory = class + protected + class procedure Done; virtual; + class procedure Init; virtual; + class procedure LoadCursors; + public + class function PainterHelperClass: TcxSchedulerPainterHelperClass; virtual; + class function DateTimeHelperClass: TcxSchedulerDateTimeHelperClass; virtual; + end; + + TcxSchedulerHelpersFactoryClass = class of TcxSchedulerHelpersFactory; + + { TcxSchedulerObjectList } + + TcxSchedulerObjectList = class(TList) + private + function GetItem(AIndex: Integer): TObject; + public + destructor Destroy; override; + procedure Clear; override; + property Items[Index: Integer]: TObject read GetItem; + end; + + { TcxSchedulerDateList } + + TcxSchedulerDateList = class(TList) + private + FChanged: Boolean; + function GetChanged: Boolean; + function GetItem(AIndex: Integer): TDateTime; + procedure SetItem(AIndex: Integer; const AValue: TDateTime); + protected + procedure Notify(Ptr: Pointer; Action: TListNotification); override; + public + {$IFNDEF DELPHI6} + procedure Assign(ASource: TList); + {$ENDIF} + function Add(ADate: TDateTime): Integer; reintroduce; + function AddEx(ADate: TDateTime): Integer; + function ExistDate(ADate: TDateTime): Boolean; + function IndexOf(ADate: TDateTime): Integer; reintroduce; + procedure ShiftPeriod(ADelta: TDateTime); + property Items[Index: Integer]: TDateTime read GetItem write SetItem; default; + property Changed: Boolean read GetChanged write FChanged; + end; + + { TcxSchedulerTimeRange } + + TcxSchedulerTimeRange = class(TCollectionItem) + protected + FFinish: TDateTime; + FStart: TDateTime; + function GetDuration: TDateTime; + public + property Duration: TDateTime read GetDuration; + property Finish: TDateTime read FFinish; + property Start: TDateTime read FStart; + end; + + { TcxSchedulerTimeRanges} + + TcxSchedulerTimeRanges = class(TCollection) + private + function GetItem(AIndex: Integer): TcxSchedulerTimeRange; + protected + FOwner: TObject; + public + constructor CreateEx(AOwner: TObject); + function Add(const AStart, AFinish: TDateTime): TcxSchedulerTimeRange; + property Items[Index: Integer]: TcxSchedulerTimeRange read GetItem; default; + end; + + { TcxSchedulerEventLabel } + + TcxSchedulerEventLabel = class(TCollectionItem) + private + FCaption: string; + FColor: TColor; + FOriginalIndex: Integer; + function GetCaption: string; + function GetColor: TColor; + procedure SetCaption(const AValue: string); + procedure SetColor(AValue: TColor); + public + constructor Create(Collection: TCollection); override; + + property Caption: string read GetCaption write SetCaption; + property Color: TColor read GetColor write SetColor; + end; + + { TcxSchedulerEventLabels } + + TcxSchedulerEventLabels = class(TCollection) + private + FImages: TImageList; + function GetItem(AIndex: Integer): TcxSchedulerEventLabel; + protected + procedure CreateDefaultItems; + procedure Update(Item: TCollectionItem); override; + procedure UpdateImageList; + public + constructor Create; + destructor Destroy; override; + function Add(AColor: TColor; const ACaption: string): TcxSchedulerEventLabel; + function IndexOfColor(AColor: TColor): Integer; + + property Items[Index: Integer]: TcxSchedulerEventLabel read GetItem; default; + property Images: TImageList read FImages; + end; + + TcxMinutesToTextProc = function (AMinutes: Integer): string; + TcxTextToMinutesProc = function (const AText: string; out AMinutes: Integer): Boolean; + +function GetNearestDivider(ANum, ADenom, AMinDenom, AMaxDenom: Integer): Integer; + +function cxCompareDates(Item1, Item2: Pointer): Integer; + +procedure cxSchedulerError(const ADescription: string); overload; +procedure cxSchedulerError(const ADescription: string; Args: array of const); overload; + +function cxMinutesToText(AMinutes: Integer): string; +function cxTextToMinutes(const AText: string; out AMinutes: Integer): Boolean; + +const + DateTimeHelper : TcxSchedulerDateTimeHelperClass = TcxSchedulerDateTimeHelper; + cxMinutesToTextProc: TcxMinutesToTextProc = cxMinutesToText; + cxTextToMinutesProc: TcxTextToMinutesProc = cxTextToMinutes; + + PredefinedResourceColors: array[0..11] of TcxSchedulerResourceColors = + (($B1E4F3, $98D0EA, $C7EFFF, $A2DBF6, $BCF4FF, $D5FFFF), + ($FF6E03, $F5BFA0, $FCE5D1, $FADAC4, $F5BFA0, $FEECDD), + ($8ACBA8, $68B48C, $B4E4CD, $A2D1BA, $97D4B3, $BCECD5), + ($B59380, $987461, $DBC9C1, $CCAFA1, $BF9E8B, $E6D8CF), + ($957CB4, $7A659C, $C7BDDA, $ABA3C5, $A186BE, $D6CBE3), + ($9CA87B, $808E54, $C3CAAE, $ADB691, $A7B189, $D1D6C1), + ($71A7EB, $4783CA, $A3C4EE, $76A6E1, $7FB4F7, $AED0FA), + ($8381D2, $6564B3, $BDBBE9, $A6A4DE, $8E8CDD, $C9C8EF), + ($7A8A81, $596466, $BFCFC4, $A9B5AC, $849689, $CBD8D0), + ($BBBA00, $999700, $E3E290, $CCCB54, $C8C700, $ECECA8), + ($C2889B, $9B6376, $E6C7D2, $D8A9B9, $CF94A8, $ECD5DD), + ($BDBDBD, $797979, $CCCCCC, $B1B1B1, $CCCCCC, $E6E6E6)); + + ResourceColorIntensityValues: array[TSchedulerResourceColor] of Integer = + (80, 65, 85, 70, 90, 100); + +var + EventImages: TCustomImageList; + MenuImages: TCustomImageList; + MoreEventButtonGlyphs: TCustomImageList; + TimeLinePatterns: TCustomImageList; + StateBrushes: array[0..7] of TBrush; + SchedulerHelpersFactory: TcxSchedulerHelpersFactoryClass; + EventLabels: TcxSchedulerEventLabels; + DefaultTimeZoneInfo: TcxTimeZoneInformation; + +implementation + +uses + CommCtrl, cxClasses, cxControls, cxLibraryConsts; + +type + TcxPaletteChangedNotifier = class(TcxSystemPaletteChangedNotifier) + protected + procedure DoChanged; override; + end; + +const + cxShadowSize = 5; + +var + PaletteChangedListener: TcxPaletteChangedNotifier; + + // date time sytem variables + PrevNextTimeZone: Integer; + PrevTimeZone: Integer; + TimeZoneDeltaBias: Double; + ACurrentTimeZone: Integer; + TimeZoneInformations: array of TcxTimeZoneInformation; + // first day of week + SystemStartOfWeek: TcxDayOfWeek; + LongDateOrder: Integer; + LongDayMonthFormat: string; + DayMonthFormats: array[0..4] of string; + + // graphics variables + PrevColorData: TcxSchedulerResourceColors; + PrevFontHandle: HFont; + PrevFontHeight: Integer; + PrevResourceColor: TColor; + +{$R cxScheduler.res} + +function GetNearestDivider(ANum, ADenom, AMinDenom, AMaxDenom: Integer): Integer; +begin + Result := Max(ADenom, AMinDenom); + Result := Min(Result, AMaxDenom); + if ANum mod Result <> 0 then + begin + if (ANum mod Result) > (Result / 2) then + while ANum mod Result <> 0 do Inc(Result) + else + while ANum mod Result <> 0 do Dec(Result); + end; + Result := Min(ADenom, AMaxDenom); +end; + +function cxCompareDates(Item1, Item2: Pointer): Integer; +begin + Result := Integer(Item1) - Integer(Item2); +end; + +procedure cxSchedulerError(const ADescription: string); overload; +begin + cxSchedulerError(ADescription, []); +end; + +procedure cxSchedulerError(const ADescription: string; Args: array of const); +begin + raise EcxScheduler.CreateFmt(ADescription, Args); +end; + +function cxMinutesToText(AMinutes: Integer): string; +var + W: Integer; +begin + if (AMinutes >= MinsPerWeek) and ((AMinutes mod MinsPerWeek) = 0) then + begin + W := AMinutes div MinsPerWeek; + Result := Format('%d %s', [W, cxGetResourceString(sWeekPluralNames[W <> 1])]); + end + else + if (AMinutes >= MinsPerDay) and ((AMinutes * 100 mod MinsPerDay) = 0) then + Result := Format('%s %s', [FloatToStr(AMinutes / MinsPerDay), + cxGetResourceString(sDayPluralNames[AMinutes <> MinsPerDay])]) + else + if (AMinutes >= MinsPerHour) and ((AMinutes * 10 mod MinsPerHour) = 0) then + Result := Format('%s %s', [FloatToStr(AMinutes / MinsPerHour), + cxGetResourceString(sHourPluralNames[AMinutes <> MinsPerHour])]) + else + Result := Format('%d %s', [AMinutes, + cxGetResourceString(sMinutePluralNames[AMinutes <> 1])]); +end; + +function cxTextToMinutes(const AText: string; out AMinutes: Integer): Boolean; +var + ACode, APos, I: Integer; + AValue: Extended; + S: string; + + function CheckMeasureUnits(const AName1, AName2: string): Boolean; + begin + Result := ((Length(S) = 1) and SameText(S, AName1[1]) or SameText(S, AName2[1])) or + (SameText(S, AName1) or SameText(S, AName2)); + end; + +begin + Result := True; + S := Trim(AText); + for I := 1 to Length(S) do + if S[I] = DecimalSeparator then S[I] := '.'; + Val(S, AValue, ACode); + if ACode = 0 then + begin + AMinutes := Abs(Round(AValue)); + Exit; + end; + if ACode > 1 then + begin + APos := ACode; + Val(Copy(S, 1, APos - 1), AValue, ACode); + S := Trim(Copy(S, APos, Length(S))); + if CheckMeasureUnits(cxGetResourceString(sMinutePluralNames[True]), + cxGetResourceString(sMinutePluralNames[False])) then + AMinutes := Round(AValue) + else + if CheckMeasureUnits(cxGetResourceString(sHourPluralNames[True]), + cxGetResourceString(sHourPluralNames[False])) then + AMinutes := Round(AValue * MinsPerHour) + else + if CheckMeasureUnits(cxGetResourceString(sDayPluralNames[True]), + cxGetResourceString(sDayPluralNames[False])) then + AMinutes := Round(AValue * MinsPerDay) + else + if CheckMeasureUnits(cxGetResourceString(sWeekPluralNames[True]), + cxGetResourceString(sWeekPluralNames[False])) then + AMinutes := Round(AValue * MinsPerWeek) + else + AMinutes := Round(AValue); + AMinutes := Abs(AMinutes); + end + else + Result := False; +end; + +{ TcxSchedulerDateTimeHelper } + +class function TcxSchedulerDateTimeHelper.ConvertToAnotherTimeZone( + const ADateTime: TDateTime; ATimeZone, ANextTimeZone: Integer): TDateTime; +begin + if (ATimeZone <> PrevTimeZone) or (ANextTimeZone <> PrevNextTimeZone) then + begin + TimeZoneDeltaBias := ConvertToLocalTime( + ConvertToGlobalTime(ADateTime, ATimeZone), ANextTimeZone) - ADateTime; + PrevTimeZone := ATimeZone; + PrevNextTimeZone := ANextTimeZone; + end; + Result := ADateTime; + if (TimeZoneDeltaBias < 0) and (Result < 1) then + Result := Result + 1; + Result := Result + TimeZoneDeltaBias; +end; + +class function TcxSchedulerDateTimeHelper.ConvertToGlobalTime( + const ADateTime: TDateTime; ATimeZone: Integer = -1): TDateTime; +begin + Result := ADateTime + TimeZoneBias(CheckTimeIndex(ATimeZone)); +end; + +class function TcxSchedulerDateTimeHelper.ConvertToLocalTime( + const ADateTime: TDateTime; ATimeZone: Integer = -1): TDateTime; +begin + Result := ADateTime - TimeZoneBias(CheckTimeIndex(ATimeZone)); +end; + +class function TcxSchedulerDateTimeHelper.CurrentTimeZone: Integer; +begin + Result := ACurrentTimeZone; +end; + +procedure CutLeftYear(var S: string); +var + F: Boolean; + I, Pos: Integer; +begin + Pos := 0; + F := False; + for I := 1 to Length(S) do + if S[I] = '''' then + F := not F + else + if not F and (UpCase(S[I]) in ['D', 'M']) then + begin + Pos := I; + break; + end; + if Pos > 0 then + Delete(S, 1, I - 1); +end; + +procedure CutRightYear(var S: string); +var + F: Boolean; + I, Pos: Integer; +begin + Pos := 0; + F := False; + for I := Length(S) downto 1 do + if S[I] = '''' then + F := not F + else + if not F and (UpCase(S[I]) in ['D', 'M']) then + begin + Pos := I; + break; + end; + if Pos > 0 then + S := Copy(S, 1, Pos); +end; + +function GetShortestFormat: string; +var + I: Integer; +begin + Result := ShortDateFormat; + if Result = '' then Exit; + if UpCase(Result[1]) = 'Y' then + CutLeftYear(Result) + else + CutRightYear(Result); + I := Pos('mm', LowerCase(Result)); + if I > 0 then + Delete(Result, I, 1); + I := Pos('dd', LowerCase(Result)); + if I > 0 then + Delete(Result, I, 1); +end; + +procedure CutMonth(var S: string; AStartIndex: Integer); + + procedure CutLeftMonth(var S: string); + var + F: Boolean; + I, Pos: Integer; + begin + Pos := 0; + F := False; + for I := AStartIndex + 3 to Length(S) do + if S[I] = '''' then + F := not F + else + if not F and (UpCase(S[I]) = 'D') then + begin + Pos := I; + break; + end; + if Pos > 0 then + Delete(S, AStartIndex, Pos - AStartIndex); + end; + + procedure CutRightMonth(var S: string); + var + F: Boolean; + I, Pos: Integer; + begin + Pos := 0; + F := False; + for I := AStartIndex - 1 downto 1 do + if S[I] = '''' then + F := not F + else + if not F and (UpCase(S[I]) <> ' ') then + begin + Pos := I; + break; + end; + if Pos > 0 then + Delete(S, I + 1, AStartIndex - I + 3); + end; + +begin + if LongDateOrder = 1 then + CutRightMonth(S) + else + CutLeftMonth(S); +end; + +procedure GetDayMonthFormats; +var + S: string; + I: Integer; + Index: Integer; +begin + S := LongDayMonthFormat; + Index := 0; + DayMonthFormats[0] := S; + DayMonthFormats[1] := GetShortestFormat; + DayMonthFormats[2] := DayMonthFormats[1]; + DayMonthFormats[3] := DayMonthFormats[1]; + DayMonthFormats[4] := DayMonthFormats[1]; + I := Pos('mmmm', LowerCase(S)); + if I > 0 then + begin + Delete(S, I, 1); + Inc(Index); + DayMonthFormats[Index] := S; + end; + I := Pos('dddd', LowerCase(S)); + if I > 0 then + begin + Delete(S, I, 1); + Inc(Index); + DayMonthFormats[Index] := S; + end; + I := Pos('mmm', LowerCase(S)); + if I > 0 then + begin + CutMonth(S, I); + Inc(Index); + DayMonthFormats[Index] := S; + end; +end; + +class function TcxSchedulerDateTimeHelper.DateToLongDateStr( + ADate: TDateTime): string; +begin + Result := cxDateUtils.DateToLongDateStr(ADate); +end; + +class function TcxSchedulerDateTimeHelper.DayToStr( + const ADate: TDateTime; AFormat: Integer; ACompressed: Boolean): string; +var + AYear, AMonth, ADay: Word; +begin + if ACompressed then + begin + DecodeDate(ADate, AYear, AMonth, ADay); + ADay := DayOfWeek(ADate); + Result := IntToStr(DayOf(ADate)); + case AFormat of + 0: + Result := LongDayNames[ADay] + '/'+ + LongDayNames[DayOfWeek(ADate + 1)] + ' ' + Result; + 1: + Result := ShortDayNames[ADay] + '/'+ + ShortDayNames[DayOfWeek(ADate + 1)] + ' ' + Result; + else + Result := Result + '/' + IntToStr(DayOf(ADate + 1)); + end; + end + else + if not cxGetDateFormat(ADate, Result, 0, DayMonthFormats[AFormat]) then + Result := DateToStr(ADate); +end; + +class function TcxSchedulerDateTimeHelper.DayToStrFormatCount: Integer; +begin + Result := 5; +end; + +class function TcxSchedulerDateTimeHelper.HourToStr(const ATime: TDateTime): string; +var + IsPM: Boolean; + H, M, S: Word; +begin + DecodeTime(ATime, H, M, S, S); + Result := ''; + if not Is24HourTimeFormat then + begin + Result := ':' + FormatFloat('00', M); + IsPM := H >= 12; + if IsPM then Dec(H, 12); + if (H = 0) then + begin + if not IsPM then + Result := '12 ' + AnsiLowerCase(TimeAMString) + else + Result := '12 ' + AnsiLowerCase(TimePMString); + end + else + Result := FormatFloat('0', H) + ':' + FormatFloat('00', M); + end + else + Result := FormatFloat('00', H) + ':' + FormatFloat('00', M); +end; + +class function TcxSchedulerDateTimeHelper.MonthYearToStr( + AMonth, AYear: Integer): string; +begin + if LongDateOrder < 2 then + Result := LongMonthNames[AMonth] + ' ' + IntToStr(AYear) + else + Result := IntToStr(AYear) + ' ' + LongMonthNames[AMonth]; +end; + +class procedure TcxSchedulerDateTimeHelper.Refresh; +begin + GetFormatSettings; + RetrieveStartOfWeek; + RefreshDateInformation; + Is24HourTimeFormat := GetIs24HourTimeFormat; +end; + +class procedure TcxSchedulerDateTimeHelper.FillAdvanceStrings(AStrings: TStrings); +begin + if AStrings = nil then Exit; + AStrings.BeginUpdate; + try + AStrings.Clear; + AStrings.AddObject(cxGetResourceString(@scxTime0m), Pointer(0)); + AStrings.AddObject(cxGetResourceString(@scxTime5m), Pointer(5)); + AStrings.AddObject(cxGetResourceString(@scxTime10m), Pointer(10)); + AStrings.AddObject(cxGetResourceString(@scxTime15m), Pointer(15)); + AStrings.AddObject(cxGetResourceString(@scxTime20m), Pointer(20)); + AStrings.AddObject(cxGetResourceString(@scxTime30m), Pointer(30)); + AStrings.AddObject(cxGetResourceString(@scxTime1h), Pointer(1 * 60)); + AStrings.AddObject(cxGetResourceString(@scxTime2h), Pointer(2 * 60)); + AStrings.AddObject(cxGetResourceString(@scxTime3h), Pointer(3 * 60)); + AStrings.AddObject(cxGetResourceString(@scxTime4h), Pointer(4 * 60)); + AStrings.AddObject(cxGetResourceString(@scxTime5h), Pointer(5 * 60)); + AStrings.AddObject(cxGetResourceString(@scxTime6h), Pointer(6 * 60)); + AStrings.AddObject(cxGetResourceString(@scxTime7h), Pointer(7 * 60)); + AStrings.AddObject(cxGetResourceString(@scxTime8h), Pointer(8 * 60)); + AStrings.AddObject(cxGetResourceString(@scxTime9h), Pointer(9 * 60)); + AStrings.AddObject(cxGetResourceString(@scxTime10h), Pointer(10 * 60)); + AStrings.AddObject(cxGetResourceString(@scxTime11h), Pointer(11 * 60)); + AStrings.AddObject(cxGetResourceString(@scxTime12h), Pointer(12 * 60)); + AStrings.AddObject(cxGetResourceString(@scxTime18h), Pointer(18 * 60)); + AStrings.AddObject(cxGetResourceString(@scxTime1d), Pointer(1 * 24 * 60)); + AStrings.AddObject(cxGetResourceString(@scxTime2d), Pointer(2 * 24 * 60)); + AStrings.AddObject(cxGetResourceString(@scxTime3d), Pointer(3 * 24 * 60)); + AStrings.AddObject(cxGetResourceString(@scxTime4d), Pointer(4 * 24 * 60)); + AStrings.AddObject(cxGetResourceString(@scxTime1w), Pointer(1 * 7 * 24 * 60)); + AStrings.AddObject(cxGetResourceString(@scxTime2w), Pointer(2 * 7 * 24 * 60)); + finally + AStrings.EndUpdate; + end; +end; + +class procedure TcxSchedulerDateTimeHelper.IncMonth( + var AYear, AMonth, ADay: Word; ANumberOfMonths: Integer = 1); +begin + IncAMonth(AYear, AMonth, ADay, ANumberOfMonths); +end; + +class function TcxSchedulerDateTimeHelper.Intersect( + const AStart, AFinish, AStart1, AFinish1: TDateTime): Boolean; +begin + Result := ((AStart1 > AStart) and (AStart1 <= AFinish)) or + ((AFinish1 > AStart) and (AFinish1 <= AFinish)); +end; + +class function TcxSchedulerDateTimeHelper.IsFreeTime( + const ADateTime: TDateTime; AWorkDays: TDays; + const AWorkStart, AWorkFinish: TDateTime): Boolean; +var + AHour: Word; +begin + AHour := HourOf(ADateTime); + Result := IsWeekEnd(ADateTime, AWorkDays) or + (AHour < AWorkStart) or (AHour > AWorkFinish); +end; + +class function TcxSchedulerDateTimeHelper.IsOddMonth( + const ADate: TDateTime): Boolean; +begin + Result := Odd(MonthOf(ADate)); +end; + +class function TcxSchedulerDateTimeHelper.IsWeekEnd( + const ADate: TDateTime; AWorkDays: TDays): Boolean; +var + ADay: Word; +begin + ADay := DayOfTheWeek(ADate); + if ADay > 6 then ADay := 0; + Result := not (TDay(ADay) in AWorkDays); +end; + +class function TcxSchedulerDateTimeHelper.IsWeeksFull( + const AStartDate, AEndDate: TDateTime): Boolean; +begin + Result := (DayOfWeek(AStartDate) = 1) and (DayOfWeek(AEndDate) = 7); +end; + +class function TcxSchedulerDateTimeHelper.StartOfWeek: Integer; +begin + Result := SystemStartOfWeek; +end; + +class function TcxSchedulerDateTimeHelper.TimeAMString: string; +begin + Result := SysUtils.TimeAMString; +end; + +class function TcxSchedulerDateTimeHelper.TimePMString: string; +begin + Result := SysUtils.TimePMString; +end; + +class function TcxSchedulerDateTimeHelper.TimeToStr( + const ATime: TDateTime): string; +var + APos: Integer; +begin + Result := AnsiLowerCase(FormatDateTime('t', ATime)); + repeat + APos := Pos(' ', Result); + if APos > 0 then + Delete(Result, APos, 1); + until APos = 0; +end; + +class function TcxSchedulerDateTimeHelper.TimeZoneCount: Integer; +begin + Result := Length(TimeZoneInformations); +end; + +class function TcxSchedulerDateTimeHelper.TimeZoneBias(AIndex: Integer): TDateTime; +begin + if AIndex = -1 then + AIndex := CurrentTimeZone; + Result := TimeZoneInfo(AIndex).TZI.Bias * MinuteToTime; +end; + +class function TcxSchedulerDateTimeHelper.TimeZoneInfo(AIndex: Integer): TcxTimeZoneInformation; +begin + if (AIndex >= 0) and (AIndex < Length(TimeZoneInformations)) then + Result := TimeZoneInformations[AIndex] + else + Result := DefaultTimeZoneInfo; +end; + +class function TcxSchedulerDateTimeHelper.RoundTime( + const ADateTime: TDateTime): TDateTime; +var + H, M, S, MS: Word; +begin + DecodeTime(ADateTime, H, M, S, MS); + Result := Int(ADateTime) + H * HourToTime + M * MinuteToTime; +end; + +class function TcxSchedulerDateTimeHelper.WeekCount( + const AStart, AFinish: TDateTime): Integer; +var + C: Integer; +begin + //DELPHI8! check Trunc(AFinish) + C := Trunc(AFinish) - Trunc(AStart); + Result := C div 7; + if (C mod 7) <> 0 then Inc(Result); +end; + +class function TcxSchedulerDateTimeHelper.WorkDays: TDays; +begin + Result := [dMonday..dFriday]; +end; + +class function TcxSchedulerDateTimeHelper.WorkFinish: TDateTime; +begin + Result := EncodeTime(17, 0, 0, 0); +end; + +class function TcxSchedulerDateTimeHelper.WorkStart: TDateTime; +begin + Result := EncodeTime(8, 0, 0, 0); +end; + +class function TcxSchedulerDateTimeHelper.CheckTimeIndex( + const AIndex: Integer): Integer; +begin + Result := AIndex; + if AIndex = -1 then + Result := CurrentTimeZone; +end; + +class function TcxSchedulerDateTimeHelper.cxTZInfoToTZInfo( + const AInfo: TcxTimeZoneInformation): TTimeZoneInformation; +begin + FillChar(Result, SizeOf(Result), 0); + Result.Bias := AInfo.TZI.Bias; + Result.StandardBias := AInfo.TZI.StandardBias; + Result.DaylightBias := AInfo.TZI.DaylightBias; + Result.StandardDate := AInfo.TZI.StandardDate; + Result.DaylightDate := AInfo.TZI.DaylightDate; + Move(AInfo.StandardName[1], Result.StandardName, Length(AInfo.StandardName) shl 1); + Move(AInfo.DaylightName[1], Result.DaylightName, Length(AInfo.DaylightName) shl 1); +end; + +class function TcxSchedulerDateTimeHelper.TZInfoTocxTZInfo( + const AInfo: TTimeZoneInformation): TcxTimeZoneInformation; +begin + FillChar(Result, SizeOf(Result), 0); + Result.TZI.Bias := AInfo.Bias; + Result.TZI.StandardBias := AInfo.StandardBias; + Result.TZI.DaylightBias := AInfo.DaylightBias; + Result.TZI.StandardDate := AInfo.StandardDate; + Result.TZI.DaylightDate := AInfo.DaylightDate; + Result.StandardName := AInfo.StandardName; + Result.DaylightName := AInfo.DaylightName; +end; + +class function TcxSchedulerDateTimeHelper.GetIs24HourTimeFormat: Boolean; +begin + Result := Pos('H', GetLocaleStr(GetThreadLocale, LOCALE_STIMEFORMAT, '')) <> 0; +end; + +class function TcxSchedulerDateTimeHelper.IsDaylightDateTime(ATimeZone: Integer; + ADateTime: TDateTime): Boolean; +var + ADay: Word; + AInfo: TcxTimeZoneInformation; + AMonth: Word; + AYear: Word; + + function GetTransitionDay(AYear: Word; const ATime: TSystemTime): Integer; + var + ADay: Word; + begin + if ATime.wDay = 5 then + ADay := DaysInAMonth(AYear, ATime.wMonth) + else + ADay := 1 + DaysPerWeek * (ATime.wDay - 1); + Result := ADay - DayOfTheWeek(EncodeDate(AYear, ATime.wMonth, ADay)) + ATime.wDayOfWeek; + if Result <= 0 then + Inc(Result, DaysPerWeek); + if Result > DaysInAMonth(AYear, ATime.wMonth) then + Dec(Result, DaysPerWeek); + end; + +begin + AInfo := TimeZoneInfo(CheckTimeIndex(ATimeZone)); + Result := AInfo.TZI.StandardDate.wMonth <> 0; + if Result then + begin + DecodeDate(ADateTime, AYear, AMonth, ADay); + Result := (AMonth >= AInfo.TZI.DaylightDate.wMonth) and + (AMonth <= AInfo.TZI.StandardDate.wMonth); + if Result then + begin + with AInfo.TZI.DaylightDate do + Result := (AMonth > wMonth) or (ADay > GetTransitionDay(AYear, + AInfo.TZI.DaylightDate)); + + with AInfo.TZI.StandardDate do + Result := Result and ((AMonth < wMonth) or (ADay <= GetTransitionDay(AYear, + AInfo.TZI.StandardDate))); + end; + end; +end; + +class function TcxSchedulerDateTimeHelper.TimeZoneDaylightBias(ADateTime: TDateTime; + ATimeZone: Integer): Integer; +begin + Result := 0; + with TimeZoneInfo(CheckTimeIndex(ATimeZone)).TZI do + if DaylightDate.wMonth <> 0 then + begin + if IsDaylightDateTime(ATimeZone, ADateTime) then + Inc(Result, DaylightBias) + else + Inc(Result, StandardBias); + end; +end; + +class procedure TcxSchedulerDateTimeHelper.InitTimeZoneInformation; +var + I: Integer; + ARegistry: TRegistry; + ASubKeys: TStringList; + ATimeZoneInfo, ACurTimeZoneInfo: TTimeZoneInformation; +const + AKeys: array[Boolean] of string = + ('SOFTWARE\Microsoft\Windows\CurrentVersion\Time Zones', + 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones'); +begin + ARegistry := TRegistry.Create(KEY_READ); + try + GetTimeZoneInformation(ACurTimeZoneInfo); + DefaultTimeZoneInfo := TZInfoTocxTZInfo(ACurTimeZoneInfo); + ARegistry.RootKey := HKEY_LOCAL_MACHINE; + if ARegistry.OpenKeyReadOnly(AKeys[IsWinNT]) and ARegistry.HasSubKeys then + begin + ASubKeys := TStringList.Create; + try + ARegistry.GetKeyNames(ASubKeys); + ARegistry.CloseKey; + SetLength(TimeZoneInformations, ASubKeys.Count); + for I := 0 to ASubKeys.Count - 1 do + if ARegistry.OpenKeyReadOnly(AKeys[IsWinNT] + '\' + ASubKeys[I]) then + begin + ReadTimeZoneInfoFromRegistry(ARegistry, TimeZoneInformations[I]); + ARegistry.CloseKey; + ATimeZoneInfo := cxTZInfoToTZInfo(TimeZoneInformations[I]); + if CompareMem(@ATimeZoneInfo, @ACurTimeZoneInfo, + SizeOf(ATimeZoneInfo.Bias) + SizeOf(ATimeZoneInfo.StandardName)) then + ACurrentTimeZone := I; + end; + finally + ASubKeys.Free; + end; + end; + finally + ARegistry.Free; + end; +end; + +class procedure TcxSchedulerDateTimeHelper.ReadTimeZoneInfoFromRegistry( + ARegistry: TRegistry; out AInfo: TcxTimeZoneInformation); +begin + if ARegistry.ValueExists('Display') then + AInfo.Display := ARegistry.ReadString('Display'); + if ARegistry.ValueExists('Std') then + AInfo.StandardName := ARegistry.ReadString('Std'); + if ARegistry.ValueExists('Dlt') then + AInfo.DaylightName := ARegistry.ReadString('Dlt'); + if ARegistry.ValueExists('MapID') then + AInfo.MapID := ARegistry.ReadString('MapID'); + if ARegistry.ValueExists('Index') then + AInfo.Index := ARegistry.ReadInteger('Index'); + if ARegistry.ValueExists('TZI') then + ARegistry.ReadBinaryData('TZI', AInfo.TZI, SizeOf(AInfo.TZI)); +end; + +{$WARNINGS OFF} + +function GetLongDayMonthFormat: string; +var + L: Integer; +begin + Result := LongDateFormat; + L := StrToIntDef(GetLocaleStr(GetThreadLocale, LOCALE_ILDATE, '0'), 0); + if L < 2 then + CutRightYear(Result) + else + CutLeftYear(Result); +end; + +class procedure TcxSchedulerDateTimeHelper.RefreshDateInformation; +var + DefaultLCID: LCID; + I, Day: Integer; +begin + DefaultLCID := GetUserDefaultLCID; + for I := 1 to 12 do + begin + ShortMonthNames[I] := + GetLocaleStr(DefaultLCID, LOCALE_SABBREVMONTHNAME1 + I - 1, ShortMonthNames[I]); + LongMonthNames[I] := + GetLocaleStr(DefaultLCID, LOCALE_SMONTHNAME1 + I - 1, LongMonthNames[I]); + end; + for I := 1 to 7 do + begin + Day := I - 2; + if Day = -1 then Day := 6; + ShortDayNames[I] := + GetLocaleStr(DefaultLCID, LOCALE_SABBREVDAYNAME1 + Day, ShortDayNames[I]); + LongDayNames[I] := + GetLocaleStr(DefaultLCID, LOCALE_SDAYNAME1 + Day, LongDayNames[I]); + end; + GetFormatSettings; + LongDateOrder := StrToIntDef(GetLocaleStr(GetThreadLocale, LOCALE_ILDATE, '1'), 1); + LongDayMonthFormat := GetLongDayMonthFormat; + GetDayMonthFormats; +end; + +{$WARNINGS ON} + +class procedure TcxSchedulerDateTimeHelper.RetrieveStartOfWeek; +begin + SystemStartOfWeek := StrToInt(GetLocaleStr(GetUserDefaultLCID, LOCALE_IFIRSTDAYOFWEEK, '0')) + 1; + if SystemStartOfWeek > 6 then + SystemStartOfWeek := 0; +end; + +class procedure TcxSchedulerDateTimeHelper.InitSchedulerDateTimeSystem; +begin + GetFormatSettings; + DateTimeHelper.InitTimeZoneInformation; + Refresh; +end; + +class procedure TcxSchedulerDateTimeHelper.DoneSchedulerDateSystem; +begin + SetLength(TimeZoneInformations, 0); +end; + +{ TcxSchedulerPainterHelper } + +class procedure TcxSchedulerPainterHelper.DrawClock(ACanvas: TcxCanvas; + const ARect: TRect; AHour, AMinute: Word; const AViewParams: TcxViewParams); +var + AfterNoon: Boolean; + XC, YC: Integer; +const + ArrowColor: array[Boolean] of TColor = (clBlack, clWhite); +begin + XC := (ARect.Left + ARect.Right) div 2; + YC := (ARect.Top + ARect.Bottom) div 2; + AfterNoon := AHour >= 12; + if AfterNoon then Dec(AHour, 12); + DrawIcon(ACanvas, ARect, rcClockIndex + Byte(AfterNoon), AViewParams, True); + ACanvas.Pen.Color := ArrowColor[AfterNoon]; + AHour := AHour * 2; + if AMinute >= 30 then + Inc(AHour); + if AMinute > 45 then + Inc(AHour); + DrawClockLine(ACanvas, AHour, 24, 5, XC, YC); + DrawClockLine(ACanvas, AMinute, 60, 8, XC, YC); +end; + +class procedure TcxSchedulerPainterHelper.DrawClock(ACanvas: TcxCanvas; + const ARect: TRect; ATime: TDateTime; const AViewParams: TcxViewParams); +var + H, M, S, MS: Word; +begin + DecodeTime(ATime, H, M, S, MS); + DrawClock(ACanvas, ARect, H, M, AViewParams); +end; + +class procedure TcxSchedulerPainterHelper.DrawGradientRect( + ACanvas: TcxCanvas; AStartColor: TColor; const ARect: TRect); +begin + FillGradientRect(ACanvas.Handle, ExcludeBorders(ARect, [bBottom]), + AStartColor, dxOffice11SelectedDownColor1, False); + ACanvas.FrameRect(ARect, dxOffice11SelectedDownColor2, 1, [bBottom]); +end; + +class procedure TcxSchedulerPainterHelper.DrawIcon( + ACanvas: TcxCanvas; const R: TRect; AIndex: Integer); +begin + if ((R.Right - R.Left) < IconsWidth) or + ((R.Bottom - R.Top) < IconsHeight) then Exit; + EventImages.DrawingStyle := dsTransparent; + EventImages.Draw(ACanvas.Canvas, R.Left, R.Top, AIndex); +end; + +class procedure TcxSchedulerPainterHelper.DrawIcon( + ACanvas: TcxCanvas; const R: TRect; AIndex: Integer; + const AViewParams: TcxViewParams; AIsTransparent: Boolean); +begin + if not AIsTransparent then + ACanvas.FillRect(R, AViewParams); + DrawIcon(ACanvas, R, AIndex); +end; + +class procedure TcxSchedulerPainterHelper.DrawShadow( + ACanvas: TcxCanvas; const ARect, AVisibleRect: TRect; ABuffer: TBitmap); +begin + ACanvas.Brush.Color := clBtnShadow; + if (ARect.Bottom - ARect.Top) > cxShadowSize then + DrawShadowLine(ACanvas, ABuffer, ARect.Right, + ARect.Top, ARect.Bottom - ARect.Top + ShadowSize - 1, AVisibleRect, True); + if (ARect.Right - ARect.Left) > cxShadowSize then + DrawShadowLine(ACanvas, ABuffer, ARect.Left, + ARect.Bottom, ARect.Right - ARect.Left + ShadowSize, AVisibleRect, False); +end; + +class procedure TcxSchedulerPainterHelper.DrawState(ACanvas: TcxCanvas; + R: TRect; AState: Integer; ABorders: TcxBorders = []; ABorderColor: TColor = clBlack); +begin + AState := Max(0, Min(AState, High(StateBrushes))); + if R.Top = R.Bottom then + begin + R := ExcludeBorders(R, ABorders); + ACanvas.Pen.Style := psSolid; + ACanvas.Pen.Color := clBlack; + ACanvas.Brush := StateBrushes[AState]; + ACanvas.Polygon([Point(R.Left, R.Top), Point(R.Right, R.Top), + Point(R.Right, R.Top + R.Right - R.Left)]); + end + else + begin + ACanvas.FrameRect(R, ABorderColor, 1, ABorders); + ACanvas.Brush := StateBrushes[AState]; + ACanvas.FillRect(ExcludeBorders(R, ABorders)); + end; +end; + +class function TcxSchedulerPainterHelper.ExcludeBorders(const ARect: TRect; + ABorders: TcxBorders; ABorderSize: Integer = 1): TRect; +begin + Result := ARect; + Inc(Result.Left, ABorderSize * Byte(bLeft in ABorders)); + Inc(Result.Top, ABorderSize * Byte(bTop in ABorders)); + Dec(Result.Right, ABorderSize * Byte(bRight in ABorders)); + Dec(Result.Bottom, ABorderSize * Byte(bBottom in ABorders)); +end; + +class function TcxSchedulerPainterHelper.GetContentColor( + AResourceColor: Integer; AIsWorkTime: Boolean): TColor; +var + AColors: TcxSchedulerResourceColors; +begin + TcxSchedulerPainterHelper.GetResourceColors(AResourceColor, AColors); + if AIsWorkTime then + Result := AColors[srcWorkTime] + else + Result := AColors[srcNonWorkTime]; +end; + +class function TcxSchedulerPainterHelper.GetResourceContentColor( + AResourceIndex: Integer): TColor; +begin + Result := PredefinedResourceColors[AResourceIndex mod + Length(PredefinedResourceColors)][High(TcxSchedulerResourceColors)]; +end; + +class function TcxSchedulerPainterHelper.GetSeparatorColor( + const AResourceColor: Integer; AIsHourSeparator, AIsWorkTime: Boolean): TColor; +var + AColors: TcxSchedulerResourceColors; +begin + TcxSchedulerPainterHelper.GetResourceColors(AResourceColor, AColors); + Result := AColors[TSchedulerResourceColor(Byte(AIsWorkTime) * 2 + Byte(AIsHourSeparator))]; +end; + +class function TcxSchedulerPainterHelper.IconsWidth: Integer; +begin + Result := 17; +end; + +class function TcxSchedulerPainterHelper.IconsHeight: Integer; +begin + Result := 17; +end; + +class function TcxSchedulerPainterHelper.IncludeBorders(const ARect: TRect; + ABorders: TcxBorders; ABorderSize: Integer = 1): TRect; +begin + Result := ARect; + Dec(Result.Left, ABorderSize * Byte(bLeft in ABorders)); + Dec(Result.Top, ABorderSize * Byte(bTop in ABorders)); + Inc(Result.Right, ABorderSize * Byte(bRight in ABorders)); + Inc(Result.Bottom, ABorderSize * Byte(bBottom in ABorders)); +end; + +class procedure TcxSchedulerPainterHelper.InitStyle( + AStyle: TcxStyle; const AResName: string; AGraphicClass: TGraphicClass); +begin + if LoadGraphic(AStyle.Bitmap, AResName, AGraphicClass) then + AStyle.AssignedValues := AStyle.AssignedValues + [svBitmap] + else + begin + AStyle.Bitmap.FreeImage; + AStyle.AssignedValues := AStyle.AssignedValues - [svBitmap]; + end; +end; + +class function TcxSchedulerPainterHelper.LoadGraphic(ABitmap: TBitmap; + const AResName: string; AGraphicClass: TGraphicClass): Boolean; +var + AGraphic: TGraphic; + AStream: TMemoryStream; +begin + AStream := GetResourceStream(AResName); + Result := False; + if AStream <> nil then + try + AGraphic := AGraphicClass.Create; + try + AGraphic.LoadFromStream(AStream); + ABitmap.Width := AGraphic.Width; + ABitmap.Height := AGraphic.Height; + ABitmap.Canvas.Draw(0, 0, AGraphic); + finally + AGraphic.Free; + end; + Result := True; + finally + AStream.Free; + end; +end; + +class function TcxSchedulerPainterHelper.LoadImages(AWidth, AHeight: Integer; + const AResName: string; AHasPalette: Boolean = False; AHasTransparent: Boolean = True): TImageList; +const + Transparents: array[Boolean] of DWORD = (CLR_NONE, CLR_DEFAULT); +begin + Result := TImageList.CreateSize(AWidth, AHeight); + if AHasPalette then + Result.Handle := ImageList_LoadImage(HInstance, PAnsiChar(AResName), AWidth, + 16, Transparents[AHasTransparent], IMAGE_BITMAP, LR_CREATEDIBSECTION) + else + Result.Handle := ImageList_LoadImage(HInstance, PAnsiChar(AResName), AWidth, + 16, CLR_NONE, IMAGE_BITMAP, LR_DEFAULTCOLOR); +end; + +class function TcxSchedulerPainterHelper.MoreButtonHeight: Integer; +begin + Result := 8; +end; + +class function TcxSchedulerPainterHelper.MoreButtonWidth: Integer; +begin + Result := 20; +end; + +class function TcxSchedulerPainterHelper.ShadowSize: Integer; +begin + Result := 5; +end; + +class function TcxSchedulerPainterHelper.TextHeight(AFont: TFont): Integer; +begin + if PrevFontHandle = AFont.Handle then + Result := PrevFontHeight + else + begin + Result := cxTextHeight(AFont); + PrevFontHeight := Result; + PrevFontHandle := AFont.Handle; + end; +end; + +class function TcxSchedulerPainterHelper.TextWidth( + AFont: TFont; const AText: string): Integer; +begin + Result := cxTextWidth(AFont, AText); +end; + +class procedure TcxSchedulerPainterHelper.GetResourceColors( + AColor: TColor; out AResourceColors: TcxSchedulerResourceColors); +var + AIndex: Integer; +begin + if (AColor = clWindow) or (ColorToRgb(AColor) <> PrevResourceColor) then + begin + AIndex := High(PredefinedResourceColors); + if AColor = clWindow then + AIndex := 1 + else + begin + AColor := ColorToRgb(AColor); + while AIndex >= 0 do + begin + if PredefinedResourceColors[AIndex, High(TcxSchedulerResourceColors)] = AColor then + Break + else + Dec(AIndex); + end; + end; + if AIndex >= 0 then + PrevColorData := PredefinedResourceColors[AIndex] + else + InitCachedColors(AColor, PrevColorData); + end; + PrevResourceColor := ColorToRgb(AColor); + AResourceColors := PrevColorData; +end; + +class function TcxSchedulerPainterHelper.GetResourceStream( + const AResName: string): TMemoryStream; +var + ASize: Integer; + AHandle: HGLOBAL; + AResInfo: HRSRC; + AResPtr: Pointer; + AResInstance: Integer; +begin + Result := nil; + AResInstance := FindResourceHInstance(hInstance); + AResInfo := FindResource(AResInstance, PChar(AResName), RT_RCDATA); + ASize := SizeOfResource(AResInstance, AResInfo); + if (AResInfo <> 0) and (ASize <> 0) then + begin + Result := TMemoryStream.Create; + AHandle := LoadResource(AResInstance, AResInfo); + AResPtr := LockResource(AHandle); + Result.WriteBuffer(AResPtr^, ASize); + Result.Position := 0; + end; +end; + +class procedure TcxSchedulerPainterHelper.CreateStateBrushes; +var + I: Integer; +const + AColors: array[0..4] of TColor = + (clWhite, clWhite, clBlue, clPurple, clWhite); + ABrushNames: array[0..7] of string = + ('', 'CXTENTATIVE', '', '', '', 'CXTENTATIVEBW', 'CXBUSYBW', 'CXOUTOFOFFICEBW'); + +begin + for I := 0 to 7 do + begin + StateBrushes[I] := TBrush.Create; + if I in [1, 5..7] then + begin + StateBrushes[I].Bitmap := TBitmap.Create; + StateBrushes[I].Bitmap.Handle := LoadBitmap(hInstance, PChar(ABrushNames[I])); + end + else + StateBrushes[I].Color := AColors[I]; + end; +end; + +class procedure TcxSchedulerPainterHelper.DrawClockLine(ACanvas: TcxCanvas; + const ATime, ATimePerCircle, ARadius, XC, YC: Integer); +var + X, Y: Integer; + A, C, S: Extended; +begin + A := Pi / 2 - (ATime * 2 * Pi) / ATimePerCircle; + SinCos(A, S, C); + X := XC + Trunc(ARadius * C); + Y := YC - Trunc(ARadius * S); + ACanvas.MoveTo(XC, YC); + ACanvas.LineTo(X, Y); +end; + +function cxInRange(Value: Integer; AMin, AMax: Integer): Boolean; +begin + Result := (Value >= AMin) and (Value <= AMax); +end; + +class procedure TcxSchedulerPainterHelper.DrawShadowLine(ACanvas: TcxCanvas; + ABuffer: TBitmap; const ALeft, ATop, ALength: Integer; + AVisibleRect: TRect; AIsRight: Boolean); +type + PRGBArray = ^TRGBArray; + TRGBArray = array[0..0] of TRGBTriple; +var + ASize: TSize; + X, Y: Integer; + APixels: PRGBArray; + AOrg: TPoint; +const + SphericAlpha: array[0..cxShadowSize - 1, 0..cxShadowSize - 1] of Double = + ((0.95, 0.96, 0.98, 0.99, 1.00), + (0.85, 0.89, 0.95, 0.98, 1.00), + (0.71, 0.78, 0.89, 0.96, 0.99), + (0.61, 0.71, 0.85, 0.95, 0.99), + (0.56, 0.67, 0.83, 0.95, 0.99)); + LinearAlpha: array[0..cxShadowSize - 1] of Double = + (0.56, 0.67, 0.83, 0.95, 0.99); +begin + AOrg := cxPointInvert(ACanvas.WindowOrg); + Inc(AOrg.Y, ATop); + Inc(AOrg.X, ALeft); + AVisibleRect := cxRectOffset(AVisibleRect, cxPointInvert(AOrg)); + if AIsRight then + ASize := cxSize(ShadowSize, ALength) + else + ASize := cxSize(ALength, ShadowSize); + for Y := 0 to ASize.Cy - 1 do + begin + if not cxInRange(AOrg.Y + Y, 0, ABuffer.Height - 1) then Continue; + APixels := ABuffer.Scanline[AOrg.Y + Y]; + for X := 0 to ASize.Cx - 1 do + begin + if not cxRectPtIn(AVisibleRect, AVisibleRect.Left, Y) then Continue; + if AIsRight then + begin + if Y < cxShadowSize then + GetShadowValue(APixels^[X + AOrg.X], SphericAlpha[Y, X]) + else + if Y > (ASize.Cy - cxShadowSize) then + GetShadowValue(APixels^[X + AOrg.X], SphericAlpha[ASize.Cy - 1 - Y, X]) + else + GetShadowValue(APixels^[X + AOrg.X], LinearAlpha[X]); + end + else + begin + if X < cxShadowSize then + GetShadowValue(APixels^[X + AOrg.X], SphericAlpha[X, Y]) + else + if X < (ASize.Cx - cxShadowSize) then + GetShadowValue(APixels^[X + AOrg.X], LinearAlpha[Y]); + end; + end; + end; +end; + +class procedure TcxSchedulerPainterHelper.FreeStateBrushes; +var + I: Integer; + ABitmap: TBitmap; +begin + for I := 0 to High(StateBrushes) do + begin + ABitmap := StateBrushes[I].Bitmap; + StateBrushes[I].Bitmap := nil; + FreeAndNil(StateBrushes[I]); + ABitmap.Free; + end; +end; + +class function TcxSchedulerPainterHelper.GetColorValue( + AColor: TColor; ALightValue: Integer): TColor; +begin + Result := Rgb( + MulDiv(GetRValue(AColor), ALightValue, 100), + MulDiv(GetGValue(AColor), ALightValue, 100), + MulDiv(GetBValue(AColor), ALightValue, 100)); +end; + +class procedure TcxSchedulerPainterHelper.GetShadowValue( + var APixel: TRGBTriple; const Alpha: Double); +begin + APixel.rgbtRed := Round(APixel.rgbtRed * Alpha); + APixel.rgbtGreen := Round(APixel.rgbtGreen * Alpha); + APixel.rgbtBlue := Round(APixel.rgbtBlue * Alpha); +end; + +class procedure TcxSchedulerPainterHelper.InitCachedColors( + AColor: TColor; out AColors: TcxSchedulerResourceColors); +var + I: TSchedulerResourceColor; +begin + for I := Low(TSchedulerResourceColor) to High(TSchedulerResourceColor) do + AColors[I] := GetColorValue(AColor, ResourceColorIntensityValues[I]); +end; + +class procedure TcxSchedulerPainterHelper.InitSchedulerGraphics; +begin + CreateStateBrushes; + PrevResourceColor := PredefinedResourceColors[0, srcMajorWorkTimeSeparator]; + PrevColorData := PredefinedResourceColors[0]; + TimeLinePatterns := TcxSchedulerPainterHelper.LoadImages( + 12, 12, 'CXTIMELINEPATTERNS'); + MoreEventButtonGlyphs := TcxSchedulerPainterHelper.LoadImages( + MoreButtonWidth, MoreButtonHeight, 'CXMOREEVENTS'); + MenuImages := TcxSchedulerPainterHelper.LoadImages( + 16, 16, 'CXSCHEDULERMENUIMAGES', True); + EventImages := TcxSchedulerPainterHelper.LoadImages( + 17, 17, 'CXSCHEDULEREVENTICONS', True); +end; + +class procedure TcxSchedulerPainterHelper.FreeSchedulerGraphics; +begin + FreeStateBrushes; + TimeLinePatterns.Free; + EventImages.Free; + MoreEventButtonGlyphs.Free; + MenuImages.Free; +end; + +{ TcxSchedulerHelpersFactory } + +class function TcxSchedulerHelpersFactory.DateTimeHelperClass: TcxSchedulerDateTimeHelperClass; +begin + Result := DateTimeHelper; +end; + +class function TcxSchedulerHelpersFactory.PainterHelperClass: TcxSchedulerPainterHelperClass; +begin + Result := TcxSchedulerPainterHelper; +end; + +class procedure TcxSchedulerHelpersFactory.Done; +begin + PaletteChangedListener.Free; + PainterHelperClass.FreeSchedulerGraphics; + DateTimeHelperClass.DoneSchedulerDateSystem; +end; + +class procedure TcxSchedulerHelpersFactory.Init; +begin + LoadCursors; + PainterHelperClass.InitSchedulerGraphics; + DateTimeHelperClass.InitSchedulerDateTimeSystem; + if PaletteChangedListener = nil then + begin + PaletteChangedListener := TcxPaletteChangedNotifier.Create(True); + PaletteChangedListener.DoChanged; + end; +end; + +class procedure TcxSchedulerHelpersFactory.LoadCursors; +begin + Screen.Cursors[crSchedulerCopyEvent] := LoadCursor(HInstance, 'CXSDCOPYEVENT'); + Screen.Cursors[crSchedulerMoveEvent] := LoadCursor(HInstance, 'CXSDMOVEEVENT'); + Screen.Cursors[crSchedulerHorzSplit] := LoadCursor(HInstance, 'CXSDHORZSPLIT'); + Screen.Cursors[crSchedulerVertSplit] := LoadCursor(HInstance, 'CXSDVERTSPLIT'); + Screen.Cursors[crSchedulerSplitAll] := LoadCursor(HInstance, 'CXSDSPLITALL'); + Screen.Cursors[crSchedulerVertResize] := LoadCursor(HInstance, 'CXSDVERTRESIZE'); + Screen.Cursors[crSchedulerHorzResize] := LoadCursor(HInstance, 'CXSDHORZRESIZE'); + Screen.Cursors[crCalendarMirrorArrow] := LoadCursor(HInstance, 'CXCALENDARMIRRORARROW'); + Screen.Cursors[crTaskLink] := LoadCursor(HInstance, 'CXTASKLINK'); +end; + +{ TcxPaletteChangedNotifier } + +procedure TcxPaletteChangedNotifier.DoChanged; +var + I: TSchedulerResourceColor; +begin + inherited DoChanged; + PrevResourceColor := clNone; + for I := srcMinorNonWorkTimeSeparator to srcMajorWorkTimeSeparator do + PredefinedResourceColors[1, I] := ColorToRgb(clBtnShadow); + PredefinedResourceColors[1, srcWorkTime] := ColorToRgb(clWindow); + PredefinedResourceColors[1, srcNonWorkTime] := ColorToRgb(clBtnFace); +end; + +{ TcxSchedulerObjectList } + +destructor TcxSchedulerObjectList.Destroy; +begin + Clear; + inherited Destroy; +end; + +procedure TcxSchedulerObjectList.Clear; +var + I: Integer; +begin + for I := Count - 1 downto 0 do + Items[I].Free; + inherited Clear; +end; + +function TcxSchedulerObjectList.GetItem(AIndex: Integer): TObject; +begin + Result := List^[AIndex]; +end; + +{ TcxSchedulerDateList } + +{$IFNDEF DELPHI6} +procedure TcxSchedulerDateList.Assign(ASource: TList); +var + I: Integer; +begin + if ASource = nil then Exit; + Clear; + Capacity := ASource.Capacity; + for I := 0 to ASource.Count - 1 do + inherited Add(ASource[I]); +end; +{$ENDIF} + +function TcxSchedulerDateList.Add(ADate: TDateTime): Integer; +begin + //DELPHI8! check Trunc(ADate) + Result := inherited Add(Pointer(Trunc(ADate))); + if Count > 1 then Sort(cxCompareDates); +end; + +function TcxSchedulerDateList.AddEx(ADate: TDateTime): Integer; +begin + Result := inherited Add(Pointer(Trunc(ADate))); +end; + +function TcxSchedulerDateList.ExistDate(ADate: TDateTime): Boolean; +begin + Result := IndexOf(ADate) >= 0; +end; + +function TcxSchedulerDateList.IndexOf(ADate: TDateTime): Integer; +begin + //DELPHI8! check Trunc(ADate) + Result := inherited IndexOf(Pointer(Trunc(ADate))); +end; + +procedure TcxSchedulerDateList.ShiftPeriod(ADelta: TDateTime); +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I] := Max(Min(Items[I] + ADelta, cxMaxDateTime), 0); +end; + +procedure TcxSchedulerDateList.Notify(Ptr: Pointer; Action: TListNotification); +begin + if (Action = lnAdded) or (Action = lnDeleted) then + FChanged := True; +end; + +function TcxSchedulerDateList.GetChanged: Boolean; +begin + Result := FChanged; + FChanged := False; +end; + +function TcxSchedulerDateList.GetItem(AIndex: Integer): TDateTime; +begin + Result := Integer(inherited Items[AIndex]); +end; + +procedure TcxSchedulerDateList.SetItem( + AIndex: Integer; const AValue: TDateTime); +begin + //DELPHI8! check Trunc(AValue) + inherited Items[AIndex] := Pointer(Trunc(AValue)); +end; + +{ TcxSchedulerTimeRange } + +function TcxSchedulerTimeRange.GetDuration: TDateTime; +begin + Result := FFinish - FStart; +end; + +{ TcxSchedulerTimeRanges } + +constructor TcxSchedulerTimeRanges.CreateEx(AOwner: TObject); +begin + inherited Create(TcxSchedulerTimeRange); + FOwner := AOwner; +end; + +function TcxSchedulerTimeRanges.GetItem(AIndex: Integer): TcxSchedulerTimeRange; +begin + Result := TcxSchedulerTimeRange(inherited Items[AIndex]); +end; + +function TcxSchedulerTimeRanges.Add(const AStart, AFinish: TDateTime): TcxSchedulerTimeRange; +begin + Result := TcxSchedulerTimeRange(inherited Add); + Result.FStart := AStart; + Result.FFinish := AFinish; +end; + +{ TcxSchedulerEventLabel } + +constructor TcxSchedulerEventLabel.Create(Collection: TCollection); +begin + inherited Create(Collection); + FOriginalIndex := -1; +end; + +function TcxSchedulerEventLabel.GetCaption: string; +begin + if FOriginalIndex < 0 then + Result := FCaption + else + Result := cxGetResourceString(sEventLabelCaptions[FOriginalIndex]); +end; + +function TcxSchedulerEventLabel.GetColor: TColor; +begin + if FOriginalIndex < 0 then + Result := FColor + else + Result := EventLabelColors[FOriginalIndex]; +end; + +procedure TcxSchedulerEventLabel.SetCaption(const AValue: string); +begin + if FCaption <> AValue then + begin + if FOriginalIndex < 0 then + FCaption := AValue + else + cxSetResourceString(sEventLabelCaptions[FOriginalIndex], AValue); + Changed(False); + end; +end; + +procedure TcxSchedulerEventLabel.SetColor(AValue: TColor); +begin + if FColor <> AValue then + begin + if FOriginalIndex < 0 then + FColor := AValue + else + EventLabelColors[FOriginalIndex] := AValue; + Changed(False); + end; +end; + +{ TcxSchedulerEventLabels } + +constructor TcxSchedulerEventLabels.Create; +begin + inherited Create(TcxSchedulerEventLabel); + FImages := TImageList.Create(nil); + CreateDefaultItems; +end; + +destructor TcxSchedulerEventLabels.Destroy; +begin + FImages.Free; + inherited Destroy; +end; + +function TcxSchedulerEventLabels.Add(AColor: TColor; + const ACaption: string): TcxSchedulerEventLabel; +begin + Result := TcxSchedulerEventLabel(inherited Add); + Result.Caption := ACaption; + Result.Color := AColor; +end; + +function TcxSchedulerEventLabels.IndexOfColor(AColor: TColor): Integer; +var + I: Integer; +begin + Result := -1; + AColor := ColorToRGB(AColor); + for I := 0 to EventLabels.Count - 1 do + if AColor = ColorToRGB(Items[I].Color) then + begin + Result := I; + break; + end; +end; + +procedure TcxSchedulerEventLabels.CreateDefaultItems; +var + I: Integer; +begin + BeginUpdate; + try + for I := 0 to 10 do + TcxSchedulerEventLabel.Create(Self).FOriginalIndex := I; + finally + EndUpdate; + end; +end; + +procedure TcxSchedulerEventLabels.Update(Item: TCollectionItem); +begin + inherited Update(Item); + UpdateImageList; +end; + +procedure TcxSchedulerEventLabels.UpdateImageList; +var + I: Integer; + B: TBitmap; + AColor: TColor; +begin + Images.Clear; + B := TBitmap.Create; + B.Width := 16; + B.Height := 16; + try + for I := 0 to Count - 1 do + begin + B.Canvas.Brush.Color := clOlive; + B.Canvas.FillRect(Rect(0, 0, 16, 16)); + AColor := Items[I].Color; + if (AColor = clDefault) or (AColor = clNone) then AColor := clWindow; + B.Canvas.Brush.Color := AColor; + B.Canvas.Pen.Color := clBlack; + B.Canvas.Rectangle(Rect(1, 1, 16, 16)); + Images.AddMasked(B, clOlive); + end; + finally + B.Free; + end; +end; + +function TcxSchedulerEventLabels.GetItem( + AIndex: Integer): TcxSchedulerEventLabel; +begin + Result := TcxSchedulerEventLabel(inherited Items[AIndex]); +end; + +initialization + SchedulerHelpersFactory := TcxSchedulerHelpersFactory; + SchedulerHelpersFactory.Init; + EventLabels := TcxSchedulerEventLabels.Create; + +finalization + SchedulerHelpersFactory.Done; + EventLabels.Free; + +end. + diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerWeekView.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerWeekView.pas new file mode 100644 index 00000000..84334d9f --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerWeekView.pas @@ -0,0 +1,2355 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerWeekView; + +{$I cxVer.inc} + +interface + +uses + Windows, Forms, Classes, cxClasses, SysUtils, Graphics, cxGraphics, + cxDateUtils, Controls, cxControls, cxSchedulerCustomControls, Math, StdCtrls, + cxLookAndFeelPainters, cxGeometry, cxSchedulerStorage, cxSchedulerUtils, + {$IFDEF DELPHI6} DateUtils, {$ENDIF} cxStyles, cxSchedulerCustomResourceView; + +type + TcxSchedulerCustomWeekView = class; + TcxSchedulerWeekViewViewInfo = class; + TcxSchedulerWeeksViewViewInfo = class; + TcxSchedulerCustomWeekViewNavigation = class; + + { TcxSchedulerCustomWeekViewController } + + TcxSchedulerCustomWeekViewController = class(TcxSchedulerCustomResourceViewController) + private + function GetNavigation: TcxSchedulerCustomWeekViewNavigation; + function GetView: TcxSchedulerCustomWeekView; + protected + function CreateDragEventHelper: TcxDragEventHelper; override; + function CreateNavigation: TcxSchedulerViewNavigation; override; + function CreateResizeEventHelper: TcxEventSizingHelper; override; + function GetDayHeaderDate: TDateTime; override; + function NeedShowDayHeaderHint: Boolean; override; + + property View: TcxSchedulerCustomWeekView read GetView; + public + property Navigation: TcxSchedulerCustomWeekViewNavigation read GetNavigation; + end; + + { TcxCustomWeekViewDragEventHelper } + + TcxCustomWeekViewDragEventHelper = class(TcxDragEventHelper) + protected + procedure UpdateViewClonesTime; override; + end; + + { TcxCustomWeekViewEventSizing } + + TcxCustomWeekViewEventSizing = class(TcxEventSizingHelper) + protected + procedure UpdateEventBounds; override; + end; + + TcxSchedulerWeekViewDaysLayout = (wdlTwoColumns, wdlOneColumn); + + { TcxSchedulerCustomWeekView } + + TcxSchedulerCustomWeekView = class(TcxSchedulerCustomResourceView) + private + FCompressWeekEnd: Boolean; + FDaysLayout: TcxSchedulerWeekViewDaysLayout; + FHideWeekEnd: Boolean; + FForceShowWeekEnd: Boolean; + function GetController: TcxSchedulerCustomWeekViewController; + function GetScrollPos(const ADatePos: TDateTime; ACheckBounds: Boolean = True): Integer; + function GetHideWeekEnd: Boolean; + function GetWeekDayCount: Integer; + procedure SetCompressWeekEnd(const AValue: Boolean); + procedure SetDaysLayout(Value: TcxSchedulerWeekViewDaysLayout); + procedure SetHideWeekEnd(Value: Boolean); + function GetWorkWeekDayCount: Integer; + protected + FWeeks: TcxSchedulerDateList; + function CheckDate(const ADate: TDateTime): Integer; + procedure CheckWorkDays; + function CreateController: TcxSchedulerSubControlController; override; + function CreateNavigation: TcxSchedulerViewNavigation; virtual; + function CreatePainter: TcxSchedulerSubControlPainter; override; + function GetCompressWeekEnd: Boolean; override; + function GetDateScrollBarKind: TScrollBarKind; + function GetFirstVisibleDate: TDateTime; override; + function GetLastVisibleDate: TDateTime; override; + function GetMaxScrollPos: Integer; virtual; + function GetMinScrollPos: Integer; virtual; + function GetWeekCount: Integer; + function GetStartOfWeek: TDay; override; + function GetViewContentRect: TRect; override; + procedure InitEventBySelectedTime(AEvent: TcxSchedulerEvent; + AllDay: Boolean; ARecurrence: Boolean; AInplaceEditing: Boolean); override; + procedure InitScrollBarsParameters; override; + function IsWeekStartOnMonday: Boolean; + function IsWholeWeekShown: Boolean; + procedure Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); override; + + property Controller: TcxSchedulerCustomWeekViewController read GetController; + property CompressWeekEnd: Boolean read FCompressWeekEnd write SetCompressWeekEnd default True; + property DaysLayout: TcxSchedulerWeekViewDaysLayout read FDaysLayout write SetDaysLayout default wdlTwoColumns; + property HideWeekEnd: Boolean read GetHideWeekEnd write SetHideWeekEnd default False; + property WeekCount: Integer read GetWeekCount; + property WeekDayCount: Integer read GetWeekDayCount; + public + constructor Create(AOwner: TcxCustomScheduler); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + property FirstVisibleDate; + property LastVisibleDate; + property StartOfWeek; + end; + + { TcxSchedulerCustomWeekViewNavigation } + + TcxSchedulerCustomWeekViewNavigation = class(TcxSchedulerCustomResourceViewNavigation) + private + function GetCompress: Boolean; + function GetFirstVisibleDate: TDateTime; + function GetLastVisibleDate: TDateTime; + function GetView: TcxSchedulerCustomWeekView; + function GetWeeks: TcxSchedulerDateList; + function IsWholeWeekAnyway: Boolean; + function VisibleDaysRangeFinish: TDateTime; + function VisibleDaysRangeStart: TDateTime; + protected + FYear: Word; + FWeekOfYear: Word; + FWeekIndex: Integer; + FDayOfWeek: Word; + IsFirstWeek, IsLastWeek: Boolean; + function DateScrollBarKind: TScrollBarKind; + function GetWeekFinish(AWeekIndex: Integer): TDateTime; + function GetWeekStart(AWeekIndex: Integer; ConsiderShowWeekEnd: Boolean): TDateTime; + procedure GotoCornerCell(AGotoEnd: Boolean); virtual; + procedure GotoNextCellHorz(AGotoNext: Boolean); virtual; + procedure GotoNextCellVert(AGotoDown: Boolean); virtual; + procedure GotoNextPage(AGotoForward: Boolean); virtual; + function IsResourceNavigation(AGoToDown: Boolean): Boolean; + public + procedure KeyDown(var AKey: Word; AShift: TShiftState); override; + procedure ValidateSelection(var ASelStart, ASelFinish: TDateTime; + var AResource: TcxSchedulerStorageResourceItem); override; + property Compress: Boolean read GetCompress; + property FirstVisibleDate: TDateTime read GetFirstVisibleDate; + property LastVisibleDate: TDateTime read GetLastVisibleDate; + property View: TcxSchedulerCustomWeekView read GetView; + property Weeks: TcxSchedulerDateList read GetWeeks; + end; + + { TcxSchedulerWeekView } + + TcxSchedulerWeekView = class(TcxSchedulerCustomWeekView) + private + function GetViewInfo: TcxSchedulerWeekViewViewInfo; + protected + function CreateNavigation: TcxSchedulerViewNavigation; override; + function CreateViewInfo: TcxSchedulerSubControlViewInfo; override; + function GetCompressWeekEnd: Boolean; override; + property ViewInfo: TcxSchedulerWeekViewViewInfo read GetViewInfo; + public + property SelectedDays; + property WorkDays; + property WorkFinish; + property WorkStart; + published + property CanShow; + property Active; + property CompressWeekEnd; + property DaysLayout; + property GroupingKind; + property HideWeekEnd; + property ShowEndTime; + property ShowTimeAsClock; + end; + + { TcxSchedulerWeekViewNavigation } + + TcxSchedulerWeekViewNavigation = class(TcxSchedulerCustomWeekViewNavigation) + private + function GetViewInfo: TcxSchedulerWeekViewViewInfo; + protected + procedure GotoNextCellHorz(AGotoNext: Boolean); override; + procedure GotoNextCellVert(AGotoDown: Boolean); override; + public + function ScrollResourcesEx(AGoForward: Boolean; var AResource: TcxSchedulerStorageResourceItem): Boolean; override; + property ViewInfo: TcxSchedulerWeekViewViewInfo read GetViewInfo; + end; + + { TcxSchedulerWeeksView } + + TcxSchedulerWeeksView = class(TcxSchedulerCustomWeekView) + private + function GetViewInfo: TcxSchedulerWeeksViewViewInfo; + protected + function CreateNavigation: TcxSchedulerViewNavigation; override; + function CreateViewInfo: TcxSchedulerSubControlViewInfo; override; + function GetMaxScrollPos: Integer; override; + function GetMinScrollPos: Integer; override; + + property ViewInfo: TcxSchedulerWeeksViewViewInfo read GetViewInfo; + public + property SelectedDays; + property WeekCount; + property WorkDays; + property WorkFinish; + property WorkStart; + published + property CanShow; + property Active; + property CompressWeekEnd; + property GroupingKind; + property HideWeekEnd; + property ShowEndTime; + property ShowTimeAsClock; + end; + + { TcxSchedulerWeeksViewNavigation } + + TcxSchedulerWeeksViewNavigation = class(TcxSchedulerCustomWeekViewNavigation) + private + function GetViewInfo: TcxSchedulerWeeksViewViewInfo; + function IsFirstDayOfWeek(ADayIndex: Integer): Boolean; + function IsLastDayOfWeek(ADayIndex: Integer): Boolean; + protected + procedure GotoNextCellHorz(AGotoNext: Boolean); override; + procedure GotoNextCellVert(AGotoDown: Boolean); override; + function IsScrollResource(AGotoNext: Boolean): Boolean; + public + property ViewInfo: TcxSchedulerWeeksViewViewInfo read GetViewInfo; + end; + + { TcxSchedulerWeekViewEventCellViewInfo } + + TcxSchedulerWeekViewEventCellViewInfo = class(TcxSchedulerEventCellViewInfo) + protected + procedure CalculateBorders; override; + procedure CalculateCaptions; override; + procedure CalculateEventTimeVisibility; override; + procedure CalculateItemsLayout; override; + function GetEditingRect: TRect; override; + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + end; + + { TcxSchedulerWeekViewViewInfo } + + TcxSchedulerWeekViewViewInfo = class(TcxSchedulerCustomResourceViewViewInfo) + private + function GetDayCell(ADay: Integer): TcxSchedulerContentCellViewInfo; + function GetDayCellCount: Integer; + function GetRotateCaptions: Boolean; + function GetRowColsOffset: Integer; + function GetStartDate(AWeek: Integer): TDateTime; + function GetView: TcxSchedulerWeekView; + function GetWeeks: TcxSchedulerDateList; + protected + Builder: TcxSchedulerEventLayoutBuilder; + FDayHeaderOffsetTop: Integer; + FHeaderOffsetLeft: Integer; + FPrintedMonth: Word; + FPrintExactlyOneMonth: Boolean; + FResourceHeaderWidth: Integer; + FRowCols: Integer; + FRowColsStart: Integer; + FRowColsStartDateOffset: Integer; + FWeekEndCells: Integer; + function AddContentCell(const ARect: TRect; const AStart, AFinish: TDateTime; + AResourceIndex: Integer): TcxSchedulerContentCellViewInfo; override; + procedure AddDayCellEvent(APlace: TcxSchedulerEventPlace); + function AddDayCellEventPlace(AEvent: TcxSchedulerControlEvent; + var AIndex: Integer; AStartDay: TcxSchedulerContentCellViewInfo): Boolean; + function AddWeekDayHeader(AWeekDay: Integer; ALeft, ARight: Integer): TcxSchedulerWeekDayHeaderCellViewInfo; + procedure CalculateDaysLayout; virtual; + procedure CalculateDaysLayoutForResource(const ABounds: TRect; AResourceIndex: Integer); virtual; + procedure CalculateDaysLayoutForDates(const ABounds: TRect; AResourceIndex: Integer); virtual; + procedure CalculateEventsViewInfo; virtual; + procedure CalculateGroupByDateForResource(const ABounds: TRect; AResourceIndex: Integer); virtual; + procedure CalculateHeaderViewInfo; virtual; + procedure CalculateMetrics; override; + procedure CalculatePrintRowCols; virtual; + procedure CalculateResourceHeadersAutoHeight(AWidth: Integer); override; + procedure CalculateStartFinishCellIndexes; virtual; + procedure CalculateWeekDates; + procedure CalculateWeekDisplayRectsHorz(const AStartDate: TDateTime; AResourceID: Integer; + {const }ABounds: TRect; AIsTopWeek, AIsLastWeek: Boolean); virtual; + procedure CalculateWeekDisplayRectsVert(const AStartDate: TDateTime; AResourceID: Integer; + const ABounds: TRect; AddBorders: TcxBorders = []); virtual; + procedure CalculateWeekDisplayRectsVertEx(const AStartDate: TDateTime; AResourceID: Integer; + const ABounds: TRect; AddBorders: TcxBorders = []); + function CanEventVisible(AEvent: TcxSchedulerControlEvent): Boolean; + function CanVisibleNextLine(ADay: TcxSchedulerContentCellViewInfo; ALine: Integer = -1): Boolean; + procedure CheckHeaderBorders; virtual; + function ContentCellClass: TcxSchedulerContentCellViewInfoClass; override; + procedure CorrectWeekDay(var AWeekDay: Integer); + function CreateEventCellViewInfo(AViewData: TcxSchedulerEventViewData): TcxSchedulerEventCellViewInfo; override; + procedure DoCalculate; override; + procedure DoContentNavigationButtonClick(Sender: TcxSchedulerContentNavigationButtonViewInfo); override; + procedure DoMoreEventsButtonClick(Sender: TcxSchedulerMoreEventsButtonViewInfo); override; + function GetCompressWeekEnd: Boolean; virtual; + procedure GetEventInfo(AColStart, AColFinish: Integer; var ALeft, ARight: Integer; var AStart, AFinish: TDateTime; + var AVisibleRect: TRect; var AResource: TcxSchedulerResourceViewInfo); + function GetResourcesContentWidth: Integer; override; + function GetResourceImagesSize: TSize; override; + function GetResourceScrollBarKind: TScrollBarKind; override; + function GetContentParams(const ATime: TDateTime; AResource: TcxSchedulerResourceViewInfo): TcxViewParams; override; + function GetDayCellContentHeight(ADay: TcxSchedulerContentCellViewInfo): Integer; virtual; + function GetDayCellHeaderHeight: Integer; virtual; + function GetHideWeekEnd: Boolean; virtual; + function IsCalculateHeaderFirst: Boolean; virtual; + function IsCellEvent(AEvent: TcxSchedulerControlEvent; + ACell: TcxSchedulerContentCellViewInfo): Boolean; + function IsSingleLine(ADay1, ADay2: TcxSchedulerContentCellViewInfo): Boolean; + function IsTimeSelected(ATime: TDateTime; AResource: TObject): Boolean; override; + function IsWeekStartOnMonday: Boolean; virtual; + procedure ProcessGroupByDate; virtual; + procedure ProcessGroupByNone; virtual; + procedure ProcessGroupByResource; virtual; + + property CompressWeekEnd: Boolean read GetCompressWeekEnd; + property DayCellCount: Integer read GetDayCellCount; + property DayCells[ADay: Integer]: TcxSchedulerContentCellViewInfo read GetDayCell; + property HideWeekEnd: Boolean read GetHideWeekEnd; + property RowColsStart: Integer read FRowColsStart; + property Weeks: TcxSchedulerDateList read GetWeeks; + property WeekEndCells: Integer read FWeekEndCells; + public + constructor Create(AOwner: TcxSchedulerSubControl); override; + destructor Destroy; override; + procedure ScrollVertical(AScrollCode: TScrollCode; var AScrollPos: Integer); override; + property PrintExactlyOneMonth: Boolean read FPrintExactlyOneMonth; + property PrintedMonth: Word read FPrintedMonth; + property StartDates[AWeek: Integer]: TDateTime read GetStartDate; + property ResourceHeaderWidth: Integer read FResourceHeaderWidth; + property RotateCaptions: Boolean read GetRotateCaptions; + property View: TcxSchedulerWeekView read GetView; + end; + + { TcxSchedulerWeeksViewEventCellViewInfo } + + TcxSchedulerWeeksViewEventCellViewInfo = class(TcxSchedulerWeekViewEventCellViewInfo) + protected + function CanAutoHideStandardImages: Boolean; override; + end; + + { TcxSchedulerWeeksViewViewInfo } + + TcxSchedulerWeeksViewViewInfo = class(TcxSchedulerWeekViewViewInfo) + private + function GetHeaderDayCount: Integer; + function GetView: TcxSchedulerWeeksView; + protected + FContentOffset: Integer; + procedure CalculateDaysLayoutForResource(const ABounds: TRect; AResourceIndex: Integer); override; + procedure CalculateGroupByDateForResource(const ABounds: TRect; AResourceIndex: Integer); override; + procedure CalculateHeaderViewInfo; override; + procedure CalculateMetrics; override; + procedure CheckHeaderBorders; override; + function ContentCellClass: TcxSchedulerContentCellViewInfoClass; override; + function CreateEventCellViewInfo(AViewData: TcxSchedulerEventViewData): TcxSchedulerEventCellViewInfo; override; + function GetCompressWeekEnd: Boolean; override; + function GetContentParams(const ATime: TDateTime; AResource: TcxSchedulerResourceViewInfo): TcxViewParams; override; + function GetDayCellHeaderHeight: Integer; override; + function IsCalculateHeaderFirst: Boolean; override; + function IsWeekStartOnMonday: Boolean; override; + procedure ProcessGroupByNone; override; + procedure ProcessGroupByResource; override; + public + property View: TcxSchedulerWeeksView read GetView; + end; + + { TcxSchedulerWeekViewPainter } + + TcxSchedulerWeekViewPainter = class(TcxSchedulerCustomViewPainter) + private + function GetViewInfo: TcxSchedulerWeekViewViewInfo; + public + procedure Paint; override; + + property ViewInfo: TcxSchedulerWeekViewViewInfo read GetViewInfo; + end; + +implementation + +uses + cxSchedulerDateNavigator; + +type + TcxSchedulerDaysRect = array[0..6] of TRect; + TcxSchedulerDaysBorders = array[0..6] of TcxBorders; + + TcxSchedulerContentCellViewInfoAccess = class(TcxSchedulerContentCellViewInfo); +const + WeekViewDayBorders: TcxSchedulerDaysBorders =( + [bTop, bRight], [bTop, bRight], [bTop, bRight], + [bTop], [bTop], [bTop], [bTop]); + DayInc: array[Boolean] of Integer = (-1, 1); + WholeWeekDayCount = 7; + +function IsWorkDay(AWeekDay: Integer; AScheduler: TcxCustomScheduler): Boolean; +begin + Result := (TDay(AWeekDay) in AScheduler.OptionsView.WorkDays); +end; + +{ TcxSchedulerCustomWeekViewController } + +function TcxSchedulerCustomWeekViewController.CreateDragEventHelper: TcxDragEventHelper; +begin + Result := TcxCustomWeekViewDragEventHelper.Create(Scheduler); +end; + +function TcxSchedulerCustomWeekViewController.CreateNavigation: TcxSchedulerViewNavigation; +begin + Result := TcxSchedulerCustomWeekView(View).CreateNavigation; +end; + +function TcxSchedulerCustomWeekViewController.CreateResizeEventHelper: TcxEventSizingHelper; +begin + Result := TcxCustomWeekViewEventSizing.Create(Scheduler); +end; + +function TcxSchedulerCustomWeekViewController.GetDayHeaderDate: TDateTime; +begin + Result := inherited GetDayHeaderDate; +end; + +function TcxSchedulerCustomWeekViewController.NeedShowDayHeaderHint: Boolean; +var + R: TRect; + P: TPoint; +begin + R := cxNullRect; + if (HitTest.ContentCell <> nil) then + with HitTest.ContentCell.Bounds do + R := Rect(Left, Top, Right, Top + View.ViewInfo.DayHeaderHeight); + P := Point(HitTest.HitX, HitTest.HitY); + Result := Scheduler.OptionsView.ShowHints and(((HitTest.ContentCell <> nil) and + (TcxSchedulerContentCellViewInfoAccess(HitTest.ContentCell).FDisplayText <> '') and + (HitTest.HitAtTime) and (PtInRect(R, P))) or + (HitTest.HitAtDayHeader and HitTest.HitAtTime)); +end; + +function TcxSchedulerCustomWeekViewController.GetNavigation: TcxSchedulerCustomWeekViewNavigation; +begin + Result := TcxSchedulerCustomWeekViewNavigation(inherited Navigation); +end; + +function TcxSchedulerCustomWeekViewController.GetView: TcxSchedulerCustomWeekView; +begin + Result := TcxSchedulerCustomWeekView(inherited View); +end; + +{cxCustomWeekViewDragEventHelper } + +procedure TcxCustomWeekViewDragEventHelper.UpdateViewClonesTime; +var + I: Integer; + ADelta: TDateTime; +begin + ADelta := Controller.StartDragHitTime - HitTest.Time; + for I := 0 to Clones.Count - 1 do + with Clones[I] do + MoveTo(Source.Start - ADelta); +end; + +{ TcxCustomWeekViewEventSizing } + +procedure TcxCustomWeekViewEventSizing.UpdateEventBounds; +begin + if Event.AllDayEvent then + inherited UpdateEventBounds + else + begin + if Controller.DragKind = edkResizeStart then + begin + Event.AllDayEvent := TimeOf(Event.Finish) = 0; + Event.Start := HitTest.Time; + end + else + begin + Event.AllDayEvent := TimeOf(Event.Start) = 0; + if Event.AllDayEvent then + Event.Finish := HitTest.Time + else + Event.Finish := HitTest.Time + 1; + end; + CheckEventState(Event); + RefreshCurrentView; + end; +end; + +{ TcxSchedulerCustomWeekView } + +constructor TcxSchedulerCustomWeekView.Create(AOwner: TcxCustomScheduler); +begin + inherited Create(AOwner); + FCompressWeekEnd := True; + EventImagesLayout := eilHorizontal; + FWeeks := TcxSchedulerDateList.Create; +end; + +destructor TcxSchedulerCustomWeekView.Destroy; +begin + FWeeks.Free; + inherited Destroy; +end; + +procedure TcxSchedulerCustomWeekView.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerCustomWeekView then + begin + CompressWeekEnd := TcxSchedulerCustomWeekView(Source).FCompressWeekEnd; + HideWeekEnd := TcxSchedulerCustomWeekView(Source).FHideWeekEnd; + FDaysLayout := TcxSchedulerCustomWeekView(Source).DaysLayout; + end; + inherited Assign(Source); +end; + +function TcxSchedulerCustomWeekView.CheckDate( + const ADate: TDateTime): Integer; +begin + //DELPHI8! check Trunc(ADate) + Result := Trunc(ADate); + if DayOfWeek(ADate) <> (1 + Byte(CompressWeekEnd)) then + Result := Result - DayOfWeek(ADate) + 1 + Byte(CompressWeekEnd); +end; + +procedure TcxSchedulerCustomWeekView.CheckWorkDays; +var + I: Integer; +begin + FForceShowWeekEnd := True; + I := 0; + while (I < 7) and FForceShowWeekEnd do + begin + FForceShowWeekEnd := not IsWorkDay(I, Scheduler); + Inc(I); + end; +end; + +function TcxSchedulerCustomWeekView.CreateController: TcxSchedulerSubControlController; +begin + Result := TcxSchedulerCustomWeekViewController.Create(Self); +end; + +function TcxSchedulerCustomWeekView.CreateNavigation: TcxSchedulerViewNavigation; +begin + Result := TcxSchedulerCustomWeekViewNavigation.Create(Self); +end; + +function TcxSchedulerCustomWeekView.CreatePainter: TcxSchedulerSubControlPainter; +begin + Result := TcxSchedulerWeekViewPainter.Create(Self); +end; + +function TcxSchedulerCustomWeekView.GetCompressWeekEnd: Boolean; +begin + Result := CompressWeekEnd; +end; + +function TcxSchedulerCustomWeekView.GetDateScrollBarKind: TScrollBarKind; +const + ScrollKind: array[TScrollBarKind] of TScrollBarKind = + (sbVertical, sbHorizontal); +begin + Result := ScrollKind[TcxSchedulerWeekViewViewInfo(ViewInfo).GetResourceScrollBarKind]; +end; + +function TcxSchedulerCustomWeekView.GetFirstVisibleDate: TDateTime; +begin + Result := inherited GetFirstVisibleDate; + if IsWeekStartOnMonday then + Result := Result + GetDateOffset; +end; + +function TcxSchedulerCustomWeekView.GetLastVisibleDate: TDateTime; +begin + Result := inherited GetLastVisibleDate; + if IsWeekStartOnMonday then + Result := Result + GetDateOffset; +end; + +function TcxSchedulerCustomWeekView.GetMaxScrollPos: Integer; +begin + Result := 25; +end; + +function TcxSchedulerCustomWeekView.GetMinScrollPos: Integer; +begin + Result := -25; +end; + +function TcxSchedulerCustomWeekView.GetWeekCount: Integer; +begin + Result := Max(1, SelectedDays.Count div 7); +end; + +function TcxSchedulerCustomWeekView.GetStartOfWeek: TDay; +begin + if IsWeekStartOnMonday then + Result := dMonday + else + Result := inherited GetStartOfWeek; +end; + +function TcxSchedulerCustomWeekView.GetViewContentRect: TRect; +begin + Result := inherited GetViewContentRect; + if ViewInfo.GroupingKind = gkByDate then + with TcxSchedulerWeekViewViewInfo(ViewInfo) do + Result.TopLeft := Point(FResourceHeaderHeight, FDayHeaderHeight); +end; + +procedure TcxSchedulerCustomWeekView.InitEventBySelectedTime( + AEvent: TcxSchedulerEvent; AllDay: Boolean; ARecurrence: Boolean; + AInplaceEditing: Boolean); +var + AStart, AFinish: TDateTime; +begin + AStart := Scheduler.SelStart; + AFinish := Scheduler.SelFinish; + AEvent.AllDayEvent := AllDay or (AFinish - AStart > 1) or (AInplaceEditing and not ARecurrence); + if not AEvent.AllDayEvent then + begin + AStart := AStart + cxTime8AM; + AFinish := (AFinish - 1) + cxTime8AM + cxHalfHour; + end; + AEvent.Start := AStart; + AEvent.Finish := AFinish; +end; + +procedure TcxSchedulerCustomWeekView.InitScrollBarsParameters; +begin + SetScrollBarInfo(GetDateScrollBarKind, GetMinScrollPos, GetMaxScrollPos, 1, + WeekCount, GetScrollPos(FirstVisibleDate), True, True); + inherited InitScrollBarsParameters; +end; + +function TcxSchedulerCustomWeekView.IsWeekStartOnMonday: Boolean; +begin + Result := TcxSchedulerWeekViewViewInfo(ViewInfo).IsWeekStartOnMonday; +end; + +function TcxSchedulerCustomWeekView.IsWholeWeekShown: Boolean; +begin + Result := not HideWeekEnd or (ClassType = TcxSchedulerWeekView) and + not ViewInfo.GroupByDate and (DaysLayout = wdlTwoColumns); +end; + +procedure TcxSchedulerCustomWeekView.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +var + ANewSelDate: TDateTime; + ADelta: Integer; +begin + HideHintOnScroll(AScrollCode); + if (AScrollBarKind <> GetDateScrollBarKind) or (AScrollCode = scEndScroll) then Exit; + ADelta := GetScrollPos(FirstVisibleDate, False); + if not (AScrollCode in [scPosition, scTrack]) then + AScrollPos := ADelta; + ANewSelDate := Controller.Navigation.SelStart; + case AScrollCode of + scLineUp, scLineDown: + begin + Inc(AScrollPos, DayInc[AScrollCode <> scLineUp]); + ANewSelDate := ANewSelDate + DayInc[AScrollCode <> scLineUp] * 7; + end; + scPageUp, scPageDown: + begin + Inc(AScrollPos, DayInc[AScrollCode <> scPageUp] * WeekCount); + with Controller.Navigation do + ANewSelDate := ANewSelDate + DayInc[AScrollCode <> scPageUp] * Weeks.Count * 7; + end; + scTop: + AScrollPos := -GetMinScrollPos; + scBottom: + AScrollPos := GetMaxScrollPos; + end; + ADelta := ADelta - AScrollPos; + if ADelta <> 0 then + begin + ScrollSelectedDays(ADelta); + AScrollPos := GetScrollPos(FirstVisibleDate); + end; + if AScrollCode = scTrack then + ShowHintOnScroll(FirstVisibleDate); + with Scheduler do + SelectTime(ANewSelDate, ANewSelDate, SelResource); +end; + +function TcxSchedulerCustomWeekView.GetController: TcxSchedulerCustomWeekViewController; +begin + Result := TcxSchedulerCustomWeekViewController(inherited Controller); +end; + +function TcxSchedulerCustomWeekView.GetHideWeekEnd: Boolean; +begin + Result := FHideWeekEnd and not FForceShowWeekEnd; +end; + +function TcxSchedulerCustomWeekView.GetScrollPos( + const ADatePos: TDateTime; ACheckBounds: Boolean = True): Integer; +begin + Result := Round(ADatePos - CheckDate(Date)) div 7; + if ACheckBounds then + begin + if Result < GetMinScrollPos then + Result := GetMinScrollPos; + if Result > GetMaxScrollPos then + Result := GetMaxScrollPos; + end; +end; + +function TcxSchedulerCustomWeekView.GetWeekDayCount: Integer; +begin + if IsWholeWeekShown then + Result := WholeWeekDayCount + else + Result := GetWorkWeekDayCount; +end; + +procedure TcxSchedulerCustomWeekView.SetCompressWeekEnd( + const AValue: Boolean); +begin + if FCompressWeekEnd <> AValue then + begin + FCompressWeekEnd := AValue; + LayoutChanged; + end; +end; + +procedure TcxSchedulerCustomWeekView.SetDaysLayout( + Value: TcxSchedulerWeekViewDaysLayout); +begin + if Value <> FDaysLayout then + begin + FDaysLayout := Value; + LayoutChanged; + end; +end; + +procedure TcxSchedulerCustomWeekView.SetHideWeekEnd(Value: Boolean); +begin + if FHideWeekEnd <> Value then + begin + FHideWeekEnd := Value; + LayoutChanged; + end; +end; + +function TcxSchedulerCustomWeekView.GetWorkWeekDayCount: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to 6 do + if IsWorkDay(I, Scheduler) then + Inc(Result); +end; + +{ TcxSchedulerCustomWeekViewNavigation } + +procedure TcxSchedulerCustomWeekViewNavigation.KeyDown( + var AKey: Word; AShift: TShiftState); +var + APos: Integer; +begin + DecodeDateWeek(FCurrentAnchor + 1 - Byte(View.StartOfWeek), + FYear, FWeekOfYear, FDayOfWeek); + Dec(FDayOfWeek); + FWeekIndex := Max(0, Weeks.IndexOf(Trunc(EncodeDateWeek(FYear, FWeekOfYear, 1)))); + IsFirstWeek := (FWeekIndex = 0) and IsFirstResource; + IsLastWeek := (FWeekIndex = Weeks.Count - 1) and IsLastResource; + case AKey of + VK_Left, VK_Right: + GotoNextCellHorz(AKey = VK_RIGHT); + VK_UP, VK_DOWN: + GotoNextCellVert(AKey = VK_DOWN); + VK_HOME, VK_END: + GotoCornerCell(AKey = VK_END); + VK_NEXT, VK_PRIOR: + GotoNextPage(AKey = VK_NEXT); + end; + APos := View.GetScrollPos(View.FirstVisibleDate, False); + if (ssShift in FShift) and ((FCurrentResource <> SelResource) or + (DateOf(FCurrentAnchor) < FirstVisibleDate) or (DateOf(FCurrentAnchor) > LastVisibleDate)) then + Exit + else + if DateOf(FCurrentAnchor) < FirstVisibleDate then + begin + View.Scroll(DateScrollBarKind, scLineUp, APos); + SetSelAnchor(FCurrentAnchor, [], FCurrentResource); + end + else + if DateOf(FCurrentAnchor) > LastVisibleDate then + begin + View.Scroll(DateScrollBarKind, scLineDown, APos); + SetSelAnchor(FCurrentAnchor, [], FCurrentResource); + end + else + SetSelAnchor(FCurrentAnchor, FShift, FCurrentResource); +end; + +procedure TcxSchedulerCustomWeekViewNavigation.ValidateSelection( + var ASelStart, ASelFinish: TDateTime; + var AResource: TcxSchedulerStorageResourceItem); +begin + inherited ValidateSelection(ASelStart, ASelFinish, AResource); + if (DateOf(ASelFinish) < FirstVisibleDate) or (DateOf(ASelFinish) > LastVisibleDate) then + begin + ASelFinish := FirstVisibleDate; + ASelStart := ASelFinish; + end +end; + +function TcxSchedulerCustomWeekViewNavigation.DateScrollBarKind: TScrollBarKind; +begin + Result := View.GetDateScrollBarKind; +end; + +function TcxSchedulerCustomWeekViewNavigation.GetWeekFinish(AWeekIndex: Integer): TDateTime; +var + I, K: Integer; +begin + Result := 0; + if (AWeekIndex < 0) or (AWeekIndex >= Weeks.Count) then Exit; + Result := Weeks[AWeekIndex]; + if View.HideWeekEnd and not IsWholeWeekAnyway then + begin + I := Integer(View.StartOfWeek) + WholeWeekDayCount - 1; + TcxSchedulerWeekViewViewInfo(ViewInfo).CorrectWeekDay(I); + K := 0; + while (K < WholeWeekDayCount) and not IsWorkDay(I, Scheduler) do + begin + Dec(I); + TcxSchedulerWeekViewViewInfo(ViewInfo).CorrectWeekDay(I); + Inc(K); + end; + if K < WholeWeekDayCount then + Result := Result + WholeWeekDayCount - 1 - K; + end + else + Result := Result + WholeWeekDayCount - 1; + if not View.IsWeekStartOnMonday then + Result := Result - View.GetDateOffset; +end; + +function TcxSchedulerCustomWeekViewNavigation.GetWeekStart(AWeekIndex: Integer; + ConsiderShowWeekEnd: Boolean): TDateTime; +var + I, K: Integer; +begin + Result := 0; + if (AWeekIndex < 0) or (AWeekIndex >= Weeks.Count) then Exit; + Result := Weeks[AWeekIndex]; + if ConsiderShowWeekEnd and View.HideWeekEnd and not IsWholeWeekAnyway then + begin + I := Integer(View.StartOfWeek); + K := 0; + while (K < WholeWeekDayCount) and not IsWorkDay(I, Scheduler) do + begin + Inc(I); + TcxSchedulerWeekViewViewInfo(ViewInfo).CorrectWeekDay(I); + Inc(K); + end; + if K < WholeWeekDayCount then + Result := Result + K; + end; + if not View.IsWeekStartOnMonday then + Result := Result - View.GetDateOffset; +end; + +procedure TcxSchedulerCustomWeekViewNavigation.GotoCornerCell( + AGotoEnd: Boolean); +begin + if ssCtrl in FShift then + begin + if AGotoEnd then + FCurrentAnchor := VisibleDaysRangeFinish + else + FCurrentAnchor := VisibleDaysRangeStart; + end + else + begin + if AGotoEnd then + FCurrentAnchor := GetWeekFinish(FWeekIndex) + else + FCurrentAnchor := GetWeekStart(FWeekIndex, True); + end; +end; + +procedure TcxSchedulerCustomWeekViewNavigation.GotoNextCellHorz( + AGotoNext: Boolean); + + function GetStep(AGotoNext: Boolean): Integer; + var + ADelta, ADay: Integer; + begin + ADelta := DayInc[AGoToNext]; + Result := 0; + repeat + Inc(Result, ADelta); + ADay := DayOfWeek(FCurrentAnchor + Result) - 1; + until IsWorkDay(ADay, Scheduler); + end; + +begin + if View.HideWeekEnd and + (ViewInfo.GroupByDate or (View.DaysLayout <> wdlTwoColumns) or + (ViewInfo.ClassType = TcxSchedulerWeeksViewViewInfo)) then + FCurrentAnchor := FCurrentAnchor + GetStep(AGotoNext) + else + FCurrentAnchor := FCurrentAnchor + DayInc[AGoToNext]; +end; + +procedure TcxSchedulerCustomWeekViewNavigation.GotoNextCellVert( + AGotoDown: Boolean); +begin + Inc(FWeekIndex, DayInc[AGotoDown]); + if (FWeekIndex >= 0) and (FWeekIndex < Weeks.Count) then + FCurrentAnchor := GetWeekStart(FWeekIndex, False) + else + if AGotoDown then + begin + if IsLastWeek then + begin + if not IsResourceNavigation(AGoToDown) then + FCurrentAnchor := LastVisibleDate + 1 + else + Exit; + end + else + if FWeekIndex = Weeks.Count then + begin + FCurrentAnchor := FirstVisibleDate; + FCurrentResource := GetNextResource(True) + end + end + else + begin + if IsFirstWeek then + begin + if not IsResourceNavigation(AGoToDown) then + FCurrentAnchor := FirstVisibleDate - 7 + else + Exit; + end + else + if FWeekIndex <= 0 then + begin + FCurrentAnchor := LastVisibleDate - 7 + 1; + FCurrentResource := GetNextResource(False); + end + end; + FCurrentAnchor := FCurrentAnchor + FDayOfWeek; +end; + +procedure TcxSchedulerCustomWeekViewNavigation.GotoNextPage( + AGotoForward: Boolean); +begin + if not (ssShift in FShift) then + begin + FCurrentAnchor := FCurrentAnchor + DayInc[AGotoForward] * Weeks.Count * 7; + View.ScrollSelectedDays(DayInc[not AGotoForward] * Weeks.Count); + end + else + begin + if AGotoForward then + FCurrentAnchor := VisibleDaysRangeFinish + else + FCurrentAnchor := VisibleDaysRangeStart; + end; +end; + +function TcxSchedulerCustomWeekViewNavigation.IsResourceNavigation(AGoToDown: Boolean): Boolean; +begin + Result := (ViewInfo.GroupingKind <> gkNone); + if Result then + Result := ScrollResourcesEx(AGoToDown, FCurrentResource); + if Result then + FCurrentAnchor := FCurrentAnchor - DayInc[AGoToDown] * (View.WeekCount - 1) * 7; +end; + +function TcxSchedulerCustomWeekViewNavigation.GetCompress: Boolean; +begin + Result := View.GetCompressWeekEnd; +end; + +function TcxSchedulerCustomWeekViewNavigation.GetFirstVisibleDate: TDateTime; +begin + Result := View.FirstVisibleDate; +end; + +function TcxSchedulerCustomWeekViewNavigation.GetLastVisibleDate: TDateTime; +begin + Result := View.LastVisibleDate; +end; + +function TcxSchedulerCustomWeekViewNavigation.GetView: TcxSchedulerCustomWeekView; +begin + Result := TcxSchedulerCustomWeekView(inherited View); +end; + +function TcxSchedulerCustomWeekViewNavigation.GetWeeks: TcxSchedulerDateList; +begin + Result := View.FWeeks; +end; + +function TcxSchedulerCustomWeekViewNavigation.IsWholeWeekAnyway: Boolean; +begin + Result := (View.ClassType = TcxSchedulerWeekView) and + not ViewInfo.GroupByDate and (View.DaysLayout = wdlTwoColumns); +end; + +function TcxSchedulerCustomWeekViewNavigation.VisibleDaysRangeFinish: TDateTime; +begin + if not View.HideWeekEnd then + Result := LastVisibleDate + else + Result := GetWeekFinish(Weeks.Count - 1); +end; + +function TcxSchedulerCustomWeekViewNavigation.VisibleDaysRangeStart: TDateTime; +begin + if not View.HideWeekEnd then + Result := FirstVisibleDate + else + Result := GetWeekStart(0, True); +end; + +{ TcxSchedulerWeekView } + +function TcxSchedulerWeekView.CreateNavigation: TcxSchedulerViewNavigation; +begin + Result := TcxSchedulerWeekViewNavigation.Create(Self); +end; + +function TcxSchedulerWeekView.CreateViewInfo: TcxSchedulerSubControlViewInfo; +begin + Result := TcxSchedulerWeekViewViewInfo.Create(Self); +end; + +function TcxSchedulerWeekView.GetCompressWeekEnd: Boolean; +begin + Result := ViewInfo.CompressWeekEnd; +end; + +function TcxSchedulerWeekView.GetViewInfo: TcxSchedulerWeekViewViewInfo; +begin + Result := TcxSchedulerWeekViewViewInfo(inherited ViewInfo); +end; + +{ TcxSchedulerWeekViewNavigation } + +function TcxSchedulerWeekViewNavigation.ScrollResourcesEx(AGoForward: Boolean; + var AResource: TcxSchedulerStorageResourceItem): Boolean; +begin + if not (ViewInfo.GroupByDate or ViewInfo.GroupByResource) then + Result := False + else + Result := inherited ScrollResourcesEx(AGoForward, AResource); +end; + +procedure TcxSchedulerWeekViewNavigation.GotoNextCellHorz(AGotoNext: Boolean); +const + DateInc: array[Boolean, 0..6] of Integer = + ((-4, -4, -4, -3, -3, -3, -4), (3, 3, 3, 4, 4, 4, 3)); +begin + if (View.DaysLayout = wdlOneColumn) and (GroupingKind <> gkByDate) then + begin + if IsFirstWeek and not AGotoNext then + begin + if not ScrollResourcesEx(AGotoNext, FCurrentResource) then + FCurrentAnchor := FCurrentAnchor - 7 + end + else + if IsLastWeek and AGotoNext then + begin + if not ScrollResourcesEx(AGotoNext, FCurrentResource) then + FCurrentAnchor := FCurrentAnchor + 7; + end + else + FCurrentResource := GetNextResource(AGotoNext); + end + else + if GroupingKind <> gkByDate then + begin + FCurrentAnchor := FCurrentAnchor + DateInc[AGotoNext, FDayOfWeek]; + if (AGotoNext and not IsLastWeek and (FDayOfWeek in [3..6])) or + (not AGotoNext and not IsFirstWeek and (FDayOfWeek in [0..2])) then + begin + FCurrentAnchor := FCurrentAnchor - DayInc[AGotoNext] * 7; + FCurrentResource := GetNextResource(AGotoNext); + end + else + begin + if (IsLastWeek and AGotoNext and (FDayOfWeek in [3..6])) + or (IsFirstWeek and not AGotoNext and (FDayOfWeek in [0..2])) then + begin + if IsResourceNavigation(AGotoNext) then + FCurrentAnchor := FCurrentAnchor - DayInc[AGoToNext] * 7; + end; + end; + end + else + inherited GoToNextCellHorz(AGotoNext); +end; + +procedure TcxSchedulerWeekViewNavigation.GotoNextCellVert(AGotoDown: Boolean); +begin + if GroupingKind <> gkByDate then + inherited GotoNextCellHorz(AGotoDown) + else + inherited GotoNextCellVert(AGotoDown) +end; + +function TcxSchedulerWeekViewNavigation.GetViewInfo: TcxSchedulerWeekViewViewInfo; +begin + Result := TcxSchedulerWeekViewViewInfo(inherited ViewInfo); +end; + +{ TcxSchedulerWeeksView } + +function TcxSchedulerWeeksView.CreateNavigation: TcxSchedulerViewNavigation; +begin + Result := TcxSchedulerWeeksViewNavigation.Create(Self); +end; + +function TcxSchedulerWeeksView.CreateViewInfo: TcxSchedulerSubControlViewInfo; +begin + Result := TcxSchedulerWeeksViewViewInfo.Create(Self); +end; + +function TcxSchedulerWeeksView.GetMaxScrollPos: Integer; +begin + Result := 51; +end; + +function TcxSchedulerWeeksView.GetMinScrollPos: Integer; +begin + Result := -51; +end; + +function TcxSchedulerWeeksView.GetViewInfo: TcxSchedulerWeeksViewViewInfo; +begin + Result := TcxSchedulerWeeksViewViewInfo(inherited ViewInfo); +end; + +{ TcxSchedulerWeeksViewNavigation } + +procedure TcxSchedulerWeeksViewNavigation.GotoNextCellHorz(AGotoNext: Boolean); +begin + if ViewInfo.GroupByResource then + begin + if IsScrollResource(AGoToNext) then Exit; + if (AGoToNext and IsLastDayOfWeek(FDayOfWeek) and not IsLastResource) or + (not AGoToNext and IsFirstDayOfWeek(FDayOfWeek) and not IsFirstResource) then + begin + if not AGoToNext then + FCurrentAnchor := GetWeekFinish(FWeekIndex) + else + FCurrentAnchor := GetWeekStart(FWeekIndex, True); + FCurrentResource := GetNextResource(AGoToNext); + end + else + inherited GotoNextCellHorz(AGotoNext); + end + else + inherited GotoNextCellHorz(AGotoNext); +end; + +procedure TcxSchedulerWeeksViewNavigation.GotoNextCellVert(AGotoDown: Boolean); +begin + if ViewInfo.GroupByResource then + begin + if not AGotoDown and (FWeekIndex <= 0) then + FCurrentAnchor := FCurrentAnchor - 7 + else + if AGotoDown and (FWeekIndex >= Weeks.Count - 1) then + FCurrentAnchor := FCurrentAnchor + 7 + else + inherited GotoNextCellVert(AGoToDown); + end + else + inherited GotoNextCellVert(AGoToDown); +end; + +function TcxSchedulerWeeksViewNavigation.IsScrollResource(AGotoNext: Boolean): Boolean; +begin + Result := (AGoToNext and IsLastDayOfWeek(FDayOfWeek) and IsLastResource) or + (not AGoToNext and IsFirstDayOfWeek(FDayOfWeek) and IsFirstResource); + if Result then + Result := ScrollResourcesEx(AGotoNext, FCurrentResource); + if Result then + begin + if not AGoToNext then + FCurrentAnchor := GetWeekFinish(FWeekIndex) + else + FCurrentAnchor := GetWeekStart(FWeekIndex, True); + end; +end; + +function TcxSchedulerWeeksViewNavigation.GetViewInfo: TcxSchedulerWeeksViewViewInfo; +begin + Result := TcxSchedulerWeeksViewViewInfo(inherited ViewInfo); +end; + +function TcxSchedulerWeeksViewNavigation.IsFirstDayOfWeek(ADayIndex: Integer): Boolean; +var + ADIndex: Integer; +begin + if not View.HideWeekEnd then + Result := ADayIndex = 0 + else + begin + Result := True; + Dec(ADayIndex); + while Result and (ADayIndex >= 0) do + begin + ADIndex := ADayIndex + Ord(Scheduler.OptionsView.ActualStartOfWeek); + ViewInfo.CorrectWeekDay(ADIndex); + Result := not IsWorkDay(ADIndex, Scheduler); + Dec(ADayIndex); + end; + end; +end; + +function TcxSchedulerWeeksViewNavigation.IsLastDayOfWeek(ADayIndex: Integer): Boolean; +var + ADIndex: Integer; +begin + if not View.HideWeekEnd then + Result := ADayIndex = WholeWeekDayCount - 1 + else + begin + Result := True; + Inc(ADayIndex); + while Result and (ADayIndex < WholeWeekDayCount) do + begin + ADIndex := ADayIndex + Ord(Scheduler.OptionsView.ActualStartOfWeek); + ViewInfo.CorrectWeekDay(ADIndex); + Result := not IsWorkDay(ADIndex, Scheduler); + Inc(ADayIndex); + end; + end; +end; + +{ TcxSchedulerWeekViewEventCellViewInfo } + +procedure TcxSchedulerWeekViewEventCellViewInfo.CalculateBorders; +begin + if ViewData.ContentFinish < EventFinish then + Exclude(FBorders, bRight); + if ViewData.ContentStart > EventStart then + Exclude(FBorders, bLeft); +end; + +procedure TcxSchedulerWeekViewEventCellViewInfo.CalculateCaptions; +begin + if (DateOf(EventStart) <> DateOf(EventFinish)) and (Event.Duration < 1) then + begin + FStartText := DateTimeHelper.TimeToStr(Max(EventStart, ContentStart)); + FFinishText := DateTimeHelper.TimeToStr(Min(EventFinish, ContentFinish)); + end + else + inherited CalculateCaptions; +end; + +procedure TcxSchedulerWeekViewEventCellViewInfo.CalculateEventTimeVisibility; +begin + CalculateNonDetailEventTimeVisibility; + if not IsHeaderEvent then + ViewData.ShowStartTime := True + else + if ViewData.ShowTimeAsClock and not Event.AllDayEvent then + begin + ViewData.ShowStartTime := ViewData.ShowStartTime and (TimeOf(Event.Start) <> 0); + ViewData.ShowFinishTime := ViewData.ShowFinishTime and (TimeOf(Event.Finish) <> 0); + end; +end; + +procedure TcxSchedulerWeekViewEventCellViewInfo.CalculateItemsLayout; +begin + if IsHeaderEvent then + CalculateHeaderEventLayout + else + CalculateNonDetailEventLayout; +end; + +function TcxSchedulerWeekViewEventCellViewInfo.GetEditingRect: TRect; +begin + Result := inherited GetEditingRect; + with Result do + begin + if not IsHeaderEvent then + begin + if not cxRectIsEmpty(FFinishRect) then + Left := FFinishRect.Right + else + if not cxRectIsEmpty(FStartRect) then + Left := FStartRect.Right + else + Left := FBounds.Left; + Inc(Left, cxTextOffset + cxEventImagesGap); + Dec(Right); + Inc(Top); + Dec(Bottom); + end; + end; +end; + +procedure TcxSchedulerWeekViewEventCellViewInfo.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + inherited InitHitTest(AHitTest); + if IsHeaderEvent then + InitHitTestForHorzEvent(AHitTest) + else + if (ShowStartTime and (AHitTest.HitX <= FStartRect.Right)) or + (ShowFinishTime and (AHitTest.HitX <= FFinishRect.Right)) then + AHitTest.SetDragKind(edkEventDragRect); +end; + +{ TcxSchedulerWeekViewViewInfo } + +constructor TcxSchedulerWeekViewViewInfo.Create(AOwner: TcxSchedulerSubControl); +begin + inherited Create(AOwner); + Builder := TcxSchedulerEventLayoutBuilder.Create; +end; + +destructor TcxSchedulerWeekViewViewInfo.Destroy; +begin + Builder.Free; + inherited Destroy; +end; + +procedure TcxSchedulerWeekViewViewInfo.ScrollVertical( + AScrollCode: TScrollCode; var AScrollPos: Integer); +var + ADelta: Integer; +begin + ADelta := View.GetScrollPos(StartDates[0], False); + if not (AScrollCode in [scPosition, scTrack]) then + AScrollPos := ADelta; + case AScrollCode of + scLineUp: + Dec(AScrollPos, 1); + scLineDown: + Inc(AScrollPos, 1); + scPageUp: + Dec(AScrollPos, Weeks.Count); + scPageDown: + Inc(AScrollPos, Weeks.Count); + scTop: + AScrollPos := -View.GetMinScrollPos; + scBottom: + AScrollPos := View.GetMaxScrollPos; + end; + ADelta := ADelta - AScrollPos; + if ADelta <> 0 then + begin + View.ScrollSelectedDays(ADelta); + View.LayoutChanged; + AScrollPos := View.GetScrollPos(StartDates[0]); + end; +end; + +function TcxSchedulerWeekViewViewInfo.AddContentCell(const ARect: TRect; + const AStart, AFinish: TDateTime; AResourceIndex: Integer): TcxSchedulerContentCellViewInfo; +begin + Result := inherited AddContentCell(ARect, AStart, AFinish, AResourceIndex); + Result.DontPrint := PrintExactlyOneMonth and (MonthOf(AStart) <> PrintedMonth); +end; + +procedure TcxSchedulerWeekViewViewInfo.AddDayCellEvent( + APlace: TcxSchedulerEventPlace); +var + I, AOfs: Integer; + AStart, AFinish: TDateTime; + ABounds, AVisibleRect: TRect; + AResource: TcxSchedulerResourceViewInfo; + AViewData: TcxSchedulerEventViewData; + ACell: TcxSchedulerEventCellViewInfo; + AEvent: TcxSchedulerControlEvent; +begin + AOfs := DayCells[APlace.ColStart].Bounds.Top + GetDayCellHeaderHeight; + AEvent := TcxSchedulerControlEvent(APlace.Event); + ABounds.Top := 0; + ABounds.Bottom := FContentLineHeight; + GetEventInfo(APlace.ColStart, APlace.ColFinish, ABounds.Left, + ABounds.Right, AStart, AFinish, AVisibleRect, AResource); + OffsetRect(ABounds, 0, AOfs + APlace.LineStart * (FContentLineHeight + cxTextOffset)); + if ABounds.Bottom <= AVisibleRect.Bottom then + begin + AViewData := CreateEventViewData(AEvent, ABounds, AStart, AFinish, AResource); + AViewData.VisibleRect := AVisibleRect; + if AEvent.Selected then + with Styles.GetSelectionParams do + begin + AViewData.ViewParams.Color := Color; + AViewData.ViewParams.TextColor := TextColor; + AViewData.ViewParams.Font := Font; + end; + ACell := AddEventCell(AViewData); + if not (AEvent.AllDayEvent or (AEvent.Duration >= 1)) then + begin + ACell.Transparent := not (AEvent.Selected or Styles.IsEventStyleAssigned(AEvent)); + ACell.Borders := []; + end; + end + else + for I := APlace.ColStart to APlace.ColFinish do + begin + if DayCells[I].LineCount <> MaxInt then + begin + AddButton(DayCells[I].Bounds, DayCells[I].TimeStart, True, AEvent); + DayCells[I].LineCount := MaxInt; + end; + end; +end; + +function TcxSchedulerWeekViewViewInfo.AddDayCellEventPlace( + AEvent: TcxSchedulerControlEvent; var AIndex: Integer; AStartDay: TcxSchedulerContentCellViewInfo): Boolean; +var + I, AStartCol, AFinishCol: Integer; + ADay: TcxSchedulerContentCellViewInfo; +begin + Result := False; + if not CanEventVisible(AEvent) then + begin + Inc(AIndex); + Exit; + end; + // skip days for event on invisible line + if (AStartDay.LineCount = MaxInt) then + begin + while (AIndex < (DayCellCount - 1)) and IsSingleLine(DayCells[AIndex], AStartDay) do + Inc(AIndex); + Exit; + end; + AStartCol := AIndex; + AFinishCol := AIndex; + Result := True; + for I := AIndex + 1 to DayCellCount - 1 do + begin + ADay := DayCells[I]; + Result := IsCellEvent(AEvent, ADay); + if Result and IsSingleLine(AStartDay, ADay) then + begin + ADay.LineCount := AStartDay.LineCount + 1; + if CanVisibleNextLine(ADay, AStartDay.LineCount) then + AFinishCol := I + else + begin + AddButton(ADay.Bounds, ADay.TimeStart, True, AEvent); + AIndex := I + 1; + Break; + end; + end + else + Break; + end; + AIndex := Max(AFinishCol + 1, AIndex); + Builder.AddEventPlace(AEvent, AStartCol, AFinishCol); + AStartDay.LineCount := AStartDay.LineCount + 1; +end; + +function TcxSchedulerWeekViewViewInfo.AddWeekDayHeader( + AWeekDay: Integer; ALeft, ARight: Integer): TcxSchedulerWeekDayHeaderCellViewInfo; +begin + CreateCellInstance(TcxSchedulerWeekDayHeaderCellViewInfo, cxRect(ALeft, FDayHeaderOffsetTop, + ARight, FDayHeaderOffsetTop + FDayHeaderHeight), + StylesAdapter.GetDayHeaderParams(View.FirstVisibleDate + AWeekDay), Result); + if CompressWeekEnd and not HideWeekEnd and (AWeekDay >= 6) then + Result.DateTime := 8 + else + Result.DateTime := AWeekDay; + DayHeaderCells.Add(Result); +end; + +procedure TcxSchedulerWeekViewViewInfo.CalculateDaysLayout; +begin + if GroupByResource then + ProcessGroupByResource + else + if GroupByDate then + ProcessGroupByDate + else + ProcessGroupByNone; +end; + +procedure TcxSchedulerWeekViewViewInfo.CalculateDaysLayoutForResource( + const ABounds: TRect; AResourceIndex: Integer); +const + AddBorders: array[Boolean] of TcxBorders = ([bRight], []); +begin + CalculateWeekDisplayRectsVert(StartDates[0], AResourceIndex, ABounds, + AddBorders[HasSeparator or (AResourceIndex = (ResourceCount - 1))]); +end; + +procedure TcxSchedulerWeekViewViewInfo.CalculateDaysLayoutForDates( + const ABounds: TRect; AResourceIndex: Integer); +begin + +end; + +procedure TcxSchedulerWeekViewViewInfo.CalculateEventsViewInfo; +var + I, J: Integer; + AEvent: TcxSchedulerControlEvent; +begin + for I := 0 to Events.AbsoluteCount - 1 do + begin + J := 0; + AEvent := Events.AbsoluteItems[I]; + while J < DayCellCount do + begin + if IsCellEvent(AEvent, DayCells[J]) then + begin + if not AddDayCellEventPlace(AEvent, J, DayCells[J]) and (ResourceCount = 0) then + Break; + end + else + Inc(J); + end; + end; + Builder.Calculate; + for I := 0 to Builder.EventPlaceCount - 1 do + AddDayCellEvent(Builder.EventPlaces[I]); +end; + +procedure TcxSchedulerWeekViewViewInfo.CalculateGroupByDateForResource( + const ABounds: TRect; AResourceIndex: Integer); +begin + CalculateWeekDisplayRectsHorz(StartDates[0], AResourceIndex, ABounds, True, True); +end; + +procedure TcxSchedulerWeekViewViewInfo.CalculateHeaderViewInfo; +var + R: TRect; + I, AIndex, AWeekDay: Integer; + ACell: TcxSchedulerContentCellViewInfo; + AHeader: TcxSchedulerDayHeaderCellViewInfo; +const + ANeighbors: array[Boolean] of TcxNeighbors = ([], [nLeft]); +begin + if GroupByDate then + begin + for I := 0 to FRowCols - 1 do + begin + ACell := DayCells[I]; + AWeekDay := DayOfWeek(ACell.TimeStart) - 1; + CorrectWeekDay(AWeekDay); + AHeader := AddWeekDayHeader(AWeekDay, ACell.Bounds.Left, ACell.Bounds.Right); + AHeader.Compressed := (I = 5) and CompressWeekEnd; + end; + end + else + begin + AIndex := Byte(ResourceCount > 0) - 1; + for I := 0 to ContentCells.Count - 1 do + begin + ACell := TcxSchedulerContentCellViewInfo(ContentCells[I]); + R := cxRectSetHeight(ACell.Bounds, FDayHeaderHeight); + OffsetRect(R, 0, 1); + if HasVisibleBounds then + begin + Inc(R.Right); + OffsetRect(R, 0, -1); + end; + if (View.DaysLayout <> wdlOneColumn) and (not HasSeparator or ((I mod 7) <= 2)) then + Dec(R.Right); + with AddDayHeader(ACell.TimeStart, R, AIndex) do + begin + AlignHorz := taRightJustify; + Selected := IsTimeSelected(DateTime, Resource); + if Selected and not HideSelection then + begin + SelectionColor := FSelectionParams.Color; + SelectionTextColor := FSelectionParams.TextColor; + end; + end; + if (I + 1) mod View.GetWeekDayCount = 0 then + Inc(AIndex); + end; + end; + ProcessDateToDisplayText(True); +end; + +procedure TcxSchedulerWeekViewViewInfo.CalculateMetrics; +begin + inherited CalculateMetrics; + FDayHeaderOffsetTop := Bounds.Top; + FHeaderOffsetLeft := Bounds.Left; + FResourceHeaderWidth := FResourceHeaderHeight; + Weeks.Clear; + CalculatePrintRowCols; + CalculateWeekDates; +end; + +procedure TcxSchedulerWeekViewViewInfo.CalculatePrintRowCols; +begin + FWeekEndCells := Byte(not PrintWeekEnds) * (Byte(not CompressWeekEnd) + 1); + FRowColsStart := 0; + FRowColsStartDateOffset := 0; + if View.IsWholeWeekShown then + FRowCols := WholeWeekDayCount - Byte(CompressWeekEnd) - FWeekEndCells + else + FRowCols := View.GetWorkWeekDayCount; + CalculateStartFinishCellIndexes; +end; + +procedure TcxSchedulerWeekViewViewInfo.CalculateResourceHeadersAutoHeight( + AWidth: Integer); +begin + if GroupByDate and not RotateCaptions then + FResourceHeaderHeight := CalculateResourceHeaderWidth + else + inherited CalculateResourceHeadersAutoHeight(AWidth); + FResourceHeaderWidth := FResourceHeaderHeight; +end; + +procedure TcxSchedulerWeekViewViewInfo.CalculateStartFinishCellIndexes; +var + I: Integer; +begin + if PagesPerWeek = 1 then Exit; + if PrimaryPage then + begin + if View.GetWorkWeekDayCount > 3 then + FRowCols := 3 + else + FRowCols := View.GetWorkWeekDayCount; + end + else + begin + FRowColsStart := 3; + FRowColsStartDateOffset := FRowColsStart; + for I := 0 to FRowCols - 1 do + if not IsWorkDay(I + Byte(Scheduler.OptionsView.StartOfWeek), Scheduler) and HideWeekEnd then + Inc(FRowColsStartDateOffset); + FRowCols := FRowCols - FRowColsStart; + end; +end; + +procedure TcxSchedulerWeekViewViewInfo.CalculateWeekDates; +var + I, ADate: Integer; + AYear, APrevYear, AWeek, APrevWeek, AWeekDay: Word; +begin + APrevYear := 0; + APrevWeek := 0; + for I := 0 to DayCount - 1 do + begin + DecodeDateWeek(Days[I] + View.GetDateOffset, AYear, AWeek, AWeekDay); + if (AYear <> APrevYear) or (AWeek <> APrevWeek) then + begin + APrevYear := AYear; + APrevWeek := AWeek; + //DELPHI8! check Trunc(EncodeDateWeek(AYear, AWeek, 1)) + ADate := Trunc(EncodeDateWeek(AYear, AWeek, 1)); + Weeks.Add(ADate); + end; + end; +end; + +procedure TcxSchedulerWeekViewViewInfo.CalculateWeekDisplayRectsHorz( + const AStartDate: TDateTime; AResourceID: Integer; + {const }ABounds: TRect; AIsTopWeek, AIsLastWeek: Boolean); +var + I, J, W, K, AWeekDay: Integer; + ARects: TcxSchedulerDaysRect; + ACellBorders: TcxBorders; +const + ABorders: array[Boolean] of TcxBorders = ([bTop, bRight], [bTop]); +begin + W := ABounds.Right - ABounds.Left; + for I := 0 to FRowCols + GetRowColsOffset - 1 do + begin + J := I + FRowColsStart; + ARects[J] := cxRect(ABounds.Left + MulDiv(W, I, FRowCols), + ABounds.Top - 1, ABounds.Left + MulDiv(W, I + 1, FRowCols), ABounds.Bottom); + if CompressWeekEnd and not HideWeekEnd and (J = 5) then + cxRectSplitVert(ARects[5], ARects[5], ARects[6]); + end; + + K := -1; + for I := FRowColsStartDateOffset to WholeWeekDayCount - 1 do + begin + AWeekDay := I + Integer(View.StartOfWeek); + CorrectWeekDay(AWeekDay); + if IsWorkDay(AWeekDay, Scheduler) or not HideWeekEnd then + begin + Inc(K); + ACellBorders := ABorders[(K >= (FRowCols - 1)) and (HasSeparator or (AResourceID = (ResourceCount - 1)))]; + if AIsTopWeek and (K <> FRowCols) then + Exclude(ACellBorders, bTop); + if AIsLastWeek and not HasSeparator and (K <> FRowCols - 1) and (AResourceID <> ResourceCount - 1) then + Include(ACellBorders, bBottom); + J := K + FRowColsStart; + AddContentCell(ARects[J], AStartDate + I, + AStartDate + I + 1, AResourceID).Borders := ACellBorders; + end; + end; +end; + +procedure TcxSchedulerWeekViewViewInfo.CalculateWeekDisplayRectsVert( + const AStartDate: TDateTime; AResourceID: Integer; + const ABounds: TRect; AddBorders: TcxBorders = []); +var + R: TRect; + I, J: Integer; + ARects: TcxSchedulerDaysRect; + ASize: TSize; +begin + if View.DaysLayout = wdlOneColumn then + begin + CalculateWeekDisplayRectsVertEx(AStartDate, AResourceID, ABounds, AddBorders); + Exit; + end; + FillChar(ARects, SizeOf(ARects), 0); + ASize := cxRectSize(ABounds); + for I := 0 to 2 do + begin + R := cxRect(ABounds.Left, ABounds.Top + MulDiv(ASize.CY, I, 3), + ABounds.Right, ABounds.Top + MulDiv(ASize.CY, I + 1, 3)); + if PagesPerWeek = 1 then + cxRectSplitHorz(R, ARects[I], ARects[I + 3]) + else + begin + ARects[I] := R; + ARects[I + 3] := R; + end; + end; + cxRectSplitVert(ARects[5], ARects[5], ARects[6]); + for I := 0 to FRowCols - GetRowColsOffset do + begin + J := RowColsStart + I; + AddContentCell(ARects[J], AStartDate + J, AStartDate + J + 1, + AResourceID).Borders := WeekViewDayBorders[J] + AddBorders; + end; +end; + +procedure TcxSchedulerWeekViewViewInfo.CalculateWeekDisplayRectsVertEx( + const AStartDate: TDateTime; AResourceID: Integer; + const ABounds: TRect; AddBorders: TcxBorders = []); +var + R: TRect; + I, J, K, AWeekDay: Integer; + ARects: TcxSchedulerDaysRect; + ASize: TSize; +begin + FillChar(ARects, SizeOf(ARects), 0); + ASize := cxRectSize(ABounds); + for I := 0 to FRowCols - GetRowColsOffset - 1 do + begin + R := cxRect(ABounds.Left, ABounds.Top + MulDiv(ASize.CY, I, FRowCols), + ABounds.Right, ABounds.Top + MulDiv(ASize.CY, I + 1, FRowCols)); + ARects[RowColsStart + I] := R; + end; + if View.CompressWeekEnd and not HideWeekEnd then + cxRectSplitVert(ARects[5], ARects[5], ARects[6]); + K := -1; + for I := 0 to WholeWeekDayCount - 1 do + begin + AWeekDay := I + Integer(View.StartOfWeek); + CorrectWeekDay(AWeekDay); + if IsWorkDay(AWeekDay, Scheduler) or not HideWeekEnd then + begin + Inc(K); + J := RowColsStart + I; + AddContentCell(ARects[RowColsStart + K], AStartDate + J, AStartDate + J + 1, + AResourceID).Borders := [bTop] + AddBorders; + end; + end; +end; + +function TcxSchedulerWeekViewViewInfo.CanEventVisible( + AEvent: TcxSchedulerControlEvent): Boolean; +begin + Result := not (AEvent.IsClone and FHideClones); +end; + +function TcxSchedulerWeekViewViewInfo.CanVisibleNextLine( + ADay: TcxSchedulerContentCellViewInfo; ALine: Integer = -1): Boolean; +begin + if ALine = -1 then + ALine := ADay.LineCount; + Result := (ALine <> MaxInt) and((GetDayCellContentHeight(ADay)) >= + (ALine + 1) * FContentLineHeight); +end; + +procedure TcxSchedulerWeekViewViewInfo.CheckHeaderBorders; +var + I: Integer; +const + ANeigbors: array[Boolean] of TcxNeighbors = + ([], [nTop]); + ADayHeader: array[Boolean] of TcxNeighbors = + ([], [nLeft]); + ABorders: array[Boolean] of TcxBorders = + ([], [bBottom]); +begin + ProcessCheckBorders(DayHeaderCells, GroupingKind = gkByDate, + ANeigbors[not GroupByDate] + ADayHeader[GroupByDate]); + ProcessCheckBorders(ResourceHeaderCells, False, [], ABorders[GroupByResource]); + if not GroupByDate then + begin + if GroupByResource then + with TcxSchedulerDayHeaderCellViewInfo(ResourceHeaderCells[0]) do + Borders := Borders - [bLeft]; + for I := 0 to DayHeaderCells.Count - 1 do + with TcxSchedulerDayHeaderCellViewInfo(DayHeaderCells[I]) do + Borders := [bBottom, bTop] * LookAndFeelPainter.HeaderBorders([nTop]); + end; +end; + +function TcxSchedulerWeekViewViewInfo.ContentCellClass: TcxSchedulerContentCellViewInfoClass; +begin + if GroupByDate then + Result := TcxSchedulerMonthDayContentCellViewInfo + else + Result := inherited ContentCellClass; +end; + +procedure TcxSchedulerWeekViewViewInfo.CorrectWeekDay(var AWeekDay: Integer); +begin + if AWeekDay > 6 then Dec(AWeekDay, 7); + if AWeekDay < 0 then Inc(AWeekDay, 7); +end; + +function TcxSchedulerWeekViewViewInfo.CreateEventCellViewInfo( + AViewData: TcxSchedulerEventViewData): TcxSchedulerEventCellViewInfo; +begin + Result := TcxSchedulerWeekViewEventCellViewInfo.Create(AViewData); +end; + +procedure TcxSchedulerWeekViewViewInfo.DoCalculate; +begin + View.CheckWorkDays; + FPrintWeekEnds := True; + Builder.Clear; + inherited DoCalculate; + FPrintExactlyOneMonth := Adapter.PrintExactlyOneMonth; + if FPrintExactlyOneMonth then + FPrintedMonth := MonthOf(Days[DayCount div 2]); + if IsCalculateHeaderFirst then + begin + CalculateHeaderViewInfo; + CalculateDaysLayout; + end + else + begin + CalculateDaysLayout; + CalculateHeaderViewInfo; + end; + CalculateEventsViewInfo; + CheckHeaderBorders; + CalculateContentNavigationButtons; +end; + +procedure TcxSchedulerWeekViewViewInfo.DoContentNavigationButtonClick( + Sender: TcxSchedulerContentNavigationButtonViewInfo); +const + DaysInWeek = 7; +var + AInterval: TDateTime; +begin + if Sender.Interval < 0 then + begin + if Sender.Interval / DaysInWeek = Trunc(Sender.Interval / DaysInWeek) then + AInterval := DaysInWeek * Trunc(Sender.Interval / DaysInWeek) + else + AInterval := DaysInWeek * (Trunc(Sender.Interval / DaysInWeek) - 1); + end + else + AInterval := DaysInWeek * (Trunc((Sender.Interval - 1) / DaysInWeek) + 1); + SelectedDays.ShiftPeriod(AInterval); + inherited DoContentNavigationButtonClick(Sender); +end; + +procedure TcxSchedulerWeekViewViewInfo.DoMoreEventsButtonClick( + Sender: TcxSchedulerMoreEventsButtonViewInfo); +begin + SelectedDays.Clear; + SelectedDays.Add(Sender.DateTime); + View.PeriodChanged; +end; + +function TcxSchedulerWeekViewViewInfo.GetCompressWeekEnd: Boolean; +begin + Result := View.CompressWeekEnd or (not GroupByDate and (View.DaysLayout = wdlTwoColumns)); +end; + +procedure TcxSchedulerWeekViewViewInfo.GetEventInfo(AColStart, AColFinish: Integer; + var ALeft, ARight: Integer; var AStart, AFinish: TDateTime; + var AVisibleRect: TRect; var AResource: TcxSchedulerResourceViewInfo); +begin + with DayCells[AColStart] do + begin + ALeft := Bounds.Left + cxTextOffset; + AStart := TimeStart; + AResource := Resource; + AVisibleRect := Bounds; + end; + with DayCells[AColFinish] do + begin + ARight := Bounds.Right - cxTextOffset - 1; + AFinish := TimeFinish; + AVisibleRect.Right := Bounds.Right; + end; + Dec(AVisibleRect.Bottom, cxTextOffset); +end; + +function TcxSchedulerWeekViewViewInfo.GetResourcesContentWidth: Integer; +begin + if GroupByResource then + Result := Bounds.Right - Bounds.Left + else + Result := inherited GetResourcesContentWidth; +end; + +function TcxSchedulerWeekViewViewInfo.GetResourceImagesSize: TSize; +begin + if ResourceImages = nil then + Result := TSize(cxNullSize) + else + begin + Result := inherited GetResourceImagesSize; + if GroupByDate and ResourceHeaders.RotateCaptions then + Result := cxSize(ResourceImages.Height, ResourceImages.Width); + end; +end; + +function TcxSchedulerWeekViewViewInfo.GetResourceScrollBarKind: TScrollBarKind; +begin + if (FGroupingKind = gkByDate) and ResourceNavigator.NeedScrollBar then + Result := sbVertical + else + Result := sbHorizontal +end; + +function TcxSchedulerWeekViewViewInfo.GetContentParams( + const ATime: TDateTime; AResource: TcxSchedulerResourceViewInfo): TcxViewParams; +begin + if AResource = nil then + Result := StylesAdapter.GetContentParams(ATime, True, nil) + else + Result := StylesAdapter.GetContentParams(ATime, True, AResource.ResourceItem); +end; + +function TcxSchedulerWeekViewViewInfo.GetDayCellContentHeight( + ADay: TcxSchedulerContentCellViewInfo): Integer; +begin + Result := cxRectHeight(PainterHelper.ExcludeBorders(ADay.Bounds, + ADay.Borders)) - GetDayCellHeaderHeight - cxTextOffset; +end; + +function TcxSchedulerWeekViewViewInfo.GetDayCellHeaderHeight: Integer; +begin + if GroupByDate then + Result := cxTextOffset + FContentFontHeight + else + Result := FDayHeaderHeight + cxTextOffset; +end; + +function TcxSchedulerWeekViewViewInfo.GetHideWeekEnd: Boolean; +begin + Result := View.HideWeekEnd; +end; + +function TcxSchedulerWeekViewViewInfo.IsCalculateHeaderFirst: Boolean; +begin + Result := False; +end; + +function TcxSchedulerWeekViewViewInfo.IsCellEvent( + AEvent: TcxSchedulerControlEvent; ACell: TcxSchedulerContentCellViewInfo): Boolean; +begin + Result := (ACell <> nil) and AEvent.IsDayEvent(ACell.TimeStart); + if Result and (GroupingKind <> gkNone) then + Result := AEvent.IsResourceEvent(ACell.Resource.ResourceItem, ShowEventsWithoutResource); + if Result and PrintExactlyOneMonth then + Result := MonthOf(ACell.TimeStart) = PrintedMonth; +end; + +function TcxSchedulerWeekViewViewInfo.IsSingleLine( + ADay1, ADay2: TcxSchedulerContentCellViewInfo): Boolean; +begin + Result := (ADay1 <> nil) and (ADay2 <> nil) and + (ADay1.Bounds.Top = ADay2.Bounds.Top); +end; + +function TcxSchedulerWeekViewViewInfo.IsTimeSelected( + ATime: TDateTime; AResource: TObject): Boolean; +begin + ATime := DateTimeHelper.RoundTime(ATime); + Result := not HideSelection and (AResource = FSelResource) and + (ATime >= SelStart) and (ATime <= SelFinish); + Result := Result and CanSelected; +end; + +function TcxSchedulerWeekViewViewInfo.IsWeekStartOnMonday: Boolean; +begin + Result := not HideWeekEnd and CompressWeekEnd and GroupByDate or + (not HideWeekEnd or (View.DaysLayout = wdlTwoColumns)) and not GroupByDate; +end; + +procedure TcxSchedulerWeekViewViewInfo.ProcessGroupByDate; + + function IsSameMonth(ACell1, ACell2: TcxSchedulerMonthDayContentCellViewInfo): Boolean; + begin + Result := (ACell1 <> nil) and (ACell2 <> nil); + if Result then + Result := ACell1.Resource = ACell2.Resource; + if Result then + Result := MonthOf(ACell1.TimeStart) = MonthOf(ACell2.TimeStart); + end; + +var + I, H: Integer; + ABounds: TRect; + + ACell: TcxSchedulerHeaderCellViewInfo; + APrevCell, AContentCell: TcxSchedulerMonthDayContentCellViewInfo; +begin + ABounds := Bounds; + Inc(ABounds.Left, ResourceHeaderWidth); + H := cxRectHeight(ABounds) - DayHeaderHeight - + SeparatorWidth * (ResourceCount - 1); + AddResourceHeader(-1, cxRectSetSize(Bounds, ResourceHeaderWidth, DayHeaderHeight)); + for I := 0 to ResourceCount - 1 do + begin + ABounds.Top := Bounds.Top + DayHeaderHeight + + MulDiv(H, I, ResourceCount) + SeparatorWidth * I + 1; + ABounds.Bottom := Bounds.Top + DayHeaderHeight + + MulDiv(H, I + 1, ResourceCount) + SeparatorWidth * I; + AddResourceBounds(I, ABounds); + CalculateGroupByDateForResource(ABounds, I); + if I < (ResourceCount - 1) then + AddGroupHorzSeparator(ABounds.Bottom); + Dec(ABounds.Top); + ACell := AddResourceHeader(I, cxRectSetWidth(ABounds, + Bounds.Left, ResourceHeaderWidth)); + ACell.RotateText := RotateCaptions; + ACell.RotateHeader := True; + end; + APrevCell := nil; + for I := 0 to ContentCells.Count - 1 do + begin + AContentCell := TcxSchedulerMonthDayContentCellViewInfo(ContentCells[I]); + AContentCell.SetContentState(IsSameMonth(APrevCell, AContentCell), + IsTimeSelected(AContentCell.TimeStart, AContentCell.Resource), + FContentFontHeight, FSelectionParams); + APrevCell := AContentCell; + end; +end; + +procedure TcxSchedulerWeekViewViewInfo.ProcessGroupByNone; +begin + CalculateWeekDisplayRectsVert(StartDates[0], -1, Bounds); +end; + +procedure TcxSchedulerWeekViewViewInfo.ProcessGroupByResource; +var + I, W: Integer; + ABounds: TRect; + ACell: TcxSchedulerHeaderCellViewInfo; +begin + ABounds := Bounds; + W := ABounds.Right - ABounds.Left - SeparatorWidth * (ResourceCount - 1); + Inc(ABounds.Top, ResourceHeaderHeight); + for I := 0 to ResourceCount - 1 do + begin + ABounds.Left := MulDiv(W, I, ResourceCount) + SeparatorWidth * I; + ABounds.Right := MulDiv(W, I + 1, ResourceCount) + SeparatorWidth * I; + AddResourceBounds(I, ABounds); + CalculateDaysLayoutForResource(ABounds, I); + if I < (ResourceCount - 1) then + AddGroupVertSeparator(ABounds.Right); + ACell := AddResourceHeader(I, cxRectSetTop(ABounds, Bounds.Top, ResourceHeaderHeight)); + ACell.Borders := LookAndFeelPainter.HeaderBorders([nLeft, nRight, nBottom]); + if not (bLeft in ACell.Borders) then + ACell.Borders := ACell.Borders - [bRight, bBottom]; + end; +end; + +function TcxSchedulerWeekViewViewInfo.GetDayCell( + ADay: Integer): TcxSchedulerContentCellViewInfo; +begin + Result := TcxSchedulerContentCellViewInfo(ContentCells[ADay]); +end; + +function TcxSchedulerWeekViewViewInfo.GetDayCellCount: Integer; +begin + Result := ContentCells.Count; +end; + +function TcxSchedulerWeekViewViewInfo.GetRotateCaptions: Boolean; +begin + Result := View.OptionsView.RotateResourceCaptions; +end; + +function TcxSchedulerWeekViewViewInfo.GetRowColsOffset: Integer; +begin + Result := Integer((Adapter <> nil) and Adapter.IsPrinting and (Adapter.PagesPerWeek = 2) and PrimaryPage); +end; + +function TcxSchedulerWeekViewViewInfo.GetStartDate(AWeek: Integer): TDateTime; +begin + Result := Weeks[AWeek]; + if not IsWeekStartOnMonday then + Result := Result - View.GetDateOffset; +end; + +function TcxSchedulerWeekViewViewInfo.GetView: TcxSchedulerWeekView; +begin + Result := TcxSchedulerWeekView(inherited View); +end; + +function TcxSchedulerWeekViewViewInfo.GetWeeks: TcxSchedulerDateList; +begin + Result := View.FWeeks; +end; + +{ TcxSchedulerWeeksViewEventCellViewInfo } + +function TcxSchedulerWeeksViewEventCellViewInfo.CanAutoHideStandardImages: Boolean; +begin + Result := True; +end; + +{ TcxSchedulerWeeksViewViewInfo } + +procedure TcxSchedulerWeeksViewViewInfo.CalculateDaysLayoutForResource( + const ABounds: TRect; AResourceIndex: Integer); +var + R: TRect; + C, I, H, ATop, APrevMonth: Integer; + ACell: TcxSchedulerMonthDayContentCellViewInfo; +begin + ATop := ABounds.Top; + if not GroupByDate then + Inc(ATop, FDayHeaderHeight); + H := ABounds.Bottom - ATop; + C := ContentCells.Count; + for I := 0 to Weeks.Count - 1 do + begin + R := cxRect(ABounds.Left, ATop + MulDiv(H, I, Weeks.Count), + ABounds.Right, ATop + MulDiv(H, I + 1, Weeks.Count)); + if (I > 0) or not GroupByDate then Inc(R.Top); + CalculateWeekDisplayRectsHorz(StartDates[I], AResourceIndex, R, I = 0, I = Weeks.Count - 1); + end; + APrevMonth := -1; + for I := C to ContentCells.Count - 1 do + begin + ACell := TcxSchedulerMonthDayContentCellViewInfo(ContentCells[I]); + ACell.SetContentState(APrevMonth = MonthOf(ACell.TimeStart), + IsTimeSelected(ACell.TimeStart, ACell.Resource), FContentFontHeight, FSelectionParams); + APrevMonth := MonthOf(ACell.TimeStart); + end; +end; + +procedure TcxSchedulerWeeksViewViewInfo.CalculateGroupByDateForResource( + const ABounds: TRect; AResourceIndex: Integer); +begin + CalculateDaysLayoutForResource(ABounds, AResourceIndex); +end; + +procedure TcxSchedulerWeeksViewViewInfo.CalculateHeaderViewInfo; +var + I, J, W, AWeekDay: Integer; +begin + if GroupByResource then Exit; + if GroupByDate then + FHeaderOffsetLeft := ResourceHeaderWidth + Bounds.Left; + W := Bounds.Right - FHeaderOffsetLeft; + J := 0; + I := 0; + while J < FRowCols do + begin + AWeekDay := I + Integer(View.StartOfWeek) + FRowColsStartDateOffset; + CorrectWeekDay(AWeekDay); + if IsWorkDay(AWeekDay, Scheduler) or not HideWeekEnd then + begin + if ((J + FRowColsStartDateOffset) < 6) or HideWeekEnd or not CompressWeekEnd then + AddWeekDayHeader(AWeekDay, + MulDiv(W, J, FRowCols) + FHeaderOffsetLeft, + MulDiv(W, J + 1, FRowCols) + FHeaderOffsetLeft); + Inc(J); + end; + Inc(I); + end; + ProcessDateToDisplayText(True); + FContentOffset := FDayHeaderHeight; +end; + +procedure TcxSchedulerWeeksViewViewInfo.CalculateMetrics; +begin + FPrintWeekEnds := not Adapter.DontPrintWeekEnd; + inherited CalculateMetrics; +end; + +procedure TcxSchedulerWeeksViewViewInfo.CheckHeaderBorders; +const + ANeigbors: array[Boolean] of TcxNeighbors = + ([], [nTop]); +begin + ProcessCheckBorders(DayHeaderCells, False, ANeigbors[GroupByResource]); + ProcessCheckBorders(ResourceHeaderCells, False); + if not GroupByDate or not (bLeft in LookAndFeelPainter.HeaderBorders([nLeft])) then + begin + with TcxSchedulerHeaderCellViewInfo(DayHeaderCells[0]) do + Borders := Borders - [bLeft]; + if GroupByResource then + with TcxSchedulerDayHeaderCellViewInfo(ResourceHeaderCells[0]) do + Borders := Borders - [bLeft]; + end; +end; + +function TcxSchedulerWeeksViewViewInfo.ContentCellClass: TcxSchedulerContentCellViewInfoClass; +begin + Result := TcxSchedulerMonthDayContentCellViewInfo; +end; + +function TcxSchedulerWeeksViewViewInfo.CreateEventCellViewInfo( + AViewData: TcxSchedulerEventViewData): TcxSchedulerEventCellViewInfo; +begin + Result := TcxSchedulerWeeksViewEventCellViewInfo.Create(AViewData); +end; + +function TcxSchedulerWeeksViewViewInfo.GetCompressWeekEnd: Boolean; +begin + Result := View.CompressWeekEnd; +end; + +function TcxSchedulerWeeksViewViewInfo.GetContentParams( + const ATime: TDateTime; AResource: TcxSchedulerResourceViewInfo): TcxViewParams; +begin + if AResource = nil then + Result := StylesAdapter.GetContentParams(ATime, not Odd(MonthOf(ATime)), nil) + else + Result := StylesAdapter.GetContentParams(ATime, not Odd(MonthOf(ATime)), + AResource.ResourceItem); +end; + +function TcxSchedulerWeeksViewViewInfo.GetDayCellHeaderHeight: Integer; +begin + Result := cxTextOffset + FContentFontHeight; +end; + +function TcxSchedulerWeeksViewViewInfo.IsCalculateHeaderFirst: Boolean; +begin + Result := True; +end; + +function TcxSchedulerWeeksViewViewInfo.IsWeekStartOnMonday: Boolean; +begin + Result := not HideWeekEnd and CompressWeekEnd; +end; + +procedure TcxSchedulerWeeksViewViewInfo.ProcessGroupByNone; +begin + CalculateDaysLayoutForResource(Bounds, -1); +end; + +procedure TcxSchedulerWeeksViewViewInfo.ProcessGroupByResource; +var + I, J, K, W, AWeekDay: Integer; + ACell: TcxSchedulerHeaderCellViewInfo; +begin + inherited ProcessGroupByResource; + Inc(FDayHeaderOffsetTop, FResourceHeaderHeight); + for J := 0 to ResourceHeaderCells.Count - 1 do + begin + ACell := TcxSchedulerHeaderCellViewInfo(ResourceHeaderCells[J]); + W := cxRectWidth(ACell.Bounds); + K := 0; + for I := 0 to WholeWeekDayCount - 1 do + begin + AWeekDay := I + Integer(View.StartOfWeek) + RowColsStart; + CorrectWeekDay(AWeekDay); + if IsWorkDay(AWeekDay, Scheduler) or not HideWeekEnd then + begin + if (K < 6) or HideWeekEnd or not CompressWeekEnd then + AddWeekDayHeader(AWeekDay, + MulDiv(W, K, GetHeaderDayCount) + ACell.Bounds.Left, + MulDiv(W, K + 1, GetHeaderDayCount) + ACell.Bounds.Left).Resource := ACell.Resource; + Inc(K); + end; + end; + ProcessDateToDisplayText(True); + end; +end; + +function TcxSchedulerWeeksViewViewInfo.GetHeaderDayCount: Integer; +begin + Result := View.GetWeekDayCount; + if IsWeekStartOnMonday then + Result := Result - 1; +end; + +function TcxSchedulerWeeksViewViewInfo.GetView: TcxSchedulerWeeksView; +begin + Result := TcxSchedulerWeeksView(inherited View); +end; + +{ TcxSchedulerWeekViewPainter } + +procedure TcxSchedulerWeekViewPainter.Paint; +begin + inherited Paint; + ViewInfo.ContentCells.Draw(Canvas, DrawContentCell); + ViewInfo.DayHeaderCells.Draw(Canvas, DrawHeaderCell); + ViewInfo.ResourceHeaderCells.Draw(Canvas, DrawResourceHeaderCell); + ViewInfo.GroupSeparatorCells.Draw(Canvas, DrawGroupSeparatorCell); + ViewInfo.EventCells.Draw(Canvas, DrawEventCell); + ViewInfo.Buttons.Draw(Canvas, DrawButtonCell); + ViewInfo.NavigationButtons.Draw(Canvas, DrawButtonCell); +end; + +function TcxSchedulerWeekViewPainter.GetViewInfo: TcxSchedulerWeekViewViewInfo; +begin + Result := TcxSchedulerWeekViewViewInfo(inherited ViewInfo); +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulerYearView.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerYearView.pas new file mode 100644 index 00000000..12c5cccd --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulerYearView.pas @@ -0,0 +1,1881 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulerYearView; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, DateUtils, +{$ENDIF} + Windows, Forms, Classes, SysUtils, Math, StdCtrls, Graphics, + Controls, Menus, cxClasses, cxControls, cxGraphics, cxStyles, cxGeometry, + cxLookAndFeelPainters, cxSchedulerCustomControls, cxSchedulerCustomResourceView, + cxSchedulerUtils, cxSchedulerStorage, cxSchedulerStrs, cxDateUtils; + +const + cxMaxSelectedDaysCount = 20; + MaxYearViewWeekDays = 37; + cxYearViewScrollCurrentYearPos = 10; + cxYearViewScrollMaxPos = 21; + cxYearViewScrollMinPos = 0; + + cxcsMonthHeader = 0; + cxcsUnusedContent = 1; + cxcsMaxYearViewStyle = cxcsUnusedContent; + + // hittests + htcYear = $11; + htcMonth = $12; + +type + TcxSchedulerMonthHeaderCellViewInfo = class; + TcxSchedulerMonthHeaderPopupMenu = class; + TcxSchedulerYearView = class; + TcxSchedulerYearViewViewInfo = class; + TcxSchedulerYearViewNavigation = class; + TcxSchedulerYearViewStyles = class; + TcxSchedulerYearViewContentCellViewInfo = class; + + { TcxSchedulerYearViewController } + + TcxSchedulerYearViewController = class(TcxSchedulerCustomResourceViewController) + protected + function CreateDragEventHelper: TcxDragEventHelper; override; + function CreateNavigation: TcxSchedulerViewNavigation; override; + function CreateResizeEventHelper: TcxEventSizingHelper; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + end; + + { TcxSchedulerYearViewHitTest } + + TcxSchedulerYearViewHitTest = class(TcxSchedulerCustomResourceViewHitTest) + public + property HitAtYear: Boolean index htcYear read GetBitState; + property HitAtMonth: Boolean index htcMonth read GetBitState; + end; + + { IcxSchedulerYearViewAdapter } + + IcxSchedulerYearViewAdapter = interface + ['{7B39CB3C-256E-4269-9B24-5A59BC3D868D}'] + function GetMonthCount: Integer; + function GetFirstMonth: Integer; + function GetShowMonthHeaders: Boolean; + function GetShowWeekDayHeaders: Boolean; + function GetStartDayIndex: Integer; + function GetDayCountPerPage: Integer; + end; + + { TcxSchedulerYearViewPainter } + + TcxSchedulerYearViewPainter = class(TcxSchedulerCustomViewPainter) + private + function GetViewInfo: TcxSchedulerYearViewViewInfo; + public + procedure Paint; override; + property ViewInfo: TcxSchedulerYearViewViewInfo read GetViewInfo; + end; + + { TcxSchedulerYearViewEventCellViewInfo } + + TcxSchedulerYearViewEventCellViewInfo = class(TcxSchedulerEventCellViewInfo) + protected + procedure CalculateBorders; override; + procedure CalculateCaptions; override; + procedure CalculateEventTimeVisibility; override; + function CanAutoHideStandardImages: Boolean; override; + function GetForceShowClockInHeaderEvent: Boolean; override; + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + end; + + { TcxSchedulerYearViewViewInfo } + + TcxSchedulerYearViewViewInfo = class(TcxSchedulerCustomResourceViewViewInfo) + private + FAdapterFirstMonth: Integer; + FAdapterMonthCount: Integer; + function GetAdapterFirstMonth: Integer; + function GetAdapterMonthCount: Integer; + function GetDaysCell(AIndex: Integer): TcxSchedulerYearViewContentCellViewInfo; + function GetDaysCellCount: Integer; + function GetMonthBounds(AIndex: Integer): TRect; + function GetYearView: TcxSchedulerYearView; + protected + FContentFont: TFont; + FContentSmallFont: TFont; + FDayCells: TList; + FDayTextHeight: Integer; + FMonthHeaderCells: TcxSchedulerViewInfoCellList; + FMonthHeaderWidth: Integer; + FShowMonthHeaders: Boolean; + FStartDayIndex: Integer; + FMaxYearViewWeekDays: Integer; + FMaxEventsCount: Integer; + FYear: Word; + FYearViewExtraAdapter: IcxSchedulerYearViewAdapter; + FRangeStart: Integer; + FRangeFinish: Integer; + procedure AddEventButtons(APlace: TcxSchedulerEventPlace); + procedure AddEventForCalculation(ABuilder: TcxSchedulerEventLayoutBuilder; + AEvent: TcxSchedulerControlEvent); + procedure AddEventToYearView(APlace: TcxSchedulerEventPlace); + function AddMonthHeader(AYear, AMonth: Integer; const ARect: TRect; + AFirstMonth: Integer = 0; + AMonthCount: Integer = 12): TcxSchedulerMonthHeaderCellViewInfo; + function AddWeekDayHeader(AWeekDay: Integer; + ARect: TRect): TcxSchedulerWeekDayHeaderCellViewInfo; + function AddYearViewContentCell(ARect: TRect; ADate: TDate; ASelected: Boolean; + AParams: TcxViewParams; AColIndex: Integer): TcxSchedulerYearViewContentCellViewInfo; + procedure CalculateContentCellMonthParams(AMonth: Integer; + out AMonthBounds: TRect; out AStartOfMonth: TDate; + out AStartMonthColumn, ADaysPerMonth: Integer); + procedure CalculateContentCells; virtual; + procedure CalculateContentNavigationButtons; override; + procedure CalculateDaysHeader; virtual; + procedure CalculateEventsViewInfo; virtual; + procedure CalculateMetrics; override; + procedure CalculateMonthHeaderWidth; + procedure CalculateMonthsHeader; virtual; + procedure CheckLayout(ADate: TDateTime); + procedure Clear; override; + function ContentCellClass: TcxSchedulerContentCellViewInfoClass; override; + function CreateEventCellViewInfo(AViewData: TcxSchedulerEventViewData): TcxSchedulerEventCellViewInfo; override; + function GetPartOfTheYear(ADate: TDateTime): Word; + procedure DoCalculate; override; + procedure DoContentNavigationButtonClick(Sender: TcxSchedulerContentNavigationButtonViewInfo); override; + function GetMonthColumnDate(AStartOfMonth: TDateTime; + ADaysPerMonth, AStartMonthColumn, AColumn: Integer): TDateTime; + function GetSmallFont(const AParams: TcxViewParams): TFont; + function IsEventVisible(AEvent: TcxSchedulerControlEvent): Boolean; + procedure PrepareSmallContentFont; + + // page splitting + function GetFirstMonth: Integer; virtual; + function GetMonthCountPerPage: Integer; virtual; + + property AdapterFirstMonth: Integer read GetAdapterFirstMonth write FAdapterFirstMonth; + property AdapterMonthCount: Integer read GetAdapterMonthCount write FAdapterMonthCount; + property FirstMonth: Integer read GetFirstMonth; + property MonthCountPerPage: Integer read GetMonthCountPerPage; + public + constructor Create(AOwner: TcxSchedulerSubControl); override; + destructor Destroy; override; + procedure CalculateHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + procedure UpdateSelection; + + property DaysCellCount: Integer read GetDaysCellCount; + property DaysCells[AIndex: Integer]: TcxSchedulerYearViewContentCellViewInfo read GetDaysCell; + property MonthBounds[AIndex: Integer]: TRect read GetMonthBounds; + property MonthHeaderCells: TcxSchedulerViewInfoCellList read FMonthHeaderCells; + property View: TcxSchedulerYearView read GetYearView; + property Year: Word read FYear; + end; + + { TcxSchedulerYearViewNavigation } + + TcxSchedulerYearViewNavigation = class(TcxSchedulerCustomResourceViewNavigation) + private + FCanChangeSelection: Boolean; + FSaveSelFinish: TDateTime; + FSaveSelStart: TDateTime; + function GetYearView: TcxSchedulerYearView; + function GetYearViewInfo: TcxSchedulerYearViewViewInfo; + protected + function ContentCell(AIndex: Integer): TcxSchedulerYearViewContentCellViewInfo; + procedure CorrectCurrentAnchor; + procedure DoKeyDown(var AKey: Word; AShift: TShiftState); override; + procedure GotoCornerCell(AGotoEnd: Boolean); virtual; + procedure GotoNextCellHorz(AGotoNext: Boolean); virtual; + procedure GotoNextCellVert(AGoForward: Boolean); virtual; + procedure GotoNextPage(AGotoForward: Boolean); virtual; + public + procedure KeyDown(var AKey: Word; AShift: TShiftState); override; + procedure ValidateSelection(var ASelStart, ASelFinish: TDateTime; + var AResource: TcxSchedulerStorageResourceItem); override; + + property View: TcxSchedulerYearView read GetYearView; + property ViewInfo: TcxSchedulerYearViewViewInfo read GetYearViewInfo; + end; + + { TcxSchedulerMonthHeaderCellViewInfo } + + TcxSchedulerMonthHeaderCellViewInfo = class(TcxSchedulerDayHeaderCellViewInfo) + private + FFirstMonth: Integer; + FMonth: Integer; + FMonthCount: Integer; + FYear: Integer; + procedure SetFirstMonth(AValue: Integer); + procedure SetMonth(AValue: Integer); + procedure SetMonthCount(AValue: Integer); + procedure SetYear(AValue: Integer); + protected + FColStart: Integer; + procedure CalculateDisplayText; virtual; + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + public + property FirstMonth: Integer read FFirstMonth write SetFirstMonth; + property Month: Integer read FMonth write SetMonth; + property MonthCount: Integer read FMonthCount write SetMonthCount; + property Year: Integer read FYear write SetYear; + end; + + { TcxSchedulerYearViewContentCellViewInfo } + + TcxSchedulerYearViewContentCellViewInfo = class(TcxSchedulerMonthDayContentCellViewInfo) + protected + FColIndex: Integer; + procedure InitHitTest(AHitTest: TcxSchedulerCustomResourceViewHitTest); override; + end; + + { TcxYearViewDragEventHelper } + + TcxYearViewDragEventHelper = class(TcxDragEventHelper) + protected + procedure UpdateViewClonesTime; override; + end; + + { TcxYearViewEventSizing } + + TcxYearViewEventSizing = class(TcxEventSizingHelper) + protected + procedure UpdateEventBounds; override; + end; + + { TcxSchedulerYearViewStyles } + + TcxSchedulerYearViewGetUnusedContentStyleEvent = procedure(Sender: TcxSchedulerYearView; + AYear, AMonth, ADayOfWeek: Integer; var AStyle: TcxStyle) of object; + TcxSchedulerYearViewGetMonthHeaderStyleEvent = procedure(Sender: TcxSchedulerYearView; + AYear, AMonth: Integer; var AStyle: TcxStyle) of object; + + TcxSchedulerYearViewStyles = class(TcxStyles) + private + FScheduler: TcxCustomScheduler; + FYearView: TcxSchedulerYearView; + FOnGetMonthHeaderStyle: TcxSchedulerYearViewGetMonthHeaderStyleEvent; + FOnGetUnusedContentStyle: TcxSchedulerYearViewGetUnusedContentStyleEvent; + function GetPainter: TcxCustomLookAndFeelPainterClass; + protected + procedure Changed(AIndex: Integer); override; + procedure GetDefaultViewParams(Index: Integer; AData: TObject; + out AParams: TcxViewParams); override; + property Painter: TcxCustomLookAndFeelPainterClass read GetPainter; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + function GetMonthHeaderParams(AYear, AMonth: Integer): TcxViewParams; + function GetUnusedContentParams( + AYear, AMonth, ADayOfWeek: Integer): TcxViewParams; + + property Scheduler: TcxCustomScheduler read FScheduler; + property YearView: TcxSchedulerYearView read FYearView; + published + property MonthHeader: TcxStyle index cxcsMonthHeader read GetValue write SetValue; + property UnusedContent: TcxStyle index cxcsUnusedContent read GetValue write SetValue; + property OnGetMonthHeaderStyle: TcxSchedulerYearViewGetMonthHeaderStyleEvent read FOnGetMonthHeaderStyle write FOnGetMonthHeaderStyle; + property OnGetUnusedContentStyle: TcxSchedulerYearViewGetUnusedContentStyleEvent read FOnGetUnusedContentStyle write FOnGetUnusedContentStyle; + end; + + { TcxSchedulerYearView } + + TcxSchedulerYearView = class(TcxSchedulerCustomResourceView) + private + FAllDayEventsOnly: Boolean; + FMaxSelectedDaysCount: Integer; + FMonthHeaderPopupMenu: TcxSchedulerMonthHeaderPopupMenu; + FStyles: TcxSchedulerYearViewStyles; + FScale: Integer; + function GetHitTest: TcxSchedulerYearViewHitTest; + function GetNavigation: TcxSchedulerYearViewNavigation; + function GetViewInfo: TcxSchedulerYearViewViewInfo; + function GetYear: Word; + procedure SetAllDayEventsOnly(AValue: Boolean); + procedure SetMaxSelectedDaysCount(AValue: Integer); + procedure SetMonthHeaderPopupMenu(AValue: TcxSchedulerMonthHeaderPopupMenu); + procedure SetScale(AValue: Integer); + procedure SetStyles(AValue: TcxSchedulerYearViewStyles); + protected + procedure CreateSubClasses; override; + function CreateViewAdapter: TcxCustomResourceViewAdapter; override; + procedure DestroySubClasses; override; + function CanDeactivateOnDateNavigatorSelectionChange: Boolean; override; + function CanSelectPeriod: Boolean; override; + procedure ChangeLayout(ACurrentAnchor: TDateTime); + function CreateController: TcxSchedulerSubControlController; override; + function CreateHitTest: TcxSchedulerSubControlHitTest; override; + function CreateMonthHeaderPopupMenu: TcxSchedulerMonthHeaderPopupMenu; virtual; + function CreatePainter: TcxSchedulerSubControlPainter; override; + function CreateStyles: TcxSchedulerYearViewStyles; virtual; + function CreateViewInfo: TcxSchedulerSubControlViewInfo; override; + function DoShowPopupMenu(X, Y: Integer): Boolean; override; + function GetCompressWeekEnd: Boolean; override; + function GetGroupingKind: TcxSchedulerGroupingKind; override; + function GetFirstVisibleDate: TDateTime; override; + function GetLastVisibleDate: TDateTime; override; + function GetScrollPos: Integer; virtual; + function GetVisibleDaysRange: Integer; override; + procedure InitScrollBarsParameters; override; + procedure MakeEventVisible(AEvent: TcxSchedulerControlEvent; + const ADate: TDateTime; AResource: TcxSchedulerStorageResourceItem); override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); override; + procedure SelectedDaysChanged; override; + procedure SetGroupingKind(AValue: TcxSchedulerGroupingKind); override; + + property Navigation: TcxSchedulerYearViewNavigation read GetNavigation; + property ViewInfo: TcxSchedulerYearViewViewInfo read GetViewInfo; + public + constructor Create(AOwner: TcxCustomScheduler); override; + procedure Assign(Source: TPersistent); override; + + property HitTest: TcxSchedulerYearViewHitTest read GetHitTest; + property Year: Word read GetYear; + published + property Active; + property AllDayEventsOnly: Boolean read FAllDayEventsOnly write SetAllDayEventsOnly default False; + property MaxSelectedDaysCount: Integer read FMaxSelectedDaysCount write SetMaxSelectedDaysCount default 0; + property MonthHeaderPopupMenu: TcxSchedulerMonthHeaderPopupMenu read FMonthHeaderPopupMenu write SetMonthHeaderPopupMenu; + property Scale: Integer read FScale write SetScale default 12; + property Styles: TcxSchedulerYearViewStyles read FStyles write SetStyles; + end; + + { TcxSchedulerYearViewAdapter } + + TcxSchedulerYearViewAdapter = class(TcxCustomResourceViewAdapter, IcxSchedulerYearViewAdapter) + private + FPredefinedCurrentAnchor: TDateTime; + protected + { IUnknown } + function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + { IcxSchedulerYearViewAdapter } + function GetDayCountPerPage: Integer; virtual; + function GetFirstMonth: Integer; virtual; + function GetMonthCount: Integer; virtual; + function GetShowMonthHeaders: Boolean; virtual; + function GetShowWeekDayHeaders: Boolean; virtual; + function GetStartDayIndex: Integer; virtual; + + property PredefinedCurrentAnchor: TDateTime read FPredefinedCurrentAnchor write FPredefinedCurrentAnchor; + end; + + { TcxSchedulerMonthHeaderPopupMenu } + + TcxSchedulerMonthHeaderPopupMenuItem = (mhpmiNewEvent, mhpmiNewAllDayEvent, + mhpmiNewReccuringEvent, mhpmiFullYear, mhpmiHalfYear, mhpmiQuarter); + TcxSchedulerMonthHeaderPopupMenuItems = set of TcxSchedulerMonthHeaderPopupMenuItem; + + TcxSchedulerMonthHeaderPopupMenuPopupEvent = procedure ( + Sender: TcxSchedulerMonthHeaderPopupMenu; ABuiltInMenu: TPopupMenu; + var AHandled: Boolean) of object; + TcxSchedulerMonthHeaderPopupMenuClickEvent = procedure ( + Sender: TcxSchedulerMonthHeaderPopupMenu; + AItem: TcxSchedulerMonthHeaderPopupMenuItem; var AHandled: Boolean) of object; + + TcxSchedulerMonthHeaderPopupMenu = class(TcxSchedulerCustomContentPopupMenu) + private + FItems: TcxSchedulerMonthHeaderPopupMenuItems; + FOnPopup: TcxSchedulerMonthHeaderPopupMenuPopupEvent; + FOnClick: TcxSchedulerMonthHeaderPopupMenuClickEvent; + function GetYearView: TcxSchedulerYearView; + protected + procedure CreateItems; override; + procedure DoExecute(ACommand: Integer); override; + function DoOnClick(ACommand: Integer): Boolean; override; + function DoOnPopup: Boolean; override; + function IsValidCommand(ACommand: Integer): Boolean; override; + + property YearView: TcxSchedulerYearView read GetYearView; + public + constructor Create(AScheduler: TcxCustomScheduler); override; + procedure Assign(Source: TPersistent); override; + procedure Execute(AItem: TcxSchedulerMonthHeaderPopupMenuItem); + function GetMenuItem(AItem: TcxSchedulerMonthHeaderPopupMenuItem): TMenuItem; + published + property Items: TcxSchedulerMonthHeaderPopupMenuItems + read FItems write FItems default [mhpmiNewEvent, mhpmiNewAllDayEvent, + mhpmiNewReccuringEvent, mhpmiFullYear, mhpmiHalfYear, mhpmiQuarter]; + property PopupMenu; + property UseBuiltInPopupMenu; + + property OnClick: TcxSchedulerMonthHeaderPopupMenuClickEvent read FOnClick write FOnClick; + property OnPopup: TcxSchedulerMonthHeaderPopupMenuPopupEvent read FOnPopup write FOnPopup; + end; + +implementation + +const + DayInc: array[Boolean] of Integer = (-1, 1); + YearScales: array[0..2] of Integer = (12, 6, 3); + +type + TcxSchedulerCustomViewInfoItemAccess = class(TcxSchedulerCustomViewInfoItem); + TcxSchedulerCustomViewViewInfoAccess = class(TcxSchedulerCustomViewViewInfo); + +{ TcxSchedulerYearViewController } + +function TcxSchedulerYearViewController.CreateDragEventHelper: TcxDragEventHelper; +begin + Result := TcxYearViewDragEventHelper.Create(Scheduler); +end; + +function TcxSchedulerYearViewController.CreateNavigation: TcxSchedulerViewNavigation; +begin + Result := TcxSchedulerYearViewNavigation.Create(View); +end; + +function TcxSchedulerYearViewController.CreateResizeEventHelper: TcxEventSizingHelper; +begin + Result := TcxYearViewEventSizing.Create(Scheduler); +end; + +procedure TcxSchedulerYearViewController.KeyDown(var Key: Word; Shift: TShiftState); +begin + if View.Active and not EditController.IsEditing and + TcxSchedulerYearViewNavigation(Navigation).IsKeyNavigation(Key, Shift) then + TcxSchedulerYearViewNavigation(Navigation).DoKeyDown(Key, Shift) + else + inherited KeyDown(Key, Shift); +end; + +{ TcxSchedulerYearViewPainter } + +procedure TcxSchedulerYearViewPainter.Paint; +begin + inherited Paint; + ViewInfo.MonthHeaderCells.Draw(Canvas, DrawHeaderCell); + ViewInfo.DayHeaderCells.Draw(Canvas, DrawHeaderCell); + ViewInfo.ContentCells.Draw(Canvas, DrawContentCell); + ViewInfo.EventCells.Draw(Canvas, DrawEventCell); + ViewInfo.Buttons.Draw(Canvas, DrawButtonCell); + ViewInfo.NavigationButtons.Draw(Canvas, DrawButtonCell); +end; + +function TcxSchedulerYearViewPainter.GetViewInfo: TcxSchedulerYearViewViewInfo; +begin + Result := TcxSchedulerYearViewViewInfo(inherited ViewInfo); +end; + +{ TcxSchedulerYearViewEventCellViewInfo } + +procedure TcxSchedulerYearViewEventCellViewInfo.CalculateBorders; +begin + if ViewData.ContentFinish < EventFinish then + Exclude(FBorders, bRight); + if ViewData.ContentStart > EventStart then + Exclude(FBorders, bLeft); +end; + +procedure TcxSchedulerYearViewEventCellViewInfo.CalculateCaptions; +begin +end; + +procedure TcxSchedulerYearViewEventCellViewInfo.CalculateEventTimeVisibility; +var + B: Boolean; +begin + B := IsHeaderEvent and not Event.AllDayEvent; + ViewData.ShowStartTime := B and (TimeOf(Event.Start) <> 0) and + (EventStart > ViewData.ContentStart); + ViewData.ShowFinishTime := B and (TimeOf(Event.Finish) <> 0) and + (EventFinish < ViewData.ContentFinish); +end; + +function TcxSchedulerYearViewEventCellViewInfo.CanAutoHideStandardImages: Boolean; +begin + Result := True; +end; + +function TcxSchedulerYearViewEventCellViewInfo.GetForceShowClockInHeaderEvent: Boolean; +begin + Result := False; +end; + +procedure TcxSchedulerYearViewEventCellViewInfo.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + inherited InitHitTest(AHitTest); + InitHitTestForHorzEvent(AHitTest); +end; + +{ TcxSchedulerYearViewViewInfo } + +constructor TcxSchedulerYearViewViewInfo.Create( + AOwner: TcxSchedulerSubControl); +begin + inherited Create(AOwner); + FContentSmallFont := TFont.Create; + FDayCells := TList.Create; + FDayCells.Capacity := 444; + FMonthHeaderCells := TcxSchedulerViewInfoCellList.Create; + FCells.Add(FMonthHeaderCells); +end; + +destructor TcxSchedulerYearViewViewInfo.Destroy; +begin + FContentSmallFont.Free; + FDayCells.Free; + inherited Destroy; +end; + +procedure TcxSchedulerYearViewViewInfo.CalculateHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + if not MonthHeaderCells.CalculateHitTest(AHitTest) then + inherited CalculateHitTest(AHitTest); +end; + +procedure TcxSchedulerYearViewViewInfo.UpdateSelection; +var + I: Integer; + ACell: TcxSchedulerMonthDayContentCellViewInfo; +begin + with View.Navigation do + begin + Self.FSelStart := DateTimeHelper.RoundTime(Min(SelStart, SelFinish)); + Self.FSelFinish := DateTimeHelper.RoundTime(Max(SelStart, SelFinish)); + end; + for I := 0 to ContentCells.Count - 1 do + begin + ACell := TcxSchedulerMonthDayContentCellViewInfo(ContentCells[I]); + if (ACell.TimeStart <> NullDate) and ACell.UpdateSelection(not HideSelection and + (ACell.TimeStart >= SelStart) and (ACell.TimeStart <= SelFinish)) then + View.InvalidateRect(ACell.Bounds); + end; +end; + +procedure TcxSchedulerYearViewViewInfo.AddEventButtons( + APlace: TcxSchedulerEventPlace); +var + I: Integer; +begin + for I := APlace.ColStart to APlace.ColFinish do + if DaysCells[I].LineCount = 0 then + begin + AddButton(DaysCells[I].Bounds, DaysCells[I].TimeStart, True, APlace.Event); + DaysCells[I].LineCount := 1; + end; +end; + +procedure TcxSchedulerYearViewViewInfo.AddEventForCalculation( + ABuilder: TcxSchedulerEventLayoutBuilder; AEvent: TcxSchedulerControlEvent); +var + AStart, AFinish: TDateTime; + AOfs, I, AStartIndex, AFinishIndex: Integer; + AStartDay: TcxSchedulerYearViewContentCellViewInfo; +begin + if (FYearViewExtraAdapter = nil) then + begin + AStart := Max(FRangeStart, AEvent.Start); + AFinish := Min(FRangeFinish, AEvent.Finish); + AOfs := DayOfTheYear(EncodeDate(Year, FirstMonth, 1)); + I := DayOfTheYear(AStart) - AOfs; + AFinishIndex := Max(DayOfTheYear(AFinish) - 1 - AOfs, I); + while (AFinishIndex < (DaysCellCount - 1)) and + AEvent.IsDayEvent(DaysCells[AFinishIndex + 1].TimeStart) do Inc(AFinishIndex); + end + else + begin + I := 0; + while (I < DaysCellCount) and not AEvent.IsDayEvent(DaysCells[I].TimeStart) do + Inc(I); + if I = DaysCellCount then Exit; + AFinishIndex := I; + while (AFinishIndex < DaysCellCount) and + AEvent.IsDayEvent(DaysCells[AFinishIndex].TimeStart) do Inc(AFinishIndex); + Dec(AFinishIndex); + end; + while I <= AFinishIndex do + begin + AStartIndex := I; + AStartDay := DaysCells[I]; + while (I <= AFinishIndex) and (AStartDay.Bounds.Top = DaysCells[I].Bounds.Top) do + Inc(I); + ABuilder.AddEventPlace(AEvent, AStartIndex, I - 1, 1, TObject(MonthOf(AStartDay.DateTime))); + end; +end; + +procedure TcxSchedulerYearViewViewInfo.AddEventToYearView( + APlace: TcxSchedulerEventPlace); +var + ABounds: TRect; + AViewData: TcxSchedulerEventViewData; + AStart, AFinish: TDateTime; +begin + ABounds := MonthBounds[Integer(APlace.Resource)]; + with DaysCells[APlace.ColStart] do + begin + AStart := TimeStart; + ABounds.Left := Bounds.Left + cxTextOffset; + end; + with DaysCells[APlace.ColFinish] do + begin + AFinish := TimeFinish; + ABounds.Right := Bounds.Right - cxTextOffset - 1; + end; + ABounds.Top := ABounds.Top + APlace.LineStart * (ContentLineHeight + cxTextOffset); + ABounds.Bottom := ABounds.Top + ContentLineHeight; + OffsetRect(ABounds, 0, FDayTextHeight); + AViewData := CreateEventViewData(TcxSchedulerControlEvent(APlace.Event), + ABounds, AStart, AFinish, nil); + AViewData.VisibleRect := MonthBounds[Integer(APlace.Resource)]; + Dec(AViewData.VisibleRect.Bottom, cxTextOffset); + if AViewData.Bounds.Bottom > AViewData.VisibleRect.Bottom then + begin + //todo: lcm if not AViewData.Event.IsClone then + AddEventButtons(APlace); + AViewData.Free + end + else + AddEventCell(AViewData); +end; + +function TcxSchedulerYearViewViewInfo.AddMonthHeader(AYear, AMonth: Integer; + const ARect: TRect; AFirstMonth, AMonthCount: Integer): TcxSchedulerMonthHeaderCellViewInfo; +var + AParams: TcxViewParams; +begin + AParams := View.Styles.GetMonthHeaderParams(AYear, AMonth); + CreateCellInstance(TcxSchedulerMonthHeaderCellViewInfo, ARect, + AParams, Result); + Result.Month := AMonth; + Result.Year := AYear; + Result.RotateHeader := True; + Result.FirstMonth := AFirstMonth; + Result.MonthCount := AMonthCount; + MonthHeaderCells.Add(Result); +end; + +function TcxSchedulerYearViewViewInfo.AddWeekDayHeader(AWeekDay: Integer; + ARect: TRect): TcxSchedulerWeekDayHeaderCellViewInfo; +begin + Inc(AWeekDay, Integer(View.StartOfWeek)); + if AWeekDay >= 7 then Dec(AWeekDay, 7); + CreateCellInstance(TcxSchedulerWeekDayHeaderCellViewInfo, ARect, + StylesAdapter.GetDayHeaderParams(AWeekDay), + Result); + Result.DateTime := AWeekDay; + DayHeaderCells.Add(Result); +end; + +function TcxSchedulerYearViewViewInfo.AddYearViewContentCell( + ARect: TRect; ADate: TDate; ASelected: Boolean; + AParams: TcxViewParams; AColIndex: Integer): TcxSchedulerYearViewContentCellViewInfo; +var + AColor: TColor; +begin + CreateCellInstance(TcxSchedulerYearViewContentCellViewInfo, + ARect, AParams, Result); + Result.FSmallFont := True; + Result.SmallTextFont := GetSmallFont(AParams); + if ADate <> NullDate then + begin + Result.SetTime(ADate, ADate + 1); + Result.SetContentState(True, ASelected, FDayTextHeight - cxTextOffset, FSelectionParams); + AColor := StylesAdapter.GetContentParams(ADate, True, nil).Color; + Result.Color := PainterHelper.GetContentColor(AColor, + View.IsWorkTime(nil, ADate + View.WorkStart)); + FDayCells.Add(Result); + end; + Result.LineCount := 0; + Result.FColIndex := AColIndex; + ContentCells.Add(Result); +end; + +procedure TcxSchedulerYearViewViewInfo.CalculateContentCellMonthParams( + AMonth: Integer; out AMonthBounds: TRect; out AStartOfMonth: TDate; + out AStartMonthColumn, ADaysPerMonth: Integer); +begin + AMonthBounds := FMonthHeaderCells[AMonth + 1].Bounds; + AStartOfMonth := EncodeDate(Year, AMonth + FirstMonth, 1); + AStartMonthColumn := DayOfWeek(AStartOfMonth) - 1; + Dec(AStartMonthColumn, Integer(View.GetStartOfWeek)); + if AStartMonthColumn < 0 then + Inc(AStartMonthColumn, 7); + ADaysPerMonth := DaysPerMonth(Year, AMonth + FirstMonth); + TcxSchedulerMonthHeaderCellViewInfo(FMonthHeaderCells[AMonth + 1]).FColStart := AStartMonthColumn; +end; + +procedure TcxSchedulerYearViewViewInfo.CalculateContentCells; +var + I, J: Integer; + R, DayBounds, MonthBounds: TRect; + AStartOfMonth, ADate: TDate; + ACell: TcxSchedulerYearViewContentCellViewInfo; + AStartMonthColumn, ADaysPerMonth: Integer; + ASelected: Boolean; + AParams: TcxViewParams; +begin + FMaxEventsCount := 0; + for I := 0 to MonthCountPerPage - 1 do + begin + CalculateContentCellMonthParams(I, MonthBounds, AStartOfMonth, + AStartMonthColumn, ADaysPerMonth); + for J := 0 to FMaxYearViewWeekDays - 1 do + begin + DayBounds := DayHeaderCells[J].Bounds; + R := Rect(DayBounds.Left, MonthBounds.Top, + DayBounds.Right, MonthBounds.Bottom); + ADate := GetMonthColumnDate(AStartOfMonth, ADaysPerMonth, + AStartMonthColumn, J + FStartDayIndex); + ASelected := not HideSelection and + (ADate >= SelStart) and (ADate <= SelFinish); + if ADate = NullDate then + AParams := View.Styles.GetUnusedContentParams(FYear, (I + FirstMonth), + (Byte(View.OptionsView.ActualStartOfWeek) + J + FStartDayIndex) mod 7) + else + AParams := GetContentParams(ADate, nil); + ACell := AddYearViewContentCell(R, ADate, ASelected, AParams, J); + FMaxEventsCount := Max(FMaxEventsCount, (R.Bottom - R.Top) div FContentLineHeight + 1); + if I < MonthCountPerPage then + ACell.Borders := [bBottom, bRight] + else + ACell.Borders := [bRight]; + end; + end; +end; + +procedure TcxSchedulerYearViewViewInfo.CalculateContentNavigationButtons; +var + ABounds: TRect; +begin + ABounds := Bounds; + ABounds.Left := ABounds.Left + FMonthHeaderWidth; + if IsValidNavigationButtonsPlace(ABounds) then + AddContentNavigationButton(ABounds, -1, cprSingle); +end; + +procedure TcxSchedulerYearViewViewInfo.CalculateDaysHeader; +var + R: TRect; + I, W: Integer; +begin + W := Bounds.Right - Bounds.Left - FMonthHeaderWidth + 1; + R := cxRectSetHeight(Bounds, FDayHeaderHeight); + for I := 0 to FMaxYearViewWeekDays - 1 do + begin + R.Left := FMonthHeaderWidth + MulDiv(W, I, FMaxYearViewWeekDays); + R.Right := FMonthHeaderWidth + MulDiv(W, I + 1, FMaxYearViewWeekDays); + AddWeekDayHeader(((I + FStartDayIndex) mod 7), R); + end; + ProcessCheckBorders(DayHeaderCells, True, [nLeft]); + ProcessDateToDisplayText(True); +end; + +procedure TcxSchedulerYearViewViewInfo.CalculateEventsViewInfo; +var + I: Integer; + AEvent: TcxSchedulerControlEvent; + ABuilder: TcxSchedulerEventLayoutBuilder; +begin + ABuilder := TcxSchedulerEventLayoutBuilder.Create; + try + for I := 0 to Events.AbsoluteCount - 1 do + begin + AEvent := Events.AbsoluteItems[I]; + if IsEventVisible(AEvent) then + AddEventForCalculation(ABuilder, AEvent); + end; + ABuilder.Calculate; + for I := 0 to DaysCellCount - 1 do + DaysCells[I].LineCount := 0; + for I := ABuilder.EventPlaceCount - 1 downto 0 do + AddEventToYearView(ABuilder.EventPlaces[I]); + finally + ABuilder.Free; + end; +end; + +procedure TcxSchedulerYearViewViewInfo.CalculateMetrics; +begin + inherited CalculateMetrics; + if FYearViewExtraAdapter = nil then + FYear := View.Year + else + FYear := YearOf(SelectedDays[0]); + FDayTextHeight := Round(FContentFontHeight * 2 / 3); +end; + +procedure TcxSchedulerYearViewViewInfo.CalculateMonthHeaderWidth; +var + I: Integer; + AFont: TFont; + AStyle: TcxStyle; +begin + if not FShowMonthHeaders then + begin + FMonthHeaderWidth := 0; + Exit; + end; + AStyle := View.Styles.MonthHeader; + if (AStyle <> nil) and (cxStyles.svFont in AStyle.AssignedValues) then + AFont := AStyle.Font + else + AFont := DefaultFont; + FMonthHeaderWidth := cxTextWidth(AFont, 'WWWW') + 4 * cxTextOffset; + for I := 1 to 12 do + FMonthHeaderWidth := Max(FMonthHeaderWidth, + cxTextWidth(AFont, LongMonthNames[I]) + 4 * cxTextOffset); +end; + +procedure TcxSchedulerYearViewViewInfo.CalculateMonthsHeader; +var + R: TRect; + I, H: Integer; +begin + CalculateMonthHeaderWidth; + H := Bounds.Bottom - Bounds.Top - FDayHeaderHeight; + R := cxRectSetHeight(cxRectSetWidth(Bounds, FMonthHeaderWidth), + FDayHeaderHeight); + AddMonthHeader(FYear, 0, R, AdapterFirstMonth, AdapterMonthCount).RotateHeader := False; + for I := 0 to MonthCountPerPage - 1 do + begin + R.Top := MulDiv(H, I, MonthCountPerPage) + FDayHeaderHeight; + R.Bottom := MulDiv(H, I + 1, MonthCountPerPage) + FDayHeaderHeight; + AddMonthHeader(FYear, I + FirstMonth, R); + end; + ProcessCheckBorders(MonthHeaderCells, True, [], []); +end; + +procedure TcxSchedulerYearViewViewInfo.CheckLayout(ADate: TDateTime); +begin + if (ADate < Trunc(TcxSchedulerCustomViewInfoItemAccess(FDayCells[0]).FDateTime)) or + (ADate > Trunc(TcxSchedulerCustomViewInfoItemAccess(FDayCells[FDayCells.Count - 1]).FDateTime)) then + begin + View.Changed; + View.ChangeLayout(ADate); + end; +end; + +procedure TcxSchedulerYearViewViewInfo.Clear; +begin + FDayCells.Clear; + FMonthHeaderCells.Clear; + inherited Clear; +end; + +function TcxSchedulerYearViewViewInfo.ContentCellClass: TcxSchedulerContentCellViewInfoClass; +begin + Result := TcxSchedulerYearViewContentCellViewInfo; +end; + +function TcxSchedulerYearViewViewInfo.CreateEventCellViewInfo( + AViewData: TcxSchedulerEventViewData): TcxSchedulerEventCellViewInfo; +begin + Result := TcxSchedulerYearViewEventCellViewInfo.Create(AViewData); +end; + +function TcxSchedulerYearViewViewInfo.GetPartOfTheYear(ADate: TDateTime): Word; +var + AYear, AMonth, ADay: Word; +begin + DecodeDate(ADate, AYear, AMonth, ADay); + Result := 0; + while AMonth >= (Result + 1) * AdapterMonthCount + 1 do + Inc(Result); +end; + +procedure TcxSchedulerYearViewViewInfo.DoCalculate; +var + ADate: TDateTime; +begin + ADate := SelectedDays[0]; + SelectedDays.Clear; + SelectedDays.Add(ADate); + PrepareSmallContentFont; + FStartDayIndex := 0; + FShowMonthHeaders := True; + FMaxYearViewWeekDays := MaxYearViewWeekDays; + Supports(TObject(Adapter), IcxSchedulerYearViewAdapter, FYearViewExtraAdapter); + try + inherited DoCalculate; + if FYearViewExtraAdapter <> nil then + begin + if not FYearViewExtraAdapter.GetShowWeekDayHeaders then + FDayHeaderHeight := 0; + FShowMonthHeaders := FYearViewExtraAdapter.GetShowMonthHeaders; + FStartDayIndex := FYearViewExtraAdapter.GetStartDayIndex; + FMaxYearViewWeekDays := FYearViewExtraAdapter.GetDayCountPerPage; + FAdapterFirstMonth := FYearViewExtraAdapter.GetFirstMonth; + FAdapterMonthCount := FYearViewExtraAdapter.GetMonthCount; + end; + FRangeStart := Trunc(EncodeDate(Year, FirstMonth, 1)); + FRangeFinish := Trunc(EndOfTheMonth(EncodeDate(Year, + FirstMonth + GetMonthCountPerPage - 1, 1))); + + CalculateMonthsHeader; + CalculateDaysHeader; + CalculateContentCells; + CalculateEventsViewInfo; + CalculateContentNavigationButtons; + finally + FYearViewExtraAdapter := nil; + end; +end; + +procedure TcxSchedulerYearViewViewInfo.DoContentNavigationButtonClick( + Sender: TcxSchedulerContentNavigationButtonViewInfo); +var + ARequiredDay: TDateTime; +begin + ARequiredDay := SelectedDays[0] + Sender.Interval; + View.Navigation.FCurrentAnchor := ARequiredDay; + CheckLayout(ARequiredDay); +end; + +function TcxSchedulerYearViewViewInfo.GetMonthColumnDate( + AStartOfMonth: TDateTime; + ADaysPerMonth, AStartMonthColumn, AColumn: Integer): TDateTime; +begin + Result := NullDate; + Dec(AColumn, AStartMonthColumn); + if (AColumn >= 0) and (AColumn < ADaysPerMonth) then + Result := AStartOfMonth + AColumn; +end; + +function TcxSchedulerYearViewViewInfo.GetSmallFont(const AParams: TcxViewParams): TFont; +begin + if AParams.Font = FContentFont then + Result := FContentSmallFont + else + Result := nil; +end; + +function TcxSchedulerYearViewViewInfo.GetFirstMonth: Integer; +begin + if FYearViewExtraAdapter = nil then + Result := 1 + else + Result := FYearViewExtraAdapter.GetFirstMonth; +end; + +function TcxSchedulerYearViewViewInfo.GetMonthCountPerPage: Integer; +begin + if FYearViewExtraAdapter = nil then + Result := 12 + else + Result := FYearViewExtraAdapter.GetMonthCount; +end; + +function TcxSchedulerYearViewViewInfo.IsEventVisible( + AEvent: TcxSchedulerControlEvent): Boolean; +begin + Result := not View.AllDayEventsOnly or (AEvent.AllDayEvent or (AEvent.Duration > 1)); + if Result then + Result := (DateOf(AEvent.Start) <= FRangeFinish) and + (AEvent.Finish > FRangeStart); +end; + +procedure TcxSchedulerYearViewViewInfo.PrepareSmallContentFont; +begin + FContentFont := StylesAdapter.GetContentParams(NullDate, Nil).Font; + FContentSmallFont.Assign(FContentFont); + FContentSmallFont.Size := Round(FContentFont.Size * 2 / 3); +end; + +function TcxSchedulerYearViewViewInfo.GetAdapterFirstMonth: Integer; +begin + Result := Max(FAdapterFirstMonth, 1); +end; + +function TcxSchedulerYearViewViewInfo.GetAdapterMonthCount: Integer; +begin + Result := FAdapterMonthCount; + if (Result < 1) or (Result > 12) then + Result := 12; +end; + +function TcxSchedulerYearViewViewInfo.GetDaysCell( + AIndex: Integer): TcxSchedulerYearViewContentCellViewInfo; +begin + Result := TcxSchedulerYearViewContentCellViewInfo(FDayCells.List^[AIndex]) +end; + +function TcxSchedulerYearViewViewInfo.GetDaysCellCount: Integer; +begin + Result := FDayCells.Count; +end; + +function TcxSchedulerYearViewViewInfo.GetMonthBounds(AIndex: Integer): TRect; +begin + Result := MonthHeaderCells[AIndex - FirstMonth + 1].Bounds; + Result.Left := Result.Right; + Result.Right := Bounds.Right; +end; + +function TcxSchedulerYearViewViewInfo.GetYearView: TcxSchedulerYearView; +begin + Result := TcxSchedulerYearView(inherited View); +end; + +{ TcxSchedulerYearViewNavigation } + +procedure TcxSchedulerYearViewNavigation.KeyDown(var AKey: Word; + AShift: TShiftState); +begin + CorrectCurrentAnchor; + FCanChangeSelection := True; + case AKey of + VK_Left, VK_Right: + GotoNextCellHorz(AKey = VK_RIGHT); + VK_UP, VK_DOWN: + GotoNextCellVert(AKey = VK_DOWN); + VK_HOME, VK_END: + GotoCornerCell(AKey = VK_END); + VK_NEXT, VK_PRIOR: + GotoNextPage(AKey = VK_NEXT); + end; + if ViewInfo.FYearViewExtraAdapter <> nil then + TcxSchedulerYearViewAdapter(ViewInfo.FYearViewExtraAdapter).PredefinedCurrentAnchor := + FCurrentAnchor; + ViewInfo.CheckLayout(FCurrentAnchor); + SetSelAnchor(FCurrentAnchor, AShift); +end; + +procedure TcxSchedulerYearViewNavigation.ValidateSelection( + var ASelStart, ASelFinish: TDateTime; + var AResource: TcxSchedulerStorageResourceItem); +begin + AResource := nil; + FCanChangeSelection := FCanChangeSelection or View.HitTest.HitAtTime; + if not FCanChangeSelection then + begin + ASelStart := FSaveSelStart; + ASelFinish := FSaveSelFinish; + end; + ASelStart := Min(Max(ASelStart, View.FirstVisibleDate), View.LastVisibleDate); + ASelFinish := Min(Max(ASelFinish, View.FirstVisibleDate), View.LastVisibleDate); + if (View.MaxSelectedDaysCount > 0) then + ASelFinish := Max(Min(ASelFinish, ASelStart + View.MaxSelectedDaysCount - 1), + ASelStart - View.MaxSelectedDaysCount + 1); + FSaveSelFinish := ASelFinish; + FSaveSelStart := ASelStart; + FCanChangeSelection := False; +end; + +function TcxSchedulerYearViewNavigation.ContentCell( + AIndex: Integer): TcxSchedulerYearViewContentCellViewInfo; +begin + Result := TcxSchedulerYearViewContentCellViewInfo(ViewInfo.ContentCells.List^[AIndex]); +end; + +procedure TcxSchedulerYearViewNavigation.CorrectCurrentAnchor; +begin + FCurrentAnchor := Min(Max(FCurrentAnchor, View.FirstVisibleDate), + View.LastVisibleDate); +end; + +procedure TcxSchedulerYearViewNavigation.DoKeyDown( + var AKey: Word; AShift: TShiftState); +var + APrevCurrentAnchor: TDateTime; +begin + if Scheduler.SelectedEventCount > 0 then + Scheduler.UnselectEvents; + FCurrentAnchor := SelAnchor; + FCurrentResource := SelResource; + APrevCurrentAnchor := FCurrentAnchor; + FShift := AShift; + KeyDown(AKey, AShift); + if YearOf(APrevCurrentAnchor) = YearOf(FCurrentAnchor) then + ViewInfo.UpdateSelection; +end; + +procedure TcxSchedulerYearViewNavigation.GotoCornerCell(AGotoEnd: Boolean); +var + AMonth, AYear, ADay: Word; +begin + if ssCtrl in FShift then + begin + if AGotoEnd then + FCurrentAnchor := View.LastVisibleDate + else + FCurrentAnchor := View.FirstVisibleDate; + end + else + begin + DecodeDate(FCurrentAnchor, AYear, AMonth, ADay); + if AGotoEnd then + FCurrentAnchor := EncodeDate(AYear, AMonth, DaysPerMonth(AYear, AMonth)) + else + FCurrentAnchor := EncodeDate(AYear, AMonth, 1); + end; +end; + +procedure TcxSchedulerYearViewNavigation.GotoNextCellHorz(AGotoNext: Boolean); +begin + FCurrentAnchor := FCurrentAnchor + DayInc[AGotoNext]; +end; + +procedure TcxSchedulerYearViewNavigation.GotoNextCellVert(AGoForward: Boolean); + + function DayOfTheRange(ACurrentAnchor: TDateTime): Word; + var + AYear, AMonth, ADay: Word; + begin + DecodeDate(ACurrentAnchor, AYear, AMonth, ADay); + Result := Trunc(ACurrentAnchor) - + Trunc(EncodeDate(AYear, ViewInfo.AdapterFirstMonth, 1)) + 1; + end; + +var + AYear, AMonth, ADay, APart: Word; + AIndex, AColIndex: Integer; +begin + APart := ViewInfo.GetPartOfTheYear(FCurrentAnchor); + DecodeDate(FCurrentAnchor, AYear, AMonth, ADay); + IncAMonth(AYear, AMonth, ADay, DayInc[AGoForward]); + if (AYear = ViewInfo.Year) and + (APart = ViewInfo.GetPartOfTheYear(EncodeDate(AYear, AMonth, ADay))) then + begin + AIndex := ViewInfo.FContentCells.IndexOf(ViewInfo.DaysCells[DayOfTheRange(FCurrentAnchor) - 1]); + AColIndex := ContentCell(AIndex).FColIndex; + AIndex := AIndex + DayInc[AGoForward]; + while ContentCell(AIndex).FColIndex <> AColIndex do + Inc(AIndex, DayInc[AGoForward]); + while ContentCell(AIndex).TimeStart = NullDate do + Inc(AIndex, DayInc[AColIndex < 20]); + FCurrentAnchor := ContentCell(AIndex).TimeStart; + end + else + FCurrentAnchor := EncodeDate(AYear, AMonth, ADay); +end; + +procedure TcxSchedulerYearViewNavigation.GotoNextPage(AGotoForward: Boolean); +var + AYear, AMonth, ADay: Word; + ANewMonth: Integer; +begin + DecodeDate(FCurrentAnchor, AYear, AMonth, ADay); + ANewMonth := AMonth; + Inc(ANewMonth, DayInc[AGotoForward] * ViewInfo.AdapterMonthCount); + if ANewMonth < 1 then + begin + Dec(AYear); + Inc(ANewMonth, 12); + end; + if ANewMonth > 12 then + begin + Inc(AYear); + Dec(ANewMonth, 12); + end; + AMonth := ANewMonth; + ADay := Min(ADay, DayOfTheMonth(EndOfAMonth(AYear, AMonth))); + FCurrentAnchor := EncodeDate(AYear, AMonth, ADay); +end; + +function TcxSchedulerYearViewNavigation.GetYearView: TcxSchedulerYearView; +begin + Result := TcxSchedulerYearView(inherited View); +end; + +function TcxSchedulerYearViewNavigation.GetYearViewInfo: TcxSchedulerYearViewViewInfo; +begin + Result := TcxSchedulerYearViewViewInfo(inherited ViewInfo); +end; + +{ TcxSchedulerMonthHeaderCellViewInfo } + +procedure TcxSchedulerMonthHeaderCellViewInfo.CalculateDisplayText; + + function GetPartOfYear: string; + begin + if MonthCount = 0 then Exit; + Result := ''; + if MonthCount = 6 then + Result := Result + scxHalfYearShort + else + if MonthCount = 3 then + Result := Result + scxQuarterShort; + if MonthCount <> 12 then + Result := Result + IntToStr(FirstMonth div MonthCount + 1) + ' '; + end; + +begin + DateTime := NullDate; + if FMonth = 0 then + DisplayText := GetPartOfYear + IntToStr(FYear) + else + DisplayText := LongMonthNames[FMonth]; +end; + +procedure TcxSchedulerMonthHeaderCellViewInfo.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + if FMonth = 0 then + TcxSchedulerYearViewHitTest(AHitTest).SetHitTime(htcYear, EncodeDate(Year, 1, 1)) + else + TcxSchedulerYearViewHitTest(AHitTest).SetHitTime(htcMonth, EncodeDate(Year, FMonth, 1)); +end; + +procedure TcxSchedulerMonthHeaderCellViewInfo.SetFirstMonth(AValue: Integer); +begin + FFirstMonth := AValue; + CalculateDisplayText; +end; + +procedure TcxSchedulerMonthHeaderCellViewInfo.SetMonth(AValue: Integer); +begin + FMonth := AValue; + CalculateDisplayText; +end; + +procedure TcxSchedulerMonthHeaderCellViewInfo.SetMonthCount(AValue: Integer); +begin + FMonthCount := AValue; + CalculateDisplayText; +end; + +procedure TcxSchedulerMonthHeaderCellViewInfo.SetYear(AValue: Integer); +begin + FYear := AValue; + CalculateDisplayText; +end; + +{ TcxSchedulerYearViewContentCellViewInfo } + +procedure TcxSchedulerYearViewContentCellViewInfo.InitHitTest( + AHitTest: TcxSchedulerCustomResourceViewHitTest); +begin + if Self.TimeStart <> NullDate then + inherited InitHitTest(AHitTest); +end; + +{ TcxYearViewDragEventHelper } + +procedure TcxYearViewDragEventHelper.UpdateViewClonesTime; +var + I: Integer; + ANewStart, ADelta: TDateTime; + AShift: TDateTime; + View: TcxSchedulerYearView; +begin + View := TcxSchedulerYearViewViewInfo(ViewInfo).GetYearView; + AShift := HitTest.Time - Controller.StartDragHitTime; + for I := 0 to Clones.Count - 1 do + begin + ANewStart := AShift + Clones[I].Source.Start; + ADelta := Max(0, View.GetFirstVisibleDate - DateOf(ANewStart)); + if ADelta = 0 then + begin + ADelta := Min(0, View.GetLastVisibleDate - DateOf(ANewStart) - + DateOf(Clones[I].Duration) + Ord(Clones[I].AllDayEvent)); + end; + Clones[I].MoveTo(ANewStart + ADelta); + end; +end; + +{ TcxYearViewEventSizing } + +procedure TcxYearViewEventSizing.UpdateEventBounds; +begin + if Event.AllDayEvent then + inherited UpdateEventBounds + else + begin + if Controller.DragKind = edkResizeStart then + begin + Event.AllDayEvent := TimeOf(Event.Finish) = 0; + Event.Start := HitTest.Time; + end + else + begin + Event.AllDayEvent := TimeOf(Event.Start) = 0; + if Event.AllDayEvent then + Event.Finish := HitTest.Time + else + Event.Finish := HitTest.Time + 1; + end; + CheckEventState(Event); + RefreshCurrentView; + end; +end; + +{ TcxSchedulerYearViewStyles } + +constructor TcxSchedulerYearViewStyles.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FYearView := TcxSchedulerYearView(GetOwner); + FScheduler := FYearView.Scheduler; + BitmapInViewParams := True; +end; + +procedure TcxSchedulerYearViewStyles.Assign(Source: TPersistent); +var + I: Integer; +begin + if Source is TcxSchedulerYearViewStyles then + for I := 0 to cxcsMaxYearViewStyle do + SetValue(I, TcxSchedulerYearViewStyles(Source).GetValue(I)); + inherited Assign(Source); +end; + +function TcxSchedulerYearViewStyles.GetMonthHeaderParams( + AYear, AMonth: Integer): TcxViewParams; +var + AStyle: TcxStyle; +begin + AStyle := nil; + if Assigned(FOnGetMonthHeaderStyle) then + FOnGetMonthHeaderStyle(YearView, AYear, AMonth, AStyle); + GetViewParams(cxcsMonthHeader, nil, AStyle, Result); +end; + +function TcxSchedulerYearViewStyles.GetUnusedContentParams( + AYear, AMonth, ADayOfWeek: Integer): TcxViewParams; +var + AStyle: TcxStyle; +begin + AStyle := nil; + if Assigned(FOnGetUnusedContentStyle) then + FOnGetUnusedContentStyle(YearView, AYear, AMonth, ADayOfWeek, AStyle); + GetViewParams(cxcsUnusedContent, Pointer(ADayOfWeek), AStyle, Result); + {with YearView do + begin + if (AStyle = nil) or not (svColor in AStyle.AssignedValues) then + begin + Result.Color := PainterHelper.GetContentColor(Result.Color, + TDay(ADayOfWeek) in OptionsView.WorkDays); + end; + end;} //Do the same as GetDefaultViewParams +end; + +procedure TcxSchedulerYearViewStyles.Changed(AIndex: Integer); +begin + inherited Changed(AIndex); + FYearView.Refresh; +end; + +procedure TcxSchedulerYearViewStyles.GetDefaultViewParams(Index: Integer; + AData: TObject; out AParams: TcxViewParams); +begin + AParams.Bitmap := nil; + AParams.Font := Scheduler.Font; + AParams.TextColor := clBlack; + AParams.Color := Scheduler.Color; + case Index of + cxcsUnusedContent: + begin + with FYearView do + begin + AParams.Color := PainterHelper.GetContentColor( + clBtnFace, TDay(Integer(AData)) in OptionsView.WorkDays); + end; + end; + cxcsMonthHeader: + begin + AParams.Color := Painter.DefaultHeaderColor; + AParams.TextColor := Painter.DefaultHeaderTextColor; + end; + end; +end; + +function TcxSchedulerYearViewStyles.GetPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := FYearView.LookAndFeelPainter; +end; + +{ TcxSchedulerYearView } + +constructor TcxSchedulerYearView.Create(AOwner: TcxCustomScheduler); +begin + inherited Create(AOwner); + FScale := 12; +end; + +procedure TcxSchedulerYearView.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerYearView then + with TcxSchedulerYearView(Source) do + begin + Self.FMaxSelectedDaysCount := FMaxSelectedDaysCount; + Self.FAllDayEventsOnly := FAllDayEventsOnly; + Self.FMonthHeaderPopupMenu := FMonthHeaderPopupMenu; + Self.FStyles.Assign(FStyles); + Self.FScale := FScale; + end; + inherited Assign(Source); +end; + +procedure TcxSchedulerYearView.CreateSubClasses; +begin + FStyles := CreateStyles; + inherited CreateSubClasses; + FMonthHeaderPopupMenu := CreateMonthHeaderPopupMenu; +end; + +function TcxSchedulerYearView.CreateViewAdapter: TcxCustomResourceViewAdapter; +begin + Result := TcxSchedulerYearViewAdapter.Create(Self); +end; + +procedure TcxSchedulerYearView.DestroySubClasses; +begin + FMonthHeaderPopupMenu.Free; + inherited DestroySubClasses; + FStyles.Free; +end; + +function TcxSchedulerYearView.CanDeactivateOnDateNavigatorSelectionChange: Boolean; +begin + Result := False; +end; + +function TcxSchedulerYearView.CanSelectPeriod: Boolean; +begin + Result := False; +end; + +procedure TcxSchedulerYearView.ChangeLayout(ACurrentAnchor: TDateTime); +begin + Scheduler.DateNavigator.BeginUpdate; + try + SelectedDays.Clear; + SelectedDays.Add(EncodeDate(YearOf(ACurrentAnchor), + ViewInfo.GetPartOfTheYear(ACurrentAnchor) * + ViewInfo.AdapterMonthCount + 1, 1)); + UpdateDateNavigatorSelection; + Changed; + Scheduler.FullRefresh; + finally + Scheduler.DateNavigator.EndUpdate; + end; +end; + +function TcxSchedulerYearView.CreateController: TcxSchedulerSubControlController; +begin + Result := TcxSchedulerYearViewController.Create(Self); +end; + +function TcxSchedulerYearView.CreateHitTest: TcxSchedulerSubControlHitTest; +begin + Result := TcxSchedulerYearViewHitTest.Create(Self); +end; + +function TcxSchedulerYearView.CreateMonthHeaderPopupMenu: TcxSchedulerMonthHeaderPopupMenu; +begin + Result := TcxSchedulerMonthHeaderPopupMenu.Create(Scheduler); +end; + +function TcxSchedulerYearView.CreatePainter: TcxSchedulerSubControlPainter; +begin + Result := TcxSchedulerYearViewPainter.Create(Self); +end; + +function TcxSchedulerYearView.CreateStyles: TcxSchedulerYearViewStyles; +begin + Result := TcxSchedulerYearViewStyles.Create(Self); +end; + +function TcxSchedulerYearView.CreateViewInfo: TcxSchedulerSubControlViewInfo; +begin + Result := TcxSchedulerYearViewViewInfo.Create(Self); +end; + +function TcxSchedulerYearView.DoShowPopupMenu(X, Y: Integer): Boolean; +begin + if HitTest.HitAtMonth then + Result := MonthHeaderPopupMenu.Popup(X, Y) + else + Result := inherited DoShowPopupMenu(X, Y); +end; + +function TcxSchedulerYearView.GetCompressWeekEnd: Boolean; +begin + Result := False; +end; + +function TcxSchedulerYearView.GetGroupingKind: TcxSchedulerGroupingKind; +begin + Result := gkNone; +end; + +function TcxSchedulerYearView.GetFirstVisibleDate: TDateTime; +begin + Result := EncodeDate(Year, ViewInfo.AdapterFirstMonth, 1); +end; + +function TcxSchedulerYearView.GetLastVisibleDate: TDateTime; +var + AMonth: Integer; +begin + AMonth := ViewInfo.AdapterFirstMonth + ViewInfo.AdapterMonthCount - 1; + Result := EncodeDate(Year, AMonth, DayOfTheMonth(EndOfAMonth(Year, AMonth))); +end; + +function TcxSchedulerYearView.GetScrollPos: Integer; +var + AMonthCount: Integer; +begin + AMonthCount := ViewInfo.AdapterMonthCount; + if AMonthCount <> 0 then + Result := Max(cxYearViewScrollMinPos, + Min(MulDiv(cxYearViewScrollMaxPos, 12, AMonthCount), + MulDiv((Year - YearOf(Now)), 12, AMonthCount) + + ViewInfo.AdapterFirstMonth div AMonthCount - + ViewInfo.GetPartOfTheYear(Now) + + MulDiv(cxYearViewScrollCurrentYearPos, 12, AMonthCount))) + else + Result := Max(cxYearViewScrollMinPos, Min(cxYearViewScrollMaxPos, + (Year - YearOf(Now) + cxYearViewScrollCurrentYearPos))); +end; + +function TcxSchedulerYearView.GetVisibleDaysRange: Integer; +begin + Result := Trunc(GetLastVisibleDate - GetFirstVisibleDate); +end; + +procedure TcxSchedulerYearView.InitScrollBarsParameters; +var + APos: Integer; +begin + inherited InitScrollBarsParameters; + APos := GetScrollPos; + SetScrollBarInfo(sbVertical, cxYearViewScrollMinPos, + MulDiv(cxYearViewScrollMaxPos, 12, ViewInfo.AdapterMonthCount), + 1, 1, APos, True, True); +end; + +procedure TcxSchedulerYearView.MakeEventVisible(AEvent: TcxSchedulerControlEvent; + const ADate: TDateTime; AResource: TcxSchedulerStorageResourceItem); +begin + if ADate <> NullDate then + begin + ViewInfo.CheckLayout(ADate); + LayoutChanged; + end; +end; + +procedure TcxSchedulerYearView.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) then + begin + if AComponent = Styles.UnusedContent then + Styles.UnusedContent := nil; + if AComponent = Styles.MonthHeader then + Styles.MonthHeader := nil; + end; + MonthHeaderPopupMenu.Notification(AComponent, Operation); +end; + +procedure TcxSchedulerYearView.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +var + AYear, AMonth, AMonthCount: Integer; + ANavigation: TcxSchedulerYearViewNavigation; +begin + ANavigation := TcxSchedulerYearViewNavigation(Navigation); + HideHintOnScroll(AScrollCode); + AMonthCount := ViewInfo.AdapterMonthCount; + if AMonthCount = 0 then + AYear := YearOf(Now) - cxYearViewScrollCurrentYearPos + AScrollPos + else + AYear := MulDiv(YearOf(Now) - cxYearViewScrollCurrentYearPos, 12, AMonthCount) + + ViewInfo.GetPartOfTheYear(Now) + AScrollPos; + ANavigation.CorrectCurrentAnchor; + case AScrollCode of + scTrack: + begin + ShowHintOnScroll(IntToStr(AYear), sbHorizontal); + Exit; + end; + scPosition: + if AMonthCount = 0 then + ViewInfo.CheckLayout(EncodeDate(AYear, 1, 1)) + else + begin + AMonth := AYear mod (12 div AMonthCount) * AMonthCount + 1; + AYear := AYear div (12 div AMonthCount); + ANavigation.FCurrentAnchor := EncodeDate(AYear, AMonth, 1); + end; + scLineUp, scPageUp: + ANavigation.GotoNextPage(False); + scLineDown, scPageDown: + ANavigation.GotoNextPage(True); + end; + ViewInfo.CheckLayout(ANavigation.FCurrentAnchor); + AScrollPos := GetScrollPos; +end; + +procedure TcxSchedulerYearView.SelectedDaysChanged; +begin + if SelectedDays.Count > 0 then + ViewInfo.CheckLayout(SelectedDays[0]); +end; + +procedure TcxSchedulerYearView.SetGroupingKind(AValue: TcxSchedulerGroupingKind); +begin + inherited SetGroupingKind(gkNone); +end; + +function TcxSchedulerYearView.GetHitTest: TcxSchedulerYearViewHitTest; +begin + Result := TcxSchedulerYearViewHitTest(inherited HitTest); +end; + +function TcxSchedulerYearView.GetNavigation: TcxSchedulerYearViewNavigation; +begin + Result := TcxSchedulerYearViewNavigation(Controller.Navigation); +end; + +function TcxSchedulerYearView.GetViewInfo: TcxSchedulerYearViewViewInfo; +begin + Result := TcxSchedulerYearViewViewInfo(inherited ViewInfo); +end; + +function TcxSchedulerYearView.GetYear: Word; +begin + Result := YearOf(inherited GetFirstVisibleDate); +end; + +procedure TcxSchedulerYearView.SetAllDayEventsOnly(AValue: Boolean); +begin + if FAllDayEventsOnly <> AValue then + begin + FAllDayEventsOnly := AValue; + Changed; + end; +end; + +procedure TcxSchedulerYearView.SetMaxSelectedDaysCount( + AValue: Integer); +begin + AValue := Max(0, AValue); + if AValue <> FMaxSelectedDaysCount then + begin + FMaxSelectedDaysCount := AValue; + Changed; + end; +end; + +procedure TcxSchedulerYearView.SetMonthHeaderPopupMenu( + AValue: TcxSchedulerMonthHeaderPopupMenu); +begin + FMonthHeaderPopupMenu.Assign(AValue); +end; + +procedure TcxSchedulerYearView.SetScale(AValue: Integer); +begin + if (AValue <> FScale) and (AValue in [3, 6, 12]) then + begin + FScale := AValue; + Changed; + end; +end; + +procedure TcxSchedulerYearView.SetStyles(AValue: TcxSchedulerYearViewStyles); +begin + FStyles.Assign(AValue); +end; + +{ TcxSchedulerYearViewAdapter } + +function TcxSchedulerYearViewAdapter.QueryInterface( + const IID: TGUID; out Obj): HResult; stdcall; +begin + if GetInterface(IID, Obj) then + Result := 0 + else + Result := E_NOINTERFACE; +end; + +function TcxSchedulerYearViewAdapter._AddRef: Integer; +begin + Result := -1; +end; + +function TcxSchedulerYearViewAdapter._Release: Integer; +begin + Result := -1; +end; + +function TcxSchedulerYearViewAdapter.GetDayCountPerPage: Integer; +begin + Result := MaxYearViewWeekDays; +end; + +function TcxSchedulerYearViewAdapter.GetFirstMonth: Integer; +var + AYear, AMonth, ADay: Word; + AMonthCount: Integer; + ACurrentAnchor: TDateTime; +begin + if PredefinedCurrentAnchor <> 0 then + ACurrentAnchor := PredefinedCurrentAnchor + else + ACurrentAnchor := TcxSchedulerCustomViewViewInfoAccess(TcxSchedulerYearView(View).ViewInfo).FSelectedDays[0]; + PredefinedCurrentAnchor := 0; + DecodeDate(ACurrentAnchor, AYear, AMonth, ADay); + AMonthCount := GetMonthCount; + Result := 1; + while Result + AMonthCount <= AMonth do + Inc(Result, AMonthCount); +end; + +function TcxSchedulerYearViewAdapter.GetMonthCount: Integer; +begin + Result := TcxSchedulerYearView(View).Scale; +end; + +function TcxSchedulerYearViewAdapter.GetShowMonthHeaders: Boolean; +begin + Result := True; +end; + +function TcxSchedulerYearViewAdapter.GetShowWeekDayHeaders: Boolean; +begin + Result := True; +end; + +function TcxSchedulerYearViewAdapter.GetStartDayIndex: Integer; +begin + Result := 0; +end; + +{ TcxSchedulerMonthHeaderPopupMenu } + +constructor TcxSchedulerMonthHeaderPopupMenu.Create(AScheduler: TcxCustomScheduler); +begin + inherited Create(AScheduler); + FItems := [mhpmiNewEvent, mhpmiNewAllDayEvent, mhpmiNewReccuringEvent, + mhpmiFullYear, mhpmiHalfYear, mhpmiQuarter]; +end; + +procedure TcxSchedulerMonthHeaderPopupMenu.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxSchedulerMonthHeaderPopupMenu then + begin + Items := TcxSchedulerMonthHeaderPopupMenu(Source).Items; + OnClick := TcxSchedulerMonthHeaderPopupMenu(Source).OnClick; + OnPopup := TcxSchedulerMonthHeaderPopupMenu(Source).OnPopup; + end; +end; + +procedure TcxSchedulerMonthHeaderPopupMenu.Execute(AItem: TcxSchedulerMonthHeaderPopupMenuItem); +begin + ExecuteCommand(Ord(AItem)); +end; + +function TcxSchedulerMonthHeaderPopupMenu.GetMenuItem(AItem: TcxSchedulerMonthHeaderPopupMenuItem): TMenuItem; +begin + Result := FindItemByCommand(Root, Ord(AItem)); +end; + +procedure TcxSchedulerMonthHeaderPopupMenu.CreateItems; + + function GetChecked(ACommand: Integer): Boolean; + var + AIndex: Integer; + begin + Result := False; + AIndex := ACommand - Ord(mhpmiFullYear); + if (AIndex >= 0) and (AIndex <= 2) then + Result := YearView.Scale = YearScales[AIndex]; + end; + + procedure CreateRulerItem(const ACaption: string; + AItem: TcxSchedulerMonthHeaderPopupMenuItem); + var + ACommand: Integer; + begin + if AItem in Items then + begin + ACommand := Ord(AItem); + CreateSubItem(Root, ACaption, ACommand, -1, True, GetChecked(ACommand)); + end; + end; + +begin + CreateNewEventItems(mhpmiNewEvent in FItems, mhpmiNewAllDayEvent in FItems, + mhpmiNewReccuringEvent in FItems, Ord(mhpmiNewEvent), Ord(mhpmiNewAllDayEvent), + Ord(mhpmiNewReccuringEvent)); + if Items * [mhpmiFullYear, mhpmiHalfYear, mhpmiQuarter] <> [] then + begin + AddValidSeparator(Root); + CreateRulerItem(cxGetResourceString(@scxpmFullYear), mhpmiFullYear); + CreateRulerItem(cxGetResourceString(@scxpmHalfYear), mhpmiHalfYear); + CreateRulerItem(cxGetResourceString(@scxpmQuarter), mhpmiQuarter); + end; +end; + +function TcxSchedulerMonthHeaderPopupMenu.GetYearView: TcxSchedulerYearView; +begin + Result := Scheduler.CurrentView as TcxSchedulerYearView; +end; + +procedure TcxSchedulerMonthHeaderPopupMenu.DoExecute(ACommand: Integer); +var + AIndex: Integer; +begin + if ACommand in [Ord(mhpmiNewEvent), Ord(mhpmiNewAllDayEvent), Ord(mhpmiNewReccuringEvent)] then + inherited DoExecute(ACommand) + else + begin + AIndex := ACommand - Ord(mhpmiFullYear); + if AIndex in [0..2] then + YearView.Scale := YearScales[AIndex]; + end; +end; + +function TcxSchedulerMonthHeaderPopupMenu.DoOnClick(ACommand: Integer): Boolean; +begin + Result := False; + if Assigned(FOnClick) then + FOnClick(Self, TcxSchedulerMonthHeaderPopupMenuItem(ACommand), Result); +end; + +function TcxSchedulerMonthHeaderPopupMenu.DoOnPopup: Boolean; +begin + Result := False; + if Assigned(FOnPopup) then + FOnPopup(Self, InternalMenu, Result); +end; + +function TcxSchedulerMonthHeaderPopupMenu.IsValidCommand(ACommand: Integer): Boolean; +begin + Result := (ACommand >= Ord(mhpmiNewEvent)) and (ACommand <= Ord(mhpmiQuarter)); +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulercxGridConnection.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulercxGridConnection.pas new file mode 100644 index 00000000..5aa9f749 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulercxGridConnection.pas @@ -0,0 +1,2092 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulercxGridConnection; + +{$I cxVer.inc} + +interface + +uses + Classes, SysUtils, Windows, Forms, Math, Graphics, Variants, Menus, + cxClasses, cxControls, cxCustomData, cxDataStorage, cxVariants, + cxLookAndFeels, cxSchedulerStorage, cxGridCustomView, cxGridCustomTableView, + cxSchedulerUtils, cxSchedulerStrs, cxSchedulerDialogs, cxGridTableView, + cxTextEdit, cxMemo, cxDropDownEdit, cxImageCombobox, cxCalendar, cxEdit, + cxColorCombobox, cxSpinEdit, cxProgressBar, cxMaskEdit, cxCheckBox, + cxGridPopupMenu, cxGridCustomPopupMenu, cxGridLevel, cxGrid, + cxSchedulerCustomControls; + +type + TcxSchedulerGridBuildInPopupMenu = class; + TcxSchedulerGridBuildInPopupMenuController = class; + TcxSchedulerGridConnection = class; + TcxSchedulerFieldAdapter = class; + + { TcxSchedulerStorageDataSource } + + TcxSchedulerStorageDataSource = class(TcxCustomDataSource) + private + FConnection: TcxSchedulerGridConnection; + function GetStorage: TcxCustomSchedulerStorage; + protected + function AddNewEvent: TcxDataRecordHandle; + function AppendRecord: TcxDataRecordHandle; override; + procedure DeleteRecord(ARecordHandle: TcxDataRecordHandle); override; + function GetAdapter(AItemHandle: TcxDataItemHandle; out Adapter: TcxSchedulerFieldAdapter): Boolean; + function GetRecordCount: Integer; override; + function GetValue(ARecordHandle: TcxDataRecordHandle; AItemHandle: TcxDataItemHandle): Variant; override; + function InsertRecord(ARecordHandle: TcxDataRecordHandle): TcxDataRecordHandle; override; + procedure SetValue(ARecordHandle: TcxDataRecordHandle; AItemHandle: TcxDataItemHandle; const AValue: Variant); override; + public + property Connection: TcxSchedulerGridConnection read FConnection; + property Storage: TcxCustomSchedulerStorage read GetStorage; + end; + + { TcxSchedulerFieldAdapter } + + TcxSchedulerFieldAdapter = class(TPersistent) + private + FConnection: TcxSchedulerGridConnection; + FEditProperties: TcxCustomEditProperties; + FField: TcxCustomSchedulerStorageField; + FItem: TcxCustomGridTableItem; + FLink: TCollectionItem; + function GetCaption: string; + function GetProperties: TcxCustomEditProperties; + function GetReadOnly: Boolean; + function GetStorage: TcxCustomSchedulerStorage; + function GetVisible: Boolean; + procedure SetCaption(AValue: string); + procedure SetItem(AValue: TcxCustomGridTableItem); + procedure SetReadOnly(const AValue: Boolean); + procedure SetVisible(const AValue: Boolean); + protected + procedure DeleteItem; virtual; + procedure DoGetPropertiesForEdit(Sender: TcxCustomGridTableItem; + ARecord: TcxCustomGridRecord; var AProperties: TcxCustomEditProperties); virtual; + function GetEvent(ARecordIndex: Integer): TcxSchedulerEvent; + function GetNativeValue(ARecordIndex: Integer): Variant; virtual; + function GetPropertiesClass: TcxCustomEditPropertiesClass; virtual; + function GetPropertiesForEditClass: TcxCustomEditPropertiesClass; virtual; + function GetValue(ARecordIndex: Integer): Variant; virtual; + function GetValueTypeClass: TcxValueTypeClass; virtual; + procedure Initialize; virtual; + procedure InitializeAdapter; virtual; + procedure InitializeEditProperties; virtual; + procedure SetValue(ARecordIndex: Integer; const AValue: Variant); virtual; + + property Link: TCollectionItem read FLink write FLink; + public + constructor Create(AConnection: TcxSchedulerGridConnection; + ALink: TCollectionItem); virtual; + constructor CreateWithField(AConnection: TcxSchedulerGridConnection; + AField: TcxCustomSchedulerStorageField); virtual; + destructor Destroy; override; + class procedure Register; + class procedure Unregister; + + property Caption: string read GetCaption write SetCaption; + property Connection: TcxSchedulerGridConnection read FConnection; + property EditProperties: TcxCustomEditProperties read FEditProperties write FEditProperties; + property Field: TcxCustomSchedulerStorageField read FField; + property Item: TcxCustomGridTableItem read FItem write SetItem; + property Properties: TcxCustomEditProperties read GetProperties; + property ReadOnly: Boolean read GetReadOnly write SetReadOnly; + property Storage: TcxCustomSchedulerStorage read GetStorage; + property Values[ARecordIndex: Integer]: Variant read GetValue write SetValue; + property Visible: Boolean read GetVisible write SetVisible; + end; + + TcxSchedulerFieldAdapterClass = class of TcxSchedulerFieldAdapter; + + { TcxSchedulerNullAdapter } + + TcxSchedulerNullAdapter = class(TcxSchedulerFieldAdapter) + protected + procedure DeleteItem; override; + function GetValue(ARecordIndex: Integer): Variant; override; + procedure SetValue(ARecordIndex: Integer; const AValue: Variant); override; + public + constructor CreateWithItem(AConnection: TcxSchedulerGridConnection; AItem: TcxCustomGridTableItem); virtual; + end; + + { TcxSchedulerIntegerFieldAdapter } + + TcxSchedulerIntegerFieldAdapter = class(TcxSchedulerFieldAdapter) + protected + function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + function GetValueTypeClass: TcxValueTypeClass; override; + end; + + { TcxSchedulerTextFieldAdapter } + + TcxSchedulerTextFieldAdapter = class(TcxSchedulerFieldAdapter) + protected + function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + end; + + { TcxSchedulerCheckFieldAdapter } + + TcxSchedulerCheckFieldAdapter = class(TcxSchedulerFieldAdapter) + protected + function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + function GetValueTypeClass: TcxValueTypeClass; override; + end; + + { TcxSchedulerDateTimeFieldAdapter } + + TcxSchedulerDateTimeFieldAdapter = class(TcxSchedulerFieldAdapter) + protected + function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + procedure Initialize; override; + end; + + { TcxSchedulerImageComboFieldAdapter } + + TcxSchedulerImageComboFieldAdapter = class(TcxSchedulerFieldAdapter) + private + function GetProperties: TcxImageComboBoxProperties; + protected + procedure AddItems(const AItemsValues: array of Variant); + function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + public + property Properties: TcxImageComboBoxProperties read GetProperties; + end; + + { TcxSchedulerIDFieldAdapter } + + TcxSchedulerIDFieldAdapter = class(TcxSchedulerFieldAdapter) + protected + function GetValue(ARecordIndex: Integer): Variant; override; + procedure SetValue(ARecordIndex: Integer; const AValue: Variant); override; + end; + + { TcxSchedulerTypeFieldAdapter } + + TcxSchedulerTypeFieldAdapter = class(TcxSchedulerImageComboFieldAdapter) + protected + procedure Initialize; override; + end; + + { TcxSchedulerAllDayFieldAdapter } + + TcxSchedulerAllDayFieldAdapter = class(TcxSchedulerCheckFieldAdapter) + protected + function GetValue(ARecordIndex: Integer): Variant; override; + procedure SetValue(ARecordIndex: Integer; const AValue: Variant); override; + end; + + { TcxSchedulerEnabledFieldAdapter } + + TcxSchedulerEnabledFieldAdapter = class(TcxSchedulerCheckFieldAdapter) + protected + function GetValue(ARecordIndex: Integer): Variant; override; + procedure SetValue(ARecordIndex: Integer; const AValue: Variant); override; + end; + + { TcxSchedulerReminderFieldAdapter } + + TcxSchedulerReminderFieldAdapter = class(TcxSchedulerCheckFieldAdapter) + protected + function GetValue(ARecordIndex: Integer): Variant; override; + procedure SetValue(ARecordIndex: Integer; const AValue: Variant); override; + end; + + { TcxSchedulerLabelColorFieldAdapter } + + TcxSchedulerLabelColorFieldAdapter = class(TcxSchedulerImageComboFieldAdapter) + protected + function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + function GetValue(ARecordIndex: Integer): Variant; override; + procedure Initialize; override; + procedure SetValue(ARecordIndex: Integer; const AValue: Variant); override; + end; + + { TcxSchedulerRecurringFieldAdapter } + + TcxSchedulerRecurringFieldAdapter = class(TcxSchedulerFieldAdapter) + protected + function GetValue(ARecordIndex: Integer): Variant; override; + function GetValueTypeClass: TcxValueTypeClass; override; + end; + + { TcxSchedulerStateFieldAdapter } + + TcxSchedulerStateFieldAdapter = class(TcxSchedulerImageComboFieldAdapter) + protected + function GetValue(ARecordIndex: Integer): Variant; override; + procedure Initialize; override; + end; + + { TcxSchedulerResourceIDFieldAdapter } + + TcxSchedulerResourceIDFieldAdapter = class(TcxSchedulerFieldAdapter) + protected + function GetValueTypeClass: TcxValueTypeClass; override; + procedure Initialize; override; + end; + + { TcxSchedulerCompleteFieldAdapter } + + TcxSchedulerCompleteFieldAdapter = class(TcxSchedulerFieldAdapter) + protected + function GetPropertiesClass: TcxCustomEditPropertiesClass; override; + function GetPropertiesForEditClass: TcxCustomEditPropertiesClass; override; + function GetValue(ARecordIndex: Integer): Variant; override; + procedure InitializeEditProperties; override; + procedure SetValue(ARecordIndex: Integer; const AValue: Variant); override; + end; + + { TcxSchedulerLinksFieldAdapter } + + TcxSchedulerLinksFieldAdapter = class(TcxSchedulerFieldAdapter) + protected + function GetValue(ARecordIndex: Integer): Variant; override; + end; + + { TcxSchedulerStatusFieldAdapter } + + TcxSchedulerStatusFieldAdapter = class(TcxSchedulerImageComboFieldAdapter) + protected + function GetValue(ARecordIndex: Integer): Variant; override; + procedure Initialize; override; + procedure SetValue(ARecordIndex: Integer; const AValue: Variant); override; + end; + + { TcxSchedulerGridConnection } + + TcxSchedulerInitializeGridItemEvent = procedure(Sender: TcxSchedulerGridConnection; + AField: TcxCustomSchedulerStorageField; AItem: TcxCustomGridTableItem; Adapter: TcxSchedulerFieldAdapter) of object; + TcxSchedulerConnectionEditEventEvent = procedure(Sender: TcxSchedulerGridConnection; + AEvent: TcxSchedulerControlEvent; var AModified: Boolean; var AHandled: Boolean) of object; + TcxSchedulerConnectionNewEventEvent = procedure(Sender: TcxSchedulerGridConnection; + var AEvent: TcxSchedulerControlEvent; var AHandled: Boolean) of object; + + TcxSchedulerGridConnection = class(TComponent, IUnknown, IcxSchedulerStorageListener) + private + FActive: Boolean; + FAdapters: TCollection; + FEventEditInfo: TcxSchedulerEventEditInfo; + FGridPopupMenu: TcxSchedulerGridBuildInPopupMenu; + FGridPopupMenuEvents: TNotifyEvent; + FGridPopupMenuController: TcxSchedulerGridBuildInPopupMenuController; + FGridView: TcxCustomGridTableView; + FProvider: TcxSchedulerStorageDataSource; + FStorage: TcxCustomSchedulerStorage; + FOnEditEvent: TcxSchedulerConnectionEditEventEvent; + FOnInitializeItem: TcxSchedulerInitializeGridItemEvent; + FOnNewEvent: TcxSchedulerConnectionNewEventEvent; + function GetAdapter(AIndex: Integer): TcxSchedulerFieldAdapter; + function GetCount: Integer; + function GetDataController: TcxCustomDataController; + function GetEvent(ARowIndex: Integer): TcxSchedulerEvent; + function GetEventCount: Integer; + function GetIsDestroying: Boolean; + function GetIsLoading: Boolean; + procedure SetActive(AValue: Boolean); + procedure SetGridPopupMenu(AValue: TcxSchedulerGridBuildInPopupMenu); + procedure SetGridView(AValue: TcxCustomGridTableView); + procedure SetStorage(AValue: TcxCustomSchedulerStorage); + procedure SetupBuildInPopupMenu; + procedure ReadLinks(Reader: TReader); + procedure WriteLinks(Writer: TWriter); + protected + function AddNewEvent(ARecurrence: Boolean = False; + AnAllDayEvent: Boolean = False): TcxSchedulerEvent; virtual; + function AdapterByItem(AItem: TcxCustomGridTableItem): TcxSchedulerFieldAdapter; + function AddAdapterLink(Adapter: TcxSchedulerFieldAdapter): TCollectionItem; + function AddAdapter(AField: TcxCustomSchedulerStorageField; + AdapterClass: TcxSchedulerFieldAdapterClass; ACaption: Pointer; + AVisible, ACanEdit: Boolean): TcxSchedulerFieldAdapter; + function AddAdapterEx(ALink: TCollectionItem; + AdapterClass: TcxSchedulerFieldAdapterClass): TcxSchedulerFieldAdapter; + + function CreateDataSource: TcxSchedulerStorageDataSource; + procedure DefineProperties(Filer: TFiler); override; + procedure DblClickGridHandler(Sender: TObject); virtual; + procedure DoInitializeItem(AField: TcxCustomSchedulerStorageField; + AItem: TcxCustomGridTableItem; AAdapter: TcxSchedulerFieldAdapter); virtual; + procedure DoEditEventUsingDialog(AEvent: TcxSchedulerEvent; + ARecurrence: Boolean = False; AReadOnly: Boolean = False; + AForcePatternEditing: Boolean = False); virtual; + function GetEventEditInfo(AEvent: TcxSchedulerControlEvent; + ARecurrence: Boolean = False): TcxSchedulerEventEditInfo; + function GetFocusedEvent: TcxSchedulerEvent; + function GetIsFieldActive(AField: TcxCustomSchedulerStorageField): Boolean; + procedure Loaded; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure OpenEventEditDialog(AForcePatternEditing: Boolean = False; + AReadOnly: Boolean = False); + procedure Reactivate; + procedure SetupView; virtual; + // IcxSchedulerStorageListener + procedure StorageChanged(Sender: TObject); virtual; + procedure StorageRemoved(Sender: TObject); virtual; + + property Adapters[Index: Integer]: TcxSchedulerFieldAdapter read GetAdapter; + property Count: Integer read GetCount; + property DataController: TcxCustomDataController read GetDataController; + property EventCount: Integer read GetEventCount; + property Events[ARowIndex: Integer]: TcxSchedulerEvent read GetEvent; + property IsDestroying: Boolean read GetIsDestroying; + property IsLoading: Boolean read GetIsLoading; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; +// procedure Assign(Source: TPersistent); override; + procedure Refresh; + + property Provider: TcxSchedulerStorageDataSource read FProvider; + published + property GridPopupMenu: TcxSchedulerGridBuildInPopupMenu read FGridPopupMenu write SetGridPopupMenu; + property GridPopupMenuEvents: TNotifyEvent read FGridPopupMenuEvents write FGridPopupMenuEvents; + property GridView: TcxCustomGridTableView read FGridView write SetGridView; + property Storage: TcxCustomSchedulerStorage read FStorage write SetStorage; + property Active: Boolean read FActive write SetActive default False; + property OnEditEvent: TcxSchedulerConnectionEditEventEvent read FOnEditEvent write FOnEditEvent; + property OnInitializeItem: TcxSchedulerInitializeGridItemEvent read FOnInitializeItem write FOnInitializeItem; + property OnNewEvent: TcxSchedulerConnectionNewEventEvent read FOnNewEvent write FOnNewEvent; + end; + + { TcxSchedulerGridBuildInPopupMenu } + + TcxSchedulerGridBuildInPopupMenuItem = (bpmiNewEvent, bpmiNewAllDayEvent, + bpmiNewReccuringEvent, bpmiOpen, bpmiEditSeries, + bpmiShowTimeAs, bpmiLabel, bpmiDelete); + TcxSchedulerGridBuildInPopupMenuItems = set of TcxSchedulerGridBuildInPopupMenuItem; + + TcxSchedulerGridBuildInPopupMenuPopupEvent = procedure (Sender: TcxSchedulerGridBuildInPopupMenu; + ABuiltInMenu: TPopupMenu; var AHandled: Boolean) of object; + TcxSchedulerGridBuildInPopupMenuClickEvent = procedure (Sender: TcxSchedulerGridBuildInPopupMenu; + AItem: TcxSchedulerGridBuildInPopupMenuItem; ASubItemIndex: Integer; + var AHandled: Boolean) of object; + + TcxSchedulerGridBuildInPopupMenu = class(TPersistent) + private + FItems: TcxSchedulerGridBuildInPopupMenuItems; + FOwner: TcxSchedulerGridConnection; + FPopupMenu: TComponent; + FUseBuiltInPopupMenu: Boolean; + FOnPopup: TcxSchedulerGridBuildInPopupMenuPopupEvent; + FOnClick: TcxSchedulerGridBuildInPopupMenuClickEvent; + procedure SetPopupMenu(AValue: TComponent); + protected + procedure Notification(AComponent: TComponent; Operation: TOperation); + public + constructor Create(ASchedulerGridConnection: TcxSchedulerGridConnection); + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + published + property Items: TcxSchedulerGridBuildInPopupMenuItems + read FItems write FItems default [bpmiNewEvent, bpmiNewAllDayEvent, + bpmiNewReccuringEvent, bpmiOpen, bpmiEditSeries, + bpmiShowTimeAs, bpmiLabel, bpmiDelete]; + property PopupMenu: TComponent read FPopupMenu write SetPopupMenu; + property UseBuiltInPopupMenu: Boolean read FUseBuiltInPopupMenu write FUseBuiltInPopupMenu default True; + + property OnClick: TcxSchedulerGridBuildInPopupMenuClickEvent read FOnClick write FOnClick; + property OnPopup: TcxSchedulerGridBuildInPopupMenuPopupEvent read FOnPopup write FOnPopup; + end; + + TcxSchedulerGridBuildInPopupMenuController = class + private + FEvent: TcxSchedulerEvent; + FGridPopupMenu: TcxGridPopupMenu; + FInternalMenu: TPopupMenu; + FMenuInfo: TcxPopupMenuInfo; + FOwner: TcxSchedulerGridConnection; + function CanEventEdit: Boolean; + procedure CreateLabelItems; + procedure CreateTimeItems; + procedure DeleteEvent; + procedure EditEvent; + procedure EditSeries; + function GetBuildInPopupMenu: TcxSchedulerGridBuildInPopupMenu; + function GetCommand(AItem: TcxSchedulerGridBuildInPopupMenuItem; + ASubItemIndex: Integer): Integer; + function GetItems: TcxSchedulerGridBuildInPopupMenuItems; + function GetStorage: TcxCustomSchedulerStorage; + procedure GridMenuPopup(ASenderMenu: TComponent; + AHitTest: TcxCustomGridHitTest; X, Y: Integer); + function IsEventsReadOnly: Boolean; + procedure NewAllDayEvent; + procedure NewEvent; + procedure NewRecurrence; + procedure SetEvent; + procedure SetEventLabelColor(AColor: Integer); + procedure SetEventState(AState: Integer); + procedure UnpackCommand(ACommand: Integer; + out AItem: TcxSchedulerGridBuildInPopupMenuItem; out ASubItemIndex: Integer); + protected + function AddValidSeparator(AOwner: TMenuItem): TMenuItem; + procedure CreateInternalMenu; + procedure CreateItems; + function CreateSubItem(AOwner: TMenuItem; const ACaption: string; ACommand: Integer = -1; + AImageIndex: Integer = -1; AEnabled: Boolean = True; AChecked: Boolean = False): TMenuItem; + function DoOnClick(ACommand: Integer): Boolean; + function DoOnPopup: Boolean; + function IsValidCommand(ACommand: Integer): Boolean; + + procedure OnItemClickHandler(Sender: TObject); + + property BuildInPopupMenu: TcxSchedulerGridBuildInPopupMenu read GetBuildInPopupMenu; + property Items: TcxSchedulerGridBuildInPopupMenuItems read GetItems; + property Storage: TcxCustomSchedulerStorage read GetStorage; + public + constructor Create(ASchedulerGridConnection: TcxSchedulerGridConnection); + destructor Destroy; override; + function Popup(X, Y: Integer): Boolean; + end; + +implementation + +type + TStorageAccess = class(TcxSchedulerStorage); + TStorageFieldAccess = class(TcxCustomSchedulerStorageField); + + { TcxSchedulerFieldAdapters } + + TcxSchedulerFieldAdapters = class(TCollection) + private + FOwner: TPersistent; + protected + function GetOwner: TPersistent; override; + public + constructor Create(AOwner: TcxSchedulerGridConnection); reintroduce; overload; + end; + + { TcxSchedulerFieldAdapterItemLink } + + TcxSchedulerFieldAdapterItemLink = class(TCollectionItem) + private + FFieldIndex: Integer; + FLink: TcxSchedulerFieldAdapter; + function GetAdapterClass: string; + function GetConnection: TcxSchedulerGridConnection; + function GetFieldIndex: Integer; + function GetItem: TcxCustomGridTableItem; + procedure SetAdapterClass(AValue: string); + procedure SetFieldIndex(AValue: Integer); + procedure SetItem(AValue: TcxCustomGridTableItem); + protected + procedure AssignFieldByIndex; + public + destructor Destroy; override; + + property Connection: TcxSchedulerGridConnection read GetConnection; + property Link: TcxSchedulerFieldAdapter read FLink write FLink; + published + property AdapterClass: string read GetAdapterClass write SetAdapterClass; + property FieldIndex: Integer read GetFieldIndex write SetFieldIndex default -1; + property Item: TcxCustomGridTableItem read GetItem write SetItem; + end; + +function IsPopupMenuPossible(AGridView: TcxCustomGridTableView; + out AGrid: TcxGrid): Boolean; +var + ALevel: TComponent; + AControl: TcxControl; +begin + Result := False; + AGrid := nil; + if AGridView <> nil then + begin + ALevel := AGridView.Level; + if (ALevel <> nil) and (ALevel is TcxGridLevel) then + begin + AControl := TcxGridLevel(ALevel).Control; + if (AControl <> nil) and (AControl is TcxGrid) then + begin + AGrid := TcxGrid(AControl); + Result := True; + end; + end; + end; +end; + +{ TcxSchedulerStorageDataSource } + +function TcxSchedulerStorageDataSource.AddNewEvent: TcxDataRecordHandle; +var + AEvent: TcxSchedulerEvent; +begin + Result := nil; + AEvent := Connection.AddNewEvent(); + if AEvent <> nil then + Result := GetRecordHandleByIndex(AEvent.RecordIndex); +end; + +function TcxSchedulerStorageDataSource.AppendRecord: TcxDataRecordHandle; +begin + Result := AddNewEvent; +end; + +procedure TcxSchedulerStorageDataSource.DeleteRecord( + ARecordHandle: TcxDataRecordHandle); +begin + Connection.Storage.Events[GetRecordIndexByHandle(ARecordHandle)].Delete; +end; + +function TcxSchedulerStorageDataSource.GetAdapter( + AItemHandle: TcxDataItemHandle; out Adapter: TcxSchedulerFieldAdapter): Boolean; +begin + Adapter := Connection.AdapterByItem( + DataController.GetItem(Integer(AItemHandle)) as TcxCustomGridTableItem); + Result := Adapter <> nil; +end; + +function TcxSchedulerStorageDataSource.GetRecordCount: Integer; +begin + if Storage = nil then + Result := 0 + else + Result := Storage.EventCount; +end; + +function TcxSchedulerStorageDataSource.GetValue( + ARecordHandle: TcxDataRecordHandle; AItemHandle: TcxDataItemHandle): Variant; +var + Adapter: TcxSchedulerFieldAdapter; +begin + if (Storage <> nil) and GetAdapter(AItemHandle, Adapter) then + Result := Adapter.GetValue(GetRecordIndexByHandle(ARecordHandle)) + else + Result := Null; +end; + +function TcxSchedulerStorageDataSource.InsertRecord( + ARecordHandle: TcxDataRecordHandle): TcxDataRecordHandle; +begin + Result := AddNewEvent; +end; + +procedure TcxSchedulerStorageDataSource.SetValue( + ARecordHandle: TcxDataRecordHandle; AItemHandle: TcxDataItemHandle; const AValue: Variant); +var + Adapter: TcxSchedulerFieldAdapter; +begin + if (Storage <> nil) and GetAdapter(AItemHandle, Adapter) then + Adapter.SetValue(GetRecordIndexByHandle(ARecordHandle), AValue); +end; + +function TcxSchedulerStorageDataSource.GetStorage: TcxCustomSchedulerStorage; +begin + Result := FConnection.Storage; +end; + +{ TcxSchedulerFieldAdapter } + +constructor TcxSchedulerFieldAdapter.Create( + AConnection: TcxSchedulerGridConnection; ALink: TCollectionItem); +begin + FConnection := AConnection; + FLink := ALink; +end; + +constructor TcxSchedulerFieldAdapter.CreateWithField( + AConnection: TcxSchedulerGridConnection; AField: TcxCustomSchedulerStorageField); +begin + Create(AConnection, AConnection.AddAdapterLink(Self)); + FField := AField; + with Connection do + begin + FItem := GridView.CreateItem as TcxCustomGridTableItem; + FItem.Name := CreateUniqueName(GridView.Owner, GridView, FItem, + Copy(FItem.ClassName, 1, Pos('Item', FItem.ClassName) - 1), ''); + end; + FItem.DataBinding.ValueTypeClass := GetValueTypeClass; + FItem.PropertiesClass := GetPropertiesClass; + InitializeAdapter; +end; + +destructor TcxSchedulerFieldAdapter.Destroy; +begin + FreeAndNil(FEditProperties); + if FItem <> nil then + FItem.RemoveFreeNotification(Connection); + DeleteItem; + inherited Destroy; +end; + +class procedure TcxSchedulerFieldAdapter.Register; +begin + Classes.RegisterClass(Self); +end; + +class procedure TcxSchedulerFieldAdapter.Unregister; +begin + Classes.UnRegisterClass(Self); +end; + +procedure TcxSchedulerFieldAdapter.DeleteItem; +begin + if (FItem <> nil) and not (csDestroying in FItem.ComponentState) then + FreeAndNil(FItem); +end; + +procedure TcxSchedulerFieldAdapter.DoGetPropertiesForEdit( + Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord; + var AProperties: TcxCustomEditProperties); +begin + if EditProperties <> nil then + AProperties := EditProperties; +end; + +function TcxSchedulerFieldAdapter.GetEvent( + ARecordIndex: Integer): TcxSchedulerEvent; +begin + Result := Storage.Events[ARecordIndex]; +end; + +function TcxSchedulerFieldAdapter.GetNativeValue(ARecordIndex: Integer): Variant; +var + AEvent: TcxSchedulerEvent; +begin + Result := Storage.Values[ARecordIndex, Field.Index]; + if VarIsNull(Result) then + begin + AEvent := GetEvent(ARecordIndex); + Result := AEvent.Values[Field.Index]; + end; +end; + +function TcxSchedulerFieldAdapter.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxTextEditProperties; +end; + +function TcxSchedulerFieldAdapter.GetPropertiesForEditClass: TcxCustomEditPropertiesClass; +begin + Result := nil; +end; + +function TcxSchedulerFieldAdapter.GetValue(ARecordIndex: Integer): Variant; +begin + Result := GetNativeValue(ARecordIndex); +end; + +function TcxSchedulerFieldAdapter.GetValueTypeClass: TcxValueTypeClass; +begin + Result := TStorageAccess(Storage).GetFieldValueTypeClass(Field) +end; + +procedure TcxSchedulerFieldAdapter.Initialize; +begin +end; + +procedure TcxSchedulerFieldAdapter.InitializeAdapter; +begin + Initialize; + InitializeEditProperties; +end; + +procedure TcxSchedulerFieldAdapter.InitializeEditProperties; +begin + if csDesigning in Connection.ComponentState then Exit; + if GetPropertiesForEditClass <> nil then + begin + FreeAndNil(FEditProperties); + FEditProperties := GetPropertiesForEditClass.Create(FConnection); + end; + if (FEditProperties <> nil) and not Assigned(FItem.OnGetPropertiesForEdit) then + FItem.OnGetPropertiesForEdit := DoGetPropertiesForEdit; +end; + +procedure TcxSchedulerFieldAdapter.SetValue( + ARecordIndex: Integer; const AValue: Variant); +begin + Storage.Events[ARecordIndex].Values[Field.Index] := AValue; +end; + +function TcxSchedulerFieldAdapter.GetCaption: string; +begin + Result := Item.Caption; +end; + +function TcxSchedulerFieldAdapter.GetProperties: TcxCustomEditProperties; +begin + Result := Item.Properties; +end; + +function TcxSchedulerFieldAdapter.GetReadOnly: Boolean; +begin + Result := Item.Options.Editing; +end; + +function TcxSchedulerFieldAdapter.GetStorage: TcxCustomSchedulerStorage; +begin + Result := Connection.Storage; +end; + +function TcxSchedulerFieldAdapter.GetVisible: Boolean; +begin + Result := Item.Visible; +end; + +procedure TcxSchedulerFieldAdapter.SetCaption(AValue: string); +begin + Item.Caption := AValue; +end; + +procedure TcxSchedulerFieldAdapter.SetItem(AValue: TcxCustomGridTableItem); +begin + if FItem = AValue then Exit; + if FItem <> nil then + Item.RemoveFreeNotification(Connection); + FItem := AValue; + if Item <> nil then + begin + Item.FreeNotification(Connection); + InitializeEditProperties; + end; +end; + +procedure TcxSchedulerFieldAdapter.SetReadOnly(const AValue: Boolean); +begin + Item.Options.Editing := not AValue; +end; + +procedure TcxSchedulerFieldAdapter.SetVisible(const AValue: Boolean); +begin + Item.Visible := AValue; +end; + +{ TcxSchedulerNullAdapter } + +constructor TcxSchedulerNullAdapter.CreateWithItem( + AConnection: TcxSchedulerGridConnection; AItem: TcxCustomGridTableItem); +begin + inherited CreateWithField(AConnection, nil); + Item := AItem; +end; + +procedure TcxSchedulerNullAdapter.DeleteItem; +begin +end; + +function TcxSchedulerNullAdapter.GetValue(ARecordIndex: Integer): Variant; +begin + Result := Null; +end; + +procedure TcxSchedulerNullAdapter.SetValue(ARecordIndex: Integer; const AValue: Variant); +begin +end; + +{ TcxSchedulerIntegerFieldAdapter } + +function TcxSchedulerIntegerFieldAdapter.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := inherited GetPropertiesClass; +end; + +function TcxSchedulerIntegerFieldAdapter.GetValueTypeClass: TcxValueTypeClass; +begin + Result := TcxIntegerValueType; +end; + +{ TcxSchedulerEventTextFieldAdapter } + +function TcxSchedulerTextFieldAdapter.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxMemoProperties; +end; + +{ TcxSchedulerCheckFieldAdapter } + +function TcxSchedulerCheckFieldAdapter.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxCheckBoxProperties; +end; + +function TcxSchedulerCheckFieldAdapter.GetValueTypeClass: TcxValueTypeClass; +begin + Result := TcxBooleanValueType; +end; + +{ TcxSchedulerDateTimeFieldAdapter } + +function TcxSchedulerDateTimeFieldAdapter.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxDateEditProperties; +end; + +procedure TcxSchedulerDateTimeFieldAdapter.Initialize; +begin + TcxDateEditProperties(Properties).Kind := ckDateTime; +end; + +{ TcxSchedulerImageComboFieldAdapter } + +procedure TcxSchedulerImageComboFieldAdapter.AddItems( + const AItemsValues: array of Variant); +var + AIndex: Integer; +begin + for AIndex := Low(AItemsValues) to High(AItemsValues) div 3 do + if AItemsValues[AIndex * 3 + 2] <> -1 then + with Properties.Items.Add() do + begin + Description := AItemsValues[AIndex * 3]; + Value := AItemsValues[AIndex * 3 + 1]; + ImageIndex := AItemsValues[AIndex * 3 + 2]; + end; + ReadOnly := True; +end; + +function TcxSchedulerImageComboFieldAdapter.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxImageComboBoxProperties; +end; + +function TcxSchedulerImageComboFieldAdapter.GetProperties: TcxImageComboBoxProperties; +begin + Result := TcxImageComboBoxProperties(inherited Properties); +end; + +{ TcxSchedulerIDFieldAdapter } + +function TcxSchedulerIDFieldAdapter.GetValue(ARecordIndex: Integer): Variant; +begin + if Field = nil then + Result := GetEvent(ARecordIndex).ID + else + begin + Result := GetEvent(ARecordIndex).ParentID; + if VarIsNumeric(Result) and (Result = -2) then + Result := Null; + end; +end; + +procedure TcxSchedulerIDFieldAdapter.SetValue( + ARecordIndex: Integer; const AValue: Variant); +begin +end; + +{ TcxSchedulerTypeFieldAdapter } + +procedure TcxSchedulerTypeFieldAdapter.Initialize; +begin + Properties.Images := EventImages; + Properties.ShowDescriptions := False; + AddItems([cxGetResourceString(@scxNone), Integer(etNone), -1,// MaxInt, + cxGetResourceString(@scxPattern), Integer(etPattern), Integer(2), + cxGetResourceString(@scxOccurrence), Integer(etOccurrence), -1,//MaxInt - 1, + cxGetResourceString(@scxException), Integer(etException), -1,// MaxInt - 2, + cxGetResourceString(@scxCustom), Integer(etCustom), Integer(3)]); + Properties.Buttons.Clear; +end; + +{ TcxSchedulerAllDayFieldAdapter } + +function TcxSchedulerAllDayFieldAdapter.GetValue( + ARecordIndex: Integer): Variant; +begin + Result := GetEvent(ARecordIndex).AllDayEvent; +end; + +procedure TcxSchedulerAllDayFieldAdapter.SetValue( + ARecordIndex: Integer; const AValue: Variant); +begin + GetEvent(ARecordIndex).AllDayEvent := AValue; +end; + +{ TcxSchedulerEnabledFieldAdapter } + +function TcxSchedulerEnabledFieldAdapter.GetValue( + ARecordIndex: Integer): Variant; +begin + Result := GetEvent(ARecordIndex).Enabled; +end; + +procedure TcxSchedulerEnabledFieldAdapter.SetValue( + ARecordIndex: Integer; const AValue: Variant); +begin + GetEvent(ARecordIndex).Enabled := AValue; +end; + +{ TcxSchedulerReminderFieldAdapter } + +function TcxSchedulerReminderFieldAdapter.GetValue( + ARecordIndex: Integer): Variant; +begin + Result := GetEvent(ARecordIndex).Reminder; +end; + +procedure TcxSchedulerReminderFieldAdapter.SetValue( + ARecordIndex: Integer; const AValue: Variant); +begin + GetEvent(ARecordIndex).Reminder := AValue; +end; + +{ TcxSchedulerLabelColorFieldAdapter } + +function TcxSchedulerLabelColorFieldAdapter.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxColorComboBoxProperties; +end; + +function TcxSchedulerLabelColorFieldAdapter.GetValue( + ARecordIndex: Integer): Variant; +begin + Result := inherited GetValue(ARecordIndex); + if VarIsNumeric(Result) and (Result = clDefault) then + Result := Null; +end; + +procedure TcxSchedulerLabelColorFieldAdapter.Initialize; +var + I: Integer; +begin + with TcxColorComboBoxProperties(Properties) do + try + BeginUpdate(); + Items.ClearNonCustom; + for I := 1 to EventLabels.Count - 1 do + Items.AddColor(EventLabels[I].Color, EventLabels[I].Caption); + DefaultColor := EventLabels[0].Color; + DefaultDescription := EventLabels[0].Caption; + DefaultColorStyle := cxdcClear; + NamingConvention := cxncNone; + finally + EndUpdate(); + end; +end; + +procedure TcxSchedulerLabelColorFieldAdapter.SetValue( + ARecordIndex: Integer; const AValue: Variant); +begin + if VarIsNull(AValue) then + inherited SetValue(ARecordIndex, clDefault) + else + inherited SetValue(ARecordIndex, AValue); +end; + +{ TcxSchedulerRecurringFieldAdapter } + +function TcxSchedulerRecurringFieldAdapter.GetValue(ARecordIndex: Integer): Variant; +begin + Result := cxGetRecurrenceDescriptionString(GetEvent(ARecordIndex).RecurrenceInfo) +end; + +function TcxSchedulerRecurringFieldAdapter.GetValueTypeClass: TcxValueTypeClass; +begin + Result := TcxStringValueType; +end; + +{ TcxSchedulerStateFieldAdapter } + +function TcxSchedulerStateFieldAdapter.GetValue(ARecordIndex: Integer): Variant; +begin + Result := inherited GetValue(ARecordIndex); + with GetEvent(ARecordIndex) do + begin + if EventType = etCustom then + Result := State + else + Result := State; + end; +end; + +procedure TcxSchedulerStateFieldAdapter.Initialize; +begin + AddItems([ + cxGetResourceString(@scxFree), tlsFree, 0, + cxGetResourceString(@scxTentative), tlsTentative, 1, + cxGetResourceString(@scxBusy), tlsBusy, 2, + cxGetResourceString(@scxOutOfOffice), tlsOutOfOffice, 3]); + Properties.Images := TimeLinePatterns; +end; + +{ TcxSchedulerResourceIDFieldAdapter } + +function TcxSchedulerResourceIDFieldAdapter.GetValueTypeClass: TcxValueTypeClass; +begin + Result := TcxStringValueType; +end; + +procedure TcxSchedulerResourceIDFieldAdapter.Initialize; +begin +end; + +{ TcxSchedulerCompleteFieldAdapter } + +function TcxSchedulerCompleteFieldAdapter.GetPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := TcxProgressBarProperties; +end; + +function TcxSchedulerCompleteFieldAdapter.GetPropertiesForEditClass: TcxCustomEditPropertiesClass; +begin + Result := TcxSpinEditProperties; +end; + +function TcxSchedulerCompleteFieldAdapter.GetValue(ARecordIndex: Integer): Variant; +begin + Result := inherited GetValue(ARecordIndex); + if VarIsNumeric(Result) then + Result := Min(100, Max(0, Result)) + else + Result := 0; +end; + +procedure TcxSchedulerCompleteFieldAdapter.InitializeEditProperties; +begin + inherited InitializeEditProperties; + if EditProperties = nil then Exit; + with TcxSpinEditProperties(EditProperties) do + begin + DisplayFormat := cxGetResourceString(@scxCompleteDisplayFormat); + MaxValue := 100; + MinValue := 0; + end; +end; + +procedure TcxSchedulerCompleteFieldAdapter.SetValue( + ARecordIndex: Integer; const AValue: Variant); +begin + if VarIsNull(AValue) then + GetEvent(ARecordIndex).TaskComplete := 0 + else + GetEvent(ARecordIndex).TaskComplete := AValue +end; + +{ TcxSchedulerLinksFieldAdapter } + +function TcxSchedulerLinksFieldAdapter.GetValue( + ARecordIndex: Integer): Variant; +begin + Result := GetEvent(ARecordIndex).TaskLinks.DisplayText; +end; + +{ TcxSchedulerStatusFieldAdapter } + +function TcxSchedulerStatusFieldAdapter.GetValue(ARecordIndex: Integer): Variant; +begin + Result := GetEvent(ARecordIndex).TaskStatus; +end; + +procedure TcxSchedulerStatusFieldAdapter.Initialize; +begin + inherited Initialize; + AddItems([cxGetResourceString(@scxNotStarted), Integer(tsNotStarted), -1,//MaxInt, + cxGetResourceString(@scxInProgress), Integer(tsInProgress), -1,// MaxInt - 1, + cxGetResourceString(@scxComplete), Integer(tsComplete), -1,// MaxInt - 2, + cxGetResourceString(@scxWaiting), Integer(tsWaiting), -1,// MaxInt - 3, + cxGetResourceString(@scxDeferred), Integer(tsDeferred), -1]); // MaxInt - 4 +end; + +procedure TcxSchedulerStatusFieldAdapter.SetValue( + ARecordIndex: Integer; const AValue: Variant); +begin + if VarIsNull(AValue) then + GetEvent(ARecordIndex).TaskStatus := tsNotStarted + else + GetEvent(ARecordIndex).TaskStatus := AValue; +end; + +{ TcxSchedulerFieldAdapters } + +constructor TcxSchedulerFieldAdapters.Create(AOwner: TcxSchedulerGridConnection); +begin + inherited Create(TcxSchedulerFieldAdapterItemLink); + FOwner := AOwner; +end; + +function TcxSchedulerFieldAdapters.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +{ TcxSchedulerFieldAdapterItemLink } + +destructor TcxSchedulerFieldAdapterItemLink.Destroy; +begin + FLink.Free; + inherited Destroy; +end; + +procedure TcxSchedulerFieldAdapterItemLink.AssignFieldByIndex; +begin + if FFieldIndex < 0 then + FLink.FField := nil + else + FLink.FField := TStorageAccess(Connection.Storage).DataFields[FFieldIndex]; +end; + +function TcxSchedulerFieldAdapterItemLink.GetAdapterClass: string; +begin + Result := FLink.ClassName; +end; + +function TcxSchedulerFieldAdapterItemLink.GetConnection: TcxSchedulerGridConnection; +begin + Result := Collection.Owner as TcxSchedulerGridConnection; +end; + +function TcxSchedulerFieldAdapterItemLink.GetFieldIndex: Integer; +begin + if FLink.FField <> nil then + Result := FLink.FField.Index + else + Result := -1; +end; + +function TcxSchedulerFieldAdapterItemLink.GetItem: TcxCustomGridTableItem; +begin + Result := FLink.Item; +end; + +procedure TcxSchedulerFieldAdapterItemLink.SetAdapterClass(AValue: string); +begin + FLink := Connection.AddAdapterEx(Self, TcxSchedulerFieldAdapterClass(FindClass(AValue))); +end; + +procedure TcxSchedulerFieldAdapterItemLink.SetFieldIndex(AValue: Integer); +begin + FFieldIndex := AValue; +end; + +procedure TcxSchedulerFieldAdapterItemLink.SetItem(AValue: TcxCustomGridTableItem); +begin + FLink.Item := AValue; +end; + +{ TcxSchedulerGridConnection } + +constructor TcxSchedulerGridConnection.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FAdapters := TcxSchedulerFieldAdapters.Create(Self); + FGridPopupMenu := TcxSchedulerGridBuildInPopupMenu.Create(Self); + FEventEditInfo := TcxSchedulerEventEditInfo.Create; + FProvider := CreateDataSource; + FProvider.FConnection := Self; +end; + +destructor TcxSchedulerGridConnection.Destroy; +begin + GridView := nil; + Storage := nil; + FProvider.Free; + FEventEditInfo.Free; + FGridPopupMenu.Free; + FAdapters.Free; + FGridPopupMenuController.Free; + inherited Destroy; +end; + +{procedure TcxSchedulerGridConnection.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerGridConnection then + begin + GridPopupMenu := TcxSchedulerGridConnection(Source).GridPopupMenu; + + end; + inherited Assign(Source); +end;} + +procedure TcxSchedulerGridConnection.Refresh; +var + APrevActive: Boolean; +begin + APrevActive := Active; + Active := False; + Active := APrevActive; +end; + +function TcxSchedulerGridConnection.AddNewEvent( + ARecurrence: Boolean = False; AnAllDayEvent: Boolean = False): TcxSchedulerEvent; +var + AEvent: TcxSchedulerControlEvent; + AHandled, AModified: Boolean; +begin + Result := nil; + AEvent := TcxSchedulerControlEvent.Create(Storage); + try + AHandled := False; + if Assigned(FOnNewEvent) then + FOnNewEvent(Self, AEvent, AHandled); + if not AHandled and (AEvent <> nil) then + begin + AEvent.AllDayEvent := AnAllDayEvent; + cxShowEventEditorEx(GetEventEditInfo(AEvent, ARecurrence), + AModified); + end; + finally + AEvent.Free; + end; +end; + +function TcxSchedulerGridConnection.AdapterByItem( + AItem: TcxCustomGridTableItem): TcxSchedulerFieldAdapter; +var + I: Integer; +begin + for I := 0 to Count - 1 do + begin + Result := Adapters[I]; + if Result.Item = AItem then Exit; + end; + Result := nil; +end; + +function TcxSchedulerGridConnection.AddAdapterLink( + Adapter: TcxSchedulerFieldAdapter): TCollectionItem; +begin + Result := FAdapters.Add; + TcxSchedulerFieldAdapterItemLink(Result).Link := Adapter; +end; + +function TcxSchedulerGridConnection.AddAdapter(AField: TcxCustomSchedulerStorageField; + AdapterClass: TcxSchedulerFieldAdapterClass; ACaption: Pointer; + AVisible, ACanEdit: Boolean): TcxSchedulerFieldAdapter; +begin + Result := AdapterClass.CreateWithField(Self, AField); + Result.Caption := cxGetResourceString(ACaption); + Result.ReadOnly := not ACanEdit and GetIsFieldActive(AField); + Result.Visible := AVisible and GetIsFieldActive(AField); + DoInitializeItem(AField, Result.Item, Result); +end; + +function TcxSchedulerGridConnection.AddAdapterEx(ALink: TCollectionItem; + AdapterClass: TcxSchedulerFieldAdapterClass): TcxSchedulerFieldAdapter; +begin + Result := AdapterClass.Create(Self, ALink); +end; + +function TcxSchedulerGridConnection.CreateDataSource(): TcxSchedulerStorageDataSource; +begin + Result := TcxSchedulerStorageDataSource.Create; +end; + +procedure TcxSchedulerGridConnection.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('Links', ReadLinks, WriteLinks, Count > 0); +end; + +procedure TcxSchedulerGridConnection.DblClickGridHandler(Sender: TObject); +var + AHitTest: TcxCustomGridHitTest; +begin + with GridView.Controller do + begin + with Site.ScreenToClient(GetMouseCursorPos) do + AHitTest := Site.ViewInfo.GetHitTest(X, Y); + if AHitTest is TcxGridRecordHitTest and (FocusedRecordIndex >= 0) then + OpenEventEditDialog; + end; +end; + +procedure TcxSchedulerGridConnection.DoInitializeItem( + AField: TcxCustomSchedulerStorageField; AItem: TcxCustomGridTableItem; + AAdapter: TcxSchedulerFieldAdapter); +begin + if Assigned(FOnInitializeItem) then + FOnInitializeItem(Self, AField, AItem, AAdapter); +end; + +procedure TcxSchedulerGridConnection.DoEditEventUsingDialog( + AEvent: TcxSchedulerEvent; ARecurrence: Boolean = False; AReadOnly: Boolean = False; + AForcePatternEditing: Boolean = False); +var + AModified, AHandled, AllowDelete, ARecurrenceButton: Boolean; + AControlEvent: TcxSchedulerControlEvent; + AOnDeleteFunc: TcxOnDeleteEventFunc; +begin + AControlEvent := TcxSchedulerControlEvent.Create(AEvent); + try + AControlEvent.Pattern := AEvent.Pattern; + AModified := False; + AHandled := False; + AllowDelete := True; + ARecurrenceButton := True; + AOnDeleteFunc := nil; + if Assigned(FOnEditEvent) then + FOnEditEvent(Self, AControlEvent, AModified, AHandled); + {if (AHandled or cxShowEventEditor(AControlEvent, RootLookAndFeel, + ARecurrence, AModified, AReadOnly, AllowDelete, ARecurrenceButton, + AOnDeleteFunc, AForcePatternEditing, 0, True)) and AModified then + AEvent.Assign(AControlEvent);} + cxShowEventEditor(AControlEvent, RootLookAndFeel, + ARecurrence, AModified, AReadOnly, AllowDelete, ARecurrenceButton, + AOnDeleteFunc, AForcePatternEditing, 0, True); + finally + AControlEvent.Free; + end; +end; + +function TcxSchedulerGridConnection.GetEventEditInfo(AEvent: TcxSchedulerControlEvent; + ARecurrence: Boolean = False): TcxSchedulerEventEditInfo; +begin + Result := FEventEditInfo; + Result.Event := AEvent; + Result.Recurrence := ARecurrence; + Result.RecurrenceButton := True; + Result.ShowResources := True; +end; + +function TcxSchedulerGridConnection.GetFocusedEvent; +begin + if (GridView.DataController.RecordCount = 0) or (GridView.Controller.FocusedRecordIndex < 0) then + Result := nil + else + Result := Storage.Events[GridView.DataController.FilteredRecordIndex[GridView.Controller.FocusedRecordIndex]]; +end; + +function TcxSchedulerGridConnection.GetIsFieldActive( + AField: TcxCustomSchedulerStorageField): Boolean; +begin + Result := (AField = nil) or + TStorageFieldAccess(AField).GetIsActive; +end; + +procedure TcxSchedulerGridConnection.Loaded; +var + AIndex: Integer; +begin + inherited Loaded; + for AIndex := 0 to FAdapters.Count - 1 do + TcxSchedulerFieldAdapterItemLink(FAdapters.Items[AIndex]).AssignFieldByIndex; + Reactivate; +end; + +procedure TcxSchedulerGridConnection.Notification( + AComponent: TComponent; Operation: TOperation); +var + Adapter: TcxSchedulerFieldAdapter; +begin + if Operation = opRemove then + begin + if AComponent = GridView then + begin + Active := False; + GridView := nil; + end; + if AComponent = Storage then + begin + Active := False; + Storage := nil; + end; + if AComponent is TcxCustomGridTableItem then + begin + Adapter := AdapterByItem(TcxCustomGridTableItem(AComponent)); + if Adapter <> nil then + begin + Adapter.Item := nil; + Adapter.Link.Free; + end; + end; + end; + FGridPopupMenu.Notification(AComponent, Operation); + inherited Notification(AComponent, Operation); +end; + +procedure TcxSchedulerGridConnection.OpenEventEditDialog( +AForcePatternEditing: Boolean = False; AReadOnly: Boolean = False); +begin + DoEditEventUsingDialog(GetFocusedEvent, False, AReadOnly, + AForcePatternEditing); +end; + +procedure TcxSchedulerGridConnection.Reactivate; +var + I: Integer; +begin + Active := Active; + for I := 0 to Count - 1 do + begin + Adapters[I].InitializeAdapter; + DoInitializeItem(Adapters[I].Field, Adapters[I].Item, Adapters[I]); + end; +end; + +procedure TcxSchedulerGridConnection.SetupView; +var + I: Integer; +begin + if (Storage = nil) or (GridView = nil) or (Count <> 0) then Exit; + if IsLoading then Exit; + GridView.BeginUpdate; + try + with TStorageAccess(Storage) do + begin + AddAdapter(nil, TcxSchedulerIDFieldAdapter, @scxIDField, False, False); + AddAdapter(FParentIDField, TcxSchedulerIDFieldAdapter, @scxParentIDField, False, False); + + AddAdapter(FStateField, TcxSchedulerStateFieldAdapter, @scxStateField, True, True); + AddAdapter(FCaptionField, TcxSchedulerTextFieldAdapter, @scxCaptionField, True, True); + AddAdapter(FLocationField, TcxSchedulerTextFieldAdapter, @scxLocationField, True, True); + AddAdapter(FActualFinishField, TcxSchedulerDateTimeFieldAdapter, @scxActualFinishField, False, False); + AddAdapter(FActualStartField, TcxSchedulerDateTimeFieldAdapter, @scxActualStartField, False, False); + AddAdapter(FFinishField, TcxSchedulerDateTimeFieldAdapter, @scxFinishField, True, True); + AddAdapter(FStartField, TcxSchedulerDateTimeFieldAdapter, @scxStartField, True, True); + AddAdapter(FMessageField, TcxSchedulerTextFieldAdapter, @scxMessageField, False, True); + AddAdapter(FEventTypeField, TcxSchedulerTypeFieldAdapter, @scxEventTypeField, False, False); + + AddAdapter(FOptionsField, TcxSchedulerReminderFieldAdapter, @scxReminderField, True, True); + AddAdapter(FOptionsField, TcxSchedulerAllDayFieldAdapter, @scxAllDayEventField, True, True); + AddAdapter(FOptionsField, TcxSchedulerEnabledFieldAdapter, @scxEnabledField, True, True); + + AddAdapter(FLabelColorField, TcxSchedulerLabelColorFieldAdapter, @scxLabelField, True, True); + + AddAdapter(FRecurrenceInfoField, TcxSchedulerRecurringFieldAdapter, @scxRecurrenceField, True, False); + AddAdapter(FRecurrenceIndexField, TcxSchedulerIntegerFieldAdapter, @scxRecurrenceIndexField, False, False); + AddAdapter(FReminderDateField, TcxSchedulerDateTimeFieldAdapter, @scxReminderDateField, False, False); + AddAdapter(FReminderMinutesBeforeStartField, TcxSchedulerIntegerFieldAdapter, @scxReminderMinutesBeforeStartField, False, False); + + AddAdapter(FResourceIDField, TcxSchedulerResourceIDFieldAdapter, @scxResourceField, False, False); + + AddAdapter(FTaskCompleteField, TcxSchedulerCompleteFieldAdapter, @scxTaskCompleteField, False, True); + AddAdapter(FTaskLinksField, TcxSchedulerLinksFieldAdapter, @scxTaskLinksField, False, False); + AddAdapter(FTaskStatusField, TcxSchedulerStatusFieldAdapter, @scxTaskStatusField, False, True); + end; + finally + GridView.EndUpdate; + GridView.BeginUpdate; + try + for I := 0 to Count - 1 do + if Adapters[I].Item.ActuallyVisible then + Adapters[I].Item.ApplyBestFit(); + finally + GridView.EndUpdate; + end; + end; +end; + +procedure TcxSchedulerGridConnection.StorageChanged(Sender: TObject); +begin + Provider.DataChanged; +end; + +procedure TcxSchedulerGridConnection.StorageRemoved(Sender: TObject); +begin + Storage := nil; +end; + +function TcxSchedulerGridConnection.GetAdapter( + AIndex: Integer): TcxSchedulerFieldAdapter; +begin + Result := TcxSchedulerFieldAdapterItemLink(FAdapters.Items[AIndex]).Link; +end; + +function TcxSchedulerGridConnection.GetCount: Integer; +begin + Result := FAdapters.Count; +end; + +function TcxSchedulerGridConnection.GetDataController: TcxCustomDataController; +begin + Result := nil; + if GridView <> nil then + Result := GridView.DataController; +end; + +function TcxSchedulerGridConnection.GetEvent(ARowIndex: Integer): TcxSchedulerEvent; +begin + with GridView.DataController.GetRowInfo(ARowIndex) do + Result := Storage.Events[RecordIndex]; +end; + +function TcxSchedulerGridConnection.GetEventCount: Integer; +begin + Result := GridView.DataController.RowCount; +end; + +function TcxSchedulerGridConnection.GetIsDestroying: Boolean; +begin + Result := csDestroying in ComponentState +end; + +function TcxSchedulerGridConnection.GetIsLoading: Boolean; +begin + Result := csLoading in ComponentState +end; + +procedure TcxSchedulerGridConnection.SetActive(AValue: Boolean); +begin + if not AValue and IsLoading then Exit; + if FActive and not AValue and (DataController <> nil) then + DataController.CustomDataSource := nil; + FActive := AValue; + if (DataController <> nil) and AValue then + DataController.CustomDataSource := Provider; + if IsLoading and not AValue then Exit; + if not Active then + FAdapters.Clear + else + begin + if (GridView <> nil) and (Storage <> nil) then + SetupView + else + Active := False; + end; +end; + +procedure TcxSchedulerGridConnection.SetGridPopupMenu( + AValue: TcxSchedulerGridBuildInPopupMenu); +begin + if FGridPopupMenu <> AValue then + FGridPopupMenu := AValue; +end; + +procedure TcxSchedulerGridConnection.SetGridView(AValue: TcxCustomGridTableView); +begin + if AValue = GridView then Exit; + Active := False; + if GridView <> nil then + begin + GridView.RemoveFreeNotification(Self); + if GridView.DataController <> nil then + GridView.DataController.CustomDataSource := nil; + end; + FGridView := AValue; + if GridView <> nil then + begin + GridView.FreeNotification(Self); + GridView.OptionsBehavior.AlwaysShowEditor := False; + GridView.OptionsBehavior.ImmediateEditor := False; + GridView.OptionsBehavior.CellHints := True; + GridView.OnDblClick := DblClickGridHandler; + end; + SetupBuildInPopupMenu; +end; + +procedure TcxSchedulerGridConnection.SetStorage(AValue: TcxCustomSchedulerStorage); +begin + if AValue = Storage then Exit; + Active := False; + if Storage <> nil then + begin + Storage.RemoveListener(Self); + Storage.RemoveFreeNotification(Self); + end; + FStorage := AValue; + if Storage <> nil then + begin + Storage.AddListener(Self); + Storage.FreeNotification(Self); + end; + SetupBuildInPopupMenu; +end; + +procedure TcxSchedulerGridConnection.SetupBuildInPopupMenu; +begin + if csDesigning in ComponentState then Exit; + if FGridPopupMenuController <> nil then + FGridPopupMenuController.Free; + FGridPopupMenuController := TcxSchedulerGridBuildInPopupMenuController.Create(Self); +end; + +procedure TcxSchedulerGridConnection.ReadLinks(Reader: TReader); +begin + Reader.ReadValue; + Reader.ReadCollection(FAdapters); +end; + +procedure TcxSchedulerGridConnection.WriteLinks(Writer: TWriter); +begin + Writer.WriteCollection(FAdapters); +end; + +{ TcxSchedulerGridBuildInPopupMenu } + +constructor TcxSchedulerGridBuildInPopupMenu.Create( + ASchedulerGridConnection: TcxSchedulerGridConnection); +begin + FOwner := ASchedulerGridConnection; + FUseBuiltInPopupMenu := True; + FItems := [bpmiNewEvent, bpmiNewAllDayEvent, bpmiNewReccuringEvent, + bpmiOpen, bpmiEditSeries, bpmiShowTimeAs, bpmiLabel, bpmiDelete]; +end; + +destructor TcxSchedulerGridBuildInPopupMenu.Destroy; +begin + PopupMenu := nil; + inherited Destroy; +end; + +procedure TcxSchedulerGridBuildInPopupMenu.Assign(Source: TPersistent); +begin + if Source is TcxSchedulerGridBuildInPopupMenu then + begin + PopupMenu := TcxSchedulerGridBuildInPopupMenu(Source).PopupMenu; + UseBuiltInPopupMenu := TcxSchedulerGridBuildInPopupMenu(Source).UseBuiltInPopupMenu; + Items := TcxSchedulerGridBuildInPopupMenu(Source).Items; + OnClick := TcxSchedulerGridBuildInPopupMenu(Source).OnClick; + OnPopup := TcxSchedulerGridBuildInPopupMenu(Source).OnPopup; + end; +end; + +procedure TcxSchedulerGridBuildInPopupMenu.Notification(AComponent: TComponent; + Operation: TOperation); +begin + if (Operation = opRemove) and (AComponent = PopupMenu) then + PopupMenu := nil; +end; + +procedure TcxSchedulerGridBuildInPopupMenu.SetPopupMenu(AValue: TComponent); +begin + if FPopupMenu <> AValue then + begin + if (FPopupMenu <> nil) and not (csDestroying in FPopupMenu.ComponentState) then + FPopupMenu.RemoveFreeNotification(FOwner); + FPopupMenu := AValue; + if FPopupMenu <> nil then + FPopupMenu.FreeNotification(FOwner); + end; +end; + +{ TcxSchedulerGridBuildInPopupMenuController } + +constructor TcxSchedulerGridBuildInPopupMenuController.Create( + ASchedulerGridConnection: TcxSchedulerGridConnection); +var + AGrid: TcxGrid; +begin + inherited Create; + FOwner := ASchedulerGridConnection; + if IsPopupMenuPossible(FOwner.GridView, AGrid) then + begin + FGridPopupMenu := TcxGridPopupMenu.Create(FOwner); + FInternalMenu := TPopupMenu.Create(FOwner); + FGridPopupMenu.Grid := AGrid; + FMenuInfo := TcxPopupMenuInfo(FGridPopupMenu.PopupMenus.Add); + FMenuInfo.GridView := FOwner.GridView; + FMenuInfo.HitTypes := [gvhtCell, gvhtNone]; + FMenuInfo.OnPopup := GridMenuPopup; + FMenuInfo.PopupMenu := FInternalMenu; + end; +end; + +destructor TcxSchedulerGridBuildInPopupMenuController.Destroy; +begin + FreeAndNil(FGridPopupMenu); + FreeAndNil(FInternalMenu); + inherited Destroy; +end; + +function TcxSchedulerGridBuildInPopupMenuController.Popup(X, Y: Integer): Boolean; +var + AGrid: TcxGrid; +begin + Result := False; + SetEvent; + if not IsPopupMenuPossible(FOwner.GridView, AGrid) or (FEvent = nil) then Exit; + Result := DoOnPopup; + if not Result then + begin + if BuildInPopupMenu.UseBuiltInPopupMenu then + begin + CreateInternalMenu; + Result := ShowPopupMenu(FOwner, FInternalMenu, X, Y); + end + else + Result := ShowPopupMenu(FOwner, BuildInPopupMenu.FPopupMenu, X, Y); + end; +end; + +function TcxSchedulerGridBuildInPopupMenuController.AddValidSeparator( + AOwner: TMenuItem): TMenuItem; +begin + if AOwner.Count > 0 then + Result := CreateSubItem(AOwner, '-') + else + Result := nil +end; + +procedure TcxSchedulerGridBuildInPopupMenuController.CreateInternalMenu; +begin + FreeAndNil(FInternalMenu); + FInternalMenu := TPopupMenu.Create(nil); + FInternalMenu.Images := MenuImages; + FMenuInfo.PopupMenu := FInternalMenu; + CreateItems; +end; + +procedure TcxSchedulerGridBuildInPopupMenuController.CreateItems; +begin + if bpmiNewEvent in Items then + CreateSubItem(FInternalMenu.Items, + cxGetResourceString(@scxpmNewEvent), Ord(bpmiNewEvent), 2); + if bpmiNewAllDayEvent in Items then + CreateSubItem(FInternalMenu.Items, + cxGetResourceString(@scxpmNewAllDayEvent), Ord(bpmiNewAllDayEvent), -1); + if (bpmiNewReccuringEvent in Items) and (Storage.IsRecurrenceAvailable) then + CreateSubItem(FInternalMenu.Items, + cxGetResourceString(@scxpmNewRecurringEvent), Ord(bpmiNewReccuringEvent), 3); + + if FEvent <> nil then + begin + if (bpmiOpen in Items) and not (FEvent.EventType = etPattern) then + begin + AddValidSeparator(FInternalMenu.Items); + CreateSubItem(FInternalMenu.Items, cxGetResourceString(@scxpmOpen), + Ord(bpmiOpen)); + end; + if FEvent.EventType = etPattern then + AddValidSeparator(FInternalMenu.Items); + if (bpmiEditSeries in Items) and (FEvent.EventType <> etNone) then + CreateSubItem(FInternalMenu.Items, cxGetResourceString(@scxpmEditSeries), + Ord(bpmiEditSeries), 8); + + if Items * [bpmiLabel, bpmiShowTimeAs] <> [] then + AddValidSeparator(FInternalMenu.Items); + CreateTimeItems; + CreateLabelItems; + if bpmiDelete in Items then + begin + AddValidSeparator(FInternalMenu.Items); + CreateSubItem(FInternalMenu.Items, cxGetResourceString(@scxpmDelete), + Ord(bpmiDelete), 10).Enabled := not IsEventsReadOnly; + end; + end; +end; + +function TcxSchedulerGridBuildInPopupMenuController.CreateSubItem(AOwner: TMenuItem; + const ACaption: string; ACommand: Integer = -1; AImageIndex: Integer = -1; + AEnabled: Boolean = True; AChecked: Boolean = False): TMenuItem; +begin + Result := TMenuItem.Create(nil); + Result.Caption := ACaption; + Result.Enabled := AEnabled; + Result.ImageIndex := AImageIndex; + Result.Checked := AChecked; + Result.Tag := ACommand; + Result.OnClick := OnItemClickHandler; + AOwner.Add(Result); +end; + +function TcxSchedulerGridBuildInPopupMenuController.DoOnClick(ACommand: Integer): Boolean; +var + AItem: TcxSchedulerGridBuildInPopupMenuItem; + ASubItemIndex: Integer; +begin + Result := False; + UnpackCommand(ACommand, AItem, ASubItemIndex); + if Assigned(BuildInPopupMenu.FOnClick) then + BuildInPopupMenu.FOnClick(BuildInPopupMenu, + TcxSchedulerGridBuildInPopupMenuItem(ACommand), ASubItemIndex, Result); +end; + +function TcxSchedulerGridBuildInPopupMenuController.DoOnPopup: Boolean; +begin + Result := False; + if Assigned(BuildInPopupMenu.FOnPopup) then + BuildInPopupMenu.FOnPopup(BuildInPopupMenu, FInternalMenu, Result); +end; + +function TcxSchedulerGridBuildInPopupMenuController.IsValidCommand(ACommand: Integer): Boolean; +begin + Result := (ACommand >= Ord(bpmiNewEvent)) and (ACommand <= Ord(bpmiDelete)) or + (ACommand in [20..20 + EventLabels.Count - 1]) or //Label + (ACommand in [10..13]); //TimeLine +end; + +procedure TcxSchedulerGridBuildInPopupMenuController.OnItemClickHandler(Sender: TObject); +var + ACommand: Integer; +begin + if (Sender <> nil) and (Sender is TComponent) then + begin + ACommand := TComponent(Sender).Tag; + if IsValidCommand(ACommand) and not DoOnClick(ACommand) then + case ACommand of + Ord(bpmiNewEvent): NewEvent; + Ord(bpmiNewAllDayEvent): NewAllDayEvent; + Ord(bpmiNewReccuringEvent): NewRecurrence; + Ord(bpmiDelete): DeleteEvent; + Ord(bpmiOpen): EditEvent; + Ord(bpmiEditSeries): EditSeries; + 10..13: + SetEventState(ACommand - 10); + else + if (ACommand >= 20) and (ACommand < 20 + EventLabels.Count) then + SetEventLabelColor(EventLabels[ACommand - 20].Color); + end; + end; +end; + +function TcxSchedulerGridBuildInPopupMenuController.CanEventEdit: Boolean; +begin + Result := (FEvent <> nil) and not FEvent.ReadOnly; +end; + +procedure TcxSchedulerGridBuildInPopupMenuController.CreateLabelItems; +var + AOwner: TMenuItem; + I: Integer; + + function GetColorChecked(AColor: TColor): Boolean; + begin + if FEvent = nil then + Result := False + else + Result := ColorToRgb(FEvent.LabelColor) = ColorToRgb(AColor); + end; + + procedure CreateEventColorItem(ALabel: TcxSchedulerEventLabel); + var + AChecked: Boolean; + AItem: TMenuItem; + begin + AChecked := GetColorChecked(ALabel.Color); + AItem := CreateSubItem(AOwner, ALabel.Caption, + GetCommand(bpmiLabel, ALabel.Index), -1, CanEventEdit, AChecked); + AItem.Default := AChecked; + EventLabels.Images.GetBitmap(ALabel.Index, AItem.Bitmap); + end; + +begin + if not (bpmiLabel in Items) or not Storage.IsLabelColorAvailable or + (EventLabels.Count = 0) then Exit; + AOwner := CreateSubItem(FInternalMenu.Items, cxGetResourceString(@scxpmLabel), + Ord(bpmiLabel)); + //label colors + CreateEventColorItem(EventLabels[0]); + if EventLabels.Count > 1 then + begin + AddValidSeparator(AOwner); + for I := 1 to EventLabels.Count - 1 do + CreateEventColorItem(EventLabels[I]); + end; +end; + +procedure TcxSchedulerGridBuildInPopupMenuController.CreateTimeItems; +var + AOwner: TMenuItem; + + function GetTimeLineChecked(AIndex: Integer): Boolean; + begin + if FEvent = nil then + Result := False + else + Result := Integer(FEvent.State) = AIndex; + end; + + procedure CreateTimeLineItem(const ACaption: string; AIndex: Integer); + var + AChecked: Boolean; + begin + AChecked := GetTimeLineChecked(AIndex); + CreateSubItem(AOwner, ACaption, GetCommand(bpmiShowTimeAs, AIndex), AIndex, + CanEventEdit, AChecked).Default := AChecked; + end; + +begin + if not (bpmiShowTimeAs in Items) or not Storage.IsStateAvailable then Exit; + AOwner := CreateSubItem(FInternalMenu.Items, + cxGetResourceString(@scxpmShowTimeAs), Ord(bpmiShowTimeAs)); + AOwner.SubMenuImages := TimeLinePatterns; + // TimeLine styles + CreateTimeLineItem(cxGetResourceString(@scxpmFree), 0); + CreateTimeLineItem(cxGetResourceString(@scxpmTentative), 1); + CreateTimeLineItem(cxGetResourceString(@scxpmBusy), 2); + CreateTimeLineItem(cxGetResourceString(@scxpmOutOfOffice), 3); +end; + +procedure TcxSchedulerGridBuildInPopupMenuController.DeleteEvent; +begin + FOwner.FGridView.Controller.DeleteSelection; +end; + +procedure TcxSchedulerGridBuildInPopupMenuController.EditEvent; +begin + FOwner.OpenEventEditDialog(False, IsEventsReadOnly); +end; + +procedure TcxSchedulerGridBuildInPopupMenuController.EditSeries; +begin + FOwner.OpenEventEditDialog(True, IsEventsReadOnly); +end; + +function TcxSchedulerGridBuildInPopupMenuController.GetBuildInPopupMenu: TcxSchedulerGridBuildInPopupMenu; +begin + Result := FOwner.GridPopupMenu; +end; + +function TcxSchedulerGridBuildInPopupMenuController.GetCommand( + AItem: TcxSchedulerGridBuildInPopupMenuItem; ASubItemIndex: Integer): Integer; +begin + Result := Ord(AItem); + case AItem of + bpmiShowTimeAs: + if (ASubItemIndex >= 0) and (ASubItemIndex <= 3) then + Result := 10 + ASubItemIndex; + bpmiLabel: + if (ASubItemIndex >= 0) and (ASubItemIndex < EventLabels.Count) then + Result := 20 + ASubItemIndex; + end; +end; + +function TcxSchedulerGridBuildInPopupMenuController.GetItems: TcxSchedulerGridBuildInPopupMenuItems; +begin + Result := BuildInPopupMenu.Items; +end; + +function TcxSchedulerGridBuildInPopupMenuController.GetStorage: TcxCustomSchedulerStorage; +begin + Result := FOwner.Storage; +end; + +procedure TcxSchedulerGridBuildInPopupMenuController.GridMenuPopup(ASenderMenu: TComponent; + AHitTest: TcxCustomGridHitTest; X, Y: Integer); +begin + Popup(X, Y); +end; + +function TcxSchedulerGridBuildInPopupMenuController.IsEventsReadOnly: Boolean; +var + I, ACount: Integer; +begin + Result := False; + ACount := FOwner.FGridView.Controller.SelectedRecordCount; + I := 0; + while not Result and (I < ACount) do + begin + Result := GetStorage.Events[FOwner.FGridView.Controller.SelectedRecords[I].Index].ReadOnly; + Inc(I); + end; +end; + +procedure TcxSchedulerGridBuildInPopupMenuController.NewAllDayEvent; +begin + FOwner.AddNewEvent(False, True); +end; + +procedure TcxSchedulerGridBuildInPopupMenuController.NewEvent; +begin + FOwner.AddNewEvent; +end; + +procedure TcxSchedulerGridBuildInPopupMenuController.NewRecurrence; +begin + FOwner.AddNewEvent(True); +end; + +procedure TcxSchedulerGridBuildInPopupMenuController.SetEvent; +begin + FEvent := FOwner.GetFocusedEvent; +end; + +procedure TcxSchedulerGridBuildInPopupMenuController.SetEventLabelColor(AColor: Integer); +begin + if FEvent = nil then Exit; + if FEvent.EventType = etOccurrence then + FEvent.Pattern.LabelColor := AColor + else + FEvent.LabelColor := AColor; +end; + +procedure TcxSchedulerGridBuildInPopupMenuController.SetEventState(AState: Integer); +begin + if FEvent = nil then Exit; + FEvent.State := AState; +end; + +procedure TcxSchedulerGridBuildInPopupMenuController.UnpackCommand(ACommand: Integer; + out AItem: TcxSchedulerGridBuildInPopupMenuItem; out ASubItemIndex: Integer); +begin + AItem := bpmiOpen; + ASubItemIndex := -1; + if not IsValidCommand(ACommand) then Exit; + if ACommand in [20..20 + EventLabels.Count - 1] then + begin + AItem := bpmiLabel; + ASubItemIndex := ACommand - 20; + end + else + if ACommand in [10..13] then + begin + AItem := bpmiShowTimeAs; + ASubItemIndex := ACommand - 10; + end + else + AItem := TcxSchedulerGridBuildInPopupMenuItem(ACommand); +end; + +procedure RegisterAssistants; +begin + TcxSchedulerNullAdapter.Register; + TcxSchedulerIntegerFieldAdapter.Register; + TcxSchedulerTextFieldAdapter.Register; + TcxSchedulerCheckFieldAdapter.Register; + TcxSchedulerDateTimeFieldAdapter.Register; + TcxSchedulerImageComboFieldAdapter.Register; + TcxSchedulerIDFieldAdapter.Register; + TcxSchedulerTypeFieldAdapter.Register; + TcxSchedulerAllDayFieldAdapter.Register; + TcxSchedulerEnabledFieldAdapter.Register; + TcxSchedulerReminderFieldAdapter.Register; + TcxSchedulerLabelColorFieldAdapter.Register; + TcxSchedulerRecurringFieldAdapter.Register; + TcxSchedulerStateFieldAdapter.Register; + TcxSchedulerResourceIDFieldAdapter.Register; + TcxSchedulerCompleteFieldAdapter.Register; + TcxSchedulerLinksFieldAdapter.Register; + TcxSchedulerStatusFieldAdapter.Register; + RegisterClasses([TcxSchedulerFieldAdapterItemLink]); +end; + +procedure UnregisterAssistants; +begin + TcxSchedulerNullAdapter.Unregister; + TcxSchedulerIntegerFieldAdapter.Unregister; + TcxSchedulerTextFieldAdapter.Unregister; + TcxSchedulerCheckFieldAdapter.Unregister; + TcxSchedulerDateTimeFieldAdapter.Unregister; + TcxSchedulerImageComboFieldAdapter.Unregister; + TcxSchedulerIDFieldAdapter.Unregister; + TcxSchedulerTypeFieldAdapter.Unregister; + TcxSchedulerAllDayFieldAdapter.Unregister; + TcxSchedulerEnabledFieldAdapter.Unregister; + TcxSchedulerReminderFieldAdapter.Unregister; + TcxSchedulerLabelColorFieldAdapter.Unregister; + TcxSchedulerRecurringFieldAdapter.Unregister; + TcxSchedulerStateFieldAdapter.Unregister; + TcxSchedulerResourceIDFieldAdapter.Unregister; + TcxSchedulerCompleteFieldAdapter.Unregister; + TcxSchedulerLinksFieldAdapter.Unregister; + TcxSchedulerStatusFieldAdapter.Unregister; +end; + +initialization + RegisterAssistants; + +finalization + UnregisterAssistants; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxSchedulercxGridConnectionReg.pas b/official/x.35/ExpressScheduler 3/Sources/cxSchedulercxGridConnectionReg.pas new file mode 100644 index 00000000..5422f073 --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxSchedulercxGridConnectionReg.pas @@ -0,0 +1,78 @@ +{ } +{ Developer Express Visual Component Library } +{ ExpressScheduler } +{ } +{ Copyright (c) 2003-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSCHEDULER AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit cxSchedulercxGridConnectionReg; + +{$I cxVer.inc} + +interface + +uses + Classes, + Types, DesignIntf, DesignEditors, + cxSchedulercxGridConnection, cxSchedulerReg, cxPropEditors; + +type + + { TcxSchedulerGridConnectionGridPopupMenuEventsProperty } + + TcxSchedulerGridConnectionGridPopupMenuEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + +procedure Register; + +implementation + +{ TcxSchedulerGridConnectionGridPopupMenuEventsProperty } + +function TcxSchedulerGridConnectionGridPopupMenuEventsProperty.GetInstance: TPersistent; +begin + if (GetComponent(0) is TcxSchedulerGridConnection) then + Result := TcxSchedulerGridConnection(GetComponent(0)).GridPopupMenu + else + Result := nil; +end; + +procedure Register; +begin + RegisterComponents('Dev Express', [TcxSchedulerGridConnection]); + RegisterClasses([TcxSchedulerGridConnection]); + RegisterComponentEditor(TcxSchedulerGridConnection, cxSchedulerComponentEditor); + + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxSchedulerGridConnection, + 'GridPopupMenuEvents', TcxSchedulerGridConnectionGridPopupMenuEventsProperty); +end; + +end. diff --git a/official/x.35/ExpressScheduler 3/Sources/cxVer.inc b/official/x.35/ExpressScheduler 3/Sources/cxVer.inc new file mode 100644 index 00000000..a26364cc --- /dev/null +++ b/official/x.35/ExpressScheduler 3/Sources/cxVer.inc @@ -0,0 +1,172 @@ +{$B-} { Complete Boolean Evaluation } +{$R-} { Range-Checking } +{$T-} { Typed @ operator } +{$X+} { Extended syntax } +{$P+} { Open string params } +{$J+} { Writeable structured consts } +{$H+} { Use long strings by default } +{$Q-} { Overflow checking } + +{$DEFINE DXVER500} + +{$IFNDEF CLR} + {$DEFINE OLEDRAGANDDROP} + {$IFNDEF DONTUSEJPEGIMAGE} + {$DEFINE USEJPEGIMAGE} + {$ENDIF} +{$ENDIF} + +{$DEFINE EXPRESSBARS5} + +{$DEFINE VCL} + +{$IFNDEF VER80} + {$IFNDEF VER90} + {$IFNDEF VER93} + {$DEFINE DELPHI3} { Borland Delphi 3.0 } + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER110} { Borland C++Builder 3.0 } + {$DEFINE CBUILDER3} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE DELPHI4} +{$ENDIF} + +{$IFDEF VER125} { Borland C++Builder 4.0 } + {$DEFINE CBUILDER3} + {$DEFINE DELPHI4} + {$DEFINE CBUILDER4} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$IFDEF BCB} { Borland C++Builder 5.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$IFDEF BCB} { Borland C++Builder 6.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} +{$ENDIF} + +{$IFNDEF DELPHI6} + {$DEFINE MSWINDOWS} +{$ENDIF} +{$IFDEF LINUX} + {$UNDEF MSWINDOWS} +{$ENDIF} + +{$IFDEF LINUX} + {$DEFINE KYLIX1} { Borland Kylix 1 } + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF CompilerVersion >= 14} + {$DEFINE KYLIX2} { Borland Kylix 2 } + {$IFEND} + {$IF CompilerVersion >= 14.50} + {$DEFINE KYLIX3} { Borland Kylix 3 } + {$IFEND} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} { Borland Delphi.Net } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} +{$ENDIF} + +{$IFDEF VER170} { Borland Delphi 9.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} +{$ENDIF} + +{$IFDEF VER180} { Borland Delphi 10 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$IFDEF BCB} { Borland C++Builder 10 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Borland Delphi 11 //CodeGear} + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$DEFINE DELPHI11} + {$IFDEF BCB} { Borland C++Builder 11 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$DEFINE CBUILDER11} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFNDEF CLR} + {$IFNDEF BCB} + {$IFDEF DELPHI6} + {$DEFINE REGISTERSHELLCTRLS} + {$ENDIF} + {$ENDIF} + {$IFDEF DELPHI7} + {$WARN UNSAFE_CAST OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_TYPE OFF} + {$ENDIF} +{$ENDIF} + +{$IFDEF REGISTERSHELLCTRLS} + {$DEFINE REGISTERCXSHELLCTRLS} +{$ENDIF} + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} diff --git a/official/x.35/ExpressSideBar/Help/ESideBar.cnt b/official/x.35/ExpressSideBar/Help/ESideBar.cnt new file mode 100644 index 00000000..00de6b89 --- /dev/null +++ b/official/x.35/ExpressSideBar/Help/ESideBar.cnt @@ -0,0 +1,35 @@ +:Base ESideBar.hlp +:Title ExpressSideBar Suite +:Index ExpressSideBar Suite=ESideBar.hlp +1 ExpressSideBar Suite +2 About the ExpressSideBar=About +2 Getting Started with the ExpressSideBar=Getting_started1 +2 ExpressSideBar: Resource Strings=IDH_CD_ExpressSideBar_Resource_Strings +2 ExpressSideBar +3 Unit dxsbar=Unit_dxsbar +3 Controls +4 TdxSideBar=TdxSideBar +3 Visible Components +4 TdxSideBarStore=TdxSideBarStore +4 TdxSideBarPopupMenu=TdxSideBarPopupMenu +3 Invisible Components +4 TdxStoredSideItem=TdxStoredSideItem +3 Objects +4 TdxSideBarItem=TdxSideBarItem +4 TdxSideBarItems=TdxSideBarItems +4 TdxSideGroup=TdxSideGroup +4 TdxSideGroups=TdxSideGroups +3 Variables +4 dxSideBarDragObject=dxSideBarDragObject +2 Express ImageControl +3 Unit dximctrl=Unit_dximctrl +3 Controls +4 TdxCustomImageListBox=TdxCustomImageListBox +4 TdxImageListBox=TdxImageListBox +4 TdxCustomImageComboBox=TdxCustomImageComboBox +4 TdxImageComboBox=TdxImageComboBox +4 TdxCustomSpinImage=TdxCustomSpinImage +4 TdxSpinImage=TdxSpinImage +3 Objects +4 TdxSpinImageItem=TdxSpinImageItem +4 TdxSpinImageItems=TdxSpinImageItems diff --git a/official/x.35/ExpressSideBar/Help/ESideBar.hlp b/official/x.35/ExpressSideBar/Help/ESideBar.hlp new file mode 100644 index 00000000..e990abf6 Binary files /dev/null and b/official/x.35/ExpressSideBar/Help/ESideBar.hlp differ diff --git a/official/x.35/ExpressSideBar/Packages/dcldxSBD10.dpk b/official/x.35/ExpressSideBar/Packages/dcldxSBD10.dpk new file mode 100644 index 00000000..e2e23a63 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dcldxSBD10.dpk @@ -0,0 +1,44 @@ +package dcldxsbD10; + +{$R *.res} +{$R dxsbreg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSideBar by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxComnD10, + dxsbD10; + +contains + dxsbreg, + dxsppred, + dxsbared, + dxsbrgre, + dxsbrsed, + dximcted; + +end. diff --git a/official/x.35/ExpressSideBar/Packages/dcldxSBD10.res b/official/x.35/ExpressSideBar/Packages/dcldxSBD10.res new file mode 100644 index 00000000..0dc583c8 Binary files /dev/null and b/official/x.35/ExpressSideBar/Packages/dcldxSBD10.res differ diff --git a/official/x.35/ExpressSideBar/Packages/dcldxSBD11.dpk b/official/x.35/ExpressSideBar/Packages/dcldxSBD11.dpk new file mode 100644 index 00000000..0c6886b4 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dcldxSBD11.dpk @@ -0,0 +1,44 @@ +package dcldxsbD11; + +{$R *.res} +{$R dxsbreg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSideBar by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxComnD11, + dxsbD11; + +contains + dxsbreg, + dxsppred, + dxsbared, + dxsbrgre, + dxsbrsed, + dximcted; + +end. diff --git a/official/x.35/ExpressSideBar/Packages/dcldxSBD11.res b/official/x.35/ExpressSideBar/Packages/dcldxSBD11.res new file mode 100644 index 00000000..1a6f9e4a Binary files /dev/null and b/official/x.35/ExpressSideBar/Packages/dcldxSBD11.res differ diff --git a/official/x.35/ExpressSideBar/Packages/dcldxSBD9.dpk b/official/x.35/ExpressSideBar/Packages/dcldxSBD9.dpk new file mode 100644 index 00000000..64e658c1 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dcldxSBD9.dpk @@ -0,0 +1,44 @@ +package dcldxsbD9; + +{$R *.res} +{$R dxsbreg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSideBar by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxComnD9, + dxsbD9; + +contains + dxsbreg, + dxsppred, + dxsbared, + dxsbrgre, + dxsbrsed, + dximcted; + +end. diff --git a/official/x.35/ExpressSideBar/Packages/dcldxSBD9.res b/official/x.35/ExpressSideBar/Packages/dcldxSBD9.res new file mode 100644 index 00000000..64018b48 Binary files /dev/null and b/official/x.35/ExpressSideBar/Packages/dcldxSBD9.res differ diff --git a/official/x.35/ExpressSideBar/Packages/dcldxsbC10.bpk b/official/x.35/ExpressSideBar/Packages/dcldxsbC10.bpk new file mode 100644 index 00000000..db322204 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dcldxsbC10.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxsbC10.bpl +OBJFILES = dxsbreg.obj dximcted.obj dxsbared.obj dxsbrgre.obj dxsbrsed.obj dxsppred.obj dcldxsbC10.obj +MAINSOURCE = dcldxsbC10.cpp +RESFILES = dcldxsbC10.res dxsbreg.dcr +DEFFILE = +RESDEPEN = $(RESFILES) dximcted.dfm dxsbared.dfm dxsbrgre.dfm dxsbrsed.dfm dxsppred.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dxcomnC10.bpi dxsbC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSideBar by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSideBar/Packages/dcldxsbC10.cpp b/official/x.35/ExpressSideBar/Packages/dcldxsbC10.cpp new file mode 100644 index 00000000..20c4093a --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dcldxsbC10.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxsbC10.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxcomnC10.bpi"); +USEPACKAGE("dxsbC10.bpi"); +USEUNIT("dxsbreg.pas"); +USERES("dxsbreg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSideBar/Packages/dcldxsbC10.res b/official/x.35/ExpressSideBar/Packages/dcldxsbC10.res new file mode 100644 index 00000000..576b5f63 Binary files /dev/null and b/official/x.35/ExpressSideBar/Packages/dcldxsbC10.res differ diff --git a/official/x.35/ExpressSideBar/Packages/dcldxsbC11.bpk b/official/x.35/ExpressSideBar/Packages/dcldxsbC11.bpk new file mode 100644 index 00000000..73d73dc8 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dcldxsbC11.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxsbC11.bpl +OBJFILES = dxsbreg.obj dximcted.obj dxsbared.obj dxsbrgre.obj dxsbrsed.obj dxsppred.obj dcldxsbC11.obj +MAINSOURCE = dcldxsbC11.cpp +RESFILES = dcldxsbC11.res dxsbreg.dcr +DEFFILE = +RESDEPEN = $(RESFILES) dximcted.dfm dxsbared.dfm dxsbrgre.dfm dxsbrsed.dfm dxsppred.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dxcomnC11.bpi dxsbC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSideBar by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSideBar/Packages/dcldxsbC11.cpp b/official/x.35/ExpressSideBar/Packages/dcldxsbC11.cpp new file mode 100644 index 00000000..e4aa8882 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dcldxsbC11.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxsbC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxcomnC11.bpi"); +USEPACKAGE("dxsbC11.bpi"); +USEUNIT("dxsbreg.pas"); +USERES("dxsbreg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSideBar/Packages/dcldxsbC11.res b/official/x.35/ExpressSideBar/Packages/dcldxsbC11.res new file mode 100644 index 00000000..f6b5361e Binary files /dev/null and b/official/x.35/ExpressSideBar/Packages/dcldxsbC11.res differ diff --git a/official/x.35/ExpressSideBar/Packages/dcldxsbC6.bpk b/official/x.35/ExpressSideBar/Packages/dcldxsbC6.bpk new file mode 100644 index 00000000..53e2d041 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dcldxsbC6.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxsbC6.bpl +OBJFILES = dxsbreg.obj dximcted.obj dxsbared.obj dxsbrgre.obj dxsbrsed.obj dxsppred.obj dcldxsbC6.obj +RESFILES = dcldxsbC6.res dxsbreg.dcr +DEFFILE = +RESDEPEN = $(RESFILES) dximcted.dfm dxsbared.dfm dxsbrgre.dfm dxsbrsed.dfm dxsppred.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib +PACKAGES = rtl.bpi vcl.bpi designide.bpi dxcomnC6.bpi dxsbC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSideBar by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSideBar/Packages/dcldxsbC6.cpp b/official/x.35/ExpressSideBar/Packages/dcldxsbC6.cpp new file mode 100644 index 00000000..76b3fab8 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dcldxsbC6.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxsbC6.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("dxcomnC6.bpi"); +USEPACKAGE("dxsbC6.bpi"); +USEUNIT("dxsbreg.pas"); +USERES("dxsbreg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSideBar/Packages/dcldxsbC6.res b/official/x.35/ExpressSideBar/Packages/dcldxsbC6.res new file mode 100644 index 00000000..dd5939e7 Binary files /dev/null and b/official/x.35/ExpressSideBar/Packages/dcldxsbC6.res differ diff --git a/official/x.35/ExpressSideBar/Packages/dcldxsbD5.dpk b/official/x.35/ExpressSideBar/Packages/dcldxsbD5.dpk new file mode 100644 index 00000000..d5deb861 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dcldxsbD5.dpk @@ -0,0 +1,43 @@ +package dcldxsbd5; + +{$R *.RES} +{$R dxsbreg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressSideBar by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dxComnD5, + dxsbD5; + +contains + dxsbreg, + dximcted, + dxsbared, + dxsbrgre, + dxsbrsed, + dxsppred; + +end. diff --git a/official/x.35/ExpressSideBar/Packages/dcldxsbD5.res b/official/x.35/ExpressSideBar/Packages/dcldxsbD5.res new file mode 100644 index 00000000..84ffe5d5 Binary files /dev/null and b/official/x.35/ExpressSideBar/Packages/dcldxsbD5.res differ diff --git a/official/x.35/ExpressSideBar/Packages/dcldxsbD6.dpk b/official/x.35/ExpressSideBar/Packages/dcldxsbD6.dpk new file mode 100644 index 00000000..d30b3d3f --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dcldxsbD6.dpk @@ -0,0 +1,44 @@ +package dcldxsbD6; + +{$R *.RES} +{$R dxsbreg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressSideBar by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxComnD6, + dxsbD6; + +contains + dxsbreg, + dximcted, + dxsbared, + dxsbrgre, + dxsbrsed, + dxsppred; + +end. diff --git a/official/x.35/ExpressSideBar/Packages/dcldxsbD6.res b/official/x.35/ExpressSideBar/Packages/dcldxsbD6.res new file mode 100644 index 00000000..907d1416 Binary files /dev/null and b/official/x.35/ExpressSideBar/Packages/dcldxsbD6.res differ diff --git a/official/x.35/ExpressSideBar/Packages/dcldxsbD7.dpk b/official/x.35/ExpressSideBar/Packages/dcldxsbD7.dpk new file mode 100644 index 00000000..2107d932 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dcldxsbD7.dpk @@ -0,0 +1,44 @@ +package dcldxsbD7; + +{$R *.res} +{$R dxsbreg.dcr} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSideBar by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxComnD7, + dxsbD7; + +contains + dxsbreg, + dxsppred, + dxsbared, + dxsbrgre, + dxsbrsed, + dximcted; + +end. diff --git a/official/x.35/ExpressSideBar/Packages/dcldxsbD7.res b/official/x.35/ExpressSideBar/Packages/dcldxsbD7.res new file mode 100644 index 00000000..43cc7a6f Binary files /dev/null and b/official/x.35/ExpressSideBar/Packages/dcldxsbD7.res differ diff --git a/official/x.35/ExpressSideBar/Packages/dcldxsbc5.bpk b/official/x.35/ExpressSideBar/Packages/dcldxsbc5.bpk new file mode 100644 index 00000000..83ae5611 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dcldxsbc5.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dcldxsbc5.bpl +OBJFILES = dxsbreg.obj dximcted.obj dxsbared.obj dxsbrgre.obj dxsbrsed.obj dxsppred.obj dcldxsbc5.obj +RESFILES = dcldxsbc5.res dxsbreg.dcr +DEFFILE = +RESDEPEN = $(RESFILES) dximcted.dfm dxsbared.dfm dxsbrgre.dfm dxsbrsed.dfm dxsppred.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib +PACKAGES = VCL50.bpi dxcomnc5.bpi dxsbC5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSideBar by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpd +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSideBar/Packages/dcldxsbc5.cpp b/official/x.35/ExpressSideBar/Packages/dcldxsbc5.cpp new file mode 100644 index 00000000..ac21f5ae --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dcldxsbc5.cpp @@ -0,0 +1,19 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxsbC5.res"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("dxcomnC5.bpi"); +USEPACKAGE("dxsbC5.bpi"); +USEUNIT("dxsbreg.pas"); +USERES("dxsbreg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSideBar/Packages/dcldxsbc5.res b/official/x.35/ExpressSideBar/Packages/dcldxsbc5.res new file mode 100644 index 00000000..3d6ef72b Binary files /dev/null and b/official/x.35/ExpressSideBar/Packages/dcldxsbc5.res differ diff --git a/official/x.35/ExpressSideBar/Packages/dxSBD10.dpk b/official/x.35/ExpressSideBar/Packages/dxSBD10.dpk new file mode 100644 index 00000000..c89d2bc2 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dxSBD10.dpk @@ -0,0 +1,40 @@ +package dxsbD10; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSideBar by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl; + +contains + dximctrl, + dxreginf, + dxsbar, + dxsbstrs, + dxsbarcs; + +end. diff --git a/official/x.35/ExpressSideBar/Packages/dxSBD10.res b/official/x.35/ExpressSideBar/Packages/dxSBD10.res new file mode 100644 index 00000000..719bdf9a Binary files /dev/null and b/official/x.35/ExpressSideBar/Packages/dxSBD10.res differ diff --git a/official/x.35/ExpressSideBar/Packages/dxSBD11.dpk b/official/x.35/ExpressSideBar/Packages/dxSBD11.dpk new file mode 100644 index 00000000..914ec633 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dxSBD11.dpk @@ -0,0 +1,40 @@ +package dxsbD11; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSideBar by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl; + +contains + dximctrl, + dxreginf, + dxsbar, + dxsbstrs, + dxsbarcs; + +end. diff --git a/official/x.35/ExpressSideBar/Packages/dxSBD11.res b/official/x.35/ExpressSideBar/Packages/dxSBD11.res new file mode 100644 index 00000000..85330421 Binary files /dev/null and b/official/x.35/ExpressSideBar/Packages/dxSBD11.res differ diff --git a/official/x.35/ExpressSideBar/Packages/dxSBD9.dpk b/official/x.35/ExpressSideBar/Packages/dxSBD9.dpk new file mode 100644 index 00000000..40d80c06 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dxSBD9.dpk @@ -0,0 +1,40 @@ +package dxsbD9; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSideBar by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl; + +contains + dximctrl, + dxreginf, + dxsbar, + dxsbstrs, + dxsbarcs; + +end. diff --git a/official/x.35/ExpressSideBar/Packages/dxSBD9.res b/official/x.35/ExpressSideBar/Packages/dxSBD9.res new file mode 100644 index 00000000..54bab09c Binary files /dev/null and b/official/x.35/ExpressSideBar/Packages/dxSBD9.res differ diff --git a/official/x.35/ExpressSideBar/Packages/dxsbC10.bpk b/official/x.35/ExpressSideBar/Packages/dxsbC10.bpk new file mode 100644 index 00000000..47c1e3d8 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dxsbC10.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxsbC10.bpl +OBJFILES = dximctrl.obj dxreginf.obj dxsbar.obj dxsbarcs.obj dxsbstrs.obj dxsbC10.obj +MAINSOURCE = dxsbC10.cpp +RESFILES = dxsbC10.res +DEFFILE = +RESDEPEN = $(RESFILES) dxsbarcs.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib dxcomnC10.lib +PACKAGES = rtl.bpi vcl.bpi dxcomnC10.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSideBar by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSideBar/Packages/dxsbC10.cpp b/official/x.35/ExpressSideBar/Packages/dxsbC10.cpp new file mode 100644 index 00000000..c6ed1fd2 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dxsbC10.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxsbC10.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxcomnC10.bpi"); +USEUNIT("dximctrl.pas"); +USEUNIT("dxreginf.pas"); +USEUNIT("dxsbar.pas"); +USEFORMNS("dxsbarcs.pas", dxsbarcs, AForm); +USEUNIT("dxsbstrs.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSideBar/Packages/dxsbC10.res b/official/x.35/ExpressSideBar/Packages/dxsbC10.res new file mode 100644 index 00000000..2d4e0dd0 Binary files /dev/null and b/official/x.35/ExpressSideBar/Packages/dxsbC10.res differ diff --git a/official/x.35/ExpressSideBar/Packages/dxsbC11.bpk b/official/x.35/ExpressSideBar/Packages/dxsbC11.bpk new file mode 100644 index 00000000..fcf91301 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dxsbC11.bpk @@ -0,0 +1,138 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxsbC11.bpl +OBJFILES = dximctrl.obj dxreginf.obj dxsbar.obj dxsbarcs.obj dxsbstrs.obj dxsbC11.obj +MAINSOURCE = dxsbC11.cpp +RESFILES = dxsbC11.res +DEFFILE = +RESDEPEN = $(RESFILES) dxsbarcs.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib dxcomnC11.lib +PACKAGES = rtl.bpi vcl.bpi dxcomnC11.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSideBar by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSideBar/Packages/dxsbC11.cpp b/official/x.35/ExpressSideBar/Packages/dxsbC11.cpp new file mode 100644 index 00000000..c71c784d --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dxsbC11.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxsbC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxcomnC11.bpi"); +USEUNIT("dximctrl.pas"); +USEUNIT("dxreginf.pas"); +USEUNIT("dxsbar.pas"); +USEFORMNS("dxsbarcs.pas", dxsbarcs, AForm); +USEUNIT("dxsbstrs.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSideBar/Packages/dxsbC11.res b/official/x.35/ExpressSideBar/Packages/dxsbC11.res new file mode 100644 index 00000000..2bd56956 Binary files /dev/null and b/official/x.35/ExpressSideBar/Packages/dxsbC11.res differ diff --git a/official/x.35/ExpressSideBar/Packages/dxsbC6.bpk b/official/x.35/ExpressSideBar/Packages/dxsbC6.bpk new file mode 100644 index 00000000..27946d5c --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dxsbC6.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxsbC6.bpl +OBJFILES = dximctrl.obj dxreginf.obj dxsbar.obj dxsbarcs.obj dxsbstrs.obj dxsbC6.obj +RESFILES = dxsbC6.res +DEFFILE = +RESDEPEN = $(RESFILES) dxsbarcs.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = rtl.lib vcl.lib dxcomnC6.lib +PACKAGES = rtl.bpi vcl.bpi dxcomnC6.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSideBar by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSideBar/Packages/dxsbC6.cpp b/official/x.35/ExpressSideBar/Packages/dxsbC6.cpp new file mode 100644 index 00000000..ddffc5b3 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dxsbC6.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxsbC6.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxcomnC6.bpi"); +USEUNIT("dximctrl.pas"); +USEUNIT("dxreginf.pas"); +USEUNIT("dxsbar.pas"); +USEFORMNS("dxsbarcs.pas", dxsbarcs, AForm); +USEUNIT("dxsbstrs.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSideBar/Packages/dxsbC6.res b/official/x.35/ExpressSideBar/Packages/dxsbC6.res new file mode 100644 index 00000000..90487795 Binary files /dev/null and b/official/x.35/ExpressSideBar/Packages/dxsbC6.res differ diff --git a/official/x.35/ExpressSideBar/Packages/dxsbD5.dpk b/official/x.35/ExpressSideBar/Packages/dxsbD5.dpk new file mode 100644 index 00000000..3a41f2de --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dxsbD5.dpk @@ -0,0 +1,39 @@ +package dxsbd5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressSideBar by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50; + +contains + dximctrl, + dxreginf, + dxsbar, + dxsbarcs, + dxsbstrs; + +end. diff --git a/official/x.35/ExpressSideBar/Packages/dxsbD5.res b/official/x.35/ExpressSideBar/Packages/dxsbD5.res new file mode 100644 index 00000000..f8821a14 Binary files /dev/null and b/official/x.35/ExpressSideBar/Packages/dxsbD5.res differ diff --git a/official/x.35/ExpressSideBar/Packages/dxsbD6.dpk b/official/x.35/ExpressSideBar/Packages/dxsbD6.dpk new file mode 100644 index 00000000..f63f3463 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dxsbD6.dpk @@ -0,0 +1,40 @@ +package dxsbD6; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressSideBar by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl; + +contains + dximctrl, + dxreginf, + dxsbar, + dxsbarcs, + dxsbstrs; + +end. diff --git a/official/x.35/ExpressSideBar/Packages/dxsbD6.res b/official/x.35/ExpressSideBar/Packages/dxsbD6.res new file mode 100644 index 00000000..b897fec3 Binary files /dev/null and b/official/x.35/ExpressSideBar/Packages/dxsbD6.res differ diff --git a/official/x.35/ExpressSideBar/Packages/dxsbD7.dpk b/official/x.35/ExpressSideBar/Packages/dxsbD7.dpk new file mode 100644 index 00000000..bed5b11a --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dxsbD7.dpk @@ -0,0 +1,40 @@ +package dxsbD7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSideBar by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl; + +contains + dximctrl, + dxreginf, + dxsbar, + dxsbstrs, + dxsbarcs; + +end. diff --git a/official/x.35/ExpressSideBar/Packages/dxsbD7.res b/official/x.35/ExpressSideBar/Packages/dxsbD7.res new file mode 100644 index 00000000..a9451f59 Binary files /dev/null and b/official/x.35/ExpressSideBar/Packages/dxsbD7.res differ diff --git a/official/x.35/ExpressSideBar/Packages/dxsbc5.bpk b/official/x.35/ExpressSideBar/Packages/dxsbc5.bpk new file mode 100644 index 00000000..4e99ee94 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dxsbc5.bpk @@ -0,0 +1,137 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxsbc5.bpl +OBJFILES = dximctrl.obj dxreginf.obj dxsbar.obj dxsbarcs.obj dxsbstrs.obj dxsbc5.obj +RESFILES = dxsbc5.res +DEFFILE = +RESDEPEN = $(RESFILES) dxsbarcs.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = VCL50.lib dxcomnc5.lib +PACKAGES = VCL50.bpi dxcomnc5.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -$C- -v -JPHNE -M -LUdclstd50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L"$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSideBar by Developer Express Inc." -aa -Tpp -x -Gn -Gl -Gi -Gpr +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSideBar/Packages/dxsbc5.cpp b/official/x.35/ExpressSideBar/Packages/dxsbc5.cpp new file mode 100644 index 00000000..4337d506 --- /dev/null +++ b/official/x.35/ExpressSideBar/Packages/dxsbc5.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxsbC5.res"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("dxcomnC5.bpi"); +USEUNIT("dximctrl.pas"); +USEUNIT("dxreginf.pas"); +USEUNIT("dxsbar.pas"); +USEFORMNS("dxsbarcs.pas", dxsbarcs, AForm); +USEUNIT("dxsbstrs.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSideBar/Packages/dxsbc5.res b/official/x.35/ExpressSideBar/Packages/dxsbc5.res new file mode 100644 index 00000000..d5a80a8c Binary files /dev/null and b/official/x.35/ExpressSideBar/Packages/dxsbc5.res differ diff --git a/official/x.35/ExpressSideBar/Sources/cxVer.inc b/official/x.35/ExpressSideBar/Sources/cxVer.inc new file mode 100644 index 00000000..a26364cc --- /dev/null +++ b/official/x.35/ExpressSideBar/Sources/cxVer.inc @@ -0,0 +1,172 @@ +{$B-} { Complete Boolean Evaluation } +{$R-} { Range-Checking } +{$T-} { Typed @ operator } +{$X+} { Extended syntax } +{$P+} { Open string params } +{$J+} { Writeable structured consts } +{$H+} { Use long strings by default } +{$Q-} { Overflow checking } + +{$DEFINE DXVER500} + +{$IFNDEF CLR} + {$DEFINE OLEDRAGANDDROP} + {$IFNDEF DONTUSEJPEGIMAGE} + {$DEFINE USEJPEGIMAGE} + {$ENDIF} +{$ENDIF} + +{$DEFINE EXPRESSBARS5} + +{$DEFINE VCL} + +{$IFNDEF VER80} + {$IFNDEF VER90} + {$IFNDEF VER93} + {$DEFINE DELPHI3} { Borland Delphi 3.0 } + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER110} { Borland C++Builder 3.0 } + {$DEFINE CBUILDER3} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE DELPHI4} +{$ENDIF} + +{$IFDEF VER125} { Borland C++Builder 4.0 } + {$DEFINE CBUILDER3} + {$DEFINE DELPHI4} + {$DEFINE CBUILDER4} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$IFDEF BCB} { Borland C++Builder 5.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$IFDEF BCB} { Borland C++Builder 6.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} +{$ENDIF} + +{$IFNDEF DELPHI6} + {$DEFINE MSWINDOWS} +{$ENDIF} +{$IFDEF LINUX} + {$UNDEF MSWINDOWS} +{$ENDIF} + +{$IFDEF LINUX} + {$DEFINE KYLIX1} { Borland Kylix 1 } + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF CompilerVersion >= 14} + {$DEFINE KYLIX2} { Borland Kylix 2 } + {$IFEND} + {$IF CompilerVersion >= 14.50} + {$DEFINE KYLIX3} { Borland Kylix 3 } + {$IFEND} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} { Borland Delphi.Net } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} +{$ENDIF} + +{$IFDEF VER170} { Borland Delphi 9.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} +{$ENDIF} + +{$IFDEF VER180} { Borland Delphi 10 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$IFDEF BCB} { Borland C++Builder 10 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Borland Delphi 11 //CodeGear} + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$DEFINE DELPHI11} + {$IFDEF BCB} { Borland C++Builder 11 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$DEFINE CBUILDER11} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFNDEF CLR} + {$IFNDEF BCB} + {$IFDEF DELPHI6} + {$DEFINE REGISTERSHELLCTRLS} + {$ENDIF} + {$ENDIF} + {$IFDEF DELPHI7} + {$WARN UNSAFE_CAST OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_TYPE OFF} + {$ENDIF} +{$ENDIF} + +{$IFDEF REGISTERSHELLCTRLS} + {$DEFINE REGISTERCXSHELLCTRLS} +{$ENDIF} + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} diff --git a/official/x.35/ExpressSideBar/Sources/dximcted.dfm b/official/x.35/ExpressSideBar/Sources/dximcted.dfm new file mode 100644 index 00000000..d052b447 --- /dev/null +++ b/official/x.35/ExpressSideBar/Sources/dximcted.dfm @@ -0,0 +1,219 @@ +object frmdxImagePropEditor: TfrmdxImagePropEditor + Left = 251 + Top = 167 + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'Express Image Items editor: ' + ClientHeight = 321 + ClientWidth = 282 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 207 + Top = 0 + Width = 75 + Height = 208 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object bAdd: TButton + Left = 2 + Top = 5 + Width = 72 + Height = 22 + Caption = '&Add' + TabOrder = 0 + OnClick = bAddClick + end + object bInsert: TButton + Left = 2 + Top = 30 + Width = 72 + Height = 22 + Caption = '&Insert' + TabOrder = 1 + OnClick = bInsertClick + end + object bDelete: TButton + Left = 2 + Top = 54 + Width = 72 + Height = 22 + Caption = 'De&lete' + TabOrder = 2 + OnClick = bDeleteClick + end + object bUp: TButton + Left = 2 + Top = 102 + Width = 72 + Height = 22 + Caption = 'Move &up' + TabOrder = 4 + OnClick = bUpClick + end + object bDown: TButton + Left = 2 + Top = 126 + Width = 72 + Height = 22 + Caption = 'Move d&own' + TabOrder = 5 + OnClick = bDownClick + end + object bClear: TButton + Left = 2 + Top = 78 + Width = 72 + Height = 22 + Caption = 'Clear' + TabOrder = 3 + OnClick = bClearClick + end + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 207 + Height = 208 + Align = alClient + BevelInner = bvLowered + BevelOuter = bvNone + BorderWidth = 3 + TabOrder = 2 + object ListBox: TdxImageListBox + Left = 4 + Top = 4 + Width = 199 + Height = 200 + Alignment = taLeftJustify + ImageAlign = dxliLeft + ItemHeight = 0 + MultiLines = True + VertAlignment = tvaCenter + Align = alClient + DragMode = dmAutomatic + TabOrder = 0 + OnClick = ListBoxClick + OnDragDrop = ListBoxDragDrop + OnDragOver = ListBoxDragOver + SaveStrings = () + end + end + object Panel3: TPanel + Left = 0 + Top = 208 + Width = 282 + Height = 113 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + object LabelText: TLabel + Left = 6 + Top = 8 + Width = 21 + Height = 13 + Caption = 'Text' + end + object LabelValue: TLabel + Left = 7 + Top = 32 + Width = 27 + Height = 13 + Caption = 'Value' + end + object LabelImageIndex: TLabel + Left = 6 + Top = 60 + Width = 58 + Height = 13 + Caption = 'Image Index' + end + object Edit1: TEdit + Left = 40 + Top = 5 + Width = 239 + Height = 21 + Enabled = False + TabOrder = 0 + OnExit = Edit1Exit + end + object Edit3: TEdit + Left = 40 + Top = 30 + Width = 168 + Height = 21 + TabOrder = 1 + OnExit = Edit3Exit + end + object Edit2: TEdit + Left = 93 + Top = 57 + Width = 115 + Height = 21 + Enabled = False + TabOrder = 2 + OnExit = Edit2Exit + OnKeyPress = Edit2KeyPress + end + object BOk: TButton + Left = 51 + Top = 85 + Width = 72 + Height = 22 + Caption = '&Ok' + Default = True + ModalResult = 1 + TabOrder = 4 + end + object bCancel: TButton + Left = 129 + Top = 85 + Width = 72 + Height = 22 + Cancel = True + Caption = '&Cancel' + ModalResult = 2 + TabOrder = 5 + end + object bHelp: TButton + Left = 207 + Top = 85 + Width = 72 + Height = 22 + Caption = '&Help' + TabOrder = 6 + OnClick = bHelpClick + end + object SpinImage: TdxSpinImage + Left = 213 + Top = 30 + Width = 66 + Height = 49 + AutoSize = False + BorderStyle = bsSingle + DefaultImages = True + ImageHAlign = hsiCenter + ImageVAlign = vsiCenter + Items = <> + ItemIndex = -1 + ReadOnly = False + Stretch = True + UpDownAlign = udaRight + UpDownOrientation = siVertical + UpDownWidth = 16 + UseDblClick = True + OnChange = SpinImageChange + Color = clWhite + TabOrder = 3 + end + end +end diff --git a/official/x.35/ExpressSideBar/Sources/dximcted.pas b/official/x.35/ExpressSideBar/Sources/dximcted.pas new file mode 100644 index 00000000..d16b7a04 --- /dev/null +++ b/official/x.35/ExpressSideBar/Sources/dximcted.pas @@ -0,0 +1,308 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express image controls editor } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dximcted; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls, dximctrl; + +type + TfrmdxImagePropEditor = class(TForm) + Panel1: TPanel; + bAdd: TButton; + bInsert: TButton; + bDelete: TButton; + Panel2: TPanel; + Panel3: TPanel; + Edit1: TEdit; + ListBox: TdxImageListBox; + bUp: TButton; + bDown: TButton; + LabelText: TLabel; + bClear: TButton; + LabelValue: TLabel; + Edit3: TEdit; + LabelImageIndex: TLabel; + Edit2: TEdit; + BOk: TButton; + bCancel: TButton; + bHelp: TButton; + SpinImage: TdxSpinImage; + procedure Edit2KeyPress(Sender: TObject; var Key: Char); + procedure Edit2Exit(Sender: TObject); + procedure bAddClick(Sender: TObject); + procedure bInsertClick(Sender: TObject); + procedure bDeleteClick(Sender: TObject); + procedure Edit1Exit(Sender: TObject); + procedure ListBoxClick(Sender: TObject); + procedure bUpClick(Sender: TObject); + procedure bDownClick(Sender: TObject); + procedure ListBoxDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure ListBoxDragDrop(Sender, Source: TObject; X, Y: Integer); + procedure bClearClick(Sender: TObject); + procedure Edit3Exit(Sender: TObject); + procedure SpinImageChange(Sender: TObject; ItemIndex: Integer); + procedure bHelpClick(Sender: TObject); + private + public + end; + +function ExpressImageItemsPropEditor(Control : TWinControl) : Boolean; + +implementation +uses dxsbstrs; + +function ExpressImageItemsPropEditor(Control : TWinControl) : Boolean; +Var + Form : TfrmdxImagePropEditor; +begin + Result := False; + Form := TfrmdxImagePropEditor.Create(Nil); + Form.Caption := Form.Caption + Control.Name; + if(Control is TdxCustomImageListBox) then + Form.ListBox.Assign(TdxCustomImageListBox(Control)); + if(Control is TdxImageComboBox) then + Form.ListBox.Assign(TdxImageComboBox(Control)); + Form.Edit3.Visible := True; + Form.LabelValue.Visible := True; + Form.SpinImage.ImageList := Form.ListBox.ImageList; + Form.SpinImage.ItemIndex := -1; + if(Form.ListBox.Items.Count > 0) then + Form.ListBox.ItemIndex := 0; + Form.ListBoxClick(Nil); + Form.ShowModal; + if(Form.ModalResult = mrOk) then begin + if(Control is TdxCustomImageListBox) then + TdxCustomImageListBox(Control).Assign(Form.ListBox); + if(Control is TdxImageComboBox) then + TdxImageComboBox(Control).Assign(Form.ListBox); + Result := True; + end; + Form.Free; +end; + +{$R *.DFM} + +procedure TfrmdxImagePropEditor.Edit2KeyPress(Sender: TObject; var Key: Char); +begin + if((Key < '0') Or (Key > '9')) And (Key <> Char(VK_BACK)) + And ((Key <> '-') Or ((Edit2.Text <> '') And (Edit2.Text <> Edit2.SelText))) then begin + Key := #0; + MessageBeep(0); + end; +end; + +procedure TfrmdxImagePropEditor.Edit2Exit(Sender: TObject); +begin + if(ListBox.ItemIndex > -1) and (ListBox.Items.Count > 0) then begin + if(Edit2.Text = '-') then + Edit2.Text := '-1'; + SpinImage.ItemIndex := StrToInt(Edit2.Text); + ListBox.ImageIndexes[ListBox.ItemIndex] := SpinImage.ItemIndex; + end; +end; + +procedure TfrmdxImagePropEditor.bAddClick(Sender: TObject); +begin + ListBox.AddItem(dxSideBarGetResourceString(@DXSB_NEWITEM), -1); + ListBox.ItemIndex := ListBox.Items.Count - 1; + ListBoxClick(Sender); + Edit1.SetFocus; +end; + +procedure TfrmdxImagePropEditor.bInsertClick(Sender: TObject); +begin + if(ListBox.ItemIndex > -1) and (ListBox.Items.Count > 0) then begin + ListBox.InsertItem(ListBox.ItemIndex - 1, 'New Item', -1); + ListBoxClick(Sender); + Edit1.SetFocus; + end + else bAddClick(Sender); +end; + +procedure TfrmdxImagePropEditor.bDeleteClick(Sender: TObject); +Var + index : Integer; +begin + if(ListBox.ItemIndex > -1) and (ListBox.Items.Count > 0) then begin + index := ListBox.ItemIndex; + ListBox.Items.Delete(ListBox.ItemIndex); + if(index < ListBox.Items.Count) then + ListBox.ItemIndex := index + else if (index > 0) then + ListBox.ItemIndex := index - 1; + ListBoxClick(Sender); + end; +end; + +procedure TfrmdxImagePropEditor.Edit1Exit(Sender: TObject); +Var + index, imindex : Integer; + St : String; +begin + if (ListBox.Items.Count > 0) + and (Edit1.Text <> ListBox.Items[ListBox.ItemIndex]) then begin + St := Edit1.Text; + imindex := ListBox.ImageIndexes[ListBox.ItemIndex]; + index := ListBox.ItemIndex; + ListBox.Items.Delete(index); + ListBox.InsertItem(index, St, imindex); + ListBox.ItemIndex := index; + end; +end; + +type +TtempAutoImageListBox = class(TdxImageListBox) +public + property Values; +end; + +procedure TfrmdxImagePropEditor.ListBoxClick(Sender: TObject); +begin + Edit1.Enabled := (ListBox.ItemIndex > -1) and (ListBox.Items.Count > 0); + Edit2.Enabled := Edit1.Enabled; + SpinImage.Enabled := Edit1.Enabled; + bDelete.Enabled := Edit1.Enabled; + bUp.Enabled := Edit1.Enabled; + bDown.Enabled := Edit1.Enabled; + Edit3.Enabled := Edit1.Enabled; + if(Edit1.Enabled) then begin + Edit1.Text := ListBox.Items[ListBox.ItemIndex]; + Edit2.Text := IntToStr(ListBox.ImageIndexes[ListBox.ItemIndex]); + SpinImage.ItemIndex := ListBox.ImageIndexes[ListBox.ItemIndex]; + Edit3.Text := TtempAutoImageListBox(ListBox).Values[ListBox.ItemIndex]; + end else begin + Edit1.Text := ''; + Edit2.Text := ''; + Edit3.Text := ''; + SpinImage.ItemIndex := -1; + end; +end; + +procedure TfrmdxImagePropEditor.bUpClick(Sender: TObject); +Var + index : Integer; +begin + if(ListBox.ItemIndex > 0) and (ListBox.Items.Count > 0) then begin + index := ListBox.ItemIndex; + ListBox.ExchangeItems(index, index - 1); + ListBox.ItemIndex := index - 1; + end; +end; + +procedure TfrmdxImagePropEditor.bDownClick(Sender: TObject); +Var + index : Integer; +begin + if(ListBox.ItemIndex < ListBox.Items.Count - 1) then begin + index := ListBox.ItemIndex; + ListBox.ExchangeItems(index, index + 1); + ListBox.ItemIndex := index + 1; + end; +end; + +procedure TfrmdxImagePropEditor.ListBoxDragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); +Var + p : TPoint; + item : Integer; +begin + Accept := False; + p.x := X; + p.y := Y; + item := ListBox.ItemAtPos(p, True); + if(item > -1) And (item < ListBox.Items.Count) then + Accept := Not ListBox.Selected[Item]; +end; + +procedure TfrmdxImagePropEditor.ListBoxDragDrop(Sender, Source: TObject; X, + Y: Integer); +Var + p : TPoint; + Item, Item1 : Integer; + flag : Boolean; +begin + ListBoxDragOver(Sender, Source, X, Y, dsDragLeave, flag); + if Not flag then exit; + p.x := X; + p.y := Y; + item := ListBox.ItemAtPos(p, True); + if(item > -1) And (item < ListBox.Items.Count) then begin + if(Item > ListBox.ItemIndex) then + Inc(Item); + ListBox.InsertItem(Item, ListBox.Items[ListBox.ItemIndex], + ListBox.ImageIndexes[ListBox.ItemIndex]); + item1 := ListBox.ItemIndex; + ListBox.Items.Delete(Item1); + if(Item >= Item1) then + Dec(Item); + ListBox.ItemIndex := Item; + end; +end; + +procedure TfrmdxImagePropEditor.bClearClick(Sender: TObject); +begin + ListBox.Items.Clear; + ListBoxClick(Sender); +end; + +procedure TfrmdxImagePropEditor.Edit3Exit(Sender: TObject); +begin + if(ListBox.ItemIndex > -1) and (ListBox.Items.Count > 0) + and (Edit3.Text <> TtempAutoImageListBox(ListBox).Values[ListBox.ItemIndex]) then + TtempAutoImageListBox(ListBox).Values[ListBox.ItemIndex] := Edit3.Text; +end; + +procedure TfrmdxImagePropEditor.SpinImageChange(Sender: TObject; + ItemIndex: Integer); +begin + if(ListBox.ItemIndex > -1) and (ListBox.Items.Count > 0) then begin + Edit2.Text := IntToStr(ItemIndex); + Edit2Exit(Sender); + end; +end; + +procedure TfrmdxImagePropEditor.bHelpClick(Sender: TObject); +begin +// Application.HelpFile := 'aob_ps.hlp'; +// Application.HelpContext(10001); +end; + +end. diff --git a/official/x.35/ExpressSideBar/Sources/dximctrl.pas b/official/x.35/ExpressSideBar/Sources/dximctrl.pas new file mode 100644 index 00000000..c652a9c0 --- /dev/null +++ b/official/x.35/ExpressSideBar/Sources/dximctrl.pas @@ -0,0 +1,1918 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express image controls } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dximctrl; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI4} + ImgList, +{$ENDIF} +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls; + +type + TdxImageAlign = (dxliLeft, dxliRight); + TVertAlignment = (tvaTop, tvaCenter, tvaBottom); + TdxImageDrawItemEvent = procedure(Sender : TObject; Index: Integer; Rect: TRect) of object; + +TdxCustomImageListBox = class(TCustomListBox) +private + FImageList : TCustomImageList; + FChangeLink : TChangeLink; + FAlignment : TAlignment; + FVertAlignment : TVertAlignment; + FImageAlign : TdxImageAlign; + FMultiLines : Boolean; + FItemHeight : Integer; + FOnDrawItem : TdxImageDrawItemEvent; + FDrawEdgeIndex : Integer; + FDrawImageOnly : Boolean; + FDeletedSt : String; + FDeletedIndex : Integer; + FHintWindow : THintWindow; + FHintWindowShowing : Boolean; + FHintIndex : Integer; + FItemTextHeight : Integer; + + function GetImageIndex(Index : Integer) : Integer; + function GetValue(Index : Integer) : String; + procedure SetImageIndex(Index : Integer; Value : Integer); + procedure SetImageList(Value : TCustomImageList); + procedure SetAlignment(Value : TAlignment); + procedure SetImageAlign(Value : TdxImageAlign); + procedure SetItemHeight(Value : Integer); + procedure SetMultiLines(Value : Boolean); + procedure SetVertAlignment(Value : TVertAlignment); + procedure SetValue(Index : Integer; const Value : String); + procedure StringsRead(Reader: TReader); + procedure StringsWrite(Writer: TWriter); + procedure SetInheritedItemHeight; + procedure OnChangeLink(Sender : TObject); + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; + procedure CNDrawItem(var Message: TWMDrawItem); message CN_DRAWITEM; + function GetImageRect(ItemIndex : Integer) : TRect; + procedure DrawImageFocus(Index : Integer); +protected + FStrings : TStrings; + procedure DrawItem(Index: Integer; Rect: TRect; + State: TOwnerDrawState); override; + procedure DefineProperties(Filer: TFiler); override; + procedure Notification(AComponent: TComponent; + Operation: TOperation); override; + procedure WndProc(var Message : TMessage); override; + function ValuesIndexOf(Text : String) : Integer; + + property Alignment : TAlignment read FAlignment write SetAlignment; + property ImageAlign : TdxImageAlign read FImageAlign write SetImageAlign; + property ItemHeight : Integer read FItemHeight write SetItemHeight; + property ImageList : TCustomImageList read FImageList write SetImageList; + property MultiLines : Boolean read FMultiLines write SetMultiLines; + property VertAlignment : TVertAlignment read FVertAlignment write SetVertAlignment; + property OnDrawItem : TdxImageDrawItemEvent read FOnDrawItem write FOnDrawItem; +public + constructor Create(AOwner : TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure AddItem(St :String; ImageIndex : Integer); {$IFDEF DELPHI6} reintroduce;{$ENDIF} + procedure InsertItem(Index: Integer; St :String; ImageIndex : Integer); + procedure ExchangeItems(Index1, Index2: Integer); + procedure MoveItem(CurIndex, NewIndex: Integer); + + property ImageIndexes[Index : Integer] : Integer read GetImageIndex write SetImageIndex; + property Values[Index : Integer] : String read GetValue write SetValue; +end; + +TdxImageListBox = class(TdxCustomImageListBox) +published + property Alignment; + property ImageAlign; + property ItemHeight; + property ImageList; + property MultiLines; + property VertAlignment; + property OnDrawItem; + + property ExtendedSelect; + property MultiSelect; + + property Align; + property BorderStyle; + property Color; + property Columns; + property Ctl3D; + property DragCursor; + property DragMode; + property Enabled; + property Font; + property IntegralHeight; + property Items; + property ParentColor; + property ParentCtl3D; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property ShowHint; + property Sorted; + property TabOrder; + property TabStop; + property TabWidth; + property Visible; + property OnClick; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDrag; + {$IFDEF DELPHI4} + property Anchors; + property Constraints; + property OnStartDock; + property OnEndDock; + {$ENDIF} +end; + +TdxCustomImageComboBox = class(TCustomComboBox) +private + FImageList : TCustomImageList; + FChangeLink : TChangeLink; + FAlignment : TAlignment; + FVertAlignment : TVertAlignment; + FImageAlign : TdxImageAlign; + FMultiLines : Boolean; + FItemHeight : Integer; + FOnDrawItem : TdxImageDrawItemEvent; + FDeletedSt : String; + FDeletedIndex : Integer; + + function GetImageIndex(Index : Integer) : Integer; + function GetValue(INdex : Integer) : String; + procedure SetImageIndex(Index : Integer; Value : Integer); + procedure SetImageList(Value : TCustomImageList); + procedure SetAlignment(Value : TAlignment); + procedure SetImageAlign(Value : TdxImageAlign); + procedure SetInternalItemHeight(Value : Integer); + procedure SetMultiLines(Value : Boolean); + procedure SetVertAlignment(Value : TVertAlignment); + procedure SetValue(Index : Integer; const Value : String); + procedure StringsRead(Reader: TReader); + procedure StringsWrite(Writer: TWriter); + procedure SetInheritedItemHeight; + procedure OnChangeLink(Sender : TObject); + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; +protected + FStrings : TStrings; + procedure DrawItem(Index: Integer; Rect: TRect; + State: TOwnerDrawState); override; + procedure DefineProperties(Filer: TFiler); override; + procedure Notification(AComponent: TComponent; + Operation: TOperation); override; + procedure WndProc(var Message : TMessage); override; + function ValuesIndexOf(Text : String) : Integer; +protected + property Alignment : TAlignment read FAlignment write SetAlignment; + property ImageAlign : TdxImageAlign read FImageAlign write SetImageAlign; + property ItemHeight : Integer read FItemHeight write SetInternalItemHeight; + property ImageList : TCustomImageList read FImageList write SetImageList; + property MultiLines : Boolean read FMultiLines write SetMultiLines; + property VertAlignment : TVertAlignment read FVertAlignment write SetVertAlignment; + property OnDrawItem : TdxImageDrawItemEvent read FOnDrawItem write FOnDrawItem; +public + constructor Create(AOwner : TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure AddItem(St :String; ImageIndex : Integer); {$IFDEF DELPHI6} reintroduce;{$ENDIF} + procedure InsertItem(Index: Integer; St :String; ImageIndex : Integer); + procedure ExchangeItems(Index1, Index2: Integer); + procedure MoveItem(CurIndex, NewIndex: Integer); + + property Values[Index : Integer] : String read GetValue write SetValue; + property ImageIndexes[Index : Integer] : Integer read GetImageIndex write SetImageIndex; +end; + +TdxImageComboBox = class(TdxCustomImageComboBox) +published + property Alignment; + property ImageAlign; + property ItemHeight; + property ImageList; + property MultiLines; + property VertAlignment; + property OnDrawItem; + + property Color; + property Ctl3D; + property DragMode; + property DragCursor; + property DropDownCount; + property Enabled; + property Font; + property Items; + property MaxLength; + property ParentColor; + property ParentCtl3D; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property ShowHint; + property Sorted; + property TabOrder; + property TabStop; + property Visible; + property OnChange; + property OnClick; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnDropDown; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnStartDrag; + {$IFDEF DELPHI4} + property Anchors; + property Constraints; + property OnStartDock; + property OnEndDock; + {$ENDIF} +end; + +TdxUpDownAlign = (udaBottom, udaLeft, udaRight, udaTop); +TdxHSpinImageAlign = (hsiLeft, hsiCenter, hsiRight); +TdxVSpinImageAlign = (vsiTop, vsiCenter, vsiBottom); + +TdxSpinImageItems = class; +TdxCustomSpinImage = class; + +TdxSpinImageItem = class(TCollectionItem) +private + Owner : TdxSpinImageItems; + FImageIndex : Integer; + FValue : String; + FHint : String; + + procedure SetImageIndex(Value : Integer); + procedure SetValue(Value : String); + procedure SetHint(Value : String); +public + constructor Create(Collection : TCollection); override; + procedure Assign(Source: TPersistent); override; +published + property ImageIndex : Integer read FImageIndex write SetImageIndex; + property Hint : String read FHint write SetHint; + property Value : String read FValue write SetValue; +end; + +TdxSpinImageItems = class(TCollection) +private + Owner : TdxCustomSpinImage; + + function GetItem(Index : Integer) : TdxSpinImageItem; + procedure SetItem(Index : Integer; Value : TdxSpinImageItem); +protected + procedure Update(Item: TCollectionItem); override; +public + constructor Create(AOwner : TdxCustomSpinImage); + + function Add : TdxSpinImageItem; + function IndexOf(Value : String) : Integer; + property Items[Index : Integer] : TdxSpinImageItem read GetItem write SetItem; default; +end; + +TdxSIChange = procedure(Sender: TObject; ItemIndex: Integer) of object; +TdxsiOrientation = (siHorizontal, siVertical); + +TdxCustomSpinImage = class(TCustomControl) +private + FTimer: TTimer; + FScrollTimerCount: Integer; + + FAutoSize : Boolean; + FDefaultImages : Boolean; + FBorderStyle: TBorderStyle; + FChangeLink : TChangeLink; + FItemIndex : Integer; + FImageList : TCustomImageList; + FImageHAlign : TdxHSpinImageAlign; + FImageVAlign : TdxVSpinImageAlign; + FItems : TdxSpinImageItems; + FOnChange : TdxSIChange; + FReadOnly : Boolean; + FUseDblClick : Boolean; + + FStretch : Boolean; + FUpDownAlign : TdxUpDownAlign; + FUpDownOrientation: TdxsiOrientation; + FUpDownWidth : Integer; + FNCSide : Integer; + FUpPress : Boolean; + FDownPress : Boolean; + FUpButtonRect : TRect; + FDownButtonRect : TRect; + FUpButtonEnabled : Boolean; + FDownButtonEnabled : Boolean; + + procedure SetInternalAutoSize(Value : Boolean); + procedure SetBorderStyle(Value : TBorderStyle); + procedure SetDefaultImages(Value : Boolean); + procedure SetItemIndex(Value : Integer); + procedure SetImageList(Value : TCustomImageList); + procedure SetImageHAlign(Value : TdxHSpinImageAlign); + procedure SetImageVAlign(Value : TdxVSpinImageAlign); + procedure SetItems(Value : TdxSpinImageItems); + procedure SetStretch(Value : Boolean); + procedure SetUpDownAlign(Value : TdxUpDownAlign); + procedure SetUpDownOrientation(Value : TdxsiOrientation); + procedure SetUpDownWidth(Value : Integer); + procedure CMEnter(var Message: TCMEnter); message CM_ENTER; + procedure CMExit(var Message: TCMExit); message CM_EXIT; + procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED; + procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; + procedure WMLButtonDblClk(var Message: TWMLButtonDblClk); message WM_LBUTTONDBLCLK; + procedure WMGetDlgCode(var Msg: TWMGetDlgCode); message WM_GETDLGCODE; + procedure WMNCCalcSize(var Message : TWMNCCalcSize); message WM_NCCALCSIZE; + procedure WMNCPaint(var Message : TWMNCPaint); message WM_NCPAINT; + procedure WMNCLButtonDblClk(var Message : TWMNCLBUTTONDOWN); message WM_NCLBUTTONDBLCLK; + procedure WMNCMouseDown(var Message : TWMNCLBUTTONDOWN); message WM_NCLBUTTONDOWN; + procedure WMNCMouseUp(var Message : TWMNCLBUTTONUP); message WM_NCLBUTTONUP; + procedure WMMouseUp(var Message : TWMLBUTTONUP); message WM_LBUTTONUP; + procedure WMNCHitTest(var Message : TWMNCHITTEST); message WM_NCHITTEST; + procedure UpDownClick(AKey : Word); + procedure OnChangeLink(Sender : TObject); + procedure MakeAutoSize; + procedure SetNextItem; + function IsLastItem : Boolean; + procedure UpdateNCRegion; + procedure NCMouseDown(X, Y : Integer); + procedure DoTimerScroll(Sender: TObject); +protected + procedure CreateWnd; override; + procedure CreateParams(var Params: TCreateParams); override; + procedure Notification(AComponent: TComponent; + Operation: TOperation); override; + procedure Paint; override; + + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyUp(var Key: Word; Shift: TShiftState); override; + + procedure Change; virtual; + function CanChange : Boolean; virtual; + procedure UpdateItems; virtual; + + property AutoSize : Boolean read FAutoSize write SetInternalAutoSize; + property BorderStyle: TBorderStyle read FBorderStyle write SetBorderStyle; + property DefaultImages : Boolean read FDefaultImages write SetDefaultImages; + property ImageHAlign : TdxHSpinImageAlign read FImageHAlign write SetImageHAlign; + property ImageVAlign : TdxVSpinImageAlign read FImageVAlign write SetImageVAlign; + property ItemIndex : Integer read FItemIndex write SetItemIndex; + property ReadOnly : Boolean read FReadOnly write FReadOnly; + property Stretch : Boolean read FStretch write SetStretch; + property UpDownAlign : TdxUpDownAlign read FUpDownAlign write SetUpDownAlign; + property UpDownOrientation: TdxsiOrientation read FUpDownOrientation + write SetUpDownOrientation; + property UpDownWidth : Integer read FUpDownWidth write SetUpDownWidth; + property UseDblClick : Boolean read FUseDblClick write FUseDblClick; + property OnChange : TdxSIChange read FOnChange write FOnChange; +public + constructor Create(AOwner : TComponent); override; + destructor Destroy; override; + + property ImageList : TCustomImageList read FImageList write SetImageList; + property Items : TdxSpinImageItems read FItems write SetItems; +end; + +TdxSpinImage = class(TdxCustomSpinImage) +published + property AutoSize; + property BorderStyle; + property DefaultImages; + property ImageList; + property ImageHAlign; + property ImageVAlign; + property Items; + property ItemIndex; + property ReadOnly; + property Stretch; + property UpDownAlign; + property UpDownOrientation; + property UpDownWidth; + property UseDblClick; + property OnChange; + + property Align; + property Color; + property Ctl3D; + property DragCursor; + property DragMode; + property Enabled; + property Font; + property ParentColor default False; + property ParentCtl3D; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property ShowHint; + property TabOrder; + property TabStop default True; + property Visible; + property OnClick; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDrag; + {$IFDEF DELPHI4} + property Anchors; + property Constraints; + property OnStartDock; + property OnEndDock; + {$ENDIF} +end; + +implementation + +{TdxCustomImageListBox} +constructor TdxCustomImageListBox.Create(AOwner : TComponent); +begin + inherited; + FStrings := TStringList.Create; + FChangeLink := TChangeLink.Create; + FChangeLink.OnChange := OnChangeLink; + FHintWindow := THintWindow.Create(self); + FHintWindowShowing := False; + FHintIndex := -1; + + Style := lbOwnerDrawFixed; + FItemHeight := 0; + FVertAlignment := tvaCenter; + FDrawEdgeIndex := -1; + FDrawImageOnly := False; + FDeletedIndex := -1; +end; + +destructor TdxCustomImageListBox.Destroy; +begin + FHintWindow.Free; + FChangeLink.Free; + FStrings.Free; + inherited; +end; + +procedure TdxCustomImageListBox.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (FImageList <> nil) and + (AComponent = FImageList) then ImageList := nil; +end; + +procedure TdxCustomImageListBox.Assign(Source: TPersistent); +Var + lb : TdxCustomImageComboBox; + lb1 : TdxCustomImageListBox; +begin + if(Source is TdxCustomImageComboBox) + Or(Source is TdxCustomImageListBox) then begin + if(Source is TdxCustomImageComboBox) then begin + lb := TdxCustomImageComboBox(Source); + FImageList := lb.FImageList; + Items.Assign(lb.Items); + FStrings.Assign(lb.FStrings); + FImageAlign := lb.FImageAlign; + FAlignment := lb.FAlignment; + MultiLines := lb.MultiLines; + ItemHeight := lb.ItemHeight; + FVertAlignment := lb.FVertAlignment; + Font := lb.Font; + end; + if(Source is TdxCustomImageListBox) then begin + lb1 := TdxCustomImageListBox(Source); + FImageList := lb1.FImageList; + IntegralHeight := lb1.IntegralHeight; + ItemHeight := lb1.ItemHeight; + Items.Assign(lb1.Items); + FStrings.Assign(lb1.FStrings); + FImageAlign := lb1.FImageAlign; + FAlignment := lb1.FAlignment; + MultiLines := lb1.MultiLines; + FVertAlignment := lb1.FVertAlignment; + Font := lb1.Font; + end; + SetInheritedItemHeight; + Repaint; + end + else inherited; +end; + +function TdxCustomImageListBox.GetImageIndex(Index : Integer) : Integer; +Var + St : String; +begin + Result := -1; + if(Index < FStrings.Count) then begin + St := FStrings[Index]; + if(Pos(',', St) > 0) then begin + St := Copy(St, 1, Pos(',', St) - 1); + if(St <> '') then + Result := StrToInt(St); + end; + end; +end; + +function TdxCustomImageListBox.GetValue(Index : Integer) : String; +begin + Result := ''; + if(Index < FStrings.Count) And (Pos(',', FStrings[Index]) > 0) then + Result := Copy(FStrings[Index], Pos(',', FStrings[Index]) + 1, 1000); +end; + +procedure TdxCustomImageListBox.SetImageIndex(Index : Integer; Value : Integer); +Var + St : String; +begin + if(Index < FStrings.Count) And (Index > -1) + And (Value <> ImageIndexes[Index])then begin + St := Values[Index]; + FStrings[Index] := IntToStr(Value) + ',' + St; + if(HandleAllocated) then Repaint; + end; +end; + +procedure TdxCustomImageListBox.SetAlignment(Value : TAlignment); +begin + if(Value <> FAlignment) then begin + FAlignment := Value; + Repaint; + end; +end; + +procedure TdxCustomImageListBox.SetVertAlignment(Value : TVertAlignment); +begin + if(Value <> FVertAlignment) then begin + FVertAlignment := Value; + Repaint; + end; +end; + +procedure TdxCustomImageListBox.SetImageAlign(Value : TdxImageAlign); +begin + if(Value <> FImageAlign) then begin + FImageAlign := Value; + Repaint; + end; +end; + +procedure TdxCustomImageListBox.SetImageList(Value : TCustomImageList); +begin + if(Value <> FImageList) then begin + if(FImageList <> Nil) then + FImageList.UnRegisterChanges(FChangeLink); + FImageList := Value; + if(FImageList <> Nil) then + FImageList.RegisterChanges(FChangeLink); + SetInheritedItemHeight; + end; +end; + +procedure TdxCustomImageListBox.SetItemHeight(Value : Integer); +begin + if(Value <> FItemHeight) then begin + if(Value < 10) then + FItemHeight := 0 + else FItemHeight := Value; + SetInheritedItemHeight; + end; +end; + +procedure TdxCustomImageListBox.SetMultiLines(Value : Boolean); +begin + if(Value <> FMultiLines) then begin + FMultiLines := Value; + Repaint; + end; +end; + +procedure TdxCustomImageListBox.SetValue(Index : Integer; const Value : String); +Var + St : String; +begin + if(Index < FStrings.Count) And (Index > -1) + And (Value <> Values[Index])then begin + St := IntToStr(ImageIndexes[Index]); + FStrings[Index] := St + ',' + Value; + end; +end; + +procedure TdxCustomImageListBox.AddItem(St :String; ImageIndex : Integer); +begin + Items.Add(St); + SetImageIndex(Items.Count -1, ImageIndex); +end; + +procedure TdxCustomImageListBox.InsertItem(Index : Integer; + St :String; ImageIndex : Integer); +begin + if(Index < 0) then Index := 0; + if(Index >= Items.Count) then + AddItem(St, ImageIndex) + else begin + Items.Insert(Index, St); + SetImageIndex(Index, ImageIndex); + end; +end; + +procedure TdxCustomImageListBox.ExchangeItems(Index1, Index2 : Integer); +var + flag : Boolean; + St1, St2 : string; +begin + flag := (Index1 > -1 ) And (Index1 < Items.Count) + And (Index2 > -1 ) And (Index2 < Items.Count); + if(flag) then begin + St1 := FStrings[Index1]; + St2 := FStrings[Index2]; + end; + Items.Exchange(Index1, Index2); + if(flag) then begin + FStrings[Index1] := St2; + FStrings[Index2] := St1; + end; +end; + +procedure TdxCustomImageListBox.MoveItem(CurIndex, NewIndex: Integer); +Var + TempString: string; +begin + if (CurIndex <> NewIndex) And (CurIndex > -1) And (CurIndex < Items.Count) then begin + TempString := FStrings[CurIndex]; + Items.Move(CurIndex, NewIndex); + FStrings[NewIndex] := TempString; + end; +end; + +procedure TdxCustomImageListBox.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('SaveStrings', StringsRead, StringsWrite, True); +end; + +procedure TdxCustomImageListBox.StringsRead(Reader: TReader); +begin + Reader.ReadListBegin; + FStrings.Clear; + while not Reader.EndOfList do + FStrings.Add(Reader.ReadString); + Reader.ReadListEnd; +end; + +procedure TdxCustomImageListBox.StringsWrite(Writer: TWriter); +var + i: Integer; +begin + Writer.WriteListBegin; + for i := 0 to FStrings.Count - 1 do + Writer.WriteString(FStrings[I]); + Writer.WriteListEnd; +end; + +function TdxCustomImageListBox.GetImageRect(ItemIndex : Integer) : TRect; +Var + ImageWidth : Integer; + r : TRect; +begin + r := ItemRect(ItemIndex); + if (FImageList <> Nil) then begin + Result.Top := r.Top + 1; + Result.Bottom := r.Bottom - 1; + ImageWidth := ((Result.Bottom - Result.Top) * FImageList.Width) div FImageList.Height; + if (FImageAlign = dxliLeft) then begin + Result.Left := r.Left + 1 ; + Result.Right := Result.Left + ImageWidth + 2; + end else begin + Result.Right := r.Right - 1; + Result.Left := Result.Right - 2 - ImageWidth; + end; + end; +end; + +procedure TdxCustomImageListBox.DrawItem(Index: Integer; Rect: TRect; + State: TOwnerDrawState); +const + AlignFlags : array [TAlignment] of Integer = + ( DT_LEFT or DT_EXPANDTABS or DT_NOPREFIX Or DT_EDITCONTROL, + DT_RIGHT or DT_EXPANDTABS or DT_NOPREFIX Or DT_EDITCONTROL, + DT_CENTER or DT_EXPANDTABS or DT_NOPREFIX Or DT_EDITCONTROL); + VAlignFlags : array [TVertAlignment] of Integer = + (DT_TOP or DT_SINGLELINE, + DT_VCENTER or DT_SINGLELINE, + DT_BOTTOM or DT_SINGLELINE); +Var + r, r1 : TRect; + Image: TBitmap; + ImageFlag : Boolean; + Drawflag : Integer; +begin + with Canvas do begin + ImageFlag := (FImageList <> Nil) And (ImageIndexes[Index] > -1) + And (ImageIndexes[Index] < FImageList.Count); + r := GetImageRect(Index); + r1 := Rect; + if(ImageFlag) And (Canvas.Brush.Color = clHighlight) then begin + if(FImageAlign = dxliLeft) then + r1.Left := r.Right + 1 + else r1.Right := r.Left - 1; + DrawImageFocus(Index); + end; + FillRect(r1); + if ImageFlag then begin + InflateRect(r, -1, 0); + Image := TBitmap.Create; + FImageList.GetBitmap(GetImageIndex(Index), Image); + StretchDraw(r, Image); + Image.Free; + end; + if (FImageList <> Nil) then begin + InflateRect(Rect, -2, -2); + if(FImageAlign = dxliLeft) then + Rect.Left := r.Right + 2 + else Rect.Right := r.Left - 2; + end; + Inc(Rect.Left); + Dec(Rect.Right); + SetBkMode(Handle, TRANSPARENT); + if(Assigned(FOnDrawItem)) then begin + FOnDrawItem(self, Index, Rect); + end else begin + if(FMultiLines) then + DrawFlag := AlignFlags[Alignment] Or (DT_WORDBREAK) + else DrawFlag := AlignFlags[Alignment] Or VAlignFlags[VertAlignment]; + DrawText(Handle, PChar(Items[Index]), Length(Items[Index]), Rect, DrawFlag Or DT_EDITCONTROL); + FItemTextHeight := r.Bottom - r.Top; + end; + end; +end; + +procedure TdxCustomImageListBox.CNDrawItem(var Message: TWMDrawItem); +var + State: TOwnerDrawState; + ARect: TRect; +begin + with Message.DrawItemStruct^ do + begin + {$IFNDEF DELPHI5} + State := TOwnerDrawState(WordRec(LongRec(itemState).Lo).Lo); + {$ELSE} + State := TOwnerDrawState(LongRec(itemState).Lo); + {$ENDIF} + Canvas.Handle := hDC; + Canvas.Font := Font; + Canvas.Brush := Brush; + if (Integer(itemID) >= 0) and (odSelected in State) then + begin + Canvas.Brush.Color := clHighlight; + Canvas.Font.Color := clHighlightText + end; + ARect := rcItem; + if Integer(itemID) >= 0 then + DrawItem(itemID, ARect, State) + else Canvas.FillRect(ARect); + if odFocused in State then begin + if(FImageList <> Nil) then + InflateRect(ARect, -2, -3); + DrawFocusRect(hDC, ARect); + end; + Canvas.Handle := 0; + end; +end; + +procedure TdxCustomImageListBox.SetInheritedItemHeight; +Var + h : Integer; +begin + if(FItemHeight < 10) then begin + Canvas.Font.Size := Font.Size; + h := Canvas.TextHeight('Wg'); + if(FImageList <> NIl) And (h < FImageList.Height) then + h := FImageList.Height; + Inc(h, 2); + end else h := FItemHeight; + if(h <> inherited ItemHeight) then + inherited ItemHeight := h; + if HandleAllocated then + Repaint; +end; + +procedure TdxCustomImageListBox.OnChangeLink(Sender : TObject); +begin + SetInheritedItemHeight; +end; + +procedure TdxCustomImageListBox.CMFontChanged(var Message: TMessage); +begin + inherited; + SetInheritedItemHeight; +end; + +procedure TdxCustomImageListBox.DrawImageFocus(Index : Integer); +Var + r : TRect; + SColor : TColor; +begin + if (FImageList <> Nil) then begin + if(Index > -1) And (FDrawEdgeIndex <> Index) then begin + if(FDrawEdgeIndex > -1) And (ImageIndexes[FDrawEdgeIndex] > -1) + And (ImageIndexes[FDrawEdgeIndex] < FImageList.Count) then begin + r := GetImageRect(FDrawEdgeIndex); + SColor := Canvas.Brush.Color; + Canvas.Brush.Color := Color; + Canvas.FrameRect(r); + Canvas.Brush.Color := SColor; + end; + FDrawEdgeIndex := Index; + if(FDrawEdgeIndex > -1) And (ImageIndexes[FDrawEdgeIndex] > -1) + And (ImageIndexes[FDrawEdgeIndex] < FImageList.Count) then begin + r := GetImageRect(FDrawEdgeIndex); + DrawEdge(Canvas.Handle, R, BDR_RAISEDOUTER, BF_BOTTOMRIGHT); + Dec(R.Bottom); + Dec(R.Right); + if(Color = clWindow) Or (Color = clWhite) then + DrawEdge(Canvas.Handle, R, BDR_RAISEDOUTER, BF_TOPLEFT) + else DrawEdge(Canvas.Handle, R, BDR_RAISEDINNER, BF_TOPLEFT); + end; + end; + end; +end; + +procedure TdxCustomImageListBox.WndProc(var Message : TMessage); +begin + with Message do + case Msg of + LB_INSERTSTRING: + begin + if (FDeletedIndex = wParam) And (wParam <> -1) then + FStrings.Insert(wParam, FDeletedSt) + else begin + FStrings.Insert(wParam, ''); + ImageIndexes[wParam] := -1; + end; + end; + LB_ADDSTRING: + begin + FStrings.Add(''); + ImageIndexes[FStrings.Count - 1] := -1; + end; + LB_DELETESTRING: + begin + FDeletedIndex := wParam; + FDeletedSt := FStrings[wParam]; + FStrings.Delete(wParam); + end; + else FDeletedIndex := -1; + end; + inherited; +end; + +function TdxCustomImageListBox.ValuesIndexOf(Text : String) : Integer; +begin + for Result := 0 to FStrings.Count - 1 do + if AnsiCompareText(Text, Values[Result]) = 0 then Exit; + Result := -1; +end; + +{TdxCustomImageComboBox} +constructor TdxCustomImageComboBox.Create(AOwner : TComponent); +begin + inherited; + FStrings := TStringList.Create; + FChangeLink := TChangeLink.Create; + FChangeLink.OnChange := OnChangeLink; + + Style := csOwnerDrawFixed; + FItemHeight := 0; + FVertAlignment := tvaCenter; +end; + +destructor TdxCustomImageComboBox.Destroy; +begin + FChangeLink.Free; + FStrings.Free; + inherited; +end; + +procedure TdxCustomImageComboBox.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (FImageList <> nil) and + (AComponent = FImageList) then ImageList := nil; +end; + +procedure TdxCustomImageComboBox.Assign(Source: TPersistent); +Var + lb : TdxCustomImageComboBox; + lb1 : TdxCustomImageListBox; +begin + if(Source is TdxCustomImageComboBox) + Or(Source is TdxCustomImageListBox) then begin + if(Source is TdxCustomImageComboBox) then begin + lb := TdxCustomImageComboBox(Source); + FImageList := lb.FImageList; + Items.Assign(lb.Items); + FStrings.Assign(lb.FStrings); + FImageAlign := lb.FImageAlign; + FAlignment := lb.FAlignment; + MultiLines := lb.MultiLines; + FVertAlignment := lb.FVertAlignment; + Font := lb.Font; + end; + if(Source is TdxCustomImageListBox) then begin + lb1 := TdxCustomImageListBox(Source); + FImageList := lb1.FImageList; + Items.Assign(lb1.Items); + FStrings.Assign(lb1.FStrings); + FImageAlign := lb1.FImageAlign; + FAlignment := lb1.FAlignment; + MultiLines := lb1.MultiLines; + FVertAlignment := lb1.FVertAlignment; + Font := lb1.Font; + end; + SetInheritedItemHeight; + end + else inherited; +end; + +function TdxCustomImageComboBox.GetImageIndex(Index : Integer) : Integer; +Var + St : String; +begin + Result := -1; + if(Index < FStrings.Count) then begin + St := FStrings[Index]; + if(Pos(',', St) > 0) then begin + St := Copy(St, 1, Pos(',', St) - 1); + if(St <> '') then + Result := StrToInt(St); + end; + end; +end; + +function TdxCustomImageComboBox.GetValue(INdex : Integer) : String; +begin + Result := ''; + if(Index < FStrings.Count) And (Pos(',', FStrings[Index]) > 0) then + Result := Copy(FStrings[Index], Pos(',', FStrings[Index]) + 1, 1000); +end; + +procedure TdxCustomImageComboBox.SetImageIndex(Index : Integer; Value : Integer); +Var + St : String; +begin + if(Index < FStrings.Count) + And (Value <> ImageIndexes[Index])then begin + St := Values[Index]; + FStrings[Index] := IntToStr(Value) + ',' + St; + end; +end; + +procedure TdxCustomImageComboBox.SetAlignment(Value : TAlignment); +begin + if(Value <> FAlignment) then + FAlignment := Value; +end; + +procedure TdxCustomImageComboBox.SetVertAlignment(Value : TVertAlignment); +begin + if(Value <> FVertAlignment) then + FVertAlignment := Value; +end; + +procedure TdxCustomImageComboBox.SetImageAlign(Value : TdxImageAlign); +begin + if(Value <> FImageAlign) then + FImageAlign := Value; +end; + +procedure TdxCustomImageComboBox.SetImageList(Value : TCustomImageList); +begin + if(Value <> FImageList) then begin + if(FImageList <> Nil) then + FImageList.UnRegisterChanges(FChangeLink); + FImageList := Value; + if(FImageList <> Nil) then + FImageList.RegisterChanges(FChangeLink); + SetInheritedItemHeight; + end; +end; + +procedure TdxCustomImageComboBox.SetInternalItemHeight(Value : Integer); +begin + if(Value <> FItemHeight) then begin + if(Value < 10) then + FItemHeight := 0 + else FItemHeight := Value; + SetInheritedItemHeight; + end; +end; + +procedure TdxCustomImageComboBox.SetMultiLines(Value : Boolean); +begin + if(Value <> FMultiLines) then + FMultiLines := Value; +end; + +procedure TdxCustomImageComboBox.SetValue(Index : Integer; const Value : String); +Var + St : String; +begin + if(Index < FStrings.Count) And (Index > -1) + And (Value <> Values[Index])then begin + St := IntToStr(ImageIndexes[Index]); + FStrings[Index] := St + ',' + Value; + end; +end; + +procedure TdxCustomImageComboBox.AddItem(St :String; ImageIndex : Integer); +begin + Items.Add(St); + SetImageIndex(Items.Count -1, ImageIndex); +end; + +procedure TdxCustomImageComboBox.InsertItem(Index : Integer; + St :String; ImageIndex : Integer); +begin + if(Index < 0) then Index := 0; + if(Index >= Items.Count) then + AddItem(St, ImageIndex) + else begin + Items.Insert(Index, St); + SetImageIndex(Index, ImageIndex); + end; +end; + +procedure TdxCustomImageComboBox.ExchangeItems(Index1, Index2 : Integer); +var + flag : Boolean; + St1, St2 : string; +begin + flag := (Index1 > -1 ) And (Index1 < Items.Count) + And (Index2 > -1 ) And (Index2 < Items.Count); + if(flag) then begin + St1 := FStrings[Index1]; + St2 := FStrings[Index2]; + end; + Items.Exchange(Index1, Index2); + if(flag) then begin + FStrings[Index1] := St2; + FStrings[Index2] := St1; + end; +end; + +procedure TdxCustomImageComboBox.MoveItem(CurIndex, NewIndex: Integer); +Var + TempString: string; +begin + if (CurIndex <> NewIndex) And (CurIndex > -1) And (CurIndex < Items.Count) then begin + TempString := FStrings[CurIndex]; + Items.Move(CurIndex, NewIndex); + FStrings[NewIndex] := TempString; + end; +end; + +procedure TdxCustomImageComboBox.DefineProperties(Filer: TFiler); +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('SaveStrings', StringsRead, StringsWrite, True); +end; + +procedure TdxCustomImageComboBox.StringsRead(Reader: TReader); +begin + Reader.ReadListBegin; + FStrings.Clear; + while not Reader.EndOfList do + FStrings.Add(Reader.ReadString); + Reader.ReadListEnd; +end; + +procedure TdxCustomImageComboBox.StringsWrite(Writer: TWriter); +var + i: Integer; +begin + Writer.WriteListBegin; + for i := 0 to FStrings.Count - 1 do + Writer.WriteString(FStrings[I]); + Writer.WriteListEnd; +end; + +procedure TdxCustomImageComboBox.DrawItem(Index: Integer; Rect: TRect; + State: TOwnerDrawState); +const + AlignFlags : array [TAlignment] of Integer = + ( DT_LEFT or DT_EXPANDTABS or DT_NOPREFIX Or DT_EDITCONTROL, + DT_RIGHT or DT_EXPANDTABS or DT_NOPREFIX Or DT_EDITCONTROL, + DT_CENTER or DT_EXPANDTABS or DT_NOPREFIX Or DT_EDITCONTROL); + VAlignFlags : array [TVertAlignment] of Integer = + (DT_TOP or DT_SINGLELINE, + DT_VCENTER or DT_SINGLELINE, + DT_BOTTOM or DT_SINGLELINE); +Var + r : TRect; + Image: TBitmap; + ImageFlag : Boolean; + Drawflag, ImageWidth : Integer; +begin + with Canvas do begin + FillRect(Rect); + ImageFlag := (FImageList <> Nil) And (ImageIndexes[Index] > -1) + And (ImageIndexes[Index] < FImageList.Count); + if (FImageList <> Nil) then begin + r.Top := Rect.Top + 1; + r.Bottom := Rect.Bottom - 1; + ImageWidth := ((r.Bottom - r.Top) * FImageList.Width) div FImageList.Height; + if (FImageAlign = dxliLeft) then begin + r.Left := Rect.Left - 1 ; + r.Right := r.Left + ImageWidth + 2; + end else begin + r.Right := Rect.Right - 1; + r.Left := r.Right - 2 - ImageWidth; + end; + end; + if ImageFlag then begin + if (Index = ItemIndex) And (Canvas.Brush.Color <> Color)then + DrawEdge(Canvas.handle, r, EDGE_RAISED, BF_RECT); + InflateRect(r, -1, 0); + Image := TBitmap.Create; + FImageList.GetBitmap(GetImageIndex(Index), Image); + StretchDraw(r, Image); + Image.Free; + end; + Inc(Rect.Top); + Dec(Rect.Bottom); + if (FImageList <> Nil) then begin + if(FImageAlign = dxliLeft) then + Rect.Left := r.Right + else Rect.Right := r.Left; + end; + Inc(Rect.Left); + Dec(Rect.Right); + SetBkMode(Handle, TRANSPARENT); + if(Assigned(FOnDrawItem)) then begin + FOnDrawItem(self, Index, Rect); + end else begin + if(FMultiLines) then + DrawFlag := AlignFlags[Alignment] Or (DT_WORDBREAK) + else DrawFlag := AlignFlags[Alignment] Or VAlignFlags[VertAlignment]; + DrawText(Handle, PChar(Items[Index]), Length(Items[Index]), Rect, DrawFlag); + end; + end; +end; +procedure TdxCustomImageComboBox.SetInheritedItemHeight; +Var + h : Integer; +begin + if(FItemHeight < 10) then begin + h := Font.Height; + if(FImageList <> NIl) And (h < FImageList.Height) then + h := FImageList.Height; + Inc(h, 2); + end else h := FItemHeight; + if(h <> inherited ItemHeight) then + inherited ItemHeight := h; + RecreateWnd; +end; + +procedure TdxCustomImageComboBox.OnChangeLink(Sender : TObject); +begin + SetInheritedItemHeight; +end; + +procedure TdxCustomImageComboBox.CMFontChanged(var Message: TMessage); +begin + inherited; + SetInheritedItemHeight; +end; + +procedure TdxCustomImageComboBox.WndProc(var Message : TMessage); +begin + with Message do + case Msg of + CB_INSERTSTRING: + begin + if (FDeletedIndex = wParam) And (wParam <> -1) then + FStrings.Insert(wParam, FDeletedSt) + else begin + FStrings.Insert(wParam, ''); + ImageIndexes[wParam] := -1; + end; + end; + CB_ADDSTRING: + begin + FStrings.Add(''); + ImageIndexes[FStrings.Count - 1] := -1; + end; + CB_DELETESTRING: + begin + FDeletedIndex := wParam; + FDeletedSt := FStrings[wParam]; + FStrings.Delete(wParam); + end; + else FDeletedIndex := -1; + end; + inherited; +end; + +function TdxCustomImageComboBox.ValuesIndexOf(Text : String) : Integer; +begin + for Result := 0 to FStrings.Count - 1 do + if AnsiCompareText(Text, Values[Result]) = 0 then Exit; + Result := -1; +end; + +{TdxSpinImageItem} +constructor TdxSpinImageItem.Create(Collection : TCollection); +begin + inherited Create(Collection); + Owner := TdxSpinImageItems(Collection); + FImageIndex := -1; +end; + +procedure TdxSpinImageItem.Assign(Source: TPersistent); +begin + if Source is TdxSpinImageItem then begin + ImageIndex := TdxSpinImageItem(Source).ImageIndex; + Value := TdxSpinImageItem(Source).Value; + Hint := TdxSpinImageItem(Source).Hint; + end; +end; + +procedure TdxSpinImageItem.SetImageIndex(Value : Integer); +begin + if(FImageIndex <> Value) then begin + FImageIndex := Value; + if(Owner.Owner <> Nil) then + Owner.Owner.UpdateItems; + end; +end; + +procedure TdxSpinImageItem.SetValue(Value : String); +begin + if(FValue <> Value) then begin + FValue := Value; + if(Owner.Owner <> Nil) then + Owner.Owner.UpdateItems; + end; +end; + +procedure TdxSpinImageItem.SetHint(Value : String); +begin + if(FHint <> Value) then + FHint := Value; +end; + +{TdxSpinImageItems} +constructor TdxSpinImageItems.Create(AOwner : TdxCustomSpinImage); +begin + inherited Create(TdxSpinImageItem); + Owner := AOwner; +end; + +function TdxSpinImageItems.Add : TdxSpinImageItem; +begin + Result := TdxSpinImageItem(inherited Add); +end; + +function TdxSpinImageItems.IndexOf(Value : String) : Integer; +begin + for Result := 0 to Count - 1 do + if (CompareText(Value, Items[Result].Value) = 0) then + exit; + Result := -1; +end; + +function TdxSpinImageItems.GetItem(Index : Integer) : TdxSpinImageItem; +begin + Result := TdxSpinImageItem(inherited Items[Index]); +end; + +procedure TdxSpinImageItems.SetItem(Index: Integer; Value: TdxSpinImageItem); +begin + Items[Index].Assign(Value); +end; + +procedure TdxSpinImageItems.Update(Item: TCollectionItem); +begin + if(Item <> Nil) And (Owner <> Nil) then + Owner.UpdateItems; +end; + +{TdxCustomSpinImage} +constructor TdxCustomSpinImage.Create(AOwner : TComponent); +begin + inherited Create(AOwner); + ControlStyle := ControlStyle + [csFramed, csOpaque]; + + FChangeLink := TChangeLink.Create; + FChangeLink.OnChange := OnChangeLink; + FItems := TdxSpinImageItems.Create(self); + + TabStop := True; + FBorderStyle := bsSingle; + FItemIndex := -1; + FUpDownAlign := udaRight; + FUpDownWidth := 16; + FUpDownOrientation := siVertical; + FImageHAlign := hsiCenter; + FImageVAlign := vsiCenter; + FStretch := True; + FDefaultImages := True; + Height := 100; + Width := 118; + FUseDblClick := True; + FNCSide := 0; + + FTimer := TTimer.Create(self); + FTimer.Enabled := False; + FTimer.Interval := 300; + FTimer.OnTimer := DoTimerScroll; +end; + +destructor TdxCustomSpinImage.Destroy; +begin + FTimer.Free; + FTimer := nil; + FItems.Free; + FChangeLink.Free; + inherited Destroy; +end; + +procedure TdxCustomSpinImage.CreateWnd; +begin + inherited CreateWnd; + UpdateNCRegion; +end; + +procedure TdxCustomSpinImage.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + Params.Style := Params.Style or WS_TABSTOP; + if FBorderStyle = bsSingle then + Params.Style := Params.Style or WS_BORDER; +end; + +procedure TdxCustomSpinImage.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (FImageList <> nil) and + (AComponent = FImageList) then ImageList := nil; +end; + +procedure TdxCustomSpinImage.SetInternalAutoSize(Value : Boolean); +begin + if(Value <> FAutoSize) And (FImageList <> Nil) then begin + FAutoSize := Value; + if(FAutoSize) then + MakeAutoSize; + end; +end; + +procedure TdxCustomSpinImage.SetBorderStyle(Value: TBorderStyle); +begin + if FBorderStyle <> Value then begin + FBorderStyle := Value; + RecreateWnd; + end; +end; + +procedure TdxCustomSpinImage.SetDefaultImages(Value : Boolean); +begin + if(Value <> FDefaultImages) then begin + FDefaultImages := Value; + if Not (csLoading in ComponentState) then begin + if(Value And (FImageList <> Nil) And (FImageList.Count > 0)) + Or (Not Value And (Items.Count > 0)) then + ItemIndex := 0 + else ItemIndex := -1; + UpdateItems; + Repaint; + end; + end; +end; + +procedure TdxCustomSpinImage.SetItemIndex(Value : Integer); +begin + if (csLoading in ComponentState) then begin + FItemIndex := Value; + Change; + exit; + end; + if(Value >= -1) And (FItemIndex <> Value) And (FImageList <> Nil) + And ((FDefaultImages And (Value < FImageList.Count)) + Or (Not FDefaultImages And (Value < Items.Count)))then begin + FItemIndex := Value; + Change; + Paint; + end; +end; + +procedure TdxCustomSpinImage.SetImageList(Value : TCustomImageList); +begin + if(Value <> FImageList) then begin + if(FImageList <> Nil) then + FImageList.UnRegisterChanges(FChangeLink); + FImageList := Value; + if(FImageList <> Nil) then + FImageList.RegisterChanges(FChangeLink); + if Not (csLoading in ComponentState) then + ItemIndex := -1; + Paint; + end; +end; + +procedure TdxCustomSpinImage.SetImageHAlign(Value : TdxHSpinImageAlign); +begin + if(FImageHAlign <> Value) then begin + FImageHAlign := Value; + Repaint; + end; +end; + +procedure TdxCustomSpinImage.SetImageVAlign(Value : TdxVSpinImageAlign); +begin + if(FImageVAlign <> Value) then begin + FImageVAlign := Value; + Repaint; + end; +end; + +procedure TdxCustomSpinImage.SetItems(Value : TdxSpinImageItems); +begin + FItems.Assign(Value); + Update; + Repaint; +end; + +procedure TdxCustomSpinImage.SetStretch(Value : Boolean); +begin + if(FStretch <> Value) then begin + FStretch := Value; + Repaint; + end; +end; + +procedure TdxCustomSpinImage.SetUpDownAlign(Value : TdxUpDownAlign); +begin + if(Value <> FUpDownAlign) then begin + FUpDownAlign := Value; + UpdateNCRegion; + end; +end; + +procedure TdxCustomSpinImage.SetUpDownOrientation(Value : TdxsiOrientation); +begin + if(FUpDownOrientation <> Value) then begin + FUpDownOrientation := Value; + UpdateNCRegion; + end; +end; + +procedure TdxCustomSpinImage.SetUpDownWidth(Value : Integer); +begin + if(FUpDownWidth <> Value) then begin + FUpDownWidth := Value; + UpdateNCRegion; + end; + if(FAutoSize) then + MakeAutoSize; +end; + +procedure TdxCustomSpinImage.CMEnter(var Message: TCMEnter); +begin + Invalidate; + inherited; +end; + +procedure TdxCustomSpinImage.CMExit(var Message: TCMExit); +begin + Invalidate; + inherited; +end; + +procedure TdxCustomSpinImage.CMEnabledChanged(var Message: TMessage); +begin + inherited; + Perform(WM_NCPAINT, 0, 0); +end; + +procedure TdxCustomSpinImage.WMLButtonDown(var Message: TWMLButtonDown); +begin + if TabStop and CanFocus then SetFocus; + inherited; +end; + +procedure TdxCustomSpinImage.WMLButtonDblClk(var Message: TWMLButtonDblClk); +begin + if FUseDblClick then + SetNextItem + else inherited; +end; + +procedure TdxCustomSpinImage.UpDownClick(AKey : Word); +begin + if(Not Focused) then + SetFocus; + if not CanChange then exit; + + case AKey of + VK_DOWN, VK_RIGHT, VK_END: + begin + if IsLastItem then exit; + FDownPress := True; + FUpPress := False; + if (AKey = VK_END) then begin + if(FDefaultImages) then + ItemIndex := FImageList.Count - 1 + else ItemIndex := Items.Count - 1; + end else + if not IsLastItem then + ItemIndex := ItemIndex + 1; + Perform(WM_NCPAINT, 0, 0); + end; + VK_UP, VK_LEFT, VK_HOME: + begin + FUpPress := True; + FDownPress := False; + if ItemIndex = 0 then exit; + if(FDefaultImages and (FImageList.Count > 0)) + or (not FDefaultImages and (Items.Count > 0)) then + begin + if (AKey = VK_HOME) then + ItemIndex := 0 + else + if (ItemIndex > 0) then + ItemIndex := ItemIndex - 1; + end; + Perform(WM_NCPAINT, 0, 0); + end; + VK_SPACE: + begin + SetNextItem; + Perform(WM_NCPAINT, 0, 0); + end; + end; +end; + +procedure TdxCustomSpinImage.MakeAutoSize; +Var + R : TRect; + FWidth, FHeight : Integer; +begin + R := ClientRect; + FWidth := R.Right - R.Left; + FHeight := R.Bottom - R.Top; + Width := Width + FImageList.Width - FWidth; + Height := Height + FImageList.Height - FHeight; +end; + +function TdxCustomSpinImage.IsLastItem : Boolean; +begin + Result := not ( FDefaultImages and (FItemIndex < FImageList.Count - 1)) + Or (Not FDefaultImages and (FItemIndex < Items.Count - 1)); +end; + +procedure TdxCustomSpinImage.SetNextItem; +begin + if CanChange And ((FDefaultImages And (FImageList.Count > 0)) + Or(Not FDefaultImages And (Items.Count >0))) then begin + if not IsLastItem then + ItemIndex := FItemIndex + 1 + else ItemIndex := 0; + end; +end; + +procedure TdxCustomSpinImage.UpdateNCRegion; +begin + if HandleAllocated then + SetWindowPos(Handle, 0, 0, 0, 0, 0, SWP_FRAMECHANGED or SWP_NOMOVE or SWP_NOSIZE or SWP_NOZORDER); +end; + +procedure TdxCustomSpinImage.OnChangeLink(Sender : TObject); +begin + if(FAutoSize) then MakeAutoSize; + Repaint; +end; + +procedure TdxCustomSpinImage.WMGetDlgCode(var Msg: TWMGetDlgCode); +begin + Msg.Result := DLGC_WANTARROWS; +end; + +procedure TdxCustomSpinImage.WMNCCalcSize(var Message : TWMNCCalcSize); +var + r : TRect; +begin + inherited; + GetWindowRect(Handle, r); + with Message.CalcSize_Params^.rgrc[0] do + begin + if Left > r.Left then + FNCSide := Left - r.Left; + case FUpDownAlign of + udaBottom: Dec(Bottom, FUpDownWidth); + udaLeft: Inc(Left, FUpDownWidth); + udaRight: Dec(Right, FUpDownWidth); + udaTop: Inc(Top, FUpDownWidth); + end; + end; +end; + +procedure TdxCustomSpinImage.WMNCPaint(var Message : TWMNCPaint); +var + DC : HDC; + r : TRect; + rgn, rgn1 : HRGN; +const + EnableFlag : Array[False..True] of Integer = (DFCS_INACTIVE, 0); + FlatFlag : Array[False..True] of Integer = (DFCS_FLAT, 0); + PressFlag : Array[False..True] of Integer = (0, DFCS_PUSHED); + UpLeftFlag : Array[False..True] of Integer = (DFCS_SCROLLLEFT, DFCS_SCROLLUP); + DownRightFlag : Array[False..True] of Integer = (DFCS_SCROLLRIGHT, DFCS_SCROLLDOWN); +begin + inherited; + DC := GetWindowDC(Handle); + GetWindowRect(Handle, r); + OffSetRect(r, -r.Left, -r.Top); + InflateRect(r, -FNCSide, -FNCSide); + case FUpDownAlign of + udaBottom: r.Top := r.Bottom - FUpDownWidth; + udaLeft: r.Right := r.Left + FUpDownWidth; + udaRight: r.Left := r.Right - FUpDownWidth; + udaTop: r.Bottom := r.Top + FUpDownWidth; + end; + FUpButtonRect := r; + FDownButtonRect := r; + FUpButtonEnabled := CanChange and (ItemIndex > 0); + FDownButtonEnabled := CanChange and not IsLastItem; + + if (FUpDownOrientation = siVertical) then + FUpButtonRect.Bottom := r.Top + (r.Bottom - r.Top) div 2 + else FUpButtonRect.Right := r.Right - (r.Right - r.Left) div 2; + if (FUpDownOrientation = siVertical) then + FDownButtonRect.Top := r.Bottom - (r.Bottom - r.Top) div 2 + else FDownButtonRect.Left := r.Left + (r.Right - r.Left) div 2 + 1; + DrawFrameControl(DC, FUpButtonRect, DFC_SCROLL, UpLeftFlag[FUpDownOrientation = siVertical] + or EnableFlag[FUpButtonEnabled] or FlatFlag[Ctl3D] or PressFlag[FUpPress and FUpButtonEnabled]); + DrawFrameControl(DC, FDownButtonRect, DFC_SCROLL, DownRightFlag[FUpDownOrientation = siVertical] + or EnableFlag[FDownButtonEnabled] or FlatFlag[Ctl3D] or PressFlag[FDownPress and FDownButtonEnabled]); + + rgn := CreateRectRgnIndirect(r); + rgn1 := CreateRectRgnIndirect(FUpButtonRect); + CombineRgn(rgn, rgn, rgn1, RGN_XOR); + DeleteObject(rgn1); + rgn1 := CreateRectRgnIndirect(FDownButtonRect); + CombineRgn(rgn, rgn, rgn1, RGN_XOR); + DeleteObject(rgn1); + FillRgn(DC, rgn, Canvas.Brush.Handle); + DeleteObject(rgn); + ReleaseDC(Handle, DC); +end; + +procedure TdxCustomSpinImage.DoTimerScroll(Sender: TObject); +Var + p : TPoint; +begin + if(FUpPress or FDownPress) then + begin + if FScrollTimerCount > 1 then + begin + GetCursorPos(p); + p := ScreenToClient(p); + if FUpPress then + begin + if PtInRect(FUpButtonRect, Point(p.X, p.Y)) then + UpDownClick(VK_UP) + else FScrollTimerCount := 0; + end else + if PtInRect(FDownButtonRect, Point(p.X, p.Y)) then + UpDownClick(VK_DOWN) + else FScrollTimerCount := 0; + end else Inc(FScrollTimerCount); + end + else + begin + FTimer.Enabled := False; + end; +end; + +procedure TdxCustomSpinImage.NCMouseDown(X, Y : Integer); +var + r : TRect; +begin + GetWindowRect(Handle, r); + Dec(X, r.Left); + Dec(Y, r.Top); + if PtInRect(FUpButtonRect, Point(X, Y)) then + UpDownClick(VK_UP); + if PtInRect(FDownButtonRect, Point(X, Y)) then + UpDownClick(VK_DOWN); + if FUpPress or FDownPress then + begin + SetCapture(Handle); + FScrollTimerCount := 0; + FTimer.Enabled := True; + end; +end; + +procedure TdxCustomSpinImage.WMNCLButtonDblClk(var Message : TWMNCLBUTTONDOWN); +begin + with Message do + NCMouseDown(XCursor, YCursor); + inherited; +end; + +procedure TdxCustomSpinImage.WMNCMouseDown(var Message : TWMNCLBUTTONDOWN); +begin + with Message do + NCMouseDown(XCursor, YCursor); +end; + +procedure TdxCustomSpinImage.WMNCMouseUp(var Message : TWMNCLBUTTONUP); +begin + if (GetCapture = Handle) then + begin + ReleaseCapture; + FUpPress := False; + FDownPress := False; + Perform(WM_NCPAINT, 0, 0); + end; + inherited; +end; + +procedure TdxCustomSpinImage.WMMouseUp(var Message : TWMLBUTTONUP); +begin + if (GetCapture = Handle) then + begin + ReleaseCapture; + FUpPress := False; + FDownPress := False; + Perform(WM_NCPAINT, 0, 0); + end; + inherited; +end; + +procedure TdxCustomSpinImage.WMNCHitTest(var Message : TWMNCHITTEST); +begin + inherited; + with Message do + if(Result = HTNOWHERE) then + Result := HTBORDER; +end; + +procedure TdxCustomSpinImage.KeyDown(var Key: Word; Shift: TShiftState); +begin + UpDownClick(Key); + inherited; +end; + +procedure TdxCustomSpinImage.KeyUp(var Key: Word; Shift: TShiftState); +begin + if(FImageList <> NIl) And (FImageList.Count > 0) then + case Key of + VK_UP, VK_LEFT, VK_HOME: + begin + FUpPress := False; + Perform(WM_NCPAINT, 0, 0); + end; + VK_DOWN, VK_RIGHT, VK_END: + begin + FDownPress := False; + Perform(WM_NCPAINT, 0, 0); + end; + end; + inherited; +end; + +procedure TdxCustomSpinImage.Paint; +var + Image : TBitmap; + R: TRect; + FLeft, FTop : Integer; +begin + with Canvas do begin + Brush.Style := bsSolid; + Brush.Color := Color; + R := ClientRect; + if (FImageList <> Nil) And (FItemIndex <> -1) then begin + Image := TBitmap.Create; + if FDefaultImages then + FImageList.GetBitmap(ItemIndex, Image) + else FImageList.GetBitmap(Items[ItemIndex].ImageIndex, Image); + if(FStretch) then + StretchDraw(r, Image) + else begin + FillRect(R); + FLeft := R.Left; + FTop := R.Top; + if(R.Right - R.Left > FImageList.Width) then + case FImageHAlign of + hsiCenter: Inc(FLeft, (R.Right - R.Left - FImageList.Width) div 2); + hsiRight: Inc(FLeft, R.Right - R.Left - FImageList.Width); + end; + if(R.Bottom - R.Top > FImageList.Height) then + case FImageVAlign of + vsiCenter: Inc(FTop, (R.Bottom - R.Top - FImageList.Height) div 2); + vsiBottom: Inc(FTop, R.Bottom - R.Top - FImageList.Height); + end; + Draw(FLeft, FTop, Image); + end; + Image.Free; + end + else begin + FillRect(R); + end; + if (GetParentForm(Self) <> nil) and (GetParentForm(Self).ActiveControl = Self) and + not (csDesigning in ComponentState) then begin + Brush.Color := clWindowFrame; + FrameRect(R); + end; + end; +end; + +function TdxCustomSpinImage.CanChange : Boolean; +begin + Result := Enabled and not FReadOnly and (FImageList <> nil) and (FImageList.Count > 0); +end; + +procedure TdxCustomSpinImage.Change; +begin + if Not FDefaultImages And (FItemIndex > -1) + And Not (csDesigning in ComponentState) then begin + Hint := Items[FItemIndex].Hint; + if(Hint <> '') then + ShowHint := True + else ShowHint := False; + end; + if Assigned(FOnChange) then + FOnChange(self, FItemIndex); +end; + +procedure TdxCustomSpinImage.UpdateItems; +begin +end; + +end. diff --git a/official/x.35/ExpressSideBar/Sources/dxreginf.pas b/official/x.35/ExpressSideBar/Sources/dxreginf.pas new file mode 100644 index 00000000..ab195fc1 --- /dev/null +++ b/official/x.35/ExpressSideBar/Sources/dxreginf.pas @@ -0,0 +1,83 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxreginf; + +interface +uses forms, Registry; + +procedure StoreExpressFormsInformation(AForm : TForm); +procedure ReStoreExpressFormsInformation(AForm : TForm); + +implementation + +const + REGISTRYRSDPATHTODXL = 'Software\Developer Express\Delphi\Design Forms\'; + +procedure StoreExpressFormsInformation(AForm : TForm); +Var + reg : TRegIniFile; +begin + reg := TRegIniFile.Create(REGISTRYRSDPATHTODXL); + try + with reg, AForm do begin + LazyWrite := True; + WriteInteger(AForm.Name, 'Top', Top); + WriteInteger(AForm.Name, 'Left', Left); + WriteInteger(AForm.Name, 'Height', Height); + WriteInteger(AForm.Name, 'Width', Width); + end; + finally + reg.Free; + end; +end; + +procedure ReStoreExpressFormsInformation(AForm : TForm); +Var + reg : TRegIniFile; +begin + reg := TRegIniFile.Create(REGISTRYRSDPATHTODXL); + try + with reg, AForm do begin + Top := reg.ReadInteger(AForm.Name, 'Top', Top); + Left := reg.ReadInteger(AForm.Name, 'Left', Left); + Height := reg.ReadInteger(AForm.Name, 'Height', Height); + Width := reg.ReadInteger(AForm.Name, 'Width', Width); + end; + finally + reg.Free; + end; +end; + +end. diff --git a/official/x.35/ExpressSideBar/Sources/dxsbar.pas b/official/x.35/ExpressSideBar/Sources/dxsbar.pas new file mode 100644 index 00000000..25b7b29e --- /dev/null +++ b/official/x.35/ExpressSideBar/Sources/dxsbar.pas @@ -0,0 +1,5507 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express side bar control } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxsbar; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI4} + ImgList, ActnList, +{$ENDIF} +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Classes, Controls, Windows, SysUtils, ExtCtrls, Graphics, Buttons, + StdCtrls, Forms, Messages, Menus, CommCtrl; + +type + TdxSideBarStore = class; + TdxStoredSideItem = class; + TdxSideBarItem = class; + TdxSideBarTag = Integer; + + TdxSideBarItemClickEvent = procedure(Sender: TObject; Item: TdxSideBarItem) of object; + + {$IFDEF DELPHI4} + TdxSideBarItemActionLink = class(TActionLink) + protected + FClient: TdxStoredSideItem; + + procedure AssignClient(AClient: TObject); override; + + function IsCaptionLinked: Boolean; override; + function IsEnabledLinked: Boolean; override; + function IsHintLinked: Boolean; override; + function IsImageIndexLinked: Boolean; override; + + procedure SetCaption(const Value: string); override; + procedure SetEnabled(Value: Boolean); override; + procedure SetHint(const Value: string); override; + procedure SetImageIndex(Value: Integer); override; + procedure SetVisible(Value: Boolean); override; + end; + + TdxSideBarItemActionLinkClass = class of TdxSideBarItemActionLink; + {$ENDIF} + + TdxStoredSideItem = class(TComponent) + private + FCategory: Integer; + FCaption: string; + FEnabled: Boolean; + FHint: string; + FLargeImage: Integer; + FSmallImage: Integer; + FOnClick: TdxSideBarItemClickEvent; + FStore: TdxSideBarStore; + FPopupMenu: TPopupMenu; + FAvailableInCustomizeForm: Boolean; + {$IFDEF DELPHI4} + FActionLink: TdxSideBarItemActionLink; + {$ENDIF} + + {$IFDEF DELPHI4} + function GetAction: TBasicAction; + {$ENDIF} + + {$IFDEF DELPHI4} + procedure SetAction(Value: TBasicAction); + {$ENDIF} + procedure SetCaption(Value: string); + procedure SetCategory(Value: Integer); + procedure SetEnabled(Value: Boolean); + procedure SetHint(Value: string); + procedure SetLargeImage(Value: Integer); + procedure SetSmallImage(Value: Integer); + procedure SetStore(Value: TdxSideBarStore); + + {$IFDEF DELPHI4} + procedure DoActionChange(Sender: TObject); + function IsCaptionStored: Boolean; + function IsEnabledStored: Boolean; + function IsHintStored: Boolean; + function IsImageIndexStored: Boolean; + {$ENDIF} + protected + procedure DoClick(Sender: TObject; Item: TdxSideBarItem); + procedure ReadState(Reader: TReader); override; + {$IFDEF DELPHI4} + procedure Loaded; override; + {$ENDIF} + procedure Notification(AComponent: TComponent; + Operation: TOperation); override; + + {$IFDEF DELPHI4} + procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); dynamic; + function GetActionLinkClass: TdxSideBarItemActionLinkClass; dynamic; + {$ENDIF} + + {$IFDEF DELPHI4} + property ActionLink: TdxSideBarItemActionLink read FActionLink write FActionLink; + {$ENDIF} + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure SetParentComponent(AParent: TComponent); override; + function GetParentComponent: TComponent; override; + function HasParent: Boolean; override; + property AvailableInCustomizeForm: Boolean read FAvailableInCustomizeForm write FAvailableInCustomizeForm; + property Store: TdxSideBarStore read FStore write SetStore; + published + {$IFDEF DELPHI4} + property Action: TBasicAction read GetAction write SetAction; + {$ENDIF} + property Caption: string read FCaption write SetCaption {$IFDEF DELPHI4} stored IsCaptionStored{$ENDIF}; + property Category: Integer read FCategory write SetCategory; + property Enabled: Boolean read FEnabled write SetEnabled {$IFDEF DELPHI4} stored IsEnabledStored{$ENDIF}; + property Hint: string read FHint write SetHint{$IFDEF DELPHI4} stored IsHintStored{$ENDIF}; + property LargeImage: Integer read FLargeImage write SetLargeImage {$IFDEF DELPHI4} stored IsImageIndexStored{$ENDIF}; + property SmallImage: Integer read FSmallImage write SetSmallImage; + property PopupMenu: TPopupMenu read FPopupMenu write FPopupMenu; + property OnClick: TdxSideBarItemClickEvent read FOnClick write FOnClick; + end; + + TdxSideBar = class; + + TdxSideBarStoreDesigner = class(TForm) + protected + Store: TdxSideBarStore; + + procedure CloseSideBarStoreEditor; virtual; abstract; + procedure SideBarStoreEditorUpdate; virtual; abstract; + procedure SideBarStoreEditorUpdateItem(AItem: TdxStoredSideItem); virtual; abstract; + end; + + TdxSideBarStoreCustomizeForm = class(TForm) + protected + Store: TdxSideBarStore; + + procedure BeginCustomizing; + procedure EndCustomizing; + end; + + TdxSideBarStore = class(TComponent) + private + FList: TList; + FBars: TList; + FCategories: TStrings; + FLargeImages: TCustomImageList; + FSmallImages: TCustomImageList; + FSmallChangeLink: TChangeLink; + FLargeChangeLink: TChangeLink; + FDefaultLargeImage: Integer; + FDefaultSmallImage: Integer; + FIsCustomizing: Boolean; + + function GetCount: Integer; + function GetSideBarCount: Integer; + function GetItem(Index: Integer): TdxStoredSideItem; + function GetSideBar(Index: Integer): TdxSideBar; + procedure SetCategories(Value: TStrings); + procedure SetDefaultLargeImage(Value: Integer); + procedure SetDefaultSmallImage(Value: Integer); + procedure SetImages(AValue: TCustomImageList; var AImageList: TCustomImageList; AChangeLink: TChangeLink); + procedure SetLargeImages(Value: TCustomImageList); + procedure SetSmallImages(Value: TCustomImageList); + procedure DestroyItems; + procedure OnChangeLink(Sender: TObject); + procedure RedrawBars; + procedure RemoveBarItem(StoredItem: TdxStoredSideItem); + protected + {$IFDEF DELPHI3} + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + {$ELSE} + procedure GetChildren(Proc: TGetChildProc); override; + {$ENDIF} + procedure SetName(const Value: TComponentName); override; + procedure Notification(AComponent: TComponent; + Operation: TOperation); override; + public + Designer: TdxSideBarStoreDesigner; + + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure AddItem(Item: TdxStoredSideItem); + procedure ExchangeItems(Item1, Item2: TdxStoredSideItem); + procedure RemoveItem(Item: TdxStoredSideItem); + procedure UpdateItem(Item: TdxStoredSideItem); + function GetCountByCategory(St: string): Integer; + function GetItemByCategory(St: string; Index: Integer): TdxStoredSideItem; + function GetItemsByCategory(St: string; List: TList): Integer; + procedure Customize; + procedure UpdateEditorItem(Item: TdxStoredSideItem); + property Count: Integer read GetCount; + property IsCustomizing: Boolean read FIsCustomizing; + property Items[Index: Integer]: TdxStoredSideItem read GetItem; + property SideBarCount: Integer read GetSideBarCount; + property SideBars[Index: Integer]: TdxSideBar read GetSideBar; + published + property Categories: TStrings read FCategories write SetCategories; + property DefaultLargeImage: Integer read FDefaultLargeImage write SetDefaultLargeImage; + property DefaultSmallImage: Integer read FDefaultSmallImage write SetDefaultSmallImage; + property LargeImages: TCustomImageList read FLargeImages write SetLargeImages; + property SmallImages: TCustomImageList read FSmallImages write SetSmallImages; + end; + + TdxSideGroups = class; + TdxSideGroup = class; + TdxSideBarItems = class; + + TdxSideBarItem = class(TCollectionItem) + private + FCaption: string; + FIsDefault: Boolean; + FLargeImage: Integer; + FSmallImage: Integer; + FStoredItem: TdxStoredSideItem; + FCustomData: string; + FHint: string; + FObject: TObject; + FTag: TdxSideBarTag; + FEnabled: Boolean; + + function GetCaption: string; + function GetEnabled: Boolean; + function GetHint: string; + function GetGroup: TdxSideGroup; + function GetSideBar: TdxSideBar; + function GetLargeImage: Integer; + function GetSmallImage: Integer; + procedure SetCaption(Value: string); + procedure SetEnabled(Value: Boolean); + procedure SetHint(Value: string); + procedure SetIsDefault(Value: Boolean); + procedure SetLargeImage(Value: Integer); + procedure SetSmallImage(Value: Integer); + procedure SetStoredItem(Value: TdxStoredSideItem); + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + function MakeVisible: Boolean; + function IsSelected: Boolean; + function IsFocused: Boolean; + function IsFullVisible: Boolean; + function Visible: Boolean; + + property Enabled: Boolean read GetEnabled write SetEnabled; + property Group: TdxSideGroup read GetGroup; + property SideBar: TdxSideBar read GetSideBar; + property ItemObject: TObject read FObject write FObject; + published + property Caption: string read GetCaption write SetCaption; + property CustomData: string read FCustomData write FCustomData; + property Hint: string read GetHint write SetHint; + property Index; + property IsDefault: Boolean read FIsDefault write SetIsDefault default True; + property LargeImage: Integer read GetLargeImage write SetLargeImage default -1; + property SmallImage: Integer read GetSmallImage write SetSmallImage default -1; + property StoredItem: TdxStoredSideItem read FStoredItem write SetStoredItem; + property Tag: TdxSideBarTag read FTag write FTag default 0; + end; + + TdxSideBarItems = class(TCollection) + private + Group: TdxSideGroup; + SideBar: TdxSideBar; + + function GetItem(Index: Integer): TdxSideBarItem; + procedure SetItem(Index: Integer; Value: TdxSideBarItem); + protected + procedure Update(Item: TCollectionItem); override; + public + constructor Create(AOwner: TdxSideGroup); + + function Add: TdxSideBarItem; + property Items[Index: Integer]: TdxSideBarItem read GetItem write SetItem; default; + end; + + TdxSideGroupIconType = (dxsgLargeIcon, dxsgSmallIcon); + + TdxSideGroup = class(TCollectionItem) + private + FItems: TdxSideBarItems; + FTopVisibleItem: Integer; + FCaption: string; + FIconType: TdxSideGroupIconType; + FIsAssigning: Boolean; + FVisible: Boolean; + FTag: Integer; + FDestroying: Boolean; + + function GetActive: Boolean; + function GetItemCount: Integer; + procedure SetCaption(Value: string); + procedure SetIconType(Value: TdxSideGroupIconType); + procedure SetItems(Value: TdxSideBarItems); + procedure SetTopVisibleItem(Value: Integer); + procedure SetVisible(Value: Boolean); + public + constructor Create(Collection: TCollection); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure MakeActive; + function GetVisibleCount: Integer; + function SideBar: TdxSideBar; + + property Active: Boolean read GetActive; + property ItemCount: Integer read GetItemCount; + property TopVisibleItem: Integer read FTopVisibleItem write SetTopVisibleItem; + property Tag: Integer read FTag write FTag; + published + property Caption: string read FCaption write SetCaption; + property Index; + property IconType: TdxSideGroupIconType read FIconType write SetIconType default dxsgLargeIcon; + property Items: TdxSideBarItems read FItems write SetItems; + property Visible: Boolean read FVisible write SetVisible default True; + end; + + TdxSideGroups = class(TCollection) + private + SideBar: TdxSideBar; + + function GetItem(Index: Integer): TdxSideGroup; + function GetVisibleItem(Index: Integer): TdxSideGroup; + function GetVisibleCount: Integer; + procedure SetItem(Index: Integer; Value: TdxSideGroup); + protected + procedure Update(Item: TCollectionItem); override; + public + constructor Create(AOwner: TdxSideBar); + + function Add: TdxSideGroup; + property Items[Index: Integer]: TdxSideGroup read GetItem write SetItem; default; + property VisibleItems[Index: Integer]: TdxSideGroup read GetVisibleItem; + property VisibleCount: Integer read GetVisibleCount; + end; + + TdxSideBarChangeGroupCaptionEvent = procedure(Sender: TObject; Group: TdxSideGroup) of object; + TdxSideBarDragDropItemEvent = procedure(Sender: TObject; Source, Target: TdxSideBarItem; + IsCopy: Boolean) of object; + TdxSideBarDeleteItemEvent = procedure(Sender: TObject; Item: TdxSideBarItem) of object; + + TdxSideBarFillStyle = (bfsNone, bfsHorz, bfsVert); + + TdxSideBarBackGround = class(TPersistent) + private + FBeginColor: TColor; + FEndColor: TColor; + FOnChange: TNotifyEvent; + FFillStyle: TdxSideBarFillStyle; + FStep: Integer; + + procedure SetBeginColor(Value: TColor); + procedure SetEndColor(Value: TColor); + procedure SetFillStyle(Value: TdxSideBarFillStyle); + procedure SetStep(Value: Integer); + procedure DoChange; + public + constructor Create; + function IsUsed: Boolean; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + published + property BeginColor: TColor read FBeginColor write SetBeginColor default clGrayText; + property EndColor: TColor read FEndColor write SetEndColor default clGrayText; + property FillStyle: TdxSideBarFillStyle read FFillStyle write SetFillStyle default bfsNone; + property Step: Integer read FStep write SetStep default 2; + end; + + TdxsbPaintStyle = (sbpsStandard, sbpsFlat, sbpsXP, sbpsW2K); + + TdxSideBarPainter = class; + TdxSideBarViewInfo = class; + + TdxSideGroupViewInfo = class + private + FViewInfo: TdxSideBarViewInfo; + FGroup: TdxSideGroup; + FRect: TRect; + + function GetCaption: String; + function GetPainter: TdxSideBarPainter; + public + constructor Create(AViewInfo: TdxSideBarViewInfo; AGroup: TdxSideGroup; ARect: TRect); + + function Index: Integer; + + property Group: TdxSideGroup read FGroup; + property Caption: String read GetCaption; + property Painter: TdxSideBarPainter read GetPainter; + property Rect: TRect read FRect; + property ViewInfo: TdxSideBarViewInfo read FViewInfo; + end; + + TdxSideBarDragSourcePosition = (sbdspTop, sbdspBottom, sbdspIn); + + TdxSideItemViewInfo = class + private + FViewInfo: TdxSideBarViewInfo; + FItem: TdxSideBarItem; + FImageRect: TRect; + FCaptionRect: TRect; + + function GetCaption: String; + function GetImageIndex: Integer; + function GetImageList: TCustomImageList; + function GetPainter: TdxSideBarPainter; + protected + function GetBorderRect: TRect; virtual; + function GetItemRect: TRect; virtual; + property BorderRect: TRect read GetBorderRect; + property ItemRect: TRect read GetItemRect; + public + constructor Create(AViewInfo: TdxSideBarViewInfo; AItem: TdxSideBarItem; AImageRect, ACaptionRect: TRect); + + function Index: Integer; + function IsPartialVisible: Boolean; + function Bottom: Integer; + function Top: Integer; + function FocusedCaptionRect: TRect; + function GetItemDragSourceSpace(APosition: TdxSideBarDragSourcePosition): TRect; + + property Caption: String read GetCaption; + property ImageIndex: Integer read GetImageIndex; + property ImageList: TCustomImageList read GetImageList; + property Item: TdxSideBarItem read FItem; + property Painter: TdxSideBarPainter read GetPainter; + property CaptionRect: TRect read FCaptionRect; + property ImageRect: TRect read FImageRect; + property ViewInfo: TdxSideBarViewInfo read FViewInfo; + end; + + TdxSideItemViewInfoClass = class of TdxSideItemViewInfo; + + TdxSideBarViewInfo = class + private + FPainter: TdxSideBarPainter; + FGroups: TList; + FItems: TList; + FIsReady: Boolean; + FItemsRect: TRect; + FTopScrollButtonRect: TRect; + FBottomScrollButtonRect: TRect; + + function GetGroup(Index: Integer): TdxSideGroupViewInfo; + function GetItem(Index: Integer): TdxSideItemViewInfo; + + function GetItemCorrectedCaptionRect(ACaption: String; ARect: TRect): TRect; + protected + function CreateGroup(AGroup: TdxSideGroup; ARect: TRect): TdxSideGroupViewInfo; virtual; + procedure CreateGroups; + procedure ClearGroups; + function CreateItemInfo(AItem: TdxSideBarItem; AImageRect, ACaptionRect: TRect): TdxSideItemViewInfo; virtual; + function CreateItem(AItem: TdxSideBarItem; ATop: Integer): TdxSideItemViewInfo; virtual; + procedure CreateItems; + procedure ClearItems; + function GetGroupHeight: Integer; virtual; + function GetPaintRect: TRect; virtual; + function GetGroupOffSet: Integer; virtual; + function GetBorderOffSet: Integer; virtual; + function GetSideBarTopItemSpaceHeight: Integer; virtual; + + function GetItemViewInfo(AItem: TdxSideBarItem): TdxSideItemViewInfo; + function GetItemImageRect(AItem: TdxSideBarItem; ATop: Integer): TRect; + function GetItemCaptionRect(AItem: TdxSideBarItem; ATop: Integer; AImageRect: TRect): TRect; + function GetItemEditRect(AItem: TdxSideBarItem; ACaption: String): TRect; + + function GetDrawEdgeFlag: Integer; + + function GetItemHeight: Integer; + function GetLargeImageHeight: Integer; + function GetLargeImageWidth: Integer; + function GetSmallImageHeight: Integer; + function GetSmallImageWidth: Integer; + + procedure CalcItemsRect; + procedure CalcScrollButtonsRect; + + function GroupIndexOf(AGroup: TdxSideGroupViewInfo): Integer; + function ItemIndexOf(AItem: TdxSideItemViewInfo): Integer; + + property ItemsRect: TRect read FItemsRect; + property TopScrollButtonRect: TRect read FTopScrollButtonRect; + property BottomScrollButtonRect: TRect read FBottomScrollButtonRect; + public + constructor Create(APainter: TdxSideBarPainter); virtual; + destructor Destroy; override; + function SideBar: TdxSideBar; + procedure Clear; + procedure CalcViewInfo; + procedure Unready; + + function GroupCount: Integer; + function ItemCount: Integer; + + function GetGroupViewInfoByGroup(AGroup: TdxSideGroup): TdxSideGroupViewInfo; + function GetItemViewInfoByItem(AItem: TdxSideBarItem): TdxSideItemViewInfo; + + function ActiveGroupViewInfo: TdxSideGroupViewInfo; + function GetGroupViewInfoAtPos(p: TPoint): TdxSideGroupViewInfo; + function GetGroupAtPos(p: TPoint): TdxSideGroup; + function GetItemViewInfoAtPos(p: TPoint): TdxSideItemViewInfo; + function GetItemAtPos(p: TPoint): TdxSideBarItem; + function GetNearestItemViewInfoAtPost(p: TPoint; var APosition: TdxSideBarDragSourcePosition): TdxSideItemViewInfo; + function GetNearestItemAtPost(p: TPoint; var APosition: TdxSideBarDragSourcePosition): TdxSideBarItem; + + function IsTopScrollButtonVisible: Boolean; + function IsBottomScrollButtonVisible: Boolean; + function IsPtTopScrollButton(pt: TPoint): Boolean; + function IsPtBottomScrollButton(pt: TPoint): Boolean; + + property IsReady: Boolean read FIsReady; + property Painter: TdxSideBarPainter read FPainter; + property Groups[Index: Integer]: TdxSideGroupViewInfo read GetGroup; + property Items[Index: Integer]: TdxSideItemViewInfo read GetItem; + end; + + TdxSideBarViewInfoClass = class of TdxSideBarViewInfo; + + TdxSideBarPainter = class + private + FSideBar: TdxSideBar; + FViewInfo: TdxSideBarViewInfo; + protected + function ClientHeight: Integer; + function ClientWidth: Integer; + procedure ExcludeClipRect(ARect: TRect); + procedure IntersectClipRect(ARect: TRect); + + function CreateViewInfo: TdxSideBarViewInfo; virtual; + + procedure ScrollGroups; + + procedure DoDrawItemBorder(AItemViewInfo: TdxSideItemViewInfo; const ARect: TRect); virtual; + + procedure DrawFillRect(ARect: TRect); + procedure DrawGroups; + procedure DrawItems; + procedure DrawBorder; virtual; + procedure DrawGroup(AGroupViewInfo: TdxSideGroupViewInfo); virtual; + procedure DrawItem(AItemViewInfo: TdxSideItemViewInfo); virtual; + procedure DrawItemCaption(AItemViewInfo: TdxSideItemViewInfo); virtual; + procedure DrawImageBackground(AItemViewInfo: TdxSideItemViewInfo; ARect: TRect); virtual; + procedure DrawItemImage(AItemViewInfo: TdxSideItemViewInfo); virtual; + procedure DrawItemBorder(AItemViewInfo: TdxSideItemViewInfo); virtual; + procedure DrawScrollButtons; virtual; + procedure DrawDragDestinationArrow; virtual; + public + constructor Create(ASideBar: TdxSideBar); virtual; + destructor Destroy; override; + function Canvas: TCanvas; + function DC: HDC; + procedure NeedRecalViewInfo; + + procedure Paint; + procedure InvalidateGroup(AGroup: TdxSideGroup); + procedure InvalidateItem(AItem: TdxSideBarItem); virtual; + procedure InvalidateItemImage(AItem: TdxSideBarItem); + procedure InvalidateItemBorder(AItem: TdxSideBarItem); virtual; + procedure InvalidateItems; + procedure InvalidateScrollButtons; + + function IsGroupFocused: Boolean; virtual; + + property SideBar: TdxSideBar read FSideBar; + property ViewInfo: TdxSideBarViewInfo read FViewInfo; + end; + + TdxSideBarPainterClass = class of TdxSideBarPainter; + + TdxSideBar = class(TCustomPanel) + private + FLargeImages: TCustomImageList; + FSmallImages: TCustomImageList; + FSmallChangeLink: TChangeLink; + FLargeChangeLink: TChangeLink; + + FActiveGroupIndex: Integer; + FOldActiveGroup: TdxSideGroup; + FActiveGroup: TdxSideGroup; + FGroups: TdxSideGroups; + FStore: TdxSideBarStore; + FGroupFont: TFont; + FItemFont: TFont; + FRenameGroup: TdxSideGroup; + FRenameItem: TdxSideBarItem; + FRenameEdit: TEdit; + FCanSelected: Boolean; + FHintWindow: THintWindow; + FHintWindowShowing: Boolean; +// FHintTimerID: Integer; + FSelectedItem: TdxSideBarItem; + FOnDeleteItem: TdxSideBarDeleteItemEvent; + FOnChangeActiveGroup: TNotifyEvent; + FOnChangeFocusedItem: TNotifyEvent; + FOnChangeSelectedItem: TNotifyEvent; + FOnChangeGroupCaption: TdxSideBarChangeGroupCaptionEvent; + FSpaceHeight: Integer; + FScrollButtonUpIsDown: Boolean; + FScrollButtonDownIsDown: Boolean; + + FScrollTimer: TTimer; + FHintTimer: TTimer; + + FMouseDownItem: TdxSideBarItem; + FMouseFocusedItem: TdxSideBarItem; + FMouseFocusedItemIsDown: Boolean; + FMouseFocusedGroup: TdxSideGroup; + FMouseFocusedGroupIsDown: Boolean; + FDestDropItem: TdxSideBarItem; + FDropItemPosition: TdxSideBarDragSourcePosition; + FEnableDraging: Boolean; + FDragMode: TDragMode; + FPointDragging: TPoint; + FGroupPopupMenu: TPopupMenu; + FItemPopupMenu: TPopupMenu; + FTransparentImages: Boolean; + FImageList: TImageList; + FAssignFlag: Boolean; + FOnMouseEnter: TNotifyEvent; + FOnMouseLeave: TNotifyEvent; + FOnAfterEdit: TNotifyEvent; + FOnBeforeEdit: TNotifyEvent; + FOnDragDropItem: TdxSideBarDragDropItemEvent; + FOnItemClick: TdxSideBarItemClickEvent; + FBkPicture: TPicture; + FBkGround: TdxSideBarBackGround; + FPaintStyle: TdxsbPaintStyle; + FRegistryPath: string; + FStoreInRegistry: Boolean; + FIsMakingUpdate: Boolean; + FGroupHeightOffSet: Integer; + FShowGroups: Boolean; + FDestroying: Boolean; + FPainter: TdxSideBarPainter; + + function GetGroupCount: Integer; + function GetHintWindow: THintWindow; + function GetPainter: TdxSideBarPainter; + function GetScrollDelay: Integer; + function GetViewInfo: TdxSideBarViewInfo; + procedure SetActiveGroup(Value: TdxSideGroup); + procedure SetActiveGroupIndex(Value: Integer); + procedure SetBkGround(Value: TdxSideBarBackGround); + procedure SetBkPicture(Value: TPicture); + procedure SetCanSelected(Value: Boolean); + procedure SetGroupFont(Value: TFont); + procedure SetGroups(Value: TdxSideGroups); + procedure SetGroupHeightOffSet(Value: Integer); + procedure SetItemFont(Value: TFont); + procedure SetImages(AValue: TCustomImageList; var AImageList: TCustomImageList; AChangeLink: TChangeLink); + procedure SetLargeImages(Value: TCustomImageList); + procedure SetSmallImages(Value: TCustomImageList); + procedure SetPaintStyle(Value: TdxsbPaintStyle); + procedure SetScrollDelay(Value: Integer); + procedure SetShowGroups(Value: Boolean); + procedure SetSpaceHeight(Value: Integer); + procedure SetStore(Value: TdxSideBarStore); + procedure SetTransparentImages(Value: Boolean); + procedure SetDestDropItem(Value: TdxSideBarItem); + procedure SetDropItemPosition(Value: TdxSideBarDragSourcePosition); + procedure SetDestDropItemandPosition(AItem: TdxSideBarItem; APosition: TdxSideBarDragSourcePosition); + procedure SetMouseFocusedItem(Item: TdxSideBarItem); + procedure SetSelectedItem(Item: TdxSideBarItem); + + procedure DoHintTimer(Sender: TObject); + procedure DoScrollTimer(Sender: TObject); + procedure HintActivate(AShow: Boolean); + + function GetVisibleGroup(Index: Integer): TdxSideGroup; + function GetVisibleIndexByGroup(AGroup: TdxSideGroup): Integer; + + function GetFocusedItem(X, Y: Integer): TdxSideBarItem; + function GetTopVisibleToMakeItemVisible(AItem: TdxSideBarItem): Integer; + function GetDestDropItemViewInfo: TdxSideItemViewInfo; + + procedure RenameEditExit(Sender: TObject); + procedure DoGroupMouseFocused(Group: TdxSideGroup; IsDown: Boolean); + procedure DoItemMouseFocused(Item: TdxSideBarItem; IsDown: Boolean); + procedure DoItemSelected(Item: TdxSideBarItem); + procedure DoBkPictureChange(Sender: TObject); + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER; + procedure WMEraseBkgnd(var Message: TWmEraseBkgnd); message WM_ERASEBKGND; + procedure WMSetCursor(var Message: TWMSetCursor); message WM_SETCURSOR; + procedure WMSize(var Message: TWMSize); message WM_SIZE; + + procedure OnChangeLink(Sender: TObject); + procedure OnFontChange(Sender: TObject); + protected + procedure Loaded; override; + procedure Paint; override; + procedure RepaintAll; + procedure InvalidateGroup(AGroup: TdxSideGroup); + procedure InvalidateItem(AItem: TdxSideBarItem); + procedure InvalidateItemImage(AItem: TdxSideBarItem); + procedure InvalidateItemBorder(AItem: TdxSideBarItem); + procedure InvalidateItems(AUpdateCalcInfo: Boolean); + procedure InvalidateScrollButtons; + + procedure WndProc(var Message: TMessage); override; + procedure Notification(AComponent: TComponent; + Operation: TOperation); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure DoItemClick(Item: TdxSideBarItem); virtual; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); override; + procedure DoEndDrag(Target: TObject; X, Y: Integer); override; + procedure DoStartDrag(var DragObject: TDragObject); override; + function CreatePainter: TdxSideBarPainter; virtual; + function VisibleGroupCount: Integer; + + property DestDropItem: TdxSideBarItem read FDestDropItem write SetDestDropItem; + property DestDropItemViewInfo: TdxSideItemViewInfo read GetDestDropItemViewInfo; + property DropItemPosition: TdxSideBarDragSourcePosition read FDropItemPosition write SetDropItemPosition; + property HintWindow: THintWindow read GetHintWindow; + property MouseFocusedItemIsDown: Boolean read FMouseFocusedItemIsDown; + property Painter: TdxSideBarPainter read GetPainter; + property ViewInfo: TdxSideBarViewInfo read GetViewInfo; + property VisibleGroups[Index: Integer]: TdxSideGroup read GetVisibleGroup; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; + + class function XPBackgroundColor: COLORREF; + class function XPSelectedItemColor: COLORREF; + + procedure Assign(Source: TPersistent); override; + function GetGroupAtPos(p: TPoint): TdxSideGroup; + function GetItemAtPos(p: TPoint): TdxSideBarItem; + function GetPopupGroup: TdxSideGroup; + function IsGroupEditing: Boolean; + function IsItemEditing: Boolean; + function IsEditing: Boolean; + procedure EditGroup(Group: TdxSideGroup); + procedure EditItem(Item: TdxSideBarItem); + procedure EndEdit(Accept: Boolean); + + function GetSmallImages: TCustomImageList; + function GetLargeImages: TCustomImageList; + + procedure LoadFromRegistry(ARegistryPath: string); + procedure SaveToRegistry(ARegistryPath: string); + + property ActiveGroup: TdxSideGroup read FActiveGroup write SetActiveGroup; + property EditControl: TEdit read FRenameEdit; + property EditingGroup: TdxSideGroup read FRenameGroup; + property EditingItem: TdxSideBarItem read FRenameItem; + property FocusedItem: TdxSideBarItem read FMouseFocusedItem; + property GroupCount: Integer read GetGroupCount; + property IsMakingUpdate: Boolean read FIsMakingUpdate write FIsMakingUpdate; + property SelectedItem: TdxSideBarItem read FSelectedItem write DoItemSelected; + + property BevelWidth; + property BorderWidth; + published + property Align default alLeft; + property BkGround: TdxSideBarBackGround read FBkGround write SetBkGround; + property BkPicture: TPicture read FBkPicture write SetBkPicture; + property Color default clGrayText; + property CanSelected: Boolean read FCanSelected write SetCanSelected default False; + property GroupFont: TFont read FGroupFont write SetGroupFont; + property Groups: TdxSideGroups read FGroups write SetGroups; + // Have to be defined after property Groups ! + property ActiveGroupIndex: Integer read FActiveGroupIndex write SetActiveGroupIndex; + property GroupPopupMenu: TPopupMenu read FGroupPopupMenu write FGroupPopupMenu; + property GroupHeightOffSet: Integer read FGroupHeightOffSet write SetGroupHeightOffSet default 0; + property ItemFont: TFont read FItemFont write SetItemFont; + property ItemPopupMenu: TPopupMenu read FItemPopupMenu write FItemPopupMenu; + property LargeImages: TCustomImageList read FLargeImages write SetLargeImages; + property PaintStyle: TdxsbPaintStyle read FPaintStyle write SetPaintStyle default sbpsFlat; + property SmallImages: TCustomImageList read FSmallImages write SetSmallImages; + property ScrollDelay: Integer read GetScrollDelay write SetScrollDelay default 300; + property SpaceHeight: Integer read FSpaceHeight write SetSpaceHeight default 7; + property Store: TdxSideBarStore read FStore write SetStore; + property TransparentImages: Boolean read FTransparentImages write SetTransparentImages default False; + property RegistryPath: string read FRegistryPath write FRegistryPath; + property ShowGroups: Boolean read FShowGroups write SetShowGroups default True; + property StoreInRegistry: Boolean read FStoreInRegistry write FStoreInRegistry default False; + property OnItemClick: TdxSideBarItemClickEvent read FOnItemClick write FOnItemClick; + property OnDeleteItem: TdxSideBarDeleteItemEvent read FOnDeleteItem write FOnDeleteItem; + property OnChangeActiveGroup: TNotifyEvent read FOnChangeActiveGroup write FOnChangeActiveGroup; + property OnChangeFocusedItem: TNotifyEvent read FOnChangeFocusedItem write FOnChangeFocusedItem; + property OnChangeGroupCaption: TdxSideBarChangeGroupCaptionEvent + read FOnChangeGroupCaption write FOnChangeGroupCaption; + property OnChangeSelectedItem: TNotifyEvent read FOnChangeSelectedItem + write FOnChangeSelectedItem; + property BorderStyle; + property DragCursor; + property DragMode read FDragMode write FDragMode; + property Enabled; + property Ctl3D; + property Locked; + property ParentColor; + property ParentCtl3D; + property ParentShowHint; + property ShowHint; + property Visible; + property OnAfterEdit: TNotifyEvent read FOnAfterEdit write FOnAfterEdit; + property OnBeforeEdit: TNotifyEvent read FOnBeforeEdit write FOnBeforeEdit; + property OnClick; + property OnDblClick; + property OnDragDrop; + property OnDragDropItem: TdxSideBarDragDropItemEvent read FOnDragDropItem + write FOnDragDropItem; + property OnDragOver; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnMouseDown; + property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter; + property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnResize; + property OnStartDrag; + + {$IFDEF DELPHI4} + property Anchors; + property Constraints; + property OnStartDock; + property OnEndDock; + {$ENDIF} + end; + + TdxSideBarPopupMenuOption = (sbmIconType, sbmAddGroup, sbmRemoveGroup, + sbmCustomize, sbmRenameGroup, sbmRenameItem, sbmRemoveItem); + + TdxSideBarPopupMenuOptions = set of TdxSideBarPopupMenuOption; + + TdxSideBarPopupMenu = class(TPopupMenu) + private + FOptions: TdxSideBarPopupMenuOptions; + List: TList; + Bar: TdxSideBar; + FocusedItem: TdxSideBarItem; + Group: TdxSideGroup; + FOnAfterClick: TNotifyEvent; + FOnPopupClose: TNotifyEvent; + protected + procedure BarMenuClick(Sender: TObject); + procedure DestroyBarItems; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + procedure Popup(X, Y: Integer); override; + published + property Options: TdxSideBarPopupMenuOptions read FOptions write FOptions; + property OnAfterClick: TNotifyEvent read FOnAfterClick write FOnAfterClick; + property OnPopupClose: TNotifyEvent read FOnPopupClose write FOnPopupClose; + end; + + EdxSideBarError = class(Exception); + + TdxSideBarDragObject = class(TObject) + private + FStoredItem: TdxStoredSideItem; + FItem: TdxSideBarItem; + FDeleteItem: Boolean; + FDragObject: TDragControlObject; + FCancelDrag: Boolean; + public + constructor Create(Control: TControl; var DragObject: TDragObject; + AItem: TdxSideBarItem; AStoredItem: TdxStoredSideItem); + destructor Destroy; override; + function EndDrag(Target: TObject; X, Y: Integer): TdxSideBarItem; + + property CancelDrag: Boolean read FCancelDrag write FCancelDrag; + property DeleteItem: Boolean read FDeleteItem write FDeleteItem; + property Item: TdxSideBarItem read FItem; + property StoredItem: TdxStoredSideItem read FStoredItem; + end; + +var + dxSideBarDragObject: TdxSideBarDragObject; + + //Group scrolling variable. Change them to change the speed of the group scrolling + dxSideBarGroupScrollStep: Integer = 1; + dxSideBarGroupScrollIncrement: Integer = 2; + dxSideBarGroupScrollTimeToIncrement: Integer = 50; + +implementation + +{$R dxsbar.res} + +uses dxsbstrs, dxsbarcs, Registry, TypInfo, Math; + +const + ScrollButtonHeight = 16; + ScrollButtonIndention = 3; + + dxSideBarHintShowDelay = 3000; + + // Cursors + dxSideBarDragCursor = -1121; + dxSideBarDragCopyCursor = -1122; + dxSideBarDragDeleteCursor = -1123; + dxSideBarGroupCursor = -1125; + + dxSideBarDefaultLargeImageHeight = 32; + dxSideBarDefaultLargeImageWidth = 32; + dxSideBarDefaultSmallImageHeight = 16; + dxSideBarDefaultSmallImageWidth = 16; + + dxSideBarDragArrowHeight = 9; + +function CreateChangeLink(AOnChange: TNotifyEvent): TChangeLink; +begin + Result := TChangeLink.Create; + Result.OnChange := AOnChange; +end; + +// null reference routines + +function GetViewInfoItem(AItemViewInfo: TdxSideItemViewInfo): TdxSideBarItem; +begin + if AItemViewInfo <> nil then + Result := AItemViewInfo.Item + else + Result := nil; +end; + +function GetViewInfoGroup(AGroupViewInfo: TdxSideGroupViewInfo): TdxSideGroup; +begin + if AGroupViewInfo <> nil then + Result := AGroupViewInfo.Group + else + Result := nil; +end; + +procedure CallNotify(ANotifyEvent: TNotifyEvent; ASender: TObject); +begin + if Assigned(ANotifyEvent) then + ANotifyEvent(ASender); +end; + +// cxGraphics + +function cxDrawText(ADC: THandle; const AText: string; var ARect: TRect; AFormat: UINT; ACharCount: Integer = - 1): Integer; +begin + Result := Windows.DrawText(ADC, PChar(AText), ACharCount, ARect, AFormat); +end; + +function IsImageAssigned(AImageList: TCustomImageList; AImageIndex: Integer): Boolean; +begin + Result := (AImageList <> nil) and (0 <= AImageIndex) and (AImageIndex < AImageList.Count); +end; + +procedure cxInvalidateRect(AHandle: THandle; const ARect: TRect; AEraseBackground: Boolean = True); +begin + InvalidateRect(AHandle, @ARect, AEraseBackground); +end; + +// system routines + +procedure DrawBmpOnCanvas(ACanvas: TCanvas; APicture: TPicture; + ADrawRect: TRect; AWidth, AHeight: Integer); +var + dLeft, dTop, dWidth, dHeight, sLeft, sTop : Integer; + ABmp: TBitmap; + ACreatedFlag: Boolean; +begin + ABmp := nil; + ACreatedFlag := False; + if (APicture.Graphic is TBitmap) then + ABmp := APicture.Bitmap; + if (APicture.Graphic is TIcon) or (APicture.Graphic is TMetaFile) then + begin + ABmp := TBitmap.Create; + ABmp.Height := APicture.Graphic.Height; + ABmp.Width := APicture.Graphic.Height; + ABmp.Canvas.Draw(0, 0, APicture.Graphic); + ACreatedFlag := True; + end; + + if (ABmp = nil) then begin + ACanvas.FillRect(ADrawRect); + Exit; + end; + dTop := ADrawRect.Top; + while (dTop < ADrawRect.Bottom) do begin + if (dTop mod ABmp.Height <> 0) then + sTop := dTop - (dTop div ABmp.Height) * ABmp.Height + else sTop := 0; + dHeight := ABmp.Height - sTop; + if (dTop + dHeight > ADrawRect.Bottom) then + dHeight := ADrawRect.Bottom - dTop; + dLeft := ADrawRect.Left; + while (dLeft < ADrawRect.Right) do begin + if (dLeft mod ABmp.Width <> 0) then + sLeft := dLeft - (dLeft div ABmp.Width) * ABmp.Width + else sLeft := 0; + dWidth := ABmp.Width - sLeft; + if (dLeft + dWidth > ADrawRect.Right) then + dWidth := ADrawRect.Right - dLeft; + BitBlt(ACanvas.Handle, dLeft, dTop, dWidth, dHeight, + ABmp.Canvas.Handle, sLeft, sTop, SRCCOPY); + Inc(dLeft, dWidth); + end; + Inc(dTop, dHeight); + end; + if ACreatedFlag then + ABmp.Free; +end; + +procedure DrawDifColorsOnCanvas(ACanvas: TCanvas; ABeginColor, AEndColor: TColor; + cdXY: Integer; AIsHorz: Boolean; ADrawRect: TRect; AWidth, AHeight: Integer); +var + r: TRect; + FBeginColor, FEndColor, FColor: Integer; + FBeginColorB, FBeginColorG, FBeginColorR: Byte; + FEndColorB, FEndColorG, FEndColorR: Byte; + dColorB, dColorG, dColorR: Real; + FColorB, FColorG, FColorR: Real; + brh: HBRUSH; + FHeight: Integer; +begin + + FBeginColor := ColorToRGB(ABeginColor); + FEndColor := ColorToRGB(AEndColor); + + FBeginColorB := GetBValue(FBeginColor); + FBeginColorG := GetGValue(FBeginColor); + FBeginColorR := GetRValue(FBeginColor); + + FEndColorB := GetBValue(FEndColor); + FEndColorG := GetGValue(FEndColor); + FEndColorR := GetRValue(FEndColor); + + if AIsHorz then + FHeight := AHeight + else FHeight := AWidth; + dColorB := (FEndColorB - FBeginColorB) * cdXY /FHeight; + dColorG := (FEndColorG - FBeginColorG) * cdXY /FHeight; + dColorR := (FEndColorR - FBeginColorR) * cdXY /FHeight; + + r := ADrawRect; + if AIsHorz then begin + r.Top := ADrawRect.Top; + FColorB := FBeginColorB + dColorB * r.Top / cdXY; + FColorG := FBeginColorG + dColorG * r.Top / cdXY; + FColorR := FBeginColorR + dColorR * r.Top / cdXY; + while (r.Top < ADrawRect.Bottom) do begin + r.Bottom := r.Top + cdXY; + if (r.Bottom > ADrawRect.Bottom) then + r.Bottom := ADrawRect.Bottom; + FColor := {PALETTE}RGB(Trunc(FColorR), Trunc(FColorG), Trunc(FColorB)); + brh := CreateSolidBrush(FColor); + Windows.FillRect(ACanvas.Handle, r, brh); + DeleteObject(brh); + if (r.Top mod cdXY <> 0) then + Dec(r.Top, r.Top mod cdXY); + Inc(r.Top, cdXY); + FColorB := FColorB + dColorB; + FColorG := FColorG + dColorG; + FColorR := FColorR + dColorR; + end; + end else begin + r.Left := ADrawRect.Left; + FColorB := FBeginColorB + dColorB * r.Left / cdXY; + FColorG := FBeginColorG + dColorG * r.Left / cdXY; + FColorR := FBeginColorR + dColorR * r.Left / cdXY; + while (r.Left < ADrawRect.Right) do begin + r.Right := r.Left + cdXY; + if (r.Right > ADrawRect.Right) then + r.Right := ADrawRect.Right; + FColor := {PALETTE}RGB(Trunc(FColorR), Trunc(FColorG), Trunc(FColorB)); + brh := CreateSolidBrush(FColor); + Windows.FillRect(ACanvas.Handle, r, brh); + DeleteObject(brh); + if (r.Left mod cdXY <> 0) then + Dec(r.Left, r.Left mod cdXY); + Inc(r.Left, cdXY); + FColorB := FColorB + dColorB; + FColorG := FColorG + dColorG; + FColorR := FColorR + dColorR; + end; + end; +// ACanvas.Brush.Color := OldColor; +end; + +function GetClippedString(DC: HDC; const S: string; Rect: TRect): string; +var + Width, Len: Integer; + Size: TSize; +begin + if S = '' then Result := '' + else + begin + Width := Rect.Right - Rect.Left; + for Len := Length(S) downto 0 do + begin + GetTextExtentPoint32(DC, PChar(Copy(S, 1, Len)), Len, Size); + if Size.cX <= Width then Break; + end; + Result := Copy(S, 1, Len); + end; +end; + +function GetFontHeight(AFont: TFont): Integer; +var + DC: HDC; + SaveFont: HFont; + Metrics: TTextMetric; +begin + DC := GetDC(0); + SaveFont := SelectObject(DC, AFont.Handle); + GetTextMetrics(DC, Metrics); + SelectObject(DC, SaveFont); + ReleaseDC(0, DC); + Result := Metrics.tmHeight; +end; + +type +{TStoredSideBarItemsStoreStrings} +TStoredSideBarItemsStoreStrings = class(TStringList) +private + Owner: TdxSideBarStore; + + procedure ChangeCategory(OldCategory, NewCategory: Integer); +public + constructor Create(AOwner: TdxSideBarStore); + procedure Clear; override; + procedure Delete(Index: Integer); override; + procedure Insert(Index: Integer; const S: string); override; + procedure Exchange(Index1, Index2: Integer); override; + procedure Move(CurIndex, NewIndex: Integer); override; +end; + +{TStoredSideBarItemsStoreStrings} + +constructor TStoredSideBarItemsStoreStrings.Create(AOwner: TdxSideBarStore); +begin + inherited Create; + Owner := AOwner; + if not (csLoading in Owner.ComponentState) then + Add(dxSideBarGetResourceString(@DXSB_DEFAULTGROUP)); +end; + +procedure TStoredSideBarItemsStoreStrings.ChangeCategory(OldCategory, NewCategory: Integer); +var + I: Integer; + List: TList; +begin + if (OldCategory > -1) and (OldCategory < Count) + and (NewCategory > -1) and (NewCategory < Count) then begin + List := TList.Create; + Owner.GetItemsByCategory(Strings[OldCategory], List); + for I := 0 to List.Count - 1 do + TdxStoredSideItem(List[I]).Category := NewCategory; + List.Free; + end; +end; + +procedure TStoredSideBarItemsStoreStrings.Clear; +begin + if (Owner.Count > 0) and not (csLoading in Owner.ComponentState) then + raise EdxSideBarError.Create(dxSideBarGetResourceString(@DXSB_CANTDELETEGROUP)) + else begin + inherited Clear; + if not (csLoading in Owner.ComponentState) then + Add(dxSideBarGetResourceString(@DXSB_DEFAULTGROUP)); + end; + +end; + +procedure TStoredSideBarItemsStoreStrings.Delete(Index: Integer); +var + I: Integer; +begin + if (Index > -1 ) and (Index < Count) and (Owner.GetCountByCategory(Strings[Index]) > 0) then + raise EdxSideBarError.Create(dxSideBarGetResourceString(@DXSB_CANTDELETEGROUP)) + else begin + if (Index > -1 ) and (Index < Count) then + for I := Index to Count - 1 do + ChangeCategory(I + 1, I); + inherited Delete(Index); + end; + if Count = 0 then + Add(dxSideBarGetResourceString(@DXSB_DEFAULTGROUP)); +end; + +procedure TStoredSideBarItemsStoreStrings.Insert(Index: Integer; const S: string); +var + I: Integer; +begin + inherited Insert(Index, S); + if (Index < Count) and (Index > -1) then + for I := Count - 1 downto Index + 1 do + ChangeCategory(I - 1, I); +end; + +procedure TStoredSideBarItemsStoreStrings.Exchange(Index1, Index2: Integer); +var + I: Integer; + List1: TList; + List2: TList; +begin + if (Index1 > -1) and (Index1 < Count) + and (Index2 > -1) and (Index2 < Count) then begin + List1 := TList.Create; + List2 := TList.Create; + Owner.GetItemsByCategory(Strings[Index1], List1); + Owner.GetItemsByCategory(Strings[Index2], List2); + for I := 0 to List1.Count - 1 do + TdxStoredSideItem(List1[I]).Category := Index2; + for I := 0 to List2.Count - 1 do + TdxStoredSideItem(List2[I]).Category := Index1; + List1.Free; + List2.Free; + end; + inherited Exchange(Index1, Index2); +end; + +procedure TStoredSideBarItemsStoreStrings.Move(CurIndex, NewIndex: Integer); +var + I: Integer; +begin + if (CurIndex < NewIndex) then begin + for I := CurIndex + 1 to NewIndex do + ChangeCategory(I, I - 1); + end else + for I := NewIndex to CurIndex - 1 do + ChangeCategory(I, I + 1); + inherited Move(CurIndex, NewIndex); +end; + +{$IFDEF DELPHI4} + +{ TdxSideBarItemActionLink } + +procedure TdxSideBarItemActionLink.AssignClient(AClient: TObject); +begin + FClient := AClient as TdxStoredSideItem; +end; + +function TdxSideBarItemActionLink.IsCaptionLinked: Boolean; +begin + Result := inherited IsCaptionLinked and + (FClient.Caption = (Action as TCustomAction).Caption); +end; + +function TdxSideBarItemActionLink.IsEnabledLinked: Boolean; +begin + Result := inherited IsEnabledLinked and + (FClient.Enabled = (Action as TCustomAction).Enabled); +end; + +function TdxSideBarItemActionLink.IsHintLinked: Boolean; +begin + Result := inherited IsHintLinked and + (FClient.Hint = (Action as TCustomAction).Hint); +end; + +function TdxSideBarItemActionLink.IsImageIndexLinked: Boolean; +begin + Result := inherited IsImageIndexLinked and + (FClient.LargeImage = (Action as TCustomAction).ImageIndex); +end; + +procedure TdxSideBarItemActionLink.SetCaption(const Value: string); +begin + if IsCaptionLinked then FClient.Caption := Value; +end; + +procedure TdxSideBarItemActionLink.SetEnabled(Value: Boolean); +begin + if IsEnabledLinked then FClient.Enabled := Value; +end; + +procedure TdxSideBarItemActionLink.SetHint(const Value: string); +begin + if IsHintLinked then FClient.Hint := Value; +end; + +procedure TdxSideBarItemActionLink.SetImageIndex(Value: Integer); +begin + if IsImageIndexLinked then FClient.LargeImage := Value; +end; + +procedure TdxSideBarItemActionLink.SetVisible(Value: Boolean); +begin + FClient.Enabled := Value and inherited IsEnabledLinked and TCustomAction(FClient.Action).Enabled; +end; +{$ENDIF} + +{TdxStoredSideItem} +constructor TdxStoredSideItem.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FCaption := dxSideBarGetResourceString(@DXSB_DEFAULTITEMCAPTION); + FLargeImage := -1; + FSmallImage := -1; + FEnabled := True; + FAvailableInCustomizeForm := True; +end; + +destructor TdxStoredSideItem.Destroy; +begin + if (FStore <> nil) then + FStore.RemoveItem(Self); +{$IFDEF DELPHI4} + if FActionLink <> nil then + begin + FActionLink.Free; + FActionLink := nil; + end; +{$ENDIF} + + inherited Destroy; +end; + +{$IFDEF DELPHI4} +procedure TdxStoredSideItem.Loaded; +begin + inherited; + if Action <> nil then ActionChange(Action, True); +end; +{$ENDIF} + +procedure TdxStoredSideItem.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (AComponent = FPopupMenu) then FPopupMenu := nil; + if (Operation = opRemove) and (AComponent = FStore) then Store := nil; +{$IFDEF DELPHI4} + if (Operation = opRemove) and (AComponent = Action) then Action := nil; +{$ENDIF} +end; + +function TdxStoredSideItem.GetParentComponent: TComponent; +begin + Result := FStore; +end; + +function TdxStoredSideItem.HasParent: Boolean; +begin + HasParent := True; +end; + +procedure TdxStoredSideItem.ReadState(Reader: TReader); +begin + inherited ReadState(Reader); + if Reader.Parent is TdxSideBarStore then Store := TdxSideBarStore(Reader.Parent); +end; + +procedure TdxStoredSideItem.SetParentComponent(AParent: TComponent); +begin + if not (csLoading in ComponentState) then Store := AParent as TdxSideBarStore; +end; + +{$IFDEF DELPHI4} +procedure TdxStoredSideItem.ActionChange(Sender: TObject; CheckDefaults: Boolean); +begin + if Action is TCustomAction then + with TCustomAction(Sender) do + begin + if not CheckDefaults or (Self.Caption = '') or (Self.Caption = dxSideBarGetResourceString(@DXSB_DEFAULTITEMCAPTION)) then + Self.Caption := Caption; + if not CheckDefaults or (Self.Enabled = True) then + Self.Enabled := Enabled; + if not CheckDefaults or (Self.Hint = '') then + Self.Hint := Hint; + if not CheckDefaults or (Self.LargeImage = -1) then + Self.LargeImage := ImageIndex; + end; +end; + +function TdxStoredSideItem.GetActionLinkClass: TdxSideBarItemActionLinkClass; +begin + Result := TdxSideBarItemActionLink; +end; +{$ENDIF} + +{$IFDEF DELPHI4} +function TdxStoredSideItem.GetAction: TBasicAction; +begin + if FActionLink = nil then Result := nil + else Result := FActionLink.Action; +end; +{$ENDIF} + +{$IFDEF DELPHI4} +procedure TdxStoredSideItem.SetAction(Value: TBasicAction); +begin + if Value = nil then + begin + if FActionLink <> nil then + FActionLink.Free; + FActionLink := nil; + end + else + begin + if (Value is TCustomAction) and (csDesigning in Value.ComponentState) then + TCustomAction(Value).DisableIfNoHandler := False; + if FActionLink = nil then + FActionLink := GetActionLinkClass.Create(Self); + FActionLink.Action := Value; + FActionLink.OnChange := DoActionChange; + ActionChange(Value, csLoading in Value.ComponentState); + Value.FreeNotification(Self); + end; +end; +{$ENDIF} + +procedure TdxStoredSideItem.SetCaption(Value: string); +begin + if (FCaption <> Value) then begin + FCaption := Value; + if (FStore <> nil) then + FStore.UpdateItem(Self); + end; +end; + +procedure TdxStoredSideItem.SetEnabled(Value: Boolean); +begin + if (FEnabled <> Value) then begin + FEnabled := Value; + if (FStore <> nil) then + FStore.UpdateItem(Self); + end; +end; + +procedure TdxStoredSideItem.SetHint(Value: string); +begin + if (FHint <> Value) then begin + FHint := Value; + if (FStore <> nil) then + FStore.UpdateItem(Self); + end; +end; + +procedure TdxStoredSideItem.DoClick(Sender: TObject; Item: TdxSideBarItem); +begin + if Assigned(FOnClick) then + FOnClick(Sender, Item) + else + if FActionLink <> nil then + FActionLink.Execute; +end; + +procedure TdxStoredSideItem.SetCategory(Value: Integer); +begin + if (csLoading in ComponentState) then + FCategory := Value + else + if (FStore <> nil) and (Value > - 1) + and (Value < FStore.Categories.Count) then begin + FCategory := Value; + FStore.UpdateEditorItem(Self) + end; +end; + +procedure TdxStoredSideItem.SetLargeImage(Value: Integer); +begin + if (FLargeImage <> Value) then begin + FLargeImage := Value; + if (FStore <> nil) then + FStore.UpdateItem(Self); + end; +end; + +procedure TdxStoredSideItem.SetSmallImage(Value: Integer); +begin + if (FSmallImage <> Value) then begin + FSmallImage := Value; + if (FStore <> nil) then + FStore.UpdateItem(Self); + end; +end; + +procedure TdxStoredSideItem.SetStore(Value: TdxSideBarStore); +begin + if (FStore <> Value) then begin + if (FStore <> nil) then + FStore.RemoveItem(Self); + FStore := Value; + if (FStore <> nil) then begin + FStore.AddItem(Self); + if not (csLoading in ComponentState) then + Category := 0; + end; + end; +end; + +{$IFDEF DELPHI4} +procedure TdxStoredSideItem.DoActionChange(Sender: TObject); +begin + if Sender = Action then ActionChange(Sender, False); +end; + +function TdxStoredSideItem.IsCaptionStored: Boolean; +begin + Result := (FActionLink = nil) or not FActionLink.IsCaptionLinked; +end; + +function TdxStoredSideItem.IsEnabledStored: Boolean; +begin + Result := (FActionLink = nil) or not FActionLink.IsEnabledLinked; +end; + +function TdxStoredSideItem.IsHintStored: Boolean; +begin + Result := (FActionLink = nil) or not FActionLink.IsHintLinked; +end; + +function TdxStoredSideItem.IsImageIndexStored: Boolean; +begin + Result := (FActionLink = nil) or not FActionLink.IsImageIndexLinked; +end; +{$ENDIF} + +procedure TdxSideBarStoreCustomizeForm.BeginCustomizing; +begin + Store.FIsCustomizing := True; +end; + +procedure TdxSideBarStoreCustomizeForm.EndCustomizing; +begin + Store.FIsCustomizing := False; +end; + +{TdxSideBarStore} +constructor TdxSideBarStore.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FList := TList.Create; + FBars := TList.Create; + FCategories := TStoredSideBarItemsStoreStrings.Create(Self); + FLargeChangeLink := CreateChangeLink(OnChangeLink); + FSmallChangeLink := CreateChangeLink(OnChangeLink); + FDefaultLargeImage := -1; + FDefaultSmallImage := -1; + + Designer := nil; +end; + +destructor TdxSideBarStore.Destroy; +begin + FSmallChangeLink.Free; + FLargeChangeLink.Free; + if (Designer <> nil) then + Designer.Free; + DestroyItems; + FCategories.Free; + FBars.Free; + FList.Free; + inherited Destroy; +end; + +procedure TdxSideBarStore.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) then begin + if (AComponent = LargeImages) then LargeImages := nil; + if (AComponent = SmallImages) then SmallImages := nil; + end; +end; + +procedure TdxSideBarStore.DestroyItems; +var + Item: TdxStoredSideItem; +begin + while FList.Count > 0 do + begin + Item := TdxStoredSideItem(FList.Last); + RemoveItem(Item); + Item.Free; + end; +end; + +{$IFDEF DELPHI3} +procedure TdxSideBarStore.GetChildren(Proc: TGetChildProc; Root: TComponent); +var + I: Integer; +begin + for I := 0 to Count - 1 do + if Items[I].Owner = Root then Proc(Items[I]); +end; +{$ELSE} +procedure TdxSideBarStore.GetChildren(Proc: TGetChildProc); +var + I: Integer; +begin + for I := 0 to Count - 1 do + if Items[I].Owner <> Self then Proc(Items[I]); +end; +{$ENDIF} + +procedure TdxSideBarStore.SetName(const Value: TComponentName); +var + I: Integer; + OldName, ItemName, NamePrefix: TComponentName; + item: TdxStoredSideItem; +begin + OldName := Name; + inherited SetName(Value); + if (csDesigning in ComponentState) and (Name <> OldName) then + for I := 0 to Count - 1 do begin + item := Items[I]; + if item.Owner = Owner then begin + itemName := item.Name; + NamePrefix := itemName; + if Length(NamePrefix) > Length(OldName) then begin + SetLength(NamePrefix, Length(OldName)); + if CompareText(OldName, NamePrefix) = 0 then begin + Delete(itemName, 1, Length(OldName)); + Insert(Value, itemName, 1); + try + item.Name := itemName; + except + on EComponentError do + end; + end; + end; + end; + end; + if (Designer <> nil) then + Designer.SideBarStoreEditorUpdate; +end; + +function TdxSideBarStore.GetCount: Integer; +begin + Result := FList.Count; +end; + +function TdxSideBarStore.GetSideBarCount: Integer; +begin + Result := FBars.Count; +end; + +function TdxSideBarStore.GetItem(Index: Integer): TdxStoredSideItem; +begin + if (Index > -1) and (Index < Count) then + Result := TdxStoredSideItem(FList[INdex]) + else Result := nil; +end; + +function TdxSideBarStore.GetSideBar(Index: Integer): TdxSideBar; +begin + Result := nil; + if (Index > -1) and (Index < FBars.Count) then + Result := TdxSideBar(FBars[Index]); +end; + +procedure TdxSideBarStore.SetCategories(Value: TStrings); +var + I: Integer; +begin + if (Value.Count = 0) then begin + Categories.Clear; + Exit; + end; + if (Value.Count < FCategories.Count) then begin + for I := Value.Count to FCategories.Count - 1 do + if (GetCountByCategory(FCategories[I]) > 0) then begin + raise EdxSideBarError.Create(dxSideBarGetResourceString(@DXSB_CANTDELETEGROUP)); + Exit; + end; + while Value.Count < Categories.Count do + FCategories.Delete(FCategories.Count - 1); + end else begin + for I := FCategories.Count to Value.Count - 1 do + FCategories.Add(Value[I]); + end; + for I := 0 to Value.Count - 1 do + FCategories[I]:= Value[I]; +end; + +procedure TdxSideBarStore.SetDefaultLargeImage(Value: Integer); +begin + if (Value >= -1) and (FDefaultLargeImage <> Value) then begin + FDefaultLargeImage := Value; + RedrawBars; + end; +end; + +procedure TdxSideBarStore.SetDefaultSmallImage(Value: Integer); +begin + if (Value >= -1) and (FDefaultSmallImage <> Value) then begin + FDefaultSmallImage := Value; + RedrawBars; + end; +end; + +procedure TdxSideBarStore.SetImages(AValue: TCustomImageList; var AImageList: TCustomImageList; AChangeLink: TChangeLink); +begin + if (AImageList <> AValue) then + begin + if (AImageList <> nil) and not (csDestroying in AImageList.ComponentState) then + AImageList.UnRegisterChanges(AChangeLink); + AImageList := AValue; + if (AImageList <> nil) then + begin + AImageList.RegisterChanges(AChangeLink); + AImageList.FreeNotification(Self); + end; + if not (csDestroying in ComponentState) then + begin + RedrawBars; + if (Designer <> nil) then + Designer.SideBarStoreEditorUpdate; + end; + end; +end; + +procedure TdxSideBarStore.SetLargeImages(Value: TCustomImageList); +begin + SetImages(Value, FLargeImages, FLargeChangeLink); +end; + +procedure TdxSideBarStore.SetSmallImages(Value: TCustomImageList); +begin + SetImages(Value, FSmallImages, FSmallChangeLink); +end; + +function TdxSideBarStore.GetCountByCategory(St: string): Integer; +var + Index, I: Integer; +begin + Result := 0; + Index := FCategories.IndexOf(St); + if (Index > -1) then + for I := 0 to Count - 1 do + if (Items[I].Category = Index) then + Inc(Result); +end; + +function TdxSideBarStore.GetItemByCategory(St: string; Index: Integer): TdxStoredSideItem; +var + List: TList; +begin + Result := nil; + List := TList.Create; + GetItemsByCategory(St, List); + if (Index < List.Count) then + Result := TdxStoredSideItem(List[Index]); + List.Free; +end; + +function TdxSideBarStore.GetItemsByCategory(St: string; List: TList): Integer; +var + Index, I: Integer; +begin + List.Clear; + Index := FCategories.IndexOf(St); + if (Index > -1) then + for I := 0 to Count - 1 do + if (Items[I].Category = Index) then + List.Add(Items[I]); + Result := List.Count; +end; + +procedure TdxSideBarStore.AddItem(Item: TdxStoredSideItem); +begin + FList.Add(Item); +end; + +procedure TdxSideBarStore.ExchangeItems(Item1, Item2: TdxStoredSideItem); +var + Index1, Index2: Integer; +begin + Index1 := FList.IndexOf(Item1); + Index2 := FList.IndexOf(Item2); + if (Index1 > -1) and (Index2 > -1) then + FList.Exchange(Index1, Index2); +end; + +procedure TdxSideBarStore.RemoveItem(Item: TdxStoredSideItem); +begin + RemoveBarItem(Item); + FList.Remove(Item); +end; + +procedure TdxSideBarStore.OnChangeLink(Sender: TObject); +begin + RedrawBars; +end; + +procedure TdxSideBarStore.RedrawBars; +var + I: Integer; +begin + for I := 0 to FBars.Count - 1 do + SideBars[I].RepaintAll; +end; + +procedure TdxSideBarStore.RemoveBarItem(StoredItem: TdxStoredSideItem); +var + I, j, k: Integer; +begin + if (csDestroying in ComponentState) then Exit; + for I := 0 to FBars.Count - 1 do + if not (csDestroying in SideBars[I].ComponentState) + and (SideBars[I].Groups <> nil) then + for j := 0 to SideBars[I].Groups.Count - 1 do begin + k := 0; + while k < SideBars[I].Groups[j].Items.Count do begin + if (SideBars[I].Groups[j].Items[k].StoredItem = StoredItem) then + SideBars[I].Groups[j].Items[k].Free + else Inc(k); + end; + end; +end; + +procedure TdxSideBarStore.UpdateItem(Item: TdxStoredSideItem); +begin + RedrawBars; + UpdateEditorItem(Item); +end; + +procedure TdxSideBarStore.Customize; +begin + SideBarCustomize(Self); +end; + +procedure TdxSideBarStore.UpdateEditorItem(Item: TdxStoredSideItem); +begin + if (Designer <> nil) then + Designer.SideBarStoreEditorUpdateItem(Item); +end; + +{TdxSideBarItem} +constructor TdxSideBarItem.Create(Collection: TCollection); +begin + inherited Create(Collection); + FIsDefault := True; + FEnabled := True; + FLargeImage := -1; + FSmallImage := -1; +end; + +destructor TdxSideBarItem.Destroy; +var + IsSelectedFlag: Boolean; + NeedRepaint: Boolean; + Bar: TdxSideBar; +begin + IsSelectedFlag := False; + NeedRepaint := False; + Bar := SideBar; + if (Bar <> nil) and not (csDestroying in Bar.ComponentState) then begin + NeedRepaint := Visible and not Bar.FDestroying; + if (Bar.IsEditing) then + Bar.EndEdit(False); + if (Bar.FSelectedItem = Self) then + IsSelectedFlag := True; + if (Bar.FMouseFocusedItem = Self) then + Bar.FMouseFocusedItem := nil; + end; + if (Bar <> nil) and Assigned(Bar.FOnDeleteItem) then + Bar.FOnDeleteItem(Bar, Self); + inherited Destroy; + if (IsSelectedFlag) then + Bar.SetSelectedItem(nil); + if NeedRepaint then + Bar.InvalidateItems(True); +end; + +procedure TdxSideBarItem.Assign(Source: TPersistent); +var + item: TdxSideBarItem; +begin + if (Source is TdxSideBarItem) then begin + item := TdxSideBarItem(Source); + FStoredItem := item.StoredItem; + FHint := item.Hint; + FIsDefault := item.IsDefault; + FCaption := item.Caption; + FTag := item.Tag; + FCustomData := item.CustomData; + FLargeImage := item.LargeImage; + FSmallImage := item.SmallImage; + FEnabled := item.Enabled; + end else inherited Assign(Source); +end; + +function TdxSideBarItem.MakeVisible; +begin + Result := IsFullVisible and Group.Active; + if not Result and Group.Active then + Group.TopVisibleItem := SideBar.GetTopVisibleToMakeItemVisible(self); +end; + +function TdxSideBarItem.IsSelected: Boolean; +begin + Result := SideBar.SelectedItem = self; +end; + +function TdxSideBarItem.IsFocused: Boolean; +begin + Result := SideBar.FocusedItem = self; +end; + +function TdxSideBarItem.IsFullVisible: Boolean; +begin + Result := (SideBar.ViewInfo.GetItemViewInfoByItem(self) <> nil) + and not SideBar.ViewInfo.GetItemViewInfoByItem(self).IsPartialVisible; +end; + +function TdxSideBarItem.Visible: Boolean; +begin + Result := SideBar.ViewInfo.GetItemViewInfoByItem(self) <> nil; +end; + +function TdxSideBarItem.GetCaption: string; +begin + if (FStoredItem <> nil) and IsDefault then + Result := FStoredItem.Caption + else Result := FCaption; +end; + +function TdxSideBarItem.GetEnabled: Boolean; +begin + if (FStoredItem <> nil) and IsDefault then + Result := FStoredItem.Enabled + else Result := FEnabled; +end; + +function TdxSideBarItem.GetHint: string; +begin + if (FStoredItem <> nil) and IsDefault then + Result := FStoredItem.Hint + else Result := FHint; +end; + +function TdxSideBarItem.GetGroup: TdxSideGroup; +begin + if (Collection <> nil) then + Result := TdxSideBarItems(Collection).Group + else Result := nil; +end; + +function TdxSideBarItem.GetSideBar: TdxSideBar; +begin + if Group <> nil then + Result := Group.SideBar + else Result := nil; +end; + +function TdxSideBarItem.GetLargeImage: Integer; +begin + if (FStoredItem <> nil) and IsDefault then + Result := FStoredItem.LargeImage + else Result := FLargeImage; +end; + +function TdxSideBarItem.GetSmallImage: Integer; +begin + if (FStoredItem <> nil) and IsDefault then + Result := FStoredItem.SmallImage + else Result := FSmallImage; +end; + +procedure TdxSideBarItem.SetCaption(Value: string); +var + ABar: TdxSideBar; +begin + if (FCaption <> Value) then begin + FCaption := Value; + if (FStoredItem <> nil) and (FCaption <> FStoredItem.Caption) then + IsDefault := False; + if (Collection <> nil) then begin + ABar := TdxSideBarItems(Collection).SideBar; + if (ABar <> nil) and (ABar.ActiveGroup <> nil) and Visible then + ABar.InvalidateItems(True); + end; + end; +end; + +procedure TdxSideBarItem.SetEnabled(Value: Boolean); +var + ABar: TdxSideBar; +begin + if (FEnabled <> Value) then + begin + FEnabled := Value; + if (FStoredItem <> nil) and (FEnabled <> FStoredItem.Enabled) then + IsDefault := False; + if (Collection <> nil) then begin + ABar := TdxSideBarItems(Collection).SideBar; + if (ABar <> nil) and (ABar.ActiveGroup <> nil) and Visible then + ABar.InvalidateItems(False); + end; + end; +end; + +procedure TdxSideBarItem.SetHint(Value: string); +begin + if (FHint <> Value) then begin + FHint := Value; + if (FStoredItem <> nil) and (FHint <> FStoredItem.Hint) then + IsDefault := False; + end; +end; + +procedure TdxSideBarItem.SetIsDefault(Value: Boolean); +begin + FIsDefault := Value; + if (FStoredItem <> nil) and (Value) then begin + Caption := FStoredItem.Caption; + Hint := FStoredItem.Hint; + Enabled := FStoredItem.Enabled; + LargeImage := FStoredItem.LargeImage; + SmallImage := FStoredItem.SmallImage; + end; +end; + +procedure TdxSideBarItem.SetLargeImage(Value: Integer); +begin + if (FLargeImage <> Value) then begin + FLargeImage := Value; + if (FStoredItem <> nil) and (FLargeImage <> FStoredItem.LargeImage) then + IsDefault := False; + if (Collection <> nil) and + (TdxSideBarItems(Collection).SideBar.ActiveGroup = + TdxSideBarItems(Collection).Group) then + TdxSideBarItems(Collection).SideBar.InvalidateItems(False); + end; +end; + +procedure TdxSideBarItem.SetSmallImage(Value: Integer); +begin + if (FSmallImage <> Value) then begin + FSmallImage := Value; + if (FStoredItem <> nil) and (FSmallImage <> FStoredItem.SmallImage) then + IsDefault := False; + if (Collection <> nil) and + (TdxSideBarItems(Collection).SideBar.ActiveGroup = + TdxSideBarItems(Collection).Group) then + TdxSideBarItems(Collection).SideBar.InvalidateItems(False); + end; +end; + +procedure TdxSideBarItem.SetStoredItem(Value: TdxStoredSideItem); +begin + if (Value <> FStoredItem) then begin + FStoredItem := Value; + if (FStoredItem <> nil) and (Collection <> nil) + and not (csLoading in TdxSideBarItems(Collection).SideBar.ComponentState) then begin + FCaption := FStoredItem.Caption; + FSmallImage := FStoredItem.SmallImage; + FLargeImage := FStoredItem.LargeImage; + Tag := FStoredItem.Tag; + FIsDefault := True; + TdxSideBarItems(Collection).SideBar.RepaintAll; + end; + end; +end; + +{TdxSideBarItems} +constructor TdxSideBarItems.Create(AOwner: TdxSideGroup); +begin + inherited Create(TdxSideBarItem); + Group := AOwner; + SideBar := TdxSideGroups(Group.Collection).SideBar; +end; + +procedure TdxSideBarItems.Update(Item: TCollectionItem); +begin + if (SideBar <> nil) and (SideBar.Owner <> nil) + and not (csLoading in SideBar.Owner.ComponentState) + and (SideBar.ActiveGroup = Group) then + SideBar.InvalidateItems(True); +end; + +function TdxSideBarItems.Add: TdxSideBarItem; +begin + Result := TdxSideBarItem(inherited Add); +end; + +function TdxSideBarItems.GetItem(Index: Integer): TdxSideBarItem; +begin + Result := TdxSideBarItem(inherited Items[Index]); +end; + +procedure TdxSideBarItems.SetItem(Index: Integer; Value: TdxSideBarItem); +begin + Items[Index].Assign(Value); +end; + +{TdxSideGroup} +constructor TdxSideGroup.Create(Collection: TCollection); +begin + inherited Create(Collection); + FItems := TdxSideBarItems.Create(Self); + FCaption := dxSideBarGetResourceString(@DXSB_DEFAULTGROUPCAPTION); + FTopVisibleItem := 0; + FIconType := dxsgLargeIcon; + FIsAssigning := False; + FVisible := True; + if not (csLoading in SideBar.ComponentState) then + begin + if (SideBar.FActiveGroup = nil) then + SideBar.ActiveGroup := Self; + SideBar.RepaintAll; + end; +end; + +destructor TdxSideGroup.Destroy; +var + Bar: TdxSideBar; + IsGroupActive: Boolean; +begin + FDestroying := True; + Bar := SideBar; + IsGroupActive := Active; + if Bar <> nil then + begin + if Bar.FMouseFocusedGroup = Self then + Bar.FMouseFocusedGroup := nil; + if Bar.FOldActiveGroup = Self then + Bar.FOldActiveGroup := nil; + if Bar.IsEditing then + Bar.EndEdit(False); + end; + FItems.Free; + FItems := nil; + inherited Destroy; + if (Bar <> nil) and not Bar.FDestroying then + begin + if IsGroupActive then + Bar.ActiveGroup := nil; + if Bar.ActiveGroup <> nil then + Bar.FActiveGroupIndex := Bar.GetVisibleIndexByGroup(Bar.ActiveGroup); + Bar.RepaintAll; + end; +end; + +procedure TdxSideGroup.MakeActive; +begin + SideBar.ActiveGroup := Self; +end; + +function TdxSideGroup.GetActive: Boolean; +begin + Result := SideBar.ActiveGroup = Self; +end; + +function TdxSideGroup.GetItemCount: Integer; +begin + if FItems = nil then + Result := 0 + else Result := FItems.Count; +end; + +function TdxSideGroup.SideBar: TdxSideBar; +begin + Result := TdxSideGroups(Collection).SideBar; +end; + +function TdxSideGroup.GetVisibleCount: Integer; +var + I: Integer; +begin + Result := 0; + if (Active) and (FTopVisibleItem > -1) and (Items.Count > 0) then + begin + I := FTopVisibleItem; + while (I < Items.Count) and Items[I].Visible do + begin + Inc(I); + Inc(Result); + end; + end; +end; + +procedure TdxSideGroup.SetCaption(Value: string); +var + ABar: TdxSideBar; +begin + if (FCaption <> Value) then + begin + FCaption := Value; + if FIsAssigning then Exit; + + ABar := SideBar; + if (ABar <> nil) and (([csLoading, csDestroying] * ABar.ComponentState) = []) then + begin + if Assigned(ABar.OnChangeGroupCaption) then + ABar.OnChangeGroupCaption(Self, Self); + ABar.InvalidateGroup(Self); + end; + end; +end; + +procedure TdxSideGroup.SetIconType(Value: TdxSideGroupIconType); +begin + if (FIconType <> Value) then begin + FIconType := Value; + if (TopVisibleItem <> 0) then + TopVisibleItem := 0; + if FIsAssigning then Exit; + if (SideBar <> nil) and not (csLoading in SideBar.ComponentState) + and (Self = SideBar.ActiveGroup) then + SideBar.InvalidateItems(True);; + end; +end; + +procedure TdxSideGroup.SetItems(Value: TdxSideBarItems); +begin + FTopVisibleItem := 0; + FItems.Assign(Value); + if (FItems.Count > 0) then + FTopVisibleItem := 0; +end; + +procedure TdxSideGroup.SetTopVisibleItem(Value: Integer); +begin + if (FTopVisibleItem <> Value) + and (Value > -1) and (Value < Items.Count) then begin + FTopVisibleItem := Value; + if (SideBar <> nil) and not (csLoading in SideBar.ComponentState) + and (SideBar.ActiveGroup = Self) then + SideBar.InvalidateItems(True); + end; +end; + +procedure TdxSideGroup.SetVisible(Value: Boolean); +begin + if (FVisible <> Value) then + begin + FVisible := Value; + if (SideBar <> nil) and not (csLoading in SideBar.ComponentState) then + SideBar.RepaintAll; + end; +end; + +procedure TdxSideGroup.Assign(Source: TPersistent); +begin + if (Source is TdxSideGroup) then begin + FIsAssigning := True; + Caption := TdxSideGroup(Source).Caption; + IconType := TdxSideGroup(Source).IconType; + Visible := TdxSideGroup(Source).Visible; + SetItems(TdxSideGroup(Source).Items); + FIsAssigning := False; + end + else inherited Assign(Source); +end; + +{TdxSideGroups} +constructor TdxSideGroups.Create(AOwner: TdxSideBar); +begin + inherited Create(TdxSideGroup); + SideBar := AOwner; +end; + +function TdxSideGroups.Add: TdxSideGroup; +begin + Result := TdxSideGroup(inherited Add); +end; + +function TdxSideGroups.GetItem(Index: Integer): TdxSideGroup; +begin + Result := TdxSideGroup(inherited Items[Index]); +end; + +function TdxSideGroups.GetVisibleItem(Index: Integer): TdxSideGroup; +var + I: Integer; + j: Integer; +begin + Result := nil; + j := 0; + for I := 0 to Count - 1 do + begin + if (Items[I].Visible) then + begin + if (Index = j) then + Result := Items[I]; + Inc(j); + end; + end; +end; + +function TdxSideGroups.GetVisibleCount: Integer; +var + I: Integer; +begin + Result := 0; + for I := 0 to Count - 1 do + if (Items[I].Visible) then + Inc(Result); +end; + +procedure TdxSideGroups.SetItem(Index: Integer; Value: TdxSideGroup); +begin + Items[Index].Assign(Value); +end; + +procedure TdxSideGroups.Update(Item: TCollectionItem); +begin + if (SideBar <> nil) and (SideBar.Owner <> nil) + and not (csLoading in SideBar.Owner.ComponentState) + and not (csDestroying in SideBar.ComponentState) + and (Count > 0) then begin + if (SideBar.FActiveGroup = nil) or (SideBar.FActiveGroup.FDestroying) then + SideBar.ActiveGroup := Items[0] + else SideBar.RepaintAll; + end; +end; + +{TdxSideBarBackGround} +constructor TdxSideBarBackGround.Create; +begin + inherited Create; + FBeginColor := clGrayText; + FEndColor := clGrayText; + FFillStyle := bfsNone; + FStep := 2; +end; + +function TdxSideBarBackGround.IsUsed: Boolean; +begin + Result := (FFillStyle <> bfsNone) and (FBeginColor <> EndColor); +end; + +procedure TdxSideBarBackGround.SetBeginColor(Value: TColor); +begin + if (FBeginColor <> Value) then begin + FBeginColor := Value; + DoChange; + end; +end; + +procedure TdxSideBarBackGround.SetEndColor(Value: TColor); +begin + if (FEndColor <> Value) then begin + FEndColor := Value; + DoChange; + end; +end; + +procedure TdxSideBarBackGround.SetFillStyle(Value: TdxSideBarFillStyle); +begin + if (FFillStyle <> Value) then begin + FFillStyle := Value; + DoChange; + end; +end; + +procedure TdxSideBarBackGround.SetStep(Value: Integer); +begin + if (Value <> FStep) and (Value > 0) then + begin + FStep := Value; + DoChange; + end; +end; + +procedure TdxSideBarBackGround.DoChange; +begin + CallNotify(FOnChange, Self); +end; + +{TSideBarRenameEdit} +type +TSideBarRenameEdit = class(TEdit) +private + procedure WMChar(var Message: TWMChar); message WM_CHAR; +protected + procedure CreateParams(var Params: TCreateParams); override; +end; + +procedure TSideBarRenameEdit.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + Params.Style := Params.Style or WS_BORDER; + if (TdxSideBar(Owner).FRenameItem <> nil) then begin + if (TdxSideBar(Owner).ActiveGroup.IconType = dxsgLargeIcon) then + Params.Style := Params.Style or ES_MULTILINE or ES_CENTER or ES_AUTOHSCROLL + else Params.Style := Params.Style or ES_LEFT or ES_AUTOHSCROLL; + end; +end; + +procedure TSideBarRenameEdit.WMChar(var Message: TWMChar); +var + ABounds: TRect; + ACurrentText: string; +begin + if (Message.CharCode = VK_RETURN) or (Message.CharCode = VK_ESCAPE) then + begin + TdxSideBar(Owner).EndEdit(Message.CharCode = VK_RETURN); + Exit; + end; + inherited; + if (TdxSideBar(Owner).FRenameItem <> nil) then begin + if (TdxSideBar(Owner).ActiveGroup.IconType = dxsgLargeIcon) then + ACurrentText := Text + else + ACurrentText := ''; + ABounds:= TdxSideBar(Owner).ViewInfo.GetItemEditRect(TdxSideBar(Owner).FRenameItem, + ACurrentText); + InflateRect(ABounds, 2, 2); + if (Left <> ABounds.Left) or (Width <> ABounds.Right - ABounds.Left) + or (Height <> ABounds.Bottom - ABounds.Top) or (Top <> ABounds.Top) then + SetBounds(ABounds.Left, ABounds.Top, ABounds.Right - ABounds.Left, + ABounds.Bottom - ABounds.Top); + end; +end; + +{TdxSideGroupViewInfo} +constructor TdxSideGroupViewInfo.Create(AViewInfo: TdxSideBarViewInfo; AGroup: TdxSideGroup; ARect: TRect); +begin + inherited Create; + FViewInfo := AViewInfo; + FGroup := AGroup; + FRect := ARect; +end; + +function TdxSideGroupViewInfo.GetPainter: TdxSideBarPainter; +begin + Result := ViewInfo.Painter; +end; + +function TdxSideGroupViewInfo.Index: Integer; +begin + Result := ViewInfo.GroupIndexOf(self); +end; + +function TdxSideGroupViewInfo.GetCaption: String; +begin + Result := GetClippedString(Painter.DC, Group.Caption, Rect); +end; + +{TdxSideItemViewInfo} +constructor TdxSideItemViewInfo.Create(AViewInfo: TdxSideBarViewInfo; AItem: TdxSideBarItem; AImageRect, ACaptionRect: TRect); +begin + inherited Create; + FViewInfo := AViewInfo; + FItem := AItem; + FImageRect := AImageRect; + FCaptionRect := ACaptionRect; +end; + +function TdxSideItemViewInfo.GetPainter: TdxSideBarPainter; +begin + Result := ViewInfo.Painter; +end; + +function TdxSideItemViewInfo.Index: Integer; +begin + Result := ViewInfo.ItemIndexOf(self); +end; + +function TdxSideItemViewInfo.IsPartialVisible: Boolean; +begin + Result := Bottom > ViewInfo.ItemsRect.Bottom; +end; + +function TdxSideItemViewInfo.Bottom: Integer; +begin + Result := ItemRect.Bottom; +end; + +function TdxSideItemViewInfo.Top: Integer; +begin + Result := ItemRect.Top; +end; + +function TdxSideItemViewInfo.FocusedCaptionRect: TRect; +begin + Result := CaptionRect; + if (Item.Group.IconType = dxsgLargeIcon) then + Result.Top := ImageRect.Bottom + else Result.Left := ImageRect.Right; +end; + +function TdxSideItemViewInfo.GetItemDragSourceSpace(APosition: TdxSideBarDragSourcePosition): TRect; +begin + Result := ViewInfo.ItemsRect; + case APosition of + sbdspTop: + begin + Result.Bottom := Top; + Result.Top := Result.Bottom - dxSideBarDragArrowHeight + 1; + end; + sbdspBottom: + begin + Result.Top := Bottom; + Result.Bottom := Result.Top + dxSideBarDragArrowHeight - 1; + end; + sbdspIn: + begin + Result.Top := Top; + Result.Bottom := Bottom; + end; + end; +end; + +function TdxSideItemViewInfo.GetBorderRect: TRect; +begin + Result := ImageRect; + InflateRect(Result, ViewInfo.GetBorderOffSet, ViewInfo.GetBorderOffSet); +end; + +function TdxSideItemViewInfo.GetItemRect: TRect; +begin + Result.Left := Min(Min(CaptionRect.Left, ImageRect.Left), BorderRect.Left); + Result.Top := Min(Min(CaptionRect.Top, ImageRect.Top), BorderRect.Top); + Result.Right := Max(Max(CaptionRect.Right, ImageRect.Right), BorderRect.Right); + Result.Bottom := Max(Max(CaptionRect.Bottom, ImageRect.Bottom), BorderRect.Bottom); +end; + +function TdxSideItemViewInfo.GetCaption: String; +begin + Result := Item.Caption; +end; + +function TdxSideItemViewInfo.GetImageIndex: Integer; +begin + if Item.Group.IconType = dxsgLargeIcon then + Result := Item.LargeImage + else Result := Item.SmallImage; +end; + +function TdxSideItemViewInfo.GetImageList: TCustomImageList; +begin + if Item.Group.IconType = dxsgLargeIcon then + Result := Painter.SideBar.GetLargeImages + else + Result := Painter.SideBar.GetSmallImages; +end; + +{TdxSideBarViewInfo} +constructor TdxSideBarViewInfo.Create(APainter: TdxSideBarPainter); +begin + inherited Create; + FPainter := APainter; + FGroups := TList.Create; + FItems := TList.Create; +end; + +destructor TdxSideBarViewInfo.Destroy; +begin + Clear; + FGroups.Free; + FItems.Free; + inherited Destroy; +end; + +procedure TdxSideBarViewInfo.Clear; +begin + ClearGroups; + ClearItems; +end; + +procedure TdxSideBarViewInfo.Unready; +begin + FIsReady := False; +end; + +procedure TdxSideBarViewInfo.CalcViewInfo; +begin + Clear; + CreateGroups; + CalcItemsRect; + CreateItems; + CalcScrollButtonsRect; + + FIsReady := True; +end; + +function TdxSideBarViewInfo.SideBar: TdxSideBar; +begin + Result := Painter.SideBar; +end; + +function TdxSideBarViewInfo.GroupCount: Integer; +begin + Result := FGroups.Count; +end; + +function TdxSideBarViewInfo.ItemCount: Integer; +begin + Result := FItems.Count; +end; + +function TdxSideBarViewInfo.GetGroup(Index: Integer): TdxSideGroupViewInfo; +begin + Result := TdxSideGroupViewInfo(FGroups[Index]); +end; + +function TdxSideBarViewInfo.GetItem(Index: Integer): TdxSideItemViewInfo; +begin + Result := TdxSideItemViewInfo(FItems[Index]); +end; + +function TdxSideBarViewInfo.GroupIndexOf(AGroup: TdxSideGroupViewInfo): Integer; +begin + Result := FGroups.IndexOf(AGroup); +end; + +function TdxSideBarViewInfo.ItemIndexOf(AItem: TdxSideItemViewInfo): Integer; +begin + Result := FItems.IndexOf(AItem); +end; + +function TdxSideBarViewInfo.GetGroupViewInfoByGroup(AGroup: TdxSideGroup): TdxSideGroupViewInfo; +var + i: Integer; +begin + Result := nil; + for i := 0 to GroupCount - 1 do + if Groups[i].Group = AGroup then + begin + Result := Groups[i]; + break; + end; +end; + +function TdxSideBarViewInfo.GetItemViewInfoByItem(AItem: TdxSideBarItem): TdxSideItemViewInfo; +var + i: Integer; +begin + Result := nil; + for i := 0 to ItemCount - 1 do + if Items[i].Item = AItem then + begin + Result := Items[i]; + break; + end; +end; + +function TdxSideBarViewInfo.ActiveGroupViewInfo: TdxSideGroupViewInfo; +begin + Result := nil; + if (SideBar.ActiveGroup <> nil) then + Result := GetGroupViewInfoByGroup(SideBar.ActiveGroup); +end; + +function TdxSideBarViewInfo.GetGroupViewInfoAtPos(p: TPoint): TdxSideGroupViewInfo; +var + i: Integer; +begin + Result := nil; + for i := 0 to GroupCount - 1 do + if ptInRect(Groups[i].Rect, p) then + begin + Result := Groups[i]; + break; + end; +end; + +function TdxSideBarViewInfo.GetGroupAtPos(p: TPoint): TdxSideGroup; +begin + Result := GetViewInfoGroup(GetGroupViewInfoAtPos(p)); +end; + +function TdxSideBarViewInfo.GetItemViewInfoAtPos(p: TPoint): TdxSideItemViewInfo; +var + i: Integer; +begin + Result := nil; + for i := 0 to ItemCount - 1 do + if ptInRect(Items[i].FocusedCaptionRect, p) or ptInRect(Items[i].ItemRect, p) then + begin + Result := Items[i]; + break; + end; +end; + +function TdxSideBarViewInfo.GetItemAtPos(p: TPoint): TdxSideBarItem; +begin + Result := GetViewInfoItem(GetItemViewInfoAtPos(p)); +end; + +function TdxSideBarViewInfo.GetNearestItemViewInfoAtPost(p: TPoint; var APosition: TdxSideBarDragSourcePosition): TdxSideItemViewInfo; +var + I: Integer; +begin + Result := nil; + APosition := sbdspIn; + if not PtInRect(ItemsRect, p) then + exit; + if ItemCount > 0 then + APosition := sbdspBottom + else APosition := sbdspTop; + for i := 0 to ItemCount - 1 do + begin + Result := Items[i]; + if (p.Y <= Result.Bottom) then + begin + if p.Y < Result.Top then + APosition := sbdspTop + else APosition := sbdspIn; + break; + end; + end; +end; + +function TdxSideBarViewInfo.GetNearestItemAtPost(p: TPoint; var APosition: TdxSideBarDragSourcePosition): TdxSideBarItem; +begin + Result := GetViewInfoItem(GetNearestItemViewInfoAtPost(p, APosition)); +end; + +function TdxSideBarViewInfo.IsTopScrollButtonVisible: Boolean; +begin + Result := FTopScrollButtonRect.Left < FTopScrollButtonRect.Right; +end; + +function TdxSideBarViewInfo.IsBottomScrollButtonVisible: Boolean; +begin + Result := FBottomScrollButtonRect.Left < FBottomScrollButtonRect.Right; +end; + +function TdxSideBarViewInfo.IsPtTopScrollButton(pt: TPoint): Boolean; +begin + Result := PtInRect(FTopScrollButtonRect, pt); +end; + +function TdxSideBarViewInfo.IsPtBottomScrollButton(pt: TPoint): Boolean; +begin + Result := PtInRect(FBottomScrollButtonRect, pt); +end; + +function TdxSideBarViewInfo.CreateGroup(AGroup: TdxSideGroup; ARect: TRect): TdxSideGroupViewInfo; +begin + Result := TdxSideGroupViewInfo.Create(self, AGroup, ARect); +end; + +procedure TdxSideBarViewInfo.CreateGroups; +var + i: Integer; + APaintRect: TRect; + AGroupHeight: Integer; + ATop_Bottom: Integer; + AMaxGroupIndex: Integer; + ABottomHeight: Integer; +begin + if (not SideBar.ShowGroups or (SideBar.ActiveGroup = nil)) then exit; + + APaintRect := GetPaintRect; + AGroupHeight := GetGroupHeight; + + Painter.Canvas.Font := SideBar.GroupFont; + + ATop_Bottom := APaintRect.Top; + for i := 0 to SideBar.ActiveGroup.Index do + if (SideBar.Groups[i].Visible) then + begin + FGroups.Add(CreateGroup(SideBar.Groups[i], Rect(APaintRect.Left, ATop_Bottom, + APaintRect.Right, ATop_Bottom + AGroupHeight))); + Inc(ATop_Bottom, AGroupHeight + GetGroupOffSet); + end; + + Inc(ATop_Bottom, Sidebar.SpaceHeight + AGroupHeight + GetGroupOffSet); + ABottomHeight := 0; + for i := SideBar.ActiveGroup.Index + 1 to SideBar.GroupCount - 1 do + begin + if(ATop_Bottom > APaintRect.Bottom) then break; + if (SideBar.Groups[i].Visible) then + begin + Inc(ATop_Bottom, AGroupHeight + GetGroupOffSet); + Inc(ABottomHeight, AGroupHeight + GetGroupOffSet); + end; + end; + + AMaxGroupIndex := SideBar.GroupCount - 1; + ATop_Bottom := APaintRect.Bottom - ABottomHeight; + for i := SideBar.ActiveGroup.Index + 1 to AMaxGroupIndex do + if (SideBar.Groups[i].Visible) then + begin + FGroups.Add(CreateGroup(SideBar.Groups[i], Rect(APaintRect.Left, ATop_Bottom, + APaintRect.Right, ATop_Bottom + AGroupHeight))); + Inc(ATop_Bottom, AGroupHeight + GetGroupOffSet); + end; +end; + +procedure TdxSideBarViewInfo.ClearGroups; +var + i: Integer; +begin + for i := 0 to GroupCount - 1 do + Groups[i].Free; + FGroups.Clear; +end; + +procedure TdxSideBarViewInfo.CalcItemsRect; +var + AGroupViewInfo: TdxSideGroupViewInfo; +begin + FItemsRect := GetPaintRect; + InflateRect(FItemsRect, -1, -1); + AGroupViewInfo := ActiveGroupViewInfo; + if AGroupViewInfo <> nil then + begin + FItemsRect.Top := AGroupViewInfo.Rect.Bottom; + if AGroupViewInfo.Index + 1 < GroupCount then + begin + AGroupViewInfo := Groups[AGroupViewInfo.Index + 1]; + FItemsRect.Bottom := AGroupViewInfo.Rect.Top; + end; + end; +end; + +procedure TdxSideBarViewInfo.CalcScrollButtonsRect; +begin + SetRectEmpty(FTopScrollButtonRect); + SetRectEmpty(FBottomScrollButtonRect); + + if (ItemCount = 0) then + Exit; + + if Items[0].Item.Index > 0 then + begin + FTopScrollButtonRect := ItemsRect; + FTopScrollButtonRect.Left := FTopScrollButtonRect.Right - ScrollButtonHeight; + FTopScrollButtonRect.Bottom := FTopScrollButtonRect.Top + ScrollButtonHeight; + OffSetRect(FTopScrollButtonRect, - SideBar.SpaceHeight, SideBar.SpaceHeight); + end; + if (Items[ItemCount - 1].Item.Index + 1 < SideBar.ActiveGroup.ItemCount) + or (Items[ItemCount - 1].IsPartialVisible) then + begin + FBottomScrollButtonRect := ItemsRect; + FBottomScrollButtonRect.Left := FBottomScrollButtonRect.Right - ScrollButtonHeight; + FBottomScrollButtonRect.Top := FBottomScrollButtonRect.Bottom - ScrollButtonHeight; + OffSetRect(FBottomScrollButtonRect, - SideBar.SpaceHeight, - SideBar.SpaceHeight); + end; +end; + +function TdxSideBarViewInfo.CreateItemInfo(AItem: TdxSideBarItem; AImageRect, ACaptionRect: TRect): TdxSideItemViewInfo; +begin + Result := TdxSideItemViewInfo.Create(self, AItem, AImageRect, ACaptionRect); +end; + +function TdxSideBarViewInfo.CreateItem(AItem: TdxSideBarItem; ATop: Integer): TdxSideItemViewInfo; +var + ACaptionRect, AImageRect: TRect; +begin + AImageRect := GetItemImageRect(AItem, ATop); + ACaptionRect := GetItemCaptionRect(AItem, ATop, AImageRect); + Result := CreateItemInfo(AItem, AImageRect, ACaptionRect); +end; + +procedure TdxSideBarViewInfo.CreateItems; +var + ATop: Integer; + AItemViewInfo: TdxSideItemViewInfo; + i: Integer; +begin + if (SideBar.ActiveGroup = nil) then exit; + Painter.Canvas.Font.Assign(SideBar.ItemFont); + ATop := ItemsRect.Top; + for i := SideBar.ActiveGroup.TopVisibleItem to SideBar.ActiveGroup.ItemCount - 1 do + begin + Inc(ATop, GetSideBarTopItemSpaceHeight); + if ATop >= ItemsRect.Bottom then + break; + AItemViewInfo := CreateItem(SideBar.ActiveGroup.Items[i], ATop); + ATop := AItemViewInfo.Bottom; + FItems.Add(AItemViewInfo); + end; +end; + +function TdxSideBarViewInfo.GetSideBarTopItemSpaceHeight: Integer; +begin + Result := SideBar.SpaceHeight; +end; + +procedure TdxSideBarViewInfo.ClearItems; +var + i: Integer; +begin + for i := 0 to ItemCount - 1 do + Items[i].Free; + FItems.Clear; +end; + +function TdxSideBarViewInfo.GetGroupHeight: Integer; +begin + Result := SideBar.GroupHeightOffSet * 2; + if (Result = 0) then + Result := 4; + Inc(Result, GetFontHeight(SideBar.GroupFont)); +end; + +function TdxSideBarViewInfo.GetPaintRect: TRect; +begin + Result := SideBar.ClientRect; +end; + +function TdxSideBarViewInfo.GetGroupOffSet: Integer; +begin + Result := 1; +end; + +function TdxSideBarViewInfo.GetBorderOffSet: Integer; +begin + Result := 1; +end; + +function TdxSideBarViewInfo.GetItemViewInfo(AItem: TdxSideBarItem): TdxSideItemViewInfo; +var + I: Integer; +begin + Result := nil; + for I := 0 to ItemCount - 1 do + if Items[I].Item = AItem then + begin + Result := Items[I]; + break; + end; +end; + +function TdxSideBarViewInfo.GetItemImageRect(AItem: TdxSideBarItem; ATop: Integer): TRect; +begin + with GetPaintRect do + SetRect(Result, Left, SideBar.SpaceHeight, Right, Bottom); + if (SideBar.ActiveGroup.IconType = dxsgLargeIcon) then begin + Result.Bottom := Result.Top + GetLargeImageHeight; + Inc(Result.Left, (Result.Right - Result.Left - GetLargeImageWidth) div 2); + Result.Right := Result.Left + GetLargeImageWidth; + end + else + begin + Inc(Result.Left, SideBar.SpaceHeight); + Result.Right := Result.Left + GetSmallImageWidth; + if GetItemHeight > GetSmallImageHeight then + Inc(Result.Top, (GetItemHeight - GetSmallImageHeight) div 2); + Result.Bottom := Result.Top + GetSmallImageHeight + end; + OffSetRect(Result, 0, ATop); +end; + +function TdxSideBarViewInfo.GetItemCorrectedCaptionRect(ACaption: String; ARect: TRect): TRect; +var + AHeight: Integer; +begin + Result := ARect; + AHeight := cxDrawText(Painter.DC, ACaption, Result, GetDrawEdgeFlag or DT_CALCRECT); + if (SideBar.ActiveGroup.IconType = dxsgLargeIcon) then + begin + OffSetRect(Result, ((ItemsRect.Right - ItemsRect.Left) - (Result.Right - Result.Left)) div 2, 0); + Result.Bottom := Result.Top + AHeight; + end else + begin + if Result.Right > ItemsRect.Right - SideBar.SpaceHeight then + Result.Right := ItemsRect.Right - SideBar.SpaceHeight; + end; +end; + +function TdxSideBarViewInfo.GetItemCaptionRect(AItem: TdxSideBarItem; ATop: Integer; AImageRect: TRect): TRect; +begin + if (SideBar.ActiveGroup.IconType = dxsgLargeIcon) then + begin + Result := ItemsRect; + Result.Top := AImageRect.Bottom + SideBar.SpaceHeight; + end + else + begin + Result.Top := ATop + SideBar.SpaceHeight; + if (GetItemHeight < GetSmallImageHeight) then + Inc(Result.Top, (GetSmallImageHeight - GetItemHeight) div 2); + Result.Bottom := Result.Top + GetItemHeight; + Result.Left := AImageRect.Right + SideBar.SpaceHeight; + Result.Right := SideBar.ClientWidth - Result.Top - SideBar.SpaceHeight; + end; + Result := GetItemCorrectedCaptionRect(AItem.Caption, Result); +end; + +function TdxSideBarViewInfo.GetItemEditRect(AItem: TdxSideBarItem; ACaption: String): TRect; +var + AItemViewInfo: TdxSideItemViewInfo; +begin + AItemViewInfo := GetItemViewInfoByItem(AItem); + if AItemViewInfo = nil then + begin + SetRectEmpty(Result); + exit; + end; + if (SideBar.ActiveGroup.IconType = dxsgLargeIcon) then + begin + Result := ItemsRect; + Result.Top := AItemViewInfo.ImageRect.Bottom + SideBar.SpaceHeight; + end + else + begin + Result := AItemViewInfo.CaptionRect; + Result.Right := ItemsRect.Right; + end; + if SideBar.Canvas.TextWidth(AItem.Caption) > SideBar.Canvas.TextWidth(ACaption) then + ACaption := AItem.Caption; + Result := GetItemCorrectedCaptionRect(ACaption, Result); +end; + +function TdxSideBarViewInfo.GetDrawEdgeFlag: Integer; +begin + if (SideBar.ActiveGroup.IconType = dxsgLargeIcon) then + Result := DT_CENTER or DT_WORDBREAK or DT_EDITCONTROL + else Result := DT_LEFT or DT_VCENTER or DT_SINGLELINE; + Result := Result or DT_NOPREFIX; +end; + +function TdxSideBarViewInfo.GetItemHeight: Integer; +begin + Result := GetFontHeight(SideBar.ItemFont) + 2; + if (GetSmallImageHeight > Result) then + Result := GetSmallImageHeight; +end; + +function TdxSideBarViewInfo.GetLargeImageHeight: Integer; +begin + if (SideBar.GetLargeImages <> nil) then + Result := SideBar.GetLargeImages.Height + else Result := dxSideBarDefaultLargeImageHeight; +end; + +function TdxSideBarViewInfo.GetLargeImageWidth: Integer; +begin + if (SideBar.GetLargeImages <> nil) then + Result := SideBar.GetLargeImages.Width + else Result := dxSideBarDefaultLargeImageWidth; +end; + +function TdxSideBarViewInfo.GetSmallImageHeight: Integer; +begin + if (SideBar.GetSmallImages <> nil) then + Result := SideBar.GetSmallImages.Height + else Result := dxSideBarDefaultSmallImageHeight; +end; + +function TdxSideBarViewInfo.GetSmallImageWidth: Integer; +begin + if (SideBar.GetSmallImages <> nil) then + Result := SideBar.GetSmallImages.Width + else Result := dxSideBarDefaultSmallImageWidth; +end; + +{TdxSideBarPainter} +constructor TdxSideBarPainter.Create(ASideBar: TdxSideBar); +begin + inherited Create; + FSideBar := ASideBar; + FViewInfo := CreateViewInfo; +end; + +destructor TdxSideBarPainter.Destroy; +begin + FViewInfo.Free; + inherited Destroy; +end; + +function TdxSideBarPainter.IsGroupFocused: Boolean; +begin + Result := False; +end; + +procedure TdxSideBarPainter.Paint; +begin + if (SideBar.ActiveGroup <> nil) and (SideBar.FOldActiveGroup <> nil) + and (SideBar.ActiveGroup <> SideBar.FOldActiveGroup) + and (ViewInfo.GroupCount > 0) then + ScrollGroups; + SideBar.FOldActiveGroup := nil; + + if not ViewInfo.IsReady then + ViewInfo.CalcViewInfo; + + DrawGroups; + DrawBorder; + DrawScrollButtons; + DrawItems; + DrawFillRect(SideBar.ClientRect); + DrawDragDestinationArrow; +end; + +procedure TdxSideBarPainter.InvalidateGroup(AGroup: TdxSideGroup); +var + AGroupViewInfo: TdxSideGroupViewInfo; +begin + AGroupViewInfo := ViewInfo.GetGroupViewInfoByGroup(AGroup); + if (AGroupViewInfo <> nil) then + cxInvalidateRect(SideBar.Handle, AGroupViewInfo.Rect, True); +end; + +procedure TdxSideBarPainter.InvalidateItem(AItem: TdxSideBarItem); +var + Rgn1, Rgn2: HRGN; + AItemViewInfo: TdxSideItemViewInfo; +begin + AItemViewInfo := ViewInfo.GetItemViewInfoByItem(AItem); + if (AItemViewInfo = nil) then exit; + with AItemViewInfo.ImageRect do + Rgn1 := CreateRectRgn(Left - 1, Top - 1, Right + 1, Bottom + 1); + with AItemViewInfo.CaptionRect do + Rgn2 := CreateRectRgn(Left, Top, Right, Bottom); + CombineRgn(Rgn1, Rgn1, Rgn2, RGN_OR); + DeleteObject(Rgn2); + with ViewInfo.ItemsRect do + Rgn2 := CreateRectRgn(Left, Top, Right, Bottom); + CombineRgn(Rgn1, Rgn1, Rgn2, RGN_AND); + DeleteObject(Rgn2); + Windows.InvalidateRgn(SideBar.Handle, Rgn1, True); + DeleteObject(Rgn1); +end; + +procedure TdxSideBarPainter.InvalidateItemImage(AItem: TdxSideBarItem); +var + ARect: TRect; + AItemViewInfo: TdxSideItemViewInfo; +begin + AItemViewInfo := ViewInfo.GetItemViewInfoByItem(AItem); + if (AItemViewInfo <> nil) then + begin + ARect := AItemViewInfo.ImageRect; + if ARect.Bottom > ViewInfo.ItemsRect.Bottom then + ARect.Bottom := ViewInfo.ItemsRect.Bottom; + cxInvalidateRect(SideBar.Handle, ARect, True); + end; +end; + +procedure TdxSideBarPainter.InvalidateItemBorder(AItem: TdxSideBarItem); +var + AItemViewInfo: TdxSideItemViewInfo; + Rgn1, Rgn2: HRGN; +begin + AItemViewInfo := ViewInfo.GetItemViewInfoByItem(AItem); + if AItemViewInfo <> nil then + begin + with AItemViewInfo.ItemRect do + Rgn1 := CreateRectRgn(Left - 1, Top - 1, Right + 1, Bottom + 1); + with AItemViewInfo.ImageRect do + Rgn2 := CreateRectRgn(Left, Top, Right, Bottom); + CombineRgn(Rgn1, Rgn1, Rgn2, RGN_XOR); + DeleteObject(Rgn2); + with ViewInfo.ItemsRect do + Rgn2 := CreateRectRgn(Left, Top, Right, Bottom); + CombineRgn(Rgn1, Rgn1, Rgn2, RGN_AND); + DeleteObject(Rgn2); + Windows.InvalidateRgn(SideBar.Handle, Rgn1, True); + DeleteObject(Rgn1); + end; +end; + +procedure TdxSideBarPainter.InvalidateItems; +var + Rgn1, Rgn2: HRGN; + i: Integer; +begin + with ViewInfo.GetPaintRect do + Rgn1 := CreateRectRgn(Left, Top, Right, Bottom); + for i := 0 to ViewInfo.GroupCount - 1 do + begin + with ViewInfo.Groups[i].Rect do + Rgn2 := CreateRectRgn(Left, Top, Right, Bottom); + CombineRgn(Rgn1, Rgn1, Rgn2, RGN_XOR); + DeleteObject(Rgn2); + end; + Windows.InvalidateRgn(SideBar.Handle, Rgn1, True); + DeleteObject(Rgn1); +end; + +procedure TdxSideBarPainter.InvalidateScrollButtons; +var + Rgn1, Rgn2: HRGN; +begin + if not ViewInfo.IsTopScrollButtonVisible and not ViewInfo.IsTopScrollButtonVisible then + exit; + with ViewInfo.TopScrollButtonRect do + Rgn1 := CreateRectRgn(Left, Top, Right, Bottom); + with ViewInfo.BottomScrollButtonRect do + Rgn2 := CreateRectRgn(Left, Top, Right, Bottom); + CombineRgn(Rgn1, Rgn1, Rgn2, RGN_OR); + Windows.InvalidateRgn(SideBar.Handle, Rgn1, True); + DeleteObject(Rgn1); + DeleteObject(Rgn2); +end; + +function TdxSideBarPainter.CreateViewInfo: TdxSideBarViewInfo; +begin + Result := TdxSideBarViewInfo.Create(self); +end; + +function TdxSideBarPainter.Canvas: TCanvas; +begin + Result := SideBar.Canvas; +end; + +function TdxSideBarPainter.DC: HDC; +begin + Result := Canvas.Handle; +end; + +procedure TdxSideBarPainter.NeedRecalViewInfo; +begin + ViewInfo.Unready; +end; + +function TdxSideBarPainter.ClientHeight: Integer; +begin + Result := SideBar.ClientHeight; +end; + +function TdxSideBarPainter.ClientWidth: Integer; +begin + Result := SideBar.ClientWidth; +end; + +procedure TdxSideBarPainter.ExcludeClipRect(ARect: TRect); +begin + Windows.ExcludeClipRect(DC, ARect.Left, ARect.Top, ARect.Right, ARect.Bottom); +end; + +procedure TdxSideBarPainter.IntersectClipRect(ARect: TRect); +begin + Windows.IntersectClipRect(DC, ARect.Left, ARect.Top, ARect.Right, ARect.Bottom); +end; + +procedure TdxSideBarPainter.DrawBorder; +begin +end; + +procedure TdxSideBarPainter.ScrollGroups; + + function IsTopScrolling: Boolean; + begin + Result := SideBar.FOldActiveGroup.Index > SideBar.ActiveGroup.Index; + end; + +var + r, rs: TRect; + FStep, FdStep: Integer; + FirstTime, NextTime: Integer; + AIndex: Integer; +begin + if(SideBar.FOldActiveGroup = nil) then exit; + r := ViewInfo.ItemsRect; + r.Left := ViewInfo.GetPaintRect.Left; + r.Right := ViewInfo.GetPaintRect.Right; + if IsTopScrolling then + begin + AIndex := ViewInfo.GetGroupViewInfoByGroup(SideBar.ActiveGroup).Index; + r.Top := ViewInfo.GetGroup(AIndex).Rect.Bottom; + if(AIndex + 1 < ViewInfo.GroupCount) then + r.Bottom := ViewInfo.GetGroup(AIndex + 1).Rect.Top; + FdStep := 1; + end + else + begin + AIndex := ViewInfo.GetGroupViewInfoByGroup(SideBar.ActiveGroup).Index; + r.Top := ViewInfo.GetGroup(AIndex).Rect.Bottom; + if(AIndex + 1 < ViewInfo.GroupCount) then + r.Bottom := ViewInfo.GetGroup(AIndex + 1).Rect.Top; + FdStep := -1; + end; + + FirstTime := GetTickCount; + FStep := dxSideBarGroupScrollStep; + while (r.Bottom - r.Top > ViewInfo.GetGroupHeight) do + begin + ScrollWindowEx(SideBar.Handle, 0, FStep * FdStep, @r, @r, 0, nil, 0); + if IsTopScrolling then + begin + rs := r; + rs.Bottom := rs.Top + FStep; + Inc(r.Top, FStep); + end + else + begin + rs := r; + rs.Top := rs.Bottom - FStep; + Dec(r.Bottom, FStep); + end; + DrawFillRect(rs); + + NextTime := GetTickCount; + + if (NextTime - FirstTime) > dxSideBarGroupScrollTimeToIncrement then + begin + FirstTime := NextTime; + Inc(FStep, dxSideBarGroupScrollIncrement); + end; + end; + SideBar.FOldActiveGroup := nil; +end; + +procedure TdxSideBarPainter.DoDrawItemBorder(AItemViewInfo: TdxSideItemViewInfo; const ARect: TRect); +var + ABorderRect: TRect; +begin + if AItemViewInfo.Item.Enabled then + begin + ABorderRect := ARect; + if AItemViewInfo.Item.IsSelected or SideBar.MouseFocusedItemIsDown then + DrawEdge(DC, ABorderRect, BDR_SUNKENINNER, BF_RECT) + else + DrawEdge(DC, ABorderRect, BDR_RAISEDOUTER, BF_RECT); +// if (AItemViewInfo.ItemRect.Left < AItemViewInfo.BorderRect.Left) +// or (AItemViewInfo.ItemRect.Top < AItemViewInfo.BorderRect.Top) then + begin + with ABorderRect do + begin + ExcludeClipRect(Rect(Left, Top, Left + 1, Bottom)); //[ + ExcludeClipRect(Rect(Right - 1, Top, Right, Bottom)); //] + ExcludeClipRect(Rect(Left, Top, Right, Top + 1)); //- + ExcludeClipRect(Rect(Left, Bottom - 1, Right, Bottom)); //_ + end; + end; + end; +end; + +procedure TdxSideBarPainter.DrawFillRect(ARect: TRect); +begin + if (SideBar.BkPicture.Graphic = nil) or (SideBar.BkPicture.Graphic.Empty) then begin + if (SideBar.BkGround.IsUsed) then + DrawDifColorsOnCanvas(Canvas, SideBar.BkGround.BeginColor, SideBar.BkGround.EndColor, + SideBar.BkGround.Step, (SideBar.BkGround.FillStyle = bfsHorz), ARect, ClientWidth, ClientHeight) + else + begin + Canvas.Brush.Color := SideBar.Color; + Canvas.FillRect(ARect); + end; + end else DrawBmpOnCanvas(Canvas, SideBar.BkPicture, ARect, ClientWidth, ClientHeight); +end; + +procedure TdxSideBarPainter.DrawGroups; +var + i: Integer; +begin + for i := 0 to ViewInfo.GroupCount - 1 do + DrawGroup(ViewInfo.Groups[i]); +end; + +procedure TdxSideBarPainter.DrawItems; +var + i: Integer; +begin + for i := 0 to ViewInfo.ItemCount - 1 do + DrawItem(ViewInfo.Items[i]); +end; + +procedure TdxSideBarPainter.DrawGroup(AGroupViewInfo: TdxSideGroupViewInfo); +begin +end; + +procedure TdxSideBarPainter.DrawItem(AItemViewInfo: TdxSideItemViewInfo); +begin + DrawItemImage(AItemViewInfo); + DrawItemCaption(AItemViewInfo); + DrawItemBorder(AItemViewInfo); +end; + +{$IFDEF DELPHI4} +const + DT_END_ELLIPSIS = $8000; +{$ENDIF} + +procedure TdxSideBarPainter.DrawItemCaption(AItemViewInfo: TdxSideItemViewInfo); +var + Flag: Integer; + OldColor: TColor; + ARect: TRect; +begin + if (SideBar.ActiveGroup.IconType = dxsgLargeIcon) then + Flag := ViewInfo.GetDrawEdgeFlag + else Flag := ViewInfo.GetDrawEdgeFlag or DT_END_ELLIPSIS; + + Canvas.Brush.Style := bsClear; + Canvas.Font := SideBar.ItemFont; + ARect := AItemViewInfo.CaptionRect; + + DrawFillRect(ARect); + + if PtInRect(ViewInfo.ItemsRect, ARect.TopLeft) then + begin + if AItemViewInfo.Item.Enabled then + cxDrawText(DC, AItemViewInfo.Caption, ARect, Flag) + else + begin + OldColor := Canvas.Font.Color; + Canvas.Font.Color := clbtnHighLight; + Canvas.Brush.Style := bsClear; + OffsetRect(ARect, 1, 1); + cxDrawText(DC, AItemViewInfo.Caption, ARect, Flag); + Canvas.Font.Color := clbtnShadow; + OffsetRect(ARect, -1, -1); + cxDrawText(DC, AItemViewInfo.Caption, ARect, Flag); + Canvas.Font.Color := OldColor; + end; + end; + ExcludeClipRect(AItemViewInfo.CaptionRect); +end; + +procedure TdxSideBarPainter.DrawImageBackground(AItemViewInfo: TdxSideItemViewInfo; ARect: TRect); +begin + DrawFillRect(ARect); +end; + +procedure TdxSideBarPainter.DrawItemImage(AItemViewInfo: TdxSideItemViewInfo); +var + ARect: TRect; +begin + ARect := AItemViewInfo.ImageRect; + DrawImageBackground(AItemViewInfo, ARect); + if IsImageAssigned(AItemViewInfo.ImageList, AItemViewInfo.ImageIndex) then + begin + AItemViewInfo.ImageList.Draw(Canvas, AItemViewInfo.ImageRect.Left, AItemViewInfo.ImageRect.Top, AItemViewInfo.ImageIndex, AItemViewInfo.Item.Enabled); + if ARect.Bottom > ViewInfo.ItemsRect.Bottom then + ARect.Bottom := ViewInfo.ItemsRect.Bottom; + ExcludeClipRect(ARect); + end; +end; + +procedure TdxSideBarPainter.DrawItemBorder(AItemViewInfo: TdxSideItemViewInfo); +begin + if IsImageAssigned(AItemViewInfo.ImageList, AItemViewInfo.ImageIndex) and + (AItemViewInfo.Item.IsFocused or AItemViewInfo.Item.IsSelected) then + DoDrawItemBorder(AItemViewInfo, AItemViewInfo.BorderRect); +end; + +procedure TdxSideBarPainter.DrawScrollButtons; +Const + ConstPushed: Array[False..True] of Integer = + (0, DFCS_PUSHED); +begin + if ViewInfo.IsTopScrollButtonVisible then + begin + DrawFrameControl(Canvas.Handle, ViewInfo.TopScrollButtonRect, DFC_SCROLL, + DFCS_SCROLLUP or ConstPushed[(dxSideBarDragObject = nil) and SideBar.FScrollButtonUpIsDown]); + ExcludeClipRect(ViewInfo.TopScrollButtonRect); + end; + if ViewInfo.IsBottomScrollButtonVisible then + begin + DrawFrameControl(Canvas.Handle, ViewInfo.BottomScrollButtonRect, DFC_SCROLL, + DFCS_SCROLLDOWN or ConstPushed[(dxSideBarDragObject = nil) and SideBar.FScrollButtonDownIsDown]); + ExcludeClipRect(ViewInfo.BottomScrollButtonRect); + end; +end; + +procedure TdxSideBarPainter.DrawDragDestinationArrow; +var + p1, p2, p3: TPoint; + r: TRect; + OldColor: TColor; + fdY: Integer; + + function HasTopTriangle: Boolean; + begin + Result := (SideBar.DropItemPosition <> sbdspTop) or ((SideBar.DestDropItemViewInfo <> nil) + and (SideBar.DestDropItemViewInfo.Index > 0)); + end; + + function HasBottomTriangle: Boolean; + begin + Result := (SideBar.DropItemPosition <> sbdspBottom) or ((SideBar.DestDropItemViewInfo <> nil) + and (SideBar.DestDropItemViewInfo.Index + 1 < ViewInfo.ItemCount)); + end; + +begin + if SideBar.DropItemPosition = sbdspIn then + Exit; + if SideBar.DestDropItemViewInfo <> nil then + r := SideBar.DestDropItemViewInfo.GetItemDragSourceSpace(SideBar.DropItemPosition) + else + begin + r := ViewInfo.ItemsRect; + r.Bottom := r.Top + dxSideBarDragArrowHeight - 1; + end; + InflateRect(r, - SideBar.SpaceHeight, 0); + + OldColor := Canvas.Brush.Color; + Canvas.Brush.Color := clBlack; + + Canvas.MoveTo(r.Left + dxSideBarDragArrowHeight, r.Top + dxSideBarDragArrowHeight div 2); + Canvas.LineTo(r.Right - dxSideBarDragArrowHeight, r.Top + dxSideBarDragArrowHeight div 2); + + p3.Y := r.Top + dxSideBarDragArrowHeight div 2; + fdY := 0; + if HasTopTriangle then + p1.Y := r.Top + else + begin + p1.Y := p3.Y; + fdY := 1; + end; + if HasBottomTriangle then + p2.Y := r.Bottom + else + begin + p2.Y := p3.Y; + fdY := -1; + end; + + p3.X := r.Left + dxSideBarDragArrowHeight - 1; + p1.X := r.Left; + p2.X := r.Left; + + Canvas.Polyline([p1, p2, p3, p1]); + Canvas.FloodFill(p3.X - dxSideBarDragArrowHeight div 2, p3.Y + fdy, clBlack, fsBorder); + + p3.X := r.Right - dxSideBarDragArrowHeight + 1; + p1.X := r.Right; + p2.X := r.Right; + Canvas.Polyline([p1, p2, p3, p1]); + Canvas.FloodFill(p3.X + dxSideBarDragArrowHeight div 2, p3.Y+ fdy, clBlack, fsBorder); + Canvas.Brush.Color := OldColor; +end; + +{TdxSideBarStandardPainter} +type +TdxSideBarStandardViewInfo = class(TdxSideBarViewInfo) +protected + function GetPaintRect: TRect; override; +end; + +TdxSideBarStandardPainter = class(TdxSideBarPainter) +protected + function CreateViewInfo: TdxSideBarViewInfo; override; +public + procedure DrawGroup(AGroupViewInfo: TdxSideGroupViewInfo); override; +end; + +TdxSideBarFlatViewInfo = class(TdxSideBarViewInfo) +protected + function GetGroupHeight: Integer; override; + function GetPaintRect: TRect; override; +end; + +TdxSideBarFlatPainter = class(TdxSideBarPainter) +protected + function CreateViewInfo: TdxSideBarViewInfo; override; +public + procedure DrawBorder; override; + procedure DrawGroup(AGroupViewInfo: TdxSideGroupViewInfo); override; + function IsGroupFocused: Boolean; override; +end; + +TdxSideItemW2KViewInfo = class(TdxSideItemViewInfo) +protected + function GetBorderRect: TRect; override; +end; + +TdxSideBarW2KViewInfo = class(TdxSideBarFlatViewInfo) +protected + function GetSideBarTopItemSpaceHeight: Integer; override; +public + function CreateItemInfo(AItem: TdxSideBarItem; AImageRect, ACaptionRect: TRect): TdxSideItemViewInfo; override; +end; + +TdxSideBarW2KPainter = class(TdxSideBarFlatPainter) +protected + function CreateViewInfo: TdxSideBarViewInfo; override; +end; + +TdxSideBarXPViewInfo = class(TdxSideBarViewInfo) +protected + function GetGroupHeight: Integer; override; + function GetPaintRect: TRect; override; + function GetGroupOffSet: Integer; override; + function GetBorderOffSet: Integer; override; +end; + +TdxSideBarXPPainter = class(TdxSideBarPainter) +protected + function CreateViewInfo: TdxSideBarViewInfo; override; + procedure DoDrawItemBorder(AItemViewInfo: TdxSideItemViewInfo; const ARect: TRect); override; +public + procedure DrawBorder; override; + procedure DrawGroup(AGroupViewInfo: TdxSideGroupViewInfo); override; + procedure DrawImageBackground(AItemViewInfo: TdxSideItemViewInfo; ARect: TRect); override; + procedure InvalidateItemBorder(AItem: TdxSideBarItem); override; + function IsGroupFocused: Boolean; override; +end; + +{TdxSideBarStandardPainter} +function TdxSideBarStandardViewInfo.GetPaintRect: TRect; +var + dxy: Integer; +begin + Result := SideBar.ClientRect; + if SideBar.ShowGroups then + begin + dxy := SideBar.BevelWidth; + if (SideBar.BorderStyle = bsSingle) then + Inc(dxy, SideBar.BorderWidth); + InflateRect(Result, - dxy, - dxy); + Inc(Result.Top, 1); + Inc(Result.Bottom, 1); + end; +end; + +function TdxSideBarStandardPainter.CreateViewInfo: TdxSideBarViewInfo; +begin + Result := TdxSideBarStandardViewInfo.Create(self); +end; + +procedure TdxSideBarStandardPainter.DrawGroup(AGroupViewInfo: TdxSideGroupViewInfo); +var + r: TRect; + DrawCaption: string; +begin + Canvas.Font := SideBar.GroupFont; + Canvas.Brush.Color := clBtnFace; + r := DrawButtonFace(Canvas, AGroupViewInfo.Rect, 1, bsNew, True, False, False); + DrawCaption := GetClippedString(DC, AGroupViewInfo.Caption, r); + cxDrawText(DC, DrawCaption, r, DT_CENTER or DT_VCENTER + or DT_SINGLELINE or DT_END_ELLIPSIS or DT_NOPREFIX); + ExcludeClipRect(AGroupViewInfo.Rect); +end; + +{TdxSideBarFlatPainter} +function TdxSideBarFlatViewInfo.GetGroupHeight: Integer; +begin + Result := SideBar.GroupHeightOffSet * 2; + if (Result = 0) then + Result := 8; + Inc(Result, GetFontHeight(SideBar.GroupFont)); +end; + +function TdxSideBarFlatViewInfo.GetPaintRect: TRect; +begin + if SideBar.ShowGroups then + SetRect(Result, 1, 1, SideBar.ClientWidth - 1, SideBar.ClientHeight) + else SetRect(Result, 1, 0, SideBar.ClientWidth - 1, SideBar.ClientHeight); +end; + +function TdxSideBarFlatPainter.CreateViewInfo: TdxSideBarViewInfo; +begin + Result := TdxSideBarFlatViewInfo.Create(self); +end; + +procedure TdxSideBarFlatPainter.DrawBorder; +var + r: TRect; +begin + SetRect(r, 0, 0, ClientWidth, ClientHeight); + DrawEdge(DC, r, BDR_SUNKENOUTER, BF_RECT); + InflateRect(r, -1, -1); + IntersectClipRect(r); +end; + +procedure TdxSideBarFlatPainter.DrawGroup(AGroupViewInfo: TdxSideGroupViewInfo); +var + r, r1: TRect; +begin + Canvas.Brush.Color := clBtnFace; + Canvas.Font := SideBar.GroupFont; + r := AGroupViewInfo.Rect; + + InflateRect(r, -1, -1); + r1 := r; + cxDrawText(DC, AGroupViewInfo.Caption, r1, + DT_CENTER or DT_VCENTER or DT_SINGLELINE or DT_END_ELLIPSIS or DT_NOPREFIX); + cxDrawText(DC, AGroupViewInfo.Caption, r1, + DT_CENTER or DT_VCENTER or DT_CALCRECT or DT_END_ELLIPSIS or DT_NOPREFIX); + if (r1.Right > r.Right) then + begin + r1.Left := r.Left; + r1.Right := r.Right; + end; + + OffSetRect(r1, ((r.Right - r.Left) - (r1.Right - r1.Left)) div 2, + ((r.Bottom - r.Top) - (r1.Bottom - r1.Top)) div 2); + ExcludeClipRect(r1); + Canvas.FillRect(r); + + InflateRect(r, 1, 1); + if (SideBar.FMouseFocusedGroup = AGroupViewInfo.Group) then + begin + if not SideBar.FMouseFocusedGroupIsDown then + begin + DrawEdge(DC, r, BDR_RAISEDINNER, BF_TOPLEFT); + DrawEdge(DC, r, BDR_RAISEDOUTER, BF_BOTTOMRIGHT); + InflateRect(r, -1, -1); + DrawEdge(DC, r, BDR_RAISEDINNER, BF_BOTTOMRIGHT); + Dec(r.Bottom); + Dec(r.Right); + end + else + begin + DrawEdge(DC, r, BDR_SUNKENINNER, BF_TOPLEFT); + DrawEdge(DC, r, BDR_SUNKENOUTER, BF_BOTTOMRIGHT); + InflateRect(r, -1, -1); + DrawEdge(DC, r, BDR_SUNKENOUTER, BF_TOPLEFT); + Inc(r.Top); + Inc(r.Left); + end; + end + else + begin + DrawEdge(DC, r, BDR_RAISEDINNER, BF_TOPLEFT); + DrawEdge(DC, r, BDR_RAISEDINNER, BF_BOTTOMRIGHT); + end; + r := AGroupViewInfo.Rect; + if AGroupViewInfo.Group.Active then + begin + Inc(r.Bottom); + DrawEdge(DC, r, BDR_RAISEDOUTER, BF_BOTTOM); + end; + ExcludeClipRect(r); +end; + +function TdxSideBarFlatPainter.IsGroupFocused: Boolean; +begin + Result := True; +end; + +{TdxSideItemW2KViewInfo} + +function TdxSideItemW2KViewInfo.GetBorderRect: TRect; +begin + Result := inherited GetBorderRect; + Result.Left := ViewInfo.ItemsRect.Left; + Result.Right := ViewInfo.ItemsRect.Right; + if Result.Bottom < CaptionRect.Bottom then + Result.Bottom := CaptionRect.Bottom; + Dec(Result.Top, Painter.SideBar.SpaceHeight); + Inc(Result.Bottom, Painter.SideBar.SpaceHeight - 1); +end; + +{TdxSideBarW2KViewInfo} +function TdxSideBarW2KViewInfo.GetSideBarTopItemSpaceHeight: Integer; +begin + Result := 2; +end; + +function TdxSideBarW2KViewInfo.CreateItemInfo(AItem: TdxSideBarItem; AImageRect, ACaptionRect: TRect): TdxSideItemViewInfo; +begin + Result := TdxSideItemW2KViewInfo.Create(self, AItem, AImageRect, ACaptionRect); +end; + +{TdxSideBarW2KPainter} +function TdxSideBarW2KPainter.CreateViewInfo: TdxSideBarViewInfo; +begin + Result := TdxSideBarW2KViewInfo.Create(self); +end; + +{TdxSideBarXPViewInfo} +function TdxSideBarXPViewInfo.GetGroupHeight: Integer; +begin + Result := SideBar.GroupHeightOffSet * 2; + if (Result = 0) then + Result := 8; + Inc(Result, GetFontHeight(SideBar.GroupFont)); +end; + +function TdxSideBarXPViewInfo.GetPaintRect: TRect; +begin + if SideBar.ShowGroups then + SetRect(Result, 1, 1, SideBar.ClientWidth - 1, SideBar.ClientHeight - 1) + else SetRect(Result, 1, 0, SideBar.ClientWidth - 1, SideBar.ClientHeight); +end; + +function TdxSideBarXPViewInfo.GetGroupOffSet: Integer; +begin + Result := 0; +end; + +function TdxSideBarXPViewInfo.GetBorderOffSet: Integer; +begin + Result := 5; +end; + +{TdxSideBarXPPainter} +function TdxSideBarXPPainter.CreateViewInfo: TdxSideBarViewInfo; +begin + Result := TdxSideBarXPViewInfo.Create(Self); +end; + +procedure TdxSideBarXPPainter.DoDrawItemBorder(AItemViewInfo: TdxSideItemViewInfo; const ARect: TRect); +var + OldColor: TColor; +begin + DrawImageBackground(AItemViewInfo, ARect); + OldColor := Canvas.Brush.Color; + Canvas.Brush.Color := clHighlight; + Canvas.FrameRect(ARect); + Canvas.Brush.Color := OldColor; + ExcludeClipRect(ARect); +end; + +procedure TdxSideBarXPPainter.InvalidateItemBorder(AItem: TdxSideBarItem); +var + AItemViewInfo: TdxSideItemViewInfo; +begin + AItemViewInfo := ViewInfo.GetItemViewInfoByItem(AItem); + if AItemViewInfo <> nil then + cxInvalidateRect(SideBar.Handle, AItemViewInfo.BorderRect, True); +end; + +procedure TdxSideBarXPPainter.DrawBorder; +var + r: TRect; +begin + SetRect(r, 0, 0, ClientWidth, ClientHeight); + DrawEdge(DC, r, BDR_SUNKENOUTER, BF_RECT); + InflateRect(r, -1, -1); + IntersectClipRect(r); +end; + +procedure TdxSideBarXPPainter.DrawGroup(AGroupViewInfo: TdxSideGroupViewInfo); +var + r, r1: TRect; +begin + Canvas.Brush.Color := clBtnFace; + Canvas.Font := SideBar.GroupFont; + r := AGroupViewInfo.Rect; + + InflateRect(r, -1, -1); + r1 := r; + cxDrawText(DC, AGroupViewInfo.Caption, r1, + DT_CENTER or DT_VCENTER or DT_SINGLELINE or DT_END_ELLIPSIS or DT_NOPREFIX); + cxDrawText(DC, AGroupViewInfo.Caption, r1, + DT_CENTER or DT_VCENTER or DT_CALCRECT or DT_END_ELLIPSIS or DT_NOPREFIX); + if (r1.Right > r.Right) then + begin + r1.Left := r.Left; + r1.Right := r.Right; + end; + + OffSetRect(r1, ((r.Right - r.Left) - (r1.Right - r1.Left)) div 2, + ((r.Bottom - r.Top) - (r1.Bottom - r1.Top)) div 2); + ExcludeClipRect(r1); + Canvas.FillRect(r); + + InflateRect(r, 1, 1); + if (SideBar.FMouseFocusedGroup = AGroupViewInfo.Group) then + begin + if not SideBar.FMouseFocusedGroupIsDown then + begin + DrawEdge(DC, r, BDR_RAISEDINNER, BF_TOPLEFT); + DrawEdge(DC, r, BDR_RAISEDOUTER, BF_BOTTOMRIGHT); + InflateRect(r, -1, -1); + DrawEdge(DC, r, BDR_RAISEDINNER, BF_BOTTOMRIGHT); + Dec(r.Bottom); + Dec(r.Right); + end + else + begin + DrawEdge(DC, r, BDR_SUNKENINNER, BF_TOPLEFT); + DrawEdge(DC, r, BDR_SUNKENOUTER, BF_BOTTOMRIGHT); + InflateRect(r, -1, -1); + DrawEdge(DC, r, BDR_SUNKENOUTER, BF_TOPLEFT); + Inc(r.Top); + Inc(r.Left); + end; + end + else + begin + DrawEdge(DC, r, BDR_RAISEDINNER, BF_TOPLEFT); + DrawEdge(DC, r, BDR_RAISEDINNER, BF_BOTTOMRIGHT); + end; + ExcludeClipRect(AGroupViewInfo.Rect); +end; + +procedure TdxSideBarXPPainter.DrawImageBackground(AItemViewInfo: TdxSideItemViewInfo; ARect: TRect); +var + brush: HBrush; +begin + if (AItemViewInfo.Item.IsSelected)or (AItemViewInfo.Item.IsFocused)then + begin + brush := CreateSolidBrush(TdxSideBar.XPSelectedItemColor); + Windows.FillRect(DC, ARect, brush); + DeleteObject(brush); + end + else + inherited; +end; + +function TdxSideBarXPPainter.IsGroupFocused: Boolean; +begin + Result := True; +end; + +{TdxSideBar} +constructor TdxSideBar.Create(AOwner: TComponent); + + function CreateTimer(AInterval: Integer; AOnTimer: TNotifyEvent): TTimer; + begin + Result := TTimer.Create(nil); + Result.Enabled := False; + Result.Interval := AInterval; + Result.OnTimer := AOnTimer; + end; + +begin + inherited Create(AOwner); + + PaintStyle := sbpsFlat; + + FScrollTimer := CreateTimer(300, DoScrollTimer); + FHintTimer := CreateTimer(dxSideBarHintShowDelay, DoHintTimer); + + ControlStyle := ControlStyle - [csSetCaption, csAcceptsControls]; + FGroups := TdxSideGroups.Create(Self); + FGroupFont := TFont.Create; + FGroupFont.OnChange := OnFontChange; + FItemFont := TFont.Create; + FImageList := TImageList.Create(Self); + FItemFont.Color := clWindow; + FItemFont.OnChange := OnFontChange; + FBkPicture := TPicture.Create; + FBkPicture.OnChange := DoBkPictureChange; + Color := clGrayText; + FBkGround := TdxSideBarBackGround.Create; + FBkGround.OnChange := DoBkPictureChange; + + FSpaceHeight := 7; + BevelInner := bvNone; + BevelOuter := bvNone; + + FLargeChangeLink := CreateChangeLink(OnChangeLink); + FSmallChangeLink := CreateChangeLink(OnChangeLink); + + Align := alLeft; + Height := 300; + Width := 150; + FDropItemPosition := sbdspIn; + + FShowGroups := True; +end; + +destructor TdxSideBar.Destroy; +begin + FreeAndNil(FScrollTimer); + FreeAndNil(FHintTimer); + + if StoreInRegistry and not (csDesigning in ComponentState) and (RegistryPath <> '') then + SaveToRegistry(RegistryPath); + + FDestroying := True; + FLargeChangeLink.Free; + FSmallChangeLink.Free; + + Store := nil; + FreeAndNil(FHintWindow); + FImageList.Free; + FGroupFont.Free; + FItemFont.Free; + FGroups.Free; + FBkPicture.Free; + FBkGround.Free; + + FreeAndNil(FPainter); + + inherited Destroy; +end; + +procedure TdxSideBar.Loaded; +begin + inherited Loaded; + {load from registry} + if StoreInregistry and not (csDesigning in ComponentState) and (RegistryPath <> '') then + LoadFromRegistry(RegistryPath); + if (ActiveGroup = nil) then + ActiveGroupIndex := 0; +end; + +procedure TdxSideBar.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); +begin + inherited SetBounds(ALeft, ATop, AWidth, AHeight); + Painter.NeedRecalViewInfo; +end; + +function GetRealColor(AColor: COLORREF): COLORREF; +var + DC: HDC; +begin + DC := GetDC(0); + Result := GetNearestColor(DC, AColor); + ReleaseDC(0, DC); +end; + +function GetLightColor(ABtnFaceColorPart, AHighlightColorPart, AWindowColorPart: Integer): COLORREF; +var + ABtnFaceColor, AHighlightColor, AWindowColor: COLORREF; + + function GetLightIndex(ABtnFaceValue, AHighlightValue, AWindowValue: Byte): Integer; + begin + Result := + MulDiv(ABtnFaceValue, ABtnFaceColorPart, 100) + + MulDiv(AHighlightValue, AHighlightColorPart, 100) + + MulDiv(AWindowValue, AWindowColorPart, 100); + if Result < 0 then Result := 0; + if Result > 255 then Result := 255; + end; + +begin + ABtnFaceColor := GetSysColor(COLOR_BTNFACE); + AHighlightColor := GetSysColor(COLOR_HIGHLIGHT); + AWindowColor := GetSysColor(COLOR_WINDOW); + if (ABtnFaceColor = 0) or (ABtnFaceColor = $FFFFFF) then + Result := AHighlightColor + else + Result := RGB( + GetLightIndex(GetRValue(ABtnFaceColor), GetRValue(AHighlightColor), GetRValue(AWindowColor)), + GetLightIndex(GetGValue(ABtnFaceColor), GetGValue(AHighlightColor), GetGValue(AWindowColor)), + GetLightIndex(GetBValue(ABtnFaceColor), GetBValue(AHighlightColor), GetBValue(AWindowColor))); +end; + +class function TdxSideBar.XPBackgroundColor: COLORREF; + + function GetLightValue(Value: Byte): Byte; + begin + Result := Value + MulDiv(255 - Value, 16, 100); + end; + +begin + Result := GetSysColor(COLOR_BTNFACE); + Result := RGB( + GetLightValue(GetRValue(Result)), + GetLightValue(GetGValue(Result)), + GetLightValue(GetBValue(Result))); + Result := GetRealColor(Result); +end; + +class function TdxSideBar.XPSelectedItemColor: COLORREF; +begin + Result := GetRealColor(GetLightColor(-2, 30, 72)); +end; + +procedure TdxSideBar.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) then begin + if (AComponent = FGroupPopupMenu) then FGroupPopupMenu := nil; + if (AComponent = FItemPopupMenu) then FItemPopupMenu := nil; + if (AComponent = FStore) then Store := nil; + if (AComponent = LargeImages) then LargeImages := nil; + if (AComponent = SmallImages) then SmallImages := nil; + end +end; + +procedure TdxSideBar.Assign(Source: TPersistent); +begin + if (Source is TdxSideBar) then begin + FAssignFlag := True; + FMouseFocusedGroup := nil; + Store := TdxSideBar(Source).Store; + SetGroups(TdxSideBar(Source).Groups); + SmallImages := TdxSideBar(Source).SmallImages; + LargeImages := TdxSideBar(Source).LargeImages; + FAssignFlag := False; + RepaintAll; + end; +end; + +function TdxSideBar.GetGroupCount: Integer; +begin + Result := FGroups.Count; +end; + +function TdxSideBar.GetHintWindow: THintWindow; +begin + if(FHintWindow = nil) then + FHintWindow := THintWindow.Create(nil); + Result := FHintWindow; +end; + +function TdxSideBar.GetPainter: TdxSideBarPainter; +begin + if FPainter = nil then + FPainter := CreatePainter; + Result := FPainter; +end; + +function TdxSideBar.GetScrollDelay: Integer; +begin + if FScrollTimer <> nil then + Result := FScrollTimer.Interval + else Result := 300; +end; + +function TdxSideBar.GetViewInfo: TdxSideBarViewInfo; +begin + Result := Painter.ViewInfo; +end; + +procedure TdxSideBar.SetActiveGroup(Value: TdxSideGroup); +var + I: Integer; +begin + if (Store <> nil) and not (csDesigning in Store.ComponentState) then + for I := 0 to Store.Count - 1 do + with Store.Items[I] do + if FActionLink <> nil then FActionLink.Update; + + if (Value <> nil) and not Value.Visible then + Value := nil; + + if (FActiveGroup <> Value) or ((FActiveGroup <> nil) and (not FActiveGroup.Visible)) + and not (csDestroying in ComponentState) then + begin + DoItemMouseFocused(nil, False); + + SetMouseFocusedItem(nil); + FMouseFocusedItemIsDown := False; + SetDestDropItemandPosition(nil, sbdspIn); + FOldActiveGroup := FActiveGroup; + if (Value = nil) and (VisibleGroupCount > 0) then + FActiveGroup := VisibleGroups[0] + else + FActiveGroup := Value; + if FActiveGroup <> nil then + begin + ActiveGroupIndex := GetVisibleIndexByGroup(FActiveGroup); + FActiveGroup.FTopVisibleItem := 0; + end + else + ActiveGroupIndex := -1; + CallNotify(FOnChangeActiveGroup, Self); + RepaintAll; + end; +end; + +procedure TdxSideBar.SetActiveGroupIndex(Value: Integer); +begin + if (FActiveGroupIndex <> Value) then + begin + if ((Value < 0) or (Value >= VisibleGroupCount)) and (VisibleGroupCount > 0) then + FActiveGroupIndex := 0 + else + FActiveGroupIndex := Value; + end; + if (VisibleGroupCount > 0) and (FActiveGroupIndex < VisibleGroupCount) then + ActiveGroup := VisibleGroups[FActiveGroupIndex]; +end; + +procedure TdxSideBar.SetBkGround(Value: TdxSideBarBackGround); +begin + FBkGround := Value; + RepaintAll; +end; + +procedure TdxSideBar.SetBkPicture(Value: TPicture); +begin + FBkPicture.Assign(Value); +end; + +procedure TdxSideBar.SetCanSelected(Value: Boolean); +begin + if (FCanSelected <> Value) then + begin + if (FSelectedItem <> nil) then + DoItemSelected(nil); + FCanSelected := Value; + end; +end; + +procedure TdxSideBar.SetGroupFont(Value: TFont); +begin + FGroupFont.Assign(Value); + RepaintAll; +end; + +procedure TdxSideBar.SetGroups(Value: TdxSideGroups); +begin + FGroups.Assign(Value); + ActiveGroupIndex := 0; + RepaintAll; +end; + +procedure TdxSideBar.SetGroupHeightOffSet(Value: Integer); +begin + if (FGroupHeightOffSet <> Value) and (Value > -1) and (Value < 10) then + begin + FGroupHeightOffSet := Value; + RepaintAll; + end; +end; + +procedure TdxSideBar.SetItemFont(Value: TFont); +begin + FItemFont.Assign(Value); + RepaintAll; +end; + +procedure TdxSideBar.SetImages(AValue: TCustomImageList; var AImageList: TCustomImageList; AChangeLink: TChangeLink); +begin + if (AImageList <> AValue) then begin + if (AImageList <> nil) and not (csDestroying in AImageList.ComponentState) then + AImageList.UnRegisterChanges(AChangeLink); + AImageList := AValue; + if (AImageList <> nil) then + begin + AImageList.RegisterChanges(AChangeLink); + AImageList.FreeNotification(Self); + end; + RepaintAll; + end; +end; + +procedure TdxSideBar.SetLargeImages(Value: TCustomImageList); +begin + SetImages(Value, FLargeImages, FLargeChangeLink); +end; + +procedure TdxSideBar.SetSmallImages(Value: TCustomImageList); +begin + SetImages(Value, FSmallImages, FSmallChangeLink); +end; + +procedure TdxSideBar.SetPaintStyle(Value: TdxsbPaintStyle); +begin + if (FPaintStyle <> Value) then + begin + FPaintStyle := Value; + FreeAndNil(FPainter); + if (BorderStyle <> bsNone) then + BorderStyle := bsNone + else if HandleAllocated then + RepaintAll; + end; +end; + +procedure TdxSideBar.SetStore(Value: TdxSideBarStore); +begin + if (FStore <> Value) then begin + if not (csLoading in ComponentState) then + FGroups.Clear; + FActiveGroup := nil; + FMouseFocusedGroup := nil; + if not (csDestroying in ComponentState) {and (csDesigning in ComponentState)} then + RepaintAll; + if (FStore <> nil) and not (csDestroying in FStore.ComponentState) then + FStore.FBars.Remove(Self); + FStore := Value; + if (FStore <> nil) then + FStore.FBars.Add(Self); + end; +end; + +procedure TdxSideBar.SetTransparentImages(Value: Boolean); +begin + if (FTransparentImages <> Value) then begin + FTransparentImages := Value; + RepaintAll; + end; +end; + +procedure TdxSideBar.SetScrollDelay(Value: Integer); +begin + if (Value > 0) and (FScrollTimer <> nil) then + FScrollTimer.Interval := Value; +end; + +procedure TdxSideBar.SetShowGroups(Value: Boolean); +begin + if (FShowGroups <> Value) then + begin + FShowGroups := Value; + RepaintAll; + end; +end; + +procedure TdxSideBar.SetSpaceHeight(Value: Integer); +begin + if (FSpaceHeight <> Value) and (Value > 4) then begin + FSpaceHeight := Value; + InvalidateItems(True); + end; +end; + +procedure TdxSideBar.OnChangeLink(Sender: TObject); +begin + RepaintAll; +end; + +procedure TdxSideBar.OnFontChange(Sender: TObject); +begin + RepaintAll; +end; + +procedure TdxSideBar.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + p: TPoint; + Group: TdxSideGroup; + Item: TdxSideBarItem; +begin + if (csDesigning in ComponentState) then + begin + inherited MouseDown(Button, Shift, X, Y); + Exit; + end; + if (Button = mbRight) then begin + PopupMenu := nil; + item := GetFocusedItem(X, Y); + if (item <> nil) then begin + if (item.StoredItem <> nil) and (item.StoredItem.PopupMenu <> nil) then + PopupMenu := item.StoredItem.PopupMenu + else PopupMenu := FItemPopupMenu; + end; + if (PopupMenu = nil) then + PopupMenu := FGroupPopupMenu; + end; + + inherited MouseDown(Button, Shift, X, Y); + if (Button = mbLeft) then begin + // IsRenameGroup or Is RenameItem ? + if (IsEditing) then begin + EndEdit(True); + Exit; + end; + p.X := X; + p.Y := Y; + Group := GetGroupAtPos(p); + if (Group <> nil) then + DoGroupMouseFocused(Group, True) + else begin + if ViewInfo.IsPtTopScrollButton(p) then + begin + FScrollButtonUpIsDown := True; + FScrollTimer.Enabled := True; + FActiveGroup.TopVisibleItem:= FActiveGroup.TopVisibleItem - 1; + end else + if ViewInfo.IsPtBottomScrollButton(p) then + begin + FScrollButtonDownIsDown := True; + FScrollTimer.Enabled := True; + FActiveGroup.TopVisibleItem:= FActiveGroup.TopVisibleItem + 1; + end + else + begin + item := GetFocusedItem(X, Y); + if (item <> nil) then begin + DoItemMouseFocused(Item, True); + FMouseDownItem := FMouseFocusedItem; + if (CanSelected) then + DoItemSelected(Item); + FEnableDraging := True; + FPointDragging.X := X; + FPointDragging.Y := Y; + end; + end; + end; + end; +end; + +procedure TdxSideBar.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + Item: TdxSideBarItem; + Group: TdxSideGroup; +begin + inherited MouseUp(Button, Shift, X, Y); + if (csDesigning in ComponentState) then Exit; + + if (GetCapture = Handle) then + ReleaseCapture; + if not (Button = mbLeft) or (IsGroupEditing) then Exit; + + if (FMouseFocusedGroup <> nil) then + begin + DoGroupMouseFocused(FMouseFocusedGroup, False); + if (GetGroupAtPos(Point(X, Y)) = FMouseFocusedGroup) then + ActiveGroup := FMouseFocusedGroup + else + begin + Group := FMouseFocusedGroup; + FMouseFocusedGroup := nil; + InvalidateGroup(Group); + end; + end; + if FScrollButtonDownIsDown or FScrollButtonUpIsDown then begin + FScrollButtonDownIsDown := False; + FScrollButtonUpIsDown := False; + InvalidateScrollButtons; + end else + if not Dragging and FEnableDraging then begin + FEnableDraging := False; + item := GetFocusedItem(X, Y); + if (item <> nil) and (FMouseDownItem = item) then + DoItemClick(item); + end; + FMouseDownItem := nil; +end; + +procedure TdxSideBar.MouseMove(Shift: TShiftState; X, Y: Integer); +var + Item, OldItem: TdxSideBarItem; + Group: TdxSideGroup; +begin + inherited MouseMove(Shift, X, Y); + + Group := GetGroupAtPos(Point(X, Y)); + if not (ssLeft in Shift) then + DoGroupMouseFocused(Group, False) + else + if (FMouseFocusedGroup <> Group) then + begin + FMouseFocusedGroupIsDown := False; + if (FMouseFocusedGroup <> nil) then + InvalidateGroup(FMouseFocusedGroup); + end else + if (FMouseFocusedGroup <> nil) then + DoGroupMouseFocused(FMouseFocusedGroup, True); + OldItem := FMouseFocusedItem; + Item := GetFocusedItem(X, Y); + if not FEnableDraging then + DoItemMouseFocused(Item, False); + + if not (csDesigning in ComponentState) and (DragMode = dmAutomatic) and FShowGroups then begin + if FEnableDraging and (((Item = nil) and (OldItem <> nil)) + or ((Item <> nil) and ((X < FPointDragging.X - 5) or (X > FPointDragging.X + 5) + or (Y < FPointDragging.Y - 5) or (Y > FPointDragging.Y + 5)))) then begin + if (FMouseFocusedItem = nil) then + FMouseFocusedItem := OldItem; + inherited DragMode := dmAutomatic; + FEnableDraging := False; + BeginDrag(True); + end + else inherited DragMode := dmManual; + end; +end; + +procedure TdxSideBar.WMEraseBkgnd(var Message: TWmEraseBkgnd); +begin + if (ActiveGroup = nil) then + inherited + else Message.Result := 1; +end; + +procedure TdxSideBar.WMSetCursor(var Message: TWMSetCursor); +begin + if (FMouseFocusedGroup <> nil) then + SetCursor(Screen.Cursors[dxSideBarGroupCursor]) + else + inherited; +end; + +procedure TdxSideBar.WMSize(var Message: TWMSize); +begin + inherited; + Painter.NeedRecalViewInfo; +end; + +procedure TdxSideBar.Paint; +begin + if FAssignFlag or IsMakingUpdate then + Exit; + + Painter.Paint; +end; + +procedure TdxSideBar.RepaintAll; +begin + if (csDestroying in ComponentState) or not HandleAllocated then + Exit; + + ViewInfo.CalcViewInfo; + Invalidate; +end; + +procedure TdxSideBar.InvalidateGroup(AGroup: TdxSideGroup); +begin + if HandleAllocated then + Painter.InvalidateGroup(AGroup); +end; + +procedure TdxSideBar.InvalidateItem(AItem: TdxSideBarItem); +begin + if HandleAllocated then + Painter.InvalidateItem(AItem); +end; + +procedure TdxSideBar.InvalidateItemImage(AItem: TdxSideBarItem); +begin + if HandleAllocated then + Painter.InvalidateItemImage(AItem); +end; + +procedure TdxSideBar.InvalidateItemBorder(AItem: TdxSideBarItem); +begin + if HandleAllocated then + Painter.InvalidateItemBorder(AItem); +end; + +procedure TdxSideBar.InvalidateItems(AUpdateCalcInfo: Boolean); +begin + if HandleAllocated then + begin + if AUpdateCalcInfo then + ViewInfo.CalcViewInfo; + Painter.InvalidateItems; + end; +end; + +procedure TdxSideBar.InvalidateScrollButtons; +begin + if HandleAllocated then + Painter.InvalidateScrollButtons; +end; + +procedure TdxSideBar.WndProc(var Message: TMessage); +begin + if (FHintWindowShowing) then + with Message do + if ((Msg >= WM_KEYFIRST) and (Msg <= WM_KEYLAST)) or + ((Msg = CM_ACTIVATE) or (Msg = CM_DEACTIVATE)) or + (Msg = CM_APPKEYDOWN) or (Msg = CM_APPSYSCOMMAND) or + (Msg = WM_COMMAND) or ((Msg > WM_MOUSEMOVE) and + (Msg <= WM_MOUSELAST)) or (Msg = WM_NCMOUSEMOVE) then + HintActivate(False); + inherited WndProc(Message); +end; + +function TdxSideBar.GetVisibleGroup(Index: Integer): TdxSideGroup; +var + i, AIndex: Integer; +begin + Result := nil; + AIndex := 0; + for i := 0 to Groups.Count - 1 do + if Groups[i].Visible then + begin + if (AIndex = Index) then + begin + Result := Groups[i]; + break; + end; + Inc(AIndex); + end; +end; + +function TdxSideBar.GetVisibleIndexByGroup(AGroup: TdxSideGroup): Integer; +var + i, VisibleIndex: Integer; +begin + Result := -1; + VisibleIndex := 0; + for i := 0 to Groups.Count - 1 do + if Groups[i].Visible then + begin + if (Groups[i] = AGroup) then + begin + Result := VisibleIndex; + break; + end; + Inc(VisibleIndex); + end; +end; + +procedure TdxSideBar.DoHintTimer(Sender: TObject); +begin + HintActivate(False); + FHintTimer.Enabled := False; +end; + +procedure TdxSideBar.DoScrollTimer(Sender: TObject); +begin + FScrollButtonUpIsDown := FScrollButtonUpIsDown and ViewInfo.IsTopScrollButtonVisible; + FScrollButtonDownIsDown := FScrollButtonDownIsDown and ViewInfo.IsBottomScrollButtonVisible; + + if FScrollButtonUpIsDown or FScrollButtonDownIsDown then begin + FDestDropItem := nil; + FDropItemPosition := sbdspIn; + if FScrollButtonUpIsDown then + ActiveGroup.TopVisibleItem:= ActiveGroup.TopVisibleItem - 1; + if FScrollButtonDownIsDown then + ActiveGroup.TopVisibleItem := ActiveGroup.TopVisibleItem + 1; + end else FScrollTimer.Enabled := False; +end; + +procedure TdxSideBar.HintActivate(AShow: Boolean); +var + r: TRect; + p: TPoint; + AHint: string; + AItemViewInfo: TdxSideItemViewInfo; +begin + FHintWindowShowing := False; + AShow := AShow and (FMouseFocusedItem <> nil) and (FMouseFocusedItem.Hint <> ''); + if IsWindowVisible(HintWindow.Handle) then + ShowWindow(HintWindow.Handle, SW_HIDE); + if AShow and not Dragging and Application.Active then + begin + AItemViewInfo := ViewInfo.GetItemViewInfoByItem(FMouseFocusedItem); + if AItemViewInfo <> nil then + begin + if (not AItemViewInfo.IsPartialVisible) then + r := AItemViewInfo.CaptionRect + else r := AItemViewInfo.ImageRect; + end; + p.Y := r.Bottom + 2; + p.X := 0; + p := ClientToScreen(p); + SetRect(r, 0, 0, Width - 2 * FSpaceHeight, 0); + AHint := GetShortHint(FMouseFocusedItem.Hint); + r := HintWindow.CalcHintRect(r.Right - r.Left, AHint, nil); + if (FMouseFocusedItem.Group.IconType = dxsgLargeIcon) then + Inc(p.X , (Width - r.Right + r.Left) div 2) + else Inc(p.X , FSpaceHeight); + OffsetRect(r, p.X, p.Y); + InflateRect(r, 1, 1); + FHintTimer.Enabled := False; + HintWindow.Color := Application.HintColor; + HintWindow.ActivateHint(r, AHint); + FHintWindowShowing := True; + FHintTimer.Enabled := True; + end + else + FHintTimer.Enabled := False; +end; + +function TdxSideBar.GetGroupAtPos(p: TPoint): TdxSideGroup; +begin + Result := ViewInfo.GetGroupAtPos(p); +end; + +function TdxSideBar.GetPopupGroup: TdxSideGroup; +var + p: TPoint; +begin + GetCursorPos(p); + p := ScreenToCLient(p); + Result := GetGroupAtPos(p); + if (Result = nil) then + Result := FActiveGroup; +end; + +function TdxSideBar.GetItemAtPos(p: TPoint): TdxSideBarItem; +begin + Result := ViewInfo.GetItemAtPos(p); +end; + +function TdxSideBar.IsGroupEditing: Boolean; +begin + Result := FRenameGroup <> nil; +end; + +function TdxSideBar.IsItemEditing: Boolean; +begin + Result := FRenameItem <> nil; +end; + +function TdxSideBar.IsEditing: Boolean; +begin + Result := IsGroupEditing or IsItemEditing; +end; + +procedure TdxSideBar.EditGroup(Group: TdxSideGroup); +var + r: TRect; +begin + if (FRenameGroup <> nil) or (FRenameItem <> nil) then + EndEdit(True); + FRenameGroup := Group; + + FRenameEdit := TSideBarRenameEdit.Create(Self); + r := ViewInfo.GetGroupViewInfoByGroup(Group).Rect; + with FRenameEdit do begin + Parent := Self; + BorderStyle := bsNone; + OnExit := RenameEditExit; + Font := FGroupFont; + Top := r.Top; + Left := r.Left; + Width := r.Right - r.Left; + Height := r.Bottom - r.Top; + Text := Group.Caption; + Font := FGroupFont; + Font.Color := clWindowText; + end; + CallNotify(FOnBeforeEdit, Self); + FRenameEdit.SetFocus; +end; + +procedure TdxSideBar.EditItem(Item: TdxSideBarItem); +var + r: TRect; + AItemViewInfo: TdxSideItemViewInfo; +begin + if (FRenameGroup <> nil) or (FRenameItem <> nil) then + EndEdit(True); + + ActiveGroup := Item.Group; + Item.MakeVisible; + + AItemViewInfo := ViewInfo.GetItemViewInfoByItem(Item); + if AItemViewInfo = nil then + exit; + + FRenameItem := Item; + FRenameEdit := TSideBarRenameEdit.Create(Self); + FRenameEdit.Font.Assign(ItemFont); + r := AItemViewInfo.CaptionRect; + InflateRect(r, 2, 2); + with FRenameEdit do begin + Parent := Self; + BorderStyle := bsNone; + OnExit := RenameEditExit; + Font := FGroupFont; + Top := r.Top; + Left := r.Left; + Width := r.Right - r.Left + 2; + Height := r.Bottom - r.Top; + Font := FItemFont; + Font.Color := clWindowText; + Text := Item.Caption; + end; + CallNotify(FOnBeforeEdit, Self); + FRenameEdit.SetFocus; + SendMessage(FRenameEdit.Handle, EM_SETSEL, 0, 1000); +end; + +procedure TdxSideBar.EndEdit(Accept: Boolean); +begin + if (FRenameEdit.Text <> '') and Accept then + begin + if (FRenameGroup <> nil) then + FRenameGroup.Caption := FRenameEdit.Text; + if (FRenameItem <> nil) then + FRenameItem.Caption := FRenameEdit.Text; + end; + CallNotify(FOnAfterEdit, Self); + FRenameEdit.Free; + FRenameEdit := nil; + FRenameGroup := nil; + FRenameItem := nil; + RepaintAll; +end; + +function TdxSideBar.GetLargeImages: TCustomImageList; +begin + Result := FLargeImages; + if (Result = nil) and (Store <> nil) then + Result := Store.FLargeImages; +end; + +function TdxSideBar.GetSmallImages: TCustomImageList; +begin + Result := FSmallImages; + if (Result = nil) and (Store <> nil) then + Result := Store.FSmallImages; +end; + +procedure TdxSideBar.RenameEditExit(Sender: TObject); +begin + EndEdit(True); +end; + +procedure TdxSideBar.DoItemClick(Item: TdxSideBarItem); +begin + if (Item <> nil) and not Item.Enabled then Exit; + if (Item <> nil) and (Item.StoredItem <> nil) then + Item.StoredItem.DoClick(Self, Item); + if (Assigned(FOnItemClick)) + and ((Item.StoredItem = nil) or not Assigned(Item.StoredItem.FOnClick)) then + FOnItemClick(Self, Item); +end; + +function TdxSideBar.GetFocusedItem(X, Y: Integer): TdxSideBarItem; +var + p: TPoint; +begin + p.X := X; + p.Y := Y; + Result := GetItemAtPos(p); +end; + +function TdxSideBar.GetTopVisibleToMakeItemVisible(AItem: TdxSideBarItem): Integer; +var + OldTopVisible: Integer; +begin + Result := 0; + if ViewInfo.ItemCount = 0 then exit; + if AItem.Index < ViewInfo.Items[0].Item.Index then + Result := AItem.Index + else + begin + OldTopVisible := ActiveGroup.TopVisibleItem; + while not AItem.IsFullVisible and (ActiveGroup.FTopVisibleItem < ActiveGroup.Items.Count - 1) do + begin + ActiveGroup.FTopVisibleItem := ActiveGroup.FTopVisibleItem + 1; + Result := ActiveGroup.TopVisibleItem; + ViewInfo.CalcViewInfo; + end; + ActiveGroup.FTopVisibleItem := OldTopVisible; + ViewInfo.CalcViewInfo; + end; +end; + +function TdxSideBar.GetDestDropItemViewInfo: TdxSideItemViewInfo; +begin + if DestDropItem <> nil then + Result := ViewInfo.GetItemViewInfo(DestDropItem) + else Result := nil; +end; + +procedure TdxSideBar.SetMouseFocusedItem(Item: TdxSideBarItem); +begin + if (Item <> FMouseFocusedItem) then begin + FMouseFocusedItem := Item; + CallNotify(FOnChangeFocusedItem, Self); + end; +end; + +procedure TdxSideBar.SetSelectedItem(Item: TdxSideBarItem); +begin + if (Item <> FSelectedItem) then + begin + FSelectedItem := Item; + CallNotify(FOnChangeSelectedItem, Self); + end; +end; + +procedure TdxSideBar.DoGroupMouseFocused(Group: TdxSideGroup; IsDown: Boolean); +var + OldGroup: TdxSideGroup; + OldDown: Boolean; +begin + if (FMouseFocusedGroup <> Group) or (FMouseFocusedGroupIsDown <> IsDown) then begin + OldGroup := FMouseFocusedGroup; + FMouseFocusedGroup := Group; + OldDown := IsDown; + FMouseFocusedGroupIsDown := IsDown; + if (OldGroup <> nil) and ((OldGroup <> Group) or (IsDown = OldDown)) + and Painter.IsGroupFocused then + InvalidateGroup(OldGroup); + if (Group <> nil) and (OldGroup <> Group) and Painter.IsGroupFocused then + InvalidateGroup(Group); + end; +end; + +procedure TdxSideBar.DoItemMouseFocused(Item: TdxSideBarItem; IsDown: Boolean); +var + ANeedShowHint: Boolean; +begin + if (FMouseFocusedItem <> Item) or (FMouseFocusedItemIsDown <> IsDown) then begin + if (FMouseFocusedItem <> nil) and (FMouseFocusedItem <> Item) and(FMouseFocusedItem <> FSelectedItem) then + InvalidateItemBorder(FMouseFocusedItem); + ANeedShowHint := ShowHint and (Item <> FMouseFocusedItem); + if ANeedShowHint then + HintActivate(False); + SetMouseFocusedItem(Item); + if not IsDown and ANeedShowHint then + HintActivate(True); + FMouseFocusedItemIsDown := IsDown; + if (FMouseFocusedItem <> nil) and(FMouseFocusedItem <> FSelectedItem) and FMouseFocusedItem.Enabled then + InvalidateItemBorder(FMouseFocusedItem); + end; +end; + +procedure TdxSideBar.DoItemSelected(Item: TdxSideBarItem); +begin + if not CanSelected then Exit; + if (FSelectedItem <> Item) and (FSelectedItem <> nil) then + InvalidateItemBorder(FSelectedItem); + + SetSelectedItem(Item); + + if (FSelectedItem <> nil) and (FSelectedItem.Collection <> nil) + and FSelectedItem.Enabled then + InvalidateItemBorder(FSelectedItem); +end; + +procedure TdxSideBar.DoBkPictureChange(Sender: TObject); +begin + RepaintAll; +end; + +procedure TdxSideBar.CMMouseEnter(var Message: TMessage); +begin + inherited; + CallNotify(FOnMouseEnter, Self); +end; + +procedure TdxSideBar.CMMouseLeave(var Message: TMessage); +var + Group: TdxSideGroup; +begin + inherited; + if (dxSideBarDragObject <> nil) then + SetDestDropItemandPosition(nil, sbdspIn) + else DoItemMouseFocused(nil, False); + CallNotify(FOnMouseLeave, Self); + if (FMouseFocusedGroup <> nil) then + begin + Group := FMouseFocusedGroup; + FMouseFocusedGroup := nil; + InvalidateGroup(Group); + end; +end; + +procedure TdxSideBar.SetDestDropItemandPosition(AItem: TdxSideBarItem; APosition: TdxSideBarDragSourcePosition); +var + OldItemViewInfo: TdxSideItemViewInfo; + OldPosition: TdxSideBarDragSourcePosition; + +procedure InvalidateSpace(AItemViewInfo: TdxSideItemViewInfo; APosition: TdxSideBarDragSourcePosition); +var + r: TRect; +begin + if (AItemViewInfo <> nil) then + begin + r := AItemViewInfo.GetItemDragSourceSpace(APosition); + InflateRect(r, 0, 1); + cxInvalidateRect(Handle, r, True); + end; +end; + +procedure InvalidateArrow; +begin + InvalidateSpace(OldItemViewInfo, OldPosition); + InvalidateSpace(DestDropItemViewInfo, DropItemPosition); +end; + +begin + if (DestDropItem = AItem) and (DropItemPosition = APosition) then + exit; + OldItemViewInfo := DestDropItemViewInfo; + OldPosition := FDropItemPosition; + FDestDropItem := AItem; + FDropItemPosition := APosition; + InvalidateArrow; +end; + +procedure TdxSideBar.SetDestDropItem(Value: TdxSideBarItem); +begin + SetDestDropItemandPosition(Value, DropItemPosition); +end; + +procedure TdxSideBar.SetDropItemPosition(Value: TdxSideBarDragSourcePosition); +begin + SetDestDropItemandPosition(DestDropItem, Value); +end; + +procedure TdxSideBar.DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); + + procedure DoDragOver; + begin + if Assigned(OnDragOver) then + OnDragOver(Self, Source, X, Y, State, Accept); + end; + +var + p: TPoint; + r: TRect; + AItemViewInfo: TdxSideItemViewInfo; + APosition: TdxSideBarDragSourcePosition; +begin + if (dxSideBarDragObject = nil) or (ActiveGroup = nil) then begin + Accept := ActiveGroup = nil; + DoDragOver; + Exit; + end; + + p := Point(X, Y); + Accept := False; + + if (GetGroupAtPos(p) <> nil) then begin + ActiveGroup := GetGroupAtPos(p); + DoDragOver; + Exit; + end; + + if not FScrollTimer.Enabled then + FScrollTimer.Enabled := True; + + FScrollButtonUpIsDown := False; + FScrollButtonDownIsDown := False; + if ViewInfo.IsTopScrollButtonVisible then begin + r := ViewInfo.ItemsRect; + r.Bottom := r.Top + SpaceHeight + ScrollButtonHeight; + if (Y > r.Top) and (Y < r.Bottom) then begin + FScrollButtonUpIsDown := True; + DoItemMouseFocused(nil, False); + DoDragOver; + Exit; + end; + end; + if ViewInfo.IsBottomScrollButtonVisible then + begin + r := ViewInfo.ItemsRect; + r.Top := r.Bottom - SpaceHeight - ScrollButtonHeight; + if (Y > r.Top) and (Y < r.Bottom) then begin + FScrollButtonDownIsDown := True; + DoItemMouseFocused(nil, False); + DoDragOver; + Exit; + end; + end; + + DoItemMouseFocused(GetFocusedItem(X, Y), False); + + AItemViewInfo := ViewInfo.GetNearestItemViewInfoAtPost(p, APosition); + SetDestDropItemandPosition(GetViewInfoItem(AItemViewInfo), APosition); + Accept := (APosition <> sbdspIn) or (AItemViewInfo <> nil); + DoDragOver; +end; + +procedure TdxSideBar.DoEndDrag(Target: TObject; X, Y: Integer); +begin + if (dxSideBarDragObject <> nil) then + begin + dxSideBarDragObject.EndDrag(Target, X, Y); + FDropItemPosition := sbdspIn; + if Target = nil then + RepaintAll; + end; + inherited; +end; + +procedure TdxSideBar.DoStartDrag(var DragObject: TDragObject); +var + Item: TdxSideBarItem; + p: TPoint; +begin + inherited; + GetCursorPos(p); + p := ScreenToClient(p); + Item := FMouseFocusedItem; + if (Item <> nil) then begin + dxSideBarDragObject := TdxSideBarDragObject.Create(Self, DragObject, Item, nil); + end; +end; + +procedure TdxSideBar.LoadFromRegistry(ARegistryPath: string); +var + Registry: TRegistry; + + function GetStoredItemByName(ASt: string): TdxStoredSideItem; + var + I: Integer; + begin + Result := nil; + if (ASt <> '') and (Store <> nil) then + for I := 0 to Store.Count - 1 do + if (CompareText(Store.Items[I].Name, ASt) = 0) then + begin + Result := Store.Items[I]; + Break; + end; + end; + + procedure ReadGroupItems(const AKey: string; AGroup: TdxSideGroup); + var + I, ItemCount: Integer; + begin + with Registry do + begin + if ValueExists('ItemCount') then ItemCount := ReadInteger('ItemCount') + else ItemCount := 0; + CloseKey; + for I := 0 to ItemCount - 1 do + if OpenKey(AKey + '\Item' + IntToStr(I), False) then + with AGroup.Items.Add do + try + if (Store <> nil) then + StoredItem := GetStoredItemByName(ReadString('StoredItem')); + Caption := ReadString('Caption'); + CustomData := ReadString('CustomData'); + Hint := ReadString('Hint'); + IsDefault := ReadBool('IsDefault'); + LargeImage := ReadInteger('LargeImage'); + SmallImage := ReadInteger('SmallImage'); + Tag := ReadInteger('Tag'); + finally + CloseKey; + end; + end; + end; + +var + AGroupCount: Integer; + AGroup: TdxSideGroup; + I: Integer; + AKey: string; +begin + Registry := TRegistry.Create; + with Registry do + if OpenKey(ARegistryPath, False) then + begin + if ValueExists('GroupCount') then AGroupCount := ReadInteger('GroupCount') + else AGroupCount := 0; + + if (AGroupCount > 0) then + Groups.Clear; + + for I := 0 to AGroupCount - 1 do + begin + AGroup := Groups.Add; + AKey := ARegistryPath + '\Group' + IntToStr(I); + if OpenKey(AKey, False) then + begin + AGroup.Caption := ReadString('Caption'); + AGroup.IconType := TdxSideGroupIconType(ReadInteger('IconType')); + ReadGroupItems(AKey, AGroup); + end; + end; + end; + Registry.Free; +end; + +procedure TdxSideBar.SaveToRegistry(ARegistryPath: string); +var + Registry, SubRegistry: TRegistry; + Keys, SubKeys: TStringList; + + procedure WriteGroupItems(const AKey: string; AGroup: TdxSideGroup); + var + I: Integer; + begin + with Registry do + begin + WriteInteger('ItemCount', AGroup.ItemCount); + CloseKey; + for I := 0 to AGroup.ItemCount - 1 do + if OpenKey(AKey + '\Item' + IntToStr(I), True) then + with AGroup.Items[I] do + begin + WriteString('Caption', Caption); + WriteString('CustomData', CustomData); + WriteString('Hint', Hint); + WriteBool('IsDefault', IsDefault); + WriteInteger('LargeImage', LargeImage); + WriteInteger('SmallImage', SmallImage); + WriteInteger('Tag', Tag); + if (StoredItem <> nil) then + WriteString('StoredItem', StoredItem.Name); + CloseKey; + end; + end; + end; + +var + I, j: Integer; + AKey: string; +begin + if (ARegistryPath = '') then + Exit; + + Registry := TRegistry.Create; + with Registry do + if OpenKey(ARegistryPath, True) then + begin + // delete entire previous data from registry + Keys := TStringList.Create; + SubKeys := TStringList.Create; + SubRegistry := TRegistry.Create; + try + GetKeyNames(Keys); + for I := 0 to Keys.Count - 1 do + begin + with SubRegistry do + begin + OpenKey(ARegistryPath + '\' + Keys[I], False); + SubRegistry.GetKeyNames(SubKeys); + for j := 0 to SubKeys.Count - 1 do DeleteKey(SubKeys[j]); + CloseKey; + end; + DeleteKey(Keys[I]); + end; + finally + SubRegistry.Free; + SubKeys.Free; + Keys.Free; + end; + + // write group count + WriteInteger('GroupCount', Groups.Count); + + // write Groups + for I := 0 to GroupCount - 1 do + begin + AKey := ARegistryPath + '\Group' + IntToStr(I); + if OpenKey(AKey, True) then + begin + WriteString('Caption', Groups[I].Caption); + WriteInteger('IconType', Ord(Groups[I].IconType)); + WriteGroupItems(AKey, Groups[I]); + end; + end; + end; + Registry.Free; +end; + +{$IFNDEF DELPHI7} +var + SideBarDragObjectHookKey: HHOOK; + +function SideBarDragObjectWinProcKey(code: Integer; wparam: WParam; lparam: LParam): LResult; stdcall; +var + p: TPoint; +begin + if (wparam = VK_CONTROL) then begin + GetCursorPos(p); + Windows.ScreenToClient(GetCapture, p); + SendMessage(GetCapture, LongInt(WM_MOUSEMOVE), MK_LBUTTON, MAKELONG(p.X, p.Y)); + end; + Result := CallNextHookEx(SideBarDragObjectHookKey, code, wparam, lparam); +end; +{$ENDIF} + +function TdxSideBar.CreatePainter: TdxSideBarPainter; +const + PainterClasses: Array[TdxsbPaintStyle] of TdxSideBarPainterClass = + (TdxSideBarStandardPainter, + TdxSideBarFlatPainter, + TdxSideBarXPPainter, + TdxSideBarW2kPainter); +begin + Result := PainterClasses[PaintStyle].Create(self); +end; + +function TdxSideBar.VisibleGroupCount: Integer; +var + i: Integer; +begin + Result := 0; + for i := 0 to Groups.Count - 1 do + if Groups[i].Visible then + Inc(Result); +end; + +{ TdxSideBarPopupMenu } +constructor TdxSideBarPopupMenu.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Bar := nil; + List := TList.Create; + FOptions := [sbmIconType, sbmAddGroup, sbmRemoveGroup, sbmCustomize, + sbmRenameGroup, sbmRenameItem, sbmRemoveItem]; +end; + +destructor TdxSideBarPopupMenu.Destroy; +begin + DestroyBarItems; + List.Free; + inherited Destroy; +end; + +procedure TdxSideBarPopupMenu.Popup(X, Y: Integer); +var + MenuItem: TMenuItem; +const + Flags: array[TPopupAlignment] of Word = (TPM_LEFTALIGN, TPM_RIGHTALIGN, + TPM_CENTERALIGN); + + procedure InsertNewMenuItem(const ACaption: string; AEnabled, AChecked: Boolean; ATag: TdxSideBarTag); + begin + MenuItem := NewItem(ACaption, 0, AChecked, AEnabled, BarMenuClick, 0, ''); + MenuItem.Tag := ATag; + Items.Insert(List.Count, MenuItem); + List.Add(MenuItem); + end; + +begin + if (List.Count > 0) then + DestroyBarItems; + Bar := nil; + if (PopupComponent <> nil) and (PopupComponent is TdxSideBar) then + begin + Bar := PopupComponent As TdxSideBar; + Group := Bar.GetPopupGroup; + FocusedItem := Bar.FocusedItem; + + if FocusedItem = nil then + begin + if (sbmIconType in FOptions) and (Group <> nil) then begin + InsertNewMenuItem(dxSideBarGetResourceString(@DXSB_LARGEICONTYPE), True, Group.IconType = dxsgLargeIcon, -101); + InsertNewMenuItem(dxSideBarGetResourceString(@DXSB_SMALLICONTYPE), True, Group.IconType = dxsgSmallIcon, -102); + end; + if (sbmAddGroup in FOptions) or (sbmRemoveGroup in FOptions) + or (sbmRenameGroup in FOptions) then begin + if (List.Count > 0) then + InsertNewMenuItem('-', True, False, 0); + if (sbmAddGroup in FOptions) then + InsertNewMenuItem(dxSideBarGetResourceString(@DXSB_ADDGROUP), True, False, -201); + if (sbmRemoveGroup in FOptions) then + InsertNewMenuItem(dxSideBarGetResourceString(@DXSB_REMOVEGROUP), Group <> nil, False, -202); + if (sbmRenameGroup in FOptions) then + InsertNewMenuItem(dxSideBarGetResourceString(@DXSB_RENAMEGROUP), Group <> nil, False, -203); + end; + if (sbmCustomize in FOptions) and (Bar <> nil) and (Bar.Store <> nil) + and (Group <> nil) then begin + if (List.Count > 0) and (TMenuItem(List.Last).Caption <> '-') then + InsertNewMenuItem('-', True, False, 0); + InsertNewMenuItem(dxSideBarGetResourceString(@DXSB_CUSTOMIZE), True, False, -401); + end; + end else begin + if (sbmRemoveItem in FOptions) then + InsertNewMenuItem(dxSideBarGetResourceString(@DXSB_REMOVEITEM), True, False, -301); + if (sbmRenameItem in FOptions) then + InsertNewMenuItem(dxSideBarGetResourceString(@DXSB_RENAMEITEM), True, False, -302); + end; + if (Items.Count > List.Count) and (List.Count > 0) + and (TMenuItem(List.Last).Caption <> '-') then + InsertNewMenuItem('-', True, False, 0); + end; + inherited Popup(X, Y); + CallNotify(FOnPopupClose, Self); +end; + +procedure TdxSideBarPopupMenu.BarMenuClick(Sender: TObject); +var + tag: LongInt; + gr: TdxSideGroup; +begin + if not (Sender is TMenuItem) then Exit; + tag := TMenuItem(Sender).Tag; + case tag of + -101: Group.IconType := dxsgLargeIcon; + -102: Group.IconType := dxsgSmallIcon; + -201: + begin + gr := Bar.Groups.Add; + Bar.EditGroup(gr); + end; + -202: Group.Free; + -203: Bar.EditGroup(Group); + -301: + begin + Bar.FMouseFocusedItem := nil; + FocusedItem.Free; + end; + -302: Bar.EditItem(FocusedItem); + -401: if (Bar.Store <> nil) then Bar.Store.Customize; + end; + CallNotify(FOnAfterClick, Self); +end; + +procedure TdxSideBarPopupMenu.DestroyBarItems; +var + MenuItem: TMenuItem; +begin + if (Bar <> nil) then + begin + while List.Count > 0 do begin + MenuItem := TMenuItem(List[0]); + List.Remove(MenuItem); + MenuItem.Free; + end; + Bar := nil; + end; +end; + +{TdxSideBarDragObject} +type + TtmpDragObject = class(TDragControlObject) + protected + function GetDragCursor(Accepted: Boolean; X, Y: Integer): TCursor; override; + public + constructor Create(AControl: TControl); override; + end; + +function TtmpDragObject.GetDragCursor(Accepted: Boolean; X, Y: Integer): TCursor; +var + wnd: TWinControl; +begin + if Accepted then begin + if dxSideBarDragObject.FDeleteItem then + Result := dxSideBarDragDeleteCursor + else + begin + wnd := FindVCLWindow(Point(X, Y)); + if not (GetKeyState(VK_CONTROL) < 0) and ((dxSideBarDragObject.Item <> nil) or (wnd = nil) or not (wnd is TdxSideBar)) then + Result := dxSideBarDragCursor + else + Result := dxSideBarDragCopyCursor; + end + end + else + Result := crNoDrop; + dxSideBarDragObject.FDeleteItem := False; +end; + +constructor TtmpDragObject.Create(AControl: TControl); +begin + inherited Create(AControl); +end; + +constructor TdxSideBarDragObject.Create(Control: TControl; + var DragObject: TDragObject; AItem: TdxSideBarItem; AStoredItem: TdxStoredSideItem); +begin + inherited Create; + FDragObject := TtmpDragObject.Create(Control); + DragObject := FDragObject; +{$IFNDEF DELPHI7} +//avoid Delphi bug. Send Mouse move on VK_CONTROL down/up + SideBarDragObjectHookKey := SetWindowsHookEx(WH_KEYBOARD, + SideBarDragObjectWinProcKey, 0, GetCurrentThreadId); +{$ENDIF} + FItem := AItem; + if Item <> nil then + FStoredItem := Item.StoredItem + else + FStoredItem := AStoredItem; +end; + +destructor TdxSideBarDragObject.Destroy; +begin + FDragObject.Free; + inherited; +end; + +function TdxSideBarDragObject.EndDrag(Target: TObject; X, Y: Integer): TdxSideBarItem; +var + Index: Integer; + AItem, AFreeItem: TdxSideBarItem; +begin + AItem := nil; + AFreeItem := FItem; + if (Target <> nil) and (Target is TdxSideBar) then + with TdxSideBar(Target) do + begin + if not FCancelDrag then + begin + if ActiveGroup = nil then + Groups.Add; + Index := -1; + if ActiveGroup.Items.Count = 0 then + Index := 0; + if (DestDropItemViewInfo <> nil) then + Index := DestDropItemViewInfo.Item.Index; + if (Index > -1) and ((GetKeyState(VK_CONTROL) < 0) or not ((Item <> nil) + and (ActiveGroup = Item.Group) + and (Item.Index = Index))) then + begin + if not (GetKeyState(VK_CONTROL) < 0) and (Item <> nil) and (ActiveGroup = Item.Group) then + begin + AItem := Item; + AFreeItem := nil; + end else + begin + AItem := ActiveGroup.Items.Add; + if DropItemPosition = sbdspBottom then + Inc(Index); + if (dxSideBarDragObject.Item <> nil) then + AItem.Assign(dxSideBarDragObject.Item) + else AItem.StoredItem := dxSideBarDragObject.StoredItem; + end; + AItem.Index := Index; + end + else + Index := -1; + FDestDropItem := nil; + FDropItemPosition := sbdspIn; + + if (Assigned(FOnDragDropItem)) then + FOnDragDropItem(Self, Item, AItem, (GetKeyState(VK_CONTROL) < 0)); + + if (AItem <> nil) then + DoItemSelected(AItem); + if (AFreeItem <> nil) and (Index > -1) and not (GetKeyState(VK_CONTROL) < 0) then + AFreeItem.Free; + FMouseFocusedItem := nil; + end; + RepaintAll; + end; + +{$IFNDEF DELPHI7} + UnhookWindowsHookEx(SideBarDragObjectHookKey); +{$ENDIF} + Result := AItem; + Self.Free; + dxSideBarDragObject := nil; +end; + +initialization + Classes.RegisterClass(TdxStoredSideItem); + dxSideBarDragObject := nil; + Screen.Cursors[dxSideBarDragCursor] := LoadCursor(HInstance, 'dxSideBarDragCursor'); + Screen.Cursors[dxSideBarDragCopyCursor] := LoadCursor(HInstance, 'dxSideBarDragCopyCursor'); + Screen.Cursors[dxSideBarDragDeleteCursor] := LoadCursor(HInstance, 'dxSideBarDragDeleteCursor'); + Screen.Cursors[dxSideBarGroupCursor] := LoadCursor(HInstance, 'DXSIDEBARGROUPCURSOR'); + +finalization + DestroyCursor(Screen.Cursors[dxSideBarGroupCursor]); + DestroyCursor(Screen.Cursors[dxSideBarDragDeleteCursor]); + DestroyCursor(Screen.Cursors[dxSideBarDragCopyCursor]); + DestroyCursor(Screen.Cursors[dxSideBarDragCursor]); + +end. diff --git a/official/x.35/ExpressSideBar/Sources/dxsbar.res b/official/x.35/ExpressSideBar/Sources/dxsbar.res new file mode 100644 index 00000000..993026df Binary files /dev/null and b/official/x.35/ExpressSideBar/Sources/dxsbar.res differ diff --git a/official/x.35/ExpressSideBar/Sources/dxsbarcs.dfm b/official/x.35/ExpressSideBar/Sources/dxsbarcs.dfm new file mode 100644 index 00000000..b8533bbf --- /dev/null +++ b/official/x.35/ExpressSideBar/Sources/dxsbarcs.dfm @@ -0,0 +1,103 @@ +object frmSideBarCustomize: TfrmSideBarCustomize + Left = 107 + Top = 98 + BorderIcons = [] + BorderStyle = bsDialog + Caption = 'Customize' + ClientHeight = 223 + ClientWidth = 342 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + FormStyle = fsStayOnTop + OldCreateOrder = True + OnClose = FormClose + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 0 + Top = 200 + Width = 342 + Height = 23 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + object Button: TButton + Left = 265 + Top = 1 + Width = 72 + Height = 21 + Cancel = True + Caption = 'Close' + Default = True + ModalResult = 1 + TabOrder = 0 + OnClick = ButtonClick + end + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 342 + Height = 200 + Align = alClient + BevelInner = bvLowered + BevelOuter = bvNone + BorderWidth = 5 + TabOrder = 1 + object Panel3: TPanel + Left = 6 + Top = 6 + Width = 130 + Height = 188 + Align = alLeft + BevelInner = bvLowered + BevelOuter = bvNone + Caption = 'Panel2' + TabOrder = 0 + object ListBox: TListBox + Left = 1 + Top = 1 + Width = 128 + Height = 186 + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + TabOrder = 0 + OnClick = ListBoxClick + end + end + object Panel4: TPanel + Left = 136 + Top = 6 + Width = 7 + Height = 188 + Align = alLeft + TabOrder = 1 + end + object ImageListBox: TdxImageListBox + Left = 143 + Top = 6 + Width = 193 + Height = 188 + Alignment = taLeftJustify + ImageAlign = dxliLeft + ItemHeight = 0 + MultiLines = False + VertAlignment = tvaCenter + Align = alClient + BorderStyle = bsNone + DragMode = dmAutomatic + TabOrder = 2 + OnDragDrop = ImageListBoxDragDrop + OnDragOver = ImageListBoxDragOver + OnEndDrag = ImageListBoxEndDrag + OnStartDrag = ImageListBoxStartDrag + SaveStrings = () + end + end +end diff --git a/official/x.35/ExpressSideBar/Sources/dxsbarcs.pas b/official/x.35/ExpressSideBar/Sources/dxsbarcs.pas new file mode 100644 index 00000000..2a1927fc --- /dev/null +++ b/official/x.35/ExpressSideBar/Sources/dxsbarcs.pas @@ -0,0 +1,208 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express side bar store component editor } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE and ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL and PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS and ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE and ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ and PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxsbarcs; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, dximctrl, ExtCtrls, dxsbar; + +type + TfrmSideBarCustomize = class(TdxSideBarStoreCustomizeForm) + Panel1: TPanel; + Panel2: TPanel; + Panel3: TPanel; + ListBox: TListBox; + Panel4: TPanel; + Button: TButton; + ImageListBox: TdxImageListBox; + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure ListBoxClick(Sender: TObject); + procedure ImageListBoxStartDrag(Sender: TObject; + var DragObject: TDragObject); + procedure ImageListBoxEndDrag(Sender, Target: TObject; X, Y: Integer); + procedure ButtonClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure ImageListBoxDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure ImageListBoxDragDrop(Sender, Source: TObject; X, Y: Integer); + private + public + constructor Create(AOwner: TComponent); override; + end; + +procedure SideBarCustomize(AStore : TdxSideBarStore); + +implementation + +uses dxreginf, dxsbstrs; + +Var + AForm : TfrmSideBarCustomize; + +procedure SideBarCustomize(AStore : TdxSideBarStore); + + function IsCategoryVisible(Index : Integer) : Boolean; + var + i : Integer; + List : TList; + begin + List := TList.Create; + AStore.GetItemsByCategory(AStore.Categories[Index], List); + Result := False; + for i := 0 to List.Count - 1 do + if TdxStoredSideItem(List[i]).AvailableInCustomizeForm then + begin + Result := True; + Break; + end; + List.Free; + end; + +var + i : Integer; +begin + if AForm = nil then + begin + AForm := TfrmSideBarCustomize.Create(nil); + with AForm do + begin + for i := 0 to AStore.Categories.Count - 1 do + if IsCategoryVisible(i) then + ListBox.Items.AddObject(AStore.Categories[i], TObject(i)); + ImageListBox.ImageList := AStore.LargeImages; + if (ListBox.Items.Count > 0) then + ListBox.ItemIndex := 0; + end; + end; + AForm.Store := AStore; + AForm.ListBoxClick(nil); + AForm.BeginCustomizing; + + AForm.Show; +end; + +{$R *.DFM} + +constructor TfrmSideBarCustomize.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Caption := dxSideBarGetResourceString(@DXSB_CUSTOMIZE); + Button.Caption := dxSideBarGetResourceString(@DXSB_CUSTOMIZECLOSEBUTTON); + Constraints.MinWidth := 350; + Constraints.MinHeight := 250; + Constraints.MaxWidth := Constraints.MinWidth; + Constraints.MaxHeight := Constraints.MinHeight; +end; + +procedure TfrmSideBarCustomize.FormClose(Sender: TObject; + var Action: TCloseAction); +begin + StoreExpressFormsInformation(self); + Action := caFree; + EndCustomizing; + AForm := nil; +end; + +procedure TfrmSideBarCustomize.ListBoxClick(Sender: TObject); +Var + List : TList; + i : Integer; + item : TdxStoredSideItem; +begin + ImageListBox.Items.Clear; + if (ListBox.ItemIndex > -1) and (ListBox.Items.Count > 0) then + begin + List := TList.Create; + Store.GetItemsByCategory(Store.Categories[Integer(ListBox.Items.Objects[ListBox.ItemIndex])], List); + for i := 0 to List.Count - 1 do + if TdxStoredSideItem(List[i]).AvailableInCustomizeForm then + begin + Item := TdxStoredSideItem(List[i]); + ImageListBox.AddItem(Item.Caption, Item.LargeImage) + end; + List.Free; + end; + if ImageListBox.Items.Count > 1 then + ImageListBox.ItemIndex := 0; +end; + +procedure TfrmSideBarCustomize.ImageListBoxStartDrag(Sender: TObject; + var DragObject: TDragObject); +begin + if (ImageListBox.ItemIndex > -1) and (ImageListBox.Items.Count > 0) then + dxSideBarDragObject := TdxSideBarDragObject.Create(ImageListBox, DragObject, nil, + Store.GetItemByCategory(ListBox.Items[ListBox.ItemIndex], ImageListBox.ItemIndex)); +end; + +procedure TfrmSideBarCustomize.ImageListBoxEndDrag(Sender, + Target: TObject; X, Y: Integer); +begin + if (dxSideBarDragObject <> nil) then + dxSideBarDragObject.EndDrag(Target, X, Y); +end; + +procedure TfrmSideBarCustomize.ButtonClick(Sender: TObject); +begin + AForm.Close; +end; + +procedure TfrmSideBarCustomize.FormCreate(Sender: TObject); +begin + RestoreExpressFormsInformation(self); +end; + +procedure TfrmSideBarCustomize.ImageListBoxDragOver(Sender, + Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); +begin + if (dxSideBarDragObject <> nil) and (Source is TdxSideBar) then begin + dxSideBarDragObject.DeleteItem := True; + Accept := True; + end; +end; + +procedure TfrmSideBarCustomize.ImageListBoxDragDrop(Sender, + Source: TObject; X, Y: Integer); +begin + if (dxSideBarDragObject <> nil) and (Source is TdxSideBar) then begin + dxSideBarDragObject.Item.Free; + end; +end; + +end. diff --git a/official/x.35/ExpressSideBar/Sources/dxsbared.dfm b/official/x.35/ExpressSideBar/Sources/dxsbared.dfm new file mode 100644 index 00000000..95264c86 --- /dev/null +++ b/official/x.35/ExpressSideBar/Sources/dxsbared.dfm @@ -0,0 +1,436 @@ +object frmdxSideBarEditor: TfrmdxSideBarEditor + Left = 245 + Top = 126 + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'ExpressSideBar Editor: ' + ClientHeight = 367 + ClientWidth = 545 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + OnCreate = FormCreate + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Panel3: TPanel + Left = 0 + Top = 0 + Width = 125 + Height = 367 + Align = alLeft + BevelOuter = bvNone + BorderWidth = 4 + TabOrder = 0 + object Bar: TdxSideBar + Left = 4 + Top = 4 + Width = 117 + Height = 359 + Align = alClient + BkGround.BeginColor = clGray + BkGround.EndColor = clGray + Color = clGray + CanSelected = True + GroupFont.Charset = DEFAULT_CHARSET + GroupFont.Color = clWindowText + GroupFont.Height = -11 + GroupFont.Name = 'MS Sans Serif' + GroupFont.Style = [] + Groups = <> + ActiveGroupIndex = 0 + GroupPopupMenu = AutoOutLookPopupMenu1 + ItemFont.Charset = DEFAULT_CHARSET + ItemFont.Color = clWhite + ItemFont.Height = -11 + ItemFont.Name = 'MS Sans Serif' + ItemFont.Style = [] + ItemPopupMenu = AutoOutLookPopupMenu1 + OnChangeActiveGroup = BarChangeActiveGroup + OnChangeSelectedItem = BarChangeSelectedItem + DragMode = dmAutomatic + end + end + object Panel1: TPanel + Left = 125 + Top = 0 + Width = 420 + Height = 367 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + object Panel2: TPanel + Left = 0 + Top = 340 + Width = 420 + Height = 27 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + object BOk: TButton + Left = 157 + Top = 4 + Width = 80 + Height = 21 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + OnClick = BOkClick + end + object BCancel: TButton + Left = 248 + Top = 4 + Width = 80 + Height = 21 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + OnClick = BCancelClick + end + object bHelp: TButton + Left = 336 + Top = 4 + Width = 80 + Height = 21 + Caption = 'Help' + TabOrder = 3 + end + object BDefault: TButton + Left = 8 + Top = 3 + Width = 80 + Height = 21 + Caption = 'Default' + TabOrder = 0 + OnClick = BDefaultClick + end + end + object BIAdd: TButton + Left = 6 + Top = 289 + Width = 80 + Height = 21 + Caption = 'Add' + TabOrder = 1 + OnClick = BIAddClick + end + object BIInsert: TButton + Left = 6 + Top = 313 + Width = 80 + Height = 21 + Caption = 'Insert' + TabOrder = 2 + OnClick = BIInsertClick + end + object BIDelete: TButton + Left = 89 + Top = 289 + Width = 80 + Height = 21 + Caption = 'Delete' + TabOrder = 3 + OnClick = BIDeleteClick + end + object BIClear: TButton + Left = 89 + Top = 312 + Width = 80 + Height = 21 + Caption = 'Clear' + TabOrder = 4 + OnClick = BIClearClick + end + object BIMoveUp: TButton + Left = 174 + Top = 289 + Width = 80 + Height = 21 + Caption = 'Move Up' + TabOrder = 5 + OnClick = BIMoveUpClick + end + object BIMovedown: TButton + Left = 174 + Top = 312 + Width = 80 + Height = 21 + Caption = 'Move down' + TabOrder = 6 + OnClick = BIMovedownClick + end + object GGroup: TGroupBox + Left = 8 + Top = 1 + Width = 408 + Height = 72 + Caption = 'Groups' + TabOrder = 7 + object LIconType: TLabel + Left = 272 + Top = 21 + Width = 48 + Height = 13 + Caption = 'Icon Type' + end + object BGAdd: TButton + Left = 6 + Top = 18 + Width = 80 + Height = 21 + Caption = 'Add' + TabOrder = 0 + OnClick = BGAddClick + end + object BGDelete: TButton + Left = 91 + Top = 18 + Width = 80 + Height = 21 + Caption = 'Delete' + TabOrder = 1 + OnClick = BGDeleteClick + end + object BGRename: TButton + Left = 177 + Top = 18 + Width = 80 + Height = 21 + Caption = 'Rename' + TabOrder = 2 + OnClick = BGRenameClick + end + object CBGIType: TCheckBox + Left = 338 + Top = 20 + Width = 65 + Height = 17 + Caption = 'Large' + Checked = True + State = cbChecked + TabOrder = 3 + OnClick = CBGITypeClick + end + object BGUp: TButton + Left = 6 + Top = 42 + Width = 80 + Height = 21 + Caption = 'Move Up' + TabOrder = 4 + OnClick = BGUpClick + end + object BGDown: TButton + Left = 91 + Top = 42 + Width = 80 + Height = 21 + Caption = 'Move Down' + TabOrder = 5 + OnClick = BGDownClick + end + object cbGroupVisible: TCheckBox + Left = 274 + Top = 46 + Width = 122 + Height = 17 + Caption = 'Visible' + TabOrder = 6 + OnClick = cbGroupVisibleClick + end + end + object GItemProp: TGroupBox + Left = 8 + Top = 80 + Width = 245 + Height = 205 + Caption = 'Item properties' + TabOrder = 8 + object LCustomData: TLabel + Left = 6 + Top = 19 + Width = 61 + Height = 13 + Caption = 'Custom Data' + end + object LTag: TLabel + Left = 7 + Top = 43 + Width = 19 + Height = 13 + Caption = 'Tag' + end + object LSILarge: TLabel + Left = 5 + Top = 117 + Width = 38 + Height = 29 + AutoSize = False + Caption = 'Large Image' + WordWrap = True + end + object LSISmall: TLabel + Left = 126 + Top = 119 + Width = 38 + Height = 29 + AutoSize = False + Caption = 'Small Image' + WordWrap = True + end + object LCaption: TLabel + Left = 7 + Top = 72 + Width = 36 + Height = 13 + Caption = 'Caption' + end + object Bevel1: TBevel + Left = 7 + Top = 64 + Width = 231 + Height = 2 + end + object LHint: TLabel + Left = 7 + Top = 96 + Width = 19 + Height = 13 + Caption = 'Hint' + end + object ECustomData: TEdit + Left = 91 + Top = 17 + Width = 147 + Height = 21 + TabOrder = 0 + OnExit = ECustomDataExit + end + object ETag: TEdit + Left = 91 + Top = 40 + Width = 147 + Height = 21 + TabOrder = 1 + OnExit = ETagExit + OnKeyPress = ETagKeyPress + end + object SILarge: TdxSpinImage + Left = 45 + Top = 119 + Width = 70 + Height = 54 + AutoSize = False + BorderStyle = bsSingle + DefaultImages = True + ImageHAlign = hsiCenter + ImageVAlign = vsiCenter + Items = <> + ItemIndex = -1 + ReadOnly = False + Stretch = True + UpDownAlign = udaRight + UpDownOrientation = siVertical + UpDownWidth = 16 + UseDblClick = True + OnChange = SILargeChange + ParentColor = True + TabOrder = 4 + end + object SISmall: TdxSpinImage + Left = 169 + Top = 119 + Width = 70 + Height = 54 + AutoSize = False + BorderStyle = bsSingle + DefaultImages = True + ImageHAlign = hsiCenter + ImageVAlign = vsiCenter + Items = <> + ItemIndex = -1 + ReadOnly = False + Stretch = True + UpDownAlign = udaRight + UpDownOrientation = siVertical + UpDownWidth = 16 + UseDblClick = True + OnChange = SISmallChange + ParentColor = True + TabOrder = 5 + end + object ECaption: TEdit + Left = 69 + Top = 69 + Width = 169 + Height = 21 + TabOrder = 2 + OnChange = ECaptionChange + end + object BIDefault: TButton + Left = 7 + Top = 178 + Width = 233 + Height = 22 + Caption = 'Set default item properties' + TabOrder = 6 + OnClick = BIDefaultClick + end + object EHint: TEdit + Left = 69 + Top = 93 + Width = 169 + Height = 21 + TabOrder = 3 + OnChange = EHintChange + end + end + object GStoredItems: TGroupBox + Left = 256 + Top = 80 + Width = 161 + Height = 258 + Caption = 'Stored Items' + TabOrder = 9 + object CBStoredGroup: TComboBox + Left = 3 + Top = 13 + Width = 154 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + OnClick = CBStoredGroupClick + end + object LBStoredItems: TdxImageListBox + Left = 4 + Top = 38 + Width = 152 + Height = 213 + Alignment = taLeftJustify + ImageAlign = dxliLeft + ItemHeight = 0 + MultiLines = True + VertAlignment = tvaCenter + DragMode = dmAutomatic + TabOrder = 1 + OnDragDrop = LBStoredItemsDragDrop + OnDragOver = LBStoredItemsDragOver + OnEndDrag = LBStoredItemsEndDrag + OnStartDrag = LBStoredItemsStartDrag + SaveStrings = () + end + end + end + object AutoOutLookPopupMenu1: TdxSideBarPopupMenu + Options = [sbmIconType, sbmAddGroup, sbmRemoveGroup, sbmRenameGroup, sbmRenameItem, sbmRemoveItem] + Left = 69 + Top = 120 + end +end diff --git a/official/x.35/ExpressSideBar/Sources/dxsbared.pas b/official/x.35/ExpressSideBar/Sources/dxsbared.pas new file mode 100644 index 00000000..07e72a87 --- /dev/null +++ b/official/x.35/ExpressSideBar/Sources/dxsbared.pas @@ -0,0 +1,598 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express side bar component editor } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE and ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL and PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS and ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE and ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ and PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxsbared; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, dximctrl, ExtCtrls, dxsbar, Menus ; + +type + TfrmdxSideBarEditor = class(TForm) + Panel3: TPanel; + Bar: TdxSideBar; + AutoOutLookPopupMenu1: TdxSideBarPopupMenu; + Panel1: TPanel; + Panel2: TPanel; + BOk: TButton; + BCancel: TButton; + bHelp: TButton; + BDefault: TButton; + BIAdd: TButton; + BIInsert: TButton; + BIDelete: TButton; + BIClear: TButton; + BIMoveUp: TButton; + BIMovedown: TButton; + GGroup: TGroupBox; + LIconType: TLabel; + BGAdd: TButton; + BGDelete: TButton; + BGRename: TButton; + CBGIType: TCheckBox; + GItemProp: TGroupBox; + LCustomData: TLabel; + ECustomData: TEdit; + LTag: TLabel; + ETag: TEdit; + SILarge: TdxSpinImage; + SISmall: TdxSpinImage; + LSILarge: TLabel; + LSISmall: TLabel; + LCaption: TLabel; + ECaption: TEdit; + BIDefault: TButton; + GStoredItems: TGroupBox; + CBStoredGroup: TComboBox; + LBStoredItems: TdxImageListBox; + Bevel1: TBevel; + EHint: TEdit; + LHint: TLabel; + BGUp: TButton; + BGDown: TButton; + cbGroupVisible: TCheckBox; + procedure FormShow(Sender: TObject); + procedure CBStoredGroupClick(Sender: TObject); + procedure BGAddClick(Sender: TObject); + procedure BIAddClick(Sender: TObject); + procedure BGRenameClick(Sender: TObject); + procedure BCancelClick(Sender: TObject); + procedure BOkClick(Sender: TObject); + procedure CBGITypeClick(Sender: TObject); + procedure BGDeleteClick(Sender: TObject); + procedure BIInsertClick(Sender: TObject); + procedure BIDeleteClick(Sender: TObject); + procedure BIClearClick(Sender: TObject); + procedure BIMoveUpClick(Sender: TObject); + procedure BIMovedownClick(Sender: TObject); + procedure LBStoredItemsStartDrag(Sender: TObject; + var DragObject: TDragObject); + procedure LBStoredItemsEndDrag(Sender, Target: TObject; X, Y: Integer); + procedure FormCreate(Sender: TObject); + procedure LBItemsDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure BDefaultClick(Sender: TObject); + procedure ECustomDataExit(Sender: TObject); + procedure ETagKeyPress(Sender: TObject; var Key: Char); + procedure ETagExit(Sender: TObject); + procedure BarChangeSelectedItem(Sender: TObject); + procedure SILargeChange(Sender: TObject; ItemIndex: Integer); + procedure SISmallChange(Sender: TObject; ItemIndex: Integer); + procedure BarChangeActiveGroup(Sender: TObject); + procedure ECaptionChange(Sender: TObject); + procedure BIDefaultClick(Sender: TObject); + procedure LBStoredItemsDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure LBStoredItemsDragDrop(Sender, Source: TObject; X, + Y: Integer); + procedure EHintChange(Sender: TObject); + procedure BGUpClick(Sender: TObject); + procedure BGDownClick(Sender: TObject); + procedure cbGroupVisibleClick(Sender: TObject); + private + OldSelectedGroup: TdxSideGroup; + OldSelectedItem: TdxSideBarItem; + procedure SelectItem; + end; + +function ShowSideBarEditor(ABar: TdxSideBar): Boolean; + +implementation + +function ShowSideBarEditor(ABar: TdxSideBar): Boolean; +var + AForm: TfrmdxSideBarEditor; + i: Integer; +begin + Result := False; + AForm := TfrmdxSideBarEditor.Create(nil); + AForm.Caption := AForm.Caption + ABar.Name; + AForm.Bar.Assign(ABar); + with AForm do + begin + if(ABar.Store = nil) then + begin + GStoredItems.Enabled := False; + CBStoredGroup.Color := clBtnFace; + LBStoredItems.Color := clBtnFace; + BDefault.Enabled := False; + BIDefault.Enabled := False; + end; + SILarge.ImageList := ABar.GetLargeImages; + SISmall.ImageList := ABar.GetSmallImages; + BGDelete.Enabled := ABar.GroupCount > 0; + BGRename.Enabled := ABar.GroupCount > 0; + BGUp.Enabled := ABar.GroupCount > 1; + BGDown.Enabled := ABar.GroupCount > 1; + for i := 0 to Bar.Groups.Count - 1 do + begin + Bar.Groups[i].Tag := Integer(Bar.Groups[i].Visible); + Bar.Groups[i].Visible := True; + end; + BarChangeActiveGroup(nil); + ShowModal; + if(ModalResult = mrOk) then begin + for i := 0 to Bar.Groups.Count - 1 do + Bar.Groups[i].Visible := Boolean(Bar.Groups[i].Tag); + ABar.Assign(Bar); + Result := True; + end; + end; + AForm.Free; +end; + +{$R *.DFM} +procedure TfrmdxSideBarEditor.SelectItem; +Var + i: Integer; +begin + if (Bar.ActiveGroup = nil) then begin + OldSelectedGroup := nil; + OldSelectedItem := nil; + exit; + end; + if (OldSelectedGroup = nil) then + OldSelectedGroup := Bar.Groups[0]; + + if(OldSelectedItem = nil) and (OldSelectedGroup.Items.Count > 0) then + Bar.SelectedItem := OldSelectedGroup.Items[0] + else + if(OldSelectedGroup.Items.Count > 0) then + Bar.SelectedItem := OldSelectedGroup.Items[OldSelectedGroup.Items.Count - 1] + else + for i := 0 to Bar.Groups.Count - 1 do + if(Bar.Groups[i].Items.Count > 0) then + begin + Bar.SelectedItem := Bar.Groups[i].Items[0]; + break; + end; + if (Bar.SelectedItem <> nil) then + begin + Bar.ActiveGroup := Bar.SelectedItem.Group; + Bar.SelectedItem.MakeVisible; + OldSelectedItem := Bar.SelectedItem; + OldSelectedGroup := Bar.ActiveGroup; + end else begin + OldSelectedGroup := nil; + OldSelectedItem := nil; + end; +end; + +procedure TfrmdxSideBarEditor.FormShow(Sender: TObject); +Var + i: Integer; +begin + BarChangeActiveGroup(nil); + BarChangeSelectedItem(nil); + BIAdd.Enabled := (Bar.Store = nil) or (Bar.Store.Count > 0); + BIInsert.Enabled := (Bar.Store = nil) or (Bar.Store.Count > 0); + if(Bar.Store <> nil) and (Bar.Store.Count > 0) then begin + LBStoredItems.ImageList := Bar.Store.LargeImages; + for i := 0 to Bar.Store.Categories.Count - 1 do + if(Bar.Store.GetCountByCategory(Bar.Store.Categories[i]) > 0) then + CBStoredGroup.Items.Add(Bar.Store.Categories[i]); + if(CBStoredGroup.Items.Count > 0) then begin + CBStoredGroup.ItemIndex := 0; + CBStoredGroupClick(Sender); + end; + end; +end; + +procedure TfrmdxSideBarEditor.CBStoredGroupClick(Sender: TObject); +Var + List: TList; + i: Integer; + item: TdxStoredSideItem; +begin + LBStoredItems.Items.Clear; + List := TList.Create; + Bar.Store.GetItemsByCategory(CBStoredGroup.Items[CBStoredGroup.ItemIndex], List); + for i := 0 to List.Count - 1 do begin + Item := TdxStoredSideItem(List[i]); + LBStoredItems.AddItem(Item.Caption, Item.LargeImage) + end; + List.Free; + LBStoredItems.ItemIndex := 0; +end; + +procedure TfrmdxSideBarEditor.BGAddClick(Sender: TObject); +Var + Group: TdxSideGroup; +begin + Group := Bar.Groups.Add; + Group.Tag := Integer(True); + Bar.EditGroup(Group); +end; + +procedure TfrmdxSideBarEditor.BIAddClick(Sender: TObject); +Var + item: TdxSideBarItem; +begin + if(Bar.ActiveGroup = nil) then + begin + Bar.Groups.Add; + Bar.Groups[0].Tag := Integer(True); + end; + Item := Bar.ActiveGroup.Items.Add; + if(Bar.Store <> nil) and (Bar.Store.Count > 0) then + Item.StoredItem := Bar.Store.GetItemByCategory( + CBStoredGroup.Items[CBStoredGroup.ItemIndex], + LBStoredItems.ItemIndex); + if(Bar.SmallImages <> nil) and (Bar.SmallImages.Count > 0) then + Item.SmallImage := 0; + if(Bar.LargeImages <> nil) and (Bar.LargeImages.Count > 0) then + Item.LargeImage := 0; + Bar.SelectedItem := Item; + Item.MakeVisible; +end; + +procedure TfrmdxSideBarEditor.BGRenameClick(Sender: TObject); +begin + if(Bar.Groups.Count > 0) then + Bar.EditGroup(Bar.Groups[Bar.ActiveGroupIndex]); +end; + +procedure TfrmdxSideBarEditor.BCancelClick(Sender: TObject); +begin + if(Bar.IsEditing) then begin + ModalResult := mrNone; + Bar.EndEdit(False); + end; +end; + +procedure TfrmdxSideBarEditor.BOkClick(Sender: TObject); +begin + if(Bar.IsEditing) then begin + ModalResult := mrNone; + Bar.EndEdit(True); + end; +end; + +procedure TfrmdxSideBarEditor.CBGITypeClick(Sender: TObject); +begin + if(Bar.Groups.Count > 0) then + if(CBGIType.Checked) then + Bar.Groups[Bar.ActiveGroupIndex].IconType := dxsgLargeIcon + else Bar.Groups[Bar.ActiveGroupIndex].IconType := dxsgSmallIcon; +end; + +procedure TfrmdxSideBarEditor.BGDeleteClick(Sender: TObject); +begin + if(Bar.Groups.Count > 0) then + Bar.Groups[Bar.ActiveGroupIndex].Free; +end; + +procedure TfrmdxSideBarEditor.BIInsertClick(Sender: TObject); +Var + item: TdxSideBarItem; +begin + if(Bar.ActiveGroup = nil) then + Bar.Groups.Add; + Item := Bar.ActiveGroup.Items.Add; + if(Bar.Store <> nil) and (Bar.Store.Count > 0) then + Item.StoredItem := Bar.Store.GetItemByCategory( + CBStoredGroup.Items[CBStoredGroup.ItemIndex], + LBStoredItems.ItemIndex); + if (Bar.SelectedItem <> nil) then + Item.Index := Bar.SelectedItem.Index + else + Item.Index := 0; + Bar.SelectedItem := Item; + Item.MakeVisible; +end; + +procedure TfrmdxSideBarEditor.BIDeleteClick(Sender: TObject); +begin + Bar.SelectedItem.Free; +end; + +procedure TfrmdxSideBarEditor.BIClearClick(Sender: TObject); +begin + Bar.ActiveGroup.Items.Clear; +end; + +procedure TfrmdxSideBarEditor.BIMoveUpClick(Sender: TObject); +begin + if (Bar.SelectedItem.Index > 0) then + begin + Bar.SelectedItem.Index := Bar.SelectedItem.Index - 1; + Bar.SelectedItem.MakeVisible; + end; +end; + +procedure TfrmdxSideBarEditor.BIMovedownClick(Sender: TObject); +begin + if (Bar.SelectedItem.Index < Bar.ActiveGroup.Items.Count - 1) then + begin + Bar.SelectedItem.Index := Bar.SelectedItem.Index + 1; + Bar.SelectedItem.MakeVisible; + end; +end; + +procedure TfrmdxSideBarEditor.LBStoredItemsStartDrag(Sender: TObject; + var DragObject: TDragObject); +begin + if (LBStoredItems.ItemIndex > -1) and (LBStoredItems.Items.Count > 0) then + dxSideBarDragObject := TdxSideBarDragObject.Create(LBStoredItems, DragObject, nil, + Bar.Store.GetItemByCategory(CBStoredGroup.Items[CBStoredGroup.ItemIndex], + LBStoredItems.ItemIndex)); +end; + +procedure TfrmdxSideBarEditor.LBStoredItemsEndDrag(Sender, + Target: TObject; X, Y: Integer); +var + groupcount: Integer; +begin + groupcount := 0; + if (dxSideBarDragObject <> nil) then + dxSideBarDragObject.EndDrag(Target, X, Y); + if (groupcount = 0) and (Bar.GroupCount = 1) then + Bar.Groups[0].Tag := 1; +end; + +procedure TfrmdxSideBarEditor.FormCreate(Sender: TObject); +begin + OldSelectedGroup := nil; + OldSelectedItem := nil; +end; + +procedure TfrmdxSideBarEditor.LBItemsDragOver(Sender, Source: TObject; + X, Y: Integer; State: TDragState; var Accept: Boolean); +begin + if ((LBStoredItems.ItemIndex = -1) and (LBStoredItems.Items.Count > 0)) + or (Bar.ActiveGroup = nil) then + Accept := False + else Accept := True; +end; + +procedure TfrmdxSideBarEditor.BDefaultClick(Sender: TObject); +Var + i, j: Integer; + fGroup: TdxSideGroup; + List: TList; + sItem: TdxStoredSideItem; + fItem: TdxSideBarItem; +begin + Bar.Groups.Clear; + List := TList.Create; + for i := 0 to Bar.Store.Categories.Count - 1 do + begin + fGroup := Bar.Groups.Add; + fGroup.Caption := Bar.Store.Categories[i]; + fGroup.Tag := Integer(True); + cbGroupVisible.Checked := True; + Bar.Store.GetItemsByCategory(Bar.Store.Categories[i], List); + for j := 0 to List.Count - 1 do + begin + sItem := TdxStoredSideItem(List[j]); + fItem := fGroup.Items.Add; + fItem.StoredItem := sItem; + end; + end; + List.Free; +end; + +procedure TfrmdxSideBarEditor.ECustomDataExit(Sender: TObject); +begin + Bar.SelectedItem.CustomData := ECustomData.Text; +end; + +procedure TfrmdxSideBarEditor.ETagKeyPress(Sender: TObject; + var Key: Char); +begin + if((Key < '0') Or (Key > '9')) and (Key <> Char(VK_BACK)) + and ((Key <> '-') Or ((ETag.Text <> '') and (ETag.Text <> ETag.SelText))) then begin + Key := #0; + MessageBeep(0); + end; +end; + +procedure TfrmdxSideBarEditor.ETagExit(Sender: TObject); +begin + if(ETag.Text = '-') then + ETag.Text := '-1'; + Bar.SelectedItem.Tag := StrToInt(ETag.Text); +end; + +procedure TfrmdxSideBarEditor.BarChangeSelectedItem(Sender: TObject); +begin + if(OldSelectedItem <> nil) then + with OldSelectedItem do begin + CustomData := ECustomData.Text; + Hint := EHint.Text; + if(ETag.Text = '-') then ETag.Text := '-1'; + if(ETag.Text = '') then ETag.Text := '0'; + Tag := StrToInt(ETag.Text); + end; + if (Bar.SelectedItem = nil) then + SelectItem + else + begin + OldSelectedItem := Bar.SelectedItem; + OldSelectedGroup := Bar.SelectedItem.Group; + end; + ECustomData.Enabled := Bar.SelectedItem <> nil; + ETag.Enabled := Bar.SelectedItem <> nil; + BIDelete.Enabled := ETag.Enabled; + BIClear.Enabled := ETag.Enabled; + BIMoveUp.Enabled := ETag.Enabled; + BIMoveDown.Enabled := ETag.Enabled; + SILarge.Enabled := ETag.Enabled; + SISmall.Enabled := ETag.Enabled; + ECaption.Enabled := ETag.Enabled; + EHint.Enabled := ETag.Enabled; + BIDefault.Enabled := ETag.Enabled and (Bar.Store <> nil) and (Bar.Store.Count > 0); + if ECustomData.Enabled then + begin + ECustomData.Text := Bar.SelectedItem.CustomData; + EHint.Text := Bar.SelectedItem.Hint; + ETag.Text := IntToStr(Bar.SelectedItem.Tag); + SILarge.ItemIndex := Bar.SelectedItem.LargeImage; + SISmall.ItemIndex := Bar.SelectedItem.SmallImage; + ECaption.Text := Bar.SelectedItem.Caption; + end + else + begin + ECustomData.Text := ''; + EHint.Text := ''; + ECaption.Text := ''; + ETag.Text := ''; + SILarge.ItemIndex := -1; + SISmall.ItemIndex := -1; + end; +end; + +procedure TfrmdxSideBarEditor.SILargeChange(Sender: TObject; + ItemIndex: Integer); +begin + if (Bar.SelectedItem <> nil) then + Bar.SelectedItem.LargeImage := ItemIndex; +end; + +procedure TfrmdxSideBarEditor.SISmallChange(Sender: TObject; + ItemIndex: Integer); +begin + if (Bar.SelectedItem <> nil) then + Bar.SelectedItem.SmallImage := ItemIndex; +end; + +procedure TfrmdxSideBarEditor.BarChangeActiveGroup(Sender: TObject); +begin + BGDelete.Enabled := Bar.ActiveGroup <> nil; + BGRename.Enabled := BGDelete.Enabled; + CBGIType.Enabled := BGDelete.Enabled; + cbGroupVisible.Enabled := BGDelete.Enabled; + if Bar.ActiveGroup <> nil then + begin + CBGIType.Checked := Bar.ActiveGroup.IconType = dxsgLargeIcon; + cbGroupVisible.Checked := Boolean(Bar.ActiveGroup.Tag); + end; +end; + +procedure TfrmdxSideBarEditor.ECaptionChange(Sender: TObject); +begin + if (Bar.SelectedItem <> nil) then + Bar.SelectedItem.Caption := ECaption.Text; +end; + +procedure TfrmdxSideBarEditor.BIDefaultClick(Sender: TObject); +begin + Bar.SelectedItem.IsDefault := True; + ECaption.Text := Bar.SelectedItem.Caption; + ECaption.Hint := Bar.SelectedItem.Hint; + SILarge.ItemIndex := Bar.SelectedItem.LargeImage; + SISmall.ItemIndex := Bar.SelectedItem.SmallImage; +end; + +procedure TfrmdxSideBarEditor.LBStoredItemsDragOver(Sender, + Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); +begin + if (Source = Bar) and (dxSideBarDragObject <> nil) then + begin + dxSideBarDragObject.DeleteItem := True; + Accept := True; + end; +end; + +procedure TfrmdxSideBarEditor.LBStoredItemsDragDrop(Sender, + Source: TObject; X, Y: Integer); +begin + if (Source = Bar) then + Bar.SelectedItem.Free; +end; + +procedure TfrmdxSideBarEditor.EHintChange(Sender: TObject); +begin + if(Bar.SelectedItem <> nil) then + Bar.SelectedItem.Hint := EHint.Text; +end; + +procedure TfrmdxSideBarEditor.BGUpClick(Sender: TObject); +var + gr: TdxSideGroup; +begin + if (Bar.ActiveGroup <> nil) and (Bar.ActiveGroup.Index > 0) then + begin + gr := Bar.ActiveGroup; + Bar.ActiveGroup.Index := Bar.ActiveGroup.Index - 1; + Bar.ActiveGroupIndex := gr.Index; + Bar.Repaint; + end; +end; + +procedure TfrmdxSideBarEditor.BGDownClick(Sender: TObject); +var + gr: TdxSideGroup; +begin + if (Bar.ActiveGroup <> nil) and (Bar.ActiveGroup.Index < Bar.Groups.Count - 1) then + begin + gr := Bar.ActiveGroup; + Bar.ActiveGroup.Index := Bar.ActiveGroup.Index + 1; + Bar.ActiveGroupIndex := gr.Index; + Bar.Repaint; + end; +end; + +procedure TfrmdxSideBarEditor.cbGroupVisibleClick(Sender: TObject); +begin + if (Bar.ActiveGroup <> nil) then + Bar.ActiveGroup.Tag := Integer(cbGroupVisible.Checked); +end; + +end. diff --git a/official/x.35/ExpressSideBar/Sources/dxsbreg.dcr b/official/x.35/ExpressSideBar/Sources/dxsbreg.dcr new file mode 100644 index 00000000..16ec80f9 Binary files /dev/null and b/official/x.35/ExpressSideBar/Sources/dxsbreg.dcr differ diff --git a/official/x.35/ExpressSideBar/Sources/dxsbreg.pas b/official/x.35/ExpressSideBar/Sources/dxsbreg.pas new file mode 100644 index 00000000..d4cc4ba6 --- /dev/null +++ b/official/x.35/ExpressSideBar/Sources/dxsbreg.pas @@ -0,0 +1,263 @@ +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express side bar controls registration } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxsbreg; + +{$I cxVer.inc} + +interface + +uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, +{$IFDEF DELPHI6} + DesignIntf, DesignEditors +{$ELSE} + DsgnIntf +{$ENDIF}; + +procedure Register; + +implementation + +uses dximctrl, dximcted, dxsppred, dxsbar, dxsbared, dxsbrsed, dxRegEd, ShellAPI; + +const + dxsbEditorName = 'Express SideBarStore Editor ...'; + dxsbDelimiter = '-'; + dxsbVersion = '5.35'; + dxsbWebSite = 'http://www.devexpress.com'; + dxsbCompanyName = 'Developer Express Inc.'; + +{TSideBarStoreEditor} +type + TSideBarStoreEditor = class(TComponentEditor) + procedure ExecuteVerb(Index: Integer); override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + end; + +procedure TSideBarStoreEditor.ExecuteVerb(Index: Integer); +begin + case Index of + 0: ShowSideBarStoreEditor(TdxSideBarStore(Component), Designer); + 3: ShellExecute(0, 'OPEN', 'http://www.devexpress.com', '', Nil, SW_SHOWMAXIMIZED); + end; +end; + +function TSideBarStoreEditor.GetVerb(Index: Integer): string; +begin + case Index of + 0: Result := dxsbEditorName; + 1: Result := dxsbDelimiter; + 2: Result := 'ExpressSideBar ' + dxsbVersion; + 3: Result := dxsbWebSite; + 4: Result := dxsbCompanyName; + end; +end; + +function TSideBarStoreEditor.GetVerbCount: Integer; +begin + Result := 5; +end; + +{TSideBarEditor} +type + TSideBarEditor = class(TComponentEditor) + procedure ExecuteVerb(Index: Integer); override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + end; + +procedure TSideBarEditor.ExecuteVerb(Index: Integer); +begin + case Index of + 0: if ShowSideBarEditor(TdxSideBar(Component)) then Designer.Modified; + 3: ShellExecute(0, 'OPEN', 'http://www.devexpress.com', '', Nil, SW_SHOWMAXIMIZED); + end; +end; + +function TSideBarEditor.GetVerb(Index: Integer): string; +begin + case Index of + 0: Result := dxsbEditorName; + 1: Result := dxsbDelimiter; + 2: Result := 'ExpressSideBar ' + dxsbVersion; + 3: Result := dxsbWebSite; + 4: Result := dxsbCompanyName; + end; +end; + +function TSideBarEditor.GetVerbCount: Integer; +begin + Result := 5; +end; + +{TSideBarStoreGroupsPropertyEditor} +type +TSideBarStoreGroupsPropertyEditor = class(TPropertyEditor) +public + function GetValue: string; override; + function GetAttributes: TPropertyAttributes; override; + procedure Edit; override; +end; + +function TSideBarStoreGroupsPropertyEditor.GetValue: string; +begin + Result := Format('(%s)', [TStrings.ClassName]); +end; + +function TSideBarStoreGroupsPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paMultiSelect, paDialog]; +end; + +procedure TSideBarStoreGroupsPropertyEditor.Edit; +begin + ShowSideBarStoreEditor(GetComponent(0) as TdxSideBarStore, Designer); +end; + +{TSideBarGroupsPropertyEditor} +type +TSideBarGroupsPropertyEditor = class(TPropertyEditor) +public + function GetValue: string; override; + function GetAttributes: TPropertyAttributes; override; + procedure Edit; override; +end; + +function TSideBarGroupsPropertyEditor.GetValue: string; +begin + Result := Format('(%s)', [TdxSideGroups.ClassName]); +end; + +function TSideBarGroupsPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paMultiSelect, paDialog]; +end; + +procedure TSideBarGroupsPropertyEditor.Edit; +begin + if ShowSideBarEditor(GetComponent(0) as TdxSideBar) then + Modified; +end; + +type +TdxImageControlItemProperties = class(TPropertyEditor) +public + function GetValue: string; override; + function GetAttributes: TPropertyAttributes; override; + procedure Edit; override; +end; + +function TdxImageControlItemProperties.GetValue: string; +begin + Result := Format('(%s)', [TStrings.ClassName]); +end; + +function TdxImageControlItemProperties.GetAttributes: TPropertyAttributes; +begin + Result := [paMultiSelect, paDialog]; +end; + +procedure TdxImageControlItemProperties.Edit; +begin + if(ExpressImageItemsPropEditor(GetComponent(0) as TWinControl)) then + Modified; +end; + +type +TdxSpinImageItemsProperties = class(TClassProperty) +public + function GetAttributes: TPropertyAttributes; override; + procedure Edit; override; +end; + +function TdxSpinImageItemsProperties.GetAttributes: TPropertyAttributes; +begin + Result := [paDialog, paReadOnly]; +end; + +procedure TdxSpinImageItemsProperties.Edit; +begin + if(ExpressSpinImageItemsPropEditor(GetComponent(0) as TdxCustomSpinImage)) then + Modified; +end; + +{ TdxRegistryPathProperty } + +type + TdxRegistryPathProperty = class(TStringProperty) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + +procedure TdxRegistryPathProperty.Edit; +var + Bar: TdxSideBar; + S: string; +begin + Bar := TdxSideBar(GetComponent(0)); + S := Bar.RegistryPath; + if dxGetRegistryPath(S) then + begin + Bar.RegistryPath := S; + Designer.Modified; + end; +end; + +function TdxRegistryPathProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog]; +end; + +procedure Register; +begin + RegisterComponents('ExpressBars', [TdxSideBarStore, TdxSideBar, TdxSideBarPopupMenu]); + RegisterNoIcon([TdxStoredSideItem]); + + RegisterComponents('ExpressBars', [TdxImageListBox, TdxImageComboBox, TdxSpinImage]); + + RegisterPropertyEditor(TypeInfo(TStrings), TdxCustomImageListBox, 'Items', TdxImageControlItemProperties); + RegisterPropertyEditor(TypeInfo(TStrings), TdxImageComboBox, 'Items', TdxImageControlItemProperties); + RegisterPropertyEditor(TypeInfo(TdxSpinImageItems), TdxCustomSpinImage, 'Items', TdxSpinImageItemsProperties); + RegisterPropertyEditor(TypeInfo(TStrings), TdxSideBarStore, 'Groups', TSideBarStoreGroupsPropertyEditor); + RegisterPropertyEditor(TypeInfo(TdxSideGroups), TdxSideBar, 'Groups', TSideBarGroupsPropertyEditor); + + RegisterPropertyEditor(TypeInfo(string), TdxSideBar, 'RegistryPath', TdxRegistryPathProperty); + + RegisterComponentEditor(TdxSideBarStore, TSideBarStoreEditor); + RegisterComponentEditor(TdxSideBar, TSideBarEditor); +end; + +end. diff --git a/official/x.35/ExpressSideBar/Sources/dxsbrgre.dfm b/official/x.35/ExpressSideBar/Sources/dxsbrgre.dfm new file mode 100644 index 00000000..461c3264 --- /dev/null +++ b/official/x.35/ExpressSideBar/Sources/dxsbrgre.dfm @@ -0,0 +1,68 @@ +object frmSideBarGroupRename: TfrmSideBarGroupRename + Left = 149 + Top = 197 + BorderIcons = [] + BorderStyle = bsDialog + ClientHeight = 84 + ClientWidth = 237 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object Bevel1: TBevel + Left = 4 + Top = 5 + Width = 227 + Height = 39 + Shape = bsFrame + end + object LGroupName: TLabel + Left = 11 + Top = 18 + Width = 63 + Height = 13 + Caption = 'Group Name:' + end + object EGroupName: TEdit + Left = 80 + Top = 13 + Width = 144 + Height = 21 + TabOrder = 0 + OnKeyUp = EGroupNameKeyUp + end + object BOk: TButton + Left = 6 + Top = 53 + Width = 72 + Height = 22 + Caption = '&OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object BCancel: TButton + Left = 83 + Top = 53 + Width = 72 + Height = 22 + Cancel = True + Caption = 'Can&cel' + ModalResult = 2 + TabOrder = 2 + end + object BHelp: TButton + Left = 160 + Top = 53 + Width = 72 + Height = 22 + Caption = '&Help' + TabOrder = 3 + end +end diff --git a/official/x.35/ExpressSideBar/Sources/dxsbrgre.pas b/official/x.35/ExpressSideBar/Sources/dxsbrgre.pas new file mode 100644 index 00000000..3e5fa412 --- /dev/null +++ b/official/x.35/ExpressSideBar/Sources/dxsbrgre.pas @@ -0,0 +1,94 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxsbrgre; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls; + +type + TfrmSideBarGroupRename = class(TForm) + Bevel1: TBevel; + LGroupName: TLabel; + EGroupName: TEdit; + BOk: TButton; + BCancel: TButton; + BHelp: TButton; + procedure EGroupNameKeyUp(Sender: TObject; var Key: Word; + Shift: TShiftState); + private + { Private declarations } + public + { Public declarations } + end; + +function ESideBarGroupRename(var GroupName : String; Kind : Integer) : Boolean; + +implementation + +function ESideBarGroupRename(var GroupName : String; Kind : Integer) : Boolean; +Var + AForm : TfrmSideBarGroupRename; +begin + AForm := TfrmSideBarGroupRename.Create(Nil); + Result := False; + with AForm do begin + case Kind of + 0: Caption := 'Add New Category'; + 1: Caption := 'Insert New Category'; + 2: Caption := 'Rename the Category'; + end; + EGroupName.Text := GroupName; + BOk.Enabled := EGroupName.Text <> ''; + ShowModal; + if(ModalResult = mrOk) then begin + GroupName := EGroupName.Text; + Result := True; + end; + end; + AForm.Free; +end; + +{$R *.DFM} + +procedure TfrmSideBarGroupRename.EGroupNameKeyUp(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + BOk.Enabled := EGroupName.Text <> ''; +end; + +end. diff --git a/official/x.35/ExpressSideBar/Sources/dxsbrsed.dfm b/official/x.35/ExpressSideBar/Sources/dxsbrsed.dfm new file mode 100644 index 00000000..d68e4a6c --- /dev/null +++ b/official/x.35/ExpressSideBar/Sources/dxsbrsed.dfm @@ -0,0 +1,321 @@ +object frmSideBarStoreEditor: TfrmSideBarStoreEditor + Left = 306 + Top = 100 + Width = 554 + Height = 368 + BorderIcons = [biSystemMenu] + BorderStyle = bsSizeToolWin + Caption = 'SideBarStore Editor:' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + OnClose = FormClose + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 0 + Top = 239 + Width = 546 + Height = 95 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + object LItemCaption: TLabel + Left = 197 + Top = 19 + Width = 36 + Height = 13 + Caption = 'Caption' + end + object LLImage: TLabel + Left = 3 + Top = 5 + Width = 59 + Height = 13 + Caption = 'Large Image' + end + object LSImage: TLabel + Left = 107 + Top = 5 + Width = 57 + Height = 13 + Caption = 'Small Image' + end + object LItemHint: TLabel + Left = 199 + Top = 46 + Width = 19 + Height = 13 + Caption = 'Hint' + end + object EItemCaption: TEdit + Tag = 2 + Left = 265 + Top = 18 + Width = 177 + Height = 24 + TabOrder = 2 + OnExit = EItemCaptionExit + end + object BClose: TButton + Left = 267 + Top = 70 + Width = 87 + Height = 21 + Caption = 'Close' + TabOrder = 4 + OnClick = BCloseClick + end + object BHelp: TButton + Left = 360 + Top = 70 + Width = 80 + Height = 21 + Caption = 'Help' + TabOrder = 5 + end + object SILImage: TdxSpinImage + Left = 4 + Top = 19 + Width = 70 + Height = 54 + AutoSize = False + BorderStyle = bsSingle + DefaultImages = True + ImageHAlign = hsiCenter + ImageVAlign = vsiCenter + Items = <> + ItemIndex = -1 + ReadOnly = False + Stretch = True + UpDownAlign = udaRight + UpDownOrientation = siVertical + UpDownWidth = 16 + UseDblClick = True + OnChange = SIImageChange + ParentColor = True + TabOrder = 0 + end + object SISImage: TdxSpinImage + Left = 107 + Top = 20 + Width = 70 + Height = 54 + AutoSize = False + BorderStyle = bsSingle + DefaultImages = True + ImageHAlign = hsiCenter + ImageVAlign = vsiCenter + Items = <> + ItemIndex = -1 + ReadOnly = False + Stretch = True + UpDownAlign = udaRight + UpDownOrientation = siVertical + UpDownWidth = 16 + UseDblClick = True + OnChange = SISImageChange + ParentColor = True + TabOrder = 1 + end + object EItemHint: TEdit + Tag = 2 + Left = 266 + Top = 44 + Width = 175 + Height = 24 + TabOrder = 3 + OnExit = EItemHintExit + end + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 90 + Height = 239 + Align = alLeft + BevelInner = bvLowered + BevelOuter = bvNone + TabOrder = 1 + object ListBox: TListBox + Left = 1 + Top = 1 + Width = 88 + Height = 237 + Align = alClient + ItemHeight = 13 + TabOrder = 0 + OnClick = ListBoxClick + OnDragOver = ListBoxDragOver + end + end + object Panel3: TPanel + Left = 90 + Top = 0 + Width = 456 + Height = 239 + Align = alClient + BevelOuter = bvNone + TabOrder = 2 + object Panel4: TPanel + Left = 0 + Top = 0 + Width = 108 + Height = 239 + Align = alLeft + BevelOuter = bvNone + Caption = 'Panel4' + TabOrder = 0 + object GBGroups: TGroupBox + Left = 0 + Top = 0 + Width = 108 + Height = 239 + Align = alClient + Caption = 'Categories' + TabOrder = 0 + object BGAdd: TButton + Left = 5 + Top = 17 + Width = 96 + Height = 21 + Caption = 'Add ...' + TabOrder = 0 + OnClick = BGAddClick + end + object BGInsert: TButton + Left = 5 + Top = 40 + Width = 96 + Height = 21 + Caption = 'Insert ...' + TabOrder = 1 + OnClick = BGInsertClick + end + object BGDelete: TButton + Left = 5 + Top = 63 + Width = 96 + Height = 21 + Caption = 'Delete' + TabOrder = 2 + OnClick = BGDeleteClick + end + object BGRename: TButton + Left = 5 + Top = 86 + Width = 96 + Height = 21 + Caption = 'Rename ...' + TabOrder = 3 + OnClick = BGRenameClick + end + object BGMoveUp: TButton + Left = 6 + Top = 110 + Width = 94 + Height = 21 + Caption = 'Move Up' + TabOrder = 4 + OnClick = BGMoveUpClick + end + object BGMoveDown: TButton + Left = 6 + Top = 134 + Width = 94 + Height = 21 + Caption = 'Move Down' + TabOrder = 5 + OnClick = BGMoveDownClick + end + end + end + object Panel5: TPanel + Left = 342 + Top = 0 + Width = 114 + Height = 239 + Align = alRight + BevelOuter = bvNone + Caption = 'Panel5' + TabOrder = 2 + object GBItems: TGroupBox + Left = 0 + Top = 0 + Width = 114 + Height = 239 + Align = alClient + Caption = 'Items' + TabOrder = 0 + object BIAdd: TButton + Left = 5 + Top = 17 + Width = 105 + Height = 21 + Caption = 'Add' + TabOrder = 0 + OnClick = BIAddClick + end + object BIDelete: TButton + Left = 5 + Top = 40 + Width = 105 + Height = 21 + Caption = 'Delete' + TabOrder = 1 + OnClick = BIDeleteClick + end + object BIClear: TButton + Left = 5 + Top = 63 + Width = 105 + Height = 21 + Caption = 'Clear' + TabOrder = 2 + OnClick = BIClearClick + end + object BIMoveUp: TButton + Left = 6 + Top = 87 + Width = 103 + Height = 21 + Caption = 'Move Up' + TabOrder = 3 + OnClick = BIMoveUpClick + end + object BIMoveDown: TButton + Left = 7 + Top = 110 + Width = 103 + Height = 21 + Caption = 'Move Down' + TabOrder = 4 + OnClick = BIMoveDownClick + end + end + end + object ImageListBox: TdxImageListBox + Left = 108 + Top = 0 + Width = 234 + Height = 239 + Alignment = taLeftJustify + ImageAlign = dxliLeft + ItemHeight = 0 + MultiLines = True + VertAlignment = tvaCenter + Align = alClient + DragMode = dmAutomatic + TabOrder = 1 + OnClick = ImageListBoxClick + OnDragOver = ImageListBoxDragOver + OnEndDrag = ImageListBoxEndDrag + SaveStrings = () + end + end +end diff --git a/official/x.35/ExpressSideBar/Sources/dxsbrsed.pas b/official/x.35/ExpressSideBar/Sources/dxsbrsed.pas new file mode 100644 index 00000000..8ee44e7a --- /dev/null +++ b/official/x.35/ExpressSideBar/Sources/dxsbrsed.pas @@ -0,0 +1,570 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE and ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL and PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS and ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE and ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ and PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxsbrsed; + +interface +{$I cxVer.inc} + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, dximctrl, ExtCtrls, dxsbar, + {$IFDEF DELPHI6} + DesignIntf + {$ELSE} + DsgnIntf + {$ENDIF}; + +type + TfrmSideBarStoreEditor = class(TdxSideBarStoreDesigner) + Panel1: TPanel; + Panel2: TPanel; + ListBox: TListBox; + LItemCaption: TLabel; + EItemCaption: TEdit; + LLImage: TLabel; + Panel3: TPanel; + Panel4: TPanel; + GBGroups: TGroupBox; + BGAdd: TButton; + BGInsert: TButton; + BGDelete: TButton; + BGRename: TButton; + BGMoveUp: TButton; + BGMoveDown: TButton; + Panel5: TPanel; + GBItems: TGroupBox; + BIAdd: TButton; + BIDelete: TButton; + BIClear: TButton; + BIMoveUp: TButton; + BIMoveDown: TButton; + LSImage: TLabel; + BClose: TButton; + BHelp: TButton; + ImageListBox: TdxImageListBox; + SILImage: TdxSpinImage; + SISImage: TdxSpinImage; + EItemHint: TEdit; + LItemHint: TLabel; + procedure BGAddClick(Sender: TObject); + procedure BGInsertClick(Sender: TObject); + procedure BGRenameClick(Sender: TObject); + procedure BGDeleteClick(Sender: TObject); + procedure ListBoxClick(Sender: TObject); + procedure BIAddClick(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure ImageListBoxClick(Sender: TObject); + procedure BGMoveUpClick(Sender: TObject); + procedure BGMoveDownClick(Sender: TObject); + procedure EItemCaptionExit(Sender: TObject); + procedure SIImageChange(Sender: TObject; ItemIndex: Integer); + procedure BIDeleteClick(Sender: TObject); + procedure BIClearClick(Sender: TObject); + procedure BIMoveUpClick(Sender: TObject); + procedure BIMoveDownClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure ImageListBoxDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure ListBoxDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure ImageListBoxEndDrag(Sender, Target: TObject; X, Y: Integer); + procedure SISImageChange(Sender: TObject; ItemIndex: Integer); + procedure BCloseClick(Sender: TObject); + procedure EItemHintExit(Sender: TObject); + private + FLockUpdate: Boolean; + ActiveItem: TdxStoredSideItem; + FDesigner: {$IFDEF DELPHI6}IDesigner{$ELSE}{$IFDEF DELPHI4}IFormDesigner{$ELSE}TFormDesigner{$ENDIF}{$ENDIF}; + procedure SelectComponent(AComponent: TComponent); + protected + procedure CloseSideBarStoreEditor; override; + procedure SideBarStoreEditorUpdate; override; + procedure SideBarStoreEditorUpdateItem(AItem: TdxStoredSideItem); override; + end; + +procedure ShowSideBarStoreEditor(AStore: TdxSideBarStore; + ADesigner: {$IFDEF DELPHI6}IDesigner{$ELSE}{$IFDEF DELPHI4}IFormDesigner{$ELSE}TFormDesigner{$ENDIF}{$ENDIF}); + +implementation + +uses dxsbrgre, dxreginf; + +{$R *.DFM} + +procedure ShowSideBarStoreEditor(AStore: TdxSideBarStore; + ADesigner: {$IFDEF DELPHI6}IDesigner{$ELSE}{$IFDEF DELPHI4}IFormDesigner{$ELSE}TFormDesigner{$ENDIF}{$ENDIF}); +var + AForm: TfrmSideBarStoreEditor; +begin + if (AStore.Designer = nil) then + begin + AStore.Designer := TfrmSideBarStoreEditor.Create(nil); + + with TfrmSideBarStoreEditor(AStore.Designer) do + begin + Constraints.MinWidth := 450; + Constraints.MinHeight := 315; + FDesigner := ADesigner; + ListBox.Items.Assign(AStore.Categories); + if (ListBox.Items.Count > 0) then + ListBox.ItemIndex := 0; + end; + end; + + AForm := TfrmSideBarStoreEditor(AStore.Designer); + AForm.Store := AStore; + AForm.SideBarStoreEditorUpdate; + AForm.ListBoxClick(nil); + AForm.Show; +end; + +procedure TfrmSideBarStoreEditor.CloseSideBarStoreEditor; +begin + Close; +end; + +procedure TfrmSideBarStoreEditor.SideBarStoreEditorUpdate; +begin + Caption := 'SideBarStore Editor:' + Store.Name; + ImageListBox.ImageList := Store.LargeImages; + SILImage.ImageList := Store.LargeImages; + SISImage.ImageList := Store.SmallImages; +end; + +procedure TfrmSideBarStoreEditor.SideBarStoreEditorUpdateItem(AItem: TdxStoredSideItem); +begin + if (AItem <> nil) then + begin + if (ListBox.ItemIndex < 0) then Exit; + if (ListBox.ItemIndex <> AItem.Category) then + begin + if (ImageListBox.Items.Count <> + Store.GetCountByCategory(ListBox.Items[ListBox.ItemIndex])) then + ListBoxClick(nil); + end else + begin + ImageListBoxClick(nil); + EItemCaptionExit(nil); + end; + end; +end; + +procedure TfrmSideBarStoreEditor.SelectComponent(AComponent: TComponent); +begin + if not (csDestroying in Store.ComponentState) and (csDesigning in Store.ComponentState) then + FDesigner.SelectComponent(AComponent); +end; + +procedure TfrmSideBarStoreEditor.BGAddClick(Sender: TObject); +var + St: String; +begin + St := ''; + if ESideBarGroupRename(St, 0) then + begin + Store.Categories.Add(St); + ListBox.Items.Add(St); + end; +end; + +procedure TfrmSideBarStoreEditor.BGInsertClick(Sender: TObject); +var + St: String; +begin + St := ''; + if ESideBarGroupRename(St, 1) then + begin + Store.Categories.Insert(ListBox.ItemIndex, St); + ListBox.Items.Insert(ListBox.ItemIndex, St); + end; +end; + +procedure TfrmSideBarStoreEditor.BGRenameClick(Sender: TObject); +var + St: String; + Index: Integer; +begin + if (ListBox.ItemIndex > -1) then + begin + Index := ListBox.ItemIndex; + St := ListBox.Items[ListBox.ItemIndex]; + if ESideBarGroupRename(St, 2) then + begin + Store.Categories[ListBox.ItemIndex] := St; + ListBox.Items[ListBox.ItemIndex] := St; + end; + ListBox.ItemIndex := Index; + end +end; + +procedure TfrmSideBarStoreEditor.BGDeleteClick(Sender: TObject); +var + Index: Integer; +begin + if (ListBox.ItemIndex > -1) then + begin + Index := ListBox.ItemIndex; + Store.Categories.Delete(ListBox.ItemIndex); + if (Store.Categories.Count <> ListBox.Items.Count) then + ListBox.Items.Delete(ListBox.ItemIndex); + if (Index >= ListBox.Items.Count) then + Dec(Index); + ListBox.ItemIndex := Index; + ListBoxClick(Sender); + end; +end; + +procedure TfrmSideBarStoreEditor.ListBoxClick(Sender: TObject); +var + List: TList; + I: Integer; + item: TdxStoredSideItem; +begin + ImageListBox.Items.Clear; + if (ListBox.ItemIndex > -1) then + begin + List := TList.Create; + Store.GetItemsByCategory(ListBox.Items[ListBox.ItemIndex], List); + for I := 0 to List.Count - 1 do + begin + Item := TdxStoredSideItem(List[I]); + ImageListBox.AddItem(Item.Caption, Item.LargeImage) + end; + List.Free; + end; + if (ImageListBox.Items.Count > 0) then + ImageListBox.ItemIndex := 0; + ImageListBoxClick(Sender); +end; + +procedure TfrmSideBarStoreEditor.BIAddClick(Sender: TObject); +var + item: TdxStoredSideItem; + I: Integer; + flag: Boolean; +begin + item := TdxStoredSideItem.Create(Store.Owner); + item.Store := Store; + item.Category := ListBox.ItemIndex; + I := Store.Count; + flag := True; + while Flag do begin + try + item.Name := Store.Name + 'Item' + IntToStr(I); + flag := False; + except + Inc(I); + end; + end; + ImageListBox.AddItem(Item.Caption, -1); + ImageListBox.ItemIndex := ImageListBox.Items.Count - 1; + ImageListBoxClick(Sender); +end; + +procedure TfrmSideBarStoreEditor.FormClose(Sender: TObject; + var Action: TCloseAction); +begin + Store.Designer := nil; + SelectComponent(Store); + StoreExpressFormsInformation(self); + Action := caFree; +end; + +procedure TfrmSideBarStoreEditor.ImageListBoxClick(Sender: TObject); +var + AComponent: TComponent; +begin + ActiveItem := nil; + if (ImageListBox.ItemIndex > -1) then + ActiveItem := Store.GetItemByCategory(ListBox.Items[ListBox.ItemIndex], ImageListBox.ItemIndex); + + EItemCaption.Enabled := ActiveItem <> nil; + EItemHint.Enabled := EItemCaption.Enabled; + SILImage.Enabled := EItemCaption.Enabled and (SILImage.ImageList <> nil); + SISImage.Enabled := EItemCaption.Enabled and (SISImage.ImageList <> nil); + if (ActiveItem <> nil) then + begin + FLockUpdate := True; + EItemCaption.Text := ActiveItem.Caption; + EItemHint.Text := ActiveItem.Hint; + SILImage.ItemIndex := ActiveItem.LargeImage; + SISImage.ItemIndex := ActiveItem.SmallImage; + FLockUpdate := False; + end else begin + EItemCaption.Text := ''; + EItemHint.Text := ''; + SILImage.ItemIndex := -1; + SISImage.ItemIndex := -1; + end; + if (Sender <> nil) then + begin + if (ActiveItem <> nil) then + AComponent := ActiveItem + else AComponent := Store; + SelectComponent(AComponent); + end; +end; + +procedure TfrmSideBarStoreEditor.BGMoveUpClick(Sender: TObject); +var + Index: Integer; +begin + if ListBox.ItemIndex > 0 then + begin + Index := ListBox.ItemIndex; + ListBox.Items.Exchange(Index, Index - 1); + Store.Categories.Exchange(Index, Index - 1); + ListBox.ItemIndex := Index - 1; + ListBoxClick(Sender); + end; +end; + +procedure TfrmSideBarStoreEditor.BGMoveDownClick(Sender: TObject); +var + Index: Integer; +begin + if ListBox.ItemIndex < ListBox.Items.Count - 1 then + begin + Index := ListBox.ItemIndex; + ListBox.Items.Exchange(Index, Index + 1); + Store.Categories.Exchange(Index, Index + 1); + ListBox.ItemIndex := Index + 1; + ListBoxClick(Sender); + end; +end; + +procedure TfrmSideBarStoreEditor.EItemCaptionExit(Sender: TObject); +var + Index, ImageIndex: Integer; +begin + if ActiveItem <> nil then + begin + ActiveItem.Caption := EItemCaption.Text; + ImageIndex := ActiveItem.LargeImage; + Index := ImageListBox.ItemIndex; + ImageListBox.Items[ImageListBox.ItemIndex] := EItemCaption.Text; + ImageListBox.ImageIndexes[Index] := ImageIndex; + ImageListBox.ItemIndex := Index; + if (Sender <> nil) then + SelectComponent(Store); + end; +end; + +procedure TfrmSideBarStoreEditor.SIImageChange(Sender: TObject; + ItemIndex: Integer); +begin + if (ActiveItem <> nil) and not FLockUpdate then + begin + ActiveItem.LargeImage := ItemIndex; + ImageListBox.ImageIndexes[ImageListBox.ItemIndex] := ItemIndex; + if (Sender <> nil) then + SelectComponent(Store); + end; +end; + +procedure TfrmSideBarStoreEditor.BIDeleteClick(Sender: TObject); +var + Index: Integer; +begin + if ActiveItem <> nil then + begin + Index := ImageListBox.ItemIndex; + ActiveItem.Free; + ImageListBox.Items.Delete(Index); + if (Index >= ImageListBox.Items.Count) then + Dec(Index); + ImageListBox.ItemIndex := Index; + ImageListBoxClick(Sender); + end; +end; + +procedure TfrmSideBarStoreEditor.BIClearClick(Sender: TObject); +var + List: TList; + I: Integer; + item: TdxStoredSideItem; +begin + ImageListBox.Items.Clear; + if ListBox.ItemIndex > -1 then + begin + List := TList.Create; + Store.GetItemsByCategory(ListBox.Items[ListBox.ItemIndex], List); + for I := 0 to List.Count - 1 do + begin + Item := TdxStoredSideItem(List[I]); + Item.Free; + end; + List.Free; + end; + ImageListBoxClick(Sender); +end; + +procedure TfrmSideBarStoreEditor.BIMoveUpClick(Sender: TObject); +var + Index: Integer; + Item1, Item2: TdxStoredSideItem; +begin + if ImageListBox.ItemIndex > 0 then + begin + Index := ImageListBox.ItemIndex; + Item1 := Store.GetItemByCategory(ListBox.Items[ListBox.ItemIndex], Index); + Item2 := Store.GetItemByCategory(ListBox.Items[ListBox.ItemIndex], Index - 1); + ImageListBox.ExchangeItems(Index, Index - 1); + Store.ExchangeItems(Item1, Item2); + ImageListBox.ItemIndex := Index - 1; + ImageListBoxClick(Sender); + end; +end; + +procedure TfrmSideBarStoreEditor.BIMoveDownClick(Sender: TObject); +var + Index: Integer; + Item1, Item2: TdxStoredSideItem; +begin + if ImageListBox.ItemIndex < ImageListBox.Items.Count - 1 then + begin + Index := ImageListBox.ItemIndex; + Item1 := Store.GetItemByCategory(ListBox.Items[ListBox.ItemIndex], Index); + Item2 := Store.GetItemByCategory(ListBox.Items[ListBox.ItemIndex], Index + 1); + ImageListBox.ExchangeItems(Index, Index + 1); + Store.ExchangeItems(Item1, Item2); + ImageListBox.ItemIndex := Index + 1; + ImageListBoxClick(Sender); + end; +end; + +procedure TfrmSideBarStoreEditor.FormCreate(Sender: TObject); +begin + RestoreExpressFormsInformation(self); +end; + +procedure TfrmSideBarStoreEditor.ImageListBoxDragOver(Sender, + Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); +var + p: TPoint; + item: Integer; +begin + if ImageListBox.ItemIndex = -1 then Exit; + Accept := False; + p.x := X; + p.y := Y; + item := ImageListBox.ItemAtPos(p, True); + if (item > -1) and (item < ImageListBox.Items.Count) then + Accept := not ImageListBox.Selected[Item]; +end; + +procedure TfrmSideBarStoreEditor.ListBoxDragOver(Sender, + Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); +var + p: TPoint; + item: Integer; +begin + if ImageListBox.ItemIndex = -1 then + Exit; + Accept := False; + p.x := X; + p.y := Y; + item := ListBox.ItemAtPos(p, True); + if (item > -1) and (item < ListBox.Items.Count) then + Accept := not ListBox.Selected[Item]; +end; + +procedure TfrmSideBarStoreEditor.ImageListBoxEndDrag(Sender, + Target: TObject; X, Y: Integer); +var + p: TPoint; + item: Integer; + Index: Integer; + Item1, Item2: TdxStoredSideItem; +begin + if ImageListBox.ItemIndex = -1 then Exit; + p.x := X; + p.y := Y; + if (Target = ListBox) then + begin + item := ListBox.ItemAtPos(p, True); + if (item > -1) and (item < ListBox.Items.Count) and not ListBox.Selected[Item] then + begin + Item1 := Store.GetItemByCategory(ListBox.Items[ListBox.ItemIndex], ImageListBox.ItemIndex); + Item1.Category := item; + ListBoxClick(Sender); + end; + end; + if Target = ImageListBox then + begin + item := ImageListBox.ItemAtPos(p, True); + if (item > -1) and (item < ImageListBox.Items.Count) + and not ImageListBox.Selected[Item] then + begin + Index := ImageListBox.ItemIndex; + Item1 := Store.GetItemByCategory( + ListBox.Items[ListBox.ItemIndex], Index); + Item2 := Store.GetItemByCategory( + ListBox.Items[ListBox.ItemIndex], Item); + ImageListBox.ExchangeItems(Index, Item); + Store.ExchangeItems(Item1, Item2); + ImageListBox.ItemIndex := Item; + ImageListBoxClick(Sender); + end; + end; +end; + +procedure TfrmSideBarStoreEditor.SISImageChange(Sender: TObject; + ItemIndex: Integer); +begin + if (ActiveItem <> nil) and not FLockUpdate then + begin + ActiveItem.SmallImage := ItemIndex; + if (Sender <> nil) then + SelectComponent(Store); + end; +end; + +procedure TfrmSideBarStoreEditor.BCloseClick(Sender: TObject); +begin + Close; +end; + +procedure TfrmSideBarStoreEditor.EItemHintExit(Sender: TObject); +begin + if (ActiveItem <> nil) then + begin + ActiveItem.Hint := EItemHint.Text; + SelectComponent(Store); + end; +end; + +end. + diff --git a/official/x.35/ExpressSideBar/Sources/dxsbstrs.pas b/official/x.35/ExpressSideBar/Sources/dxsbstrs.pas new file mode 100644 index 00000000..a9cf853d --- /dev/null +++ b/official/x.35/ExpressSideBar/Sources/dxsbstrs.pas @@ -0,0 +1,45 @@ +unit dxsbstrs; + +{$I cxVer.inc} + +interface + +resourcestring + DXSB_NEWITEM = 'New item'; + + DXSB_DEFAULTGROUP = 'Default'; + DXSB_DEFAULTITEMCAPTION = 'New Item'; + DXSB_DEFAULTGROUPCAPTION = 'New Group'; + + //PopupMenu + DXSB_ADDGROUP = 'Add Group'; + DXSB_REMOVEGROUP = 'Remove Group'; + DXSB_RENAMEGROUP = 'Rename Group'; + DXSB_REMOVEITEM = 'Remove ShortCut'; + DXSB_RENAMEITEM = 'Rename ShortCut'; + DXSB_LARGEICONTYPE = 'Large Icons'; + DXSB_SMALLICONTYPE = 'Small Icons'; + DXSB_CUSTOMIZE = 'Customize...'; + DXSB_CUSTOMIZECLOSEBUTTON = 'Close'; + + DXSB_CANTDELETEGROUP = 'Can''t delete the group. It has items.'; + +type + TdxSideBarGetResourceStringFunc = function(AResString: Pointer): string; + +var + dxSideBarGetResourceStringFunc: TdxSideBarGetResourceStringFunc; + +function dxSideBarGetResourceString(AResString: Pointer): string; + +implementation + +function dxSideBarGetResourceString(AResString: Pointer): string; +begin + if Assigned(dxSideBarGetResourceStringFunc) then + Result := dxSideBarGetResourceStringFunc(AResString) + else + Result := LoadResString(AResString); +end; + +end. diff --git a/official/x.35/ExpressSideBar/Sources/dxsppred.dfm b/official/x.35/ExpressSideBar/Sources/dxsppred.dfm new file mode 100644 index 00000000..1e5778e4 --- /dev/null +++ b/official/x.35/ExpressSideBar/Sources/dxsppred.dfm @@ -0,0 +1,218 @@ +object frmSpinImagePropEditor: TfrmSpinImagePropEditor + Left = 249 + Top = 149 + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'Express SpinImage Items editor: ' + ClientHeight = 330 + ClientWidth = 279 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 203 + Top = 0 + Width = 76 + Height = 199 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object bAdd: TButton + Left = 2 + Top = 5 + Width = 72 + Height = 22 + Caption = '&Add' + TabOrder = 0 + OnClick = bAddClick + end + object bInsert: TButton + Left = 2 + Top = 30 + Width = 72 + Height = 22 + Caption = '&Insert' + TabOrder = 1 + OnClick = bInsertClick + end + object bDelete: TButton + Left = 2 + Top = 55 + Width = 72 + Height = 22 + Caption = 'De&lete' + TabOrder = 2 + OnClick = bDeleteClick + end + object bUp: TButton + Left = 2 + Top = 105 + Width = 72 + Height = 22 + Caption = 'Move &up' + TabOrder = 4 + OnClick = bUpClick + end + object bDown: TButton + Left = 2 + Top = 130 + Width = 72 + Height = 22 + Caption = 'Move d&own' + TabOrder = 5 + OnClick = bDownClick + end + object bClear: TButton + Left = 2 + Top = 80 + Width = 72 + Height = 22 + Caption = 'Clear' + TabOrder = 3 + OnClick = bClearClick + end + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 203 + Height = 199 + Align = alClient + BevelInner = bvLowered + BevelOuter = bvNone + BorderWidth = 3 + TabOrder = 2 + object ListBox: TdxImageListBox + Left = 4 + Top = 4 + Width = 195 + Height = 191 + Alignment = taLeftJustify + ImageAlign = dxliLeft + ItemHeight = 32 + MultiLines = False + VertAlignment = tvaCenter + Align = alClient + DragMode = dmAutomatic + TabOrder = 0 + OnClick = ListBoxClick + OnDragDrop = ListBoxDragDrop + OnDragOver = ListBoxDragOver + SaveStrings = () + end + end + object Panel3: TPanel + Left = 0 + Top = 199 + Width = 279 + Height = 131 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + object LabelHint: TLabel + Left = 9 + Top = 60 + Width = 19 + Height = 13 + Caption = 'Hint' + end + object LabelValue: TLabel + Left = 7 + Top = 34 + Width = 27 + Height = 13 + Caption = 'Value' + end + object LabelImageIndex: TLabel + Left = 6 + Top = 5 + Width = 58 + Height = 13 + Caption = 'Image Index' + end + object Edit1: TEdit + Left = 42 + Top = 31 + Width = 159 + Height = 21 + Enabled = False + TabOrder = 1 + OnExit = Edit1Exit + end + object Edit2: TEdit + Left = 67 + Top = 4 + Width = 133 + Height = 21 + Enabled = False + TabOrder = 0 + OnExit = Edit2Exit + OnKeyPress = Edit2KeyPress + end + object BOk: TButton + Left = 47 + Top = 102 + Width = 72 + Height = 22 + Caption = '&Ok' + Default = True + ModalResult = 1 + TabOrder = 4 + end + object bCancel: TButton + Left = 124 + Top = 102 + Width = 72 + Height = 22 + Cancel = True + Caption = '&Cancel' + ModalResult = 2 + TabOrder = 5 + end + object bHelp: TButton + Left = 202 + Top = 102 + Width = 72 + Height = 22 + Caption = '&Help' + TabOrder = 6 + end + object SpinImage: TdxSpinImage + Left = 206 + Top = 4 + Width = 69 + Height = 50 + AutoSize = False + BorderStyle = bsSingle + DefaultImages = True + ImageHAlign = hsiCenter + ImageVAlign = vsiCenter + Items = <> + ItemIndex = -1 + ReadOnly = False + Stretch = True + UpDownAlign = udaRight + UpDownOrientation = siVertical + UpDownWidth = 16 + UseDblClick = True + OnChange = SpinImageChange + Color = clWhite + TabOrder = 3 + end + object Edit3: TMemo + Left = 42 + Top = 57 + Width = 233 + Height = 38 + TabOrder = 2 + OnExit = Edit3Exit + end + end +end diff --git a/official/x.35/ExpressSideBar/Sources/dxsppred.pas b/official/x.35/ExpressSideBar/Sources/dxsppred.pas new file mode 100644 index 00000000..0d3d26fe --- /dev/null +++ b/official/x.35/ExpressSideBar/Sources/dxsppred.pas @@ -0,0 +1,312 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Express properties store editor } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSBARS AND ALL ACCOMPANYING VCL } +{ CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxsppred; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls, dximctrl; + +type + TfrmSpinImagePropEditor = class(TForm) + Panel1: TPanel; + bAdd: TButton; + bInsert: TButton; + bDelete: TButton; + Panel2: TPanel; + Panel3: TPanel; + Edit1: TEdit; + ListBox: TdxImageListBox; + bUp: TButton; + bDown: TButton; + LabelHint: TLabel; + bClear: TButton; + LabelValue: TLabel; + LabelImageIndex: TLabel; + Edit2: TEdit; + BOk: TButton; + bCancel: TButton; + bHelp: TButton; + SpinImage: TdxSpinImage; + Edit3: TMemo; + procedure Edit2KeyPress(Sender: TObject; var Key: Char); + procedure Edit2Exit(Sender: TObject); + procedure bAddClick(Sender: TObject); + procedure bInsertClick(Sender: TObject); + procedure bDeleteClick(Sender: TObject); + procedure Edit1Exit(Sender: TObject); + procedure ListBoxClick(Sender: TObject); + procedure bUpClick(Sender: TObject); + procedure bDownClick(Sender: TObject); + procedure ListBoxDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure ListBoxDragDrop(Sender, Source: TObject; X, Y: Integer); + procedure bClearClick(Sender: TObject); + procedure Edit3Exit(Sender: TObject); + procedure SpinImageChange(Sender: TObject; ItemIndex: Integer); + private + public + end; + +function ExpressSpinImageItemsPropEditor(Control : TdxCustomSpinImage) : Boolean; + +implementation + +function ExpressSpinImageItemsPropEditor(Control : TdxCustomSpinImage) : Boolean; +Var + Form : TfrmSpinImagePropEditor; + Item : TdxSpinImageItem; + i : Integer; +begin + Result := False; + Form := TfrmSpinImagePropEditor.Create(Nil); + Form.Caption := Form.Caption + Control.Name; + Form.ListBox.ImageList := TdxSpinImage(Control).ImageList; + Form.SpinImage.ImageList := TdxSpinImage(Control).ImageList; + for i := 0 to Control.Items.Count - 1 do begin + Form.ListBox.AddItem(Control.Items[i].Value, Control.Items[i].ImageIndex); + Form.ListBox.Values[i] := Control.Items[i].Hint; + end; + Form.SpinImage.ItemIndex := -1; + if(Form.ListBox.Items.Count > 0) then + Form.ListBox.ItemIndex := 0; + Form.ListBoxClick(Nil); + Form.ShowModal; + if(Form.ModalResult = mrOk) then begin + Control.Items.Clear; + for i := 0 to Form.ListBox.Items.Count - 1 do begin + Item := Control.Items.Add; + with Form.ListBox do begin + Item.ImageIndex := ImageIndexes[i]; + Item.Value := Items[i]; + Item.Hint := Values[i]; + end; + end; + Result := True; + end; + Form.Free; +end; + +{$R *.DFM} + +procedure TfrmSpinImagePropEditor.Edit2KeyPress(Sender: TObject; var Key: Char); +begin + if((Key < '0') Or (Key > '9')) And (Key <> Char(VK_BACK)) + And ((Key <> '-') Or ((Edit2.Text <> '') And (Edit2.Text <> Edit2.SelText))) then begin + Key := #0; + MessageBeep(0); + end; +end; + +procedure TfrmSpinImagePropEditor.Edit2Exit(Sender: TObject); +begin + if(ListBox.ItemIndex > -1) and (ListBox.Items.Count > 0) then begin + if(Edit2.Text = '-') then + Edit2.Text := '-1'; + SpinImage.ItemIndex := StrToInt(Edit2.Text); + ListBox.ImageIndexes[ListBox.ItemIndex] := SpinImage.ItemIndex; + end; +end; + +procedure TfrmSpinImagePropEditor.bAddClick(Sender: TObject); +begin + ListBox.AddItem(IntToStr(ListBox.Items.Count), -1); + ListBox.ItemIndex := ListBox.Items.Count - 1; + ListBoxClick(Sender); + Edit2.SetFocus; +end; + +procedure TfrmSpinImagePropEditor.bInsertClick(Sender: TObject); +begin + if(ListBox.ItemIndex > -1) and (ListBox.Items.Count > 0) then begin + ListBox.InsertItem(ListBox.ItemIndex - 1, 'New Item', -1); + ListBoxClick(Sender); + Edit2.SetFocus; + end + else bAddClick(Sender); +end; + +procedure TfrmSpinImagePropEditor.bDeleteClick(Sender: TObject); +Var + index : Integer; +begin + if(ListBox.ItemIndex > -1) and (ListBox.Items.Count > 0) then begin + index := ListBox.ItemIndex; + ListBox.Items.Delete(ListBox.ItemIndex); + if(index < ListBox.Items.Count) then + ListBox.ItemIndex := index + else if (index > 0) then + ListBox.ItemIndex := index - 1; + ListBoxClick(Sender); + end; +end; + +procedure TfrmSpinImagePropEditor.Edit1Exit(Sender: TObject); +Var + index, imindex : Integer; + St : String; +begin + if(Edit1.Text <> ListBox.Items[ListBox.ItemIndex]) then begin + St := Edit1.Text; + imindex := ListBox.ImageIndexes[ListBox.ItemIndex]; + index := ListBox.ItemIndex; + ListBox.Items.Delete(index); + ListBox.InsertItem(index, St, imindex); + ListBox.ItemIndex := index; + end; +end; + +type +TtempAutoImageListBox = class(TdxImageListBox) +public + property Values; +end; + +procedure TfrmSpinImagePropEditor.ListBoxClick(Sender: TObject); +begin + Edit1.Enabled := (ListBox.ItemIndex > -1) and (ListBox.Items.Count > 0); + Edit2.Enabled := Edit1.Enabled; + SpinImage.Enabled := Edit1.Enabled; + bDelete.Enabled := Edit1.Enabled; + bUp.Enabled := Edit1.Enabled; + bDown.Enabled := Edit1.Enabled; + Edit3.Enabled := Edit1.Enabled; + if(Edit1.Enabled) then begin + Edit1.Text := ListBox.Items[ListBox.ItemIndex]; + Edit2.Text := IntToStr(ListBox.ImageIndexes[ListBox.ItemIndex]); + SpinImage.ItemIndex := ListBox.ImageIndexes[ListBox.ItemIndex]; + Edit3.Text := TtempAutoImageListBox(ListBox).Values[ListBox.ItemIndex]; + end else begin + Edit1.Text := ''; + Edit2.Text := ''; + Edit3.TExt := ''; + SpinImage.ItemIndex := -1; + end; +end; + +procedure TfrmSpinImagePropEditor.bUpClick(Sender: TObject); +Var + index, imind1, imind2 : Integer; +begin + if(ListBox.ItemIndex > 0) then begin + index := ListBox.ItemIndex; + imind1 := ListBox.ImageIndexes[index]; + imind2 := ListBox.ImageIndexes[index - 1]; + ListBox.Items.Exchange(index, index - 1); + ListBox.ImageIndexes[index - 1] := imind1; + ListBox.ImageIndexes[index] := imind2; + ListBox.ItemIndex := index - 1; + end; +end; + +procedure TfrmSpinImagePropEditor.bDownClick(Sender: TObject); +Var + index, imind1, imind2 : Integer; +begin + if(ListBox.ItemIndex < ListBox.Items.Count - 1) then begin + index := ListBox.ItemIndex; + imind1 := ListBox.ImageIndexes[index]; + imind2 := ListBox.ImageIndexes[index + 1]; + ListBox.Items.Exchange(index, index + 1); + ListBox.ImageIndexes[index + 1] := imind1; + ListBox.ImageIndexes[index] := imind2; + ListBox.ItemIndex := index + 1; + end; +end; + +procedure TfrmSpinImagePropEditor.ListBoxDragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); +Var + p : TPoint; + item : Integer; +begin + Accept := False; + p.x := X; + p.y := Y; + item := ListBox.ItemAtPos(p, True); + if(item > -1) And (item < ListBox.Items.Count) then + Accept := Not ListBox.Selected[Item]; +end; + +procedure TfrmSpinImagePropEditor.ListBoxDragDrop(Sender, Source: TObject; X, + Y: Integer); +Var + p : TPoint; + Item, Item1 : Integer; + flag : Boolean; +begin + ListBoxDragOver(Sender, Source, X, Y, dsDragLeave, flag); + if Not flag then exit; + p.x := X; + p.y := Y; + item := ListBox.ItemAtPos(p, True); + if(item > -1) And (item < ListBox.Items.Count) then begin + if(Item > ListBox.ItemIndex) then + Inc(Item); + ListBox.InsertItem(Item, ListBox.Items[ListBox.ItemIndex], + ListBox.ImageIndexes[ListBox.ItemIndex]); + item1 := ListBox.ItemIndex; + ListBox.Items.Delete(Item1); + if(Item >= Item1) then + Dec(Item); + ListBox.ItemIndex := Item; + end; +end; + +procedure TfrmSpinImagePropEditor.bClearClick(Sender: TObject); +begin + ListBox.Items.Clear; + ListBoxClick(Sender); +end; + +procedure TfrmSpinImagePropEditor.Edit3Exit(Sender: TObject); +begin + if(ListBox.ItemIndex > -1) and (ListBox.Items.Count > 0) + and (Edit3.Text <> TtempAutoImageListBox(ListBox).Values[ListBox.ItemIndex]) then + TtempAutoImageListBox(ListBox).Values[ListBox.ItemIndex] := Edit3.Text; +end; + +procedure TfrmSpinImagePropEditor.SpinImageChange(Sender: TObject; + ItemIndex: Integer); +begin + if(ListBox.ItemIndex > -1) and (ListBox.Items.Count > 0) then begin + Edit2.Text := IntToStr(ItemIndex); + Edit2Exit(Sender); + end; +end; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreC11.bpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreC11.bpk new file mode 100644 index 00000000..41d6cb70 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxSkinsCoreC11.bpl +OBJFILES = dcldxSkinsCoreC11.obj dxSkinsReg.obj +RESFILES = dcldxSkinsCoreC11.res dxSkinsReg.dcr +MAINSOURCE = dcldxSkinsCoreC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi designide.bpi dxSkinsCoreC11.bpi cxLibraryC11.bpi dclcxLibraryC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins Library by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreC11.cpp b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreC11.cpp new file mode 100644 index 00000000..a547f824 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreC11.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxSkinsCoreC11.res"); +USERES("dxSkinsReg.dcr"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEUNIT("dxSkinsReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreC11.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreC11.res new file mode 100644 index 00000000..c148247e Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD10.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD10.dpk new file mode 100644 index 00000000..75650233 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD10.dpk @@ -0,0 +1,39 @@ +package dcldxSkinsCoreD10; + +{$R *.RES} +{$R dxSkinsReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressSkins Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxSkinsCoreD10, + cxLibraryD10, + dclcxLibraryD10; + +contains + dxSkinsReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD10.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD10.res new file mode 100644 index 00000000..5d62012e Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD11.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD11.dpk new file mode 100644 index 00000000..9c4b649a --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD11.dpk @@ -0,0 +1,39 @@ +package dcldxSkinsCoreD11; + +{$R *.RES} +{$R dxSkinsReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressSkins Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxSkinsCoreD11, + cxLibraryD11, + dclcxLibraryD11; + +contains + dxSkinsReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD11.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD11.res new file mode 100644 index 00000000..a9c0ca72 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD7.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD7.dpk new file mode 100644 index 00000000..844b9d92 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD7.dpk @@ -0,0 +1,39 @@ +package dcldxSkinsCoreD7; + +{$R *.RES} +{$R dxSkinsReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressSkins Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxSkinsCoreD7, + cxLibraryVCLD7, + dclcxLibraryVCLD7; + +contains + dxSkinsReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD7.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD7.res new file mode 100644 index 00000000..1ccf7bab Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD9.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD9.dpk new file mode 100644 index 00000000..284e9b89 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD9.dpk @@ -0,0 +1,39 @@ +package dcldxSkinsCoreD9; + +{$R *.RES} +{$R dxSkinsReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressSkins Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxSkinsCoreD9, + cxLibraryD9, + dclcxLibraryD9; + +contains + dxSkinsReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD9.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD9.res new file mode 100644 index 00000000..2cb8cbfd Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsCoreD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperC11.bpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperC11.bpk new file mode 100644 index 00000000..b51af8ba --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxSkinsDesignHelperC11.bpl +OBJFILES = dcldxSkinsDesignHelperC11.obj dxSkinsDesignHelperReg.obj +RESFILES = dcldxSkinsDesignHelperC11.res +MAINSOURCE = dcldxSkinsCoreC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi designide.bpi dxSkinsCoreC11.bpi cxLibraryC11.bpi dclcxLibraryC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins Library Uses Clause Auto Fill Helper by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperC11.cpp b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperC11.cpp new file mode 100644 index 00000000..78a183e9 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dcldxSkinsDesignHelperC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("designide.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEUNIT("dxSkinsDesignHelperReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperC11.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperC11.res new file mode 100644 index 00000000..11488e56 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD10.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD10.dpk new file mode 100644 index 00000000..f78dbcc8 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD10.dpk @@ -0,0 +1,40 @@ +package dcldxSkinsDesignHelperD10; + +{$R *.RES} +{$R dxSkinsReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxSkinsCoreD10, + cxLibraryD10, + dclcxLibraryD10; + +contains + dxSkinsDesignHelperReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD10.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD10.res new file mode 100644 index 00000000..6d3b00fb Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD11.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD11.dpk new file mode 100644 index 00000000..42281a69 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD11.dpk @@ -0,0 +1,40 @@ +package dcldxSkinsDesignHelperD11; + +{$R *.RES} +{$R dxSkinsReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxSkinsCoreD11, + cxLibraryD11, + dclcxLibraryD11; + +contains + dxSkinsDesignHelperReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD11.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD11.res new file mode 100644 index 00000000..0ea1499f Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD7.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD7.dpk new file mode 100644 index 00000000..820dd118 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD7.dpk @@ -0,0 +1,40 @@ +package dcldxSkinsDesignHelperD7; + +{$R *.RES} +{$R dxSkinsReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxSkinsCoreD7, + cxLibraryVCLD7, + dclcxLibraryVCLD7; + +contains + dxSkinsDesignHelperReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD7.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD7.res new file mode 100644 index 00000000..64dd2729 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD9.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD9.dpk new file mode 100644 index 00000000..462a9c42 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD9.dpk @@ -0,0 +1,40 @@ +package dcldxSkinsDesignHelperD9; + +{$R *.RES} +{$R dxSkinsReg.dcr} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dxSkinsCoreD9, + cxLibraryD9, + dclcxLibraryD9; + +contains + dxSkinsDesignHelperReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD9.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD9.res new file mode 100644 index 00000000..8d625edc Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsDesignHelperD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterC11.bpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterC11.bpk new file mode 100644 index 00000000..bc87e1ed --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterC11.bpk @@ -0,0 +1,200 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxSkinscxPCPainterC11.bpl +OBJFILES = dcldxSkinscxPCPainterC11.obj dxSkinscxPCPainterReg.obj + +RESFILES = dcldxSkinscxPCPainterC11.res +MAINSOURCE = dcldxSkinscxPCPainterC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi designide.bpi cxPageControlC11.bpi dxSkinscxPCPainterC11.bpi dcldxSkinsDesignHelperC11.bpi dcldxSkinsCoreC11.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSkins Library Painter for PageControl by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterC11.cpp b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterC11.cpp new file mode 100644 index 00000000..4714c985 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterC11.cpp @@ -0,0 +1,19 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinscxPCPainterC11.res"); +USEPACKAGE("dxSkinscxPCPainterC11.bpi"); +USEPACKAGE("dcldxSkinsCoreC11.bpi"); +USEPACKAGE("cxPageControlC11.bpi"); +USEPACKAGE("dcldxSkinsDesignHelperC11.bpi"); +USEUNIT("dxSkinscxPCPainterReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterC11.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterC11.res new file mode 100644 index 00000000..df3f4f39 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD10.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD10.dpk new file mode 100644 index 00000000..58e0cb81 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD10.dpk @@ -0,0 +1,41 @@ +package dcldxSkinscxPCPainterD10; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for PageControl Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD10, + dcldxSkinsDesignHelperD10, + cxPageControlD10, + dxSkinscxPCPainterD10; + +contains + dxSkinscxPCPainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD10.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD10.res new file mode 100644 index 00000000..2f99c736 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD11.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD11.dpk new file mode 100644 index 00000000..4a39eb28 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD11.dpk @@ -0,0 +1,41 @@ +package dcldxSkinscxPCPainterD11; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for PageControl Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD11, + dcldxSkinsDesignHelperD11, + cxPageControlD11, + dxSkinscxPCPainterD11; + +contains + dxSkinscxPCPainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD11.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD11.res new file mode 100644 index 00000000..3b625f1a Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD7.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD7.dpk new file mode 100644 index 00000000..98a4c178 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD7.dpk @@ -0,0 +1,41 @@ +package dcldxSkinscxPCPainterD7; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for PageControl Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD7, + dcldxSkinsDesignHelperD7, + cxPageControlVCLD7, + dxSkinscxPCPainterD7; + +contains + dxSkinscxPCPainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD7.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD7.res new file mode 100644 index 00000000..a8753ed3 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD9.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD9.dpk new file mode 100644 index 00000000..411c9e61 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD9.dpk @@ -0,0 +1,41 @@ +package dcldxSkinscxPCPainterD9; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for PageControl Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD9, + dcldxSkinsDesignHelperD9, + cxPageControlD9, + dxSkinscxPCPainterD9; + +contains + dxSkinscxPCPainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD9.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD9.res new file mode 100644 index 00000000..68cf71f6 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxPCPainterD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterC11.bpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterC11.bpk new file mode 100644 index 00000000..074a6576 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterC11.bpk @@ -0,0 +1,200 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxSkinscxScheduler3PainterC11.bpl +OBJFILES = dcldxSkinscxScheduler3PainterC11.obj dxSkinscxScheduler3PainterReg.obj + +RESFILES = dcldxSkinscxScheduler3PainterC11.res +MAINSOURCE = dcldxSkinscxScheduler3PainterC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi designide.bpi cxSchedulerC11.bpi dxSkinscxScheduler3PainterC11.bpi dcldxSkinsDesignHelperC11.bpi dcldxSkinsCoreC11.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSkins Library Painter for Scheduler by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterC11.cpp b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterC11.cpp new file mode 100644 index 00000000..d4aff1ff --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterC11.cpp @@ -0,0 +1,19 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinscxSchedulerC11.res"); +USEPACKAGE("dxSkinscxScheduler3PainterC11.bpi"); +USEPACKAGE("cxSchedulerC11.bpi"); +USEPACKAGE("dcldxSkinsCoreC11.bpi"); +USEPACKAGE("dcldxSkinsDesignHelperC11.bpi"); +USEUNIT("dxSkinscxScheduler3PainterReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterC11.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterC11.res new file mode 100644 index 00000000..628314aa Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD10.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD10.dpk new file mode 100644 index 00000000..d94affa2 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD10.dpk @@ -0,0 +1,41 @@ +package dcldxSkinscxScheduler3PainterD10; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for Scheduler 3 Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD10, + dcldxSkinsDesignHelperD10, + cxSchedulerD10, + dxSkinscxScheduler3PainterD10; + +contains + dxSkinscxScheduler3PainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD10.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD10.res new file mode 100644 index 00000000..4722d598 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD11.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD11.dpk new file mode 100644 index 00000000..43c60e75 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD11.dpk @@ -0,0 +1,41 @@ +package dcldxSkinscxScheduler3PainterD11; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for Scheduler 3 Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD11, + dcldxSkinsDesignHelperD11, + cxSchedulerD11, + dxSkinscxScheduler3PainterD11; + +contains + dxSkinscxScheduler3PainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD11.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD11.res new file mode 100644 index 00000000..0e988fa1 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD7.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD7.dpk new file mode 100644 index 00000000..4f6317a6 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD7.dpk @@ -0,0 +1,41 @@ +package dcldxSkinscxScheduler3PainterD7; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for Scheduler 3 Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD7, + dcldxSkinsDesignHelperD7, + cxSchedulerD7, + dxSkinscxScheduler3PainterD7; + +contains + dxSkinscxScheduler3PainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD7.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD7.res new file mode 100644 index 00000000..6a0ed718 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD9.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD9.dpk new file mode 100644 index 00000000..30892ccc --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD9.dpk @@ -0,0 +1,41 @@ +package dcldxSkinscxScheduler3PainterD9; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for Scheduler 3 Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD9, + dcldxSkinsDesignHelperD9, + cxSchedulerD9, + dxSkinscxScheduler3PainterD9; + +contains + dxSkinscxScheduler3PainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD9.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD9.res new file mode 100644 index 00000000..54c5163a Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxScheduler3PainterD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterC11.bpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterC11.bpk new file mode 100644 index 00000000..c0429594 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterC11.bpk @@ -0,0 +1,200 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxSkinscxSchedulerPainterC11.bpl +OBJFILES = dcldxSkinscxSchedulerPainterC11.obj dxSkinscxSchedulerPainterReg.obj + +RESFILES = dcldxSkinscxSchedulerPainterC11.res +MAINSOURCE = dcldxSkinscxSchedulerPainterC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi designide.bpi cxSchedulerC11.bpi dxSkinscxSchedulerPainterC11.bpi dcldxSkinsDesignHelperC11.bpi dcldxSkinsCoreC11.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSkins Library Painter for Scheduler by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterC11.cpp b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterC11.cpp new file mode 100644 index 00000000..48c1f749 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterC11.cpp @@ -0,0 +1,19 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinscxSchedulerC11.res"); +USEPACKAGE("cxSchedulerC11.bpi"); +USEPACKAGE("dxSkinscxSchedulerPainterC11.bpi"); +USEPACKAGE("dcldxSkinsCoreC11.bpi"); +USEPACKAGE("dcldxSkinsDesignHelperC11.bpi"); +USEUNIT("dxSkinscxSchedulerPainterReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterC11.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterC11.res new file mode 100644 index 00000000..295d69f3 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD10.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD10.dpk new file mode 100644 index 00000000..27f479a4 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD10.dpk @@ -0,0 +1,41 @@ +package dcldxSkinscxSchedulerPainterD10; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for Scheduler Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD10, + dcldxSkinsDesignHelperD10, + cxSchedulerD10, + dxSkinscxSchedulerPainterD10; + +contains + dxSkinscxSchedulerPainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD10.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD10.res new file mode 100644 index 00000000..c559eff2 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD11.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD11.dpk new file mode 100644 index 00000000..42da64da --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD11.dpk @@ -0,0 +1,41 @@ +package dcldxSkinscxSchedulerPainterD11; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for Scheduler Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD11, + dcldxSkinsDesignHelperD11, + cxSchedulerD11, + dxSkinscxSchedulerPainterD11; + +contains + dxSkinscxSchedulerPainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD11.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD11.res new file mode 100644 index 00000000..98399c83 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD7.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD7.dpk new file mode 100644 index 00000000..486bf487 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD7.dpk @@ -0,0 +1,41 @@ +package dcldxSkinscxSchedulerPainterD7; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for Scheduler Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD7, + dcldxSkinsDesignHelperD7, + cxSchedulerVCLD7, + dxSkinscxSchedulerPainterD7; + +contains + dxSkinscxSchedulerPainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD7.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD7.res new file mode 100644 index 00000000..5803b445 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD9.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD9.dpk new file mode 100644 index 00000000..e36cb967 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD9.dpk @@ -0,0 +1,41 @@ +package dcldxSkinscxSchedulerPainterD9; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for Scheduler Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD9, + dcldxSkinsDesignHelperD9, + cxSchedulerD9, + dxSkinscxSchedulerPainterD9; + +contains + dxSkinscxSchedulerPainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD9.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD9.res new file mode 100644 index 00000000..37ea95a7 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinscxSchedulerPainterD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersC11.bpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersC11.bpk new file mode 100644 index 00000000..39ee2c7f --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersC11.bpk @@ -0,0 +1,197 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxSkinsdxBarsPaintersC11.bpl +OBJFILES = dcldxSkinsdxBarsPaintersC11.obj dxSkinsdxBarsPaintersReg.obj +RESFILES = dcldxSkinsdxBarsPaintersC11.res +MAINSOURCE = dcldxSkinsdxBarsPaintersC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi designide.bpi dxSkinsCoreC11.bpi dxBarC11.bpi \ + dcldxSkinsDesignHelperC11.bpi dcldxSkinsCoreC11.bpi dxRibbonC11.bpi \ + dxSkinsdxBarPainterC11.bpi dxSkinsdxDLPainterC11.bpi dxSkinsdxRibbonPainterC11.bpi dxDockingC11.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# ---------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSkins Library Painter for Bars by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersC11.cpp b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersC11.cpp new file mode 100644 index 00000000..ff15c1b5 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersC11.cpp @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinsdxBarPainterC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxDockingC11.bpi"); +USEPACKAGE("dxSkinsdxRibbonPainterC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEPACKAGE("dxRibbonC11.bpi"); +USEPACKAGE("dxSkinsdxDLPainterC11.bpi"); +USEPACKAGE("dxBarC11.bpi"); +USEPACKAGE("dxSkinsdxBarPainterC11.bpi"); +USEPACKAGE("dcldxSkinsCoreC11.bpi"); +USEPACKAGE("dcldxSkinsDesignHelperC11.bpi"); +USEUNIT("dxSkinsdxBarsPaintersReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- \ No newline at end of file diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersC11.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersC11.res new file mode 100644 index 00000000..9b7463f6 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD10.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD10.dpk new file mode 100644 index 00000000..0c7d33fd --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD10.dpk @@ -0,0 +1,45 @@ +package dcldxSkinsdxBarsPaintersD7; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for Bars Painters by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD10, + dcldxSkinsDesignHelperD10, + dxBarD10, + dxRibbonD10, + dxDockingD10, + dxSkinsdxBarPainterD10, + dxSkinsdxRibbonPainterD10, + dxSkinsdxDLPainterD10; + +contains + dxSkinsdxBarsPaintersReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD10.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD10.res new file mode 100644 index 00000000..1c04e6a4 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD11.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD11.dpk new file mode 100644 index 00000000..a314655d --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD11.dpk @@ -0,0 +1,45 @@ +package dcldxSkinsdxBarsPaintersD7; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for Bars Painters by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD11, + dcldxSkinsDesignHelperD11, + dxBarD11, + dxRibbonD11, + dxDockingD11, + dxSkinsdxBarPainterD11, + dxSkinsdxRibbonPainterD11, + dxSkinsdxDLPainterD11; + +contains + dxSkinsdxBarsPaintersReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD11.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD11.res new file mode 100644 index 00000000..8176da91 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD7.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD7.dpk new file mode 100644 index 00000000..7f6bc5e5 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD7.dpk @@ -0,0 +1,45 @@ +package dcldxSkinsdxBarsPaintersD7; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for Bars Painters by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD7, + dcldxSkinsDesignHelperD7, + dxBarD7, + dxRibbonD7, + dxDockingD7, + dxSkinsdxBarPainterD7, + dxSkinsdxRibbonPainterD7, + dxSkinsdxDLPainterD7; + +contains + dxSkinsdxBarsPaintersReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD7.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD7.res new file mode 100644 index 00000000..86bc180d Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD9.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD9.dpk new file mode 100644 index 00000000..9a1406fc --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD9.dpk @@ -0,0 +1,45 @@ +package dcldxSkinsdxBarsPaintersD7; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for Bars Painters by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD9, + dcldxSkinsDesignHelperD9, + dxBarD9, + dxRibbonD9, + dxDockingD9, + dxSkinsdxBarPainterD9, + dxSkinsdxRibbonPainterD9, + dxSkinsdxDLPainterD9; + +contains + dxSkinsdxBarsPaintersReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD9.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD9.res new file mode 100644 index 00000000..1132c843 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxBarsPaintersD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterC11.bpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterC11.bpk new file mode 100644 index 00000000..41932be3 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterC11.bpk @@ -0,0 +1,200 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxSkinsdxLCPainterC11.bpl +OBJFILES = dcldxSkinsdxLCPainterC11.obj dxSkinsdxLCPainterReg.obj + +RESFILES = dcldxSkinsdxLCPainterC11.res +MAINSOURCE = dcldxSkinsdxLCPainterC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi designide.bpi dxLayoutControlC11.bpi dxSkinsdxLCPainterC11.bpi dcldxSkinsDesignHelperC11.bpi dcldxSkinsCoreC11.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSkins Library Painter for LayoutControl by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterC11.cpp b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterC11.cpp new file mode 100644 index 00000000..1d1d36f4 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterC11.cpp @@ -0,0 +1,19 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinsdxLCPainterC11.res"); +USEPACKAGE("dxLayoutControlC11.bpi"); +USEPACKAGE("dxSkinsdxLCPainterC11.bpi"); +USEPACKAGE("dcldxSkinsCoreC11.bpi"); +USEPACKAGE("dcldxSkinsDesignHelperC11.bpi"); +USEUNIT("dxSkinsdxLCPainterReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterC11.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterC11.res new file mode 100644 index 00000000..6dc50960 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD10.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD10.dpk new file mode 100644 index 00000000..cf29cbae --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD10.dpk @@ -0,0 +1,41 @@ +package dcldxSkinsdxLCPainterD10; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for LayoutControl Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD10, + dcldxSkinsDesignHelperD10, + dxLayoutControlD10, + dxSkinsdxLCPainterD10; + +contains + dxSkinsdxLCPainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD10.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD10.res new file mode 100644 index 00000000..0f8823f9 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD11.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD11.dpk new file mode 100644 index 00000000..81f4d886 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD11.dpk @@ -0,0 +1,41 @@ +package dcldxSkinsdxLCPainterD11; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for LayoutControl Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD11, + dcldxSkinsDesignHelperD11, + dxLayoutControlD11, + dxSkinsdxLCPainterD11; + +contains + dxSkinsdxLCPainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD11.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD11.res new file mode 100644 index 00000000..bbeedbf5 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD7.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD7.dpk new file mode 100644 index 00000000..769d6c1c --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD7.dpk @@ -0,0 +1,41 @@ +package dcldxSkinsdxLCPainterD7; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for LayoutControl Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD7, + dcldxSkinsDesignHelperD7, + dxLayoutControlD7, + dxSkinsdxLCPainterD7; + +contains + dxSkinsdxLCPainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD7.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD7.res new file mode 100644 index 00000000..b74d4e8c Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD9.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD9.dpk new file mode 100644 index 00000000..777220a5 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD9.dpk @@ -0,0 +1,41 @@ +package dcldxSkinsdxLCPainterD9; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for LayoutControl Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD9, + dcldxSkinsDesignHelperD9, + dxLayoutControlD9, + dxSkinsdxLCPainterD9; + +contains + dxSkinsdxLCPainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD9.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD9.res new file mode 100644 index 00000000..edb668ef Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxLCPainterD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterC11.bpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterC11.bpk new file mode 100644 index 00000000..c43b1d2d --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterC11.bpk @@ -0,0 +1,199 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxSkinsdxNavBar2PainterC11.bpl +OBJFILES = dcldxSkinsdxNavBar2PainterC11.obj dxSkinsdxNavBar2PainterReg.obj +RESFILES = dcldxSkinsdxNavBar2PainterC11.res +MAINSOURCE = dcldxSkinsdxNavBar2PainterC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi designide.bpi dxNavBarC11.bpi dxSkinsdxNavBar2PainterC11.bpi dcldxSkinsDesignHelperC11.bpi dcldxSkinsCoreC11.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# ---------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSkins Library Painter for NavBar by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterC11.cpp b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterC11.cpp new file mode 100644 index 00000000..e3b1394f --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinsdxNavBar2PainterC11.res"); +USEPACKAGE("dxNavBarC11.bpi"); +USEPACKAGE("dxSkinsdxNavBar2PainterC11.bpi"); +USEPACKAGE("dcldxSkinsCoreC11.bpi"); +USEPACKAGE("dcldxSkinsDesignHelperC11.bpi"); +USEPACKAGE("dxNavBarC11.bpi"); +USEUNIT("dxSkinsdxNavBar2PainterReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterC11.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterC11.res new file mode 100644 index 00000000..54df535c Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD10.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD10.dpk new file mode 100644 index 00000000..f0865126 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD10.dpk @@ -0,0 +1,41 @@ +package dcldxSkinsdxNavBar2PainterD10; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for NavBar 2 Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dxNavBarD10, + dcldxSkinsCoreD10, + dcldxSkinsDesignHelperD10, + dxSkinsdxNavBar2PainterD10; + +contains + dxSkinsdxNavBar2PainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD10.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD10.res new file mode 100644 index 00000000..56fb6ded Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD11.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD11.dpk new file mode 100644 index 00000000..f4d4a642 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD11.dpk @@ -0,0 +1,41 @@ +package dcldxSkinsdxNavBar2PainterD11; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for NavBar 2 Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dxNavBarD11, + dcldxSkinsCoreD11, + dcldxSkinsDesignHelperD11, + dxSkinsdxNavBar2PainterD11; + +contains + dxSkinsdxNavBar2PainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD11.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD11.res new file mode 100644 index 00000000..2cf035b7 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD7.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD7.dpk new file mode 100644 index 00000000..4448d8da --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD7.dpk @@ -0,0 +1,41 @@ +package dcldxSkinsdxNavBar2PainterD7; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for NavBar 2 Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dxNavBarD7, + dcldxSkinsCoreD7, + dcldxSkinsDesignHelperD7, + dxSkinsdxNavBar2PainterD7; + +contains + dxSkinsdxNavBar2PainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD7.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD7.res new file mode 100644 index 00000000..3e63e92b Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD9.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD9.dpk new file mode 100644 index 00000000..354b8773 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD9.dpk @@ -0,0 +1,41 @@ +package dcldxSkinsdxNavBar2PainterD9; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for NavBar 2 Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dxNavBarD9, + dcldxSkinsCoreD9, + dcldxSkinsDesignHelperD9, + dxSkinsdxNavBar2PainterD9; + +contains + dxSkinsdxNavBar2PainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD9.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD9.res new file mode 100644 index 00000000..4654b73f Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBar2PainterD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterC11.bpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterC11.bpk new file mode 100644 index 00000000..01380c57 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterC11.bpk @@ -0,0 +1,199 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dcldxSkinsdxNavBarPainterC11.bpl +OBJFILES = dcldxSkinsdxNavBarPainterC11.obj dxSkinsdxNavBarPainterReg.obj +RESFILES = dcldxSkinsdxNavBarPainterC11.res +MAINSOURCE = dcldxSkinsdxNavBarPainterC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi designide.bpi dxNavBarC11.bpi dxSkinsdxNavBarPainterC11.bpi dcldxSkinsDesignHelperC11.bpi dcldxSkinsCoreC11.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# ---------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSkins Library Painter for NavBar by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterC11.cpp b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterC11.cpp new file mode 100644 index 00000000..b27fab8c --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinsdxNavBarPainterC11.res"); +USEPACKAGE("dxNavBarC11.bpi"); +USEPACKAGE("dxSkinsdxNavBarPainterC11.bpi"); +USEPACKAGE("dcldxSkinsCoreC11.bpi"); +USEPACKAGE("dcldxSkinsDesignHelperC11.bpi"); +USEPACKAGE("dxNavBarC11.bpi"); +USEUNIT("dxSkinsdxNavBarPainterReg.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterC11.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterC11.res new file mode 100644 index 00000000..57580859 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD10.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD10.dpk new file mode 100644 index 00000000..1404d343 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD10.dpk @@ -0,0 +1,41 @@ +package dcldxSkinsdxNavBarPainterD10; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for NavBar Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD10, + dcldxSkinsDesignHelperD10, + dxNavBarD10, + dxSkinsdxNavBarPainterD10; + +contains + dxSkinsdxNavBarPainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD10.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD10.res new file mode 100644 index 00000000..a2f4a19f Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD11.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD11.dpk new file mode 100644 index 00000000..ed96c24f --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD11.dpk @@ -0,0 +1,41 @@ +package dcldxSkinsdxNavBarPainterD11; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for NavBar Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD11, + dcldxSkinsDesignHelperD11, + dxNavBarD11, + dxSkinsdxNavBarPainterD11; + +contains + dxSkinsdxNavBarPainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD11.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD11.res new file mode 100644 index 00000000..e3395445 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD7.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD7.dpk new file mode 100644 index 00000000..cea6a274 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD7.dpk @@ -0,0 +1,41 @@ +package dcldxSkinsdxNavBarPainterD7; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for NavBar Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD7, + dcldxSkinsDesignHelperD7, + dxNavBarD7, + dxSkinsdxNavBarPainterD7; + +contains + dxSkinsdxNavBarPainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD7.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD7.res new file mode 100644 index 00000000..0079b8ef Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD9.dpk b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD9.dpk new file mode 100644 index 00000000..f00e9874 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD9.dpk @@ -0,0 +1,41 @@ +package dcldxSkinsdxNavBarPainterD9; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Uses Clause Auto Fill Helper for NavBar Painter by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + designide, + dcldxSkinsCoreD9, + dcldxSkinsDesignHelperD9, + dxNavBarD9, + dxSkinsdxNavBarPainterD9; + +contains + dxSkinsdxNavBarPainterReg; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD9.res b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD9.res new file mode 100644 index 00000000..ace487cb Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dcldxSkinsdxNavBarPainterD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlackC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackC11.bpk new file mode 100644 index 00000000..69f53974 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinBlackC11.bpl +OBJFILES = dxSkinBlackC11.obj dxSkinBlack.obj +RESFILES = dxSkinBlack.res +MAINSOURCE = dxSkinBlackC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxSkinsCoreC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins - Black Skin by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlackC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackC11.cpp new file mode 100644 index 00000000..78258313 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinBlack.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEUNIT("dxSkinBlack.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlackC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackC11.res new file mode 100644 index 00000000..0a8e83c0 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD10.dpk new file mode 100644 index 00000000..215b0755 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD10.dpk @@ -0,0 +1,34 @@ +package dxSkinBlackD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Black Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD10; + +contains + dxSkinBlack; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD10.res new file mode 100644 index 00000000..9490c237 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD11.dpk new file mode 100644 index 00000000..71bb294b --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD11.dpk @@ -0,0 +1,34 @@ +package dxSkinBlackD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Black Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD11; + +contains + dxSkinBlack; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD11.res new file mode 100644 index 00000000..c4ea812b Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD7.dpk new file mode 100644 index 00000000..72f72be5 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD7.dpk @@ -0,0 +1,34 @@ +package dxSkinBlackD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Black Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD7; + +contains + dxSkinBlack; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD7.res new file mode 100644 index 00000000..7e0c1d62 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD9.dpk new file mode 100644 index 00000000..ffe80981 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD9.dpk @@ -0,0 +1,34 @@ +package dxSkinBlackD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Black Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD9; + +contains + dxSkinBlack; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD9.res new file mode 100644 index 00000000..19e1d3ea Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinBlackD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlueC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueC11.bpk new file mode 100644 index 00000000..04c95fd6 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinBlueC11.bpl +OBJFILES = dxSkinBlueC11.obj dxSkinBlue.obj +RESFILES = dxSkinBlue.res +MAINSOURCE = dxSkinBlueC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxSkinsCoreC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins - Blue Skin by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlueC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueC11.cpp new file mode 100644 index 00000000..595a0ba9 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinBlue.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEUNIT("dxSkinBlue.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlueC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueC11.res new file mode 100644 index 00000000..931b53c4 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD10.dpk new file mode 100644 index 00000000..4af87830 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD10.dpk @@ -0,0 +1,34 @@ +package dxSkinBlueD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Blue Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD10; + +contains + dxSkinBlue; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD10.res new file mode 100644 index 00000000..2fce6c26 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD11.dpk new file mode 100644 index 00000000..4d90e9e6 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD11.dpk @@ -0,0 +1,34 @@ +package dxSkinBlueD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Blue Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD11; + +contains + dxSkinBlue; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD11.res new file mode 100644 index 00000000..d754b06f Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD7.dpk new file mode 100644 index 00000000..0cb15cca --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD7.dpk @@ -0,0 +1,34 @@ +package dxSkinBlueD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Blue Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD7; + +contains + dxSkinBlue; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD7.res new file mode 100644 index 00000000..897da39d Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD9.dpk new file mode 100644 index 00000000..c776db62 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD9.dpk @@ -0,0 +1,34 @@ +package dxSkinBlueD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Blue Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD9; + +contains + dxSkinBlue; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD9.res new file mode 100644 index 00000000..4320305b Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinBlueD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelC11.bpk new file mode 100644 index 00000000..bc6ab499 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinCaramelC11.bpl +OBJFILES = dxSkinCaramelC11.obj dxSkinCaramel.obj +RESFILES = dxSkinCaramel.res +MAINSOURCE = dxSkinCaramelC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxSkinsCoreC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins - Caramel Skin by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelC11.cpp new file mode 100644 index 00000000..4d370085 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinCaramel.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEUNIT("dxSkinCaramel.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelC11.res new file mode 100644 index 00000000..a15f3624 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD10.dpk new file mode 100644 index 00000000..ad164988 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD10.dpk @@ -0,0 +1,34 @@ +package dxSkinCaramelD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Caramel Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD10; + +contains + dxSkinCaramel; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD10.res new file mode 100644 index 00000000..6248647a Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD11.dpk new file mode 100644 index 00000000..45fe5a9f --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD11.dpk @@ -0,0 +1,34 @@ +package dxSkinCaramelD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Caramel Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD11; + +contains + dxSkinCaramel; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD11.res new file mode 100644 index 00000000..ccb925da Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD7.dpk new file mode 100644 index 00000000..4d473077 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD7.dpk @@ -0,0 +1,34 @@ +package dxSkinCaramelD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Caramel Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD7; + +contains + dxSkinCaramel; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD7.res new file mode 100644 index 00000000..0915b758 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD9.dpk new file mode 100644 index 00000000..aebcb986 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD9.dpk @@ -0,0 +1,34 @@ +package dxSkinCaramelD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Caramel Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD9; + +contains + dxSkinCaramel; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD9.res new file mode 100644 index 00000000..0d12ccd9 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinCaramelD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeC11.bpk new file mode 100644 index 00000000..76d08874 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinCoffeeC11.bpl +OBJFILES = dxSkinCoffeeC11.obj dxSkinCoffee.obj +RESFILES = dxSkinCoffee.res +MAINSOURCE = dxSkinCoffeeC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxSkinsCoreC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins - Coffee Skin by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeC11.cpp new file mode 100644 index 00000000..b5a062be --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinCoffee.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEUNIT("dxSkinCoffee.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeC11.res new file mode 100644 index 00000000..2cf616cd Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD10.dpk new file mode 100644 index 00000000..5a556111 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD10.dpk @@ -0,0 +1,34 @@ +package dxSkinCoffeeD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Coffee Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD10; + +contains + dxSkinCoffee; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD10.res new file mode 100644 index 00000000..b6946888 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD11.dpk new file mode 100644 index 00000000..e8854308 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD11.dpk @@ -0,0 +1,34 @@ +package dxSkinCoffeeD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Coffee Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD11; + +contains + dxSkinCoffee; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD11.res new file mode 100644 index 00000000..de88c18d Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD7.dpk new file mode 100644 index 00000000..e64517a2 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD7.dpk @@ -0,0 +1,34 @@ +package dxSkinCoffeeD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Coffee Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD7; + +contains + dxSkinCoffee; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD7.res new file mode 100644 index 00000000..93407237 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD9.dpk new file mode 100644 index 00000000..e8e2d1fc --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD9.dpk @@ -0,0 +1,34 @@ +package dxSkinCoffeeD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Coffee Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD9; + +contains + dxSkinCoffee; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD9.res new file mode 100644 index 00000000..a9e4605a Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinCoffeeD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansC11.bpk new file mode 100644 index 00000000..c99ed3d3 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinGlassOceansC11.bpl +OBJFILES = dxSkinGlassOceansC11.obj dxSkinGlassOceans.obj +RESFILES = dxSkinGlassOceans.res +MAINSOURCE = dxSkinGlassOceansC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxSkinsCoreC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins - GlassOceans Skin by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansC11.cpp new file mode 100644 index 00000000..1bf7260e --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinGlassOceans.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEUNIT("dxSkinGlassOceans.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansC11.res new file mode 100644 index 00000000..7db8c802 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD10.dpk new file mode 100644 index 00000000..d1bd07a9 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD10.dpk @@ -0,0 +1,34 @@ +package dxSkinGlassOceansD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - GlassOceans Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD10; + +contains + dxSkinGlassOceans; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD10.res new file mode 100644 index 00000000..5fdb3966 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD11.dpk new file mode 100644 index 00000000..104100b3 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD11.dpk @@ -0,0 +1,34 @@ +package dxSkinGlassOceansD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - GlassOceans Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD11; + +contains + dxSkinGlassOceans; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD11.res new file mode 100644 index 00000000..ac238a26 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD7.dpk new file mode 100644 index 00000000..e090c274 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD7.dpk @@ -0,0 +1,34 @@ +package dxSkinGlassOceansD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - GlassOceans Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD7; + +contains + dxSkinGlassOceans; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD7.res new file mode 100644 index 00000000..fff878a5 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD9.dpk new file mode 100644 index 00000000..414fc805 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD9.dpk @@ -0,0 +1,34 @@ +package dxSkinGlassOceansD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - GlassOceans Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD9; + +contains + dxSkinGlassOceans; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD9.res new file mode 100644 index 00000000..f0f1c7b0 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinGlassOceansD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLilianC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianC11.bpk new file mode 100644 index 00000000..dc47d79c --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinLilianC11.bpl +OBJFILES = dxSkinLilianC11.obj dxSkinLilian.obj +RESFILES = dxSkinLilian.res +MAINSOURCE = dxSkinLilianC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxSkinsCoreC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins - Lilian Skin by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLilianC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianC11.cpp new file mode 100644 index 00000000..1ddfdcc4 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinLilian.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEUNIT("dxSkinLilian.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLilianC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianC11.res new file mode 100644 index 00000000..dad7ed89 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD10.dpk new file mode 100644 index 00000000..8bbc584c --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD10.dpk @@ -0,0 +1,34 @@ +package dxSkinLilianD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Lilian Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD10; + +contains + dxSkinLilian; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD10.res new file mode 100644 index 00000000..3b0e04de Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD11.dpk new file mode 100644 index 00000000..6d53a1f5 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD11.dpk @@ -0,0 +1,34 @@ +package dxSkinLilianD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Lilian Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD11; + +contains + dxSkinLilian; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD11.res new file mode 100644 index 00000000..3fccff5d Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD7.dpk new file mode 100644 index 00000000..5d36ec42 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD7.dpk @@ -0,0 +1,34 @@ +package dxSkinLilianD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Lilian Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD7; + +contains + dxSkinLilian; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD7.res new file mode 100644 index 00000000..9ec59317 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD9.dpk new file mode 100644 index 00000000..94659b28 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD9.dpk @@ -0,0 +1,34 @@ +package dxSkinLilianD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Lilian Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD9; + +contains + dxSkinLilian; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD9.res new file mode 100644 index 00000000..205b2a2a Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinLilianD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyC11.bpk new file mode 100644 index 00000000..69df4034 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinLiquidSkyC11.bpl +OBJFILES = dxSkinLiquidSkyC11.obj dxSkinLiquidSky.obj +RESFILES = dxSkinLiquidSky.res +MAINSOURCE = dxSkinLiquidSkyC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxSkinsCoreC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins - LiquidSky Skin by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyC11.cpp new file mode 100644 index 00000000..fa3e1de4 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinLiquidSky.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEUNIT("dxSkinLiquidSky.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyC11.res new file mode 100644 index 00000000..59389448 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD10.dpk new file mode 100644 index 00000000..2f809dd7 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD10.dpk @@ -0,0 +1,34 @@ +package dxSkinLiquidSkyD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - LiquidSky Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD10; + +contains + dxSkinLiquidSky; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD10.res new file mode 100644 index 00000000..cae293b0 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD11.dpk new file mode 100644 index 00000000..8b6db894 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD11.dpk @@ -0,0 +1,34 @@ +package dxSkinLiquidSkyD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - LiquidSky Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD11; + +contains + dxSkinLiquidSky; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD11.res new file mode 100644 index 00000000..0c52c866 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD7.dpk new file mode 100644 index 00000000..606d5be4 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD7.dpk @@ -0,0 +1,34 @@ +package dxSkinLiquidSkyD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - LiquidSky Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD7; + +contains + dxSkinLiquidSky; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD7.res new file mode 100644 index 00000000..03aa2509 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD9.dpk new file mode 100644 index 00000000..a16d86b3 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD9.dpk @@ -0,0 +1,34 @@ +package dxSkinLiquidSkyD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - LiquidSky Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD9; + +contains + dxSkinLiquidSky; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD9.res new file mode 100644 index 00000000..0e6839d4 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinLiquidSkyD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyC11.bpk new file mode 100644 index 00000000..cba92ffe --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinLondonLiquidSkyC11.bpl +OBJFILES = dxSkinLondonLiquidSkyC11.obj dxSkinLondonLiquidSky.obj +RESFILES = dxSkinLondonLiquidSky.res +MAINSOURCE = dxSkinLondonLiquidSkyC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxSkinsCoreC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins - LondonLiquidSky Skin by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyC11.cpp new file mode 100644 index 00000000..3ad0073b --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinLondonLiquidSky.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEUNIT("dxSkinLondonLiquidSky.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyC11.res new file mode 100644 index 00000000..9e9b86cc Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD10.dpk new file mode 100644 index 00000000..51b35174 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD10.dpk @@ -0,0 +1,34 @@ +package dxSkinLondonLiquidSkyD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - LondonLiquidSky Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD10; + +contains + dxSkinLondonLiquidSky; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD10.res new file mode 100644 index 00000000..7abb2de3 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD11.dpk new file mode 100644 index 00000000..81a9ea4b --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD11.dpk @@ -0,0 +1,34 @@ +package dxSkinLondonLiquidSkyD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - LondonLiquidSky Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD11; + +contains + dxSkinLondonLiquidSky; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD11.res new file mode 100644 index 00000000..1c0142db Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD7.dpk new file mode 100644 index 00000000..e42ab87a --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD7.dpk @@ -0,0 +1,34 @@ +package dxSkinLondonLiquidSkyD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - LondonLiquidSky Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD7; + +contains + dxSkinLondonLiquidSky; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD7.res new file mode 100644 index 00000000..219edbee Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD9.dpk new file mode 100644 index 00000000..ed1bbce5 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD9.dpk @@ -0,0 +1,34 @@ +package dxSkinLondonLiquidSkyD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - LondonLiquidSky Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD9; + +contains + dxSkinLondonLiquidSky; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD9.res new file mode 100644 index 00000000..937cef43 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinLondonLiquidSkyD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinC11.bpk new file mode 100644 index 00000000..a675a58e --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinMcSkinC11.bpl +OBJFILES = dxSkinMcSkinC11.obj dxSkinMcSkin.obj +RESFILES = dxSkinMcSkin.res +MAINSOURCE = dxSkinMcSkinC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxSkinsCoreC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins - McSkin Skin by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinC11.cpp new file mode 100644 index 00000000..87373768 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinMcSkin.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEUNIT("dxSkinMcSkin.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinC11.res new file mode 100644 index 00000000..7b98d025 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD10.dpk new file mode 100644 index 00000000..c9be4781 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD10.dpk @@ -0,0 +1,34 @@ +package dxSkinMcSkinD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - McSkin Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD10; + +contains + dxSkinMcSkin; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD10.res new file mode 100644 index 00000000..c022a88b Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD11.dpk new file mode 100644 index 00000000..1313750e --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD11.dpk @@ -0,0 +1,34 @@ +package dxSkinMcSkinD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - McSkin Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD11; + +contains + dxSkinMcSkin; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD11.res new file mode 100644 index 00000000..4c434962 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD7.dpk new file mode 100644 index 00000000..d797c23c --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD7.dpk @@ -0,0 +1,34 @@ +package dxSkinMcSkinD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - McSkin Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD7; + +contains + dxSkinMcSkin; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD7.res new file mode 100644 index 00000000..1901dea2 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD9.dpk new file mode 100644 index 00000000..e48a398e --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD9.dpk @@ -0,0 +1,34 @@ +package dxSkinMcSkinD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - McSkin Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD9; + +contains + dxSkinMcSkin; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD9.res new file mode 100644 index 00000000..a4841112 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinMcSkinD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsC11.bpk new file mode 100644 index 00000000..587de607 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinMoneyTwinsC11.bpl +OBJFILES = dxSkinMoneyTwinsC11.obj dxSkinMoneyTwins.obj +RESFILES = dxSkinMoneyTwins.res +MAINSOURCE = dxSkinMoneyTwinsC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxSkinsCoreC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins - MoneyTwins Skin by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsC11.cpp new file mode 100644 index 00000000..3b58d8dd --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinMoneyTwins.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEUNIT("dxSkinMoneyTwins.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsC11.res new file mode 100644 index 00000000..82f31612 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD10.dpk new file mode 100644 index 00000000..99cf0472 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD10.dpk @@ -0,0 +1,34 @@ +package dxSkinMoneyTwinsD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - MoneyTwins Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD10; + +contains + dxSkinMoneyTwins; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD10.res new file mode 100644 index 00000000..c2401b24 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD11.dpk new file mode 100644 index 00000000..5c66966e --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD11.dpk @@ -0,0 +1,34 @@ +package dxSkinMoneyTwinsD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - MoneyTwins Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD11; + +contains + dxSkinMoneyTwins; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD11.res new file mode 100644 index 00000000..c3c47a34 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD7.dpk new file mode 100644 index 00000000..cf07bcb0 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD7.dpk @@ -0,0 +1,34 @@ +package dxSkinMoneyTwinsD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - MoneyTwins Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD7; + +contains + dxSkinMoneyTwins; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD7.res new file mode 100644 index 00000000..91282c8c Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD9.dpk new file mode 100644 index 00000000..330365a0 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD9.dpk @@ -0,0 +1,34 @@ +package dxSkinMoneyTwinsD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - MoneyTwins Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD9; + +contains + dxSkinMoneyTwins; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD9.res new file mode 100644 index 00000000..800a9340 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinMoneyTwinsD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackC11.bpk new file mode 100644 index 00000000..21d4ce76 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinOffice2007BlackC11.bpl +OBJFILES = dxSkinOffice2007BlackC11.obj dxSkinOffice2007Black.obj +RESFILES = dxSkinOffice2007Black.res +MAINSOURCE = dxSkinOffice2007BlackC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxSkinsCoreC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins - Office2007Black Skin by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackC11.cpp new file mode 100644 index 00000000..3e551dd2 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinOffice2007Black.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEUNIT("dxSkinOffice2007Black.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackC11.res new file mode 100644 index 00000000..b7026d34 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD10.dpk new file mode 100644 index 00000000..ff5bca17 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD10.dpk @@ -0,0 +1,34 @@ +package dxSkinOffice2007BlackD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Office2007Black Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD10; + +contains + dxSkinOffice2007Black; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD10.res new file mode 100644 index 00000000..e31d6a60 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD11.dpk new file mode 100644 index 00000000..a42e206f --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD11.dpk @@ -0,0 +1,34 @@ +package dxSkinOffice2007BlackD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Office2007Black Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD11; + +contains + dxSkinOffice2007Black; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD11.res new file mode 100644 index 00000000..0f844b19 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD7.dpk new file mode 100644 index 00000000..09bdea34 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD7.dpk @@ -0,0 +1,34 @@ +package dxSkinOffice2007BlackD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Office2007Black Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD7; + +contains + dxSkinOffice2007Black; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD7.res new file mode 100644 index 00000000..2e7d0e68 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD9.dpk new file mode 100644 index 00000000..d7aabaa3 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD9.dpk @@ -0,0 +1,34 @@ +package dxSkinOffice2007BlackD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Office2007Black Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD9; + +contains + dxSkinOffice2007Black; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD9.res new file mode 100644 index 00000000..382d89f1 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlackD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueC11.bpk new file mode 100644 index 00000000..cb245eb4 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinOffice2007BlueC11.bpl +OBJFILES = dxSkinOffice2007BlueC11.obj dxSkinOffice2007Blue.obj +RESFILES = dxSkinOffice2007Blue.res +MAINSOURCE = dxSkinOffice2007BlueC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxSkinsCoreC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins - Office2007Blue Skin by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueC11.cpp new file mode 100644 index 00000000..a57ecf04 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinOffice2007Blue.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEUNIT("dxSkinOffice2007Blue.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueC11.res new file mode 100644 index 00000000..931cc215 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD10.dpk new file mode 100644 index 00000000..ab8dbea4 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD10.dpk @@ -0,0 +1,34 @@ +package dxSkinOffice2007BlueD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Office2007Blue Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD10; + +contains + dxSkinOffice2007Blue; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD10.res new file mode 100644 index 00000000..a66ae5d3 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD11.dpk new file mode 100644 index 00000000..5fa7471b --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD11.dpk @@ -0,0 +1,34 @@ +package dxSkinOffice2007BlueD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Office2007Blue Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD11; + +contains + dxSkinOffice2007Blue; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD11.res new file mode 100644 index 00000000..60ea7120 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD7.dpk new file mode 100644 index 00000000..069221c7 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD7.dpk @@ -0,0 +1,34 @@ +package dxSkinOffice2007BlueD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Office2007Blue Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD7; + +contains + dxSkinOffice2007Blue; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD7.res new file mode 100644 index 00000000..4e80a2a3 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD9.dpk new file mode 100644 index 00000000..c8382eb7 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD9.dpk @@ -0,0 +1,34 @@ +package dxSkinOffice2007BlueD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Office2007Blue Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD9; + +contains + dxSkinOffice2007Blue; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD9.res new file mode 100644 index 00000000..af704491 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007BlueD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenC11.bpk new file mode 100644 index 00000000..416d0be2 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinOffice2007GreenC11.bpl +OBJFILES = dxSkinOffice2007GreenC11.obj dxSkinOffice2007Green.obj +RESFILES = dxSkinOffice2007Green.res +MAINSOURCE = dxSkinOffice2007GreenC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxSkinsCoreC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins - Office2007Green Skin by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenC11.cpp new file mode 100644 index 00000000..05e633ed --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinOffice2007Green.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEUNIT("dxSkinOffice2007Green.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenC11.res new file mode 100644 index 00000000..f5cc6932 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD10.dpk new file mode 100644 index 00000000..5c964c3c --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD10.dpk @@ -0,0 +1,34 @@ +package dxSkinOffice2007GreenD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Office2007Green Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD10; + +contains + dxSkinOffice2007Green; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD10.res new file mode 100644 index 00000000..ecfb9402 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD11.dpk new file mode 100644 index 00000000..78b43e23 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD11.dpk @@ -0,0 +1,34 @@ +package dxSkinOffice2007GreenD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Office2007Green Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD11; + +contains + dxSkinOffice2007Green; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD11.res new file mode 100644 index 00000000..d298bfcb Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD7.dpk new file mode 100644 index 00000000..97d334b3 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD7.dpk @@ -0,0 +1,34 @@ +package dxSkinOffice2007GreenD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Office2007Green Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD7; + +contains + dxSkinOffice2007Green; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD7.res new file mode 100644 index 00000000..833d6fee Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD9.dpk new file mode 100644 index 00000000..97a23488 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD9.dpk @@ -0,0 +1,34 @@ +package dxSkinOffice2007GreenD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Office2007Green Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD9; + +contains + dxSkinOffice2007Green; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD9.res new file mode 100644 index 00000000..bc729d16 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007GreenD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkC11.bpk new file mode 100644 index 00000000..efd23a3e --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinOffice2007PinkC11.bpl +OBJFILES = dxSkinOffice2007PinkC11.obj dxSkinOffice2007Pink.obj +RESFILES = dxSkinOffice2007Pink.res +MAINSOURCE = dxSkinOffice2007PinkC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxSkinsCoreC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins - Office2007Pink Skin by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkC11.cpp new file mode 100644 index 00000000..2991cbe7 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinOffice2007Pink.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEUNIT("dxSkinOffice2007Pink.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkC11.res new file mode 100644 index 00000000..54ec9de2 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD10.dpk new file mode 100644 index 00000000..70a46756 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD10.dpk @@ -0,0 +1,34 @@ +package dxSkinOffice2007PinkD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Office2007Pink Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD10; + +contains + dxSkinOffice2007Pink; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD10.res new file mode 100644 index 00000000..c51c3cc1 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD11.dpk new file mode 100644 index 00000000..08fd38d7 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD11.dpk @@ -0,0 +1,34 @@ +package dxSkinOffice2007PinkD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Office2007Pink Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD11; + +contains + dxSkinOffice2007Pink; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD11.res new file mode 100644 index 00000000..76bf3721 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD7.dpk new file mode 100644 index 00000000..660c9fa0 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD7.dpk @@ -0,0 +1,34 @@ +package dxSkinOffice2007PinkD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Office2007Pink Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD7; + +contains + dxSkinOffice2007Pink; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD7.res new file mode 100644 index 00000000..76f7dc15 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD9.dpk new file mode 100644 index 00000000..353be558 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD9.dpk @@ -0,0 +1,34 @@ +package dxSkinOffice2007PinkD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Office2007Pink Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD9; + +contains + dxSkinOffice2007Pink; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD9.res new file mode 100644 index 00000000..3d9ebadc Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007PinkD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverC11.bpk new file mode 100644 index 00000000..86babf95 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinOffice2007SilverC11.bpl +OBJFILES = dxSkinOffice2007SilverC11.obj dxSkinOffice2007Silver.obj +RESFILES = dxSkinOffice2007Silver.res +MAINSOURCE = dxSkinOffice2007SilverC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxSkinsCoreC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins - Office2007Silver Skin by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverC11.cpp new file mode 100644 index 00000000..2c69bdfd --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinOffice2007Silver.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEUNIT("dxSkinOffice2007Silver.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverC11.res new file mode 100644 index 00000000..de960c4f Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD10.dpk new file mode 100644 index 00000000..6b9684d5 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD10.dpk @@ -0,0 +1,34 @@ +package dxSkinOffice2007SilverD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Office2007Silver Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD10; + +contains + dxSkinOffice2007Silver; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD10.res new file mode 100644 index 00000000..113de8bc Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD11.dpk new file mode 100644 index 00000000..e6dd5a23 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD11.dpk @@ -0,0 +1,34 @@ +package dxSkinOffice2007SilverD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Office2007Silver Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD11; + +contains + dxSkinOffice2007Silver; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD11.res new file mode 100644 index 00000000..1f20c6f8 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD7.dpk new file mode 100644 index 00000000..7e3f6783 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD7.dpk @@ -0,0 +1,34 @@ +package dxSkinOffice2007SilverD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Office2007Silver Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD7; + +contains + dxSkinOffice2007Silver; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD7.res new file mode 100644 index 00000000..3e9aa1b3 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD9.dpk new file mode 100644 index 00000000..20b76ccf --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD9.dpk @@ -0,0 +1,34 @@ +package dxSkinOffice2007SilverD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Office2007Silver Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD9; + +contains + dxSkinOffice2007Silver; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD9.res new file mode 100644 index 00000000..cf924fd6 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinOffice2007SilverD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinSilverC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverC11.bpk new file mode 100644 index 00000000..274e9b47 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinSilverC11.bpl +OBJFILES = dxSkinSilverC11.obj dxSkinSilver.obj +RESFILES = dxSkinSilver.res +MAINSOURCE = dxSkinSilverC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxSkinsCoreC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins - Silver Skin by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinSilverC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverC11.cpp new file mode 100644 index 00000000..28189784 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinSilver.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEUNIT("dxSkinSilver.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinSilverC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverC11.res new file mode 100644 index 00000000..ac5cd4b5 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD10.dpk new file mode 100644 index 00000000..30c0f7af --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD10.dpk @@ -0,0 +1,34 @@ +package dxSkinSilverD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Silver Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD10; + +contains + dxSkinSilver; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD10.res new file mode 100644 index 00000000..3cc253e7 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD11.dpk new file mode 100644 index 00000000..36a29fac --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD11.dpk @@ -0,0 +1,34 @@ +package dxSkinSilverD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Silver Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD11; + +contains + dxSkinSilver; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD11.res new file mode 100644 index 00000000..ece2e32f Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD7.dpk new file mode 100644 index 00000000..f88d796e --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD7.dpk @@ -0,0 +1,34 @@ +package dxSkinSilverD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Silver Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD7; + +contains + dxSkinSilver; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD7.res new file mode 100644 index 00000000..947149c6 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD9.dpk new file mode 100644 index 00000000..6a7d8495 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD9.dpk @@ -0,0 +1,34 @@ +package dxSkinSilverD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Silver Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD9; + +contains + dxSkinSilver; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD9.res new file mode 100644 index 00000000..144048f8 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinSilverD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinStardustC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustC11.bpk new file mode 100644 index 00000000..acc131d8 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinStardustC11.bpl +OBJFILES = dxSkinStardustC11.obj dxSkinStardust.obj +RESFILES = dxSkinStardust.res +MAINSOURCE = dxSkinStardustC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxSkinsCoreC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins - Stardust Skin by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinStardustC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustC11.cpp new file mode 100644 index 00000000..af7e0120 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinStardust.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEUNIT("dxSkinStardust.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinStardustC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustC11.res new file mode 100644 index 00000000..5f14b9ab Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD10.dpk new file mode 100644 index 00000000..d01fdd10 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD10.dpk @@ -0,0 +1,34 @@ +package dxSkinStardustD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Stardust Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD10; + +contains + dxSkinStardust; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD10.res new file mode 100644 index 00000000..9d0c0711 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD11.dpk new file mode 100644 index 00000000..738eade7 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD11.dpk @@ -0,0 +1,34 @@ +package dxSkinStardustD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Stardust Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD11; + +contains + dxSkinStardust; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD11.res new file mode 100644 index 00000000..62e0b0ba Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD7.dpk new file mode 100644 index 00000000..732b18dc --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD7.dpk @@ -0,0 +1,34 @@ +package dxSkinStardustD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Stardust Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD7; + +contains + dxSkinStardust; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD7.res new file mode 100644 index 00000000..b7e4e69f Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD9.dpk new file mode 100644 index 00000000..3ec8dd29 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD9.dpk @@ -0,0 +1,34 @@ +package dxSkinStardustD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Stardust Skin by Developer Express Inc.' } + +requires + dxSkinsCoreD9; + +contains + dxSkinStardust; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD9.res new file mode 100644 index 00000000..28fcb966 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinStardustD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinValentineC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineC11.bpk new file mode 100644 index 00000000..75c82233 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinValentineC11.bpl +OBJFILES = dxSkinValentineC11.obj dxSkinValentine.obj +RESFILES = dxSkinValentine.res +MAINSOURCE = dxSkinValentineC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxSkinsCoreC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins - Valentine Skin by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinValentineC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineC11.cpp new file mode 100644 index 00000000..d171f6db --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinValentine.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEUNIT("dxSkinValentine.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinValentineC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineC11.res new file mode 100644 index 00000000..62174291 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD10.dpk new file mode 100644 index 00000000..b15a3f33 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD10.dpk @@ -0,0 +1,34 @@ +package dxSkinValentineD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Valentine Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD10; + +contains + dxSkinValentine; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD10.res new file mode 100644 index 00000000..3f722edc Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD11.dpk new file mode 100644 index 00000000..ae21529f --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD11.dpk @@ -0,0 +1,34 @@ +package dxSkinValentineD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Valentine Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD11; + +contains + dxSkinValentine; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD11.res new file mode 100644 index 00000000..ef7c9cff Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD7.dpk new file mode 100644 index 00000000..4cd76366 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD7.dpk @@ -0,0 +1,34 @@ +package dxSkinValentineD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Valentine Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD7; + +contains + dxSkinValentine; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD7.res new file mode 100644 index 00000000..d9600878 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD9.dpk new file mode 100644 index 00000000..595c51bd --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD9.dpk @@ -0,0 +1,34 @@ +package dxSkinValentineD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Valentine Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD9; + +contains + dxSkinValentine; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD9.res new file mode 100644 index 00000000..5638e6fb Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinValentineD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueC11.bpk new file mode 100644 index 00000000..0cd085cd --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinXmas2008BlueC11.bpl +OBJFILES = dxSkinXmas2008BlueC11.obj dxSkinXmas2008Blue.obj +RESFILES = dxSkinXmas2008Blue.res +MAINSOURCE = dxSkinXmas2008BlueC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxSkinsCoreC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins - Xmas2008Blue Skin by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueC11.cpp new file mode 100644 index 00000000..7939aefb --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinXmas2008Blue.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEUNIT("dxSkinXmas2008Blue.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueC11.res new file mode 100644 index 00000000..aede2d16 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD10.dpk new file mode 100644 index 00000000..67dffa69 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD10.dpk @@ -0,0 +1,34 @@ +package dxSkinXmas2008BlueD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Xmas2008Blue Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD10; + +contains + dxSkinXmas2008Blue; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD10.res new file mode 100644 index 00000000..2dc69701 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD11.dpk new file mode 100644 index 00000000..b4885c90 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD11.dpk @@ -0,0 +1,34 @@ +package dxSkinXmas2008BlueD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Xmas2008Blue Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD11; + +contains + dxSkinXmas2008Blue; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD11.res new file mode 100644 index 00000000..a9f08c4f Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD7.dpk new file mode 100644 index 00000000..c1cb840b --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD7.dpk @@ -0,0 +1,34 @@ +package dxSkinXmas2008BlueD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Xmas2008Blue Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD7; + +contains + dxSkinXmas2008Blue; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD7.res new file mode 100644 index 00000000..cd87fc72 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD9.dpk new file mode 100644 index 00000000..85560bdc --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD9.dpk @@ -0,0 +1,34 @@ +package dxSkinXmas2008BlueD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - Xmas2008Blue Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD9; + +contains + dxSkinXmas2008Blue; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD9.res new file mode 100644 index 00000000..8fc42633 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinXmas2008BlueD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryC11.bpk new file mode 100644 index 00000000..cb0cd4ad --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkiniMaginaryC11.bpl +OBJFILES = dxSkiniMaginaryC11.obj dxSkiniMaginary.obj +RESFILES = dxSkiniMaginary.res +MAINSOURCE = dxSkiniMaginaryC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi dxSkinsCoreC11.bpi +SPARELIBS = +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressSkins - iMaginary Skin by Developer Express Inc." -aa -Tpp \ + -Gpd -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryC11.cpp new file mode 100644 index 00000000..5c164de8 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkiniMaginary.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEUNIT("dxSkiniMaginary.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryC11.res new file mode 100644 index 00000000..b4d85f86 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD10.dpk new file mode 100644 index 00000000..59cd90b7 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD10.dpk @@ -0,0 +1,34 @@ +package dxSkiniMaginaryD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - iMaginary Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD10; + +contains + dxSkiniMaginary; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD10.res new file mode 100644 index 00000000..e5f83d0d Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD11.dpk new file mode 100644 index 00000000..9e493602 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD11.dpk @@ -0,0 +1,34 @@ +package dxSkiniMaginaryD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - iMaginary Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD11; + +contains + dxSkiniMaginary; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD11.res new file mode 100644 index 00000000..bd115dcc Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD7.dpk new file mode 100644 index 00000000..1e7aad7a --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD7.dpk @@ -0,0 +1,34 @@ +package dxSkiniMaginaryD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - iMaginary Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD7; + +contains + dxSkiniMaginary; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD7.res new file mode 100644 index 00000000..5bcfa7e1 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD9.dpk new file mode 100644 index 00000000..fdf57f80 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD9.dpk @@ -0,0 +1,34 @@ +package dxSkiniMaginaryD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$IMPLICITBUILD OFF} +{$DESCRIPTION 'ExpressSkins - iMaginary Skin by Developer Express Inc.'} + +requires + dxSkinsCoreD9; + +contains + dxSkiniMaginary; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD9.res new file mode 100644 index 00000000..7e54c07d Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkiniMaginaryD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreC11.bpk new file mode 100644 index 00000000..6c510335 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreC11.bpk @@ -0,0 +1,192 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinsCoreC11.bpl +OBJFILES = dxSkinsCoreC11.obj dxSkinsLookAndFeelPainter.obj dxSkinsDefaultPainters.obj dxSkinsForm.obj +RESFILES = dxSkinsCoreC11.res +MAINSOURCE = dxSkinsCoreC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxThemeC11.bpi dxGDIPlusC11.bpi cxLibraryC11.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"ExpressSkins Library by Developer Express Inc." -aa -Tpp -Gpr -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreC11.cpp new file mode 100644 index 00000000..acabc1de --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreC11.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinsCoreC11.res"); +USEPACKAGE("dxThemeC11.bpi"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("dxGDIPlusC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEUNIT("dxSkinsCore.pas"); +USEUNIT("dxSkinsForm.pas"); +USEUNIT("dxSkinsDefaultPainters.pas"); +USEUNIT("dxSkinsLookAndFeelPainter.pas"); +USEUNIT("dxSkinsStrs.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreC11.res new file mode 100644 index 00000000..2432d0f1 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD10.dpk new file mode 100644 index 00000000..89c269b1 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD10.dpk @@ -0,0 +1,41 @@ +package dxSkinsCoreD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressSkins Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxGDIPlusD10, + dxThemeD10, + cxLibraryD10; + +contains + dxSkinsDefaultPainters, + dxSkinsLookAndFeelPainter, + dxSkinsForm; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD10.res new file mode 100644 index 00000000..9995ce75 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD11.dpk new file mode 100644 index 00000000..1b94d134 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD11.dpk @@ -0,0 +1,41 @@ +package dxSkinsCoreD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressSkins Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxGDIPlusD11, + dxThemeD11, + cxLibraryD11; + +contains + dxSkinsDefaultPainters, + dxSkinsLookAndFeelPainter, + dxSkinsForm; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD11.res new file mode 100644 index 00000000..87f83d0d Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD7.dpk new file mode 100644 index 00000000..9a6b0682 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD7.dpk @@ -0,0 +1,41 @@ +package dxSkinsCoreD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressSkins Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxGDIPlusD7, + dxThemeD7, + cxLibraryVCLD7; + +contains + dxSkinsDefaultPainters, + dxSkinsLookAndFeelPainter, + dxSkinsForm; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD7.res new file mode 100644 index 00000000..bac7ca13 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD9.dpk new file mode 100644 index 00000000..3c72d232 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD9.dpk @@ -0,0 +1,41 @@ +package dxSkinsCoreD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'ExpressSkins Library by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxGDIPlusD9, + dxThemeD9, + cxLibraryD9; + +contains + dxSkinsDefaultPainters, + dxSkinsLookAndFeelPainter, + dxSkinsForm; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD9.res new file mode 100644 index 00000000..38b520cb Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsCoreD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterC11.bpk new file mode 100644 index 00000000..f2c53bae --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterC11.bpk @@ -0,0 +1,200 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinscxPCPainterC11.bpl +OBJFILES = dxSkinscxPCPainterC11.obj dxSkinscxPCPainter.obj + +RESFILES = dxSkinscxPCPainterC11.res +MAINSOURCE = dxSkinscxPCPainterC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxSkinsCoreC11.bpi cxPageControlC11.bpi cxLibraryC11.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSkins Library Painter for PageControl by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterC11.cpp new file mode 100644 index 00000000..bd7073e1 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinscxPCPainterC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEPACKAGE("cxPageControlC11.bpi"); +USEUNIT("dxSkinscxPCPainter.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterC11.res new file mode 100644 index 00000000..fdff6347 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD10.dpk new file mode 100644 index 00000000..0f91bb2c --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD10.dpk @@ -0,0 +1,37 @@ +package dxSkinscxPCPainterD10; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for PageControl by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD10, + cxPageControlD10; + +contains + dxSkinscxPCPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD10.res new file mode 100644 index 00000000..c82a103c Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD11.dpk new file mode 100644 index 00000000..02d0bc73 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD11.dpk @@ -0,0 +1,37 @@ +package dxSkinscxPCPainterD11; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for PageControl by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD11, + cxPageControlD11; + +contains + dxSkinscxPCPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD11.res new file mode 100644 index 00000000..e4aded06 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD7.dpk new file mode 100644 index 00000000..fe892602 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD7.dpk @@ -0,0 +1,37 @@ +package dxSkinscxPCPainterD7; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for PageControl by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD7, + cxPageControlVCLD7; + +contains + dxSkinscxPCPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD7.res new file mode 100644 index 00000000..da633a54 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD9.dpk new file mode 100644 index 00000000..8c15f56a --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD9.dpk @@ -0,0 +1,37 @@ +package dxSkinscxPCPainterD9; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for PageControl by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD9, + cxPageControlD9; + +contains + dxSkinscxPCPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD9.res new file mode 100644 index 00000000..bf5d4629 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinscxPCPainterD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterC11.bpk new file mode 100644 index 00000000..4f894d59 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterC11.bpk @@ -0,0 +1,200 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinscxScheduler3PainterC11.bpl +OBJFILES = dxSkinscxScheduler3PainterC11.obj dxSkinscxScheduler3Painter.obj + +RESFILES = dxSkinscxScheduler3PainterC11.res +MAINSOURCE = dxSkinscxScheduler3PainterC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxSkinsCoreC11.bpi cxSchedulerC11.bpi cxLibraryC11.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSkins Library Painter for Scheduler3 by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterC11.cpp new file mode 100644 index 00000000..e55e4dfe --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinscxScheduler3PainterC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEPACKAGE("cxSchedulerC11.bpi"); +USEUNIT("dxSkinscxScheduler3Painter.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterC11.res new file mode 100644 index 00000000..594c81be Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD10.dpk new file mode 100644 index 00000000..66a1e6e6 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD10.dpk @@ -0,0 +1,37 @@ +package dxSkinscxScheduler3PainterD10; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for Scheduler 3 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD10, + cxSchedulerD10; + +contains + dxSkinscxScheduler3Painter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD10.res new file mode 100644 index 00000000..253fd55a Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD11.dpk new file mode 100644 index 00000000..ed475bb1 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD11.dpk @@ -0,0 +1,37 @@ +package dxSkinscxScheduler3PainterD11; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for Scheduler 3 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD11, + cxSchedulerD11; + +contains + dxSkinscxScheduler3Painter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD11.res new file mode 100644 index 00000000..17eaec0d Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD7.dpk new file mode 100644 index 00000000..17969c75 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD7.dpk @@ -0,0 +1,37 @@ +package dxSkinscxScheduler3PainterD7; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for Scheduler 3 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD7, + cxSchedulerD7; + +contains + dxSkinscxScheduler3Painter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD7.res new file mode 100644 index 00000000..00d6c93a Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD9.dpk new file mode 100644 index 00000000..3ebbe9b7 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD9.dpk @@ -0,0 +1,37 @@ +package dxSkinscxScheduler3PainterD9; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for Scheduler 3 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD9, + cxSchedulerD9; + +contains + dxSkinscxScheduler3Painter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD9.res new file mode 100644 index 00000000..4cf84fa5 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinscxScheduler3PainterD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterC11.bpk new file mode 100644 index 00000000..caeb7bf7 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterC11.bpk @@ -0,0 +1,200 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinscxSchedulerPainterC11.bpl +OBJFILES = dxSkinscxSchedulerPainterC11.obj dxSkinscxSchedulerPainter.obj + +RESFILES = dxSkinscxSchedulerPainterC11.res +MAINSOURCE = dxSkinscxSchedulerPainterC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxSkinsCoreC11.bpi cxSchedulerC11.bpi cxLibraryC11.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSkins Library Painter for Scheduler by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterC11.cpp new file mode 100644 index 00000000..391e2f74 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinscxSchedulerC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEPACKAGE("cxSchedulerC11.bpi"); +USEUNIT("dxSkinscxSchedulerPainter.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterC11.res new file mode 100644 index 00000000..c57c81a4 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD10.dpk new file mode 100644 index 00000000..3cebb0fb --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD10.dpk @@ -0,0 +1,37 @@ +package dxSkinscxSchedulerPainterD10; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for Scheduler by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD10, + cxSchedulerD10; + +contains + dxSkinscxSchedulerPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD10.res new file mode 100644 index 00000000..f8701665 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD11.dpk new file mode 100644 index 00000000..c4c39673 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD11.dpk @@ -0,0 +1,37 @@ +package dxSkinscxSchedulerPainterD11; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for Scheduler by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD11, + cxSchedulerD11; + +contains + dxSkinscxSchedulerPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD11.res new file mode 100644 index 00000000..364d8801 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD7.dpk new file mode 100644 index 00000000..b9ad8197 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD7.dpk @@ -0,0 +1,37 @@ +package dxSkinscxSchedulerPainterD7; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for Scheduler by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD7, + cxSchedulerVCLD7; + +contains + dxSkinscxSchedulerPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD7.res new file mode 100644 index 00000000..6c4a0ffb Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD9.dpk new file mode 100644 index 00000000..cd231a8a --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD9.dpk @@ -0,0 +1,37 @@ +package dxSkinscxSchedulerPainterD9; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for Scheduler by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD9, + cxSchedulerD9; + +contains + dxSkinscxSchedulerPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD9.res new file mode 100644 index 00000000..218dfd0a Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinscxSchedulerPainterD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterC11.bpk new file mode 100644 index 00000000..a35336f4 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinsdxBarPainterC11.bpl +OBJFILES = dxSkinsdxBarPainterC11.obj dxSkinsdxBarPainter.obj dxSkinsdxStatusBarPainter.obj +RESFILES = dxSkinsdxBarPainterC11.res +MAINSOURCE = dxSkinsdxBarPainterC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxSkinsCoreC11.bpi dxBarC11.bpi dxThemeC11.bpi cxLibraryC11.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# ---------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSkins Library Painter for Bars by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterC11.cpp new file mode 100644 index 00000000..6a6ed3bd --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterC11.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinsdxBarPainterC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEPACKAGE("dxBarC11.bpi"); +USEUNIT("dxSkinsdxBarPainter.pas"); +USEUNIT("dxSkinsdxStatusBarPainter.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- \ No newline at end of file diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterC11.res new file mode 100644 index 00000000..b790334d Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD10.dpk new file mode 100644 index 00000000..0ca63001 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD10.dpk @@ -0,0 +1,38 @@ +package dxSkinsdxBarPainterD10; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for Bars by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD10, + dxBarD10; + +contains + dxSkinsdxBarPainter, + dxSkinsdxStatusBarPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD10.res new file mode 100644 index 00000000..00806581 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD11.dpk new file mode 100644 index 00000000..953ee851 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD11.dpk @@ -0,0 +1,38 @@ +package dxSkinsdxBarPainterD11; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for Bars by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD11, + dxBarD11; + +contains + dxSkinsdxBarPainter, + dxSkinsdxStatusBarPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD11.res new file mode 100644 index 00000000..70656892 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD7.dpk new file mode 100644 index 00000000..32b0f33b --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD7.dpk @@ -0,0 +1,38 @@ +package dxSkinsdxBarPainterD7; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for Bars by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD7, + dxBarD7; + +contains + dxSkinsdxBarPainter, + dxSkinsdxStatusBarPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD7.res new file mode 100644 index 00000000..b4ba0d11 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD9.dpk new file mode 100644 index 00000000..b33965dd --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD9.dpk @@ -0,0 +1,38 @@ +package dxSkinsdxBarPainterD9; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for Bars by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD9, + dxBarD9; + +contains + dxSkinsdxBarPainter, + dxSkinsdxStatusBarPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD9.res new file mode 100644 index 00000000..c06e1ad1 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxBarPainterD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterC11.bpk new file mode 100644 index 00000000..7d550986 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterC11.bpk @@ -0,0 +1,200 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinsdxDLPainterC11.bpl +OBJFILES = dxSkinsdxDLPainterC11.obj dxSkinsdxDockControlPainter.obj + +RESFILES = dxSkinsdxDLPainterC11.res +MAINSOURCE = dxSkinsdxDLPainterC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxSkinsCoreC11.bpi dxDockingC11.bpi cxLibraryC11.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# ---------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSkins Library Painter for Docking Library by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterC11.cpp new file mode 100644 index 00000000..8653f617 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinsdxDLPainterC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEPACKAGE("dxDockingC11.bpi"); +USEUNIT("dxSkinsdxDockControlPainter.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterC11.res new file mode 100644 index 00000000..48010ea8 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD10.dpk new file mode 100644 index 00000000..63ddc942 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD10.dpk @@ -0,0 +1,39 @@ +package dxSkinsdxDLPainterD10; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for Docking Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dxSkinsCoreD10, + dxDockingD10; + +contains + dxSkinsdxDockControlPainter; + +end. + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD10.res new file mode 100644 index 00000000..2189b96e Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD11.dpk new file mode 100644 index 00000000..d6bd4127 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD11.dpk @@ -0,0 +1,39 @@ +package dxSkinsdxDLPainterD11; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for Docking Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dxSkinsCoreD11, + dxDockingD11; + +contains + dxSkinsdxDockControlPainter; + +end. + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD11.res new file mode 100644 index 00000000..a1a1927b Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD7.dpk new file mode 100644 index 00000000..25429af1 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD7.dpk @@ -0,0 +1,39 @@ +package dxSkinsdxDLPainterD7; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for Docking Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dxSkinsCoreD7, + dxDockingD7; + +contains + dxSkinsdxDockControlPainter; + +end. + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD7.res new file mode 100644 index 00000000..e67ae078 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD9.dpk new file mode 100644 index 00000000..2007f52d --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD9.dpk @@ -0,0 +1,39 @@ +package dxSkinsdxDLPainterD9; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for Docking Library by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dxSkinsCoreD9, + dxDockingD9; + +contains + dxSkinsdxDockControlPainter; + +end. + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD9.res new file mode 100644 index 00000000..296297e4 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxDLPainterD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterC11.bpk new file mode 100644 index 00000000..7f7798a4 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterC11.bpk @@ -0,0 +1,200 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinsdxLCPainterC11.bpl +OBJFILES = dxSkinsdxLCPainterC11.obj dxSkinsdxLCPainter.obj + +RESFILES = dxSkinsdxLCPainterC11.res +MAINSOURCE = dxSkinsdxLCPainterC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxSkinsCoreC11.bpi dxLayoutControlC11.bpi cxLibraryC11.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSkins Library Painter for LayoutControl by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterC11.cpp new file mode 100644 index 00000000..e0f36e6f --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinsdxLCPainterC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEPACKAGE("dxLayoutControlC11.bpi"); +USEUNIT("dxSkinsdxLCPainter.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterC11.res new file mode 100644 index 00000000..76fedd93 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD10.dpk new file mode 100644 index 00000000..a87ab3d0 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD10.dpk @@ -0,0 +1,37 @@ +package dxSkinsdxLCPainterD10; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for LayoutControl by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD10, + dxLayoutControlD10; + +contains + dxSkinsdxLCPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD10.res new file mode 100644 index 00000000..74fa1c86 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD11.dpk new file mode 100644 index 00000000..342b016e --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD11.dpk @@ -0,0 +1,37 @@ +package dxSkinsdxLCPainterD11; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for LayoutControl by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD11, + dxLayoutControlD11; + +contains + dxSkinsdxLCPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD11.res new file mode 100644 index 00000000..f81ee0c6 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD7.dpk new file mode 100644 index 00000000..7826100d --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD7.dpk @@ -0,0 +1,37 @@ +package dxSkinsdxLCPainterD7; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for LayoutControl by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD7, + dxLayoutControlD7; + +contains + dxSkinsdxLCPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD7.res new file mode 100644 index 00000000..da8542d4 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD9.dpk new file mode 100644 index 00000000..597d4007 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD9.dpk @@ -0,0 +1,37 @@ +package dxSkinsdxLCPainterD9; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for LayoutControl by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD9, + dxLayoutControlD9; + +contains + dxSkinsdxLCPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD9.res new file mode 100644 index 00000000..fbb9a115 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxLCPainterD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterC11.bpk new file mode 100644 index 00000000..9ef45e17 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterC11.bpk @@ -0,0 +1,199 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinsdxNavBar2PainterC11.bpl +OBJFILES = dxSkinsdxNavBar2PainterC11.obj dxSkinsdxNavBar2Painter.obj +RESFILES = dxSkinsdxNavBar2PainterC11.res +MAINSOURCE = dxSkinsdxNavBar2PainterC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxSkinsCoreC11.bpi dxNavBarC11.bpi cxLibraryC11.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# ---------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSkins Library Painter for NavBar by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterC11.cpp new file mode 100644 index 00000000..05bd331e --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinsdxNavBar2PainterC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEPACKAGE("dxNavBarC11.bpi"); +USEUNIT("dxSkinsdxNavBar2Painter.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterC11.res new file mode 100644 index 00000000..72d858bb Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD10.dpk new file mode 100644 index 00000000..4b76c7e0 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD10.dpk @@ -0,0 +1,37 @@ +package dxSkinsdxNavBar2PainterD10; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for NavBar 2 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD10, + dxNavBarD10; + +contains + dxSkinsdxNavBar2Painter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD10.res new file mode 100644 index 00000000..69b22829 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD11.dpk new file mode 100644 index 00000000..fc7eeba5 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD11.dpk @@ -0,0 +1,37 @@ +package dxSkinsdxNavBar2PainterD11; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for NavBar 2 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD11, + dxNavBarD11; + +contains + dxSkinsdxNavBar2Painter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD11.res new file mode 100644 index 00000000..0be602b9 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD7.dpk new file mode 100644 index 00000000..1d8f1269 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD7.dpk @@ -0,0 +1,37 @@ +package dxSkinsdxNavBar2PainterD7; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for NavBar 2 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD7, + dxNavBarD7; + +contains + dxSkinsdxNavBar2Painter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD7.res new file mode 100644 index 00000000..2009d74e Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD9.dpk new file mode 100644 index 00000000..eee2d695 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD9.dpk @@ -0,0 +1,37 @@ +package dxSkinsdxNavBar2PainterD9; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for NavBar 2 by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD9, + dxNavBarD9; + +contains + dxSkinsdxNavBar2Painter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD9.res new file mode 100644 index 00000000..e5aea6e5 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBar2PainterD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterC11.bpk new file mode 100644 index 00000000..f357052c --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterC11.bpk @@ -0,0 +1,199 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinsdxNavBarPainterC11.bpl +OBJFILES = dxSkinsdxNavBarPainterC11.obj dxSkinsdxNavBarPainter.obj +RESFILES = dxSkinsdxNavBarPainterC11.res +MAINSOURCE = dxSkinsdxNavBarPainterC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxSkinsCoreC11.bpi dxNavBarC11.bpi cxLibraryC11.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# ---------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSkins Library Painter for NavBar by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterC11.cpp new file mode 100644 index 00000000..2e9a9282 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterC11.cpp @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinsdxNavBarPainterC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEPACKAGE("dxNavBarC11.bpi"); +USEUNIT("dxSkinsdxNavBarPainter.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterC11.res new file mode 100644 index 00000000..103ac22b Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD10.dpk new file mode 100644 index 00000000..12711465 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD10.dpk @@ -0,0 +1,37 @@ +package dxSkinsdxNavBarPainterD10; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for NavBar by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD10, + dxNavBarD10; + +contains + dxSkinsdxNavBarPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD10.res new file mode 100644 index 00000000..a953ff2a Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD11.dpk new file mode 100644 index 00000000..f40a3853 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD11.dpk @@ -0,0 +1,37 @@ +package dxSkinsdxNavBarPainterD11; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for NavBar by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD11, + dxNavBarD11; + +contains + dxSkinsdxNavBarPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD11.res new file mode 100644 index 00000000..083b629e Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD7.dpk new file mode 100644 index 00000000..fe78f16c --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD7.dpk @@ -0,0 +1,37 @@ +package dxSkinsdxNavBarPainterD7; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for NavBar by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD7, + dxNavBarD7; + +contains + dxSkinsdxNavBarPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD7.res new file mode 100644 index 00000000..2fbe0cdf Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD9.dpk new file mode 100644 index 00000000..8688b61a --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD9.dpk @@ -0,0 +1,37 @@ +package dxSkinsdxNavBarPainterD9; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for NavBar by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + vcl, + rtl, + dxSkinsCoreD9, + dxNavBarD9; + +contains + dxSkinsdxNavBarPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD9.res new file mode 100644 index 00000000..803964a8 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxNavBarPainterD9.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterC11.bpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterC11.bpk new file mode 100644 index 00000000..41ccef91 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterC11.bpk @@ -0,0 +1,200 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxSkinsdxRibbonPainterC11.bpl +OBJFILES = dxSkinsdxRibbonPainterC11.obj dxSkinsdxRibbonPainter.obj + +RESFILES = dxSkinsdxRibbonPainterC11.res +MAINSOURCE = dxSkinsdxRibbonPainterC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi dxGDIPlusC11.bpi dxSkinsCoreC11.bpi dxBarC11.bpi dxRibbonC11.bpi dxThemeC11.bpi cxLibraryC11.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# ---------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -O2 -Hc -H=$(BCB)\lib\vcl.csm -w -Ve \ + -Tkh30000 -a8 -k- -vi -D$(SYSDEFINES);$(USERDEFINES) -c -b- -w-par -w-inl -Vx \ + -tWM +CFLAG2 = +CFLAG3 = +PFLAGS = -DBCB -U$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$YD -$L- -$D- -v -M -JPHNE -LUdclstd +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn /d_RTLDLL /dUSEPACKAGES +LFLAGS = -L$(LIBDIR);"$(SEARCHPATH)";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -D"ExpressSkins Library Painter for Ribbon by Developer Express Inc." -aa \ + -Tpp -x -Gn -Gl -Gi +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterC11.cpp b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterC11.cpp new file mode 100644 index 00000000..aebe76a8 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterC11.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dxSkinsdxDLPainterC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dxSkinsCoreC11.bpi"); +USEPACKAGE("dxBarsC10.bpi"); +USEPACKAGE("dxRibbonC11.bpi"); +USEUNIT("dxSkinsdxRibbonPainter.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterC11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterC11.res new file mode 100644 index 00000000..197993e3 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterC11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD10.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD10.dpk new file mode 100644 index 00000000..fd272e7b --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD10.dpk @@ -0,0 +1,39 @@ +package dxSkinsdxRibbonPainterD10; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for Ribbon by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dxSkinsCoreD10, + dxRibbonD10; + +contains + dxSkinsdxRibbonPainter; + +end. + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD10.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD10.res new file mode 100644 index 00000000..d6ee4b9d Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD10.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD11.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD11.dpk new file mode 100644 index 00000000..d2e32d91 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD11.dpk @@ -0,0 +1,39 @@ +package dxSkinsdxRibbonPainterD11; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for Ribbon by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dxSkinsCoreD11, + dxRibbonD11; + +contains + dxSkinsdxRibbonPainter; + +end. + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD11.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD11.res new file mode 100644 index 00000000..9765eda5 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD11.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD7.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD7.dpk new file mode 100644 index 00000000..59eedbb8 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD7.dpk @@ -0,0 +1,39 @@ +package dxSkinsdxRibbonPainterD7; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for Ribbon by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dxSkinsCoreD7, + dxRibbonD7; + +contains + dxSkinsdxRibbonPainter; + +end. + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD7.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD7.res new file mode 100644 index 00000000..8a17c665 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD7.res differ diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD9.dpk b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD9.dpk new file mode 100644 index 00000000..9b61515d --- /dev/null +++ b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD9.dpk @@ -0,0 +1,39 @@ +package dxSkinsdxRibbonPainterD9; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressSkins Library Painter for Ribbon by Developer Express Inc.'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dxSkinsCoreD9, + dxRibbonD9; + +contains + dxSkinsdxRibbonPainter; + +end. + + diff --git a/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD9.res b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD9.res new file mode 100644 index 00000000..50b893ff Binary files /dev/null and b/official/x.35/ExpressSkins Library/Packages/dxSkinsdxRibbonPainterD9.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/cxVer.inc b/official/x.35/ExpressSkins Library/Sources/cxVer.inc new file mode 100644 index 00000000..a26364cc --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/cxVer.inc @@ -0,0 +1,172 @@ +{$B-} { Complete Boolean Evaluation } +{$R-} { Range-Checking } +{$T-} { Typed @ operator } +{$X+} { Extended syntax } +{$P+} { Open string params } +{$J+} { Writeable structured consts } +{$H+} { Use long strings by default } +{$Q-} { Overflow checking } + +{$DEFINE DXVER500} + +{$IFNDEF CLR} + {$DEFINE OLEDRAGANDDROP} + {$IFNDEF DONTUSEJPEGIMAGE} + {$DEFINE USEJPEGIMAGE} + {$ENDIF} +{$ENDIF} + +{$DEFINE EXPRESSBARS5} + +{$DEFINE VCL} + +{$IFNDEF VER80} + {$IFNDEF VER90} + {$IFNDEF VER93} + {$DEFINE DELPHI3} { Borland Delphi 3.0 } + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER110} { Borland C++Builder 3.0 } + {$DEFINE CBUILDER3} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE DELPHI4} +{$ENDIF} + +{$IFDEF VER125} { Borland C++Builder 4.0 } + {$DEFINE CBUILDER3} + {$DEFINE DELPHI4} + {$DEFINE CBUILDER4} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$IFDEF BCB} { Borland C++Builder 5.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$IFDEF BCB} { Borland C++Builder 6.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} +{$ENDIF} + +{$IFNDEF DELPHI6} + {$DEFINE MSWINDOWS} +{$ENDIF} +{$IFDEF LINUX} + {$UNDEF MSWINDOWS} +{$ENDIF} + +{$IFDEF LINUX} + {$DEFINE KYLIX1} { Borland Kylix 1 } + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF CompilerVersion >= 14} + {$DEFINE KYLIX2} { Borland Kylix 2 } + {$IFEND} + {$IF CompilerVersion >= 14.50} + {$DEFINE KYLIX3} { Borland Kylix 3 } + {$IFEND} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} { Borland Delphi.Net } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} +{$ENDIF} + +{$IFDEF VER170} { Borland Delphi 9.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} +{$ENDIF} + +{$IFDEF VER180} { Borland Delphi 10 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$IFDEF BCB} { Borland C++Builder 10 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Borland Delphi 11 //CodeGear} + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$DEFINE DELPHI11} + {$IFDEF BCB} { Borland C++Builder 11 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$DEFINE CBUILDER11} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFNDEF CLR} + {$IFNDEF BCB} + {$IFDEF DELPHI6} + {$DEFINE REGISTERSHELLCTRLS} + {$ENDIF} + {$ENDIF} + {$IFDEF DELPHI7} + {$WARN UNSAFE_CAST OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_TYPE OFF} + {$ENDIF} +{$ENDIF} + +{$IFDEF REGISTERSHELLCTRLS} + {$DEFINE REGISTERCXSHELLCTRLS} +{$ENDIF} + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinBlack.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinBlack.pas new file mode 100644 index 00000000..bc3b31be --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinBlack.pas @@ -0,0 +1,75 @@ +unit dxSkinBlack; + +interface + +uses + Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, dxSkinsLookAndFeelPainter; + +type + { TdxBlackPainter } + TdxBlackPainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +const + SkinsCount = 1; + SkinNames: array[0..SkinsCount - 1] of ShortString = + ('Black'); + SkinPainters: array[0..SkinsCount - 1] of TcxCustomLookAndFeelPainterClass = + (TdxBlackPainter); + +implementation + +{$R dxSkinBlack.res} + +var + CachedPainterData: array[0..SkinsCount - 1] of TdxSkinLookAndFeelPainterInfo; + +{ TdxBlackPainter } + +class function TdxBlackPainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData[0]; +end; + +class function TdxBlackPainter.InternalUnitName: string; +begin + Result := 'dxSkinBlack'; +end; + + +procedure RegisterPainters; +var + SkinIndex: Integer; +begin + if not CheckGdiPlus then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + begin + CachedPainterData[SkinIndex] := + TdxSkinLookAndFeelPainterInfo.Create(TdxSkin.Create(SkinNames[SkinIndex], True, HInstance)); + GetExtendedStylePainters.Register( + SkinNames[SkinIndex], SkinPainters[SkinIndex], CachedPainterData[SkinIndex]); + end; +end; + +procedure UnregisterPainters; +var + SkinIndex: Integer; +begin + if GetExtendedStylePainters = nil then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + GetExtendedStylePainters.UnRegister(SkinNames[SkinIndex]); +end; + +{$IFNDEF DXSKINDYNAMICLOADING} +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinBlack.res b/official/x.35/ExpressSkins Library/Sources/dxSkinBlack.res new file mode 100644 index 00000000..3bf1d1dd Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinBlack.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinBlue.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinBlue.pas new file mode 100644 index 00000000..9b3a55de --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinBlue.pas @@ -0,0 +1,75 @@ +unit dxSkinBlue; + +interface + +uses + Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, dxSkinsLookAndFeelPainter; + +type + { TdxBluePainter } + TdxBluePainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +const + SkinsCount = 1; + SkinNames: array[0..SkinsCount - 1] of ShortString = + ('Blue'); + SkinPainters: array[0..SkinsCount - 1] of TcxCustomLookAndFeelPainterClass = + (TdxBluePainter); + +implementation + +{$R dxSkinBlue.res} + +var + CachedPainterData: array[0..SkinsCount - 1] of TdxSkinLookAndFeelPainterInfo; + +{ TdxBluePainter } + +class function TdxBluePainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData[0]; +end; + +class function TdxBluePainter.InternalUnitName: string; +begin + Result := 'dxSkinBlue'; +end; + + +procedure RegisterPainters; +var + SkinIndex: Integer; +begin + if not CheckGdiPlus then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + begin + CachedPainterData[SkinIndex] := + TdxSkinLookAndFeelPainterInfo.Create(TdxSkin.Create(SkinNames[SkinIndex], True, HInstance)); + GetExtendedStylePainters.Register( + SkinNames[SkinIndex], SkinPainters[SkinIndex], CachedPainterData[SkinIndex]); + end; +end; + +procedure UnregisterPainters; +var + SkinIndex: Integer; +begin + if GetExtendedStylePainters = nil then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + GetExtendedStylePainters.UnRegister(SkinNames[SkinIndex]); +end; + +{$IFNDEF DXSKINDYNAMICLOADING} +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinBlue.res b/official/x.35/ExpressSkins Library/Sources/dxSkinBlue.res new file mode 100644 index 00000000..9fae1a41 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinBlue.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinCaramel.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinCaramel.pas new file mode 100644 index 00000000..c76f3953 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinCaramel.pas @@ -0,0 +1,75 @@ +unit dxSkinCaramel; + +interface + +uses + Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, dxSkinsLookAndFeelPainter; + +type + { TdxCaramelPainter } + TdxCaramelPainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +const + SkinsCount = 1; + SkinNames: array[0..SkinsCount - 1] of ShortString = + ('Caramel'); + SkinPainters: array[0..SkinsCount - 1] of TcxCustomLookAndFeelPainterClass = + (TdxCaramelPainter); + +implementation + +{$R dxSkinCaramel.res} + +var + CachedPainterData: array[0..SkinsCount - 1] of TdxSkinLookAndFeelPainterInfo; + +{ TdxCaramelPainter } + +class function TdxCaramelPainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData[0]; +end; + +class function TdxCaramelPainter.InternalUnitName: string; +begin + Result := 'dxSkinCaramel'; +end; + + +procedure RegisterPainters; +var + SkinIndex: Integer; +begin + if not CheckGdiPlus then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + begin + CachedPainterData[SkinIndex] := + TdxSkinLookAndFeelPainterInfo.Create(TdxSkin.Create(SkinNames[SkinIndex], True, HInstance)); + GetExtendedStylePainters.Register( + SkinNames[SkinIndex], SkinPainters[SkinIndex], CachedPainterData[SkinIndex]); + end; +end; + +procedure UnregisterPainters; +var + SkinIndex: Integer; +begin + if GetExtendedStylePainters = nil then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + GetExtendedStylePainters.UnRegister(SkinNames[SkinIndex]); +end; + +{$IFNDEF DXSKINDYNAMICLOADING} +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinCaramel.res b/official/x.35/ExpressSkins Library/Sources/dxSkinCaramel.res new file mode 100644 index 00000000..1c83666e Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinCaramel.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinCoffee.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinCoffee.pas new file mode 100644 index 00000000..e4e597e1 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinCoffee.pas @@ -0,0 +1,75 @@ +unit dxSkinCoffee; + +interface + +uses + Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, dxSkinsLookAndFeelPainter; + +type + { TdxCoffeePainter } + TdxCoffeePainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +const + SkinsCount = 1; + SkinNames: array[0..SkinsCount - 1] of ShortString = + ('Coffee'); + SkinPainters: array[0..SkinsCount - 1] of TcxCustomLookAndFeelPainterClass = + (TdxCoffeePainter); + +implementation + +{$R dxSkinCoffee.res} + +var + CachedPainterData: array[0..SkinsCount - 1] of TdxSkinLookAndFeelPainterInfo; + +{ TdxCoffeePainter } + +class function TdxCoffeePainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData[0]; +end; + +class function TdxCoffeePainter.InternalUnitName: string; +begin + Result := 'dxSkinCoffee'; +end; + + +procedure RegisterPainters; +var + SkinIndex: Integer; +begin + if not CheckGdiPlus then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + begin + CachedPainterData[SkinIndex] := + TdxSkinLookAndFeelPainterInfo.Create(TdxSkin.Create(SkinNames[SkinIndex], True, HInstance)); + GetExtendedStylePainters.Register( + SkinNames[SkinIndex], SkinPainters[SkinIndex], CachedPainterData[SkinIndex]); + end; +end; + +procedure UnregisterPainters; +var + SkinIndex: Integer; +begin + if GetExtendedStylePainters = nil then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + GetExtendedStylePainters.UnRegister(SkinNames[SkinIndex]); +end; + +{$IFNDEF DXSKINDYNAMICLOADING} +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinCoffee.res b/official/x.35/ExpressSkins Library/Sources/dxSkinCoffee.res new file mode 100644 index 00000000..1d3bc842 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinCoffee.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinGlassOceans.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinGlassOceans.pas new file mode 100644 index 00000000..1ede20a4 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinGlassOceans.pas @@ -0,0 +1,75 @@ +unit dxSkinGlassOceans; + +interface + +uses + Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, dxSkinsLookAndFeelPainter; + +type + { TdxGlassOceansPainter } + TdxGlassOceansPainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +const + SkinsCount = 1; + SkinNames: array[0..SkinsCount - 1] of ShortString = + ('GlassOceans'); + SkinPainters: array[0..SkinsCount - 1] of TcxCustomLookAndFeelPainterClass = + (TdxGlassOceansPainter); + +implementation + +{$R dxSkinGlassOceans.res} + +var + CachedPainterData: array[0..SkinsCount - 1] of TdxSkinLookAndFeelPainterInfo; + +{ TdxGlassOceansPainter } + +class function TdxGlassOceansPainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData[0]; +end; + +class function TdxGlassOceansPainter.InternalUnitName: string; +begin + Result := 'dxSkinGlassOceans'; +end; + + +procedure RegisterPainters; +var + SkinIndex: Integer; +begin + if not CheckGdiPlus then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + begin + CachedPainterData[SkinIndex] := + TdxSkinLookAndFeelPainterInfo.Create(TdxSkin.Create(SkinNames[SkinIndex], True, HInstance)); + GetExtendedStylePainters.Register( + SkinNames[SkinIndex], SkinPainters[SkinIndex], CachedPainterData[SkinIndex]); + end; +end; + +procedure UnregisterPainters; +var + SkinIndex: Integer; +begin + if GetExtendedStylePainters = nil then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + GetExtendedStylePainters.UnRegister(SkinNames[SkinIndex]); +end; + +{$IFNDEF DXSKINDYNAMICLOADING} +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinGlassOceans.res b/official/x.35/ExpressSkins Library/Sources/dxSkinGlassOceans.res new file mode 100644 index 00000000..833962ba Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinGlassOceans.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinLilian.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinLilian.pas new file mode 100644 index 00000000..03c54eb4 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinLilian.pas @@ -0,0 +1,75 @@ +unit dxSkinLilian; + +interface + +uses + Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, dxSkinsLookAndFeelPainter; + +type + { TdxLilianPainter } + TdxLilianPainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +const + SkinsCount = 1; + SkinNames: array[0..SkinsCount - 1] of ShortString = + ('Lilian'); + SkinPainters: array[0..SkinsCount - 1] of TcxCustomLookAndFeelPainterClass = + (TdxLilianPainter); + +implementation + +{$R dxSkinLilian.res} + +var + CachedPainterData: array[0..SkinsCount - 1] of TdxSkinLookAndFeelPainterInfo; + +{ TdxLilianPainter } + +class function TdxLilianPainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData[0]; +end; + +class function TdxLilianPainter.InternalUnitName: string; +begin + Result := 'dxSkinLilian'; +end; + + +procedure RegisterPainters; +var + SkinIndex: Integer; +begin + if not CheckGdiPlus then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + begin + CachedPainterData[SkinIndex] := + TdxSkinLookAndFeelPainterInfo.Create(TdxSkin.Create(SkinNames[SkinIndex], True, HInstance)); + GetExtendedStylePainters.Register( + SkinNames[SkinIndex], SkinPainters[SkinIndex], CachedPainterData[SkinIndex]); + end; +end; + +procedure UnregisterPainters; +var + SkinIndex: Integer; +begin + if GetExtendedStylePainters = nil then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + GetExtendedStylePainters.UnRegister(SkinNames[SkinIndex]); +end; + +{$IFNDEF DXSKINDYNAMICLOADING} +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinLilian.res b/official/x.35/ExpressSkins Library/Sources/dxSkinLilian.res new file mode 100644 index 00000000..6d8906db Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinLilian.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinLiquidSky.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinLiquidSky.pas new file mode 100644 index 00000000..4f178e94 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinLiquidSky.pas @@ -0,0 +1,75 @@ +unit dxSkinLiquidSky; + +interface + +uses + Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, dxSkinsLookAndFeelPainter; + +type + { TdxLiquidSkyPainter } + TdxLiquidSkyPainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +const + SkinsCount = 1; + SkinNames: array[0..SkinsCount - 1] of ShortString = + ('LiquidSky'); + SkinPainters: array[0..SkinsCount - 1] of TcxCustomLookAndFeelPainterClass = + (TdxLiquidSkyPainter); + +implementation + +{$R dxSkinLiquidSky.res} + +var + CachedPainterData: array[0..SkinsCount - 1] of TdxSkinLookAndFeelPainterInfo; + +{ TdxLiquidSkyPainter } + +class function TdxLiquidSkyPainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData[0]; +end; + +class function TdxLiquidSkyPainter.InternalUnitName: string; +begin + Result := 'dxSkinLiquidSky'; +end; + + +procedure RegisterPainters; +var + SkinIndex: Integer; +begin + if not CheckGdiPlus then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + begin + CachedPainterData[SkinIndex] := + TdxSkinLookAndFeelPainterInfo.Create(TdxSkin.Create(SkinNames[SkinIndex], True, HInstance)); + GetExtendedStylePainters.Register( + SkinNames[SkinIndex], SkinPainters[SkinIndex], CachedPainterData[SkinIndex]); + end; +end; + +procedure UnregisterPainters; +var + SkinIndex: Integer; +begin + if GetExtendedStylePainters = nil then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + GetExtendedStylePainters.UnRegister(SkinNames[SkinIndex]); +end; + +{$IFNDEF DXSKINDYNAMICLOADING} +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinLiquidSky.res b/official/x.35/ExpressSkins Library/Sources/dxSkinLiquidSky.res new file mode 100644 index 00000000..06276a0e Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinLiquidSky.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinLondonLiquidSky.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinLondonLiquidSky.pas new file mode 100644 index 00000000..3270c537 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinLondonLiquidSky.pas @@ -0,0 +1,75 @@ +unit dxSkinLondonLiquidSky; + +interface + +uses + Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, dxSkinsLookAndFeelPainter; + +type + { TdxLondonLiquidSkyPainter } + TdxLondonLiquidSkyPainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +const + SkinsCount = 1; + SkinNames: array[0..SkinsCount - 1] of ShortString = + ('LondonLiquidSky'); + SkinPainters: array[0..SkinsCount - 1] of TcxCustomLookAndFeelPainterClass = + (TdxLondonLiquidSkyPainter); + +implementation + +{$R dxSkinLondonLiquidSky.res} + +var + CachedPainterData: array[0..SkinsCount - 1] of TdxSkinLookAndFeelPainterInfo; + +{ TdxLondonLiquidSkyPainter } + +class function TdxLondonLiquidSkyPainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData[0]; +end; + +class function TdxLondonLiquidSkyPainter.InternalUnitName: string; +begin + Result := 'dxSkinLondonLiquidSky'; +end; + + +procedure RegisterPainters; +var + SkinIndex: Integer; +begin + if not CheckGdiPlus then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + begin + CachedPainterData[SkinIndex] := + TdxSkinLookAndFeelPainterInfo.Create(TdxSkin.Create(SkinNames[SkinIndex], True, HInstance)); + GetExtendedStylePainters.Register( + SkinNames[SkinIndex], SkinPainters[SkinIndex], CachedPainterData[SkinIndex]); + end; +end; + +procedure UnregisterPainters; +var + SkinIndex: Integer; +begin + if GetExtendedStylePainters = nil then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + GetExtendedStylePainters.UnRegister(SkinNames[SkinIndex]); +end; + +{$IFNDEF DXSKINDYNAMICLOADING} +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinLondonLiquidSky.res b/official/x.35/ExpressSkins Library/Sources/dxSkinLondonLiquidSky.res new file mode 100644 index 00000000..df858257 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinLondonLiquidSky.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinMcSkin.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinMcSkin.pas new file mode 100644 index 00000000..396055f5 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinMcSkin.pas @@ -0,0 +1,75 @@ +unit dxSkinMcSkin; + +interface + +uses + Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, dxSkinsLookAndFeelPainter; + +type + { TdxMcSkinPainter } + TdxMcSkinPainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +const + SkinsCount = 1; + SkinNames: array[0..SkinsCount - 1] of ShortString = + ('McSkin'); + SkinPainters: array[0..SkinsCount - 1] of TcxCustomLookAndFeelPainterClass = + (TdxMcSkinPainter); + +implementation + +{$R dxSkinMcSkin.res} + +var + CachedPainterData: array[0..SkinsCount - 1] of TdxSkinLookAndFeelPainterInfo; + +{ TdxMcSkinPainter } + +class function TdxMcSkinPainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData[0]; +end; + +class function TdxMcSkinPainter.InternalUnitName: string; +begin + Result := 'dxSkinMcSkin'; +end; + + +procedure RegisterPainters; +var + SkinIndex: Integer; +begin + if not CheckGdiPlus then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + begin + CachedPainterData[SkinIndex] := + TdxSkinLookAndFeelPainterInfo.Create(TdxSkin.Create(SkinNames[SkinIndex], True, HInstance)); + GetExtendedStylePainters.Register( + SkinNames[SkinIndex], SkinPainters[SkinIndex], CachedPainterData[SkinIndex]); + end; +end; + +procedure UnregisterPainters; +var + SkinIndex: Integer; +begin + if GetExtendedStylePainters = nil then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + GetExtendedStylePainters.UnRegister(SkinNames[SkinIndex]); +end; + +{$IFNDEF DXSKINDYNAMICLOADING} +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinMcSkin.res b/official/x.35/ExpressSkins Library/Sources/dxSkinMcSkin.res new file mode 100644 index 00000000..c585ad2d Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinMcSkin.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinMoneyTwins.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinMoneyTwins.pas new file mode 100644 index 00000000..bc25e495 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinMoneyTwins.pas @@ -0,0 +1,75 @@ +unit dxSkinMoneyTwins; + +interface + +uses + Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, dxSkinsLookAndFeelPainter; + +type + { TdxMoneyTwinsPainter } + TdxMoneyTwinsPainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +const + SkinsCount = 1; + SkinNames: array[0..SkinsCount - 1] of ShortString = + ('MoneyTwins'); + SkinPainters: array[0..SkinsCount - 1] of TcxCustomLookAndFeelPainterClass = + (TdxMoneyTwinsPainter); + +implementation + +{$R dxSkinMoneyTwins.res} + +var + CachedPainterData: array[0..SkinsCount - 1] of TdxSkinLookAndFeelPainterInfo; + +{ TdxMoneyTwinsPainter } + +class function TdxMoneyTwinsPainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData[0]; +end; + +class function TdxMoneyTwinsPainter.InternalUnitName: string; +begin + Result := 'dxSkinMoneyTwins'; +end; + + +procedure RegisterPainters; +var + SkinIndex: Integer; +begin + if not CheckGdiPlus then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + begin + CachedPainterData[SkinIndex] := + TdxSkinLookAndFeelPainterInfo.Create(TdxSkin.Create(SkinNames[SkinIndex], True, HInstance)); + GetExtendedStylePainters.Register( + SkinNames[SkinIndex], SkinPainters[SkinIndex], CachedPainterData[SkinIndex]); + end; +end; + +procedure UnregisterPainters; +var + SkinIndex: Integer; +begin + if GetExtendedStylePainters = nil then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + GetExtendedStylePainters.UnRegister(SkinNames[SkinIndex]); +end; + +{$IFNDEF DXSKINDYNAMICLOADING} +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinMoneyTwins.res b/official/x.35/ExpressSkins Library/Sources/dxSkinMoneyTwins.res new file mode 100644 index 00000000..b286fc5b Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinMoneyTwins.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Black.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Black.pas new file mode 100644 index 00000000..66548896 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Black.pas @@ -0,0 +1,75 @@ +unit dxSkinOffice2007Black; + +interface + +uses + Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, dxSkinsLookAndFeelPainter; + +type + { TdxOffice2007BlackPainter } + TdxOffice2007BlackPainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +const + SkinsCount = 1; + SkinNames: array[0..SkinsCount - 1] of ShortString = + ('Office2007Black'); + SkinPainters: array[0..SkinsCount - 1] of TcxCustomLookAndFeelPainterClass = + (TdxOffice2007BlackPainter); + +implementation + +{$R dxSkinOffice2007Black.res} + +var + CachedPainterData: array[0..SkinsCount - 1] of TdxSkinLookAndFeelPainterInfo; + +{ TdxOffice2007BlackPainter } + +class function TdxOffice2007BlackPainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData[0]; +end; + +class function TdxOffice2007BlackPainter.InternalUnitName: string; +begin + Result := 'dxSkinOffice2007Black'; +end; + + +procedure RegisterPainters; +var + SkinIndex: Integer; +begin + if not CheckGdiPlus then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + begin + CachedPainterData[SkinIndex] := + TdxSkinLookAndFeelPainterInfo.Create(TdxSkin.Create(SkinNames[SkinIndex], True, HInstance)); + GetExtendedStylePainters.Register( + SkinNames[SkinIndex], SkinPainters[SkinIndex], CachedPainterData[SkinIndex]); + end; +end; + +procedure UnregisterPainters; +var + SkinIndex: Integer; +begin + if GetExtendedStylePainters = nil then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + GetExtendedStylePainters.UnRegister(SkinNames[SkinIndex]); +end; + +{$IFNDEF DXSKINDYNAMICLOADING} +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Black.res b/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Black.res new file mode 100644 index 00000000..963cf162 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Black.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Blue.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Blue.pas new file mode 100644 index 00000000..4e53944a --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Blue.pas @@ -0,0 +1,75 @@ +unit dxSkinOffice2007Blue; + +interface + +uses + Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, dxSkinsLookAndFeelPainter; + +type + { TdxOffice2007BluePainter } + TdxOffice2007BluePainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +const + SkinsCount = 1; + SkinNames: array[0..SkinsCount - 1] of ShortString = + ('Office2007Blue'); + SkinPainters: array[0..SkinsCount - 1] of TcxCustomLookAndFeelPainterClass = + (TdxOffice2007BluePainter); + +implementation + +{$R dxSkinOffice2007Blue.res} + +var + CachedPainterData: array[0..SkinsCount - 1] of TdxSkinLookAndFeelPainterInfo; + +{ TdxOffice2007BluePainter } + +class function TdxOffice2007BluePainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData[0]; +end; + +class function TdxOffice2007BluePainter.InternalUnitName: string; +begin + Result := 'dxSkinOffice2007Blue'; +end; + + +procedure RegisterPainters; +var + SkinIndex: Integer; +begin + if not CheckGdiPlus then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + begin + CachedPainterData[SkinIndex] := + TdxSkinLookAndFeelPainterInfo.Create(TdxSkin.Create(SkinNames[SkinIndex], True, HInstance)); + GetExtendedStylePainters.Register( + SkinNames[SkinIndex], SkinPainters[SkinIndex], CachedPainterData[SkinIndex]); + end; +end; + +procedure UnregisterPainters; +var + SkinIndex: Integer; +begin + if GetExtendedStylePainters = nil then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + GetExtendedStylePainters.UnRegister(SkinNames[SkinIndex]); +end; + +{$IFNDEF DXSKINDYNAMICLOADING} +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Blue.res b/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Blue.res new file mode 100644 index 00000000..069c2dac Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Blue.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Green.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Green.pas new file mode 100644 index 00000000..a93a260d --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Green.pas @@ -0,0 +1,75 @@ +unit dxSkinOffice2007Green; + +interface + +uses + Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, dxSkinsLookAndFeelPainter; + +type + { TdxOffice2007GreenPainter } + TdxOffice2007GreenPainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +const + SkinsCount = 1; + SkinNames: array[0..SkinsCount - 1] of ShortString = + ('Office2007Green'); + SkinPainters: array[0..SkinsCount - 1] of TcxCustomLookAndFeelPainterClass = + (TdxOffice2007GreenPainter); + +implementation + +{$R dxSkinOffice2007Green.res} + +var + CachedPainterData: array[0..SkinsCount - 1] of TdxSkinLookAndFeelPainterInfo; + +{ TdxOffice2007GreenPainter } + +class function TdxOffice2007GreenPainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData[0]; +end; + +class function TdxOffice2007GreenPainter.InternalUnitName: string; +begin + Result := 'dxSkinOffice2007Green'; +end; + + +procedure RegisterPainters; +var + SkinIndex: Integer; +begin + if not CheckGdiPlus then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + begin + CachedPainterData[SkinIndex] := + TdxSkinLookAndFeelPainterInfo.Create(TdxSkin.Create(SkinNames[SkinIndex], True, HInstance)); + GetExtendedStylePainters.Register( + SkinNames[SkinIndex], SkinPainters[SkinIndex], CachedPainterData[SkinIndex]); + end; +end; + +procedure UnregisterPainters; +var + SkinIndex: Integer; +begin + if GetExtendedStylePainters = nil then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + GetExtendedStylePainters.UnRegister(SkinNames[SkinIndex]); +end; + +{$IFNDEF DXSKINDYNAMICLOADING} +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Green.res b/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Green.res new file mode 100644 index 00000000..a9be60dc Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Green.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Pink.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Pink.pas new file mode 100644 index 00000000..e116cf87 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Pink.pas @@ -0,0 +1,75 @@ +unit dxSkinOffice2007Pink; + +interface + +uses + Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, dxSkinsLookAndFeelPainter; + +type + { TdxOffice2007PinkPainter } + TdxOffice2007PinkPainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +const + SkinsCount = 1; + SkinNames: array[0..SkinsCount - 1] of ShortString = + ('Office2007Pink'); + SkinPainters: array[0..SkinsCount - 1] of TcxCustomLookAndFeelPainterClass = + (TdxOffice2007PinkPainter); + +implementation + +{$R dxSkinOffice2007Pink.res} + +var + CachedPainterData: array[0..SkinsCount - 1] of TdxSkinLookAndFeelPainterInfo; + +{ TdxOffice2007PinkPainter } + +class function TdxOffice2007PinkPainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData[0]; +end; + +class function TdxOffice2007PinkPainter.InternalUnitName: string; +begin + Result := 'dxSkinOffice2007Pink'; +end; + + +procedure RegisterPainters; +var + SkinIndex: Integer; +begin + if not CheckGdiPlus then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + begin + CachedPainterData[SkinIndex] := + TdxSkinLookAndFeelPainterInfo.Create(TdxSkin.Create(SkinNames[SkinIndex], True, HInstance)); + GetExtendedStylePainters.Register( + SkinNames[SkinIndex], SkinPainters[SkinIndex], CachedPainterData[SkinIndex]); + end; +end; + +procedure UnregisterPainters; +var + SkinIndex: Integer; +begin + if GetExtendedStylePainters = nil then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + GetExtendedStylePainters.UnRegister(SkinNames[SkinIndex]); +end; + +{$IFNDEF DXSKINDYNAMICLOADING} +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Pink.res b/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Pink.res new file mode 100644 index 00000000..90b48d5d Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Pink.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Silver.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Silver.pas new file mode 100644 index 00000000..79c1e72a --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Silver.pas @@ -0,0 +1,75 @@ +unit dxSkinOffice2007Silver; + +interface + +uses + Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, dxSkinsLookAndFeelPainter; + +type + { TdxOffice2007SilverPainter } + TdxOffice2007SilverPainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +const + SkinsCount = 1; + SkinNames: array[0..SkinsCount - 1] of ShortString = + ('Office2007Silver'); + SkinPainters: array[0..SkinsCount - 1] of TcxCustomLookAndFeelPainterClass = + (TdxOffice2007SilverPainter); + +implementation + +{$R dxSkinOffice2007Silver.res} + +var + CachedPainterData: array[0..SkinsCount - 1] of TdxSkinLookAndFeelPainterInfo; + +{ TdxOffice2007SilverPainter } + +class function TdxOffice2007SilverPainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData[0]; +end; + +class function TdxOffice2007SilverPainter.InternalUnitName: string; +begin + Result := 'dxSkinOffice2007Silver'; +end; + + +procedure RegisterPainters; +var + SkinIndex: Integer; +begin + if not CheckGdiPlus then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + begin + CachedPainterData[SkinIndex] := + TdxSkinLookAndFeelPainterInfo.Create(TdxSkin.Create(SkinNames[SkinIndex], True, HInstance)); + GetExtendedStylePainters.Register( + SkinNames[SkinIndex], SkinPainters[SkinIndex], CachedPainterData[SkinIndex]); + end; +end; + +procedure UnregisterPainters; +var + SkinIndex: Integer; +begin + if GetExtendedStylePainters = nil then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + GetExtendedStylePainters.UnRegister(SkinNames[SkinIndex]); +end; + +{$IFNDEF DXSKINDYNAMICLOADING} +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Silver.res b/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Silver.res new file mode 100644 index 00000000..d30a0fdc Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinOffice2007Silver.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinSilver.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinSilver.pas new file mode 100644 index 00000000..e8958315 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinSilver.pas @@ -0,0 +1,75 @@ +unit dxSkinSilver; + +interface + +uses + Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, dxSkinsLookAndFeelPainter; + +type + { TdxSilverPainter } + TdxSilverPainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +const + SkinsCount = 1; + SkinNames: array[0..SkinsCount - 1] of ShortString = + ('Silver'); + SkinPainters: array[0..SkinsCount - 1] of TcxCustomLookAndFeelPainterClass = + (TdxSilverPainter); + +implementation + +{$R dxSkinSilver.res} + +var + CachedPainterData: array[0..SkinsCount - 1] of TdxSkinLookAndFeelPainterInfo; + +{ TdxSilverPainter } + +class function TdxSilverPainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData[0]; +end; + +class function TdxSilverPainter.InternalUnitName: string; +begin + Result := 'dxSkinSilver'; +end; + + +procedure RegisterPainters; +var + SkinIndex: Integer; +begin + if not CheckGdiPlus then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + begin + CachedPainterData[SkinIndex] := + TdxSkinLookAndFeelPainterInfo.Create(TdxSkin.Create(SkinNames[SkinIndex], True, HInstance)); + GetExtendedStylePainters.Register( + SkinNames[SkinIndex], SkinPainters[SkinIndex], CachedPainterData[SkinIndex]); + end; +end; + +procedure UnregisterPainters; +var + SkinIndex: Integer; +begin + if GetExtendedStylePainters = nil then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + GetExtendedStylePainters.UnRegister(SkinNames[SkinIndex]); +end; + +{$IFNDEF DXSKINDYNAMICLOADING} +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinSilver.res b/official/x.35/ExpressSkins Library/Sources/dxSkinSilver.res new file mode 100644 index 00000000..716785dc Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinSilver.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinStardust.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinStardust.pas new file mode 100644 index 00000000..7e180060 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinStardust.pas @@ -0,0 +1,75 @@ +unit dxSkinStardust; + +interface + +uses + Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, dxSkinsLookAndFeelPainter; + +type + { TdxStardustPainter } + TdxStardustPainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +const + SkinsCount = 1; + SkinNames: array[0..SkinsCount - 1] of ShortString = + ('Stardust'); + SkinPainters: array[0..SkinsCount - 1] of TcxCustomLookAndFeelPainterClass = + (TdxStardustPainter); + +implementation + +{$R dxSkinStardust.res} + +var + CachedPainterData: array[0..SkinsCount - 1] of TdxSkinLookAndFeelPainterInfo; + +{ TdxStardustPainter } + +class function TdxStardustPainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData[0]; +end; + +class function TdxStardustPainter.InternalUnitName: string; +begin + Result := 'dxSkinStardust'; +end; + + +procedure RegisterPainters; +var + SkinIndex: Integer; +begin + if not CheckGdiPlus then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + begin + CachedPainterData[SkinIndex] := + TdxSkinLookAndFeelPainterInfo.Create(TdxSkin.Create(SkinNames[SkinIndex], True, HInstance)); + GetExtendedStylePainters.Register( + SkinNames[SkinIndex], SkinPainters[SkinIndex], CachedPainterData[SkinIndex]); + end; +end; + +procedure UnregisterPainters; +var + SkinIndex: Integer; +begin + if GetExtendedStylePainters = nil then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + GetExtendedStylePainters.UnRegister(SkinNames[SkinIndex]); +end; + +{$IFNDEF DXSKINDYNAMICLOADING} +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinStardust.res b/official/x.35/ExpressSkins Library/Sources/dxSkinStardust.res new file mode 100644 index 00000000..b34624c7 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinStardust.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinValentine.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinValentine.pas new file mode 100644 index 00000000..4cf4086a --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinValentine.pas @@ -0,0 +1,75 @@ +unit dxSkinValentine; + +interface + +uses + Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, dxSkinsLookAndFeelPainter; + +type + { TdxValentinePainter } + TdxValentinePainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +const + SkinsCount = 1; + SkinNames: array[0..SkinsCount - 1] of ShortString = + ('Valentine'); + SkinPainters: array[0..SkinsCount - 1] of TcxCustomLookAndFeelPainterClass = + (TdxValentinePainter); + +implementation + +{$R dxSkinValentine.res} + +var + CachedPainterData: array[0..SkinsCount - 1] of TdxSkinLookAndFeelPainterInfo; + +{ TdxValentinePainter } + +class function TdxValentinePainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData[0]; +end; + +class function TdxValentinePainter.InternalUnitName: string; +begin + Result := 'dxSkinValentine'; +end; + + +procedure RegisterPainters; +var + SkinIndex: Integer; +begin + if not CheckGdiPlus then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + begin + CachedPainterData[SkinIndex] := + TdxSkinLookAndFeelPainterInfo.Create(TdxSkin.Create(SkinNames[SkinIndex], True, HInstance)); + GetExtendedStylePainters.Register( + SkinNames[SkinIndex], SkinPainters[SkinIndex], CachedPainterData[SkinIndex]); + end; +end; + +procedure UnregisterPainters; +var + SkinIndex: Integer; +begin + if GetExtendedStylePainters = nil then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + GetExtendedStylePainters.UnRegister(SkinNames[SkinIndex]); +end; + +{$IFNDEF DXSKINDYNAMICLOADING} +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinValentine.res b/official/x.35/ExpressSkins Library/Sources/dxSkinValentine.res new file mode 100644 index 00000000..be7d0905 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinValentine.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinXmas2008Blue.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinXmas2008Blue.pas new file mode 100644 index 00000000..6884201b --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinXmas2008Blue.pas @@ -0,0 +1,75 @@ +unit dxSkinXmas2008Blue; + +interface + +uses + Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, dxSkinsLookAndFeelPainter; + +type + { TdxXmas2008BluePainter } + TdxXmas2008BluePainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +const + SkinsCount = 1; + SkinNames: array[0..SkinsCount - 1] of ShortString = + ('Xmas2008Blue'); + SkinPainters: array[0..SkinsCount - 1] of TcxCustomLookAndFeelPainterClass = + (TdxXmas2008BluePainter); + +implementation + +{$R dxSkinXmas2008Blue.res} + +var + CachedPainterData: array[0..SkinsCount - 1] of TdxSkinLookAndFeelPainterInfo; + +{ TdxXmas2008BluePainter } + +class function TdxXmas2008BluePainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData[0]; +end; + +class function TdxXmas2008BluePainter.InternalUnitName: string; +begin + Result := 'dxSkinXmas2008Blue'; +end; + + +procedure RegisterPainters; +var + SkinIndex: Integer; +begin + if not CheckGdiPlus then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + begin + CachedPainterData[SkinIndex] := + TdxSkinLookAndFeelPainterInfo.Create(TdxSkin.Create(SkinNames[SkinIndex], True, HInstance)); + GetExtendedStylePainters.Register( + SkinNames[SkinIndex], SkinPainters[SkinIndex], CachedPainterData[SkinIndex]); + end; +end; + +procedure UnregisterPainters; +var + SkinIndex: Integer; +begin + if GetExtendedStylePainters = nil then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + GetExtendedStylePainters.UnRegister(SkinNames[SkinIndex]); +end; + +{$IFNDEF DXSKINDYNAMICLOADING} +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinXmas2008Blue.res b/official/x.35/ExpressSkins Library/Sources/dxSkinXmas2008Blue.res new file mode 100644 index 00000000..63557aac Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinXmas2008Blue.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkiniMaginary.pas b/official/x.35/ExpressSkins Library/Sources/dxSkiniMaginary.pas new file mode 100644 index 00000000..73750fee --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkiniMaginary.pas @@ -0,0 +1,75 @@ +unit dxSkiniMaginary; + +interface + +uses + Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, dxSkinsLookAndFeelPainter; + +type + { TdxiMaginaryPainter } + TdxiMaginaryPainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +const + SkinsCount = 1; + SkinNames: array[0..SkinsCount - 1] of ShortString = + ('iMaginary'); + SkinPainters: array[0..SkinsCount - 1] of TcxCustomLookAndFeelPainterClass = + (TdxiMaginaryPainter); + +implementation + +{$R dxSkiniMaginary.res} + +var + CachedPainterData: array[0..SkinsCount - 1] of TdxSkinLookAndFeelPainterInfo; + +{ TdxiMaginaryPainter } + +class function TdxiMaginaryPainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData[0]; +end; + +class function TdxiMaginaryPainter.InternalUnitName: string; +begin + Result := 'dxSkiniMaginary'; +end; + + +procedure RegisterPainters; +var + SkinIndex: Integer; +begin + if not CheckGdiPlus then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + begin + CachedPainterData[SkinIndex] := + TdxSkinLookAndFeelPainterInfo.Create(TdxSkin.Create(SkinNames[SkinIndex], True, HInstance)); + GetExtendedStylePainters.Register( + SkinNames[SkinIndex], SkinPainters[SkinIndex], CachedPainterData[SkinIndex]); + end; +end; + +procedure UnregisterPainters; +var + SkinIndex: Integer; +begin + if GetExtendedStylePainters = nil then Exit; + for SkinIndex := 0 to SkinsCount - 1 do + GetExtendedStylePainters.UnRegister(SkinNames[SkinIndex]); +end; + +{$IFNDEF DXSKINDYNAMICLOADING} +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); +{$ENDIF} + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkiniMaginary.res b/official/x.35/ExpressSkins Library/Sources/dxSkiniMaginary.res new file mode 100644 index 00000000..f9ba3acf Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkiniMaginary.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinsDefaultPainters.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinsDefaultPainters.pas new file mode 100644 index 00000000..8ecde0ac --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinsDefaultPainters.pas @@ -0,0 +1,281 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinsDefaultPainters; + +{$I cxVer.inc} + +interface + +uses + Windows, SysUtils, Classes, dxGDIPlusApi, cxLookAndFeelPainters, dxSkinsCore, + dxSkinsLookAndFeelPainter, dxSkinsStrs; + +const + sdxDefaultUserSkinData = 'DefaultUserSkinData'; + sdxSkinsUserSkinName = 'UserSkin'; + +type + + { TdxSkinsUserSkinPainter } + + TdxSkinsUserSkinPainter = class(TdxSkinLookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; override; + public + class function InternalUnitName: string; override; + end; + +procedure dxSkinsPopulateSkinResources(AModule: HMODULE; AResNames, ASkinNames: TStringList); +function dxSkinsUserSkinLoadFromFile(const AFileName: string; const ASkinName: string = ''): Boolean; +function dxSkinsUserSkinLoadFromStream(AStream: TStream; const ASkinName: string = ''): Boolean; +function dxSkinsUserSkinPopulateSkinNames(AStream: TStream; AList: TStrings): Boolean; overload; +function dxSkinsUserSkinPopulateSkinNames(const AFileName: string; AList: TStrings): Boolean; overload; + +implementation + +uses + dxSkinInfo, cxLookAndFeels; + +{$R dxSkinsDefaultPainters.res} + +type + + { TdxSkinUserLookAndFeelPainterInfo } + + TdxSkinUserLookAndFeelPainterInfo = class(TdxSkinLookAndFeelPainterInfo) + protected + procedure SkinChanged(Sender: TdxSkin); override; + end; + +procedure TdxSkinUserLookAndFeelPainterInfo.SkinChanged(Sender: TdxSkin); +begin + inherited SkinChanged(Sender); + RootLookAndFeel.Refresh; +end; + +var + CachedPainterData: TdxSkinUserLookAndFeelPainterInfo; + +function ReadStringFromStream(AStream: TStream): string; +var + L: Integer; +begin + AStream.Read(L, SizeOf(L)); + SetLength(Result, L); + if L > 0 then + AStream.ReadBuffer(Result[1], L); +end; + +type + TdxListPair = class + public + ResNames, SkinNames: TStringList; + end; + +function EnumResNameProc(hModule: HMODULE; lpszType: LPCTSTR; + lpszName: LPTSTR; AData: TdxListPair): Boolean; stdcall; + + function IsSkinResource(var ASkinName: string): Boolean; + var + AStream: TStream; + AVersion: Double; + begin + AStream := TResourceStream.Create(hModule, lpszName, lpszType); + try + Result := dxSkinCheckSignature(AStream, AVersion); + if Result then + begin + ASkinName := ReadStringFromStream(AStream); + Result := Result and + (AData.ResNames.IndexOf(lpszName) = -1) and + (AData.SkinNames.IndexOf(ASkinName) = -1); + end; + finally + AStream.Free; + end; + end; + +var + ASkinName: string; +begin + Result := True; + if IsSkinResource(ASkinName) then + begin + AData.SkinNames.AddObject(ASkinName, + TObject(AData.ResNames.AddObject(lpszName, TObject(hModule)))); + end; +end; + +procedure dxSkinsPopulateSkinResources(AModule: HMODULE; AResNames, ASkinNames: TStringList); +var + AData: TdxListPair; +begin + AResNames.Clear; + ASkinNames.Clear; + AData := TdxListPair.Create; + try + AData.ResNames := AResNames; + AData.SkinNames := ASkinNames; + Windows.EnumResourceNames(AModule, PChar(sdxResourceType), @EnumResNameProc, Integer(AData)); + ASkinNames.Sort; + finally + AData.Free; + end; +end; + +function dxSkinsUserSkinLoadFromFile(const AFileName: string; + const ASkinName: string = ''): Boolean; +var + AFileStream: TFileStream; +begin + AFileStream := TFileStream.Create(AFileName, fmOpenRead or fmShareDenyNone); + try + Result := dxSkinsUserSkinLoadFromStream(AFileStream, ASkinName); + finally + AFileStream.Free; + end; +end; + +function LoadUserSkinDataFromStream(AStream: TStream; APosition: Int64 = 0): Boolean; +begin + AStream.Position := APosition; + CachedPainterData.Skin.LoadFromStream(AStream); + Result := True; +end; + +function dxSkinsUserSkinLoadFromStream(AStream: TStream; const ASkinName: string = ''): Boolean; +var + ASavedPosition: Int64; + ASkinCount: Integer; + ASkinSize: Integer; + AVersion: Double; + I: Integer; +begin + Result := dxSkinCheckSignature(AStream, AVersion) and (AVersion > 1.00); + if Result then + begin + Result := AStream.Read(ASkinCount, SizeOf(ASkinCount)) = SizeOf(ASkinCount); + if not Result then Exit; + for I := 0 to ASkinCount - 1 do + begin + AStream.Read(ASkinSize, SizeOf(ASkinSize)); + ASavedPosition := AStream.Position; + Result := not dxSkinCheckSignature(AStream, AVersion) and + LoadUserSkinDataFromStream(AStream); + if Result then Break; + Result := ((ASkinName = '') or + SameText(ReadStringFromStream(AStream), ASkinName)) and + LoadUserSkinDataFromStream(AStream, ASavedPosition); + if Result then Break; + AStream.Position := ASavedPosition + ASkinSize; + end; + end; +end; + +function dxSkinsUserSkinPopulateSkinNames(AStream: TStream; AList: TStrings): Boolean; +var + ASavedPosition: Int64; + ASkinCount: Integer; + ASkinSize: Integer; + AVersion: Double; + I: Integer; +begin + Result := dxSkinCheckSignature(AStream, AVersion) and (AVersion > 1.00); + if Result then + begin + Result := AStream.Read(ASkinCount, SizeOf(ASkinCount)) = SizeOf(ASkinCount); + if not Result then Exit; + for I := 0 to ASkinCount - 1 do + begin + AStream.Read(ASkinSize, SizeOf(ASkinSize)); + ASavedPosition := AStream.Position; + Result := dxSkinCheckSignature(AStream, AVersion); + if not Result then Exit; + AList.Add(ReadStringFromStream(AStream)); + AStream.Position := ASavedPosition + ASkinSize; + end; + end; +end; + +function dxSkinsUserSkinPopulateSkinNames(const AFileName: string; AList: TStrings): Boolean; +var + AFileStream: TFileStream; +begin + AFileStream := TFileStream.Create(AFileName, fmOpenRead or fmShareDenyNone); + try + Result := dxSkinsUserSkinPopulateSkinNames(AFileStream, AList); + finally + AFileStream.Free; + end; +end; + +{ TdxSkinsUserSkinPainter } + +class function TdxSkinsUserSkinPainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + Result := CachedPainterData; +end; + +class function TdxSkinsUserSkinPainter.InternalUnitName: string; +begin + Result := 'dxSkinsDefaultPainters'; +end; + +// + +procedure RegisterPainters; +begin + if CheckGdiPlus then + begin + CachedPainterData := TdxSkinUserLookAndFeelPainterInfo.Create( + TdxSkin.Create(sdxDefaultUserSkinData, True, HInstance)); + GetExtendedStylePainters.Register(sdxSkinsUserSkinName, TdxSkinsUserSkinPainter, + CachedPainterData); + end; +end; + +procedure UnregisterPainters; +begin + if GetExtendedStylePainters <> nil then + GetExtendedStylePainters.UnRegister(sdxSkinsUserSkinName); +end; + +initialization + dxUnitsLoader.AddUnit(@RegisterPainters, @UnregisterPainters); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainters); + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinsDefaultPainters.res b/official/x.35/ExpressSkins Library/Sources/dxSkinsDefaultPainters.res new file mode 100644 index 00000000..89e21c63 Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinsDefaultPainters.res differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinsDesignHelperReg.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinsDesignHelperReg.pas new file mode 100644 index 00000000..5ae00e4a --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinsDesignHelperReg.pas @@ -0,0 +1,85 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinsDesignHelperReg; + +{$I cxVer.inc} + +interface + +uses + Classes, Types, DesignIntf, DesignEditors, cxControls, cxLookAndFeels, + cxLookAndFeelPainters, dxSkinsLookAndFeelPainter; + +type + { TdxSkinsBaseSelectionEditor } + + TdxSkinsBaseSelectionEditor = class(TSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + +procedure Register; + +implementation + +{ TdxSkinsBaseSelectionEditor } + +procedure TdxSkinsBaseSelectionEditor.RequiresUnits(Proc: TGetStrProc); +var + AExtendedPainters: TcxExtendedStylePainters; + APainter: TcxCustomLookAndFeelPainterClass; + I: Integer; +begin + inherited RequiresUnits(Proc); + Proc('dxSkinsCore'); + AExtendedPainters := GetExtendedStylePainters; + for I := 0 to AExtendedPainters.Count - 1 do + begin + APainter := AExtendedPainters.Painters[I]; + if APainter.InheritsFrom(TdxSkinLookAndFeelPainter) then + Proc(TdxSkinLookAndFeelPainterClass(APainter).InternalUnitName); + end; +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterSelectionEditor(TcxControl, TdxSkinsBaseSelectionEditor); + RegisterSelectionEditor(TcxLookAndFeelController, TdxSkinsBaseSelectionEditor); +end; + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinsForm.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinsForm.pas new file mode 100644 index 00000000..a418eb04 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinsForm.pas @@ -0,0 +1,3359 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinsForm; + +interface + +{$I cxVer.inc} + +uses + Types, Windows, Classes, SysUtils, Messages, Forms, Graphics, Controls, cxScrollBar, + MultiMon, cxDWMAPI, ShellApi, cxLookAndFeelPainters, cxClasses, StdCtrls, + cxGraphics, cxControls, cxGeometry, dxSkinsLookAndFeelPainter, dxSkinsCore, Math, + ExtCtrls, FlatSB, cxLookAndFeels, dxUxTheme, dxSkinInfo; + +const + dxSkinFormTextOffset = 5; + dxSkinIconSpacing = 2; + WM_POSTREDRAW: Cardinal = WM_DX + 1; + WM_CHILDCHANGED: Cardinal = WM_DX + 2; + WM_POSTCREATE: Cardinal = WM_DX + 3; + WM_POSTCHECKRGN: Cardinal = WM_DX + 4; + IsDesigning: Boolean = False; + +type + TdxSkinFormPainter = class; + TdxSkinFormNonClientAreaInfo = class; + + TdxSkinFormCorner = (sfcLeftTop, sfcRightTop, sfcLeftBottom, sfcRightBottom); + + TdxScrollAreaElement = (saeHorzScroll, saeVertScroll, saeSizeGrip); + TdxScrollAreaElements = set of TdxScrollAreaElement; + TdxSkinFormScrollBar = saeHorzScroll..saeVertScroll; + + TdxSkinFormEvent = procedure(Sender: TObject; AForm: TCustomForm; + var ASkinName: string; var UseSkin: Boolean) of object; + TdxSkinControlEvent = procedure(Sender: TObject; AControl: TWinControl; + var UseSkin: Boolean) of object; + + { TdxSkinController } + + TdxSkinController = class(TcxLookAndFeelController) + private + FOnSkinControl: TdxSkinControlEvent; + FOnSkinForm: TdxSkinFormEvent; + function GetUseSkins: Boolean; + procedure SetUseSkins(Value: Boolean); + protected + procedure Changed; + function DoSkinControl(AControl: TWinControl): Boolean; virtual; + function DoSkinForm(AForm: TCustomForm): TdxSkinLookAndFeelPainterClass; virtual; + function DoSkinFormEx(AForm: TCustomForm; + var ASkinName: string; var AUseSkin: Boolean): TdxSkinLookAndFeelPainterClass; virtual; + procedure Loaded; override; + procedure MasterLookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); override; + procedure MasterLookAndFeelDestroying(Sender: TcxLookAndFeel); override; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Refresh; + class function GetFormSkin(AForm: TCustomForm; var ASkinName: string): Boolean; + published + property Kind; + property NativeStyle; + property SkinName; + property UseSkins: Boolean read GetUseSkins write SetUseSkins default True; + property OnSkinForm: TdxSkinFormEvent read FOnSkinForm write FOnSkinForm; + property OnSkinControl: TdxSkinControlEvent read FOnSkinControl write FOnSkinControl; + end; + + { TdxSkinWinController } + + TdxSkinWinController = class(TcxIUnknownObject, IcxMouseTrackingCaller) + private + FHandle: HWND; + FLookAndFeelPainter: TdxSkinLookAndFeelPainterClass; + FMaster: TdxSkinWinController; + FProcInstance: Pointer; + FSavedWndProc: TWndMethod; + FSavedWndProcPtr: Pointer; + FWinControl: TWinControl; + function GetHasVirtualChilds: Boolean; + function GetIsHooked: Boolean; + function GetIsMDIClient: Boolean; + function GetLookAndFeelPainter: TdxSkinLookAndFeelPainterClass; + procedure SetHandle(AHandle: HWND); + protected + function GetIsSkinUsed: Boolean; virtual; + function GetMaster(AHandle: HWND): TdxSkinWinController; virtual; + function GetUseSkinForControl: Boolean; virtual; + procedure DefWndProc(var AMessage); + procedure HookWndProc; virtual; + procedure InitializePainter; virtual; + procedure RedrawWindow(AUpdateNow: Boolean); + procedure UnHookWndProc; virtual; + procedure WndProc(var AMessage: TMessage); virtual; + { IcxMouseTrackingCaller } + procedure MouseLeave; virtual; + public + constructor Create(AHandle: HWND); virtual; + destructor Destroy; override; + + class function IsMDIChildWindow(AHandle: HWND): Boolean; virtual; + class function IsMDIClientWindow(AHandle: HWND): Boolean; virtual; + class function IsMessageDlgWindow(AHandle: HWND): Boolean; virtual; + class function IsSkinActive(AHandle: HWND): Boolean; + class procedure FinalizeEngine(AHandle: HWND); + class procedure InitializeEngine(AHandle: HWND); + + function GetSkinName(var ASkinName: string): Boolean; + procedure Refresh; virtual; + procedure Update; virtual; + + property Handle: HWND read FHandle write SetHandle; + property HasVirtualChilds: Boolean read GetHasVirtualChilds; + property IsHooked: Boolean read GetIsHooked; + property IsMDIClient: Boolean read GetIsMDIClient; + property IsSkinUsed: Boolean read GetIsSkinUsed; + property LookAndFeelPainter: TdxSkinLookAndFeelPainterClass read GetLookAndFeelPainter; + property Master: TdxSkinWinController read FMaster; + property ProcInstance: Pointer read FProcInstance; + property WinControl: TWinControl read FWinControl; + end; + + TdxSkinWinControllerClass = class of TdxSkinWinController; + TdxSkinGetControllerClassForWindowProc = function (AWnd: HWND): TdxSkinWinControllerClass; + + { TdxSkinFormController } + + TdxSkinFormController = class(TdxSkinWinController) + private + FForceRedraw: Boolean; + FHasRegion: Boolean; + FLockRedrawCount: Integer; + FMaster: TdxSkinFormController; + FPainter: TdxSkinFormPainter; + FSizingInProcess: Boolean; + FViewInfo: TdxSkinFormNonClientAreaInfo; + function GetForm: TCustomForm; + function GetIsMDIMain: Boolean; + protected + function GetIsSkinUsed: Boolean; override; + function NeedForceRgnUpdate(ASizeType: Integer): Boolean; + procedure CalculateViewInfo; virtual; + procedure CheckWindowRgn(AForceRgn: Boolean); + procedure DrawWindowBackground(DC: HDC); virtual; + procedure DrawWindowBorder; virtual; + procedure InitializeMessageForm; virtual; + procedure InitializePainter; override; + function HandleWindowMessage(var AMessage: TMessage): Boolean; virtual; + procedure LockRedraw; + procedure MouseLeave; override; + function RefreshOnMouseEvent(AForceRefresh: Boolean = False): Boolean; + procedure UnlockRedraw; + procedure UpdateMDIClientEdge; + procedure UpdateScrollTrackPos(AKind: TdxSkinFormScrollBar; APos: Integer); + procedure WMDestroy(var Message: TWMDestroy); virtual; + procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); virtual; + procedure WMNCActivate(var Message: TWMNCActivate); virtual; + procedure WMNCButtonDown(var Message: TWMNCHitMessage); virtual; + procedure WMNCCalcSize(var Message: TWMNCCALCSIZE); virtual; + procedure WMNCHitTest(var Message: TWMNCHitTest); virtual; + procedure WMNCLButtonUp(var Message: TWMNCHitMessage); virtual; + procedure WMNCMouseMove(var Message: TWMNCHitMessage); + procedure WMNCPaint(var Message: TWMNCPaint); virtual; + procedure WMScroll(var Message: TWMScroll); virtual; + procedure WMSetText(var Message: TWMSetText); virtual; + procedure WMSize(var Message: TWMSize); virtual; + procedure WMSizing(var Message: TWMSize); virtual; + procedure WMSysCommand(var Message: TWMSysCommand); virtual; + procedure WndProc(var AMessage: TMessage); override; + public + constructor Create(AHandle: HWND); override; + destructor Destroy; override; + procedure Update; override; + + property ForceRedraw: Boolean read FForceRedraw write FForceRedraw; + property Form: TCustomForm read GetForm; + property HasRegion: Boolean read FHasRegion write FHasRegion; + property IsMDIMain: Boolean read GetIsMDIMain; + property Painter: TdxSkinFormPainter read FPainter; + property SizingInProcess: Boolean read FSizingInProcess write FSizingInProcess; + property ViewInfo: TdxSkinFormNonClientAreaInfo read FViewInfo; + end; + + { TdxSkinFormNonClientAreaInfo } + + TdxSkinFormNonClientAreaInfo = class + private + FController: TdxSkinFormController; + FThemeActive: Boolean; + FThemeActiveAssigned: Boolean; + function GetBorderBounds(ASide: TcxBorder): TRect; + function GetButtonPressed: Boolean; + function GetCaptionBounds: TRect; + function GetCaptionButtonRect(const ACaptionRect: TRect): TRect; + function GetCaptionContentOffset: TRect; + function GetCaptionIconSize: Integer; + function GetCaptionTextColor: TColor; + function GetClientRect: TRect; + function GetClientRectOnClient: TRect; + function GetExStyle: Integer; + function GetHandle: HWND; + function GetHasBorder: Boolean; + function GetHasCaption: Boolean; + function GetHasMenu: Boolean; + function GetIconBounds(AIcon: TdxSkinFormIcon): TRect; + function GetIconState(AIcon: TdxSkinFormIcon): TdxSkinElementState; + function GetIsAlphaBlendUsed: Boolean; + function GetIsDialog: Boolean; + function GetIsIconic: Boolean; + function GetIsSizeBox: Boolean; + function GetIsZoomed: Boolean; + function GetNativeBorderWidth: Boolean; + function GetNeedCheckNonClientSize: Boolean; + function GetScrollAreaBounds(AItem: TdxScrollAreaElement): TRect; + function GetScrollBarInfo(AScrollBar: TdxSkinFormScrollBar): TScrollBarInfo; + function GetScrollBarPartBounds(AScrollBar: TdxSkinFormScrollBar; APart: TcxScrollBarPart): TRect; + function GetScrollBarPartState(AScrollBar: TdxSkinFormScrollBar; APart: TcxScrollBarPart): TcxButtonState; + function GetSizeArea(ASide: TcxBorder): TRect; + function GetSizeCorners(ACorner: TdxSkinFormCorner): TRect; + function GetSkinBorderWidth(ASide: TcxBorder): Integer; + function GetStyle: Integer; + function GetThemeActive: Boolean; + function GetToolWindow: Boolean; + function GetWindowRect: TRect; + procedure SetActive(AActive: Boolean); + procedure SetUpdateRgn(ARgn: HRGN); + procedure SetWindowRgn(ARgn: HRGN); + protected + FActive: Boolean; + FBorderBounds: array[TcxBorder] of TRect; + FBorderWidths: TRect; + FBoundsNoBorders: TRect; + FCaption: string; + FCaptionBounds: TRect; + FCaptionFont: TFont; + FCaptionSufix: string; + FCaptionTextColor: array[Boolean] of TColor; + FCaptionTextShadowColor: TColor; + FHasMenu: Boolean; + FIconBounds: array[TdxSkinFormIcon] of TRect; + FIconPressed: TdxSkinFormIcon; + FIcons: TdxSkinFormIcons; + FIconState: array[TdxSkinFormIcon] of TdxSkinElementState; + FIsMDIClient: Boolean; + FIsSimpleForm: Boolean; + FMenuBounds: TRect; + FPainter: TcxCustomLookAndFeelPainterClass; + FPainterInfo: TdxSkinLookAndFeelPainterInfo; + FScrollAreaBounds: array[TdxScrollAreaElement] of TRect; + FScrollAreaElements: TdxScrollAreaElements; + FScrollBarPartBounds: array[TdxSkinFormScrollBar, TcxScrollBarPart] of TRect; + FScrollBarPartState: array[TdxSkinFormScrollBar, TcxScrollBarPart] of TcxButtonState; + FScrollBarsInfo: array[TdxSkinFormScrollBar] of TScrollBarInfo; + FSizeFrame: TSize; + FSysMenuIcon: HICON; + FTrackedScrollBar: TdxScrollAreaElement; + FTrackIcon: TdxSkinFormIcon; + FUpdateRgn: HRGN; + FWindowBounds: TRect; + FWindowRgn: HRGN; + WindowInfo: TWindowInfo; + procedure CalculateBordersInfo; virtual; + procedure CalculateBorderWidths; virtual; + procedure CalculateCaptionIconsInfo; virtual; + procedure CalculateFontInfo; + procedure CalculateScrollArea; virtual; + procedure CalculateScrollBarPartInfo(AScrollBar: TdxSkinFormScrollBar; + Pos1, Pos2: Integer; APart: TcxScrollBarPart); + procedure CalculateScrollBarPartsInfo; virtual; + function GetActiveMDIChild: TCustomForm; + function GetBorderRect(ASide: TcxBorder; const ABounds, AWidths: TRect): TRect; + function GetCaption: string; + function GetIcons: TdxSkinFormIcons; virtual; + function GetMaximizedMDIChild: TCustomForm; + function GetSysMenuIcon: HICON; virtual; + function GetSystemSizeFrame: TSize; + function IsMDIMainAlphaBlendUsed: Boolean; + procedure UpdateCaption(const ANewText: string); + function UpdateCaptionIconStates: Boolean; + function UpdateCaptionSufix: Boolean; + function UpdateIconPressed(AReset: Boolean = False): TdxSkinFormIcon; + property ThemeActiveAssigned: Boolean read FThemeActiveAssigned write FThemeActiveAssigned; + public + constructor Create(AController: TdxSkinFormController); virtual; + destructor Destroy; override; + procedure Calculate(AUpdateRgn: HRGN); virtual; + function ClientToScreen(const P: TPoint): TPoint; overload; + function ClientToScreen(const R: TRect): TRect; overload; + function CreateDrawRgn: HRGN; virtual; + function GetHitTest(AHitPoint: TPoint; AHitTest: Integer = 0): Integer; + function GetIconHitTest: TdxSkinFormIcon; + function GetIconHitTestFromHitTest(AHitTest: Integer): TdxSkinFormIcon; + function GetScrollBarHitTest(var AScrollBar: TdxSkinFormScrollBar; var APart: TcxScrollBarPart): Boolean; + function ScreenToClient(const P: TSmallPoint): TPoint; overload; + function ScreenToClient(const P: TPoint): TPoint; overload; + function ScreenToClient(const R: TRect): TRect; overload; + + property Active: Boolean read FActive write SetActive; + property BorderBounds[ASide: TcxBorder]: TRect read GetBorderBounds; + property BorderWidths: TRect read FBorderWidths; + property BoundsNoBorders: TRect read FBoundsNoBorders; + property ButtonPressed: Boolean read GetButtonPressed; + property Caption: string read GetCaption; + property CaptionBounds: TRect read FCaptionBounds; + property CaptionFont: TFont read FCaptionFont; + property CaptionTextColor: TColor read GetCaptionTextColor; + property CaptionTextShadowColor: TColor read FCaptionTextShadowColor write FCaptionTextShadowColor; + property ClientRect: TRect read GetClientRect; + property ClientRectOnClient: TRect read GetClientRectOnClient; + property Controller: TdxSkinFormController read FController; + property ExStyle: Integer read GetExStyle; + property Handle: HWND read GetHandle; + property HasBorder: Boolean read GetHasBorder; + property HasCaption: Boolean read GetHasCaption; + property HasMenu: Boolean read GetHasMenu; + property IconBounds[AIcon: TdxSkinFormIcon]: TRect read GetIconBounds; + property IconPressed: TdxSkinFormIcon read FIconPressed write FIconPressed; + property Icons: TdxSkinFormIcons read FIcons; + property IconState[AIcon: TdxSkinFormIcon]: TdxSkinElementState read GetIconState; + property IsAlphaBlendUsed: Boolean read GetIsAlphaBlendUsed; + property IsDialog: Boolean read GetIsDialog; + property IsIconic: Boolean read GetIsIconic; + property IsMDIClient: Boolean read FIsMDIClient; + property IsSizebox: Boolean read GetIsSizeBox; + property IsZoomed: Boolean read GetIsZoomed; + property MenuBounds: TRect read FMenuBounds; + property NativeBorderWidth: Boolean read GetNativeBorderWidth; + property NeedCheckNonClientSize: Boolean read GetNeedCheckNonClientSize; + property Painter: TcxCustomLookAndFeelPainterClass read FPainter; + property PainterInfo: TdxSkinLookAndFeelPainterInfo read FPainterInfo; + property ScrollAreaBounds[AItem: TdxScrollAreaElement]: TRect read GetScrollAreaBounds; + property ScrollAreaElements: TdxScrollAreaElements read FScrollAreaElements; + property ScrollBarInfo[AScrollBar: TdxSkinFormScrollBar]: TScrollBarInfo read GetScrollBarInfo; + property ScrollBarPartBounds[AScrollBar: TdxSkinFormScrollBar; APart: TcxScrollBarPart]: TRect read GetScrollBarPartBounds; + property ScrollBarPartState[AScrollBar: TdxSkinFormScrollBar; APart: TcxScrollBarPart]: TcxButtonState read GetScrollBarPartState; + property SimpleForm: Boolean read FIsSimpleForm; + property SizeArea[ASide: TcxBorder]: TRect read GetSizeArea; + property SizeCorners[ACorner: TdxSkinFormCorner]: TRect read GetSizeCorners; + property SizeFrame: TSize read FSizeFrame; + property SkinBorderWidth[ASide: TcxBorder]: Integer read GetSkinBorderWidth; + property Style: Integer read GetStyle; + property SysMenuIcon: HICON read FSysMenuIcon; + property SystemSizeFrame: TSize read GetSystemSizeFrame; + property ThemeActive: Boolean read GetThemeActive; + property ToolWindow: Boolean read GetToolWindow; + property TrackedScrollBar: TdxScrollAreaElement read FTrackedScrollBar write FTrackedScrollBar; + property TrackIcon: TdxSkinFormIcon read FTrackIcon write FTrackIcon; + property UpdateRgn: HRGN read FUpdateRgn write SetUpdateRgn; + property WindowBounds: TRect read FWindowBounds; + property WindowRect: TRect read GetWindowRect; + property WindowRgn: HRGN read FWindowRgn write SetWindowRgn; + end; + + { TdxSkinFormPainter } + + TdxSkinFormPainter = class + private + FBaseCanvas: TCanvas; + FBordersCache: array[TcxBorder] of TdxSkinElementCache; + FCanvas: TcxCanvas; + FDC: HDC; + FIconsCache: array[TdxSkinFormIcon] of TdxSkinElementCache; + FNeedRelease: Boolean; + FPainter: TcxCustomLookAndFeelPainterClass; + FPainterInfo: TdxSkinLookAndFeelPainterInfo; + FViewInfo: TdxSkinFormNonClientAreaInfo; + function GetActive: Boolean; + function GetIconElement(AIcon: TdxSkinFormIcon): TdxSkinElement; + function GetIsBordersThin: Boolean; + protected + procedure CreateCacheInfos; + procedure DrawBackground(DC: HDC; const R: TRect); virtual; + procedure DrawScrollAreaElements(DC: HDC); virtual; + procedure DrawScrollBar(DC: HDC; + AScrollBar: TdxSkinFormScrollBar; const R: TRect); virtual; + procedure DrawSizeGrip(DC: HDC; const R: TRect); + procedure DrawWindowCaption(DC: HDC; + const R: TRect; AElement: TdxSkinElement); virtual; + procedure DrawWindowIcon(DC: HDC; const R: TRect; + AIcon: TdxSkinFormIcon; AElement: TdxSkinElement); virtual; + procedure FreeCacheInfos; + procedure InternalDrawBorder(const R: TRect; ASide: TcxBorder; + AFillBackground: Boolean); + procedure InternalDrawBorders; + procedure InternalDrawCaption(const R: TRect; AElement: TdxSkinElement); + procedure InternalDrawThinBorders; + public + constructor Create(AViewInfo: TdxSkinFormNonClientAreaInfo); virtual; + destructor Destroy; override; + procedure BeginPaint(ADestDC: HDC = 0); + procedure DrawWindowBackground; virtual; + procedure DrawWindowBorder; virtual; + procedure EndPaint; + function IsRectVisible(const R: TRect): Boolean; + function SelectDC(DC: HDC): Integer; + + property Active: Boolean read GetActive; + property Canvas: TcxCanvas read FCanvas; + property IconElements[AIcon: TdxSkinFormIcon]: TdxSkinElement read GetIconElement; + property IsBordersThin: Boolean read GetIsBordersThin; + property Painter: TcxCustomLookAndFeelPainterClass read FPainter; + property PainterInfo: TdxSkinLookAndFeelPainterInfo read FPainterInfo; + property ViewInfo: TdxSkinFormNonClientAreaInfo read FViewInfo; + end; + + { TdxSkinCustomControlViewInfo } + + TdxSkinCustomControlViewInfo = class + private + FController: TdxSkinWinController; + function GetClientRect: TRect; + function GetIsEnabled: Boolean; + function GetIsFocused: Boolean; + function GetIsMouseAtControl: Boolean; + public + constructor Create(AController: TdxSkinWinController); virtual; + property ClientRect: TRect read GetClientRect; + property Controller: TdxSkinWinController read FController; + property IsEnabled: Boolean read GetIsEnabled; + property IsFocused: Boolean read GetIsFocused; + property IsMouseAtControl: Boolean read GetIsMouseAtControl; + end; + TdxSkinCustomControlViewInfoClass = class of TdxSkinCustomControlViewInfo; + + { TdxSkinButtonViewInfo } + + TdxSkinButtonViewInfo = class(TdxSkinCustomControlViewInfo) + private + FCaption: string; + FPressed: Boolean; + FState: TcxButtonState; + procedure SetState(AState: TcxButtonState); + protected + procedure UpdateEnabledState; + public + constructor Create(AController: TdxSkinWinController); override; + property Caption: string read FCaption; + procedure MouseClickEvent(ADown: Boolean); virtual; + procedure MouseHoverEvent(AEnter: Boolean); virtual; + property Pressed: Boolean read FPressed; + property State: TcxButtonState read FState write SetState; + end; + + { TdxSkinCustomPainter } + + TdxSkinCustomControlPainter = class(TObject) + private + FCanvas: TCanvas; + FcxCanvas: TcxCanvas; + FDC: HDC; + FNeedRelease: Boolean; + FViewInfo: TdxSkinCustomControlViewInfo; + function GetController: TdxSkinWinController; + function GetPainter: TcxCustomLookAndFeelPainterClass; + protected + procedure BeginPaint(DC: HDC = 0); + procedure EndPaint; + property NeedRelease: Boolean read FNeedRelease; + public + constructor Create(AViewInfo: TdxSkinCustomControlViewInfo); + destructor Destroy; override; + procedure DrawBackground; + procedure DrawButton(const ACaption: string; const R: TRect; AState: TcxButtonState); + procedure DrawFocus(const R: TRect); + property Canvas: TcxCanvas read FcxCanvas; + property Controller: TdxSkinWinController read GetController; + property Painter: TcxCustomLookAndFeelPainterClass read GetPainter; + property ViewInfo: TdxSkinCustomControlViewInfo read FViewInfo; + end; + + { TdxSkinCustomController } + + TdxSkinCustomController = class(TdxSkinWinController) + private + FPainter: TdxSkinCustomControlPainter; + FViewInfo: TdxSkinCustomControlViewInfo; + protected + class function GetViewInfoClass: TdxSkinCustomControlViewInfoClass; virtual; + function GetMaster(AHandle: HWND): TdxSkinWinController; override; + procedure InitializePainter; override; + procedure WndProc(var AMessage: TMessage); override; + // Messages + function WMEraseBk(var AMessage: TWMEraseBkgnd): Boolean; virtual; + function WMPaint(var AMessage: TWMPaint): Boolean; virtual; + public + constructor Create(AHandle: HWND); override; + destructor Destroy; override; + procedure DrawBackground(DC: HDC = 0); + procedure DrawContent(DC: HDC = 0); virtual; + property Painter: TdxSkinCustomControlPainter read FPainter; + property ViewInfo: TdxSkinCustomControlViewInfo read FViewInfo; + end; + + { TdxSkinButtonController } + + TdxSkinButtonController = class(TdxSkinCustomController) + protected + function GetViewInfo: TdxSkinButtonViewInfo; + class function GetViewInfoClass: TdxSkinCustomControlViewInfoClass; override; + procedure MouseLeave; override; + procedure WndProc(var AMessage: TMessage); override; + public + procedure DrawContent(DC: HDC = 0); override; + property ViewInfo: TdxSkinButtonViewInfo read GetViewInfo; + end; + + { TdxSkinPanelController } + + TdxSkinPanelController = class(TdxSkinCustomController) + private + FPainting: Boolean; + protected + function WMEraseBk(var AMessage: TWMEraseBkgnd): Boolean; override; + function WMPaint(var AMessage: TWMPaint): Boolean; override; + procedure InternalDrawBackground(APanel: TCustomPanel; const R: TRect); + procedure WndProc(var AMessage: TMessage); override; + public + procedure DrawContent(DC: HDC = 0); override; + end; + + { TdxSkinFrameController } + + TdxSkinFrameController = class(TdxSkinCustomController) + protected + function WMPrintClient(var AMessage: TWMPrintClient): Boolean; + procedure WndProc(var AMessage: TMessage); override; + public + procedure DrawContent(DC: HDC = 0); override; + end; + +var + dxSkinGetControllerClassForWindowProc: TdxSkinGetControllerClassForWindowProc; + +function dxSkinGetControllerClassForWindow(AWnd: HWND): TdxSkinWinControllerClass; +implementation + +const + SC_TITLEDBLCLICK = 61490; +{$IFNDEF DELPHI7} + ICON_SMALL2 = 2; + + WM_NCMOUSELEAVE = $02A2; + WM_NCMOUSEHOVER = $02A0; +{$ENDIF} + WM_NCUAHDRAWCAPTION = $00AE; + WM_NCUAHDRAWFRAME = $00AF; + WM_SYNCPAINT = $0088; + + // hittests + CornerHitTests: array[TdxSkinFormCorner] of DWORD = + (HTTOPLEFT, HTTOPRIGHT, HTBOTTOMLEFT, HTBOTTOMRIGHT); + ResizeHitTests: array[TcxBorder] of DWORD = + (HTLEFT, HTTOP, HTRIGHT, HTBOTTOM); + IconsHitTest: array[TdxSkinFormIcon] of DWORD = + (HTSYSMENU, HTHELP, HTMINBUTTON, HTMAXBUTTON, HTMAXBUTTON, HTCLOSE); + IconCommand: array[TdxSkinFormIcon] of Integer = + (SC_DEFAULT, SC_CONTEXTHELP, SC_MINIMIZE, SC_MAXIMIZE, SC_RESTORE, SC_CLOSE); + + sdxMDICaptionFormat = '%s - [%s]'; + +const + CaptionFlags = DT_VCENTER or DT_SINGLELINE or DT_EDITCONTROL or DT_END_ELLIPSIS; + FrameStates: array[Boolean] of TdxSkinElementState = (esActiveDisabled, esActive); + +type + + { TdxSkinWinControllerHelper } + + TdxSkinWinControllerHelper = class(TObject) + private + FHandle: HWND; + protected + procedure WndProc(var AMsg: TMessage); + public + constructor Create; + destructor Destroy; override; + property Handle: HWND read FHandle; + end; + +var + FormControllers: TcxObjectList; + SkinControllersList: TList; + SkinHelper: TdxSkinWinControllerHelper; + WndProcHookHandle: HHOOK; + +type + TCustomFormAccess = class(TCustomForm); + TCustomFrameAccess = class(TCustomFrame); + TCustomLabelAccess = class(TCustomLabel); + TCustomPanelAccess = class(TCustomPanel); + TcxLookAndFeelAccess = class(TcxLookAndFeel); + +function GetControllerByControl(AControl: TWinControl): TdxSkinWinController; +var + I: Integer; +begin + Result := nil; + if AControl = nil then Exit; + for I := 0 to FormControllers.Count - 1 do + if TdxSkinWinController(FormControllers.Items[I]).WinControl = AControl then + begin + Result := TdxSkinWinController(FormControllers.Items[I]); + Break; + end; +end; + +function GetControllerByHandle(AHandle: HWND): TdxSkinWinController; +var + I: Integer; +begin + Result := nil; + for I := 0 to FormControllers.Count - 1 do + if TdxSkinWinController(FormControllers.Items[I]).Handle = AHandle then + begin + Result := TdxSkinWinController(FormControllers.Items[I]); + Break; + end; +end; + +function GetWindowCaption(AWnd: HWND): string; +var + L: Integer; +begin + L := SendMessage(AWnd, WM_GETTEXTLENGTH, 0, 0); + SetLength(Result, L); + if L > 0 then + SendMessage(AWnd, WM_GETTEXT, L + 1, Integer(@Result[1])); +end; + +function GetWindowClass(AWnd: HWND): string; +var + AClassName: array[Byte] of Char; +begin + if GetClassName(AWnd, @AClassName[0], 256) > 0 then + Result := AClassName + else + Result := ''; +end; + +procedure RefreshController(AController: TdxSkinFormController); +var + AIndex: Integer; + ASkinController: TdxSkinController; + ASkinName: string; + AUseSkin: Boolean; +begin + with AController do + for AIndex := SkinControllersList.Count - 1 downto 0 do + begin + ASkinController := TdxSkinController(SkinControllersList[AIndex]); + if (csDestroying in ASkinController.ComponentState) then + Continue; + if FLookAndFeelPainter = nil then + FLookAndFeelPainter := ASkinController.DoSkinForm(Form) + else + begin + AUseSkin := SendMessage(Form.Handle, dxWMGetSkinnedMessage, 0, 0) <> 1; + if AUseSkin then + begin + AUseSkin := GetSkinName(ASkinName); + FLookAndFeelPainter := ASkinController.DoSkinFormEx(Form, ASkinName, AUseSkin); + end + else + FLookAndFeelPainter := nil; + end; + end; +end; + +procedure RefreshControllers; +var + AIndex: Integer; +begin + for AIndex := 0 to FormControllers.Count - 1 do + with TdxSkinWinController(FormControllers[AIndex]) do + begin + FLookAndFeelPainter := nil; + if IsMDIClient then + Continue; + if FormControllers[AIndex] is TdxSkinFormController then + RefreshController(TdxSkinFormController(FormControllers[AIndex])); + end; + for AIndex := 0 to FormControllers.Count - 1 do + TdxSkinWinController(FormControllers[AIndex]).Update; +end; + +{ TdxSkinWinController } + +constructor TdxSkinWinController.Create(AHandle: HWND); +begin + FProcInstance := Classes.MakeObjectInstance(WndProc); + Handle := AHandle; +end; + +destructor TdxSkinWinController.Destroy; +begin + EndMouseTracking(Self); + Handle := 0; + {$IFDEF DELPHI6}Classes.{$ENDIF}FreeObjectInstance(FProcInstance); + inherited Destroy; +end; + +class procedure TdxSkinWinController.InitializeEngine(AHandle: HWND); +var + ANewController: TdxSkinWinController; +begin + ANewController := GetControllerByHandle(AHandle); + if ANewController = nil then + begin + ANewController := GetControllerByControl(FindControl(AHandle)); + if ANewController = nil then + begin + ANewController := Self.Create(AHandle); + ANewController.FMaster := ANewController.GetMaster(AHandle); + FormControllers.Add(ANewController); + end + else + ANewController.Handle := AHandle; + ANewController.InitializePainter; + ANewController.Update; + end; +end; + +class procedure TdxSkinWinController.FinalizeEngine(AHandle: HWND); +var + AController: TdxSkinWinController; +begin + AController := GetControllerByHandle(AHandle); + if Assigned(AController) then + begin + FormControllers.Remove(AController); + AController.Free; + end; +end; + +class function TdxSkinWinController.IsMDIChildWindow(AHandle: HWND): Boolean; +var + AControl: TWinControl; +begin + AControl := FindControl(AHandle); + Result := (AControl is TCustomForm) and + (TCustomFormAccess(AControl).FormStyle = fsMDIChild); +end; + +class function TdxSkinWinController.IsMDIClientWindow(AHandle: HWND): Boolean; +begin + Result := AnsiSameText(GetWindowClass(AHandle), 'MDICLIENT'); +end; + +class function TdxSkinWinController.IsSkinActive(AHandle: HWND): Boolean; +var + AController: TdxSkinWinController; +begin + AController := GetControllerByHandle(AHandle); + Result := Assigned(AController) and AController.IsSkinUsed; +end; + +class function TdxSkinWinController.IsMessageDlgWindow(AHandle: HWND): Boolean; +begin + Result := AnsiSameText(GetWindowClass(AHandle), 'TMessageForm'); +end; + +function TdxSkinWinController.GetHasVirtualChilds: Boolean; +var + AControl: TWinControl; + I: Integer; +begin + AControl := WinControl; + Result := False; + if Assigned(AControl) then + for I := 0 to AControl.ControlCount - 1 do + begin + Result := not (AControl.Controls[I] is TWinControl); + if Result then + Break; + end; +end; + +function TdxSkinWinController.GetIsHooked: Boolean; +begin + Result := (Handle <> 0) and ((FSavedWndProcPtr <> nil) or Assigned(FSavedWndProc)); +end; + +function TdxSkinWinController.GetIsMDIClient: Boolean; +begin + Result := Assigned(FMaster); +end; + +function TdxSkinWinController.GetLookAndFeelPainter: TdxSkinLookAndFeelPainterClass; +begin + Result := FLookAndFeelPainter; + if Master <> nil then + Result := Master.LookAndFeelPainter; +end; + +procedure TdxSkinWinController.SetHandle(AHandle: HWND); +begin + UnHookWndProc; + FHandle := AHandle; + FWinControl := FindControl(Handle); + Update; +end; + +function TdxSkinWinController.GetIsSkinUsed: Boolean; +begin + Result := LookAndFeelPainter <> nil; +end; + +function TdxSkinWinController.GetMaster(AHandle: HWND): TdxSkinWinController; +begin + Result := nil; + if IsMDIClientWindow(AHandle) then + Result := GetControllerByHandle(GetParent(AHandle)); +end; + +function TdxSkinWinController.GetUseSkinForControl: Boolean; +var + AControl: TWinControl; + AIndex: Integer; + ASkinController: TdxSkinController; + AUseSkin: Boolean; +begin + AControl := WinControl; + AUseSkin := cxUseSkins and (AControl <> nil); + if Assigned(AControl) then + for AIndex := SkinControllersList.Count - 1 downto 0 do + begin + ASkinController := TdxSkinController(SkinControllersList[AIndex]); + if (csDestroying in ASkinController.ComponentState) then + Continue; + AUseSkin := ASkinController.DoSkinControl(AControl); + if AUseSkin then + Break; + end; + Result := AUseSkin; +end; + +procedure TdxSkinWinController.DefWndProc(var AMessage); +begin + if FSavedWndProcPtr <> nil then + with TMessage(AMessage) do + Result := CallWindowProc(FSavedWndProcPtr, Handle, Msg, wParam, lParam) + else + if Assigned(FSavedWndProc) then + FSavedWndProc(TMessage(AMessage)); +end; + +procedure TdxSkinWinController.HookWndProc; +begin + if Handle = 0 then Exit; + UnHookWndProc; + if WinControl <> nil then + begin + FSavedWndProc := WinControl.WindowProc; + WinControl.WindowProc := WndProc; + end + else + begin + FSavedWndProcPtr := Pointer(GetWindowLong(Handle, GWL_WNDPROC)); + SetWindowLong(Handle, GWL_WNDPROC, Integer(FProcInstance)); + end; +end; + +procedure TdxSkinWinController.InitializePainter; +begin + // nothing todo +end; + +procedure TdxSkinWinController.RedrawWindow(AUpdateNow: Boolean); +var + AFlags: Integer; +const + DefaultFlags = RDW_ERASE or RDW_INVALIDATE or RDW_FRAME or RDW_ALLCHILDREN; +begin + if Handle = 0 then Exit; + AFlags := DefaultFlags; + if AUpdateNow then + AFlags := AFlags or RDW_UPDATENOW; + Windows.RedrawWindow(Handle, nil, 0, AFlags); +end; + +procedure TdxSkinWinController.UnHookWndProc; +begin + if IsHooked then + begin + if WinControl <> nil then + WinControl.WindowProc := FSavedWndProc + else + SetWindowLong(Handle, GWL_WNDPROC, Integer(FSavedWndProcPtr)); + FSavedWndProcPtr := nil; + FSavedWndProc := nil; + end; +end; + +function TdxSkinWinController.GetSkinName(var ASkinName: string): Boolean; +begin + Result := GetExtendedStylePainters.GetNameByPainter(FLookAndFeelPainter, ASkinName); +end; + +procedure TdxSkinWinController.Refresh; +const + Flags = SWP_FRAMECHANGED or SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE or + SWP_NOZORDER; +begin + if Handle <> 0 then + SetWindowPos(Handle, 0, 0, 0, 0, 0, Flags); +end; + +procedure TdxSkinWinController.Update; +begin + HookWndProc; + Refresh; + RedrawWindow(HasVirtualChilds); +end; + +procedure TdxSkinWinController.WndProc(var AMessage: TMessage); +begin + DefWndProc(AMessage); +end; + +procedure TdxSkinWinController.MouseLeave; +begin +end; + +{ TdxSkinController } + +constructor TdxSkinController.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + if SkinControllersList <> nil then + SkinControllersList.Add(Self); + Changed; +end; + +destructor TdxSkinController.Destroy; +begin + Changed; + if SkinControllersList <> nil then + SkinControllersList.Remove(Self); + inherited Destroy; +end; + +procedure TdxSkinController.Refresh; +begin + Changed; +end; + +class function TdxSkinController.GetFormSkin(AForm: TCustomForm; var ASkinName: string): Boolean; +var + AController: TdxSkinWinController; +begin + AController := GetControllerByHandle(AForm.Handle); + Result := Assigned(AController) and AController.GetSkinName(ASkinName); +end; + +procedure TdxSkinController.Changed; +begin + RefreshControllers; +end; + +function TdxSkinController.DoSkinControl(AControl: TWinControl): Boolean; +var + AUseSkin: Boolean; +begin + Result := AControl <> nil; + if Result then + begin + AUseSkin := True; + if Assigned(OnSkinControl) then + OnSkinControl(Self, AControl, AUseSkin); + Result := AUseSkin + end +end; + +function TdxSkinController.DoSkinForm( + AForm: TCustomForm): TdxSkinLookAndFeelPainterClass; +var + ASkinName: string; + AUseSkin: Boolean; +begin + if (AForm <> nil) and (SendMessage(AForm.Handle, dxWMGetSkinnedMessage, 0, 0) = 1) then + begin + ASkinName := ''; + AUseSkin := False; + end + else + begin + ASkinName := SkinName; + AUseSkin := UseSkins; + end; + Result := DoSkinFormEx(AForm, ASkinName, AUseSkin); +end; + +function TdxSkinController.DoSkinFormEx(AForm: TCustomForm; + var ASkinName: string; var AUseSkin: Boolean): TdxSkinLookAndFeelPainterClass; +var + APainter: TcxCustomLookAndFeelPainterClass; +begin + Result := nil; + if AForm = nil then Exit; + if Assigned(OnSkinForm) then + OnSkinForm(Self, AForm, ASkinName, AUseSkin); + if AUseSkin and (ASkinName <> '') and GetExtendedStylePainters.GetPainterByName( + ASkinName, APainter) and (APainter.InheritsFrom(TdxSkinLookAndFeelPainter)) then + Result := TdxSkinLookAndFeelPainterClass(APainter); +end; + +procedure TdxSkinController.Loaded; +begin + inherited Loaded; + Changed; +end; + +procedure TdxSkinController.MasterLookAndFeelChanged( + Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); +begin + inherited MasterLookAndFeelChanged(Sender, AChangedValues); + Changed; +end; + +procedure TdxSkinController.MasterLookAndFeelDestroying( + Sender: TcxLookAndFeel); +begin + inherited MasterLookAndFeelDestroying(Sender); + Changed; +end; + +function TdxSkinController.GetUseSkins: Boolean; +begin + Result := cxUseSkins; +end; + +procedure TdxSkinController.SetUseSkins(Value: Boolean); +begin + if Value <> UseSkins then + begin + cxLookAndFeels.cxUseSkins := Value; + TcxLookAndFeelAccess(RootLookAndFeel).Changed([lfvKind..lfvSkinName]); + Changed; + end; +end; + +{ TdxSkinFormController } + +constructor TdxSkinFormController.Create(AHandle: HWND); +begin + inherited Create(AHandle); + FViewInfo := TdxSkinFormNonClientAreaInfo.Create(Self); + FPainter := TdxSkinFormPainter.Create(FViewInfo); + if IsMessageDlgWindow(AHandle) then + InitializeMessageForm; +end; + +destructor TdxSkinFormController.Destroy; +var + I: Integer; +begin + cxClearObjectLinks(Self); + for I := 0 to SkinControllersList.Count - 1 do + with TdxSkinFormController(SkinControllersList[I]) do + if FMaster = Self then FMaster := nil; + FreeAndNil(FPainter); + FreeAndNil(FViewInfo); + inherited Destroy; +end; + +procedure TdxSkinFormController.Update; +begin + inherited Update; + if HasRegion and not IsSkinUsed and (Handle <> 0) and (Form <> nil) then + begin + HasRegion := False; + SetWindowRgn(Handle, 0, False); + end; + UpdateMDIClientEdge; +end; + +procedure TdxSkinFormController.DrawWindowBackground(DC: HDC); +begin + Painter.BeginPaint(DC); + try + Painter.DrawWindowBackground; + finally + Painter.EndPaint; + end; +end; + +procedure TdxSkinFormController.DrawWindowBorder; +begin + Painter.BeginPaint; + try + Painter.DrawWindowBorder; + finally + Painter.EndPaint; + end; +end; + +procedure TdxSkinFormController.CalculateViewInfo; +begin + ViewInfo.Calculate(0); +end; + +procedure TdxSkinFormController.CheckWindowRgn(AForceRgn: Boolean); +var + R: TRect; +begin + if AForceRgn then + begin + HasRegion := True; + GetWindowRect(Handle, R); + OffsetRect(R, -R.Left, -R.Top); + SetWindowRgn(Handle, CreateRectRgnIndirect(R), True); + end + else + if IsZoomed(Handle) and HasRegion then + begin + HasRegion := False; + LockRedraw; + SetWindowRgn(Handle, 0, False); + UnlockRedraw; + PostMessage(Handle, WM_POSTREDRAW, 0, 0); + end; +end; + +procedure TdxSkinFormController.InitializeMessageForm; +var + I: Integer; + AForm: TCustomForm; +begin + AForm := Form; + for I := AForm.ControlCount - 1 downto 0 do + begin + if AForm.Controls[I] is TCustomLabel then + TCustomLabelAccess(AForm.Controls[I]).Transparent := True; + end; +end; + +procedure TdxSkinFormController.InitializePainter; +var + ASkinName: string; + AUseSkin: Boolean; + I: Integer; +begin + if Form <> nil then + for I := 0 to SkinControllersList.Count - 1 do + with TdxSkinController(SkinControllersList[I]) do + begin + if I = 0 then + begin + FLookAndFeelPainter := DoSkinForm(Form); + AUseSkin := FLookAndFeelPainter <> nil; + end + else + begin + AUseSkin := GetFormSkin(Form, ASkinName); + FLookAndFeelPainter := DoSkinFormEx(Form, ASkinName, AUseSkin); + end; + if FLookAndFeelPainter <> nil then Break; + end; +end; + +function TdxSkinFormController.HandleWindowMessage( + var AMessage: TMessage): Boolean; +const + WindowState: array[Boolean] of Integer = (0, SIZE_MAXIMIZED); +begin + Result := IsSkinUsed; + if not Result then Exit; + CheckWindowRgn(False); + if ForceRedraw then + begin + DrawWindowBorder; + ForceRedraw := False; + end; + case AMessage.Msg of + $3F: + UpdateMDIClientEdge; + WM_DESTROY, WM_MDIDESTROY: + if AMessage.WParam = 0 then + WMDestroy(TWMDestroy(AMessage)) + else + DefWndProc(AMessage); + WM_NCCALCSIZE: + WMNCCalcSize(TWMNCCalcSize(AMessage)); + WM_NCMOUSEMOVE: + WMNCMouseMove(TWMNCHitMessage(AMessage)); + WM_NCACTIVATE: + WMNCActivate(TWMNCActivate(AMessage)); + WM_ACTIVATE: + begin + DefWndProc(AMessage); + DrawWindowBorder; + end; + WM_NCUAHDRAWFRAME, WM_NCUAHDRAWCAPTION, WM_SYNCPAINT: + DrawWindowBorder; + WM_NCLBUTTONDOWN, WM_NCLBUTTONDBLCLK: + WMNCButtonDown(TWMNCHitMessage(AMessage)); + WM_NCLBUTTONUP: + WMNCLButtonUp(TWMNCHitMessage(AMessage)); + WM_NCPAINT: + WMNCPaint(TWMNCPaint(AMessage)); + WM_NCHITTEST: + WMNCHitTest(TWMNCHitTest(AMessage)); + WM_ERASEBKGND: + WMEraseBkgnd(TWMEraseBkgnd(AMessage)); + WM_SIZING: + WMSizing(TWMSize(AMessage)); + WM_SIZE: + WMSize(TWMSize(AMessage)); + WM_SYSCOMMAND: + WMSysCommand(TWMSysCommand(AMessage)); + WM_VSCROLL, WM_HSCROLL: + WMScroll(TWMScroll(AMessage)); + WM_THEMECHANGED: + begin + ViewInfo.ThemeActiveAssigned := False; + Result := False; + end; + else + if AMessage.Msg = WM_CHILDCHANGED then + begin + if ViewInfo.UpdateCaptionSufix then + DrawWindowBorder; + end + else + if (dxWMSetSkinnedMessage > 0) and (AMessage.Msg = dxWMSetSkinnedMessage) then + RefreshController(ViewInfo.Controller) + else + + if AMessage.Msg = WM_POSTREDRAW then + RedrawWindow(False) + else + + if AMessage.Msg = WM_POSTCHECKRGN then + CheckWindowRgn(NeedForceRgnUpdate(WindowState[IsZoomed(Handle)])) + else + Result := False; + end; +end; + +procedure TdxSkinFormController.LockRedraw; +begin + Inc(FLockRedrawCount); + if FLockRedrawCount = 1 then + DefWindowProc(Handle, WM_SETREDRAW, 0, 0); +end; + +procedure TdxSkinFormController.UpdateMDIClientEdge; +var + AStyle: Integer; +begin + if IsMDIClient then + begin + AStyle := GetWindowLong(Handle, GWL_EXSTYLE); + if AStyle and WS_EX_CLIENTEDGE <> 0 then + AStyle := AStyle and not WS_EX_CLIENTEDGE + else + Exit; + SetWindowLong(Handle, GWL_EXSTYLE, AStyle); + Refresh; + end; +end; + +function TdxSkinFormController.RefreshOnMouseEvent( + AForceRefresh: Boolean = False): Boolean; +var + APart: TcxScrollBarPart; + AScrollBar: TdxSkinFormScrollBar; +begin + with ViewInfo do + begin + Result := UpdateCaptionIconStates; + if TrackIcon <> sfiMenu then + BeginMouseTracking(nil, ClientToScreen(IconBounds[TrackIcon]), Self) + else + if GetScrollBarHitTest(AScrollBar, APart) then + begin + Result := not IsMouseTracking(Self); + BeginMouseTracking(nil, ClientToScreen(ScrollBarPartBounds[AScrollBar, APart]), Self) + end + else + begin + Result := Result or IsMouseTracking(Self); + EndMouseTracking(Self); + end; + end; + if Result or AForceRefresh then + Refresh; +end; + +procedure TdxSkinFormController.UnlockRedraw; +begin + Dec(FLockRedrawCount); + if FLockRedrawCount = 0 then + DefWindowProc(Handle, WM_SETREDRAW, 1, 0); +end; + +procedure TdxSkinFormController.UpdateScrollTrackPos( + AKind: TdxSkinFormScrollBar; APos: Integer); +var + Info: TScrollInfo; +begin + Info.cbSize := SizeOf(TScrollInfo); + Info.fMask := SIF_TRACKPOS; + if FlatSB_GetScrollInfo(Handle, Byte(AKind), Info) then + APos := Info.nTrackPos; + FlatSB_SetScrollPos(Handle, Byte(AKind), APos, False); +end; + +procedure TdxSkinFormController.WMDestroy(var Message: TWMDestroy); +begin + FLookAndFeelPainter := nil; + DefWndProc(Message); + UnHookWndProc; +end; + +procedure TdxSkinFormController.WMEraseBkgnd(var Message: TWMEraseBkgnd); +begin + DrawWindowBackground(Message.DC); + Message.Result := 1; +end; + +procedure TdxSkinFormController.WMNCActivate(var Message: TWMNCActivate); +var + AFlags: DWORD; + AMDIChild: TCustomForm; +begin + ViewInfo.Active := Message.Active; + AMDIChild := ViewInfo.GetActiveMDIChild; + if Assigned(AMDIChild) then + AMDIChild.Perform(WM_NCACTIVATE, TMessage(Message).WParam, 0); + if IsMDIChildWindow(Handle) then + begin + AFlags := GetWindowLong(Handle, GWL_STYLE); + SetWindowLong(Handle, GWL_STYLE, AFlags and not WS_VISIBLE); + Message.Result := DefWindowProc(Handle, WM_NCACTIVATE, TMessage(Message).WParam, 0); + SetWindowLong(Handle, GWL_STYLE, AFlags); + end + else + Message.Result := 1; + DrawWindowBorder; +end; + +procedure TdxSkinFormController.WMNCButtonDown(var Message: TWMNCHitMessage); +var + ALink: TcxObjectLink; + ALocked: Boolean; +begin + ALink := cxAddObjectLink(Self); + try + ForceRedraw := True; + ViewInfo.UpdateIconPressed; + ViewInfo.UpdateCaptionIconStates; + ALocked := Message.HitTest in [HTHSCROLL, HTVSCROLL]; + if ALocked then + LockRedraw; + if ViewInfo.GetIconHitTest in [sfiMenu, sfiHelp] then + DefWndProc(Message); + if Assigned(ALink.Ref) then + begin + if ALocked then + UnlockRedraw; + RefreshOnMouseEvent(True); + DrawWindowBorder; + end; + finally + cxRemoveObjectLink(ALink); + end; + Message.Result := 0; +end; + +procedure TdxSkinFormController.WMNCCalcSize(var Message: TWMNCCalcSize); +var + R, Margins: TRect; +begin + R := Message.CalcSize_Params^.rgrc[0]; + DefWndProc(Message); + CalculateViewInfo; + if Message.CalcValidRects and ViewInfo.NeedCheckNonClientSize then + begin + Margins := ViewInfo.BorderWidths; + if saeVertScroll in ViewInfo.ScrollAreaElements then + Inc(Margins.Right, GetSystemMetrics(SM_CXVSCROLL)); + if saeHorzScroll in ViewInfo.ScrollAreaElements then + Inc(Margins.Bottom, GetSystemMetrics(SM_CYHSCROLL)); + with ViewInfo do + if IsZoomed and IsSizebox then + begin + Inc(Margins.Left, SystemSizeFrame.cx - SizeFrame.cx); + Inc(Margins.Right, SystemSizeFrame.cx - SizeFrame.cx); + Inc(Margins.Top, SystemSizeFrame.cy - SizeFrame.cy); + if saeVertScroll in ScrollAreaElements then + Inc(Margins.Right, SizeFrame.cx - BorderWidths.Right); + if saeHorzScroll in ScrollAreaElements then + Inc(Margins.Bottom, SizeFrame.cy - BorderWidths.Bottom); + end; + Message.CalcSize_Params^.rgrc[0] := cxRectContent(R, Margins); + end; +end; + +procedure TdxSkinFormController.WMNCHitTest(var Message: TWMNCHitTest); +begin + with Message do + Result := ViewInfo.GetHitTest(SmallPointToPoint(Pos), Result); + if (Message.Result = HTNOWHERE) or (Message.Result = HTSYSMENU) then + DefWndProc(Message); +end; + +procedure TdxSkinFormController.WMNCLButtonUp(var Message: TWMNCHitMessage); +var + ADefaultCall: Boolean; + ADownIcon: TdxSkinFormIcon; +begin + ADownIcon := ViewInfo.UpdateIconPressed(True); + ADefaultCall := ADownIcon in [sfiMenu, sfiHelp]; + if ADefaultCall then + DefWndProc(Message); + RefreshOnMouseEvent(True); + if not ADefaultCall then + SendMessage(Handle, WM_SYSCOMMAND, IconCommand[ADownIcon], 0); +end; + +procedure TdxSkinFormController.WMNCMouseMove(var Message: TWMNCHitMessage); +begin + if not RefreshOnMouseEvent then + begin + Message.HitTest := 0; + DefWndProc(Message); + DrawWindowBorder; + end; +end; + +procedure TdxSkinFormController.WMNCPaint(var Message: TWMNCPaint); +var + AFrameRgn, AWindowRgn: HRgn; +begin + CalculateViewInfo; + DrawWindowBorder; + AFrameRgn := ViewInfo.CreateDrawRgn; + AWindowRgn := CreateRectRgnIndirect(ViewInfo.WindowRect); + CombineRgn(AWindowRgn, AWindowRgn, AFrameRgn, RGN_XOR); + DeleteObject(AFrameRgn); + if ViewInfo.HasMenu or IsMDIClientWindow(Handle) then + begin + if Message.RGN <> 1 then + begin + CombineRgn(AWindowRgn, AWindowRgn, Message.RGN, RGN_AND); + DeleteObject(Message.RGN); + end; + Message.RGN := AWindowRgn; + DefWndProc(Message); + end; + DeleteObject(AWindowRgn); + Message.RGN := 1; + Message.Result := 0; +end; + +procedure TdxSkinFormController.WMScroll(var Message: TWMScroll); +begin + ViewInfo.TrackedScrollBar := TdxScrollAreaElement(Message.Msg - WM_HSCROLL); + if TWMScroll(Message).ScrollCode = SB_THUMBTRACK then + UpdateScrollTrackPos(ViewInfo.TrackedScrollBar, TWMScroll(Message).Pos) + else + ViewInfo.TrackedScrollBar := saeSizeGrip; + LockRedraw; + DefWndProc(Message); + UnlockRedraw; + UnlockRedraw; + try + RedrawWindow(True); + finally + LockRedraw; + end; +end; + +procedure TdxSkinFormController.WMSetText(var Message: TWMSetText); +begin + DefWndProc(Message); + if IsWindowUnicode(Handle) then + ViewInfo.UpdateCaption(PWideChar(Message.Text)) + else + ViewInfo.UpdateCaption(Message.Text); + Refresh; +end; + +procedure TdxSkinFormController.WMSizing(var Message: TWMSize); +begin + FSizingInProcess := True; + DefWndProc(Message); +end; + +procedure TdxSkinFormController.WMSize(var Message: TWMSize); +begin + FSizingInProcess := False; + DefWndProc(Message); + CheckWindowRgn(NeedForceRgnUpdate(Message.SizeType)); +end; + +procedure TdxSkinFormController.WMSysCommand(var Message: TWMSysCommand); +var + ALink: TcxObjectLink; +begin + ALink := cxAddObjectLink(Self); + try + DefWndProc(Message); + if Assigned(ALink.Ref) then + DrawWindowBorder; + finally + cxRemoveObjectLink(ALink); + end; +end; + +procedure TdxSkinFormController.MouseLeave; +begin + UnlockRedraw; + RefreshOnMouseEvent(True); + UpdateWindow(Handle); + LockRedraw; +end; + +function TdxSkinFormController.GetForm: TCustomForm; +var + AControl: TWinControl; +begin + AControl := FindControl(Handle); + if AControl is TCustomForm then + Result := AControl as TCustomForm + else + Result := nil; +end; + +function TdxSkinFormController.GetIsMDIMain: Boolean; +begin + Result := (Form <> nil) and (TCustomFormAccess(Form).FormStyle = fsMDIForm); +end; + +function TdxSkinFormController.GetIsSkinUsed: Boolean; +begin + Result := inherited GetIsSkinUsed and (ViewInfo <> nil); +end; + +function TdxSkinFormController.NeedForceRgnUpdate(ASizeType: Integer): Boolean; +var + AForm: TCustomForm; +begin + AForm := Form; + if Assigned(AForm) then + begin + Result := AForm.BorderStyle <> bsNone; + if Result then + Result := (ASizeType <> SIZE_MAXIMIZED) or Assigned(AForm.Parent) + end + else + Result := ASizeType <> SIZE_MAXIMIZED; +end; + +procedure TdxSkinFormController.WndProc(var AMessage: TMessage); +begin + if AMessage.Msg = WM_SETTEXT then + WMSetText(TWMSetText(AMessage)) + else + if not (IsSkinUsed and HandleWindowMessage(AMessage)) then + DefWndProc(AMessage); +end; + +{ TdxSkinFormNonClientAreaInfo } + +constructor TdxSkinFormNonClientAreaInfo.Create(AController: TdxSkinFormController); +begin + FController := AController; + FCaptionFont := TFont.Create; + FTrackedScrollBar := saeSizeGrip; + FCaption := GetWindowCaption(Handle); + FActive := True; +end; + +destructor TdxSkinFormNonClientAreaInfo.Destroy; +begin + UpdateRgn := 0; + WindowRgn := 0; + FreeAndNil(FCaptionFont); + inherited Destroy; +end; + +procedure TdxSkinFormNonClientAreaInfo.Calculate( + AUpdateRgn: HRGN); +begin + FHasMenu := IsMenu(GetMenu(Handle)) and not TdxSkinFormController.IsMDIChildWindow(Handle); + FIsMDIClient := TdxSkinFormController.IsMDIClientWindow(Handle); + FIsSimpleForm := (Controller.Form <> nil) and not + (TCustomFormAccess(Controller.Form).FormStyle in [fsMDIChild, fsMDIForm]); + FPainter := Controller.LookAndFeelPainter; + GetExtendedStylePainters.GetPainterData(Painter, FPainterInfo); + WindowInfo.cbSize := SizeOf(WindowInfo); + GetWindowInfo(Handle, WindowInfo); + if NativeBorderWidth then + FSizeFrame := GetSystemSizeFrame + else + FSizeFrame := Size(4, 4); + FWindowBounds := cxRectOffset(WindowRect, -WindowRect.Left, -WindowRect.Top); + FBoundsNOBorders := cxRectOffset(ClientRect, cxPointInvert(WindowRect.TopLeft)); + WindowRgn := CreateRectRgnIndirect(WindowBounds); + FIcons := GetIcons; + FSysMenuIcon := GetSysMenuIcon; + CalculateFontInfo; + CalculateBorderWidths; + FMenuBounds := cxRectSetBottom(FBoundsNOBorders, FBoundsNOBorders.Top, + FBoundsNOBorders.Top - BorderWidths.Top); + CalculateBordersInfo; + CalculateCaptionIconsInfo; + CalculateScrollArea; +end; + +function TdxSkinFormNonClientAreaInfo.ClientToScreen(const P: TPoint): TPoint; +begin + Result := cxPointOffset(P, WindowRect.TopLeft); +end; + +function TdxSkinFormNonClientAreaInfo.ClientToScreen(const R: TRect): TRect; +begin + Result := cxRectOffset(R, WindowRect.TopLeft); +end; + +function TdxSkinFormNonClientAreaInfo.CreateDrawRgn: HRGN; +var + ARgn: HRgn; + ASide: TcxBorder; + AItem: TdxScrollAreaElement; +begin + Result := CreateRectRgnIndirect(cxNullRect); + for ASide := bLeft to bBottom do + begin + if cxRectIsEmpty(BorderBounds[ASide]) then Continue; + ARgn := CreateRectRgnIndirect( + ClientToScreen(BorderBounds[ASide])); + CombineRgn(Result, Result, ARgn, RGN_OR); + DeleteObject(ARgn); + end; + if HasMenu then + begin + ARgn := CreateRectRgnIndirect(ClientToScreen( + cxRectSetBottom(MenuBounds, MenuBounds.Bottom, 1))); + CombineRgn(Result, Result, ARgn, RGN_OR); + DeleteObject(ARgn); + end; + for AItem := saeHorzScroll to saeSizeGrip do + if AItem in FScrollAreaElements then + begin + ARgn := CreateRectRgnIndirect(ClientToScreen(ScrollAreaBounds[AItem])); + CombineRgn(Result, Result, ARgn, RGN_OR); + DeleteObject(ARgn); + end; +end; + +function TdxSkinFormNonClientAreaInfo.GetHitTest(AHitPoint: TPoint; AHitTest: Integer = 0): Integer; +var + ASide: TcxBorder; + AIcon: TdxSkinFormIcon; + ACorner: TdxSkinFormCorner; +begin + Result := AHitTest; + AHitPoint := ScreenToClient(AHitPoint); + if IsSizebox and not IsZoomed then + begin + for ACorner := sfcLeftTop to sfcRightBottom do + if (Result = HTNOWHERE) and PtInRect(SizeCorners[ACorner], AHitPoint) then + Result := CornerHitTests[ACorner]; + for ASide := bLeft to bBottom do + if (Result = HTNOWHERE) and PtInRect(SizeArea[ASide], AHitPoint) then + Result := ResizeHitTests[ASide]; + end; + if (Result = HTNOWHERE) and PtInRect(BorderBounds[bTop], AHitPoint) then + begin + Result := HTCAPTION; + // correct 'restore' hittest + IconsHitTest[sfiRestore] := HTMAXBUTTON; + if IsIconic then + IconsHitTest[sfiRestore] := HTMINBUTTON; + // + for AIcon := sfiMenu to sfiClose do + begin + if PtInRect(IconBounds[AIcon], AHitPoint) then + Result := IconsHitTest[AIcon]; + end; + end; +end; + +function TdxSkinFormNonClientAreaInfo.GetIconHitTest: TdxSkinFormIcon; +begin + Result := GetIconHitTestFromHitTest(GetHitTest(GetMouseCursorPos)); +end; + +function TdxSkinFormNonClientAreaInfo.GetIconHitTestFromHitTest( + AHitTest: Integer): TdxSkinFormIcon; +begin + Result := sfiMenu; + case AHitTest of + HTHELP: + Result := sfiHelp; + HTMINBUTTON: + if IsIconic then + Result := sfiRestore + else + Result := sfiMinimize; + HTMAXBUTTON: + if IsZoomed then + Result := sfiRestore + else + Result := sfiMaximize; + HTCLOSE: + Result := sfiClose; + end; +end; + +function TdxSkinFormNonClientAreaInfo.GetScrollBarHitTest( + var AScrollBar: TdxSkinFormScrollBar; var APart: TcxScrollBarPart): Boolean; +var + APoint: TPoint; + AItem: TdxSkinFormScrollBar; + APartItem: TcxScrollBarPart; +begin + Result := False; + APoint := ScreenToClient(GetMouseCursorPos); + for AItem := saeHorzScroll to saeVertScroll do + begin + if not (AItem in ScrollAreaElements) or + not PtInRect(ScrollAreaBounds[AItem], APoint) then Continue; + AScrollBar := AItem; + for APartItem := sbpLineUp to sbpPageDown do + begin + Result := (ScrollBarPartState[AItem, APartItem] <> cxbsDefault) and + PtInRect(ScrollBarPartBounds[AItem, APartItem], APoint); + if Result then + begin + APart := APartItem; + Exit; + end; + end; + end; +end; + +function TdxSkinFormNonClientAreaInfo.ScreenToClient(const P: TSmallPoint): TPoint; +begin + Result := ScreenToClient(SmallPointToPoint(P)); +end; + +function TdxSkinFormNonClientAreaInfo.ScreenToClient(const P: TPoint): TPoint; +begin + Result := cxPointOffset(P, cxPointInvert(WindowRect.TopLeft)); +end; + +function TdxSkinFormNonClientAreaInfo.ScreenToClient(const R: TRect): TRect; +begin + Result := cxRectOffset(R, cxPointInvert(WindowRect.TopLeft)); +end; + +procedure TdxSkinFormNonClientAreaInfo.UpdateCaption(const ANewText: string); +begin + FCaption := ANewText; + UpdateCaptionSufix; +end; + +procedure TdxSkinFormNonClientAreaInfo.CalculateBordersInfo; +var + ASide: TcxBorder; +begin + for ASide := bLeft to bBottom do + FBorderBounds[ASide] := GetBorderRect(ASide, WindowBounds, BorderWidths); + if IsZoomed and not NativeBorderWidth and IsSizeBox then + OffsetRect(FBorderBounds[bTop], 0, SystemSizeFrame.cy - SizeFrame.cy); +end; + +procedure TdxSkinFormNonClientAreaInfo.CalculateBorderWidths; +const + CaptionMetric: array[Boolean] of Integer = (SM_CYCAPTION, SM_CYSMCAPTION); +begin + FBorderWidths := cxNullRect; + if not NativeBorderWidth and HasBorder then + begin + FBorderWidths := PainterInfo.FormBorderWidths[not ToolWindow]; + if ToolWindow then + Inc(FBorderWidths.Top, SizeFrame.cy); + end; + + if HasCaption then + if NativeBorderWidth or ToolWindow then + Inc(FBorderWidths.Top, GetSystemMetrics(CaptionMetric[ToolWindow])) + else + Inc(FBorderWidths.Top, SizeFrame.cy + 2 * GetSystemMetrics(SM_CYEDGE) + + Max(GetSystemMetrics(SM_CYSMICON), cxScreenCanvas.FontHeight(FCaptionFont))); + + if NativeBorderWidth and HasBorder then + begin + Inc(FBorderWidths.Left, WindowInfo.cxWindowBorders); + Inc(FBorderWidths.Right, WindowInfo.cxWindowBorders); + Inc(FBorderWidths.Top, WindowInfo.cyWindowBorders); + Inc(FBorderWidths.Bottom, WindowInfo.cyWindowBorders); + end; +end; + +function TdxSkinFormNonClientAreaInfo.GetCaptionButtonRect( + const ACaptionRect: TRect): TRect; +begin + Result := BorderBounds[bTop]; + with GetCaptionContentOffset do + begin + if NativeBorderWidth and IsSizeBox then + Inc(Result.Top, SystemSizeFrame.cy) + else + Inc(Result.Top, Top); + Dec(Result.Bottom, Bottom); + Result.Right := ACaptionRect.Right; + Result.Left := Result.Right - (Result.Bottom - Result.Top); + end; +end; + +procedure TdxSkinFormNonClientAreaInfo.CalculateCaptionIconsInfo; +const + RestoreAndMaximize = [sfiRestore, sfiMaximize]; +var + AIcon: TdxSkinFormIcon; + AIconSize: Integer; + ARealIcons: TdxSkinFormIcons; + R: TRect; +begin + FillChar(FIconBounds, SizeOf(FIconBounds), 0); + AIconSize := GetCaptionIconSize; + FCaptionBounds := GetCaptionBounds; + R := FCaptionBounds; + R.Top := (R.Top + R.Bottom - AIconSize) div 2; + R.Bottom := R.Top + AIconSize; + if sfiMenu in Icons then + begin + FIconBounds[sfiMenu] := cxRectCenter(cxRectSetWidth(R, AIconSize), + AIconSize, AIconSize); + FCaptionBounds.Left := FIconBounds[sfiMenu].Right + dxSkinFormTextOffset; + end + else + FCaptionBounds.Left := cxTextOffset + dxSkinFormTextOffset; + + R := GetCaptionButtonRect(FCaptionBounds); + ARealIcons := Icons; + if RestoreAndMaximize * Icons = RestoreAndMaximize then + ARealIcons := ARealIcons - [sfiRestore] + [sfiMinimize]; + for AIcon := sfiClose downto sfiHelp do + begin + if not (AIcon in ARealIcons) then Continue; + FIconBounds[AIcon] := R; + OffsetRect(R, -(R.Right - R.Left + dxSkinIconSpacing), 0); + FCaptionBounds.Right := FIconBounds[AIcon].Left - dxSkinFormTextOffset; + end; + if RestoreAndMaximize * Icons = RestoreAndMaximize then + FIconBounds[sfiRestore] := FIconBounds[sfiMinimize]; + UpdateCaptionIconStates; +end; + +procedure TdxSkinFormNonClientAreaInfo.CalculateFontInfo; +var + AMetrics: TNonClientMetrics; +begin + AMetrics.cbSize := SizeOf(AMetrics); + SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, @AMetrics, 0); + if ToolWindow then + FCaptionFont.Handle := CreateFontIndirect(AMetrics.lfSmCaptionFont) + else + begin + FCaptionFont.Handle := CreateFontIndirect(AMetrics.lfCaptionFont); + if PainterInfo <> nil then + FCaptionFont.Size := FCaptionFont.Size + (PainterInfo.FormCaptionDelta - 1); + end; + FCaptionTextShadowColor := clBtnShadow; + FCaptionTextColor[True] := GetSysColor(COLOR_CAPTIONTEXT); + FCaptionTextColor[False] := GetSysColor(COLOR_INACTIVECAPTIONTEXT); + if PainterInfo <> nil then + begin + FCaptionTextColor[True] := PainterInfo.FormFrames[True, bTop].TextColor; + if PainterInfo.FormInactiveColor <> nil then + FCaptionTextColor[False] := PainterInfo.FormInactiveColor.Value; + if PainterInfo.FormTextShadowColor <> nil then + FCaptionTextShadowColor := PainterInfo.FormTextShadowColor.Value; + end; +end; + +procedure TdxSkinFormNonClientAreaInfo.CalculateScrollArea; +const + BothScrollBars = [saeHorzScroll, saeVertScroll]; +begin + FScrollAreaElements := []; + FillChar(FScrollAreaBounds, SizeOf(FScrollAreaBounds), 0); + FillChar(FScrollBarsInfo[saeHorzScroll], SizeOf(TScrollBarInfo), 0); + FScrollBarsInfo[saeHorzScroll].cbSize := SizeOf(TScrollBarInfo); + FScrollBarsInfo[saeVertScroll] := FScrollBarsInfo[saeHorzScroll]; + Windows.GetScrollBarInfo(Handle, Integer(OBJID_VSCROLL), FScrollBarsInfo[saeVertScroll]); + Windows.GetScrollBarInfo(Handle, Integer(OBJID_HSCROLL), FScrollBarsInfo[saeHorzScroll]); + if Style and WS_HSCROLL = WS_HSCROLL then + begin + Include(FScrollAreaElements, saeHorzScroll); + FScrollAreaBounds[saeHorzScroll] := cxRectSetTop(BoundsNOBorders, + BoundsNOBorders.Bottom, GetSystemMetrics(SM_CYHSCROLL)); + end; + if Style and WS_VSCROLL = WS_VSCROLL then + begin + Include(FScrollAreaElements, saeVertScroll); + FScrollAreaBounds[saeVertScroll] := cxRectSetLeft(BoundsNOBorders, + BoundsNOBorders.Right, GetSystemMetrics(SM_CXVSCROLL)); + end; + if BothScrollBars * ScrollAreaElements = BothScrollBars then + begin + Include(FScrollAreaElements, saeSizeGrip); + FScrollAreaBounds[saeHorzScroll].Right := FScrollAreaBounds[saeVertScroll].Left; + FScrollAreaBounds[saeVertScroll].Bottom := FScrollAreaBounds[saeHorzScroll].Top; + FScrollAreaBounds[saeSizeGrip] := cxRect(BoundsNOBorders.BottomRight, + Point(FScrollAreaBounds[saeVertScroll].Right, FScrollAreaBounds[saeHorzScroll].Bottom)); + end; + CalculateScrollBarPartsInfo; +end; + +procedure TdxSkinFormNonClientAreaInfo.CalculateScrollBarPartInfo( + AScrollBar: TdxSkinFormScrollBar; Pos1, Pos2: Integer; APart: TcxScrollBarPart); +var + P: TPoint; + AState: Integer; +const + Part2StateIndex: array[TcxScrollBarPart] of Integer = (0, 1, 5, 3, 2, 4); +begin + AState := ScrollBarInfo[AScrollBar].rgState[Part2StateIndex[APart]]; + FScrollBarPartState[AScrollBar, APart] := cxbsDefault; + if AState and STATE_SYSTEM_INVISIBLE = STATE_SYSTEM_INVISIBLE then Exit; + FScrollBarPartState[AScrollBar, APart] := cxbsNormal; + FScrollBarPartBounds[AScrollBar, APart] := ScrollAreaBounds[AScrollBar]; + P := ScreenToClient(GetMouseCursorPos); + if (Pos1 <> Pos2) and (Pos1 <> -1) then + begin + if AScrollBar = saeHorzScroll then + FScrollBarPartBounds[AScrollBar, APart] := + cxRectSetXPos(FScrollBarPartBounds[AScrollBar, APart], Pos1, Pos2) + else + FScrollBarPartBounds[AScrollBar, APart] := + cxRectSetYPos(FScrollBarPartBounds[AScrollBar, APart], Pos1, Pos2); + end; + if ((APart = sbpThumbnail) and (AScrollBar = TrackedScrollBar)) or + (AState and STATE_SYSTEM_PRESSED = STATE_SYSTEM_PRESSED) then + FScrollBarPartState[AScrollBar, APart] := cxbsPressed + else + if AState and STATE_SYSTEM_UNAVAILABLE = STATE_SYSTEM_UNAVAILABLE then + FScrollBarPartState[AScrollBar, APart] := cxbsDisabled + else + if (AState and STATE_SYSTEM_HOTTRACKED = STATE_SYSTEM_HOTTRACKED) or + PtInRect(FScrollBarPartBounds[AScrollBar, APart], P) then + begin + FScrollBarPartState[AScrollBar, APart] := cxbsHot; + if ButtonPressed and PtInRect(FScrollBarPartBounds[AScrollBar, APart], P) then + FScrollBarPartState[AScrollBar, APart] := cxbsPressed; + end; +end; + +procedure TdxSkinFormNonClientAreaInfo.CalculateScrollBarPartsInfo; +var + R: TRect; + AScrollBar: TdxSkinFormScrollBar; +begin + for AScrollBar := saeHorzScroll to saeVertScroll do + begin + if not (AScrollBar in ScrollAreaElements) then Continue; + R := ScrollAreaBounds[AScrollBar]; + if AScrollBar = saeVertScroll then + R := cxRectSetXPos(R, R.Top, R.Bottom); + with ScrollBarInfo[AScrollBar] do + begin + CalculateScrollBarPartInfo(AScrollBar, R.Left, + R.Left + dxyLineButton, sbpLineUp); + CalculateScrollBarPartInfo(AScrollBar, R.Right - dxyLineButton, + R.Right, sbpLineDown); + CalculateScrollBarPartInfo(AScrollBar, R.Left + xyThumbTop, + R.Left + xyThumbBottom, sbpThumbnail); + CalculateScrollBarPartInfo(AScrollBar, R.Left + dxyLineButton, + R.Left + xyThumbTop, sbpPageUp); + CalculateScrollBarPartInfo(AScrollBar, R.Left + xyThumbBottom, + R.Right - dxyLineButton, sbpPageDown); + end + end; +end; + +function TdxSkinFormNonClientAreaInfo.GetActiveMDIChild: TCustomForm; +var + AActiveChild: TCustomForm; +begin + Result := nil; + if Assigned(Controller.Form) then + if TCustomFormAccess(Controller.Form).FormStyle = fsMDIForm then + begin + AActiveChild := TCustomFormAccess(Controller.Form).ActiveMDIChild; + if Assigned(AActiveChild) then + Result := AActiveChild; + end; +end; + +function TdxSkinFormNonClientAreaInfo.GetBorderRect( + ASide: TcxBorder; const ABounds, AWidths: TRect): TRect; +begin + Result := ABounds; + case ASide of + bLeft: + Result.Right := Result.Left + AWidths.Left; + bTop: + Result.Bottom := Result.Top + AWidths.Top; + bRight: + Result.Left := Result.Right - AWidths.Right; + bBottom: + Result.Top := Result.Bottom - AWidths.Bottom; + end; +end; + +function TdxSkinFormNonClientAreaInfo.GetCaption: string; +begin + if FCaptionSufix = '' then + Result := FCaption + else + Result := Format(sdxMDICaptionFormat, [FCaption, FCaptionSufix]); +end; + +function TdxSkinFormNonClientAreaInfo.GetIcons: TdxSkinFormIcons; +const + SysMenuIcons: array[Boolean] of TdxSkinFormIcons = + ([sfiMenu, sfiClose], [sfiClose]); +begin + Result := []; + if Style and WS_SYSMENU = WS_SYSMENU then + Result := SysMenuIcons[ToolWindow or IsDialog]; + if Style and WS_MINIMIZEBOX = WS_MINIMIZEBOX then + begin + if IsIconic then + Include(Result, sfiRestore) + else + Include(Result, sfiMinimize); + end; + if Style and WS_MAXIMIZEBOX = WS_MAXIMIZEBOX then + begin + if IsZoomed then + Include(Result, sfiRestore) + else + Include(Result, sfiMaximize); + end; + if ExStyle and WS_EX_CONTEXTHELP = WS_EX_CONTEXTHELP then + Include(Result, sfiHelp); +end; + +function TdxSkinFormNonClientAreaInfo.GetMaximizedMDIChild: TCustomForm; +var + AActiveMDI: TCustomForm; +begin + AActiveMDI := GetActiveMDIChild; + if Assigned(AActiveMDI) and Windows.IsZoomed(AActiveMDI.Handle) then + Result := AActiveMDI + else + Result := nil; +end; + +function TdxSkinFormNonClientAreaInfo.GetSysMenuIcon: HIcon; +var + wParam: Integer; +begin + wParam := Byte(not ToolWindow); + if IsWinXP then + wParam := ICON_SMALL2; + Result := DefWindowProc(Handle, WM_GETICON, wParam, 0); +end; + +function TdxSkinFormNonClientAreaInfo.GetSystemSizeFrame: TSize; +begin + Result := Size(GetSystemMetrics(SM_CXSIZEFRAME), GetSystemMetrics(SM_CYSIZEFRAME)); +end; + +function TdxSkinFormNonClientAreaInfo.IsMDIMainAlphaBlendUsed: Boolean; +var + AMainForm: TWinControl; +begin + AMainForm := FindControl(GetParent(GetParent(Handle))); + Result := (AMainForm <> nil) and (AMainForm is TCustomForm) and + TCustomFormAccess(AMainForm).AlphaBlend; +end; + +function TdxSkinFormNonClientAreaInfo.UpdateCaptionIconStates: Boolean; +var + AHitTest, AIcon: TdxSkinFormIcon; + APrevStates: array[TdxSkinFormIcon] of TdxSkinElementState; +begin + Result := False; + Move(FIconState, APrevStates, SizeOf(FIconState)); + FillChar(FIconState, SizeOf(FIconState), 0); + AHitTest := GetIconHitTest; + TrackIcon := IconPressed; + for AIcon := sfiMenu to sfiClose do + begin + if not Active then + FIconState[AIcon] := esActiveDisabled + else + if ((AIcon = sfiMinimize) and (Style and WS_MINIMIZEBOX <> WS_MINIMIZEBOX)) or + ((AIcon = sfiMaximize) and (Style and WS_MAXIMIZEBOX <> WS_MAXIMIZEBOX)) then + FIconState[AIcon] := esDisabled; + if (AHitTest <> AIcon) or (FIconState[AIcon] = esDisabled) then Continue; + if ButtonPressed and (IconPressed = AIcon) then + FIconState[AIcon] := esPressed + else + if IconPressed = sfiMenu then + begin + FIconState[AIcon] := esHot; + TrackIcon := AIcon; + end; + end; + for AIcon := sfiMenu to sfiClose do + Result := Result or (FIconState[AIcon] <> APrevStates[AIcon]); +end; + +function TdxSkinFormNonClientAreaInfo.UpdateIconPressed( + AReset: Boolean = False): TdxSkinFormIcon; +begin + Result := FIconPressed; + FIconPressed := GetIconHitTest; + if AReset then + begin + if Result <> FIconPressed then + Result := sfiMenu; + FIconPressed := sfiMenu; + end; +end; + +function TdxSkinFormNonClientAreaInfo.UpdateCaptionSufix: Boolean; +var + AMDIChild: TCustomForm; + ATempSufix: string; +begin + AMDIChild := GetMaximizedMDIChild; + if Assigned(AMDIChild) then + ATempSufix := AMDIChild.Caption + else + ATempSufix := ''; + + Result := ATempSufix <> FCaptionSufix; + if Result then + FCaptionSufix := ATempSufix; +end; + +function TdxSkinFormNonClientAreaInfo.GetBorderBounds(ASide: TcxBorder): TRect; +begin + Result := FBorderBounds[ASide]; +end; + +function TdxSkinFormNonClientAreaInfo.GetButtonPressed: Boolean; +begin + Result := GetMouseKeys and MK_LBUTTON = MK_LBUTTON; +end; + +function TdxSkinFormNonClientAreaInfo.GetCaptionBounds: TRect; +var + AFrame: TSize; +begin + AFrame := Size(GetSystemMetrics(SM_CXEDGE), GetSystemMetrics(SM_CYEDGE)); + Result := BorderBounds[bTop]; + Inc(Result.Top, Byte(ToolWindow) + 1); + if IsSizeBox and not NativeBorderWidth and IsZoomed then + InflateRect(Result, -SystemSizeFrame.cx, -AFrame.cy) + else + InflateRect(Result, -SizeFrame.cx, -AFrame.cy); + + if IsSizeBox then + begin + if IsZoomed then + Inc(Result.Top, SizeFrame.cy) + else + if NativeBorderWidth then + Inc(Result.Top, SystemSizeFrame.cy - 4); + end; +end; + +function TdxSkinFormNonClientAreaInfo.GetCaptionContentOffset: TRect; +begin + if PainterInfo.FormFrames[not ToolWindow, bTop] <> nil then + Result := PainterInfo.FormFrames[not ToolWindow, bTop].ContentOffset.Rect + else + Result := cxNullRect; +end; + +function TdxSkinFormNonClientAreaInfo.GetCaptionIconSize: Integer; +begin + if ToolWindow then + Result := GetSystemMetrics(SM_CYSMCAPTION) - 2 * GetSystemMetrics(SM_CYEDGE) + else + Result := GetSystemMetrics(SM_CYSMICON); +end; + +function TdxSkinFormNonClientAreaInfo.GetCaptionTextColor: TColor; +begin + Result := FCaptionTextColor[Active]; +end; + +function TdxSkinFormNonClientAreaInfo.GetClientRect: TRect; +begin + Result := WindowInfo.rcClient; +end; + +function TdxSkinFormNonClientAreaInfo.GetExStyle: Integer; +begin + Result := WindowInfo.dwExStyle; +end; + +function TdxSkinFormNonClientAreaInfo.GetHandle: HWND; +begin + Result := Controller.Handle; +end; + +function TdxSkinFormNonClientAreaInfo.GetClientRectOnClient: TRect; +begin + Result := cxRectOffset(ClientRect, cxPointInvert(ClientRect.TopLeft)); +end; + +function TdxSkinFormNonClientAreaInfo.GetHasBorder: Boolean; +begin + Result := GetWindowLong(Handle, GWL_STYLE) and WS_BORDER = WS_BORDER; +end; + +function TdxSkinFormNonClientAreaInfo.GetHasCaption: Boolean; +begin + Result := GetWindowLong(Handle, GWL_STYLE) and WS_CAPTION = WS_CAPTION; +end; + +function TdxSkinFormNonClientAreaInfo.GetHasMenu: Boolean; +begin + Result := FHasMenu; +end; + +function TdxSkinFormNonClientAreaInfo.GetIconBounds( + AIcon: TdxSkinFormIcon): TRect; +begin + Result := FIconBounds[AIcon]; +end; + +function TdxSkinFormNonClientAreaInfo.GetIconState( + AIcon: TdxSkinFormIcon): TdxSkinElementState; +begin + Result := FIconState[AIcon]; +end; + +function TdxSkinFormNonClientAreaInfo.GetIsAlphaBlendUsed: Boolean; +begin + Result := Controller.Form <> nil; + if Result then + with TCustomFormAccess(Controller.Form) do + Result := AlphaBlend or (FormStyle = fsMDIChild) and IsMDIMainAlphaBlendUsed; +end; + +function TdxSkinFormNonClientAreaInfo.GetIsDialog: Boolean; +begin + Result := WindowInfo.dwExStyle and WS_EX_DLGMODALFRAME = WS_EX_DLGMODALFRAME; +end; + +function TdxSkinFormNonClientAreaInfo.GetIsIconic: Boolean; +begin + Result := WindowInfo.dwStyle and WS_ICONIC = WS_ICONIC; +end; + +function TdxSkinFormNonClientAreaInfo.GetIsSizeBox: Boolean; +begin + Result := WindowInfo.dwStyle and WS_SIZEBOX = WS_SIZEBOX; +end; + +function TdxSkinFormNonClientAreaInfo.GetIsZoomed: Boolean; +begin + Result := WindowInfo.dwStyle and WS_MAXIMIZE = WS_MAXIMIZE; +end; + +function TdxSkinFormNonClientAreaInfo.GetNativeBorderWidth: Boolean; +begin + Result := FHasMenu or FIsMDIClient or not ThemeActive; +end; + +function TdxSkinFormNonClientAreaInfo.GetNeedCheckNonClientSize: Boolean; +begin + Result := HasBorder and not (NativeBorderWidth or + IsZoomed and TdxSkinFormController.IsMDIChildWindow(Handle)); +end; + +function TdxSkinFormNonClientAreaInfo.GetScrollAreaBounds( + AItem: TdxScrollAreaElement): TRect; +begin + Result := FScrollAreaBounds[AItem]; +end; + +function TdxSkinFormNonClientAreaInfo.GetScrollBarInfo( + AScrollBar: TdxSkinFormScrollBar): TScrollBarInfo; +begin + Result := FScrollBarsInfo[AScrollBar]; +end; + +function TdxSkinFormNonClientAreaInfo.GetScrollBarPartBounds( + AScrollBar: TdxSkinFormScrollBar; APart: TcxScrollBarPart): TRect; +begin + Result := FScrollBarPartBounds[AScrollBar, APart]; +end; + +function TdxSkinFormNonClientAreaInfo.GetScrollBarPartState( + AScrollBar: TdxSkinFormScrollBar; APart: TcxScrollBarPart): TcxButtonState; +begin + Result := FScrollBarPartState[AScrollBar, APart]; +end; + +function TdxSkinFormNonClientAreaInfo.GetSizeArea( + ASide: TcxBorder): TRect; +begin + Result := WindowBounds; + if ASide in [bLeft, bRight] then + Inc(Result.Top, BorderWidths.Top); + if NativeBorderWidth then + with SizeFrame do + Result := GetBorderRect(ASide, Result, Rect(cx, cy, cx, cy)) + else + Result := GetBorderRect(ASide, Result, Rect(2, 2, 2, 2)) +end; + +function TdxSkinFormNonClientAreaInfo.GetSizeCorners( + ACorner: TdxSkinFormCorner): TRect; +var + ASize: TSize; +begin + Result := WindowBounds; + ASize := SizeFrame; + if not NativeBorderWidth then + ASize := Size(2, 2); + if ACorner in [sfcLeftTop, sfcLeftBottom] then + Result.Right := Result.Left + ASize.cx + else + Result.Left := Result.Right - ASize.cx; + if ACorner in [sfcLeftTop, sfcRightTop] then + Result.Bottom := Result.Top + BorderWidths.Top + else + Result.Top := Result.Bottom - ASize.cy; +end; + +function TdxSkinFormNonClientAreaInfo.GetSkinBorderWidth(ASide: TcxBorder): Integer; +var + AElement: TdxSkinElement; +begin + Result := 0; + AElement := PainterInfo.FormFrames[not ToolWindow, ASide]; + if Assigned(AElement) then + begin + if ASide in [bLeft, bRight] then + Result := AElement.Size.cx + else + Result := AElement.Size.cy; + end; +end; + +function TdxSkinFormNonClientAreaInfo.GetStyle: Integer; +begin + Result := WindowInfo.dwStyle; +end; + +function TdxSkinFormNonClientAreaInfo.GetThemeActive: Boolean; +begin + if not ThemeActiveAssigned then + begin + FThemeActive := IsThemeActive; + ThemeActiveAssigned := True; + end; + Result := FThemeActive; +end; + +function TdxSkinFormNonClientAreaInfo.GetToolWindow: Boolean; +begin + Result := WindowInfo.dwExStyle and WS_EX_TOOLWINDOW = WS_EX_TOOLWINDOW; +end; + +function TdxSkinFormNonClientAreaInfo.GetWindowRect: TRect; +begin + Result := WindowInfo.rcWindow; +end; + +procedure TdxSkinFormNonClientAreaInfo.SetActive(AActive: Boolean); +begin + if FActive <> AActive then + begin + FActive := AActive; + UpdateCaptionIconStates; + end; +end; + +procedure TdxSkinFormNonClientAreaInfo.SetUpdateRgn(ARgn: HRGN); +begin + if FUpdateRgn <> 0 then + DeleteObject(FUpdateRgn); + FUpdateRgn := ARgn; + if FUpdateRgn <> 0 then + OffsetRgn(FUpdateRgn, -WindowRect.Left, -WindowRect.Top); +end; + +procedure TdxSkinFormNonClientAreaInfo.SetWindowRgn(ARgn: HRGN); +begin + if FWindowRgn <> 0 then + DeleteObject(FWindowRgn); + FWindowRgn := ARgn; +end; + +{ TdxSkinFormPainter } + +constructor TdxSkinFormPainter.Create(AViewInfo: TdxSkinFormNonClientAreaInfo); +begin + FViewInfo := AViewInfo; + FBaseCanvas := TCanvas.Create; + FCanvas := TcxCanvas.Create(FBaseCanvas); + CreateCacheInfos; +end; + +destructor TdxSkinFormPainter.Destroy; +begin + FreeCacheInfos; + FCanvas.Free; + FBaseCanvas.Free; + inherited Destroy; +end; + +procedure TdxSkinFormPainter.CreateCacheInfos; +var + AIcon: TdxSkinFormIcon; + ASide: TcxBorder; +begin + for ASide := Low(TcxBorder) to High(TcxBorder) do + FBordersCache[ASide] := TdxSkinElementCache.Create; + for AIcon := Low(TdxSkinFormIcon) to High(TdxSkinFormIcon) do + FIconsCache[AIcon] := TdxSkinElementCache.Create; +end; + +procedure TdxSkinFormPainter.FreeCacheInfos; +var + AIcon: TdxSkinFormIcon; + ASide: TcxBorder; +begin + for ASide := Low(TcxBorder) to High(TcxBorder) do + FBordersCache[ASide].Free; + for AIcon := Low(TdxSkinFormIcon) to High(TdxSkinFormIcon) do + FIconsCache[AIcon].Free; +end; + +procedure TdxSkinFormPainter.BeginPaint(ADestDC: HDC = 0); +const + Flags = DCX_CACHE or DCX_CLIPSIBLINGS or DCX_WINDOW or DCX_VALIDATE; +begin + FPainter := ViewInfo.Painter; + FPainterInfo := ViewInfo.PainterInfo; + FDC := ADestDC; + FNeedRelease := ADestDC = 0; + if FNeedRelease then + FDC := GetDCEx(ViewInfo.Handle, 0, Flags); + FBaseCanvas.Handle := FDC; +end; + +procedure TdxSkinFormPainter.DrawWindowBackground; +begin + if PainterInfo <> nil then + dxSkinCheckSkinElement(PainterInfo.FormContent).Draw(Canvas.Handle, + ViewInfo.ClientRectOnClient); +end; + +procedure TdxSkinFormPainter.DrawWindowBorder; +begin + InternalDrawCaption(ViewInfo.BorderBounds[bTop], + PainterInfo.FormFrames[not ViewInfo.ToolWindow, bTop]); + if IsBordersThin then + InternalDrawThinBorders + else + InternalDrawBorders; + // Draw menu separator + if ViewInfo.HasMenu then + FillRect(Canvas.Handle, cxRectSetBottom(ViewInfo.MenuBounds, ViewInfo.MenuBounds.Bottom, 1), + GetSysColorBrush(COLOR_MENU)); + if (ViewInfo.ScrollAreaElements <> []) and not ViewInfo.IsIconic then + DrawScrollAreaElements(Canvas.Handle); +end; + +procedure TdxSkinFormPainter.EndPaint; +begin + if FNeedRelease then + ReleaseDC(ViewInfo.Handle, FDC); + FBaseCanvas.Handle := 0; +end; + +procedure TdxSkinFormPainter.DrawBackground(DC: HDC; const R: TRect); +begin + dxSkinCheckSkinElement(PainterInfo.FormContent).Draw(DC, R); +end; + +procedure TdxSkinFormPainter.DrawScrollAreaElements(DC: HDC); +var + AElement: TdxScrollAreaElement; + CDC: HDC; + MemBMP: HBitmap; +begin + for AElement := saeHorzScroll to saeSizeGrip do + with ViewInfo do + begin + if not (AElement in ViewInfo.ScrollAreaElements) then Continue; + if AElement = saeSizeGrip then + DrawSizeGrip(DC, ScrollAreaBounds[AElement]) + else + begin + CDC := CreateCompatibleDC(0); + with ScrollAreaBounds[AElement] do + begin + MemBMP := CreateCompatibleBitmap(DC, Right - Left, Bottom - Top); + SetWindowOrgEx(CDC, Left, Top, nil); + end; + MemBMP := SelectObject(CDC, MemBmp); + DrawBackground(CDC, ScrollAreaBounds[AElement]); + DrawScrollBar(CDC, AElement, ScrollAreaBounds[AElement]); + SetWindowOrgEx(CDC, 0, 0, nil); + with ScrollAreaBounds[AElement] do + BitBlt(DC, Left, Top, Right - Left, Bottom - Top, CDC, 0, 0, SRCCOPY); + MemBMP := SelectObject(CDC, MemBmp); + DeleteObject(MemBMP); + DeleteDC(CDC); + end; + end; +end; + +procedure TdxSkinFormPainter.DrawScrollBar( + DC: HDC; AScrollBar: TdxSkinFormScrollBar; const R: TRect); +var + APart: TcxScrollBarPart; +begin + DrawBackground(DC, R); + DC := SelectDC(DC); + for APart := sbpLineUp to sbpPageDown do + with ViewInfo do + begin + if ScrollBarPartState[AScrollBar, APart] = cxbsDefault then Continue; + Painter.DrawScrollBarPart(Canvas, AScrollBar = saeHorzScroll, + ScrollBarPartBounds[AScrollBar, APart], APart, ScrollBarPartState[AScrollBar, APart]); + end; + SelectDC(DC); +end; + +procedure TdxSkinFormPainter.DrawSizeGrip(DC: HDC; const R: TRect); +begin +// FillRect(DC, R, CreateSolidBrush(clRed)); + DrawBackground(DC, R); + Painter.DrawSizeGrip(Canvas, R, clNone); +end; + +procedure TdxSkinFormPainter.DrawWindowCaption(DC: HDC; const R: TRect; + AElement: TdxSkinElement); +var + CR: TRect; + AIcon: TdxSkinFormIcon; + APrevFont: HFONT; + APrevColor: TColor; + APrevTransparent: Integer; +begin + FBordersCache[bTop].CheckCacheState(dxSkinCheckSkinElement(AElement), R, + FrameStates[ViewInfo.Active], 0); + FBordersCache[bTop].Draw(DC, R); + for AIcon := Low(TdxSkinFormIcon) to High(TdxSkinFormIcon) do + if AIcon in ViewInfo.Icons then + begin + DrawWindowIcon(DC, ViewInfo.IconBounds[AIcon], AIcon, + PainterInfo.FormIcons[not ViewInfo.ToolWindow, AIcon]); + end; + if Length(ViewInfo.Caption) > 0 then + begin + APrevFont := SelectObject(DC, ViewInfo.CaptionFont.Handle); + APrevTransparent := SetBkMode(DC, Transparent); + CR := ViewInfo.CaptionBounds; + if ViewInfo.Active and not ViewInfo.ToolWindow then + begin + APrevColor := SetTextColor(DC, ViewInfo.CaptionTextShadowColor); + if ViewInfo.CaptionTextShadowColor <> clDefault then + cxDrawText(DC, ViewInfo.Caption, CR, CaptionFlags); + SetTextColor(DC, APrevColor); + end; + OffsetRect(CR, -1, -1); + APrevColor := SetTextColor(DC, ViewInfo.CaptionTextColor); + cxDrawText(DC, ViewInfo.Caption, CR, CaptionFlags); + SetBkMode(DC, APrevTransparent); + SelectObject(DC, APrevFont); + SetTextColor(DC, APrevColor); + end; +end; + +procedure TdxSkinFormPainter.DrawWindowIcon(DC: HDC; const R: TRect; + AIcon: TdxSkinFormIcon; AElement: TdxSkinElement); +begin + if ((AIcon = sfiMenu) and (ViewInfo.SysMenuIcon = 0)) or + ((AIcon <> sfiMenu) and (AElement = nil)) then Exit; + + if RectVisible(DC, R) then + begin + if AElement = nil then + DrawIconEx(DC, R.Left, R.Top, ViewInfo.SysMenuIcon, R.Right - R.Left, + R.Bottom - R.Top, 0, 0, DI_NORMAL) + else + begin + FIconsCache[AIcon].CheckCacheState(AElement, R, ViewInfo.IconState[AIcon], 0); + FIconsCache[AIcon].Draw(DC, R); + end; + end; +end; + +procedure TdxSkinFormPainter.InternalDrawBorder(const R: TRect; + ASide: TcxBorder; AFillBackground: Boolean); +var + ACachedDC: HDC; + AElement: TdxSkinElement; + AMemBmp: HBitmap; + R1: TRect; +begin + AElement := PainterInfo.FormFrames[not ViewInfo.ToolWindow, ASide]; + FBordersCache[ASide].CheckCacheState(AElement, R, FrameStates[Active]); + if AFillBackground then + begin + R1 := R; + OffsetRect(R1, -R1.Left, -R1.Top); + ACachedDC := CreateCompatibleDC(Canvas.Handle); + AMemBmp := CreateCompatibleBitmap(Canvas.Handle, R1.Right, R1.Bottom); + AMemBmp := SelectObject(ACachedDC, AMemBmp); + dxSkinCheckSkinElement(PainterInfo.FormContent).Draw(ACachedDC, R1, 0, FrameStates[Active]); + FBordersCache[ASide].Draw(ACachedDC, R1); + BitBlt(Canvas.Handle, R.Left, R.Top, R1.Right, R1.Bottom, ACachedDC, 0, 0, SRCCOPY); + AMemBMP := SelectObject(ACachedDC, AMemBmp); + DeleteObject(AMemBmp); + DeleteDC(ACachedDC); + end + else + FBordersCache[ASide].Draw(Canvas.Handle, R); +end; + +procedure TdxSkinFormPainter.InternalDrawBorders; +var + AIsAlphaBlendUsed: Boolean; + ASide: TcxBorder; + R: TRect; +begin + AIsAlphaBlendUsed := ViewInfo.IsAlphaBlendUsed; + for ASide := Low(TcxBorder) to High(TcxBorder) do + begin + R := ViewInfo.BorderBounds[ASide]; + if (ASide <> bTop) and IsRectVisible(R) and not cxRectIsEmpty(R) then + begin + if ASide in [bLeft, bRight] then + begin + R.Top := ViewInfo.BorderBounds[bTop].Bottom; + R.Bottom := ViewInfo.BorderBounds[bBottom].Top; + end; + InternalDrawBorder(R, ASide, AIsAlphaBlendUsed); + end; + end; +end; + +procedure TdxSkinFormPainter.InternalDrawCaption(const R: TRect; + AElement: TdxSkinElement); +var + ACachedDC: HDC; + AMemBmp: HBitmap; +begin + ACachedDC := CreateCompatibleDC(Canvas.Handle); + AMemBmp := CreateCompatibleBitmap(Canvas.Handle, R.Right, R.Bottom); + AMemBmp := SelectObject(ACachedDC, AMemBmp); + DrawWindowCaption(ACachedDC, R, AElement); + BitBlt(Canvas.Handle, 0, 0, R.Right, R.Bottom, ACachedDC, 0, 0, SRCCOPY); + AMemBMP := SelectObject(ACachedDC, AMemBmp); + DeleteObject(AMemBmp); + DeleteDC(ACachedDC); +end; + +procedure TdxSkinFormPainter.InternalDrawThinBorders; +var + ASide: TcxBorder; + R: TRect; +begin + InternalDrawBorder(ViewInfo.BorderBounds[bBottom], bBottom, True); + for ASide := Low(TcxBorder) to High(TcxBorder) do + if ASide in [bLeft, bRight] then + begin + R := ViewInfo.BorderBounds[ASide]; + if IsRectVisible(R) and not cxRectIsEmpty(R) then + begin + R.Top := ViewInfo.BorderBounds[bTop].Bottom; + R.Bottom := ViewInfo.WindowBounds.Bottom - ViewInfo.SkinBorderWidth[bBottom]; + InternalDrawBorder(R, ASide, True); + end; + end; +end; + +function TdxSkinFormPainter.IsRectVisible(const R: TRect): Boolean; +begin + with FViewInfo do + Result := (FUpdateRgn = 0) or RectInRegion(FUpdateRgn, R); + if Result then + Result := Canvas.RectVisible(R); +end; + +function TdxSkinFormPainter.SelectDC(DC: HDC): Integer; +begin + Result := Canvas.Handle; + Canvas.Canvas.Handle := DC; +end; + +function TdxSkinFormPainter.GetActive: Boolean; +begin + Result := ViewInfo.Active; +end; + +function TdxSkinFormPainter.GetIconElement( + AIcon: TdxSkinFormIcon): TdxSkinElement; +begin + Result := FPainterInfo.FormIcons[ViewInfo.ToolWindow, AIcon]; +end; + +function TdxSkinFormPainter.GetIsBordersThin: Boolean; +begin + Result := (ViewInfo.SkinBorderWidth[bLeft] < ViewInfo.BorderWidths.Left) or + (ViewInfo.SkinBorderWidth[bRight] < ViewInfo.BorderWidths.Right) or + (ViewInfo.SkinBorderWidth[bBottom] < ViewInfo.BorderWidths.Bottom); +end; + +{ TdxSkinButtonPainter } + +constructor TdxSkinCustomControlPainter.Create(AViewInfo: TdxSkinCustomControlViewInfo); +begin + FViewInfo := AViewInfo; + FCanvas := TCanvas.Create; + FcxCanvas := TcxCanvas.Create(FCanvas); +end; + +destructor TdxSkinCustomControlPainter.Destroy; +begin + FViewInfo := nil; + FcxCanvas.Free; + FCanvas.Free; + inherited Destroy; +end; + +function TdxSkinCustomControlPainter.GetController: TdxSkinWinController; +begin + Result := ViewInfo.Controller; +end; + +function TdxSkinCustomControlPainter.GetPainter: TcxCustomLookAndFeelPainterClass; +begin + Result := Controller.LookAndFeelPainter; +end; + +procedure TdxSkinCustomControlPainter.BeginPaint(DC: HDC = 0); +const + Flags = DCX_CACHE or DCX_CLIPSIBLINGS or DCX_WINDOW or DCX_VALIDATE; +begin + FNeedRelease := DC = 0; + if NeedRelease then + DC := GetDCEx(Controller.Handle, 0, Flags); + FDC := DC; + Canvas.Canvas.Handle := FDC; +end; + +procedure TdxSkinCustomControlPainter.EndPaint; +begin + Canvas.Canvas.Handle := 0; + if NeedRelease then + ReleaseDC(Controller.Handle, FDC); +end; + +procedure TdxSkinCustomControlPainter.DrawBackground; +var + AControl: TWinControl; +begin + AControl := Controller.WinControl; + if AControl <> nil then + cxDrawTransparentControlBackground(AControl, Canvas, ViewInfo.ClientRect); +end; + +procedure TdxSkinCustomControlPainter.DrawButton(const ACaption: string; + const R: TRect; AState: TcxButtonState); +var + AFlags: Integer; +begin + Painter.DrawButton(Canvas, R, '', AState, False, clDefault, clDefault, False); + if Length(ACaption) > 0 then + begin + Canvas.Brush.Style := bsClear; + AFlags := cxAlignVCenter or cxShowPrefix or cxAlignHCenter; + if GetWindowLong(Controller.Handle, GWL_STYLE) and BS_MULTILINE <> 0 then + AFlags := AFlags or cxWordBreak + else + AFlags := AFlags or cxSingleLine; + if AState = cxbsDisabled then + begin + Canvas.Font.Color := clBtnHighlight; + Canvas.DrawText(ACaption, cxRectOffset(R, 1, 1), AFlags, True); + end; + Canvas.Font.Color := Painter.ButtonSymbolColor(AState); + Canvas.DrawText(ACaption, R, AFlags, True); + end; +end; + +procedure TdxSkinCustomControlPainter.DrawFocus(const R: TRect); +begin + DrawFocusRect(Canvas.Handle, R); +end; + +{ TdxSkinCustomControlViewInfo } + +constructor TdxSkinCustomControlViewInfo.Create(AController: TdxSkinWinController); +begin + FController := AController; +end; + +function TdxSkinCustomControlViewInfo.GetClientRect: TRect; +begin + GetWindowRect(Controller.Handle, Result); + OffsetRect(Result, -Result.Left, -Result.Top); +end; + +function TdxSkinCustomControlViewInfo.GetIsEnabled: Boolean; +begin + Result := IsWindowEnabled(Controller.Handle); +end; + +function TdxSkinCustomControlViewInfo.GetIsFocused: Boolean; +begin + Result := GetFocus = Controller.Handle; +end; + +function TdxSkinCustomControlViewInfo.GetIsMouseAtControl: Boolean; +begin + Result := WindowFromPoint(Mouse.CursorPos) = FController.Handle; +end; + +{ TdxSkinButtonViewInfo } + +constructor TdxSkinButtonViewInfo.Create(AController: TdxSkinWinController); +begin + inherited Create(AController); + FCaption := GetWindowCaption(Controller.Handle); + UpdateEnabledState; +end; + +procedure TdxSkinButtonViewInfo.MouseClickEvent(ADown: Boolean); +const + AStates: array[Boolean] of TcxButtonState = (cxbsNormal, cxbsPressed); +begin + State := AStates[ADown]; +end; + +procedure TdxSkinButtonViewInfo.MouseHoverEvent(AEnter: Boolean); +const + AStates: array[Boolean, Boolean] of TcxButtonState = + ((cxbsNormal, cxbsNormal), (cxbsHot, cxbsPressed)); +begin + State := AStates[AEnter, Pressed]; +end; + +procedure TdxSkinButtonViewInfo.SetState(AState: TcxButtonState); +var + ANewState: TcxButtonState; +begin + if IsEnabled then + ANewState := AState + else + ANewState := cxbsDisabled; + + if ANewState <> FState then + begin + FState := ANewState; + FPressed := FState = cxbsPressed; + Controller.RedrawWindow(True); + end; +end; + +procedure TdxSkinButtonViewInfo.UpdateEnabledState; +const + AStates: array[Boolean] of TcxButtonState = (cxbsDisabled, cxbsNormal); +begin + State := AStates[IsEnabled]; +end; + +{ TdxSkinButtonController } + +function TdxSkinButtonController.GetViewInfo: TdxSkinButtonViewInfo; +begin + Result := TdxSkinButtonViewInfo(inherited ViewInfo); +end; + +class function TdxSkinButtonController.GetViewInfoClass: TdxSkinCustomControlViewInfoClass; +begin + Result := TdxSkinButtonViewInfo; +end; + +procedure TdxSkinButtonController.DrawContent(DC: HDC = 0); +begin + Painter.BeginPaint(DC); + try + Painter.DrawBackground; + with TdxSkinButtonViewInfo(ViewInfo) do + begin + Painter.DrawButton(Caption, ClientRect, State); + if IsFocused then + Painter.DrawFocus(cxRectInflate(ClientRect, -4, -4)); + end; + finally + Painter.EndPaint; + end; +end; + +procedure TdxSkinButtonController.MouseLeave; +begin + inherited MouseLeave; + ViewInfo.MouseHoverEvent(False) +end; + +procedure TdxSkinButtonController.WndProc(var AMessage: TMessage); +const + AStates: array[Boolean] of TcxButtonState = (cxbsDisabled, cxbsNormal); +begin + if AMessage.Msg = WM_SETTEXT then + ViewInfo.FCaption := TWMSetText(AMessage).Text; + + inherited WndProc(AMessage); + if IsSkinUsed then + case AMessage.Msg of + WM_ENABLE: + ViewInfo.UpdateEnabledState; + WM_UPDATEUISTATE: + if AMessage.WParamLo in [UIS_SET, UIS_CLEAR] then + DrawContent; + BM_SETSTATE: + ViewInfo.MouseClickEvent(AMessage.WParam <> 0); + WM_MOUSELEAVE, CM_MOUSELEAVE: + ViewInfo.MouseHoverEvent(False); + WM_MOUSEMOVE, WM_MOUSEHOVER: + if ViewInfo.IsMouseAtControl then + ViewInfo.MouseHoverEvent(True); + end; +end; + +{ TdxSkinCustomController } + +constructor TdxSkinCustomController.Create(AHandle: HWND); +begin + inherited Create(AHandle); + FViewInfo := GetViewInfoClass.Create(Self); + FPainter := TdxSkinCustomControlPainter.Create(FViewInfo); +end; + +destructor TdxSkinCustomController.Destroy; +begin + FViewInfo.Free; + FPainter.Free; + inherited Destroy; +end; + +procedure TdxSkinCustomController.DrawBackground(DC: HDC = 0); +begin + Painter.BeginPaint(DC); + try + Painter.DrawBackground; + finally + Painter.EndPaint; + end; +end; + +procedure TdxSkinCustomController.DrawContent(DC: HDC = 0); +begin +end; + +class function TdxSkinCustomController.GetViewInfoClass: TdxSkinCustomControlViewInfoClass; +begin + Result := TdxSkinCustomControlViewInfo; +end; + +function TdxSkinCustomController.GetMaster(AHandle: HWND): TdxSkinWinController; +var + AParent: TCustomForm; +begin + Result := nil; + if Assigned(WinControl) then + begin + AParent := GetParentForm(WinControl); + if Assigned(AParent) and GetUseSkinForControl then + Result := GetControllerByHandle(AParent.Handle) + end; +end; + +procedure TdxSkinCustomController.InitializePainter; +begin + // nothing todo +end; + +function TdxSkinCustomController.WMEraseBk(var AMessage: TWMEraseBkgnd): Boolean; +begin + AMessage.Result := 1; + Result := True; +end; + +function TdxSkinCustomController.WMPaint(var AMessage: TWMPaint): Boolean; +var + APaintStruct: TPaintStruct; + ADC: HDC; +begin + Result := True; + if AMessage.DC <> 0 then + DrawContent(AMessage.DC) + else + begin + ADC := BeginPaint(Handle, APaintStruct); + try + DrawContent(ADC); + finally + EndPaint(Handle, APaintStruct); + end; + end; +end; + +procedure TdxSkinCustomController.WndProc(var AMessage: TMessage); +var + AHandled: Boolean; +begin + AHandled := False; + if IsSkinUsed then + case AMessage.Msg of + WM_ERASEBKGND: + AHandled := WMEraseBk(TWMEraseBkgnd(AMessage)); + + WM_PAINT: + AHandled := WMPaint(TWMPaint(AMessage)); + end; + + if not AHandled then + inherited WndProc(AMessage); +end; + +{ TdxSkinPanelController } + +procedure TdxSkinPanelController.DrawContent(DC: HDC = 0); +const + Alignments: array[TAlignment] of Longint = (DT_LEFT, DT_RIGHT, DT_CENTER); +var + AControl: TControl; + R: TRect; +begin + AControl := WinControl; + if Assigned(AControl) and (AControl is TCustomPanel) then + begin + Painter.BeginPaint(DC); + try + R := ViewInfo.ClientRect; + InternalDrawBackground(TCustomPanel(AControl), R); + with TCustomPanelAccess(AControl) do + begin + Painter.Canvas.Brush.Style := bsClear; + Painter.Canvas.Font := Font; + DrawText(Painter.Canvas.Handle, PChar(Caption), -1, R, + DrawTextBiDiModeFlags(DT_EXPANDTABS or DT_SINGLELINE or DT_VCENTER or + Alignments[Alignment])); + PaintControls(Painter.Canvas.Handle, nil); + end; + finally + Painter.EndPaint; + end; + end; +end; + +procedure TdxSkinPanelController.InternalDrawBackground(APanel: TCustomPanel; + const R: TRect); +var + ABGColor: TColor; +begin + with TCustomPanelAccess(APanel) do + begin + if (csParentBackground in ControlStyle) or (Color = clBtnFace) then + ABGColor := clDefault + else + ABGColor := Color; + Painter.Painter.DrawPanelBackground(Painter.Canvas, APanel, R, ABGColor); + if not (csParentBackground in ControlStyle) and (ABGColor = clDefault) then + Painter.Painter.DrawPanelContent(Painter.Canvas, R, False); + if (BevelOuter <> bvNone) or (BevelInner <> bvNone) then + Painter.Painter.DrawPanelBorders(Painter.Canvas, R); + end; +end; + +function TdxSkinPanelController.WMEraseBk(var AMessage: TWMEraseBkgnd): Boolean; +begin + Result := WMPaint(TWMPaint(AMessage)); + if not Result then + Result := inherited WMEraseBk(AMessage); +end; + +function TdxSkinPanelController.WMPaint(var AMessage: TWMPaint): Boolean; +begin + Result := False; + if not FPainting then + begin + FPainting := True; + try + Result := inherited WMPaint(AMessage); + finally + FPainting := False; + end; + end; +end; + +procedure TdxSkinPanelController.WndProc(var AMessage: TMessage); +var + AHandled: Boolean; +begin + AHandled := False; + if (AMessage.Msg = WM_PRINTCLIENT) and IsSkinUsed then + with TWMPrintClient(AMessage) do + begin + AHandled := (Result <> 1) and ((Flags and PRF_CHECKVISIBLE = 0) or IsWindowVisible(Handle)); + if AHandled then + WMPaint(TWMPaint(AMessage)); + end; + if not AHandled then + inherited WndProc(AMessage); +end; + +{ TdxSkinFrameController } + +procedure TdxSkinFrameController.DrawContent(DC: HDC = 0); +var + AControl: TWinControl; +begin + Painter.BeginPaint(DC); + try + AControl := WinControl; + if (AControl <> nil) and (AControl is TCustomFrame) then + with TCustomFrameAccess(AControl) do + begin + if csParentBackground in ControlStyle then + cxDrawTransparentControlBackground(AControl, Painter.Canvas, + ViewInfo.ClientRect, False) + else + (Master as TdxSkinFormController).DrawWindowBackground(Painter.Canvas.Handle); + PaintControls(Painter.Canvas.Handle, nil); + end; + finally + Painter.EndPaint; + end; +end; + +function TdxSkinFrameController.WMPrintClient(var AMessage: TWMPrintClient): Boolean; +begin + Result := (AMessage.Result <> 1) and ((AMessage.Flags and PRF_CHECKVISIBLE = 0) or + IsWindowVisible(Handle)); + if Result then + Result := WMPaint(TWMPaint(AMessage)); +end; + +procedure TdxSkinFrameController.WndProc(var AMessage: TMessage); +begin + if not IsSkinUsed or (AMessage.Msg <> WM_PRINTCLIENT) or not + WMPrintClient(TWMPrintClient(AMessage)) + then + inherited WndProc(AMessage); +end; + +{ TdxSkinWinControllerHelper } + +constructor TdxSkinWinControllerHelper.Create; +begin + FHandle := {$IFDEF DELPHI6}Classes.{$ENDIF}AllocateHWnd(WndProc); +end; + +destructor TdxSkinWinControllerHelper.Destroy; +begin + {$IFDEF DELPHI6}Classes.{$ENDIF}DeallocateHWnd(FHandle); + inherited Destroy; +end; + +procedure TdxSkinWinControllerHelper.WndProc(var AMsg: TMessage); + + function IsAnotherApplicatonWindow(AWnd: HWND): Boolean; + var + AProcessId: Cardinal; + begin + GetWindowThreadProcessId(AWnd, @AProcessId); + Result := (AWnd = 0) or (AProcessId <> GetCurrentProcessId); + end; + + function GetSkinClassForWindow(AWnd: HWND): TdxSkinWinControllerClass; + begin + Result := nil; + if not IsAnotherApplicatonWindow(AWnd) then + Result := dxSkinGetControllerClassForWindowProc(AWnd); + end; + +var + ASkinClass: TdxSkinWinControllerClass; +begin + if AMsg.Msg = WM_POSTCREATE then + begin + ASkinClass := GetSkinClassForWindow(AMsg.LParam); + if ASkinClass <> nil then + begin + GetSystemMenu(AMsg.LParam, True); // W2k redrawing bug + ASkinClass.InitializeEngine(AMsg.LParam); + PostMessage(AMsg.LParam, WM_POSTCHECKRGN, 0, 0); + end; + end + else + AMsg.Result := DefWindowProc(Handle, AMsg.Msg, AMsg.WParam, AMsg.LParam); +end; + +// + +function dxSkinGetControllerClassForWindow(AWnd: HWND): TdxSkinWinControllerClass; +var + AControl: TControl; +begin + Result := nil; + if TdxSkinWinController.IsMDIClientWindow(AWnd) then + Result := TdxSkinFormController + else + begin + AControl := FindControl(AWnd); + if AControl <> nil then + begin + if AControl is TCustomForm then + Result := TdxSkinFormController; + if AControl is TCustomFrame then + Result := TdxSkinFrameController; + if SameText(AControl.ClassName, 'TButton') then + Result := TdxSkinButtonController; + if SameText(AControl.ClassName, 'TPanel') then + Result := TdxSkinPanelController; + end; + end; +end; + +function dxSkinsWndProcHook(Code: Integer; wParam: WParam; lParam: LParam): LRESULT; stdcall; +var + AMsg: PCWPStruct; + + procedure ChildChanged(AHandle: HWND); + begin + if AHandle <> 0 then + if AnsiSameText(GetWindowClass(AHandle), 'MDICLIENT') then + begin + AHandle := GetParent(AHandle); + if AHandle <> 0 then + SendMessage(AHandle, WM_CHILDCHANGED, 0, 0); + end; + end; + +begin + AMsg := PCWPStruct(lParam); + Result := CallNextHookEx(WndProcHookHandle, Code, wParam, lParam); + if IsDesigning then Exit; + case AMsg.message of + WM_CHILDACTIVATE, WM_MDIACTIVATE: + ChildChanged(GetParent(AMsg.hwnd)); + + WM_CREATE, WM_MDICREATE: + PostMessage(SkinHelper.Handle, WM_POSTCREATE, 0, AMsg.hwnd); + + WM_DESTROY, WM_MDIDESTROY: + if AMsg.wParam = 0 then + begin + TdxSkinWinController.FinalizeEngine(AMsg.hwnd); + ChildChanged(GetParent(AMsg.hwnd)); + end; + end; +end; + +var + SetScrollInfo: function(hWnd: HWND; BarFlag: Integer; + const ScrollInfo: TScrollInfo; Redraw: BOOL): Integer; stdcall; + SetScrollPos: function (hWnd: HWND; nBar, nPos: Integer; + bRedraw: BOOL): Integer stdcall; + +function My_SetScrollPos(hWnd: HWND; nBar, nPos: Integer; + bRedraw: BOOL): Integer; stdcall; +begin + bRedraw := bRedraw and not TdxSkinFormController.IsSkinActive(hWnd); + Result := SetScrollPos(hWnd, nBar, nPos, bRedraw); +end; + +function My_SetScrollInfo(hWnd: HWND; BarFlag: Integer; + const ScrollInfo: TScrollInfo; Redraw: BOOL): Integer; stdcall; +begin + Redraw := Redraw and not TdxSkinFormController.IsSkinActive(hWnd); + Result := SetScrollInfo(hWnd, BarFlag, ScrollInfo, Redraw); +end; + +procedure RegisterAssistants; +begin + SetScrollPos := FlatSB_SetScrollPos; + SetScrollInfo := FlatSB_SetScrollInfo; + FlatSB_SetScrollPos := My_SetScrollPos; + FlatSB_SetScrollInfo := My_SetScrollInfo; + SkinControllersList := TList.Create; + SkinHelper := TdxSkinWinControllerHelper.Create; + WndProcHookHandle := SetWindowsHookEx(WH_CALLWNDPROC, dxSkinsWndProcHook, 0, GetCurrentThreadId); + WM_POSTREDRAW := RegisterWindowMessage('WM_POSTREDRAW'); + WM_CHILDCHANGED := RegisterWindowMessage('WM_CHILDCHANGED'); + WM_POSTCREATE := RegisterWindowMessage('WM_POSTCREATE'); + WM_POSTCHECKRGN := RegisterWindowMessage('WM_POSTCHECKRGN'); + FormControllers := TcxObjectList.Create; +end; + +procedure UnregisterAssistants; +begin + FlatSB_SetScrollPos := SetScrollPos; + FlatSB_SetScrollInfo := SetScrollInfo; + UnhookWindowsHookEx(WndProcHookHandle); + FormControllers.Clear; // destroy all active controllers + SkinControllersList.Free; + FormControllers.Free; + SkinHelper.Free; +end; + +initialization + dxSkinGetControllerClassForWindowProc := dxSkinGetControllerClassForWindow; + RegisterAssistants; + +finalization + UnregisterAssistants; +end. + diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinsLookAndFeelPainter.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinsLookAndFeelPainter.pas new file mode 100644 index 00000000..0b950b0f --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinsLookAndFeelPainter.pas @@ -0,0 +1,1802 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinsLookAndFeelPainter; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, Graphics, SysUtils, cxLookAndFeels, cxLookAndFeelPainters, + cxGraphics, dxSkinsCore, cxClasses, dxSkinsStrs, ImgList, dxGdiPlusApi, + cxGeometry, dxSkinInfo; + +type + { TdxSkinLookAndFeelPainterInfo } + + TdxSkinLookAndFeelPainterInfo = class(TdxSkinInfo); + + { TcxSkinLookAndFeelPainter } + + TdxSkinLookAndFeelPainter = class(TcxOffice11LookAndFeelPainter) + protected + class function CacheData: TdxSkinLookAndFeelPainterInfo; virtual; + class procedure DrawContent(ACanvas: TcxCanvas; const ABounds, ATextAreaBounds: TRect; AState: Integer; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil; AIsFooter: Boolean = False); override; + class function DrawEditorButtonBackground(ACanvas: TcxCanvas; const ARect: TRect; + ACloseButton: Boolean; AState: TdxSkinElementState): Boolean; virtual; + class procedure DrawSchedulerNavigationButtonContent(ACanvas: TcxCanvas; + const ARect: TRect; const AArrowRect: TRect; AIsNextButton: Boolean; + AState: TcxButtonState); override; + public + // colors + class function DefaultContentColor: TColor; override; + class function DefaultContentEvenColor: TColor; override; + class function DefaultContentOddColor: TColor; override; + class function DefaultContentTextColor: TColor; override; + class function DefaultEditorBackgroundColor(AIsDisabled: Boolean): TColor; override; + class function DefaultEditorTextColor(AIsDisabled: Boolean): TColor; override; + class function DefaultFilterBoxTextColor: TColor; override; + class function DefaultFixedSeparatorColor: TColor; override; + class function DefaultGridLineColor: TColor; override; + class function DefaultGroupByBoxTextColor: TColor; override; + class function DefaultGroupColor: TColor; override; + class function DefaultGroupTextColor: TColor; override; + class function DefaultHeaderBackgroundColor: TColor; override; + class function DefaultHeaderBackgroundTextColor: TColor; override; + class function DefaultHeaderColor: TColor; override; + class function DefaultHeaderTextColor: TColor; override; + class function DefaultRecordSeparatorColor: TColor; override; + class function DefaultSchedulerBackgroundColor: TColor; override; + class function DefaultSchedulerControlColor: TColor; override; + class function DefaultSchedulerNavigatorColor: TColor; override; + class function DefaultSchedulerViewSelectedTextColor: TColor; override; + class function DefaultSchedulerViewTextColor: TColor; override; + class function DefaultSelectionColor: TColor; override; + class function DefaultSelectionTextColor: TColor; override; + class function DefaultSeparatorColor: TColor; override; + class function DefaultSizeGripAreaColor: TColor; override; + + class function DefaultVGridBandLineColor: TColor; override; + class function DefaultVGridCategoryColor: TColor; override; + class function DefaultVGridCategoryTextColor: TColor; override; + class function DefaultVGridLineColor: TColor; override; + // borders + class procedure DrawBorder(ACanvas: TcxCanvas; R: TRect); override; + // buttons + class function AdjustGroupButtonDisplayRect(const R: TRect; AButtonCount, AButtonIndex: Integer): TRect; override; + class function ButtonBorderSize(AState: TcxButtonState = cxbsNormal): Integer; override; + class function ButtonColor(AState: TcxButtonState): TColor; override; + class function ButtonFocusRect(ACanvas: TcxCanvas; R: TRect): TRect; override; + class function ButtonGroupBorderSizes(AButtonCount, AButtonIndex: Integer): TRect; override; + class function ButtonSymbolColor(AState: TcxButtonState; + ADefaultColor: TColor = clDefault): TColor; override; + class function ButtonTextOffset: Integer; override; + class function ButtonTextShift: Integer; override; + class procedure DrawButton(ACanvas: TcxCanvas; R: TRect; const ACaption: string; + AState: TcxButtonState; ADrawBorder: Boolean = True; + AColor: TColor = clDefault; ATextColor: TColor = clDefault; + AWordWrap: Boolean = False); override; + class procedure DrawButtonGroupBorder(ACanvas: TcxCanvas; R: TRect; AInplace, ASelected: Boolean); override; + class procedure DrawButtonInGroup(ACanvas: TcxCanvas; R: TRect; + AState: TcxButtonState; AButtonCount, AButtonIndex: Integer; + ABackgroundColor: TColor); override; + class procedure DrawExpandButton(ACanvas: TcxCanvas; const R: TRect; + AExpanded: Boolean; AColor: TColor = clDefault); override; + class function DrawExpandButtonFirst: Boolean; override; + class procedure DrawGroupExpandButton(ACanvas: TcxCanvas; const R: TRect; + AExpanded: Boolean; AState: TcxButtonState); override; + class procedure DrawSmallExpandButton(ACanvas: TcxCanvas; R: TRect; AExpanded: Boolean; + ABorderColor: TColor; AColor: TColor = clDefault); override; + class function ExpandButtonSize: Integer; override; + class function GroupExpandButtonSize: Integer; override; + class function SmallExpandButtonSize: Integer; override; + class function IsButtonHotTrack: Boolean; override; + class function IsPointOverGroupExpandButton(const R: TRect; const P: TPoint): Boolean; override; + // scroll bars + class function ScrollBarMinimalThumbSize(AVertical: Boolean): Integer; override; + class procedure DrawScrollBarPart(ACanvas: TcxCanvas; AHorizontal: Boolean; + R: TRect; APart: TcxScrollBarPart; AState: TcxButtonState); override; + // size grip + class function SizeGripSize: TSize; override; + class procedure DrawSizeGrip(ACanvas: TcxCanvas; const ARect: TRect; ABackgroundColor: TColor); override; + // RadioGroup + class procedure DrawRadioButton(ACanvas: TcxCanvas; X, Y: Integer; + AButtonState: TcxButtonState; AChecked, AFocused: Boolean; + ABrushColor: TColor; AIsDesigning: Boolean = False); override; + class function RadioButtonSize: TSize; override; + // Checkbox + class function CheckButtonSize: TSize; override; + class procedure DrawCheckButton(ACanvas: TcxCanvas; R: TRect; + AState: TcxButtonState; ACheckState: TcxCheckBoxState); override; + // Editors + class procedure DrawClock(ACanvas: TcxCanvas; const ARect: TRect; + ADateTime: TDateTime; ABackgroundColor: TColor); override; + class procedure DrawEditorButton(ACanvas: TcxCanvas; const ARect: TRect; + AButtonKind: TcxEditBtnKind; AState: TcxButtonState); override; + class function EditButtonTextOffset: Integer; override; + class function EditButtonSize: TSize; override; + class function EditButtonTextColor: TColor; override; + class function GetContainerBorderColor(AIsHighlightBorder: Boolean): TColor; override; + // Navigator + class procedure DrawNavigatorGlyph(ACanvas: TcxCanvas; + AImageList: TCustomImageList; AImageIndex: {$IFDEF DELPHI5}TImageIndex{$ELSE}Integer{$ENDIF}; + AButtonIndex: Integer; const AGlyphRect: TRect; AEnabled: Boolean; AUserGlyphs: Boolean); override; + class function NavigatorGlyphSize: TSize; override; + // ProgressBar + class procedure DrawProgressBarBorder(ACanvas: TcxCanvas; ARect: TRect; AVertical: Boolean); override; + class procedure DrawProgressBarChunk(ACanvas: TcxCanvas; ARect: TRect; AVertical: Boolean); override; + class function ProgressBarBorderSize(AVertical: Boolean): TRect; override; + // GroupBox + class procedure DrawGroupBoxBackground(ACanvas: TcxCanvas; ABounds: TRect; + ARect: TRect); override; + class procedure DrawGroupBoxCaption(ACanvas: TcxCanvas; ACaptionRect: TRect; + ACaptionPosition: TcxGroupBoxCaptionPosition); override; + class procedure DrawGroupBoxContent(ACanvas: TcxCanvas; ABorderRect: TRect; + ACaptionPosition: TcxGroupBoxCaptionPosition); override; + class function GroupBoxBorderSize(ACaption: Boolean; + ACaptionPosition: TcxGroupBoxCaptionPosition): TRect; override; + class function GroupBoxTextColor(ACaptionPosition: TcxGroupBoxCaptionPosition): TColor; override; + class function IsGroupBoxTransparent(AIsCaption: Boolean; + ACaptionPosition: TcxGroupBoxCaptionPosition): Boolean; override; + // Header + class procedure DrawHeader(ACanvas: TcxCanvas; const ABounds, ATextAreaBounds: TRect; + ANeighbors: TcxNeighbors; ABorders: TcxBorders; AState: TcxButtonState; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil; AIsLast: Boolean = False; + AIsGroup: Boolean = False); override; + class procedure DrawHeaderEx(ACanvas: TcxCanvas; const ABounds, ATextAreaBounds: TRect; + ANeighbors: TcxNeighbors; ABorders: TcxBorders; AState: TcxButtonState; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil); override; + class procedure DrawHeaderSeparator(ACanvas: TcxCanvas; const ABounds: TRect; + AIndentSize: Integer; AColor: TColor; AViewParams: TcxViewParams); override; + class function HeaderBorders(ANeighbors: TcxNeighbors): TcxBorders; override; + class function HeaderDrawCellsFirst: Boolean; override; + // Grid + class procedure DrawGroupByBox(ACanvas: TcxCanvas; const ARect: TRect; + ATransparent: Boolean; ABackgroundColor: TColor; const ABackgroundBitmap: TBitmap); override; + // Footer + class procedure DrawFooterBorder(ACanvas: TcxCanvas; const R: TRect); override; + class procedure DrawFooterCell(ACanvas: TcxCanvas; const ABounds: TRect; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; AMultiLine: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil); override; + class procedure DrawFooterContent(ACanvas: TcxCanvas; const ARect: TRect; + const AViewParams: TcxViewParams); override; + class function FooterCellBorderSize: Integer; override; + class function FooterDrawCellsFirst: Boolean; override; + class function FooterSeparatorColor: TColor; override; + // filter + class function FilterCloseButtonSize: TPoint; override; + class procedure DrawFilterCloseButton(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); override; + class procedure DrawFilterDropDownButton(ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState; AIsFilterActive: Boolean); override; + class procedure DrawFilterPanel(ACanvas: TcxCanvas; const ARect: TRect; + ATransparent: Boolean; ABackgroundColor: TColor; const ABackgroundBitmap: TBitmap); override; + // Panel + class procedure DrawPanelBorders(ACanvas: TcxCanvas; const ABorderRect: TRect); override; + class procedure DrawPanelContent(ACanvas: TcxCanvas; const ABorderRect: TRect; ABorder: Boolean); override; + // TrackBar + class procedure DrawTrackBar(ACanvas: TcxCanvas; const ARect: TRect; + const ASelection: TRect; AShowSelection: Boolean; AEnabled: Boolean; + AHorizontal: Boolean); override; + class procedure DrawTrackBarThumb(ACanvas: TcxCanvas; ARect: TRect; AState: TcxButtonState; + AHorizontal: Boolean; ATicks: TcxTrackBarTicksAlign); override; + class function TrackBarThumbSize(AHorizontal: Boolean): TSize; override; + class function TrackBarTrackSize: Integer; override; + // Splitter + class procedure DrawSplitter(ACanvas: TcxCanvas; const ARect: TRect; + AHighlighted: Boolean; AClicked: Boolean; AHorizontal: Boolean); override; + class function GetSplitterSize(AHorizontal: Boolean): TSize; override; + // Indicator + class procedure DrawIndicatorCustomizationMark(ACanvas: TcxCanvas; + const R: TRect; AColor: TColor); override; + class procedure DrawIndicatorImage(ACanvas: TcxCanvas; const R: TRect; AKind: TcxIndicatorKind); override; + class procedure DrawIndicatorItem(ACanvas: TcxCanvas; const R: TRect; + AKind: TcxIndicatorKind; AColor: TColor; AOnDrawBackground: TcxDrawBackgroundEvent = nil); override; + class procedure DrawIndicatorItemEx(ACanvas: TcxCanvas; const R: TRect; + AKind: TcxIndicatorKind; AColor: TColor; AOnDrawBackground: TcxDrawBackgroundEvent = nil); override; + class function IndicatorDrawItemsFirst: Boolean; override; + // ms outlook + class procedure DrawMonthHeader(ACanvas: TcxCanvas; const ABounds: TRect; + const AText: string; ANeighbors: TcxNeighbors; const AViewParams: TcxViewParams; + AArrows: TcxHeaderArrows; ASideWidth: Integer; AOnDrawBackground: TcxDrawBackgroundEvent = nil); override; + class procedure DrawSchedulerEventProgress(ACanvas: TcxCanvas; + const ABounds, AProgress: TRect; AViewParams: TcxViewParams; ATransparent: Boolean); override; + class function SchedulerEventProgressOffsets: TRect; override; + // Scheduler + class procedure CalculateSchedulerNavigationButtonRects(AIsNextButton: Boolean; + ACollapsed: Boolean; APrevButtonTextSize: TSize; ANextButtonTextSize: TSize; + var ABounds: TRect; out ATextRect: TRect; out AArrowRect: TRect); override; + class procedure DrawSchedulerNavigatorButton(ACanvas: TcxCanvas; R: TRect; + AState: TcxButtonState); override; + class procedure SchedulerNavigationButtonSizes(AIsNextButton: Boolean; + var ABorders: TRect; var AArrowSize: TSize); override; + // Popup + class procedure DrawWindowContent(ACanvas: TcxCanvas; const ARect: TRect); override; + class function InternalUnitName: string; virtual; + end; + + TdxSkinLookAndFeelPainterClass = class of TdxSkinLookAndFeelPainter; + + procedure RegisterSkin(ASkin: TdxSkin; APainter: TdxSkinLookAndFeelPainterClass); overload; + procedure RegisterSkin(const ASkinName: string; APainter: TdxSkinLookAndFeelPainterClass; + ALoadFromResource: Boolean; AInstance: THandle); overload; + procedure UnregisterSkin(const ASkinName: string); + +implementation + +uses + Math, dxSkinsDefaultPainters; + +var + PaintersManager: TcxExtendedStylePainters; + +const + ButtonState2SkinState: array[TcxButtonState] of TdxSkinElementState = + (esNormal, esNormal, esHot, esPressed, esDisabled); + +{ TdxSkinLookAndFeelPainter } + +class function TdxSkinLookAndFeelPainter.InternalUnitName: string; +begin + Result := 'dxSkinsLookAndFeelPainter'; +end; + +class function TdxSkinLookAndFeelPainter.DefaultContentColor: TColor; +begin + with CacheData do + if ContentColor = nil then + Result := inherited DefaultContentColor + else + Result := ContentColor.Value; +end; + +class function TdxSkinLookAndFeelPainter.DefaultContentEvenColor: TColor; +begin + with CacheData do + if (ContentEvenColor = nil) or (ContentEvenColor.Value = clDefault) then + Result := inherited DefaultContentEvenColor + else + Result := ContentEvenColor.Value; +end; + +class function TdxSkinLookAndFeelPainter.DefaultContentOddColor: TColor; +begin + with CacheData do + if (ContentOddColor = nil) or (ContentOddColor.Value = clDefault) then + Result := inherited DefaultContentOddColor + else + Result := ContentOddColor.Value; +end; + +class function TdxSkinLookAndFeelPainter.DefaultContentTextColor: TColor; +begin + with CacheData do + if ContentTextColor = nil then + Result := inherited DefaultContentTextColor + else + Result := ContentTextColor.Value; +end; + +class function TdxSkinLookAndFeelPainter.DefaultEditorBackgroundColor( + AIsDisabled: Boolean): TColor; +begin + with CacheData do + if EditorBackgroundColors[AIsDisabled] = nil then + Result := inherited DefaultEditorBackgroundColor(AIsDisabled) + else + Result := EditorBackgroundColors[AIsDisabled].Value; +end; + +class function TdxSkinLookAndFeelPainter.DefaultEditorTextColor( + AIsDisabled: Boolean): TColor; +begin + with CacheData do + if EditorTextColors[AIsDisabled] = nil then + Result := inherited DefaultEditorTextColor(AIsDisabled) + else + Result := EditorTextColors[AIsDisabled].Value; +end; + +class function TdxSkinLookAndFeelPainter.DefaultFilterBoxTextColor: TColor; +begin + with CacheData do + if FilterPanel = nil then + Result := inherited DefaultFilterBoxTextColor + else + Result := FilterPanel.TextColor; +end; + +class function TdxSkinLookAndFeelPainter.DefaultFixedSeparatorColor: TColor; +begin + with CacheData do + if GridFixedLine = nil then + Result := inherited DefaultFixedSeparatorColor + else + Result := GridFixedLine.Color; +end; + +class function TdxSkinLookAndFeelPainter.DefaultGridLineColor: TColor; +begin + with CacheData do + if GridLine = nil then + Result := inherited DefaultGridLineColor + else + Result := GridLine.Color; +end; + +class function TdxSkinLookAndFeelPainter.DefaultGroupColor: TColor; +begin + with CacheData do + if GridGroupRow = nil then + Result := inherited DefaultGroupColor + else + Result := GridGroupRow.Color; +end; + +class function TdxSkinLookAndFeelPainter.DefaultGroupByBoxTextColor: TColor; +begin + with CacheData do + if GridGroupByBox = nil then + Result := inherited DefaultGroupByBoxTextColor + else + Result := GridGroupByBox.TextColor; +end; + +class function TdxSkinLookAndFeelPainter.DefaultGroupTextColor: TColor; +begin + with CacheData do + if GridGroupRow = nil then + Result := inherited DefaultGroupTextColor + else + Result := GridGroupRow.TextColor; +end; + +class function TdxSkinLookAndFeelPainter.DefaultHeaderBackgroundColor: TColor; +begin + with CacheData do + if HeaderBackgroundColor = nil then + Result := inherited DefaultHeaderBackgroundColor + else + Result := HeaderBackgroundColor.Value; +end; + +class function TdxSkinLookAndFeelPainter.DefaultHeaderBackgroundTextColor: TColor; +begin + with CacheData do + if HeaderBackgroundTextColor = nil then + Result := inherited DefaultHeaderBackgroundTextColor + else + Result := HeaderBackgroundTextColor.Value; +end; + +class function TdxSkinLookAndFeelPainter.DefaultHeaderColor: TColor; +begin + with CacheData do + if Header = nil then + Result := inherited DefaultHeaderColor + else + Result := Header.Color; +end; + +class function TdxSkinLookAndFeelPainter.DefaultHeaderTextColor: TColor; +begin + with CacheData do + if Header = nil then + Result := inherited DefaultHeaderTextColor + else + Result := Header.TextColor; +end; + +class function TdxSkinLookAndFeelPainter.DefaultSelectionColor: TColor; +begin + with CacheData do + if SelectionColor = nil then + Result := inherited DefaultSelectionColor + else + Result := SelectionColor.Value; +end; + +class function TdxSkinLookAndFeelPainter.DefaultSelectionTextColor: TColor; +begin + with CacheData do + if SelectionTextColor = nil then + Result := inherited DefaultSelectionTextColor + else + Result := SelectionTextColor.Value; +end; + +class function TdxSkinLookAndFeelPainter.DefaultSeparatorColor: TColor; +begin + with CacheData do + if CardViewSeparator = nil then + Result := inherited DefaultSeparatorColor + else + Result := CardViewSeparator.Color; +end; + +class function TdxSkinLookAndFeelPainter.DefaultSchedulerBackgroundColor: TColor; +begin + with CacheData do + if ContentColor = nil then + Result := inherited DefaultSchedulerBackgroundColor + else + Result := ContentColor.Value; +end; + +class function TdxSkinLookAndFeelPainter.DefaultSchedulerControlColor: TColor; +begin + with CacheData do + if ContentColor = nil then + Result := inherited DefaultSchedulerControlColor + else + Result := ContentColor.Value; +end; + +class function TdxSkinLookAndFeelPainter.DefaultSchedulerNavigatorColor: TColor; +begin + with CacheData do + if SchedulerNavigatorColor = nil then + Result := inherited DefaultSchedulerNavigatorColor + else + Result := SchedulerNavigatorColor.Value; +end; + +class function TdxSkinLookAndFeelPainter.DefaultSchedulerViewSelectedTextColor: TColor; +begin + Result := DefaultSchedulerViewTextColor; +end; + +class function TdxSkinLookAndFeelPainter.DefaultSchedulerViewTextColor: TColor; +begin + with CacheData do + if SchedulerAppointment[True] = nil then + Result := inherited DefaultSchedulerViewTextColor + else + Result := SchedulerAppointment[True].TextColor; +end; + +class function TdxSkinLookAndFeelPainter.DefaultSizeGripAreaColor: TColor; +begin + Result := clDefault; + with CacheData do + if FormContent <> nil then + Result := FormContent.Color; + if Result = clDefault then + Result := inherited DefaultSizeGripAreaColor; +end; + +class function TdxSkinLookAndFeelPainter.DefaultRecordSeparatorColor: TColor; +begin + with CacheData do + if GridFixedLine = nil then + Result := inherited DefaultRecordSeparatorColor + else + Result := GridFixedLine.Color; +end; + +class function TdxSkinLookAndFeelPainter.DefaultVGridBandLineColor: TColor; +begin + with CacheData do + begin + if VGridLine[True] = nil then + Result := inherited DefaultVGridBandLineColor + else + Result := VGridLine[True].Color; + end; +end; + +class function TdxSkinLookAndFeelPainter.DefaultVGridCategoryColor: TColor; +begin + with CacheData do + if VGridCategory = nil then + Result := inherited DefaultVGridCategoryColor + else + Result := VGridCategory.Color; +end; + +class function TdxSkinLookAndFeelPainter.DefaultVGridCategoryTextColor: TColor; +begin + with CacheData do + if VGridCategory = nil then + Result := inherited DefaultVGridCategoryTextColor + else + Result := VGridCategory.TextColor; +end; + +class function TdxSkinLookAndFeelPainter.DefaultVGridLineColor: TColor; +begin + with CacheData do + begin + if VGridLine[False] = nil then + Result := inherited DefaultVGridLineColor + else + Result := VGridLine[False].Color; + end; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawBorder(ACanvas: TcxCanvas; R: TRect); +begin + if CacheData.ContainerBorderColor = nil then + inherited DrawBorder(ACanvas, R) + else + ACanvas.FrameRect(R, CacheData.ContainerBorderColor.Value); +end; + +class function TdxSkinLookAndFeelPainter.AdjustGroupButtonDisplayRect( + const R: TRect; AButtonCount, AButtonIndex: Integer): TRect; +begin + Result := inherited AdjustGroupButtonDisplayRect(R, AButtonCount, AButtonIndex); +end; + +class function TdxSkinLookAndFeelPainter.ButtonBorderSize( + AState: TcxButtonState = cxbsNormal): Integer; +begin + if CacheData.ButtonElements <> nil then + Result := 0 + else + Result := inherited ButtonBorderSize(AState); +end; + +class function TdxSkinLookAndFeelPainter.ButtonColor( + AState: TcxButtonState): TColor; +begin + Result := inherited ButtonColor(AState); +end; + +class function TdxSkinLookAndFeelPainter.ButtonFocusRect( + ACanvas: TcxCanvas; R: TRect): TRect; +begin + Result := inherited ButtonFocusRect(ACanvas, R); +end; + +class function TdxSkinLookAndFeelPainter.ButtonGroupBorderSizes( + AButtonCount, AButtonIndex: Integer): TRect; +var + AGlyphSize: TSize; + AXOffset: Integer; + AYOffset: Integer; +begin + with CacheData do + begin + if EditButtonElements[False] <> nil then + begin + AGlyphSize := NavigatorGlyphSize; + AXOffset := (EditButtonElements[False].Size.cx - AGlyphSize.cx) div 2; + AYOffset := (EditButtonElements[False].Size.cy - AGlyphSize.cy) div 2; + Result := Rect(AXOffset, AYOffset, AXOffset, AYOffset); + end + else + Result := inherited ButtonGroupBorderSizes(AButtonCount, AButtonIndex); + end; +end; + +class function TdxSkinLookAndFeelPainter.ButtonSymbolColor( + AState: TcxButtonState; ADefaultColor: TColor = clDefault): TColor; +begin + with CacheData do + if ButtonElements = nil then + Result := inherited ButtonSymbolColor(AState, ADefaultColor) + else + if (AState = cxbsDisabled) and (ButtonDisabled <> nil) then + Result := ButtonDisabled.Value + else + Result := ButtonElements.TextColor; +end; + +class function TdxSkinLookAndFeelPainter.ButtonTextOffset: Integer; +begin + Result := inherited ButtonTextOffset; +end; + +class function TdxSkinLookAndFeelPainter.ButtonTextShift: Integer; +begin + Result := inherited ButtonTextShift; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawButton(ACanvas: TcxCanvas; + R: TRect; const ACaption: string; AState: TcxButtonState; ADrawBorder: Boolean = True; + AColor: TColor = clDefault; ATextColor: TColor = clDefault; + AWordWrap: Boolean = False); +var + AFlags: Integer; +begin + with ACanvas, CacheData do + if ButtonElements <> nil then + begin + ButtonElements.Draw(ACanvas.Handle, R, 0, ButtonState2SkinState[AState]); + R := cxRectContent(R, ButtonElements.ContentOffset.Rect); + if ATextColor = clDefault then + Font.Color := ButtonSymbolColor(AState) + else + Font.Color := ATextColor; + Brush.Style := bsClear; + with R do // for compatible with standard buttons + begin + Dec(Bottom, Ord(Odd(Bottom - Top))); + if (Bottom - Top) < 18 then Dec(Top); + end; + if AState = cxbsPressed then + OffsetRect(R, ButtonTextShift, ButtonTextShift); + if Length(ACaption) > 0 then + begin + AFlags := cxAlignVCenter or cxShowPrefix or cxAlignHCenter; + if AWordWrap then + AFlags := AFlags or cxWordBreak + else + AFlags := AFlags or cxSingleLine; + DrawText(ACaption, R, AFlags, AState <> cxbsDisabled); + end; + Brush.Style := bsSolid; + end + else + inherited DrawButton(ACanvas, R, ACaption, AState, ADrawBorder, AColor, + ATextColor, AWordWrap); +end; + +class procedure TdxSkinLookAndFeelPainter.DrawButtonGroupBorder(ACanvas: TcxCanvas; + R: TRect; AInplace, ASelected: Boolean); +begin +end; + +class procedure TdxSkinLookAndFeelPainter.DrawButtonInGroup(ACanvas: TcxCanvas; R: TRect; + AState: TcxButtonState; AButtonCount, AButtonIndex: Integer; + ABackgroundColor: TColor); +begin + DrawEditorButton(ACanvas, R, cxbkEditorBtn, AState); +end; + +class procedure TdxSkinLookAndFeelPainter.DrawExpandButton(ACanvas: TcxCanvas; + const R: TRect; AExpanded: Boolean; AColor: TColor = clDefault); +begin + with CacheData do + begin + if ExpandButton = nil then + inherited DrawExpandButton(ACanvas, R, AExpanded, AColor) + else + ExpandButton.Draw(ACanvas.Handle, R, Byte(AExpanded)); + end; +end; + +class function TdxSkinLookAndFeelPainter.DrawExpandButtonFirst: Boolean; +begin + Result := inherited DrawExpandButtonFirst; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawGroupExpandButton( + ACanvas: TcxCanvas; const R: TRect; AExpanded: Boolean; AState: TcxButtonState); +begin + inherited DrawGroupExpandButton(ACanvas,R, AExpanded, AState); +end; + +class procedure TdxSkinLookAndFeelPainter.DrawSmallExpandButton( + ACanvas: TcxCanvas; R: TRect; AExpanded: Boolean; + ABorderColor: TColor; AColor: TColor = clDefault); +begin + with CacheData do + begin + if ExpandButton = nil then + inherited DrawSmallExpandButton(ACanvas, R, AExpanded, ABorderColor, AColor) + else + ExpandButton.Draw(ACanvas.Handle, R, Byte(AExpanded)); + end; +end; + +class function TdxSkinLookAndFeelPainter.ExpandButtonSize: Integer; +begin + with CacheData do + begin + if ExpandButton = nil then + Result := inherited ExpandButtonSize + else + Result := ExpandButton.Size.cy; + end; +end; + +class function TdxSkinLookAndFeelPainter.GroupExpandButtonSize: Integer; +begin + Result := inherited GroupExpandButtonSize; +end; + +class function TdxSkinLookAndFeelPainter.SmallExpandButtonSize: Integer; +begin + Result := inherited SmallExpandButtonSize; +end; + +class function TdxSkinLookAndFeelPainter.IsButtonHotTrack: Boolean; +begin + Result := inherited IsButtonHotTrack; +end; + +class function TdxSkinLookAndFeelPainter.IsPointOverGroupExpandButton( + const R: TRect; const P: TPoint): Boolean; +begin + Result := inherited IsPointOverGroupExpandButton(R, P); +end; + +class function TdxSkinLookAndFeelPainter.ScrollBarMinimalThumbSize(AVertical: Boolean): Integer; +var + AInfo: TdxSkinScrollInfo; +begin + AInfo := CacheData.ScrollBar_Elements[not AVertical, sbpThumbnail]; + if (AInfo <> nil) and (AInfo.Element <> nil) then + begin + if AVertical then + Result := AInfo.Element.Size.cy + else + Result := AInfo.Element.Size.cx; + end else + Result := inherited ScrollBarMinimalThumbSize(AVertical); +end; + +class procedure TdxSkinLookAndFeelPainter.DrawScrollBarPart(ACanvas: TcxCanvas; + AHorizontal: Boolean; R: TRect; APart: TcxScrollBarPart; AState: TcxButtonState); +var + AInfo: TdxSkinScrollInfo; +begin + AInfo := CacheData.ScrollBar_Elements[AHorizontal, APart]; + if (AInfo <> nil) and (AInfo.Element <> nil) then + AInfo.Element.Draw(ACanvas.Handle, R, AInfo.ImageIndex, ButtonState2SkinState[AState]) + else + inherited DrawScrollBarPart(ACanvas, AHorizontal, R, APart, AState) +end; + +class function TdxSkinLookAndFeelPainter.SizeGripSize: TSize; +begin + with CacheData do + if SizeGrip = nil then + Result := inherited SizeGripSize + else + Result := SizeGrip.Size +end; + +class procedure TdxSkinLookAndFeelPainter.DrawSizeGrip(ACanvas: TcxCanvas; + const ARect: TRect; ABackgroundColor: TColor); +begin + with CacheData do + if SizeGrip = nil then + inherited DrawSizeGrip(ACanvas, ARect, ABackgroundColor) + else + begin + ACanvas.FillRect(ARect, ABackgroundColor); + SizeGrip.Draw(ACanvas.Handle, ARect); + end; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawRadioButton(ACanvas: TcxCanvas; + X, Y: Integer; AButtonState: TcxButtonState; AChecked, AFocused: Boolean; + ABrushColor: TColor; AIsDesigning: Boolean = False); +var + ADestRect: TRect; +begin + with CacheData do + begin + if RadioGroupButton <> nil then + begin + ADestRect := Rect(X, Y, X + RadioGroupButton.Size.cX, Y + RadioGroupButton.Size.cy); + if ABrushColor <> clDefault then + ACanvas.FillRect(ADestRect, ABrushColor); + RadioGroupButton.Draw(ACanvas.Handle, ADestRect, Byte(AChecked), + ButtonState2SkinState[AButtonState]); + end + else + inherited DrawRadioButton(ACanvas, X, Y, AButtonState, AChecked, AFocused, + ABrushColor, AIsDesigning); + end; +end; + +class function TdxSkinLookAndFeelPainter.RadioButtonSize: TSize; +begin + with CacheData do + if RadioGroupButton <> nil then + Result := RadioGroupButton.Size + else + Result := inherited RadioButtonSize; +end; + +class function TdxSkinLookAndFeelPainter.CheckButtonSize: TSize; +begin + with CacheData do + if CheckboxElement <> nil then + Result := CheckboxElement.Size + else + Result := inherited CheckButtonSize; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawCheckButton(ACanvas: TcxCanvas; + R: TRect; AState: TcxButtonState; ACheckState: TcxCheckBoxState); +const + ImageIndexMap: array[TcxCheckBoxState] of Integer = (0, 1, 2); +begin + with CacheData do + if CheckboxElement = nil then + inherited DrawCheckButton(ACanvas, R, AState, ACheckState) + else + CheckboxElement.Draw(ACanvas.Handle, R, ImageIndexMap[ACheckState], + ButtonState2SkinState[AState]); +end; + +class function TdxSkinLookAndFeelPainter.DrawEditorButtonBackground(ACanvas: TcxCanvas; + const ARect: TRect; ACloseButton: Boolean; AState: TdxSkinElementState): Boolean; +begin + with CacheData do + begin + Result := EditButtonElements[ACloseButton] <> nil; + if Result then + EditButtonElements[ACloseButton].Draw(ACanvas.Handle, ARect, 0, AState); + end; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawClock(ACanvas: TcxCanvas; + const ARect: TRect; ADateTime: TDateTime; ABackgroundColor: TColor); + + procedure DrawHand(ACanvas: TCanvas; ACenter: TPoint; + AAngle, L1X, L1Y, L2X, L2Y, L3: Extended; AHandColor: TColor); + begin + with ACanvas do + begin + Brush.Color := AHandColor; + BeginPath(Handle); + Pixels[Round(ACenter.X + L1X * cos(AAngle)), + Round(ACenter.Y + L1Y * sin(AAngle))] := clTeal; + Pen.Color := clTeal; + MoveTo(Round(ACenter.X + L1X * cos(AAngle)), + Round(ACenter.Y + L1Y * sin(AAngle))); + LineTo(Round(ACenter.X + L3 / 2 * cos(AAngle + Pi / 2)), + Round(ACenter.Y + L3 / 2 * sin(AAngle + Pi / 2))); + LineTo(Round(ACenter.X + L2X * cos(AAngle + Pi)), + Round(ACenter.Y + L2Y * sin(AAngle + Pi))); + LineTo(Round(ACenter.X + L3 / 2 * cos(AAngle + Pi * 3 / 2)), + Round(ACenter.Y + L3 / 2 * sin(AAngle + Pi * 3 / 2))); + LineTo(Round(ACenter.X + L1X * cos(AAngle)), + Round(ACenter.Y + L1Y * sin(AAngle))); + EndPath(Handle); + FillPath(Handle); + end; + end; + + procedure DrawHands(ACanvas: TCanvas; AHandColor: TColor); + var + AAngle: Extended; + ACenter: TPoint; + AHandRadiusX, AHandRadiusY: Extended; + AHour, AMin, AMSec, ASec: Word; + begin + DecodeTime(ADateTime, AHour, AMin, ASec, AMSec); + ACenter.X := (ARect.Right + ARect.Left) div 2; + ACenter.Y := (ARect.Bottom + ARect.Top) div 2; + AHandRadiusX := (ARect.Right - ARect.Left) / 2 - 2; + AHandRadiusY := (ARect.Bottom - ARect.Top) / 2 - 2; + with ACanvas do + begin + AAngle := Pi * 2 * ((AHour mod 12) * 60 * 60 + AMin * 60 + ASec - 3 * 60 * 60) / 12 / 60 / 60; + DrawHand(ACanvas, ACenter, AAngle, AHandRadiusX * 0.75, AHandRadiusY * 0.75, + AHandRadiusX * 0.15, AHandRadiusY * 0.15, 9, AHandColor); + + AAngle := Pi * 2 * (AMin * 60 + ASec - 15 * 60) / 60 / 60; + DrawHand(ACanvas, ACenter, AAngle, AHandRadiusX * 0.85, AHandRadiusY * 0.85, + AHandRadiusX * 0.2, AHandRadiusY * 0.2, 7, AHandColor); + + Pen.Color := AHandColor; + MoveTo(ACenter.X, ACenter.Y); + AAngle := Pi * 2 * (ASec - 15) / 60; + LineTo(Round(ACenter.X + AHandRadiusX * 0.9 * cos(AAngle)), + Round(ACenter.Y + AHandRadiusY * 0.9 * sin(AAngle))); + end; + end; + +var + ABitmap: TBitmap; +begin + with CacheData do + if (ClockElements[False] = nil) or (ClockElements[True] = nil) then + inherited DrawClock(ACanvas, ARect, ADateTime, ABackgroundColor) + else + begin + ABitmap := TBitmap.Create; + try + ABitmap.Width := ARect.Right - ARect.Left; + ABitmap.Height := ARect.Bottom - ARect.Top; + ABitmap.Canvas.Brush.Color := ABackgroundColor; + ABitmap.Canvas.FillRect(ARect); + ClockElements[False].Draw(ABitmap.Canvas.Handle, ARect); + DrawHands(ABitmap.Canvas, ClockElements[False].TextColor); + ClockElements[True].Draw(ABitmap.Canvas.Handle, ARect); + with ARect do + BitBlt(ACanvas.Handle, Left, Top, Right - Left, Bottom - Top, + ABitmap.Canvas.Handle, 0, 0, SRCCOPY); + finally + ABitmap.Free; + end; + end; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawEditorButton(ACanvas: TcxCanvas; + const ARect: TRect; AButtonKind: TcxEditBtnKind; AState: TcxButtonState); +var + AEllipseSize: Integer; + AGlyph: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + R: TRect; + + procedure DrawEllipsis(const ARect: TRect; ASize: Integer); + var + AColor: TColor; + begin + if ASkinInfo.EditButtonElements[False] <> nil then + AColor := ASkinInfo.EditButtonElements[False].TextColor + else + AColor := clDefault; + + ACanvas.FillRect(Rect(ARect.Left, ARect.Top, ARect.Left + ASize, + ARect.Top + ASize), AColor); + ACanvas.FillRect(Rect(ARect.Left + ASize + 2, ARect.Top, + ARect.Left + ASize * 2 + 2, ARect.Top + ASize), AColor); + ACanvas.FillRect(Rect(ARect.Left + ASize * 2 + 4, ARect.Top, + ARect.Left + ASize * 3 + 4, ARect.Top + ASize), AColor); + end; + +begin + if not DrawEditorButtonBackground(ACanvas, ARect, AButtonKind = cxbkCloseBtn, + ButtonState2SkinState[AState]) + then + inherited DrawEditorButton(ACanvas, ARect, AButtonKind, AState) + else + if PaintersManager.GetPainterData(Self, ASkinInfo) then + begin + if ASkinInfo.EditButtonElements[False] <> nil then + R := cxRectContent(ARect, ASkinInfo.EditButtonElements[False].ContentOffset.Rect); + + case AButtonKind of + cxbkComboBtn, cxbkEditorBtn, cxbkSpinUpBtn, cxbkSpinDownBtn, + cxbkSpinLeftBtn, cxbkSpinRightBtn: + begin + AGlyph := ASkinInfo.EditButtonGlyphs[AButtonKind]; + if AGlyph <> nil then + AGlyph.Glyph.Draw(ACanvas.Handle, R); + end; + cxbkEllipsisBtn: + begin + AEllipseSize := 1; + if R.Right - R.Left >= 12 then + Inc(AEllipseSize); + DrawEllipsis(cxRectCenter(R, 3 * AEllipseSize + 4, AEllipseSize), + AEllipseSize); + end; + end; + + end; +end; + +class function TdxSkinLookAndFeelPainter.EditButtonTextOffset: Integer; +begin + Result := 1; +end; + +class function TdxSkinLookAndFeelPainter.EditButtonSize: TSize; +begin + with CacheData do + if EditButtonElements[False] = nil then + Result := inherited EditButtonSize + else + Result := EditButtonElements[False].Size; +end; + +class function TdxSkinLookAndFeelPainter.EditButtonTextColor: TColor; +begin + with CacheData do + if EditButtonElements[False] = nil then + Result := inherited EditButtonTextColor + else + Result := EditButtonElements[False].TextColor; +end; + +class function TdxSkinLookAndFeelPainter.GetContainerBorderColor( + AIsHighlightBorder: Boolean): TColor; +var + ASkinColor: TdxSkinColor; +begin + with CacheData do + begin + if AIsHighlightBorder then + ASkinColor := ContainerHighlightBorderColor + else + ASkinColor := ContainerBorderColor; + if ASkinColor = nil then + Result := inherited GetContainerBorderColor(AIsHighlightBorder) + else + Result := ASkinColor.Value; + end; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawNavigatorGlyph(ACanvas: TcxCanvas; + AImageList: TCustomImageList; AImageIndex: {$IFDEF DELPHI5}TImageIndex{$ELSE}Integer{$ENDIF}; + AButtonIndex: Integer; const AGlyphRect: TRect; AEnabled: Boolean; + AUserGlyphs: Boolean); +begin + with CacheData do + if (NavigatorGlyphs = nil) or (NavigatorGlyphsVert = nil) or AUserGlyphs then + inherited DrawNavigatorGlyph(ACanvas, AImageList, AImageIndex, AButtonIndex, + AGlyphRect, AEnabled, AUserGlyphs) + else + if NavigatorGlyphs.ImageCount > AImageIndex then + NavigatorGlyphs.Draw(ACanvas.Handle, AGlyphRect, AImageIndex) + else + begin + Dec(AImageIndex, NavigatorGlyphs.ImageCount); + NavigatorGlyphsVert.Draw(ACanvas.Handle, AGlyphRect, AImageIndex); + end; +end; + +class function TdxSkinLookAndFeelPainter.NavigatorGlyphSize: TSize; +begin + with CacheData do + if NavigatorGlyphs <> nil then + Result := NavigatorGlyphs.Size + else + Result := inherited NavigatorGlyphSize; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawProgressBarBorder(ACanvas: TcxCanvas; + ARect: TRect; AVertical: Boolean); +begin + with CacheData do + if ProgressBarElements[False, AVertical] <> nil then + ProgressBarElements[False, AVertical].Draw(ACanvas.Handle, ARect) + else + inherited DrawProgressBarBorder(ACanvas, ARect, AVertical); +end; + +class procedure TdxSkinLookAndFeelPainter.DrawProgressBarChunk(ACanvas: TcxCanvas; + ARect: TRect; AVertical: Boolean); +begin + with CacheData do + if ProgressBarElements[True, AVertical] <> nil then + ProgressBarElements[True, AVertical].Draw(ACanvas.Handle, ARect) + else + inherited DrawProgressBarChunk(ACanvas, ARect, AVertical); +end; + +class function TdxSkinLookAndFeelPainter.ProgressBarBorderSize(AVertical: Boolean): TRect; +begin + with CacheData do + if ProgressBarElements[False, AVertical] <> nil then + Result := ProgressBarElements[False, AVertical].ContentOffset.Rect + else + Result := inherited ProgressBarBorderSize(AVertical); +end; + +class function TdxSkinLookAndFeelPainter.GroupBoxBorderSize(ACaption: Boolean; + ACaptionPosition: TcxGroupBoxCaptionPosition): TRect; +var + AGroupBoxInfo: TdxSkinElement; +begin + with CacheData do + if ACaption then + AGroupBoxInfo := GroupBoxCaptionElements[ACaptionPosition] + else + AGroupBoxInfo := GroupBoxElements[ACaptionPosition]; + + if AGroupBoxInfo = nil then + Result := inherited GroupBoxBorderSize(ACaption, ACaptionPosition) + else + Result := AGroupBoxInfo.ContentOffset.Rect; +end; + +class function TdxSkinLookAndFeelPainter.GroupBoxTextColor( + ACaptionPosition: TcxGroupBoxCaptionPosition): TColor; +var + AGroupBoxCaption: TdxSkinElement; +begin + with CacheData do + AGroupBoxCaption := GroupBoxCaptionElements[ACaptionPosition]; + if AGroupBoxCaption = nil then + Result := inherited GroupBoxTextColor(ACaptionPosition) + else + Result := AGroupBoxCaption.TextColor; +end; + +class function TdxSkinLookAndFeelPainter.IsGroupBoxTransparent( + AIsCaption: Boolean; ACaptionPosition: TcxGroupBoxCaptionPosition): Boolean; +var + AGroupBoxInfo: TdxSkinElement; +begin + with CacheData do + if AIsCaption then + AGroupBoxInfo := GroupBoxCaptionElements[ACaptionPosition] + else + AGroupBoxInfo := GroupBoxElements[ACaptionPosition]; + + if AGroupBoxInfo = nil then + Result := inherited IsGroupBoxTransparent(AIsCaption, ACaptionPosition) + else + Result := AGroupBoxInfo.IsAlphaUsed; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawGroupBoxCaption(ACanvas: TcxCanvas; + ACaptionRect: TRect; ACaptionPosition: TcxGroupBoxCaptionPosition); +begin + with CacheData do + if GroupBoxCaptionElements[ACaptionPosition] = nil then + inherited DrawGroupBoxCaption(ACanvas, ACaptionRect, ACaptionPosition) + else + GroupBoxCaptionElements[ACaptionPosition].Draw(ACanvas.Handle, ACaptionRect); +end; + +class procedure TdxSkinLookAndFeelPainter.DrawGroupBoxContent(ACanvas: TcxCanvas; + ABorderRect: TRect; ACaptionPosition: TcxGroupBoxCaptionPosition); +var + ARect: TRect; +begin + with CacheData do + if (GroupBoxElements[ACaptionPosition] = nil) or (GroupBoxClient = nil) then + inherited DrawGroupBoxContent(ACanvas, ABorderRect, ACaptionPosition) + else + begin + with GroupBoxElements[ACaptionPosition] do + ARect := Rect(ABorderRect.Left + ContentOffset.Left + Borders[bLeft].Thin, + ABorderRect.Top + ContentOffset.Top + Borders[bTop].Thin, + ABorderRect.Right - ContentOffset.Right - Borders[bRight].Thin, + ABorderRect.Bottom - ContentOffset.Bottom - Borders[bBottom].Thin); + GroupBoxClient.Draw(ACanvas.Handle, ARect); + ACanvas.ExcludeClipRect(ARect); + GroupBoxElements[ACaptionPosition].Draw(ACanvas.Handle, ABorderRect); + end; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawGroupBoxBackground(ACanvas: TcxCanvas; + ABounds: TRect; ARect: TRect); +begin + with CacheData do + if GroupBoxClient = nil then + inherited DrawGroupBoxBackground(ACanvas, ABounds, ARect) + else + GroupBoxClient.Draw(ACanvas.Handle, ARect); +end; + +class procedure TdxSkinLookAndFeelPainter.DrawHeader(ACanvas: TcxCanvas; + const ABounds, ATextAreaBounds: TRect; ANeighbors: TcxNeighbors; ABorders: TcxBorders; + AState: TcxButtonState; AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; + AMultiLine, AShowEndEllipsis: Boolean; const AText: string; AFont: TFont; ATextColor, + ABkColor: TColor; AOnDrawBackground: TcxDrawBackgroundEvent = nil; AIsLast: Boolean = False; + AIsGroup: Boolean = False); +var + AHeader: TdxSkinElement; + ARect: TRect; +begin + with CacheData do + if AIsGroup then + AHeader := HeaderSpecial + else + AHeader := Header; + + if AHeader = nil then + inherited DrawHeader(ACanvas, ABounds, ATextAreaBounds, ANeighbors, ABorders, + AState, AAlignmentHorz, AAlignmentVert, AMultiLine, AShowEndEllipsis, AText, + AFont, ATextColor, ABkColor, AOnDrawBackGround, AIsLast, AIsGroup) + else + begin + ARect := ABounds; + if not (bLeft in ABorders) then + Dec(ARect.Left); + if not (bTop in ABorders) then + Dec(ARect.Top); + if not (bRight in ABorders) then + Inc(ARect.Right); + if not (bBottom in ABorders) then + Inc(ARect.Bottom); + + ACanvas.SaveClipRegion; + ACanvas.SetClipRegion(TcxRegion.Create(ABounds), roIntersect); + try + AHeader.Draw(ACanvas.Handle, ARect, 0, ButtonState2SkinState[AState]); + DrawContent(ACanvas, HeaderContentBounds(ABounds, ABorders), ATextAreaBounds, + Integer(AState), AAlignmentHorz, AAlignmentVert, AMultiLine, AShowEndEllipsis, + AText, AFont, ATextColor, ABkColor, AOnDrawBackground); + finally + ACanvas.RestoreClipRegion; + end; + end; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawHeaderEx(ACanvas: TcxCanvas; + const ABounds, ATextAreaBounds: TRect; ANeighbors: TcxNeighbors; + ABorders: TcxBorders; AState: TcxButtonState; AAlignmentHorz: TAlignment; + AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil); +begin + DrawHeader(ACanvas, ABounds, ATextAreaBounds, ANeighbors, ABorders, AState, + AAlignmentHorz, AAlignmentVert, AMultiLine, AShowEndEllipsis, AText, AFont, + ATextColor, ABkColor, AOnDrawBackground); +end; + +class procedure TdxSkinLookAndFeelPainter.DrawHeaderSeparator(ACanvas: TcxCanvas; + const ABounds: TRect; AIndentSize: Integer; AColor: TColor; AViewParams: TcxViewParams); +begin + with CacheData do + if HeaderBackgroundColor = nil then + inherited DrawHeaderSeparator(ACanvas, ABounds, AIndentSize, AColor, AViewParams) + else + ACanvas.FillRect(cxRectInflate(ABounds, -AIndentSize, 0), HeaderBackgroundColor.Value); +end; + +class function TdxSkinLookAndFeelPainter.HeaderBorders( + ANeighbors: TcxNeighbors): TcxBorders; +begin + Result := inherited HeaderBorders(ANeighbors); + if nLeft in ANeighbors then Exclude(Result, bLeft); + if nTop in ANeighbors then Exclude(Result, bTop); +end; + +class function TdxSkinLookAndFeelPainter.HeaderDrawCellsFirst: Boolean; +begin + Result := False; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawGroupByBox(ACanvas: TcxCanvas; + const ARect: TRect; ATransparent: Boolean; ABackgroundColor: TColor; + const ABackgroundBitmap: TBitmap); +begin + with CacheData do + if GridGroupByBox = nil then + inherited DrawGroupByBox(ACanvas, ARect, ATransparent, ABackgroundColor, + ABackgroundBitmap) + else + GridGroupByBox.Draw(ACanvas.Handle, ARect); +end; + +class procedure TdxSkinLookAndFeelPainter.DrawFooterBorder(ACanvas: TcxCanvas; + const R: TRect); +var + ABounds: TRect; +begin + with CacheData do + if FooterPanel = nil then + inherited DrawFooterBorder(ACanvas, R) + else + begin + ACanvas.SaveClipRegion; + with FooterPanel.ContentOffset.Rect do + ACanvas.ExcludeClipRect(Rect(R.Left, R.Top, R.Right - Right, + R.Bottom - Bottom)); + ACanvas.ExcludeClipRect(Rect(R.Left, R.Top - 1, R.Right, R.Top)); + try + ABounds := R; + Dec(ABounds.Top); + Dec(ABounds.Left, FooterPanel.ContentOffset.Left); + FooterPanel.Draw(ACanvas.Handle, ABounds); + finally + ACanvas.RestoreClipRegion; + end; + end; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawFooterCell(ACanvas: TcxCanvas; + const ABounds: TRect; AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; + AMultiLine: Boolean; const AText: string; AFont: TFont; ATextColor, ABkColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil); +begin + with CacheData do + begin + if FooterCell = nil then + inherited DrawFooterCell(ACanvas, ABounds, AAlignmentHorz, AAlignmentVert, + AMultiLine, AText, AFont, ATextColor, ABkColor, AOnDrawBackground) + else + begin + FooterCell.Draw(ACanvas.Handle, ABounds); + DrawContent(ACanvas, FooterCellContentBounds(ABounds), FooterCellTextAreaBounds(ABounds), 0, + AAlignmentHorz, AAlignmentVert, AMultiLine, False, AText, AFont, ATextColor, ABkColor, + AOnDrawBackground, True); + ACanvas.ExcludeClipRect(ABounds); + end; + end; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawFooterContent(ACanvas: TcxCanvas; + const ARect: TRect; const AViewParams: TcxViewParams); +var + R: TRect; +begin + with CacheData do + begin + if (FooterPanel = nil) or (AViewParams.Bitmap <> nil) and + not AViewParams.Bitmap.Empty + then + inherited DrawFooterContent(ACanvas, ARect, AViewParams) + else + begin + with FooterPanel.ContentOffset do + R := Classes.Rect(ARect.Left - Left, ARect.Top, ARect.Right + Right, + ARect.Bottom + Bottom); + Dec(R.Top); + FooterPanel.Draw(ACanvas.Handle, R); + end; + end; +end; + +class function TdxSkinLookAndFeelPainter.FooterCellBorderSize: Integer; +begin + with CacheData do + if FooterCell = nil then + Result := inherited FooterCellBorderSize + else + with FooterCell.ContentOffset do + Result := Max(Max(Left, Top), Max(Right, Bottom)); +end; + +class function TdxSkinLookAndFeelPainter.FooterDrawCellsFirst: Boolean; +begin + Result := False; +end; + +class function TdxSkinLookAndFeelPainter.FooterSeparatorColor: TColor; +begin + Result := DefaultGridLineColor; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawFilterDropDownButton( + ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState; AIsFilterActive: Boolean); +begin + with CacheData do + if FilterButtons[AIsFilterActive] <> nil then + FilterButtons[AIsFilterActive].Draw(ACanvas.Handle, R, 0, + ButtonState2SkinState[AState]) + else + inherited DrawFilterDropDownButton(ACanvas, R, AState, AIsFilterActive); +end; + +class procedure TdxSkinLookAndFeelPainter.DrawFilterCloseButton(ACanvas: TcxCanvas; + R: TRect; AState: TcxButtonState); +begin + with CacheData do + begin + if EditButtonElements[True] = nil then + inherited DrawFilterCloseButton(ACanvas, R, AState) + else + EditButtonElements[True].Draw(ACanvas.Handle, R, 0, + ButtonState2SkinState[AState]); + end; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawFilterPanel(ACanvas: TcxCanvas; + const ARect: TRect; ATransparent: Boolean; ABackgroundColor: TColor; + const ABackgroundBitmap: TBitmap); +begin + with CacheData do + begin + if FilterPanel = nil then + inherited DrawFilterPanel(ACanvas, ARect, ATransparent, ABackgroundColor, + ABackgroundBitmap) + else + FilterPanel.Draw(ACanvas.Handle, ARect); + end; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawPanelBorders(ACanvas: TcxCanvas; + const ABorderRect: TRect); +var + AElement: TdxSkinElement; +begin + AElement := CacheData.GroupBoxElements[cxgpCenter]; + if AElement = nil then + DrawPanelBorders(ACanvas, ABorderRect) + else + begin + ACanvas.SaveClipRegion; + try + ACanvas.ExcludeClipRect(cxRectContent(ABorderRect, AElement.ContentOffset.Rect)); + AElement.Draw(ACanvas.Handle, ABorderRect); + finally + ACanvas.RestoreClipRegion; + end; + end; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawPanelContent(ACanvas: TcxCanvas; + const ABorderRect: TRect; ABorder: Boolean); +begin + with CacheData do + if (GroupBoxClient = nil) then + inherited DrawPanelContent(ACanvas, ABorderRect, ABorder) + else + begin + GroupBoxClient.Draw(ACanvas.Handle, ABorderRect); + if ABorder then + DrawPanelBorders(ACanvas, ABorderRect); + end; +end; + +class function TdxSkinLookAndFeelPainter.FilterCloseButtonSize: TPoint; +begin + with CacheData do + begin + if EditButtonElements[True] = nil then + Result := inherited FilterCloseButtonSize + else + with EditButtonElements[True].Size do + Result := Point(cx, cy); + end; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawTrackBar(ACanvas: TcxCanvas; + const ARect: TRect; const ASelection: TRect; AShowSelection: Boolean; + AEnabled: Boolean; AHorizontal: Boolean); +begin + with CacheData do + if TrackBarTrack[AHorizontal] = nil then + inherited DrawTrackBar(ACanvas, ARect, ASelection, AShowSelection, AEnabled, + AHorizontal) + else + begin + TrackBarTrack[AHorizontal].Draw(ACanvas.Handle, ARect, 2 * Byte(not AEnabled)); + if AShowSelection then + TrackBarTrack[AHorizontal].Draw(ACanvas.Handle, ASelection, 2 * Byte(not AEnabled) + 1); + end; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawTrackBarThumb(ACanvas: TcxCanvas; + ARect: TRect; AState: TcxButtonState; AHorizontal: Boolean; ATicks: TcxTrackBarTicksAlign); +begin + with CacheData do + begin + if TrackBarThumb[AHorizontal, ATicks] <> nil then + TrackBarThumb[AHorizontal, ATicks].Draw( + ACanvas.Handle, ARect, 0, ButtonState2SkinState[AState]) + else + inherited DrawTrackBarThumb(ACanvas, ARect, AState, AHorizontal, ATicks) + end; +end; + +class function TdxSkinLookAndFeelPainter.TrackBarThumbSize(AHorizontal: Boolean): TSize; +begin + with CacheData do + begin + if TrackBarThumb[AHorizontal, tbtaDown] <> nil then + Result := TrackBarThumb[AHorizontal, tbtaDown].Size + else + Result := inherited TrackBarThumbSize(AHorizontal); + end; +end; + +class function TdxSkinLookAndFeelPainter.TrackBarTrackSize: Integer; +begin + with CacheData do + begin + if TrackBarTrack[True] <> nil then + Result := TrackBarTrack[True].Size.cy + else + Result := inherited TrackBarTrackSize; + end; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawContent(ACanvas: TcxCanvas; + const ABounds, ATextAreaBounds: TRect; AState: Integer; AAlignmentHorz: TAlignment; + AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor, ABkColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil; AIsFooter: Boolean = False); +const + AlignmentsHorz: array[TAlignment] of Integer = + (cxAlignLeft, cxAlignRight, cxAlignHCenter); + AlignmentsVert: array[TcxAlignmentVert] of Integer = + (cxAlignTop, cxAlignBottom, cxAlignVCenter); + MultiLines: array[Boolean] of Integer = (cxSingleLine, cxWordBreak); + ShowEndEllipsises: array[Boolean] of Integer = (0, cxShowEndEllipsis); +begin + with ACanvas do + begin + if AText <> '' then + begin + Brush.Style := bsClear; + Font := AFont; + Font.Color := ATextColor; + DrawText(AText, ATextAreaBounds, AlignmentsHorz[AAlignmentHorz] or + AlignmentsVert[AAlignmentVert] or MultiLines[AMultiLine] or + ShowEndEllipsises[AShowEndEllipsis]); + Brush.Style := bsSolid; + end; + end; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawSplitter(ACanvas: TcxCanvas; + const ARect: TRect; AHighlighted: Boolean; AClicked: Boolean; AHorizontal: Boolean); +begin + with CacheData do + begin + if Splitter[AHorizontal] <> nil then + Splitter[AHorizontal].Draw(ACanvas.Handle , ARect, Byte(AHighlighted)) + else + inherited DrawSplitter(ACanvas, ARect, AHighlighted, AClicked, AHorizontal); + end; +end; + +class function TdxSkinLookAndFeelPainter.GetSplitterSize(AHorizontal: Boolean): TSize; +begin + with CacheData do + begin + if Splitter[AHorizontal] <> nil then + Result := Splitter[Ahorizontal].Size + else + Result := inherited GetSplitterSize(AHorizontal); + end; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawIndicatorCustomizationMark( + ACanvas: TcxCanvas; const R: TRect; AColor: TColor); +const + AIndicatorCustomizationMarkID = 2; +var + ARect: TRect; +begin + with CacheData do + if IndicatorImages = nil then + inherited DrawIndicatorCustomizationMark(ACanvas, R, AColor) + else + begin + with IndicatorImages.Image.Size, R do + begin + ARect := Rect(0, 0, cx, cy); + OffsetRect(ARect, (Left + Right - cx) div 2, (Top + Bottom - cy) div 2); + end; + IndicatorImages.Draw(ACanvas.Handle, ARect, AIndicatorCustomizationMarkID); + end; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawIndicatorImage(ACanvas: TcxCanvas; + const R: TRect; AKind: TcxIndicatorKind); +const + AIndicatorImagesMap: array[TcxIndicatorKind] of integer = (0, 0, 1, 2, 0, 0, 8); +var + ARect: TRect; +begin + with CacheData do + if IndicatorImages = nil then + inherited DrawIndicatorImage(ACanvas, R, AKind) + else + if AKind <> ikNone then + begin + with IndicatorImages.Image.Size, R do + begin + ARect := Rect(0, 0, cx, cy); + OffsetRect(ARect, (Left + Right - cx) div 2, (Top + Bottom - cy) div 2); + end; + IndicatorImages.Draw(ACanvas.Handle, ARect, AIndicatorImagesMap[AKind]); + end; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawIndicatorItem(ACanvas: TcxCanvas; + const R: TRect; AKind: TcxIndicatorKind; AColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil); +var + ARect: TRect; +begin + with R do + ARect := Rect(Left, Top - HeaderBorderSize, Right, Bottom); + DrawHeader(ACanvas, ARect, ARect, [], HeaderBorders([nTop, nBottom]), cxbsNormal, + taLeftJustify, vaTop, False, False, '', nil, clNone, AColor, AOnDrawBackground); + DrawIndicatorImage(ACanvas, R, AKind); +end; + +class procedure TdxSkinLookAndFeelPainter.DrawIndicatorItemEx(ACanvas: TcxCanvas; + const R: TRect; AKind: TcxIndicatorKind; AColor: TColor; + AOnDrawBackground: TcxDrawBackgroundEvent = nil); +begin + DrawIndicatorItem(ACanvas, R, AKind, AColor, AOnDrawBackground); +end; + +class procedure TdxSkinLookAndFeelPainter.DrawMonthHeader(ACanvas: TcxCanvas; + const ABounds: TRect; const AText: string; ANeighbors: TcxNeighbors; + const AViewParams: TcxViewParams; AArrows: TcxHeaderArrows; ASideWidth: Integer; + AOnDrawBackground: TcxDrawBackgroundEvent = nil); +begin + DrawHeader(ACanvas, ABounds, ABounds, ANeighbors, HeaderBorders(ANeighbors), + cxbsNormal, taCenter, vaCenter, False, False, AText, AViewParams.Font, + AViewParams.TextColor, AViewParams.Color, AOnDrawBackground); + DrawMonthHeaderArrows(ACanvas, ABounds, AArrows, ASideWidth, clWindowText); +end; + +class procedure TdxSkinLookAndFeelPainter.DrawSchedulerEventProgress( + ACanvas: TcxCanvas; const ABounds, AProgress: TRect; + AViewParams: TcxViewParams; ATransparent: Boolean); +var + AProgressBar: TdxSkinElement; + AProgressChunk: TdxSkinElement; +begin + with CacheData do + begin + AProgressBar := ProgressBarElements[False, False]; + AProgressChunk := ProgressBarElements[True, False]; + end; + if (AProgressBar = nil) or (AProgressChunk = nil) then + inherited DrawSchedulerEventProgress(ACanvas, ABounds, AProgress, AViewParams, + ATransparent) + else + begin + AProgressBar.Draw(ACanvas.Handle, ABounds); + AProgressChunk.Draw(ACanvas.Handle, AProgress); + end; +end; + +class function TdxSkinLookAndFeelPainter.SchedulerEventProgressOffsets: TRect; +var + AProgressBar: TdxSkinElement; +begin + with CacheData do + AProgressBar := ProgressBarElements[False, False]; + if AProgressBar = nil then + Result := SchedulerEventProgressOffsets + else + Result := AProgressBar.ContentOffset.Rect +end; + +class procedure TdxSkinLookAndFeelPainter.CalculateSchedulerNavigationButtonRects( + AIsNextButton: Boolean; ACollapsed: Boolean; APrevButtonTextSize: TSize; + ANextButtonTextSize: TSize; var ABounds: TRect; out ATextRect: TRect; + out AArrowRect: TRect); +var + AMinSize: TSize; +begin + with CacheData do + if SchedulerNavigationButtons[AIsNextButton] = nil then + AMinSize := cxNullSize + else + AMinSize := SchedulerNavigationButtons[AIsNextButton].MinSize.Size; + + if (AMinSize.cx > 0) and (ABounds.Right - ABounds.Left < AMinSize.cx) then + if AIsNextButton then + ABounds.Left := ABounds.Right - AMinSize.cx + else + ABounds.Right := ABounds.Left + AMinSize.cx; + + inherited CalculateSchedulerNavigationButtonRects(AIsNextButton, ACollapsed, + APrevButtonTextSize, ANextButtonTextSize, ABounds, ATextRect, AArrowRect); +end; + +class procedure TdxSkinLookAndFeelPainter.DrawSchedulerNavigationButtonContent( + ACanvas: TcxCanvas; const ARect: TRect; const AArrowRect: TRect; + AIsNextButton: Boolean; AState: TcxButtonState); +var + R: TRect; +begin + with CacheData do + if SchedulerNavigationButtons[AIsNextButton] = nil then + inherited DrawSchedulerNavigationButtonContent(ACanvas, ARect, AArrowRect, + AIsNextButton, AState) + else + begin + R := ARect; + if AIsNextButton then + Inc(R.Right) + else + Dec(R.Left); + + ACanvas.SaveClipRegion; + try + ACanvas.SetClipRegion(TcxRegion.Create(ARect), roIntersect); + SchedulerNavigationButtons[AIsNextButton].Draw(ACanvas.Handle, R, 0, + ButtonState2SkinState[AState]); + if SchedulerNavigationButtonsArrow[AIsNextButton] <> nil then + SchedulerNavigationButtonsArrow[AIsNextButton].Draw(ACanvas.Handle, + AArrowRect, 0, ButtonState2SkinState[AState]); + finally + ACanvas.RestoreClipRegion; + end; + end; +end; + +class procedure TdxSkinLookAndFeelPainter.SchedulerNavigationButtonSizes( + AIsNextButton: Boolean; var ABorders: TRect; var AArrowSize: TSize); +begin + with CacheData do + if (SchedulerNavigationButtons[AIsNextButton] = nil) or + (SchedulerNavigationButtonsArrow[AIsNextButton] = nil) + then + inherited SchedulerNavigationButtonSizes(AIsNextButton, ABorders, AArrowSize) + else + begin + ABorders := SchedulerNavigationButtons[AIsNextButton].ContentOffset.Rect; + AArrowSize := SchedulerNavigationButtonsArrow[AIsNextButton].Size; + end; +end; + +class procedure TdxSkinLookAndFeelPainter.DrawSchedulerNavigatorButton( + ACanvas: TcxCanvas; R: TRect; AState: TcxButtonState); +begin + DrawEditorButtonBackground(ACanvas, R, False, ButtonState2SkinState[AState]); +end; + +class procedure TdxSkinLookAndFeelPainter.DrawWindowContent(ACanvas: TcxCanvas; + const ARect: TRect); +begin + with CacheData do + if FormContent = nil then + inherited DrawWindowContent(ACanvas, ARect) + else + ACanvas.FillRect(ARect, FormContent.Color); +end; + +class function TdxSkinLookAndFeelPainter.IndicatorDrawItemsFirst: Boolean; +begin + Result := True; +end; + +class function TdxSkinLookAndFeelPainter.CacheData: TdxSkinLookAndFeelPainterInfo; +begin + PaintersManager.GetPainterData(Self, Result); +end; + +// +procedure RegisterSkin(ASkin: TdxSkin; APainter: TdxSkinLookAndFeelPainterClass); +begin + if not CheckGdiPlus then Exit; + PaintersManager.Register(ASkin.Name, TdxSkinLookAndFeelPainter, + TdxSkinLookAndFeelPainterInfo.Create(ASkin)); +end; + +procedure RegisterSkin(const ASkinName: string; + APainter: TdxSkinLookAndFeelPainterClass; ALoadFromResource: Boolean; AInstance: THandle); +var + ASkin: TdxSkin; + AData: TdxSkinLookAndFeelPainterInfo; +begin + if not CheckGdiPlus then Exit; + if ALoadFromResource then + ASkin := TdxSkin.Create(ASkinName, ALoadFromResource, AInstance) + else + ASkin := nil; + AData := APainter.CacheData; + if AData = nil then + AData := TdxSkinLookAndFeelPainterInfo.Create(ASkin); + PaintersManager.Register(ASkinName, APainter, AData); +end; + +procedure UnregisterSkin(const ASkinName: string); +begin + PaintersManager.Unregister(ASkinName); +end; + +initialization + PaintersManager := GetExtendedStylePainters; + +finalization + PaintersManager := nil; + +end. + diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinsReg.dcr b/official/x.35/ExpressSkins Library/Sources/dxSkinsReg.dcr new file mode 100644 index 00000000..9ef2ce5a Binary files /dev/null and b/official/x.35/ExpressSkins Library/Sources/dxSkinsReg.dcr differ diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinsReg.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinsReg.pas new file mode 100644 index 00000000..8321a5b6 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinsReg.pas @@ -0,0 +1,159 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinsReg; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, cxClasses, Forms, +{$IFDEF DELPHI6} + Types, DesignIntf, DesignEditors, VCLEditors, +{$ELSE} + DsgnWnds, DsgnIntf, +{$ENDIF} + SysUtils, TypInfo, cxLibraryReg, cxLookAndFeels, cxLookAndFeelPainters, + dxSkinsCore, dxSkinsLookAndFeelPainter, dxSkinsDefaultPainters, dxSkinsForm; + +type + { TdxSkinNameProperty } + + TdxSkinNameProperty = class(TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + end; + +const + dxSkinsMajorVersion = '1'; + dxSkinsProductName = 'ExpressSkins'; + +procedure Register; + +implementation + +uses + cxControls; + +{ TdxSkinNameProperty } + +function TdxSkinNameProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes - [paReadOnly] + [paValueList]; +end; + +procedure TdxSkinNameProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to GetExtendedStylePainters.Count - 1 do + Proc(GetExtendedStylePainters.Names[I]); +end; + +type + { TdxSkinControllerEditor } + + TdxSkinControllerEditor = class(TcxComponentEditor) + protected + function GetProductMajorVersion: string; override; + function GetProductName: string; override; + public + procedure Edit; override; + procedure ExecuteVerb(Index: Integer); override; + function GetVerb(Index: Integer): string; override; + function GetVerbCount: Integer; override; + end; + +procedure TdxSkinControllerEditor.Edit; +begin +end; + +procedure TdxSkinControllerEditor.ExecuteVerb(Index: Integer); +begin + case Index of + 0: + begin + with TdxSkinController(Component) do + begin + Kind := cxDefaultLookAndFeelKind; + NativeStyle := cxDefaultLookAndFeelNativeStyle; + SkinName := ''; + UseSkins := True; + end; + Designer.Modified; + end; + end; +end; + +function TdxSkinControllerEditor.GetVerb(Index: Integer): string; +begin + case Index of + 0: Result := 'Reset'; + 1: Result := '-'; + else + Result := inherited GetVerb(Index); + end; +end; + +function TdxSkinControllerEditor.GetVerbCount: Integer; +begin + Result := 1 + inherited GetVerbCount; +end; + +function TdxSkinControllerEditor.GetProductMajorVersion: string; +begin + Result := dxSkinsMajorVersion; +end; + +function TdxSkinControllerEditor.GetProductName: string; +begin + Result := dxSkinsProductName; +end; + +procedure Register; +begin + IsDesigning := True; +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterComponents('Dev Express', [TdxSkinController]); + RegisterClasses([TdxSkinController]); + RegisterPropertyEditor(TypeInfo(TdxSkinName), + nil, 'SkinName', TdxSkinNameProperty); + RegisterComponentEditor(TdxSkinController, TdxSkinControllerEditor); +end; + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinscxPCPainter.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinscxPCPainter.pas new file mode 100644 index 00000000..3ad4b57e --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinscxPCPainter.pas @@ -0,0 +1,692 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinscxPCPainter; + +{$I cxVer.inc} + +interface + +uses + Windows, SysUtils, Classes, Controls, Graphics, cxLookAndFeels, + cxLookAndFeelPainters, cxPCPainters, cxPC, dxSkinsLookAndFeelPainter, + dxSkinsCore, cxPCPaintersFactory, cxGraphics, Math, cxGeometry; + +const + cxNullPCDistance: TcxPCDistance = (dw: 0; dh: 0); + +type + { TcxPCSkinPainter } + + TcxPCSkinIndents = (siFar, siNear, siSelectedDownGrow, siHorzGrow, siVertGrow, + siDownGrow); + + TcxPCSkinPainter = class(TcxPCTabsPainter) + private + FFrameContentCache: TdxSkinElementCache; + FWasDoubleBuffered: Boolean; + function GetButtonHorz: TdxSkinElement; + function GetButtonVert: TdxSkinElement; + function GetFrameContent: TdxSkinElement; + function GetHeader: TdxSkinElement; + function GetIndentByIndex(AType: TcxPCSkinIndents): Integer; + function GetNeedDrawTabBitmapBackground: Boolean; + function GetSkinPainterData(var AData: TdxSkinLookAndFeelPainterInfo): Boolean; + function GetTabState(ATab: TcxTab): TdxSkinElementState; + procedure InternalCorrectCustomTabRect(APosition: TcxTabPosition; var ARect: TRect); + procedure InternalCorrectMainTabRect(APosition: TcxTabPosition; var ARect: TRect); + protected + function CalculateTabNormalWidth(Tab: TcxTab): Integer; override; + procedure CorrectTabRect(TabVisibleIndex: Integer; + var TabRectCorrection: TcxPCRectCorrection); override; + procedure DrawNativeTabBackground(DC: HDC; ATab: TcxTabSheet); override; + function GetClientRectOffset: TRect; override; + function GetButtonWidth(Button: TcxPCNavigatorButton): Integer; override; + function GetFreeSpaceColor: TColor; override; + function GetNativeContentOffset: TRect; override; + function GetTabClipRgn(ATabVisibleIndex: Integer): TcxRegion; override; + function GetTabsNormalDistance: TcxPCDistance; override; + function GetTabsPosition(NavigatorButtons: TcxPCNavigatorButtons): TcxPCTabsPosition; override; + function GetTextColor(ATabVisibleIndex: Integer): TColor; override; + procedure InternalDrawFocusRect(TabVisibleIndex: Integer; R: TRect); override; + procedure InternalDrawText(ACanvas: TCanvas; const ACaption: string; + ARect: TRect; ATabVisibleIndex: Integer); override; + procedure InternalPaintFrame(ACanvas: TCanvas); override; + function IsEnableHotTrack: Boolean; override; + function IsNativePainting: Boolean; override; + function IsSkinAvailable: Boolean; + function NeedDisabledTextShadow: Boolean; override; + + procedure PaintButton(Button: TcxPCNavigatorButton; const ButtonRect: TRect); override; + procedure PaintNativeTabBackground(DC: HDC; ATabVisibleIndex: Integer; const ABounds: TRect); override; + procedure PaintTabsRegion; override; + procedure PrepareTabBitmapBackground(ABitmap: TBitmap; const ARect: TRect; ATab: TcxTab); override; + + property ButtonHorz: TdxSkinElement read GetButtonHorz; + property ButtonVert: TdxSkinElement read GetButtonVert; + property FrameContent: TdxSkinElement read GetFrameContent; + property FrameContentCache: TdxSkinElementCache read FFrameContentCache; + property Header: TdxSkinElement read GetHeader; + property Indents[AType: TcxPCSkinIndents]: Integer read GetIndentByIndex; + property NeedDrawTabBitmapBackground: Boolean read GetNeedDrawTabBitmapBackground; + public + constructor Create(AParent: TcxCustomTabControl); override; + destructor Destroy; override; + function CalculateTabNormalHeight: Integer; override; + class function GetStyleID: TcxPCStyleID; override; + class function GetStyleName: TCaption; override; + class function HasLookAndFeel(ALookAndFeel: TcxLookAndFeel): Boolean; override; + end; + +implementation + +{$IFDEF DELPHI6} + +uses + Types, dxSkinInfo; + +{$ENDIF} + +const + TabPosition2cxBorder: array[TcxTabPosition] of TcxBorder = ( + bTop, bBottom, bLeft, bRight); + +{ TcxPCSkinPainter } + +constructor TcxPCSkinPainter.Create(AParent: TcxCustomTabControl); +begin + inherited Create(AParent); + FFrameContentCache := TdxSkinElementCache.Create; + FWasDoubleBuffered := AParent.DoubleBuffered; + AParent.DoubleBuffered := True; +end; + +destructor TcxPCSkinPainter.Destroy; +begin + ParentControl.DoubleBuffered := FWasDoubleBuffered; + FFrameContentCache.Free; + inherited Destroy; +end; + +function TcxPCSkinPainter.CalculateTabNormalHeight: Integer; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; + APageControlHeader: TdxSkinElement; +begin + APageControlHeader := nil; + if GetSkinPainterData(ASkinPainterInfo) then + APageControlHeader := ASkinPainterInfo.PageControlHeader; + if APageControlHeader = nil then + Result := inherited CalculateTabNormalHeight + else + with APageControlHeader.ContentOffset do + Result := Top + Bottom + inherited CalculateTabNormalHeight - 2; +end; + +class function TcxPCSkinPainter.GetStyleID: TcxPCStyleID; +begin + Result := cxPCSkinStyle; +end; + +class function TcxPCSkinPainter.GetStyleName: TCaption; +begin + Result := 'Skin'; +end; + +class function TcxPCSkinPainter.HasLookAndFeel(ALookAndFeel: TcxLookAndFeel): Boolean; +begin + Result := ALookAndFeel.SkinPainter <> nil; +end; + +function TcxPCSkinPainter.CalculateTabNormalWidth(Tab: TcxTab): Integer; +var + AIndex: Integer; +begin + if Header = nil then + Result := inherited CalculateTabNormalWidth(Tab) + else + with Header do + begin + Result := ContentOffset.Left + ContentOffset.Right; + with ParentInfo do + if TabWidth > 0 then + Inc(Result, TabWidth) + else + begin + AIndex := Tab.VisibleIndex; + if IsAssignedImages and ((AIndex = -1) or IsTabHasImage(AIndex) or ParentInfo.Rotate) then + Inc(Result, GetTabBaseImageSize.cx + 2 * ParentInfo.ImageBorder + + GetImageTextDistance(AIndex)); + Inc(Result, TextSize(Tab, Tab.Caption).cx + 2); + end; + end; +end; + +procedure TcxPCSkinPainter.InternalCorrectCustomTabRect(APosition: TcxTabPosition; + var ARect: TRect); +begin + case APosition of + tpTop: + ARect.Bottom := Indents[siDownGrow] + 1; + tpBottom: + ARect.Top := -Indents[siDownGrow] + 1; + tpLeft: + ARect.Right := Indents[siDownGrow] + 1; + tpRight: + ARect.Left := -Indents[siDownGrow] + 1; + end; +end; + +procedure TcxPCSkinPainter.InternalCorrectMainTabRect(APosition: TcxTabPosition; + var ARect: TRect); +begin + case APosition of + tpTop: + ARect := Rect(-Indents[siHorzGrow], -Indents[siVertGrow], Indents[siHorzGrow], + Indents[siSelectedDownGrow]); + tpBottom: + ARect := Rect(-Indents[siHorzGrow], -Indents[siSelectedDownGrow], + Indents[siHorzGrow], Indents[siVertGrow]); + tpLeft: + ARect := Rect(-Indents[siVertGrow], -Indents[siHorzGrow], Indents[siSelectedDownGrow], + Indents[siHorzGrow]); + tpRight: + ARect := Rect(-Indents[siSelectedDownGrow], -Indents[siHorzGrow], + Indents[siVertGrow], Indents[siHorzGrow]); + end; +end; + +procedure TcxPCSkinPainter.CorrectTabRect(TabVisibleIndex: Integer; + var TabRectCorrection: TcxPCRectCorrection); +var + ATab: TcxTab; + ARect: TRect; +begin + if IsSkinAvailable then + begin + ARect := cxNullRect; + ATab := ParentInfo.VisibleTabs[TabVisibleIndex]; + if ATab.IsMainTab then + InternalCorrectMainTabRect(ATab.PaintingPosition, ARect) + else + InternalCorrectCustomTabRect(ATab.PaintingPosition, ARect); + TabRectCorrection := TcxPCRectCorrection(ARect); + end + else + inherited CorrectTabRect(TabVisibleIndex, TabRectCorrection); +end; + +procedure TcxPCSkinPainter.DrawNativeTabBackground(DC: HDC; ATab: TcxTabSheet); +var + AFrameContent: TdxSkinElement; + R: TRect; +begin + AFrameContent := FrameContent; + if AFrameContent = nil then + inherited DrawNativeTabBackground(DC, ATab) + else + begin + R := GetDisplayRect; + OffsetRect(R, -ATab.Left, -ATab.Top); + AFrameContent.Draw(DC, R); + end; +end; + +function TcxPCSkinPainter.GetClientRectOffset: TRect; +begin + Result := inherited GetDisplayRectOffset; + if FrameContent <> nil then + with RotateRectBack(GetNativeContentOffset, ParentInfo.TabPosition) do + begin + Inc(Result.Left, Left); + Inc(Result.Top, Top); + Inc(Result.Right, Right); + Inc(Result.Bottom, Bottom); + end; +end; + +function TcxPCSkinPainter.GetButtonWidth(Button: TcxPCNavigatorButton): Integer; +begin + Result := 0; + if ButtonHorz <> nil then + Result := ButtonHorz.Image.Size.cx; + if Result = 0 then + Result := inherited GetButtonWidth(Button); +end; + +function TcxPCSkinPainter.GetFreeSpaceColor: TColor; +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinPainterData(ASkinInfo) and (ASkinInfo.ContentColor <> nil) then + Result := ASkinInfo.ContentColor.Value + else + Result := inherited GetFreeSpaceColor; +end; + +function TcxPCSkinPainter.GetNativeContentOffset: TRect; +begin + Result := cxNullRect; + // todo: need correct skin info + if FrameContent <> nil then + with FrameContent.Image.Margins{ContentOffset}.Rect do + Result := Rect(Left + 1, Top + 1, Right + 1, Bottom + 1); +end; + +function TcxPCSkinPainter.GetTabClipRgn(ATabVisibleIndex: Integer): TcxRegion; +begin + Result := TcxRegion.Create(ParentInfo.VisibleTabs[ATabVisibleIndex].FullRect); + if ParentInfo.NavigatorButtons <> [] then + Result.Combine(TcxRegion.Create(ButtonsRect), roSubtract); +end; + +function TcxPCSkinPainter.GetTabsNormalDistance: TcxPCDistance; +begin + Result := cxNullPCDistance; + if not ParentInfo.Rotate then + Result.dh := Indents[siVertGrow] + else + Result.dw := Indents[siVertGrow]; +end; + +function TcxPCSkinPainter.GetTabsPosition( + NavigatorButtons: TcxPCNavigatorButtons): TcxPCTabsPosition; +var + AddX: Integer; + NormalTabsRectCorrection: TRect; + + procedure DoHardCalculation; + var + AButtonsWidth: Integer; + ATabsContainerOffset: TRect; + begin + AButtonsWidth := CalculateButtonsRegionWidth(NavigatorButtons); + if AButtonsWidth <> 0 then + Inc(AButtonsWidth); + ATabsContainerOffset := cxEmptyRect; + if ParentInfo.IsTabsContainer then + ATabsContainerOffset := GetTabsContainerOffsets; + + NormalTabsRectCorrection := RotateRect(Rect(0, Indents[siVertGrow] + ATabsContainerOffset.Top, 0, 0), ParentInfo.TabPosition); + ExtendRect(Result.ExtendedTabsRect, RotateRect(Rect(0, ATabsContainerOffset.Top, 0, 0), ParentInfo.TabPosition)); + with ParentInfo do + begin + if TabPosition in [tpTop, tpBottom] then + begin + if MultiLine or (NavigatorButtons = []) then + begin + Result.ExtendedTabsRect.Left := ATabsContainerOffset.Left + Indents[siNear]; + Result.ExtendedTabsRect.Right := Width - ATabsContainerOffset.Left - Indents[siFar]; + end + else + begin + if NavigatorPosition in [npLeftTop, npLeftBottom] then + begin + Result.ExtendedTabsRect.Left := AButtonsWidth; + Result.ExtendedTabsRect.Right := Width - ATabsContainerOffset.Left - Indents[siFar]; + end + else + begin + Result.ExtendedTabsRect.Left := ATabsContainerOffset.Left + Indents[siNear]; + Result.ExtendedTabsRect.Right := Width - AButtonsWidth; + end; + end; + Result.NormalTabsRect.Left := Result.ExtendedTabsRect.Left + AddX; + Result.NormalTabsRect.Right := Result.ExtendedTabsRect.Right - AddX; + Result.NormalRowWidth := Result.NormalTabsRect.Right - Result.NormalTabsRect.Left; + end + else + begin + if MultiLine or (NavigatorButtons = []) then + begin + Result.ExtendedTabsRect.Top := ATabsContainerOffset.Left + Indents[siNear]; + Result.ExtendedTabsRect.Bottom := Height - ATabsContainerOffset.Left - Indents[siFar]; + end + else + begin + if NavigatorPosition in [npLeftTop, npRightTop] then + begin + Result.ExtendedTabsRect.Top := AButtonsWidth; + Result.ExtendedTabsRect.Bottom := Height - ATabsContainerOffset.Left - Indents[siFar]; + end + else + begin + Result.ExtendedTabsRect.Top := ATabsContainerOffset.Left + Indents[siNear]; + Result.ExtendedTabsRect.Bottom := Height - AButtonsWidth; + end; + end; + Result.NormalTabsRect.Top := Result.ExtendedTabsRect.Top + AddX; + Result.NormalTabsRect.Bottom := Result.ExtendedTabsRect.Bottom - AddX; + Result.NormalRowWidth := Result.NormalTabsRect.Bottom - Result.NormalTabsRect.Top; + end; + end; + end; + +begin + if IsSkinAvailable then + begin + AddX := Indents[siHorzGrow]; + with Result do + begin + ExtendedTabsRect := Rect(0, 0, ParentControl.Width, ParentControl.Height); + NormalTabsRect := ExtendedTabsRect; + DoHardCalculation; + cxGraphics.ExtendRect(NormalTabsRect, NormalTabsRectCorrection); + ExtendedTopOrLeftTabsRectBottomOrRightBorderOffset := 0; + ExtendedBottomOrRightTabsRectTopOrLeftBorderOffset := 0; + if ParentInfo.TabPosition in [tpTop, tpLeft] then + ExtendedTopOrLeftTabsRectBottomOrRightBorderOffset := 1 + else + ExtendedBottomOrRightTabsRectTopOrLeftBorderOffset := -1; + MinDistanceBetweenTopOrLeftAndBottomOrRightExtendedTabsRects := 0; + end; + CalculateButtonsRegion(NavigatorButtons); + end + else + Result := inherited GetTabsPosition(NavigatorButtons); +end; + +function TcxPCSkinPainter.GetTextColor(ATabVisibleIndex: Integer): TColor; +var + ASkinColor: TdxSkinColor; + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; + ATab: TcxTab; +begin + ATab := ParentInfo.VisibleTabs[ATabVisibleIndex]; + ASkinColor := nil; + if GetSkinPainterData(ASkinPainterInfo) then + begin + if not ATab.Enabled then + ASkinColor := ASkinPainterInfo.TabTextColorDisabled + else + if ATab.IsMainTab then + ASkinColor := ASkinPainterInfo.TabTextColorActive + else + if ATab.HotTrack then + ASkinColor := ASkinPainterInfo.TabTextColorHot + else + ASkinColor := ASkinPainterInfo.TabTextColor; + end; + if ASkinColor = nil then + Result := inherited GetTextColor(ATabVisibleIndex) + else + Result := ASkinColor.Value; +end; + +procedure TcxPCSkinPainter.InternalDrawFocusRect(TabVisibleIndex: Integer; R: TRect); +begin + // TODO +end; + +procedure TcxPCSkinPainter.InternalDrawText(ACanvas: TCanvas; const ACaption: string; + ARect: TRect; ATabVisibleIndex: Integer); +begin + ACanvas.Font.Color := GetTextColor(ATabVisibleIndex); + cxDrawText(ACanvas.Handle, ACaption, ARect, DT_SINGLELINE or DT_END_ELLIPSIS); +end; + +procedure TcxPCSkinPainter.InternalPaintFrame(ACanvas: TCanvas); +var + AFrameContent: TdxSkinElement; + ARect, R: TRect; +begin + ARect := GetDisplayRect; + if IsRectEmpty(ARect) then Exit; + R := GetNativeContentOffset; + if ARect.Right - ARect.Left < R.Left + R.Right then + ARect.Right := ARect.Left + R.Left + R.Right; + if ARect.Bottom - ARect.Top < R.Top + R.Bottom then + ARect.Bottom := ARect.Top + R.Top + R.Bottom; + cxDrawThemeParentBackground(ParentControl, ACanvas, ParentControl.ClientRect); + AFrameContent := FrameContent; + if AFrameContent = nil then + inherited InternalPaintFrame(ACanvas) + else + begin + if ParentInfo.IsTabsContainer then + with GetNativeContentOffset do + begin + if ParentInfo.TabPosition in [tpTop, tpBottom] then + InflateRect(ARect, Max(Left, Right), 0) + else + InflateRect(ARect, 0, Max(Top, Bottom)); + end; + FrameContentCache.CheckCacheState(AFrameContent, ARect); + FrameContentCache.Draw(ACanvas.Handle, ARect); + if ACanvas.Handle = ParentInfo.Canvas.Handle then + Windows.ExcludeClipRect(ACanvas.Handle, ARect.Left, ARect.Top, ARect.Right, + ARect.Bottom); + end; +end; + +function TcxPCSkinPainter.IsEnableHotTrack: Boolean; +begin + Result := True; +end; + +function TcxPCSkinPainter.IsNativePainting: Boolean; +begin + if IsSkinAvailable then + Result := True + else + Result := inherited IsNativePainting; +end; + +function TcxPCSkinPainter.IsSkinAvailable: Boolean; +begin + Result := ParentControl.LookAndFeel.SkinPainter <> nil; +end; + +function TcxPCSkinPainter.NeedDisabledTextShadow: Boolean; +begin + Result := False; +end; + +procedure TcxPCSkinPainter.PaintButton(Button: TcxPCNavigatorButton; + const ButtonRect: TRect); +const + AButtonKindVert: array[TcxPCNavigatorButton] of Integer = (2, 1, 3, 0); + AButtonKindHorz: array[TcxPCNavigatorButton] of Integer = (1, 2, 3, 0); + AButtonStates: array[TcxPCNavigatorButtonState] of TdxSkinElementState = ( + esNormal, esPressed, esHot, esDisabled); +begin + if (ButtonHorz <> nil) and (ButtonVert <> nil) then + with ParentInfo do + begin + cxDrawThemeParentBackground(ParentControl, ParentInfo.Canvas, ButtonRect); + if ParentInfo.TabPosition in [tpTop, tpBottom] then + ButtonHorz.Draw(Canvas.Handle, ButtonRect, + AButtonKindHorz[Button], AButtonStates[NavigatorButtonsState[Button]]) + else + ButtonVert.Draw(Canvas.Handle, ButtonRect, AButtonKindVert[Button], + AButtonStates[NavigatorButtonsState[Button]]) + end + else + inherited PaintButton(Button, ButtonRect) +end; + +procedure TcxPCSkinPainter.PaintNativeTabBackground(DC: HDC; + ATabVisibleIndex: Integer; const ABounds: TRect); +begin + if Header = nil then + inherited PaintNativeTabBackground(DC, ATabVisibleIndex, ABounds) + else + Header.Draw(DC, ABounds, 0, GetTabState(ParentInfo.VisibleTabs[ATabVisibleIndex])); +end; + +procedure TcxPCSkinPainter.PaintTabsRegion; +var + I: Integer; + FirstIndex, LastIndex: Integer; + MainTabVisibleIndex: Integer; +begin + if IsSkinAvailable then + begin + MainTabVisibleIndex := ParentInfo.MainTabVisibleIndex; + InitializeVisibleTabRange(ParentControl, FirstIndex, LastIndex); + for I := FirstIndex to LastIndex do + if I <> MainTabVisibleIndex then + PaintTab(I); + if MainTabVisibleIndex <> -1 then + if ParentInfo.VisibleTabs[MainTabVisibleIndex].RealVisible then + PaintTab(MainTabVisibleIndex); + end + else + inherited PaintTabsRegion; +end; + +procedure TcxPCSkinPainter.PrepareTabBitmapBackground(ABitmap: TBitmap; + const ARect: TRect; ATab: TcxTab); +const + HorzRotationAngle: array[Boolean] of TcxRotationAngle = (raPlus90, raMinus90); +var + R: TRect; +begin + inherited PrepareTabBitmapBackground(ABitmap, ARect, ATab); + if (FrameContent <> nil) and NeedDrawTabBitmapBackground then + begin + R := GetDisplayRect; + OffsetRect(R, -ATab.FullRect.Left, -ATab.FullRect.Top); + if ATab.IsMainTab then + begin + case ATab.PaintingPosition of + tpBottom: + OffsetRect(R, 0, 1); + tpRight: + OffsetRect(R, 1, 0); + end; + end; + case ATab.PaintingPosition of + tpLeft, tpRight: + ParentControl.Canvas.RotateBitmap(ABitmap, + HorzRotationAngle[ATab.PaintingPosition = tpRight]); + tpBottom: + ParentControl.Canvas.RotateBitmap(ABitmap, ra180); + end; + FrameContent.Draw(ABitmap.Canvas.Handle, R); + case ATab.PaintingPosition of + tpLeft, tpRight: + ParentControl.Canvas.RotateBitmap(ABitmap, + HorzRotationAngle[ATab.PaintingPosition <> tpRight]); + tpBottom: + ParentControl.Canvas.RotateBitmap(ABitmap, ra180); + end; + end; +end; + +function TcxPCSkinPainter.GetButtonHorz: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.PageControlButtonHorz; +end; + +function TcxPCSkinPainter.GetButtonVert: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.PageControlButtonVert; +end; + +function TcxPCSkinPainter.GetFrameContent: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + if ParentInfo.HideTabs then + begin + if ParentInfo.ShowFrame then + Result := ASkinPainterInfo.GroupBoxElements[cxgpCenter] + else + Result := ASkinPainterInfo.FormContent; + end + else + Result := ASkinPainterInfo.PageControlPane; +end; + +function TcxPCSkinPainter.GetHeader: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.PageControlHeader; +end; + +function TcxPCSkinPainter.GetIndentByIndex(AType: TcxPCSkinIndents): Integer; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := 0; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.PageControlIndents[Integer(AType)]; +end; + +function TcxPCSkinPainter.GetNeedDrawTabBitmapBackground: Boolean; +begin + Result := {(Indents[siDownGrow] > 1) and} (Header <> nil) and Header.IsAlphaUsed; +end; + +function TcxPCSkinPainter.GetSkinPainterData(var AData: TdxSkinLookAndFeelPainterInfo): Boolean; +begin + Result := GetExtendedStylePainters.GetPainterData( + ParentControl.LookAndFeel.SkinPainter, AData); +end; + +function TcxPCSkinPainter.GetTabState(ATab: TcxTab): TdxSkinElementState; +begin + if not ATab.Enabled then + Result := esDisabled + else + if ATab.IsMainTab then + Result := esPressed + else + if ATab.HotTrack or ATab.Highlighted then + Result := esHot + else + Result := esNormal; +end; + +initialization + RegisterPCPainterClass(TcxPCSkinPainter); + +finalization + UnregisterPCPainterClass(TcxPCSkinPainter); + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinscxPCPainterReg.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinscxPCPainterReg.pas new file mode 100644 index 00000000..5bdebf97 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinscxPCPainterReg.pas @@ -0,0 +1,76 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinscxPCPainterReg; + +{$I cxVer.inc} + +interface + +uses + Classes, DesignIntf, dxSkinsDesignHelperReg, cxPC, dxSkinscxPCPainter; + +procedure Register; + +implementation + +type + TdxSkinscxPageControlSelectionEditor = class(TdxSkinsBaseSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + +{ TdxSkinscxPageControlSelectionEditor } + +procedure TdxSkinscxPageControlSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + inherited RequiresUnits(Proc); + Proc('dxSkinscxPCPainter'); +end; + +procedure Register; +var + I: Integer; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterSelectionEditor(TcxPageControl, TdxSkinscxPageControlSelectionEditor); + RegisterSelectionEditor(TcxTabControl, TdxSkinscxPageControlSelectionEditor); + RegisterSelectionEditor(TcxTabSheet, TdxSkinscxPageControlSelectionEditor); + for I := 0 to PageControlDependsControls.Count - 1 do + RegisterSelectionEditor(TClass(PageControlDependsControls[I]), TdxSkinscxPageControlSelectionEditor); +end; + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinscxScheduler3Painter.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinscxScheduler3Painter.pas new file mode 100644 index 00000000..36ef5cb7 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinscxScheduler3Painter.pas @@ -0,0 +1,559 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinscxScheduler3Painter; + +interface + +uses + Windows, SysUtils, Classes, cxSchedulerCustomResourceView, cxDateUtils, + cxSchedulerCustomControls, dxSkinsCore, dxSkinsLookAndFeelPainter, + cxLookAndFeels, cxLookAndFeelPainters, cxGraphics, Graphics, cxGeometry, + cxSchedulerUtils, Math, cxScheduler, cxClasses; + +type + + { TcxSchedulerSkinViewItemsPainter } + + TcxScheduler3SkinViewItemsPainter = class(TcxSchedulerExternalPainter) + private + procedure DrawCaption(ACanvas: TcxCanvas; const ATextAreaBounds: TRect; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; + AMultiLine, AShowEndEllipsis: Boolean; const AText: string; + AFont: TFont; ATextColor: TColor); + procedure DrawClippedElement(ACanvas: TcxCanvas; AElement: TdxSkinElement; + ABorders: TcxBorders; R: TRect); + procedure InternalDrawShadow(ACanvas: TcxCanvas; const ARect, AVisibleRect: TRect); + function IsSkinAvalaible: Boolean; + function SkinInfo: TdxSkinLookAndFeelPainterInfo; + // Headers + procedure DrawHorizontalHeader(AViewInfo: TcxSchedulerDayHeaderCellViewInfo); + procedure DrawVerticalHeader(AViewInfo: TcxSchedulerDayHeaderCellViewInfo); + public + procedure DoCustomDrawButton(AViewInfo: TcxSchedulerMoreEventsButtonViewInfo; + var ADone: Boolean); override; + procedure DoCustomDrawDayHeader(AViewInfo: TcxSchedulerDayHeaderCellViewInfo; + var ADone: Boolean); override; + // + function NeedDrawSelection: Boolean; override; + function DrawCurrentTimeFirst: Boolean; override; + // + procedure DrawAllDayArea(ACanvas: TcxCanvas; const ARect: TRect; + ABorderColor: TColor; ABorders: TcxBorders; AViewParams: TcxViewParams; + ASelected: Boolean; ATransparent: Boolean); override; + procedure DrawCurrentTime(ACanvas: TcxCanvas; AColor: TColor; AStart: TDateTime; + ABounds: TRect); override; + procedure DrawEvent(AViewInfo: TcxSchedulerEventCellViewInfo); override; + procedure DrawEventAsProgressText(AViewInfo: TcxSchedulerEventCellViewInfo; + AContent: TRect; AProgressRect: TRect; const AText: string); override; + procedure DrawTimeGridCurrentTime(ACanvas: TcxCanvas; AColor: TColor; + const ATimeLineRect: TRect); override; + procedure DrawTimeGridHeader(ACanvas: TcxCanvas; ABorderColor: TColor; + AViewInfo: TcxSchedulerCustomViewInfoItem; ABorders: TcxBorders; + ASelected: Boolean); override; + procedure DrawTimeLine(ACanvas: TcxCanvas; const ARect: TRect; + AViewParams: TcxViewParams; ABorders: TcxBorders; + ABorderColor: TColor); override; + procedure DrawTimeRulerBackground(ACanvas: TcxCanvas; const ARect: TRect; + ABorders: TcxBorders; AViewParams: TcxViewParams; ATransparent: Boolean); override; + procedure DrawShadow(ACanvas: TcxCanvas; const ARect, AVisibleRect: TRect; + ABuffer: TBitmap); override; + function MoreButtonSize(ASize: TSize): TSize; override; + end; + +implementation + +uses Types; + +type + TcxCustomSchedulerAccess = class(TcxCustomScheduler); + +const + cxHeaderStateToButtonState: array[Boolean] of TcxButtonState = + (cxbsNormal, cxbsHot); + +{ TcxSchedulerSkinViewItemsPainter } + +procedure TcxScheduler3SkinViewItemsPainter.DrawClippedElement(ACanvas: TcxCanvas; + AElement: TdxSkinElement; ABorders: TcxBorders; R: TRect); +begin + ACanvas.SaveClipRegion; + ACanvas.SetClipRegion(TcxRegion.Create(R), roIntersect); + try + with AElement.Image.Margins.Rect do + begin + if not (bLeft in ABorders) then + Dec(R.Left, Left); + if not (bTop in ABorders) then + Dec(R.Top, Top); + if not (bRight in ABorders) then + Inc(R.Right, Right); + if not (bBottom in ABorders) then + Inc(R.Bottom, Bottom); + end; + AElement.Draw(ACanvas.Handle, R); + finally + ACanvas.RestoreClipRegion; + end; +end; + +function TcxScheduler3SkinViewItemsPainter.IsSkinAvalaible: Boolean; +begin + Result := Painter.InheritsFrom(TdxSkinLookAndFeelPainter); +end; + +function TcxScheduler3SkinViewItemsPainter.SkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + GetExtendedStylePainters.GetPainterData(Painter, Result); +end; + +function TcxScheduler3SkinViewItemsPainter.MoreButtonSize(ASize: TSize): TSize; +begin + if IsSkinAvalaible and (SkinInfo.SchedulerMoreButton <> nil) then + Result := SkinInfo.SchedulerMoreButton.Size + else + Result := ASize; +end; + +procedure TcxScheduler3SkinViewItemsPainter.DoCustomDrawButton( + AViewInfo: TcxSchedulerMoreEventsButtonViewInfo; var ADone: Boolean); +var + AElement: TdxSkinElement; +begin + inherited DoCustomDrawButton(AViewInfo, ADone); + ADone := IsSkinAvalaible; + if ADone then + begin + AElement := SkinInfo.SchedulerMoreButton; + ADone := AElement <> nil; + if ADone then + with AViewInfo do + AElement.Draw(Canvas.Handle, Bounds, Byte(IsDown)); + end; +end; + +procedure TcxScheduler3SkinViewItemsPainter.DrawCaption(ACanvas: TcxCanvas; + const ATextAreaBounds: TRect; AAlignmentHorz: TAlignment; + AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor: TColor); +const + AlignmentsHorz: array[TAlignment] of Integer = + (cxAlignLeft, cxAlignRight, cxAlignHCenter); + AlignmentsVert: array[TcxAlignmentVert] of Integer = + (cxAlignTop, cxAlignBottom, cxAlignVCenter); + MultiLines: array[Boolean] of Integer = (cxSingleLine, cxWordBreak); + ShowEndEllipsises: array[Boolean] of Integer = (0, cxShowEndEllipsis); +begin + with ACanvas do + if AText <> '' then + begin + Brush.Style := bsClear; + Font := AFont; + Font.Color := ATextColor; + DrawText(AText, ATextAreaBounds, AlignmentsHorz[AAlignmentHorz] or + AlignmentsVert[AAlignmentVert] or MultiLines[AMultiLine] or + ShowEndEllipsises[AShowEndEllipsis]); + end; +end; + +procedure TcxScheduler3SkinViewItemsPainter.DrawHorizontalHeader( + AViewInfo: TcxSchedulerDayHeaderCellViewInfo); +begin + with AViewInfo do + begin + Painter.DrawHeader(Canvas, Bounds, TextRect, Neighbors, Borders, + cxHeaderStateToButtonState[Selected], AlignHorz, AlignVert, MultiLine, + ShowEndEllipsis, '', Font, TextColor, 0, nil); + DrawCaption(Canvas, TextRect, AlignHorz, AlignVert, MultiLine, + ShowEndEllipsis, DisplayText, Font, TextColor); + end; +end; + +procedure TcxScheduler3SkinViewItemsPainter.DrawVerticalHeader( + AViewInfo: TcxSchedulerDayHeaderCellViewInfo); +var + ABitmap: TcxBitmap; + R: TRect; +begin + with AViewInfo do + begin + ABitmap := TcxBitmap.CreateSize(Bounds.Right - Bounds.Left, + Bounds.Bottom - Bounds.Top); + try + ABitmap.cxCanvas.WindowOrg := Bounds.TopLeft; + BitBlt(ABitmap.Canvas.Handle, 0, 0, ABitmap.Width, ABitmap.Height, + Canvas.Handle, Bounds.Left, Bounds.Top, SRCCOPY); + ABitmap.Rotate(raPlus90, True); + + R := cxRect(0, 0, ABitmap.Width, ABitmap.Height); + Painter.DrawHeader(ABitmap.cxCanvas, R, R, Neighbors, Borders, cxbsNormal, + taCenter, vaCenter, False, False, '', Font, TextColor, Color, nil); + + if RotateText then + begin + ABitmap.Rotate(ra0, True); + DrawCaption(ABitmap.cxCanvas, R, AlignHorz, AlignVert, MultiLine, + ShowEndEllipsis, DisplayText, Font, TextColor); + ABitmap.Rotate(raPlus90); + end + else + begin + ABitmap.Rotate(raPlus90, True); + R.BottomRight := cxPoint(R.Bottom, R.Right); + DrawCaption(ABitmap.cxCanvas, R, AlignHorz, AlignVert, MultiLine, + ShowEndEllipsis, DisplayText, Font, TextColor); + end; + + BitBlt(Canvas.Handle, Bounds.Left, Bounds.Top, ABitmap.Width, ABitmap.Height, + ABitmap.Canvas.Handle, 0, 0, SRCCOPY); + finally + ABitmap.Free; + end; + end; +end; + +procedure TcxScheduler3SkinViewItemsPainter.DoCustomDrawDayHeader( + AViewInfo: TcxSchedulerDayHeaderCellViewInfo; var ADone: Boolean); +begin + inherited DoCustomDrawDayHeader(AViewInfo, ADone); + ADone := IsSkinAvalaible; + if ADone then + with AViewInfo do + if RotateHeader or RotateText then + DrawVerticalHeader(AViewInfo) + else + DrawHorizontalHeader(AViewInfo); +end; + +procedure TcxScheduler3SkinViewItemsPainter.DrawAllDayArea(ACanvas: TcxCanvas; + const ARect: TRect; ABorderColor: TColor; ABorders: TcxBorders; + AViewParams: TcxViewParams; ASelected: Boolean; ATransparent: Boolean); +var + ADoCustomDraw: Boolean; + AElement: TdxSkinElement; +begin + if IsSkinAvalaible then + begin + AElement := SkinInfo.SchedulerAllDayArea[ASelected]; + ADoCustomDraw := AElement = nil; + if not ADoCustomDraw then + DrawClippedElement(ACanvas, AElement, ABorders, ARect); + end + else + ADoCustomDraw := True; + + if ADoCustomDraw then + inherited DrawAllDayArea(ACanvas, ARect, ABorderColor, ABorders, AViewParams, + ASelected, ATransparent); +end; + +procedure TcxScheduler3SkinViewItemsPainter.DrawCurrentTime(ACanvas: TcxCanvas; + AColor: TColor; AStart: TDateTime; ABounds: TRect); +var + ADoCustomDraw: Boolean; + AElement: TdxSkinElement; + ANow: TDateTime; + Y, I: Integer; +begin + if IsSkinAvalaible then + begin + AElement := SkinInfo.SchedulerCurrentTimeIndicator; + ADoCustomDraw := AElement = nil; + if not ADoCustomDraw then + begin + ANow := TimeOf(Now) - TimeOf(AStart); + if (ANow < 0) or (ANow >= HourToTime) then Exit; + Y := Trunc(ABounds.Top + (ANow * cxRectHeight(ABounds)) / HourToTime); + Dec(ABounds.Right); + Inc(ABounds.Left, 5); + with AElement.Image.Size do + ABounds := cxRectSetTop(ABounds, Y - cy div 2, cy); + for I := 0 to 1 do + AElement.Draw(ACanvas.Handle, ABounds, I); + end; + end + else + ADoCustomDraw := True; + + if ADoCustomDraw then + inherited DrawCurrentTime(ACanvas, AColor, AStart, ABounds); +end; + +function TcxScheduler3SkinViewItemsPainter.NeedDrawSelection: Boolean; +begin + Result := not IsSkinAvalaible; +end; + +function TcxScheduler3SkinViewItemsPainter.DrawCurrentTimeFirst: Boolean; +begin + Result := True; +end; + +procedure TcxScheduler3SkinViewItemsPainter.DrawEvent( + AViewInfo: TcxSchedulerEventCellViewInfo); +const + AShadowSize = 4; + ASelectedFlags: array[Boolean] of TdxSkinElementState = (esNormal, esHot); +var + ADone: Boolean; + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + + function CheckRect(const ARect: TRect): TRect; + begin + if AViewInfo.Selected and (ASkinInfo.SchedulerAppointmentBorderSize <> nil) then + begin + with ASkinInfo.SchedulerAppointmentBorderSize do + begin + Result := Rect(ARect.Left, ARect.Top - Value, ARect.Right + Value, + ARect.Bottom + Value); + if IsRectEmpty(AViewInfo.TimeLineRect) then + Dec(Result.Left, Value) + else + Dec(Result.Left, cxTimeLineWidth); + end; + end + else + Result := ARect; + end; + + procedure DrawLabeledEvent(ALabelColor: TColor; AMask: TdxSkinElement); + const + AImageIndexs: array[Boolean] of Integer = (1, 0); + var + ABitmap: TcxBitmap; + AMaskBmp: TcxBitmap; + ASourceBmp: TcxBitmap; + R: TRect; + begin + if AMask = nil then Exit; + R := AViewInfo.Bounds; + OffsetRect(R, -R.Left, -R.Top); + AMaskBmp := TcxBitmap.CreateSize(R); + ASourceBmp := TcxBitmap.CreateSize(R); + try + ASourceBmp.Canvas.Brush.Color := ALabelColor; + ASourceBmp.Canvas.FillRect(R); + AMask.Draw(AMaskBmp.Canvas.Handle, R, AImageIndexs[IsRectEmpty(AViewInfo.TimeLineRect)]); + ABitmap := TcxBitmap.CreateSize(R); + try + ABitmap.PixelFormat := pf32bit; + BitBlt(AMaskBmp.Canvas.Handle, 0, 0, ABitmap.Width, ABitmap.Height, + AMaskBmp.Canvas.Handle, 0, 0, NOTSRCCOPY); + BitBlt(ABitmap.Canvas.Handle, 0, 0, ABitmap.Width, ABitmap.Height, + AMaskBmp.Canvas.Handle, 0, 0, SRCCOPY); + BitBlt(ABitmap.Canvas.Handle, 0, 0, ABitmap.Width, ABitmap.Height, + ASourceBmp.Canvas.Handle, 0, 0, SrcErase); + BitBlt(AViewInfo.Canvas.Handle, AViewInfo.Bounds.Left, AViewInfo.Bounds.Top, + ABitmap.Width, ABitmap.Height, AMaskBmp.Canvas.Handle, 0, 0, SrcAnd); + BitBlt(AViewInfo.Canvas.Handle, AViewInfo.Bounds.Left, AViewInfo.Bounds.Top, + ABitmap.Width, ABitmap.Height, ABitmap.Canvas.Handle, 0, 0, SrcInvert); + finally + ABitmap.Free; + end; + finally + AMaskBmp.Free; + ASourceBmp.Free; + end; + end; + + function GetSeparatorColor(ABorderColor: TdxSkinColor): TColor; + begin + Result := clDefault; + if ABorderColor <> nil then + Result := ABorderColor.Value; + if (Result = clNone) or (Result = clDefault) then + Result := AViewInfo.SeparatorColor; + end; + + function GetDrawShadow: Boolean; + begin + with AViewInfo do + Result := EventViewData.DrawShadows and (EventViewData.Bitmap <> nil) and + not (Hidden or Selected) and AViewInfo.ShowTimeLine; + end; + +begin + ASkinInfo := SkinInfo; + ADone := ASkinInfo <> nil; + if ADone then + begin + AElement := ASkinInfo.SchedulerAppointment[IsRectEmpty(AViewInfo.TimeLineRect)]; + ADone := (AElement <> nil); + if ADone then + with AViewInfo do + begin + Canvas.SaveClipRegion; + try + Canvas.SetClipRegion(TcxRegion.Create(EventViewData.VisibleRect), roSet); + Canvas.ExcludeClipRect(TimeLineRect); + if GetDrawShadow then + InternalDrawShadow(Canvas, Bounds, EventViewData.VisibleRect); + SeparatorColor := GetSeparatorColor(ASkinInfo.SchedulerAppointmentBorder); + AElement.Draw(Canvas.Handle, CheckRect(Bounds), 0, ASelectedFlags[Selected]); + if Event.LabelColor <> clDefault then + DrawLabeledEvent(Event.LabelColor, ASkinInfo.SchedulerAppointmentMask); + Transparent := True; + finally + Canvas.RestoreClipRegion; + end; + end; + end; + if not ADone then + inherited DrawEvent(AViewInfo); +end; + +procedure TcxScheduler3SkinViewItemsPainter.DrawEventAsProgressText( + AViewInfo: TcxSchedulerEventCellViewInfo; AContent: TRect; AProgressRect: TRect; + const AText: string); +begin + if IsSkinAvalaible then + cxDrawText(AViewInfo.Canvas.Handle, AText, AContent, + DT_CENTER or DT_VCENTER or DT_SINGLELINE) + else + inherited DrawEventAsProgressText(AViewInfo, AContent, AProgressRect, AText); +end; + +procedure TcxScheduler3SkinViewItemsPainter.DrawTimeGridCurrentTime( + ACanvas: TcxCanvas; AColor: TColor; const ATimeLineRect: TRect); +var + ADoCustomDraw: Boolean; + AElement: TdxSkinElement; +begin + ADoCustomDraw := True; + if IsSkinAvalaible then + begin + AElement := SkinInfo.SchedulerTimeGridCurrentTimeIndicator; + ADoCustomDraw := AElement = nil; + if not ADoCustomDraw then + AElement.Draw(ACanvas.Handle, ATimeLineRect); + end; + if ADoCustomDraw then + inherited DrawTimeGridCurrentTime(ACanvas, AColor, ATimeLineRect); +end; + +procedure TcxScheduler3SkinViewItemsPainter.DrawTimeGridHeader(ACanvas: TcxCanvas; + ABorderColor: TColor; AViewInfo: TcxSchedulerCustomViewInfoItem; + ABorders: TcxBorders; ASelected: Boolean); +var + ADoCustomDraw: Boolean; + AElement: TdxSkinElement; +begin + ADoCustomDraw := True; + if IsSkinAvalaible then + begin + AElement := SkinInfo.SchedulerTimeGridHeader[ASelected]; + ADoCustomDraw := AElement = nil; + if not ADoCustomDraw then + with AViewInfo do + DrawClippedElement(ACanvas, AElement, ABorders, Bounds); + end; + if ADoCustomDraw then + inherited DrawTimeGridHeader(ACanvas, ABorderColor, AViewInfo, ABorders, + ASelected); +end; + +procedure TcxScheduler3SkinViewItemsPainter.DrawTimeLine(ACanvas: TcxCanvas; + const ARect: TRect; AViewParams: TcxViewParams; ABorders: TcxBorders; + ABorderColor: TColor); +var + ADoCustomDraw: Boolean; + AElement: TdxSkinElement; +begin + ADoCustomDraw := True; + if IsSkinAvalaible then + begin + AElement := SkinInfo.SchedulerTimeLine; + ADoCustomDraw := AElement = nil; + if not ADoCustomDraw then + DrawClippedElement(ACanvas, AElement, ABorders, ARect); + end; + if ADoCustomDraw then + inherited DrawTimeLine(ACanvas, ARect, AViewParams, ABorders, ABorderColor); +end; + +procedure TcxScheduler3SkinViewItemsPainter.DrawTimeRulerBackground( + ACanvas: TcxCanvas; const ARect: TRect; ABorders: TcxBorders; + AViewParams: TcxViewParams; ATransparent: Boolean); +var + ADoCustomDraw: Boolean; + AElement: TdxSkinElement; +begin + ADoCustomDraw := True; + if IsSkinAvalaible then + begin + AElement := SkinInfo.SchedulerTimeRuler; + ADoCustomDraw := AElement = nil; + if not ADoCustomDraw then + DrawClippedElement(ACanvas, AElement, ABorders, ARect); + end; + if ADoCustomDraw then + inherited DrawTimeRulerBackground(ACanvas, ARect, ABorders, AViewParams, + ATransparent); +end; + +procedure TcxScheduler3SkinViewItemsPainter.DrawShadow(ACanvas: TcxCanvas; + const ARect, AVisibleRect: TRect; ABuffer: TBitmap); +begin + if not IsSkinAvalaible then + inherited DrawShadow(ACanvas, ARect, AVisibleRect, ABuffer); +end; + +procedure TcxScheduler3SkinViewItemsPainter.InternalDrawShadow(ACanvas: TcxCanvas; + const ARect, AVisibleRect: TRect); +const + ShadowSize = 4; + + procedure DrawShadowLine(const AShadow: TdxSkinElement; const ARect: TRect); + begin + if AShadow <> nil then + AShadow.Draw(ACanvas.Handle, ARect); + end; + +begin + DrawShadowLine(SkinInfo.SchedulerAppointmentShadow[False], + Rect(ARect.Left + ShadowSize, ARect.Bottom - ShadowSize, + ARect.Right + ShadowSize, ARect.Bottom + ShadowSize)); + DrawShadowLine(SkinInfo.SchedulerAppointmentShadow[True], + Rect(ARect.Right - ShadowSize, ARect.Top + ShadowSize, + ARect.Right + ShadowSize, ARect.Bottom - ShadowSize)); +end; + +initialization + ExternalPainterClass := TcxScheduler3SkinViewItemsPainter; + +finalization + ExternalPainterClass := TcxSchedulerExternalPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinscxScheduler3PainterReg.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinscxScheduler3PainterReg.pas new file mode 100644 index 00000000..232eda7a --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinscxScheduler3PainterReg.pas @@ -0,0 +1,71 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinscxScheduler3PainterReg; + +{$I cxVer.inc} + +interface + +uses + Classes, DesignIntf, dxSkinsDesignHelperReg, cxSchedulerCustomControls, + dxSkinscxScheduler3Painter; + +procedure Register; + +implementation + +type + TdxSkinscxScheduler3SelectionEditor = class(TdxSkinsBaseSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + +{ TdxSkinscxSchedulerSelectionEditor } + +procedure TdxSkinscxScheduler3SelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + inherited RequiresUnits(Proc); + Proc('dxSkinscxScheduler3Painter'); +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterSelectionEditor(TcxCustomScheduler, TdxSkinscxScheduler3SelectionEditor); +end; + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinscxSchedulerPainter.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinscxSchedulerPainter.pas new file mode 100644 index 00000000..4f901af5 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinscxSchedulerPainter.pas @@ -0,0 +1,528 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinscxSchedulerPainter; + +interface + +uses + Windows, SysUtils, Classes, cxSchedulerCustomResourceView, cxDateUtils, + cxSchedulerCustomControls, dxSkinsCore, dxSkinsLookAndFeelPainter, + cxLookAndFeels, cxLookAndFeelPainters, cxGraphics, Graphics, cxGeometry, + cxSchedulerUtils, Math, cxScheduler, cxClasses; + +type + + { TcxSchedulerSkinViewItemsPainter } + + TcxSchedulerSkinViewItemsPainter = class(TcxSchedulerExternalPainter) + private + procedure DrawCaption(ACanvas: TcxCanvas; const ATextAreaBounds: TRect; + AAlignmentHorz: TAlignment; AAlignmentVert: TcxAlignmentVert; + AMultiLine, AShowEndEllipsis: Boolean; const AText: string; + AFont: TFont; ATextColor: TColor); + procedure DrawClippedElement(ACanvas: TcxCanvas; AElement: TdxSkinElement; + ABorders: TcxBorders; R: TRect); + function IsSkinAvalaible: Boolean; + function SkinInfo: TdxSkinLookAndFeelPainterInfo; + // Headers + procedure DrawHorizontalHeader(AViewInfo: TcxSchedulerDayHeaderCellViewInfo); + procedure DrawVerticalHeader(AViewInfo: TcxSchedulerDayHeaderCellViewInfo); + public + procedure DoCustomDrawButton(AViewInfo: TcxSchedulerMoreEventsButtonViewInfo; + var ADone: Boolean); override; + procedure DoCustomDrawDayHeader(AViewInfo: TcxSchedulerDayHeaderCellViewInfo; + var ADone: Boolean); override; + // + function NeedDrawSelection: Boolean; override; + function DrawCurrentTimeFirst: Boolean; override; + // + procedure DrawAllDayArea(ACanvas: TcxCanvas; const ARect: TRect; + ABorderColor: TColor; ABorders: TcxBorders; AViewParams: TcxViewParams; + ASelected: Boolean; ATransparent: Boolean); override; + procedure DrawCurrentTime(ACanvas: TcxCanvas; AColor: TColor; AStart: TDateTime; + ABounds: TRect); override; + procedure DrawEvent(AViewInfo: TcxSchedulerEventCellViewInfo); override; + procedure DrawTimeGridHeader(ACanvas: TcxCanvas; ABorderColor: TColor; + AViewInfo: TcxSchedulerCustomViewInfoItem; ABorders: TcxBorders; + ASelected: Boolean); override; + procedure DrawTimeLine(ACanvas: TcxCanvas; const ARect: TRect; + AViewParams: TcxViewParams; ABorders: TcxBorders; + ABorderColor: TColor); override; + procedure DrawTimeRulerBackground(ACanvas: TcxCanvas; const ARect: TRect; + ABorders: TcxBorders; AViewParams: TcxViewParams; ATransparent: Boolean); override; + procedure DrawShadow(ACanvas: TcxCanvas; const ARect, AVisibleRect: TRect; + ABuffer: TBitmap); override; + function MoreButtonSize(ASize: TSize): TSize; override; + end; + +implementation + +uses Types; + +type + TcxCustomSchedulerAccess = class(TcxCustomScheduler); + +const + cxHeaderStateToButtonState: array[Boolean] of TcxButtonState = + (cxbsNormal, cxbsHot); + +{ TcxSchedulerSkinViewItemsPainter } + +procedure TcxSchedulerSkinViewItemsPainter.DrawClippedElement(ACanvas: TcxCanvas; + AElement: TdxSkinElement; ABorders: TcxBorders; R: TRect); +begin + ACanvas.SaveClipRegion; + ACanvas.SetClipRegion(TcxRegion.Create(R), roIntersect); + try + with AElement.Image.Margins.Rect do + begin + if not (bLeft in ABorders) then + Dec(R.Left, Left); + if not (bTop in ABorders) then + Dec(R.Top, Top); + if not (bRight in ABorders) then + Inc(R.Right, Right); + if not (bBottom in ABorders) then + Inc(R.Bottom, Bottom); + end; + AElement.Draw(ACanvas.Handle, R); + finally + ACanvas.RestoreClipRegion; + end; +end; + +function TcxSchedulerSkinViewItemsPainter.IsSkinAvalaible: Boolean; +begin + Result := Painter.InheritsFrom(TdxSkinLookAndFeelPainter); +end; + +function TcxSchedulerSkinViewItemsPainter.SkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + GetExtendedStylePainters.GetPainterData(Painter, Result); +end; + +function TcxSchedulerSkinViewItemsPainter.MoreButtonSize(ASize: TSize): TSize; +begin + if IsSkinAvalaible and (SkinInfo.SchedulerMoreButton <> nil) then + Result := SkinInfo.SchedulerMoreButton.Size + else + Result := ASize; +end; + +procedure TcxSchedulerSkinViewItemsPainter.DoCustomDrawButton( + AViewInfo: TcxSchedulerMoreEventsButtonViewInfo; var ADone: Boolean); +var + AElement: TdxSkinElement; +begin + inherited DoCustomDrawButton(AViewInfo, ADone); + ADone := IsSkinAvalaible; + if ADone then + begin + AElement := SkinInfo.SchedulerMoreButton; + ADone := AElement <> nil; + if ADone then + with AViewInfo do + AElement.Draw(Canvas.Handle, Bounds, Byte(IsDown)); + end; +end; + +procedure TcxSchedulerSkinViewItemsPainter.DrawCaption(ACanvas: TcxCanvas; + const ATextAreaBounds: TRect; AAlignmentHorz: TAlignment; + AAlignmentVert: TcxAlignmentVert; AMultiLine, AShowEndEllipsis: Boolean; + const AText: string; AFont: TFont; ATextColor: TColor); +const + AlignmentsHorz: array[TAlignment] of Integer = + (cxAlignLeft, cxAlignRight, cxAlignHCenter); + AlignmentsVert: array[TcxAlignmentVert] of Integer = + (cxAlignTop, cxAlignBottom, cxAlignVCenter); + MultiLines: array[Boolean] of Integer = (cxSingleLine, cxWordBreak); + ShowEndEllipsises: array[Boolean] of Integer = (0, cxShowEndEllipsis); +begin + with ACanvas do + if AText <> '' then + begin + Brush.Style := bsClear; + Font := AFont; + Font.Color := ATextColor; + DrawText(AText, ATextAreaBounds, AlignmentsHorz[AAlignmentHorz] or + AlignmentsVert[AAlignmentVert] or MultiLines[AMultiLine] or + ShowEndEllipsises[AShowEndEllipsis]); + end; +end; + +procedure TcxSchedulerSkinViewItemsPainter.DrawHorizontalHeader( + AViewInfo: TcxSchedulerDayHeaderCellViewInfo); +begin + with AViewInfo do + begin + Painter.DrawHeader(Canvas, Bounds, TextRect, Neighbors, Borders, + cxHeaderStateToButtonState[Selected], AlignHorz, AlignVert, MultiLine, + ShowEndEllipsis, '', Font, TextColor, 0, nil); + DrawCaption(Canvas, TextRect, AlignHorz, AlignVert, MultiLine, + ShowEndEllipsis, DisplayText, Font, TextColor); + end; +end; + +procedure TcxSchedulerSkinViewItemsPainter.DrawVerticalHeader( + AViewInfo: TcxSchedulerDayHeaderCellViewInfo); +var + ABitmap: TcxBitmap; + R: TRect; +begin + with AViewInfo do + begin + ABitmap := TcxBitmap.CreateSize(Bounds.Right - Bounds.Left, + Bounds.Bottom - Bounds.Top); + try + ABitmap.cxCanvas.WindowOrg := Bounds.TopLeft; + BitBlt(ABitmap.Canvas.Handle, 0, 0, ABitmap.Width, ABitmap.Height, + Canvas.Handle, Bounds.Left, Bounds.Top, SRCCOPY); + ABitmap.Rotate(raPlus90, True); + + R := cxRect(0, 0, ABitmap.Width, ABitmap.Height); + Painter.DrawHeader(ABitmap.cxCanvas, R, R, Neighbors, Borders, cxbsNormal, + taCenter, vaCenter, False, False, '', Font, TextColor, Color, nil); + + if RotateText then + begin + ABitmap.Rotate(ra0, True); + DrawCaption(ABitmap.cxCanvas, R, AlignHorz, AlignVert, MultiLine, + ShowEndEllipsis, DisplayText, Font, TextColor); + ABitmap.Rotate(raPlus90); + end + else + begin + ABitmap.Rotate(raPlus90, True); + R.BottomRight := cxPoint(R.Bottom, R.Right); + DrawCaption(ABitmap.cxCanvas, R, AlignHorz, AlignVert, MultiLine, + ShowEndEllipsis, DisplayText, Font, TextColor); + end; + + BitBlt(Canvas.Handle, Bounds.Left, Bounds.Top, ABitmap.Width, ABitmap.Height, + ABitmap.Canvas.Handle, 0, 0, SRCCOPY); + finally + ABitmap.Free; + end; + end; +end; + +procedure TcxSchedulerSkinViewItemsPainter.DoCustomDrawDayHeader( + AViewInfo: TcxSchedulerDayHeaderCellViewInfo; var ADone: Boolean); +begin + inherited DoCustomDrawDayHeader(AViewInfo, ADone); + ADone := IsSkinAvalaible; + if ADone then + with AViewInfo do + if RotateHeader or RotateText then + DrawVerticalHeader(AViewInfo) + else + DrawHorizontalHeader(AViewInfo); +end; + +procedure TcxSchedulerSkinViewItemsPainter.DrawAllDayArea(ACanvas: TcxCanvas; + const ARect: TRect; ABorderColor: TColor; ABorders: TcxBorders; + AViewParams: TcxViewParams; ASelected: Boolean; ATransparent: Boolean); +var + ADoCustomDraw: Boolean; + AElement: TdxSkinElement; +begin + if IsSkinAvalaible then + begin + AElement := SkinInfo.SchedulerAllDayArea[ASelected]; + ADoCustomDraw := AElement = nil; + if not ADoCustomDraw then + DrawClippedElement(ACanvas, AElement, ABorders, ARect); + end + else + ADoCustomDraw := True; + + if ADoCustomDraw then + inherited DrawAllDayArea(ACanvas, ARect, ABorderColor, ABorders, AViewParams, + ASelected, ATransparent); +end; + +procedure TcxSchedulerSkinViewItemsPainter.DrawCurrentTime(ACanvas: TcxCanvas; + AColor: TColor; AStart: TDateTime; ABounds: TRect); +var + ADoCustomDraw: Boolean; + AElement: TdxSkinElement; + ANow: TDateTime; + Y, I: Integer; +begin + if IsSkinAvalaible then + begin + AElement := SkinInfo.SchedulerCurrentTimeIndicator; + ADoCustomDraw := AElement = nil; + if not ADoCustomDraw then + begin + ANow := TimeOf(Now) - TimeOf(AStart); + if (ANow < 0) or (ANow >= HourToTime) then Exit; + Y := Trunc(ABounds.Top + (ANow * cxRectHeight(ABounds)) / HourToTime); + Dec(ABounds.Right); + Inc(ABounds.Left, 5); + with AElement.Image.Size do + ABounds := cxRectSetTop(ABounds, Y - cy div 2, cy); + for I := 0 to 1 do + AElement.Draw(ACanvas.Handle, ABounds, I); + end; + end + else + ADoCustomDraw := True; + + if ADoCustomDraw then + inherited DrawCurrentTime(ACanvas, AColor, AStart, ABounds); +end; + +function TcxSchedulerSkinViewItemsPainter.NeedDrawSelection: Boolean; +begin + Result := not IsSkinAvalaible; +end; + +function TcxSchedulerSkinViewItemsPainter.DrawCurrentTimeFirst: Boolean; +begin + Result := True; +end; + +procedure TcxSchedulerSkinViewItemsPainter.DrawEvent( + AViewInfo: TcxSchedulerEventCellViewInfo); +const + AShadowSize = 4; + ASelectedFlags: array[Boolean] of TdxSkinElementState = (esNormal, esHot); +var + ADone: Boolean; + AElement: TdxSkinElement; + AMask: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + + function CheckRect(const ARect: TRect): TRect; + begin + if AViewInfo.Selected and (ASkinInfo.SchedulerAppointmentBorderSize <> nil) then + begin + with ASkinInfo.SchedulerAppointmentBorderSize do + begin + Result := Rect(ARect.Left, ARect.Top - Value, ARect.Right + Value, + ARect.Bottom + Value); + if IsRectEmpty(AViewInfo.TimeLineRect) then + Dec(Result.Left, Value) + else + Dec(Result.Left, cxTimeLineWidth); + end; + end + else + Result := ARect; + end; + + procedure DrawShadowLine(const AShadow: TdxSkinElement; const ARect: TRect); + begin + if AShadow <> nil then + AShadow.Draw(AViewInfo.Canvas.Handle, ARect); + end; + + procedure DrawShadows(ASkinInfo: TdxSkinLookAndFeelPainterInfo); + begin + with AViewInfo do + if EventViewData.DrawShadows and (EventViewData.Bitmap <> nil) and + not Hidden and not Selected and ShowTimeLine then + begin + DrawShadowLine(ASkinInfo.SchedulerAppointmentShadow[False], + Rect(Bounds.Left + AShadowSize, Bounds.Bottom - AShadowSize, + Bounds.Right + AShadowSize, Bounds.Bottom + AShadowSize)); + DrawShadowLine(ASkinInfo.SchedulerAppointmentShadow[True], + Rect(Bounds.Right - AShadowSize, Bounds.Top + AShadowSize, + Bounds.Right + AShadowSize, Bounds.Bottom - AShadowSize)); + end; + end; + + procedure DrawLabeledEvent(ALabelColor: TColor); + const + AImageIndexs: array[Boolean] of Integer = (1, 0); + var + AMaskBmp: TcxBitmap; + ASourceBmp: TcxBitmap; + ABitmap: TcxBitmap; + R: TRect; + begin + R := AViewInfo.Bounds; + OffsetRect(R, -R.Left, -R.Top); + AMaskBmp := TcxBitmap.CreateSize(R); + ASourceBmp := TcxBitmap.CreateSize(R); + try + ASourceBmp.Canvas.Brush.Color := ALabelColor; + ASourceBmp.Canvas.FillRect(R); + + AMask.Draw(AMaskBmp.Canvas.Handle, R, AImageIndexs[IsRectEmpty(AViewInfo.TimeLineRect)]); + + ABitmap := TcxBitmap.CreateSize(R); + try + ABitmap.PixelFormat := pf32bit; + BitBlt(AMaskBmp.Canvas.Handle, 0, 0, ABitmap.Width, ABitmap.Height, + AMaskBmp.Canvas.Handle, 0, 0, NOTSRCCOPY); + BitBlt(ABitmap.Canvas.Handle, 0, 0, ABitmap.Width, ABitmap.Height, + AMaskBmp.Canvas.Handle, 0, 0, SRCCOPY); + BitBlt(ABitmap.Canvas.Handle, 0, 0, ABitmap.Width, ABitmap.Height, + ASourceBmp.Canvas.Handle, 0, 0, SrcErase); + BitBlt(AViewInfo.Canvas.Handle, AViewInfo.Bounds.Left, AViewInfo.Bounds.Top, + ABitmap.Width, ABitmap.Height, AMaskBmp.Canvas.Handle, 0, 0, SrcAnd); + BitBlt(AViewInfo.Canvas.Handle, AViewInfo.Bounds.Left, AViewInfo.Bounds.Top, + ABitmap.Width, ABitmap.Height, ABitmap.Canvas.Handle, 0, 0, SrcInvert); + finally + ABitmap.Free; + end; + + finally + AMaskBmp.Free; + ASourceBmp.Free; + end; + end; + + function GetSeparatorColor(ABorderColor: TdxSkinColor): TColor; + begin + Result := clDefault; + if ABorderColor <> nil then + Result := ABorderColor.Value; + if (Result = clNone) or (Result = clDefault) then + Result := AViewInfo.SeparatorColor; + end; + +begin + ASkinInfo := SkinInfo; + ADone := ASkinInfo <> nil; + if ADone then + begin + with ASkinInfo do + begin + AElement := SchedulerAppointment[IsRectEmpty(AViewInfo.TimeLineRect)]; + AMask := SchedulerAppointmentMask; + end; + ADone := (AElement <> nil) and (AMask <> nil); + if ADone then + with AViewInfo do + begin + Canvas.SaveClipRegion; + try + Canvas.SetClipRegion(TcxRegion.Create( + cxRectInflate(CheckRect(ClipRect), 0, 0, AShadowSize, AShadowSize)), + roSet); + Canvas.ExcludeClipRect(TimeLineRect); + DrawShadows(ASkinInfo); + SeparatorColor := GetSeparatorColor(ASkinInfo.SchedulerAppointmentBorder); + AElement.Draw(Canvas.Handle, CheckRect(Bounds), 0, ASelectedFlags[Selected]); + if Event.LabelColor <> clDefault then + DrawLabeledEvent(Event.LabelColor); + Transparent := True; + finally + Canvas.RestoreClipRegion; + end; + end; + end; + + if not ADone then + inherited DrawEvent(AViewInfo); +end; + +procedure TcxSchedulerSkinViewItemsPainter.DrawTimeGridHeader(ACanvas: TcxCanvas; + ABorderColor: TColor; AViewInfo: TcxSchedulerCustomViewInfoItem; + ABorders: TcxBorders; ASelected: Boolean); +var + ADoCustomDraw: Boolean; + AElement: TdxSkinElement; +begin + ADoCustomDraw := True; + if IsSkinAvalaible then + begin + AElement := SkinInfo.SchedulerTimeGridHeader[ASelected]; + ADoCustomDraw := AElement = nil; + if not ADoCustomDraw then + with AViewInfo do + DrawClippedElement(ACanvas, AElement, ABorders, Bounds); + end; + if ADoCustomDraw then + inherited DrawTimeGridHeader(ACanvas, ABorderColor, AViewInfo, ABorders, + ASelected); +end; + +procedure TcxSchedulerSkinViewItemsPainter.DrawTimeLine(ACanvas: TcxCanvas; + const ARect: TRect; AViewParams: TcxViewParams; ABorders: TcxBorders; + ABorderColor: TColor); +var + ADoCustomDraw: Boolean; + AElement: TdxSkinElement; +begin + ADoCustomDraw := True; + if IsSkinAvalaible then + begin + AElement := SkinInfo.SchedulerTimeLine; + ADoCustomDraw := AElement = nil; + if not ADoCustomDraw then + DrawClippedElement(ACanvas, AElement, ABorders, ARect); + end; + if ADoCustomDraw then + inherited DrawTimeLine(ACanvas, ARect, AViewParams, ABorders, ABorderColor); +end; + +procedure TcxSchedulerSkinViewItemsPainter.DrawTimeRulerBackground( + ACanvas: TcxCanvas; const ARect: TRect; ABorders: TcxBorders; + AViewParams: TcxViewParams; ATransparent: Boolean); +var + ADoCustomDraw: Boolean; + AElement: TdxSkinElement; +begin + ADoCustomDraw := True; + if IsSkinAvalaible then + begin + AElement := SkinInfo.SchedulerTimeRuler; + ADoCustomDraw := AElement = nil; + if not ADoCustomDraw then + DrawClippedElement(ACanvas, AElement, ABorders, ARect); + end; + if ADoCustomDraw then + inherited DrawTimeRulerBackground(ACanvas, ARect, ABorders, AViewParams, + ATransparent); +end; + +procedure TcxSchedulerSkinViewItemsPainter.DrawShadow(ACanvas: TcxCanvas; + const ARect, AVisibleRect: TRect; ABuffer: TBitmap); +begin + if not IsSkinAvalaible then + inherited DrawShadow(ACanvas, ARect, AVisibleRect, ABuffer); +end; + +initialization + ExternalPainterClass := TcxSchedulerSkinViewItemsPainter; + +finalization + ExternalPainterClass := TcxSchedulerExternalPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinscxSchedulerPainterReg.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinscxSchedulerPainterReg.pas new file mode 100644 index 00000000..dffef018 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinscxSchedulerPainterReg.pas @@ -0,0 +1,70 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinscxSchedulerPainterReg; + +{$I cxVer.inc} + +interface + +uses + Classes, DesignIntf, dxSkinsDesignHelperReg, cxSchedulerCustomControls, dxSkinscxSchedulerPainter; + +procedure Register; + +implementation + +type + TdxSkinscxSchedulerSelectionEditor = class(TdxSkinsBaseSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + +{ TdxSkinscxSchedulerSelectionEditor } + +procedure TdxSkinscxSchedulerSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + inherited RequiresUnits(Proc); + Proc('dxSkinscxSchedulerPainter'); +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterSelectionEditor(TcxCustomScheduler, TdxSkinscxSchedulerSelectionEditor); +end; + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinsdxBarPainter.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxBarPainter.pas new file mode 100644 index 00000000..d68ba8b2 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxBarPainter.pas @@ -0,0 +1,2034 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinsdxBarPainter; + +{$I cxVer.inc} + +interface + +uses + Types, Windows, SysUtils, Classes, Controls, Graphics, Messages, cxLookAndFeels, + cxLookAndFeelPainters, dxBar, dxSkinsLookAndFeelPainter, + dxSkinsCore, cxGraphics, cxGeometry; + +type + {TdxBarSkinPainter} + + TdxBarSkinPainter = class(TdxBarPainter) + private + FSkinPainter: TcxCustomLookAndFeelPainterClass; + function GetBar(AIsVertical: Boolean): TdxSkinElement; + function GetBarCustomize(AIsVertical: Boolean): TdxSkinElement; + function GetBarDisabledTextColor: TdxSkinColor; + function GetBarDrag(AIsVertical: Boolean): TdxSkinElement; + function GetBarSeparator(AIsVertical: Boolean): TdxSkinElement; + function GetDock: TdxSkinElement; + function GetDockControlWindowButton: TdxSkinElement; + function GetDockControlWindowButtonGlyph: TdxSkinElement; + function GetFloatingBar: TdxSkinElement; + function GetLinkBorderPainter: TdxSkinElement; + function GetLinkSelected: TdxSkinElement; + function GetMainMenu(AIsVertical: Boolean): TdxSkinElement; + function GetMainMenuCustomize(AIsVertical: Boolean): TdxSkinElement; + function GetMainMenuDrag(AIsVertical: Boolean): TdxSkinElement; + function GetMainMenuLinkSelected: TdxSkinElement; + function GetPopupMenu: TdxSkinElement; + function GetPopupMenuCheck: TdxSkinElement; + function GetPopupMenuExpandButton: TdxSkinElement; + function GetPopupMenuLinkSelected: TdxSkinElement; + function GetPopupMenuSeparator: TdxSkinElement; + function GetPopupMenuSideStrip: TdxSkinElement; + function GetPopupMenuSideStripNonRecent: TdxSkinElement; + function GetPopupMenuSplitButton: TdxSkinElement; + function GetPopupMenuSplitButton2: TdxSkinElement; + function GetStatusBar: TdxSkinElement; + function GetScreenTipItem: TdxSkinColor; + function GetScreenTipSeparator: TdxSkinElement; + function GetScreenTipTitleItem: TdxSkinColor; + function GetScreenTipWindow: TdxSkinElement; + function GetSkinPainterData(var AData: TdxSkinLookAndFeelPainterInfo): Boolean; + + function DrawSkinElement(AElement: TdxSkinElement; DC: HDC; + const ARect: TRect; AImageIndex: Integer = 0; AState: TdxSkinElementState = esNormal): Boolean; + function DrawSkinElementContent(AElement: TdxSkinElement; DC: HDC; + const ARect: TRect; AImageIndex: Integer = 0; AState: TdxSkinElementState = esNormal): Boolean; + function DrawSkinElementBorders(AElement: TdxSkinElement; DC: HDC; + const ARect: TRect; AImageIndex: Integer = 0; AState: TdxSkinElementState = esNormal): Boolean; + + function GetSkinElementTextColorHot(ASkinElement: TdxSkinElement): TdxSkinColor; + function GetSkinElementSize(ASkinElement: TdxSkinElement): TSize; + + function GetBarElement(ABarControl: TCustomdxBarControl; AVertical: Boolean): TdxSkinElement; overload; + function GetBarElement(ABarControl: TCustomdxBarControl): TdxSkinElement; overload; + function GetBarDragElement(AMainMenu, AVertical: Boolean): TdxSkinElement; overload; + function GetBarDragElement(ABarControl: TdxBarControl): TdxSkinElement; overload; + function GetBarMarkElement(AMainMenu, AVertical: Boolean): TdxSkinElement; overload; + function GetBarMarkElement(ABarControl: TdxBarControl): TdxSkinElement; overload; + function GetTextColorElement(ABarControl: TCustomdxBarControl): TdxSkinElement; + + function IsBarElementSkinned(ABarControl: TCustomdxBarControl): Boolean; + + procedure DrawArrowButtonElement(AElement: TdxSkinElement; ACanvas: TcxCanvas; + const ARect: TRect; AImageIndex: Integer = 0; AState: TdxSkinElementState = esNormal); + + // Bar + procedure DrawFloatingBarCaptionButton(DC: HDC; ARect: TRect; AContentType: Integer; AState: TdxBarMarkState); + procedure InternalDrawDockedBarBackground(ABarControl: TdxBarControl; ACanvas: TcxCanvas; R: TRect; AClientArea: Boolean); + + // ButtonLikeControl + function ButtonLikeControlGetState(const ADrawParams: TdxBarButtonLikeControlDrawParams): TdxSkinElementState; + protected + // Common + // Attributes + function GetDefaultEnabledTextColor(ABarItemControl: TdxBarItemControl; + ASelected, AFlat: Boolean): TColor; override; + procedure GetDisabledTextColors(ABarItemControl: TdxBarItemControl; + ASelected, AFlat: Boolean; var AColor1, AColor2: TColor); override; + // Conditions + class function UseTextColorForItemArrow: Boolean; override; + // Draw + procedure DrawGlyphEmptyImage(ABarItemControl: TdxBarItemControl; DC: HDC; R: TRect; + APaintType: TdxBarPaintType; ADown: Boolean); override; + procedure DrawGlyphBorder(ABarItemControl: TdxBarItemControl; DC: HDC; ABrush: HBRUSH; + NeedBorder: Boolean; R: TRect; PaintType: TdxBarPaintType; IsGlyphEmpty, + Selected, Down, DrawDowned, ADroppedDown, IsSplit: Boolean); override; + + // Bar + // Attributes + function BarCaptionColor(ABarControl: TdxBarControl): COLORREF; override; + // Positions + class procedure BarOffsetFloatingBarCaption(ABarControl: TdxBarControl; + var X: Integer; var R: TRect); override; + // Draw + procedure BarDrawGrip(ABarControl: TdxBarControl; DC: HDC; R: TRect; + AToolbarBrush: HBRUSH); override; + procedure BarDrawMarkBackground(ABarControl: TdxBarControl; DC: HDC; + ItemRect: TRect; AToolbarBrush: HBRUSH); override; + + // SubMenuControl + procedure SubMenuControlDrawMarkSelection(ABarSubMenuControl: TdxBarSubMenuControl; + ADC: HDC; const AMarkRect: TRect); override; + + // Hints + function CreateHintViewInfo(ABarManager: TdxBarManager; AHintText: string; const AShortCut: string; + AScreenTip: TdxBarScreenTip): TdxBarCustomHintViewInfo; override; + + property Bar[AIsVertical: Boolean]: TdxSkinElement read GetBar; + property BarCustomize[AIsVertical: Boolean]: TdxSkinElement read GetBarCustomize; + property BarDisabledTextColor: TdxSkinColor read GetBarDisabledTextColor; + property BarDrag[AIsVertical: Boolean]: TdxSkinElement read GetBarDrag; + property BarSeparator[AIsVertical: Boolean]: TdxSkinElement read GetBarSeparator; + property Dock: TdxSkinElement read GetDock; + property DockControlWindowButton: TdxSkinElement read GetDockControlWindowButton; + property DockControlWindowButtonGlyph: TdxSkinElement read GetDockControlWindowButtonGlyph; + property FloatingBar: TdxSkinElement read GetFloatingBar; + property LinkBorderPainter: TdxSkinElement read GetLinkBorderPainter; + property LinkSelected: TdxSkinElement read GetLinkSelected; + property MainMenu[AIsVertical: Boolean]: TdxSkinElement read GetMainMenu; + property MainMenuCustomize[AIsVertical: Boolean]: TdxSkinElement read GetMainMenuCustomize; + property MainMenuDrag[AIsVertical: Boolean]: TdxSkinElement read GetMainMenuDrag; + property MainMenuLinkSelected: TdxSkinElement read GetMainMenuLinkSelected; + property PopupMenu: TdxSkinElement read GetPopupMenu; + property PopupMenuCheck: TdxSkinElement read GetPopupMenuCheck; + property PopupMenuExpandButton: TdxSkinElement read GetPopupMenuExpandButton; + property PopupMenuLinkSelected: TdxSkinElement read GetPopupMenuLinkSelected; + property PopupMenuSeparator: TdxSkinElement read GetPopupMenuSeparator; + property PopupMenuSideStrip: TdxSkinElement read GetPopupMenuSideStrip; + property PopupMenuSideStripNonRecent: TdxSkinElement read GetPopupMenuSideStripNonRecent; + property PopupMenuSplitButton: TdxSkinElement read GetPopupMenuSplitButton; + property PopupMenuSplitButton2: TdxSkinElement read GetPopupMenuSplitButton2; + property StatusBar: TdxSkinElement read GetStatusBar; + property ScreenTipItem: TdxSkinColor read GetScreenTipItem; + property ScreenTipSeparator: TdxSkinElement read GetScreenTipSeparator; + property ScreenTipTitleItem: TdxSkinColor read GetScreenTipTitleItem; + property ScreenTipWindow: TdxSkinElement read GetScreenTipWindow; + public + constructor Create(AData: Integer); override; + + // Common + // Conditions + class function IsFlatGlyphImage: Boolean; override; + class function IsFlatItemText: Boolean; override; + function IsCustomSelectedTextColorExists(ABarItemControl: TdxBarItemControl): Boolean; override; + // Draw + procedure DrawItemBackgroundInSubMenu(const ADrawParams: TdxBarButtonLikeControlDrawParams; R: TRect); override; + + // BarManager + function GripperSize(ABarControl: TdxBarControl): Integer; override; + class function BorderSizeX: Integer; override; + class function BorderSizeY: Integer; override; + function FingersSize(ABarControl: TdxBarControl): Integer; override; + class function SubMenuBeginGroupIndent: Integer; override; + + // Bar + //Conditions + class function BarCaptionTransparent: Boolean; override; + // Sizes + function BarBeginGroupSize: Integer; override; + procedure BarBorderPaintSizes(ABarControl: TdxBarControl; var R: TRect); override; + procedure BarBorderSizes(ABar: TdxBar; AStyle: TdxBarDockingStyle; var R: TRect); override; + function BarMarkItemRect(ABarControl: TdxBarControl): TRect; override; + function BarMarkRect(ABarControl: TdxBarControl): TRect; override; + function MarkSizeX(ABarControl: TdxBarControl): Integer; override; + function StatusBarBorderOffsets: TRect; override; + class function StatusBarTopBorderSize: Integer; override; + function StatusBarGripSize(ABarManager: TdxBarManager): TSize; override; + // Draw + procedure BarCaptionFillBackground(ABarControl: TdxBarControl; DC: HDC; + R: TRect; AToolbarBrush: HBRUSH); override; + procedure BarDrawBeginGroup(ABarControl: TCustomdxBarControl; DC: HDC; + ABeginGroupRect: TRect; AToolbarBrush: HBRUSH; AHorz: Boolean); override; + procedure BarDrawCloseButton(ABarControl: TdxBarControl; DC: HDC; R: TRect); override; + procedure BarDrawDockedBarBorder(ABarControl: TdxBarControl; DC: HDC; R: TRect; + AToolbarBrush: HBRUSH); override; + procedure BarDrawFloatingBarBorder(ABarControl: TdxBarControl; DC: HDC; + R, CR: TRect; AToolbarBrush: HBRUSH); override; + procedure BarDrawFloatingBarCaption(ABarControl: TdxBarControl; DC: HDC; + R, CR: TRect; AToolbarBrush: HBRUSH); override; + procedure BarDrawMDIButton(ABarControl: TdxBarControl; AButton: TdxBarMDIButton; + AState: Integer; DC: HDC; R: TRect); override; + procedure BarDrawStatusBarBorder(ABarControl: TdxBarControl; DC: HDC; + R: TRect; AToolbarBrush: HBRUSH); override; + procedure BarMarkRectInvalidate(ABarControl: TdxBarControl); override; + procedure StatusBarFillBackground(ABarControl: TdxBarControl; DC: HDC; + ADestR, ASourceR, AWholeR: TRect; ABrush: HBRUSH; AColor: TColor); override; + + // DockControl + procedure DockControlFillBackground(ADockControl: TdxDockControl; + DC: HDC; ADestR, ASourceR, AWholeR: TRect; ABrush: HBRUSH; AColor: TColor); override; + class function IsNativeBackground: Boolean; override; + + // CustomBar + // Sizes + class function BarDockedGetRowIndent: Integer; override; + function ComboBoxArrowWidth(ABarControl: TCustomdxBarControl; cX: Integer): Integer; override; + // Draw + procedure BarDrawDockedBackground(ABarControl: TdxBarControl; DC: HDC; + ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); override; + procedure BarDrawFloatingBackground(ABarControl: TCustomdxBarControl; DC: HDC; + ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); override; + + // SubMenuControl + // Conditions + class function SubMenuControlHasBand: Boolean; override; + // Sizes + class function SubMenuControlArrowsOffset: Integer; override; + function SubMenuControlBeginGroupRect( + ABarSubMenuControl: TdxBarSubMenuControl; AControl: TdxBarItemControl; + const AItemRect: TRect): TRect; override; + function SubMenuControlBeginGroupSize: Integer; override; + procedure SubMenuControlCalcDrawingConsts(ACanvas: TcxCanvas; + ATextSize: Integer; out AMenuArrowWidth, AMarkSize: Integer); override; + class function SubMenuControlDetachCaptionAreaSize(ABarSubMenuControl: TdxBarSubMenuControl): Integer; override; + class procedure SubMenuControlOffsetDetachCaptionRect(ABarSubMenuControl: TdxBarSubMenuControl; + var R: TRect); override; + // Positions + class function SubMenuControlGetItemTextIndent(const ADrawParams: TdxBarItemControlDrawParams): Integer; override; + // Draw + procedure SubMenuControlDrawBeginGroup(ABarSubMenuControl: TdxBarSubMenuControl; + AControl: TdxBarItemControl; ACanvas: TcxCanvas; const ABeginGroupRect: TRect); override; + procedure SubMenuControlDrawBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); override; + procedure SubMenuControlDrawClientBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; const R: TRect; ABrush: HBRUSH); override; + procedure SubMenuControlDrawBackground(ABarSubMenuControl: TdxBarSubMenuControl; + ACanvas: TcxCanvas; ARect: TRect; ABrush: HBRUSH; AColor: TColor); override; + procedure SubMenuControlDrawDetachCaption(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); override; + procedure SubMenuControlDrawMarkContent(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect; ASelected: Boolean); override; + procedure SubMenuControlDrawSeparator(ACanvas: TcxCanvas; const ARect: TRect); override; + + // Mark + // Draw + procedure BarDrawMark(ABarControl: TdxBarControl; DC: HDC; MarkR: TRect); override; + procedure BarDrawMarkElements(ABarControl: TdxBarControl; DC: HDC; + ItemRect: TRect); override; + + // QuickCustItem + // Conditions + class function IsQuickControlPopupOnRight: Boolean; override; + + // Button Control + // Conditions + function IsButtonControlArrowBackgroundOpaque(const ADrawParams: TdxBarButtonLikeControlDrawParams): Boolean; override; + function IsButtonControlArrowDrawSelected(const ADrawParams: TdxBarButtonLikeControlDrawParams): Boolean; override; + function IsDropDownRepaintNeeded: Boolean; override; + // Sizes + class procedure CorrectButtonControlDefaultHeight(var DefaultHeight: Integer); override; + class procedure CorrectButtonControlDefaultWidth(var DefaultWidth: Integer); override; + // Draw + procedure DrawButtonControlArrowBackground(const ADrawParams: TdxBarButtonLikeControlDrawParams; + var R1: TRect; ABrush: HBRUSH); override; + + // ColorCombo + // Conditions + function ColorComboHasCompleteFrame: Boolean; override; + // Sizes + function GetCustomColorButtonIndents(APaintType: TdxBarPaintType): TRect; override; + function GetCustomColorButtonWidth(APaintType: TdxBarPaintType; const ARect: TRect): Integer; override; + // Draw + procedure ColorComboDrawCustomButton(const ADrawParams: TdxBarColorComboControlDrawParams; ARect: TRect); override; + procedure ColorComboDrawCustomButtonAdjacentZone(const ADrawParams: TdxBarColorComboControlDrawParams; ARect: TRect); override; + + // EditControl + // Conditions + class function EditControlCaptionBackgroundIsOpaque(const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; override; + class function EditControlCaptionRightIndentIsOpaque(const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; override; + // Sizes + class function EditControlBorderOffsets(APaintType: TdxBarPaintType): TRect; override; + // Draw + procedure EditControlDrawBackground(const ADrawParams: TdxBarEditLikeControlDrawParams); override; + procedure EditControlDrawBorder(const ADrawParams: TdxBarEditLikeControlDrawParams; var ARect: TRect); override; + procedure EditControlDrawSelectionFrame(const ADrawParams: TdxBarEditLikeControlDrawParams; const ARect: TRect); override; + // Select EditControl indents + class function EditControlCaptionAbsoluteLeftIndent(const ADrawParams: TdxBarEditLikeControlDrawParams): Integer; override; + + // CustomCombo + class procedure CustomComboDrawItem(ABarCustomCombo: TdxBarCustomCombo; + ACanvas: TCanvas; AIndex: Integer; ARect: TRect; AState: TOwnerDrawState; + AInteriorIsDrawing: Boolean); override; + + // ComboControl + // Sizes + class function ComboControlArrowOffset: Integer; override; + // Draw + procedure ComboControlDrawArrowButton(const ADrawParams: TdxBarEditLikeControlDrawParams; ARect: TRect; AInClientArea: Boolean); override; + + // DateNavigator + // Conditions + class function IsDateNavigatorFlat: Boolean; override; + // Attributes + function DateNavigatorHeaderColor: TColor; override; + // Draw + procedure DateNavigatorDrawButton(ABarItem: TdxBarItem; + DC: HDC; R: TRect; const ACaption: string; APressed: Boolean); override; + + // InPlaceSubItemControl + // Conditions + function InPlaceSubItemControlIsArrowSelected(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams): Boolean; override; + // Draw + procedure InPlaceSubItemControlDrawBackground(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams; ARect: TRect); override; + + // SpinEditControl + // Sizes + function GetSpinEditButtonWidth(APaintType: TdxBarPaintType; const ARect: TRect): Integer; override; + function GetSpinEditButtonIndents(APaintType: TdxBarPaintType): TRect; override; + // Draw + procedure SpinEditControlDrawButton(const ADrawParams: TdxBarSpinEditDrawParams; ARect: TRect; AButtonIndex: Integer); override; + procedure SpinEditControlDrawButtonsAdjacentZone(const ADrawParams: TdxBarSpinEditDrawParams; const ARect: TRect); override; + // Others + procedure CalculateSpinEditParts(const ADrawParams: TdxBarSpinEditDrawParams; + var AParts: array of TRect; const AItemRect: TRect); override; + procedure SpinEditCorrectFrameRect(const ADrawParams: TdxBarItemControlDrawParams; var ARect: TRect); override; + + // ProgressControl + // Sizes + function ProgressControlBarHeight(ABarItemControl: TdxBarItemControl): Integer; override; + class function ProgressControlIndent(const ADrawParams: TdxBarItemControlDrawParams): Integer; override; + // Draw + procedure ProgressControlDrawBackground(const ADrawParams: TdxBarItemControlDrawParams; var BarR: TRect); override; + procedure ProgressControlFillContent(const ADrawParams: TdxBarItemControlDrawParams; const R: TRect; ABarBrush: HBRUSH); override; + + // StaticControl + // Sizes + function StaticControlGetBorderOffsets(AParent: TCustomdxBarControl; ABorderStyle: TdxBarStaticBorderStyle): TRect; override; + // Draw + procedure DrawStaticBackground(const ADrawParams: TdxBarStaticLikeControlDrawParams; ARect: TRect); override; + procedure DrawStaticBorder(const ADrawParams: TdxBarStaticLikeControlDrawParams; var ARect: TRect); override; + + // Separator + // Sizes + function SubMenuGetSeparatorSize: Integer; override; + // Draw + procedure DrawSeparatorGlyphAndCaption(const ADrawParams: TdxBarSeparatorControlDrawParams; const ARect: TRect); override; + + // ScreenTips + // Attributes + function ScreenTipGetDescriptionTextColor: TColor; override; + function ScreenTipGetTitleTextColor: TColor; override; + // Size + function ScreenTipGetFooterLineSize: Integer; override; + // Draw + procedure ScreenTipDrawBackground(ACanvas: TcxCanvas; ARect: TRect); override; + procedure ScreenTipDrawFooterLine(ACanvas: TcxCanvas; const ARect: TRect); override; + end; + +implementation + +uses + Math, dxOffice11, dxBarSkinConsts, dxSkinsStrs; + +type + TdxBarAccess = class(TdxBar); + TCustomdxBarControlAccess = class(TCustomdxBarControl); + TdxBarControlAccess = class(TdxBarControl); + TdxBarSubMenuControlAccess = class(TdxBarSubMenuControl); + TdxBarItemControlAccess = class(TdxBarItemControl); + TdxBarEditControlAccess = class(TdxBarEditControl); + TdxBarDockControlAccess = class(TdxBarDockControl); + +{TdxBarSkinPainter} + +constructor TdxBarSkinPainter.Create(AData: Integer); +begin + inherited Create(AData); + FSkinPainter := TcxCustomLookAndFeelPainterClass(AData); +end; + +class function TdxBarSkinPainter.IsFlatGlyphImage: Boolean; +begin + Result := True; +end; + +class function TdxBarSkinPainter.IsFlatItemText: Boolean; +begin + Result := True; +end; + +function TdxBarSkinPainter.IsCustomSelectedTextColorExists(ABarItemControl: TdxBarItemControl): Boolean; +begin + Result := IsBarElementSkinned(ABarItemControl.Parent) and (GetSkinElementTextColorHot(GetTextColorElement(ABarItemControl.Parent)) <> nil); +end; + +procedure TdxBarSkinPainter.DrawItemBackgroundInSubMenu(const ADrawParams: TdxBarButtonLikeControlDrawParams; R: TRect); +var + ASkinElement: TdxSkinElement; +begin + with ADrawParams do + begin + R := BarItemControl.ItemBounds; // because quickcontrolitem draw before + DrawBackground(BarItemControl, Canvas.Handle, R, 0, False); + if DrawSelected then + begin + if IsDropDown and SplitDropDown then + begin + ASkinElement := PopupMenuSplitButton; + Dec(R.Right, ArrowSize.cx); + end + else + ASkinElement := PopupMenuLinkSelected; + DrawSkinElement(ASkinElement, Canvas.Handle, R, 0, ButtonLikeControlGetState(ADrawParams)); + end; + end; +end; + +function TdxBarSkinPainter.GripperSize(ABarControl: TdxBarControl): Integer; +var + ABarControlAccess: TdxBarControlAccess; +begin + Result := 0; + ABarControlAccess := TdxBarControlAccess(ABarControl); + if GetBarDragElement(ABarControl) <> nil then + Result := GetSkinElementSize(GetBarDragElement(ABarControlAccess.IsMainMenu, False)).cx; +end; + +class function TdxBarSkinPainter.BorderSizeX: Integer; +begin + Result := 2; +end; + +class function TdxBarSkinPainter.BorderSizeY: Integer; +begin + Result := 2; +end; + +function TdxBarSkinPainter.FingersSize(ABarControl: TdxBarControl): Integer; +begin + Result := GripperSize(ABarControl); +end; + +class function TdxBarSkinPainter.SubMenuBeginGroupIndent: Integer; +begin + Result := TdxBarFlatPainter.SubMenuBeginGroupIndent; +end; + +class function TdxBarSkinPainter.BarCaptionTransparent: Boolean; +begin + Result := True; // TdxBarXPPainter +end; + +function TdxBarSkinPainter.BarBeginGroupSize: Integer; +begin + Result := GetSkinElementSize(BarSeparator[False]).cx; +end; + +procedure TdxBarSkinPainter.BarBorderPaintSizes(ABarControl: TdxBarControl; var R: TRect); +var + ABarControlAccess: TdxBarControlAccess; + ABarAccess: TdxBarAccess; +begin + ABarControlAccess := TdxBarControlAccess(ABarControl); + ABarAccess := TdxBarAccess(ABarControlAccess.Bar); + BarBorderSizes(ABarAccess, ABarAccess.DockingStyle, R); + if ABarControlAccess.CanMoving then + if ABarControlAccess.Vertical then + Inc(R.Top, FingersSize(ABarControlAccess)) + else + Inc(R.Left, FingersSize(ABarControlAccess)); +end; + +procedure TdxBarSkinPainter.BarBorderSizes(ABar: TdxBar; AStyle: TdxBarDockingStyle; var R: TRect); +begin + R := cxEmptyRect; + if IsBarElementSkinned(ABar.Control) then + R := GetBarElement(ABar.Control).ContentOffset.Rect; +end; + +function TdxBarSkinPainter.BarMarkItemRect(ABarControl: TdxBarControl): TRect; +var + ABarControlAccess: TdxBarControlAccess; + ABarAccess: TdxBarAccess; + ABorderOffsets: TRect; +begin + ABarControlAccess := TdxBarControlAccess(ABarControl); + ABarAccess := TdxBarAccess(ABarControlAccess.Bar); + + Result := inherited BarMarkItemRect(ABarControl); + ABorderOffsets := cxEmptyRect; + + if (ABarControlAccess.DockingStyle <> dsNone) and + not ABarAccess.IsStatusBar then + begin + BarBorderSizes(ABarAccess, ABarAccess.DockingStyle, ABorderOffsets); + if ABarControl.IsRealVertical then + begin + OffsetRect(Result, 0, ABorderOffsets.Bottom); + Result := cxRectInflate(Result, ABorderOffsets.Left, 0, ABorderOffsets.Right, 0); + end + else + begin + OffsetRect(Result, ABorderOffsets.Right, 0); + Result := cxRectInflate(Result, 0, ABorderOffsets.Top, 0, ABorderOffsets.Bottom); + end; + end; + + if ABarAccess.IsStatusBar then + begin + ABorderOffsets := StatusBarBorderOffsets; + ABorderOffsets.Left := 0; + Result := cxRectContent(Result, cxRectInvert(ABorderOffsets)); + end; +end; + +function TdxBarSkinPainter.BarMarkRect(ABarControl: TdxBarControl): TRect; +var + ABarControlAccess: TdxBarControlAccess; + ABarAccess: TdxBarAccess; + ABorderOffsets: TRect; +begin + ABarControlAccess := TdxBarControlAccess(ABarControl); + ABarAccess := TdxBarAccess(ABarControlAccess.Bar); + if ABarAccess.BorderStyle = bbsNone then + begin + Result := inherited BarMarkItemRect(ABarControl); + if not ABarAccess.IsStatusBar then + begin + BarBorderSizes(ABarAccess, ABarAccess.DockingStyle, ABorderOffsets); + if ABarControlAccess.Vertical then + Inc(Result.Top, ABorderOffsets.Bottom) + else + Inc(Result.Left, ABorderOffsets.Right); + end; + end + else + Result := BarMarkItemRect(ABarControl); +end; + +function TdxBarSkinPainter.MarkSizeX(ABarControl: TdxBarControl): Integer; +var + ABarControlAccess: TdxBarControlAccess; +begin + ABarControlAccess := TdxBarControlAccess(ABarControl); + Result := GetSkinElementSize(GetBarMarkElement(ABarControlAccess.IsMainMenu, False)).cx; +end; + +function TdxBarSkinPainter.StatusBarBorderOffsets: TRect; +begin + if StatusBar <> nil then + Result := StatusBar.ContentOffset.Rect + else + Result := inherited StatusBarBorderOffsets; +end; + +class function TdxBarSkinPainter.StatusBarTopBorderSize: Integer; +begin + Result := 0; +end; + +function TdxBarSkinPainter.StatusBarGripSize(ABarManager: TdxBarManager): TSize; +begin + Result := FSkinPainter.SizeGripSize; +end; + +procedure TdxBarSkinPainter.BarCaptionFillBackground(ABarControl: TdxBarControl; DC: HDC; + R: TRect; AToolbarBrush: HBRUSH); +begin + if FloatingBar <> nil then + FillRectByColor(DC, R, FloatingBar.Color) + else + inherited; +end; + +procedure TdxBarSkinPainter.BarDrawBeginGroup(ABarControl: TCustomdxBarControl; DC: HDC; + ABeginGroupRect: TRect; AToolbarBrush: HBRUSH; AHorz: Boolean); +begin + TdxBarControlAccess(ABarControl).FillBackground(DC, ABeginGroupRect, 0, clNone, True); + DrawSkinElement(BarSeparator[AHorz], DC, ABeginGroupRect); +end; + +procedure TdxBarSkinPainter.BarDrawCloseButton(ABarControl: TdxBarControl; DC: HDC; R: TRect); +begin + BarCanvas.BeginPaint(DC); + try + BarCanvas.SetClipRegion(TcxRegion.Create(R), roIntersect); + BarCaptionFillBackground(ABarControl, BarCanvas.Handle, R, 0); + DrawFloatingBarCaptionButton(BarCanvas.Handle, R, 2, TdxBarControlAccess(ABarControl).CloseButtonState); + finally + BarCanvas.EndPaint; + end; +end; + +procedure TdxBarSkinPainter.BarDrawDockedBarBorder(ABarControl: TdxBarControl; DC: HDC; R: TRect; + AToolbarBrush: HBRUSH); +var + ABarControlAccess: TdxBarControlAccess; +begin + ABarControlAccess := TdxBarControlAccess(ABarControl); + BarCanvas.BeginPaint(DC); + try + BarCanvas.SetClipRegion(TcxRegion.Create(ABarControlAccess.ClientBounds), roSubtract); + InternalDrawDockedBarBackground(ABarControl, BarCanvas, R, False); + finally + BarCanvas.EndPaint; + end; +end; + +procedure TdxBarSkinPainter.BarDrawFloatingBarBorder(ABarControl: TdxBarControl; DC: HDC; + R, CR: TRect; AToolbarBrush: HBRUSH); +var + ABorderKind: TcxBorder; +begin + if FloatingBar <> nil then + begin + for ABorderKind := Low(TcxBorder) to High(TcxBorder) do + FloatingBar.Borders.Items[ABorderKind].Draw(DC, R); + InflateRect(R, -1, -1); + FrameRectByColor(DC, R, FloatingBar.Color); + end + else + inherited; +end; + +procedure TdxBarSkinPainter.BarDrawFloatingBarCaption(ABarControl: TdxBarControl; DC: HDC; + R, CR: TRect; AToolbarBrush: HBRUSH); +begin + if FloatingBar <> nil then + AToolbarBrush := CreateSolidBrush(FloatingBar.Color) + else + AToolbarBrush := 0; + inherited; + DeleteObject(AToolbarBrush); +end; + +procedure TdxBarSkinPainter.BarDrawMDIButton(ABarControl: TdxBarControl; AButton: TdxBarMDIButton; + AState: Integer; DC: HDC; R: TRect); + + function GetSkinElementState: TdxSkinElementState; + begin + case AState of + DXBAR_DISABLED: + Result := esDisabled; + DXBAR_HOT: + Result := esHot; + DXBAR_PRESSED: + Result := esPressed; + else{DXBAR_NORMAL, DXBAR_ACTIVE} + Result := esActive; + end; + end; + +begin + TdxBarControlAccess(ABarControl).FillBackground(DC, R, 0, clNone, True); + DrawSkinElement(DockControlWindowButton, DC, R, 0, GetSkinElementState); + DrawSkinElement(DockControlWindowButtonGlyph, DC, R, Ord(AButton)); +end; + +procedure TdxBarSkinPainter.BarDrawStatusBarBorder(ABarControl: TdxBarControl; DC: HDC; + R: TRect; AToolbarBrush: HBRUSH); +begin + DrawSkinElementBorders(StatusBar, DC, R); +end; + +procedure TdxBarSkinPainter.BarMarkRectInvalidate(ABarControl: TdxBarControl); +begin + inherited; + if TdxBarControlAccess(ABarControl).DockingStyle <> dsNone then // TdxOffice11Painter + SendMessage(ABarControl.Handle, WM_NCPAINT, 0, 0); +end; + +procedure TdxBarSkinPainter.StatusBarFillBackground(ABarControl: TdxBarControl; DC: HDC; + ADestR, ASourceR, AWholeR: TRect; ABrush: HBRUSH; AColor: TColor); +begin + BarCanvas.BeginPaint(DC); + try + BarCanvas.SetClipRegion(TcxRegion.Create(ADestR), roIntersect); + OffsetRect(AWholeR, -(ASourceR.Left - ADestR.Left), -(ASourceR.Top - ADestR.Top)); + BarFillParentBackground(ABarControl, BarCanvas.Handle, AWholeR, AWholeR, 0, clNone); + DrawSkinElement(StatusBar, BarCanvas.Handle, AWholeR); + finally + BarCanvas.EndPaint; + end; +end; + +procedure TdxBarSkinPainter.DockControlFillBackground(ADockControl: TdxDockControl; + DC: HDC; ADestR, ASourceR, AWholeR: TRect; ABrush: HBRUSH; AColor: TColor); + + procedure FillBackgroundTempBitmap(ABitmap: TBitmap); + begin + ABitmap.Width := cxRectWidth(AWholeR); + ABitmap.Height := cxRectHeight(AWholeR); + DrawSkinElement(Dock, ABitmap.Canvas.Handle, AWholeR); + end; + +var + ADockControlAccess: TdxBarDockControlAccess; +begin + ADockControlAccess := TdxBarDockControlAccess(ADockControl); + if ADockControlAccess.BackgroundTempBitmap.Empty then + FillBackgroundTempBitmap(ADockControlAccess.BackgroundTempBitmap); + cxBitBlt(DC, ADockControlAccess.BackgroundTempBitmap.Canvas.Handle, ADestR, ASourceR.TopLeft, SRCCOPY); +end; + +class function TdxBarSkinPainter.IsNativeBackground: Boolean; +begin + Result := True; // TdxBarXPPainter +end; + +class function TdxBarSkinPainter.BarDockedGetRowIndent: Integer; +begin + Result := 1 +end; + +function TdxBarSkinPainter.ComboBoxArrowWidth(ABarControl: TCustomdxBarControl; cX: Integer): Integer; +begin + Result := cX + 11; +end; + +procedure TdxBarSkinPainter.BarDrawDockedBackground(ABarControl: TdxBarControl; DC: HDC; + ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); +var + AWholeR: TRect; + ABarControlAccess: TdxBarControlAccess; +begin + ABarControlAccess := TdxBarControlAccess(ABarControl); + if (ABarControlAccess.Bar.BorderStyle = bbsNone) or + ABarControlAccess.IsBackgroundBitmap then + inherited + else + begin + BarCanvas.BeginPaint(DC); + try + BarCanvas.SetClipRegion(TcxRegion.Create(ADestR), roIntersect); + AWholeR := Rect(0, 0, ABarControl.Width, ABarControl.Height); + OffsetRect(AWholeR, -(ASourceR.Left - ADestR.Left), -(ASourceR.Top - ADestR.Top)); + InternalDrawDockedBarBackground(ABarControl, BarCanvas, AWholeR, not cxRectIsEqual(ASourceR, ADestR)); + finally + BarCanvas.EndPaint; + end; + end; +end; + +procedure TdxBarSkinPainter.BarDrawFloatingBackground(ABarControl: TCustomdxBarControl; DC: HDC; + ADestR, ASourceR: TRect; ABrush: HBRUSH; AColor: TColor); +begin + if TdxBarControlAccess(ABarControl).IsBackgroundBitmap then + inherited + else + begin + BarCanvas.BeginPaint(DC); + try + BarCanvas.SetClipRegion(TcxRegion.Create(ADestR), roIntersect); + DrawSkinElement(FloatingBar, BarCanvas.Handle, ABarControl.ClientRect); + finally + BarCanvas.EndPaint; + end; + end; +end; + +class function TdxBarSkinPainter.SubMenuControlHasBand: Boolean; +begin + Result := True; +end; + +class function TdxBarSkinPainter.SubMenuControlArrowsOffset: Integer; +begin + Result := 1; // TdxBarXPPainter +end; + +function TdxBarSkinPainter.SubMenuControlBeginGroupRect( + ABarSubMenuControl: TdxBarSubMenuControl; AControl: TdxBarItemControl; + const AItemRect: TRect): TRect; +begin + Result := AItemRect; + Result.Bottom := Result.Top; + Dec(Result.Top, TdxBarSubMenuControlAccess(ABarSubMenuControl).BeginGroupSize); // TdxBarXPPainter +end; + +function TdxBarSkinPainter.SubMenuControlBeginGroupSize: Integer; +begin + Result := GetSkinElementSize(PopupMenuSeparator).cy; +end; + +procedure TdxBarSkinPainter.SubMenuControlCalcDrawingConsts(ACanvas: TcxCanvas; + ATextSize: Integer; out AMenuArrowWidth, AMarkSize: Integer); +begin + inherited; + if PopupMenuExpandButton <> nil then + AMarkSize := GetSkinElementSize(PopupMenuExpandButton).cy; +end; + +class function TdxBarSkinPainter.SubMenuControlDetachCaptionAreaSize(ABarSubMenuControl: TdxBarSubMenuControl): Integer; +begin + Result := TdxBarSubMenuControlAccess(ABarSubMenuControl).DetachCaptionSize + 1;// TdxBarXPPainter +end; + +class procedure TdxBarSkinPainter.SubMenuControlOffsetDetachCaptionRect(ABarSubMenuControl: TdxBarSubMenuControl; + var R: TRect); +begin + InflateRect(R, -2, -2);// TdxBarXPPainter +end; + +class function TdxBarSkinPainter.SubMenuControlGetItemTextIndent(const ADrawParams: TdxBarItemControlDrawParams): Integer; +begin + Result := TdxBarFlatPainter.SubMenuControlGetItemTextIndent(ADrawParams); +end; + +procedure TdxBarSkinPainter.SubMenuControlDrawBeginGroup(ABarSubMenuControl: TdxBarSubMenuControl; + AControl: TdxBarItemControl; ACanvas: TcxCanvas; const ABeginGroupRect: TRect); +var + ARect: TRect; +begin + with ABeginGroupRect do + ARect := cxRect(Left + SubMenuBeginGroupIndent + TdxBarItemControlAccess(AControl).TextAreaOffset, + Bottom - SubMenuGetSeparatorSize, + Right, + Bottom); + DrawBackground(AControl, ACanvas.Handle, ABeginGroupRect, 0, False); + DrawSkinElement(PopupMenuSeparator, ACanvas.Handle, ARect); +end; + +procedure TdxBarSkinPainter.SubMenuControlDrawBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); +var + AContentRect: TRect; + ABarSubmenuControlAccess: TdxBarSubMenuControlAccess; +begin + ABarSubmenuControlAccess := TdxBarSubMenuControlAccess(ABarSubMenuControl); + BarCanvas.BeginPaint(DC); + try + AContentRect := cxRectOffset(ABarSubmenuControlAccess.ContentRect, ABarSubmenuControlAccess.GetClientOffset.TopLeft); + BarCanvas.ExcludeClipRect(AContentRect); + DrawSkinElement(PopupMenu, DC, R); + SubMenuControlDrawDetachCaption(ABarSubMenuControl, DC, ABarSubmenuControlAccess.DetachCaptionRect); + finally + BarCanvas.EndPaint; + end; +end; + +procedure TdxBarSkinPainter.SubMenuControlDrawClientBorder(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; const R: TRect; ABrush: HBRUSH); +begin + // do nothing +end; + +procedure TdxBarSkinPainter.SubMenuControlDrawBackground(ABarSubMenuControl: TdxBarSubMenuControl; + ACanvas: TcxCanvas; ARect: TRect; ABrush: HBRUSH; AColor: TColor); +var + ASubMenuControlAccess: TdxBarSubMenuControlAccess; + ASideStripElement: TdxSkinElement; + AContentRect, ABarRect, ABandRect, ASeparatorRect: TRect; +begin + if not TdxBarSubMenuControlAccess(ABarSubMenuControl).GetBackgroundBitmap.Empty then + inherited + else + begin + ASubMenuControlAccess := TdxBarSubMenuControlAccess(ABarSubMenuControl); + AContentRect := ASubMenuControlAccess.ContentRect; + + ABarRect := ASubMenuControlAccess.BarRect; + + ABandRect := Rect(ABarRect.Right, AContentRect.Top, + ABarRect.Right + ASubMenuControlAccess.BandSize + ASubMenuControlAccess.GetIndent2, AContentRect.Bottom); + + ASeparatorRect := Rect(ABandRect.Right, AContentRect.Top, + ABandRect.Right + 2, AContentRect.Bottom); // dxBar.MenuSeparatorSize = 2 + + ABandRect.Right := ABandRect.Right + cxRectWidth(ASeparatorRect); + + if ASubMenuControlAccess.NonRecent then + ASideStripElement := PopupMenuSideStripNonRecent + else + ASideStripElement := PopupMenuSideStrip; + + DrawSkinElement(PopupMenu, ACanvas.Handle, cxRectInflate(ASubMenuControlAccess.ContentRect, + SubMenuControlBorderSize, SubMenuControlBorderSize)); + DrawSkinElement(ASideStripElement, ACanvas.Handle, ABandRect); + end; +end; + +procedure TdxBarSkinPainter.SubMenuControlDrawDetachCaption(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect); +begin + DrawSkinElement(PopupMenuSeparator, DC, R); +end; + +procedure TdxBarSkinPainter.SubMenuControlDrawMarkContent(ABarSubMenuControl: TdxBarSubMenuControl; + DC: HDC; R: TRect; ASelected: Boolean); +begin + DrawSkinElement(PopupMenuExpandButton, DC, R); +end; + +procedure TdxBarSkinPainter.SubMenuControlDrawSeparator(ACanvas: TcxCanvas; const ARect: TRect); +begin + DrawSkinElement(PopupMenuSeparator, ACanvas.Handle, ARect); +end; + +procedure TdxBarSkinPainter.BarDrawMark(ABarControl: TdxBarControl; DC: HDC; MarkR: TRect); +begin + BarCanvas.BeginPaint(DC); + try + BarCanvas.SetClipRegion(TcxRegion.Create(MarkR), roIntersect); + BarCaptionFillBackground(ABarControl, BarCanvas.Handle, MarkR, 0); + DrawFloatingBarCaptionButton(BarCanvas.Handle, MarkR, 6, TdxBarControlAccess(ABarControl).MarkState); + finally + BarCanvas.EndPaint; + end; +end; + +procedure TdxBarSkinPainter.BarDrawMarkElements(ABarControl: TdxBarControl; DC: HDC; + ItemRect: TRect); +const + States: array [Boolean] of TdxSkinElementState = (esNormal, esHot); +var + ABarControlAccess: TdxBarControlAccess; +begin + ABarControlAccess := TdxBarControlAccess(ABarControl); + DrawSkinElement(GetBarMarkElement(ABarControlAccess), DC, ItemRect, 0, + States[ABarControlAccess.MarkState <> msNone]); +end; + +class function TdxBarSkinPainter.IsQuickControlPopupOnRight: Boolean; +begin + Result := True; // TdxBarXPPainter +end; + +function TdxBarSkinPainter.IsButtonControlArrowBackgroundOpaque(const ADrawParams: TdxBarButtonLikeControlDrawParams): Boolean; +begin + Result := False; +end; + +function TdxBarSkinPainter.IsButtonControlArrowDrawSelected(const ADrawParams: TdxBarButtonLikeControlDrawParams): Boolean; +begin + Result := False; +end; + +function TdxBarSkinPainter.IsDropDownRepaintNeeded: Boolean; +begin + Result := False; +end; + +class procedure TdxBarSkinPainter.CorrectButtonControlDefaultHeight(var DefaultHeight: Integer); +begin + Inc(DefaultHeight, 5); +end; + +class procedure TdxBarSkinPainter.CorrectButtonControlDefaultWidth(var DefaultWidth: Integer); +begin + Inc(DefaultWidth, 9); +end; + +procedure TdxBarSkinPainter.DrawButtonControlArrowBackground(const ADrawParams: TdxBarButtonLikeControlDrawParams; + var R1: TRect; ABrush: HBRUSH); +var + ASkinElement: TdxSkinElement; +begin + inherited; + with ADrawParams do + if (PaintType = ptMenu) or not DroppedDown then + begin + if PaintType = ptMenu then + ASkinElement := PopupMenuSplitButton2 + else + ASkinElement := LinkSelected; + + if DrawSelected or (PaintType <> ptMenu) and Downed then + DrawArrowButtonElement(ASkinElement, Canvas, R1, 0, ButtonLikeControlGetState(ADrawParams)); + end; +end; + +function TdxBarSkinPainter.ColorComboHasCompleteFrame: Boolean; +begin + Result := True; +end; + +function TdxBarSkinPainter.GetCustomColorButtonIndents(APaintType: TdxBarPaintType): TRect; +begin + Result := EditControlBorderOffsets(APaintType); + Result.Left := 0; +end; + +function TdxBarSkinPainter.GetCustomColorButtonWidth(APaintType: TdxBarPaintType; const ARect: TRect): Integer; +begin + Result := 17; +end; + +procedure TdxBarSkinPainter.ColorComboDrawCustomButton(const ADrawParams: TdxBarColorComboControlDrawParams; ARect: TRect); + + function GetState: TcxButtonState; + begin + with ADrawParams do + if not Enabled then + Result := cxbsDisabled + else + if IsPressed then + Result := cxbsPressed + else + if DrawSelected then + Result := cxbsHot + else + Result := cxbsNormal; + end; + +begin + FSkinPainter.DrawEditorButton(ADrawParams.Canvas, ARect, cxbkEllipsisBtn, GetState); +end; + +procedure TdxBarSkinPainter.ColorComboDrawCustomButtonAdjacentZone(const ADrawParams: TdxBarColorComboControlDrawParams; ARect: TRect); +begin + FillRectByColor(ADrawParams.Canvas.Handle, cxRectContent(ARect, GetCustomColorButtonIndents(ADrawParams.PaintType)), EditGetBkColor(ADrawParams)); +end; + +class function TdxBarSkinPainter.EditControlCaptionBackgroundIsOpaque(const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; +begin + Result := False; +end; + +class function TdxBarSkinPainter.EditControlCaptionRightIndentIsOpaque(const ADrawParams: TdxBarEditLikeControlDrawParams): Boolean; +begin + Result := EditControlCaptionBackgroundIsOpaque(ADrawParams); +end; + +class function TdxBarSkinPainter.EditControlBorderOffsets(APaintType: TdxBarPaintType): TRect; +begin + if APaintType = ptMenu then + Result := Rect(4, 4, 4, 4) + else + Result := dxBarFlatPainter.EditControlBorderOffsets(APaintType); +end; + +procedure TdxBarSkinPainter.EditControlDrawBackground(const ADrawParams: TdxBarEditLikeControlDrawParams); +begin + with ADrawParams do + begin + Canvas.SaveClipRegion; + Canvas.ExcludeClipRect(EditControlGetContentRect(PaintType, TdxBarEditControlAccess(BarEditControl).GetEditRect)); + DrawBackground(BarEditControl, Canvas.Handle, BarEditControl.ItemBounds, 0, False); + Canvas.RestoreClipRegion; + end; +end; + +procedure TdxBarSkinPainter.EditControlDrawBorder(const ADrawParams: TdxBarEditLikeControlDrawParams; var ARect: TRect); +begin + with ADrawParams do + begin + ARect := cxRectContent(ARect, EditControlBorderOffsets(PaintType)); // TODO cxProgress: TdxBarItemControlAccess(BarEditControl).CanSelect + if not IsTransparent or (IsTransparent and DrawSelected and not (PaintType = ptMenu)) then + FrameRectByColor(Canvas.Handle, cxRectInflate(ARect, 1, 1), FSkinPainter.GetContainerBorderColor(DrawSelected and (PaintType <> ptMenu))); + end; +end; + +procedure TdxBarSkinPainter.EditControlDrawSelectionFrame(const ADrawParams: TdxBarEditLikeControlDrawParams; const ARect: TRect); +const + State: array [Boolean] of TdxSkinElementState = (esDisabled, esHot); +var + AExcludedRect: TRect; +begin + with ADrawParams do + begin + Canvas.SaveClipRegion; + AExcludedRect := EditControlGetContentRect(PaintType, TdxBarEditControlAccess(BarEditControl).GetEditRect); + if IsTransparent and DrawSelected and (PaintType = ptMenu) then + InflateRect(AExcludedRect, 1, 1); + Canvas.ExcludeClipRect(AExcludedRect); + try + DrawSkinElement(PopupMenuLinkSelected, Canvas.Handle, ARect, 0, State[Enabled]); + finally + Canvas.RestoreClipRegion; + end; + end; +end; + +class function TdxBarSkinPainter.EditControlCaptionAbsoluteLeftIndent(const ADrawParams: TdxBarEditLikeControlDrawParams): Integer; +begin + Result := TdxBarOffice11Painter.EditControlCaptionAbsoluteLeftIndent(ADrawParams); +end; + +class procedure TdxBarSkinPainter.CustomComboDrawItem(ABarCustomCombo: TdxBarCustomCombo; + ACanvas: TCanvas; AIndex: Integer; ARect: TRect; AState: TOwnerDrawState; + AInteriorIsDrawing: Boolean); +begin + TdxBarFlatPainter.CustomComboDrawItem(ABarCustomCombo, ACanvas, AIndex, ARect, AState, AInteriorIsDrawing); +end; + +class function TdxBarSkinPainter.ComboControlArrowOffset: Integer; +begin + Result := 0; // TdxBarXPPainter +end; + +procedure TdxBarSkinPainter.ComboControlDrawArrowButton(const ADrawParams: TdxBarEditLikeControlDrawParams; ARect: TRect; AInClientArea: Boolean); + + function GetState: TcxButtonState; + begin + with ADrawParams do + if not Enabled then + Result := cxbsDisabled + else + if DroppedDown then + Result := cxbsPressed + else + if DrawSelected then + Result := cxbsHot + else + Result := cxbsNormal; + end; +begin + FillRectByColor(ADrawParams.Canvas.Handle, ARect, EditGetBkColor(ADrawParams)); + FSkinPainter.DrawEditorButton(ADrawParams.Canvas, ARect, cxbkComboBtn, GetState); +end; + +class function TdxBarSkinPainter.IsDateNavigatorFlat: Boolean; +begin + Result := True; +end; + +function TdxBarSkinPainter.DateNavigatorHeaderColor: TColor; +begin + if FloatingBar <> nil then + Result := FloatingBar.Color + else + Result := inherited DateNavigatorHeaderColor; +end; + +procedure TdxBarSkinPainter.DateNavigatorDrawButton(ABarItem: TdxBarItem; + DC: HDC; R: TRect; const ACaption: string; APressed: Boolean); +const + State: array [Boolean] of TcxButtonState = (cxbsNormal, cxbsPressed); +begin + BarCanvas.BeginPaint(DC); + try + FillRect(BarCanvas.Handle, R, GetSysColorBrush(COLOR_WINDOW)); + FSkinPainter.DrawButton(BarCanvas, R, ACaption, State[APressed]); + finally + BarCanvas.EndPaint; + end; +end; + +function TdxBarSkinPainter.InPlaceSubItemControlIsArrowSelected(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams): Boolean; +begin + Result := False; +end; + +procedure TdxBarSkinPainter.InPlaceSubItemControlDrawBackground(const ADrawParams: TdxBarInPlaceSubItemControlDrawParams; ARect: TRect); +begin + if ADrawParams.DrawSelected then + DrawItemBackgroundInSubMenu(ADrawParams, ARect) + else + begin + DrawBackground(ADrawParams.BarItemControl, ADrawParams.Canvas.Handle, ARect, 0, False); + DrawSkinElementContent(PopupMenuSideStrip, ADrawParams.Canvas.Handle, ARect); + end; +end; + +function TdxBarSkinPainter.GetSpinEditButtonWidth(APaintType: TdxBarPaintType; const ARect: TRect): Integer; +begin + Result := 17; +end; + +function TdxBarSkinPainter.GetSpinEditButtonIndents(APaintType: TdxBarPaintType): TRect; +begin + Result := EditControlBorderOffsets(APaintType); + Result.Left := 0; +end; + +procedure TdxBarSkinPainter.SpinEditControlDrawButton(const ADrawParams: TdxBarSpinEditDrawParams; ARect: TRect; AButtonIndex: Integer); +const + ButtonKind: array [Boolean] of TcxEditBtnKind = (cxbkSpinDownBtn, cxbkSpinUpBtn); +begin + FSkinPainter.DrawEditorButton(ADrawParams.Canvas, ARect, ButtonKind[AButtonIndex = secButtonUp], + GetSpinEditButtonState(ADrawParams, AButtonIndex)); +end; + +procedure TdxBarSkinPainter.SpinEditControlDrawButtonsAdjacentZone(const ADrawParams: TdxBarSpinEditDrawParams; const ARect: TRect); +begin + FillRectByColor(ADrawParams.Canvas.Handle, cxRectContent(ARect, GetSpinEditButtonIndents(ADrawParams.PaintType)), EditGetBkColor(ADrawParams)); +end; + +procedure TdxBarSkinPainter.CalculateSpinEditParts(const ADrawParams: TdxBarSpinEditDrawParams; + var AParts: array of TRect; const AItemRect: TRect); +begin + inherited; + AParts[ecpEdit].Right := AParts[secButtonUp].Left; +end; + +procedure TdxBarSkinPainter.SpinEditCorrectFrameRect(const ADrawParams: TdxBarItemControlDrawParams; var ARect: TRect); +begin + // do nothing +end; + +function TdxBarSkinPainter.ProgressControlBarHeight(ABarItemControl: TdxBarItemControl): Integer; +begin + Result := 24; +end; + +class function TdxBarSkinPainter.ProgressControlIndent(const ADrawParams: TdxBarItemControlDrawParams): Integer; +begin + Result := TdxBarOffice11Painter.ProgressControlIndent(ADrawParams); +end; + +procedure TdxBarSkinPainter.ProgressControlDrawBackground(const ADrawParams: TdxBarItemControlDrawParams; var BarR: TRect); +begin + DrawBackground(ADrawParams.BarItemControl, ADrawParams.Canvas.Handle, BarR, 0, False); + FSkinPainter.DrawProgressBarBorder(ADrawParams.Canvas, BarR, ADrawParams.PaintType = ptVert); + BarR := cxRectContent(BarR, FSkinPainter.ProgressBarBorderSize(ADrawParams.PaintType = ptVert)); +end; + +procedure TdxBarSkinPainter.ProgressControlFillContent(const ADrawParams: TdxBarItemControlDrawParams; const R: TRect; ABarBrush: HBRUSH); +begin + FSkinPainter.DrawProgressBarChunk(ADrawParams.Canvas, R, ADrawParams.PaintType = ptVert); +end; + +function TdxBarSkinPainter.StaticControlGetBorderOffsets(AParent: TCustomdxBarControl; ABorderStyle: TdxBarStaticBorderStyle): TRect; +begin + if (LinkBorderPainter <> nil) and TCustomdxBarControlAccess(AParent).IsStatusBar then + Result := LinkBorderPainter.ContentOffset.Rect + else + Result := inherited StaticControlGetBorderOffsets(AParent, ABorderStyle); +end; + +procedure TdxBarSkinPainter.DrawStaticBackground(const ADrawParams: TdxBarStaticLikeControlDrawParams; ARect: TRect); +begin + inherited; + with ADrawParams do + if (LinkBorderPainter <> nil) and TCustomdxBarControlAccess(BarStaticControl.Parent).IsStatusBar then + DrawSkinElementContent(LinkBorderPainter, Canvas.Handle, ARect); +end; + +procedure TdxBarSkinPainter.DrawStaticBorder(const ADrawParams: TdxBarStaticLikeControlDrawParams; var ARect: TRect); +var + AContentRect: TRect; +begin + with ADrawParams do + if not cxRectIsNull(BorderOffsets) and (LinkBorderPainter <> nil) and TCustomdxBarControlAccess(BarStaticControl.Parent).IsStatusBar then + begin + Canvas.SaveClipRegion; + try + AContentRect := cxRectContent(ARect, BorderOffsets); + Canvas.ExcludeClipRect(AContentRect); + DrawBackground(BarStaticControl, Canvas.Handle, ARect, 0, False); + DrawSkinElement(LinkBorderPainter, Canvas.Handle, ARect); + ARect := AContentRect; + finally + Canvas.RestoreClipRegion; + end; + end + else + inherited; +end; + +function TdxBarSkinPainter.SubMenuGetSeparatorSize: Integer; +begin + Result := GetSkinElementSize(PopupMenuSeparator).cy; +end; + +procedure TdxBarSkinPainter.DrawSeparatorGlyphAndCaption(const ADrawParams: TdxBarSeparatorControlDrawParams; const ARect: TRect); +var + ACaptionRect: TRect; +begin + with ADrawParams do + begin + DrawBackground(BarStaticControl, Canvas.Handle, ARect, 0, False); + DrawSkinElement(FloatingBar, Canvas.Handle, ARect); + ACaptionRect := ARect; + ACaptionRect.Left := ACaptionRect.Left + + SeparatorControlGetIndents(ADrawParams, cpText).Left; + DrawItemText(BarItemControl, Canvas.Handle, Caption, ACaptionRect, + SystemAlignmentsHorz[Alignment], Enabled, False, PaintType = ptVert, True, + False); + end; +end; + +function TdxBarSkinPainter.ScreenTipGetDescriptionTextColor: TColor; +begin + if ScreenTipItem <> nil then + Result := ScreenTipItem.Value + else + Result := inherited ScreenTipGetDescriptionTextColor; +end; + +function TdxBarSkinPainter.ScreenTipGetTitleTextColor: TColor; +begin + if ScreenTipTitleItem <> nil then + Result := ScreenTipTitleItem.Value + else + Result := inherited ScreenTipGetTitleTextColor; +end; + +function TdxBarSkinPainter.ScreenTipGetFooterLineSize: Integer; +begin + if ScreenTipSeparator <> nil then + Result := ScreenTipSeparator.Size.cy + else + Result := inherited ScreenTipGetFooterLineSize; +end; + +procedure TdxBarSkinPainter.ScreenTipDrawBackground(ACanvas: TcxCanvas; ARect: TRect); +begin + DrawSkinElement(ScreenTipWindow, ACanvas.Handle, ARect); +end; + +procedure TdxBarSkinPainter.ScreenTipDrawFooterLine(ACanvas: TcxCanvas; const ARect: TRect); +begin + DrawSkinElement(ScreenTipSeparator, ACanvas.Handle, ARect); +end; + +function TdxBarSkinPainter.GetDefaultEnabledTextColor(ABarItemControl: TdxBarItemControl; + ASelected, AFlat: Boolean): TColor; +var + ATextColorElement: TdxSkinElement; +begin + ATextColorElement := GetTextColorElement(ABarItemControl.Parent); + if IsBarElementSkinned(ABarItemControl.Parent) and (ATextColorElement <> nil) then + if ASelected and (GetSkinElementTextColorHot(ATextColorElement) <> nil) then + Result := GetSkinElementTextColorHot(ATextColorElement).Value + else + Result := ATextColorElement.TextColor + else + Result := inherited GetDefaultEnabledTextColor(ABarItemControl, ASelected, AFlat); +end; + +procedure TdxBarSkinPainter.GetDisabledTextColors(ABarItemControl: TdxBarItemControl; + ASelected, AFlat: Boolean; var AColor1, AColor2: TColor); +begin + if BarDisabledTextColor <> nil then + begin + AColor1 := BarDisabledTextColor.Value; + AColor2 := AColor1; + end + else + inherited; +end; + +class function TdxBarSkinPainter.UseTextColorForItemArrow: Boolean; +begin + Result := True; +end; + +procedure TdxBarSkinPainter.DrawGlyphEmptyImage(ABarItemControl: TdxBarItemControl; DC: HDC; R: TRect; + APaintType: TdxBarPaintType; ADown: Boolean); +begin + if (APaintType = ptMenu) and ADown and (PopupMenuCheck <> nil) then + DrawSkinElement(PopupMenuCheck, DC, cxRectCenter(R, cxSize(PopupMenuCheck.Size.cx, PopupMenuCheck.Size.cy)), 0) + else + inherited; +end; + +procedure TdxBarSkinPainter.DrawGlyphBorder(ABarItemControl: TdxBarItemControl; DC: HDC; ABrush: HBRUSH; + NeedBorder: Boolean; R: TRect; PaintType: TdxBarPaintType; IsGlyphEmpty, + Selected, Down, DrawDowned, ADroppedDown, IsSplit: Boolean); + + function GetState: TdxSkinElementState; + begin + if Selected then + begin + if Down then + if DrawDowned then + Result := esCheckPressed + else + Result := esHotCheck + else + if DrawDowned and not ADroppedDown then + Result := esPressed + else + Result := esHot; + end + else + Result := esChecked; + end; + +var + ASkinElement: TdxSkinElement; + AIsMenuItem: Boolean; +begin + if PaintType <> ptMenu then + begin + DrawBackground(ABarItemControl, DC, R, ABrush, False); + AIsMenuItem := TdxBarItemControlAccess(ABarItemControl).IsMenuItem; + if Selected or Down then + begin + if AIsMenuItem then + ASkinElement := MainMenuLinkSelected + else + ASkinElement := LinkSelected; + DrawSkinElement(ASkinElement, DC, R, 0, GetState); + end; + end + else + if not IsGlyphEmpty and Down then + DrawSkinElement(PopupMenuCheck, DC, cxRectInflate(R, -2, -2), 1); +end; + +function TdxBarSkinPainter.BarCaptionColor(ABarControl: TdxBarControl): COLORREF; +begin + if FloatingBar <> nil then + Result := FloatingBar.TextColor + else + Result := inherited BarCaptionColor(ABarControl); +end; + +class procedure TdxBarSkinPainter.BarOffsetFloatingBarCaption(ABarControl: TdxBarControl; + var X: Integer; var R: TRect); +begin + Inc(X, 2); + R.Right := TdxBarControlAccess(ABarControl).MarkNCRect.Left;// TdxBarXPPainter +end; + +procedure TdxBarSkinPainter.BarDrawGrip(ABarControl: TdxBarControl; DC: HDC; R: TRect; + AToolbarBrush: HBRUSH); +begin + BarCanvas.BeginPaint(DC); + try + FSkinPainter.DrawSizeGrip(BarCanvas, R, clNone); + finally + BarCanvas.EndPaint; + end; +end; + +procedure TdxBarSkinPainter.BarDrawMarkBackground(ABarControl: TdxBarControl; DC: HDC; + ItemRect: TRect; AToolbarBrush: HBRUSH); +begin + BarFillParentBackground(ABarControl, DC, ItemRect, ItemRect, 0, clNone); +end; + +procedure TdxBarSkinPainter.SubMenuControlDrawMarkSelection(ABarSubMenuControl: TdxBarSubMenuControl; + ADC: HDC; const AMarkRect: TRect); +begin + DrawSkinElement(PopupMenuLinkSelected, ADC, AMarkRect); +end; + +function TdxBarSkinPainter.CreateHintViewInfo(ABarManager: TdxBarManager; AHintText: string; const AShortCut: string; + AScreenTip: TdxBarScreenTip): TdxBarCustomHintViewInfo; +begin + Result := dxBarCreateScreenTipViewInfo(ABarManager, AHintText, AShortCut, AScreenTip, Self); +end; + +function TdxBarSkinPainter.GetBar(AIsVertical: Boolean): TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + if AIsVertical then + Result := ASkinPainterInfo.BarVertical + else + Result := ASkinPainterInfo.Bar; +end; + +function TdxBarSkinPainter.GetBarCustomize(AIsVertical: Boolean): TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + if AIsVertical then + Result := ASkinPainterInfo.BarCustomizeVertical + else + Result := ASkinPainterInfo.BarCustomize; +end; + +function TdxBarSkinPainter.GetBarDisabledTextColor: TdxSkinColor; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.BarDisabledTextColor; +end; + +function TdxBarSkinPainter.GetBarDrag(AIsVertical: Boolean): TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + if AIsVertical then + Result := ASkinPainterInfo.BarDragVertical + else + Result := ASkinPainterInfo.BarDrag; +end; + +function TdxBarSkinPainter.GetBarSeparator(AIsVertical: Boolean): TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + if AIsVertical then + Result := ASkinPainterInfo.BarVerticalSeparator + else + Result := ASkinPainterInfo.BarSeparator; +end; + +function TdxBarSkinPainter.GetDock: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.Dock; +end; + +function TdxBarSkinPainter.GetDockControlWindowButton: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.DockControlWindowButton; +end; + +function TdxBarSkinPainter.GetDockControlWindowButtonGlyph: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.DockControlWindowButtonGlyphs; +end; + +function TdxBarSkinPainter.GetFloatingBar: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.FloatingBar; +end; + +function TdxBarSkinPainter.GetLinkBorderPainter: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.LinkBorderPainter; +end; + +function TdxBarSkinPainter.GetLinkSelected: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.LinkSelected; +end; + +function TdxBarSkinPainter.GetMainMenu(AIsVertical: Boolean): TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + if AIsVertical then + Result := ASkinPainterInfo.MainMenuVertical + else + Result := ASkinPainterInfo.MainMenu; +end; + +function TdxBarSkinPainter.GetMainMenuCustomize(AIsVertical: Boolean): TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + begin + if not AIsVertical then + Result := ASkinPainterInfo.MainMenuCustomize; + if Result = nil then + Result := BarCustomize[AIsVertical]; + end; +end; + +function TdxBarSkinPainter.GetMainMenuDrag(AIsVertical: Boolean): TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) and (not AIsVertical) then + Result := ASkinPainterInfo.MainMenuDrag; +end; + +function TdxBarSkinPainter.GetMainMenuLinkSelected: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.MainMenuLinkSelected; +end; + +function TdxBarSkinPainter.GetPopupMenu: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.PopupMenu; +end; + +function TdxBarSkinPainter.GetPopupMenuCheck: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.PopupMenuCheck; +end; + +function TdxBarSkinPainter.GetPopupMenuExpandButton: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.PopupMenuExpandButton; +end; + +function TdxBarSkinPainter.GetPopupMenuLinkSelected: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.PopupMenuLinkSelected; +end; + +function TdxBarSkinPainter.GetPopupMenuSeparator: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.PopupMenuSeparator; +end; + +function TdxBarSkinPainter.GetPopupMenuSideStrip: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.PopupMenuSideStrip; +end; + +function TdxBarSkinPainter.GetPopupMenuSideStripNonRecent: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.PopupMenuSideStripNonRecent; +end; + +function TdxBarSkinPainter.GetPopupMenuSplitButton: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.PopupMenuSplitButton; +end; + +function TdxBarSkinPainter.GetPopupMenuSplitButton2: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.PopupMenuSplitButton2; +end; + +function TdxBarSkinPainter.GetStatusBar: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.FormStatusBar; +end; + +function TdxBarSkinPainter.GetScreenTipItem: TdxSkinColor; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.ScreenTipItem; +end; + +function TdxBarSkinPainter.GetScreenTipSeparator: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.ScreenTipSeparator; +end; + +function TdxBarSkinPainter.GetScreenTipTitleItem: TdxSkinColor; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.ScreenTipTitleItem; +end; + +function TdxBarSkinPainter.GetScreenTipWindow: TdxSkinElement; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinPainterInfo) then + Result := ASkinPainterInfo.ScreenTipWindow; +end; + +function TdxBarSkinPainter.GetSkinPainterData(var AData: TdxSkinLookAndFeelPainterInfo): Boolean; +begin + Result := GetExtendedStylePainters.GetPainterData(FSkinPainter, AData); +end; + +function TdxBarSkinPainter.DrawSkinElement(AElement: TdxSkinElement; DC: HDC; + const ARect: TRect; AImageIndex: Integer; AState: TdxSkinElementState): Boolean; +begin + Result := AElement <> nil; + if Result then + begin + AImageIndex := Min(AImageIndex, AElement.ImageCount); + if not (AState in AElement.Image.States) then + AState := esNormal; + AElement.Draw(DC, ARect, AImageIndex, AState); + end; +end; + +function TdxBarSkinPainter.DrawSkinElementContent(AElement: TdxSkinElement; DC: HDC; + const ARect: TRect; AImageIndex: Integer = 0; AState: TdxSkinElementState = esNormal): Boolean; +begin + BarCanvas.BeginPaint(DC); + try + Result := AElement <> nil; + if Result then + begin + BarCanvas.SetClipRegion(TcxRegion.Create(ARect), roIntersect); + Result := DrawSkinElement(AElement, BarCanvas.Handle, cxRectContent(ARect, cxRectInvert(AElement.ContentOffset.Rect)), + AImageIndex, AState); + end; + finally + BarCanvas.EndPaint; + end; +end; + +function TdxBarSkinPainter.DrawSkinElementBorders(AElement: TdxSkinElement; DC: HDC; + const ARect: TRect; AImageIndex: Integer = 0; AState: TdxSkinElementState = esNormal): Boolean; +begin + BarCanvas.BeginPaint(DC); + try + Result := AElement <> nil; + if Result then + begin + BarCanvas.ExcludeClipRect(cxRectContent(ARect, AElement.ContentOffset.Rect)); + Result := DrawSkinElement(AElement, BarCanvas.Handle, ARect, AImageIndex, AState); + end; + finally + BarCanvas.EndPaint; + end; +end; + +function TdxBarSkinPainter.GetSkinElementTextColorHot(ASkinElement: TdxSkinElement): TdxSkinColor; +begin + if ASkinElement <> nil then + Result := TdxSkinColor(ASkinElement.GetPropertyByName(sdxTextColorHot)) + else + Result := nil; +end; + +function TdxBarSkinPainter.GetSkinElementSize(ASkinElement: TdxSkinElement): TSize; +begin + Result := cxNullSize; + if ASkinElement <> nil then + if ASkinElement.MinSize.IsEmpty then + Result := ASkinElement.Size + else + Result := ASkinElement.MinSize.Size; +end; + +function TdxBarSkinPainter.GetBarElement(ABarControl: TCustomdxBarControl; AVertical: Boolean): TdxSkinElement; +var + ACustomBarControlAccess: TCustomdxBarControlAccess; +begin + ACustomBarControlAccess := TCustomdxBarControlAccess(ABarControl); + if ACustomBarControlAccess.Kind = bkSubMenu then + Result := PopupMenu + else + begin + if ACustomBarControlAccess.IsMainMenu then + Result := MainMenu[AVertical] + else + if ACustomBarControlAccess.IsStatusBar then + Result := StatusBar + else + Result := Bar[AVertical]; + end; +end; + +function TdxBarSkinPainter.GetBarElement(ABarControl: TCustomdxBarControl): TdxSkinElement; +var + ACustomBarControlAccess: TCustomdxBarControlAccess; +begin + ACustomBarControlAccess := TCustomdxBarControlAccess(ABarControl); + Result := GetBarElement(ABarControl, ACustomBarControlAccess.IsRealVertical); +end; + +function TdxBarSkinPainter.GetBarDragElement(AMainMenu, AVertical: Boolean): TdxSkinElement; +begin + if AMainMenu then + Result := MainMenuDrag[AVertical] + else + Result := BarDrag[AVertical]; +end; + +function TdxBarSkinPainter.GetBarDragElement(ABarControl: TdxBarControl): TdxSkinElement; +var + ABarControlAccess: TdxBarControlAccess; +begin + ABarControlAccess := TdxBarControlAccess(ABarControl); + Result := GetBarDragElement(ABarControlAccess.IsMainMenu, ABarControlAccess.IsRealVertical); +end; + +function TdxBarSkinPainter.GetBarMarkElement(AMainMenu, AVertical: Boolean): TdxSkinElement; +begin + if AMainMenu then + Result := MainMenuCustomize[AVertical] + else + Result := BarCustomize[AVertical]; +end; + +function TdxBarSkinPainter.GetBarMarkElement(ABarControl: TdxBarControl): TdxSkinElement; +var + ABarControlAccess: TdxBarControlAccess; +begin + ABarControlAccess := TdxBarControlAccess(ABarControl); + Result := GetBarMarkElement(ABarControlAccess.IsMainMenu, ABarControlAccess.Vertical); +end; + +function TdxBarSkinPainter.GetTextColorElement(ABarControl: TCustomdxBarControl): TdxSkinElement; +begin + Result := GetBarElement(ABarControl, False); + if (Result = Bar[False]) and (ABarControl is TdxBarControl) and + (TdxBarControlAccess(ABarControl).Bar.BorderStyle = bbsNone) then + Result := Dock; +end; + +function TdxBarSkinPainter.IsBarElementSkinned(ABarControl: TCustomdxBarControl): Boolean; +begin + Result := GetBarElement(ABarControl) <> nil; +end; + +procedure TdxBarSkinPainter.DrawArrowButtonElement(AElement: TdxSkinElement; ACanvas: TcxCanvas; + const ARect: TRect; AImageIndex: Integer = 0; AState: TdxSkinElementState = esNormal); +var + R: TRect; +begin + if AElement <> nil then + begin + R := ARect; + if cxRectWidth(ARect) < (AElement.Image.Margins.Left + AElement.Image.Margins.Right) then + R.Left := ARect.Left + cxRectWidth(ARect) - AElement.Image.Margins.Left - AElement.Image.Margins.Right; + ACanvas.SaveClipRegion; + try + ACanvas.SetClipRegion(TcxRegion.Create(ARect), roIntersect); + DrawSkinElement(AElement, ACanvas.Handle, R, 0, AState); + finally + ACanvas.RestoreClipRegion; + end; + end; +end; + +procedure TdxBarSkinPainter.DrawFloatingBarCaptionButton(DC: HDC; ARect: TRect; AContentType: Integer; AState: TdxBarMarkState); +const + MarkState2SkinState: array [TdxBarMarkState] of TdxSkinElementState = (esActive, esHot, esPressed); +begin + DrawSkinElement(DockControlWindowButton, DC, ARect, 0, MarkState2SkinState[AState]); + DrawSkinElement(DockControlWindowButtonGlyph, DC, ARect, AContentType); +end; + +procedure TdxBarSkinPainter.InternalDrawDockedBarBackground(ABarControl: TdxBarControl; ACanvas: TcxCanvas; R: TRect; AClientArea: Boolean); + + function GetBarElementRect(ABarControlAccess: TdxBarControlAccess; const ARect: TRect): TRect; + begin + Result := ARect; + if ABarControlAccess.Vertical then + begin + if ABarControlAccess.CanMoving then + Inc(Result.Top, GripperSize(ABarControl)); + if ABarControlAccess.MarkExists then + Dec(Result.Bottom, cxRectHeight(BarMarkItemRect(ABarControlAccess))); + end + else + begin + if ABarControlAccess.CanMoving then + Inc(Result.Left, GripperSize(ABarControl)); + if ABarControlAccess.MarkExists then + Dec(Result.Right, cxRectWidth(BarMarkItemRect(ABarControlAccess))); + end; + end; + + procedure DrawBarElement(ABarControlAccess: TdxBarControlAccess; ACanvas: TcxCanvas; const ARect: TRect); + var + ABarRect: TRect; + begin + ABarRect := GetBarElementRect(ABarControlAccess, ARect); + BarFillParentBackground(ABarControl, ACanvas.Handle, ABarRect, ABarRect, 0, clNone); + DrawSkinElement(GetBarElement(ABarControlAccess), ACanvas.Handle, ABarRect); + end; + + procedure DrawMarkElementNCPart(ABarControlAccess: TdxBarControlAccess; ACanvas: TcxCanvas; const ARect: TRect); + var + ANCMarkRect: TRect; + begin + ANCMarkRect := cxRectOffset(BarMarkItemRect(ABarControlAccess), ABarControlAccess.NCOffset); + ANCMarkRect := cxRectOffset(ANCMarkRect, cxPointInvert(ARect.TopLeft)); + BarDrawMarks(ABarControlAccess, ACanvas, ANCMarkRect, 0); + end; + + procedure DrawBarDragElement(ABarControlAccess: TdxBarControlAccess; ACanvas: TcxCanvas; const ARect: TRect); + var + ABarDragRect: TRect; + begin + ABarDragRect := ARect; + if ABarControlAccess.Vertical then + ABarDragRect.Bottom := ABarDragRect.Top + GripperSize(ABarControlAccess) + else + ABarDragRect.Right := ABarDragRect.Left + GripperSize(ABarControlAccess); + BarFillParentBackground(ABarControl, ACanvas.Handle, ABarDragRect, ABarDragRect, 0, clNone); + DrawSkinElement(GetBarDragElement(ABarControlAccess), ACanvas.Handle, ABarDragRect); + end; + + procedure FillBackgroundTempBitmap(ABarControlAccess: TdxBarControlAccess; const AWholeR: TRect); + var + ABitmap: TBitmap; + ABitmapRect: TRect; + begin + ABitmap := ABarControlAccess.BackgroundTempBitmap; + ABitmap.Width := cxRectWidth(AWholeR); + ABitmap.Height := cxRectHeight(AWholeR); + ABitmapRect := cxRectOffset(AWholeR, cxPointInvert(AWholeR.TopLeft)); + + BarCanvas.BeginPaint(ABitmap.Canvas); + try + DrawBarElement(ABarControlAccess, BarCanvas, ABitmapRect); + if not AClientArea then + begin + if ABarControlAccess.MarkExists then + DrawMarkElementNCPart(ABarControlAccess, BarCanvas, AWholeR); + if ABarControlAccess.CanMoving then + DrawBarDragElement(ABarControlAccess, BarCanvas, ABitmapRect); + end; + finally + BarCanvas.EndPaint; + end; + end; + +var + ABarControlAccess: TdxBarControlAccess; +begin + ABarControlAccess := TdxBarControlAccess(ABarControl); + FillBackgroundTempBitmap(ABarControlAccess, R); + cxBitBlt(ACanvas.Handle, ABarControlAccess.BackgroundTempBitmap.Canvas.Handle, R, cxNullPoint, SRCCOPY); +end; + +function TdxBarSkinPainter.ButtonLikeControlGetState(const ADrawParams: TdxBarButtonLikeControlDrawParams): TdxSkinElementState; +begin + with ADrawParams do + if PaintType = ptMenu then + if Enabled then + Result := esHot + else + Result := esDisabled + else + if DrawSelected then + begin + if Downed then + if IsPressed then + Result := esCheckPressed + else + Result := esHotCheck + else + if IsPressed then + Result := esPressed + else + Result := esHot; + end + else + Result := esChecked; +end; + +initialization + dxBarSkinPainterClass := TdxBarSkinPainter; + +finalization + dxBarSkinPainterClass := TdxBarStandardPainter; + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinsdxBarsPaintersReg.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxBarsPaintersReg.pas new file mode 100644 index 00000000..9312c3c5 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxBarsPaintersReg.pas @@ -0,0 +1,115 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinsdxBarsPaintersReg; + +{$I cxVer.inc} + +interface + +uses + Classes, DesignIntf, dxSkinsDesignHelperReg, dxRibbon, dxBar, dxDockControl, dxStatusBar, + dxSkinsdxBarPainter, dxSkinsdxRibbonPainter, dxSkinsdxStatusBarPainter, + dxSkinsdxDockControlPainter; + +procedure Register; + +implementation + +type + TdxSkinsdxBarsSelectionEditor = class(TdxSkinsBaseSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + + TdxSkinsdxStatusBarSelectionEditor = class(TdxSkinsBaseSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + + TdxSkinsdxRibbonSelectionEditor = class(TdxSkinsBaseSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + + TdxSkinsdxDockingSelectionEditor = class(TdxSkinsBaseSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + + +{ TdxSkinsdxBarsSelectionEditor } + +procedure TdxSkinsdxBarsSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + inherited RequiresUnits(Proc); + Proc('dxSkinsdxBarPainter'); +end; + +{ TdxSkinsdxStatusBarSelectionEditor } + +procedure TdxSkinsdxStatusBarSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + inherited RequiresUnits(Proc); + Proc('dxSkinsdxStatusBarPainter'); +end; + +{ TdxSkinsdxRibbonSelectionEditor } + +procedure TdxSkinsdxRibbonSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + inherited RequiresUnits(Proc); + Proc('dxSkinsdxRibbonPainter'); +end; + +{ TdxSkinsdxDockingSelectionEditor } + +procedure TdxSkinsdxDockingSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + inherited RequiresUnits(Proc); + Proc('dxSkinsdxDockControlPainter'); +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterSelectionEditor(TdxBarManager, TdxSkinsdxBarsSelectionEditor); + RegisterSelectionEditor(TdxStatusBar, TdxSkinsdxStatusBarSelectionEditor); + RegisterSelectionEditor(TdxRibbon, TdxSkinsdxRibbonSelectionEditor); + RegisterSelectionEditor(TdxDockingManager, TdxSkinsdxDockingSelectionEditor); +end; + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinsdxDockControlPainter.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxDockControlPainter.pas new file mode 100644 index 00000000..6b8c9882 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxDockControlPainter.pas @@ -0,0 +1,843 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinsdxDockControlPainter; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, Graphics, cxGraphics, dxDockControl, dxDockControlXPView, + dxSkinsCore, dxSkinsLookAndFeelPainter, cxLookAndFeels, cxLookAndFeelPainters, + Math, cxGeometry, dxDockControlOfficeView, dxSkinInfo, Types; + +type + + { TdxDockControlSkinPainter } + + TdxDockControlSkinPainter = class(TdxDockControlXPPainter) + private + FButtonsCache: TdxSkinElementCache; + FHideBarElementCache: array[TdxAutoHidePosition] of TdxSkinElementCache; + FPanelsBackgroundCache: TdxSkinElementCacheList; + procedure DrawClippedElement(ACanvas: TCanvas; const ARect, AClipRect: TRect; + AElement: TdxSkinElement; AState: TdxSkinElementState = esNormal); + protected + function DrawCaptionFirst: Boolean; override; + function GetCaptionFontColor(IsActive: Boolean): TColor; override; + function GetCaptionRect(const ARect: TRect; AIsVertical: Boolean): TRect; override; + function GetElementState(IsActive, IsDown, IsHot: Boolean): TdxSkinElementState; + function GetHideBarButtonFontColor: TColor; override; + function GetSkinLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; + function GetSkinPainterData(var AData: TdxSkinLookAndFeelPainterInfo): Boolean; + function GetTabFontColor(IsActive: Boolean): TColor; override; + function GetTopBorderSize: Integer; + function InternalDrawCaptionButton(ACanvas: TCanvas; AGlyphIndex: Integer; + ARect: TRect; AState: TdxSkinElementState): Boolean; + function InternalDrawTabButton(ACanvas: TCanvas; ARect: TRect; + IsDown, IsHot, IsEnable, IsNextButton: Boolean): Boolean; + public + constructor Create(ADockControl: TdxCustomDockControl); override; + destructor Destroy; override; + // Custom + function CanVerticalCaption: Boolean; override; + procedure DrawBorder(ACanvas: TCanvas; ARect: TRect); override; + procedure DrawCaption(ACanvas: TCanvas; ARect: TRect; IsActive: Boolean); override; + procedure DrawCaptionCloseButton(ACanvas: TCanvas; ARect: TRect; IsActive, + IsDown, IsHot, IsSwitched: Boolean); override; + procedure DrawCaptionHideButton(ACanvas: TCanvas; ARect: TRect;IsActive, + IsDown, IsHot, IsSwitched: Boolean); override; + procedure DrawCaptionMaximizeButton(ACanvas: TCanvas; ARect: TRect; IsActive, + IsDown, IsHot, IsSwitched: Boolean); override; + procedure DrawCaptionSeparator(ACanvas: TCanvas; ARect: TRect); override; + procedure DrawCaptionText(ACanvas: TCanvas; ARect: TRect; IsActive: Boolean); override; + procedure DrawClientEx(ACanvas: TCanvas; AWindowRect, ARect: TRect); override; + function GetBorderWidth: Integer; override; + function GetCaptionButtonSize: Integer; override; + function GetCaptionHorizInterval: Integer; override; + // TabContainer + procedure CorrectTabRect(var ATab: TRect; APosition: TdxTabContainerTabsPosition; + AIsActive: Boolean); override; + function DrawActiveTabLast: Boolean; override; + procedure DrawTab(ACanvas: TCanvas; AControl: TdxCustomDockControl; + ARect: TRect; IsActive: Boolean; APosition: TdxTabContainerTabsPosition); override; + procedure DrawTabContent(ACanvas: TCanvas; AControl: TdxCustomDockControl; + ARect: TRect; IsActive: Boolean; APosition: TdxTabContainerTabsPosition); override; + procedure DrawTabs(ACanvas: TCanvas; ARect, AActiveTabRect: TRect; + APosition: TdxTabContainerTabsPosition); override; + procedure DrawTabsNextTabButton(ACanvas: TCanvas; ARect: TRect; + IsDown, IsHot, IsEnable: Boolean; APosition: TdxTabContainerTabsPosition); override; + procedure DrawTabsPrevTabButton(ACanvas: TCanvas; ARect: TRect; + IsDown, IsHot, IsEnable: Boolean; APosition: TdxTabContainerTabsPosition); override; + function GetTabHorizInterval: Integer; override; + function GetTabHorizOffset: Integer; override; + function GetTabsHeight: Integer; override; + function GetTabVertInterval: Integer; override; + function GetTabVertOffset: Integer; override; + // AutoHideContainer + procedure DrawHideBar(ACanvas: TCanvas; ARect: TRect; APosition: TdxAutoHidePosition); override; + procedure DrawHideBarButton(ACanvas: TCanvas; AControl: TdxCustomDockControl; + ARect: TRect; APosition: TdxAutoHidePosition); override; + end; + + TdxDockControlAccess = class(TdxCustomDockControl); + +implementation + +{ TdxDockControlSkinPainter } + +constructor TdxDockControlSkinPainter.Create(ADockControl: TdxCustomDockControl); +var + ASide: TdxAutoHidePosition; +begin + inherited Create(ADockControl); + FPanelsBackgroundCache := TdxSkinElementCacheList.Create; + FButtonsCache := TdxSkinElementCache.Create; + for ASide := Low(TdxAutoHidePosition) to High(TdxAutoHidePosition) do + FHideBarElementCache[ASide] := TdxSkinElementCache.Create; +end; + +destructor TdxDockControlSkinPainter.Destroy; +var + ASide: TdxAutoHidePosition; +begin + FButtonsCache.Free; + FPanelsBackgroundCache.Free; + for ASide := Low(TdxAutoHidePosition) to High(TdxAutoHidePosition) do + FHideBarElementCache[ASide].Free; + inherited Destroy; +end; + +function TdxDockControlSkinPainter.CanVerticalCaption: Boolean; +begin + Result := False; +end; + +procedure TdxDockControlSkinPainter.CorrectTabRect(var ATab: TRect; + APosition: TdxTabContainerTabsPosition; AIsActive: Boolean); +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if not GetSkinPainterData(ASkinInfo) then + inherited CorrectTabRect(ATab, APosition, AIsActive) + else + begin + if AIsActive then + begin + InflateRect(ATab, ASkinInfo.DockControlIndents[1], 0); + if APosition = tctpTop then + Dec(ATab.Top, ASkinInfo.DockControlIndents[2]) + else + Inc(ATab.Bottom, ASkinInfo.DockControlIndents[2]); + end; + + if APosition = tctpTop then + Inc(ATab.Bottom, ASkinInfo.DockControlIndents[0] - 1) + else + Dec(ATab.Top, ASkinInfo.DockControlIndents[0] + 1); + end; +end; + +procedure TdxDockControlSkinPainter.DrawBorder(ACanvas: TCanvas; ARect: TRect); +var + ABorder: TdxSkinElement; + ACaption: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + ABorder := nil; + ACaption := nil; + if GetSkinPainterData(ASkinInfo) then + begin + ABorder := ASkinInfo.DockControlBorder; + ACaption := ASkinInfo.DockControlCaption; + end; + + if (ABorder = nil) or (ACaption = nil) then + inherited DrawBorder(ACanvas, ARect) + else + begin + FPanelsBackgroundCache.DrawElement(ACanvas.Handle, ABorder, ARect); + DrawClippedElement(ACanvas, cxRectSetHeight(ARect, ACaption.Size.cy), + cxRectSetHeight(ARect, GetBorderWidth), ACaption); + end; +end; + +procedure TdxDockControlSkinPainter.DrawCaption(ACanvas: TCanvas; ARect: TRect; + IsActive: Boolean); +const + AStates: array[Boolean] of TdxSkinElementState = (esNormal, esActive); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + R: TRect; +begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.DockControlCaption; + if AElement = nil then + inherited DrawCaption(ACanvas, ARect, IsActive) + else + begin + R := ARect; + Dec(R.Top, GetTopBorderSize); + DrawClippedElement(ACanvas, R, ARect, AElement, AStates[IsActive]); + end; +end; + +procedure TdxDockControlSkinPainter.DrawCaptionCloseButton(ACanvas: TCanvas; + ARect: TRect; IsActive, IsDown, IsHot, IsSwitched: Boolean); +begin + if not InternalDrawCaptionButton(ACanvas, 2, ARect, + GetElementState(IsActive, IsDown, IsHot)) + then + inherited DrawCaptionCloseButton(ACanvas, ARect, IsActive, IsDown, IsHot, + IsSwitched); +end; + +procedure TdxDockControlSkinPainter.DrawCaptionHideButton(ACanvas: TCanvas; + ARect: TRect; IsActive, IsDown, IsHot, IsSwitched: Boolean); +const + AGlyphMap: array[Boolean] of Integer = (3, 4); +begin + if not InternalDrawCaptionButton(ACanvas, AGlyphMap[IsSwitched], ARect, + GetElementState(IsActive, IsDown, IsHot)) + then + inherited DrawCaptionHideButton(ACanvas, ARect, IsActive, IsDown, IsHot, + IsSwitched); +end; + +procedure TdxDockControlSkinPainter.DrawCaptionMaximizeButton(ACanvas: TCanvas; + ARect: TRect; IsActive, IsDown, IsHot, IsSwitched: Boolean); +const + AGlyphs: array[Boolean] of Integer = (1, 0); +begin + if not InternalDrawCaptionButton(ACanvas, AGlyphs[IsSwitched], ARect, + GetElementState(IsActive, IsDown, IsHot)) + then + inherited DrawCaptionMaximizeButton(ACanvas, ARect, IsActive, IsDown, IsHot, + IsSwitched); +end; + +procedure TdxDockControlSkinPainter.DrawCaptionSeparator(ACanvas: TCanvas; ARect: TRect); +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if not GetSkinPainterData(ASkinInfo) then + inherited DrawCaptionSeparator(ACanvas, ARect); +end; + +procedure TdxDockControlSkinPainter.DrawCaptionText(ACanvas: TCanvas; ARect: TRect; + IsActive: Boolean); +var + R: TRect; +begin + if IsValidImageIndex(DockControl.ImageIndex) then + begin + R.Left := ARect.Left + 2 * GetCaptionHorizInterval; + R.Top := ARect.Top + (ARect.Bottom - ARect.Top - GetImageHeight) div 2; + R.Right := R.Left + GetImageWidth; + R.Bottom := R.Top + GetImageHeight; + if RectInRect(R, ARect) then + begin + DrawImage(ACanvas, DockControl.Images, DockControl.ImageIndex, R); + ARect.Left := R.Right + 2 * GetCaptionHorizInterval; + end; + end; + + ACanvas.Brush.Style := bsClear; + ACanvas.Font := GetFont; + ACanvas.Font.Color := GetCaptionFontColor(IsActive); + cxDrawText(ACanvas.Handle, DockControl.Caption, ARect, + DT_SINGLELINE or DT_LEFT or DT_VCENTER or DT_END_ELLIPSIS); +end; + +procedure TdxDockControlSkinPainter.DrawClientEx(ACanvas: TCanvas; + AWindowRect, ARect: TRect); +var + ABorderWidth: Integer; + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.DockControlBorder + else + AElement := nil; + + if AElement = nil then + inherited DrawClientEx(ACanvas, AWindowRect, ARect) + else + if cxRectIsEqual(AWindowRect, ARect) then + begin + ABorderWidth := GetBorderWidth; + InflateRect(ARect, ABorderWidth, ABorderWidth); + DrawClippedElement(ACanvas, ARect, AWindowRect, AElement); + end + else + FPanelsBackgroundCache.DrawElement(ACanvas.Handle, AElement, AWindowRect); +end; + +function TdxDockControlSkinPainter.GetBorderWidth: Integer; +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.DockControlBorder; + if AElement = nil then + Result := inherited GetBorderWidth + else + with AElement.Image.Margins do + Result := Max(Max(Left, Top), Max(Right, Bottom)); +end; + +function TdxDockControlSkinPainter.GetCaptionButtonSize: Integer; +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.DockControlWindowButton; + if AElement = nil then + Result := inherited GetCaptionButtonSize + else + Result := AElement.Size.cy; +end; + +function TdxDockControlSkinPainter.GetCaptionHorizInterval: Integer; +begin + Result := 2; +end; + +procedure TdxDockControlSkinPainter.DrawHideBar(ACanvas: TCanvas; ARect: TRect; + APosition: TdxAutoHidePosition); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + case APosition of + ahpTop, ahpUndefined: + AElement := ASkinInfo.DockControlHideBar; + ahpLeft: + AElement := ASkinInfo.DockControlHideBarLeft; + ahpRight: + AElement := ASkinInfo.DockControlHideBarRight; + ahpBottom: + AElement := ASkinInfo.DockControlHideBarBottom; + end; + + if AElement = nil then + inherited DrawHideBar(ACanvas, ARect, APosition) + else + begin + FHideBarElementCache[APosition].CheckCacheState(AElement, ARect); + FHideBarElementCache[APosition].Draw(ACanvas.Handle, ARect); + end; +end; + +procedure TdxDockControlSkinPainter.DrawHideBarButton(ACanvas: TCanvas; + AControl: TdxCustomDockControl; ARect: TRect; APosition: TdxAutoHidePosition); +var + ABitmap: TBitmap; + AElement: TdxSkinElement; + ALine: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + R: TRect; + Temp: Integer; +begin + AElement := nil; + ALine := nil; + if GetSkinPainterData(ASkinInfo) then + begin + AElement := ASkinInfo.DockControlHideBarButtons; + ALine := ASkinInfo.DockControlTabHeaderLine; + end; + if (AElement = nil) or (ALine = nil) then + inherited DrawHideBarButton(ACanvas, AControl, ARect, APosition) + else + begin + ABitmap := TBitmap.Create; + try + ABitmap.PixelFormat := pf32bit; + R := ARect; + OffsetRect(R, -R.Left, -R.Top); + if APosition in [ahpLeft, ahpRight] then + begin + Temp := R.Right; + R.Right := R.Left + (R.Bottom - R.Top); + R.Bottom := R.Top + (Temp - R.Left); + end; + ABitmap.Width := R.Right - R.Left; + ABitmap.Height := R.Bottom - R.Top; + if APosition in [ahpLeft, ahpRight] then + begin + case APosition of + ahpLeft: RotateBitmap(ABitmap, raMinus90); + ahpRight: RotateBitmap(ABitmap, raPlus90); + end; + BitBlt(ABitmap.Canvas.Handle, 0, 0, ABitmap.Width, ABitmap.Height, + ACanvas.Handle, ARect.Left, ARect.Top, SRCCOPY); + case APosition of + ahpLeft: RotateBitmap(ABitmap, raPlus90); + ahpRight: RotateBitmap(ABitmap, raMinus90); + end; + end + else + BitBlt(ABitmap.Canvas.Handle, 0, 0, ABitmap.Width, ABitmap.Height, + ACanvas.Handle, ARect.Left, ARect.Top, SRCCOPY); + AElement.Draw(ABitmap.Canvas.Handle, R); + ALine.Draw(ABitmap.Canvas.Handle, Rect(1, R.Bottom - 1, R.Right - 1, R.Bottom)); + case APosition of + ahpTop: RotateBitmap(ABitmap, ra180); + ahpLeft: RotateBitmap(ABitmap, raMinus90); + ahpRight: RotateBitmap(ABitmap, raPlus90); + end; + BitBlt(ACanvas.Handle, ARect.Left, ARect.Top, ARect.Right - ARect.Left, + ARect.Bottom - ARect.Top, ABitmap.Canvas.Handle, 0, 0, SRCCOPY); + finally + ABitmap.Free; + end; + DrawHideBarButtonContent(ACanvas, AControl, ARect, APosition); + end; +end; + +function TdxDockControlSkinPainter.DrawActiveTabLast: Boolean; +begin + Result := True; +end; + +procedure TdxDockControlSkinPainter.DrawTab(ACanvas: TCanvas; + AControl: TdxCustomDockControl; ARect: TRect; IsActive: Boolean; + APosition: TdxTabContainerTabsPosition); +const + AStates: array[Boolean] of TdxSkinElementState = (esNormal, esPressed); +var + ABitmap: TcxBitmap; + ABitmapCanvas: TcxCanvas; + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.DockControlTabHeader; + + if AElement = nil then + inherited DrawTab(ACanvas, AControl, ARect, IsActive, APosition) + else + begin + ABitmap := TcxBitmap.CreateSize(ARect.Right - ARect.Left, ARect.Bottom - ARect.Top); + try + ABitmap.PixelFormat := pf32bit; + BitBlt(ABitmap.Canvas.Handle, 0, 0, ABitmap.Width, ABitmap.Height, + ACanvas.Handle, ARect.Left, ARect.Top, SRCCOPY); + + ABitmapCanvas := TcxCanvas.Create(ACanvas); + try + if APosition = tctpBottom then + ABitmapCanvas.RotateBitmap(ABitmap, ra0, True); + AElement.Draw(ABitmap.Canvas.Handle, + Rect(0, 0, ABitmap.Width, ABitmap.Height), 0, AStates[IsActive]); + if APosition = tctpBottom then + ABitmapCanvas.RotateBitmap(ABitmap, ra0, True); + finally + ABitmapCanvas.Free; + end; + + with ARect do + BitBlt(ACanvas.Handle, Left, Top, Right - Left, Bottom - Top, + ABitmap.Canvas.Handle, 0, 0, SRCCOPY); + finally + ABitmap.Free; + end; + with AElement.ContentOffset.Rect do + begin + Inc(ARect.Left, Left); + Inc(ARect.Top, Top); + Dec(ARect.Right, Right); + Dec(ARect.Bottom, Bottom); + end; + if APosition = tctpBottom then + Inc(ARect.Top, ASkinInfo.DockControlIndents[0]); + DrawTabContent(ACanvas, AControl, ARect, IsActive, APosition); + end; +end; + +procedure TdxDockControlSkinPainter.DrawTabContent(ACanvas: TCanvas; + AControl: TdxCustomDockControl; ARect: TRect; IsActive: Boolean; + APosition: TdxTabContainerTabsPosition); +var + R: TRect; +begin + if IsValidImageIndex(AControl.ImageIndex) then + begin + R.Left := ARect.Left; + R.Top := ARect.Top + (ARect.Bottom - ARect.Top - GetImageHeight) div 2; + R.Right := R.Left + GetImageWidth; + R.Bottom := R.Top + GetImageHeight; + if RectInRect(R, ARect) then + begin + DrawImage(ACanvas, AControl.Images, AControl.ImageIndex, R); + ARect.Left := R.Right + GetTabHorizInterval; + end; + end; + + ACanvas.Brush.Style := bsClear; + ACanvas.Font := GetTabFont(IsActive); + ACanvas.Font.Color := ColorToRGB(GetTabFontColor(IsActive)); + DrawText(ACanvas.Handle, PChar(AControl.Caption), Length(AControl.Caption), ARect, + DT_SINGLELINE or DT_CENTER or DT_VCENTER or DT_END_ELLIPSIS); +end; + +procedure TdxDockControlSkinPainter.DrawTabs(ACanvas: TCanvas; + ARect, AActiveTabRect: TRect; APosition: TdxTabContainerTabsPosition); +var + ABitmap: TBitmap; + AElement: TdxSkinElement; + ALine: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + R: TRect; +begin + AElement := nil; + ALine := nil; + if GetSkinPainterData(ASkinInfo) then + begin + AElement := ASkinInfo.DockControlTabHeaderBackground; + ALine := ASkinInfo.DockControlTabHeaderLine; + end; + if (AElement = nil) or (ALine = nil) then + inherited DrawTabs(ACanvas, ARect, AActiveTabRect, APosition) + else + begin + AElement.Draw(ACanvas.Handle, ARect); + R := ARect; + + if APosition = tctpBottom then + R.Bottom := R.Top + 1 + else + R.Top := R.Bottom - 1; + + if APosition = tctpTop then + ALine.Draw(ACanvas.Handle, R) + else + begin + ABitmap := TBitmap.Create; + try + ABitmap.PixelFormat := pf32bit; + ABitmap.Width := R.Right - R.Left; + ABitmap.Height := R.Bottom - R.Top; + ALine.Draw(ABitmap.Canvas.Handle, Rect(0, 0, ABitmap.Width, ABitmap.Height)); + RotateBitmap(ABitmap, ra180); + BitBlt(ACanvas.Handle, R.Left, R.Top, ABitmap.Width, ABitmap.Height, + ABitmap.Canvas.Handle, 0, 0, SRCCOPY); + finally + ABitmap.Free; + end; + end; + + with AActiveTabRect do + begin + ExcludeClipRect(ACanvas.Handle, R.Left, R.Top, Left, R.Bottom); + ExcludeClipRect(ACanvas.Handle, Right, R.Top, R.Right, R.Bottom); + end; + end; +end; + +procedure TdxDockControlSkinPainter.DrawTabsNextTabButton(ACanvas: TCanvas; + ARect: TRect; IsDown, IsHot, IsEnable: Boolean; + APosition: TdxTabContainerTabsPosition); +begin + if not InternalDrawTabButton(ACanvas, ARect, IsDown, IsHot, IsEnable, True) then + inherited DrawTabsNextTabButton(ACanvas, ARect, IsDown, IsHot, IsEnable, + APosition); +end; + +procedure TdxDockControlSkinPainter.DrawTabsPrevTabButton(ACanvas: TCanvas; + ARect: TRect; IsDown, IsHot, IsEnable: Boolean; APosition: TdxTabContainerTabsPosition); +begin + if not InternalDrawTabButton(ACanvas, ARect, IsDown, IsHot, IsEnable, False) then + inherited DrawTabsNextTabButton(ACanvas, ARect, IsDown, IsHot, IsEnable, + APosition); +end; + +function TdxDockControlSkinPainter.GetCaptionFontColor(IsActive: Boolean): TColor; +var + AColor: TColor; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AColor := clDefault; + if GetSkinPainterData(ASkinInfo) then + if not IsActive then + AColor := ASkinInfo.DockControlCaptionNonFocusedTextColor + else + if ASkinInfo.DockControlCaption <> nil then + AColor := ASkinInfo.DockControlCaption.TextColor; + + if AColor = clDefault then + Result := inherited GetCaptionFontColor(IsActive) + else + Result := AColor; +end; + +function TdxDockControlSkinPainter.GetCaptionRect(const ARect: TRect; + AIsVertical: Boolean): TRect; +var + ABorder: Integer; + ACaptionButtonSize: Integer; + ACaptionHeight: Integer; +begin + ABorder := GetBorderWidth; + Result := inherited GetCaptionRect(ARect, AIsVertical); + InflateRect(Result, ABorder, ABorder); + Inc(Result.Top, GetTopBorderSize); + ACaptionButtonSize := GetCaptionButtonSize; + ACaptionHeight := Max(GetCaptionHeight, ACaptionButtonSize + 4); + ACaptionHeight := ACaptionHeight + Integer(Odd(ACaptionHeight + ACaptionButtonSize)); + if AIsVertical then + Result.Right := Result.Left + ACaptionHeight + else + Result.Bottom := Result.Top + ACaptionHeight; +end; + +function TdxDockControlSkinPainter.GetElementState(IsActive: Boolean; + IsDown: Boolean; IsHot: Boolean): TdxSkinElementState; +begin + if IsDown then + Result := esPressed + else + if IsHot then + Result := esHot + else + if IsActive then + Result := esActive + else + Result := esNormal; +end; + +function TdxDockControlSkinPainter.GetHideBarButtonFontColor: TColor; +var + AColor: TdxSkinColor; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AColor := nil; + if GetSkinPainterData(ASkinInfo) then + AColor := ASkinInfo.DockControlHideBarTextColor; + if AColor = nil then + Result := inherited GetHideBarButtonFontColor + else + Result := AColor.Value; +end; + +function TdxDockControlSkinPainter.GetTabFontColor(IsActive: Boolean): TColor; +var + AColor: TdxSkinColor; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AColor := nil; + if GetSkinPainterData(ASkinInfo) then + AColor := ASkinInfo.DockControlTabTextColor[IsActive]; + if AColor = nil then + Result := inherited GetTabFontColor(IsActive) + else + Result := AColor.Value; +end; + +function TdxDockControlSkinPainter.GetTopBorderSize: Integer; +begin + Result := 2; +end; + +function TdxDockControlSkinPainter.GetTabHorizInterval: Integer; +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.DockControlTabHeader; + if (AElement = nil) then + Result := inherited GetTabHorizInterval + else + Result := AElement.ContentOffset.Left; +end; + +function TdxDockControlSkinPainter.GetTabHorizOffset: Integer; +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := inherited GetTabHorizOffset; + if GetSkinPainterData(ASkinInfo) then + Inc(Result, ASkinInfo.DockControlIndents[1]); +end; + +function TdxDockControlSkinPainter.GetTabsHeight: Integer; +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.DockControlTabHeader; + if (AElement = nil) then + Result := inherited GetTabsHeight + else + with AElement.ContentOffset do + Result := Top + Bottom + Max(GetImageHeight + 4, GetFont.Size + 10); +end; + +function TdxDockControlSkinPainter.GetTabVertInterval: Integer; +begin + Result := 0; +end; + +function TdxDockControlSkinPainter.GetTabVertOffset: Integer; +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.DockControlIndents[2] + else + Result := inherited GetTabVertOffset; +end; + +function TdxDockControlSkinPainter.GetSkinLookAndFeelPainter: TcxCustomLookAndFeelPainterClass; +var + I: Integer; +begin + Result := nil; + with DockControl.Controller do + for I := 0 to DockManagerCount - 1 do + begin + Result := DockManagers[I].LookAndFeel.SkinPainter; + if Result <> nil then Break; + end; +end; + +function TdxDockControlSkinPainter.GetSkinPainterData( + var AData: TdxSkinLookAndFeelPainterInfo): Boolean; +begin + Result := GetExtendedStylePainters.GetPainterData(GetSkinLookAndFeelPainter, + AData); +end; + +function TdxDockControlSkinPainter.DrawCaptionFirst: Boolean; +begin + Result := True; +end; + +procedure TdxDockControlSkinPainter.DrawClippedElement(ACanvas: TCanvas; + const ARect, AClipRect: TRect; AElement: TdxSkinElement; + AState: TdxSkinElementState = esNormal); +var + ATempCanvas: TcxCanvas; +begin + ATempCanvas := TcxCanvas.Create(ACanvas); + try + ATempCanvas.SaveClipRegion; + try + ATempCanvas.SetClipRegion(TcxRegion.Create(AClipRect), roSet); + AElement.Draw(ACanvas.Handle, ARect, 0, AState); + finally + ATempCanvas.RestoreClipRegion; + end; + finally + ATempCanvas.Free; + end; +end; + +function TdxDockControlSkinPainter.InternalDrawCaptionButton(ACanvas: TCanvas; + AGlyphIndex: Integer; ARect: TRect; AState: TdxSkinElementState): Boolean; +var + AElement: TdxSkinElement; + AGlyph: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + AGlyph := nil; + if GetSkinPainterData(ASkinInfo) then + begin + AElement := ASkinInfo.DockControlWindowButton; + AGlyph := ASkinInfo.DockControlWindowButtonGlyphs; + end; + Result := (AElement <> nil) and (AGlyph <> nil); + if Result then + begin + FButtonsCache.CheckCacheState(AElement, ARect, AState); + FButtonsCache.Draw(ACanvas.Handle, ARect); + AGlyph.Draw(ACanvas.Handle, cxRectContent(ARect, AElement.ContentOffset.Rect), + AGlyphIndex, AState); + end; +end; + +function TdxDockControlSkinPainter.InternalDrawTabButton(ACanvas: TCanvas; + ARect: TRect; IsDown, IsHot, IsEnable, IsNextButton: Boolean): Boolean; +const + AScrollPart: array[Boolean] of TcxScrollBarPart = (sbpLineUp, sbpLineDown); +var + AElementInfo: TdxSkinScrollInfo; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + AState: TdxSkinElementState; +begin + AElementInfo := nil; + if GetSkinPainterData(ASkinInfo) then + AElementInfo := ASkinInfo.ScrollBar_Elements[True, AScrollPart[IsNextButton]]; + Result := (AElementInfo <> nil) and (AElementInfo.Element <> nil); + if Result then + begin + if IsEnable then + begin + AState := esNormal; + if IsDown then + AState := esPressed + else + if IsHot then + AState := esHot + end + else + AState := esDisabled; + with AElementInfo do + Element.Draw(ACanvas.Handle, ARect, ImageIndex, AState); + end; +end; + +initialization + CustomSkinPainterClass := TdxDockControlSkinPainter; + +finalization + CustomSkinPainterClass := nil; + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinsdxLCPainter.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxLCPainter.pas new file mode 100644 index 00000000..825e30bd --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxLCPainter.pas @@ -0,0 +1,599 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinsdxLCPainter; + +{$I cxVer.inc} + +interface + +uses + Windows, Classes, Controls, Graphics, cxGraphics, dxLayoutCommon, + dxLayoutLookAndFeels, dxLayoutControl, cxLookAndFeels, cxClasses, + dxSkinsLookAndFeelPainter, dxSkinsCore, cxLookAndFeelPainters; + +type + + { TdxLayoutSkinLookAndFeel } + + TdxLayoutSkinLookAndFeel = class(TdxLayoutStandardLookAndFeel) + private + FLookAndFeel: TcxLookAndFeel; + FPainterData: TdxSkinLookAndFeelPainterInfo; + function GetSkinNameAssigned: Boolean; + function GetSkinName: TdxSkinName; + function IsSkinNameStored: Boolean; + procedure SetSkinNameAssigned(AValue: Boolean); + procedure SetSkinName(const AValue: TdxSkinName); + protected + function ForceControlArrangement: Boolean; override; + function GetInternalName: string; override; + procedure SetInternalName(const AValue: string); override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); + procedure UpdateSkinInfo; + + property PainterData: TdxSkinLookAndFeelPainterInfo read FPainterData; + public + class function Description: String; override; + + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + function GetEmptyAreaColor: TColor; override; + function GetGroupBorderWidth(AControl: TControl; ASide: TdxLayoutSide; + AHasCaption: Boolean): Integer; override; + function GetGroupPainterClass: TClass; override; + function GetGroupViewInfoClass: TClass; override; + function GetItemPainterClass: TClass; override; + + property LookAndFeel: TcxLookAndFeel read FLookAndFeel; + published + property SkinName: TdxSkinName read GetSkinName write SetSkinName stored IsSkinNameStored; + property SkinNameAssigned: Boolean read GetSkinNameAssigned write SetSkinNameAssigned default False; + end; + + { TdxLayoutGroupCaptionSkinPainter } + + TdxLayoutGroupCaptionSkinPainter = class(TdxLayoutGroupCaptionPainter) + protected + procedure BeforeDrawText; override; + procedure DrawBackground; override; + end; + + { TdxLayoutGroupSkinViewInfo } + + TdxLayoutGroupSkinViewInfo = class(TdxLayoutGroupStandardViewInfo) + private + function GetCaptionBorderSize: TRect; + function IsSkinAvalaible: Boolean; + protected + function CalculateCaptionViewInfoBounds: TRect; override; + function GetClientBounds: TRect; override; + function GetColor: TColor; override; + function GetFrameBounds: TRect; override; + function GetIsTransparent: Boolean; override; + function HasSkinBackground: Boolean; virtual; + end; + + { TdxLayoutGroupSkinPainter } + + TdxLayoutGroupSkinPainter = class(TdxLayoutGroupStandardPainter) + private + procedure DrawBorderCaptionPart(ACanvas: TcxCanvas; const ABounds: TRect; + ACaptionElement: TdxSkinElement); + protected + function GetCaptionPainterClass: TdxCustomLayoutItemCaptionPainterClass; override; + function GetPainerData(var AData: TdxSkinLookAndFeelPainterInfo): Boolean; + function IsParentBackground: Boolean; virtual; + procedure DrawBorders; override; + procedure DrawCaption; override; + procedure DrawItemsArea; override; + public + procedure Paint; override; + end; + + { TdxLayoutItemCaptionSkinPainter } + + TdxLayoutItemCaptionSkinPainter = class(TdxLayoutItemCaptionPainter) + protected + procedure BeforeDrawText; override; + procedure DrawBackground; override; + end; + + { TdxLayoutItemSkinPainter } + + TdxLayoutItemSkinPainter = class(TdxLayoutItemPainter) + protected + function GetCaptionPainterClass: TdxCustomLayoutItemCaptionPainterClass; override; + function GetPainterData(var AData: TdxSkinLookAndFeelPainterInfo): Boolean; + public + procedure Paint; override; + end; + + TdxLayoutItemViewInfoAccess = class(TdxLayoutItemViewInfo); + TdxLayoutGroupViewInfoAccess = class(TdxLayoutGroupViewInfo); + TdxLayoutControlViewInfoAccess = class(TdxLayoutControlViewInfo); + +implementation + +{ TdxLayoutSkinLookAndFeel } + +constructor TdxLayoutSkinLookAndFeel.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FLookAndFeel := TcxLookAndFeel.Create(Self); + FLookAndFeel.OnChanged := LookAndFeelChanged; + UpdateSkinInfo; +end; + +destructor TdxLayoutSkinLookAndFeel.Destroy; +begin + FLookAndFeel.Free; + inherited Destroy; +end; + +procedure TdxLayoutSkinLookAndFeel.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + UpdateSkinInfo; + if lfvSkinName in AChangedValues then + Changed; +end; + +procedure TdxLayoutSkinLookAndFeel.UpdateSkinInfo; +begin + GetExtendedStylePainters.GetPainterData(LookAndFeel.SkinPainter, FPainterData); +end; + +class function TdxLayoutSkinLookAndFeel.Description: String; +begin + Result := 'Skin'; +end; + +function TdxLayoutSkinLookAndFeel.GetEmptyAreaColor: TColor; +var + AElement: TdxSkinColor; +begin + if PainterData <> nil then + AElement := PainterData.LayoutControlColor + else + AElement := nil; + if AElement = nil then + Result := inherited GetEmptyAreaColor + else + Result := AElement.Value; + if Result = clDefault then + Result := clBtnFace; +end; + +function TdxLayoutSkinLookAndFeel.GetGroupBorderWidth(AControl: TControl; + ASide: TdxLayoutSide; AHasCaption: Boolean): Integer; +var + AGroupBox: TdxSkinElement; + AFont: TFont; +begin + if PainterData <> nil then + AGroupBox := PainterData.GroupBoxCaptionElements[cxgpTop] + else + AGroupBox := nil; + if AGroupBox <> nil then + begin + AFont := GetGroupCaptionFont(AControl); + if ASide in [sdTop, sdBottom] then + begin + Result := DLUToPixels(AFont, 4); + if (ASide = sdTop) and AHasCaption then + Inc(Result, VDLUToPixels(AFont, 11)); + end + else + Result := DLUToPixels(AFont, 2); + if AHasCaption then + with AGroupBox.ContentOffset.Rect do + Result := Top + Bottom + Result; + end + else + Result := inherited GetGroupBorderWidth(AControl, ASide, AHasCaption); +end; + +function TdxLayoutSkinLookAndFeel.GetGroupPainterClass: TClass; +begin + Result := TdxLayoutGroupSkinPainter; +end; + +function TdxLayoutSkinLookAndFeel.GetGroupViewInfoClass: TClass; +begin + Result := TdxLayoutGroupSkinViewInfo; +end; + +function TdxLayoutSkinLookAndFeel.GetItemPainterClass: TClass; +begin + Result := TdxLayoutItemSkinPainter; +end; + +function TdxLayoutSkinLookAndFeel.ForceControlArrangement: Boolean; +begin + Result := True; +end; + +function TdxLayoutSkinLookAndFeel.GetInternalName: string; +begin + Result := FLookAndFeel.SkinName; +end; + +procedure TdxLayoutSkinLookAndFeel.SetInternalName(const AValue: string); +var + I: Integer; +begin + FLookAndFeel.SkinName := AValue; + for I := 0 to UserCount - 1 do + Users[I].LookAndFeelChanged; +end; + +function TdxLayoutSkinLookAndFeel.IsSkinNameStored: Boolean; +begin + Result := SkinNameAssigned; +end; + +function TdxLayoutSkinLookAndFeel.GetSkinName: TdxSkinName; +begin + Result := InternalName; +end; + +procedure TdxLayoutSkinLookAndFeel.SetSkinName(const AValue: TdxSkinName); +begin + InternalName := AValue; +end; + +function TdxLayoutSkinLookAndFeel.GetSkinNameAssigned: Boolean; +begin + Result := lfvSkinName in FLookAndFeel.AssignedValues +end; + +procedure TdxLayoutSkinLookAndFeel.SetSkinNameAssigned(AValue: Boolean); +begin + if AValue then + FLookAndFeel.AssignedValues := FLookAndFeel.AssignedValues + [lfvSkinName] + else + FLookAndFeel.AssignedValues := FLookAndFeel.AssignedValues - [lfvSkinName]; +end; + +{ TdxLayoutGroupCaptionSkinPainter } + +procedure TdxLayoutGroupCaptionSkinPainter.BeforeDrawText; +begin + Canvas.Font := ViewInfo.Font; + Canvas.Font.Color := ViewInfo.TextColor; + if ViewInfo.IsTextUnderlined then + Canvas.Font.Style := Canvas.Font.Style + [fsUnderline]; + Canvas.Brush.Style := bsClear; +end; + +procedure TdxLayoutGroupCaptionSkinPainter.DrawBackground; +begin +end; + +{ TdxLayoutGroupSkinViewInfo } + +function TdxLayoutGroupSkinViewInfo.CalculateCaptionViewInfoBounds: TRect; +var + ACaptionWidth: Integer; +begin + if IsSkinAvalaible then + begin + Result := BorderBounds[sdTop]; + with GetCaptionBorderSize do + begin + Inc(Result.Top, Top); + Dec(Result.Bottom, Bottom); + end; + ACaptionWidth := CaptionViewInfo.CalculateWidth; + with Result do + begin + case Item.CaptionOptions.AlignHorz of + taLeftJustify: + begin + Inc(Left, CaptionViewInfoOffset); + Right := Left + ACaptionWidth; + end; + taRightJustify: + begin + Dec(Right, CaptionViewInfoOffset); + Left := Right - ACaptionWidth; + end; + taCenter: + begin + Left := (Left + Right - ACaptionWidth) div 2; + Right := Left + ACaptionWidth; + end; + end; + Top := (Result.Bottom + Result.Top - CaptionViewInfo.CalculateHeight) div 2; + end; + end + else + Result := inherited CalculateCaptionViewInfoBounds; +end; + +function TdxLayoutGroupSkinViewInfo.GetCaptionBorderSize: TRect; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; + AGroupBoxCaption: TdxSkinElement; +begin + ASkinPainterInfo := TdxLayoutSkinLookAndFeel(LookAndFeel).PainterData; + if ASkinPainterInfo <> nil then + AGroupBoxCaption := ASkinPainterInfo.GroupBoxCaptionElements[cxgpTop] + else + AGroupBoxCaption := nil; + if AGroupBoxCaption <> nil then + Result := AGroupBoxCaption.ContentOffset.Rect + else + Result := cxEmptyRect; +end; + +function TdxLayoutGroupSkinViewInfo.IsSkinAvalaible: Boolean; +begin + Result := TdxLayoutSkinLookAndFeel(LookAndFeel).PainterData <> nil; +end; + +function TdxLayoutGroupSkinViewInfo.GetClientBounds: TRect; +var + ACaptionHeight: Integer; + AGroupBox: TdxSkinElement; + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + ASkinPainterInfo := TdxLayoutSkinLookAndFeel(LookAndFeel).PainterData; + if ASkinPainterInfo <> nil then + AGroupBox := ASkinPainterInfo.GroupBoxElements[cxgpTop] + else + AGroupBox := nil; + + if AGroupBox <> nil then + begin + Result := Bounds; + if HasBorder then + begin + ACaptionHeight := CaptionViewInfo.CalculateHeight; + if ACaptionHeight <> 0 then + with GetCaptionBorderSize do + ACaptionHeight := ACaptionHeight + Top + Bottom; + with AGroupBox.ContentOffset.Rect do + begin + Inc(Result.Left, Left); + Inc(Result.Top, Top + ACaptionHeight); + Dec(Result.Right, Right); + Dec(Result.Bottom, Bottom); + end; + end; + end + else + Result := inherited GetClientBounds; +end; + +function TdxLayoutGroupSkinViewInfo.GetColor: TColor; +var + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; + ALayoutControl: TdxSkinColor; +begin + ALayoutControl := nil; + ASkinPainterInfo := TdxLayoutSkinLookAndFeel(LookAndFeel).PainterData; + if ASkinPainterInfo <> nil then + ALayoutControl := ASkinPainterInfo.LayoutControlColor; + if ALayoutControl = nil then + Result := inherited GetColor + else + Result := ALayoutControl.Value; +end; + +function TdxLayoutGroupSkinViewInfo.GetFrameBounds: TRect; +begin + Result := Bounds; + Result.Top := BorderBounds[sdTop].Bottom; +end; + +function TdxLayoutGroupSkinViewInfo.GetIsTransparent: Boolean; +begin + if IsSkinAvalaible then + Result := HasSkinBackground + else + Result := inherited GetIsTransparent; +end; + +function TdxLayoutGroupSkinViewInfo.HasSkinBackground: Boolean; +begin + Result := Group.ShowBorder; + if not Result and (Group.Parent <> nil) and (ParentViewInfo is TdxLayoutGroupSkinViewInfo) then + Result := TdxLayoutGroupSkinViewInfo(ParentViewInfo).HasSkinBackground + else + if Group.Parent = nil then + Result := inherited GetIsTransparent; +end; + +{ TdxLayoutGroupSkinPainter } + +procedure TdxLayoutGroupSkinPainter.DrawBorders; +var + AGroupBox: TdxSkinElement; + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + AGroupBox := nil; + if GetPainerData(ASkinPainterInfo) then + AGroupBox := ASkinPainterInfo.GroupBoxElements[cxgpTop]; + if AGroupBox = nil then + inherited DrawBorders + else + with TdxLayoutGroupSkinViewInfo(ViewInfo) do + begin + if not IsParentBackground then + AGroupBox.Draw(Canvas.Handle, FrameBounds); + if not HasCaption then + DrawBorderCaptionPart(Canvas, FrameBounds, + ASkinPainterInfo.GroupBoxCaptionElements[cxgpTop]); + end; +end; + +procedure TdxLayoutGroupSkinPainter.DrawCaption; +var + ACaption: TdxSkinElement; + ACaptionRect: TRect; + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + ACaption := nil; + if GetPainerData(ASkinPainterInfo) then + ACaption := ASkinPainterInfo.GroupBoxCaptionElements[cxgpTop]; + if Assigned(ACaption) then + with ViewInfo do + begin + ACaptionRect := Bounds; + ACaptionRect.Bottom := FrameBounds.Top; + ACaption.Draw(Canvas.Handle, ACaptionRect); + end; + inherited DrawCaption; +end; + +procedure TdxLayoutGroupSkinPainter.DrawBorderCaptionPart(ACanvas: TcxCanvas; + const ABounds: TRect; ACaptionElement: TdxSkinElement); +var + ACaptionRect: TRect; +begin + if ACaptionElement <> nil then + begin + ACanvas.SaveClipRegion; + try + ACaptionRect := ABounds; + ACanvas.SetClipRegion(TcxRegion.Create(ACaptionRect), roIntersect); + ACaptionRect.Bottom := ACaptionRect.Top + ACaptionElement.Size.cy; + OffsetRect(ACaptionRect, 0, -ACaptionElement.Size.cy + 1); + ACaptionElement.Draw(ACanvas.Handle, ACaptionRect); + finally + ACanvas.RestoreClipRegion; + end; + end; +end; + +procedure TdxLayoutGroupSkinPainter.DrawItemsArea; +var + AContent: TdxSkinColor; + ASkinPainterInfo: TdxSkinLookAndFeelPainterInfo; +begin + if not TdxLayoutGroupSkinViewInfo(ViewInfo).IsTransparent then + begin + AContent := nil; + if GetPainerData(ASkinPainterInfo) then + AContent := ASkinPainterInfo.LayoutControlColor; + if AContent = nil then + inherited DrawItemsArea + else + Canvas.FillRect(ViewInfo.ClientBounds, AContent.Value); + end; +end; + +function TdxLayoutGroupSkinPainter.GetCaptionPainterClass: TdxCustomLayoutItemCaptionPainterClass; +begin + Result := TdxLayoutGroupCaptionSkinPainter; +end; + +function TdxLayoutGroupSkinPainter.GetPainerData( + var AData: TdxSkinLookAndFeelPainterInfo): Boolean; +begin + AData := TdxLayoutSkinLookAndFeel(LookAndFeel).PainterData; + Result := AData <> nil; +end; + +function TdxLayoutGroupSkinPainter.IsParentBackground: Boolean; +begin + with TdxLayoutGroupSkinViewInfo(ViewInfo) do + Result := TdxLayoutControlViewInfoAccess(ContainerViewInfo).HasBackground; +end; + +procedure TdxLayoutGroupSkinPainter.Paint; +begin + inherited Paint; + with TdxLayoutGroupSkinViewInfo(ViewInfo) do + if not IsTransparent then + Canvas.FillRect(ClientBounds, LookAndFeel.GetEmptyAreaColor) +end; + +{ TdxLayoutItemSkinPainter } + +function TdxLayoutItemSkinPainter.GetCaptionPainterClass: TdxCustomLayoutItemCaptionPainterClass; +begin + Result := TdxLayoutItemCaptionSkinPainter; +end; + +function TdxLayoutItemSkinPainter.GetPainterData( + var AData: TdxSkinLookAndFeelPainterInfo): Boolean; +begin + AData := TdxLayoutSkinLookAndFeel(LookAndFeel).PainterData; + Result := AData <> nil; +end; + +procedure TdxLayoutItemSkinPainter.Paint; +begin + with TdxLayoutItemViewInfoAccess(ViewInfo) do + begin + with TdxLayoutGroupViewInfoAccess(ParentViewInfo) do + if not IsTransparent then + Canvas.FillRect(Bounds, LookAndFeel.GetEmptyAreaColor); + if HasControl and ControlViewInfo.OpaqueControl then + Canvas.ExcludeClipRect(ControlViewInfo.ControlBounds); + if HasControl then + DrawControl; + if HasCaption then + DrawCaption; + InternalDrawSelection; + Canvas.ExcludeClipRect(Bounds); + end; +end; + +{ TdxLayoutItemCaptionSkinPainter } + +procedure TdxLayoutItemCaptionSkinPainter.BeforeDrawText; +begin + Canvas.Font := ViewInfo.Font; + Canvas.Font.Color := ViewInfo.TextColor; + if ViewInfo.IsTextUnderlined then + Canvas.Font.Style := Canvas.Font.Style + [fsUnderline]; + Canvas.Brush.Style := bsClear; +end; + +procedure TdxLayoutItemCaptionSkinPainter.DrawBackground; +begin +end; + +initialization + dxLayoutLookAndFeelDefs.Register(TdxLayoutSkinLookAndFeel); + +finalization + dxLayoutLookAndFeelDefs.Unregister(TdxLayoutStandardLookAndFeel); + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinsdxLCPainterReg.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxLCPainterReg.pas new file mode 100644 index 00000000..9162df71 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxLCPainterReg.pas @@ -0,0 +1,70 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinsdxLCPainterReg; + +{$I cxVer.inc} + +interface + +uses + Classes, DesignIntf, dxSkinsDesignHelperReg, dxLayoutControl, dxSkinsdxLCPainter; + +procedure Register; + +implementation + +type + TdxSkinsdxLayoutControlSelectionEditor = class(TdxSkinsBaseSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + +{ TdxSkinsdxLayoutControlSelectionEditor } + +procedure TdxSkinsdxLayoutControlSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + inherited RequiresUnits(Proc); + Proc('dxSkinsdxLCPainter'); +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterSelectionEditor(TdxLayoutControl, TdxSkinsdxLayoutControlSelectionEditor); +end; + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinsdxNavBar2Painter.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxNavBar2Painter.pas new file mode 100644 index 00000000..1d367c5a --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxNavBar2Painter.pas @@ -0,0 +1,745 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinsdxNavBar2Painter; + +interface + +uses + Types, Windows, Graphics, Classes, ImgList, + dxNavBar, dxNavBarBase, dxNavBarCollns, dxNavBarStyles, dxNavBarExplorerViews, + dxNavBarGraphics, dxNavBarConsts, dxNavBarOffice11Views, dxNavBarOfficeViews, + cxLookAndFeels, cxLookAndFeelPainters,cxGraphics, cxClasses, dxSkinInfo, + dxNavBarSkinBasedViews, dxSkinsCore, dxSkinsLookAndFeelPainter, dxNavBarCustomPainters; + +type + TdxNavBarSkinPainterHelper = class(TdxNavBarSkinBasedPainterHelper) + private + FLookAndFeel: TcxLookAndFeel; + protected + function GetSkinsCount: Integer; override; + function GetSkinNames(AIndex: Integer): TdxSkinName; override; + function GetSkinInfoClass: TdxSkinInfoClass; override; + function GetSkinName: TdxSkinName; override; + function GetSkinPainterData(var AData: TdxSkinInfo): Boolean; override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); + procedure SetSkinName(AValue: TdxSkinName); override; + public + constructor Create(ASkinName: TdxSkinName); override; + destructor Destroy; override; + + function NavBarDragDropItemTarget: TdxSkinElement; override; + function NavBarSeparator: TdxSkinElement; override; + function NavPanePopupControl: TdxSkinElement; override; + end; + + { TdxNavBarSkinNavPaneLinkViewInfo } + + TdxNavBarSkinNavPaneLinkViewInfo = class(TdxNavBarSkinBasedNavPaneLinkViewInfo) + public + function SelectionRect: TRect; override; + end; + + { TdxNavBarSkinNavPaneGroupViewInfo } + + TdxNavBarSkinNavPaneGroupViewInfo = class(TdxNavBarSkinBasedNavPaneGroupViewInfo); + + { TdxNavBarSkinOverflowPanelViewInfo } + + TdxNavBarSkinOverflowPanelViewInfo = class(TdxNavBarSkinBasedOverflowPanelViewInfo) + private + function GetMinHeight: Integer; + protected + function GetHeight: Integer; override; + function GetImageWidthAddon: Integer; override; + function GetSignWidth: Integer; override; + end; + + { TdxNavBarSkinNavPaneViewInfo } + + TdxNavBarSkinNavPaneViewInfo = class(TdxNavBarSkinBasedNavPaneViewInfo) + protected + function GetGroupBorderOffsets: TRect; override; + function GetGroupCaptionSignSize: TSize; override; + function GetGroupHeaderTextIndent: Integer; override; + function GetHeaderClientOffset: TRect; override; + function GetHeaderHeightAddon: Integer; override; + function GetHeaderSignIndents: TRect; override; + function GetOverflowPanelViewInfoClass: TdxNavBarOverflowPanelViewInfoClass; override; + public + function BorderColor: TColor; override; + function BorderWidth: Integer; override; + function CollapseBarFontColor: TColor; override; + end; + + { TdxNavBarSkinPopupControlViewInfo } + + TdxNavBarSkinPopupControlViewInfo = class(TdxNavBarSkinBasedPopupControlViewInfo) + protected + function GetBorderOffsets: TRect; override; + end; + + { TdxNavBarSkinNavPanePainter } + + TdxNavBarSkinNavPanePainter = class(TdxNavBarSkinBasedNavPanePainter) + private + function GetLookAndFeel: TcxLookAndFeel; + function GetOverflowPanelViewInfo: TdxNavBarSkinOverflowPanelViewInfo; + function GetSkinName: TdxSkinName; + function GetSkinNameAssigned: Boolean; + function IsSkinNameStored: Boolean; + procedure SetLookAndFeel(AValue: TcxLookAndFeel); + procedure SetSkinName(const AValue: TdxSkinName); + procedure SetSkinNameAssigned(AValue: Boolean); + protected + class function GetViewInfoClass: TdxNavBarViewInfoClass; override; + class function GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; override; + class function GetLinkViewInfoClass: TdxNavBarLinkViewInfoClass; override; + class function GetSkinPainterHelperClass: TdxNavBarSkinBasedPainterHelperClass; override; + class function GetPopupControlViewInfoClass: TdxNavBarPopupControlViewInfoClass; override; + + function GetSplitterType: Integer; override; + function GetMasterLookAndFeel: TcxLookAndFeel; override; + public + procedure Assign(Source: TPersistent); override; + + procedure DrawBackground; override; + procedure DrawBorder; override; + procedure DrawGroupBackground(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawGroupControl(ACanvas: TCanvas; ARect: TRect; + AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawSeparator(ALinkViewInfo: TdxNavBarLinkViewInfo); override; + procedure DrawSizeGrip(ACanvas: TCanvas; const ARect: TRect); override; + property LookAndFeel: TcxLookAndFeel read GetLookAndFeel write SetLookAndFeel; + property OverflowPanelViewInfo: TdxNavBarSkinOverflowPanelViewInfo read GetOverflowPanelViewInfo; + published + property SkinName: TdxSkinName read GetSkinName write SetSkinName stored IsSkinNameStored; + property SkinNameAssigned: Boolean read GetSkinNameAssigned write SetSkinNameAssigned default False; + end; + + { TdxNavBarSkinExplorerBarViewInfo } + + TdxNavBarSkinExplorerBarViewInfo = class(TdxNavBarExplorerBarViewInfo) + protected + function GetHelper: TdxNavBarSkinPainterHelper; + + function GetGroupBorderOffsets: TRect; override; + function GetGroupCaptionSignSize: TSize; override; + end; + + { TdxNavBarSkinExplorerBarPainter } + + TdxNavBarSkinExplorerBarPainter = class(TdxNavBarSkinBasedExplorerBarPainter) + private + function GetLookAndFeel: TcxLookAndFeel; + function GetSkinName: TdxSkinName; + function GetSkinNameAssigned: Boolean; + function IsSkinNameStored: Boolean; + procedure SetLookAndFeel(AValue: TcxLookAndFeel); + procedure SetSkinName(const AValue: TdxSkinName); + procedure SetSkinNameAssigned(AValue: Boolean); + protected + class function GetViewInfoClass: TdxNavBarViewInfoClass; override; + class function GetSkinPainterHelperClass: TdxNavBarSkinBasedPainterHelperClass; override; + class function SignPainterClass: TdxNavBarCustomSignPainterClass; override; + + function GetMasterLookAndFeel: TcxLookAndFeel; override; + public + procedure Assign(Source: TPersistent); override; + + procedure DrawBackground; override; + procedure DrawGroupBackground(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawGroupControl(ACanvas: TCanvas; ARect: TRect; + AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawGroupControlSplitter(AGroupViewInfo: TdxNavBarExplorerBarGroupViewInfo); override; + procedure DrawSeparator(ALinkViewInfo: TdxNavBarLinkViewInfo); override; + property LookAndFeel: TcxLookAndFeel read GetLookAndFeel write SetLookAndFeel; + published + property SkinName: TdxSkinName read GetSkinName write SetSkinName stored IsSkinNameStored; + property SkinNameAssigned: Boolean read GetSkinNameAssigned write SetSkinNameAssigned default False; + end; + +implementation + +uses + dxNavBarViewsFact, Math, cxGeometry; + +type + TdxCustomNavBarAccess = class(TdxCustomNavBar); + +{ TdxNavBarSkinPainterHelper } + +constructor TdxNavBarSkinPainterHelper.Create(ASkinName: TdxSkinName); +begin + inherited Create(ASkinName); + FLookAndFeel := TcxLookAndFeel.Create(nil); + FLookAndFeel.NativeStyle := False; + FLookAndFeel.OnChanged := LookAndFeelChanged; +end; + +destructor TdxNavBarSkinPainterHelper.Destroy; +begin + FLookAndFeel.Free; + inherited; +end; + +function TdxNavBarSkinPainterHelper.NavBarDragDropItemTarget: TdxSkinElement; +begin + Result := nil; +end; + +function TdxNavBarSkinPainterHelper.NavBarSeparator: TdxSkinElement; +begin + Result := nil; +end; + +function TdxNavBarSkinPainterHelper.NavPanePopupControl: TdxSkinElement; +var + ASkinInfo: TdxSkinInfo; +begin + Result := nil; + if GetSkinPainterData(ASkinInfo) then + Result := ASkinInfo.NavPaneFormBorder; +end; + +function TdxNavBarSkinPainterHelper.GetSkinsCount: Integer; +begin + Result := GetExtendedStylePainters.Count; +end; + +function TdxNavBarSkinPainterHelper.GetSkinNames(AIndex: Integer): TdxSkinName; +begin + Result := GetExtendedStylePainters.Names[AIndex]; +end; + +function TdxNavBarSkinPainterHelper.GetSkinInfoClass: TdxSkinInfoClass; +begin + Result := TdxSkinInfo; +end; + +function TdxNavBarSkinPainterHelper.GetSkinName: TdxSkinName; +begin + Result := FLookAndFeel.SkinName; +end; + +function TdxNavBarSkinPainterHelper.GetSkinPainterData(var AData: TdxSkinInfo): Boolean; +begin + Result := GetExtendedStylePainters.GetPainterData(FLookAndFeel.SkinPainter, AData); +end; + +procedure TdxNavBarSkinPainterHelper.LookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); +begin + DoChanged; +end; + +procedure TdxNavBarSkinPainterHelper.SetSkinName(AValue: TdxSkinName); +begin + FLookAndFeel.SkinName := AValue; +end; + +{ TdxNavBarSkinNavPaneLinkViewInfo } + +function TdxNavBarSkinNavPaneLinkViewInfo.SelectionRect: TRect; +begin + Result := Rect; + InflateRect(Result, -1, 0); + if not TdxCustomNavBarAccess(NavBar).IsInternal then + Result := cxRectContent(Result, GetSkinElementOffsets(GetSkinHelper.NavPaneGroupClient)); +end; + +{ TdxNavBarSkinOverflowPanelViewInfo } + +function TdxNavBarSkinOverflowPanelViewInfo.GetHeight: Integer; +begin + Result := inherited GetHeight; + if IsSkinAvailable and (Result > 0) then + Result := Max(Result, GetMinHeight); +end; + +function TdxNavBarSkinOverflowPanelViewInfo.GetImageWidthAddon: Integer; +var + AElement: TdxSkinElement; +begin + AElement := GetSkinHelper.NavPaneOverflowPanelItem; + if AElement = nil then + Result := inherited GetImageWidthAddon + else + with AElement.ContentOffset do + Result := (Left + Right) div 2; +end; + +function TdxNavBarSkinOverflowPanelViewInfo.GetSignWidth: Integer; +begin + if IsSkinAvailable then + Result := GetItemSelectionWidth + else + Result := inherited GetSignWidth; +end; + +function TdxNavBarSkinOverflowPanelViewInfo.GetMinHeight: Integer; +var + AElement: TdxSkinElement; +begin + Result := GetClientOffset.Top + GetClientOffset.Bottom + GetImageHeight; + AElement := GetSkinHelper.NavPaneOverflowPanelItem; + if AElement <> nil then + with AElement.ContentOffset do + Inc(Result, Top + Bottom); +end; + +{ TdxNavBarSkinNavPaneViewInfo } + +function TdxNavBarSkinNavPaneViewInfo.BorderColor: TColor; +begin + if IsSkinAvailable then + Result := HeaderFontColor + else + Result := inherited BorderColor; +end; + +function TdxNavBarSkinNavPaneViewInfo.BorderWidth: Integer; +begin + if IsSkinAvailable then + Result := 0 + else + Result := inherited BorderWidth; +end; + +function TdxNavBarSkinNavPaneViewInfo.CollapseBarFontColor: TColor; +var + AElement: TdxSkinElement; +begin + AElement := GetSkinHelper.NavPaneItemPanel; + if AElement <> nil then + Result := AElement.TextColor + else + Result := inherited CollapseBarFontColor; +end; + +function TdxNavBarSkinNavPaneViewInfo.GetGroupBorderOffsets: TRect; +var + AOffsets: TRect; +begin + Result := inherited GetGroupBorderOffsets; + if not TdxCustomNavBarAccess(NavBar).IsInternal then + begin + if IsTopBorderNeeded then + Result.Top := Result.Top + 1; + if IsBottomBorderNeeded then + Result.Bottom := Result.Bottom + 1; + AOffsets := GetSkinElementOffsets(GetSkinHelper.NavPaneGroupClient); + Inc(Result.Left, AOffsets.Left); + Inc(Result.Right, AOffsets.Right); + end; +end; + +function TdxNavBarSkinNavPaneViewInfo.GetGroupCaptionSignSize: TSize; +var + AElement: TdxSkinElement; +begin + AElement := GetSkinHelper.NavePaneHeaderSign(False); + if AElement <> nil then + Result := AElement.Size + else + Result := inherited GetGroupCaptionSignSize; +end; + +function TdxNavBarSkinNavPaneViewInfo.GetGroupHeaderTextIndent: Integer; +begin + if IsSkinAvailable then + Result := 0 + else + Result := inherited GetGroupHeaderTextIndent; +end; + +function TdxNavBarSkinNavPaneViewInfo.GetHeaderClientOffset: TRect; +var + AElement: TdxSkinElement; +begin + AElement := GetSkinHelper.NavPaneHeader; + if AElement <> nil then + Result := AElement.ContentOffset.Rect + else + Result := inherited GetHeaderClientOffset; +end; + +function TdxNavBarSkinNavPaneViewInfo.GetHeaderHeightAddon: Integer; +begin + if IsSkinAvailable then + Result := GetHeaderClientOffset.Top + GetHeaderClientOffset.Bottom + else + Result := inherited GetHeaderHeightAddon; +end; + +function TdxNavBarSkinNavPaneViewInfo.GetHeaderSignIndents: TRect; +begin + Result := inherited GetHeaderSignIndents; + if IsSkinAvailable then + Result.Right := 0; +end; + +function TdxNavBarSkinNavPaneViewInfo.GetOverflowPanelViewInfoClass: TdxNavBarOverflowPanelViewInfoClass; +begin + Result := TdxNavBarSkinOverflowPanelViewInfo; +end; + +{ TdxNavBarSkinPopupControlViewInfo } + +function TdxNavBarSkinPopupControlViewInfo.GetBorderOffsets: TRect; +var + AElement: TdxSkinElement; +begin + AElement := GetSkinHelper.NavPanePopupControl; + if AElement <> nil then + if not AElement.Image.Empty then + Result := AElement.Image.Margins.Rect + else + with AElement.Borders do + Result := cxRect(Left.Thin, Top.Thin, Right.Thin, Bottom.Thin) + else + Result := inherited GetBorderOffsets; +end; + +{ TdxNavBarSkinNavPanePainter } + +procedure TdxNavBarSkinNavPanePainter.Assign(Source: TPersistent); +begin + if Source is TdxNavBarSkinNavPanePainter then + LookAndFeel := TdxNavBarSkinNavPanePainter(Source).LookAndFeel + else + inherited; +end; + +class function TdxNavBarSkinNavPanePainter.GetViewInfoClass: TdxNavBarViewInfoClass; +begin + Result := TdxNavBarSkinNavPaneViewInfo; +end; + +class function TdxNavBarSkinNavPanePainter.GetGroupViewInfoClass: TdxNavBarGroupViewInfoClass; +begin + Result := TdxNavBarSkinNavPaneGroupViewInfo; +end; + +class function TdxNavBarSkinNavPanePainter.GetLinkViewInfoClass: TdxNavBarLinkViewInfoClass; +begin + Result := TdxNavBarSkinNavPaneLinkViewInfo; +end; + +class function TdxNavBarSkinNavPanePainter.GetSkinPainterHelperClass: TdxNavBarSkinBasedPainterHelperClass; +begin + Result := TdxNavBarSkinPainterHelper; +end; + +class function TdxNavBarSkinNavPanePainter.GetPopupControlViewInfoClass: TdxNavBarPopupControlViewInfoClass; +begin + Result := TdxNavBarSkinPopupControlViewInfo; +end; + +function TdxNavBarSkinNavPanePainter.GetSplitterType: Integer; +begin + Result := 0; +end; + +function TdxNavBarSkinNavPanePainter.GetMasterLookAndFeel: TcxLookAndFeel; +begin + Result := LookAndFeel; +end; + +function TdxNavBarSkinNavPanePainter.IsSkinNameStored: Boolean; +begin + Result := SkinNameAssigned; +end; + +function TdxNavBarSkinNavPanePainter.GetLookAndFeel: TcxLookAndFeel; +begin + Result := TdxNavBarSkinPainterHelper(FSkinBasedPainterHelper).FLookAndFeel; +end; + +function TdxNavBarSkinNavPanePainter.GetOverflowPanelViewInfo: TdxNavBarSkinOverflowPanelViewInfo; +begin + Result := TdxNavBarSkinOverflowPanelViewInfo(inherited OverflowPanelViewInfo); +end; + +function TdxNavBarSkinNavPanePainter.GetSkinName: TdxSkinName; +begin + Result := ColorSchemeName; +end; + +function TdxNavBarSkinNavPanePainter.GetSkinNameAssigned: Boolean; +begin + Result := lfvSkinName in LookAndFeel.AssignedValues; +end; + +procedure TdxNavBarSkinNavPanePainter.SetLookAndFeel(AValue: TcxLookAndFeel); +begin + LookAndFeel.Assign(AValue); +end; + +procedure TdxNavBarSkinNavPanePainter.SetSkinName(const AValue: TdxSkinName); +begin + ColorSchemeName := AValue; +end; + +procedure TdxNavBarSkinNavPanePainter.SetSkinNameAssigned(AValue: Boolean); +begin + if AValue then + LookAndFeel.AssignedValues := LookAndFeel.AssignedValues + [lfvSkinName] + else + LookAndFeel.AssignedValues := LookAndFeel.AssignedValues - [lfvSkinName]; +end; + +procedure TdxNavBarSkinNavPanePainter.DrawBackground; +var + AElement: TdxSkinElement; +begin + AElement := FSkinBasedPainterHelper.NavBarBackground; + if AElement = nil then + inherited DrawBackground + else + begin + Canvas.Brush.Color := AElement.Color; + Canvas.FillRect(NavBar.ClientRect); + end; +end; + +procedure TdxNavBarSkinNavPanePainter.DrawBorder; + + procedure DrawBorder(AElement: TdxSkinElement; ADrawRect, AClipRect: TRect); + begin + if AElement = nil then Exit; + cxCanvas.SaveClipRegion; + try + cxCanvas.SetClipRegion(TcxRegion.Create(AClipRect), roIntersect); + AElement.Draw(cxCanvas.Handle, ADrawRect); + finally + cxCanvas.RestoreClipRegion; + end; + end; + + procedure DrawTopBorder(const ARect: TRect); + begin + DrawBorder(FSkinBasedPainterHelper.NavPaneHeader, cxRectSetBottom(ARect, ARect.Top + 1), cxRectSetHeight(ARect, 1)); + end; + + procedure DrawBottomBorder(const ARect: TRect); + begin + DrawBorder(FSkinBasedPainterHelper.NavPaneSplitter, cxRectSetTop(ARect, ARect.Bottom - 1), cxRectSetBottom(ARect, ARect.Bottom, 1)); + end; + +begin + if not IsSkinAvailable then + inherited DrawBorder + else + if not TdxCustomNavBarAccess(NavBar).IsInternal then + begin + if TdxNavBarSkinNavPaneViewInfo(ViewInfo).IsTopBorderNeeded then + DrawTopBorder(NavBar.ClientRect); + if TdxNavBarSkinNavPaneViewInfo(ViewInfo).IsBottomBorderNeeded then + DrawBottomBorder(NavBar.ClientRect); + end +end; + +procedure TdxNavBarSkinNavPanePainter.DrawGroupBackground(AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + if not DrawSkinElement(FSkinBasedPainterHelper.NavPaneGroupClient, Canvas, AGroupViewInfo.ItemsRect, + 0, esNormal, TdxCustomNavBarAccess(NavBar).IsInternal) then + inherited DrawGroupBackground(AGroupViewInfo) +end; + +procedure TdxNavBarSkinNavPanePainter.DrawGroupControl(ACanvas: TCanvas; ARect: TRect; + AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + if not DrawSkinElement(FSkinBasedPainterHelper.NavPaneGroupClient, ACanvas, ARect, + 0, esNormal, True) then + inherited DrawGroupControl(ACanvas, ARect, AGroupViewInfo); +end; + +procedure TdxNavBarSkinNavPanePainter.DrawSeparator(ALinkViewInfo: TdxNavBarLinkViewInfo); +var + ARect: TRect; +begin + Canvas.Brush.Color := ALinkViewInfo.FontColor; + ARect := cxRectInflate(ALinkViewInfo.Rect, -1, 0); + if not TdxCustomNavBarAccess(NavBar).IsInternal then + ARect := cxRectContent(ARect, GetSkinElementOffsets(FSkinBasedPainterHelper.NavPaneGroupClient)); + Canvas.FillRect(cxRectCenter(ARect, cxRectWidth(ARect), 1)); +end; + +procedure TdxNavBarSkinNavPanePainter.DrawSizeGrip(ACanvas: TCanvas; const ARect: TRect); +begin + if not DrawSkinElement(FSkinBasedPainterHelper.NavPaneSizeGrip, ACanvas, ARect) then + inherited; +end; + +{ TdxNavBarSkinExplorerBarViewInfo } + +function TdxNavBarSkinExplorerBarViewInfo.GetHelper: TdxNavBarSkinPainterHelper; +begin + Result := TdxNavBarSkinPainterHelper(TdxNavBarSkinExplorerBarPainter(Painter).FSkinBasedPainterHelper); +end; + +function TdxNavBarSkinExplorerBarViewInfo.GetGroupBorderOffsets: TRect; +begin + if TdxNavBarSkinExplorerBarPainter(Painter).IsSkinAvailable then + Result := GetSkinElementOffsets(GetHelper.NavBarGroupClient) + else + Result := inherited GetGroupBorderOffsets; +end; + +function TdxNavBarSkinExplorerBarViewInfo.GetGroupCaptionSignSize: TSize; +var + AElement: TdxSkinElement; +begin + AElement := GetHelper.NavBarGroupSigns(True); + if AElement <> nil then + Result := AElement.Size + else + Result := inherited GetGroupCaptionSignSize; +end; + +{ TdxNavBarSkinExplorerBarPainter } + +procedure TdxNavBarSkinExplorerBarPainter.Assign(Source: TPersistent); +begin + if Source is TdxNavBarSkinExplorerBarPainter then + LookAndFeel := TdxNavBarSkinExplorerBarPainter(Source).LookAndFeel + else + inherited; +end; + +procedure TdxNavBarSkinExplorerBarPainter.DrawBackground; +begin + if not DrawSkinElement(FSkinBasedPainterHelper.NavBarBackground, Canvas, NavBar.ClientRect) then + inherited; +end; + +procedure TdxNavBarSkinExplorerBarPainter.DrawGroupBackground(AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + if not IsSkinAvailable then + inherited; +end; + +procedure TdxNavBarSkinExplorerBarPainter.DrawGroupControl(ACanvas: TCanvas; + ARect: TRect; AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + if not DrawSkinElement(FSkinBasedPainterHelper.NavBarGroupClient, ACanvas, ARect, 0, esNormal, True) then + inherited; +end; + +procedure TdxNavBarSkinExplorerBarPainter.DrawGroupControlSplitter(AGroupViewInfo: TdxNavBarExplorerBarGroupViewInfo); +begin +//do nothing +end; + +procedure TdxNavBarSkinExplorerBarPainter.DrawSeparator(ALinkViewInfo: TdxNavBarLinkViewInfo); +var + ARect: TRect; +begin + Canvas.Brush.Color := ALinkViewInfo.FontColor; + ARect := cxRectInflate(ALinkViewInfo.Rect, -1, 0); + ARect := cxRectContent(ARect, GetSkinElementOffsets(FSkinBasedPainterHelper.NavBarGroupClient)); + Canvas.FillRect(cxRectCenter(ARect, cxRectWidth(ARect), 1)); +end; + +class function TdxNavBarSkinExplorerBarPainter.GetViewInfoClass: TdxNavBarViewInfoClass; +begin + Result := TdxNavBarSkinExplorerBarViewInfo; +end; + +class function TdxNavBarSkinExplorerBarPainter.GetSkinPainterHelperClass: TdxNavBarSkinBasedPainterHelperClass; +begin + Result := TdxNavBarSkinPainterHelper; +end; + +class function TdxNavBarSkinExplorerBarPainter.SignPainterClass: TdxNavBarCustomSignPainterClass; +begin + Result := TdxNavBarExplorerBarSignPainter; +end; + +function TdxNavBarSkinExplorerBarPainter.GetMasterLookAndFeel: TcxLookAndFeel; +begin + Result := LookAndFeel; +end; + +function TdxNavBarSkinExplorerBarPainter.IsSkinNameStored: Boolean; +begin + Result := SkinNameAssigned; +end; + +procedure TdxNavBarSkinExplorerBarPainter.SetLookAndFeel(AValue: TcxLookAndFeel); +begin + LookAndFeel.Assign(AValue); +end; + +procedure TdxNavBarSkinExplorerBarPainter.SetSkinName(const AValue: TdxSkinName); +begin + ColorSchemeName := AValue; +end; + +function TdxNavBarSkinExplorerBarPainter.GetLookAndFeel: TcxLookAndFeel; +begin + Result := TdxNavBarSkinPainterHelper(FSkinBasedPainterHelper).FLookAndFeel; +end; + +function TdxNavBarSkinExplorerBarPainter.GetSkinName: TdxSkinName; +begin + Result := ColorSchemeName; +end; + +function TdxNavBarSkinExplorerBarPainter.GetSkinNameAssigned: Boolean; +begin + Result := lfvSkinName in LookAndFeel.AssignedValues; +end; + +procedure TdxNavBarSkinExplorerBarPainter.SetSkinNameAssigned(AValue: Boolean); +begin + if AValue then + LookAndFeel.AssignedValues := LookAndFeel.AssignedValues + [lfvSkinName] + else + LookAndFeel.AssignedValues := LookAndFeel.AssignedValues - [lfvSkinName]; +end; + +initialization + dxNavBarViewsFactory.RegisterView(dxNavBarSkinExplorerBarView, + 'SkinExplorerBarView', TdxNavBarSkinExplorerBarPainter); + dxNavBarViewsFactory.RegisterView(dxNavBarSkinNavigatorPaneView, + 'SkinNavigationPaneView', TdxNavBarSkinNavPanePainter); + RegisterClasses([TdxNavBarSkinNavPanePainter, TdxNavBarSkinExplorerBarPainter]); + +finalization + dxNavBarViewsFactory.UnRegisterView(dxNavBarSkinExplorerBarView); + dxNavBarViewsFactory.UnRegisterView(dxNavBarSkinNavigatorPaneView); + +end. + diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinsdxNavBar2PainterReg.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxNavBar2PainterReg.pas new file mode 100644 index 00000000..fe56b0c7 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxNavBar2PainterReg.pas @@ -0,0 +1,71 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinsdxNavBar2PainterReg; + +{$I cxVer.inc} + +interface + +uses + Classes, DesignIntf, dxSkinsDesignHelperReg, dxNavBar, dxSkinsdxNavBar2Painter; + +procedure Register; + +implementation + +type + TdxSkinsdxNavBar2SelectionEditor = class(TdxSkinsBaseSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + +{ TdxSkinsdxNavBarSelectionEditor } + +procedure TdxSkinsdxNavBar2SelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + inherited RequiresUnits(Proc); + Proc('dxSkinsdxNavBar2Painter'); +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterSelectionEditor(TdxNavBar, TdxSkinsdxNavBar2SelectionEditor); +end; + +end. + diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinsdxNavBarPainter.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxNavBarPainter.pas new file mode 100644 index 00000000..f5424fd7 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxNavBarPainter.pas @@ -0,0 +1,1087 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinsdxNavBarPainter; + +interface + +uses + Types, Windows, Graphics, Classes, dxNavBar, dxNavBarBase, dxNavBarCollns, dxNavBarStyles, + dxNavBarExplorerViews, dxNavBarGraphics, cxLookAndFeels, cxLookAndFeelPainters, + dxSkinsLookAndFeelPainter, dxNavBarConsts, dxNavBarOffice11Views, ImgList, + cxGraphics, cxClasses, dxNavBarOfficeViews; + +type + + { TdxNavBarSkinNavPaneLinkViewInfo } + + TdxNavBarSkinNavPaneLinkViewInfo = class(TdxNavBarOffice3LinkViewInfo) + public + function FontColor: TColor; override; + function SelectionRect: TRect; override; + end; + + { TdxNavBarSkinNavPaneGroupViewInfo } + + TdxNavBarSkinNavPaneGroupViewInfo = class(TdxNavBarOffice11NavPaneGroupViewInfo) + public + function CaptionFontColor: TColor; override; + end; + + { TdxNavBarSkinNavPaneViewInfo } + + TdxNavBarSkinNavPaneViewInfo = class(TdxNavBarOffice11NavPaneViewInfo) + protected + function GetOverflowPanelClientOffset: TRect; override; + function GetOverflowPanelImageWidthAddon: Integer; override; + function GetOverflowPanelSignWidth: Integer; override; + function GetSkinInfo(var ASkinInfo: TdxSkinLookAndFeelPainterInfo): Boolean; + public + procedure AssignDefaultNavigationPaneHeaderStyle; override; + function GetHeaderHeight: Integer; override; + function GetOverflowPanelHeight: Integer; override; + function HeaderFont: TFont; override; + function HeaderFontColor: TColor; override; + end; + + { TdxNavBarSkinNavPanePainter } + + TdxNavBarSkinNavPanePainter = class(TdxNavBarOffice11NavPanePainter) + private + FLookAndFeel: TcxLookAndFeel; + function GetSkinNameAssigned: Boolean; + function GetSkinName: TdxSkinName; + function InternalDrawScrollButton(ADownButton: Boolean; const ARect: TRect; + AState: TdxNavBarObjectStates): Boolean; + function IsSkinNameStored: Boolean; + procedure SetSkinNameAssigned(AValue: Boolean); + procedure SetSkinName(const Value: TdxSkinName); + // Custom draw + function CustomDrawHeader: Boolean; + function CustomDrawOverflowPanel: Boolean; + function CustomDrawSplitter: Boolean; + protected + function CreateViewInfo: TdxNavBarViewInfo; override; + function CreateGroupViewInfo(AViewInfo: TdxNavBarViewInfo; AGroup: TdxNavBarGroup; + ACaptionVisible: Boolean; AItemsVisible: Boolean): TdxNavBarGroupViewInfo; override; + function CreateLinkViewInfo(AViewInfo: TdxNavBarGroupViewInfo; + ALink: TdxNavBarItemLink; ACaptionVisible: Boolean; + AImageVisisble: Boolean): TdxNavBarLinkViewInfo; override; + function GetMasterLookAndFeel: TcxLookAndFeel; override; + function GetSkinPainterData(var AData: TdxSkinLookAndFeelPainterInfo): Boolean; virtual; + function IsSkinAvailable: Boolean; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); virtual; + public + constructor Create(ANavBar: TdxCustomNavBar); override; + destructor Destroy; override; + + procedure DrawBackground; override; + procedure DrawBorder; override; + procedure DrawBottomScrollButton; override; + procedure DrawGroupBorder(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawGroupCaptionButton(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawGroupControl(ACanvas: TCanvas; ARect: TRect; + AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawHeader; override; + procedure DrawItemSelection(ALinkViewInfo: TdxNavBarLinkViewInfo); override; + procedure DrawOverflowPanel; override; + procedure DrawOverflowPanelItems; override; + procedure DrawOverflowPanelSign; override; + procedure DrawPopupMenuItem(ACanvas: TCanvas; ARect: TRect; + AImageList: TCustomImageList; AImageIndex: Integer; AText: String; + State: TdxNavBarObjectStates); override; + procedure DrawSplitter; override; + procedure DrawTopScrollButton; override; + property LookAndFeel: TcxLookAndFeel read FLookAndFeel; + published + property SkinName: TdxSkinName read GetSkinName write SetSkinName stored IsSkinNameStored; + property SkinNameAssigned: Boolean read GetSkinNameAssigned write SetSkinNameAssigned default False; + end; + + { TdxNavBarSkinExplorerBarPainter } + + TdxNavBarSkinExplorerBarPainter = class(TdxNavBarExplorerBarPainter) + private + FLookAndFeel: TcxLookAndFeel; + function GetSkinNameAssigned: Boolean; + function GetSkinName: TdxSkinName; + function IsSkinNameStored: Boolean; + procedure SetSkinNameAssigned(AValue: Boolean); + procedure SetSkinName(const Value: TdxSkinName); + protected + function CreateGroupViewInfo(AViewInfo: TdxNavBarViewInfo; AGroup: TdxNavBarGroup; + ACaptionVisible: Boolean; AItemsVisible: Boolean): TdxNavBarGroupViewInfo; override; + function CreateLinkViewInfo(AViewInfo: TdxNavBarGroupViewInfo; + ALink: TdxNavBarItemLink; ACaptionVisible: Boolean; + AImageVisisble: Boolean): TdxNavBarLinkViewInfo; override; + function GetMasterLookAndFeel: TcxLookAndFeel; override; + function GetSkinPainterData(var AData: TdxSkinLookAndFeelPainterInfo): Boolean; virtual; + function IsSkinAvailable: Boolean; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); virtual; + public + constructor Create(ANavBar: TdxCustomNavBar); override; + destructor Destroy; override; + + procedure DrawBackground; override; + procedure DrawGroupBackground(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawGroupBorder(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawGroupCaption(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawGroupCaptionButton(AGroupViewInfo: TdxNavBarGroupViewInfo); override; + procedure DrawGroupControl(ACanvas: TCanvas; ARect: TRect; + AGroupViewInfo: TdxNavBarGroupViewInfo); override; + property LookAndFeel: TcxLookAndFeel read FLookAndFeel; + published + property SkinName: TdxSkinName read GetSkinName write SetSkinName stored IsSkinNameStored; + property SkinNameAssigned: Boolean read GetSkinNameAssigned write SetSkinNameAssigned default False; + end; + + { TdxNavBarSkinExplorerBarLinkViewInfo } + + TdxNavBarSkinExplorerBarLinkViewInfo = class(TdxNavBarLinkViewInfo) + public + function FontColor: TColor; override; + end; + + { TdxNavBarSkinExplorerBarGroupViewInfo } + + TdxNavBarSkinExplorerBarGroupViewInfo = class(TdxNavBarGroupViewInfo) + public + function CaptionFontColor: TColor; override; + procedure CalculateBounds(X: Integer; Y: Integer); override; + end; + +implementation + +uses + dxNavBarViewsFact, dxSkinsCore, Math, cxGeometry; + +function NavBarObjectStateToSkinState(AState: TdxNavBarObjectStates): TdxSkinElementState; +begin + Result := esNormal; + if sPressed in AState then + Result := esPressed + else + if sHotTracked in AState then + Result := esHot + else + if sDisabled in AState then + Result := esDisabled; +end; + +{ TdxNavBarSkinNavPaneGroupViewInfo } + +function TdxNavBarSkinNavPaneGroupViewInfo.CaptionFontColor: TColor; +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + with TdxNavBarSkinNavPanePainter(Painter) do + begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.NavPaneGroupButton[False]; + if AElement <> nil then + Result := AElement.TextColor + else + Result := inherited CaptionFontColor; + end; +end; + +{ TdxNavBarSkinNavPaneLinkViewInfo } + +function TdxNavBarSkinNavPaneLinkViewInfo.FontColor: TColor; +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + with TdxNavBarSkinNavPanePainter(Painter) do + begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.NavPaneItem; + if AElement <> nil then + Result := AElement.TextColor + else + Result := inherited FontColor; + end; +end; + +function TdxNavBarSkinNavPaneLinkViewInfo.SelectionRect: TRect; +begin + Result := Rect; + InflateRect(Result, -2, 0); +end; + +{ TdxNavBarSkinNavPaneViewInfo } + +procedure TdxNavBarSkinNavPaneViewInfo.AssignDefaultNavigationPaneHeaderStyle; +begin + with NavBar.DefaultStyles.NavigationPaneHeader do + begin + ResetValues; + HAlignment := haCenter; + BackColor := clNone; + BackColor2 := clNone; + Font.Color := clNone; + Font.Name := 'Arial'; + Font.Style := [fsBold]; + Font.Size := 9; + end; +end; + +function TdxNavBarSkinNavPaneViewInfo.HeaderFont: TFont; +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := inherited HeaderFont; + if (Result.Size = 9) and GetSkinInfo(ASkinInfo) then + if Assigned(ASkinInfo.NavPaneCaptionFontSize) then + Result.Size := ASkinInfo.NavPaneCaptionFontSize.Value; +end; + +function TdxNavBarSkinNavPaneViewInfo.HeaderFontColor: TColor; +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinInfo(ASkinInfo) and (ASkinInfo.NavPaneGroupCaption <> nil) then + Result := ASkinInfo.NavPaneGroupCaption.TextColor + else + Result := inherited HeaderFontColor; +end; + +function TdxNavBarSkinNavPaneViewInfo.GetHeaderHeight: Integer; +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := inherited GetHeaderHeight; + if GetSkinInfo(ASkinInfo) then + if Assigned(ASkinInfo.NavPaneCaptionHeight) then + Result := Max(ASkinInfo.NavPaneCaptionHeight.Value, Result); +end; + +function TdxNavBarSkinNavPaneViewInfo.GetOverflowPanelHeight: Integer; +var + AOverflowButton: TdxSkinElement; + AOverflowPanel: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := inherited GetOverflowPanelHeight; + if GetSkinInfo(ASkinInfo) then + begin + AOverflowButton := ASkinInfo.NavPaneOverflowPanelItem; + AOverflowPanel := ASkinInfo.NavPaneOverflowPanel; + if (AOverflowButton <> nil) and (AOverflowPanel <> nil) then + with AOverflowPanel.ContentOffset do + Result := Max(Result, Top + Bottom + AOverflowButton.Size.cy); + end; +end; + +function TdxNavBarSkinNavPaneViewInfo.GetOverflowPanelClientOffset: TRect; +var + AOverflowPanel: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AOverflowPanel := nil; + if GetSkinInfo(ASkinInfo) then + AOverflowPanel := ASkinInfo.NavPaneOverflowPanel; + + if AOverflowPanel = nil then + Result := inherited GetOverflowPanelClientOffset + else + Result := AOverflowPanel.ContentOffset.Rect; +end; + +function TdxNavBarSkinNavPaneViewInfo.GetOverflowPanelImageWidthAddon: Integer; +var + AOverflowButton: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinInfo(ASkinInfo) then + AOverflowButton := ASkinInfo.NavPaneOverflowPanelItem + else + AOverflowButton := nil; + + if AOverflowButton = nil then + Result := inherited GetOverflowPanelImageWidthAddon + else + with AOverflowButton.ContentOffset do + Result := (Left + Right) div 2; +end; + +function TdxNavBarSkinNavPaneViewInfo.GetOverflowPanelSignWidth: Integer; +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := inherited GetOverflowPanelSignWidth; + if GetSkinInfo(ASkinInfo) then + begin + if ASkinInfo.NavPaneOverflowPanelExpandedItem <> nil then + with ASkinInfo.NavPaneOverflowPanelExpandedItem do + Result := Max(Size.cx, Result); + end; +end; + +function TdxNavBarSkinNavPaneViewInfo.GetSkinInfo( + var ASkinInfo: TdxSkinLookAndFeelPainterInfo): Boolean; +begin + with TdxNavBarSkinNavPanePainter(Painter) do + Result := GetSkinPainterData(ASkinInfo); +end; + +{ TdxNavBarSkinNavPanePainter } + +constructor TdxNavBarSkinNavPanePainter.Create(ANavBar: TdxCustomNavBar); +begin + inherited Create(ANavBar); + FLookAndFeel := TcxLookAndFeel.Create(nil); + FLookAndFeel.NativeStyle := False; + FLookAndFeel.OnChanged := LookAndFeelChanged; +end; + +destructor TdxNavBarSkinNavPanePainter.Destroy; +begin + FLookAndFeel.Free; + inherited Destroy; +end; + +function TdxNavBarSkinNavPanePainter.CreateViewInfo: TdxNavBarViewInfo; +begin + Result := TdxNavBarSkinNavPaneViewInfo.Create(Self); +end; + +function TdxNavBarSkinNavPanePainter.CreateGroupViewInfo(AViewInfo: TdxNavBarViewInfo; + AGroup: TdxNavBarGroup; ACaptionVisible: Boolean; AItemsVisible: Boolean): TdxNavBarGroupViewInfo; +begin + Result := TdxNavBarSkinNavPaneGroupViewInfo.Create(AViewInfo, AGroup, ACaptionVisible, + AItemsVisible); +end; + +function TdxNavBarSkinNavPanePainter.CreateLinkViewInfo(AViewInfo: TdxNavBarGroupViewInfo; + ALink: TdxNavBarItemLink; ACaptionVisible: Boolean; + AImageVisisble: Boolean): TdxNavBarLinkViewInfo; +begin + Result := TdxNavBarSkinNavPaneLinkViewInfo.Create(AViewInfo, ALink, ACaptionVisible, + AImageVisisble); +end; + +function TdxNavBarSkinNavPanePainter.GetMasterLookAndFeel: TcxLookAndFeel; +begin + Result := FLookAndFeel; +end; + +function TdxNavBarSkinNavPanePainter.GetSkinPainterData( + var AData: TdxSkinLookAndFeelPainterInfo): Boolean; +begin + Result := GetExtendedStylePainters.GetPainterData(FLookAndFeel.SkinPainter, AData); +end; + +procedure TdxNavBarSkinNavPanePainter.LookAndFeelChanged( + Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); +begin + NavBar.InvalidateAll(doRecreate); +end; + +function TdxNavBarSkinNavPanePainter.InternalDrawScrollButton(ADownButton: Boolean; + const ARect: TRect; AState: TdxNavBarObjectStates): Boolean; +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.NavPaneScrollButtons[ADownButton]; + Result := AElement <> nil; + if Result then + AElement.Draw(Canvas.Handle, ARect, 0, NavBarObjectStateToSkinState(AState)); +end; + +function TdxNavBarSkinNavPanePainter.IsSkinAvailable: Boolean; +begin + Result := FLookAndFeel.SkinPainter <> nil; +end; + +function TdxNavBarSkinNavPanePainter.IsSkinNameStored: Boolean; +begin + Result := SkinNameAssigned; +end; + +function TdxNavBarSkinNavPanePainter.GetSkinName: TdxSkinName; +begin + Result := FLookAndFeel.SkinName; +end; + +procedure TdxNavBarSkinNavPanePainter.SetSkinName(const Value: TdxSkinName); +begin + FLookAndFeel.SkinName := Value; +end; + +function TdxNavBarSkinNavPanePainter.GetSkinNameAssigned: Boolean; +begin + Result := lfvSkinName in FLookAndFeel.AssignedValues; +end; + +procedure TdxNavBarSkinNavPanePainter.SetSkinNameAssigned(AValue: Boolean); +begin + if AValue then + FLookAndFeel.AssignedValues := FLookAndFeel.AssignedValues + [lfvSkinName] + else + FLookAndFeel.AssignedValues := FLookAndFeel.AssignedValues - [lfvSkinName]; +end; + +function TdxNavBarSkinNavPanePainter.CustomDrawHeader: Boolean; +begin + Result := False; + if Assigned(NavBar.OnCustomDrawNavigationPaneHeader) then + NavBar.OnCustomDrawNavigationPaneHeader(NavBar, Canvas, ViewInfo, Result); +end; + +function TdxNavBarSkinNavPanePainter.CustomDrawOverflowPanel: Boolean; +begin + Result := False; + if Assigned(NavBar.OnCustomDrawNavigationPaneOverflowPanel) then + NavBar.OnCustomDrawNavigationPaneOverflowPanel(NavBar, Canvas, ViewInfo, Result); +end; + +function TdxNavBarSkinNavPanePainter.CustomDrawSplitter: Boolean; +begin + Result := False; + if Assigned(NavBar.OnCustomDrawNavigationPaneSplitter) then + NavBar.OnCustomDrawNavigationPaneSplitter(NavBar, Canvas, ViewInfo, Result); +end; + +procedure TdxNavBarSkinNavPanePainter.DrawBackground; +var + AColor: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AColor := nil; + if GetSkinPainterData(ASkinInfo) then + AColor := ASkinInfo.NavBarBackgroundColor; + if AColor = nil then + inherited DrawBackground + else + begin + Canvas.Brush.Color := AColor.Color; + Canvas.FillRect(NavBar.ClientRect); + end; +end; + +procedure TdxNavBarSkinNavPanePainter.DrawBorder; +begin + if not IsSkinAvailable then + inherited DrawBorder; +end; + +procedure TdxNavBarSkinNavPanePainter.DrawBottomScrollButton; +begin + with ViewInfo do + if not InternalDrawScrollButton(True, BottomScrollButtonRect, + BottomScrollButtonState) + then + inherited DrawBottomScrollButton; +end; + +procedure TdxNavBarSkinNavPanePainter.DrawHeader; +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if not CustomDrawHeader then + begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.NavPaneGroupCaption; + if AElement = nil then + inherited DrawHeader + else + begin + AElement.Draw(Canvas.Handle, ViewInfo.HeaderRect); + DrawHeaderText; + end; + end; +end; + +procedure TdxNavBarSkinNavPanePainter.DrawGroupBorder(AGroupViewInfo: TdxNavBarGroupViewInfo); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.NavPaneGroupClient; + if AElement = nil then + inherited DrawGroupBorder(AGroupViewInfo) + else + begin + AElement.Draw(Canvas.Handle, AGroupViewInfo.ControlRect); + end; +end; + +procedure TdxNavBarSkinNavPanePainter.DrawGroupCaptionButton( + AGroupViewInfo: TdxNavBarGroupViewInfo); +var + AElement: TdxSkinElement; + ARect: TRect; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + with AGroupViewInfo do + begin + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.NavPaneGroupButton[sActive in AGroupViewInfo.State]; + if AElement = nil then + inherited DrawGroupCaptionButton(AGroupViewInfo) + else + begin + ARect := AGroupViewInfo.CaptionRect; + Dec(ARect.Top); + AElement.Draw(Canvas.Handle, ARect, 0, NavBarObjectStateToSkinState(State)); + end; + end; +end; + +procedure TdxNavBarSkinNavPanePainter.DrawGroupControl(ACanvas: TCanvas; ARect: TRect; + AGroupViewInfo: TdxNavBarGroupViewInfo); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.NavPaneGroupClient; + + if AElement = nil then + inherited DrawGroupControl(ACanvas, ARect, AGroupViewInfo) + else + AElement.Draw(ACanvas.Handle, ARect); +end; + +procedure TdxNavBarSkinNavPanePainter.DrawItemSelection( + ALinkViewInfo: TdxNavBarLinkViewInfo); +var + AItem: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + AState: TdxSkinElementState; +begin + AItem := nil; + AState := NavBarObjectStateToSkinState(ALinkViewInfo.State); + + if GetSkinPainterData(ASkinInfo) then + if (AState = esNormal) and (sSelected in ALinkViewInfo.State) then + AItem := ASkinInfo.NavPaneSelectedItem + else + AItem := ASkinInfo.NavPaneItem; + + if AItem = nil then + inherited DrawItemSelection(ALinkViewInfo) + else + AItem.Draw(Canvas.Handle, ALinkViewInfo.SelectionRect, 0, AState); +end; + +procedure TdxNavBarSkinNavPanePainter.DrawOverflowPanel; +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if not CustomDrawOverflowPanel then + begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.NavPaneOverflowPanel; + if AElement = nil then + inherited DrawOverflowPanel + else + begin + AElement.Draw(Canvas.Handle, ViewInfo.OverflowPanelRect); + DrawOverflowPanelSign; + DrawOverflowPanelItems; + end; + end; +end; + +procedure TdxNavBarSkinNavPanePainter.DrawOverflowPanelItems; +var + AElementItem: TdxSkinElement; + AElementState: TdxSkinElementState; + AGroup: TdxNavBarGroup; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + I: Integer; + R: TRect; +begin + AElementItem := nil; + if GetSkinPainterData(ASkinInfo) then + AElementItem := ASkinInfo.NavPaneOverflowPanelItem; + if AElementItem = nil then + inherited DrawOverflowPanelItems + else + with ViewInfo do + for I := 0 to OverflowPanelVisibleItemCount - 1 do + begin + R := OverflowPanelItems[I].SelectionRect; + AGroup := OverflowPanelItems[I].Group; + if NavBar.NavigationPaneOverflowPanelHotTrackedIndex = I then + AElementState := esHot + else + if NavBar.NavigationPaneOverflowPanelPressedIndex = I then + AElementState := esPressed + else + AElementState := esNormal; + AElementItem.Draw(Canvas.Handle, R, Byte(AGroup = NavBar.ActiveGroup), + AElementState); + R := ViewInfo.OverflowPanelItems[I].Rect; + with ImagePainterClass do + if IsValidImage(GetOverflowPanelImageList, GetOverflowPanelImageIndex(AGroup)) then + DrawImage(Canvas, GetOverflowPanelImageList, GetOverflowPanelImageIndex(AGroup), R) + else + if NavBar.NavigationPaneOverflowPanelUseSmallImages then + Canvas.Draw(R.Left, R.Top, dxOffice11NavPaneDefaultSmallBitmap) + else + Canvas.Draw(R.Left, R.Top, dxOffice11NavPaneDefaultLargeBitmap); + end; +end; + +procedure TdxNavBarSkinNavPanePainter.DrawOverflowPanelSign; +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + AState: TdxSkinElementState; +begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.NavPaneOverflowPanelExpandedItem; + if AElement = nil then + inherited DrawOverflowPanelSign + else + with ViewInfo do + begin + if NavBar.NavigationPaneOverflowPanelSignPressed then + AState := esPressed + else + if NavBar.NavigationPaneOverflowPanelSignHotTracked then + AState := esHot + else + AState := esNormal; + AElement.Draw(Canvas.Handle, ViewInfo.OverflowPanelSignRect, 0, AState); + end; +end; + +procedure TdxNavBarSkinNavPanePainter.DrawPopupMenuItem(ACanvas: TCanvas; ARect: TRect; + AImageList: TCustomImageList; AImageIndex: Integer; AText: String; + State: TdxNavBarObjectStates); +var + ABuf: TcxBitmap; + APopupMenu: TdxSkinElement; + ASelected: TdxSkinElement; + ASeparator: TdxSkinElement; + ASideStrip: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + AImageAreaWidth: Integer; + R: TRect; + + function InitializeElements: Boolean; + begin + Result := GetSkinPainterData(ASkinInfo); + if Result then + begin + APopupMenu := ASkinInfo.PopupMenu; + ASelected := ASkinInfo.PopupMenuLinkSelected; + ASeparator := ASkinInfo.PopupMenuSeparator; + ASideStrip := ASkinInfo.PopupMenuSideStrip; + Result := (APopupMenu <> nil) and (ASelected <> nil) and (ASeparator <> nil) and + (ASideStrip <> nil); + end; + end; + + procedure DrawImage(ACanvas: TCanvas; AIsActive: Boolean; AImageAreaWidth: Integer); + var + R: TRect; + begin + R := ARect; + OffsetRect(R, -R.Left, -R.Top); + R.Right := R.Left + AImageAreaWidth; + + if AIsActive then + ASelected.Draw(ACanvas.Handle, R); + + with TdxNavBarSkinNavPaneViewInfo(ViewInfo) do + InflateRect(R, -GetOverflowPanelPopupMenuImageIndent, + -GetOverflowPanelPopupMenuImageIndent); + AImageList.Draw(ACanvas, R.Left, R.Top, AImageIndex, not (sDisabled in State)); + end; + + procedure DrawItemText(ACanvas: TCanvas; AImageAreaWidth: Integer); + var + R: TRect; + begin + R := ARect; + OffsetRect(R, -R.Left, -R.Top); + + with TdxNavBarSkinNavPaneViewInfo(ViewInfo) do + R.Left := AImageAreaWidth + GetOverflowPanelPopupMenuTextIndent; + + if sDisabled in State then + ACanvas.Font.Color := clGrayText + else + ACanvas.Font.Color := clMenuText; + + ACanvas.Brush.Style := bsClear; + cxDrawText(ACanvas.Handle, AText, R, DT_LEFT or DT_VCENTER or DT_SINGLELINE); + end; + + procedure DrawMenuBackground(ACanvas: TCanvas; AImageAreaWidth: Integer); + var + R: TRect; + begin + R := ARect; + OffsetRect(R, -R.Left, -R.Top); + with APopupMenu.Borders do + begin + Dec(R.Left, Left.Thin); + Dec(R.Top, Top.Thin); + Inc(R.Right, Right.Thin); + Inc(R.Bottom, Bottom.Thin); + end; + APopupMenu.Draw(ABuf.Canvas.Handle, R); + + R := ARect; + OffsetRect(R, -R.Left, -R.Top); + R.Right := R.Left + AImageAreaWidth + 2; + ASideStrip.Draw(ABuf.Canvas.Handle, R); + end; + +begin + if not InitializeElements then + inherited DrawPopupMenuItem(ACanvas, ARect, AImageList, AImageIndex, AText, State) + else + begin + with TdxNavBarSkinNavPaneViewInfo(ViewInfo) do + AImageAreaWidth := 2 * GetOverflowPanelPopupMenuImageIndent + GetSmallImageWidth; + + ABuf := TcxBitmap.CreateSize(ARect); + try + ABuf.Canvas.Font := ACanvas.Font; + ABuf.PixelFormat := pf32bit; + DrawMenuBackground(ABuf.Canvas, AImageAreaWidth); + if AText = '-' then + ASeparator.Draw(ABuf.Canvas.Handle, Rect(AImageAreaWidth + 4, + cxRectHeight(ARect) div 2, ABuf.Width, cxRectHeight(ARect) div 2 + 1)) + else + begin + if sSelected in State then + begin + R := ARect; + OffsetRect(R, -R.Left, -R.Top); + ASelected.Draw(ABuf.Canvas.Handle, R); + end; + DrawImage(ABuf.Canvas, sActive in State, AImageAreaWidth); + DrawItemText(ABuf.Canvas, AImageAreaWidth); + end; + BitBlt(ACanvas.Handle, ARect.Left, ARect.Top, ABuf.Width, ABuf.Height, + ABuf.Canvas.Handle, 0, 0, SRCCOPY); + finally + ABuf.Free; + end; + end; +end; + +procedure TdxNavBarSkinNavPanePainter.DrawSplitter; +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if not CustomDrawSplitter then + begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.NavPaneSplitter; + if AElement = nil then + inherited DrawSplitter + else + AElement.Draw(Canvas.Handle, ViewInfo.SplitterRect); + end; +end; + +procedure TdxNavBarSkinNavPanePainter.DrawTopScrollButton; +begin + with ViewInfo do + if not InternalDrawScrollButton(False, TopScrollButtonRect, + TopScrollButtonState) + then + inherited DrawTopScrollButton; +end; + +{ TdxNavBarSkinExplorerBarPainter } + +constructor TdxNavBarSkinExplorerBarPainter.Create(ANavBar: TdxCustomNavBar); +begin + inherited Create(ANavBar); + FLookAndFeel := TcxLookAndFeel.Create(nil); + FLookAndFeel.NativeStyle := False; + FLookAndFeel.OnChanged := LookAndFeelChanged; +end; + +destructor TdxNavBarSkinExplorerBarPainter.Destroy; +begin + FLookAndFeel.Free; + inherited Destroy; +end; + +procedure TdxNavBarSkinExplorerBarPainter.DrawBackground; +var + ABackground: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + ABackground := nil; + if GetSkinPainterData(ASkinInfo) then + ABackground := ASkinInfo.NavBarBackgroundColor; + if ABackground = nil then + inherited DrawBackground + else + ABackground.Draw(Canvas.Handle, NavBar.ClientRect); +end; + +procedure TdxNavBarSkinExplorerBarPainter.DrawGroupBackground( + AGroupViewInfo: TdxNavBarGroupViewInfo); +begin + if not IsSkinAvailable then + inherited DrawGroupBackground(AGroupViewInfo); +end; + +procedure TdxNavBarSkinExplorerBarPainter.DrawGroupBorder( + AGroupViewInfo: TdxNavBarGroupViewInfo); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.NavBarGroupClient; + if AElement <> nil then + AElement.Draw(Canvas.Handle, AGroupViewInfo.ItemsRect) + else + inherited DrawGroupBorder(AGroupViewInfo); +end; + +procedure TdxNavBarSkinExplorerBarPainter.DrawGroupCaption( + AGroupViewInfo: TdxNavBarGroupViewInfo); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.NavBarGroupHeader; + if AElement <> nil then + begin + AElement.Draw(Canvas.Handle, AGroupViewInfo.CaptionRect); + DrawGroupCaptionButton(AGroupViewInfo); + DrawGroupCaptionText(AGroupViewInfo); + if AGroupViewInfo.IsCaptionImageVisible then + DrawGroupCaptionImage(AGroupViewInfo); + end else + inherited DrawGroupCaption(AGroupViewInfo); +end; + +procedure TdxNavBarSkinExplorerBarPainter.DrawGroupCaptionButton( + AGroupViewInfo: TdxNavBarGroupViewInfo); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + with AGroupViewInfo do + begin + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.NavBarGroupButtons[sExpanded in State]; + if AElement = nil then + inherited DrawGroupCaptionButton(AGroupViewInfo) + else + if Group.ShowExpandButton then + AElement.Draw(Canvas.Handle, AGroupViewInfo.CaptionSignRect, 0, + NavBarObjectStateToSkinState(State)); + end; +end; + +procedure TdxNavBarSkinExplorerBarPainter.DrawGroupControl(ACanvas: TCanvas; + ARect: TRect; AGroupViewInfo: TdxNavBarGroupViewInfo); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.NavBarGroupClient; + + if AElement = nil then + inherited DrawGroupControl(ACanvas, ARect, AGroupViewInfo) + else + AElement.Draw(ACanvas.Handle, cxRectInflate(ARect, 1, 0, 1, 1)); +end; + +function TdxNavBarSkinExplorerBarPainter.CreateGroupViewInfo( + AViewInfo: TdxNavBarViewInfo; AGroup: TdxNavBarGroup; ACaptionVisible: Boolean; + AItemsVisible: Boolean): TdxNavBarGroupViewInfo; +begin + Result := TdxNavBarSkinExplorerBarGroupViewInfo.Create(AViewInfo, AGroup, + ACaptionVisible, AItemsVisible); +end; + +function TdxNavBarSkinExplorerBarPainter.CreateLinkViewInfo( + AViewInfo: TdxNavBarGroupViewInfo; ALink: TdxNavBarItemLink; ACaptionVisible: Boolean; + AImageVisisble: Boolean): TdxNavBarLinkViewInfo; +begin + Result := TdxNavBarSkinExplorerBarLinkViewInfo.Create(AViewInfo, ALink, + ACaptionVisible, AImageVisisble); +end; + +function TdxNavBarSkinExplorerBarPainter.GetMasterLookAndFeel: TcxLookAndFeel; +begin + Result := FLookAndFeel; +end; + +function TdxNavBarSkinExplorerBarPainter.GetSkinPainterData( + var AData: TdxSkinLookAndFeelPainterInfo): Boolean; +begin + Result := GetExtendedStylePainters.GetPainterData(FLookAndFeel.SkinPainter, AData); +end; + +function TdxNavBarSkinExplorerBarPainter.IsSkinAvailable: Boolean; +begin + Result := FLookAndFeel.SkinPainter <> nil; +end; + +procedure TdxNavBarSkinExplorerBarPainter.LookAndFeelChanged( + Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); +begin + NavBar.InvalidateAll(doRecreate); +end; + +function TdxNavBarSkinExplorerBarPainter.IsSkinNameStored: Boolean; +begin + Result := SkinNameAssigned; +end; + +function TdxNavBarSkinExplorerBarPainter.GetSkinName: TdxSkinName; +begin + Result := FLookAndFeel.SkinName; +end; + +procedure TdxNavBarSkinExplorerBarPainter.SetSkinName(const Value: TdxSkinName); +begin + FLookAndFeel.SkinName := Value; +end; + +function TdxNavBarSkinExplorerBarPainter.GetSkinNameAssigned: Boolean; +begin + Result := lfvSkinName in FLookAndFeel.AssignedValues; +end; + +procedure TdxNavBarSkinExplorerBarPainter.SetSkinNameAssigned(AValue: Boolean); +begin + if AValue then + FLookAndFeel.AssignedValues := FLookAndFeel.AssignedValues + [lfvSkinName] + else + FLookAndFeel.AssignedValues := FLookAndFeel.AssignedValues - [lfvSkinName]; +end; + +{ TdxNavBarSkinExplorerBarGroupViewInfo } + +function TdxNavBarSkinExplorerBarGroupViewInfo.CaptionFontColor: TColor; +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + with TdxNavBarSkinExplorerBarPainter(Painter) do + begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.NavBarGroupHeader; + if AElement <> nil then + Result := AElement.TextColor + else + Result := inherited CaptionFontColor; + end; +end; + +procedure TdxNavBarSkinExplorerBarGroupViewInfo.CalculateBounds(X: Integer; Y: Integer); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + inherited CalculateBounds(X, Y); + with TdxNavBarSkinExplorerBarPainter(Painter) do + begin + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.NavBarGroupHeader + else + AElement := nil; + if (AElement <> nil) and IsCaptionVisible and not IsRectEmpty(FCaptionImageRect) then + begin + OffsetRect(FCaptionImageRect, AElement.ContentOffset.Left, 0); + Inc(FCaptionTextRect.Left, AElement.ContentOffset.Left); + end; + end; +end; + +{ TdxNavBarSkinExplorerBarLinkViewInfo } + +function TdxNavBarSkinExplorerBarLinkViewInfo.FontColor: TColor; +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + with TdxNavBarSkinExplorerBarPainter(Painter) do + begin + AElement := nil; + if GetSkinPainterData(ASkinInfo) then + AElement := ASkinInfo.NavBarItem; + if AElement <> nil then + Result := AElement.TextColor + else + Result := inherited FontColor; + end; +end; + +initialization + dxNavBarViewsFactory.RegisterView(dxNavBarSkinExplorerBarView, + 'SkinExplorerBarView', TdxNavBarSkinExplorerBarPainter); + dxNavBarViewsFactory.RegisterView(dxNavBarSkinNavigatorPaneView, + 'SkinNavigationPaneView', TdxNavBarSkinNavPanePainter); + RegisterClasses([TdxNavBarSkinNavPanePainter, TdxNavBarSkinExplorerBarPainter]); + +finalization + dxNavBarViewsFactory.UnRegisterView(dxNavBarSkinExplorerBarView); + dxNavBarViewsFactory.UnRegisterView(dxNavBarSkinNavigatorPaneView); + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinsdxNavBarPainterReg.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxNavBarPainterReg.pas new file mode 100644 index 00000000..d79050a2 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxNavBarPainterReg.pas @@ -0,0 +1,71 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinsdxNavBarPainterReg; + +{$I cxVer.inc} + +interface + +uses + Classes, DesignIntf, dxSkinsDesignHelperReg, dxNavBar, dxSkinsdxNavBarPainter; + +procedure Register; + +implementation + +type + TdxSkinsdxNavBarSelectionEditor = class(TdxSkinsBaseSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + +{ TdxSkinsdxNavBarSelectionEditor } + +procedure TdxSkinsdxNavBarSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + inherited RequiresUnits(Proc); + Proc('dxSkinsdxNavBarPainter'); +end; + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + RegisterSelectionEditor(TdxNavBar, TdxSkinsdxNavBarSelectionEditor); +end; + +end. + diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinsdxRibbonPainter.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxRibbonPainter.pas new file mode 100644 index 00000000..af14d3d6 --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxRibbonPainter.pas @@ -0,0 +1,2270 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinsdxRibbonPainter; + +interface + +uses + Windows, Classes, SysUtils, dxSkinsCore, dxSkinsLookAndFeelPainter, Graphics, + dxRibbonSkins, dxBarSkin, cxLookAndFeels, cxLookAndFeelPainters, cxGraphics, cxClasses, + dxBarSkinConsts, cxGeometry, dxRibbon, dxBar, Math, cxDWMApi, Forms, dxSkinInfo; + +const + QATLeftDefaultOffset = 15; + QATOffsetDelta = 10; + QATRightDefaultOffset = 12; + +type + + { TdxSkinRibbonPainter } + + TdxSkinRibbonPainter = class(TdxBlackRibbonSkin) + private + FFormBordersCache: array[TcxBorder] of TdxSkinElementCache; + FFormCaptionCache: TdxSkinElementCache; + FFormIconsCache: array[TdxBorderDrawIcon] of TdxSkinElementCache; + FLookAndFeel: TcxLookAndFeel; + FSmallButtonsCache: TdxSkinElementCache; + FTabGroupBackground: TdxSkinElementCacheList; + FTabGroupsAreaCache: TdxSkinElementCache; + function GetBorderBounds(ASide: TcxBorder; const ABorders: TRect; + const AData: TdxRibbonFormData): TRect; + function GetBorderSkinElement(ASide: TcxBorder; AIsRectangular: Boolean; + ASkinInfo: TdxSkinLookAndFeelPainterInfo): TdxSkinElement; + function GetCustomizeButtonOutsizeQAT(AHasAppButton: Boolean): Boolean; + function GetQATLeftOffset: Integer; + function GetSkinData(var ASkinInfo: TdxSkinLookAndFeelPainterInfo): Boolean; + function GetStatusBarElement(AIsLeft, AIsRectangular: Boolean): TdxSkinElement; + function IsSkinAvailable: Boolean; + procedure DrawClippedElement(DC: HDC; const R: TRect; const ASource: TRect; + AElement: TdxSkinElement; AState: TdxSkinElementState = esNormal; + AIntersect: Boolean = False; AImageIndex: Integer = 0); + procedure InternalDrawEditButton(DC: HDC; const R: TRect; AState: Integer; + AButtonKind: TcxEditBtnKind); + procedure InternalDrawStatusBarBottomPart(DC: HDC; R: TRect; AIsLeft: Boolean; + AIsActive: Boolean); + function InternalDrawStatusBarPart(DC: HDC; const R: TRect; AIsRaised: Boolean; + AIsRectangular: Boolean; AActive: Boolean; AIsLeft: Boolean): Boolean; + // SkinName + procedure SetInternalSkinName(const ASkinName: string); + protected + function GetName: string; override; + procedure FinalizeCacheElements; + procedure DrawFormBorder(DC: HDC; ASide: TcxBorder; ACaptionHeight: Integer; + const AData: TdxRibbonFormData; const ABorders: TRect; AElement: TdxSkinElement); + procedure InitializeCacheElements; + property LookAndFeel: TcxLookAndFeel read FLookAndFeel; + public + constructor Create(const ASkinName: string); virtual; + destructor Destroy; override; + // Application + procedure DrawApplicationButton(DC: HDC; const R: TRect; + AState: TdxApplicationButtonState); override; + procedure DrawApplicationMenuBorder(DC: HDC; const R: TRect); override; + procedure DrawApplicationMenuButton(DC: HDC; const R: TRect; AState: Integer); override; + procedure DrawApplicationMenuContentFooter(DC: HDC; const R: TRect); override; + procedure DrawApplicationMenuContentHeader(DC: HDC; const R: TRect); override; + // Button Group + procedure DrawButtonGroup(DC: HDC; const R: TRect; AState: Integer); override; + procedure DrawButtonGroupBorderLeft(DC: HDC; const R: TRect); override; + procedure DrawButtonGroupBorderRight(DC: HDC; const R: TRect); override; + procedure DrawButtonGroupBorderMiddle(DC: HDC; const R: TRect; + AState: Integer); override; + // CollapsedToolbar + procedure DrawCollapsedToolbarBackground(DC: HDC; const R: TRect; AState: Integer); override; + procedure DrawCollapsedToolbarGlyphBackground(DC: HDC; const R: TRect; AState: Integer); override; + // EditButton + procedure DrawEditArrowButton(DC: HDC; const R: TRect; AState: Integer); override; + procedure DrawEditEllipsisButton(DC: HDC; const R: TRect; AState: Integer); override; + procedure DrawEditSpinDownButton(DC: HDC; const R: TRect; AState: Integer); override; + procedure DrawEditSpinUpButton(DC: HDC; const R: TRect; AState: Integer); override; + // Custom controls + procedure DrawProgressDiscreteBand(DC: HDC; const R: TRect); override; + procedure DrawProgressSolidBand(DC: HDC; const R: TRect); override; + procedure DrawProgressSubstrate(DC: HDC; const R: TRect); override; + // DropDown Gallery + procedure DrawDropDownBorder(DC: HDC; const R: TRect); override; + procedure DrawDropDownGalleryBackground(DC: HDC; const R: TRect); override; + procedure DrawDropDownGalleryBottomSizeGrip(DC: HDC; const R: TRect); override; + procedure DrawDropDownGalleryBottomSizingBand(DC: HDC; const R: TRect); override; + procedure DrawDropDownGalleryBottomVerticalSizeGrip(DC: HDC; const R: TRect); override; + procedure DrawDropDownGalleryTopSizingBand(DC: HDC; const R: TRect); override; + procedure DrawDropDownGalleryTopSizeGrip(DC: HDC; const R: TRect); override; + procedure DrawDropDownGalleryTopVerticalSizeGrip(DC: HDC; const R: TRect); override; + procedure DrawGalleryFilterBandBackground(DC: HDC; const R: TRect); override; + procedure DrawGalleryGroupHeaderBackground(DC: HDC; const R: TRect); override; + procedure DrawInRibbonGalleryBackground(DC: HDC; const R: TRect; AState: Integer); override; + procedure DrawInRibbonGalleryScrollBarButton(DC: HDC; const R: TRect; + AButtonKind: TdxInRibbonGalleryScrollBarButtonKind; AState: Integer); override; + // Form + procedure DrawFormBorders(DC: HDC; const ABordersWidth: TRect; + ACaptionHeight: Integer; const AData: TdxRibbonFormData); override; + procedure DrawFormBorderIcon(DC: HDC; const R: TRect; + AIcon: TdxBorderDrawIcon; AState: TdxBorderIconState); override; + procedure DrawFormCaption(DC: HDC; const R: TRect; + const AData: TdxRibbonFormData); override; + procedure DrawFormStatusBarPart(DC: HDC; const R: TRect; AIsLeft: Boolean; + AIsActive: Boolean; AIsRaised: Boolean; AIsRectangular: Boolean); override; + procedure DrawHelpButton(DC: HDC; const R: TRect; AState: TdxBorderIconState); override; + // Others + procedure DrawArrowDown(DC: HDC; const R: TRect; AState: Integer); override; + procedure DrawGroupScrollButton(DC: HDC; const R: TRect; ALeft: Boolean; AState: Integer); override; + procedure DrawMarkArrow(DC: HDC; const R: TRect; AState: Integer); override; + procedure DrawMDIButton(DC: HDC; const R: TRect; AButton: TdxBarMDIButton; + AState: TdxBorderIconState); override; + procedure DrawRibbonBackground(DC: HDC; const R: TRect); override; + procedure DrawRibbonClientTopArea(DC: HDC; const R: TRect); override; + procedure DrawScreenTip(DC: HDC; const R: TRect); override; + // Large buttons + procedure DrawLargeButton(DC: HDC; const R: TRect; AState: Integer); override; + procedure DrawLargeButtonDropButton(DC: HDC; const R: TRect; AState: Integer); override; + procedure DrawLargeButtonGlyphBackground(DC: HDC; const R: TRect; AState: Integer); override; + // Launch + procedure DrawLaunchButtonBackground(DC: HDC; const R: TRect; AState: Integer); override; + procedure DrawLaunchButtonDefaultGlyph(DC: HDC; const R: TRect; AState: Integer); override; + // Menus + procedure DrawMenuCheck(DC: HDC; const R: TRect; AState: Integer); override; + procedure DrawMenuCheckMark(DC: HDC; const R: TRect; AState: Integer); override; + procedure DrawMenuContent(DC: HDC; const R: TRect); override; + procedure DrawMenuGlyph(DC: HDC; const R: TRect); override; + procedure DrawMenuScrollArea(DC: HDC; const R: TRect; AState: Integer); override; + procedure DrawMenuSeparatorHorz(DC: HDC; const R: TRect); override; + procedure DrawMenuSeparatorVert(DC: HDC; const R: TRect); override; + // Small buttons + procedure DrawSmallButton(DC: HDC; const R: TRect; AState: Integer); override; + procedure DrawSmallButtonDropButton(DC: HDC; const R: TRect; AState: Integer); override; + procedure DrawSmallButtonGlyphBackground(DC: HDC; const R: TRect; + AState: Integer); override; + // Status Bar + procedure DrawStatusBar(DC: HDC; const R: TRect); override; + procedure DrawStatusBarGripBackground(DC: HDC; const R: TRect); override; + procedure DrawStatusBarPanel(DC: HDC; const R: TRect; AIsLowered: Boolean); override; + procedure DrawStatusBarPanelSeparator(DC: HDC; const R: TRect); override; + procedure DrawStatusBarToolbarSeparator(DC: HDC; const R: TRect);override; + // Tabs + procedure DrawTab(DC: HDC; const R: TRect; AState: TdxRibbonTabState); override; + procedure DrawTabGroupBackground(DC: HDC; const R: TRect; AState: Integer); override; + procedure DrawTabGroupHeaderBackground(DC: HDC; const R: TRect; + AState: Integer); override; + procedure DrawTabGroupsArea(DC: HDC; const R: TRect); override; + procedure DrawTabScrollButton(DC: HDC; const R: TRect; ALeft: Boolean; + AState: Integer); override; + procedure DrawTabSeparator(DC: HDC; const R: TRect; Alpha: Byte); override; + procedure DrawRibbonBottomBorder(DC: HDC; const R: TRect); override; + // QuickAccess + procedure DrawQuickAccessToolbar(DC: HDC; const R: TRect; + ABellow, ANonClientDraw, AHasApplicationButton, AIsActive, ADontUseAero: Boolean); override; + procedure DrawQuickAccessToolbarDefaultGlyph(DC: HDC; const R: TRect); override; + procedure DrawQuickAccessToolbarGroupButton(DC: HDC; const R: TRect; + ABellow: Boolean; ANonClientDraw: Boolean; AIsActive: Boolean; + AState: Integer); override; + procedure DrawQuickAccessToolbarPopup(DC: HDC; const R: TRect); override; + // + function GetCaptionFontSize(ACurrentFontSize: Integer): Integer; override; + function GetMenuSeparatorSize: Integer; override; + function GetPartColor(APart: Integer; AState: Integer = 0): TColor; override; + function GetPartContentOffsets(APart: Integer): TRect; override; + function GetQuickAccessToolbarLeftIndent(AHasApplicationButton: Boolean; + AUseAeroGlass: Boolean): Integer; override; + function GetQuickAccessToolbarMarkButtonOffset(AHasApplicationButton: Boolean; + ABelow: Boolean): Integer; override; + function GetQuickAccessToolbarOverrideWidth(AHasApplicationButton: Boolean; + AUseAeroGlass: Boolean): Integer; override; + function GetQuickAccessToolbarRightIndent(AHasApplicationButton: Boolean): Integer; override; + function GetSkinName: string; override; + function GetWindowBordersWidth(AHasStatusBar: Boolean): TRect; override; + function HasGroupTransparency: Boolean; override; + function NeedDrawGroupScrollArrow: Boolean; override; + property SkinName: string read GetSkinName write SetInternalSkinName; + end; + + { TdxSkinsRibbonPainterManager } + + TdxSkinsRibbonPainterManager = class(TcxIUnknownObject, IcxLookAndFeelPainterListener) + protected + procedure FreePaintersList; + procedure InitializePaintersList; + procedure PainterChanged(APainter: TcxCustomLookAndFeelPainterClass); + public + constructor Create; virtual; + destructor Destroy; override; + end; + +implementation + +uses + dxGDIPlusAPI; + +const + RibbonFormBorderStates: array[Boolean] of TdxSkinElementState = ( + esActiveDisabled, esActive); + +var + SkinsRibbonPainterManager: TdxSkinsRibbonPainterManager; + +function SkinElementStateByRibbonState(AState: Integer): TdxSkinElementState; +const + StateMap: array[0..8] of TdxSkinElementState = ( + esNormal, esDisabled, esHot, esActive, esPressed, esChecked, + esChecked, esHotCheck, esActiveDisabled); +begin + if (Low(StateMap) <= AState) and (High(StateMap) >= AState) then + Result := StateMap[AState] + else + Result := esNormal; +end; + +{ TdxSkinRibbonPainter } + +constructor TdxSkinRibbonPainter.Create(const ASkinName: string); +begin + FLookAndFeel := TcxLookAndFeel.Create(nil); + FLookAndFeel.NativeStyle := False; + FLookAndFeel.SkinName := ASkinName; + inherited Create; + InitializeCacheElements; +end; + +destructor TdxSkinRibbonPainter.Destroy; +begin + FinalizeCacheElements; + FLookAndFeel.Free; + inherited Destroy; +end; + +procedure TdxSkinRibbonPainter.FinalizeCacheElements; +var + AIndex: TdxBorderDrawIcon; + ASide: TcxBorder; +begin + FFormCaptionCache.Free; + FTabGroupBackground.Free; + FTabGroupsAreaCache.Free; + FSmallButtonsCache.Free; + for AIndex := Low(TdxBorderDrawIcon) to High(TdxBorderDrawIcon) do + FFormIconsCache[AIndex].Free; + for ASide := Low(TcxBorder) to High(TcxBorder) do + FFormBordersCache[ASide].Free; +end; + +procedure TdxSkinRibbonPainter.InitializeCacheElements; +var + AIndex: TdxBorderDrawIcon; + ASide: TcxBorder; +begin + FSmallButtonsCache := TdxSkinElementCache.Create; + FFormCaptionCache := TdxSkinElementCache.Create; + FTabGroupBackground := TdxSkinElementCacheList.Create; + FTabGroupsAreaCache := TdxSkinElementCache.Create; + for AIndex := Low(TdxBorderDrawIcon) to High(TdxBorderDrawIcon) do + FFormIconsCache[AIndex] := TdxSkinElementCache.Create; + for ASide := Low(TcxBorder) to High(TcxBorder) do + FFormBordersCache[ASide] := TdxSkinElementCache.Create; +end; + +function TdxSkinRibbonPainter.GetName: string; +begin + Result := GetSkinName; +end; + +procedure TdxSkinRibbonPainter.SetInternalSkinName(const ASkinName: string); +begin + FLookAndFeel.SkinName := ASkinName; +end; + +function TdxSkinRibbonPainter.GetSkinData( + var ASkinInfo: TdxSkinLookAndFeelPainterInfo): Boolean; +begin + Result := GetExtendedStylePainters.GetPainterData(LookAndFeel.SkinPainter, ASkinInfo); +end; + +function TdxSkinRibbonPainter.GetStatusBarElement( + AIsLeft, AIsRectangular: Boolean): TdxSkinElement; +const + ABorders: array[Boolean] of TcxBorder = (bRight, bLeft); +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := nil; + if GetSkinData(ASkinInfo) then + if not AIsRectangular then + Result := ASkinInfo.RibbonStatusBarBackground + else + Result := ASkinInfo.FormFrames[True, ABorders[AIsLeft]]; +end; + +function TdxSkinRibbonPainter.GetBorderBounds(ASide: TcxBorder; const ABorders: TRect; + const AData: TdxRibbonFormData): TRect; +begin + Result := AData.Bounds; + if ASide in [bLeft, bRight] then + begin + Result.Top := ABorders.Top; + if ASide = bLeft then + Result.Right := Result.Left + ABorders.Left + else + Result.Left := Result.Right - ABorders.Right; + end + else + if ASide = bTop then + Result.Bottom := ABorders.Top + else + Result := Rect(Result.Left + 4, Result.Bottom - ABorders.Bottom, + Result.Right - 4, Result.Bottom); +end; + +function TdxSkinRibbonPainter.GetBorderSkinElement(ASide: TcxBorder; + AIsRectangular: Boolean; ASkinInfo: TdxSkinLookAndFeelPainterInfo): TdxSkinElement; +begin + case ASide of + bLeft: + Result := ASkinInfo.RibbonFormLeft[AIsRectangular]; + bTop: + Result := ASkinInfo.RibbonFormCaption; + bRight: + Result := ASkinInfo.RibbonFormRight[AIsRectangular]; + bBottom: + Result := ASkinInfo.RibbonFormBottom[AIsRectangular]; + else + Result := nil; + end; +end; + +function TdxSkinRibbonPainter.GetCustomizeButtonOutsizeQAT(AHasAppButton: Boolean): Boolean; +var + AProperty: TdxSkinBooleanProperty; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := False; + if GetSkinData(ASkinInfo) then + begin + AProperty := ASkinInfo.RibbonQATCustomizeButtonOutsizeQAT[AHasAppButton]; + if AProperty <> nil then + Result := AProperty.Value; + end; +end; + +function TdxSkinRibbonPainter.GetQATLeftOffset: Integer; +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := 0; + if GetSkinData(ASkinInfo) then + with ASkinInfo do + Result := RibbonIndents[0] + RibbonIndents[1] + QATOffsetDelta; +end; + +function TdxSkinRibbonPainter.IsSkinAvailable: Boolean; +begin + Result := LookAndFeel.SkinPainter <> nil; +end; + +procedure TdxSkinRibbonPainter.DrawApplicationButton(DC: HDC; const R: TRect; + AState: TdxApplicationButtonState); +const + dxApplicationButtonStateToElementState: array[TdxApplicationButtonState] of + TdxSkinElementState = (esNormal, esHot, esPressed); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonApplicationButton; + + if AElement = nil then + inherited DrawApplicationButton(DC, R, AState) + else + AElement.Draw(DC, R, 0, dxApplicationButtonStateToElementState[AState]); +end; + +procedure TdxSkinRibbonPainter.DrawApplicationMenuBorder(DC: HDC; const R: TRect); +var + AFooter: TdxSkinElement; + AHeader: TdxSkinElement; + ARect: TRect; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AFooter := nil; + AHeader := nil; + if GetSkinData(ASkinInfo) then + begin + AFooter := ASkinInfo.RibbonApplicationMenuBorders[True]; + AHeader := ASkinInfo.RibbonApplicationMenuBorders[False]; + end; + + if (AFooter = nil) or (AHeader = nil) then + inherited DrawApplicationMenuBorder(DC, R) + else + begin + ARect := R; + Dec(ARect.Bottom, AFooter.Size.cy); + AHeader.Draw(DC, ARect); + + ARect.Top := ARect.Bottom; + ARect.Bottom := R.Bottom; + AFooter.Draw(DC, ARect); + end; +end; + +procedure TdxSkinRibbonPainter.DrawApplicationMenuButton(DC: HDC; const R: TRect; AState: Integer); +const + ButtonState: array [Boolean] of TdxSkinElementState = (esNormal, esHot); +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + AButton: TdxSkinElement; +begin + if GetSkinData(ASkinInfo) then + AButton := ASkinInfo.ButtonElements + else + AButton := nil; + + if AButton = nil then + inherited DrawApplicationMenuButton(DC, R, AState) + else + AButton.Draw(DC, R, 0, ButtonState[AState = DXBAR_HOT]); +end; + +procedure TdxSkinRibbonPainter.DrawApplicationMenuContentFooter(DC: HDC; + const R: TRect); +var + AFooter: TdxSkinElement; + ARect: TRect; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AFooter := nil; + if GetSkinData(ASkinInfo) then + AFooter := ASkinInfo.RibbonApplicationMenuBorders[True]; + + if AFooter = nil then + inherited DrawApplicationMenuContentFooter(DC, R) + else + begin + ARect := R; + InflateRect(ARect, 3, 0); + Inc(ARect.Bottom, 3); + AFooter.Draw(DC, ARect); + end; +end; + +procedure TdxSkinRibbonPainter.DrawApplicationMenuContentHeader(DC: HDC; + const R: TRect); +var + AHeader: TdxSkinElement; + ARect: TRect; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AHeader := nil; + if GetSkinData(ASkinInfo) then + AHeader := ASkinInfo.RibbonApplicationMenuBorders[False]; + + if AHeader = nil then + inherited DrawApplicationMenuContentHeader(DC, R) + else + begin + ARect := R; + InflateRect(ARect, 3, 0); + Dec(ARect.Top, 3); + with AHeader.Image.Margins do + Inc(ARect.Bottom, Bottom); + DrawClippedElement(DC, R, ARect, AHeader); + end; +end; + +procedure TdxSkinRibbonPainter.DrawButtonGroup(DC: HDC; const R: TRect; + AState: Integer); +var + AElement: TdxSkinElement; + ABackground: TdxSkinElement; + ARect: TRect; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + ABackground := nil; + if GetSkinData(ASkinInfo) then + begin + AElement := ASkinInfo.RibbonButtonGroupButton; + ABackground := ASkinInfo.RibbonButtonGroup; + end; + + if (AElement = nil) or (ABackground = nil) then + inherited DrawButtonGroup(DC, R, AState) + else + begin + ARect := R; + with ABackground.Image.Margins.Rect do + DrawClippedElement(DC, R, Rect(R.Left - Left, R.Top, R.Right + Right, R.Bottom), + ABackground); + with ABackground.ContentOffset do + begin + Inc(ARect.Top, Top); + Dec(ARect.Bottom, Bottom); + end; + AElement.Draw(DC, ARect, 0, SkinElementStateByRibbonState(AState)); + end; +end; + +procedure TdxSkinRibbonPainter.DrawButtonGroupBorderLeft(DC: HDC; const R: TRect); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonButtonGroup + else + AElement := nil; + + if AElement = nil then + inherited DrawButtonGroupBorderLeft(DC, R) + else + AElement.Draw(DC, R); +end; + +procedure TdxSkinRibbonPainter.DrawButtonGroupBorderRight(DC: HDC; const R: TRect); +var + AElement: TdxSkinElement; + ARect: TRect; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonButtonGroup + else + AElement := nil; + + if AElement = nil then + inherited DrawButtonGroupBorderLeft(DC, R) + else + if not IsRectEmpty(R) then + begin + ARect := R; + ARect.Left := ARect.Right - Trunc(AElement.Size.cx * AElement.Image.Margins.Right / cxRectWidth(ARect)); + DrawClippedElement(DC, R, ARect, AElement); + end; +end; + +procedure TdxSkinRibbonPainter.DrawButtonGroupBorderMiddle(DC: HDC; const R: TRect; + AState: Integer); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonButtonGroupSeparator + else + AElement := nil; + + if AElement = nil then + inherited DrawButtonGroupBorderMiddle(DC, R, AState) + else + AElement.Draw(DC, R, 0, SkinElementStateByRibbonState(AState)); +end; + +procedure TdxSkinRibbonPainter.DrawCollapsedToolbarBackground(DC: HDC; + const R: TRect; AState: Integer); +var + ACollapsedToolBar: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + ACollapsedToolBar := ASkinInfo.RibbonCollapsedToolBarBackground + else + ACollapsedToolBar := nil; + + if ACollapsedToolBar <> nil then + ACollapsedToolBar.Draw(DC, R, 0, SkinElementStateByRibbonState(AState)) + else + inherited DrawCollapsedToolbarBackground(DC, R, AState); +end; + +procedure TdxSkinRibbonPainter.DrawCollapsedToolbarGlyphBackground(DC: HDC; + const R: TRect; AState: Integer); +var + ACollapsedToolBarGlyph: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + ACollapsedToolBarGlyph := ASkinInfo.RibbonCollapsedToolBarGlyphBackground + else + ACollapsedToolBarGlyph := nil; + + if ACollapsedToolBarGlyph <> nil then + ACollapsedToolBarGlyph.Draw(DC, R) + else + inherited DrawCollapsedToolbarGlyphBackground(DC, R, AState); +end; + +procedure TdxSkinRibbonPainter.DrawEditArrowButton(DC: HDC; const R: TRect; AState: Integer); +begin + InternalDrawEditButton(DC, R, AState, cxbkComboBtn); +end; + +procedure TdxSkinRibbonPainter.DrawEditEllipsisButton(DC: HDC; const R: TRect; AState: Integer); +begin + InternalDrawEditButton(DC, R, AState, cxbkEllipsisBtn); +end; + +procedure TdxSkinRibbonPainter.DrawEditSpinDownButton(DC: HDC; const R: TRect; AState: Integer); +begin + InternalDrawEditButton(DC, R, AState, cxbkSpinDownBtn); +end; + +procedure TdxSkinRibbonPainter.DrawEditSpinUpButton(DC: HDC; const R: TRect; AState: Integer); +begin + InternalDrawEditButton(DC, R, AState, cxbkSpinUpBtn); +end; + +procedure TdxSkinRibbonPainter.DrawProgressDiscreteBand(DC: HDC; const R: TRect); +var + AElement: TdxSkinElement; + ARect: TRect; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + + function CheckRect(const R: TRect): TRect; + begin + Result := R; + if ASkinInfo.ProgressBarElements[False, False] <> nil then + begin + InflateRect(Result, 0, 2); + with ASkinInfo.ProgressBarElements[False, False].ContentOffset.Rect do + begin + Inc(Result.Top, Top); + Dec(Result.Bottom, Bottom); + end; + end; + end; + +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.ProgressBarElements[True, False] + else + AElement := nil; + + if AElement = nil then + inherited DrawProgressDiscreteBand(DC, R) + else + begin + ARect := CheckRect(R); + with AElement.Image.Margins.Rect do + begin + Dec(ARect.Left, Left); + Inc(ARect.Right, Right); + end; + DrawClippedElement(DC, R, ARect, AElement); + end; +end; + +procedure TdxSkinRibbonPainter.DrawProgressSolidBand(DC: HDC; const R: TRect); +var + AElement: TdxSkinElement; + ARect: TRect; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.ProgressBarElements[True, False] + else + AElement := nil; + + if AElement = nil then + inherited DrawProgressDiscreteBand(DC, R) + else + begin + ARect := R; + if ASkinInfo.ProgressBarElements[False, False] <> nil then + begin + InflateRect(ARect, 2, 2); + with ASkinInfo.ProgressBarElements[False, False].ContentOffset.Rect do + begin + Inc(ARect.Left, Left); + Inc(ARect.Top, Top); + Dec(ARect.Bottom, Bottom); + Dec(ARect.Right, Right); + end; + end; + DrawClippedElement(DC, R, ARect, AElement); + end; +end; + +procedure TdxSkinRibbonPainter.DrawProgressSubstrate(DC: HDC; const R: TRect); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.ProgressBarElements[False, False] + else + AElement := nil; + + if AElement = nil then + inherited DrawProgressSubstrate(DC, R) + else + AElement.Draw(DC, R); +end; + +procedure TdxSkinRibbonPainter.DrawDropDownBorder(DC: HDC; const R: TRect); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.PopupMenu; + + if AElement = nil then + inherited DrawDropDownBorder(DC, R) + else + AElement.Draw(DC, R); +end; + +procedure TdxSkinRibbonPainter.DrawDropDownGalleryBackground(DC: HDC; + const R: TRect); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonGalleryBackground + else + AElement := nil; + + if AElement = nil then + inherited DrawDropDownGalleryBackground(DC, R) + else + AElement.Draw(DC, R); +end; + +procedure TdxSkinRibbonPainter.DrawDropDownGalleryBottomSizeGrip(DC: HDC; + const R: TRect); +var + AElement: TdxSkinElement; + ARect: TRect; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonGallerySizeGrips + else + AElement := nil; + + if AElement = nil then + inherited DrawDropDownGalleryBottomSizeGrip(DC, R) + else + begin + ARect := cxRectInflate(R, 0, -3, -2, -1); + ARect.Left := ARect.Right - cxRectHeight(ARect); + AElement.Draw(DC, ARect, 1); + end; +end; + +procedure TdxSkinRibbonPainter.DrawDropDownGalleryBottomSizingBand(DC: HDC; + const R: TRect); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonGallerySizingPanel + else + AElement := nil; + + if AElement = nil then + inherited DrawDropDownGalleryBottomSizingBand(DC, R) + else + AElement.Draw(DC, R); +end; + +procedure TdxSkinRibbonPainter.DrawDropDownGalleryBottomVerticalSizeGrip(DC: HDC; + const R: TRect); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonGallerySizeGrips + else + AElement := nil; + + if AElement = nil then + inherited DrawDropDownGalleryBottomVerticalSizeGrip(DC, R) + else + AElement.Draw(DC, R); +end; + +procedure TdxSkinRibbonPainter.DrawDropDownGalleryTopSizingBand(DC: HDC; + const R: TRect); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonGallerySizingPanel + else + AElement := nil; + + if AElement = nil then + inherited DrawDropDownGalleryTopSizingBand(DC, R) + else + AElement.Draw(DC, R); +end; + +procedure TdxSkinRibbonPainter.DrawDropDownGalleryTopSizeGrip(DC: HDC; + const R: TRect); +var + AElement: TdxSkinElement; + ARect: TRect; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonGallerySizeGrips + else + AElement := nil; + + if AElement = nil then + inherited DrawDropDownGalleryTopSizingBand(DC, R) + else + begin + ARect := cxRectInflate(R, 0, -3, -2, -1); + ARect.Left := ARect.Right - cxRectHeight(ARect); + AElement.Draw(DC, ARect, 2); + end; +end; + +procedure TdxSkinRibbonPainter.DrawDropDownGalleryTopVerticalSizeGrip(DC: HDC; + const R: TRect); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonGallerySizeGrips + else + AElement := nil; + + if AElement = nil then + inherited DrawDropDownGalleryTopVerticalSizeGrip(DC, R) + else + AElement.Draw(DC, R); +end; + +procedure TdxSkinRibbonPainter.DrawGalleryFilterBandBackground(DC: HDC; + const R: TRect); +begin + DrawDropDownGalleryBottomSizingBand(DC, R); +end; + +procedure TdxSkinRibbonPainter.DrawGalleryGroupHeaderBackground(DC: HDC; + const R: TRect); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonGalleryGroupCaption + else + AElement := nil; + + if AElement = nil then + inherited DrawGalleryGroupHeaderBackground(DC, R) + else + AElement.Draw(DC, R); +end; + +procedure TdxSkinRibbonPainter.DrawInRibbonGalleryBackground(DC: HDC; + const R: TRect; AState: Integer); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonGalleryPane + else + AElement := nil; + + if AElement = nil then + inherited DrawInRibbonGalleryBackground(DC, R, AState) + else + AElement.Draw(DC, R, 0, SkinElementStateByRibbonState(AState)); +end; + +procedure TdxSkinRibbonPainter.DrawInRibbonGalleryScrollBarButton(DC: HDC; + const R: TRect; AButtonKind: TdxInRibbonGalleryScrollBarButtonKind; + AState: Integer); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + begin + case AButtonKind of + gsbkLineUp: + AElement := ASkinInfo.RibbonGalleryButtonUp; + gsbkLineDown: + AElement := ASkinInfo.RibbonGalleryButtonDown; + gsbkDropDown: + AElement := ASkinInfo.RibbonGalleryButtonDropDown; + end; + end; + + if AElement = nil then + inherited DrawInRibbonGalleryScrollBarButton(DC, R, AButtonKind, AState) + else + AElement.Draw(DC, R, 0, SkinElementStateByRibbonState(AState)); +end; + +procedure TdxSkinRibbonPainter.DrawArrowDown(DC: HDC; const R: TRect; + AState: Integer); +const + StateMap: array[0..8] of TdxSkinElementState = (esNormal, esDisabled, esHot, + esActive, esNormal, esNormal, esNormal, esNormal, esNormal); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonButtonArrow; + + if AElement = nil then + inherited DrawArrowDown(DC, R, AState) + else + AElement.Draw(DC, R, 0, StateMap[AState]); +end; + +procedure TdxSkinRibbonPainter.DrawClippedElement(DC: HDC; const R: TRect; + const ASource: TRect; AElement: TdxSkinElement; + AState: TdxSkinElementState = esNormal; AIntersect: Boolean = False; + AImageIndex: Integer = 0); +const + ARegionOperations: array[Boolean] of TcxRegionOperation = (roSet, roIntersect); +begin + BarCanvas.BeginPaint(DC); + try + BarCanvas.SetClipRegion(TcxRegion.Create(R), ARegionOperations[AIntersect]); + AElement.Draw(BarCanvas.Handle, ASource, AImageIndex, AState); + finally + BarCanvas.EndPaint; + end; +end; + +procedure TdxSkinRibbonPainter.InternalDrawEditButton(DC: HDC; const R: TRect; + AState: Integer; AButtonKind: TcxEditBtnKind); +const + ButtonState: array [DXBAR_NORMAL..DXBAR_ACTIVEDISABLED] of TcxButtonState = ( + cxbsNormal, cxbsDisabled, cxbsHot, cxbsNormal, cxbsPressed, cxbsPressed, + cxbsDefault, cxbsDefault, cxbsDisabled); +begin + if IsSkinAvailable then + begin + BarCanvas.BeginPaint(DC); + try + LookAndFeel.SkinPainter.DrawEditorButton(BarCanvas, R, AButtonKind, + ButtonState[AState]); + finally + BarCanvas.EndPaint; + end; + end + else + DrawEditButton(DC, R, AState); +end; + +procedure TdxSkinRibbonPainter.InternalDrawStatusBarBottomPart(DC: HDC; + R: TRect; AIsLeft: Boolean; AIsActive: Boolean); +const + AState: array[Boolean] of TdxSkinElementState = (esActiveDisabled, esActive); +var + AElement: TdxSkinElement; + AMinSize: Integer; + ARect: TRect; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.FormFrames[True, bBottom] + else + AElement := nil; + + if Assigned(AElement) then + begin + R.Top := Max(R.Bottom - AElement.Size.cy, R.Top); + ARect := R; + with AElement.Image.Margins do + begin + AMinSize := Max(Left + Right, AElement.MinSize.Width); + if AIsLeft then + ARect.Right := Max(ARect.Left + AMinSize, ARect.Right + Right) + else + ARect.Left := Min(ARect.Right - AMinSize, ARect.Left - Left); + end; + DrawClippedElement(DC, R, ARect, AElement, AState[AIsActive]); + end; +end; + +function TdxSkinRibbonPainter.InternalDrawStatusBarPart(DC: HDC; const R: TRect; + AIsRaised: Boolean; AIsRectangular: Boolean; AActive: Boolean; + AIsLeft: Boolean): Boolean; +const + AIndexMap: array[Boolean] of Integer = (0, 1); + AState: array[Boolean] of TdxSkinElementState = (esActiveDisabled, esActive); +var + AMinSize: Integer; + AElement: TdxSkinElement; + ARect: TRect; +begin + AElement := GetStatusBarElement(AIsLeft, AIsRectangular); + Result := Assigned(AElement); + if Result then + begin + ARect := R; + with AElement.Image.Margins do + begin + AMinSize := Max(Left + Right, AElement.MinSize.Width); + if AIsLeft then + ARect.Right := Max(ARect.Left + AMinSize, ARect.Right + Right) + else + ARect.Left := Min(ARect.Right - AMinSize, ARect.Left - Left); + end; + DrawClippedElement(DC, R, ARect, AElement, AState[AActive], False, AIndexMap[AIsRaised]); + if AIsRectangular then + InternalDrawStatusBarBottomPart(DC, R, AIsLeft, AActive); + end; +end; + +procedure TdxSkinRibbonPainter.DrawFormBorders(DC: HDC; const ABordersWidth: TRect; + ACaptionHeight: Integer; const AData: TdxRibbonFormData); + + procedure DrawBottomAngles(ALeft, ARight: TdxSkinElement); + var + ALeftRect: TRect; + ARightRect: TRect; + R: TRect; + begin + R := AData.Bounds; + R.Top := R.Bottom - ABordersWidth.Bottom; + ALeftRect := R; + ALeftRect.Right := ALeftRect.Left + 4; + ARightRect := R; + ARightRect.Left := ARightRect.Right - 4; + + R := ALeftRect; + Dec(R.Top, ALeft.Size.cy); + DrawClippedElement(DC, ALeftRect, R, ALeft, esNormal, False, Byte(not AData.Active)); + R := ARightRect; + Dec(R.Top, ARight.Size.cy); + DrawClippedElement(DC, ARightRect, R, ARight, esNormal, False, Byte(not AData.Active)); + end; + +var + ADialogFrame: Boolean; + ASide: TcxBorder; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + begin + BarCanvas.BeginPaint(DC); + BarCanvas.SaveClipRegion; + try + ADialogFrame := IsRectangularFormBottom(AData); + BarCanvas.ExcludeClipRect(cxRectContent(AData.Bounds, ABordersWidth)); + for ASide := Low(TcxBorder) to High(TcxBorder) do + begin + if (ASide = bTop) and (ACaptionHeight = 0) then + Continue; + DrawFormBorder(DC, ASide, ACaptionHeight, AData, ABordersWidth, + GetBorderSkinElement(ASide, ADialogFrame, ASkinInfo)); + end; + if ABordersWidth.Bottom > 1 then + DrawBottomAngles( + GetBorderSkinElement(bLeft, ADialogFrame, ASkinInfo), + GetBorderSkinElement(bRight, ADialogFrame, ASkinInfo)); + finally + BarCanvas.RestoreClipRegion; + BarCanvas.EndPaint; + end; + end + else + inherited DrawFormBorders(DC, ABordersWidth, ACaptionHeight, AData); +end; + +procedure TdxSkinRibbonPainter.DrawFormBorder(DC: HDC; ASide: TcxBorder; + ACaptionHeight: Integer; const AData: TdxRibbonFormData; const ABorders: TRect; + AElement: TdxSkinElement); +var + R: TRect; +begin + if Assigned(AElement) then + begin + R := ABorders; + Inc(R.Top, ACaptionHeight); + R := GetBorderBounds(ASide, R, AData); + FFormBordersCache[ASide].CheckCacheState(AElement, R, + RibbonFormBorderStates[AData.Active], Integer(not AData.Active)); + FFormBordersCache[ASide].Draw(DC, R); + end; +end; + +procedure TdxSkinRibbonPainter.DrawFormBorderIcon(DC: HDC; const R: TRect; + AIcon: TdxBorderDrawIcon; AState: TdxBorderIconState); +const + RibbonIconsToSkinFormIcons: array[TdxBorderDrawIcon] of TdxSkinFormIcon = + (sfiMinimize, sfiMaximize, sfiRestore, sfiClose, sfiHelp); + RibbonIconStateToSkinElementState: array[TdxBorderIconState] of TdxSkinElementState = + (esNormal, esHot, esPressed, esActive, esHot); +var + AElement: TdxSkinElement; + ARect: TRect; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.FormIcons[True, RibbonIconsToSkinFormIcons[AIcon]]; + if AElement = nil then + inherited DrawFormBorderIcon(DC, R, AIcon, AState) + else + begin + ARect := R; + InflateRect(ARect, -1, -1); + FFormIconsCache[AIcon].CheckCacheState(AElement, ARect, + RibbonIconStateToSkinElementState[AState]); + FFormIconsCache[AIcon].Draw(DC, ARect); + end; +end; + +procedure TdxSkinRibbonPainter.DrawFormCaption(DC: HDC; const R: TRect; + const AData: TdxRibbonFormData); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonFormCaption; + + if AElement = nil then + inherited DrawFormCaption(DC, R, AData) + else + begin + FFormCaptionCache.CheckCacheState(AElement, R, esNormal, Byte(not AData.Active)); + FFormCaptionCache.Draw(DC, R); + end; +end; + +procedure TdxSkinRibbonPainter.DrawFormStatusBarPart(DC: HDC; const R: TRect; + AIsLeft: Boolean; AIsActive: Boolean; AIsRaised: Boolean; + AIsRectangular: Boolean); +begin + if not InternalDrawStatusBarPart(DC, R, AIsRaised, AIsRectangular, AIsActive, + AIsLeft) + then + inherited DrawFormStatusBarPart(DC, R, AIsLeft, AIsActive, AIsRaised, + AIsRectangular); +end; + +procedure TdxSkinRibbonPainter.DrawLargeButton(DC: HDC; const R: TRect; + AState: Integer); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonLargeButton; + + if AElement = nil then + inherited DrawLargeButton(DC, R, AState) + else + AElement.Draw(DC, R, 0, SkinElementStateByRibbonState(AState)); +end; + +procedure TdxSkinRibbonPainter.DrawLargeButtonDropButton(DC: HDC; const R: TRect; + AState: Integer); +const + StateMap: array[0..8] of TdxSkinElementState = (esNormal, esNormal, esHot, + esActive, esPressed, esPressed, esActive, esHot, esActiveDisabled); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonLargeSplitButtonBottom; + + if AElement = nil then + inherited DrawLargeButton(DC, R, AState) + else + AElement.Draw(DC, R, 0, StateMap[AState]); +end; + +procedure TdxSkinRibbonPainter.DrawLargeButtonGlyphBackground(DC: HDC; + const R: TRect; AState: Integer); +const + StateMap: array[0..8] of TdxSkinElementState = (esNormal, esNormal, esHot, + esActive, esPressed, esDroppedDown, esActive, esHot, esActiveDisabled); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonLargeSplitButtonTop; + + if AElement = nil then + inherited DrawLargeButton(DC, R, AState) + else + AElement.Draw(DC, R, 0, StateMap[AState]); +end; + +procedure TdxSkinRibbonPainter.DrawLaunchButtonBackground(DC: HDC; const R: TRect; + AState: Integer); +const + StateMap: array[0..8] of TdxSkinElementState = (esNormal, esNormal, esHot, + esHot, esPressed, esNormal, esNormal, esNormal, esNormal); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + ARect: TRect; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonTabPanelGroupButton; + + if AElement = nil then + inherited DrawLaunchButtonBackground(DC, R, AState) + else + begin + ARect := R; + OffsetRect(ARect, 0, 1); + InflateRect(ARect, -1, -1); + AElement.Draw(DC, ARect, 0, StateMap[AState]); + end; +end; + +procedure TdxSkinRibbonPainter.DrawLaunchButtonDefaultGlyph(DC: HDC; const R: TRect; + AState: Integer); +begin + if not IsSkinAvailable then + inherited DrawLaunchButtonDefaultGlyph(DC, R, AState); +end; + +procedure TdxSkinRibbonPainter.DrawHelpButton(DC: HDC; const R: TRect; + AState: TdxBorderIconState); +const + AStateMap: array [TdxBorderIconState] of Integer = + (DXBAR_NORMAL, DXBAR_HOT, DXBAR_PRESSED, DXBAR_NORMAL, DXBAR_NORMAL); +begin + if IsSkinAvailable then + DrawSmallButton(DC, R, AStateMap[AState]) + else + inherited DrawHelpButton(DC, R, AState); +end; + +procedure TdxSkinRibbonPainter.DrawGroupScrollButton(DC: HDC; const R: TRect; + ALeft: Boolean; AState: Integer); +const + AScrollPart: array[Boolean] of TcxScrollBarPart = (sbpLineDown, sbpLineUp); +var + AElementInfo: TdxSkinScrollInfo; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElementInfo := ASkinInfo.ScrollBar_Elements[True, AScrollPart[ALeft]] + else + AElementInfo := nil; + + if (AElementInfo = nil) or (AElementInfo.Element = nil) then + inherited DrawGroupScrollButton(DC, R, ALeft, AState) + else + AElementInfo.Element.Draw(DC, R, AElementInfo.ImageIndex, + SkinElementStateByRibbonState(AState)); +end; + +procedure TdxSkinRibbonPainter.DrawMarkArrow(DC: HDC; const R: TRect; + AState: Integer); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonQuickToolbarGlyph + else + AElement := nil; + + if AElement = nil then + inherited DrawMarkArrow(DC, R, AState) + else + AElement.Draw(DC, R); +end; + +procedure TdxSkinRibbonPainter.DrawMDIButton(DC: HDC; const R: TRect; + AButton: TdxBarMDIButton; AState: TdxBorderIconState); +const + RibbonIconsToSkinFormIcons: array[TdxBarMDIButton] of TdxSkinFormIcon = + (sfiMinimize, sfiRestore, sfiClose); + RibbonIconStateToSkinElementState: array[TdxBorderIconState] of TdxSkinElementState = + (esNormal, esHot, esPressed, esActive, esHot); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + ARect: TRect; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.FormIcons[True, RibbonIconsToSkinFormIcons[AButton]]; + if AElement = nil then + inherited DrawMDIButton(DC, R, AButton, AState) + else + begin + ARect := R; + InflateRect(ARect, -1, -1); + AElement.Draw(DC, ARect, 0, RibbonIconStateToSkinElementState[AState]); + end; +end; + +procedure TdxSkinRibbonPainter.DrawMenuCheck(DC: HDC; const R: TRect; + AState: Integer); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.PopupMenuCheck; + + if AElement = nil then + inherited DrawMenuCheck(DC, R, AState) + else + AElement.Draw(DC, R, 1); +end; + +procedure TdxSkinRibbonPainter.DrawMenuCheckMark(DC: HDC; const R: TRect; + AState: Integer); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.PopupMenuCheck; + + if AElement = nil then + inherited DrawMenuCheckMark(DC, R, AState) + else + AElement.Draw(DC, R); +end; + +procedure TdxSkinRibbonPainter.DrawMenuContent(DC: HDC; const R: TRect); +var + AElement: TdxSkinElement; + ARect: TRect; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.PopupMenu; + + if AElement = nil then + inherited DrawMenuContent(DC, R) + else + begin + ARect := R; + if AElement.Image.Empty then + with AElement.Borders do + ARect := cxRectInflate(ARect, Left.Thin, Top.Thin, Right.Thin, Bottom.Thin) + else + with AElement.Image.Margins.Rect do + ARect := cxRectInflate(ARect, Left, Top, Right, Bottom); + DrawClippedElement(DC, R, ARect, AElement, esNormal, True); + end; +end; + +procedure TdxSkinRibbonPainter.DrawMenuGlyph(DC: HDC; const R: TRect); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + R1: TRect; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.PopupMenuSideStrip; + if AElement = nil then + inherited DrawMenuGlyph(DC, R) + else + begin + R1 := R; + Inc(R1.Right, Max(2, AElement.Image.Margins.Right)); + DrawClippedElement(DC, R, R1, AElement); + end; +end; + +procedure TdxSkinRibbonPainter.DrawMenuScrollArea(DC: HDC; const R: TRect; + AState: Integer); +begin + if not IsSkinAvailable then + inherited DrawMenuScrollArea(DC, R, AState) +end; + +procedure TdxSkinRibbonPainter.DrawMenuSeparatorHorz(DC: HDC; const R: TRect); +var + ABackground: TdxSkinElement; + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + ABackground := nil; + AElement := nil; + if GetSkinData(ASkinInfo) then + begin + ABackground := ASkinInfo.PopupMenuSideStripNonRecent; + AElement := ASkinInfo.PopupMenuSeparator; + end; + + if (AElement = nil) or (ABackground = nil) then + inherited DrawMenuSeparatorHorz(DC, R) + else + begin + ABackground.Draw(DC, R); + AElement.Draw(DC, R); + end; +end; + +procedure TdxSkinRibbonPainter.DrawMenuSeparatorVert(DC: HDC; const R: TRect); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + R1: TRect; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.PopupMenuSideStrip; + if AElement = nil then + inherited DrawMenuGlyph(DC, R) + else + begin + R1 := R; + R1.Left := R.Right - Max(2, AElement.Size.cx); + DrawClippedElement(DC, R, R1, AElement); + end; +end; + +procedure TdxSkinRibbonPainter.DrawRibbonBackground(DC: HDC; const R: TRect); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + R1: TRect; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonHeaderBackground; + + if AElement = nil then + inherited DrawRibbonBackground(DC, R) + else + begin + R1 := R; + if AElement.IsAlphaUsed then + Inc(R1.Bottom, AElement.Image.Margins.Bottom); + DrawClippedElement(DC, R, R1, AElement, esNormal, True); + end; +end; + +procedure TdxSkinRibbonPainter.DrawRibbonClientTopArea(DC: HDC; const R: TRect); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonFormCaption; + + if AElement = nil then + inherited DrawRibbonClientTopArea(DC, R) + else + with AElement.Image.Margins.Rect do + DrawClippedElement(DC, R, Rect(R.Left - Left, R.Top, R.Right + Right, + R.Bottom), AElement, esNormal, True); +end; + +procedure TdxSkinRibbonPainter.DrawScreenTip(DC: HDC; const R: TRect); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.ScreenTipWindow; + + if AElement = nil then + inherited DrawScreenTip(DC, R) + else + AElement.Draw(DC, R); +end; + +procedure TdxSkinRibbonPainter.DrawSmallButton(DC: HDC; const R: TRect; + AState: Integer); +const + StateMap: array[0..8] of TdxSkinElementState = (esNormal, esDisabled, esHot, + esHot, esPressed, esChecked, esChecked, esHotCheck, esActiveDisabled); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonSmallButton; + + if AElement = nil then + inherited DrawSmallButton(DC, R, AState) + else + begin + FSmallButtonsCache.CheckCacheState(AElement, R, StateMap[AState]); + FSmallButtonsCache.Draw(DC, R); + end; +end; + +procedure TdxSkinRibbonPainter.DrawSmallButtonDropButton(DC: HDC; const R: TRect; + AState: Integer); +const + StateMap: array[0..8] of TdxSkinElementState = (esNormal, esNormal, esHot, + esActive, esPressed, esFocused, esActive, esHot, esNormal); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonSplitButtonRight; + + if AElement = nil then + inherited DrawSmallButtonDropButton(DC, R, AState) + else + AElement.Draw(DC, R, 0, StateMap[AState]); +end; + +procedure TdxSkinRibbonPainter.DrawSmallButtonGlyphBackground(DC: HDC; + const R: TRect; AState: Integer); +const + StateMap: array[0..8] of TdxSkinElementState = (esNormal, esNormal, esHot, + esActive, esPressed, esFocused, esActive, esHot, esNormal); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonSplitButtonLeft; + + if AElement = nil then + inherited DrawSmallButtonDropButton(DC, R, AState) + else + AElement.Draw(DC, R, 0, StateMap[AState]); +end; + +procedure TdxSkinRibbonPainter.DrawStatusBar(DC: HDC; const R: TRect); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + ARect: TRect; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonStatusBarBackground; + + if AElement = nil then + inherited DrawStatusBar(DC, R) + else + begin + ARect := R; + with AElement.Image.Margins do + begin + Dec(ARect.Left, Left); + Inc(ARect.Right, Right); + end; + DrawClippedElement(DC, R, ARect, AElement); + end; +end; + +procedure TdxSkinRibbonPainter.DrawStatusBarGripBackground(DC: HDC; const R: TRect); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + + procedure DrawBackground; + var + ARect: TRect; + begin + ARect := R; + with AElement.Image.Margins do + begin + Dec(ARect.Left, Left); + Inc(ARect.Right, Right); + end; + DrawClippedElement(DC, R, ARect, AElement, esNormal, False, 1); + end; + + procedure DrawContent(ASizeGrip: TdxSkinElement); + var + ARect: TRect; + begin + if ASizeGrip = nil then Exit; + ARect := R; + with AElement.ContentOffset do + begin + Inc(ARect.Left, Left); + Inc(ARect.Top, Top); + Dec(ARect.Right, Right); + Dec(ARect.Bottom, Bottom); + end; + ASizeGrip.Draw(DC, ARect); + end; + +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonStatusBarBackground; + + if AElement = nil then + inherited DrawStatusBarGripBackground(DC, R) + else + begin + DrawBackground; + DrawContent(ASkinInfo.SizeGrip); + ExcludeClipRect(DC, R.Left, R.Top, R.Right, R.Bottom); + end; +end; + +procedure TdxSkinRibbonPainter.DrawStatusBarPanel(DC: HDC; const R: TRect; + AIsLowered: Boolean); +var + AElement: TdxSkinElement; + ABitmap: TcxBitmap; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonStatusBarBackground; + + if AElement = nil then + inherited DrawStatusBarPanel(DC, R, AIsLowered) + else + begin /// TODO + ABitmap := TcxBitmap.CreateSize(R); + try + with AElement.Image.Margins.Rect do + AElement.Draw(ABitmap.Canvas.Handle, Rect(-Left, 0, R.Right - R.Left + Right, + R.Bottom - R.Top), Integer(not AIsLowered)); + BitBlt(DC, R.Left, R.Top, R.Right - R.Left, R.Bottom - R.Top, + ABitmap.Canvas.Handle, 0, 0, SRCCOPY); + finally + ABitmap.Free; + end; + end; +end; + +procedure TdxSkinRibbonPainter.DrawStatusBarPanelSeparator(DC: HDC; const R: TRect); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonStatusBarSeparator; + + if AElement = nil then + inherited DrawStatusBarPanelSeparator(DC, R) + else + AElement.Draw(DC, R); +end; + +procedure TdxSkinRibbonPainter.DrawStatusBarToolbarSeparator(DC: HDC; const R: TRect); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonStatusBarSeparator; + + if AElement = nil then + inherited DrawStatusBarToolbarSeparator(DC, R) + else + AElement.Draw(DC, R); +end; + +procedure TdxSkinRibbonPainter.DrawTab(DC: HDC; const R: TRect; + AState: TdxRibbonTabState); +const + ATabStatesMap: array[TdxRibbonTabState] of TdxSkinElementState = + (esNormal, esHot, esActive, esFocused, esFocused); +var + AElement: TdxSkinElement; + ARect: TRect; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonTab; + + if AElement = nil then + inherited DrawTab(DC, R, AState) + else + begin + ARect := R; + Inc(ARect.Top, 2); + InflateRect(ARect, -1, 0); + AElement.Draw(DC, ARect, 0, ATabStatesMap[AState]); + end; +end; + +procedure TdxSkinRibbonPainter.DrawTabGroupBackground(DC: HDC; const R: TRect; + AState: Integer); +const + AStateMap: array[Boolean] of TdxSkinElementState = (esNormal, esHot); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonTabGroup; + + if AElement = nil then + inherited DrawTabGroupBackground(DC, R, AState) + else + FTabGroupBackground.DrawElement(DC, AElement, R, AStateMap[AState = DXBAR_HOT]); +end; + +procedure TdxSkinRibbonPainter.DrawTabGroupHeaderBackground(DC: HDC; const R: TRect; + AState: Integer); +const + AStateMap: array[Boolean] of TdxSkinElementState = (esNormal, esHot); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonTabGroupHeader; + + if AElement = nil then + inherited DrawTabGroupHeaderBackground(DC, R, AState) + else + AElement.Draw(DC, R, 0, AStateMap[AState = DXBAR_HOT]); +end; + +procedure TdxSkinRibbonPainter.DrawTabGroupsArea(DC: HDC; const R: TRect); +var + AElement: TdxSkinElement; + ARect: TRect; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonTabPanel; + if AElement = nil then + inherited DrawTabGroupsArea(DC, R) + else + begin + ARect := R; + if ASkinInfo.RibbonIndents[2] <> 0 then + ARect.Top := ARect.Top - ASkinInfo.RibbonIndents[2] + 1; + FTabGroupsAreaCache.CheckCacheState(AElement, ARect); + FTabGroupsAreaCache.Draw(DC, ARect); + end; +end; + +procedure TdxSkinRibbonPainter.DrawTabScrollButton(DC: HDC; const R: TRect; + ALeft: Boolean; AState: Integer); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonSmallButton + else + AElement := nil; + + if AElement = nil then + inherited DrawTabScrollButton(DC, R, ALeft, AState) + else + AElement.Draw(DC, R, 0, SkinElementStateByRibbonState(AState)); +end; + +procedure TdxSkinRibbonPainter.DrawTabSeparator(DC: HDC; const R: TRect; + Alpha: Byte); +begin + if not IsSkinAvailable then + inherited DrawTabSeparator(DC, R, Alpha); +end; + +procedure TdxSkinRibbonPainter.DrawRibbonBottomBorder(DC: HDC; const R: TRect); +var + AElement: TdxSkinElement; + ARect: TRect; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonTabPanel + else + AElement := nil; + + if AElement = nil then + inherited DrawRibbonBottomBorder(DC, R) + else + begin + ARect := R; + with AElement.Image.Margins do + begin + Dec(ARect.Left, Left); + Inc(ARect.Right, Right); + end; + ARect.Bottom := ARect.Top + AElement.Size.cy; + DrawClippedElement(DC, R, ARect, AElement); + end; +end; + +procedure TdxSkinRibbonPainter.DrawQuickAccessToolbar(DC: HDC; const R: TRect; + ABellow, ANonClientDraw, AHasApplicationButton, AIsActive, ADontUseAero: Boolean); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; + + function ValidateQATRect(const R: TRect; AParent: TdxSkinElement): TRect; + var + ARightIndent: Integer; + begin + Result := R; + if AParent = nil then + ARightIndent := 0 + else + with AParent.ContentOffset.Rect do + begin + ARightIndent := GetQuickAccessToolbarRightIndent(AHasApplicationButton); + Result := cxRectInflate(R, 0, -Top, 0, -Bottom); + end; + + if GetCustomizeButtonOutsizeQAT(AHasApplicationButton) then + begin + Dec(ARightIndent, QATRightDefaultOffset); + Dec(ARightIndent, GetQuickAccessToolbarMarkButtonOffset(AHasApplicationButton, ABellow)); + end; + Inc(Result.Right, ARightIndent); + end; + +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + if ABellow then + AElement := ASkinInfo.RibbonQuickToolbarBelow + else + AElement := ASkinInfo.RibbonQuickToolbar[AHasApplicationButton]; + + if (AElement = nil) or (ANonClientDraw and IsCompositionEnabled and not ADontUseAero) then + inherited DrawQuickAccessToolbar(DC, R, ABellow, ANonClientDraw, + AHasApplicationButton, AIsActive, ADontUseAero) + else + if ABellow then + AElement.Draw(DC, R) + else + AElement.Draw(DC, ValidateQATRect(R, ASkinInfo.RibbonFormCaption)); +end; + +procedure TdxSkinRibbonPainter.DrawQuickAccessToolbarDefaultGlyph(DC: HDC; + const R: TRect); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonQuickToolbarButtonGlyph + else + AElement := nil; + + if AElement = nil then + inherited DrawQuickAccessToolbarDefaultGlyph(DC, R) + else + AElement.Draw(DC, R); +end; + +procedure TdxSkinRibbonPainter.DrawQuickAccessToolbarGroupButton(DC: HDC; + const R: TRect; ABellow: Boolean; ANonClientDraw: Boolean; AIsActive: Boolean; + AState: Integer); +var + ABackground: TdxSkinElement; + AElement: TdxSkinElement; + ARect: TRect; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + begin + ABackground := ASkinInfo.RibbonButtonGroup; + AElement := ASkinInfo.RibbonButtonGroupButton; + end + else + begin + AElement := nil; + ABackground := nil; + end; + + if (AElement = nil) or (ABackground = nil) then + inherited DrawQuickAccessToolbarGroupButton(DC, R, ABellow, ANonClientDraw, + AIsActive, AState) + else + begin + ARect := R; + ABackground.Draw(DC, R); + with ABackground.ContentOffset.Rect do + begin + Inc(ARect.Top, Top); + Inc(ARect.Left, Left); + Dec(ARect.Right, Right); + Dec(ARect.Bottom, Bottom); + end; + AElement.Draw(DC, ARect, 0, SkinElementStateByRibbonState(AState)); + end; +end; + +procedure TdxSkinRibbonPainter.DrawQuickAccessToolbarPopup(DC: HDC; const R: TRect); +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AElement := ASkinInfo.RibbonQuickToolbarDropDown + else + AElement := nil; + + if AElement = nil then + inherited DrawQuickAccessToolbarPopup(DC, R) + else + AElement.Draw(DC, R); +end; + +function TdxSkinRibbonPainter.GetCaptionFontSize(ACurrentFontSize: Integer): Integer; +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := inherited GetCaptionFontSize(ACurrentFontSize); + if GetSkinData(ASkinInfo) and (ASkinInfo.RibbonCaptionFontDelta <> nil) then + Inc(Result, ASkinInfo.RibbonCaptionFontDelta.Value); +end; + +function TdxSkinRibbonPainter.GetMenuSeparatorSize: Integer; +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) and Assigned(ASkinInfo.PopupMenuSeparator) then + Result := ASkinInfo.PopupMenuSeparator.Size.cy + else + Result := inherited GetMenuSeparatorSize; +end; + +function TdxSkinRibbonPainter.GetPartColor(APart: Integer; + AState: Integer = 0): TColor; + + function GetPropertyColor(AColor: TdxSkinColor): TColor; + begin + if AColor = nil then + Result := clDefault + else + Result := AColor.Value; + end; + +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + Result := clDefault; + if GetSkinData(ASkinInfo) then + case APart of + DXBAR_MENUEXTRAPANE: + Result := GetPropertyColor(ASkinInfo.RibbonExtraPaneColor); + + DXBAR_SEPARATOR_BACKGROUND, DXBAR_EDIT_BACKGROUND: + Result := GetPropertyColor(ASkinInfo.ContentColor); + + DXBAR_ITEMTEXT: + Result := ASkinInfo.RibbonButtonText[AState = DXBAR_DISABLED]; + + DXBAR_MENUITEMTEXT: + if AState = DXBAR_DISABLED then + Result := GetPropertyColor(ASkinInfo.BarDisabledTextColor) + else + if ASkinInfo.PopupMenu <> nil then + Result := ASkinInfo.PopupMenu.TextColor; + + DXBAR_EDIT_BORDER: + if AState = DXBAR_ACTIVE then + Result := GetPropertyColor(ASkinInfo.ContainerHighlightBorderColor) + else + Result := GetPropertyColor(ASkinInfo.ContainerBorderColor); + + DXBAR_SCREENTIP_FOOTERLINE, + DXBAR_APPLICATIONMENUCONTENTINNERBORDER: + Result := GetPropertyColor(ASkinInfo.ContainerBorderColor); + + DXBAR_APPLICATIONMENUCONTENTOUTERBORDER, + DXBAR_APPLICATIONMENUCONTENTSIDES, rfspRibbonForm: + if ASkinInfo.FormContent <> nil then + Result := ASkinInfo.FormContent.Color; + + rspTabHeaderText: + Result := ASkinInfo.RibbonTabText[AState = DXBAR_ACTIVE]; + + rspFormCaptionText: + Result := ASkinInfo.RibbonCaptionText[AState = DXBAR_NORMAL]; + + rspDocumentNameText: + Result := ASkinInfo.RibbonDocumentNameTextColor[AState = DXBAR_NORMAL]; + + rspTabGroupText: + if ASkinInfo.RibbonSmallButton <> nil then + Result := ASkinInfo.RibbonSmallButton.TextColor; + + rspTabGroupHeaderText: + if ASkinInfo.RibbonTabGroupHeader <> nil then + Result := ASkinInfo.RibbonTabGroupHeader.TextColor; + + rspStatusBarText: + case AState of + DXBAR_NORMAL: + Result := ASkinInfo.RibbonStatusBarText; + DXBAR_HOT: + Result := ASkinInfo.RibbonStatusBarTextHot; + DXBAR_DISABLED: + Result := ASkinInfo.RibbonStatusBarTextDisabled; + end; + + DXBAR_GALLERYGROUPHEADERTEXT, DXBAR_GALLERYFILTERBANDTEXT: + if ASkinInfo.RibbonGalleryGroupCaption <> nil then + Result := ASkinInfo.RibbonGalleryGroupCaption.TextColor; + end; + if Result = clDefault then + Result := inherited GetPartColor(APart, AState); +end; + +function TdxSkinRibbonPainter.GetPartContentOffsets(APart: Integer): TRect; +var + AElement: TdxSkinElement; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + AElement := nil; + if GetSkinData(ASkinInfo) then + if APart = DXBAR_GALLERYFILTERBAND then + AElement := ASkinInfo.RibbonGallerySizingPanel; + if AElement <> nil then + Result := AElement.Image.Margins.Rect + else + Result := inherited GetPartContentOffsets(APart); +end; + +function TdxSkinRibbonPainter.GetQuickAccessToolbarLeftIndent( + AHasApplicationButton: Boolean; AUseAeroGlass: Boolean): Integer; +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if not AUseAeroGlass and AHasApplicationButton and GetSkinData(ASkinInfo) then + begin + Result := -QATLeftDefaultOffset; + if ASkinInfo.RibbonQuickToolbar[True] <> nil then + Inc(Result, ASkinInfo.RibbonQuickToolbar[True].ContentOffset.Left); + Inc(Result, GetQATLeftOffset); + end + else + Result := inherited GetQuickAccessToolbarLeftIndent(AHasApplicationButton, + AUseAeroGlass); +end; + +function TdxSkinRibbonPainter.GetQuickAccessToolbarMarkButtonOffset( + AHasApplicationButton: Boolean; ABelow: Boolean): Integer; +var + AOffsetProperty: TdxSkinIntegerProperty; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + AOffsetProperty := ASkinInfo.RibbonQATIndentBeforeCustomizeButton[AHasApplicationButton] + else + AOffsetProperty := nil; + + if ABelow or (AOffsetProperty = nil) then + Result := inherited GetQuickAccessToolbarMarkButtonOffset(AHasApplicationButton, ABelow) + else + begin + Result := AOffsetProperty.Value; + if GetCustomizeButtonOutsizeQAT(AHasApplicationButton) then + Inc(Result, GetQuickAccessToolbarRightIndent(AHasApplicationButton)); + end; +end; + +function TdxSkinRibbonPainter.GetQuickAccessToolbarOverrideWidth( + AHasApplicationButton: Boolean; AUseAeroGlass: Boolean): Integer; +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if not AUseAeroGlass and AHasApplicationButton and GetSkinData(ASkinInfo) then + begin + with ASkinInfo do + Result := GetQuickAccessToolbarLeftIndent(True, AUseAeroGlass) + QATLeftDefaultOffset; + Dec(Result, GetQATLeftOffset); + end + else + Result := inherited GetQuickAccessToolbarOverrideWidth(AHasApplicationButton, + AUseAeroGlass); +end; + +function TdxSkinRibbonPainter.GetQuickAccessToolbarRightIndent( + AHasApplicationButton: Boolean): Integer; +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) and (ASkinInfo.RibbonQuickToolbar[AHasApplicationButton] <> nil) then + Result := ASkinInfo.RibbonQuickToolbar[AHasApplicationButton].ContentOffset.Right + else + Result := inherited GetQuickAccessToolbarRightIndent(AHasApplicationButton); +end; + +function TdxSkinRibbonPainter.GetSkinName: string; +begin + Result := FLookAndFeel.SkinName; +end; + +function TdxSkinRibbonPainter.GetWindowBordersWidth(AHasStatusBar: Boolean): TRect; + + function GetElementSizes(AElement: TdxSkinElement): TSize; + begin + if AElement = nil then + Result := cxNullSize + else + Result := AElement.Size; + end; + +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if GetSkinData(ASkinInfo) then + begin + Result := Rect(GetElementSizes(GetBorderSkinElement(bLeft, False, ASkinInfo)).cx, + 0, GetElementSizes(GetBorderSkinElement(bRight, False, ASkinInfo)).cx, 0); + if AHasStatusBar then + Result.Bottom := 1 + else + Result.Bottom := GetElementSizes(GetBorderSkinElement(bBottom, False, ASkinInfo)).cy; + end + else + Result := inherited GetWindowBordersWidth(AHasStatusBar); +end; + +function TdxSkinRibbonPainter.HasGroupTransparency: Boolean; +begin + Result := True; +end; + +function TdxSkinRibbonPainter.NeedDrawGroupScrollArrow: Boolean; +begin + Result := False; +end; + +{ TdxSkinsRibbonPainterManager } + +constructor TdxSkinsRibbonPainterManager.Create; +begin + GetExtendedStylePainters.AddListener(Self); + InitializePaintersList; +end; + +destructor TdxSkinsRibbonPainterManager.Destroy; +begin + GetExtendedStylePainters.RemoveListener(Self); + FreePaintersList; + inherited Destroy; +end; + +procedure TdxSkinsRibbonPainterManager.FreePaintersList; +var + I: Integer; + ASkin: TdxCustomBarSkin; +begin + for I := SkinManager.SkinCount - 1 downto 0 do + begin + ASkin := SkinManager.Skins[I]; + if ASkin is TdxSkinRibbonPainter then + SkinManager.RemoveSkin(ASkin); + end; +end; + +procedure TdxSkinsRibbonPainterManager.InitializePaintersList; +var + I: Integer; + AExtendedPainters: TcxExtendedStylePainters; +begin + AExtendedPainters := GetExtendedStylePainters; + if AExtendedPainters <> nil then + for I := 0 to AExtendedPainters.Count - 1 do + if SkinManager.SkinByName(AExtendedPainters.Names[I]) = nil then + SkinManager.AddSkin(TdxSkinRibbonPainter.Create(AExtendedPainters.Names[I])); +end; + +procedure TdxSkinsRibbonPainterManager.PainterChanged( + APainter: TcxCustomLookAndFeelPainterClass); +var + AName: string; + ASkin: TdxCustomBarSkin; + I: Integer; +begin + if GetExtendedStylePainters.GetNameByPainter(APainter, AName) then + begin + if SkinManager.SkinByName(AName) = nil then + SkinManager.AddSkin(TdxSkinRibbonPainter.Create(AName)) + end + else + for I := SkinManager.SkinCount - 1 downto 0 do + begin + ASkin := SkinManager.Skins[I]; + if (ASkin is TdxSkinRibbonPainter) and (TdxSkinRibbonPainter(ASkin).SkinName = '') then + SkinManager.RemoveSkin(ASkin); + end; +end; + +procedure RegisterPainterManager; +begin + SkinsRibbonPainterManager := TdxSkinsRibbonPainterManager.Create; +end; + +procedure UnregisterPainterManager; +begin + FreeAndNil(SkinsRibbonPainterManager); +end; + +initialization + dxUnitsLoader.AddUnit(@RegisterPainterManager, @UnregisterPainterManager); + +finalization + dxUnitsLoader.RemoveUnit(@UnregisterPainterManager); + +end. diff --git a/official/x.35/ExpressSkins Library/Sources/dxSkinsdxStatusBarPainter.pas b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxStatusBarPainter.pas new file mode 100644 index 00000000..a260c2de --- /dev/null +++ b/official/x.35/ExpressSkins Library/Sources/dxSkinsdxStatusBarPainter.pas @@ -0,0 +1,279 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressSkins Library } +{ } +{ Copyright (c) 2006-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSSKINS AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxSkinsdxStatusBarPainter; + +interface + +uses + Windows, SysUtils, Classes, dxSkinsCore, cxLookAndFeels, dxSkinsLookAndFeelPainter, dxStatusBar, + cxGraphics, Graphics, cxLookAndFeelPainters; + +type + + { TdxStatusBarSkinPainter } + + TdxStatusBarSkinPainter = class(TdxStatusBarStandardPainter) + protected + class function CheckStatusBarRect(AFormStatusBar: TdxSkinElement; const R: TRect): TRect; + class function GetSkinInfo(AStatusBar: TdxCustomStatusBar; + out ASkinInfo: TdxSkinLookAndFeelPainterInfo): Boolean; + class function IsSizeGripExists(AStatusBar: TdxCustomStatusBar; APanel: TdxStatusBarPanel): Boolean; + class function IsSkinAvailable(AStatusBar: TdxCustomStatusBar): Boolean; + public + class procedure AdjustTextColor(AStatusBar: TdxCustomStatusBar; var AColor: TColor; + Active: Boolean); override; + class function DrawSizeGripFirst: Boolean; override; + class function SeparatorSize: Integer; override; + class function TopBorderSize: Integer; override; + class procedure DrawClippedElement(AElement: TdxSkinElement; ACanvas: TcxCanvas; + const ARect, AClipRegion: TRect; ARegionOperation: TcxRegionOperation = roSet); + class procedure DrawEmptyPanel(AStatusBar: TdxCustomStatusBar; ACanvas: TcxCanvas; + R: TRect); override; + class procedure DrawPanelBorder(AStatusBar: TdxCustomStatusBar; + ABevel: TdxStatusBarPanelBevel; ACanvas: TcxCanvas; var R: TRect); override; + class procedure DrawPanelSeparator(AStatusBar: TdxCustomStatusBar; + ACanvas: TcxCanvas; const R: TRect); override; + class procedure DrawTopBorder(AStatusBar: TdxCustomStatusBar; ACanvas: TcxCanvas; + const R: TRect); override; + class procedure DrawSizeGrip(AStatusBar: TdxCustomStatusBar; ACanvas: TcxCanvas; + R: TRect; AOverlapped: Boolean); override; + class procedure FillBackground(AStatusBar: TdxCustomStatusBar; + APanel: TdxStatusBarPanel; ACanvas: TcxCanvas; const R: TRect); override; + class function ValidatePanelTextRect(AStatusBar: TdxCustomStatusBar; + APanel: TdxStatusBarPanel; const R: TRect): TRect; override; + end; + +implementation + +uses + cxGeometry; + +type + TdxCustomStatusBarAccess = class(TdxCustomStatusBar); + +{ TdxStatusBarSkinPainter } + +class procedure TdxStatusBarSkinPainter.AdjustTextColor(AStatusBar: TdxCustomStatusBar; + var AColor: TColor; Active: Boolean); +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + inherited AdjustTextColor(AStatusBar, AColor, Active); + if AColor = clWindowText then + if GetSkinInfo(AStatusBar, ASkinInfo) then + begin + if Active then + begin + if ASkinInfo.FormStatusBar <> nil then + AColor := ASkinInfo.FormStatusBar.TextColor; + end + else + if ASkinInfo.BarDisabledTextColor <> nil then + AColor := ASkinInfo.BarDisabledTextColor.Value; + end; +end; + +class function TdxStatusBarSkinPainter.CheckStatusBarRect(AFormStatusBar: TdxSkinElement; + const R: TRect): TRect; +begin + Result := R; + if Assigned(AFormStatusBar) then + with AFormStatusBar.ContentOffset do + begin + Dec(Result.Left, Left); + Inc(Result.Right, Right); + Inc(Result.Bottom, Bottom); + end; +end; + +class function TdxStatusBarSkinPainter.DrawSizeGripFirst: Boolean; +begin + Result := False; +end; + +class function TdxStatusBarSkinPainter.SeparatorSize: Integer; +begin + Result := 0; +end; + +class function TdxStatusBarSkinPainter.TopBorderSize: Integer; +begin + Result := 2; +end; + +class procedure TdxStatusBarSkinPainter.DrawClippedElement(AElement: TdxSkinElement; + ACanvas: TcxCanvas; const ARect: TRect; const AClipRegion: TRect; + ARegionOperation: TcxRegionOperation = roSet); +begin + ACanvas.SaveClipRegion; + try + ACanvas.SetClipRegion(TcxRegion.Create(AClipRegion), ARegionOperation); + AElement.Draw(ACanvas.Handle, ARect); + finally + ACanvas.RestoreClipRegion; + end; +end; + +class procedure TdxStatusBarSkinPainter.DrawEmptyPanel(AStatusBar: TdxCustomStatusBar; + ACanvas: TcxCanvas; R: TRect); +var + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + if not GetSkinInfo(AStatusBar, ASkinInfo) or (ASkinInfo.FormStatusBar = nil) then + inherited DrawEmptyPanel(AStatusBar, ACanvas, R) + else + DrawClippedElement(ASkinInfo.FormStatusBar, ACanvas, + CheckStatusBarRect(ASkinInfo.FormStatusBar, AStatusBar.Bounds), R); +end; + +class procedure TdxStatusBarSkinPainter.DrawPanelBorder(AStatusBar: TdxCustomStatusBar; + ABevel: TdxStatusBarPanelBevel; ACanvas: TcxCanvas; var R: TRect); +begin + if not IsSkinAvailable(AStatusBar) then + inherited DrawPanelBorder(AStatusBar, ABevel, ACanvas, R); +end; + +class procedure TdxStatusBarSkinPainter.DrawPanelSeparator(AStatusBar: TdxCustomStatusBar; + ACanvas: TcxCanvas; const R: TRect); +begin + if not IsSkinAvailable(AStatusBar) then + inherited DrawPanelSeparator(AStatusBar, ACanvas, R); +end; + +class procedure TdxStatusBarSkinPainter.DrawTopBorder(AStatusBar: TdxCustomStatusBar; + ACanvas: TcxCanvas; const R: TRect); +var + ANeedCustomDraw: Boolean; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + ANeedCustomDraw := True; + if GetSkinInfo(AStatusBar, ASkinInfo) then + begin + ANeedCustomDraw := ASkinInfo.FormStatusBar = nil; + if not ANeedCustomDraw then + DrawClippedElement(ASkinInfo.FormStatusBar, ACanvas, + CheckStatusBarRect(ASkinInfo.FormStatusBar, AStatusBar.Bounds), R); + end; + if ANeedCustomDraw then + inherited DrawTopBorder(AStatusBar, ACanvas, R); +end; + +class procedure TdxStatusBarSkinPainter.DrawSizeGrip(AStatusBar: TdxCustomStatusBar; + ACanvas: TcxCanvas; R: TRect; AOverlapped: Boolean); +var + ANeedCustomDraw: Boolean; + ARect: TRect; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + ANeedCustomDraw := True; + if GetSkinInfo(AStatusBar, ASkinInfo) then + begin + ANeedCustomDraw := ASkinInfo.SizeGrip = nil; + if not ANeedCustomDraw then + begin + with ASkinInfo.FormStatusBar.ContentOffset.Rect do + ARect := Rect(R.Right - ASkinInfo.SizeGrip.Size.cx - Right, R.Top, + R.Right - Right, R.Bottom - Bottom); + ASkinInfo.SizeGrip.Draw(ACanvas.Handle, ARect); + end; + end; + if ANeedCustomDraw then + inherited DrawSizeGrip(AStatusBar, ACanvas, R, AOverlapped); +end; + +class procedure TdxStatusBarSkinPainter.FillBackground( + AStatusBar: TdxCustomStatusBar; APanel: TdxStatusBarPanel; ACanvas: TcxCanvas; + const R: TRect); +var + ADone: Boolean; + ARect: TRect; + ASkinInfo: TdxSkinLookAndFeelPainterInfo; +begin + ADone := False; + if GetSkinInfo(AStatusBar, ASkinInfo) then + begin + ADone := (ASkinInfo.FormStatusBar <> nil) and (ASkinInfo.LinkBorderPainter <> nil); + if ADone then + begin + DrawClippedElement(ASkinInfo.FormStatusBar, ACanvas, + CheckStatusBarRect(ASkinInfo.FormStatusBar, AStatusBar.Bounds), R, + roIntersect); + ARect := cxRectInflate(R, -1, 0, -1, -1); + if IsSizeGripExists(AStatusBar, APanel) then + Dec(ARect.Right, GripAreaSize.cx); + ASkinInfo.LinkBorderPainter.Draw(ACanvas.Handle, ARect); + end; + end; + if not ADone then + inherited FillBackground(AStatusBar, APanel, ACanvas, R); +end; + +class function TdxStatusBarSkinPainter.GetSkinInfo(AStatusBar: TdxCustomStatusBar; + out ASkinInfo: TdxSkinLookAndFeelPainterInfo): Boolean; +begin + with TdxCustomStatusBarAccess(AStatusBar) do + Result := GetExtendedStylePainters.GetPainterData(LookAndFeel.SkinPainter, + ASkinInfo); +end; + +class function TdxStatusBarSkinPainter.IsSkinAvailable( + AStatusBar: TdxCustomStatusBar): Boolean; +begin + with TdxCustomStatusBarAccess(AStatusBar) do + Result := LookAndFeel.SkinPainter <> nil; +end; + +class function TdxStatusBarSkinPainter.IsSizeGripExists(AStatusBar: TdxCustomStatusBar; + APanel: TdxStatusBarPanel): Boolean; +begin + with TdxCustomStatusBarAccess(AStatusBar) do + Result := (APanel <> nil) and (APanel.Index = Panels.Count - 1) and SizeGrip; +end; + +class function TdxStatusBarSkinPainter.ValidatePanelTextRect(AStatusBar: TdxCustomStatusBar; + APanel: TdxStatusBarPanel; const R: TRect): TRect; +begin + Result := R; + if IsSizeGripExists(AStatusBar, APanel) then + Dec(Result.Right, GripAreaSize.cx); +end; + +initialization + dxStatusBarSkinPainterClass := TdxStatusBarSkinPainter; + +finalization + dxStatusBarSkinPainterClass := nil; + +end. diff --git a/official/x.35/ExpressSkins Library/dxSkinEditor.exe b/official/x.35/ExpressSkins Library/dxSkinEditor.exe new file mode 100644 index 00000000..fe1cb6fb Binary files /dev/null and b/official/x.35/ExpressSkins Library/dxSkinEditor.exe differ diff --git a/official/x.35/ExpressSkins Library/eula.txt b/official/x.35/ExpressSkins Library/eula.txt new file mode 100644 index 00000000..07f61487 --- /dev/null +++ b/official/x.35/ExpressSkins Library/eula.txt @@ -0,0 +1,119 @@ +DEVELOPER EXPRESS INC +ExpressSkins Library(tm) COMPONENT SUITE +Copyright (C) 2006-2008 Developer Express Inc. + +END-USER LICENSE AGREEMENT +FOR ALL SOFTWARE COMPONENT PRODUCT(S) + +IMPORTANT- READ CAREFULLY: This DEVELOPER EXPRESS INC ("DEVEXPRESS") End-User License Agreement ("EULA") is a legal agreement between you, a developer of software applications, ("Developer End User") and DEVEXPRESS for all DEVEXPRESS products, controls, source code, demos, intermediate files, media, printed materials, and "online" or electronic documentation ("SOFTWARE COMPONENT PRODUCT(S)") contained in this installation file. + +DEVEXPRESS grants to you as an individual, a personal, nonexclusive license to install and use the SOFTWARE COMPONENT PRODUCT(S) for the sole purposes of designing, developing, testing, and deploying application programs which you create. By installing, copying, or otherwise using the SOFTWARE COMPONENT PRODUCT(S), you agree to be bound by the terms of this EULA. If you do not agree to any part of the terms of this EULA, DO NOT INSTALL, USE, EVALUATE, OR REPLICATE IN ANY MANNER, ANY PART, FILE OR PORTION OF THE SOFTWARE COMPONENT PRODUCT(S). + +All SOFTWARE COMPONENT PRODUCT(S) is licensed, not sold. If you are an individual, you must acquire an individual license for the SOFTWARE COMPONENT PRODUCT(S) from DEVEXPRESS or its authorized resellers. If you are an entity, you must acquire and assign an individual license for each Developer End User within your organization using and or developing with the SOFTWARE COMPONENT PRODUCT(S) from DEVEXPRESS or its authorized resellers. + +If the SOFTWARE COMPONENT PRODUCT(S) you have obtained is marked as a "TRIAL" or "EVALUATION," you may install one copy of the SOFTWARE COMPONENT PRODUCT(S) for testing purposes for a period of 30 calendar days from the date of installation ("Evaluation Period"). Upon expiration of the Evaluation Period, the SOFTWARE COMPONENT PRODUCT(S) must be uninstalled and all copies destroyed. + +RIGOROUS ENFORCEMENT OF INTELLECTUAL PROPERTY RIGHTS. If the licensed right of use for this SOFTWARE COMPONENT PRODUCT(S) is purchased by you with any intent to reverse engineer, decompile, create derivative works, and the exploitation or unauthorized transfer of, any DEVEXPRESS intellectual property and trade secrets, to include any exposed methods or source code where provided, no licensed right of use shall exist, and any PRODUCT(s) created as a result shall be judged illegal by definition of all applicable law. Any sale or resale of intellectual property or created derivatives so obtained will be prosecuted to the fullest extent of all local, federal and international law. + +1. GRANT OF LICENSE. + +This EULA, if legally executed as defined herein, licenses and so grants the single individual Developer End User the following rights: + +SOFTWARE COMPONENT PRODUCT(S) - Developer End User may install and use the SOFTWARE COMPONENT PRODUCT(S) on a single computer. Developer End User may also install and use the SOFTWARE COMPONENT PRODUCT(S) on a portable computer. + +2. LIMITATIONS ON REVERSE ENGINEERING, DECOMPILATION, AND DISASSEMBLY. + +You may not reverse engineer, decompile, create derivative works, translate, or disassemble the SOFTWARE COMPONENT PRODUCT(S), and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation. You agree to take all reasonable, legal and appropriate measures to prohibit the illegal dissemination of the SOFTWARE COMPONENT PRODUCT(S) or any of its constituent parts and redistributables to the fullest extent of all applicable local, US Codes and International Laws and Treaties regarding anti-circumvention, including but not limited to, the Geneva and Berne World Intellectual Property Organization (WIPO) Diplomatic Conferences. + +3. SEPARATION OF COMPONENTS. + +The SOFTWARE COMPONENT PRODUCT(S) is licensed as a single PRODUCT(s). The SOFTWARE COMPONENT PRODUCT(S) and its constituent parts and any provided redistributables may not be reverse engineered, decompiled, disassembled or separated for use on more than one computer, nor placed for distribution, sale, or resale as individual creations by Developer End User. The provision of source code, if included with the SOFTWARE COMPONENT PRODUCT(S), does not constitute transfer of any legal rights to such code, and resale or distribution of all or any portion of all source code and intellectual property will be prosecuted to the fullest extent of all applicable local, federal and international laws. All DEVEXPRESS libraries, source code, redistributables and other files remain DEVEXPRESS's exclusive property. You may not distribute any files, except those that DEVEXPRESS has expressly designated as Redistributable. + +4. RENTAL. + +You may not rent, lease, or lend the SOFTWARE COMPONENT PRODUCT(S). + +5. TRANSFER. + +You may NOT permanently or temporarily transfer ANY of your rights under this EULA to any individual or entity without prior written approval from DEVEXPRESS. Regardless of any modifications which you make and regardless of how you might compile, link, and/or package your programs, under no circumstances may the libraries, Redistributables, and/or other files of the SOFTWARE COMPONENT PRODUCT(S) (including any portions thereof) be used for developing programs by anyone other than you. Only you as the licensed Developer End User have the right to use the libraries, redistributables, or other files of the SOFTWARE COMPONENT PRODUCT(S) (or any portions thereof) for developing programs created with the SOFTWARE COMPONENT PRODUCT(S). In particular, you may not share copies of the Redistributables with other co-developers. You may not reproduce or distribute any DEVEXPRESS documentation without DEVEXPRESS's explicit permission. + +If you are an entity (Company), you must acquire and assign a license to each Developer End User within your organization using and or developing with the SOFTWARE COMPONENT PRODUCT(S). With written notification to DEVEXPRESS, Company may transfer the license obtained for a Developer End User to another Developer End User employed or otherwise engaged by Company if the initial Developer End User is no longer employed or engaged by Company or is reassigned to another function within Company and no longer develops software applications using the SOFTWARE COMPONENT PRODUCT(S). In addition, with written notification to DEVEXPRESS, Company may transfer its license of the SOFTWARE COMPONENT PRODUCT(S) to a successor Company. + +6. ROYALTY FREE REDISTRIBUTION. + +DEVEXPRESS PRODUCT(s) may include certain files ("Redistributable(s)") intended for distribution by you to the users of software applications which you create. Redistributables include, for example, those files identified in printed or on-line documentation as redistributable files, or those files preselected for deployment by an install utility provided with the SOFTWARE COMPONENT PRODUCT(S) (if any). In all circumstances, the Redistributables for the SOFTWARE COMPONENT PRODUCT(S) are only those files specifically designated as such by DEVEXPRESS. + +Subject to all of the terms and conditions in this EULA, you may reproduce and distribute copies of the Redistributables, provided that such copies are made from the original copy of the Redistributables included with the SOFTWARE COMPONENT PRODUCT(S) or modified versions of the Redistributables which are provided to you by DEVEXPRESS or those which you create. Copies of Redistributables may only be distributed with and for the sole purpose of executing application programs permitted under this EULA that you have created using the SOFTWARE COMPONENT PRODUCT(S). + +REDISTRIBUTABLES. To obtain a list of redistributables that apply under this EULA, contact support@devexpress.com + +AT NO TIME MAY DEVELOPER END USER CREATE ANY TOOL, REDISTRIBUTABLE, OR SOFTWARE COMPONENT PRODUCT(S) THAT DIRECTLY OR INDIRECTLY COMPETES WITH DEVEXPRESS SOFTWARE COMPONENT PRODUCT(S) WHICH UTILIZES ALL OR ANY PORTION OF THE SOFTWARE COMPONENT PRODUCT(S) contained within this installation. + +Distribution by the Developer End User of any design-time tools (EXE's OCX's or DLL's), executables, and source code distributed to Developer End User by DEVEXPRESS as part of this SOFTWARE COMPONENT PRODUCT(S) and not explicitly identified as a redistributable file is strictly prohibited. The Developer End User shall not develop software applications that provide an application programming interface to the SOFTWARE COMPONENT PRODUCT(S) or the SOFTWARE COMPONENT PRODUCT(S) as modified. + +The Developer End User may NOT distribute the SOFTWARE COMPONENT PRODUCT(S), in any format, to other users for development or application compilation purposes. Specifically, if Developer End User creates a control using the SOFTWARE COMPONENT PRODUCT(S) as a constituent control, Developer End User may NOT distribute the control created with the SOFTWARE COMPONENT PRODUCT(S) (in any format) to users to be used used at design time and or for ANY development purposes. + +Developer End User MAY NOT REDISTRIBUTE any SOFTWARE COMPONENT PRODUCT(s) files if using an evaluation, trial, Not for Resale, or demo version of the SOFTWARE COMPONENT PRODUCT(s). + +7. UPGRADES. + +If the SOFTWARE COMPONENT PRODUCT(S) is labeled as an upgrade, you must be properly licensed to use the SOFTWARE COMPONENT PRODUCT(S) identified by DEVEXPRESS as being eligible for the upgrade in order to use the SOFTWARE COMPONENT PRODUCT(S). A SOFTWARE COMPONENT PRODUCT(S) labeled as an upgrade replaces and/or supplements the SOFTWARE COMPONENT PRODUCT(S) that formed the basis for your eligibility for the upgrade, and together constitutes a single PRODUCT(S). You may use the resulting upgraded PRODUCT(S) only in accordance with all the terms of this EULA. + +8. COPYRIGHT. + +All title and copyrights in and to the SOFTWARE COMPONENT PRODUCT(S) (including but not limited to any copywritten images, demos, source code, intermediate files, packages, photographs, redistributables, animations, video, audio, music, text, and "applets" incorporated into the SOFTWARE COMPONENT PRODUCT(S) the accompanying printed materials, and any copies of the SOFTWARE COMPONENT PRODUCT(S)) are owned by DEVEXPRESS or its subsidiaries. The SOFTWARE COMPONENT PRODUCT(S) is protected by copyright laws and international treaty provisions and therefore, you must treat the SOFTWARE COMPONENT PRODUCT(S) like any other copyrighted material except that you may install the SOFTWARE COMPONENT PRODUCT(S) as described in this EULA. + +9. DUAL-MEDIA SOFTWARE COMPONENT PRODUCT(S). + +You may receive the SOFTWARE COMPONENT PRODUCT(S) in more than one medium. Regardless of the medium, you may use only one medium that is appropriate for your single computer. You may not loan, sell, rent, lease, or otherwise transfer in any manner the other medium to another user or entity. + +10. U.S. GOVERNMENT RESTRICTED RIGHTS. + +The Licensed Software is Commercial Computer Software provided with RESTRICTED RIGHTS under Federal Acquisition Regulations and agency supplements to them. Use, duplication or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFAR 255.227-7013 et. seq. or 252.211-7015, or subparagraphs (a) through (d) of the Commercial Computer Software Restricted Rights at FAR 52.227-19, as applicable, or similar clauses in the NASA FAR Supplement. Contractor-manufacturer is Developer Express Inc. / 6375 S. Pecos Rd Suite 118, Las Vegas NV 89120. + +11. EXPORT RESTRICTIONS. + +DEVEXPRESS expressly complies with all export restrictions imposed by the government of the United States of America. You, as Developer End User, must agree not to export or re-export the SOFTWARE COMPONENT PRODUCT(S) within any created application to any country, person, entity or end user subject to U.S.A. export restrictions. Restricted countries currently include, but are not necessarily limited to Cuba, Iran, Iraq, Libya, North Korea, Sudan, and Syria. You warrant and represent that neither the U.S.A. Bureau of Export Administration nor any other federal agency has suspended, revoked or denied your export privileges. + +12. NOTE ON JAVA SUPPORT. + +Certain SOFTWARE COMPONENT PRODUCT(S) may contain support for programs written in Java. Java technology is not fault tolerant and is not designed, manufactured, or intended for use or resale as on-line control equipment in hazardous environments requiring fail-safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines, or weapons systems, in which the failure of Java technology could lead directly to death, personal injury, or severe physical or environmental damage. + +13. DISCLAIMER OF WARRANTY. + +DEVEXPRESS expressly disclaims any warranty for the SOFTWARE COMPONENT PRODUCT(S). THE SOFTWARE COMPONENT PRODUCT(S) AND ANY RELATED DOCUMENTATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. DEVEXPRESS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY REPRESENTATIONS REGARDING THE USE, OR THE RESULTS OF THE USE, OF THE SOFTWARE COMPONENT PRODUCT(S) IN TERMS OF CORRECTNESS, ACCURACY, RELIABILITY, OR OTHERWISE. THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE COMPONENT PRODUCT(S) REMAINS WITH YOU. No oral or written information or advice given by DEVEXPRESS or its employees shall create a warranty or in any way increase the scope of this warranty. + +14. LIMITATIONS ON LIABILITY. + +To the maximum extent permitted by applicable law, in no event shall DEVEXPRESS be liable for any special, incidental, indirect, or consequential damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use the SOFTWARE COMPONENT PRODUCT(S) or the provision of or failure to provide Support Services, even if DEVEXPRESS has been advised of the possibility of such damages. + +Developer End User understands that the SOFTWARE COMPONENT PRODUCT(S) may produce inaccurate results because of a failure or fault within the SOFTWARE COMPONENT PRODUCT(S) or failure by Developer End User to properly use and or deploy the SOFTWARE COMPONENT PRODUCT(S). Developer End User assumes full and sole responsibility for any use of the SOFTWARE COMPONENT PRODUCT(S), and bears the entire risk for failures or faults within the SOFTWARE COMPONENT PRODUCT(S). You agree that regardless of the cause of failure or fault or the form of any claim, YOUR SOLE REMEDY AND DEVEXPRESS'S SOLE OBLIGATION SHALL BE GOVERNED BY THIS AGREEMENT AND IN NO EVENT SHALL DEVEXPRESS'S LIABILITY EXCEED THE PRICE PAID TO DEVEXPRESS FOR THE SOFTWARE COMPONENT PRODUCT(S). This Limited Warranty is void if failure of the SOFTWARE COMPONENT PRODUCT(S) has resulted from accident, abuse, alteration, unauthorized use or misapplication of the SOFTWARE COMPONENT PRODUCT(S). + +15. INDEMNIFICATION. + +You hereby agree to indemnify DEVEXPRESS and its officers, directors, employees, agents, and representatives from each and every demand, claim, loss, liability, or damage of any kind, including actual attorneys fees, whether in tort or contract, that it or any of them may incur by reason of, or arising out of, any claim which is made by any third party with respect to any breach or violation of this Agreement by you or any claims based on the Applications and the SOFTWARE COMPONENT PRODUCT(S) included herein. + +16. SUPPORT SERVICES. + +DEVEXPRESS may provide you with support services related to the SOFTWARE COMPONENT PRODUCT(S) ("Support Services"). Use of Support Services is governed by DEVEXPRESS policies and programs described in the user manual, in "on line" documentation and/or other DEVEXPRESS provided materials. Any supplemental SOFTWARE COMPONENT PRODUCT(S) provided to you as part of the Support Services shall be considered part of the SOFTWARE COMPONENT PRODUCT(S) and subject to the terms and conditions of this EULA. With respect to technical information you provide to DEVEXPRESS as part of the Support Services, DEVEXPRESS may use such information for its business purposes, including for SOFTWARE COMPONENT PRODUCT(s) support and development. DEVEXPRESS will not utilize such technical information in a form that personally identifies you. + +17. TERMINATION. + +Without prejudice to any other rights or remedies, DEVEXPRESS will terminate this EULA upon your failure to comply with all the terms and conditions of this EULA. In such events, you must destroy all copies of the SOFTWARE COMPONENT PRODUCT(S) and all of its component parts including any related documentation, and must remove ANY and ALL use of such technology immediately from any applications using technology contained in the SOFTWARE COMPONENT PRODUCT(S) developed by you, whether in native, altered or compiled state. + +18. TAX. + +DEVEXPRESS delivers its software electronically and does not collect sales or use tax for residents of US states in which it operates. You should confirm that your local, state, or federal government does not impose any sales or use tax on electronically delivered software. You are entirely liable for any such sales or use tax. + +19. MISCELLANEOUS. + +This EULA shall be construed, interpreted and governed by the laws of the State of Nevada, U.S.A. This EULA gives you specific legal rights; you may have others that vary from state to state and from country to country. + +This EULA may only be modified in writing signed by you and an authorized officer of DEVELOPER EXPRESS INC. If any provision of this EULA is found void or unenforceable, the remainder will remain valid and enforceable according to its terms. If any remedy provided is determined to have failed for its essential purpose, all limitations of liability and exclusions of damages set forth in the Limited Warranty shall remain in effect. + +DEVEXPRESS reserves all rights not specifically granted in this EULA. + +ACKNOWLEDGEMENTS. Developer End User acknowledges that he or she has read this Agreement, understands it, and agrees to be bound by its terms and conditions. + +Should you have any questions concerning this EULA, or if you desire to contact DEVEXPRESS for any reason, please contact us directly at us in the United States of America at 702-262-0609, or write: Developer Express Inc. Legal department / 6330 McLeod Dr Suite 1, Las Vegas NV 89120. + diff --git a/official/x.35/ExpressVerticalGrid/EULA.txt b/official/x.35/ExpressVerticalGrid/EULA.txt new file mode 100644 index 00000000..d7f1cd58 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/EULA.txt @@ -0,0 +1,119 @@ +DEVELOPER EXPRESS INC +ExpressVerticalGrid(tm) COMPONENT SUITE +Copyright (C) 1999-2008 Developer Express Inc. + +END-USER LICENSE AGREEMENT +FOR ALL SOFTWARE COMPONENT PRODUCT(S) + +IMPORTANT- READ CAREFULLY: This DEVELOPER EXPRESS INC ("DEVEXPRESS") End-User License Agreement ("EULA") is a legal agreement between you, a developer of software applications, ("Developer End User") and DEVEXPRESS for all DEVEXPRESS products, controls, source code, demos, intermediate files, media, printed materials, and "online" or electronic documentation ("SOFTWARE COMPONENT PRODUCT(S)") contained in this installation file. + +DEVEXPRESS grants to you as an individual, a personal, nonexclusive license to install and use the SOFTWARE COMPONENT PRODUCT(S) for the sole purposes of designing, developing, testing, and deploying application programs which you create. By installing, copying, or otherwise using the SOFTWARE COMPONENT PRODUCT(S), you agree to be bound by the terms of this EULA. If you do not agree to any part of the terms of this EULA, DO NOT INSTALL, USE, EVALUATE, OR REPLICATE IN ANY MANNER, ANY PART, FILE OR PORTION OF THE SOFTWARE COMPONENT PRODUCT(S). + +All SOFTWARE COMPONENT PRODUCT(S) is licensed, not sold. If you are an individual, you must acquire an individual license for the SOFTWARE COMPONENT PRODUCT(S) from DEVEXPRESS or its authorized resellers. If you are an entity, you must acquire and assign an individual license for each Developer End User within your organization using and or developing with the SOFTWARE COMPONENT PRODUCT(S) from DEVEXPRESS or its authorized resellers. + +If the SOFTWARE COMPONENT PRODUCT(S) you have obtained is marked as a "TRIAL" or "EVALUATION," you may install one copy of the SOFTWARE COMPONENT PRODUCT(S) for testing purposes for a period of 30 calendar days from the date of installation ("Evaluation Period"). Upon expiration of the Evaluation Period, the SOFTWARE COMPONENT PRODUCT(S) must be uninstalled and all copies destroyed. + +RIGOROUS ENFORCEMENT OF INTELLECTUAL PROPERTY RIGHTS. If the licensed right of use for this SOFTWARE COMPONENT PRODUCT(S) is purchased by you with any intent to reverse engineer, decompile, create derivative works, and the exploitation or unauthorized transfer of, any DEVEXPRESS intellectual property and trade secrets, to include any exposed methods or source code where provided, no licensed right of use shall exist, and any PRODUCT(s) created as a result shall be judged illegal by definition of all applicable law. Any sale or resale of intellectual property or created derivatives so obtained will be prosecuted to the fullest extent of all local, federal and international law. + +1. GRANT OF LICENSE. + +This EULA, if legally executed as defined herein, licenses and so grants the single individual Developer End User the following rights: + +SOFTWARE COMPONENT PRODUCT(S) - Developer End User may install and use the SOFTWARE COMPONENT PRODUCT(S) on a single computer. Developer End User may also install and use the SOFTWARE COMPONENT PRODUCT(S) on a portable computer. + +2. LIMITATIONS ON REVERSE ENGINEERING, DECOMPILATION, AND DISASSEMBLY. + +You may not reverse engineer, decompile, create derivative works, translate, or disassemble the SOFTWARE COMPONENT PRODUCT(S), and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation. You agree to take all reasonable, legal and appropriate measures to prohibit the illegal dissemination of the SOFTWARE COMPONENT PRODUCT(S) or any of its constituent parts and redistributables to the fullest extent of all applicable local, US Codes and International Laws and Treaties regarding anti-circumvention, including but not limited to, the Geneva and Berne World Intellectual Property Organization (WIPO) Diplomatic Conferences. + +3. SEPARATION OF COMPONENTS. + +The SOFTWARE COMPONENT PRODUCT(S) is licensed as a single PRODUCT(s). The SOFTWARE COMPONENT PRODUCT(S) and its constituent parts and any provided redistributables may not be reverse engineered, decompiled, disassembled or separated for use on more than one computer, nor placed for distribution, sale, or resale as individual creations by Developer End User. The provision of source code, if included with the SOFTWARE COMPONENT PRODUCT(S), does not constitute transfer of any legal rights to such code, and resale or distribution of all or any portion of all source code and intellectual property will be prosecuted to the fullest extent of all applicable local, federal and international laws. All DEVEXPRESS libraries, source code, redistributables and other files remain DEVEXPRESS's exclusive property. You may not distribute any files, except those that DEVEXPRESS has expressly designated as Redistributable. + +4. RENTAL. + +You may not rent, lease, or lend the SOFTWARE COMPONENT PRODUCT(S). + +5. TRANSFER. + +You may NOT permanently or temporarily transfer ANY of your rights under this EULA to any individual or entity without prior written approval from DEVEXPRESS. Regardless of any modifications which you make and regardless of how you might compile, link, and/or package your programs, under no circumstances may the libraries, Redistributables, and/or other files of the SOFTWARE COMPONENT PRODUCT(S) (including any portions thereof) be used for developing programs by anyone other than you. Only you as the licensed Developer End User have the right to use the libraries, redistributables, or other files of the SOFTWARE COMPONENT PRODUCT(S) (or any portions thereof) for developing programs created with the SOFTWARE COMPONENT PRODUCT(S). In particular, you may not share copies of the Redistributables with other co-developers. You may not reproduce or distribute any DEVEXPRESS documentation without DEVEXPRESS's explicit permission. + +If you are an entity (Company), you must acquire and assign a license to each Developer End User within your organization using and or developing with the SOFTWARE COMPONENT PRODUCT(S). With written notification to DEVEXPRESS, Company may transfer the license obtained for a Developer End User to another Developer End User employed or otherwise engaged by Company if the initial Developer End User is no longer employed or engaged by Company or is reassigned to another function within Company and no longer develops software applications using the SOFTWARE COMPONENT PRODUCT(S). In addition, with written notification to DEVEXPRESS, Company may transfer its license of the SOFTWARE COMPONENT PRODUCT(S) to a successor Company. + +6. ROYALTY FREE REDISTRIBUTION. + +DEVEXPRESS PRODUCT(s) may include certain files ("Redistributable(s)") intended for distribution by you to the users of software applications which you create. Redistributables include, for example, those files identified in printed or on-line documentation as redistributable files, or those files preselected for deployment by an install utility provided with the SOFTWARE COMPONENT PRODUCT(S) (if any). In all circumstances, the Redistributables for the SOFTWARE COMPONENT PRODUCT(S) are only those files specifically designated as such by DEVEXPRESS. + +Subject to all of the terms and conditions in this EULA, you may reproduce and distribute copies of the Redistributables, provided that such copies are made from the original copy of the Redistributables included with the SOFTWARE COMPONENT PRODUCT(S) or modified versions of the Redistributables which are provided to you by DEVEXPRESS or those which you create. Copies of Redistributables may only be distributed with and for the sole purpose of executing application programs permitted under this EULA that you have created using the SOFTWARE COMPONENT PRODUCT(S). + +REDISTRIBUTABLES. To obtain a list of redistributables that apply under this EULA, contact support@devexpress.com + +AT NO TIME MAY DEVELOPER END USER CREATE ANY TOOL, REDISTRIBUTABLE, OR SOFTWARE COMPONENT PRODUCT(S) THAT DIRECTLY OR INDIRECTLY COMPETES WITH DEVEXPRESS SOFTWARE COMPONENT PRODUCT(S) WHICH UTILIZES ALL OR ANY PORTION OF THE SOFTWARE COMPONENT PRODUCT(S) contained within this installation. + +Distribution by the Developer End User of any design-time tools (EXE's OCX's or DLL's), executables, and source code distributed to Developer End User by DEVEXPRESS as part of this SOFTWARE COMPONENT PRODUCT(S) and not explicitly identified as a redistributable file is strictly prohibited. The Developer End User shall not develop software applications that provide an application programming interface to the SOFTWARE COMPONENT PRODUCT(S) or the SOFTWARE COMPONENT PRODUCT(S) as modified. + +The Developer End User may NOT distribute the SOFTWARE COMPONENT PRODUCT(S), in any format, to other users for development or application compilation purposes. Specifically, if Developer End User creates a control using the SOFTWARE COMPONENT PRODUCT(S) as a constituent control, Developer End User may NOT distribute the control created with the SOFTWARE COMPONENT PRODUCT(S) (in any format) to users to be used used at design time and or for ANY development purposes. + +Developer End User MAY NOT REDISTRIBUTE any SOFTWARE COMPONENT PRODUCT(s) files if using an evaluation, trial, Not for Resale, or demo version of the SOFTWARE COMPONENT PRODUCT(s). + +7. UPGRADES. + +If the SOFTWARE COMPONENT PRODUCT(S) is labeled as an upgrade, you must be properly licensed to use the SOFTWARE COMPONENT PRODUCT(S) identified by DEVEXPRESS as being eligible for the upgrade in order to use the SOFTWARE COMPONENT PRODUCT(S). A SOFTWARE COMPONENT PRODUCT(S) labeled as an upgrade replaces and/or supplements the SOFTWARE COMPONENT PRODUCT(S) that formed the basis for your eligibility for the upgrade, and together constitutes a single PRODUCT(S). You may use the resulting upgraded PRODUCT(S) only in accordance with all the terms of this EULA. + +8. COPYRIGHT. + +All title and copyrights in and to the SOFTWARE COMPONENT PRODUCT(S) (including but not limited to any copywritten images, demos, source code, intermediate files, packages, photographs, redistributables, animations, video, audio, music, text, and "applets" incorporated into the SOFTWARE COMPONENT PRODUCT(S) the accompanying printed materials, and any copies of the SOFTWARE COMPONENT PRODUCT(S)) are owned by DEVEXPRESS or its subsidiaries. The SOFTWARE COMPONENT PRODUCT(S) is protected by copyright laws and international treaty provisions and therefore, you must treat the SOFTWARE COMPONENT PRODUCT(S) like any other copyrighted material except that you may install the SOFTWARE COMPONENT PRODUCT(S) as described in this EULA. + +9. DUAL-MEDIA SOFTWARE COMPONENT PRODUCT(S). + +You may receive the SOFTWARE COMPONENT PRODUCT(S) in more than one medium. Regardless of the medium, you may use only one medium that is appropriate for your single computer. You may not loan, sell, rent, lease, or otherwise transfer in any manner the other medium to another user or entity. + +10. U.S. GOVERNMENT RESTRICTED RIGHTS. + +The Licensed Software is Commercial Computer Software provided with RESTRICTED RIGHTS under Federal Acquisition Regulations and agency supplements to them. Use, duplication or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFAR 255.227-7013 et. seq. or 252.211-7015, or subparagraphs (a) through (d) of the Commercial Computer Software Restricted Rights at FAR 52.227-19, as applicable, or similar clauses in the NASA FAR Supplement. Contractor-manufacturer is Developer Express Inc. / 6375 S. Pecos Rd Suite 118, Las Vegas NV 89120. + +11. EXPORT RESTRICTIONS. + +DEVEXPRESS expressly complies with all export restrictions imposed by the government of the United States of America. You, as Developer End User, must agree not to export or re-export the SOFTWARE COMPONENT PRODUCT(S) within any created application to any country, person, entity or end user subject to U.S.A. export restrictions. Restricted countries currently include, but are not necessarily limited to Cuba, Iran, Iraq, Libya, North Korea, Sudan, and Syria. You warrant and represent that neither the U.S.A. Bureau of Export Administration nor any other federal agency has suspended, revoked or denied your export privileges. + +12. NOTE ON JAVA SUPPORT. + +Certain SOFTWARE COMPONENT PRODUCT(S) may contain support for programs written in Java. Java technology is not fault tolerant and is not designed, manufactured, or intended for use or resale as on-line control equipment in hazardous environments requiring fail-safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines, or weapons systems, in which the failure of Java technology could lead directly to death, personal injury, or severe physical or environmental damage. + +13. DISCLAIMER OF WARRANTY. + +DEVEXPRESS expressly disclaims any warranty for the SOFTWARE COMPONENT PRODUCT(S). THE SOFTWARE COMPONENT PRODUCT(S) AND ANY RELATED DOCUMENTATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. DEVEXPRESS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY REPRESENTATIONS REGARDING THE USE, OR THE RESULTS OF THE USE, OF THE SOFTWARE COMPONENT PRODUCT(S) IN TERMS OF CORRECTNESS, ACCURACY, RELIABILITY, OR OTHERWISE. THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE COMPONENT PRODUCT(S) REMAINS WITH YOU. No oral or written information or advice given by DEVEXPRESS or its employees shall create a warranty or in any way increase the scope of this warranty. + +14. LIMITATIONS ON LIABILITY. + +To the maximum extent permitted by applicable law, in no event shall DEVEXPRESS be liable for any special, incidental, indirect, or consequential damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use the SOFTWARE COMPONENT PRODUCT(S) or the provision of or failure to provide Support Services, even if DEVEXPRESS has been advised of the possibility of such damages. + +Developer End User understands that the SOFTWARE COMPONENT PRODUCT(S) may produce inaccurate results because of a failure or fault within the SOFTWARE COMPONENT PRODUCT(S) or failure by Developer End User to properly use and or deploy the SOFTWARE COMPONENT PRODUCT(S). Developer End User assumes full and sole responsibility for any use of the SOFTWARE COMPONENT PRODUCT(S), and bears the entire risk for failures or faults within the SOFTWARE COMPONENT PRODUCT(S). You agree that regardless of the cause of failure or fault or the form of any claim, YOUR SOLE REMEDY AND DEVEXPRESS'S SOLE OBLIGATION SHALL BE GOVERNED BY THIS AGREEMENT AND IN NO EVENT SHALL DEVEXPRESS'S LIABILITY EXCEED THE PRICE PAID TO DEVEXPRESS FOR THE SOFTWARE COMPONENT PRODUCT(S). This Limited Warranty is void if failure of the SOFTWARE COMPONENT PRODUCT(S) has resulted from accident, abuse, alteration, unauthorized use or misapplication of the SOFTWARE COMPONENT PRODUCT(S). + +15. INDEMNIFICATION. + +You hereby agree to indemnify DEVEXPRESS and its officers, directors, employees, agents, and representatives from each and every demand, claim, loss, liability, or damage of any kind, including actual attorneys fees, whether in tort or contract, that it or any of them may incur by reason of, or arising out of, any claim which is made by any third party with respect to any breach or violation of this Agreement by you or any claims based on the Applications and the SOFTWARE COMPONENT PRODUCT(S) included herein. + +16. SUPPORT SERVICES. + +DEVEXPRESS may provide you with support services related to the SOFTWARE COMPONENT PRODUCT(S) ("Support Services"). Use of Support Services is governed by DEVEXPRESS policies and programs described in the user manual, in "on line" documentation and/or other DEVEXPRESS provided materials. Any supplemental SOFTWARE COMPONENT PRODUCT(S) provided to you as part of the Support Services shall be considered part of the SOFTWARE COMPONENT PRODUCT(S) and subject to the terms and conditions of this EULA. With respect to technical information you provide to DEVEXPRESS as part of the Support Services, DEVEXPRESS may use such information for its business purposes, including for SOFTWARE COMPONENT PRODUCT(s) support and development. DEVEXPRESS will not utilize such technical information in a form that personally identifies you. + +17. TERMINATION. + +Without prejudice to any other rights or remedies, DEVEXPRESS will terminate this EULA upon your failure to comply with all the terms and conditions of this EULA. In such events, you must destroy all copies of the SOFTWARE COMPONENT PRODUCT(S) and all of its component parts including any related documentation, and must remove ANY and ALL use of such technology immediately from any applications using technology contained in the SOFTWARE COMPONENT PRODUCT(S) developed by you, whether in native, altered or compiled state. + +18. TAX. + +DEVEXPRESS delivers its software electronically and does not collect sales or use tax for residents of US states in which it operates. You should confirm that your local, state, or federal government does not impose any sales or use tax on electronically delivered software. You are entirely liable for any such sales or use tax. + +19. MISCELLANEOUS. + +This EULA shall be construed, interpreted and governed by the laws of the State of Nevada, U.S.A. This EULA gives you specific legal rights; you may have others that vary from state to state and from country to country. + +This EULA may only be modified in writing signed by you and an authorized officer of DEVELOPER EXPRESS INC. If any provision of this EULA is found void or unenforceable, the remainder will remain valid and enforceable according to its terms. If any remedy provided is determined to have failed for its essential purpose, all limitations of liability and exclusions of damages set forth in the Limited Warranty shall remain in effect. + +DEVEXPRESS reserves all rights not specifically granted in this EULA. + +ACKNOWLEDGEMENTS. Developer End User acknowledges that he or she has read this Agreement, understands it, and agrees to be bound by its terms and conditions. + +Should you have any questions concerning this EULA, or if you desire to contact DEVEXPRESS for any reason, please contact us directly at us in the United States of America at 702-262-0609, or write: Developer Express Inc. Legal department / 6330 McLeod Dr Suite 1, Las Vegas NV 89120. + diff --git a/official/x.35/ExpressVerticalGrid/Help/cxVertGrid.cnt b/official/x.35/ExpressVerticalGrid/Help/cxVertGrid.cnt new file mode 100644 index 00000000..e5dc7ecd --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Help/cxVertGrid.cnt @@ -0,0 +1,129 @@ +:Base cxVertGrid.hlp +:Title ExpressVerticalGrid Suite +:Index ExpressVerticalGrid Suite=cxVertGrid.hlp +1 ExpressVerticalGrid +2 Units +3 cxDBVGrid Unit Overview=IDH_Unit_cxDBVGrid +3 cxExportVGLink Unit Overview=IDH_Unit_cxExportVGLink +3 cxOI Unit Overview=IDH_Unit_cxOI +3 cxVGrid Unit Overview=IDH_Unit_cxVGrid +2 Concepts +3 Customization Form Overview=IDH_CD_Customization_Form_Overview +3 Implementing Drag-And-Drop Operations=IDH_CD_Implementing_Drag_And_Drop_Operations +3 Converting To The ExpressVerticalGrid=IDH_CD_Converting_To_The_ExpressVerticalGrid +3 Data Export=Data_Export +3 ExpressVerticalGrid +4 Paint Styles=IDH_CD_Paint_Styles +4 Layouts +5 Layouts Overview=IDH_CD_Layouts_Overview +5 Bands View Layout=IDH_CD_Bands_View_Layout +5 Single Record View Layout=IDH_CD_Single_Record_View_Layout +5 Multiple Records View Layout=IDH_CD_Multiple_Records_View_Layout +3 RTTIInspector +4 Implementing Custom Property Editor=IDH_CD_Implementing_Custom_Property_Editor +3 Binding To Data +4 Data Modes Overview=IDH_CD_Data_Modes_Overview +4 Bound Mode=IDH_CD_Bound_Mode +4 Provider Mode=IDH_CD_Provider_Mode +3 Rows +4 Rows Overview=IDH_CD_Rows_Overview +4 Row Class Structure=IDH_CD_Row_Class_Structure +4 Row Properties=IDH_CD_Row_Properties +4 Category Rows=IDH_CD_Category_Rows +4 Editor Rows=IDH_CD_Editor_Rows +4 Multi Editor Rows=IDH_CD_Multi_Editor_Rows +4 Row Operations +5 Creating A Tree-like Structure Of Rows=IDH_CD_Creating_A_Tree_like_Structure_Of_Rows +5 Accessing Rows=IDH_CD_Accessing_Rows +5 Scrolling And Focusing Rows=IDH_CD_Scrolling_And_Focusing_Rows +5 Expanding And Collapsing Rows=IDH_CD_Expanding_And_Collapsing_Rows +3 Inplace Editors +4 The Repository Concept=IDH_CD_The_Repository_Concept +4 Assigning Editors to Editor Rows=IDH_CD_Assigning_Editors_to_Editor_Rows +4 Assigning Editors To MultiEditor Rows=IDH_CD_Assigning_Editors_To_MultiEditor_Rows +4 Obtaining And Setting Cell Values=IDH_CD_Obtaining_And_Setting_Cell_Values +3 Styles +4 Styles Overview=IDH_CD_Styles_Overview +4 Using StyleSheets=IDH_CD_Using_StyleSheets +4 Assigning Styles To Individual Rows=IDH_CD_Assigning_Styles_To_Individual_Rows +4 Using Styles Events=IDH_CD_Using_Styles_Events +3 Custom Painting +4 Custom Painting Overview=IDH_CD_Custom_Painting_Overview +4 Painting Of The Row Headers=IDH_CD_Painting_Of_The_Row_Headers +4 Painting Of The Row Values=IDH_CD_Painting_Of_The_Row_Values +4 Painting Of The Vertical Grid Background=IDH_CD_Painting_Of_The_Vertical_Grid_Background +2 VerticalGrid Controls +3 TcxCustomVerticalGrid=IDH_Class_TcxCustomVerticalGrid +3 TcxDBVerticalGrid=IDH_Class_TcxDBVerticalGrid +3 TcxDBVerticalGridDataController=IDH_Class_TcxDBVerticalGridDataController +3 TcxUnboundVerticalGrid=IDH_Class_TcxUnboundVerticalGrid +3 TcxVerticalGrid=IDH_Class_TcxVerticalGrid +3 TcxVirtualVerticalGrid=IDH_Class_TcxVirtualVerticalGrid +2 Rows +3 TcxCategoryRow=IDH_Class_TcxCategoryRow +3 TcxEditorRow=IDH_Class_TcxEditorRow +3 TcxEditorPropertiesCollection=IDH_Class_TcxEditorPropertiesCollection +3 TcxMultiEditorRow=IDH_Class_TcxMultiEditorRow +3 Custom Row Classes +4 TcxCustomEditorRow=IDH_Class_TcxCustomEditorRow +4 TcxCustomMultiEditorRow=IDH_Class_TcxCustomMultiEditorRow +4 TcxCustomRow=IDH_Class_TcxCustomRow +3 Row Options +4 TcxRowOptions=IDH_Class_TcxRowOptions +3 Row Properties +4 TcxCaptionRowProperties=IDH_Class_TcxCaptionRowProperties +4 TcxEditorRowProperties=IDH_Class_TcxEditorRowProperties +4 TcxEditorRowPropertiesOptions=IDH_Class_TcxEditorRowPropertiesOptions +4 TcxMultiEditorRowProperties=IDH_Class_TcxMultiEditorRowProperties +4 Custom Row Properties Classes +5 TcxCustomEditorRowProperties=IDH_Class_TcxCustomEditorRowProperties +5 TcxCustomRowProperties=IDH_Class_TcxCustomRowProperties +4 Data-Aware Row Properties Classes +5 TcxDBEditorRowProperties=IDH_Class_TcxDBEditorRowProperties +5 TcxDBMultiEditorRowProperties=IDH_Class_TcxDBMultiEditorRowProperties +4 MultiEditorRow Item Properties +5 TcxCollectionItemEditorRowProperties=IDH_Class_TcxCollectionItemEditorRowProperties +5 TcxDBEditorRowItemProperties=IDH_Class_TcxDBEditorRowItemProperties +5 TcxEditorRowItemProperties=IDH_Class_TcxEditorRowItemProperties +3 Data-Aware Rows +4 TcxDBEditorRow=IDH_Class_TcxDBEditorRow +4 TcxDBMultiEditorRow=IDH_Class_TcxDBMultiEditorRow +4 TcxDBEditorPropertiesCollection=IDH_Class_TcxDBEditorPropertiesCollection +4 TcxDBVerticalGridItemDataBinding=IDH_Class_TcxDBVerticalGridItemDataBinding +3 Row Info +4 TcxCustomRowHeaderInfo=IDH_Class_TcxCustomRowHeaderInfo +4 TcxRowCaptionInfo=IDH_Class_TcxRowCaptionInfo +4 TcxRowValueInfo=IDH_Class_TcxRowValueInfo +2 RTTIInspector +3 EcxPropertyError=IDH_Class_EcxPropertyError +3 TcxCustomRTTIInspector=IDH_Class_TcxCustomRTTIInspector +3 TcxPropertyAttribute=IDH_Type_TcxPropertyAttribute +3 TcxPropertyAttributes=IDH_Type_TcxPropertyAttributes +3 TcxPropertyEditor=IDH_Class_TcxPropertyEditor +3 TcxRTTIInspector=IDH_Class_TcxRTTIInspector +2 Options +3 TcxvgMultiRecordsOptionsBehavior=IDH_Class_TcxvgMultiRecordsOptionsBehavior +3 TcxvgMultiRecordsOptionsData=IDH_Class_TcxvgMultiRecordsOptionsData +3 TcxvgMultiRecordsOptionsView=IDH_Class_TcxvgMultiRecordsOptionsView +3 TcxvgOptionsBehavior=IDH_Class_TcxvgOptionsBehavior +3 TcxvgOptionsView=IDH_Class_TcxvgOptionsView +2 Customization Form +3 TcxVerticalGridCustomizing=IDH_Class_TcxVerticalGridCustomizing +2 Styles +3 TcxCategoryRowStyles=IDH_Class_TcxCategoryRowStyles +3 TcxEditorRowStyles=IDH_Class_TcxEditorRowStyles +3 TcxVerticalGridStyles=IDH_Class_TcxVerticalGridStyles +2 Miscellaneous Classes And Types +3 TcxvgHitTest=IDH_Class_TcxvgHitTest +3 TcxvgGridLines=IDH_Type_TcxvgGridLines +3 TcxvgLayoutStyle=IDH_Type_TcxvgLayoutStyle +3 TcxvgPaintStyle=IDH_Type_TcxvgPaintStyle +3 TcxvgUnboundLayoutStyle=IDH_Type_TcxvgUnboundLayoutStyle +3 TSeparatorKind=IDH_Type_TSeparatorKind +2 Routines +3 cxRegisterEditPropertiesClass=IDH_cxOI_cxRegisterEditPropertiesClass +3 cxRegisterPropertyEditor=IDH_cxOI_cxRegisterPropertyEditor +3 cxExportVGToExcel=IDH_cxExportVGLink_cxExportVGToExcel +3 cxExportVGToHTML=IDH_cxExportVGLink_cxExportVGToHTML +3 cxExportVGToText=IDH_cxExportVGLink_cxExportVGToText +3 cxExportVGToXML=IDH_cxExportVGLink_cxExportVGToXML diff --git a/official/x.35/ExpressVerticalGrid/Help/cxVertGrid.hlp b/official/x.35/ExpressVerticalGrid/Help/cxVertGrid.hlp new file mode 100644 index 00000000..d39f6c25 Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Help/cxVertGrid.hlp differ diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC10.bpk b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC10.bpk new file mode 100644 index 00000000..60595f0a --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC10.bpk @@ -0,0 +1,184 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = cxVerticalGridC10.bpl +OBJFILES = cxDBVGrid.obj cxExportVGLink.obj cxOI.obj cxOICollectionEd.obj \ + cxOIPictureEd.obj cxOIStringsEd.obj cxVGrid.obj cxVGridConsts.obj \ + cxVGridNewCategory.obj cxVGridUtils.obj cxVGridViewInfo.obj \ + cxVerticalGridC10.obj cxVGridStyleSheetPreview.obj +MAINSOURCE = cxVerticalGridC10.cpp +RESFILES = cxVerticalGridC10.res +RESDEPEN = $(RESFILES) cxOICollectionEd.dfm cxOIPictureEd.dfm cxOIStringsEd.dfm \ + cxVGridNewCategory.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = +PACKAGES = rtl.bpi vcl.bpi vclx.bpi dbrtl.bpi cxDataC10.bpi cxLibraryC10.bpi \ + cxEditorsC10.bpi cxExtEditorsC10.bpi cxExportC10.bpi dxThemeC10.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressVerticalGrid by Developer Express Inc." -aa -Tpp -Gpr \ + -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC10.cpp b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC10.cpp new file mode 100644 index 00000000..4bdc2c1b --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC10.cpp @@ -0,0 +1,36 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("cxVerticalGridC10.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEPACKAGE("cxExtEditorsC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("cxExportC10.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEPACKAGE("dxThemeC10.bpi"); +USEUNIT("cxDBVGrid.pas"); +USEUNIT("cxExportVGLink.pas"); +USEUNIT("cxOI.pas"); +USEFORMNS("cxOICollectionEd.pas", Cxoicollectioned, cxCollectionEditor); +USEFORMNS("cxOIPictureEd.pas", Cxoipictureed, cxfmPictureEditor); +USEFORMNS("cxOIStringsEd.pas", Cxoistringsed, cxfmStringsEditor); +USEUNIT("cxVGrid.pas"); +USEUNIT("cxVGridConsts.pas"); +USEFORMNS("cxVGridNewCategory.pas", Cxvgridnewcategory, fmCreateCategory); +USEUNIT("cxVGridUtils.pas"); +USEUNIT("cxVGridViewInfo.pas"); +USEUNIT("cxVGridStyleSheetPreview.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC10.res b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC10.res new file mode 100644 index 00000000..597db0cc Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC10.res differ diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC11.bpk b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC11.bpk new file mode 100644 index 00000000..c5a67264 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC11.bpk @@ -0,0 +1,184 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = cxVerticalGridC11.bpl +OBJFILES = cxDBVGrid.obj cxExportVGLink.obj cxOI.obj cxOICollectionEd.obj \ + cxOIPictureEd.obj cxOIStringsEd.obj cxVGrid.obj cxVGridConsts.obj \ + cxVGridNewCategory.obj cxVGridUtils.obj cxVGridViewInfo.obj \ + cxVerticalGridC11.obj cxVGridStyleSheetPreview.obj +MAINSOURCE = cxVerticalGridC11.cpp +RESFILES = cxVerticalGridC11.res +RESDEPEN = $(RESFILES) cxOICollectionEd.dfm cxOIPictureEd.dfm cxOIStringsEd.dfm \ + cxVGridNewCategory.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = +PACKAGES = rtl.bpi vcl.bpi vclx.bpi dbrtl.bpi cxDataC11.bpi cxLibraryC11.bpi \ + cxEditorsC11.bpi cxExtEditorsC11.bpi cxExportC11.bpi dxThemeC11.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressVerticalGrid by Developer Express Inc." -aa -Tpp -Gpr \ + -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC11.cpp b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC11.cpp new file mode 100644 index 00000000..01958563 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC11.cpp @@ -0,0 +1,36 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("cxVerticalGridC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("cxExtEditorsC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("cxExportC11.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("dxThemeC11.bpi"); +USEUNIT("cxDBVGrid.pas"); +USEUNIT("cxExportVGLink.pas"); +USEUNIT("cxOI.pas"); +USEFORMNS("cxOICollectionEd.pas", Cxoicollectioned, cxCollectionEditor); +USEFORMNS("cxOIPictureEd.pas", Cxoipictureed, cxfmPictureEditor); +USEFORMNS("cxOIStringsEd.pas", Cxoistringsed, cxfmStringsEditor); +USEUNIT("cxVGrid.pas"); +USEUNIT("cxVGridConsts.pas"); +USEFORMNS("cxVGridNewCategory.pas", Cxvgridnewcategory, fmCreateCategory); +USEUNIT("cxVGridUtils.pas"); +USEUNIT("cxVGridViewInfo.pas"); +USEUNIT("cxVGridStyleSheetPreview.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC11.res b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC11.res new file mode 100644 index 00000000..5f536cca Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC11.res differ diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC5.bpk b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC5.bpk new file mode 100644 index 00000000..61c05a0a --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC5.bpk @@ -0,0 +1,183 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = cxVerticalGridC5.bpl +OBJFILES = cxDBVGrid.obj cxExportVGLink.obj cxOI.obj cxOICollectionEd.obj \ + cxOIPictureEd.obj cxOIStringsEd.obj cxVGrid.obj cxVGridConsts.obj \ + cxVGridNewCategory.obj cxVGridUtils.obj cxVGridViewInfo.obj \ + cxVerticalGridC5.obj cxVGridStyleSheetPreview.obj +RESFILES = cxVerticalGridC5.res +RESDEPEN = $(RESFILES) cxOICollectionEd.dfm cxOIPictureEd.dfm cxOIStringsEd.dfm \ + cxVGridNewCategory.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = +PACKAGES = vcl50.bpi vclx50.bpi vcldb50.bpi cxDataC5.bpi cxLibraryVCLC5.bpi \ + cxEditorsC5.bpi cxExtEditorsC5.bpi cxExportC5.bpi dxThemeC5.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressVerticalGrid (VCL Edition) by Developer Express Inc." -aa -Tpp -Gpr \ + -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC5.cpp b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC5.cpp new file mode 100644 index 00000000..a7195ecd --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC5.cpp @@ -0,0 +1,35 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("cxVerticalGridC5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vclx50.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("cxExtEditorsC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("cxExportC5.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEPACKAGE("dxThemeC5.bpi"); +USEUNIT("cxDBVGrid.pas"); +USEUNIT("cxExportVGLink.pas"); +USEUNIT("cxOI.pas"); +USEFORMNS("cxOICollectionEd.pas", Cxoicollectioned, cxCollectionEditor); +USEFORMNS("cxOIPictureEd.pas", Cxoipictureed, cxfmPictureEditor); +USEFORMNS("cxOIStringsEd.pas", Cxoistringsed, cxfmStringsEditor); +USEUNIT("cxVGrid.pas"); +USEUNIT("cxVGridConsts.pas"); +USEFORMNS("cxVGridNewCategory.pas", Cxvgridnewcategory, fmCreateCategory); +USEUNIT("cxVGridUtils.pas"); +USEUNIT("cxVGridViewInfo.pas"); +USEUNIT("cxVGridStyleSheetPreview.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC5.res b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC5.res new file mode 100644 index 00000000..cc37150f Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridC5.res differ diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD10.dpk b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD10.dpk new file mode 100644 index 00000000..5ddd9722 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD10.dpk @@ -0,0 +1,49 @@ +package cxVerticalGridD10; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressVerticalGrid by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + vclx, + cxEditorsD10, + cxExtEditorsD10, + cxExportD10; + +contains + cxDBVGrid, + cxOI, + cxVGrid, + cxVGridConsts, + cxVGridUtils, + cxVGridViewInfo, + cxOIPictureEd, + cxOIStringsEd, + cxVGridNewCategory, + cxExportVGLink, + cxOICollectionEd; + +end. diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD10.res b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD10.res new file mode 100644 index 00000000..c99771ab Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD10.res differ diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD11.dpk b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD11.dpk new file mode 100644 index 00000000..2a7ba968 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD11.dpk @@ -0,0 +1,49 @@ +package cxVerticalGridD11; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressVerticalGrid by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + vclx, + cxEditorsD11, + cxExtEditorsD11, + cxExportD11; + +contains + cxDBVGrid, + cxOI, + cxVGrid, + cxVGridConsts, + cxVGridUtils, + cxVGridViewInfo, + cxOIPictureEd, + cxOIStringsEd, + cxVGridNewCategory, + cxExportVGLink, + cxOICollectionEd; + +end. diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD11.res b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD11.res new file mode 100644 index 00000000..4218042a Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD11.res differ diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD5.dpk b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD5.dpk new file mode 100644 index 00000000..9a07547e --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD5.dpk @@ -0,0 +1,48 @@ +package cxVerticalGridD5; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressVerticalGrid (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vclx50, + cxEditorsD5, + cxExtEditorsD5, + cxExportD5; + +contains + cxDBVGrid, + cxOI, + cxVGrid, + cxVGridConsts, + cxVGridUtils, + cxVGridViewInfo, + cxOIPictureEd, + cxOIStringsEd, + cxVGridNewCategory, + cxExportVGLink, + cxOICollectionEd; + +end. diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD5.res b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD5.res new file mode 100644 index 00000000..8a972ed3 Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD5.res differ diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD9.dpk b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD9.dpk new file mode 100644 index 00000000..3e63232b --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD9.dpk @@ -0,0 +1,49 @@ +package cxVerticalGridD9; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressVerticalGrid by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + vclx, + cxEditorsD9, + cxExtEditorsD9, + cxExportD9; + +contains + cxDBVGrid, + cxOI, + cxVGrid, + cxVGridConsts, + cxVGridUtils, + cxVGridViewInfo, + cxOIPictureEd, + cxOIStringsEd, + cxVGridNewCategory, + cxExportVGLink, + cxOICollectionEd; + +end. diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD9.res b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD9.res new file mode 100644 index 00000000..6476b890 Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridD9.res differ diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLC6.bpk b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLC6.bpk new file mode 100644 index 00000000..b9675251 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLC6.bpk @@ -0,0 +1,183 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = cxVerticalGridVCLC6.bpl +OBJFILES = cxDBVGrid.obj cxExportVGLink.obj cxOI.obj cxOICollectionEd.obj \ + cxOIPictureEd.obj cxOIStringsEd.obj cxVGrid.obj cxVGridConsts.obj \ + cxVGridNewCategory.obj cxVGridUtils.obj cxVGridViewInfo.obj \ + cxVerticalGridVCLC6.obj cxVGridStyleSheetPreview.obj +RESFILES = cxVerticalGridVCLC6.res +RESDEPEN = $(RESFILES) cxOICollectionEd.dfm cxOIPictureEd.dfm cxOIStringsEd.dfm \ + cxVGridNewCategory.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = +PACKAGES = rtl.bpi vcl.bpi vclx.bpi dbrtl.bpi cxDataC6.bpi cxLibraryVCLC6.bpi \ + cxEditorsVCLC6.bpi cxExtEditorsVCLC6.bpi cxExportVCLC6.bpi dxThemeC6.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressVerticalGrid (VCL Edition) by Developer Express Inc." -aa -Tpp -Gpr \ + -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLC6.cpp b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLC6.cpp new file mode 100644 index 00000000..2013804c --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLC6.cpp @@ -0,0 +1,36 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("cxVerticalGridC6.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("dbrtl.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("cxExtEditorsVCLC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("cxExportVCLC6.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEPACKAGE("dxThemeC6.bpi"); +USEUNIT("cxDBVGrid.pas"); +USEUNIT("cxExportVGLink.pas"); +USEUNIT("cxOI.pas"); +USEFORMNS("cxOICollectionEd.pas", Cxoicollectioned, cxCollectionEditor); +USEFORMNS("cxOIPictureEd.pas", Cxoipictureed, cxfmPictureEditor); +USEFORMNS("cxOIStringsEd.pas", Cxoistringsed, cxfmStringsEditor); +USEUNIT("cxVGrid.pas"); +USEUNIT("cxVGridConsts.pas"); +USEFORMNS("cxVGridNewCategory.pas", Cxvgridnewcategory, fmCreateCategory); +USEUNIT("cxVGridUtils.pas"); +USEUNIT("cxVGridViewInfo.pas"); +USEUNIT("cxVGridStyleSheetPreview.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLC6.res b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLC6.res new file mode 100644 index 00000000..5857c6a3 Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLC6.res differ diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLD6.dpk b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLD6.dpk new file mode 100644 index 00000000..5c155181 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLD6.dpk @@ -0,0 +1,49 @@ +package cxVerticalGridVCLD6; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressVerticalGrid (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + vclx, + cxEditorsVCLD6, + cxExtEditorsVCLD6, + cxExportVCLD6; + +contains + cxDBVGrid, + cxOI, + cxVGrid, + cxVGridConsts, + cxVGridUtils, + cxVGridViewInfo, + cxOIPictureEd, + cxOIStringsEd, + cxVGridNewCategory, + cxExportVGLink, + cxOICollectionEd; + +end. diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLD6.res b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLD6.res new file mode 100644 index 00000000..11f0819d Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLD6.res differ diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLD7.dpk b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLD7.dpk new file mode 100644 index 00000000..a5cbf830 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLD7.dpk @@ -0,0 +1,49 @@ +package cxVerticalGridVCLD7; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressVerticalGrid (VCL Edition) by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + vclx, + cxEditorsVCLD7, + cxExtEditorsVCLD7, + cxExportVCLD7; + +contains + cxDBVGrid, + cxOI, + cxVGrid, + cxVGridConsts, + cxVGridUtils, + cxVGridViewInfo, + cxOIPictureEd, + cxOIStringsEd, + cxVGridNewCategory, + cxExportVGLink, + cxOICollectionEd; + +end. diff --git a/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLD7.res b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLD7.res new file mode 100644 index 00000000..0f5238f2 Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Packages/cxVerticalGridVCLD7.res differ diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC10.bpk b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC10.bpk new file mode 100644 index 00000000..e65f90a4 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC10.bpk @@ -0,0 +1,183 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxVerticalGridC10.bpl +OBJFILES = cxVGridPredefinedStyles.obj cxVGridLayoutEditor.obj cxVGridEditor.obj \ + cxVGridReg.obj cxVGridConverter.obj cxVGridDXInspConverter.obj \ + dclcxVerticalGridC10.obj +MAINSOURCE = dclcxVerticalGridC10.cpp +RESFILES = dclcxVerticalGridC10.res cxVGridReg.dcr +RESDEPEN = $(RESFILES) cxVGridLayoutEditor.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = +PACKAGES = rtl.bpi vcl.bpi vclx.bpi dbrtl.bpi cxEditorsC10.bpi \ + cxExportC10.bpi cxVerticalGridC10.bpi cxLibraryC10.bpi dclcxLibraryC10.bpi \ + cxDataC10.bpi dclcxEditorsC10.bpi designide.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressVerticalGrid by Developer Express Inc." -aa -Tpp -Gpd \ + -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC10.cpp b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC10.cpp new file mode 100644 index 00000000..443f6aef --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC10.cpp @@ -0,0 +1,32 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dclcxVerticalGridC10.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("cxEditorsC10.bpi"); +USEPACKAGE("cxExportC10.bpi"); +USEPACKAGE("cxVerticalGridC10.bpi"); +USEPACKAGE("cxLibraryC10.bpi"); +USEPACKAGE("dclcxLibraryC10.bpi"); +USEPACKAGE("cxDataC10.bpi"); +USEPACKAGE("dclcxEditorsC10.bpi"); +USEPACKAGE("designide.bpi"); +USEUNIT("cxVGridPredefinedStyles.pas"); +USEFORMNS("cxVGridLayoutEditor.pas", Cxvgridlayouteditor, fmvgLayoutEditor); +USEUNIT("cxVGridEditor.pas"); +USEUNIT("cxVGridReg.pas"); +USERES("cxVGridReg.dcr"); +USEUNIT("cxVGridConverter.pas"); +USEUNIT("cxVGridDXInspConverter.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC10.res b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC10.res new file mode 100644 index 00000000..7f88138c Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC10.res differ diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC11.bpk b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC11.bpk new file mode 100644 index 00000000..a29f1131 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC11.bpk @@ -0,0 +1,183 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxVerticalGridC11.bpl +OBJFILES = cxVGridPredefinedStyles.obj cxVGridLayoutEditor.obj cxVGridEditor.obj \ + cxVGridReg.obj cxVGridConverter.obj cxVGridDXInspConverter.obj \ + dclcxVerticalGridC11.obj +MAINSOURCE = dclcxVerticalGridC11.cpp +RESFILES = dclcxVerticalGridC11.res cxVGridReg.dcr +RESDEPEN = $(RESFILES) cxVGridLayoutEditor.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = +PACKAGES = rtl.bpi vcl.bpi vclx.bpi dbrtl.bpi cxEditorsC11.bpi \ + cxExportC11.bpi cxVerticalGridC11.bpi cxLibraryC11.bpi dclcxLibraryC11.bpi \ + cxDataC11.bpi dclcxEditorsC11.bpi designide.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl100.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressVerticalGrid by Developer Express Inc." -aa -Tpp -Gpd \ + -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC11.cpp b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC11.cpp new file mode 100644 index 00000000..53c8ab4b --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC11.cpp @@ -0,0 +1,32 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dclcxVerticalGridC11.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("cxEditorsC11.bpi"); +USEPACKAGE("cxExportC11.bpi"); +USEPACKAGE("cxVerticalGridC11.bpi"); +USEPACKAGE("cxLibraryC11.bpi"); +USEPACKAGE("dclcxLibraryC11.bpi"); +USEPACKAGE("cxDataC11.bpi"); +USEPACKAGE("dclcxEditorsC11.bpi"); +USEPACKAGE("designide.bpi"); +USEUNIT("cxVGridPredefinedStyles.pas"); +USEFORMNS("cxVGridLayoutEditor.pas", Cxvgridlayouteditor, fmvgLayoutEditor); +USEUNIT("cxVGridEditor.pas"); +USEUNIT("cxVGridReg.pas"); +USERES("cxVGridReg.dcr"); +USEUNIT("cxVGridConverter.pas"); +USEUNIT("cxVGridDXInspConverter.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC11.res b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC11.res new file mode 100644 index 00000000..652f75d8 Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC11.res differ diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC5.bpk b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC5.bpk new file mode 100644 index 00000000..87a66a33 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC5.bpk @@ -0,0 +1,182 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dclcxVerticalGridC5.bpl +OBJFILES = cxVGridPredefinedStyles.obj cxVGridLayoutEditor.obj cxVGridEditor.obj \ + cxVGridReg.obj cxVGridConverter.obj cxVGridDXInspConverter.obj \ + dclcxVerticalGridC5.obj +RESFILES = dclcxVerticalGridC5.res cxVGridReg.dcr +RESDEPEN = $(RESFILES) cxVGridLayoutEditor.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = +PACKAGES = vcl50.bpi vclx50.bpi vcldb50.bpi cxEditorsC5.bpi \ + cxExportC5.bpi cxVerticalGridC5.bpi cxLibraryVCLC5.bpi dclcxLibraryVCLC5.bpi \ + cxDataC5.bpi dclcxEditorsC5.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl50.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd50 -LUdcldb50 +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressVerticalGrid (VCL Edition) by Developer Express Inc." -aa -Tpp -Gpd \ + -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC5.cpp b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC5.cpp new file mode 100644 index 00000000..70a771b0 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC5.cpp @@ -0,0 +1,30 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dclcxVerticalGridC5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vclx50.bpi"); +USEPACKAGE("cxEditorsC5.bpi"); +USEPACKAGE("cxExportC5.bpi"); +USEPACKAGE("cxVerticalGridC5.bpi"); +USEPACKAGE("cxLibraryVCLC5.bpi"); +USEPACKAGE("dclcxLibraryVCLC5.bpi"); +USEPACKAGE("cxDataC5.bpi"); +USEPACKAGE("dclcxEditorsC5.bpi"); +USEUNIT("cxVGridPredefinedStyles.pas"); +USEFORMNS("cxVGridLayoutEditor.pas", Cxvgridlayouteditor, fmvgLayoutEditor); +USEUNIT("cxVGridEditor.pas"); +USEUNIT("cxVGridReg.pas"); +USERES("cxVGridReg.dcr"); +USEUNIT("cxVGridConverter.pas"); +USEUNIT("cxVGridDXInspConverter.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC5.res b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC5.res new file mode 100644 index 00000000..c639bf4b Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridC5.res differ diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD10.dpk b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD10.dpk new file mode 100644 index 00000000..7c3b5ee6 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD10.dpk @@ -0,0 +1,46 @@ +package dclcxVerticalGridD10; + +{$R *.res} +{$R cxVGridReg.dcr} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressVerticalGrid by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dclcxLibraryD10, + dclcxEditorsD10, + cxVerticalGridD10; + + +contains + cxVGridEditor, + cxVGridLayoutEditor, + cxVGridReg, + cxVGridStyleSheetPreview, + cxVGridPredefinedStyles, + cxVGridConverter, + cxVGridDXInspConverter; + +end. diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD10.res b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD10.res new file mode 100644 index 00000000..024cd92d Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD10.res differ diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD11.dpk b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD11.dpk new file mode 100644 index 00000000..23d3a1f5 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD11.dpk @@ -0,0 +1,46 @@ +package dclcxVerticalGridD11; + +{$R *.res} +{$R cxVGridReg.dcr} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressVerticalGrid by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dclcxLibraryD11, + dclcxEditorsD11, + cxVerticalGridD11; + + +contains + cxVGridEditor, + cxVGridLayoutEditor, + cxVGridReg, + cxVGridStyleSheetPreview, + cxVGridPredefinedStyles, + cxVGridConverter, + cxVGridDXInspConverter; + +end. diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD11.res b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD11.res new file mode 100644 index 00000000..cd947e36 Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD11.res differ diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD5.dpk b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD5.dpk new file mode 100644 index 00000000..5f4c42c1 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD5.dpk @@ -0,0 +1,45 @@ +package dclcxVerticalGridD5; + +{$R *.res} +{$R cxVGridReg.dcr} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressVerticalGrid (VCL Edition) by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dclcxLibraryVCLD5, + dclcxEditorsD5, + cxVerticalGridD5; + + +contains + cxVGridEditor, + cxVGridLayoutEditor, + cxVGridReg, + cxVGridStyleSheetPreview, + cxVGridPredefinedStyles, + cxVGridConverter, + cxVGridDXInspConverter; + +end. diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD5.res b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD5.res new file mode 100644 index 00000000..e256718c Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD5.res differ diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD9.dpk b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD9.dpk new file mode 100644 index 00000000..011687d3 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD9.dpk @@ -0,0 +1,46 @@ +package dclcxVerticalGridD9; + +{$R *.res} +{$R cxVGridReg.dcr} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressVerticalGrid by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dclcxLibraryD9, + dclcxEditorsD9, + cxVerticalGridD9; + + +contains + cxVGridEditor, + cxVGridLayoutEditor, + cxVGridReg, + cxVGridStyleSheetPreview, + cxVGridPredefinedStyles, + cxVGridConverter, + cxVGridDXInspConverter; + +end. diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD9.res b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD9.res new file mode 100644 index 00000000..d3e0b68d Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridD9.res differ diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLC6.bpk b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLC6.bpk new file mode 100644 index 00000000..76123057 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLC6.bpk @@ -0,0 +1,182 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dclcxVerticalGridVCLC6.bpl +OBJFILES = cxVGridPredefinedStyles.obj cxVGridLayoutEditor.obj cxVGridEditor.obj \ + cxVGridReg.obj cxVGridConverter.obj cxVGridDXInspConverter.obj \ + dclcxVerticalGridVCLC6.obj +RESFILES = dclcxVerticalGridVCLC6.res cxVGridReg.dcr +RESDEPEN = $(RESFILES) cxVGridLayoutEditor.dfm +LIBFILES = +LIBRARIES = +SPARELIBS = +PACKAGES = rtl.bpi vcl.bpi vclx.bpi dbrtl.bpi cxEditorsVCLC6.bpi \ + cxExportVCLC6.bpi cxVerticalGridVCLC6.bpi cxLibraryVCLC6.bpi dclcxLibraryVCLC6.bpi \ + cxDataC6.bpi dclcxEditorsVCLC6.bpi designide.bpi +DEFFILE = +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +# --------------------------------------------------------------------------- +CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl;"$(SEARCHPATH)";$(LIBDIR) -O2 -Hc -H=$(BCB)\lib\vcl60.csm -w -Ve -a8 \ + -k- -vi -c -b- -w-par -w-inl -Vx -tWM -D$(SYSDEFINES);$(USERDEFINES) +PFLAGS = -U$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y- -$L- -$D- -v -JPHNE -M -LUdclstd -LUdcldb +RFLAGS = -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /mx /w2 /zn +LFLAGS = -L$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH);"$(SEARCHPATH)";$(LIBDIR) \ + -D"ExpressVerticalGrid (VCL Edition) by Developer Express Inc." -aa -Tpp -Gpd \ + -x -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj Memmgr.Lib $(PACKAGES) sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +InMemoryExe=0 +ShowInfoMsgs=0 + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLC6.cpp b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLC6.cpp new file mode 100644 index 00000000..7868d7eb --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLC6.cpp @@ -0,0 +1,32 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("dclcxVerticalGridVCLC6.res"); +USEPACKAGE("rtl.bpi"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("vclx.bpi"); +USEPACKAGE("cxEditorsVCLC6.bpi"); +USEPACKAGE("cxExportVCLC6.bpi"); +USEPACKAGE("cxVerticalGridVCLC6.bpi"); +USEPACKAGE("cxLibraryVCLC6.bpi"); +USEPACKAGE("dclcxLibraryVCLC6.bpi"); +USEPACKAGE("cxDataC6.bpi"); +USEPACKAGE("dclcxEditorsVCLC6.bpi"); +USEPACKAGE("designide.bpi"); +USEUNIT("cxVGridPredefinedStyles.pas"); +USEFORMNS("cxVGridLayoutEditor.pas", Cxvgridlayouteditor, fmvgLayoutEditor); +USEUNIT("cxVGridEditor.pas"); +USEUNIT("cxVGridReg.pas"); +USERES("cxVGridReg.dcr"); +USEUNIT("cxVGridConverter.pas"); +USEUNIT("cxVGridDXInspConverter.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLC6.res b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLC6.res new file mode 100644 index 00000000..9e928585 Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLC6.res differ diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLD6.dpk b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLD6.dpk new file mode 100644 index 00000000..c5074f57 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLD6.dpk @@ -0,0 +1,46 @@ +package dclcxVerticalGridVCLD6; + +{$R *.res} +{$R cxVGridReg.dcr} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressVerticalGrid (VCL Edition) by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dclcxLibraryVCLD6, + dclcxEditorsVCLD6, + cxVerticalGridVCLD6; + + +contains + cxVGridEditor, + cxVGridLayoutEditor, + cxVGridReg, + cxVGridStyleSheetPreview, + cxVGridPredefinedStyles, + cxVGridConverter, + cxVGridDXInspConverter; + +end. diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLD6.res b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLD6.res new file mode 100644 index 00000000..d104da65 Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLD6.res differ diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLD7.dpk b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLD7.dpk new file mode 100644 index 00000000..4aa2335c --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLD7.dpk @@ -0,0 +1,46 @@ +package dclcxVerticalGridVCLD7; + +{$R *.res} +{$R cxVGridReg.dcr} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ExpressVerticalGrid (VCL Edition) by Developer Express Inc.'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + designide, + dclcxLibraryVCLD7, + dclcxEditorsVCLD7, + cxVerticalGridVCLD7; + + +contains + cxVGridEditor, + cxVGridLayoutEditor, + cxVGridReg, + cxVGridStyleSheetPreview, + cxVGridPredefinedStyles, + cxVGridConverter, + cxVGridDXInspConverter; + +end. diff --git a/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLD7.res b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLD7.res new file mode 100644 index 00000000..d5f77710 Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Packages/dclcxVerticalGridVCLD7.res differ diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxDBVGrid.pas b/official/x.35/ExpressVerticalGrid/Sources/cxDBVGrid.pas new file mode 100644 index 00000000..7e9ad994 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxDBVGrid.pas @@ -0,0 +1,734 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressVerticalGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSVERTICALGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxDBVGrid; + +{$I cxVer.inc} + +interface + +uses + cxVGrid, cxInplaceContainer, Classes, DB, cxCustomData, cxDBData, + cxDataStorage, cxEdit, cxDBEdit, cxEditRepositoryItems, cxDataUtils; + +type + TcxDBVerticalGrid = class; + TcxDBCellEdit = class; + + { TcxDBVerticalGridDefaultValuesProvider } + + TcxDBVerticalGridDefaultValuesProvider = class(TcxCustomDBEditDefaultValuesProvider) + public + function IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean; override; + end; + + { TcxDBVerticalGridDataController } + + TcxDBVerticalGridDataController = class(TcxDBDataController, + IcxVerticalGridDBDataContoller) + private + FPrevBufferCount: Integer; + FPrevScrollBarPos: Integer; + function GetVerticalGrid: TcxDBVerticalGrid; + function GetGridMode: Boolean; + function GetGridModeBufferCount: Integer; + function GetScroller: TcxvgScroller; + procedure SetGridMode(Value: Boolean); + procedure SetGridModeBufferCount(Value: Integer); + protected + // IcxVerticalGridDBDataContoller + procedure CheckGridModeBufferCount; + function DoScroll(AForward: Boolean): Boolean; + function GetDataSetRecordCount: Integer; + function GetScrollBarPos: Integer; + function GetScrollBarRecordCount: Integer; + function SetScrollBarPos(APos: Integer): Boolean; + + function GetDefaultGridModeBufferCount: Integer; override; + function GetItemID(AItem: TObject): Integer; override; + function SupportsScrollBarParams: Boolean; virtual; + procedure UpdateControl(AInfo: TcxUpdateControlInfo); override; + procedure UpdateScrollBars; override; + property Scroller: TcxvgScroller read GetScroller; + property VerticalGrid: TcxDBVerticalGrid read GetVerticalGrid; + public + procedure CreateAllItems; + procedure FocusControl(AItemIndex: Integer; var Done: Boolean); override; + function GetItem(Index: Integer): TObject; override; + function GetItemValueSource(AItemIndex: Integer): TcxDataEditValueSource; override; + procedure UpdateData; override; + procedure UpdateItemIndexes; override; + published + property DataSource; + property GridMode: Boolean read GetGridMode write SetGridMode default False; + property GridModeBufferCount: Integer read GetGridModeBufferCount write SetGridModeBufferCount default 0; + end; + + { TcxDBVerticalGridItemDataBinding } + + TcxDBVerticalGridItemDataBinding = class(TcxCustomItemDataBinding) + private + function GetDataController: TcxDBVerticalGridDataController; + function GetField: TField; + function GetFieldName: string; + procedure SetFieldName(const Value: string); + protected + function DefaultRepositoryItem: TcxEditRepositoryItem; override; + function GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; override; + function GetValueTypeClass: TcxValueTypeClass; override; + procedure Init; override; + procedure ValueTypeClassChanged; override; + public + procedure Assign(Source: TPersistent); override; + function DefaultCaption: string; virtual; + property DataController: TcxDBVerticalGridDataController read GetDataController; + property Field: TField read GetField; + published + property FieldName: string read GetFieldName write SetFieldName; + end; + + { TcxDBCellEdit } + + TcxDBCellEdit = class(TcxCellEdit) + protected + function GetDataBindingClass: TcxItemDataBindingClass; override; + end; + + { TcxDBEditorRowItemProperties } + + TcxDBEditorRowItemProperties = class(TcxCollectionItemEditorRowProperties) + private + function GetDataBinding: TcxDBVerticalGridItemDataBinding; + procedure SetDataBinding(Value: TcxDBVerticalGridItemDataBinding); + protected + function DefaultCaption: string; override; + function GetDisplayName: string; override; + function GetInplaceEditContainerClass: TcxCellEditClass; override; + published + property DataBinding: TcxDBVerticalGridItemDataBinding read GetDataBinding write SetDataBinding; + property Options; + property OnGetDisplayText; + property OnGetEditProperties; + property OnGetEditingProperties; + end; + + { TcxDBEditorPropertiesCollection } + + TcxDBEditorPropertiesCollection = class(TcxEditorPropertiesCollection) + private + function GetItem(Index: Integer): TcxDBEditorRowItemProperties; + protected + function GetCollectionItemClass: TCollectionItemClass; override; + public + function Add: TcxDBEditorRowItemProperties; + property Items[Index: Integer]: TcxDBEditorRowItemProperties read GetItem; default; + end; + + { TcxDBEditorRowProperties } + + TcxDBEditorRowProperties = class(TcxCustomEditorRowProperties) + private + function GetDataBinding: TcxDBVerticalGridItemDataBinding; + procedure SetDataBinding(Value: TcxDBVerticalGridItemDataBinding); + protected + function DefaultCaption: string; override; + function GetInplaceEditContainerClass: TcxCellEditClass; override; + public + property Value; + published + property DataBinding: TcxDBVerticalGridItemDataBinding read GetDataBinding write SetDataBinding; + property Options; + property OnGetDisplayText; + property OnGetEditProperties; + property OnGetEditingProperties; + end; + + { TcxDBEditorRow } + + TcxDBEditorRow = class(TcxCustomEditorRow) + private + function GetProperties: TcxDBEditorRowProperties; + procedure SetProperties(Value: TcxDBEditorRowProperties); + protected + function GetPropertiesClass: TcxRowPropertiesClass; override; + published + property Expanded; + property Height; + property Options; + property Properties: TcxDBEditorRowProperties read GetProperties write SetProperties; + property Styles; + property Visible; + end; + + { TcxDBMultiEditorRowProperties } + + TcxDBMultiEditorRowProperties = class(TcxMultiEditorRowProperties) + private + function GetEditors: TcxDBEditorPropertiesCollection; + procedure SetEditors(Value: TcxDBEditorPropertiesCollection); + protected + function GetCollectionClass: TcxEditorPropertiesCollectionClass; override; + published + property Editors: TcxDBEditorPropertiesCollection read GetEditors write SetEditors; + end; + + { TcxDBMultiEditorRow } + + TcxDBMultiEditorRow = class(TcxCustomMultiEditorRow) + private + function GetProperties: TcxDBMultiEditorRowProperties; + procedure SetProperties(Value: TcxDBMultiEditorRowProperties); + protected + function GetPropertiesClass: TcxRowPropertiesClass; override; + published + property Expanded; + property Height; + property Options; + property Properties: TcxDBMultiEditorRowProperties read GetProperties write SetProperties; + property Styles; + property Visible; + end; + + { TcxDBVerticalGrid } + + TcxDBVerticalGrid = class(TcxVirtualVerticalGrid, IcxVGridDesignerRows) + private + function GetDataController: TcxDBVerticalGridDataController; + procedure SetDataController(Value: TcxDBVerticalGridDataController); + protected + function GetDataControllerClass: TcxCustomDataControllerClass; override; + function GetEditCellDataBindingClass: TcxItemDataBindingClass; override; + function GetEditorRowClass: TcxCustomRowClass; override; + function GetMultiEditorRowClass: TcxCustomRowClass; override; + procedure InitDataController; override; + published + property Align; + property Anchors; + property Constraints; + property DataController: TcxDBVerticalGridDataController read GetDataController write SetDataController; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property Font; + property Images; + property LayoutStyle; + property LookAndFeel; + property OptionsView; //before OptionsBehavior + property OptionsBehavior; + property OptionsData; + property ParentFont; + property PopupMenu; + property Styles; + property TabOrder; + property TabStop; + property Visible; + + property OnClick; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnCustomizationFormVisibleChanged; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnDrawBackground; + property OnDrawRowHeader; + property OnDrawValue; + property OnEdited; + property OnEditing; + property OnEditValueChanged; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnFilterControlDialogShow; + property OnFilterRecord; + property OnFocusedRecordChanged; + property OnInitEdit; + property OnItemChanged; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnLayoutChanged; + property OnLeftVisibleBandIndexChanged; + property OnLeftVisibleRecordIndexChanged; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnMouseWheel; + property OnMouseWheelDown; + property OnMouseWheelUp; + property OnResize; + property OnStartDock; + property OnStartDrag; + property OnTopRowIndexChanged; + end; + +implementation + +uses + SysUtils, cxGraphics, cxControls, cxLookAndFeelPainters, cxEditDBRegisteredRepositoryItems, +{$IFDEF DELPHI6} + Types, +{$ENDIF} + cxGeometry, cxVGridViewInfo, cxClasses; + +{ TcxDBVerticalGridDefaultValuesProvider } + +function TcxDBVerticalGridDefaultValuesProvider.IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean; +begin + Result := TcxDBVerticalGridItemDataBinding(Owner).IsDisplayFormatDefined(AIsCurrencyValueAccepted); +end; + +{ TcxDBVerticalGridDataController } + +procedure TcxDBVerticalGridDataController.CreateAllItems; +var + I: Integer; + AItem: TcxDBEditorRow; +begin + if DataSet = nil then Exit; + ShowHourglassCursor; + try + VerticalGrid.BeginUpdate; + try + with DataSet do + for I := 0 to FieldCount - 1 do + begin + AItem := TcxDBEditorRow(GetVerticalGrid.Add(TcxDBEditorRow)); + AItem.Name := CreateUniqueName(VerticalGrid.Owner, VerticalGrid, AItem, 'Tcx', Fields[I].FieldName); + with AItem.Properties do + begin + DataBinding.FieldName := Fields[I].FieldName; + Caption := DataBinding.DefaultCaption; + end; + AItem.Visible := Fields[I].Visible; + end; + finally + VerticalGrid.EndUpdate; + end; + finally + HideHourglassCursor; + end; +end; + +procedure TcxDBVerticalGridDataController.FocusControl(AItemIndex: Integer; + var Done: Boolean); +begin + TcxDBCellEdit(GetItem(AItemIndex)).Editing := True; + Done := TcxDBCellEdit(GetItem(AItemIndex)).Editing; +end; + +function TcxDBVerticalGridDataController.GetItem(Index: Integer): TObject; +begin + Result := VerticalGrid.ContainerList.List^[Index]; +end; + +function TcxDBVerticalGridDataController.GetItemValueSource( + AItemIndex: Integer): TcxDataEditValueSource; +begin + Result := TcxDBCellEdit(GetItem(AItemIndex)).PropertiesValue.GetEditValueSource(True); +end; + +procedure TcxDBVerticalGridDataController.UpdateData; +begin + VerticalGrid.UpdateData; +end; + +procedure TcxDBVerticalGridDataController.UpdateItemIndexes; +begin + VerticalGrid.UpdateIndexes; + inherited UpdateItemIndexes; +end; + +procedure TcxDBVerticalGridDataController.CheckGridModeBufferCount; +var + ACount: Integer; +begin + ACount := GetDefaultGridModeBufferCount; + if FPrevBufferCount <> ACount then + UpdateGridModeBufferCount; + FPrevBufferCount := ACount; +end; + +function TcxDBVerticalGridDataController.DoScroll(AForward: Boolean): Boolean; +begin + Result := SupportsScrollBarParams; + if Result then + with Scroller do + if AForward then GoToNext else GoToPrev; +end; + +function TcxDBVerticalGridDataController.GetDataSetRecordCount: Integer; +begin + if IsGridMode then + Result := DataSetRecordCount + else + Result := RowCount; +end; + +function TcxDBVerticalGridDataController.GetScrollBarPos: Integer; +begin + if SupportsScrollBarParams then + if dceInsert in EditState then + Result := FPrevScrollBarPos + else + Result := RecNo - 1 + else + Result := -1; + FPrevScrollBarPos := Result; +end; + +function TcxDBVerticalGridDataController.GetScrollBarRecordCount: Integer; +begin + if SupportsScrollBarParams then + Result := DataSetRecordCount + Scroller.VisibleValueCount - 1 + else + Result := -1; +end; + +function TcxDBVerticalGridDataController.SetScrollBarPos(APos: Integer): Boolean; +begin + Result := SupportsScrollBarParams; + if Result then + RecNo := APos + 1; +end; + +function TcxDBVerticalGridDataController.GetDefaultGridModeBufferCount: Integer; +begin + Result := VerticalGrid.ViewInfo.GetDefaultGridModeBufferCount; + if Result = 0 then + Result := inherited GetDefaultGridModeBufferCount; +end; + +function TcxDBVerticalGridDataController.GetItemID(AItem: TObject): Integer; +begin + if AItem is TcxDBCellEdit then + Result := TcxDBCellEdit(AItem).ItemIndex + else + Result := -1; +end; + +function TcxDBVerticalGridDataController.SupportsScrollBarParams: Boolean; +begin + Result := IsGridMode and IsSequenced; +end; + +procedure TcxDBVerticalGridDataController.UpdateControl( + AInfo: TcxUpdateControlInfo); +begin + VerticalGrid.ControlUpdateData(AInfo); +end; + +procedure TcxDBVerticalGridDataController.UpdateScrollBars; +begin + // refresh for GridMode + VerticalGrid.LayoutChanged; +end; + +function TcxDBVerticalGridDataController.GetGridMode: Boolean; +begin + Result := DataModeController.GridMode; +end; + +function TcxDBVerticalGridDataController.GetGridModeBufferCount: Integer; +begin + Result := DataModeController.GridModeBufferCount; +end; + +function TcxDBVerticalGridDataController.GetScroller: TcxvgScroller; +begin + Result := VerticalGrid.Controller.Scroller; +end; + +procedure TcxDBVerticalGridDataController.SetGridMode(Value: Boolean); +begin + DataModeController.GridMode := Value; +end; + +procedure TcxDBVerticalGridDataController.SetGridModeBufferCount(Value: Integer); +begin + DataModeController.GridModeBufferCount := Value; +end; + +function TcxDBVerticalGridDataController.GetVerticalGrid: TcxDBVerticalGrid; +begin + Result := TcxDBVerticalGrid(GetOwner); +end; + +{ TcxDBCellEdit } + +function TcxDBCellEdit.GetDataBindingClass: TcxItemDataBindingClass; +begin + Result := TcxDBVerticalGridItemDataBinding; +end; + +{ TcxDBVerticalGridItemDataBinding } + +procedure TcxDBVerticalGridItemDataBinding.Assign(Source: TPersistent); +begin + if Source is TcxDBVerticalGridItemDataBinding then + FieldName := TcxDBVerticalGridItemDataBinding(Source).FieldName; +end; + +function TcxDBVerticalGridItemDataBinding.DefaultCaption: string; +var + AField: TField; +begin + AField := Field; + if AField = nil then + Result := FieldName + else + Result := AField.DisplayName; +end; + +function TcxDBVerticalGridItemDataBinding.DefaultRepositoryItem: TcxEditRepositoryItem; +begin + Result := GetDefaultEditDBRepositoryItems.GetItemByField(Field); +end; + +function TcxDBVerticalGridItemDataBinding.GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass; +begin + Result := TcxDBVerticalGridDefaultValuesProvider; +end; + +function TcxDBVerticalGridItemDataBinding.GetValueTypeClass: TcxValueTypeClass; +begin + Result := GetValueTypeClassByField(Field); +end; + +procedure TcxDBVerticalGridItemDataBinding.Init; +begin + inherited Init; + TcxDBVerticalGridDefaultValuesProvider(DefaultValuesProvider).DataSource := DataController.DataSource; + TcxDBVerticalGridDefaultValuesProvider(DefaultValuesProvider).Field := Field; +end; + +procedure TcxDBVerticalGridItemDataBinding.ValueTypeClassChanged; +begin + TcxDBCellEdit(EditContainer).InternalPropertiesChanged; +end; + +function TcxDBVerticalGridItemDataBinding.GetDataController: TcxDBVerticalGridDataController; +begin + Result := TcxDBVerticalGridDataController(inherited DataController); +end; + +function TcxDBVerticalGridItemDataBinding.GetField: TField; +begin + Result := DataController.GetItemField(EditContainer.ItemIndex); +end; + +function TcxDBVerticalGridItemDataBinding.GetFieldName: string; +begin + Result := DataController.GetItemFieldName(EditContainer.ItemIndex); +end; + +procedure TcxDBVerticalGridItemDataBinding.SetFieldName(const Value: string); +begin + DataController.ChangeFieldName(EditContainer.ItemIndex, Value); + Init; + ValueTypeClassChanged; +end; + +{ TcxDBEditorRowItemProperties } + +function TcxDBEditorRowItemProperties.DefaultCaption: string; +begin + Result := DataBinding.DefaultCaption; +end; + +function TcxDBEditorRowItemProperties.GetDisplayName: string; +begin + Result := Caption; + if DataBinding.FieldName <> '' then + Result := Format('%s [%s]', [Result, DataBinding.FieldName]); +end; + +function TcxDBEditorRowItemProperties.GetInplaceEditContainerClass: TcxCellEditClass; +begin + Result := TcxDBCellEdit; +end; + +function TcxDBEditorRowItemProperties.GetDataBinding: TcxDBVerticalGridItemDataBinding; +begin + Result := TcxDBVerticalGridItemDataBinding(inherited DataBinding); +end; + +procedure TcxDBEditorRowItemProperties.SetDataBinding( + Value: TcxDBVerticalGridItemDataBinding); +begin + inherited DataBinding.Assign(Value); +end; + +{ TcxDBEditorPropertiesCollection } + +function TcxDBEditorPropertiesCollection.Add: TcxDBEditorRowItemProperties; +begin + Result := TcxDBEditorRowItemProperties(inherited Add); +end; + +function TcxDBEditorPropertiesCollection.GetCollectionItemClass: TCollectionItemClass; +begin + Result := TcxDBEditorRowItemProperties; +end; + +function TcxDBEditorPropertiesCollection.GetItem( + Index: Integer): TcxDBEditorRowItemProperties; +begin + Result := TcxDBEditorRowItemProperties(inherited Items[Index]); +end; + +{ TcxDBEditorRowProperties } + +function TcxDBEditorRowProperties.DefaultCaption: string; +begin + Result := DataBinding.DefaultCaption; +end; + +function TcxDBEditorRowProperties.GetInplaceEditContainerClass: TcxCellEditClass; +begin + Result := TcxDBCellEdit; +end; + +function TcxDBEditorRowProperties.GetDataBinding: TcxDBVerticalGridItemDataBinding; +begin + Result := TcxDBVerticalGridItemDataBinding(inherited DataBinding); +end; + +procedure TcxDBEditorRowProperties.SetDataBinding( + Value: TcxDBVerticalGridItemDataBinding); +begin + inherited DataBinding.Assign(Value); +end; + +{ TcxDBEditorRow } + +function TcxDBEditorRow.GetPropertiesClass: TcxRowPropertiesClass; +begin + Result := TcxDBEditorRowProperties; +end; + +function TcxDBEditorRow.GetProperties: TcxDBEditorRowProperties; +begin + Result := TcxDBEditorRowProperties(FProperties) +end; + +procedure TcxDBEditorRow.SetProperties(Value: TcxDBEditorRowProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxDBMultiEditorRowProperties } + +function TcxDBMultiEditorRowProperties.GetCollectionClass: TcxEditorPropertiesCollectionClass; +begin + Result := TcxDBEditorPropertiesCollection; +end; + +function TcxDBMultiEditorRowProperties.GetEditors: TcxDBEditorPropertiesCollection; +begin + Result := TcxDBEditorPropertiesCollection(inherited Editors); +end; + +procedure TcxDBMultiEditorRowProperties.SetEditors( + Value: TcxDBEditorPropertiesCollection); +begin + inherited Editors.Assign(Value); +end; + +{ TcxDBMultiEditorRow } + +function TcxDBMultiEditorRow.GetPropertiesClass: TcxRowPropertiesClass; +begin + Result := TcxDBMultiEditorRowProperties; +end; + +function TcxDBMultiEditorRow.GetProperties: TcxDBMultiEditorRowProperties; +begin + Result := TcxDBMultiEditorRowProperties(FProperties); +end; + +procedure TcxDBMultiEditorRow.SetProperties( + Value: TcxDBMultiEditorRowProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxDBVerticalGrid } + +function TcxDBVerticalGrid.GetDataControllerClass: TcxCustomDataControllerClass; +begin + Result := TcxDBVerticalGridDataController; +end; + +function TcxDBVerticalGrid.GetEditCellDataBindingClass: TcxItemDataBindingClass; +begin + Result := TcxDBVerticalGridItemDataBinding; +end; + +function TcxDBVerticalGrid.GetEditorRowClass: TcxCustomRowClass; +begin + Result := TcxDBEditorRow; +end; + +function TcxDBVerticalGrid.GetMultiEditorRowClass: TcxCustomRowClass; +begin + Result := TcxDBMultiEditorRow; +end; + +procedure TcxDBVerticalGrid.InitDataController; +begin +end; + +function TcxDBVerticalGrid.GetDataController: TcxDBVerticalGridDataController; +begin + Result := TcxDBVerticalGridDataController(FDataController); +end; + +procedure TcxDBVerticalGrid.SetDataController( + Value: TcxDBVerticalGridDataController); +begin + FDataController.Assign(Value); +end; + +initialization + RegisterClasses([TcxDBVerticalGridItemDataBinding]); + RegisterClasses([TcxDBEditorRow, TcxDBMultiEditorRow]); + RegisterClasses([TcxDBEditorRowProperties, TcxDBMultiEditorRowProperties]); + +end. + diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxExportVGLink.pas b/official/x.35/ExpressVerticalGrid/Sources/cxExportVGLink.pas new file mode 100644 index 00000000..f67ed5e5 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxExportVGLink.pas @@ -0,0 +1,1304 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressVerticalGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSVERTICALGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxExportVGLink; + +{$I cxVer.inc} + +interface + +uses + cxVGrid; + +procedure cxExportVGToHTML(const AFileName: string; + AVerticalGrid: TcxCustomVerticalGrid; AExpand: Boolean = True; + ARecordPerBand: Integer = 8; const AFileExt: string = 'html'); +procedure cxExportVGToXML(const AFileName: string; + AVerticalGrid: TcxCustomVerticalGrid; AExpand: Boolean = True; + ARecordPerBand: Integer = 8; const AFileExt: string = 'xml'); +procedure cxExportVGToExcel(const AFileName: string; + AVerticalGrid: TcxCustomVerticalGrid; AExpand: Boolean = True; + AUseNativeFormat: Boolean = True; + ARecordPerBand: Integer = 8; const AFileExt: string = 'xls'); +procedure cxExportVGToText(const AFileName: string; + AVerticalGrid: TcxCustomVerticalGrid; AExpand: Boolean = True; + const ASeparator: string = ''; const ABeginString: string = ''; + const AEndString: string = ''; ARecordPerBand: Integer = 8; + const AFileExt: string = 'txt'); +procedure cxExportVGToFile(AFileName: string; + AVerticalGrid: TcxCustomVerticalGrid; AExportType: Integer; + AExpand, AUseNativeFormat: Boolean; const ASeparators: array of string; + ARecordPerBand: Integer; const AFileExt: string); + +implementation + +uses + Windows, Types, + Graphics, cxGeometry, +{$IFDEF DELPHI6} + Variants, +{$ENDIF} + cxEdit, cxCalendar, cxCurrencyEdit, cxSpinEdit, cxCalc, cxTimeEdit, + SysUtils, Classes, cxClasses, cxGraphics, cxStyles, cxInplaceContainer, + cxDataUtils, cxExport, cxXLSExport, cxHtmlXmlTxtExport, cxVGridViewInfo, + cxVGridConsts, cxVGridUtils; + +type + TcxVerticalGridAccess = class(TcxCustomVerticalGrid); + TcxControllerAccess = class(TcxvgController); + TcxScrollerAccess = class(TcxvgScroller); + TcxViewInfoAccess = class(TcxvgCustomViewInfo); + TcxStylesAccess = class(TcxVerticalGridStyles); + TcxPropertiesAccess = class(TcxCustomEditProperties); + TcxRowHeaderAccess = class(TcxCustomRowHeaderInfo); + TcxCustomEditorRowAccess = class(TcxCustomEditorRow); + TcxCustomEditorRowPropertiesAccess = class(TcxCustomEditorRowProperties); + TcxCustomMultiEditorRowAccess = class(TcxCustomMultiEditorRow); + TcxCustomRowAccess = class(TcxCustomRow); + + TcxVerticalGridExportHelper = class; + TcxColumnsMap = class; + + TcxRowIndentData = record + StyleIndex: Integer; + IsCategory: Boolean; + Column: Integer; + Width: Integer; + end; + PcxRowIndentData = ^TcxRowIndentData; + + { TcxRowIndentsInfo } + + TcxRowIndentsInfo = class + private + FGridLineColor: TColor; + FGridLines: TcxvgGridLines; + FHeaderColumnsMap: TcxColumnsMap; + FHeaderInfo: TcxRowHeaderAccess; + FIsCategory: Boolean; + FList: TList; + FPaintStyle: TcxvgPaintStyle; + FProvider: IcxExportProvider; + FRow: TcxCustomRow; + function GetCount: Integer; + function GetIndent(Index: Integer): TcxRowIndentData; + protected + procedure AddFirstIndent; + procedure AddParentIndents; + procedure Calculate(AHeaderColumnsMap: TcxColumnsMap; AProvider: IcxExportProvider); + property Row: TcxCustomRow read FRow; + property GridLineColor: TColor read FGridLineColor; + property GridLines: TcxvgGridLines read FGridLines; + property HeaderColumnsMap: TcxColumnsMap read FHeaderColumnsMap; + property HeaderInfo: TcxRowHeaderAccess read FHeaderInfo; + property IsCategory: Boolean read FIsCategory; + property PaintStyle: TcxvgPaintStyle read FPaintStyle; + property Provider: IcxExportProvider read FProvider; + public + constructor Create(ARow: TcxCustomRow); + destructor Destroy; override; + property Count: Integer read GetCount; + property Indents[Index: Integer]: TcxRowIndentData read GetIndent; + end; + + { TcxColumnsMap } + + TElementInfo = record + Pos: Integer; + ColumnStart: Integer; + ColumnEnd: Integer; + Width: Integer; + IsLevel: Boolean; + case Boolean of + False: ( + Row: TcxCustomRow; + CellIndex: Integer + ); + True: ( + Level: Integer + ); + end; + PElementInfo = ^TElementInfo; + + TcxColumnsMap = class + private + FElements: TList; + FColumnWidths: array of Integer; + protected + NeedWidth: Integer; + MaxColumnIndex: Integer; + public + constructor Create; + destructor Destroy; override; + procedure AddRowCell(APos: Integer; ARow: TcxCustomRow; ACellIndex, AWidth: Integer); + procedure AddLevel(ALevel, APos, AWidth: Integer); + procedure Build; + procedure CheckNeedWidth(APos: Integer); + function FindColumnForPos(APos: Integer): Integer; + procedure GetColumnInfoFromRowCell(ARow: TcxCustomRow; ACellIndex: Integer; + var AStart, AEnd: Integer); + procedure GetColumnInfoFromLevel(ALevel: Integer; var AStart, AEnd: Integer); + function GetColumnWidth(AIndex: Integer): Integer; + end; + + { TcxRowsIndents } + + TcxRowsIndents = class(TList) + private + function GetIndent(Index: Integer): TcxRowIndentsInfo; + public + procedure Clear; override; + property Indents[Index: Integer]: TcxRowIndentsInfo read GetIndent; default; + end; + + { TcxRowCellsInfo } + + TRowCaptionCellInfo = record + Caption: string; + Column: Integer; + Width: Integer; + StyleIndex: Integer; + end; + PRowCaptionCellInfo = ^TRowCaptionCellInfo; + + TcxRowCellsInfo = class(TList) + private + function GetItem(Index: Integer): TRowCaptionCellInfo; + public + function AddCaption(AColumn: Integer; AWidth: Integer; AStyleIndex: Integer; const ACaption: string): Integer; overload; + procedure Clear; override; + property Items[Index: Integer]: TRowCaptionCellInfo read GetItem; default; + end; + + { TcxRowsCaptions } + + TcxRowsCaptions = class(TList) + private + function GetCaption(Index: Integer): TcxRowCellsInfo; + public + function AddCaption: TcxRowCellsInfo; + procedure Clear; override; + property Captions[Index: Integer]: TcxRowCellsInfo read GetCaption; + end; + + { TcxVerticalGridMapInfo } + + TcxVerticalGridMapsInfo = class + private + FBandCount: Integer; + FFirstValuesColumn: Integer; + FGridLineColor: TColor; + FGridLines: TcxvgGridLines; + FHeaderColumnsMap: TcxColumnsMap; + FIsEmpty: Boolean; + FLastBandRecords: Integer; + FLevelIndents: array of Integer; + FMaxHeaderWidth: Integer; + FMaxLevel: Integer; + FMaxValueWidth: Integer; + FMinHeaderWidth: Integer; + FMinValueWidth: Integer; + FOwner: TcxVerticalGridExportHelper; + FPaintStyle: TcxvgPaintStyle; + FRecordCount: Integer; + FRecordsPerBand: Integer; + FRowCount: Integer; + FRows: TList; + FRowsCaptions: TcxRowsCaptions; + FRowsIndents: TcxRowsIndents; + FSize: TSize; + FValueColumnsMap: TcxColumnsMap; + FVerticalGrid: TcxVerticalGridAccess; + FViewInfo: TcxViewInfoAccess; + function GetLevelIndent(Index: Integer): Integer; + function GetProvider: IcxExportProvider; + function GetRow(Index: Integer): TcxCustomRow; + protected + TotalWidth: Integer; + Position: Integer; + procedure AddMultiEditorRowCells(ARow: TcxCustomRow); + procedure AddMapRightSide(AMap: TcxColumnsMap; ARight, AMinCellWidth: Integer; ACalcIndent: Boolean); + procedure AlignCategories; + procedure CalculateHeader; + procedure CalculateRowsCaptions; + procedure CalculateRowsIndents; + procedure CalculateSize; + procedure CalculateValuesMap; + procedure DoCalculate; virtual; + procedure DoWrite; virtual; + function GetDisplayText(ARecordIndex: Integer; ARow: TcxCustomEditorRowProperties): string; + function GetDisplayValue(ARecordIndex: Integer; ARow: TcxCustomEditorRowProperties): Variant; + function GetMultiEditorRowProperties(ARow: TcxCustomRow): TcxMultiEditorRowProperties; + function IsIncludeRow(ARow: TcxCustomRow): Boolean; virtual; + function IsNativeFormatProperties(AProperties: TcxCustomEditProperties): Boolean; + procedure SetCellStyle(ACol, ARow, W, AStyleIndex: Integer); overload; + procedure SetCellStyle(ACol, ARow, W: Integer; const AStyle: TcxCacheCellStyle); overload; + procedure WriteColumnWidths; + procedure WriteHeaders(ARowIndex: Integer); virtual; + procedure WriteRecord(ACol, ARowIndex, ARecordIndex: Integer); virtual; + procedure WriteRowCaptions(ARowIndex: Integer; ACaptions: TcxRowCellsInfo); + procedure WriteRowHeader(ARowIndex: Integer; AIndents: TcxRowIndentsInfo; ACaptions: TcxRowCellsInfo); + procedure WriteValue(ACol, ARow, ARecordIndex: Integer; + AProperties: TcxCustomEditorRowProperties); + procedure WriteValues; + + property FirstValuesColumn: Integer read FFirstValuesColumn; + property GridLineColor: TColor read FGridLineColor; + property GridLines: TcxvgGridLines read FGridLines; + property HeaderColumnsMap: TcxColumnsMap read FHeaderColumnsMap; + property IsEmpty: Boolean read FIsEmpty; + property LastBandRecords: Integer read FLastBandRecords; + property LevelIndents[Index: Integer]: Integer read GetLevelIndent; + property MaxHeaderWidth: Integer read FMaxHeaderWidth; + property MaxValueWidth: Integer read FMaxValueWidth; + property MinHeaderWidth: Integer read FMinHeaderWidth; + property MinValueWidth: Integer read FMinHeaderWidth; + property Owner: TcxVerticalGridExportHelper read FOwner; + property PaintStyle: TcxvgPaintStyle read FPaintStyle; + property Provider: IcxExportProvider read GetProvider; + property RecordCount: Integer read FRecordCount; + property RecordsPerBand: Integer read FRecordsPerBand; + property ValueColumnsMap: TcxColumnsMap read FValueColumnsMap; + property ViewInfo: TcxViewInfoAccess read FViewInfo; + public + constructor Create(AOwner: TcxVerticalGridExportHelper); virtual; + destructor Destroy; override; + property MaxLevel: Integer read FMaxLevel; + property RowCount: Integer read FRowCount; + property Rows[Index: Integer]: TcxCustomRow read GetRow; + property RowsCaptions: TcxRowsCaptions read FRowsCaptions; + property RowsIndents: TcxRowsIndents read FRowsIndents; + property Size: TSize read FSize; + property VerticalGrid: TcxVerticalGridAccess read FVerticalGrid; + end; + + TcxVerticalGridMapsInfoClass = class of TcxVerticalGridMapsInfo; + + { TcxVerticalGridExportHelper } + + TcxVerticalGridExportHelper = class + private + FProvider: IcxExportProvider; + FRecordsPerBand: Integer; + FExpand: Boolean; + FIsNativeFormat: Boolean; + FVerticalGrid: TcxVerticalGridAccess; + protected + MapsInfo: TcxVerticalGridMapsInfo; + procedure DoCalculateTableMap; virtual; + procedure DoWriteCells; virtual; + function GetMapsInfoClass: TcxVerticalGridMapsInfoClass; virtual; + public + constructor Create(AVerticalGrid: TcxCustomVerticalGrid; + AExportType: Integer; const AFileName: string); virtual; + destructor Destroy; override; + property RecordsPerBand: Integer read FRecordsPerBand write FRecordsPerBand; + property Expand: Boolean read FExpand write FExpand; + property IsNativeFormat: Boolean read FIsNativeFormat; + property Provider: IcxExportProvider read FProvider; + property VerticalGrid: TcxVerticalGridAccess read FVerticalGrid; + end; + +const + cxInvalidIndex = -1; + cxIndentFontName = 'Tahoma'; + cxCellBorders: array[Boolean] of TcxBorders = ([], cxBordersAll); + cxIndentStyle: TcxCacheCellStyle = + ( AlignText: catCenter; + FontStyle: []; + FontColor: 0; + FontSize: 12; + FontCharset: 0; + BrushStyle: cbsSolid); + +// todo: need move to cxExport for Delphi 4 + AlignToCxAlign: array[TAlignment] of TcxAlignText = + (catLeft, catRight, catCenter); + cxUsedBorder: TcxCellBorders = (IsDefault: False; Width: 1); + cxEmptyBorder: TcxCellBorders = (IsDefault: True; Width: 0); + +function cxSetBorder(var ABorder: TcxCellBorders; NeedSet: Boolean; Color: Integer): Boolean; +begin + Result := NeedSet; + if NeedSet then + begin + ABorder := cxUsedBorder; + ABorder.Color := Color; + end + else + ABorder := cxEmptyBorder; +end; + +procedure cxCheckBorders(var AStyle: TcxCacheCellStyle; + const ABorders: TcxBorders; AColor: TColor; AGridLines: TcxvgGridLines); +begin + cxSetBorder(AStyle.Borders[0], + (bLeft in ABorders) and (AGridLines in [vglVertical, vglBoth]), AColor); + cxSetBorder(AStyle.Borders[1], + (bTop in ABorders) and (AGridLines in [vglHorizontal, vglBoth]), AColor); + cxSetBorder(AStyle.Borders[2], + (bRight in ABorders) and (AGridLines in [vglVertical, vglBoth]), AColor); + cxSetBorder(AStyle.Borders[3], + (bBottom in ABorders) and (AGridLines in [vglHorizontal, vglBoth]), AColor); +end; + +procedure cxViewParamsToCacheStyle( + AViewParams: TcxViewParams; var ACacheStyle: TcxCacheCellStyle); +begin + ACacheStyle := DefaultCellStyle; + with ACacheStyle do + begin + StrPCopy(FontName, AViewParams.Font.Name); + FontStyle := TcxFontStyles(AViewParams.Font.Style); + FontColor := ColorToRgb(AViewParams.TextColor); + FontSize := AViewParams.Font.Size; + FontCharset := AViewParams.Font.Charset; + BrushStyle := cbsSolid; + BrushBkColor := ColorToRgb(AViewParams.Color); + BrushFgColor := BrushBkColor; + end; +end; + +function GetHeaderViewParams(ARow: TcxCustomRow): TcxViewParams; +begin + with TcxRowHeaderAccess(ARow.ViewInfo.HeaderInfo) do + begin + CalcViewParams(False); + Result := IndentViewParams; + end; +end; + +{ TcxRowIndentsInfo } + +constructor TcxRowIndentsInfo.Create(ARow: TcxCustomRow); +begin + FRow := ARow; + FList := TList.Create; +end; + +destructor TcxRowIndentsInfo.Destroy; +var + I: Integer; +begin + FProvider := nil; + for I := 0 to FList.Count - 1 do + Dispose(PcxRowIndentData(FList[I])); + FList.Free; + inherited Destroy; +end; + +procedure TcxRowIndentsInfo.AddFirstIndent; +var + AEnd: Integer; + Info: PcxRowIndentData; + AStyle: TcxCacheCellStyle; + ABorders: TcxBorders; +begin + New(Info); + FIsCategory := FRow is TcxCategoryRow; + Info.IsCategory := IsCategory; + HeaderColumnsMap.GetColumnInfoFromLevel(FRow.Level, Info.Column, AEnd); + Info.Width := AEnd - Info.Column; + cxViewParamsToCacheStyle(GetHeaderViewParams(FRow), AStyle); + AStyle.AlignText := catCenter; + ABorders := [bTop, bBottom]; + if FRow.IsRootLevel then Include(ABorders, bLeft); + if (PaintStyle = psDotNet) and IsCategory then + begin + Include(ABorders, bLeft); + if FRow.HasVisibleChildren then + Exclude(ABorders, bBottom); + end; + cxCheckBorders(AStyle, ABorders, GridLineColor, GridLines); + Info.StyleIndex := Provider.RegisterStyle(AStyle); + FList.Add(Info); +end; + +procedure TcxRowIndentsInfo.AddParentIndents; +var + AEnd: Integer; + Info: PcxRowIndentData; + ABorders: TcxBorders; + ANeedBottom, ALastRow: Boolean; + AParent: TcxCustomRow; + AStyle: TcxCacheCellStyle; +begin + if FRow.IsRootLevel then Exit; + AParent := Row; + ALastRow := Row.VerticalGrid.LastVisibleRow = Row; + ANeedBottom := True; + repeat + AParent := AParent.Parent; + New(Info); + Info.IsCategory := AParent is TcxCategoryRow; + HeaderColumnsMap.GetColumnInfoFromLevel(AParent.Level, Info.Column, AEnd); + Info.Width := AEnd - Info.Column; + cxViewParamsToCacheStyle(GetHeaderViewParams(AParent), AStyle); + if PaintStyle = psDelphi then + begin + ABorders := [bTop, bBottom]; + if AParent.IsRootLevel then Include(ABorders, bLeft); + end + else + begin + if Info.IsCategory then + begin + ANeedBottom := False; + ABorders := [bLeft, bRight]; + if AParent.GetLastVisibleChild = FRow then + Include(ABorders, bBottom); + end + else + if (not IsCategory and ANeedBottom) or ALastRow then + ABorders := [bBottom] + else + ABorders := []; + end; + cxCheckBorders(AStyle, ABorders, GridLineColor, GridLines); + Info.StyleIndex := Provider.RegisterStyle(AStyle); + FList.Add(Info); + until AParent.IsRootLevel; +end; + +procedure TcxRowIndentsInfo.Calculate(AHeaderColumnsMap: TcxColumnsMap; + AProvider: IcxExportProvider); +begin + FHeaderColumnsMap := AHeaderColumnsMap; + FHeaderInfo := TcxRowHeaderAccess(FRow.ViewInfo.HeaderInfo); + with FRow.VerticalGrid.OptionsView do + begin + FGridLines := GridLines; + FPaintStyle := PaintStyle; + FGridLineColor := GridLineColor; + end; + FProvider := AProvider; + AddFirstIndent; + AddParentIndents; +end; + +function TcxRowIndentsInfo.GetCount: Integer; +begin + Result := FList.Count; +end; + +function TcxRowIndentsInfo.GetIndent(Index: Integer): TcxRowIndentData; +begin + Result := PcxRowIndentData(FList[Index])^; +end; + +{ TcxRowsIndents } + +procedure TcxRowsIndents.Clear; +var + I: Integer; +begin + for I := 0 to Count - 1 do + TObject(Items[I]).Free; + inherited Clear; +end; + +function TcxRowsIndents.GetIndent(Index: Integer): TcxRowIndentsInfo; +begin + Result := List^[Index]; +end; + +{ TcxRowCellsInfo } + +function TcxRowCellsInfo.AddCaption(AColumn, AWidth, + AStyleIndex: Integer; const ACaption: string): Integer; +var + C: PRowCaptionCellInfo; +begin + New(C); + with C^ do + begin + Caption := ACaption; + Column := AColumn; + StyleIndex := AStyleIndex; + Width := AWidth; + end; + Result := Add(C); +end; + +procedure TcxRowCellsInfo.Clear; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Dispose(PRowCaptionCellInfo(inherited Items[I])); + inherited Clear; +end; + +function TcxRowCellsInfo.GetItem(Index: Integer): TRowCaptionCellInfo; +begin + Result := TRowCaptionCellInfo(inherited Items[Index]^); +end; + +{ TcxRowsCaptions } + +function TcxRowsCaptions.AddCaption: TcxRowCellsInfo; +begin + Result := TcxRowCellsInfo.Create; + Add(Result); +end; + +procedure TcxRowsCaptions.Clear; +var + I: Integer; +begin + for I := 0 to Count - 1 do + TObject(Items[I]).Free; + inherited Clear; +end; + +function TcxRowsCaptions.GetCaption(Index: Integer): TcxRowCellsInfo; +begin + Result := List^[Index]; +end; + +{ TcxColumnsMap } + +constructor TcxColumnsMap.Create; +begin + FElements := TList.Create; + NeedWidth := 0; +end; + +destructor TcxColumnsMap.Destroy; +var + I: Integer; +begin + for I := 0 to FElements.Count - 1 do + Dispose(PElementInfo(FElements.List^[I])); + FElements.Free; + FColumnWidths := nil; + inherited Destroy; +end; + +procedure TcxColumnsMap.AddRowCell(APos: Integer; ARow: TcxCustomRow; + ACellIndex, AWidth: Integer); +var + E: PElementInfo; +begin + New(E); + E.Pos := APos; + E.Width := AWidth; + E.IsLevel := False; + E.Row := ARow; + E.CellIndex := ACellIndex; + FElements.Add(E); + if AWidth > 0 then + begin + New(E); + E.Pos := APos + AWidth; + E.Width := 0; + E.IsLevel := False; + E.Row := ARow; + E.CellIndex := ACellIndex; + FElements.Add(E); + end; +end; + +procedure TcxColumnsMap.AddLevel(ALevel, APos, AWidth: Integer); +var + E: PElementInfo; +begin + New(E); + E.Pos := APos; + E.Width := AWidth; + E.IsLevel := True; + E.Level := ALevel; + FElements.Add(E); + if AWidth > 0 then + begin + New(E); + E.Pos := APos + AWidth; + E.Width := 0; + E.IsLevel := True; + E.Level := ALevel; + FElements.Add(E); + end; +end; + +function ComparePos(Item1, Item2: Pointer): Integer; +begin + Result := PElementInfo(Item1).Pos - PElementInfo(Item2).Pos; +end; + +procedure TcxColumnsMap.Build; +var + I, AColumn, APos: Integer; +begin + FElements.Sort(ComparePos); + AColumn := 0; + APos := 0; + for I := 0 to FElements.Count - 1 do + with PElementInfo(FElements.List^[I])^ do + begin + if Pos > APos then + begin + SetLength(FColumnWidths, Succ(AColumn)); + FColumnWidths[AColumn] := Pos - APos; + APos := Pos; + Inc(AColumn); + end; + ColumnStart := AColumn; + end; + for I := 0 to FElements.Count - 1 do + with PElementInfo(FElements.List^[I])^ do + if Width > 0 then ColumnEnd := FindColumnForPos(Pos + Width); + MaxColumnIndex := AColumn - 1; +end; + +procedure TcxColumnsMap.CheckNeedWidth(APos: Integer); +begin + NeedWidth := Max(NeedWidth, APos); +end; + +function TcxColumnsMap.FindColumnForPos(APos: Integer): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to FElements.Count - 1 do + with PElementInfo(FElements.List^[I])^ do + if APos = Pos then + begin + Result := ColumnStart; + break; + end; +end; + +procedure TcxColumnsMap.GetColumnInfoFromRowCell(ARow: TcxCustomRow; + ACellIndex: Integer; var AStart, AEnd: Integer); +var + I: Integer; +begin + for I := 0 to FElements.Count - 1 do + with PElementInfo(FElements.List^[I])^ do + if not IsLevel and (Row = ARow) and (CellIndex = ACellIndex) then + begin + AStart := ColumnStart; + AEnd := ColumnEnd; + break; + end; +end; + +procedure TcxColumnsMap.GetColumnInfoFromLevel(ALevel: Integer; + var AStart, AEnd: Integer); +var + I: Integer; +begin + for I := 0 to FElements.Count - 1 do + with PElementInfo(FElements.List^[I])^ do + if IsLevel and (Level = ALevel) then + begin + AStart := ColumnStart; + AEnd := ColumnEnd; + break; + end; +end; + +function TcxColumnsMap.GetColumnWidth(AIndex: Integer): Integer; +begin + Result := FColumnWidths[AIndex]; +end; + +{ TcxVerticalGridMapsInfo } + +constructor TcxVerticalGridMapsInfo.Create( + AOwner: TcxVerticalGridExportHelper); +begin + FOwner := AOwner; + FVerticalGrid := FOwner.VerticalGrid; + FViewInfo := TcxViewInfoAccess(FVerticalGrid.ViewInfo); + FRows := TList.Create; + FRowsCaptions := TcxRowsCaptions.Create; + FRowsIndents := TcxRowsIndents.Create; + FHeaderColumnsMap := TcxColumnsMap.Create; + FValueColumnsMap := TcxColumnsMap.Create; + with FVerticalGrid.OptionsView do + begin + FGridLineColor := GridLineColor; + FGridLines := GridLines; + FPaintStyle := PaintStyle; + end; +end; + +destructor TcxVerticalGridMapsInfo.Destroy; +begin + FLevelIndents := nil; + FRows.Free; + FHeaderColumnsMap.Free; + FValueColumnsMap.Free; + FRowsCaptions.Free; + FRowsIndents.Free; + inherited Destroy; +end; + +procedure TcxVerticalGridMapsInfo.AddMultiEditorRowCells(ARow: TcxCustomRow); +var + I, APosHeaderCell, AWidthHeaderCell, APosValueCell, AWidthValueCell: Integer; +begin + with GetMultiEditorRowProperties(ARow) do + begin + if Editors.Count < 2 then Exit; + APosHeaderCell := Succ(ARow.Level) * ViewInfo.RowIndentWidth; + APosValueCell := 0; + for I := 0 to Editors.Count - 1 do + begin + AWidthHeaderCell := Max(Editors[I].Width, FMinHeaderWidth); + AWidthValueCell := Max(Editors[I].Width, FMinValueWidth); + HeaderColumnsMap.CheckNeedWidth(APosHeaderCell + AWidthHeaderCell); + ValueColumnsMap.CheckNeedWidth(APosValueCell + AWidthValueCell); + if I = Editors.Count - 1 then break; + HeaderColumnsMap.AddRowCell(APosHeaderCell, ARow, I, AWidthHeaderCell); + Inc(APosHeaderCell, AWidthHeaderCell); + ValueColumnsMap.AddRowCell(APosValueCell, ARow, I, AWidthValueCell); + Inc(APosValueCell, AWidthValueCell); + end; + end; +end; + +procedure TcxVerticalGridMapsInfo.AddMapRightSide(AMap: TcxColumnsMap; + ARight, AMinCellWidth: Integer; ACalcIndent: Boolean); +var + I, J, AWidth, APos: Integer; + ARow: TcxCustomRow; +begin + for I := 0 to RowCount - 1 do + begin + ARow := Rows[I]; + APos := cxSetValue(ACalcIndent, (ARow.Level + 1) * ViewInfo.RowIndentWidth, 0); + if ARow is TcxCustomEditorRow then + AMap.AddRowCell(APos, ARow, 0, ARight - APos) + else + if ARow is TcxCustomMultiEditorRow then + with GetMultiEditorRowProperties(ARow) do + begin + if Editors.Count = 0 then continue; + for J := 0 to Editors.Count - 1 do + begin + AWidth := Max(Editors[J].Width, AMinCellWidth); + if J = Editors.Count - 1 then + AMap.AddRowCell(APos, ARow, J, ARight - APos); + Inc(APos, AWidth); + end; + end; + end; +end; + +procedure TcxVerticalGridMapsInfo.AlignCategories; +var + I: Integer; + AProperties: TcxCaptionRowProperties; + ARow: TcxCustomRow; + AStart, AEnd: Integer; + AStyle: TcxCacheCellStyle; + AViewParams: TcxViewParams; +begin + for I := 0 to RowCount - 1 do + begin + ARow := Rows[I]; + if ARow is TcxCategoryRow then + begin + AProperties := TcxCategoryRow(ARow).Properties; + HeaderColumnsMap.GetColumnInfoFromLevel(ARow.Level, AStart, AEnd); + AViewParams := VerticalGrid.Styles.GetCategoryParams(ARow); + cxViewParamsToCacheStyle(AViewParams, AStyle); + AStyle.AlignText := AlignToCxAlign[AProperties.HeaderAlignmentHorz]; + cxCheckBorders(AStyle, [bTop, bBottom, bRight], GridLineColor, GridLines); + RowsCaptions.Captions[I].AddCaption(AEnd, Size.cx - AEnd, + Provider.RegisterStyle(AStyle), AProperties.Caption); + end; + end; +end; + +procedure TcxVerticalGridMapsInfo.CalculateHeader; +var + I, AWidth: Integer; + ARow: TcxCustomRow; +begin + FMinHeaderWidth := VerticalGrid.OptionsView.RowHeaderMinWidth; + FMaxLevel := 0; + for I := 0 to VerticalGrid.Rows.Count - 1 do + begin + ARow := VerticalGrid.Rows[I]; + if IsIncludeRow(ARow) then + begin + FRows.Add(ARow); + if ARow is TcxCustomMultiEditorRow then + AddMultiEditorRowCells(ARow); + FMaxLevel := Max(FMaxLevel, ARow.Level); + end; + end; + FRowCount := FRows.Count; + AWidth := ViewInfo.RowIndentWidth; + for I := 0 to FMaxLevel do + HeaderColumnsMap.AddLevel(I, I * AWidth, AWidth); + FMaxHeaderWidth := Max(HeaderColumnsMap.NeedWidth, + VerticalGrid.OptionsView.RowHeaderWidth); + HeaderColumnsMap.AddLevel(-1, 0, MaxHeaderWidth); + AddMapRightSide(HeaderColumnsMap, MaxHeaderWidth, MinHeaderWidth, True); + HeaderColumnsMap.Build; + CalculateRowsIndents; + CalculateRowsCaptions; +end; + +procedure TcxVerticalGridMapsInfo.CalculateRowsCaptions; +var + I, J: Integer; + AViewParams: TcxViewParams; + ARow: TcxCustomRow; + ACaptions: TcxRowCellsInfo; + + procedure AddCaption(AProperties: TcxCaptionRowProperties; ACellIndex: Integer); + var + AStart, AEnd: Integer; + AStyle: TcxCacheCellStyle; + begin + HeaderColumnsMap.GetColumnInfoFromRowCell(ARow, ACellIndex, AStart, AEnd); + cxViewParamsToCacheStyle(AViewParams, AStyle); + AStyle.AlignText := AlignToCxAlign[AProperties.HeaderAlignmentHorz]; + cxCheckBorders(AStyle, [bTop, bBottom, bRight], GridLineColor, GridLines); + ACaptions.AddCaption(AStart, AEnd - AStart, Provider.RegisterStyle(AStyle), AProperties.Caption); + end; + +begin + for I := 0 to RowCount - 1 do + begin + ARow := Rows[I]; + ACaptions := RowsCaptions.AddCaption; + AViewParams := VerticalGrid.Styles.GetHeaderParams(ARow); + if ARow is TcxCustomEditorRow then + AddCaption(TcxCustomEditorRowAccess(ARow).Properties, 0) + else + if ARow is TcxCustomMultiEditorRow then + with GetMultiEditorRowProperties(ARow) do + for J := 0 to Editors.Count - 1 do + AddCaption(Editors[J], J); + end; +end; + +procedure TcxVerticalGridMapsInfo.CalculateRowsIndents; +var + I: Integer; + AIndents: TcxRowIndentsInfo; +begin + for I := 0 to RowCount - 1 do + begin + AIndents := TcxRowIndentsInfo.Create(Rows[I]); + AIndents.Calculate(HeaderColumnsMap, Provider); + RowsIndents.Add(AIndents); + end; +end; + +procedure TcxVerticalGridMapsInfo.CalculateSize; +begin + CalculateHeader; + CalculateValuesMap; + FRecordCount := VerticalGrid.RecordCount; + FIsEmpty := FRecordCount = 0; + if FIsEmpty then Inc(FRecordCount); + FRecordsPerBand := Max(Owner.RecordsPerBand, 1); + FBandCount := FRecordCount div FRecordsPerBand; + FLastBandRecords := FRecordCount - FBandCount * FRecordsPerBand; + if FLastBandRecords > 0 then + Inc(FBandCount) + else + FLastBandRecords := FRecordsPerBand; + FSize := cxSize(FirstValuesColumn + (ValueColumnsMap.MaxColumnIndex + 1) * + cxSetValue(FBandCount = 1, FLastBandRecords, RecordsPerBand), + (RowCount + 1) * FBandCount - 1); +end; + +procedure TcxVerticalGridMapsInfo.CalculateValuesMap; +begin + FFirstValuesColumn := HeaderColumnsMap.MaxColumnIndex + 1; + FMinValueWidth := VerticalGrid.OptionsView.ValueMinWidth; + FMaxValueWidth := Max(ValueColumnsMap.NeedWidth, + VerticalGrid.OptionsView.ValueWidth); + ValueColumnsMap.AddLevel(-1, 0, MaxValueWidth); + AddMapRightSide(ValueColumnsMap, MaxValueWidth, MinValueWidth, False); + ValueColumnsMap.Build; +end; + +procedure TcxVerticalGridMapsInfo.DoCalculate; +begin + CalculateSize; + AlignCategories; +end; + +procedure TcxVerticalGridMapsInfo.DoWrite; +begin + Provider.SetRange(Size.cx, Size.cy, False); + WriteColumnWidths; + WriteValues; +end; + +function TcxVerticalGridMapsInfo.GetDisplayText(ARecordIndex: Integer; + ARow: TcxCustomEditorRowProperties): string; +begin + with ARow.DisplayEditProperties[ARecordIndex] do + begin + if GetEditValueSource(False) = evsValue then + Result := GetDisplayText(ARow.Values[ARecordIndex], True) + else + Result := ARow.DisplayTexts[ARecordIndex]; + end; +end; + +function TcxVerticalGridMapsInfo.GetDisplayValue(ARecordIndex: Integer; + ARow: TcxCustomEditorRowProperties): Variant; +var + AProperties: TcxCustomEditProperties; +begin + AProperties := ARow.DisplayEditProperties[ARecordIndex]; + if IsNativeFormatProperties(AProperties) then + Result := ARow.Values[ARecordIndex] + else + Result := AProperties.GetDisplayText(ARow.Values[ARecordIndex], True); +end; + +function TcxVerticalGridMapsInfo.GetMultiEditorRowProperties( + ARow: TcxCustomRow): TcxMultiEditorRowProperties; +begin + Result := TcxMultiEditorRowProperties( + TcxCustomMultiEditorRowAccess(ARow).FProperties); +end; + +function TcxVerticalGridMapsInfo.IsIncludeRow(ARow: TcxCustomRow): Boolean; +begin + Result := VerticalGrid.IsRowVisible(ARow); +end; + +function TcxVerticalGridMapsInfo.IsNativeFormatProperties( + AProperties: TcxCustomEditProperties): Boolean; +begin + Result := (AProperties is TcxDateEditProperties) or (AProperties is TcxCurrencyEditProperties) or + (AProperties is TcxSpinEditProperties) or (AProperties is TcxCalcEditProperties) or + (AProperties is TcxTimeEditProperties); +end; + +procedure TcxVerticalGridMapsInfo.SetCellStyle(ACol, ARow, W, AStyleIndex: Integer); +begin + with Provider do + SetCellStyleEx(ACol, ARow, 1, W, AStyleIndex); +end; + +procedure TcxVerticalGridMapsInfo.SetCellStyle(ACol, ARow, W: Integer; + const AStyle: TcxCacheCellStyle); +begin + with Provider do + SetCellStyleEx(ACol, ARow, 1, W, RegisterStyle(AStyle)); +end; + +procedure TcxVerticalGridMapsInfo.WriteColumnWidths; +var + I, J, AWidth, ACount: Integer; +begin + for I := 0 to HeaderColumnsMap.MaxColumnIndex do + begin + AWidth := HeaderColumnsMap.GetColumnWidth(I); + Provider.SetColumnWidth(I, AWidth); + end; + ACount := cxSetValue(RecordCount > FRecordsPerBand, FRecordsPerBand, + FLastBandRecords); + for J := 0 to ACount - 1 do + for I := 0 to ValueColumnsMap.MaxColumnIndex do + begin + AWidth := ValueColumnsMap.GetColumnWidth(I); + Provider.SetColumnWidth(FirstValuesColumn + + J * (ValueColumnsMap.MaxColumnIndex + 1) + I, AWidth); + end; +end; + +procedure TcxVerticalGridMapsInfo.WriteHeaders(ARowIndex: Integer); +var + I: Integer; +begin + for I := 0 to RowCount - 1 do + WriteRowHeader(ARowIndex + I, RowsIndents[I], RowsCaptions[I]); +end; + +procedure TcxVerticalGridMapsInfo.WriteRecord( + ACol, ARowIndex, ARecordIndex: Integer); +var + I, J: Integer; + ARow: TcxCustomRow; + + procedure WriteCell(ARowIndex: Integer; + AProperties: TcxCustomEditorRowProperties; ACellIndex: Integer); + var + AStart, AEnd: Integer; + AViewParams: TcxViewParams; + AStyle: TcxCacheCellStyle; + begin + ValueColumnsMap.GetColumnInfoFromRowCell(ARow, ACellIndex, AStart, AEnd); + AViewParams := VerticalGrid.Styles.GetContentParams(AProperties, False, ARecordIndex); + cxViewParamsToCacheStyle(AViewParams, AStyle); + AStyle.AlignText := AlignToCxAlign[TcxPropertiesAccess(AProperties.DisplayEditProperties[ARecordIndex]).Alignment.Horz]; + cxCheckBorders(AStyle, cxBordersAll, GridLineColor, GridLines); + SetCellStyle(ACol + AStart, ARowIndex, AEnd - AStart, AStyle); + WriteValue(ACol + AStart, ARowIndex, ARecordIndex, AProperties); + end; + +begin + for I := 0 to RowCount - 1 do + begin + ARow := Rows[I]; + if ARow is TcxCustomEditorRow then + WriteCell(ARowIndex + I, TcxCustomEditorRowAccess(ARow).Properties, 0) + else + if ARow is TcxCustomMultiEditorRow then + with GetMultiEditorRowProperties(ARow) do + for J := 0 to Editors.Count - 1 do + WriteCell(ARowIndex + I, Editors[J], J) + end; +end; + +procedure TcxVerticalGridMapsInfo.WriteRowCaptions(ARowIndex: Integer; + ACaptions: TcxRowCellsInfo); +var + I: Integer; +begin + with Provider do + for I := 0 to ACaptions.Count - 1 do + with ACaptions[I] do + begin + SetCellStyleEx(Column, ARowIndex, 1, Width, StyleIndex); + SetCellDataString(Column, ARowIndex, Caption); + end; +end; + +procedure TcxVerticalGridMapsInfo.WriteRowHeader(ARowIndex: Integer; + AIndents: TcxRowIndentsInfo; ACaptions: TcxRowCellsInfo); +const + PlusMinus: array[Boolean] of Char = ('+', '-'); +var + I: Integer; +begin + for I := 0 to AIndents.Count - 1 do + with AIndents.Indents[I] do + begin + if (I = 0) and AIndents.Row.HasVisibleChildren then + Provider.SetCellDataString(Column, ARowIndex, PlusMinus[AIndents.Row.Expanded]); + SetCellStyle(Column, ARowIndex, Width, StyleIndex); + end; + WriteRowCaptions(ARowIndex, ACaptions); +end; + +procedure TcxVerticalGridMapsInfo.WriteValue(ACol, ARow, ARecordIndex: Integer; + AProperties: TcxCustomEditorRowProperties); +begin + if IsEmpty then + Provider.SetCellDataString(ACol, ARow, '') + else + begin + if Owner.IsNativeFormat then + Provider.SetCellValue(ACol, ARow, GetDisplayValue(ARecordIndex, AProperties)) + else + Provider.SetCellDataString(ACol, ARow, GetDisplayText(ARecordIndex, AProperties)); + end; +end; + +procedure TcxVerticalGridMapsInfo.WriteValues; +var + I, J, ARow, ACol, ARecord: Integer; +begin + ARow := 0; + ARecord := 0; + for I := 0 to FBandCount - 1 do + begin + ACol := HeaderColumnsMap.MaxColumnIndex + 1; + WriteHeaders(ARow); + for J := 0 to FRecordsPerBand - 1 do + begin + WriteRecord(ACol + J * (ValueColumnsMap.MaxColumnIndex + 1), ARow, ARecord); + Inc(ARecord); + if ARecord = RecordCount then Exit; + end; + Inc(ARow, RowCount + 1); + Provider.SetRowHeight(ARow - 1, 8); + end; +end; + +function TcxVerticalGridMapsInfo.GetLevelIndent(Index: Integer): Integer; +begin + Result := FLevelIndents[Index]; +end; + +function TcxVerticalGridMapsInfo.GetProvider: IcxExportProvider; +begin + Result := FOwner.Provider; +end; + +function TcxVerticalGridMapsInfo.GetRow(Index: Integer): TcxCustomRow; +begin + Result := TcxCustomRow(FRows.List^[Index]); +end; + +{ TcxVerticalGridExportHelper } + +constructor TcxVerticalGridExportHelper.Create( + AVerticalGrid: TcxCustomVerticalGrid; AExportType: Integer; + const AFileName: string); + + function DefaultStyle: TcxCacheCellStyle; + var + I: Integer; + begin + cxViewParamsToCacheStyle(VerticalGrid.Styles.GetBackgroundParams, Result); + for I := 0 to 3 do + begin + Result.Borders[I].IsDefault := True; + Result.Borders[I].Width := 0; + end; + end; + +begin + FVerticalGrid := TcxVerticalGridAccess(AVerticalGrid); + TcxExport.Provider(AExportType, AFileName).GetInterface(IcxExportProvider, FProvider); + FProvider.SetDefaultStyle(DefaultStyle); + MapsInfo := GetMapsInfoClass.Create(Self); +end; + +destructor TcxVerticalGridExportHelper.Destroy; +begin + try + MapsInfo.Free; + FProvider := nil; + finally + inherited Destroy; + end; +end; + +procedure TcxVerticalGridExportHelper.DoCalculateTableMap; +begin + MapsInfo.DoCalculate; +end; + +procedure TcxVerticalGridExportHelper.DoWriteCells; +begin + MapsInfo.DoWrite; + Provider.Commit; +end; + +function TcxVerticalGridExportHelper.GetMapsInfoClass: TcxVerticalGridMapsInfoClass; +begin + Result := TcxVerticalGridMapsInfo; +end; + +// external procedures definition + +{$IFNDEF DELPHI6} +type + IInterface = IUnknown; +{$ENDIF} + +function cxSupports(const Instance: IInterface; const IID: TGUID; out Intf): Boolean; +begin + Result := (Instance <> nil) and (Instance.QueryInterface(IID, Intf) = 0); +end; + +procedure cxExportVGToFile(AFileName: string; + AVerticalGrid: TcxCustomVerticalGrid; AExportType: Integer; + AExpand, AUseNativeFormat: Boolean; const ASeparators: array of string; + ARecordPerBand: Integer; const AFileExt: string); +var + I: Integer; + AIntf: IcxExportWithSeparators; +begin + if AFileExt <> '' then + AFileName := ChangeFileExt(AFileName, '.' + AFileExt); + if not AVerticalGrid.Visible then + cxVerticalGridError(cxSvgExportNotVisibleControl); + with TcxVerticalGridExportHelper.Create(AVerticalGrid, AExportType, AFileName) do + try + FExpand := AExpand; + if AExpand then AVerticalGrid.FullExpand; + AVerticalGrid.FocusedRow := nil; + FRecordsPerBand := Max(ARecordPerBand, 1); + FIsNativeFormat := AUseNativeFormat; + if cxSupports(Provider, IcxExportWithSeparators, AIntf) and (Length(ASeparators) > 0) then + begin + for I := Low(ASeparators) to High(ASeparators) do + AIntf.AddSeparator(ASeparators[I]); + end; + DoCalculateTableMap; + DoWriteCells; + finally + Free; + end; +end; + +procedure cxExportVGToHTML(const AFileName: string; + AVerticalGrid: TcxCustomVerticalGrid; AExpand: Boolean = True; + ARecordPerBand: Integer = 8; const AFileExt: string = 'html'); +begin + cxExportVGToFile(AFileName, AVerticalGrid, cxExportToHtml, AExpand, False, [], + ARecordPerBand, AFileExt); +end; + +procedure cxExportVGToXML(const AFileName: string; + AVerticalGrid: TcxCustomVerticalGrid; AExpand: Boolean = True; + ARecordPerBand: Integer = 8; const AFileExt: string = 'xml'); +begin + cxExportVGToFile(AFileName, AVerticalGrid, cxExportToXML, AExpand, False, [], + ARecordPerBand, AFileExt); +end; + +procedure cxExportVGToExcel(const AFileName: string; + AVerticalGrid: TcxCustomVerticalGrid; AExpand: Boolean = True; + AUseNativeFormat: Boolean = True; + ARecordPerBand: Integer = 8; const AFileExt: string = 'xls'); +begin + cxExportVGToFile(AFileName, AVerticalGrid, cxExportToExcel, AExpand, + AUseNativeFormat, [], ARecordPerBand, AFileExt); +end; + +procedure cxExportVGToText(const AFileName: string; + AVerticalGrid: TcxCustomVerticalGrid; AExpand: Boolean = True; + const ASeparator: string = ''; const ABeginString: string = ''; + const AEndString: string = ''; ARecordPerBand: Integer = 8; + const AFileExt: string = 'txt'); +begin + cxExportVGToFile(AFileName, AVerticalGrid, cxExportToText, AExpand, False, + [ASeparator, ABeginString, AEndString], ARecordPerBand, AFileExt); +end; + +initialization + Move(cxIndentFontName[1], cxIndentStyle.FontName[0], Length(cxIndentFontName)); + cxExportInit(TcxGetResourceStringProc(@cxGetResourceString), @ColorToRGB, True ); +end. + diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxInsCur.res b/official/x.35/ExpressVerticalGrid/Sources/cxInsCur.res new file mode 100644 index 00000000..4866c97e Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Sources/cxInsCur.res differ diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxOI.pas b/official/x.35/ExpressVerticalGrid/Sources/cxOI.pas new file mode 100644 index 00000000..7fda5c2e --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxOI.pas @@ -0,0 +1,4367 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressVerticalGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSVERTICALGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxOI; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, TypInfo, +{$IFDEF DELPHI6} + RTLConsts, +{$ENDIF} + cxVGrid, cxEdit, cxInplaceContainer, cxGraphics, cxClasses; + +const + CN_PropertyChanged = WM_DX + 25; + +type + TcxPropertyEditor = class; + TcxRTTIInspectorController = class; + TcxCustomRTTIInspector = class; + + { TcxComponentList } + + TcxComponentList = class(TObject) + private + FList: TList; + function GetItem(Index: Integer): TPersistent; + function GetCount: Integer; + public + constructor Create; + destructor Destroy; override; + + function Add(Item: TPersistent): Integer; + function Equals(List: TcxComponentList): Boolean; + + property Count: Integer read GetCount; + property Items[Index: Integer]: TPersistent read GetItem; default; + end; + + TcxPropertyAttribute = + (ipaValueList, ipaSubProperties, ipaDialog, ipaMultiSelect, ipaAutoUpdate, + ipaSortList, ipaReadOnly, ipaRevertable); + TcxPropertyAttributes = set of TcxPropertyAttribute; + + TcxInstProp = record + Instance: TPersistent; + PropInfo: PPropInfo; + end; + + PcxInstPropList = ^TcxInstPropList; + TcxInstPropList = array[0..1023] of TcxInstProp; + + TcxGetPropEditProc = procedure(APropertyEditor: TcxPropertyEditor) of object; + + { TcxPropertyEditor } + + TcxPropertyEditor = class + private + FInspector: TcxCustomRTTIInspector; + FAncestorList: TList; + FPropCount: Integer; + FPropList: PcxInstPropList; + FOwner: TComponent; + FRoot: TComponent; + FAncestor: TPersistent; + FRootAncestor: TComponent; + FLookingFor: TComponent; + FDoneLooking: Boolean; + procedure AddAncestor(Component: TComponent); + procedure GetLookupInfo(var Ancestor: TPersistent; + var Root, LookupRoot, RootAncestor: TComponent); + procedure SetPropEntry(Index: Integer; AInstance: TPersistent; + APropInfo: PPropInfo); + procedure WriteComponentSimulation(Component: TComponent); + protected + procedure AdjustInnerEditProperties(AProperties: TcxCustomEditProperties); virtual; + function GetFloatValue: Extended; + function GetFloatValueAt(Index: Integer): Extended; + function GetInt64Value: Int64; + function GetInt64ValueAt(Index: Integer): Int64; + function GetOrdValue: Longint; + function GetOrdValueAt(Index: Integer): Longint; + function GetPropInfo: PPropInfo; + function GetStrValue: string; + function GetStrValueAt(Index: Integer): string; + function GetVarValue: Variant; + function GetVarValueAt(Index: Integer): Variant; + function FindRoot: TComponent; + procedure PostChangedNotification; + procedure SetFloatValue(Value: Extended); + procedure SetInt64Value(Value: Int64); + procedure SetOrdValue(Value: Longint); + procedure SetStrValue(const Value: string); + procedure SetVarValue(const Value: Variant); + + property Inspector: TcxCustomRTTIInspector read FInspector; + public + constructor Create(AOwner: TComponent; AInspector: TcxCustomRTTIInspector; + APropCount: Integer); + destructor Destroy; override; + + function AllEqual: Boolean; virtual; + procedure Edit; virtual; + function GetAttributes: TcxPropertyAttributes; virtual; + function GetComponent(Index: Integer): TPersistent; + function GetEditLimit: Integer; virtual; + function GetName: string; virtual; + procedure GetProperties(AOwner: TComponent; Proc: TcxGetPropEditProc); virtual; + function GetPropType: PTypeInfo; + function GetValue: string; virtual; + procedure GetValues(Proc: TGetStrProc); virtual; + procedure SetValue(const Value: string); virtual; + function IsDefaultValue: Boolean; virtual; + function ValueAvailable: Boolean; + + property PropCount: Integer read FPropCount; + property Value: string read GetValue write SetValue; + end; + + TcxPropertyEditorClass = class of TcxPropertyEditor; + + { TcxOrdinalProperty } + + TcxOrdinalProperty = class(TcxPropertyEditor) + function AllEqual: Boolean; override; + function GetEditLimit: Integer; override; + end; + + { TcxIntegerProperty } + + TcxIntegerProperty = class(TcxOrdinalProperty) + public + function GetValue: string; override; + procedure SetValue(const Value: string); override; + end; + + { TcxCharProperty } + + TcxCharProperty = class(TcxOrdinalProperty) + public + function GetValue: string; override; + procedure SetValue(const Value: string); override; + end; + + { TcxEnumProperty } + + TcxEnumProperty = class(TcxOrdinalProperty) + public + function GetAttributes: TcxPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + { TcxBoolProperty } + + TcxBoolProperty = class(TcxEnumProperty) + public + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + { TcxFloatProperty } + + TcxFloatProperty = class(TcxPropertyEditor) + public + function AllEqual: Boolean; override; + function GetValue: string; override; + procedure SetValue(const Value: string); override; + end; + + { TInt64Property } + + TcxInt64Property = class(TcxPropertyEditor) + public + function AllEqual: Boolean; override; + function GetEditLimit: Integer; override; + function GetValue: string; override; + procedure SetValue(const Value: string); override; + end; + + { TcxStringProperty} + + TcxStringProperty = class(TcxPropertyEditor) + public + function AllEqual: Boolean; override; + function GetEditLimit: Integer; override; + function GetValue: string; override; + procedure SetValue(const Value: string); override; + end; + + { TcxSetElementProperty } + + TcxSetElementProperty = class(TcxPropertyEditor) + private + FElement: Integer; + constructor Create(APropList: PcxInstPropList; APropCount: Integer; AElement: Integer); + public + destructor Destroy; override; + function AllEqual: Boolean; override; + function GetAttributes: TcxPropertyAttributes; override; + function GetName: string; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + function IsDefaultValue: Boolean; override; + end; + + { TcxSetProperty } + + TcxSetProperty = class(TcxOrdinalProperty) + public + function GetAttributes: TcxPropertyAttributes; override; + procedure GetProperties(AOwner: TComponent; Proc: TcxGetPropEditProc); override; + function GetValue: string; override; + end; + + { TcxClassProperty } + + TcxClassProperty = class(TcxPropertyEditor) + public + function GetAttributes: TcxPropertyAttributes; override; + procedure GetProperties(AOwner: TComponent; Proc: TcxGetPropEditProc); override; + function GetValue: string; override; + end; + + { TcxComponentProperty } + + TcxComponentProperty = class(TcxPropertyEditor) + private + function GetFullName(AComponent: TComponent): string; + protected + function IsValidComponent(AComponent: TComponent): Boolean; virtual; + public + function GetAttributes: TcxPropertyAttributes; override; + function GetEditLimit: Integer; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + { TcxComponentNameProperty } + + TcxComponentNameProperty = class(TcxStringProperty) + public + function GetAttributes: TcxPropertyAttributes; override; + function GetEditLimit: Integer; override; + end; + + { TcxFontNameProperty } + + TcxFontNameProperty = class(TcxStringProperty) + public + function GetAttributes: TcxPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + end; + + { TcxFontCharsetProperty } + + TcxFontCharsetProperty = class(TcxIntegerProperty) + public + function GetAttributes: TcxPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + { TcxImeNameProperty } + + TcxImeNameProperty = class(TcxStringProperty) + public + function GetAttributes: TcxPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + end; + + { TColorProperty } + + TcxColorProperty = class(TcxIntegerProperty) + public + procedure Edit; override; + function GetAttributes: TcxPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + end; + + { TcxCursorProperty } + + TcxCursorProperty = class(TcxIntegerProperty) + public + function GetAttributes: TcxPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + { TcxFontProperty } + + TcxFontProperty = class(TcxClassProperty) + public + procedure Edit; override; + function GetAttributes: TcxPropertyAttributes; override; + end; + + { TcxStringsProperty } + + TcxStringsProperty = class(TcxClassProperty) + public + procedure Edit; override; + function GetAttributes: TcxPropertyAttributes; override; + end; + + { TcxGraphicProperty } + + TcxGraphicProperty = class(TcxClassProperty) + private + function HasGraphic: Boolean; + protected + function GetGraphic: TGraphic; virtual; + procedure SetGraphic(Value: TGraphic); virtual; + + function GetClipboardFormat: Word; virtual; + function GetGraphicFilter: string; virtual; + function GraphicClass: TGraphicClass; + public + procedure Edit; override; + function GetAttributes: TcxPropertyAttributes; override; + function GetValue: string; override; + procedure SetValue(const Value: string); override; + end; + + { TcxPictureProperty } + + TcxPictureProperty = class(TcxGraphicProperty) + protected + function GetGraphic: TGraphic; override; + procedure SetGraphic(Value: TGraphic); override; + end; + + { TcxModalResultProperty } + + TcxModalResultProperty = class(TcxIntegerProperty) + public + function GetAttributes: TcxPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + { TcxShortCutProperty } + + TcxShortCutProperty = class(TcxOrdinalProperty) + public + function GetAttributes: TcxPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + { TcxMPFilenameProperty } + + TcxMPFilenameProperty = class(TcxStringProperty) + public + procedure Edit; override; + function GetAttributes: TcxPropertyAttributes; override; + end; + + { TcxTabOrderProperty } + + TcxTabOrderProperty = class(TcxIntegerProperty) + public + function GetAttributes: TcxPropertyAttributes; override; + end; + + { TCaptionProperty } + + TcxCaptionProperty = class(TcxStringProperty) + public + function GetAttributes: TcxPropertyAttributes; override; + end; + + { TcxDateProperty } + + TcxDateProperty = class(TcxPropertyEditor) + public + function GetAttributes: TcxPropertyAttributes; override; + function GetValue: string; override; + procedure SetValue(const Value: string); override; + end; + + { TcxTimeProperty } + + TcxTimeProperty = class(TcxPropertyEditor) + public + function GetAttributes: TcxPropertyAttributes; override; + function GetValue: string; override; + procedure SetValue(const Value: string); override; + end; + + { TcxDateTimeProperty } + + TcxDateTimeProperty = class(TcxPropertyEditor) + public + function GetAttributes: TcxPropertyAttributes; override; + function GetValue: string; override; + procedure SetValue(const Value: string); override; + end; + + { TcxVariantProperty } + + TcxVariantProperty = class(TcxPropertyEditor) + function GetAttributes: TcxPropertyAttributes; override; + procedure GetProperties(AOwner: TComponent; Proc: TcxGetPropEditProc); override; + function GetValue: string; override; + procedure SetValue(const Value: string); override; + end; + + // the support DevExpress editor's properties + + { TcxEditPropertiesProperty } + + TcxEditPropertiesProperty = class(TcxClassProperty) + protected + function HasSubProperties: Boolean; + public + function GetAttributes: TcxPropertyAttributes; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + + EcxPropertyError = class(Exception); + + { TcxPropertyRow } + + TcxPropertyRow = class(TcxEditorRow) + private + FIsDefaultValue: Boolean; + FPropertyEditor: TcxPropertyEditor; + public + property IsDefaultValue: Boolean read FIsDefaultValue; + property PropertyEditor: TcxPropertyEditor read FPropertyEditor; + end; + + { TcxRTTIInspectorEditingController } + + TcxRTTIInspectorEditingController = class(TcxEditingController) + private + FDeactivating: Boolean; + function GetController: TcxRTTIInspectorController; + function GetInspector: TcxCustomRTTIInspector; + protected + property Controller: TcxRTTIInspectorController read GetController; + property Deactivating: Boolean read FDeactivating; + property Inspector: TcxCustomRTTIInspector read GetInspector; + public + procedure HideEdit(Accept: Boolean); override; + end; + + { TcxRTTIInspectorController } + + TcxRTTIInspectorController = class(TcxvgController) + private + FFocusChanging: Boolean; + FNeedCorrect: Boolean; + function GetEditingController: TcxRTTIInspectorEditingController; + function GetFocusedRowIndex: Integer; + function GetInspector: TcxCustomRTTIInspector; + function GetRowIndexFromCellEdit(Value: TcxCustomInplaceEditContainer): Integer; + procedure SetFocusedRowIndex(AIndex: Integer); + protected + procedure BeforeEditKeyDown(var Key: Word; var Shift: TShiftState); override; + procedure DoEditDblClick(Sender: TObject); override; + procedure DoUpdateRowAndCell(ANewRow: TcxCustomRow; ANewCellIndex: Integer); override; + procedure FocusChanged; override; + function IsKeyForController(AKey: Word; AShift: TShiftState): Boolean; override; + procedure SetFocusedItem(Value: TcxCustomInplaceEditContainer); override; + procedure SetFocusedRowAndCell(Value: TcxCustomRow; ACellIndex: Integer); override; + public + procedure SetFocusedRecordItem(ARecordIndex: Integer; + AItem: TcxCustomInplaceEditContainer); override; + property EditingController: TcxRTTIInspectorEditingController read GetEditingController; + property Inspector: TcxCustomRTTIInspector read GetInspector; + end; + + { TcxRTTIInspectorOptionsView } + + TcxRTTIInspectorOptionsView = class(TcxvgOptionsView) + public + constructor Create(AOwner: TPersistent); override; + published + property PaintStyle default psDelphi; + property ShowEditButtons default ecsbFocused; + end; + + { TcxRTTIInspectorOptionsBehavior } + + TcxRTTIInspectorOptionsBehavior = class(TcxvgOptionsBehavior) + public + constructor Create(AOwner: TPersistent); override; + published + property AlwaysShowEditor default True; + end; + + { TcxCustomRTTIInspector } + IcxRTTIInspectorHelper = interface + ['{EA7182FA-139D-4525-9C5F-4D8BBAB5FEEE}'] + procedure CloseNonModal(AInspector: TcxCustomRTTIInspector); + procedure PropertyChanged(AInspector: TcxCustomRTTIInspector); + end; + + TcxFilterPropertyEvent = procedure(Sender: TObject; const PropertyName: string; + var Accept: Boolean) of object; + + TcxCustomRTTIInspector = class(TcxUnboundVerticalGrid) + private + FBoldFont: TFont; + FCurrentRow: TcxPropertyRow; + FListeners: TList; + FLockRefresh: Boolean; + FInspectedObject: TPersistent; + FParentRow: TcxCustomRow; + FReloaded: Boolean; + FSaveTopRowIndex: Integer; + FSettingValue: Boolean; + FOnFilterProperty: TcxFilterPropertyEvent; + FOnFilterPropertyEx: TcxFilterPropertyEvent; + FOnPropertyChanged: TNotifyEvent; + function CanInvokePropertyEditorDlg: Boolean; + procedure CNPropertyChanged(var AMessage: TMsg); message CN_PropertyChanged; + procedure CreatePropertyRows(AOldInspectedObject: TPersistent); + procedure CreateRows(APropertyEditor: TcxPropertyEditor); + procedure GetComponentsProperties(const AInstances: array of TPersistent); + function GetController: TcxRTTIInspectorController; + function GetPropertyEditor: TcxPropertyEditor; + procedure GetStrProc(const S: string); + procedure ReleaseComponentProperties; + procedure RowButtonClick(Sender: TObject; AbsoluteIndex: Integer); + procedure SetInspectedObject(Value: TPersistent); + procedure TryInvokePropertyEditorDlg; + function TrySetValue(AEdit: TcxCustomEdit; AUseText: Boolean): Boolean; + protected + //override VCL + function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; override; + procedure FontChanged; override; + procedure Loaded; override; + procedure Notification(AComponent: TComponent; AOperation: TOperation); override; + procedure DataChanged; override; + procedure DoPropertyChanged; + procedure EditChange(Sender: TObject); + procedure EditValueChanged(Sender: TObject); + function GetControllerClass: TcxCustomControlControllerClass; override; + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + function GetEditingControllerClass: TcxEditingControllerClass; override; + function GetOptionsBehaviorClass: TcxControlOptionsBehaviorClass; override; + function GetOptionsViewClass: TcxControlOptionsViewClass; override; + + function FilterProperty(const APropertyName: string): Boolean; virtual; + function FilterPropertyEx(const AFullPropertyName: string): Boolean; virtual; + function FindRowByPropertyName(const APropertyName: string): TcxPropertyRow; + procedure FocusRowByPropertyName(const APropertyName: string); + function GetEditPropertiesClass(APropertyEditor: TcxPropertyEditor): TcxCustomEditPropertiesClass; virtual; + procedure PostChangedNotification; + procedure PrepareEditProperties(AProperties: TcxCustomEditProperties; APropertyEditor: TcxPropertyEditor); virtual; + + property Controller: TcxRTTIInspectorController read GetController; + property PropertyEditor: TcxPropertyEditor read GetPropertyEditor; + property Reloaded: Boolean read FReloaded; + property LockRefresh: Boolean read FLockRefresh; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure AddListener(AListener: TPersistent); + procedure CloseNonModalEditors; + procedure RefreshInspectedProperties; + procedure RemoveListener(AListener: TPersistent); + property InspectedObject: TPersistent read FInspectedObject write SetInspectedObject; + property OnFilterProperty: TcxFilterPropertyEvent read FOnFilterProperty write FOnFilterProperty; + property OnFilterPropertyEx: TcxFilterPropertyEvent read FOnFilterPropertyEx write FOnFilterPropertyEx; + property OnPropertyChanged: TNotifyEvent read FOnPropertyChanged write FOnPropertyChanged; + end; + + { TcxRTTIInspector } + + TcxRTTIInspector = class(TcxCustomRTTIInspector) + published + property Align; + property Anchors; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property Font; + property Images; + property InspectedObject; + property LayoutStyle; + property LookAndFeel; + property OptionsView; //before OptionsBehavior + property OptionsBehavior; + property OptionsData; + property ParentFont; + property PopupMenu; + property Styles; + property TabOrder; + property TabStop; + property Visible; + + property OnClick; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnDrawBackground; + property OnDrawRowHeader; + property OnDrawValue; + property OnEdited; + property OnEditing; + property OnEditValueChanged; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnFilterProperty; + property OnFilterPropertyEx; + property OnItemChanged; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnLayoutChanged; + property OnLeftVisibleBandIndexChanged; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnMouseWheel; + property OnMouseWheelDown; + property OnMouseWheelUp; + property OnPropertyChanged; + property OnResize; + property OnStartDock; + property OnStartDrag; + property OnTopRowIndexChanged; + end; + +procedure cxRegisterPropertyEditor(APropertyType: PTypeInfo; AComponentClass: TClass; + const APropertyName: string; AEditorClass: TcxPropertyEditorClass); + +type + TcxPropertyMapperFunc = function(Obj: TPersistent; PropInfo: PPropInfo): TcxPropertyEditorClass; + +procedure cxRegisterPropertyMapper(AMapper: TcxPropertyMapperFunc); +procedure cxGetComponentProperties(AOwner: TComponent; + AInspector: TcxCustomRTTIInspector; AComponents: TcxComponentList; + AFilter: TTypeKinds; AProc: TcxGetPropEditProc); + +function cxGetPropertiesClassByEditor(APropertyEditor: TcxPropertyEditor): TcxCustomEditPropertiesClass; +procedure cxRegisterEditPropertiesClass(AEditorClass: TcxPropertyEditorClass; AEditPropertiesClass: TcxCustomEditPropertiesClass); +function HasProperty(AClass: TClass; const APropertyName: string): Boolean; +function IsUniquePropertyRelativeTo(AClass, ARelativeClass: TClass; const APropertyName: string): Boolean; +function IsUniquePropertyRelativeParent(AClass: TClass; const APropertyName: string): Boolean; + +function IsValidInspectedObject(AObject: TPersistent; AInspector: TcxCustomRTTIInspector): Boolean; + +procedure cxDotNetInspectObject(AObject: TPersistent; AInspector: TcxRTTIInspector); + +implementation + +uses + Menus, Clipbrd, Dialogs, Consts, Registry, MPlayer, + cxOIStringsEd, cxOIPictureEd, cxOICollectionEd, cxColorComboBox, +{$IFDEF DELPHI6} + Variants, +{$ELSE} + cxVariants, +{$ENDIF} + cxTextEdit, cxDropDownEdit, cxCalendar, cxSpinEdit, cxTimeEdit, cxButtonEdit, + cxControls, cxCustomData, cxGeometry, cxVGridConsts; + +const + cxSString = 'String'; + cxSNull = '(Null)'; + cxSUnassigned = '(Unassigned)'; + +type + TcxCustomRowAccess = class(TcxCustomRow); + TcxCustomEditPropertiesAccess = class(TcxCustomEditProperties); + TcxEditCellViewInfoAccess = class(TcxEditCellViewInfo); + TcxColorComboBoxPropertiesAccess = class(TcxColorComboBoxProperties); +{$IFNDEF DELPHI6} + IInterface = IUnknown; +{$ENDIF} + + TcxIntegerSet = set of 0..SizeOf(Integer) * 8 - 1; + + TcxPropertyClassRec = class + Group: Integer; + PropertyType: PTypeInfo; + PropertyName: string; + ComponentClass: TClass; + EditorClass: TcxPropertyEditorClass; + end; + + TcxPropertyMapperRec = class + Group: Integer; + Mapper: TcxPropertyMapperFunc; + end; + + TcxEditPropertiesMapperRec = class + EditorClass: TcxPropertyEditorClass; + EditPropertiesClass: TcxCustomEditPropertiesClass; + end; + + TcxInspectedObjectPropertyEditor = class(TcxComponentProperty) + protected + function IsValidComponent(AComponent: TComponent): Boolean; override; + end; + +const + cxPropClassMap: array[TTypeKind] of TcxPropertyEditorClass = ( + nil, TcxIntegerProperty, TcxCharProperty, TcxEnumProperty, + TcxFloatProperty, TcxStringProperty, TcxSetProperty, TcxClassProperty, + nil, TcxPropertyEditor, TcxStringProperty, TcxStringProperty, + TcxPropertyEditor, nil, nil, nil, TcxInt64Property, nil); + +var + FPropertyClasses: TList = nil; + FPropertyMappers: TList = nil; + FEditPropertiesClasses: TList = nil; + +{$IFNDEF DELPHI5} +function SameText(const S1, S2: string): Boolean; assembler; +asm + CMP EAX,EDX + JZ @1 + OR EAX,EAX + JZ @2 + OR EDX,EDX + JZ @3 + MOV ECX,[EAX-4] + CMP ECX,[EDX-4] + JNE @3 + CALL CompareText + TEST EAX,EAX + JNZ @3 +@1: MOV AL,1 +@2: RET +@3: XOR EAX,EAX +end; +{$ENDIF} + +function HasProperty(AClass: TClass; const APropertyName: string): Boolean; +var + TypeKinds: TTypeKinds; + PropCount: Integer; + PropList: PPropList; + I: Integer; +begin + TypeKinds := tkProperties; + PropCount := GetPropList(AClass.ClassInfo, TypeKinds, nil); + if PropCount > 0 then + begin + PropList := AllocMem(PropCount * SizeOf(PPropInfo)); + try + PropCount := GetPropList(AClass.ClassInfo, TypeKinds, PropList); + I := 0; + while (I < PropCount) and (CompareText(PropList^[I].Name, APropertyName) <> 0) do + Inc(I); + Result := I < PropCount; + finally + FreeMem(PropList, PropCount * SizeOf(PPropInfo)); + end; + end + else + Result := False; +end; + +function IsUniquePropertyRelativeTo(AClass, ARelativeClass: TClass; const APropertyName: string): Boolean; +begin + Result := HasProperty(AClass, APropertyName) and + ((ARelativeClass = nil) or not HasProperty(ARelativeClass, APropertyName)); +end; + +function IsUniquePropertyRelativeParent(AClass: TClass; const APropertyName: string): Boolean; +begin + Result := IsUniquePropertyRelativeTo(AClass, AClass.ClassParent, APropertyName); +end; + +function IsValidInspectedObject(AObject: TPersistent; AInspector: TcxCustomRTTIInspector): Boolean; +begin + Result := AObject <> AInspector; + if Result and (AObject is TcxCustomRTTIInspector) then + Result := IsValidInspectedObject(TcxCustomRTTIInspector(AObject).InspectedObject, AInspector); +end; + +{ TComponentList } + +constructor TcxComponentList.Create; +begin + inherited Create; + FList := TList.Create; +end; + +destructor TcxComponentList.Destroy; +begin + FList.Free; + inherited Destroy; +end; + +function TcxComponentList.GetItem(Index: Integer): TPersistent; +begin + Result := FList[Index]; +end; + +function TcxComponentList.GetCount: Integer; +begin + Result := FList.Count; +end; + +function TcxComponentList.Add(Item: TPersistent): Integer; +begin + Result := FList.Add(Item); +end; + +function TcxComponentList.Equals(List: TcxComponentList): Boolean; +var + I: Integer; +begin + Result := False; + if List.Count <> FList.Count then Exit; + for I := 0 to List.Count - 1 do + if List[I] <> FList[I] then Exit; + Result := True; +end; + +function cxGetPropertiesClassByEditor(APropertyEditor: TcxPropertyEditor): TcxCustomEditPropertiesClass; +var + I: Integer; + Item: TcxEditPropertiesMapperRec; +begin + Result := nil; + if FEditPropertiesClasses <> nil then + for I := 0 to FEditPropertiesClasses.Count - 1 do + begin + Item := TcxEditPropertiesMapperRec(FEditPropertiesClasses[I]); + if Item.EditorClass.InheritsFrom(APropertyEditor.ClassType) then + Result := Item.EditPropertiesClass; + if Item.EditorClass = APropertyEditor.ClassType then + Exit; + end; +end; + +procedure cxRegisterEditPropertiesClass( + AEditorClass: TcxPropertyEditorClass; + AEditPropertiesClass: TcxCustomEditPropertiesClass); +var + Item: TcxEditPropertiesMapperRec; +begin + if FEditPropertiesClasses = nil then FEditPropertiesClasses := TList.Create; + Item := TcxEditPropertiesMapperRec.Create; + Item.EditorClass := AEditorClass; + Item.EditPropertiesClass := AEditPropertiesClass; + FEditPropertiesClasses.Insert(0, Item); +end; + +procedure ListFreeAndNil(var List: TList); +var + I: Integer; +begin + if List <> nil then + begin + for I := 0 to List.Count - 1 do + TObject(List[I]).Free; + List.Free; + List := nil; + end; +end; + +{ TcxPropertyEditor } + +constructor TcxPropertyEditor.Create(AOwner: TComponent; + AInspector: TcxCustomRTTIInspector; APropCount: Integer); +begin + GetMem(FPropList, APropCount * SizeOf(TcxInstProp)); + FInspector := AInspector; + FPropCount := APropCount; + FOwner := AOwner; +end; + +destructor TcxPropertyEditor.Destroy; +begin + if FPropList <> nil then + FreeMem(FPropList, FPropCount * SizeOf(TcxInstProp)); + inherited Destroy; +end; + +function TcxPropertyEditor.AllEqual: Boolean; +begin + Result := FPropCount = 1; +end; + +procedure TcxPropertyEditor.Edit; +type + TcxGetStrFunc = function(const Value: string): Integer of object; +var + I: Integer; + Values: TStringList; + AddValue: TcxGetStrFunc; +begin + Values := TStringList.Create; + Values.Sorted := ipaSortList in GetAttributes; + try + AddValue := Values.Add; + GetValues(TGetStrProc(AddValue)); + if Values.Count > 0 then + begin + I := Values.IndexOf(Value) + 1; + if I = Values.Count then I := 0; + Value := Values[I]; + end; + finally + Values.Free; + end; +end; + +function TcxPropertyEditor.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaMultiSelect, ipaRevertable]; +end; + +function TcxPropertyEditor.GetComponent(Index: Integer): TPersistent; +begin + Result := FPropList^[Index].Instance; +end; + +function TcxPropertyEditor.GetFloatValue: Extended; +begin + Result := GetFloatValueAt(0); +end; + +function TcxPropertyEditor.GetFloatValueAt(Index: Integer): Extended; +begin + with FPropList^[Index] do + Result := GetFloatProp(Instance, PropInfo); +end; + +function TcxPropertyEditor.GetInt64Value: Int64; +begin + Result := GetInt64ValueAt(0); +end; + +function TcxPropertyEditor.GetInt64ValueAt(Index: Integer): Int64; +begin + with FPropList^[Index] do + Result := GetInt64Prop(Instance, PropInfo); +end; + +function TcxPropertyEditor.GetEditLimit: Integer; +begin + Result := 255; +end; + +function TcxPropertyEditor.GetName: string; +begin + Result := FPropList^[0].PropInfo^.Name; +end; + +function TcxPropertyEditor.GetOrdValue: Longint; +begin + Result := GetOrdValueAt(0); +end; + +function TcxPropertyEditor.GetOrdValueAt(Index: Integer): Longint; +begin + with FPropList^[Index] do + Result := GetOrdProp(Instance, PropInfo); +end; + +procedure TcxPropertyEditor.GetProperties(AOwner: TComponent; Proc: TcxGetPropEditProc); +begin +end; + +procedure TcxPropertyEditor.AdjustInnerEditProperties( + AProperties: TcxCustomEditProperties); +begin +end; + +function TcxPropertyEditor.GetPropInfo: PPropInfo; +begin + Result := FPropList^[0].PropInfo; +end; + +function TcxPropertyEditor.GetPropType: PTypeInfo; +begin + Result := FPropList^[0].PropInfo^.PropType^; +end; + +function TcxPropertyEditor.GetStrValue: string; +begin + Result := GetStrValueAt(0); +end; + +function TcxPropertyEditor.GetStrValueAt(Index: Integer): string; +begin + with FPropList^[Index] do + Result := GetStrProp(Instance, PropInfo); +end; + +function TcxPropertyEditor.GetVarValue: Variant; +begin + Result := GetVarValueAt(0); +end; + +function TcxPropertyEditor.GetVarValueAt(Index: Integer): Variant; +begin + with FPropList^[Index] do + Result := GetVariantProp(Instance, PropInfo); +end; + +function TcxPropertyEditor.GetValue: string; +begin + Result := srUnknown; +end; + +procedure TcxPropertyEditor.GetValues(Proc: TGetStrProc); +begin +end; + +function TcxPropertyEditor.FindRoot: TComponent; +begin + Result := FOwner; +end; + +procedure TcxPropertyEditor.PostChangedNotification; +begin + Inspector.PostChangedNotification; +end; + +procedure TcxPropertyEditor.SetFloatValue(Value: Extended); +var + I: Integer; +begin + for I := 0 to FPropCount - 1 do + with FPropList^[I] do + SetFloatProp(Instance, PropInfo, Value); +end; + +procedure TcxPropertyEditor.SetInt64Value(Value: Int64); +var + I: Integer; +begin + for I := 0 to FPropCount - 1 do + with FPropList^[I] do + SetInt64Prop(Instance, PropInfo, Value); +end; + +procedure TcxPropertyEditor.SetOrdValue(Value: Longint); +var + I: Integer; +begin + for I := 0 to FPropCount - 1 do + with FPropList^[I] do + SetOrdProp(Instance, PropInfo, Value); +end; + +procedure TcxPropertyEditor.SetStrValue(const Value: string); +var + I: Integer; +begin + for I := 0 to FPropCount - 1 do + with FPropList^[I] do + SetStrProp(Instance, PropInfo, Value); +end; + +procedure TcxPropertyEditor.SetVarValue(const Value: Variant); +var + I: Integer; +begin + for I := 0 to FPropCount - 1 do + with FPropList^[I] do + SetVariantProp(Instance, PropInfo, Value); +end; + +procedure TcxPropertyEditor.SetValue(const Value: string); +begin +end; + +function AncestorIsValid(Ancestor: TPersistent; Root, RootAncestor: TComponent): Boolean; +begin + Result := (Ancestor <> nil) and (RootAncestor <> nil) and + Root.InheritsFrom(RootAncestor.ClassType); +end; + +{$IFNDEF DELPHI6} +type + IInterfaceComponentReference = interface + ['{E28B1858-EC86-4559-8FCD-6B4F824151ED}'] + function GetComponent: TComponent; + end; + +function VarSameValue(const A, B: Variant): Boolean; +var + LA, LB: TVarData; +begin + LA := FindVarData(A)^; + LB := FindVarData(B)^; + if LA.VType = varEmpty then + Result := LB.VType = varEmpty + else if LA.VType = varNull then + Result := LB.VType = varNull + else if LB.VType in [varEmpty, varNull] then + Result := False + else + Result := A = B; +end; + +function VarIsClear(const V: Variant): Boolean; +var + LVarData: TVarData; +begin + LVarData := FindVarData(V)^; + with LVarData do + Result := (VType = varEmpty) or + (((VType = varDispatch) or (VType = varUnknown)) and (VDispatch = nil)); +end; + +function GetInterfaceProp(Instance: TObject; PropInfo: PPropInfo): IInterface; +type + TInterfaceGetProc = function :IInterface of object; + TInterfaceIndexedGetProc = function (Index: Integer): IInterface of object; +var + P: ^IInterface; + M: TMethod; + Getter: Longint; +begin + Getter := Longint(PropInfo^.GetProc); + if (Getter and $FF000000) = $FF000000 then + begin // field - Getter is the field's offset in the instance data + P := Pointer(Integer(Instance) + (Getter and $00FFFFFF)); + Result := P^; // auto ref count + end + else + begin + if (Getter and $FF000000) = $FE000000 then + // virtual method - Getter is a signed 2 byte integer VMT offset + M.Code := Pointer(PInteger(PInteger(Instance)^ + SmallInt(Getter))^) + else + // static method - Getter is the actual address + M.Code := Pointer(Getter); + + M.Data := Instance; + if PropInfo^.Index = Integer($80000000) then // no index + Result := TInterfaceGetProc(M)() + else + Result := TInterfaceIndexedGetProc(M)(PropInfo^.Index); + end; +end; + +function GetObjectProp(Instance: TObject; PropInfo: PPropInfo): TObject; +begin + Result := TObject(GetOrdProp(Instance, PropInfo)); +end; + +function GetWideStrProp(Instance: TObject; PropInfo: PPropInfo): WideString; +type + TWideStringGetProc = function :WideString of object; + TWideStringIndexedGetProc = function (Index: Integer): WideString of object; +var + P: PWideString; + M: TMethod; + Getter: Longint; +begin + case PropInfo^.PropType^.Kind of + tkString, + tkLString: Result := GetStrProp(Instance, PropInfo); + tkWString: + begin + Getter := Longint(PropInfo^.GetProc); + if (Getter and $FF000000) = $FF000000 then + begin // field - Getter is the field's offset in the instance data + P := Pointer(Integer(Instance) + (Getter and $00FFFFFF)); + Result := P^; // auto ref count + end + else + begin + if (Getter and $FF000000) = $FE000000 then + // virtual method - Getter is a signed 2 byte integer VMT offset + M.Code := Pointer(PInteger(PInteger(Instance)^ + SmallInt(Getter))^) + else + // static method - Getter is the actual address + M.Code := Pointer(Getter); + + M.Data := Instance; + if PropInfo^.Index = Integer($80000000) then // no index + Result := TWideStringGetProc(M)() + else + Result := TWideStringIndexedGetProc(M)(PropInfo^.Index); + end; + end; + else + Result := ''; + end; +end; +{$ENDIF} + +{$IFNDEF DELPHI7} +type + TGetLookupInfoEvent = procedure(var Ancestor: TPersistent; + var Root, LookupRoot, RootAncestor: TComponent) of object; + +function IsDefaultPropertyValue(Instance: TObject; PropInfo: PPropInfo; + OnGetLookupInfo: TGetLookupInfoEvent): Boolean; +var + PropType: PTypeInfo; + Ancestor: TPersistent; + LookupRoot: TComponent; + RootAncestor: TComponent; + Root: TComponent; + AncestorValid: Boolean; + + function IsDefaultOrdProp: Boolean; + var + Value: Longint; + Default: LongInt; + begin + Value := GetOrdProp(Instance, PropInfo); + if AncestorValid then + Result := Value = GetOrdProp(Ancestor, PropInfo) + else + begin + Default := PPropInfo(PropInfo)^.Default; + Result := (Default <> LongInt($80000000)) and (Value = Default); + end; + end; + + function IsDefaultFloatProp: Boolean; + var + Value: Extended; + begin + Value := GetFloatProp(Instance, PropInfo); + if AncestorValid then + Result := Value = GetFloatProp(Ancestor, PropInfo) + else + Result := Value = 0;; + end; + + function IsDefaultInt64Prop: Boolean; + var + Value: Int64; + begin + Value := GetInt64Prop(Instance, PropInfo); + if AncestorValid then + Result := Value = GetInt64Prop(Ancestor, PropInfo) + else + Result := Value = 0; + end; + + function IsDefaultStrProp: Boolean; + var + Value: WideString; + begin + Value := GetWideStrProp(Instance, PropInfo); + if AncestorValid then + Result := Value = GetWideStrProp(Ancestor, PropInfo) + else + Result := Value = ''; + end; + + function ObjectAncestorMatch(AncestorValue, Value: TComponent): Boolean; + begin + Result := (AncestorValue <> nil) and (AncestorValue.Owner = RootAncestor) and + (Value <> nil) and (Value.Owner = Root) and + SameText(AncestorValue.Name, Value.Name); + end; + + function IsDefaultObjectProp: Boolean; + var + Value: TObject; + + function IsDefault: Boolean; + var + AncestorValue: TObject; + begin + AncestorValue := nil; + if AncestorValid then + begin + AncestorValue := TObject(GetOrdProp(Ancestor, PropInfo)); + if ObjectAncestorMatch(TComponent(AncestorValue), TComponent(Value)) then + AncestorValue := Value; + end; + Result := Value = AncestorValue; + end; + + begin + Result := True; + Value := TObject(GetOrdProp(Instance, PropInfo)); + if (Value = nil) and not IsDefault then + begin + Result := False; // nil wasn't the "default" value + end + else if Value is TPersistent then + begin + {$IFDEF DELPHI6} + if (Value is TComponent) and + not (csSubComponent in TComponent(Value).ComponentStyle) then + begin + if not IsDefault then + begin + // A non sub-component TComponent is only non-default if + // it actually has a name (that way, it can be streamed out - + // it can't be streamed without a name). + if TComponent(Value).Name <> '' then + Result := False; + end + end + else + {$ENDIF} + Result := False; // The TPersistent should be checked for default's by the caller + end; + end; + + function IsDefaultInterfaceProp: Boolean; + var + Intf: IInterface; + Value: TComponent; + + function IsDefaultValue: Boolean; + var + AncestorIntf: IInterface; + ASR: IInterfaceComponentReference; + begin + Result := Intf = nil; + if AncestorValid then + begin + AncestorIntf := GetInterfaceProp(Ancestor, PropInfo); + Result := Intf = AncestorIntf; + if not Result then + begin + if Supports(AncestorIntf, IInterfaceComponentReference, ASR) then + Result := ObjectAncestorMatch(ASR.GetComponent, Value); + end; + end; + end; + + var + SR: IInterfaceComponentReference; + begin + Result := True; + Intf := GetInterfaceProp(Instance, PropInfo); + if (Intf = nil) or (not Supports(Intf, IInterfaceComponentReference, SR)) then + begin + if AncestorValid and (GetInterfaceProp(Ancestor, PropInfo) <> nil) then + Result := False; + end + else + begin + Value := SR.GetComponent; + if not IsDefaultValue then + begin + // We can only stream out components (ie: non-default ones) + // if they actually have a name + if Value.Name <> '' then + Result := False; + end; + end; + end; + + function IsDefaultMethodProp: Boolean; + var + Value: TMethod; + DefaultCode: Pointer; + begin + Value := GetMethodProp(Instance, PropInfo); + DefaultCode := nil; + if AncestorValid then + DefaultCode := GetMethodProp(Ancestor, PropInfo).Code; + Result := (Value.Code = DefaultCode) or + ((Value.Code <> nil) and (LookupRoot.MethodName(Value.Code) = '')); + end; + + function IsDefaultVariantProp: Boolean; + var + Value: Variant; + begin + Value := GetVariantProp(Instance, PropInfo); + if AncestorValid then + Result := VarSameValue(Value, GetVariantProp(Ancestor, PropInfo)) + else + Result := VarIsClear(Value); + end; + +begin + Ancestor := nil; + Root := nil; + LookupRoot := nil; + RootAncestor := nil; + + if Assigned(OnGetLookupInfo) then + OnGetLookupInfo(Ancestor, Root, LookupRoot, RootAncestor); + + AncestorValid := AncestorIsValid(Ancestor, Root, RootAncestor); + + Result := True; + if (PropInfo^.GetProc <> nil) and + ((PropInfo^.SetProc <> nil) {$IFDEF DELPHI6} or + ((PropInfo^.PropType^.Kind = tkClass) and + (TObject(GetOrdProp(Instance, PropInfo)) is TComponent) and + (csSubComponent in TComponent(GetOrdProp(Instance, PropInfo)).ComponentStyle)) {$ENDIF}) then + begin + PropType := PropInfo^.PropType^; + case PropType^.Kind of + tkInteger, tkChar, tkEnumeration, tkSet: + Result := IsDefaultOrdProp; + tkFloat: + Result := IsDefaultFloatProp; + tkString, tkLString, tkWString: + Result := IsDefaultStrProp; + tkClass: + Result := IsDefaultObjectProp; + tkMethod: + Result := IsDefaultMethodProp; + tkVariant: + Result := IsDefaultVariantProp; + tkInt64: + Result := IsDefaultInt64Prop; + tkInterface: + Result := IsDefaultInterfaceProp; + end; + end; +end; +{$ENDIF} + +function TcxPropertyEditor.IsDefaultValue: Boolean; + function CheckProperties(AnObject: TObject): Boolean; + var + PropList: PPropList; + PropInfo: PPropInfo; + I, Count: Integer; + begin + Result := True; + // Go through each of the properties on the object + Count := GetTypeData(AnObject.ClassInfo)^.PropCount; + if Count > 0 then + begin + GetMem(PropList, Count * SizeOf(Pointer)); + try + GetPropInfos(AnObject.ClassInfo, PropList); + for I := 0 to Count - 1 do + begin + PropInfo := PropList^[I]; + if PropInfo = nil then + Break; + if not IsDefaultPropertyValue(AnObject, PropInfo, GetLookupInfo) then + begin + Result := False; + Break; + end; + end; + finally + FreeMem(PropList, Count * SizeOf(Pointer)); + end; + end; + end; + +var + FirstInstance: TObject; + FirstPropInfo: PPropInfo; + + SubObject: TObject; + OldAncestor: TPersistent; + +begin + Result := True; + if PropCount > 0 then + begin + // if they are not all equal, then they aren't all the default (at least one..) + if not AllEqual then + begin + Result := False; + Exit; + end; + + FirstInstance := FPropList^[0].Instance; + FirstPropInfo := FPropList^[0].PropInfo; + if IsStoredProp(FirstInstance, FirstPropInfo) then + begin + // TWriter.WriteDescendent simulation + FRootAncestor := nil; + FAncestor := nil; + FRoot := FindRoot; + if FirstInstance is TComponent then + begin + FLookingFor := TComponent(FirstInstance); + // Only lookup the component if it was introduced in an ancestor form/frame + if csAncestor in FLookingFor.ComponentState then + begin + FDoneLooking := False; + WriteComponentSimulation(FRoot); + end + else + begin + FRootAncestor := nil; + FAncestor := nil; + end; + end + else + begin + // In this case, we will not look up the ancestor (there really + // isn't one - take columns on tlistview as an example) + FRootAncestor := nil; + FAncestor := nil; + end; + + Result := IsDefaultPropertyValue(FirstInstance, FirstPropInfo, GetLookupInfo); + if not Result then + begin + if FirstPropInfo^.PropType^.Kind = tkClass then + begin + // If it was a class/object then we need to recursivly check that + // object to see if it has all default properties. + SubObject := GetObjectProp(FirstInstance, FirstPropInfo); + + OldAncestor := FAncestor; + try + if AncestorIsValid(FAncestor, FRoot, FRootAncestor) then + FAncestor := TPersistent(GetOrdProp(FAncestor, FirstPropInfo)); + Result := CheckProperties(SubObject); + finally + FAncestor := OldAncestor; + end; + + if SubObject is TCollection then + begin + if not AncestorIsValid(FAncestor, FRoot, FRootAncestor) or + not CollectionsEqual(TCollection(SubObject), + TCollection(GetOrdProp(FAncestor, FirstPropInfo)) + {$IFDEF DELPHI6}, FRoot, FRootAncestor{$ENDIF}) then + Result := False; + end; + end; + end; + end; + end; +end; + +function TcxPropertyEditor.ValueAvailable: Boolean; +var + I: Integer; + S: string; +begin + Result := True; + for I := 0 to FPropCount - 1 do + if (FPropList^[I].Instance is TComponent) and + (csCheckPropAvail in TComponent(FPropList^[I].Instance).ComponentStyle) then + begin + try + S := GetValue; + AllEqual; + except + Result := False; + end; + Exit; + end; +end; + +procedure TcxPropertyEditor.AddAncestor(Component: TComponent); +begin + FAncestorList.Add(Component); +end; + +procedure TcxPropertyEditor.GetLookupInfo(var Ancestor: TPersistent; + var Root, LookupRoot, RootAncestor: TComponent); +begin + Ancestor := FAncestor; + Root := FRoot; + LookupRoot := FRoot; // Same in this case + RootAncestor := FRootAncestor; +end; + +procedure TcxPropertyEditor.SetPropEntry(Index: Integer; + AInstance: TPersistent; APropInfo: PPropInfo); +begin + with FPropList^[Index] do + begin + Instance := AInstance; + PropInfo := APropInfo; + end; +end; + +type + TComponentHack = class(TComponent); + +procedure TcxPropertyEditor.WriteComponentSimulation(Component: TComponent); + function FindAncestor(const Name: string): TComponent; + var + I: Integer; + begin + for I := 0 to FAncestorList.Count - 1 do + begin + Result := FAncestorList[I]; + if SameText(Result.Name, Name) then Exit; + end; + Result := nil; + end; +var + OldAncestor: TPersistent; + OldRoot, OldRootAncestor: TComponent; + OldAncestorList: TList; + TempAncestor: TPersistent; +begin + if FDoneLooking then + Exit; + + OldAncestor := FAncestor; + OldRootAncestor := FRootAncestor; + try + if Assigned(FAncestorList) then + FAncestor := FindAncestor(Component.Name); + + // If we are at the component we were looking for, then we + // can stop at this point + if FLookingFor = Component then + FDoneLooking := True + else if SameText(FLookingFor.Name, Component.Name) then + FDoneLooking := True + else + begin + if (FAncestor = nil) and (Component <> FRoot) then + begin + TempAncestor := FRoot; + if TempAncestor <> nil then + begin + FAncestor := TempAncestor; + FRootAncestor := TComponent(FAncestor); + end; + end; + // Component.WriteState(Self); // This is simulated below, inline + OldAncestorList := FAncestorList; + OldRoot := FRoot; + OldRootAncestor := FRootAncestor; + try + FAncestorList := nil; + try + if (FAncestor <> nil) and (FAncestor is TComponent) then + begin + {$IFDEF DELPHI5} + if csInline in TComponent(FAncestor).ComponentState then + FRootAncestor := TComponent(FAncestor); + {$ENDIF} + FAncestorList := TList.Create; + TComponentHack(FAncestor).GetChildren(AddAncestor, FRootAncestor); + end; + {$IFDEF DELPHI5} + if csInline in Component.ComponentState then + FRoot := Component; + {$ENDIF} + TComponentHack(Component).GetChildren(WriteComponentSimulation, FRoot); + finally + FAncestorList.Free; + end; + finally + FAncestorList := OldAncestorList; + if not FDoneLooking then + begin + FRoot := OldRoot; + FRootAncestor := OldRootAncestor; + end; + end; + end; + finally + if not FDoneLooking then + begin + // Only restore the ancestor if we were not done looking. + // This way, we can continue up the chaing looking for the + // component + FAncestor := OldAncestor; + FRootAncestor := OldRootAncestor; + end + end; +end; + +{ TcxOrdinalProperty } + +function TcxOrdinalProperty.AllEqual: Boolean; +var + I: Integer; + V: Longint; +begin + Result := False; + if PropCount > 1 then + begin + V := GetOrdValue; + for I := 1 to PropCount - 1 do + if GetOrdValueAt(I) <> V then Exit; + end; + Result := True; +end; + +function TcxOrdinalProperty.GetEditLimit: Integer; +begin + Result := 63; +end; + +{ TcxIntegerProperty } + +function TcxIntegerProperty.GetValue: string; +begin + Result := IntToStr(GetOrdValue); +end; + +procedure TcxIntegerProperty.SetValue(const Value: string); + + procedure Error(const Args: array of const); + begin + raise EcxPropertyError.CreateFmt(SOutOfRange, Args); + end; + +var + L: Int64; +begin + L := StrToInt64(Value); + with GetTypeData(GetPropType)^ do +{$IFDEF DELPHI5} + if OrdType = otULong then + begin + if (L < Cardinal(MinValue)) or (L > Cardinal(MaxValue)) then + Error([Int64(Cardinal(MinValue)), Int64(Cardinal(MaxValue))]); + end + else +{$ENDIF}if (L < MinValue) or (L > MaxValue) then + Error([MinValue, MaxValue]); + SetOrdValue(L); +end; + +{ TCharProperty } + +function TcxCharProperty.GetValue: string; +var + Ch: Char; +begin + Ch := Chr(GetOrdValue); + if Ch in [#33..#127] then + Result := Ch + else + FmtStr(Result, '#%d', [Ord(Ch)]); +end; + +procedure TcxCharProperty.SetValue(const Value: string); +var + L: Longint; +begin + if Length(Value) = 0 then + L := 0 + else + if Length(Value) = 1 then + L := Ord(Value[1]) + else + if Value[1] = '#' then + L := StrToInt(Copy(Value, 2, Maxint)) + else + raise EcxPropertyError.Create(SInvalidPropertyValue); + + with GetTypeData(GetPropType)^ do + if (L < MinValue) or (L > MaxValue) then + raise EcxPropertyError.CreateFmt(SOutOfRange, [MinValue, MaxValue]); + SetOrdValue(L); +end; + +{ TcxEnumProperty } + +function TcxEnumProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaMultiSelect, ipaValueList, ipaSortList, ipaRevertable]; +end; + +function TcxEnumProperty.GetValue: string; +var + L: Longint; +begin + L := GetOrdValue; + with GetTypeData(GetPropType)^ do + if (L < MinValue) or (L > MaxValue) then L := MaxValue; + Result := GetEnumName(GetPropType, L); +end; + +procedure TcxEnumProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; + EnumType: PTypeInfo; +begin + EnumType := GetPropType; + with GetTypeData(EnumType)^ do + for I := MinValue to MaxValue do + Proc(GetEnumName(EnumType, I)); +end; + +procedure TcxEnumProperty.SetValue(const Value: string); +var + I: Integer; +begin + I := GetEnumValue(GetPropType, Value); + if I < 0 then raise EcxPropertyError.Create(SInvalidPropertyValue); + SetOrdValue(I); +end; + +{ TcxBoolProperty } + +function TcxBoolProperty.GetValue: string; +begin + if GetOrdValue = 0 then + Result := 'False' + else + Result := 'True'; +end; + +procedure TcxBoolProperty.GetValues(Proc: TGetStrProc); +begin + Proc('False'); + Proc('True'); +end; + +procedure TcxBoolProperty.SetValue(const Value: string); +var + I: Integer; +begin + if CompareText(Value, 'False') = 0 then + I := 0 + else + if CompareText(Value, 'True') = 0 then + I := 1 + else + I := StrToInt(Value); + SetOrdValue(I); +end; + +{ TInt64Property } + +function TcxInt64Property.AllEqual: Boolean; +var + I: Integer; + V: Int64; +begin + Result := False; + if PropCount > 1 then + begin + V := GetInt64Value; + for I := 1 to PropCount - 1 do + if GetInt64ValueAt(I) <> V then Exit; + end; + Result := True; +end; + +function TcxInt64Property.GetEditLimit: Integer; +begin + Result := 63; +end; + +function TcxInt64Property.GetValue: string; +begin + Result := IntToStr(GetInt64Value); +end; + +procedure TcxInt64Property.SetValue(const Value: string); +begin + SetInt64Value(StrToInt64(Value)); +end; + +{ TcxFloatProperty } + +function TcxFloatProperty.AllEqual: Boolean; +var + I: Integer; + V: Extended; +begin + Result := False; + if PropCount > 1 then + begin + V := GetFloatValue; + for I := 1 to PropCount - 1 do + if GetFloatValueAt(I) <> V then Exit; + end; + Result := True; +end; + +function TcxFloatProperty.GetValue: string; +const + Precisions: array[TFloatType] of Integer = (7, 15, 18, 18, 18); +begin + Result := FloatToStrF(GetFloatValue, ffGeneral, + Precisions[GetTypeData(GetPropType)^.FloatType], 0); +end; + +procedure TcxFloatProperty.SetValue(const Value: string); +begin + SetFloatValue(StrToFloat(Value)); +end; + +{ TcxStringProperty } + +function TcxStringProperty.AllEqual: Boolean; +var + I: Integer; + V: string; +begin + Result := False; + if PropCount > 1 then + begin + V := GetStrValue; + for I := 1 to PropCount - 1 do + if GetStrValueAt(I) <> V then Exit; + end; + Result := True; +end; + +function TcxStringProperty.GetEditLimit: Integer; +begin + if GetPropType^.Kind = tkString then + Result := GetTypeData(GetPropType)^.MaxLength + else + Result := 255; +end; + +function TcxStringProperty.GetValue: string; +begin + Result := GetStrValue; +end; + +procedure TcxStringProperty.SetValue(const Value: string); +begin + SetStrValue(Value); +end; + +{ TcxComponentNameProperty } + +function TcxComponentNameProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := []; +end; + +function TcxComponentNameProperty.GetEditLimit: Integer; +begin + Result := 63; +end; + +{ TcxSetElementProperty } + +constructor TcxSetElementProperty.Create(APropList: PcxInstPropList; + APropCount: Integer; AElement: Integer); +begin + FPropList := APropList; + FPropCount := APropCount; + FElement := AElement; +end; + +destructor TcxSetElementProperty.Destroy; +begin +end; + +function TcxSetElementProperty.AllEqual: Boolean; +var + I: Integer; + S: TcxIntegerSet; + V: Boolean; +begin + Result := False; + if PropCount > 1 then + begin + Integer(S) := GetOrdValue; + V := FElement in S; + for I := 1 to PropCount - 1 do + begin + Integer(S) := GetOrdValueAt(I); + if (FElement in S) <> V then Exit; + end; + end; + Result := True; +end; + +function TcxSetElementProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaMultiSelect, ipaValueList, ipaSortList, ipaRevertable]; +end; + +function TcxSetElementProperty.GetName: string; +begin + Result := GetEnumName(GetTypeData(GetPropType)^.CompType^, FElement); +end; + +function TcxSetElementProperty.GetValue: string; +var + S: TcxIntegerSet; +begin + Integer(S) := GetOrdValue; + if FElement in S then + Result := 'True' + else + Result := 'False'; +end; + +procedure TcxSetElementProperty.GetValues(Proc: TGetStrProc); +begin + Proc('False'); + Proc('True'); +end; + +procedure TcxSetElementProperty.SetValue(const Value: string); +var + S: TcxIntegerSet; +begin + Integer(S) := GetOrdValue; + if CompareText(Value, 'True') = 0 then + Include(S, FElement) + else + Exclude(S, FElement); + SetOrdValue(Integer(S)); +end; + +function TcxSetElementProperty.IsDefaultValue: Boolean; +var + S1, S2: TcxIntegerSet; + HasStoredProc: Integer; + ProcAsInt: Integer; +begin + Result := inherited IsDefaultValue; + if not Result then + begin + ProcAsInt := Integer(PPropInfo(GetPropInfo)^.StoredProc); + HasStoredProc := ProcAsInt and $FFFFFF00; + if HasStoredProc = 0 then + begin + Integer(S1) := PPropInfo(GetPropInfo)^.Default; + Integer(S2) := GetOrdValue; + Result := not ((FElement in S1) xor (FElement in S2)); + end; + end; +end; + +{ TcxSetProperty } + +function TcxSetProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaMultiSelect, ipaSubProperties, ipaReadOnly, ipaRevertable]; +end; + +procedure TcxSetProperty.GetProperties(AOwner: TComponent; Proc: TcxGetPropEditProc); +var + I: Integer; +begin + with GetTypeData(GetTypeData(GetPropType)^.CompType^)^ do + for I := MinValue to MaxValue do + Proc(TcxSetElementProperty.Create(FPropList, FPropCount, I)); +end; + +function TcxSetProperty.GetValue: string; +var + S: TcxIntegerSet; + TypeInfo: PTypeInfo; + I: Integer; +begin + Integer(S) := GetOrdValue; + TypeInfo := GetTypeData(GetPropType)^.CompType^; + Result := '['; + for I := 0 to SizeOf(Integer) * 8 - 1 do + if I in S then + begin + if Length(Result) <> 1 then Result := Result + ','; + Result := Result + GetEnumName(TypeInfo, I); + end; + Result := Result + ']'; +end; + +{ TcxClassProperty } + +function TcxClassProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaMultiSelect, ipaSubProperties, ipaReadOnly]; +end; + +procedure TcxClassProperty.GetProperties(AOwner: TComponent; Proc: TcxGetPropEditProc); +var + Components: TcxComponentList; + I: Integer; +begin + Components := TcxComponentList.Create; + try + for I := 0 to PropCount - 1 do + if TComponent(GetOrdValueAt(I)) <> nil then + Components.Add(TComponent(GetOrdValueAt(I))); + cxGetComponentProperties(AOwner, FInspector, Components, tkProperties, Proc); + finally + Components.Free; + end; +end; + +function TcxClassProperty.GetValue: string; +begin + FmtStr(Result, '(%s)', [GetPropType^.Name]); +end; + +{ TcxComponentProperty } + +function TcxComponentProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaMultiSelect, ipaValueList, ipaSortList, ipaRevertable]; +end; + +function TcxComponentProperty.GetEditLimit: Integer; +begin + Result := 127; +end; + +function TcxComponentProperty.GetValue: string; +begin + if TComponent(GetOrdValue) <> nil then + Result := GetFullName(TComponent(GetOrdValue)) + else + Result := ''; +end; + +procedure TcxComponentProperty.GetValues(Proc: TGetStrProc); + + procedure AddProc(AComponent: TComponent); + var + i: Integer; + begin + for i := 0 to AComponent.ComponentCount - 1 do + begin + if IsValidComponent(AComponent.Components[i]) then + Proc(GetFullName(AComponent.Components[i])); + AddProc(AComponent.Components[i]); + end; + end; + +var + AOwner: TComponent; +begin + if FOwner <> nil then + begin + AOwner := FOwner; + while AOwner.Owner <> nil do + AOwner := AOwner.Owner; + AddProc(AOwner); + end + else + AddProc(Application); +end; + +procedure TcxComponentProperty.SetValue(const Value: string); +var + Component: TComponent; + + function GetComponentByName(const AName: string): TComponent; + + procedure CheckOwner(AOwner: TComponent); + var + I: Integer; + AComponent: TComponent; + begin + if Result <> nil then Exit; + for I := 0 to AOwner.ComponentCount - 1 do + begin + AComponent := AOwner.Components[I]; + if SameText(GetFullName(AComponent), AName) then + begin + Result := AComponent; + break; + end + else + CheckOwner(AComponent); + end; + end; + + var + AOwner: TComponent; + begin + Result := nil; + AOwner := FOwner; + while AOwner.Owner <> nil do + AOwner := AOwner.Owner; + CheckOwner(AOwner); + end; + +begin + if Value = '' then + Component := nil + else + begin + Component := GetComponentByName(Value); + if not (Component is GetTypeData(GetPropType)^.ClassType) then + raise EcxPropertyError.Create(SInvalidPropertyValue); + end; + SetOrdValue(Longint(Component)); +end; + +function TcxComponentProperty.IsValidComponent(AComponent: TComponent): Boolean; +begin + Result := (AComponent.Name <> '') and (AComponent is GetTypeData(GetPropType)^.ClassType); +end; + +function TcxComponentProperty.GetFullName(AComponent: TComponent): string; +begin + Result := AComponent.Name; + while (AComponent.Name <> '') and (AComponent.Owner <> nil) do + begin + AComponent := AComponent.Owner; + if AComponent.Name <> '' then + Result := AComponent.Name + '.' + Result; + end; +end; + +{ TcxFontNameProperty } + +function TcxFontNameProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaMultiSelect, ipaValueList, ipaSortList, ipaRevertable]; +end; + +procedure TcxFontNameProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to Screen.Fonts.Count - 1 do + Proc(Screen.Fonts[I]); +end; + +{ TcxFontCharsetProperty } + +function TcxFontCharsetProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaMultiSelect, ipaSortList, ipaValueList]; +end; + +function TcxFontCharsetProperty.GetValue: string; +begin + if not CharsetToIdent(TFontCharset(GetOrdValue), Result) then + FmtStr(Result, '%d', [GetOrdValue]); +end; + +procedure TcxFontCharsetProperty.GetValues(Proc: TGetStrProc); +begin + GetCharsetValues(Proc); +end; + +procedure TcxFontCharsetProperty.SetValue(const Value: string); +var + NewValue: Longint; +begin + if IdentToCharset(Value, NewValue) then + SetOrdValue(NewValue) + else + inherited SetValue(Value); +end; + +{ TcxImeNameProperty } + +function TcxImeNameProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaValueList, ipaSortList, ipaMultiSelect]; +end; + +procedure TcxImeNameProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to Screen.Imes.Count - 1 do + Proc(Screen.Imes[I]); +end; + +{ TcxMPFilenameProperty } + +procedure TcxMPFilenameProperty.Edit; +var + OpenDialog: TOpenDialog; +begin + OpenDialog := TOpenDialog.Create(Application); + with OpenDialog do + try + Filename := GetValue; + Filter := SMPOpenFilter; + Options := Options + [ofPathMustExist, ofFileMustExist]; + if Execute then + begin + SetValue(FileName); + PostChangedNotification; + end; + finally + Free; + end; +end; + +function TcxMPFilenameProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaDialog, ipaRevertable]; +end; + +{ TcxColorProperty } + +procedure TcxColorProperty.Edit; +var + ColorDialog: TColorDialog; + IniFile: TRegIniFile; + + procedure GetCustomColors; + begin + IniFile := TRegIniFile.Create('\Software\Borland\Delphi\7.0'); + try + IniFile.ReadSectionValues(SCustomColors, + ColorDialog.CustomColors); + except + { Ignore errors reading values } + end; + end; + + procedure SaveCustomColors; + var + I, P: Integer; + S: string; + begin + if IniFile <> nil then + with ColorDialog do + for I := 0 to CustomColors.Count - 1 do + begin + S := CustomColors.Strings[I]; + P := Pos('=', S); + if P <> 0 then + begin + S := Copy(S, 1, P - 1); + IniFile.WriteString(SCustomColors, S, + CustomColors.Values[S]); + end; + end; + end; + +begin + IniFile := nil; + ColorDialog := TColorDialog.Create(Application); + with ColorDialog do + try + GetCustomColors; + Color := GetOrdValue; + if Execute then + begin + SetOrdValue(Color); + PostChangedNotification; + end; + SaveCustomColors; + finally + if IniFile <> nil then IniFile.Free; + Free; + end; +end; + +function TcxColorProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaMultiSelect, ipaDialog]; +end; + +function TcxColorProperty.GetValue: string; +begin + Result := IntToStr(GetOrdValue); +end; + +procedure TcxColorProperty.GetValues(Proc: TGetStrProc); +begin +end; + +{ TcxCursorProperty } + +function TcxCursorProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaMultiSelect, ipaValueList, ipaSortList, ipaRevertable]; +end; + +function TcxCursorProperty.GetValue: string; +begin + Result := CursorToString(TCursor(GetOrdValue)); +end; + +procedure TcxCursorProperty.GetValues(Proc: TGetStrProc); +begin + GetCursorValues(Proc); +end; + +procedure TcxCursorProperty.SetValue(const Value: string); +var + NewValue: Longint; +begin + if IdentToCursor(Value, NewValue) then + SetOrdValue(NewValue) + else + inherited SetValue(Value); +end; + +{ TcxFontProperty } + +procedure TcxFontProperty.Edit; +var + FontDialog: TFontDialog; +begin + FontDialog := TFontDialog.Create(Application); + try + FontDialog.Font := TFont(GetOrdValue); + FontDialog.Options := FontDialog.Options + [fdForceFontExist]; + if FontDialog.Execute then + begin + SetOrdValue(Longint(FontDialog.Font)); + PostChangedNotification; + end; + finally + FontDialog.Free; + end; +end; + +function TcxFontProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaMultiSelect, ipaSubProperties, ipaDialog, ipaReadOnly]; +end; + +{TcxStringsProperty} + +procedure TcxStringsProperty.Edit; +var + Data: TcxStringsEditorDlgData; +begin + if Inspector <> nil then + Data.LookAndFeel := TcxCustomRTTIInspector(Inspector).LookAndFeel + else + Data.LookAndFeel := nil; + Data.Caption := GetComponent(0).GetNamePath + '.' + GetName; + Data.Text := TStrings(GetOrdValue).Text; + if cxShowStringsEditor(@Data) then + begin + TStrings(GetOrdValue).Text := Data.Text; + PostChangedNotification; + end; +end; + +function TcxStringsProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaDialog, ipaReadOnly]; +end; + +{ TcxGraphicProperty } + +procedure TcxGraphicProperty.Edit; +var + Data: TcxPictureEditorDlgData; + P: TPicture; +begin + P := TPicture.Create; + try + P.Assign(GetGraphic); + with Data do + begin + if Inspector <> nil then + LookAndFeel := TcxCustomRTTIInspector(Inspector).LookAndFeel + else + LookAndFeel := nil; + Caption := GetComponent(0).GetNamePath + '.' + GetName; + ClipboardFormat := GetClipboardFormat; + GraphicFilter := GetGraphicFilter; + Picture := P; + end; + if cxShowPictureEditor(@Data) then + begin + SetGraphic(P.Graphic); + PostChangedNotification; + end; + finally + P.Free; + end; +end; + +function TcxGraphicProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaDialog]; +end; + +function TcxGraphicProperty.HasGraphic: Boolean; +begin + Result := (GetGraphic <> nil) and not GetGraphic.Empty; +end; + +function TcxGraphicProperty.GraphicClass: TGraphicClass; +begin + if GetGraphic = nil then + Result := nil + else + Result := TGraphicClass(GetGraphic.ClassType); +end; + +function TcxGraphicProperty.GetGraphicFilter: string; +begin + Result := GraphicFilter(TGraphic) +end; + +function TcxGraphicProperty.GetClipboardFormat: Word; +begin + Result := CF_PICTURE; + if GraphicClass <> nil then + if GraphicClass.InheritsFrom(TBitmap) then + Result := CF_BITMAP + else + if GraphicClass.InheritsFrom(TMetafile) then + Result := CF_METAFILEPICT; +end; + +function TcxGraphicProperty.GetGraphic: TGraphic; +begin + Result := TGraphic(GetOrdValue); +end; + +procedure TcxGraphicProperty.SetGraphic(Value: TGraphic); +begin + GetGraphic.Assign(Value); +end; + +function TcxGraphicProperty.GetValue: string; +begin + if HasGraphic then + Result := '(' + GetGraphic.ClassName + ')' + else + Result := '(None)'; +end; + +procedure TcxGraphicProperty.SetValue(const Value: string); +begin + if Value = '' then SetGraphic(nil); +end; + +{TcxPictureProperty} + +function TcxPictureProperty.GetGraphic: TGraphic; +begin + if GetOrdValue = 0 then + Result := nil + else + Result := TPicture(GetOrdValue).Graphic; +end; + +procedure TcxPictureProperty.SetGraphic(Value: TGraphic); +begin + TPicture(GetOrdValue).Assign(Value); +end; + +{ TcxModalResultProperty } + +const + dxModalResults: array[mrNone..mrYesToAll] of string = ( + 'mrNone', + 'mrOk', + 'mrCancel', + 'mrAbort', + 'mrRetry', + 'mrIgnore', + 'mrYes', + 'mrNo', + 'mrAll', + 'mrNoToAll', + 'mrYesToAll'); + +function TcxModalResultProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaMultiSelect, ipaValueList, ipaRevertable]; +end; + +function TcxModalResultProperty.GetValue: string; +var + CurValue: Longint; +begin + CurValue := GetOrdValue; + case CurValue of + Low(dxModalResults)..High(dxModalResults): + Result := dxModalResults[CurValue]; + else + Result := IntToStr(CurValue); + end; +end; + +procedure TcxModalResultProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := Low(dxModalResults) to High(dxModalResults) do + Proc(dxModalResults[I]); +end; + +procedure TcxModalResultProperty.SetValue(const Value: string); +var + I: Integer; +begin + if Value = '' then + begin + SetOrdValue(0); + Exit; + end; + for I := Low(dxModalResults) to High(dxModalResults) do + if CompareText(dxModalResults[I], Value) = 0 then + begin + SetOrdValue(I); + Exit; + end; + inherited SetValue(Value); +end; + +{ TcxShortCutProperty } + +const + cxShortCuts: array[0..82] of TShortCut = ( + scNone, + Byte('A') or scCtrl, + Byte('B') or scCtrl, + Byte('C') or scCtrl, + Byte('D') or scCtrl, + Byte('E') or scCtrl, + Byte('F') or scCtrl, + Byte('G') or scCtrl, + Byte('H') or scCtrl, + Byte('I') or scCtrl, + Byte('J') or scCtrl, + Byte('K') or scCtrl, + Byte('L') or scCtrl, + Byte('M') or scCtrl, + Byte('N') or scCtrl, + Byte('O') or scCtrl, + Byte('P') or scCtrl, + Byte('Q') or scCtrl, + Byte('R') or scCtrl, + Byte('S') or scCtrl, + Byte('T') or scCtrl, + Byte('U') or scCtrl, + Byte('V') or scCtrl, + Byte('W') or scCtrl, + Byte('X') or scCtrl, + Byte('Y') or scCtrl, + Byte('Z') or scCtrl, + VK_F1, + VK_F2, + VK_F3, + VK_F4, + VK_F5, + VK_F6, + VK_F7, + VK_F8, + VK_F9, + VK_F10, + VK_F11, + VK_F12, + VK_F1 or scCtrl, + VK_F2 or scCtrl, + VK_F3 or scCtrl, + VK_F4 or scCtrl, + VK_F5 or scCtrl, + VK_F6 or scCtrl, + VK_F7 or scCtrl, + VK_F8 or scCtrl, + VK_F9 or scCtrl, + VK_F10 or scCtrl, + VK_F11 or scCtrl, + VK_F12 or scCtrl, + VK_F1 or scShift, + VK_F2 or scShift, + VK_F3 or scShift, + VK_F4 or scShift, + VK_F5 or scShift, + VK_F6 or scShift, + VK_F7 or scShift, + VK_F8 or scShift, + VK_F9 or scShift, + VK_F10 or scShift, + VK_F11 or scShift, + VK_F12 or scShift, + VK_F1 or scShift or scCtrl, + VK_F2 or scShift or scCtrl, + VK_F3 or scShift or scCtrl, + VK_F4 or scShift or scCtrl, + VK_F5 or scShift or scCtrl, + VK_F6 or scShift or scCtrl, + VK_F7 or scShift or scCtrl, + VK_F8 or scShift or scCtrl, + VK_F9 or scShift or scCtrl, + VK_F10 or scShift or scCtrl, + VK_F11 or scShift or scCtrl, + VK_F12 or scShift or scCtrl, + VK_INSERT, + VK_INSERT or scShift, + VK_INSERT or scCtrl, + VK_DELETE, + VK_DELETE or scShift, + VK_DELETE or scCtrl, + VK_BACK or scAlt, + VK_BACK or scShift or scAlt); + +function TcxShortCutProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaMultiSelect, ipaValueList, ipaRevertable]; +end; + +function TcxShortCutProperty.GetValue: string; +var + CurValue: TShortCut; +begin + CurValue := GetOrdValue; + if CurValue = scNone then + Result := srNone + else + Result := ShortCutToText(CurValue); +end; + +procedure TcxShortCutProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + Proc(srNone); + for I := 1 to High(cxShortCuts) do + Proc(ShortCutToText(cxShortCuts[I])); +end; + +procedure TcxShortCutProperty.SetValue(const Value: string); +var + NewValue: TShortCut; +begin + NewValue := 0; + if (Value <> '') and (AnsiCompareText(Value, srNone) <> 0) then + begin + NewValue := TextToShortCut(Value); + if NewValue = 0 then + raise EcxPropertyError.Create(SInvalidPropertyValue); + end; + SetOrdValue(NewValue); +end; + +{ TcxTabOrderProperty } + +function TcxTabOrderProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := []; +end; + +{ TcxCaptionProperty } + +function TcxCaptionProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaMultiSelect, ipaAutoUpdate, ipaRevertable]; +end; + +{ TcxDateProperty } + +function TcxDateProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaMultiSelect, ipaRevertable]; +end; + +function TcxDateProperty.GetValue: string; +var + DT: TDateTime; +begin + DT := GetFloatValue; + if DT = 0.0 then + Result := '' + else + Result := DateToStr(DT); +end; + +procedure TcxDateProperty.SetValue(const Value: string); +var + DT: TDateTime; +begin + if Value = '' then + DT := 0.0 + else + DT := StrToDate(Value); + SetFloatValue(DT); +end; + +{ TcxTimeProperty } + +function TcxTimeProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaMultiSelect, ipaRevertable]; +end; + +function TcxTimeProperty.GetValue: string; +var + DT: TDateTime; +begin + DT := GetFloatValue; + if DT = 0.0 then + Result := '' + else + Result := TimeToStr(DT); +end; + +procedure TcxTimeProperty.SetValue(const Value: string); +var + DT: TDateTime; +begin + if Value = '' then + DT := 0.0 + else + DT := StrToTime(Value); + SetFloatValue(DT); +end; + +function TcxDateTimeProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaMultiSelect, ipaRevertable]; +end; + +function TcxDateTimeProperty.GetValue: string; +var + DT: TDateTime; +begin + DT := GetFloatValue; + if DT = 0.0 then + Result := '' + else + Result := DateTimeToStr(DT); +end; + +procedure TcxDateTimeProperty.SetValue(const Value: string); +var + DT: TDateTime; +begin + if Value = '' then + DT := 0.0 + else + DT := StrToDateTime(Value); + SetFloatValue(DT); +end; + +{ TVariantTypeProperty } + +{$IFNDEF DELPHI6} +const + varInt64 = $14; +{$ENDIF} + +var + VarTypeNames: array[varEmpty..varInt64] of string = ( + 'Unassigned', // varEmpty + 'Null', // varNull + 'Smallint', // varSmallint + 'Integer', // varInteger + 'Single', // varSingle + 'Double', // varDouble + 'Currency', // varCurrency + 'Date', // varDate + 'OleStr', // varOleStr + '', // varDispatch + '', // varError + 'Boolean', // varBoolean + '', // varVariant + '', // varUnknown + '', // [varDecimal] + '', // [undefined] + 'Shortint', // varShortInt + 'Byte', // varByte + 'Word', // varWord + 'LongWord', // varLongWord + 'Int64'); // varInt64 + +type + TcxVariantTypeProperty = class(TcxPropertyEditor) + public + constructor Create(APropList: PcxInstPropList; APropCount: Integer); + destructor Destroy; override; + function AllEqual: Boolean; override; + function GetAttributes: TcxPropertyAttributes; override; + function GetName: string; override; + function GetValue: string; override; + procedure GetValues(Proc: TGetStrProc); override; + procedure SetValue(const Value: string); override; + end; + +constructor TcxVariantTypeProperty.Create(APropList: PcxInstPropList; + APropCount: Integer); +begin + FPropList := APropList; + FPropCount := APropCount; +end; + +destructor TcxVariantTypeProperty.Destroy; +begin +end; + +function TcxVariantTypeProperty.AllEqual: Boolean; +var + i: Integer; + V1, V2: Variant; +begin + Result := False; + if PropCount > 1 then + begin + V1 := GetVarValue; + for i := 1 to PropCount - 1 do + begin + V2 := GetVarValueAt(i); + if VarType(V1) <> VarType(V2) then Exit; + end; + end; + Result := True; +end; + +function TcxVariantTypeProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaMultiSelect, ipaValueList, ipaSortList]; +end; + +function TcxVariantTypeProperty.GetName: string; +begin + Result := 'Type'; +end; + +function TcxVariantTypeProperty.GetValue: string; +begin + case VarType(GetVarValue) and varTypeMask of + Low(VarTypeNames)..High(VarTypeNames): + Result := VarTypeNames[VarType(GetVarValue)]; + varString: + Result := cxSString; + else + Result := cxGetResourceString(@cxSvgUnknown); + end; +end; + +procedure TcxVariantTypeProperty.GetValues(Proc: TGetStrProc); +var + i: Integer; +begin + for i := 0 to High(VarTypeNames) do + if VarTypeNames[i] <> '' then + Proc(VarTypeNames[i]); + Proc(cxSString); +end; + +procedure TcxVariantTypeProperty.SetValue(const Value: string); + + function GetSelectedType: Integer; + var + i: Integer; + begin + Result := -1; + for i := 0 to High(VarTypeNames) do + if VarTypeNames[i] = Value then + begin + Result := i; + break; + end; + if (Result = -1) and (Value = cxSString) then + Result := varString; + end; + +var + NewType: Integer; + V: Variant; +begin + V := GetVarValue; + NewType := GetSelectedType; + case NewType of + varEmpty: VarClear(V); + varNull: V := NULL; + -1: raise Exception.Create('UnknownType'); //todo resource + else + try + VarCast(V, V, NewType); + except + // If it cannot cast, clear it and then cast again. + VarClear(V); + VarCast(V, V, NewType); + end; + end; + SetVarValue(V); +end; + +{ TcxVariantProperty } + +{$IFNDEF DELPHI6} + +function VarToStrDef(const V: Variant; const ADefault: string): string; +begin + if not VarIsNull(V) then + Result := V + else + Result := ADefault; +end; +{$ENDIF} + +function TcxVariantProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaMultiSelect, ipaSubProperties]; +end; + +procedure TcxVariantProperty.GetProperties(AOwner: TComponent; + Proc: TcxGetPropEditProc); +begin + Proc(TcxVariantTypeProperty.Create(FPropList, FPropCount)); +end; + +function TcxVariantProperty.GetValue: string; + + function GetVariantStr(const Value: Variant): string; + begin + case VarType(Value) of + varBoolean: + Result := BooleanIdents[Value = True]; + varCurrency: + Result := CurrToStr(Value); + else + Result := VarToStrDef(Value, cxSNull); + end; + end; + +var + Value: Variant; +begin + Value := GetVarValue; + if VarType(Value) <> varDispatch then + Result := GetVariantStr(Value) + else + Result := 'ERROR'; +end; + +procedure TcxVariantProperty.SetValue(const Value: string); + + function Cast(var Value: Variant; NewType: Integer): Boolean; + var + V2: Variant; + begin + Result := True; + if NewType = varCurrency then + Result := AnsiPos(CurrencyString, Value) > 0; + if Result then + try + VarCast(V2, Value, NewType); + Result := (NewType = varDate) or (VarToStr(V2) = VarToStr(Value)); + if Result then Value := V2; + except + Result := False; + end; + end; + +var + V: Variant; + OldType: Integer; +begin + OldType := VarType(GetVarValue); + V := Value; + if Value = '' then + VarClear(V) else + if (CompareText(Value, cxSNull) = 0) then + V := NULL else + if not Cast(V, OldType) then + V := Value; + SetVarValue(V); +end; + +{ TcxEditPropertiesProperty } + +function TcxEditPropertiesProperty.HasSubProperties: Boolean; +var + I: Integer; + AIntf: IcxEditorPropertiesContainer; +begin + for I := 0 to PropCount - 1 do + begin + Result := Supports(GetComponent(I), IcxEditorPropertiesContainer, AIntf) and + (AIntf.GetProperties <> nil); + if not Result then Exit; + end; + Result := True; +end; + +function TcxEditPropertiesProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := inherited GetAttributes; + if not HasSubProperties then + Exclude(Result, ipaSubProperties); + Result := Result - [ipaReadOnly] + [ipaValueList, ipaSortList, ipaRevertable]; +end; + +function TcxEditPropertiesProperty.GetValue: string; +begin + if HasSubProperties then + Result := GetRegisteredEditProperties.GetDescriptionByClass( + TcxCustomEditProperties(GetOrdValue).ClassType) + else + Result := ''; +end; + +procedure TcxEditPropertiesProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; +begin + for I := 0 to GetRegisteredEditProperties.Count - 1 do + Proc(GetRegisteredEditProperties.Descriptions[I]); +end; + +procedure TcxEditPropertiesProperty.SetValue(const Value: string); +var + APropertiesClass: TcxCustomEditPropertiesClass; + I: Integer; + AIntf: IcxEditorPropertiesContainer; +begin + APropertiesClass := TcxCustomEditPropertiesClass( + GetRegisteredEditProperties.FindByClassName(Value)); + if APropertiesClass = nil then + APropertiesClass := TcxCustomEditPropertiesClass( + GetRegisteredEditProperties.FindByDescription(Value)); + for I := 0 to PropCount - 1 do + if Supports(GetComponent(I), IcxEditorPropertiesContainer, AIntf) then + AIntf.SetPropertiesClass(APropertiesClass); + inherited; +end; + +{ TcxPropInfoList } + +type + TcxPropInfoList = class + private + FList: PPropList; + FCount: Integer; + FSize: Integer; + function Get(Index: Integer): PPropInfo; + public + constructor Create(Instance: TPersistent; Filter: TTypeKinds); + destructor Destroy; override; + + function Contains(P: PPropInfo): Boolean; + procedure Delete(Index: Integer); + procedure Intersect(List: TcxPropInfoList); + + property Count: Integer read FCount; + property Items[Index: Integer]: PPropInfo read Get; default; + end; + +constructor TcxPropInfoList.Create(Instance: TPersistent; Filter: TTypeKinds); +begin + if Instance.ClassInfo <> nil then + begin + FCount := GetPropList(Instance.ClassInfo, Filter, nil); + FSize := FCount * SizeOf(Pointer); + GetMem(FList, FSize); + GetPropList(Instance.ClassInfo, Filter, FList); + end; +end; + +destructor TcxPropInfoList.Destroy; +begin + if FList <> nil then FreeMem(FList, FSize); + inherited Destroy; +end; + +function TcxPropInfoList.Contains(P: PPropInfo): Boolean; +var + I: Integer; +begin + for I := 0 to FCount - 1 do + with FList^[I]^ do + if (PropType^ = P^.PropType^) and (CompareText(Name, P^.Name) = 0) then + begin + Result := True; + Exit; + end; + Result := False; +end; + +procedure TcxPropInfoList.Delete(Index: Integer); +begin + Dec(FCount); + if Index < FCount then + Move(FList^[Index + 1], FList^[Index], (FCount - Index) * SizeOf(Pointer)); +end; + +function TcxPropInfoList.Get(Index: Integer): PPropInfo; +begin + Result := FList^[Index]; +end; + +procedure TcxPropInfoList.Intersect(List: TcxPropInfoList); +var + I: Integer; +begin + for I := FCount - 1 downto 0 do + if not List.Contains(FList^[I]) then Delete(I); +end; + +{ GetComponentProperties } + +procedure cxRegisterPropertyEditor(APropertyType: PTypeInfo; AComponentClass: TClass; + const APropertyName: string; AEditorClass: TcxPropertyEditorClass); +var + Item: TcxPropertyClassRec; +begin + if FPropertyClasses = nil then FPropertyClasses := TList.Create; + Item := TcxPropertyClassRec.Create; + with Item do + begin + Group := CurrentGroup; + PropertyType := APropertyType; + ComponentClass := AComponentClass; + PropertyName := ''; + if ComponentClass <> nil then PropertyName := APropertyName; + EditorClass := AEditorClass; + end; + FPropertyClasses.Insert(0, Item); +end; + +procedure cxRegisterPropertyMapper(AMapper: TcxPropertyMapperFunc); +var + Item: TcxPropertyMapperRec; +begin + if FPropertyMappers = nil then + FPropertyMappers := TList.Create; + Item := TcxPropertyMapperRec.Create; + Item.Group := CurrentGroup; + Item.Mapper := AMapper; + FPropertyMappers.Insert(0, Item); +end; + +function cxGetEditorClass(APropInfo: PPropInfo; Obj: TPersistent): TcxPropertyEditorClass; +var + PropType: PTypeInfo; + P, C: TcxPropertyClassRec; + I: Integer; +begin + if FPropertyMappers <> nil then + for I := 0 to FPropertyMappers.Count - 1 do + with TcxPropertyMapperRec(FPropertyMappers[I]) do + begin + Result := Mapper(Obj, APropInfo); + if Result <> nil then Exit; + end; + + PropType := APropInfo^.PropType^; + I := 0; + C := nil; + + if FPropertyClasses <> nil then + while I < FPropertyClasses.Count do + begin + P := FPropertyClasses[I]; + if ((P.PropertyType = PropType) or ((PropType^.Kind = tkClass) and + (P.PropertyType^.Kind = tkClass) and + GetTypeData(PropType)^.ClassType.InheritsFrom(GetTypeData(P.PropertyType)^.ClassType))) and + ((P.ComponentClass = nil) or (Obj.InheritsFrom(P.ComponentClass))) and + ((P.PropertyName = '') or (CompareText(APropInfo^.Name, P.PropertyName) = 0)) then + if (C = nil) or ((C.ComponentClass = nil) and (P.ComponentClass <> nil)) + or ((C.PropertyName = '') and (P.PropertyName <> '')) then + C := P; + Inc(I); + end; + + if C <> nil then + Result := C.EditorClass + else + Result := cxPropClassMap[PropType^.Kind]; +end; + +procedure cxGetComponentProperties(AOwner: TComponent; + AInspector: TcxCustomRTTIInspector; AComponents: TcxComponentList; + AFilter: TTypeKinds; AProc: TcxGetPropEditProc); +var + I, J, CompCount: Integer; + CompType: TClass; + Candidates: TcxPropInfoList; + PropLists: TList; + Editor: TcxPropertyEditor; + EdClass: TcxPropertyEditorClass; + PropInfo: PPropInfo; + AddEditor: Boolean; + Obj: TPersistent; +begin + if (AComponents = nil) or (AComponents.Count = 0) then Exit; + CompCount := AComponents.Count; + Obj := AComponents[0]; + CompType := AComponents[0].ClassType; + Candidates := TcxPropInfoList.Create(AComponents[0], AFilter); + try + for I := Candidates.Count - 1 downto 0 do + begin + PropInfo := Candidates[I]; + EdClass := cxGetEditorClass(PropInfo, Obj); + if EdClass = nil then + Candidates.Delete(I) + else + begin + Editor := EdClass.Create(AOwner, AInspector, 1); + try + Editor.SetPropEntry(0, Obj, PropInfo); + with PropInfo^ do + if (GetProc = nil) or + ((PropType^.Kind <> tkClass) and (SetProc = nil)) or + ((CompCount > 1) and + not (ipaMultiSelect in Editor.GetAttributes)) or + not Editor.ValueAvailable then + Candidates.Delete(I); + finally + Editor.Free; + end; + end; + end; + PropLists := TList.Create; + try + PropLists.Capacity := CompCount; + for I := 0 to CompCount - 1 do + PropLists.Add(TcxPropInfoList.Create(AComponents[I], AFilter)); + for I := 0 to CompCount - 1 do + Candidates.Intersect(TcxPropInfoList(PropLists[I])); + for I := 0 to CompCount - 1 do + TcxPropInfoList(PropLists[I]).Intersect(Candidates); + for I := 0 to Candidates.Count - 1 do + begin + EdClass := cxGetEditorClass(Candidates[I], Obj); + if EdClass = nil then Continue; + Editor := EdClass.Create(AOwner, AInspector, CompCount); + try + AddEditor := True; + for J := 0 to CompCount - 1 do + begin + if (AComponents[J].ClassType <> CompType) and + (cxGetEditorClass(TcxPropInfoList(PropLists[J])[I], + AComponents[J]) <> EdClass) then + begin + AddEditor := False; + Break; + end; + Editor.SetPropEntry(J, AComponents[J], TcxPropInfoList(PropLists[J])[I]); + end; + except + Editor.Free; + raise; + end; + if AddEditor and Editor.ValueAvailable and Assigned(AProc) then + AProc(Editor) + else + Editor.Free; + end; + finally + for I := 0 to PropLists.Count - 1 do TcxPropInfoList(PropLists[I]).Free; + PropLists.Free; + end; + finally + Candidates.Free; + end; +end; + +{ TcxRTTIInspectorEditingController } + +procedure TcxRTTIInspectorEditingController.HideEdit(Accept: Boolean); + + procedure RemoveEditing; + begin + EditingItem := nil; + HideInplaceEditor; + end; + +var + AEditViewInfo: TcxEditCellViewInfo; + AItem: TcxCustomInplaceEditContainer; + ASaveIndex: Integer; +begin + if FDeactivating then Exit; + Controller.CancelCheckEditPost; + CancelEditUpdatePost; + StopEditShowingTimer; + if EditHiding or not IsEditing then Exit; + EditHiding := True; + try + if Accept then + begin + FDeactivating := True; + if Inspector.FocusedRow <> nil then + ASaveIndex := Inspector.FocusedRow.AbsoluteIndex + else + ASaveIndex := -1; + try + try + if not Edit.Deactivate then raise EAbort.Create(''); + Controller.DataController.PostEditingData; + except + RemoveEditing; + with Inspector do + if CanFocusEx then SetFocus; + raise; + end; + finally + with Inspector do + if Reloaded then + begin + RemoveEditing; + if (ASaveIndex >= 0) and (ASaveIndex < Rows.Count) then + begin + Controller.InternalSetRowAndCell(TcxPropertyRow(Rows[ASaveIndex]), 0); + Controller.InternalSetFocusedItem(TcxPropertyRow(Rows[ASaveIndex]).EditContainer) + end + else + begin + Controller.InternalSetRowAndCell(nil, 0); + Controller.InternalSetFocusedItem(nil); + end; + Controller.RefreshFocusedRow; + Controller.FNeedCorrect := True; + end; + FDeactivating := False; + end; + IsErrorOnEditExit := False; + if EditingItem = nil then Exit; + AEditViewInfo := Controller.GetFocusedCellViewInfo(EditingItem); + if AEditViewInfo <> nil then + Edit.ActiveProperties.Update( + TcxEditCellViewInfoAccess(AEditViewInfo).Properties); + end; + AItem := EditingItem; + TcxCustomRTTIInspector(EditingControl).DoEdited(AItem); + EditingItem := nil; + Controller.RefreshFocusedCellViewInfo(AItem); + HideInplaceEditor; + IsErrorOnEditExit := False; + finally + EditHiding := False; + end; +end; + +function TcxRTTIInspectorEditingController.GetController: TcxRTTIInspectorController; +begin + Result := TcxRTTIInspectorController(inherited Controller); +end; + +function TcxRTTIInspectorEditingController.GetInspector: TcxCustomRTTIInspector; +begin + Result := TcxCustomRTTIInspector(EditingControl); +end; + +{ TcxRTTIInspectorController } + +procedure TcxRTTIInspectorController.SetFocusedRecordItem( + ARecordIndex: Integer; AItem: TcxCustomInplaceEditContainer); +var + AIndex: Integer; +begin + AIndex := GetRowIndexFromCellEdit(AItem); + EditingController.HideEdit(True); + if FNeedCorrect then + begin + if (AIndex >= 0) and (AIndex < Inspector.Rows.Count) and + (Inspector.Rows[AIndex] is TcxPropertyRow) then + AItem := TcxPropertyRow(Inspector.Rows[AIndex]).EditContainer + else + AItem := nil; + FNeedCorrect := False; + end; + AllowCheckEdit := False; + try + DisableCellsRefresh := (FocusedRecordIndex = ARecordIndex); + FocusedRecordIndex := ARecordIndex; + DisableCellsRefresh := DisableCellsRefresh and (FocusedItem = AItem); + FocusedItem := AItem; + finally + AllowCheckEdit := True; + CheckEdit; + DisableCellsRefresh := False; + end; +end; + +procedure TcxRTTIInspectorController.BeforeEditKeyDown(var Key: Word; + var Shift: TShiftState); +begin + if (Key = VK_RETURN) and (ssCtrl in Shift) then + begin + Key := 0; + Inspector.TryInvokePropertyEditorDlg; + end; +end; + +procedure TcxRTTIInspectorController.DoEditDblClick(Sender: TObject); +begin + with Inspector do + if (PropertyEditor <> nil) and not (ipaRevertable in PropertyEditor.GetAttributes) then + TryInvokePropertyEditorDlg; +end; + +procedure TcxRTTIInspectorController.DoUpdateRowAndCell(ANewRow: TcxCustomRow; + ANewCellIndex: Integer); +begin + if Inspector.LockRefresh then Exit; + inherited DoUpdateRowAndCell(ANewRow, ANewCellIndex); +end; + +procedure TcxRTTIInspectorController.FocusChanged; +begin + if FFocusChanging or Inspector.LockRefresh then Exit; + FFocusChanging := True; + try + inherited FocusChanged; + finally + FFocusChanging := False; + end; +end; + +function TcxRTTIInspectorController.IsKeyForController(AKey: Word; + AShift: TShiftState): Boolean; +begin + Result := inherited IsKeyForController(AKey, AShift) or + ((AKey = VK_RETURN) and (ssCtrl in AShift)); +end; + +procedure TcxRTTIInspectorController.SetFocusedItem( + Value: TcxCustomInplaceEditContainer); +var + AIndex: Integer; +begin + if Inspector.LockRefresh then Exit; + try + AIndex := GetRowIndexFromCellEdit(Value); + if IsEditing then EditingController.HideEdit(True); + if FNeedCorrect then + begin + if (AIndex >= 0) and (AIndex < Inspector.Rows.Count) and + (Inspector.Rows[AIndex] is TcxPropertyRow) then + Value := TcxPropertyRow(Inspector.Rows[AIndex]).EditContainer + else + Value := nil; + FNeedCorrect := False; + end; + inherited SetFocusedItem(Value); + finally + Inspector.FReloaded := False; + end; +end; + +procedure TcxRTTIInspectorController.SetFocusedRowAndCell(Value: TcxCustomRow; + ACellIndex: Integer); +var + AEditContainer: TcxCustomInplaceEditContainer; +begin + if EditingController.Deactivating or Inspector.IsDesigning or + Assigned(Value) and not TcxCustomRowAccess(Value).CanFocus then Exit; + FLockUpdate := True; + try + if (Value <> nil) and (Value is TcxPropertyRow) then + AEditContainer := TcxPropertyRow(Value).GetEditContainer(ACellIndex) + else + AEditContainer := nil; + FNeedCorrect := False; + if FocusedItem <> AEditContainer then + FocusedItem := AEditContainer; + if FocusedItem <> nil then + Value := TcxCellEdit(FocusedItem).Row + else + Value := nil; + finally + FLockUpdate := False; + AllowCheckEdit := True; + end; + inherited DoUpdateRowAndCell(Value, ACellIndex); +end; + +function TcxRTTIInspectorController.GetEditingController: TcxRTTIInspectorEditingController; +begin + Result := TcxRTTIInspectorEditingController(inherited EditingController); +end; + +function TcxRTTIInspectorController.GetFocusedRowIndex: Integer; +begin + if FocusedRow = nil then + Result := -1 + else + Result := FocusedRow.AbsoluteIndex; +end; + +function TcxRTTIInspectorController.GetInspector: TcxCustomRTTIInspector; +begin + Result := TcxCustomRTTIInspector(EditingControl); +end; + +function TcxRTTIInspectorController.GetRowIndexFromCellEdit( + Value: TcxCustomInplaceEditContainer): Integer; +begin + if Value <> nil then + Result := TcxCellEdit(Value).Row.AbsoluteIndex + else + Result := -1; +end; + +procedure TcxRTTIInspectorController.SetFocusedRowIndex(AIndex: Integer); +var + ARow: TcxCustomRow; + AItem: TcxCustomInplaceEditContainer; +begin + AItem := nil; + if (AIndex >= 0) and (AIndex < Inspector.Rows.Count) then + begin + ARow := Inspector.Rows[AIndex]; + if ARow is TcxPropertyRow then + AItem := TcxPropertyRow(ARow).EditContainer; + end + else + ARow := nil; + InternalSetRowAndCell(ARow, 0); + InternalSetFocusedItem(AItem); +end; + +{ TcxRTTIInspectorOptionsView } + +constructor TcxRTTIInspectorOptionsView.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + PaintStyle := psDelphi; + ShowEditButtons := ecsbFocused; +end; + +{ TcxRTTIInspectorOptionsBehavior } + +constructor TcxRTTIInspectorOptionsBehavior.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + AlwaysShowEditor := True; +end; + +{ TcxCustomRTTIInspector } + +constructor TcxCustomRTTIInspector.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + OptionsBehavior.CellHints := True; + OptionsBehavior.AlwaysShowEditor := True; + FBoldFont := TFont.Create; + FBoldFont.Assign(Font); + FBoldFont.Style := FBoldFont.Style + [fsBold]; +end; + +destructor TcxCustomRTTIInspector.Destroy; +begin + if FListeners <> nil then + begin + CloseNonModalEditors; + FListeners.Free; + end; + ReleaseComponentProperties; + FBoldFont.Free; + inherited Destroy; +end; + +procedure TcxCustomRTTIInspector.AddListener(AListener: TPersistent); +begin + if FListeners = nil then FListeners := TList.Create; + if (AListener <> nil) and (FListeners.IndexOf(AListener) < 0) then + FListeners.Add(AListener) +end; + +procedure TcxCustomRTTIInspector.CloseNonModalEditors; +var + I: Integer; + AIntf: IcxRTTIInspectorHelper; +begin + if FListeners <> nil then + for I := 0 to FListeners.Count - 1 do + if Supports(TObject(FListeners[I]), IcxRTTIInspectorHelper, AIntf) then + begin + AIntf.CloseNonModal(Self); + AIntf := nil; + end; +end; + +procedure TcxCustomRTTIInspector.RefreshInspectedProperties; + + function GetFullName(ARow: TcxCustomRow): string; + begin + Result := ''; + repeat + if ARow is TcxPropertyRow then + Result := UpperCase(TcxPropertyRow(ARow).Properties.Caption) + ' ' + Result; + ARow := ARow.Parent; + until ARow = nil; + end; + +var + ALayout: TStringList; + AIndex, I, J: Integer; + AObject: TPersistent; + ARow: TcxCustomRow; + AFullName: string; +begin + BeginUpdate; + FLockRefresh := True; + try + FSaveTopRowIndex := TopVisibleRowIndex; + ALayout := TStringList.Create; + try + for I := 0 to Rows.Count - 1 do + begin + ARow := Rows[I]; + if ARow.Expanded then + ALayout.Add(GetFullName(ARow)); + end; + AObject := InspectedObject; + AIndex := Controller.GetFocusedRowIndex; + InspectedObject := nil; + InspectedObject := AObject; + if ALayout.Count > 0 then + for I := 0 to Rows.Count - 1 do + begin + ARow := Rows[I]; + AFullName := GetFullName(ARow); + for J := 0 to ALayout.Count - 1 do + if ALayout[J] = AFullName then + ARow.Expanded := True; + end; + TopVisibleRowIndex := FSaveTopRowIndex; + FLockRefresh := False; + if not Controller.EditingController.FDeactivating then + Controller.SetFocusedRowIndex(AIndex); + finally + ALayout.Free; + end; + finally + EndUpdate; + FReloaded := True; + FLockRefresh := False; + if not Controller.EditingController.FDeactivating then + Controller.CheckEdit + end; +end; + +procedure TcxCustomRTTIInspector.RemoveListener(AListener: TPersistent); +begin + if (FListeners <> nil) and (FListeners.IndexOf(AListener) >= 0) then + FListeners.Remove(AListener); +end; + +procedure TcxCustomRTTIInspector.Notification(AComponent: TComponent; AOperation: TOperation); +begin + inherited Notification(AComponent, AOperation); + if (AOperation = opRemove) and (AComponent = InspectedObject) then + InspectedObject := nil; +end; + +procedure TcxCustomRTTIInspector.DataChanged; +begin +end; + +function TcxCustomRTTIInspector.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; + MousePos: TPoint): Boolean; +var + ARow: TcxCustomRow; +begin + if ([ssShift] = Shift) and not IsScrollingContent then + begin + if WheelDelta > 0 then + ARow := PrevVisibleRow(FocusedRow) + else + ARow := NextVisibleRow(FocusedRow); + if ARow <> nil then FocusedRow := ARow; + Result := ARow <> nil; + end + else + Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos); +end; + +procedure TcxCustomRTTIInspector.FontChanged; +begin + FBoldFont.Assign(Font); + FBoldFont.Style := FBoldFont.Style + [fsBold]; + inherited FontChanged; +end; + +procedure TcxCustomRTTIInspector.Loaded; +begin + inherited Loaded; + if not IsDesigning and Assigned(InspectedObject) then + begin + HandleNeeded; + CreatePropertyRows(nil); + end; +end; + +function TcxCustomRTTIInspector.FilterProperty(const APropertyName: string): Boolean; +begin + Result := True; + if Assigned(FOnFilterProperty) then FOnFilterProperty(Self, APropertyName, Result); +end; + +function TcxCustomRTTIInspector.FilterPropertyEx(const AFullPropertyName: string): Boolean; +begin + Result := True; + if Assigned(FOnFilterPropertyEx) then FOnFilterPropertyEx(Self, AFullPropertyName, Result); +end; + +function TcxCustomRTTIInspector.FindRowByPropertyName(const APropertyName: string): TcxPropertyRow; +var + I: Integer; +begin + if APropertyName <> '' then + for I := 0 to Rows.Count - 1 do + if Rows[I] is TcxPropertyRow then + begin + Result := TcxPropertyRow(Rows[I]); + if CompareText(APropertyName, Result.PropertyEditor.GetName) = 0 then + Exit; + end; + Result := nil; +end; + +procedure TcxCustomRTTIInspector.FocusRowByPropertyName(const APropertyName: string); +var + ARow: TcxCustomRow; +begin + ARow := FindRowByPropertyName(APropertyName); + if ARow = nil then ARow := FirstVisibleRow; + FocusedRow := ARow; +end; + +function TcxCustomRTTIInspector.GetEditPropertiesClass(APropertyEditor: TcxPropertyEditor): TcxCustomEditPropertiesClass; +var + AFullPropertyName: string; + ARow: TcxPropertyRow; +begin + AFullPropertyName := APropertyEditor.GetName; + ARow := TcxPropertyRow(FParentRow); + while ARow <> nil do + begin + if ARow.PropertyEditor <> nil then + begin + if AFullPropertyName <> '' then + AFullPropertyName := '.' + AFullPropertyName; + AFullPropertyName := ARow.PropertyEditor.GetName + AFullPropertyName; + end; + ARow := TcxPropertyRow(ARow.Parent); + end; + if FilterProperty(APropertyEditor.GetName) and FilterPropertyEx(AFullPropertyName) then + begin + Result := cxGetPropertiesClassByEditor(APropertyEditor); + if Result = TcxColorComboBoxProperties then Exit; + if ipaDialog in APropertyEditor.GetAttributes then + Result := TcxButtonEditProperties; + if ipaValueList in APropertyEditor.GetAttributes then + Result := TcxComboBoxProperties; + if Result = nil then + Result := TcxTextEditProperties + end + else + Result := nil; +end; + +procedure TcxCustomRTTIInspector.PostChangedNotification; +begin + PostMessage(Handle, CN_PropertyChanged, 0, 0); +end; + +procedure TcxCustomRTTIInspector.PrepareEditProperties( + AProperties: TcxCustomEditProperties; APropertyEditor: TcxPropertyEditor); +begin + with TcxCustomEditPropertiesAccess(AProperties) do + begin + //todo: need cxEditors fix + ClickKey := 0; + //remove ipaSubProperties for TcxVariantProperty + ReadOnly := ([ipaReadOnly] * APropertyEditor.GetAttributes <> []); + UseMouseWheel := False; + ValidateOnEnter := True; + OnChange := EditChange; + OnEditValueChanged := EditValueChanged; + end; + if AProperties is TcxCustomTextEditProperties then + TcxCustomTextEditProperties(AProperties).MaxLength := APropertyEditor.GetEditLimit; + if AProperties is TcxComboBoxProperties then + begin + APropertyEditor.GetValues(GetStrProc); + with TcxComboBoxProperties(AProperties) do + begin + DropDownAutoWidth := True; + ImmediateDropDown := False; + Revertable := ipaRevertable in APropertyEditor.GetAttributes; + end; + end; + if AProperties is TcxColorComboBoxProperties then + with TcxColorComboBoxPropertiesAccess(AProperties) do + begin + //todo exteditors bug + //DropDownListStyle := lsEditFixedList; + ColorValueFormat := cxcvHexadecimal; + DropDownListStyle := lsEditList; + MaxMRUColors := 0; + ColorBoxWidth := 16; + PrepareDelphiColorList(False, False); + end; + if AProperties is TcxButtonEditProperties then + with TcxButtonEditProperties(AProperties) do + OnButtonClick := RowButtonClick; + if AProperties is TcxSpinEditProperties then + TcxSpinEditProperties(AProperties).UseCtrlIncrement := True; + APropertyEditor.AdjustInnerEditProperties(AProperties); +end; + +procedure TcxCustomRTTIInspector.DoPropertyChanged; +var + I: Integer; + AIntf: IcxRTTIInspectorHelper; +begin + if FListeners <> nil then + for I := 0 to FListeners.Count - 1 do + if Supports(TObject(FListeners[I]), IcxRTTIInspectorHelper, AIntf) then + begin + AIntf.PropertyChanged(Self); + AIntf := nil; + end; + if Assigned(FOnPropertyChanged) then FOnPropertyChanged(Self); +end; + +procedure TcxCustomRTTIInspector.EditChange(Sender: TObject); +begin + if (PropertyEditor <> nil) and (ipaAutoUpdate in PropertyEditor.GetAttributes) then + begin + if Sender is TcxCustomTextEdit then + begin + try + PropertyEditor.Value := TcxCustomTextEdit(Sender).Text; + DoPropertyChanged; + except + TcxCustomTextEdit(Sender).Text := PropertyEditor.GetValue; + raise + end; + end + else + TrySetValue(TcxCustomEdit(Sender), True); + end; +end; + +procedure TcxCustomRTTIInspector.EditValueChanged(Sender: TObject); +begin + if not ((PropertyEditor <> nil) and (ipaAutoUpdate in PropertyEditor.GetAttributes)) then + TrySetValue(TcxCustomEdit(Sender), False); + Controller.CheckPostData; +end; + +function TcxCustomRTTIInspector.GetControllerClass: TcxCustomControlControllerClass; +begin + Result := TcxRTTIInspectorController; +end; + +procedure TcxCustomRTTIInspector.GetDefaultViewParams(Index: Integer; + AData: TObject; out AParams: TcxViewParams); +var + AIsUnfocusedColor: Boolean; + ARow: TcxPropertyRow; + AFocused: Boolean; + + function IsRootParentComponent: Boolean; + var + AParent: TcxCustomRow; + begin + Result := True; + AParent := ARow.Parent; + while (AParent <> nil) and not AParent.IsRootLevel do + begin + if (AParent is TcxPropertyRow) and + (TcxPropertyRow(AParent).PropertyEditor is TcxComponentProperty) and + (TcxPropertyRow(AParent).PropertyEditor.GetComponent(0) <> InspectedObject) then + begin + Result := False; + Exit; + end; + AParent := AParent.Parent; + end; + end; + +begin + with AParams do + case Index of + vgs_Content: + begin + Bitmap := nil; + with PcxvgContentParamsData(AData)^ do + begin + ARow := TcxPropertyRow(Row); + AFocused := Focused; + end; + AIsUnfocusedColor := not AFocused or ARow.Properties.EditProperties.ReadOnly; + Color := ViewInfo.CalcHelper.GetContentColor(not AIsUnfocusedColor); + if not (AFocused or ARow.IsDefaultValue) then + Font := FBoldFont + else + Font := Self.Font; + TextColor := ViewInfo.CalcHelper.GetContentTextColor; + end; + vgs_Header: + if TcxCustomRow(AData) is TcxPropertyRow then + begin + Bitmap := nil; + ARow := TcxPropertyRow(AData); + Color := ViewInfo.CalcHelper.GetHeaderColor; + Font := Self.Font; + if ARow.PropertyEditor is TcxComponentProperty then + TextColor := clMaroon + else + if IsRootParentComponent then + TextColor := ViewInfo.CalcHelper.GetHeaderTextColor + else + TextColor := clGreen; + end + else + inherited GetDefaultViewParams(Index, AData, AParams); + else + inherited GetDefaultViewParams(Index, AData, AParams); + end; +end; + +function TcxCustomRTTIInspector.GetEditingControllerClass: TcxEditingControllerClass; +begin + Result := TcxRTTIInspectorEditingController; +end; + +function TcxCustomRTTIInspector.GetOptionsBehaviorClass: TcxControlOptionsBehaviorClass; +begin + Result := TcxRTTIInspectorOptionsBehavior; +end; + +function TcxCustomRTTIInspector.GetOptionsViewClass: TcxControlOptionsViewClass; +begin + Result := TcxRTTIInspectorOptionsView; +end; + +function TcxCustomRTTIInspector.CanInvokePropertyEditorDlg: Boolean; +begin + Result := (PropertyEditor <> nil) and + ((ipaDialog in PropertyEditor.GetAttributes) or (ipaValueList in PropertyEditor.GetAttributes)); +end; + +procedure TcxCustomRTTIInspector.CNPropertyChanged(var AMessage: TMsg); +begin + DoPropertyChanged; +end; + +procedure TcxCustomRTTIInspector.CreatePropertyRows(AOldInspectedObject: TPersistent); +var + APropName: string; +begin + APropName := ''; + BeginUpdate; + try + if AOldInspectedObject <> nil then + begin + if PropertyEditor <> nil then APropName := PropertyEditor.GetName; + ReleaseComponentProperties; + end; + if FInspectedObject <> nil then + GetComponentsProperties([FInspectedObject]); + finally + EndUpdate; + end; + //todo: move before EndUpdate; + if not LockRefresh then + FocusRowByPropertyName(APropName); +end; + +procedure TcxCustomRTTIInspector.CreateRows(APropertyEditor: TcxPropertyEditor); +var + AEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + AEditPropertiesClass := GetEditPropertiesClass(APropertyEditor); + if AEditPropertiesClass = nil then + begin + APropertyEditor.Free; + Exit; + end; + FCurrentRow := TcxPropertyRow(AddChild(FParentRow, TcxPropertyRow)); + with FCurrentRow.Properties do + begin + Caption := APropertyEditor.GetName; + FCurrentRow.FIsDefaultValue := APropertyEditor.IsDefaultValue; + EditPropertiesClass := AEditPropertiesClass; + PrepareEditProperties(EditProperties, APropertyEditor); + end; + FCurrentRow.FPropertyEditor := APropertyEditor; + FCurrentRow.Properties.Value := APropertyEditor.Value; + if ipaSubProperties in APropertyEditor.GetAttributes then + begin + FParentRow := FCurrentRow; + APropertyEditor.GetProperties(APropertyEditor.FOwner, CreateRows); + FParentRow := FParentRow.Parent; //check for nil + end; +end; + +procedure TcxCustomRTTIInspector.GetComponentsProperties( + const AInstances: array of TPersistent); + + function FindRootOwner(APersistent: TPersistent): TComponent; + begin + if (APersistent is TComponent) then + Result := TComponent(APersistent).Owner + else Result := nil; + if Result <> nil then + while (Result.Owner <> nil) and not (Result is TDataModule) and + not (Result is TCustomForm) {$IFDEF DELPHI5} and not (Result is TCustomFrame) {$ENDIF} do + Result := Result.Owner; + end; + +var + ComponentList: TcxComponentList; + I: Integer; + AOwner: TComponent; +begin + ComponentList := TcxComponentList.Create; + try + AOwner := FindRootOwner(AInstances[Low(AInstances)]); + for I := Low(AInstances) to High(AInstances) do + begin + ComponentList.Add(TPersistent(AInstances[I])); + if (AOwner <> nil) then + begin + if FindRootOwner(AInstances[I]) <> AOwner then + AOwner := nil; + end else AOwner := nil; + end; + if AOwner = nil then + AOwner := self; + cxGetComponentProperties(AOwner, Self, ComponentList, tkProperties, CreateRows); + FullCollapse; + FParentRow := nil; + FCurrentRow := nil; + finally + ComponentList.Free; + end; +end; + +function TcxCustomRTTIInspector.GetController: TcxRTTIInspectorController; +begin + Result := TcxRTTIInspectorController(FController); +end; + +function TcxCustomRTTIInspector.GetPropertyEditor: TcxPropertyEditor; +begin + if FocusedRow <> nil then + Result := TcxPropertyRow(FocusedRow).PropertyEditor + else + Result := nil; +end; + +procedure TcxCustomRTTIInspector.GetStrProc(const S: string); +begin + TcxComboBoxProperties(TcxPropertyRow(FCurrentRow).Properties.EditProperties).Items.Add(S); +end; + +procedure TcxCustomRTTIInspector.ReleaseComponentProperties; +var + I: Integer; + ARow: TcxCustomRow; +begin + for I := 0 to Rows.Count - 1 do + begin + ARow := Rows[I]; + if ARow is TcxPropertyRow then + with TcxPropertyRow(ARow) do + begin + if PropertyEditor is TcxPropertyEditor then + begin + PropertyEditor.Free; + FPropertyEditor := nil; + end; + end; + end; + if not (csDestroying in ComponentState) then + ClearRows; +end; + +procedure TcxCustomRTTIInspector.RowButtonClick(Sender: TObject; AbsoluteIndex: Integer); +begin + TryInvokePropertyEditorDlg; +end; + +procedure TcxCustomRTTIInspector.SetInspectedObject(Value: TPersistent); +var + OldInspectedObject: TPersistent; +begin + if (FInspectedObject <> Value) and IsValidInspectedObject(Value, Self) then + begin + if not (csDestroying in ComponentState) then + OldInspectedObject := FInspectedObject + else + OldInspectedObject := nil; + if not FLockRefresh and (OldInspectedObject <> nil) and + not OptionsData.CancelOnExit and Controller.IsEditing then + begin + TrySetValue(Controller.EditingController.Edit, True); + end; + FInspectedObject := Value; + if (FInspectedObject <> nil) and (FInspectedObject is TComponent) then + TComponent(Value).FreeNotification(Self); + if ([csDesigning, csLoading, csDestroying] * ComponentState) = [] then + CreatePropertyRows(OldInspectedObject); + end; +end; + +procedure TcxCustomRTTIInspector.TryInvokePropertyEditorDlg; +begin + if CanInvokePropertyEditorDlg then + begin + PropertyEditor.Edit; + RefreshInspectedProperties; + end; +end; + +function TcxCustomRTTIInspector.TrySetValue( + AEdit: TcxCustomEdit; AUseText: Boolean): Boolean; +var + V: Variant; +begin + Result := False; + if FSettingValue or (PropertyEditor = nil) then Exit; + FSettingValue := True; + try + V := PropertyEditor.Value; + try + if AUseText and (AEdit is TcxCustomTextEdit) then + PropertyEditor.Value := TcxCustomTextEdit(AEdit).Text + else + PropertyEditor.Value := AEdit.EditValue; + Result := True; + except + PropertyEditor.Value := V; + AEdit.EditValue := V; + raise; + end; + DoPropertyChanged; + RefreshInspectedProperties; + finally + FSettingValue := False; + end; +end; + +procedure cxDotNetInspectObject(AObject: TPersistent; AInspector: TcxRTTIInspector); +var + I: Integer; + C: TcxCategoryRow; +begin + if AObject <> nil then + with AInspector do + begin + InspectedObject := nil; + BeginUpdate; + try + InspectedObject := AObject; + OptionsBehavior.AlwaysShowEditor := False; + OptionsView.GridLineColor := clBtnFace; + OptionsView.PaintStyle := psdotNet; + C := TcxCategoryRow(Add(TcxCategoryRow)); + with C do + begin + if (AObject is TComponent) and (TComponent(AObject).Name <> '') then + Properties.Caption := TComponent(AObject).Name + ': ' + AObject.ClassName + else + Properties.Caption := AObject.ClassName; + Properties.HeaderAlignmentVert := vaCenter; + Index := 0; + end; + for I := 1 to Rows.Count - 1 do + if Rows[I].Level = 0 then + Rows[I].Parent := C; + finally + FocusedRow := FirstVisibleRow; + EndUpdate; + end; + end; +end; + +{ TcxInspectedObjectPropertyEditor } + +function TcxInspectedObjectPropertyEditor.IsValidComponent(AComponent: TComponent): Boolean; +begin + Result := inherited IsValidComponent(AComponent) and + IsValidInspectedObject(AComponent, Inspector); +end; + +initialization + cxRegisterPropertyEditor(TypeInfo(TColor), nil, '', TcxColorProperty); + cxRegisterPropertyEditor(TypeInfo(TFont), nil, '', TcxFontProperty); + cxRegisterPropertyEditor(TypeInfo(TFontCharset), nil, '', TcxFontCharsetProperty); + cxRegisterPropertyEditor(TypeInfo(TFontName), nil, '', TcxFontNameProperty); + cxRegisterPropertyEditor(TypeInfo(TCursor), nil, '', TcxCursorProperty); + cxRegisterPropertyEditor(TypeInfo(string), TMediaPlayer, 'FileName', TcxMPFilenameProperty); + cxRegisterPropertyEditor(TypeInfo(TCaption), nil, '', TcxCaptionProperty); + cxRegisterPropertyEditor(TypeInfo(TComponent), nil, '', TcxComponentProperty); + cxRegisterPropertyEditor(TypeInfo(TComponentName), nil, '', TcxComponentNameProperty); + cxRegisterPropertyEditor(TypeInfo(TImeName), nil, '', TcxImeNameProperty); + cxRegisterPropertyEditor(TypeInfo(TModalResult), nil, '', TcxModalResultProperty); + cxRegisterPropertyEditor(TypeInfo(TShortCut), nil, '', TcxShortCutProperty); + cxRegisterPropertyEditor(TypeInfo(TTabOrder), nil, '', TcxTabOrderProperty); + cxRegisterPropertyEditor(TypeInfo(TDate), nil, '', TcxDateProperty); + cxRegisterPropertyEditor(TypeInfo(TTime), nil, '', TcxTimeProperty); + cxRegisterPropertyEditor(TypeInfo(TDateTime), nil, '', TcxDateTimeProperty); + cxRegisterPropertyEditor(TypeInfo(Boolean), nil, '', TcxBoolProperty); + cxRegisterPropertyEditor(TypeInfo(TStrings), nil, '', TcxStringsProperty); + cxRegisterPropertyEditor(TypeInfo(TPicture), nil, '', TcxPictureProperty); + cxRegisterPropertyEditor(TypeInfo(TBitmap), nil, '', TcxGraphicProperty); + cxRegisterPropertyEditor(TypeInfo(Variant), nil, '', TcxVariantProperty); + + cxRegisterPropertyEditor(TypeInfo(TPersistent), + TcxCustomRTTIInspector, 'InspectedObject', TcxInspectedObjectPropertyEditor); + + cxRegisterEditPropertiesClass(TcxCaptionProperty, TcxTextEditProperties); + cxRegisterEditPropertiesClass(TcxColorProperty, TcxColorComboBoxProperties); + cxRegisterEditPropertiesClass(TcxComponentNameProperty, TcxTextEditProperties); + cxRegisterEditPropertiesClass(TcxComponentProperty, TcxComboBoxProperties); + cxRegisterEditPropertiesClass(TcxCursorProperty, TcxComboBoxProperties); + cxRegisterEditPropertiesClass(TcxDateProperty, TcxDateEditProperties); + cxRegisterEditPropertiesClass(TcxDateTimeProperty, TcxTextEditProperties); + cxRegisterEditPropertiesClass(TcxFontCharsetProperty, TcxComboBoxProperties); + cxRegisterEditPropertiesClass(TcxFontNameProperty, TcxComboBoxProperties); + cxRegisterEditPropertiesClass(TcxFontProperty, TcxTextEditProperties); + cxRegisterEditPropertiesClass(TcxIntegerProperty, TcxSpinEditProperties); + cxRegisterEditPropertiesClass(TcxImeNameProperty, TcxTextEditProperties); + cxRegisterEditPropertiesClass(TcxModalResultProperty, TcxComboBoxProperties); + cxRegisterEditPropertiesClass(TcxMPFilenameProperty, TcxTextEditProperties); + cxRegisterEditPropertiesClass(TcxPictureProperty, TcxButtonEditProperties); + cxRegisterEditPropertiesClass(TcxShortCutProperty, TcxComboBoxProperties); + cxRegisterEditPropertiesClass(TcxStringsProperty, TcxButtonEditProperties); + cxRegisterEditPropertiesClass(TcxTabOrderProperty, TcxSpinEditProperties); + cxRegisterEditPropertiesClass(TcxTimeProperty, TcxTimeEditProperties); + // + cxRegisterPropertyEditor(TypeInfo(string), TcxCustomEditorRowProperties, 'EditPropertiesClassName', nil); + cxRegisterPropertyEditor(TypeInfo(TcxCustomEditProperties), TcxCustomEditorRowProperties, 'EditProperties', TcxEditPropertiesProperty); + +finalization + ListFreeAndNil(FEditPropertiesClasses); + ListFreeAndNil(FPropertyClasses); + ListFreeAndNil(FPropertyMappers); + +end. + diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxOICollectionEd.dfm b/official/x.35/ExpressVerticalGrid/Sources/cxOICollectionEd.dfm new file mode 100644 index 00000000..157a4b7b --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxOICollectionEd.dfm @@ -0,0 +1,453 @@ +object cxCollectionEditor: TcxCollectionEditor + Left = 534 + Top = 162 + HelpContext = 26150 + HorzScrollBar.Increment = 10 + VertScrollBar.Increment = 11 + AutoScroll = False + BorderIcons = [biSystemMenu] + BorderStyle = bsSizeToolWin + Caption = 'CollectionEditor' + ClientHeight = 142 + ClientWidth = 183 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + KeyPreview = True + OldCreateOrder = True + ShowHint = True + OnClose = FormClose + OnCreate = FormCreate + OnDestroy = FormDestroy + OnKeyDown = FormKeyDown + OnKeyPress = FormKeyPress + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object ToolBar1: TToolBar + Left = 0 + Top = 0 + Width = 183 + Height = 28 + AutoSize = True + ButtonHeight = 24 + ButtonWidth = 24 + EdgeBorders = [ebTop, ebBottom] + Flat = True + Images = ImageList + PopupMenu = PopupMenu2 + TabOrder = 1 + Wrapable = False + object ToolButton1: TToolButton + Left = 0 + Top = 0 + Action = acAdd + end + object ToolButton2: TToolButton + Left = 24 + Top = 0 + Action = acDelete + end + object ToolButton3: TToolButton + Left = 48 + Top = 0 + Width = 8 + Caption = 'ToolButton3' + ImageIndex = 2 + Style = tbsSeparator + end + object ToolButton4: TToolButton + Left = 56 + Top = 0 + Action = acMoveUp + end + object ToolButton5: TToolButton + Left = 80 + Top = 0 + Action = acMoveDown + end + end + object Panel: TPanel + Left = 0 + Top = 28 + Width = 183 + Height = 114 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object ListView1: TListView + Left = 0 + Top = 0 + Width = 183 + Height = 114 + Align = alClient + Columns = <> + ColumnClick = False + DragMode = dmAutomatic + HideSelection = False + ReadOnly = True + RowSelect = True + PopupMenu = PopupMenu1 + ShowColumnHeaders = False + TabOrder = 0 + ViewStyle = vsReport + OnChange = ListView1Change + OnDragDrop = ListView1DragDrop + OnDragOver = ListView1DragOver + OnKeyDown = ListView1KeyDown + OnKeyPress = ListView1KeyPress + end + end + object ImageList: TImageList + Left = 40 + Top = 40 + Bitmap = { + 494C010104000500040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000002000000001002000000000000020 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840084848400848484000000000000000000848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840084848400848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 0000FFFFFF0000FFFF0000000000848484000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 0000FFFFFF0000FFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000000000C6C6 + C60000000000FFFFFF000000000084848400848484000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000000000C6C6 + C60000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000FF + FF00C6C6C6000000000000000000848484000000840000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000FF + FF00C6C6C6000000000000000000848484000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848400000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000 + 000000000000000000000000000084848400000084000000840000FFFF00FFFF + FF0000FFFF00FFFFFF00848484000000840000FFFF00FFFFFF00000000000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000000000FFFFFF008484 + 840000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00000000008484840084848400000084008484840000FF + FF00FFFFFF00848484000000840084848400FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000848484000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008484000084840000848400008484000084840000000000000000 + 0000000000000000000000000000000000008484840000FFFF0000FFFF008484 + 8400FFFFFF0000FFFF008484840000FFFF00FFFFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000848484000000000000008400000084008484 + 840000FFFF000000840000008400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000848400008484000084840000848400008484000084840000848400000000 + 0000000000000000000000000000000000000000000084848400FFFFFF008484 + 840000FFFF008484840000FFFF00FFFFFF0000FFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000848484000000000084848400000084000000 + 84000000840000008400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000848484000000000000000000000000000000 + 0000848400008484000084840000848400008484000084840000848400000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000848484008484840084848400FFFF + FF0084848400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000848484000000000084848400000084000000 + 840000008400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000008484000084840000848400008484000084840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000FFFF008484840000FF + FF00FFFFFF008484840084848400848484008484840000000000000000000000 + 0000000000000000000000000000000000008484840000008400000084000000 + 8400000084008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000000000008484840000FFFF008484 + 840000FFFF008484840000FFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000840000008400848484000000 + 0000000084000000840084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848400000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000008484840000FFFF00000000008484 + 8400FFFFFF00000000008484840000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000840000008400848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF0000000000000000008484 + 840000FFFF000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000008400000084008484840000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFC000C000FFFFFFFF + 80008000FFFFFFFF80008000FFFFFFFF80000000F83FFEFF80000000F83FFC7F + 80000000F83FF83F00000000F83FF01F00008000C007E00F80008000E00FC007 + 00008000F01FF83F00010001F83FF83F81FF11FFFC7FF83F24FFF8FFFEFFF83F + 66FFFC7FFFFFFFFFE7FFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end + object ActionList: TActionList + Images = ImageList + Left = 8 + Top = 40 + object acAdd: TAction + ImageIndex = 0 + ShortCut = 45 + OnExecute = acAddExecute + end + object acDelete: TAction + Enabled = False + ImageIndex = 1 + ShortCut = 46 + OnExecute = acDeleteExecute + OnUpdate = SelectionUpdate + end + object acMoveUp: TAction + Enabled = False + ImageIndex = 2 + ShortCut = 16422 + OnExecute = acMoveUpExecute + OnUpdate = SelectionUpdate + end + object acMoveDown: TAction + Enabled = False + ImageIndex = 3 + ShortCut = 16424 + OnExecute = acMoveDownExecute + OnUpdate = SelectionUpdate + end + object acSelectAll: TAction + Enabled = False + ShortCut = 16449 + OnExecute = acSelectAllExecute + OnUpdate = SelectAllCommandUpdate + end + object acToolbar: TAction + Checked = True + OnExecute = acToolbarExecute + end + object acTextLabels: TAction + OnExecute = acTextLabelsExecute + end + end + object PopupMenu1: TPopupMenu + Images = ImageList + Left = 72 + Top = 40 + object miAdd: TMenuItem + Action = acAdd + end + object miDelete: TMenuItem + Action = acDelete + end + object miMoveUp: TMenuItem + Action = acMoveUp + end + object miMoveDown: TMenuItem + Action = acMoveDown + end + object N1: TMenuItem + Caption = '-' + end + object miToolbar: TMenuItem + Action = acToolbar + end + end + object PopupMenu2: TPopupMenu + Left = 104 + Top = 40 + object miTextLabels: TMenuItem + Action = acTextLabels + end + end +end diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxOICollectionEd.pas b/official/x.35/ExpressVerticalGrid/Sources/cxOICollectionEd.pas new file mode 100644 index 00000000..8a479874 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxOICollectionEd.pas @@ -0,0 +1,948 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressVerticalGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSVERTICALGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxOICollectionEd; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + StdCtrls, Menus, ExtCtrls, ComCtrls, ImgList, ActnList, ToolWin, cxOI, cxClasses; + +const + AM_DeferUpdate = WM_DX + 1; // avoids break-before-make listview ugliness + +type + TcxColOption = (coAdd, coDelete, coMove); + TcxColOptions = set of TcxColOption; + + { TcxCollectionEditor } + + TcxCollectionEditor = class(TForm, IcxRTTIInspectorHelper) + acAdd: TAction; + acDelete: TAction; + acMoveDown: TAction; + acMoveUp: TAction; + acSelectAll: TAction; + acTextLabels: TAction; + acToolbar: TAction; + ImageList: TImageList; + ListView1: TListView; + miAdd: TMenuItem; + miDelete: TMenuItem; + miMoveDown: TMenuItem; + miMoveUp: TMenuItem; + miTextLabels: TMenuItem; + miToolbar: TMenuItem; + N1: TMenuItem; + Panel: TPanel; + PopupMenu1: TPopupMenu; + PopupMenu2: TPopupMenu; + Toolbar1: TToolbar; + ToolButton1: TToolButton; + ToolButton2: TToolButton; + ToolButton3: TToolButton; + ToolButton4: TToolButton; + ToolButton5: TToolButton; + ActionList: TActionList; + procedure acAddExecute(Sender: TObject); + procedure acDeleteExecute(Sender: TObject); + procedure acMoveDownExecute(Sender: TObject); + procedure acMoveUpExecute(Sender: TObject); + procedure acSelectAllExecute(Sender: TObject); + procedure acTextLabelsExecute(Sender: TObject); + procedure acToolbarExecute(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure FormKeyPress(Sender: TObject; var Key: Char); + procedure FormShow(Sender: TObject); + procedure ListView1Change(Sender: TObject; Item: TListItem; Change: TItemChange); + procedure ListView1DragDrop(Sender, Source: TObject; X, Y: Integer); + procedure ListView1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); + procedure ListView1KeyDown(Sender: TObject; var Key: word; Shift: TShiftState); + procedure ListView1KeyPress(Sender: TObject; var Key: Char); + procedure SelectAllCommandUpdate(Sender: TObject); + procedure SelectionUpdate(Sender: TObject); + private + FClosing: Boolean; + FCollectionPropertyName: string; + FStateLock: Integer; + FItemIDList: TList; + FCollectionClassName: string; + FSelectionError: Boolean; + FColOptions: TcxColOptions; + FInspector: TcxCustomRTTIInspector; + function GetRegKey: string; + procedure SetCollectionPropertyName(const Value: string); + procedure AMDeferUpdate(var Msg); message AM_DeferUpdate; + procedure SetColOptions(Value: TcxColOptions); + procedure CloseEditor; + procedure WMActivate(var Message: TWMActivate); message WM_ACTIVATE; + protected + // IcxRTTIInspectorHelper + procedure CloseNonModal(AInspector: TcxCustomRTTIInspector); + procedure PropertyChanged(AInspector: TcxCustomRTTIInspector); + // + function CanAdd(Index: Integer): Boolean; virtual; + procedure Localize; virtual; + procedure LockState; + procedure UnlockState; + property StateLock: Integer read FStateLock; + procedure SelectAll(DoUpdate: Boolean = True); + procedure SelectNone(DoUpdate: Boolean = True); + public + Collection: TCollection; + Component: TComponent; + property Options: TcxColOptions read FColOptions write SetColOptions; + procedure ItemsModified(AInspector: TcxCustomRTTIInspector); virtual; + function GetItemName(Index, ItemIndex: Integer): string; + procedure GetSelection; + procedure SetSelection; + procedure UpdateListbox; + property CollectionPropertyName: string read FCollectionPropertyName + write SetCollectionPropertyName; + property Inspector: TcxCustomRTTIInspector read FInspector; + end; + + TcxCollectionEditorClass = class of TcxCollectionEditor; + + { TcxCollectionProperty } + + TcxCollectionProperty = class(TcxClassProperty) + public + destructor Destroy; override; + procedure Edit; override; + function GetAttributes: TcxPropertyAttributes; override; + function GetEditorClass: TcxCollectionEditorClass; virtual; + function GetColOptions: TcxColOptions; virtual; + function IsDefaultValue: Boolean; override; + end; + +procedure cxShowCollectionEditor(AInspector: TcxCustomRTTIInspector; AComponent: TComponent; + ACollection: TCollection; const PropertyName: string); +function cxShowCollectionEditorClass(AInspector: TcxCustomRTTIInspector; + CollectionEditorClass: TcxCollectionEditorClass; AComponent: TComponent; + ACollection: TCollection; const PropertyName: string; + ColOptions: TcxColOptions = [coAdd, coDelete, coMove]): TcxCollectionEditor; + +implementation + +{$R *.dfm} + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Registry, TypInfo, cxVGridConsts; + +type + TCollectionAccess = class(TCollection); // used for protected method access + TPersistentAccess = class(TPersistent); + +var + cxCollectionEditorsList: TList = nil; + +function cxShowCollectionEditorClass(AInspector: TcxCustomRTTIInspector; + CollectionEditorClass: TcxCollectionEditorClass; AComponent: TComponent; + ACollection: TCollection; const PropertyName: string; + ColOptions: TcxColOptions): TcxCollectionEditor; +var + I: Integer; +begin + if cxCollectionEditorsList = nil then + cxCollectionEditorsList := TList.Create; + for I := 0 to cxCollectionEditorsList.Count-1 do + begin + Result := TcxCollectionEditor(cxCollectionEditorsList[I]); + with Result do + if (Inspector = AInspector) and (Component = AComponent) + and (Collection = ACollection) + and (CompareText(CollectionPropertyName, PropertyName) = 0) then + begin + Show; + BringToFront; + Exit; + end; + end; + Result := CollectionEditorClass.Create(Application); + with Result do + try + Options := ColOptions; + FInspector := AInspector; + AInspector.AddListener(Result); + Collection := ACollection; + FCollectionClassName := ACollection.ClassName; + Component := AComponent; + CollectionPropertyName := PropertyName; + UpdateListbox; + Show; + except + Free; + end; +end; + +procedure cxShowCollectionEditor(AInspector: TcxCustomRTTIInspector; AComponent: TComponent; + ACollection: TCollection; const PropertyName: string); +begin + cxShowCollectionEditorClass(AInspector, TcxCollectionEditor, AComponent, + ACollection, PropertyName); +end; + +{ TcxCollectionProperty } + +destructor TcxCollectionProperty.Destroy; +var + I: Integer; +begin + if Inspector.IsDestroying and (cxCollectionEditorsList <> nil) then + begin + for I := 0 to cxCollectionEditorsList.Count - 1 do + with TcxCollectionEditor(cxCollectionEditorsList[I]) do + if Inspector = Self.Inspector then CloseEditor; + end; + inherited Destroy; +end; + +procedure TcxCollectionProperty.Edit; +var + Obj: TPersistent; +begin + Obj := GetComponent(0); + while (Obj <> nil) and not (Obj is TComponent) do + Obj := TPersistentAccess(Obj).GetOwner; + cxShowCollectionEditorClass(Inspector, GetEditorClass, + TComponent(Obj), TCollection(GetOrdValue), GetName, GetColOptions); +end; + +function TcxCollectionProperty.GetAttributes: TcxPropertyAttributes; +begin + Result := [ipaDialog, ipaReadOnly, ipaSubProperties]; +end; + +function TcxCollectionProperty.GetEditorClass: TcxCollectionEditorClass; +begin + Result := TcxCollectionEditor; +end; + +function TcxCollectionProperty.GetColOptions: TcxColOptions; +begin + Result := [coAdd, coDelete, coMove]; +end; + +function TcxCollectionProperty.IsDefaultValue: Boolean; +begin + Result := False; +end; + +{ TcxCollectionEditor } + +procedure TcxCollectionEditor.acAddExecute(Sender: TObject); +var + Item: TListItem; + PrevCount: Integer; +begin + SelectNone(False); + Collection.BeginUpdate; + try + PrevCount := Collection.Count + 1; + Collection.Add; + // Take into account collections that free items + if PrevCount <> Collection.Count then + UpdateListBox + else + ListView1.Selected := ListView1.Items.Add; + finally + Collection.EndUpdate; + end; + SetSelection; + Item := ListView1.Items[ListView1.Items.Count-1]; + Item.Focused := True; + Item.MakeVisible(False); +end; + +procedure TcxCollectionEditor.acDeleteExecute(Sender: TObject); +var + I, J: Integer; +begin + Collection.BeginUpdate; + try + Inspector.InspectedObject := nil; + if ListView1.Selected <> nil then + J := ListView1.Selected.Index + else + J := -1; + if ListView1.SelCount = Collection.Count then + Collection.Clear + else if ListView1.SelCount > 0 then + for I := ListView1.Items.Count - 1 downto 0 do + if ListView1.Items[I].Selected then + Collection.Items[I].Free; + finally + Collection.EndUpdate; + end; + UpdateListbox; + if J >= ListView1.Items.Count then + J := ListView1.Items.Count - 1; + if (J > -1) and (J < ListView1.Items.Count) then + ListView1.Selected := ListView1.Items[J]; + SetSelection; +end; + +procedure TcxCollectionEditor.acMoveDownExecute(Sender: TObject); +var + I, InsPos: Integer; +begin + if (ListView1.SelCount = 0) or + (ListView1.SelCount = Collection.Count) then Exit; + + InsPos := ListView1.Items.Count - 1; + while not ListView1.Items[InsPos].Selected do + Dec(InsPos); + if InsPos < (ListView1.Items.Count -1) then Inc(InsPos); + + Collection.BeginUpdate; + try + for I := ListView1.Items.Count - 1 downto 0 do + if ListView1.Items[I].Selected then + begin + Collection.Items[I].Index := InsPos; + Dec(InsPos); + end; + finally + Collection.EndUpdate; + end; + GetSelection; +end; + +procedure TcxCollectionEditor.acMoveUpExecute(Sender: TObject); +var + I, InsPos: Integer; +begin + if (ListView1.SelCount = 0) or + (ListView1.SelCount = Collection.Count) then Exit; + + InsPos := 0; + while not ListView1.Items[InsPos].Selected do + Inc(InsPos); + if InsPos > 0 then Dec(InsPos); + + Collection.BeginUpdate; + try + for I := 0 to ListView1.Items.Count - 1 do + if ListView1.Items[I].Selected then + begin + Collection.Items[I].Index := InsPos; + Inc(InsPos); + end; + finally + Collection.EndUpdate; + end; + GetSelection; +end; + +procedure TcxCollectionEditor.acSelectAllExecute(Sender: TObject); +begin + SelectAll; +end; + +procedure TcxCollectionEditor.acTextLabelsExecute(Sender: TObject); +begin + with acTextLabels do + begin + Checked := not Checked; + Toolbar1.ShowCaptions := Checked; + if not Checked then + begin + Toolbar1.ButtonHeight := 24; + Toolbar1.ButtonWidth := 24; + end; + end; +end; + +procedure TcxCollectionEditor.acToolbarExecute(Sender: TObject); +begin + with acToolbar do + begin + Checked := not Checked; + Toolbar1.Visible := Checked; + end; +end; + +procedure TcxCollectionEditor.SetColOptions(Value: TcxColOptions); +begin + FColOptions := Value; + acAdd.Enabled := coAdd in Value; +end; + +procedure TcxCollectionEditor.CloseEditor; +begin + FClosing := True; + Collection := nil; + Component := nil; + Close; +end; + +procedure TcxCollectionEditor.WMActivate(var Message: TWMActivate); +begin + inherited; + if (Message.Active <> WA_INACTIVE) and (Collection <> nil) then + SetSelection; +end; + +procedure TcxCollectionEditor.ItemsModified(AInspector: TcxCustomRTTIInspector); +begin + if FClosing then exit; + if Collection <> nil then + begin + UpdateListbox; + GetSelection; + end; +end; + +function TcxCollectionEditor.GetItemName(Index, ItemIndex: Integer): string; +begin + with TCollectionAccess(Collection) do + if GetAttrCount < 1 then + Result := Format('%d - %s',[ItemIndex, Collection.Items[ItemIndex].DisplayName]) + else Result := GetItemAttr(Index, ItemIndex); +end; + +function TcxCollectionEditor.GetRegKey: string; +begin + Result := '\Software\Borland\Delphi\3.0\Collection Editor'; +end; + +procedure TcxCollectionEditor.GetSelection; +var + I: Integer; + Item: TCollectionItem; +{$IFDEF RTTIMULTISELECTION} + List: TList; +{$ENDIF} +begin + LockState; + try + ListView1.Selected := nil; + finally + UnlockState; + end; +{$IFDEF RTTIMULTISELECTION} + List := TList.Create; + try + Inspector.GetSelections(List); + if (List.Count = 0) or (List.Count > Collection.Count) then Exit; + if not ((List[0] = Component) or (List[0] = Collection) + or (TcxCollectionEditor(List[0]).GetOwner = Collection)) then Exit; + if List.Count > ListView1.Items.Count then + UpdateListbox; + finally + List.Free; + end; +{$ELSE} + UpdateListbox; +{$ENDIF} + LockState; + try + for I := FItemIDList.Count - 1 downto 0 do + begin + Item := Collection.FindItemID(Integer(FItemIDList[I])); + if Item <> nil then + ListView1.Items[Item.Index].Selected := True + else FItemIDList.Delete(I); + end; + finally + UnlockState; + end; +end; + +procedure TcxCollectionEditor.LockState; +begin + Inc(FStateLock); +end; + +procedure TcxCollectionEditor.SetCollectionPropertyName(const Value: string); +begin + if Value <> FCollectionPropertyName then + begin + FCollectionPropertyName := Value; + Caption := Format(cxGetResourceString(@cxSvgRTTICollectionEditCaption), + [Component.Name, DotSep, Value]); + end; +end; + +procedure TcxCollectionEditor.SetSelection; +var + I: Integer; +{$IFDEF RTTIMULTISELECTION} + List: TList; +{$ENDIF} +begin + UpdateListBox; + if FSelectionError then Exit; + try + if ListView1.SelCount > 0 then + begin + {$IFDEF RTTIMULTISELECTION} + List := TList.Create; + try + {$ENDIF} + FItemIDList.Clear; + for I := 0 to ListView1.Items.Count - 1 do + if ListView1.Items[I].Selected then + begin + {$IFDEF RTTIMULTISELECTION} + List.Add(Collection.Items[I]); + {$ENDIF} + Inspector.InspectedObject := Collection.Items[I]; + FItemIDList.Add(Pointer(Collection.Items[I].ID)); + end; + {$IFDEF RTTIMULTISELECTION} + Inspector.SetSelections(List); + finally + List.Free; + end; + {$ENDIF} + end + else + Inspector.InspectedObject := Collection; + Inspector.RefreshInspectedProperties; + except + FSelectionError := True; + Application.HandleException(ExceptObject); + Close; + end; +end; + +procedure TcxCollectionEditor.UnlockState; +begin + Dec(FStateLock); +end; + +procedure TcxCollectionEditor.UpdateListbox; +var + I, J: Integer; + + procedure UpdateSizes; + var + I: Integer; + begin + with TRegIniFile.Create(GetRegKey) do + try + Top := ReadInteger(FCollectionClassName, 'Top', 100); + Left := ReadInteger(FCollectionClassName, 'Left', 100); + Width := ReadInteger(FCollectionClassName, 'Width', Width); + Height := ReadInteger(FCollectionClassName, 'Height', Height); + ToolBar1.Visible := ReadBool(FCollectionClassName, 'Toolbar', True); + acTextLabels.Checked := ReadBool(FCollectionClassName, 'TextLabels', False); + ListView1.HandleNeeded; + if ListView1.Columns.Count > 1 then + for I := 0 to ListView1.Columns.Count - 1 do + ListView1.Column[I].Width := ReadInteger(FCollectionClassName, + Format('Column%d', [I]), ListView1.Column[I].WidthType); + finally + Free; + end; + end; + + procedure UpdateColumns; + var + I: Integer; + begin + if (Collection <> nil) and + (((TCollectionAccess(Collection).GetAttrCount > 0) and + (ListView1.Columns.Count <> TCollectionAccess(Collection).GetAttrCount)) or + ((ListView1.Columns.Count = 0) and + (TCollectionAccess(Collection).GetAttrCount < 1))) then + begin + ListView1.HandleNeeded; + with TCollectionAccess(Collection) do + begin + if GetAttrCount >= 1 then + for I := 0 to GetAttrCount - 1 do + with ListView1.Columns.Add do + begin + Caption := GetAttr(I); + Width := -2; + end + else + with ListView1.Columns.Add do + Width := -1; + if GetAttrCount >= 1 then + ListView1.ShowColumnHeaders := True + end; + UpdateSizes; + end; + end; + + procedure FetchItems(List: TStrings); + var + I, J: Integer; + SubList: TStringList; + begin + if Collection <> nil then + for I := 0 to Collection.Count - 1 do + if CanAdd(I) then + begin + SubList := TStringList.Create; + for J := 1 to TCollectionAccess(Collection).GetAttrCount - 1 do + SubList.Add(GetItemName(J, I)); + List.AddObject(GetItemName(0, I), SubList); + end; + + end; + + function ItemsEqual(ListItems: TListItems; Items: TStrings): Boolean; + var + I, J: Integer; + begin + Result := False; + if ListItems.Count <> Items.Count then Exit; + for I := 0 to ListItems.Count - 1 do + begin + if ListItems[I].Caption = Items[I] then + begin + for J := 0 to ListItems[I].SubItems.Count - 1 do + if ListItems[I].SubItems[J] <> TStrings(Items.Objects[I])[J] then + Exit; + end + else + Exit; + end; + Result := True; + end; + +var + TmpItems: TStringList; +begin + if Collection = nil then Exit; + LockState; + try + TmpItems := TStringList.Create; + FetchItems(TmpItems); + try + if (TmpItems.Count = 0) or not ItemsEqual(ListView1.Items, TmpItems) then + begin + ListView1.Items.BeginUpdate; + try + UpdateColumns; + ListView1.Items.Clear; + for I := 0 to TmpItems.Count - 1 do + with ListView1.Items.Add do + begin + Caption := TmpItems[I]; + for J := 0 to TStrings(TmpItems.Objects[I]).Count - 1 do + SubItems.Add(TStrings(TmpItems.Objects[I])[J]); + end; + finally + ListView1.Items.EndUpdate; + end; + end; + finally + for I := 0 to TmpItems.Count - 1 do + TStrings(TmpItems.Objects[I]).Free; + TmpItems.Free; + end; + finally + UnlockState; + end; +end; + +procedure TcxCollectionEditor.FormClose(Sender: TObject; + var Action: TCloseAction); +var + I: Integer; +begin + if Component <> nil then + Inspector.InspectedObject := Component; + with TRegIniFile.Create(GetRegKey) do + try + EraseSection(FCollectionClassName); + WriteInteger(FCollectionClassName, 'Left', Left); + WriteInteger(FCollectionClassName, 'Top', Top); + WriteInteger(FCollectionClassName, 'Width', Width); + WriteInteger(FCollectionClassName, 'Height', Height); + WriteBool(FCollectionClassName, 'TextLabels', acTextLabels.Checked); + WriteBool(FCollectionClassName, 'Toolbar', ToolBar1.Visible); + for I := 0 to ListView1.Columns.Count - 1 do + WriteInteger(FCollectionClassName, Format('Column%d', [I]), + ListView1.Column[I].WidthType); + finally + Free; + end; + Action := caFree; + LockState; +end; + +procedure TcxCollectionEditor.FormCreate(Sender: TObject); +begin + Localize; + FItemIdList := TList.Create; + cxCollectionEditorsList.Add(Self); +end; + +procedure TcxCollectionEditor.FormDestroy(Sender: TObject); +begin + Inspector.RemoveListener(Self); + FItemIdList.Free; + if cxCollectionEditorsList <> nil then + cxCollectionEditorsList.Remove(Self); +end; + +procedure TcxCollectionEditor.FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if Key = VK_PROCESSKEY then + with Inspector do + if CanFocusEx then + begin + SetFocus; + ShowEdit; + end; +end; + +procedure TcxCollectionEditor.FormKeyPress(Sender: TObject; var Key: Char); +begin + if Key = #13 then + with Inspector do + if CanFocusEx then + begin + SetFocus; + ShowEdit; + end; +end; + +procedure TcxCollectionEditor.FormShow(Sender: TObject); +{$IFNDEF DELPHI6} +var + ALeft: Integer; + ATop: Integer; +{$ENDIF} +begin +{$IFNDEF DELPHI6} + ALeft := Left; + ATop := Top; + if Left + Width > Monitor.Left + Monitor.Width then + ALeft := Monitor.Left + Monitor.Width - Width; + if Left < Monitor.Left then + ALeft := Monitor.Left; + if Top + Height > Monitor.Top + Monitor.Height then + ATop := Monitor.Top + Monitor.Height - Height; + if Top < Monitor.Top then + ATop := Monitor.Top; + SetBounds(ALeft, ATop, Width, Height); +{$ELSE} + MakeFullyVisible; +{$ENDIF} +end; + +procedure TcxCollectionEditor.ListView1Change(Sender: TObject; + Item: TListItem; Change: TItemChange); +var + Msg: TMsg; +begin + if (Change = ctState) and (FStateLock = 0) then + if not PeekMessage(Msg, Handle, AM_DeferUpdate, AM_DeferUpdate, PM_NOREMOVE) then + PostMessage(Handle, AM_DeferUpdate, 0, 0); +end; + +procedure TcxCollectionEditor.ListView1DragDrop(Sender, Source: TObject; X, + Y: Integer); +var + Item: TListItem; + I, J, InsPos: Integer; + L: TList; +begin + Item := ListView1.GetItemAt(X, Y); + if Item <> nil then + InsPos := Item.Index + else Exit; + L := TList.Create; + try + for I := 0 to ListView1.Items.Count - 1 do + if ListView1.Items[I].Selected then + L.Add(Collection.Items[I]); + + Collection.BeginUpdate; + try + for I := 0 to L.Count - 1 do + with TCollectionItem(L[I]) do + begin + J := Index; + Index := InsPos; + if (J > InsPos) and (InsPos < Collection.Count) then + Inc(InsPos); + end; + finally + Collection.EndUpdate; + end; + finally + L.Free; + end; + GetSelection; +end; + +procedure TcxCollectionEditor.ListView1DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); +var + Item: TListItem; +begin + Item := ListView1.GetItemAt(X, Y); + Accept := (Item <> nil) and (Source = ListView1) and + (not Item.Selected); +end; + +procedure TcxCollectionEditor.ListView1KeyDown(Sender: TObject; var Key: word; + Shift: TShiftState); +begin + if Key = VK_PROCESSKEY then + Inspector.SetFocus; +end; + +procedure TcxCollectionEditor.ListView1KeyPress(Sender: TObject; + var Key: Char); +begin + if (Key in ['!'..'~']) and Inspector.CanFocusEx then + begin + Inspector.SetFocus; + Inspector.ShowEditByKey(Key); + Key := #0; + end; +end; + +procedure TcxCollectionEditor.SelectAllCommandUpdate(Sender: TObject); +begin + (Sender as TAction).Enabled := ListView1.Items.Count > 0; +end; + +procedure TcxCollectionEditor.AMDeferUpdate(var Msg); +begin + if FStateLock = 0 then + begin + if TMessage(Msg).WParam = 0 then + SetSelection + else + ItemsModified(nil); + end + else + PostMessage(Handle, AM_DeferUpdate, TMessage(Msg).WParam, TMessage(Msg).LParam); +end; + +procedure TcxCollectionEditor.SelectionUpdate(Sender: TObject); +var + Enabled: Boolean; +begin + Enabled := ListView1.Selected <> nil; + if Enabled then + if Sender = acDelete then + Enabled := coDelete in Options + else + if (Sender = acMoveUp) or (Sender = acMoveDown) then + Enabled := coMove in Options; + (Sender as TAction).Enabled := Enabled; +end; + +procedure TcxCollectionEditor.SelectAll(DoUpdate: Boolean); +var + I: Integer; +begin + LockState; + ListView1.Items.BeginUpdate; + try + for I := 0 to Listview1.Items.Count-1 do + Listview1.Items[I].Selected := True; + finally + ListView1.Items.EndUpdate; + UnlockState; + if DoUpdate then SetSelection; + end; +end; + +procedure TcxCollectionEditor.SelectNone(DoUpdate: Boolean); +var + I: Integer; +begin + LockState; + ListView1.Items.BeginUpdate; + try + for I := 0 to Listview1.Items.Count-1 do + Listview1.Items[I].Selected := False; + finally + ListView1.Items.EndUpdate; + UnlockState; + if DoUpdate then SetSelection; + end; +end; + +procedure TcxCollectionEditor.CloseNonModal(AInspector: TcxCustomRTTIInspector); +begin + CloseEditor; +end; + +procedure TcxCollectionEditor.PropertyChanged( + AInspector: TcxCustomRTTIInspector); +begin + if FStateLock > 0 then Exit; + ItemsModified(AInspector); +end; + +function TcxCollectionEditor.CanAdd(Index: Integer): Boolean; +begin + Result := True; +end; + +procedure TcxCollectionEditor.Localize; +begin + acAdd.Caption := cxGetResourceString(@cxSvgRTTICollectionAdd); + acAdd.Hint := cxGetResourceString(@cxSvgRTTICollectionAddHint); + acDelete.Caption := cxGetResourceString(@cxSvgRTTICollectionDelete); + acDelete.Hint := cxGetResourceString(@cxSvgRTTICollectionDeleteHint); + acSelectAll.Caption := cxGetResourceString(@cxSvgRTTICollectionSelectAll); + acToolbar.Caption := cxGetResourceString(@cxSvgRTTICollectionToolbar); + acTextLabels.Caption := cxGetResourceString(@cxSvgRTTICollectionTextLabel); + acMoveUp.Caption := cxGetResourceString(@cxSvgRTTICollectionMoveUp); + acMoveUp.Hint := cxGetResourceString(@cxSvgRTTICollectionMoveUpHint); + acMoveDown.Caption := cxGetResourceString(@cxSvgRTTICollectionMoveDown); + acMoveDown.Hint := cxGetResourceString(@cxSvgRTTICollectionMoveDownHint); +end; + +initialization + cxRegisterPropertyEditor(TypeInfo(TCollection), nil, '', TcxCollectionProperty); + +finalization + cxCollectionEditorsList.Free; + cxCollectionEditorsList := nil; +end. diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxOIPictureEd.dfm b/official/x.35/ExpressVerticalGrid/Sources/cxOIPictureEd.dfm new file mode 100644 index 00000000..9c0cd8e1 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxOIPictureEd.dfm @@ -0,0 +1,121 @@ +object cxfmPictureEditor: TcxfmPictureEditor + Left = 295 + Top = 158 + AutoScroll = False + BorderIcons = [biSystemMenu] + Caption = 'Picture Editor' + ClientHeight = 326 + ClientWidth = 368 + Color = clBtnFace + Constraints.MinHeight = 220 + Constraints.MinWidth = 200 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + OnPaint = FormPaint + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object Bevel1: TBevel + Left = 8 + Top = 287 + Width = 352 + Height = 4 + Anchors = [akLeft, akRight, akBottom] + Shape = bsTopLine + end + object Image: TcxImage + Left = 8 + Top = 8 + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 8 + Height = 273 + Width = 268 + end + object btnCancel: TcxButton + Left = 264 + Top = 297 + Width = 81 + Height = 22 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 0 + end + object btnOk: TcxButton + Left = 178 + Top = 296 + Width = 80 + Height = 22 + Anchors = [akRight, akBottom] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnClear: TcxButton + Left = 282 + Top = 120 + Width = 79 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'C&lear' + TabOrder = 2 + OnClick = btnClearClick + end + object btnCopy: TcxButton + Left = 282 + Top = 64 + Width = 79 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Copy' + TabOrder = 3 + OnClick = btnCopyClick + end + object btnLoad: TcxButton + Left = 282 + Top = 8 + Width = 79 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Load...' + TabOrder = 4 + OnClick = btnLoadClick + end + object btnPaste: TcxButton + Left = 282 + Top = 92 + Width = 79 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Paste' + TabOrder = 5 + OnClick = btnPasteClick + end + object btnSave: TcxButton + Left = 282 + Top = 36 + Width = 79 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Save...' + TabOrder = 6 + OnClick = btnSaveClick + end + object Panel1: TPanel + Left = 24 + Top = 24 + Width = 236 + Height = 241 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + Color = clWindow + TabOrder = 7 + end +end diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxOIPictureEd.pas b/official/x.35/ExpressVerticalGrid/Sources/cxOIPictureEd.pas new file mode 100644 index 00000000..cb18e813 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxOIPictureEd.pas @@ -0,0 +1,290 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressVerticalGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSVERTICALGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxOIPictureEd; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + ExtCtrls, ExtDlgs, Buttons, StdCtrls, Menus, cxLookAndFeelPainters, + cxControls, cxContainer, cxEdit, cxImage, cxButtons, cxLookAndFeels, + ComCtrls; + +type + TcxfmPictureEditor = class(TForm) + btnLoad: TcxButton; + btnSave: TcxButton; + btnCopy: TcxButton; + btnPaste: TcxButton; + btnClear: TcxButton; + btnCancel: TcxButton; + btnOk: TcxButton; + Image: TcxImage; + Bevel1: TBevel; + Panel1: TPanel; + procedure btnLoadClick(Sender: TObject); + procedure btnSaveClick(Sender: TObject); + procedure btnClearClick(Sender: TObject); + procedure btnCopyClick(Sender: TObject); + procedure btnPasteClick(Sender: TObject); + procedure FormPaint(Sender: TObject); + procedure FormResize(Sender: TObject); + private + FSizeGripBounds: TRect; + FChained: Boolean; + FNextWindow: HWND; + FGraphicFilter: string; + function GetSaveGraphicFilter: string; + procedure ForwardMessage(var Message: TMessage); + procedure WMChangeCBChain(var Message: TWMChangeCBChain); message WM_CHANGECBCHAIN; + procedure WMDrawClipboard(var Message: TMessage); message WM_DRAWCLIPBOARD; + procedure WMNCDestroy(var Message: TWMNCDestroy); message WM_NCDESTROY; + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + procedure DestroyWindowHandle; override; + function HasPicture: Boolean; + procedure UpdateButtons; + end; + + PcxPictureEditorDlgData = ^TcxPictureEditorDlgData; + TcxPictureEditorDlgData = record + Caption: string; + ClipboardFormat: Word; + GraphicFilter: string; + LookAndFeel: TcxLookAndFeel; + Picture: TPicture; + end; + +function cxShowPictureEditor(const AData: PcxPictureEditorDlgData): Boolean; + +implementation + +{$R *.DFM} + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + ClipBrd, cxClasses, cxVGridConsts, cxEditConsts, dxThemeConsts, + dxThemeManager, dxUxTheme; + +function cxShowPictureEditor(const AData: PcxPictureEditorDlgData): Boolean; +var + Form: TcxfmPictureEditor; + I: Integer; +begin + Form := TcxfmPictureEditor.Create(nil); + with Form do + try + Image.Style.LookAndFeel.MasterLookAndFeel := AData.LookAndFeel; + for I := 0 to ComponentCount - 1 do + if Components[I] is TcxButton then + TcxButton(Components[I]).LookAndFeel.MasterLookAndFeel := AData.LookAndFeel; + btnCopy.Caption := cxGetResourceString(@cxSMenuItemCaptionCopy); + btnPaste.Caption := cxGetResourceString(@cxSMenuItemCaptionPaste); + btnClear.Caption := cxGetResourceString(@cxSMenuItemCaptionDelete); + btnLoad.Caption := cxGetResourceString(@cxSMenuItemCaptionLoad); + btnSave.Caption := cxGetResourceString(@cxSMenuItemCaptionSave); + btnOK.Caption := cxGetResourceString(@cxSvgOKCaption); + btnCancel.Caption := cxGetResourceString(@cxSvgCancelCaption); + Panel1.Caption := cxGetResourceString(@cxSvgRTTIInspectorEmptyGlyph); + Image.Picture := AData^.Picture; + Caption := AData^.Caption; + FGraphicFilter := AData^.GraphicFilter; + Image.ClipboardFormat := AData^.ClipboardFormat; + UpdateButtons; + Result := ShowModal = mrOK; + if Result then + AData^.Picture.Assign(Image.Picture); + finally + Free; + end; +end; + +procedure TcxfmPictureEditor.CreateWnd; +begin + inherited CreateWnd; + if Handle <> 0 then + begin + FNextWindow := SetClipboardViewer(Handle); + FChained := True; + end; + SendMessage(Self.Handle, WM_SETICON, 1, 0); +end; + +procedure TcxfmPictureEditor.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + Params.ExStyle := WS_EX_DLGMODALFRAME or WS_EX_WINDOWEDGE; +end; + +procedure TcxfmPictureEditor.DestroyWindowHandle; +begin + if FChained then + begin + ChangeClipboardChain(Handle, FNextWindow); + FChained := False; + end; + FNextWindow := 0; + inherited DestroyWindowHandle; +end; + +procedure TcxfmPictureEditor.FormPaint(Sender: TObject); +var + ATheme: TdxTheme; + R: TRect; +begin + R := ClientRect; + R.Left := R.Right - GetSystemMetrics(SM_CXVSCROLL); + R.Top := R.Bottom - GetSystemMetrics(SM_CYHSCROLL); + if btnOk.LookAndFeel.NativeStyle and AreVisualStylesAvailable([totScrollBar]) then + begin + ATheme := OpenTheme(totScrollBar); + DrawThemeBackground(ATheme, Canvas.Handle, SBP_SIZEBOX, SZB_RIGHTALIGN, @R); + end + else + DrawFrameControl(Canvas.Handle, R, DFC_SCROLL, DFCS_SCROLLSIZEGRIP); +end; + +procedure TcxfmPictureEditor.FormResize(Sender: TObject); +begin + GetWindowRect(Handle, FSizeGripBounds); + FSizeGripBounds.Left := FSizeGripBounds.Right - GetSystemMetrics(SM_CXVSCROLL); + FSizeGripBounds.Top := FSizeGripBounds.Bottom - GetSystemMetrics(SM_CYHSCROLL); + Invalidate; +end; + +procedure TcxfmPictureEditor.ForwardMessage(var Message: TMessage); +begin + if FNextWindow <> 0 then + with Message do + SendMessage(FNextWindow, Msg, WParam, LParam); +end; + +procedure TcxfmPictureEditor.WMChangeCBChain(var Message: TWMChangeCBChain); +begin + if Message.Remove = FNextWindow then + FNextWindow := Message.Next + else ForwardMessage(TMessage(Message)); + inherited; +end; + +procedure TcxfmPictureEditor.WMDrawClipboard(var Message: TMessage); +begin + UpdateButtons; + ForwardMessage(Message); + inherited; +end; + +procedure TcxfmPictureEditor.WMNCDestroy(var Message: TWMNCDestroy); +begin + if FChained then + begin + ChangeClipboardChain(Handle, FNextWindow); + FChained := False; + FNextWindow := 0; + end; + inherited; +end; + +procedure TcxfmPictureEditor.WMNCHitTest(var Message: TWMNCHitTest); +begin + inherited; + if not (csDesigning in ComponentState) then + begin + if Message.Result in [HTCLIENT, HTRIGHT, HTBOTTOM] then + if PtInRect(FSizeGripBounds, GetMouseCursorPos) then + Message.Result := HTBOTTOMRIGHT; + end; +end; + +function TcxfmPictureEditor.HasPicture: Boolean; +begin + Result := (Image.Picture.Graphic <> nil) and not Image.Picture.Graphic.Empty; +end; + +procedure TcxfmPictureEditor.UpdateButtons; +begin + btnSave.Enabled := HasPicture; + btnCopy.Enabled := HasPicture; + btnPaste.Enabled := Clipboard.HasFormat(Image.ClipboardFormat); + btnClear.Enabled := HasPicture; + Panel1.Visible := not HasPicture; +end; + +procedure TcxfmPictureEditor.btnLoadClick(Sender: TObject); +begin + Image.Properties.CustomFilter := FGraphicFilter; + Image.LoadFromFile; + UpdateButtons; +end; + +procedure TcxfmPictureEditor.btnSaveClick(Sender: TObject); +begin + Image.Properties.CustomFilter := GetSaveGraphicFilter; + Image.SaveToFile; + UpdateButtons; +end; + +procedure TcxfmPictureEditor.btnClearClick(Sender: TObject); +begin + Image.Clear; + UpdateButtons; +end; + +procedure TcxfmPictureEditor.btnCopyClick(Sender: TObject); +begin + Image.CopyToClipboard; + UpdateButtons; +end; + +procedure TcxfmPictureEditor.btnPasteClick(Sender: TObject); +begin + Image.PasteFromClipboard; + UpdateButtons; +end; + +function TcxfmPictureEditor.GetSaveGraphicFilter: string; +begin + if Image.Picture.Graphic = nil then + Result := GraphicFilter(TGraphic) + else + Result := GraphicFilter(TGraphicClass(Image.Picture.Graphic.ClassType)); +end; + +end. diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxOIStringsEd.dfm b/official/x.35/ExpressVerticalGrid/Sources/cxOIStringsEd.dfm new file mode 100644 index 00000000..f2001cc2 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxOIStringsEd.dfm @@ -0,0 +1,100 @@ +object cxfmStringsEditor: TcxfmStringsEditor + Left = 370 + Top = 256 + ActiveControl = Memo1 + AutoScroll = False + Caption = 'String List Editor' + ClientHeight = 317 + ClientWidth = 412 + Color = clBtnFace + Constraints.MinHeight = 200 + Constraints.MinWidth = 200 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + OnPaint = FormPaint + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object pnlClient: TPanel + Left = 0 + Top = 0 + Width = 412 + Height = 281 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + BorderWidth = 4 + TabOrder = 0 + object GroupBox: TGroupBox + Left = 4 + Top = 4 + Width = 404 + Height = 273 + Align = alClient + TabOrder = 0 + object pnlClientTop: TPanel + Left = 2 + Top = 15 + Width = 400 + Height = 19 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Label1: TLabel + Left = 9 + Top = 1 + Width = 32 + Height = 13 + Caption = 'Label1' + end + end + object pnlClientClient: TPanel + Left = 2 + Top = 34 + Width = 400 + Height = 237 + Align = alClient + BevelOuter = bvNone + BorderWidth = 5 + TabOrder = 1 + object Memo1: TcxMemo + Left = 5 + Top = 5 + Align = alClient + Lines.Strings = ( + 'Memo1') + Properties.OnChange = Memo1PropertiesChange + TabOrder = 0 + Height = 227 + Width = 390 + end + end + end + end + object btnOK: TcxButton + Left = 224 + Top = 286 + Width = 81 + Height = 23 + Anchors = [akRight, akBottom] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TcxButton + Left = 311 + Top = 286 + Width = 80 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end +end diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxOIStringsEd.pas b/official/x.35/ExpressVerticalGrid/Sources/cxOIStringsEd.pas new file mode 100644 index 00000000..25c0644f --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxOIStringsEd.pas @@ -0,0 +1,168 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressVerticalGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSVERTICALGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxOIStringsEd; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, Buttons, ExtCtrls, cxLookAndFeels, cxLookAndFeelPainters, + cxButtons, cxControls, cxContainer, cxEdit, cxTextEdit, cxMemo, ComCtrls, + Menus; + +type + TcxfmStringsEditor = class(TForm) + pnlClient: TPanel; + GroupBox: TGroupBox; + pnlClientTop: TPanel; + Label1: TLabel; + pnlClientClient: TPanel; + Memo1: TcxMemo; + btnOK: TcxButton; + btnCancel: TcxButton; + procedure Memo1PropertiesChange(Sender: TObject); + procedure FormPaint(Sender: TObject); + procedure FormResize(Sender: TObject); + private + FSizeGripBounds: TRect; + procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST; + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + procedure DoShow; override; + end; + + PcxStringsEditorDlgData = ^TcxStringsEditorDlgData; + TcxStringsEditorDlgData = record + Caption: string; + LookAndFeel: TcxLookAndFeel; + Text: string; + end; + +function cxShowStringsEditor(const AData: PcxStringsEditorDlgData): Boolean; + +implementation + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + dxThemeConsts, dxThemeManager, dxUxTheme, cxClasses, cxVGridConsts; + +{$R *.DFM} + +function cxShowStringsEditor(const AData: PcxStringsEditorDlgData): Boolean; +var + Form: TcxfmStringsEditor; +begin + Form := TcxfmStringsEditor.Create(nil); + with Form do + try + Caption := AData.Caption; + Memo1.Text := AData.Text; + Memo1.Style.LookAndFeel.MasterLookAndFeel := AData.LookAndFeel; + btnOK.Caption := cxGetResourceString(@cxSvgOKCaption); + btnOK.LookAndFeel.MasterLookAndFeel := AData.LookAndFeel; + btnCancel.Caption := cxGetResourceString(@cxSvgCancelCaption); + btnCancel.LookAndFeel.MasterLookAndFeel := AData.LookAndFeel; + Result := Form.ShowModal = mrOK; + if Result then + AData^.Text := Memo1.Text; + finally + Free; + end; +end; + +procedure TcxfmStringsEditor.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + Params.ExStyle := WS_EX_DLGMODALFRAME or WS_EX_WINDOWEDGE; +end; + +procedure TcxfmStringsEditor.CreateWnd; +begin + inherited CreateWnd; + SendMessage(Self.Handle, WM_SETICON, 1, 0); +end; + +procedure TcxfmStringsEditor.DoShow; +begin + inherited DoShow; + Memo1PropertiesChange(nil); +end; + +procedure TcxfmStringsEditor.Memo1PropertiesChange(Sender: TObject); +begin + Label1.Caption := IntToStr(Memo1.InnerControl.Perform(EM_GETLINECOUNT, 0, 0)) + ' line(s)'; +end; + +procedure TcxfmStringsEditor.WMNCHitTest(var Message: TWMNCHitTest); +begin + inherited; + if not (csDesigning in ComponentState) then + begin + if Message.Result in [HTCLIENT, HTRIGHT, HTBOTTOM] then + if PtInRect(FSizeGripBounds, GetMouseCursorPos) then + Message.Result := HTBOTTOMRIGHT; + end; +end; + +procedure TcxfmStringsEditor.FormPaint(Sender: TObject); +var + ATheme: TdxTheme; + R: TRect; +begin + R := ClientRect; + R.Left := R.Right - GetSystemMetrics(SM_CXVSCROLL); + R.Top := R.Bottom - GetSystemMetrics(SM_CYHSCROLL); + if btnOk.LookAndFeel.NativeStyle and AreVisualStylesAvailable([totScrollBar]) then + begin + ATheme := OpenTheme(totScrollBar); + DrawThemeBackground(ATheme, Canvas.Handle, SBP_SIZEBOX, SZB_RIGHTALIGN, @R); + end + else + DrawFrameControl(Canvas.Handle, R, DFC_SCROLL, DFCS_SCROLLSIZEGRIP); +end; + +procedure TcxfmStringsEditor.FormResize(Sender: TObject); +begin + GetWindowRect(Handle, FSizeGripBounds); + FSizeGripBounds.Left := FSizeGripBounds.Right - GetSystemMetrics(SM_CXVSCROLL); + FSizeGripBounds.Top := FSizeGripBounds.Bottom - GetSystemMetrics(SM_CYHSCROLL); + Invalidate; +end; + +end. diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxVGrid.pas b/official/x.35/ExpressVerticalGrid/Sources/cxVGrid.pas new file mode 100644 index 00000000..4a1dc291 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxVGrid.pas @@ -0,0 +1,12409 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressVerticalGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSVERTICALGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxVGrid; + +{$I cxVer.inc} + +interface + +uses + SysUtils, Classes, + Windows, Controls, Messages, + Forms, StdCtrls, ImgList, ExtCtrls, cxEdit, cxControls, Graphics, cxGraphics, + cxVGridUtils, cxStyles, cxLookAndFeelPainters, cxLookAndFeels, cxClasses, + cxInplaceContainer, ComCtrls, cxButtons, cxNavigator, cxFilterControl, + cxFilter, cxDataStorage, cxCustomData, cxStorage; + +const + cxvgMinValueWidth = 20; + + // verticalgrid styles predefined indexes + // for row styles + vgrs_Header = 0; + vgrs_Content = 1; + + // for control styles + vgs_Content = ecs_Content; + vgs_Category = ecs_EditingStylesMaxIndex + 1; + vgs_Header = ecs_EditingStylesMaxIndex + 2; + vgs_IncSearch = ecs_EditingStylesMaxIndex + 3; + + // base constants for descendants + cxvgMaxControlStyleIndex = vgs_IncSearch; + cxvgMaxRowStyleIndex = vgrs_Content; + + // hit codes + vghc_Base = 4; + vghc_HitAtBandSizing = vghc_Base; + vghc_HitAtButton = vghc_Base + 1; + vghc_HitAtCaption = vghc_Base + 2; + vghc_HitAtDivider = vghc_Base + 3; + vghc_HitAtEmpty = vghc_Base + 4; + vghc_HitAtImage = vghc_Base + 5; + vghc_HitAtIndent = vghc_Base + 6; + vghc_HitAtRowSizing = vghc_Base + 7; + vghc_HitAtValue = vghc_Base + 8; + vghc_HitAtCustomize = vghc_Base + 9; + vghc_HitAtSeparator = vghc_Base + 10; + +type +{$IFNDEF DELPHI5} + TImageIndex = Integer; +{$ENDIF} + + EcxVerticalGridError = class(Exception); + + TcxCustomRow = class; + TcxCustomRowHeaderInfo = class; + TcxCustomRowViewInfo = class; + TcxCustomVerticalGrid = class; + TcxVirtualVerticalGrid = class; + TcxRowCaptionInfo = class; + TcxRowValueInfo = class; + TcxRowValueInfoClass = class of TcxRowValueInfo; + TcxValueInfoList = class; + TcxCustomEditorRow = class; + TcxCustomMultiEditorRow = class; + TcxMultiEditorRow = class; + TcxVerticalGridCustomizing = class; + TcxVerticalGridCustomizingClass = class of TcxVerticalGridCustomizing; + TcxVerticalGridRows = class; + TcxvgCustomRowStyles = class; + TcxvgCustomRowStylesClass = class of TcxvgCustomRowStyles; + TcxCategoryRowStyles = class; + TcxEditorRowStyles = class; + TcxvgScroller = class; + TcxCellEdit = class; + TcxvgController = class; + TcxvgCustomPaintStyleCalcHelper = class; + TcxvgCustomPaintStyleCalcHelperClass = class of TcxvgCustomPaintStyleCalcHelper; + TcxvgCustomViewInfo = class; + TcxvgHitTest = class; + TcxvgPainter = class; + TcxVerticalGridStyles = class; + + { TcxvgOptionsBehavior } + + TcxvgOptionsBehavior = class(TcxControlOptionsBehavior) + private + FAlwaysShowEditorAssigned: Boolean; + FBandSizing: Boolean; + FHeaderSizing: Boolean; + FRowSizing: Boolean; + FRowTracking: Boolean; + function GetAlwaysShowEditor: Boolean; + procedure SetAlwaysShowEditor(Value: Boolean); + protected + procedure InternalSetAlwaysShowEditor(Value: Boolean); + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; virtual; + published + property AlwaysShowEditor: Boolean read GetAlwaysShowEditor write SetAlwaysShowEditor stored FAlwaysShowEditorAssigned; + property BandSizing: Boolean read FBandSizing write FBandSizing default True; + property CellHints default True; + property HeaderSizing: Boolean read FHeaderSizing write FHeaderSizing default True; + property RowSizing: Boolean read FRowSizing write FRowSizing default False; + property RowTracking: Boolean read FRowTracking write FRowTracking default True; + end; + + { TcxvgMultiRecordsOptionsBehavior } + + TcxvgMultiRecordsOptionsBehavior = class(TcxvgOptionsBehavior) + private + FAllowChangeRecord: Boolean; + function GetIncSearchItem: TcxCustomEditorRow; + procedure SetAllowChangeRecord(Value: Boolean); + procedure SetIncSearchItem(Value: TcxCustomEditorRow); + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + published + property AllowChangeRecord: Boolean read FAllowChangeRecord write SetAllowChangeRecord default True; + property FocusFirstCellOnNewRecord; + property IncSearch; + property IncSearchItem: TcxCustomEditorRow read GetIncSearchItem write SetIncSearchItem; + end; + + { TcxvgMultiRecordsOptionsData } + + TcxvgMultiRecordsOptionsData = class(TcxControlOptionsData) + private + FAppending: Boolean; + FDeleting: Boolean; + FInserting: Boolean; + FDeletingConfirmation: Boolean; + procedure SetAppending(Value: Boolean); + procedure SetDeleting(Value: Boolean); + procedure SetInserting(Value: Boolean); + protected + procedure Changed; override; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + published + property Appending: Boolean read FAppending write SetAppending default True; + property Deleting: Boolean read FDeleting write SetDeleting default True; + property DeletingConfirmation: Boolean read FDeletingConfirmation write FDeletingConfirmation default True; + property Inserting: Boolean read FInserting write SetInserting default True; + end; + + { TcxvgOptionsView } + + TcxvgPaintStyle = (psdotNet, psDelphi); + TcxvgGridLines = (vglNone, vglHorizontal, vglVertical, vglBoth); + + TcxvgOptionsView = class(TcxControlOptionsView) + private + FAutoScaleBands: Boolean; + FBandsInterval: Integer; + FCategoryExplorerStyle: Boolean; + FGridLineColor: TColor; + FGridLineColorAssigned: Boolean; + FValueWidth: Integer; + FPaintStyle: TcxvgPaintStyle; + FRowHeaderMinWidth: Integer; + FRowHeaderWidth: Integer; + FRowHeight: Integer; + FShowButtons: Boolean; + FShowHeaders: Boolean; + FShowEmptyRowImage: Boolean; + FGridLines: TcxvgGridLines; + FValueMinWidth: Integer; + function GetGridLineColor: TColor; + procedure SetAutoScaleBands(Value: Boolean); + procedure SetBandsInterval(Value: Integer); + procedure SetCategoryExplorerStyle(Value: Boolean); + procedure SetGridLineColor(Value: TColor); + procedure SetPaintStyle(Value: TcxvgPaintStyle); + procedure SetRowHeaderMinWidth(Value: Integer); + procedure SetRowHeaderWidth(Value: Integer); + procedure SetRowHeight(Value: Integer); + procedure SetShowButtons(Value: Boolean); + procedure SetShowEmptyRowImage(Value: Boolean); + procedure SetShowHeaders(Value: Boolean); + procedure SetGridLines(Value: TcxvgGridLines); + procedure SetValueMinWidth(Value: Integer); + procedure SetValueWidth(Value: Integer); + protected + procedure Changed; override; + procedure CheckRowHeaderWidth; + public + constructor Create(AOwner: TPersistent); override; + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; virtual; + published + property AutoScaleBands: Boolean read FAutoScaleBands write SetAutoScaleBands default True; + property BandsInterval: Integer read FBandsInterval write SetBandsInterval default 2; + property CategoryExplorerStyle: Boolean read FCategoryExplorerStyle write SetCategoryExplorerStyle default False; + property PaintStyle: TcxvgPaintStyle read FPaintStyle write SetPaintStyle default psDotNet; + property GridLineColor: TColor read GetGridLineColor write SetGridLineColor stored FGridLineColorAssigned; + property RowHeaderMinWidth: Integer read FRowHeaderMinWidth write SetRowHeaderMinWidth default 24; + property RowHeaderWidth: Integer read FRowHeaderWidth write SetRowHeaderWidth default 100; + property RowHeight: Integer read FRowHeight write SetRowHeight default -1; + property ShowButtons: Boolean read FShowButtons write SetShowButtons default True; + property ShowEditButtons; + property ShowEmptyRowImage: Boolean read FShowEmptyRowImage write SetShowEmptyRowImage default False; + property ShowHeaders: Boolean read FShowHeaders write SetShowHeaders default True; + property GridLines: TcxvgGridLines read FGridLines write SetGridLines default vglBoth; + property ValueWidth: Integer read FValueWidth write SetValueWidth default 100; + property ValueMinWidth: Integer read FValueMinWidth write SetValueMinWidth default 40; + end; + + { TcxvgMultiRecordsOptionsView } + + TcxvgMultiRecordsOptionsView = class(TcxvgOptionsView) + private + FRecordsInterval: Integer; + procedure SetRecordsInterval(Value: Integer); + public + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; override; + published + property RecordsInterval: Integer read FRecordsInterval write SetRecordsInterval default 0; + end; + + { TcxCustomRowProperties } + + TcxCustomRowProperties = class(TcxInterfacedCollectionItem) + private + FCollection: TCollection; + FLocked: Boolean; + FRow: TcxCustomRow; + protected + procedure Changed; virtual; + function GetOwner: TPersistent; override; + + property Locked: Boolean read FLocked; + public + constructor Create(Collection: TCollection); override; + constructor CreateEx(ARow: TcxCustomRow); virtual; + property Row: TcxCustomRow read FRow; + end; + + TcxRowPropertiesClass = class of TcxCustomRowProperties; + + { TcxCaptionRowProperties } + + TcxCaptionRowProperties = class(TcxCustomRowProperties) + private + FHeaderAlignmentHorz: TAlignment; + FHeaderAlignmentVert: TcxAlignmentVert; + FIsCaptionAssigned: Boolean; + FCaption: TCaption; + FImageIndex: TImageIndex; + FHint: string; + function GetCaption: TCaption; + function IsCaptionStored: Boolean; + procedure SetCaption(const Value: TCaption); + procedure SetImageIndex(const Value: TImageIndex); + procedure SetHeaderAlignmentHorz(const Value: TAlignment); + procedure SetHeaderAlignmentVert(const Value: TcxAlignmentVert); + protected + function DefaultCaption: string; virtual; + procedure RestoreDefaults; virtual; + public + constructor CreateEx(ARow: TcxCustomRow); override; + procedure Assign(Source: TPersistent); override; + published + property Caption: TCaption read GetCaption write SetCaption + stored IsCaptionStored; + property HeaderAlignmentHorz: TAlignment read FHeaderAlignmentHorz + write SetHeaderAlignmentHorz default taLeftJustify; + property HeaderAlignmentVert: TcxAlignmentVert read FHeaderAlignmentVert + write SetHeaderAlignmentVert default vaTop; + property Hint: string read FHint write FHint; + property ImageIndex: TImageIndex read FImageIndex write SetImageIndex default -1; + end; + + { TcxRowOptions } + + TcxRowOptions = class(TPersistent) + private + FCanAutoHeight: Boolean; + FCanMovedToCustomizationForm: Boolean; + FCanResized: Boolean; + FFocusing: Boolean; + FMoving: Boolean; + FRow: TcxCustomRow; + FShowExpandButton: Boolean; + FShowInCustomizationForm: Boolean; + FTabStop: Boolean; + procedure SetCanAutoHeight(Value: Boolean); + procedure SetFocusing(Value: Boolean); + procedure SetShowExpandButton(Value: Boolean); + procedure SetShowInCustomizationForm(Value: Boolean); + protected + procedure Changed; virtual; + property Row: TcxCustomRow read FRow; + public + constructor Create(ARow: TcxCustomRow); virtual; + procedure Assign(Source: TPersistent); override; + procedure RestoreDefaults; virtual; + published + property CanAutoHeight: Boolean read FCanAutoHeight write SetCanAutoHeight default True; + property CanMovedToCustomizationForm: Boolean read FCanMovedToCustomizationForm write FCanMovedToCustomizationForm default True; + property CanResized: Boolean read FCanResized write FCanResized default True; + property Focusing: Boolean read FFocusing write SetFocusing default True; + property Moving: Boolean read FMoving write FMoving default True; + property ShowExpandButton: Boolean read FShowExpandButton write SetShowExpandButton default True; + property ShowInCustomizationForm: Boolean read FShowInCustomizationForm write SetShowInCustomizationForm default True; + property TabStop: Boolean read FTabStop write FTabStop default True; + end; + + TcxRowOptionsClass = class of TcxRowOptions; + + { TcxCustomRow } + + TcxRowList = class(TList) + private + FOwner: TcxCustomRow; + protected + procedure Notify(Ptr: Pointer; Action: TListNotification); override; + procedure UpdateIndexes; + property Owner: TcxCustomRow read FOwner; + public + constructor Create(AOwner: TcxCustomRow); + end; + + TcxCustomRow = class(TComponent, IUnknown, IcxStoredObject) + private + FExpanded: Boolean; + FHeight: Integer; + FID: Integer; + FIndex: Integer; + FLoadingIndex: Integer; + FLoadingParent: string; + FOptions: TcxRowOptions; + FParent: TcxCustomRow; + FRows: TcxRowList; + FStyles: TcxvgCustomRowStyles; + FVerticalGrid: TcxCustomVerticalGrid; + FViewInfo: TcxCustomRowViewInfo; + FVisible: Boolean; + FVisibleIndex: Integer; + function GetAbsoluteIndex: Integer; + function GetCount: Integer; + function GetFocused: Boolean; + function GetLevel: Integer; + function GetOwnerRows: TcxVerticalGridRows; + function GetParent: TcxCustomRow; + function GetRow(Index: Integer): TcxCustomRow; + function GetViewInfo: TcxCustomRowViewInfo; + procedure SetExpanded(Value: Boolean); + procedure SetFocused(Value: Boolean); + procedure SetHeight(Value: Integer); + procedure SetIndex(Value: Integer); + procedure SetOptions(Value: TcxRowOptions); + procedure SetParent(Value: TcxCustomRow); + procedure SetVisible(Value: Boolean); + protected + FProperties: TcxCustomRowProperties; + // IcxStoredObject + function GetObjectName: string; virtual; + function IcxStoredObject.GetProperties = GetStoredProperties; + function GetStoredProperties(AProperties: TStrings): Boolean; virtual; + procedure GetPropertyValue(const AName: string; var AValue: Variant); virtual; + procedure SetPropertyValue(const AName: string; const AValue: Variant); virtual; + // override TComponent + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + procedure SetName(const NewName: TComponentName); override; + procedure SetParentComponent(Value: TComponent); override; + + procedure Add(ARow: TcxCustomRow); + function CanFocus: Boolean; virtual; + procedure Changed(ARebuild: Boolean = False); virtual; + function CreateHeaderInfo: TcxCustomRowHeaderInfo; virtual; abstract; + function CreateViewInfo: TcxCustomRowViewInfo; virtual; abstract; + procedure Delete(AIndex: Integer); + function GetDefaultHeight: Integer; virtual; + function GetEditContainer(ACellIndex: Integer): TcxCellEdit; virtual; + function GetEditContainerCount: Integer; virtual; + function GetPropertiesClass: TcxRowPropertiesClass; virtual; + function GetRealHeight: Integer; virtual; + function GetOptionsClass: TcxRowOptionsClass; virtual; + function GetStylesClass: TcxvgCustomRowStylesClass; virtual; + procedure Insert(AIndex: Integer; ARow: TcxCustomRow); + function IsHeightAssigned: Boolean; + procedure Remove(ARow: TcxCustomRow); + procedure RemoveAll; + procedure RemoveChildren; + procedure ResetOwnerCount; + procedure SetVerticalGrid(Value: TcxCustomVerticalGrid); virtual; + property ID: Integer read FID; + property OwnerRows: TcxVerticalGridRows read GetOwnerRows; + property Styles: TcxvgCustomRowStyles read FStyles write FStyles; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + // override + function GetParentComponent: TComponent; override; + function HasParent: Boolean; override; + // visualization + procedure Collapse(ARecurse: Boolean); + procedure Expand(ARecurse: Boolean); + function GetFirstVisibleChild: TcxCustomRow; + function GetLastVisibleChild: TcxCustomRow; + function HasChildren: Boolean; + function HasVisibleChildren: Boolean; + function IndexOf(ARow: TcxCustomRow): Integer; + function IsChild(ARow: TcxCustomRow): Boolean; + function IsFirst: Boolean; + function IsFirstVisible: Boolean; + function IsLast: Boolean; + function IsLastVisible: Boolean; + function IsRootLevel: Boolean; + function IsParent(ARow: TcxCustomRow): Boolean; + procedure MakeVisible; + procedure RestoreDefaults; + property AbsoluteIndex: Integer read GetAbsoluteIndex; + property Count: Integer read GetCount; + property Expanded: Boolean read FExpanded write SetExpanded default True; + property Focused: Boolean read GetFocused write SetFocused; + property Height: Integer read FHeight write SetHeight default -1; + property Index: Integer read FIndex write SetIndex; + property Level: Integer read GetLevel; + property Options: TcxRowOptions read FOptions write SetOptions; + property Parent: TcxCustomRow read GetParent write SetParent; + property Rows[Index: Integer]: TcxCustomRow read GetRow; + property VerticalGrid: TcxCustomVerticalGrid read FVerticalGrid write SetVerticalGrid; + property ViewInfo: TcxCustomRowViewInfo read GetViewInfo; + property Visible: Boolean read FVisible write SetVisible default True; + property VisibleIndex: Integer read FVisibleIndex; + end; + + TcxCustomRowClass = class of TcxCustomRow; + + { TcxCategoryRow } + + TcxCategoryRow = class(TcxCustomRow) + private + function GetProperties: TcxCaptionRowProperties; + function GetStyles: TcxCategoryRowStyles; + procedure SetProperties(Value: TcxCaptionRowProperties); + procedure SetStyles(Value: TcxCategoryRowStyles); + protected + function GetStoredProperties(AProperties: TStrings): Boolean; override; + procedure GetPropertyValue(const AName: string; var AValue: Variant); override; + procedure SetPropertyValue(const AName: string; const AValue: Variant); override; + function GetDefaultHeight: Integer; override; + function GetStylesClass: TcxvgCustomRowStylesClass; override; + public + function CreateHeaderInfo: TcxCustomRowHeaderInfo; override; + function CreateViewInfo: TcxCustomRowViewInfo; override; + published + property Expanded; + property Height; + property Options; + property Properties: TcxCaptionRowProperties read GetProperties write SetProperties; + property Styles: TcxCategoryRowStyles read GetStyles write SetStyles; + property Visible; + end; + + TcxCustomEditorRowProperties = class; + + { TcxEditorRowPropertiesOptions } + + TcxEditorRowPropertiesOptions = class(TcxCustomEditContainerItemOptions) + published + property Editing; + property Filtering; + property IncSearch; + property ShowEditButtons; + end; + + { TcxCellEdit } + + TcxCellEdit = class(TcxCustomInplaceEditContainer) + private + FCalculating: Boolean; + FEditRowProperties: TcxCustomEditorRowProperties; + FRow: TcxCustomRow; + function GetViewInfo: TcxCustomRowViewInfo; + protected + FCellIndex: Integer; + procedure Calculate(ACellViewInfo: TcxRowValueInfo); + function CanEdit: Boolean; override; + function CanFocus: Boolean; override; + function CanInitEditing: Boolean; override; + function CanTabStop: Boolean; override; + procedure DoGetDisplayText(ARecordIndex: Integer; var AText: string); override; + function DoGetPropertiesFromEvent(AEvent: TcxGetEditPropertiesEvent; AData: Pointer; + AProperties: TcxCustomEditProperties): TcxCustomEditProperties; override; + function GetCurrentValue: Variant; override; + function GetDataBindingClass: TcxItemDataBindingClass; override; + function GetDisplayValue(AProperties: TcxCustomEditProperties; ARecordIndex: Integer): Variant; override; + function GetEditValue: Variant; override; + function GetOptionsClass: TcxCustomEditContainerItemOptionsClass; override; + function GetValue(ARecordIndex: Integer): Variant; override; + function GetValueCount: Integer; override; + function HasDataTextHandler: Boolean; override; + procedure PropertiesChanged; override; + procedure SetCurrentValue(const Value: Variant); override; + procedure SetValue(ARecordIndex: Integer; const Value: Variant); override; + public + constructor Create(AOwner: TComponent); override; + property CellIndex: Integer read FCellIndex; + property EditRowProperties: TcxCustomEditorRowProperties read FEditRowProperties; + property Options; + property Row: TcxCustomRow read FRow; + property ViewInfo: TcxCustomRowViewInfo read GetViewInfo; + end; + + TcxCellEditClass = class of TcxCellEdit; + + { TcxCustomEditorRowProperties } + + TcxVerticalGridGetDisplayTextEvent = procedure(Sender: TcxCustomEditorRowProperties; + ARecord: Integer; var AText: string) of object; + TcxVerticalGridGetEditPropertiesEvent = procedure(Sender: TcxCustomEditorRowProperties; + ARecordIndex: Integer; var AProperties: TcxCustomEditProperties) of object; + + TcxCustomEditorRowProperties = class(TcxCaptionRowProperties, + IcxEditorPropertiesContainer) + private + FEditContainer: TcxCellEdit; + FOnGetDisplayText: TcxVerticalGridGetDisplayTextEvent; + function GetDataBinding: TcxItemDataBinding; + function GetDisplayEditProperty(Index: Integer): TcxCustomEditProperties; + function GetDisplayText(Index: Integer): string; + function GetEditViewData: TcxCustomEditViewData; + function GetEditProperties: TcxCustomEditProperties; + function GetEditPropertiesClass: TcxCustomEditPropertiesClass; + function GetEditPropertiesClassName: string; + function GetIEditorPropertiesContainer: IcxEditorPropertiesContainer; + function GetItemIndex: Integer; + function GetItemLink: TObject; + function GetOptions: TcxEditorRowPropertiesOptions; + function GetRepositoryItem: TcxEditRepositoryItem; + function GetValue: Variant; + function GetValueByIndex(Index: Integer): Variant; + procedure SetDataBinding(Value: TcxItemDataBinding); + procedure SetEditProperties(Value: TcxCustomEditProperties); + procedure SetEditPropertiesClass(Value: TcxCustomEditPropertiesClass); + procedure SetEditPropertiesClassName(const Value: string); + procedure SetOptions(Value: TcxEditorRowPropertiesOptions); + procedure SetRepositoryItem(Value: TcxEditRepositoryItem); + procedure SetValue(const Value: Variant); + // events delegation + function GetOnGetEditingProperties: TcxVerticalGridGetEditPropertiesEvent; + function GetOnGetEditProperties: TcxVerticalGridGetEditPropertiesEvent; + procedure SetOnGetEditingProperties(Value: TcxVerticalGridGetEditPropertiesEvent); + procedure SetOnGetEditProperties(Value: TcxVerticalGridGetEditPropertiesEvent); + protected + function GetInplaceEditContainerClass: TcxCellEditClass; virtual; + procedure DoGetDisplayTextEvent(ARecordIndex: Integer; var Text: string); virtual; + property EditContainer: TcxCellEdit read FEditContainer; + property EditViewData: TcxCustomEditViewData read GetEditViewData; + property IEditorPropertiesContainer: IcxEditorPropertiesContainer + read GetIEditorPropertiesContainer implements IcxEditorPropertiesContainer; + property DataBinding: TcxItemDataBinding read GetDataBinding write SetDataBinding; + property Options: TcxEditorRowPropertiesOptions read GetOptions write SetOptions; + property Value: Variant read GetValue write SetValue; + property OnGetDisplayText: TcxVerticalGridGetDisplayTextEvent read FOnGetDisplayText write FOnGetDisplayText; + property OnGetEditProperties: TcxVerticalGridGetEditPropertiesEvent read GetOnGetEditProperties write SetOnGetEditProperties; + property OnGetEditingProperties: TcxVerticalGridGetEditPropertiesEvent read GetOnGetEditingProperties write SetOnGetEditingProperties; + public + constructor CreateEx(ARow: TcxCustomRow); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + property DisplayEditProperties[Index: Integer]: TcxCustomEditProperties read GetDisplayEditProperty; + property DisplayTexts[Index: Integer]: string read GetDisplayText; + property EditPropertiesClass: TcxCustomEditPropertiesClass read GetEditPropertiesClass write SetEditPropertiesClass; + property ItemIndex: Integer read GetItemIndex; + property ItemLink: TObject read GetItemLink; + property Values[Index: Integer]: Variant read GetValueByIndex; + published + property EditPropertiesClassName: string read GetEditPropertiesClassName write SetEditPropertiesClassName; + property EditProperties: TcxCustomEditProperties read GetEditProperties write SetEditProperties; + property RepositoryItem: TcxEditRepositoryItem read GetRepositoryItem write SetRepositoryItem; + end; + + TcxEditorRowPropertiesClass = class of TcxCustomEditorRowProperties; + + { TcxEditorRowProperties } + + TcxEditorRowProperties = class(TcxCustomEditorRowProperties) + public + procedure Assign(Source: TPersistent); override; + published + property DataBinding; + property Options; + property Value; + property OnGetDisplayText; + property OnGetEditProperties; + property OnGetEditingProperties; + end; + + { TcxCustomEditorRow } + + TcxCustomEditorRow = class(TcxCustomRow) + private + FEditPropertiesEvents: TNotifyEvent; + FPropertiesEvents: TNotifyEvent; + function GetProperties: TcxCustomEditorRowProperties; + function GetStyles: TcxEditorRowStyles; + procedure SetProperties(Value: TcxCustomEditorRowProperties); + procedure SetStyles(Value: TcxEditorRowStyles); + protected + function CanFocus: Boolean; override; + function EditContainer: TcxCellEdit; + function GetDefaultHeight: Integer; override; + function GetEditContainer(ACellIndex: Integer): TcxCellEdit; override; + function GetEditContainerCount: Integer; override; + function GetPropertiesClass: TcxRowPropertiesClass; override; + function GetStylesClass: TcxvgCustomRowStylesClass; override; + procedure SetParentComponent(Value: TComponent); override; + procedure SetVerticalGrid(Value: TcxCustomVerticalGrid); override; + property Styles: TcxEditorRowStyles read GetStyles write SetStyles; + property Properties: TcxCustomEditorRowProperties read GetProperties write SetProperties; + public + function CreateHeaderInfo: TcxCustomRowHeaderInfo; override; + function CreateViewInfo: TcxCustomRowViewInfo; override; + published + property EditPropertiesEvents: TNotifyEvent read FEditPropertiesEvents write FEditPropertiesEvents; + property Options; + property PropertiesEvents: TNotifyEvent read FPropertiesEvents write FPropertiesEvents; + end; + + { TcxEditorRow } + + TcxEditorRow = class(TcxCustomEditorRow) + private + function GetProperties: TcxEditorRowProperties; + procedure SetProperties(Value: TcxEditorRowProperties); + protected + function GetPropertiesClass: TcxRowPropertiesClass; override; + published + property Expanded; + property Height; + property Options; + property Properties: TcxEditorRowProperties read GetProperties write SetProperties; + property Styles; + property Visible; + end; + + { TcxMultiEditorRow } + + TSeparatorKind = (skVertLine, skString); + + { TSeparatorInfo } + + TSeparatorInfo = record + Width: Integer; + Kind: TSeparatorKind; + Caption: string; + TextFlags: Integer; + ViewParams: TcxViewParams; + end; + + { TcxMultiEditorRowPropertiesOptions } + + TcxMultiEditorRowPropertiesOptions = class(TcxCustomEditContainerItemOptions) + published + property Editing; + property Filtering; + property Focusing; + property IncSearch; + property ShowEditButtons; + property TabStop; + end; + + { TcxCollectionItemEditorRowProperties } + + TcxCollectionItemEditorRowProperties = class(TcxCustomEditorRowProperties) + private + FEditPropertiesEvents: TNotifyEvent; + FWidth: Integer; + function GetOptions: TcxMultiEditorRowPropertiesOptions; + procedure SetOptions(Value: TcxMultiEditorRowPropertiesOptions); + procedure SetWidth(Value: Integer); + protected + function GetDisplayName: string; override; + function GetOwner: TPersistent; override; + property Options: TcxMultiEditorRowPropertiesOptions read GetOptions write SetOptions; + public + constructor CreateEx(ARow: TcxCustomRow); override; + procedure Assign(Source: TPersistent); override; + published + property EditPropertiesEvents: TNotifyEvent read FEditPropertiesEvents write FEditPropertiesEvents; + property Width: Integer read FWidth write SetWidth default 50; + end; + + { TcxEditorRowItemProperties } + + TcxEditorRowItemProperties = class(TcxCollectionItemEditorRowProperties) + public + procedure Assign(Source: TPersistent); override; + published + property DataBinding; + property Options; + property Value; + property OnGetDisplayText; + property OnGetEditProperties; + property OnGetEditingProperties; + end; + + { TcxEditorPropertiesCollection } + + TcxEditorPropertiesCollection = class(TCollection) + private + FRow: TcxCustomMultiEditorRow; + function GetItem(Index: Integer): TcxEditorRowItemProperties; + protected + function GetCollectionItemClass: TCollectionItemClass; virtual; + function GetOwner: TPersistent; override; + procedure Update(Item: TCollectionItem); override; + public + constructor Create(ARow: TcxCustomMultiEditorRow); reintroduce; virtual; + function Add: TcxEditorRowItemProperties; + function GetNamePath: string; override; + property Items[Index: Integer]: TcxEditorRowItemProperties read GetItem; default; + property Row: TcxCustomMultiEditorRow read FRow; + end; + + TcxEditorPropertiesCollectionClass = class of TcxEditorPropertiesCollection; + + { TcxMultiEditorRowProperties } + + TcxMultiEditorRowProperties = class(TcxCustomRowProperties) + private + FFixed: Boolean; + FEditors: TcxEditorPropertiesCollection; + FSeparatorAlignmentVert: TcxAlignmentVert; + FSeparatorKind: TSeparatorKind; + FSeparatorString: string; + procedure SetFixed(Value: Boolean); + procedure SetSeparatorAlignmentVert(Value: TcxAlignmentVert); + procedure SetSeparatorKind(Value: TSeparatorKind); + procedure SetSeparatorString(const Value: string); + protected + function GetCollectionClass: TcxEditorPropertiesCollectionClass; virtual; + function GetOwner: TPersistent; override; + public + constructor CreateEx(ARow: TcxCustomRow); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + published + property Editors: TcxEditorPropertiesCollection read FEditors write FEditors; + property Fixed: Boolean read FFixed write SetFixed default False; + property SeparatorAlignmentVert: TcxAlignmentVert read FSeparatorAlignmentVert + write SetSeparatorAlignmentVert default vaTop; + property SeparatorKind: TSeparatorKind read FSeparatorKind + write SetSeparatorKind default skVertLine; + property SeparatorString: string read FSeparatorString write SetSeparatorString; + end; + + { TcxCustomMultiEditorRow } + + TcxCustomMultiEditorRow = class(TcxCustomRow) + private + function GetProperties: TcxMultiEditorRowProperties; + function GetStyles: TcxEditorRowStyles; + procedure SetProperties(const Value: TcxMultiEditorRowProperties); + procedure SetStyles(Value: TcxEditorRowStyles); + protected + function CanFocus: Boolean; override; + function GetDefaultHeight: Integer; override; + function GetEditContainer(ACellIndex: Integer): TcxCellEdit; override; + function GetEditContainerCount: Integer; override; + function GetPropertiesClass: TcxRowPropertiesClass; override; + function GetStylesClass: TcxvgCustomRowStylesClass; override; + property Styles: TcxEditorRowStyles read GetStyles write SetStyles; + property Properties: TcxMultiEditorRowProperties read GetProperties write SetProperties; + public + function CreateHeaderInfo: TcxCustomRowHeaderInfo; override; + function CreateViewInfo: TcxCustomRowViewInfo; override; + end; + + { TcxMultiEditorRow } + + TcxMultiEditorRow = class(TcxCustomMultiEditorRow) + published + property Expanded; + property Height; + property Options; + property Properties; + property Styles; + property Visible; + end; + + { TcxVerticalGridRows } + + TcxVerticalGridRows = class + private + FList: TList; + FLockCount: Integer; + FNextID: Integer; + FOwner: TcxCustomVerticalGrid; + FCount: Integer; + function GetCount: Integer; + function GetRoot: TcxCustomRow; + function GetRow(Index: Integer): TcxCustomRow; + procedure SetRow(Index: Integer; const Value: TcxCustomRow); + protected + procedure Add(ARow: TcxCustomRow); + procedure AddChild(AParent, ARow: TcxCustomRow); + procedure BeginUpdate; + procedure Changed(ARebuild: Boolean = False); virtual; + procedure CheckList; + procedure Clear; + procedure EndUpdate; + function FindRowByID(AID: Integer): TcxCustomRow; + function FindRowByStoredName(const AName: string): TcxCustomRow; + function GetNextID: Integer; + procedure PrepareList; + procedure Remove(ARow: TcxCustomRow); + procedure RestoreDefaults; + procedure UnprepareList; + property Root: TcxCustomRow read GetRoot; + property Owner: TcxCustomVerticalGrid read FOwner; + public + constructor Create(AOwner: TcxCustomVerticalGrid); + destructor Destroy; override; + procedure AssignRows(Source: TcxVerticalGridRows); + function IndexOf(ARow: TcxCustomRow): Integer; + property Count: Integer read GetCount; + property Items[Index: Integer]: TcxCustomRow read GetRow write SetRow; default; + end; + + TcxvgUnboundLayoutStyle = (ulsBandsView, ulsSingleRecordView); + TcxvgLayoutStyle = (lsBandsView, lsSingleRecordView, lsMultiRecordView); + + { TBandInfoList } + + TBandInfo = record + BandIndex: Integer; + RowsCount: Integer; + BandHeight: Integer; + FirstRow: TcxCustomRow; + end; + + TBandInfoList = class(TcxDataList) + private + function GetItem(Index: Integer): TBandInfo; + public + constructor Create; + function Add(ABandIndex, ARowsCount, ABandHeight: Integer; + AFirstRow: TcxCustomRow): Integer; + property Items[Index: Integer]: TBandInfo read GetItem; default; + end; + + { TcxvgCustomScrollStrategy } + + TcxvgCustomScrollStrategy = class + private + FBandsInfo: TBandInfoList; + FCheckingCoordinate: Boolean; + FLeftVisibleRecord: Integer; + FTopVisibleRowIndex: Integer; + FScroller: TcxvgScroller; + FViewInfo: TcxvgCustomViewInfo; + function GetController: TcxvgController; + function GetDataController: TcxCustomDataController; + function GetScrollBarPos: Integer; + function GetVerticalGrid: TcxCustomVerticalGrid; + function GetVisibleRowCount: Integer; + procedure SetScrollBarPos(Value: Integer); + procedure SetTopVisibleRowIndex(Value: Integer); + protected + function CanContinueForward(Index: Integer): Boolean; virtual; + function CanContinueBackward(Index: Integer): Boolean; virtual; + function CanCalcRowsOnTheNextBand(ALeft, ANextBandIndex: Integer): Boolean; virtual; + procedure CheckLeftVisibleRecord(var AValue: Integer); virtual; + function GetBandInterval: Integer; virtual; abstract; + function GetBandWidth: Integer; + function GetBottomVisibleChild(ARow: TcxCustomRow): TcxCustomRow; + function GetFullRowHeight(ARow: TcxCustomRow; out ChildCount: Integer): Integer; + function GetLeftVisibleBand: Integer; virtual; abstract; + function GetScrollBarOffsetBegin: Integer; virtual; + function GetScrollBarOffsetEnd: Integer; virtual; + function GetVisibleBandCount: Integer; virtual; abstract; + function GetVisibleCount(ABeginIndex, AAreaHeight, AStep: Integer; + AForward: Boolean): Integer; virtual; + function GetVisibleValueCount: Integer; virtual; abstract; + function IsBehindRightClientEdge(X: Integer): Boolean; + function IsHideHScrollBar: Boolean; virtual; + function IsHideVScrollBar: Boolean; virtual; + function IsRecordsScrollMode: Boolean; virtual; + procedure ScrollH(AScrollCode: TScrollCode; var AScrollPos: Integer); virtual; + procedure ScrollV(AScrollCode: TScrollCode; var AScrollPos: Integer); virtual; + procedure SetLeftVisibleBand(Value: Integer); virtual; abstract; + procedure SetLeftVisibleRecord(Value: Integer); virtual; + procedure SetTopVisibleRowIndexAndBand(Index: Integer); + property Scroller: TcxvgScroller read FScroller; + property ScrollBarPos: Integer read GetScrollBarPos write SetScrollBarPos; + public + constructor Create(AScroller: TcxvgScroller); virtual; + destructor Destroy; override; + procedure CheckDecreaseLeftIndex; virtual; + procedure CheckDecreaseTopIndex(AScrollRectHeight: Integer); virtual; + function CheckTopVisibleIndex(AIndex, AStep: Integer): Integer; virtual; + function FindNextCustomItem(AFocusedItemIndex, AItemCount: Integer; + AGoForward: Boolean; var AItemIndex: Integer): Boolean; + function FindNextRecord(AFocusedRecordIndex: Integer; AGoForward: Boolean): Integer; + function FocusNextRecord(AFocusedRecordIndex: Integer; AGoForward: Boolean): Boolean; + function GetBandIndexByRowIndex(ARowIndex: Integer): Integer; virtual; abstract; + function GetVisibleCountFromBottom(ABottomIndex, AHeight: Integer): Integer; + function GetVisibleCountFromTop(ATopIndex, AHeight: Integer): Integer; + function GetFirstRowByBandIndex(ABandIndex: Integer): TcxCustomRow; virtual; + procedure InitHScrollBarParameters; virtual; + procedure InitVScrollBarParameters; virtual; + procedure RecalcBandsInfo; virtual; + procedure ScrollRecords(AForward: Boolean; ACount: Integer); + procedure SetRowMaxVisible(ARow: TcxCustomRow); virtual; + property BandInterval: Integer read GetBandInterval; + property BandWidth: Integer read GetBandWidth; + property BandsInfo: TBandInfoList read FBandsInfo; + property Controller: TcxvgController read GetController; + property DataController: TcxCustomDataController read GetDataController; + property LeftVisibleBand: Integer read GetLeftVisibleBand write SetLeftVisibleBand; + property LeftVisibleRecord: Integer read FLeftVisibleRecord write SetLeftVisibleRecord; + property ScrollBarOffsetBegin: Integer read GetScrollBarOffsetBegin; + property ScrollBarOffsetEnd: Integer read GetScrollBarOffsetEnd; + property TopVisibleRowIndex: Integer read FTopVisibleRowIndex write SetTopVisibleRowIndex; + property VerticalGrid: TcxCustomVerticalGrid read GetVerticalGrid; + property ViewInfo: TcxvgCustomViewInfo read FViewInfo; + property VisibleBandCount: Integer read GetVisibleBandCount; + property VisibleRowCount: Integer read GetVisibleRowCount; + property VisibleValueCount: Integer read GetVisibleValueCount; + end; + + TcxvgCustomScrollStrategyClass = class of TcxvgCustomScrollStrategy; + + { TcxvgSingleRecordScrollStrategy } + + TcxvgSingleRecordScrollStrategy = class(TcxvgCustomScrollStrategy) + protected + function GetBandInterval: Integer; override; + function GetLeftVisibleBand: Integer; override; + function GetVisibleBandCount: Integer; override; + function GetVisibleValueCount: Integer; override; + procedure SetLeftVisibleBand(Value: Integer); override; + public + function GetBandIndexByRowIndex(ARowIndex: Integer): Integer; override; + end; + + { TcxvgMultiRecordsScrollStrategy } + + TcxvgMultiRecordsScrollStrategy = class(TcxvgCustomScrollStrategy) + private + function GetRecordsInterval: Integer; + protected + function GetBandInterval: Integer; override; + function GetLeftVisibleBand: Integer; override; + function GetVisibleBandCount: Integer; override; + function GetVisibleValueCount: Integer; override; + procedure SetLeftVisibleBand(Value: Integer); override; + procedure SetLeftVisibleRecord(Value: Integer); override; + property RecordsInterval: Integer read GetRecordsInterval; + public + procedure CheckDecreaseLeftIndex; override; + function GetBandIndexByRowIndex(ARowIndex: Integer): Integer; override; + end; + + { TcxvgBandsScrollStrategy } + + TcxvgBandsScrollStrategy = class(TcxvgCustomScrollStrategy) + private + FLeftVisibleBand: Integer; + protected + function CanCalcRowsOnTheNextBand(ALeft, ANextBandIndex: Integer): Boolean; override; + function GetBandInterval: Integer; override; + function GetBandViewRowMaxVisibleTopIndex(ARow: TcxCustomRow): Integer; + function GetLeftVisibleBand: Integer; override; + function GetVisibleBandCount: Integer; override; + function GetVisibleValueCount: Integer; override; + function IsRecordsScrollMode: Boolean; override; + procedure SetLeftVisibleBand(Value: Integer); override; + public + procedure CheckDecreaseTopIndex(AScrollRectHeight: Integer); override; + function CheckTopVisibleIndex(AIndex, AStep: Integer): Integer; override; + function GetBandIndexByRowIndex(ARowIndex: Integer): Integer; override; + procedure InitHScrollBarParameters; override; + function IsHideVScrollBar: Boolean; override; + procedure RecalcBandsInfo; override; + procedure SetRowMaxVisible(ARow: TcxCustomRow); override; + end; + + { TcxvgScroller } + + TcxvgScroller = class + private + FCheckDecreaseLeftIndex: Boolean; + FCheckDecreaseTopIndex: Boolean; + FScrollStrategy: TcxvgCustomScrollStrategy; + FVerticalGrid: TcxCustomVerticalGrid; + procedure CheckDecreaseLeftIndex; + procedure CheckDecreaseTopIndex; + function GetBandsInfo: TBandInfoList; + function GetCheckDecrease: Boolean; + function GetFocusedRecordIndex: Integer; + function GetLeftVisibleBand: Integer; + function GetLeftVisibleRecord: Integer; + function GetTopVisibleRowIndex: Integer; + function GetViewInfo: TcxvgCustomViewInfo; + function GetVisibleCountFromBottom(ARowIndex: Integer): Integer; + function GetVisibleRowCount: Integer; + function GetVisibleValueCount: Integer; + procedure SetCheckDecrease(Value: Boolean); + procedure SetLeftVisibleBand(Value: Integer); + procedure SetLeftVisibleRecord(Value: Integer); + procedure SetTopVisibleRowIndex(Value: Integer); + protected + function CreateScrollStrategy(AScroller: TcxvgScroller): TcxvgCustomScrollStrategy; virtual; + procedure LayoutStyleChanged; + // other + property FocusedRecordIndex: Integer read GetFocusedRecordIndex; + property ScrollStrategy: TcxvgCustomScrollStrategy read FScrollStrategy; + property VerticalGrid: TcxCustomVerticalGrid read FVerticalGrid; + property ViewInfo: TcxvgCustomViewInfo read GetViewInfo; + public + constructor Create(AVerticalGrid: TcxCustomVerticalGrid); virtual; + destructor Destroy; override; + // navigation + function GoToFirst: Boolean; + function GoToLast: Boolean; + function GoToNext: Boolean; + function GoToPrev: Boolean; + + function GetBandIndexByRowIndex(ARowIndex: Integer): Integer; + procedure InitScrollBarsParameters; virtual; + procedure RecalcBandsInfo; + procedure RecreateScrollStrategy; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; var AScrollPos: Integer); + function SetRecordVisible(ARecordIndex: Integer): Boolean; virtual; + procedure SetRowVisible(ARow: TcxCustomRow); virtual; + procedure SetRowMaxVisible(ARow: TcxCustomRow); + property BandsInfo: TBandInfoList read GetBandsInfo; + property CheckDecrease: Boolean read GetCheckDecrease write SetCheckDecrease; + property LeftVisibleBand: Integer read GetLeftVisibleBand write SetLeftVisibleBand; + property LeftVisibleRecord: Integer read GetLeftVisibleRecord write SetLeftVisibleRecord; + property TopVisibleRowIndex: Integer read GetTopVisibleRowIndex write SetTopVisibleRowIndex; + property VisibleRowCount: Integer read GetVisibleRowCount; + property VisibleValueCount: Integer read GetVisibleValueCount; + end; + + { TcxvgHitTest } + + TcxvgHitTest = class(TcxCustomHitTestController) + private + FHitInControl: Boolean; + FHitBandIndex: Integer; + FHitRow: TcxCustomRow; + FHitCellIndex: Integer; + function GetHitAtRowHeader: Boolean; + function GetVerticalGrid: TcxCustomVerticalGrid; + protected + FNewHitTestItem: TObject; + function AllowDesignMouseEvents(X, Y: Integer; AShift: TShiftState): Boolean; override; + procedure CalcBandsHitTest(AViewInfo: TcxvgCustomViewInfo); virtual; + function CalcCustomizingHitTest: Boolean; virtual; + function CalcRowHeaderHitTest(AHeaderInfo: TcxCustomRowHeaderInfo): Boolean; virtual; + function CalcRowHitTest(ARowViewInfo: TcxCustomRowViewInfo): Boolean; + procedure CalcRowValuesHitTest(ARowViewInfo: TcxCustomRowViewInfo); virtual; + procedure CalcRowsHitTest(AViewInfo: TcxvgCustomViewInfo); + function CanMoving: Boolean; virtual; + function CanSizing: Boolean; overload; + function CanSizing(var ASizeDirection: TcxDragSizingDirection): Boolean; overload; virtual; + function Check(const ARect: TRect): Boolean; + procedure DoCalculate; override; + function GetCurrentCursor: TCursor; override; + function GetState(Index: Integer): Boolean; + procedure SetHitState(Index: Integer; Value: Boolean); + property VerticalGrid: TcxCustomVerticalGrid read GetVerticalGrid; + public + property HitAtBandSizing: Boolean index vghc_HitAtBandSizing read GetState; + property HitAtButton: Boolean index vghc_HitAtButton read GetState; + property HitAtCaption: Boolean index vghc_HitAtCaption read GetState; + property HitAtCustomize: Boolean index vghc_HitAtCustomize read GetState; + property HitAtDivider: Boolean index vghc_HitAtDivider read GetState; + property HitAtEmpty: Boolean index vghc_HitAtEmpty read GetState; + property HitAtImage: Boolean index vghc_HitAtImage read GetState; + property HitAtIndent: Boolean index vghc_HitAtIndent read GetState; + property HitAtRowHeader: Boolean read GetHitAtRowHeader; + property HitAtRowSizing: Boolean index vghc_HitAtRowSizing read GetState; + property HitAtValue: Boolean index vghc_HitAtValue read GetState; + property HitBandIndex: Integer read FHitBandIndex; + property HitInControl: Boolean read FHitInControl; + property HitRow: TcxCustomRow read FHitRow; + property HitCellIndex: Integer read FHitCellIndex; + end; + + { TcxvgCellNavigator } + + TcxvgCellNavigator = class(TcxCustomCellNavigator) + private + function GetController: TcxvgController; + function GetRecordCount: Integer; + function GetRow(Index: Integer): TcxCustomRow; + function GetValueCount: Integer; + protected + procedure CalcNextRow(AForward: Boolean; var ARowIndex, ACellIndex: Integer); override; + function FindNextRecord(AForward: Boolean): Boolean; + function GetCellContainer(ARowIndex, ACellIndex: Integer): TcxCustomInplaceEditContainer; override; + function GetContainerCount(ARowIndex: Integer): Integer; + function GetCount(ARowIndex: Integer): Integer; override; + procedure Init(var ARowIndex, ACellIndex, ARowCount: Integer); override; + function MayFocusedEmptyRow(ARowIndex: Integer): Boolean; override; + procedure SetFocusCell(ARowIndex, ACellIndex: Integer; AShift: TShiftState = []); override; + public + constructor Create(AController: TcxCustomControlController); override; + procedure FocusNextCell(AForward, ANextRow: Boolean; AShift: TShiftState = []); override; + property RecordCount: Integer read GetRecordCount; + property Rows[Index: Integer]: TcxCustomRow read GetRow; + property Controller: TcxvgController read GetController; + property ValueCount: Integer read GetValueCount; + end; + + { TcxvgDragImageHelper } + + TcxvgDragImageHelper = class(TcxDragImageHelper) + protected + procedure DragAndDrop(const P: TPoint); override; + function GetCursor: TCursor; virtual; + end; + + { TcxvgController } + + TcxvgResizeKind = (rkNone, rkRowSizing, rkDivider, rkBandSizing); + + TcxvgController = class(TcxCustomControlController, IUnknown, IcxDragSizing) + private + FAutoScrollObject: TcxControllerAutoScrollingObject; + FCellIndex: Integer; + FDragFromCustomizingForm: Boolean; + FDragRow: TcxCustomRow; + FForceShowEditor: Boolean; + FFocusedRow: TcxCustomRow; + FLockIncSearch: Boolean; + FProcessMultiEditorRow: Boolean; + FResizeKind: TcxvgResizeKind; + FScrollDown: Boolean; + FScroller: TcxvgScroller; + FScrollTimer: TTimer; + FSizingRow: TcxCustomRow; + FSizingValue: Integer; + FTrackingEnabled: Boolean; + FWasScroll: Boolean; + procedure CheckMoveToCustomizationForm; + function GetHitTest: TcxvgHitTest; + function GetVerticalGrid: TcxCustomVerticalGrid; + function GetViewInfo: TcxvgCustomViewInfo; + procedure SetFocusedRow(Value: TcxCustomRow); + procedure SetResizeKind(Value: TcxvgResizeKind); + procedure OnScrollTimer(Sender: TObject); + procedure StartScrollTimer; + procedure StopScrollTimer; + protected + FLockUpdate: Boolean; + ResizeDirection: TcxDragSizingDirection; + // IUnknown + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + // IcxDragSizing + function CanSizing(ADirection: TcxDragSizingDirection): Boolean; virtual; + function GetSizingBoundsRect(ADirection: TcxDragSizingDirection): TRect; virtual; + function GetSizingIncrement(ADirection: TcxDragSizingDirection): Integer; virtual; + function IsDynamicUpdate: Boolean; virtual; + procedure SetSizeDelta(ADirection: TcxDragSizingDirection; ADelta: Integer); virtual; + // drag'n'drop + procedure DragDrop(Source: TObject; X, Y: Integer); override; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); override; + procedure EndDrag(Target: TObject; X, Y: Integer); override; + procedure StartDrag(var DragObject: TDragObject); override; + + procedure BeforeMouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure BehaviorChanged; override; + function CanAppend(ACheckOptions: Boolean): Boolean; virtual; + function CanChangeRecord: Boolean; virtual; + function CanDelete(ACheckOptions: Boolean): Boolean; virtual; + function CanInsert(ACheckOptions: Boolean): Boolean; virtual; + procedure CheckPostData; + procedure DoCancelMode; override; + procedure DoMouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure DoMouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure DoNextPage(AForward: Boolean; Shift: TShiftState); override; + procedure DoUpdateRowAndCell(ANewRow: TcxCustomRow; ANewCellIndex: Integer); virtual; + procedure FocusedItemChanged(APrevFocusedItem: TcxCustomInplaceEditContainer); override; + function GetCancelEditingOnExit: Boolean; override; + function GetDragAndDropObjectClass: TcxDragAndDropObjectClass; override; + function GetFocusedCellViewInfo(AEditContainer: TcxCustomInplaceEditContainer): TcxEditCellViewInfo; override; + function GetImmediateEditor: Boolean; override; + function GetNavigatorClass: TcxCustomCellNavigatorClass; override; + function GetPostDataOnChangeItem: Boolean; virtual; + function GetResizeDirection: TcxDragSizingDirection; override; + procedure InternalSetRowAndCell(ARow: TcxCustomRow; ACellIndex: Integer); + function IsImmediatePost: Boolean; override; + function IsInternalDragging: Boolean; + function IsKeyForController(AKey: Word; AShift: TShiftState): Boolean; override; + procedure RefreshFocusedRow; virtual; + procedure SetFocusedCellEdit(ACellEdit: TcxCellEdit); + procedure SetFocusedRowAndCell(Value: TcxCustomRow; ACellIndex: Integer); virtual; + procedure UpdatePaintStyle; virtual; + procedure UpdateRecord(ARecordIndex: Integer); override; + property DragRow: TcxCustomRow read FDragRow; + property DragFromCustomizingForm: Boolean read FDragFromCustomizingForm; + property ForceShowEditor: Boolean read FForceShowEditor; + property ProcessMultiEditorRow: Boolean read FProcessMultiEditorRow; + property ResizeKind: TcxvgResizeKind read FResizeKind write SetResizeKind; + public + // override + constructor Create(AOwner: TcxEditingControl); override; + destructor Destroy; override; + // IUnknown + function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall; + + procedure Clear; override; + function GetCursor(X, Y: Integer): TCursor; override; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure MakeFocusedItemVisible; override; + procedure MakeFocusedRecordVisible; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + // drag and drop + function CanDrag(X, Y: Integer): Boolean; override; + procedure EndDragAndDrop(Accepted: Boolean); override; + function StartDragAndDrop(const P: TPoint): Boolean; override; + // scrolling + procedure InitScrollBarsParameters; override; + procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); override; + + procedure AppendRecord; virtual; + procedure DeleteSelection; virtual; + procedure InsertRecord; virtual; + procedure MakeRowVisible(ARow: TcxCustomRow); virtual; + function MakeRecordVisible(AIndex: Integer): Boolean; virtual; + property CellIndex: Integer read FCellIndex; + property FocusedRow: TcxCustomRow read FFocusedRow write SetFocusedRow; + property HitTest: TcxvgHitTest read GetHitTest; + property Scroller: TcxvgScroller read FScroller; + property VerticalGrid: TcxCustomVerticalGrid read GetVerticalGrid; + property ViewInfo: TcxvgCustomViewInfo read GetViewInfo; + end; + + { TcxvgMultiRecordsController } + + TcxvgMultiRecordsController = class(TcxvgController) + private + function GetOptionsBehavior: TcxvgMultiRecordsOptionsBehavior; + function GetOptionsData: TcxvgMultiRecordsOptionsData; + function GetVerticalGrid: TcxVirtualVerticalGrid; + protected + function CanAppend(ACheckOptions: Boolean): Boolean; override; + function CanChangeRecord: Boolean; override; + function CanDelete(ACheckOptions: Boolean): Boolean; override; + function CanInsert(ACheckOptions: Boolean): Boolean; override; + procedure FocusedRecordChanged(APrevFocusedRowIndex, AFocusedRowIndex: Integer); override; + function GetCancelEditingOnExit: Boolean; override; + function GetFocusedRecordIndex: Integer; override; + function GetPostDataOnChangeItem: Boolean; override; + function IncSearchKeyDown(AKey: Word; AShift: TShiftState): Word; override; + function IsImmediatePost: Boolean; override; + procedure RefreshIncSearchItem; virtual; + procedure SetFocusedRecordIndex(Value: Integer); override; + property OptionsBehavior: TcxvgMultiRecordsOptionsBehavior read GetOptionsBehavior; + property OptionsData: TcxvgMultiRecordsOptionsData read GetOptionsData; + property VerticalGrid: TcxVirtualVerticalGrid read GetVerticalGrid; + public + procedure DeleteSelection; override; + end; + + { TcxCustomVerticalGrid } + + TcxVerticalGridDrawHeaderEvent = procedure(Sender: TObject; + ACanvas: TcxCanvas; APainter: TcxvgPainter; + AHeaderViewInfo: TcxCustomRowHeaderInfo; + var Done: Boolean) of object; + + TcxVerticalGridDrawValueEvent = procedure(Sender: TObject; + ACanvas: TcxCanvas; APainter: TcxvgPainter; + AValueInfo: TcxRowValueInfo; + var Done: Boolean) of object; + + TcxVerticalGridDrawBackgroundEvent = procedure(Sender: TObject; + ACanvas: TcxCanvas; const R: TRect; const AViewParams: TcxViewParams; + var Done: Boolean) of object; + + TcxVerticalGridEditingEvent = procedure(Sender: TObject; + ARowProperties: TcxCustomEditorRowProperties; var Allow: Boolean) of object; + + TcxVerticalGridChangedEvent = procedure(Sender: TObject; + ARowProperties: TcxCustomEditorRowProperties) of object; + + TcxVerticalGridItemChangedEvent = procedure(Sender: TObject; + AOldRow: TcxCustomRow; AOldCellIndex: Integer) of object; + + TcxCustomVerticalGrid = class(TcxExtEditingControl, IcxStoredObject, + IcxStoredParent, IdxSkinSupport) + private + FCategoryFont: TFont; + FCustomizing: TcxVerticalGridCustomizing; + FImageChangeLink: TChangeLink; + FImages: TCustomImageList; + FNewLoadMode: Boolean; + FRootRow: TcxCustomRow; + FRows: TcxVerticalGridRows; + FSaveDragCursor: TCursor; + FStoringName: string; + FStylesEvents: TNotifyEvent; + FOnCustomizationVisibleChanged: TNotifyEvent; + FOnDrawBackground: TcxVerticalGridDrawBackgroundEvent; + FOnDrawRowHeader: TcxVerticalGridDrawHeaderEvent; + FOnDrawValue: TcxVerticalGridDrawValueEvent; + FOnEdited: TcxVerticalGridChangedEvent; + FOnEditing: TcxVerticalGridEditingEvent; + FOnEditValueChanged: TcxVerticalGridChangedEvent; + FOnItemChanged: TcxVerticalGridItemChangedEvent; + FOnLayoutChanged: TNotifyEvent; + FOnLeftVisibleBandIndexChanged: TNotifyEvent; + FOnLeftVisibleRecordIndexChanged: TNotifyEvent; + FOnTopRowIndexChanged: TNotifyEvent; + procedure CategoryFontChanged(Sender: TObject); + function GetController: TcxvgController; + function GetDragHeaderInfo: TcxCustomRowHeaderInfo; + function GetFocusedRow: TcxCustomRow; + function GetHitTest: TcxvgHitTest; + function GetInplaceEditor: TcxCustomEdit; + function GetIsEditing: Boolean; + function GetLeftVisibleBand: Integer; + function GetLeftVisibleRecord: Integer; + function GetOptionsBehavior: TcxvgOptionsBehavior; + function GetOptionsView: TcxvgOptionsView; + function GetPainter: TcxvgPainter; + function GetRecordCount: Integer; + function GetStyles: TcxVerticalGridStyles; + function GetTopVisibleRowIndex: Integer; + function GetViewInfo: TcxvgCustomViewInfo; + procedure ImageListChange(Sender: TObject); + procedure SetFocusedRow(Value: TcxCustomRow); + procedure SetImages(Value: TCustomImageList); + procedure SetLeftVisibleBand(Value: Integer); + procedure SetLeftVisibleRecord(Value: Integer); + procedure SetOptionsBehavior(Value: TcxvgOptionsBehavior); + procedure SetOptionsView(Value: TcxvgOptionsView); + procedure SetStyles(Value: TcxVerticalGridStyles); + procedure SetTopVisibleRowIndex(Value: Integer); + procedure CMDrag(var Message: TCMDrag); message CM_DRAG; + protected + // IcxStoredObject + function GetObjectName: string; virtual; + function GetProperties(AProperties: TStrings): Boolean; virtual; + procedure GetPropertyValue(const AName: string; var AValue: Variant); virtual; + procedure SetPropertyValue(const AName: string; const AValue: Variant); virtual; + // IcxStoredParent + function CreateChild(const AObjectName, AClassName: string): TObject; virtual; + procedure DeleteChild(const AObjectName: string; AObject: TObject); virtual; + procedure IcxStoredParent.GetChildren = GetStoredChildren; + procedure GetStoredChildren(AChildren: TStringList); virtual; + // vcl methods + procedure DoEndDrag(Target: TObject; X, Y: Integer); override; + procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; + procedure Loaded; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure SetName(const Value: TComponentName); override; + // cxControls + procedure BoundsChanged; override; + procedure FontChanged; override; + procedure InitControl; override; + procedure LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); override; + // cxControls - drag'n'drop + function GetDragObjectClass: TDragControlObjectClass; override; + // cxExtEditingControl + procedure CreateSubClasses; override; + procedure DataChanged; override; + procedure DestroySubClasses; override; + procedure DoEdited(AItem: TcxCustomInplaceEditContainer); override; + function DoEditing(AItem: TcxCustomInplaceEditContainer): Boolean; override; + procedure DoEditValueChanged(AItem: TcxCustomInplaceEditContainer); override; + procedure DoInplaceEditContainerItemRemoved(AItem: TcxCustomInplaceEditContainer); override; + procedure DoLayoutChanged; override; + function DragDropImageDisplayRect: TRect; override; + procedure DrawDragDropImage(ADragBitmap: TBitmap; ACanvas: TcxCanvas); override; + function GetControllerClass: TcxCustomControlControllerClass; override; + function GetControlStylesClass: TcxCustomControlStylesClass; override; + function GetDragImageHelperClass: TcxDragImageHelperClass; override; + function GetEditCellDataBindingClass: TcxItemDataBindingClass; virtual; + function GetHitTestControllerClass: TcxHitTestControllerClass; override; + function GetOptionsBehaviorClass: TcxControlOptionsBehaviorClass; override; + function GetOptionsViewClass: TcxControlOptionsViewClass; override; + function GetPainterClass: TcxCustomControlPainterClass; override; + function HasDragDropImages: Boolean; override; + procedure RecreateViewInfo; override; + // virtuals + procedure AfterLoadedRows; + procedure BeforeLoadedRows; + function CanBandSizing: Boolean; virtual; + procedure CheckRowClass(ARowClass: TcxCustomRowClass); virtual; + procedure CheckGridModeBufferCount; + procedure DoCustomizationVisibleChanged; virtual; + function DoDrawBackgroundPart(const R: TRect; const AViewParams: TcxViewParams): Boolean; virtual; + function DoDrawRowHeader(AHeaderViewInfo: TcxCustomRowHeaderInfo): Boolean; virtual; + function DoDrawValue(AValueInfo: TcxRowValueInfo): Boolean; virtual; + procedure DoItemChanged(AOldRow: TcxCustomRow; AOldCellIndex: Integer); virtual; + procedure DoLeftVisibleBandIndexChanged; virtual; + procedure DoLeftVisibleRecordIndexChanged; virtual; + procedure DoTopRowIndexChanged; virtual; + function GetCalcHelperClass: TcxvgCustomPaintStyleCalcHelperClass; virtual; + function GetCellAutoHeight: Boolean; virtual; + function GetCustomizingClass: TcxVerticalGridCustomizingClass; virtual; + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); virtual; + function GetEditorRowClass: TcxCustomRowClass; virtual; + function GetMultiEditorRowClass: TcxCustomRowClass; virtual; + function GetScrollStrategyClass: TcxvgCustomScrollStrategyClass; virtual; abstract; + procedure InitDataController; virtual; + procedure RemoveRowFromVerticalGrid(ARow: TcxCustomRow); + procedure RowsChanged; virtual; + procedure UpdateDesignEditor; virtual; + property CategoryFont: TFont read FCategoryFont; + property Controller: TcxvgController read GetController; + property Customizing: TcxVerticalGridCustomizing read FCustomizing write FCustomizing; + property DragHeaderInfo: TcxCustomRowHeaderInfo read GetDragHeaderInfo; + property LeftVisibleRecord: Integer read GetLeftVisibleRecord write SetLeftVisibleRecord; + property Painter: TcxvgPainter read GetPainter; + property RecordCount: Integer read GetRecordCount; + property RootRow: TcxCustomRow read FRootRow; + property OnCustomizationFormVisibleChanged: TNotifyEvent read FOnCustomizationVisibleChanged write FOnCustomizationVisibleChanged; + property OnDrawBackground: TcxVerticalGridDrawBackgroundEvent read FOnDrawBackground write FOnDrawBackground; + property OnDrawRowHeader: TcxVerticalGridDrawHeaderEvent read FOnDrawRowHeader write FOnDrawRowHeader; + property OnDrawValue: TcxVerticalGridDrawValueEvent read FOnDrawValue write FOnDrawValue; + property OnEdited: TcxVerticalGridChangedEvent read FOnEdited write FOnEdited; + property OnEditing: TcxVerticalGridEditingEvent read FOnEditing write FOnEditing; + property OnEditValueChanged: TcxVerticalGridChangedEvent read FOnEditValueChanged write FOnEditValueChanged; + property OnItemChanged: TcxVerticalGridItemChangedEvent read FOnItemChanged write FOnItemChanged; + property OnLayoutChanged: TNotifyEvent read FOnLayoutChanged write FOnLayoutChanged; + property OnLeftVisibleBandIndexChanged: TNotifyEvent read FOnLeftVisibleBandIndexChanged write FOnLeftVisibleBandIndexChanged; + property OnLeftVisibleRecordIndexChanged: TNotifyEvent read FOnLeftVisibleRecordIndexChanged write FOnLeftVisibleRecordIndexChanged; + property OnTopRowIndexChanged: TNotifyEvent read FOnTopRowIndexChanged write FOnTopRowIndexChanged; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + // work with rows + function Add(ARowClass: TcxCustomRowClass): TcxCustomRow; + function AddChild(AParent: TcxCustomRow; ARowClass: TcxCustomRowClass): TcxCustomRow; + procedure AssignRows(Source: TcxCustomVerticalGrid); virtual; + procedure ClearRows; + function FirstRow: TcxCustomRow; + function FirstVisibleRow: TcxCustomRow; + procedure FocusRow(ARow: TcxCustomRow; ACellIndex: Integer = 0); + procedure FullCollapse; + procedure FullExpand; + function HasRows: Boolean; + function HasVisibleRows: Boolean; + function IsInternalDragging: Boolean; + function IsRowVisible(ARow: TcxCustomRow): Boolean; + function LastRow: TcxCustomRow; + function LastVisibleRow: TcxCustomRow; + function NextRow(ARow: TcxCustomRow): TcxCustomRow; + function NextVisibleRow(ARow: TcxCustomRow): TcxCustomRow; + function PrevRow(ARow: TcxCustomRow): TcxCustomRow; + function PrevVisibleRow(ARow: TcxCustomRow): TcxCustomRow; + procedure Remove(ARow: TcxCustomRow); + function RowByCaption(const ACaption: string): TcxCustomRow; + function RowByName(const AName: string): TcxCustomRow; + // store/load + procedure RestoreFromIniFile(const AStorageName: string); + procedure RestoreFromRegistry(const AStorageName: string); + procedure RestoreFromStream(AStream: TStream); + procedure StoreToIniFile(const AStorageName: string; AReCreate: Boolean = True); + procedure StoreToRegistry(const AStorageName: string; AReCreate: Boolean = True); + procedure StoreToStream(AStream: TStream); + // edit control + procedure CancelEdit; + procedure HideEdit; + procedure ShowEdit; + procedure ShowEditByKey(AKey: Char); + procedure ShowEditByMouse(X, Y: Integer; AShift: TShiftState); + + procedure RestoreDefaults; virtual; + // properties + property FocusedRow: TcxCustomRow read GetFocusedRow write SetFocusedRow; + property HitTest: TcxvgHitTest read GetHitTest; + property Images: TCustomImageList read FImages write SetImages; + property InplaceEditor: TcxCustomEdit read GetInplaceEditor; + property IsEditing: Boolean read GetIsEditing; + property LeftVisibleBand: Integer read GetLeftVisibleBand write SetLeftVisibleBand; + property LookAndFeel; + property OptionsBehavior: TcxvgOptionsBehavior read GetOptionsBehavior write SetOptionsBehavior; + property OptionsData; + property OptionsView: TcxvgOptionsView read GetOptionsView write SetOptionsView; + property Rows: TcxVerticalGridRows read FRows write FRows; + property StoringName: string read FStoringName write FStoringName; + property Styles: TcxVerticalGridStyles read GetStyles write SetStyles; + property TopVisibleRowIndex: Integer read GetTopVisibleRowIndex write SetTopVisibleRowIndex; + property ViewInfo: TcxvgCustomViewInfo read GetViewInfo; + published + property StylesEvents: TNotifyEvent read FStylesEvents write FStylesEvents; + end; + + { TcxUnboundVerticalGrid } + + TcxUnboundVerticalGrid = class(TcxCustomVerticalGrid) + private + FLayoutStyle: TcxvgUnboundLayoutStyle; + procedure SetLayoutStyle(Value: TcxvgUnboundLayoutStyle); + protected + function CanBandSizing: Boolean; override; + function GetScrollStrategyClass: TcxvgCustomScrollStrategyClass; override; + function GetViewInfoClass: TcxCustomControlViewInfoClass; override; + property LayoutStyle: TcxvgUnboundLayoutStyle read FLayoutStyle write SetLayoutStyle default ulsSingleRecordView; + public + constructor Create(AOwner: TComponent); override; + end; + + IcxVGridDesignerRows = interface + ['{D77CC392-984F-4C1E-A41C-A341FEAC93EB}'] + function GetEditorRowClass: TcxCustomRowClass; + function GetMultiEditorRowClass: TcxCustomRowClass; + end; + + { TcxVerticalGrid } + + TcxVerticalGrid = class(TcxUnboundVerticalGrid, IcxVGridDesignerRows) + public + property Customizing; + published + property Align; + property Anchors; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property Font; + property Images; + property LayoutStyle; + property LookAndFeel; + property OptionsView; //before OptionsBehavior + property OptionsBehavior; + property OptionsData; + property ParentFont; + property PopupMenu; + property Styles; + property TabOrder; + property TabStop; + property Visible; + + property OnClick; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnCustomizationFormVisibleChanged; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnDrawBackground; + property OnDrawRowHeader; + property OnDrawValue; + property OnEdited; + property OnEditing; + property OnEditValueChanged; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnInitEdit; + property OnItemChanged; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnLayoutChanged; + property OnLeftVisibleBandIndexChanged; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnMouseWheel; + property OnMouseWheelDown; + property OnMouseWheelUp; + property OnResize; + property OnStartDock; + property OnStartDrag; + property OnTopRowIndexChanged; + end; + + { TcxVirtualVerticalGrid } + + TcxVerticalGridFocusedRecordChangedEvent = procedure(Sender: TcxVirtualVerticalGrid; + APrevFocusedRecord, AFocusedRecord: Integer) of object; + + IcxVerticalGridDBDataContoller = interface + ['{947072DE-3531-4010-8C44-D243FD289FDF}'] + procedure CheckGridModeBufferCount; + function DoScroll(AForward: Boolean): Boolean; + function GetDataSetRecordCount: Integer; + function GetScrollBarPos: Integer; + function GetScrollBarRecordCount: Integer; + function SetScrollBarPos(APos: Integer): Boolean; + end; + + TcxVirtualVerticalGrid = class(TcxCustomVerticalGrid, IcxVGridDesignerRows, + IcxNavigator, IcxFilterControl) + private + FNavigatorNotifier: TcxNavigatorControlNotifier; + FLayoutStyle: TcxvgLayoutStyle; + FOnFilterControlDialogShow: TNotifyEvent; + FOnFocusedRecordChanged: TcxVerticalGridFocusedRecordChangedEvent; + procedure ApplyFilter(Sender: TObject); + function GetFilterElementProperties(AIndex: Integer): TcxCustomEditorRowProperties; + function GetFilterRecordEvent: TcxDataFilterRecordEvent; + function GetFocusedRecordIndex: Integer; + function GetController: TcxvgMultiRecordsController; + function GetOptionsBehavior: TcxvgMultiRecordsOptionsBehavior; + function GetOptionsData: TcxvgMultiRecordsOptionsData; + function GetOptionsView: TcxvgMultiRecordsOptionsView; + procedure SetFilterRecordEvent(Value: TcxDataFilterRecordEvent); + procedure SetFocusedRecordIndex(Value: Integer); + procedure SetLayoutStyle(Value: TcxvgLayoutStyle); + procedure SetOptionsBehavior(Value: TcxvgMultiRecordsOptionsBehavior); + procedure SetOptionsData(Value: TcxvgMultiRecordsOptionsData); + procedure SetOptionsView(Value: TcxvgMultiRecordsOptionsView); + protected + // IcxFilterControl + function IcxFilterControl.GetCaption = GetFilterCaption; + function IcxFilterControl.GetCount = GetFilterCount; + function IcxFilterControl.GetCriteria = GetFilterCriteria; + function IcxFilterControl.GetFieldName = GetFilterFieldName; + function IcxFilterControl.GetItemLink = GetFilterItemLink; + function IcxFilterControl.GetItemLinkID = GetFilterItemLinkID; + function IcxFilterControl.GetProperties = GetFilterProperties; + function IcxFilterControl.GetValueType = GetFilterValueType; + function GetFilterCaption(Index: Integer): string; + function GetFilterCount: Integer; + function GetFilterCriteria: TcxFilterCriteria; + function GetFilterFieldName(Index: Integer): string; + function GetFilterItemLink(Index: Integer): TObject; + function GetFilterItemLinkID(Index: Integer): Integer; + function GetItemLinkName(Index: Integer): string; + function GetFilterProperties(Index: Integer): TcxCustomEditProperties; + function GetFilterValueType(Index: Integer): TcxValueTypeClass; + // IcxNavigator + function IcxNavigator.CanAppend = NavigatorCanAppend; + function IcxNavigator.CanDelete = NavigatorCanDelete; + function IcxNavigator.CanEdit = NavigatorCanEdit; + function IcxNavigator.CanInsert = NavigatorCanInsert; + function IcxNavigator.IsActive = NavigatorIsActive; + function IcxNavigator.IsBof = NavigatorIsBof; + function IcxNavigator.IsBookmarkAvailable = NavigatorIsBookmarkAvailable; + function IcxNavigator.IsEditing = NavigatorIsEditing; + function IcxNavigator.IsEof = NavigatorIsEof; + procedure IcxNavigator.ClearBookmark = NavigatorClearBookmark; + procedure IcxNavigator.DoAction = NavigatorDoAction; + function IcxNavigator.GetNotifier = NavigatorGetNotifier; + function IcxNavigator.IsActionSupported = NavigatorIsActionSupported; + function NavigatorCanAppend: Boolean; + function NavigatorCanDelete: Boolean; + function NavigatorCanEdit: Boolean; + function NavigatorCanInsert: Boolean; + function NavigatorIsActive: Boolean; + function NavigatorIsBof: Boolean; + function NavigatorIsBookmarkAvailable: Boolean; + function NavigatorIsEditing: Boolean; + function NavigatorIsEof: Boolean; + procedure NavigatorClearBookmark; + procedure NavigatorDoAction(AButtonIndex: Integer); + function NavigatorGetNotifier: TcxNavigatorControlNotifier; + function NavigatorIsActionSupported(AButtonIndex: Integer): Boolean; + procedure RefreshNavigators; + procedure CreateSubClasses; override; + procedure DestroySubClasses; override; + function CanBandSizing: Boolean; override; + procedure ControlUpdateData(AInfo: TcxUpdateControlInfo); override; + procedure DoFilterDialog; virtual; + procedure DoFocusedRecordChanged(APrevFocusedRecord, AFocusedRecord: Integer); virtual; + function GetCellAutoHeight: Boolean; override; + function GetControllerClass: TcxCustomControlControllerClass; override; + function GetOptionsBehaviorClass: TcxControlOptionsBehaviorClass; override; + function GetOptionsDataClass: TcxControlOptionsDataClass; override; + function GetOptionsViewClass: TcxControlOptionsViewClass; override; + function GetScrollStrategyClass: TcxvgCustomScrollStrategyClass; override; + function GetViewInfoClass: TcxCustomControlViewInfoClass; override; + procedure InitDataController; override; + procedure DataLayoutChanged; override; + property Controller: TcxvgMultiRecordsController read GetController; + public + constructor Create(AOwner: TComponent); override; + procedure Assign(Source: TPersistent); override; + property Customizing; + property DataController; + property LeftVisibleRecord; + property FocusedRecordIndex: Integer read GetFocusedRecordIndex write SetFocusedRecordIndex; + property RecordCount; + published + property Align; + property Anchors; + property Constraints; + property DragCursor; + property DragKind; + property DragMode; + property Enabled; + property Font; + property Images; + property LayoutStyle: TcxvgLayoutStyle read FLayoutStyle write SetLayoutStyle default lsSingleRecordView; + property LookAndFeel; + //before OptionsBehavior + property OptionsView: TcxvgMultiRecordsOptionsView read GetOptionsView write SetOptionsView; + property OptionsBehavior: TcxvgMultiRecordsOptionsBehavior read GetOptionsBehavior write SetOptionsBehavior; + property OptionsData: TcxvgMultiRecordsOptionsData read GetOptionsData write SetOptionsData; + property ParentFont; + property PopupMenu; + property Styles; + property TabOrder; + property TabStop; + property Visible; + + property OnClick; + {$IFDEF DELPHI5} + property OnContextPopup; + {$ENDIF} + property OnCustomizationFormVisibleChanged; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnDrawBackground; + property OnDrawRowHeader; + property OnDrawValue; + property OnEdited; + property OnEditing; + property OnEditValueChanged; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnFilterControlDialogShow: TNotifyEvent + read FOnFilterControlDialogShow write FOnFilterControlDialogShow; + property OnFilterRecord: TcxDataFilterRecordEvent + read GetFilterRecordEvent write SetFilterRecordEvent; + property OnFocusedRecordChanged: TcxVerticalGridFocusedRecordChangedEvent + read FOnFocusedRecordChanged write FOnFocusedRecordChanged; + property OnInitEdit; + property OnItemChanged; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnLayoutChanged; + property OnLeftVisibleBandIndexChanged; + property OnLeftVisibleRecordIndexChanged; + property OnMouseDown; + property OnMouseEnter; + property OnMouseLeave; + property OnMouseMove; + property OnMouseUp; + property OnMouseWheel; + property OnMouseWheelDown; + property OnMouseWheelUp; + property OnResize; + property OnStartDock; + property OnStartDrag; + property OnTopRowIndexChanged; + end; + + { TcxRowValueInfo } + + TcxRowValueInfo = class(TcxEditCellViewInfo) + private + FFocusRect: TRect; + FRow: TcxCustomRow; + FRowCellIndex: Integer; + FRecordIndex: Integer; + function GetEditorRowProperties: TcxCustomEditorRowProperties; + protected + procedure DoCalculate; override; + function EditContainer: TcxCellEdit; + function GetButtonTransparency: TcxEditButtonTransparency; override; + function GetDisplayValue: Variant; override; + function GetEditViewParams: TcxViewParams; override; + function GetFocused: Boolean; override; + function GetRecordIndex: Integer; override; + function GetSelectedTextColor: Integer; override; + function GetSelectedBKColor: Integer; override; + function IncSearchParams: TcxViewParams; + function IsAutoHeight: Boolean; override; + property EditorRowProperties: TcxCustomEditorRowProperties read GetEditorRowProperties; + public + property Focused; + property FocusRect: TRect read FFocusRect write FFocusRect; + property Row: TcxCustomRow read FRow; + property RowCellIndex: Integer read FRowCellIndex; + property ViewParams; + end; + + { TcxRowCaptionInfo } + + TcxRowCaptionInfo = class(TPersistent, IUnknown, IcxHotTrackElement) + private + FCaption: string; + FCaptionRect: TRect; + FCaptionTextRect: TRect; + FFocused: Boolean; + FImageIndex: Integer; + FImageRect: TRect; + FImages: TCustomImageList; + FRow: TcxCustomRow; + FRowCellIndex: Integer; + FViewParams: TcxViewParams; + FTextFlags: Integer; + function FindPropertiesHint(const P: TPoint): string; + protected + // IUnknown + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + // IcxHotTrackElement + function GetOrigin: TPoint; virtual; + function IsNeedHint(ACanvas: TcxCanvas; const P: TPoint; + out AText: TCaption; + out AIsMultiLine: Boolean; + out ATextRect: TRect; var IsNeedOffsetHint: Boolean): Boolean; virtual; + procedure UpdateHotTrackState(const APoint: TPoint); + public + constructor Create; virtual; + destructor Destroy; override; + // IUnknown + function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall; + + property Caption: string read FCaption write FCaption; + property CaptionRect: TRect read FCaptionRect; + property CaptionTextRect: TRect read FCaptionTextRect; + property Focused: Boolean read FFocused; + property ImageIndex: Integer read FImageIndex; + property ImageRect: TRect read FImageRect; + property Images: TCustomImageList read FImages; + property Row: TcxCustomRow read FRow; + property RowCellIndex: Integer read FRowCellIndex write FRowCellIndex; + property ViewParams: TcxViewParams read FViewParams; + property TextFlags: Integer read FTextFlags; + end; + + { TcxCaptionInfoList } + + TcxCaptionInfoList = class(TcxObjectList) + private + function GetItem(Index: Integer): TcxRowCaptionInfo; + public + property Items[Index: Integer]: TcxRowCaptionInfo read GetItem; default; + end; + + { TcxValueInfoList } + + TcxValueInfoList = class(TList) + private + FViewInfo: TcxvgCustomViewInfo; + function GetItem(Index: Integer): TcxRowValueInfo; + public + constructor Create(AViewInfo: TcxvgCustomViewInfo); + destructor Destroy; override; + procedure Trunc(ACount: Integer); + property Items[Index: Integer]: TcxRowValueInfo read GetItem; default; + end; + + { TcxCustomRowHeaderInfo } + + TcxCustomRowHeaderInfo = class + private + FCaptionsInfo: TcxCaptionInfoList; + FCategoryIndents: TIndentInfoList; + FFocusRect: TRect; + FLinesInfo: TLineInfoList; + FRowIndents: TIndentInfoList; + FTransparent: Boolean; + FViewInfo: TcxvgCustomViewInfo; + function GetPaintStyle: TcxvgPaintStyle; + function GetSelected: Boolean; + function GetShowButton: Boolean; + function GetVerticalGrid: TcxCustomVerticalGrid; + protected + FButtonRect: TRect; + FButtonColor: TColor; + FFocused: Boolean; + FHeaderCellsRect: TRect; + FHeaderRect: TRect; + FIndentBounds: TRect; + FIndentViewParams: TcxViewParams; + FRow: TcxCustomRow; + FViewParams: TcxViewParams; + procedure AddBottomHorzLine(const R: TRect); virtual; + procedure AddBoundHeaderLines; virtual; + procedure AddNextIndentInfo(const ABounds: TRect; + const AViewParams: TcxViewParams; + AToCategories, AUnderline, AAddVertLine: Boolean); + procedure AddRightVertLine(const R: TRect); virtual; + procedure Calc(const AHeaderRect: TRect; AViewInfo: TcxvgCustomViewInfo; + ANextRow: TcxCustomRow; ACalcBounds: Boolean); + function CalcCaptionInfo(ARowProperties: TcxCaptionRowProperties; + const R: TRect): TcxRowCaptionInfo; + procedure CalcIndentBounds(ANextRow: TcxCustomRow; ACalculate: Boolean); virtual; + function CalcIndentsInfo(ALevelCount: Integer; + ANextRow: TcxCustomRow): TIndentRectInfoList; virtual; + procedure CalcExpandButton; + procedure CalcRowCaptionsInfo; virtual; + procedure CalcViewParams(AAllowFocus: Boolean); virtual; + procedure Clear; virtual; + procedure DoCalcExpandButton; virtual; + function GetButtonPlaceBackgroundWidth: Integer; virtual; + function GetCaptionViewParams: TcxViewParams; virtual; + function GetButtonColor: TColor; virtual; + function GetFocusRect: TRect; virtual; + function GetTopCentralPoint(AHeight: Integer; const R: TRect): Integer; + function IncreaseBoundsByLastVertLine: Boolean; virtual; + function LeftViewPoint: Integer; virtual; + property IndentViewParams: TcxViewParams read FIndentViewParams; + property PaintStyle: TcxvgPaintStyle read GetPaintStyle; + property Selected: Boolean read GetSelected; + property VerticalGrid: TcxCustomVerticalGrid read GetVerticalGrid; + property ViewInfo: TcxvgCustomViewInfo read FViewInfo; + public + constructor Create(ARow: TcxCustomRow); virtual; + destructor Destroy; override; + property CaptionsInfo: TcxCaptionInfoList read FCaptionsInfo; + property CategoryIndents: TIndentInfoList read FCategoryIndents; + property ButtonRect: TRect read FButtonRect; + property ButtonColor: TColor read FButtonColor; + property Focused: Boolean read FFocused; + property FocusRect: TRect read FFocusRect write FFocusRect; + property HeaderCellsRect: TRect read FHeaderCellsRect; + property HeaderRect: TRect read FHeaderRect write FHeaderRect; + property IndentBounds: TRect read FIndentBounds; + property LinesInfo: TLineInfoList read FLinesInfo; + property Row: TcxCustomRow read FRow; + property RowIndents: TIndentInfoList read FRowIndents; + property ShowButton: Boolean read GetShowButton; + property Transparent: Boolean read FTransparent write FTransparent; + property ViewParams: TcxViewParams read FViewParams write FViewParams; + end; + + { TcxCustomRowViewInfo } + + TcxCustomRowViewInfo = class + private + FBandIndex: Integer; + FBandRowIndex: Integer; + FCalculatedHeight: Integer; + FHeaderInfo: TcxCustomRowHeaderInfo; + FRow: TcxCustomRow; + FRowRect: TRect; + FValuesInfo: TcxValueInfoList; + FValuesRect: TRect; + FViewInfo: TcxvgCustomViewInfo; + function GetRowValueInfo(ARecordIndex, ACellIndex: Integer): TcxRowValueInfo; + function GetVerticalGrid: TcxCustomVerticalGrid; + protected + procedure AddRectValueLines(R: TRect; ALast, ABottomLineNeeded: Boolean); + procedure CalcValuesInfo; virtual; abstract; + procedure CalcRowHeaderInfo(ANextRow: TcxCustomRow); virtual; + function CalcRowValueInfo(ARowProperties: TcxCustomRowProperties; + AViewInfo: TcxvgCustomViewInfo; + ARecordIndex, ACellIndex: Integer): TcxRowValueInfo; + procedure CalcPaintViewParamsLines(ANextRow: TcxCustomRow); virtual; + function GetValueHeight(ARecordIndex: Integer; AWidth: Integer; + AViewInfo: TcxvgCustomViewInfo): Integer; virtual; + function GetRowValueInfoClass: TcxRowValueInfoClass; virtual; + procedure ValidateViewInfo; + + property ValuesInfo: TcxValueInfoList read FValuesInfo; + property ViewInfo: TcxvgCustomViewInfo read FViewInfo; + public + constructor Create(ARow: TcxCustomRow); virtual; + destructor Destroy; override; + procedure Calc(const ARowRect: TRect; + AViewInfo: TcxvgCustomViewInfo; + ANextRow: TcxCustomRow); + procedure Update; + procedure UpdateRecord(ARecordIndex: Integer); + property BandIndex: Integer read FBandIndex write FBandIndex; + property BandRowIndex: Integer read FBandRowIndex write FBandRowIndex; + property CalculatedHeight: Integer read FCalculatedHeight write FCalculatedHeight; + property HeaderInfo: TcxCustomRowHeaderInfo read FHeaderInfo; + property Row: TcxCustomRow read FRow; + property RowRect: TRect read FRowRect; + property RowValueInfo[ARecordIndex, ACellIndex: Integer]: TcxRowValueInfo read GetRowValueInfo; + property ValuesRect: TRect read FValuesRect write FValuesRect; + property VerticalGrid: TcxCustomVerticalGrid read GetVerticalGrid; + end; + + { TcxRowViewInfoList } + + TcxRowViewInfoList = class(TList) + private + function GetItem(Index: Integer): TcxCustomRowViewInfo; + public + constructor Create; + function Find(ARow: TcxCustomRow): TcxCustomRowViewInfo; + property Items[Index: Integer]: TcxCustomRowViewInfo read GetItem; default; + end; + + { TcxvgCustomViewInfo } + + TcxvgCustomViewInfo = class(TcxCustomControlViewInfo) + private + FBandBorderColor: TColor; + FBandMinWidth: Integer; + FBandsInterval: Integer; + FButtonSize: Integer; + FCalcHelper: TcxvgCustomPaintStyleCalcHelper; + FClipRect: TRect; + FDividerWidth: Integer; + FExplorerButtonSize: TSize; + FUseCategoryExplorerStyle: Boolean; + FFocusLinesInfo: TLineInfoList; + FFullHeaderWidth: Integer; + FHorzLineBrush: TBrush; + FHorzLineWidth: Integer; + FImageSize: TSize; + FLevelWidth: Integer; + FLinesInfo: TLineInfoList; + FLockDividerPos: Boolean; + FMaxVisibleLevel: Integer; + FRowHeaderMinWidth: Integer; + FRowIndentWidth: Integer; + FRowMinHeight: Integer; + FRowsViewInfo: TcxRowViewInfoList; + FShowHeaders: Boolean; + FVerticalGrid: TcxCustomVerticalGrid; + FVertLineBrush: TBrush; + FVertLineWidth: Integer; + FViewBandWidth: Integer; + FViewHeaderWidth: Integer; + FViewValueWidth: Integer; + FViewRects: TViewRects; + FVisibleRows: TList; + procedure ClearLinesAndRows; + function GetBandInfo: TBandInfoList; + function GetFirstVisibleRecordIndex: Integer; + function GetMinRowHeight: Integer; + function GetPainter: TcxvgPainter; + function GetScroller: TcxvgScroller; + function GetVisibleRow(Index: Integer): TcxCustomRow; + function GetVisibleRowCount: Integer; + procedure UpdateScroller; + protected + // overriding methods + function CalculateDefaultEditHeight: Integer; override; + procedure DoCalculate; override; + procedure UpdateSelection; override; + // + procedure AddBandRowsLines(const R: TRect); virtual; + procedure AddBottomValueSide(const R: TRect); + procedure AddEmptyRects; virtual; abstract; + procedure AddRightValueSide(const R: TRect; ALast: Boolean); virtual; + procedure CalcBandRects; virtual; + procedure CalcBandRowsViewInfo(var AFirstRowIndex: Integer; + const ABandRect: TRect; ABandIndex, ABandRowCount: Integer); virtual; + procedure CalcBandWidth; virtual; + procedure CalcEmpty; virtual; + procedure CalcCategoryExplorerStyle; + procedure CalcLayoutGeneral; virtual; + procedure CalcRowRects(ARowViewInfo: TcxCustomRowViewInfo); virtual; + procedure CalcRowsViewInfo; virtual; + procedure CalcViewRects; virtual; + function CanAddRowToBand(const ARowRect, ABandRect: TRect; ABandRowIndex: Integer): Boolean; virtual; + procedure CheckMaxRowHeaderWidth(var Value: Integer; AValueMinWidth: Integer); virtual; + function CheckShowRowHeader(ARowViewInfo: TcxCustomRowViewInfo): Boolean; + procedure Clear; virtual; + procedure CreateBand(ABandHeight, ABandWidth: Integer); virtual; + procedure CreateBrushes; virtual; + function CreateCalcHelper: TcxvgCustomPaintStyleCalcHelper; virtual; + procedure DestroyBrushes; virtual; + function GetBandSizeableRect(const ABandRect: TRect): TRect; virtual; + function GetRowAutoHeight(ARow: TcxCustomRow): Boolean; virtual; + function GetRowHeight(ARowViewInfo: TcxCustomRowViewInfo; ABandWidth: Integer): Integer; virtual; + function GetViewBandWidth: Integer; virtual; + function GetViewHeaderWidth: Integer; virtual; + function GetViewMinHeaderWidth: Integer; virtual; + function GetViewValueWidth: Integer; virtual; + function GetVisibleValueCount: Integer; virtual; abstract; + procedure LayoutStyleChanged; virtual; + procedure Reset; virtual; + function ScaleRowRects(ARowViewInfo: TcxCustomRowViewInfo): TRectScaler; virtual; + procedure SetDividerPos(APos: Integer); virtual; + procedure SetValueWidth(AWidth: Integer); virtual; + procedure UpdateVisibleRows; + property Scroller: TcxvgScroller read GetScroller; + property LockDividerPos: Boolean read FLockDividerPos; + property MaxVisibleLevel: Integer read FMaxVisibleLevel; + property ViewBandWidth: Integer read FViewBandWidth write FViewBandWidth; + property ViewHeaderWidth: Integer read FViewHeaderWidth write FViewHeaderWidth; + property ViewValueWidth: Integer read FViewValueWidth write FViewValueWidth; + public + constructor Create(AOwner: TcxEditingControl); override; + destructor Destroy; override; + procedure CalcEditCell(const ABounds: TRect; ARowValueInfo: TcxRowValueInfo); virtual; + function CalcRowHeight(ARow: TcxCustomRow): Integer; + procedure ChangeFocusedRow(ANewFocus, AOldFocus: TcxCustomRow); virtual; + function GetDefaultGridModeBufferCount: Integer; virtual; + function GetRowViewInfo(ARow: TcxCustomRow): TcxCustomRowViewInfo; + function GetValueRect(AValueIndex: Integer; + ARowViewInfo: TcxCustomRowViewInfo): TRect; virtual; + function GetValuesRect(ARowViewInfo: TcxCustomRowViewInfo): TRect; virtual; + procedure UpdateRecord(ARecordIndex: Integer); virtual; + // properties + property BandBorderColor: TColor read FBandBorderColor write FBandBorderColor; + property BandMinWidth: Integer read FBandMinWidth; + property BandInfo: TBandInfoList read GetBandInfo; + property BandsInterval: Integer read FBandsInterval; + property ButtonSize: Integer read FButtonSize write FButtonSize; + property CalcHelper: TcxvgCustomPaintStyleCalcHelper read FCalcHelper; + property ClipRect: TRect read FClipRect; + property DividerWidth: Integer read FDividerWidth write FDividerWidth; + property ExplorerButtonSize: TSize read FExplorerButtonSize; + property UseCategoryExplorerStyle: Boolean read FUseCategoryExplorerStyle; + property FirstVisibleRecordIndex: Integer read GetFirstVisibleRecordIndex; + property FocusLinesInfo: TLineInfoList read FFocusLinesInfo; + property FullHeaderWidth: Integer read FFullHeaderWidth; + property HorzLineBrush: TBrush read FHorzLineBrush write FHorzLineBrush; + property HorzLineWidth: Integer read FHorzLineWidth; + property ImageSize: TSize read FImageSize write FImageSize; + property LevelWidth: Integer read FLevelWidth write FLevelWidth; + property LinesInfo: TLineInfoList read FLinesInfo write FLinesInfo; + property Painter: TcxvgPainter read GetPainter; + property RowHeaderMinWidth: Integer read FRowHeaderMinWidth; + property RowIndentWidth: Integer read FRowIndentWidth; + property RowsViewInfo: TcxRowViewInfoList read FRowsViewInfo; + property ShowHeaders: Boolean read FShowHeaders; + property VerticalGrid: TcxCustomVerticalGrid read FVerticalGrid; + property VertLineBrush: TBrush read FVertLineBrush write FVertLineBrush; + property VertLineWidth: Integer read FVertLineWidth write FVertLineWidth; + property ViewRects: TViewRects read FViewRects; + property VisibleRows[Index: Integer]: TcxCustomRow read GetVisibleRow; + property VisibleRowCount: Integer read GetVisibleRowCount; + property VisibleValueCount: Integer read GetVisibleValueCount; + end; + + { TcxvgCustomPaintStyleCalcHelper } + + TcxvgCustomPaintStyleCalcHelper = class + private + FScroller: TcxvgScroller; + FViewInfo: TcxvgCustomViewInfo; + FVerticalGrid: TcxCustomVerticalGrid; + protected + function CreateHorzLineBrush: TBrush; virtual; abstract; + function CreateVertLineBrush: TBrush; virtual; abstract; + function GetBandBorderColor: TColor; virtual; + function GetDividerWidth: Integer; virtual; abstract; + function GetIndentWidth: Integer; virtual; abstract; + public + constructor Create(AViewInfo: TcxvgCustomViewInfo); virtual; + procedure AddBoundHeaderLines(ARowHeaderInfo: TcxCustomRowHeaderInfo); virtual; abstract; + procedure AddDivider(ALinesInfo: TLineInfoList; const R: TRect; + AColor: TColor; AIsSeparator: Boolean); virtual; abstract; + procedure AddHeaderIndentLines(ARowHeaderInfo: TcxCustomRowHeaderInfo; + const R: TRect; const AViewParams: TcxViewParams; + AToCategories, AUnderline, AAddVertLine: Boolean); virtual; abstract; + procedure CalcPaintViewParamsLines(ARowViewInfo: TcxCustomRowViewInfo; + ANextRow: TcxCustomRow); virtual; abstract; + function ChangeFocusedRow(ANewFocus, AOldFocus: TcxCustomRow): TRect; virtual; abstract; + function GetBackgroundColor: TColor; virtual; + function GetCategoryColor: TColor; virtual; abstract; + function GetCategoryFocusRect(ARowHeaderInfo: TcxCustomRowHeaderInfo): TRect; virtual; abstract; + function GetCategoryTextColor: TColor; virtual; abstract; + function GetContentColor(AFocused: Boolean): TColor; virtual; abstract; + function GetContentTextColor: TColor; virtual; abstract; + function GetHeaderColor: TColor; virtual; abstract; + function GetHeaderTextColor: TColor; virtual; abstract; + function GetIndentViewParams(ARow, AParentIndentRow: TcxCustomRow): TcxViewParams; virtual; abstract; + function IsDrawValueFocusRect: Boolean; virtual; abstract; + property Scroller: TcxvgScroller read FScroller; + property ViewInfo: TcxvgCustomViewInfo read FViewInfo; + property VerticalGrid: TcxCustomVerticalGrid read FVerticalGrid; + end; + + { TcxvgDotNetStyleCalcHelper } + + TcxvgDotNetStyleCalcHelper = class(TcxvgCustomPaintStyleCalcHelper) + protected + function CreateHorzLineBrush: TBrush; override; + function CreateVertLineBrush: TBrush; override; + function GetDividerWidth: Integer; override; + function GetIndentWidth: Integer; override; + public + procedure AddBoundHeaderLines(ARowHeaderInfo: TcxCustomRowHeaderInfo); override; + procedure AddDivider(ALinesInfo: TLineInfoList; const R: TRect; + AColor: TColor; AIsSeparator: Boolean); override; + procedure AddHeaderIndentLines(ARowHeaderInfo: TcxCustomRowHeaderInfo; + const R: TRect; const AViewParams: TcxViewParams; + AToCategories, AUnderline, AAddVertLine: Boolean); override; + procedure CalcPaintViewParamsLines(ARowViewInfo: TcxCustomRowViewInfo; + ANextRow: TcxCustomRow); override; + function ChangeFocusedRow(ANewFocus, AOldFocus: TcxCustomRow): TRect; override; + function GetCategoryColor: TColor; override; + function GetCategoryFocusRect(ARowHeaderInfo: TcxCustomRowHeaderInfo): TRect; override; + function GetCategoryTextColor: TColor; override; + function GetContentColor(AFocused: Boolean): TColor; override; + function GetContentTextColor: TColor; override; + function GetHeaderColor: TColor; override; + function GetHeaderTextColor: TColor; override; + function GetIndentViewParams(ARow, AParentIndentRow: TcxCustomRow): TcxViewParams; override; + function IsDrawValueFocusRect: Boolean; override; + end; + + { TcxvgStyle3DCalcHelper } + + TcxvgStyle3DCalcHelper = class(TcxvgCustomPaintStyleCalcHelper) + protected + function CreateHorzLineBrush: TBrush; override; + function CreateVertLineBrush: TBrush; override; + function GetDividerWidth: Integer; override; + function GetIndentWidth: Integer; override; + public + procedure AddBoundHeaderLines(ARowHeaderInfo: TcxCustomRowHeaderInfo); override; + procedure AddHeaderIndentLines(ARowHeaderInfo: TcxCustomRowHeaderInfo; + const R: TRect; const AViewParams: TcxViewParams; + AToCategories, AUnderline, AAddVertLine: Boolean); override; + procedure AddDivider(ALinesInfo: TLineInfoList; + const R: TRect; AColor: TColor; AIsSeparator: Boolean); override; + procedure CalcPaintViewParamsLines(ARowViewInfo: TcxCustomRowViewInfo; + ANextRow: TcxCustomRow); override; + function ChangeFocusedRow(ANewFocus, AOldFocus: TcxCustomRow): TRect; override; + function GetCategoryColor: TColor; override; + function GetCategoryFocusRect(ARowHeaderInfo: TcxCustomRowHeaderInfo): TRect; override; + function GetCategoryTextColor: TColor; override; + function GetContentColor(AFocused: Boolean): TColor; override; + function GetContentTextColor: TColor; override; + function GetHeaderColor: TColor; override; + function GetHeaderTextColor: TColor; override; + function GetIndentViewParams(ARow, AParentIndentRow: TcxCustomRow): TcxViewParams; override; + function IsDrawValueFocusRect: Boolean; override; + end; + + { TcxvgStyle3DCalcHelper } + + TcxvgSkinCalcHelper = class(TcxvgDotNetStyleCalcHelper) + protected + function CreateHorzLineBrush: TBrush; override; + function CreateVertLineBrush: TBrush; override; + function GetBandBorderColor: TColor; override; + public + procedure AddBoundHeaderLines(ARowHeaderInfo: TcxCustomRowHeaderInfo); override; + procedure AddHeaderIndentLines(ARowHeaderInfo: TcxCustomRowHeaderInfo; + const R: TRect; const AViewParams: TcxViewParams; + AToCategories, AUnderline, AAddVertLine: Boolean); override; + function GetBackgroundColor: TColor; override; + function GetCategoryColor: TColor; override; + function GetCategoryTextColor: TColor; override; + function GetHeaderColor: TColor; override; + end; + + { TcxvgPainter } + + TcxvgPainter = class(TcxCustomControlPainter) + private + function GetViewInfo: TcxvgCustomViewInfo; + function GetVerticalGrid: TcxCustomVerticalGrid; + protected + procedure DoPaint; override; + procedure DrawRows; + procedure DrawStyleFeatures; virtual; + public + constructor Create(AOwner: TcxEditingControl); override; + procedure DrawBackground; virtual; + procedure DrawButton(ARowHeader: TcxCustomRowHeaderInfo); virtual; + procedure DrawCategoryRowHeader(ARowHeader: TcxCustomRowHeaderInfo); virtual; + procedure DrawCategoryRowIndent(ARowHeader: TcxCustomRowHeaderInfo); virtual; + procedure DrawHeaderDragImage(ARowHeader: TcxCustomRowHeaderInfo); virtual; + procedure DrawHeaderSeparators(ARowHeader: TcxCustomRowHeaderInfo); virtual; + procedure DrawImage(ACaptionInfo: TcxRowCaptionInfo); virtual; + procedure DrawLines(ALinesInfo: TLineInfoList; R: TRect); virtual; + procedure DrawRow(ARowViewInfo: TcxCustomRowViewInfo); virtual; + procedure DrawRowHeader(ARowHeader: TcxCustomRowHeaderInfo); virtual; + procedure DrawRowHeaderCell(ACaptionInfo: TcxRowCaptionInfo; ATransparent: Boolean); virtual; + procedure DrawRowIndent(ARowHeader: TcxCustomRowHeaderInfo); virtual; + procedure DrawRowValueCell(AValueInfo: TcxRowValueInfo); virtual; + procedure DrawValuesSeparators(ARowViewInfo: TcxCustomRowViewInfo); virtual; + procedure FillRect(const R: TRect; ABitmap: TBitmap = nil); + property VerticalGrid: TcxCustomVerticalGrid read GetVerticalGrid; + property ViewInfo: TcxvgCustomViewInfo read GetViewInfo; + end; + + { TcxStyle3DPainter } + + TcxStyle3DPainter = class(TcxvgPainter) + protected + procedure DrawStyleFeatures; override; + end; + + // STYLES + PcxvgContentParamsData = ^TcxvgContentParamsData; + TcxvgContentParamsData = record + Row: TcxCustomRow; + Focused: Boolean; + end; + + TcxvgOnGetItemStyleEvent = procedure(Sender: TObject; ARow: TcxCustomRow; + var AStyle: TcxStyle) of object; + TcxvgOnGetContentStyleEvent = procedure(Sender: TObject; + AEditProp: TcxCustomEditorRowProperties; AFocused: Boolean; + ARecordIndex: Integer; var AStyle: TcxStyle) of object; + + { TcxvgCustomRowStyles } + + TcxvgCustomRowStyles = class(TcxStyles) + protected + procedure Changed(AIndex: Integer); override; + end; + + { TcxCategoryRowStyles } + + TcxCategoryRowStyles = class(TcxvgCustomRowStyles) + public + procedure Assign(Source: TPersistent); override; + published + property Header: TcxStyle index vgrs_Header read GetValue write SetValue; + end; + + { TcxEditorRowStyles } + + TcxEditorRowStyles = class(TcxCategoryRowStyles) + public + procedure Assign(Source: TPersistent); override; + published + property Content: TcxStyle index vgrs_Content read GetValue write SetValue; + property Header; + end; + + { TcxVerticalGridStyleSheet } + + TcxVerticalGridStyleSheet = class(TcxCustomStyleSheet) + private + function GetStylesValue: TcxVerticalGridStyles; + procedure SetStylesValue(Value: TcxVerticalGridStyles); + public + class function GetStylesClass: TcxCustomStylesClass; override; + published + property Styles: TcxVerticalGridStyles read GetStylesValue write SetStylesValue; + end; + + { TcxVerticalGridStyles } + + TcxVerticalGridStyles = class(TcxCustomControlStyles) + private + FOnGetCategoryStyle: TcxvgOnGetItemStyleEvent; + FOnGetHeaderStyle: TcxvgOnGetItemStyleEvent; + FOnGetContentStyle: TcxvgOnGetContentStyleEvent; + procedure CallInheritedDefaultViewParams(Index: Integer; AData: Pointer; out AParams: TcxViewParams); + protected + procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override; + function GetStyleFromEvent(const AEvent: TcxvgOnGetItemStyleEvent; AItem: TcxCustomRow): TcxStyle; + public + procedure Assign(Source: TPersistent); override; + function GetCategoryParams(ARow: TcxCustomRow): TcxViewParams; virtual; + function GetContentParams(AEditProp: TcxCustomEditorRowProperties; AFocused: Boolean; ARecordIndex: Integer): TcxViewParams; virtual; + function GetHeaderParams(ARow: TcxCustomRow): TcxViewParams; virtual; + function GetIncSearchParams: TcxViewParams; + function GetSelectedHeaderParams(ARow: TcxCustomRow): TcxViewParams; + published + property Category: TcxStyle index vgs_Category read GetValue write SetValue; + property Header: TcxStyle index vgs_Header read GetValue write SetValue; + property IncSearch: TcxStyle index vgs_IncSearch read GetValue write SetValue; + property OnGetCategoryStyle: TcxvgOnGetItemStyleEvent read FOnGetCategoryStyle write FOnGetCategoryStyle; + property OnGetHeaderStyle: TcxvgOnGetItemStyleEvent read FOnGetHeaderStyle write FOnGetHeaderStyle; + property OnGetContentStyle: TcxvgOnGetContentStyleEvent read FOnGetContentStyle write FOnGetContentStyle; + property Background; + property Content; + property Inactive; + property Selection; + property StyleSheet; + end; + + { TcxVerticalGridItemsCustomizeListBox } + + TcxVerticalGridItemsCustomizeListBox = class(TcxCustomizeListBox) + private + FCanvas: TcxCanvas; + FDragging: Boolean; + FIsCategoryListBox: Boolean; + FVerticalGrid: TcxCustomVerticalGrid; + FDragAndDropItemIndex: Integer; + FMouseDownPos: TPoint; + FOffset: TPoint; + function GetDragRow: TcxCustomRow; + function GetPainter: TcxvgPainter; + procedure CNDrawItem(var Message: TWMDrawItem); message CN_DRAWITEM; + procedure WMCancelMode(var Message: TWMCancelMode); message WM_CANCELMODE; + procedure WMPaint(var Message: TMessage); message WM_PAINT; + protected + IsPaint: Boolean; + procedure CalcHeaderViewInfo(const R: TRect; AHeaderInfo: TcxCustomRowHeaderInfo); virtual; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); override; + procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); override; + procedure InitDragAndDropObject; virtual; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure RefreshList; + property Canvas: TcxCanvas read FCanvas; + property DragRow: TcxCustomRow read GetDragRow; + property VerticalGrid: TcxCustomVerticalGrid read FVerticalGrid; + property Painter: TcxvgPainter read GetPainter; + public + constructor CreateEx(AOwner: TComponent; + AVerticalGrid: TcxCustomVerticalGrid; IsCategoryListBox: Boolean); + procedure DragDrop(Source: TObject; X, Y: Integer); override; + destructor Destroy; override; + end; + + { TcxVerticalGridCustomizationForm } + + TcxVerticalGridCustomizationForm = class(TForm) + private + FOwner: TcxVerticalGridCustomizing; + FHookTimer: TTimer; + function GetVerticalGrid: TcxCustomVerticalGrid; + procedure HookTimerHandler(Sender: TObject); + protected + procedure CreateParams(var Params: TCreateParams); override; + procedure DoClose(var Action: TCloseAction); override; + procedure DoShow; override; + + property Customizing: TcxVerticalGridCustomizing read FOwner; + property VerticalGrid: TcxCustomVerticalGrid read GetVerticalGrid; + public + constructor CreateEx(AOwner: TcxVerticalGridCustomizing); + destructor Destroy; override; + end; + + { TcxVerticalGridCustomizing } + + TcxVerticalGridCustomizing = class(TcxOwnedInterfacedPersistent) + private + FCategoryListBox: TcxVerticalGridItemsCustomizeListBox; + FForm: TcxVerticalGridCustomizationForm; + FRowListBox: TcxVerticalGridItemsCustomizeListBox; + FLastBandIndex: Integer; + FLastHeaderIndex: Integer; + FLastPosition: TPoint; + FLineHeight: Integer; + FPageControl: TPageControl; + FPanel: TPanel; + FButtonNew: TcxButton; + FButtonDelete: TcxButton; + FRowCount: Integer; + FSaveDragMode: TDragMode; + FShowCategoryButtons: Boolean; + FShowCategoryTab: Boolean; + FTabSheetCategories: TTabSheet; + FTabSheetRows: TTabSheet; + FVerticalGrid: TcxCustomVerticalGrid; + FVisible: Boolean; + procedure CreateCategoryClick(Sender: TObject); + procedure DeleteCategoryClick(Sender: TObject); + procedure SetRowCount(Value: Integer); + procedure SetShowCategoryButtons(const Value: Boolean); + procedure SetVisible(Value: Boolean); + procedure ShowCustomizingForm; + procedure UpdateButtons(Sender: TObject); + protected + procedure AdjustControls; virtual; + function CanDrop(const P: TPoint): Boolean; virtual; + procedure CreateCategoryPanel; + procedure CreateCategoryRow; virtual; + procedure CreateControls; virtual; + procedure CreateCustomizingForm; + procedure FormClose(Sender: TObject; var Action: TCloseAction); virtual; + procedure FormShow(Sender: TObject); virtual; + procedure LookAndFeelChanged; virtual; + procedure ReleaseControls; + procedure SetControlParent(AControl, AParent: TWinControl); + function SizeDelta: TSize; virtual; + procedure ValidateListBox(AListBox: TcxVerticalGridItemsCustomizeListBox; AIndex: Integer); + procedure Update; virtual; + // IcxVerticalGridDesigner + procedure ComponentRemoved(Sender: TObject); virtual; + procedure Modified; virtual; + property CategoryListBox: TcxVerticalGridItemsCustomizeListBox read FCategoryListBox; + property CustomizingPos: TPoint read FLastPosition write FLastPosition; + property RowListBox: TcxVerticalGridItemsCustomizeListBox read FRowListBox; + property VerticalGrid: TcxCustomVerticalGrid read FVerticalGrid; + public + constructor Create(AOwner: TPersistent); override; + destructor Destroy; override; + procedure Assign(Source: TPersistent); override; + procedure MakeCategorySheetVisible; + procedure MakeRowSheetVisible; + property Form: TcxVerticalGridCustomizationForm read FForm; + property RowCount: Integer read FRowCount write SetRowCount default 10; + property ShowCategoryButtons: Boolean read FShowCategoryButtons write SetShowCategoryButtons; + property ShowCategoryTab: Boolean read FShowCategoryTab write FShowCategoryTab; + property Visible: Boolean read FVisible write SetVisible; + end; + +function GetTextAligmentFlags(AProperties: TcxCaptionRowProperties): Integer; overload; +function GetTextAligmentFlags(AHorz: TAlignment; AVert: TcxAlignmentVert): Integer; overload; +procedure cxVerticalGridError(const Msg: string); + +implementation + +uses +{$IFDEF DELPHI6} + Variants, Types, +{$ELSE} + MultiMon, +{$ENDIF} + dxUxTheme, dxThemeManager, dxThemeConsts, + cxVGridConsts, cxVGridViewInfo, cxGeometry, cxVGridNewCategory, + cxFilterControlDialog, cxDataUtils, cxEditUtils, cxDrawTextUtils, cxContainer, + cxTextEdit, cxLibraryConsts; + +{$R cxInsCur.res} + +const + cxvgScrollDelta = 32; + + // Cursors + cxInspectorInsertCursor = 'CXVG_INSERT'; + cxInspectorAddChildCursor = 'CXVG_ADDCHILD'; + cxInspectorAddCursor = 'CXVG_ADD'; + cxInspectorHideCursor = 'CXVG_HIDE'; + cxInspectorNoDragCursor = 'CXVG_NODRAG'; + +type + TControlAccess = class(TControl); + TcxEditingControllerAccess = class(TcxEditingController); + TcxHotTrackControllerAccess = class(TcxHotTrackController); + +const + HorzAlignment: array[TAlignment] of Integer = (CXTO_LEFT, CXTO_RIGHT, CXTO_CENTER_HORIZONTALLY); + VertAlignment: array[TcxAlignmentVert] of Integer = (CXTO_TOP, CXTO_BOTTOM, CXTO_CENTER_VERTICALLY); + +function GetTextAligmentFlags(AProperties: TcxCaptionRowProperties): Integer; overload; +begin + Result := HorzAlignment[AProperties.HeaderAlignmentHorz] or + VertAlignment[AProperties.HeaderAlignmentVert]; +end; + +function GetTextAligmentFlags(AHorz: TAlignment; + AVert: TcxAlignmentVert): Integer; overload; +begin + Result := HorzAlignment[AHorz] or VertAlignment[AVert]; +end; + +procedure cxVerticalGridError(const Msg: string); +begin + raise EcxVerticalGridError.Create(Msg); +end; + +{ TcxvgOptionsBehavior } + +constructor TcxvgOptionsBehavior.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FBandSizing := True; + FHeaderSizing := True; + FRowTracking := True; + CellHints := True; +end; + +procedure TcxvgOptionsBehavior.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxvgOptionsBehavior then + with TcxvgOptionsBehavior(Source) do + begin + Self.BandSizing := BandSizing; + Self.HeaderSizing := HeaderSizing; + Self.RowSizing := RowSizing; + Self.RowTracking := RowTracking; + end; +end; + +procedure TcxvgOptionsBehavior.RestoreDefaults; +begin + FAlwaysShowEditorAssigned := False; +end; + +procedure TcxvgOptionsBehavior.InternalSetAlwaysShowEditor(Value: Boolean); +begin + inherited AlwaysShowEditor := Value; +end; + +function TcxvgOptionsBehavior.GetAlwaysShowEditor: Boolean; +begin + if FAlwaysShowEditorAssigned then + Result := inherited AlwaysShowEditor + else + Result := TcxCustomVerticalGrid(EditingControl).OptionsView.PaintStyle = psDelphi; +end; + +procedure TcxvgOptionsBehavior.SetAlwaysShowEditor(Value: Boolean); +begin + FAlwaysShowEditorAssigned := True; + InternalSetAlwaysShowEditor(Value); +end; + +{ TcxvgMultiRecordsOptionsBehavior } + +constructor TcxvgMultiRecordsOptionsBehavior.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FallowChangeRecord := True; +end; + +procedure TcxvgMultiRecordsOptionsBehavior.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxvgMultiRecordsOptionsBehavior then + AllowChangeRecord := TcxvgMultiRecordsOptionsBehavior(Source).AllowChangeRecord; +end; + +function TcxvgMultiRecordsOptionsBehavior.GetIncSearchItem: TcxCustomEditorRow; +var + AItem: TcxCellEdit; +begin + AItem := TcxCellEdit(inherited IncSearchItem); + if AItem <> nil then + Result := TcxCustomEditorRow(AItem.Row) + else + Result := nil; +end; + +procedure TcxvgMultiRecordsOptionsBehavior.SetAllowChangeRecord(Value: Boolean); +begin + if FAllowChangeRecord <> Value then + begin + FAllowChangeRecord := Value; + EditingControl.LayoutChanged; + end; +end; + +procedure TcxvgMultiRecordsOptionsBehavior.SetIncSearchItem( + Value: TcxCustomEditorRow); +begin + if Value <> nil then + inherited IncSearchItem := TcxCustomEditorRowProperties(Value.FProperties).EditContainer + else + inherited IncSearchItem := nil; +end; + +{ TcxvgMultiRecordsOptionsData } + +constructor TcxvgMultiRecordsOptionsData.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FAppending := True; + FDeletingConfirmation := True; + FDeleting := True; + FInserting := True; +end; + +procedure TcxvgMultiRecordsOptionsData.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxvgMultiRecordsOptionsData then + with TcxvgMultiRecordsOptionsData(Source) do + begin + Self.Appending := Appending; + Self.Deleting := Deleting; + Self.DeletingConfirmation := DeletingConfirmation; + Self.Inserting := Inserting; + end; +end; + +procedure TcxvgMultiRecordsOptionsData.Changed; +begin + if EditingControl is TcxVirtualVerticalGrid then + TcxVirtualVerticalGrid(EditingControl).RefreshNavigators; +end; + +procedure TcxvgMultiRecordsOptionsData.SetAppending(Value: Boolean); +begin + if FAppending <> Value then + begin + FAppending := Value; + Changed; + end; +end; + +procedure TcxvgMultiRecordsOptionsData.SetDeleting(Value: Boolean); +begin + if FDeleting <> Value then + begin + FDeleting := Value; + Changed; + end; +end; + +procedure TcxvgMultiRecordsOptionsData.SetInserting(Value: Boolean); +begin + if FInserting <> Value then + begin + FInserting := Value; + Changed; + end; +end; + +{ TcxvgOptionsView } + +constructor TcxvgOptionsView.Create(AOwner: TPersistent); +begin + inherited Create(AOwner); + FAutoScaleBands := True; + FGridLineColor := clBtnShadow; + FBandsInterval := 2; + FRowHeaderMinWidth := 24; + FRowHeaderWidth := 100; + FRowHeight := -1; + FShowButtons := True; + FShowHeaders := True; + FGridLines := vglBoth; + FValueMinWidth := 40; + FValueWidth := 100; +end; + +procedure TcxvgOptionsView.Assign(Source: TPersistent); +begin + if Source is TcxvgOptionsView then + begin + EditingControl.BeginUpdate; + try + inherited Assign(Source); + with TcxvgOptionsView(Source) do + begin + Self.PaintStyle := PaintStyle; + Self.FGridLineColor := FGridLineColor; + Self.FGridLineColorAssigned := FGridLineColorAssigned; + Self.FRowHeaderMinWidth := RowHeaderMinWidth; + Self.FRowHeight := FRowHeight; + Self.FValueMinWidth := ValueMinWidth; + Self.FValueWidth := ValueWidth; + Self.FRowHeaderWidth := RowHeaderWidth; + Self.BandsInterval := BandsInterval; + Self.CategoryExplorerStyle := CategoryExplorerStyle; + Self.ShowButtons := ShowButtons; + Self.ShowEmptyRowImage := ShowEmptyRowImage; + Self.ShowHeaders := ShowHeaders; + Self.GridLines := GridLines; + Self.AutoScaleBands := AutoScaleBands; + end; + with TcxCustomVerticalGrid(EditingControl).ViewInfo do + begin + FViewBandWidth := 0; + FViewHeaderWidth := 0; + FViewValueWidth := 0; + end; + finally + EditingControl.EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxvgOptionsView.RestoreDefaults; +begin + FGridLineColorAssigned := False; + FRowHeight := -1; + FBandsInterval := 2; + Changed; +end; + +procedure TcxvgOptionsView.Changed; +begin + TcxCustomVerticalGrid(EditingControl).CheckGridModeBufferCount; + inherited Changed; +end; + +procedure TcxvgOptionsView.CheckRowHeaderWidth; +begin + RowHeaderWidth := RowHeaderWidth; +end; + +function TcxvgOptionsView.GetGridLineColor: TColor; +const + Colors: array[TcxvgPaintStyle] of TColor = (clBtnFace, clBtnShadow); +begin + if FGridLineColorAssigned then + Result := FGridLineColor + else + Result := Colors[FPaintStyle]; +end; + +procedure TcxvgOptionsView.SetAutoScaleBands(Value: Boolean); +begin + if FAutoScaleBands <> Value then + begin + FAutoScaleBands := Value; + if Value then + with TcxCustomVerticalGrid(EditingControl) do + if Controller <> nil then + Controller.Scroller.ScrollStrategy.SetTopVisibleRowIndex(0); + Changed; + end; +end; + +procedure TcxvgOptionsView.SetShowButtons(Value: Boolean); +begin + if FShowButtons <> Value then + begin + FShowButtons := Value; + Changed; + end; +end; + +procedure TcxvgOptionsView.SetBandsInterval(Value: Integer); +begin + if Value < 0 then Value := 0; + if FBandsInterval <> Value then + begin + FBandsInterval := Value; + Changed; + end; +end; + +procedure TcxvgOptionsView.SetCategoryExplorerStyle(Value: Boolean); +begin + if FCategoryExplorerStyle <> Value then + begin + FCategoryExplorerStyle := Value; + Changed; + end; +end; + +procedure TcxvgOptionsView.SetGridLineColor(Value: TColor); +begin + FGridLineColorAssigned := True; + FGridLineColor := Value; + Changed; +end; + +procedure TcxvgOptionsView.SetPaintStyle(Value: TcxvgPaintStyle); +begin + if FPaintStyle <> Value then + begin + FPaintStyle := Value; + with TcxCustomVerticalGrid(EditingControl) do + begin + if ViewInfo <> nil then RecreateViewInfo; + if Controller <> nil then Controller.UpdatePaintStyle; + CheckRowHeaderWidth; + end; + Changed; + end; +end; + +procedure TcxvgOptionsView.SetRowHeaderMinWidth(Value: Integer); +begin + if Value < 0 then Value := 0; + if FRowHeaderMinWidth <> Value then + begin + FRowHeaderMinWidth := Value; + RowHeaderWidth := RowHeaderWidth; + end; +end; + +procedure TcxvgOptionsView.SetRowHeaderWidth(Value: Integer); +begin + with TcxCustomVerticalGrid(EditingControl) do + if ViewInfo <> nil then + begin + Value := Max(ViewInfo.GetViewMinHeaderWidth, Value); + if not IsLoading then ViewInfo.CheckMaxRowHeaderWidth(Value, Max(FValueMinWidth, 4)); + end; + if Value < FRowHeaderMinWidth then Value := FRowHeaderMinWidth; + if FRowHeaderWidth <> Value then + begin + FRowHeaderWidth := Value; + Changed; + end; +end; + +procedure TcxvgOptionsView.SetRowHeight(Value: Integer); +begin + if Value < -1 then Value := -1; + if FRowHeight <> Value then + begin + FRowHeight := Value; + Changed; + end; +end; + +procedure TcxvgOptionsView.SetShowEmptyRowImage(Value: Boolean); +begin + if FShowEmptyRowImage <> Value then + begin + FShowEmptyRowImage := Value; + Changed; + end; +end; + +procedure TcxvgOptionsView.SetShowHeaders(Value: Boolean); +begin + if FShowHeaders <> Value then + begin + FShowHeaders := Value; + Changed; + end; +end; + +procedure TcxvgOptionsView.SetGridLines(Value: TcxvgGridLines); +begin + if FGridLines <> Value then + begin + FGridLines := Value; + Changed; + end; +end; + +procedure TcxvgOptionsView.SetValueMinWidth(Value: Integer); +begin + Value := Max(cxvgMinValueWidth, Value); + if FValueMinWidth <> Value then + begin + FValueMinWidth := Value; + ValueWidth := ValueWidth; + end; +end; + +procedure TcxvgOptionsView.SetValueWidth(Value: Integer); +begin + if Value < FValueMinWidth then Value := FValueMinWidth; + if FValueWidth <> Value then + begin + FValueWidth := Value; + Changed; + end; +end; + +{ TcxvgMultiRecordsOptionsView } + +procedure TcxvgMultiRecordsOptionsView.Assign(Source: TPersistent); +begin + if Source is TcxvgMultiRecordsOptionsView then + begin + EditingControl.BeginUpdate; + try + FRecordsInterval := TcxvgMultiRecordsOptionsView(Source).RecordsInterval; + inherited Assign(Source); + finally + EditingControl.EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +procedure TcxvgMultiRecordsOptionsView.RestoreDefaults; +begin + FRecordsInterval := 0; + inherited RestoreDefaults; +end; + +procedure TcxvgMultiRecordsOptionsView.SetRecordsInterval(Value: Integer); +begin + if Value < 0 then Value := 0; + if FRecordsInterval <> Value then + begin + FRecordsInterval := Value; + Changed; + end; +end; + +{ TcxCustomRowProperties } + +constructor TcxCustomRowProperties.Create(Collection: TCollection); +begin + if Collection <> nil then + FRow := TcxEditorPropertiesCollection(Collection).Row; + FCollection := Collection; + CreateEx(FRow); +end; + +constructor TcxCustomRowProperties.CreateEx(ARow: TcxCustomRow); +begin + FRow := ARow; + inherited Create(FCollection); +end; + +procedure TcxCustomRowProperties.Changed; +begin + if FCollection <> nil then + inherited Changed(True) + else + if Row.Visible then Row.Changed; +end; + +function TcxCustomRowProperties.GetOwner: TPersistent; +begin + Result := FRow; +end; + +{ TcxCaptionRowProperties } + +constructor TcxCaptionRowProperties.CreateEx(ARow: TcxCustomRow); +begin + inherited CreateEx(ARow); + FHeaderAlignmentHorz := taLeftJustify; + FHeaderAlignmentVert := vaTop; + FImageIndex := -1; +end; + +function TcxCaptionRowProperties.DefaultCaption: string; +begin + Result := ''; +end; + +procedure TcxCaptionRowProperties.RestoreDefaults; +begin + FIsCaptionAssigned := False; + Row.Changed; +end; + +function TcxCaptionRowProperties.GetCaption: TCaption; +begin + if FIsCaptionAssigned then + Result := FCaption + else + Result := DefaultCaption; +end; + +function TcxCaptionRowProperties.IsCaptionStored: Boolean; +begin + Result := FIsCaptionAssigned and (FCaption <> DefaultCaption); +end; + +procedure TcxCaptionRowProperties.SetCaption( + const Value: TCaption); +begin + if FIsCaptionAssigned and (Value = FCaption) then Exit; + FCaption := Value; + FIsCaptionAssigned := True; + Changed; +end; + +procedure TcxCaptionRowProperties.SetHeaderAlignmentHorz( + const Value: TAlignment); +begin + if HeaderAlignmentHorz <> Value then + begin + FHeaderAlignmentHorz := Value; + Changed; + end; +end; + +procedure TcxCaptionRowProperties.SetHeaderAlignmentVert( + const Value: TcxAlignmentVert); +begin + if HeaderAlignmentVert <> Value then + begin + FHeaderAlignmentVert := Value; + Changed; + end; +end; + +procedure TcxCaptionRowProperties.SetImageIndex( + const Value: TImageIndex); +begin + if FImageIndex <> Value then + begin + FImageIndex := Value; + Changed; + end; +end; + +procedure TcxCaptionRowProperties.Assign(Source: TPersistent); +begin + if Source is TcxCaptionRowProperties then + begin + Row.OwnerRows.BeginUpdate; + try + with TcxCaptionRowProperties(Source) do + begin + Self.FCaption := FCaption; + Self.FIsCaptionAssigned := FIsCaptionAssigned; + Self.FImageIndex := FImageIndex; + Self.FHeaderAlignmentHorz := FHeaderAlignmentHorz; + Self.FHeaderAlignmentVert := FHeaderAlignmentVert; + Self.FHint := FHint; + end; + finally + Row.OwnerRows.EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +{ TcxRowOptions } + +constructor TcxRowOptions.Create(ARow: TcxCustomRow); +begin + FRow := ARow; + FCanAutoHeight := True; + FCanMovedToCustomizationForm := True; + FCanResized := True; + FFocusing := True; + FMoving := True; + FShowExpandButton := True; + FShowInCustomizationForm := True; + FTabStop := True; +end; + +procedure TcxRowOptions.Assign(Source: TPersistent); +begin + if Source is TcxRowOptions then + with TcxRowOptions(Source) do + begin + Self.FCanAutoHeight := CanAutoHeight; + Self.FCanMovedToCustomizationForm := CanMovedToCustomizationForm; + Self.FCanResized := CanResized; + Self.FFocusing := Focusing; + Self.FMoving := Moving; + Self.FShowExpandButton := ShowExpandButton; + Self.FShowInCustomizationForm := ShowInCustomizationForm; + Self.FTabStop := TabStop; + Self.Changed; + end + else + inherited Assign(Source); +end; + +procedure TcxRowOptions.RestoreDefaults; +begin + FCanAutoHeight := True; + FCanMovedToCustomizationForm := True; + FCanResized := True; + FFocusing := True; + FMoving := True; + FShowExpandButton := True; + FShowInCustomizationForm := True; + FTabStop := True; + Changed; +end; + +procedure TcxRowOptions.Changed; +begin + FRow.Changed; +end; + +procedure TcxRowOptions.SetCanAutoHeight(Value: Boolean); +begin + if FCanAutoHeight <> Value then + begin + FCanAutoHeight := Value; + Changed; + end; +end; + +procedure TcxRowOptions.SetFocusing(Value: Boolean); +begin + if FFocusing <> Value then + begin + FFocusing := Value; + Changed; + end; +end; + +procedure TcxRowOptions.SetShowExpandButton(Value: Boolean); +begin + if FShowExpandButton <> Value then + begin + FShowExpandButton := Value; + Changed; + end; +end; + +procedure TcxRowOptions.SetShowInCustomizationForm(Value: Boolean); +begin + if FShowInCustomizationForm <> Value then + begin + FShowInCustomizationForm := Value; + Changed; + end; +end; + +{ TcxRowList } + +constructor TcxRowList.Create(AOwner: TcxCustomRow); +begin + inherited Create; + FOwner := AOwner; +end; + +procedure TcxRowList.Notify(Ptr: Pointer; Action: TListNotification); +begin + if (Action in [lnAdded, lnDeleted]) and not (csDestroying in Owner.ComponentState) then + UpdateIndexes; +end; + +procedure TcxRowList.UpdateIndexes; +var + I: Integer; +begin + for I := 0 to Count - 1 do + TcxCustomRow(Items[I]).FIndex := I; +end; + +{ TcxCustomRow } + +constructor TcxCustomRow.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FIndex := -1; + FExpanded := True; + FVisible := True; + FHeight := -1; + FStyles := GetStylesClass.Create(Self); + FProperties := GetPropertiesClass.CreateEx(Self); + FOptions := GetOptionsClass.Create(Self); + FVisibleIndex := -1; +end; + +destructor TcxCustomRow.Destroy; +begin + VerticalGrid.RemoveRowFromVerticalGrid(Self); + FreeAndNil(FViewInfo); + FreeAndNil(FStyles); + FreeAndNil(FProperties); + FreeAndNil(FOptions); + inherited Destroy; +end; + +procedure TcxCustomRow.Assign(Source: TPersistent); +begin + if Source is TcxCustomRow then + with TcxCustomRow(Source) do + begin + Self.FHeight := FHeight; //need a direct assign + Self.FVisible := FVisible; + Self.FExpanded := FExpanded; + Self.FProperties.Assign(FProperties); + Self.Styles.Assign(Styles); + end + else + inherited Assign(Source); +end; + +function TcxCustomRow.GetParentComponent: TComponent; +begin + if FParent = nil then Result := VerticalGrid else Result := FParent; +end; + +function TcxCustomRow.HasParent: Boolean; +begin + Result := True; +end; + +procedure TcxCustomRow.Collapse(ARecurse: Boolean); +var + I: Integer; +begin + if HasChildren then + begin + OwnerRows.BeginUpdate; + try + FExpanded := False; + if ARecurse then + for I := 0 to Count - 1 do + Rows[I].Collapse(ARecurse); + finally + OwnerRows.EndUpdate; + end + end + else FExpanded := False; +end; + +procedure TcxCustomRow.Expand(ARecurse: Boolean); +var + I: Integer; +begin + if HasChildren then + begin + OwnerRows.BeginUpdate; + try + FExpanded := True; + if ARecurse then + for I := 0 to Count - 1 do + Rows[I].Expand(ARecurse); + finally + OwnerRows.EndUpdate; + end; + end + else FExpanded := True; +end; + +function TcxCustomRow.GetFirstVisibleChild: TcxCustomRow; +var + I: Integer; +begin + Result := nil; + for I := 0 to Count - 1 do + if Rows[I].Visible then + begin + Result := Rows[I]; + break; + end; +end; + +function TcxCustomRow.GetLastVisibleChild: TcxCustomRow; +var + I: Integer; + ARow: TcxCustomRow; +begin + Result := nil; + for I := Count - 1 downto 0 do + begin + ARow := Rows[I]; + if ARow.Visible then + begin + if ARow.Expanded then ARow := ARow.GetLastVisibleChild; + if ARow <> nil then Result := ARow else Result := Rows[I]; + break; + end; + end; +end; + +function TcxCustomRow.HasChildren: Boolean; +begin + Result := Count > 0; +end; + +function TcxCustomRow.HasVisibleChildren: Boolean; +var + I: Integer; +begin + Result := False; + for I := 0 to Count - 1 do + if Rows[I].Visible then + begin + Result := True; + break; + end; +end; + +function TcxCustomRow.IndexOf(ARow: TcxCustomRow): Integer; +begin + Result := -1; + if FRows <> nil then Result := FRows.IndexOf(ARow); +end; + +function TcxCustomRow.IsChild(ARow: TcxCustomRow): Boolean; +begin + Result := (ARow <> nil) and ARow.IsParent(Self) +end; + +function TcxCustomRow.IsFirst: Boolean; +begin + Result := Index = 0; +end; + +function TcxCustomRow.IsFirstVisible: Boolean; +begin + Result := Self = FParent.GetFirstVisibleChild; +end; + +function TcxCustomRow.IsLast: Boolean; +begin + Result := Index = FParent.Count - 1; +end; + +function TcxCustomRow.IsLastVisible: Boolean; +var + I: Integer; + ARow: TcxCustomRow; +begin + Result := False; + with FParent do + for I := Count - 1 downto 0 do + begin + ARow := Rows[I]; + if ARow.Visible then + if ARow = Self then + begin + Result := True; + break; + end + else + break + end; +end; + +function TcxCustomRow.IsRootLevel: Boolean; +begin + Result := FParent = VerticalGrid.RootRow; +end; + +function TcxCustomRow.IsParent(ARow: TcxCustomRow): Boolean; +begin + Result := False; + while ARow <> nil do + begin + if ARow.FParent = Self then + begin + Result := True; + break; + end; + ARow := ARow.FParent; + end; +end; + +procedure TcxCustomRow.MakeVisible; +begin + VerticalGrid.Controller.MakeRowVisible(Self); +end; + +procedure TcxCustomRow.RestoreDefaults; +begin + FHeight := -1; + Options.RestoreDefaults; // indirect call the row's changed method +end; + +function TcxCustomRow.GetObjectName: string; +begin + if VerticalGrid.FNewLoadMode then + begin + Result := Name; + if Result = '' then + Result := IntToStr(FID); + end + else + Result := IntToStr(FID); +end; + +procedure TcxCustomRow.GetPropertyValue(const AName: string; var AValue: Variant); +begin + if AName = 'Visible' then + AValue := Visible + else + if AName = 'Height' then + AValue := Height + else + if AName = 'Expanded' then + AValue := Expanded + else + if AName = 'AParentID' then + begin + if VerticalGrid.FNewLoadMode then + AValue := FParent.GetObjectName + else + AValue := FParent.ID; + end + else + if AName = 'Index' then + AValue := Index + else + AValue := Null; +end; + +function TcxCustomRow.GetStoredProperties(AProperties: TStrings): Boolean; +begin + with AProperties do + begin + Add('AParentID'); + Add('Index'); + Add('Visible'); + Add('Height'); + Add('Expanded'); + end; + Result := True; +end; + +procedure TcxCustomRow.SetPropertyValue(const AName: string; const AValue: Variant); +begin + if AName = 'Visible' then + Visible := AValue + else + if AName = 'Height' then + Height := AValue + else + if AName = 'Expanded' then + Expanded := AValue + else + if AName = 'AParentID' then + begin + if VerticalGrid.FNewLoadMode then + FLoadingParent := AValue + else + Parent := OwnerRows.FindRowByID(AValue); + end + else + if AName = 'Index' then + if VerticalGrid.FNewLoadMode then + FLoadingIndex := AValue + else + Index := AValue; +end; + +procedure TcxCustomRow.GetChildren(Proc: TGetChildProc; Root: TComponent); +var + I: Integer; +begin + for I := 0 to Count - 1 do Proc(Rows[I]) +end; + +procedure TcxCustomRow.SetName(const NewName: TComponentName); +begin + inherited SetName(NewName); + if not (csLoading in ComponentState) then + Changed; +end; + +procedure TcxCustomRow.SetParentComponent(Value: TComponent); +begin + if FParent <> nil then FParent.Remove(Self); + if Value <> nil then + if Value is TcxCustomVerticalGrid then + TcxCustomVerticalGrid(Value).FRootRow.Add(Self) + else + if Value is TcxCustomRow then + TcxCustomRow(Value).Add(Self); +end; + +procedure TcxCustomRow.Add(ARow: TcxCustomRow); +begin + Insert(GetCount, ARow); +end; + +function TcxCustomRow.CanFocus: Boolean; +begin + Result := Options.Focusing; +end; + +procedure TcxCustomRow.Changed(ARebuild: Boolean = False); +begin + if OwnerRows <> nil then + OwnerRows.Changed(ARebuild); +end; + +procedure TcxCustomRow.Delete(AIndex: Integer); +var + ARow: TcxCustomRow; +begin + if (AIndex < 0) or (FRows = nil) or (AIndex >= GetCount) then + cxVerticalGridError(cxSvgIndexError); + ARow := FRows[AIndex]; + FRows.Delete(AIndex); + ARow.FParent := nil; + ResetOwnerCount; +end; + +function TcxCustomRow.GetDefaultHeight: Integer; +begin + with VerticalGrid do + Result := Max(OptionsView.RowHeight, + cxScreenCanvas.FontHeight(Styles.GetHeaderParams(Self).Font) + cxTextOffset); +end; + +function TcxCustomRow.GetEditContainer(ACellIndex: Integer): TcxCellEdit; +begin + Result := nil; +end; + +function TcxCustomRow.GetEditContainerCount: Integer; +begin + Result := 0; +end; + +function TcxCustomRow.GetPropertiesClass: TcxRowPropertiesClass; +begin + Result := TcxCaptionRowProperties; +end; + +function TcxCustomRow.GetRealHeight: Integer; +begin + Result := Max(FHeight, GetDefaultHeight); +end; + +function TcxCustomRow.GetOptionsClass: TcxRowOptionsClass; +begin + Result := TcxRowOptions; +end; + +function TcxCustomRow.GetStylesClass: TcxvgCustomRowStylesClass; +begin + Result := TcxvgCustomRowStyles; +end; + +procedure TcxCustomRow.Insert(AIndex: Integer; ARow: TcxCustomRow); +begin + if FRows = nil then + FRows := TcxRowList.Create(Self); + ARow.FParent := Self; + ARow.SetVerticalGrid(VerticalGrid); + FRows.Insert(AIndex, ARow); + ResetOwnerCount; +end; + +function TcxCustomRow.IsHeightAssigned: Boolean; +begin + Result := FHeight >= 0; +end; + +procedure TcxCustomRow.Remove(ARow: TcxCustomRow); +begin + Delete(IndexOf(ARow)); +end; + +procedure TcxCustomRow.RemoveAll; +begin + while Count > 0 do Rows[0].Free; + FreeAndNil(FRows); + ResetOwnerCount; +end; + +procedure TcxCustomRow.RemoveChildren; +begin + if (FParent <> nil) then + begin + FParent.Remove(Self); + FParent := nil; + end; + RemoveAll; +end; + +procedure TcxCustomRow.ResetOwnerCount; +begin + OwnerRows.FCount := -1; +end; + +procedure TcxCustomRow.SetVerticalGrid(Value: TcxCustomVerticalGrid); +begin + if FVerticalGrid <> Value then + begin + FVerticalGrid := Value; + if Value <> nil then + FID := Value.Rows.GetNextID; + end; +end; + +function TcxCustomRow.GetAbsoluteIndex: Integer; +begin + Result := OwnerRows.IndexOf(Self); +end; + +function TcxCustomRow.GetCount: Integer; +begin + if FRows = nil then Result := 0 else Result := FRows.Count; +end; + +function TcxCustomRow.GetFocused: Boolean; +begin + Result := VerticalGrid.FocusedRow = Self; +end; + +function TcxCustomRow.GetLevel: Integer; +var + P: TcxCustomRow; +begin + Result := 0; + P := FParent; + while (P <> nil) and (P <> VerticalGrid.RootRow) do + begin + P := P.FParent; + Inc(Result); + end; +end; + +function TcxCustomRow.GetOwnerRows: TcxVerticalGridRows; +begin + Result := FVerticalGrid.Rows; +end; + +function TcxCustomRow.GetParent: TcxCustomRow; +begin + if FParent = FVerticalGrid.FRootRow then + Result := nil + else + Result := FParent; +end; + +function TcxCustomRow.GetRow(Index: Integer): TcxCustomRow; +begin + if FRows = nil then + cxVerticalGridError(cxSvgIndexError); + Result := FRows[Index]; +end; + +function TcxCustomRow.GetViewInfo: TcxCustomRowViewInfo; +begin + if FViewInfo = nil then FViewInfo := CreateViewInfo; + Result := FViewInfo; +end; + +procedure TcxCustomRow.SetExpanded(Value: Boolean); +begin + if FExpanded <> Value then + begin + FExpanded := Value; + Changed(HasChildren); + end; +end; + +procedure TcxCustomRow.SetFocused(Value: Boolean); +begin + if Value <> Focused then + if Value then + VerticalGrid.FocusedRow := Self + else + VerticalGrid.FocusedRow := nil; +end; + +procedure TcxCustomRow.SetHeight(Value: Integer); +begin + if Value < -1 then Value := -1; + if FHeight <> Value then + begin + FHeight := Value; + Changed; + end; +end; + +procedure TcxCustomRow.SetIndex(Value: Integer); +var + AIndex: Integer; +begin + if (FParent <> nil) and (Value >= 0) and (Value < FParent.GetCount) then + begin + AIndex := Index; + if Value <> AIndex then + begin + FParent.FRows.Move(AIndex, Value); + FParent.FRows.UpdateIndexes; + Changed(True); + end; + end; +end; + +procedure TcxCustomRow.SetOptions(Value: TcxRowOptions); +begin + FOptions.Assign(Value); +end; + +procedure TcxCustomRow.SetParent(Value: TcxCustomRow); +begin + if Value = Self then Exit; + if Value = nil then + Value := FVerticalGrid.FRootRow; + if FParent <> Value then + begin + if FParent <> nil then + FParent.Remove(Self); + FParent := Value; + FParent.Add(Self); + Changed(True); + end; +end; + +procedure TcxCustomRow.SetVisible(Value: Boolean); +begin + if FVisible <> Value then + begin + FVisible := Value; + Changed(True); + end; +end; + +{ TcxCategoryRow } + +function TcxCategoryRow.CreateHeaderInfo: TcxCustomRowHeaderInfo; +begin + Result := TcxCategoryRowHeaderInfo.Create(Self); +end; + +function TcxCategoryRow.CreateViewInfo: TcxCustomRowViewInfo; +begin + Result := TcxCategoryRowViewInfo.Create(Self); +end; + +function TcxCategoryRow.GetStoredProperties(AProperties: TStrings): Boolean; +begin + AProperties.Add('Caption'); + Result := inherited GetStoredProperties(AProperties); +end; + +procedure TcxCategoryRow.GetPropertyValue(const AName: string; + var AValue: Variant); +begin + if AName = 'Caption' then + AValue := Properties.Caption + else + inherited GetPropertyValue(AName, AValue); +end; + +procedure TcxCategoryRow.SetPropertyValue(const AName: string; + const AValue: Variant); +begin + if (AName = 'Caption') and not VarIsEmpty(AValue) then + Properties.Caption := AValue + else + inherited SetPropertyValue(AName, AValue); +end; + +function TcxCategoryRow.GetDefaultHeight: Integer; +begin + with VerticalGrid do + begin + Result := Max(OptionsView.RowHeight, + cxScreenCanvas.FontHeight(Styles.GetCategoryParams(Self).Font) + cxTextOffset * 2); + if ViewInfo.UseCategoryExplorerStyle and (LookAndFeel.SkinPainter = nil) then + Result := Max(Result, ViewInfo.ExplorerButtonSize.cy + 2); + end; +end; + +function TcxCategoryRow.GetStylesClass: TcxvgCustomRowStylesClass; +begin + Result := TcxCategoryRowStyles; +end; + +function TcxCategoryRow.GetProperties: TcxCaptionRowProperties; +begin + Result := TcxCaptionRowProperties(FProperties); +end; + +function TcxCategoryRow.GetStyles: TcxCategoryRowStyles; +begin + Result := TcxCategoryRowStyles(FStyles); +end; + +procedure TcxCategoryRow.SetProperties(Value: TcxCaptionRowProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCategoryRow.SetStyles(Value: TcxCategoryRowStyles); +begin + FStyles.Assign(Value); + Changed; +end; + +{ TcxCellEdit } + +constructor TcxCellEdit.Create(AOwner: TComponent); +begin + FRow := TcxCustomRow(AOwner); + inherited Create(AOwner); +end; + +procedure TcxCellEdit.Calculate(ACellViewInfo: TcxRowValueInfo); +begin + FCalculating := True; + try + InitEditViewInfo(ACellViewInfo); + CalculateEditViewInfo(ACellViewInfo.CellValue, ACellViewInfo, cxInvalidPoint); + finally + FCalculating := False; + end; +end; + +function TcxCellEdit.CanEdit: Boolean; +begin + Result := CanFocus and + TcxCustomVerticalGrid(EditingControl).OptionsData.Editing and + TcxEditorRowPropertiesOptions(Options).Editing and + (dceoShowEdit in DataController.EditOperations); +end; + +function TcxCellEdit.CanFocus: Boolean; +begin + Result := Row.Options.Focusing and inherited CanFocus; +end; + +function TcxCellEdit.CanInitEditing: Boolean; +begin + with TcxCustomVerticalGrid(EditingControl) do + begin + Result := inherited CanInitEditing and ((DragAndDropState = ddsNone) or + ((DragMode <> dmAutomatic) or not HitTest.HitAtValue)); + end; +end; + +function TcxCellEdit.CanTabStop: Boolean; +begin + Result := Row.Options.TabStop and inherited CanTabStop; +end; + +procedure TcxCellEdit.DoGetDisplayText(ARecordIndex: Integer; var AText: string); +begin + EditRowProperties.DoGetDisplayTextEvent(ARecordIndex, AText); +end; + +function TcxCellEdit.DoGetPropertiesFromEvent(AEvent: TcxGetEditPropertiesEvent; + AData: Pointer; AProperties: TcxCustomEditProperties): TcxCustomEditProperties; +begin + Result := AProperties; + if Assigned(AEvent) then + begin + AEvent(FEditRowProperties, AData, Result); + if Result = nil then + Result := AProperties; + end; + InitProperties(Result); +end; + +function TcxCellEdit.GetCurrentValue: Variant; +begin + with DataController do + if RowCount = 0 then + Value := Null + else + Result := Values[FilteredRecordIndex[FocusedRowIndex], ItemIndex]; +end; + +function TcxCellEdit.GetDataBindingClass: TcxItemDataBindingClass; +begin + Result := TcxItemDataBinding; +end; + +function TcxCellEdit.GetDisplayValue(AProperties: TcxCustomEditProperties; + ARecordIndex: Integer): Variant; +begin + with DataController do + begin + if RowCount = 0 then + Result := '' + else + if AProperties.GetEditValueSource(False) = evsValue then + Result := GetValue(FilteredRecordIndex[ARecordIndex], ItemIndex) + else + Result := GetDisplayText(FilteredRecordIndex[ARecordIndex], ItemIndex); + end; +end; + +function TcxCellEdit.GetEditValue: Variant; +begin + if Editing then + begin + if DataController.RowCount = 0 then + Result := Null + else + Result := DataController.GetEditValue(ItemIndex, EditValueSource); + end + else + Result := Unassigned; +end; + +function TcxCellEdit.GetOptionsClass: TcxCustomEditContainerItemOptionsClass; +begin + if Row is TcxCustomMultiEditorRow then + Result := TcxMultiEditorRowPropertiesOptions + else + Result := TcxEditorRowPropertiesOptions; +end; + +function TcxCellEdit.GetValue(ARecordIndex: Integer): Variant; +begin + with DataController do + if RowCount = 0 then + Value := Null + else + Result := Values[FilteredRecordIndex[ARecordIndex], ItemIndex]; +end; + +function TcxCellEdit.GetValueCount: Integer; +begin + Result := DataController.RowCount; +end; + +function TcxCellEdit.HasDataTextHandler: Boolean; +begin + Result := Assigned(EditRowProperties.FOnGetDisplayText); +end; + +procedure TcxCellEdit.PropertiesChanged; +begin + if (ViewInfo <> nil) and not FCalculating then + begin + ViewInfo.ValuesInfo.Trunc(0); + inherited PropertiesChanged; + if not TcxCustomVerticalGrid(EditingControl).IsLocked then + begin + ViewInfo.ValidateViewInfo; + ViewInfo.CalcValuesInfo; + end; + end + else + inherited PropertiesChanged; +end; + +procedure TcxCellEdit.SetCurrentValue(const Value: Variant); +begin + with DataController do + if RowCount > 0 then + Values[FilteredRecordIndex[FocusedRowIndex], ItemIndex] := Value; +end; + +procedure TcxCellEdit.SetValue(ARecordIndex: Integer; const Value: Variant); +begin + with DataController do + if RowCount > 0 then + Values[FilteredRecordIndex[ARecordIndex], ItemIndex] := Value; +end; + +function TcxCellEdit.GetViewInfo: TcxCustomRowViewInfo; +begin + Result := FRow.ViewInfo; +end; + +{ TcxCustomEditorRowProperties } + +constructor TcxCustomEditorRowProperties.CreateEx(ARow: TcxCustomRow); +begin + //for the correct work with a collection + FEditContainer := GetInplaceEditContainerClass.Create(ARow); + FEditContainer.FEditRowProperties := Self; + inherited CreateEx(ARow); +end; + +destructor TcxCustomEditorRowProperties.Destroy; +begin + FreeAndNil(FEditContainer); + inherited Destroy; +end; + +procedure TcxCustomEditorRowProperties.Assign(Source: TPersistent); +begin + if Source is TcxCustomEditorRowProperties then + FEditContainer.Assign(TcxCustomEditorRowProperties(Source).FEditContainer); + inherited Assign(Source); +end; + +function TcxCustomEditorRowProperties.GetInplaceEditContainerClass: TcxCellEditClass; +begin + Result := TcxCellEdit; +end; + +procedure TcxCustomEditorRowProperties.DoGetDisplayTextEvent( + ARecordIndex: Integer; var Text: string); +begin + if Assigned(FOnGetDisplayText) then + FOnGetDisplayText(Self, ARecordIndex, Text); +end; + +function TcxCustomEditorRowProperties.GetDataBinding: TcxItemDataBinding; +begin + Result := TcxItemDataBinding(EditContainer.FDataBinding); +end; + +function TcxCustomEditorRowProperties.GetDisplayEditProperty( + Index: Integer): TcxCustomEditProperties; +begin + Result := FEditContainer.DoGetEditProperties(Pointer(Index)); +end; + +function TcxCustomEditorRowProperties.GetDisplayText(Index: Integer): string; +begin + with EditContainer do + Result := GetDisplayValue(DisplayEditProperties[Index], Index); + DoGetDisplayTextEvent(Index, Result); +end; + +function TcxCustomEditorRowProperties.GetEditViewData: TcxCustomEditViewData; +begin + Result := EditContainer.EditViewData; +end; + +function TcxCustomEditorRowProperties.GetEditProperties: TcxCustomEditProperties; +begin + Result := FEditContainer.Properties; +end; + +function TcxCustomEditorRowProperties.GetEditPropertiesClass: TcxCustomEditPropertiesClass; +begin + Result := FEditContainer.PropertiesClass; +end; + +function TcxCustomEditorRowProperties.GetEditPropertiesClassName: string; +begin + Result := FEditContainer.PropertiesClassName; +end; + +function TcxCustomEditorRowProperties.GetIEditorPropertiesContainer: IcxEditorPropertiesContainer; +begin + Supports(TObject(FEditContainer), IcxEditorPropertiesContainer, Result); +end; + +function TcxCustomEditorRowProperties.GetItemIndex: Integer; +begin + Result := FEditContainer.ItemIndex; +end; + +function TcxCustomEditorRowProperties.GetItemLink: TObject; +begin + Result := FEditContainer; +end; + +function TcxCustomEditorRowProperties.GetOptions: TcxEditorRowPropertiesOptions; +begin + Result := TcxEditorRowPropertiesOptions(FEditContainer.Options); +end; + +function TcxCustomEditorRowProperties.GetRepositoryItem: TcxEditRepositoryItem; +begin + Result := FEditContainer.RepositoryItem; +end; + +function TcxCustomEditorRowProperties.GetValue: Variant; +begin + Result := FEditContainer.Value; +end; + +function TcxCustomEditorRowProperties.GetValueByIndex(Index: Integer): Variant; +begin + Result := FEditContainer.Values[Index]; +end; + +procedure TcxCustomEditorRowProperties.SetDataBinding( + Value: TcxItemDataBinding); +begin + FEditContainer.FDataBinding.Assign(Value); +end; + +procedure TcxCustomEditorRowProperties.SetEditProperties( + Value: TcxCustomEditProperties); +begin + FEditContainer.Properties := Value; +end; + +procedure TcxCustomEditorRowProperties.SetEditPropertiesClass( + Value: TcxCustomEditPropertiesClass); +begin + FEditContainer.PropertiesClass := Value; +end; + +procedure TcxCustomEditorRowProperties.SetEditPropertiesClassName( + const Value: string); +begin + FEditContainer.PropertiesClassName := Value; +end; + +procedure TcxCustomEditorRowProperties.SetOptions( + Value: TcxEditorRowPropertiesOptions); +begin + FEditContainer.Options.Assign(Value); +end; + +procedure TcxCustomEditorRowProperties.SetRepositoryItem( + Value: TcxEditRepositoryItem); +begin + FEditContainer.RepositoryItem := Value; +end; + +procedure TcxCustomEditorRowProperties.SetValue(const Value: Variant); +begin + with FEditContainer.DataController do + begin + if (RowCount = 0) or (FocusedRowIndex < 0) then Exit; + if dceEdit in EditState then + SetEditValue(FEditContainer.ItemIndex, Value, evsValue) + else + Values[FilteredRecordIndex[FocusedRowIndex], FEditContainer.ItemIndex] := Value; + end; +end; + +function TcxCustomEditorRowProperties.GetOnGetEditingProperties: TcxVerticalGridGetEditPropertiesEvent; +begin + Result := TcxVerticalGridGetEditPropertiesEvent(EditContainer.OnGetEditingProperties); +end; + +function TcxCustomEditorRowProperties.GetOnGetEditProperties: TcxVerticalGridGetEditPropertiesEvent; +begin + Result := TcxVerticalGridGetEditPropertiesEvent(EditContainer.OnGetEditProperties); +end; + +procedure TcxCustomEditorRowProperties.SetOnGetEditProperties( + Value: TcxVerticalGridGetEditPropertiesEvent); +begin + EditContainer.OnGetEditProperties := TcxGetEditPropertiesEvent(Value); +end; + +procedure TcxCustomEditorRowProperties.SetOnGetEditingProperties( + Value: TcxVerticalGridGetEditPropertiesEvent); +begin + EditContainer.OnGetEditingProperties := TcxGetEditPropertiesEvent(Value); +end; + +{ TcxEditorRowProperties } + +procedure TcxEditorRowProperties.Assign(Source: TPersistent); +begin + if Source is TcxEditorRowProperties then + begin + inherited Assign(Source); + if not (Row.VerticalGrid is TcxVirtualVerticalGrid) then + Value := TcxEditorRowProperties(Source).Value; + end + else + inherited Assign(Source); +end; + +{ TcxCustomEditorRow } + +function TcxCustomEditorRow.CreateHeaderInfo: TcxCustomRowHeaderInfo; +begin + Result := TcxEditorRowHeaderInfo.Create(Self); +end; + +function TcxCustomEditorRow.CreateViewInfo: TcxCustomRowViewInfo; +begin + Result := TcxEditorRowViewInfo.Create(Self); +end; + +function TcxCustomEditorRow.CanFocus: Boolean; +begin + Result := Options.Focusing and Properties.Options.Focusing; +end; + +function TcxCustomEditorRow.EditContainer: TcxCellEdit; +begin + if FProperties <> nil then + Result := TcxCustomEditorRowProperties(FProperties).FEditContainer + else + Result := nil; +end; + +function TcxCustomEditorRow.GetDefaultHeight: Integer; +var + AFont: TFont; +begin + AFont := VerticalGrid.Styles.GetContentParams(Properties, False, -1).Font; + Result := Max(inherited GetDefaultHeight, EditContainer.GetEditDefaultHeight(AFont) + cxTextOffset); +end; + +function TcxCustomEditorRow.GetEditContainer( + ACellIndex: Integer): TcxCellEdit; +begin + Result := EditContainer; +end; + +function TcxCustomEditorRow.GetEditContainerCount: Integer; +begin + Result := 1; +end; + +function TcxCustomEditorRow.GetPropertiesClass: TcxRowPropertiesClass; +begin + Result := TcxCustomEditorRowProperties; +end; + +function TcxCustomEditorRow.GetStylesClass: TcxvgCustomRowStylesClass; +begin + Result := TcxEditorRowStyles; +end; + +procedure TcxCustomEditorRow.SetParentComponent(Value: TComponent); +begin + inherited SetParentComponent(Value); + if Value <> nil then + if Value is TcxCustomVerticalGrid then + EditContainer.EditingControl := TcxCustomVerticalGrid(Value) + else + EditContainer.EditingControl := (Value as TcxCustomRow).VerticalGrid; +end; + +procedure TcxCustomEditorRow.SetVerticalGrid(Value: TcxCustomVerticalGrid); +begin + inherited SetVerticalGrid(Value); + EditContainer.EditingControl := Value +end; + +function TcxCustomEditorRow.GetProperties: TcxCustomEditorRowProperties; +begin + Result := TcxCustomEditorRowProperties(FProperties); +end; + +function TcxCustomEditorRow.GetStyles: TcxEditorRowStyles; +begin + Result := TcxEditorRowStyles(FStyles); +end; + +procedure TcxCustomEditorRow.SetProperties(Value: TcxCustomEditorRowProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomEditorRow.SetStyles(Value: TcxEditorRowStyles); +begin + FStyles.Assign(Value); + Changed; +end; + +{ TcxEditorRow } + +function TcxEditorRow.GetPropertiesClass: TcxRowPropertiesClass; +begin + Result := TcxEditorRowProperties; +end; + +function TcxEditorRow.GetProperties: TcxEditorRowProperties; +begin + Result := TcxEditorRowProperties(FProperties); +end; + +procedure TcxEditorRow.SetProperties(Value: TcxEditorRowProperties); +begin + FProperties.Assign(Value); +end; + +{ TcxCollectionItemEditorRowProperties } + +constructor TcxCollectionItemEditorRowProperties.CreateEx( + ARow: TcxCustomRow); +begin + ARow.FProperties.FLocked := True; + inherited CreateEx(ARow); + FWidth := 50; + FEditContainer.EditingControl := ARow.VerticalGrid; + ARow.FProperties.FLocked := False; +end; + +procedure TcxCollectionItemEditorRowProperties.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxCollectionItemEditorRowProperties then + Width := TcxCollectionItemEditorRowProperties(Source).Width; +end; + +function TcxCollectionItemEditorRowProperties.GetDisplayName: string; +begin + Result := Caption; +end; + +function TcxCollectionItemEditorRowProperties.GetOwner: TPersistent; +begin + Result := Collection; +end; + +function TcxCollectionItemEditorRowProperties.GetOptions: TcxMultiEditorRowPropertiesOptions; +begin + Result := TcxMultiEditorRowPropertiesOptions(FEditContainer.Options); +end; + +procedure TcxCollectionItemEditorRowProperties.SetOptions( + Value: TcxMultiEditorRowPropertiesOptions); +begin + FEditContainer.Options.Assign(Value); +end; + +procedure TcxCollectionItemEditorRowProperties.SetWidth(Value: Integer); +begin + if Value < cxvgMinValueWidth then Value := cxvgMinValueWidth; + if FWidth <> Value then + begin + FWidth := Value; + Changed; + end; +end; + +{ TcxEditorRowItemProperties } + +procedure TcxEditorRowItemProperties.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TcxEditorRowItemProperties then + Value := TcxEditorRowItemProperties(Source).Value; +end; + +{ TcxEditorPropertiesCollection } + +constructor TcxEditorPropertiesCollection.Create(ARow: TcxCustomMultiEditorRow); +begin + inherited Create(GetCollectionItemClass); + FRow := ARow; +end; + +function TcxEditorPropertiesCollection.Add: TcxEditorRowItemProperties; +begin + Result := TcxEditorRowItemProperties(inherited Add); +end; + +function TcxEditorPropertiesCollection.GetNamePath: string; +var + S, P: string; +begin + S := Row.Name; + if S = '' then S := Row.GetNamePath; + P := PropName; + if P = '' then Exit; + Result := S + '.' + P; +end; + +function TcxEditorPropertiesCollection.GetCollectionItemClass: TCollectionItemClass; +begin + Result := TcxEditorRowItemProperties; +end; + +function TcxEditorPropertiesCollection.GetOwner: TPersistent; +begin + if FRow = nil then + Result := nil + else + Result := FRow.FProperties; +end; + +procedure TcxEditorPropertiesCollection.Update(Item: TCollectionItem); +var + I: Integer; + ARowInfo: TcxCustomRowViewInfo; +begin + for I := 0 to Count - 1 do + GetItem(I).FEditContainer.FCellIndex := I; + ARowInfo := FRow.ViewInfo; + with FRow.VerticalGrid do + begin + if csLoading in ComponentState then Exit; + HideEdit; + if not FRow.Properties.Locked then + begin + ARowInfo.ValuesInfo.Trunc(0); + if FocusedRow = FRow then + FocusedRow := nil; + with ARowInfo do + begin + Update; + for I := 0 to ValuesInfo.Count - 1 do + ValuesInfo[I].UpdateEditRect; + end; + FRow.Changed; + end; + end; +end; + +function TcxEditorPropertiesCollection.GetItem( + Index: Integer): TcxEditorRowItemProperties; +begin + Result := TcxEditorRowItemProperties(inherited Items[Index]); +end; + +{ TcxMultiEditorRowProperties } + +constructor TcxMultiEditorRowProperties.CreateEx(ARow: TcxCustomRow); +begin + inherited CreateEx(ARow); + FEditors := GetCollectionClass.Create(ARow as TcxCustomMultiEditorRow); + FSeparatorKind := skVertLine; +end; + +destructor TcxMultiEditorRowProperties.Destroy; +begin + FreeAndNil(FEditors); + inherited Destroy; +end; + +procedure TcxMultiEditorRowProperties.Assign(Source: TPersistent); +begin + if Source is TcxMultiEditorRowProperties then + with TcxMultiEditorRowProperties(Source) do + begin + Self.SeparatorAlignmentVert := SeparatorAlignmentVert; + Self.SeparatorKind := SeparatorKind; + Self.SeparatorString := SeparatorString; + Self.Fixed := Fixed; + Self.Editors.Assign(Editors); + end + else + inherited Assign(Source); +end; + +function TcxMultiEditorRowProperties.GetCollectionClass: TcxEditorPropertiesCollectionClass; +begin + Result := TcxEditorPropertiesCollection; +end; + +function TcxMultiEditorRowProperties.GetOwner: TPersistent; +begin + Result := Row; +end; + +procedure TcxMultiEditorRowProperties.SetFixed(Value: Boolean); +begin + if FFixed <> Value then + begin + FFixed := Value; + Changed; + end; +end; + +procedure TcxMultiEditorRowProperties.SetSeparatorAlignmentVert( + Value: TcxAlignmentVert); +begin + if FSeparatorAlignmentVert <> Value then + begin + FSeparatorAlignmentVert := Value; + Changed; + end; +end; + +procedure TcxMultiEditorRowProperties.SetSeparatorKind( + Value: TSeparatorKind); +begin + if FSeparatorKind <> Value then + begin + FSeparatorKind := Value; + Changed; + end; +end; + +procedure TcxMultiEditorRowProperties.SetSeparatorString( + const Value: string); +begin + if FSeparatorString <> Value then + begin + FSeparatorString := Value; + Changed; + end; +end; + +{ TcxCustomMultiEditorRow } + +function TcxCustomMultiEditorRow.CreateHeaderInfo: TcxCustomRowHeaderInfo; +begin + Result := TcxMultiEditorRowHeaderInfo.Create(Self); +end; + +function TcxCustomMultiEditorRow.CreateViewInfo: TcxCustomRowViewInfo; +var + I: Integer; +begin + Result := TcxMultiEditorRowViewInfo.Create(Self); + with TcxMultiEditorRowProperties(FProperties) do + for I := 0 to Editors.Count - 1 do + Editors[I].EditContainer.FCellIndex := I; +end; + +function TcxCustomMultiEditorRow.CanFocus: Boolean; +var + I: Integer; +begin + Result := inherited CanFocus; + if Result then + begin + Result := False; + for I := 0 to Properties.Editors.Count - 1 do + begin + Result := Result or Properties.Editors.GetItem(I).Options.Focusing; + if Result then break; + end; + end; +end; + +function TcxCustomMultiEditorRow.GetDefaultHeight: Integer; +var + I: Integer; + AFont: TFont; +begin + Result := inherited GetDefaultHeight; + for I := 0 to Properties.Editors.Count - 1 do + begin + AFont := VerticalGrid.Styles.GetContentParams(Properties.Editors[I], False, -1).Font; + Result := Max(Result, Properties.Editors[I].EditContainer.GetEditDefaultHeight(AFont) + cxTextOffset); + end; +end; + +function TcxCustomMultiEditorRow.GetEditContainer( + ACellIndex: Integer): TcxCellEdit; +begin + if (ACellIndex >= 0) and (ACellIndex < GetEditContainerCount) then + Result := Properties.Editors[ACellIndex].EditContainer + else + Result := nil; +end; + +function TcxCustomMultiEditorRow.GetEditContainerCount: Integer; +begin + Result := Properties.Editors.Count; +end; + +function TcxCustomMultiEditorRow.GetPropertiesClass: TcxRowPropertiesClass; +begin + Result := TcxMultiEditorRowProperties; +end; + +function TcxCustomMultiEditorRow.GetStylesClass: TcxvgCustomRowStylesClass; +begin + Result := TcxEditorRowStyles; +end; + +function TcxCustomMultiEditorRow.GetProperties: TcxMultiEditorRowProperties; +begin + Result := TcxMultiEditorRowProperties(FProperties);; +end; + +function TcxCustomMultiEditorRow.GetStyles: TcxEditorRowStyles; +begin + Result := TcxEditorRowStyles(FStyles); +end; + +procedure TcxCustomMultiEditorRow.SetProperties( + const Value: TcxMultiEditorRowProperties); +begin + FProperties.Assign(Value); +end; + +procedure TcxCustomMultiEditorRow.SetStyles(Value: TcxEditorRowStyles); +begin + FStyles.Assign(Value); + Changed; +end; + +{ TcxVerticalGridRows } + +constructor TcxVerticalGridRows.Create(AOwner: TcxCustomVerticalGrid); +begin + inherited Create; + FOwner := AOwner; + FList := TList.Create; + FCount := -1; +end; + +destructor TcxVerticalGridRows.Destroy; +begin + FreeAndNil(FList); + inherited Destroy; +end; + +procedure TcxVerticalGridRows.AssignRows(Source: TcxVerticalGridRows); + + procedure AddRowWithChildren(AParent: TcxCustomRow; ASourceRow: TcxCustomRow); + var + I: Integer; + AddedRow: TcxCustomRow; + begin + AddedRow := Owner.AddChild(AParent, TcxCustomRowClass(ASourceRow.ClassType)); + AddedRow.FID := ASourceRow.ID; + AddedRow.Assign(ASourceRow); + for I := 0 to ASourceRow.Count - 1 do + AddRowWithChildren(AddedRow, ASourceRow.Rows[I]); + end; + +var + I: Integer; +begin + if not (Source is TcxVerticalGridRows) then + cxVerticalGridError(cxGetResourceString(@cxSvgAssignRowsError)); + BeginUpdate; + try + Clear; + for I := 0 to Source.Root.Count - 1 do + AddRowWithChildren(Root, Source.Root.Rows[I]); + finally + EndUpdate; + end; +end; + +function TcxVerticalGridRows.IndexOf(ARow: TcxCustomRow): Integer; +begin + CheckList; + Result := FList.IndexOf(ARow); +end; + +procedure TcxVerticalGridRows.Add(ARow: TcxCustomRow); +begin + if Assigned(ARow) then + begin + FOwner.RootRow.Add(ARow); + UnprepareList; + end; +end; + +procedure TcxVerticalGridRows.AddChild(AParent, + ARow: TcxCustomRow); +begin + if Assigned(AParent) and Assigned(ARow) then + begin + AParent.Add(ARow); + UnprepareList; + end; +end; + +procedure TcxVerticalGridRows.BeginUpdate; +begin + Inc(FLockCount); +end; + +procedure TcxVerticalGridRows.Changed(ARebuild: Boolean = False); +begin + if ARebuild then PrepareList; + if FLockCount = 0 then + begin + FOwner.RowsChanged; + FOwner.OptionsView.CheckRowHeaderWidth; + end; +end; + +procedure TcxVerticalGridRows.CheckList; +begin + if FCount = -1 then PrepareList; +end; + +procedure TcxVerticalGridRows.Clear; +begin + BeginUpdate; + try + FOwner.FocusedRow := nil; + FOwner.RootRow.RemoveAll; + UnprepareList; + finally + EndUpdate; + end; +end; + +procedure TcxVerticalGridRows.EndUpdate; +begin + Dec(FLockCount); + if FLockCount = 0 then Changed(True); +end; + +function TcxVerticalGridRows.FindRowByID(AID: Integer): TcxCustomRow; +var + I: Integer; + ARow: TcxCustomRow; +begin + if AID = -1 then + Result := FOwner.FRootRow + else + begin + Result := nil; + for I := 0 to Count - 1 do + begin + ARow := Items[I]; + if ARow.ID = AID then + begin + Result := ARow; + break; + end; + end; + end; +end; + +function TcxVerticalGridRows.FindRowByStoredName(const AName: string): TcxCustomRow; +var + I: Integer; +begin + Result := FOwner.FRootRow; + for I := 0 to Count - 1 do + if CompareStr(Items[I].GetObjectName, AName) = 0 then + begin + Result := Items[I]; + break; + end; +end; + +function TcxVerticalGridRows.GetNextID: Integer; +begin + Result := FNextID; + Inc(FNextID); +end; + +procedure TcxVerticalGridRows.PrepareList; +var + ARow: TcxCustomRow; + + function NextRow: TcxCustomRow; + var + AIndex: Integer; + ATemp: TcxCustomRow; + begin + Result := nil; + AIndex := 0; + ATemp := ARow; + repeat + if ATemp.Count > AIndex then + Result := ATemp.Rows[AIndex] + else + begin + AIndex := Succ(ATemp.Index); + ATemp := ATemp.FParent; + end; + until (Result <> nil) or (ATemp = nil); + end; + +begin + FList.Clear; + ARow := FOwner.FirstRow; + while ARow <> nil do + begin + FList.Add(ARow); + ARow := NextRow; + end; + FCount := FList.Count; +end; + +procedure TcxVerticalGridRows.Remove(ARow: TcxCustomRow); +begin + FList.Remove(ARow); + UnprepareList; +end; + +procedure TcxVerticalGridRows.RestoreDefaults; +var + I: Integer; +begin + for I := 0 to Count - 1 do + Items[I].RestoreDefaults; +end; + +procedure TcxVerticalGridRows.UnprepareList; +begin + FCount := -1; +end; + +function TcxVerticalGridRows.GetCount: Integer; +begin + CheckList; + Result := FList.Count; +end; + +function TcxVerticalGridRows.GetRoot: TcxCustomRow; +begin + Result := FOwner.FRootRow; +end; + +function TcxVerticalGridRows.GetRow(Index: Integer): TcxCustomRow; +begin + if (Index < 0) or (Index >= Count) then // call Count -> refresh if need + cxVerticalGridError(cxSvgIndexError); + Result := TcxCustomRow(FList.List^[Index]); +end; + +procedure TcxVerticalGridRows.SetRow(Index: Integer; + const Value: TcxCustomRow); +begin + if (Index < 0) or (Index >= Count) then // call Count -> refresh if need + cxVerticalGridError(cxSvgIndexError); + FList[Index] := Value; +end; + +{ TBandInfoList } + +constructor TBandInfoList.Create; +begin + inherited Create(SizeOf(TBandInfo)); + Delta := 32; +end; + +function TBandInfoList.Add(ABandIndex, ARowsCount, ABandHeight: Integer; + AFirstRow: TcxCustomRow): Integer; +begin + CheckCapacity; + Result := FCount; + Inc(FCount); + with TBandInfo(Get(Result)^) do + begin + BandIndex := ABandIndex; + RowsCount := ARowsCount; + BandHeight := ABandHeight; + FirstRow := AFirstRow; + end; +end; + +function TBandInfoList.GetItem(Index: Integer): TBandInfo; +begin + Result := TBandInfo(Get(Index)^); +end; + +{ TcxvgCustomScrollStrategy } + +constructor TcxvgCustomScrollStrategy.Create( + AScroller: TcxvgScroller); +begin + FBandsInfo := TBandInfoList.Create; + FScroller := AScroller; + FViewInfo := AScroller.ViewInfo; +end; + +destructor TcxvgCustomScrollStrategy.Destroy; +begin + FBandsInfo.Free; + inherited Destroy; +end; + +procedure TcxvgCustomScrollStrategy.CheckDecreaseLeftIndex; +begin +end; + +procedure TcxvgCustomScrollStrategy.CheckDecreaseTopIndex(AScrollRectHeight: Integer); +var + ACount, ATotal: Integer; +begin + ATotal := FViewInfo.VisibleRowCount; + ACount := GetVisibleCountFromBottom(ATotal - 1, AScrollRectHeight); + if ATotal - ACount < FTopVisibleRowIndex then + FTopVisibleRowIndex := ATotal - ACount; +end; + +function TcxvgCustomScrollStrategy.CheckTopVisibleIndex(AIndex, AStep: Integer): Integer; +var + ACount: Integer; +begin + Result := AIndex; + ACount := ViewInfo.VisibleRowCount; + cxRange(Result, 0, ACount - + GetVisibleCountFromBottom(ACount - 1, cxRectHeight(ViewInfo.ClientRect))); +end; + +function TcxvgCustomScrollStrategy.FindNextCustomItem(AFocusedItemIndex, AItemCount: Integer; + AGoForward: Boolean; var AItemIndex: Integer): Boolean; + + function GetFromIndex: Integer; + begin + if AFocusedItemIndex = -1 then + if AGoForward then + Result := 0 + else + Result := -1 + else + if AGoForward then + Result := AFocusedItemIndex + 1 + else + Result := AFocusedItemIndex - 1; + end; + + function CheckIndex(var AIndex: Integer): Boolean; + begin + Result := True; + if AGoForward then + if AIndex > AItemCount - 1 then + Result := False + else + else + if AIndex < 0 then + Result := False; + end; +begin + Result := False; + if AItemCount = 0 then Exit; + AItemIndex := GetFromIndex; + Result := CheckIndex(AItemIndex); +end; + +function TcxvgCustomScrollStrategy.FindNextRecord(AFocusedRecordIndex: Integer; + AGoForward: Boolean): Integer; +begin + if DataController.IsGridMode then + if AGoForward then + if not DataController.IsEOF and (AFocusedRecordIndex = DataController.RowCount - 1) then + begin + DataController.Scroll(1); + if not DataController.IsEOF then + Dec(AFocusedRecordIndex); + end + else + else + if (AFocusedRecordIndex = 0) and not DataController.IsBOF then + begin + DataController.Scroll(-1); + if not DataController.IsBOF then + Inc(AFocusedRecordIndex); + end; + if not FindNextCustomItem(AFocusedRecordIndex, DataController.RowCount, AGoForward, Result) then + Result := -1; +end; + +function TcxvgCustomScrollStrategy.FocusNextRecord(AFocusedRecordIndex: Integer; + AGoForward: Boolean): Boolean; + + procedure CheckEditing; + begin + if DataController.IsEditing then + begin + TcxEditingControllerAccess(Controller.EditingController).UpdateValue; + if not (dceModified in DataController.EditState) then + begin + if DataController.EditState = [dceInsert] then + begin + Result := AGoForward xor DataController.IsEOF; + if Result then DataController.Cancel; + end; + Exit; + end; + DataController.Post; + AFocusedRecordIndex := DataController.FocusedRowIndex; + end; + end; + + procedure CheckGridMode; + begin + if DataController.IsGridMode and (AFocusedRecordIndex = -1) and AGoForward then + DataController.GotoFirst + end; + +var + ANewRecordIndex: Integer; + +begin + Result := False; + CheckEditing; + if Result then Exit; + CheckGridMode; + ANewRecordIndex := FindNextRecord(AFocusedRecordIndex, AGoForward); + Result := ANewRecordIndex <> -1; + if Result then + DataController.FocusedRowIndex := ANewRecordIndex; +end; + +function TcxvgCustomScrollStrategy.GetFirstRowByBandIndex( + ABandIndex: Integer): TcxCustomRow; +begin + if not cxInRange(ABandIndex, 0, BandsInfo.Count - 1) then + Result := nil + else + Result := FBandsInfo[ABandIndex].FirstRow; +end; + +procedure TcxvgCustomScrollStrategy.InitHScrollBarParameters; +var + AScrollRecordCount, AScrollPos: Integer; + + procedure GetScrollRecordParams; + var + AIntf: IcxVerticalGridDBDataContoller; + begin + if DataController.GetInterface(IcxVerticalGridDBDataContoller, AIntf) then + begin + AScrollRecordCount := AIntf.GetScrollBarRecordCount; + AScrollPos := AIntf.GetScrollBarPos; + end + else + begin + AScrollRecordCount := -1; + AScrollPos := -1; + end; + if AScrollRecordCount = -1 then + AScrollRecordCount := DataController.RowCount + ScrollBarOffsetBegin + ScrollBarOffsetEnd; + if AScrollPos = -1 then + AScrollPos := LeftVisibleRecord + ScrollBarOffsetBegin; + end; + +begin + GetScrollRecordParams; + VerticalGrid.SetScrollBarInfo(sbHorizontal, + 0, AScrollRecordCount - 1, 1, VisibleValueCount, + ScrollBarPos, not IsHideHScrollBar, True); +end; + +procedure TcxvgCustomScrollStrategy.InitVScrollBarParameters; +begin + VerticalGrid.SetScrollBarInfo(sbVertical, + 0, ViewInfo.VisibleRowCount - 1, //min max + 1, VisibleRowCount, TopVisibleRowIndex, not IsHideVScrollBar, True); +end; + +function TcxvgCustomScrollStrategy.GetVisibleCountFromBottom( + ABottomIndex, AHeight: Integer): Integer; +begin + Result := GetVisibleCount(ABottomIndex, AHeight, -1, False); +end; + +function TcxvgCustomScrollStrategy.GetVisibleCountFromTop( + ATopIndex, AHeight: Integer): Integer; +begin + Result := GetVisibleCount(ATopIndex, AHeight, 1, True); +end; + +procedure TcxvgCustomScrollStrategy.RecalcBandsInfo; +begin + FBandsInfo.Clear; + FBandsInfo.Add(0, FViewInfo.VisibleRowCount, -1, FViewInfo.VisibleRows[0]); +end; + +procedure TcxvgCustomScrollStrategy.ScrollRecords(AForward: Boolean; + ACount: Integer); +var + AIntf: IcxVerticalGridDBDataContoller; +begin + if not DataController.GetInterface(IcxVerticalGridDBDataContoller, AIntf) or + not AIntf.DoScroll(AForward) then + if AForward then + Scroller.LeftVisibleRecord := LeftVisibleRecord + ACount + else + Scroller.LeftVisibleRecord := LeftVisibleRecord - ACount; +end; + +procedure TcxvgCustomScrollStrategy.SetRowMaxVisible(ARow: TcxCustomRow); +var + N, ATopIndex, AChildCount, AGroupHeight, AClientHeight: Integer; +begin + if ARow = nil then Exit; + AGroupHeight := GetFullRowHeight(ARow, AChildCount); + AClientHeight := BandsInfo.Count * cxRectHeight(FViewInfo.ClientRect); + if AGroupHeight >= AClientHeight then + SetTopVisibleRowIndexAndBand(ARow.VisibleIndex) + else + begin + N := GetVisibleCountFromTop(FTopVisibleRowIndex, cxRectHeight(ViewInfo.ClientRect)); + ATopIndex := ARow.VisibleIndex + AChildCount - N + 1; + if FTopVisibleRowIndex < ATopIndex then + SetTopVisibleRowIndexAndBand(ATopIndex); + end +end; + +function TcxvgCustomScrollStrategy.CanContinueForward(Index: Integer): Boolean; +begin + Result := Index < FViewInfo.VisibleRowCount; +end; + +function TcxvgCustomScrollStrategy.CanContinueBackward(Index: Integer): Boolean; +begin + Result := Index > -1; +end; + +function TcxvgCustomScrollStrategy.CanCalcRowsOnTheNextBand(ALeft, + ANextBandIndex: Integer): Boolean; +begin + Result := False; +end; + +procedure TcxvgCustomScrollStrategy.CheckLeftVisibleRecord(var AValue: Integer); +var + AIsGridMode: Boolean; + AMaxValue: Integer; +begin + if FCheckingCoordinate then Exit; + FCheckingCoordinate := True; + with DataController do + try + AIsGridMode := IsGridMode; + if AValue < 0 then + begin + if AIsGridMode and not IsBOF then + Scroll(AValue); + AValue := 0; + end; + if AValue > RowCount - 1 then + begin + if AIsGridMode and not IsEOF then + Scroll(AValue - (RowCount - 1)); + AValue := RowCount - 1; + end; + if AValue <= 0 then Exit; + AMaxValue := RowCount - VisibleValueCount; + if AValue > AMaxValue then + begin + if AIsGridMode and not IsEOF and not (dceInsert in EditState) then + Scroll(AValue - AMaxValue); + AValue := AMaxValue; + end; + finally + FCheckingCoordinate := False; + end; +end; + +function TcxvgCustomScrollStrategy.GetBandWidth: Integer; +begin + Result := ViewInfo.FViewBandWidth; +end; + +function TcxvgCustomScrollStrategy.GetBottomVisibleChild( + ARow: TcxCustomRow): TcxCustomRow; +begin + if (ARow = nil) or not (ARow.Expanded and ARow.Visible) then + begin + Result := nil; + Exit + end; + Result := ARow.GetLastVisibleChild; +end; + +function TcxvgCustomScrollStrategy.GetFullRowHeight(ARow: TcxCustomRow; + out ChildCount: Integer): Integer; +var + I, AIndex: Integer; + AChild: TcxCustomRow; +begin + ChildCount := 0; + Result := 0; + if ARow = nil then Exit; + with ViewInfo do + begin + Result := ARow.ViewInfo.CalculatedHeight + HorzLineWidth; + AIndex := ARow.VisibleIndex; + if AIndex >= 0 then + for I := AIndex + 1 to VisibleRowCount - 1 do + begin + AChild := VisibleRows[I]; + if ARow.IsParent(AChild) then + begin + Inc(ChildCount); + Inc(Result, AChild.ViewInfo.CalculatedHeight + HorzLineWidth); + end; + end; + end; +end; + +function TcxvgCustomScrollStrategy.GetScrollBarOffsetBegin: Integer; +begin + with DataController do + begin + if IsGridMode and IsRecordsScrollMode then + Result := Ord(not IsBOF) + else + Result := 0; + end; +end; + +function TcxvgCustomScrollStrategy.GetScrollBarOffsetEnd: Integer; +begin + with DataController do + begin + if IsGridMode and IsRecordsScrollMode then + Result := Ord(not IsEOF) + else + Result := 0; + end; +end; + +function TcxvgCustomScrollStrategy.GetVisibleCount(ABeginIndex, AAreaHeight, + AStep: Integer; AForward: Boolean): Integer; + + function CheckContinue(AIndex: Integer): Boolean; + begin + if AForward then + Result := CanContinueForward(AIndex) + else + Result := CanContinueBackward(AIndex) + end; + +var + ARowCount, ARowHeight, ABandCount, ALeft, ABandWidth, ABandHeight: Integer; + ARowViewInfo: TcxCustomRowViewInfo; +begin + Result := 0; + ARowCount := 0; + ABandCount := 0; + ABandWidth := BandWidth; + if ABandWidth <= 0 then Exit; + with ViewInfo do + begin + ABandHeight := HorzLineWidth; + ALeft := ClientRect.Left; + while CheckContinue(ABeginIndex) do + begin + ARowViewInfo := VisibleRows[ABeginIndex].ViewInfo; + if FRowsViewInfo.IndexOf(ARowViewInfo) = -1 then + ARowHeight := GetRowHeight(ARowViewInfo, ABandWidth) + else + ARowHeight := ARowViewInfo.CalculatedHeight; + if ABandHeight + ARowHeight + HorzLineWidth > AAreaHeight then + begin + if ARowCount = 0 then ARowCount := 1; + Inc(Result, ARowCount); + ARowCount := 0; + ABandHeight := HorzLineWidth; + Inc(ALeft, ABandWidth + BandInterval); + Inc(ABandCount); + if not CanCalcRowsOnTheNextBand(ALeft, ABandCount) then break; + end; + Inc(ABandHeight, ARowHeight + HorzLineWidth); + Inc(ARowCount); + Inc(ABeginIndex, AStep); + end; + end; + Inc(Result, ARowCount); +end; + +function TcxvgCustomScrollStrategy.IsBehindRightClientEdge(X: Integer): Boolean; +begin + Result := X > (FViewInfo.ClientRect.Right - FViewInfo.VertLineWidth); +end; + +function TcxvgCustomScrollStrategy.IsHideHScrollBar: Boolean; +begin + with VerticalGrid do + Result := (ClientHeight - 2 < HScrollBar.Height) or + (IsRecordsScrollMode and not Controller.CanChangeRecord); +end; + +function TcxvgCustomScrollStrategy.IsHideVScrollBar: Boolean; +begin + with VerticalGrid do + Result := cxRectWidth(ViewInfo.ClientRect) - 2 < VScrollBar.Width; +end; + +function TcxvgCustomScrollStrategy.IsRecordsScrollMode: Boolean; +begin + Result := True; +end; + +procedure TcxvgCustomScrollStrategy.ScrollH( + AScrollCode: TScrollCode; var AScrollPos: Integer); + + procedure DoScrollRecords; + begin + case AScrollCode of + scLineUp: + ScrollRecords(False, 1); + scLineDown: + ScrollRecords(True, 1); + scPageUp: + Scroller.LeftVisibleRecord := LeftVisibleRecord - VisibleValueCount; + scPageDown: + Scroller.LeftVisibleRecord := LeftVisibleRecord + VisibleValueCount; + scTrack: + if not DataController.IsGridMode then + ScrollBarPos := AScrollPos; + scPosition: + if DataController.IsGridMode then + ScrollBarPos := AScrollPos; + end; + AScrollPos := ScrollBarPos; + end; + + procedure DoScrollBands; + begin + case AScrollCode of + scLineUp: + Scroller.LeftVisibleBand := LeftVisibleBand - 1; + scLineDown: + Scroller.LeftVisibleBand := LeftVisibleBand + 1; + scPageUp: + Scroller.LeftVisibleBand := LeftVisibleBand - VisibleBandCount; + scPageDown: + Scroller.LeftVisibleBand := LeftVisibleBand + VisibleBandCount; + scTrack: + Scroller.LeftVisibleBand := AScrollPos; + end; + AScrollPos := LeftVisibleBand; + end; + +begin + if IsRecordsScrollMode then + DoScrollRecords + else + DoScrollBands; +end; + +procedure TcxvgCustomScrollStrategy.ScrollV( + AScrollCode: TScrollCode; var AScrollPos: Integer); +begin + case AScrollCode of + scLineUp: + Scroller.TopVisibleRowIndex := TopVisibleRowIndex - 1; + scLineDown: + Scroller.TopVisibleRowIndex := TopVisibleRowIndex + 1; + scPageUp: + Scroller.TopVisibleRowIndex := TopVisibleRowIndex - VisibleRowCount; + scPageDown: + Scroller.TopVisibleRowIndex := TopVisibleRowIndex + VisibleRowCount; + scTrack: + Scroller.TopVisibleRowIndex := AScrollPos; + end; + AScrollPos := TopVisibleRowIndex; +end; + +procedure TcxvgCustomScrollStrategy.SetLeftVisibleRecord(Value: Integer); +var + ARowIndex: Integer; +begin + ARowIndex := Value; + CheckLeftVisibleRecord(ARowIndex); + if FLeftVisibleRecord <> ARowIndex then + begin + FLeftVisibleRecord := ARowIndex; + VerticalGrid.LayoutChanged; + end; +end; + +procedure TcxvgCustomScrollStrategy.SetTopVisibleRowIndexAndBand(Index: Integer); +begin + SetTopVisibleRowIndex(Index); +end; + +function TcxvgCustomScrollStrategy.GetController: TcxvgController; +begin + Result := FViewInfo.VerticalGrid.Controller; +end; + +function TcxvgCustomScrollStrategy.GetDataController: TcxCustomDataController; +begin + Result := FViewInfo.VerticalGrid.DataController; +end; + +function TcxvgCustomScrollStrategy.GetScrollBarPos: Integer; +var + AIntf: IcxVerticalGridDBDataContoller; +begin + if DataController.GetInterface(IcxVerticalGridDBDataContoller, AIntf) then + Result := AIntf.GetScrollBarPos + else + Result := -1; + if Result = -1 then + Result := LeftVisibleRecord + ScrollBarOffsetBegin; +end; + +function TcxvgCustomScrollStrategy.GetVerticalGrid: TcxCustomVerticalGrid; +begin + Result := FViewInfo.VerticalGrid; +end; + +function TcxvgCustomScrollStrategy.GetVisibleRowCount: Integer; +begin + with FViewInfo.ClientRect do + Result := GetVisibleCountFromTop(TopVisibleRowIndex, Bottom - Top); +end; + +procedure TcxvgCustomScrollStrategy.SetScrollBarPos(Value: Integer); +var + AIntf: IcxVerticalGridDBDataContoller; +begin + if not DataController.GetInterface(IcxVerticalGridDBDataContoller, AIntf) or + not AIntf.SetScrollBarPos(Value) then + Scroller.LeftVisibleRecord := Value - ScrollBarOffsetBegin +end; + +procedure TcxvgCustomScrollStrategy.SetTopVisibleRowIndex(Value: Integer); +begin + if FTopVisibleRowIndex <> Value then + begin + FTopVisibleRowIndex := Value; + VerticalGrid.LayoutChanged; + VerticalGrid.DoTopRowIndexChanged; + end; +end; + +{ TcxvgSingleRecordScrollStrategy } + +function TcxvgSingleRecordScrollStrategy.GetBandIndexByRowIndex( + ARowIndex: Integer): Integer; +begin + Result := 0; +end; + +function TcxvgSingleRecordScrollStrategy.GetBandInterval: Integer; +begin + Result := 0; +end; + +function TcxvgSingleRecordScrollStrategy.GetLeftVisibleBand: Integer; +begin + Result := 0; +end; + +function TcxvgSingleRecordScrollStrategy.GetVisibleBandCount: Integer; +begin + Result := 1; +end; + +function TcxvgSingleRecordScrollStrategy.GetVisibleValueCount: Integer; +begin + Result := 1; +end; + +procedure TcxvgSingleRecordScrollStrategy.SetLeftVisibleBand(Value: Integer); +begin +end; + +{ TcxvgMultiRecordsScrollStrategy } + +procedure TcxvgMultiRecordsScrollStrategy.CheckDecreaseLeftIndex; +var + AVisibleCount: Integer; +begin + AVisibleCount := VisibleValueCount; + if LeftVisibleRecord + AVisibleCount > VerticalGrid.RecordCount then + FLeftVisibleRecord := Max(0, VerticalGrid.RecordCount - AVisibleCount); +end; + +function TcxvgMultiRecordsScrollStrategy.GetBandIndexByRowIndex( + ARowIndex: Integer): Integer; +begin + Result := 0; +end; + +function TcxvgMultiRecordsScrollStrategy.GetBandInterval: Integer; +begin + Result := 0; +end; + +function TcxvgMultiRecordsScrollStrategy.GetLeftVisibleBand: Integer; +begin + Result := 0; +end; + +function TcxvgMultiRecordsScrollStrategy.GetVisibleBandCount: Integer; +begin + Result := 1; +end; + +function TcxvgMultiRecordsScrollStrategy.GetVisibleValueCount: Integer; +var + ACount, ARecordSpace, ARecordsWidth: Integer; +begin + with FViewInfo do + begin + ARecordSpace := cxSetValue(RecordsInterval = 0, VertLineWidth, + 2 * VertLineWidth + RecordsInterval); + ARecordsWidth := cxRectWidth(ClientRect) - VertLineWidth - + FFullHeaderWidth + (ARecordSpace - VertLineWidth); + ACount := Max(1, ARecordsWidth div (ViewValueWidth + ARecordSpace)); + end; + Result := Min(ACount, VerticalGrid.RecordCount); +end; + +procedure TcxvgMultiRecordsScrollStrategy.SetLeftVisibleBand(Value: Integer); +begin +end; + +procedure TcxvgMultiRecordsScrollStrategy.SetLeftVisibleRecord(Value: Integer); +var + ARecordIndex: Integer; +begin + ARecordIndex := Value; + CheckLeftVisibleRecord(ARecordIndex); + if FLeftVisibleRecord <> ARecordIndex then + begin + FLeftVisibleRecord := ARecordIndex; + VerticalGrid.LayoutChanged; + end; +end; + +function TcxvgMultiRecordsScrollStrategy.GetRecordsInterval: Integer; +begin + Result := TcxMultiRecordViewInfo(ViewInfo).RecordsInterval; +end; + +{ TcxvgBandsScrollStrategy } + +procedure TcxvgBandsScrollStrategy.CheckDecreaseTopIndex(AScrollRectHeight: Integer); +var + ALeftBand: Integer; +begin + ALeftBand := Max(0, BandsInfo.Count - VisibleBandCount); + if ALeftBand < FLeftVisibleBand then + begin + FLeftVisibleBand := ALeftBand; + VerticalGrid.DoLeftVisibleBandIndexChanged; + end; + FTopVisibleRowIndex := GetFirstRowByBandIndex(FLeftVisibleBand).VisibleIndex; +end; + +function TcxvgBandsScrollStrategy.CheckTopVisibleIndex( + AIndex, AStep: Integer): Integer; +var + ARow: TcxCustomRow; + ABandIndex: Integer; +begin + ARow := ViewInfo.VisibleRows[AIndex]; + ABandIndex := GetBandIndexByRowIndex(AIndex); + if ARow <> GetFirstRowByBandIndex(ABandIndex) then + begin + Inc(ABandIndex, AStep); + ARow := GetFirstRowByBandIndex(ABandIndex); + end; + if ARow <> nil then + begin + AIndex := ARow.VisibleIndex; + if FLeftVisibleBand <> ABandIndex then + begin + FLeftVisibleBand := ABandIndex; + VerticalGrid.DoLeftVisibleBandIndexChanged; + end; + end; + Result := AIndex; +end; + +function TcxvgBandsScrollStrategy.GetBandIndexByRowIndex( + ARowIndex: Integer): Integer; +var + I, AFirstIndex: Integer; + ABandInfo: TBandInfo; +begin + Result := -1; + for I := 0 to FBandsInfo.Count - 1 do + begin + ABandInfo := BandsInfo[I]; + AFirstIndex := ABandInfo.FirstRow.VisibleIndex; + if (ARowIndex >= AFirstIndex) and (ARowIndex < AFirstIndex + ABandInfo.RowsCount) then + begin + Result := I; + break; + end; + end; +end; + +procedure TcxvgBandsScrollStrategy.InitHScrollBarParameters; +begin + if IsRecordsScrollMode then + inherited InitHScrollBarParameters + else + VerticalGrid.SetScrollBarInfo(sbHorizontal, 0, BandsInfo.Count - 1, 1, + VisibleBandCount, LeftVisibleBand, not IsHideHScrollBar, True); +end; + +function TcxvgBandsScrollStrategy.IsHideVScrollBar: Boolean; +begin + Result := True; +end; + +procedure TcxvgBandsScrollStrategy.RecalcBandsInfo; +var + I, ARowCount, AHeight, ABandIndex, AClientHeight: Integer; + ARow, AFirstRow: TcxCustomRow; + ARowViewInfo: TcxCustomRowViewInfo; +begin + FBandsInfo.Clear; + ARowCount := 0; + ABandIndex := 0; + with ViewInfo do + begin + AHeight := HorzLineWidth; + ViewValueWidth := GetViewValueWidth; + AClientHeight := cxRectHeight(ClientRect); // for LayoutStyleChanged + I := 0; + while I < VisibleRowCount do + begin + ARow := VisibleRows[I]; + ARowViewInfo := ARow.ViewInfo; + ARowViewInfo.CalculatedHeight := GetRowHeight(ARowViewInfo, ViewBandWidth); + if AHeight + ARowViewInfo.CalculatedHeight + HorzLineWidth > AClientHeight then + begin + AFirstRow := VisibleRows[I - ARowCount]; + if ARowCount = 0 then + begin + ARowCount := 1; + AFirstRow := VisibleRows[I]; + AHeight := ARowViewInfo.CalculatedHeight + HorzLineWidth; + end + else Dec(I); + BandsInfo.Add(ABandIndex, ARowCount, AHeight, AFirstRow); + AHeight := HorzLineWidth; + ARowCount := 0; + Inc(ABandIndex); + Inc(I); + continue; + end; + Inc(AHeight, ARowViewInfo.CalculatedHeight + HorzLineWidth); + Inc(ARowCount); + Inc(I); + end; + if ARowCount <> 0 then + BandsInfo.Add(ABandIndex, ARowCount, AHeight, VisibleRows[I - ARowCount]); + end; +end; + +procedure TcxvgBandsScrollStrategy.SetRowMaxVisible(ARow: TcxCustomRow); +begin + SetTopVisibleRowIndexAndBand(GetBandViewRowMaxVisibleTopIndex(ARow)); +end; + +function TcxvgBandsScrollStrategy.CanCalcRowsOnTheNextBand( + ALeft, ANextBandIndex: Integer): Boolean; +var + X: Integer; +begin + Result := True; + if IsBehindRightClientEdge(ALeft + BandWidth + FViewInfo.BandsInterval + 1) then + begin + if VerticalGrid.OptionsView.AutoScaleBands then + begin + X := (ALeft + BandWidth) - FViewInfo.ClientRect.Right; + if X > ANextBandIndex then Result := False; + end + else + Result := False; + end; +end; + +function TcxvgBandsScrollStrategy.GetBandInterval: Integer; +begin + Result := FViewInfo.BandsInterval; +end; + +function TcxvgBandsScrollStrategy.GetBandViewRowMaxVisibleTopIndex( + ARow: TcxCustomRow): Integer; +var + AFirstBandIndex, ALastBandIndex, AVisBandsCount: Integer; + ABottomChild: TcxCustomRow; +begin + AFirstBandIndex := GetBandIndexByRowIndex(ARow.VisibleIndex); + ABottomChild := GetBottomVisibleChild(ARow); + if (ABottomChild <> nil) and (ABottomChild <> ARow) then + begin + ALastBandIndex := GetBandIndexByRowIndex(ABottomChild.VisibleIndex); + AVisBandsCount := VisibleBandCount; + if ALastBandIndex - AFirstBandIndex > AVisBandsCount then + begin + Result := ARow.VisibleIndex; + Exit; + end; + if AFirstBandIndex + AVisBandsCount > ALastBandIndex then + begin + AFirstBandIndex := Max(0, ALastBandIndex - AVisBandsCount + 1); + Result := GetFirstRowByBandIndex(AFirstBandIndex).VisibleIndex; + Exit; + end; + end; + Result := ARow.VisibleIndex; +end; + +function TcxvgBandsScrollStrategy.GetLeftVisibleBand: Integer; +begin + Result := FLeftVisibleBand; +end; + +function TcxvgBandsScrollStrategy.GetVisibleBandCount: Integer; +var + W, AIndents: Integer; +begin + W := Max(1, ViewInfo.ViewBandWidth); // W = 0 ??? + AIndents := FBandsInfo.Count - 1 * TcxBandsViewInfo(ViewInfo).BandsInterval; + Result := Min(BandsInfo.Count, Max(1, (cxRectWidth(ViewInfo.ClientRect) - AIndents) div W)); +end; + +function TcxvgBandsScrollStrategy.GetVisibleValueCount: Integer; +begin + Result := 1; +end; + +function TcxvgBandsScrollStrategy.IsRecordsScrollMode: Boolean; +begin + Result := Controller.CanChangeRecord; +end; + +procedure TcxvgBandsScrollStrategy.SetLeftVisibleBand(Value: Integer); +var + AFirstRow: TcxCustomRow; +begin + cxRange(Value, 0, BandsInfo.Count - VisibleBandCount); + if FLeftVisibleBand <> Value then + begin + FLeftVisibleBand := Value; + AFirstRow := GetFirstRowByBandIndex(Value); + if AFirstRow = nil then + FTopVisibleRowIndex := 0 + else + FTopVisibleRowIndex := AFirstRow.VisibleIndex; + VerticalGrid.LayoutChanged; + end; +end; + +{ TcxvgScroller } + +constructor TcxvgScroller.Create(AVerticalGrid: TcxCustomVerticalGrid); +begin + FVerticalGrid := AVerticalGrid; +end; + +destructor TcxvgScroller.Destroy; +begin + FreeAndNil(FScrollStrategy); + inherited Destroy; +end; + +function TcxvgScroller.GoToFirst: Boolean; +begin + Result := ScrollStrategy.FocusNextRecord(-1, True); +end; + +function TcxvgScroller.GoToLast: Boolean; +begin + Result := ScrollStrategy.FocusNextRecord(-1, False); +end; + +function TcxvgScroller.GoToNext: Boolean; +begin + Result := ScrollStrategy.FocusNextRecord(FocusedRecordIndex, True); +end; + +function TcxvgScroller.GoToPrev: Boolean; +begin + Result := ScrollStrategy.FocusNextRecord(FocusedRecordIndex, False); +end; + +function TcxvgScroller.GetBandIndexByRowIndex( + ARowIndex: Integer): Integer; +begin + Result := FScrollStrategy.GetBandIndexByRowIndex(ARowIndex); +end; + +procedure TcxvgScroller.InitScrollBarsParameters; +begin + with ScrollStrategy do + begin + InitHScrollBarParameters; + InitVScrollBarParameters; + end; +end; + +procedure TcxvgScroller.RecalcBandsInfo; +begin + FScrollStrategy.RecalcBandsInfo; + CheckDecreaseLeftIndex; + CheckDecreaseTopIndex; +end; + +procedure TcxvgScroller.RecreateScrollStrategy; +begin + FreeAndNil(FScrollStrategy); + FScrollStrategy := CreateScrollStrategy(Self); +end; + +procedure TcxvgScroller.Scroll(AScrollBarKind: TScrollBarKind; + AScrollCode: TScrollCode; var AScrollPos: Integer); +begin + if AScrollBarKind = sbHorizontal then + FScrollStrategy.ScrollH(AScrollCode, AScrollPos) + else + FScrollStrategy.ScrollV(AScrollCode, AScrollPos); +end; + +function TcxvgScroller.SetRecordVisible(ARecordIndex: Integer): Boolean; +var + ACount, AOldLeftVisibleRecord: Integer; +begin + Result := False; + if (ARecordIndex < 0) or (ARecordIndex > VerticalGrid.RecordCount - 1) then Exit; + AOldLeftVisibleRecord := LeftVisibleRecord; + if (ARecordIndex < AOldLeftVisibleRecord) then + LeftVisibleRecord := ARecordIndex + else + begin + ACount := VisibleValueCount; + if AOldLeftVisibleRecord + ACount <= ARecordIndex then + LeftVisibleRecord := ARecordIndex - ACount + 1; + end; + Result := LeftVisibleRecord <> AOldLeftVisibleRecord; +end; + +procedure TcxvgScroller.SetRowMaxVisible(ARow: TcxCustomRow); +begin + if (ARow = nil) or (ARow.VisibleIndex < 0) then Exit; + if not ARow.Expanded then + SetRowVisible(ARow) + else + ScrollStrategy.SetRowMaxVisible(ARow); +end; + +procedure TcxvgScroller.SetRowVisible(ARow: TcxCustomRow); +var + AIndex, ATopIndex, ACount, AStep: Integer; +begin + AIndex := ARow.VisibleIndex; + ATopIndex := TopVisibleRowIndex; + AStep := 0; + if AIndex < TopVisibleRowIndex then + ATopIndex := AIndex + else + if TopVisibleRowIndex + VisibleRowCount <= AIndex then + begin + ACount := GetVisibleCountFromBottom(AIndex); + if AIndex + 1 - ACount > TopVisibleRowIndex then + ATopIndex := Max(0, AIndex - ACount + 1); + AStep := 1; + end; + with ScrollStrategy do + SetTopVisibleRowIndex(CheckTopVisibleIndex(ATopIndex, AStep)); +end; + +function TcxvgScroller.CreateScrollStrategy( + AScroller: TcxvgScroller): TcxvgCustomScrollStrategy; +begin + Result := VerticalGrid.GetScrollStrategyClass.Create(Self); +end; + +procedure TcxvgScroller.LayoutStyleChanged; +begin + with VerticalGrid do + begin + BeginUpdate; + try + DoLayoutChanged; + LeftVisibleBand := 0; + FScrollStrategy.SetTopVisibleRowIndex(0); + if FocusedRow <> nil then SetRowVisible(FocusedRow); + finally + if HandleAllocated then + ViewInfo.FLockDividerPos := False; + EndUpdate; + end; + end; +end; + +procedure TcxvgScroller.CheckDecreaseLeftIndex; +begin + if FCheckDecreaseLeftIndex then + begin + FScrollStrategy.CheckDecreaseLeftIndex; + FCheckDecreaseLeftIndex := False; + end; +end; + +procedure TcxvgScroller.CheckDecreaseTopIndex; +begin + if not FCheckDecreaseTopIndex or (TopVisibleRowIndex = 0) then Exit; + with ViewInfo.ClientRect do + FScrollStrategy.CheckDecreaseTopIndex(Bottom - Top); + FCheckDecreaseTopIndex := False; +end; + +function TcxvgScroller.GetBandsInfo: TBandInfoList; +begin + Result := FScrollStrategy.FBandsInfo; +end; + +function TcxvgScroller.GetCheckDecrease: Boolean; +begin + Result := FCheckDecreaseLeftIndex or FCheckDecreaseTopIndex; +end; + +function TcxvgScroller.GetFocusedRecordIndex: Integer; +begin + Result := FVerticalGrid.DataController.FocusedRowIndex; +end; + +function TcxvgScroller.GetLeftVisibleBand: Integer; +begin + Result := FScrollStrategy.LeftVisibleBand; +end; + +function TcxvgScroller.GetLeftVisibleRecord: Integer; +begin + Result := FScrollStrategy.LeftVisibleRecord; +end; + +function TcxvgScroller.GetTopVisibleRowIndex: Integer; +begin + Result := FScrollStrategy.TopVisibleRowIndex; +end; + +function TcxvgScroller.GetViewInfo: TcxvgCustomViewInfo; +begin + Result := FVerticalGrid.ViewInfo; +end; + +function TcxvgScroller.GetVisibleCountFromBottom( + ARowIndex: Integer): Integer; +begin + Result := FScrollStrategy.GetVisibleCountFromBottom(ARowIndex, cxRectHeight(ViewInfo.ClientRect)); +end; + +function TcxvgScroller.GetVisibleRowCount: Integer; +begin + Result := FScrollStrategy.GetVisibleRowCount; +end; + +function TcxvgScroller.GetVisibleValueCount: Integer; +begin + Result := FScrollStrategy.GetVisibleValueCount; +end; + +procedure TcxvgScroller.SetCheckDecrease(Value: Boolean); +begin + FCheckDecreaseTopIndex := Value; + FCheckDecreaseLeftIndex := Value; +end; + +procedure TcxvgScroller.SetLeftVisibleBand(Value: Integer); +var + AOldValue: Integer; +begin + with FScrollStrategy do + begin + AOldValue := LeftVisibleBand; + LeftVisibleBand := Value; + if AOldValue <> LeftVisibleBand then + FVerticalGrid.DoLeftVisibleBandIndexChanged; + end; +end; + +procedure TcxvgScroller.SetLeftVisibleRecord( + Value: Integer); +var + AOldValue: Integer; +begin + with FScrollStrategy do + begin + AOldValue := LeftVisibleRecord; + LeftVisibleRecord := Value; + if AOldValue <> LeftVisibleRecord then + begin + FVerticalGrid.ViewInfo.Calculate; + FVerticalGrid.DoLeftVisibleRecordIndexChanged; + end; + end; +end; + +procedure TcxvgScroller.SetTopVisibleRowIndex(Value: Integer); +begin + with ScrollStrategy do + SetTopVisibleRowIndex(CheckTopVisibleIndex(Value, 0)); +end; + +{ TcxCustomVerticalGrid } + +constructor TcxCustomVerticalGrid.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FImageChangeLink := TChangeLink.Create; + FImageChangeLink.OnChange := ImageListChange; + FCategoryFont := TFont.Create; + FCategoryFont.Style := [fsBold]; + FCategoryFont.OnChange := CategoryFontChanged; + SetBounds(Left, Top, 150, 200); +end; + +destructor TcxCustomVerticalGrid.Destroy; +begin + FreeAndNil(FImageChangeLink); + FreeAndNil(FCategoryFont); + inherited Destroy; +end; + +function TcxCustomVerticalGrid.Add(ARowClass: TcxCustomRowClass): TcxCustomRow; +begin + CheckRowClass(ARowClass); + Result := ARowClass.Create(Owner); + Result.SetVerticalGrid(Self); + FRows.Add(Result); + LayoutChanged; +end; + +function TcxCustomVerticalGrid.AddChild(AParent: TcxCustomRow; + ARowClass: TcxCustomRowClass): TcxCustomRow; +begin + if AParent = nil then + begin + Result := Add(ARowClass); + Exit; + end; + CheckRowClass(ARowClass); + Result := ARowClass.Create(Owner); + Result.SetVerticalGrid(Self); + FRows.AddChild(AParent, Result); + LayoutChanged; +end; + +procedure TcxCustomVerticalGrid.AssignRows(Source: TcxCustomVerticalGrid); +begin + if Source <> nil then + Rows.AssignRows(Source.Rows); +end; + +procedure TcxCustomVerticalGrid.ClearRows; +begin + BeginUpdate; + try + DataController.BeginUpdateFields; + try + Controller.Clear; + Rows.Clear; + finally + DataController.EndUpdateFields; + end; + finally + EndUpdate; + end; +end; + +function TcxCustomVerticalGrid.FirstRow: TcxCustomRow; +begin + if HasRows then Result := FRootRow.Rows[0] else Result := nil; +end; + +function TcxCustomVerticalGrid.FirstVisibleRow: TcxCustomRow; +var + I: Integer; +begin + Result := nil; + Rows.CheckList; + for I := 0 to FRootRow.Count - 1 do + if FRootRow.Rows[I].Visible then + begin + Result := FRootRow.Rows[I]; + break; + end; +end; + +procedure TcxCustomVerticalGrid.FocusRow(ARow: TcxCustomRow; + ACellIndex: Integer = 0); +begin + with Controller do + begin + SetFocusedRowAndCell(ARow, ACellIndex); + MakeFocusedItemVisible; + end; +end; + +procedure TcxCustomVerticalGrid.FullCollapse; +var + I: Integer; +begin + if HasRows then + begin + BeginUpdate; + try + for I := 0 to FRootRow.Count - 1 do + FRootRow.Rows[I].Collapse(True); + finally + EndUpdate; + end; + end +end; + +procedure TcxCustomVerticalGrid.FullExpand; +begin + if HasRows then + begin + BeginUpdate; + try + FRootRow.Expand(True); + finally + EndUpdate; + end; + end +end; + +function TcxCustomVerticalGrid.HasRows: Boolean; +begin + Result := FRootRow.Count > 0 +end; + +function TcxCustomVerticalGrid.HasVisibleRows: Boolean; +begin + Result := FirstVisibleRow <> nil; +end; + +function TcxCustomVerticalGrid.IsInternalDragging: Boolean; +begin + Result := Controller.IsInternalDragging; +end; + +function TcxCustomVerticalGrid.IsRowVisible(ARow: TcxCustomRow): Boolean; +begin + Result := False; + Rows.CheckList; + if ARow.Visible then + repeat + ARow := ARow.FParent; + if (ARow = FRootRow) then + begin + Result := True; + Exit; + end + else + if not (ARow.Expanded and ARow.Visible) then Exit; + until False; +end; + +function TcxCustomVerticalGrid.LastRow: TcxCustomRow; +begin + if Rows.Count > 0 then + Result := Rows.GetRow(Rows.Count - 1) + else + Result := nil; +end; + +function TcxCustomVerticalGrid.LastVisibleRow: TcxCustomRow; +var + I: Integer; + ARow: TcxCustomRow; +begin + Result := nil; + for I := Rows.Count - 1 downto 0 do + begin + ARow := Rows.GetRow(I); + if IsRowVisible(ARow) then + begin + Result := ARow; + break; + end; + end; +end; + +function TcxCustomVerticalGrid.NextRow(ARow: TcxCustomRow): TcxCustomRow; +var + AIndex: Integer; +begin + Rows.CheckList; + if ARow = nil then + Result := FirstRow + else + begin + AIndex := Rows.FList.IndexOf(ARow) + 1; + if (AIndex > 0) and (AIndex < Rows.Count) then + Result := Rows[AIndex] + else + Result := nil; + end; +end; + +function TcxCustomVerticalGrid.NextVisibleRow( + ARow: TcxCustomRow): TcxCustomRow; +var + I, AIndex: Integer; +begin + Rows.CheckList; + if ARow = nil then + Result := FirstVisibleRow + else + begin + Result := nil; + AIndex := Rows.FList.IndexOf(ARow) + 1; + if AIndex > 0 then + for I := AIndex to Rows.Count - 1 do + begin + ARow := Rows[I]; + if IsRowVisible(ARow) then + begin + Result := ARow; + break; + end; + end; + end; +end; + +function TcxCustomVerticalGrid.PrevRow(ARow: TcxCustomRow): TcxCustomRow; +var + AIndex: Integer; +begin + Rows.CheckList; + if ARow = nil then + Result := LastRow + else + begin + AIndex := Rows.FList.IndexOf(ARow); + if (AIndex > 0) then Result := Rows[AIndex - 1] else Result := nil; + end; +end; + +function TcxCustomVerticalGrid.PrevVisibleRow(ARow: TcxCustomRow): TcxCustomRow; +var + I, AIndex: Integer; +begin + Rows.CheckList; + if ARow = nil then + Result := LastVisibleRow + else + begin + Result := nil; + AIndex := Rows.FList.IndexOf(ARow); + if AIndex > 0 then + for I := AIndex - 1 downto 0 do + begin + ARow := Rows[I]; + if IsRowVisible(ARow) then + begin + Result := ARow; + break; + end; + end; + end; +end; + +procedure TcxCustomVerticalGrid.Remove(ARow: TcxCustomRow); +begin + FreeAndNil(ARow); +end; + +function TcxCustomVerticalGrid.RowByCaption(const ACaption: string): TcxCustomRow; + + function CheckCaption(ARow: TcxCustomRow): Boolean; + var + I: Integer; + begin + if ARow.FProperties is TcxCaptionRowProperties then + with TcxCaptionRowProperties(ARow.FProperties) do + Result := CompareText(Caption, ACaption) = 0 + else + begin + Result := False; + if ARow.FProperties is TcxMultiEditorRowProperties then + with TcxMultiEditorRowProperties(ARow.FProperties) do + for I := 0 to Editors.Count - 1 do + if CompareText(Editors[I].Caption, ACaption) = 0 then + begin + Result := True; + break + end; + end; + end; + +var + I: Integer; + ARow: TcxCustomRow; +begin + Result := nil; + for I := 0 to Rows.Count - 1 do + begin + ARow := Rows[I]; + if CheckCaption(ARow) then + begin + Result := ARow; + break; + end; + end; +end; + +function TcxCustomVerticalGrid.RowByName(const AName: string): TcxCustomRow; +var + I: Integer; + ARow: TcxCustomRow; +begin + Result := nil; + for I := 0 to Rows.Count - 1 do + begin + ARow := Rows[I]; + if CompareText(ARow.Name, AName) = 0 then + begin + Result := ARow; + break; + end; + end; +end; + +procedure TcxCustomVerticalGrid.RestoreFromIniFile(const AStorageName: string); +var + AStorage: TcxStorage; +begin + FNewLoadMode := False; + AStorage := TcxStorage.Create(AStorageName); + try + BeginUpdate; + BeforeLoadedRows; + try + AStorage.Modes := [smChildrenCreating]; + AStorage.RestoreFromIni(Self); + AfterLoadedRows; + finally + EndUpdate; + end; + finally + AStorage.Free; + end; +end; + +procedure TcxCustomVerticalGrid.RestoreFromRegistry(const AStorageName: string); +var + AStorage: TcxStorage; +begin + FNewLoadMode := False; + AStorage := TcxStorage.Create(AStorageName); + try + BeginUpdate; + BeforeLoadedRows; + try + AStorage.Modes := [smChildrenCreating]; + AStorage.RestoreFromRegistry(Self); + AfterLoadedRows; + finally + EndUpdate; + end; + finally + AStorage.Free; + end; +end; + +procedure TcxCustomVerticalGrid.RestoreFromStream(AStream: TStream); +var + AStorage: TcxStorage; +begin + FNewLoadMode := False; + AStorage := TcxStorage.Create(AStream); + try + BeginUpdate; + BeforeLoadedRows; + try + AStorage.Modes := [smChildrenCreating]; + AStorage.RestoreFromStream(Self); + AfterLoadedRows; + finally + EndUpdate; + end; + finally + AStorage.Free; + end; +end; + +procedure TcxCustomVerticalGrid.StoreToIniFile(const AStorageName: string; + AReCreate: Boolean = True); +var + AStorage: TcxStorage; +begin + FNewLoadMode := True; + AStorage := TcxStorage.Create(AStorageName); + try + BeginUpdate; + try + AStorage.ReCreate := AReCreate; + AStorage.StoreToIni(Self); + finally + EndUpdate; + end; + finally + AStorage.Free; + end; +end; + +procedure TcxCustomVerticalGrid.StoreToRegistry(const AStorageName: string; + AReCreate: Boolean = True); +var + AStorage: TcxStorage; +begin + FNewLoadMode := True; + AStorage := TcxStorage.Create(AStorageName); + try + BeginUpdate; + try + AStorage.ReCreate := AReCreate; + AStorage.StoreToRegistry(Self); + finally + EndUpdate; + end; + finally + AStorage.Free; + end; +end; + +procedure TcxCustomVerticalGrid.StoreToStream(AStream: TStream); +var + AStorage: TcxStorage; +begin + FNewLoadMode := True; + AStorage := TcxStorage.Create(AStream); + try + BeginUpdate; + try + AStorage.StoreToStream(Self); + finally + EndUpdate; + end; + finally + AStorage.Free; + end; +end; + +procedure TcxCustomVerticalGrid.CancelEdit; +begin + Controller.EditingController.HideEdit(False); +end; + +procedure TcxCustomVerticalGrid.HideEdit; +begin + Controller.EditingController.HideEdit(True); +end; + +procedure TcxCustomVerticalGrid.ShowEdit; +begin + if not OptionsData.Editing then Exit; + DataController.Edit; + if CanFocusEx then SetFocus; + Controller.EditingController.ShowEdit; +end; + +procedure TcxCustomVerticalGrid.ShowEditByKey(AKey: Char); +begin + if not OptionsData.Editing then Exit; + DataController.Edit; + if CanFocusEx then SetFocus; + with Controller do + EditingController.ShowEdit(FocusedItem, AKey); +end; + +procedure TcxCustomVerticalGrid.ShowEditByMouse(X, Y: Integer; AShift: TShiftState); +begin + if not OptionsData.Editing then Exit; + DataController.Edit; + if CanFocusEx then SetFocus; + with Controller do + EditingController.ShowEdit(FocusedItem, AShift, X, Y); +end; + +procedure TcxCustomVerticalGrid.RestoreDefaults; +begin + BeginUpdate; + try + OptionsBehavior.RestoreDefaults; + OptionsView.RestoreDefaults; + Rows.RestoreDefaults; + finally + EndUpdate; + end; + Modified; +end; + +function TcxCustomVerticalGrid.GetObjectName: string; +begin + if FStoringName <> '' then + Result := FStoringName + else + Result := Name; +end; + +function TcxCustomVerticalGrid.GetProperties(AProperties: TStrings): Boolean; +begin + with AProperties do + begin + Add('PaintStyle'); + Add('HeaderWidth'); + Add('ValueWidth'); + Add('NewLoad'); + end; + Result := True; +end; + +procedure TcxCustomVerticalGrid.GetPropertyValue(const AName: string; + var AValue: Variant); +begin + if AName = 'PaintStyle' then + AValue := OptionsView.PaintStyle + else + if AName = 'HeaderWidth' then + AValue := OptionsView.RowHeaderWidth + else + if AName = 'ValueWidth' then + AValue := OptionsView.ValueWidth + else + if AName = 'NewLoad' then + AValue := 1 + else + AValue := Null; +end; + +procedure TcxCustomVerticalGrid.SetPropertyValue(const AName: string; + const AValue: Variant); +begin + if AName = 'PaintStyle' then + OptionsView.PaintStyle := AValue + else + if AName = 'HeaderWidth' then + OptionsView.RowHeaderWidth := AValue + else + if AName = 'ValueWidth' then + OptionsView.ValueWidth := AValue + else + if AName = 'NewLoad' then + FNewLoadMode := True; +end; + +function TcxCustomVerticalGrid.CreateChild( + const AObjectName, AClassName: string): TObject; +var + ARow: TcxCustomRow; +begin + if CompareText(AClassName, 'TcxCategoryRow') = 0 then + begin + ARow := Add(TcxCategoryRow); + ARow.Name := CreateUniqueName(Owner, Self, ARow, 'Tcx', 'RuntimeCreatedRow'); + Result := ARow; + end + else + Result := nil; +end; + +procedure TcxCustomVerticalGrid.DeleteChild(const AObjectName: string; + AObject: TObject); +begin +end; + +procedure TcxCustomVerticalGrid.GetStoredChildren(AChildren: TStringList); + + function GetStoredRowName(ARow: TcxCustomRow): string; + begin + if FNewLoadMode then + Result := ARow.GetObjectName + else + Result := ''; + end; + +var + I: Integer; +begin + with Rows do + for I := 0 to Count - 1 do + AChildren.AddObject(GetStoredRowName(Items[I]), Items[I]) +end; + +procedure TcxCustomVerticalGrid.DoEndDrag(Target: TObject; X, Y: Integer); +begin + inherited DoEndDrag(Target, X, Y); + DragCursor := FSaveDragCursor; +end; + +procedure TcxCustomVerticalGrid.GetChildren(Proc: TGetChildProc; Root: TComponent); +begin + FRootRow.GetChildren(Proc, Root); +end; + +procedure TcxCustomVerticalGrid.Loaded; +var + ASaveLock: Boolean; +begin + // need a lock for AutoScaleBands and changing visibility HScrollBar + ASaveLock := ViewInfo.FLockDividerPos; + ViewInfo.FLockDividerPos := True; + try + inherited Loaded; + with OptionsBehavior do + if not FAlwaysShowEditorAssigned then + InternalSetAlwaysShowEditor(AlwaysShowEditor); + finally + ViewInfo.FLockDividerPos := ASaveLock; + LayoutChanged; + end; +end; + +procedure TcxCustomVerticalGrid.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + if (Operation = opRemove) and (AComponent = Images) then + Images := nil; +end; + +function cxVerticalGridGetItem(ACaller: TComponent; + Index: Integer): TComponent; +begin + Result := TcxCustomVerticalGrid(ACaller).Rows[Index]; +end; + +procedure TcxCustomVerticalGrid.SetName(const Value: TComponentName); +var + AOldName: TComponentName; +begin + AOldName := Name; + inherited SetName(Value); + if (Name <> AOldName) and (Name <> '') then + begin + RenameComponents(Self, Owner, Name, AOldName, Rows.Count, @cxVerticalGridGetItem); + if not IsLoading and (Rows.Count > 0) then + LayoutChanged; + end; +end; + +procedure TcxCustomVerticalGrid.BoundsChanged; +begin + if CreatingWindow then //SC B92213 + LockScrollBars; + try + inherited BoundsChanged; + CheckGridModeBufferCount; + LayoutChanged; + finally + if CreatingWindow then //SC B92213 + UnlockScrollBars; + end; +end; + +procedure TcxCustomVerticalGrid.FontChanged; +begin + Inc(FLockUpdate); + try + inherited FontChanged; + FCategoryFont.Assign(Font); + FCategoryFont.Style := Font.Style + [fsBold]; + finally + Dec(FLockUpdate); + LayoutChanged; + end; +end; + +procedure TcxCustomVerticalGrid.InitControl; +begin + ViewInfo.FLockDividerPos := False; + inherited InitControl; +end; + +procedure TcxCustomVerticalGrid.LookAndFeelChanged(Sender: TcxLookAndFeel; + AChangedValues: TcxLookAndFeelValues); +begin + inherited LookAndFeelChanged(Sender, AChangedValues); + if lfvSkinName in AChangedValues then + begin + if ViewInfo <> nil then RecreateViewInfo; + if Controller <> nil then Controller.UpdatePaintStyle; + OptionsView.CheckRowHeaderWidth; + OptionsView.Changed; + end; + if OptionsView.CellAutoHeight then + LayoutChanged; +end; + +function TcxCustomVerticalGrid.GetDragObjectClass: TDragControlObjectClass; +begin + Result := nil; +end; + +procedure TcxCustomVerticalGrid.CreateSubClasses; +begin + FRows := TcxVerticalGridRows.Create(Self); + FRootRow := TcxCategoryRow.Create(nil); + FRootRow.FParent := nil; + FRootRow.FVerticalGrid := Self; + FRootRow.FID := -1; + inherited CreateSubClasses; + InitDataController; + FCustomizing := GetCustomizingClass.Create(Self); +end; + +procedure TcxCustomVerticalGrid.DataChanged; +begin + if FLockUpdate > 0 then Exit; + Inc(FLockUpdate); + try + inherited DataChanged; + finally + Dec(FLockUpdate); + LayoutChanged; + end; + Controller.MakeFocusedRecordVisible; +end; + +procedure TcxCustomVerticalGrid.DestroySubClasses; +begin + FreeAndNil(FCustomizing); + FreeAndNil(FRootRow); + FreeAndNil(FRows); + inherited DestroySubClasses; +end; + +procedure TcxCustomVerticalGrid.DoEdited( + AItem: TcxCustomInplaceEditContainer); +begin + if Assigned(FOnEdited) then + FOnEdited(Self, TcxCellEdit(AItem).EditRowProperties); +end; + +function TcxCustomVerticalGrid.DoEditing( + AItem: TcxCustomInplaceEditContainer): Boolean; +begin + Result := True; + if Assigned(FOnEditing) then + FOnEditing(Self, TcxCellEdit(AItem).EditRowProperties, Result); +end; + +procedure TcxCustomVerticalGrid.DoEditValueChanged( + AItem: TcxCustomInplaceEditContainer); +begin + if Assigned(FOnEditValueChanged) then + if AItem <> nil then + FOnEditValueChanged(Self, TcxCellEdit(AItem).EditRowProperties) + else + FOnEditValueChanged(Self, nil); +end; + +procedure TcxCustomVerticalGrid.DoInplaceEditContainerItemRemoved( + AItem: TcxCustomInplaceEditContainer); +begin + try + ContainerList.Remove(AItem); + DataController.RemoveItem(AItem); + UpdateIndexes; + finally + if not (AItem.Owner is TcxCustomMultiEditorRow) then + // for correct work with collection + LayoutChanged; + end; +end; + +procedure TcxCustomVerticalGrid.DoLayoutChanged; +begin + if csUpdating in ComponentState then exit; + ViewInfo.Calculate; + if Controller <> nil then + with Controller.Scroller do + begin + CheckDecrease := True; + CheckDecreaseLeftIndex; + CheckDecreaseTopIndex; + end; + if Customizing.Visible then + Customizing.Update; + if Assigned(FOnLayoutChanged) then + FOnLayoutChanged(Self); +end; + +function TcxCustomVerticalGrid.DragDropImageDisplayRect: TRect; +begin + Result := DragHeaderInfo.HeaderCellsRect; +end; + +procedure TcxCustomVerticalGrid.DrawDragDropImage(ADragBitmap: TBitmap; + ACanvas: TcxCanvas); +var + AHeaderInfo: TcxCustomRowHeaderInfo; + ASaveCanvas: TcxCanvas; + ASaveOrg: TPoint; +begin + ASaveCanvas := Painter.FCanvas; + AHeaderInfo := DragHeaderInfo; + Painter.FCanvas := ACanvas; + try + ASaveOrg := ACanvas.WindowOrg; + ACanvas.WindowOrg := AHeaderInfo.HeaderCellsRect.TopLeft; + Painter.DrawHeaderDragImage(AHeaderInfo); + finally + ACanvas.WindowOrg := ASaveOrg; + Painter.FCanvas := ASaveCanvas; + end; +end; + +function TcxCustomVerticalGrid.GetControllerClass: TcxCustomControlControllerClass; +begin + Result := TcxvgController; +end; + +function TcxCustomVerticalGrid.GetControlStylesClass: TcxCustomControlStylesClass; +begin + Result := TcxVerticalGridStyles; +end; + +function TcxCustomVerticalGrid.GetDragImageHelperClass: TcxDragImageHelperClass; +begin + Result := TcxvgDragImageHelper; +end; + +function TcxCustomVerticalGrid.GetEditCellDataBindingClass: TcxItemDataBindingClass; +begin + Result := TcxItemDataBinding; +end; + +function TcxCustomVerticalGrid.GetHitTestControllerClass: TcxHitTestControllerClass; +begin + Result := TcxvgHitTest; +end; + +function TcxCustomVerticalGrid.GetOptionsBehaviorClass: TcxControlOptionsBehaviorClass; +begin + Result := TcxvgOptionsBehavior; +end; + +function TcxCustomVerticalGrid.GetOptionsViewClass: TcxControlOptionsViewClass; +begin + Result := TcxvgOptionsView; +end; + +function TcxCustomVerticalGrid.GetPainterClass: TcxCustomControlPainterClass; +begin + if OptionsView.PaintStyle = psdotNet then + Result := TcxvgPainter + else + Result := TcxStyle3DPainter +end; + +function TcxCustomVerticalGrid.HasDragDropImages: Boolean; +begin + Result := DragHeaderInfo <> nil; +end; + +procedure TcxCustomVerticalGrid.RecreateViewInfo; +var + AIndex: Integer; +begin + if ViewInfo <> nil then + begin + HideEdit; + AIndex := Controller.Scroller.TopVisibleRowIndex; + Inc(FLockUpdate); + try + inherited RecreateViewInfo; + finally + Dec(FLockUpdate); + Controller.Scroller.TopVisibleRowIndex := AIndex; + Controller.CheckEdit; + end; + end + else + inherited RecreateViewInfo; +end; + +procedure TcxCustomVerticalGrid.InitDataController; +begin + DataController.AppendRecord; + Controller.FocusedRecordIndex := 0; +end; + +procedure TcxCustomVerticalGrid.RemoveRowFromVerticalGrid(ARow: TcxCustomRow); +begin + Inc(FLockUpdate); + try + if not IsDestroying then + begin + if IsDesigning and (Controller.DesignSelectionHelper <> nil) then + Controller.DesignSelectionHelper.UnselectObject(ARow); + if ARow = FocusedRow then Controller.Clear; + end; + Rows.Remove(ARow); + ARow.RemoveChildren; + finally + Dec(FLockUpdate); + end; + LayoutChanged; +end; + +procedure TcxCustomVerticalGrid.AfterLoadedRows; + + procedure SetupIndexes(ARow: TcxCustomRow); + var + I, AIndex: Integer; + begin + if ARow.Count > 0 then + begin + AIndex := 0; + repeat + for I := AIndex to ARow.Count - 1 do + if ARow.Rows[I].FLoadingIndex = AIndex then + begin + ARow.Rows[I].Index := AIndex; + break; + end; + Inc(AIndex); + until AIndex = ARow.Count; + for I := 0 to ARow.Count - 1 do + SetupIndexes(ARow.Rows[I]); + end; + end; + +var + L: TList; + I: Integer; + ARow: TcxCustomRow; +begin + if not FNewLoadMode then Exit; + L := TList.Create; + try + Rows.PrepareList; + {$IFDEF DELPHI6} + L.Assign(Rows.FList); + {$ELSE} + L.Capacity := Rows.FList.Capacity; + for I := 0 to Rows.FList.Count - 1 do + L.Add(Rows.FList[I]); + {$ENDIF} + for I := 0 to L.Count - 1 do + begin + ARow := L[I]; + if ARow.FLoadingIndex <> MaxInt then + ARow.Parent := Rows.FindRowByStoredName(ARow.FLoadingParent); + end; + SetupIndexes(FRootRow); + finally + L.Free; + end; +end; + +procedure TcxCustomVerticalGrid.BeforeLoadedRows; +var + I: Integer; +begin + Rows.PrepareList; + for I := 0 to Rows.Count - 1 do + Rows[I].FLoadingIndex := MaxInt; +end; + +function TcxCustomVerticalGrid.CanBandSizing: Boolean; +begin + Result := OptionsBehavior.BandSizing and not OptionsView.AutoScaleBands; +end; + +procedure TcxCustomVerticalGrid.CheckRowClass(ARowClass: TcxCustomRowClass); +begin + if (ARowClass = nil) or not (ARowClass.InheritsFrom(GetEditorRowClass) or + ARowClass.InheritsFrom(TcxCategoryRow) or ARowClass.InheritsFrom(GetMultiEditorRowClass)) then + cxVerticalGridError(cxGetResourceString(@cxSvgInvalidRowClass)); +end; + +procedure TcxCustomVerticalGrid.CheckGridModeBufferCount; +var + AIntf: IcxVerticalGridDBDataContoller; +begin + if (DataController <> nil) and DataController.IsGridMode and + DataController.GetInterface(IcxVerticalGridDBDataContoller, AIntf) then + AIntf.CheckGridModeBufferCount; +end; + +procedure TcxCustomVerticalGrid.DoCustomizationVisibleChanged; +begin + if Assigned(FOnCustomizationVisibleChanged) then + FOnCustomizationVisibleChanged(Self); +end; + +function TcxCustomVerticalGrid.DoDrawBackgroundPart(const R: TRect; + const AViewParams: TcxViewParams): Boolean; +begin + Result := False; + if Assigned(FOnDrawBackground) then + FOnDrawBackground(Self, TcxvgPainter(Painter).Canvas, R, AViewParams, Result); +end; + +function TcxCustomVerticalGrid.DoDrawRowHeader( + AHeaderViewInfo: TcxCustomRowHeaderInfo): Boolean; +begin + Result := False; + if Assigned(FOnDrawRowHeader) then + FOnDrawRowHeader(Self, TcxvgPainter(Painter).Canvas, TcxvgPainter(Painter), + AHeaderViewInfo, Result); +end; + +function TcxCustomVerticalGrid.DoDrawValue( + AValueInfo: TcxRowValueInfo): Boolean; +begin + Result := False; + if Assigned(FOnDrawValue) then + FOnDrawValue(Self, TcxvgPainter(Painter).Canvas, TcxvgPainter(Painter), + AValueInfo, Result); +end; + +procedure TcxCustomVerticalGrid.DoItemChanged(AOldRow: TcxCustomRow; + AOldCellIndex: Integer); +begin + if Assigned(FOnItemChanged) then + FOnItemChanged(Self, AOldRow, AOldCellIndex); +end; + +procedure TcxCustomVerticalGrid.DoLeftVisibleBandIndexChanged; +begin + if Assigned(FOnLeftVisibleBandIndexChanged) then + FOnLeftVisibleBandIndexChanged(Self); +end; + +procedure TcxCustomVerticalGrid.DoLeftVisibleRecordIndexChanged; +begin + if Assigned(FOnLeftVisibleRecordIndexChanged) then + FOnLeftVisibleRecordIndexChanged(Self); +end; + +procedure TcxCustomVerticalGrid.DoTopRowIndexChanged; +begin + if Assigned(FOnTopRowIndexChanged) then + FOnTopRowIndexChanged(Self); +end; + +function TcxCustomVerticalGrid.GetCalcHelperClass: TcxvgCustomPaintStyleCalcHelperClass; +begin + if LookAndFeel.SkinPainter <> nil then + Result := TcxvgSkinCalcHelper + else + if OptionsView.PaintStyle = psDotNet then + Result := TcxvgDotNetStyleCalcHelper + else + Result := TcxvgStyle3DCalcHelper +end; + +function TcxCustomVerticalGrid.GetCellAutoHeight: Boolean; +begin + Result := OptionsView.CellAutoHeight; +end; + +function TcxCustomVerticalGrid.GetCustomizingClass: TcxVerticalGridCustomizingClass; +begin + Result := TcxVerticalGridCustomizing; +end; + +procedure TcxCustomVerticalGrid.GetDefaultViewParams(Index: Integer; + AData: TObject; out AParams: TcxViewParams); + + function CalcHelper: TcxvgCustomPaintStyleCalcHelper; + begin + Result := ViewInfo.CalcHelper; + end; + +begin + with AParams do + begin + Font := Self.Font; + TextColor := Font.Color; + Bitmap := nil; + case Index of + vgs_Content: + begin + Color := CalcHelper.GetContentColor(PcxvgContentParamsData(AData)^.Focused); + TextColor := CalcHelper.GetContentTextColor; + end; + vgs_Header: + begin + Color := CalcHelper.GetHeaderColor; + TextColor := CalcHelper.GetHeaderTextColor; + end; + vgs_Category: + begin + Font := FCategoryFont; + Color := CalcHelper.GetCategoryColor; + TextColor := CalcHelper.GetCategoryTextColor; + end; + vgs_IncSearch: + begin + Color := clDefault; + TextColor := clDefault; + end; + ecs_Background: + begin + Color := CalcHelper.GetBackgroundColor; + with Styles do + if (Background <> nil) and (Background.Bitmap <> nil) and not Background.Bitmap.Empty then + Bitmap := Background.Bitmap; + end; + else + Styles.CallInheritedDefaultViewParams(Index, nil, AParams); + end; + end; +end; + +function TcxCustomVerticalGrid.GetEditorRowClass: TcxCustomRowClass; +begin + Result := TcxEditorRow; +end; + +function TcxCustomVerticalGrid.GetMultiEditorRowClass: TcxCustomRowClass; +begin + Result := TcxMultiEditorRow; +end; + +procedure TcxCustomVerticalGrid.RowsChanged; +begin + if IsLocked then + begin + if ViewInfo <> nil then + ViewInfo.UpdateVisibleRows; + end + else + LayoutChanged; +end; + +procedure TcxCustomVerticalGrid.UpdateDesignEditor; +begin + if not IsLocked and IsDesigning then + begin + LayoutChanged; + Modified; + end; +end; + +procedure TcxCustomVerticalGrid.CategoryFontChanged(Sender: TObject); +begin + LayoutChanged; +end; + +function TcxCustomVerticalGrid.GetController: TcxvgController; +begin + Result := TcxvgController(FController) +end; + +function TcxCustomVerticalGrid.GetDragHeaderInfo: TcxCustomRowHeaderInfo; +begin + with Controller do + if DragRow <> nil then + Result := DragRow.ViewInfo.HeaderInfo + else + Result := nil; +end; + +function TcxCustomVerticalGrid.GetFocusedRow: TcxCustomRow; +begin + Result := Controller.FocusedRow; +end; + +function TcxCustomVerticalGrid.GetHitTest: TcxvgHitTest; +begin + Result := TcxvgHitTest(Controller.HitTestController); +end; + +function TcxCustomVerticalGrid.GetInplaceEditor: TcxCustomEdit; +begin + if IsEditing then + Result := Controller.EditingController.Edit + else + Result := nil; +end; + +function TcxCustomVerticalGrid.GetIsEditing: Boolean; +begin + Result := Controller.IsEditing; +end; + +function TcxCustomVerticalGrid.GetLeftVisibleBand: Integer; +begin + Result := Controller.Scroller.LeftVisibleBand; +end; + +function TcxCustomVerticalGrid.GetLeftVisibleRecord: Integer; +begin + Result := Controller.Scroller.LeftVisibleRecord; +end; + +function TcxCustomVerticalGrid.GetOptionsBehavior: TcxvgOptionsBehavior; +begin + Result := TcxvgOptionsBehavior(inherited OptionsBehavior); +end; + +function TcxCustomVerticalGrid.GetOptionsView: TcxvgOptionsView; +begin + Result := TcxvgOptionsView(inherited OptionsView); +end; + +function TcxCustomVerticalGrid.GetPainter: TcxvgPainter; +begin + Result := TcxvgPainter(inherited Painter); +end; + +function TcxCustomVerticalGrid.GetRecordCount: Integer; +begin + Result := DataController.RowCount; +end; + +function TcxCustomVerticalGrid.GetStyles: TcxVerticalGridStyles; +begin + Result := TcxVerticalGridStyles(inherited Styles); +end; + +function TcxCustomVerticalGrid.GetTopVisibleRowIndex: Integer; +begin + Result := Controller.Scroller.TopVisibleRowIndex; +end; + +function TcxCustomVerticalGrid.GetViewInfo: TcxvgCustomViewInfo; +begin + Result := TcxvgCustomViewInfo(inherited ViewInfo); +end; + +procedure TcxCustomVerticalGrid.ImageListChange(Sender: TObject); +begin + if HandleAllocated and (Sender = Images) then + LayoutChanged; +end; + +procedure TcxCustomVerticalGrid.SetFocusedRow(Value: TcxCustomRow); +begin + with Controller do + begin + FocusedRow := Value; + MakeRowVisible(FocusedRow); + end; +end; + +procedure TcxCustomVerticalGrid.SetImages(Value: TCustomImageList); +begin + BeginUpdate; + try + cxSetImageList(Value, FImages, FImageChangeLink, Self); + finally + EndUpdate; + end; +end; + +procedure TcxCustomVerticalGrid.SetLeftVisibleBand(Value: Integer); +begin + if ViewInfo <> nil then ViewInfo.Calculate; + Controller.Scroller.LeftVisibleBand := Value; +end; + +procedure TcxCustomVerticalGrid.SetLeftVisibleRecord(Value: Integer); +begin + if ViewInfo <> nil then ViewInfo.Calculate; + Controller.Scroller.LeftVisibleRecord := Value; +end; + +procedure TcxCustomVerticalGrid.SetOptionsBehavior(Value: TcxvgOptionsBehavior); +begin + OptionsBehavior.Assign(Value); +end; + +procedure TcxCustomVerticalGrid.SetOptionsView(Value: TcxvgOptionsView); +begin + OptionsView.Assign(Value); +end; + +procedure TcxCustomVerticalGrid.SetStyles(Value: TcxVerticalGridStyles); +begin + Styles.Assign(Value); +end; + +procedure TcxCustomVerticalGrid.SetTopVisibleRowIndex(Value: Integer); +begin + if ViewInfo <> nil then ViewInfo.Calculate; + Controller.Scroller.TopVisibleRowIndex := Value; +end; + +procedure TcxCustomVerticalGrid.CMDrag(var Message: TCMDrag); +const + AcceptedCursors: array[Boolean] of TCursor = (crDrag, crDragCopy); +begin + if Controller.DragRow = nil then + DragCursor := AcceptedCursors[IsCtrlPressed]; + inherited; +end; + +{ TcxUnboundVerticalGrid } + +constructor TcxUnboundVerticalGrid.Create(AOwner: TComponent); +begin + FLayoutStyle := ulsSingleRecordView; + inherited Create(AOwner); +end; + +function TcxUnboundVerticalGrid.CanBandSizing: Boolean; +begin + Result := (FLayoutStyle <> ulsSingleRecordView) and inherited CanBandSizing; +end; + +function TcxUnboundVerticalGrid.GetScrollStrategyClass: TcxvgCustomScrollStrategyClass; +begin + if FLayoutStyle = ulsSingleRecordView then + Result := TcxvgSingleRecordScrollStrategy + else + Result := TcxvgBandsScrollStrategy; +end; + +function TcxUnboundVerticalGrid.GetViewInfoClass: TcxCustomControlViewInfoClass; +begin + if FLayoutStyle = ulsSingleRecordView then + Result := TcxInspectorViewInfo + else + Result := TcxBandsViewInfo; +end; + +procedure TcxUnboundVerticalGrid.SetLayoutStyle(Value: TcxvgUnboundLayoutStyle); +begin + if FLayoutStyle <> Value then + begin + FLayoutStyle := Value; + RecreateViewInfo; + ViewInfo.LayoutStyleChanged; + end; +end; + +{ TcxVirtualVerticalGrid } + +constructor TcxVirtualVerticalGrid.Create(AOwner: TComponent); +begin + FLayoutStyle := lsSingleRecordView; + inherited Create(AOwner); +end; + +procedure TcxVirtualVerticalGrid.Assign(Source: TPersistent); +begin + if Source is TcxVirtualVerticalGrid then + with TcxVirtualVerticalGrid(Source) do + begin + Self.BeginUpdate; + inherited Assign(Source); + try + Self.LayoutStyle := LayoutStyle; + finally + Self.EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +function TcxVirtualVerticalGrid.GetFilterCaption(Index: Integer): string; +var + AElement: TcxCustomEditorRowProperties; +begin + AElement := GetFilterElementProperties(Index); + if AElement = nil then + Result := '' + else + Result := AElement.Caption; +end; + +function TcxVirtualVerticalGrid.GetFilterCount: Integer; +var + I, J: Integer; + ARow: TcxCustomRow; + AEditContainer: TcxCellEdit; +begin + Result := 0; + for I := 0 to Rows.Count - 1 do + begin + ARow := Rows[I]; + for J := 0 to ARow.GetEditContainerCount - 1 do + begin + AEditContainer := ARow.GetEditContainer(J); + if TcxEditorRowPropertiesOptions(AEditContainer.Options).Filtering and + (esoFiltering in AEditContainer.PropertiesValue.GetSupportedOperations) then + Inc(Result); + end; + end; +end; + +function TcxVirtualVerticalGrid.GetFilterCriteria: TcxFilterCriteria; +begin + Result := DataController.Filter; +end; + +function TcxVirtualVerticalGrid.GetFilterFieldName(Index: Integer): string; +begin + Result := ''; +end; + +function TcxVirtualVerticalGrid.GetFilterItemLink(Index: Integer): TObject; +var + AElement: TcxCustomEditorRowProperties; +begin + AElement := GetFilterElementProperties(Index); + if AElement = nil then + Result := nil + else + Result := TObject(AElement.FEditContainer); +end; + +function TcxVirtualVerticalGrid.GetFilterItemLinkID(Index: Integer): Integer; +var + AElement: TcxCustomEditorRowProperties; +begin + AElement := GetFilterElementProperties(Index); + if AElement = nil then + Result := -1 + else + Result := AElement.FEditContainer.ItemIndex; +end; + +function TcxVirtualVerticalGrid.GetItemLinkName(Index: Integer): string; +var + AElement: TcxCustomEditorRowProperties; +begin + AElement := GetFilterElementProperties(Index); + if AElement = nil then + Result := '' + else + Result := 'Item' + IntToStr(AElement.ID); +end; + +function TcxVirtualVerticalGrid.GetFilterProperties(Index: Integer): TcxCustomEditProperties; +var + AElement: TcxCustomEditorRowProperties; +begin + AElement := GetFilterElementProperties(Index); + if AElement = nil then + Result := nil + else + Result := AElement.FEditContainer.PropertiesValue; +end; + +function TcxVirtualVerticalGrid.GetFilterValueType(Index: Integer): TcxValueTypeClass; +var + AElement: TcxCustomEditorRowProperties; +begin + AElement := GetFilterElementProperties(Index); + if AElement = nil then + Result := nil + else + Result := AElement.FEditContainer.GetEditDataValueTypeClass; +end; + +function TcxVirtualVerticalGrid.NavigatorCanAppend: Boolean; +begin + Result := Controller.CanAppend(True); +end; + +function TcxVirtualVerticalGrid.NavigatorCanDelete: Boolean; +begin + Result := Controller.CanDelete(True); +end; + +function TcxVirtualVerticalGrid.NavigatorCanEdit: Boolean; +begin + Result := OptionsData.Editing; +end; + +function TcxVirtualVerticalGrid.NavigatorCanInsert: Boolean; +begin + Result := Controller.CanInsert(True); +end; + +function TcxVirtualVerticalGrid.NavigatorIsActive: Boolean; +begin + Result := DataController.Active; +end; + +function TcxVirtualVerticalGrid.NavigatorIsBof: Boolean; +begin + Result := DataController.IsBOF; +end; + +function TcxVirtualVerticalGrid.NavigatorIsBookmarkAvailable: Boolean; +begin + Result := DataController.IsBookmarkAvailable; +end; + +function TcxVirtualVerticalGrid.NavigatorIsEditing: Boolean; +begin + Result := DataController.IsEditing; +end; + +function TcxVirtualVerticalGrid.NavigatorIsEof: Boolean; +begin + Result := DataController.IsEOF; +end; + +procedure TcxVirtualVerticalGrid.NavigatorClearBookmark; +begin + DataController.ClearBookmark; +end; + +procedure TcxVirtualVerticalGrid.NavigatorDoAction(AButtonIndex: Integer); +begin + with DataController do + case AButtonIndex of + NBDI_FIRST: + GotoFirst; + NBDI_PRIORPAGE: + if LayoutStyle = lsMultiRecordView then + MoveBy(-Controller.Scroller.VisibleValueCount) + else + GotoPrev; + NBDI_PRIOR: + GotoPrev; + NBDI_NEXT: + GotoNext; + NBDI_NEXTPAGE: + if LayoutStyle = lsMultiRecordView then + MoveBy(Controller.Scroller.VisibleValueCount) + else + GotoNext; + NBDI_LAST: + GotoLast; + NBDI_APPEND: + Controller.AppendRecord; + NBDI_INSERT: + Controller.InsertRecord; + NBDI_DELETE: + Controller.DeleteSelection; + NBDI_EDIT: + ShowEdit; + NBDI_POST: + begin + PostEditingData; + Post; + end; + NBDI_CANCEL: + Cancel; + NBDI_REFRESH: + Refresh; + NBDI_SAVEBOOKMARK: + SaveBookmark; + NBDI_GOTOBOOKMARK: + GotoBookmark; + NBDI_FILTER: + DoFilterDialog; + end; +end; + +function TcxVirtualVerticalGrid.NavigatorGetNotifier: TcxNavigatorControlNotifier; +begin + Result := FNavigatorNotifier; +end; + +function TcxVirtualVerticalGrid.NavigatorIsActionSupported( + AButtonIndex: Integer): Boolean; +begin + Result := AButtonIndex in [NBDI_FIRST..NBDI_FILTER]; +end; + +procedure TcxVirtualVerticalGrid.RefreshNavigators; +begin + if not IsDestroying then FNavigatorNotifier.RefreshNavigatorButtons; +end; + +procedure TcxVirtualVerticalGrid.CreateSubClasses; +begin + inherited CreateSubClasses; + FNavigatorNotifier := TcxNavigatorControlNotifier.Create; +end; + +procedure TcxVirtualVerticalGrid.DestroySubClasses; +begin + FreeAndNil(FNavigatorNotifier); + inherited DestroySubClasses; +end; + +function TcxVirtualVerticalGrid.CanBandSizing: Boolean; +begin + Result := OptionsBehavior.BandSizing and + ((FLayoutStyle = lsMultiRecordView) or + ((FLayoutStyle = lsBandsView) and not OptionsView.AutoScaleBands)); +end; + +procedure TcxVirtualVerticalGrid.ControlUpdateData(AInfo: TcxUpdateControlInfo); +begin + if IsDestroying then Exit; + inherited ControlUpdateData(AInfo); + if (AInfo is TcxSearchChangedInfo) then + Controller.RefreshIncSearchItem; + RefreshNavigators; +end; + +procedure TcxVirtualVerticalGrid.DoFilterDialog; +begin + ExecuteFilterControlDialog(Self, LookAndFeel, ApplyFilter, OnFilterControlDialogShow); +end; + +procedure TcxVirtualVerticalGrid.DoFocusedRecordChanged( + APrevFocusedRecord, AFocusedRecord: Integer); +begin + if Assigned(FOnFocusedRecordChanged) then + FOnFocusedRecordChanged(Self, APrevFocusedRecord, AFocusedRecord); +end; + +function TcxVirtualVerticalGrid.GetCellAutoHeight: Boolean; +begin + Result := (FLayoutStyle <> lsMultiRecordView) and inherited GetCellAutoHeight; +end; + +function TcxVirtualVerticalGrid.GetControllerClass: TcxCustomControlControllerClass; +begin + Result := TcxvgMultiRecordsController; +end; + +function TcxVirtualVerticalGrid.GetOptionsBehaviorClass: TcxControlOptionsBehaviorClass; +begin + Result := TcxvgMultiRecordsOptionsBehavior; +end; + +function TcxVirtualVerticalGrid.GetOptionsDataClass: TcxControlOptionsDataClass; +begin + Result := TcxvgMultiRecordsOptionsData; +end; + +function TcxVirtualVerticalGrid.GetOptionsViewClass: TcxControlOptionsViewClass; +begin + Result := TcxvgMultiRecordsOptionsView; +end; + +procedure TcxVirtualVerticalGrid.InitDataController; +begin +end; + +procedure TcxVirtualVerticalGrid.DataLayoutChanged; +begin + if not DataController.IsGridMode then + inherited DataLayoutChanged + else + LayoutChanged; +end; + +function TcxVirtualVerticalGrid.GetScrollStrategyClass: TcxvgCustomScrollStrategyClass; +begin + case FLayoutStyle of + lsSingleRecordView: Result := TcxvgSingleRecordScrollStrategy; + lsBandsView: Result := TcxvgBandsScrollStrategy; + else + Result := TcxvgMultiRecordsScrollStrategy; + end; +end; + +function TcxVirtualVerticalGrid.GetViewInfoClass: TcxCustomControlViewInfoClass; +begin + case FLayoutStyle of + lsSingleRecordView: Result := TcxInspectorViewInfo; + lsBandsView: Result := TcxBandsViewInfo; + else + Result := TcxMultiRecordViewInfo; + end; +end; + +procedure TcxVirtualVerticalGrid.ApplyFilter(Sender: TObject); +begin + DataController.Filter.Active := True; +end; + +function TcxVirtualVerticalGrid.GetFilterElementProperties( + AIndex: Integer): TcxCustomEditorRowProperties; +var + I, J, K: Integer; + ARow: TcxCustomRow; + AEditContainer: TcxCellEdit; +begin + K := 0; + Result := nil; + for I := 0 to Rows.Count - 1 do + begin + ARow := Rows[I]; + for J := 0 to ARow.GetEditContainerCount - 1 do + begin + AEditContainer := ARow.GetEditContainer(J); + if TcxEditorRowPropertiesOptions(AEditContainer.Options).Filtering and + (esoFiltering in AEditContainer.PropertiesValue.GetSupportedOperations) then + begin + if K = AIndex then + begin + Result := AEditContainer.FEditRowProperties; + Exit; + end; + Inc(K); + end; + end; + end; +end; + +function TcxVirtualVerticalGrid.GetFilterRecordEvent: TcxDataFilterRecordEvent; +begin + Result := DataController.OnFilterRecord; +end; + +function TcxVirtualVerticalGrid.GetFocusedRecordIndex: Integer; +begin + Result := DataController.FocusedRowIndex; +end; + +function TcxVirtualVerticalGrid.GetController: TcxvgMultiRecordsController; +begin + Result := TcxvgMultiRecordsController(FController); +end; + +function TcxVirtualVerticalGrid.GetOptionsBehavior: TcxvgMultiRecordsOptionsBehavior; +begin + Result := TcxvgMultiRecordsOptionsBehavior(inherited OptionsBehavior); +end; + +function TcxVirtualVerticalGrid.GetOptionsData: TcxvgMultiRecordsOptionsData; +begin + Result := TcxvgMultiRecordsOptionsData(inherited OptionsData); +end; + +function TcxVirtualVerticalGrid.GetOptionsView: TcxvgMultiRecordsOptionsView; +begin + Result := TcxvgMultiRecordsOptionsView(inherited OptionsView); +end; + +procedure TcxVirtualVerticalGrid.SetFilterRecordEvent( + Value: TcxDataFilterRecordEvent); +begin + DataController.OnFilterRecord := Value; +end; + +procedure TcxVirtualVerticalGrid.SetFocusedRecordIndex(Value: Integer); +begin + DataController.FocusedRowIndex := Value; +end; + +procedure TcxVirtualVerticalGrid.SetLayoutStyle(Value: TcxvgLayoutStyle); +begin + if FLayoutStyle <> Value then + begin + FLayoutStyle := Value; + RecreateViewInfo; + ViewInfo.LayoutStyleChanged; + CheckGridModeBufferCount; + end; +end; + +procedure TcxVirtualVerticalGrid.SetOptionsBehavior( + Value: TcxvgMultiRecordsOptionsBehavior); +begin + inherited OptionsBehavior.Assign(Value); +end; + +procedure TcxVirtualVerticalGrid.SetOptionsData( + Value: TcxvgMultiRecordsOptionsData); +begin + inherited OptionsData.Assign(Value); +end; + +procedure TcxVirtualVerticalGrid.SetOptionsView( + Value: TcxvgMultiRecordsOptionsView); +begin + inherited OptionsView.Assign(Value); +end; + +{ TcxvgHitTest } + +function TcxvgHitTest.AllowDesignMouseEvents(X, Y: Integer; + AShift: TShiftState): Boolean; +begin + // we must use GetAsyncKeyState + if (GetAsyncKeyState(VK_CONTROL) < 0) or (GetAsyncKeyState(VK_MENU) < 0) then + begin + Result := False; + Exit; + end; + RecalculateOnMouseEvent(X, Y, AShift); + Result := (VerticalGrid.DragAndDropState <> ddsNone) or CanSizing or + HitAtRowHeader; +end; + +procedure TcxvgHitTest.CalcBandsHitTest(AViewInfo: TcxvgCustomViewInfo); +var + I: Integer; + R, CR: TRect; + ABandSizing, AHasDivider: Boolean; +begin + with AViewInfo do + begin + ABandSizing := VerticalGrid.CanBandSizing; + AHasDivider := (VerticalGrid.OptionsBehavior.HeaderSizing or + VerticalGrid.IsDesigning) and ShowHeaders; + CR := ClientRect; + for I := 0 to ViewRects.BandRects.Count - 1 do + begin + R := ViewRects.BandRects[I]; + if AHasDivider and (I = 0) then + begin + // calc divider pos + CR.Left := R.Left + ViewHeaderWidth; + CR.Right := CR.Left + DividerWidth + 2; + if Check(CR) then SetHitState(vghc_HitAtDivider, True); + end; + // calc first band right side + if (I = 0) and ABandSizing and Check(GetBandSizeableRect(R)) then + SetHitState(vghc_HitAtBandSizing, True); + if Check(R) then + begin + FHitBandIndex := I; + break; + end; + end; + end; + CalcRowsHitTest(AViewInfo); +end; + +function TcxvgHitTest.CalcCustomizingHitTest: Boolean; +begin + Result := False; + with VerticalGrid.Customizing do + begin + if not Visible then Exit; + Result := CanDrop(VerticalGrid.ClientToScreen(HitPoint)); + if Result then + SetHitState(vghc_HitAtCustomize, True); + end; +end; + +function TcxvgHitTest.CalcRowHeaderHitTest( + AHeaderInfo: TcxCustomRowHeaderInfo): Boolean; +var + I: Integer; + ACaptionInfo: TcxRowCaptionInfo; +begin + with AHeaderInfo do + begin + Result := Check(HeaderRect); + if not Result then Exit; + if Check(FButtonRect) then + SetHitState(vghc_HitAtButton, True) + else + if Check(FHeaderCellsRect) then + for I := 0 to CaptionsInfo.Count - 1 do + begin + ACaptionInfo := CaptionsInfo[I]; + with ACaptionInfo do + begin + if Check(FImageRect) then + begin + FHitCellIndex := I; + SetHitState(vghc_HitAtImage, True); + end + else + if Check(FCaptionRect) then + begin + FNewHitTestItem := ACaptionInfo; + FHitCellIndex := I; + SetHitState(vghc_HitAtCaption, True); + end; + end; + end + else + SetHitState(vghc_HitAtIndent, True); + end; +end; + +function TcxvgHitTest.CalcRowHitTest( + ARowViewInfo: TcxCustomRowViewInfo): Boolean; +begin + with ARowViewInfo do + begin + with RowRect do + Result := Check(cxRect(Left, Top, Right, + Bottom + TcxvgCustomViewInfo(ViewInfo).HorzLineWidth)); + if not Result then Exit; + FHitRow := Row; + if not CalcRowHeaderHitTest(HeaderInfo) and Check(ValuesRect) then + CalcRowValuesHitTest(ARowViewInfo) + end; +end; + +procedure TcxvgHitTest.CalcRowValuesHitTest( + ARowViewInfo: TcxCustomRowViewInfo); +var + I: Integer; + AValueInfo: TcxRowValueInfo; + AUseValue: Boolean; +begin + AUseValue := TcxvgController(Controller).ResizeKind = rkNone; + with ARowViewInfo do + for I := 0 to ValuesInfo.Count - 1 do + begin + AValueInfo := ValuesInfo[I]; + if Check(AValueInfo.VisibleRect) then + begin + if AUseValue then + begin + FNewHitTestItem := AValueInfo; + FHitCellIndex := AValueInfo.RowCellIndex; + end; + SetHitState(vghc_HitAtValue, True); + break; + end; + end; +end; + +procedure TcxvgHitTest.CalcRowsHitTest( + AViewInfo: TcxvgCustomViewInfo); +var + I: Integer; + ARowSizing: Boolean; + ARowViewInfo: TcxCustomRowViewInfo; +begin + with AViewInfo do + begin + ARowSizing := VerticalGrid.OptionsBehavior.RowSizing; + for I := 0 to RowsViewInfo.Count - 1 do + begin + ARowViewInfo := RowsViewInfo[I]; + if ARowSizing and ARowViewInfo.Row.Options.CanResized then + with ARowViewInfo.RowRect do + if Check(cxRect(Left, Bottom - 1, Right, Min(Bottom + 1, + ClientRect.Bottom))) then + begin + FHitRow := ARowViewInfo.Row; + SetHitState(vghc_HitAtRowSizing, True); + Exit; + end; + if CalcRowHitTest(ARowViewInfo) then Exit; + end; + SetHitState(vghc_HitAtEmpty, True); + end; +end; + +function TcxvgHitTest.CanMoving: Boolean; +var + ADirection: TcxDragSizingDirection; +begin + Result := ((VerticalGrid.DragMode = dmAutomatic)) and (HitRow <> nil) and + HitRow.Options.Moving and HitAtCaption and not CanSizing(ADirection); +end; + +function TcxvgHitTest.CanSizing: Boolean; +var + ADirection: TcxDragSizingDirection; +begin + Result := CanSizing(ADirection); +end; + +function TcxvgHitTest.CanSizing(var ASizeDirection: TcxDragSizingDirection): Boolean; +begin + Result := HitAtRowSizing or HitAtBandSizing or HitAtDivider; + if not Result then Exit; + if HitAtRowSizing then + ASizeDirection := dsdVert + else + ASizeDirection := dsdHorz; +end; + +function TcxvgHitTest.Check(const ARect: TRect): Boolean; +begin + Result := cxRectPtIn(ARect, HitPoint); +end; + +procedure TcxvgHitTest.DoCalculate; +begin + FHitRow := nil; + FNewHitTestItem := nil; + FHitBandIndex := -1; + FHitCellIndex := -1; + FHitState := FHitState and 3; + FHitInControl := Check(VerticalGrid.ClientBounds); + if not CalcCustomizingHitTest and FHitInControl then + CalcBandsHitTest(VerticalGrid.ViewInfo); + HitTestItem := FNewHitTestItem; +end; + +function TcxvgHitTest.GetCurrentCursor: TCursor; +var + ADirection: TcxDragSizingDirection; +const + ACursors: array[TcxDragSizingDirection] of TCursor = (crHSplit, crVSplit); +begin + Result := inherited GetCurrentCursor; + if (VerticalGrid.DragAndDropState <> ddsNone) and + not (VerticalGrid.DragAndDropObject is TcxSizingDragAndDropObject) then Exit; + if Result = crDefault then + if CanSizing(ADirection) then Result := ACursors[ADirection]; +end; + +function TcxvgHitTest.GetState(Index: Integer): Boolean; +begin + Result := (FHitState and (1 shl Index)) <> 0; +end; + +procedure TcxvgHitTest.SetHitState(Index: Integer; Value: Boolean); +begin + if Value then + FHitState := FHitState or (1 shl Index) + else + FHitState := FHitState and not (1 shl Index); +end; + +function TcxvgHitTest.GetHitAtRowHeader: Boolean; +begin + Result := HitAtCaption or HitAtIndent or HitAtImage or HitAtButton; +end; + +function TcxvgHitTest.GetVerticalGrid: TcxCustomVerticalGrid; +begin + // reduce calls + Result := TcxCustomVerticalGrid(TcxvgController(Controller).EditingControl); +end; + +{ TcxvgCellNavigator } + +constructor TcxvgCellNavigator.Create(AController: TcxCustomControlController); +begin + inherited Create(AController); + DownOnTab := True; + DownOnEnter := True; +end; + +procedure TcxvgCellNavigator.FocusNextCell(AForward, ANextRow: Boolean; + AShift: TShiftState = []); +var + APrevRowIndex, APrevCellIndex, ARowIndex, ACellIndex: Integer; + + function IsValidCellIndex(ACount: Integer): Boolean; + begin + Result := cxInRange(ACellIndex, 0, ACount - 1) or + (MayFocusedEmptyRow(ARowIndex) and (ACount = 0)); + end; + +begin + Init(APrevRowIndex, APrevCellIndex, RowCount); + ARowIndex := APrevRowIndex; + ACellIndex := APrevCellIndex; + if ANextRow then + CalcNextRow(AForward, ARowIndex, ACellIndex) + else + ACellIndex := APrevCellIndex + cxIntOffs[AForward]; + SelectCell(AForward, ANextRow, ARowIndex, ACellIndex); + if (ACellIndex < 0) and FindNextRecord(False) then + ACellIndex := GetContainerCount(ARowIndex) - 1; + if not IsValidCellIndex(Count[ARowIndex]) then + begin + ACellIndex := APrevCellIndex; + ARowIndex := APrevRowIndex; + end; + if (ARowIndex <> APrevRowIndex) or (ACellIndex <> APrevCellIndex) then + SetFocusCell(ARowIndex, ACellIndex, AShift); +end; + +procedure TcxvgCellNavigator.CalcNextRow(AForward: Boolean; + var ARowIndex, ACellIndex: Integer); + + function CanCellTabStop(ARowIndex, AIndex: Integer): Boolean; + var + ACell: TcxCellEdit; + begin + ACell := TcxCellEdit(GetCellContainer(ARowIndex, AIndex)); + Result := (ACell <> nil) and ACell.CanFocus; + if Result then + begin + if ACell.Options is TcxMultiEditorRowPropertiesOptions then + Result := TcxMultiEditorRowPropertiesOptions(ACell.Options).TabStop; + end; + end; + + function NavigateMultiEditorRow(var AIndex: Integer): Boolean; + var + ACount, ARecordIndex: Integer; + begin + Result := False; + if ACellIndex < 0 then Exit; + ACount := GetContainerCount(ARowIndex); + ARecordIndex := Max(Controller.FocusedRecordIndex, 0); + AIndex := (ACellIndex mod ACount) + cxIntOffs[AForward]; + while (AIndex >=0) and (AIndex < ACount) do + if CanCellTabStop(ARowIndex, AIndex) then + begin + Result := True; + Inc(AIndex, ARecordIndex * ACount); + break + end + else + Inc(AIndex, cxIntOffs[AForward]); + end; + +var + AIndex, AMin, AMax: Integer; +begin + if Controller.ProcessMultiEditorRow and NavigateMultiEditorRow(AIndex) then + begin + ACellIndex := AIndex; + Exit; + end; + //calc valid row's index + AMin := 0; + AMax := RowCount - 1; + AIndex := ARowIndex; + repeat + Inc(AIndex, cxIntOffs[AForward]); + if not cxInRange(AIndex, AMin, AMax) then Exit; + until Rows[AIndex].CanFocus and Rows[AIndex].Options.TabStop; + ARowIndex := AIndex; + //calc valid cell's index + AMax := GetContainerCount(ARowIndex); + if (AMax = 0) or (Controller.FocusedRecordIndex < 0) then + Exit; + AIndex := AMax * Controller.FocusedRecordIndex; + if (AMax > 1) and not Controller.ProcessMultiEditorRow then + begin + //special case (multieditor row) + if not AForward then Inc(AIndex, AMax - 1); + while not CanCellTabStop(ARowIndex, AIndex) do + Inc(AIndex, cxIntOffs[AForward]); + end + else + while not CanCellTabStop(ARowIndex, AIndex) do + Inc(AIndex); + ACellIndex := AIndex; +end; + +function TcxvgCellNavigator.FindNextRecord(AForward: Boolean): Boolean; +begin + Result := Controller.Scroller.ScrollStrategy.FindNextRecord( + DataController.FocusedRowIndex, AForward) <> -1; +end; + +function TcxvgCellNavigator.GetCellContainer(ARowIndex, + ACellIndex: Integer): TcxCustomInplaceEditContainer; +var + ACount: Integer; +begin + Result := nil; + if cxInRange(ARowIndex, 0, RowCount - 1) then + with Rows[ARowIndex] do + begin + ACount := GetEditContainerCount; + if (ACount > 0) and (ACellIndex >= 0) then + Result := GetEditContainer(ACellIndex mod ACount); + end; +end; + +function TcxvgCellNavigator.GetContainerCount( + ARowIndex: Integer): Integer; +begin + if cxInRange(ARowIndex, 0, RowCount - 1) then + Result := Rows[ARowIndex].GetEditContainerCount + else + Result := 0; +end; + +function TcxvgCellNavigator.GetCount( + ARowIndex: Integer): Integer; +begin + Result := GetContainerCount(ARowIndex) * RecordCount; +end; + +procedure TcxvgCellNavigator.Init(var ARowIndex, ACellIndex, + ARowCount: Integer); +var + ARecordIndex: Integer; +begin + with Controller do + begin + ARowCount := ViewInfo.VisibleRowCount; + ARecordIndex := Max(0, FocusedRecordIndex); + if FocusedRow = nil then + ARowIndex := -1 + else + ARowIndex := FocusedRow.VisibleIndex; + if CellIndex < 0 then + ACellIndex := -1 + else + ACellIndex := CellIndex + ARecordIndex * Max(1, GetContainerCount(ARowIndex)); + end; +end; + +function TcxvgCellNavigator.MayFocusedEmptyRow(ARowIndex: Integer): Boolean; +begin + Result := True; +end; + +procedure TcxvgCellNavigator.SetFocusCell(ARowIndex, ACellIndex: Integer; AShift: TShiftState = []); +var + ACount, AIndex, ARecord, AFocusedRecord: Integer; +begin + ACount := GetContainerCount(ARowIndex); + if Rows[ARowIndex] <> Controller.FocusedRow then + with Controller do + begin + if (FocusedRecordIndex < 0) and (DataController.RowCount > 0) then + FocusedRecordIndex := 0; + if (ACount > 0) then + AIndex := ACellIndex mod ACount + else + AIndex := ACellIndex; + SetFocusedRowAndCell(Rows[ARowIndex], AIndex); + end + else + begin + AFocusedRecord := Controller.FocusedRecordIndex; + ARecord := ACellIndex div Max(ACount, 1); + if ACount > 0 then AIndex := ACellIndex mod ACount else AIndex := 0; + if (AFocusedRecord <> -1) and (ARecord <> AFocusedRecord) then + begin + if ARecord < AFocusedRecord then + begin + if not FindNextRecord(False) then Exit; + while (AIndex >= 0) and (ACount > 0) and + not TcxCellEdit(GetCellContainer(ARowIndex, AIndex)).CanFocus do + Dec(AIndex); + if AIndex < 0 then Exit; + end + else + begin + if not FindNextRecord(True) then Exit; + while (AIndex < ACount) and (ACount > 0) and + not TcxCellEdit(GetCellContainer(ARowIndex, AIndex)).CanFocus do + Inc(AIndex); + if (ACount > 0) and (AIndex = ACount) then Exit; + end; + Controller.SetFocusedRecordItem(ARecord, GetCellContainer(ARowIndex, AIndex)); + end + else + Controller.SetFocusedRowAndCell(Rows[ARowIndex], AIndex); + end; +end; + +function TcxvgCellNavigator.GetController: TcxvgController; +begin + Result := TcxvgController(inherited Controller); +end; + +function TcxvgCellNavigator.GetRecordCount: Integer; +var + AIntf: IcxVerticalGridDBDataContoller; +begin + if DataController.GetInterface(IcxVerticalGridDBDataContoller, AIntf) then + Result := AIntf.GetDataSetRecordCount + else + Result := DataController.RowCount; +end; + +function TcxvgCellNavigator.GetRow(Index: Integer): TcxCustomRow; +begin + Result := Controller.ViewInfo.VisibleRows[Index]; +end; + +function TcxvgCellNavigator.GetValueCount: Integer; +begin + Result := Max(1, Controller.ViewInfo.VisibleValueCount) +end; + +{ TcxvgDragImageHelper } + +procedure TcxvgDragImageHelper.DragAndDrop(const P: TPoint); +var + CP: TPoint; +begin + inherited DragAndDrop(P); + with TcxCustomVerticalGrid(DragControl).Controller do + begin + CP := DragControl.ScreenToClient(P); + HitTest.RecalculateOnMouseEvent(CP.X, CP.Y, []); + if (FAutoScrollObject <> nil) and not HitTest.HitAtCustomize then + FAutoScrollObject.CheckBounds(CP); + end; + DragControl.DragCursor := GetCursor; +end; + +function TcxvgDragImageHelper.GetCursor: TCursor; +begin + Result := crcxInspectorNoDrag; + with TcxCustomVerticalGrid(DragControl), HitTest do + begin + if HitAtCustomize then + Result := crDrag + else + if HitAtCaption then + Result := crcxInspectorAddChild + else + if HitAtEmpty then + Result := crcxInspectorAdd + else + if HitInControl then + Result := crcxInspectorInsert + end; +end; + +{ TcxvgController } + +constructor TcxvgController.Create( + AOwner: TcxEditingControl); +begin + inherited Create(AOwner); + FScroller := TcxvgScroller.Create(VerticalGrid); + FCellIndex := -1; +end; + +destructor TcxvgController.Destroy; +begin + FScroller.Free; + inherited Destroy; +end; + +function TcxvgController.QueryInterface(const IID: TGUID; + out Obj): HResult; +begin + if GetInterface(IID, Obj) then Result := 0 else Result := cxE_NOINTERFACE; +end; + +function TcxvgController.GetCursor(X, Y: Integer): TCursor; +begin + if not VerticalGrid.IsDesigning then + begin + if Int64(Point(X, Y)) <> Int64(HitTestController.HitPoint) then + TcxvgHitTest(HitTestController).RecalculateOnMouseEvent(X, Y, []); + Result := TcxvgHitTest(HitTestController).GetCurrentCursor; + if Result = crDefault then + Result := inherited GetCursor(X, Y); + end + else + Result := inherited GetCursor(X, Y); +end; + +procedure TcxvgController.KeyDown(var Key: Word; + Shift: TShiftState); +var + AIsMultiEditorRow: Boolean; + + function CanProcessProcessMultiEditorRow: Boolean; + var + AIndex: Integer; + begin + Result := False; + if not AIsMultiEditorRow then Exit; + with TcxCustomMultiEditorRow(FocusedRow) do + begin + AIndex := CellIndex; + if Key = VK_LEFT then + begin + if AIndex > 0 then + repeat + Dec(AIndex); + with Properties.Editors[AIndex].EditContainer do + if CanFocus and CanTabStop then + begin + Result := True; + Exit; + end; + until AIndex = 0; + end + else + if AIndex < Properties.Editors.Count - 1 then + repeat + Inc(AIndex); + with Properties.Editors[AIndex].EditContainer do + if CanFocus and CanTabStop then + begin + Result := True; + Exit; + end; + until AIndex = Properties.Editors.Count - 1; + end; + end; + + function CanChangeExpandedState: Boolean; + begin + Result := VerticalGrid.OptionsView.ShowButtons and (FocusedRow <> nil) and + FocusedRow.Options.ShowExpandButton and (FocusedRow.Count > 0) and not IsEditing; + end; + +begin + FForceShowEditor := (Key = VK_RETURN) and GetGoToNextCellOnEnter; + AIsMultiEditorRow := (FocusedRow is TcxCustomMultiEditorRow) and + (TcxCustomMultiEditorRow(FocusedRow).Properties.Editors.Count > 0); + FProcessMultiEditorRow := AIsMultiEditorRow and + (ForceShowEditor or ((Key = VK_TAB) and GetGoToNextCellOnTab)); + if ((Key = VK_LEFT) or (Key = VK_RIGHT)) and not CanProcessProcessMultiEditorRow then + begin + if not CanChangeRecord then + begin + if CanChangeExpandedState then + FocusedRow.Expanded := Key = VK_RIGHT; + EatKeyPress := True; + Key := 0; + end; + end; + inherited KeyDown(Key, Shift); + case Key of + VK_MULTIPLY: + if CanChangeExpandedState then + begin + FocusedRow.Expand(True); + EatKeyPress := True; + Key := 0; + end; + VK_ADD, VK_SUBTRACT: + if CanChangeExpandedState then + begin + FocusedRow.Expanded := Key = VK_ADD; + EatKeyPress := True; + Key := 0; + end; + VK_INSERT: + if (Shift = []) and CanInsert(True) then + begin + InsertRecord; + Key := 0; + end; + VK_DELETE: + if ((Shift = []) or (Shift = [ssCtrl])) and CanDelete(True) then + begin + DeleteSelection; + Key := 0; + end; + end; +end; + +procedure TcxvgController.MakeFocusedItemVisible; +begin + if FLockUpdate or (FFocusedRow = nil) then Exit; + MakeRecordVisible(FocusedRecordIndex); + MakeRowVisible(FFocusedRow) +end; + +procedure TcxvgController.MakeFocusedRecordVisible; +begin + MakeRecordVisible(FocusedRecordIndex); +end; + +procedure TcxvgController.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + + function IsChangeExpandState(ARow: TcxCustomRow): Boolean; + begin + with HitTest do + Result := ARow.Options.ShowExpandButton and + (HitAtButton or (IsDblClick and HitAtCaption and ARow.HasVisibleChildren)); + end; + + procedure CheckDesignSelection(ARow: TcxCustomRow); + begin + if VerticalGrid.IsDesigning then + begin + with VerticalGrid.Controller do + if DesignSelectionHelper <> nil then + if ARow <> nil then + DesignSelectionHelper.Select(ARow, Shift) + else + DesignSelectionHelper.Select(VerticalGrid, Shift); + end; + end; + + function CanChangeFocusedItem(ARow: TcxCustomRow): Boolean; + begin + with HitTest do + Result := (ARow <> nil) and ARow.CanFocus and + (not IsItemEditCell or not TcxRowValueInfo(EditCellViewInfo).EditContainer.CanFocus); + end; + + procedure CheckFocusedRow; + var + ARow: TcxCustomRow; + begin + ARow := FocusedRow; + while (ARow <> nil) and not VerticalGrid.IsRowVisible(ARow) do + ARow := ARow.Parent; + if ARow <> FocusedRow then + if (ARow <> nil) and ARow.CanFocus then + FocusedRow := ARow + else + FocusedRow := nil; + end; + +var + ARow: TcxCustomRow; + ACellIndex: Integer; + AChangeExpand: Boolean; +begin + ARow := HitTest.HitRow; + CheckDesignSelection(ARow); + AChangeExpand := (ARow <> nil) and IsChangeExpandState(ARow); + if (ResizeKind = rkNone) and CanChangeFocusedItem(ARow) then + begin + if HitTest.HitCellIndex >= 0 then + ACellIndex := HitTest.HitCellIndex + else + ACellIndex := cxSetValue(FocusedRow <> ARow, 0, CellIndex); + SetFocusedRowAndCell(ARow, ACellIndex); + AChangeExpand := AChangeExpand and (VerticalGrid.Rows.IndexOf(ARow) >= 0); + end; + if AChangeExpand then + begin + ARow.Expanded := not ARow.Expanded; + if ARow.Expanded then + Scroller.SetRowMaxVisible(ARow) + else + CheckFocusedRow; + end; +end; + +procedure TcxvgController.MouseMove(Shift: TShiftState; X, Y: Integer); +var + I: Integer; + ARow: TcxCustomRow; +begin + inherited MouseMove(Shift, X, Y); + if FTrackingEnabled and (VerticalGrid.DragAndDropState = ddsNone) and + not VerticalGrid.Dragging and not VerticalGrid.IsLocked then + begin + ARow := HitTest.HitRow; + if ARow <> nil then + begin + if ARow.CanFocus then + begin + StopScrollTimer; + SetFocusedRowAndCell(ARow, HitTest.HitCellIndex); + Exit; + end; + end + else + for I := 0 to ViewInfo.RowsViewInfo.Count - 1 do + with ViewInfo.RowsViewInfo[I] do + if cxRectPtIn(RowRect, X, Y) or ((Y >= RowRect.Top) and + (Y < RowRect.Bottom)) and Row.CanFocus then + begin + StopScrollTimer; + SetFocusedRowAndCell(Row, HitTest.HitCellIndex); + Exit; + end; + with VerticalGrid.ClientBounds do + begin + if Y <= Top then + begin + FScrollDown := False; + StartScrollTimer; + end; + if Y > Bottom then + begin + FScrollDown := True; + StartScrollTimer; + end; + end; + end; +end; + +function TcxvgController.CanDrag(X, Y: Integer): Boolean; +begin + with HitTest do + begin + HitPoint := Point(X, Y); + if HitAtValue and (dceModified in DataController.EditState) then + Result := False + else + Result := not FWasScroll and CanMoving; + end; +end; + +procedure TcxvgController.EndDragAndDrop(Accepted: Boolean); +begin + inherited EndDragAndDrop(Accepted); + ResizeKind := rkNone; +end; + +function TcxvgController.StartDragAndDrop(const P: TPoint): Boolean; +begin + with HitTest do + begin + HitPoint := P; + Result := CanSizing; + end; +end; + +procedure TcxvgController.InitScrollBarsParameters; +begin + if VerticalGrid.HandleAllocated then + Scroller.InitScrollBarsParameters; +end; + +procedure TcxvgController.Scroll( + AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode; + var AScrollPos: Integer); +begin + Scroller.Scroll(AScrollBarKind, AScrollCode, AScrollPos); +end; + +procedure TcxvgController.AppendRecord; +begin + if not CanAppend(False) then Exit; + if VerticalGrid.OptionsBehavior.FocusFirstCellOnNewRecord then + FocusedRow := ViewInfo.VisibleRows[0]; + DataController.Append; +end; + +procedure TcxvgController.DeleteSelection; +begin +end; + +procedure TcxvgController.InsertRecord; +begin + if not CanInsert(False) then Exit; + if VerticalGrid.OptionsBehavior.FocusFirstCellOnNewRecord then + FocusedRow := ViewInfo.VisibleRows[0]; + DataController.Insert; +end; + +procedure TcxvgController.MakeRowVisible(ARow: TcxCustomRow); +var + AParent: TcxCustomRow; +begin + if ARow = nil then Exit; + if VerticalGrid.IsRowVisible(ARow) then + Scroller.SetRowVisible(ARow) + else + with VerticalGrid do + begin + AParent := ARow.FParent; + BeginUpdate; + try + while AParent <> FRootRow do + begin + AParent.Visible := True; + AParent.Expanded := True; + AParent := AParent.FParent; + end; + Scroller.SetRowVisible(ARow); + finally + EndUpdate; + end; + end; +end; + +function TcxvgController.MakeRecordVisible(AIndex: Integer): Boolean; +begin + Result := Scroller.SetRecordVisible(AIndex); +end; + +function TcxvgController._AddRef: Integer; +begin + Result := -1; +end; + +function TcxvgController._Release: Integer; +begin + Result := -1; +end; + +function TcxvgController.CanSizing( + ADirection: TcxDragSizingDirection): Boolean; +begin + HitTest.Recalculate(Mouse.CursorPos); + Result := HitTest.CanSizing(ADirection); +end; + +function TcxvgController.GetSizingBoundsRect( + ADirection: TcxDragSizingDirection): TRect; +begin + Result := ViewInfo.ClipRect; + Dec(Result.Bottom); +end; + +function TcxvgController.GetSizingIncrement( + ADirection: TcxDragSizingDirection): Integer; +begin + Result := 1; +end; + +function TcxvgController.IsDynamicUpdate: Boolean; +begin + Result := True; +end; + +procedure TcxvgController.SetSizeDelta( + ADirection: TcxDragSizingDirection; ADelta: Integer); +begin + Inc(FSizingValue, ADelta); + case ResizeKind of + rkRowSizing: + FSizingRow.Height := Max(FSizingValue, ViewInfo.FRowMinHeight); + rkDivider: + ViewInfo.SetDividerPos(FSizingValue); + rkBandSizing: + ViewInfo.SetValueWidth(FSizingValue); + end; + VerticalGrid.Modified; +end; + +procedure TcxvgController.DragDrop(Source: TObject; X, Y: Integer); +begin + if IsInternalDragging then + begin + with HitTest do + if (HitRow <> nil) or HitAtEmpty then + begin + VerticalGrid.BeginUpdate; + try + if HitRow = nil then + begin + DragRow.Parent := VerticalGrid.FRootRow; + DragRow.Index := VerticalGrid.FRootRow.Count - 1; + end + else + begin + if HitAtCaption then + DragRow.Parent := HitRow + else + DragRow.Parent := HitRow.Parent; + DragRow.Index := HitRow.Index; + end; + DragRow.Visible := True; + finally + VerticalGrid.EndUpdate; + end; + end + else + CheckMoveToCustomizationForm; + end; +end; + +procedure TcxvgController.DragOver(Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); +begin + inherited DragOver(Source, X, Y, State, Accept); + if (not Assigned(VerticalGrid.OnDragOver) or Accept) and IsInternalDragging then + with HitTest do + begin + HitPoint := cxPoint(X, Y); + Accept := HitAtEmpty or + HitAtRowHeader and (DragRow <> HitRow) and not DragRow.IsParent(HitRow); + end; +end; + +procedure TcxvgController.EndDrag(Target: TObject; X, Y: Integer); +begin + FAutoScrollObject.Free; + FAutoScrollObject := nil; + FTrackingEnabled := False; + inherited EndDrag(Target, X, Y); +end; + +procedure TcxvgController.StartDrag(var DragObject: TDragObject); +begin + inherited StartDrag(DragObject); + FAutoScrollObject := TcxControllerAutoScrollingObject.Create(Self); + FAutoScrollObject.SetBoundsParams(VerticalGrid.ClientBounds, False, True, 1); + HitTest.HitPoint := VerticalGrid.ScreenToClient(GetMouseCursorPos); + with VerticalGrid.Customizing do + begin + FDragFromCustomizingForm := Visible and HitTest.HitAtCustomize; + if Visible and (DragRow <> nil) then + begin + if DragRow is TcxCategoryRow then + MakeCategorySheetVisible + else + MakeRowSheetVisible; + end; + end; +end; + +procedure TcxvgController.BeforeMouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + inherited BeforeMouseDown(Button, Shift, X, Y); + FDragRow := nil; +end; + +procedure TcxvgController.BehaviorChanged; +begin + if not VerticalGrid.IsLocked then + inherited BehaviorChanged; +end; + +function TcxvgController.CanAppend(ACheckOptions: Boolean): Boolean; +begin + Result := False; +end; + +function TcxvgController.CanChangeRecord: Boolean; +begin + Result := False; +end; + +function TcxvgController.CanDelete(ACheckOptions: Boolean): Boolean; +begin + Result := False; +end; + +function TcxvgController.CanInsert(ACheckOptions: Boolean): Boolean; +begin + Result := False; +end; + +procedure TcxvgController.CheckPostData; +begin + if [dceEdit, dceModified] * DataController.EditState <> [] then + DataController.Post; +end; + +procedure TcxvgController.Clear; +begin + StopScrollTimer; + FTrackingEnabled := False; + inherited Clear; + EditingController.EditingItem := nil; + FocusedItem := nil; + FFocusedRow := nil; +end; + +procedure TcxvgController.DoCancelMode; +begin + StopScrollTimer; + FTrackingEnabled := False; + inherited DoCancelMode; +end; + +procedure TcxvgController.DoMouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +var + ATopRow: Integer; +begin + if (VerticalGrid.DragAndDropState <> ddsNone) and HitTest.CanSizing then + begin + EditingController.HideEdit(True); + Exit; + end; + ATopRow := Scroller.TopVisibleRowIndex; + inherited DoMouseDown(Button, Shift, X, Y); + FWasScroll := ATopRow <> Scroller.TopVisibleRowIndex; + with VerticalGrid, HitTest do + begin + RecalculateOnMouseEvent(X, Y, Shift); + FTrackingEnabled := (Button = mbLeft) and (DragMode <> dmAutomatic) and + not FWasScroll and not HitAtEmpty and + not HitAtButton and OptionsBehavior.RowTracking and + not (IsItemEditCell and EditCellViewInfo.EditViewInfo.IsHotTrack(cxPoint(X, Y))); + if CanMoving and not FTrackingEnabled then + FDragRow := HitRow; + end; +end; + +procedure TcxvgController.DoMouseUp(Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + StopScrollTimer; + FTrackingEnabled := False; + inherited DoMouseUp(Button, Shift, X, Y); +end; + +procedure TcxvgController.DoNextPage(AForward: Boolean; + Shift: TShiftState); +const + Direction: array[Boolean] of TScrollCode = (scPageUp, scPageDown); +var + AIndex: Integer; +begin + if ViewInfo.VisibleRowCount = 0 then Exit; + if ssCtrl in Shift then + if AForward then + FocusedRow := VerticalGrid.LastVisibleRow + else + FocusedRow := VerticalGrid.FirstVisibleRow + else + begin + if FFocusedRow = nil then + AIndex := 0 + else + AIndex := FFocusedRow.VisibleIndex; + if AForward then + Inc(AIndex, Scroller.VisibleRowCount) + else + Dec(AIndex, Scroller.VisibleRowCount); + cxRange(AIndex, 0, ViewInfo.VisibleRowCount - 1); + FocusedRow := ViewInfo.VisibleRows[AIndex]; + end; + MakeFocusedItemVisible; +end; + +procedure TcxvgController.DoUpdateRowAndCell(ANewRow: TcxCustomRow; + ANewCellIndex: Integer); +var + APrevFocusedRow: TcxCustomRow; + APrevCellIndex: Integer; +begin + APrevFocusedRow := FFocusedRow; + APrevCellIndex := FCellIndex; + if FFocusedRow <> ANewRow then + begin + FFocusedRow := ANewRow; + FCellIndex := cxSetValue(ANewRow = nil, -1, ANewCellIndex); + ViewInfo.ChangeFocusedRow(ANewRow, APrevFocusedRow) + end + else + if FCellIndex <> ANewCellIndex then + begin + FCellIndex := cxSetValue(FFocusedRow = nil, -1, ANewCellIndex); + RefreshFocusedRow; + end; + MakeFocusedItemVisible; + if (APrevFocusedRow <> FFocusedRow) or (APrevCellIndex <> FCellIndex) then + VerticalGrid.DoItemChanged(APrevFocusedRow, APrevCellIndex); + if VerticalGrid.IsLocked then Exit; + AllowCheckEdit := True; + if ForceShowEditor then + begin + FForceShowEditor := False; + EditingController.ShowEdit; + end + else + CheckEdit; +end; + +procedure TcxvgController.FocusedItemChanged( + APrevFocusedItem: TcxCustomInplaceEditContainer); +var + ARow: TcxCustomRow; + ACellIndex: Integer; +begin + if EditingControl.ComponentState * [csLoading, csDestroying] <> [] then Exit; + if not FLockIncSearch then + CancelIncSearching; + if (APrevFocusedItem <> nil) and GetPostDataOnChangeItem then + CheckPostData; + AllowCheckEdit := False; + if FLockUpdate then Exit; + if FocusedItem = nil then + begin + if (FFocusedRow = nil) or (csDestroying in FFocusedRow.ComponentState) then + ARow := nil + else + ARow := FFocusedRow; + ACellIndex := FCellIndex; + end + else + with TcxCellEdit(FocusedItem) do + begin + ARow := Row; + ACellIndex := CellIndex; + end; + DoUpdateRowAndCell(ARow, ACellIndex); +end; + +function TcxvgController.GetCancelEditingOnExit: Boolean; +begin + Result := [dceEdit, dceModified] * DataController.EditState = []; +end; + +function TcxvgController.GetDragAndDropObjectClass: TcxDragAndDropObjectClass; +begin + FResizeKind := rkNone; + if HitTest.CanSizing(ResizeDirection) then + begin + if ResizeDirection = dsdHorz then + begin + if HitTest.HitAtDivider then + ResizeKind := rkDivider + else + ResizeKind := rkBandSizing; + end + else + ResizeKind := rkRowSizing; + Result := TcxSizingDragAndDropObject; + DragItem := Self; + end + else + Result := nil +end; + +function TcxvgController.GetFocusedCellViewInfo( + AEditContainer: TcxCustomInplaceEditContainer): TcxEditCellViewInfo; +var + ARowViewInfo: TcxCustomRowViewInfo; +begin + Result := nil; + if AEditContainer = nil then Exit; + ARowViewInfo := TcxCellEdit(AEditContainer).ViewInfo; + if (ARowViewInfo <> nil) and (FCellIndex >= 0) then + Result := ARowViewInfo.RowValueInfo[FocusedRecordIndex, FCellIndex]; +end; + +function TcxvgController.GetImmediateEditor: Boolean; +begin + // ignore VerticalGrid.DragMode + with VerticalGrid.OptionsBehavior do + Result := ImmediateEditor or AlwaysShowEditor; +end; + +function TcxvgController.GetNavigatorClass: TcxCustomCellNavigatorClass; +begin + Result := TcxvgCellNavigator; +end; + +function TcxvgController.GetPostDataOnChangeItem: Boolean; +begin + Result := True; +end; + +function TcxvgController.GetResizeDirection: TcxDragSizingDirection; +begin + if ResizeKind = rkRowSizing then Result := dsdVert else Result := dsdHorz; +end; + +procedure TcxvgController.InternalSetRowAndCell(ARow: TcxCustomRow; + ACellIndex: Integer); +begin + FFocusedRow := ARow; + FCellIndex := ACellIndex; +end; + +function TcxvgController.IsImmediatePost: Boolean; +begin + Result := True; +end; + +function TcxvgController.IsInternalDragging: Boolean; +begin + Result := (VerticalGrid.DragMode = dmAutomatic) and (FDragRow <> nil); +end; + +function TcxvgController.IsKeyForController(AKey: Word; + AShift: TShiftState): Boolean; +begin + Result := inherited IsKeyForController(AKey, AShift) or + (IsEditing and (ssCtrl in AShift) and (AKey in [VK_MULTIPLY, VK_ADD, VK_SUBTRACT])); +end; + +procedure TcxvgController.RefreshFocusedRow; +begin + if not FLockUpdate and (FFocusedRow <> nil) and + not (csDestroying in FFocusedRow.ComponentState) and FFocusedRow.Visible then + FFocusedRow.ViewInfo.Update; +end; + +procedure TcxvgController.SetFocusedCellEdit(ACellEdit: TcxCellEdit); +var + I: Integer; + ARow: TcxCustomRow; + ACellViewInfo: TcxEditCellViewInfo; +begin + if ACellEdit = nil then + FocusedRow := nil + else + begin + ARow := ACellEdit.Row; + for I := 0 to ARow.GetEditContainerCount - 1 do + if ARow.GetEditContainer(I) = ACellEdit then + begin + SetFocusedRowAndCell(ARow, I); + ACellViewInfo := GetFocusedCellViewInfo(ACellEdit); + if Assigned(ACellViewInfo) then + ACellViewInfo.Invalidate(True); + break; + end; + end; +end; + +procedure TcxvgController.SetFocusedRowAndCell( + Value: TcxCustomRow; ACellIndex: Integer); + + function CanCellFocus(AIndex: Integer): Boolean; + begin + Result := Value.GetEditContainer(AIndex).CanFocus; + end; + + procedure CorrectCellIndex; + var + I, ACount: Integer; + begin + if Value = nil then + ACount := 0 + else + ACount := Value.GetEditContainerCount; + if (ACellIndex >= ACount) or (ACellIndex < 0) then + ACellIndex := 0; + if (ACount > 0) and not CanCellFocus(ACellIndex) then + begin + ACellIndex := 0; + for I := 0 to ACount - 1 do + if CanCellFocus(I) then + begin + ACellIndex := I; + break; + end; + end; + end; + +var + AEditContainer: TcxCustomInplaceEditContainer; +begin + if VerticalGrid.IsDesigning or Assigned(Value) and not Value.CanFocus then Exit; + CorrectCellIndex; + if (FCellIndex = ACellIndex) and (FFocusedRow = Value) then Exit; + FLockUpdate := True; + try + if Value <> nil then + AEditContainer := Value.GetEditContainer(ACellIndex) + else + AEditContainer := nil; + if FocusedItem <> AEditContainer then + FocusedItem := AEditContainer; + finally + FLockUpdate := False; + AllowCheckEdit := True; + end; + DoUpdateRowAndCell(Value, ACellIndex); +end; + +procedure TcxvgController.UpdatePaintStyle; +begin + ViewInfo.LayoutStyleChanged; +end; + +procedure TcxvgController.UpdateRecord(ARecordIndex: Integer); +begin + if not VerticalGrid.IsLocked then + ViewInfo.UpdateRecord(ARecordIndex); +end; + +procedure TcxvgController.CheckMoveToCustomizationForm; + + procedure HideWithChildren(ARow: TcxCustomRow); + begin + if not ARow.Options.CanMovedToCustomizationForm then + begin + if ARow.Parent <> nil then + ARow.Parent := ARow.Parent.Parent + else + ARow.Parent := nil; + end; + while ARow.Count > 0 do + HideWithChildren(ARow.Rows[0]); + if ARow.Options.CanMovedToCustomizationForm then + begin + ARow.Visible := False; + ARow.Parent := nil; + end; + end; + +begin + if not DragFromCustomizingForm and HitTest.HitAtCustomize and + DragRow.Options.CanMovedToCustomizationForm then + begin + with VerticalGrid do + begin + BeginUpdate; + try + HideWithChildren(FDragRow); + FocusedRow := nil; + finally + EndUpdate; + end; + Customizing.Modified; + end; + end; +end; + +function TcxvgController.GetHitTest: TcxvgHitTest; +begin + Result := TcxvgHitTest(inherited HitTestController); +end; + +function TcxvgController.GetVerticalGrid: TcxCustomVerticalGrid; +begin + Result := TcxCustomVerticalGrid(EditingControl); +end; + +function TcxvgController.GetViewInfo: TcxvgCustomViewInfo; +begin + Result := VerticalGrid.ViewInfo; +end; + +procedure TcxvgController.SetFocusedRow(Value: TcxCustomRow); +begin + SetFocusedRowAndCell(Value, 0); +end; + +procedure TcxvgController.SetResizeKind( + Value: TcxvgResizeKind); +begin + FResizeKind := Value; + case Value of + rkDivider: + FSizingValue := VerticalGrid.OptionsView.RowHeaderWidth; + rkBandSizing: + FSizingValue := VerticalGrid.OptionsView.ValueWidth; + rkRowSizing: + begin + FSizingRow := HitTest.HitRow; + FSizingValue := FSizingRow.ViewInfo.CalculatedHeight; + end + end; +end; + +procedure TcxvgController.OnScrollTimer(Sender: TObject); +var + ARow: TcxCustomRow; +begin + if FScrollDown then + ARow := VerticalGrid.NextVisibleRow(FocusedRow) + else + ARow := VerticalGrid.PrevVisibleRow(FocusedRow); + if ARow <> nil then FocusedRow := ARow; +end; + +procedure TcxvgController.StartScrollTimer; +begin + if FScrollTimer <> nil then Exit; + FScrollTimer := TTimer.Create(nil); + FScrollTimer.Interval := 5; + FScrollTimer.OnTimer := OnScrollTimer; +end; + +procedure TcxvgController.StopScrollTimer; +begin + FreeAndNil(FScrollTimer); +end; + +{ TcxvgMultiRecordsController } + +procedure TcxvgMultiRecordsController.DeleteSelection; +begin + if not CanDelete(False) then Exit; + if not OptionsData.DeletingConfirmation or + cxConfirmMessageBox( + PChar(cxGetResourceString(@cxSvgDeletingFocusedConfirmationText)), + PChar(cxGetResourceString(@cxSvgDeletingConfirmationCaption))) then + DataController.DeleteFocused; +end; + +function TcxvgMultiRecordsController.CanAppend(ACheckOptions: Boolean): Boolean; +begin + Result := (dceoAppend in DataController.EditOperations) and + (not ACheckOptions or OptionsData.Appending); +end; + +function TcxvgMultiRecordsController.CanChangeRecord: Boolean; +begin + Result := OptionsBehavior.AllowChangeRecord or + (VerticalGrid.LayoutStyle = lsMultiRecordView); +end; + +function TcxvgMultiRecordsController.CanDelete(ACheckOptions: Boolean): Boolean; +begin + Result := (dceoDelete in DataController.EditOperations) and + (not ACheckOptions or OptionsData.Deleting) and (DataController.RowCount > 0); +end; + +function TcxvgMultiRecordsController.CanInsert(ACheckOptions: Boolean): Boolean; +begin + Result := (dceoInsert in DataController.EditOperations) and + (not ACheckOptions or OptionsData.Inserting); +end; + +procedure TcxvgMultiRecordsController.FocusedRecordChanged(APrevFocusedRowIndex, + AFocusedRowIndex: Integer); +begin + if APrevFocusedRowIndex <> -1 then + EditingController.HideEdit(True); + if not MakeRecordVisible(AFocusedRowIndex) then + begin + if VerticalGrid.OptionsView.CellAutoHeight then + ViewInfo.Calculate + else + begin + ViewInfo.UpdateRecord(APrevFocusedRowIndex); + ViewInfo.UpdateRecord(AFocusedRowIndex); + end; + end; + VerticalGrid.UpdateScrollBars; + CheckEdit; + TcxEditingControllerAccess(EditingController).UpdateEditValue; + VerticalGrid.DoFocusedRecordChanged(APrevFocusedRowIndex, AFocusedRowIndex); + VerticalGrid.Invalidate; +end; + +function TcxvgMultiRecordsController.GetCancelEditingOnExit: Boolean; +begin + with VerticalGrid do + Result := OptionsData.CancelOnExit and + (DataController.EditState * [dceInsert, dceChanging, dceModified] = [dceInsert]); +end; + +function TcxvgMultiRecordsController.GetFocusedRecordIndex: Integer; +begin + Result := DataController.GetFocusedRowIndex; +end; + +function TcxvgMultiRecordsController.GetPostDataOnChangeItem: Boolean; +begin + Result := False; +end; + +function TcxvgMultiRecordsController.IncSearchKeyDown(AKey: Word; + AShift: TShiftState): Word; +begin + if ItemForIncSearching = nil then + begin + Result := AKey; + Exit; + end + else + Result := 0; + case AKey of + VK_LEFT, VK_RIGHT: + if AShift = [ssCtrl] then + SearchLocateNext(ItemForIncSearching, AKey = VK_RIGHT) + else + begin + CancelIncSearching; + Result := AKey; + end; + VK_UP, VK_DOWN: + Result := AKey; + else + Result := inherited IncSearchKeyDown(AKey, AShift); + end; +end; + +function TcxvgMultiRecordsController.IsImmediatePost: Boolean; +begin + Result := False; +end; + +procedure TcxvgMultiRecordsController.RefreshIncSearchItem; +var + ACellEdit: TcxCellEdit; +begin + if IsIncSearching then + begin + ACellEdit := VerticalGrid.ContainerList.List^[DataController.Search.ItemIndex]; + FLockIncSearch := True; + try + SetFocusedCellEdit(ACellEdit); + finally + FLockIncSearch := False; + end; + end; +end; + +procedure TcxvgMultiRecordsController.SetFocusedRecordIndex(Value: Integer); +var + AIndexesAreEqual: Boolean; +begin + with DataController do + begin + if cxInRange(Value, 0, RowCount - 1) and + not (CanFocusedRecordIndex(Value) and ChangeFocusedRowIndex(Value)) then Exit; + end; + AIndexesAreEqual := FocusedRecordIndex = Value; + if AIndexesAreEqual then MakeFocusedRecordVisible; +end; + +function TcxvgMultiRecordsController.GetOptionsBehavior: TcxvgMultiRecordsOptionsBehavior; +begin + Result := VerticalGrid.OptionsBehavior; +end; + +function TcxvgMultiRecordsController.GetOptionsData: TcxvgMultiRecordsOptionsData; +begin + Result := VerticalGrid.OptionsData; +end; + +function TcxvgMultiRecordsController.GetVerticalGrid: TcxVirtualVerticalGrid; +begin + Result := inherited VerticalGrid as TcxVirtualVerticalGrid; +end; + +{ TcxRowValueInfo } + +procedure TcxRowValueInfo.DoCalculate; +begin + EditContainer.Calculate(Self); + if Focused then + FFocusRect := DisplayRect + else + FFocusRect := cxNullRect; +end; + +function TcxRowValueInfo.EditContainer: TcxCellEdit; +begin + Result := TcxCellEdit(inherited EditContainer); +end; + +function TcxRowValueInfo.GetButtonTransparency: TcxEditButtonTransparency; + + function NeedButton: Boolean; + begin + Result := Focused; + if not Result and (Control is TcxVirtualVerticalGrid) then + with TcxVirtualVerticalGrid(Control) do + Result := (LayoutStyle = lsMultiRecordView) and + (RecordIndex = DataController.FocusedRowIndex); + end; + +var + B1: TcxEditingControlEditShowButtons; + B2: TcxEditItemShowEditButtons; +begin + B1 := TcxCustomVerticalGrid(Control).OptionsView.ShowEditButtons; + B2 := EditorRowProperties.Options.ShowEditButtons; + if (B2 = eisbAlways) or (B2 = eisbDefault) and + ((B1 = ecsbAlways) or (B1 = ecsbFocused) and NeedButton) then + Result := ebtNone + else + Result := ebtHideInactive; +end; + +function TcxRowValueInfo.GetDisplayValue: Variant; +begin + if (FRecordIndex < 0) or (FRecordIndex >= EditContainer.DataController.RowCount) then + Result := Null + else + Result := EditContainer.GetDisplayValue(Properties, FRecordIndex); +end; + +function TcxRowValueInfo.GetEditViewParams: TcxViewParams; +begin + Result := Row.VerticalGrid.Styles.GetContentParams(EditorRowProperties, + Focused, FRecordIndex); +end; + +function TcxRowValueInfo.GetFocused: Boolean; +begin + with EditContainer do + Result := (FocusedCellViewInfo = Self) and + (DataController.FocusedRowIndex = FRecordIndex) and + (FRow = FRow.VerticalGrid.FocusedRow); +end; + +function TcxRowValueInfo.GetRecordIndex: Integer; +begin + Result := FRecordIndex; +end; + +function TcxRowValueInfo.GetSelectedTextColor: Integer; +begin + Result := IncSearchParams.TextColor; +end; + +function TcxRowValueInfo.GetSelectedBKColor: Integer; +begin + Result := IncSearchParams.Color +end; + +function TcxRowValueInfo.IncSearchParams: TcxViewParams; +begin + Result := TcxCustomVerticalGrid(Control).Styles.GetIncSearchParams; + if Result.Color = clDefault then + Result.Color := inherited GetSelectedBKColor; + if Result.TextColor = clDefault then + Result.TextColor := inherited GetSelectedTextColor; +end; + +function TcxRowValueInfo.IsAutoHeight: Boolean; +begin + Result := (Properties <> nil) and + (esoAutoHeight in Properties.GetSupportedOperations) and + TcxvgCustomViewInfo(ControlViewInfo).GetRowAutoHeight(Row); +end; + +function TcxRowValueInfo.GetEditorRowProperties: TcxCustomEditorRowProperties; +begin + Result := EditContainer.FEditRowProperties; +end; + +{ TcxRowCaptionInfo } + +constructor TcxRowCaptionInfo.Create; +begin + inherited Create; + FImageIndex := -1; +end; + +destructor TcxRowCaptionInfo.Destroy; +begin + with Row.VerticalGrid do + if not IsDestroying then + with TcxHotTrackControllerAccess(Controller.HotTrackController) do + if PrevElement = Self then + Clear; + inherited Destroy; +end; + +function TcxRowCaptionInfo.QueryInterface(const IID: TGUID; + out Obj): HResult; +begin + if GetInterface(IID, Obj) then Result := 0 else Result := cxE_NOINTERFACE; +end; + +function TcxRowCaptionInfo._AddRef: Integer; +begin + Result := -1; +end; + +function TcxRowCaptionInfo._Release: Integer; +begin + Result := -1; +end; + +function TcxRowCaptionInfo.GetOrigin: TPoint; +begin + Result := CaptionRect.TopLeft; +end; + +function TcxRowCaptionInfo.IsNeedHint(ACanvas: TcxCanvas; const P: TPoint; + out AText: TCaption; + out AIsMultiLine: Boolean; + out ATextRect: TRect; var IsNeedOffsetHint: Boolean): Boolean; +var + ASize: TSize; +begin + AText := FindPropertiesHint(P); + ACanvas.Font := ViewParams.Font; + if AText <> '' then + begin + ASize := ACanvas.TextExtent(AText); + ATextRect.TopLeft := CaptionRect.TopLeft; + with ATextRect do + begin + Right := Left + ASize.cx; + Bottom := Top + ASize.cy; + end; + IsNeedOffsetHint := True; + Result := True; + end + else + begin + AText := FCaption; + ASize := ACanvas.TextExtent(AText); + cxRectIntersect(ATextRect, CaptionTextRect, Row.ViewInfo.HeaderInfo.HeaderRect); + cxRectIntersect(ATextRect, ATextRect, Row.VerticalGrid.ClientBounds); + IsNeedOffsetHint := False; + Result := (cxRectWidth(ATextRect) < ASize.cx - 1) + or (cxRectHeight(ATextRect) < ASize.cy - 1); + end; + AIsMultiLine := False; +end; + +procedure TcxRowCaptionInfo.UpdateHotTrackState(const APoint: TPoint); +begin +end; + +function TcxRowCaptionInfo.FindPropertiesHint(const P: TPoint): string; +var + I: Integer; +begin + Result := ''; + if (Row.FProperties is TcxCaptionRowProperties) then + Result := TcxCaptionRowProperties(Row.FProperties).Hint + else + if (Row.FProperties is TcxMultiEditorRowProperties) then + with TcxMultiEditorRowProperties(Row.FProperties), Row.ViewInfo.HeaderInfo do + for I := 0 to CaptionsInfo.Count - 1 do + if cxRectPtIn(CaptionsInfo[I].CaptionRect, P) then + begin + Result := Editors[I].Hint; + break; + end; +end; + +{ TcxCaptionInfoList } + +function TcxCaptionInfoList.GetItem(Index: Integer): TcxRowCaptionInfo; +begin +{$IFDEF LABEL45} + Result := TcxRowCaptionInfo(inherited Items[Index]); +{$ELSE} + Result := TcxRowCaptionInfo(List^[Index]); +{$ENDIF} +end; + +{ TcxValueInfoList } + +constructor TcxValueInfoList.Create(AViewInfo: TcxvgCustomViewInfo); +begin + inherited Create; + Capacity := 64; + FViewInfo := AViewInfo; +end; + +destructor TcxValueInfoList.Destroy; +var + I: Integer; +begin + for I := 0 to Count - 1 do + FViewInfo.RemoveEditCellViewInfo(GetItem(I)); + inherited Destroy; +end; + +procedure TcxValueInfoList.Trunc(ACount: Integer); +var + I: Integer; +begin + if ACount < Count then + begin + for I := ACount to Count - 1 do + FViewInfo.RemoveEditCellViewInfo(GetItem(I)); + Count := ACount; + end; +end; + +function TcxValueInfoList.GetItem(Index: Integer): TcxRowValueInfo; +begin + Result := TcxRowValueInfo(List^[Index]); +end; + +{ TcxCustomRowHeaderInfo } + +constructor TcxCustomRowHeaderInfo.Create(ARow: TcxCustomRow); +begin + FCaptionsInfo := TcxCaptionInfoList.Create; + FCategoryIndents := TIndentInfoList.Create; + FLinesInfo := TLineInfoList.Create; + FRow := ARow; + FRowIndents := TIndentInfoList.Create; +end; + +destructor TcxCustomRowHeaderInfo.Destroy; +begin + FreeAndNil(FCaptionsInfo); + FreeAndNil(FLinesInfo); + FreeAndNil(FRowIndents); + FreeAndNil(FCategoryIndents); + inherited Destroy; +end; + +function TcxCustomRowHeaderInfo.GetPaintStyle: TcxvgPaintStyle; +begin + Result := VerticalGrid.OptionsView.PaintStyle; +end; + +function TcxCustomRowHeaderInfo.GetSelected: Boolean; +begin + with VerticalGrid.Controller do + Result := (DesignSelectionHelper <> nil) and + DesignSelectionHelper.IsObjectSelected(Row); +end; + +function TcxCustomRowHeaderInfo.GetShowButton: Boolean; +begin + with VerticalGrid.OptionsView do + Result := ShowButtons and ShowHeaders and Row.Options.ShowExpandButton and + Row.HasVisibleChildren; +end; + +function TcxCustomRowHeaderInfo.GetVerticalGrid: TcxCustomVerticalGrid; +begin + Result := Row.VerticalGrid; +end; + +procedure TcxCustomRowHeaderInfo.AddBottomHorzLine(const R: TRect); +begin + with ViewInfo, R do + if HorzLineWidth > 0 then + Self.LinesInfo.Add(Left, Bottom, Right - Left, HorzLineWidth, HorzLineBrush); +end; + +procedure TcxCustomRowHeaderInfo.AddBoundHeaderLines; +begin + ViewInfo.CalcHelper.AddBoundHeaderLines(Self); +end; + +procedure TcxCustomRowHeaderInfo.AddNextIndentInfo(const ABounds: TRect; + const AViewParams: TcxViewParams; + AToCategories, AUnderline, AAddVertLine: Boolean); +begin + if AToCategories then + CategoryIndents.Add(ABounds, AViewParams) + else + RowIndents.Add(ABounds, AViewParams); + ViewInfo.CalcHelper.AddHeaderIndentLines(Self, ABounds, AViewParams, + AToCategories, AUnderline, AAddVertLine); +end; + +procedure TcxCustomRowHeaderInfo.AddRightVertLine(const R: TRect); +begin + if ViewInfo.ShowHeaders then + ViewInfo.CalcHelper.AddDivider(LinesInfo, R, clNone, False); +end; + +procedure TcxCustomRowHeaderInfo.Calc(const AHeaderRect: TRect; + AViewInfo: TcxvgCustomViewInfo; ANextRow: TcxCustomRow; + ACalcBounds: Boolean); +begin + FViewInfo := AViewInfo; + Clear; + FTransparent := False; + FHeaderRect := AHeaderRect; + FFocused := FRow = VerticalGrid.FocusedRow; + CalcViewParams(ACalcBounds); + CalcIndentBounds(ANextRow, ACalcBounds); + CalcExpandButton; + AddBoundHeaderLines; + FHeaderCellsRect := AHeaderRect; + FHeaderCellsRect.Left := IndentBounds.Right; + if not cxRectIsEmpty(FHeaderCellsRect) then + begin + AddRightVertLine(AHeaderRect); + CalcRowCaptionsInfo; + FFocusRect := GetFocusRect; + end + else + FHeaderCellsRect := cxNullRect; +end; + +function TcxCustomRowHeaderInfo.CalcCaptionInfo( + ARowProperties: TcxCaptionRowProperties; const R: TRect): TcxRowCaptionInfo; +var + W: Integer; + AOffset: TRect; +begin + Result := TcxRowCaptionInfo.Create; + with Result do + begin + FRow := Self.Row; + FCaptionRect := R; + FImages := VerticalGrid.Images; + if FImages <> nil then + begin + W := ViewInfo.ImageSize.cx; + if (ARowProperties.ImageIndex >= 0) and (ARowProperties.ImageIndex < FImages.Count) then + FImageIndex := ARowProperties.ImageIndex + else + begin + if not VerticalGrid.OptionsView.FShowEmptyRowImage then W := 0; + FImageIndex := -1; + end; + end + else W := 0; + FImageRect := cxRectBounds(R.Left, GetTopCentralPoint(ViewInfo.ImageSize.cy, R), W, ViewInfo.ImageSize.cy); + with R do + begin + FCaptionTextRect := cxRect(FImageRect.Right + 1, Top, + FImageRect.Right + 1 + Max(0, Right - FImageRect.Right - 2), Bottom); + end; + AOffset := GetTextEditDrawTextOffset(ARowProperties.HeaderAlignmentHorz, True); + with FCaptionTextRect do + begin + Inc(Top, AOffset.Top + 1); + Inc(Left, AOffset.Left + 1); + Dec(Bottom, AOffset.Bottom + 1); + Dec(Right, AOffset.Right + 1); + end; + FTextFlags := GetTextAligmentFlags(ARowProperties); + if VerticalGrid.OptionsView.CellEndEllipsis then + FTextFlags := FTextFlags or CXTO_END_ELLIPSIS; + FViewParams := GetCaptionViewParams; + FCaption := ARowProperties.Caption; + FFocused := FRow = VerticalGrid.FocusedRow; + end; +end; + +procedure TcxCustomRowHeaderInfo.CalcExpandButton; +begin + if GetShowButton then + begin + DoCalcExpandButton; + FButtonColor := GetButtonColor; + end; +end; + +function TcxCustomRowHeaderInfo.CalcIndentsInfo(ALevelCount: Integer; + ANextRow: TcxCustomRow): TIndentRectInfoList; +var + ACurRow: TcxCustomRow; + AUnderline, AIsCategory: Boolean; + I, ANextRowLevel: Integer; +begin + Result := TIndentRectInfoList.Create; + if ANextRow = nil then ANextRowLevel := -1 else ANextRowLevel := ANextRow.Level; + ACurRow := Row; + for I := ALevelCount downto 0 do + begin + AIsCategory := ACurRow is TcxCategoryRow; + if AIsCategory then + AUnderline := (ANextRow = nil) or (ACurRow.Level >= ANextRowLevel) + else + AUnderline := I = ALevelCount; + Result.Add(cxSize(ViewInfo.RowIndentWidth, cxRectHeight(HeaderRect)), + AIsCategory, AUnderline, ViewInfo.CalcHelper.GetIndentViewParams(Row, ACurRow)); + ACurRow := ACurRow.FParent; + end; +end; + +procedure TcxCustomRowHeaderInfo.CalcIndentBounds(ANextRow: TcxCustomRow; + ACalculate: Boolean); +var + R: TRect; + I, J, W, ALevelCount, ANextLevel, AHeight, ABoundsWidth: Integer; + AIndents: TIndentRectInfoList; +begin + AHeight := cxRectHeight(HeaderRect); + R := cxRectBounds(HeaderRect.Left, HeaderRect.Top, 0, AHeight); + if not ACalculate then + begin + FIndentBounds := R; + Exit; + end; + ALevelCount := cxSetValue(ViewInfo.ShowHeaders, Row.Level, -1); + if ANextRow = nil then ANextLevel := -1 else ANextLevel := ANextRow.Level; + AIndents := CalcIndentsInfo(ALevelCount, ANextRow); + ABoundsWidth := 0; + W := ViewInfo.VertLineWidth; + J := 0; + try + for I := 0 to ALevelCount do + with AIndents[ALevelCount - I]^ do + begin + if IsCategory then + begin + if R.Right - R.Left > 0 then + begin + Inc(R.Right, W); + cxRectIntersect(R, R, HeaderRect); + if not cxRectIsEmpty(R) then + AddNextIndentInfo(R, AIndents[ALevelCount - J].ViewParams, False, ANextLevel - I <= 0, True); + Inc(ABoundsWidth, W); + end; + cxRectIntersect(R, cxRectBounds(HeaderRect.Left + ABoundsWidth, + HeaderRect.Top, Size.cx + W, Size.cy), HeaderRect); + if not cxRectIsEmpty(R) then + AddNextIndentInfo(cxRectBounds(HeaderRect.Left + ABoundsWidth, HeaderRect.Top, + Size.cx + W, Size.cy), ViewParams, True, Underline, I < ALevelCount); + Inc(ABoundsWidth, cxSetValue(I < ALevelCount, W, cxSetValue(IncreaseBoundsByLastVertLine, W, 0))); + R := cxRectBounds(HeaderRect.Left + ABoundsWidth + Size.cx, HeaderRect.Top, 0, AHeight); + end + else + begin + Inc(R.Right, Size.cx); + J := I; + end; + Inc(ABoundsWidth, Size.cx); + end; + cxRectIntersect(R, R, FHeaderRect); + if not cxRectIsEmpty(R) then + AddNextIndentInfo(R, AIndents[ALevelCount - J].ViewParams, False, True, False); + with HeaderRect do + FIndentBounds := cxRectBounds(Left, Top, ABoundsWidth, AHeight); + finally + AIndents.Free; + end; +end; + +procedure TcxCustomRowHeaderInfo.CalcRowCaptionsInfo; +var + ACaptionInfo: TcxRowCaptionInfo; +begin + ACaptionInfo := CalcCaptionInfo(TcxCaptionRowProperties(Row.FProperties), HeaderCellsRect); + CaptionsInfo.Add(ACaptionInfo); +end; + +procedure TcxCustomRowHeaderInfo.CalcViewParams(AAllowFocus: Boolean); +begin + FIndentViewParams := VerticalGrid.Styles.GetHeaderParams(Row); + if AAllowFocus and Focused and (PaintStyle = psDotNet) then + begin + ViewParams := VerticalGrid.Styles.GetSelectedHeaderParams(Row) + end + else + ViewParams := IndentViewParams; +end; + +procedure TcxCustomRowHeaderInfo.Clear; +begin + FCaptionsInfo.Clear; + FLinesInfo.Clear; + FRowIndents.Clear; + FCategoryIndents.Clear; + FButtonRect := cxNullRect; + FFocusRect := cxNullRect; +end; + +procedure TcxCustomRowHeaderInfo.DoCalcExpandButton; +var + AWidth: Integer; + AButtonPlace: TRect; +begin + AWidth := GetButtonPlaceBackgroundWidth; + with IndentBounds do + AButtonPlace := cxRect(Right - AWidth, Top, Right, Bottom); + FButtonRect := cxRectCenter(AButtonPlace, ViewInfo.ButtonSize, ViewInfo.ButtonSize); +end; + +function TcxCustomRowHeaderInfo.GetButtonPlaceBackgroundWidth: Integer; +begin + Result := ViewInfo.RowIndentWidth; +end; + +function TcxCustomRowHeaderInfo.GetCaptionViewParams: TcxViewParams; +begin + Result := FViewParams; +end; + +function TcxCustomRowHeaderInfo.GetButtonColor: TColor; +begin + Result := clWindow; +end; + +function TcxCustomRowHeaderInfo.GetFocusRect: TRect; +begin + Result := cxNullRect; +end; + +function TcxCustomRowHeaderInfo.GetTopCentralPoint(AHeight: Integer; + const R: TRect): Integer; +begin + Result := R.Top + (cxRectHeight(R) - AHeight) div 2; +end; + +function TcxCustomRowHeaderInfo.IncreaseBoundsByLastVertLine: Boolean; +begin + Result := False; +end; + +function TcxCustomRowHeaderInfo.LeftViewPoint: Integer; +begin + Result := FHeaderRect.Left; + if (PaintStyle = psDotNet) and (FRowIndents.Count > 0) then + Result := FRowIndents[FRowIndents.Count - 1].Bounds.Left; +end; + +{ TcxCustomRowViewInfo } + +constructor TcxCustomRowViewInfo.Create(ARow: TcxCustomRow); +begin + FRow := ARow; + FBandIndex := -1; + FBandRowIndex := -1; + FValuesInfo := TcxValueInfoList.Create(VerticalGrid.ViewInfo); + FHeaderInfo := Row.CreateHeaderInfo; +end; + +destructor TcxCustomRowViewInfo.Destroy; +begin + FRow.FViewInfo := nil; + FreeAndNil(FValuesInfo); + FreeAndNil(FHeaderInfo); + inherited Destroy; +end; + +procedure TcxCustomRowViewInfo.Calc(const ARowRect: TRect; + AViewInfo: TcxvgCustomViewInfo; ANextRow: TcxCustomRow); +begin + FViewInfo := AViewInfo; + FRowRect := ARowRect; + AViewInfo.CalcRowRects(Self); + CalcRowHeaderInfo(ANextRow); + CalcValuesInfo; + CalcPaintViewParamsLines(ANextRow); +end; + +procedure TcxCustomRowViewInfo.Update; +begin + ValuesInfo.Trunc(0); + with VerticalGrid, ViewInfo do + begin + if Row = FocusedRow then + ChangeFocusedRow(Row, PrevVisibleRow(Row)) + else + begin + LinesInfo.Locked := True; + FocusLinesInfo.Locked := True; + try + Self.Calc(RowRect, ViewInfo, NextVisibleRow(Row)); + finally + LinesInfo.Locked := False; + FocusLinesInfo.Locked := False; + InvalidateRect(RowRect, False); + end; + end; + end; +end; + +procedure TcxCustomRowViewInfo.UpdateRecord(ARecordIndex: Integer); +var + I: Integer; + ACellInfo: TcxRowValueInfo; +begin + ValidateViewInfo; + CalcValuesInfo; + for I := 0 to ValuesInfo.Count - 1 do + begin + ACellInfo := ValuesInfo[I]; + if ACellInfo.FRecordIndex = ARecordIndex then + begin + ACellInfo.Invalidate(True); + ACellInfo.UpdateEditRect; + end; + end; +end; + +procedure TcxCustomRowViewInfo.AddRectValueLines(R: TRect; + ALast, ABottomLineNeeded: Boolean); +begin + with ViewInfo do + begin + if ALast then + begin + if R.Left > ClipRect.Right then Exit; + if R.Right > ClipRect.Right then R.Right := ClipRect.Right; + end; + if ABottomLineNeeded then + AddBottomValueSide(R); + AddRightValueSide(R, ALast); + end; +end; + +procedure TcxCustomRowViewInfo.CalcRowHeaderInfo(ANextRow: TcxCustomRow); +begin + HeaderInfo.Calc(HeaderInfo.HeaderRect, ViewInfo, ANextRow, True); +end; + +function TcxCustomRowViewInfo.CalcRowValueInfo( + ARowProperties: TcxCustomRowProperties; + AViewInfo: TcxvgCustomViewInfo; + ARecordIndex, ACellIndex: Integer): TcxRowValueInfo; +var + AEditContainer: TcxCellEdit; +begin + FViewInfo := AViewInfo; + AEditContainer := FRow.GetEditContainer(ACellIndex); + if AEditContainer = nil then + begin + Result := nil; + Exit; + end; + Result := GetRowValueInfo(ARecordIndex, ACellIndex); + if Result = nil then + begin + Result := TcxRowValueInfo(AViewInfo.AddEditCellViewInfo(GetRowValueInfoClass, AEditContainer)); + with Result do + begin + FRow := Self.Row; + FRecordIndex := ARecordIndex; + FRowCellIndex := ACellIndex; + end; + AEditContainer.InitEditViewInfo(Result); + FValuesInfo.Insert(0, Result); + end + else + with FValuesInfo do Move(IndexOf(Result), 0); +end; + +procedure TcxCustomRowViewInfo.CalcPaintViewParamsLines(ANextRow: TcxCustomRow); +begin + ViewInfo.CalcHelper.CalcPaintViewParamsLines(Self, ANextRow); +end; + +function TcxCustomRowViewInfo.GetValueHeight(ARecordIndex: Integer; + AWidth: Integer; AViewInfo: TcxvgCustomViewInfo): Integer; +begin + Result := -1; +end; + +function TcxCustomRowViewInfo.GetRowValueInfoClass: TcxRowValueInfoClass; +begin + Result := TcxRowValueInfo; +end; + +procedure TcxCustomRowViewInfo.ValidateViewInfo; +begin + if ViewInfo = nil then + FViewInfo := VerticalGrid.ViewInfo; +end; + +function TcxCustomRowViewInfo.GetRowValueInfo(ARecordIndex, + ACellIndex: Integer): TcxRowValueInfo; +var + I: Integer; + ARowValueInfo: TcxRowValueInfo; +begin + Result := nil; + if ValuesInfo = nil then Exit; + for I := 0 to ValuesInfo.Count - 1 do + begin + ARowValueInfo := ValuesInfo[I]; + with ARowValueInfo do + if (RecordIndex = ARecordIndex) and (RowCellIndex = ACellIndex) then + begin + Result := ARowValueInfo; + break + end; + end; +end; + +function TcxCustomRowViewInfo.GetVerticalGrid: TcxCustomVerticalGrid; +begin + Result := Row.VerticalGrid; +end; + +{ TcxRowViewInfoList } + +constructor TcxRowViewInfoList.Create; +begin + Capacity := 1024; +end; + +function TcxRowViewInfoList.Find(ARow: TcxCustomRow): TcxCustomRowViewInfo; +var + I: Integer; + AViewInfo: TcxCustomRowViewInfo; +begin + Result := nil; + if ARow = nil then Exit; + for I := 0 to Count - 1 do + begin + AViewInfo := List^[I]; + if AViewInfo.Row = ARow then + begin + Result := AViewInfo; + break; + end; + end; +end; + +function TcxRowViewInfoList.GetItem(Index: Integer): TcxCustomRowViewInfo; +begin + Result := List^[Index]; +end; + +{ TcxvgCustomViewInfo } + +constructor TcxvgCustomViewInfo.Create( + AOwner: TcxEditingControl); +begin + inherited Create(AOwner); + FVerticalGrid := TcxCustomVerticalGrid(AOwner); + FVisibleRows := TList.Create; + FLinesInfo := TLineInfoList.Create; + FFocusLinesInfo := TLineInfoList.Create; + FRowsViewInfo := TcxRowViewInfoList.Create; + FViewRects := TViewRects.Create; + FHorzLineWidth := 1; + FVertLineWidth := 1; + FCalcHelper := CreateCalcHelper; + FLockDividerPos := True; + CalcLayoutGeneral; + UpdateVisibleRows; + UpdateScroller; +end; + +destructor TcxvgCustomViewInfo.Destroy; +var + I: Integer; +begin + ClearLinesAndRows; + FreeAndNil(FCalcHelper); + FreeAndNil(FLinesInfo); + FreeAndNil(FFocusLinesInfo); + FreeAndNil(FRowsViewInfo); + FreeAndNil(FViewRects); + FreeAndNil(FVisibleRows); + // destroy rows viewinfos on RecreateViewInfo + with VerticalGrid do + if not IsDestroying then + for I := 0 to Rows.Count - 1 do Rows[I].ViewInfo.Free; + DestroyBrushes; + inherited Destroy; +end; + +procedure TcxvgCustomViewInfo.CalcEditCell( + const ABounds: TRect; ARowValueInfo: TcxRowValueInfo); +begin + if ARowValueInfo <> nil then + ARowValueInfo.SetBounds(ABounds, ClipRect); +end; + +function TcxvgCustomViewInfo.CalcRowHeight(ARow: TcxCustomRow): Integer; +begin + Result := GetRowHeight(ARow.ViewInfo, ViewValueWidth); +end; + +procedure TcxvgCustomViewInfo.ChangeFocusedRow( + ANewFocus, AOldFocus: TcxCustomRow); +var + R: TRect; +begin + if VerticalGrid.IsLocked then Exit; + LinesInfo.Locked := True; + try + R := CalcHelper.ChangeFocusedRow(ANewFocus, AOldFocus); + finally + LinesInfo.Locked := False; + end; + Inc(R.Bottom, HorzLineWidth); // + VerticalGrid.InvalidateRect(R, False); +end; + +function TcxvgCustomViewInfo.GetDefaultGridModeBufferCount: Integer; +begin + Result := GetVisibleValueCount; +end; + +function TcxvgCustomViewInfo.GetRowViewInfo( + ARow: TcxCustomRow): TcxCustomRowViewInfo; +begin + Result := RowsViewInfo.Find(ARow); +end; + +function TcxvgCustomViewInfo.GetValueRect(AValueIndex: Integer; + ARowViewInfo: TcxCustomRowViewInfo): TRect; +begin + with ARowViewInfo, RowRect do + Result := cxRect(ValuesRect.Left, Top, Right, Bottom); +end; + +function TcxvgCustomViewInfo.GetValuesRect( + ARowViewInfo: TcxCustomRowViewInfo): TRect; +begin + with ARowViewInfo, RowRect do + Result := cxRect(Left + ViewHeaderWidth + DividerWidth, Top, Right, Bottom); +end; + +procedure TcxvgCustomViewInfo.UpdateRecord(ARecordIndex: Integer); +var + I: Integer; +begin + if (ARecordIndex < 0) or VerticalGrid.IsLocked then Exit; + for I := 0 to RowsViewInfo.Count - 1 do + RowsViewInfo[I].UpdateRecord(ARecordIndex); +end; + +function TcxvgCustomViewInfo.CalculateDefaultEditHeight: Integer; +begin + Result := FRowMinHeight; +end; + +procedure TcxvgCustomViewInfo.DoCalculate; +begin + Reset; + CalcLayoutGeneral; + UpdateVisibleRows; + Scroller.RecalcBandsInfo; + CalcBandWidth; + ClearLinesAndRows; + CalcViewRects; + CalcRowsViewInfo; + AddEmptyRects; +end; + +procedure TcxvgCustomViewInfo.UpdateSelection; +begin + inherited UpdateSelection; + VerticalGrid.Controller.RefreshFocusedRow; +end; + +procedure TcxvgCustomViewInfo.AddBandRowsLines(const R: TRect); +begin + with R do + begin + if HorzLineWidth > 0 then + begin + LinesInfo.Add(Left, Top, Right - Left, HorzLineWidth, BandBorderColor); + LinesInfo.Add(Left + VertLineWidth, Bottom - HorzLineWidth, + (Right - Left) - 2 * VertLineWidth, HorzLineWidth, BandBorderColor); + end; + if VertLineWidth > 0 then + LinesInfo.Add(Left, Top + HorzLineWidth, VertLineWidth, + (Bottom - Top) - HorzLineWidth, BandBorderColor); + end; +end; + +procedure TcxvgCustomViewInfo.AddBottomValueSide(const R: TRect); +begin + with R do + if HorzLineWidth > 0 then + LinesInfo.Add(Left, Bottom, Right - Left, HorzLineWidth, HorzLineBrush); +end; + +procedure TcxvgCustomViewInfo.AddRightValueSide(const R: TRect; + ALast: Boolean); +begin + with R do + if VertLineWidth > 0 then + if ALast then + LinesInfo.Add(Right, Top, VertLineWidth, Bottom - Top + HorzLineWidth, BandBorderColor) + else + LinesInfo.Add(Right, Top, VertLineWidth, Bottom - Top + HorzLineWidth, VertLineBrush); +end; + +procedure TcxvgCustomViewInfo.CalcBandRects; +var + ASumHeight: Integer; + I: Integer; + ARowViewInfo: TcxCustomRowViewInfo; +begin + ASumHeight := HorzLineWidth; + for I := Scroller.TopVisibleRowIndex to VisibleRowCount - 1 do + begin + ARowViewInfo := VisibleRows[I].ViewInfo; + ARowViewInfo.CalculatedHeight := GetRowHeight(ARowViewInfo, ViewBandWidth); + Inc(ASumHeight, ARowViewInfo.CalculatedHeight + HorzLineWidth); + end; + CreateBand(ASumHeight, ViewBandWidth); +end; + +procedure TcxvgCustomViewInfo.CalcBandRowsViewInfo( + var AFirstRowIndex: Integer; const ABandRect: TRect; + ABandIndex, ABandRowCount: Integer); +var + ATop, AWidth, ABandRowIndex: Integer; + ARow, ANextRow: TcxCustomRow; + ARowRect: TRect; + ARowViewInfo: TcxCustomRowViewInfo; +begin + ABandRowIndex := 0; + ATop := ABandRect.Top + HorzLineWidth; + ARow := VisibleRows[AFirstRowIndex]; + AWidth := cxRectWidth(ABandRect) - 2 * VertLineWidth; + if AWidth > 0 then + while AFirstRowIndex < VisibleRowCount do + begin + if ARow = nil then break; + ANextRow := VisibleRows[AFirstRowIndex + 1]; + ARowViewInfo := ARow.ViewInfo; + ARowRect := cxRectBounds(ABandRect.Left + VertLineWidth, ATop, AWidth, + ARowViewInfo.CalculatedHeight); + if not CanAddRowToBand(ARowRect, ABandRect, ABandRowIndex) then break; + ARowViewInfo.BandIndex := ABandIndex; + ARowViewInfo.BandRowIndex := ABandRowIndex; + ARowViewInfo.Calc(ARowRect, Self, ANextRow); + RowsViewInfo.Add(ARowViewInfo); + AddBandRowsLines(ABandRect); + Inc(ATop, ARowViewInfo.CalculatedHeight + HorzLineWidth); + ARow := ANextRow; + Inc(AFirstRowIndex); + Inc(ABandRowIndex); + end; +end; + +procedure TcxvgCustomViewInfo.CalcBandWidth; +begin + FViewBandWidth := GetViewBandWidth; + FViewHeaderWidth := GetViewHeaderWidth; + FViewValueWidth := GetViewValueWidth; +end; + +procedure TcxvgCustomViewInfo.CalcEmpty; +begin + if ShowHeaders then + with ClientRect do + FCalcHelper.AddDivider(LinesInfo, cxRect(Left, Top, Left + ViewHeaderWidth, + Bottom), clNone, False); +end; + +procedure TcxvgCustomViewInfo.CalcCategoryExplorerStyle; +var + ATheme: TdxTheme; +begin + FUseCategoryExplorerStyle := VerticalGrid.OptionsView.CategoryExplorerStyle and + AreVisualStylesAvailable([totExplorerBar]) and + (VerticalGrid.LookAndFeel.SkinPainter = nil); + if FUseCategoryExplorerStyle then + begin + ATheme := OpenTheme(totExplorerBar); + if ATheme <> 0 then + GetThemePartSize(ATheme, 0, EBP_NORMALGROUPEXPAND, + EBNGE_NORMAL, nil, TS_TRUE, @FExplorerButtonSize) + else + begin + FExplorerButtonSize := cxSize(FButtonSize, FButtonSize); + FUseCategoryExplorerStyle := False; + end; + end + else + FExplorerButtonSize := cxSize(FButtonSize, FButtonSize); +end; + +procedure TcxvgCustomViewInfo.CalcLayoutGeneral; +begin + with VerticalGrid do + begin + FClipRect := cxRectInflate(Self.ClientRect, -VertLineWidth, -FHorzLineWidth); + FBandsInterval := OptionsView.BandsInterval; + FRowHeaderMinWidth := OptionsView.RowHeaderMinWidth; + FShowHeaders := OptionsView.ShowHeaders; + FButtonSize := LookAndFeel.Painter.ExpandButtonSize; + FHorzLineWidth := Byte(OptionsView.GridLines in [vglHorizontal, vglBoth]); + FVertLineWidth := Byte(OptionsView.GridLines in [vglVertical, vglBoth]); + if Images <> nil then + FImageSize := cxSize(Images.Width, Images.Height) + else + FImageSize := cxNullSize; + if (FVertLineWidth > 0) and FShowHeaders then + DividerWidth := FCalcHelper.GetDividerWidth + else + DividerWidth := 0; + FBandBorderColor := FCalcHelper.GetBandBorderColor; + FRowIndentWidth := FCalcHelper.GetIndentWidth; + FBandMinWidth := FRowHeaderMinWidth + OptionsView.ValueMinWidth + DividerWidth; + FRowMinHeight := GetMinRowHeight; + if FShowHeaders then + FFullHeaderWidth := GetViewHeaderWidth + DividerWidth + else + FFullHeaderWidth := 0; + CreateBrushes; + CalcCategoryExplorerStyle; + end; +end; + +procedure TcxvgCustomViewInfo.CalcRowRects(ARowViewInfo: TcxCustomRowViewInfo); +begin + if not CheckShowRowHeader(ARowViewInfo) then Exit; + with ARowViewInfo, RowRect do + begin + FHeaderInfo.HeaderRect := cxRect(Left, Top, Left + ViewHeaderWidth, Bottom); + FValuesRect := cxRect(Left + ViewHeaderWidth + DividerWidth, Top, Right, Bottom); + end; +end; + +procedure TcxvgCustomViewInfo.CalcRowsViewInfo; +var + ARowIndex, ABandIndex, ALeftVisibleBand: Integer; + R: TRect; +begin + with Scroller do + begin + ARowIndex := TopVisibleRowIndex; + ALeftVisibleBand := LeftVisibleBand; + for ABandIndex := ALeftVisibleBand to BandsInfo.Count - 1 do + begin + if ABandIndex - ALeftVisibleBand > ViewRects.BandRects.Count - 1 then break; + R := ViewRects.BandRects[ABandIndex - ALeftVisibleBand]; + if R.Left > ClientRect.Right then + break + else + CalcBandRowsViewInfo(ARowIndex, R, ABandIndex, BandsInfo[ABandIndex].RowsCount); + end; + end; + if VisibleRowCount = 0 then CalcEmpty; +end; + +procedure TcxvgCustomViewInfo.CalcViewRects; +begin + ViewRects.Clear; + if VisibleRowCount = 0 then + begin + // make empty band + with ClientRect do + ViewRects.BandRects.Add(cxRect(Left, Top, Right, Top)); + ViewRects.EmptyRects.Add(ClientRect); + end + else + CalcBandRects; +end; + +function TcxvgCustomViewInfo.CanAddRowToBand(const ARowRect, + ABandRect: TRect; ABandRowIndex: Integer): Boolean; +begin + Result := ARowRect.Top < ABandRect.Bottom; +end; + +procedure TcxvgCustomViewInfo.CheckMaxRowHeaderWidth(var Value: Integer; AValueMinWidth: Integer); +begin +end; + +function TcxvgCustomViewInfo.CheckShowRowHeader( + ARowViewInfo: TcxCustomRowViewInfo): Boolean; +begin + Result := ShowHeaders; + if not Result then + begin + with ARowViewInfo.FHeaderInfo do + begin + FHeaderRect := ARowViewInfo.FRowRect; + FHeaderRect.Right := FHeaderRect.Left; + end; + ARowViewInfo.FValuesRect := ARowViewInfo.FRowRect; + end; +end; + +procedure TcxvgCustomViewInfo.CreateBand(ABandHeight, + ABandWidth: Integer); +var + ALeft, AClientHeight: Integer; + R: TRect; +begin + if ViewRects.BandRects.Count = 0 then + ALeft := ClientRect.Left + else + ALeft := ViewRects.BandRects.Rects[ViewRects.BandRects.Count - 1].Right; + AClientHeight := cxRectHeight(ClientRect); + R := cxRectBounds(ALeft, ClientRect.Top, ABandWidth, Min(ABandHeight, AClientHeight)); + ViewRects.BandRects.Add(R); + with R do + if Bottom - Top < AClientHeight then + ViewRects.EmptyRects.Add(cxRectBounds(Left, Bottom, ABandWidth, AClientHeight - (Bottom - Top))); +end; + +procedure TcxvgCustomViewInfo.CreateBrushes; +begin + DestroyBrushes; + FHorzLineBrush := FCalcHelper.CreateHorzLineBrush; + FVertLineBrush := FCalcHelper.CreateVertLineBrush; +end; + +function TcxvgCustomViewInfo.CreateCalcHelper: TcxvgCustomPaintStyleCalcHelper; +begin + Result := VerticalGrid.GetCalcHelperClass.Create(Self); +end; + +procedure TcxvgCustomViewInfo.DestroyBrushes; + + procedure DestroyBrush(var ABrush: TBrush); + begin + if ABrush <> nil then + begin + if ABrush.Bitmap <> nil then ABrush.Bitmap.Free; + ABrush.Free; + ABrush := nil; + end; + end; + +begin + DestroyBrush(FHorzLineBrush); + DestroyBrush(FVertLineBrush); +end; + +function TcxvgCustomViewInfo.GetBandSizeableRect(const ABandRect: TRect): TRect; +begin + with ABandRect do + Result := cxRect(Right - 1, Top, Right + 2, ClientRect.Bottom); +end; + +function TcxvgCustomViewInfo.GetRowAutoHeight(ARow: TcxCustomRow): Boolean; +begin + Result := VerticalGrid.OptionsView.CellAutoHeight; + if ARow <> nil then Result := Result and ARow.Options.CanAutoHeight and + not ARow.IsHeightAssigned; +end; + +function TcxvgCustomViewInfo.GetRowHeight( + ARowViewInfo: TcxCustomRowViewInfo; ABandWidth: Integer): Integer; +begin + Result := Max(ARowViewInfo.Row.GetRealHeight, FRowMinHeight); + if GetRowAutoHeight(ARowViewInfo.Row) then + Result := Max(ARowViewInfo.GetValueHeight(FirstVisibleRecordIndex, ViewValueWidth, Self), Result); +end; + +function TcxvgCustomViewInfo.GetViewBandWidth: Integer; +begin + Result := ClientRect.Right - ClientRect.Left; +end; + +function TcxvgCustomViewInfo.GetViewHeaderWidth: Integer; +begin + if ShowHeaders then + Result := Max(GetViewMinHeaderWidth, VerticalGrid.OptionsView.RowHeaderWidth) + else + Result := 0; +end; + +function TcxvgCustomViewInfo.GetViewMinHeaderWidth: Integer; +begin + Result := 1 + (RowIndentWidth + VertLineWidth) * (MaxVisibleLevel + 1); +end; + +function TcxvgCustomViewInfo.GetViewValueWidth: Integer; +begin + Result := VerticalGrid.OptionsView.ValueWidth; +end; + +procedure TcxvgCustomViewInfo.LayoutStyleChanged; +begin + Scroller.LayoutStyleChanged; +end; + +procedure TcxvgCustomViewInfo.Reset; +var + AValueInfo: TcxRowValueInfo; +begin + with VerticalGrid.Controller do + begin + AValueInfo := TcxRowValueInfo(EditingViewInfo); + if AValueInfo <> nil then + begin + AValueInfo.CellEditRect := cxNullRect; + AValueInfo.ItemVisible := False; + end; + end; +end; + +function TcxvgCustomViewInfo.ScaleRowRects( + ARowViewInfo: TcxCustomRowViewInfo): TRectScaler; +begin + Result := TRectScaler.Create; + with Result do + begin + Add(ViewHeaderWidth, RowHeaderMinWidth, DividerWidth); + Add(ViewBandWidth - ViewHeaderWidth, BandMinWidth); + ScaleRect(ARowViewInfo.RowRect); + end; +end; + +procedure TcxvgCustomViewInfo.SetDividerPos(APos: Integer); +var + AValueWidth: Integer; +begin + with VerticalGrid.OptionsView do + if APos <> RowHeaderWidth then + begin + AValueWidth := ViewBandWidth - (APos + DividerWidth); + if AValueWidth < ValueMinWidth then + APos := ViewBandWidth - ValueMinWidth; + RowHeaderWidth := APos; + end; +end; + +procedure TcxvgCustomViewInfo.SetValueWidth(AWidth: Integer); +begin + VerticalGrid.OptionsView.ValueWidth := AWidth; +end; + +procedure TcxvgCustomViewInfo.UpdateVisibleRows; +var + ARow: TcxCustomRow; + I: Integer; +begin + FMaxVisibleLevel := 0; + FVisibleRows.Clear; + with FVerticalGrid do + for I := 0 to Rows.Count - 1 do + begin + ARow := TcxCustomRow(FRows.FList.List^[I]); // Rows[I]; + if IsRowVisible(ARow) then + begin + FMaxVisibleLevel := Max(FMaxVisibleLevel, ARow.Level); + ARow.FVisibleIndex := FVisibleRows.Count; + FVisibleRows.Add(ARow); + end + else + ARow.FVisibleIndex := -1; + end; +end; + +procedure TcxvgCustomViewInfo.Clear; +begin + ClearLinesAndRows; + ViewRects.Clear; +end; + +procedure TcxvgCustomViewInfo.ClearLinesAndRows; +begin + FLinesInfo.Clear; + FFocusLinesInfo.Clear; + FRowsViewInfo.Clear; +end; + +function TcxvgCustomViewInfo.GetBandInfo: TBandInfoList; +begin + Result := Scroller.ScrollStrategy.BandsInfo; +end; + +function TcxvgCustomViewInfo.GetFirstVisibleRecordIndex: Integer; +begin + if VerticalGrid.RecordCount = 0 then + Result := -1 + else + Result := Scroller.LeftVisibleRecord; +end; + +function TcxvgCustomViewInfo.GetMinRowHeight: Integer; +begin + Result := cxScreenCanvas.FontHeight(VerticalGrid.Font) + cxTextOffset; + with VerticalGrid.OptionsView do + if (FRowHeight >= 0) and (FRowHeight > Result) then Result := FRowHeight; + if FImageSize.cy + 2 > Result then + Result := FImageSize.cy + 2; +end; + +function TcxvgCustomViewInfo.GetPainter: TcxvgPainter; +begin + Result := TcxvgPainter(inherited Painter); +end; + +function TcxvgCustomViewInfo.GetScroller: TcxvgScroller; +begin + Result := VerticalGrid.Controller.Scroller; +end; + +function TcxvgCustomViewInfo.GetVisibleRow( + Index: Integer): TcxCustomRow; +begin + if (Index >= 0) and (Index < FVisibleRows.Count) then + Result := TcxCustomRow(FVisibleRows.List^[Index]) + else + Result := nil; +end; + +function TcxvgCustomViewInfo.GetVisibleRowCount: Integer; +begin + Result := FVisibleRows.Count; +end; + +procedure TcxvgCustomViewInfo.UpdateScroller; +begin + with FVerticalGrid.Controller.Scroller do + begin + RecreateScrollStrategy; + ScrollStrategy.FViewInfo := Self; + end; +end; + +{ TcxvgCustomPaintStyleCalcHelper } + +constructor TcxvgCustomPaintStyleCalcHelper.Create( + AViewInfo: TcxvgCustomViewInfo); +begin + FViewInfo := AViewInfo; + FVerticalGrid := AViewInfo.VerticalGrid; + FScroller := AViewInfo.Scroller; +end; + +function TcxvgCustomPaintStyleCalcHelper.GetBandBorderColor: TColor; +begin + Result := VerticalGrid.OptionsView.GridLineColor; +end; + +function TcxvgCustomPaintStyleCalcHelper.GetBackgroundColor: TColor; +begin + Result := GetHeaderColor; +end; + +{ TcxvgDotNetStyleCalcHelper } + +procedure TcxvgDotNetStyleCalcHelper.AddBoundHeaderLines( + ARowHeaderInfo: TcxCustomRowHeaderInfo); +begin + with ARowHeaderInfo, IndentBounds do + AddBottomHorzLine(cxRectBounds(Right, Top, HeaderRect.Right - Right, Bottom - Top)); +end; + +procedure TcxvgDotNetStyleCalcHelper.AddDivider( + ALinesInfo: TLineInfoList; const R: TRect; AColor: TColor; AIsSeparator: Boolean); +begin + with ViewInfo, R do + if DividerWidth > 0 then + ALinesInfo.Add(Right, Top, VertLineWidth, Bottom - Top + HorzLineWidth, VertLineBrush); +end; + +procedure TcxvgDotNetStyleCalcHelper.AddHeaderIndentLines( + ARowHeaderInfo: TcxCustomRowHeaderInfo; const R: TRect; + const AViewParams: TcxViewParams; + AToCategories, AUnderline, AAddVertLine: Boolean); +var + W: Integer; +begin + with ViewInfo, R do + begin + if not ShowHeaders then Exit; + if AAddVertLine and (VertLineWidth > 0) then + ARowHeaderInfo.LinesInfo.Add(Right - VertLineWidth, Top, VertLineWidth, + Bottom - Top + HorzLineWidth, VertLineBrush); + if HorzLineWidth > 0 then + begin + W := Right - Left; + if AAddVertLine then Dec(W, VertLineWidth); + if AUnderline then + ARowHeaderInfo.LinesInfo.Add(Left, Bottom, W, HorzLineWidth, HorzLineBrush) + else + if (AViewParams.Bitmap <> nil) and not AViewParams.Bitmap.Empty then + ARowHeaderInfo.RowIndents.Add(cxRectBounds(Left, Bottom, W, HorzLineWidth), AViewParams) + else + ARowHeaderInfo.LinesInfo.Add(Left, Bottom, W, HorzLineWidth, AViewParams.Color); + end; + end; +end; + +procedure TcxvgDotNetStyleCalcHelper.CalcPaintViewParamsLines( + ARowViewInfo: TcxCustomRowViewInfo; ANextRow: TcxCustomRow); +begin +end; + +function TcxvgDotNetStyleCalcHelper.ChangeFocusedRow( + ANewFocus, AOldFocus: TcxCustomRow): TRect; +var + ARecalcChild: Boolean; + + procedure ProcessRow(ARow: TcxCustomRow); + var + ARowViewInfo: TcxCustomRowViewInfo; + ASaveColor: TColor; + I: Integer; + ANextRow: TcxCustomRow; + begin + ARowViewInfo := ViewInfo.GetRowViewInfo(ARow); + if ARowViewInfo = nil then Exit; + with ARowViewInfo, ViewInfo do + begin + ASaveColor := HeaderInfo.IndentViewParams.Color; + Result := cxRectUnion(Result, RowRect); + ANextRow := VisibleRows[ARow.VisibleIndex + 1]; + Calc(RowRect, Self.ViewInfo, VisibleRows[ARow.VisibleIndex + 1]); + ARecalcChild := ARecalcChild or + ((ASaveColor <> HeaderInfo.IndentViewParams.Color) and (Row is TcxCategoryRow)); + if ARecalcChild and (ANextRow <> nil) then + for I := ANextRow.VisibleIndex to VisibleRowCount - 1 do + if ARow.IsParent(VisibleRows[I]) then + with VisibleRows[I].ViewInfo, HeaderInfo do + begin + ANextRow := VisibleRows[ARow.VisibleIndex + 1]; + HeaderInfo.Calc(HeaderRect, Self.ViewInfo, ANextRow, True); + Result := cxRectUnion(Result, HeaderRect); + end + else + break + end; + end; + +begin + Result := cxNullRect; + ARecalcChild := False; + ProcessRow(ANewFocus); + ProcessRow(AOldFocus); +end; + +function TcxvgDotNetStyleCalcHelper.GetCategoryColor: TColor; +begin + Result := ViewInfo.Painter.Painter.DefaultHeaderColor; +end; + +function TcxvgDotNetStyleCalcHelper.GetCategoryFocusRect( + ARowHeaderInfo: TcxCustomRowHeaderInfo): TRect; +var + ATextRect: TRect; + ASize: TSize; + ACaption: string; + AHeaderInfo: TcxCategoryRowHeaderInfo; + AProperties: TcxCaptionRowProperties; +begin + Result := cxNullRect; + if VerticalGrid.FocusedRow <> ARowHeaderInfo.Row then Exit; + AHeaderInfo := TcxCategoryRowHeaderInfo(ARowHeaderInfo); + AProperties := AHeaderInfo.Row.Properties; + ACaption := AProperties.Caption; + if ACaption = '' then Exit; + ATextRect := AHeaderInfo.CaptionsInfo[0].CaptionTextRect; + ASize := cxTextExtent(AHeaderInfo.ViewParams.Font, ACaption); + with ATextRect do + begin + case AProperties.HeaderAlignmentHorz of + taLeftJustify: Right := Left + ASize.cx; + taRightJustify: Left := Right - ASize.cx; + else + ATextRect := cxRectCenter(ATextRect, ASize.cx, Bottom - Top); + end; + case AProperties.HeaderAlignmentVert of + vaTop: Bottom := Top + ASize.cy; + vaBottom: Top := Bottom - ASize.cy; + else + ATextRect := cxRectCenter(ATextRect, Right - Left, ASize.cy); + end; + end; + cxRectIntersect(Result, cxRectInflate(ATextRect, 1, 1), AHeaderInfo.HeaderRect); +end; + +function TcxvgDotNetStyleCalcHelper.GetCategoryTextColor: TColor; +begin + Result := clGrayText; +end; + +function TcxvgDotNetStyleCalcHelper.GetContentColor(AFocused: Boolean): TColor; +begin + Result := ViewInfo.Painter.Painter.DefaultContentColor; +end; + +function TcxvgDotNetStyleCalcHelper.GetContentTextColor: TColor; +begin + Result := ViewInfo.Painter.Painter.DefaultContentTextColor; +end; + +function TcxvgDotNetStyleCalcHelper.GetHeaderColor: TColor; +begin + Result := ViewInfo.Painter.Painter.DefaultContentColor; +end; + +function TcxvgDotNetStyleCalcHelper.GetHeaderTextColor: TColor; +begin + Result := ViewInfo.Painter.Painter.DefaultContentTextColor; +end; + +function TcxvgDotNetStyleCalcHelper.GetIndentViewParams(ARow, + AParentIndentRow: TcxCustomRow): TcxViewParams; +begin + if ARow <> AParentIndentRow then + with AParentIndentRow.ViewInfo.HeaderInfo do + begin + if AParentIndentRow.VisibleIndex < Scroller.TopVisibleRowIndex then + CalcViewParams(False); + Result := IndentViewParams; + end + else + Result := ARow.ViewInfo.HeaderInfo.ViewParams; +end; + +function TcxvgDotNetStyleCalcHelper.IsDrawValueFocusRect: Boolean; +begin + Result := True; +end; + +function TcxvgDotNetStyleCalcHelper.CreateHorzLineBrush: TBrush; +begin + Result := TBrush.Create; + Result.Color := VerticalGrid.OptionsView.GridLineColor; +end; + +function TcxvgDotNetStyleCalcHelper.CreateVertLineBrush: TBrush; +begin + Result := TBrush.Create; + Result.Color := VerticalGrid.OptionsView.GridLineColor; +end; + +function TcxvgDotNetStyleCalcHelper.GetDividerWidth: Integer; +begin + Result := 1; +end; + +function TcxvgDotNetStyleCalcHelper.GetIndentWidth: Integer; +begin + Result := ViewInfo.Painter.Painter.ExpandButtonSize + 4; +end; + +{ TcxvgStyle3DCalcHelper } + +procedure TcxvgStyle3DCalcHelper.AddBoundHeaderLines( + ARowHeaderInfo: TcxCustomRowHeaderInfo); +begin + if ViewInfo.HorzLineWidth > 0 then + with ARowHeaderInfo, HeaderRect do + LinesInfo.Add(Left, Bottom, Right - Left, + ViewInfo.HorzLineWidth, ViewInfo.HorzLineBrush); +end; + +procedure TcxvgStyle3DCalcHelper.AddHeaderIndentLines( + ARowHeaderInfo: TcxCustomRowHeaderInfo; const R: TRect; + const AViewParams: TcxViewParams; + AToCategories, AUnderline, AAddVertLine: Boolean); +begin +end; + +procedure TcxvgStyle3DCalcHelper.AddDivider(ALinesInfo: TLineInfoList; + const R: TRect; AColor: TColor; AIsSeparator: Boolean); +begin + with ViewInfo, R do + if DividerWidth > 0 then + if AIsSeparator then + begin + ALinesInfo.Add(Right, Top, 2, 2, AColor); + ALinesInfo.Add(Right, Bottom - 2, 2, 2, AColor); + ALinesInfo.Add(Right, Top + 2, 1, Bottom - Top + HorzLineWidth - 5, clBtnShadow); + ALinesInfo.Add(Right + 1, Top + 2, 1, Bottom - Top + HorzLineWidth - 5, clBtnHighlight); + end + else + begin + ALinesInfo.Add(Right, Top, 1, Bottom - Top + HorzLineWidth, clBtnShadow); + ALinesInfo.Add(Right + 1, Top, 1, Bottom - Top + HorzLineWidth, clBtnHighlight); + end; +end; + +procedure TcxvgStyle3DCalcHelper.CalcPaintViewParamsLines( + ARowViewInfo: TcxCustomRowViewInfo; ANextRow: TcxCustomRow); +var + AFocusedRowBandIndex: Integer; + R: TRect; +begin + if VerticalGrid.FocusedRow = nil then Exit; + R := ARowViewInfo.RowRect; + with R do + begin + if ANextRow = VerticalGrid.FocusedRow then + begin + AFocusedRowBandIndex := Scroller.GetBandIndexByRowIndex(ANextRow.VisibleIndex); + if AFocusedRowBandIndex = ARowViewInfo.BandIndex then + begin + ViewInfo.FocusLinesInfo.Add(Left, Bottom - 1, Right - Left, 1, cl3DDkShadow); + ViewInfo.FocusLinesInfo.Add(Left + 1, Bottom, Right - Left - 1, 1, clBtnShadow); + end; + end; + if ARowViewInfo.Row = VerticalGrid.FocusedRow then + begin + ViewInfo.FocusLinesInfo.Add(Left, Bottom - 1, Right - Left, 1, clBtnFace); + ViewInfo.FocusLinesInfo.Add(Left, Bottom, Right - Left, 1, clBtnHighlight); + ViewInfo.FocusLinesInfo.Add(Left, Top - 1, 1, Bottom - Top + 1, cl3DDkShadow); + ViewInfo.FocusLinesInfo.Add(Left + 1, Top, 1, Bottom - Top - 1, clBtnShadow); + end; + end; +end; + +function TcxvgStyle3DCalcHelper.ChangeFocusedRow( + ANewFocus, AOldFocus: TcxCustomRow): TRect; + + procedure ProcessRow(ARow: TcxCustomRow); + var + ARowViewInfo: TcxCustomRowViewInfo; + begin + ARowViewInfo := ViewInfo.GetRowViewInfo(ARow); + if ARowViewInfo = nil then Exit; + with ViewInfo do + begin + with ARowViewInfo do + begin + Result := cxRectUnion(Result, RowRect); + Calc(RowRect, ViewInfo, VisibleRows[ARow.VisibleIndex + 1]); + end; + ARowViewInfo := GetRowViewInfo(VisibleRows[ARow.VisibleIndex - 1]); + if ARowViewInfo <> nil then + with ARowViewInfo do + begin + Calc(RowRect, ViewInfo, ARow); + Result := cxRectUnion(Result, RowRect); + end; + if HorzLineWidth = 0 then + Inc(Result.Bottom); + end; + end; + +begin + Result := cxNullRect; + ViewInfo.FocusLinesInfo.Clear; + ProcessRow(ANewFocus); + ProcessRow(AOldFocus); +end; + +function TcxvgStyle3DCalcHelper.GetCategoryColor: TColor; +begin + Result := ViewInfo.Painter.Painter.DefaultHeaderColor; +end; + +function TcxvgStyle3DCalcHelper.GetCategoryFocusRect( + ARowHeaderInfo: TcxCustomRowHeaderInfo): TRect; +begin + Result := cxNullRect; +end; + +function TcxvgStyle3DCalcHelper.GetCategoryTextColor: TColor; +begin + Result := ViewInfo.Painter.Painter.DefaultHeaderTextColor; +end; + +function TcxvgStyle3DCalcHelper.GetContentColor(AFocused: Boolean): TColor; +begin + if AFocused then + Result := ViewInfo.Painter.Painter.DefaultContentColor + else + Result := ViewInfo.Painter.Painter.DefaultHeaderColor; +end; + +function TcxvgStyle3DCalcHelper.GetContentTextColor: TColor; +begin + Result := clNavy; +end; + +function TcxvgStyle3DCalcHelper.GetHeaderColor: TColor; +begin + Result := ViewInfo.Painter.Painter.DefaultHeaderColor; +end; + +function TcxvgStyle3DCalcHelper.GetHeaderTextColor: TColor; +begin + Result := ViewInfo.Painter.Painter.DefaultHeaderTextColor; +end; + +function TcxvgStyle3DCalcHelper.GetIndentViewParams(ARow, + AParentIndentRow: TcxCustomRow): TcxViewParams; +begin + Result := ARow.ViewInfo.HeaderInfo.ViewParams; +end; + +function TcxvgStyle3DCalcHelper.IsDrawValueFocusRect: Boolean; +begin + Result := False; +end; + +function TcxvgStyle3DCalcHelper.CreateHorzLineBrush: TBrush; +begin + Result := cxCreateHalftoneBrush(VerticalGrid.OptionsView.GridLineColor, clBtnFace); +end; + +function TcxvgStyle3DCalcHelper.CreateVertLineBrush: TBrush; +begin + Result := cxCreateHalftoneBrush(VerticalGrid.OptionsView.GridLineColor, clBtnFace); +end; + +function TcxvgStyle3DCalcHelper.GetDividerWidth: Integer; +begin + Result := 2; +end; + +function TcxvgStyle3DCalcHelper.GetIndentWidth: Integer; +begin + Result := ViewInfo.Painter.Painter.ExpandButtonSize + 4; +end; + +{ TcxvgSkinCalcHelper } + +procedure TcxvgSkinCalcHelper.AddBoundHeaderLines( + ARowHeaderInfo: TcxCustomRowHeaderInfo); +begin + if ARowHeaderInfo is TcxCategoryRowHeaderInfo then + begin + if ARowHeaderInfo.ViewInfo.HorzLineWidth > 0 then + with ARowHeaderInfo, IndentBounds do + begin + ARowHeaderInfo.LinesInfo.Add(Right, Top - ViewInfo.HorzLineWidth, + HeaderRect.Right - Right, ViewInfo.HorzLineWidth, ViewInfo.BandBorderColor); + ARowHeaderInfo.LinesInfo.Add(Right, Bottom, HeaderRect.Right - Right, + ViewInfo.HorzLineWidth, ViewInfo.BandBorderColor); + end; + end else + inherited AddBoundHeaderLines(ARowHeaderInfo); +end; + +procedure TcxvgSkinCalcHelper.AddHeaderIndentLines(ARowHeaderInfo: TcxCustomRowHeaderInfo; + const R: TRect; const AViewParams: TcxViewParams; AToCategories, AUnderline, + AAddVertLine: Boolean); +begin + inherited AddHeaderIndentLines(ARowHeaderInfo, R, AViewParams, AToCategories, + AUnderline, AAddVertLine); + if not ViewInfo.ShowHeaders then Exit; + if AToCategories and (ViewInfo.VertLineWidth > 0) then + begin + if ARowHeaderInfo is TcxCategoryRowHeaderInfo then + if ARowHeaderInfo.IndentBounds.Right = R.Right then + ARowHeaderInfo.LinesInfo.Add(R.Left, R.Top - ViewInfo.HorzLineWidth, + R.Right - R.Left, ViewInfo.HorzLineWidth, ViewInfo.BandBorderColor); + if AAddVertLine then + ARowHeaderInfo.LinesInfo.Add(R.Right - ViewInfo.VertLineWidth, + R.Top - ViewInfo.HorzLineWidth, ViewInfo.VertLineWidth, + R.Bottom - R.Top + ViewInfo.HorzLineWidth, ViewInfo.BandBorderColor); + if AUnderline then + ARowHeaderInfo.LinesInfo.Add(R.Left, R.Bottom, R.Right - R.Left, + ViewInfo.HorzLineWidth, ViewInfo.BandBorderColor); + end; +end; + +function TcxvgSkinCalcHelper.GetBackgroundColor: TColor; +begin + Result := ViewInfo.Painter.Painter.DefaultContentColor; +end; + +function TcxvgSkinCalcHelper.GetCategoryColor: TColor; +begin + Result := ViewInfo.Painter.Painter.DefaultVGridCategoryColor; +end; + +function TcxvgSkinCalcHelper.GetCategoryTextColor: TColor; +begin + Result := ViewInfo.Painter.Painter.DefaultVGridCategoryTextColor; + if Result = clDefault then + Result := inherited GetCategoryTextColor; +end; + +function TcxvgSkinCalcHelper.GetHeaderColor: TColor; +begin + Result := ViewInfo.Painter.Painter.DefaultHeaderColor; + if Result = clDefault then + Result := inherited GetHeaderColor; +end; + +function TcxvgSkinCalcHelper.CreateHorzLineBrush: TBrush; +begin + Result := TBrush.Create; + Result.Color := ViewInfo.Painter.Painter.DefaultVGridLineColor; +end; + +function TcxvgSkinCalcHelper.CreateVertLineBrush: TBrush; +begin + Result := TBrush.Create; + Result.Color := ViewInfo.Painter.Painter.DefaultVGridLineColor; +end; + +function TcxvgSkinCalcHelper.GetBandBorderColor: TColor; +begin + Result := ViewInfo.Painter.Painter.DefaultVGridBandLineColor; +end; + +{ TcxvgPainter } + +constructor TcxvgPainter.Create(AOwner: TcxEditingControl); +begin + inherited Create(AOwner); + Buffered := True; +end; + +procedure TcxvgPainter.DrawBackground; +var + I: Integer; + AParams: TcxViewParams; + R: TRect; +begin + AParams := VerticalGrid.Styles.GetBackgroundParams; + with ViewInfo.ViewRects.EmptyRects, VerticalGrid do + for I := 0 to Count - 1 do + begin + R := Rects[I]; + if not DoDrawBackgroundPart(R, AParams) then + begin + Self.Canvas.Brush.Color := AParams.Color; + FillRect(R, AParams.Bitmap); + end; + end; +end; + +procedure TcxvgPainter.DoPaint; +begin + DrawBackground; + DrawRows; + with ViewInfo do + DrawLines(LinesInfo, ClientRect); + DrawStyleFeatures; +end; + +procedure TcxvgPainter.DrawButton(ARowHeader: TcxCustomRowHeaderInfo); +begin + with ARowHeader do + begin + if cxRectIsEmpty(ButtonRect) then Exit; + Painter.DrawExpandButton(Canvas, ButtonRect, Row.Expanded, ButtonColor); + if not Buffered then + Canvas.ExcludeClipRect(ButtonRect); + end; +end; + +procedure TcxvgPainter.DrawCategoryRowHeader(ARowHeader: TcxCustomRowHeaderInfo); +const + Parts: array[Boolean, 0..1] of Integer = ( + (EBP_NORMALGROUPEXPAND, EBNGE_NORMAL), + (EBP_NORMALGROUPCOLLAPSE, EBNGC_NORMAL)); +var + R: TRect; + ATheme: TdxTheme; +begin + if ViewInfo.UseCategoryExplorerStyle and (VerticalGrid.LookAndFeel.SkinPainter = nil) then + with ARowHeader do + begin + DrawCategoryRowIndent(ARowHeader); + Canvas.Brush.Style := bsSolid; + Canvas.Brush.Color := ViewParams.Color; + R := HeaderRect; + if (Row.Level > 0) and (PaintStyle = psDotNet) then + R.Left := IndentBounds.Right - (ViewInfo.RowIndentWidth + ViewInfo.VertLineWidth); + Canvas.FillRect(R); + ATheme := OpenTheme(totExplorerBar); + if ATheme <> 0 then + begin + DrawThemeBackground(ATheme, Canvas.Handle, EBP_NORMALGROUPHEAD, 0, @R); + if not cxRectIsEmpty(ButtonRect) and (ButtonRect.Left >= R.Left) then + begin + R := ButtonRect; + DrawThemeBackground(ATheme, Canvas.Handle, Parts[Row.Expanded, 0], + Parts[Row.Expanded, 1], @R); + end; + if CaptionsInfo.Count > 0 then + with CaptionsInfo[0] do + begin + Canvas.Brush.Style := bsClear; + Canvas.Font := ViewParams.Font; + Canvas.Font.Color := ViewParams.TextColor; + R := CaptionTextRect; + cxTextOut(Canvas.Canvas, PcxCaptionChar(Caption), R, TextFlags); + Canvas.Brush.Style := bsSolid; + DrawImage(CaptionsInfo[0]); + end; + DrawLines(LinesInfo, cxNullRect); + if not cxRectIsEmpty(FocusRect) and not VerticalGrid.IsDesigning then + Canvas.DrawFocusRect(FocusRect); + if Selected then + begin + Canvas.DrawFocusRect(HeaderRect); + Canvas.DrawFocusRect(cxRectInflate(HeaderRect, -1, -1)); + end; + end + else + DrawRowHeader(ARowHeader); + end + else + DrawRowHeader(ARowHeader); +end; + +procedure TcxvgPainter.DrawCategoryRowIndent(ARowHeader: TcxCustomRowHeaderInfo); +var + I: Integer; +begin + with ARowHeader do + begin + if Transparent then Exit; + for I := 0 to CategoryIndents.Count - 2 do + with CategoryIndents[I]^ do + begin + Canvas.Brush.Color := ViewParams.Color; + Canvas.FillRect(Bounds); + end; + for I := 0 to RowIndents.Count - 1 do + with RowIndents[I]^ do + begin + Canvas.Brush.Color := ViewParams.Color; + Canvas.FillRect(Bounds); + end; + end; +end; + +procedure TcxvgPainter.DrawHeaderDragImage(ARowHeader: TcxCustomRowHeaderInfo); +var + I: Integer; + R: TRect; +begin + with ARowHeader do + begin + for I := 0 to CaptionsInfo.Count - 1 do + DrawRowHeaderCell(CaptionsInfo[I], Transparent); + if ARowHeader is TcxMultiEditorRowHeaderInfo then + begin + DrawLines(LinesInfo, cxNullRect); + DrawHeaderSeparators(ARowHeader); + end; + R := HeaderRect; + R.Left := IndentBounds.Right; + Canvas.FrameRect(R, ViewInfo.BandBorderColor); + end; +end; + +procedure TcxvgPainter.DrawHeaderSeparators(ARowHeader: TcxCustomRowHeaderInfo); +var + I: Integer; + AOffset, R: TRect; +begin + if not (ARowHeader is TcxMultiEditorRowHeaderInfo) then Exit; + with TcxMultiEditorRowHeaderInfo(ARowHeader) do + begin + Canvas.Brush.Color := SeparatorInfo.ViewParams.Color; + Canvas.Font.Color := SeparatorInfo.ViewParams.TextColor; + AOffset := GetTextEditDrawTextOffset(taLeftJustify, True); + for I := 0 to SeparatorRects.Count - 1 do + begin + R := SeparatorRects[I]; + if cxRectIsEmpty(R) then continue; + if not Transparent then + FillRect(R, SeparatorInfo.ViewParams.Bitmap); + with R do + begin + Inc(Top, AOffset.Top + 1); + Inc(Left, AOffset.Left + 1); + Dec(Bottom, AOffset.Bottom + 1); + Dec(Right, AOffset.Right + 1); + end; + cxTextOut(Canvas.Canvas, PcxCaptionChar(SeparatorInfo.Caption), R, + SeparatorInfo.TextFlags); + end; + end; +end; + +procedure TcxvgPainter.DrawImage(ACaptionInfo: TcxRowCaptionInfo); +var + ARgn: TcxRegion; + R: TRect; +begin + with ACaptionInfo do + begin + if ImageIndex = -1 then Exit; + ARgn := Canvas.GetClipRegion; + try + cxRectIntersect(R, ImageRect, CaptionRect); + Canvas.IntersectClipRect(R); + Canvas.DrawImage(Images, ImageRect.Left, ImageRect.Top, ImageIndex); + finally + Canvas.SetClipRegion(ARgn, roSet); + end; + end; +end; + +procedure TcxvgPainter.DrawLines(ALinesInfo: TLineInfoList; R: TRect); +var + I: Integer; +begin + for I := 0 to ALinesInfo.Count - 1 do + with ALinesInfo[I]^ do + begin + if IsBrush then + Canvas.Brush.Assign(Brush) + else + Canvas.Brush.Color := Color; + Canvas.FillRect(Rect); + end; +end; + +procedure TcxvgPainter.DrawRow(ARowViewInfo: TcxCustomRowViewInfo); +var + I: Integer; + AValueInfo: TcxRowValueInfo; +begin + with ARowViewInfo do + begin + if ARowViewInfo is TcxCategoryRowViewInfo then + begin + if not VerticalGrid.DoDrawRowHeader(HeaderInfo) then + DrawCategoryRowHeader(HeaderInfo) + end + else + begin + if not VerticalGrid.DoDrawRowHeader(HeaderInfo) then + DrawRowHeader(HeaderInfo); + DrawHeaderSeparators(HeaderInfo); + DrawValuesSeparators(ARowViewInfo); + for I := 0 to ValuesInfo.Count - 1 do + begin + AValueInfo := ValuesInfo[I]; + BeforeCustomDraw(AValueInfo); + if not VerticalGrid.DoDrawValue(AValueInfo) then + begin + AValueInfo.EditViewInfo.TextColor := Canvas.Font.Color; + AValueInfo.EditViewInfo.BackgroundColor := Canvas.Brush.Color; + DrawRowValueCell(AValueInfo); + end; + AfterCustomDraw(AValueInfo); + end; + end; + DrawLines(HeaderInfo.LinesInfo, cxNullRect); + end; +end; + +procedure TcxvgPainter.DrawRowHeader(ARowHeader: TcxCustomRowHeaderInfo); +var + I: Integer; +begin + DrawRowIndent(ARowHeader); + with ARowHeader do + begin + for I := 0 to CaptionsInfo.Count - 1 do + DrawRowHeaderCell(CaptionsInfo[I], Transparent); + if not cxRectIsEmpty(FocusRect) then + Canvas.DrawFocusRect(FocusRect); + if Selected then + begin + Canvas.DrawFocusRect(HeaderRect); + Canvas.DrawFocusRect(cxRectInflate(HeaderRect, -1, -1)); + end; + end; +end; + +procedure TcxvgPainter.DrawRowHeaderCell( + ACaptionInfo: TcxRowCaptionInfo; ATransparent: Boolean); +var + R: TRect; +begin + with ACaptionInfo do + begin + cxApplyViewParams(Canvas, ViewParams); + if not ATransparent then + FillRect(CaptionRect, ViewParams.Bitmap); + Canvas.Brush.Style := bsClear; + R := CaptionTextRect; + cxTextOut(Canvas.Canvas, PcxCaptionChar(Caption), R, TextFlags); + Canvas.Brush.Style := bsSolid; + DrawImage(ACaptionInfo); + end; +end; + +procedure TcxvgPainter.DrawRowIndent( + ARowHeader: TcxCustomRowHeaderInfo); +var + I: Integer; +begin + if ARowHeader.Transparent then Exit; + if not Buffered then DrawButton(ARowHeader); + with ARowHeader do + begin + for I := 0 to CategoryIndents.Count - 1 do + with CategoryIndents[I]^ do + begin + Canvas.Brush.Color := ViewParams.Color; + FillRect(Bounds, ViewParams.Bitmap); + end; + for I := 0 to RowIndents.Count - 1 do + with RowIndents[I]^ do + begin + Canvas.Brush.Color := ViewParams.Color; + FillRect(Bounds, ViewParams.Bitmap); + end; + end; + if Buffered then DrawButton(ARowHeader); +end; + +procedure TcxvgPainter.DrawRows; +var + I: Integer; + ARowInfo: TcxCustomRowViewInfo; +begin + for I := 0 to ViewInfo.RowsViewInfo.Count - 1 do + begin + ARowInfo := ViewInfo.RowsViewInfo[I]; + if Canvas.RectVisible(ARowInfo.RowRect) then + DrawRow(ARowInfo); + end; +end; + +procedure TcxvgPainter.DrawStyleFeatures; +begin +end; + +procedure TcxvgPainter.DrawRowValueCell(AValueInfo: TcxRowValueInfo); +begin + with AValueInfo do + begin + if cxRectIsEmpty(DisplayRect) then Exit; + if ViewParams.Bitmap <> nil then + Canvas.FillRect(DisplayRect, ViewParams.Bitmap); + ViewInfo.PaintEx(Canvas); + if Focused and Self.ViewInfo.CalcHelper.IsDrawValueFocusRect and + not cxRectIsEmpty(FFocusRect) then + Canvas.DrawFocusRect(BoundsRect); + end; +end; + +procedure TcxvgPainter.DrawValuesSeparators(ARowViewInfo: TcxCustomRowViewInfo); +var + I, ASepPerRecord: Integer; + AViewParams: TcxViewParams; + ASeparatorInfo: TSeparatorInfo; + R, AOffset: TRect; + AStyle: TcxStyle; + AData: TcxvgContentParamsData; +begin + if not (ARowViewInfo is TcxMultiEditorRowViewInfo) then Exit; + with TcxMultiEditorRowViewInfo(ARowViewInfo) do + begin + if (FValuesInfo.Count = 0) or (SeparatorRects.Count = 0) then Exit; + ASeparatorInfo := TcxMultiEditorRowHeaderInfo(HeaderInfo).SeparatorInfo; + AOffset := GetTextEditDrawTextOffset(taLeftJustify, True); + ASepPerRecord := Row.Properties.Editors.Count - 1; + for I := 0 to SeparatorRects.Count - 1 do + begin + R := SeparatorRects[I]; + if cxRectIsEmpty(R) then continue; + with VerticalGrid.Styles do + begin + AStyle := nil; + if Assigned(FOnGetContentStyle) then + FOnGetContentStyle(Control, nil, False, + ViewInfo.FirstVisibleRecordIndex + (I div ASepPerRecord), AStyle); + AData.Row := Row; + AData.Focused := False; + cxStylesToViewParams(VerticalGrid.Styles, vgs_Content, @AData, + [AStyle, Content], AViewParams); + end; + Canvas.Brush.Color := AViewParams.Color; + Canvas.Font.Color := AViewParams.TextColor; + FillRect(R, AViewParams.Bitmap); + with R do + begin + Inc(Top, AOffset.Top + 1); + Inc(Left, AOffset.Left + 1); + Dec(Bottom, AOffset.Bottom + 1); + Dec(Right, AOffset.Right + 1); + end; + cxTextOut(Canvas.Canvas, PcxCaptionChar(ASeparatorInfo.Caption), R, + ASeparatorInfo.TextFlags); + end; + end; +end; + +procedure TcxvgPainter.FillRect(const R: TRect; ABitmap: TBitmap = nil); +begin + if (ABitmap = nil) or ABitmap.Empty then + Canvas.FillRect(R) + else + Canvas.FillRect(R, ABitmap); +end; + +function TcxvgPainter.GetVerticalGrid: TcxCustomVerticalGrid; +begin + Result := TcxCustomVerticalGrid(Control); +end; + +function TcxvgPainter.GetViewInfo: TcxvgCustomViewInfo; +begin + Result := TcxvgCustomViewInfo(inherited ViewInfo); +end; + +{ TcxStyle3DPainter } + +procedure TcxStyle3DPainter.DrawStyleFeatures; +begin + with ViewInfo do + DrawLines(FocusLinesInfo, ClientRect); +end; + +{ TcxvgCustomRowStyles } + +procedure TcxvgCustomRowStyles.Changed(AIndex: Integer); +begin + TcxCustomRow(GetOwner).Changed; +end; + +{ TcxCategoryRowStyles } + +procedure TcxCategoryRowStyles.Assign(Source: TPersistent); +begin + if Source is TcxCategoryRowStyles then + SetValue(vgrs_Header, TcxCategoryRowStyles(Source).GetValue(vgrs_Header)); + inherited Assign(Source); +end; + +{ TcxEditorRowStyles } + +procedure TcxEditorRowStyles.Assign(Source: TPersistent); +begin + if Source is TcxEditorRowStyles then + SetValue(vgrs_Content, TcxCategoryRowStyles(Source).GetValue(vgrs_Content)); + inherited Assign(Source); +end; + +{ TcxVerticalGridStyleSheet } + +function TcxVerticalGridStyleSheet.GetStylesValue: TcxVerticalGridStyles; +begin + Result := TcxVerticalGridStyles(GetStyles) +end; + +procedure TcxVerticalGridStyleSheet.SetStylesValue(Value: TcxVerticalGridStyles); +begin + SetStyles(Value); +end; + +class function TcxVerticalGridStyleSheet.GetStylesClass: TcxCustomStylesClass; +begin + Result := TcxVerticalGridStyles; +end; + +{ TcxVerticalGridStyles } + +procedure TcxVerticalGridStyles.Assign(Source: TPersistent); +var + I: Integer; +begin + inherited Assign(Source); + if Source is TcxVerticalGridStyles then + for I := vgs_Category to vgs_IncSearch do + SetValue(I, TcxVerticalGridStyles(Source).GetValue(I)); +end; + +function TcxVerticalGridStyles.GetCategoryParams( + ARow: TcxCustomRow): TcxViewParams; +begin + cxStylesToViewParams(Self, vgs_Category, ARow, + [GetStyleFromEvent(FOnGetCategoryStyle, ARow), + TcxCategoryRowStyles(ARow.FStyles).Header, Category], Result) +end; + +function TcxVerticalGridStyles.GetContentParams( + AEditProp: TcxCustomEditorRowProperties; + AFocused: Boolean; ARecordIndex: Integer): TcxViewParams; +var + AStyle: TcxStyle; + AData: TcxvgContentParamsData; +begin + AStyle := nil; + if Assigned(FOnGetContentStyle) then + FOnGetContentStyle(Control, AEditProp, AFocused, ARecordIndex, AStyle); + AData.Row := AEditProp.Row; + AData.Focused := AFocused; + cxStylesToViewParams(Self, vgs_Content, @AData, [AStyle, + TcxEditorRowStyles(AEditProp.Row.FStyles).Content, Content], Result); +end; + +function TcxVerticalGridStyles.GetHeaderParams( + ARow: TcxCustomRow): TcxViewParams; +begin + cxStylesToViewParams(Self, vgs_Header, ARow, + [GetStyleFromEvent(FOnGetHeaderStyle, ARow), + TcxCategoryRowStyles(ARow.FStyles).Header, Header], Result) +end; + +function TcxVerticalGridStyles.GetIncSearchParams: TcxViewParams; +begin + GetViewParams(vgs_IncSearch, nil, IncSearch, Result); +end; + +function TcxVerticalGridStyles.GetSelectedHeaderParams( + ARow: TcxCustomRow): TcxViewParams; +begin + Result := GetSelectionParams; + CombineParamsWithStyle(GetStyleFromEvent(FOnGetHeaderStyle, ARow), [], Result) +end; + +procedure TcxVerticalGridStyles.GetDefaultViewParams(Index: Integer; + AData: TObject; out AParams: TcxViewParams); +begin + TcxCustomVerticalGrid(Control).GetDefaultViewParams(Index, AData, AParams); +end; + +function TcxVerticalGridStyles.GetStyleFromEvent( + const AEvent: TcxvgOnGetItemStyleEvent; AItem: TcxCustomRow): TcxStyle; +begin + Result := nil; + if Assigned(AEvent) then AEvent(Control, AItem, Result); +end; + +procedure TcxVerticalGridStyles.CallInheritedDefaultViewParams(Index: Integer; + AData: Pointer; out AParams: TcxViewParams); +begin + inherited GetDefaultViewParams(Index, AData, AParams); +end; + +{ TcxVerticalGridItemsCustomizeListBox } + +constructor TcxVerticalGridItemsCustomizeListBox.CreateEx(AOwner: TComponent; + AVerticalGrid: TcxCustomVerticalGrid; IsCategoryListBox: Boolean); +begin + inherited Create(AOwner); + FVerticalGrid := AVerticalGrid; + FIsCategoryListBox := IsCategoryListBox; + Style := lbOwnerDrawFixed; + FCanvas := TcxCanvas.Create(inherited Canvas); + DoubleBuffered := True; + FDragAndDropItemIndex := -1; +end; + +procedure TcxVerticalGridItemsCustomizeListBox.DragDrop(Source: TObject; + X, Y: Integer); +begin + if (Source = VerticalGrid) and (DragRow <> nil) then + VerticalGrid.DragDrop(Source, X, Y); +end; + +destructor TcxVerticalGridItemsCustomizeListBox.Destroy; +begin + FreeAndNil(FCanvas); + inherited Destroy; +end; + +procedure TcxVerticalGridItemsCustomizeListBox.CalcHeaderViewInfo( + const R: TRect; AHeaderInfo: TcxCustomRowHeaderInfo); +begin + AHeaderInfo.Row.ViewInfo.FViewInfo := VerticalGrid.ViewInfo; + AHeaderInfo.Calc(R, VerticalGrid.ViewInfo, nil, False); +end; + +procedure TcxVerticalGridItemsCustomizeListBox.DragOver(Source: TObject; + X, Y: Integer; State: TDragState; var Accept: Boolean); +begin + Accept := (Source = VerticalGrid) and (DragRow <> nil) and + (DragRow.Options.CanMovedToCustomizationForm); +end; + +procedure TcxVerticalGridItemsCustomizeListBox.DrawItem( + Index: Integer; Rect: TRect; State: TOwnerDrawState); +var + ACanvas: TcxCanvas; + AHeaderInfo: TcxCustomRowHeaderInfo; +begin + AHeaderInfo := TcxCustomRowHeaderInfo(Items.Objects[Index]); + with AHeaderInfo, Painter do + begin + ACanvas := FCanvas; + FCanvas := Self.Canvas; + try + CalcHeaderViewInfo(Rect, AHeaderInfo); + DrawHeaderDragImage(AHeaderInfo); + if ItemIndex = Index then FCanvas.InvertRect(Rect); + finally + FCanvas := ACanvas; + end; + end; +end; + +procedure TcxVerticalGridItemsCustomizeListBox.InitDragAndDropObject; +var + AHeaderInfo: TcxCustomRowHeaderInfo; + R: TRect; +begin + with VerticalGrid.Controller do + if IsEditing then EditingController.HideEdit(False); + AHeaderInfo := TcxCustomRowHeaderInfo(Items.Objects[FDragAndDropItemIndex]); + R := cxRectOffset(ItemRect(FDragAndDropItemIndex), -FMouseDownPos.X, -FMouseDownPos.Y); + CalcHeaderViewInfo(R, AHeaderInfo); + VerticalGrid.Controller.FDragRow := AHeaderInfo.Row; + VerticalGrid.DragPos := cxPointOffset(R.TopLeft, FOffset); + VerticalGrid.BeginDrag(True); +end; + +procedure TcxVerticalGridItemsCustomizeListBox.MouseDown( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + AItem: Integer; +begin + inherited MouseDown(Button, Shift, X, Y); + if (Button = mbLeft) then + begin + AItem := ItemAtPos(Point(X, Y), True); + if AItem <> - 1 then + begin + with ItemRect(AItem) do + FOffset := Point(X - TopLeft.X, Y - TopLeft.Y); + FDragging := True; + FDragAndDropItemIndex := ItemIndex; + FMouseDownPos := Point(X, Y); + Invalidate; + end; + end; +end; + +procedure TcxVerticalGridItemsCustomizeListBox.MouseMove( + Shift: TShiftState; X, Y: Integer); +begin + inherited MouseMove(Shift, X, Y); + if (FDragAndDropItemIndex <> -1) and not IsPointInDragDetectArea(FMouseDownPos, X, Y) then + begin + InitDragAndDropObject; + FDragAndDropItemIndex := -1; + end; +end; + +procedure TcxVerticalGridItemsCustomizeListBox.MouseUp( + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + inherited MouseUp(Button, Shift, X, Y); + FDragging := False; + FDragAndDropItemIndex := -1; + Invalidate; + VerticalGrid.Controller.CheckEdit; +end; + +procedure TcxVerticalGridItemsCustomizeListBox.RefreshList; + + procedure CheckRow(ARow: TcxCustomRow; AIsCategory: Boolean); + begin + if ((ARow is TcxCategoryRow) = AIsCategory) and not ARow.Visible and + ARow.Options.ShowInCustomizationForm then + Items.AddObject('', ARow.ViewInfo.HeaderInfo); + end; + +var + I: Integer; + ASaveIndex: Integer; +begin + ASaveIndex := ItemIndex; + Items.Clear; + Items.BeginUpdate; + with FVerticalGrid do + try + for I := 0 to Rows.Count - 1 do CheckRow(Rows[I], FIsCategoryListBox); + finally + if FDragging then ItemIndex := ASaveIndex; + Items.EndUpdate; + end; + Invalidate; +end; + +procedure TcxVerticalGridItemsCustomizeListBox.CNDrawItem( + var Message: TWMDrawItem); +begin + if not IsPaint then Exit; + with Message.DrawItemStruct^ do + begin + Canvas.Canvas.Handle := hDC; + Canvas.Font := Font; + Canvas.Brush := Brush; + if Integer(itemID) >= 0 then + {$IFDEF DELPHI5} + DrawItem(itemID, rcItem, TOwnerDrawState(LongRec(itemState).Lo)) + {$ELSE} + DrawItem(itemID, rcItem, TOwnerDrawState(Byte(itemState))) + {$ENDIF} + else + Canvas.FillRect(rcItem); + Canvas.Canvas.Handle := 0; + end; +end; + +procedure TcxVerticalGridItemsCustomizeListBox.WMCancelMode( + var Message: TWMCancelMode); +begin + inherited; + FDragging := False; + ItemIndex := -1; + FDragAndDropItemIndex := -1; + Invalidate; +end; + +procedure TcxVerticalGridItemsCustomizeListBox.WMPaint(var Message: TMessage); +begin + IsPaint := True; + try + inherited; + finally + IsPaint := False; + end; +end; + +function TcxVerticalGridItemsCustomizeListBox.GetDragRow: TcxCustomRow; +begin + Result := VerticalGrid.Controller.DragRow; +end; + +function TcxVerticalGridItemsCustomizeListBox.GetPainter: TcxvgPainter; +begin + Result := VerticalGrid.Painter; +end; + +{ TcxVerticalGridCustomizationForm } + +constructor TcxVerticalGridCustomizationForm.CreateEx( + AOwner: TcxVerticalGridCustomizing); +begin + CreateNew(nil); + FOwner := AOwner; +end; + +procedure TcxVerticalGridCustomizationForm.CreateParams( + var Params: TCreateParams); +begin + inherited; + with Params do + begin + Style := Style or WS_POPUP; + if not VerticalGrid.IsDestroying then + WndParent := VerticalGrid.Handle + else + WndParent := 0; + end; +end; + +destructor TcxVerticalGridCustomizationForm.Destroy; +begin + FreeAndNil(FHookTimer); + inherited Destroy; +end; + +procedure TcxVerticalGridCustomizationForm.DoClose(var Action: TCloseAction); +begin + FreeAndNil(FHookTimer); + inherited DoClose(Action); +end; + +procedure TcxVerticalGridCustomizationForm.DoShow; +begin + if FHookTimer = nil then + begin + FHookTimer := TTimer.Create(nil); + with FHookTimer do + begin + Interval := 100; + OnTimer := HookTimerHandler; + end; + end; + inherited DoShow; +end; + +function TcxVerticalGridCustomizationForm.GetVerticalGrid: TcxCustomVerticalGrid; +begin + Result := Customizing.VerticalGrid; +end; + +procedure TcxVerticalGridCustomizationForm.HookTimerHandler(Sender: TObject); +begin + if IsIconic(Application.Handle) then + Visible := False + else + if not VerticalGrid.Visible or not IsWindowVisible(VerticalGrid.Handle) then + VerticalGrid.Customizing.Visible := False + else + if not Visible then + begin + ShowWindow(Handle, SW_SHOWNOACTIVATE); + Visible := True; + end; +end; + +{ TcxVerticalGridCustomizing } + +constructor TcxVerticalGridCustomizing.Create(AOwner: TPersistent); +begin + FVerticalGrid := TcxCustomVerticalGrid(AOwner); + FVisible := False; + FRowCount := 10; + FLastPosition := cxPoint(-10000, -10000); + FShowCategoryButtons := True; + FShowCategoryTab := True; +end; + +destructor TcxVerticalGridCustomizing.Destroy; +begin + Visible := False; + inherited Destroy; +end; + +procedure TcxVerticalGridCustomizing.Assign(Source: TPersistent); +begin + if Source is TcxVerticalGridCustomizing then + begin + RowCount := TcxVerticalGridCustomizing(Source).RowCount; + Visible := TcxVerticalGridCustomizing(Visible).Visible; + end; +end; + +procedure TcxVerticalGridCustomizing.MakeCategorySheetVisible; +begin + if Visible and ((FTabSheetCategories <> nil) and (FCategoryListBox.Parent = FTabSheetCategories)) then + FPageControl.ActivePage := FTabSheetCategories; +end; + +procedure TcxVerticalGridCustomizing.MakeRowSheetVisible; +begin + if Visible and (FRowListBox.Parent = FTabSheetRows) then + FPageControl.ActivePage := FTabSheetRows; +end; + +procedure TcxVerticalGridCustomizing.AdjustControls; +begin + with VerticalGrid do + begin + SetControlParent(FPageControl, FForm); + SetControlParent(FTabSheetRows, FPageControl); + FTabSheetRows.PageControl := FPageControl; + SetControlParent(FRowListBox, FTabSheetRows); + if Assigned(FTabSheetCategories) then + begin + SetControlParent(FTabSheetCategories, FPageControl); + FTabSheetCategories.PageControl := FPageControl; + SetControlParent(FCategoryListBox, FTabSheetCategories); + end; + end; + ShowCustomizingForm; +end; + +function TcxVerticalGridCustomizing.CanDrop(const P: TPoint): Boolean; + + function CheckListBox(AListBox: TcxVerticalGridItemsCustomizeListBox): Boolean; + begin + if AListBox = nil then + Result := False + else + with AListBox do + Result := Visible and cxRectPtIn(ClientRect, ScreenToClient(P)); + end; + +var + ADragCategoryRow: Boolean; +begin + Result := False; + if not Visible then Exit; + ADragCategoryRow := VerticalGrid.Controller.DragRow is TcxCategoryRow; + if ADragCategoryRow then + Result := CheckListBox(FCategoryListBox) + else + Result := CheckListBox(FRowListBox); +end; + +procedure TcxVerticalGridCustomizing.CreateCategoryPanel; + + function CreateButton(ALeft, ATabOrder: Integer; const ACaption: string; + AOnClick: TNotifyEvent): TcxButton; + begin + Result := TcxButton.Create(nil); + with Result do + begin + Left := ALeft; + Top := 7; + Width := 75; + Height := 25; + Caption := ACaption; + TabOrder := ATabOrder; + LookAndFeel.MasterLookAndFeel := VerticalGrid.LookAndFeel; + Enabled := ATabOrder = 0; + OnClick := AOnClick; + Parent := FPanel; + end; + end; + +begin + FPanel := TPanel.Create(nil); + FPanel.Align := alBottom; + FPanel.Height := 35; + FPanel.BevelOuter := bvNone; + FPanel.Visible := FShowCategoryButtons; + FPanel.Parent := FTabSheetCategories; + FButtonNew := CreateButton(7, 0, + cxGetResourceString(@cxSvgCustomizeNewCategory), CreateCategoryClick); + FButtonDelete := CreateButton(90, 1, + cxGetResourceString(@cxSvgCustomizeDeleteCategory), DeleteCategoryClick); +end; + +procedure TcxVerticalGridCustomizing.CreateCategoryRow; +var + ARow: TcxCategoryRow; + S: string; +begin + if cxShowNewCategoryForm(Form, S, VerticalGrid.LookAndFeel) then + begin + VerticalGrid.BeginUpdate; + try + ARow := TcxCategoryRow(VerticalGrid.Add(TcxCategoryRow)); + ARow.Visible := False; + ARow.Properties.Caption := S; + ARow.Name := CreateUniqueName(VerticalGrid.Owner, + VerticalGrid, ARow, 'Tcx', 'RuntimeCreatedRow'); + finally + Modified; + VerticalGrid.EndUpdate; + end; + end; +end; + +procedure TcxVerticalGridCustomizing.CreateControls; +begin + if FForm <> nil then Exit; + FSaveDragMode := VerticalGrid.DragMode; + VerticalGrid.DragMode := dmAutomatic; + CreateCustomizingForm; + FRowListBox := TcxVerticalGridItemsCustomizeListBox.CreateEx(nil, VerticalGrid, False); + FPageControl := TPageControl.Create(nil); + FPageControl.HotTrack := True; + FTabSheetRows := TTabSheet.Create(FPageControl); + FTabSheetRows.Caption := cxGetResourceString(@cxSvgCustomizeRowsCaption); + FTabSheetRows.TabVisible := True; + if FShowCategoryTab then + begin + FCategoryListBox := TcxVerticalGridItemsCustomizeListBox.CreateEx(nil, VerticalGrid, True); + FCategoryListBox.OnClick := UpdateButtons; + FTabSheetCategories := TTabSheet.Create(FPageControl); + FTabSheetCategories.Caption := cxGetResourceString(@cxSvgCustomizeCategoriesCaption); + FTabSheetCategories.TabVisible := True; + CreateCategoryPanel; + end; + AdjustControls; +end; + +procedure TcxVerticalGridCustomizing.CreateCustomizingForm; +var + I: Integer; +const + UnusedItems: array[0..4, 0..1] of Integer = + ((7, MF_BYPOSITION), (5, MF_BYPOSITION), (SC_MAXIMIZE, MF_BYCOMMAND), + (SC_MINIMIZE, MF_BYCOMMAND), (SC_RESTORE, MF_BYCOMMAND)); +begin + FForm := TcxVerticalGridCustomizationForm.CreateEx(Self); + with FForm do + begin + Visible := False; + Caption := cxGetResourceString(@cxSvgCustomizeCaption); + BorderStyle := bsSizeToolWin; + BorderIcons := [biSystemMenu]; + Font.Assign(VerticalGrid.Font); + ClientWidth := SizeDelta.cx * cxTextWidth(Font, '0'); + FLineHeight := cxTextHeight(Font) + SizeDelta.cy; + ClientHeight := (RowCount + 1) * FLineHeight; + Constraints.MinWidth := Width; + Color := clBtnFace; + OnShow := FormShow; + OnClose := FormClose; + for I := 0 to High(UnusedItems) do + DeleteMenu(GetSystemMenu(Handle, False), UnusedItems[I, 0], UnusedItems[I, 1]); + end; +end; + +procedure TcxVerticalGridCustomizing.FormClose(Sender: TObject; var Action: TCloseAction); + + function CheckIndex(AListBox: TListBox): Integer; + begin + if (AListBox = nil) or (AListBox.Parent = nil) then + Result := -1 + else + Result := AListBox.ItemIndex; + end; + +begin + FLastPosition := FForm.BoundsRect.TopLeft; + FLastHeaderIndex := CheckIndex(FRowListBox); + FLastBandIndex := CheckIndex(FCategoryListBox); + Visible := False; + VerticalGrid.DoCustomizationVisibleChanged; +end; + +procedure TcxVerticalGridCustomizing.FormShow(Sender: TObject); +begin + VerticalGrid.DoCustomizationVisibleChanged; +end; + +procedure TcxVerticalGridCustomizing.LookAndFeelChanged; +begin + FCategoryListBox.Invalidate; + FRowListBox.Invalidate; + FPageControl.Invalidate; +end; + +procedure TcxVerticalGridCustomizing.ReleaseControls; + + procedure ReleaseControl(var AControl: TControl); + begin + if AControl = nil then Exit; + AControl.Parent := nil; + FreeAndNil(AControl); + end; + +begin + if FForm <> nil then + try + FLastPosition := Point(FForm.Left, FForm.Top); + ReleaseControl(TControl(FButtonNew)); + ReleaseControl(TControl(FButtonDelete)); + ReleaseControl(TControl(FPanel)); + ReleaseControl(TControl(FRowListBox)); + ReleaseControl(TControl(FCategoryListBox)); + ReleaseControl(TControl(FTabSheetCategories)); + ReleaseControl(TControl(FTabSheetRows)); + ReleaseControl(TControl(FPageControl)); + FLastBandIndex := -1; + FLastHeaderIndex := -1; + if not VerticalGrid.IsDestroying then + begin + VerticalGrid.DragMode := FSaveDragMode; + FForm.Release + end + else + FForm.Free; + finally + FForm := nil; + end; +end; + +procedure TcxVerticalGridCustomizing.SetControlParent(AControl, AParent: TWinControl); +begin + AControl.Parent := AParent; + if AParent <> nil then + begin + AControl.Align := alClient; + TControlAccess(AControl).ParentFont := True; + TControlAccess(AControl).ParentColor := True; + Visible := True; + end; +end; + +function TcxVerticalGridCustomizing.SizeDelta: TSize; +begin + Result := cxSize(31, 4); +end; + +procedure TcxVerticalGridCustomizing.ComponentRemoved(Sender: TObject); +begin +end; + +procedure TcxVerticalGridCustomizing.Modified; +begin + Update; +end; + +procedure TcxVerticalGridCustomizing.ValidateListBox( + AListBox: TcxVerticalGridItemsCustomizeListBox; AIndex: Integer); +begin + if (AListBox = nil) or (AListBox.Parent = nil) then Exit; + AListBox.RefreshList; + if (AIndex >= 0) and (AIndex < AListBox.Items.Count) then + AListBox.ItemIndex := AIndex; +end; + +procedure TcxVerticalGridCustomizing.Update; +begin + if (FRowListBox <> nil) and (FRowListBox.Parent <> nil) then + FRowListBox.RefreshList; + if (FCategoryListBox <> nil) and (FCategoryListBox.Parent <> nil) then + begin + FCategoryListBox.RefreshList; + UpdateButtons(nil); + end; +end; + +procedure TcxVerticalGridCustomizing.CreateCategoryClick(Sender: TObject); +begin + CreateCategoryRow; +end; + +procedure TcxVerticalGridCustomizing.DeleteCategoryClick(Sender: TObject); +var + ARowHeader: TcxCustomRowHeaderInfo; +begin + with CategoryListBox do + if ItemIndex >= 0 then + begin + ARowHeader := TcxCustomRowHeaderInfo(Items.Objects[ItemIndex]); + Items.Delete(ItemIndex); + ARowHeader.Row.Free; + end; + Modified; +end; + +procedure TcxVerticalGridCustomizing.SetRowCount(Value: Integer); +begin + if Value < 2 then Value := 2; + FRowCount := Value; +end; + +procedure TcxVerticalGridCustomizing.SetShowCategoryButtons( + const Value: Boolean); +begin + FShowCategoryButtons := Value; + if FPanel <> nil then FPanel.Visible := Value; +end; + +procedure TcxVerticalGridCustomizing.SetVisible(Value: Boolean); + + function CanVisible: Boolean; + begin + Result := VerticalGrid.Rows.Count > 0; + end; + +begin + if Value <> FVisible then + begin + if Value and not CanVisible then Exit; + FVisible := Value; + if not Value then + ReleaseControls + else + CreateControls; + end; +end; + +function GetDesktopRect: TRect; +begin +{$IFDEF DELPHI6} + Result := Screen.DesktopRect; +{$ELSE} + with Result do + begin + Top := GetSystemMetrics(SM_YVIRTUALSCREEN); + Left := GetSystemMetrics(SM_XVIRTUALSCREEN); + Bottom := Top + GetSystemMetrics(SM_CYVIRTUALSCREEN); + Right := Left + GetSystemMetrics(SM_CXVIRTUALSCREEN); + end; +{$ENDIF} +end; + +procedure TcxVerticalGridCustomizing.ShowCustomizingForm; +var + P: TPoint; + R: TRect; +begin + if (CustomizingPos.X <> -10000) and (CustomizingPos.Y <> -10000) then + begin + FForm.Left := CustomizingPos.X; + FForm.Top := CustomizingPos.Y; + end + else + begin + R := GetDesktopRect; + P := VerticalGrid.ClientToScreen(cxPoint(VerticalGrid.Width, 0)); + with FForm do + begin + if P.X + Width > R.Right then + P.X := R.Right - Width; + if P.Y + Height > R.Bottom then + P.Y := R.Bottom - Height; + if P.X < R.Left then + P.X := R.Left; + if P.Y < R.Top then + P.Y := R.Top; + SetBounds(P.X, P.Y, Width, Height); + end; + end; + ValidateListBox(FRowListBox, FLastHeaderIndex); + ValidateListBox(FCategoryListBox, FLastBandIndex); + FForm.Show; +end; + +procedure TcxVerticalGridCustomizing.UpdateButtons(Sender: TObject); +begin + FButtonDelete.Enabled := FCategoryListBox.ItemIndex <> -1; +end; + +initialization + RegisterClasses([TcxCategoryRow, TcxEditorRow, TcxMultiEditorRow]); + RegisterClasses([TcxCaptionRowProperties, TcxEditorRowProperties, TcxMultiEditorRowProperties]); + + Screen.Cursors[crcxInspectorInsert] := LoadCursor(HInstance, cxInspectorInsertCursor); + Screen.Cursors[crcxInspectorAddChild] := LoadCursor(HInstance, cxInspectorAddChildCursor); + Screen.Cursors[crcxInspectorAdd] := LoadCursor(HInstance, cxInspectorAddCursor); + Screen.Cursors[crcxInspectorHide] := LoadCursor(HInstance, cxInspectorHideCursor); + Screen.Cursors[crcxInspectorNoDrag] := LoadCursor(HInstance, cxInspectorNoDragCursor); + +finalization +{$IFDEF DELPHI4} + DestroyCursor(Screen.Cursors[crcxInspectorInsert]); + DestroyCursor(Screen.Cursors[crcxInspectorAddChild]); + DestroyCursor(Screen.Cursors[crcxInspectorAdd]); + DestroyCursor(Screen.Cursors[crcxInspectorHide]); + DestroyCursor(Screen.Cursors[crcxInspectorNoDrag]); +{$ENDIF} +end. + diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxVGridConsts.pas b/official/x.35/ExpressVerticalGrid/Sources/cxVGridConsts.pas new file mode 100644 index 00000000..ac49ac16 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxVGridConsts.pas @@ -0,0 +1,82 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressVerticalGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSVERTICALGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxVGridConsts; + +{$I cxVer.inc} + +interface + +resourcestring + cxSvgIndexError = 'Index error'; + cxSvgInvalidRowClass = 'Can''t create row'; + cxSvgAssignRowsError = 'Can''t assign rows'; + cxSvgDeletingFocusedConfirmationText = 'Delete record?'; + cxSvgDeletingConfirmationCaption = 'Confirm'; + + cxSvgOKCaption = 'OK'; + cxSvgCancelCaption = 'Cancel'; + + cxSvgCustomizeCaption = 'Customize'; + cxSvgCustomizeCategoriesCaption = 'Categories'; + cxSvgCustomizeDeleteCategory = '&Delete'; + cxSvgCustomizeNewCategory = '&New...'; + cxSvgCustomizeRowsCaption = 'Rows'; + + cxSvgNewCategoryCaption = 'New Category'; + cxSvgNewCategoryLabelCaption = '&Category:'; + + cxSvgLayoutEditorCaption = 'Layout editor'; + cxSvgLayoutEditorCustomize = '&Customize'; + + //cxRTTIInspector + cxSvgRTTIInspectorEmptyGlyph = '(None)'; + cxSvgUnknown = '(Unknown)'; + cxSvgExportNotVisibleControl = 'Can''t export invisible control'; + cxSvgRTTICollectionEditCaption = 'Editing %s%s%s'; + cxSvgRTTICollectionAdd = '&Add'; + cxSvgRTTICollectionAddHint = 'Add New'; + cxSvgRTTICollectionDelete = '&Delete'; + cxSvgRTTICollectionDeleteHint = 'Delete Selected'; + cxSvgRTTICollectionSelectAll = '&Select All'; + cxSvgRTTICollectionToolbar = '&Toolbar'; + cxSvgRTTICollectionTextLabel = 'Text &Labels'; + cxSvgRTTICollectionMoveUp = 'Move &Up'; + cxSvgRTTICollectionMoveUpHint = 'Move Selected Up'; + cxSvgRTTICollectionMoveDown = 'Move Dow&n'; + cxSvgRTTICollectionMoveDownHint = 'Move Selected Down'; + +implementation + +end. + diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxVGridConverter.pas b/official/x.35/ExpressVerticalGrid/Sources/cxVGridConverter.pas new file mode 100644 index 00000000..d21df2f7 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxVGridConverter.pas @@ -0,0 +1,116 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressVerticalGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSVERTICALGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxVGridConverter; + +{$I cxVer.inc} + +interface + +uses + cxConverterFactory, cxVGrid, cxStyles; + +type + TcxCustomVerticalGridConverterClass = class of TcxCustomVerticalGridConverter; + TcxStylesAccessor = class(TcxStyles); + + { TcxCustomVerticalGridConverter } + + TcxCustomVerticalGridConverter = class(TcxCustomConverterWithStyles) + private + procedure ClearStyles; + procedure ClearVerticalGrid; + function GetDestination: TcxCustomVerticalGrid; + protected + procedure DoImport; override; + procedure DoRealImport; virtual; + procedure SetVerticalGridRowUniqueName(AVerticalGrid: TcxCustomVerticalGrid; ARow: TcxCustomRow); + public + property Destination: TcxCustomVerticalGrid read GetDestination; + end; + +const + cxVGGroupConverterName = 'VerticalGrid Converters'; + cxDBVGGroupConverterName = 'DBVerticalGrid Converters'; + cxRTTIVGGroupConverterName = 'RTTI Inspector Converters'; + +implementation + +{ TcxCustomVerticalGridConverter } + +procedure TcxCustomVerticalGridConverter.DoImport; +begin + Destination.BeginUpdate; + try + ClearVerticalGrid; + DoRealImport; + finally + Destination.EndUpdate; + end; + inherited DoImport; +end; + +procedure TcxCustomVerticalGridConverter.DoRealImport; +begin +end; + +procedure TcxCustomVerticalGridConverter.SetVerticalGridRowUniqueName( + AVerticalGrid: TcxCustomVerticalGrid; ARow: TcxCustomRow); +begin + //todo +end; + +procedure TcxCustomVerticalGridConverter.ClearStyles; +var + I: Integer; +begin + for I := 0 to cxvgMaxControlStyleIndex do + TcxStylesAccessor(Destination.Styles).SetValue(I, nil); +end; + +procedure TcxCustomVerticalGridConverter.ClearVerticalGrid; +begin + with Destination do + begin + ClearRows; + ClearStyles; + RestoreDefaults; + end; +end; + +function TcxCustomVerticalGridConverter.GetDestination: TcxCustomVerticalGrid; +begin + Result := inherited Destination as TcxCustomVerticalGrid; +end; + +end. diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxVGridDXInspConverter.pas b/official/x.35/ExpressVerticalGrid/Sources/cxVGridDXInspConverter.pas new file mode 100644 index 00000000..256add49 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxVGridDXInspConverter.pas @@ -0,0 +1,886 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressVerticalGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSVERTICALGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxVGridDXInspConverter; + +{$I cxVer.inc} + +interface + +uses + SysUtils, cxConverterFactory, cxVGridConverter, cxVGrid, cxDBVGrid, Classes, + cxConverterUtils, cxLookAndFeels, cxInplaceContainer, DB, cxStyles, + Graphics, cxCustomData, cxCustomConverter, cxBlobEdit, cxPropertiesConverters, + cxButtonEdit, cxCalc, cxCheckBox, cxDropDownEdit, cxCurrencyEdit, cxCalendar, + cxDBLookupComboBox, cxHyperLinkEdit, cxImage, cxImageComboBox, cxMaskEdit, cxMemo, + cxMRUEdit, cxSpinEdit, cxTextEdit, cxTimeEdit, cxVariants, cxOI; + +type + TcxCustomVerticalGridAccess = class(TcxCustomVerticalGrid); + TcxUnboundVerticalGridAccess = class(TcxUnboundVerticalGrid); + + { TcxCustomDXInspConverter } + + TcxCustomDXInspConverter = class(TcxCustomVerticalGridConverter) + private + FcxRowCache: TStringList; + FdxRowCache: TStringList; + FDefaultRowHeight: Integer; + FSeparatorString: string; + function GetAccess: TcxCustomVerticalGridAccess; + function GetComponent: TComponent; + protected + function AddRow(AcxRowParent: TcxCustomRow; const AdxRowName: string): TcxCustomRow; + procedure AssignCaptionProperties(AdxRow: TObject; AProperties: TcxCaptionRowProperties); + procedure AssignEditorDataBinding(AdxRow: TObject; AProperties: TcxCustomEditorRowProperties); virtual; + procedure AssignEditorProperties(AdxRow: TObject; AProperties: TcxCustomEditorRowProperties); + procedure AssignVerticalGrid; virtual; + procedure AssignVerticalGridOptions; virtual; + procedure ConvertPaintStyle; + function CreateMultiEditorRowItem( + AcxRow: TcxCustomRow): TcxCollectionItemEditorRowProperties; virtual; + procedure DoRealImport; override; + function GetConvertorIndex(AdxRow: TObject): Integer; virtual; + function GetRowClassType(AdxRow: TObject): TcxCustomRowClass; virtual; + procedure ImportCategoryRow(AdxRow: TObject; AcxRow: TcxCustomRow); + procedure ImportEditorRow(AdxRow: TObject; AcxRow: TcxCustomRow); virtual; + procedure ImportLayout; + procedure ImportMultiEditorRow(AdxRow: TObject; AcxRow: TcxCustomRow); virtual; + procedure ImportRow(AcxRow: TcxCustomRow; AdxRow: TObject); + procedure ImportRows; virtual; + procedure SetRowName(AcxRow: TcxCustomRow); virtual; + property Access: TcxCustomVerticalGridAccess read GetAccess; + property Component: TComponent read GetComponent; + public + constructor Create(ADestination: TObject); override; + destructor Destroy; override; + end; + + { TcxDXInspConverter } + + TcxDXInspConverter = class(TcxCustomDXInspConverter) + private + function GetDestination: TcxUnboundVerticalGridAccess; + protected + procedure AssignEditorDataBinding(AdxRow: TObject; AProperties: TcxCustomEditorRowProperties); override; + procedure AssignVerticalGridOptions; override; + function CreateMultiEditorRowItem( + AcxRow: TcxCustomRow): TcxCollectionItemEditorRowProperties; override; + function GetRowClassType(AdxRow: TObject): TcxCustomRowClass; override; + public + class function GetSourceClassName: string; override; + property Destination: TcxUnboundVerticalGridAccess read GetDestination; + end; + + { TcxDXDBInspConverter } + + TcxDXDBInspConverter = class(TcxCustomDXInspConverter) + private + function GetDestination: TcxDBVerticalGrid; + protected + procedure AssignEditorDataBinding(AdxRow: TObject; AProperties: TcxCustomEditorRowProperties); override; + procedure AssignVerticalGrid; override; + procedure AssignVerticalGridOptions; override; + function CreateMultiEditorRowItem( + AcxRow: TcxCustomRow): TcxCollectionItemEditorRowProperties; override; + function GetConvertorIndex(AdxRow: TObject): Integer; override; + function GetRowClassType(AdxRow: TObject): TcxCustomRowClass; override; + procedure SetRowName(AcxRow: TcxCustomRow); override; + public + class function GetSourceClassName: string; override; + property Destination: TcxDBVerticalGrid read GetDestination; + end; + + { TcxDXRTTIConverter } + + TcxDXRTTIConverter = class(TcxDXInspConverter) + protected + procedure DoRealImport; override; + procedure ImportRows; override; + public + class function GetSourceClassName: string; override; + end; + +implementation + +uses + Controls, cxDesignWindows, cxControls, cxEdit, cxDataStorage; + +type + TcxCustomRowAccess = class(TcxCustomRow); + TcxCustomEditorRowAccess = class(TcxCustomEditorRow); + TcxCustomEditorRowPropertiesAccess = class(TcxCustomEditorRowProperties); + TcxCustomMultiEditorRowAccess = class(TcxCustomMultiEditorRow); + TcxCustomPropertiesConverterClass = class of TcxCustomPropertiesConverter; + +const + ConvertorTable: array[0..17] of record + RowClassName: string; + DBRowClassName: string; + PropertiesClass: TcxCustomEditPropertiesClass; + ConvertorClass: TcxCustomPropertiesConverterClass; + ValueType: TcxValueTypeClass; + end = ( + (RowClassName: 'TdxInspectorTextRow'; + DBRowClassName: 'TdxInspectorDBRow'; + PropertiesClass: TcxTextEditProperties; + ConvertorClass: TcxTextEditPropertiesConverter; + ValueType: nil), + (RowClassName: 'TdxInspectorTextMaskRow'; + DBRowClassName: 'TdxInspectorDBMaskRow'; + PropertiesClass: TcxMaskEditProperties; + ConvertorClass: TcxMaskEditPropertiesConverter; + ValueType: nil), + (RowClassName: 'TdxInspectorTextDateRow'; + DBRowClassName: 'TdxInspectorDBDateRow'; + PropertiesClass: TcxDateEditProperties; + ConvertorClass: TcxDateEditPropertiesConverter; + ValueType: TcxDateTimeValueType), + (RowClassName: 'TdxInspectorTextCheckRow'; + DBRowClassName: 'TdxInspectorDBCheckRow'; + PropertiesClass: TcxCheckBoxProperties; + ConvertorClass: TcxCheckBoxPropertiesConverter; + ValueType: TcxVariantValueType), + (RowClassName: 'TdxInspectorTextCalcRow'; + DBRowClassName: 'TdxInspectorDBCalcRow'; + PropertiesClass: TcxCalcEditProperties; + ConvertorClass: TcxCalcEditPropertiesConverter; + ValueType: TcxFloatValueType), + (RowClassName: 'TdxInspectorTextButtonRow'; + DBRowClassName: 'TdxInspectorDBButtonRow'; + PropertiesClass: TcxButtonEditProperties; + ConvertorClass: TcxButtonEditPropertiesConverter; + ValueType: nil), + (RowClassName: 'TdxInspectorTextSpinRow'; + DBRowClassName: 'TdxInspectorDBSpinRow'; + PropertiesClass: TcxSpinEditProperties; + ConvertorClass: TcxSpinEditPropertiesConverter; + ValueType: TcxFloatValueType), + (RowClassName: 'TdxInspectorTextPickRow'; + DBRowClassName: 'TdxInspectorDBPickRow'; + PropertiesClass: TcxComboBoxProperties; + ConvertorClass: TcxComboBoxPropertiesConverter; + ValueType: nil), + (RowClassName: 'TdxInspectorTextImageRow'; + DBRowClassName: 'TdxInspectorDBImageRow'; + PropertiesClass: TcxImageComboBoxProperties; + ConvertorClass: TcxImageComboBoxPropertiesConverter; + ValueType: TcxVariantValueType), + (RowClassName: 'TdxInspectorTextTimeRow'; + DBRowClassName: 'TdxInspectorDBTimeRow'; + PropertiesClass: TcxTimeEditProperties; + ConvertorClass: TcxTimeEditPropertiesConverter; + ValueType: TcxDateTimeValueType), + (RowClassName: 'TdxInspectorTextCurrencyRow'; + DBRowClassName: 'TdxInspectorDBCurrencyRow'; + PropertiesClass: TcxCurrencyEditProperties; + ConvertorClass: TcxCurrencyEditPropertiesConverter; + ValueType: TcxCurrencyValueType), + (RowClassName: 'TdxInspectorTextHyperLinkRow'; + DBRowClassName: 'TdxInspectorDBHyperLinkRow'; + PropertiesClass: TcxHyperLinkEditProperties; + ConvertorClass: TcxHyperLinkEditPropertiesConverter; + ValueType: nil), + (RowClassName: 'TdxInspectorTextBlobRow'; + DBRowClassName: 'TdxInspectorBlobRow'; + PropertiesClass: TcxBlobEditProperties; + ConvertorClass: TcxBlobEditPropertiesConverter; + ValueType: TcxVariantValueType), + (RowClassName: 'TdxInspectorTextMRURow'; + DBRowClassName: 'TdxInspectorDBMRURow'; + PropertiesClass: TcxMRUEditProperties; + ConvertorClass: TcxMRUEditPropertiesConverter; + ValueType: nil), + (RowClassName: 'TdxInspectorTextPopupRow'; + DBRowClassName: 'TdxInspectorDBPopupRow'; + PropertiesClass: TcxPopupEditProperties; + ConvertorClass: TcxPopupEditPropertiesConverter; + ValueType: nil), + (RowClassName: 'TdxInspectorTextMemoRow'; + DBRowClassName: 'TdxInspectorDBMemoRow'; + PropertiesClass: TcxMemoProperties; + ConvertorClass: TcxMemoPropertiesConverter; + ValueType: nil), + (RowClassName: 'TdxInspectorTextGraphicRow'; + DBRowClassName: 'TdxInspectorDBGraphicRow'; + PropertiesClass: TcxImageProperties; + ConvertorClass: TcxImagePropertiesConverter; + ValueType: TcxVariantValueType), + (RowClassName: ''; + DBRowClassName: 'TdxInspectorLookupRow'; + PropertiesClass: TcxLookupComboBoxProperties; + ConvertorClass: TcxLookupComboBoxPropertiesConverter; + ValueType: nil) + ); + +{$IFNDEF DELPHI5} +function SameText(const S1, S2: string): Boolean; assembler; +asm + CMP EAX,EDX + JZ @1 + OR EAX,EAX + JZ @2 + OR EDX,EDX + JZ @3 + MOV ECX,[EAX-4] + CMP ECX,[EDX-4] + JNE @3 + CALL CompareText + TEST EAX,EAX + JNZ @3 +@1: MOV AL,1 +@2: RET +@3: XOR EAX,EAX +end; +{$ENDIF} + +function InheritsFromEx(AObject: TObject; const AParentClassName: string): Boolean; +var + AClass: TClass; +begin + Result := False; + AClass := AObject.ClassType; + while AClass <> nil do + if SameText(AClass.ClassName, AParentClassName) then + begin + Result := True; + break; + end + else + AClass := AClass.ClassParent; +end; + +{ TcxCustomDXInspConverter } + +constructor TcxCustomDXInspConverter.Create(ADestination: TObject); +begin + inherited Create(ADestination); + FcxRowCache := TStringList.Create; + FcxRowCache.Sorted := True; + FdxRowCache := TStringList.Create; + FdxRowCache.Sorted := True; +end; + +destructor TcxCustomDXInspConverter.Destroy; +begin + FcxRowCache.Free; + FdxRowCache.Free; + inherited Destroy; +end; + +function TcxCustomDXInspConverter.AddRow(AcxRowParent: TcxCustomRow; + const AdxRowName: string): TcxCustomRow; +var + ARowClass: TcxCustomRowClass; + AdxRow: TObject; +begin + AdxRow := Component.Owner.FindComponent(AdxRowName); + ARowClass := GetRowClassType(AdxRow); + if ARowClass <> nil then + begin + Result := Destination.AddChild(AcxRowParent, ARowClass); + ImportRow(Result, AdxRow); + SetRowName(Result); + end + else + Result := nil; +end; + +procedure TcxCustomDXInspConverter.AssignCaptionProperties(AdxRow: TObject; + AProperties: TcxCaptionRowProperties); +begin + AProperties.Caption := GetStringProperty(AdxRow, 'Caption'); + AProperties.Hint := GetStringProperty(AdxRow, 'Hint'); + AProperties.ImageIndex := GetIntegerProperty(AdxRow, 'ImageIndex', -1); +end; + +procedure TcxCustomDXInspConverter.AssignEditorDataBinding( + AdxRow: TObject; AProperties: TcxCustomEditorRowProperties); +begin +end; + +procedure TcxCustomDXInspConverter.AssignEditorProperties( + AdxRow: TObject; AProperties: TcxCustomEditorRowProperties); +var + AConverter: TcxCustomPropertiesConverter; + Index: Integer; +begin + Index := GetConvertorIndex(AdxRow); + if Index < 0 then Exit; + AProperties.EditPropertiesClass := ConvertorTable[Index].PropertiesClass; + AConverter := ConvertorTable[Index].ConvertorClass.Create(AProperties.EditProperties); + try + AConverter.ImportFrom(AdxRow); + finally + AConverter.Free; + end; + AssignEditorDataBinding(AdxRow, AProperties); +end; + +procedure TcxCustomDXInspConverter.AssignVerticalGrid; +var + AFont: TFont; +begin + ConvertPaintStyle; + AFont := GetClassProperty(Source, 'Font') as TFont; + Access.Font.Assign(AFont); + with Destination do + begin + if SameText(GetEnumProperty(Source, 'BorderStyle'), 'bsNone') then + BorderStyle := cxcbsNone + else + BorderStyle := cxcbsDefault; + FDefaultRowHeight := GetIntegerProperty(Source, 'RowHeight', 17); + FSeparatorString := GetStringProperty(Source, 'ComplexRowSeparator'); + StoringName := GetStringProperty(Source, 'RegistryPath'); + Images := TImageList(GetClassProperty(Source, 'Images')); + end; +end; + +procedure TcxCustomDXInspConverter.AssignVerticalGridOptions; +begin + with Destination.OptionsView do + begin + if FDefaultRowHeight <> 17 then RowHeight := FDefaultRowHeight; + CellTextMaxLineCount := GetIntegerProperty(Source, 'MaxRowTextLineCount', 0); + RowHeaderMinWidth := GetIntegerProperty(Source, 'MinColumnWidth', 24); + RowHeaderWidth := GetIntegerProperty(Source, 'DividerPos', 100); + ValueWidth := GetIntegerProperty(Source, 'BandWidth', 150) - RowHeaderWidth; + GridLineColor := GetIntegerProperty(Source, 'GridColor', clBtnFace); + end; +end; + +procedure TcxCustomDXInspConverter.ConvertPaintStyle; +var + S: string; +begin + S := GetEnumProperty(Source, 'PaintStyle'); + if SameText(S, 'ipsNet') or SameText(S, 'ipsCategorized') then + Destination.OptionsView.PaintStyle := psdotNet + else + Destination.OptionsView.PaintStyle := psDelphi; + if GetBooleanProperty(Source, 'Flat') then + Destination.LookAndFeel.Kind := lfFlat + else + Destination.LookAndFeel.Kind := lfStandard; +end; + +function TcxCustomDXInspConverter.CreateMultiEditorRowItem( + AcxRow: TcxCustomRow): TcxCollectionItemEditorRowProperties; +begin + Result := nil; +end; + +procedure TcxCustomDXInspConverter.DoRealImport; +begin + AssignVerticalGrid; + AssignVerticalGridOptions; + ImportRows; +end; + +function TcxCustomDXInspConverter.GetConvertorIndex(AdxRow: TObject): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to 16 do + if SameText(AdxRow.ClassName, ConvertorTable[I].RowClassName) then + begin + Result := I; + break + end; +end; + +function TcxCustomDXInspConverter.GetRowClassType( + AdxRow: TObject): TcxCustomRowClass; +begin + Result := nil; +end; + +type + TComponentAccess = class(TComponent); + + PdxRowNodeInfo = ^TdxRowNodeInfo; + TdxRowNodeInfo = packed record + Count: Integer; + StrLen: Integer; + Str: record end; + end; + + TcxConverterFiler = class(TFiler) + private + FHasData: Boolean; + FReadDataProc: TStreamProc; + FWriteDataProc: TStreamProc; + public + constructor CreateFor(AComponent: TObject); + procedure CreateVisibleRows(AStream: TStream; AConverter: TcxCustomDXInspConverter); + procedure DefineProperty(const Name: string; ReadData: TReaderProc; + WriteData: TWriterProc; HasData: Boolean); override; + procedure DefineBinaryProperty(const Name: string; AReadData, AWriteData: TStreamProc; HasData: Boolean); override; + procedure FlushBuffer; override; + property HasData: Boolean read FHasData; + property ReadDataProc: TStreamProc read FReadDataProc; + property WriteDataProc: TStreamProc read FWriteDataProc; + end; + +constructor TcxConverterFiler.CreateFor(AComponent: TObject); +begin + TComponentAccess(AComponent).DefineProperties(Self); +end; + +procedure TcxConverterFiler.CreateVisibleRows(AStream: TStream; + AConverter: TcxCustomDXInspConverter); +var + AReader: TcxReader; + I, AItemCount: Integer; + + procedure ReadInfo(AcxParentRow: TcxCustomRow); + var + PInfo: PdxRowNodeInfo; + I, ACount, ASize: Integer; + S: string; + begin + ASize := AReader.ReadInteger; + GetMem(PInfo, ASize); + try + AStream.ReadBuffer(PInfo^, ASize); + SetLength(S, PInfo^.StrLen); + AStream.ReadBuffer(S[1], PInfo^.StrLen); + ACount := PInfo^.Count; + AcxParentRow := AConverter.AddRow(AcxParentRow, S); + if AcxParentRow <> nil then + AConverter.FdxRowCache.AddObject(S, AcxParentRow); + for I := 0 to ACount - 1 do + ReadInfo(AcxParentRow); + finally + FreeMem(PInfo, ASize); + end; + end; + + procedure ReadExpandedData; + var + PInfo: PdxRowNodeInfo; + I, Index, ACount, ASize: Integer; + S: string; + begin + if AStream.Position = AStream.Size then Exit; + AConverter.Destination.FullCollapse; + ACount := AReader.ReadInteger; + for I := 0 to ACount - 1 do + begin + ASize := AReader.ReadInteger; + GetMem(PInfo, ASize); + try + AStream.ReadBuffer(PInfo^, ASize); + SetLength(S, PInfo^.StrLen); + AStream.ReadBuffer(S[1], PInfo^.StrLen); + Index := AConverter.FdxRowCache.IndexOf(S); + if Index >= 0 then + TcxCustomRow(AConverter.FdxRowCache.Objects[Index]).Expanded := True; + finally + FreeMem(PInfo, ASize); + end; + end; + end; + +begin + AReader := TcxReader.Create(AStream); + try + AConverter.Destination.ClearRows; + try + if (AStream.Size > 0) and (AReader.ReadInteger > 0) then + begin + AItemCount := AReader.ReadInteger; + for I := 0 to AItemCount - 1 do + ReadInfo(nil); + ReadExpandedData; + end; + except + AConverter.Destination.ClearRows; + raise; + end; + finally + AReader.Free; + end; +end; + +procedure TcxConverterFiler.DefineProperty(const Name: string; ReadData: TReaderProc; + WriteData: TWriterProc; HasData: Boolean); +begin +end; + +procedure TcxConverterFiler.DefineBinaryProperty(const Name: string; + AReadData, AWriteData: TStreamProc; HasData: Boolean); +begin + if Name <> 'Data' then Exit; + FHasData := HasData; + FReadDataProc := AReadData; + FWriteDataProc := AWriteData; +end; + +procedure TcxConverterFiler.FlushBuffer; +begin +end; + +procedure TcxCustomDXInspConverter.ImportCategoryRow(AdxRow: TObject; + AcxRow: TcxCustomRow); +begin + AssignCaptionProperties(AdxRow, TcxCategoryRow(AcxRow).Properties); +end; + +procedure TcxCustomDXInspConverter.ImportEditorRow(AdxRow: TObject; + AcxRow: TcxCustomRow); +var + AProperties: TcxCustomEditorRowProperties; +begin + AProperties := TcxCustomEditorRowAccess(AcxRow).Properties; + AssignCaptionProperties(AdxRow, AProperties); + AssignEditorProperties(AdxRow, AProperties); +end; + +procedure TcxCustomDXInspConverter.ImportLayout; +var + AFiler: TcxConverterFiler; + AMemStream: TMemoryStream; +begin + AFiler := TcxConverterFiler.CreateFor(Source); + try + if AFiler.HasData then + begin + AMemStream := TMemoryStream.Create; + try + begin + AFiler.WriteDataProc(AMemStream); + AMemStream.Position := 0; + AFiler.CreateVisibleRows(AMemStream, Self); + end; + finally + AMemStream.Free; + end; + end; + finally + AFiler.Free; + end; +end; + +procedure TcxCustomDXInspConverter.ImportMultiEditorRow(AdxRow: TObject; + AcxRow: TcxCustomRow); +var + I, AIndex: Integer; + AItems, AItem, AItemRow: TObject; + AMultiEditorRowItem: TcxCollectionItemEditorRowProperties; +begin + if FSeparatorString <> '' then + with TcxCustomMultiEditorRowAccess(AcxRow).Properties do + begin + SeparatorKind := skString; + SeparatorString := FSeparatorString; + end; + AItems := GetClassProperty(AdxRow, 'Items'); + if AItems is TCollection then + with TCollection(AItems) do + begin + for I := 0 to Count - 1 do + begin + AItem := Items[I]; + AItemRow := GetClassProperty(AItem, 'Row'); + if AItemRow <> nil then + begin + AMultiEditorRowItem := CreateMultiEditorRowItem(AcxRow); + AssignCaptionProperties(AItemRow, AMultiEditorRowItem); + AssignEditorProperties(AItemRow, AMultiEditorRowItem); + if (I = 0) and (AMultiEditorRowItem.ImageIndex = -1) then + AMultiEditorRowItem.ImageIndex := GetIntegerProperty(AdxRow, 'ImageIndex'); + AMultiEditorRowItem.Width := GetIntegerProperty(AItem, 'Width', 50); + AIndex := FdxRowCache.IndexOf(GetStringProperty(AItemRow, 'Name')); + if AIndex >= 0 then FdxRowCache.Delete(AIndex); + end; + end; + end; +end; + +procedure TcxCustomDXInspConverter.ImportRow(AcxRow: TcxCustomRow; + AdxRow: TObject); +var + H: Integer; +begin + H := GetIntegerProperty(AdxRow, 'Height', 17); + if H <> FDefaultRowHeight then + AcxRow.Height := H; + AcxRow.Visible := GetBooleanProperty(AdxRow, 'Visible'); + if AcxRow is TcxCategoryRow then + ImportCategoryRow(AdxRow, AcxRow) + else if AcxRow is TcxCustomMultiEditorRow then + ImportMultiEditorRow(AdxRow, AcxRow) + else + ImportEditorRow(AdxRow, AcxRow); +end; + +procedure TcxCustomDXInspConverter.ImportRows; +var + I: Integer; + AComponent: TComponent; +begin + // get invisible rows + with Component.Owner do + for I := 0 to ComponentCount - 1 do + begin + AComponent := Components[I]; + if InheritsFromEx(AComponent, 'TdxInspectorRow') and + (AComponent.GetParentComponent = Source) then + if not GetBooleanProperty(AComponent, 'Visible', True) then + FdxRowCache.AddObject(AComponent.Name, nil); + end; + // get visible rows + ImportLayout; + for I := 0 to FdxRowCache.Count -1 do + if FdxRowCache.Objects[I] = nil then + FdxRowCache.Objects[I] := AddRow(nil, FdxRowCache[I]); +end; + +procedure TcxCustomDXInspConverter.SetRowName(AcxRow: TcxCustomRow); +begin + AcxRow.Name := CreateUniqueName(Destination.Owner, Destination, AcxRow, 'Tcx', ''); +end; + +function TcxCustomDXInspConverter.GetAccess: TcxCustomVerticalGridAccess; +begin + Result := TcxCustomVerticalGridAccess(inherited Destination); +end; + +function TcxCustomDXInspConverter.GetComponent: TComponent; +begin + Result := Source as TComponent; +end; + +{ TcxDXInspConverter } + +class function TcxDXInspConverter.GetSourceClassName: string; +begin + Result := 'TdxInspector'; +end; + +procedure TcxDXInspConverter.AssignEditorDataBinding( + AdxRow: TObject; AProperties: TcxCustomEditorRowProperties); +var + Index: Integer; + S: string; +begin + Index := GetConvertorIndex(AdxRow); + if Index < 0 then Exit; + if ConvertorTable[Index].ValueType <> nil then + TcxEditorRowProperties(AProperties).DataBinding.ValueTypeClass := + ConvertorTable[Index].ValueType; + S := GetStringProperty(AdxRow, 'Text'); + if S <> '' then + try + if ConvertorTable[Index].ValueType = TcxDateTimeValueType then + TcxEditorRowProperties(AProperties).Value := StrToDateTime(S) + else + TcxEditorRowProperties(AProperties).Value := S; + except + end; +end; + +procedure TcxDXInspConverter.AssignVerticalGridOptions; +var + S: TStringList; +begin + inherited AssignVerticalGridOptions; + S := TStringList.Create; + with Destination do + try + GetSetProperty(Source, 'Options', S); + if S.IndexOf('ioAutoBandCount') >= 0 then + LayoutStyle := ulsBandsView + else + LayoutStyle := ulsSingleRecordView; + OptionsView.AutoScaleBands := False; + OptionsView.CellAutoHeight := S.IndexOf('ioRowAutoHeight') >= 0; + OptionsView.CellEndEllipsis := S.IndexOf('ioDrawEndEllipsis') >= 0; + OptionsBehavior.BandSizing := S.IndexOf('ioBandSizing') >= 0; + OptionsBehavior.HeaderSizing := S.IndexOf('ioColumnSizing') >= 0; + OptionsBehavior.GoToNextCellOnTab := S.IndexOf('ioTabThrough') >= 0; + OptionsBehavior.GoToNextCellOnEnter := S.IndexOf('ioEnterThrough') >= 0; + OptionsBehavior.RowSizing := S.IndexOf('ioRowSizing') >= 0; + OptionsData.Editing := S.IndexOf('ioEditing') >= 0; + finally + S.Free; + end; +end; + +function TcxDXInspConverter.CreateMultiEditorRowItem( + AcxRow: TcxCustomRow): TcxCollectionItemEditorRowProperties; +begin + Result := TcxMultiEditorRow(AcxRow).Properties.Editors.Add; +end; + +function TcxDXInspConverter.GetRowClassType( + AdxRow: TObject): TcxCustomRowClass; +begin + Result := nil; + if AdxRow = nil then Exit; + if GetBooleanProperty(AdxRow, 'IsCategory') then + Result := TcxCategoryRow + else if SameText(AdxRow.ClassName, 'TdxInspectorComplexRow') then + Result := TcxMultiEditorRow + else + Result := TcxEditorRow; +end; + +function TcxDXInspConverter.GetDestination: TcxUnboundVerticalGridAccess; +begin + Result := TcxUnboundVerticalGridAccess(inherited Destination); +end; + +{ TcxDXDBInspConverter } + +class function TcxDXDBInspConverter.GetSourceClassName: string; +begin + Result := 'TdxDBInspector'; +end; + +procedure TcxDXDBInspConverter.AssignEditorDataBinding( + AdxRow: TObject; AProperties: TcxCustomEditorRowProperties); +begin + TcxDBVerticalGridItemDataBinding(TcxCustomEditorRowPropertiesAccess( + AProperties).DataBinding).FieldName := GetStringProperty(AdxRow, 'FieldName'); +end; + +procedure TcxDXDBInspConverter.AssignVerticalGrid; +begin + inherited AssignVerticalGrid; + Destination.DataController.DataSource := + TDataSource(GetClassProperty(Source, 'DataSource')); +end; + +procedure TcxDXDBInspConverter.AssignVerticalGridOptions; +var + S: TStringList; +begin + inherited AssignVerticalGridOptions; + S := TStringList.Create; + with Destination do + try + GetSetProperty(Source, 'Options', S); + if S.IndexOf('dioAutoBandCount') >= 0 then + LayoutStyle := lsBandsView + else + LayoutStyle := lsSingleRecordView; + OptionsView.AutoScaleBands := False; + OptionsView.CellAutoHeight := S.IndexOf('dioRowAutoHeight') >= 0; + OptionsView.CellEndEllipsis := S.IndexOf('dioDrawEndEllipsis') >= 0; + OptionsBehavior.BandSizing := S.IndexOf('dioBandSizing') >= 0; + OptionsBehavior.HeaderSizing := S.IndexOf('dioColumnSizing') >= 0; + OptionsBehavior.GoToNextCellOnTab := S.IndexOf('dioTabThrough') >= 0; + OptionsBehavior.GoToNextCellOnEnter := S.IndexOf('dioEnterThrough') >= 0; + OptionsBehavior.RowSizing := S.IndexOf('dioRowSizing') >= 0; + OptionsData.CancelOnExit := S.IndexOf('dioCancelOnExit') >= 0; + OptionsData.Editing := S.IndexOf('dioEditing') >= 0; + finally + S.Free; + end; +end; + +function TcxDXDBInspConverter.CreateMultiEditorRowItem( + AcxRow: TcxCustomRow): TcxCollectionItemEditorRowProperties; +begin + Result := TcxDBMultiEditorRow(AcxRow).Properties.Editors.Add; +end; + +function TcxDXDBInspConverter.GetConvertorIndex(AdxRow: TObject): Integer; +var + I: Integer; +begin + Result := -1; + for I := 0 to 17 do + if SameText(AdxRow.ClassName, ConvertorTable[I].DBRowClassName) then + begin + Result := I; + break + end; +end; + +function TcxDXDBInspConverter.GetRowClassType( + AdxRow: TObject): TcxCustomRowClass; +begin + Result := nil; + if AdxRow = nil then Exit; + if GetBooleanProperty(AdxRow, 'IsCategory') then + Result := TcxCategoryRow + else if SameText(AdxRow.ClassName, 'TdxInspectorComplexRow') then + Result := TcxDBMultiEditorRow + else + Result := TcxDBEditorRow; +end; + +procedure TcxDXDBInspConverter.SetRowName(AcxRow: TcxCustomRow); +begin + if AcxRow is TcxDBEditorRow then + AcxRow.Name := CreateUniqueName(Destination.Owner, Destination, AcxRow, + 'Tcx', TcxDBEditorRow(AcxRow).Properties.DataBinding.FieldName) + else + inherited SetRowName(AcxRow); +end; + +function TcxDXDBInspConverter.GetDestination: TcxDBVerticalGrid; +begin + Result := TcxDBVerticalGrid(inherited Destination); +end; + +{ TcxDXRTTIConverter } + +class function TcxDXRTTIConverter.GetSourceClassName: string; +begin + Result := 'TdxRTTIInspector'; +end; + +procedure TcxDXRTTIConverter.DoRealImport; +begin + inherited DoRealImport; + TcxCustomRTTIInspector(Destination).InspectedObject := + TPersistent(GetClassProperty(Source, 'InspectedObject')); +end; + +procedure TcxDXRTTIConverter.ImportRows; +begin +//do nothing +end; + +initialization + ConverterFactory(cxVGGroupConverterName).RegisterConverter('DX Inspector Converter', TcxDXInspConverter); + ConverterFactory(cxDBVGGroupConverterName).RegisterConverter('DX DBInspector Converter', TcxDXDBInspConverter); + ConverterFactory(cxRTTIVGGroupConverterName).RegisterConverter('DX RTTIInspector Converter', TcxDXRTTIConverter); + +end. diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxVGridEditor.dfm b/official/x.35/ExpressVerticalGrid/Sources/cxVGridEditor.dfm new file mode 100644 index 00000000..41be2ec8 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxVGridEditor.dfm @@ -0,0 +1,160 @@ +inherited cxVerticalGridEditor: TcxVerticalGridEditor + Left = 591 + Top = 125 + Width = 282 + Height = 404 + Caption = 'VerticalGrid - rows editor' + Constraints.MinHeight = 310 + Constraints.MinWidth = 280 + PopupMenu = PopupMenu + OnActivate = FormActivate + OnShow = FormShow + PixelsPerInch = 120 + TextHeight = 16 + object Panel1: TPanel + Left = 147 + Top = 0 + Width = 127 + Height = 364 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btCategory: TcxButton + Left = 6 + Top = 50 + Width = 110 + Height = 31 + Caption = 'Add category' + TabOrder = 2 + OnClick = btCategoryClick + end + object btEditor: TcxButton + Left = 6 + Top = 11 + Width = 110 + Height = 31 + Caption = 'Add editor' + TabOrder = 0 + OnClick = btEditorClick + end + object btClose: TcxButton + Left = 6 + Top = 397 + Width = 110 + Height = 31 + Anchors = [akLeft, akRight, akBottom] + Caption = 'Close' + TabOrder = 5 + OnClick = btCloseClick + end + object btMultiEditor: TcxButton + Left = 6 + Top = 90 + Width = 110 + Height = 31 + Caption = 'Add multieditor' + TabOrder = 1 + OnClick = btMultiEditorClick + end + object btDelete: TcxButton + Left = 6 + Top = 129 + Width = 110 + Height = 31 + Caption = 'Delete' + Enabled = False + TabOrder = 3 + OnClick = btDeleteClick + end + object btClear: TcxButton + Left = 6 + Top = 208 + Width = 110 + Height = 31 + Caption = 'Clear all' + Enabled = False + TabOrder = 4 + OnClick = btClearClick + end + object btCreateAll: TcxButton + Left = 6 + Top = 169 + Width = 110 + Height = 30 + Caption = 'Create all items' + TabOrder = 6 + OnClick = btCreateAllClick + end + object btLayoutEditor: TcxButton + Left = 6 + Top = 247 + Width = 110 + Height = 31 + Caption = 'Layout editor...' + Enabled = False + TabOrder = 7 + OnClick = btLayoutEditorClick + end + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 147 + Height = 364 + Align = alClient + BevelOuter = bvNone + BorderWidth = 4 + TabOrder = 1 + object lbRows: TListBox + Left = 4 + Top = 4 + Width = 139 + Height = 356 + Align = alClient + ItemHeight = 16 + MultiSelect = True + TabOrder = 0 + OnClick = lbRowsClick + end + end + object PopupMenu: TPopupMenu + Left = 128 + Top = 16 + object miEditor: TMenuItem + Caption = 'Add &editor' + ShortCut = 45 + OnClick = miEditorClick + end + object miCategory: TMenuItem + Caption = 'Add &category' + OnClick = miCategoryClick + end + object miMultieditor: TMenuItem + Caption = 'Add &multieditor' + OnClick = miMultieditorClick + end + object N1: TMenuItem + Caption = '-' + end + object miDelete: TMenuItem + Caption = '&Delete row' + Enabled = False + ShortCut = 46 + OnClick = miDeleteClick + end + object miClearAll: TMenuItem + Caption = 'C&lear all' + Enabled = False + OnClick = miClearAllClick + end + object N2: TMenuItem + Caption = '-' + end + object miSelectAll: TMenuItem + Caption = 'Select &All' + Enabled = False + ShortCut = 16449 + OnClick = miSelectAllClick + end + end +end diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxVGridEditor.pas b/official/x.35/ExpressVerticalGrid/Sources/cxVGridEditor.pas new file mode 100644 index 00000000..e1737bcf --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxVGridEditor.pas @@ -0,0 +1,433 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressVerticalGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSVERTICALGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxVGridEditor; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + DesignIntf, Variants, +{$ELSE} + DsgnIntf, +{$ENDIF} + Classes, Graphics, Controls, Forms, + Dialogs, cxDesignWindows, cxVGrid, StdCtrls, ComCtrls, ExtCtrls, + cxLookAndFeelPainters, cxButtons, cxDBVGrid, Menus; + +type + TcxVerticalGridEditor = class(TcxDesignFormEditor) + Panel1: TPanel; + Panel2: TPanel; + lbRows: TListBox; + btCategory: TcxButton; + btEditor: TcxButton; + btClose: TcxButton; + btMultiEditor: TcxButton; + btDelete: TcxButton; + btClear: TcxButton; + btCreateAll: TcxButton; + PopupMenu: TPopupMenu; + miEditor: TMenuItem; + miCategory: TMenuItem; + miMultieditor: TMenuItem; + N1: TMenuItem; + miDelete: TMenuItem; + miClearAll: TMenuItem; + N2: TMenuItem; + miSelectAll: TMenuItem; + btLayoutEditor: TcxButton; + procedure btCloseClick(Sender: TObject); + procedure lbRowsClick(Sender: TObject); + procedure btCategoryClick(Sender: TObject); + procedure btEditorClick(Sender: TObject); + procedure btMultiEditorClick(Sender: TObject); + procedure btDeleteClick(Sender: TObject); + procedure btClearClick(Sender: TObject); + procedure FormActivate(Sender: TObject); + procedure btCreateAllClick(Sender: TObject); + procedure miEditorClick(Sender: TObject); + procedure miCategoryClick(Sender: TObject); + procedure miMultieditorClick(Sender: TObject); + procedure miDeleteClick(Sender: TObject); + procedure miClearAllClick(Sender: TObject); + procedure miSelectAllClick(Sender: TObject); + procedure btLayoutEditorClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + private + FLocked: Boolean; + procedure AddRow(ARowClass: TcxCustomRowClass); + function GetVerticalGrid: TcxCustomVerticalGrid; + procedure SelectItem(AItem: Pointer); + procedure UpdateButtons; + procedure UpdateDesigner(Sender: TObject); + procedure UpdateItems; + protected + procedure InitFormEditor; override; + public + procedure DoItemsModified; override; + procedure SelectionsChanged(const ASelection: TDesignerSelectionList); override; + property VerticalGrid: TcxCustomVerticalGrid read GetVerticalGrid; + end; + +procedure ShowVerticalGridEditor(ADesigner: IDesigner; AVerticalGrid: TcxCustomVerticalGrid); + +implementation + +uses +{$IFNDEF DELPHI5} + cxClasses, +{$ENDIF} +{$IFDEF DELPHI6} + Types, +{$ELSE} + Windows, +{$ENDIF} + SysUtils, cxDBData, cxVGridLayoutEditor; + +{$R *.dfm} + +const + SSubStr = 'Tcx'; + SizeStore: TRect = (Left: -1; Top: -1; Right: -1; Bottom: -1); + +procedure ShowVerticalGridEditor(ADesigner: IDesigner; + AVerticalGrid: TcxCustomVerticalGrid); +begin + ShowFormEditorClass(ADesigner, AVerticalGrid, TcxVerticalGridEditor); +end; + +procedure TcxVerticalGridEditor.btCategoryClick(Sender: TObject); +begin + AddRow(TcxCategoryRow); +end; + +procedure TcxVerticalGridEditor.btEditorClick(Sender: TObject); +var + AIntf: IcxVGridDesignerRows; +begin + if Supports(TObject(VerticalGrid), IcxVGridDesignerRows, AIntf) then + AddRow(AIntf.GetEditorRowClass); +end; + +procedure TcxVerticalGridEditor.btMultiEditorClick(Sender: TObject); +var + AIntf: IcxVGridDesignerRows; +begin + if Supports(TObject(VerticalGrid), IcxVGridDesignerRows, AIntf) then + AddRow(AIntf.GetMultiEditorRowClass); +end; + +procedure TcxVerticalGridEditor.btDeleteClick(Sender: TObject); + + function FindItemToSelect: Pointer; + var + I: Integer; + begin + Result := nil; + with lbRows do + begin + if ItemIndex = -1 then Exit; + if not Selected[ItemIndex] then + Result := Items.Objects[ItemIndex] + else + begin + for I := ItemIndex + 1 to Items.Count - 1 do + if not Selected[I] then + begin + Result := Items.Objects[I]; + Exit + end; + for I := ItemIndex - 1 downto 0 do + if not Selected[I] then + begin + Result := Items.Objects[I]; + Exit + end; + end; + end; + end; + +var + AItem: Pointer; + ARow: TcxCustomRow; + I, J: Integer; +begin + if lbRows.SelCount > 0 then + begin + FLocked := True; + AItem := FindItemToSelect; + VerticalGrid.BeginUpdate; + try + for I := lbRows.Items.Count - 1 downto 0 do + if lbRows.Selected[I] then + begin + ARow := TcxCustomRow(lbRows.Items.Objects[I]); + if not CanDeleteComponent(ARow) then + begin + AItem := ARow; + continue; + end; + J := ARow.Index; + while ARow.Count > 0 do + with ARow.Rows[0] do + begin + Parent := ARow.Parent; + Index := J; + Inc(J); + end; + ARow.Free; + end; + finally + VerticalGrid.EndUpdate; + FLocked := False; + end; + if lbRows.CanFocus then lbRows.SetFocus; + UpdateItems; + SelectItem(AItem); + UpdateDesigner(nil); + lbRowsClick(nil); + end; +end; + +procedure TcxVerticalGridEditor.btCloseClick(Sender: TObject); +begin + Close; +end; + +procedure TcxVerticalGridEditor.lbRowsClick(Sender: TObject); +var + AList: TList; + I: Integer; +begin + AList := TList.Create; + try + for I := 0 to lbRows.Items.Count - 1 do + if lbRows.Selected[I] then + AList.Add(lbRows.Items.Objects[I]); + SelectComponents(AList, VerticalGrid); + finally + AList.Free; + end; + UpdateButtons; +end; + +procedure TcxVerticalGridEditor.AddRow(ARowClass: TcxCustomRowClass); +var + ARow: TcxCustomRow; +begin + if ARowClass <> nil then + begin + ARow := VerticalGrid.Add(ARowClass); + ARow.Name := CreateUniqueName(VerticalGrid.Owner, VerticalGrid, ARow, 'Tcx', ''); + UpdateItems; + SelectItem(ARow); + UpdateButtons; + UpdateDesigner(nil); + end; +end; + +function TcxVerticalGridEditor.GetVerticalGrid: TcxCustomVerticalGrid; +begin + Result := Component as TcxCustomVerticalGrid; +end; + +procedure TcxVerticalGridEditor.SelectItem(AItem: Pointer); +begin + with lbRows do + ItemIndex := Items.IndexOfObject(AItem); + ListBoxClearSelection(lbRows); + if Component <> nil then + if (AItem <> nil) and (lbRows.ItemIndex >= 0) then + Designer.SelectComponent(TPersistent(AItem)) + else + Designer.SelectComponent(Component) +end; + +procedure TcxVerticalGridEditor.UpdateButtons; +begin + btDelete.Enabled := lbRows.SelCount <> 0; + miDelete.Enabled := btDelete.Enabled; + miSelectAll.Enabled := lbRows.Items.Count > 0; + btClear.Enabled := miSelectAll.Enabled; + miClearAll.Enabled := miSelectAll.Enabled; + btLayoutEditor.Enabled := miSelectAll.Enabled; + btCreateAll.Visible := VerticalGrid is TcxDBVerticalGrid; + if btCreateAll.Visible then + btCreateAll.Enabled := TcxDBVerticalGrid(VerticalGrid).DataController.Dataset <> nil; +end; + +procedure TcxVerticalGridEditor.UpdateDesigner(Sender: TObject); +begin + Designer.Modified; +end; + +procedure TcxVerticalGridEditor.UpdateItems; +var + I, AItemIndex, ATopIndex: Integer; + ASelection: TStringList; +begin + ListBoxSaveSelection(lbRows, ASelection, AItemIndex, ATopIndex); + try + lbRows.Items.Clear; + for I := 0 to VerticalGrid.Rows.Count - 1 do + lbRows.Items.AddObject(VerticalGrid.Rows[I].Name, VerticalGrid.Rows.Items[I]); + finally + ListBoxRestoreSelection(lbRows, ASelection, AItemIndex, ATopIndex); + end; +end; + +procedure TcxVerticalGridEditor.InitFormEditor; +begin + inherited InitFormEditor; + UpdateItems; + UpdateSelection; + UpdateButtons; + if not btCreateAll.Visible then + begin + btLayoutEditor.Top := btClear.Top; + btClear.Top := btCreateAll.Top; + end; + ClientHeight := btLayoutEditor.Top + btLayoutEditor.Height * 3 + 16; + Constraints.MinHeight := Height; + btClose.Top := ClientHeight - (btClose.Height + 8); +end; + +procedure TcxVerticalGridEditor.DoItemsModified; +begin + UpdateItems; +end; + +procedure TcxVerticalGridEditor.SelectionsChanged( + const ASelection: TDesignerSelectionList); +var + AList: TList; +begin + if FLocked then Exit; + AList := TList.Create; + try + GetSelectionList(AList); + ListBoxSyncSelection(lbRows, AList); + finally + AList.Free; + end; + UpdateButtons; +end; + +procedure TcxVerticalGridEditor.btClearClick(Sender: TObject); +begin + ListBoxSelectAll(lbRows); + btDeleteClick(nil); + UpdateItems; + UpdateSelection; + UpdateButtons; +end; + +procedure TcxVerticalGridEditor.FormActivate(Sender: TObject); +begin + UpdateButtons; +end; + +procedure TcxVerticalGridEditor.btCreateAllClick(Sender: TObject); +begin + if VerticalGrid is TcxDBVerticalGrid then + begin + TcxDBVerticalGrid(VerticalGrid).DataController.CreateAllItems; + UpdateItems; + UpdateButtons; + UpdateDesigner(nil); + end; +end; + +procedure TcxVerticalGridEditor.miEditorClick(Sender: TObject); +begin + btEditorClick(nil); +end; + +procedure TcxVerticalGridEditor.miCategoryClick(Sender: TObject); +begin + btCategoryClick(nil); +end; + +procedure TcxVerticalGridEditor.miMultieditorClick(Sender: TObject); +begin + btMultiEditorClick(nil); +end; + +procedure TcxVerticalGridEditor.miDeleteClick(Sender: TObject); +begin + btDeleteClick(nil); +end; + +procedure TcxVerticalGridEditor.miClearAllClick(Sender: TObject); +begin + btClearClick(nil); +end; + +procedure TcxVerticalGridEditor.miSelectAllClick(Sender: TObject); +begin + ListBoxSelectAll(lbRows); + UpdateItems; + UpdateButtons; + UpdateDesigner(nil); +end; + +procedure TcxVerticalGridEditor.btLayoutEditorClick(Sender: TObject); +begin + ShowVerticalGridLayoutEditor(VerticalGrid); +end; + +procedure TcxVerticalGridEditor.FormShow(Sender: TObject); +begin + if SizeStore.Right <> -1 then + begin + Left := SizeStore.Left; + Top := SizeStore.Top; + Width := SizeStore.Right; + Height := SizeStore.Bottom; + end; +end; + +procedure TcxVerticalGridEditor.FormClose(Sender: TObject; + var Action: TCloseAction); +begin + SizeStore.Left := Left; + SizeStore.Top := Top; + SizeStore.Right := Width; + SizeStore.Bottom := Height; +end; + +end. diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxVGridLayoutEditor.dfm b/official/x.35/ExpressVerticalGrid/Sources/cxVGridLayoutEditor.dfm new file mode 100644 index 00000000..5524ba01 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxVGridLayoutEditor.dfm @@ -0,0 +1,76 @@ +object fmvgLayoutEditor: TfmvgLayoutEditor + Left = 301 + Top = 223 + Width = 491 + Height = 343 + Caption = 'Layout editor' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poDefaultPosOnly + OnClose = FormClose + OnCreate = FormCreate + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object pnlButtons: TPanel + Left = 378 + Top = 0 + Width = 105 + Height = 309 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btCustomize: TcxButton + Left = 8 + Top = 80 + Width = 89 + Height = 25 + Caption = 'Customize' + TabOrder = 0 + OnClick = btCustomizeClick + end + object btOk: TcxButton + Left = 8 + Top = 16 + Width = 89 + Height = 25 + Caption = 'OK' + ModalResult = 1 + TabOrder = 1 + end + object btCancel: TcxButton + Left = 8 + Top = 48 + Width = 89 + Height = 25 + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object StatusBar1: TStatusBar + Left = 0 + Top = 290 + Width = 105 + Height = 19 + Panels = < + item + Bevel = pbNone + Width = 50 + end> + end + end + object pnlVGPlace: TPanel + Left = 0 + Top = 0 + Width = 378 + Height = 309 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + end +end diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxVGridLayoutEditor.pas b/official/x.35/ExpressVerticalGrid/Sources/cxVGridLayoutEditor.pas new file mode 100644 index 00000000..5ddcb117 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxVGridLayoutEditor.pas @@ -0,0 +1,257 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressVerticalGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSVERTICALGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxVGridLayoutEditor; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, ExtCtrls, StdCtrls, cxButtons, cxVGrid, cxLookAndFeelPainters, + ComCtrls; + +type + TfmvgLayoutEditor = class(TForm) + pnlButtons: TPanel; + pnlVGPlace: TPanel; + btCustomize: TcxButton; + btOk: TcxButton; + btCancel: TcxButton; + StatusBar1: TStatusBar; + procedure btCustomizeClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + private + FVerticalGrid: TcxCustomVerticalGrid; + protected + procedure ApplyUpdates(Dest: TcxCustomVerticalGrid); virtual; + procedure CreateClone(Source: TcxCustomVerticalGrid); virtual; + procedure PrepareLayoutStyle(Source: TcxCustomVerticalGrid); virtual; + property VerticalGrid: TcxCustomVerticalGrid read FVerticalGrid; + end; + +var + fmvgLayoutEditor: TfmvgLayoutEditor; + +procedure ShowVerticalGridLayoutEditor(AVerticalGrid: TcxCustomVerticalGrid; + ACaption: string = ''); + +implementation + +uses + cxInplaceContainer, cxClasses, cxVGridConsts; + +{$R *.dfm} + +const + SizeStore: TRect = (Left: -1; Top: -1; Right: -1; Bottom: -1); + +type + TcxCustomVerticalGridClass = class of TcxCustomVerticalGrid; + TcxCustomVerticalGridAccess = class(TcxCustomVerticalGrid); + TcxUnboundVerticalGridAccess = class(TcxUnboundVerticalGrid); + TcxVerticalGridCustomizingAccess = class(TcxVerticalGridCustomizing); + TcxCustomRowAccess = class(TcxCustomRow); + TcxCustomMultiEditorRowAccess = class(TcxCustomMultiEditorRow); + TcxVerticalGridRowsAccess = class(TcxVerticalGridRows); + +procedure ShowVerticalGridLayoutEditor(AVerticalGrid: TcxCustomVerticalGrid; + ACaption: string = ''); +var + AForm: TfmvgLayoutEditor; +begin + if AVerticalGrid = nil then Exit; + AForm := TfmvgLayoutEditor.Create(nil); + with AForm do + try + if ACaption <> '' then + Caption := ACaption + else + Caption := cxGetResourceString(@cxSvgLayoutEditorCaption); + FVerticalGrid := TcxCustomVerticalGridClass(AVerticalGrid.ClassType).Create(nil); + try + CreateClone(AVerticalGrid); + FVerticalGrid.Parent := pnlVGPlace; + FVerticalGrid.Align := alClient; + if ShowModal = mrOk then ApplyUpdates(AVerticalGrid); + finally + FVerticalGrid.Free; + end; + finally + Release; + end; +end; + +{ TfmvgLayoutEditor } + +procedure TfmvgLayoutEditor.ApplyUpdates(Dest: TcxCustomVerticalGrid); +var + I: Integer; + ASourceRow: TcxCustomRowAccess; + ADestRow: TcxCustomRow; + ADestRows: TcxVerticalGridRowsAccess; +begin + with Dest do + try + BeginUpdate; + ADestRows := TcxVerticalGridRowsAccess(Rows); + for I := 0 to VerticalGrid.Rows.Count - 1 do + begin + ASourceRow := TcxCustomRowAccess(VerticalGrid.Rows[I]); + ADestRow := ADestRows.FindRowByID(ASourceRow.ID); + if ADestRow = nil then continue; + if ASourceRow.Parent = nil then + ADestRow.Parent := nil + else + ADestRow.Parent := ADestRows.FindRowByID(TcxCustomRowAccess(ASourceRow.Parent).ID); + ADestRow.Index := ASourceRow.Index; + if ASourceRow.IsHeightAssigned then + ADestRow.Height := ASourceRow.Height; + ADestRow.Expanded := ASourceRow.Expanded; + ADestRow.Visible := ASourceRow.Visible; + end; + OptionsView.Assign(VerticalGrid.OptionsView); + finally + EndUpdate; + TcxCustomVerticalGridAccess(Dest).Modified; + end; +end; + +procedure TfmvgLayoutEditor.CreateClone(Source: TcxCustomVerticalGrid); + + procedure CorrectRowsNames; + var + I, J: Integer; + ASourceRow, ADestRow: TcxCustomRow; + begin + for I := 0 to VerticalGrid.Rows.Count - 1 do + begin + ASourceRow := Source.Rows[I]; + ADestRow := VerticalGrid.Rows[I]; + if ADestRow is TcxCustomMultiEditorRow then + with TcxCustomMultiEditorRowAccess(ADestRow) do + for J := 0 to Properties.Editors.Count - 1 do + Properties.Editors[J].Options.Focusing := True; + ADestRow.Options.Focusing := True; + if ASourceRow.Name <> '' then + try + ADestRow.Name := ASourceRow.Name; + except + end; + end; + end; + +begin + with VerticalGrid do + try + BeginUpdate; + TcxCustomVerticalGridAccess(VerticalGrid).DataController.Assign( + TcxCustomVerticalGridAccess(Source).DataController); + AssignRows(Source); + CorrectRowsNames; + OptionsData.Assign(Source.OptionsData); + OptionsView.Assign(Source.OptionsView); + Images := Source.Images; + PrepareLayoutStyle(Source); + OptionsBehavior.Assign(Source.OptionsBehavior); + LookAndFeel.Assign(Source.LookAndFeel); + Styles.Assign(Source.Styles); + TcxCustomVerticalGridAccess(VerticalGrid).DragMode := dmAutomatic; + OptionsBehavior.RowSizing := True; + OptionsBehavior.CellHints := False; + OptionsData.Editing := False; + if OptionsData is TcxvgMultiRecordsOptionsData then + with TcxvgMultiRecordsOptionsData(OptionsData) do + begin + Deleting := False; + Inserting := False; + end; + finally + EndUpdate; + end; + btCustomize.LookAndFeel.Assign(VerticalGrid.LookAndFeel); + btOk.LookAndFeel.Assign(VerticalGrid.LookAndFeel); + btCancel.LookAndFeel.Assign(VerticalGrid.LookAndFeel); +end; + +procedure TfmvgLayoutEditor.PrepareLayoutStyle(Source: TcxCustomVerticalGrid); +begin + if VerticalGrid is TcxUnboundVerticalGrid then + TcxUnboundVerticalGridAccess(VerticalGrid).LayoutStyle := + TcxUnboundVerticalGridAccess(Source).LayoutStyle + else + if VerticalGrid is TcxVirtualVerticalGrid then + TcxVirtualVerticalGrid(VerticalGrid).LayoutStyle := + TcxVirtualVerticalGrid(Source).LayoutStyle; +end; + +procedure TfmvgLayoutEditor.btCustomizeClick(Sender: TObject); +begin + with TcxCustomVerticalGridAccess(VerticalGrid) do + begin + TcxVerticalGridCustomizingAccess(Customizing).ShowCategoryButtons := False; + Customizing.Visible := True; + end; +end; + +procedure TfmvgLayoutEditor.FormCreate(Sender: TObject); +begin + btOk.Caption := cxGetResourceString(@cxSvgOKCaption); + btCancel.Caption := cxGetResourceString(@cxSvgCancelCaption); + btCustomize.Caption := cxGetResourceString(@cxSvgLayoutEditorCustomize); +end; + +procedure TfmvgLayoutEditor.FormShow(Sender: TObject); +begin + if SizeStore.Right <> -1 then + begin + Left := SizeStore.Left; + Top := SizeStore.Top; + Width := SizeStore.Right; + Height := SizeStore.Bottom; + end; +end; + +procedure TfmvgLayoutEditor.FormClose(Sender: TObject; + var Action: TCloseAction); +begin + SizeStore.Left := Left; + SizeStore.Top := Top; + SizeStore.Right := Width; + SizeStore.Bottom := Height; +end; + +end. diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxVGridNewCategory.dfm b/official/x.35/ExpressVerticalGrid/Sources/cxVGridNewCategory.dfm new file mode 100644 index 00000000..3ea6d8eb --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxVGridNewCategory.dfm @@ -0,0 +1,59 @@ +object fmCreateCategory: TfmCreateCategory + Left = 669 + Top = 113 + BorderStyle = bsDialog + ClientHeight = 87 + ClientWidth = 279 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object lbCaption: TLabel + Left = 11 + Top = 13 + Width = 3 + Height = 13 + FocusControl = edCaption + end + object Bevel: TBevel + Left = 11 + Top = 42 + Width = 260 + Height = 4 + Shape = bsTopLine + end + object btOK: TcxButton + Left = 113 + Top = 55 + Width = 75 + Height = 24 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btCancel: TcxButton + Left = 196 + Top = 55 + Width = 75 + Height = 24 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object edCaption: TcxTextEdit + Left = 72 + Top = 10 + Width = 199 + Height = 21 + Properties.OnChange = edCaptionPropertiesChange + TabOrder = 0 + end +end diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxVGridNewCategory.pas b/official/x.35/ExpressVerticalGrid/Sources/cxVGridNewCategory.pas new file mode 100644 index 00000000..69ec1e5a --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxVGridNewCategory.pas @@ -0,0 +1,143 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressVerticalGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSVERTICALGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxVGridNewCategory; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls, cxControls, cxContainer, cxEdit, cxTextEdit, + cxButtons, cxLookAndFeels, cxLookAndFeelPainters; + +type + TfmCreateCategory = class(TForm) + lbCaption: TLabel; + Bevel: TBevel; + btOK: TcxButton; + btCancel: TcxButton; + edCaption: TcxTextEdit; + procedure FormCreate(Sender: TObject); + procedure edCaptionPropertiesChange(Sender: TObject); + private + FParentWindow: HWND; + protected + procedure CreateParams(var Params: TCreateParams); override; + public + constructor Create(AOwner: TComponent); override; + procedure Prepare(AOwnerForm: TForm; ALookAndFeel: TcxLookAndFeel); + end; + +function cxShowNewCategoryForm(AOwnerForm: TForm; var ACaption: string; + ALookAndFeel: TcxLookAndFeel = nil): Boolean; + +implementation + +uses + cxClasses, cxVGridConsts; + +{$R *.DFM} + +function cxShowNewCategoryForm(AOwnerForm: TForm; var ACaption: string; + ALookAndFeel: TcxLookAndFeel = nil): Boolean; +var + AForm: TfmCreateCategory; +begin + Result := False; + AForm := TfmCreateCategory.Create(AOwnerForm); + try + AForm.edCaption.Text := ACaption; + AForm.edCaptionPropertiesChange(nil); + AForm.Prepare(AOwnerForm, ALookAndFeel); + if AForm.ShowModal = mrOK then + begin + ACaption := AForm.edCaption.Text; + Result := True; + end; + finally + AForm.Free; + end; +end; + +{ TfmCreateCategory } + +constructor TfmCreateCategory.Create(AOwner: TComponent); +begin + if AOwner is TForm then + FParentWindow := TForm(AOwner).Handle + else + FParentWindow := 0; + inherited Create(AOwner); +end; + +procedure TfmCreateCategory.Prepare(AOwnerForm: TForm; ALookAndFeel: TcxLookAndFeel); +var + ALeft, ATop: Integer; +begin + if Assigned(AOwnerForm) then + begin + Font.Name := AOwnerForm.Font.Name; + ALeft := (AOwnerForm.Width - Width) div 2 + AOwnerForm.Left; + ATop := (AOwnerForm.Height - Height) div 2 + AOwnerForm.Top; + if ALeft < 0 then ALeft := 0; + if ATop < 0 then ATop := 0; + SetBounds(ALeft, ATop, Width, Height); + end; + btOK.LookAndFeel := ALookAndFeel; + btCancel.LookAndFeel := ALookAndFeel; + edCaption.Style.LookAndFeel := ALookAndFeel; +end; + +procedure TfmCreateCategory.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + if FParentWindow <> 0 then + Params.WndParent := FParentWindow; +end; + +procedure TfmCreateCategory.FormCreate(Sender: TObject); +begin + Caption := cxGetResourceString(@cxSvgNewCategoryCaption); + lbCaption.Caption := cxGetResourceString(@cxSvgNewCategoryLabelCaption); + btOK.Caption := cxGetResourceString(@cxSvgOKCaption); + btCancel.Caption := cxGetResourceString(@cxSvgCancelCaption); +end; + +procedure TfmCreateCategory.edCaptionPropertiesChange(Sender: TObject); +begin + btOK.Enabled := edCaption.Text <> ''; +end; + +end. diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxVGridPredefinedStyles.dfm b/official/x.35/ExpressVerticalGrid/Sources/cxVGridPredefinedStyles.dfm new file mode 100644 index 00000000..0d8425bf --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxVGridPredefinedStyles.dfm @@ -0,0 +1,2350 @@ +object cxdmVerticalGridPredefinedStyles: TcxdmVerticalGridPredefinedStyles + OldCreateOrder = False + Left = 447 + Top = 147 + Height = 150 + Width = 215 + object StyleRepository: TcxStyleRepository + Left = 88 + Top = 8 + object cxStyle1: TcxStyle + AssignedValues = [svColor] + Color = 10996706 + end + object cxStyle2: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6787015 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clMaroon + end + object cxStyle3: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14215155 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsItalic] + TextColor = clBlack + end + object cxStyle4: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10996706 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle5: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8171478 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle6: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 2829218 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle7: TcxStyle + AssignedValues = [svColor] + Color = 11518669 + end + object cxStyle8: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Verdana' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle9: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clTeal + end + object cxStyle10: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11518669 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle11: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9612476 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle12: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle13: TcxStyle + AssignedValues = [svColor] + Color = 11055248 + end + object cxStyle14: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 8292193 + TextColor = clWhite + end + object cxStyle15: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle16: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11055248 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle17: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9279343 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle18: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7897176 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle19: TcxStyle + AssignedValues = [svColor] + Color = 14264494 + end + object cxStyle20: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12941956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Garamond' + Font.Style = [fsBold, fsItalic] + TextColor = clWhite + end + object cxStyle21: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 16380659 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle22: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14264494 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle23: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13338511 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle24: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11619930 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle25: TcxStyle + AssignedValues = [svColor] + Color = 11458790 + end + object cxStyle26: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7913174 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clOlive + end + object cxStyle27: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15004664 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clGray + end + object cxStyle28: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11458790 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clOlive + end + object cxStyle29: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9095643 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle30: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4630214 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle31: TcxStyle + AssignedValues = [svColor] + Color = clTeal + end + object cxStyle32: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle33: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14213320 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle34: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12107912 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle35: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11515030 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle36: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10067831 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle37: TcxStyle + AssignedValues = [svColor] + Color = 9476264 + end + object cxStyle38: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7568529 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle39: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160664 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle40: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9476264 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle41: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7831957 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle42: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4210816 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle43: TcxStyle + AssignedValues = [svColor] + Color = 8308967 + end + object cxStyle44: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 2396093 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle45: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14019831 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clGreen + end + object cxStyle46: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8308967 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle47: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5617117 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle48: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4944971 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle49: TcxStyle + AssignedValues = [svColor] + Color = 12429461 + end + object cxStyle50: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11441533 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle51: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clGray + end + object cxStyle52: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12429461 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle53: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9993057 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle54: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8217935 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle55: TcxStyle + AssignedValues = [svColor] + Color = 15395562 + end + object cxStyle56: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13002291 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle57: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsItalic] + TextColor = clMaroon + end + object cxStyle58: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15395562 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle59: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12171705 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle60: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 185 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle61: TcxStyle + AssignedValues = [svColor] + Color = 13158655 + end + object cxStyle62: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9211088 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle63: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15461375 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle64: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 13158655 + TextColor = clBlack + end + object cxStyle65: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8553164 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle66: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5855675 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle67: TcxStyle + AssignedValues = [svColor] + Color = 13158655 + end + object cxStyle68: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9540050 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -19 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle69: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15461375 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle70: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [] + TextColor = clBlack + end + object cxStyle71: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9013711 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle72: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5855675 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle73: TcxStyle + AssignedValues = [svColor] + Color = 13154717 + end + object cxStyle74: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12035200 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle75: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clGray + end + object cxStyle76: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13154717 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle77: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11771255 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle78: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9928789 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle79: TcxStyle + AssignedValues = [svColor] + Color = 12309430 + end + object cxStyle80: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11126946 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle81: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle82: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12309430 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle83: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9615497 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle84: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6592345 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle85: TcxStyle + AssignedValues = [svColor] + Color = 13750737 + end + object cxStyle86: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10911061 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle87: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 16119285 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle88: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13750737 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle89: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11579568 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle90: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12097140 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle91: TcxStyle + AssignedValues = [svColor] + Color = clSilver + end + object cxStyle92: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle93: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clTeal + end + object cxStyle94: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle95: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10526880 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle96: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle97: TcxStyle + AssignedValues = [svColor] + Color = 15138815 + end + object cxStyle98: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7523789 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle99: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15138815 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clOlive + end + object cxStyle100: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10542814 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle101: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 38807 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle102: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clOlive + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle103: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle104: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle105: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle106: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle107: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle108: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle109: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle110: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle111: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle112: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle113: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle114: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle115: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle116: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle117: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle118: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle119: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle120: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle121: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle122: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle123: TcxStyle + AssignedValues = [svColor] + Color = -1 + end + object cxStyle124: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clYellow + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle125: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clYellow + end + object cxStyle126: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle127: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle128: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 206 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle129: TcxStyle + AssignedValues = [svColor] + Color = -1 + end + object cxStyle130: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clYellow + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle131: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clYellow + end + object cxStyle132: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle133: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle134: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 206 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle135: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle136: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clNavy + end + object cxStyle137: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clYellow + end + object cxStyle138: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle139: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clYellow + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clNavy + end + object cxStyle140: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle141: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clNavy + end + object cxStyle142: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clYellow + end + object cxStyle143: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle144: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clYellow + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clNavy + end + object cxStyle145: TcxStyle + AssignedValues = [svColor] + Color = -1 + end + object cxStyle146: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle147: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clSilver + end + object cxStyle148: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle149: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle150: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle151: TcxStyle + AssignedValues = [svColor] + Color = -1 + end + object cxStyle152: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = -1 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -21 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle153: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clSilver + end + object cxStyle154: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle155: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle156: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle157: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = -1 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle158: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle159: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle160: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle161: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle162: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = -1 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -21 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle163: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle164: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle165: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle166: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle167: TcxStyle + AssignedValues = [svColor] + Color = 11295531 + end + object cxStyle168: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16247513 + TextColor = clBlack + end + object cxStyle169: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 12937777 + TextColor = clWhite + end + object cxStyle170: TcxStyle + AssignedValues = [svColor] + Color = 15451300 + end + object cxStyle171: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBlack + end + object cxStyle172: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14059352 + TextColor = clWhite + end + object cxStyle173: TcxStyle + AssignedValues = [svColor] + Color = 5211069 + end + object cxStyle174: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14348540 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle175: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8104919 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle176: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11457510 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle177: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10207457 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle178: TcxStyle + AssignedValues = [svColor] + Color = 5475927 + end + object cxStyle179: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15463404 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Verdana' + Font.Style = [] + TextColor = clGreen + end + object cxStyle180: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7383924 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Verdana' + Font.Style = [] + TextColor = clWhite + end + object cxStyle181: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9420435 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Verdana' + Font.Style = [] + TextColor = clWhite + end + object cxStyle182: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9223055 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Verdana' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle183: TcxStyle + AssignedValues = [svColor] + Color = 11053224 + end + object cxStyle184: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15329769 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clGray + end + object cxStyle185: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13948116 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle186: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clGray + end + object cxStyle187: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11579568 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle188: TcxStyle + AssignedValues = [svColor] + Color = 12937777 + end + object cxStyle189: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11295531 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle190: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16247513 + TextColor = clBlack + end + object cxStyle191: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 12937777 + TextColor = clWhite + end + object cxStyle192: TcxStyle + AssignedValues = [svColor] + Color = 15119240 + end + object cxStyle193: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBlack + end + object cxStyle194: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 15120025 + TextColor = clWhite + end + object cxStyle195: TcxStyle + AssignedValues = [svColor] + Color = 8104919 + end + object cxStyle196: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5211069 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle197: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14348540 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle198: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8104919 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle199: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9289948 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle200: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10207457 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle201: TcxStyle + AssignedValues = [svColor] + Color = 7383924 + end + object cxStyle202: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5475927 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Verdana' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle203: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15463404 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Verdana' + Font.Style = [] + TextColor = clGreen + end + object cxStyle204: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7383924 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Verdana' + Font.Style = [] + TextColor = clWhite + end + object cxStyle205: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9617558 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Verdana' + Font.Style = [] + TextColor = clWhite + end + object cxStyle206: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10733990 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Verdana' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle207: TcxStyle + AssignedValues = [svColor] + Color = 13948116 + end + object cxStyle208: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11053224 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle209: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15329769 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clGray + end + object cxStyle210: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13948116 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle211: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clGray + end + object cxStyle212: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11579568 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle213: TcxStyle + AssignedValues = [svColor] + Color = 14590588 + end + object cxStyle214: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13795663 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clYellow + end + object cxStyle215: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 16247513 + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = clNavy + end + object cxStyle216: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14590588 + TextColor = clWhite + end + object cxStyle217: TcxStyle + AssignedValues = [svColor] + Color = 15185807 + end + object cxStyle218: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBlack + end + object cxStyle219: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15120279 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle220: TcxStyle + AssignedValues = [svColor] + Color = 14125918 + end + object cxStyle221: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13596225 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle222: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16247513 + TextColor = clBlack + end + object cxStyle223: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14125918 + TextColor = clWhite + end + object cxStyle224: TcxStyle + AssignedValues = [svColor] + Color = 15451300 + end + object cxStyle225: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBlack + end + object cxStyle226: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14656381 + TextColor = clWhite + end + object cxStyle227: TcxStyle + AssignedValues = [svColor] + Color = clWhite + end + object cxStyle228: TcxStyle + AssignedValues = [svColor] + Color = clWhite + end + object cxStyle229: TcxStyle + AssignedValues = [svColor] + Color = clWhite + end + object cxStyle230: TcxStyle + AssignedValues = [svColor] + Color = clWhite + end + object cxStyle231: TcxStyle + AssignedValues = [svColor] + Color = 10841658 + end + object cxStyle232: TcxStyle + AssignedValues = [svColor] + Color = 10841658 + end + object cxStyle233: TcxStyle + AssignedValues = [svColor] + Color = 10841658 + end + object cxStyle234: TcxStyle + AssignedValues = [svColor] + Color = 10841658 + end + object cxVerticalGridStyleSheetDevExpress: TcxVerticalGridStyleSheet + Caption = 'DevExpress' + Styles.Background = cxStyle213 + Styles.Content = cxStyle215 + Styles.Inactive = cxStyle217 + Styles.Selection = cxStyle219 + Styles.Category = cxStyle214 + Styles.Header = cxStyle216 + Styles.IncSearch = cxStyle218 + BuiltIn = True + end + object cxVerticalGridStyleSheetUserFormat1: TcxVerticalGridStyleSheet + Caption = 'UserFormat1' + Styles.Background = cxStyle195 + Styles.Content = cxStyle197 + Styles.Inactive = cxStyle199 + Styles.Selection = cxStyle200 + Styles.Category = cxStyle196 + Styles.Header = cxStyle198 + BuiltIn = True + end + object cxVerticalGridStyleSheetUserFormat2: TcxVerticalGridStyleSheet + Caption = 'UserFormat2' + Styles.Background = cxStyle201 + Styles.Content = cxStyle203 + Styles.Inactive = cxStyle205 + Styles.Selection = cxStyle206 + Styles.Category = cxStyle202 + Styles.Header = cxStyle204 + BuiltIn = True + end + object cxVerticalGridStyleSheetUserFormat3: TcxVerticalGridStyleSheet + Caption = 'UserFormat3' + Styles.Background = cxStyle207 + Styles.Content = cxStyle209 + Styles.Inactive = cxStyle211 + Styles.Selection = cxStyle212 + Styles.Category = cxStyle208 + Styles.Header = cxStyle210 + BuiltIn = True + end + object cxVerticalGridStyleSheetUserFormat4: TcxVerticalGridStyleSheet + Caption = 'UserFormat4' + Styles.Background = cxStyle188 + Styles.Content = cxStyle190 + Styles.Inactive = cxStyle192 + Styles.Selection = cxStyle194 + Styles.Category = cxStyle189 + Styles.Header = cxStyle191 + Styles.IncSearch = cxStyle193 + BuiltIn = True + end + object cxVerticalGridStyleSheetBrick: TcxVerticalGridStyleSheet + Caption = 'Brick' + Styles.Background = cxStyle1 + Styles.Content = cxStyle3 + Styles.Inactive = cxStyle5 + Styles.Selection = cxStyle6 + Styles.Category = cxStyle2 + Styles.Header = cxStyle4 + BuiltIn = True + end + object cxVerticalGridStyleDesert: TcxVerticalGridStyleSheet + Caption = 'Desert' + Styles.Background = cxStyle7 + Styles.Content = cxStyle9 + Styles.Inactive = cxStyle11 + Styles.Selection = cxStyle12 + Styles.Category = cxStyle8 + Styles.Header = cxStyle10 + BuiltIn = True + end + object cxVerticalGridStyleSheetEggplant: TcxVerticalGridStyleSheet + Caption = 'Eggplant' + Styles.Background = cxStyle13 + Styles.Content = cxStyle15 + Styles.Inactive = cxStyle17 + Styles.Selection = cxStyle18 + Styles.Category = cxStyle14 + Styles.Header = cxStyle16 + BuiltIn = True + end + object cxVerticalGridStyleSheetLilac: TcxVerticalGridStyleSheet + Caption = 'Lilac' + Styles.Background = cxStyle19 + Styles.Content = cxStyle21 + Styles.Inactive = cxStyle23 + Styles.Selection = cxStyle24 + Styles.Category = cxStyle20 + Styles.Header = cxStyle22 + BuiltIn = True + end + object cxVerticalGridStyleSheetMaple: TcxVerticalGridStyleSheet + Caption = 'Maple' + Styles.Background = cxStyle25 + Styles.Content = cxStyle27 + Styles.Inactive = cxStyle29 + Styles.Selection = cxStyle30 + Styles.Category = cxStyle26 + Styles.Header = cxStyle28 + BuiltIn = True + end + object cxVerticalGridStyleSheetMarineHighColor: TcxVerticalGridStyleSheet + Caption = 'Marine (high color)' + Styles.Background = cxStyle31 + Styles.Content = cxStyle33 + Styles.Inactive = cxStyle35 + Styles.Selection = cxStyle36 + Styles.Category = cxStyle32 + Styles.Header = cxStyle34 + BuiltIn = True + end + object cxVerticalGridStyleSheetPlumHighColor: TcxVerticalGridStyleSheet + Caption = 'Plum (high color)' + Styles.Background = cxStyle37 + Styles.Content = cxStyle39 + Styles.Inactive = cxStyle41 + Styles.Selection = cxStyle42 + Styles.Category = cxStyle38 + Styles.Header = cxStyle40 + BuiltIn = True + end + object cxVerticalGridStyleSheetPumpkinLarge: TcxVerticalGridStyleSheet + Caption = 'Pumpkin (large)' + Styles.Background = cxStyle43 + Styles.Content = cxStyle45 + Styles.Inactive = cxStyle47 + Styles.Selection = cxStyle48 + Styles.Category = cxStyle44 + Styles.Header = cxStyle46 + BuiltIn = True + end + object cxVerticalGridStyleSheetRainyDay: TcxVerticalGridStyleSheet + Caption = 'Rainy Day' + Styles.Background = cxStyle49 + Styles.Content = cxStyle51 + Styles.Inactive = cxStyle53 + Styles.Selection = cxStyle54 + Styles.Category = cxStyle50 + Styles.Header = cxStyle52 + BuiltIn = True + end + object cxVerticalGridStyleSheetRedWhiteAndBlueVGA: TcxVerticalGridStyleSheet + Caption = 'Red, White, and Blue (VGA)' + Styles.Background = cxStyle55 + Styles.Content = cxStyle57 + Styles.Inactive = cxStyle59 + Styles.Selection = cxStyle60 + Styles.Category = cxStyle56 + Styles.Header = cxStyle58 + BuiltIn = True + end + object cxVerticalGridStyleSheetRose: TcxVerticalGridStyleSheet + Caption = 'Rose' + Styles.Background = cxStyle61 + Styles.Content = cxStyle63 + Styles.Inactive = cxStyle65 + Styles.Selection = cxStyle66 + Styles.Category = cxStyle62 + Styles.Header = cxStyle64 + BuiltIn = True + end + object cxVerticalGridStyleSheetRoseLarge: TcxVerticalGridStyleSheet + Caption = 'Rose (large)' + Styles.Background = cxStyle67 + Styles.Content = cxStyle69 + Styles.Inactive = cxStyle71 + Styles.Selection = cxStyle72 + Styles.Category = cxStyle68 + Styles.Header = cxStyle70 + BuiltIn = True + end + object cxVerticalGridStyleSheetSlate: TcxVerticalGridStyleSheet + Caption = 'Slate' + Styles.Background = cxStyle73 + Styles.Content = cxStyle75 + Styles.Inactive = cxStyle77 + Styles.Selection = cxStyle78 + Styles.Category = cxStyle74 + Styles.Header = cxStyle76 + BuiltIn = True + end + object cxVerticalGridStyleSheetSpruce: TcxVerticalGridStyleSheet + Caption = 'Spruce' + Styles.Background = cxStyle79 + Styles.Content = cxStyle81 + Styles.Inactive = cxStyle83 + Styles.Selection = cxStyle84 + Styles.Category = cxStyle80 + Styles.Header = cxStyle82 + BuiltIn = True + end + object cxVerticalGridStyleSheetStormVGA: TcxVerticalGridStyleSheet + Caption = 'Storm (VGA)' + Styles.Background = cxStyle85 + Styles.Content = cxStyle87 + Styles.Inactive = cxStyle89 + Styles.Selection = cxStyle90 + Styles.Category = cxStyle86 + Styles.Header = cxStyle88 + BuiltIn = True + end + object cxVerticalGridStyleSheetTealVGA: TcxVerticalGridStyleSheet + Caption = 'Teal (VGA)' + Styles.Background = cxStyle91 + Styles.Content = cxStyle93 + Styles.Inactive = cxStyle95 + Styles.Selection = cxStyle96 + Styles.Category = cxStyle92 + Styles.Header = cxStyle94 + BuiltIn = True + end + object cxVerticalGridStyleSheetWheat: TcxVerticalGridStyleSheet + Caption = 'Wheat' + Styles.Background = cxStyle97 + Styles.Content = cxStyle99 + Styles.Inactive = cxStyle101 + Styles.Selection = cxStyle102 + Styles.Category = cxStyle98 + Styles.Header = cxStyle100 + BuiltIn = True + end + object cxVerticalGridStyleSheetWindowsClassic: TcxVerticalGridStyleSheet + Caption = 'Windows Classic' + Styles.Background = cxStyle231 + Styles.Content = cxStyle104 + Styles.Inactive = cxStyle106 + Styles.Selection = cxStyle107 + Styles.Category = cxStyle103 + Styles.Header = cxStyle105 + BuiltIn = True + end + object cxVerticalGridStyleSheetWindowsClassicLarge: TcxVerticalGridStyleSheet + Caption = 'Windows Classic (large)' + Styles.Background = cxStyle232 + Styles.Content = cxStyle109 + Styles.Inactive = cxStyle111 + Styles.Selection = cxStyle112 + Styles.Category = cxStyle108 + Styles.Header = cxStyle110 + BuiltIn = True + end + object cxVerticalGridStyleSheetWindowsStandard: TcxVerticalGridStyleSheet + Caption = 'Windows Standard' + Styles.Background = cxStyle233 + Styles.Content = cxStyle114 + Styles.Inactive = cxStyle116 + Styles.Selection = cxStyle117 + Styles.Category = cxStyle113 + Styles.Header = cxStyle115 + BuiltIn = True + end + object cxVerticalGridStyleSheetWindowsStandardLarge: TcxVerticalGridStyleSheet + Caption = 'Windows Standard (large)' + Styles.Background = cxStyle234 + Styles.Content = cxStyle119 + Styles.Inactive = cxStyle121 + Styles.Selection = cxStyle122 + Styles.Category = cxStyle118 + Styles.Header = cxStyle120 + BuiltIn = True + end + object cxVerticalGridStyleSheetHighContrast1: TcxVerticalGridStyleSheet + Caption = 'High Contrast #1' + Styles.Background = cxStyle123 + Styles.Content = cxStyle125 + Styles.Inactive = cxStyle127 + Styles.Selection = cxStyle128 + Styles.Category = cxStyle124 + Styles.Header = cxStyle126 + BuiltIn = True + end + object cxVerticalGridStyleSheetHighContrast1Large: TcxVerticalGridStyleSheet + Caption = 'High Contrast #1 (large)' + Styles.Background = cxStyle129 + Styles.Content = cxStyle131 + Styles.Inactive = cxStyle133 + Styles.Selection = cxStyle134 + Styles.Category = cxStyle130 + Styles.Header = cxStyle132 + BuiltIn = True + end + object cxVerticalGridStyleSheetHighContrast2: TcxVerticalGridStyleSheet + Caption = 'High Contrast #2' + Styles.Background = cxStyle230 + Styles.Content = cxStyle136 + Styles.Inactive = cxStyle138 + Styles.Selection = cxStyle139 + Styles.Category = cxStyle135 + Styles.Header = cxStyle137 + BuiltIn = True + end + object cxVerticalGridStyleSheetHighContrast2Large: TcxVerticalGridStyleSheet + Caption = 'High Contrast #2 (large)' + Styles.Background = cxStyle229 + Styles.Content = cxStyle141 + Styles.Inactive = cxStyle143 + Styles.Selection = cxStyle144 + Styles.Category = cxStyle140 + Styles.Header = cxStyle142 + BuiltIn = True + end + object cxVerticalGridStyleSheetHighContrastBlack: TcxVerticalGridStyleSheet + Caption = 'High Contrast Black' + Styles.Background = cxStyle145 + Styles.Content = cxStyle147 + Styles.Inactive = cxStyle149 + Styles.Selection = cxStyle150 + Styles.Category = cxStyle146 + Styles.Header = cxStyle148 + BuiltIn = True + end + object cxVerticalGridStyleSheetHighContrastBlackLarge: TcxVerticalGridStyleSheet + Caption = 'High Contrast Black (large)' + Styles.Background = cxStyle151 + Styles.Content = cxStyle153 + Styles.Inactive = cxStyle155 + Styles.Selection = cxStyle156 + Styles.Category = cxStyle152 + Styles.Header = cxStyle154 + BuiltIn = True + end + object cxVerticalGridStyleSheetHighContrastWhite: TcxVerticalGridStyleSheet + Caption = 'High Contrast White' + Styles.Background = cxStyle228 + Styles.Content = cxStyle158 + Styles.Inactive = cxStyle160 + Styles.Selection = cxStyle161 + Styles.Category = cxStyle157 + Styles.Header = cxStyle159 + BuiltIn = True + end + object cxVerticalGridStyleSheetHighContrastWhiteLarge: TcxVerticalGridStyleSheet + Caption = 'High Contrast White (large)' + Styles.Background = cxStyle227 + Styles.Content = cxStyle163 + Styles.Inactive = cxStyle165 + Styles.Selection = cxStyle166 + Styles.Category = cxStyle162 + Styles.Header = cxStyle164 + BuiltIn = True + end + end +end diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxVGridPredefinedStyles.pas b/official/x.35/ExpressVerticalGrid/Sources/cxVGridPredefinedStyles.pas new file mode 100644 index 00000000..e5180072 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxVGridPredefinedStyles.pas @@ -0,0 +1,360 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressVerticalGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSVERTICALGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxVGridPredefinedStyles; + +interface + +uses +{$IFNDEF DELPHI6} + Forms, +{$ENDIF} + SysUtils, Classes, cxStyles, cxVGrid, cxClasses; + +type + TcxdmVerticalGridPredefinedStyles = class(TDataModule) + StyleRepository: TcxStyleRepository; + cxStyle1: TcxStyle; + cxStyle2: TcxStyle; + cxStyle3: TcxStyle; + cxStyle4: TcxStyle; + cxStyle5: TcxStyle; + cxStyle6: TcxStyle; + cxStyle7: TcxStyle; + cxStyle8: TcxStyle; + cxStyle9: TcxStyle; + cxStyle10: TcxStyle; + cxStyle11: TcxStyle; + cxStyle12: TcxStyle; + cxStyle13: TcxStyle; + cxStyle14: TcxStyle; + cxStyle15: TcxStyle; + cxStyle16: TcxStyle; + cxStyle17: TcxStyle; + cxStyle18: TcxStyle; + cxStyle19: TcxStyle; + cxStyle20: TcxStyle; + cxStyle21: TcxStyle; + cxStyle22: TcxStyle; + cxStyle23: TcxStyle; + cxStyle24: TcxStyle; + cxStyle25: TcxStyle; + cxStyle26: TcxStyle; + cxStyle27: TcxStyle; + cxStyle28: TcxStyle; + cxStyle29: TcxStyle; + cxStyle30: TcxStyle; + cxStyle31: TcxStyle; + cxStyle32: TcxStyle; + cxStyle33: TcxStyle; + cxStyle34: TcxStyle; + cxStyle35: TcxStyle; + cxStyle36: TcxStyle; + cxStyle37: TcxStyle; + cxStyle38: TcxStyle; + cxStyle39: TcxStyle; + cxStyle40: TcxStyle; + cxStyle41: TcxStyle; + cxStyle42: TcxStyle; + cxStyle43: TcxStyle; + cxStyle44: TcxStyle; + cxStyle45: TcxStyle; + cxStyle46: TcxStyle; + cxStyle47: TcxStyle; + cxStyle48: TcxStyle; + cxStyle49: TcxStyle; + cxStyle50: TcxStyle; + cxStyle51: TcxStyle; + cxStyle52: TcxStyle; + cxStyle53: TcxStyle; + cxStyle54: TcxStyle; + cxStyle55: TcxStyle; + cxStyle56: TcxStyle; + cxStyle57: TcxStyle; + cxStyle58: TcxStyle; + cxStyle59: TcxStyle; + cxStyle60: TcxStyle; + cxStyle61: TcxStyle; + cxStyle62: TcxStyle; + cxStyle63: TcxStyle; + cxStyle64: TcxStyle; + cxStyle65: TcxStyle; + cxStyle66: TcxStyle; + cxStyle67: TcxStyle; + cxStyle68: TcxStyle; + cxStyle69: TcxStyle; + cxStyle70: TcxStyle; + cxStyle71: TcxStyle; + cxStyle72: TcxStyle; + cxStyle73: TcxStyle; + cxStyle74: TcxStyle; + cxStyle75: TcxStyle; + cxStyle76: TcxStyle; + cxStyle77: TcxStyle; + cxStyle78: TcxStyle; + cxStyle79: TcxStyle; + cxStyle80: TcxStyle; + cxStyle81: TcxStyle; + cxStyle82: TcxStyle; + cxStyle83: TcxStyle; + cxStyle84: TcxStyle; + cxStyle85: TcxStyle; + cxStyle86: TcxStyle; + cxStyle87: TcxStyle; + cxStyle88: TcxStyle; + cxStyle89: TcxStyle; + cxStyle90: TcxStyle; + cxStyle91: TcxStyle; + cxStyle92: TcxStyle; + cxStyle93: TcxStyle; + cxStyle94: TcxStyle; + cxStyle95: TcxStyle; + cxStyle96: TcxStyle; + cxStyle97: TcxStyle; + cxStyle98: TcxStyle; + cxStyle99: TcxStyle; + cxStyle100: TcxStyle; + cxStyle101: TcxStyle; + cxStyle102: TcxStyle; + cxStyle103: TcxStyle; + cxStyle104: TcxStyle; + cxStyle105: TcxStyle; + cxStyle106: TcxStyle; + cxStyle107: TcxStyle; + cxStyle108: TcxStyle; + cxStyle109: TcxStyle; + cxStyle110: TcxStyle; + cxStyle111: TcxStyle; + cxStyle112: TcxStyle; + cxStyle113: TcxStyle; + cxStyle114: TcxStyle; + cxStyle115: TcxStyle; + cxStyle116: TcxStyle; + cxStyle117: TcxStyle; + cxStyle118: TcxStyle; + cxStyle119: TcxStyle; + cxStyle120: TcxStyle; + cxStyle121: TcxStyle; + cxStyle122: TcxStyle; + cxStyle123: TcxStyle; + cxStyle124: TcxStyle; + cxStyle125: TcxStyle; + cxStyle126: TcxStyle; + cxStyle127: TcxStyle; + cxStyle128: TcxStyle; + cxStyle129: TcxStyle; + cxStyle130: TcxStyle; + cxStyle131: TcxStyle; + cxStyle132: TcxStyle; + cxStyle133: TcxStyle; + cxStyle134: TcxStyle; + cxStyle135: TcxStyle; + cxStyle136: TcxStyle; + cxStyle137: TcxStyle; + cxStyle138: TcxStyle; + cxStyle139: TcxStyle; + cxStyle140: TcxStyle; + cxStyle141: TcxStyle; + cxStyle142: TcxStyle; + cxStyle143: TcxStyle; + cxStyle144: TcxStyle; + cxStyle145: TcxStyle; + cxStyle146: TcxStyle; + cxStyle147: TcxStyle; + cxStyle148: TcxStyle; + cxStyle149: TcxStyle; + cxStyle150: TcxStyle; + cxStyle151: TcxStyle; + cxStyle152: TcxStyle; + cxStyle153: TcxStyle; + cxStyle154: TcxStyle; + cxStyle155: TcxStyle; + cxStyle156: TcxStyle; + cxStyle157: TcxStyle; + cxStyle158: TcxStyle; + cxStyle159: TcxStyle; + cxStyle160: TcxStyle; + cxStyle161: TcxStyle; + cxStyle162: TcxStyle; + cxStyle163: TcxStyle; + cxStyle164: TcxStyle; + cxStyle165: TcxStyle; + cxStyle166: TcxStyle; + cxVerticalGridStyleSheetBrick: TcxVerticalGridStyleSheet; + cxVerticalGridStyleDesert: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetEggplant: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetLilac: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetMaple: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetMarineHighColor: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetPlumHighColor: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetPumpkinLarge: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetRainyDay: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetRedWhiteAndBlueVGA: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetRose: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetRoseLarge: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetSlate: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetSpruce: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetStormVGA: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetTealVGA: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetWheat: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetWindowsClassic: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetWindowsClassicLarge: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetWindowsStandard: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetWindowsStandardLarge: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetHighContrast1: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetHighContrast1Large: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetHighContrast2: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetHighContrast2Large: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetHighContrastBlack: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetHighContrastBlackLarge: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetHighContrastWhite: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetHighContrastWhiteLarge: TcxVerticalGridStyleSheet; + cxStyle167: TcxStyle; + cxStyle168: TcxStyle; + cxStyle169: TcxStyle; + cxStyle170: TcxStyle; + cxStyle171: TcxStyle; + cxStyle172: TcxStyle; + cxStyle173: TcxStyle; + cxStyle174: TcxStyle; + cxStyle175: TcxStyle; + cxStyle176: TcxStyle; + cxStyle177: TcxStyle; + cxStyle178: TcxStyle; + cxStyle179: TcxStyle; + cxStyle180: TcxStyle; + cxStyle181: TcxStyle; + cxStyle182: TcxStyle; + cxStyle183: TcxStyle; + cxStyle184: TcxStyle; + cxStyle185: TcxStyle; + cxStyle186: TcxStyle; + cxStyle187: TcxStyle; + cxStyle188: TcxStyle; + cxStyle189: TcxStyle; + cxStyle190: TcxStyle; + cxStyle191: TcxStyle; + cxStyle192: TcxStyle; + cxStyle193: TcxStyle; + cxStyle194: TcxStyle; + cxStyle195: TcxStyle; + cxStyle196: TcxStyle; + cxStyle197: TcxStyle; + cxStyle198: TcxStyle; + cxStyle199: TcxStyle; + cxStyle200: TcxStyle; + cxStyle201: TcxStyle; + cxStyle202: TcxStyle; + cxStyle203: TcxStyle; + cxStyle204: TcxStyle; + cxStyle205: TcxStyle; + cxStyle206: TcxStyle; + cxStyle207: TcxStyle; + cxStyle208: TcxStyle; + cxStyle209: TcxStyle; + cxStyle210: TcxStyle; + cxStyle211: TcxStyle; + cxStyle212: TcxStyle; + cxVerticalGridStyleSheetUserFormat4: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetUserFormat1: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetUserFormat2: TcxVerticalGridStyleSheet; + cxVerticalGridStyleSheetUserFormat3: TcxVerticalGridStyleSheet; + cxStyle213: TcxStyle; + cxStyle214: TcxStyle; + cxStyle215: TcxStyle; + cxStyle216: TcxStyle; + cxStyle217: TcxStyle; + cxStyle218: TcxStyle; + cxStyle219: TcxStyle; + cxVerticalGridStyleSheetDevExpress: TcxVerticalGridStyleSheet; + cxStyle220: TcxStyle; + cxStyle221: TcxStyle; + cxStyle222: TcxStyle; + cxStyle223: TcxStyle; + cxStyle224: TcxStyle; + cxStyle225: TcxStyle; + cxStyle226: TcxStyle; + end; + +var + cxdmVerticalGridPredefinedStyles: TcxdmVerticalGridPredefinedStyles; + +implementation + +{$R *.dfm} + +uses + cxStyleSheetsLoad, Dialogs; + +type + TcxVerticalGridPredefinedStyleSheets = class(TcxPredefinedStyleSheets) + private + FData: TcxdmVerticalGridPredefinedStyles; + protected + procedure AddStyleSheets; override; + public + constructor Create; override; + destructor Destroy; override; + end; + +{ TcxVerticalGridPredefinedStyleSheets } + +constructor TcxVerticalGridPredefinedStyleSheets.Create; +begin + inherited Create; + FData := TcxdmVerticalGridPredefinedStyles.Create(nil); + AddStyleSheets; +end; + +destructor TcxVerticalGridPredefinedStyleSheets.Destroy; +begin + FData.Free; + inherited Destroy; +end; + +procedure TcxVerticalGridPredefinedStyleSheets.AddStyleSheets; +var + I: Integer; +begin + with FData.StyleRepository do + for I := 0 to StyleSheetCount - 1 do + AddStyleSheet(StyleSheets[I]); +end; + +initialization + RegisterPredefinedStyleSheets(TcxVerticalGridPredefinedStyleSheets); + +finalization + UnregisterPredefinedStyleSheets(TcxVerticalGridPredefinedStyleSheets); + +end. diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxVGridReg.dcr b/official/x.35/ExpressVerticalGrid/Sources/cxVGridReg.dcr new file mode 100644 index 00000000..e209e582 Binary files /dev/null and b/official/x.35/ExpressVerticalGrid/Sources/cxVGridReg.dcr differ diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxVGridReg.pas b/official/x.35/ExpressVerticalGrid/Sources/cxVGridReg.pas new file mode 100644 index 00000000..d5ac2585 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxVGridReg.pas @@ -0,0 +1,473 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressVerticalGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSVERTICALGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxVGridReg; + +{$I cxVer.inc} + +interface + +procedure Register; + +implementation + +uses +{$IFDEF DELPHI6} + DesignEditors, DesignIntf, + VCLEditors, +{$ELSE} + DsgnIntf, +{$ENDIF} + Classes, Controls, ImgList, cxScrollBar, cxVGrid, cxEdit, cxStyles, + cxEditRepositoryItems, cxEditPropEditors, cxVGridEditor, cxClasses, + cxInplaceContainerReg, cxPropEditors, DB, cxDBVGrid, cxOI, SysUtils, Forms, + cxVGridPredefinedStyles, cxVGridLayoutEditor, TypInfo, + cxVGridConverter, cxImportDialog, cxLibraryReg; + +const + cxVGridMajorVersion = '3'; + cxVGridProductName = 'ExpressVerticalGrid'; + UnitNamePrefix = ''; + +type + TcxCustomRowAccess = class(TcxCustomRow); + + { TcxVerticalGridStylesEventsProperty } + + TcxVerticalGridStylesEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + + { TcxEditorRowPropertiesEventsProperty } + + TcxEditorRowPropertiesEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + + { TcxEditPropertiesEventsProperty } + + TcxEditPropertiesEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + + { TcxCollectionItemEditPropertiesEventsProperty } + + TcxCollectionItemEditPropertiesEventsProperty = class(TcxNestedEventProperty) + protected + function GetInstance: TPersistent; override; + end; + + { TcxCustomRowImageIndexProperty } + + TcxCustomRowPropertiesImageIndexProperty = class(TImageIndexProperty) + public + function GetImages: TCustomImageList; override; + end; + + { TcxCustomVerticalGridComponentEditor } + + TcxCustomVerticalGridComponentEditor = class(TcxComponentEditor) + protected + function GetProductMajorVersion: string; override; + function GetProductName: string; override; + end; + + { TcxVerticalGridComponentEditor } + + TcxVerticalGridComponentEditor = class(TcxCustomVerticalGridComponentEditor) + private + function GetVerticalGrid: TcxCustomVerticalGrid; + protected + function InternalGetVerb(AIndex: Integer): string; override; + function InternalGetVerbCount: Integer; override; + procedure InternalExecuteVerb(AIndex: Integer); override; + public + property VerticalGrid: TcxCustomVerticalGrid read GetVerticalGrid; + end; + + { TcxRTTIInspectorComponentEditor } + + TcxRTTIInspectorComponentEditor = class(TcxCustomVerticalGridComponentEditor) + private + function GetInspector: TcxCustomRTTIInspector; + protected + function InternalGetVerb(AIndex: Integer): string; override; + function InternalGetVerbCount: Integer; override; + procedure InternalExecuteVerb(AIndex: Integer); override; + public + property Inspector: TcxCustomRTTIInspector read GetInspector; + end; + + { TcxDBVerticalGridItemDataBindingFieldNameProperty } + + TcxDBVerticalGridItemDataBindingFieldNameProperty = class(TFieldNameProperty) + public + function GetDataSource: TDataSource; override; + end; + + { TcxOIPropertyEditor } + + TcxOIPropertyEditor = class(TPropertyEditor) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + function GetValue: string; override; + procedure SetValue(const Value: string); override; + end; + +{ TcxVerticalGridStylesEventsProperty } + +function TcxVerticalGridStylesEventsProperty.GetInstance: TPersistent; +begin + if (GetComponent(0) is TcxCustomVerticalGrid) then + Result := TcxCustomVerticalGrid(GetComponent(0)).Styles + else + Result := nil; +end; + +{ TcxEditorRowPropertiesEventsProperty } + +function TcxEditorRowPropertiesEventsProperty.GetInstance: TPersistent; +begin + if (GetComponent(0) is TcxCustomEditorRow) then + Result := TcxCustomRowAccess(GetComponent(0)).FProperties + else + Result := nil; +end; + +{ TcxEditPropertiesEventsProperty } + +function TcxEditPropertiesEventsProperty.GetInstance: TPersistent; +begin + if (GetComponent(0) is TcxCustomEditorRow) then + Result := TcxCustomEditorRowProperties(TcxCustomRowAccess(GetComponent(0)).FProperties).EditProperties + else + Result := nil; +end; + +{ TcxCollectionItemEditPropertiesEventsProperty } + +function TcxCollectionItemEditPropertiesEventsProperty.GetInstance: TPersistent; +begin + if (GetComponent(0) is TcxCollectionItemEditorRowProperties) then + Result := TcxCollectionItemEditorRowProperties(GetComponent(0)).EditProperties + else + Result := nil; +end; + +{ TcxCustomRowImageIndexProperty } + +function TcxCustomRowPropertiesImageIndexProperty.GetImages: TCustomImageList; +begin + if GetComponent(0) is TcxCustomRowProperties then + Result := TcxCustomRowProperties(GetComponent(0)).Row.VerticalGrid.Images + else + Result := nil; +end; + +{ TcxCustomVerticalGridComponentEditor } + +function TcxCustomVerticalGridComponentEditor.GetProductMajorVersion: string; +begin + Result := cxVGridMajorVersion; +end; + +function TcxCustomVerticalGridComponentEditor.GetProductName: string; +begin + Result := cxVGridProductName; +end; + +{ TcxVerticalGridComponentEditor } + +function TcxVerticalGridComponentEditor.InternalGetVerb(AIndex: Integer): string; +begin + case AIndex of + 0: Result := 'Edit...'; + 1: Result := 'Layout editor...'; + 2: Result := 'Import...'; + 3: Result := 'Restore default values'; + end; +end; + +function TcxVerticalGridComponentEditor.InternalGetVerbCount: Integer; +begin + Result := 4; +end; + +procedure TcxVerticalGridComponentEditor.InternalExecuteVerb(AIndex: Integer); +begin + case AIndex of + 0: ShowVerticalGridEditor(Designer, VerticalGrid); + 1: ShowVerticalGridLayoutEditor(VerticalGrid, + Format('Layout editor - %s', [VerticalGrid.Name])); + 2: if Component is TcxDBVerticalGrid then + ShowImportDialog(Designer, Component, cxDBVGGroupConverterName, False) + else if Component is TcxUnboundVerticalGrid then + ShowImportDialog(Designer, Component, cxVGGroupConverterName, False); + 3: VerticalGrid.RestoreDefaults; + end; +end; + +function TcxVerticalGridComponentEditor.GetVerticalGrid: TcxCustomVerticalGrid; +begin + Result := Component as TcxCustomVerticalGrid; +end; + +{ TcxRTTIInspectorComponentEditor } + +function TcxRTTIInspectorComponentEditor.InternalGetVerb(AIndex: Integer): string; +begin + case AIndex of + 0: Result := 'Import...'; + 1: Result := 'Restore default values'; + end; +end; + +function TcxRTTIInspectorComponentEditor.InternalGetVerbCount: Integer; +begin + Result := 2; +end; + +procedure TcxRTTIInspectorComponentEditor.InternalExecuteVerb(AIndex: Integer); +begin + case AIndex of + 0: ShowImportDialog(Designer, Inspector, cxRTTIVGGroupConverterName, False); + 1: Inspector.RestoreDefaults; + end; +end; + +function TcxRTTIInspectorComponentEditor.GetInspector: TcxCustomRTTIInspector; +begin + Result := Component as TcxCustomRTTIInspector; +end; + +{ TcxDBVerticalGridItemDataBindingFieldNameProperty } + +function TcxDBVerticalGridItemDataBindingFieldNameProperty.GetDataSource: TDataSource; +begin + Result := TcxDBVerticalGridItemDataBinding(GetComponent(0)).DataController.DataSource; +end; + +{ TcxOIPropertyEditor } + +function TcxOIPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList]; +end; + +procedure TcxOIPropertyEditor.GetValues(Proc: TGetStrProc); + + function IsValidComponent(AComponent: TComponent): Boolean; + begin + Result := (AComponent.Name <> '') and + IsValidInspectedObject(AComponent, GetComponent(0) as TcxCustomRTTIInspector); + end; + + procedure FillList(AComponent: TComponent); + var + I: Integer; + begin + if IsValidComponent(AComponent) then + Proc(AComponent.Name); + for i := 0 to AComponent.ComponentCount - 1 do + FillList(AComponent.Components[I]); + end; + +begin + FillList(Designer.GetRoot); +end; + +function TcxOIPropertyEditor.GetValue: string; +var + OI: TcxCustomRTTIInspector; +begin + Result := ''; + OI := TcxCustomRTTIInspector(GetComponent(0)); + if OI.InspectedObject <> nil then + begin + if OI.InspectedObject is TComponent then + Result := OI.InspectedObject.GetNamePath; + end; +end; + +procedure TcxOIPropertyEditor.SetValue(const Value: string); + + function GetValueComponent: TComponent; + begin + if CompareText(Value, Designer.GetRoot.Name) = 0 then + Result := Designer.GetRoot + else Result := Designer.GetRoot.FindComponent(Value); + if Result = nil then + Result := Application.FindComponent(Value); + if Result = GetComponent(0) then + Result := nil; + end; + +var + OI: TcxCustomRTTIInspector; +begin + OI := TcxCustomRTTIInspector(GetComponent(0)); + if Value = '' then + OI.InspectedObject := nil + else + begin + if GetValueComponent <> nil then + OI.InspectedObject := GetValueComponent; + end; + Modified; +end; + +{$IFDEF DELPHI6} +type + TcxVerticalGridSelectionEditor = class(TSelectionEditor) + protected + ComponentsList: TStringList; + public + procedure AddComponent(const Name: string); + procedure RequiresUnits(Proc: TGetStrProc); override; + end; + +procedure TcxVerticalGridSelectionEditor.RequiresUnits(Proc: TGetStrProc); + + procedure AddPropertiesUnitName(AProperties: TcxCustomEditProperties); + begin + if AProperties <> nil then + Proc(GetTypeData(PTypeinfo(AProperties.ClassType.ClassInfo))^.UnitName); + end; + + procedure CheckRow(ARow: TcxCustomRow); + var + AProperties: TcxCustomRowProperties; + I: Integer; + begin + AProperties := TcxCustomRowAccess(ARow).FProperties; + if AProperties is TcxCustomEditorRowProperties then + with TcxCustomEditorRowProperties(AProperties) do + AddPropertiesUnitName(EditProperties) + else + if AProperties is TcxDBMultiEditorRowProperties then + with TcxDBMultiEditorRowProperties(AProperties) do + for I := 0 to Editors.Count - 1 do + AddPropertiesUnitName(Editors[I].EditProperties) + else + if AProperties is TcxMultiEditorRowProperties then + with TcxMultiEditorRowProperties(AProperties) do + for I := 0 to Editors.Count - 1 do + AddPropertiesUnitName(Editors[I].EditProperties) + end; + +var + AComponent: TComponent; + I, J: Integer; +begin + Proc(UnitNamePrefix + 'cxStyles'); + Proc(UnitNamePrefix + 'cxGraphics'); + Proc(UnitNamePrefix + 'cxEdit'); + ComponentsList := TStringList.Create; + try + Designer.GetComponentNames(GetTypeData(PTypeInfo(TcxCustomVerticalGrid.ClassInfo)), AddComponent); + for I := 0 to ComponentsList.Count - 1 do + begin + AComponent := Designer.GetComponent(ComponentsList[I]); + if AComponent is TcxCustomVerticalGrid then + with TcxCustomVerticalGrid(AComponent) do + for J := 0 to Rows.Count - 1 do CheckRow(Rows[J]); + end; + finally + ComponentsList.Free; + end; +end; + +procedure TcxVerticalGridSelectionEditor.AddComponent(const Name: string); +begin + ComponentsList.Add(Name); +end; +{$ENDIF} + +procedure Register; +begin +{$IFDEF DELPHI9} + ForceDemandLoadState(dlDisable); +{$ENDIF} + + RegisterComponents('Dev Express', [TcxVerticalGrid, + TcxVirtualVerticalGrid, TcxDBVerticalGrid, TcxRTTIInspector]); + //rows + RegisterClasses([TcxCustomVerticalGrid, TcxCategoryRow, TcxEditorRow, + TcxMultiEditorRow, TcxVerticalGridStyleSheet]); + RegisterNoIcon([TcxCategoryRow, TcxEditorRow, TcxMultiEditorRow, + TcxVerticalGridStyleSheet]); + //row properties + RegisterClasses([TcxCaptionRowProperties, TcxEditorRowProperties, + TcxMultiEditorRowProperties]); + RegisterPropertyEditor(TypeInfo(string), TcxCustomEditorRowProperties, 'EditPropertiesClassName', nil); + RegisterPropertyEditor(TypeInfo(TcxCustomEditProperties), TcxCustomEditorRowProperties, 'EditProperties', TcxInplaceEditContainerPropertiesProperty); + RegisterPropertyEditor(TypeInfo(TImageIndex), TcxCustomRowProperties, 'ImageIndex', TcxCustomRowPropertiesImageIndexProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomVerticalGrid, + 'StylesEvents', TcxVerticalGridStylesEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomEditorRow, + 'PropertiesEvents', TcxEditorRowPropertiesEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCustomEditorRow, + 'EditPropertiesEvents', TcxEditPropertiesEventsProperty); + RegisterPropertyEditor(TypeInfo(TNotifyEvent), TcxCollectionItemEditorRowProperties, + 'EditPropertiesEvents', TcxCollectionItemEditPropertiesEventsProperty); + + RegisterComponentEditor(TcxVerticalGrid, TcxVerticalGridComponentEditor); + RegisterComponentEditor(TcxVirtualVerticalGrid, TcxVerticalGridComponentEditor); + RegisterPropertyEditor(TypeInfo(string), TcxDBVerticalGridItemDataBinding, 'FieldName', TcxDBVerticalGridItemDataBindingFieldNameProperty); + RegisterPropertyEditor(TypeInfo(string), TcxDBVerticalGridItemDataBinding, 'FieldName', TcxDBVerticalGridItemDataBindingFieldNameProperty); + //DB + RegisterClasses([TcxDBEditorRow, TcxDBMultiEditorRow]); + RegisterNoIcon([TcxDBEditorRow, TcxDBMultiEditorRow]); + RegisterClasses([TcxDBEditorRowProperties, TcxDBMultiEditorRowProperties]); + RegisterComponentEditor(TcxDBVerticalGrid, TcxVerticalGridComponentEditor); + RegisterPropertyEditor(TypeInfo(string), TcxDBVerticalGridItemDataBinding, 'FieldName', TcxDBVerticalGridItemDataBindingFieldNameProperty); + //RTTI + RegisterComponentEditor(TcxCustomRTTIInspector, TcxRTTIInspectorComponentEditor); + RegisterPropertyEditor(TypeInfo(TPersistent), TcxCustomRTTIInspector, 'InspectedObject', + TcxOIPropertyEditor); +{$IFDEF DELPHI6} + RegisterSelectionEditor(TcxCustomVerticalGrid, TcxVerticalGridSelectionEditor); +{$ENDIF} +end; + +initialization + RegisterStyleSheetClass(TcxVerticalGridStyleSheet); + +finalization + UnRegisterStyleSheetClass(TcxVerticalGridStyleSheet); + +end. diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxVGridStyleSheetPreview.pas b/official/x.35/ExpressVerticalGrid/Sources/cxVGridStyleSheetPreview.pas new file mode 100644 index 00000000..992b4fb0 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxVGridStyleSheetPreview.pas @@ -0,0 +1,157 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressVerticalGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSVERTICALGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxVGridStyleSheetPreview; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, + Classes, Controls, SysUtils, cxStyles, cxVGrid; + +resourcestring + cxTextDescription = 'ABC'; + cxPreviewDescription = 'Check the preview style'; + +implementation + +uses + cxStyleSheetEditor, cxClasses; + +type + TcxVerticalGridStyleSheetEditorPreview = class(TcxStyleSheetEditorPreview) + private + FVerticalGrid: TcxCustomVerticalGrid; + protected + procedure CreateData; + procedure SetOptions; + property VerticalGrid: TcxCustomVerticalGrid read FVerticalGrid; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function Control: TWinControl; override; + class function GetStyleSheetClass: TcxCustomStyleSheetClass; override; + procedure SetStyleSheet(AStyleSheet: TcxCustomStyleSheet); override; + end; + +{ TcxVerticalGridStyleSheetEditorPreview } + +constructor TcxVerticalGridStyleSheetEditorPreview.Create(AOwner: TComponent); +begin + FVerticalGrid := TcxVerticalGrid.Create(AOwner); + CreateData; +end; + +destructor TcxVerticalGridStyleSheetEditorPreview.Destroy; +begin + FVerticalGrid.Free; + inherited Destroy; +end; + +function TcxVerticalGridStyleSheetEditorPreview.Control: TWinControl; +begin + Result := FVerticalGrid; +end; + +class function TcxVerticalGridStyleSheetEditorPreview.GetStyleSheetClass: TcxCustomStyleSheetClass; +begin + Result := TcxVerticalGridStyleSheet; +end; + +procedure TcxVerticalGridStyleSheetEditorPreview.SetStyleSheet( + AStyleSheet: TcxCustomStyleSheet); +begin + VerticalGrid.Styles.StyleSheet := AStyleSheet; +end; + +procedure TcxVerticalGridStyleSheetEditorPreview.CreateData; +const + Captions: array[0..3] of string = ('Text edit', 'Currency edit', + 'Spin edit', 'Date edit'); + ValueTypes: array[0..3] of string = ('String', 'Currency', 'Integer', 'Date'); + +var + ACategoryRow: TcxCategoryRow; + AEditorRow: TcxEditorRow; + I: Integer; +begin + VerticalGrid.BeginUpdate; + try + VerticalGrid.OptionsView.RowHeaderWidth := 150; + ACategoryRow := TcxCategoryRow(VerticalGrid.Add(TcxCategoryRow)); + with ACategoryRow do + begin + Properties.HeaderAlignmentVert := vaCenter; + Properties.Caption := 'Category Row' + end; + for I := 0 to 3 do + begin + AEditorRow := TcxEditorRow(VerticalGrid.AddChild(ACategoryRow, TcxEditorRow)); + with AEditorRow do + begin + Properties.HeaderAlignmentVert := vaCenter; + Properties.Caption := Captions[I]; + Properties.DataBinding.ValueType := ValueTypes[I]; + case I of + 0: Properties.Value := 'Some string'; + 1: Properties.Value := 123456789; + 2: Properties.Value := 999; + 3: Properties.Value := Date; + end; + end; + end; + SetOptions; + finally + VerticalGrid.EndUpdate; + end; +end; + +procedure TcxVerticalGridStyleSheetEditorPreview.SetOptions; +begin + with VerticalGrid.OptionsView do + begin + end; + VerticalGrid.OptionsData.Editing := False; +//todo: +// VerticalGrid.OptionsBehavior.IncSearch := True; +end; + +initialization + RegisterStyleSheetEditorPreview(TcxVerticalGridStyleSheetEditorPreview); + +finalization + UnregisterStyleSheetEditorPreview(TcxVerticalGridStyleSheetEditorPreview); + +end. diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxVGridUtils.pas b/official/x.35/ExpressVerticalGrid/Sources/cxVGridUtils.pas new file mode 100644 index 00000000..81d70df5 --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxVGridUtils.pas @@ -0,0 +1,554 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressVerticalGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSVERTICALGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxVGridUtils; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Windows, Classes, Graphics, cxGraphics, cxStyles; + +type + { TcxDataList } + + TcxDataList = class + private + FAllocated: Integer; + FData: Pointer; + FDelta: Integer; + FRecordSize: Integer; + protected + FCount: Integer; + procedure CheckCapacity; + function Get(Index: Integer): Pointer; + property Data: Pointer read FData; + property RecordSize: Integer read FRecordSize; + public + constructor Create(ARecordSize: Integer); + destructor Destroy; override; + procedure Clear; + property Count: Integer read FCount; + property Delta: Integer read FDelta write FDelta; + end; + + { TcxRectList } + + TcxRectList = class(TcxDataList) + private + function GetRect(Index: Integer): TRect; + procedure SetRect(Index: Integer; const Value: TRect); + public + constructor Create; + procedure Assign(Source: TcxRectList); + function Add(const R: TRect): Integer; + property Rects[Index: Integer]: TRect read GetRect write SetRect; default; + end; + + { TRectScaler } + + PScaleParams = ^TScaleParams; + TScaleParams = record + Width: Integer; + MinWidth: Integer; + FixedWidth: Integer; + end; + + TRectScaler = class(TList) + private + FScaledRects: TcxRectList; + function GetSummaryParam: TScaleParams; + public + constructor Create; + destructor Destroy; override; + procedure Add(AWidth: Integer); overload; + procedure Add(AWidth, AMinWidth: Integer); overload; + procedure Add(AWidth, AMinWidth, AFixedWidth: Integer); overload; + procedure Clear; override; + procedure CalcRect(const Rect: TRect); + procedure ScaleRect(const Rect: TRect); + property ScaledRects: TcxRectList read FScaledRects; + property SummaryParam: TScaleParams read GetSummaryParam; + end; + + { TLineInfo } + + PLineInfo = ^TLineInfo; + TLineInfo = record + Rect: TRect; + IsBrush: Boolean; + case Boolean of + False: (Color: TColor); + True: (Brush: TBrush); + end; + + { TLineInfoList } + + TLineInfoList = class(TcxDataList) + private + FLocked: Boolean; + function GetItem(Index: Integer): PLineInfo; + public + constructor Create; + function Add(const ARect: TRect; ABrush: TBrush): Integer; overload; + function Add(const ARect: TRect; AColor: TColor): Integer; overload; + function Add(X, Y, AWidth, AHeight: Integer; ABrush: TBrush): Integer; overload; + function Add(X, Y, AWidth, AHeight: Integer; AColor: TColor): Integer; overload; + property Items[Index: Integer]: PLineInfo read GetItem; default; + property Locked: Boolean read FLocked write FLocked; + end; + + { TIndentInfo } + + PIndentInfo = ^TIndentInfo; + TIndentInfo = record + Bounds: TRect; + ViewParams: TcxViewParams; + end; + + { TIndentInfoList } + + TIndentInfoList = class(TcxDataList) + private + function GetItem(Index: Integer): PIndentInfo; + public + constructor Create; + function Add(const ABounds: TRect; const AViewParams: TcxViewParams): Integer; + property Items[Index: Integer]: PIndentInfo read GetItem; default; + end; + + { TIndentRectInfo } + + PIndentRectInfo = ^TIndentRectInfo; + TIndentRectInfo = record + IsCategory: Boolean; + Size: TSize; + ViewParams: TcxViewParams; + Underline: Boolean; + end; + + { TIndentRectInfoList } + + TIndentRectInfoList = class(TcxDataList) + private + function GetItem(Index: Integer): PIndentRectInfo; + public + constructor Create; + function Add(const ASize: TSize; AIsCategory, AUnderline: Boolean; const AViewParams: TcxViewParams): Integer; + property Items[Index: Integer]: PIndentRectInfo read GetItem; default; + end; + + { TViewRects } + + TViewRects = class + public + BandRects: TcxRectList; + EmptyRects: TcxRectList; + constructor Create; + destructor Destroy; override; + procedure Clear; + end; + +function Max(A, B: Integer): Integer; +function Min(A, B: Integer): Integer; + +function cxCreateHalftoneBrush(AColor1, AColor2: TColor): TBrush; + +implementation + +uses +{$IFNDEF DELPHI5} + cxClasses, +{$ENDIF} + SysUtils, cxGeometry; + +function Max(A, B: Integer): Integer; +begin + if A > B then Result := A else Result := B; +end; + +function Min(A, B: Integer): Integer; +begin + if A < B then Result := A else Result := B; +end; + +{ TcxDataList } + +constructor TcxDataList.Create(ARecordSize: Integer); +begin + FDelta := 1024; + FRecordSize := ARecordSize; +end; + +destructor TcxDataList.Destroy; +begin + FreeMem(FData, FAllocated * FRecordSize); + inherited Destroy; +end; + +procedure TcxDataList.Clear; +begin + FCount := 0; +end; + +procedure TcxDataList.CheckCapacity; +begin + if FCount = FAllocated then + begin + Inc(FAllocated, FDelta); + ReallocMem(FData, FAllocated * FRecordSize); + end; +end; + +function TcxDataList.Get(Index: Integer): Pointer; +begin + if (Index < 0) or (Index >= FCount) then + Exception.CreateFmt('Error %s: Invalid index %d', [ClassName, Index]); + Cardinal(Result) := Cardinal(FData) + Cardinal(Index * FRecordSize); +end; + +{ TcxRectList } + +constructor TcxRectList.Create; +begin + inherited Create(SizeOf(TRect)); +end; + +procedure TcxRectList.Assign(Source: TcxRectList); +begin + if Source.FAllocated > FAllocated then + begin + FAllocated := Source.FAllocated; + ReallocMem(FData, FAllocated * SizeOf(TRect)); + end; + FCount := Source.Count; + Move(Source.FData^, FData^, FCount * SizeOf(TRect)); +end; + +function TcxRectList.Add(const R: TRect): Integer; +begin + CheckCapacity; + Result := FCount; + Inc(FCount); + PRect(Get(Result))^ := R; +end; + +function TcxRectList.GetRect(Index: Integer): TRect; +begin + Result := PRect(Get(Index))^; +end; + +procedure TcxRectList.SetRect(Index: Integer; const Value: TRect); +begin + PRect(Get(Index))^ := Value; +end; + +{ TRectScaler } + +constructor TRectScaler.Create; +begin + FScaledRects := TcxRectList.Create; +end; + +destructor TRectScaler.Destroy; +begin + FreeAndNil(FScaledRects); // not Free!!! + inherited Destroy; +end; + +function TRectScaler.GetSummaryParam: TScaleParams; +var + I: Integer; + P: TScaleParams; +begin + FillChar(Result, SizeOf(TScaleParams), 0); + for I := 0 to Count - 1 do + begin + P := PScaleParams(List^[I])^; + Inc(Result.Width, P.Width); + Inc(Result.MinWidth, P.MinWidth); + Inc(Result.FixedWidth, P.FixedWidth); + end; +end; + +procedure TRectScaler.Add(AWidth: Integer); +begin + Add(AWidth, 0, 0); +end; + +procedure TRectScaler.Add(AWidth, AMinWidth: Integer); +begin + Add(AWidth, AMinWidth, 0); +end; + +procedure TRectScaler.Add(AWidth, AMinWidth, AFixedWidth: Integer); +var + P: PScaleParams; +begin + New(P); + P.Width := AWidth; + P.MinWidth := AMinWidth; + P.FixedWidth := AFixedWidth; + inherited Add(P); +end; + +procedure TRectScaler.Clear; +var + I: Integer; +begin + FreeAndNil(FScaledRects); + for I := 0 to Count - 1 do + FreeMem(List^[I], SizeOf(TScaleParams)); + inherited Clear; +end; + +procedure TRectScaler.CalcRect(const Rect: TRect); +var + AScaleParams: TScaleParams; + I, ALeft, H: Integer; + R: TRect; +begin + FScaledRects.Clear; + if Count = 0 then Exit; + ALeft := Rect.Left; + H := Rect.Bottom - Rect.Top; + for I := 0 to Count -1 do + begin + AScaleParams := PScaleParams(Items[I])^; + R := cxRectBounds(ALeft, Rect.Top, AScaleParams.Width, H); + if R.Right - R.Left < AScaleParams.MinWidth then + R.Right := R.Left + AScaleParams.MinWidth; + if I = Count - 1 then R.Right := Rect.Right; + if R.Right >= Rect.Right then + begin + R.Right := Rect.Right; + FScaledRects.Add(R); + break; + end + else + FScaledRects.Add(R); + Inc(ALeft, R.Right - R.Left + AScaleParams.FixedWidth); + end; +end; + +procedure TRectScaler.ScaleRect(const Rect: TRect); +var + ASummary, AScaleParams: TScaleParams; + I, W, ALeft, H: Integer; + ACoeff: Double; + R: TRect; +begin + FScaledRects.Clear; + if Count = 0 then Exit; + ASummary := GetSummaryParam; + if ASummary.Width > 0 then + begin + W := (Rect.Right - Rect.Left) - ASummary.FixedWidth; + ACoeff := W / ASummary.Width; + ALeft := Rect.Left; + H := Rect.Bottom - Rect.Top; + for I := 0 to Count -1 do + begin + AScaleParams := PScaleParams(Items[I])^; + R := cxRectBounds(ALeft, Rect.Top, Round(ACoeff * AScaleParams.Width), H); + if R.Right - R.Left < AScaleParams.MinWidth then + R.Right := R.Left + AScaleParams.MinWidth; + if I = Count - 1 then R.Right := Rect.Right; + if R.Right >= Rect.Right then + begin + R.Right := Rect.Right; + FScaledRects.Add(R); + break; + end + else + FScaledRects.Add(R); + Inc(ALeft, R.Right - R.Left + AScaleParams.FixedWidth); + end; + end; +end; + +{ TLineInfoList } + +constructor TLineInfoList.Create; +begin + inherited Create(SizeOf(TLineInfo)); +end; + +function TLineInfoList.Add(const ARect: TRect; ABrush: TBrush): Integer; +begin + if not FLocked then + begin + CheckCapacity; + Result := FCount; + Inc(FCount); + with PLineInfo(Get(Result))^ do + begin + Rect := ARect; + IsBrush := True; + Brush := ABrush; + end; + end + else Result := -1; +end; + +function TLineInfoList.Add(const ARect: TRect; AColor: TColor): Integer; +begin + if not FLocked then + begin + CheckCapacity; + Result := FCount; + Inc(FCount); + with PLineInfo(Get(Result))^ do + begin + Rect := ARect; + IsBrush := False; + Color := AColor; + end; + end + else Result := -1; +end; + +function TLineInfoList.Add(X, Y, AWidth, AHeight: Integer; ABrush: TBrush): Integer; +begin + Result := Add(cxRectBounds(X, Y, AWidth, AHeight), ABrush); +end; + +function TLineInfoList.Add(X, Y, AWidth, AHeight: Integer; AColor: TColor): Integer; +begin + Result := Add(cxRectBounds(X, Y, AWidth, AHeight), AColor); +end; + +function TLineInfoList.GetItem(Index: Integer): PLineInfo; +begin + Result := PLineInfo(Get(Index)); +end; + +{ TIndentInfoList } + +constructor TIndentInfoList.Create; +begin + inherited Create(SizeOf(TIndentInfo)); +end; + +function TIndentInfoList.Add(const ABounds: TRect; + const AViewParams: TcxViewParams): Integer; +begin + CheckCapacity; + Result := FCount; + Inc(FCount); + with PIndentInfo(Get(Result))^ do + begin + Bounds := ABounds; + ViewParams := AViewParams; + end; +end; + +function TIndentInfoList.GetItem(Index: Integer): PIndentInfo; +begin + Result := PIndentInfo(Get(Index)); +end; + +{ TIndentRectInfoList } + +constructor TIndentRectInfoList.Create; +begin + inherited Create(SizeOf(TIndentRectInfo)); +end; + +function TIndentRectInfoList.Add(const ASize: TSize; AIsCategory, + AUnderline: Boolean; const AViewParams: TcxViewParams): Integer; +begin + CheckCapacity; + Result := FCount; + Inc(FCount); + with PIndentRectInfo(Get(Result))^ do + begin + IsCategory := AIsCategory; + Size := ASize; + ViewParams := AViewParams; + Underline := AUnderline; + end; +end; + +function TIndentRectInfoList.GetItem(Index: Integer): PIndentRectInfo; +begin + Result := PIndentRectInfo(Get(Index)); +end; + +{ TViewRects } + +constructor TViewRects.Create; +begin + BandRects := TcxRectList.Create; + EmptyRects := TcxRectList.Create; +end; + +destructor TViewRects.Destroy; +begin + BandRects.Free; + EmptyRects.Free; + inherited Destroy; +end; + +procedure TViewRects.Clear; +begin + BandRects.Clear; + EmptyRects.Clear; +end; + +function cxCreateHalftoneBrush(AColor1, AColor2: TColor): TBrush; +var + ABitmap: TBitmap; + I, J: Integer; +const + APattern: array[0..7] of Word = + ($00AA, $0055, $00AA, $0055, $00AA, $0055, $00AA, $0055); +begin + Result := TBrush.Create; + ABitmap := cxCreateBitmap(TSize(cxPoint(8, 8)), pfDevice); + for I := 0 to 7 do + for J := 0 to 7 do + begin + if ((APattern[I] and (1 shl J)) <> 0) then + ABitmap.Canvas.Pixels[I, J] := AColor1 + else + ABitmap.Canvas.Pixels[I, J] := AColor2; + end; + Result.Bitmap := ABitmap; +end; + +end. diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxVGridViewInfo.pas b/official/x.35/ExpressVerticalGrid/Sources/cxVGridViewInfo.pas new file mode 100644 index 00000000..07d791ef --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxVGridViewInfo.pas @@ -0,0 +1,1103 @@ +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressVerticalGrid } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSVERTICALGRID AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} +unit cxVGridViewInfo; + +{$I cxVer.inc} + +interface + +uses + Classes, Graphics, + Windows, Controls, + cxGraphics, cxVGrid, cxVGridUtils, cxEdit, cxInplaceContainer, cxStyles; + +type + { TcxCategoryRowHeaderInfo } + + TcxCategoryRowHeaderInfo = class(TcxCustomRowHeaderInfo) + private + function GetRow: TcxCategoryRow; + protected + procedure AddBottomHorzLine(const R: TRect); override; + procedure AddRightVertLine(const R: TRect); override; + procedure CalcRowCaptionsInfo; override; + procedure CalcViewParams(AAllowFocus: Boolean); override; + procedure DoCalcExpandButton; override; + function GetCaptionViewParams: TcxViewParams; override; + function GetButtonColor: TColor; override; + function GetFocusRect: TRect; override; + function IncreaseBoundsByLastVertLine: Boolean; override; + function LeftViewPoint: Integer; override; + public + property Row: TcxCategoryRow read GetRow; + end; + + { TcxCategoryRowViewInfo } + + TcxCategoryRowViewInfo = class(TcxCustomRowViewInfo) + private + function GetRow: TcxCategoryRow; + protected + procedure CalcRowHeaderInfo(ANextRow: TcxCustomRow); override; + procedure CalcValuesInfo; override; + public + property Row: TcxCategoryRow read GetRow; + end; + + { TcxEditorRowHeaderInfo } + + TcxEditorRowHeaderInfo = class(TcxCustomRowHeaderInfo) + private + function GetRow: TcxEditorRow; + public + property Row: TcxEditorRow read GetRow; + end; + + { TcxEditorRowViewInfo } + + TcxEditorRowViewInfo = class(TcxCustomRowViewInfo) + private + function GetRow: TcxEditorRow; + protected + procedure CalcValuesInfo; override; + function GetValueHeight(ARecordIndex: Integer; AWidth: Integer; + AViewInfo: TcxvgCustomViewInfo): Integer; override; + public + property Row: TcxEditorRow read GetRow; + end; + + { TcxMultiEditorRowHeaderInfo } + + TcxMultiEditorRowHeaderInfo = class(TcxCustomRowHeaderInfo) + private + FSeparatorRects: TcxRectList; + FSeparatorInfo: TSeparatorInfo; + function GetRow: TcxMultiEditorRow; + protected + procedure CalcRowCaptionsInfo; override; + procedure CalcSeparatorRects(AHeaderCells: TcxRectList); virtual; + procedure CalcSeparatorWidth(ASeparatorWidth: Integer); virtual; + procedure CalcSeparatorStyle; virtual; + procedure Clear; override; + public + constructor Create(ARow: TcxCustomRow); override; + destructor Destroy; override; + property Row: TcxMultiEditorRow read GetRow; + property SeparatorInfo: TSeparatorInfo read FSeparatorInfo; + property SeparatorRects: TcxRectList read FSeparatorRects; + end; + + { TcxMultiEditorRowViewInfo } + + TcxMultiEditorRowViewInfo = class(TcxCustomRowViewInfo) + private + FSeparatorRects: TcxRectList; + function GetHeaderInfo: TcxMultiEditorRowHeaderInfo; + function GetRow: TcxMultiEditorRow; + function GetSeparatorRects: TcxRectList; + protected + procedure AddSeparatorRects(AHeader: Boolean; ASepRects: TcxRectList; + ASeparatorKind: TSeparatorKind; AValueCells: TcxRectList; + const ABounds: TRect); + procedure CalcValuesInfo; override; + procedure CheckEmptyValuesInfo; virtual; + function GetValueHeight(ARecordIndex: Integer; AWidth: Integer; + AViewInfo: TcxvgCustomViewInfo): Integer; override; + public + constructor Create(ARow: TcxCustomRow); override; + destructor Destroy; override; + class function GetCellRects(ARow: TcxMultiEditorRow; const R: TRect; + ASepWidth: Integer): TcxRectList; + property HeaderInfo: TcxMultiEditorRowHeaderInfo read GetHeaderInfo; + property Row: TcxMultiEditorRow read GetRow; + property SeparatorRects: TcxRectList read GetSeparatorRects; + end; + + { TcxInspectorViewInfo } + + TcxInspectorViewInfo = class(TcxvgCustomViewInfo) + protected + procedure AddEmptyRects; override; + procedure CheckMaxRowHeaderWidth(var Value: Integer; AValueMinWidth: Integer); override; + function GetViewValueWidth: Integer; override; + function GetVisibleValueCount: Integer; override; + end; + + { TcxBandsViewInfo } + + TcxBandsViewInfo = class(TcxvgCustomViewInfo) + private + FBandsIndent: Integer; + FAutoScaleBands: Boolean; + FLock: Boolean; + procedure UpdateBandsWidth; + protected + procedure AddEmptyRects; override; + procedure CalcBandRects; override; + procedure CalcBandWidth; override; + procedure CalcLayoutGeneral; override; + function CanAddRowToBand(const ARowRect, ABandRect: TRect; ABandRowIndex: Integer): Boolean; override; + procedure CreateBand(ABandHeight, ABandWidth: Integer); override; + function GetBandSizeableRect(const ABandRect: TRect): TRect; override; + function GetMinViewBandWidth: Integer; + function GetRowAutoHeight(ARow: TcxCustomRow): Boolean; override; + function GetViewBandWidth: Integer; override; + function GetViewValueWidth: Integer; override; + function GetVisibleValueCount: Integer; override; + procedure LayoutStyleChanged; override; + procedure SetDividerPos(APos: Integer); override; + property BandsIndent: Integer read FBandsIndent; + property AutoScaleBands: Boolean read FAutoScaleBands; + end; + + { TcxMultiRecordViewInfo } + + TcxMultiRecordViewInfo = class(TcxvgCustomViewInfo) + private + FCommonWidth: Integer; + FRecordsInterval: Integer; + FVisibleValueCount: Integer; + function CalcVisibleValueCount: Integer; + function GetRecordCount: Integer; + protected + procedure AddBandRowsLines(const R: TRect); override; + procedure AddEmptyRects; override; + procedure AddRightValueSide(const R: TRect; ALast: Boolean); override; + procedure CalcBandWidth; override; + procedure CalcLayoutGeneral; override; + procedure Clear; override; + function GetBandSizeableRect(const ABandRect: TRect): TRect; override; + function GetRowHeight(ARowViewInfo: TcxCustomRowViewInfo; ABandWidth: Integer): Integer; override; + function GetVisibleValueCount: Integer; override; + procedure Reset; override; + procedure SetDividerPos(APos: Integer); override; + property RecordCount: Integer read GetRecordCount; + public + constructor Create(AOwner: TcxEditingControl); override; + function GetDefaultGridModeBufferCount: Integer; override; + function GetValueRect(AValueIndex: Integer; ARowViewInfo: TcxCustomRowViewInfo): TRect; override; + procedure UpdateRecord(ARecordIndex: Integer); override; + property RecordsInterval: Integer read FRecordsInterval; + end; + +implementation + +uses +{$IFNDEF DELPHI5} + cxClasses, +{$ENDIF} + SysUtils, cxControls, cxGeometry, cxEditUtils; + +type + TcxCustomEditorRowPropertiesAccess = class(TcxCustomEditorRowProperties); + TcxCustomRowAccess = class(TcxCustomRow); + TcxCustomRowViewInfoAccess = class(TcxCustomRowViewInfo); + TcxCustomVerticalGridAccess = class(TcxCustomVerticalGrid); + TcxCollectionItemEditorRowPropertiesAccess = class(TcxCollectionItemEditorRowProperties); + TcxRowValueInfoAccess = class(TcxRowValueInfo); + TcxVerticalGridRowsAccess = class(TcxVerticalGridRows); + +{ TcxCategoryRowHeaderInfo } + +procedure TcxCategoryRowHeaderInfo.AddBottomHorzLine(const R: TRect); +begin + with ViewInfo, R do + if HorzLineWidth > 0 then + Self.LinesInfo.Add(Left - VertLineWidth, Bottom, + Right - Left + 2 * VertLineWidth, HorzLineWidth, HorzLineBrush); +end; + +procedure TcxCategoryRowHeaderInfo.AddRightVertLine(const R: TRect); +begin + with ViewInfo, Row.ViewInfo.RowRect do + if VertLineWidth > 0 then + Self.LinesInfo.Add(Right, Top, VertLineWidth, + Bottom - Top + HorzLineWidth, BandBorderColor); +end; + +procedure TcxCategoryRowHeaderInfo.CalcRowCaptionsInfo; +begin + if ViewInfo.UseCategoryExplorerStyle and not cxRectIsEmpty(ButtonRect) then + FHeaderCellsRect.Right := FButtonRect.Left; + inherited CalcRowCaptionsInfo; +end; + +procedure TcxCategoryRowHeaderInfo.CalcViewParams(AAllowFocus: Boolean); +begin + FIndentViewParams := VerticalGrid.Styles.GetCategoryParams(Row); + ViewParams := IndentViewParams; +end; + +procedure TcxCategoryRowHeaderInfo.DoCalcExpandButton; +begin + if Row.HasVisibleChildren then + if ViewInfo.UseCategoryExplorerStyle then + with HeaderRect, ViewInfo.ExplorerButtonSize do + FButtonRect := cxRectCenter(cxRect(Right - cx - 2, Top, Right, Bottom), cx, cy) + else + inherited DoCalcExpandButton; +end; + +function TcxCategoryRowHeaderInfo.GetCaptionViewParams: TcxViewParams; +begin + Result := ViewParams; +end; + +function TcxCategoryRowHeaderInfo.GetButtonColor: TColor; +begin + if PaintStyle = psDotNet then + Result := ViewParams.Color + else + Result := inherited GetButtonColor; +end; + +function TcxCategoryRowHeaderInfo.GetFocusRect: TRect; +begin + Result := ViewInfo.CalcHelper.GetCategoryFocusRect(Self); +end; + +function TcxCategoryRowHeaderInfo.IncreaseBoundsByLastVertLine: Boolean; +begin + Result := True; +end; + +function TcxCategoryRowHeaderInfo.LeftViewPoint: Integer; +begin + if PaintStyle = psDotNet then + Result := IndentBounds.Right + else + Result := inherited LeftViewPoint; +end; + +function TcxCategoryRowHeaderInfo.GetRow: TcxCategoryRow; +begin + Result := TcxCategoryRow(FRow); +end; + +{ TcxCategoryRowViewInfo } + +procedure TcxCategoryRowViewInfo.CalcRowHeaderInfo(ANextRow: TcxCustomRow); +begin + HeaderInfo.HeaderRect := RowRect; + with ValuesRect do + ValuesRect := cxNullRect; + inherited CalcRowHeaderInfo(ANextRow); +end; + +procedure TcxCategoryRowViewInfo.CalcValuesInfo; +begin +end; + +function TcxCategoryRowViewInfo.GetRow: TcxCategoryRow; +begin + Result := TcxCategoryRow(inherited Row); +end; + +{ TcxEditorRowHeaderInfo } + +function TcxEditorRowHeaderInfo.GetRow: TcxEditorRow; +begin + Result := TcxEditorRow(FRow); +end; + +{ TcxEditorRowViewInfo } + +procedure TcxEditorRowViewInfo.CalcValuesInfo; +var + ABottomLineNeeded: Boolean; + ANextRow: TcxCustomRow; + ARowValueInfo: TcxRowValueInfo; + I, ACount: Integer; + R: TRect; +begin + with ViewInfo do + begin + ACount := VisibleValueCount; + for I := 0 to ACount - 1 do + begin + R := GetValueRect(I, Self); + ANextRow := VerticalGrid.NextVisibleRow(Row); + ABottomLineNeeded := (ANextRow = nil) or (ANextRow <> nil) and not + (ANextRow.ViewInfo is TcxCategoryRowViewInfo) or + (VerticalGrid.LookAndFeel.SkinPainter = nil); + AddRectValueLines(R, (I = ACount - 1) or (R.Right >= ClipRect.Right), + ABottomLineNeeded); + ARowValueInfo := CalcRowValueInfo(Row.Properties, ViewInfo, FirstVisibleRecordIndex + I, 0); + CalcEditCell(R, ARowValueInfo); + end; + end; + ValuesInfo.Trunc(ACount); +end; + +function TcxEditorRowViewInfo.GetValueHeight(ARecordIndex: Integer; + AWidth: Integer; AViewInfo: TcxvgCustomViewInfo): Integer; +var + ARowValueInfo: TcxRowValueInfoAccess; +begin + with AViewInfo do + begin + ARowValueInfo := TcxRowValueInfoAccess( + CalcRowValueInfo(Row.Properties, AViewInfo, ARecordIndex, 0)); + ARowValueInfo.CellContentRect := cxRectBounds(0, 0, AWidth, 0); + Result := ARowValueInfo.CalculateEditHeight; + ValuesInfo.Trunc(VisibleValueCount); + end; +end; + +function TcxEditorRowViewInfo.GetRow: TcxEditorRow; +begin + Result := TcxEditorRow(inherited Row); +end; + +{ TcxMultiEditorRowHeaderInfo } + +constructor TcxMultiEditorRowHeaderInfo.Create(ARow: TcxCustomRow); +begin + inherited Create(ARow); + FSeparatorRects := TcxRectList.Create; +end; + +destructor TcxMultiEditorRowHeaderInfo.Destroy; +begin + FSeparatorRects.Free; + inherited Destroy; +end; + +procedure TcxMultiEditorRowHeaderInfo.CalcRowCaptionsInfo; +var + I: Integer; + R: TRect; + ARects: TcxRectList; + ACaptionInfo: TcxRowCaptionInfo; +begin + CalcSeparatorWidth(ViewInfo.DividerWidth); + CalcSeparatorStyle; + ARects := TcxMultiEditorRowViewInfo.GetCellRects(Row, HeaderCellsRect, FSeparatorInfo.Width); + if ARects <> nil then + try + for I := 0 to ARects.Count - 1 do + begin + R := ARects[I]; + if R.Left < HeaderCellsRect.Right then + begin + ACaptionInfo := CalcCaptionInfo(Row.Properties.Editors[I], R); + ACaptionInfo.RowCellIndex := I; + CaptionsInfo.Add(ACaptionInfo); + end; + end; + CalcSeparatorRects(ARects); + finally + ARects.Free; + end; +end; + +procedure TcxMultiEditorRowHeaderInfo.CalcSeparatorRects( + AHeaderCells: TcxRectList); +begin + TcxMultiEditorRowViewInfo(Row.ViewInfo).AddSeparatorRects( + True, SeparatorRects, SeparatorInfo.Kind, AHeaderCells, HeaderCellsRect); +end; + +procedure TcxMultiEditorRowHeaderInfo.CalcSeparatorWidth( + ASeparatorWidth: Integer); +begin + with FSeparatorInfo do + begin + Kind := Row.Properties.SeparatorKind; + Caption := Row.Properties.SeparatorString; + if Kind = skVertLine then + Width := ASeparatorWidth + else + Width := cxTextWidth(Self.ViewParams.Font, SeparatorInfo.Caption + '0'); + end; +end; + +procedure TcxMultiEditorRowHeaderInfo.CalcSeparatorStyle; +begin + FSeparatorInfo.ViewParams := ViewParams; + with Row.Properties do + FSeparatorInfo.TextFlags := GetTextAligmentFlags(taCenter, SeparatorAlignmentVert); +end; + +procedure TcxMultiEditorRowHeaderInfo.Clear; +begin + inherited Clear; + FSeparatorRects.Clear; +end; + +function TcxMultiEditorRowHeaderInfo.GetRow: TcxMultiEditorRow; +begin + Result := TcxMultiEditorRow(FRow); +end; + +{ TcxMultiEditorRowViewInfo } + +constructor TcxMultiEditorRowViewInfo.Create(ARow: TcxCustomRow); +begin + inherited Create(ARow); + FSeparatorRects := TcxRectList.Create; +end; + +destructor TcxMultiEditorRowViewInfo.Destroy; +begin + FreeAndNil(FSeparatorRects); + inherited Destroy; +end; + +class function TcxMultiEditorRowViewInfo.GetCellRects(ARow: TcxMultiEditorRow; + const R: TRect; ASepWidth: Integer): TcxRectList; +var + I, ACount, AMinWidth: Integer; +begin + Result := nil; + AMinWidth := ARow.VerticalGrid.OptionsView.RowHeaderMinWidth; + ACount := ARow.Properties.Editors.Count; + with TRectScaler.Create do + try + for I := 0 to ACount - 1 do + Add(ARow.Properties.Editors[I].Width, AMinWidth, + cxSetValue(I = ACount - 1, 0, ASepWidth)); + if ARow.Properties.Fixed then CalcRect(R) else ScaleRect(R); + if ScaledRects.Count > 0 then + begin + Result := TcxRectList.Create; + Result.Assign(ScaledRects); + end; + finally + Free; + end; +end; + +procedure TcxMultiEditorRowViewInfo.AddSeparatorRects( + AHeader: Boolean; + ASepRects: TcxRectList; + ASeparatorKind: TSeparatorKind; + AValueCells: TcxRectList; + const ABounds: TRect); +var + I: Integer; + R: TRect; +begin + for I := 0 to AValueCells.Count - 2 do + with AValueCells[I] do + if ASeparatorKind = skString then + begin + R := cxRect(Right, Top, AValueCells[I + 1].Left, Bottom); + if cxRectIntersect(R, R, ABounds) then ASepRects.Add(R) + end + else + begin + R := cxRect(Right - ViewInfo.DividerWidth, Top, Right, Bottom); + if cxRectIntersect(R, R, ABounds) then + if AHeader then + ViewInfo.CalcHelper.AddDivider(HeaderInfo.LinesInfo, R, + HeaderInfo.ViewParams.Color, True) + else + ViewInfo.CalcHelper.AddDivider(ViewInfo.LinesInfo, R, + HeaderInfo.ViewParams.Color, True); + end; +end; + +procedure TcxMultiEditorRowViewInfo.CalcValuesInfo; +var + I, J, ASepWidth, ACount, AValuesCount: Integer; + ABottomLineNeeded: Boolean; + ANextRow: TcxCustomRow; + ARects: TcxRectList; + ARowValueInfo: TcxRowValueInfo; + ASepKind: TSeparatorKind; + AValueRect, R: TRect; +begin + ACount := 0; + SeparatorRects.Clear; + with HeaderInfo.SeparatorInfo do + begin + ASepWidth := Width; + ASepKind := Kind; + end; + with ViewInfo do + begin + AValuesCount := VisibleValueCount; + for I := 0 to AValuesCount - 1 do + begin + AValueRect := GetValueRect(I, Self); + ARects := GetCellRects(Row, AValueRect, ASepWidth); + ANextRow := VerticalGrid.NextVisibleRow(Row); + ABottomLineNeeded := (ANextRow = nil) or not (ANextRow.ViewInfo is TcxCategoryRowViewInfo) + or (VerticalGrid.LookAndFeel.SkinPainter = nil); + if ARects <> nil then + begin + ACount := Min(ARects.Count, TcxCustomRowAccess(Row).GetEditContainerCount); + try + for J := 0 to ACount - 1 do + begin + R := ARects[J]; + if not cxRectIsEmpty(R) then + begin + ARowValueInfo := CalcRowValueInfo(Row.Properties.Editors[J], + ViewInfo, FirstVisibleRecordIndex + I, J); + CalcEditCell(R, ARowValueInfo); + end; + end; + AddSeparatorRects(False, SeparatorRects, ASepKind, ARects, AValueRect); + finally + ARects.Free; + end; + end; + AddRectValueLines(AValueRect, I = AValuesCount - 1, ABottomLineNeeded); + end; + ValuesInfo.Trunc(AValuesCount * ACount); + end; + CheckEmptyValuesInfo; +end; + +procedure TcxMultiEditorRowViewInfo.CheckEmptyValuesInfo; +begin + if (Row.Properties.Editors.Count = 0) and (cxRectWidth(ValuesRect) > 0) then + begin + HeaderInfo.LinesInfo.Add(RowRect, HeaderInfo.ViewParams.Color); + AddRectValueLines(ValuesRect, True, True); + end; +end; + +function TcxMultiEditorRowViewInfo.GetValueHeight(ARecordIndex: Integer; + AWidth: Integer; AViewInfo: TcxvgCustomViewInfo): Integer; +var + I, J, ASepWidth, ACount, AValuesCount: Integer; + AValueRect, R: TRect; + ARects: TcxRectList; + ARowValueInfo: TcxRowValueInfoAccess; +begin + Result := -1; + ACount := 0; + ASepWidth := HeaderInfo.SeparatorInfo.Width; + with AViewInfo do + begin + AValuesCount := VisibleValueCount; + for I := 0 to AValuesCount - 1 do + begin + AValueRect := GetValueRect(I, Self); + ARects := GetCellRects(Row, AValueRect, ASepWidth); + if ARects <> nil then + begin + ACount := Min(ARects.Count, TcxCustomRowAccess(Row).GetEditContainerCount); + try + for J := 0 to ACount - 1 do + begin + R := ARects[J]; + if not cxRectIsEmpty(R) then + begin + ARowValueInfo := TcxRowValueInfoAccess(CalcRowValueInfo( + Row.Properties.Editors[J], AViewInfo, FirstVisibleRecordIndex + I, J)); + ARowValueInfo.CellContentRect := cxRectBounds(0, 0, R.Right - R.Left, 0); + Result := Max(Result, ARowValueInfo.CalculateEditHeight); + end; + end; + finally + ARects.Free; + end; + end; + end; + ValuesInfo.Trunc(AValuesCount * ACount); + end; +end; + +function TcxMultiEditorRowViewInfo.GetHeaderInfo: TcxMultiEditorRowHeaderInfo; +begin + Result := TcxMultiEditorRowHeaderInfo(inherited HeaderInfo); +end; + +function TcxMultiEditorRowViewInfo.GetRow: TcxMultiEditorRow; +begin + Result := TcxMultiEditorRow(inherited Row); +end; + +function TcxMultiEditorRowViewInfo.GetSeparatorRects: TcxRectList; +begin + Result := FSeparatorRects; +end; + +{ TcxInspectorViewInfo } + +procedure TcxInspectorViewInfo.AddEmptyRects; +begin +end; + +procedure TcxInspectorViewInfo.CheckMaxRowHeaderWidth(var Value: Integer; + AValueMinWidth: Integer); +begin + if ViewBandWidth > 0 then + Value := Min(Value, ViewBandWidth - Max(AValueMinWidth, 4)); +end; + +function TcxInspectorViewInfo.GetViewValueWidth: Integer; +begin + Result := ViewBandWidth - ViewHeaderWidth - DividerWidth - 2 * VertLineWidth; +end; + +function TcxInspectorViewInfo.GetVisibleValueCount: Integer; +begin + Result := 1; +end; + +{ TcxBandsViewInfo } + +procedure TcxBandsViewInfo.AddEmptyRects; +var + I, AHeight: Integer; + ABand: TRect; +begin + AHeight := ClientRect.Bottom - ClientRect.Top; + with ABand, ViewRects do + begin + if BandsIndent > 0 then + for I := 0 to BandRects.Count - 2 do + begin + ABand := BandRects[I]; + EmptyRects.Add(cxRectBounds(Right, Top, BandsIndent, AHeight)); + end; + // check last band + ABand := BandRects[BandRects.Count - 1]; + if Right < ClientRect.Right then + //suppose non-autoWidth mode + EmptyRects.Add(cxRectBounds(Right, Top, ClientRect.Right - Right, AHeight)); + end; +end; + +procedure TcxBandsViewInfo.CalcBandRects; +var + I: Integer; +begin + with Scroller do + for I := LeftVisibleBand to BandsInfo.Count - 1 do + CreateBand(BandsInfo[I].BandHeight, 40); + UpdateBandsWidth; +end; + +procedure TcxBandsViewInfo.CalcBandWidth; +var + ABandIndentWidth, ASaveWidth, ABandCount: Integer; + APos: Double; +begin + ViewHeaderWidth := GetViewHeaderWidth; + if not AutoScaleBands then + begin + ViewValueWidth := GetViewValueWidth; + ViewBandWidth := GetViewBandWidth; + end + else + begin + if LockDividerPos then Exit; + ASaveWidth := GetViewBandWidth; + if ShowHeaders and (ASaveWidth > 0) then + APos := Max(GetViewBandWidth, VerticalGrid.OptionsView.ValueMinWidth ) / Max(ViewHeaderWidth, 1) + else + APos := 1; + ABandCount := Scroller.BandsInfo.Count; + ABandIndentWidth := cxSetValue(ABandCount > 1, (ABandCount - 1) * BandsIndent, 0); + ViewBandWidth := Max(GetMinViewBandWidth, + (cxRectWidth(ClientRect) - ABandIndentWidth) div Max(ABandCount, 1)); + if ViewBandWidth < BandMinWidth then + ViewBandWidth := BandMinWidth; + if ShowHeaders and not FLock and (ASaveWidth > ViewHeaderWidth) and + (ASaveWidth <> ViewBandWidth) then + SetDividerPos(Round(ViewBandWidth / APos)); + ViewHeaderWidth := GetViewHeaderWidth; + end; +end; + +procedure TcxBandsViewInfo.CalcLayoutGeneral; +begin + FAutoScaleBands := VerticalGrid.OptionsView.AutoScaleBands; + inherited CalcLayoutGeneral; + FBandsIndent := VerticalGrid.OptionsView.BandsInterval; +end; + +function TcxBandsViewInfo.CanAddRowToBand(const ARowRect, ABandRect: TRect; + ABandRowIndex: Integer): Boolean; +begin + Result := (ARowRect.Bottom <= ABandRect.Bottom) or (ABandRowIndex = 0); +end; + +procedure TcxBandsViewInfo.CreateBand(ABandHeight, ABandWidth: Integer); +var + ABandIndex, ALeft: Integer; + R: TRect; +begin + ABandIndex := ViewRects.BandRects.Count; + if ABandIndex = 0 then + ALeft := ClientRect.Left + else + ALeft := ViewRects.BandRects[ABandIndex - 1].Right; + R := cxRectBounds(ALeft, ClientRect.Top, ABandWidth, + Min(ABandHeight, cxRectHeight(ClientRect))); + ViewRects.BandRects.Add(R); + if R.Bottom < ClientRect.Bottom then + ViewRects.EmptyRects.Add(cxRectBounds(R.Left, R.Bottom, ABandIndex, + cxRectHeight(ClientRect) - cxRectHeight(R))); +end; + +function TcxBandsViewInfo.GetBandSizeableRect(const ABandRect: TRect): TRect; +begin + if VerticalGrid.OptionsView.AutoScaleBands then + Result := cxNullRect + else + Result := inherited GetBandSizeableRect(ABandRect); +end; + +function TcxBandsViewInfo.GetMinViewBandWidth: Integer; +begin + Result := GetViewMinHeaderWidth + VerticalGrid.OptionsView.ValueMinWidth +end; + +function TcxBandsViewInfo.GetRowAutoHeight(ARow: TcxCustomRow): Boolean; +begin + with VerticalGrid.OptionsView do + Result := CellAutoHeight and not FAutoScaleBands and + ARow.Options.CanAutoHeight; +end; + +function TcxBandsViewInfo.GetViewBandWidth: Integer; +begin + if not AutoScaleBands then + Result := ViewHeaderWidth + DividerWidth + ViewValueWidth + 2 + else + Result := Max(ViewBandWidth, GetMinViewBandWidth); +end; + +function TcxBandsViewInfo.GetViewValueWidth: Integer; +begin + Result := VerticalGrid.OptionsView.ValueWidth +end; + +function TcxBandsViewInfo.GetVisibleValueCount: Integer; +begin + Result := 1; +end; + +procedure TcxBandsViewInfo.LayoutStyleChanged; +begin + if AutoScaleBands then + begin + ViewHeaderWidth := Max(VerticalGrid.OptionsView.RowHeaderWidth, GetViewMinHeaderWidth); + SetDividerPos(ViewHeaderWidth); + ViewBandWidth := GetMinViewBandWidth; + end; + inherited LayoutStyleChanged; +end; + +procedure TcxBandsViewInfo.SetDividerPos(APos: Integer); +begin + FLock := True; + try + if AutoScaleBands then + inherited SetDividerPos(APos) + else + begin + if APos > ClipRect.Right - 4 then APos := ClipRect.Right - 4; + VerticalGrid.OptionsView.RowHeaderWidth := APos; + end; + finally + FLock := False; + end; +end; + +procedure TcxBandsViewInfo.UpdateBandsWidth; +var + I, ACurLeft: Integer; + R, B: TRect; +begin + ACurLeft := ClientRect.Left; + with ViewRects do + begin + for I := 0 to BandRects.Count - 1 do + begin + R := BandRects[I]; + R.Left := ACurLeft; + R.Right := R.Left + ViewBandWidth; + Inc(ACurLeft, ViewBandWidth + BandsIndent); + if AutoScaleBands then + begin + if I = BandRects.Count - 1 then + begin + Dec(ACurLeft, BandsIndent); + Inc(R.Right, ClientRect.Right - ACurLeft); + end; + end; + BandRects[I] := R; + end; + for I := 0 to EmptyRects.Count - 1 do + begin + R := EmptyRects[I]; + B := BandRects[R.Right - R.Left]; + R.Left := B.Left; + R.Right := B.Right; + EmptyRects[I] := R; + end; + end; +end; + +{ TcxMultiRecordViewInfo } + +constructor TcxMultiRecordViewInfo.Create(AOwner: TcxEditingControl); +begin + inherited Create(AOwner); + FVisibleValueCount := -1; +end; + +function TcxMultiRecordViewInfo.GetDefaultGridModeBufferCount: Integer; +var + W: Integer; +begin + W := cxRectWidth(ClientRect) - ViewHeaderWidth - DividerWidth - VertLineWidth; + if W <= 0 then + begin + Result := 1; + Exit; + end; + Result := W div (ViewValueWidth + RecordsInterval); + if Result * (ViewValueWidth + RecordsInterval) < W then Inc(Result); +end; + +function TcxMultiRecordViewInfo.GetValueRect(AValueIndex: Integer; + ARowViewInfo: TcxCustomRowViewInfo): TRect; +var + ALeft: Integer; +begin + with ARowViewInfo.RowRect do + begin + ALeft := Left + ViewHeaderWidth + DividerWidth + + AValueIndex * (ViewValueWidth + cxSetValue(RecordsInterval = 0, VertLineWidth, + RecordsInterval + 2 * VertLineWidth)); + Result := cxRectBounds(ALeft, Top, ViewValueWidth, Bottom - Top); + end; +end; + +procedure TcxMultiRecordViewInfo.UpdateRecord(ARecordIndex: Integer); +var + I: Integer; +begin + if ARecordIndex < 0 then Exit; + for I := 0 to RowsViewInfo.Count - 1 do + RowsViewInfo[I].UpdateRecord(ARecordIndex); +end; + +procedure TcxMultiRecordViewInfo.AddBandRowsLines(const R: TRect); +var + ASize: TSize; + ABandRect: TRect; + I, ALeft, ATop, AHeight: Integer; + ARowInfo: TcxCustomRowViewInfo; + + procedure AddRecordInterval(ALast: Boolean); + var + I: Integer; + R: TRect; + begin + if AHeight > 0 then + for I := 0 to VisibleValueCount - 2 do + begin + if (HorzLineWidth > 0) and not ALast then + LinesInfo.Add(ALeft, ATop + AHeight, RecordsInterval, HorzLineWidth, + BandBorderColor); + R := cxRectBounds(ALeft, ATop, RecordsInterval, AHeight); + if ALast then Inc(R.Bottom, HorzLineWidth); + ViewRects.EmptyRects.Add(R); + if VertLineWidth > 0 then + LinesInfo.Add(R.Right, R.Top, VertLineWidth, AHeight + HorzLineWidth, + BandBorderColor); + Inc(ALeft, ViewValueWidth + RecordsInterval + 2 * VertLineWidth); + end; + end; + +begin + if RecordsInterval = 0 then + begin + inherited AddBandRowsLines(R); + Exit; + end; + ABandRect := R; + if RecordsInterval > 0 then + begin + ALeft := ABandRect.Left + FCommonWidth; + ATop := ClientRect.Top; + AHeight := 0; + for I := 0 to RowsViewInfo.Count - 1 do + begin + ARowInfo := RowsViewInfo[I]; + if not (ARowInfo is TcxCategoryRowViewInfo) then + Inc(AHeight, cxRectHeight(ARowInfo.RowRect) + HorzLineWidth) + else + begin + AddRecordInterval(False); + AHeight := 0; + ATop := ARowInfo.RowRect.Bottom; + ALeft := ABandRect.Left + 2 * VertLineWidth + DividerWidth + + ViewHeaderWidth + ViewValueWidth; + end; + end; + AddRecordInterval(True); + end; + if (VertLineWidth > 0) then + with R do + LinesInfo.Add(Left, Top - HorzLineWidth, VertLineWidth, Bottom - Top, + BandBorderColor); + ALeft := R.Left; + ATop := R.Top; + ASize := cxSize(FCommonWidth, R.Bottom - R.Top); + while ALeft < R.Right do + begin + if ALeft + ASize.cx > R.Right then ASize.cx := R.Right - ALeft; + with cxRectBounds(ALeft, ATop, ASize.cx, ASize.cy) do + begin + if HorzLineWidth > 0 then + begin + LinesInfo.Add(Left, Top, Right - Left, HorzLineWidth, BandBorderColor); + LinesInfo.Add(Left, Bottom - HorzLineWidth, Right - Left, HorzLineWidth, BandBorderColor); + end; + end; + Inc(ALeft, RecordsInterval + ASize.cx); + ASize.cx := 2 * VertLineWidth + ViewValueWidth; + end; +end; + +procedure TcxMultiRecordViewInfo.AddEmptyRects; +var + ABandRect: TRect; +begin + ABandRect := ViewRects.BandRects[0]; +// Inc(ABandRect.Bottom, HorzLineWidth * 2); ? + if ABandRect.Right < ClientRect.Right then + ViewRects.EmptyRects.Add(cxRect(ABandRect.Right, ABandRect.Top, + ClientRect.Right, ClientRect.Bottom)); +end; + +procedure TcxMultiRecordViewInfo.AddRightValueSide(const R: TRect; + ALast: Boolean); +begin + inherited AddRightValueSide(R, ALast or (FRecordsInterval > 0)); +end; + +procedure TcxMultiRecordViewInfo.CalcBandWidth; +var + AWidth: Integer; +begin + ViewHeaderWidth := GetViewHeaderWidth; + ViewValueWidth := VerticalGrid.OptionsView.ValueWidth; + AWidth := ViewHeaderWidth + 2 * VertLineWidth + DividerWidth + ViewValueWidth; + FCommonWidth := AWidth; + if RecordCount > 1 then + Inc(AWidth, (RecordCount - Scroller.LeftVisibleRecord - 1) * + (ViewValueWidth + cxSetValue(RecordsInterval = 0, VertLineWidth, + RecordsInterval + 2 * VertLineWidth))); + ViewBandWidth := Min(AWidth, cxRectWidth(ClientRect)); +end; + +procedure TcxMultiRecordViewInfo.CalcLayoutGeneral; +begin + FRecordsInterval := + TcxvgMultiRecordsOptionsView(VerticalGrid.OptionsView).RecordsInterval; + inherited CalcLayoutGeneral; +end; + +procedure TcxMultiRecordViewInfo.Clear; +begin + inherited Clear; + FVisibleValueCount := -1; + FCommonWidth := 0 +end; + +function TcxMultiRecordViewInfo.GetBandSizeableRect( + const ABandRect: TRect): TRect; +var + ALeft: Integer; +begin + if TcxVirtualVerticalGrid(VerticalGrid).LayoutStyle <> lsMultiRecordView then + Result := inherited GetBandSizeableRect(ABandRect) + else + with ClientRect do + begin + ALeft := ABandRect.Left + ViewHeaderWidth + DividerWidth + ViewValueWidth + VertLineWidth; + Result := cxRect(ALeft - 1, Top, ALeft + 2, Bottom); + end; +end; + +function TcxMultiRecordViewInfo.GetRowHeight( + ARowViewInfo: TcxCustomRowViewInfo; ABandWidth: Integer): Integer; +var + I, ACount: Integer; +begin + Result := TcxCustomRowAccess(ARowViewInfo.Row).GetRealHeight; + if GetRowAutoHeight(ARowViewInfo.Row) and (ARowViewInfo.Row.Height < 0) then + begin + ACount := VisibleValueCount; + for I := 0 to ACount - 1 do + Result := Max(TcxCustomRowViewInfoAccess(ARowViewInfo).GetValueHeight( + FirstVisibleRecordIndex + I, ViewValueWidth, Self), Result); + end; +end; + +function TcxMultiRecordViewInfo.GetVisibleValueCount: Integer; +begin + if FVisibleValueCount = -1 then + FVisibleValueCount := CalcVisibleValueCount; + Result := FVisibleValueCount; +end; + +procedure TcxMultiRecordViewInfo.Reset; +begin + inherited Reset; + FVisibleValueCount := -1; +end; + +procedure TcxMultiRecordViewInfo.SetDividerPos(APos: Integer); +begin + if APos > ClipRect.Right - 4 then APos := ClipRect.Right - 4; + VerticalGrid.OptionsView.RowHeaderWidth := APos; +end; + +function TcxMultiRecordViewInfo.CalcVisibleValueCount: Integer; +begin + Result := 0; + if cxRectIsEmpty(ClientRect) then Exit; + Result := Max(1, Min(GetDefaultGridModeBufferCount, + RecordCount - Scroller.LeftVisibleRecord)); +end; + +function TcxMultiRecordViewInfo.GetRecordCount: Integer; +begin + Result := TcxCustomVerticalGridAccess(VerticalGrid).RecordCount; +end; + +end. diff --git a/official/x.35/ExpressVerticalGrid/Sources/cxVer.inc b/official/x.35/ExpressVerticalGrid/Sources/cxVer.inc new file mode 100644 index 00000000..a26364cc --- /dev/null +++ b/official/x.35/ExpressVerticalGrid/Sources/cxVer.inc @@ -0,0 +1,172 @@ +{$B-} { Complete Boolean Evaluation } +{$R-} { Range-Checking } +{$T-} { Typed @ operator } +{$X+} { Extended syntax } +{$P+} { Open string params } +{$J+} { Writeable structured consts } +{$H+} { Use long strings by default } +{$Q-} { Overflow checking } + +{$DEFINE DXVER500} + +{$IFNDEF CLR} + {$DEFINE OLEDRAGANDDROP} + {$IFNDEF DONTUSEJPEGIMAGE} + {$DEFINE USEJPEGIMAGE} + {$ENDIF} +{$ENDIF} + +{$DEFINE EXPRESSBARS5} + +{$DEFINE VCL} + +{$IFNDEF VER80} + {$IFNDEF VER90} + {$IFNDEF VER93} + {$DEFINE DELPHI3} { Borland Delphi 3.0 } + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER110} { Borland C++Builder 3.0 } + {$DEFINE CBUILDER3} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE DELPHI4} +{$ENDIF} + +{$IFDEF VER125} { Borland C++Builder 4.0 } + {$DEFINE CBUILDER3} + {$DEFINE DELPHI4} + {$DEFINE CBUILDER4} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$IFDEF BCB} { Borland C++Builder 5.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$IFDEF BCB} { Borland C++Builder 6.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} +{$ENDIF} + +{$IFNDEF DELPHI6} + {$DEFINE MSWINDOWS} +{$ENDIF} +{$IFDEF LINUX} + {$UNDEF MSWINDOWS} +{$ENDIF} + +{$IFDEF LINUX} + {$DEFINE KYLIX1} { Borland Kylix 1 } + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF CompilerVersion >= 14} + {$DEFINE KYLIX2} { Borland Kylix 2 } + {$IFEND} + {$IF CompilerVersion >= 14.50} + {$DEFINE KYLIX3} { Borland Kylix 3 } + {$IFEND} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} { Borland Delphi.Net } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} +{$ENDIF} + +{$IFDEF VER170} { Borland Delphi 9.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} +{$ENDIF} + +{$IFDEF VER180} { Borland Delphi 10 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$IFDEF BCB} { Borland C++Builder 10 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Borland Delphi 11 //CodeGear} + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$DEFINE DELPHI11} + {$IFDEF BCB} { Borland C++Builder 11 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$DEFINE CBUILDER11} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFNDEF CLR} + {$IFNDEF BCB} + {$IFDEF DELPHI6} + {$DEFINE REGISTERSHELLCTRLS} + {$ENDIF} + {$ENDIF} + {$IFDEF DELPHI7} + {$WARN UNSAFE_CAST OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_TYPE OFF} + {$ENDIF} +{$ENDIF} + +{$IFDEF REGISTERSHELLCTRLS} + {$DEFINE REGISTERCXSHELLCTRLS} +{$ENDIF} + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} diff --git a/official/x.35/Lib/D11/cxADOAdapters.dcu b/official/x.35/Lib/D11/cxADOAdapters.dcu new file mode 100644 index 00000000..08b62972 Binary files /dev/null and b/official/x.35/Lib/D11/cxADOAdapters.dcu differ diff --git a/official/x.35/Lib/D11/cxADOAdaptersD11.bpl b/official/x.35/Lib/D11/cxADOAdaptersD11.bpl new file mode 100644 index 00000000..2069a1e4 Binary files /dev/null and b/official/x.35/Lib/D11/cxADOAdaptersD11.bpl differ diff --git a/official/x.35/Lib/D11/cxADOAdaptersD11.dcp b/official/x.35/Lib/D11/cxADOAdaptersD11.dcp new file mode 100644 index 00000000..81559b94 Binary files /dev/null and b/official/x.35/Lib/D11/cxADOAdaptersD11.dcp differ diff --git a/official/x.35/Lib/D11/cxADOAdaptersD11.dcu b/official/x.35/Lib/D11/cxADOAdaptersD11.dcu new file mode 100644 index 00000000..e9c89330 Binary files /dev/null and b/official/x.35/Lib/D11/cxADOAdaptersD11.dcu differ diff --git a/official/x.35/Lib/D11/cxAccessibility.dcu b/official/x.35/Lib/D11/cxAccessibility.dcu new file mode 100644 index 00000000..85ba6367 Binary files /dev/null and b/official/x.35/Lib/D11/cxAccessibility.dcu differ diff --git a/official/x.35/Lib/D11/cxBDEAdapters.dcu b/official/x.35/Lib/D11/cxBDEAdapters.dcu new file mode 100644 index 00000000..122961de Binary files /dev/null and b/official/x.35/Lib/D11/cxBDEAdapters.dcu differ diff --git a/official/x.35/Lib/D11/cxBDEAdaptersD11.bpl b/official/x.35/Lib/D11/cxBDEAdaptersD11.bpl new file mode 100644 index 00000000..6dfdbaa5 Binary files /dev/null and b/official/x.35/Lib/D11/cxBDEAdaptersD11.bpl differ diff --git a/official/x.35/Lib/D11/cxBDEAdaptersD11.dcp b/official/x.35/Lib/D11/cxBDEAdaptersD11.dcp new file mode 100644 index 00000000..e79b3292 Binary files /dev/null and b/official/x.35/Lib/D11/cxBDEAdaptersD11.dcp differ diff --git a/official/x.35/Lib/D11/cxBDEAdaptersD11.dcu b/official/x.35/Lib/D11/cxBDEAdaptersD11.dcu new file mode 100644 index 00000000..0106e0ff Binary files /dev/null and b/official/x.35/Lib/D11/cxBDEAdaptersD11.dcu differ diff --git a/official/x.35/Lib/D11/cxBandedTableViewEditor.dcu b/official/x.35/Lib/D11/cxBandedTableViewEditor.dcu new file mode 100644 index 00000000..83f26f01 Binary files /dev/null and b/official/x.35/Lib/D11/cxBandedTableViewEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxBandedTableViewEditor.dfm b/official/x.35/Lib/D11/cxBandedTableViewEditor.dfm new file mode 100644 index 00000000..4e144072 --- /dev/null +++ b/official/x.35/Lib/D11/cxBandedTableViewEditor.dfm @@ -0,0 +1,127 @@ +inherited cxBandedTableViewEditor: TcxBandedTableViewEditor + Left = 477 + Caption = 'cxBandedTableViewEditor' + PixelsPerInch = 96 + TextHeight = 13 + inherited PViewEditor: TPanel + inherited PageControl1: TcxPageControl + ActivePage = TSBands + object TSBands: TcxTabSheet [0] + BorderWidth = 8 + Caption = ' Bands ' + object Panel22: TPanel + Left = 209 + Top = 0 + Width = 118 + Height = 273 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object BAddBand: TcxButton + Left = 8 + Top = 0 + Width = 110 + Height = 24 + Caption = '&Add' + TabOrder = 0 + OnClick = BAddBandClick + end + object BDeleteBand: TcxButton + Left = 8 + Top = 32 + Width = 110 + Height = 24 + Caption = 'Delete' + TabOrder = 1 + OnClick = BDeleteBandClick + end + object BBandMoveDown: TcxButton + Left = 8 + Top = 104 + Width = 110 + Height = 24 + Caption = 'Move &Down' + TabOrder = 2 + OnClick = BBandMoveDownClick + end + object BBandMoveUp: TcxButton + Left = 8 + Top = 72 + Width = 110 + Height = 24 + Caption = 'Move &Up' + TabOrder = 3 + OnClick = BBandMoveUpClick + end + end + object Panel20: TPanel + Left = 0 + Top = 0 + Width = 209 + Height = 273 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object LBBands: TListBox + Left = 1 + Top = 1 + Width = 207 + Height = 271 + Style = lbOwnerDrawFixed + Align = alClient + BorderStyle = bsNone + DragMode = dmAutomatic + ItemHeight = 16 + MultiSelect = True + PopupMenu = PMBands + TabOrder = 0 + OnClick = LBBandsClick + OnDragDrop = LBBandsDragDrop + OnDragOver = LBBandsDragOver + OnDrawItem = LBBandsDrawItem + OnEndDrag = LBBandsEndDrag + OnKeyPress = FormKeyPress + OnStartDrag = LBBandsStartDrag + end + end + end + end + end + object PMBands: TPopupMenu + Left = 230 + Top = 90 + object MIBandsAdd: TMenuItem + Caption = '&Add' + ShortCut = 45 + OnClick = BAddBandClick + end + object MIBandsDelete: TMenuItem + Caption = '&Delete' + ShortCut = 46 + OnClick = BDeleteBandClick + end + object MenuItem4: TMenuItem + Caption = '-' + end + object MIBandsMoveUp: TMenuItem + Caption = 'Move Up' + ShortCut = 16422 + OnClick = BBandMoveUpClick + end + object MIBandsMoveDown: TMenuItem + Caption = 'Move Down' + ShortCut = 16424 + OnClick = BBandMoveDownClick + end + object MenuItem7: TMenuItem + Caption = '-' + end + object MIBandsSelectAll: TMenuItem + Caption = '&Select All' + ShortCut = 16449 + OnClick = MIBandsSelectAllClick + end + end +end diff --git a/official/x.35/Lib/D11/cxBarEditItem.dcu b/official/x.35/Lib/D11/cxBarEditItem.dcu new file mode 100644 index 00000000..c0d8559b Binary files /dev/null and b/official/x.35/Lib/D11/cxBarEditItem.dcu differ diff --git a/official/x.35/Lib/D11/cxBarEditItemD11.bpl b/official/x.35/Lib/D11/cxBarEditItemD11.bpl new file mode 100644 index 00000000..b4996dc2 Binary files /dev/null and b/official/x.35/Lib/D11/cxBarEditItemD11.bpl differ diff --git a/official/x.35/Lib/D11/cxBarEditItemD11.dcp b/official/x.35/Lib/D11/cxBarEditItemD11.dcp new file mode 100644 index 00000000..c1f390d7 Binary files /dev/null and b/official/x.35/Lib/D11/cxBarEditItemD11.dcp differ diff --git a/official/x.35/Lib/D11/cxBarEditItemD11.dcu b/official/x.35/Lib/D11/cxBarEditItemD11.dcu new file mode 100644 index 00000000..86978d36 Binary files /dev/null and b/official/x.35/Lib/D11/cxBarEditItemD11.dcu differ diff --git a/official/x.35/Lib/D11/cxBarEditItemReg.dcu b/official/x.35/Lib/D11/cxBarEditItemReg.dcu new file mode 100644 index 00000000..43ddbdc0 Binary files /dev/null and b/official/x.35/Lib/D11/cxBarEditItemReg.dcu differ diff --git a/official/x.35/Lib/D11/cxBarEditItemValueEditor.dcu b/official/x.35/Lib/D11/cxBarEditItemValueEditor.dcu new file mode 100644 index 00000000..43512a96 Binary files /dev/null and b/official/x.35/Lib/D11/cxBarEditItemValueEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxBlobEdit.dcu b/official/x.35/Lib/D11/cxBlobEdit.dcu new file mode 100644 index 00000000..db98f529 Binary files /dev/null and b/official/x.35/Lib/D11/cxBlobEdit.dcu differ diff --git a/official/x.35/Lib/D11/cxButtonEdit.dcu b/official/x.35/Lib/D11/cxButtonEdit.dcu new file mode 100644 index 00000000..f294bbbf Binary files /dev/null and b/official/x.35/Lib/D11/cxButtonEdit.dcu differ diff --git a/official/x.35/Lib/D11/cxButtons.dcu b/official/x.35/Lib/D11/cxButtons.dcu new file mode 100644 index 00000000..92d7e9d0 Binary files /dev/null and b/official/x.35/Lib/D11/cxButtons.dcu differ diff --git a/official/x.35/Lib/D11/cxCalc.dcu b/official/x.35/Lib/D11/cxCalc.dcu new file mode 100644 index 00000000..27ec95a3 Binary files /dev/null and b/official/x.35/Lib/D11/cxCalc.dcu differ diff --git a/official/x.35/Lib/D11/cxCalendar.dcu b/official/x.35/Lib/D11/cxCalendar.dcu new file mode 100644 index 00000000..c39461b0 Binary files /dev/null and b/official/x.35/Lib/D11/cxCalendar.dcu differ diff --git a/official/x.35/Lib/D11/cxCardViewEditor.dcu b/official/x.35/Lib/D11/cxCardViewEditor.dcu new file mode 100644 index 00000000..3dda2da5 Binary files /dev/null and b/official/x.35/Lib/D11/cxCardViewEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxCardViewEditor.dfm b/official/x.35/Lib/D11/cxCardViewEditor.dfm new file mode 100644 index 00000000..8c648579 --- /dev/null +++ b/official/x.35/Lib/D11/cxCardViewEditor.dfm @@ -0,0 +1,15 @@ +inherited cxCardViewEditor: TcxCardViewEditor + Caption = 'cxCardViewEditor' + PixelsPerInch = 96 + TextHeight = 13 + inherited PViewEditor: TPanel + inherited PageControl1: TcxPageControl + inherited TSItems: TcxTabSheet + Caption = ' Rows ' + end + inherited TSSummary: TcxTabSheet + TabVisible = False + end + end + end +end diff --git a/official/x.35/Lib/D11/cxChartViewEditor.dcu b/official/x.35/Lib/D11/cxChartViewEditor.dcu new file mode 100644 index 00000000..77c5c5b6 Binary files /dev/null and b/official/x.35/Lib/D11/cxChartViewEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxChartViewEditor.dfm b/official/x.35/Lib/D11/cxChartViewEditor.dfm new file mode 100644 index 00000000..dccf7e97 --- /dev/null +++ b/official/x.35/Lib/D11/cxChartViewEditor.dfm @@ -0,0 +1,165 @@ +inherited cxChartViewEditor: TcxChartViewEditor + Left = 543 + Top = 157 + Caption = 'cxChartViewEditor' + ClientHeight = 291 + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + inherited PViewEditor: TPanel + Height = 291 + Constraints.MinHeight = 210 + Constraints.MinWidth = 200 + object tcMain: TcxTabControl + Left = 0 + Top = 0 + Width = 343 + Height = 291 + Align = alClient + TabOrder = 0 + Tabs.Strings = ( + ' Series ' + ' DataGroups ') + OnChange = tcMainChange + OnChanging = tcMainChanging + ClientRectBottom = 291 + ClientRectRight = 343 + ClientRectTop = 24 + object Panel1: TPanel + Left = 0 + Top = 24 + Width = 343 + Height = 267 + Align = alClient + BevelOuter = bvNone + BorderWidth = 8 + TabOrder = 0 + object Panel2: TPanel + Left = 217 + Top = 8 + Width = 118 + Height = 251 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object btnItemAdd: TcxButton + Left = 8 + Top = 0 + Width = 110 + Height = 24 + Caption = '&Add' + TabOrder = 0 + OnClick = btnItemAddClick + end + object btnItemDelete: TcxButton + Left = 8 + Top = 32 + Width = 110 + Height = 24 + Caption = 'Delete' + TabOrder = 1 + OnClick = btnItemDeleteClick + end + object btnItemMoveUp: TcxButton + Left = 8 + Top = 72 + Width = 110 + Height = 24 + Caption = 'Move &Up' + TabOrder = 2 + OnClick = btnItemMoveUpClick + end + object btnItemMoveDown: TcxButton + Left = 8 + Top = 104 + Width = 110 + Height = 24 + Caption = 'Move &Down' + TabOrder = 3 + OnClick = btnItemMoveDownClick + end + object btnItemSelectAll: TcxButton + Left = 8 + Top = 144 + Width = 110 + Height = 24 + Caption = 'Select All' + TabOrder = 4 + OnClick = btnItemSelectAllClick + end + end + object Panel9: TPanel + Left = 8 + Top = 8 + Width = 209 + Height = 251 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object lbItems: TListBox + Left = 1 + Top = 1 + Width = 207 + Height = 249 + Style = lbOwnerDrawFixed + Align = alClient + BorderStyle = bsNone + DragMode = dmAutomatic + ItemHeight = 13 + MultiSelect = True + PopupMenu = pmItems + TabOrder = 0 + OnClick = lbItemsClick + OnDragDrop = lbItemsDragDrop + OnDragOver = lbItemsDragOver + OnDrawItem = lbItemsDrawItem + OnEndDrag = lbItemsEndDrag + OnKeyPress = FormKeyPress + OnStartDrag = lbItemsStartDrag + end + end + end + end + end + object pmItems: TPopupMenu + Left = 140 + Top = 74 + object miItemAdd: TMenuItem + Caption = '&Add' + ShortCut = 45 + OnClick = btnItemAddClick + end + object miItemDelete: TMenuItem + Caption = '&Delete' + ShortCut = 46 + OnClick = btnItemDeleteClick + end + object N2: TMenuItem + Caption = '-' + end + object miItemMoveUp: TMenuItem + Caption = 'Move Up' + ShortCut = 16422 + OnClick = btnItemMoveUpClick + end + object miItemMoveDown: TMenuItem + Caption = 'Move Down' + ShortCut = 16424 + OnClick = btnItemMoveDownClick + end + object N1: TMenuItem + Caption = '-' + end + object miItemSelectAll: TMenuItem + Caption = '&Select All' + ShortCut = 16449 + OnClick = btnItemSelectAllClick + end + end + object pmItemsAdd: TPopupMenu + Left = 140 + Top = 112 + end +end diff --git a/official/x.35/Lib/D11/cxCheckBox.dcu b/official/x.35/Lib/D11/cxCheckBox.dcu new file mode 100644 index 00000000..6bfa37d0 Binary files /dev/null and b/official/x.35/Lib/D11/cxCheckBox.dcu differ diff --git a/official/x.35/Lib/D11/cxCheckComboBox.dcu b/official/x.35/Lib/D11/cxCheckComboBox.dcu new file mode 100644 index 00000000..0eb186e2 Binary files /dev/null and b/official/x.35/Lib/D11/cxCheckComboBox.dcu differ diff --git a/official/x.35/Lib/D11/cxCheckGroup.dcu b/official/x.35/Lib/D11/cxCheckGroup.dcu new file mode 100644 index 00000000..955ca944 Binary files /dev/null and b/official/x.35/Lib/D11/cxCheckGroup.dcu differ diff --git a/official/x.35/Lib/D11/cxCheckGroupStatesEditor.dcu b/official/x.35/Lib/D11/cxCheckGroupStatesEditor.dcu new file mode 100644 index 00000000..047dec03 Binary files /dev/null and b/official/x.35/Lib/D11/cxCheckGroupStatesEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxCheckGroupStatesEditor.dfm b/official/x.35/Lib/D11/cxCheckGroupStatesEditor.dfm new file mode 100644 index 00000000..42daa26b --- /dev/null +++ b/official/x.35/Lib/D11/cxCheckGroupStatesEditor.dfm @@ -0,0 +1,69 @@ +object cxCheckGroupStatesEditorDlg: TcxCheckGroupStatesEditorDlg + Left = 260 + Top = 283 + BorderStyle = bsDialog + Caption = 'cxCheckGroup - CheckStates editor' + ClientHeight = 238 + ClientWidth = 436 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnShow = FormShow + PixelsPerInch = 96 + Position = poScreenCenter + TextHeight = 13 + object clbStates: TcxCheckListBox + Left = 0 + Top = 0 + Width = 346 + Height = 238 + Align = alClient + Columns = 0 + EditValue = 0 + EditValueFormat = cvfCaptions + Items = <> + ParentColor = False + ScrollWidth = 0 + Style.LookAndFeel.Kind = lfUltraFlat + Style.LookAndFeel.NativeStyle = True + TabOrder = 0 + TabWidth = 0 + end + object Panel1: TPanel + Left = 346 + Top = 0 + Width = 90 + Height = 238 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object btnOK: TcxButton + Left = 8 + Top = 8 + Width = 75 + Height = 25 + Caption = 'OK' + ModalResult = 1 + TabOrder = 0 + LookAndFeel.Kind = lfUltraFlat + LookAndFeel.NativeStyle = True + UseSystemPaint = False + end + object btnCancel: TcxButton + Left = 8 + Top = 40 + Width = 75 + Height = 25 + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + LookAndFeel.Kind = lfUltraFlat + LookAndFeel.NativeStyle = True + UseSystemPaint = False + end + end +end diff --git a/official/x.35/Lib/D11/cxCheckListBox.dcu b/official/x.35/Lib/D11/cxCheckListBox.dcu new file mode 100644 index 00000000..d13b610c Binary files /dev/null and b/official/x.35/Lib/D11/cxCheckListBox.dcu differ diff --git a/official/x.35/Lib/D11/cxClasses.dcu b/official/x.35/Lib/D11/cxClasses.dcu new file mode 100644 index 00000000..868a381c Binary files /dev/null and b/official/x.35/Lib/D11/cxClasses.dcu differ diff --git a/official/x.35/Lib/D11/cxClassesReg.dcu b/official/x.35/Lib/D11/cxClassesReg.dcu new file mode 100644 index 00000000..7328f27c Binary files /dev/null and b/official/x.35/Lib/D11/cxClassesReg.dcu differ diff --git a/official/x.35/Lib/D11/cxColorComboBox.dcu b/official/x.35/Lib/D11/cxColorComboBox.dcu new file mode 100644 index 00000000..f85ffa1e Binary files /dev/null and b/official/x.35/Lib/D11/cxColorComboBox.dcu differ diff --git a/official/x.35/Lib/D11/cxComponentCollectionEditor.dcu b/official/x.35/Lib/D11/cxComponentCollectionEditor.dcu new file mode 100644 index 00000000..f42e5685 Binary files /dev/null and b/official/x.35/Lib/D11/cxComponentCollectionEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxComponentCollectionEditor.dfm b/official/x.35/Lib/D11/cxComponentCollectionEditor.dfm new file mode 100644 index 00000000..05bd2458 --- /dev/null +++ b/official/x.35/Lib/D11/cxComponentCollectionEditor.dfm @@ -0,0 +1,470 @@ +object frmComponentCollectionEditor: TfrmComponentCollectionEditor + Left = 534 + Top = 162 + HelpContext = 26150 + HorzScrollBar.Increment = 10 + VertScrollBar.Increment = 11 + BorderIcons = [biSystemMenu] + BorderStyle = bsSizeToolWin + Caption = 'CollectionEditor' + ClientHeight = 152 + ClientWidth = 183 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + KeyPreview = True + OldCreateOrder = True + Position = poDesigned + ShowHint = True + OnClose = FormClose + OnDestroy = FormDestroy + OnKeyDown = FormKeyDown + OnKeyPress = FormKeyPress + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object ToolBar1: TToolBar + Left = 0 + Top = 0 + Width = 183 + Height = 28 + AutoSize = True + ButtonHeight = 24 + ButtonWidth = 24 + EdgeBorders = [ebTop, ebBottom] + Images = ImageList + PopupMenu = PopupMenu2 + TabOrder = 1 + Wrapable = False + object ToolButton1: TToolButton + Left = 0 + Top = 0 + Action = acAdd + end + object ToolButton2: TToolButton + Left = 24 + Top = 0 + Action = acDelete + end + object ToolButton3: TToolButton + Left = 48 + Top = 0 + Width = 8 + Caption = 'ToolButton3' + ImageIndex = 2 + Style = tbsSeparator + end + object ToolButton4: TToolButton + Left = 56 + Top = 0 + Action = acMoveUp + end + object ToolButton5: TToolButton + Left = 80 + Top = 0 + Action = acMoveDown + end + end + object Panel: TPanel + Left = 0 + Top = 28 + Width = 183 + Height = 124 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object ListView1: TListView + Left = 0 + Top = 0 + Width = 183 + Height = 124 + Align = alClient + Columns = < + item + AutoSize = True + end> + ColumnClick = False + DragMode = dmAutomatic + HideSelection = False + MultiSelect = True + ReadOnly = True + RowSelect = True + PopupMenu = PopupMenu1 + ShowColumnHeaders = False + TabOrder = 0 + ViewStyle = vsReport + OnChange = ListView1Change + OnDragDrop = ListView1DragDrop + OnDragOver = ListView1DragOver + OnKeyDown = ListView1KeyDown + OnKeyPress = ListView1KeyPress + end + end + object ImageList: TImageList + Left = 40 + Top = 40 + Bitmap = { + 494C010104000500040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000002000000001002000000000000020 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840084848400848484000000000000000000848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840084848400848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 0000FFFFFF0000FFFF0000000000848484000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 0000FFFFFF0000FFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000000000C6C6 + C60000000000FFFFFF000000000084848400848484000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000000000C6C6 + C60000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000FF + FF00C6C6C6000000000000000000848484000000840000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000FF + FF00C6C6C6000000000000000000848484000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848400000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000 + 000000000000000000000000000084848400000084000000840000FFFF00FFFF + FF0000FFFF00FFFFFF00848484000000840000FFFF00FFFFFF00000000000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000000000FFFFFF008484 + 840000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00000000008484840084848400000084008484840000FF + FF00FFFFFF00848484000000840084848400FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000848484000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008484000084840000848400008484000084840000000000000000 + 0000000000000000000000000000000000008484840000FFFF0000FFFF008484 + 8400FFFFFF0000FFFF008484840000FFFF00FFFFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000848484000000000000008400000084008484 + 840000FFFF000000840000008400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000848400008484000084840000848400008484000084840000848400000000 + 0000000000000000000000000000000000000000000084848400FFFFFF008484 + 840000FFFF008484840000FFFF00FFFFFF0000FFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000848484000000000084848400000084000000 + 84000000840000008400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000848484000000000000000000000000000000 + 0000848400008484000084840000848400008484000084840000848400000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000848484008484840084848400FFFF + FF0084848400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000848484000000000084848400000084000000 + 840000008400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000008484000084840000848400008484000084840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000FFFF008484840000FF + FF00FFFFFF008484840084848400848484008484840000000000000000000000 + 0000000000000000000000000000000000008484840000008400000084000000 + 8400000084008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000000000008484840000FFFF008484 + 840000FFFF008484840000FFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000840000008400848484000000 + 0000000084000000840084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848400000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000008484840000FFFF00000000008484 + 8400FFFFFF00000000008484840000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000840000008400848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF0000000000000000008484 + 840000FFFF000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000008400000084008484840000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFC000C000FFFFFFFF + 80008000FFFFFFFF80008000FFFFFFFF80000000F83FFEFF80000000F83FFC7F + 80000000F83FF83F00000000F83FF01F00008000C007E00F80008000E00FC007 + 00008000F01FF83F00010001F83FF83F81FF11FFFC7FF83F24FFF8FFFEFFF83F + 66FFFC7FFFFFFFFFE7FFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end + object ActionList: TActionList + Images = ImageList + Left = 8 + Top = 40 + object acAdd: TAction + Caption = '&Add' + Hint = 'Add New' + ImageIndex = 0 + ShortCut = 45 + OnExecute = acAddExecute + end + object acDelete: TAction + Caption = '&Delete' + Enabled = False + Hint = 'Delete Selected' + ImageIndex = 1 + ShortCut = 46 + OnExecute = acDeleteExecute + OnUpdate = SelectionUpdate + end + object acMoveUp: TAction + Caption = 'Move &Up' + Enabled = False + Hint = 'Move Selected Up' + ImageIndex = 2 + ShortCut = 16422 + OnExecute = acMoveUpExecute + OnUpdate = SelectionUpdate + end + object acMoveDown: TAction + Caption = 'Move Dow&n' + Enabled = False + Hint = 'Move Selected Down' + ImageIndex = 3 + ShortCut = 16424 + OnExecute = acMoveDownExecute + OnUpdate = SelectionUpdate + end + object acSelectAll: TAction + Caption = '&Select All' + Enabled = False + ShortCut = 16449 + OnExecute = acSelectAllExecute + OnUpdate = SelectAllCommandUpdate + end + object acToolbar: TAction + Caption = '&Toolbar' + Checked = True + OnExecute = acToolbarExecute + OnUpdate = acToolbarUpdate + end + object acTextLabels: TAction + Caption = 'Text &Labels' + OnExecute = acTextLabelsExecute + end + end + object PopupMenu1: TPopupMenu + Images = ImageList + Left = 72 + Top = 40 + object miAdd: TMenuItem + Action = acAdd + end + object miDelete: TMenuItem + Action = acDelete + end + object miMoveUp: TMenuItem + Action = acMoveUp + end + object miMoveDown: TMenuItem + Action = acMoveDown + end + object SelectAll1: TMenuItem + Action = acSelectAll + end + object N1: TMenuItem + Caption = '-' + end + object miToolbar: TMenuItem + Action = acToolbar + end + end + object PopupMenu2: TPopupMenu + Left = 104 + Top = 40 + object miTextLabels: TMenuItem + Action = acTextLabels + end + end +end diff --git a/official/x.35/Lib/D11/cxContainer.dcu b/official/x.35/Lib/D11/cxContainer.dcu new file mode 100644 index 00000000..2c24ce43 Binary files /dev/null and b/official/x.35/Lib/D11/cxContainer.dcu differ diff --git a/official/x.35/Lib/D11/cxControls.dcu b/official/x.35/Lib/D11/cxControls.dcu new file mode 100644 index 00000000..39e0184b Binary files /dev/null and b/official/x.35/Lib/D11/cxControls.dcu differ diff --git a/official/x.35/Lib/D11/cxControls.res b/official/x.35/Lib/D11/cxControls.res new file mode 100644 index 00000000..ea812551 Binary files /dev/null and b/official/x.35/Lib/D11/cxControls.res differ diff --git a/official/x.35/Lib/D11/cxConverterFactory.dcu b/official/x.35/Lib/D11/cxConverterFactory.dcu new file mode 100644 index 00000000..bd0e4849 Binary files /dev/null and b/official/x.35/Lib/D11/cxConverterFactory.dcu differ diff --git a/official/x.35/Lib/D11/cxConverterUtils.dcu b/official/x.35/Lib/D11/cxConverterUtils.dcu new file mode 100644 index 00000000..0ae465e2 Binary files /dev/null and b/official/x.35/Lib/D11/cxConverterUtils.dcu differ diff --git a/official/x.35/Lib/D11/cxCurrencyEdit.dcu b/official/x.35/Lib/D11/cxCurrencyEdit.dcu new file mode 100644 index 00000000..0cf7c691 Binary files /dev/null and b/official/x.35/Lib/D11/cxCurrencyEdit.dcu differ diff --git a/official/x.35/Lib/D11/cxCustomConverter.dcu b/official/x.35/Lib/D11/cxCustomConverter.dcu new file mode 100644 index 00000000..4de5a30b Binary files /dev/null and b/official/x.35/Lib/D11/cxCustomConverter.dcu differ diff --git a/official/x.35/Lib/D11/cxCustomData.dcu b/official/x.35/Lib/D11/cxCustomData.dcu new file mode 100644 index 00000000..35460eaa Binary files /dev/null and b/official/x.35/Lib/D11/cxCustomData.dcu differ diff --git a/official/x.35/Lib/D11/cxCustomTableViewEditor.dcu b/official/x.35/Lib/D11/cxCustomTableViewEditor.dcu new file mode 100644 index 00000000..47c5c420 Binary files /dev/null and b/official/x.35/Lib/D11/cxCustomTableViewEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxCustomTableViewEditor.dfm b/official/x.35/Lib/D11/cxCustomTableViewEditor.dfm new file mode 100644 index 00000000..fc545584 --- /dev/null +++ b/official/x.35/Lib/D11/cxCustomTableViewEditor.dfm @@ -0,0 +1,766 @@ +inherited cxCustomTableViewEditor: TcxCustomTableViewEditor + Left = 556 + Top = 316 + ActiveControl = PageControl1 + Caption = 'cxCustomTableViewEditor' + ClientHeight = 319 + ClientWidth = 344 + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + inherited PViewEditor: TPanel + Width = 344 + Height = 319 + Constraints.MinHeight = 282 + Constraints.MinWidth = 344 + object PageControl1: TcxPageControl + Left = 0 + Top = 0 + Width = 344 + Height = 319 + ActivePage = TSItems + Align = alClient + TabOrder = 0 + ClientRectBottom = 319 + ClientRectRight = 344 + ClientRectTop = 24 + object TSItems: TcxTabSheet + BorderWidth = 8 + object Panel1: TPanel + Left = 200 + Top = 0 + Width = 128 + Height = 279 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object BColumnAdd: TcxButton + Left = 8 + Top = 0 + Width = 120 + Height = 24 + Caption = '&Add' + TabOrder = 0 + OnClick = BColumnAddClick + end + object BColumnDelete: TcxButton + Left = 8 + Top = 32 + Width = 120 + Height = 24 + Caption = 'Delete' + TabOrder = 1 + OnClick = BColumnDeleteClick + end + object BColumnAddAll: TcxButton + Left = 8 + Top = 176 + Width = 120 + Height = 24 + Caption = 'Retrieve &Fields' + TabOrder = 5 + Visible = False + OnClick = BColumnAddAllClick + end + object BColumnRestore: TcxButton + Left = 8 + Top = 64 + Width = 120 + Height = 24 + Caption = '&Restore Defaults' + TabOrder = 2 + OnClick = BColumnRestoreClick + end + object BColumnMoveUp: TcxButton + Left = 8 + Top = 104 + Width = 120 + Height = 24 + Caption = 'Move &Up' + TabOrder = 3 + OnClick = BColumnMoveUpClick + end + object BColumnMoveDown: TcxButton + Left = 8 + Top = 136 + Width = 120 + Height = 24 + Caption = 'Move &Down' + TabOrder = 4 + OnClick = BColumnMoveDownClick + end + object BColumnAddMissing: TcxButton + Left = 8 + Top = 208 + Width = 120 + Height = 24 + Caption = 'Retrieve &Missing Fields' + TabOrder = 6 + Visible = False + OnClick = BColumnAddMissingClick + end + end + object Panel8: TPanel + Left = 0 + Top = 0 + Width = 200 + Height = 279 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object LBColumns: TListBox + Left = 1 + Top = 1 + Width = 198 + Height = 277 + Style = lbOwnerDrawFixed + Align = alClient + BorderStyle = bsNone + DragMode = dmAutomatic + ItemHeight = 13 + MultiSelect = True + PopupMenu = PMColumns + TabOrder = 0 + OnClick = LBColumnsClick + OnDragDrop = LBColumnsDragDrop + OnDragOver = LBColumnsDragOver + OnDrawItem = LBColumnsDrawItem + OnEndDrag = LBColumnsEndDrag + OnKeyPress = FormKeyPress + OnStartDrag = LBColumnsStartDrag + end + end + end + object TSSummary: TcxTabSheet + BorderWidth = 8 + Caption = ' Summary ' + ImageIndex = 1 + object PageControl2: TcxPageControl + Left = 0 + Top = 0 + Width = 328 + Height = 279 + ActivePage = TSFooterSummaryItems + Align = alClient + TabOrder = 0 + ClientRectBottom = 279 + ClientRectRight = 328 + ClientRectTop = 24 + object TSFooterSummaryItems: TcxTabSheet + Caption = ' Footer ' + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 185 + Height = 255 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object Panel3: TPanel + Left = 0 + Top = 220 + Width = 185 + Height = 35 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object BAddFooterSummaryItem: TcxButton + Left = 13 + Top = 8 + Width = 75 + Height = 24 + Caption = '&Add' + TabOrder = 0 + OnClick = BAddFooterSummaryItemClick + end + object BDeleteFooterSummaryItem: TcxButton + Left = 97 + Top = 8 + Width = 75 + Height = 24 + Caption = '&Delete' + TabOrder = 1 + OnClick = BDeleteFooterSummaryItemClick + end + end + object Panel4: TPanel + Left = 0 + Top = 0 + Width = 185 + Height = 20 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Label1: TLabel + Left = 4 + Top = 4 + Width = 28 + Height = 13 + Caption = 'Items:' + end + end + object Panel9: TPanel + Left = 0 + Top = 20 + Width = 185 + Height = 200 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object LBFooterSummary: TListBox + Left = 1 + Top = 1 + Width = 183 + Height = 198 + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + PopupMenu = PMFooterSummary + TabOrder = 0 + OnClick = LBFooterSummaryClick + OnKeyPress = FormKeyPress + end + end + end + end + object TSDefaultGroupSummaryItems: TcxTabSheet + Caption = ' Default For Groups ' + ImageIndex = 1 + object Panel5: TPanel + Left = 0 + Top = 0 + Width = 185 + Height = 255 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object Panel6: TPanel + Left = 0 + Top = 220 + Width = 185 + Height = 35 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object BDefaultGroupSummaryAdd: TcxButton + Left = 13 + Top = 8 + Width = 75 + Height = 24 + Caption = '&Add' + TabOrder = 0 + OnClick = BDefaultGroupSummaryAddClick + end + object BDefaultGroupSummaryDelete: TcxButton + Left = 97 + Top = 8 + Width = 75 + Height = 24 + Caption = '&Delete' + TabOrder = 1 + OnClick = BDefaultGroupSummaryDeleteClick + end + end + object Panel7: TPanel + Left = 0 + Top = 0 + Width = 185 + Height = 20 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Label2: TLabel + Left = 4 + Top = 4 + Width = 28 + Height = 13 + Caption = 'Items:' + end + end + object Panel10: TPanel + Left = 0 + Top = 20 + Width = 185 + Height = 200 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object LBDefaultGroupsSummary: TListBox + Left = 1 + Top = 1 + Width = 183 + Height = 198 + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + PopupMenu = PMDefaultGroupsSummary + TabOrder = 0 + OnClick = LBDefaultGroupsSummaryClick + OnKeyPress = FormKeyPress + end + end + end + end + object TabSheet3: TcxTabSheet + Caption = ' Groups ' + ImageIndex = 2 + object Splitter2: TSplitter + Left = 0 + Top = 137 + Width = 328 + Height = 5 + Cursor = crVSplit + Align = alBottom + Beveled = True + end + object PSummaryGroups: TPanel + Left = 0 + Top = 0 + Width = 328 + Height = 137 + Align = alClient + BevelOuter = bvNone + Constraints.MinHeight = 100 + TabOrder = 0 + OnResize = PSummaryGroupsResize + object PGroupItems: TPanel + Left = 166 + Top = 0 + Width = 162 + Height = 137 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + object Panel11: TPanel + Left = 0 + Top = 103 + Width = 162 + Height = 34 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object BGroupSummaryItemAdd: TcxButton + Left = 4 + Top = 6 + Width = 75 + Height = 24 + Caption = '&Add' + TabOrder = 0 + OnClick = BGroupSummaryItemAddClick + end + object BGroupSummaryItemDelete: TcxButton + Left = 83 + Top = 6 + Width = 75 + Height = 24 + Caption = '&Delete' + TabOrder = 1 + OnClick = BGroupSummaryItemDeleteClick + end + end + object Panel12: TPanel + Left = 0 + Top = 0 + Width = 162 + Height = 20 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Label4: TLabel + Left = 4 + Top = 4 + Width = 28 + Height = 13 + Caption = 'Items:' + end + end + object Panel16: TPanel + Left = 0 + Top = 20 + Width = 162 + Height = 83 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object LBGroupSummaryItems: TListBox + Left = 1 + Top = 1 + Width = 160 + Height = 81 + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + PopupMenu = PMGroupSummaryItems + TabOrder = 0 + OnClick = LBGroupSummaryItemsClick + OnKeyPress = FormKeyPress + end + end + end + object PGroups: TPanel + Left = 0 + Top = 0 + Width = 162 + Height = 137 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object Panel14: TPanel + Left = 0 + Top = 103 + Width = 162 + Height = 34 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object BSummaryGroupAdd: TcxButton + Left = 4 + Top = 6 + Width = 75 + Height = 24 + Caption = '&Add' + TabOrder = 0 + OnClick = BSummaryGroupAddClick + end + object BSummaryGroupDelete: TcxButton + Left = 83 + Top = 6 + Width = 75 + Height = 24 + Caption = '&Delete' + TabOrder = 1 + OnClick = BSummaryGroupDeleteClick + end + end + object Panel15: TPanel + Left = 0 + Top = 0 + Width = 162 + Height = 20 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Label5: TLabel + Left = 4 + Top = 4 + Width = 37 + Height = 13 + Caption = 'Groups:' + end + end + object Panel13: TPanel + Left = 0 + Top = 20 + Width = 162 + Height = 83 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object LBSummaryGroups: TListBox + Left = 1 + Top = 1 + Width = 160 + Height = 81 + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + PopupMenu = PMSummaryGroups + TabOrder = 0 + OnClick = LBSummaryGroupsClick + OnKeyPress = FormKeyPress + end + end + end + object PGSeparator: TPanel + Left = 162 + Top = 0 + Width = 4 + Height = 137 + Align = alLeft + BevelOuter = bvNone + TabOrder = 2 + end + end + object PLinks: TPanel + Left = 0 + Top = 142 + Width = 328 + Height = 113 + Align = alBottom + BevelOuter = bvNone + Constraints.MinHeight = 100 + TabOrder = 1 + OnResize = PLinksResize + object PUnlinkedColumns: TPanel + Left = 0 + Top = 0 + Width = 147 + Height = 113 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object Panel19: TPanel + Left = 0 + Top = 0 + Width = 147 + Height = 20 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Label6: TLabel + Left = 4 + Top = 4 + Width = 88 + Height = 13 + Caption = 'Unlinked Columns:' + end + end + object Panel17: TPanel + Left = 0 + Top = 20 + Width = 147 + Height = 93 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 1 + object LBUnlinkedColumns: TListBox + Left = 1 + Top = 1 + Width = 145 + Height = 91 + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + TabOrder = 0 + OnClick = LBUnlinkedColumnsClick + OnKeyPress = FormKeyPress + end + end + end + object PLinkUnlink: TPanel + Left = 147 + Top = 0 + Width = 35 + Height = 113 + Align = alLeft + BevelOuter = bvNone + TabOrder = 1 + object BColumnLink: TcxButton + Left = 5 + Top = 34 + Width = 25 + Height = 25 + Caption = '>' + TabOrder = 0 + OnClick = BColumnLinkClick + end + object BColumnUnlink: TcxButton + Left = 5 + Top = 68 + Width = 25 + Height = 25 + Caption = '<' + TabOrder = 1 + OnClick = BColumnUnlinkClick + end + end + object PLinkedColumns: TPanel + Left = 182 + Top = 0 + Width = 146 + Height = 113 + Align = alClient + BevelOuter = bvNone + TabOrder = 2 + object Panel23: TPanel + Left = 0 + Top = 0 + Width = 146 + Height = 20 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Label7: TLabel + Left = 4 + Top = 4 + Width = 78 + Height = 13 + Caption = 'Linked Columns:' + end + end + object Panel18: TPanel + Left = 0 + Top = 20 + Width = 146 + Height = 93 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 1 + object LBLinkedColumns: TListBox + Left = 1 + Top = 1 + Width = 144 + Height = 91 + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + TabOrder = 0 + OnClick = LBUnlinkedColumnsClick + OnKeyPress = FormKeyPress + end + end + end + end + end + end + end + end + end + object PMColumns: TPopupMenu + Left = 228 + Top = 6 + object MIColumnAdd: TMenuItem + Caption = '&Add' + ShortCut = 45 + OnClick = BColumnAddClick + end + object MIColumnDelete: TMenuItem + Caption = '&Delete' + ShortCut = 46 + OnClick = BColumnDeleteClick + end + object MIColumnRestore: TMenuItem + Caption = 'Rest&ore Defaults' + OnClick = BColumnRestoreClick + end + object N2: TMenuItem + Caption = '-' + end + object MIColumnMoveUp: TMenuItem + Caption = 'Move Up' + ShortCut = 16422 + OnClick = BColumnMoveUpClick + end + object MIColumnMoveDown: TMenuItem + Caption = 'Move Down' + ShortCut = 16424 + OnClick = BColumnMoveDownClick + end + object N1: TMenuItem + Caption = '-' + end + object MIColumnSelectAll: TMenuItem + Caption = '&Select All' + ShortCut = 16449 + OnClick = MIColumnSelectAllClick + end + end + object PMFooterSummary: TPopupMenu + Left = 230 + Top = 90 + object MIFooterSummaryAdd: TMenuItem + Caption = '&Add' + ShortCut = 45 + OnClick = BAddFooterSummaryItemClick + end + object MIFooterSummaryDelete: TMenuItem + Caption = '&Delete' + ShortCut = 46 + OnClick = BDeleteFooterSummaryItemClick + end + object MenuItem4a: TMenuItem + Caption = '-' + end + object MIFooterSummarySelectAll: TMenuItem + Caption = '&Select All' + ShortCut = 16449 + OnClick = MIFooterSummarySelectAllClick + end + end + object PMDefaultGroupsSummary: TPopupMenu + Left = 230 + Top = 130 + object MIDefaultGroupSummaryAdd: TMenuItem + Caption = '&Add' + ShortCut = 45 + OnClick = BDefaultGroupSummaryAddClick + end + object MIDefaultGroupSummaryDelete: TMenuItem + Caption = '&Delete' + ShortCut = 46 + OnClick = BDefaultGroupSummaryDeleteClick + end + object MenuItem3b: TMenuItem + Caption = '-' + end + object MIDefaultGroupSummarySelectAll: TMenuItem + Caption = '&Select All' + ShortCut = 16449 + OnClick = MIDefaultGroupSummarySelectAllClick + end + end + object PMSummaryGroups: TPopupMenu + Left = 230 + Top = 170 + object MISummaryGroupAdd: TMenuItem + Caption = '&Add' + ShortCut = 45 + OnClick = BSummaryGroupAddClick + end + object MISummaryGroupDelete: TMenuItem + Caption = '&Delete' + ShortCut = 46 + OnClick = BSummaryGroupDeleteClick + end + object MenuItem5d: TMenuItem + Caption = '-' + end + object MISummaryGroupSelectAll: TMenuItem + Caption = '&Select All' + ShortCut = 16449 + OnClick = MISummaryGroupSelectAllClick + end + end + object PMGroupSummaryItems: TPopupMenu + Left = 230 + Top = 210 + object MIGroupSummaryItemsAdd: TMenuItem + Caption = '&Add' + ShortCut = 45 + OnClick = BGroupSummaryItemAddClick + end + object MIGroupSummaryItemsDelete: TMenuItem + Caption = '&Delete' + ShortCut = 46 + OnClick = BGroupSummaryItemDeleteClick + end + object MenuItem6c: TMenuItem + Caption = '-' + end + object MIGroupSummaryItemsSelectAll: TMenuItem + Caption = '&Select All' + ShortCut = 16449 + OnClick = MIGroupSummaryItemsSelectAllClick + end + end +end diff --git a/official/x.35/Lib/D11/cxDB.dcu b/official/x.35/Lib/D11/cxDB.dcu new file mode 100644 index 00000000..955458d9 Binary files /dev/null and b/official/x.35/Lib/D11/cxDB.dcu differ diff --git a/official/x.35/Lib/D11/cxDBCheckComboBox.dcu b/official/x.35/Lib/D11/cxDBCheckComboBox.dcu new file mode 100644 index 00000000..408453b1 Binary files /dev/null and b/official/x.35/Lib/D11/cxDBCheckComboBox.dcu differ diff --git a/official/x.35/Lib/D11/cxDBCheckGroup.dcu b/official/x.35/Lib/D11/cxDBCheckGroup.dcu new file mode 100644 index 00000000..beb9a22a Binary files /dev/null and b/official/x.35/Lib/D11/cxDBCheckGroup.dcu differ diff --git a/official/x.35/Lib/D11/cxDBCheckListBox.dcu b/official/x.35/Lib/D11/cxDBCheckListBox.dcu new file mode 100644 index 00000000..2b5cc154 Binary files /dev/null and b/official/x.35/Lib/D11/cxDBCheckListBox.dcu differ diff --git a/official/x.35/Lib/D11/cxDBColorComboBox.dcu b/official/x.35/Lib/D11/cxDBColorComboBox.dcu new file mode 100644 index 00000000..c33a5069 Binary files /dev/null and b/official/x.35/Lib/D11/cxDBColorComboBox.dcu differ diff --git a/official/x.35/Lib/D11/cxDBData.dcu b/official/x.35/Lib/D11/cxDBData.dcu new file mode 100644 index 00000000..f4cec8d8 Binary files /dev/null and b/official/x.35/Lib/D11/cxDBData.dcu differ diff --git a/official/x.35/Lib/D11/cxDBEdit.dcu b/official/x.35/Lib/D11/cxDBEdit.dcu new file mode 100644 index 00000000..0bdf8669 Binary files /dev/null and b/official/x.35/Lib/D11/cxDBEdit.dcu differ diff --git a/official/x.35/Lib/D11/cxDBEditRepository.dcu b/official/x.35/Lib/D11/cxDBEditRepository.dcu new file mode 100644 index 00000000..e8a76e1f Binary files /dev/null and b/official/x.35/Lib/D11/cxDBEditRepository.dcu differ diff --git a/official/x.35/Lib/D11/cxDBExtLookupComboBox.dcu b/official/x.35/Lib/D11/cxDBExtLookupComboBox.dcu new file mode 100644 index 00000000..b0b90ea5 Binary files /dev/null and b/official/x.35/Lib/D11/cxDBExtLookupComboBox.dcu differ diff --git a/official/x.35/Lib/D11/cxDBFilter.dcu b/official/x.35/Lib/D11/cxDBFilter.dcu new file mode 100644 index 00000000..45ad4753 Binary files /dev/null and b/official/x.35/Lib/D11/cxDBFilter.dcu differ diff --git a/official/x.35/Lib/D11/cxDBFilterControl.dcu b/official/x.35/Lib/D11/cxDBFilterControl.dcu new file mode 100644 index 00000000..0fb53ccb Binary files /dev/null and b/official/x.35/Lib/D11/cxDBFilterControl.dcu differ diff --git a/official/x.35/Lib/D11/cxDBFontNameComboBox.dcu b/official/x.35/Lib/D11/cxDBFontNameComboBox.dcu new file mode 100644 index 00000000..2568fbec Binary files /dev/null and b/official/x.35/Lib/D11/cxDBFontNameComboBox.dcu differ diff --git a/official/x.35/Lib/D11/cxDBGridConverter.dcu b/official/x.35/Lib/D11/cxDBGridConverter.dcu new file mode 100644 index 00000000..023cb432 Binary files /dev/null and b/official/x.35/Lib/D11/cxDBGridConverter.dcu differ diff --git a/official/x.35/Lib/D11/cxDBLabel.dcu b/official/x.35/Lib/D11/cxDBLabel.dcu new file mode 100644 index 00000000..4c40e360 Binary files /dev/null and b/official/x.35/Lib/D11/cxDBLabel.dcu differ diff --git a/official/x.35/Lib/D11/cxDBLookupComboBox.dcu b/official/x.35/Lib/D11/cxDBLookupComboBox.dcu new file mode 100644 index 00000000..b659058e Binary files /dev/null and b/official/x.35/Lib/D11/cxDBLookupComboBox.dcu differ diff --git a/official/x.35/Lib/D11/cxDBLookupEdit.dcu b/official/x.35/Lib/D11/cxDBLookupEdit.dcu new file mode 100644 index 00000000..c5ce4086 Binary files /dev/null and b/official/x.35/Lib/D11/cxDBLookupEdit.dcu differ diff --git a/official/x.35/Lib/D11/cxDBNavigator.dcu b/official/x.35/Lib/D11/cxDBNavigator.dcu new file mode 100644 index 00000000..ad4f4530 Binary files /dev/null and b/official/x.35/Lib/D11/cxDBNavigator.dcu differ diff --git a/official/x.35/Lib/D11/cxDBProgressBar.dcu b/official/x.35/Lib/D11/cxDBProgressBar.dcu new file mode 100644 index 00000000..88e8370b Binary files /dev/null and b/official/x.35/Lib/D11/cxDBProgressBar.dcu differ diff --git a/official/x.35/Lib/D11/cxDBRichEdit.dcu b/official/x.35/Lib/D11/cxDBRichEdit.dcu new file mode 100644 index 00000000..fdc25016 Binary files /dev/null and b/official/x.35/Lib/D11/cxDBRichEdit.dcu differ diff --git a/official/x.35/Lib/D11/cxDBShellComboBox.dcu b/official/x.35/Lib/D11/cxDBShellComboBox.dcu new file mode 100644 index 00000000..9d08a41a Binary files /dev/null and b/official/x.35/Lib/D11/cxDBShellComboBox.dcu differ diff --git a/official/x.35/Lib/D11/cxDBTL.dcu b/official/x.35/Lib/D11/cxDBTL.dcu new file mode 100644 index 00000000..617052cc Binary files /dev/null and b/official/x.35/Lib/D11/cxDBTL.dcu differ diff --git a/official/x.35/Lib/D11/cxDBTrackBar.dcu b/official/x.35/Lib/D11/cxDBTrackBar.dcu new file mode 100644 index 00000000..165b9618 Binary files /dev/null and b/official/x.35/Lib/D11/cxDBTrackBar.dcu differ diff --git a/official/x.35/Lib/D11/cxDBVGrid.dcu b/official/x.35/Lib/D11/cxDBVGrid.dcu new file mode 100644 index 00000000..907d80bb Binary files /dev/null and b/official/x.35/Lib/D11/cxDBVGrid.dcu differ diff --git a/official/x.35/Lib/D11/cxDWMApi.dcu b/official/x.35/Lib/D11/cxDWMApi.dcu new file mode 100644 index 00000000..75e7c8f1 Binary files /dev/null and b/official/x.35/Lib/D11/cxDWMApi.dcu differ diff --git a/official/x.35/Lib/D11/cxDXGridConverter.dcu b/official/x.35/Lib/D11/cxDXGridConverter.dcu new file mode 100644 index 00000000..badaa090 Binary files /dev/null and b/official/x.35/Lib/D11/cxDXGridConverter.dcu differ diff --git a/official/x.35/Lib/D11/cxDXTLConverter.dcu b/official/x.35/Lib/D11/cxDXTLConverter.dcu new file mode 100644 index 00000000..9ec8a47d Binary files /dev/null and b/official/x.35/Lib/D11/cxDXTLConverter.dcu differ diff --git a/official/x.35/Lib/D11/cxData.dcu b/official/x.35/Lib/D11/cxData.dcu new file mode 100644 index 00000000..dd97514b Binary files /dev/null and b/official/x.35/Lib/D11/cxData.dcu differ diff --git a/official/x.35/Lib/D11/cxDataConsts.dcu b/official/x.35/Lib/D11/cxDataConsts.dcu new file mode 100644 index 00000000..ea4138ad Binary files /dev/null and b/official/x.35/Lib/D11/cxDataConsts.dcu differ diff --git a/official/x.35/Lib/D11/cxDataD11.bpl b/official/x.35/Lib/D11/cxDataD11.bpl new file mode 100644 index 00000000..f525df55 Binary files /dev/null and b/official/x.35/Lib/D11/cxDataD11.bpl differ diff --git a/official/x.35/Lib/D11/cxDataD11.dcp b/official/x.35/Lib/D11/cxDataD11.dcp new file mode 100644 index 00000000..bfe2482a Binary files /dev/null and b/official/x.35/Lib/D11/cxDataD11.dcp differ diff --git a/official/x.35/Lib/D11/cxDataD11.dcu b/official/x.35/Lib/D11/cxDataD11.dcu new file mode 100644 index 00000000..18eb3c25 Binary files /dev/null and b/official/x.35/Lib/D11/cxDataD11.dcu differ diff --git a/official/x.35/Lib/D11/cxDataStorage.dcu b/official/x.35/Lib/D11/cxDataStorage.dcu new file mode 100644 index 00000000..626458c0 Binary files /dev/null and b/official/x.35/Lib/D11/cxDataStorage.dcu differ diff --git a/official/x.35/Lib/D11/cxDataUtils.dcu b/official/x.35/Lib/D11/cxDataUtils.dcu new file mode 100644 index 00000000..269f3105 Binary files /dev/null and b/official/x.35/Lib/D11/cxDataUtils.dcu differ diff --git a/official/x.35/Lib/D11/cxDateNavigator.dcu b/official/x.35/Lib/D11/cxDateNavigator.dcu new file mode 100644 index 00000000..31d3fce2 Binary files /dev/null and b/official/x.35/Lib/D11/cxDateNavigator.dcu differ diff --git a/official/x.35/Lib/D11/cxDateUtils.dcu b/official/x.35/Lib/D11/cxDateUtils.dcu new file mode 100644 index 00000000..c0621a34 Binary files /dev/null and b/official/x.35/Lib/D11/cxDateUtils.dcu differ diff --git a/official/x.35/Lib/D11/cxDesignWindow.dfm b/official/x.35/Lib/D11/cxDesignWindow.dfm new file mode 100644 index 00000000..5bb23dc0 --- /dev/null +++ b/official/x.35/Lib/D11/cxDesignWindow.dfm @@ -0,0 +1,15 @@ +object cxDesignWindow: TcxDesignWindow + Left = 612 + Top = 120 + Width = 320 + Height = 240 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + PixelsPerInch = 96 + TextHeight = 13 +end diff --git a/official/x.35/Lib/D11/cxDesignWindows.dcu b/official/x.35/Lib/D11/cxDesignWindows.dcu new file mode 100644 index 00000000..9bbff3d2 Binary files /dev/null and b/official/x.35/Lib/D11/cxDesignWindows.dcu differ diff --git a/official/x.35/Lib/D11/cxDesignWindows.dfm b/official/x.35/Lib/D11/cxDesignWindows.dfm new file mode 100644 index 00000000..125d288d --- /dev/null +++ b/official/x.35/Lib/D11/cxDesignWindows.dfm @@ -0,0 +1,18 @@ +object cxDesignFormEditor: TcxDesignFormEditor + Left = 612 + Top = 120 + Width = 320 + Height = 240 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + OnClose = FormClose + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 +end diff --git a/official/x.35/Lib/D11/cxDrawTextUtils.dcu b/official/x.35/Lib/D11/cxDrawTextUtils.dcu new file mode 100644 index 00000000..bd050c0c Binary files /dev/null and b/official/x.35/Lib/D11/cxDrawTextUtils.dcu differ diff --git a/official/x.35/Lib/D11/cxDropDownEdit.dcu b/official/x.35/Lib/D11/cxDropDownEdit.dcu new file mode 100644 index 00000000..eaaa984f Binary files /dev/null and b/official/x.35/Lib/D11/cxDropDownEdit.dcu differ diff --git a/official/x.35/Lib/D11/cxEdit.dcu b/official/x.35/Lib/D11/cxEdit.dcu new file mode 100644 index 00000000..92128bed Binary files /dev/null and b/official/x.35/Lib/D11/cxEdit.dcu differ diff --git a/official/x.35/Lib/D11/cxEdit.res b/official/x.35/Lib/D11/cxEdit.res new file mode 100644 index 00000000..81cce5f1 Binary files /dev/null and b/official/x.35/Lib/D11/cxEdit.res differ diff --git a/official/x.35/Lib/D11/cxEditConsts.dcu b/official/x.35/Lib/D11/cxEditConsts.dcu new file mode 100644 index 00000000..a4521f8f Binary files /dev/null and b/official/x.35/Lib/D11/cxEditConsts.dcu differ diff --git a/official/x.35/Lib/D11/cxEditDBRegisteredRepositoryItems.dcu b/official/x.35/Lib/D11/cxEditDBRegisteredRepositoryItems.dcu new file mode 100644 index 00000000..151fc181 Binary files /dev/null and b/official/x.35/Lib/D11/cxEditDBRegisteredRepositoryItems.dcu differ diff --git a/official/x.35/Lib/D11/cxEditDataRegisteredRepositoryItems.dcu b/official/x.35/Lib/D11/cxEditDataRegisteredRepositoryItems.dcu new file mode 100644 index 00000000..c0e5bd78 Binary files /dev/null and b/official/x.35/Lib/D11/cxEditDataRegisteredRepositoryItems.dcu differ diff --git a/official/x.35/Lib/D11/cxEditMaskEditor.dcu b/official/x.35/Lib/D11/cxEditMaskEditor.dcu new file mode 100644 index 00000000..60977213 Binary files /dev/null and b/official/x.35/Lib/D11/cxEditMaskEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxEditMaskEditor.dfm b/official/x.35/Lib/D11/cxEditMaskEditor.dfm new file mode 100644 index 00000000..493a21fb --- /dev/null +++ b/official/x.35/Lib/D11/cxEditMaskEditor.dfm @@ -0,0 +1,270 @@ +object cxEditMaskEditorDlg: TcxEditMaskEditorDlg + Left = 353 + Top = 212 + BorderStyle = bsDialog + Caption = 'Input Mask Editor' + ClientHeight = 322 + ClientWidth = 543 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + KeyPreview = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 8 + Top = 8 + Width = 49 + Height = 13 + Caption = 'Mask kind' + Transparent = True + end + object Bevel1: TBevel + Left = 7 + Top = 37 + Width = 266 + Height = 2 + end + object cxMaskKindPickEdit1: TcxComboBox + Tag = 4 + Left = 64 + Top = 4 + Properties.DropDownListStyle = lsFixedList + Properties.Items.Strings = ( + 'Standard' + 'Regular expression' + 'Extended regular expression') + Properties.OnChange = cxMaskKindPickEdit1PropertiesChange + TabOrder = 0 + Width = 193 + end + object ButtonsPanel: TPanel + Left = 0 + Top = 281 + Width = 543 + Height = 41 + Align = alBottom + BevelOuter = bvNone + TabOrder = 3 + object CancelButton: TcxButton + Left = 440 + Top = 5 + Width = 93 + Height = 25 + Caption = 'Cancel' + TabOrder = 2 + OnClick = CancelButtonClick + end + object OKButton: TcxButton + Left = 336 + Top = 5 + Width = 93 + Height = 25 + Caption = 'OK' + TabOrder = 1 + OnClick = OKButtonClick + end + object MasksButton: TcxButton + Left = 8 + Top = 5 + Width = 93 + Height = 25 + Caption = 'Masks...' + TabOrder = 0 + OnClick = MasksButtonClick + end + end + object RegExprMaskPanel: TPanel + Left = 0 + Top = 42 + Width = 543 + Height = 239 + Align = alBottom + BevelOuter = bvNone + TabOrder = 2 + Visible = False + object Label2: TLabel + Left = 4 + Top = 12 + Width = 55 + Height = 13 + Caption = 'Input mask:' + Transparent = True + end + object Label3: TLabel + Left = 4 + Top = 48 + Width = 50 + Height = 13 + Caption = 'Test input:' + Transparent = True + end + object Label4: TLabel + Left = 12 + Top = 96 + Width = 38 + Height = 13 + Caption = 'Sample:' + Transparent = True + end + object Label5: TLabel + Left = 192 + Top = 96 + Width = 56 + Height = 13 + Caption = 'Description:' + Transparent = True + end + object Bevel2: TBevel + Left = 8 + Top = 80 + Width = 529 + Height = 2 + end + object cxEditMaskEdit: TcxTextEdit + Tag = 7 + Left = 64 + Top = 8 + TabOrder = 0 + OnKeyDown = cxEditMaskEditKeyDown + Width = 473 + end + object cxMaskEdit1: TcxMaskEdit + Tag = 4 + Left = 64 + Top = 44 + Properties.IgnoreMaskBlank = True + Properties.MaskKind = emkRegExprEx + Properties.MaxLength = 0 + TabOrder = 1 + OnEnter = cxMaskEdit1Enter + Width = 473 + end + object Memo1: TcxMemo + Left = 192 + Top = 112 + TabOrder = 2 + Height = 121 + Width = 345 + end + object ListBox1: TcxListBox + Left = 8 + Top = 112 + Width = 177 + Height = 121 + ItemHeight = 13 + TabOrder = 3 + OnClick = ListBox1Click + OnExit = ListBox1Exit + end + end + object StandardMaskPanel: TPanel + Left = 0 + Top = 42 + Width = 543 + Height = 239 + BevelOuter = bvNone + TabOrder = 1 + object Bevel3: TBevel + Left = 4 + Top = 188 + Width = 261 + Height = 2 + end + object Label6: TLabel + Left = 8 + Top = 4 + Width = 55 + Height = 13 + Caption = 'Input mask:' + Transparent = True + end + object Label7: TLabel + Left = 8 + Top = 196 + Width = 51 + Height = 13 + Caption = 'Test Input:' + Transparent = True + end + object Label8: TLabel + Left = 272 + Top = 4 + Width = 66 + Height = 13 + Caption = 'Sample mask:' + Transparent = True + end + object Label9: TLabel + Left = 140 + Top = 64 + Width = 98 + Height = 13 + Caption = 'Character for blanks:' + Transparent = True + end + object cxTextEdit1: TcxTextEdit + Tag = 21 + Left = 8 + Top = 20 + TabOrder = 0 + OnExit = cxTextEdit1Exit + OnKeyDown = cxTextEdit1KeyDown + Width = 253 + end + object cxMaskEdit2: TcxMaskEdit + Tag = 22 + Left = 8 + Top = 212 + Properties.IgnoreMaskBlank = True + TabOrder = 3 + Width = 253 + end + object cxTextEdit2: TcxTextEdit + Tag = 23 + Left = 244 + Top = 60 + Properties.MaxLength = 1 + Properties.OnChange = cxTextEdit2PropertiesChange + TabOrder = 1 + OnExit = cxTextEdit2Exit + Width = 17 + end + object cxCheckBox1: TcxCheckBox + Left = 4 + Top = 160 + Caption = 'Save literal characters' + Properties.OnChange = cxCheckBox1PropertiesChange + TabOrder = 2 + Transparent = True + Width = 153 + end + object ListView1: TListView + Left = 272 + Top = 20 + Width = 261 + Height = 213 + Columns = < + item + AutoSize = True + Caption = 'Description' + end + item + AutoSize = True + Caption = 'Sample' + end> + ReadOnly = True + RowSelect = True + TabOrder = 4 + ViewStyle = vsReport + OnSelectItem = ListView1SelectItem + end + end +end diff --git a/official/x.35/Lib/D11/cxEditPaintUtils.dcu b/official/x.35/Lib/D11/cxEditPaintUtils.dcu new file mode 100644 index 00000000..e0a4f7b5 Binary files /dev/null and b/official/x.35/Lib/D11/cxEditPaintUtils.dcu differ diff --git a/official/x.35/Lib/D11/cxEditPropEditors.dcu b/official/x.35/Lib/D11/cxEditPropEditors.dcu new file mode 100644 index 00000000..1e2c0838 Binary files /dev/null and b/official/x.35/Lib/D11/cxEditPropEditors.dcu differ diff --git a/official/x.35/Lib/D11/cxEditReg.dcr b/official/x.35/Lib/D11/cxEditReg.dcr new file mode 100644 index 00000000..448bf805 Binary files /dev/null and b/official/x.35/Lib/D11/cxEditReg.dcr differ diff --git a/official/x.35/Lib/D11/cxEditReg.dcu b/official/x.35/Lib/D11/cxEditReg.dcu new file mode 100644 index 00000000..6451af98 Binary files /dev/null and b/official/x.35/Lib/D11/cxEditReg.dcu differ diff --git a/official/x.35/Lib/D11/cxEditRegisteredRepositoryItems.dcu b/official/x.35/Lib/D11/cxEditRegisteredRepositoryItems.dcu new file mode 100644 index 00000000..727e34cd Binary files /dev/null and b/official/x.35/Lib/D11/cxEditRegisteredRepositoryItems.dcu differ diff --git a/official/x.35/Lib/D11/cxEditRepositoryEditor.dcu b/official/x.35/Lib/D11/cxEditRepositoryEditor.dcu new file mode 100644 index 00000000..87c9fc90 Binary files /dev/null and b/official/x.35/Lib/D11/cxEditRepositoryEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxEditRepositoryEditor.dfm b/official/x.35/Lib/D11/cxEditRepositoryEditor.dfm new file mode 100644 index 00000000..604d88ab --- /dev/null +++ b/official/x.35/Lib/D11/cxEditRepositoryEditor.dfm @@ -0,0 +1,86 @@ +inherited cxEditRepositoryEditor: TcxEditRepositoryEditor + Left = 363 + Top = 194 + Width = 353 + Height = 416 + Caption = 'EditRepository editor' + Constraints.MinHeight = 200 + Constraints.MinWidth = 350 + PopupMenu = PopupMenu1 + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object LBItems: TListBox + Left = 0 + Top = 0 + Width = 258 + Height = 382 + Align = alClient + ItemHeight = 13 + MultiSelect = True + Sorted = True + TabOrder = 0 + OnClick = LBItemsClick + end + object Panel1: TPanel + Left = 258 + Top = 0 + Width = 87 + Height = 382 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object btAdd: TButton + Left = 6 + Top = 8 + Width = 75 + Height = 25 + Caption = '&Add...' + TabOrder = 0 + OnClick = btAddClick + end + object btDelete: TButton + Left = 6 + Top = 40 + Width = 75 + Height = 25 + Caption = '&Delete' + TabOrder = 1 + OnClick = btDeleteClick + end + object btClose: TButton + Left = 6 + Top = 356 + Width = 75 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = '&Close' + TabOrder = 2 + OnClick = btCloseClick + end + end + object PopupMenu1: TPopupMenu + Left = 32 + Top = 16 + object miAdd: TMenuItem + Caption = 'Add' + ShortCut = 45 + OnClick = miAddClick + end + object miDelete: TMenuItem + Caption = 'Delete' + Enabled = False + ShortCut = 46 + OnClick = miDeleteClick + end + object N1: TMenuItem + Caption = '-' + end + object miSelectAll: TMenuItem + Caption = 'Select all' + Enabled = False + ShortCut = 16449 + OnClick = miSelectAllClick + end + end +end diff --git a/official/x.35/Lib/D11/cxEditRepositoryItems.dcu b/official/x.35/Lib/D11/cxEditRepositoryItems.dcu new file mode 100644 index 00000000..9277a321 Binary files /dev/null and b/official/x.35/Lib/D11/cxEditRepositoryItems.dcu differ diff --git a/official/x.35/Lib/D11/cxEditUtils.dcu b/official/x.35/Lib/D11/cxEditUtils.dcu new file mode 100644 index 00000000..2fd1400d Binary files /dev/null and b/official/x.35/Lib/D11/cxEditUtils.dcu differ diff --git a/official/x.35/Lib/D11/cxEditorsD11.bpl b/official/x.35/Lib/D11/cxEditorsD11.bpl new file mode 100644 index 00000000..07187afe Binary files /dev/null and b/official/x.35/Lib/D11/cxEditorsD11.bpl differ diff --git a/official/x.35/Lib/D11/cxEditorsD11.dcp b/official/x.35/Lib/D11/cxEditorsD11.dcp new file mode 100644 index 00000000..dd6b69e9 Binary files /dev/null and b/official/x.35/Lib/D11/cxEditorsD11.dcp differ diff --git a/official/x.35/Lib/D11/cxEditorsD11.dcu b/official/x.35/Lib/D11/cxEditorsD11.dcu new file mode 100644 index 00000000..cac075e5 Binary files /dev/null and b/official/x.35/Lib/D11/cxEditorsD11.dcu differ diff --git a/official/x.35/Lib/D11/cxExport.dcu b/official/x.35/Lib/D11/cxExport.dcu new file mode 100644 index 00000000..5b8370aa Binary files /dev/null and b/official/x.35/Lib/D11/cxExport.dcu differ diff --git a/official/x.35/Lib/D11/cxExportD11.bpl b/official/x.35/Lib/D11/cxExportD11.bpl new file mode 100644 index 00000000..a263b979 Binary files /dev/null and b/official/x.35/Lib/D11/cxExportD11.bpl differ diff --git a/official/x.35/Lib/D11/cxExportD11.dcp b/official/x.35/Lib/D11/cxExportD11.dcp new file mode 100644 index 00000000..6e176e9e Binary files /dev/null and b/official/x.35/Lib/D11/cxExportD11.dcp differ diff --git a/official/x.35/Lib/D11/cxExportD11.dcu b/official/x.35/Lib/D11/cxExportD11.dcu new file mode 100644 index 00000000..4b004c59 Binary files /dev/null and b/official/x.35/Lib/D11/cxExportD11.dcu differ diff --git a/official/x.35/Lib/D11/cxExportSchedulerLink.dcu b/official/x.35/Lib/D11/cxExportSchedulerLink.dcu new file mode 100644 index 00000000..98832e1c Binary files /dev/null and b/official/x.35/Lib/D11/cxExportSchedulerLink.dcu differ diff --git a/official/x.35/Lib/D11/cxExportStrs.dcu b/official/x.35/Lib/D11/cxExportStrs.dcu new file mode 100644 index 00000000..5db68a9b Binary files /dev/null and b/official/x.35/Lib/D11/cxExportStrs.dcu differ diff --git a/official/x.35/Lib/D11/cxExportTL4Link.dcu b/official/x.35/Lib/D11/cxExportTL4Link.dcu new file mode 100644 index 00000000..231ccbc7 Binary files /dev/null and b/official/x.35/Lib/D11/cxExportTL4Link.dcu differ diff --git a/official/x.35/Lib/D11/cxExportVGLink.dcu b/official/x.35/Lib/D11/cxExportVGLink.dcu new file mode 100644 index 00000000..3f9a8281 Binary files /dev/null and b/official/x.35/Lib/D11/cxExportVGLink.dcu differ diff --git a/official/x.35/Lib/D11/cxExtEditConsts.dcu b/official/x.35/Lib/D11/cxExtEditConsts.dcu new file mode 100644 index 00000000..941f2e59 Binary files /dev/null and b/official/x.35/Lib/D11/cxExtEditConsts.dcu differ diff --git a/official/x.35/Lib/D11/cxExtEditReg.dcr b/official/x.35/Lib/D11/cxExtEditReg.dcr new file mode 100644 index 00000000..dd736fed Binary files /dev/null and b/official/x.35/Lib/D11/cxExtEditReg.dcr differ diff --git a/official/x.35/Lib/D11/cxExtEditReg.dcu b/official/x.35/Lib/D11/cxExtEditReg.dcu new file mode 100644 index 00000000..a33dc8ff Binary files /dev/null and b/official/x.35/Lib/D11/cxExtEditReg.dcu differ diff --git a/official/x.35/Lib/D11/cxExtEditRepositoryItems.dcu b/official/x.35/Lib/D11/cxExtEditRepositoryItems.dcu new file mode 100644 index 00000000..f1e178e2 Binary files /dev/null and b/official/x.35/Lib/D11/cxExtEditRepositoryItems.dcu differ diff --git a/official/x.35/Lib/D11/cxExtEditUtils.dcu b/official/x.35/Lib/D11/cxExtEditUtils.dcu new file mode 100644 index 00000000..defea7c0 Binary files /dev/null and b/official/x.35/Lib/D11/cxExtEditUtils.dcu differ diff --git a/official/x.35/Lib/D11/cxExtEditorsD11.bpl b/official/x.35/Lib/D11/cxExtEditorsD11.bpl new file mode 100644 index 00000000..4f584684 Binary files /dev/null and b/official/x.35/Lib/D11/cxExtEditorsD11.bpl differ diff --git a/official/x.35/Lib/D11/cxExtEditorsD11.dcp b/official/x.35/Lib/D11/cxExtEditorsD11.dcp new file mode 100644 index 00000000..7916b550 Binary files /dev/null and b/official/x.35/Lib/D11/cxExtEditorsD11.dcp differ diff --git a/official/x.35/Lib/D11/cxExtEditorsD11.dcu b/official/x.35/Lib/D11/cxExtEditorsD11.dcu new file mode 100644 index 00000000..36e0989e Binary files /dev/null and b/official/x.35/Lib/D11/cxExtEditorsD11.dcu differ diff --git a/official/x.35/Lib/D11/cxFilter.dcu b/official/x.35/Lib/D11/cxFilter.dcu new file mode 100644 index 00000000..e319ab39 Binary files /dev/null and b/official/x.35/Lib/D11/cxFilter.dcu differ diff --git a/official/x.35/Lib/D11/cxFilterConsts.dcu b/official/x.35/Lib/D11/cxFilterConsts.dcu new file mode 100644 index 00000000..c79ec927 Binary files /dev/null and b/official/x.35/Lib/D11/cxFilterConsts.dcu differ diff --git a/official/x.35/Lib/D11/cxFilterControl.dcu b/official/x.35/Lib/D11/cxFilterControl.dcu new file mode 100644 index 00000000..767d5c8b Binary files /dev/null and b/official/x.35/Lib/D11/cxFilterControl.dcu differ diff --git a/official/x.35/Lib/D11/cxFilterControlDialog.dcu b/official/x.35/Lib/D11/cxFilterControlDialog.dcu new file mode 100644 index 00000000..2ea60219 Binary files /dev/null and b/official/x.35/Lib/D11/cxFilterControlDialog.dcu differ diff --git a/official/x.35/Lib/D11/cxFilterControlDialog.dfm b/official/x.35/Lib/D11/cxFilterControlDialog.dfm new file mode 100644 index 00000000..55779e1d --- /dev/null +++ b/official/x.35/Lib/D11/cxFilterControlDialog.dfm @@ -0,0 +1,112 @@ +object fmFilterControlDialog: TfmFilterControlDialog + Left = 360 + Top = 200 + BorderIcons = [biSystemMenu] + Caption = 'fmFilterControlDialog' + AutoScroll = False + ClientHeight = 316 + ClientWidth = 552 + Color = clBtnFace + Constraints.MinHeight = 165 + Constraints.MinWidth = 560 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Icon.Data = { + 0000010001001010100000000000280100001600000028000000100000002000 + 00000100040000000000C0000000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000008 + 8EEE8FFFF8FF000888888888888800088EEE8FFFF8FF00088888888888880008 + 8E6677FFF8FF0007700007777777000780F607888788000770F6077777770008 + 80F807888888000880F807888888000808886070000000706888660700000706 + 8F88866070000068F88888660700068FFF88886660000000000000000000C000 + 0000C0000000C0000000C0000000C0000000C0000000C0000000C0000000C000 + 0000C0000000C0000000C00F000080070000800300000003000000030000} + KeyPreview = True + Position = poDefaultPosOnly + OldCreateOrder = False + OnClose = FormClose + OnKeyDown = FormKeyDown + OnKeyPress = FormKeyPress + PixelsPerInch = 96 + TextHeight = 13 + object pnlBottom: TPanel + Left = 0 + Top = 278 + Width = 552 + Height = 38 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + object btOpen: TcxButton + Left = 6 + Top = 8 + Width = 100 + Height = 23 + Hint = 'Open|Opens an existing filter' + Caption = '&Open...' + TabOrder = 0 + OnClick = acOpenExecute + end + object btSave: TcxButton + Left = 112 + Top = 8 + Width = 100 + Height = 23 + Hint = 'Save As|Saves the active filter with a new name' + Caption = 'Save &As...' + TabOrder = 1 + OnClick = acSaveExecute + end + object pnlBottomRight: TPanel + Left = 234 + Top = 0 + Width = 318 + Height = 38 + Align = alRight + BevelOuter = bvNone + TabOrder = 2 + object btApply: TcxButton + Left = 212 + Top = 8 + Width = 100 + Height = 23 + Caption = 'Apply' + TabOrder = 2 + OnClick = acApplyExecute + end + object btCancel: TcxButton + Left = 106 + Top = 8 + Width = 100 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + object btOk: TcxButton + Left = 0 + Top = 8 + Width = 100 + Height = 23 + Caption = 'Ok' + ModalResult = 1 + TabOrder = 0 + OnClick = acOkExecute + end + end + end + object OpenDialog: TOpenDialog + Left = 240 + Top = 8 + end + object SaveDialog: TSaveDialog + Options = [ofOverwritePrompt, ofHideReadOnly, ofEnableSizing] + Left = 272 + Top = 8 + end +end diff --git a/official/x.35/Lib/D11/cxFilterControlReg.dcr b/official/x.35/Lib/D11/cxFilterControlReg.dcr new file mode 100644 index 00000000..8791bda1 Binary files /dev/null and b/official/x.35/Lib/D11/cxFilterControlReg.dcr differ diff --git a/official/x.35/Lib/D11/cxFilterControlReg.dcu b/official/x.35/Lib/D11/cxFilterControlReg.dcu new file mode 100644 index 00000000..384b9940 Binary files /dev/null and b/official/x.35/Lib/D11/cxFilterControlReg.dcu differ diff --git a/official/x.35/Lib/D11/cxFilterControlStrs.dcu b/official/x.35/Lib/D11/cxFilterControlStrs.dcu new file mode 100644 index 00000000..7dec3bed Binary files /dev/null and b/official/x.35/Lib/D11/cxFilterControlStrs.dcu differ diff --git a/official/x.35/Lib/D11/cxFilterControlUtils.dcu b/official/x.35/Lib/D11/cxFilterControlUtils.dcu new file mode 100644 index 00000000..fa2c73f4 Binary files /dev/null and b/official/x.35/Lib/D11/cxFilterControlUtils.dcu differ diff --git a/official/x.35/Lib/D11/cxFilterDialog.dcu b/official/x.35/Lib/D11/cxFilterDialog.dcu new file mode 100644 index 00000000..c3e380f8 Binary files /dev/null and b/official/x.35/Lib/D11/cxFilterDialog.dcu differ diff --git a/official/x.35/Lib/D11/cxFilterDialog.dfm b/official/x.35/Lib/D11/cxFilterDialog.dfm new file mode 100644 index 00000000..be0a7601 --- /dev/null +++ b/official/x.35/Lib/D11/cxFilterDialog.dfm @@ -0,0 +1,140 @@ +object cxFilterDialog: TcxFilterDialog + Left = 421 + Top = 148 + HorzScrollBar.Visible = False + VertScrollBar.Visible = False + ActiveControl = cbOperator1 + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'Custom Filter' + ClientHeight = 175 + ClientWidth = 414 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + PixelsPerInch = 96 + TextHeight = 13 + object lblTitle: TLabel + Left = 8 + Top = 8 + Width = 87 + Height = 13 + Caption = 'Show rows where:' + Transparent = True + end + object bvlLine: TBevel + Left = 8 + Top = 34 + Width = 396 + Height = 4 + Shape = bsTopLine + end + object lblColumnCaption: TLabel + Left = 8 + Top = 27 + Width = 71 + Height = 13 + Caption = 'ColumnCaption' + Transparent = True + end + object lblSingle: TLabel + Left = 8 + Top = 134 + Width = 185 + Height = 13 + Caption = 'Use ? to represent any single character' + Transparent = True + end + object lblSeries: TLabel + Left = 8 + Top = 153 + Width = 200 + Height = 13 + Caption = 'Use * to represent any series of characters' + Transparent = True + end + object lblEdit1PlaceHolder: TLabel + Left = 208 + Top = 46 + Width = 193 + Height = 21 + AutoSize = False + Color = clGreen + ParentColor = False + Visible = False + end + object lblEdit2PlaceHolder: TLabel + Left = 208 + Top = 96 + Width = 193 + Height = 21 + AutoSize = False + Color = clGreen + ParentColor = False + Visible = False + end + object cbOperator1: TcxComboBox + Left = 8 + Top = 46 + Properties.DropDownListStyle = lsFixedList + TabOrder = 0 + OnClick = cbOperator1Click + Width = 193 + end + object cbOperator2: TcxComboBox + Left = 8 + Top = 96 + Properties.DropDownListStyle = lsFixedList + Properties.OnChange = cbOperator2PropertiesChange + TabOrder = 3 + Width = 193 + end + object btnOK: TcxButton + Left = 248 + Top = 144 + Width = 75 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 4 + end + object btnCancel: TcxButton + Left = 330 + Top = 144 + Width = 75 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 5 + end + object rbAnd: TcxRadioButton + Tag = 1 + Left = 56 + Top = 74 + Width = 60 + Height = 17 + Caption = '&And' + Checked = True + TabOrder = 1 + TabStop = True + Transparent = True + end + object rbOr: TcxRadioButton + Tag = 1 + Left = 120 + Top = 74 + Width = 65 + Height = 17 + Caption = '&Or' + TabOrder = 2 + Transparent = True + end +end diff --git a/official/x.35/Lib/D11/cxFontNameComboBox.dcu b/official/x.35/Lib/D11/cxFontNameComboBox.dcu new file mode 100644 index 00000000..1093646b Binary files /dev/null and b/official/x.35/Lib/D11/cxFontNameComboBox.dcu differ diff --git a/official/x.35/Lib/D11/cxFontNameComboBox.res b/official/x.35/Lib/D11/cxFontNameComboBox.res new file mode 100644 index 00000000..4dd46661 Binary files /dev/null and b/official/x.35/Lib/D11/cxFontNameComboBox.res differ diff --git a/official/x.35/Lib/D11/cxFormats.dcu b/official/x.35/Lib/D11/cxFormats.dcu new file mode 100644 index 00000000..44fa6def Binary files /dev/null and b/official/x.35/Lib/D11/cxFormats.dcu differ diff --git a/official/x.35/Lib/D11/cxGeometry.dcu b/official/x.35/Lib/D11/cxGeometry.dcu new file mode 100644 index 00000000..a3dc5812 Binary files /dev/null and b/official/x.35/Lib/D11/cxGeometry.dcu differ diff --git a/official/x.35/Lib/D11/cxGraphics.dcu b/official/x.35/Lib/D11/cxGraphics.dcu new file mode 100644 index 00000000..72bb1c63 Binary files /dev/null and b/official/x.35/Lib/D11/cxGraphics.dcu differ diff --git a/official/x.35/Lib/D11/cxGrid.dcu b/official/x.35/Lib/D11/cxGrid.dcu new file mode 100644 index 00000000..05c8b6d5 Binary files /dev/null and b/official/x.35/Lib/D11/cxGrid.dcu differ diff --git a/official/x.35/Lib/D11/cxGrid.res b/official/x.35/Lib/D11/cxGrid.res new file mode 100644 index 00000000..04b9d5d7 Binary files /dev/null and b/official/x.35/Lib/D11/cxGrid.res differ diff --git a/official/x.35/Lib/D11/cxGridBandedTableView.dcu b/official/x.35/Lib/D11/cxGridBandedTableView.dcu new file mode 100644 index 00000000..b99a2c00 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridBandedTableView.dcu differ diff --git a/official/x.35/Lib/D11/cxGridCardView.dcu b/official/x.35/Lib/D11/cxGridCardView.dcu new file mode 100644 index 00000000..dbd7d06f Binary files /dev/null and b/official/x.35/Lib/D11/cxGridCardView.dcu differ diff --git a/official/x.35/Lib/D11/cxGridChartView.dcu b/official/x.35/Lib/D11/cxGridChartView.dcu new file mode 100644 index 00000000..bade86c7 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridChartView.dcu differ diff --git a/official/x.35/Lib/D11/cxGridChartView.res b/official/x.35/Lib/D11/cxGridChartView.res new file mode 100644 index 00000000..6c0eb144 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridChartView.res differ diff --git a/official/x.35/Lib/D11/cxGridCommon.dcu b/official/x.35/Lib/D11/cxGridCommon.dcu new file mode 100644 index 00000000..6471124f Binary files /dev/null and b/official/x.35/Lib/D11/cxGridCommon.dcu differ diff --git a/official/x.35/Lib/D11/cxGridConverter.dcu b/official/x.35/Lib/D11/cxGridConverter.dcu new file mode 100644 index 00000000..1e8f9667 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridConverter.dcu differ diff --git a/official/x.35/Lib/D11/cxGridCustomPopupMenu.dcu b/official/x.35/Lib/D11/cxGridCustomPopupMenu.dcu new file mode 100644 index 00000000..53d769f1 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridCustomPopupMenu.dcu differ diff --git a/official/x.35/Lib/D11/cxGridCustomTableView.dcu b/official/x.35/Lib/D11/cxGridCustomTableView.dcu new file mode 100644 index 00000000..9bd5f8f2 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridCustomTableView.dcu differ diff --git a/official/x.35/Lib/D11/cxGridCustomView.dcu b/official/x.35/Lib/D11/cxGridCustomView.dcu new file mode 100644 index 00000000..45062e9d Binary files /dev/null and b/official/x.35/Lib/D11/cxGridCustomView.dcu differ diff --git a/official/x.35/Lib/D11/cxGridD11.bpl b/official/x.35/Lib/D11/cxGridD11.bpl new file mode 100644 index 00000000..f8678fe6 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridD11.bpl differ diff --git a/official/x.35/Lib/D11/cxGridD11.dcp b/official/x.35/Lib/D11/cxGridD11.dcp new file mode 100644 index 00000000..00bbcf3a Binary files /dev/null and b/official/x.35/Lib/D11/cxGridD11.dcp differ diff --git a/official/x.35/Lib/D11/cxGridD11.dcu b/official/x.35/Lib/D11/cxGridD11.dcu new file mode 100644 index 00000000..02975ede Binary files /dev/null and b/official/x.35/Lib/D11/cxGridD11.dcu differ diff --git a/official/x.35/Lib/D11/cxGridDBBandedTableView.dcu b/official/x.35/Lib/D11/cxGridDBBandedTableView.dcu new file mode 100644 index 00000000..8011ce90 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridDBBandedTableView.dcu differ diff --git a/official/x.35/Lib/D11/cxGridDBCardView.dcu b/official/x.35/Lib/D11/cxGridDBCardView.dcu new file mode 100644 index 00000000..9288b0f5 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridDBCardView.dcu differ diff --git a/official/x.35/Lib/D11/cxGridDBChartView.dcu b/official/x.35/Lib/D11/cxGridDBChartView.dcu new file mode 100644 index 00000000..d94c1800 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridDBChartView.dcu differ diff --git a/official/x.35/Lib/D11/cxGridDBDataDefinitions.dcu b/official/x.35/Lib/D11/cxGridDBDataDefinitions.dcu new file mode 100644 index 00000000..fc567128 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridDBDataDefinitions.dcu differ diff --git a/official/x.35/Lib/D11/cxGridDBTableView.dcu b/official/x.35/Lib/D11/cxGridDBTableView.dcu new file mode 100644 index 00000000..78fb75fb Binary files /dev/null and b/official/x.35/Lib/D11/cxGridDBTableView.dcu differ diff --git a/official/x.35/Lib/D11/cxGridDetailsSite.dcu b/official/x.35/Lib/D11/cxGridDetailsSite.dcu new file mode 100644 index 00000000..64cf8757 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridDetailsSite.dcu differ diff --git a/official/x.35/Lib/D11/cxGridEditor.dcu b/official/x.35/Lib/D11/cxGridEditor.dcu new file mode 100644 index 00000000..c5fb39af Binary files /dev/null and b/official/x.35/Lib/D11/cxGridEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxGridEditor.dfm b/official/x.35/Lib/D11/cxGridEditor.dfm new file mode 100644 index 00000000..5e7018c7 --- /dev/null +++ b/official/x.35/Lib/D11/cxGridEditor.dfm @@ -0,0 +1,339 @@ +object cxGridEditor: TcxGridEditor + Left = 457 + Top = 105 + Width = 610 + Height = 435 + HorzScrollBar.Range = 4 + VertScrollBar.Range = 34 + BorderIcons = [biSystemMenu] + Caption = 'Editing' + Color = clBtnFace + ParentFont = True + OldCreateOrder = True + OnClose = FormClose + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 594 + Height = 361 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Splitter1: TSplitter + Left = 240 + Top = 0 + Width = 8 + Height = 361 + end + object Panel4: TPanel + Left = 248 + Top = 0 + Width = 346 + Height = 361 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Panel11: TPanel + Left = 0 + Top = 8 + Width = 346 + Height = 23 + Align = alTop + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object Panel12: TPanel + Left = 1 + Top = 1 + Width = 344 + Height = 21 + Align = alClient + BevelOuter = bvNone + Color = clInfoBk + TabOrder = 0 + object Label1: TLabel + Left = 7 + Top = 4 + Width = 26 + Height = 13 + Caption = 'View:' + end + object LSelectedView: TLabel + Left = 38 + Top = 4 + Width = 72 + Height = 13 + Caption = '' + end + end + end + object Panel5: TPanel + Left = 0 + Top = 0 + Width = 346 + Height = 8 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + end + object Panel13: TPanel + Left = 0 + Top = 31 + Width = 346 + Height = 8 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + end + object Panel15: TPanel + Left = 0 + Top = 39 + Width = 346 + Height = 322 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + Constraints.MinWidth = 100 + TabOrder = 3 + object PViewFrame: TPanel + Left = 1 + Top = 1 + Width = 344 + Height = 320 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + end + end + end + object PLeft: TPanel + Left = 0 + Top = 0 + Width = 240 + Height = 361 + Align = alLeft + BevelOuter = bvNone + TabOrder = 1 + object Panel7: TPanel + Left = 0 + Top = 8 + Width = 8 + Height = 353 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + end + object Panel8: TPanel + Left = 0 + Top = 0 + Width = 240 + Height = 8 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + end + object Panel14: TPanel + Left = 8 + Top = 8 + Width = 232 + Height = 353 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + Constraints.MinHeight = 200 + Constraints.MinWidth = 189 + TabOrder = 2 + object PageControl1: TcxPageControl + Left = 1 + Top = 1 + Width = 230 + Height = 351 + ActivePage = tsLevels + Align = alClient + TabOrder = 0 + ClientRectBottom = 351 + ClientRectRight = 230 + ClientRectTop = 24 + object tsLevels: TcxTabSheet + BorderWidth = 8 + Caption = ' Structure ' + Color = clBtnFace + ParentColor = False + object PLevels: TPanel + Left = 0 + Top = 0 + Width = 214 + Height = 277 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + end + object Panel6: TPanel + Left = 0 + Top = 277 + Width = 214 + Height = 34 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object BAddLevel: TcxButton + Left = 1 + Top = 8 + Width = 80 + Height = 24 + Caption = '&Add Level' + TabOrder = 0 + OnClick = BAddLevelClick + end + object BDeleteLevel: TcxButton + Left = 90 + Top = 8 + Width = 80 + Height = 24 + Caption = '&Delete Level' + TabOrder = 1 + OnClick = BDeleteLevelClick + end + end + end + object TabSheet2: TcxTabSheet + BorderWidth = 8 + Caption = ' Views ' + Color = clBtnFace + ImageIndex = 1 + ParentColor = False + object PViews: TPanel + Left = 0 + Top = 0 + Width = 214 + Height = 247 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object LBViews: TListBox + Left = 1 + Top = 1 + Width = 212 + Height = 245 + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + PopupMenu = PMViewList + TabOrder = 0 + OnClick = LBViewsClick + OnKeyPress = GridStructureControlKeyPress + end + end + object Panel9: TPanel + Left = 0 + Top = 247 + Width = 214 + Height = 64 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object BAddView: TcxButton + Left = 1 + Top = 8 + Width = 80 + Height = 24 + Caption = 'Add &View...' + TabOrder = 0 + OnClick = BAddViewClick + end + object BDeleteView: TcxButton + Left = 90 + Top = 8 + Width = 80 + Height = 24 + Caption = 'D&elete View' + TabOrder = 1 + OnClick = BDeleteViewClick + end + object BEditView: TcxButton + Left = 1 + Top = 40 + Width = 169 + Height = 24 + Caption = 'Edit View &Layout and Data...' + TabOrder = 2 + OnClick = miEditLayoutClick + end + end + end + end + end + end + end + object Panel2: TPanel + Left = 0 + Top = 361 + Width = 602 + Height = 40 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object Panel3: TPanel + Left = 425 + Top = 0 + Width = 177 + Height = 40 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object BClose: TcxButton + Left = 89 + Top = 8 + Width = 80 + Height = 24 + Cancel = True + Caption = '&Close' + TabOrder = 0 + OnClick = BCloseClick + end + end + end + object Panel10: TPanel + Left = 594 + Top = 0 + Width = 8 + Height = 361 + Align = alRight + BevelOuter = bvNone + TabOrder = 2 + end + object PMGridStructureControl: TPopupMenu + Left = 80 + Top = 64 + end + object PMViews: TPopupMenu + Left = 80 + Top = 96 + end + object PMViewList: TPopupMenu + Left = 80 + Top = 128 + object miDeleteView: TMenuItem + Caption = '&Delete' + ShortCut = 46 + OnClick = BDeleteViewClick + end + object N1: TMenuItem + Caption = '-' + end + object miEditLayout: TMenuItem + Caption = '&Edit Layout and Data...' + OnClick = miEditLayoutClick + end + end +end diff --git a/official/x.35/Lib/D11/cxGridExportLink.dcu b/official/x.35/Lib/D11/cxGridExportLink.dcu new file mode 100644 index 00000000..a6ef10d5 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridExportLink.dcu differ diff --git a/official/x.35/Lib/D11/cxGridFilterHelpers.dcu b/official/x.35/Lib/D11/cxGridFilterHelpers.dcu new file mode 100644 index 00000000..4a740b3a Binary files /dev/null and b/official/x.35/Lib/D11/cxGridFilterHelpers.dcu differ diff --git a/official/x.35/Lib/D11/cxGridFooterPopupMenuItems.dcu b/official/x.35/Lib/D11/cxGridFooterPopupMenuItems.dcu new file mode 100644 index 00000000..79512f58 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridFooterPopupMenuItems.dcu differ diff --git a/official/x.35/Lib/D11/cxGridGroupRowPopupMenuItems.dcu b/official/x.35/Lib/D11/cxGridGroupRowPopupMenuItems.dcu new file mode 100644 index 00000000..1ce31a22 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridGroupRowPopupMenuItems.dcu differ diff --git a/official/x.35/Lib/D11/cxGridHeaderPopupMenuItems.dcu b/official/x.35/Lib/D11/cxGridHeaderPopupMenuItems.dcu new file mode 100644 index 00000000..086e85d2 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridHeaderPopupMenuItems.dcu differ diff --git a/official/x.35/Lib/D11/cxGridImportDialog.dcu b/official/x.35/Lib/D11/cxGridImportDialog.dcu new file mode 100644 index 00000000..d414cd61 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridImportDialog.dcu differ diff --git a/official/x.35/Lib/D11/cxGridImportDialog.dfm b/official/x.35/Lib/D11/cxGridImportDialog.dfm new file mode 100644 index 00000000..3e08ec17 --- /dev/null +++ b/official/x.35/Lib/D11/cxGridImportDialog.dfm @@ -0,0 +1,237 @@ +object ImportDialog: TImportDialog + Left = 0 + Top = 0 + BorderStyle = bsDialog + Caption = 'Import' + ClientHeight = 368 + ClientWidth = 694 + Color = clBtnFace + ParentFont = True + KeyPreview = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 237 + Top = 0 + Width = 80 + Height = 368 + Align = alLeft + BevelOuter = bvNone + TabOrder = 1 + object btnImport: TcxButton + Left = 0 + Top = 8 + Width = 80 + Height = 24 + Caption = 'Import ->' + Enabled = False + TabOrder = 0 + OnClick = btnImportClick + end + object btnClose: TcxButton + Left = 0 + Top = 40 + Width = 80 + Height = 24 + Cancel = True + Caption = 'Close' + TabOrder = 1 + OnClick = btnCloseClick + end + end + object Panel2: TPanel + Left = 317 + Top = 0 + Width = 377 + Height = 368 + Align = alClient + BevelOuter = bvNone + BorderWidth = 8 + TabOrder = 2 + object Panel6: TPanel + Left = 8 + Top = 8 + Width = 361 + Height = 352 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object PageControl1: TcxPageControl + Left = 1 + Top = 1 + Width = 359 + Height = 350 + ActivePage = TabSheet1 + Align = alClient + Color = clBtnFace + ParentColor = False + TabOrder = 0 + ClientRectBottom = 350 + ClientRectRight = 359 + ClientRectTop = 24 + object TabSheet1: TcxTabSheet + BorderWidth = 8 + Caption = ' Levels ' + Color = clBtnFace + ParentColor = False + object cbDeleteAllSublevels: TcxCheckBox + Left = 0 + Top = 289 + Align = alBottom + Caption = 'Delete All Sublevels' + State = cbsChecked + TabOrder = 3 + Width = 343 + end + object Panel7: TPanel + Left = 0 + Top = 0 + Width = 343 + Height = 13 + Align = alTop + AutoSize = True + BevelOuter = bvNone + TabOrder = 0 + object lblLevelName: TLabel + Left = 89 + Top = 0 + Width = 254 + Height = 13 + Align = alClient + end + object Label1: TLabel + Left = 0 + Top = 0 + Width = 89 + Height = 13 + Align = alLeft + Caption = 'Destination Level: ' + end + end + object pnlStructureControlSite: TPanel + Left = 0 + Top = 21 + Width = 343 + Height = 260 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 1 + end + object Panel3: TPanel + Left = 0 + Top = 13 + Width = 343 + Height = 8 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + end + object Panel8: TPanel + Left = 0 + Top = 281 + Width = 343 + Height = 8 + Align = alBottom + BevelOuter = bvNone + TabOrder = 4 + end + end + object TabSheet2: TcxTabSheet + BorderWidth = 8 + Caption = ' Styles ' + Color = clBtnFace + ImageIndex = 1 + ParentColor = False + object cbImportStyles: TcxCheckBox + Left = 0 + Top = 0 + Align = alTop + Caption = 'Import Styles' + State = cbsChecked + TabOrder = 0 + OnClick = cbImportStylesClick + Width = 343 + end + object rbCreateNewStyleRepository: TcxRadioButton + Left = 12 + Top = 29 + Width = 169 + Height = 17 + Caption = 'Create New StyleRepository' + Checked = True + TabOrder = 1 + TabStop = True + OnClick = rbStyleRepositoryClick + end + object rbUseExistingStyleRepository: TcxRadioButton + Left = 12 + Top = 87 + Width = 173 + Height = 17 + Caption = 'Use Existing StyleRepository' + TabOrder = 3 + TabStop = True + OnClick = rbStyleRepositoryClick + end + object edNewStyleRepository: TcxTextEdit + Left = 36 + Top = 52 + TabOrder = 2 + Width = 290 + end + object cbStyleRepositories: TcxComboBox + Left = 36 + Top = 110 + Properties.DropDownListStyle = lsFixedList + TabOrder = 4 + Width = 290 + end + end + end + end + end + object Panel4: TPanel + Left = 0 + Top = 0 + Width = 237 + Height = 368 + Align = alLeft + BevelOuter = bvNone + BorderWidth = 8 + TabOrder = 0 + object Panel5: TPanel + Left = 8 + Top = 8 + Width = 221 + Height = 352 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + Color = clBtnShadow + TabOrder = 0 + object lbComponentsForImport: TListBox + Left = 1 + Top = 1 + Width = 219 + Height = 350 + Style = lbOwnerDrawVariable + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + TabOrder = 0 + OnClick = lbComponentsForImportClick + OnDblClick = lbComponentsForImportDblClick + OnMeasureItem = lbComponentsForImportMeasureItem + end + end + end +end diff --git a/official/x.35/Lib/D11/cxGridLevel.dcu b/official/x.35/Lib/D11/cxGridLevel.dcu new file mode 100644 index 00000000..6208a0e3 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridLevel.dcu differ diff --git a/official/x.35/Lib/D11/cxGridMenuOperations.dcu b/official/x.35/Lib/D11/cxGridMenuOperations.dcu new file mode 100644 index 00000000..7c4fdf11 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridMenuOperations.dcu differ diff --git a/official/x.35/Lib/D11/cxGridMenuOperations.res b/official/x.35/Lib/D11/cxGridMenuOperations.res new file mode 100644 index 00000000..d726fd87 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridMenuOperations.res differ diff --git a/official/x.35/Lib/D11/cxGridPopupMenu.dcu b/official/x.35/Lib/D11/cxGridPopupMenu.dcu new file mode 100644 index 00000000..4e3e53ea Binary files /dev/null and b/official/x.35/Lib/D11/cxGridPopupMenu.dcu differ diff --git a/official/x.35/Lib/D11/cxGridPopupMenuConsts.dcu b/official/x.35/Lib/D11/cxGridPopupMenuConsts.dcu new file mode 100644 index 00000000..15abbb51 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridPopupMenuConsts.dcu differ diff --git a/official/x.35/Lib/D11/cxGridPopupMenuReg.dcr b/official/x.35/Lib/D11/cxGridPopupMenuReg.dcr new file mode 100644 index 00000000..2fd9240e Binary files /dev/null and b/official/x.35/Lib/D11/cxGridPopupMenuReg.dcr differ diff --git a/official/x.35/Lib/D11/cxGridPopupMenuReg.dcu b/official/x.35/Lib/D11/cxGridPopupMenuReg.dcu new file mode 100644 index 00000000..0df2a353 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridPopupMenuReg.dcu differ diff --git a/official/x.35/Lib/D11/cxGridPredefinedStyles.dcu b/official/x.35/Lib/D11/cxGridPredefinedStyles.dcu new file mode 100644 index 00000000..5ac59095 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridPredefinedStyles.dcu differ diff --git a/official/x.35/Lib/D11/cxGridPredefinedStyles.dfm b/official/x.35/Lib/D11/cxGridPredefinedStyles.dfm new file mode 100644 index 00000000..350308ba --- /dev/null +++ b/official/x.35/Lib/D11/cxGridPredefinedStyles.dfm @@ -0,0 +1,4856 @@ +object cxdmGridPredefinedStyles: TcxdmGridPredefinedStyles + OldCreateOrder = False + Left = 262 + Top = 123 + Height = 253 + Width = 356 + object StyleRepository: TcxStyleRepository + Left = 160 + Top = 96 + object ClassicBackground: TcxStyle + AssignedValues = [svColor] + Color = 15451300 + end + object ClassicContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 16247513 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object ClassicContentEven: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16247513 + TextColor = clBlack + end + object ClassicContentOdd: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16247513 + TextColor = clBlack + end + object ClassicFilterBox: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14811135 + TextColor = clBlack + end + object ClassicFooter: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14811135 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clNavy + end + object ClassicGroup: TcxStyle + AssignedValues = [svColor] + Color = 14872561 + end + object ClassicGroupByBox: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBlack + end + object ClassicHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12937777 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object ClassicInactive: TcxStyle + AssignedValues = [svColor] + Color = 15451300 + end + object ClassicIncSearch: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBlack + end + object ClassicIndicator: TcxStyle + AssignedValues = [svColor] + Color = 15451300 + end + object ClassicPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14811135 + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clNavy + end + object ClassicSelection: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 12937777 + TextColor = clWhite + end + object cxStyle1: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8894686 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle2: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8894686 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle3: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle4: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 1262987 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Arial' + Font.Style = [] + TextColor = clWhite + end + object cxStyle5: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlue + end + object cxStyle6: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15136253 + Font.Charset = DEFAULT_CHARSET + Font.Color = 7346457 + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [] + TextColor = 7346457 + end + object cxStyle7: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16436871 + TextColor = clBlack + end + object cxStyle8: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 8036607 + TextColor = clBlack + end + object cxStyle9: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12180223 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle10: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle11: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8894686 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial Narrow' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle12: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9157775 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle13: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9157775 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle14: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4615972 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle15: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5737262 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial Black' + Font.Style = [] + TextColor = clBlack + end + object cxStyle16: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlue + end + object cxStyle17: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle18: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 9234160 + TextColor = clBlack + end + object cxStyle19: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 11788021 + TextColor = clBlack + end + object cxStyle20: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11193702 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clBlack + end + object cxStyle21: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5736750 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle22: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9157775 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle23: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13749760 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle24: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13749760 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle25: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 166 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -12 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle26: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8519755 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 14481663 + end + object cxStyle27: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlue + end + object cxStyle28: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle29: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16775416 + TextColor = clBlack + end + object cxStyle30: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16443110 + TextColor = clBlack + end + object cxStyle31: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14599344 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle32: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 191 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -12 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle33: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13749760 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle34: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6908265 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle35: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6908265 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle36: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 85 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle37: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle38: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlue + end + object cxStyle39: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle40: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle41: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 15461355 + TextColor = clBlack + end + object cxStyle42: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle43: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 85 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle44: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6908265 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle45: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10862530 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle46: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10862530 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle47: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6392205 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle48: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 66 + Font.Charset = DEFAULT_CHARSET + Font.Color = 13820129 + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = 13820129 + end + object cxStyle49: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle50: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle51: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 10862530 + TextColor = clBlack + end + object cxStyle52: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 13820129 + TextColor = clBlack + end + object cxStyle53: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6392205 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 13820129 + end + object cxStyle54: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6392205 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle55: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10862530 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle56: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12307669 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle57: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12307669 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle58: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle59: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6852002 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle60: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clTeal + end + object cxStyle61: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle62: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 12307669 + TextColor = clBlack + end + object cxStyle63: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14542570 + TextColor = clBlack + end + object cxStyle64: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6852002 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle65: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle66: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12307669 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle67: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11055248 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle68: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11055248 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle69: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7897176 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle70: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4194368 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle71: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = 7897176 + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = 7897176 + end + object cxStyle72: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle73: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 11055248 + TextColor = clBlack + end + object cxStyle74: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14211272 + TextColor = clBlack + end + object cxStyle75: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7897176 + Font.Charset = DEFAULT_CHARSET + Font.Color = 524288 + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = 524288 + end + object cxStyle76: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7897176 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle77: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11055248 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle78: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14264494 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -15 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle79: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14264494 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = 'Garamond' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle80: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11619930 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle81: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -15 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle82: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = 11619930 + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 11619930 + end + object cxStyle83: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = 'Garamond' + Font.Style = [] + TextColor = clBlack + end + object cxStyle84: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14264494 + TextColor = clBlack + end + object cxStyle85: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 15521240 + TextColor = clBlack + end + object cxStyle86: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11619930 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -15 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle87: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11619930 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle88: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14264494 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle89: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11458790 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle90: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11458790 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle91: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4630214 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle92: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle93: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle94: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle95: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 11458790 + TextColor = clBlack + end + object cxStyle96: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14150898 + TextColor = clBlack + end + object cxStyle97: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4630214 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 14150898 + end + object cxStyle98: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4630214 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle99: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11458790 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle100: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12107912 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle101: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12107912 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle102: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6053956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle103: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4673068 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle104: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14213320 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clNavy + end + object cxStyle105: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14213320 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle106: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 12107912 + TextColor = clBlack + end + object cxStyle107: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14213320 + TextColor = clBlack + end + object cxStyle108: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8949832 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clSilver + end + object cxStyle109: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6053956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle110: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12107912 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle111: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9476264 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle112: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9476264 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle113: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4210816 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 13160664 + end + object cxStyle114: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4204608 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle115: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160664 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 6307912 + end + object cxStyle116: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160664 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle117: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 10266296 + TextColor = clBlack + end + object cxStyle118: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14476524 + TextColor = clBlack + end + object cxStyle119: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5791864 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 9476264 + end + object cxStyle120: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4210816 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 13160664 + end + object cxStyle121: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9476264 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle122: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10343916 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle123: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10343916 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle124: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4944971 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle125: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4325442 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle126: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 3122647 + end + object cxStyle127: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle128: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 10343916 + TextColor = clBlack + end + object cxStyle129: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 13626101 + TextColor = clBlack + end + object cxStyle130: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3122647 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 13626101 + end + object cxStyle131: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4944971 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle132: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10343916 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle133: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11639171 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle134: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11639171 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle135: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8217935 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle136: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle137: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 8217935 + end + object cxStyle138: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle139: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 11639171 + TextColor = clBlack + end + object cxStyle140: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14273729 + TextColor = clBlack + end + object cxStyle141: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8217935 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 14273729 + end + object cxStyle142: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8217935 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle143: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11639171 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle144: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clBlack + end + object cxStyle145: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle146: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clMaroon + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clWhite + end + object cxStyle147: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4325376 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle148: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle149: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clBlack + end + object cxStyle150: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle151: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle152: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clSilver + end + object cxStyle153: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clMaroon + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clWhite + end + object cxStyle154: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle155: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle156: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle157: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5855675 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle158: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3552892 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle159: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 7364767 + end + object cxStyle160: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15461375 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle161: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 15461375 + TextColor = clBlack + end + object cxStyle162: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 15461375 + TextColor = clBlack + end + object cxStyle163: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3552892 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 14540253 + end + object cxStyle164: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5855675 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle165: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clBlack + end + object cxStyle166: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12103888 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle167: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [] + TextColor = clBlack + end + object cxStyle168: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5855675 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle169: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3552892 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clWhite + end + object cxStyle170: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 7364768 + end + object cxStyle171: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15461375 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [] + TextColor = clBlack + end + object cxStyle172: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 15461375 + TextColor = clBlack + end + object cxStyle173: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle174: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3552892 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 14540253 + end + object cxStyle175: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5855675 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle176: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12103888 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clBlack + end + object cxStyle177: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13154717 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle178: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13154717 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle179: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9928789 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle180: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4276545 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle181: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 9928789 + end + object cxStyle182: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle183: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 13154717 + TextColor = clBlack + end + object cxStyle184: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14933198 + TextColor = clBlack + end + object cxStyle185: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9928789 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clSilver + end + object cxStyle186: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9928789 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle187: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13154717 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle188: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11126946 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle189: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11126946 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle190: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6592345 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle191: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 2178849 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle192: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 6592345 + end + object cxStyle193: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle194: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 11126946 + TextColor = clBlack + end + object cxStyle195: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 13886416 + TextColor = clBlack + end + object cxStyle196: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6592345 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 13886416 + end + object cxStyle197: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6592345 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle198: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11126946 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle199: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle200: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle201: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4194432 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle202: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle203: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clPurple + end + object cxStyle204: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle205: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle206: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle207: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clSilver + end + object cxStyle208: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4194432 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle209: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle210: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle211: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle212: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle213: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4210688 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle214: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clTeal + end + object cxStyle215: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle216: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle217: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle218: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle219: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle220: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle221: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10542814 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle222: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10542814 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle223: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clOlive + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle224: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 1916928 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle225: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clOlive + end + object cxStyle226: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle227: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 10542814 + TextColor = clBlack + end + object cxStyle228: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 13692654 + TextColor = clBlack + end + object cxStyle229: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4308156 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle230: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clOlive + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle231: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10542814 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle232: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle233: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle234: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle235: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10841658 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle236: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clNavy + end + object cxStyle237: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle238: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle239: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle240: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clSilver + end + object cxStyle241: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle242: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle243: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle244: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle245: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle246: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10841658 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle247: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clNavy + end + object cxStyle248: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle249: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14671839 + TextColor = clBlack + end + object cxStyle250: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle251: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clSilver + end + object cxStyle252: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle253: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle254: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle255: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle256: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle257: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10841658 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle258: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 6956042 + end + object cxStyle259: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle260: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 13160660 + TextColor = clBlack + end + object cxStyle261: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle262: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 13160660 + end + object cxStyle263: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle264: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle265: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle266: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle267: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle268: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10841658 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle269: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 6956042 + end + object cxStyle270: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle271: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 13160660 + TextColor = clBlack + end + object cxStyle272: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle273: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 13160660 + end + object cxStyle274: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle275: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle276: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle277: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle278: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 206 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle279: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clSilver + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clSilver + end + object cxStyle280: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlue + end + object cxStyle281: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clYellow + end + object cxStyle282: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle283: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle284: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle285: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 206 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle286: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle287: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle288: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle289: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 206 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle290: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle291: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlue + end + object cxStyle292: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clYellow + end + object cxStyle293: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle294: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle295: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle296: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 206 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle297: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle298: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clYellow + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clYellow + end + object cxStyle299: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clYellow + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clYellow + end + object cxStyle300: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle301: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle302: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clAqua + end + object cxStyle303: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle304: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle305: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle306: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle307: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle308: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle309: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clYellow + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clYellow + end + object cxStyle310: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clYellow + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clYellow + end + object cxStyle311: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle312: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -15 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle313: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clAqua + end + object cxStyle314: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle315: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle316: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle317: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle318: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle319: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle320: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle321: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle322: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clPurple + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle323: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle324: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clPurple + end + object cxStyle325: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle326: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle327: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clWhite + end + object cxStyle328: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle329: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clPurple + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle330: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle331: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle332: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle333: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clPurple + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle334: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -15 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle335: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clPurple + end + object cxStyle336: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle337: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle338: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clWhite + end + object cxStyle339: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle340: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clPurple + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle341: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle342: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle343: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle344: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle345: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clSilver + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clSilver + end + object cxStyle346: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle347: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle348: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle349: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 15658734 + TextColor = clBlack + end + object cxStyle350: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle351: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle352: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle353: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle354: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle355: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle356: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clSilver + Font.Height = -15 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clSilver + end + object cxStyle357: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle358: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle359: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clSilver + TextColor = clBlack + end + object cxStyle360: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 15658734 + TextColor = clBlack + end + object cxStyle361: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clGray + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle362: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle363: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object ClassicRowCaption: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16749885 + TextColor = clWhite + end + object cxStyle364: TcxStyle + AssignedValues = [svColor] + Color = clSilver + end + object cxStyle365: TcxStyle + AssignedValues = [svColor] + Color = 13160660 + end + object cxStyle366: TcxStyle + AssignedValues = [svColor] + Color = 13160660 + end + object GridTableViewStyleSheetDevExpress: TcxGridTableViewStyleSheet + Caption = 'DevExpress' + Styles.Background = ClassicBackground + Styles.Content = ClassicContent + Styles.ContentEven = ClassicContentEven + Styles.ContentOdd = ClassicContentOdd + Styles.FilterBox = ClassicFilterBox + Styles.Inactive = ClassicInactive + Styles.IncSearch = ClassicIncSearch + Styles.Selection = ClassicSelection + Styles.Footer = ClassicFooter + Styles.Group = ClassicGroup + Styles.GroupByBox = ClassicGroupByBox + Styles.Header = ClassicHeader + Styles.Indicator = ClassicIndicator + Styles.Preview = ClassicPreview + BuiltIn = True + end + object GridBandedTableViewStyleSheetDevExpress: TcxGridBandedTableViewStyleSheet + Caption = 'DevExpress' + Styles.Background = ClassicBackground + Styles.Content = ClassicContent + Styles.ContentEven = ClassicContentEven + Styles.ContentOdd = ClassicContentOdd + Styles.FilterBox = ClassicFilterBox + Styles.Inactive = ClassicInactive + Styles.IncSearch = ClassicIncSearch + Styles.Selection = ClassicSelection + Styles.Footer = ClassicFooter + Styles.Group = ClassicGroup + Styles.GroupByBox = ClassicGroupByBox + Styles.Header = ClassicHeader + Styles.Indicator = ClassicIndicator + Styles.Preview = ClassicPreview + Styles.BandBackground = ClassicBackground + Styles.BandHeader = ClassicHeader + BuiltIn = True + end + object GridCardViewStyleSheetDevExpress: TcxGridCardViewStyleSheet + Caption = 'DevExpress' + Styles.Background = ClassicBackground + Styles.Content = ClassicContent + Styles.ContentEven = ClassicContentOdd + Styles.ContentOdd = ClassicContentEven + Styles.Inactive = ClassicInactive + Styles.IncSearch = ClassicIncSearch + Styles.Selection = ClassicSelection + Styles.CaptionRow = ClassicHeader + Styles.CardBorder = ClassicHeader + Styles.RowCaption = ClassicRowCaption + BuiltIn = True + end + object GridTableViewStyleSheetUserFormat1: TcxGridTableViewStyleSheet + Caption = 'UserFormat1' + Styles.Content = cxStyle6 + Styles.ContentEven = cxStyle7 + Styles.ContentOdd = cxStyle8 + Styles.Inactive = cxStyle10 + Styles.Selection = cxStyle3 + Styles.Footer = cxStyle1 + Styles.Group = cxStyle9 + Styles.GroupByBox = cxStyle4 + Styles.Header = cxStyle2 + Styles.Indicator = cxStyle11 + Styles.Preview = cxStyle5 + BuiltIn = True + end + object GridBandedTableViewStyleSheetUserFormat1: TcxGridBandedTableViewStyleSheet + Caption = 'UserFormat1' + Styles.Content = cxStyle6 + Styles.ContentEven = cxStyle7 + Styles.ContentOdd = cxStyle8 + Styles.Inactive = cxStyle10 + Styles.Selection = cxStyle3 + Styles.Footer = cxStyle1 + Styles.Group = cxStyle9 + Styles.GroupByBox = cxStyle4 + Styles.Header = cxStyle2 + Styles.Indicator = cxStyle11 + Styles.Preview = cxStyle5 + Styles.BandHeader = cxStyle2 + BuiltIn = True + end + object GridCardViewStyleSheetUserFormat1: TcxGridCardViewStyleSheet + Caption = 'UserFormat1' + Styles.Content = cxStyle6 + Styles.ContentEven = cxStyle7 + Styles.ContentOdd = cxStyle8 + Styles.Inactive = cxStyle10 + Styles.Selection = cxStyle3 + Styles.CaptionRow = cxStyle2 + Styles.RowCaption = cxStyle2 + BuiltIn = True + end + object GridTableViewStyleSheetUserFormat2: TcxGridTableViewStyleSheet + Caption = 'UserFormat2' + Styles.Content = cxStyle17 + Styles.ContentEven = cxStyle18 + Styles.ContentOdd = cxStyle19 + Styles.Inactive = cxStyle21 + Styles.Selection = cxStyle14 + Styles.Footer = cxStyle12 + Styles.Group = cxStyle20 + Styles.GroupByBox = cxStyle15 + Styles.Header = cxStyle13 + Styles.Indicator = cxStyle22 + Styles.Preview = cxStyle16 + BuiltIn = True + end + object GridBandedTableViewStyleSheetUserFormat2: TcxGridBandedTableViewStyleSheet + Caption = 'UserFormat2' + Styles.Content = cxStyle17 + Styles.ContentEven = cxStyle18 + Styles.ContentOdd = cxStyle19 + Styles.Inactive = cxStyle21 + Styles.Selection = cxStyle14 + Styles.Footer = cxStyle12 + Styles.Group = cxStyle20 + Styles.GroupByBox = cxStyle15 + Styles.Header = cxStyle13 + Styles.Indicator = cxStyle22 + Styles.Preview = cxStyle16 + Styles.BandHeader = cxStyle13 + BuiltIn = True + end + object GridCardViewStyleSheetUserFormat2: TcxGridCardViewStyleSheet + Caption = 'UserFormat2' + Styles.Content = cxStyle17 + Styles.ContentEven = cxStyle18 + Styles.ContentOdd = cxStyle19 + Styles.Inactive = cxStyle21 + Styles.Selection = cxStyle14 + Styles.CaptionRow = cxStyle13 + Styles.RowCaption = cxStyle13 + BuiltIn = True + end + object GridTableViewStyleSheetUserFormat3: TcxGridTableViewStyleSheet + Caption = 'UserFormat3' + Styles.Content = cxStyle28 + Styles.ContentEven = cxStyle29 + Styles.ContentOdd = cxStyle30 + Styles.Inactive = cxStyle32 + Styles.Selection = cxStyle25 + Styles.Footer = cxStyle23 + Styles.Group = cxStyle31 + Styles.GroupByBox = cxStyle26 + Styles.Header = cxStyle24 + Styles.Indicator = cxStyle33 + Styles.Preview = cxStyle27 + BuiltIn = True + end + object GridBandedTableViewStyleSheetUserFormat3: TcxGridBandedTableViewStyleSheet + Caption = 'UserFormat3' + Styles.Content = cxStyle28 + Styles.ContentEven = cxStyle29 + Styles.ContentOdd = cxStyle30 + Styles.Inactive = cxStyle32 + Styles.Selection = cxStyle25 + Styles.Footer = cxStyle23 + Styles.Group = cxStyle31 + Styles.GroupByBox = cxStyle26 + Styles.Header = cxStyle24 + Styles.Indicator = cxStyle33 + Styles.Preview = cxStyle27 + Styles.BandHeader = cxStyle24 + BuiltIn = True + end + object GridCardViewStyleSheetUserFormat3: TcxGridCardViewStyleSheet + Caption = 'UserFormat3' + Styles.Content = cxStyle28 + Styles.ContentEven = cxStyle29 + Styles.ContentOdd = cxStyle30 + Styles.Inactive = cxStyle32 + Styles.Selection = cxStyle25 + Styles.CaptionRow = cxStyle24 + Styles.RowCaption = cxStyle24 + BuiltIn = True + end + object GridTableViewStyleSheetUserFormat4: TcxGridTableViewStyleSheet + Caption = 'UserFormat4' + Styles.Content = cxStyle39 + Styles.ContentEven = cxStyle40 + Styles.ContentOdd = cxStyle41 + Styles.Inactive = cxStyle43 + Styles.Selection = cxStyle36 + Styles.Footer = cxStyle34 + Styles.Group = cxStyle42 + Styles.GroupByBox = cxStyle37 + Styles.Header = cxStyle35 + Styles.Indicator = cxStyle44 + Styles.Preview = cxStyle38 + BuiltIn = True + end + object GridBandedTableViewStyleSheetUserFormat4: TcxGridBandedTableViewStyleSheet + Caption = 'UserFormat4' + Styles.Content = cxStyle39 + Styles.ContentEven = cxStyle40 + Styles.ContentOdd = cxStyle41 + Styles.Inactive = cxStyle43 + Styles.Selection = cxStyle36 + Styles.Footer = cxStyle34 + Styles.Group = cxStyle42 + Styles.GroupByBox = cxStyle37 + Styles.Header = cxStyle35 + Styles.Indicator = cxStyle44 + Styles.Preview = cxStyle38 + Styles.BandHeader = cxStyle35 + BuiltIn = True + end + object GridCardViewStyleSheetUserFormat4: TcxGridCardViewStyleSheet + Caption = 'UserFormat4' + Styles.Content = cxStyle39 + Styles.ContentEven = cxStyle40 + Styles.ContentOdd = cxStyle41 + Styles.Inactive = cxStyle43 + Styles.Selection = cxStyle36 + Styles.CaptionRow = cxStyle35 + Styles.RowCaption = cxStyle35 + BuiltIn = True + end + object GridTableViewStyleSheetBrick: TcxGridTableViewStyleSheet + Caption = 'Brick' + Styles.Content = cxStyle50 + Styles.ContentEven = cxStyle51 + Styles.ContentOdd = cxStyle52 + Styles.Inactive = cxStyle54 + Styles.Selection = cxStyle47 + Styles.Footer = cxStyle45 + Styles.Group = cxStyle53 + Styles.GroupByBox = cxStyle48 + Styles.Header = cxStyle46 + Styles.Indicator = cxStyle55 + Styles.Preview = cxStyle49 + BuiltIn = True + end + object GridBandedTableViewStyleSheetBrick: TcxGridBandedTableViewStyleSheet + Caption = 'Brick' + Styles.Content = cxStyle50 + Styles.ContentEven = cxStyle51 + Styles.ContentOdd = cxStyle52 + Styles.Inactive = cxStyle54 + Styles.Selection = cxStyle47 + Styles.Footer = cxStyle45 + Styles.Group = cxStyle53 + Styles.GroupByBox = cxStyle48 + Styles.Header = cxStyle46 + Styles.Indicator = cxStyle55 + Styles.Preview = cxStyle49 + Styles.BandHeader = cxStyle46 + BuiltIn = True + end + object GridCardViewStyleSheetBrick: TcxGridCardViewStyleSheet + Caption = 'Brick' + Styles.Content = cxStyle50 + Styles.ContentEven = cxStyle51 + Styles.ContentOdd = cxStyle52 + Styles.Inactive = cxStyle54 + Styles.Selection = cxStyle47 + Styles.CaptionRow = cxStyle46 + Styles.RowCaption = cxStyle46 + BuiltIn = True + end + object GridTableViewStyleSheetDesert: TcxGridTableViewStyleSheet + Caption = 'Desert' + Styles.Content = cxStyle61 + Styles.ContentEven = cxStyle62 + Styles.ContentOdd = cxStyle63 + Styles.Inactive = cxStyle65 + Styles.Selection = cxStyle58 + Styles.Footer = cxStyle56 + Styles.Group = cxStyle64 + Styles.GroupByBox = cxStyle59 + Styles.Header = cxStyle57 + Styles.Indicator = cxStyle66 + Styles.Preview = cxStyle60 + BuiltIn = True + end + object GridBandedTableViewStyleSheetDesert: TcxGridBandedTableViewStyleSheet + Caption = 'Desert' + Styles.Content = cxStyle61 + Styles.ContentEven = cxStyle62 + Styles.ContentOdd = cxStyle63 + Styles.Inactive = cxStyle65 + Styles.Selection = cxStyle58 + Styles.Footer = cxStyle56 + Styles.Group = cxStyle64 + Styles.GroupByBox = cxStyle59 + Styles.Header = cxStyle57 + Styles.Indicator = cxStyle66 + Styles.Preview = cxStyle60 + Styles.BandHeader = cxStyle57 + BuiltIn = True + end + object GridCardViewStyleSheetDesert: TcxGridCardViewStyleSheet + Caption = 'Desert' + Styles.Content = cxStyle61 + Styles.ContentEven = cxStyle62 + Styles.ContentOdd = cxStyle63 + Styles.Inactive = cxStyle65 + Styles.Selection = cxStyle58 + Styles.CaptionRow = cxStyle57 + Styles.RowCaption = cxStyle57 + BuiltIn = True + end + object GridTableViewStyleSheetEggplant: TcxGridTableViewStyleSheet + Caption = 'Eggplant' + Styles.Content = cxStyle72 + Styles.ContentEven = cxStyle73 + Styles.ContentOdd = cxStyle74 + Styles.Inactive = cxStyle76 + Styles.Selection = cxStyle69 + Styles.Footer = cxStyle67 + Styles.Group = cxStyle75 + Styles.GroupByBox = cxStyle70 + Styles.Header = cxStyle68 + Styles.Indicator = cxStyle77 + Styles.Preview = cxStyle71 + BuiltIn = True + end + object GridBandedTableViewStyleSheetEggplant: TcxGridBandedTableViewStyleSheet + Caption = 'Eggplant' + Styles.Content = cxStyle72 + Styles.ContentEven = cxStyle73 + Styles.ContentOdd = cxStyle74 + Styles.Inactive = cxStyle76 + Styles.Selection = cxStyle69 + Styles.Footer = cxStyle67 + Styles.Group = cxStyle75 + Styles.GroupByBox = cxStyle70 + Styles.Header = cxStyle68 + Styles.Indicator = cxStyle77 + Styles.Preview = cxStyle71 + Styles.BandBackground = cxStyle68 + BuiltIn = True + end + object GridCardViewStyleSheetEggplant: TcxGridCardViewStyleSheet + Caption = 'Eggplant' + Styles.Content = cxStyle72 + Styles.ContentEven = cxStyle73 + Styles.ContentOdd = cxStyle74 + Styles.Inactive = cxStyle76 + Styles.Selection = cxStyle69 + Styles.CaptionRow = cxStyle68 + Styles.RowCaption = cxStyle68 + BuiltIn = True + end + object GridTableViewStyleSheetLilac: TcxGridTableViewStyleSheet + Caption = 'Lilac' + Styles.Content = cxStyle83 + Styles.ContentEven = cxStyle84 + Styles.ContentOdd = cxStyle85 + Styles.Inactive = cxStyle87 + Styles.Selection = cxStyle80 + Styles.Footer = cxStyle78 + Styles.Group = cxStyle86 + Styles.GroupByBox = cxStyle81 + Styles.Header = cxStyle79 + Styles.Indicator = cxStyle88 + Styles.Preview = cxStyle82 + BuiltIn = True + end + object GridBandedTableViewStyleSheetLilac: TcxGridBandedTableViewStyleSheet + Caption = 'Lilac' + Styles.Content = cxStyle83 + Styles.ContentEven = cxStyle84 + Styles.ContentOdd = cxStyle85 + Styles.Inactive = cxStyle87 + Styles.Selection = cxStyle80 + Styles.Footer = cxStyle78 + Styles.Group = cxStyle86 + Styles.GroupByBox = cxStyle81 + Styles.Header = cxStyle79 + Styles.Indicator = cxStyle88 + Styles.Preview = cxStyle82 + Styles.BandHeader = cxStyle79 + BuiltIn = True + end + object GridCardViewStyleSheetLilac: TcxGridCardViewStyleSheet + Caption = 'Lilac' + Styles.Content = cxStyle83 + Styles.ContentEven = cxStyle84 + Styles.ContentOdd = cxStyle85 + Styles.Inactive = cxStyle87 + Styles.Selection = cxStyle80 + Styles.CaptionRow = cxStyle79 + Styles.RowCaption = cxStyle79 + BuiltIn = True + end + object GridTableViewStyleSheetMaple: TcxGridTableViewStyleSheet + Caption = 'Maple' + Styles.Content = cxStyle94 + Styles.ContentEven = cxStyle95 + Styles.ContentOdd = cxStyle96 + Styles.Inactive = cxStyle98 + Styles.Selection = cxStyle91 + Styles.Footer = cxStyle89 + Styles.Group = cxStyle97 + Styles.GroupByBox = cxStyle92 + Styles.Header = cxStyle90 + Styles.Indicator = cxStyle99 + Styles.Preview = cxStyle93 + BuiltIn = True + end + object GridBandedTableViewStyleSheetMaple: TcxGridBandedTableViewStyleSheet + Caption = 'Maple' + Styles.Content = cxStyle94 + Styles.ContentEven = cxStyle95 + Styles.ContentOdd = cxStyle96 + Styles.Inactive = cxStyle98 + Styles.Selection = cxStyle91 + Styles.Footer = cxStyle89 + Styles.Group = cxStyle97 + Styles.GroupByBox = cxStyle92 + Styles.Header = cxStyle90 + Styles.Indicator = cxStyle99 + Styles.Preview = cxStyle93 + Styles.BandHeader = cxStyle90 + BuiltIn = True + end + object GridCardViewStyleSheetMaple: TcxGridCardViewStyleSheet + Caption = 'Maple' + Styles.Content = cxStyle94 + Styles.ContentEven = cxStyle95 + Styles.ContentOdd = cxStyle96 + Styles.Inactive = cxStyle98 + Styles.Selection = cxStyle91 + Styles.CaptionRow = cxStyle90 + Styles.RowCaption = cxStyle90 + BuiltIn = True + end + object GridTableViewStyleSheetMarinehighcolor: TcxGridTableViewStyleSheet + Caption = 'Marine (high color)' + Styles.Content = cxStyle105 + Styles.ContentEven = cxStyle106 + Styles.ContentOdd = cxStyle107 + Styles.Inactive = cxStyle109 + Styles.Selection = cxStyle102 + Styles.Footer = cxStyle100 + Styles.Group = cxStyle108 + Styles.GroupByBox = cxStyle103 + Styles.Header = cxStyle101 + Styles.Indicator = cxStyle110 + Styles.Preview = cxStyle104 + BuiltIn = True + end + object GridBandedTableViewStyleSheetMarinehighcolor: TcxGridBandedTableViewStyleSheet + Caption = 'Marine (high color)' + Styles.Content = cxStyle105 + Styles.ContentEven = cxStyle106 + Styles.ContentOdd = cxStyle107 + Styles.Inactive = cxStyle109 + Styles.Selection = cxStyle102 + Styles.Footer = cxStyle100 + Styles.Group = cxStyle108 + Styles.GroupByBox = cxStyle103 + Styles.Header = cxStyle101 + Styles.Indicator = cxStyle110 + Styles.Preview = cxStyle104 + Styles.BandHeader = cxStyle101 + BuiltIn = True + end + object GridCardViewStyleSheetMarinehighcolor: TcxGridCardViewStyleSheet + Caption = 'Marine (high color)' + Styles.Content = cxStyle105 + Styles.ContentEven = cxStyle106 + Styles.ContentOdd = cxStyle107 + Styles.Inactive = cxStyle109 + Styles.Selection = cxStyle102 + Styles.CaptionRow = cxStyle101 + Styles.RowCaption = cxStyle101 + BuiltIn = True + end + object GridTableViewStyleSheetPlumhighcolor: TcxGridTableViewStyleSheet + Caption = 'Plum (high color)' + Styles.Content = cxStyle116 + Styles.ContentEven = cxStyle117 + Styles.ContentOdd = cxStyle118 + Styles.Inactive = cxStyle120 + Styles.Selection = cxStyle113 + Styles.Footer = cxStyle111 + Styles.Group = cxStyle119 + Styles.GroupByBox = cxStyle114 + Styles.Header = cxStyle112 + Styles.Indicator = cxStyle121 + Styles.Preview = cxStyle115 + BuiltIn = True + end + object GridBandedTableViewStyleSheetPlumhighcolor: TcxGridBandedTableViewStyleSheet + Caption = 'Plum (high color)' + Styles.Content = cxStyle116 + Styles.ContentEven = cxStyle117 + Styles.ContentOdd = cxStyle118 + Styles.Inactive = cxStyle120 + Styles.Selection = cxStyle113 + Styles.Footer = cxStyle111 + Styles.Group = cxStyle119 + Styles.GroupByBox = cxStyle114 + Styles.Header = cxStyle112 + Styles.Indicator = cxStyle121 + Styles.Preview = cxStyle115 + Styles.BandHeader = cxStyle112 + BuiltIn = True + end + object GridCardViewStyleSheetPlumhighcolor: TcxGridCardViewStyleSheet + Caption = 'Plum (high color)' + Styles.Content = cxStyle116 + Styles.ContentEven = cxStyle117 + Styles.ContentOdd = cxStyle118 + Styles.Inactive = cxStyle120 + Styles.Selection = cxStyle113 + Styles.CaptionRow = cxStyle112 + Styles.CardBorder = cxStyle112 + Styles.RowCaption = cxStyle112 + BuiltIn = True + end + object GridTableViewStyleSheetPumpkinlarge: TcxGridTableViewStyleSheet + Caption = 'Pumpkin (large)' + Styles.Content = cxStyle127 + Styles.ContentEven = cxStyle128 + Styles.ContentOdd = cxStyle129 + Styles.Inactive = cxStyle131 + Styles.Selection = cxStyle124 + Styles.Footer = cxStyle122 + Styles.Group = cxStyle130 + Styles.GroupByBox = cxStyle125 + Styles.Header = cxStyle123 + Styles.Indicator = cxStyle132 + Styles.Preview = cxStyle126 + BuiltIn = True + end + object GridBandedTableViewStyleSheetPumpkinlarge: TcxGridBandedTableViewStyleSheet + Caption = 'Pumpkin (large)' + Styles.Content = cxStyle127 + Styles.ContentEven = cxStyle128 + Styles.ContentOdd = cxStyle129 + Styles.Inactive = cxStyle131 + Styles.Selection = cxStyle124 + Styles.Footer = cxStyle122 + Styles.Group = cxStyle130 + Styles.GroupByBox = cxStyle125 + Styles.Header = cxStyle123 + Styles.Indicator = cxStyle132 + Styles.Preview = cxStyle126 + Styles.BandHeader = cxStyle123 + BuiltIn = True + end + object GridCardViewStyleSheetPumpkinlarge: TcxGridCardViewStyleSheet + Caption = 'Pumpkin (large)' + Styles.Content = cxStyle127 + Styles.ContentEven = cxStyle128 + Styles.ContentOdd = cxStyle129 + Styles.Inactive = cxStyle131 + Styles.Selection = cxStyle124 + Styles.CaptionRow = cxStyle123 + Styles.RowCaption = cxStyle123 + BuiltIn = True + end + object GridTableViewStyleSheetRainyDay: TcxGridTableViewStyleSheet + Caption = 'Rainy Day' + Styles.Content = cxStyle138 + Styles.ContentEven = cxStyle139 + Styles.ContentOdd = cxStyle140 + Styles.Inactive = cxStyle142 + Styles.Selection = cxStyle135 + Styles.Footer = cxStyle133 + Styles.Group = cxStyle141 + Styles.GroupByBox = cxStyle136 + Styles.Header = cxStyle134 + Styles.Indicator = cxStyle143 + Styles.Preview = cxStyle137 + BuiltIn = True + end + object GridBandedTableViewStyleSheetRainyDay: TcxGridBandedTableViewStyleSheet + Caption = 'Rainy Day' + Styles.Content = cxStyle138 + Styles.ContentEven = cxStyle139 + Styles.ContentOdd = cxStyle140 + Styles.Inactive = cxStyle142 + Styles.Selection = cxStyle135 + Styles.Footer = cxStyle133 + Styles.Group = cxStyle141 + Styles.GroupByBox = cxStyle136 + Styles.Header = cxStyle134 + Styles.Indicator = cxStyle143 + Styles.Preview = cxStyle137 + Styles.BandHeader = cxStyle134 + BuiltIn = True + end + object GridCardViewStyleSheetRainyDay: TcxGridCardViewStyleSheet + Caption = 'Rainy Day' + Styles.Content = cxStyle138 + Styles.ContentEven = cxStyle139 + Styles.ContentOdd = cxStyle140 + Styles.Inactive = cxStyle142 + Styles.Selection = cxStyle135 + Styles.CaptionRow = cxStyle134 + Styles.RowCaption = cxStyle134 + BuiltIn = True + end + object GridTableViewStyleSheetRedWhiteandBlueVGA: TcxGridTableViewStyleSheet + Caption = 'Red, White, and Blue (VGA)' + Styles.Content = cxStyle149 + Styles.ContentEven = cxStyle150 + Styles.ContentOdd = cxStyle151 + Styles.Inactive = cxStyle153 + Styles.Selection = cxStyle146 + Styles.Footer = cxStyle144 + Styles.Group = cxStyle152 + Styles.GroupByBox = cxStyle147 + Styles.Header = cxStyle145 + Styles.Indicator = cxStyle154 + Styles.Preview = cxStyle148 + BuiltIn = True + end + object GridBandedTableViewStyleSheetRedWhiteandBlueVGA: TcxGridBandedTableViewStyleSheet + Caption = 'Red, White, and Blue (VGA)' + Styles.Content = cxStyle149 + Styles.ContentEven = cxStyle150 + Styles.ContentOdd = cxStyle151 + Styles.Inactive = cxStyle153 + Styles.Selection = cxStyle146 + Styles.Footer = cxStyle144 + Styles.Group = cxStyle152 + Styles.GroupByBox = cxStyle147 + Styles.Header = cxStyle145 + Styles.Indicator = cxStyle154 + Styles.Preview = cxStyle148 + Styles.BandHeader = cxStyle145 + BuiltIn = True + end + object GridCardViewStyleSheetRedWhiteandBlueVGA: TcxGridCardViewStyleSheet + Caption = 'Red, White, and Blue (VGA)' + Styles.Content = cxStyle149 + Styles.ContentEven = cxStyle150 + Styles.ContentOdd = cxStyle151 + Styles.Inactive = cxStyle153 + Styles.Selection = cxStyle146 + Styles.CaptionRow = cxStyle145 + Styles.RowCaption = cxStyle145 + BuiltIn = True + end + object GridTableViewStyleSheetRose: TcxGridTableViewStyleSheet + Caption = 'Rose' + Styles.Content = cxStyle160 + Styles.ContentEven = cxStyle161 + Styles.ContentOdd = cxStyle162 + Styles.Inactive = cxStyle164 + Styles.Selection = cxStyle157 + Styles.Footer = cxStyle155 + Styles.Group = cxStyle163 + Styles.GroupByBox = cxStyle158 + Styles.Header = cxStyle156 + Styles.Indicator = cxStyle165 + Styles.Preview = cxStyle159 + BuiltIn = True + end + object GridBandedTableViewStyleSheetRose: TcxGridBandedTableViewStyleSheet + Caption = 'Rose' + Styles.Content = cxStyle160 + Styles.ContentEven = cxStyle161 + Styles.ContentOdd = cxStyle162 + Styles.Inactive = cxStyle164 + Styles.Selection = cxStyle157 + Styles.Footer = cxStyle155 + Styles.Group = cxStyle163 + Styles.GroupByBox = cxStyle158 + Styles.Header = cxStyle156 + Styles.Indicator = cxStyle165 + Styles.Preview = cxStyle159 + Styles.BandHeader = cxStyle156 + BuiltIn = True + end + object GridCardViewStyleSheetRose: TcxGridCardViewStyleSheet + Caption = 'Rose' + Styles.Content = cxStyle160 + Styles.ContentEven = cxStyle161 + Styles.ContentOdd = cxStyle162 + Styles.Inactive = cxStyle164 + Styles.Selection = cxStyle157 + Styles.CaptionRow = cxStyle156 + Styles.RowCaption = cxStyle156 + BuiltIn = True + end + object GridTableViewStyleSheetRoselarge: TcxGridTableViewStyleSheet + Caption = 'Rose (large)' + Styles.Content = cxStyle171 + Styles.ContentEven = cxStyle172 + Styles.ContentOdd = cxStyle173 + Styles.Inactive = cxStyle175 + Styles.Selection = cxStyle168 + Styles.Footer = cxStyle166 + Styles.Group = cxStyle174 + Styles.GroupByBox = cxStyle169 + Styles.Header = cxStyle167 + Styles.Indicator = cxStyle176 + Styles.Preview = cxStyle170 + BuiltIn = True + end + object GridBandedTableViewStyleSheetRoselarge: TcxGridBandedTableViewStyleSheet + Caption = 'Rose (large)' + Styles.Content = cxStyle171 + Styles.ContentEven = cxStyle172 + Styles.ContentOdd = cxStyle173 + Styles.Inactive = cxStyle175 + Styles.Selection = cxStyle168 + Styles.Footer = cxStyle166 + Styles.Group = cxStyle174 + Styles.GroupByBox = cxStyle169 + Styles.Header = cxStyle167 + Styles.Indicator = cxStyle176 + Styles.Preview = cxStyle170 + Styles.BandHeader = cxStyle167 + BuiltIn = True + end + object GridCardViewStyleSheetRoselarge: TcxGridCardViewStyleSheet + Caption = 'Rose (large)' + Styles.Content = cxStyle171 + Styles.ContentEven = cxStyle172 + Styles.ContentOdd = cxStyle173 + Styles.Inactive = cxStyle175 + Styles.Selection = cxStyle168 + Styles.CaptionRow = cxStyle167 + Styles.RowCaption = cxStyle167 + BuiltIn = True + end + object GridTableViewStyleSheetSlate: TcxGridTableViewStyleSheet + Caption = 'Slate' + Styles.Content = cxStyle182 + Styles.ContentEven = cxStyle183 + Styles.ContentOdd = cxStyle184 + Styles.Inactive = cxStyle186 + Styles.Selection = cxStyle179 + Styles.Footer = cxStyle177 + Styles.Group = cxStyle185 + Styles.GroupByBox = cxStyle180 + Styles.Header = cxStyle178 + Styles.Indicator = cxStyle187 + Styles.Preview = cxStyle181 + BuiltIn = True + end + object GridBandedTableViewStyleSheetSlate: TcxGridBandedTableViewStyleSheet + Caption = 'Slate' + Styles.Content = cxStyle182 + Styles.ContentEven = cxStyle183 + Styles.ContentOdd = cxStyle184 + Styles.Inactive = cxStyle186 + Styles.Selection = cxStyle179 + Styles.Footer = cxStyle177 + Styles.Group = cxStyle185 + Styles.GroupByBox = cxStyle180 + Styles.Header = cxStyle178 + Styles.Indicator = cxStyle187 + Styles.Preview = cxStyle181 + Styles.BandHeader = cxStyle178 + BuiltIn = True + end + object GridCardViewStyleSheetSlate: TcxGridCardViewStyleSheet + Caption = 'Slate' + Styles.Content = cxStyle182 + Styles.ContentEven = cxStyle183 + Styles.ContentOdd = cxStyle184 + Styles.Inactive = cxStyle186 + Styles.Selection = cxStyle179 + Styles.CaptionRow = cxStyle178 + Styles.RowCaption = cxStyle178 + BuiltIn = True + end + object GridTableViewStyleSheetSpruce: TcxGridTableViewStyleSheet + Caption = 'Spruce' + Styles.Content = cxStyle193 + Styles.ContentEven = cxStyle194 + Styles.ContentOdd = cxStyle195 + Styles.Inactive = cxStyle197 + Styles.Selection = cxStyle190 + Styles.Footer = cxStyle188 + Styles.Group = cxStyle196 + Styles.GroupByBox = cxStyle191 + Styles.Header = cxStyle189 + Styles.Indicator = cxStyle198 + Styles.Preview = cxStyle192 + BuiltIn = True + end + object GridBandedTableViewStyleSheetSpruce: TcxGridBandedTableViewStyleSheet + Caption = 'Spruce' + Styles.Content = cxStyle193 + Styles.ContentEven = cxStyle194 + Styles.ContentOdd = cxStyle195 + Styles.Inactive = cxStyle197 + Styles.Selection = cxStyle190 + Styles.Footer = cxStyle188 + Styles.Group = cxStyle196 + Styles.GroupByBox = cxStyle191 + Styles.Header = cxStyle189 + Styles.Indicator = cxStyle198 + Styles.Preview = cxStyle192 + Styles.BandHeader = cxStyle189 + BuiltIn = True + end + object GridCardViewStyleSheetSpruce: TcxGridCardViewStyleSheet + Caption = 'Spruce' + Styles.Content = cxStyle193 + Styles.ContentEven = cxStyle194 + Styles.ContentOdd = cxStyle195 + Styles.Inactive = cxStyle197 + Styles.Selection = cxStyle190 + Styles.CaptionRow = cxStyle189 + Styles.RowCaption = cxStyle189 + BuiltIn = True + end + object GridTableViewStyleSheetStormVGA: TcxGridTableViewStyleSheet + Caption = 'Storm (VGA)' + Styles.Content = cxStyle204 + Styles.ContentEven = cxStyle205 + Styles.ContentOdd = cxStyle206 + Styles.Inactive = cxStyle208 + Styles.Selection = cxStyle201 + Styles.Footer = cxStyle199 + Styles.Group = cxStyle207 + Styles.GroupByBox = cxStyle202 + Styles.Header = cxStyle200 + Styles.Indicator = cxStyle209 + Styles.Preview = cxStyle203 + BuiltIn = True + end + object GridBandedTableViewStyleSheetStormVGA: TcxGridBandedTableViewStyleSheet + Caption = 'Storm (VGA)' + Styles.Content = cxStyle204 + Styles.ContentEven = cxStyle205 + Styles.ContentOdd = cxStyle206 + Styles.Inactive = cxStyle208 + Styles.Selection = cxStyle201 + Styles.Footer = cxStyle199 + Styles.Group = cxStyle207 + Styles.GroupByBox = cxStyle202 + Styles.Header = cxStyle200 + Styles.Indicator = cxStyle209 + Styles.Preview = cxStyle203 + Styles.BandHeader = cxStyle200 + BuiltIn = True + end + object GridCardViewStyleSheetStormVGA: TcxGridCardViewStyleSheet + Caption = 'Storm (VGA)' + Styles.Content = cxStyle204 + Styles.ContentEven = cxStyle205 + Styles.ContentOdd = cxStyle206 + Styles.Inactive = cxStyle208 + Styles.Selection = cxStyle201 + Styles.CaptionRow = cxStyle200 + Styles.RowCaption = cxStyle200 + BuiltIn = True + end + object GridTableViewStyleSheetTealVGA: TcxGridTableViewStyleSheet + Caption = 'Teal (VGA)' + Styles.Content = cxStyle215 + Styles.ContentEven = cxStyle216 + Styles.ContentOdd = cxStyle217 + Styles.Inactive = cxStyle219 + Styles.Selection = cxStyle212 + Styles.Footer = cxStyle210 + Styles.Group = cxStyle218 + Styles.GroupByBox = cxStyle213 + Styles.Header = cxStyle211 + Styles.Indicator = cxStyle220 + Styles.Preview = cxStyle214 + BuiltIn = True + end + object GridBandedTableViewStyleSheetTealVGA: TcxGridBandedTableViewStyleSheet + Caption = 'Teal (VGA)' + Styles.Content = cxStyle215 + Styles.ContentEven = cxStyle216 + Styles.ContentOdd = cxStyle217 + Styles.Inactive = cxStyle219 + Styles.Selection = cxStyle212 + Styles.Footer = cxStyle210 + Styles.Group = cxStyle218 + Styles.GroupByBox = cxStyle213 + Styles.Header = cxStyle211 + Styles.Indicator = cxStyle220 + Styles.Preview = cxStyle214 + Styles.BandHeader = cxStyle211 + BuiltIn = True + end + object GridCardViewStyleSheetTealVGA: TcxGridCardViewStyleSheet + Caption = 'Teal (VGA)' + Styles.Content = cxStyle215 + Styles.ContentEven = cxStyle216 + Styles.ContentOdd = cxStyle217 + Styles.Inactive = cxStyle219 + Styles.Selection = cxStyle212 + Styles.CaptionRow = cxStyle211 + Styles.CardBorder = cxStyle364 + Styles.RowCaption = cxStyle211 + BuiltIn = True + end + object GridTableViewStyleSheetWheat: TcxGridTableViewStyleSheet + Caption = 'Wheat' + Styles.Content = cxStyle226 + Styles.ContentEven = cxStyle227 + Styles.ContentOdd = cxStyle228 + Styles.Inactive = cxStyle230 + Styles.Selection = cxStyle223 + Styles.Footer = cxStyle221 + Styles.Group = cxStyle229 + Styles.GroupByBox = cxStyle224 + Styles.Header = cxStyle222 + Styles.Indicator = cxStyle231 + Styles.Preview = cxStyle225 + BuiltIn = True + end + object GridBandedTableViewStyleSheetWheat: TcxGridBandedTableViewStyleSheet + Caption = 'Wheat' + Styles.Content = cxStyle226 + Styles.ContentEven = cxStyle227 + Styles.ContentOdd = cxStyle228 + Styles.Inactive = cxStyle230 + Styles.Selection = cxStyle223 + Styles.Footer = cxStyle221 + Styles.Group = cxStyle229 + Styles.GroupByBox = cxStyle224 + Styles.Header = cxStyle222 + Styles.Indicator = cxStyle231 + Styles.Preview = cxStyle225 + Styles.BandHeader = cxStyle222 + BuiltIn = True + end + object GridCardViewStyleSheetWheat: TcxGridCardViewStyleSheet + Caption = 'Wheat' + Styles.Content = cxStyle226 + Styles.ContentEven = cxStyle227 + Styles.ContentOdd = cxStyle228 + Styles.Inactive = cxStyle230 + Styles.Selection = cxStyle223 + Styles.CaptionRow = cxStyle222 + Styles.RowCaption = cxStyle222 + BuiltIn = True + end + object GridTableViewStyleSheetWindowsClassic: TcxGridTableViewStyleSheet + Caption = 'Windows Classic' + Styles.Content = cxStyle237 + Styles.ContentEven = cxStyle238 + Styles.ContentOdd = cxStyle239 + Styles.Inactive = cxStyle241 + Styles.Selection = cxStyle234 + Styles.Footer = cxStyle232 + Styles.Group = cxStyle240 + Styles.GroupByBox = cxStyle235 + Styles.Header = cxStyle233 + Styles.Indicator = cxStyle242 + Styles.Preview = cxStyle236 + BuiltIn = True + end + object GridBandedTableViewStyleSheetWindowsClassic: TcxGridBandedTableViewStyleSheet + Caption = 'Windows Classic' + Styles.Content = cxStyle237 + Styles.ContentEven = cxStyle238 + Styles.ContentOdd = cxStyle239 + Styles.Inactive = cxStyle241 + Styles.Selection = cxStyle234 + Styles.Footer = cxStyle232 + Styles.Group = cxStyle240 + Styles.GroupByBox = cxStyle235 + Styles.Header = cxStyle233 + Styles.Indicator = cxStyle242 + Styles.Preview = cxStyle236 + Styles.BandHeader = cxStyle233 + BuiltIn = True + end + object GridCardViewStyleSheetWindowsClassic: TcxGridCardViewStyleSheet + Caption = 'Windows Classic' + Styles.Content = cxStyle237 + Styles.ContentEven = cxStyle238 + Styles.ContentOdd = cxStyle239 + Styles.Inactive = cxStyle241 + Styles.Selection = cxStyle234 + Styles.CaptionRow = cxStyle233 + Styles.RowCaption = cxStyle233 + BuiltIn = True + end + object GridTableViewStyleSheetWindowsClassiclarge: TcxGridTableViewStyleSheet + Caption = 'Windows Classic (large)' + Styles.Content = cxStyle248 + Styles.ContentEven = cxStyle249 + Styles.ContentOdd = cxStyle250 + Styles.Inactive = cxStyle252 + Styles.Selection = cxStyle245 + Styles.Footer = cxStyle243 + Styles.Group = cxStyle251 + Styles.GroupByBox = cxStyle246 + Styles.Header = cxStyle244 + Styles.Indicator = cxStyle253 + Styles.Preview = cxStyle247 + BuiltIn = True + end + object GridBandedTableViewStyleSheetWindowsClassiclarge: TcxGridBandedTableViewStyleSheet + Caption = 'Windows Classic (large)' + Styles.Content = cxStyle248 + Styles.ContentEven = cxStyle249 + Styles.ContentOdd = cxStyle250 + Styles.Inactive = cxStyle252 + Styles.Selection = cxStyle245 + Styles.Footer = cxStyle243 + Styles.Group = cxStyle251 + Styles.GroupByBox = cxStyle246 + Styles.Header = cxStyle244 + Styles.Indicator = cxStyle253 + Styles.Preview = cxStyle247 + Styles.BandHeader = cxStyle244 + BuiltIn = True + end + object GridCardViewStyleSheetWindowsClassiclarge: TcxGridCardViewStyleSheet + Caption = 'Windows Classic (large)' + Styles.Content = cxStyle248 + Styles.ContentEven = cxStyle249 + Styles.ContentOdd = cxStyle250 + Styles.Inactive = cxStyle252 + Styles.Selection = cxStyle245 + Styles.CaptionRow = cxStyle244 + Styles.RowCaption = cxStyle244 + BuiltIn = True + end + object GridTableViewStyleSheetWindowsStandard: TcxGridTableViewStyleSheet + Caption = 'Windows Standard' + Styles.Content = cxStyle259 + Styles.ContentEven = cxStyle260 + Styles.ContentOdd = cxStyle261 + Styles.Inactive = cxStyle263 + Styles.Selection = cxStyle256 + Styles.Footer = cxStyle254 + Styles.Group = cxStyle262 + Styles.GroupByBox = cxStyle257 + Styles.Header = cxStyle255 + Styles.Indicator = cxStyle264 + Styles.Preview = cxStyle258 + BuiltIn = True + end + object GridBandedTableViewStyleSheetWindowsStandard: TcxGridBandedTableViewStyleSheet + Caption = 'Windows Standard' + Styles.Content = cxStyle259 + Styles.ContentEven = cxStyle260 + Styles.ContentOdd = cxStyle261 + Styles.Inactive = cxStyle263 + Styles.Selection = cxStyle256 + Styles.Footer = cxStyle254 + Styles.Group = cxStyle262 + Styles.GroupByBox = cxStyle257 + Styles.Header = cxStyle255 + Styles.Indicator = cxStyle264 + Styles.Preview = cxStyle258 + Styles.BandHeader = cxStyle255 + BuiltIn = True + end + object GridCardViewStyleSheetWindowsStandard: TcxGridCardViewStyleSheet + Caption = 'Windows Standard' + Styles.Content = cxStyle259 + Styles.ContentEven = cxStyle260 + Styles.ContentOdd = cxStyle261 + Styles.Inactive = cxStyle263 + Styles.Selection = cxStyle256 + Styles.CaptionRow = cxStyle255 + Styles.CardBorder = cxStyle365 + Styles.RowCaption = cxStyle255 + BuiltIn = True + end + object GridTableViewStyleSheetWindowsStandardlarge: TcxGridTableViewStyleSheet + Caption = 'Windows Standard (large)' + Styles.Content = cxStyle270 + Styles.ContentEven = cxStyle271 + Styles.ContentOdd = cxStyle272 + Styles.Inactive = cxStyle274 + Styles.Selection = cxStyle267 + Styles.Footer = cxStyle265 + Styles.Group = cxStyle273 + Styles.GroupByBox = cxStyle268 + Styles.Header = cxStyle266 + Styles.Indicator = cxStyle275 + Styles.Preview = cxStyle269 + BuiltIn = True + end + object GridBandedTableViewStyleSheetWindowsStandardlarge: TcxGridBandedTableViewStyleSheet + Caption = 'Windows Standard (large)' + Styles.Content = cxStyle270 + Styles.ContentEven = cxStyle271 + Styles.ContentOdd = cxStyle272 + Styles.Inactive = cxStyle274 + Styles.Selection = cxStyle267 + Styles.Footer = cxStyle265 + Styles.Group = cxStyle273 + Styles.GroupByBox = cxStyle268 + Styles.Header = cxStyle266 + Styles.Indicator = cxStyle275 + Styles.Preview = cxStyle269 + Styles.BandHeader = cxStyle266 + BuiltIn = True + end + object GridCardViewStyleSheetWindowsStandardlarge: TcxGridCardViewStyleSheet + Caption = 'Windows Standard (large)' + Styles.Content = cxStyle270 + Styles.ContentEven = cxStyle271 + Styles.ContentOdd = cxStyle272 + Styles.Inactive = cxStyle274 + Styles.Selection = cxStyle267 + Styles.CaptionRow = cxStyle266 + Styles.CardBorder = cxStyle366 + Styles.RowCaption = cxStyle266 + BuiltIn = True + end + object GridTableViewStyleSheetHighContrast1: TcxGridTableViewStyleSheet + Caption = 'High Contrast #1' + Styles.Content = cxStyle281 + Styles.ContentEven = cxStyle282 + Styles.ContentOdd = cxStyle283 + Styles.Inactive = cxStyle285 + Styles.Selection = cxStyle278 + Styles.Footer = cxStyle276 + Styles.Group = cxStyle284 + Styles.GroupByBox = cxStyle279 + Styles.Header = cxStyle277 + Styles.Indicator = cxStyle286 + Styles.Preview = cxStyle280 + BuiltIn = True + end + object GridBandedTableViewStyleSheetHighContrast1: TcxGridBandedTableViewStyleSheet + Caption = 'High Contrast #1' + Styles.Content = cxStyle281 + Styles.ContentEven = cxStyle282 + Styles.ContentOdd = cxStyle283 + Styles.Inactive = cxStyle285 + Styles.Selection = cxStyle278 + Styles.Footer = cxStyle276 + Styles.Group = cxStyle284 + Styles.GroupByBox = cxStyle279 + Styles.Header = cxStyle277 + Styles.Indicator = cxStyle286 + Styles.Preview = cxStyle280 + Styles.BandHeader = cxStyle286 + BuiltIn = True + end + object GridCardViewStyleSheetHighContrast1: TcxGridCardViewStyleSheet + Caption = 'High Contrast #1' + Styles.Content = cxStyle281 + Styles.ContentEven = cxStyle282 + Styles.ContentOdd = cxStyle283 + Styles.Inactive = cxStyle285 + Styles.Selection = cxStyle278 + Styles.CaptionRow = cxStyle277 + Styles.RowCaption = cxStyle277 + BuiltIn = True + end + object GridTableViewStyleSheetHighContrast1large: TcxGridTableViewStyleSheet + Caption = 'High Contrast #1 (large)' + Styles.Content = cxStyle292 + Styles.ContentEven = cxStyle293 + Styles.ContentOdd = cxStyle294 + Styles.Inactive = cxStyle296 + Styles.Selection = cxStyle289 + Styles.Footer = cxStyle287 + Styles.Group = cxStyle295 + Styles.GroupByBox = cxStyle290 + Styles.Header = cxStyle288 + Styles.Indicator = cxStyle297 + Styles.Preview = cxStyle291 + BuiltIn = True + end + object GridBandedTableViewStyleSheetHighContrast1large: TcxGridBandedTableViewStyleSheet + Caption = 'High Contrast #1 (large)' + Styles.Content = cxStyle292 + Styles.ContentEven = cxStyle293 + Styles.ContentOdd = cxStyle294 + Styles.Inactive = cxStyle296 + Styles.Selection = cxStyle289 + Styles.Footer = cxStyle287 + Styles.Group = cxStyle295 + Styles.GroupByBox = cxStyle290 + Styles.Header = cxStyle288 + Styles.Indicator = cxStyle297 + Styles.Preview = cxStyle291 + Styles.BandHeader = cxStyle297 + BuiltIn = True + end + object GridCardViewStyleSheetHighContrast1large: TcxGridCardViewStyleSheet + Caption = 'High Contrast #1 (large)' + Styles.Content = cxStyle292 + Styles.ContentEven = cxStyle293 + Styles.ContentOdd = cxStyle294 + Styles.Inactive = cxStyle296 + Styles.Selection = cxStyle289 + Styles.CaptionRow = cxStyle288 + Styles.RowCaption = cxStyle288 + BuiltIn = True + end + object GridTableViewStyleSheetHighContrast2: TcxGridTableViewStyleSheet + Caption = 'High Contrast #2' + Styles.Content = cxStyle303 + Styles.ContentEven = cxStyle304 + Styles.ContentOdd = cxStyle305 + Styles.Inactive = cxStyle307 + Styles.Selection = cxStyle300 + Styles.Footer = cxStyle298 + Styles.Group = cxStyle306 + Styles.GroupByBox = cxStyle301 + Styles.Header = cxStyle299 + Styles.Indicator = cxStyle308 + Styles.Preview = cxStyle302 + BuiltIn = True + end + object GridBandedTableViewStyleSheetHighContrast2: TcxGridBandedTableViewStyleSheet + Caption = 'High Contrast #2' + Styles.Content = cxStyle303 + Styles.ContentEven = cxStyle304 + Styles.ContentOdd = cxStyle305 + Styles.Inactive = cxStyle307 + Styles.Selection = cxStyle300 + Styles.Footer = cxStyle298 + Styles.Group = cxStyle306 + Styles.GroupByBox = cxStyle301 + Styles.Header = cxStyle299 + Styles.Indicator = cxStyle308 + Styles.Preview = cxStyle302 + Styles.BandHeader = cxStyle308 + BuiltIn = True + end + object GridCardViewStyleSheetHighContrast2: TcxGridCardViewStyleSheet + Caption = 'High Contrast #2' + Styles.Content = cxStyle303 + Styles.ContentEven = cxStyle304 + Styles.ContentOdd = cxStyle305 + Styles.Inactive = cxStyle307 + Styles.Selection = cxStyle300 + Styles.CaptionRow = cxStyle299 + Styles.RowCaption = cxStyle299 + BuiltIn = True + end + object GridTableViewStyleSheetHighContrast2large: TcxGridTableViewStyleSheet + Caption = 'High Contrast #2 (large)' + Styles.Content = cxStyle314 + Styles.ContentEven = cxStyle315 + Styles.ContentOdd = cxStyle316 + Styles.Inactive = cxStyle318 + Styles.Selection = cxStyle311 + Styles.Footer = cxStyle309 + Styles.Group = cxStyle317 + Styles.GroupByBox = cxStyle312 + Styles.Header = cxStyle310 + Styles.Indicator = cxStyle319 + Styles.Preview = cxStyle313 + BuiltIn = True + end + object GridBandedTableViewStyleSheetHighContrast2large: TcxGridBandedTableViewStyleSheet + Caption = 'High Contrast #2 (large)' + Styles.Content = cxStyle314 + Styles.ContentEven = cxStyle315 + Styles.ContentOdd = cxStyle316 + Styles.Inactive = cxStyle318 + Styles.Selection = cxStyle311 + Styles.Footer = cxStyle309 + Styles.Group = cxStyle317 + Styles.GroupByBox = cxStyle312 + Styles.Header = cxStyle310 + Styles.Indicator = cxStyle319 + Styles.Preview = cxStyle313 + Styles.BandHeader = cxStyle319 + BuiltIn = True + end + object GridCardViewStyleSheetHighContrast2large: TcxGridCardViewStyleSheet + Caption = 'High Contrast #2 (large)' + Styles.Content = cxStyle314 + Styles.ContentEven = cxStyle315 + Styles.ContentOdd = cxStyle316 + Styles.Inactive = cxStyle318 + Styles.Selection = cxStyle311 + Styles.CaptionRow = cxStyle310 + Styles.RowCaption = cxStyle310 + BuiltIn = True + end + object GridTableViewStyleSheetHighContrastBlack: TcxGridTableViewStyleSheet + Caption = 'High Contrast Black' + Styles.Content = cxStyle325 + Styles.ContentEven = cxStyle326 + Styles.ContentOdd = cxStyle327 + Styles.Inactive = cxStyle329 + Styles.Selection = cxStyle322 + Styles.Footer = cxStyle320 + Styles.Group = cxStyle328 + Styles.GroupByBox = cxStyle323 + Styles.Header = cxStyle321 + Styles.Indicator = cxStyle330 + Styles.Preview = cxStyle324 + BuiltIn = True + end + object GridBandedTableViewStyleSheetHighContrastBlack: TcxGridBandedTableViewStyleSheet + Caption = 'High Contrast Black' + Styles.Content = cxStyle325 + Styles.ContentEven = cxStyle326 + Styles.ContentOdd = cxStyle327 + Styles.Inactive = cxStyle329 + Styles.Selection = cxStyle322 + Styles.Footer = cxStyle320 + Styles.Group = cxStyle328 + Styles.GroupByBox = cxStyle323 + Styles.Header = cxStyle321 + Styles.Indicator = cxStyle330 + Styles.Preview = cxStyle324 + Styles.BandHeader = cxStyle330 + BuiltIn = True + end + object GridCardViewStyleSheetHighContrastBlack: TcxGridCardViewStyleSheet + Caption = 'High Contrast Black' + Styles.Content = cxStyle325 + Styles.ContentEven = cxStyle326 + Styles.ContentOdd = cxStyle327 + Styles.Inactive = cxStyle329 + Styles.Selection = cxStyle322 + Styles.CaptionRow = cxStyle321 + Styles.RowCaption = cxStyle321 + BuiltIn = True + end + object GridTableViewStyleSheetHighContrastBlacklarge: TcxGridTableViewStyleSheet + Caption = 'High Contrast Black (large)' + Styles.Content = cxStyle336 + Styles.ContentEven = cxStyle337 + Styles.ContentOdd = cxStyle338 + Styles.Inactive = cxStyle340 + Styles.Selection = cxStyle333 + Styles.Footer = cxStyle331 + Styles.Group = cxStyle339 + Styles.GroupByBox = cxStyle334 + Styles.Header = cxStyle332 + Styles.Indicator = cxStyle341 + Styles.Preview = cxStyle335 + BuiltIn = True + end + object GridBandedTableViewStyleSheetHighContrastBlacklarge: TcxGridBandedTableViewStyleSheet + Caption = 'High Contrast Black (large)' + Styles.Content = cxStyle336 + Styles.ContentEven = cxStyle337 + Styles.ContentOdd = cxStyle338 + Styles.Inactive = cxStyle340 + Styles.Selection = cxStyle333 + Styles.Footer = cxStyle331 + Styles.Group = cxStyle339 + Styles.GroupByBox = cxStyle334 + Styles.Header = cxStyle332 + Styles.Indicator = cxStyle341 + Styles.Preview = cxStyle335 + Styles.BandHeader = cxStyle341 + BuiltIn = True + end + object GridCardViewStyleSheetHighContrastBlacklarge: TcxGridCardViewStyleSheet + Caption = 'High Contrast Black (large)' + Styles.Content = cxStyle336 + Styles.ContentEven = cxStyle337 + Styles.ContentOdd = cxStyle338 + Styles.Inactive = cxStyle340 + Styles.Selection = cxStyle333 + Styles.CaptionRow = cxStyle332 + Styles.RowCaption = cxStyle332 + BuiltIn = True + end + object GridTableViewStyleSheetHighContrastWhite: TcxGridTableViewStyleSheet + Caption = 'High Contrast White' + Styles.Content = cxStyle347 + Styles.ContentEven = cxStyle348 + Styles.ContentOdd = cxStyle349 + Styles.Inactive = cxStyle351 + Styles.Selection = cxStyle344 + Styles.Footer = cxStyle342 + Styles.Group = cxStyle350 + Styles.GroupByBox = cxStyle345 + Styles.Header = cxStyle343 + Styles.Indicator = cxStyle352 + Styles.Preview = cxStyle346 + BuiltIn = True + end + object GridBandedTableViewStyleSheetHighContrastWhite: TcxGridBandedTableViewStyleSheet + Caption = 'High Contrast White' + Styles.Content = cxStyle347 + Styles.ContentEven = cxStyle348 + Styles.ContentOdd = cxStyle349 + Styles.Inactive = cxStyle351 + Styles.Selection = cxStyle344 + Styles.Footer = cxStyle342 + Styles.Group = cxStyle350 + Styles.GroupByBox = cxStyle345 + Styles.Header = cxStyle343 + Styles.Indicator = cxStyle352 + Styles.Preview = cxStyle346 + Styles.BandHeader = cxStyle343 + BuiltIn = True + end + object GridCardViewStyleSheetHighContrastWhite: TcxGridCardViewStyleSheet + Caption = 'High Contrast White' + Styles.Content = cxStyle347 + Styles.ContentEven = cxStyle348 + Styles.ContentOdd = cxStyle349 + Styles.Inactive = cxStyle351 + Styles.Selection = cxStyle344 + Styles.CaptionRow = cxStyle343 + Styles.RowCaption = cxStyle343 + BuiltIn = True + end + object GridTableViewStyleSheetHighContrastWhitelarge: TcxGridTableViewStyleSheet + Caption = 'High Contrast White (large)' + Styles.Content = cxStyle358 + Styles.ContentEven = cxStyle359 + Styles.ContentOdd = cxStyle360 + Styles.Inactive = cxStyle362 + Styles.Selection = cxStyle355 + Styles.Footer = cxStyle353 + Styles.Group = cxStyle361 + Styles.GroupByBox = cxStyle356 + Styles.Header = cxStyle354 + Styles.Indicator = cxStyle363 + Styles.Preview = cxStyle357 + BuiltIn = True + end + object GridBandedTableViewStyleSheetHighContrastWhitelarge: TcxGridBandedTableViewStyleSheet + Caption = 'High Contrast White (large)' + Styles.Content = cxStyle358 + Styles.ContentEven = cxStyle359 + Styles.ContentOdd = cxStyle360 + Styles.Inactive = cxStyle362 + Styles.Selection = cxStyle355 + Styles.Footer = cxStyle353 + Styles.Group = cxStyle361 + Styles.GroupByBox = cxStyle356 + Styles.Header = cxStyle354 + Styles.Indicator = cxStyle363 + Styles.Preview = cxStyle357 + Styles.BandHeader = cxStyle354 + BuiltIn = True + end + object GridCardViewStyleSheetHighContrastWhitelarge: TcxGridCardViewStyleSheet + Caption = 'High Contrast White (large)' + Styles.Content = cxStyle358 + Styles.ContentEven = cxStyle359 + Styles.ContentOdd = cxStyle360 + Styles.Inactive = cxStyle362 + Styles.Selection = cxStyle355 + Styles.CaptionRow = cxStyle354 + Styles.RowCaption = cxStyle354 + BuiltIn = True + end + end +end diff --git a/official/x.35/Lib/D11/cxGridReg.dcr b/official/x.35/Lib/D11/cxGridReg.dcr new file mode 100644 index 00000000..676aae5e Binary files /dev/null and b/official/x.35/Lib/D11/cxGridReg.dcr differ diff --git a/official/x.35/Lib/D11/cxGridReg.dcu b/official/x.35/Lib/D11/cxGridReg.dcu new file mode 100644 index 00000000..e28b6e61 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridReg.dcu differ diff --git a/official/x.35/Lib/D11/cxGridRows.dcu b/official/x.35/Lib/D11/cxGridRows.dcu new file mode 100644 index 00000000..3f083628 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridRows.dcu differ diff --git a/official/x.35/Lib/D11/cxGridStdPopupMenu.dcu b/official/x.35/Lib/D11/cxGridStdPopupMenu.dcu new file mode 100644 index 00000000..1f9b2fdd Binary files /dev/null and b/official/x.35/Lib/D11/cxGridStdPopupMenu.dcu differ diff --git a/official/x.35/Lib/D11/cxGridStrs.dcu b/official/x.35/Lib/D11/cxGridStrs.dcu new file mode 100644 index 00000000..f5d74c97 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridStrs.dcu differ diff --git a/official/x.35/Lib/D11/cxGridStructureNavigator.dcu b/official/x.35/Lib/D11/cxGridStructureNavigator.dcu new file mode 100644 index 00000000..451c3514 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridStructureNavigator.dcu differ diff --git a/official/x.35/Lib/D11/cxGridStyleSheetsPreview.dcu b/official/x.35/Lib/D11/cxGridStyleSheetsPreview.dcu new file mode 100644 index 00000000..763e2259 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridStyleSheetsPreview.dcu differ diff --git a/official/x.35/Lib/D11/cxGridTableView.dcu b/official/x.35/Lib/D11/cxGridTableView.dcu new file mode 100644 index 00000000..53dc6637 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridTableView.dcu differ diff --git a/official/x.35/Lib/D11/cxGridUIBandedTableHelper.dcu b/official/x.35/Lib/D11/cxGridUIBandedTableHelper.dcu new file mode 100644 index 00000000..8af15348 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridUIBandedTableHelper.dcu differ diff --git a/official/x.35/Lib/D11/cxGridUICardHelper.dcu b/official/x.35/Lib/D11/cxGridUICardHelper.dcu new file mode 100644 index 00000000..5c5f262f Binary files /dev/null and b/official/x.35/Lib/D11/cxGridUICardHelper.dcu differ diff --git a/official/x.35/Lib/D11/cxGridUICustomTableHelper.dcu b/official/x.35/Lib/D11/cxGridUICustomTableHelper.dcu new file mode 100644 index 00000000..cc5eae79 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridUICustomTableHelper.dcu differ diff --git a/official/x.35/Lib/D11/cxGridUIHelper.dcu b/official/x.35/Lib/D11/cxGridUIHelper.dcu new file mode 100644 index 00000000..d15310de Binary files /dev/null and b/official/x.35/Lib/D11/cxGridUIHelper.dcu differ diff --git a/official/x.35/Lib/D11/cxGridUITableHelper.dcu b/official/x.35/Lib/D11/cxGridUITableHelper.dcu new file mode 100644 index 00000000..9a97a3b7 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridUITableHelper.dcu differ diff --git a/official/x.35/Lib/D11/cxGridViewLayoutEditor.dcu b/official/x.35/Lib/D11/cxGridViewLayoutEditor.dcu new file mode 100644 index 00000000..229f90f8 Binary files /dev/null and b/official/x.35/Lib/D11/cxGridViewLayoutEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxGridViewLayoutEditor.dfm b/official/x.35/Lib/D11/cxGridViewLayoutEditor.dfm new file mode 100644 index 00000000..f4520c95 --- /dev/null +++ b/official/x.35/Lib/D11/cxGridViewLayoutEditor.dfm @@ -0,0 +1,110 @@ +object cxGridViewLayoutEditor: TcxGridViewLayoutEditor + Left = 350 + Top = 204 + BorderIcons = [biSystemMenu] + Caption = 'Layout and Data Editor' + ClientHeight = 466 + ClientWidth = 692 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object pnlBottom: TPanel + Left = 0 + Top = 432 + Width = 692 + Height = 34 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + object pnlButtons: TPanel + Left = 523 + Top = 0 + Width = 169 + Height = 34 + Align = alRight + BevelOuter = bvNone + TabOrder = 2 + object btnOK: TcxButton + Left = 4 + Top = 5 + Width = 75 + Height = 24 + Caption = 'OK' + ModalResult = 1 + TabOrder = 0 + end + object btnCancel: TcxButton + Left = 89 + Top = 5 + Width = 75 + Height = 24 + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + end + object pnlLayoutCustomization: TPanel + Left = 0 + Top = 0 + Width = 153 + Height = 34 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object btnLayoutCustomization: TcxButton + Left = 8 + Top = 5 + Width = 134 + Height = 24 + TabOrder = 0 + OnClick = btnLayoutCustomizationClick + end + end + object pnlSaveOptions: TPanel + Left = 153 + Top = 0 + Width = 192 + Height = 34 + Align = alLeft + BevelOuter = bvNone + TabOrder = 1 + object chbSaveLayout: TcxCheckBox + Left = 11 + Top = 7 + Caption = 'Save layout' + State = cbsChecked + TabOrder = 0 + Width = 81 + end + object chbSaveData: TcxCheckBox + Left = 107 + Top = 7 + Caption = 'Save data' + State = cbsChecked + TabOrder = 1 + Width = 81 + end + end + end + object pnlClient: TPanel + Left = 0 + Top = 0 + Width = 692 + Height = 432 + Align = alClient + BevelOuter = bvNone + BorderWidth = 3 + Constraints.MinHeight = 200 + Constraints.MinWidth = 300 + TabOrder = 1 + end + object pmGrid: TcxGridPopupMenu + PopupMenus = <> + Left = 400 + Top = 319 + end +end diff --git a/official/x.35/Lib/D11/cxGroupBox.dcu b/official/x.35/Lib/D11/cxGroupBox.dcu new file mode 100644 index 00000000..d2cb4514 Binary files /dev/null and b/official/x.35/Lib/D11/cxGroupBox.dcu differ diff --git a/official/x.35/Lib/D11/cxHeader.dcu b/official/x.35/Lib/D11/cxHeader.dcu new file mode 100644 index 00000000..a4a7fd8f Binary files /dev/null and b/official/x.35/Lib/D11/cxHeader.dcu differ diff --git a/official/x.35/Lib/D11/cxHint.dcu b/official/x.35/Lib/D11/cxHint.dcu new file mode 100644 index 00000000..983e0a52 Binary files /dev/null and b/official/x.35/Lib/D11/cxHint.dcu differ diff --git a/official/x.35/Lib/D11/cxHintEditor.dcu b/official/x.35/Lib/D11/cxHintEditor.dcu new file mode 100644 index 00000000..ce2123de Binary files /dev/null and b/official/x.35/Lib/D11/cxHintEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxHintEditor.dfm b/official/x.35/Lib/D11/cxHintEditor.dfm new file mode 100644 index 00000000..6fa55de5 --- /dev/null +++ b/official/x.35/Lib/D11/cxHintEditor.dfm @@ -0,0 +1,586 @@ +object cxHintStyleEditor: TcxHintStyleEditor + Left = 195 + Top = 125 + BorderStyle = bsDialog + ClientHeight = 440 + ClientWidth = 576 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + ShowHint = True + OnActivate = FormActivate + OnCreate = FormCreate + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object lblHintColour: TLabel + Left = 8 + Top = 412 + Width = 46 + Height = 13 + Caption = 'Hint Color' + end + object cxBtnOk: TcxButton + Left = 415 + Top = 408 + Width = 75 + Height = 25 + Hint = 'Accept you changes and return to the Grep Demo' + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 9 + end + object cxBtnCancel: TcxButton + Left = 495 + Top = 408 + Width = 75 + Height = 25 + Hint = 'Discard your changes and return to the grep demo' + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 10 + end + object cxCbStandard: TcxCheckBox + Left = 304 + Top = 408 + Width = 105 + Height = 21 + Hint = 'Check to display hints in the standard Windows way' + Properties.DisplayUnchecked = 'False' + Properties.Caption = 'Standard Hints' + TabOrder = 7 + OnClick = cxCbStandardClick + end + object cxGbHintFont: TcxGroupBox + Left = 8 + Top = 8 + Width = 185 + Height = 185 + Alignment = alTopLeft + Caption = ' Hint Font ' + TabOrder = 0 + object Label1: TLabel + Left = 12 + Top = 80 + Width = 23 + Height = 13 + Caption = 'Style' + end + object Label2: TLabel + Left = 124 + Top = 80 + Width = 20 + Height = 13 + Caption = 'Size' + end + object Label3: TLabel + Left = 12 + Top = 40 + Width = 24 + Height = 13 + Caption = 'Color' + end + object cxFnHint: TcxFontNameComboBox + Left = 12 + Top = 16 + Width = 161 + Height = 21 + Hint = 'Font for the hint windows' + Properties.FontPreview.Visible = False + Properties.OnChange = cxFnHintPropertiesChange + TabOrder = 0 + OnClick = cxFnHintClick + end + object cxClbHintFontStyles: TcxCheckListBox + Left = 12 + Top = 96 + Width = 105 + Height = 81 + Hint = 'Font Style for Hints' + Columns = 0 + EditValue = 0 + Items = < + item + Tag = 0 + Text = 'Bold' + end + item + Tag = 0 + Text = 'Italics' + end + item + Tag = 0 + Text = 'Underline' + end + item + Tag = 0 + Text = 'Strike Thro' + end> + ParentColor = False + ScrollWidth = 0 + TabOrder = 2 + TabWidth = 0 + OnClickCheck = cxClbHintFontStylesClickCheck + end + object cxLbHfSize: TcxListBox + Left = 124 + Top = 96 + Width = 49 + Height = 81 + Hint = 'Font Size for Hints' + ExtendedSelect = False + ItemHeight = 13 + ParentColor = False + TabOrder = 3 + OnClick = cxLbHfSizeClick + end + object cxCcbHintFontColour: TcxColorComboBox + Left = 12 + Top = 56 + Width = 161 + Height = 21 + Properties.DefaultDescription = 'Color not selected' + Properties.Items = <> + Properties.PrepareInfo = '' + TabOrder = 1 + OnClick = cxCcbHintFontColourClick + end + end + object cxgbHintCapFont: TcxGroupBox + Left = 200 + Top = 8 + Width = 185 + Height = 185 + Alignment = alTopLeft + Caption = ' Hint Caption Font ' + TabOrder = 1 + object Label4: TLabel + Left = 12 + Top = 80 + Width = 23 + Height = 13 + Caption = 'Style' + end + object Label5: TLabel + Left = 124 + Top = 80 + Width = 20 + Height = 13 + Caption = 'Size' + end + object Label6: TLabel + Left = 12 + Top = 40 + Width = 24 + Height = 13 + Caption = 'Color' + end + object cxFnHinCap: TcxFontNameComboBox + Left = 12 + Top = 16 + Width = 161 + Height = 21 + Hint = 'Font for the hint windows' + Properties.FontPreview.Visible = False + Properties.OnChange = cxFnHinCapPropertiesChange + TabOrder = 0 + OnClick = cxFnHinCapClick + end + object cxClbHintCapFontStyles: TcxCheckListBox + Tag = 1 + Left = 12 + Top = 96 + Width = 105 + Height = 81 + Hint = 'Font Style for Hint Captions' + Columns = 0 + EditValue = 0 + Items = < + item + Tag = 0 + Text = 'Bold' + end + item + Tag = 0 + Text = 'Italics' + end + item + Tag = 0 + Text = 'Underline' + end + item + Tag = 0 + Text = 'Strike Thro' + end> + ParentColor = False + ScrollWidth = 0 + TabOrder = 2 + TabWidth = 0 + OnClickCheck = cxClbHintFontStylesClickCheck + end + object cxLbHcfSize: TcxListBox + Left = 124 + Top = 96 + Width = 49 + Height = 81 + Hint = 'Font Size for Hint Caption' + ItemHeight = 13 + ParentColor = False + TabOrder = 3 + OnClick = cxLbHcfSizeClick + end + object cxCcbHintCapColor: TcxColorComboBox + Left = 12 + Top = 56 + Width = 161 + Height = 21 + Properties.DefaultDescription = 'Color not selected' + Properties.Items = <> + Properties.PrepareInfo = '' + TabOrder = 1 + OnClick = cxCcbHintCapColorClick + end + end + object cxGbHintShape: TcxGroupBox + Left = 392 + Top = 8 + Width = 177 + Height = 89 + Alignment = alTopLeft + Caption = ' Shape ' + ParentFont = False + TabOrder = 2 + object Label7: TLabel + Left = 8 + Top = 14 + Width = 72 + Height = 13 + Caption = 'Callout Position' + end + object Label8: TLabel + Left = 8 + Top = 64 + Width = 68 + Height = 13 + Caption = 'Round Radius' + end + object cxCbHintCalloutPos: TcxComboBox + Left = 8 + Top = 32 + Width = 161 + Height = 21 + Hint = 'The '#39'Callout'#39' position' + Properties.DropDownListStyle = lsFixedList + Properties.Items.Strings = ( + 'None' + 'Auto' + 'Left Bottom' + 'Left Top' + 'Top Left' + 'Top Right' + 'Right Bottom' + 'Right Top' + 'Bottom Right' + 'Bottom Left') + TabOrder = 0 + OnClick = cxCbHintCalloutPosClick + end + object cxcbHintRounded: TcxCheckBox + Left = 96 + Top = 10 + Width = 75 + Height = 21 + Hint = 'Rounded corners on the hint windows' + ParentBackground = False + Properties.DisplayUnchecked = 'False' + Properties.OnChange = cxcbHintRoundedPropertiesChange + Properties.Caption = 'Rounded' + TabOrder = 1 + end + object cxSeHintRadius: TcxSpinEdit + Left = 88 + Top = 60 + Width = 81 + Height = 21 + Hint = 'Radius of the rounded corners if enabled' + Properties.MaxValue = 100 + Properties.MinValue = 5 + Properties.SpinButtons.ShowFastButtons = True + Properties.OnChange = cxSeHintRadiusPropertiesChange + TabOrder = 2 + Value = 11 + end + end + object cxGbHintIcons: TcxGroupBox + Left = 8 + Top = 200 + Width = 185 + Height = 97 + Alignment = alTopLeft + Caption = ' Icons ' + TabOrder = 4 + object Label11: TLabel + Left = 8 + Top = 16 + Width = 48 + Height = 13 + Caption = 'Icon Type' + end + object cxCbHintIconType: TcxComboBox + Left = 8 + Top = 32 + Width = 169 + Height = 21 + Hint = 'The Icon type that will be displayed in the hint window' + ParentFont = False + Properties.DropDownListStyle = lsFixedList + Properties.Items.Strings = ( + 'None' + 'Application' + 'Information' + 'Warning' + 'Error' + 'Question' + 'WinLogo' + 'CurrentApplication') + TabOrder = 0 + OnClick = cxCbHintIconTypeClick + end + object cxRbHIDef: TcxRadioButton + Left = 8 + Top = 64 + Width = 57 + Height = 17 + Hint = 'Default Icon Size' + Caption = 'Default' + TabOrder = 1 + OnClick = cxRbHIDefClick + ParentBackground = False + end + object cxRbHILarge: TcxRadioButton + Tag = 1 + Left = 72 + Top = 64 + Width = 49 + Height = 17 + Hint = 'Large Icon Size' + Caption = 'Large' + TabOrder = 2 + OnClick = cxRbHIDefClick + ParentBackground = False + end + object cxRbHISmall: TcxRadioButton + Tag = 2 + Left = 128 + Top = 64 + Width = 49 + Height = 17 + Hint = 'Small Icon Size' + Caption = 'Small' + TabOrder = 3 + OnClick = cxRbHIDefClick + ParentBackground = False + end + end + object cxGbHintPause: TcxGroupBox + Left = 8 + Top = 304 + Width = 185 + Height = 97 + Alignment = alTopLeft + Caption = ' Timings ' + TabOrder = 5 + object Label18: TLabel + Left = 8 + Top = 24 + Width = 77 + Height = 13 + Caption = 'Hint Hide Pause' + end + object Label19: TLabel + Left = 8 + Top = 48 + Width = 52 + Height = 13 + Caption = 'Hint Pause' + end + object Label20: TLabel + Left = 8 + Top = 72 + Width = 80 + Height = 13 + Caption = 'Hint Short Pause' + end + object cxSeHintHidePause: TcxSpinEdit + Left = 96 + Top = 20 + Width = 81 + Height = 21 + Hint = 'The animation delay' + Properties.Increment = 100 + Properties.LargeIncrement = 500 + Properties.MaxValue = 10000 + Properties.MinValue = 500 + Properties.SpinButtons.ShowFastButtons = True + Properties.OnChange = cxSeHintHidePausePropertiesChange + TabOrder = 0 + Value = 2500 + end + object cxSeHintPause: TcxSpinEdit + Left = 96 + Top = 44 + Width = 81 + Height = 21 + Hint = 'The animation delay' + Properties.Increment = 10 + Properties.LargeIncrement = 100 + Properties.MaxValue = 1000 + Properties.MinValue = 50 + Properties.SpinButtons.ShowFastButtons = True + Properties.OnChange = cxSeHintPausePropertiesChange + TabOrder = 1 + Value = 500 + end + object cxSeShortHintPause: TcxSpinEdit + Left = 96 + Top = 68 + Width = 81 + Height = 21 + Hint = 'The animation delay' + Properties.Increment = 5 + Properties.MaxValue = 1000 + Properties.MinValue = 10 + Properties.SpinButtons.ShowFastButtons = True + Properties.OnChange = cxSeHintDelayPropertiesChange + Properties.OnEditValueChanged = cxSeShortHintPausePropertiesEditValueChanged + TabOrder = 2 + Value = 50 + end + end + object cxCcbHintColour: TcxColorComboBox + Left = 72 + Top = 408 + Width = 225 + Height = 21 + Hint = 'Background Color for the hint windows' + Properties.AllowSelectColor = True + Properties.DefaultDescription = 'Color not selected' + Properties.ImmediatePost = True + Properties.OnEditValueChanged = cxCcbHintColourPropertiesEditValueChanged + Properties.Items = <> + Properties.PrepareInfo = '' + TabOrder = 6 + end + object cxGbHintAnimation: TcxGroupBox + Left = 392 + Top = 104 + Width = 177 + Height = 89 + Alignment = alTopLeft + Caption = ' Animation ' + TabOrder = 3 + object Label9: TLabel + Left = 8 + Top = 16 + Width = 72 + Height = 13 + Caption = 'Animation Style' + end + object Label10: TLabel + Left = 8 + Top = 64 + Width = 30 + Height = 13 + Caption = 'Delay ' + end + object cxCbHintAniStyle: TcxComboBox + Left = 8 + Top = 32 + Width = 161 + Height = 21 + Hint = 'The animation style used to display hints' + Properties.DropDownListStyle = lsFixedList + Properties.Items.Strings = ( + 'Slide From Left' + 'Slide From Right' + 'Slide Downward' + 'Slide Upward' + 'Slide From Center' + 'Hide' + 'Activate' + 'Fade In' + 'Auto' + 'None') + Properties.OnChange = cxCbHintAniStylePropertiesChange + TabOrder = 0 + end + object cxSeHintDelay: TcxSpinEdit + Left = 88 + Top = 60 + Width = 81 + Height = 21 + Hint = 'The animation delay' + Properties.MaxValue = 1000 + Properties.MinValue = 50 + Properties.SpinButtons.ShowFastButtons = True + Properties.OnChange = cxSeHintDelayPropertiesChange + TabOrder = 1 + Value = 100 + end + end + object cxGbPreview: TcxGroupBox + Left = 200 + Top = 200 + Width = 369 + Height = 201 + Alignment = alTopLeft + Caption = ' Preview ' + TabOrder = 8 + object pnlPreview: TPanel + Left = 2 + Top = 16 + Width = 365 + Height = 183 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + end + end + object cxHsc: TcxHintStyleController + Global = False + HintStyle.CaptionFont.Charset = DEFAULT_CHARSET + HintStyle.CaptionFont.Color = clWindowText + HintStyle.CaptionFont.Height = -13 + HintStyle.CaptionFont.Name = 'MS Sans Serif' + HintStyle.CaptionFont.Style = [fsBold] + HintStyle.Font.Charset = DEFAULT_CHARSET + HintStyle.Font.Color = clWindowText + HintStyle.Font.Height = -11 + HintStyle.Font.Name = 'MS Sans Serif' + HintStyle.Font.Style = [] + HintStyle.RoundRadius = 15 + HintPause = 700 + Left = 216 + Top = 216 + end + object cxEditStyleController1: TcxEditStyleController + Style.LookAndFeel.Kind = lfFlat + Style.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.Kind = lfFlat + StyleDisabled.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.Kind = lfFlat + StyleFocused.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.Kind = lfFlat + StyleHot.LookAndFeel.NativeStyle = True + Left = 216 + Top = 248 + end +end diff --git a/official/x.35/Lib/D11/cxHtmlXmlTxtExport.dcu b/official/x.35/Lib/D11/cxHtmlXmlTxtExport.dcu new file mode 100644 index 00000000..3c7bd6c1 Binary files /dev/null and b/official/x.35/Lib/D11/cxHtmlXmlTxtExport.dcu differ diff --git a/official/x.35/Lib/D11/cxHyperLinkEdit.dcu b/official/x.35/Lib/D11/cxHyperLinkEdit.dcu new file mode 100644 index 00000000..2e3300a2 Binary files /dev/null and b/official/x.35/Lib/D11/cxHyperLinkEdit.dcu differ diff --git a/official/x.35/Lib/D11/cxIBXAdapters.dcu b/official/x.35/Lib/D11/cxIBXAdapters.dcu new file mode 100644 index 00000000..83e09699 Binary files /dev/null and b/official/x.35/Lib/D11/cxIBXAdapters.dcu differ diff --git a/official/x.35/Lib/D11/cxIBXAdaptersD11.bpl b/official/x.35/Lib/D11/cxIBXAdaptersD11.bpl new file mode 100644 index 00000000..eab2eb47 Binary files /dev/null and b/official/x.35/Lib/D11/cxIBXAdaptersD11.bpl differ diff --git a/official/x.35/Lib/D11/cxIBXAdaptersD11.dcp b/official/x.35/Lib/D11/cxIBXAdaptersD11.dcp new file mode 100644 index 00000000..d6c381a1 Binary files /dev/null and b/official/x.35/Lib/D11/cxIBXAdaptersD11.dcp differ diff --git a/official/x.35/Lib/D11/cxIBXAdaptersD11.dcu b/official/x.35/Lib/D11/cxIBXAdaptersD11.dcu new file mode 100644 index 00000000..511bac03 Binary files /dev/null and b/official/x.35/Lib/D11/cxIBXAdaptersD11.dcu differ diff --git a/official/x.35/Lib/D11/cxImage.dcu b/official/x.35/Lib/D11/cxImage.dcu new file mode 100644 index 00000000..57ff6933 Binary files /dev/null and b/official/x.35/Lib/D11/cxImage.dcu differ diff --git a/official/x.35/Lib/D11/cxImageComboBox.dcu b/official/x.35/Lib/D11/cxImageComboBox.dcu new file mode 100644 index 00000000..4095e7c8 Binary files /dev/null and b/official/x.35/Lib/D11/cxImageComboBox.dcu differ diff --git a/official/x.35/Lib/D11/cxImageComboBoxItemsEditor.dcu b/official/x.35/Lib/D11/cxImageComboBoxItemsEditor.dcu new file mode 100644 index 00000000..ff544541 Binary files /dev/null and b/official/x.35/Lib/D11/cxImageComboBoxItemsEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxImageComboBoxItemsEditor.dfm b/official/x.35/Lib/D11/cxImageComboBoxItemsEditor.dfm new file mode 100644 index 00000000..05fc0860 --- /dev/null +++ b/official/x.35/Lib/D11/cxImageComboBoxItemsEditor.dfm @@ -0,0 +1,227 @@ +object fmImageComboBoxItemsEditor: TfmImageComboBoxItemsEditor + Left = 287 + Top = 190 + AutoScroll = False + Caption = 'fmImageComboBoxItemsEditor' + ClientHeight = 266 + ClientWidth = 573 + Color = clBtnFace + Constraints.MinHeight = 300 + Constraints.MinWidth = 581 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 480 + Top = 0 + Width = 93 + Height = 266 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object Bevel1: TBevel + Left = 0 + Top = 0 + Width = 6 + Height = 266 + Align = alLeft + Shape = bsLeftLine + end + object btnAdd: TcxButton + Left = 6 + Top = 12 + Width = 83 + Height = 22 + Anchors = [akTop, akRight] + Caption = '&Add' + TabOrder = 0 + OnClick = btnAddClick + LookAndFeel.NativeStyle = True + end + object btnDelete: TcxButton + Left = 6 + Top = 76 + Width = 83 + Height = 22 + Anchors = [akTop, akRight] + Caption = '&Delete' + TabOrder = 2 + OnClick = btnDeleteClick + LookAndFeel.NativeStyle = True + end + object btnInsert: TcxButton + Left = 6 + Top = 44 + Width = 83 + Height = 22 + Anchors = [akTop, akRight] + Caption = '&Insert' + TabOrder = 1 + OnClick = btnInsertClick + LookAndFeel.NativeStyle = True + end + object btnOk: TcxButton + Left = 6 + Top = 201 + Width = 83 + Height = 22 + Anchors = [akRight, akBottom] + Caption = '&OK' + ModalResult = 1 + TabOrder = 5 + OnClick = btnOkClick + LookAndFeel.NativeStyle = True + end + object btnCancel: TcxButton + Left = 6 + Top = 233 + Width = 83 + Height = 22 + Anchors = [akRight, akBottom] + Caption = '&Cancel' + ModalResult = 2 + TabOrder = 6 + LookAndFeel.NativeStyle = True + end + object btnSelectAll: TcxButton + Left = 6 + Top = 108 + Width = 83 + Height = 22 + Anchors = [akTop, akRight] + Caption = '&Select All' + TabOrder = 3 + OnClick = btnSelectAllClick + LookAndFeel.NativeStyle = True + end + object btnValueType: TcxButton + Left = 6 + Top = 140 + Width = 83 + Height = 22 + Anchors = [akTop, akRight] + Caption = 'Set Value&Type' + TabOrder = 4 + DropDownMenu = mnuValueTypes + Kind = cxbkDropDown + LookAndFeel.NativeStyle = True + end + end + object Panel3: TPanel + Left = 0 + Top = 0 + Width = 480 + Height = 266 + Align = alClient + BevelOuter = bvNone + Caption = 'Panel3' + TabOrder = 0 + object cxgImageComboBoxItems: TcxGrid + Left = 0 + Top = 0 + Width = 480 + Height = 266 + Align = alClient + TabOrder = 0 + LookAndFeel.NativeStyle = True + object tvImageComboBoxItems: TcxGridTableView + OnKeyDown = tvImageComboBoxItemsKeyDown + NavigatorButtons.ConfirmDelete = False + OnEditKeyDown = tvImageComboBoxItemsEditKeyDown + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = <> + DataController.Summary.SummaryGroups = <> + DataController.OnRecordChanged = tvImageComboBoxItemsDataControllerRecordChanged + DataController.Data = { + 960000000F00000044617461436F6E74726F6C6C657231050000001300000054 + 6378496E746567657256616C75655479706512000000546378537472696E6756 + 616C75655479706512000000546378537472696E6756616C7565547970651200 + 0000546378537472696E6756616C75655479706513000000546378496E746567 + 657256616C756554797065010000000001010001000000300101} + OptionsBehavior.CellHints = True + OptionsBehavior.ImmediateEditor = False + OptionsBehavior.ColumnHeaderHints = False + OptionsCustomize.ColumnFiltering = False + OptionsCustomize.ColumnGrouping = False + OptionsCustomize.ColumnHidingOnGrouping = False + OptionsCustomize.ColumnMoving = False + OptionsData.DeletingConfirmation = False + OptionsData.Inserting = False + OptionsSelection.MultiSelect = True + OptionsSelection.UnselectFocusedRecordOnExit = False + OptionsView.CellEndEllipsis = True + OptionsView.ShowEditButtons = gsebAlways + OptionsView.ColumnAutoWidth = True + OptionsView.ExpandButtonsForEmptyDetails = False + OptionsView.GroupByBox = False + object clnImage: TcxGridColumn + Caption = 'Image' + DataBinding.ValueType = 'Integer' + PropertiesClassName = 'TcxImageComboBoxProperties' + Properties.Items = < + item + end> + Properties.ShowDescriptions = False + MinWidth = 36 + Options.HorzSizing = False + Width = 36 + end + object clnDescription: TcxGridColumn + Caption = 'Description' + Width = 168 + end + object clnValue: TcxGridColumn + Caption = 'Value' + PropertiesClassName = 'TcxTextEditProperties' + Width = 109 + end + object clnValueType: TcxGridColumn + Caption = 'ValueType' + PropertiesClassName = 'TcxComboBoxProperties' + Properties.DropDownListStyle = lsFixedList + Properties.ImmediatePost = True + Properties.OnEditValueChanged = clnValueTypePropertiesEditValueChanged + Width = 117 + end + object clnTag: TcxGridColumn + Caption = 'Tag' + DataBinding.ValueType = 'Integer' + PropertiesClassName = 'TcxMaskEditProperties' + Properties.MaskKind = emkRegExprEx + Properties.EditMask = '\d+' + Width = 51 + end + end + object lvImageComboBoxItems: TcxGridLevel + GridView = tvImageComboBoxItems + end + end + end + object mnuValueTypes: TPopupMenu + Left = 390 + Top = 138 + object miAdd: TMenuItem + Caption = '&Add' + OnClick = miValueTypeClick + end + object miInsert: TMenuItem + Caption = '&Insert' + end + object miDelete: TMenuItem + Caption = '&Delete' + end + object N1: TMenuItem + Caption = '-' + end + object miHelp: TMenuItem + Caption = '&Help' + end + end +end diff --git a/official/x.35/Lib/D11/cxImageListEditor.dcu b/official/x.35/Lib/D11/cxImageListEditor.dcu new file mode 100644 index 00000000..96e70453 Binary files /dev/null and b/official/x.35/Lib/D11/cxImageListEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxImageListEditorView.dcu b/official/x.35/Lib/D11/cxImageListEditorView.dcu new file mode 100644 index 00000000..a2803605 Binary files /dev/null and b/official/x.35/Lib/D11/cxImageListEditorView.dcu differ diff --git a/official/x.35/Lib/D11/cxImageListEditorView.dfm b/official/x.35/Lib/D11/cxImageListEditorView.dfm new file mode 100644 index 00000000..18d02c08 --- /dev/null +++ b/official/x.35/Lib/D11/cxImageListEditorView.dfm @@ -0,0 +1,647 @@ +object cxImageListEditorForm: TcxImageListEditorForm + Left = 327 + Top = 272 + Anchors = [akLeft, akTop, akRight, akBottom] + AutoScroll = False + BorderIcons = [biSystemMenu] + Caption = 'cxImageListEditorForm' + ClientHeight = 287 + ClientWidth = 550 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -10 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object lblManifestWarning: TLabel + Left = 51 + Top = 249 + Width = 246 + Height = 32 + Anchors = [akLeft, akBottom] + AutoSize = False + Caption = 'Manifest Warning' + Transparent = True + Visible = False + WordWrap = True + end + object imgWarning: TImage + Left = 13 + Top = 249 + Width = 32 + Height = 32 + Anchors = [akLeft, akBottom] + AutoSize = True + Picture.Data = { + 055449636F6E0000010001002020000001002000A81000001600000028000000 + 2000000040000000010020000000000080100000000000000000000000000000 + 00000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + FFFFFF00414141003B3B3B5D383838B2343434CA313131CA2D2D2DCA292929CA + 262626CA222222CA1F1F1FCA1D1D1DCA191919CA161616CA141414CA101010CA + 0E0E0ECA0B0B0BCA090909CA070707CA050505CA030303CA010101CA000000CA + 000000CA000000CA000000CA000000CA000000CA000000CA000000B20000005D + 00000000434343403F3F3FE83B3B3BFF373737FF343434FF313131FF2D2D2DFF + 292929FF252525FF222222FF1F1F1FFF1B1B1BFF191919FF161616FF121212FF + 101010FF0D0D0DFF0B0B0BFF080808FF060606FF040404FF020202FF000000FF + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000E8 + 00000040484848BC434343FF404040FF3C3C3CFF363332FF302927FF2C2523FF + 29221FFF251D1BFF221A18FF1F1714FF1B1310FF18100DFF140C09FF120A06FF + 0F0703FF0C0400FF090000FF070000FF050000FF020000FF000000FF000000FF + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF + 000000BC4C4C4CEA484848FF454545FF3F3D3DFF70AABAFF86DBF3FF89E4FFFF + 85E2FFFF81E0FFFF7FDEFFFF7BDDFFFF79DCFFFF76DAFFFF73D9FFFF71D7FFFF + 6FD6FFFF6CD4FFFF6BD4FFFF68D3FFFF68D2FFFF67D1FFFF67D1FFFF67D0FFFF + 66D0FFFF66CFFFFF65CFFFFF63CBFAFF5492A5FF000000FF000000FF000000FF + 000000EA515151CA4C4C4CFF494949FF443F3DFF73B8C9FF63EEFFFF56E5FFFF + 52E3FFFF4CE0FFFF48DCFFFF43DAFFFF3ED8FFFF39D5FFFF34D3FFFF48DDFFFF + 4ED4FFFF4AD3FFFF3ED8FFFF21C9FFFF20C8FFFF20C7FFFF20C7FFFF1FC6FFFF + 1FC5FFFF1EC5FFFF1DC4FFFF25CBFFFF398FB6FF000000FF000000FF000000FF + 000000CA5252526B4F4F4FFF4C4C4CFF444140FF8EB4BDFF96F1FFFF74E2FFFF + 5FDDFFFF4FD8FFFF40D3FFFF3BCFFFFF38CEFFFF31CAFFFF48D4FFFF559DB7FF + 2D3A3FFF2A373CFF4D98B5FF35CBFFFF14BAFFFF16BAFFFF15B9FFFF14B8FFFF + 14B7FFFF13B6FFFF10B5FFFF1EC2FFFF3582A5FF000000FF000000FF000000FF + 0000006B6B6B6B0B696969D5646464FF585756FF7A7E7FFFD4F7FCFFC2F5FFFF + AFEEFFFF98EAFFFF79E1FFFF5AD9FFFF41D2FFFF37D1FFFF55C5ECFF32393CFF + 1F1714FF1B1310FF283135FF44BCEAFF1BC0FFFF17BBFFFF17BAFFFF17B9FFFF + 16B9FFFF15B8FFFF11B7FFFF35C1FCFF1B333EFF000000FF000000FF000000D5 + 0000000B7B7B7B007B7B7B5C757575FF6E6E6EFF656363FFB0C6CCFFC9FCFFFF + BAF2FFFFB3EFFFFFAAECFFFF9BE9FFFF7EE2FFFF5BDDFFFF59C0E3FF303537FF + 24201EFF211C1AFF292D2FFF44B6E3FF1FC3FFFF1ABDFFFF18BBFFFF17BAFFFF + 17BAFFFF14B8FFFF1FC4FFFF3A8AAEFF040302FF030202FF020202FF0000005C + 000000007D7D7D007D7D7D087A7A7AC7747474FF696868FF818688FFCCF4FBFF + BCF4FFFFB3F0FFFFABEDFFFFA1EBFFFF98E9FFFF8BE5FFFF8CE8FDFF5C808DFF + 2C3031FF2A2D2EFF4B7C8DFF48D2FEFF1FC0FFFF1EBFFFFF1ABDFFFF18BBFFFF + 17BBFFFF13BBFFFF39C1FAFF1E343EFF050100FF050606FF040404C702020208 + 0202020080808000808080007F7F7F4C7A7A7AFE737373FF6A6868FFADC2C6FF + C8FCFFFFB7F1FFFFAFF0FFFFA5EDFFFF9BEAFFFF8FE7FFFF89E6FFFF91E8FFFF + 75BCD3FF5DB2CEFF54D5FFFF2EC9FFFF24C3FFFF22C2FFFF1EBFFFFF1ABDFFFF + 16BBFFFF23C7FFFF3C86A5FF0C0705FF0A0909FF090909FE0606064C05050500 + 05050500828282008282820082828200808080B67A7A7AFF6F6F6EFF818687FF + C9F1F9FFBCF5FFFFB3F1FFFFAAEFFFFF9FECFFFF95E9FFFF88E5FFFF8CF0FFFF + 6D929DFF537581FF4FD7FFFF2AC9FFFF2AC7FFFF26C5FFFF21C1FFFF1DBFFFFF + 16BFFFFF3DC1F5FF25363CFF0E0A08FF0E0E0EFF0B0B0BB60909090009090900 + 09090900838383008383830083838300838383397F7F7FFA797979FF6F6D6CFF + ACC0C5FFC7FCFFFFB5F2FFFFAEF0FFFFA4EDFFFF9AEBFFFF8FE8FFFF97F0FFFF + 5A6E73FF4A5558FF71DAFBFF38D0FFFF2EC9FFFF2AC7FFFF26C4FFFF1EC1FFFF + 2ACCFFFF4087A2FF160F0DFF141514FF111111FA0E0E0E390B0B0B000B0B0B00 + 0B0B0B0086868600868686008686860086868600858585A37F7F7FFF757474FF + 838788FFC8F0F6FFBCF5FFFFB2F1FFFFA9EFFFFF9FECFFFF95EDFFFF9AE3F6FF + 515C5FFF434748FF80D3ECFF55DBFFFF36CDFFFF2FCAFFFF2AC8FFFF23C7FFFF + 45C4F1FF2D3A3FFF181412FF181818FF141414A3121212001212120012121200 + 12121200888888008888880088888800888888008888882B858585F17F7F7FFF + 747171FFABBFC3FFC6FBFFFFB5F2FFFFADF1FFFFA4EEFFFF9DF1FFFF9CD8E6FF + 484A4AFF3D3938FF80C1D4FF6BE3FFFF49D4FFFF34CEFFFF2DC9FFFF38D4FFFF + 4A89A0FF201916FF1F1F1FFF1B1B1BF11818182B171717001717170017171700 + 171717008B8B8B008B8B8B008B8B8B008B8B8B008B8B8B008A8A8A94848484FF + 7C7B7AFF86898AFFC7EEF6FFBBF6FFFFB0F1FFFFA8EFFFFFA7F6FFFF93BFC9FF + 43403FFF403C3AFF739EAAFF7AE8FFFF59D9FFFF3ED2FFFF33D0FFFF53CAF1FF + 364145FF242120FF232323FF202020941D1D1D001D1D1D001D1D1D001D1D1D00 + 1D1D1D008C8C8C008C8C8C008C8C8C008C8C8C008C8C8C008D8D8D1D898989EB + 848484FF797877FFABBDC0FFC6FCFFFFB5F3FFFFACF1FFFFB1F9FFFF7E979CFF + 474444FF43403FFF64787DFF87EDFFFF64DDFFFF4BD6FFFF4BDDFFFF558D9FFF + 2B2624FF2A2A2AFF272727EB2323231D22222200222222002222220022222200 + 222222008F8F8F008F8F8F008F8F8F008F8F8F008F8F8F008F8F8F008F8F8F7C + 898989FF818080FF8B8E8EFFC6EEF5FFBAF6FFFFB0F2FFFFB8F8FFFF6E787AFF + 4B4948FF494645FF596264FF8DE2F6FF6DE3FFFF57DEFFFF63D1F1FF414C4FFF + 312E2DFF2F2F2FFF2C2C2C7C2929290029292900292929002929290029292900 + 2929290092929200929292009292920092929200929292009292920092929214 + 8E8E8EDE898989FF7F7D7DFFADBFC2FFC6FCFFFFB6F7FFFFB4E8F2FF666B6CFF + 51504FFF4F4D4DFF545656FF8ACEDEFF76E8FFFF71EAFFFF6196A3FF393331FF + 373737FF333333DE303030143030300030303000303030003030300030303000 + 3030300093939300939393009393930093939300939393009393930093939300 + 929292698E8E8EFF868585FF8D8F90FFC6EEF3FFBEFDFFFFB0DDE6FF646667FF + 565555FF545353FF52514FFF88C3D1FF80F2FFFF83DAEEFF4C5457FF3D3A39FF + 3C3C3CFF37373769333333003333330033333300333333003333330033333300 + 3333330095959500959595009595950095959500959595009595950095959500 + 95959509939393D28E8E8EFF848181FFADBEC2FFC8FEFFFFBEEEF5FF6F7475FF + 585656FF565454FF5C5E5FFF96D7E4FF90F6FFFF759DA6FF433E3DFF444444FF + 404040D23C3C3C093B3B3B003B3B3B003B3B3B003B3B3B003B3B3B003B3B3B00 + 3B3B3B0097979700979797009797970097979700979797009797970097979700 + 9797970097979759929292FF8B8A8AFF909292FFC6EBF2FFC9FFFFFFA5BFC3FF + 656565FF5F5E5DFF8DA9B0FFA5F8FFFF98DFEFFF5E6264FF4B4949FF484848FF + 4444445943434300434343004343430043434300434343004343430043434300 + 4343430099999900999999009999990099999900999999009999990099999900 + 9999990099999906979797C2929292FF898786FFADBDC0FFC8FBFFFFC3FAFFFF + B7E7EFFFB0E3EDFFAEF3FFFFA4F7FFFF86A5ABFF585553FF525252FF4C4C4CC2 + 4949490649494900494949004949490049494900494949004949490049494900 + 494949009A9A9A009A9A9A009A9A9A009A9A9A009A9A9A009A9A9A009A9A9A00 + 9A9A9A009A9A9A009A9A9A45969797FC909090FF929393FFC6E9EFFFBEF9FFFF + B6F8FFFFAEF7FFFFA6F6FFFFA8E0EBFF6E7071FF616160FF575757FC50505045 + 4F4F4F004F4F4F004F4F4F004F4F4F004F4F4F004F4F4F004F4F4F004F4F4F00 + 4F4F4F009C9C9C009C9C9C009C9C9C009C9C9C009C9C9C009C9C9C009C9C9C00 + 9C9C9C009C9C9C009C9C9C009B9B9BAF969696FF8E8C8CFFADBABDFFCAFCFFFF + B9F5FFFFB1F4FFFFB6FAFFFF93A9ACFF6A6665FF686869FF5C5C5CAF54545400 + 5555550055555500555555005555550055555500555555005555550055555500 + 555555009E9E9E009E9E9E009E9E9E009E9E9E009E9E9E009E9E9E009E9E9E00 + 9E9E9E009E9E9E009E9E9E009D9D9D359A9A9AF8949494FF959595FFC7E8EDFF + C0F9FFFFB9F9FFFFB7E4EBFF7C7E7DFF717070FF6D6D6DF85F5F5F355A5A5A00 + 5B5B5B005B5B5B005B5B5B005B5B5B005B5B5B005B5B5B005B5B5B005B5B5B00 + 5B5B5B00A0A0A000A0A0A000A0A0A000A0A0A000A0A0A000A0A0A000A0A0A000 + A0A0A000A0A0A000A0A0A000A0A0A0009E9E9EA09A9A9AFF918F8FFFADB9BBFF + D0FFFFFFCAFFFFFF9EAFB2FF797676FF787878FF717171A06666660066666600 + 6767670067676700676767006767670067676700676767006767670067676700 + 67676700A0A0A000A0A0A000A0A0A000A0A0A000A0A0A000A0A0A000A0A0A000 + A0A0A000A0A0A000A0A0A000A0A0A000A0A0A0289D9D9DF0999898FF979797FF + ACB7B8FFA7B3B5FF888989FF818181FF7D7D7DF0747474286B6B6B006C6C6C00 + 6C6C6C006C6C6C006C6C6C006C6C6C006C6C6C006C6C6C006C6C6C006C6C6C00 + 6C6C6C00A2A2A200A2A2A200A2A2A200A2A2A200A2A2A200A2A2A200A2A2A200 + A2A2A200A2A2A200A2A2A200A2A2A200A2A2A200A1A1A18D9E9E9EFF989898FF + 908E8EFF8C8A8AFF8C8B8BFF878787FF8181818D7E7E7E007D7D7D007D7D7D00 + 7D7D7D007D7D7D007D7D7D007D7D7D007D7D7D007D7D7D007D7D7D007D7D7D00 + 7D7D7D00A3A3A300A3A3A300A3A3A300A3A3A300A3A3A300A3A3A300A3A3A300 + A3A3A300A3A3A300A3A3A300A3A3A300A3A3A300A3A3A31AA1A1A1DE9D9D9DFF + 989898FF949494FF909090FF8B8B8BDE8686861A868686008686860086868600 + 8686860086868600868686008686860086868600868686008686860086868600 + 86868600A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400 + A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400A3A3A342A1A1A1EA + 9D9D9DFF989898FF959595EA8F8F8F428D8D8D008E8E8E008E8E8E008E8E8E00 + 8E8E8E008E8E8E008E8E8E008E8E8E008E8E8E008E8E8E008E8E8E008E8E8E00 + 8E8E8E00A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400 + A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400A4A4A400A2A2A25F + 9F9F9FB59B9B9BB59797975F9292920091919100919191009191910091919100 + 9191910091919100919191009191910091919100919191009191910091919100 + 91919100FFFFFFFF800000010000000000000000000000000000000000000000 + 000000008000000180000001C0000003E0000007E0000007F000000FF000000F + F800001FF800001FFC00003FFC00003FFE00007FFE00007FFF0000FFFF0000FF + FF8001FFFFC003FFFFC003FFFFE007FFFFE007FFFFF00FFFFFF00FFFFFF81FFF + FFFC3FFF} + Visible = False + end + object btnOK: TButton + Left = 303 + Top = 250 + Width = 75 + Height = 25 + Action = actOK + Anchors = [akRight, akBottom] + Default = True + ModalResult = 1 + TabOrder = 0 + end + object btnCancel: TButton + Left = 383 + Top = 250 + Width = 75 + Height = 25 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + object btnApply: TButton + Left = 463 + Top = 250 + Width = 75 + Height = 25 + Action = actApply + Anchors = [akRight, akBottom] + TabOrder = 2 + end + object gbSelectedImage: TGroupBox + Left = 359 + Top = 7 + Width = 180 + Height = 231 + Anchors = [akTop, akRight, akBottom] + Caption = 'Selected Image' + TabOrder = 3 + object pbPreview: TPaintBox + Left = 10 + Top = 15 + Width = 160 + Height = 160 + Anchors = [akLeft, akTop, akRight] + OnMouseDown = pbPreviewMouseDown + OnMouseMove = pbPreviewMouseMove + OnMouseUp = pbPreviewMouseUp + OnPaint = pbPreviewPaint + end + object lbTransparentColor: TLabel + Left = 9 + Top = 186 + Width = 87 + Height = 13 + Anchors = [akLeft, akBottom] + Caption = 'Transparent Color:' + end + object cbTransparentColor: TComboBox + Left = 10 + Top = 201 + Width = 161 + Height = 21 + Anchors = [akLeft, akRight, akBottom] + ItemHeight = 13 + TabOrder = 0 + OnChange = cbTransparentColorChange + OnExit = cbTransparentColorExit + end + end + object gbImages: TGroupBox + Left = 12 + Top = 7 + Width = 340 + Height = 231 + Anchors = [akLeft, akTop, akRight, akBottom] + Caption = 'Images' + TabOrder = 4 + object lvImages: TListView + Left = 10 + Top = 15 + Width = 320 + Height = 178 + Hint = 'Add image' + Anchors = [akLeft, akTop, akRight, akBottom] + Columns = <> + Constraints.MinHeight = 150 + Constraints.MinWidth = 228 + DragMode = dmAutomatic + HideSelection = False + IconOptions.AutoArrange = True + MultiSelect = True + ReadOnly = True + PopupMenu = pmCommands + ShowColumnHeaders = False + TabOrder = 0 + OnEndDrag = lvImagesEndDrag + OnDragOver = lvImagesDragOver + OnKeyDown = lvImagesKeyDown + OnStartDrag = lvImagesStartDrag + end + object pnlToolBarSubstrate: TPanel + Left = 10 + Top = 200 + Width = 151 + Height = 22 + Anchors = [akLeft, akBottom] + BevelOuter = bvNone + TabOrder = 1 + object tbCommands: TToolBar + Left = 0 + Top = 0 + Width = 151 + Height = 22 + Align = alClient + Caption = 'tbCommands' + EdgeBorders = [] + Flat = True + Images = imglSmall + ParentShowHint = False + ShowHint = True + TabOrder = 0 + object tbbAdd: TToolButton + Left = 0 + Top = 0 + Action = actAdd + end + object tbbReplace: TToolButton + Left = 23 + Top = 0 + Action = actReplace + end + object tbbDelete: TToolButton + Left = 46 + Top = 0 + Action = actDelete + end + object tbbClear: TToolButton + Left = 69 + Top = 0 + Action = actClear + end + object tbbExport: TToolButton + Left = 92 + Top = 0 + Action = actExport + end + object tbbImport: TToolButton + Left = 115 + Top = 0 + Action = actImport + DropdownMenu = pmImageLists + end + end + end + object cbImagesSize: TComboBox + Left = 260 + Top = 200 + Width = 70 + Height = 21 + Style = csDropDownList + Anchors = [akRight, akBottom] + ItemHeight = 13 + TabOrder = 2 + OnChange = cbImagesSizeChange + Items.Strings = ( + '16x16' + '24x24' + '32x32' + '48x48' + '64x64' + '128x128') + end + end + object pmImageLists: TPopupMenu + Left = 64 + Top = 40 + end + object pmCommands: TPopupMenu + Images = imglSmall + Left = 152 + Top = 40 + object miAdd: TMenuItem + Action = actAdd + end + object miReplace: TMenuItem + Action = actReplace + end + object miDelete: TMenuItem + Action = actDelete + end + object miClear: TMenuItem + Action = actClear + end + object miExport: TMenuItem + Action = actExport + end + object miImport: TMenuItem + Action = actImport + end + end + object imglSmall: TcxImageList + CompressData = True + FormatVersion = 1 + DesignInfo = 1572992 + ImageInfo = < + item + Image.Data = { + 860200005844424D0100823604020084424D3604060081360300812803008110 + 03008110030083010020060081045200034E8100034D8100034D8100034B8100 + 034B810003488100034781000347810003458100034381000343810003431100 + 0351A9006BCE7D006BCE7D0069CF7F0068CF800068D0810067D1830067D18400 + 65D2860065D2860064D38800034511000354A90064D388002FC562002EC76500 + 2EC765002DC869002DC869002ECA6D002ECA6D0030CB700064D9950003471100 + 0357A90068D9960041CF7A004CD181005CD68C0072DB9C0085E1A900A1E7BB00 + BDEDCD00E4F1DB00F2F5E600034B11000359A900D1EFD400E4F1DB00F6F1DD00 + F9F2DF00FDF3E100FDF3E100FDF4E200FFF4E600FFF4E600FFF8EE00034D1100 + 035CB000FFF6EA00FFF3E300FFF3E300FFF3E100FFF2DF00FFF1DE00FFF1DE00 + FFF1DD00FFF1DD0003531900034F1800034F180D00035EB000FFF0DA00FFEBCE + 00FFEACC00FFEACC00FFE9CA00FFE9C800FFE8C700FFE7C400FFE7C40002591B + 000FCD69000353190D000361B000FFE8C700FFDFB300FFDEB000FFDEB000FFDD + AE00FFDDAD00FFDCAB00FFDBAA00FFDAA600025E1D000FCD690002561A0D0003 + 64BD00FFDEB000FFDDAE00FFDDAD00FFDDAD00FFDCAB00FFDBAA000375280003 + 7025000269220002641F0027D87C00025E1D0002591B0002561A000353190003 + 66810003668100036481000363810003638100036181000361A400037C2C006F + F0B0006FF0B00053E89C003CE08A0027D87C000FCD69000FCD690002561A1D00 + A30387330003873300037C2C000375280053E89C000269220002641F00025E1D + 0002591B29008B037C2C006FF0B00003702535008B0387330087F6C100037C2C + 35008B04943A00038733000387334D00} + Mask.Data = { + 670000005844424D0100817E030083424D7E0700813E03008128030081100300 + 8110030083010001050081400B0081020B0003FF810002FF0300810F0300810F + 0300810F0300810F0300810F0300810703008107030081070A0081FE030082FF + C7020082FFC7020082FFC7020002FF0200} + end + item + Image.Data = { + 580300005844424D0100823604020084424D3604060081360300812803008110 + 0300811003008301002006008104460083A559060900037A8100037A81000377 + 8100037781000377810003758100037581000375810003738100037081000370 + 050090A5590600A5590600A5590600CCB59200037DA5008FDA9D008FDA9D008F + DA9D008EDBA0008DDCA1008DDCA1008CDDA4008CDDA4008CDDA400037309008C + A5590600D3CFC200A5590600037DA5008BDEA50062D3890062D3890062D58C00 + 62D58C0061D7900061D7900061D790008CE3AF000375110084A55906000381A5 + 008CE3AF0072DB9C0078DCA00085E1A90095E4B400A1E7BB00BDEDCD00D1EFD4 + 00EDF6E7000377150003819100E4F1DB00EDF6E700F9F5E600F9F5E600034E81 + 00034D8100034D8100034B8100034B8100034881000347810003478100034581 + 00034381000343810003859100FFF8EE00FFF6EA00FFF6EA00FFF6EA000351A5 + 006BCE7D006BCE7D0069CF7F0068CF800068D0810067D1830067D1840065D286 + 0065D286000345810003859100FFF3E300FFF0DA00FFF0DA00FFF0DA000354A5 + 0064D388002FC562002EC765002EC765002DC869002DC869002ECA6D002ECA6D + 0064D995000348810003899100FFEDD300FFE7C600FFE7C400FFE7C4000357A5 + 0068D9960041CF7A004CD181005CD68C0072DB9C0085E1A900A1E7BB00BDEDCD + 00EDF6E700034B8100038A9100FFE6C200FFE6C200FFE6C200FFE6C2000359A5 + 00D1EFD400E4F1DB00F6F1DD00F9F2DF00FDF3E100FDF3E100FDF4E200FFF4E6 + 00FFF8EE00034E8100038D8100038A8100038A8100038A810003898100035CA5 + 00FFF6EA00FFF3E300FFF3E300FFF3E100FFF2DF00FFF1DE00FFF1DE00FFF1DD + 00FFF4E60003511500035EA500FFF0DA00FFEBCE00FFEACC00FFEACC00FFE9CA + 00FFE9C800FFE8C700FFE7C400FFEDD30003548400C6731B11000361A500FFE8 + C700FFDFB300FFDEB000FFDEB000FFDDAE00FFDDAD00FFDCAB00FFDBAA00FFE4 + BB0003578C00C9761D00DAD4C600C6731B09000364A500FFDEB000FFDDAE00FF + DDAD00FFDDAD00FFDCAB00FFDBAA00FFDBAA00FFDAA600FFDAA60003599000D8 + C3A600CB781E00C9761D00C6731B050003668100036681000364810003638100 + 036381000361810003618100035E8100035E8100035E8100035C090083CB781E + 3500} + Mask.Data = { + 550000005844424D0100817E030083424D7E0700813E03008128030081100300 + 8110030083010001050081400B0081020B0003FF8300FFFB0300811003008118 + 0300811E0300811F1A0081F8030081780300811803008108030082DFFF0200} + end + item + Image.Data = { + AE0200005844424D0100823604020084424D3604060081360300812803008110 + 03008110030083010020060081045200034E8100034D8100034D8100034B8100 + 034B810003488100034781000347810003458100034381000343810003431100 + 0351A9006BCE7D006BCE7D0069CF7F0068CF800068D0810067D1830067D18400 + 65D2860065D2860064D38800034511000354A90064D388002FC562002EC76500 + 2EC765002DC869002DC869002ECA6D002ECA6D0030CB700064D9950003471100 + 0357A90068D9960041CF7A004CD181005CD68C0072DB9C0085E1A900A1E7BB00 + BDEDCD00E4F1DB00F2F5E600034B11000359A900D1EFD400E4F1DB00F6F1DD00 + F9F2DF00FDF3E100FDF3E100FDF4E200FFF4E600FFF4E600FFF8EE00034D0900 + 83969FD30500035CA900FFF6EA00FFF3E300FFF3E300FFF3E100FFF2DF00EFE2 + DC00FFF1DE00FFF1DD00FFF1DD00FFF3E300034E050087969FD300929BD10500 + 035EA900FFF0DA00FFEBCE00FFEACC00FFEACC00FFE9CA00B7A8CA00E7D3C600 + FFE7C400FFE7C400FFEDD30003538800C9D5EB005B60BD09000361A900FFE8C7 + 00FFDFB300FFDEB000FFDEB000FFDDAE00C4ABB6008B78B700FADAAB00FFDAA6 + 00FFE4BB00035388006469CA00969FD309000364A900FFDEB000FFDDAE00FFDD + AD00FFDDAD00FFDBAA00FADAAB008B78B7008B78B700FFDAA600FFDAA600022A + 8594006469CA0D00036681000366810003648100036381000363810003618100 + 036181000259826600022A829400022A829400022A829400022A8194310088AE + B8E5000A0BCC00020585C9007C84D92900A7C9D5EB007D84E4002C2FD7006D73 + DD006D73DD001011CA001F21CD005D62D6008991DA00C9D5EB19008B7D84E400 + 383AD6009BA4E309008CAEB8E5004E52D9001011CA00020585C500474BD31900 + 87C9D5EB00C9D5EB15008BB5C0E7007D84E4008B93E24100} + Mask.Data = { + 6F0000005844424D0100817E030083424D7E0700813E03008128030081100300 + 8110030083010001050081400B0081020B0003FF810002FF0300810F0300810F + 0300810F0300810F0300810D030081090300810303008103030081070300810F + 020082FF0F020081FC030082FC60020082FCF8020002FF0200} + end + item + Image.Data = { + DB0100005844424D0100823604020084424D3604060081360300812803008110 + 03008110030083010020060081044600835B60BD39008799A2D3005B60BD0900 + 83C9D5EB2D00874B4FB40099A2D30900838991DA2900878A92CF004B4FB40D00 + 877C84D900A4ADE421008BB5C0E7002C2EAF00929BD10D0087AEB8E5005D62D6 + 2100875B60BD005B60BD1500876D73DD005D62D619008B7178CF002C2EAF00AE + B8E51900873F42D200646AD81100847C84D900021585BC008991DA1D008B9BA4 + E3001F21CD00585CD60900847C84D900021585BC007177D4250090858DE10010 + 11CA00383AD600474BD300020B85C500646AD82D0088646AD8000A0BCC000205 + 89C9002E30CE00A4ADE4290090858DE1002C2FD7000A0BCC001A1BCD0002058D + C9001A1BCD005D62D6009BA4E3190088A4ADE4004E52D900020892D5003033D5 + 008B93E200A4ADE4004E52D900020582C900020582C600020591C6002E30CE00 + 5D62D600838ADB00A4ADE40500845D63E200020882D500020889D5005E63DF00 + B5C0E70D0088858DE100383AD600020582C900020582C600020582C500020582 + C500020591C0007C84D9007D84E4005D63E200959EE71D008C858DE100474BD3 + 001011CA00020582C600020585C5001F21C7310090B5C0E700858DE1005D62D6 + 009BA4E300} + Mask.Data = { + 7A0000005844424D0100817E030083424D7E0700813E03008128030081100300 + 8110030083010001050081400B0081020B0003FF8300FFFB020082FFF3020082 + 7FF30200827FE70200823FC70200823FCF0200829F8F020082CF1F020082C63F + 020082E07F020082F07F020082E01F0200828001020081070300821FC0020082 + FFF00200} + end + item + Image.Data = { + 520300005844424D0100823604020084424D3604060081360300812803008110 + 030081100300830100200600810456008CC5A67B00B26C3400CA8B5800032481 + 0003248100031981000319810003198100030F8100030F8100030F8C00BA7743 + 00A1551A00B78E5D09008CBA774300EFCA9100EBC58800033481000332810003 + 2C8100032C810003248900E2B97A00E2B97A0003198C00E2B97A00DAA65600A1 + 551A09008CC17E4800F2CE9600EFCA91000345810003418100033C8100033781 + 0003348900E5BD7D00E4BA7C0003248C00E2B97A00DAA65600A1551A09008CC6 + 834E00F4D19D00F2CE96000359810003538100034E81000348810003458900E7 + BD8300E5BD7D0003378C00E2B97A00DAA65600A85E2409008CCA8B5800F6D5A5 + 00F4D19D00036B81000366810003618100035C81000357810003538100034D81 + 0003488C00E5BD7D00DAA65600A85E240900B7CA8B5800FADAAB00F6D5A500F4 + D19D00EFCA9100EFCA9100EBC58800EBC58800EBC58800E7BD8300E7BD8300E7 + BD8300E1AE5F00A85E240900B7D1915D00FBDDB100F2CE9600F3C88600F3C886 + 00EDC07A00ECBC7200E9B86D00E6B56900E6B56900E3B16400E3B16400E1AE5F + 00B26C340900B7D99B6800FFE4BB00E3AF7900E3AF7900E3B27500E3B27500E4 + AF6E00E4AF6E00E2AD6800E2AD6800E2AD6800E2AD6800E3B16400B26C340900 + 8CD99B6800FFE4BB00E3AF790003FC810003FC810003FA810003FA810003F881 + 0003F8810003F6810003F68C00E2AD6800E6B56900B26C3409008CDFA47100FF + E6C200DFA4710003FE810003D6810003D6810003D6810003D6810003D2810003 + D2810003F88C00E0A96A00E6B56900BA774309008CDFA47100FFECC900DFA471 + 0003FF810003FF810003FE810003FE810003FC810003FC810003FA810003FA8C + 00E0A96A00E9B86D00BA774309008CE4A77500FFEFCF00D99B680003FF810003 + D9810003D9810003D9810003D9810003D6810003D6810003FC8C00E0A96A00EC + BC7200C17E4809008CE4A77500FFF4D400DFAE850003FF810003FF810003FF81 + 0003FF810003FF810003FF810003FF810003FC8C00E7BD8300EFCA9100C6834E + 09008CE2CFB000E4A77500E4A7750003D9810003D9810003D9810003D9810003 + D9810003D9810003D9810003D98C00D1915D00CA8B5800CCB5924500} + Mask.Data = { + 7A0000005844424D0100817E030083424D7E0700813E03008128030081100300 + 8110030083010001050081400B0081020B0003FF810002FF0200828001020082 + 8001020082800102008280010200828001020082800102008280010200828001 + 0200828001020082800102008280010200828001020082800102008280010200 + 02FF0200} + end + item + Image.Data = { + E10200005844424D0100823604020084424D3604060081360300812803008110 + 03008110030083010020060081045E000366810003618100035C810003578100 + 03518100034D81000347810003418100033C81000337810003348100032C1100 + 036B810003E3810003FF810003FF810003FF810003FF810003FF810003FF8100 + 03FF810003FF810003FF810003321100036B810003E3810003FF810003FF8100 + 03FF810003FF810003FF810003FF810003FF810003FF810003FF810003341100 + 0370810003E3810003FF810003FF8500BF611B0003FF810003FF810003FF8100 + 03FF810003FF810003FF8100033711000373810003E3810003FF810003FF8900 + C5631B00C5631B0003FF810003FF810003FF810003FF810003FF8100033C0900 + A4E07A2E00DD762A00DA722600D6712600D46C2200D16B1F00CB661C00CB661C + 00C5631B0003FF810003FF810003FF810003FF8100033C0900A8E8833A00E37E + 3400E37E3400E07A2E00DD762A00DA722600D6712600D16B1F00CE691F00CB66 + 1C0003FF810003FF810003FF810003410900A4EE8D4600EE8D4600E8833A00E8 + 833A00E37E3400E37E3400E07A2E00DD762A00D671260003FF810003FF810003 + FF810003FF8100034511000381810003E3810003FF810003FF8900E8833A00E3 + 7E340003FF810003FF810003FF810003FF810003FF8100034811000381810003 + E3810003FF810003FF8500EE8D460003FF810003FF810003FF810003FF810003 + FF810003FF8100034B11000385810003E3810003FF810003FF810003FF810003 + FF810003FF810003FF810003FF810003FF810003FF8100034E11000389810003 + E3810003FF810003FF810003FF810003FF810003FF810003FF810003FF810003 + FF810003FF810003531100038A810003E3810003E3810003E3810003E3810003 + E3810003E3810003E3810003E3810003E3810003E3810003571100038D810003 + 8981000385810003818100037D81000377810003738100037081000366810003 + 648100035E810003594500} + Mask.Data = { + 7A0000005844424D0100817E030083424D7E0700813E03008128030081100300 + 8110030083010001050081400B0081020B0003FF810002FF020082E001020082 + E001020082E001020082E001020082E001020082800102008280010200828001 + 020082E001020082E001020082E001020082E001020082E001020082E0010200 + 02FF0200} + end> + end + object spdSave: TSavePictureDialog + DefaultExt = '*.bmp' + Filter = 'Bitmaps (*.bmp)|*.bmp' + Left = 201 + Top = 24 + end + object actlCommands: TActionList + Images = imglSmall + Left = 128 + Top = 80 + object actAdd: TAction + Caption = '&Add' + Hint = 'Add image' + ImageIndex = 0 + ShortCut = 45 + OnExecute = actAddExecute + end + object actInsert: TAction + Caption = 'Insert' + ShortCut = 8237 + OnExecute = actInsertExecute + end + object actReplace: TAction + Caption = '&Replace' + Hint = 'Replace image' + ImageIndex = 1 + ShortCut = 16466 + OnExecute = actReplaceExecute + end + object actDelete: TAction + Caption = '&Delete' + Hint = 'Delete image' + ImageIndex = 2 + ShortCut = 46 + OnExecute = actDeleteExecute + end + object actClear: TAction + Caption = '&Clear' + Hint = 'Clear' + ImageIndex = 3 + ShortCut = 16430 + OnExecute = actClearExecute + end + object actExport: TAction + Caption = '&Export' + Hint = 'Export images' + ImageIndex = 4 + ShortCut = 16453 + OnExecute = actExportExecute + end + object actImport: TAction + Caption = '&Import' + Hint = 'Import images' + ImageIndex = 5 + OnExecute = actImportExecute + end + object actApply: TAction + Caption = 'Apply' + OnExecute = actApplyExecute + end + object actOK: TAction + Caption = 'OK' + OnExecute = actOKExecute + end + end + object opdOpen: TOpenPictureDialog + Filter = + 'All (*.bmp, *.ico)|*.bmp;*.ico|Bitmaps (*.bmp)|*.bmp|Icons (*.ic' + + 'o)|*.ico' + FilterIndex = 0 + Options = [ofHideReadOnly, ofAllowMultiSelect, ofEnableSizing] + Left = 198 + Top = 80 + end +end diff --git a/official/x.35/Lib/D11/cxImportDialog.dcu b/official/x.35/Lib/D11/cxImportDialog.dcu new file mode 100644 index 00000000..f51a50b4 Binary files /dev/null and b/official/x.35/Lib/D11/cxImportDialog.dcu differ diff --git a/official/x.35/Lib/D11/cxImportDialog.dfm b/official/x.35/Lib/D11/cxImportDialog.dfm new file mode 100644 index 00000000..440d9d29 --- /dev/null +++ b/official/x.35/Lib/D11/cxImportDialog.dfm @@ -0,0 +1,150 @@ +object cxImportDialogForm: TcxImportDialogForm + Left = 288 + Top = 203 + BorderIcons = [biSystemMenu] + BorderStyle = bsSingle + Caption = 'Import' + ClientHeight = 367 + ClientWidth = 546 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 141 + Top = 0 + Width = 113 + Height = 367 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object Button1: TButton + Left = 12 + Top = 8 + Width = 89 + Height = 25 + Caption = 'Import' + Enabled = False + TabOrder = 0 + OnClick = Button1Click + end + object Button2: TButton + Left = 12 + Top = 40 + Width = 89 + Height = 25 + Cancel = True + Caption = 'Close' + ModalResult = 2 + TabOrder = 1 + end + object Button3: TButton + Left = 12 + Top = 332 + Width = 89 + Height = 25 + Caption = 'Options >>' + TabOrder = 2 + OnClick = Button3Click + end + end + object ListBox1: TListBox + Left = 0 + Top = 0 + Width = 141 + Height = 367 + Align = alLeft + ItemHeight = 13 + TabOrder = 1 + OnClick = ListBox1Click + OnDblClick = ListBox1DblClick + end + object StylesPane: TPanel + Left = 254 + Top = 0 + Width = 292 + Height = 367 + Align = alClient + TabOrder = 2 + object PageControl1: TPageControl + Left = 1 + Top = 1 + Width = 290 + Height = 365 + ActivePage = TabSheet2 + Align = alClient + TabOrder = 0 + TabStop = False + object TabSheet2: TTabSheet + Caption = 'Styles' + ImageIndex = 1 + OnShow = TabSheet2Show + object GroupBox2: TGroupBox + Left = 0 + Top = 36 + Width = 282 + Height = 301 + Align = alBottom + Caption = ' StyleRepository Options ' + TabOrder = 1 + object RadioButton1: TRadioButton + Left = 16 + Top = 28 + Width = 169 + Height = 17 + Caption = 'Create New StyleRepository' + Checked = True + TabOrder = 0 + TabStop = True + OnClick = RadioButton1Click + end + object RadioButton2: TRadioButton + Left = 16 + Top = 100 + Width = 173 + Height = 17 + Caption = 'Use Existing StyleRepository' + TabOrder = 2 + OnClick = RadioButton2Click + end + object Edit1: TEdit + Left = 36 + Top = 52 + Width = 229 + Height = 21 + TabOrder = 1 + end + object ComboBox1: TComboBox + Left = 36 + Top = 124 + Width = 229 + Height = 21 + Style = csDropDownList + Color = clBtnFace + Enabled = False + ItemHeight = 13 + TabOrder = 3 + end + end + object cbImportStyles: TCheckBox + Left = 4 + Top = 8 + Width = 97 + Height = 17 + Caption = 'Import Styles' + Checked = True + State = cbChecked + TabOrder = 0 + OnClick = cbImportStylesClick + end + end + end + end +end diff --git a/official/x.35/Lib/D11/cxInplaceContainer.dcu b/official/x.35/Lib/D11/cxInplaceContainer.dcu new file mode 100644 index 00000000..358a4a7f Binary files /dev/null and b/official/x.35/Lib/D11/cxInplaceContainer.dcu differ diff --git a/official/x.35/Lib/D11/cxInplaceContainerReg.dcu b/official/x.35/Lib/D11/cxInplaceContainerReg.dcu new file mode 100644 index 00000000..ea520c0c Binary files /dev/null and b/official/x.35/Lib/D11/cxInplaceContainerReg.dcu differ diff --git a/official/x.35/Lib/D11/cxInsCur.res b/official/x.35/Lib/D11/cxInsCur.res new file mode 100644 index 00000000..4866c97e Binary files /dev/null and b/official/x.35/Lib/D11/cxInsCur.res differ diff --git a/official/x.35/Lib/D11/cxLabel.dcu b/official/x.35/Lib/D11/cxLabel.dcu new file mode 100644 index 00000000..e05688e1 Binary files /dev/null and b/official/x.35/Lib/D11/cxLabel.dcu differ diff --git a/official/x.35/Lib/D11/cxLibraryConsts.dcu b/official/x.35/Lib/D11/cxLibraryConsts.dcu new file mode 100644 index 00000000..64da9f6e Binary files /dev/null and b/official/x.35/Lib/D11/cxLibraryConsts.dcu differ diff --git a/official/x.35/Lib/D11/cxLibraryD11.bpl b/official/x.35/Lib/D11/cxLibraryD11.bpl new file mode 100644 index 00000000..0d2137cd Binary files /dev/null and b/official/x.35/Lib/D11/cxLibraryD11.bpl differ diff --git a/official/x.35/Lib/D11/cxLibraryD11.dcp b/official/x.35/Lib/D11/cxLibraryD11.dcp new file mode 100644 index 00000000..0e5ef065 Binary files /dev/null and b/official/x.35/Lib/D11/cxLibraryD11.dcp differ diff --git a/official/x.35/Lib/D11/cxLibraryD11.dcu b/official/x.35/Lib/D11/cxLibraryD11.dcu new file mode 100644 index 00000000..3c599af2 Binary files /dev/null and b/official/x.35/Lib/D11/cxLibraryD11.dcu differ diff --git a/official/x.35/Lib/D11/cxLibraryReg.dcr b/official/x.35/Lib/D11/cxLibraryReg.dcr new file mode 100644 index 00000000..8e8077c5 Binary files /dev/null and b/official/x.35/Lib/D11/cxLibraryReg.dcr differ diff --git a/official/x.35/Lib/D11/cxLibraryReg.dcu b/official/x.35/Lib/D11/cxLibraryReg.dcu new file mode 100644 index 00000000..31ba9cc6 Binary files /dev/null and b/official/x.35/Lib/D11/cxLibraryReg.dcu differ diff --git a/official/x.35/Lib/D11/cxLibraryStrs.dcu b/official/x.35/Lib/D11/cxLibraryStrs.dcu new file mode 100644 index 00000000..9665098b Binary files /dev/null and b/official/x.35/Lib/D11/cxLibraryStrs.dcu differ diff --git a/official/x.35/Lib/D11/cxLike.dcu b/official/x.35/Lib/D11/cxLike.dcu new file mode 100644 index 00000000..d3978b5b Binary files /dev/null and b/official/x.35/Lib/D11/cxLike.dcu differ diff --git a/official/x.35/Lib/D11/cxListBox.dcu b/official/x.35/Lib/D11/cxListBox.dcu new file mode 100644 index 00000000..21138d5c Binary files /dev/null and b/official/x.35/Lib/D11/cxListBox.dcu differ diff --git a/official/x.35/Lib/D11/cxListView.dcu b/official/x.35/Lib/D11/cxListView.dcu new file mode 100644 index 00000000..a6cd8ede Binary files /dev/null and b/official/x.35/Lib/D11/cxListView.dcu differ diff --git a/official/x.35/Lib/D11/cxLookAndFeelPainters.dcu b/official/x.35/Lib/D11/cxLookAndFeelPainters.dcu new file mode 100644 index 00000000..310f3a90 Binary files /dev/null and b/official/x.35/Lib/D11/cxLookAndFeelPainters.dcu differ diff --git a/official/x.35/Lib/D11/cxLookAndFeelPainters.res b/official/x.35/Lib/D11/cxLookAndFeelPainters.res new file mode 100644 index 00000000..f380b79f Binary files /dev/null and b/official/x.35/Lib/D11/cxLookAndFeelPainters.res differ diff --git a/official/x.35/Lib/D11/cxLookAndFeels.dcu b/official/x.35/Lib/D11/cxLookAndFeels.dcu new file mode 100644 index 00000000..196eea94 Binary files /dev/null and b/official/x.35/Lib/D11/cxLookAndFeels.dcu differ diff --git a/official/x.35/Lib/D11/cxLookupDBGrid.dcu b/official/x.35/Lib/D11/cxLookupDBGrid.dcu new file mode 100644 index 00000000..b72ef633 Binary files /dev/null and b/official/x.35/Lib/D11/cxLookupDBGrid.dcu differ diff --git a/official/x.35/Lib/D11/cxLookupEdit.dcu b/official/x.35/Lib/D11/cxLookupEdit.dcu new file mode 100644 index 00000000..2568c7fb Binary files /dev/null and b/official/x.35/Lib/D11/cxLookupEdit.dcu differ diff --git a/official/x.35/Lib/D11/cxLookupGrid.dcu b/official/x.35/Lib/D11/cxLookupGrid.dcu new file mode 100644 index 00000000..5c00acd2 Binary files /dev/null and b/official/x.35/Lib/D11/cxLookupGrid.dcu differ diff --git a/official/x.35/Lib/D11/cxMCListBox.dcu b/official/x.35/Lib/D11/cxMCListBox.dcu new file mode 100644 index 00000000..6bb5c96a Binary files /dev/null and b/official/x.35/Lib/D11/cxMCListBox.dcu differ diff --git a/official/x.35/Lib/D11/cxMRUEdit.dcu b/official/x.35/Lib/D11/cxMRUEdit.dcu new file mode 100644 index 00000000..73c81cb7 Binary files /dev/null and b/official/x.35/Lib/D11/cxMRUEdit.dcu differ diff --git a/official/x.35/Lib/D11/cxMaskEdit.dcu b/official/x.35/Lib/D11/cxMaskEdit.dcu new file mode 100644 index 00000000..552f38cd Binary files /dev/null and b/official/x.35/Lib/D11/cxMaskEdit.dcu differ diff --git a/official/x.35/Lib/D11/cxMaskEditTextEditor.dcu b/official/x.35/Lib/D11/cxMaskEditTextEditor.dcu new file mode 100644 index 00000000..33c7ed4d Binary files /dev/null and b/official/x.35/Lib/D11/cxMaskEditTextEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxMaskEditTextEditor.dfm b/official/x.35/Lib/D11/cxMaskEditTextEditor.dfm new file mode 100644 index 00000000..58b53a51 --- /dev/null +++ b/official/x.35/Lib/D11/cxMaskEditTextEditor.dfm @@ -0,0 +1,75 @@ +object cxMaskEditTextEditorDlg: TcxMaskEditTextEditorDlg + Left = 327 + Top = 323 + BorderStyle = bsDialog + Caption = 'Masked Text Editor' + ClientHeight = 151 + ClientWidth = 466 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + KeyPreview = True + OldCreateOrder = False + OnKeyDown = FormKeyDown + OnShow = FormShow + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 8 + Top = 24 + Width = 47 + Height = 13 + Caption = 'Input text:' + end + object Label2: TLabel + Left = 8 + Top = 62 + Width = 49 + Height = 13 + Caption = 'Edit mask:' + end + object Label3: TLabel + Left = 64 + Top = 62 + Width = 3 + Height = 13 + end + object Bevel1: TBevel + Left = 8 + Top = 96 + Width = 449 + Height = 2 + end + object cxMaskEdit1: TcxMaskEdit + Tag = 25 + Left = 64 + Top = 20 + Width = 391 + Height = 21 + Properties.IgnoreMaskBlank = True + Properties.MaxLength = 0 + TabOrder = 0 + end + object cxButton2: TButton + Left = 352 + Top = 112 + Width = 105 + Height = 25 + Caption = 'Cancel' + TabOrder = 1 + OnClick = cxButton2Click + end + object cxButton1: TButton + Left = 240 + Top = 112 + Width = 105 + Height = 25 + Caption = 'OK' + TabOrder = 2 + OnClick = cxButton1Click + end +end diff --git a/official/x.35/Lib/D11/cxMemo.dcu b/official/x.35/Lib/D11/cxMemo.dcu new file mode 100644 index 00000000..e9ba208a Binary files /dev/null and b/official/x.35/Lib/D11/cxMemo.dcu differ diff --git a/official/x.35/Lib/D11/cxNavigator.dcu b/official/x.35/Lib/D11/cxNavigator.dcu new file mode 100644 index 00000000..48d01d68 Binary files /dev/null and b/official/x.35/Lib/D11/cxNavigator.dcu differ diff --git a/official/x.35/Lib/D11/cxOI.dcu b/official/x.35/Lib/D11/cxOI.dcu new file mode 100644 index 00000000..63326724 Binary files /dev/null and b/official/x.35/Lib/D11/cxOI.dcu differ diff --git a/official/x.35/Lib/D11/cxOICollectionEd.dcu b/official/x.35/Lib/D11/cxOICollectionEd.dcu new file mode 100644 index 00000000..dc4a32c1 Binary files /dev/null and b/official/x.35/Lib/D11/cxOICollectionEd.dcu differ diff --git a/official/x.35/Lib/D11/cxOICollectionEd.dfm b/official/x.35/Lib/D11/cxOICollectionEd.dfm new file mode 100644 index 00000000..157a4b7b --- /dev/null +++ b/official/x.35/Lib/D11/cxOICollectionEd.dfm @@ -0,0 +1,453 @@ +object cxCollectionEditor: TcxCollectionEditor + Left = 534 + Top = 162 + HelpContext = 26150 + HorzScrollBar.Increment = 10 + VertScrollBar.Increment = 11 + AutoScroll = False + BorderIcons = [biSystemMenu] + BorderStyle = bsSizeToolWin + Caption = 'CollectionEditor' + ClientHeight = 142 + ClientWidth = 183 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + KeyPreview = True + OldCreateOrder = True + ShowHint = True + OnClose = FormClose + OnCreate = FormCreate + OnDestroy = FormDestroy + OnKeyDown = FormKeyDown + OnKeyPress = FormKeyPress + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object ToolBar1: TToolBar + Left = 0 + Top = 0 + Width = 183 + Height = 28 + AutoSize = True + ButtonHeight = 24 + ButtonWidth = 24 + EdgeBorders = [ebTop, ebBottom] + Flat = True + Images = ImageList + PopupMenu = PopupMenu2 + TabOrder = 1 + Wrapable = False + object ToolButton1: TToolButton + Left = 0 + Top = 0 + Action = acAdd + end + object ToolButton2: TToolButton + Left = 24 + Top = 0 + Action = acDelete + end + object ToolButton3: TToolButton + Left = 48 + Top = 0 + Width = 8 + Caption = 'ToolButton3' + ImageIndex = 2 + Style = tbsSeparator + end + object ToolButton4: TToolButton + Left = 56 + Top = 0 + Action = acMoveUp + end + object ToolButton5: TToolButton + Left = 80 + Top = 0 + Action = acMoveDown + end + end + object Panel: TPanel + Left = 0 + Top = 28 + Width = 183 + Height = 114 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object ListView1: TListView + Left = 0 + Top = 0 + Width = 183 + Height = 114 + Align = alClient + Columns = <> + ColumnClick = False + DragMode = dmAutomatic + HideSelection = False + ReadOnly = True + RowSelect = True + PopupMenu = PopupMenu1 + ShowColumnHeaders = False + TabOrder = 0 + ViewStyle = vsReport + OnChange = ListView1Change + OnDragDrop = ListView1DragDrop + OnDragOver = ListView1DragOver + OnKeyDown = ListView1KeyDown + OnKeyPress = ListView1KeyPress + end + end + object ImageList: TImageList + Left = 40 + Top = 40 + Bitmap = { + 494C010104000500040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000002000000001002000000000000020 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840084848400848484000000000000000000848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840084848400848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 0000FFFFFF0000FFFF0000000000848484000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 0000FFFFFF0000FFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000000000C6C6 + C60000000000FFFFFF000000000084848400848484000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000000000C6C6 + C60000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000FF + FF00C6C6C6000000000000000000848484000000840000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000FF + FF00C6C6C6000000000000000000848484000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848400000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000 + 000000000000000000000000000084848400000084000000840000FFFF00FFFF + FF0000FFFF00FFFFFF00848484000000840000FFFF00FFFFFF00000000000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000000000FFFFFF008484 + 840000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00000000008484840084848400000084008484840000FF + FF00FFFFFF00848484000000840084848400FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000848484000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008484000084840000848400008484000084840000000000000000 + 0000000000000000000000000000000000008484840000FFFF0000FFFF008484 + 8400FFFFFF0000FFFF008484840000FFFF00FFFFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000848484000000000000008400000084008484 + 840000FFFF000000840000008400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000848400008484000084840000848400008484000084840000848400000000 + 0000000000000000000000000000000000000000000084848400FFFFFF008484 + 840000FFFF008484840000FFFF00FFFFFF0000FFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000848484000000000084848400000084000000 + 84000000840000008400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000848484000000000000000000000000000000 + 0000848400008484000084840000848400008484000084840000848400000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000848484008484840084848400FFFF + FF0084848400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000848484000000000084848400000084000000 + 840000008400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000008484000084840000848400008484000084840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000FFFF008484840000FF + FF00FFFFFF008484840084848400848484008484840000000000000000000000 + 0000000000000000000000000000000000008484840000008400000084000000 + 8400000084008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000000000008484840000FFFF008484 + 840000FFFF008484840000FFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000840000008400848484000000 + 0000000084000000840084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848400000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000008484840000FFFF00000000008484 + 8400FFFFFF00000000008484840000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000840000008400848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF0000000000000000008484 + 840000FFFF000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000008400000084008484840000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFC000C000FFFFFFFF + 80008000FFFFFFFF80008000FFFFFFFF80000000F83FFEFF80000000F83FFC7F + 80000000F83FF83F00000000F83FF01F00008000C007E00F80008000E00FC007 + 00008000F01FF83F00010001F83FF83F81FF11FFFC7FF83F24FFF8FFFEFFF83F + 66FFFC7FFFFFFFFFE7FFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end + object ActionList: TActionList + Images = ImageList + Left = 8 + Top = 40 + object acAdd: TAction + ImageIndex = 0 + ShortCut = 45 + OnExecute = acAddExecute + end + object acDelete: TAction + Enabled = False + ImageIndex = 1 + ShortCut = 46 + OnExecute = acDeleteExecute + OnUpdate = SelectionUpdate + end + object acMoveUp: TAction + Enabled = False + ImageIndex = 2 + ShortCut = 16422 + OnExecute = acMoveUpExecute + OnUpdate = SelectionUpdate + end + object acMoveDown: TAction + Enabled = False + ImageIndex = 3 + ShortCut = 16424 + OnExecute = acMoveDownExecute + OnUpdate = SelectionUpdate + end + object acSelectAll: TAction + Enabled = False + ShortCut = 16449 + OnExecute = acSelectAllExecute + OnUpdate = SelectAllCommandUpdate + end + object acToolbar: TAction + Checked = True + OnExecute = acToolbarExecute + end + object acTextLabels: TAction + OnExecute = acTextLabelsExecute + end + end + object PopupMenu1: TPopupMenu + Images = ImageList + Left = 72 + Top = 40 + object miAdd: TMenuItem + Action = acAdd + end + object miDelete: TMenuItem + Action = acDelete + end + object miMoveUp: TMenuItem + Action = acMoveUp + end + object miMoveDown: TMenuItem + Action = acMoveDown + end + object N1: TMenuItem + Caption = '-' + end + object miToolbar: TMenuItem + Action = acToolbar + end + end + object PopupMenu2: TPopupMenu + Left = 104 + Top = 40 + object miTextLabels: TMenuItem + Action = acTextLabels + end + end +end diff --git a/official/x.35/Lib/D11/cxOIPictureEd.dcu b/official/x.35/Lib/D11/cxOIPictureEd.dcu new file mode 100644 index 00000000..8dd0c844 Binary files /dev/null and b/official/x.35/Lib/D11/cxOIPictureEd.dcu differ diff --git a/official/x.35/Lib/D11/cxOIPictureEd.dfm b/official/x.35/Lib/D11/cxOIPictureEd.dfm new file mode 100644 index 00000000..9c0cd8e1 --- /dev/null +++ b/official/x.35/Lib/D11/cxOIPictureEd.dfm @@ -0,0 +1,121 @@ +object cxfmPictureEditor: TcxfmPictureEditor + Left = 295 + Top = 158 + AutoScroll = False + BorderIcons = [biSystemMenu] + Caption = 'Picture Editor' + ClientHeight = 326 + ClientWidth = 368 + Color = clBtnFace + Constraints.MinHeight = 220 + Constraints.MinWidth = 200 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + OnPaint = FormPaint + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object Bevel1: TBevel + Left = 8 + Top = 287 + Width = 352 + Height = 4 + Anchors = [akLeft, akRight, akBottom] + Shape = bsTopLine + end + object Image: TcxImage + Left = 8 + Top = 8 + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 8 + Height = 273 + Width = 268 + end + object btnCancel: TcxButton + Left = 264 + Top = 297 + Width = 81 + Height = 22 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 0 + end + object btnOk: TcxButton + Left = 178 + Top = 296 + Width = 80 + Height = 22 + Anchors = [akRight, akBottom] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnClear: TcxButton + Left = 282 + Top = 120 + Width = 79 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'C&lear' + TabOrder = 2 + OnClick = btnClearClick + end + object btnCopy: TcxButton + Left = 282 + Top = 64 + Width = 79 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Copy' + TabOrder = 3 + OnClick = btnCopyClick + end + object btnLoad: TcxButton + Left = 282 + Top = 8 + Width = 79 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Load...' + TabOrder = 4 + OnClick = btnLoadClick + end + object btnPaste: TcxButton + Left = 282 + Top = 92 + Width = 79 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Paste' + TabOrder = 5 + OnClick = btnPasteClick + end + object btnSave: TcxButton + Left = 282 + Top = 36 + Width = 79 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Save...' + TabOrder = 6 + OnClick = btnSaveClick + end + object Panel1: TPanel + Left = 24 + Top = 24 + Width = 236 + Height = 241 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + Color = clWindow + TabOrder = 7 + end +end diff --git a/official/x.35/Lib/D11/cxOIStringsEd.dcu b/official/x.35/Lib/D11/cxOIStringsEd.dcu new file mode 100644 index 00000000..250d1b95 Binary files /dev/null and b/official/x.35/Lib/D11/cxOIStringsEd.dcu differ diff --git a/official/x.35/Lib/D11/cxOIStringsEd.dfm b/official/x.35/Lib/D11/cxOIStringsEd.dfm new file mode 100644 index 00000000..f2001cc2 --- /dev/null +++ b/official/x.35/Lib/D11/cxOIStringsEd.dfm @@ -0,0 +1,100 @@ +object cxfmStringsEditor: TcxfmStringsEditor + Left = 370 + Top = 256 + ActiveControl = Memo1 + AutoScroll = False + Caption = 'String List Editor' + ClientHeight = 317 + ClientWidth = 412 + Color = clBtnFace + Constraints.MinHeight = 200 + Constraints.MinWidth = 200 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + OnPaint = FormPaint + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object pnlClient: TPanel + Left = 0 + Top = 0 + Width = 412 + Height = 281 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + BorderWidth = 4 + TabOrder = 0 + object GroupBox: TGroupBox + Left = 4 + Top = 4 + Width = 404 + Height = 273 + Align = alClient + TabOrder = 0 + object pnlClientTop: TPanel + Left = 2 + Top = 15 + Width = 400 + Height = 19 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Label1: TLabel + Left = 9 + Top = 1 + Width = 32 + Height = 13 + Caption = 'Label1' + end + end + object pnlClientClient: TPanel + Left = 2 + Top = 34 + Width = 400 + Height = 237 + Align = alClient + BevelOuter = bvNone + BorderWidth = 5 + TabOrder = 1 + object Memo1: TcxMemo + Left = 5 + Top = 5 + Align = alClient + Lines.Strings = ( + 'Memo1') + Properties.OnChange = Memo1PropertiesChange + TabOrder = 0 + Height = 227 + Width = 390 + end + end + end + end + object btnOK: TcxButton + Left = 224 + Top = 286 + Width = 81 + Height = 23 + Anchors = [akRight, akBottom] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TcxButton + Left = 311 + Top = 286 + Width = 80 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end +end diff --git a/official/x.35/Lib/D11/cxPC.dcu b/official/x.35/Lib/D11/cxPC.dcu new file mode 100644 index 00000000..38c12ff3 Binary files /dev/null and b/official/x.35/Lib/D11/cxPC.dcu differ diff --git a/official/x.35/Lib/D11/cxPCConsts.dcu b/official/x.35/Lib/D11/cxPCConsts.dcu new file mode 100644 index 00000000..750f91f0 Binary files /dev/null and b/official/x.35/Lib/D11/cxPCConsts.dcu differ diff --git a/official/x.35/Lib/D11/cxPCGoDialog.dcu b/official/x.35/Lib/D11/cxPCGoDialog.dcu new file mode 100644 index 00000000..b8db793d Binary files /dev/null and b/official/x.35/Lib/D11/cxPCGoDialog.dcu differ diff --git a/official/x.35/Lib/D11/cxPCPainters.dcu b/official/x.35/Lib/D11/cxPCPainters.dcu new file mode 100644 index 00000000..4940cfe9 Binary files /dev/null and b/official/x.35/Lib/D11/cxPCPainters.dcu differ diff --git a/official/x.35/Lib/D11/cxPCPaintersFactory.dcu b/official/x.35/Lib/D11/cxPCPaintersFactory.dcu new file mode 100644 index 00000000..28e9a527 Binary files /dev/null and b/official/x.35/Lib/D11/cxPCPaintersFactory.dcu differ diff --git a/official/x.35/Lib/D11/cxPCReg.dcr b/official/x.35/Lib/D11/cxPCReg.dcr new file mode 100644 index 00000000..17054b7a Binary files /dev/null and b/official/x.35/Lib/D11/cxPCReg.dcr differ diff --git a/official/x.35/Lib/D11/cxPCReg.dcu b/official/x.35/Lib/D11/cxPCReg.dcu new file mode 100644 index 00000000..a81bf208 Binary files /dev/null and b/official/x.35/Lib/D11/cxPCReg.dcu differ diff --git a/official/x.35/Lib/D11/cxPageControlD11.bpl b/official/x.35/Lib/D11/cxPageControlD11.bpl new file mode 100644 index 00000000..8e3fc3d4 Binary files /dev/null and b/official/x.35/Lib/D11/cxPageControlD11.bpl differ diff --git a/official/x.35/Lib/D11/cxPageControlD11.dcp b/official/x.35/Lib/D11/cxPageControlD11.dcp new file mode 100644 index 00000000..da2ce781 Binary files /dev/null and b/official/x.35/Lib/D11/cxPageControlD11.dcp differ diff --git a/official/x.35/Lib/D11/cxPageControlD11.dcu b/official/x.35/Lib/D11/cxPageControlD11.dcu new file mode 100644 index 00000000..7f38a96b Binary files /dev/null and b/official/x.35/Lib/D11/cxPageControlD11.dcu differ diff --git a/official/x.35/Lib/D11/cxProgressBar.dcu b/official/x.35/Lib/D11/cxProgressBar.dcu new file mode 100644 index 00000000..7868559e Binary files /dev/null and b/official/x.35/Lib/D11/cxProgressBar.dcu differ diff --git a/official/x.35/Lib/D11/cxPropEditors.dcu b/official/x.35/Lib/D11/cxPropEditors.dcu new file mode 100644 index 00000000..30070ecf Binary files /dev/null and b/official/x.35/Lib/D11/cxPropEditors.dcu differ diff --git a/official/x.35/Lib/D11/cxPropertiesConverters.dcu b/official/x.35/Lib/D11/cxPropertiesConverters.dcu new file mode 100644 index 00000000..b639dab3 Binary files /dev/null and b/official/x.35/Lib/D11/cxPropertiesConverters.dcu differ diff --git a/official/x.35/Lib/D11/cxPropertiesStore.dcu b/official/x.35/Lib/D11/cxPropertiesStore.dcu new file mode 100644 index 00000000..c012a184 Binary files /dev/null and b/official/x.35/Lib/D11/cxPropertiesStore.dcu differ diff --git a/official/x.35/Lib/D11/cxPropertiesStoreEditor.dcu b/official/x.35/Lib/D11/cxPropertiesStoreEditor.dcu new file mode 100644 index 00000000..b5590be5 Binary files /dev/null and b/official/x.35/Lib/D11/cxPropertiesStoreEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxPropertiesStoreEditor.dfm b/official/x.35/Lib/D11/cxPropertiesStoreEditor.dfm new file mode 100644 index 00000000..6b6e7ab3 --- /dev/null +++ b/official/x.35/Lib/D11/cxPropertiesStoreEditor.dfm @@ -0,0 +1,1117 @@ +object frmPropertiesStoreEditor: TfrmPropertiesStoreEditor + Left = 412 + Top = 178 + Width = 393 + Height = 553 + Caption = 'PropertiesStore Editor' + Color = clBtnFace + Constraints.MinHeight = 553 + Constraints.MinWidth = 393 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -10 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object pnlClient: TPanel + Left = 0 + Top = 33 + Width = 385 + Height = 486 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object pnlLeftTree: TPanel + Left = 0 + Top = 0 + Width = 272 + Height = 486 + Align = alClient + BevelOuter = bvNone + BorderWidth = 4 + TabOrder = 0 + object pnlLeftTreeTop: TPanel + Left = 4 + Top = 4 + Width = 264 + Height = 29 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object lblFindComponent: TLabel + Left = 7 + Top = 6 + Width = 80 + Height = 13 + Caption = 'Find Component:' + end + object edFindComponent: TEdit + Left = 96 + Top = 4 + Width = 165 + Height = 21 + TabOrder = 0 + OnKeyDown = edFindComponentKeyDown + end + end + object Tree: TTreeView + Left = 4 + Top = 33 + Width = 264 + Height = 449 + Align = alClient + Indent = 19 + ReadOnly = True + RightClickSelect = True + TabOrder = 0 + OnContextPopup = TreeContextPopup + OnCustomDrawItem = TreeCustomDrawItem + OnDeletion = TreeDeletion + OnKeyDown = TreeKeyDown + end + end + object pnlButtons: TPanel + Left = 272 + Top = 0 + Width = 113 + Height = 486 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object Panel1: TPanel + Left = 0 + Top = 348 + Width = 113 + Height = 138 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 113 + Height = 348 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + object btnOK: TButton + Left = 4 + Top = 32 + Width = 105 + Height = 25 + Caption = 'OK' + TabOrder = 0 + OnClick = btnOKClick + end + object btnCancel: TButton + Left = 4 + Top = 64 + Width = 105 + Height = 25 + Caption = 'Cancel' + TabOrder = 1 + OnClick = btnCancelClick + end + end + end + end + object ToolBar: TToolBar + Left = 0 + Top = 0 + Width = 385 + Height = 33 + ButtonHeight = 30 + ButtonWidth = 31 + Caption = 'ToolBar' + Flat = True + Images = ImageList1 + TabOrder = 1 + object btnGroupByComponents: TToolButton + Left = 0 + Top = 0 + Hint = 'Group by components' + Action = actGroupByComponents + ImageIndex = 0 + ParentShowHint = False + ShowHint = True + end + object btnGroupByProperties: TToolButton + Left = 31 + Top = 0 + Hint = 'Group by properties' + Action = actGroupByProperties + ImageIndex = 1 + ParentShowHint = False + ShowHint = True + end + object ToolButton3: TToolButton + Left = 62 + Top = 0 + Width = 8 + Caption = 'ToolButton3' + ImageIndex = 2 + Style = tbsSeparator + end + object btnReset: TToolButton + Left = 70 + Top = 0 + Hint = 'Reset' + Caption = 'btnReset' + ImageIndex = 2 + ParentShowHint = False + ShowHint = True + OnClick = btnResetClick + end + object btnCheckAll: TToolButton + Left = 101 + Top = 0 + Hint = 'Check all' + Caption = 'btnCheckAll' + ImageIndex = 3 + ParentShowHint = False + ShowHint = True + OnClick = btnCheckAllClick + end + object btnUncheckAll: TToolButton + Left = 132 + Top = 0 + Hint = 'Uncheck all' + Caption = 'btnUncheckAll' + ImageIndex = 4 + ParentShowHint = False + ShowHint = True + OnClick = btnUncheckAllClick + end + object btnInvertChecking: TToolButton + Left = 163 + Top = 0 + Hint = 'Invert checking' + Caption = 'btnInvertChecking' + ImageIndex = 5 + ParentShowHint = False + ShowHint = True + OnClick = btnInvertCheckingClick + end + end + object ActionList1: TActionList + Left = 356 + Top = 4 + object actGroupByComponents: TAction + Caption = 'GroupByComponents' + OnExecute = actGroupByComponentsExecute + end + object actGroupByProperties: TAction + Caption = 'GroupByProperties' + OnExecute = actGroupByPropertiesExecute + end + end + object ImageList1: TImageList + Height = 24 + Width = 24 + Left = 324 + Top = 4 + Bitmap = { + 494C010106000900040018001800FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 000000000000360000002800000060000000480000000100200000000000006C + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF0000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF008000 + 0000800000008000000080000000800000008000000080000000800000008000 + 00008000000080000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080800000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000008080800000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF008000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF008000 + 0000800000008000000080000000800000008000000080000000800000008000 + 00008000000080000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00800000008000 + 0000800000008000000080000000FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000080808000FFFFFF00800000008000 + 0000800000008000000080000000FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0080000000FFFF + FF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000080808000FFFFFF0080000000FFFF + FF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00800000008000 + 0000800000008000000080000000800000008000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000080808000FFFFFF00800000008000 + 0000800000008000000080000000FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0080000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00800000008000 + 0000800000008000000080000000800000008000000080808000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF000000FF0000000000000080808000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000080808000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF000000FF000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0080000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FFFFFF00FF0000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FFFFFF00FF000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00800000008000 + 0000800000008000000080000000800000008000000080808000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF000000FF0000000000000080808000FFFFFF00800000008000 + 0000800000008000000080000000800000008000000080808000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF000000FF000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0080000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 80008080800080808000808080000000000080808000FFFFFF0080000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00800000008000 + 0000800000008000000080000000800000008000000080000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 00000080000000000000000000000000000080808000FFFFFF00800000008000 + 0000800000008000000080000000800000008000000080000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000008000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000080 + 00000080000000800000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000080 + 0000008000000080000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF00000000000000000000000000000000000000008000000080 + 00000080000000800000008000000000000080808000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF00000000000000000000000000000000000000008000000080 + 0000008000000080000000800000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FFFFFF00FF00000000000000000000000000000000000000000000000000 + 00000080000000000000000000000000000080808000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FFFFFF00FF00000000000000000000000000000000000000000000000000 + 0000008000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF00000000000000008000000000000000000000000000000080 + 00000000000000000000000000000000000080808000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF00000000000000008000000000000000000000000000000080 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800000000000000000000080000000800000008000000000 + 0000000000000000000000000000000000008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800000000000000000000080000000800000008000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FF0000000000000000000000000000000000 + 00000000000000FFFF0000FFFF0000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000FF0000000000000000000000000000000000 + 0000FFFFFF0000000000FFFFFF000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FF000000FF00000000000000000000000000 + 000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF008000 + 000080000000800000008000000080000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000FF000000FF00000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000C0C0 + C00000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000000000000000 + 000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF008000 + 0000FFFFFF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000FF000000FF000000FF000000FF000000FF000000FF000000000000000000 + 0000FFFFFF0000000000FFFFFF000000000000000000FFFFFF0000000000C0C0 + C00000000000000000000000000000000000000000000000000000000000FF00 + 0000000000000000000000000000FF000000FF00000000000000000000000000 + 000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000000000C0C0 + C000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF008000 + 0000800000008000000080000000800000008000000080000000800000008000 + 0000FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000FF0000000000000000000000FF000000FF00000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000C0C0 + C00000000000808080000000000000000000000000000000000000000000FF00 + 0000000000000000000000000000FF0000000000000000000000000000000000 + 000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000000000C0C0 + C000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF008000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008000 + 0000FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000FF0000000000000000000000FF0000000000000000000000000000000000 + 0000FFFFFF00FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000C0C0 + C00000000000808080000000000000000000000000000000000000000000FF00 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000FFFF0000FFFF0000FFFF0000FFFF0000000000C0C0C000C0C0 + C000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080800000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF008000 + 0000800000008000000080000000800000008000000080000000800000008000 + 00008000000080000000FFFFFF00000000000000000000000000000000000000 + 0000FF0000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF0000000000FFFFFF0000000000FFFFFF000000000000000000C0C0 + C00080000000808080000000000000000000000000000000000000000000FF00 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000C0C0C000C0C0C000C0C0 + C000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000800000C0C0C000C0C0C00000800000008000000080 + 00000080000000800000C0C0C000C0C0C0000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF008000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080000000FFFFFF00000000000000000000000000000000000000 + 0000FF0000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF0000000000FFFFFF00FFFFFF000000 + 0000800000008000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000C0C0C000C0C0C000C0C0C000C0C0C0000000 + 0000808080008080800000000000000000000000000000000000000000000000 + 0000000000000000000000800000008000000080000000800000008000000000 + 0000000000000000000000800000C0C0C000C0C0C00000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF008000 + 0000800000008000000080000000800000008000000080000000800000008000 + 00008000000080000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000C0C0C00000000000FFFFFF00FFFFFF00FFFFFF000000 + 0000800000008000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800000000000000000000000000000000000000000000000 + 0000000000000000000000800000008000000080000000800000000000000000 + 0000000000000000000000000000008000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF008000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000800000008000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000080808000808080008080 + 8000808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000800000008000000080000000800000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF008000 + 000080000000800000008000000080000000800000008000000080000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 00000000000000FFFF0000FFFF0000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000008080800080808000808080008080 + 8000808080008080800000000000000000000000000000000000FFFFFF000000 + 000000000000FFFFFF0000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000800000008000000080000000800000008000000000 + 00000000000000000000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C0000000000000000000000000000000000080808000FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000000000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080000000800000008000000080000000800000C0C0C000C0C0 + C0000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF000000FF0000000000000000000000000000000000000000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 000000000000FFFFFF0000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000800000008000000080000000800000C0C0C000C0C0 + C0000000000000000000000000000000000080808000FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000080808000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FFFFFF00FF00000000000000000000000000000000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000080000000000000000000000000 + 0000000000000000000000800000008000000080000000800000C0C0C0000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF000000FF00000000000000000000000000000000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000800000000000000000 + 0000000000000080000000800000008000000080000000800000C0C0C0000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 800080808000808080008080800000000000000000000000000000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF0000000000FFFFFF0000000000FFFFFF0000000000FFFFFF00000000000000 + 0000000000008000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008000000080 + 0000008000000080000000800000C0C0C0000000000000800000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 000000800000000000000000000000000000000000000000000000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFFFF00FFFF + FF00000000008000000080000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000080 + 00000080000000800000000000000000000000000000000000000000000000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF0000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF008000000080000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF00000000000000000000000000000000000000008000000080 + 00000080000000800000008000000000000000000000000000000000000000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000008000000080000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FFFFFF00FF00000000000000000000000000000000000000000000000000 + 0000008000000000000000000000000000000000000000000000000000000000 + 00000000000000FFFF0000FFFF0000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008000000080000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FF00000000000000008000000000000000000000000000000080 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800000000000000000000080000000800000008000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000060000000480000000100010000000000600300000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFF000000000000FF8000FF + 8000000000000000FF8000FF8000000000000000FF8000FF8000000000000000 + FF8000FF8000000000000000FF8000FF8000000000000000FF8000FF80000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000001F700 + 01F70000000000000001E30001E30000000000000001C10001C1000000000000 + 0001F70001F70000000000000000EF0000EF00000000000000011F00011F0000 + 00000000FFFFFFFFFFFF000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFE01FFF + F87FFFFFFFFF8000FFE01FFEF03FFFFFFFFF8000FEE007FE601FFFFFFFFF8000 + FE6007E0200FFFFFFFFF8000F02001EE6007FFFFFFFF8000F66001EEE003FFFF + FFFF8000F6E001EFF001FFC1FF000000F7E001EFF801FC00FF000000F7E001FF + FC01FC1C7F000000FFF801800E01FC3EFF000000F87801800F03FC3FFF000000 + E01E01800F87FC1C0F000000C00E01800FFFFFF80F000000C00FFF800FFFFFFC + 0F0000008007FF800FFFFF7C1F0000008007FF800FFFFFB81F0000008007FF80 + 0BFFFFC0BF0001F78007FF8001FFFFFFFF0001E3C00FFF8001FFFFFFFF0001C1 + C00FFFFE01FFFFFFFF0001F7E01FFFFF09FFFFFFFF0000EFF87FFFFFFFFFFFFF + FF00011FFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/cxRadioGroup.dcu b/official/x.35/Lib/D11/cxRadioGroup.dcu new file mode 100644 index 00000000..3833e621 Binary files /dev/null and b/official/x.35/Lib/D11/cxRadioGroup.dcu differ diff --git a/official/x.35/Lib/D11/cxRegExpr.dcu b/official/x.35/Lib/D11/cxRegExpr.dcu new file mode 100644 index 00000000..71f96a40 Binary files /dev/null and b/official/x.35/Lib/D11/cxRegExpr.dcu differ diff --git a/official/x.35/Lib/D11/cxRichEdit.dcu b/official/x.35/Lib/D11/cxRichEdit.dcu new file mode 100644 index 00000000..89d21570 Binary files /dev/null and b/official/x.35/Lib/D11/cxRichEdit.dcu differ diff --git a/official/x.35/Lib/D11/cxScheduler.dcu b/official/x.35/Lib/D11/cxScheduler.dcu new file mode 100644 index 00000000..15d05eaf Binary files /dev/null and b/official/x.35/Lib/D11/cxScheduler.dcu differ diff --git a/official/x.35/Lib/D11/cxScheduler.res b/official/x.35/Lib/D11/cxScheduler.res new file mode 100644 index 00000000..7e7fe68d Binary files /dev/null and b/official/x.35/Lib/D11/cxScheduler.res differ diff --git a/official/x.35/Lib/D11/cxSchedulerAggregateStorage.dcu b/official/x.35/Lib/D11/cxSchedulerAggregateStorage.dcu new file mode 100644 index 00000000..54570f6b Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerAggregateStorage.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerCustomControls.dcu b/official/x.35/Lib/D11/cxSchedulerCustomControls.dcu new file mode 100644 index 00000000..aaaeb472 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerCustomControls.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerCustomResourceView.dcu b/official/x.35/Lib/D11/cxSchedulerCustomResourceView.dcu new file mode 100644 index 00000000..4a3c2cb7 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerCustomResourceView.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerD11.bpl b/official/x.35/Lib/D11/cxSchedulerD11.bpl new file mode 100644 index 00000000..7f8733ac Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerD11.bpl differ diff --git a/official/x.35/Lib/D11/cxSchedulerD11.dcp b/official/x.35/Lib/D11/cxSchedulerD11.dcp new file mode 100644 index 00000000..f5cc5a0f Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerD11.dcp differ diff --git a/official/x.35/Lib/D11/cxSchedulerD11.dcu b/official/x.35/Lib/D11/cxSchedulerD11.dcu new file mode 100644 index 00000000..9533894b Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerD11.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerDBStorage.dcu b/official/x.35/Lib/D11/cxSchedulerDBStorage.dcu new file mode 100644 index 00000000..5acce46b Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerDBStorage.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerDateNavigator.dcu b/official/x.35/Lib/D11/cxSchedulerDateNavigator.dcu new file mode 100644 index 00000000..d835e106 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerDateNavigator.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerDayView.dcu b/official/x.35/Lib/D11/cxSchedulerDayView.dcu new file mode 100644 index 00000000..4ad7c197 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerDayView.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerDialogs.dcu b/official/x.35/Lib/D11/cxSchedulerDialogs.dcu new file mode 100644 index 00000000..2c27af41 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerDialogs.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerEventEditor.dcu b/official/x.35/Lib/D11/cxSchedulerEventEditor.dcu new file mode 100644 index 00000000..3ac7a051 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerEventEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerEventEditor.dfm b/official/x.35/Lib/D11/cxSchedulerEventEditor.dfm new file mode 100644 index 00000000..20b55bb7 --- /dev/null +++ b/official/x.35/Lib/D11/cxSchedulerEventEditor.dfm @@ -0,0 +1,543 @@ +object cxSchedulerEventEditorForm: TcxSchedulerEventEditorForm + Left = 313 + Top = 267 + AutoScroll = False + ClientHeight = 415 + ClientWidth = 450 + Color = clBtnFace + Constraints.MinHeight = 410 + Constraints.MinWidth = 458 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + KeyPreview = True + OldCreateOrder = False + Position = poScreenCenter + OnActivate = FormActivate + OnCloseQuery = FormCloseQuery + OnKeyDown = FormKeyDown + PixelsPerInch = 96 + TextHeight = 13 + object pnlButtons: TPanel + Left = 0 + Top = 377 + Width = 450 + Height = 38 + Align = alBottom + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 0 + object pnlThreeButtons: TPanel + Left = 0 + Top = 0 + Width = 340 + Height = 38 + Align = alClient + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 0 + object btnOk: TcxButton + Left = 15 + Top = 7 + Width = 95 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object btnCancel: TcxButton + Left = 125 + Top = 7 + Width = 95 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + object btnDelete: TcxButton + Left = 235 + Top = 7 + Width = 95 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Delete' + TabOrder = 2 + OnClick = btnDeleteClick + end + end + object pnlRecurrence: TPanel + Left = 340 + Top = 0 + Width = 110 + Height = 38 + Align = alRight + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 1 + object btnRecurrence: TcxButton + Left = 5 + Top = 7 + Width = 95 + Height = 23 + Caption = '&Recurrence' + TabOrder = 0 + OnClick = btnRecurrenceClick + end + end + end + object pnlInformation: TPanel + Left = 0 + Top = 0 + Width = 450 + Height = 41 + Align = alTop + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 8 + object Bevel6: TBevel + Left = 11 + Top = 33 + Width = 429 + Height = 7 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object btnFindTime: TcxButton + Left = 320 + Top = 8 + Width = 120 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Find available time' + TabOrder = 0 + OnClick = btnFindTimeClick + end + object cxGroupBox1: TcxGroupBox + Left = 13 + Top = 8 + Alignment = alCenterCenter + Anchors = [akLeft, akTop, akRight] + ParentBackground = False + ParentColor = False + Style.Color = clInfoBk + Style.TransparentBorder = False + TabOrder = 1 + Height = 23 + Width = 298 + object lbInformation: TLabel + Left = 4 + Top = 4 + Width = 290 + Height = 15 + AutoSize = False + Caption = 'Conflicts with another event in your schedule.' + end + end + end + object pnlCaption: TPanel + Left = 0 + Top = 41 + Width = 450 + Height = 65 + Align = alTop + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 1 + object lbSubject: TLabel + Left = 16 + Top = 13 + Width = 40 + Height = 13 + Caption = 'Subject:' + FocusControl = teSubject + end + object lbLocation: TLabel + Left = 16 + Top = 38 + Width = 44 + Height = 13 + Caption = 'Location:' + FocusControl = teLocation + end + object lbLabel: TLabel + Left = 239 + Top = 38 + Width = 29 + Height = 13 + Anchors = [akTop, akRight] + Caption = 'La&bel:' + FocusControl = icbLabel + end + object teSubject: TcxTextEdit + Left = 72 + Top = 9 + Anchors = [akLeft, akTop, akRight] + Properties.OnChange = OnChanged + TabOrder = 0 + Width = 369 + end + object teLocation: TcxTextEdit + Left = 72 + Top = 34 + Anchors = [akLeft, akTop, akRight] + Properties.OnChange = OnChanged + TabOrder = 1 + Width = 145 + end + object icbLabel: TcxImageComboBox + Left = 272 + Top = 34 + Anchors = [akTop, akRight] + Properties.Items = <> + Properties.OnChange = OnChanged + TabOrder = 2 + Width = 169 + end + end + object pnlTime: TPanel + Left = 0 + Top = 106 + Width = 450 + Height = 67 + Align = alTop + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 2 + object Bevel4: TBevel + Left = 11 + Top = 0 + Width = 429 + Height = 8 + Anchors = [akLeft, akTop, akRight] + Shape = bsTopLine + end + object lbStartTime: TLabel + Left = 16 + Top = 15 + Width = 51 + Height = 13 + Caption = 'Start time:' + FocusControl = deStart + end + object lbEndTime: TLabel + Left = 16 + Top = 40 + Width = 45 + Height = 13 + Caption = 'End time:' + FocusControl = deEnd + end + object deStart: TcxDateEdit + Left = 96 + Top = 11 + Properties.DateButtons = [btnToday] + Properties.InputKind = ikStandard + Properties.OnChange = OnChanged + Properties.OnEditValueChanged = StartDateChanged + TabOrder = 0 + Width = 121 + end + object teStart: TcxTimeEdit + Left = 224 + Top = 11 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = OnEventTimeChanged + TabOrder = 1 + Width = 78 + end + object deEnd: TcxDateEdit + Left = 96 + Top = 36 + Properties.DateButtons = [btnToday] + Properties.InputKind = ikStandard + Properties.OnChange = OnChanged + TabOrder = 2 + Width = 121 + end + object teEnd: TcxTimeEdit + Left = 224 + Top = 36 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = OnEventTimeChanged + TabOrder = 3 + Width = 78 + end + object cbAllDayEvent: TcxCheckBox + Left = 320 + Top = 12 + Caption = 'All day event' + Properties.OnChange = cbAllDayEventPropertiesChange + TabOrder = 4 + Width = 121 + end + end + object pnlRecurrenceInfo: TPanel + Left = 0 + Top = 213 + Width = 450 + Height = 40 + Align = alTop + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 4 + object Bevel7: TBevel + Left = 11 + Top = 0 + Width = 429 + Height = 8 + Anchors = [akLeft, akTop, akRight] + Shape = bsTopLine + end + object lbRecurrence: TLabel + Left = 16 + Top = 15 + Width = 59 + Height = 13 + Caption = 'Recurrence:' + end + object lbRecurrencePattern: TLabel + Left = 88 + Top = 16 + Width = 353 + Height = 13 + Anchors = [akLeft, akTop, akRight] + AutoSize = False + Caption = 'PatternInfo' + WordWrap = True + end + end + object pnlPlaceHolder: TPanel + Left = 0 + Top = 296 + Width = 450 + Height = 43 + Align = alTop + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 6 + object pnlReminder: TPanel + Left = 0 + Top = 4 + Width = 224 + Height = 39 + Align = alLeft + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 0 + object cbReminder: TcxCheckBox + Left = 11 + Top = 9 + Caption = 'Reminder:' + Properties.OnChange = OnChanged + State = cbsChecked + TabOrder = 0 + OnClick = cbReminderClick + Width = 81 + end + object cbReminderMinutesBeforeStart: TcxComboBox + Left = 96 + Top = 8 + Properties.ImmediateDropDown = False + Properties.ImmediatePost = True + Properties.IncrementalSearch = False + Properties.OnChange = OnChanged + Properties.OnPopup = cbReminderMinutesBeforeStartPropertiesPopup + Properties.OnValidate = cbReminderMinutesBeforeStartPropertiesValidate + TabOrder = 1 + Width = 121 + end + end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 450 + Height = 4 + Align = alTop + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 1 + object Bevel3: TBevel + Left = 11 + Top = 0 + Width = 439 + Height = 4 + Anchors = [akLeft, akTop, akRight] + Shape = bsTopLine + end + end + object pnlShowTimeAs: TPanel + Left = 224 + Top = 4 + Width = 281 + Height = 39 + Align = alLeft + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 2 + object lbShowTimeAs: TLabel + Left = 16 + Top = 12 + Width = 67 + Height = 13 + Caption = 'Show time as:' + FocusControl = icbShowTimeAs + end + object icbShowTimeAs: TcxImageComboBox + Left = 96 + Top = 8 + Properties.Items = <> + Properties.OnChange = OnEventTimeChanged + TabOrder = 0 + Width = 121 + end + end + end + object pnlMessage: TPanel + Left = 0 + Top = 339 + Width = 450 + Height = 38 + Align = alClient + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 7 + object Bevel2: TBevel + Left = 11 + Top = 0 + Width = 429 + Height = 9 + Anchors = [akLeft, akTop, akRight] + Shape = bsTopLine + end + object Bevel1: TBevel + Left = 11 + Top = 30 + Width = 429 + Height = 7 + Anchors = [akLeft, akRight, akBottom] + Shape = bsBottomLine + end + object meMessage: TcxMemo + Left = 10 + Top = 12 + Anchors = [akLeft, akTop, akRight, akBottom] + Properties.OnChange = OnChanged + TabOrder = 0 + Height = 12 + Width = 431 + end + end + object pnlResource: TPanel + Left = 0 + Top = 253 + Width = 450 + Height = 43 + Align = alTop + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 5 + object lbResource: TLabel + Left = 16 + Top = 17 + Width = 62 + Height = 13 + Caption = 'Resource(s):' + end + object Bevel5: TBevel + Left = 11 + Top = -4 + Width = 429 + Height = 7 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object cbResources: TcxCheckComboBox + Left = 96 + Top = 13 + Anchors = [akLeft, akTop, akRight] + Properties.DropDownAutoWidth = False + Properties.EditValueFormat = cvfIndices + Properties.Items = <> + Properties.OnChange = OnResourceIDChanged + TabOrder = 0 + Width = 346 + end + end + object pnlTaskComplete: TPanel + Left = 0 + Top = 173 + Width = 450 + Height = 40 + Align = alTop + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 3 + object Bevel8: TBevel + Left = 11 + Top = 0 + Width = 429 + Height = 8 + Anchors = [akLeft, akTop, akRight] + Shape = bsTopLine + end + object lbTaskComplete: TLabel + Left = 16 + Top = 15 + Width = 72 + Height = 13 + Caption = 'Task complete:' + FocusControl = seTaskComplete + end + object lbTaskStatus: TLabel + Left = 240 + Top = 15 + Width = 59 + Height = 13 + Caption = 'Task status:' + FocusControl = cbxTaskStatus + end + object seTaskComplete: TcxSpinEdit + Left = 96 + Top = 11 + Properties.AssignedValues.EditFormat = True + Properties.AssignedValues.MinValue = True + Properties.Increment = 25.000000000000000000 + Properties.LargeIncrement = 25.000000000000000000 + Properties.MaxValue = 100.000000000000000000 + Properties.OnChange = seTaskCompleteChange + Properties.OnEditValueChanged = seTaskCompleteChange + TabOrder = 0 + Width = 121 + end + object cbxTaskStatus: TcxComboBox + Left = 320 + Top = 11 + Properties.DropDownListStyle = lsFixedList + Properties.OnChange = cbxTaskStatusChange + Properties.OnEditValueChanged = cbxTaskStatusChange + TabOrder = 1 + Width = 121 + end + end +end diff --git a/official/x.35/Lib/D11/cxSchedulerGanttView.dcu b/official/x.35/Lib/D11/cxSchedulerGanttView.dcu new file mode 100644 index 00000000..fc47c56f Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerGanttView.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerGoToDateDialog.dcu b/official/x.35/Lib/D11/cxSchedulerGoToDateDialog.dcu new file mode 100644 index 00000000..469a5173 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerGoToDateDialog.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerGoToDateDialog.dfm b/official/x.35/Lib/D11/cxSchedulerGoToDateDialog.dfm new file mode 100644 index 00000000..44a9fc1c --- /dev/null +++ b/official/x.35/Lib/D11/cxSchedulerGoToDateDialog.dfm @@ -0,0 +1,78 @@ +object fmGoToDateForm: TfmGoToDateForm + Left = 160 + Top = 234 + BorderStyle = bsDialog + Caption = 'fmGoToDateForm' + ClientHeight = 90 + ClientWidth = 336 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poMainFormCenter + PixelsPerInch = 96 + TextHeight = 13 + object cxGroupBox1: TcxGroupBox + Left = 8 + Top = 4 + Alignment = alCenterCenter + TabOrder = 0 + Height = 77 + Width = 213 + object lbDate: TLabel + Left = 10 + Top = 20 + Width = 31 + Height = 13 + Caption = 'lbDate' + FocusControl = deDate + Transparent = True + end + object lbShowIn: TLabel + Left = 10 + Top = 48 + Width = 44 + Height = 13 + Caption = 'lbShowIn' + FocusControl = cbShowIn + Transparent = True + end + object deDate: TcxDateEdit + Left = 80 + Top = 16 + Properties.DateButtons = [btnToday] + TabOrder = 0 + Width = 121 + end + object cbShowIn: TcxComboBox + Left = 80 + Top = 44 + Properties.DropDownListStyle = lsFixedList + TabOrder = 1 + Width = 121 + end + end + object btnOk: TcxButton + Left = 232 + Top = 8 + Width = 95 + Height = 25 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TcxButton + Left = 232 + Top = 42 + Width = 95 + Height = 25 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end +end diff --git a/official/x.35/Lib/D11/cxSchedulerGridD11.bpl b/official/x.35/Lib/D11/cxSchedulerGridD11.bpl new file mode 100644 index 00000000..7079566e Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerGridD11.bpl differ diff --git a/official/x.35/Lib/D11/cxSchedulerGridD11.dcp b/official/x.35/Lib/D11/cxSchedulerGridD11.dcp new file mode 100644 index 00000000..b8642df0 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerGridD11.dcp differ diff --git a/official/x.35/Lib/D11/cxSchedulerGridD11.dcu b/official/x.35/Lib/D11/cxSchedulerGridD11.dcu new file mode 100644 index 00000000..5651987e Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerGridD11.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerHolidays.dcu b/official/x.35/Lib/D11/cxSchedulerHolidays.dcu new file mode 100644 index 00000000..1976d568 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerHolidays.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerHolidaysEditor.dcu b/official/x.35/Lib/D11/cxSchedulerHolidaysEditor.dcu new file mode 100644 index 00000000..50c1ce61 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerHolidaysEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerHolidaysEditor.dfm b/official/x.35/Lib/D11/cxSchedulerHolidaysEditor.dfm new file mode 100644 index 00000000..9fc9d896 --- /dev/null +++ b/official/x.35/Lib/D11/cxSchedulerHolidaysEditor.dfm @@ -0,0 +1,214 @@ +object fmHolidaysEditor: TfmHolidaysEditor + Left = 380 + Top = 223 + ActiveControl = clbLocations + BorderStyle = bsDialog + Caption = 'fmHolidaysEditor' + ClientHeight = 414 + ClientWidth = 716 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object btnImport: TcxButton + Left = 8 + Top = 8 + Width = 112 + Height = 23 + Caption = 'btnImport' + TabOrder = 3 + OnClick = btnImportClick + end + object gbAddedHolidays: TcxGroupBox + Left = 8 + Top = 175 + Caption = 'Added holidays' + TabOrder = 7 + Height = 200 + Width = 700 + object lbxAllAddedHolidays: TcxListBox + Left = 8 + Top = 16 + Width = 684 + Height = 174 + Align = alCustom + Anchors = [akLeft, akTop, akRight, akBottom] + ItemHeight = 16 + ListStyle = lbOwnerDrawFixed + ParentFont = False + TabOrder = 0 + end + end + object gbLocations: TcxGroupBox + Left = 8 + Top = 39 + Caption = 'Locations' + Style.TransparentBorder = True + TabOrder = 5 + Height = 130 + Width = 302 + object clbLocations: TcxCheckListBox + Left = 8 + Top = 16 + Width = 195 + Height = 106 + Align = alCustom + AllowDblClickToggle = False + Anchors = [akLeft, akTop, akRight, akBottom] + Items = <> + ParentFont = False + Style.Font.Charset = DEFAULT_CHARSET + Style.Font.Color = clWindowText + Style.Font.Height = -11 + Style.Font.Name = 'Tahoma' + Style.Font.Style = [] + Style.IsFontAssigned = True + TabOrder = 0 + OnClick = clbLocationsClick + OnClickCheck = clbLocationsClickCheck + OnDblClick = clbLocationsDblClick + OnEditValueChanged = clbLocationsClick + OnKeyDown = clbLocationsKeyDown + end + object btnLocationAdd: TcxButton + Left = 209 + Top = 16 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Add' + TabOrder = 1 + OnClick = btnLocationClick + end + object btnLocationEdit: TcxButton + Tag = 1 + Left = 209 + Top = 45 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Edit' + TabOrder = 2 + OnClick = btnLocationClick + end + object btnLocationDelete: TcxButton + Tag = 2 + Left = 209 + Top = 74 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Delete' + TabOrder = 3 + OnClick = btnLocationClick + end + end + object gbHolidays: TcxGroupBox + Left = 318 + Top = 39 + Caption = 'Holidays' + TabOrder = 6 + Height = 130 + Width = 390 + object clbHolidays: TcxCheckListBox + Left = 8 + Top = 16 + Width = 283 + Height = 106 + Align = alCustom + AllowDblClickToggle = False + Anchors = [akLeft, akTop, akRight, akBottom] + EditValueFormat = cvfStatesString + Items = <> + ParentFont = False + Style.Font.Charset = DEFAULT_CHARSET + Style.Font.Color = clWindowText + Style.Font.Height = -11 + Style.Font.Name = 'Tahoma' + Style.Font.Style = [] + Style.IsFontAssigned = True + TabOrder = 0 + OnClickCheck = clbHolidaysClickCheck + OnDblClick = clbHolidaysDblClick + OnKeyDown = clbHolidaysKeyDown + end + object btnHolidaysAdd: TcxButton + Left = 297 + Top = 16 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Add' + TabOrder = 1 + OnClick = btnHolidaysClick + end + object btnHolidaysDelete: TcxButton + Tag = 2 + Left = 297 + Top = 74 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Delete' + TabOrder = 3 + OnClick = btnHolidaysClick + end + object btnHolidaysEdit: TcxButton + Tag = 1 + Left = 297 + Top = 45 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Edit' + TabOrder = 2 + OnClick = btnHolidaysClick + end + end + object btnOk: TcxButton + Left = 443 + Top = 383 + Width = 85 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + OnClick = btnOkClick + end + object btnCancel: TcxButton + Left = 533 + Top = 383 + Width = 85 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + object btnApply: TcxButton + Left = 623 + Top = 383 + Width = 85 + Height = 23 + Caption = 'Apply' + TabOrder = 2 + OnClick = btnApplyClick + end + object btnExport: TcxButton + Left = 128 + Top = 8 + Width = 112 + Height = 23 + Caption = 'btnExport' + TabOrder = 4 + OnClick = btnExportClick + end +end diff --git a/official/x.35/Lib/D11/cxSchedulerHolidaysLocationEditor.dcu b/official/x.35/Lib/D11/cxSchedulerHolidaysLocationEditor.dcu new file mode 100644 index 00000000..8a04915a Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerHolidaysLocationEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerHolidaysLocationEditor.dfm b/official/x.35/Lib/D11/cxSchedulerHolidaysLocationEditor.dfm new file mode 100644 index 00000000..9a5c2668 --- /dev/null +++ b/official/x.35/Lib/D11/cxSchedulerHolidaysLocationEditor.dfm @@ -0,0 +1,52 @@ +object fmHolidaysLocationEditor: TfmHolidaysLocationEditor + Left = 617 + Top = 345 + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'fmHolidaysLocationEditor' + ClientHeight = 68 + ClientWidth = 314 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object lbName: TcxLabel + Left = 6 + Top = 10 + Caption = 'lbName' + end + object teName: TcxTextEdit + Left = 96 + Top = 8 + Properties.OnChange = teLocationPropertiesChange + TabOrder = 1 + Width = 210 + end + object btnOK: TcxButton + Left = 128 + Top = 37 + Width = 85 + Height = 23 + Caption = 'btnOK' + Default = True + ModalResult = 1 + TabOrder = 2 + OnClick = btnOKClick + end + object btnCancel: TcxButton + Left = 221 + Top = 37 + Width = 85 + Height = 23 + Cancel = True + Caption = 'btnCancel' + ModalResult = 2 + TabOrder = 3 + end +end diff --git a/official/x.35/Lib/D11/cxSchedulerHolidaysLocationHolidayEditor.dcu b/official/x.35/Lib/D11/cxSchedulerHolidaysLocationHolidayEditor.dcu new file mode 100644 index 00000000..dd4c702b Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerHolidaysLocationHolidayEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerHolidaysLocationHolidayEditor.dfm b/official/x.35/Lib/D11/cxSchedulerHolidaysLocationHolidayEditor.dfm new file mode 100644 index 00000000..c9cc63eb --- /dev/null +++ b/official/x.35/Lib/D11/cxSchedulerHolidaysLocationHolidayEditor.dfm @@ -0,0 +1,64 @@ +object fmHolidaysLocationHolidayEditor: TfmHolidaysLocationHolidayEditor + Left = 695 + Top = 316 + ActiveControl = teName + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'fmHolidaysLocationHolidayEditor' + ClientHeight = 97 + ClientWidth = 320 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object lbName: TcxLabel + Left = 6 + Top = 10 + Caption = 'lbName' + end + object teName: TcxTextEdit + Left = 112 + Top = 8 + Properties.OnChange = ValueChange + TabOrder = 1 + Width = 200 + end + object btnOk: TcxButton + Left = 133 + Top = 66 + Width = 85 + Height = 23 + Caption = 'btnOk' + ModalResult = 1 + TabOrder = 3 + OnClick = btnOkClick + end + object btnCancel: TcxButton + Left = 226 + Top = 66 + Width = 85 + Height = 23 + Cancel = True + Caption = 'btnCancel' + ModalResult = 2 + TabOrder = 5 + end + object lbDate: TcxLabel + Left = 6 + Top = 38 + Caption = 'lbDate' + end + object deDate: TcxDateEdit + Left = 112 + Top = 37 + Properties.OnChange = ValueChange + Properties.OnEditValueChanged = ValueChange + TabOrder = 2 + Width = 200 + end +end diff --git a/official/x.35/Lib/D11/cxSchedulerOutlookExchange.dcu b/official/x.35/Lib/D11/cxSchedulerOutlookExchange.dcu new file mode 100644 index 00000000..c2cb0fd5 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerOutlookExchange.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerRecurrenceEditor.dcu b/official/x.35/Lib/D11/cxSchedulerRecurrenceEditor.dcu new file mode 100644 index 00000000..afdbf36b Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerRecurrenceEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerRecurrenceEditor.dfm b/official/x.35/Lib/D11/cxSchedulerRecurrenceEditor.dfm new file mode 100644 index 00000000..933d4716 --- /dev/null +++ b/official/x.35/Lib/D11/cxSchedulerRecurrenceEditor.dfm @@ -0,0 +1,628 @@ +object cxSchedulerRecurrenceEventEditorForm: TcxSchedulerRecurrenceEventEditorForm + Left = 277 + Top = 263 + ActiveControl = teStart + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'Event recurrence' + ClientHeight = 330 + ClientWidth = 483 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + KeyPreview = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object btnOk: TcxButton + Left = 68 + Top = 298 + Width = 85 + Height = 23 + Caption = '&Ok' + Default = True + TabOrder = 0 + OnClick = btnOkClick + end + object btnCancel: TcxButton + Left = 172 + Top = 298 + Width = 85 + Height = 23 + Cancel = True + Caption = '&Cancel' + ModalResult = 2 + TabOrder = 1 + end + object btnRemove: TcxButton + Left = 276 + Top = 298 + Width = 121 + Height = 23 + Caption = '&Remove recurrence' + Enabled = False + ModalResult = 3 + TabOrder = 2 + end + object gbTime: TcxGroupBox + Left = 8 + Top = 6 + Caption = 'Event time' + TabOrder = 3 + Height = 50 + Width = 466 + object lbStart: TLabel + Left = 14 + Top = 21 + Width = 28 + Height = 13 + Caption = 'Start:' + FocusControl = teStart + Transparent = True + end + object lbEnd: TLabel + Left = 144 + Top = 21 + Width = 22 + Height = 13 + Caption = 'End:' + FocusControl = teEnd + Transparent = True + end + object lbDuration: TLabel + Left = 264 + Top = 21 + Width = 45 + Height = 13 + Caption = 'Duration:' + FocusControl = cbDuration + Transparent = True + end + object teStart: TcxTimeEdit + Left = 52 + Top = 17 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = DoChange + Properties.OnEditValueChanged = StartTimeChanged + TabOrder = 0 + Width = 78 + end + object teEnd: TcxTimeEdit + Left = 174 + Top = 17 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = DoChange + Properties.OnEditValueChanged = EndTimeChanged + TabOrder = 1 + Width = 78 + end + object cbDuration: TcxComboBox + Left = 323 + Top = 17 + Properties.ImmediateDropDown = False + Properties.ImmediatePost = True + Properties.IncrementalSearch = False + Properties.OnChange = DoChange + Properties.OnPopup = cbDurationPropertiesPopup + Properties.OnValidate = cbDurationPropertiesValidate + TabOrder = 2 + Width = 129 + end + end + object gbPattern: TcxGroupBox + Left = 8 + Top = 60 + Caption = 'Recurrence pattern' + TabOrder = 4 + Height = 127 + Width = 466 + object pnlYearly: TcxGroupBox + Left = 94 + Top = 18 + Align = alCustom + PanelStyle.Active = True + PanelStyle.OfficeBackgroundKind = pobkStyleColor + Style.BorderStyle = ebsNone + TabOrder = 0 + Visible = False + Height = 107 + Width = 370 + object lbOf: TLabel + Left = 243 + Top = 36 + Width = 10 + Height = 13 + Caption = 'of' + end + object cbMonths1: TcxComboBox + Tag = 11589716 + Left = 262 + Top = 32 + Properties.DropDownListStyle = lsFixedList + Properties.OnChange = cbWeek1PropertiesChange + TabOrder = 0 + Width = 90 + end + object meDayOfMonth: TcxMaskEdit + Tag = 11588656 + Left = 155 + Top = 3 + Properties.MaskKind = emkRegExpr + Properties.EditMask = '\d{0,4}' + Properties.MaxLength = 0 + Properties.OnChange = cbMonthsPropertiesChange + TabOrder = 1 + OnExit = ValidateNumber + Width = 32 + end + object cbMonths: TcxComboBox + Tag = 11588656 + Left = 60 + Top = 3 + Properties.DropDownListStyle = lsFixedList + Properties.OnChange = cbMonthsPropertiesChange + TabOrder = 2 + Width = 90 + end + object cbWeek1: TcxComboBox + Tag = 11589716 + Left = 60 + Top = 32 + Properties.DropDownListStyle = lsFixedList + Properties.OnChange = cbWeek1PropertiesChange + TabOrder = 3 + Width = 65 + end + object rbEvery1: TcxRadioButton + Left = 2 + Top = 6 + Width = 57 + Height = 17 + Caption = 'Every' + Checked = True + TabOrder = 4 + TabStop = True + OnClick = DoChange + end + object rbThe1: TcxRadioButton + Left = 2 + Top = 35 + Width = 49 + Height = 17 + Caption = 'The' + TabOrder = 5 + end + object cbDay1: TcxComboBox + Tag = 11589716 + Left = 130 + Top = 32 + Properties.DropDownListStyle = lsFixedList + Properties.DropDownRows = 10 + Properties.OnChange = cbWeek1PropertiesChange + TabOrder = 6 + Width = 103 + end + end + object pnlMonthly: TcxGroupBox + Left = 94 + Top = 18 + Align = alCustom + PanelStyle.Active = True + PanelStyle.OfficeBackgroundKind = pobkStyleColor + Style.BorderStyle = ebsNone + TabOrder = 1 + Visible = False + Height = 107 + Width = 370 + object lbMonths: TLabel + Left = 174 + Top = 7 + Width = 43 + Height = 13 + Caption = 'month(s)' + end + object lbMonths1: TLabel + Left = 311 + Top = 36 + Width = 43 + Height = 13 + Caption = 'month(s)' + end + object lbOfEvery: TLabel + Left = 92 + Top = 7 + Width = 41 + Height = 13 + Caption = 'of every' + end + object lbOfEvery1: TLabel + Left = 226 + Top = 36 + Width = 41 + Height = 13 + Caption = 'of every' + end + object cbWeek: TcxComboBox + Tag = 11534460 + Left = 53 + Top = 32 + Properties.DropDownListStyle = lsFixedList + Properties.OnChange = SetTheRadioButtonChecked + TabOrder = 0 + Width = 65 + end + object meNumOfDay: TcxMaskEdit + Tag = 11533468 + Left = 53 + Top = 3 + Properties.MaskKind = emkRegExpr + Properties.EditMask = '\d{0,4}' + Properties.MaxLength = 0 + Properties.OnChange = SetDayRadioButtonChecked + TabOrder = 1 + OnExit = ValidateNumber + Width = 32 + end + object meNumMonth: TcxMaskEdit + Tag = 11533468 + Left = 139 + Top = 3 + Properties.MaskKind = emkRegExpr + Properties.EditMask = '\d{0,4}' + Properties.MaxLength = 0 + Properties.OnChange = SetDayRadioButtonChecked + TabOrder = 2 + OnExit = ValidateNumber + Width = 32 + end + object meNumMonth1: TcxMaskEdit + Tag = 11534460 + Left = 273 + Top = 32 + Properties.MaskKind = emkRegExpr + Properties.EditMask = '\d{0,4}' + Properties.MaxLength = 0 + Properties.OnChange = SetTheRadioButtonChecked + TabOrder = 3 + OnExit = ValidateNumber + Width = 32 + end + object rbDay: TcxRadioButton + Left = 2 + Top = 6 + Width = 50 + Height = 17 + Caption = 'Day' + Checked = True + TabOrder = 4 + TabStop = True + OnClick = DoChange + end + object rbThe: TcxRadioButton + Left = 2 + Top = 35 + Width = 49 + Height = 17 + Caption = 'The' + TabOrder = 5 + OnClick = DoChange + end + object cbDay: TcxComboBox + Tag = 11534460 + Left = 121 + Top = 32 + Properties.DropDownListStyle = lsFixedList + Properties.DropDownRows = 10 + Properties.OnChange = SetTheRadioButtonChecked + TabOrder = 6 + Width = 96 + end + end + object pnlWeekly: TcxGroupBox + Left = 94 + Top = 18 + Align = alCustom + PanelStyle.Active = True + PanelStyle.OfficeBackgroundKind = pobkStyleColor + Style.BorderStyle = ebsNone + TabOrder = 2 + Visible = False + Height = 107 + Width = 370 + object lbRecurEvery: TLabel + Left = 4 + Top = 7 + Width = 59 + Height = 13 + Caption = 'Recur every' + FocusControl = meNumOfWeek + end + object lbWeeksOn: TLabel + Left = 117 + Top = 7 + Width = 57 + Height = 13 + Caption = 'week(s) on:' + end + object cbDayOfWeek4: TcxCheckBox + Tag = 4 + Left = 268 + Top = 38 + Caption = 'Wednesday' + Properties.OnChange = DoChange + TabOrder = 0 + Width = 90 + end + object meNumOfWeek: TcxMaskEdit + Left = 74 + Top = 3 + Properties.MaskKind = emkRegExpr + Properties.EditMask = '\d{0,4}' + Properties.MaxLength = 0 + Properties.OnChange = DoChange + TabOrder = 1 + OnExit = ValidateNumber + Width = 32 + end + object cbDayOfWeek2: TcxCheckBox + Tag = 2 + Left = 90 + Top = 38 + Caption = 'Monday' + Properties.OnChange = DoChange + TabOrder = 2 + Width = 90 + end + object cbDayOfWeek3: TcxCheckBox + Tag = 3 + Left = 179 + Top = 38 + Caption = 'Tuesday' + Properties.OnChange = DoChange + TabOrder = 3 + Width = 90 + end + object cbDayOfWeek5: TcxCheckBox + Tag = 5 + Left = 1 + Top = 62 + Caption = 'Thursday' + Properties.OnChange = DoChange + TabOrder = 4 + Width = 90 + end + object cbDayOfWeek6: TcxCheckBox + Tag = 6 + Left = 90 + Top = 62 + Caption = 'Friday' + Properties.OnChange = DoChange + TabOrder = 5 + Width = 90 + end + object cbDayOfWeek7: TcxCheckBox + Tag = 7 + Left = 179 + Top = 62 + Caption = 'Saturday' + Properties.OnChange = DoChange + TabOrder = 6 + Width = 90 + end + object cbDayOfWeek1: TcxCheckBox + Tag = 1 + Left = 1 + Top = 38 + Caption = 'Sunday' + Properties.OnChange = DoChange + TabOrder = 7 + Width = 90 + end + end + object pnlDaily: TcxGroupBox + Left = 94 + Top = 18 + Align = alCustom + PanelStyle.Active = True + PanelStyle.OfficeBackgroundKind = pobkStyleColor + Style.BorderStyle = ebsNone + TabOrder = 3 + Visible = False + Height = 107 + Width = 370 + object lbDay: TLabel + Left = 115 + Top = 7 + Width = 18 + Height = 13 + Caption = 'day' + end + object rbEvery: TcxRadioButton + Left = 2 + Top = 6 + Width = 66 + Height = 17 + Caption = 'Every' + Checked = True + TabOrder = 0 + TabStop = True + OnClick = DoChange + end + object meDay: TcxMaskEdit + Left = 74 + Top = 3 + Properties.MaskKind = emkRegExpr + Properties.EditMask = '\d{0,4}' + Properties.MaxLength = 0 + Properties.OnChange = meDayPropertiesChange + TabOrder = 1 + OnExit = ValidateNumber + Width = 32 + end + object rbEveryWeekday: TcxRadioButton + Left = 2 + Top = 35 + Width = 113 + Height = 17 + Caption = 'Every weekday' + TabOrder = 2 + OnClick = rbEveryWeekdayClick + end + end + object pnlPeriodicity: TcxGroupBox + Left = 2 + Top = 18 + PanelStyle.Active = True + PanelStyle.OfficeBackgroundKind = pobkStyleColor + Style.BorderStyle = ebsNone + TabOrder = 4 + Height = 107 + Width = 93 + object Bevel1: TBevel + Left = 90 + Top = 8 + Width = 3 + Height = 93 + Shape = bsLeftLine + end + object rbYearly: TcxRadioButton + Tag = 3 + Left = 8 + Top = 80 + Width = 80 + Height = 17 + Caption = 'Yearly' + TabOrder = 0 + OnClick = SelectPeriodicityClick + end + object rbWeekly: TcxRadioButton + Tag = 1 + Left = 8 + Top = 32 + Width = 80 + Height = 17 + Caption = 'Weekly' + TabOrder = 1 + OnClick = SelectPeriodicityClick + end + object rbMonthly: TcxRadioButton + Tag = 2 + Left = 8 + Top = 56 + Width = 80 + Height = 17 + Caption = 'Monthly' + TabOrder = 2 + OnClick = SelectPeriodicityClick + end + object rbDaily: TcxRadioButton + Left = 8 + Top = 8 + Width = 80 + Height = 17 + Caption = 'Daily' + Checked = True + TabOrder = 3 + TabStop = True + OnClick = SelectPeriodicityClick + end + end + end + object gbRange: TcxGroupBox + Left = 8 + Top = 191 + Caption = 'Range of recurrence' + TabOrder = 5 + Height = 97 + Width = 466 + object lbStart1: TLabel + Left = 16 + Top = 28 + Width = 28 + Height = 13 + Caption = 'Start:' + FocusControl = deStart + Transparent = True + end + object lbOccurrences: TLabel + Left = 332 + Top = 44 + Width = 58 + Height = 13 + Caption = 'occurrences' + Transparent = True + end + object deStart: TcxDateEdit + Left = 56 + Top = 24 + Properties.DateButtons = [btnToday] + Properties.InputKind = ikStandard + Properties.OnChange = DoChange + Properties.OnEditValueChanged = deStartPropertiesEditValueChanged + TabOrder = 0 + Width = 135 + end + object rbNoEndDate: TcxRadioButton + Left = 216 + Top = 16 + Width = 113 + Height = 17 + Caption = 'No end date' + Checked = True + TabOrder = 1 + TabStop = True + OnClick = rbNoEndDateClick + Transparent = True + end + object rbEndAfter: TcxRadioButton + Left = 216 + Top = 43 + Width = 73 + Height = 17 + Caption = 'End after:' + TabOrder = 2 + OnClick = DoChange + Transparent = True + end + object rbEndBy: TcxRadioButton + Left = 216 + Top = 70 + Width = 73 + Height = 17 + Caption = 'End by:' + TabOrder = 3 + OnClick = DoChange + Transparent = True + end + object deEndBy: TcxDateEdit + Tag = 11453468 + Left = 292 + Top = 66 + Properties.DateButtons = [btnToday] + Properties.InputKind = ikStandard + Properties.OnChange = deEndByPropertiesChange + Properties.OnEditValueChanged = deEndByPropertiesEditValueChanged + TabOrder = 5 + Width = 135 + end + object meEndAfter: TcxMaskEdit + Tag = 11452416 + Left = 292 + Top = 39 + Properties.MaskKind = emkRegExpr + Properties.EditMask = '\d{0,4}' + Properties.MaxLength = 0 + Properties.OnChange = meEndAfterPropertiesChange + Properties.OnEditValueChanged = meEndAfterPropertiesEditValueChanged + TabOrder = 4 + OnExit = meEndAfterExit + Width = 32 + end + end +end diff --git a/official/x.35/Lib/D11/cxSchedulerRecurrenceSelectionDialog.dcu b/official/x.35/Lib/D11/cxSchedulerRecurrenceSelectionDialog.dcu new file mode 100644 index 00000000..5d1c2e87 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerRecurrenceSelectionDialog.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerRecurrenceSelectionDialog.dfm b/official/x.35/Lib/D11/cxSchedulerRecurrenceSelectionDialog.dfm new file mode 100644 index 00000000..eca276b6 --- /dev/null +++ b/official/x.35/Lib/D11/cxSchedulerRecurrenceSelectionDialog.dfm @@ -0,0 +1,87 @@ +object fmRecurrenceSelectionForm: TfmRecurrenceSelectionForm + Left = 217 + Top = 476 + BorderStyle = bsDialog + Caption = 'fmRecurrenceSelectionForm' + ClientHeight = 143 + ClientWidth = 261 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poMainFormCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object lbMessage: TLabel + Left = 67 + Top = 8 + Width = 186 + Height = 44 + AutoSize = False + Caption = 'lbMessage' + Transparent = True + WordWrap = True + end + object Image: TImage + Left = 8 + Top = 4 + Width = 49 + Height = 49 + Center = True + end + object pnlControls: TPanel + Left = 0 + Top = 59 + Width = 261 + Height = 84 + Align = alBottom + BevelOuter = bvNone + FullRepaint = False + ParentColor = True + TabOrder = 0 + object btnCancel: TcxButton + Left = 136 + Top = 53 + Width = 90 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 0 + end + object rbSeries: TcxRadioButton + Left = 56 + Top = 25 + Width = 193 + Height = 17 + Caption = 'rbSeries' + TabOrder = 1 + Transparent = True + end + object rbOccurrence: TcxRadioButton + Left = 56 + Top = 2 + Width = 201 + Height = 17 + Caption = 'rbOccurrence' + Checked = True + TabOrder = 2 + TabStop = True + Transparent = True + end + object btnOk: TcxButton + Left = 36 + Top = 53 + Width = 90 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 3 + end + end +end diff --git a/official/x.35/Lib/D11/cxSchedulerReg.dcr b/official/x.35/Lib/D11/cxSchedulerReg.dcr new file mode 100644 index 00000000..6660ae58 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerReg.dcr differ diff --git a/official/x.35/Lib/D11/cxSchedulerReg.dcu b/official/x.35/Lib/D11/cxSchedulerReg.dcu new file mode 100644 index 00000000..7af7c169 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerReg.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerReminderWindow.dcu b/official/x.35/Lib/D11/cxSchedulerReminderWindow.dcu new file mode 100644 index 00000000..946626d6 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerReminderWindow.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerReminderWindow.dfm b/official/x.35/Lib/D11/cxSchedulerReminderWindow.dfm new file mode 100644 index 00000000..bfbed77c --- /dev/null +++ b/official/x.35/Lib/D11/cxSchedulerReminderWindow.dfm @@ -0,0 +1,129 @@ +object cxSchedulerReminderForm: TcxSchedulerReminderForm + Left = 288 + Top = 89 + ActiveControl = lvItems + AutoScroll = False + BorderIcons = [biSystemMenu, biMinimize] + BorderStyle = bsSingle + ClientHeight = 294 + ClientWidth = 456 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + KeyPreview = True + OldCreateOrder = False + OnKeyDown = FormKeyDown + PixelsPerInch = 96 + TextHeight = 13 + object pbImage: TPaintBox + Left = 10 + Top = 10 + Width = 16 + Height = 16 + Visible = False + OnPaint = DrawIcon + end + object lbEventCaption: TLabel + Left = 32 + Top = 10 + Width = 409 + Height = 15 + Anchors = [akLeft, akTop, akRight] + AutoSize = False + end + object lbEventStartTime: TLabel + Left = 32 + Top = 32 + Width = 3 + Height = 13 + end + object lvItems: TcxListView + Left = 9 + Top = 76 + Width = 437 + Height = 129 + Anchors = [akLeft, akTop, akRight] + ColumnClick = False + Columns = < + item + Width = 290 + end + item + Width = 120 + end> + HideSelection = False + MultiSelect = True + ReadOnly = True + RowSelect = True + Style.HotTrack = False + TabOrder = 0 + ViewStyle = vsReport + OnDblClick = lvItemsDblClick + OnKeyDown = lvItemsKeyDown + OnSelectItem = lvItemsSelectItem + end + object btnDismissAll: TcxButton + Left = 9 + Top = 212 + Width = 90 + Height = 23 + Caption = 'Dismiss &All' + Enabled = False + TabOrder = 1 + OnClick = ButtonClick + end + object btnOpenItem: TcxButton + Tag = 1 + Left = 256 + Top = 212 + Width = 90 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Open Item' + Enabled = False + TabOrder = 2 + OnClick = ButtonClick + end + object btnDismiss: TcxButton + Tag = 2 + Left = 355 + Top = 212 + Width = 90 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Dismiss' + Enabled = False + TabOrder = 3 + OnClick = ButtonClick + end + object cbSnoozeTime: TcxComboBox + Left = 9 + Top = 263 + Anchors = [akLeft, akTop, akRight] + Enabled = False + Properties.DropDownListStyle = lsFixedList + TabOrder = 4 + Width = 338 + end + object btnSnooze: TcxButton + Tag = 3 + Left = 355 + Top = 262 + Width = 90 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Snooze' + Default = True + Enabled = False + TabOrder = 5 + OnClick = ButtonClick + end + object tmUpdate: TTimer + Enabled = False + Interval = 30000 + OnTimer = tmUpdateTimer + end +end diff --git a/official/x.35/Lib/D11/cxSchedulerResourcesLayoutEditor.dcu b/official/x.35/Lib/D11/cxSchedulerResourcesLayoutEditor.dcu new file mode 100644 index 00000000..a629c4f7 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerResourcesLayoutEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerResourcesLayoutEditor.dfm b/official/x.35/Lib/D11/cxSchedulerResourcesLayoutEditor.dfm new file mode 100644 index 00000000..dd44f00f --- /dev/null +++ b/official/x.35/Lib/D11/cxSchedulerResourcesLayoutEditor.dfm @@ -0,0 +1,90 @@ +object fmResourcesLayoutEditor: TfmResourcesLayoutEditor + Left = 249 + Top = 230 + ActiveControl = clbResources + AutoScroll = False + BorderIcons = [biSystemMenu] + Caption = 'Resource editor' + ClientHeight = 227 + ClientWidth = 301 + Color = clBtnFace + Constraints.MinHeight = 160 + Constraints.MinWidth = 220 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object btnClose: TcxButton + Left = 210 + Top = 196 + Width = 85 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Close' + ModalResult = 2 + TabOrder = 0 + end + object btnUp: TcxButton + Left = 210 + Top = 8 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Up' + TabOrder = 1 + OnClick = BtnClick + end + object btnDown: TcxButton + Tag = 1 + Left = 210 + Top = 40 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Down' + TabOrder = 2 + OnClick = BtnClick + end + object clbResources: TcxCheckListBox + Left = 8 + Top = 8 + Width = 195 + Height = 212 + Anchors = [akLeft, akTop, akRight, akBottom] + EditValueFormat = cvfIndices + Items = <> + TabOrder = 5 + OnClick = clbResourcesClick + OnDragOver = clbResourcesDragOver + OnEditValueChanged = clbResourcesEditValueChanged + OnKeyDown = clbResourcesKeyDown + OnMouseDown = clbResourcesMouseDown + end + object btnSelectAll: TcxButton + Tag = 2 + Left = 210 + Top = 72 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Select all' + TabOrder = 3 + OnClick = BtnClick + end + object btnSelectNone: TcxButton + Tag = 3 + Left = 210 + Top = 104 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Select none' + TabOrder = 4 + OnClick = BtnClick + end +end diff --git a/official/x.35/Lib/D11/cxSchedulerStorage.dcu b/official/x.35/Lib/D11/cxSchedulerStorage.dcu new file mode 100644 index 00000000..b6df1967 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerStorage.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerStrs.dcu b/official/x.35/Lib/D11/cxSchedulerStrs.dcu new file mode 100644 index 00000000..9356955b Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerStrs.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerTaskDependencyEditor.dcu b/official/x.35/Lib/D11/cxSchedulerTaskDependencyEditor.dcu new file mode 100644 index 00000000..7da5d2ee Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerTaskDependencyEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerTaskDependencyEditor.dfm b/official/x.35/Lib/D11/cxSchedulerTaskDependencyEditor.dfm new file mode 100644 index 00000000..eb50f282 --- /dev/null +++ b/official/x.35/Lib/D11/cxSchedulerTaskDependencyEditor.dfm @@ -0,0 +1,118 @@ +object fmSchedulerTaskDependencyEditor: TfmSchedulerTaskDependencyEditor + Left = 494 + Top = 254 + AutoScroll = False + BorderIcons = [biSystemMenu] + Caption = 'fmSchedulerTaskDependencyEditor' + ClientHeight = 120 + ClientWidth = 292 + Color = clBtnFace + Constraints.MinHeight = 154 + Constraints.MinWidth = 300 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poOwnerFormCenter + OnKeyDown = FormKeyDown + PixelsPerInch = 96 + TextHeight = 13 + object cxGroupBox1: TcxGroupBox + Left = 0 + Top = 0 + Align = alClient + PanelStyle.Active = True + Style.BorderStyle = ebsNone + TabOrder = 0 + Height = 120 + Width = 292 + object lbTo: TcxLabel + Left = 8 + Top = 35 + Caption = 'lbTo' + Transparent = True + end + object lbType: TcxLabel + Left = 8 + Top = 60 + Caption = 'lbType' + FocusControl = cbTypeRelation + Transparent = True + end + object lbToName: TcxLabel + Left = 70 + Top = 35 + AutoSize = False + Caption = 'lbToName' + Properties.ShowAccelChar = False + Style.TransparentBorder = False + Transparent = True + Height = 17 + Width = 214 + end + object lbFromName: TcxLabel + Left = 70 + Top = 8 + AutoSize = False + Caption = 'lbFromName' + Properties.ShowAccelChar = False + Style.TransparentBorder = False + Transparent = True + Height = 17 + Width = 214 + end + object cbTypeRelation: TcxComboBox + Left = 70 + Top = 60 + Anchors = [akLeft, akTop, akRight] + Properties.DropDownListStyle = lsFixedList + Properties.OnChange = cbTypeRelationPropertiesChange + TabOrder = 3 + OnKeyDown = FormKeyDown + Width = 214 + end + object btnOk: TcxButton + Left = 106 + Top = 89 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'btnOk' + Default = True + ModalResult = 1 + TabOrder = 4 + OnKeyDown = FormKeyDown + end + object btnDelete: TcxButton + Left = 13 + Top = 89 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'btnDelete' + ModalResult = 1 + TabOrder = 5 + OnClick = btnDeleteClick + OnKeyDown = FormKeyDown + end + object btnCancel: TcxButton + Left = 199 + Top = 89 + Width = 85 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'btnCancel' + ModalResult = 2 + TabOrder = 6 + OnKeyDown = FormKeyDown + end + object lbFrom: TcxLabel + Left = 8 + Top = 8 + Caption = 'lbFrom' + Transparent = True + end + end +end diff --git a/official/x.35/Lib/D11/cxSchedulerTimeGridView.dcu b/official/x.35/Lib/D11/cxSchedulerTimeGridView.dcu new file mode 100644 index 00000000..3da18e31 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerTimeGridView.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerUtils.dcu b/official/x.35/Lib/D11/cxSchedulerUtils.dcu new file mode 100644 index 00000000..1c5c3231 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerUtils.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerWeekView.dcu b/official/x.35/Lib/D11/cxSchedulerWeekView.dcu new file mode 100644 index 00000000..b5610772 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerWeekView.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulerYearView.dcu b/official/x.35/Lib/D11/cxSchedulerYearView.dcu new file mode 100644 index 00000000..82670d93 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulerYearView.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulercxGridConnection.dcu b/official/x.35/Lib/D11/cxSchedulercxGridConnection.dcu new file mode 100644 index 00000000..a03136a6 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulercxGridConnection.dcu differ diff --git a/official/x.35/Lib/D11/cxSchedulercxGridConnectionReg.dcu b/official/x.35/Lib/D11/cxSchedulercxGridConnectionReg.dcu new file mode 100644 index 00000000..05552ab3 Binary files /dev/null and b/official/x.35/Lib/D11/cxSchedulercxGridConnectionReg.dcu differ diff --git a/official/x.35/Lib/D11/cxScrollBar.dcu b/official/x.35/Lib/D11/cxScrollBar.dcu new file mode 100644 index 00000000..b93b43f5 Binary files /dev/null and b/official/x.35/Lib/D11/cxScrollBar.dcu differ diff --git a/official/x.35/Lib/D11/cxScrollCursors.res b/official/x.35/Lib/D11/cxScrollCursors.res new file mode 100644 index 00000000..400d2d4f Binary files /dev/null and b/official/x.35/Lib/D11/cxScrollCursors.res differ diff --git a/official/x.35/Lib/D11/cxSelectEditRepositoryItem.dcu b/official/x.35/Lib/D11/cxSelectEditRepositoryItem.dcu new file mode 100644 index 00000000..17c2b366 Binary files /dev/null and b/official/x.35/Lib/D11/cxSelectEditRepositoryItem.dcu differ diff --git a/official/x.35/Lib/D11/cxSelectEditRepositoryItem.dfm b/official/x.35/Lib/D11/cxSelectEditRepositoryItem.dfm new file mode 100644 index 00000000..3c39a141 --- /dev/null +++ b/official/x.35/Lib/D11/cxSelectEditRepositoryItem.dfm @@ -0,0 +1,75 @@ +object cxSelectRepositoryItem: TcxSelectRepositoryItem + Left = 403 + Top = 209 + BorderStyle = bsDialog + Caption = 'Select EditRepositoryItem' + ClientHeight = 392 + ClientWidth = 346 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 10 + Top = 320 + Width = 56 + Height = 13 + Caption = 'Description:' + end + object lbItems: TListBox + Left = 8 + Top = 8 + Width = 233 + Height = 305 + ItemHeight = 13 + Sorted = True + TabOrder = 0 + OnClick = lbItemsClick + OnMouseDown = lbItemsMouseDown + end + object Panel1: TPanel + Left = 8 + Top = 335 + Width = 329 + Height = 49 + BevelInner = bvLowered + Color = clInfoBk + TabOrder = 3 + object lbHint: TLabel + Left = 4 + Top = 4 + Width = 321 + Height = 41 + AutoSize = False + Caption = 'LongHint' + WordWrap = True + end + end + object btOk: TButton + Left = 256 + Top = 8 + Width = 75 + Height = 25 + Caption = '&Ok' + Default = True + Enabled = False + ModalResult = 1 + TabOrder = 1 + end + object btCancel: TButton + Left = 256 + Top = 40 + Width = 75 + Height = 25 + Cancel = True + Caption = '&Cancel' + ModalResult = 2 + TabOrder = 2 + end +end diff --git a/official/x.35/Lib/D11/cxShellBrowser.dcu b/official/x.35/Lib/D11/cxShellBrowser.dcu new file mode 100644 index 00000000..fab3420b Binary files /dev/null and b/official/x.35/Lib/D11/cxShellBrowser.dcu differ diff --git a/official/x.35/Lib/D11/cxShellBrowser.dfm b/official/x.35/Lib/D11/cxShellBrowser.dfm new file mode 100644 index 00000000..0cfc1e06 --- /dev/null +++ b/official/x.35/Lib/D11/cxShellBrowser.dfm @@ -0,0 +1,74 @@ +object cxShellBrowserDlg: TcxShellBrowserDlg + Left = 455 + Top = 160 + ActiveControl = cxStv + AutoScroll = False + BorderIcons = [biSystemMenu] + Caption = 'Browse for Folder' + ClientHeight = 358 + ClientWidth = 308 + Color = clBtnFace + Constraints.MinHeight = 300 + Constraints.MinWidth = 250 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + OnCreate = FormCreate + OnPaint = FormPaint + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object lblFolder: TcxLabel + Left = 12 + Top = 8 + Caption = 'Current Folder' + Transparent = True + end + object cxStv: TcxShellTreeView + Left = 12 + Top = 56 + Width = 284 + Height = 261 + Anchors = [akLeft, akTop, akRight, akBottom] + HideSelection = False + Indent = 19 + Options.ShowNonFolders = False + RightClickSelect = True + TabOrder = 0 + OnChange = cxStvChange + end + object cxTeFolder: TcxTextEdit + Left = 12 + Top = 24 + Anchors = [akLeft, akTop, akRight, akBottom] + Properties.ReadOnly = True + Style.Color = clWindow + TabOrder = 1 + Width = 284 + end + object cxButton1: TcxButton + Left = 139 + Top = 323 + Width = 75 + Height = 25 + Anchors = [akRight, akBottom] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 2 + end + object cxButton2: TcxButton + Left = 219 + Top = 323 + Width = 75 + Height = 25 + Anchors = [akRight, akBottom] + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 3 + end +end diff --git a/official/x.35/Lib/D11/cxShellBrowserDialog.dcu b/official/x.35/Lib/D11/cxShellBrowserDialog.dcu new file mode 100644 index 00000000..efc3eb4b Binary files /dev/null and b/official/x.35/Lib/D11/cxShellBrowserDialog.dcu differ diff --git a/official/x.35/Lib/D11/cxShellComboBox.dcu b/official/x.35/Lib/D11/cxShellComboBox.dcu new file mode 100644 index 00000000..43dc5963 Binary files /dev/null and b/official/x.35/Lib/D11/cxShellComboBox.dcu differ diff --git a/official/x.35/Lib/D11/cxShellCommon.dcu b/official/x.35/Lib/D11/cxShellCommon.dcu new file mode 100644 index 00000000..79afc7a2 Binary files /dev/null and b/official/x.35/Lib/D11/cxShellCommon.dcu differ diff --git a/official/x.35/Lib/D11/cxShellControls.dcu b/official/x.35/Lib/D11/cxShellControls.dcu new file mode 100644 index 00000000..a7b8470c Binary files /dev/null and b/official/x.35/Lib/D11/cxShellControls.dcu differ diff --git a/official/x.35/Lib/D11/cxShellDlgs.dcu b/official/x.35/Lib/D11/cxShellDlgs.dcu new file mode 100644 index 00000000..e3cb57da Binary files /dev/null and b/official/x.35/Lib/D11/cxShellDlgs.dcu differ diff --git a/official/x.35/Lib/D11/cxShellEditRepositoryItems.dcu b/official/x.35/Lib/D11/cxShellEditRepositoryItems.dcu new file mode 100644 index 00000000..a8b93cd6 Binary files /dev/null and b/official/x.35/Lib/D11/cxShellEditRepositoryItems.dcu differ diff --git a/official/x.35/Lib/D11/cxShellEditorsReg.dcu b/official/x.35/Lib/D11/cxShellEditorsReg.dcu new file mode 100644 index 00000000..7be8fb4b Binary files /dev/null and b/official/x.35/Lib/D11/cxShellEditorsReg.dcu differ diff --git a/official/x.35/Lib/D11/cxShellListView.dcu b/official/x.35/Lib/D11/cxShellListView.dcu new file mode 100644 index 00000000..7c3e93e0 Binary files /dev/null and b/official/x.35/Lib/D11/cxShellListView.dcu differ diff --git a/official/x.35/Lib/D11/cxShellTreeView.dcu b/official/x.35/Lib/D11/cxShellTreeView.dcu new file mode 100644 index 00000000..3e0bae14 Binary files /dev/null and b/official/x.35/Lib/D11/cxShellTreeView.dcu differ diff --git a/official/x.35/Lib/D11/cxSpinButton.dcu b/official/x.35/Lib/D11/cxSpinButton.dcu new file mode 100644 index 00000000..ed51f2db Binary files /dev/null and b/official/x.35/Lib/D11/cxSpinButton.dcu differ diff --git a/official/x.35/Lib/D11/cxSpinEdit.dcu b/official/x.35/Lib/D11/cxSpinEdit.dcu new file mode 100644 index 00000000..f30189a3 Binary files /dev/null and b/official/x.35/Lib/D11/cxSpinEdit.dcu differ diff --git a/official/x.35/Lib/D11/cxSplitter.dcu b/official/x.35/Lib/D11/cxSplitter.dcu new file mode 100644 index 00000000..ea99def5 Binary files /dev/null and b/official/x.35/Lib/D11/cxSplitter.dcu differ diff --git a/official/x.35/Lib/D11/cxSplitterEditor.dcu b/official/x.35/Lib/D11/cxSplitterEditor.dcu new file mode 100644 index 00000000..aa1c7fa9 Binary files /dev/null and b/official/x.35/Lib/D11/cxSplitterEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxSplitterEditor.dfm b/official/x.35/Lib/D11/cxSplitterEditor.dfm new file mode 100644 index 00000000..5cd18424 --- /dev/null +++ b/official/x.35/Lib/D11/cxSplitterEditor.dfm @@ -0,0 +1,259 @@ +object cxSplitEditor: TcxSplitEditor + Left = 224 + Top = 210 + ActiveControl = cxCbAhd + BorderStyle = bsDialog + ClientHeight = 383 + ClientWidth = 466 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object cxGroupBox1: TcxGroupBox + Left = 8 + Top = 200 + Width = 449 + Height = 145 + Caption = ' Preview ' + TabOrder = 0 + object Panel1: TPanel + Left = 8 + Top = 16 + Width = 426 + Height = 121 + BevelOuter = bvNone + TabOrder = 0 + object cxListBox1: TcxListBox + Left = 0 + Top = 0 + Width = 145 + Height = 121 + TabStop = False + Align = alLeft + ItemHeight = 13 + TabOrder = 0 + end + object cxSplit: TcxSplitter + Left = 145 + Top = 0 + Width = 8 + Height = 121 + AutoPosition = False + AutoSnap = True + Control = cxListBox1 + end + object cxListBox2: TcxListBox + Left = 153 + Top = 0 + Width = 273 + Height = 121 + TabStop = False + Align = alClient + ItemHeight = 13 + TabOrder = 2 + end + end + end + object cxGroupBox2: TcxGroupBox + Left = 8 + Top = 8 + Width = 153 + Height = 189 + Caption = ' Operation ' + TabOrder = 1 + object Label1: TLabel + Left = 27 + Top = 119 + Width = 40 + Height = 13 + Caption = 'Min Size' + end + object Label2: TLabel + Left = 28 + Top = 61 + Width = 88 + Height = 13 + Caption = 'Position after open' + end + object cxCbAhd: TcxCheckBox + Left = 8 + Top = 16 + Width = 121 + Height = 21 + Caption = 'Allow HotZone Drag' + TabOrder = 0 + OnClick = cxCbAhdClick + end + object cxCbAp: TcxCheckBox + Left = 8 + Top = 40 + Width = 105 + Height = 21 + Caption = 'Auto Position' + TabOrder = 1 + OnClick = cxCbApClick + end + object cxCbSnap: TcxCheckBox + Left = 8 + Top = 99 + Width = 105 + Height = 21 + Caption = 'Auto Snap' + TabOrder = 3 + OnClick = cxCbSnapClick + end + object cxCbRu: TcxCheckBox + Left = 8 + Top = 161 + Width = 105 + Height = 21 + Caption = 'Resize Update' + TabOrder = 5 + OnClick = cxCbRuClick + end + object cxSeMs: TcxSpinEdit + Left = 27 + Top = 133 + Width = 89 + Height = 21 + Properties.MaxValue = 145.000000000000000000 + Properties.SpinButtons.ShowFastButtons = True + Properties.OnChange = cxSeMsPropertiesChange + TabOrder = 4 + Value = 30 + end + object cxSePao: TcxSpinEdit + Left = 28 + Top = 75 + Width = 89 + Height = 21 + Properties.MaxValue = 200.000000000000000000 + Properties.MinValue = 1.000000000000000000 + Properties.SpinButtons.ShowFastButtons = True + Properties.OnChange = cxSePaoPropertiesChange + TabOrder = 2 + Value = 200 + end + end + object cxGroupBox3: TcxGroupBox + Left = 168 + Top = 8 + Width = 289 + Height = 189 + Caption = ' Hot Zone ' + TabOrder = 2 + object Label3: TLabel + Left = 9 + Top = 120 + Width = 73 + Height = 13 + Caption = 'HotZone Width' + end + object cxRbHzNone: TcxRadioButton + Left = 9 + Top = 40 + Width = 113 + Height = 17 + Caption = 'None' + Checked = True + TabOrder = 1 + TabStop = True + OnClick = cxRbHzNoneClick + end + object cxRbHzMp8: TcxRadioButton + Left = 9 + Top = 65 + Width = 96 + Height = 17 + Hint = 'MediaPlayer8' + Caption = 'Media Player 8' + TabOrder = 2 + OnClick = cxRbHzMp8Click + end + object cxRbHzMp9: TcxRadioButton + Left = 106 + Top = 65 + Width = 113 + Height = 17 + Hint = 'MediaPlayer9' + Caption = 'Media Player 9' + TabOrder = 3 + OnClick = cxRbHzMp8Click + end + object cxRbHzSimple: TcxRadioButton + Left = 106 + Top = 90 + Width = 113 + Height = 17 + Hint = 'Simple' + Caption = 'Simple' + TabOrder = 4 + OnClick = cxRbHzMp8Click + end + object cxRbHzXp: TcxRadioButton + Left = 9 + Top = 90 + Width = 96 + Height = 17 + Hint = 'XPTaskBar' + Caption = 'XP Task Bar' + TabOrder = 5 + OnClick = cxRbHzMp8Click + end + object cxCbHzVisible: TcxCheckBox + Left = 9 + Top = 16 + Width = 121 + Height = 21 + Caption = 'Visible' + Enabled = False + Properties.OnChange = cxCbHzVisiblePropertiesChange + TabOrder = 0 + end + object cxTbHzWidth: TcxTrackBar + Left = 8 + Top = 136 + Width = 273 + Height = 49 + Position = 10 + Properties.Frequency = 5 + Properties.Min = 10 + Properties.Max = 100 + Properties.SelectionStart = 30 + Properties.SelectionEnd = 60 + Properties.SelectionColor = clGreen + Properties.OnChange = cxTbHzWidthPropertiesChange + TabOrder = 6 + end + end + object cxBtnOK: TcxButton + Left = 304 + Top = 352 + Width = 75 + Height = 25 + Caption = 'OK' + ModalResult = 1 + TabOrder = 3 + end + object cxBtnCancel: TcxButton + Left = 384 + Top = 352 + Width = 75 + Height = 25 + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 4 + end + object cxLookAndFeelController1: TcxLookAndFeelController + Kind = lfFlat + NativeStyle = True + Left = 200 + Top = 344 + end +end diff --git a/official/x.35/Lib/D11/cxStandardMask.dcu b/official/x.35/Lib/D11/cxStandardMask.dcu new file mode 100644 index 00000000..87489514 Binary files /dev/null and b/official/x.35/Lib/D11/cxStandardMask.dcu differ diff --git a/official/x.35/Lib/D11/cxStorage.dcu b/official/x.35/Lib/D11/cxStorage.dcu new file mode 100644 index 00000000..d0c42d48 Binary files /dev/null and b/official/x.35/Lib/D11/cxStorage.dcu differ diff --git a/official/x.35/Lib/D11/cxStyleRepositoryEditor.dcu b/official/x.35/Lib/D11/cxStyleRepositoryEditor.dcu new file mode 100644 index 00000000..a1768d32 Binary files /dev/null and b/official/x.35/Lib/D11/cxStyleRepositoryEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxStyleRepositoryEditor.dfm b/official/x.35/Lib/D11/cxStyleRepositoryEditor.dfm new file mode 100644 index 00000000..febda142 --- /dev/null +++ b/official/x.35/Lib/D11/cxStyleRepositoryEditor.dfm @@ -0,0 +1,232 @@ +inherited cxStyleRepositoryEditor: TcxStyleRepositoryEditor + Left = 333 + Top = 185 + Width = 317 + Height = 412 + Caption = 'StyleRepository editor' + Constraints.MinHeight = 350 + Constraints.MinWidth = 300 + Position = poDefaultPosOnly + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 0 + Top = 0 + Width = 309 + Height = 378 + ActivePage = tsStyles + Align = alClient + TabOrder = 0 + object tsStyles: TTabSheet + Caption = 'Styles' + object lbStyles: TListBox + Left = 0 + Top = 0 + Width = 210 + Height = 350 + Align = alClient + ItemHeight = 13 + MultiSelect = True + PopupMenu = pmStyles + TabOrder = 0 + OnClick = lbStylesClick + end + object pnlStyles: TPanel + Left = 210 + Top = 0 + Width = 91 + Height = 350 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object btStyleAdd: TButton + Left = 9 + Top = 8 + Width = 75 + Height = 25 + Caption = '&Add' + TabOrder = 0 + OnClick = btStyleAddClick + end + object btStyleDelete: TButton + Left = 9 + Top = 40 + Width = 75 + Height = 25 + Caption = '&Delete' + TabOrder = 1 + OnClick = btStyleDeleteClick + end + object btClose: TButton + Left = 9 + Top = 316 + Width = 75 + Height = 26 + Anchors = [akLeft, akBottom] + Caption = '&Close' + TabOrder = 2 + OnClick = btCloseClick + end + end + end + object tsStyleSheets: TTabSheet + Caption = 'Style Sheets' + ImageIndex = 1 + object lbStyleSheets: TListBox + Left = 0 + Top = 0 + Width = 201 + Height = 350 + Align = alClient + ItemHeight = 13 + MultiSelect = True + PopupMenu = pmStyleSheets + TabOrder = 0 + OnClick = lbStyleSheetsClick + end + object pnlStyleSheets: TPanel + Left = 201 + Top = 0 + Width = 100 + Height = 350 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object btStyleSheetAdd: TButton + Left = 9 + Top = 8 + Width = 85 + Height = 25 + Caption = '&Add...' + TabOrder = 0 + OnClick = btStyleSheetAddClick + end + object btStyleSheetDelete: TButton + Left = 9 + Top = 38 + Width = 85 + Height = 25 + Caption = '&Delete' + TabOrder = 1 + OnClick = btStyleSheetDeleteClick + end + object Button3: TButton + Left = 9 + Top = 316 + Width = 85 + Height = 26 + Anchors = [akLeft, akBottom] + Caption = '&Close' + TabOrder = 2 + OnClick = btCloseClick + end + object btnStyleSheetEdit: TButton + Left = 9 + Top = 68 + Width = 85 + Height = 25 + Caption = '&Edit...' + TabOrder = 3 + OnClick = btnStyleSheetEditClick + end + object btnStyleSheetsSave: TButton + Left = 9 + Top = 104 + Width = 85 + Height = 25 + Caption = '&Save to ini...' + TabOrder = 4 + OnClick = btnStyleSheetsSaveClick + end + object btnStyleSheetsLoad: TButton + Left = 9 + Top = 133 + Width = 85 + Height = 25 + Caption = '&Load from ini...' + TabOrder = 5 + OnClick = btnStyleSheetsLoadClick + end + object btnStyleSheetsPredefine: TButton + Left = 9 + Top = 163 + Width = 85 + Height = 25 + Caption = '&Predefined...' + TabOrder = 6 + OnClick = btnStyleSheetsPredefineClick + end + end + end + end + object pmStyles: TPopupMenu + Left = 40 + Top = 88 + object miStyleAdd: TMenuItem + Caption = 'Add' + ShortCut = 45 + OnClick = btStyleAddClick + end + object miStyleDelete: TMenuItem + Caption = 'Delete' + Enabled = False + ShortCut = 46 + OnClick = btStyleDeleteClick + end + object N1: TMenuItem + Caption = '-' + end + object miStyleSelectAll: TMenuItem + Caption = 'Select all' + Enabled = False + ShortCut = 16449 + OnClick = miStyleSelectAllClick + end + end + object pmStyleSheets: TPopupMenu + Left = 72 + Top = 168 + object miStyleSheetAdd: TMenuItem + Caption = 'Add...' + ShortCut = 45 + OnClick = btStyleSheetAddClick + end + object miStyleSheetDelete: TMenuItem + Caption = 'Delete' + Enabled = False + ShortCut = 46 + OnClick = btStyleSheetDeleteClick + end + object imStyleSheetEdit: TMenuItem + Caption = 'Edit...' + OnClick = btnStyleSheetEditClick + end + object MenuItem3: TMenuItem + Caption = '-' + end + object miStyleSheetSelectAll: TMenuItem + Caption = 'Select all' + Enabled = False + ShortCut = 16449 + OnClick = miStyleSheetSelectAllClick + end + end + object pmAddStyleSheet: TPopupMenu + Left = 128 + Top = 48 + end + object SaveDialog: TSaveDialog + DefaultExt = 'ini' + FileName = 'cxstyles.ini' + Filter = 'Ini files|*.ini' + Left = 160 + Top = 120 + end + object OpenDialog: TOpenDialog + DefaultExt = 'ini' + FileName = 'cxstyles.ini' + Filter = 'Ini files|*.ini' + Left = 160 + Top = 176 + end +end diff --git a/official/x.35/Lib/D11/cxStyleSheetEditor.dcu b/official/x.35/Lib/D11/cxStyleSheetEditor.dcu new file mode 100644 index 00000000..58f6e0ba Binary files /dev/null and b/official/x.35/Lib/D11/cxStyleSheetEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxStyleSheetEditor.dfm b/official/x.35/Lib/D11/cxStyleSheetEditor.dfm new file mode 100644 index 00000000..1f5674cf --- /dev/null +++ b/official/x.35/Lib/D11/cxStyleSheetEditor.dfm @@ -0,0 +1,223 @@ +object frmcxStyleSheetEditor: TfrmcxStyleSheetEditor + Left = 377 + Top = 147 + AutoScroll = False + BorderIcons = [biSystemMenu] + Caption = 'StyleSheet Editor' + ClientHeight = 338 + ClientWidth = 319 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -10 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object pnlBottom: TPanel + Left = 0 + Top = 303 + Width = 319 + Height = 35 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + object Bevel: TBevel + Left = 0 + Top = 0 + Width = 319 + Height = 2 + Align = alTop + end + object pnlButtons: TPanel + Left = 150 + Top = 2 + Width = 169 + Height = 33 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btnOK: TButton + Left = 7 + Top = 4 + Width = 75 + Height = 25 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object bntCancel: TButton + Left = 88 + Top = 4 + Width = 75 + Height = 25 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + end + end + object pnlClient: TPanel + Left = 0 + Top = 0 + Width = 319 + Height = 303 + Align = alClient + BevelOuter = bvNone + BorderWidth = 4 + TabOrder = 1 + object pnlStyles: TPanel + Left = 4 + Top = 4 + Width = 163 + Height = 295 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object pnlStylesCaption: TPanel + Left = 0 + Top = 0 + Width = 163 + Height = 21 + Align = alTop + Alignment = taLeftJustify + BevelOuter = bvNone + Caption = 'Styles' + TabOrder = 0 + end + object pnlStylesClient: TPanel + Left = 0 + Top = 21 + Width = 163 + Height = 274 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + object lbStyles: TListBox + Left = 0 + Top = 0 + Width = 163 + Height = 186 + Style = lbOwnerDrawVariable + Align = alClient + ItemHeight = 16 + MultiSelect = True + TabOrder = 0 + OnClick = lbStylesClick + OnDrawItem = lbStylesDrawItem + OnMeasureItem = lbStylesMeasureItem + end + object pnlStylesButtons: TPanel + Left = 0 + Top = 186 + Width = 163 + Height = 88 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object cbColor: TCheckBox + Left = 35 + Top = 33 + Width = 119 + Height = 25 + Caption = '&Color' + TabOrder = 0 + OnClick = cbClick + end + object btnBitmap: TButton + Left = 2 + Top = 4 + Width = 25 + Height = 25 + Caption = '...' + TabOrder = 1 + OnClick = btnBitmapClick + end + object btnColor1: TButton + Left = 2 + Top = 33 + Width = 25 + Height = 25 + Caption = '...' + TabOrder = 2 + OnClick = btnColor1Click + end + object btnFont1: TButton + Left = 2 + Top = 62 + Width = 25 + Height = 25 + Caption = '...' + TabOrder = 3 + OnClick = btnFont1Click + end + object cbFont: TCheckBox + Left = 35 + Top = 62 + Width = 119 + Height = 25 + Caption = '&Font' + TabOrder = 4 + OnClick = cbClick + end + object cbBitmap: TCheckBox + Left = 35 + Top = 4 + Width = 117 + Height = 25 + Caption = '&Bitmap' + TabOrder = 5 + OnClick = cbClick + end + end + end + end + object pnlPreview: TPanel + Left = 171 + Top = 4 + Width = 144 + Height = 295 + Align = alRight + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + TabOrder = 1 + object pnlPreviewCaption: TPanel + Left = 0 + Top = 0 + Width = 144 + Height = 21 + Align = alTop + Alignment = taLeftJustify + BevelOuter = bvNone + Caption = 'Preview' + TabOrder = 0 + end + object pnlPreviewClient: TPanel + Left = 0 + Top = 21 + Width = 144 + Height = 274 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + end + end + end + object FontDialog: TFontDialog + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Left = 76 + Top = 28 + end + object ColorDialog: TColorDialog + Left = 44 + Top = 28 + end +end diff --git a/official/x.35/Lib/D11/cxStyleSheetsLoad.dcu b/official/x.35/Lib/D11/cxStyleSheetsLoad.dcu new file mode 100644 index 00000000..0413dfc0 Binary files /dev/null and b/official/x.35/Lib/D11/cxStyleSheetsLoad.dcu differ diff --git a/official/x.35/Lib/D11/cxStyleSheetsLoad.dfm b/official/x.35/Lib/D11/cxStyleSheetsLoad.dfm new file mode 100644 index 00000000..ca5b3676 --- /dev/null +++ b/official/x.35/Lib/D11/cxStyleSheetsLoad.dfm @@ -0,0 +1,172 @@ +object frmcxStyleSheetsLoad: TfrmcxStyleSheetsLoad + Left = 303 + Top = 129 + AutoScroll = False + BorderIcons = [biSystemMenu] + Caption = 'Predefined StyleSheets' + ClientHeight = 329 + ClientWidth = 659 + Color = clBtnFace + Constraints.MinHeight = 296 + Constraints.MinWidth = 315 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -10 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object pnlBottom: TPanel + Left = 0 + Top = 294 + Width = 659 + Height = 35 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + object Bevel: TBevel + Left = 0 + Top = 0 + Width = 659 + Height = 2 + Align = alTop + end + object btnLoad: TButton + Left = 497 + Top = 8 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Caption = 'Load' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object btnClose: TButton + Left = 580 + Top = 8 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Close' + ModalResult = 2 + TabOrder = 1 + end + end + object pnlClient: TPanel + Left = 0 + Top = 0 + Width = 659 + Height = 294 + Align = alClient + BevelOuter = bvNone + BorderWidth = 5 + TabOrder = 1 + object pnlStyles: TPanel + Left = 5 + Top = 5 + Width = 297 + Height = 284 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object pnlStyleSheetClasses: TPanel + Left = 0 + Top = 0 + Width = 297 + Height = 25 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object lbStyleSheetClass: TLabel + Left = 3 + Top = 1 + Width = 94 + Height = 18 + AutoSize = False + Caption = 'Style Sheet Class:' + Layout = tlCenter + end + object cbStyleSheetClasses: TComboBox + Left = 96 + Top = 0 + Width = 201 + Height = 21 + Style = csDropDownList + Anchors = [akTop, akRight] + DropDownCount = 10 + ItemHeight = 13 + TabOrder = 0 + end + end + object lbStyleSheets: TListBox + Left = 0 + Top = 25 + Width = 297 + Height = 259 + Align = alClient + ItemHeight = 13 + MultiSelect = True + TabOrder = 1 + end + end + object pnlPreview: TPanel + Left = 302 + Top = 5 + Width = 352 + Height = 284 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 5 + Height = 284 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + end + object Panel1: TPanel + Left = 5 + Top = 0 + Width = 347 + Height = 284 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + object Panel3: TPanel + Left = 0 + Top = 0 + Width = 347 + Height = 25 + Align = alTop + Alignment = taLeftJustify + BevelOuter = bvNone + TabOrder = 0 + object lbPreview: TLabel + Left = 0 + Top = 0 + Width = 61 + Height = 21 + AutoSize = False + Caption = 'Preview' + Layout = tlCenter + end + end + object pnlPreviewClient: TPanel + Left = 0 + Top = 25 + Width = 347 + Height = 259 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + end + end + end + end +end diff --git a/official/x.35/Lib/D11/cxStyles.dcu b/official/x.35/Lib/D11/cxStyles.dcu new file mode 100644 index 00000000..8e6e4f22 Binary files /dev/null and b/official/x.35/Lib/D11/cxStyles.dcu differ diff --git a/official/x.35/Lib/D11/cxTL.dcu b/official/x.35/Lib/D11/cxTL.dcu new file mode 100644 index 00000000..98700825 Binary files /dev/null and b/official/x.35/Lib/D11/cxTL.dcu differ diff --git a/official/x.35/Lib/D11/cxTL.res b/official/x.35/Lib/D11/cxTL.res new file mode 100644 index 00000000..071c538b Binary files /dev/null and b/official/x.35/Lib/D11/cxTL.res differ diff --git a/official/x.35/Lib/D11/cxTLConverter.dcu b/official/x.35/Lib/D11/cxTLConverter.dcu new file mode 100644 index 00000000..5602303c Binary files /dev/null and b/official/x.35/Lib/D11/cxTLConverter.dcu differ diff --git a/official/x.35/Lib/D11/cxTLData.dcu b/official/x.35/Lib/D11/cxTLData.dcu new file mode 100644 index 00000000..3cb4aa95 Binary files /dev/null and b/official/x.35/Lib/D11/cxTLData.dcu differ diff --git a/official/x.35/Lib/D11/cxTLDsgnEdtrs.dcu b/official/x.35/Lib/D11/cxTLDsgnEdtrs.dcu new file mode 100644 index 00000000..98ac4a12 Binary files /dev/null and b/official/x.35/Lib/D11/cxTLDsgnEdtrs.dcu differ diff --git a/official/x.35/Lib/D11/cxTLDsgnEdtrs.dfm b/official/x.35/Lib/D11/cxTLDsgnEdtrs.dfm new file mode 100644 index 00000000..0d2fac56 --- /dev/null +++ b/official/x.35/Lib/D11/cxTLDsgnEdtrs.dfm @@ -0,0 +1,307 @@ +object cxTreeListBandColumnDesigner: TcxTreeListBandColumnDesigner + Left = 480 + Top = 171 + Width = 386 + Height = 317 + HorzScrollBar.Range = 5 + VertScrollBar.Range = 42 + AutoScroll = False + BorderIcons = [biSystemMenu] + Caption = 'TreeListDesigner' + Color = clBtnFace + Constraints.MinHeight = 281 + Constraints.MinWidth = 361 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 0 + Height = 283 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + end + object PageControl: TPageControl + Left = 0 + Top = 0 + Width = 378 + Height = 283 + ActivePage = tsColumns + Align = alClient + TabOrder = 1 + OnChange = PageControlChange + object tsBands: TTabSheet + Caption = ' Bands ' + object Panel12: TPanel + Left = 257 + Top = 0 + Width = 113 + Height = 246 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btnBAdd: TcxButton + Left = 5 + Top = 8 + Width = 105 + Height = 22 + Caption = '&Add' + TabOrder = 0 + OnClick = BandTabButtonsClick + end + object btnBDel: TcxButton + Tag = 1 + Left = 5 + Top = 40 + Width = 105 + Height = 22 + Caption = '&Delete' + TabOrder = 1 + OnClick = BandTabButtonsClick + end + object btnBMoveU: TcxButton + Tag = 2 + Left = 5 + Top = 72 + Width = 105 + Height = 22 + Caption = 'Move &Up ' + TabOrder = 2 + OnClick = BandTabButtonsClick + end + object btnBMoveD: TcxButton + Tag = 3 + Left = 5 + Top = 104 + Width = 105 + Height = 22 + Caption = 'Move Dow&n' + TabOrder = 3 + OnClick = BandTabButtonsClick + end + object btnBResD: TcxButton + Tag = 4 + Left = 5 + Top = 136 + Width = 105 + Height = 22 + Caption = 'Rest&ore Defaults' + TabOrder = 4 + OnClick = BandTabButtonsClick + end + object btnBResW: TcxButton + Tag = 5 + Left = 5 + Top = 168 + Width = 105 + Height = 22 + Caption = 'Restore &Widths' + TabOrder = 5 + OnClick = BandTabButtonsClick + end + end + object lbxBands: TListBox + Left = 0 + Top = 0 + Width = 257 + Height = 246 + Align = alClient + DragMode = dmAutomatic + ItemHeight = 16 + MultiSelect = True + PopupMenu = pmBands + TabOrder = 1 + OnClick = BandsListClick + OnKeyDown = lbxKeyDown + end + end + object tsColumns: TTabSheet + Caption = ' Columns ' + object pnButtons: TPanel + Left = 257 + Top = 0 + Width = 113 + Height = 255 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btnCAdd: TcxButton + Left = 5 + Top = 8 + Width = 105 + Height = 22 + Caption = '&Add' + TabOrder = 0 + OnClick = ColumnsEventHandle + end + object btnCDel: TcxButton + Tag = 1 + Left = 5 + Top = 40 + Width = 105 + Height = 22 + Caption = '&Delete' + TabOrder = 1 + OnClick = ColumnsEventHandle + end + object btnCMoveU: TcxButton + Tag = 2 + Left = 5 + Top = 72 + Width = 105 + Height = 22 + Caption = 'Move &Up ' + TabOrder = 2 + OnClick = ColumnsEventHandle + end + object btnCMoveD: TcxButton + Tag = 3 + Left = 5 + Top = 104 + Width = 105 + Height = 22 + Caption = 'Move Dow&n' + TabOrder = 3 + OnClick = ColumnsEventHandle + end + object btnCResD: TcxButton + Tag = 4 + Left = 5 + Top = 136 + Width = 105 + Height = 22 + Caption = 'Rest&ore Defaults' + TabOrder = 4 + OnClick = ColumnsEventHandle + end + object btnCResW: TcxButton + Tag = 5 + Left = 5 + Top = 168 + Width = 105 + Height = 22 + Caption = 'Restore &Widths' + TabOrder = 5 + OnClick = ColumnsEventHandle + end + object btnCreateAllFields: TcxButton + Tag = 6 + Left = 5 + Top = 200 + Width = 105 + Height = 22 + Caption = 'Create all &fields' + TabOrder = 6 + OnClick = ColumnsEventHandle + end + end + object lbxColumns: TListBox + Left = 0 + Top = 0 + Width = 257 + Height = 255 + Align = alClient + DragMode = dmAutomatic + ItemHeight = 13 + MultiSelect = True + PopupMenu = pmColumns + TabOrder = 1 + OnClick = ColumnsListClick + OnKeyDown = lbxKeyDown + end + end + end + object pmColumns: TPopupMenu + Left = 228 + Top = 6 + object mnuCAdd: TMenuItem + Caption = '&Add...' + ShortCut = 45 + OnClick = ColumnsEventHandle + end + object mnuCDel: TMenuItem + Tag = 1 + Caption = '&Delete' + ShortCut = 46 + OnClick = ColumnsEventHandle + end + object mnuCMoveU: TMenuItem + Tag = 2 + Caption = 'Move &Up' + OnClick = ColumnsEventHandle + end + object mnuCMoveD: TMenuItem + Tag = 3 + Caption = 'Move Dow&n' + OnClick = ColumnsEventHandle + end + object mnuCResD: TMenuItem + Tag = 4 + Caption = 'Rest&ore Defaults' + OnClick = ColumnsEventHandle + end + object mnuCResW: TMenuItem + Tag = 5 + Caption = 'Restore &Widths' + OnClick = ColumnsEventHandle + end + object mnuCreateAllFields: TMenuItem + Tag = 6 + Caption = 'Create all fields' + OnClick = ColumnsEventHandle + end + object mnuCSelectAll: TMenuItem + Tag = 8 + Caption = 'Select All' + ShortCut = 16449 + OnClick = ColumnsEventHandle + end + end + object pmBands: TPopupMenu + Left = 194 + Top = 6 + object mnuBAdd: TMenuItem + Caption = '&Add' + ShortCut = 45 + OnClick = BandTabButtonsClick + end + object mnuBDel: TMenuItem + Tag = 1 + Caption = '&Delete' + ShortCut = 46 + OnClick = BandTabButtonsClick + end + object mnuBMoveU: TMenuItem + Tag = 2 + Caption = 'Move &Up' + OnClick = BandTabButtonsClick + end + object mnuBMoveD: TMenuItem + Tag = 3 + Caption = 'Move Dow&n' + OnClick = BandTabButtonsClick + end + object mnuBResD: TMenuItem + Tag = 4 + Caption = 'Rest&ore Defaults' + OnClick = BandTabButtonsClick + end + object mnuBResW: TMenuItem + Caption = 'Restore &Width' + end + object mnuBSelectAll: TMenuItem + Tag = 8 + Caption = 'Select All' + ShortCut = 16449 + OnClick = BandTabButtonsClick + end + end +end diff --git a/official/x.35/Lib/D11/cxTLIntf.dcu b/official/x.35/Lib/D11/cxTLIntf.dcu new file mode 100644 index 00000000..85aaac9d Binary files /dev/null and b/official/x.35/Lib/D11/cxTLIntf.dcu differ diff --git a/official/x.35/Lib/D11/cxTLItemsEdtr.dcu b/official/x.35/Lib/D11/cxTLItemsEdtr.dcu new file mode 100644 index 00000000..58a78661 Binary files /dev/null and b/official/x.35/Lib/D11/cxTLItemsEdtr.dcu differ diff --git a/official/x.35/Lib/D11/cxTLItemsEdtr.dfm b/official/x.35/Lib/D11/cxTLItemsEdtr.dfm new file mode 100644 index 00000000..6a21ae0e --- /dev/null +++ b/official/x.35/Lib/D11/cxTLItemsEdtr.dfm @@ -0,0 +1,346 @@ +object frmItemsEditor: TfrmItemsEditor + Left = 243 + Top = 174 + Width = 485 + Height = 374 + Anchors = [akLeft, akTop, akBottom] + BorderIcons = [biSystemMenu] + Caption = 'Items Editor' + Color = clBtnFace + Constraints.MinHeight = 374 + Constraints.MinWidth = 476 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Scaled = False + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 477 + Height = 304 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Panel3: TPanel + Left = 368 + Top = 0 + Width = 109 + Height = 304 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btnNewItem: TcxButton + Tag = 4 + Left = 10 + Top = 8 + Width = 90 + Height = 22 + Anchors = [akTop, akRight] + Caption = '&New Item' + TabOrder = 0 + OnClick = cxButtonPress + end + object btnNewSubItem: TcxButton + Tag = 5 + Left = 10 + Top = 40 + Width = 90 + Height = 22 + Anchors = [akTop, akRight] + Caption = 'New &SubItem' + TabOrder = 1 + OnClick = cxButtonPress + end + object btnDelete: TcxButton + Tag = 6 + Left = 10 + Top = 72 + Width = 90 + Height = 22 + Anchors = [akTop, akRight] + Caption = '&Delete' + TabOrder = 2 + OnClick = cxButtonPress + end + object Panel5: TPanel + Left = 0 + Top = 100 + Width = 109 + Height = 204 + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + TabOrder = 3 + object gbIndexes: TGroupBox + Left = 10 + Top = 7 + Width = 91 + Height = 94 + Anchors = [akTop, akRight] + Caption = 'Image Indexes' + TabOrder = 0 + object Label1: TLabel + Left = 8 + Top = 24 + Width = 29 + Height = 13 + Caption = 'Image' + end + object Label2: TLabel + Left = 8 + Top = 48 + Width = 42 + Height = 13 + Caption = 'Selected' + end + object Label3: TLabel + Left = 8 + Top = 72 + Width = 25 + Height = 13 + Caption = 'State' + end + object edtImage: TcxTextEdit + Left = 59 + Top = 19 + Width = 24 + Height = 21 + TabOrder = 0 + Text = '0' + OnExit = edtImageExit + OnKeyDown = edtImageKeyDown + end + object edtSelected: TcxTextEdit + Tag = 1 + Left = 59 + Top = 43 + Width = 24 + Height = 21 + TabOrder = 1 + Text = '0' + OnExit = edtImageExit + OnKeyDown = edtImageKeyDown + end + object edtState: TcxTextEdit + Tag = 2 + Left = 59 + Top = 67 + Width = 24 + Height = 21 + TabOrder = 2 + Text = '-1' + OnExit = edtImageExit + OnKeyDown = edtImageKeyDown + end + end + object gbDefaultIndexes: TGroupBox + Left = 10 + Top = 108 + Width = 92 + Height = 94 + Anchors = [akTop, akRight] + Caption = 'Default Indexes' + TabOrder = 1 + object Label4: TLabel + Left = 8 + Top = 24 + Width = 29 + Height = 13 + Caption = 'Image' + end + object Label5: TLabel + Left = 8 + Top = 48 + Width = 42 + Height = 13 + Caption = 'Selected' + end + object Label6: TLabel + Left = 8 + Top = 72 + Width = 25 + Height = 13 + Caption = 'State' + end + object edtDefImage: TcxTextEdit + Left = 59 + Top = 19 + Width = 24 + Height = 21 + TabOrder = 0 + Text = '0' + end + object edtDefSelected: TcxTextEdit + Tag = 1 + Left = 59 + Top = 43 + Width = 24 + Height = 21 + TabOrder = 1 + Text = '0' + end + object edtDefState: TcxTextEdit + Tag = 2 + Left = 59 + Top = 67 + Width = 24 + Height = 21 + TabOrder = 2 + Text = '-1' + end + end + end + end + object Panel6: TPanel + Left = 0 + Top = 0 + Width = 368 + Height = 304 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + object Panel7: TPanel + Left = 0 + Top = 0 + Width = 368 + Height = 8 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + end + object Panel10: TPanel + Left = 0 + Top = 8 + Width = 8 + Height = 294 + Align = alLeft + BevelOuter = bvNone + TabOrder = 1 + end + object cxTreeList1: TcxTreeList + Left = 8 + Top = 8 + Width = 360 + Height = 294 + Align = alClient + Bands = < + item + Caption.Text = 'Band + 1' + end> + BufferedPaint = False + DragMode = dmAutomatic + OptionsBehavior.AutomateLeftMostIndent = False + OptionsSelection.HideFocusRect = False + OptionsSelection.InvertSelect = False + OptionsSelection.MultiSelect = True + OptionsView.GridLines = tlglBoth + OptionsView.PaintStyle = tlpsCategorized + PopupMenu = mnuEditItems + Preview.Visible = True + TabOrder = 2 + OnDragOver = cxTreeList1DragOver + object cxTreeList1cxTreeListColumn1: TcxTreeListColumn + DataBinding.ValueType = 'String' + Position.ColIndex = 0 + Position.RowIndex = 0 + Position.BandIndex = 0 + end + end + object Panel8: TPanel + Left = 0 + Top = 302 + Width = 368 + Height = 2 + Align = alBottom + BevelOuter = bvNone + TabOrder = 3 + end + end + end + object Panel2: TPanel + Left = 0 + Top = 304 + Width = 477 + Height = 36 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object btnCustomize: TcxButton + Left = 8 + Top = 6 + Width = 90 + Height = 22 + Anchors = [akLeft, akBottom] + Caption = 'C&ustomize' + TabOrder = 0 + OnClick = cxButtonPress + end + object Panel4: TPanel + Left = 250 + Top = 0 + Width = 227 + Height = 36 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object btnOk: TcxButton + Tag = 1 + Left = 28 + Top = 6 + Width = 90 + Height = 22 + Anchors = [akRight, akBottom] + Caption = '&Ok' + ModalResult = 1 + TabOrder = 0 + end + object btnCancel: TcxButton + Tag = 2 + Left = 128 + Top = 6 + Width = 90 + Height = 22 + Anchors = [akRight, akBottom] + Caption = '&Cancel' + ModalResult = 2 + TabOrder = 1 + end + end + end + object mnuEditItems: TPopupMenu + Left = 296 + Top = 8 + object NewItem1: TMenuItem + Tag = 4 + Caption = '&New Item' + OnClick = cxButtonPress + end + object NewSubItem1: TMenuItem + Tag = 5 + Caption = 'New &SubItem' + OnClick = cxButtonPress + end + object Delete1: TMenuItem + Tag = 6 + Caption = '&Delete' + OnClick = cxButtonPress + end + object N1: TMenuItem + Caption = '-' + OnClick = cxButtonPress + end + object Customize1: TMenuItem + Caption = 'C&ustomize' + OnClick = cxButtonPress + end + end + object cxLookAndFeelController1: TcxLookAndFeelController + Left = 328 + Top = 8 + end +end diff --git a/official/x.35/Lib/D11/cxTLPredefinedStyles.dcu b/official/x.35/Lib/D11/cxTLPredefinedStyles.dcu new file mode 100644 index 00000000..c7fa9e88 Binary files /dev/null and b/official/x.35/Lib/D11/cxTLPredefinedStyles.dcu differ diff --git a/official/x.35/Lib/D11/cxTLPredefinedStyles.dfm b/official/x.35/Lib/D11/cxTLPredefinedStyles.dfm new file mode 100644 index 00000000..6e706267 --- /dev/null +++ b/official/x.35/Lib/D11/cxTLPredefinedStyles.dfm @@ -0,0 +1,4001 @@ +object cxdmTreeListPredefinedStyles: TcxdmTreeListPredefinedStyles + OldCreateOrder = False + Left = 311 + Top = 194 + Height = 259 + Width = 315 + object StyleRepository: TcxStyleRepository + Left = 216 + Top = 48 + object cxStyle1: TcxStyle + AssignedValues = [svColor] + Color = 15451300 + end + object cxStyle2: TcxStyle + AssignedValues = [svColor] + Color = 15451300 + end + object cxStyle3: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12937777 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle4: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12937777 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle5: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16247513 + TextColor = clBlack + end + object cxStyle6: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16445924 + TextColor = clBlack + end + object cxStyle7: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 15850688 + TextColor = clBlack + end + object cxStyle8: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12937777 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle9: TcxStyle + AssignedValues = [svColor] + Color = 15451300 + end + object cxStyle10: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBlack + end + object cxStyle11: TcxStyle + AssignedValues = [svColor] + Color = 15451300 + end + object cxStyle12: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 16711164 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -9 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = clSilver + end + object cxStyle13: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 12937777 + TextColor = clWhite + end + object cxStyle14: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8894686 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle15: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8894686 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle16: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15136253 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [] + TextColor = 7346457 + end + object cxStyle17: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9818092 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [] + TextColor = clBlack + end + object cxStyle18: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8036607 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [] + TextColor = clBlack + end + object cxStyle19: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8894686 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle20: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4159924 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle21: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8894686 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial Narrow' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle22: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clOlive + end + object cxStyle23: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 2179167 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial Narrow' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle24: TcxStyle + AssignedValues = [svColor] + Color = 14149876 + end + object cxStyle25: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9157775 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle26: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9157775 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle27: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle28: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9234160 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle29: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11788021 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle30: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9157775 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle31: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6989624 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle32: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9157775 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle33: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clSilver + end + object cxStyle34: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4615972 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle35: TcxStyle + AssignedValues = [svColor] + Color = 13164490 + end + object cxStyle36: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13271182 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle37: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13271182 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle38: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle39: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 16775416 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle40: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 16443110 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial' + Font.Style = [] + TextColor = clBlack + end + object cxStyle41: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13271182 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle42: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14252010 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle43: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13271182 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle44: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsItalic] + TextColor = clPurple + end + object cxStyle45: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9509542 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle46: TcxStyle + AssignedValues = [svColor] + Color = 14528184 + end + object cxStyle47: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6908265 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle48: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6908265 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle49: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle50: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle51: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15461355 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle52: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6908265 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle53: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6447714 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle54: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6908265 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle55: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clSilver + end + object cxStyle56: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle57: TcxStyle + AssignedValues = [svColor] + Color = clSilver + end + object cxStyle58: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5337222 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle59: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5337222 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle60: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle61: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10862530 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle62: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13820129 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle63: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5337222 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle64: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7904931 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle65: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10862530 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle66: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15134192 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsItalic] + TextColor = clMaroon + end + object cxStyle67: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6392205 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle68: TcxStyle + AssignedValues = [svColor] + Color = 14674410 + end + object cxStyle69: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle70: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle71: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle72: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12307669 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle73: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14542570 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle74: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle75: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9413547 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle76: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12307669 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle77: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clTeal + end + object cxStyle78: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7572117 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle79: TcxStyle + AssignedValues = [svColor] + Color = 8421440 + end + object cxStyle80: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11055248 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle81: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7897176 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle82: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle83: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 11055248 + TextColor = clBlack + end + object cxStyle84: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14211272 + TextColor = clBlack + end + object cxStyle85: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7897176 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle86: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9345127 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle87: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10397571 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle88: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = 7897176 + end + object cxStyle89: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7897176 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle90: TcxStyle + AssignedValues = [svColor, svFont] + Color = 7897176 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + end + object cxStyle91: TcxStyle + AssignedValues = [svColor, svFont] + Color = 7897176 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + end + object cxStyle92: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13140618 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Garamond' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle93: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13140105 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Garamond' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle94: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Garamond' + Font.Style = [] + TextColor = clBlack + end + object cxStyle95: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14264494 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Garamond' + Font.Style = [fsItalic] + TextColor = clBlack + end + object cxStyle96: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15521240 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Garamond' + Font.Style = [fsItalic] + TextColor = clBlack + end + object cxStyle97: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13339026 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle98: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12876163 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle99: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14264494 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle100: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 11619930 + end + object cxStyle101: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11619930 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle102: TcxStyle + AssignedValues = [svColor] + Color = 15851746 + end + object cxStyle103: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3841470 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle104: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5680843 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle105: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle106: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11458790 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle107: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14150898 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle108: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3443881 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle109: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8044502 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle110: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11458790 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle111: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle112: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4630214 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle113: TcxStyle + AssignedValues = [svColor] + Color = clWhite + end + object cxStyle114: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9016398 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle115: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9016398 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle116: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14213320 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle117: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12107912 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle118: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14213320 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle119: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9016398 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle120: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8488544 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle121: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12107912 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle122: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14213320 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clNavy + end + object cxStyle123: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6053956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle124: TcxStyle + AssignedValues = [svColor] + Color = 14475461 + end + object cxStyle125: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9476264 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle126: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9476264 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle127: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160664 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle128: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10266296 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle129: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14476524 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle130: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9476264 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle131: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6321567 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 13160664 + end + object cxStyle132: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9476264 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle133: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160664 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsItalic] + TextColor = 6307912 + end + object cxStyle134: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4210816 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 13160664 + end + object cxStyle135: TcxStyle + AssignedValues = [svColor] + Color = 9476264 + end + object cxStyle136: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10343916 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle137: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10343916 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle138: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle139: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10343916 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle140: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13626101 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle141: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10343916 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle142: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8825791 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle143: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10343916 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle144: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 3122647 + end + object cxStyle145: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5341849 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle146: TcxStyle + AssignedValues = [svColor] + Color = clWhite + end + object cxStyle147: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9072727 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle148: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10124385 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle149: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle150: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11639171 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle151: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14273729 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle152: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9401434 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle153: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9927006 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle154: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11639171 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle155: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 8217935 + end + object cxStyle156: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8217935 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle157: TcxStyle + AssignedValues = [svColor] + Color = 11639171 + end + object cxStyle158: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12935220 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle159: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12935220 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle160: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clBlack + end + object cxStyle161: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12935220 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clBlack + end + object cxStyle162: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clNavy + end + object cxStyle163: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12935220 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clBlack + end + object cxStyle164: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7895258 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clWhite + end + object cxStyle165: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12935220 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle166: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle167: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 202 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clWhite + end + object cxStyle168: TcxStyle + AssignedValues = [svColor] + Color = clWhite + end + object cxStyle169: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle170: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle171: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15461375 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle172: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15461375 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle173: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15461375 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle174: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle175: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8289995 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle176: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clBlack + end + object cxStyle177: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 7364767 + end + object cxStyle178: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5855675 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle179: TcxStyle + AssignedValues = [svColor] + Color = clWhite + end + object cxStyle180: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clMaroon + end + object cxStyle181: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clMaroon + end + object cxStyle182: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15461375 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [] + TextColor = clBlack + end + object cxStyle183: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15461375 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [] + TextColor = clBlack + end + object cxStyle184: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [] + TextColor = clBlack + end + object cxStyle185: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12103888 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle186: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9211088 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle187: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12103888 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Times New Roman' + Font.Style = [] + TextColor = clBlack + end + object cxStyle188: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 7364768 + end + object cxStyle189: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5855675 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle190: TcxStyle + AssignedValues = [svColor] + Color = clWhite + end + object cxStyle191: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13154717 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle192: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13154717 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle193: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle194: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13154717 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle195: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14933198 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle196: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13154717 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle197: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11441772 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle198: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13154717 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle199: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = 9928789 + end + object cxStyle200: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9928789 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle201: TcxStyle + AssignedValues = [svColor] + Color = 15591908 + end + object cxStyle202: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11126946 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clTeal + end + object cxStyle203: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11126946 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clTeal + end + object cxStyle204: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle205: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11126946 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle206: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13886416 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle207: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11126946 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle208: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8170097 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle209: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11126946 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle210: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsItalic] + TextColor = 6592345 + end + object cxStyle211: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6592345 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle212: TcxStyle + AssignedValues = [svColor] + Color = 15725290 + end + object cxStyle213: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11504771 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle214: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11504771 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle215: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle216: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle217: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle218: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11504771 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle219: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13746093 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle220: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle221: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clGray + end + object cxStyle222: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12625805 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle223: TcxStyle + AssignedValues = [svColor] + Color = 14671839 + end + object cxStyle224: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8421440 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle225: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle226: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle227: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle228: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle229: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8421440 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle230: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10197760 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle231: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle232: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14803425 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsItalic] + TextColor = clTeal + end + object cxStyle233: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle234: TcxStyle + AssignedValues = [svColor] + Color = 8421440 + end + object cxStyle235: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4175028 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle236: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6342856 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle237: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle238: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10542814 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle239: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13692654 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle240: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4175028 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle241: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 43690 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle242: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10542814 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle243: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clOlive + end + object cxStyle244: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clOlive + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle245: TcxStyle + AssignedValues = [svColor] + Color = 13101807 + end + object cxStyle246: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle247: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle248: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle249: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle250: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle251: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle252: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11403264 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle253: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle254: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clNavy + end + object cxStyle255: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle256: TcxStyle + AssignedValues = [svColor] + Color = clSilver + end + object cxStyle257: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle258: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle259: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle260: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14671839 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle261: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle262: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle263: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11730944 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle264: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle265: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clNavy + end + object cxStyle266: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle267: TcxStyle + AssignedValues = [svColor] + Color = clSilver + end + object cxStyle268: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle269: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle270: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle271: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle272: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle273: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle274: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10171663 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle275: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle276: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 6956042 + end + object cxStyle277: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle278: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle279: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle280: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle281: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle282: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle283: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle284: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10434063 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle285: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle286: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 6956042 + end + object cxStyle287: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle288: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle289: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle290: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clYellow + end + object cxStyle291: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle292: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle293: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle294: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4210907 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle295: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle296: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = -1 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle297: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 206 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle298: TcxStyle + AssignedValues = [svColor] + Color = clSilver + end + object cxStyle299: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle300: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle301: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clYellow + end + object cxStyle302: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle303: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle304: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle305: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4671452 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle306: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle307: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle308: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 206 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle309: TcxStyle + AssignedValues = [svColor] + Color = clSilver + end + object cxStyle310: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle311: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clYellow + end + object cxStyle312: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle313: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle314: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle315: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clYellow + end + object cxStyle316: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9109503 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle317: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle318: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clYellow + end + object cxStyle319: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clYellow + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle320: TcxStyle + AssignedValues = [svColor] + Color = clBlack + end + object cxStyle321: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle322: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clYellow + end + object cxStyle323: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle324: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle325: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle326: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clYellow + end + object cxStyle327: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8257535 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle328: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle329: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clYellow + end + object cxStyle330: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clYellow + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle331: TcxStyle + AssignedValues = [svColor] + Color = clWhite + end + object cxStyle332: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle333: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle334: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle335: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle336: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle337: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle338: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11534512 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle339: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle340: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clPurple + end + object cxStyle341: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clPurple + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle342: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle343: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle344: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle345: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle346: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle347: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle348: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11141290 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle349: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle350: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clPurple + end + object cxStyle351: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clPurple + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle352: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle353: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle354: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle355: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle356: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15658734 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle357: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle358: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4802889 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle359: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle360: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle361: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle362: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle363: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle364: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle365: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle366: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15658734 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle367: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle368: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3355443 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle369: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle370: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle371: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object TreeListStyleSheetDevExpress: TcxTreeListStyleSheet + Caption = 'DevExpress' + Styles.Background = cxStyle1 + Styles.Content = cxStyle5 + Styles.Inactive = cxStyle9 + Styles.Selection = cxStyle13 + Styles.BandBackground = cxStyle2 + Styles.BandHeader = cxStyle3 + Styles.ColumnHeader = cxStyle4 + Styles.ContentEven = cxStyle6 + Styles.ContentOdd = cxStyle7 + Styles.Footer = cxStyle8 + Styles.IncSearch = cxStyle10 + Styles.Indicator = cxStyle11 + Styles.Preview = cxStyle12 + BuiltIn = True + end + object TreeListStyleSheetUserFormat1: TcxTreeListStyleSheet + Caption = 'UserFormat1' + Styles.Content = cxStyle16 + Styles.Inactive = cxStyle20 + Styles.Selection = cxStyle23 + Styles.BandBackground = cxStyle24 + Styles.BandHeader = cxStyle14 + Styles.ColumnHeader = cxStyle15 + Styles.ContentEven = cxStyle17 + Styles.ContentOdd = cxStyle18 + Styles.Footer = cxStyle19 + Styles.Indicator = cxStyle21 + Styles.Preview = cxStyle22 + BuiltIn = True + end + object TreeListStyleSheetUserFormat2: TcxTreeListStyleSheet + Caption = 'UserFormat2' + Styles.Content = cxStyle27 + Styles.Inactive = cxStyle31 + Styles.Selection = cxStyle34 + Styles.BandBackground = cxStyle35 + Styles.BandHeader = cxStyle25 + Styles.ColumnHeader = cxStyle26 + Styles.ContentEven = cxStyle28 + Styles.ContentOdd = cxStyle29 + Styles.Footer = cxStyle30 + Styles.Indicator = cxStyle32 + Styles.Preview = cxStyle33 + BuiltIn = True + end + object TreeListStyleSheetUserFormat3: TcxTreeListStyleSheet + Caption = 'UserFormat3' + Styles.Content = cxStyle38 + Styles.Inactive = cxStyle42 + Styles.Selection = cxStyle45 + Styles.BandBackground = cxStyle46 + Styles.BandHeader = cxStyle36 + Styles.ColumnHeader = cxStyle37 + Styles.ContentEven = cxStyle39 + Styles.ContentOdd = cxStyle40 + Styles.Footer = cxStyle41 + Styles.Indicator = cxStyle43 + Styles.Preview = cxStyle44 + BuiltIn = True + end + object TreeListStyleSheetUserFormat4: TcxTreeListStyleSheet + Caption = 'UserFormat4' + Styles.Content = cxStyle49 + Styles.Inactive = cxStyle53 + Styles.Selection = cxStyle56 + Styles.BandBackground = cxStyle57 + Styles.BandHeader = cxStyle47 + Styles.ColumnHeader = cxStyle48 + Styles.ContentEven = cxStyle50 + Styles.ContentOdd = cxStyle51 + Styles.Footer = cxStyle52 + Styles.Indicator = cxStyle54 + Styles.Preview = cxStyle55 + BuiltIn = True + end + object TreeListStyleSheetBrick: TcxTreeListStyleSheet + Caption = 'Brick' + Styles.Content = cxStyle60 + Styles.Inactive = cxStyle64 + Styles.Selection = cxStyle67 + Styles.BandBackground = cxStyle68 + Styles.BandHeader = cxStyle58 + Styles.ColumnHeader = cxStyle59 + Styles.ContentEven = cxStyle61 + Styles.ContentOdd = cxStyle62 + Styles.Footer = cxStyle63 + Styles.Indicator = cxStyle65 + Styles.Preview = cxStyle66 + BuiltIn = True + end + object TreeListStyleSheetDesert: TcxTreeListStyleSheet + Caption = 'Desert' + Styles.Content = cxStyle71 + Styles.Inactive = cxStyle75 + Styles.Selection = cxStyle78 + Styles.BandBackground = cxStyle79 + Styles.BandHeader = cxStyle69 + Styles.ColumnHeader = cxStyle70 + Styles.ContentEven = cxStyle72 + Styles.ContentOdd = cxStyle73 + Styles.Footer = cxStyle74 + Styles.Indicator = cxStyle76 + Styles.Preview = cxStyle77 + BuiltIn = True + end + object TreeListStyleSheetEggplant: TcxTreeListStyleSheet + Caption = 'Eggplant' + Styles.Content = cxStyle82 + Styles.Inactive = cxStyle86 + Styles.Selection = cxStyle89 + Styles.BandBackground = cxStyle80 + Styles.BandHeader = cxStyle91 + Styles.ColumnFooter = cxStyle90 + Styles.ColumnHeader = cxStyle81 + Styles.ContentEven = cxStyle83 + Styles.ContentOdd = cxStyle84 + Styles.Footer = cxStyle85 + Styles.Indicator = cxStyle87 + Styles.Preview = cxStyle88 + BuiltIn = True + end + object TreeListStyleSheetLilac: TcxTreeListStyleSheet + Caption = 'Lilac' + Styles.Content = cxStyle94 + Styles.Inactive = cxStyle98 + Styles.Selection = cxStyle101 + Styles.BandBackground = cxStyle102 + Styles.BandHeader = cxStyle92 + Styles.ColumnHeader = cxStyle93 + Styles.ContentEven = cxStyle95 + Styles.ContentOdd = cxStyle96 + Styles.Footer = cxStyle97 + Styles.Indicator = cxStyle99 + Styles.Preview = cxStyle100 + BuiltIn = True + end + object TreeListStyleSheetMaple: TcxTreeListStyleSheet + Caption = 'Maple' + Styles.Content = cxStyle105 + Styles.Inactive = cxStyle109 + Styles.Selection = cxStyle112 + Styles.BandBackground = cxStyle113 + Styles.BandHeader = cxStyle103 + Styles.ColumnHeader = cxStyle104 + Styles.ContentEven = cxStyle106 + Styles.ContentOdd = cxStyle107 + Styles.Footer = cxStyle108 + Styles.Indicator = cxStyle110 + Styles.Preview = cxStyle111 + BuiltIn = True + end + object TreeListStyleSheetMarineHighColor: TcxTreeListStyleSheet + Caption = 'Marine (high color)' + Styles.Content = cxStyle116 + Styles.Inactive = cxStyle120 + Styles.Selection = cxStyle123 + Styles.BandBackground = cxStyle124 + Styles.BandHeader = cxStyle114 + Styles.ColumnHeader = cxStyle115 + Styles.ContentEven = cxStyle117 + Styles.ContentOdd = cxStyle118 + Styles.Footer = cxStyle119 + Styles.Indicator = cxStyle121 + Styles.Preview = cxStyle122 + BuiltIn = True + end + object TreeListStyleSheetPlumHighColor: TcxTreeListStyleSheet + Caption = 'Plum (high color)' + Styles.Content = cxStyle127 + Styles.Inactive = cxStyle131 + Styles.Selection = cxStyle134 + Styles.BandBackground = cxStyle135 + Styles.BandHeader = cxStyle125 + Styles.ColumnHeader = cxStyle126 + Styles.ContentEven = cxStyle128 + Styles.ContentOdd = cxStyle129 + Styles.Footer = cxStyle130 + Styles.Indicator = cxStyle132 + Styles.Preview = cxStyle133 + BuiltIn = True + end + object TreeListStyleSheetPumpkinLarge: TcxTreeListStyleSheet + Caption = 'Pumpkin (large)' + Styles.Content = cxStyle138 + Styles.Inactive = cxStyle142 + Styles.Selection = cxStyle145 + Styles.BandBackground = cxStyle146 + Styles.BandHeader = cxStyle136 + Styles.ColumnHeader = cxStyle137 + Styles.ContentEven = cxStyle139 + Styles.ContentOdd = cxStyle140 + Styles.Footer = cxStyle141 + Styles.Indicator = cxStyle143 + Styles.Preview = cxStyle144 + BuiltIn = True + end + object TreeListStyleSheetRainyDay: TcxTreeListStyleSheet + Caption = 'Rainy Day' + Styles.Content = cxStyle149 + Styles.Inactive = cxStyle153 + Styles.Selection = cxStyle156 + Styles.BandBackground = cxStyle157 + Styles.BandHeader = cxStyle147 + Styles.ColumnHeader = cxStyle148 + Styles.ContentEven = cxStyle150 + Styles.ContentOdd = cxStyle151 + Styles.Footer = cxStyle152 + Styles.Indicator = cxStyle154 + Styles.Preview = cxStyle155 + BuiltIn = True + end + object TreeListStyleSheetRedWhiteBlueVGA: TcxTreeListStyleSheet + Caption = 'Red, White, and Blue (VGA)' + Styles.Content = cxStyle160 + Styles.Inactive = cxStyle164 + Styles.Selection = cxStyle167 + Styles.BandBackground = cxStyle168 + Styles.BandHeader = cxStyle158 + Styles.ColumnHeader = cxStyle159 + Styles.ContentEven = cxStyle161 + Styles.ContentOdd = cxStyle162 + Styles.Footer = cxStyle163 + Styles.Indicator = cxStyle165 + Styles.Preview = cxStyle166 + BuiltIn = True + end + object TreeListStyleSheetRose: TcxTreeListStyleSheet + Caption = 'Rose' + Styles.Content = cxStyle171 + Styles.Inactive = cxStyle175 + Styles.Selection = cxStyle178 + Styles.BandBackground = cxStyle179 + Styles.BandHeader = cxStyle169 + Styles.ColumnHeader = cxStyle170 + Styles.ContentEven = cxStyle172 + Styles.ContentOdd = cxStyle173 + Styles.Footer = cxStyle174 + Styles.Indicator = cxStyle176 + Styles.Preview = cxStyle177 + BuiltIn = True + end + object TreeListStyleSheetRoseLarge: TcxTreeListStyleSheet + Caption = 'Rose (large)' + Styles.Content = cxStyle182 + Styles.Inactive = cxStyle186 + Styles.Selection = cxStyle189 + Styles.BandBackground = cxStyle190 + Styles.BandHeader = cxStyle180 + Styles.ColumnHeader = cxStyle181 + Styles.ContentEven = cxStyle183 + Styles.ContentOdd = cxStyle184 + Styles.Footer = cxStyle185 + Styles.Indicator = cxStyle187 + Styles.Preview = cxStyle188 + BuiltIn = True + end + object TreeListStyleSheetSlate: TcxTreeListStyleSheet + Caption = 'Slate' + Styles.Content = cxStyle193 + Styles.Inactive = cxStyle197 + Styles.Selection = cxStyle200 + Styles.BandBackground = cxStyle201 + Styles.BandHeader = cxStyle191 + Styles.ColumnHeader = cxStyle192 + Styles.ContentEven = cxStyle194 + Styles.ContentOdd = cxStyle195 + Styles.Footer = cxStyle196 + Styles.Indicator = cxStyle198 + Styles.Preview = cxStyle199 + BuiltIn = True + end + object TreeListStyleSheetSpruce: TcxTreeListStyleSheet + Caption = 'Spruce' + Styles.Content = cxStyle204 + Styles.Inactive = cxStyle208 + Styles.Selection = cxStyle211 + Styles.BandBackground = cxStyle212 + Styles.BandHeader = cxStyle202 + Styles.ColumnHeader = cxStyle203 + Styles.ContentEven = cxStyle205 + Styles.ContentOdd = cxStyle206 + Styles.Footer = cxStyle207 + Styles.Indicator = cxStyle209 + Styles.Preview = cxStyle210 + BuiltIn = True + end + object TreeListStyleSheetStormVGA: TcxTreeListStyleSheet + Caption = 'Storm (VGA)' + Styles.Content = cxStyle215 + Styles.Inactive = cxStyle219 + Styles.Selection = cxStyle222 + Styles.BandBackground = cxStyle223 + Styles.BandHeader = cxStyle213 + Styles.ColumnHeader = cxStyle214 + Styles.ContentEven = cxStyle216 + Styles.ContentOdd = cxStyle217 + Styles.Footer = cxStyle218 + Styles.Indicator = cxStyle220 + Styles.Preview = cxStyle221 + BuiltIn = True + end + object TreeListStyleSheetTealVGA: TcxTreeListStyleSheet + Caption = 'Teal (VGA)' + Styles.Content = cxStyle226 + Styles.Inactive = cxStyle230 + Styles.Selection = cxStyle233 + Styles.BandBackground = cxStyle234 + Styles.BandHeader = cxStyle224 + Styles.ColumnHeader = cxStyle225 + Styles.ContentEven = cxStyle227 + Styles.ContentOdd = cxStyle228 + Styles.Footer = cxStyle229 + Styles.Indicator = cxStyle231 + Styles.Preview = cxStyle232 + BuiltIn = True + end + object TreeListStyleSheetWheat: TcxTreeListStyleSheet + Caption = 'Wheat' + Styles.Content = cxStyle237 + Styles.Inactive = cxStyle241 + Styles.Selection = cxStyle244 + Styles.BandBackground = cxStyle245 + Styles.BandHeader = cxStyle235 + Styles.ColumnHeader = cxStyle236 + Styles.ContentEven = cxStyle238 + Styles.ContentOdd = cxStyle239 + Styles.Footer = cxStyle240 + Styles.Indicator = cxStyle242 + Styles.Preview = cxStyle243 + BuiltIn = True + end + object TreeListStyleSheetWindowsClassic: TcxTreeListStyleSheet + Caption = 'Windows Classic' + Styles.Content = cxStyle248 + Styles.Inactive = cxStyle252 + Styles.Selection = cxStyle255 + Styles.BandBackground = cxStyle256 + Styles.BandHeader = cxStyle246 + Styles.ColumnHeader = cxStyle247 + Styles.ContentEven = cxStyle249 + Styles.ContentOdd = cxStyle250 + Styles.Footer = cxStyle251 + Styles.Indicator = cxStyle253 + Styles.Preview = cxStyle254 + BuiltIn = True + end + object TreeListStyleSheetWindowsClassicLarge: TcxTreeListStyleSheet + Caption = 'Windows Classic (large)' + Styles.Content = cxStyle259 + Styles.Inactive = cxStyle263 + Styles.Selection = cxStyle266 + Styles.BandBackground = cxStyle267 + Styles.BandHeader = cxStyle257 + Styles.ColumnHeader = cxStyle258 + Styles.ContentEven = cxStyle260 + Styles.ContentOdd = cxStyle261 + Styles.Footer = cxStyle262 + Styles.Indicator = cxStyle264 + Styles.Preview = cxStyle265 + BuiltIn = True + end + object TreeListStyleSheetWindowsStandard: TcxTreeListStyleSheet + Caption = 'Windows Standard' + Styles.Content = cxStyle270 + Styles.Inactive = cxStyle274 + Styles.Selection = cxStyle277 + Styles.BandHeader = cxStyle268 + Styles.ColumnHeader = cxStyle269 + Styles.ContentEven = cxStyle271 + Styles.ContentOdd = cxStyle272 + Styles.Footer = cxStyle273 + Styles.Indicator = cxStyle275 + Styles.Preview = cxStyle276 + BuiltIn = True + end + object TreeListStyleSheetWindowsStandardLarge: TcxTreeListStyleSheet + Caption = 'Windows Standard (large)' + Styles.Content = cxStyle280 + Styles.Inactive = cxStyle284 + Styles.Selection = cxStyle287 + Styles.BandHeader = cxStyle278 + Styles.ColumnHeader = cxStyle279 + Styles.ContentEven = cxStyle281 + Styles.ContentOdd = cxStyle282 + Styles.Footer = cxStyle283 + Styles.Indicator = cxStyle285 + Styles.Preview = cxStyle286 + BuiltIn = True + end + object TreeListStyleSheetHighContrast1: TcxTreeListStyleSheet + Caption = 'High Contrast #1' + Styles.Content = cxStyle290 + Styles.Inactive = cxStyle294 + Styles.Selection = cxStyle297 + Styles.BandBackground = cxStyle298 + Styles.BandHeader = cxStyle288 + Styles.ColumnHeader = cxStyle289 + Styles.ContentEven = cxStyle291 + Styles.ContentOdd = cxStyle292 + Styles.Footer = cxStyle293 + Styles.Indicator = cxStyle295 + Styles.Preview = cxStyle296 + BuiltIn = True + end + object TreeListStyleSheetHighContrast1Large: TcxTreeListStyleSheet + Caption = 'High Contrast #1 (large)' + Styles.Content = cxStyle301 + Styles.Inactive = cxStyle305 + Styles.Selection = cxStyle308 + Styles.BandBackground = cxStyle309 + Styles.BandHeader = cxStyle299 + Styles.ColumnHeader = cxStyle300 + Styles.ContentEven = cxStyle302 + Styles.ContentOdd = cxStyle303 + Styles.Footer = cxStyle304 + Styles.Indicator = cxStyle306 + Styles.Preview = cxStyle307 + BuiltIn = True + end + object TreeListStyleSheetHighContrast2: TcxTreeListStyleSheet + Caption = 'High Contrast #2' + Styles.Content = cxStyle312 + Styles.Inactive = cxStyle316 + Styles.Selection = cxStyle319 + Styles.BandBackground = cxStyle320 + Styles.BandHeader = cxStyle310 + Styles.ColumnHeader = cxStyle311 + Styles.ContentEven = cxStyle313 + Styles.ContentOdd = cxStyle314 + Styles.Footer = cxStyle315 + Styles.Indicator = cxStyle317 + Styles.Preview = cxStyle318 + BuiltIn = True + end + object TreeListStyleSheetHighContrast2Large: TcxTreeListStyleSheet + Caption = 'High Contrast #2 (large)' + Styles.Content = cxStyle323 + Styles.Inactive = cxStyle327 + Styles.Selection = cxStyle330 + Styles.BandBackground = cxStyle331 + Styles.BandHeader = cxStyle321 + Styles.ColumnHeader = cxStyle322 + Styles.ContentEven = cxStyle324 + Styles.ContentOdd = cxStyle325 + Styles.Footer = cxStyle326 + Styles.Indicator = cxStyle328 + Styles.Preview = cxStyle329 + BuiltIn = True + end + object TreeListStyleSheetHighContrastBlack: TcxTreeListStyleSheet + Caption = 'High Contrast Black' + Styles.Content = cxStyle334 + Styles.Inactive = cxStyle338 + Styles.Selection = cxStyle341 + Styles.BandHeader = cxStyle332 + Styles.ColumnHeader = cxStyle333 + Styles.ContentEven = cxStyle335 + Styles.ContentOdd = cxStyle336 + Styles.Footer = cxStyle337 + Styles.Indicator = cxStyle339 + Styles.Preview = cxStyle340 + BuiltIn = True + end + object TreeListStyleSheetHighContrastBlackLarge: TcxTreeListStyleSheet + Caption = 'High Contrast Black (large)' + Styles.Content = cxStyle344 + Styles.Inactive = cxStyle348 + Styles.Selection = cxStyle351 + Styles.BandHeader = cxStyle342 + Styles.ColumnHeader = cxStyle343 + Styles.ContentEven = cxStyle345 + Styles.ContentOdd = cxStyle346 + Styles.Footer = cxStyle347 + Styles.Indicator = cxStyle349 + Styles.Preview = cxStyle350 + BuiltIn = True + end + object TreeListStyleSheetHighContrastWhite: TcxTreeListStyleSheet + Caption = 'High Contrast White' + Styles.Content = cxStyle354 + Styles.Inactive = cxStyle358 + Styles.Selection = cxStyle361 + Styles.BandHeader = cxStyle352 + Styles.ColumnHeader = cxStyle353 + Styles.ContentEven = cxStyle355 + Styles.ContentOdd = cxStyle356 + Styles.Footer = cxStyle357 + Styles.Indicator = cxStyle359 + Styles.Preview = cxStyle360 + BuiltIn = True + end + object TreeListStyleSheetHighContrastWhiteLarge: TcxTreeListStyleSheet + Caption = 'High Contrast White (large)' + Styles.Content = cxStyle364 + Styles.Inactive = cxStyle368 + Styles.Selection = cxStyle371 + Styles.BandHeader = cxStyle362 + Styles.ColumnHeader = cxStyle363 + Styles.ContentEven = cxStyle365 + Styles.ContentOdd = cxStyle366 + Styles.Footer = cxStyle367 + Styles.Indicator = cxStyle369 + Styles.Preview = cxStyle370 + BuiltIn = True + end + end +end diff --git a/official/x.35/Lib/D11/cxTLReg.dcr b/official/x.35/Lib/D11/cxTLReg.dcr new file mode 100644 index 00000000..cdc31291 Binary files /dev/null and b/official/x.35/Lib/D11/cxTLReg.dcr differ diff --git a/official/x.35/Lib/D11/cxTLReg.dcu b/official/x.35/Lib/D11/cxTLReg.dcu new file mode 100644 index 00000000..58b3a6b2 Binary files /dev/null and b/official/x.35/Lib/D11/cxTLReg.dcu differ diff --git a/official/x.35/Lib/D11/cxTLStrs.dcu b/official/x.35/Lib/D11/cxTLStrs.dcu new file mode 100644 index 00000000..b0f4fea9 Binary files /dev/null and b/official/x.35/Lib/D11/cxTLStrs.dcu differ diff --git a/official/x.35/Lib/D11/cxTLStyleSheetPreview.dcu b/official/x.35/Lib/D11/cxTLStyleSheetPreview.dcu new file mode 100644 index 00000000..2da2cc93 Binary files /dev/null and b/official/x.35/Lib/D11/cxTLStyleSheetPreview.dcu differ diff --git a/official/x.35/Lib/D11/cxTableViewEditor.dcu b/official/x.35/Lib/D11/cxTableViewEditor.dcu new file mode 100644 index 00000000..2f6ce7e4 Binary files /dev/null and b/official/x.35/Lib/D11/cxTableViewEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxTableViewEditor.dfm b/official/x.35/Lib/D11/cxTableViewEditor.dfm new file mode 100644 index 00000000..51dc89be --- /dev/null +++ b/official/x.35/Lib/D11/cxTableViewEditor.dfm @@ -0,0 +1,12 @@ +inherited cxTableViewEditor: TcxTableViewEditor + Caption = 'cxTableViewEditor' + PixelsPerInch = 96 + TextHeight = 13 + inherited PViewEditor: TPanel + inherited PageControl1: TcxPageControl + inherited TSItems: TcxTabSheet + Caption = ' Columns ' + end + end + end +end diff --git a/official/x.35/Lib/D11/cxTextEdit.dcu b/official/x.35/Lib/D11/cxTextEdit.dcu new file mode 100644 index 00000000..7cb78953 Binary files /dev/null and b/official/x.35/Lib/D11/cxTextEdit.dcu differ diff --git a/official/x.35/Lib/D11/cxTimeEdit.dcu b/official/x.35/Lib/D11/cxTimeEdit.dcu new file mode 100644 index 00000000..7c5ff785 Binary files /dev/null and b/official/x.35/Lib/D11/cxTimeEdit.dcu differ diff --git a/official/x.35/Lib/D11/cxTrackBar.dcu b/official/x.35/Lib/D11/cxTrackBar.dcu new file mode 100644 index 00000000..c278d5f7 Binary files /dev/null and b/official/x.35/Lib/D11/cxTrackBar.dcu differ diff --git a/official/x.35/Lib/D11/cxTreeListD11.bpl b/official/x.35/Lib/D11/cxTreeListD11.bpl new file mode 100644 index 00000000..e4cba8c6 Binary files /dev/null and b/official/x.35/Lib/D11/cxTreeListD11.bpl differ diff --git a/official/x.35/Lib/D11/cxTreeListD11.dcp b/official/x.35/Lib/D11/cxTreeListD11.dcp new file mode 100644 index 00000000..f04dd4ca Binary files /dev/null and b/official/x.35/Lib/D11/cxTreeListD11.dcp differ diff --git a/official/x.35/Lib/D11/cxTreeListD11.dcu b/official/x.35/Lib/D11/cxTreeListD11.dcu new file mode 100644 index 00000000..3c19717b Binary files /dev/null and b/official/x.35/Lib/D11/cxTreeListD11.dcu differ diff --git a/official/x.35/Lib/D11/cxTreeView.dcu b/official/x.35/Lib/D11/cxTreeView.dcu new file mode 100644 index 00000000..0f637550 Binary files /dev/null and b/official/x.35/Lib/D11/cxTreeView.dcu differ diff --git a/official/x.35/Lib/D11/cxVGrid.dcu b/official/x.35/Lib/D11/cxVGrid.dcu new file mode 100644 index 00000000..00ce0d7d Binary files /dev/null and b/official/x.35/Lib/D11/cxVGrid.dcu differ diff --git a/official/x.35/Lib/D11/cxVGridConsts.dcu b/official/x.35/Lib/D11/cxVGridConsts.dcu new file mode 100644 index 00000000..9e214cf1 Binary files /dev/null and b/official/x.35/Lib/D11/cxVGridConsts.dcu differ diff --git a/official/x.35/Lib/D11/cxVGridConverter.dcu b/official/x.35/Lib/D11/cxVGridConverter.dcu new file mode 100644 index 00000000..35f67a83 Binary files /dev/null and b/official/x.35/Lib/D11/cxVGridConverter.dcu differ diff --git a/official/x.35/Lib/D11/cxVGridDXInspConverter.dcu b/official/x.35/Lib/D11/cxVGridDXInspConverter.dcu new file mode 100644 index 00000000..bd11d54d Binary files /dev/null and b/official/x.35/Lib/D11/cxVGridDXInspConverter.dcu differ diff --git a/official/x.35/Lib/D11/cxVGridEditor.dcu b/official/x.35/Lib/D11/cxVGridEditor.dcu new file mode 100644 index 00000000..cf8d8e4a Binary files /dev/null and b/official/x.35/Lib/D11/cxVGridEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxVGridEditor.dfm b/official/x.35/Lib/D11/cxVGridEditor.dfm new file mode 100644 index 00000000..41be2ec8 --- /dev/null +++ b/official/x.35/Lib/D11/cxVGridEditor.dfm @@ -0,0 +1,160 @@ +inherited cxVerticalGridEditor: TcxVerticalGridEditor + Left = 591 + Top = 125 + Width = 282 + Height = 404 + Caption = 'VerticalGrid - rows editor' + Constraints.MinHeight = 310 + Constraints.MinWidth = 280 + PopupMenu = PopupMenu + OnActivate = FormActivate + OnShow = FormShow + PixelsPerInch = 120 + TextHeight = 16 + object Panel1: TPanel + Left = 147 + Top = 0 + Width = 127 + Height = 364 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btCategory: TcxButton + Left = 6 + Top = 50 + Width = 110 + Height = 31 + Caption = 'Add category' + TabOrder = 2 + OnClick = btCategoryClick + end + object btEditor: TcxButton + Left = 6 + Top = 11 + Width = 110 + Height = 31 + Caption = 'Add editor' + TabOrder = 0 + OnClick = btEditorClick + end + object btClose: TcxButton + Left = 6 + Top = 397 + Width = 110 + Height = 31 + Anchors = [akLeft, akRight, akBottom] + Caption = 'Close' + TabOrder = 5 + OnClick = btCloseClick + end + object btMultiEditor: TcxButton + Left = 6 + Top = 90 + Width = 110 + Height = 31 + Caption = 'Add multieditor' + TabOrder = 1 + OnClick = btMultiEditorClick + end + object btDelete: TcxButton + Left = 6 + Top = 129 + Width = 110 + Height = 31 + Caption = 'Delete' + Enabled = False + TabOrder = 3 + OnClick = btDeleteClick + end + object btClear: TcxButton + Left = 6 + Top = 208 + Width = 110 + Height = 31 + Caption = 'Clear all' + Enabled = False + TabOrder = 4 + OnClick = btClearClick + end + object btCreateAll: TcxButton + Left = 6 + Top = 169 + Width = 110 + Height = 30 + Caption = 'Create all items' + TabOrder = 6 + OnClick = btCreateAllClick + end + object btLayoutEditor: TcxButton + Left = 6 + Top = 247 + Width = 110 + Height = 31 + Caption = 'Layout editor...' + Enabled = False + TabOrder = 7 + OnClick = btLayoutEditorClick + end + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 147 + Height = 364 + Align = alClient + BevelOuter = bvNone + BorderWidth = 4 + TabOrder = 1 + object lbRows: TListBox + Left = 4 + Top = 4 + Width = 139 + Height = 356 + Align = alClient + ItemHeight = 16 + MultiSelect = True + TabOrder = 0 + OnClick = lbRowsClick + end + end + object PopupMenu: TPopupMenu + Left = 128 + Top = 16 + object miEditor: TMenuItem + Caption = 'Add &editor' + ShortCut = 45 + OnClick = miEditorClick + end + object miCategory: TMenuItem + Caption = 'Add &category' + OnClick = miCategoryClick + end + object miMultieditor: TMenuItem + Caption = 'Add &multieditor' + OnClick = miMultieditorClick + end + object N1: TMenuItem + Caption = '-' + end + object miDelete: TMenuItem + Caption = '&Delete row' + Enabled = False + ShortCut = 46 + OnClick = miDeleteClick + end + object miClearAll: TMenuItem + Caption = 'C&lear all' + Enabled = False + OnClick = miClearAllClick + end + object N2: TMenuItem + Caption = '-' + end + object miSelectAll: TMenuItem + Caption = 'Select &All' + Enabled = False + ShortCut = 16449 + OnClick = miSelectAllClick + end + end +end diff --git a/official/x.35/Lib/D11/cxVGridLayoutEditor.dcu b/official/x.35/Lib/D11/cxVGridLayoutEditor.dcu new file mode 100644 index 00000000..8a9c4728 Binary files /dev/null and b/official/x.35/Lib/D11/cxVGridLayoutEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxVGridLayoutEditor.dfm b/official/x.35/Lib/D11/cxVGridLayoutEditor.dfm new file mode 100644 index 00000000..5524ba01 --- /dev/null +++ b/official/x.35/Lib/D11/cxVGridLayoutEditor.dfm @@ -0,0 +1,76 @@ +object fmvgLayoutEditor: TfmvgLayoutEditor + Left = 301 + Top = 223 + Width = 491 + Height = 343 + Caption = 'Layout editor' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poDefaultPosOnly + OnClose = FormClose + OnCreate = FormCreate + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object pnlButtons: TPanel + Left = 378 + Top = 0 + Width = 105 + Height = 309 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btCustomize: TcxButton + Left = 8 + Top = 80 + Width = 89 + Height = 25 + Caption = 'Customize' + TabOrder = 0 + OnClick = btCustomizeClick + end + object btOk: TcxButton + Left = 8 + Top = 16 + Width = 89 + Height = 25 + Caption = 'OK' + ModalResult = 1 + TabOrder = 1 + end + object btCancel: TcxButton + Left = 8 + Top = 48 + Width = 89 + Height = 25 + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object StatusBar1: TStatusBar + Left = 0 + Top = 290 + Width = 105 + Height = 19 + Panels = < + item + Bevel = pbNone + Width = 50 + end> + end + end + object pnlVGPlace: TPanel + Left = 0 + Top = 0 + Width = 378 + Height = 309 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + end +end diff --git a/official/x.35/Lib/D11/cxVGridNewCategory.dcu b/official/x.35/Lib/D11/cxVGridNewCategory.dcu new file mode 100644 index 00000000..bb25bb8f Binary files /dev/null and b/official/x.35/Lib/D11/cxVGridNewCategory.dcu differ diff --git a/official/x.35/Lib/D11/cxVGridNewCategory.dfm b/official/x.35/Lib/D11/cxVGridNewCategory.dfm new file mode 100644 index 00000000..3ea6d8eb --- /dev/null +++ b/official/x.35/Lib/D11/cxVGridNewCategory.dfm @@ -0,0 +1,59 @@ +object fmCreateCategory: TfmCreateCategory + Left = 669 + Top = 113 + BorderStyle = bsDialog + ClientHeight = 87 + ClientWidth = 279 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object lbCaption: TLabel + Left = 11 + Top = 13 + Width = 3 + Height = 13 + FocusControl = edCaption + end + object Bevel: TBevel + Left = 11 + Top = 42 + Width = 260 + Height = 4 + Shape = bsTopLine + end + object btOK: TcxButton + Left = 113 + Top = 55 + Width = 75 + Height = 24 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btCancel: TcxButton + Left = 196 + Top = 55 + Width = 75 + Height = 24 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object edCaption: TcxTextEdit + Left = 72 + Top = 10 + Width = 199 + Height = 21 + Properties.OnChange = edCaptionPropertiesChange + TabOrder = 0 + end +end diff --git a/official/x.35/Lib/D11/cxVGridPredefinedStyles.dcu b/official/x.35/Lib/D11/cxVGridPredefinedStyles.dcu new file mode 100644 index 00000000..665754d8 Binary files /dev/null and b/official/x.35/Lib/D11/cxVGridPredefinedStyles.dcu differ diff --git a/official/x.35/Lib/D11/cxVGridPredefinedStyles.dfm b/official/x.35/Lib/D11/cxVGridPredefinedStyles.dfm new file mode 100644 index 00000000..0d8425bf --- /dev/null +++ b/official/x.35/Lib/D11/cxVGridPredefinedStyles.dfm @@ -0,0 +1,2350 @@ +object cxdmVerticalGridPredefinedStyles: TcxdmVerticalGridPredefinedStyles + OldCreateOrder = False + Left = 447 + Top = 147 + Height = 150 + Width = 215 + object StyleRepository: TcxStyleRepository + Left = 88 + Top = 8 + object cxStyle1: TcxStyle + AssignedValues = [svColor] + Color = 10996706 + end + object cxStyle2: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6787015 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clMaroon + end + object cxStyle3: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14215155 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsItalic] + TextColor = clBlack + end + object cxStyle4: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10996706 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle5: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8171478 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle6: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 2829218 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle7: TcxStyle + AssignedValues = [svColor] + Color = 11518669 + end + object cxStyle8: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Verdana' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle9: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clTeal + end + object cxStyle10: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11518669 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle11: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9612476 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle12: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle13: TcxStyle + AssignedValues = [svColor] + Color = 11055248 + end + object cxStyle14: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 8292193 + TextColor = clWhite + end + object cxStyle15: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = clWhite + TextColor = clBlack + end + object cxStyle16: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11055248 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle17: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9279343 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle18: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7897176 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle19: TcxStyle + AssignedValues = [svColor] + Color = 14264494 + end + object cxStyle20: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12941956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Garamond' + Font.Style = [fsBold, fsItalic] + TextColor = clWhite + end + object cxStyle21: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 16380659 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle22: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14264494 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle23: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13338511 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle24: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11619930 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle25: TcxStyle + AssignedValues = [svColor] + Color = 11458790 + end + object cxStyle26: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7913174 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clOlive + end + object cxStyle27: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15004664 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clGray + end + object cxStyle28: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11458790 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clOlive + end + object cxStyle29: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9095643 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle30: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4630214 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle31: TcxStyle + AssignedValues = [svColor] + Color = clTeal + end + object cxStyle32: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle33: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14213320 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle34: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12107912 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle35: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11515030 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle36: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10067831 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle37: TcxStyle + AssignedValues = [svColor] + Color = 9476264 + end + object cxStyle38: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7568529 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle39: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160664 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle40: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9476264 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle41: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7831957 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle42: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4210816 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle43: TcxStyle + AssignedValues = [svColor] + Color = 8308967 + end + object cxStyle44: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 2396093 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle45: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14019831 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clGreen + end + object cxStyle46: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8308967 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle47: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5617117 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle48: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4944971 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle49: TcxStyle + AssignedValues = [svColor] + Color = 12429461 + end + object cxStyle50: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11441533 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle51: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clGray + end + object cxStyle52: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12429461 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle53: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9993057 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle54: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8217935 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle55: TcxStyle + AssignedValues = [svColor] + Color = 15395562 + end + object cxStyle56: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13002291 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle57: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsItalic] + TextColor = clMaroon + end + object cxStyle58: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15395562 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle59: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12171705 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle60: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 185 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle61: TcxStyle + AssignedValues = [svColor] + Color = 13158655 + end + object cxStyle62: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9211088 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle63: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15461375 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle64: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 13158655 + TextColor = clBlack + end + object cxStyle65: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8553164 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle66: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5855675 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle67: TcxStyle + AssignedValues = [svColor] + Color = 13158655 + end + object cxStyle68: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9540050 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -19 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle69: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15461375 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle70: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13158655 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [] + TextColor = clBlack + end + object cxStyle71: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9013711 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle72: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5855675 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle73: TcxStyle + AssignedValues = [svColor] + Color = 13154717 + end + object cxStyle74: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12035200 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle75: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clGray + end + object cxStyle76: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13154717 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle77: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11771255 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle78: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9928789 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle79: TcxStyle + AssignedValues = [svColor] + Color = 12309430 + end + object cxStyle80: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11126946 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle81: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle82: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12309430 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle83: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9615497 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle84: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6592345 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle85: TcxStyle + AssignedValues = [svColor] + Color = 13750737 + end + object cxStyle86: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10911061 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle87: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 16119285 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle88: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13750737 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle89: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11579568 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle90: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12097140 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle91: TcxStyle + AssignedValues = [svColor] + Color = clSilver + end + object cxStyle92: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle93: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clTeal + end + object cxStyle94: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle95: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10526880 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle96: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle97: TcxStyle + AssignedValues = [svColor] + Color = 15138815 + end + object cxStyle98: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7523789 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle99: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15138815 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clOlive + end + object cxStyle100: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10542814 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle101: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 38807 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle102: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clOlive + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle103: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle104: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle105: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle106: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle107: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle108: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle109: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle110: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle111: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle112: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle113: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle114: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle115: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle116: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle117: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle118: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle119: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle120: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13160660 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle121: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle122: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6956042 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle123: TcxStyle + AssignedValues = [svColor] + Color = -1 + end + object cxStyle124: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clYellow + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle125: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clYellow + end + object cxStyle126: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle127: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle128: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 206 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle129: TcxStyle + AssignedValues = [svColor] + Color = -1 + end + object cxStyle130: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clYellow + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle131: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clYellow + end + object cxStyle132: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle133: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle134: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 206 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle135: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle136: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clNavy + end + object cxStyle137: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clYellow + end + object cxStyle138: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle139: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clYellow + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clNavy + end + object cxStyle140: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle141: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clNavy + end + object cxStyle142: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clYellow + end + object cxStyle143: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle144: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clYellow + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clNavy + end + object cxStyle145: TcxStyle + AssignedValues = [svColor] + Color = -1 + end + object cxStyle146: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle147: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clSilver + end + object cxStyle148: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle149: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle150: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle151: TcxStyle + AssignedValues = [svColor] + Color = -1 + end + object cxStyle152: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = -1 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -21 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle153: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clSilver + end + object cxStyle154: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle155: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle156: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle157: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = -1 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle158: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [] + TextColor = clBlack + end + object cxStyle159: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle160: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle161: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Microsoft Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle162: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = -1 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -21 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle163: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle164: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle165: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle166: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -17 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle167: TcxStyle + AssignedValues = [svColor] + Color = 11295531 + end + object cxStyle168: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16247513 + TextColor = clBlack + end + object cxStyle169: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 12937777 + TextColor = clWhite + end + object cxStyle170: TcxStyle + AssignedValues = [svColor] + Color = 15451300 + end + object cxStyle171: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBlack + end + object cxStyle172: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14059352 + TextColor = clWhite + end + object cxStyle173: TcxStyle + AssignedValues = [svColor] + Color = 5211069 + end + object cxStyle174: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14348540 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle175: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8104919 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle176: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11457510 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle177: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10207457 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle178: TcxStyle + AssignedValues = [svColor] + Color = 5475927 + end + object cxStyle179: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15463404 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Verdana' + Font.Style = [] + TextColor = clGreen + end + object cxStyle180: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7383924 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Verdana' + Font.Style = [] + TextColor = clWhite + end + object cxStyle181: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9420435 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Verdana' + Font.Style = [] + TextColor = clWhite + end + object cxStyle182: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9223055 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Verdana' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle183: TcxStyle + AssignedValues = [svColor] + Color = 11053224 + end + object cxStyle184: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15329769 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clGray + end + object cxStyle185: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13948116 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle186: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clGray + end + object cxStyle187: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11579568 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle188: TcxStyle + AssignedValues = [svColor] + Color = 12937777 + end + object cxStyle189: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11295531 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle190: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16247513 + TextColor = clBlack + end + object cxStyle191: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 12937777 + TextColor = clWhite + end + object cxStyle192: TcxStyle + AssignedValues = [svColor] + Color = 15119240 + end + object cxStyle193: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBlack + end + object cxStyle194: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 15120025 + TextColor = clWhite + end + object cxStyle195: TcxStyle + AssignedValues = [svColor] + Color = 8104919 + end + object cxStyle196: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5211069 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle197: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14348540 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle198: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8104919 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle199: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9289948 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clMaroon + end + object cxStyle200: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10207457 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle201: TcxStyle + AssignedValues = [svColor] + Color = 7383924 + end + object cxStyle202: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 5475927 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Verdana' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle203: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15463404 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Verdana' + Font.Style = [] + TextColor = clGreen + end + object cxStyle204: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7383924 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Verdana' + Font.Style = [] + TextColor = clWhite + end + object cxStyle205: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9617558 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Verdana' + Font.Style = [] + TextColor = clWhite + end + object cxStyle206: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 10733990 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Verdana' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle207: TcxStyle + AssignedValues = [svColor] + Color = 13948116 + end + object cxStyle208: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11053224 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object cxStyle209: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15329769 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clGray + end + object cxStyle210: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13948116 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object cxStyle211: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clGray + end + object cxStyle212: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11579568 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object cxStyle213: TcxStyle + AssignedValues = [svColor] + Color = 14590588 + end + object cxStyle214: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13795663 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clYellow + end + object cxStyle215: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 16247513 + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = clNavy + end + object cxStyle216: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14590588 + TextColor = clWhite + end + object cxStyle217: TcxStyle + AssignedValues = [svColor] + Color = 15185807 + end + object cxStyle218: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBlack + end + object cxStyle219: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 15120279 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + TextColor = clWhite + end + object cxStyle220: TcxStyle + AssignedValues = [svColor] + Color = 14125918 + end + object cxStyle221: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13596225 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clWhite + end + object cxStyle222: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 16247513 + TextColor = clBlack + end + object cxStyle223: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14125918 + TextColor = clWhite + end + object cxStyle224: TcxStyle + AssignedValues = [svColor] + Color = 15451300 + end + object cxStyle225: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBlack + end + object cxStyle226: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 14656381 + TextColor = clWhite + end + object cxStyle227: TcxStyle + AssignedValues = [svColor] + Color = clWhite + end + object cxStyle228: TcxStyle + AssignedValues = [svColor] + Color = clWhite + end + object cxStyle229: TcxStyle + AssignedValues = [svColor] + Color = clWhite + end + object cxStyle230: TcxStyle + AssignedValues = [svColor] + Color = clWhite + end + object cxStyle231: TcxStyle + AssignedValues = [svColor] + Color = 10841658 + end + object cxStyle232: TcxStyle + AssignedValues = [svColor] + Color = 10841658 + end + object cxStyle233: TcxStyle + AssignedValues = [svColor] + Color = 10841658 + end + object cxStyle234: TcxStyle + AssignedValues = [svColor] + Color = 10841658 + end + object cxVerticalGridStyleSheetDevExpress: TcxVerticalGridStyleSheet + Caption = 'DevExpress' + Styles.Background = cxStyle213 + Styles.Content = cxStyle215 + Styles.Inactive = cxStyle217 + Styles.Selection = cxStyle219 + Styles.Category = cxStyle214 + Styles.Header = cxStyle216 + Styles.IncSearch = cxStyle218 + BuiltIn = True + end + object cxVerticalGridStyleSheetUserFormat1: TcxVerticalGridStyleSheet + Caption = 'UserFormat1' + Styles.Background = cxStyle195 + Styles.Content = cxStyle197 + Styles.Inactive = cxStyle199 + Styles.Selection = cxStyle200 + Styles.Category = cxStyle196 + Styles.Header = cxStyle198 + BuiltIn = True + end + object cxVerticalGridStyleSheetUserFormat2: TcxVerticalGridStyleSheet + Caption = 'UserFormat2' + Styles.Background = cxStyle201 + Styles.Content = cxStyle203 + Styles.Inactive = cxStyle205 + Styles.Selection = cxStyle206 + Styles.Category = cxStyle202 + Styles.Header = cxStyle204 + BuiltIn = True + end + object cxVerticalGridStyleSheetUserFormat3: TcxVerticalGridStyleSheet + Caption = 'UserFormat3' + Styles.Background = cxStyle207 + Styles.Content = cxStyle209 + Styles.Inactive = cxStyle211 + Styles.Selection = cxStyle212 + Styles.Category = cxStyle208 + Styles.Header = cxStyle210 + BuiltIn = True + end + object cxVerticalGridStyleSheetUserFormat4: TcxVerticalGridStyleSheet + Caption = 'UserFormat4' + Styles.Background = cxStyle188 + Styles.Content = cxStyle190 + Styles.Inactive = cxStyle192 + Styles.Selection = cxStyle194 + Styles.Category = cxStyle189 + Styles.Header = cxStyle191 + Styles.IncSearch = cxStyle193 + BuiltIn = True + end + object cxVerticalGridStyleSheetBrick: TcxVerticalGridStyleSheet + Caption = 'Brick' + Styles.Background = cxStyle1 + Styles.Content = cxStyle3 + Styles.Inactive = cxStyle5 + Styles.Selection = cxStyle6 + Styles.Category = cxStyle2 + Styles.Header = cxStyle4 + BuiltIn = True + end + object cxVerticalGridStyleDesert: TcxVerticalGridStyleSheet + Caption = 'Desert' + Styles.Background = cxStyle7 + Styles.Content = cxStyle9 + Styles.Inactive = cxStyle11 + Styles.Selection = cxStyle12 + Styles.Category = cxStyle8 + Styles.Header = cxStyle10 + BuiltIn = True + end + object cxVerticalGridStyleSheetEggplant: TcxVerticalGridStyleSheet + Caption = 'Eggplant' + Styles.Background = cxStyle13 + Styles.Content = cxStyle15 + Styles.Inactive = cxStyle17 + Styles.Selection = cxStyle18 + Styles.Category = cxStyle14 + Styles.Header = cxStyle16 + BuiltIn = True + end + object cxVerticalGridStyleSheetLilac: TcxVerticalGridStyleSheet + Caption = 'Lilac' + Styles.Background = cxStyle19 + Styles.Content = cxStyle21 + Styles.Inactive = cxStyle23 + Styles.Selection = cxStyle24 + Styles.Category = cxStyle20 + Styles.Header = cxStyle22 + BuiltIn = True + end + object cxVerticalGridStyleSheetMaple: TcxVerticalGridStyleSheet + Caption = 'Maple' + Styles.Background = cxStyle25 + Styles.Content = cxStyle27 + Styles.Inactive = cxStyle29 + Styles.Selection = cxStyle30 + Styles.Category = cxStyle26 + Styles.Header = cxStyle28 + BuiltIn = True + end + object cxVerticalGridStyleSheetMarineHighColor: TcxVerticalGridStyleSheet + Caption = 'Marine (high color)' + Styles.Background = cxStyle31 + Styles.Content = cxStyle33 + Styles.Inactive = cxStyle35 + Styles.Selection = cxStyle36 + Styles.Category = cxStyle32 + Styles.Header = cxStyle34 + BuiltIn = True + end + object cxVerticalGridStyleSheetPlumHighColor: TcxVerticalGridStyleSheet + Caption = 'Plum (high color)' + Styles.Background = cxStyle37 + Styles.Content = cxStyle39 + Styles.Inactive = cxStyle41 + Styles.Selection = cxStyle42 + Styles.Category = cxStyle38 + Styles.Header = cxStyle40 + BuiltIn = True + end + object cxVerticalGridStyleSheetPumpkinLarge: TcxVerticalGridStyleSheet + Caption = 'Pumpkin (large)' + Styles.Background = cxStyle43 + Styles.Content = cxStyle45 + Styles.Inactive = cxStyle47 + Styles.Selection = cxStyle48 + Styles.Category = cxStyle44 + Styles.Header = cxStyle46 + BuiltIn = True + end + object cxVerticalGridStyleSheetRainyDay: TcxVerticalGridStyleSheet + Caption = 'Rainy Day' + Styles.Background = cxStyle49 + Styles.Content = cxStyle51 + Styles.Inactive = cxStyle53 + Styles.Selection = cxStyle54 + Styles.Category = cxStyle50 + Styles.Header = cxStyle52 + BuiltIn = True + end + object cxVerticalGridStyleSheetRedWhiteAndBlueVGA: TcxVerticalGridStyleSheet + Caption = 'Red, White, and Blue (VGA)' + Styles.Background = cxStyle55 + Styles.Content = cxStyle57 + Styles.Inactive = cxStyle59 + Styles.Selection = cxStyle60 + Styles.Category = cxStyle56 + Styles.Header = cxStyle58 + BuiltIn = True + end + object cxVerticalGridStyleSheetRose: TcxVerticalGridStyleSheet + Caption = 'Rose' + Styles.Background = cxStyle61 + Styles.Content = cxStyle63 + Styles.Inactive = cxStyle65 + Styles.Selection = cxStyle66 + Styles.Category = cxStyle62 + Styles.Header = cxStyle64 + BuiltIn = True + end + object cxVerticalGridStyleSheetRoseLarge: TcxVerticalGridStyleSheet + Caption = 'Rose (large)' + Styles.Background = cxStyle67 + Styles.Content = cxStyle69 + Styles.Inactive = cxStyle71 + Styles.Selection = cxStyle72 + Styles.Category = cxStyle68 + Styles.Header = cxStyle70 + BuiltIn = True + end + object cxVerticalGridStyleSheetSlate: TcxVerticalGridStyleSheet + Caption = 'Slate' + Styles.Background = cxStyle73 + Styles.Content = cxStyle75 + Styles.Inactive = cxStyle77 + Styles.Selection = cxStyle78 + Styles.Category = cxStyle74 + Styles.Header = cxStyle76 + BuiltIn = True + end + object cxVerticalGridStyleSheetSpruce: TcxVerticalGridStyleSheet + Caption = 'Spruce' + Styles.Background = cxStyle79 + Styles.Content = cxStyle81 + Styles.Inactive = cxStyle83 + Styles.Selection = cxStyle84 + Styles.Category = cxStyle80 + Styles.Header = cxStyle82 + BuiltIn = True + end + object cxVerticalGridStyleSheetStormVGA: TcxVerticalGridStyleSheet + Caption = 'Storm (VGA)' + Styles.Background = cxStyle85 + Styles.Content = cxStyle87 + Styles.Inactive = cxStyle89 + Styles.Selection = cxStyle90 + Styles.Category = cxStyle86 + Styles.Header = cxStyle88 + BuiltIn = True + end + object cxVerticalGridStyleSheetTealVGA: TcxVerticalGridStyleSheet + Caption = 'Teal (VGA)' + Styles.Background = cxStyle91 + Styles.Content = cxStyle93 + Styles.Inactive = cxStyle95 + Styles.Selection = cxStyle96 + Styles.Category = cxStyle92 + Styles.Header = cxStyle94 + BuiltIn = True + end + object cxVerticalGridStyleSheetWheat: TcxVerticalGridStyleSheet + Caption = 'Wheat' + Styles.Background = cxStyle97 + Styles.Content = cxStyle99 + Styles.Inactive = cxStyle101 + Styles.Selection = cxStyle102 + Styles.Category = cxStyle98 + Styles.Header = cxStyle100 + BuiltIn = True + end + object cxVerticalGridStyleSheetWindowsClassic: TcxVerticalGridStyleSheet + Caption = 'Windows Classic' + Styles.Background = cxStyle231 + Styles.Content = cxStyle104 + Styles.Inactive = cxStyle106 + Styles.Selection = cxStyle107 + Styles.Category = cxStyle103 + Styles.Header = cxStyle105 + BuiltIn = True + end + object cxVerticalGridStyleSheetWindowsClassicLarge: TcxVerticalGridStyleSheet + Caption = 'Windows Classic (large)' + Styles.Background = cxStyle232 + Styles.Content = cxStyle109 + Styles.Inactive = cxStyle111 + Styles.Selection = cxStyle112 + Styles.Category = cxStyle108 + Styles.Header = cxStyle110 + BuiltIn = True + end + object cxVerticalGridStyleSheetWindowsStandard: TcxVerticalGridStyleSheet + Caption = 'Windows Standard' + Styles.Background = cxStyle233 + Styles.Content = cxStyle114 + Styles.Inactive = cxStyle116 + Styles.Selection = cxStyle117 + Styles.Category = cxStyle113 + Styles.Header = cxStyle115 + BuiltIn = True + end + object cxVerticalGridStyleSheetWindowsStandardLarge: TcxVerticalGridStyleSheet + Caption = 'Windows Standard (large)' + Styles.Background = cxStyle234 + Styles.Content = cxStyle119 + Styles.Inactive = cxStyle121 + Styles.Selection = cxStyle122 + Styles.Category = cxStyle118 + Styles.Header = cxStyle120 + BuiltIn = True + end + object cxVerticalGridStyleSheetHighContrast1: TcxVerticalGridStyleSheet + Caption = 'High Contrast #1' + Styles.Background = cxStyle123 + Styles.Content = cxStyle125 + Styles.Inactive = cxStyle127 + Styles.Selection = cxStyle128 + Styles.Category = cxStyle124 + Styles.Header = cxStyle126 + BuiltIn = True + end + object cxVerticalGridStyleSheetHighContrast1Large: TcxVerticalGridStyleSheet + Caption = 'High Contrast #1 (large)' + Styles.Background = cxStyle129 + Styles.Content = cxStyle131 + Styles.Inactive = cxStyle133 + Styles.Selection = cxStyle134 + Styles.Category = cxStyle130 + Styles.Header = cxStyle132 + BuiltIn = True + end + object cxVerticalGridStyleSheetHighContrast2: TcxVerticalGridStyleSheet + Caption = 'High Contrast #2' + Styles.Background = cxStyle230 + Styles.Content = cxStyle136 + Styles.Inactive = cxStyle138 + Styles.Selection = cxStyle139 + Styles.Category = cxStyle135 + Styles.Header = cxStyle137 + BuiltIn = True + end + object cxVerticalGridStyleSheetHighContrast2Large: TcxVerticalGridStyleSheet + Caption = 'High Contrast #2 (large)' + Styles.Background = cxStyle229 + Styles.Content = cxStyle141 + Styles.Inactive = cxStyle143 + Styles.Selection = cxStyle144 + Styles.Category = cxStyle140 + Styles.Header = cxStyle142 + BuiltIn = True + end + object cxVerticalGridStyleSheetHighContrastBlack: TcxVerticalGridStyleSheet + Caption = 'High Contrast Black' + Styles.Background = cxStyle145 + Styles.Content = cxStyle147 + Styles.Inactive = cxStyle149 + Styles.Selection = cxStyle150 + Styles.Category = cxStyle146 + Styles.Header = cxStyle148 + BuiltIn = True + end + object cxVerticalGridStyleSheetHighContrastBlackLarge: TcxVerticalGridStyleSheet + Caption = 'High Contrast Black (large)' + Styles.Background = cxStyle151 + Styles.Content = cxStyle153 + Styles.Inactive = cxStyle155 + Styles.Selection = cxStyle156 + Styles.Category = cxStyle152 + Styles.Header = cxStyle154 + BuiltIn = True + end + object cxVerticalGridStyleSheetHighContrastWhite: TcxVerticalGridStyleSheet + Caption = 'High Contrast White' + Styles.Background = cxStyle228 + Styles.Content = cxStyle158 + Styles.Inactive = cxStyle160 + Styles.Selection = cxStyle161 + Styles.Category = cxStyle157 + Styles.Header = cxStyle159 + BuiltIn = True + end + object cxVerticalGridStyleSheetHighContrastWhiteLarge: TcxVerticalGridStyleSheet + Caption = 'High Contrast White (large)' + Styles.Background = cxStyle227 + Styles.Content = cxStyle163 + Styles.Inactive = cxStyle165 + Styles.Selection = cxStyle166 + Styles.Category = cxStyle162 + Styles.Header = cxStyle164 + BuiltIn = True + end + end +end diff --git a/official/x.35/Lib/D11/cxVGridReg.dcr b/official/x.35/Lib/D11/cxVGridReg.dcr new file mode 100644 index 00000000..e209e582 Binary files /dev/null and b/official/x.35/Lib/D11/cxVGridReg.dcr differ diff --git a/official/x.35/Lib/D11/cxVGridReg.dcu b/official/x.35/Lib/D11/cxVGridReg.dcu new file mode 100644 index 00000000..521d89d9 Binary files /dev/null and b/official/x.35/Lib/D11/cxVGridReg.dcu differ diff --git a/official/x.35/Lib/D11/cxVGridStyleSheetPreview.dcu b/official/x.35/Lib/D11/cxVGridStyleSheetPreview.dcu new file mode 100644 index 00000000..56d89453 Binary files /dev/null and b/official/x.35/Lib/D11/cxVGridStyleSheetPreview.dcu differ diff --git a/official/x.35/Lib/D11/cxVGridUtils.dcu b/official/x.35/Lib/D11/cxVGridUtils.dcu new file mode 100644 index 00000000..1aa900a3 Binary files /dev/null and b/official/x.35/Lib/D11/cxVGridUtils.dcu differ diff --git a/official/x.35/Lib/D11/cxVGridViewInfo.dcu b/official/x.35/Lib/D11/cxVGridViewInfo.dcu new file mode 100644 index 00000000..3b96f4d8 Binary files /dev/null and b/official/x.35/Lib/D11/cxVGridViewInfo.dcu differ diff --git a/official/x.35/Lib/D11/cxVariants.dcu b/official/x.35/Lib/D11/cxVariants.dcu new file mode 100644 index 00000000..10fecb03 Binary files /dev/null and b/official/x.35/Lib/D11/cxVariants.dcu differ diff --git a/official/x.35/Lib/D11/cxVerticalGridD11.bpl b/official/x.35/Lib/D11/cxVerticalGridD11.bpl new file mode 100644 index 00000000..fc003d3f Binary files /dev/null and b/official/x.35/Lib/D11/cxVerticalGridD11.bpl differ diff --git a/official/x.35/Lib/D11/cxVerticalGridD11.dcp b/official/x.35/Lib/D11/cxVerticalGridD11.dcp new file mode 100644 index 00000000..a2f7a506 Binary files /dev/null and b/official/x.35/Lib/D11/cxVerticalGridD11.dcp differ diff --git a/official/x.35/Lib/D11/cxVerticalGridD11.dcu b/official/x.35/Lib/D11/cxVerticalGridD11.dcu new file mode 100644 index 00000000..c60530b3 Binary files /dev/null and b/official/x.35/Lib/D11/cxVerticalGridD11.dcu differ diff --git a/official/x.35/Lib/D11/cxViewEditor.dcu b/official/x.35/Lib/D11/cxViewEditor.dcu new file mode 100644 index 00000000..6d9f7a9d Binary files /dev/null and b/official/x.35/Lib/D11/cxViewEditor.dcu differ diff --git a/official/x.35/Lib/D11/cxViewEditor.dfm b/official/x.35/Lib/D11/cxViewEditor.dfm new file mode 100644 index 00000000..e7aa372d --- /dev/null +++ b/official/x.35/Lib/D11/cxViewEditor.dfm @@ -0,0 +1,26 @@ +object cxViewEditor: TcxViewEditor + Left = 742 + Top = 104 + Caption = 'cxViewEditor' + ClientHeight = 313 + ClientWidth = 343 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + OnKeyPress = FormKeyPress + PixelsPerInch = 96 + TextHeight = 13 + object PViewEditor: TPanel + Left = 0 + Top = 0 + Width = 343 + Height = 313 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + end +end diff --git a/official/x.35/Lib/D11/cxWWGridConverter.dcu b/official/x.35/Lib/D11/cxWWGridConverter.dcu new file mode 100644 index 00000000..38e1819b Binary files /dev/null and b/official/x.35/Lib/D11/cxWWGridConverter.dcu differ diff --git a/official/x.35/Lib/D11/cxXLSExport.dcu b/official/x.35/Lib/D11/cxXLSExport.dcu new file mode 100644 index 00000000..2ef2af66 Binary files /dev/null and b/official/x.35/Lib/D11/cxXLSExport.dcu differ diff --git a/official/x.35/Lib/D11/dclcxBarEditItemD11.bpl b/official/x.35/Lib/D11/dclcxBarEditItemD11.bpl new file mode 100644 index 00000000..52673d58 Binary files /dev/null and b/official/x.35/Lib/D11/dclcxBarEditItemD11.bpl differ diff --git a/official/x.35/Lib/D11/dclcxBarEditItemD11.dcp b/official/x.35/Lib/D11/dclcxBarEditItemD11.dcp new file mode 100644 index 00000000..8f2ca422 Binary files /dev/null and b/official/x.35/Lib/D11/dclcxBarEditItemD11.dcp differ diff --git a/official/x.35/Lib/D11/dclcxBarEditItemD11.dcu b/official/x.35/Lib/D11/dclcxBarEditItemD11.dcu new file mode 100644 index 00000000..370fd84e Binary files /dev/null and b/official/x.35/Lib/D11/dclcxBarEditItemD11.dcu differ diff --git a/official/x.35/Lib/D11/dclcxEditorsD11.bpl b/official/x.35/Lib/D11/dclcxEditorsD11.bpl new file mode 100644 index 00000000..39929955 Binary files /dev/null and b/official/x.35/Lib/D11/dclcxEditorsD11.bpl differ diff --git a/official/x.35/Lib/D11/dclcxEditorsD11.dcp b/official/x.35/Lib/D11/dclcxEditorsD11.dcp new file mode 100644 index 00000000..382d45dd Binary files /dev/null and b/official/x.35/Lib/D11/dclcxEditorsD11.dcp differ diff --git a/official/x.35/Lib/D11/dclcxEditorsD11.dcu b/official/x.35/Lib/D11/dclcxEditorsD11.dcu new file mode 100644 index 00000000..1fb8e52d Binary files /dev/null and b/official/x.35/Lib/D11/dclcxEditorsD11.dcu differ diff --git a/official/x.35/Lib/D11/dclcxExtEditorsD11.bpl b/official/x.35/Lib/D11/dclcxExtEditorsD11.bpl new file mode 100644 index 00000000..4467f0d5 Binary files /dev/null and b/official/x.35/Lib/D11/dclcxExtEditorsD11.bpl differ diff --git a/official/x.35/Lib/D11/dclcxExtEditorsD11.dcp b/official/x.35/Lib/D11/dclcxExtEditorsD11.dcp new file mode 100644 index 00000000..845b6404 Binary files /dev/null and b/official/x.35/Lib/D11/dclcxExtEditorsD11.dcp differ diff --git a/official/x.35/Lib/D11/dclcxExtEditorsD11.dcu b/official/x.35/Lib/D11/dclcxExtEditorsD11.dcu new file mode 100644 index 00000000..c6269071 Binary files /dev/null and b/official/x.35/Lib/D11/dclcxExtEditorsD11.dcu differ diff --git a/official/x.35/Lib/D11/dclcxGridD11.bpl b/official/x.35/Lib/D11/dclcxGridD11.bpl new file mode 100644 index 00000000..7ab937d2 Binary files /dev/null and b/official/x.35/Lib/D11/dclcxGridD11.bpl differ diff --git a/official/x.35/Lib/D11/dclcxGridD11.dcp b/official/x.35/Lib/D11/dclcxGridD11.dcp new file mode 100644 index 00000000..914d58f8 Binary files /dev/null and b/official/x.35/Lib/D11/dclcxGridD11.dcp differ diff --git a/official/x.35/Lib/D11/dclcxGridD11.dcu b/official/x.35/Lib/D11/dclcxGridD11.dcu new file mode 100644 index 00000000..b2780cb4 Binary files /dev/null and b/official/x.35/Lib/D11/dclcxGridD11.dcu differ diff --git a/official/x.35/Lib/D11/dclcxLibraryD11.bpl b/official/x.35/Lib/D11/dclcxLibraryD11.bpl new file mode 100644 index 00000000..98ae29c3 Binary files /dev/null and b/official/x.35/Lib/D11/dclcxLibraryD11.bpl differ diff --git a/official/x.35/Lib/D11/dclcxLibraryD11.dcp b/official/x.35/Lib/D11/dclcxLibraryD11.dcp new file mode 100644 index 00000000..4129f4ee Binary files /dev/null and b/official/x.35/Lib/D11/dclcxLibraryD11.dcp differ diff --git a/official/x.35/Lib/D11/dclcxLibraryD11.dcu b/official/x.35/Lib/D11/dclcxLibraryD11.dcu new file mode 100644 index 00000000..8e111921 Binary files /dev/null and b/official/x.35/Lib/D11/dclcxLibraryD11.dcu differ diff --git a/official/x.35/Lib/D11/dclcxPageControlD11.bpl b/official/x.35/Lib/D11/dclcxPageControlD11.bpl new file mode 100644 index 00000000..192bebbb Binary files /dev/null and b/official/x.35/Lib/D11/dclcxPageControlD11.bpl differ diff --git a/official/x.35/Lib/D11/dclcxPageControlD11.dcp b/official/x.35/Lib/D11/dclcxPageControlD11.dcp new file mode 100644 index 00000000..dd4cfc56 Binary files /dev/null and b/official/x.35/Lib/D11/dclcxPageControlD11.dcp differ diff --git a/official/x.35/Lib/D11/dclcxPageControlD11.dcu b/official/x.35/Lib/D11/dclcxPageControlD11.dcu new file mode 100644 index 00000000..aadb2524 Binary files /dev/null and b/official/x.35/Lib/D11/dclcxPageControlD11.dcu differ diff --git a/official/x.35/Lib/D11/dclcxSchedulerD11.bpl b/official/x.35/Lib/D11/dclcxSchedulerD11.bpl new file mode 100644 index 00000000..987e8a65 Binary files /dev/null and b/official/x.35/Lib/D11/dclcxSchedulerD11.bpl differ diff --git a/official/x.35/Lib/D11/dclcxSchedulerD11.dcp b/official/x.35/Lib/D11/dclcxSchedulerD11.dcp new file mode 100644 index 00000000..50aba522 Binary files /dev/null and b/official/x.35/Lib/D11/dclcxSchedulerD11.dcp differ diff --git a/official/x.35/Lib/D11/dclcxSchedulerD11.dcu b/official/x.35/Lib/D11/dclcxSchedulerD11.dcu new file mode 100644 index 00000000..9443c62f Binary files /dev/null and b/official/x.35/Lib/D11/dclcxSchedulerD11.dcu differ diff --git a/official/x.35/Lib/D11/dclcxSchedulerGridD11.bpl b/official/x.35/Lib/D11/dclcxSchedulerGridD11.bpl new file mode 100644 index 00000000..0044ab5d Binary files /dev/null and b/official/x.35/Lib/D11/dclcxSchedulerGridD11.bpl differ diff --git a/official/x.35/Lib/D11/dclcxSchedulerGridD11.dcp b/official/x.35/Lib/D11/dclcxSchedulerGridD11.dcp new file mode 100644 index 00000000..3fc0dd7f Binary files /dev/null and b/official/x.35/Lib/D11/dclcxSchedulerGridD11.dcp differ diff --git a/official/x.35/Lib/D11/dclcxSchedulerGridD11.dcu b/official/x.35/Lib/D11/dclcxSchedulerGridD11.dcu new file mode 100644 index 00000000..b59fc93f Binary files /dev/null and b/official/x.35/Lib/D11/dclcxSchedulerGridD11.dcu differ diff --git a/official/x.35/Lib/D11/dclcxTreeListD11.bpl b/official/x.35/Lib/D11/dclcxTreeListD11.bpl new file mode 100644 index 00000000..d82ffb22 Binary files /dev/null and b/official/x.35/Lib/D11/dclcxTreeListD11.bpl differ diff --git a/official/x.35/Lib/D11/dclcxTreeListD11.dcp b/official/x.35/Lib/D11/dclcxTreeListD11.dcp new file mode 100644 index 00000000..9b69f9c7 Binary files /dev/null and b/official/x.35/Lib/D11/dclcxTreeListD11.dcp differ diff --git a/official/x.35/Lib/D11/dclcxTreeListD11.dcu b/official/x.35/Lib/D11/dclcxTreeListD11.dcu new file mode 100644 index 00000000..e4512830 Binary files /dev/null and b/official/x.35/Lib/D11/dclcxTreeListD11.dcu differ diff --git a/official/x.35/Lib/D11/dclcxVerticalGridD11.bpl b/official/x.35/Lib/D11/dclcxVerticalGridD11.bpl new file mode 100644 index 00000000..d40ac58c Binary files /dev/null and b/official/x.35/Lib/D11/dclcxVerticalGridD11.bpl differ diff --git a/official/x.35/Lib/D11/dclcxVerticalGridD11.dcp b/official/x.35/Lib/D11/dclcxVerticalGridD11.dcp new file mode 100644 index 00000000..0935832c Binary files /dev/null and b/official/x.35/Lib/D11/dclcxVerticalGridD11.dcp differ diff --git a/official/x.35/Lib/D11/dclcxVerticalGridD11.dcu b/official/x.35/Lib/D11/dclcxVerticalGridD11.dcu new file mode 100644 index 00000000..4fdf6c70 Binary files /dev/null and b/official/x.35/Lib/D11/dclcxVerticalGridD11.dcu differ diff --git a/official/x.35/Lib/D11/dcldxBarD11.bpl b/official/x.35/Lib/D11/dcldxBarD11.bpl new file mode 100644 index 00000000..49bcc759 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxBarD11.bpl differ diff --git a/official/x.35/Lib/D11/dcldxBarD11.dcp b/official/x.35/Lib/D11/dcldxBarD11.dcp new file mode 100644 index 00000000..3a5fd789 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxBarD11.dcp differ diff --git a/official/x.35/Lib/D11/dcldxBarD11.dcu b/official/x.35/Lib/D11/dcldxBarD11.dcu new file mode 100644 index 00000000..464a436d Binary files /dev/null and b/official/x.35/Lib/D11/dcldxBarD11.dcu differ diff --git a/official/x.35/Lib/D11/dcldxBarDBNavD11.bpl b/official/x.35/Lib/D11/dcldxBarDBNavD11.bpl new file mode 100644 index 00000000..7a5320cc Binary files /dev/null and b/official/x.35/Lib/D11/dcldxBarDBNavD11.bpl differ diff --git a/official/x.35/Lib/D11/dcldxBarDBNavD11.dcp b/official/x.35/Lib/D11/dcldxBarDBNavD11.dcp new file mode 100644 index 00000000..d9c571d8 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxBarDBNavD11.dcp differ diff --git a/official/x.35/Lib/D11/dcldxBarDBNavD11.dcu b/official/x.35/Lib/D11/dcldxBarDBNavD11.dcu new file mode 100644 index 00000000..7198b6a2 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxBarDBNavD11.dcu differ diff --git a/official/x.35/Lib/D11/dcldxBarExtDBItemsD11.bpl b/official/x.35/Lib/D11/dcldxBarExtDBItemsD11.bpl new file mode 100644 index 00000000..b3aa1a80 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxBarExtDBItemsD11.bpl differ diff --git a/official/x.35/Lib/D11/dcldxBarExtDBItemsD11.dcp b/official/x.35/Lib/D11/dcldxBarExtDBItemsD11.dcp new file mode 100644 index 00000000..8bedf5ee Binary files /dev/null and b/official/x.35/Lib/D11/dcldxBarExtDBItemsD11.dcp differ diff --git a/official/x.35/Lib/D11/dcldxBarExtDBItemsD11.dcu b/official/x.35/Lib/D11/dcldxBarExtDBItemsD11.dcu new file mode 100644 index 00000000..f6301b7e Binary files /dev/null and b/official/x.35/Lib/D11/dcldxBarExtDBItemsD11.dcu differ diff --git a/official/x.35/Lib/D11/dcldxBarExtItemsD11.bpl b/official/x.35/Lib/D11/dcldxBarExtItemsD11.bpl new file mode 100644 index 00000000..5164c485 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxBarExtItemsD11.bpl differ diff --git a/official/x.35/Lib/D11/dcldxBarExtItemsD11.dcp b/official/x.35/Lib/D11/dcldxBarExtItemsD11.dcp new file mode 100644 index 00000000..2958ba39 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxBarExtItemsD11.dcp differ diff --git a/official/x.35/Lib/D11/dcldxBarExtItemsD11.dcu b/official/x.35/Lib/D11/dcldxBarExtItemsD11.dcu new file mode 100644 index 00000000..18eba5eb Binary files /dev/null and b/official/x.35/Lib/D11/dcldxBarExtItemsD11.dcu differ diff --git a/official/x.35/Lib/D11/dcldxDockingD11.bpl b/official/x.35/Lib/D11/dcldxDockingD11.bpl new file mode 100644 index 00000000..127cd27b Binary files /dev/null and b/official/x.35/Lib/D11/dcldxDockingD11.bpl differ diff --git a/official/x.35/Lib/D11/dcldxDockingD11.dcp b/official/x.35/Lib/D11/dcldxDockingD11.dcp new file mode 100644 index 00000000..5080bad8 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxDockingD11.dcp differ diff --git a/official/x.35/Lib/D11/dcldxDockingD11.dcu b/official/x.35/Lib/D11/dcldxDockingD11.dcu new file mode 100644 index 00000000..c204ec40 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxDockingD11.dcu differ diff --git a/official/x.35/Lib/D11/dcldxLayoutControlD11.bpl b/official/x.35/Lib/D11/dcldxLayoutControlD11.bpl new file mode 100644 index 00000000..1793a9fb Binary files /dev/null and b/official/x.35/Lib/D11/dcldxLayoutControlD11.bpl differ diff --git a/official/x.35/Lib/D11/dcldxLayoutControlD11.dcp b/official/x.35/Lib/D11/dcldxLayoutControlD11.dcp new file mode 100644 index 00000000..827157db Binary files /dev/null and b/official/x.35/Lib/D11/dcldxLayoutControlD11.dcp differ diff --git a/official/x.35/Lib/D11/dcldxLayoutControlD11.dcu b/official/x.35/Lib/D11/dcldxLayoutControlD11.dcu new file mode 100644 index 00000000..b74a8636 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxLayoutControlD11.dcu differ diff --git a/official/x.35/Lib/D11/dcldxNavBarD11.bpl b/official/x.35/Lib/D11/dcldxNavBarD11.bpl new file mode 100644 index 00000000..66198a08 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxNavBarD11.bpl differ diff --git a/official/x.35/Lib/D11/dcldxNavBarD11.dcp b/official/x.35/Lib/D11/dcldxNavBarD11.dcp new file mode 100644 index 00000000..e32116cb Binary files /dev/null and b/official/x.35/Lib/D11/dcldxNavBarD11.dcp differ diff --git a/official/x.35/Lib/D11/dcldxNavBarD11.dcu b/official/x.35/Lib/D11/dcldxNavBarD11.dcu new file mode 100644 index 00000000..f7d32a12 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxNavBarD11.dcu differ diff --git a/official/x.35/Lib/D11/dcldxPSCoreD11.bpl b/official/x.35/Lib/D11/dcldxPSCoreD11.bpl new file mode 100644 index 00000000..0cec27ce Binary files /dev/null and b/official/x.35/Lib/D11/dcldxPSCoreD11.bpl differ diff --git a/official/x.35/Lib/D11/dcldxPSCoreD11.dcp b/official/x.35/Lib/D11/dcldxPSCoreD11.dcp new file mode 100644 index 00000000..e781e9ae Binary files /dev/null and b/official/x.35/Lib/D11/dcldxPSCoreD11.dcp differ diff --git a/official/x.35/Lib/D11/dcldxPSCoreD11.dcu b/official/x.35/Lib/D11/dcldxPSCoreD11.dcu new file mode 100644 index 00000000..87c36c1e Binary files /dev/null and b/official/x.35/Lib/D11/dcldxPSCoreD11.dcu differ diff --git a/official/x.35/Lib/D11/dcldxRibbonD11.bpl b/official/x.35/Lib/D11/dcldxRibbonD11.bpl new file mode 100644 index 00000000..ceea368b Binary files /dev/null and b/official/x.35/Lib/D11/dcldxRibbonD11.bpl differ diff --git a/official/x.35/Lib/D11/dcldxRibbonD11.dcp b/official/x.35/Lib/D11/dcldxRibbonD11.dcp new file mode 100644 index 00000000..967bddd3 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxRibbonD11.dcp differ diff --git a/official/x.35/Lib/D11/dcldxRibbonD11.dcu b/official/x.35/Lib/D11/dcldxRibbonD11.dcu new file mode 100644 index 00000000..3b2eccb1 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxRibbonD11.dcu differ diff --git a/official/x.35/Lib/D11/dcldxSkinsCoreD11.bpl b/official/x.35/Lib/D11/dcldxSkinsCoreD11.bpl new file mode 100644 index 00000000..02246220 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinsCoreD11.bpl differ diff --git a/official/x.35/Lib/D11/dcldxSkinsCoreD11.dcp b/official/x.35/Lib/D11/dcldxSkinsCoreD11.dcp new file mode 100644 index 00000000..e896beb1 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinsCoreD11.dcp differ diff --git a/official/x.35/Lib/D11/dcldxSkinsCoreD11.dcu b/official/x.35/Lib/D11/dcldxSkinsCoreD11.dcu new file mode 100644 index 00000000..15e38af0 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinsCoreD11.dcu differ diff --git a/official/x.35/Lib/D11/dcldxSkinsDesignHelperD11.bpl b/official/x.35/Lib/D11/dcldxSkinsDesignHelperD11.bpl new file mode 100644 index 00000000..f6447a70 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinsDesignHelperD11.bpl differ diff --git a/official/x.35/Lib/D11/dcldxSkinsDesignHelperD11.dcp b/official/x.35/Lib/D11/dcldxSkinsDesignHelperD11.dcp new file mode 100644 index 00000000..a748a363 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinsDesignHelperD11.dcp differ diff --git a/official/x.35/Lib/D11/dcldxSkinsDesignHelperD11.dcu b/official/x.35/Lib/D11/dcldxSkinsDesignHelperD11.dcu new file mode 100644 index 00000000..082d3af7 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinsDesignHelperD11.dcu differ diff --git a/official/x.35/Lib/D11/dcldxSkinscxPCPainterD11.bpl b/official/x.35/Lib/D11/dcldxSkinscxPCPainterD11.bpl new file mode 100644 index 00000000..83ae8195 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinscxPCPainterD11.bpl differ diff --git a/official/x.35/Lib/D11/dcldxSkinscxPCPainterD11.dcp b/official/x.35/Lib/D11/dcldxSkinscxPCPainterD11.dcp new file mode 100644 index 00000000..6d1154ea Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinscxPCPainterD11.dcp differ diff --git a/official/x.35/Lib/D11/dcldxSkinscxPCPainterD11.dcu b/official/x.35/Lib/D11/dcldxSkinscxPCPainterD11.dcu new file mode 100644 index 00000000..d2b68d7e Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinscxPCPainterD11.dcu differ diff --git a/official/x.35/Lib/D11/dcldxSkinscxScheduler3PainterD11.bpl b/official/x.35/Lib/D11/dcldxSkinscxScheduler3PainterD11.bpl new file mode 100644 index 00000000..4a31f6e9 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinscxScheduler3PainterD11.bpl differ diff --git a/official/x.35/Lib/D11/dcldxSkinscxScheduler3PainterD11.dcp b/official/x.35/Lib/D11/dcldxSkinscxScheduler3PainterD11.dcp new file mode 100644 index 00000000..f28937c6 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinscxScheduler3PainterD11.dcp differ diff --git a/official/x.35/Lib/D11/dcldxSkinscxScheduler3PainterD11.dcu b/official/x.35/Lib/D11/dcldxSkinscxScheduler3PainterD11.dcu new file mode 100644 index 00000000..92b1c5ce Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinscxScheduler3PainterD11.dcu differ diff --git a/official/x.35/Lib/D11/dcldxSkinsdxBarsPaintersD11.bpl b/official/x.35/Lib/D11/dcldxSkinsdxBarsPaintersD11.bpl new file mode 100644 index 00000000..d7d34dca Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinsdxBarsPaintersD11.bpl differ diff --git a/official/x.35/Lib/D11/dcldxSkinsdxBarsPaintersD11.dcu b/official/x.35/Lib/D11/dcldxSkinsdxBarsPaintersD11.dcu new file mode 100644 index 00000000..de3df9ad Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinsdxBarsPaintersD11.dcu differ diff --git a/official/x.35/Lib/D11/dcldxSkinsdxBarsPaintersD7.dcp b/official/x.35/Lib/D11/dcldxSkinsdxBarsPaintersD7.dcp new file mode 100644 index 00000000..d47747ac Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinsdxBarsPaintersD7.dcp differ diff --git a/official/x.35/Lib/D11/dcldxSkinsdxLCPainterD11.bpl b/official/x.35/Lib/D11/dcldxSkinsdxLCPainterD11.bpl new file mode 100644 index 00000000..f03f5abf Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinsdxLCPainterD11.bpl differ diff --git a/official/x.35/Lib/D11/dcldxSkinsdxLCPainterD11.dcp b/official/x.35/Lib/D11/dcldxSkinsdxLCPainterD11.dcp new file mode 100644 index 00000000..e5426127 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinsdxLCPainterD11.dcp differ diff --git a/official/x.35/Lib/D11/dcldxSkinsdxLCPainterD11.dcu b/official/x.35/Lib/D11/dcldxSkinsdxLCPainterD11.dcu new file mode 100644 index 00000000..afc742a9 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinsdxLCPainterD11.dcu differ diff --git a/official/x.35/Lib/D11/dcldxSkinsdxNavBar2PainterD11.bpl b/official/x.35/Lib/D11/dcldxSkinsdxNavBar2PainterD11.bpl new file mode 100644 index 00000000..94bdbae7 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinsdxNavBar2PainterD11.bpl differ diff --git a/official/x.35/Lib/D11/dcldxSkinsdxNavBar2PainterD11.dcp b/official/x.35/Lib/D11/dcldxSkinsdxNavBar2PainterD11.dcp new file mode 100644 index 00000000..12a6fd81 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinsdxNavBar2PainterD11.dcp differ diff --git a/official/x.35/Lib/D11/dcldxSkinsdxNavBar2PainterD11.dcu b/official/x.35/Lib/D11/dcldxSkinsdxNavBar2PainterD11.dcu new file mode 100644 index 00000000..9e31ed11 Binary files /dev/null and b/official/x.35/Lib/D11/dcldxSkinsdxNavBar2PainterD11.dcu differ diff --git a/official/x.35/Lib/D11/dxBar.dcu b/official/x.35/Lib/D11/dxBar.dcu new file mode 100644 index 00000000..6a023e0b Binary files /dev/null and b/official/x.35/Lib/D11/dxBar.dcu differ diff --git a/official/x.35/Lib/D11/dxBar.res b/official/x.35/Lib/D11/dxBar.res new file mode 100644 index 00000000..14681a0c Binary files /dev/null and b/official/x.35/Lib/D11/dxBar.res differ diff --git a/official/x.35/Lib/D11/dxBarAccessibility.dcu b/official/x.35/Lib/D11/dxBarAccessibility.dcu new file mode 100644 index 00000000..3e6785b1 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarAccessibility.dcu differ diff --git a/official/x.35/Lib/D11/dxBarAddGroupItemsEd.dcu b/official/x.35/Lib/D11/dxBarAddGroupItemsEd.dcu new file mode 100644 index 00000000..5979de0e Binary files /dev/null and b/official/x.35/Lib/D11/dxBarAddGroupItemsEd.dcu differ diff --git a/official/x.35/Lib/D11/dxBarAddGroupItemsEd.dfm b/official/x.35/Lib/D11/dxBarAddGroupItemsEd.dfm new file mode 100644 index 00000000..3795a17c --- /dev/null +++ b/official/x.35/Lib/D11/dxBarAddGroupItemsEd.dfm @@ -0,0 +1,96 @@ +object frmAddGroupItems: TfrmAddGroupItems + Left = 209 + Top = 107 + Width = 364 + Height = 400 + Caption = 'Add Group Items' + Color = clBtnFace + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object Panel2: TPanel + Left = 0 + Top = 5 + Width = 5 + Height = 334 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + end + object Panel3: TPanel + Left = 351 + Top = 5 + Width = 5 + Height = 334 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + end + object Panel4: TPanel + Left = 0 + Top = 0 + Width = 356 + Height = 5 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + end + object lbGroupItems: TListBox + Left = 5 + Top = 5 + Width = 346 + Height = 334 + Align = alClient + ItemHeight = 16 + MultiSelect = True + Style = lbOwnerDrawVariable + TabOrder = 3 + OnDrawItem = lbGroupItemsDrawItem + OnMeasureItem = lbGroupItemsMeasureItem + end + object Panel1: TPanel + Left = 0 + Top = 339 + Width = 356 + Height = 34 + Align = alBottom + BevelOuter = bvNone + TabOrder = 4 + object Panel5: TPanel + Left = 191 + Top = 0 + Width = 165 + Height = 34 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btnOk: TButton + Left = 0 + Top = 7 + Width = 76 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object btnCancel: TButton + Left = 84 + Top = 7 + Width = 76 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + end + end +end diff --git a/official/x.35/Lib/D11/dxBarCommon.dcu b/official/x.35/Lib/D11/dxBarCommon.dcu new file mode 100644 index 00000000..444f9034 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarCommon.dcu differ diff --git a/official/x.35/Lib/D11/dxBarConverter.dcr b/official/x.35/Lib/D11/dxBarConverter.dcr new file mode 100644 index 00000000..07d83994 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarConverter.dcr differ diff --git a/official/x.35/Lib/D11/dxBarConverter.dcu b/official/x.35/Lib/D11/dxBarConverter.dcu new file mode 100644 index 00000000..0d91644b Binary files /dev/null and b/official/x.35/Lib/D11/dxBarConverter.dcu differ diff --git a/official/x.35/Lib/D11/dxBarCustForm.dcu b/official/x.35/Lib/D11/dxBarCustForm.dcu new file mode 100644 index 00000000..d01abf0b Binary files /dev/null and b/official/x.35/Lib/D11/dxBarCustForm.dcu differ diff --git a/official/x.35/Lib/D11/dxBarCustForm.dfm b/official/x.35/Lib/D11/dxBarCustForm.dfm new file mode 100644 index 00000000..bcc641ea --- /dev/null +++ b/official/x.35/Lib/D11/dxBarCustForm.dfm @@ -0,0 +1,1420 @@ +object dxBarCustomizingForm: TdxBarCustomizingForm + Left = 707 + Top = 171 + BorderIcons = [biSystemMenu] + Caption = 'Customize' + ClientHeight = 310 + ClientWidth = 366 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + OnClose = FormClose + OnCreate = FormCreate + OnDestroy = FormDestroy + OnHide = FormHide + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 0 + Top = 274 + Width = 366 + Height = 36 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object BClose: TButton + Left = 285 + Top = 8 + Width = 75 + Height = 23 + Cancel = True + Caption = 'Close' + Default = True + ModalResult = 1 + TabOrder = 1 + OnClick = BCloseClick + end + object BHelp: TBitBtn + Left = 6 + Top = 8 + Width = 24 + Height = 23 + TabOrder = 0 + OnClick = BHelpClick + Style = bsNew + end + end + object PageControl: TPageControl + Left = 6 + Top = 8 + Width = 354 + Height = 266 + ActivePage = tsToolbars + Align = alClient + TabOrder = 0 + object tsToolbars: TTabSheet + Caption = ' Toolbars ' + object LabelToobars: TLabel + Left = 4 + Top = 4 + Width = 44 + Height = 13 + Caption = 'Toolb&ars:' + end + object BBarDelete: TButton + Left = 239 + Top = 79 + Width = 104 + Height = 22 + Action = aDeleteToolBar + TabOrder = 3 + end + object BBarNew: TButton + Left = 239 + Top = 21 + Width = 104 + Height = 22 + Action = aNewToolBar + TabOrder = 1 + end + object BBarRename: TButton + Left = 239 + Top = 50 + Width = 104 + Height = 22 + Action = aRenameToolBar + TabOrder = 2 + end + object lbBarsList: TListBox + Left = 4 + Top = 20 + Width = 227 + Height = 213 + Style = lbOwnerDrawFixed + Anchors = [akLeft, akTop, akBottom] + ItemHeight = 13 + TabOrder = 0 + OnClick = lbBarsListClick + OnDblClick = lbBarsListDblClick + OnDrawItem = lbBarsListDrawItem + OnKeyDown = lbBarsListKeyDown + OnMouseDown = lbBarsListMouseDown + end + object BBarReset: TButton + Left = 239 + Top = 108 + Width = 104 + Height = 22 + Action = aResetToolBar + TabOrder = 4 + end + end + object tsItems: TTabSheet + Caption = ' Commands ' + object Panel6: TPanel + Left = 0 + Top = 0 + Width = 346 + Height = 25 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object LabelCategories: TLabel + Left = 6 + Top = 8 + Width = 53 + Height = 13 + Caption = 'Cate&gories:' + FocusControl = lbCategories + end + object LabelCommands: TLabel + Left = 148 + Top = 8 + Width = 55 + Height = 13 + Caption = 'Comman&ds:' + end + object CategoriesPopupButtonPlace: TSpeedButton + Left = 65 + Top = 6 + Width = 75 + Height = 17 + end + object CommandsPopupButtonPlace: TSpeedButton + Left = 207 + Top = 6 + Width = 134 + Height = 17 + end + end + object Panel7: TPanel + Left = 5 + Top = 25 + Width = 336 + Height = 213 + Align = alClient + BevelOuter = bvNone + Caption = 'Panel7' + TabOrder = 1 + object lbCategories: TListBox + Left = 0 + Top = 0 + Width = 135 + Height = 147 + Align = alLeft + ItemHeight = 13 + TabOrder = 0 + OnClick = lbCategoriesClick + OnDragOver = lbCategoriesDragOver + OnEndDrag = lbCategoriesEndDrag + OnKeyDown = lbCategoriesKeyDown + OnMouseDown = lbCategoriesMouseDown + end + object lbItems: TListBox + Left = 142 + Top = 0 + Width = 194 + Height = 147 + Style = lbOwnerDrawFixed + Align = alRight + Color = clBtnFace + ItemHeight = 22 + TabOrder = 1 + OnClick = lbItemsClick + OnDblClick = lbItemsDblClick + OnDrawItem = lbItemsDrawItem + OnKeyDown = lbItemsKeyDown + OnMeasureItem = lbItemsMeasureItem + OnMouseDown = lbItemsMouseDown + OnMouseUp = lbItemsMouseUp + end + object Panel9: TPanel + Left = 0 + Top = 147 + Width = 336 + Height = 66 + Align = alBottom + BevelOuter = bvNone + TabOrder = 2 + object DescriptionLabel: TLabel + Left = 0 + Top = 20 + Width = 335 + Height = 40 + AutoSize = False + WordWrap = True + end + object Bevel1: TBevel + Left = 0 + Top = 10 + Width = 337 + Height = 5 + Shape = bsTopLine + end + object LabelDescription: TLabel + Left = 0 + Top = 4 + Width = 59 + Height = 13 + Caption = 'Description ' + end + end + end + object Panel5: TPanel + Left = 0 + Top = 25 + Width = 5 + Height = 213 + Align = alLeft + BevelOuter = bvNone + TabOrder = 2 + end + object Panel8: TPanel + Left = 341 + Top = 25 + Width = 5 + Height = 213 + Align = alRight + BevelOuter = bvNone + TabOrder = 3 + end + end + object tsOptions: TTabSheet + Caption = ' Options ' + object StandardOptionsPanel: TPanel + Left = 0 + Top = 0 + Width = 346 + Height = 238 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object LabelMenuAnimations: TLabel + Left = 24 + Top = 152 + Width = 83 + Height = 13 + Caption = '&Menu animations:' + FocusControl = ComboBoxMenuAnimations + end + object ComboBoxMenuAnimations: TComboBox + Left = 134 + Top = 148 + Width = 93 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 3 + OnClick = ComboBoxMenuAnimationsClick + Items.Strings = ( + '(None)' + 'Random' + 'Unfold' + 'Slide') + end + object CBHint1: TCheckBox + Left = 24 + Top = 63 + Width = 301 + Height = 17 + Caption = 'Show Tool&Tips on toolbars' + TabOrder = 1 + OnClick = CBHint1Click + end + object CBHint2: TCheckBox + Left = 24 + Top = 85 + Width = 301 + Height = 17 + Caption = 'Show s&hortcut keys in ToolTips' + TabOrder = 2 + OnClick = CBHint2Click + end + object CBLargeIcons: TCheckBox + Left = 24 + Top = 38 + Width = 301 + Height = 17 + Caption = '&Large icons' + TabOrder = 0 + OnClick = CBLargeIconsClick + end + end + object EnhancedOptionsPanel: TPanel + Left = 0 + Top = 0 + Width = 346 + Height = 238 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + object Label1: TLabel + Left = 20 + Top = 200 + Width = 83 + Height = 13 + Caption = '&Menu animations:' + FocusControl = ComboBoxMenuAnimationsEx + end + object Bevel2: TBevel + Left = 12 + Top = 122 + Width = 317 + Height = 9 + Shape = bsTopLine + end + object Label2: TLabel + Left = 12 + Top = 116 + Width = 32 + Height = 13 + Caption = 'Other ' + end + object Bevel3: TBevel + Left = 12 + Top = 18 + Width = 317 + Height = 7 + Shape = bsTopLine + end + object Label3: TLabel + Left = 12 + Top = 12 + Width = 166 + Height = 13 + Caption = 'Personalized Menus and Toolbars ' + end + object ComboBoxMenuAnimationsEx: TComboBox + Left = 132 + Top = 196 + Width = 93 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 6 + OnClick = ComboBoxMenuAnimationsClick + Items.Strings = ( + '(None)' + 'Random' + 'Unfold' + 'Slide') + end + object CBHint1Ex: TCheckBox + Left = 20 + Top = 152 + Width = 309 + Height = 17 + Caption = 'Show Tool&Tips on toolbars' + TabOrder = 4 + OnClick = CBHint1ExClick + end + object CBHint2Ex: TCheckBox + Left = 36 + Top = 172 + Width = 293 + Height = 17 + Caption = 'Show s&hortcut keys in ToolTips' + TabOrder = 5 + OnClick = CBHint2Click + end + object CBLargeIconsEx: TCheckBox + Left = 20 + Top = 132 + Width = 309 + Height = 17 + Caption = '&Large icons' + TabOrder = 3 + OnClick = CBLargeIconsClick + end + object CBMenusShowRecentItemsFirst: TCheckBox + Left = 20 + Top = 32 + Width = 309 + Height = 17 + Caption = 'Me&nus show recently used commands first' + TabOrder = 0 + OnClick = CBMenusShowRecentItemsFirstClick + end + object CBShowFullMenusAfterDelay: TCheckBox + Left = 36 + Top = 52 + Width = 293 + Height = 17 + Caption = 'Show f&ull menus after a short delay' + TabOrder = 1 + OnClick = CBShowFullMenusAfterDelayClick + end + object BResetUsageData: TButton + Left = 20 + Top = 76 + Width = 119 + Height = 22 + Caption = '&Reset my usage data' + TabOrder = 2 + OnClick = BResetUsageDataClick + end + end + end + object tsCommands: TTabSheet + Caption = ' All commands ' + object LAllCommands: TListBox + Left = 6 + Top = 8 + Width = 333 + Height = 200 + Style = lbOwnerDrawFixed + Anchors = [akLeft, akTop, akBottom] + ItemHeight = 16 + MultiSelect = True + TabOrder = 0 + OnClick = LAllCommandsClick + OnDrawItem = LAllCommandsDrawItem + end + object CBShowCommandsWithShortCut: TCheckBox + Left = 6 + Top = 216 + Width = 333 + Height = 17 + Anchors = [akLeft, akBottom] + Caption = 'Show commands that may have a shortcut' + Checked = True + State = cbChecked + TabOrder = 1 + OnClick = CBShowCommandsWithShortCutClick + end + end + object tsGroups: TTabSheet + Caption = 'Groups' + object Bevel4: TBevel + Left = 171 + Top = 0 + Width = 4 + Height = 238 + Align = alLeft + Shape = bsSpacer + end + object gpGroupItems: TGroupBox + Left = 175 + Top = 0 + Width = 171 + Height = 238 + Align = alClient + Caption = ' Items ' + TabOrder = 0 + object lbGroupItems: TListBox + Left = 2 + Top = 44 + Width = 167 + Height = 192 + Style = lbOwnerDrawVariable + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + TabOrder = 0 + OnClick = lbGroupItemsClick + OnDrawItem = lbGroupItemsDrawItem + OnKeyDown = lbGroupItemsKeyDown + OnMeasureItem = lbGroupsMeasureItem + end + object tbGroupItems: TToolBar + Left = 2 + Top = 15 + Width = 167 + Height = 29 + Caption = 'tbGroupItems' + EdgeBorders = [ebBottom] + EdgeOuter = esNone + Flat = True + Images = imgGroups + ParentShowHint = False + ShowHint = True + TabOrder = 1 + object btnAddGroupItem: TToolButton + Left = 0 + Top = 0 + Hint = 'Add Item... (Ins)' + Action = aAddGroupItem + Caption = 'Add...' + end + object btnDeleteGroupItem: TToolButton + Left = 23 + Top = 0 + Hint = 'Delete Item (Del)' + Action = aDeleteGroupItem + end + object ToolButton8: TToolButton + Left = 46 + Top = 0 + Width = 8 + Caption = 'ToolButton8' + ImageIndex = 2 + Style = tbsSeparator + end + object btnMoveUpGroupItem: TToolButton + Left = 54 + Top = 0 + Hint = 'Move Up Item' + Action = aMoveUpGroupItem + Caption = 'Up' + end + object btnMoveDownGroupItem: TToolButton + Left = 77 + Top = 0 + Hint = 'Move Down Item' + Action = aMoveDownGroupItem + Caption = 'Down' + end + end + end + object gbGroups: TGroupBox + Left = 0 + Top = 0 + Width = 171 + Height = 238 + Align = alLeft + Caption = ' Groups ' + TabOrder = 1 + object lbGroups: TListBox + Left = 2 + Top = 44 + Width = 167 + Height = 192 + Style = lbOwnerDrawVariable + Align = alClient + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + TabOrder = 0 + OnClick = lbGroupsClick + OnDrawItem = lbGroupsDrawItem + OnKeyDown = lbGroupsKeyDown + OnMeasureItem = lbGroupsMeasureItem + end + object tbGroups: TToolBar + Left = 2 + Top = 15 + Width = 167 + Height = 29 + Caption = 'tbGroups' + EdgeBorders = [ebBottom] + EdgeOuter = esNone + Flat = True + Images = imgGroups + ParentShowHint = False + ShowHint = True + TabOrder = 1 + object btnAddGroup: TToolButton + Left = 0 + Top = 0 + Action = aAddGroup + Caption = 'Add' + end + object btnDeleteGroup: TToolButton + Left = 23 + Top = 0 + Action = aDeleteGroup + Caption = 'Delete' + end + object ToolButton3: TToolButton + Left = 46 + Top = 0 + Width = 8 + Caption = 'ToolButton3' + ImageIndex = 2 + Style = tbsSeparator + end + object btnMoveUpGroup: TToolButton + Left = 54 + Top = 0 + Action = aMoveUpGroup + AllowAllUp = True + Caption = 'Up' + end + object btnMoveDownGroup: TToolButton + Left = 77 + Top = 0 + Action = aMoveDownGroup + Caption = 'Down' + end + end + end + end + object TabSheet1: TTabSheet + Caption = 'Key Tips' + ImageIndex = 5 + TabVisible = False + object tvKeyTips: TTreeView + Left = 11 + Top = 13 + Width = 314 + Height = 204 + Indent = 19 + TabOrder = 0 + end + end + end + object Panel2: TPanel + Left = 0 + Top = 8 + Width = 6 + Height = 266 + Align = alLeft + BevelOuter = bvNone + TabOrder = 2 + end + object Panel3: TPanel + Left = 360 + Top = 8 + Width = 6 + Height = 266 + Align = alRight + BevelOuter = bvNone + TabOrder = 3 + end + object Panel4: TPanel + Left = 0 + Top = 0 + Width = 366 + Height = 8 + Align = alTop + BevelOuter = bvNone + TabOrder = 4 + end + object BarManager1: TdxBarManager + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Categories.Strings = ( + 'Categories' + 'Commands') + Categories.ItemsVisibles = ( + 2 + 2) + Categories.Visibles = ( + True + True) + PopupMenuLinks = <> + StretchGlyphs = False + UseSystemFont = False + Left = 170 + Top = 278 + DockControlHeights = ( + 0 + 0 + 0 + 0) + object CategoriesAdd: TdxBarButton + Caption = 'Add...' + Category = 0 + Hint = 'Add' + Visible = ivAlways + Glyph.Data = { + F6000000424DF600000000000000760000002800000010000000100000000100 + 0400000000008000000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888 + 888888888888888888888800000000000888880FFFFFFFFF0888880FFFFFFFFF + 0888880FFFFFFFFF0888880FFFFFFFFF0888880FFFFFFFFF0888880FFFFFFFFF + 0888880FFFFFFFFF0888880FFFFFFFFF0888880FFFFFF0000888880FFFFFF0F0 + 8888880FFFFFF008888888000000008888888888888888888888} + OnClick = CategoriesAddClick + end + object CategoriesInsert: TdxBarButton + Caption = 'Insert...' + Category = 0 + Hint = 'Insert' + Visible = ivAlways + ShortCut = 45 + OnClick = CategoriesInsertClick + end + object CategoriesRename: TdxBarButton + Caption = 'Rename...' + Category = 0 + Hint = 'Rename' + Visible = ivAlways + OnClick = CategoriesRenameClick + end + object CategoriesVisible: TdxBarButton + Caption = 'Visible' + Category = 0 + Hint = 'Visible' + Visible = ivAlways + ButtonStyle = bsChecked + OnClick = CategoriesVisibleClick + end + object CommandsAdd: TdxBarButton + Caption = 'Add...' + Category = 1 + Hint = 'Add' + Visible = ivAlways + Glyph.Data = { + F6000000424DF600000000000000760000002800000010000000100000000100 + 0400000000008000000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888 + 888888888888888888888800000000000888880FFFFFFFFF0888880FFFFFFFFF + 0888880FFFFFFFFF0888880FFFFFFFFF0888880FFFFFFFFF0888880FFFFFFFFF + 0888880FFFFFFFFF0888880FFFFFFFFF0888880FFFFFF0000888880FFFFFF0F0 + 8888880FFFFFF008888888000000008888888888888888888888} + ShortCut = 45 + OnClick = CommandsAddClick + end + object CommandsDelete: TdxBarButton + Caption = 'Delete' + Category = 1 + Hint = 'Delete' + Visible = ivAlways + Glyph.Data = { + EE000000424DEE000000000000007600000028000000100000000F0000000100 + 0400000000007800000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888 + 888888888888888880F88880F8888888888888000F8888880F8888000F888880 + F888888000F88800F8888888000F800F88888888800000F88888888888000F88 + 88888888800000F888888888000F80F88888880000F88800F88880000F888880 + 0F88800F8888888800F88888888888888888} + ShortCut = 46 + OnClick = CommandsDeleteClick + end + object CommandsClear: TdxBarButton + Caption = 'Clear' + Category = 1 + Hint = 'Clear' + Visible = ivAlways + OnClick = CommandsClearClick + end + object CommandsMoveUp: TdxBarButton + Caption = 'Move Up' + Category = 1 + Hint = 'Move Up' + Visible = ivAlways + Glyph.Data = { + F6000000424DF600000000000000760000002800000010000000100000000100 + 0400000000008000000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888 + 8888888888888888888888888888888888888888800000888888888880666088 + 8888888880666088888888888066608888888800006660000888888066666660 + 8888888806666608888888888066608888888888880608888888888888808888 + 8888888888888888888888888888888888888888888888888888} + ShortCut = 16422 + OnClick = CommandsMoveUpClick + end + object CommandsMoveDown: TdxBarButton + Caption = 'Move Down' + Category = 1 + Hint = 'Move Down' + Visible = ivAlways + Glyph.Data = { + F6000000424DF600000000000000760000002800000010000000100000000100 + 0400000000008000000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888 + 8888888888888888888888888888888888888888888088888888888888060888 + 8888888880666088888888880666660888888880666666608888880000666000 + 0888888880666088888888888066608888888888806660888888888880000088 + 8888888888888888888888888888888888888888888888888888} + ShortCut = 16424 + OnClick = CommandsMoveDownClick + end + object CommandsSubMenuEditor: TdxBarButton + Caption = 'SubMenu Editor...' + Category = 1 + Hint = 'SubMenu Editor' + Visible = ivAlways + OnClick = CommandsSubMenuEditorClick + end + object CategoriesItemsVisible: TdxBarCombo + Caption = 'Items Visible:' + Category = 0 + Hint = 'Items Visible:' + Visible = ivAlways + OnChange = CategoriesItemsVisibleChange + Width = 100 + ShowEditor = False + Items.Strings = ( + 'Never' + 'InCustomizing' + 'Always') + ItemIndex = -1 + end + object CategoriesDelete: TdxBarButton + Caption = 'Delete' + Category = 0 + Hint = 'Delete' + Visible = ivAlways + Glyph.Data = { + EE000000424DEE000000000000007600000028000000100000000F0000000100 + 0400000000007800000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888 + 888888888888888880F88880F8888888888888000F8888880F8888000F888880 + F888888000F88800F8888888000F800F88888888800000F88888888888000F88 + 88888888800000F888888888000F80F88888880000F88800F88880000F888880 + 0F88800F8888888800F88888888888888888} + ShortCut = 46 + OnClick = CategoriesDeleteClick + end + end + object CategoriesPopupMenu: TdxBarPopupMenu + BarManager = BarManager1 + ItemLinks = < + item + Visible = True + ItemName = 'CategoriesAdd' + end + item + Visible = True + ItemName = 'CategoriesInsert' + end + item + Visible = True + ItemName = 'CategoriesRename' + end + item + BeginGroup = True + Visible = True + ItemName = 'CategoriesVisible' + end + item + Visible = True + ItemName = 'CategoriesItemsVisible' + end + item + BeginGroup = True + Visible = True + ItemName = 'CategoriesDelete' + end> + UseOwnFont = False + OnPopup = CategoriesPopupMenuPopup + Left = 204 + Top = 278 + end + object CommandsPopupMenu: TdxBarPopupMenu + BarManager = BarManager1 + ItemLinks = < + item + Visible = True + ItemName = 'CommandsAdd' + end + item + Visible = True + ItemName = 'CommandsDelete' + end + item + Visible = True + ItemName = 'CommandsClear' + end + item + BeginGroup = True + Visible = True + ItemName = 'CommandsMoveUp' + end + item + Visible = True + ItemName = 'CommandsMoveDown' + end + item + BeginGroup = True + Visible = True + ItemName = 'CommandsSubMenuEditor' + end> + UseOwnFont = False + OnPopup = CommandsPopupMenuPopup + Left = 236 + Top = 278 + end + object alCustomize: TActionList + Images = imgGroups + Left = 136 + Top = 280 + object aAddItem: TAction + Category = 'Items' + Caption = 'Add Item' + ImageIndex = 4 + OnExecute = aAddItemExecute + end + object aAddGroup: TAction + Category = 'Groups' + Caption = 'Add Group' + Hint = 'Add Group (Ins)' + ImageIndex = 0 + OnExecute = aAddGroupExecute + end + object aDeleteGroup: TAction + Category = 'Groups' + Caption = 'Delete Group' + Hint = 'Delete Group (Del)' + ImageIndex = 1 + OnExecute = aDeleteGroupExecute + end + object aNewToolBar: TAction + Category = 'ToolBars' + Caption = '&New...' + OnExecute = aNewToolBarExecute + end + object aMoveUpGroup: TAction + Tag = -1 + Category = 'Groups' + Caption = 'Move Up Group' + Hint = 'Move Up Group' + ImageIndex = 2 + OnExecute = aMoveGroupExecute + end + object aRenameToolBar: TAction + Category = 'ToolBars' + Caption = 'R&ename...' + OnExecute = aRenameToolBarExecute + end + object aMoveDownGroup: TAction + Tag = 1 + Category = 'Groups' + Caption = 'Move Down Group' + Hint = 'Move Down Group' + ImageIndex = 3 + OnExecute = aMoveGroupExecute + end + object aDeleteToolBar: TAction + Category = 'ToolBars' + Caption = '&Delete' + OnExecute = aDeleteToolBarExecute + end + object aResetToolBar: TAction + Category = 'ToolBars' + Caption = '&Reset...' + OnExecute = aResetToolBarExecute + end + object aAddGroupItem: TAction + Category = 'GroupItems' + Caption = '&Add...' + ImageIndex = 0 + OnExecute = aAddGroupItemExecute + end + object aDeleteGroupItem: TAction + Category = 'GroupItems' + Caption = 'Delete' + ImageIndex = 1 + OnExecute = aDeleteGroupItemExecute + end + object aMoveUpGroupItem: TAction + Tag = -1 + Category = 'GroupItems' + Caption = 'Move Up Item' + ImageIndex = 2 + OnExecute = aMoveGroupItemExecute + end + object aMoveDownGroupItem: TAction + Tag = 1 + Category = 'GroupItems' + Caption = 'aMoveDownGroupItem' + ImageIndex = 3 + OnExecute = aMoveGroupItemExecute + end + object aDeleteItem: TAction + Category = 'Items' + Caption = 'Delete Item' + ImageIndex = 5 + OnExecute = aDeleteItemExecute + end + object aMoveUpItem: TAction + Tag = -1 + Category = 'Items' + Caption = 'Move Up' + ImageIndex = 2 + OnExecute = aMoveItemExecute + end + object aMoveDownItem: TAction + Tag = 1 + Category = 'Items' + Caption = 'Move Down' + ImageIndex = 3 + OnExecute = aMoveItemExecute + end + object aSubMenuEditor: TAction + Category = 'Items' + Caption = 'SubMenu Editor...' + OnExecute = aSubMenuEditorExecute + end + object aClearItemList: TAction + Category = 'Items' + Caption = 'Clear' + OnExecute = aClearItemListExecute + end + end + object imgGroups: TImageList + Left = 106 + Top = 280 + Bitmap = { + 494C010106000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 0000FFFFFF0000FFFF0000000000808080000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 0000FFFFFF0000FFFF0000000000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000000000C0C0 + C00000000000FFFFFF000000000080808000808080000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000000000C0C0 + C00000000000FFFFFF0000000000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000FF + FF00C0C0C0000000000000000000808080000000800000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000FF + FF00C0C0C0000000000000000000808080000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000808000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000 + 000000000000000000000000000080808000000080000000800000FFFF00FFFF + FF0000FFFF00FFFFFF00808080000000800000FFFF00FFFFFF00000000000000 + 0000000000000000000000000000808080000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000000000FFFFFF008080 + 800000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00000000008080800080808000000080008080800000FF + FF00FFFFFF00808080000000800080808000FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000808080000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080000080800000808000008080000080800000000000000000 + 0000000000000000000000000000000000008080800000FFFF0000FFFF008080 + 8000FFFFFF0000FFFF008080800000FFFF00FFFFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000808080000000000000008000000080008080 + 800000FFFF000000800000008000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000808080000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000808000008080000080800000808000008080000080800000808000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF008080 + 800000FFFF008080800000FFFF00FFFFFF0000FFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000808080000000000080808000000080000000 + 80000000800000008000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000808080000000000000000000000000000000 + 0000808000008080000080800000808000008080000080800000808000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 000000000000000000000000000000000000808080008080800080808000FFFF + FF0080808000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000808080000000000080808000000080000000 + 800000008000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000808080000000000000000000000000000000 + 0000000000008080000080800000808000008080000080800000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000FFFF008080800000FF + FF00FFFFFF008080800080808000808080008080800000000000000000000000 + 0000000000000000000000000000000000008080800000008000000080000000 + 8000000080008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 000000000000000000000000000000000000000000008080800000FFFF008080 + 800000FFFF008080800000FFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000800000008000808080000000 + 0000000080000000800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000808000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000008080800000FFFF00000000008080 + 8000FFFFFF00000000008080800000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000800000008000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF0000000000000000008080 + 800000FFFF000000000000000000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000008000000080008080800000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFF00000000FFFFFFFF00000000 + C007FFF900000000C007E7FF00000000C007C3F300000000C007C3E700000000 + C007E1C700000000C007F08F00000000C007F81F00000000C007FC3F00000000 + C007F81F00000000C007F09F00000000C00FC1C700000000C01F83E300000000 + C03F8FF100000000FFFFFFFF00000000C000C000FFFFFFFF80008000FFFFFFFF + 80008000FFFFFFFF80000000F83FFEFF80000000F83FFC7F80000000F83FF83F + 00000000F83FF01F00008000C007E00F80008000E00FC00700008000F01FF83F + 00010001F83FF83F81FF11FFFC7FF83F24FFF8FFFEFFF83F66FFFC7FFFFFFFFF + E7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxBarD11.bpl b/official/x.35/Lib/D11/dxBarD11.bpl new file mode 100644 index 00000000..1e7768ae Binary files /dev/null and b/official/x.35/Lib/D11/dxBarD11.bpl differ diff --git a/official/x.35/Lib/D11/dxBarD11.dcp b/official/x.35/Lib/D11/dxBarD11.dcp new file mode 100644 index 00000000..27af57b6 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarD11.dcp differ diff --git a/official/x.35/Lib/D11/dxBarD11.dcu b/official/x.35/Lib/D11/dxBarD11.dcu new file mode 100644 index 00000000..d804ec5d Binary files /dev/null and b/official/x.35/Lib/D11/dxBarD11.dcu differ diff --git a/official/x.35/Lib/D11/dxBarDBCheckLinksEd.dcu b/official/x.35/Lib/D11/dxBarDBCheckLinksEd.dcu new file mode 100644 index 00000000..3be412e2 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarDBCheckLinksEd.dcu differ diff --git a/official/x.35/Lib/D11/dxBarDBCheckLinksEd.dfm b/official/x.35/Lib/D11/dxBarDBCheckLinksEd.dfm new file mode 100644 index 00000000..84dc3540 --- /dev/null +++ b/official/x.35/Lib/D11/dxBarDBCheckLinksEd.dfm @@ -0,0 +1,156 @@ +object dxBarDBCheckLinksEditor: TdxBarDBCheckLinksEditor + Left = 233 + Top = 127 + BorderStyle = bsDialog + Caption = 'ExpressBars DBCheckLinks Editor' + ClientHeight = 278 + ClientWidth = 412 + Color = clBtnFace + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object GroupBox1: TGroupBox + Left = 6 + Top = 6 + Width = 171 + Height = 231 + Caption = ' CheckLinks ' + TabOrder = 0 + object ListBox: TListBox + Left = 10 + Top = 17 + Width = 151 + Height = 172 + ItemHeight = 13 + TabOrder = 0 + OnClick = ListBoxClick + end + object Button1: TButton + Left = 16 + Top = 198 + Width = 65 + Height = 23 + Caption = 'Add' + TabOrder = 1 + OnClick = Button1Click + end + object Button2: TButton + Left = 90 + Top = 198 + Width = 65 + Height = 23 + Caption = 'Delete' + TabOrder = 2 + OnClick = Button2Click + end + end + object GroupBox2: TGroupBox + Left = 184 + Top = 6 + Width = 221 + Height = 231 + Caption = ' Properties ' + TabOrder = 1 + object Label1: TLabel + Left = 13 + Top = 24 + Width = 20 + Height = 13 + Caption = 'Item' + end + object Label2: TLabel + Left = 12 + Top = 56 + Width = 62 + Height = 13 + Caption = 'EnableTypes' + end + object Bevel1: TBevel + Left = 80 + Top = 62 + Width = 129 + Height = 9 + Shape = bsTopLine + end + object ComboBox: TComboBox + Left = 42 + Top = 20 + Width = 167 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + end + object CheckBox1: TCheckBox + Left = 16 + Top = 78 + Width = 97 + Height = 17 + Caption = 'dxdbtCanModify' + TabOrder = 1 + end + object CheckBox4: TCheckBox + Left = 16 + Top = 138 + Width = 116 + Height = 17 + Caption = 'dxdbtHasRecords' + TabOrder = 4 + end + object CheckBox2: TCheckBox + Left = 16 + Top = 98 + Width = 97 + Height = 17 + Caption = 'dxdbtNotEOF' + TabOrder = 2 + end + object CheckBox5: TCheckBox + Left = 16 + Top = 158 + Width = 116 + Height = 17 + Caption = 'dxdbtIsModified' + TabOrder = 5 + end + object CheckBox6: TCheckBox + Left = 16 + Top = 178 + Width = 116 + Height = 17 + Caption = 'dxdbtIsNotModified' + TabOrder = 6 + end + object CheckBox3: TCheckBox + Left = 16 + Top = 118 + Width = 97 + Height = 17 + Caption = 'dxbdbtNotBOF' + TabOrder = 3 + end + end + object Button3: TButton + Left = 252 + Top = 248 + Width = 72 + Height = 23 + Caption = 'OK' + TabOrder = 2 + OnClick = Button3Click + end + object Button4: TButton + Left = 334 + Top = 248 + Width = 72 + Height = 23 + Cancel = True + Caption = 'Cancel' + TabOrder = 3 + OnClick = Button4Click + end +end diff --git a/official/x.35/Lib/D11/dxBarDBNav.dcu b/official/x.35/Lib/D11/dxBarDBNav.dcu new file mode 100644 index 00000000..03787e83 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarDBNav.dcu differ diff --git a/official/x.35/Lib/D11/dxBarDBNav.res b/official/x.35/Lib/D11/dxBarDBNav.res new file mode 100644 index 00000000..bbba3ec0 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarDBNav.res differ diff --git a/official/x.35/Lib/D11/dxBarDBNavD11.bpl b/official/x.35/Lib/D11/dxBarDBNavD11.bpl new file mode 100644 index 00000000..b3e771a5 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarDBNavD11.bpl differ diff --git a/official/x.35/Lib/D11/dxBarDBNavD11.dcp b/official/x.35/Lib/D11/dxBarDBNavD11.dcp new file mode 100644 index 00000000..3b738325 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarDBNavD11.dcp differ diff --git a/official/x.35/Lib/D11/dxBarDBNavD11.dcu b/official/x.35/Lib/D11/dxBarDBNavD11.dcu new file mode 100644 index 00000000..f37d7d08 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarDBNavD11.dcu differ diff --git a/official/x.35/Lib/D11/dxBarDBNavReg.dcr b/official/x.35/Lib/D11/dxBarDBNavReg.dcr new file mode 100644 index 00000000..e7b38737 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarDBNavReg.dcr differ diff --git a/official/x.35/Lib/D11/dxBarDBNavReg.dcu b/official/x.35/Lib/D11/dxBarDBNavReg.dcu new file mode 100644 index 00000000..0c2cdb21 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarDBNavReg.dcu differ diff --git a/official/x.35/Lib/D11/dxBarDBNavStrs.dcu b/official/x.35/Lib/D11/dxBarDBNavStrs.dcu new file mode 100644 index 00000000..ae5b044d Binary files /dev/null and b/official/x.35/Lib/D11/dxBarDBNavStrs.dcu differ diff --git a/official/x.35/Lib/D11/dxBarExtDBItems.dcu b/official/x.35/Lib/D11/dxBarExtDBItems.dcu new file mode 100644 index 00000000..fbbed027 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarExtDBItems.dcu differ diff --git a/official/x.35/Lib/D11/dxBarExtDBItems.res b/official/x.35/Lib/D11/dxBarExtDBItems.res new file mode 100644 index 00000000..4983674b Binary files /dev/null and b/official/x.35/Lib/D11/dxBarExtDBItems.res differ diff --git a/official/x.35/Lib/D11/dxBarExtDBItemsD11.bpl b/official/x.35/Lib/D11/dxBarExtDBItemsD11.bpl new file mode 100644 index 00000000..cb38c918 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarExtDBItemsD11.bpl differ diff --git a/official/x.35/Lib/D11/dxBarExtDBItemsD11.dcp b/official/x.35/Lib/D11/dxBarExtDBItemsD11.dcp new file mode 100644 index 00000000..4c53a806 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarExtDBItemsD11.dcp differ diff --git a/official/x.35/Lib/D11/dxBarExtDBItemsD11.dcu b/official/x.35/Lib/D11/dxBarExtDBItemsD11.dcu new file mode 100644 index 00000000..52f610e6 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarExtDBItemsD11.dcu differ diff --git a/official/x.35/Lib/D11/dxBarExtDBItemsReg.dcu b/official/x.35/Lib/D11/dxBarExtDBItemsReg.dcu new file mode 100644 index 00000000..cca24b17 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarExtDBItemsReg.dcu differ diff --git a/official/x.35/Lib/D11/dxBarExtItems.dcu b/official/x.35/Lib/D11/dxBarExtItems.dcu new file mode 100644 index 00000000..f8130ebb Binary files /dev/null and b/official/x.35/Lib/D11/dxBarExtItems.dcu differ diff --git a/official/x.35/Lib/D11/dxBarExtItems.res b/official/x.35/Lib/D11/dxBarExtItems.res new file mode 100644 index 00000000..7030bc61 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarExtItems.res differ diff --git a/official/x.35/Lib/D11/dxBarExtItemsD11.bpl b/official/x.35/Lib/D11/dxBarExtItemsD11.bpl new file mode 100644 index 00000000..01ac2b17 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarExtItemsD11.bpl differ diff --git a/official/x.35/Lib/D11/dxBarExtItemsD11.dcp b/official/x.35/Lib/D11/dxBarExtItemsD11.dcp new file mode 100644 index 00000000..9d621942 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarExtItemsD11.dcp differ diff --git a/official/x.35/Lib/D11/dxBarExtItemsD11.dcu b/official/x.35/Lib/D11/dxBarExtItemsD11.dcu new file mode 100644 index 00000000..02685e2e Binary files /dev/null and b/official/x.35/Lib/D11/dxBarExtItemsD11.dcu differ diff --git a/official/x.35/Lib/D11/dxBarExtItemsReg.dcu b/official/x.35/Lib/D11/dxBarExtItemsReg.dcu new file mode 100644 index 00000000..546c241b Binary files /dev/null and b/official/x.35/Lib/D11/dxBarExtItemsReg.dcu differ diff --git a/official/x.35/Lib/D11/dxBarImageComboEditor.dcu b/official/x.35/Lib/D11/dxBarImageComboEditor.dcu new file mode 100644 index 00000000..79442bf7 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarImageComboEditor.dcu differ diff --git a/official/x.35/Lib/D11/dxBarImageComboEditor.dfm b/official/x.35/Lib/D11/dxBarImageComboEditor.dfm new file mode 100644 index 00000000..cdc4532a --- /dev/null +++ b/official/x.35/Lib/D11/dxBarImageComboEditor.dfm @@ -0,0 +1,85 @@ +object dxBarImageComboEditorForm: TdxBarImageComboEditorForm + Left = 219 + Top = 82 + BorderStyle = bsDialog + Caption = 'ExpressBars ImageCombo Editor' + ClientHeight = 286 + ClientWidth = 362 + Color = clBtnFace + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Position = poScreenCenter + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object ButtonOk: TButton + Left = 284 + Top = 230 + Width = 72 + Height = 22 + Caption = '&OK' + Default = True + ModalResult = 1 + TabOrder = 4 + end + object ButtonCancel: TButton + Left = 284 + Top = 258 + Width = 72 + Height = 22 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 5 + end + object ButtonAdd: TButton + Left = 284 + Top = 6 + Width = 72 + Height = 22 + Caption = '&Add' + TabOrder = 1 + OnClick = ButtonAddClick + end + object ButtonDelete: TButton + Left = 284 + Top = 62 + Width = 72 + Height = 22 + Caption = '&Delete' + TabOrder = 3 + OnClick = ButtonDeleteClick + end + object Grid: TStringGrid + Left = 6 + Top = 6 + Width = 271 + Height = 273 + ColCount = 3 + DefaultRowHeight = 20 + FixedCols = 0 + RowCount = 2 + Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goDrawFocusSelected, goEditing, goThumbTracking] + TabOrder = 0 + OnDrawCell = GridDrawCell + OnGetEditText = GridGetEditText + OnKeyDown = GridKeyDown + OnSelectCell = GridSelectCell + OnSetEditText = GridSetEditText + ColWidths = ( + 43 + 63 + 150) + end + object ButtonInsert: TButton + Left = 284 + Top = 34 + Width = 72 + Height = 22 + Caption = '&Insert' + TabOrder = 2 + OnClick = ButtonInsertClick + end +end diff --git a/official/x.35/Lib/D11/dxBarItemEd.dcu b/official/x.35/Lib/D11/dxBarItemEd.dcu new file mode 100644 index 00000000..501b356c Binary files /dev/null and b/official/x.35/Lib/D11/dxBarItemEd.dcu differ diff --git a/official/x.35/Lib/D11/dxBarItemEd.dfm b/official/x.35/Lib/D11/dxBarItemEd.dfm new file mode 100644 index 00000000..34b22ef8 --- /dev/null +++ b/official/x.35/Lib/D11/dxBarItemEd.dfm @@ -0,0 +1,106 @@ +object dxBarItemAddEditor: TdxBarItemAddEditor + Left = 352 + Top = 153 + BorderStyle = bsDialog + Caption = 'Add New ExpressBars Item' + ClientHeight = 150 + ClientWidth = 263 + Color = clBtnFace + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + FormStyle = fsStayOnTop + Position = poScreenCenter + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object LName: TLabel + Left = 8 + Top = 68 + Width = 47 + Height = 13 + AutoSize = False + Caption = 'Name:' + end + object LCaption: TLabel + Left = 8 + Top = 96 + Width = 47 + Height = 13 + AutoSize = False + Caption = 'Caption:' + end + object LType: TLabel + Left = 8 + Top = 12 + Width = 47 + Height = 13 + AutoSize = False + Caption = 'Type:' + end + object LCategory: TLabel + Left = 8 + Top = 40 + Width = 47 + Height = 13 + AutoSize = False + Caption = 'Category:' + end + object Edit1: TEdit + Left = 62 + Top = 64 + Width = 194 + Height = 21 + TabOrder = 2 + end + object Edit2: TEdit + Left = 62 + Top = 92 + Width = 194 + Height = 21 + TabOrder = 3 + Text = 'New Item' + end + object ComboBox1: TComboBox + Left = 62 + Top = 8 + Width = 194 + Height = 21 + Style = csDropDownList + DropDownCount = 100 + ItemHeight = 13 + TabOrder = 0 + OnClick = ComboBox1Click + end + object ComboBox2: TComboBox + Left = 62 + Top = 36 + Width = 194 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 1 + end + object BOk: TButton + Left = 100 + Top = 122 + Width = 73 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 4 + OnClick = BOkClick + end + object BCancel: TButton + Left = 184 + Top = 122 + Width = 73 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 5 + end +end diff --git a/official/x.35/Lib/D11/dxBarNameEd.dcu b/official/x.35/Lib/D11/dxBarNameEd.dcu new file mode 100644 index 00000000..59e64719 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarNameEd.dcu differ diff --git a/official/x.35/Lib/D11/dxBarNameEd.dfm b/official/x.35/Lib/D11/dxBarNameEd.dfm new file mode 100644 index 00000000..c1527f25 --- /dev/null +++ b/official/x.35/Lib/D11/dxBarNameEd.dfm @@ -0,0 +1,53 @@ +object dxBarNameEd: TdxBarNameEd + Left = 199 + Top = 196 + BorderIcons = [] + BorderStyle = bsDialog + ClientHeight = 87 + ClientWidth = 266 + Color = clBtnFace + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + FormStyle = fsStayOnTop + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + PixelsPerInch = 96 + TextHeight = 13 + object LName: TLabel + Left = 8 + Top = 8 + Width = 68 + Height = 13 + Caption = '&Toolbar name:' + end + object EName: TEdit + Left = 8 + Top = 27 + Width = 251 + Height = 21 + TabOrder = 0 + OnChange = ENameChange + end + object BOK: TButton + Left = 106 + Top = 58 + Width = 73 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object BCancel: TButton + Left = 186 + Top = 58 + Width = 73 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end +end diff --git a/official/x.35/Lib/D11/dxBarPopupMenuEd.dcu b/official/x.35/Lib/D11/dxBarPopupMenuEd.dcu new file mode 100644 index 00000000..c88a9dfd Binary files /dev/null and b/official/x.35/Lib/D11/dxBarPopupMenuEd.dcu differ diff --git a/official/x.35/Lib/D11/dxBarPopupMenuEd.dfm b/official/x.35/Lib/D11/dxBarPopupMenuEd.dfm new file mode 100644 index 00000000..8c6b1e44 --- /dev/null +++ b/official/x.35/Lib/D11/dxBarPopupMenuEd.dfm @@ -0,0 +1,22 @@ +object dxBarSubMenuEditor: TdxBarSubMenuEditor + Tag = 100 + Left = 2 + Top = 105 + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'ExpressBars SubMenu Editor' + ClientHeight = 4 + ClientWidth = 196 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + OnActivate = FormActivate + OnClose = FormClose + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 +end diff --git a/official/x.35/Lib/D11/dxBarReg.dcr b/official/x.35/Lib/D11/dxBarReg.dcr new file mode 100644 index 00000000..2586d8b3 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarReg.dcr differ diff --git a/official/x.35/Lib/D11/dxBarReg.dcu b/official/x.35/Lib/D11/dxBarReg.dcu new file mode 100644 index 00000000..8a6bf30d Binary files /dev/null and b/official/x.35/Lib/D11/dxBarReg.dcu differ diff --git a/official/x.35/Lib/D11/dxBarSkin.dcu b/official/x.35/Lib/D11/dxBarSkin.dcu new file mode 100644 index 00000000..fa77fa41 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarSkin.dcu differ diff --git a/official/x.35/Lib/D11/dxBarSkinConsts.dcu b/official/x.35/Lib/D11/dxBarSkinConsts.dcu new file mode 100644 index 00000000..c8b073d7 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarSkinConsts.dcu differ diff --git a/official/x.35/Lib/D11/dxBarStrs.dcu b/official/x.35/Lib/D11/dxBarStrs.dcu new file mode 100644 index 00000000..e2fbcf86 Binary files /dev/null and b/official/x.35/Lib/D11/dxBarStrs.dcu differ diff --git a/official/x.35/Lib/D11/dxBase.dcu b/official/x.35/Lib/D11/dxBase.dcu new file mode 100644 index 00000000..33e1dc28 Binary files /dev/null and b/official/x.35/Lib/D11/dxBase.dcu differ diff --git a/official/x.35/Lib/D11/dxBkgnd.dcu b/official/x.35/Lib/D11/dxBkgnd.dcu new file mode 100644 index 00000000..42af5cf6 Binary files /dev/null and b/official/x.35/Lib/D11/dxBkgnd.dcu differ diff --git a/official/x.35/Lib/D11/dxBrhDlg.dcu b/official/x.35/Lib/D11/dxBrhDlg.dcu new file mode 100644 index 00000000..9f455a25 Binary files /dev/null and b/official/x.35/Lib/D11/dxBrhDlg.dcu differ diff --git a/official/x.35/Lib/D11/dxBrhDlg.dfm b/official/x.35/Lib/D11/dxBrhDlg.dfm new file mode 100644 index 00000000..2f5a2845 --- /dev/null +++ b/official/x.35/Lib/D11/dxBrhDlg.dfm @@ -0,0 +1,75 @@ +object dxBrushDlg: TdxBrushDlg + Left = 363 + Top = 214 + BorderStyle = bsDialog + Caption = 'Setup Brush properties' + ClientHeight = 120 + ClientWidth = 229 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object GroupBox1: TGroupBox + Left = 4 + Top = 1 + Width = 222 + Height = 85 + TabOrder = 0 + object lblColor: TLabel + Left = 6 + Top = 21 + Width = 29 + Height = 13 + Caption = '&Color:' + OnClick = lblClick + end + object lblStyle: TLabel + Left = 6 + Top = 53 + Width = 28 + Height = 13 + Caption = '&Style:' + OnClick = lblClick + end + object bvlColorHolder: TBevel + Left = 38 + Top = 16 + Width = 178 + Height = 23 + Visible = False + end + object bvlStyleHolder: TBevel + Left = 38 + Top = 48 + Width = 178 + Height = 22 + Visible = False + end + end + object btnOK: TButton + Left = 70 + Top = 93 + Width = 75 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 151 + Top = 93 + Width = 75 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end +end diff --git a/official/x.35/Lib/D11/dxCommon.dcu b/official/x.35/Lib/D11/dxCommon.dcu new file mode 100644 index 00000000..3d860999 Binary files /dev/null and b/official/x.35/Lib/D11/dxCommon.dcu differ diff --git a/official/x.35/Lib/D11/dxComnD11.bpl b/official/x.35/Lib/D11/dxComnD11.bpl new file mode 100644 index 00000000..6881c7d9 Binary files /dev/null and b/official/x.35/Lib/D11/dxComnD11.bpl differ diff --git a/official/x.35/Lib/D11/dxComnD11.dcp b/official/x.35/Lib/D11/dxComnD11.dcp new file mode 100644 index 00000000..ecdfd42b Binary files /dev/null and b/official/x.35/Lib/D11/dxComnD11.dcp differ diff --git a/official/x.35/Lib/D11/dxComnD11.dcu b/official/x.35/Lib/D11/dxComnD11.dcu new file mode 100644 index 00000000..67fb8099 Binary files /dev/null and b/official/x.35/Lib/D11/dxComnD11.dcu differ diff --git a/official/x.35/Lib/D11/dxDockConsts.dcu b/official/x.35/Lib/D11/dxDockConsts.dcu new file mode 100644 index 00000000..dcdd811c Binary files /dev/null and b/official/x.35/Lib/D11/dxDockConsts.dcu differ diff --git a/official/x.35/Lib/D11/dxDockControl.dcu b/official/x.35/Lib/D11/dxDockControl.dcu new file mode 100644 index 00000000..6ca93444 Binary files /dev/null and b/official/x.35/Lib/D11/dxDockControl.dcu differ diff --git a/official/x.35/Lib/D11/dxDockControlNETView.dcu b/official/x.35/Lib/D11/dxDockControlNETView.dcu new file mode 100644 index 00000000..8af51cca Binary files /dev/null and b/official/x.35/Lib/D11/dxDockControlNETView.dcu differ diff --git a/official/x.35/Lib/D11/dxDockControlOfficeView.dcu b/official/x.35/Lib/D11/dxDockControlOfficeView.dcu new file mode 100644 index 00000000..48729bf3 Binary files /dev/null and b/official/x.35/Lib/D11/dxDockControlOfficeView.dcu differ diff --git a/official/x.35/Lib/D11/dxDockControlXPView.dcu b/official/x.35/Lib/D11/dxDockControlXPView.dcu new file mode 100644 index 00000000..8ced465c Binary files /dev/null and b/official/x.35/Lib/D11/dxDockControlXPView.dcu differ diff --git a/official/x.35/Lib/D11/dxDockPanel.dcu b/official/x.35/Lib/D11/dxDockPanel.dcu new file mode 100644 index 00000000..042c916b Binary files /dev/null and b/official/x.35/Lib/D11/dxDockPanel.dcu differ diff --git a/official/x.35/Lib/D11/dxDockReg.dcr b/official/x.35/Lib/D11/dxDockReg.dcr new file mode 100644 index 00000000..f7559c0a Binary files /dev/null and b/official/x.35/Lib/D11/dxDockReg.dcr differ diff --git a/official/x.35/Lib/D11/dxDockReg.dcu b/official/x.35/Lib/D11/dxDockReg.dcu new file mode 100644 index 00000000..0d99638d Binary files /dev/null and b/official/x.35/Lib/D11/dxDockReg.dcu differ diff --git a/official/x.35/Lib/D11/dxDockZones.dcu b/official/x.35/Lib/D11/dxDockZones.dcu new file mode 100644 index 00000000..1df222c5 Binary files /dev/null and b/official/x.35/Lib/D11/dxDockZones.dcu differ diff --git a/official/x.35/Lib/D11/dxDockingD11.bpl b/official/x.35/Lib/D11/dxDockingD11.bpl new file mode 100644 index 00000000..8ad51fa6 Binary files /dev/null and b/official/x.35/Lib/D11/dxDockingD11.bpl differ diff --git a/official/x.35/Lib/D11/dxDockingD11.dcp b/official/x.35/Lib/D11/dxDockingD11.dcp new file mode 100644 index 00000000..8b26c75b Binary files /dev/null and b/official/x.35/Lib/D11/dxDockingD11.dcp differ diff --git a/official/x.35/Lib/D11/dxDockingD11.dcu b/official/x.35/Lib/D11/dxDockingD11.dcu new file mode 100644 index 00000000..43c052a1 Binary files /dev/null and b/official/x.35/Lib/D11/dxDockingD11.dcu differ diff --git a/official/x.35/Lib/D11/dxExtCtrls.dcu b/official/x.35/Lib/D11/dxExtCtrls.dcu new file mode 100644 index 00000000..5d817ac6 Binary files /dev/null and b/official/x.35/Lib/D11/dxExtCtrls.dcu differ diff --git a/official/x.35/Lib/D11/dxExtCtrlsStrs.dcu b/official/x.35/Lib/D11/dxExtCtrlsStrs.dcu new file mode 100644 index 00000000..7fdde7e7 Binary files /dev/null and b/official/x.35/Lib/D11/dxExtCtrlsStrs.dcu differ diff --git a/official/x.35/Lib/D11/dxFEFDlg.dcu b/official/x.35/Lib/D11/dxFEFDlg.dcu new file mode 100644 index 00000000..f12825c5 Binary files /dev/null and b/official/x.35/Lib/D11/dxFEFDlg.dcu differ diff --git a/official/x.35/Lib/D11/dxFEFDlg.dfm b/official/x.35/Lib/D11/dxFEFDlg.dfm new file mode 100644 index 00000000..3664f1bc --- /dev/null +++ b/official/x.35/Lib/D11/dxFEFDlg.dfm @@ -0,0 +1,749 @@ +object dxFEFDialog: TdxFEFDialog + Left = 446 + Top = 168 + ActiveControl = dgTexture + BorderStyle = bsDialog + Caption = 'Fill Effects' + ClientHeight = 301 + ClientWidth = 392 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + ShowHint = True + PixelsPerInch = 96 + TextHeight = 13 + object lblSample: TLabel + Left = 307 + Top = 214 + Width = 44 + Height = 13 + Caption = 'Sample : ' + end + object PageControl1: TPageControl + Left = 4 + Top = 5 + Width = 297 + Height = 292 + ActivePage = tshTexture + TabOrder = 0 + OnChange = PageControl1Change + object tshTexture: TTabSheet + Caption = '&Texture' + object dgTexture: TDrawGrid + Left = 4 + Top = 4 + Width = 280 + Height = 198 + BorderStyle = bsNone + ColCount = 4 + Ctl3D = True + DefaultColWidth = 65 + DefaultRowHeight = 65 + DefaultDrawing = False + FixedCols = 0 + RowCount = 6 + FixedRows = 0 + Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goThumbTracking] + ParentCtl3D = False + ScrollBars = ssVertical + TabOrder = 0 + OnClick = dgTextureClick + OnDblClick = dgTextureDblClick + OnDrawCell = dgTextureDrawCell + OnMouseMove = dgTextureMouseMove + end + object pnlTextureName: TPanel + Left = 4 + Top = 205 + Width = 280 + Height = 24 + BevelOuter = bvLowered + TabOrder = 1 + end + object btnOtherTexture: TButton + Left = 150 + Top = 237 + Width = 134 + Height = 23 + Caption = '&Other Texture ...' + TabOrder = 2 + OnClick = btnOtherTextureClick + end + end + object tshPattern: TTabSheet + Caption = '&Pattern' + object lblForeground: TLabel + Left = 5 + Top = 191 + Width = 66 + Height = 13 + Caption = '&Foreground : ' + OnClick = lblForegroundClick + end + object lblBackground: TLabel + Left = 160 + Top = 191 + Width = 66 + Height = 13 + Caption = '&Background : ' + OnClick = lblForegroundClick + end + object bvlForeColorHolder: TBevel + Left = 4 + Top = 208 + Width = 124 + Height = 21 + Visible = False + end + object bvlBackColorHolder: TBevel + Left = 160 + Top = 208 + Width = 125 + Height = 21 + Visible = False + end + object dgPattern: TDrawGrid + Left = 4 + Top = 4 + Width = 280 + Height = 156 + BorderStyle = bsNone + ColCount = 8 + DefaultColWidth = 34 + DefaultRowHeight = 25 + DefaultDrawing = False + FixedCols = 0 + RowCount = 6 + FixedRows = 0 + Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine] + ParentShowHint = False + ScrollBars = ssNone + ShowHint = True + TabOrder = 0 + OnClick = dgPatternClick + OnDblClick = dgPatternDblClick + OnDrawCell = dgPatternDrawCell + OnMouseMove = dgPatternMouseMove + end + object pnlPatternName: TPanel + Left = 4 + Top = 163 + Width = 281 + Height = 23 + BevelOuter = bvLowered + TabOrder = 1 + end + object btnInvert: TButton + Left = 4 + Top = 237 + Width = 281 + Height = 23 + Caption = 'I&nvert colors' + TabOrder = 2 + OnClick = btnInvertClick + end + end + object tshPicture: TTabSheet + Caption = 'P&icture' + object lblPaintMode: TLabel + Left = 7 + Top = 210 + Width = 53 + Height = 13 + Caption = 'Paint &mode' + FocusControl = cbxPaintMode + OnClick = lblPaintModeClick + end + object Bevel4: TBevel + Left = 64 + Top = 216 + Width = 217 + Height = 3 + Shape = bsBottomLine + end + object sbxPicture: TScrollBox + Left = 4 + Top = 4 + Width = 279 + Height = 145 + HorzScrollBar.Tracking = True + VertScrollBar.Tracking = True + PopupMenu = pmPicture + TabOrder = 0 + TabStop = True + object pnlPicture: TPanel + Left = 0 + Top = 0 + Width = 273 + Height = 138 + BevelOuter = bvNone + TabOrder = 0 + object pbxPicture: TPaintBox + Left = 0 + Top = 0 + Width = 273 + Height = 138 + Align = alClient + OnPaint = pbxPicturePaint + end + object pnlNoPicture: TPanel + Left = 48 + Top = 58 + Width = 185 + Height = 25 + BevelOuter = bvNone + Caption = 'There is no Picture to display' + TabOrder = 0 + end + end + end + object pnlPictureName: TPanel + Left = 4 + Top = 152 + Width = 279 + Height = 24 + BevelOuter = bvLowered + TabOrder = 1 + end + object btnSelectPicture: TButton + Left = 146 + Top = 181 + Width = 137 + Height = 23 + Caption = 'Se&lect Picture ...' + TabOrder = 3 + OnClick = SelectPictureClick + end + object cbxPaintMode: TComboBox + Left = 6 + Top = 228 + Width = 129 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 4 + OnChange = cbxPaintModeChange + Items.Strings = ( + 'Center' + 'Stretch' + 'Tile' + 'Proportional') + end + object btnPreview: TButton + Left = 4 + Top = 181 + Width = 137 + Height = 23 + Caption = 'Pre&view ...' + TabOrder = 2 + OnClick = PicturePreviewClick + end + end + end + object pnlPreview: TPanel + Left = 316 + Top = 229 + Width = 65 + Height = 65 + BevelOuter = bvNone + BorderStyle = bsSingle + TabOrder = 5 + object pbxPreview: TPaintBox + Left = 0 + Top = 0 + Width = 61 + Height = 61 + Align = alClient + OnPaint = pbxPreviewPaint + end + end + object btnHelp: TButton + Left = 308 + Top = 112 + Width = 80 + Height = 23 + Caption = '&Help' + TabOrder = 4 + end + object btnApply: TButton + Left = 308 + Top = 83 + Width = 80 + Height = 23 + Caption = '&Apply' + TabOrder = 3 + OnClick = btnApplyClick + end + object btnCancel: TButton + Left = 308 + Top = 54 + Width = 80 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object btnOK: TButton + Left = 308 + Top = 25 + Width = 80 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object pmPicture: TPopupMenu + OnPopup = pmPicturePopup + Left = 340 + Top = 146 + object miPreview: TMenuItem + Caption = 'Pre&view...' + OnClick = PicturePreviewClick + end + object N3: TMenuItem + Caption = '-' + end + object miLoad: TMenuItem + Caption = '&Load...' + ShortCut = 45 + OnClick = SelectPictureClick + end + object miDelete: TMenuItem + Caption = '&Delete' + ShortCut = 46 + OnClick = miDeleteClick + end + object N2: TMenuItem + Caption = '-' + end + object miCut: TMenuItem + Caption = 'Cu&t' + ShortCut = 16472 + OnClick = miCutClick + end + object miCopy: TMenuItem + Caption = '&Copy' + ShortCut = 16451 + OnClick = miCopyClick + end + object miPaste: TMenuItem + Caption = '&Paste' + ShortCut = 16470 + OnClick = miPasteClick + end + end + object ilMenu: TImageList + Left = 312 + Top = 146 + Bitmap = { + 494C010106000A00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000840000008400000084000000840000008400 + 0000840000008400000084000000840000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00840000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400008484008484 + 8400008484008484840084000000FFFFFF008400000084000000840000008400 + 00008400000084000000FFFFFF00840000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000848400848484000084 + 8400848484000084840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00840000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400008484008484 + 8400008484008484840084000000FFFFFF00840000008400000084000000FFFF + FF00840000008400000084000000840000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000848400848484000084 + 8400848484000084840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0084000000FFFFFF0084000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400008484008484 + 8400008484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000848400848484000084 + 8400848484000084840084000000840000008400000084000000840000008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400008484008484 + 8400008484008484840000848400848484000084840084848400008484008484 + 8400008484000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000848400848484000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400848484000000 + 0000C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600000000008484 + 8400008484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000848400848484000084 + 84000000000000FFFF00000000000000000000FFFF0000000000848484000084 + 8400848484000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000FFFF0000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000008400 + 0000000000000000000084000000000000000000000084000000840000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000840000008400000084000000840000008400 + 0000840000008400000084000000000000000000000000000000008484000084 + 8400008484000084840000848400008484000084840000848400008484000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FF000000FF000000FF000000FF000000FF000000FFFF + FF00000000000000000000000000000000000000000000000000000000008400 + 0000000000000000000084000000000000008400000000000000000000008400 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000FFFF00000000000084 + 8400008484000084840000848400008484000084840000848400008484000084 + 8400000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000008400 + 0000000000000000000084000000000000008400000000000000000000008400 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF000000000000000000000000000000 + 000000000000FFFFFF00840000000000000000000000FFFFFF0000FFFF000000 + 0000008484000084840000848400008484000084840000848400008484000084 + 8400008484000000000000000000000000008484840084848400848484000000 + 000000000000FF000000FF000000FF000000FF000000FF000000FF000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000840000008400000084000000000000008400000000000000000000008400 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000FFFF00FFFFFF0000FF + FF00000000000084840000848400008484000084840000848400008484000084 + 84000084840000848400000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000000000008400000084000000840000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF000000000000000000000000000000 + 000000000000FFFFFF00840000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00840000008400 + 000000000000FF000000FF000000FF000000FF000000FF000000FF000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000000000008400000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF000000000000000000FFFFFF008400 + 00008400000084000000840000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000 + 00000000000000000000000000000000000000000000FFFFFF00840000008400 + 00008400000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 0000FFFFFF008400000000000000000000000000000000FFFF00FFFFFF0000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000084848400848484008484840084848400848484008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00840000008400 + 000084000000840000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000FFFFFF000000000084000000840000008400000084000000840000008400 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00C6C6C6000000000000000000000000000000 + 0000FFFFFF00FFFFFF0084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00840000008400 + 00008400000084000000FFFFFF00C6C6C600FFFFFF0084000000840000008400 + 0000840000008400000084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00C6C6C600FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFF00000000FC00FFFF00000000 + 8000FFF9000000000000E7FF000000000000C3F3000000000000C3E700000000 + 0001E1C7000000000003F08F000000000003F81F000000000003FC3F00000000 + 0003F81F000000000003F09F000000000003C1C700000000800783E300000000 + F87F8FF100000000FFFFFFFF00000000FFFFFFFEFFFFFFFFFFFFFF0CF3FFFFFF + 001FFC00ED9FFC01000FF805ED6FFC010007F805ED6FFC0100030006F16F0001 + 00010006FD1F000100000006FC7F0001001F0006FEFF0001001F0005FC7F0003 + 001F0005FD7F00078FF10001F93F000FFFF90001FBBF00FFFF750001FBBF01FF + FF8F0001FBBF03FFFFFF0001FFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxFading.dcu b/official/x.35/Lib/D11/dxFading.dcu new file mode 100644 index 00000000..59764895 Binary files /dev/null and b/official/x.35/Lib/D11/dxFading.dcu differ diff --git a/official/x.35/Lib/D11/dxGDIPlusAPI.dcu b/official/x.35/Lib/D11/dxGDIPlusAPI.dcu new file mode 100644 index 00000000..4575af4d Binary files /dev/null and b/official/x.35/Lib/D11/dxGDIPlusAPI.dcu differ diff --git a/official/x.35/Lib/D11/dxGDIPlusClasses.dcu b/official/x.35/Lib/D11/dxGDIPlusClasses.dcu new file mode 100644 index 00000000..95927714 Binary files /dev/null and b/official/x.35/Lib/D11/dxGDIPlusClasses.dcu differ diff --git a/official/x.35/Lib/D11/dxGDIPlusD11.bpl b/official/x.35/Lib/D11/dxGDIPlusD11.bpl new file mode 100644 index 00000000..6fc3f535 Binary files /dev/null and b/official/x.35/Lib/D11/dxGDIPlusD11.bpl differ diff --git a/official/x.35/Lib/D11/dxGDIPlusD11.dcp b/official/x.35/Lib/D11/dxGDIPlusD11.dcp new file mode 100644 index 00000000..903f96e2 Binary files /dev/null and b/official/x.35/Lib/D11/dxGDIPlusD11.dcp differ diff --git a/official/x.35/Lib/D11/dxGDIPlusD11.dcu b/official/x.35/Lib/D11/dxGDIPlusD11.dcu new file mode 100644 index 00000000..76fe4ab8 Binary files /dev/null and b/official/x.35/Lib/D11/dxGDIPlusD11.dcu differ diff --git a/official/x.35/Lib/D11/dxLayoutCommon.dcu b/official/x.35/Lib/D11/dxLayoutCommon.dcu new file mode 100644 index 00000000..0e23ecd2 Binary files /dev/null and b/official/x.35/Lib/D11/dxLayoutCommon.dcu differ diff --git a/official/x.35/Lib/D11/dxLayoutControl.dcu b/official/x.35/Lib/D11/dxLayoutControl.dcu new file mode 100644 index 00000000..dc926275 Binary files /dev/null and b/official/x.35/Lib/D11/dxLayoutControl.dcu differ diff --git a/official/x.35/Lib/D11/dxLayoutControl.res b/official/x.35/Lib/D11/dxLayoutControl.res new file mode 100644 index 00000000..5f97ae84 Binary files /dev/null and b/official/x.35/Lib/D11/dxLayoutControl.res differ diff --git a/official/x.35/Lib/D11/dxLayoutControlAdapters.dcu b/official/x.35/Lib/D11/dxLayoutControlAdapters.dcu new file mode 100644 index 00000000..ea795975 Binary files /dev/null and b/official/x.35/Lib/D11/dxLayoutControlAdapters.dcu differ diff --git a/official/x.35/Lib/D11/dxLayoutControlD11.bpl b/official/x.35/Lib/D11/dxLayoutControlD11.bpl new file mode 100644 index 00000000..3c8b35ac Binary files /dev/null and b/official/x.35/Lib/D11/dxLayoutControlD11.bpl differ diff --git a/official/x.35/Lib/D11/dxLayoutControlD11.dcp b/official/x.35/Lib/D11/dxLayoutControlD11.dcp new file mode 100644 index 00000000..b772f122 Binary files /dev/null and b/official/x.35/Lib/D11/dxLayoutControlD11.dcp differ diff --git a/official/x.35/Lib/D11/dxLayoutControlD11.dcu b/official/x.35/Lib/D11/dxLayoutControlD11.dcu new file mode 100644 index 00000000..5cc1919d Binary files /dev/null and b/official/x.35/Lib/D11/dxLayoutControlD11.dcu differ diff --git a/official/x.35/Lib/D11/dxLayoutControlReg.dcr b/official/x.35/Lib/D11/dxLayoutControlReg.dcr new file mode 100644 index 00000000..1de5e202 Binary files /dev/null and b/official/x.35/Lib/D11/dxLayoutControlReg.dcr differ diff --git a/official/x.35/Lib/D11/dxLayoutControlReg.dcu b/official/x.35/Lib/D11/dxLayoutControlReg.dcu new file mode 100644 index 00000000..1b871fdf Binary files /dev/null and b/official/x.35/Lib/D11/dxLayoutControlReg.dcu differ diff --git a/official/x.35/Lib/D11/dxLayoutControlcxEditAdaptersD11.bpl b/official/x.35/Lib/D11/dxLayoutControlcxEditAdaptersD11.bpl new file mode 100644 index 00000000..d29b7f3b Binary files /dev/null and b/official/x.35/Lib/D11/dxLayoutControlcxEditAdaptersD11.bpl differ diff --git a/official/x.35/Lib/D11/dxLayoutControlcxEditAdaptersD11.dcp b/official/x.35/Lib/D11/dxLayoutControlcxEditAdaptersD11.dcp new file mode 100644 index 00000000..f78d3959 Binary files /dev/null and b/official/x.35/Lib/D11/dxLayoutControlcxEditAdaptersD11.dcp differ diff --git a/official/x.35/Lib/D11/dxLayoutControlcxEditAdaptersD11.dcu b/official/x.35/Lib/D11/dxLayoutControlcxEditAdaptersD11.dcu new file mode 100644 index 00000000..b43e57e8 Binary files /dev/null and b/official/x.35/Lib/D11/dxLayoutControlcxEditAdaptersD11.dcu differ diff --git a/official/x.35/Lib/D11/dxLayoutCustomizeForm.dcu b/official/x.35/Lib/D11/dxLayoutCustomizeForm.dcu new file mode 100644 index 00000000..43e1c40e Binary files /dev/null and b/official/x.35/Lib/D11/dxLayoutCustomizeForm.dcu differ diff --git a/official/x.35/Lib/D11/dxLayoutCustomizeForm.dfm b/official/x.35/Lib/D11/dxLayoutCustomizeForm.dfm new file mode 100644 index 00000000..17fc09db --- /dev/null +++ b/official/x.35/Lib/D11/dxLayoutCustomizeForm.dfm @@ -0,0 +1,172 @@ +object LayoutCustomizeForm: TLayoutCustomizeForm + Left = 219 + Top = 183 + BorderStyle = bsSizeToolWin + Caption = 'LayoutCustomizeForm' + ClientHeight = 297 + ClientWidth = 223 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnClose = FormClose + PixelsPerInch = 96 + TextHeight = 13 + object LayoutControl: TdxLayoutControl + Left = 0 + Top = 0 + Width = 223 + Height = 297 + Align = alClient + TabOrder = 0 + AutoContentSizes = [acsWidth, acsHeight] + LookAndFeel = lfStandard + object pcMain: TPageControl + Left = 4 + Top = 4 + Width = 217 + Height = 241 + ActivePage = tshItems + TabOrder = 0 + object tshItems: TTabSheet + Caption = 'Items' + object lcItems: TdxLayoutControl + Left = 0 + Top = 0 + Width = 209 + Height = 213 + Align = alClient + TabOrder = 0 + AutoContentSizes = [acsWidth, acsHeight] + LookAndFeel = lfStandard + object lbItems: TListBox + Left = 6 + Top = 6 + Width = 129 + Height = 145 + Style = lbOwnerDrawFixed + BorderStyle = bsNone + Color = clBtnFace + ItemHeight = 13 + TabOrder = 0 + OnDrawItem = lbItemsDrawItem + OnMeasureItem = lbItemsMeasureItem + end + object lcItemsGroup_Root: TdxLayoutGroup + ShowCaption = False + Hidden = True + ShowBorder = False + object lcItemsItem1: TdxLayoutItem + AutoAligns = [aaHorizontal] + AlignVert = avClient + Control = lbItems + end + end + end + end + object tshGroups: TTabSheet + Caption = 'Groups' + ImageIndex = 1 + object lcGroups: TdxLayoutControl + Left = 0 + Top = 0 + Width = 209 + Height = 213 + Align = alClient + TabOrder = 0 + AutoContentSizes = [acsWidth, acsHeight] + LookAndFeel = lfStandard + object lbGroups: TListBox + Left = 6 + Top = 6 + Width = 145 + Height = 149 + Style = lbOwnerDrawFixed + BorderStyle = bsNone + Color = clBtnFace + ItemHeight = 13 + TabOrder = 0 + OnClick = lbGroupsClick + OnDrawItem = lbGroupsDrawItem + OnMeasureItem = lbGroupsMeasureItem + end + object btnGroupsCreate: TButton + Left = 25 + Top = 234 + Width = 75 + Height = 23 + Caption = 'Create' + TabOrder = 1 + OnClick = btnGroupsCreateClick + end + object btnGroupsDelete: TButton + Left = 106 + Top = 234 + Width = 75 + Height = 23 + Caption = 'Delete' + TabOrder = 2 + OnClick = btnGroupsDeleteClick + end + object lcGroupsGroup_Root: TdxLayoutGroup + ShowCaption = False + Hidden = True + ShowBorder = False + object lcGroupsItem1: TdxLayoutItem + AutoAligns = [aaHorizontal] + AlignVert = avClient + Control = lbGroups + end + object lcGroupsGroup1: TdxLayoutGroup + AutoAligns = [aaVertical] + AlignHorz = ahCenter + ShowCaption = False + Hidden = True + LayoutDirection = ldHorizontal + ShowBorder = False + object lcGroupsItem4: TdxLayoutItem + AutoAligns = [aaVertical] + AlignHorz = ahClient + Caption = 'Button1' + ShowCaption = False + Control = btnGroupsCreate + ControlOptions.ShowBorder = False + end + object lcGroupsItem2: TdxLayoutItem + AutoAligns = [aaVertical] + AlignHorz = ahClient + Caption = 'Button2' + ShowCaption = False + Control = btnGroupsDelete + ControlOptions.ShowBorder = False + end + end + end + end + end + end + object LayoutControlGroup_Root: TdxLayoutGroup + ShowCaption = False + Hidden = True + ShowBorder = False + object LayoutControlItem1: TdxLayoutItem + AutoAligns = [aaHorizontal] + AlignVert = avClient + Control = pcMain + ControlOptions.ShowBorder = False + end + end + end + object LookAndFeels: TdxLayoutLookAndFeelList + Left = 154 + Top = 66 + object lfStandard: TdxLayoutStandardLookAndFeel + ItemOptions.ControlBorderStyle = lbsFlat + Offsets.RootItemsAreaOffsetHorz = 3 + Offsets.RootItemsAreaOffsetVert = 3 + end + end +end diff --git a/official/x.35/Lib/D11/dxLayoutDesignCommon.dcu b/official/x.35/Lib/D11/dxLayoutDesignCommon.dcu new file mode 100644 index 00000000..daf717c6 Binary files /dev/null and b/official/x.35/Lib/D11/dxLayoutDesignCommon.dcu differ diff --git a/official/x.35/Lib/D11/dxLayoutDesignForm.dcu b/official/x.35/Lib/D11/dxLayoutDesignForm.dcu new file mode 100644 index 00000000..dfc0acb8 Binary files /dev/null and b/official/x.35/Lib/D11/dxLayoutDesignForm.dcu differ diff --git a/official/x.35/Lib/D11/dxLayoutDesignForm.dfm b/official/x.35/Lib/D11/dxLayoutDesignForm.dfm new file mode 100644 index 00000000..9a9a7a6b --- /dev/null +++ b/official/x.35/Lib/D11/dxLayoutDesignForm.dfm @@ -0,0 +1,221 @@ +object DesignForm: TDesignForm + Left = 423 + Top = 176 + AutoScroll = False + BorderIcons = [biSystemMenu] + ClientHeight = 291 + ClientWidth = 306 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object lcMain: TdxLayoutControl + Left = 0 + Top = 0 + Width = 306 + Height = 291 + Align = alClient + TabOrder = 0 + TabStop = False + AutoContentSizes = [acsWidth, acsHeight] + LookAndFeel = lfStandard + object lbItems: TListBox + Left = 8 + Top = 8 + Width = 173 + Height = 245 + Style = lbOwnerDrawFixed + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + TabOrder = 0 + OnDrawItem = lbItemsDrawItem + end + object btnAddGroup: TButton + Left = 191 + Top = 6 + Width = 85 + Height = 23 + Caption = 'Add Group...' + TabOrder = 1 + OnClick = btnAddGroupClick + end + object btnAddItem: TButton + Left = 191 + Top = 35 + Width = 85 + Height = 23 + Caption = 'Add Item...' + TabOrder = 2 + OnClick = btnAddItemClick + end + object btnDelete: TButton + Left = 191 + Top = 64 + Width = 85 + Height = 23 + Caption = 'Delete' + TabOrder = 3 + end + object btnClose: TButton + Left = 191 + Top = 262 + Width = 85 + Height = 23 + Cancel = True + Caption = 'Close' + Default = True + TabOrder = 6 + OnClick = btnCloseClick + end + object btnAlign: TButton + Left = 191 + Top = 93 + Width = 109 + Height = 23 + Caption = 'Align by...' + TabOrder = 4 + OnClick = btnAlignClick + end + object chbShowHiddenGroupsBounds: TCheckBox + Left = 191 + Top = 122 + Width = 7 + Height = 26 + TabOrder = 5 + OnClick = chbShowHiddenGroupsBoundsClick + end + object TdxLayoutGroup + ShowCaption = False + Hidden = True + LayoutDirection = ldHorizontal + ShowBorder = False + object dxLayoutControl1Item1: TdxLayoutItem + AutoAligns = [] + AlignHorz = ahClient + AlignVert = avClient + Control = lbItems + end + object dxLayoutControl1Group2: TdxLayoutGroup + ShowCaption = False + Hidden = True + ShowBorder = False + object dxLayoutControl1Item2: TdxLayoutItem + Caption = 'Button1' + ShowCaption = False + Control = btnAddGroup + ControlOptions.ShowBorder = False + end + object dxLayoutControl1Item3: TdxLayoutItem + Caption = 'Button2' + ShowCaption = False + Control = btnAddItem + ControlOptions.ShowBorder = False + end + object dxLayoutControl1Item4: TdxLayoutItem + Caption = 'Button3' + ShowCaption = False + Control = btnDelete + ControlOptions.ShowBorder = False + end + object lcMainItem1: TdxLayoutItem + Caption = 'Button1' + ShowCaption = False + Control = btnAlign + ControlOptions.ShowBorder = False + end + object lcMainItem4: TdxLayoutItem + Caption = 'Show Hidden Groups Bounds' + CaptionOptions.Layout = clRight + CaptionOptions.Width = 96 + OnCaptionClick = lcMainItem4CaptionClick + Control = chbShowHiddenGroupsBounds + ControlOptions.ShowBorder = False + end + object lcMainGroup1: TdxLayoutGroup + AutoAligns = [aaHorizontal] + Caption = 'Legend' + LookAndFeel = lfStandardLegend + object lcMainItem2: TdxLayoutItem + Caption = 'Actually Invisible Group/Item' + CaptionOptions.Width = 80 + LookAndFeel = lfStandardBtnFace + end + object lcMainItem3: TdxLayoutItem + Caption = 'Hidden Group ' + LookAndFeel = lfStandardBoldItalic + end + end + object dxLayoutControl1Item5: TdxLayoutItem + AutoAligns = [aaHorizontal] + AlignVert = avBottom + Caption = 'Button4' + ShowCaption = False + Control = btnClose + ControlOptions.ShowBorder = False + end + end + end + end + object lflMain: TdxLayoutLookAndFeelList + Left = 164 + Top = 24 + object lfStandard: TdxLayoutStandardLookAndFeel + Offsets.RootItemsAreaOffsetHorz = 4 + Offsets.RootItemsAreaOffsetVert = 4 + end + object lfStandardBtnFace: TdxLayoutStandardLookAndFeel + ItemOptions.CaptionOptions.TextColor = clBtnFace + end + object lfStandardBoldItalic: TdxLayoutStandardLookAndFeel + ItemOptions.CaptionOptions.Font.Charset = DEFAULT_CHARSET + ItemOptions.CaptionOptions.Font.Color = clWindowText + ItemOptions.CaptionOptions.Font.Height = -11 + ItemOptions.CaptionOptions.Font.Name = 'MS Sans Serif' + ItemOptions.CaptionOptions.Font.Style = [fsBold, fsItalic] + ItemOptions.CaptionOptions.UseDefaultFont = False + end + object lfStandardLegend: TdxLayoutStandardLookAndFeel + GroupOptions.Color = clInfoBk + end + end + object pmAlign: TPopupMenu + Left = 272 + Top = 224 + object Left1: TMenuItem + Caption = 'Left Side' + OnClick = pmAlignItemClick + end + object Right1: TMenuItem + Tag = 2 + Caption = 'Right Side' + OnClick = pmAlignItemClick + end + object N1: TMenuItem + Caption = '-' + end + object op1: TMenuItem + Tag = 1 + Caption = 'Top Side' + OnClick = pmAlignItemClick + end + object Bottom1: TMenuItem + Tag = 3 + Caption = 'Bottom Side' + OnClick = pmAlignItemClick + end + object N2: TMenuItem + Caption = '-' + end + object None1: TMenuItem + Tag = -1 + Caption = 'None' + OnClick = pmAlignItemClick + end + end +end diff --git a/official/x.35/Lib/D11/dxLayoutEditForm.dcu b/official/x.35/Lib/D11/dxLayoutEditForm.dcu new file mode 100644 index 00000000..e47d4a2d Binary files /dev/null and b/official/x.35/Lib/D11/dxLayoutEditForm.dcu differ diff --git a/official/x.35/Lib/D11/dxLayoutEditForm.dfm b/official/x.35/Lib/D11/dxLayoutEditForm.dfm new file mode 100644 index 00000000..48863de4 --- /dev/null +++ b/official/x.35/Lib/D11/dxLayoutEditForm.dfm @@ -0,0 +1,86 @@ +object LayoutEditForm: TLayoutEditForm + Left = 233 + Top = 209 + BorderStyle = bsDialog + Caption = 'LayoutEditForm' + ClientHeight = 88 + ClientWidth = 282 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object LayoutControl: TdxLayoutControl + Left = 0 + Top = 0 + Width = 282 + Height = 88 + Align = alClient + TabOrder = 0 + TabStop = False + AutoContentSizes = [acsWidth] + object edMain: TEdit + Left = 12 + Top = 30 + Width = 121 + Height = 17 + BorderStyle = bsNone + TabOrder = 0 + Text = 'edMain' + end + object btnOK: TButton + Left = 116 + Top = 55 + Width = 75 + Height = 23 + Caption = 'btnOK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 197 + Top = 55 + Width = 75 + Height = 23 + Cancel = True + Caption = 'btnCancel' + ModalResult = 2 + TabOrder = 2 + end + object TdxLayoutGroup + ShowCaption = False + Hidden = True + ShowBorder = False + object LayoutControlItemEdit: TdxLayoutItem + Caption = 'Edit1' + CaptionOptions.Layout = clTop + Control = edMain + end + object dxLayoutControl1Group1: TdxLayoutGroup + AutoAligns = [aaVertical] + AlignHorz = ahRight + ShowCaption = False + LayoutDirection = ldHorizontal + ShowBorder = False + object dxLayoutControl1Item2: TdxLayoutItem + Caption = 'Button1' + ShowCaption = False + Control = btnOK + ControlOptions.ShowBorder = False + end + object dxLayoutControl1Item3: TdxLayoutItem + Caption = 'Button2' + ShowCaption = False + Control = btnCancel + ControlOptions.ShowBorder = False + end + end + end + end +end diff --git a/official/x.35/Lib/D11/dxLayoutLookAndFeelListDesignForm.dcu b/official/x.35/Lib/D11/dxLayoutLookAndFeelListDesignForm.dcu new file mode 100644 index 00000000..8e1eb3a4 Binary files /dev/null and b/official/x.35/Lib/D11/dxLayoutLookAndFeelListDesignForm.dcu differ diff --git a/official/x.35/Lib/D11/dxLayoutLookAndFeelListDesignForm.dfm b/official/x.35/Lib/D11/dxLayoutLookAndFeelListDesignForm.dfm new file mode 100644 index 00000000..0f16912c --- /dev/null +++ b/official/x.35/Lib/D11/dxLayoutLookAndFeelListDesignForm.dfm @@ -0,0 +1,247 @@ +object LookAndFeelListDesignForm: TLookAndFeelListDesignForm + Left = 532 + Top = 129 + Width = 326 + Height = 441 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object lcMain: TdxLayoutControl + Left = 0 + Top = 0 + Width = 318 + Height = 407 + Align = alClient + TabOrder = 0 + TabStop = False + AutoContentSizes = [acsWidth, acsHeight] + LookAndFeel = dxLayoutOfficeLookAndFeel1 + object lbItems: TListBox + Left = 12 + Top = 12 + Width = 401 + Height = 264 + Style = lbOwnerDrawFixed + BorderStyle = bsNone + ItemHeight = 13 + MultiSelect = True + TabOrder = 0 + end + object btnAdd: TButton + Left = 233 + Top = 10 + Width = 75 + Height = 23 + Caption = 'Add...' + TabOrder = 1 + OnClick = btnAddClick + end + object btnDelete: TButton + Left = 233 + Top = 39 + Width = 75 + Height = 23 + Caption = 'Delete' + TabOrder = 2 + end + object btnClose: TButton + Left = 233 + Top = 68 + Width = 75 + Height = 23 + Cancel = True + Caption = 'Close' + Default = True + TabOrder = 3 + OnClick = btnCloseClick + end + object pnlPreview: TPanel + Left = 20 + Top = 193 + Width = 278 + Height = 200 + BevelOuter = bvLowered + TabOrder = 4 + object lcPreview: TdxLayoutControl + Left = 1 + Top = 1 + Width = 276 + Height = 198 + Align = alClient + TabOrder = 0 + TabStop = False + Visible = False + AutoContentSizes = [acsWidth, acsHeight] + object Edit1: TEdit + Left = 53 + Top = 30 + Width = 90 + Height = 17 + BorderStyle = bsNone + TabOrder = 0 + Text = 'Edit1' + end + object Edit2: TEdit + Left = 53 + Top = 57 + Width = 90 + Height = 17 + BorderStyle = bsNone + TabOrder = 1 + Text = 'Edit2' + end + object CheckBox1: TCheckBox + Left = 22 + Top = 112 + Width = 97 + Height = 17 + Caption = 'CheckBox1' + TabOrder = 2 + end + object CheckBox2: TCheckBox + Left = 22 + Top = 135 + Width = 97 + Height = 17 + Caption = 'CheckBox2' + TabOrder = 3 + end + object ListBox1: TListBox + Left = 172 + Top = 30 + Width = 80 + Height = 120 + BorderStyle = bsNone + ItemHeight = 13 + Items.Strings = ( + 'Item 1' + 'Item 2' + 'Item 3' + 'Item 4' + 'Item 5' + 'Item 6' + 'Item 7' + 'Item 8' + 'Item 9') + TabOrder = 4 + end + object TdxLayoutGroup + ShowCaption = False + Hidden = True + LayoutDirection = ldHorizontal + ShowBorder = False + object dxLayoutControl1Group4: TdxLayoutGroup + AutoAligns = [aaVertical] + AlignHorz = ahClient + ShowCaption = False + Hidden = True + ShowBorder = False + object dxLayoutGroup1: TdxLayoutGroup + AutoAligns = [aaVertical] + AlignHorz = ahClient + Caption = 'Group 1' + object dxLayoutItem1: TdxLayoutItem + Caption = 'Edit1' + Control = Edit1 + end + object dxLayoutControl1Item2: TdxLayoutItem + Caption = 'Edit2' + Control = Edit2 + end + end + object dxLayoutControl1Group2: TdxLayoutGroup + Caption = 'Group2' + object dxLayoutControl1Item3: TdxLayoutItem + Caption = 'CheckBox1' + ShowCaption = False + Control = CheckBox1 + ControlOptions.AutoColor = True + ControlOptions.ShowBorder = False + end + object dxLayoutControl1Item4: TdxLayoutItem + Caption = 'CheckBox2' + ShowCaption = False + Control = CheckBox2 + ControlOptions.AutoColor = True + ControlOptions.ShowBorder = False + end + end + end + object dxLayoutControl1Group3: TdxLayoutGroup + AutoAligns = [aaHorizontal] + AlignVert = avClient + Caption = 'Group3' + object dxLayoutControl1Item5: TdxLayoutItem + AutoAligns = [aaHorizontal] + AlignVert = avClient + Control = ListBox1 + end + end + end + end + end + object TdxLayoutGroup + ShowCaption = False + Hidden = True + ShowBorder = False + object lcMainGroup4: TdxLayoutGroup + AutoAligns = [aaHorizontal] + AlignVert = avClient + ShowCaption = False + Hidden = True + LayoutDirection = ldHorizontal + ShowBorder = False + object lcMainItem1: TdxLayoutItem + AutoAligns = [] + AlignHorz = ahClient + AlignVert = avClient + Control = lbItems + end + object lcMainGroup2: TdxLayoutGroup + ShowCaption = False + Hidden = True + ShowBorder = False + object lcMainItem2: TdxLayoutItem + Caption = 'Button1' + ShowCaption = False + Control = btnAdd + ControlOptions.ShowBorder = False + end + object lcMainItem3: TdxLayoutItem + Caption = 'Button2' + ShowCaption = False + Control = btnDelete + ControlOptions.ShowBorder = False + end + object lcMainItem4: TdxLayoutItem + Caption = 'Button3' + ShowCaption = False + Control = btnClose + ControlOptions.ShowBorder = False + end + end + end + object lcMainGroup3: TdxLayoutGroup + Caption = 'Preview' + object lcMainItem6: TdxLayoutItem + Caption = 'Panel1' + ShowCaption = False + Control = pnlPreview + ControlOptions.ShowBorder = False + end + end + end + end + object lflMain: TdxLayoutLookAndFeelList + Left = 256 + Top = 116 + object dxLayoutOfficeLookAndFeel1: TdxLayoutOfficeLookAndFeel + end + end +end diff --git a/official/x.35/Lib/D11/dxLayoutLookAndFeels.dcu b/official/x.35/Lib/D11/dxLayoutLookAndFeels.dcu new file mode 100644 index 00000000..50c9e8d8 Binary files /dev/null and b/official/x.35/Lib/D11/dxLayoutLookAndFeels.dcu differ diff --git a/official/x.35/Lib/D11/dxLayoutcxEditAdapters.dcu b/official/x.35/Lib/D11/dxLayoutcxEditAdapters.dcu new file mode 100644 index 00000000..b73fcfa7 Binary files /dev/null and b/official/x.35/Lib/D11/dxLayoutcxEditAdapters.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBar.dcu b/official/x.35/Lib/D11/dxNavBar.dcu new file mode 100644 index 00000000..6e04e091 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBar.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBar.res b/official/x.35/Lib/D11/dxNavBar.res new file mode 100644 index 00000000..c36a8b42 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBar.res differ diff --git a/official/x.35/Lib/D11/dxNavBarAccessibility.dcu b/official/x.35/Lib/D11/dxNavBarAccessibility.dcu new file mode 100644 index 00000000..43bcc740 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarAccessibility.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarBase.dcu b/official/x.35/Lib/D11/dxNavBarBase.dcu new file mode 100644 index 00000000..13d6be36 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarBase.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarBaseViews.dcu b/official/x.35/Lib/D11/dxNavBarBaseViews.dcu new file mode 100644 index 00000000..eb064041 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarBaseViews.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarCollns.dcu b/official/x.35/Lib/D11/dxNavBarCollns.dcu new file mode 100644 index 00000000..2cb6b7df Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarCollns.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarConsts.dcu b/official/x.35/Lib/D11/dxNavBarConsts.dcu new file mode 100644 index 00000000..9600da67 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarConsts.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarCustomPainters.dcu b/official/x.35/Lib/D11/dxNavBarCustomPainters.dcu new file mode 100644 index 00000000..ebaada56 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarCustomPainters.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarD11.bpl b/official/x.35/Lib/D11/dxNavBarD11.bpl new file mode 100644 index 00000000..80e40740 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarD11.bpl differ diff --git a/official/x.35/Lib/D11/dxNavBarD11.dcp b/official/x.35/Lib/D11/dxNavBarD11.dcp new file mode 100644 index 00000000..a4336110 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarD11.dcp differ diff --git a/official/x.35/Lib/D11/dxNavBarD11.dcu b/official/x.35/Lib/D11/dxNavBarD11.dcu new file mode 100644 index 00000000..87d9c3bd Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarD11.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarDsgnConsts.dcu b/official/x.35/Lib/D11/dxNavBarDsgnConsts.dcu new file mode 100644 index 00000000..0cf17ee7 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarDsgnConsts.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarDsgnUtils.dcu b/official/x.35/Lib/D11/dxNavBarDsgnUtils.dcu new file mode 100644 index 00000000..91249265 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarDsgnUtils.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarExplorerViews.dcu b/official/x.35/Lib/D11/dxNavBarExplorerViews.dcu new file mode 100644 index 00000000..91da6c58 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarExplorerViews.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarGraphics.dcu b/official/x.35/Lib/D11/dxNavBarGraphics.dcu new file mode 100644 index 00000000..f8e8b138 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarGraphics.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarGroupItems.dcu b/official/x.35/Lib/D11/dxNavBarGroupItems.dcu new file mode 100644 index 00000000..cf45aaba Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarGroupItems.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarOffice11Views.dcu b/official/x.35/Lib/D11/dxNavBarOffice11Views.dcu new file mode 100644 index 00000000..5ee65ad5 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarOffice11Views.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarOffice12Views.dcu b/official/x.35/Lib/D11/dxNavBarOffice12Views.dcu new file mode 100644 index 00000000..6a8dd29f Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarOffice12Views.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarOffice12Views.res b/official/x.35/Lib/D11/dxNavBarOffice12Views.res new file mode 100644 index 00000000..ca5f5c26 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarOffice12Views.res differ diff --git a/official/x.35/Lib/D11/dxNavBarOfficeViews.dcu b/official/x.35/Lib/D11/dxNavBarOfficeViews.dcu new file mode 100644 index 00000000..8f68aae3 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarOfficeViews.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarReg.dcr b/official/x.35/Lib/D11/dxNavBarReg.dcr new file mode 100644 index 00000000..92d913b0 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarReg.dcr differ diff --git a/official/x.35/Lib/D11/dxNavBarReg.dcu b/official/x.35/Lib/D11/dxNavBarReg.dcu new file mode 100644 index 00000000..2426bb66 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarReg.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarSkinBasedViews.dcu b/official/x.35/Lib/D11/dxNavBarSkinBasedViews.dcu new file mode 100644 index 00000000..43a4a140 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarSkinBasedViews.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarStyles.dcu b/official/x.35/Lib/D11/dxNavBarStyles.dcu new file mode 100644 index 00000000..b6945765 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarStyles.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarVSToolBoxViews.dcu b/official/x.35/Lib/D11/dxNavBarVSToolBoxViews.dcu new file mode 100644 index 00000000..e9428ee1 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarVSToolBoxViews.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarViewsFact.dcu b/official/x.35/Lib/D11/dxNavBarViewsFact.dcu new file mode 100644 index 00000000..8ad4f380 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarViewsFact.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarVistaViews.dcu b/official/x.35/Lib/D11/dxNavBarVistaViews.dcu new file mode 100644 index 00000000..d4927eaa Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarVistaViews.dcu differ diff --git a/official/x.35/Lib/D11/dxNavBarVistaViews.res b/official/x.35/Lib/D11/dxNavBarVistaViews.res new file mode 100644 index 00000000..c64d8e67 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarVistaViews.res differ diff --git a/official/x.35/Lib/D11/dxNavBarXPViews.dcu b/official/x.35/Lib/D11/dxNavBarXPViews.dcu new file mode 100644 index 00000000..440a7bf4 Binary files /dev/null and b/official/x.35/Lib/D11/dxNavBarXPViews.dcu differ diff --git a/official/x.35/Lib/D11/dxOffice11.dcu b/official/x.35/Lib/D11/dxOffice11.dcu new file mode 100644 index 00000000..d0cd03ed Binary files /dev/null and b/official/x.35/Lib/D11/dxOffice11.dcu differ diff --git a/official/x.35/Lib/D11/dxOffice11.res b/official/x.35/Lib/D11/dxOffice11.res new file mode 100644 index 00000000..680cef5f Binary files /dev/null and b/official/x.35/Lib/D11/dxOffice11.res differ diff --git a/official/x.35/Lib/D11/dxPPAttr.dcu b/official/x.35/Lib/D11/dxPPAttr.dcu new file mode 100644 index 00000000..17d2075a Binary files /dev/null and b/official/x.35/Lib/D11/dxPPAttr.dcu differ diff --git a/official/x.35/Lib/D11/dxPS.dcr b/official/x.35/Lib/D11/dxPS.dcr new file mode 100644 index 00000000..f2521142 Binary files /dev/null and b/official/x.35/Lib/D11/dxPS.dcr differ diff --git a/official/x.35/Lib/D11/dxPSAutoHFTextMnuBld.dcu b/official/x.35/Lib/D11/dxPSAutoHFTextMnuBld.dcu new file mode 100644 index 00000000..c3d01a95 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSAutoHFTextMnuBld.dcu differ diff --git a/official/x.35/Lib/D11/dxPSBaseGridLnk.dcu b/official/x.35/Lib/D11/dxPSBaseGridLnk.dcu new file mode 100644 index 00000000..94be6868 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSBaseGridLnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPSCPDsg.dcu b/official/x.35/Lib/D11/dxPSCPDsg.dcu new file mode 100644 index 00000000..5480f97c Binary files /dev/null and b/official/x.35/Lib/D11/dxPSCPDsg.dcu differ diff --git a/official/x.35/Lib/D11/dxPSCPDsg.dfm b/official/x.35/Lib/D11/dxPSCPDsg.dfm new file mode 100644 index 00000000..45250ab5 --- /dev/null +++ b/official/x.35/Lib/D11/dxPSCPDsg.dfm @@ -0,0 +1,631 @@ +object dxfmCPDesigner: TdxfmCPDesigner + Left = 519 + Top = 331 + ActiveControl = btnAdd + BorderStyle = bsDialog + Caption = 'Component Printer Designer' + ClientHeight = 289 + ClientWidth = 454 + Color = clBtnFace + Constraints.MinHeight = 316 + Constraints.MinWidth = 462 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + KeyPreview = True + OldCreateOrder = False + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + OnKeyDown = FormKeyDown + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object btnClose: TButton + Left = 271 + Top = 261 + Width = 86 + Height = 23 + Caption = 'Close' + ModalResult = 1 + TabOrder = 0 + end + object btnHelp: TButton + Left = 363 + Top = 261 + Width = 86 + Height = 23 + Caption = '&Help' + TabOrder = 1 + end + object pcItems: TPageControl + Left = 5 + Top = 7 + Width = 444 + Height = 247 + ActivePage = tbsItems + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 2 + object tbsItems: TTabSheet + Caption = 'Items' + OnResize = tbsItemsResize + object lvItems: TListView + Left = 0 + Top = 0 + Width = 307 + Height = 219 + Align = alClient + Columns = <> + ColumnClick = False + MultiSelect = True + RowSelect = True + PopupMenu = pmItems + TabOrder = 0 + ViewStyle = vsReport + OnChange = lvItemsChange + OnDblClick = lvItemsDblClick + OnEdited = lvItemsEdited + OnEditing = lvItemsEditing + end + object pnlButtons: TPanel + Left = 307 + Top = 0 + Width = 129 + Height = 219 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object btnDesign: TButton + Left = 6 + Top = 103 + Width = 120 + Height = 23 + Caption = 'Desi&gn...' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 3 + OnClick = DesignClick + end + object btnAdd: TButton + Left = 6 + Top = 3 + Width = 120 + Height = 23 + Caption = '&Add...' + TabOrder = 0 + OnClick = AddClick + end + object btnDelete: TButton + Left = 6 + Top = 63 + Width = 120 + Height = 23 + Caption = '&Delete...' + TabOrder = 2 + OnClick = DeleteClick + end + object btnPageSetup: TButton + Left = 6 + Top = 133 + Width = 120 + Height = 23 + Caption = 'Pa&ge Setup...' + TabOrder = 4 + OnClick = PageSetupClick + end + object btnPrintPreview: TButton + Left = 6 + Top = 163 + Width = 120 + Height = 23 + Caption = 'Pre&view...' + TabOrder = 5 + OnClick = PrintPreviewClick + end + object btnPrint: TButton + Left = 6 + Top = 193 + Width = 120 + Height = 23 + Caption = '&Print...' + TabOrder = 6 + OnClick = PrintClick + end + object btnAddComposition: TButton + Left = 6 + Top = 33 + Width = 120 + Height = 23 + Caption = 'Add Composition' + TabOrder = 1 + OnClick = AddCompositionClick + end + end + object pnlNoItems: TPanel + Left = 12 + Top = 83 + Width = 289 + Height = 22 + BevelOuter = bvNone + Caption = 'There are no Items to display' + Color = clWindow + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnShadow + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + TabOrder = 2 + end + end + end + object pmItems: TPopupMenu + Images = ilItems + OnPopup = pmItemsPopup + Left = 20 + Top = 198 + object miAdd: TMenuItem + Caption = '&Add...' + ImageIndex = 1 + ShortCut = 45 + OnClick = AddClick + end + object miAddComposition: TMenuItem + Caption = 'Add Composition' + ImageIndex = 6 + OnClick = AddCompositionClick + end + object miDelete: TMenuItem + Caption = '&Delete' + ImageIndex = 2 + ShortCut = 46 + OnClick = DeleteClick + end + object miRename: TMenuItem + Caption = '&Rename' + ShortCut = 113 + OnClick = RenameClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miDesign: TMenuItem + Caption = 'Desi&gn...' + Default = True + ImageIndex = 0 + ShortCut = 16397 + OnClick = DesignClick + end + object miLine1: TMenuItem + Caption = '-' + end + object miPageSetup: TMenuItem + Caption = 'Pa&ge Setup...' + ImageIndex = 3 + OnClick = PageSetupClick + end + object miPrintPreview: TMenuItem + Caption = 'Pre&view...' + ImageIndex = 4 + OnClick = PrintPreviewClick + end + object miPrint: TMenuItem + Caption = '&Print...' + ImageIndex = 5 + ShortCut = 16464 + OnClick = PrintClick + end + end + object ilItems: TImageList + Left = 48 + Top = 198 + Bitmap = { + 494C010107000A00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0000000 + 0000C0C0C000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C0C0C0000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000080808000C0C0C000C0C0C0008080 + 80000000000080808000000000000000000000000000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C00000FFFF0000FFFF0000FFFF00C0C0C000C0C0 + C00000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000080808000C0C0C000C0C0C000FFFF00008080 + 80008080800000000000000000000000000000000000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000808080008080800080808000C0C0C000C0C0 + C00000000000C0C0C0000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFF + FF0000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000C0C0C000C0C0C000C0C0C000C0C0C0008080 + 8000C0C0C0000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C0C0C000C0C0C00000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFF + FF0000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000C0C0C000FFFF0000C0C0C000C0C0C0008080 + 8000C0C0C00000000000000000000000000000000000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0000000 + 0000C0C0C00000000000C0C0C00000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF0000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000080808000FFFF0000FFFF0000C0C0C0008080 + 8000808080000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C0C0 + C00000000000C0C0C0000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF0000000000FFFFFF00FFFF + FF0000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000080808000C0C0C000C0C0C0008080 + 800000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000C0C0C00000000000C0C0C00000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000000000FFFFFF000000 + 0000FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000C0C0C000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000808080000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000008000000080000000800000008000000080000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000000000008080800000000000C0C0C0000000000000000000000000000000 + 000080808000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008000000080000000800000008000 + 0000800000008000000080000000800000008000000080000000800000008000 + 000080000000800000008000000000000000000000000000000080808000C0C0 + C000C0C0C0008080800080808000808080008080800080808000808080008080 + 800000000000808080000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000008000000080000000800000008000 + 000080000000800000008080800080000000FFFFFF0080000000800000008000 + 000080000000800000008000000000000000000000000000000000000000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000FFFFFF00C0C0C0008080 + 800000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000008000000080000000808080008080 + 800080808000808080008080800080000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00800000008000000000000000000000008080800080808000C0C0 + C000C0C0C000C0C0C000C0C0C000000000008080800080808000FFFFFF008080 + 800000000000808080008080800000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000008000000080000000808080008080 + 800080808000808080008080800080000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00800000008000000000000000808080000000000000000000FFFF + FF00C0C0C000C0C0C000C0C0C000000000008080800080808000C0C0C0008080 + 800000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000008000000080000000808080008080 + 800080808000808080008080800080000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080000000800000000000000080808000C0C0C000C0C0C000FFFF + FF00808080000000000000000000000000000000000000000000C0C0C0008080 + 8000C0C0C000808080000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000008000000080000000808080008080 + 800080808000808080008080800080000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00800000008000000000000000808080000000000000000000FFFF + FF0080808000C0C0C000FFFFFF0000000000C0C0C000C0C0C000C0C0C0008080 + 800000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000008000000080000000808080008080 + 800080808000808080008080800080000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00800000008000000000000000000000000000000000000000C0C0 + C0000000000080808000C0C0C00000000000C0C0C000C0C0C000C0C0C0008080 + 800000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000008000000080000000808080008080 + 800080808000808080008080800080000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00800000008000000000000000000000000000000000000000C0C0 + C000FFFFFF00000000008080800080808000C0C0C000C0C0C000C0C0C0008080 + 800000000000808080000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000008000000080000000808080008080 + 800080808000808080008080800080000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00800000008000000000000000000000000000000080808000C0C0 + C000C0C0C000C0C0C000FFFFFF00FFFFFF00FFFFFF00C0C0C000808080008080 + 800000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000008000000080000000808080008080 + 80008080800080808000800000000000000080000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF008000000080000000000000000000000000000000000000008080 + 8000000000000000000000000000C0C0C0000000000080808000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000080000000800000008000 + 0000800000008000000000000000000000000000000080000000800000008000 + 0000800000008000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000C0C0C0000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080808000808080008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFC01F0000000CC007C01F0000 + 00088003C007000000010001C007000000030001C001000000030001C0010000 + 00030000C001000000030000C001000000038000C00100000007C000C0010000 + 000FE001C0010000000FE007F0010000000FF007F0030000001FF003FC070000 + 003FF803FC0F0000007FFFFFFFFF0000FFFFFFFFFFFFFFFFFE3FFFFFFFFFFFFF + FC3FC007FFF9F83FE027C007E7FF0001C003C007C3F30001E007C007C3E70001 + 8001C007E1C700010001C007F08F00010001C007F81F00010001C007FC3F0001 + E007C007F81F0001E003C007F09F0001C007C00FC1C70101E42FC01F83E38383 + FC3FC03F8FF1FFFFFC3FFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxPSChLbxLnk.dcu b/official/x.35/Lib/D11/dxPSChLbxLnk.dcu new file mode 100644 index 00000000..d2fd020b Binary files /dev/null and b/official/x.35/Lib/D11/dxPSChLbxLnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPSChLbxLnk.dfm b/official/x.35/Lib/D11/dxPSChLbxLnk.dfm new file mode 100644 index 00000000..eefa3d15 --- /dev/null +++ b/official/x.35/Lib/D11/dxPSChLbxLnk.dfm @@ -0,0 +1,369 @@ +object dxChlbxReportLinkDesignWindow: TdxChlbxReportLinkDesignWindow + Left = 548 + Top = 365 + BorderStyle = bsDialog + Caption = 'dxCLbReportLinkDesigner' + ClientHeight = 243 + ClientWidth = 552 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 3 + Width = 544 + Height = 204 + ActivePage = tshColor + MultiLine = True + TabOrder = 1 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = '&Options' + object pnlOptions: TPanel + Left = 0 + Top = 0 + Width = 536 + Height = 176 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Bevel11: TBevel + Left = 41 + Top = 18 + Width = 207 + Height = 4 + Shape = bsBottomLine + end + object Bevel4: TBevel + Left = 79 + Top = 90 + Width = 167 + Height = 4 + Shape = bsBottomLine + end + object Image5: TImage + Left = 10 + Top = 109 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0FFFFFFF7FFFFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFFF + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDDDDDDDDDDD0F77777777777777777777 + F07DD0F0000FF7F0000000FF000F07DDDDDDDDDDDD0F7FFF77777FF77777FFF7 + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDDDDDDDDDDD0F77777777777777777777 + F07DD0777777777777777777777707DDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFFF + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDDDDDDDDDDD0F77777777777777777777 + F07DD0F0000FF7F00000000000FF07DDDDDDDDDDDD0F7FFFFFFF7FFFFFFFFFF7 + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDDDDDDDDDDD0F7F000FFF7F00000F00F7 + F07DD0777777777777777777777707DDCDDDDCDDDD0F7FFFFFFF7FFFFFFFFFF7 + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDCCCCDCCDDD0F7F00000F7F00000000F7 + F07DD0F00000F7F0000000FF000F07DDCCCCCCCCDD0F7FFFFFFF7FFFFFFFFFF7 + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDCCCCDCCDDD0F77777777777777777777 + F07DD0777777777777777777777707DDCDDDDCDDDD0F7FFFFFFF7FFFFFFFFFF7 + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDDDDDDDDDDD0F7FFFFFFF7F000000FFF7 + F07DD0F00FFFF7F000000000000F07DDDDDDDDDDDD0F7FFFFFFF7FFFFFFFFFF7 + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDDDDDDDDDDD0F7FFFFFFF7F0000F000F7 + F07DD0F00000F7F00000000F000F07DDDDDDDDDDDD0F7FFFFFFF7FFFFFFFFFF7 + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDDDDDDDDDDD0F7F00000F7F00000000F7 + F07DD0777777777777777777777707DDDDDDDDDDDD0F7FFFFFFF7FFFFFFFFFF7 + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDCDDDDCDDDD0F7F00F00F7F000000FFF7 + F07DD0F00FFFF7F000000FF000FF07DDCCCCDCCDDD0F7FFFFFFF7FFFFFFFFFF7 + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDCCCCCCCCDD0F7F00000F7F00000000F7 + F07DD0F00000F7F000000000000F07DDCCCCDCCDDD0F7FFFFFFF7FFFFFFFFFF7 + F07DD0FFFFFFF7FFFFFFFFFFFFFF07DDCDDDDCDDDD0F77777777777777777777 + F07DD0000000000000000000000007DDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFFF + F07DD0888888808888888888888807DDDDDDDDDDDD0F77777777777777777777 + F07DD0880000808800000088888807DDDDDDDDDDDD0F77777777777777777777 + F07DD0888888808888888888888807DDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFFF + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgGrid: TImage + Left = 10 + Top = 34 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblShow: TLabel + Left = 6 + Top = 14 + Width = 26 + Height = 13 + Caption = 'Show' + end + object lblMiscellaneous: TLabel + Left = 6 + Top = 85 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + end + object chbxShowBorders: TCheckBox + Left = 95 + Top = 31 + Width = 148 + Height = 17 + Caption = 'Border' + TabOrder = 0 + OnClick = chbxShowBordersClick + end + object chbxShowHorzLines: TCheckBox + Tag = 1 + Left = 95 + Top = 54 + Width = 148 + Height = 17 + Caption = 'Horizontal Lines' + TabOrder = 1 + OnClick = chbxShowBordersClick + end + object chbxFlatCheckMarks: TCheckBox + Tag = 2 + Left = 95 + Top = 107 + Width = 148 + Height = 17 + Caption = 'Flat Check &Marks' + TabOrder = 2 + OnClick = chbxShowBordersClick + end + object chbxRowAutoHeight: TCheckBox + Left = 95 + Top = 153 + Width = 148 + Height = 17 + Caption = '&Row Auto Height' + TabOrder = 4 + OnClick = chbxRowAutoHeightClick + end + object lblPreview: TStaticText + Left = 256 + Top = 1 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 5 + end + object chbxAutoWidth: TCheckBox + Left = 95 + Top = 130 + Width = 148 + Height = 17 + Caption = 'AutoWidth' + TabOrder = 3 + OnClick = chbxAutoWidthClick + end + end + end + object tshColor: TTabSheet + Caption = '&Color' + object pnlColor: TPanel + Left = 0 + Top = 0 + Width = 536 + Height = 176 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblGridLinesColor: TLabel + Left = 14 + Top = 143 + Width = 79 + Height = 13 + Caption = 'Grid Lines color: ' + OnClick = lblComboClick + end + object bvlLineColorHolder: TBevel + Left = 100 + Top = 137 + Width = 126 + Height = 21 + Visible = False + end + object lblDrawMode: TLabel + Left = 6 + Top = 13 + Width = 58 + Height = 13 + Caption = 'Draw &Mode:' + FocusControl = cbxDrawMode + OnClick = lblComboClick + end + object gbxTransparent: TGroupBox + Left = 6 + Top = 45 + Width = 232 + Height = 82 + Caption = ' ' + TabOrder = 2 + object lblColor: TLabel + Left = 9 + Top = 24 + Width = 35 + Height = 13 + Caption = 'Co&lor : ' + OnClick = lblComboClick + end + object bvlColorHolder: TBevel + Left = 94 + Top = 20 + Width = 126 + Height = 21 + Visible = False + end + object lblEvenColor: TLabel + Left = 9 + Top = 50 + Width = 59 + Height = 13 + Caption = 'E&ven Color: ' + OnClick = lblComboClick + end + object bvlEvenColorHolder: TBevel + Left = 94 + Top = 46 + Width = 126 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 18 + Top = 42 + Width = 15 + Height = 17 + Caption = 'T&ransparent' + TabOrder = 1 + OnClick = chbxTransparentClick + end + object cbxDrawMode: TComboBox + Left = 77 + Top = 8 + Width = 161 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 0 + OnClick = cbxDrawModeClick + OnDrawItem = cbxDrawModeDrawItem + Items.Strings = ( + 'Simpe' + 'Odd\Even Rows Mode' + 'Chess' + 'Borrow From Source') + end + object stTransparent: TStaticText + Left = 33 + Top = 43 + Width = 69 + Height = 17 + Caption = ' Transparent ' + FocusControl = chbxTransparent + TabOrder = 3 + OnClick = stTransparentClick + end + end + end + object tshFont: TTabSheet + Caption = '&Font' + object pnlFont: TPanel + Left = 0 + Top = 0 + Width = 536 + Height = 176 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object btnFont: TButton + Left = 8 + Top = 9 + Width = 110 + Height = 23 + Caption = 'Fo&nt ...' + TabOrder = 0 + OnClick = btnFontClick + end + object edFont: TEdit + Left = 8 + Top = 37 + Width = 231 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + Text = 'edFont' + end + object btnEvenFont: TButton + Tag = 1 + Left = 9 + Top = 70 + Width = 110 + Height = 23 + Caption = 'E&ven Font ...' + TabOrder = 2 + OnClick = btnFontClick + end + object edEvenFont: TEdit + Left = 9 + Top = 98 + Width = 231 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 3 + Text = 'edFont' + end + end + end + end + object pnlPreview: TPanel + Left = 265 + Top = 46 + Width = 273 + Height = 150 + BevelInner = bvLowered + BevelOuter = bvNone + Color = clWindow + TabOrder = 0 + end +end diff --git a/official/x.35/Lib/D11/dxPSCompsProvider.dcu b/official/x.35/Lib/D11/dxPSCompsProvider.dcu new file mode 100644 index 00000000..6861415c Binary files /dev/null and b/official/x.35/Lib/D11/dxPSCompsProvider.dcu differ diff --git a/official/x.35/Lib/D11/dxPSContainerLnk.dcu b/official/x.35/Lib/D11/dxPSContainerLnk.dcu new file mode 100644 index 00000000..b2a04116 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSContainerLnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPSContainerLnk.dfm b/official/x.35/Lib/D11/dxPSContainerLnk.dfm new file mode 100644 index 00000000..f0f5dd7a --- /dev/null +++ b/official/x.35/Lib/D11/dxPSContainerLnk.dfm @@ -0,0 +1,884 @@ +object dxfmCustomContainerDesignWindow: TdxfmCustomContainerDesignWindow + Left = 456 + Top = 379 + BorderStyle = bsDialog + Caption = 'dxfmCustomContainerDesignWindow' + ClientHeight = 315 + ClientWidth = 582 + Color = clBtnFace + Constraints.MinHeight = 342 + Constraints.MinWidth = 588 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 9 + Width = 574 + Height = 271 + ActivePage = tshReportLinks + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + OnChange = PageControl1Change + OnChanging = PageControl1Changing + object tshOptions: TTabSheet + Caption = 'Options' + object imgExpanding: TImage + Left = 9 + Top = 26 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDD7777777777777777777777777DDDDDDDDDDDD0000000000000000000000 + 000DDF888888888888888888888887DDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFFF + FF0DDF877777777777777777777787DDDDDDDDDDDD0F00000000000000000000 + 0F0DDF8F8888888888888888888787DDCDDDCDDDDD0F0FFFFFFFFFFFFFFFFFFF + 0F0DDF8F8000000000000000008787DDCCCDCCDDDD0F0F00000000000000000F + 0F0DDF8F80FFFFFFFFFFFFFFF08787DDCCCCCCCDDD0F0F0FFFFFFFFFFFFFFF0F + 0F0DDF8F80FFFFFFFFFFFFFFF08787DDCCCDCCDDDD0F0F0FFFFFFFFFFFFFFF0F + 0F0DDF8F80FFFFFFFFFFFFFFF08787DDCDDDCDDDDD0F0F0FFFFFFFFFFFFFFF0F + 0F0DDF8F80FFFFFFFFFFFFFFF08787DDDDDDDDDDDD0F0F0FFFFFFFFFFFFFFF0F + 0F0DDF8F80FFFFFFFFFFFFFFF08787DDDDDDDDDDDD0F0F0FFFFFFFFFFFFFFF0F + 0F0DDF8F80FFFFFFFFFFFFFFF08787DDDDDDDDDDDD0F0F0FFFFFFFFFFFFFFF0F + 0F0DDF8F8000000000000000008787DDDDDDDDDDDD0F0F00000000000000000F + 0F0DDF8F8888888888888888888787DDDDDDDDDDDD0F0FFFFFFFFFFFFFFFFFFF + 0F0DDF8F8000000888888888888787DDDDDDDDDDDD0F0F000000FFFFFFFFFFFF + 0F0DDF8F8888888888888888888787DDDDDDDDDDDD0F0FFFFFFFFFFFFFFFFFFF + 0F0DDF8F8000000888888888888787DDDDDDDDDDDD0F0F000000FFFFFFFFFFFF + 0F0DDF8F8888888888888888888787DDDDDDDDDDDD0F0FFFFFFFFFFFFFFFFFFF + 0F0DDF8FFFFFFFFFFFFFFFFFFFF787DDDDDDDDDDDD0F00000000000000000000 + 0F0DDF888888888888888888888887DDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFFF + FF0DDF8FFFFFFFFFFFFF8777777787DDDDDDDDDDDD0F0000000000000F000000 + 0F0DDF8788888888888F8F88888787DDDDDDDDDDDD0F0FFFFFFFFFFF0F0FFFFF + 0F0DDF8788888888888F8F88888787DDDDDDDDDDDD0F0FFFFFFFFFFF0F0FFFFF + 0F0DDF8777777777777F8F88888787DDCDDDCDDDDD0F0000000000000F0FFFFF + 0F0DDF888888888888888F88888787DDCCCDCCDDDD0FFFFFFFFFFFFFFF0FFFFF + 0F0DDF8FFFFFFFFFFFFF8F88888787DDCCCCCCCDDD0F0000000000000F0FFFFF + 0F0DDF8788888888888F8F80088787DDCCCDCCDDDD0F0FFFFFFFFFFF0F0F00FF + 0F0DDF8788888888888F8F88888787DDCDDDCDDDDD0F0FFFFFFFFFFF0F0FFFFF + 0F0DDF8777777777777F8FFFFFF787DDDDDDDDDDDD0F0000000000000F000000 + 0F0DDF888888888888888888888887DDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFFF + FF0DDFFFFFFFFFFFFFFFFFFFFFFFF7DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object bvlTransparents: TBevel + Left = 76 + Top = 10 + Width = 480 + Height = 4 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object imgPagination: TImage + Left = 9 + Top = 131 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDD0000000000000000000000007DDDDDDDDDDDD77777777777777770DDDDD + DDDDD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD7FFFFFFFFFFFFFFF0DDDDD + DDDDD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD7F7777777777777F0DDDDD + DDDDD0888000000000000000088F07DDDDDDDDDDDD7F78887F88F7FF7F07770D + DDDDD0F8F088887FFFF8FFFF0F8F07DDDDDDDDDDDD7F78887FFFF7FF7F0FFF0D + DDDDD0F8F080087F00F8F00F0F8F07DDDDDDDDDDDD7F7777777777777F077F0D + DDDDD0F8F088887FFFF8FFFF0F8F07DDDDDDDDDDDD7F78887F88F7FF7F0F7F07 + 770DD098F0000000000000000F8907DDDDDDDDDDDD7F78887FFFF7FF7F0F7F0F + FF0DD099FFFFFFFFFFFFFFFFFF9907DDCDDDDCDDDD7F7777777777777F0F7F07 + 7F0DD0999999999999999999999907DDCCCCDCCDDD7F78887FFFF7FF7F0F7F0F + 7F0DD099F0000000000000000F9907DDCCCCCCCCDD7F78787F88F7FF7F0F7F0F + 7F0DD098F088887FFFF8FFFF0F8907DDCCCCDCCDDD7F78887FFFF7FF7F0F7F0F + 7F0DD0F8F088887F88F8F88F0F8F07DDCDDDDCDDDD7F7777777777777F0F7F0F + 7F0DD0F8F080087F00F8F00F0F8F07DDDDDDDDDDDD7F78887FFFF7FF7F0F7F0F + 7F0DD0F8F088887FFFF8FFFF0F8F07DDDDDDDDDDDD7F78787F88F7FF7F0F7F0F + 7F0DD098F0000000000000000F8907DDCDDDDCDDDD7F78887FFFF7FF7F0F7F0F + 7F0DD099FFFFFFFFFFFFFFFFFF9907DDCCCCDCCDDD7F7777777777777F0F7F0F + 7F0DD0999999999999999999999907DDCCCCCCCCDD7F78887FFFF7FF7F0F7F0F + 7F0DD099F0000000000000000F9907DDCCCCDCCDDD7F78787F88F7FF7F0F7F0F + 7F0DD098F088887FFFF8FFFF0F8907DDCDDDDCDDDD7F78887FFFF7FF7F0F7F0F + 7F0DD0F8F088887F88F8F88F0F8F07DDDDDDDDDDDD7F7777777777777F0F7F0F + 7F0DD0F8F080087F00F8F00F0F8F07DDDDDDDDDDDD7FFFFFFFFFFFFFFF0F7F0F + 7F0DD0F8F088887FFFF8FFFF0F8F07DDDDDDDDDDDD00000000000000000F7F0F + 7F0DD0F8F0777778888888880F8F07DDDDDDDDDDDDDDDD7F7777777777777F0F + 7F0DD0F8F088887FFFF8FFFF0F8F07DDDDDDDDDDDDDDDD7FFFFFFFFFFFFFFF0F + 7F0DD0F8F080087F00F8F00F0F8F07DDDDDDDDDDDDDDDD00000000000000000F + 7F0DD0F8F088887FFFF8FFFF0F8807DDDDDDDDDDDDDDDDDDDD7F777777777777 + 7F0DD0888000000000000000088F07DDDDDDDDDDDDDDDDDDDD7FFFFFFFFFFFFF + FF0DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDDDDDDDDDD00000000000000 + 000DD000000000000000000000000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object Bevel1: TBevel + Left = 64 + Top = 115 + Width = 492 + Height = 4 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object bvlSize: TBevel + Left = 31 + Top = 183 + Width = 525 + Height = 4 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object imgSize: TImage + Left = 9 + Top = 199 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000008088807DDDDDDDDDDDD0800000000000000000000 + 807DD0F0FFFFFFFFFFFFFF0FFF0F07DDDDDDDDDDDD0F0FFFFFFFFFFFFFFFFFF0 + F07DD0F0F777777777777F0FFF8F07DDDDDDDDDDDD0F0F7777777777777777F0 + F07DD0F0F7FFFFFFFFFF7F0FFF0F07DDDDDDDDDDDD0F0F7FFFFFFFFFFFFFF7F0 + F07DD0F0F777777777777F0FFF8F07DDDDDDDDDDDD0F0F7777777777777777F0 + F07DD0F0FFFFFFFFFFFFFF0FFF0F07DDCDDDDCDDDD0F0FFFFFFFFFFFFFFFFFF0 + F07DD0F0F777777777777F0FFF8F07DDCCCCDCCDDD0F0F7777777777777777F0 + F07DD0F0F7FFFFFFFFFF7F0FFF0F07DDCCCCCCCCDD0F0F7FFFFFFFFFFFFFF7F0 + F07DD0F0F777777777777F0FFF8F07DDCCCCDCCDDD0F0F7777777777777777F0 + F07DD0F0FFFFFFFFFFFFFF0FFF0F07DDCDDDDCDDDD0F0FFFFFFFFFFFFFFFFFF0 + F07DD0F0F777777777777F0FFF8F07DDDDDDDDDDDD0F0F7777777777777777F0 + F07DD0F0F7FFFFFFFFFF7F0FFF0F07DDDDDDDDDDDD0F0F7FFFFFFFFFFFFFF7F0 + F07DD0F0F7FFFFFFFFFF7F0FFF8F07DDCDDDDCDDDD0F0F7FFFFFFFFFFFFFF7F0 + F07DD0F0F7F888888F8F7F0FFF0F07DDCCCCDCCDDD0F0F7F88888F8F8888F7F0 + F07DD0F0F7FFFFFFFFFF7F0FFF8F07DDCCCCCCCCDD0F0F7FFFFFFFFFFFFFF7F0 + F07DD0F0F7F88F888F8F7F0FFF0F07DDCCCCDCCDDD0F0F7F88F888F8F888F7F0 + F07DD0F0F7FFFFFFFFFF7F0FFF8F07DDCDDDDCDDDD0F0F7FFFFFFFFFFFFFF7F0 + F07DD0F0F777777777777F0FFF0F07DDDDDDDDDDDD0F0F7777777777777777F0 + F07DD0F0FFFFFFFFFFFFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFFFFFFFFFFFFFF0 + F07DD0F0F7777777F7777F0FFF0F07DDDDDDDDDDDD0F0F777777777F777777F0 + F07DD0F0F7FFFFF7F7FF7F0FFF8F07DDDDDDDDDDDD0F0F7FFFFFFF7F7FFFF7F0 + F07DD0F0F7777777F7777F0FFF0F07DDDDDDDDDDDD0F0F777777777F777777F0 + F07DD0F0FFFFFFFFFFFFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFFFFFFFFFFFFFF0 + F07DD0800000000000000008080807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblTransparents: TLabel + Left = 5 + Top = 5 + Width = 64 + Height = 13 + Caption = 'Transparents' + end + object lblPagination: TLabel + Left = 5 + Top = 110 + Width = 50 + Height = 13 + Caption = 'Pagination' + end + object lblSize: TLabel + Left = 5 + Top = 178 + Width = 19 + Height = 13 + Caption = 'Size' + end + object chbxTransparentRoot: TCheckBox + Left = 90 + Top = 26 + Width = 166 + Height = 17 + Caption = '&Root' + TabOrder = 0 + OnClick = TransparentClick + end + object chbxTransparentControls: TCheckBox + Tag = 1 + Left = 90 + Top = 47 + Width = 166 + Height = 17 + Caption = 'Controls' + TabOrder = 1 + OnClick = TransparentClick + end + object chbxTransparentContainers: TCheckBox + Tag = 2 + Left = 90 + Top = 67 + Width = 166 + Height = 17 + Caption = 'Containers' + TabOrder = 2 + OnClick = TransparentClick + end + object chbxTransparentGraphics: TCheckBox + Tag = 3 + Left = 90 + Top = 88 + Width = 166 + Height = 17 + Caption = '&Graphics' + TabOrder = 3 + OnClick = TransparentClick + end + object chbxTransparentGroups: TCheckBox + Tag = 4 + Left = 270 + Top = 26 + Width = 166 + Height = 17 + Caption = '&Groups' + TabOrder = 4 + OnClick = TransparentClick + end + object chbxTransparentItems: TCheckBox + Tag = 5 + Left = 270 + Top = 47 + Width = 166 + Height = 17 + Caption = '&Items' + TabOrder = 5 + OnClick = TransparentClick + end + object chbxPaginateByControlDetails: TCheckBox + Left = 90 + Top = 131 + Width = 166 + Height = 17 + Caption = 'Control Details' + TabOrder = 6 + OnClick = PaginationClick + end + object chbxPaginateByControls: TCheckBox + Tag = 1 + Left = 90 + Top = 152 + Width = 166 + Height = 17 + Caption = 'Controls' + TabOrder = 7 + OnClick = PaginationClick + end + object chbxPaginateByGroups: TCheckBox + Tag = 2 + Left = 270 + Top = 131 + Width = 166 + Height = 17 + Caption = '&Groups' + TabOrder = 8 + OnClick = PaginationClick + end + object chbxPaginateByItems: TCheckBox + Tag = 3 + Left = 270 + Top = 152 + Width = 166 + Height = 17 + Caption = '&Items' + TabOrder = 9 + OnClick = PaginationClick + end + object chbxAutoWidth: TCheckBox + Left = 90 + Top = 199 + Width = 166 + Height = 17 + Caption = 'Auto Width' + TabOrder = 10 + OnClick = SizeClick + end + end + object tshReportLinks: TTabSheet + Caption = 'Aggregated Links' + ImageIndex = 1 + OnResize = tshReportLinksResize + object pnlBtnSite: TPanel + Left = 474 + Top = 0 + Width = 92 + Height = 243 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object btnLinksDesign: TButton + Left = 7 + Top = 22 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Design...' + TabOrder = 0 + OnClick = DesignClick + end + object btnLinksRemoveInconsistents: TButton + Left = 7 + Top = 50 + Width = 80 + Height = 37 + Caption = 'Remove Unneeded' + TabOrder = 1 + OnClick = btnLinksRemoveInconsistentsClick + end + end + object pnlLinkListsSite: TPanel + Left = 0 + Top = 0 + Width = 474 + Height = 243 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object pnlAvailableLinksSite: TPanel + Left = 0 + Top = 0 + Width = 216 + Height = 243 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object lblAvailableLinks: TLabel + Left = 1 + Top = 5 + Width = 73 + Height = 13 + Caption = '&Available Links:' + FocusControl = lbxAvailableLinks + end + object lbxAvailableLinks: TListBox + Left = 0 + Top = 22 + Width = 216 + Height = 221 + Style = lbOwnerDrawFixed + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + DragMode = dmAutomatic + ItemHeight = 15 + MultiSelect = True + TabOrder = 0 + OnClick = lbxAggregatedLinksClick + OnDblClick = lbxAvailableLinksDblClick + OnDragDrop = lbxAvailableLinksDragDrop + OnDragOver = lbxAvailableLinksDragOver + OnDrawItem = lbxAggregatedLinksDrawItem + OnKeyDown = lbxAvailableLinksKeyDown + end + end + object pnlMoveButtonsSite: TPanel + Left = 216 + Top = 0 + Width = 42 + Height = 243 + Align = alLeft + BevelOuter = bvNone + TabOrder = 1 + object sbtnRemove: TSpeedButton + Left = 8 + Top = 133 + Width = 26 + Height = 26 + Glyph.Data = { + F6000000424DF600000000000000760000002800000010000000100000000100 + 0400000000008000000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00DDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD0DD + DDDDDDDDDDDD00DDDDDDDDDDDDD000DDDDDDDDDDDD0000DDDDDDDDDDD00000DD + DDDDDDDDDD0000DDDDDDDDDDDDD000DDDDDDDDDDDDDD00DDDDDDDDDDDDDDD0DD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD} + OnClick = sbtnRemoveClick + end + object sbtnAdd: TSpeedButton + Left = 8 + Top = 98 + Width = 26 + Height = 26 + Glyph.Data = { + F6000000424DF600000000000000760000002800000010000000100000000100 + 0400000000008000000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00DDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD0DDDDD + DDDDDDDDDD00DDDDDDDDDDDDDD000DDDDDDDDDDDDD0000DDDDDDDDDDDD00000D + DDDDDDDDDD0000DDDDDDDDDDDD000DDDDDDDDDDDDD00DDDDDDDDDDDDDD0DDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD} + OnClick = sbtnAddClick + end + end + object pnlAggregatedLinksSite: TPanel + Left = 258 + Top = 0 + Width = 216 + Height = 243 + Align = alClient + BevelOuter = bvNone + TabOrder = 2 + object lblAggregatedLinks: TLabel + Left = 1 + Top = 5 + Width = 87 + Height = 13 + Caption = 'A&ggregated Links:' + FocusControl = lbxAggregatedLinks + end + object lbxAggregatedLinks: TListBox + Left = 0 + Top = 22 + Width = 216 + Height = 221 + Style = lbOwnerDrawFixed + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + DragMode = dmAutomatic + ItemHeight = 15 + MultiSelect = True + TabOrder = 0 + OnClick = lbxAggregatedLinksClick + OnDblClick = lbxAggregatedLinksDblClick + OnDragDrop = lbxAggregatedLinksDragDrop + OnDragOver = lbxAggregatedLinksDragOver + OnDrawItem = lbxAggregatedLinksDrawItem + OnKeyDown = lbxAggregatedLinksKeyDown + end + end + end + end + object tshControls: TTabSheet + Caption = 'Controls' + ImageIndex = 2 + object btnControlsCheckAll: TButton + Left = 481 + Top = 4 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Check All' + TabOrder = 1 + OnClick = TreeViewCheckAllClick + end + object btnControlsExpandAll: TButton + Left = 481 + Top = 32 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'E&xpand All' + TabOrder = 2 + OnClick = TreeViewExpandAllClick + end + object tvControls: TTreeView + Left = 0 + Top = 0 + Width = 474 + Height = 243 + Align = alLeft + Anchors = [akLeft, akTop, akRight, akBottom] + HideSelection = False + Indent = 19 + ReadOnly = True + StateImages = ilControls + TabOrder = 0 + OnChange = TreeViewChange + OnClick = TreeViewClick + OnCustomDrawItem = TreeViewCustomDrawItem + OnKeyDown = TreeViewKeyDown + OnKeyPress = TreeViewKeyPress + OnMouseUp = TreeViewMouseUp + end + end + object tshHiddenControls: TTabSheet + Caption = 'Hidden Controls' + ImageIndex = 3 + object tvHiddenControls: TTreeView + Left = 0 + Top = 0 + Width = 474 + Height = 243 + Align = alLeft + Anchors = [akLeft, akTop, akRight, akBottom] + HideSelection = False + Indent = 19 + ReadOnly = True + StateImages = ilControls + TabOrder = 0 + OnChange = TreeViewChange + OnClick = TreeViewClick + OnCustomDrawItem = TreeViewCustomDrawItem + OnKeyDown = TreeViewKeyDown + OnKeyPress = TreeViewKeyPress + OnMouseUp = TreeViewMouseUp + end + object btnHiddenControlsCheckAll: TButton + Left = 481 + Top = 4 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Check All' + TabOrder = 1 + OnClick = TreeViewCheckAllClick + end + object btnHiddenControlsExpandAll: TButton + Left = 481 + Top = 32 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'E&xpand All' + TabOrder = 2 + OnClick = TreeViewExpandAllClick + end + end + end + object pmControls: TPopupMenu + Images = ilControlsPopup + OnPopup = pmControlsPopup + Left = 4 + Top = 285 + object miControlsCheckAll: TMenuItem + Caption = 'Check All' + ImageIndex = 0 + OnClick = TreeViewCheckAllClick + end + object miLine1: TMenuItem + Caption = '-' + end + object miControlsCheckStandardControls: TMenuItem + Caption = 'Check Standard Unprintable Controls' + Visible = False + OnClick = UnhideStandardControlsClick + end + object miControlsUncheckStandardControls: TMenuItem + Caption = 'Uncheck Standard Unprintable Controls' + Visible = False + OnClick = HideStandardControlsClick + end + object miLine2: TMenuItem + Caption = '-' + Visible = False + end + object miControlsCheckAllChildren: TMenuItem + Caption = 'Check All Children' + OnClick = TreeViewCheckAllChildrenClick + end + object miControlsUncheckAllChildren: TMenuItem + Caption = 'Uncheck All Children' + OnClick = TreeViewUncheckAllChildrenClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miControlsExpandAll: TMenuItem + Caption = 'Expand All' + ImageIndex = 1 + OnClick = TreeViewExpandAllClick + end + end + object ilControls: TImageList + Left = 32 + Top = 285 + end + object ilControlsPopup: TImageList + Left = 60 + Top = 285 + Bitmap = { + 494C010105000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000002000000001002000000000000020 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000007F7F7F007F7F7F007F7F7F0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F00000000007F7F + 7F007F7F7F000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000007F7F + 7F00000000000000000000000000000000000000000000000000000000000000 + 0000000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F000000 + 00000000000000000000BFBFBF00BFBFBF00BFBFBF0000000000000000000000 + 000000000000000000007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F0000000000BFBF + BF007F7F7F000000000000000000BFBFBF00BFBFBF00000000007F7F7F00BFBF + BF0000000000000000007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F00BFBF + BF007F7F7F00BFBFBF00BFBFBF007F7F7F0000000000BFBFBF007F7F7F007F7F + 7F007F7F7F007F7F7F007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000BFBFBF00BFBFBF0000000000FFFFFF00FFFFFF0000000000BFBFBF000000 + 00000000000000000000000000007F7F7F000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000BFBFBF000000 + 0000BFBFBF0000000000BFBFBF00BFBFBF00BFBFBF00FFFFFF007F7F7F000000 + 0000BFBFBF00BFBFBF00000000007F7F7F000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000BFBFBF00BFBF + BF00FFFFFF00000000007F7F7F0000000000BFBFBF00FFFFFF007F7F7F00BFBF + BF00BFBFBF00BFBFBF00000000007F7F7F000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000000000000000 + 0000FFFFFF00000000007F7F7F007F7F7F00BFBFBF0000000000BFBFBF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000BFBFBF00FFFFFF00000000000000000000000000BFBFBF00BFBFBF000000 + 0000000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F00BFBF + BF007F7F7F00BFBFBF00FFFFFF00FFFFFF00BFBFBF00BFBFBF007F7F7F007F7F + 7F007F7F7F00000000007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F0000000000BFBF + BF007F7F7F000000000000000000BFBFBF000000000000000000BFBFBF00BFBF + BF00000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F000000 + 00007F7F7F0000000000BFBFBF00BFBFBF00BFBFBF00000000007F7F7F000000 + 00007F7F7F000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000007F7F + 7F0000000000000000000000000000000000000000007F7F7F00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000007F7F7F007F7F7F007F7F7F0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000808080000000000000000000000000000000 + 0000000000000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000808080000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF0000800000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000808080000000000000000000FFFFFF00FFFFFF00FFFFFF0000800000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000808080000000000000000000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00C0C0C000000000000000000000000000000000008080 + 8000000000000000000000000000FFFFFF00FFFFFF0000800000008000000080 + 0000FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF00FFFFFF0000800000008000000080 + 0000FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 000000000000C0C0C00000000000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00C0C0C000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF0000000000FFFFFF000080000000800000008000000080 + 000000800000FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF000080000000800000008000000080 + 000000800000FFFFFF00FFFFFF00000000000000000000000000000000000000 + 000000000000C0C0C00000000000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00C0C0C000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF0000000000FFFFFF000080000000800000FFFFFF000080 + 00000080000000800000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF000080000000800000FFFFFF000080 + 00000080000000800000FFFFFF00000000000000000000000000000000000000 + 000000000000C0C0C00000000000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00C0C0C000000000008080800000000000000000000000 + 0000FFFFFF00FFFFFF0000000000FFFFFF0000800000FFFFFF00FFFFFF00FFFF + FF000080000000800000FFFFFF00000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000800000FFFFFF00FFFFFF00FFFF + FF000080000000800000FFFFFF00000000000000000000000000000000000000 + 000000000000C0C0C00000000000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00C0C0C0000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF000080000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000800000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000800000FFFFFF00000000000000000000000000000000000000 + 000000000000C0C0C00000000000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00C0C0C0000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF000080000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 000000000000C0C0C00000000000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C0000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF000080000080808000000000000000000000000000000000000000 + 0000000000000000000000000000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0080808000000000000000000000000000000000000000 + 0000000000000000000000000000808080000000000000000000000000000000 + 000000000000C0C0C00080808000000000000000000000000000000000000000 + 00000000000000000000000000008080800000000000FFFFFF00008000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000800000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C00000000000000000000000000000000000FFFFFF00008000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000808080000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000808080000000000000000000000000000000000000000000000000000000 + 00000000000080808000000000000000000000000000FFFFFF00008000008080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000800000FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000008080800000000000000000000000 + 0000000000000000000000000000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF00FC7F000000000000FC27000000000000 + EC23000000000000C4010000000000008001000000000000C001000000000000 + E000000000000000000000000000000000000000000000000003000000000000 + E003000000000000C0010000000000008003000000000000C407000000000000 + EC3F000000000000FC7F000000000000FC00BBFFBC00BC00FC00BB00BC00BC00 + FC00B800B000B000E000BB0080008000E000BBFFB000B000E000B003B000B000 + 00008003B000B0000000B003B000B0000000BFFFB000B0000000B00380008000 + 00078003B003B0030007B003B003B0030007BFFFBFFFBFFF003F003F00030003 + 003F003F00030003003F003F0003000300000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxPSCore.dcu b/official/x.35/Lib/D11/dxPSCore.dcu new file mode 100644 index 00000000..6996d21f Binary files /dev/null and b/official/x.35/Lib/D11/dxPSCore.dcu differ diff --git a/official/x.35/Lib/D11/dxPSCoreD11.bpl b/official/x.35/Lib/D11/dxPSCoreD11.bpl new file mode 100644 index 00000000..91473ace Binary files /dev/null and b/official/x.35/Lib/D11/dxPSCoreD11.bpl differ diff --git a/official/x.35/Lib/D11/dxPSCoreD11.dcp b/official/x.35/Lib/D11/dxPSCoreD11.dcp new file mode 100644 index 00000000..86aaf015 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSCoreD11.dcp differ diff --git a/official/x.35/Lib/D11/dxPSCoreD11.dcu b/official/x.35/Lib/D11/dxPSCoreD11.dcu new file mode 100644 index 00000000..c6417ad1 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSCoreD11.dcu differ diff --git a/official/x.35/Lib/D11/dxPSDBBasedXplorer.dcu b/official/x.35/Lib/D11/dxPSDBBasedXplorer.dcu new file mode 100644 index 00000000..7d782bfd Binary files /dev/null and b/official/x.35/Lib/D11/dxPSDBBasedXplorer.dcu differ diff --git a/official/x.35/Lib/D11/dxPSDBBasedXplorerReg.dcu b/official/x.35/Lib/D11/dxPSDBBasedXplorerReg.dcu new file mode 100644 index 00000000..b958f374 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSDBBasedXplorerReg.dcu differ diff --git a/official/x.35/Lib/D11/dxPSDBCtrlLnkReg.dcu b/official/x.35/Lib/D11/dxPSDBCtrlLnkReg.dcu new file mode 100644 index 00000000..2005b71b Binary files /dev/null and b/official/x.35/Lib/D11/dxPSDBCtrlLnkReg.dcu differ diff --git a/official/x.35/Lib/D11/dxPSDBCtrlLnks.dcu b/official/x.35/Lib/D11/dxPSDBCtrlLnks.dcu new file mode 100644 index 00000000..d95cc190 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSDBCtrlLnks.dcu differ diff --git a/official/x.35/Lib/D11/dxPSDBCtrlProducers.dcu b/official/x.35/Lib/D11/dxPSDBCtrlProducers.dcu new file mode 100644 index 00000000..91a298b0 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSDBCtrlProducers.dcu differ diff --git a/official/x.35/Lib/D11/dxPSDBTCLnk.dcu b/official/x.35/Lib/D11/dxPSDBTCLnk.dcu new file mode 100644 index 00000000..0aa60481 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSDBTCLnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPSDBTCLnkReg.dcu b/official/x.35/Lib/D11/dxPSDBTCLnkReg.dcu new file mode 100644 index 00000000..7d417a9e Binary files /dev/null and b/official/x.35/Lib/D11/dxPSDBTCLnkReg.dcu differ diff --git a/official/x.35/Lib/D11/dxPSDBTeeChartD11.bpl b/official/x.35/Lib/D11/dxPSDBTeeChartD11.bpl new file mode 100644 index 00000000..839e9c73 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSDBTeeChartD11.bpl differ diff --git a/official/x.35/Lib/D11/dxPSDBTeeChartD11.dcp b/official/x.35/Lib/D11/dxPSDBTeeChartD11.dcp new file mode 100644 index 00000000..f00cdc3c Binary files /dev/null and b/official/x.35/Lib/D11/dxPSDBTeeChartD11.dcp differ diff --git a/official/x.35/Lib/D11/dxPSDBTeeChartD11.dcu b/official/x.35/Lib/D11/dxPSDBTeeChartD11.dcu new file mode 100644 index 00000000..3b1f5b72 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSDBTeeChartD11.dcu differ diff --git a/official/x.35/Lib/D11/dxPSDsgImgs.res b/official/x.35/Lib/D11/dxPSDsgImgs.res new file mode 100644 index 00000000..31c9e507 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSDsgImgs.res differ diff --git a/official/x.35/Lib/D11/dxPSDsgProxies.dcu b/official/x.35/Lib/D11/dxPSDsgProxies.dcu new file mode 100644 index 00000000..58953ef5 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSDsgProxies.dcu differ diff --git a/official/x.35/Lib/D11/dxPSDsgUtils.dcu b/official/x.35/Lib/D11/dxPSDsgUtils.dcu new file mode 100644 index 00000000..3abf0e9a Binary files /dev/null and b/official/x.35/Lib/D11/dxPSDsgUtils.dcu differ diff --git a/official/x.35/Lib/D11/dxPSESys.dcu b/official/x.35/Lib/D11/dxPSESys.dcu new file mode 100644 index 00000000..b9c457b8 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSESys.dcu differ diff --git a/official/x.35/Lib/D11/dxPSEdgePatterns.dcu b/official/x.35/Lib/D11/dxPSEdgePatterns.dcu new file mode 100644 index 00000000..30fe3662 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSEdgePatterns.dcu differ diff --git a/official/x.35/Lib/D11/dxPSEngn.dcu b/official/x.35/Lib/D11/dxPSEngn.dcu new file mode 100644 index 00000000..fd50e3f9 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSEngn.dcu differ diff --git a/official/x.35/Lib/D11/dxPSEvnt.dcu b/official/x.35/Lib/D11/dxPSEvnt.dcu new file mode 100644 index 00000000..84b9f880 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSEvnt.dcu differ diff --git a/official/x.35/Lib/D11/dxPSExcelEdgePatterns.dcu b/official/x.35/Lib/D11/dxPSExcelEdgePatterns.dcu new file mode 100644 index 00000000..b166964c Binary files /dev/null and b/official/x.35/Lib/D11/dxPSExcelEdgePatterns.dcu differ diff --git a/official/x.35/Lib/D11/dxPSExcelFillPatterns.dcu b/official/x.35/Lib/D11/dxPSExcelFillPatterns.dcu new file mode 100644 index 00000000..53e2282b Binary files /dev/null and b/official/x.35/Lib/D11/dxPSExcelFillPatterns.dcu differ diff --git a/official/x.35/Lib/D11/dxPSExtDlgs.dcu b/official/x.35/Lib/D11/dxPSExtDlgs.dcu new file mode 100644 index 00000000..f9103a44 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSExtDlgs.dcu differ diff --git a/official/x.35/Lib/D11/dxPSExtDlgs.res b/official/x.35/Lib/D11/dxPSExtDlgs.res new file mode 100644 index 00000000..3c35386c Binary files /dev/null and b/official/x.35/Lib/D11/dxPSExtDlgs.res differ diff --git a/official/x.35/Lib/D11/dxPSFileBasedXplorer.dcu b/official/x.35/Lib/D11/dxPSFileBasedXplorer.dcu new file mode 100644 index 00000000..a965d973 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSFileBasedXplorer.dcu differ diff --git a/official/x.35/Lib/D11/dxPSFillPatterns.dcu b/official/x.35/Lib/D11/dxPSFillPatterns.dcu new file mode 100644 index 00000000..5ec7f335 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSFillPatterns.dcu differ diff --git a/official/x.35/Lib/D11/dxPSForm.dcu b/official/x.35/Lib/D11/dxPSForm.dcu new file mode 100644 index 00000000..3fc2c120 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSForm.dcu differ diff --git a/official/x.35/Lib/D11/dxPSGlbl.dcu b/official/x.35/Lib/D11/dxPSGlbl.dcu new file mode 100644 index 00000000..2ebe439a Binary files /dev/null and b/official/x.35/Lib/D11/dxPSGlbl.dcu differ diff --git a/official/x.35/Lib/D11/dxPSGrLnks.dcu b/official/x.35/Lib/D11/dxPSGrLnks.dcu new file mode 100644 index 00000000..eae7590c Binary files /dev/null and b/official/x.35/Lib/D11/dxPSGrLnks.dcu differ diff --git a/official/x.35/Lib/D11/dxPSGraphicLnk.dcu b/official/x.35/Lib/D11/dxPSGraphicLnk.dcu new file mode 100644 index 00000000..7638f50b Binary files /dev/null and b/official/x.35/Lib/D11/dxPSGraphicLnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPSHFToolBarBld.dcu b/official/x.35/Lib/D11/dxPSHFToolBarBld.dcu new file mode 100644 index 00000000..b026f027 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSHFToolBarBld.dcu differ diff --git a/official/x.35/Lib/D11/dxPSImgLnk.dcu b/official/x.35/Lib/D11/dxPSImgLnk.dcu new file mode 100644 index 00000000..69418d84 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSImgLnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPSImgs.dcu b/official/x.35/Lib/D11/dxPSImgs.dcu new file mode 100644 index 00000000..2c56d1eb Binary files /dev/null and b/official/x.35/Lib/D11/dxPSImgs.dcu differ diff --git a/official/x.35/Lib/D11/dxPSImgs.res b/official/x.35/Lib/D11/dxPSImgs.res new file mode 100644 index 00000000..4084eab3 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSImgs.res differ diff --git a/official/x.35/Lib/D11/dxPSLVLnk.dcu b/official/x.35/Lib/D11/dxPSLVLnk.dcu new file mode 100644 index 00000000..7581fac1 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSLVLnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPSLVLnk.dfm b/official/x.35/Lib/D11/dxPSLVLnk.dfm new file mode 100644 index 00000000..b1ec1764 --- /dev/null +++ b/official/x.35/Lib/D11/dxPSLVLnk.dfm @@ -0,0 +1,699 @@ +object dxfmLVReportLinkDesignWindow: TdxfmLVReportLinkDesignWindow + Left = 489 + Top = 374 + BorderStyle = bsDialog + Caption = 'dxfmLVReportLinkDesignWindow' + ClientHeight = 354 + ClientWidth = 555 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 38 + Width = 547 + Height = 281 + ActivePage = tshColor + MultiLine = True + TabOrder = 0 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = 'Options' + object pnlOptions: TPanel + Left = 0 + Top = 0 + Width = 539 + Height = 253 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblShow: TLabel + Left = 5 + Top = 12 + Width = 26 + Height = 13 + Caption = 'Show' + end + object Bevel11: TBevel + Left = 40 + Top = 17 + Width = 194 + Height = 4 + Shape = bsBottomLine + end + object imgGrid: TImage + Left = 6 + Top = 37 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object Bevel1: TBevel + Left = 89 + Top = 98 + Width = 145 + Height = 4 + Shape = bsBottomLine + end + object lblOnEveryPage: TLabel + Left = 5 + Top = 147 + Width = 72 + Height = 13 + Caption = 'On Every Page' + end + object Image1: TImage + Left = 6 + Top = 174 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888777777777777777708888888888 + 888887FFFFFFFFFFFFFFF08888888888888887F7777777777777F07777708888 + 888887F7777777777777F0FFFFF08888888887F7777777777777F07777F07777 + 708887FFFFFFFFFFFFFFF07777F0FFFFF08887F777777777777FF07777F07777 + F08887FFFFFFFFFFFFFFF0FFFFF07777F08887F77777777777FFF077FFF07777 + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777777FFFFF0777FF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777FFFFFFFF07FFFF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF0777FF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF077FFF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777777F077FFF077FF + F08887F7777777777777F0FFFFF0FFFFF08887F7777777777777F0FFFFF07FFF + F08887FFFFFFFFFFFFFFF07777F0FFFFF0888000000000000000007777F077FF + F08888888887F7777777777777F0FFFFF08888888887FFFFFFFFFFFFFFF07777 + F0888888888000000000000000007777F08888888888888887F7777777777777 + F08888888888888887FFFFFFFFFFFFFFF0888888888888888000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object Bevel10: TBevel + Left = 83 + Top = 152 + Width = 151 + Height = 4 + Shape = bsBottomLine + end + object chbxShowVertLines: TCheckBox + Tag = 2 + Left = 95 + Top = 73 + Width = 143 + Height = 17 + Caption = 'Vertical Lines' + TabOrder = 2 + OnClick = chbxShowBordersClick + end + object chbxShowBorders: TCheckBox + Left = 95 + Top = 30 + Width = 143 + Height = 17 + Caption = 'Border' + TabOrder = 0 + OnClick = chbxShowBordersClick + end + object chbxShowHorzLines: TCheckBox + Tag = 1 + Left = 95 + Top = 51 + Width = 143 + Height = 17 + Caption = 'Horizontal Lines' + TabOrder = 1 + OnClick = chbxShowBordersClick + end + object chbxShowColumnHeaders: TCheckBox + Left = 95 + Top = 114 + Width = 143 + Height = 17 + Caption = '&Column Headers' + TabOrder = 3 + OnClick = chbxShowColumnHeadersClick + end + object chbxHeadersOnEveryPage: TCheckBox + Left = 95 + Top = 168 + Width = 143 + Height = 17 + Caption = 'Headers' + TabOrder = 4 + OnClick = chbxHeadersOnEveryPageClick + end + object lblPreview: TStaticText + Left = 244 + Top = 1 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 5 + end + end + end + object tshColor: TTabSheet + Caption = 'Color' + object pnlColor: TPanel + Left = 0 + Top = 0 + Width = 539 + Height = 253 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblGridLinesColor: TLabel + Left = 6 + Top = 217 + Width = 81 + Height = 13 + Caption = '&Grid Lines Color: ' + end + object bvlGridLineColorHost: TBevel + Left = 91 + Top = 213 + Width = 128 + Height = 21 + Visible = False + end + object lblDrawMode: TLabel + Left = 5 + Top = 16 + Width = 58 + Height = 13 + Caption = 'Draw &Mode:' + FocusControl = cbxDrawMode + end + object gbxTransparentHeaders: TGroupBox + Left = 5 + Top = 141 + Width = 225 + Height = 58 + Caption = ' ' + TabOrder = 4 + object lblHeadersColor: TLabel + Left = 6 + Top = 24 + Width = 75 + Height = 13 + Caption = 'Headers Color: ' + end + object bvlHeadersColorHost: TBevel + Left = 86 + Top = 22 + Width = 128 + Height = 21 + Visible = False + end + end + object gbxTransparent: TGroupBox + Left = 5 + Top = 50 + Width = 225 + Height = 84 + Caption = ' ' + TabOrder = 2 + object lblColor: TLabel + Left = 6 + Top = 26 + Width = 35 + Height = 13 + Caption = 'Co&lor : ' + end + object bvlColorHost: TBevel + Left = 86 + Top = 22 + Width = 128 + Height = 21 + Visible = False + end + object lblEvenColor: TLabel + Left = 6 + Top = 53 + Width = 59 + Height = 13 + Caption = 'E&ven Color: ' + end + object bvlEvenColorHost: TBevel + Left = 86 + Top = 49 + Width = 128 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 18 + Top = 48 + Width = 15 + Height = 17 + TabOrder = 1 + OnClick = chbxTransparentClick + end + object chbxTransparentHeaders: TCheckBox + Tag = 1 + Left = 18 + Top = 139 + Width = 15 + Height = 17 + Caption = 'T&ransparent Headers' + TabOrder = 3 + OnClick = chbxTransparentClick + end + object cbxDrawMode: TComboBox + Left = 69 + Top = 11 + Width = 162 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 0 + OnClick = cbxDrawModeClick + OnDrawItem = cbxDrawModeDrawItem + Items.Strings = ( + 'Simpe' + 'Odd\Even Rows Mode' + 'Chess' + 'Borrow From Source') + end + object stTransparent: TStaticText + Left = 33 + Top = 50 + Width = 69 + Height = 17 + Caption = ' Transparent ' + FocusControl = chbxTransparent + TabOrder = 5 + OnClick = stTransparentClick + end + object stTransparentHeaders: TStaticText + Left = 33 + Top = 140 + Width = 112 + Height = 17 + Caption = ' Transaprent Headers ' + FocusControl = chbxTransparentHeaders + TabOrder = 6 + OnClick = stTransparentHeadersClick + end + end + end + object tshFont: TTabSheet + Caption = 'Font' + object pnlFont: TPanel + Left = 0 + Top = 0 + Width = 539 + Height = 253 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object btnFont: TButton + Left = 8 + Top = 9 + Width = 110 + Height = 23 + Caption = 'Fo&nt...' + TabOrder = 0 + OnClick = btnFontClick + end + object edFont: TEdit + Left = 8 + Top = 38 + Width = 221 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + end + object btnHeadersFont: TButton + Tag = 2 + Left = 8 + Top = 129 + Width = 110 + Height = 23 + Caption = 'Headers Font...' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 4 + OnClick = btnFontClick + end + object edFixedFont: TEdit + Left = 8 + Top = 158 + Width = 221 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 5 + end + object btnEvenFont: TButton + Tag = 1 + Left = 8 + Top = 69 + Width = 110 + Height = 23 + Caption = 'E&ven Font...' + TabOrder = 2 + OnClick = btnFontClick + end + object edEvenFont: TEdit + Left = 8 + Top = 98 + Width = 221 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 3 + end + end + end + object tshBehaviors: TTabSheet + Caption = 'Behaviors' + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 539 + Height = 253 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Image3: TImage + Left = 7 + Top = 35 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblSelection: TLabel + Left = 5 + Top = 12 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object Bevel3: TBevel + Left = 53 + Top = 17 + Width = 181 + Height = 4 + Shape = bsBottomLine + end + object lblLookAndFeel: TLabel + Left = 5 + Top = 83 + Width = 67 + Height = 13 + Caption = 'Look And Feel' + end + object Bevel15: TBevel + Left = 85 + Top = 87 + Width = 149 + Height = 4 + Shape = bsBottomLine + end + object Image8: TImage + Left = 7 + Top = 106 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D08777777777780877777788807DCCCCDCCDDD0877777777778787777788 + 8F07D08888888888880888888888807DCCCCCCCCDD0888888888888788888888 + 8F07D00000000000000000000000007DCCCCDCCDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F7777777FF07DDDDDDDDDDD0F777777777FF7F7777777 + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F777777FFF07DDDDDDDDDDD0F777777FFFFF7F777777F + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F7777777777F7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F77777FFFF07DDDDDDDDDDD0F77777777FFF7F77777FF + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D00000000000000000000000007DCDDDDCDDDD0000000000000000000000 + 0007D08888888888880888888888807DCCCCDCCDDD0777777777777777777777 + 7707D08888888888880888888888807DCCCCCCCCDD0F88888888888788888888 + 8707D08000000008880880000000807DCCCCDCCDDD0F00000000888788000000 + 8707D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + F707D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblMiscellaneous: TLabel + Left = 5 + Top = 151 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + end + object Bevel4: TBevel + Left = 78 + Top = 156 + Width = 156 + Height = 4 + Shape = bsBottomLine + end + object Image5: TImage + Left = 7 + Top = 174 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000008088F07DDDDDDDDDDDD0800000000000000000000 + 807DD0F0FFFF8FFFF8FFFF0FFF0F07DDDDDDDDDDDD0F0F77FFF8F777F8F777F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCDDDDCDDDD0F0F00FFF8F00FF8F00FF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCCCCCDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCDDDDCDDDD0F0FFFFFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCCCCDCCDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCCCCCDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCDCCDDD0F0FFFFFF8F0FFF8F0FFF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0777777777777770FFF0F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F0F8887F8887F8880FFF8F07DDDDDDDDDDDD0F0F888887F88887F88880 + F07DD0F0F0087F0087F0080FFF0F07DDDDDDDDDDDD0F0F800087F80087F80080 + F07DD0F0FFFF7FFFF7FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF7FFFFF7FFFFF0 + F07DD0800000000000000008080807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxIncludeFixed: TCheckBox + Left = 95 + Top = 55 + Width = 143 + Height = 17 + Caption = '&Including fixed cells' + TabOrder = 1 + OnClick = chbxIncludeFixedClick + end + object chbxOnlySelected: TCheckBox + Left = 95 + Top = 32 + Width = 143 + Height = 17 + Caption = 'Only &selected cells' + TabOrder = 0 + OnClick = chbxOnlySelectedClick + end + object chbxUse3DEffects: TCheckBox + Tag = 12 + Left = 95 + Top = 104 + Width = 143 + Height = 17 + Caption = '&Use 3D Effects' + TabOrder = 2 + OnClick = chbxUse3DEffectsClick + end + object chbxUseSoft3D: TCheckBox + Tag = 13 + Left = 95 + Top = 127 + Width = 143 + Height = 17 + Caption = 'Soft &3D' + TabOrder = 3 + OnClick = chbxUseSoft3DClick + end + object chbxRowAutoHeight: TCheckBox + Left = 95 + Top = 199 + Width = 136 + Height = 17 + Caption = '&Row Auto Height' + TabOrder = 5 + OnClick = chbxRowAutoHeightClick + end + object chbxAutoWidth: TCheckBox + Left = 95 + Top = 176 + Width = 136 + Height = 17 + Caption = 'AutoWidth' + TabOrder = 4 + OnClick = chbxAutoWidthClick + end + end + end + end + object pnlPreview: TPanel + Left = 252 + Top = 81 + Width = 290 + Height = 229 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + end + object pnlHint: TPanel + Left = 4 + Top = 5 + Width = 547 + Height = 27 + Alignment = taLeftJustify + BevelOuter = bvNone + BorderStyle = bsSingle + Color = clInfoBk + Ctl3D = False + ParentCtl3D = False + TabOrder = 2 + object imgHint: TImage + Left = 7 + Top = 5 + Width = 16 + Height = 16 + Transparent = True + end + object lblHint: TLabel + Left = 30 + Top = 6 + Width = 370 + Height = 13 + Caption = ' Most Options Are Being Taken Into Account Only In Detailed View' + Font.Charset = DEFAULT_CHARSET + Font.Color = clInfoText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + ParentFont = False + Transparent = True + end + end +end diff --git a/official/x.35/Lib/D11/dxPSLbxLnk.dcu b/official/x.35/Lib/D11/dxPSLbxLnk.dcu new file mode 100644 index 00000000..4442d2a9 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSLbxLnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPSLbxLnk.dfm b/official/x.35/Lib/D11/dxPSLbxLnk.dfm new file mode 100644 index 00000000..1e229d01 --- /dev/null +++ b/official/x.35/Lib/D11/dxPSLbxLnk.dfm @@ -0,0 +1,738 @@ +object dxLBxReportLinkDesignWindow: TdxLBxReportLinkDesignWindow + Left = 441 + Top = 302 + BorderStyle = bsDialog + Caption = 'dxLbxReportLinkDesigner' + ClientHeight = 253 + ClientWidth = 553 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 4 + Width = 545 + Height = 214 + ActivePage = tshColor + MultiLine = True + TabOrder = 1 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = '&Options' + object pnlOptions: TPanel + Left = 0 + Top = 0 + Width = 537 + Height = 186 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblShow: TLabel + Left = 5 + Top = 13 + Width = 26 + Height = 13 + Caption = 'Show' + end + object Bevel11: TBevel + Left = 39 + Top = 17 + Width = 209 + Height = 4 + Shape = bsBottomLine + end + object Bevel4: TBevel + Left = 91 + Top = 84 + Width = 156 + Height = 4 + Shape = bsBottomLine + end + object imgGrid: TImage + Left = 10 + Top = 35 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object chbxPaintItemGraphics: TCheckBox + Left = 90 + Top = 103 + Width = 159 + Height = 17 + Caption = '&Paint item graphics' + TabOrder = 2 + OnClick = chbxPaintItemGraphicsClick + end + object chbxShowBorders: TCheckBox + Left = 90 + Top = 32 + Width = 159 + Height = 17 + Caption = 'Border' + TabOrder = 0 + OnClick = chbxShowBordersClick + end + object chbxShowHorzLines: TCheckBox + Tag = 1 + Left = 90 + Top = 54 + Width = 159 + Height = 17 + Caption = 'Horizontal Lines' + TabOrder = 1 + OnClick = chbxShowBordersClick + end + object chbxTransparentGraphics: TCheckBox + Tag = 1 + Left = 90 + Top = 127 + Width = 159 + Height = 17 + Caption = '&Transparent Graphics' + TabOrder = 3 + OnClick = chbxTransparentGraphicsClick + end + object lblPreview: TStaticText + Left = 257 + Top = 1 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 4 + end + end + end + object tshColor: TTabSheet + Caption = '&Color' + object pnlColor: TPanel + Left = 0 + Top = 0 + Width = 537 + Height = 186 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblGridLinesColor: TLabel + Left = 15 + Top = 150 + Width = 84 + Height = 13 + Caption = '&Grid Lines Color : ' + OnClick = lblComboClick + end + object bvlLineColorHolder: TBevel + Left = 97 + Top = 146 + Width = 135 + Height = 21 + Visible = False + end + object lblDrawMode: TLabel + Left = 5 + Top = 13 + Width = 58 + Height = 13 + Caption = 'Draw &Mode:' + FocusControl = cbxDrawMode + OnClick = lblComboClick + end + object gbxTransparent: TGroupBox + Left = 6 + Top = 46 + Width = 237 + Height = 86 + Caption = ' ' + TabOrder = 2 + object lblColor: TLabel + Left = 9 + Top = 24 + Width = 35 + Height = 13 + Caption = 'Co&lor : ' + OnClick = lblComboClick + end + object bvlColorHolder: TBevel + Left = 90 + Top = 20 + Width = 135 + Height = 21 + Visible = False + end + object lblEvenColor: TLabel + Left = 9 + Top = 48 + Width = 59 + Height = 13 + Caption = 'E&ven Color: ' + OnClick = lblComboClick + end + object bvlEvenColorHolder: TBevel + Left = 90 + Top = 49 + Width = 135 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 18 + Top = 44 + Width = 15 + Height = 17 + Caption = 'T&ransparent' + TabOrder = 1 + OnClick = chbxTransparentClick + end + object cbxDrawMode: TComboBox + Left = 95 + Top = 8 + Width = 148 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 0 + OnClick = cbxDrawModeClick + OnDrawItem = cbxDrawModeDrawItem + Items.Strings = ( + 'Simpe' + 'Odd\Even Rows Mode' + 'Chess' + 'Borrow From Source') + end + object stTransparent: TStaticText + Left = 33 + Top = 45 + Width = 76 + Height = 17 + Caption = ' &Transparent ' + FocusControl = chbxTransparent + TabOrder = 3 + OnClick = stTransparentClick + end + end + end + object tshFont: TTabSheet + Caption = '&Font' + object pnlFont: TPanel + Left = 0 + Top = 0 + Width = 537 + Height = 186 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object btnFont: TButton + Left = 8 + Top = 9 + Width = 110 + Height = 23 + Caption = 'Fo&nt ...' + TabOrder = 0 + OnClick = btnFontClick + end + object edFont: TEdit + Left = 8 + Top = 37 + Width = 233 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + end + object btnEvenFont: TButton + Tag = 1 + Left = 8 + Top = 68 + Width = 110 + Height = 23 + Caption = 'E&ven Font ...' + TabOrder = 2 + OnClick = btnFontClick + end + object edEvenFont: TEdit + Left = 8 + Top = 97 + Width = 233 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 3 + end + end + end + object tshBehaviors: TTabSheet + Caption = '&Behaviors' + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 537 + Height = 186 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Image3: TImage + Left = 10 + Top = 35 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblSelection: TLabel + Left = 5 + Top = 13 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object Bevel3: TBevel + Left = 54 + Top = 16 + Width = 194 + Height = 5 + Shape = bsBottomLine + end + object lblMiscellaneous: TLabel + Left = 5 + Top = 88 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + end + object imgMiscellaneous: TImage + Left = 10 + Top = 110 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000008088F07DDDDDDDDDDDD0800000000000000000000 + 807DD0F0FFFF8FFFF8FFFF0FFF0F07DDDDDDDDDDDD0F0F77FFF8F777F8F777F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCDDDDCDDDD0F0F00FFF8F00FF8F00FF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCCCCCDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCDDDDCDDDD0F0FFFFFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCCCCDCCDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCCCCCDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCDCCDDD0F0FFFFFF8F0FFF8F0FFF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0777777777777770FFF0F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F0F8887F8887F8880FFF8F07DDDDDDDDDDDD0F0F888887F88887F88880 + F07DD0F0F0087F0087F0080FFF0F07DDDDDDDDDDDD0F0F800087F80087F80080 + F07DD0F0FFFF7FFFF7FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF7FFFFF7FFFFF0 + F07DD0800000000000000008080807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object Bevel1: TBevel + Left = 79 + Top = 92 + Width = 169 + Height = 4 + Shape = bsBottomLine + end + object chbxOnlySelected: TCheckBox + Left = 90 + Top = 32 + Width = 148 + Height = 17 + Caption = 'Only &selected cells' + TabOrder = 0 + OnClick = chbxOnlySelectedClick + end + object chbxRowAutoHeight: TCheckBox + Left = 90 + Top = 130 + Width = 148 + Height = 17 + Caption = '&Row Auto Height' + TabOrder = 2 + OnClick = chbxRowAutoHeightClick + end + object chbxAutoWidth: TCheckBox + Left = 90 + Top = 106 + Width = 148 + Height = 17 + Caption = 'AutoWidth' + TabOrder = 1 + OnClick = chbxAutoWidthClick + end + end + end + end + object pnlPreview: TPanel + Left = 265 + Top = 47 + Width = 273 + Height = 160 + BevelInner = bvLowered + BevelOuter = bvNone + Color = clWindow + TabOrder = 0 + end + object ilPreview: TImageList + Left = 5 + Top = 223 + Bitmap = { + 494C010101000500040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000002000000001002000000000000020 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000084000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000840000008400000084000000FF000000840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000084 + 000000840000FFFFFF0000FF0000FFFFFF0000FF000000840000008400000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 0000FFFFFF0000FF0000FFFFFF0000FF000000FF000000840000008400000084 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF0000FF0000FFFFFF0000FF0000FFFFFF0000FF000000840000008400000084 + 0000008400000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 0000FFFFFF00FFFFFF0000FF000000FF000000FF000000840000008400000084 + 0000008400000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF0000FF000000FF000000FF000000FF000000FF000000FF0000008400000084 + 0000008400000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF00000084 + 0000008400000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF00000084 + 0000008400000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000084 + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF + 0000008400000084000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000084000000FF000000FF000000FF000000FF000000FF0000008400000084 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000084000000FF000000FF00000084000000840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000840000008400000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFF000000000000FFFF000000000000 + FF3F000000000000F81F000000000000E00F000000000000C007000000000000 + C003000000000000C003000000000000C003000000000000C003000000000000 + C003000000000000E003000000000000F00F000000000000F83F000000000000 + FCFF000000000000FFFF00000000000000000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxPSLnkReg.dcu b/official/x.35/Lib/D11/dxPSLnkReg.dcu new file mode 100644 index 00000000..d3baa281 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSLnkReg.dcu differ diff --git a/official/x.35/Lib/D11/dxPSLnksD11.bpl b/official/x.35/Lib/D11/dxPSLnksD11.bpl new file mode 100644 index 00000000..143a66c3 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSLnksD11.bpl differ diff --git a/official/x.35/Lib/D11/dxPSLnksD11.dcp b/official/x.35/Lib/D11/dxPSLnksD11.dcp new file mode 100644 index 00000000..a3c13b30 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSLnksD11.dcp differ diff --git a/official/x.35/Lib/D11/dxPSLnksD11.dcu b/official/x.35/Lib/D11/dxPSLnksD11.dcu new file mode 100644 index 00000000..5fdc11b2 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSLnksD11.dcu differ diff --git a/official/x.35/Lib/D11/dxPSPgsMnuBld.dcu b/official/x.35/Lib/D11/dxPSPgsMnuBld.dcu new file mode 100644 index 00000000..75180216 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSPgsMnuBld.dcu differ diff --git a/official/x.35/Lib/D11/dxPSPopupMan.dcu b/official/x.35/Lib/D11/dxPSPopupMan.dcu new file mode 100644 index 00000000..088761af Binary files /dev/null and b/official/x.35/Lib/D11/dxPSPopupMan.dcu differ diff --git a/official/x.35/Lib/D11/dxPSPrVwAdv.dcu b/official/x.35/Lib/D11/dxPSPrVwAdv.dcu new file mode 100644 index 00000000..916eaa57 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSPrVwAdv.dcu differ diff --git a/official/x.35/Lib/D11/dxPSPrVwAdv.dfm b/official/x.35/Lib/D11/dxPSPrVwAdv.dfm new file mode 100644 index 00000000..e8e7f7a8 --- /dev/null +++ b/official/x.35/Lib/D11/dxPSPrVwAdv.dfm @@ -0,0 +1,3491 @@ +object dxfmPreviewWdxBar: TdxfmPreviewWdxBar + Left = 352 + Top = 204 + Width = 893 + Height = 461 + Caption = 'Print Preview' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Icon.Data = { + 0000010001001010100000000000280100001600000028000000100000002000 + 00000100040000000000C0000000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000 + 00000000000000000000000000000FFFFFFFFFF000000FFFFFFF000070000FFF + FFF0788707000FFFFF0788E770000FFFFF08888780000FFFFF08E88780000FFF + FF07EE8770000FFFFFF0788700000FFFFFFF000000000FFFFFFFFFF000000FFF + FFFF000000000FFFFFFF080000000FFFFFFF000000000000000000000000FFFF + 0000000C00000008000000010000000300000003000000030000000300000003 + 000000070000000F0000000F0000000F0000001F0000003F0000007F0000} + KeyPreview = True + Menu = MainMenu1 + OldCreateOrder = True + Position = poDefault + ShowHint = True + PixelsPerInch = 96 + TextHeight = 13 + object dxBarManager: TdxBarManager + AutoHideEmptyBars = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Bars = < + item + Caption = 'MenuBar' + DockedDockingStyle = dsTop + DockedLeft = 0 + DockedTop = 0 + DockingStyle = dsTop + FloatLeft = 0 + FloatTop = 0 + FloatClientWidth = 0 + FloatClientHeight = 0 + IsMainMenu = True + ItemLinks = < + item + Item = bbFile + Visible = True + end + item + Item = bbExplorer + Visible = True + end + item + Item = bbEdit + Visible = True + end + item + Item = bbView + Visible = True + end + item + Item = bbInsert + Visible = True + end + item + Item = bbFormat + Visible = True + end + item + Item = bbGoToPage + Visible = True + end + item + Item = bbTools + Visible = True + end + item + Item = bbHelp + Visible = True + end> + MultiLine = True + Name = 'Build-In Menus' + OneOnRow = True + Row = 0 + UseOwnFont = False + Visible = True + WholeRow = False + end + item + Caption = 'Standard' + DockedDockingStyle = dsTop + DockedLeft = 0 + DockedTop = 23 + DockingStyle = dsTop + FloatLeft = 332 + FloatTop = 321 + FloatClientWidth = 554 + FloatClientHeight = 22 + ItemLinks = < + item + Item = bbFileDesign + Visible = True + end + item + BeginGroup = True + Item = bbFileLoad + Visible = True + end + item + Item = bbFileClose + Visible = True + end + item + Item = bbFileSave + Visible = True + end + item + BeginGroup = True + Item = bbFilePrint + Visible = True + end + item + Item = bbFilePrintDialog + Visible = True + end + item + Item = bbFilePageSetup + Visible = True + end + item + BeginGroup = True + Item = bbViewExplorer + Visible = True + end + item + Item = bbViewThumbnails + Visible = True + end + item + BeginGroup = True + Item = bbFormatTitle + Visible = True + end + item + BeginGroup = True + Item = bbZoomPercent100 + Visible = True + end + item + Item = bbZoomPageWidth + Visible = True + end + item + Item = bbZoomWholePage + Visible = True + end + item + Item = bbZoomTwoPages + Visible = True + end + item + Item = bbZoomMultiplePages + Visible = True + end + item + Item = cbxPredefinedZoom + Visible = True + end + item + BeginGroup = True + Item = bbFormatPageBackground + Visible = True + end + item + Item = bbFormatShrinkToPageWidth + Visible = True + end + item + BeginGroup = True + Item = bbGoToFirstPage + Visible = True + end + item + Item = bbGoToPrevPage + Visible = True + end + item + Item = seActivePage + UserDefine = [udWidth] + UserWidth = 63 + Visible = True + end + item + Item = bbGoToNextPage + Visible = True + end + item + Item = bbGoToLastPage + Visible = True + end + item + BeginGroup = True + Item = bbFileExit + Visible = True + end> + Name = 'Standard' + OneOnRow = True + Row = 1 + UseOwnFont = False + Visible = True + WholeRow = False + end + item + AllowClose = False + Caption = 'Header and Footer' + DockedDockingStyle = dsTop + DockedLeft = 50 + DockedTop = 0 + DockingStyle = dsNone + FloatLeft = 523 + FloatTop = 228 + FloatClientWidth = 601 + FloatClientHeight = 22 + Hidden = True + ItemLinks = < + item + Item = bsiInsertAutoText + Visible = True + end + item + BeginGroup = True + Item = bbInsertHFPageNumber + UserDefine = [udPaintStyle] + Visible = True + end + item + Item = bbInsertHFTotalPages + UserDefine = [udPaintStyle] + Visible = True + end + item + Item = bbInsertHFPageOfPages + Visible = True + end + item + Item = bbFormatPageNumbering + Visible = True + end + item + BeginGroup = True + Item = bbInsertHFDateTime + Visible = True + end + item + Item = bbInsertHFDate + Visible = True + end + item + Item = bbInsertHFTime + Visible = True + end + item + Item = bbFormatDateTime + Visible = True + end + item + BeginGroup = True + Item = bbInsertHFUserName + Visible = True + end + item + Item = bbInsertHFMachineName + UserDefine = [udPaintStyle] + Visible = True + end + item + BeginGroup = True + Item = bbFormatHFClear + Visible = True + end + item + BeginGroup = True + Item = bbFormatHFBackground + Visible = True + end + item + BeginGroup = True + Item = bbFilePageSetup + Visible = True + end + item + Item = bbViewHFSwitchHeaderFooter + Visible = True + end + item + Item = bbViewSwitchToLeftPart + Visible = True + end + item + Item = bbViewSwitchToCenterPart + Visible = True + end + item + Item = bbViewSwitchToRightPart + Visible = True + end + item + BeginGroup = True + Item = bbViewHFClose + Visible = True + end> + Name = 'Header and Footer' + OneOnRow = True + Row = 0 + UseOwnFont = False + Visible = False + WholeRow = False + end + item + Caption = 'Shortcut Menus' + DockedDockingStyle = dsTop + DockedLeft = 0 + DockedTop = 0 + DockingStyle = dsNone + FloatLeft = 293 + FloatTop = 319 + FloatClientWidth = 188 + FloatClientHeight = 19 + Hidden = True + ItemLinks = < + item + Item = bsiShortcutPreview + Visible = True + end + item + Item = bsiShortCutExplorer + Visible = True + end + item + Item = bsiShortcutThumbnails + Visible = True + end> + Name = 'Shortcut Menus' + NotDocking = [dsLeft, dsTop, dsRight, dsBottom] + OneOnRow = False + Row = 0 + UseOwnFont = False + Visible = False + WholeRow = False + end + item + Caption = 'AutoText' + DockedDockingStyle = dsTop + DockedLeft = 0 + DockedTop = 0 + DockingStyle = dsNone + FloatLeft = 460 + FloatTop = 288 + FloatClientWidth = 124 + FloatClientHeight = 22 + ItemLinks = < + item + Item = bbInsertEditAutoText + Visible = True + end + item + BeginGroup = True + Item = bsiInsertAutoText + Visible = True + end> + Name = 'AutoText' + OneOnRow = False + Row = 0 + UseOwnFont = False + Visible = False + WholeRow = False + end + item + Caption = 'Explorer' + DockedDockingStyle = dsTop + DockedLeft = 0 + DockedTop = 49 + DockingStyle = dsTop + FloatLeft = 461 + FloatTop = 349 + FloatClientWidth = 23 + FloatClientHeight = 22 + ItemLinks = < + item + Item = bbExplorerCreateNewFolder + Visible = True + end + item + Item = bbExplorerDelete + Visible = True + end + item + Item = bbExplorerProperties + Visible = True + end> + Name = 'Explorer' + OneOnRow = True + Row = 2 + UseOwnFont = False + Visible = False + WholeRow = False + end> + Categories.Strings = ( + 'File' + 'Explorer' + 'Edit' + 'Insert' + 'View' + 'Format' + 'Zoom' + 'Tools' + 'Go' + 'Help' + 'Built-in Menus' + 'Shortcut Menus' + 'New Menu') + Categories.ItemsVisibles = ( + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2) + Categories.Visibles = ( + True + True + True + True + True + True + True + True + True + True + True + False + True) + Images = ilToolBar + LargeImages = ilToolBar + MenusShowRecentItemsFirst = False + PopupMenuLinks = < + item + PopupMenu = pmPreview + end + item + PopupMenu = pmThumbnails + end> + ShowShortCutInHint = True + StoreInRegistry = True + StretchGlyphs = False + Style = bmsFlat + UseSystemFont = True + OnBarVisibleChange = dxBarManagerBarVisibleChange + OnHideCustomizingForm = dxBarManagerHideCustomizingForm + OnShowCustomizingForm = dxBarManagerShowCustomizingForm + Left = 63 + Top = 197 + DockControlHeights = ( + 0 + 0 + 49 + 0) + object bbFile: TdxBarSubItem + Caption = '&File' + Category = 10 + Visible = ivAlways + ItemLinks = < + item + Item = bbFileDesign + Visible = True + end + item + Item = bbFileRebuild + Visible = True + end + item + BeginGroup = True + Item = bbFileLoad + Visible = True + end + item + Item = bbFileClose + Visible = True + end + item + BeginGroup = True + Item = bbFileSave + Visible = True + end + item + BeginGroup = True + Item = bbFilePrintDialog + Visible = True + end + item + Item = bbFilePageSetup + Visible = True + end + item + BeginGroup = True + Item = bbFileExit + Visible = True + end> + end + object bbFileDesign: TdxBarButton + Caption = '&Design...' + Category = 0 + Hint = 'ReportDesign|' + Visible = ivNever + ImageIndex = 0 + ShortCut = 16452 + OnClick = DesignClick + end + object bbFileRebuild: TdxBarButton + Caption = 'Rebuild' + Category = 0 + Hint = 'Rebuild' + Visible = ivAlways + ShortCut = 16500 + OnClick = bbFileRebuildClick + end + object bbViewMargins: TdxBarButton + Caption = '&Margins' + Category = 4 + Hint = 'Margins' + Visible = ivAlways + ButtonStyle = bsChecked + Down = True + ShortCut = 16461 + OnClick = bbViewMarginsClick + end + object bbZoomPercent100: TdxBarButton + Caption = '&Percent 100' + Category = 6 + Hint = 'Zoom 100 %' + Visible = ivAlways + ImageIndex = 5 + ShortCut = 16604 + OnClick = ZoomClick + end + object bbZoomPageWidth: TdxBarButton + Tag = 1 + Caption = '&Fit To Window' + Category = 6 + Hint = 'Zoom Page Width' + Visible = ivAlways + ImageIndex = 6 + ShortCut = 16432 + OnClick = ZoomClick + end + object bbZoomWholePage: TdxBarButton + Tag = 2 + Caption = '&One Page' + Category = 6 + Hint = 'Zoom One Page' + Visible = ivAlways + ImageIndex = 7 + ShortCut = 16433 + OnClick = ZoomClick + end + object bbZoomTwoPages: TdxBarButton + Tag = 3 + Caption = '&Two Page' + Category = 6 + Hint = 'Zoom Two Page' + Visible = ivAlways + ImageIndex = 8 + ShortCut = 16434 + OnClick = ZoomClick + end + object bbExplorer: TdxBarSubItem + Caption = 'E&xplorer' + Category = 10 + Visible = ivAlways + ItemLinks = < + item + Item = bbExplorerCreateNewFolder + Visible = True + end + item + BeginGroup = True + Item = bbExplorerDelete + Visible = True + end + item + Item = bbExplorerRename + Visible = True + end + item + BeginGroup = True + Item = bbExplorerProperties + Visible = True + end> + end + object bbGoToFirstPage: TdxBarButton + Caption = '&First Page' + Category = 8 + Hint = 'Go to First Page' + Visible = ivAlways + ImageIndex = 13 + ShortCut = 36 + OnClick = GoToPageClick + end + object bbGoToPrevPage: TdxBarButton + Tag = 1 + Caption = '&Previous Page' + Category = 8 + Hint = 'Go to Prev Page' + Visible = ivAlways + ImageIndex = 14 + ShortCut = 33 + OnClick = GoToPageClick + end + object bbGoToNextPage: TdxBarButton + Tag = 2 + Caption = '&Next Page' + Category = 8 + Hint = 'Go to Next Page' + Visible = ivAlways + ImageIndex = 15 + ShortCut = 34 + OnClick = GoToPageClick + end + object bbGoToLastPage: TdxBarButton + Tag = 3 + Caption = '&Last Page' + Category = 8 + Hint = 'Go to Last Page' + Visible = ivAlways + ImageIndex = 16 + ShortCut = 35 + OnClick = GoToPageClick + end + object bbEdit: TdxBarSubItem + Caption = '&Edit' + Category = 10 + Visible = ivNever + ItemLinks = < + item + Item = bbEditFind + Visible = True + end + item + Item = bbEditFindNext + Visible = True + end + item + BeginGroup = True + Item = bbEditReplace + Visible = True + end> + end + object bbZoomFourPages: TdxBarButton + Tag = 4 + Caption = 'Four Page' + Category = 6 + Hint = 'Zoom Four Page' + Visible = ivAlways + ImageIndex = 9 + ShortCut = 16436 + OnClick = ZoomClick + end + object bbZoomMultiplePages: TdxBarButton + Caption = '&Multiple Pages' + Category = 6 + Hint = 'Multiple Pages' + Visible = ivAlways + ImageIndex = 10 + OnClick = bbZoomMultiplePagesClick + end + object bbZoomWidenToSourceWidth: TdxBarButton + Tag = 5 + Caption = 'Widen To Source Width' + Category = 6 + Hint = 'Widen to source width' + Visible = ivAlways + ImageIndex = 11 + OnClick = ZoomClick + end + object seActivePage: TdxBarSpinEdit + Caption = '&Active Page :' + Category = 8 + Hint = 'Active Page :' + Visible = ivAlways + OnChange = seActivePageChange + Width = 100 + OnButtonClick = seActivePageButtonClick + end + object cbxPredefinedZoom: TdxBarImageCombo + Caption = '&Zoom :' + Category = 6 + Hint = 'Zoom :' + Visible = ivAlways + Text = '100%' + OnChange = cbxPredefinedZoomChange + Glyph.Data = { + F6000000424DF600000000000000760000002800000010000000100000000100 + 0400000000008000000000000000000000001000000010000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888 + 8888008888888888888800088888888888888000888888888888880008700007 + 88888880000888800888888807EE88887088888708E88888807888808E888888 + 88088880888888888808888088888888E808888088888888E80888870888888E + E078888807888EEE708888888008888008888888887000078888} + Width = 100 + OnClick = cbxPredefinedZoomClick + ShowEditor = True + Images = ilToolBar + Items.Strings = ( + '500%' + '200%' + '150%' + '100%' + '75%' + '50%' + '25%' + '10%' + 'Page Width' + 'Whole Page' + 'Two Pages' + 'Four Pages' + 'Widen To Source Width') + ItemIndex = 3 + ImageIndexes = ( + -1 + -1 + -1 + 5 + -1 + -1 + -1 + -1 + 6 + 7 + 8 + 9 + 11) + end + object bbFileLoad: TdxBarButton + Caption = '&Load...' + Category = 0 + Hint = 'Load' + Visible = ivAlways + ImageIndex = 43 + ShortCut = 16463 + OnClick = ExplorerLoadDataClick + end + object bbZoomSetup: TdxBarButton + Caption = '&Setup ...' + Category = 6 + Hint = 'Setup ' + Visible = ivAlways + PaintStyle = psCaption + OnClick = bbZoomSetupClick + end + object bbToolsOptions: TdxBarButton + Caption = '&Options...' + Category = 7 + Hint = 'Options' + Visible = ivAlways + OnClick = bbToolsOptionsClick + end + object bbViewMarginBar: TdxBarButton + Caption = 'MarginBar' + Category = 4 + Hint = 'Margin Bar' + Visible = ivAlways + ButtonStyle = bsChecked + Down = True + OnClick = bbViewMarginBarClick + end + object bbFileSave: TdxBarButton + Caption = '&Save...' + Category = 0 + Hint = 'Save' + Visible = ivAlways + ImageIndex = 38 + ShortCut = 16467 + OnClick = FileSaveClick + end + object bbViewStatusBar: TdxBarButton + Caption = 'StatusBar' + Category = 4 + Hint = 'StatusBar' + Visible = ivAlways + ButtonStyle = bsChecked + Down = True + OnClick = bbViewStatusBarClick + end + object bbHelpTopics: TdxBarButton + Caption = '&Help Topics...' + Category = 9 + Hint = 'Help' + Visible = ivAlways + ImageIndex = 17 + OnClick = HelpClick + end + object bbViewExplorer: TdxBarButton + Caption = 'E&xplorer' + Category = 4 + Hint = 'Explorer' + Visible = ivAlways + ButtonStyle = bsChecked + ImageIndex = 48 + ShortCut = 16472 + OnClick = bbViewExplorerClick + end + object bsiShortcutPreview: TdxBarSubItem + Caption = 'Preview' + Category = 11 + Visible = ivInCustomizing + ItemLinks = <> + end + object bsiInsertHFAutoText: TdxBarSubItem + Caption = 'AutoText' + Category = 3 + Visible = ivAlways + Detachable = True + DetachingBar = 4 + ItemLinks = < + item + Item = bbInsertEditAutoText + Visible = True + end + item + BeginGroup = True + Item = bliInsertAutoTextEntries + Visible = True + end> + end + object bbInsertEditAutoText: TdxBarButton + Caption = 'AutoTe&xt...' + Category = 3 + Hint = 'AutoText' + Visible = ivAlways + ImageIndex = 33 + end + object bsiInsertAutoText: TdxBarSubItem + Caption = 'Insert AutoText' + Category = 3 + Visible = ivAlways + ItemLinks = < + item + Item = bliInsertAutoTextEntries + Visible = True + end> + end + object bliInsertAutoTextEntries: TdxBarListItem + Caption = 'List of AutoText Entries' + Category = 3 + Visible = ivAlways + ShowNumbers = False + end + object bbInsertHFPageNumber: TdxBarButton + Caption = '&Page Number' + Category = 3 + Hint = 'Insert Page Number' + Visible = ivAlways + ImageIndex = 19 + ShortCut = 41040 + OnClick = InsertHFClick + end + object bbInsertHFTotalPages: TdxBarButton + Tag = 1 + Caption = '&Number of Pages' + Category = 3 + Hint = 'Insert Number of Pages' + Visible = ivAlways + ImageIndex = 21 + OnClick = InsertHFClick + end + object bbInsertHFPageOfPages: TdxBarButton + Tag = 2 + Caption = 'Page Number Of Pages' + Category = 3 + Hint = 'Insert Page Number Of Pages' + Visible = ivAlways + ImageIndex = 20 + OnClick = InsertHFClick + end + object bbInsertHFDateTime: TdxBarButton + Tag = 3 + Caption = 'Date and Time' + Category = 3 + Hint = 'Insert Date and Time' + Visible = ivAlways + ImageIndex = 23 + OnClick = InsertHFClick + end + object bbInsertHFDate: TdxBarButton + Tag = 4 + Caption = '&Date' + Category = 3 + Hint = 'Insert Date' + Visible = ivAlways + ImageIndex = 24 + ShortCut = 41028 + OnClick = InsertHFClick + end + object bbInsertHFTime: TdxBarButton + Tag = 5 + Caption = '&Time' + Category = 3 + Hint = 'Insert Time' + Visible = ivAlways + ImageIndex = 25 + ShortCut = 41044 + OnClick = InsertHFClick + end + object bbInsertHFUserName: TdxBarButton + Tag = 6 + Caption = '&User Name' + Category = 3 + Hint = 'Insert User Name' + Visible = ivAlways + ImageIndex = 27 + OnClick = InsertHFClick + end + object bbInsert: TdxBarSubItem + Caption = '&Insert' + Category = 10 + Visible = ivAlways + ItemLinks = < + item + Item = bsiInsertHFAutoText + Visible = True + end + item + BeginGroup = True + Item = bbInsertHFPageNumber + Visible = True + end + item + Item = bbInsertHFTotalPages + Visible = True + end + item + Item = bbInsertHFPageOfPages + Visible = True + end + item + BeginGroup = True + Item = bbInsertHFDateTime + Visible = True + end + item + Item = bbInsertHFDate + Visible = True + end + item + Item = bbInsertHFTime + Visible = True + end + item + BeginGroup = True + Item = bbInsertHFUserName + Visible = True + end + item + Item = bbInsertHFMachineName + Visible = True + end> + end + object bbView: TdxBarSubItem + Caption = '&View' + Category = 10 + Visible = ivAlways + ItemLinks = < + item + Item = bbViewMargins + Visible = True + end + item + BeginGroup = True + Item = bbViewMarginBar + Visible = True + end + item + Item = bbViewStatusBar + Visible = True + end + item + Item = bbViewExplorer + Visible = True + end + item + Item = bbViewThumbnails + Visible = True + end + item + BeginGroup = True + Item = bbViewToolbars + Visible = True + end + item + BeginGroup = True + Item = bbFormatHeaderAndFooter + Visible = True + end + item + BeginGroup = True + Item = bbViewZoom + Visible = True + end + item + BeginGroup = True + Item = bbViewPageHeaders + Visible = True + end + item + Item = bbViewPageFooters + Visible = True + end> + end + object bbViewZoom: TdxBarSubItem + Caption = 'Zoom' + Category = 10 + Visible = ivAlways + ItemLinks = < + item + Item = bbZoomPercent100 + Visible = True + end + item + BeginGroup = True + Item = bbZoomPageWidth + Visible = True + end + item + Item = bbZoomWholePage + Visible = True + end + item + Item = bbZoomTwoPages + Visible = True + end + item + Item = bbZoomFourPages + Visible = True + end + item + Item = bbZoomMultiplePages + Visible = True + end + item + BeginGroup = True + Item = bbZoomWidenToSourceWidth + Visible = True + end + item + BeginGroup = True + Item = bbZoomSetup + Visible = True + end> + end + object bbFormatHeaderAndFooter: TdxBarButton + Caption = '&Header and Footer' + Category = 5 + Hint = 'Header and Footer' + Visible = ivAlways + AllowAllUp = True + ButtonStyle = bsChecked + ImageIndex = 36 + OnClick = bbFormatHeaderAndFooterClick + end + object bbFormatDateTime: TdxBarButton + Caption = 'Date and &Time...' + Category = 5 + Hint = 'Date and Time' + Visible = ivAlways + ImageIndex = 26 + OnClick = bbFormatDateTimeClick + end + object bbFormatPageNumbering: TdxBarButton + Caption = 'Page &Numbering...' + Category = 5 + Hint = 'Page Numbering' + Visible = ivAlways + ImageIndex = 22 + OnClick = bbFormatPageNumbersClick + end + object bbEditFind: TdxBarButton + Caption = 'Find...' + Category = 2 + Hint = 'Find' + Visible = ivNever + ShortCut = 16454 + end + object bbFormatPageBackground: TdxBarButton + Caption = 'Page Bac&kground...' + Category = 5 + Hint = 'Background' + Visible = ivAlways + ImageIndex = 4 + ShortCut = 16459 + OnClick = PageBackgroundClick + end + object bbFormatShrinkToPageWidth: TdxBarButton + Caption = '&Shrink To Page' + Category = 5 + Hint = 'Shrink To Page' + Visible = ivAlways + AllowAllUp = True + ButtonStyle = bsChecked + ImageIndex = 12 + OnClick = bbFormatShrinkToPageWidthClick + end + object bbEditFindNext: TdxBarButton + Caption = 'Find &Next' + Category = 2 + Hint = 'Find Next' + Visible = ivNever + ShortCut = 114 + end + object bbEditReplace: TdxBarButton + Caption = '&Replace...' + Category = 2 + Hint = 'Replace' + Visible = ivNever + ShortCut = 16466 + end + object bbFormatShowHideEmptyPages: TdxBarButton + Caption = 'Show/Hide EmptyPages' + Category = 5 + Hint = 'Show/Hide Empty Pages' + Visible = ivAlways + ButtonStyle = bsChecked + OnClick = bbFormatShowHideEmptyPagesClick + end + object bbViewThumbnails: TdxBarButton + Caption = 'Th&umbnails' + Category = 4 + Hint = 'Thumbnails' + Visible = ivAlways + ButtonStyle = bsChecked + ImageIndex = 49 + ShortCut = 16469 + OnClick = bbViewThumbnailsClick + end + object bbFormatHFBackground: TdxBarButton + Caption = 'Header and Footer Background ...' + Category = 5 + Hint = 'Header and Footer Background ' + Visible = ivAlways + ImageIndex = 34 + OnClick = bbFormatHFBackgroundClick + end + object bbThumbnailsSmall: TdxBarButton + Caption = '&Small Thumbnails' + Category = 4 + Hint = 'Small Thumbnails' + Visible = ivAlways + ButtonStyle = bsChecked + OnClick = bbThumbnailsSizeClick + end + object bbToolsCustomize: TdxBarButton + Caption = '&Customize...' + Category = 7 + Hint = 'Customize' + Visible = ivAlways + OnClick = bbToolsCustomizeClick + end + object bbThumbnailsLarge: TdxBarButton + Tag = 1 + Caption = '&Large Thumbnails' + Category = 4 + Hint = 'Large Thumbnails' + Visible = ivAlways + ButtonStyle = bsChecked + Down = True + OnClick = bbThumbnailsSizeClick + end + object bbViewPages: TdxBarSubItem + Caption = 'Pages' + Category = 10 + Visible = ivNever + ItemLinks = <> + end + object bbViewToolbars: TdxBarToolbarsListItem + Caption = '&Toolbars' + Category = 4 + Visible = ivAlways + end + object bbHelpAbout: TdxBarButton + Caption = '&About...' + Category = 9 + Hint = 'About' + Visible = ivNever + end + object bbViewPageHeaders: TdxBarButton + Caption = 'Page &Headers' + Category = 4 + Hint = 'Page Headers' + Visible = ivAlways + ButtonStyle = bsChecked + Down = True + OnClick = bbViewPageHeadersClick + end + object bbViewPageFooters: TdxBarButton + Caption = 'Page &Footers' + Category = 4 + Hint = 'Page Footers' + Visible = ivAlways + ButtonStyle = bsChecked + Down = True + OnClick = bbViewPageFootersClick + end + object bbViewSwitchToLeftPart: TdxBarButton + Caption = 'Switch To Left Part' + Category = 4 + Hint = 'Switch To Left Part' + Visible = ivAlways + ButtonStyle = bsChecked + GroupIndex = 1 + Down = True + ImageIndex = 30 + OnClick = SwitchPartClick + end + object bbFormat: TdxBarSubItem + Caption = '&Format' + Category = 10 + Visible = ivAlways + ItemLinks = < + item + Item = bbFormatTitle + Visible = True + end + item + BeginGroup = True + Item = bbFormatPageNumbering + Visible = True + end + item + Item = bbFormatDateTime + Visible = True + end + item + BeginGroup = True + Item = bbFormatShrinkToPageWidth + Visible = True + end + item + Item = bbFormatShowHideEmptyPages + Visible = True + end + item + BeginGroup = True + Item = bbFormatPageBackground + Visible = True + end> + end + object bbGoToPage: TdxBarSubItem + Caption = '&Go' + Category = 10 + Visible = ivAlways + ItemLinks = < + item + Item = bbGoToFirstPage + Visible = True + end + item + Item = bbGoToPrevPage + Visible = True + end + item + BeginGroup = True + Item = seActivePage + Visible = True + end + item + BeginGroup = True + Item = bbGoToNextPage + Visible = True + end + item + Item = bbGoToLastPage + Visible = True + end> + end + object bbFormatHFClear: TdxBarButton + Caption = 'Clea&r Text' + Category = 5 + Hint = 'Clear Text' + Visible = ivAlways + OnClick = bbFormatHFClearClick + end + object bsiNewMenuNewMenu: TdxBarSubItem + Caption = 'New Item' + Category = 12 + Visible = ivAlways + ItemLinks = <> + end + object bbFileClose: TdxBarButton + Caption = '&Unload' + Category = 0 + Hint = 'Unload' + Visible = ivAlways + ImageIndex = 44 + ShortCut = 16499 + OnClick = bbFileCloseClick + end + object bbFilePrint: TdxBarButton + Caption = 'Print' + Category = 0 + Hint = 'Print' + Visible = ivNever + ImageIndex = 1 + OnClick = PrintClick + end + object bbInsertHFMachineName: TdxBarButton + Tag = 7 + Caption = '&Machine Name' + Category = 3 + Hint = 'Insert Machine Name' + Visible = ivAlways + ImageIndex = 28 + OnClick = InsertHFClick + end + object bbFilePrintDialog: TdxBarButton + Tag = 1 + Caption = '&Print...' + Category = 0 + Hint = 'Print Dialog' + Visible = ivNever + ImageIndex = 2 + ShortCut = 16464 + OnClick = PrintClick + end + object bbTools: TdxBarSubItem + Caption = '&Tools' + Category = 10 + Visible = ivAlways + ItemLinks = < + item + Item = bbToolsCustomize + Visible = True + end + item + Item = bbToolsOptions + Visible = True + end> + end + object bbExplorerCreateNewFolder: TdxBarButton + Caption = 'Create &Folder...' + Category = 1 + Hint = 'Create Folder' + Visible = ivAlways + ImageIndex = 40 + ShortCut = 32821 + OnClick = ExplorerCreateNewFolderClick + end + object bbHelp: TdxBarSubItem + Caption = '&Help' + Category = 10 + Visible = ivAlways + ItemLinks = < + item + Item = bbHelpTopics + Visible = True + end + item + BeginGroup = True + Item = bbHelpAbout + Visible = True + end> + end + object bbFilePageSetup: TdxBarButton + Tag = 2 + Caption = 'Page set&up...' + Category = 0 + Hint = 'Page Setup ' + Visible = ivNever + ButtonStyle = bsDropDown + DropDownMenu = pmPrintStyles + ImageIndex = 3 + OnClick = PageSetupClick + end + object bbViewSwitchToCenterPart: TdxBarButton + Tag = 1 + Caption = 'Switch To Center Part' + Category = 4 + Hint = 'Switch To Center Part' + Visible = ivAlways + ButtonStyle = bsChecked + GroupIndex = 1 + ImageIndex = 31 + OnClick = SwitchPartClick + end + object bliPrintStyles: TdxBarListItem + Caption = 'Print Styles' + Category = 0 + Visible = ivAlways + ShowCheck = True + ShowNumbers = False + end + object bsiShortCutExplorer: TdxBarSubItem + Caption = 'Explorer' + Category = 11 + Visible = ivAlways + ItemLinks = <> + end + object bbDefinePrintStyles: TdxBarButton + Caption = 'Define Print Styles...' + Category = 0 + Hint = 'Define Print Styles' + Visible = ivAlways + end + object bbExplorerDelete: TdxBarButton + Caption = '&Delete...' + Category = 1 + Hint = 'Delete' + Visible = ivAlways + ImageIndex = 39 + ShortCut = 46 + OnClick = ExplorerDeleteItemClick + end + object bbExplorerRename: TdxBarButton + Caption = '&Rename...' + Category = 1 + Hint = 'Rename' + Visible = ivAlways + ShortCut = 113 + OnClick = ExplorerRenameItemClick + end + object bbFormatTitle: TdxBarButton + Caption = 'Title...' + Category = 5 + Hint = 'Title' + Visible = ivAlways + ImageIndex = 45 + OnClick = bbFormatTitleClick + end + object bbViewSwitchToRightPart: TdxBarButton + Tag = 2 + Caption = 'Switch To Right Part' + Category = 4 + Hint = 'Switch To Right Part' + Visible = ivAlways + ButtonStyle = bsChecked + GroupIndex = 1 + ImageIndex = 32 + OnClick = SwitchPartClick + end + object bbViewHFSwitchHeaderFooter: TdxBarButton + Caption = '&Show Header/Footer' + Category = 4 + Hint = 'Show Header/Footer' + Visible = ivAlways + AllowAllUp = True + ButtonStyle = bsChecked + ImageIndex = 29 + OnClick = bbViewHFSwitchHeaderFooterClick + end + object bbViewHFClose: TdxBarButton + Caption = '&Close' + Category = 4 + Hint = 'Close Header and Footer' + Visible = ivAlways + OnClick = bbViewHFCloseClick + end + object bsiShortcutThumbnails: TdxBarSubItem + Caption = 'Thumbnails' + Category = 11 + Visible = ivAlways + ItemLinks = <> + end + object bbExplorerProperties: TdxBarButton + Caption = '&Properties...' + Category = 1 + Hint = 'P&roperties' + Visible = ivAlways + ImageIndex = 46 + ShortCut = 32781 + OnClick = bbExplorerPropertiesClick + end + object bbFileExit: TdxBarButton + Caption = '&Close' + Category = 0 + Hint = 'Close' + Visible = ivAlways + OnClick = CloseClick + end + end + object ilToolBar: TImageList + AllocBy = 48 + Left = 35 + Top = 197 + Bitmap = { + 494C010132003600040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 000000000000360000002800000040000000E0000000010020000000000000E0 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FF000000FFFF000080000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FFFF00008000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080800000808000008080000080 + 8000008080000080800000808000008080000080800000808000FF000000FFFF + 0000800000000080800000808000000000000000000000000000808080000000 + 0000000000000000000080808000000000000000000000000000808080000000 + 0000000000000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF00FF000000FFFF00008000 + 000000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000FFFF00C0C0C000000000000000000000000000C0C0C0008000000000FF + FF0000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF00C0C0C00000000000FFFF0000C0C0C000FFFF000000000000C0C0C00000FF + FF0000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000000000FFFF0000C0C0C000FFFF0000C0C0C000FFFF00000000000000FF + FF0000FFFF0000FFFF0000808000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000000000C0C0C000FFFF0000C0C0C000FFFF0000C0C0C0000000000000FF + FF0000FFFF0000FFFF0000808000000000000000000000000000808080000000 + 0000000000000000000080808000000000000000000000000000808080000000 + 0000000000000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000000000FFFF0000C0C0C000FFFF0000C0C0C000FFFF00000000000000FF + FF0000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF00C0C0C00000000000FFFF0000C0C0C000FFFF000000000000C0C0C00000FF + FF0000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000FFFF00C0C0C000000000000000000000000000C0C0C00000FFFF0000FF + FF0000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000808000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000008080800000FFFF000000 + 0000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000FFFF + FF00000000000000000000000000000000000000000000000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF0000000000000000FFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000FFFF + FF00808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000808080000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF00000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00000000000000 + 0000FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00C0C0C000FFFFFF00FFFFFF00C0C0C000FFFFFF00C0C0C000FFFFFF00C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF0000FFFF00FFFFFF00000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00C0C0C000FFFFFF00FFFFFF00C0C0C000FFFFFF00C0C0C000FFFFFF00C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00000000000000 + 0000FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF00000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00C0C0C000FFFFFF00FFFFFF00C0C0C000FFFFFF00C0C0C000FFFFFF00C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF00FFFFFF000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00000000000000 + 0000FFFFFF00FFFFFF00FFFFFF0000000000C0C0C00000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00000000000000000000000000FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF00000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000808080000000000000000000FFFFFF0000000000C0C0 + C00000000000FFFFFF0000000000C0C0C00000000000C0C0C000000000000000 + 000000000000000000008000000080000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000808080000000000000000000000000000000000000000000FFFF + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF00FFFFFF0000000000808080000000000000000000FFFFFF00FFFFFF000000 + 0000C0C0C00000000000C0C0C00000000000C0C0C00000000000C0C0C000C0C0 + C000C0C0C0000000000080000000800000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 000000000000000000000000000080000000000000000000000000000000FFFF + FF000000FF000000000000000000000000000000000000000000000000000000 + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 000000000000C0C0C00000000000C0C0C00000000000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C00080000000800000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000080000000000000000000000000000000FFFF + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 00000000000000000000C0C0C00000000000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000800000008000000000000000000000000000000000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000080000000000000008000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C0000000000080000000800000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000800000008000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080000000800000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000800000008000000080000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF00000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF008000000080000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF00000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00000000000000000000000000000000000000000000000000FFFF + FF0000FFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0080000000800000008000000080000000800000008000 + 0000FFFFFF00FFFFFF0000000000000000000000000000FFFF00000000000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000000000000000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF008000000080000000FFFFFF00FFFFFF00FFFF + FF0080000000FFFFFF00000000000000000000000000FFFFFF0000FFFF000000 + 0000008080000080800000808000008080000080800000808000008080000080 + 80000080800000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF00000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF00FFFF + FF0080000000FFFFFF0000000000000000000000000000FFFF00FFFFFF0000FF + FF00000000000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF008080800000FFFF00FFFFFF0000FFFF008080 + 800000FFFF0000FFFF0000FFFF00808080000000000000FFFF00FFFFFF000000 + 000000000000000000000000000000000000FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF008080800000FFFF0000FFFF008080 + 800000FFFF00FFFFFF008080800000FFFF0000000000FFFFFF0000FFFF00FFFF + FF00000000000000000000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF0080000000FFFFFF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF008080800000FFFF008080 + 8000FFFFFF008080800000FFFF00000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF000000000000000000000000000000000000000000FFFF + FF0080000000FFFFFF00FFFFFF00FFFFFF008000000080000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF0080808000808080008080800080808000FFFF + FF008080800080808000808080008080800000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00800000008000000080000000800000008000000080000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000FFFF00FFFFFF0000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000FFFF008080800000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008000000080000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF0000000000000000008080800000FFFF008080 + 800000FFFF008080800000FFFF0000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080800000FFFF00000000008080 + 8000FFFFFF00000000008080800000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000008080800000FFFF0000000000000000008080 + 8000808080000000000000000000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0008000 + 8000C0C0C0000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF000000000000000000000000000000000000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000008000 + 8000800080008000800080008000800080008000800080008000800080008000 + 8000800080000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0008000 + 8000C0C0C0000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF000000000000000000000000000000000000000000FFFF + FF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000FFFFFF000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0008000 + 8000C0C0C0000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0008000 + 8000C0C0C0000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000FFFFFF000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0008000 + 8000C0C0C0000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000008080000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF0000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0008000 + 8000C0C0C0000000000000000000000000000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000FFFFFF000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0008000 + 8000C0C0C0000000000000000000000000000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0008000 + 8000C0C0C0000000000000000000000000000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 00000000000000000000000000000000000000000000000000000000000000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF000000 + 000000000000000000000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0008000 + 8000C0C0C0000000000000000000000000000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000000000000000 + 0000000000000000000000000000000000000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF0000000000000000000000000000000000000000000000000000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000008000 + 800080008000800080008000800080008000800080008000800000000000C0C0 + C000000000000000000000000000000000000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C0C0C00000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C0C0 + C000C0C0C00080008000C0C0C000C0C0C000C0C0C000C0C0C000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840084848400848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008484840000FFFF00848484008484 + 840000FFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084848400FFFFFF008484 + 8400FFFFFF00FFFFFF0000FFFF000000000000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008484840000FFFF0000FFFF0000FF + FF0000FFFF000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000084848400000000008484 + 840000000000FFFFFF0000FFFF00000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008484840084848400848484008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF0000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000848484008484 + 84008484840000000000FFFFFF00FFFFFF0000FFFF0084848400FFFFFF00FFFF + FF0000FFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000C6C6C600C6C6C600C6C6 + C600848484008484840000000000FFFFFF00FFFFFF008400000084848400FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00C6C6C600C6C6C600C6C6 + C600C6C6C60084848400848484000000000000FFFF008400000084000000FFFF + FF0000FFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF0000000000FFFF + FF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00C6C6C600C6C6 + C600C6C6C600C6C6C6008484840084848400840000008400000084000000FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF000000 + 0000FFFFFF0000000000FFFFFF0000000000C6C6C600FFFFFF00FFFFFF00C6C6 + C60000000000C6C6C600C6C6C60084848400840000008400000084000000FFFF + FF0000FFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000848400008484000000 + 0000FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF0000000000FFFF + FF0000000000FFFFFF00000000000000000000000000C6C6C600FFFFFF000000 + 00008400000000000000C6C6C60084000000840000008400000084848400FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00000000000000 + 000000000000FFFFFF00000000000000000000000000FFFFFF00000000000000 + 000000000000FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF000000000000848400008484000000000000000000FFFFFF000000 + 0000FFFFFF000000000000000000000000000000000000000000C6C6C600FFFF + FF0084000000C6C6C60084848400840000008400000084848400FFFFFF0000FF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF000000 + 0000C6C6C600FFFFFF00C6C6C60000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008484840084848400848484008484 + 84008484840000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000008484000000000000000000000000008400000000000000C6C6 + C60084000000848484000000000084848400FFFFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF0000000000000000000000000000000000FFFFFF00FFFFFF00C6C6 + C600000000000000000000000000C6C6C600FFFFFF00FFFFFF00000000000000 + 000000000000FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008484840000FFFF0000FFFF0000FF + FF0000FFFF0000000000000000000000000000000000FFFFFF00FFFFFF000084 + 8400FFFFFF0000848400FFFFFF0000848400FFFFFF0000848400FFFFFF000084 + 8400FFFFFF000084840000000000000000000000000084000000C6C6C6000000 + 0000840000000000000084848400000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00848484008484840084848400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008484840000FFFF00848484008484 + 840000FFFF0000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000084840000000000000000000000000084000000C6C6C600C6C6 + C600840000008484840000FFFF000000000000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF000084 + 8400FFFFFF0000848400FFFFFF0000848400FFFFFF0000848400FFFFFF000084 + 8400FFFFFF000000000000000000000000000000000084848400840000008400 + 00008484840084848400848484000000000000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF000000000000000000000000000000000000FFFF008484 + 84008484840000FFFF0084848400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF008484840000FFFF00848484008484840000FFFF0084848400FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000848484008484840084848400848484008484840000000000000000000000 + 0000848484008484840084848400848484000000000000000000000000000000 + 0000FFFFFF008484840084848400848484008484840084848400848484008484 + 84008484840000FFFF000000000000000000000000000000000000FFFF0000FF + FF0000FFFF0000FFFF0084848400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF008484840000FFFF0000FFFF0000FFFF0000FFFF0084848400FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00C6C6C600C6C6C600848484000000000000000000FFFF + FF00848484008484840084848400848484000000000084848400848484000000 + 000000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000000000000000000000000000848484008484 + 8400848484008484840084848400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00848484008484840084848400848484008484840084848400FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF000000000000000000848484008484840000000000FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFF + FF000000000000000000848484008484840000000000FFFFFF00848484008484 + 840084848400848484008484840084848400FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000084848400840000008400 + 00008400000084000000840000008400000084000000FFFFFF0000000000FFFF + FF00FFFFFF00FFFFFF00848484008484840000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000084848400840000008400 + 00008400000084000000840000008400000084000000FFFFFF0000000000FFFF + FF000000000000000000848484008484840000000000FFFFFF00848484008484 + 840084848400848484008484840084848400FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000084848400840000008400 + 00008400000084000000840000008400000084000000FFFFFF0000000000FFFF + FF000000000000000000848484008484840000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000084848400840000008400 + 00008400000084000000840000008400000084000000FFFFFF0000000000FFFF + FF008484840084848400848484008484840000000000FFFFFF00848484008484 + 840084848400848484008484840084848400FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000084848400840000008400 + 00008400000084000000840000008400000084000000FFFFFF0000000000FFFF + FF008484840084848400848484008484840000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484008484 + 8400848484008484840084848400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00848484008484840084848400848484008484840084848400FFFF + FF00FFFFFF000000000000000000000000000000000084848400848484008484 + 840084848400848484008484840084848400848484008484840000000000FFFF + FF00848484008484840084848400848484000000000084848400848484008484 + 840084848400848484008484840084848400848484000000000000FFFF00FFFF + FF0000FFFF00FFFFFF000000000000000000000000000000000000FFFF0000FF + FF0000FFFF0000FFFF0084848400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF008484840000FFFF0000FFFF0000FFFF0000FFFF0084848400FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484008484 + 84008484840000FFFF000000000000000000000000000000000000FFFF008484 + 84008484840000FFFF0084848400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF008484840000FFFF00848484008484840000FFFF0084848400FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00C6C6C600FFFFFF00C6C6C600FFFFFF00C6C6 + C600FFFFFF00C6C6C600FFFFFF00000000000000000000000000000000000000 + 000000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000FFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000C6C6C600000000000000000000000000000000000000 + 00000000000000000000C6C6C6000000000000000000000000000000000000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00000000000000000000000000000000008400000084000000840000008400 + 0000840000008400000000000000FFFFFF0000FFFF00FFFFFF0000000000FFFF + FF0000FFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000C6C6C600FFFFFF00C6C6 + C600FFFFFF0000000000FFFFFF00C6C6C600FFFFFF00C6C6C600FFFFFF00C6C6 + C600FFFFFF00C6C6C600FFFFFF0000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF0000000000000000000000000084000000FFFFFF00C6C6C600FFFF + FF00C6C6C600FFFFFF000000000000FFFF00FFFFFF0000FFFF000000000000FF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000C6C6C600C6C6C60000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 00000000000000000000C6C6C600FFFFFF00C6C6C6000000840000008400FFFF + FF00C6C6C600FFFFFF00C6C6C600000000000000000000000000FFFFFF0000FF + FF000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000000000000000000000000084000000C6C6C600FFFFFF000000 + 8400FFFFFF0000008400000084000000000000FFFF00FFFFFF0000000000FFFF + FF0000FFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000C6C6C6000000000000000000000000000000 + 00000000000000000000000000000000000000000000C6C6C600FFFFFF00C6C6 + C600FFFFFF0000000000FFFFFF00C6C6C600FFFFFF000000840000008400C6C6 + C600FFFFFF00C6C6C600FFFFFF000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF00000000000000000084000000FFFFFF00C6C6C6000000 + 8400C6C6C60000008400C6C6C600FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000C6C6C600C6C6C600C6C6C600C6C6C6000000 + 00000000000000000000000000000000000000000000FFFFFF00848484000000 + 84000000840000000000C6C6C600FFFFFF00C6C6C600FFFFFF00000084000000 + 8400C6C6C600FFFFFF00C6C6C600000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00000000000000000084000000C6C6C600000084000000 + 8400FFFFFF00C6C6C60000008400C6C6C600C6C6C60000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000C6C6C600C6C6C600C6C6C6000000 + 00000000000000000000000000000000000000000000C6C6C600000084000000 + 8400FFFFFF0000000000FFFFFF00C6C6C600FFFFFF00C6C6C600FFFFFF000000 + 840000008400C6C6C600FFFFFF000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00000000000000000000000000000000000000 + 000000000000FFFFFF00000000000000000084000000FFFFFF00C6C6C6000000 + 8400C6C6C60084000000FFFFFF0084000000C6C6C600C6C6C600000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000C6C6C600C6C6C600C6C6C600C6C6C600C6C6 + C6000000000000000000000000000000000000000000FFFFFF00848484000000 + 84000000840000000000C6C6C600FFFFFF000000840000008400000084000000 + 840000008400FFFFFF00C6C6C600000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00000000000000000084000000C6C6C600FFFFFF00C6C6 + C600FFFFFF00C6C6C600FFFFFF00C6C6C600C6C6C60000000000C6C6C6000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000C6C6C600C6C6C600C6C6C600000000000000 + 00000000000000000000000000000000000000000000C6C6C600000084000000 + 8400FFFFFF0000000000FFFFFF00C6C6C600FFFFFF00C6C6C600FFFFFF00C6C6 + C600FFFFFF00C6C6C600FFFFFF000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000000000008400000084000000840000008400 + 0000840000000000000000000000C6C6C60000000000C6C6C60000000000C6C6 + C600000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000C6C6C600C6C6C6000000 + 00000000000000000000000000000000000000000000FFFFFF00848484000000 + 8400000084000000000084000000840000008400000084000000840000008400 + 0000840000008400000084000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000000000000000000000000084000000FF00000084000000FF00 + 0000FF00000000000000C6C6C60000000000C6C6C60000000000C6C6C6000000 + 0000C6C6C600C6C6C60000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C6000000000000000000000000000000000000000000C6C6C600FFFFFF00C6C6 + C600FFFFFF000000000084000000840000008400000084000000840000008400 + 000084000000840000008400000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF000000000000000000000000008400000084000000840000008400 + 0000840000008400000000000000C6C6C60000000000C6C6C60000000000C6C6 + C600C6C6C600C6C6C600C6C6C600000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084000000840000008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000FF + FF00FFFFFF0000FFFF00FFFFFF0000000000FFFFFF0000FFFF00FFFFFF0000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000C6C6C60000000000C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084000000840000008400 + 0000840000008400000084000000840000008400000084000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF00FFFFFF0000000000FFFF + FF0000FFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0084000000FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0084000000FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF008400000084000000840000008400000084000000FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF008400 + 0000FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00840000008400000084000000840000008400 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF0084000000FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00840000008400 + 000084000000840000008400000084000000FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000FFFF00000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0084000000FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0084000000FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000008400000084000000840000008400 + 0000840000008400000000000000FFFFFF0000FFFF00FFFFFF0000000000FFFF + FF0000FFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF0084000000FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF008400 + 00008400000084000000840000008400000084000000FFFFFF00FFFFFF000000 + 00000000000000000000000000000000000084000000FFFFFF00C6C6C600FFFF + FF00C6C6C600FFFFFF000000000000FFFF00FFFFFF0000FFFF000000000000FF + FF00FFFFFF0000FFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0084000000FFFFFF0084000000FFFFFF00FFFFFF00000000000000 + 00000000000000000000000000000000000084000000C6C6C600FFFFFF000000 + 8400FFFFFF0000008400000084000000000000FFFF00FFFFFF0000000000FFFF + FF0000FFFF00000000000000000000000000000000000000000000000000FFFF + FF008400000084000000840000008400000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF0084000000FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000000000000000 + 00000000000000000000000000000000000084000000FFFFFF00C6C6C6000000 + 8400C6C6C60000008400C6C6C600FFFFFF000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF008400000084000000840000008400000084000000FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000FFFFFF000000000000000000000000000000 + 00000000000000000000000000008400000084000000C6C6C600000084000000 + 8400FFFFFF00C6C6C60000008400C6C6C6008400000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000008400000084000000FFFFFF00C6C6C6000000 + 8400C6C6C6000000840000008400FFFFFF008400000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 0000FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 00000000000000000000000000008400000084000000C6C6C600FFFFFF00C6C6 + C600FFFFFF00C6C6C600FFFFFF00C6C6C6008400000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000FFFFFF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000840000008400000084000000840000008400 + 0000840000008400000084000000840000008400000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000008400000084000000FF00000084000000FF00 + 0000FF000000FF00000084000000FF0000008400000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000840000008400000084000000840000008400 + 0000840000008400000084000000840000008400000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 840084848400848484008484840084848400848484000000000000FFFF000000 + 0000848484000000000000000000000000000000000000000000000000000000 + 0000000000008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF000000 + 0000000000008484840000000000000000000000000000000000000000000000 + 0000848484008484840000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 8400848484008484840000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFF0000000000000000000000000000FFFF + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00FFFFFF00FFFFFF008400000084000000FFFFFF00FFFFFF0000FF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400848484000000000000FFFF0000FFFF0000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF0084000000FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFF0000FFFF00008484840000000000FFFF + 0000FFFF00000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400000000000000000000FFFF0000FFFF0000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF0084000000FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000000000000FFFF + 0000FFFF0000FFFF000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00FFFFFF00FFFFFF008400000084848400FFFFFF00FFFFFF0000FF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400848484000000000000FFFF0000FFFF0000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF0084000000840000008400000084000000840000008400000084000000FFFF + FF00FFFFFF0000000000000000000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF00000000 + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000FFFF00FFFFFF008484840084000000C6C6C600FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400848484000000000000FFFF0000FFFF0084848400000000000000 + 000000000000848484008484840084848400000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF0084000000FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000000000000FFFF + 0000FFFF0000FFFF000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00FFFFFF00FFFFFF0000FFFF0084848400840000008484840000FF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400848484000000000000FFFF0000FFFF0000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF0084000000FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFF0000FFFF00008484840000000000FFFF + 0000FFFF00000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF008400000084848400FFFFFF00FFFFFF008400000084000000FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400848484000000000000FFFF0000FFFF0084848400000000000000 + 000000000000848484008484840084848400000000000000000000000000FFFF + FF00FFFFFF008400000084000000840000008400000084000000840000008400 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFF0000000000000000000000000000FFFF + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00840000008400000000FFFF00C6C6C600840000008400000000FF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 8400848484000000000000FFFF0000FFFF0000FFFF0000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF0084000000FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00C6C6C60084000000840000008400000084000000C6C6C600FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 84000000000000FFFF0000FFFF0000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF0084000000FFFFFF00FFFFFF0084000000FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FF000000FF000000FF00 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FF000000FF000000FF00 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000FFFF0000000000000000000000000000FFFF000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFF0000000000000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C600C6C6C600C6C6C600C6C6C60000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + 0000FFFF00000000000084848400FFFF0000FFFF000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFF0000FFFF00000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C600FF000000FF000000FF00000000000000FFFFFF00FF000000FF000000FF00 + 0000FFFFFF000000000000000000000000000000000000000000FFFF0000FFFF + 0000FFFF000000000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000000000000000000000000000000000000000000000000000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 000000000000000000000000000000000000000000008484000000000000C6C6 + C600C6C6C600C6C6C600C6C6C60000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFF0000FFFF0000FFFF + 000000000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF000000000000000000000000000000000000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000000000000000000000000000000000000000000000000000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000000000000000000000000000000000008484000000000000C6C6 + C600FF000000FF000000FF000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFF0000FFFF + 0000FFFF000000000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000000000000000000000000000000000000000000000000000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 000000000000000000000000000000000000000000008484000000000000C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C6000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + 0000FFFF00000000000084848400FFFF0000FFFF000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFF0000FFFF00000000 + 000000000000000000000000000000000000000000008484000000000000C6C6 + C600FF000000FF000000FF000000C6C6C6000000000000000000000000000000 + 0000000000000000000084000000000000000000000000000000000000000000 + 0000FFFF0000000000000000000000000000FFFF000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFF0000000000000000 + 000000000000000000000000000000000000000000008484000000000000C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C6000000000000000000000000000000 + 0000000000008400000084000000840000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084840000848400008484 + 0000848400008484000000000000000000000000000000000000840000000000 + 0000000000000000000084000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008400 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 8400848400008484840084840000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 8400848400008484840084840000000000000000000084840000000000000000 + 0000000000000000000000000000848400008484840000000000000000000000 + 0000000000000000000084848400000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 84008484000084848400848400000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084840000000000000000 + 0000000000000000000000000000848400008484840000000000000000000000 + 000000000000000000008484840000000000000000008484840000000000FFFF + FF00FFFFFF00FFFFFF0000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF000000000084840000000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 00008484840084840000848484000000000000000000FFFFFF00FFFFFF000000 + 000000000000FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF0000000000FFFFFF00FFFFFF0000000000000000008484840000000000FFFF + FF00FFFFFF00FFFFFF0000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF000000000084840000000000000000000084840000000000000000 + 000000000000FFFFFF0000000000848400008484840000000000000000000000 + 0000FFFFFF000000000084848400000000000000000084848400000000000000 + 0000000000008484840000000000000000000000000084840000000000000000 + 00000000000084848400848400000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000FFFFFF000000 + 000000000000000000008484840000000000000000008484840000000000FFFF + FF00FFFFFF00FFFFFF0000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF00000000008484000000000000000000008484000000000000FFFF + FF00000000008484000000000000FFFFFF00000000008484840000000000FFFF + FF000000000084840000848484000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084848400000000000000 + 000000000000FFFFFF0000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF000000000084840000000000000000000084840000000000000000 + 0000000000000000000000000000848400008484840000000000000000000000 + 000000000000000000008484840000000000000000008484840000000000FFFF + FF00000000008484840000000000FFFFFF00000000008484000000000000FFFF + FF000000000084848400848400000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000000000000000 + 0000FFFFFF000000000084848400000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 8400848400008484840084840000000000000000000084840000000000000000 + 0000000000008484000000000000000000000000000084840000000000000000 + 00000000000084840000848484000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000000000000000008484840000000000FFFF + FF00000000000000000000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF000000000084840000000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 0000848484008484000084848400000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 84008484000084848400848400000000000000000000FFFFFF0000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF0000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000FFFFFF000000 + 0000FFFFFF000000000084848400000000000000000084848400000000000000 + 0000000000000000000000000000848484008484000000000000000000000000 + 0000000000000000000084840000000000000000000084840000000000000000 + 0000000000008484000000000000000000000000000084840000000000000000 + 0000000000008484000084848400000000008484840000000000FF000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FF0000000000000084848400000000008484840000000000FFFF + FF0000000000FFFFFF0000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF00000000008484000000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000FFFFFF00FFFF + FF00FFFFFF00000000008484840000000000000000008484840000000000FFFF + FF00000000008484840000000000FFFFFF00000000008484840000000000FFFF + FF000000000084848400848400000000000000000000FF000000FF0000000000 + 0000FFFFFF00FF000000000000000000000000000000FFFFFF00FF000000FFFF + FF0000000000FF000000FF00000000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000FFFFFF00FFFF + FF00FFFFFF000000000084848400000000000000000084848400000000000000 + 000000000000FFFFFF0000000000848484008484000000000000000000000000 + 0000FFFFFF00000000008484000000000000000000008484000000000000FFFF + FF00000000008484000000000000FFFFFF00000000008484000000000000FFFF + FF00000000008484000084848400000000008484840000000000FF000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FF00000000000000848484000000000084848400000000000000 + 0000000000000000000000000000848484008484000000000000000000000000 + 000000000000000000008484000000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000FFFFFF00FFFF + FF00FFFFFF000000000084848400000000000000000084848400000000000000 + 0000000000008484840000000000000000000000000084848400000000000000 + 00000000000084848400848400000000000000000000FFFFFF0000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF00000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 0000848484008484000084848400000000000000000084848400000000000000 + 0000000000000000000000000000848484008484000000000000000000000000 + 0000000000000000000084840000000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 00008484840084840000848484000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 0000848484008484000084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084848400FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 840084840000848484008484000000000000000000000000000084848400FFFF + FF000000000000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF0000FFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084840000848484000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000848484008484000084848400000000000000000000000000848484000000 + 00008484840000000000FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00000000000000000084848400848400000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000008484840084840000000000000000000000000000000000008484 + 8400848484008484840000000000FFFFFF00FFFFFF0000FFFF0084848400FFFF + FF00FFFFFF0000FFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084840000848484000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000008484000084848400000000000000000000000000C6C6C600C6C6 + C600C6C6C600848484008484840000000000FFFFFF00FFFFFF00840000008484 + 8400FFFFFF00FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084848400848400000000 + 0000FFFFFF00840000008400000084000000840000008400000084000000FFFF + FF000000000084848400848400000000000000000000FFFFFF00C6C6C600C6C6 + C600C6C6C600C6C6C60084848400848484000000000000FFFF00840000008400 + 0000FFFFFF0000FFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084840000848484000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0000000000848400008484840000000000C6C6C600FFFFFF00FFFFFF00C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084000000840000008400 + 0000FFFFFF00FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF0000000000FFFFFF00FFFFFF00000000000000000084848400848400000000 + 0000FFFFFF0084000000840000008400000084000000FFFFFF00FFFFFF00FFFF + FF000000000084848400848400000000000000000000C6C6C600FFFFFF00FFFF + FF00C6C6C60000000000C6C6C600C6C6C6008484840084000000840000008400 + 0000FFFFFF0000FFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF0000000000FF00 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF00000000000000FFFFFF00000000000000000084840000848484000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000008484000084848400000000000000000000000000C6C6C600FFFF + FF00000000008400000000000000C6C6C6008400000084000000840000008484 + 8400FFFFFF00FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000FF000000FF00 + 000000000000FFFFFF0000000000FF000000FF00000000000000FFFFFF000000 + 0000FF000000FF00000000000000000000000000000084848400848400000000 + 0000FFFFFF00840000008400000084000000840000008400000084000000FFFF + FF0000000000848484008484000000000000000000000000000000000000C6C6 + C600FFFFFF0084000000C6C6C60084848400840000008400000084848400FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF0000000000FF00 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF00000000000000FFFFFF00000000000000000084840000848484000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000008484000084848400000000000000000000000000840000000000 + 0000C6C6C60084000000848484000000000084848400FFFFFF00FFFFFF000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF0000000000FFFFFF00FFFFFF00000000000000000084848400848400000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000848484008484000000000000000000000000000084000000C6C6 + C60000000000840000000000000084848400FFFFFF0000FFFF00FFFFFF008484 + 8400C6C6C60000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 000084848400848400008484840000000000000000000000000084000000C6C6 + C600C6C6C600840000008484840000FFFF00FFFFFF00FFFFFF00FFFFFF008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484008400 + 0000840000008484840084848400848484008484840084848400848484008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084848400848484008484840000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400000000008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000008484840000000000000000000000000000000000C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C6000000000000000000000000000000000000000000C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C6000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484000000 + 00000000000000000000C6C6C600C6C6C600C6C6C60000000000000000000000 + 0000000000000000000084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C60000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C60000000000000000000000000000000000000000000000 + 000000000000FFFFFF008484840000000000FFFFFF0000000000000000000000 + 000000000000000000000000000000000000000000008484840000000000C6C6 + C600848484000000000000000000C6C6C600C6C6C6000000000084848400C6C6 + C6000000000000000000848484000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C60000FFFF0000FFFF0000FFFF00C6C6C600C6C6 + C6000000000000000000000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C60000FFFF0000FFFF0000FFFF00C6C6C600C6C6 + C600000000000000000000000000000000000000000084848400FFFFFF00FFFF + FF00FFFFFF00848484008484840000000000FFFFFF00FFFFFF00848484008484 + 840084848400848484000000000000000000000000000000000084848400C6C6 + C60084848400C6C6C600C6C6C6008484840000000000C6C6C600848484008484 + 84008484840084848400000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084848400C6C6C600C6C6 + C60000000000C6C6C600000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084848400C6C6C600C6C6 + C60000000000C6C6C60000000000000000000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000000000000000000000000000000000 + 0000C6C6C600C6C6C60000000000FFFFFF00FFFFFF0000000000C6C6C6000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C600C6C6C600000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C600C6C6C600000000000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000008484840000000000C6C6C6000000 + 0000C6C6C60000000000C6C6C600C6C6C600C6C6C600FFFFFF00848484000000 + 0000C6C6C600C6C6C600000000008484840000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C60000000000C6C6C6000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C60000000000C6C6C600000000000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000008484840000000000C6C6C600C6C6 + C600FFFFFF00000000008484840000000000C6C6C600FFFFFF0084848400C6C6 + C600C6C6C600C6C6C60000000000848484000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C60000000000C6C6C60000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C60000000000C6C6C60000000000000000000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000008484840000000000000000000000 + 0000FFFFFF00000000008484840084848400C6C6C60000000000C6C6C6000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000C6C6C60000000000C6C6C60000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000C6C6C60000000000C6C6C600848484000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000000000000000000000000000000000 + 0000C6C6C600FFFFFF00000000000000000000000000C6C6C600C6C6C6000000 + 0000000000008484840000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008484 + 0000FFFF0000FFFF0000FFFF0000000000000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00848484000000000000000000000000000000000084848400C6C6 + C60084848400C6C6C600FFFFFF00FFFFFF00C6C6C600C6C6C600848484008484 + 8400848484000000000084848400000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000084848400000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + 0000848400000000000000000000848484000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00848484000000000000000000000000008484840000000000C6C6 + C600848484000000000000000000C6C6C6000000000000000000C6C6C600C6C6 + C600000000008484840000000000000000000000000000000000000000000000 + 000000000000FFFFFF000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000FFFF00008484 + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000000000000000000000000000000000000000000084848400FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000848484000000 + 00008484840000000000C6C6C600C6C6C600C6C6C60000000000848484000000 + 0000848484000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000084848400000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + 0000848400000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400000000000000000000000000000000000000000084848400000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00848484008484 + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084848400848484008484840000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000E00000000100010000000000000700000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFF18000000000008000800000000000 + 0000800000000000000080000000000000008000000000000000800000000000 + 0000800000000000000080000000000000008000000000000000800000000000 + 0000800000000000000080000000000000018000000000008007800000000000 + C007800000000000E007FFFF00000000FFFFE001FFFFFFFFFFFFC001000F8000 + 8003C001000F80008003C001000F80008003C001000F80008003C001000F8000 + 8003C001000F80008003C001000F80008003C001000F80008003C00100048000 + 8003C00100008000C1FEC00100008001E3FEC001F800C07FFFF5C001FC00E0FF + FFF3C003FE04FFFFFFF1FFFFFFFFFFFFFFFFFFFFC001FFFF00010001C001FFFF + 00010001C001001F00010001C001000F00010001C001000700010001C0010003 + 00010001C001000100000001C001000000000001C001001F00010001C001001F + 00000001C001001F00000003C0018FF1808180FFC001FFF9C124C1FFC003FF75 + FE66FFFFC007FF8FFFE7FFFFC00FFFFFC001FFFFFFFFFFFFC001C003C001FFFF + C001C0038031FFF9C001C0038031E7FFC001C0038031C3F3C001C0038001C3E7 + C001C0038001E1C7C001C0038001F08FC001C0038FF1F81FC001C0038FF1FC3F + C001C0038FF1F81FC001C0038FF1F09FC003C0038FF1C1C7C007C0078FF183E3 + C00FC00F80018FF1FFFFC01FFFFFFFFFFFFFFFFFFE0080008003FFFF80000000 + 8003FF81800000008003FF00800000008003FE00800300008003FE0000030000 + 8003FC80000300008003FA000003000080038000000300008003000100030000 + 8003000180030000800300018003000080030001800000008003000180000000 + 8003000580000000FFFF8003FE0000018001FFFFFFFFFFFF8001E00180038003 + DFFBE00180038003F070000180038003E060000180038003802C000180038003 + 000C003F800380030000003F80038003000C003F800380030000003F80038003 + 0000003F80038003000000018003800300000001800380030000000180038003 + FFFFE00180038003FFFFE001FFFFFFFFFFFFFFFFFC01FFFFF800F83FFC01FFFF + F800E00F8001F7DF0000C0070001F63F000080030001F83F000080030003FC1F + 000000010007F80F00000001003FF00F00000001000FF00700000001000FF00F + 000000010003F00F000080030001F007000080030000F8070000C007FE00FC1F + 001FE00FFE00FFFF001FF83FFF80FFFFFFFFFFFFFFFFFFFFC003C003000FFF07 + C003C003000FFE03C003C003140FFC01C003C003000FFC01C003C003000F8001 + C003C003000F0001C003C003000F0001C003C003000F0003C003C003052F0007 + C003C0030052003FC003C00302AC003FC003C003815E003FE003E003C0BE003F + F003F003E07C003FF803F803FF82007FFFFFFFEFFDFFFFFFFFFFFFCFF9FFFFFF + FFFFE007F1FFC003FDDFC003E1FFC003FCCF80030007C003FC478003C03FC003 + 00038003C037C00300018003C027C00300008003C000C00300018003C000C003 + 00038003C000C003FC478003C027C003FCCF8003C037C003FDDF8003C03FE003 + FFFF8003C03FF003FFFFC007FFFFF803FFFFFFFFFFFFFFFFFE03FFFFFFFFFFFF + FE03FFFFFFFFFFFFFE03FBBFFEFFFF7FFE03F33FFCFFFF3FC003E23FF8FFFF1F + C003C000F003C00F00038000E003C00700030000C003C00300038000E003C007 + 007FC000F003C00F007DE23FF8FFFF1F0078F33FFCFFFF3F007DFBBFFEFFFF7F + 01DDFFFFFFFFFFFF01E3FFFFFFFFFFFFFFFF8001FFFFFFFF8001000080018081 + 0000000000000080000000000000008000000000000000800000000000000100 + 0000000000000100000000000000018000000000000000800000000000000000 + 0000000000000100000000000000018000000000000000800000000000000080 + 8001000080018081FFFF8001FFFFFFFFFFFFFFFFFFFFFFFFC001800180018001 + C001000000000000C001000000000000C001000000000000C001000000000000 + 8001000000000000000100000000000000010000000000000001000000000000 + 8001000000000000C001000000000000C001000000000000C003000000000000 + C007800180018001C00FFFFFFFFFFFFFFC7FFFFFFFFFFFFFFC27C007C007FFFF + EC2380038003F83FC4010001000100018001000100010001C003000100010001 + E000000000000001000000000000000100008000800000010003C000C0000001 + E001E001E0000001C001E007800000018003F00780070101C407F00380008383 + EC3FF803F000FFFFFC7FFFFFF800FFFF00000000000000000000000000000000 + 000000000000} + end + object pmPreview: TdxBarPopupMenu + BarManager = dxBarManager + ItemLinks = < + item + Item = bbFileDesign + Visible = True + end + item + BeginGroup = True + Item = bbFilePageSetup + Visible = True + end + item + BeginGroup = True + Item = bbFormatShrinkToPageWidth + Visible = True + end + item + BeginGroup = True + Item = cbxPredefinedZoom + Visible = True + end + item + Item = bbZoomWholePage + Visible = True + end + item + BeginGroup = True + Item = bbGoToFirstPage + Visible = True + end + item + Item = bbGoToPrevPage + Visible = True + end + item + BeginGroup = True + Item = seActivePage + Visible = True + end + item + BeginGroup = True + Item = bbGoToNextPage + Visible = True + end + item + Item = bbGoToLastPage + Visible = True + end> + UseOwnFont = False + Left = 91 + Top = 197 + end + object MainMenu1: TMainMenu + Left = 7 + Top = 197 + end + object pmPrintStyles: TdxBarPopupMenu + BarManager = dxBarManager + ItemLinks = < + item + Item = bliPrintStyles + Visible = True + end + item + BeginGroup = True + Item = bbDefinePrintStyles + Visible = True + end> + UseOwnFont = False + Left = 119 + Top = 197 + end + object TimerHint: TTimer + Enabled = False + OnTimer = TimerHintTimer + Left = 8 + Top = 246 + end + object pmExplorer: TdxBarPopupMenu + BarManager = dxBarManager + ItemLinks = < + item + Item = bbFileLoad + Visible = True + end + item + Item = bbFileClose + Visible = True + end + item + BeginGroup = True + Item = bbExplorerCreateNewFolder + Visible = True + end + item + BeginGroup = True + Item = bbExplorerDelete + Visible = True + end + item + Item = bbExplorerRename + Visible = True + end + item + BeginGroup = True + Item = bbExplorerProperties + Visible = True + end> + UseOwnFont = False + OnPopup = pmExplorerPopup + Left = 147 + Top = 197 + end + object pmThumbnails: TdxBarPopupMenu + BarManager = dxBarManager + ItemLinks = < + item + Item = bbThumbnailsSmall + Visible = True + end + item + Item = bbThumbnailsLarge + Visible = True + end> + UseOwnFont = False + Left = 175 + Top = 197 + end +end diff --git a/official/x.35/Lib/D11/dxPSPrVwAdvD11.bpl b/official/x.35/Lib/D11/dxPSPrVwAdvD11.bpl new file mode 100644 index 00000000..5d4a70c0 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSPrVwAdvD11.bpl differ diff --git a/official/x.35/Lib/D11/dxPSPrVwAdvD11.dcu b/official/x.35/Lib/D11/dxPSPrVwAdvD11.dcu new file mode 100644 index 00000000..7a111475 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSPrVwAdvD11.dcu differ diff --git a/official/x.35/Lib/D11/dxPSPrVwDsg.dcu b/official/x.35/Lib/D11/dxPSPrVwDsg.dcu new file mode 100644 index 00000000..b31c4c87 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSPrVwDsg.dcu differ diff --git a/official/x.35/Lib/D11/dxPSPrVwOpt.dcu b/official/x.35/Lib/D11/dxPSPrVwOpt.dcu new file mode 100644 index 00000000..9e44351a Binary files /dev/null and b/official/x.35/Lib/D11/dxPSPrVwOpt.dcu differ diff --git a/official/x.35/Lib/D11/dxPSPrVwOpt.dfm b/official/x.35/Lib/D11/dxPSPrVwOpt.dfm new file mode 100644 index 00000000..75b2675f --- /dev/null +++ b/official/x.35/Lib/D11/dxPSPrVwOpt.dfm @@ -0,0 +1,181 @@ +object dxfmOptions: TdxfmOptions + Left = 310 + Top = 187 + ActiveControl = chbxShowMargins + BorderStyle = bsDialog + Caption = 'Preferences' + ClientHeight = 247 + ClientWidth = 536 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 5 + Top = 4 + Width = 526 + Height = 207 + ActivePage = tshGeneral + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + TabStop = False + object tshGeneral: TTabSheet + Caption = 'General' + object gbxShow: TGroupBox + Left = 6 + Top = 4 + Width = 250 + Height = 104 + Caption = ' &Show ' + TabOrder = 0 + object chbxShowMargins: TCheckBox + Left = 10 + Top = 22 + Width = 230 + Height = 17 + Caption = '&Margins' + TabOrder = 0 + OnClick = FormChanged + end + object chbxShowMarginsHints: TCheckBox + Left = 10 + Top = 49 + Width = 230 + Height = 17 + Caption = 'Margins &hints' + TabOrder = 1 + OnClick = FormChanged + end + object chbxShowMarginsHintsWhileDragging: TCheckBox + Left = 10 + Top = 75 + Width = 230 + Height = 17 + Caption = 'Margins hints while &dragging' + TabOrder = 2 + OnClick = FormChanged + end + end + object gbxMeasurementUnits: TGroupBox + Left = 6 + Top = 109 + Width = 250 + Height = 61 + TabOrder = 2 + object lblMeasurementUnits: TLabel + Left = 8 + Top = 12 + Width = 95 + Height = 13 + Caption = '&Measurement units:' + FocusControl = cbxMeasurementUnits + OnClick = lblMeasurementUnitsClick + end + object cbxMeasurementUnits: TComboBox + Left = 8 + Top = 28 + Width = 232 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + OnChange = FormChanged + Items.Strings = ( + 'Default' + 'Inches' + 'Millimeters') + end + end + object gbxMarginsColor: TGroupBox + Left = 261 + Top = 109 + Width = 250 + Height = 61 + TabOrder = 3 + object lblMarginsColor: TLabel + Left = 8 + Top = 12 + Width = 67 + Height = 13 + Caption = '&Margins color:' + OnClick = lblMarginsColorClick + end + object bvlMarginColorHolder: TBevel + Left = 8 + Top = 28 + Width = 231 + Height = 21 + Visible = False + end + end + object gbxZoomOpt: TGroupBox + Left = 261 + Top = 4 + Width = 250 + Height = 104 + TabOrder = 1 + object lblZoomStep: TLabel + Left = 10 + Top = 54 + Width = 58 + Height = 13 + Caption = 'Zoom &Step :' + OnClick = lblZoomStepClick + end + object bvlZoomStepHolder: TBevel + Left = 103 + Top = 50 + Width = 67 + Height = 21 + Visible = False + end + object chbxZoomOnRoll: TCheckBox + Left = 10 + Top = 22 + Width = 230 + Height = 17 + Caption = '&Zoom on roll with IntelliMouse' + TabOrder = 0 + OnClick = FormChanged + end + end + end + end + object btnOk: TButton + Left = 294 + Top = 218 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 375 + Top = 218 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object btnHelp: TButton + Left = 456 + Top = 218 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Caption = '&Help' + TabOrder = 3 + end +end diff --git a/official/x.35/Lib/D11/dxPSPrVwStd.dcu b/official/x.35/Lib/D11/dxPSPrVwStd.dcu new file mode 100644 index 00000000..964eab2b Binary files /dev/null and b/official/x.35/Lib/D11/dxPSPrVwStd.dcu differ diff --git a/official/x.35/Lib/D11/dxPSPrVwStd.dfm b/official/x.35/Lib/D11/dxPSPrVwStd.dfm new file mode 100644 index 00000000..794bc138 --- /dev/null +++ b/official/x.35/Lib/D11/dxPSPrVwStd.dfm @@ -0,0 +1,2330 @@ +object dxfmStdPreview: TdxfmStdPreview + Left = 260 + Top = 90 + Width = 1004 + Height = 492 + Caption = 'Preview' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Icon.Data = { + 0000010001001010100000000000280100001600000028000000100000002000 + 00000100040000000000C0000000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000 + 00000000000000000000000000000FFFFFFFFFF000000FFFFFFF000070000FFF + FFF0788707000FFFFF0788E770000FFFFF08888780000FFFFF08E88780000FFF + FF07EE8770000FFFFFF0788700000FFFFFFF000000000FFFFFFFFFF000000FFF + FFFF000000000FFFFFFF080000000FFFFFFF000000000000000000000000FFFF + 0000000C00000008000000010000000300000003000000030000000300000003 + 000000070000000F0000000F0000000F0000001F0000003F0000007F0000} + KeyPreview = True + Menu = MainMenu1 + OldCreateOrder = True + Position = poDefault + PixelsPerInch = 96 + TextHeight = 13 + object ToolBar: TToolBar + Left = 0 + Top = 0 + Width = 996 + Height = 30 + BorderWidth = 2 + ButtonHeight = 24 + ButtonWidth = 28 + EdgeBorders = [ebTop, ebBottom] + Flat = True + Images = ilToolBarSmall + Indent = 4 + ParentShowHint = False + PopupMenu = pmToolBar + ShowHint = True + TabOrder = 0 + Wrapable = False + object tbReportDesigner: TToolButton + Left = 4 + Top = 0 + Hint = 'Ctrl+D' + Caption = 'Design' + ImageIndex = 0 + OnClick = DesignClick + end + object tbFileLoad: TToolButton + Left = 32 + Top = 0 + Hint = 'Ctrl+O' + Caption = 'tbFileLoad' + ImageIndex = 23 + OnClick = FileLoadClick + end + object tbFileUnload: TToolButton + Left = 60 + Top = 0 + Caption = 'tbFileUnload' + ImageIndex = 24 + OnClick = FileCloseClick + end + object tbFileSave: TToolButton + Left = 88 + Top = 0 + Hint = 'Ctrl+S' + Caption = 'tbFileSave' + ImageIndex = 19 + OnClick = FileSaveClick + end + object tbSeparator1: TToolButton + Left = 116 + Top = 0 + Width = 8 + Caption = 'tbSeparator1' + ImageIndex = 0 + Style = tbsSeparator + end + object tbPrint: TToolButton + Left = 124 + Top = 0 + Caption = 'Print' + ImageIndex = 1 + OnClick = PrintClick + end + object tbPrintDialog: TToolButton + Tag = 1 + Left = 152 + Top = 0 + Hint = 'Ctrl+P' + Caption = 'PrintDialog' + ImageIndex = 2 + OnClick = PrintClick + end + object tbPageSetup: TToolButton + Tag = 2 + Left = 180 + Top = 0 + Caption = 'PageSetup' + DropdownMenu = pmPrintStyles + ImageIndex = 3 + Style = tbsDropDown + OnClick = PageSetupClick + end + object tbSeparator3: TToolButton + Left = 221 + Top = 0 + Width = 8 + Caption = 'tbSeparator3' + ImageIndex = 0 + Style = tbsSeparator + end + object tbViewExplorer: TToolButton + Left = 229 + Top = 0 + Caption = 'tbViewExplorer' + ImageIndex = 30 + Style = tbsCheck + OnClick = ViewExplorerClick + end + object tbViewThumbnails: TToolButton + Left = 257 + Top = 0 + Caption = 'tbViewThumbnails' + ImageIndex = 31 + Style = tbsCheck + OnClick = ViewThumbnailsClick + end + object tbSeparator2: TToolButton + Left = 285 + Top = 0 + Width = 8 + Caption = 'tbSeparator2' + ImageIndex = 0 + Style = tbsSeparator + end + object tbShrinkToPageWidth: TToolButton + Left = 293 + Top = 0 + AllowAllUp = True + Caption = 'tbShrinkToPageWidth' + Grouped = True + ImageIndex = 12 + OnClick = ShrinkToPageWidthClick + end + object tbPageBackground: TToolButton + Left = 321 + Top = 0 + Hint = 'Ctrl+K' + Caption = 'PageBackground' + ImageIndex = 4 + OnClick = PageBackgroundClick + end + object ToolButton5: TToolButton + Left = 349 + Top = 0 + Width = 8 + Caption = 'ToolButton5' + ImageIndex = 19 + Style = tbsSeparator + end + object tbPercent100: TToolButton + Left = 357 + Top = 0 + Hint = 'Ctrl+\' + Caption = '100 percent' + ImageIndex = 5 + OnClick = ZoomClick + end + object tbPageWidth: TToolButton + Tag = 1 + Left = 385 + Top = 0 + Hint = 'Ctrl+0' + Caption = 'Page Width' + ImageIndex = 6 + OnClick = ZoomClick + end + object tbOnePage: TToolButton + Tag = 2 + Left = 413 + Top = 0 + Hint = 'Ctrl+1' + Caption = 'Whole Page' + ImageIndex = 7 + OnClick = ZoomClick + end + object tbTwoPage: TToolButton + Tag = 3 + Left = 441 + Top = 0 + Hint = 'Ctrl+2' + Caption = 'Two Pages' + ImageIndex = 8 + OnClick = ZoomClick + end + object tbFourPage: TToolButton + Tag = 4 + Left = 469 + Top = 0 + Hint = 'Ctrl+4' + Caption = 'Four Pages' + ImageIndex = 9 + OnClick = ZoomClick + end + object tbMultiplePages: TToolButton + Left = 497 + Top = 0 + Caption = 'tbMultiplePages' + ImageIndex = 10 + OnClick = tbMultiplePagesClick + end + object tbWidenToSourceWidth: TToolButton + Tag = 5 + Left = 525 + Top = 0 + Hint = 'Ctrl+W' + Caption = 'Source Width' + ImageIndex = 11 + OnClick = ZoomClick + end + object tbSeparator4: TToolButton + Left = 553 + Top = 0 + Width = 8 + Caption = 'tbSeparator4' + ImageIndex = 18 + Style = tbsSeparator + end + object pnlZoomCbx: TPanel + Left = 561 + Top = 0 + Width = 138 + Height = 24 + BevelOuter = bvNone + TabOrder = 0 + OnResize = pnlZoomCbxResize + end + object tbSeparator5: TToolButton + Left = 699 + Top = 0 + Width = 8 + Caption = 'tbSeparator5' + ImageIndex = 19 + Style = tbsSeparator + end + object tbGotoFirstPage: TToolButton + Left = 707 + Top = 0 + Caption = 'First Page' + ImageIndex = 13 + OnClick = GoToPageClick + end + object tbGotoPrevPage: TToolButton + Tag = 1 + Left = 735 + Top = 0 + Caption = 'Prev Page' + ImageIndex = 14 + OnClick = GoToPageClick + end + object ToolButton2: TToolButton + Left = 763 + Top = 0 + Width = 8 + Caption = 'ToolButton2' + ImageIndex = 20 + Style = tbsSeparator + end + object pnlCurrentPage: TPanel + Left = 771 + Top = 0 + Width = 59 + Height = 24 + BevelOuter = bvNone + TabOrder = 1 + OnResize = pnlCurrentPageResize + end + object ToolButton1: TToolButton + Left = 830 + Top = 0 + Width = 8 + Caption = 'ToolButton1' + ImageIndex = 19 + Style = tbsSeparator + end + object tbGotoNextPage: TToolButton + Tag = 2 + Left = 838 + Top = 0 + Caption = 'Next Page' + ImageIndex = 15 + OnClick = GoToPageClick + end + object tbGotoLastPage: TToolButton + Tag = 3 + Left = 866 + Top = 0 + Caption = 'Last Page' + ImageIndex = 16 + OnClick = GoToPageClick + end + object tbSeparator8: TToolButton + Left = 894 + Top = 0 + Width = 8 + Caption = 'tbSeparator8' + ImageIndex = 0 + Style = tbsSeparator + end + object tbHelp: TToolButton + Left = 902 + Top = 0 + Hint = 'F1' + Caption = 'Help' + ImageIndex = 17 + OnClick = HelpClick + end + object tbClose: TToolButton + Left = 930 + Top = 0 + Caption = 'Close' + ImageIndex = 18 + OnClick = CloseClick + end + end + object pmToolBar: TPopupMenu + OnPopup = pmToolBarPopup + Left = 47 + Top = 56 + object pmiFlatBtns: TMenuItem + Caption = '&Flat Buttons' + Checked = True + GroupIndex = 2 + OnClick = pmiFlatBtnsClick + end + object pmiLargeBtns: TMenuItem + Caption = '&Large Buttons' + Checked = True + GroupIndex = 2 + OnClick = pmiLargeBtnsClick + end + end + object MainMenu1: TMainMenu + Left = 19 + Top = 56 + object miFile: TMenuItem + Caption = '&File' + object miFileDesign: TMenuItem + Caption = '&Design...' + ShortCut = 16452 + OnClick = DesignClick + end + object miFileRebuild: TMenuItem + Caption = 'Rebuild' + ShortCut = 16500 + OnClick = miFileRebuildClick + end + object miLine32: TMenuItem + Caption = '-' + end + object miFileLoad: TMenuItem + Caption = 'Load...' + ShortCut = 16463 + OnClick = FileLoadClick + end + object miFileClose: TMenuItem + Caption = 'Unload' + ShortCut = 16499 + OnClick = FileCloseClick + end + object miLine30: TMenuItem + Caption = '-' + end + object miFileSave: TMenuItem + Caption = '&Save...' + ShortCut = 16467 + OnClick = FileSaveClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miFilePrint: TMenuItem + Tag = 1 + Caption = '&Print...' + ShortCut = 16464 + OnClick = PrintClick + end + object miFilePageSetup: TMenuItem + Tag = 2 + Caption = 'Page Set&up...' + OnClick = PageSetupClick + end + object miFilePrintStyles: TMenuItem + Caption = 'Print Styles' + end + object miLine3: TMenuItem + Caption = '-' + end + object miFilePreferences: TMenuItem + Caption = 'Pre&ferences...' + OnClick = OptionsClick + end + object miLine1: TMenuItem + Caption = '-' + end + object miFileExit: TMenuItem + Caption = '&Close' + OnClick = CloseClick + end + end + object miExplorer: TMenuItem + Caption = 'E&xplorer' + object miExplorerCreateNewFolder: TMenuItem + Caption = 'New &Folder' + ShortCut = 32821 + OnClick = ExplorerCreateNewFolderClick + end + object miLine31: TMenuItem + Caption = '-' + end + object miExplorerDelete: TMenuItem + Caption = '&Delete...' + ShortCut = 46 + OnClick = ExplorerDeleteClick + end + object miExplorerRename: TMenuItem + Caption = '&Rename' + ShortCut = 113 + OnClick = ExplorerRenameClick + end + object miLine39: TMenuItem + Caption = '-' + end + object miExplorerProperties: TMenuItem + Caption = 'P&roperties...' + ShortCut = 32889 + OnClick = ExplorerPropertiesClick + end + end + object miEdit: TMenuItem + Caption = '&Edit' + Visible = False + object miEditFind: TMenuItem + Caption = '&Find ...' + ShortCut = 16454 + end + object miEditFindNext: TMenuItem + Caption = 'Find Ne&xt' + ShortCut = 114 + end + object N6: TMenuItem + Caption = '-' + end + object miEditReplace: TMenuItem + Caption = '&Replace ...' + ShortCut = 16466 + end + end + object miView: TMenuItem + Caption = '&View' + object miViewMargins: TMenuItem + Caption = '&Margins' + Checked = True + ShortCut = 16461 + OnClick = miViewMarginsClick + end + object miLine4: TMenuItem + Caption = '-' + end + object miViewFlatTBtns: TMenuItem + Caption = '&Flat toolbar buttons' + Checked = True + OnClick = pmiFlatBtnsClick + end + object miViewLargeTBtns: TMenuItem + Caption = '&Large toolbar buttons' + Checked = True + OnClick = pmiLargeBtnsClick + end + object miLine5: TMenuItem + Caption = '-' + end + object miViewToolBar: TMenuItem + Caption = '&Toolbar' + Checked = True + Visible = False + end + object miViewMarginBar: TMenuItem + Caption = '&MarginBar' + Checked = True + OnClick = miViewMarginBarClick + end + object miViewStatusBar: TMenuItem + Caption = '&StatusBar' + Checked = True + OnClick = miViewStatusBarClick + end + object miViewExplorer: TMenuItem + Caption = 'E&xplorer' + ShortCut = 16472 + OnClick = ViewExplorerClick + end + object miViewThumbnails: TMenuItem + Caption = 'Th&umbnails' + ShortCut = 16469 + OnClick = ViewThumbnailsClick + end + object N1: TMenuItem + Caption = '-' + end + object miViewZoom: TMenuItem + Caption = '&Zoom' + object miZoomPercent100: TMenuItem + Caption = '&Percent 100' + ShortCut = 16604 + OnClick = ZoomClick + end + object miLine6: TMenuItem + Caption = '-' + end + object miZoomPageWidth: TMenuItem + Tag = 1 + Caption = 'Page &Width' + ShortCut = 16432 + OnClick = ZoomClick + end + object miZoomWholePage: TMenuItem + Tag = 2 + Caption = 'W&hole Page' + ShortCut = 16433 + OnClick = ZoomClick + end + object miZoomTwoPages: TMenuItem + Tag = 3 + Caption = '&Two Pages' + ShortCut = 16434 + OnClick = ZoomClick + end + object miZoomFourPages: TMenuItem + Tag = 4 + Caption = '&Four Pages ' + ShortCut = 16436 + OnClick = ZoomClick + end + object miLine7: TMenuItem + Caption = '-' + end + object miZoomWidenToSourceWidth: TMenuItem + Tag = 5 + Caption = '&Widen to source width' + ShortCut = 16471 + OnClick = ZoomClick + end + object miLine20: TMenuItem + Caption = '-' + end + object miZoomSetup: TMenuItem + Caption = '&Setup ...' + OnClick = miZoomSetupClick + end + end + object N5: TMenuItem + Caption = '-' + end + object miViewPageHeaders: TMenuItem + Caption = 'Page &Headers' + Checked = True + OnClick = miViewPageHeadersClick + end + object miViewPageFooters: TMenuItem + Caption = '&Page Footers' + Checked = True + OnClick = miViewPageFootersClick + end + end + object miFormat: TMenuItem + Caption = '&Format' + object miFormatAutoText: TMenuItem + Caption = '&AutoText...' + OnClick = miFormatAutoTextClick + end + object miLine14: TMenuItem + Caption = '-' + end + object miFormatTitle: TMenuItem + Caption = 'Title...' + OnClick = miFormatTitleClick + end + object N7: TMenuItem + Caption = '-' + Hint = 'miLine38' + end + object miFormatDateTime: TMenuItem + Caption = 'Date And &Time ...' + OnClick = miFormatDateTimeClick + end + object miFormatPageNumbering: TMenuItem + Caption = 'Page &Numbering ...' + OnClick = miFormatPageNumberingClick + end + object N4: TMenuItem + Caption = '-' + end + object miFormatShowHideEmptyPages: TMenuItem + Caption = 'Show/Hide Empty Pages' + Checked = True + OnClick = miFormatShowHideEmptyPagesClick + end + object miFormatShrinkToPageWidth: TMenuItem + Caption = '&Shrink To Page' + Checked = True + OnClick = ShrinkToPageWidthClick + end + object miLine13: TMenuItem + Caption = '-' + end + object miFormatPageBackground: TMenuItem + Caption = 'Page bac&kground ...' + ShortCut = 16459 + OnClick = PageBackgroundClick + end + end + object miGoToPage: TMenuItem + Caption = '&Go' + object miGoToFirstPage: TMenuItem + Caption = '&First Page' + ShortCut = 36 + OnClick = GoToPageClick + end + object miGoToPrevPage: TMenuItem + Tag = 1 + Caption = '&Previous Page' + ShortCut = 33 + OnClick = GoToPageClick + end + object miLine8: TMenuItem + Caption = '-' + end + object miGoToNextPage: TMenuItem + Tag = 2 + Caption = '&Next Page' + ShortCut = 34 + OnClick = GoToPageClick + end + object miGoToLastPage: TMenuItem + Tag = 3 + Caption = '&Last Page' + ShortCut = 35 + OnClick = GoToPageClick + end + end + object miHelp: TMenuItem + Caption = '&Help' + object miHelpTopics: TMenuItem + Caption = '&Help Topics ...' + OnClick = HelpClick + end + object N3: TMenuItem + Caption = '-' + Visible = False + end + object miHelpAbout: TMenuItem + Caption = '&About ..' + Visible = False + end + end + end + object pmPreview: TPopupMenu + OnPopup = pmPreviewPopup + Left = 75 + Top = 56 + object pmiReportDesign: TMenuItem + Caption = '&Design ...' + Default = True + ShortCut = 16452 + OnClick = DesignClick + end + object miLine11: TMenuItem + Caption = '-' + end + object pmiPageSetup: TMenuItem + Caption = 'Page Set&up ...' + OnClick = PageSetupClick + end + object pmiFilePrintStyles: TMenuItem + Caption = 'Print Styles' + end + object pmiReportShrinkToPageWidth: TMenuItem + Caption = '&Shrink To Page' + Checked = True + OnClick = ShrinkToPageWidthClick + end + object miLine10: TMenuItem + Caption = '-' + end + object pmiZoom: TMenuItem + Caption = '&Zoom ' + object pmiZoomPercent100: TMenuItem + Caption = '&Percent 100' + ShortCut = 16604 + OnClick = ZoomClick + end + object miLine12: TMenuItem + Caption = '-' + end + object pmiZoomPageWidth: TMenuItem + Tag = 1 + Caption = 'Page &Width' + ShortCut = 16432 + OnClick = ZoomClick + end + object pmiZoomWholePage: TMenuItem + Tag = 2 + Caption = 'W&hole Page' + ShortCut = 16433 + OnClick = ZoomClick + end + object pmiZoomTwoPages: TMenuItem + Tag = 3 + Caption = '&Two Pages' + ShortCut = 16434 + OnClick = ZoomClick + end + object pmiZoomFourPages: TMenuItem + Tag = 4 + Caption = '&Four Pages' + ShortCut = 16436 + OnClick = ZoomClick + end + object miLine9: TMenuItem + Caption = '-' + end + object pmiZoomWidenToSourceWidth: TMenuItem + Tag = 5 + Caption = 'Widen to &source width' + ShortCut = 16471 + OnClick = ZoomClick + end + end + object N2: TMenuItem + Caption = '-' + end + object pmiGoToFirstPage: TMenuItem + Caption = 'First Page' + ShortCut = 36 + OnClick = GoToPageClick + end + object pmiGoToPrevPage: TMenuItem + Tag = 1 + Caption = 'Previous Page' + ShortCut = 33 + OnClick = GoToPageClick + end + object pmiGoToNextPage: TMenuItem + Tag = 2 + Caption = 'Next Page' + ShortCut = 34 + OnClick = GoToPageClick + end + object pmiGoToLastPage: TMenuItem + Tag = 3 + Caption = 'Last Page' + ShortCut = 35 + OnClick = GoToPageClick + end + end + object ilToolBarSmall: TImageList + AllocBy = 29 + Left = 47 + Top = 107 + Bitmap = { + 494C010120002200040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000009000000001002000000000000090 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FF000000FFFF000080000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FFFF00008000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF00FFFFFF0000000000FFFF + FF0000FFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000008080800000808000008080000080 + 8000008080000080800000808000008080000080800000808000FF000000FFFF + 0000800000000080800000808000000000000000000000000000808080000000 + 0000000000000000000080808000000000000000000000000000808080000000 + 0000000000000000000080808000000000000000000000000000000000000000 + 000000000000000000000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00000000000000000000000000FFFFFF00FFFFFF00C0C0 + C000FFFFFF00C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF00FF000000FFFF00008000 + 000000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF008000 + 0000FFFFFF0080000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000FFFF00C0C0C000000000000000000000000000C0C0C0008000000000FF + FF0000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000FFFF00000000000000 + 00000000000000000000000000000000000000000000FFFFFF00800000008000 + 000080000000800000008000000080000000FFFFFF00FFFFFF00FFFFFF000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF00C0C0C00000000000FFFF0000C0C0C000FFFF000000000000C0C0C00000FF + FF0000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF000000000080808000000000008000000080000000800000008000 + 0000800000008000000000000000FFFFFF0000FFFF00FFFFFF0000000000FFFF + FF0000FFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080000000FFFFFF0080000000FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000000000FFFF0000C0C0C000FFFF0000C0C0C000FFFF00000000000000FF + FF0000FFFF0000FFFF0000808000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 80008080800080808000808080000000000080000000FFFFFF00C0C0C000FFFF + FF00C0C0C000FFFFFF000000000000FFFF00FFFFFF0000FFFF000000000000FF + FF00FFFFFF0000FFFF00000000000000000000000000FFFFFF00FFFFFF008000 + 00008000000080000000800000008000000080000000FFFFFF00FFFFFF000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000000000C0C0C000FFFF0000C0C0C000FFFF0000C0C0C0000000000000FF + FF0000FFFF0000FFFF0000808000000000000000000000000000808080000000 + 0000000000000000000080808000000000000000000000000000808080000000 + 00000000000000000000808080000000000080000000C0C0C000FFFFFF000000 + 8000FFFFFF0000008000000080000000000000FFFF00FFFFFF0000000000FFFF + FF0000FFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080000000FFFFFF0080000000FFFFFF00FFFFFF00000000000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF0000000000FFFF0000C0C0C000FFFF0000C0C0C000FFFF00000000000000FF + FF0000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF0000000000808080000000000080000000FFFFFF00C0C0C0000000 + 8000C0C0C00000008000C0C0C000FFFFFF000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00C0C0C000FFFFFF00C0C0C000FFFFFF0000000000C0C0C0000000 + 00000000000000000000000000000000000080808000FFFFFF0000FFFF0000FF + FF00C0C0C00000000000FFFF0000C0C0C000FFFF000000000000C0C0C00000FF + FF0000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF0000000000808080000000000080000000C0C0C000000080000000 + 8000FFFFFF00C0C0C00000008000C0C0C0008000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000FFFFFF0000000000C0C0C00000000000C0C0 + C0000000000000000000000000008000000080808000FFFFFF0000FFFF0000FF + FF0000FFFF00C0C0C000000000000000000000000000C0C0C00000FFFF0000FF + FF0000FFFF0000FFFF000080800000000000000000000000000080808000FFFF + FF00FFFFFF000000000080808000FFFFFF00FFFFFF000000000080808000FFFF + FF00FFFFFF0000000000808080000000000080000000FFFFFF00C0C0C0000000 + 8000C0C0C0000000800000008000FFFFFF008000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF0000000000C0C0C00000000000C0C0C00000000000C0C0C0000000 + 0000C0C0C000C0C0C000000000008000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000808000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 80008080800080808000808080000000000080000000C0C0C000FFFFFF00C0C0 + C000FFFFFF00C0C0C000FFFFFF00C0C0C0008000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000FFFFFF00FFFFFF0000000000C0C0C00000000000C0C0C00000000000C0C0 + C000C0C0C000C0C0C000C0C0C000800000008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008000000080000000800000008000 + 0000800000008000000080000000800000008000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF0000000000C0C0C00000000000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C00080000000000000008080800000FFFF000000 + 0000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000FFFF + FF00000000000000000000000000000000000000000000000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF0000000000000000FFFF000000000080000000FF00000080000000FF00 + 0000FF000000FF00000080000000FF0000008000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C00000000000800000000000000000000000808080000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008000000080000000800000008000 + 0000800000008000000080000000800000008000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000800000000000000000000000000000000000 + 0000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000FFFF + FF00808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000808080000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF008000000080000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00000000000000 + 0000FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0080000000800000008000000080000000800000008000 + 0000FFFFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00C0C0C000FFFFFF00FFFFFF00C0C0C000FFFFFF00C0C0C000FFFFFF00C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF008000000080000000FFFFFF00FFFFFF00FFFF + FF0080000000FFFFFF000000000000000000000000000000000000000000FFFF + FF00C0C0C000FFFFFF00FFFFFF00C0C0C000FFFFFF00C0C0C000FFFFFF00C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00000000000000 + 0000FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF00FFFF + FF0080000000FFFFFF000000000000000000000000000000000000000000FFFF + FF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00C0C0C000FFFFFF00FFFFFF00C0C0C000FFFFFF00C0C0C000FFFFFF00C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF0080000000FFFFFF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000FFFFFF0000000000808080000000000000000000FFFFFF00000000000000 + 0000FFFFFF00FFFFFF00FFFFFF0000000000C0C0C00000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 800000808000000000000000000000000000000000000000000000000000FFFF + FF0080000000FFFFFF00FFFFFF00FFFFFF008000000080000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000808080000000000000000000FFFFFF0000000000C0C0 + C00000000000FFFFFF0000000000C0C0C00000000000C0C0C000000000000000 + 0000000000000000000080000000800000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000808080000000000000000000000000000000000000000000FFFF + FF00FFFFFF00800000008000000080000000800000008000000080000000FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF00FFFFFF0000000000808080000000000000000000FFFFFF00FFFFFF000000 + 0000C0C0C00000000000C0C0C00000000000C0C0C00000000000C0C0C000C0C0 + C000C0C0C000000000008000000080000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 000000000000000000000000000080000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008000000080000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000000000000000000000000000FFFF + FF000000FF000000000000000000000000000000000000000000000000000000 + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 000000000000C0C0C00000000000C0C0C00000000000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C00080000000800000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000080000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080000000FFFFFF00FFFFFF000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 00000000000000000000C0C0C00000000000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C00080000000800000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000080000000000000008000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000080808000000000000000000000000000000000000000 + 0000000000000000000000000000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C0000000000080000000800000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000080000000800000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080000000800000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000800000008000000080000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF00000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF00000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00000000000000000000000000000000000000000000000000FFFF + FF0000FFFF00FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000FFFF00000000000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000000000000000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF0000000000000000000000000000000000FFFFFF0000FFFF000000 + 0000008080000080800000808000008080000080800000808000008080000080 + 80000080800000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF00000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000FFFF00FFFFFF0000FF + FF00000000000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF008080800000FFFF00FFFFFF0000FFFF008080 + 800000FFFF0000FFFF0000FFFF00808080000000000000FFFF00FFFFFF000000 + 000000000000000000000000000000000000FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF008080800000FFFF0000FFFF008080 + 800000FFFF00FFFFFF008080800000FFFF0000000000FFFFFF0000FFFF00FFFF + FF00000000000000000000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF008080800000FFFF008080 + 8000FFFFFF008080800000FFFF00000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF0080808000808080008080800080808000FFFF + FF008080800080808000808080008080800000000000FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF0000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000FFFF008080800000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF0000000000000000008080800000FFFF008080 + 800000FFFF008080800000FFFF0000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080800000FFFF00000000008080 + 8000FFFFFF00000000008080800000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000008080800000FFFF0000000000000000008080 + 8000808080000000000000000000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 840084848400848484008484840084848400848484000000000000FFFF000000 + 0000848484000000000000000000000000000000000000000000000000000000 + 0000000000008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF000000 + 0000000000008484840000000000000000000000000000000000000000000000 + 0000848484008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 8400848484008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFF0000000000000000000000000000FFFF + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00FFFFFF00FFFFFF008400000084000000FFFFFF00FFFFFF0000FF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400848484000000000000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFF0000FFFF00008484840000000000FFFF + 0000FFFF00000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400000000000000000000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 80000080800000808000000000000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000000000000FFFF + 0000FFFF0000FFFF000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00FFFFFF00FFFFFF008400000084848400FFFFFF00FFFFFF0000FF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400848484000000000000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 00000080800000808000000000000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF00000000 + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000FFFF00FFFFFF008484840084000000C6C6C600FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400848484000000000000FFFF0000FFFF0084848400000000000000 + 0000000000008484840084848400848484000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000808000000000000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000000000000FFFF + 0000FFFF0000FFFF000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00FFFFFF00FFFFFF0000FFFF0084848400840000008484840000FF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400848484000000000000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFF0000FFFF00008484840000000000FFFF + 0000FFFF00000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF008400000084848400FFFFFF00FFFFFF008400000084000000FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 840084848400848484000000000000FFFF0000FFFF0084848400000000000000 + 0000000000008484840084848400848484000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFF0000000000000000000000000000FFFF + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00840000008400000000FFFF00C6C6C600840000008400000000FF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 8400848484000000000000FFFF0000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00C6C6C60084000000840000008400000084000000C6C6C600FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000008484 + 84000000000000FFFF0000FFFF0000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C0C0C00000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FF000000FF000000FF00 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FF000000FF000000FF00 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000FFFF0000000000000000000000000000FFFF000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFF0000000000000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C600C6C6C600C6C6C600C6C6C60000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + 0000FFFF00000000000084848400FFFF0000FFFF000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFF0000FFFF00000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C600FF000000FF000000FF00000000000000FFFFFF00FF000000FF000000FF00 + 0000FFFFFF000000000000000000000000000000000000000000FFFF0000FFFF + 0000FFFF000000000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000000000000000000000000000000000000000000000000000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 000000000000000000000000000000000000000000008484000000000000C6C6 + C600C6C6C600C6C6C600C6C6C60000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFF0000FFFF0000FFFF + 000000000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF000000000000000000000000000000000000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000000000000000000000000000000000000000000000000000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000000000000000000000000000000000008484000000000000C6C6 + C600FF000000FF000000FF000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFF0000FFFF + 0000FFFF000000000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000000000000000000000000000000000000000000000000000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 000000000000000000000000000000000000000000008484000000000000C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C6000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + 0000FFFF00000000000084848400FFFF0000FFFF000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFF0000FFFF00000000 + 000000000000000000000000000000000000000000008484000000000000C6C6 + C600FF000000FF000000FF000000C6C6C6000000000000000000000000000000 + 0000000000000000000084000000000000000000000000000000000000000000 + 0000FFFF0000000000000000000000000000FFFF000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFF0000000000000000 + 000000000000000000000000000000000000000000008484000000000000C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C6000000000000000000000000000000 + 0000000000008400000084000000840000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084840000848400008484 + 0000848400008484000000000000000000000000000000000000840000000000 + 0000000000000000000084000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008400 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 8400848400008484840084840000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 8400848400008484840084840000000000000000000084840000000000000000 + 0000000000000000000000000000848400008484840000000000000000000000 + 0000000000000000000084848400000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 84008484000084848400848400000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084840000000000000000 + 0000000000000000000000000000848400008484840000000000000000000000 + 000000000000000000008484840000000000000000008484840000000000FFFF + FF00FFFFFF00FFFFFF0000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF000000000084840000000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 00008484840084840000848484000000000000000000FFFFFF00FFFFFF000000 + 000000000000FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF0000000000FFFFFF00FFFFFF0000000000000000008484840000000000FFFF + FF00FFFFFF00FFFFFF0000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF000000000084840000000000000000000084840000000000000000 + 000000000000FFFFFF0000000000848400008484840000000000000000000000 + 0000FFFFFF000000000084848400000000000000000084848400000000000000 + 0000000000008484840000000000000000000000000084840000000000000000 + 00000000000084848400848400000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000FFFFFF000000 + 000000000000000000008484840000000000000000008484840000000000FFFF + FF00FFFFFF00FFFFFF0000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF00000000008484000000000000000000008484000000000000FFFF + FF00000000008484000000000000FFFFFF00000000008484840000000000FFFF + FF000000000084840000848484000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084848400000000000000 + 000000000000FFFFFF0000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF000000000084840000000000000000000084840000000000000000 + 0000000000000000000000000000848400008484840000000000000000000000 + 000000000000000000008484840000000000000000008484840000000000FFFF + FF00000000008484840000000000FFFFFF00000000008484000000000000FFFF + FF000000000084848400848400000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000000000000000 + 0000FFFFFF000000000084848400000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 8400848400008484840084840000000000000000000084840000000000000000 + 0000000000008484000000000000000000000000000084840000000000000000 + 00000000000084840000848484000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000000000000000008484840000000000FFFF + FF00000000000000000000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF000000000084840000000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 0000848484008484000084848400000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 84008484000084848400848400000000000000000000FFFFFF0000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF0000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000FFFFFF000000 + 0000FFFFFF000000000084848400000000000000000084848400000000000000 + 0000000000000000000000000000848484008484000000000000000000000000 + 0000000000000000000084840000000000000000000084840000000000000000 + 0000000000008484000000000000000000000000000084840000000000000000 + 0000000000008484000084848400000000008484840000000000FF000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FF0000000000000084848400000000008484840000000000FFFF + FF0000000000FFFFFF0000000000848484008484000000000000FFFFFF00FFFF + FF00FFFFFF00000000008484000000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000FFFFFF00FFFF + FF00FFFFFF00000000008484840000000000000000008484840000000000FFFF + FF00000000008484840000000000FFFFFF00000000008484840000000000FFFF + FF000000000084848400848400000000000000000000FF000000FF0000000000 + 0000FFFFFF00FF000000000000000000000000000000FFFFFF00FF000000FFFF + FF0000000000FF000000FF00000000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000FFFFFF00FFFF + FF00FFFFFF000000000084848400000000000000000084848400000000000000 + 000000000000FFFFFF0000000000848484008484000000000000000000000000 + 0000FFFFFF00000000008484000000000000000000008484000000000000FFFF + FF00000000008484000000000000FFFFFF00000000008484000000000000FFFF + FF00000000008484000084848400000000008484840000000000FF000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FF00000000000000848484000000000084848400000000000000 + 0000000000000000000000000000848484008484000000000000000000000000 + 000000000000000000008484000000000000000000008484000000000000FFFF + FF00FFFFFF00FFFFFF0000000000848400008484840000000000FFFFFF00FFFF + FF00FFFFFF000000000084848400000000000000000084848400000000000000 + 0000000000008484840000000000000000000000000084848400000000000000 + 00000000000084848400848400000000000000000000FFFFFF0000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF00000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 0000848484008484000084848400000000000000000084848400000000000000 + 0000000000000000000000000000848484008484000000000000000000000000 + 0000000000000000000084840000000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 00008484840084840000848484000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 0000848484008484000084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084848400FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084848400848400008484 + 8400848400008484840084840000848484008484000084848400848400008484 + 840084840000848484008484000000000000000000000000000084848400FFFF + FF000000000000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF0000FFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084840000848484000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000848484008484000084848400000000000000000000000000848484000000 + 00008484840000000000FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00000000000000000084848400848400000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000008484840084840000000000000000000000000000000000008484 + 8400848484008484840000000000FFFFFF00FFFFFF0000FFFF0084848400FFFF + FF00FFFFFF0000FFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084840000848484000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000008484000084848400000000000000000000000000C6C6C600C6C6 + C600C6C6C600848484008484840000000000FFFFFF00FFFFFF00840000008484 + 8400FFFFFF00FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084848400848400000000 + 0000FFFFFF00840000008400000084000000840000008400000084000000FFFF + FF000000000084848400848400000000000000000000FFFFFF00C6C6C600C6C6 + C600C6C6C600C6C6C60084848400848484000000000000FFFF00840000008400 + 0000FFFFFF0000FFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084840000848484000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0000000000848400008484840000000000C6C6C600FFFFFF00FFFFFF00C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084000000840000008400 + 0000FFFFFF00FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF0000000000FFFFFF00FFFFFF00000000000000000084848400848400000000 + 0000FFFFFF0084000000840000008400000084000000FFFFFF00FFFFFF00FFFF + FF000000000084848400848400000000000000000000C6C6C600FFFFFF00FFFF + FF00C6C6C60000000000C6C6C600C6C6C6008484840084000000840000008400 + 0000FFFFFF0000FFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF0000000000FF00 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF00000000000000FFFFFF00000000000000000084840000848484000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000008484000084848400000000000000000000000000C6C6C600FFFF + FF00000000008400000000000000C6C6C6008400000084000000840000008484 + 8400FFFFFF00FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000FF000000FF00 + 000000000000FFFFFF0000000000FF000000FF00000000000000FFFFFF000000 + 0000FF000000FF00000000000000000000000000000084848400848400000000 + 0000FFFFFF00840000008400000084000000840000008400000084000000FFFF + FF0000000000848484008484000000000000000000000000000000000000C6C6 + C600FFFFFF0084000000C6C6C60084848400840000008400000084848400FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF0000000000FF00 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF00000000000000FFFFFF00000000000000000084840000848484000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000008484000084848400000000000000000000000000840000000000 + 0000C6C6C60084000000848484000000000084848400FFFFFF00FFFFFF000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF0000000000FFFFFF00FFFFFF00000000000000000084848400848400000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000848484008484000000000000000000000000000084000000C6C6 + C60000000000840000000000000084848400FFFFFF0000FFFF00FFFFFF008484 + 8400C6C6C60000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000084840000848484008484 + 0000848484008484000084848400848400008484840084840000848484008484 + 000084848400848400008484840000000000000000000000000084000000C6C6 + C600C6C6C600840000008484840000FFFF00FFFFFF00FFFFFF00FFFFFF008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484008400 + 0000840000008484840084848400848484008484840084848400848484008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084848400848484008484840000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400000000008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000008484840000000000000000000000000000000000C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C6000000000000000000000000000000000000000000C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C6000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484000000 + 00000000000000000000C6C6C600C6C6C600C6C6C60000000000000000000000 + 0000000000000000000084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C60000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C60000000000000000000000000000000000000000000000 + 000000000000FFFFFF008484840000000000FFFFFF0000000000000000000000 + 000000000000000000000000000000000000000000008484840000000000C6C6 + C600848484000000000000000000C6C6C600C6C6C6000000000084848400C6C6 + C6000000000000000000848484000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C60000FFFF0000FFFF0000FFFF00C6C6C600C6C6 + C6000000000000000000000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C60000FFFF0000FFFF0000FFFF00C6C6C600C6C6 + C600000000000000000000000000000000000000000084848400FFFFFF00FFFF + FF00FFFFFF00848484008484840000000000FFFFFF00FFFFFF00848484008484 + 840084848400848484000000000000000000000000000000000084848400C6C6 + C60084848400C6C6C600C6C6C6008484840000000000C6C6C600848484008484 + 84008484840084848400000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084848400C6C6C600C6C6 + C60000000000C6C6C600000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084848400C6C6C600C6C6 + C60000000000C6C6C60000000000000000000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000000000000000000000000000000000 + 0000C6C6C600C6C6C60000000000FFFFFF00FFFFFF0000000000C6C6C6000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C600C6C6C600000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C600C6C6C600000000000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000008484840000000000C6C6C6000000 + 0000C6C6C60000000000C6C6C600C6C6C600C6C6C600FFFFFF00848484000000 + 0000C6C6C600C6C6C600000000008484840000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C60000000000C6C6C6000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C60000000000C6C6C600000000000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000008484840000000000C6C6C600C6C6 + C600FFFFFF00000000008484840000000000C6C6C600FFFFFF0084848400C6C6 + C600C6C6C600C6C6C60000000000848484000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C60000000000C6C6C60000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C60000000000C6C6C60000000000000000000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000008484840000000000000000000000 + 0000FFFFFF00000000008484840084848400C6C6C60000000000C6C6C6000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000C6C6C60000000000C6C6C60000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000C6C6C60000000000C6C6C600848484000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000000000000000000000000000000000 + 0000C6C6C600FFFFFF00000000000000000000000000C6C6C600C6C6C6000000 + 0000000000008484840000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008484 + 0000FFFF0000FFFF0000FFFF0000000000000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00848484000000000000000000000000000000000084848400C6C6 + C60084848400C6C6C600FFFFFF00FFFFFF00C6C6C600C6C6C600848484008484 + 8400848484000000000084848400000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000084848400000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + 0000848400000000000000000000848484000000000084848400FFFFFF008484 + 840084848400848484008484840000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00848484000000000000000000000000008484840000000000C6C6 + C600848484000000000000000000C6C6C6000000000000000000C6C6C600C6C6 + C600000000008484840000000000000000000000000000000000000000000000 + 000000000000FFFFFF000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000FFFF00008484 + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000000000000000000000000000000000000000000084848400FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000848484000000 + 00008484840000000000C6C6C600C6C6C600C6C6C60000000000848484000000 + 0000848484000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000084848400000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + 0000848400000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400000000000000000000000000000000000000000084848400000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00848484008484 + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084848400848484008484840000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000900000000100010000000000800400000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFF18000FF07000F80008000 + FE03000F00008000FC01000F00008000FC01000F000080008001000F00008000 + 0001000F000080000001000F000080000003000F000080000007000F00008000 + 003F000200008000003F000000008000003F800000018000003FC00080078000 + 003FE000C0078000007FFF82E007FFFFFFFFC001E001FFFFFFFFC001C001000F + 8003C001C001000F8003C001C001000F8003C001C001000F8003C001C001000F + 8003C001C001000F8003C001C001000F8003C001C001000F8003C001C0010004 + 8003C001C0010000C1FEC001C0010000E3FEC001C001F800FFF5C003C001FC00 + FFF3C007C003FE04FFF1C00FFFFFFFFFFFFFFFFFFFFFFFFF00010001FFFFFFFF + 00010001FFF9001F00010001E7FF000F00010001C3F3000700010001C3E70003 + 00010001E1C7000100000001F08F000000000001F81F001F00010001FC3F001F + 00000001F81F001F00000003F09F8FF1808180FFC1C7FFF9C124C1FF83E3FF75 + FE66FFFF8FF1FF8FFFE7FFFFFFFFFFFFFFFFFFEFFDFFFFFFFFFFFFCFF9FFC001 + FFFFE007F1FF8031FDDFC003E1FF8031FCCF800300078031FC478003C03F8001 + 00038003C037800100018003C027800100008003C0008FF100018003C0008FF1 + 00038003C0008FF1FC478003C0278FF1FCCF8003C0378FF1FDDF8003C03F8FF1 + FFFF8003C03F8001FFFFC007FFFFFFFFFFFFFFFFFFFFFFFFFE03FFFFFFFFFFFF + FE03FFFFFFFFFFFFFE03FBBFFEFFFF7FFE03F33FFCFFFF3FC003E23FF8FFFF1F + C003C000F003C00F00038000E003C00700030000C003C00300038000E003C007 + 007FC000F003C00F007DE23FF8FFFF1F0078F33FFCFFFF3F007DFBBFFEFFFF7F + 01DDFFFFFFFFFFFF01E3FFFFFFFFFFFFFFFF8001FFFFFFFF8001000080018081 + 0000000000000080000000000000008000000000000000800000000000000100 + 0000000000000100000000000000018000000000000000800000000000000000 + 0000000000000100000000000000018000000000000000800000000000000080 + 8001000080018081FFFF8001FFFFFFFFFFFFFFFFFFFFFFFFC001800180018001 + C001000000000000C001000000000000C001000000000000C001000000000000 + 8001000000000000000100000000000000010000000000000001000000000000 + 8001000000000000C001000000000000C001000000000000C003000000000000 + C007800180018001C00FFFFFFFFFFFFFFC7FFFFFFFFFFFFFFC27C007C007FFFF + EC2380038003F83FC4010001000100018001000100010001C003000100010001 + E000000000000001000000000000000100008000800000010003C000C0000001 + E001E001E0000001C001E007800000018003F00780070101C407F00380008383 + EC3FF803F000FFFFFC7FFFFFF800FFFF00000000000000000000000000000000 + 000000000000} + end + object ilStub: TImageList + AllocBy = 2 + Left = 19 + Top = 107 + Bitmap = { + 494C010102000500040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000002000000001002000000000000020 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840084848400848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084848400000000000000000000000000000000008484 + 84000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000084848400FFFF0000FFFF00000000000000000000000000000000 + 00008484840000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 84000000000000000000FFFF0000000000000000000000000000000000000000 + 00000000000000000000848484000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFF000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 000000000000FFFFFF00000000000000000000000000FFFFFF00000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFF000000000000000000000000000000000000FFFFFF00FFFFFF000000 + 0000C6C6C600FFFFFF00C6C6C60000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFF000000000000000000000000000000000000FFFFFF00FFFFFF00C6C6 + C600000000000000000000000000C6C6C600FFFFFF00FFFFFF00000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 840000000000000000000000000000000000000000000000000000000000FFFF + 0000FFFF000000000000848484000000000000000000FFFFFF00FFFFFF00FFFF + FF00848484008484840084848400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000084848400000000000000000000000000FFFF0000FFFF0000FFFF + 00008484840000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084848400000000000000000000000000000000008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFF8000000000003FFF000000000000 + 1FFF0000000000008FFF000000000000C40F000000000000E1E7000000000000 + F0F3000000000000E5F9000000000000EBFD000000000000EFFD000000000000 + EFF5000000000000EFF5000000000000E7E1000000000000F383000000000000 + F9E7000000000000FC0F00010000000000000000000000000000000000000000 + 000000000000} + end + object pmPrintStyles: TPopupMenu + OnPopup = pmPrintStylesPopup + Left = 103 + Top = 56 + end + object pmDesigners: TPopupMenu + Left = 131 + Top = 56 + end + object Timer1: TTimer + Enabled = False + OnTimer = Timer1Timer + Left = 19 + Top = 159 + end + object pmExplorer: TPopupMenu + OnPopup = pmExplorerPopup + Left = 159 + Top = 56 + object pmiExplorerLoadData: TMenuItem + Caption = 'Load' + Default = True + ShortCut = 16397 + OnClick = FileLoadClick + end + object pmiExplorerUnloadData: TMenuItem + Caption = 'Unload' + ShortCut = 16499 + OnClick = FileCloseClick + end + object miLine33: TMenuItem + Caption = '-' + end + object pmiExplorerCreateFolder: TMenuItem + Caption = 'New Folder' + ShortCut = 32821 + OnClick = ExplorerCreateNewFolderClick + end + object miLine34: TMenuItem + Caption = '-' + end + object pmiExplorerDelete: TMenuItem + Caption = '&Delete...' + ShortCut = 46 + OnClick = ExplorerDeleteClick + end + object pmiExplorerRename: TMenuItem + Caption = '&Rename' + ShortCut = 113 + OnClick = ExplorerRenameClick + end + object miLine40: TMenuItem + Caption = '-' + end + object pmiExplorerProperties: TMenuItem + Caption = '&Properties...' + ShortCut = 32781 + OnClick = ExplorerPropertiesClick + end + end + object pmThumbnails: TPopupMenu + OnPopup = pmThumbnailsPopup + Left = 187 + Top = 56 + object pmiSmallThumbnails: TMenuItem + Caption = '&Small Thumbnails' + Checked = True + GroupIndex = 1 + RadioItem = True + OnClick = pmiThumbnailsSizeClick + end + object pmiLargeThumbnails: TMenuItem + Tag = 1 + Caption = '&Large Thumbnails' + GroupIndex = 1 + RadioItem = True + OnClick = pmiThumbnailsSizeClick + end + end +end diff --git a/official/x.35/Lib/D11/dxPSPrvw.dcu b/official/x.35/Lib/D11/dxPSPrvw.dcu new file mode 100644 index 00000000..14f9515f Binary files /dev/null and b/official/x.35/Lib/D11/dxPSPrvw.dcu differ diff --git a/official/x.35/Lib/D11/dxPSRELnk.dcu b/official/x.35/Lib/D11/dxPSRELnk.dcu new file mode 100644 index 00000000..ee366eac Binary files /dev/null and b/official/x.35/Lib/D11/dxPSRELnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPSReg.dcu b/official/x.35/Lib/D11/dxPSReg.dcu new file mode 100644 index 00000000..22e7a0c4 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSReg.dcu differ diff --git a/official/x.35/Lib/D11/dxPSRes.dcu b/official/x.35/Lib/D11/dxPSRes.dcu new file mode 100644 index 00000000..3226b9c9 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSRes.dcu differ diff --git a/official/x.35/Lib/D11/dxPSShapes.dcu b/official/x.35/Lib/D11/dxPSShapes.dcu new file mode 100644 index 00000000..ff7ef860 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSShapes.dcu differ diff --git a/official/x.35/Lib/D11/dxPSSngltn.dcu b/official/x.35/Lib/D11/dxPSSngltn.dcu new file mode 100644 index 00000000..6eb7ed03 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSSngltn.dcu differ diff --git a/official/x.35/Lib/D11/dxPSStandardFillPatterns.dcu b/official/x.35/Lib/D11/dxPSStandardFillPatterns.dcu new file mode 100644 index 00000000..8c45ebd2 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSStandardFillPatterns.dcu differ diff --git a/official/x.35/Lib/D11/dxPSStdGrLnk.dcu b/official/x.35/Lib/D11/dxPSStdGrLnk.dcu new file mode 100644 index 00000000..94311c1d Binary files /dev/null and b/official/x.35/Lib/D11/dxPSStdGrLnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPSStdGrLnk.dfm b/official/x.35/Lib/D11/dxPSStdGrLnk.dfm new file mode 100644 index 00000000..941f8bbf --- /dev/null +++ b/official/x.35/Lib/D11/dxPSStdGrLnk.dfm @@ -0,0 +1,676 @@ +object dxGridReportLinkDesignWindow: TdxGridReportLinkDesignWindow + Left = 346 + Top = 298 + BorderStyle = bsDialog + Caption = 'dxGridReportLinkDesigner' + ClientHeight = 314 + ClientWidth = 579 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 6 + Width = 571 + Height = 273 + ActivePage = tshColor + MultiLine = True + TabOrder = 0 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = '&Options' + object pnlOptions: TPanel + Left = 0 + Top = 0 + Width = 563 + Height = 245 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblShow: TLabel + Left = 5 + Top = 13 + Width = 26 + Height = 13 + Caption = 'Show' + end + object Bevel11: TBevel + Left = 40 + Top = 18 + Width = 210 + Height = 4 + Shape = bsBottomLine + end + object imgGrid: TImage + Left = 6 + Top = 32 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblOnEveryPage: TLabel + Left = 8 + Top = 151 + Width = 72 + Height = 13 + Caption = 'On Every Page' + end + object Image1: TImage + Left = 10 + Top = 172 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888777777777777777708888888888 + 888887FFFFFFFFFFFFFFF08888888888888887F7777777777777F07777708888 + 888887F7777777777777F0FFFFF08888888887F7777777777777F07777F07777 + 708887FFFFFFFFFFFFFFF07777F0FFFFF08887F777777777777FF07777F07777 + F08887FFFFFFFFFFFFFFF0FFFFF07777F08887F77777777777FFF077FFF07777 + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777777FFFFF0777FF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777FFFFFFFF07FFFF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF0777FF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF077FFF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777777F077FFF077FF + F08887F7777777777777F0FFFFF0FFFFF08887F7777777777777F0FFFFF07FFF + F08887FFFFFFFFFFFFFFF07777F0FFFFF0888000000000000000007777F077FF + F08888888887F7777777777777F0FFFFF08888888887FFFFFFFFFFFFFFF07777 + F0888888888000000000000000007777F08888888888888887F7777777777777 + F08888888888888887FFFFFFFFFFFFFFF0888888888888888000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object Bevel10: TBevel + Left = 88 + Top = 156 + Width = 162 + Height = 4 + Shape = bsBottomLine + end + object chbxShowVertLines: TCheckBox + Tag = 2 + Left = 90 + Top = 75 + Width = 161 + Height = 17 + Caption = 'Vertical Lines' + TabOrder = 2 + OnClick = chbxShowBordersClick + end + object chbxShowFixedHorzLines: TCheckBox + Tag = 3 + Left = 90 + Top = 98 + Width = 161 + Height = 17 + Caption = 'Fixed &Horizontal Lines' + TabOrder = 3 + OnClick = chbxShowBordersClick + end + object chbxShowFixedVertLines: TCheckBox + Tag = 4 + Left = 90 + Top = 121 + Width = 161 + Height = 17 + Caption = 'Fixed &Vertical Lines' + TabOrder = 4 + OnClick = chbxShowBordersClick + end + object chbxShowBorders: TCheckBox + Left = 90 + Top = 30 + Width = 161 + Height = 17 + Caption = 'Border' + TabOrder = 0 + OnClick = chbxShowBordersClick + end + object chbxShowHorzLines: TCheckBox + Tag = 1 + Left = 90 + Top = 52 + Width = 161 + Height = 17 + Caption = 'Horizontal Lines' + TabOrder = 1 + OnClick = chbxShowBordersClick + end + object chbxFixedRowsOnEveryPage: TCheckBox + Left = 91 + Top = 173 + Width = 161 + Height = 17 + Caption = 'Fi&xed Rows' + TabOrder = 5 + OnClick = chbxFixedRowsOnEveryPageClick + end + object lblPreview: TStaticText + Left = 264 + Top = 2 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 6 + end + end + end + object tshColor: TTabSheet + Caption = '&Color' + object pnlColor: TPanel + Left = 0 + Top = 0 + Width = 563 + Height = 245 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblGridLinesColor: TLabel + Left = 6 + Top = 218 + Width = 79 + Height = 13 + Caption = '&Grid lines color : ' + OnClick = lblColorClick + end + object bvlLineColorHolder: TBevel + Left = 91 + Top = 214 + Width = 146 + Height = 21 + Visible = False + end + object lblDrawMode: TLabel + Left = 5 + Top = 21 + Width = 58 + Height = 13 + Caption = 'Draw &Mode:' + FocusControl = cbxDrawMode + OnClick = lblColorClick + end + object gbxFixedTransparent: TGroupBox + Left = 5 + Top = 144 + Width = 243 + Height = 58 + Caption = ' ' + TabOrder = 4 + object lblFixedColor: TLabel + Left = 6 + Top = 24 + Width = 62 + Height = 13 + Caption = 'F&ixed color : ' + OnClick = lblColorClick + end + object bvlFixedColorHolder: TBevel + Left = 86 + Top = 22 + Width = 146 + Height = 21 + Visible = False + end + end + object gbxTransparent: TGroupBox + Left = 5 + Top = 52 + Width = 243 + Height = 84 + Caption = ' ' + TabOrder = 2 + object lblColor: TLabel + Left = 6 + Top = 24 + Width = 35 + Height = 13 + Caption = 'Co&lor : ' + OnClick = lblColorClick + end + object bvlColorHolder: TBevel + Left = 86 + Top = 20 + Width = 146 + Height = 21 + Visible = False + end + object lblEvenColor: TLabel + Left = 6 + Top = 51 + Width = 59 + Height = 13 + Caption = 'E&ven Color: ' + OnClick = lblColorClick + end + object bvlEvenColorHolder: TBevel + Left = 86 + Top = 47 + Width = 146 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 18 + Top = 50 + Width = 15 + Height = 17 + Caption = 'T&ransparent' + TabOrder = 1 + OnClick = chbxTransparentClick + end + object chbxFixedTransparent: TCheckBox + Tag = 1 + Left = 18 + Top = 142 + Width = 15 + Height = 17 + Caption = 'Fixed T&ransparent' + TabOrder = 3 + OnClick = chbxTransparentClick + end + object cbxDrawMode: TComboBox + Left = 69 + Top = 16 + Width = 179 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 0 + OnClick = cbxDrawModeClick + OnDrawItem = cbxDrawModeDrawItem + Items.Strings = ( + 'Simpe' + 'Odd\Even Rows Mode' + 'Chess' + 'Borrow From Source') + end + object stTransparent: TStaticText + Left = 33 + Top = 51 + Width = 76 + Height = 17 + Caption = ' &Transparent ' + FocusControl = chbxTransparent + TabOrder = 5 + OnClick = stTransparentClick + end + object stFixedTransparent: TStaticText + Left = 33 + Top = 143 + Width = 105 + Height = 17 + Caption = ' Fixed T&ransparent ' + FocusControl = chbxFixedTransparent + TabOrder = 6 + OnClick = stFixedTransparentClick + end + end + end + object tshFont: TTabSheet + Caption = '&Font' + object pnlFont: TPanel + Left = 0 + Top = 0 + Width = 563 + Height = 245 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object btnFont: TButton + Left = 8 + Top = 9 + Width = 110 + Height = 23 + Caption = 'Fo&nt ...' + TabOrder = 0 + OnClick = btnFontClick + end + object edFont: TEdit + Left = 8 + Top = 38 + Width = 239 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + end + object btnFixedFont: TButton + Tag = 2 + Left = 8 + Top = 133 + Width = 110 + Height = 23 + Caption = 'Fi&xed Font ...' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 4 + OnClick = btnFontClick + end + object edFixedFont: TEdit + Left = 8 + Top = 162 + Width = 239 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 5 + end + object btnEvenFont: TButton + Tag = 1 + Left = 7 + Top = 71 + Width = 110 + Height = 23 + Caption = 'E&ven Font ...' + TabOrder = 2 + OnClick = btnFontClick + end + object edEvenFont: TEdit + Left = 8 + Top = 100 + Width = 239 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 3 + end + end + end + object tshBehaviors: TTabSheet + Caption = '&Behaviors' + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 563 + Height = 245 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Image3: TImage + Left = 7 + Top = 34 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblSelection: TLabel + Left = 5 + Top = 13 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object Bevel3: TBevel + Left = 55 + Top = 18 + Width = 195 + Height = 4 + Shape = bsBottomLine + end + object lblLookAndFeel: TLabel + Left = 5 + Top = 85 + Width = 67 + Height = 13 + Caption = 'Look And Feel' + end + object Bevel15: TBevel + Left = 84 + Top = 89 + Width = 166 + Height = 4 + Shape = bsBottomLine + end + object Image8: TImage + Left = 7 + Top = 106 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D08777777777780877777788807DCCCCDCCDDD0877777777778787777788 + 8F07D08888888888880888888888807DCCCCCCCCDD0888888888888788888888 + 8F07D00000000000000000000000007DCCCCDCCDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F7777777FF07DDDDDDDDDDD0F777777777FF7F7777777 + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F777777FFF07DDDDDDDDDDD0F777777FFFFF7F777777F + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F7777777777F7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F77777FFFF07DDDDDDDDDDD0F77777777FFF7F77777FF + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D00000000000000000000000007DCDDDDCDDDD0000000000000000000000 + 0007D08888888888880888888888807DCCCCDCCDDD0777777777777777777777 + 7707D08888888888880888888888807DCCCCCCCCDD0F88888888888788888888 + 8707D08000000008880880000000807DCCCCDCCDDD0F00000000888788000000 + 8707D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + F707D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object bvlMiscellaneous: TBevel + Left = 81 + Top = 160 + Width = 169 + Height = 3 + Shape = bsBottomLine + end + object lblMiscellaneous: TLabel + Left = 5 + Top = 154 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + end + object imgMiscellaneous: TImage + Left = 7 + Top = 177 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000008088F07DDDDDDDDDDDD0800000000000000000000 + 807DD0F0FFFF8FFFF8FFFF0FFF0F07DDDDDDDDDDDD0F0F77FFF8F777F8F777F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCDDDDCDDDD0F0F00FFF8F00FF8F00FF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCCCCCDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCDDDDCDDDD0F0FFFFFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCCCCDCCDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCCCCCDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCDCCDDD0F0FFFFFF8F0FFF8F0FFF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0777777777777770FFF0F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F0F8887F8887F8880FFF8F07DDDDDDDDDDDD0F0F888887F88887F88880 + F07DD0F0F0087F0087F0080FFF0F07DDDDDDDDDDDD0F0F800087F80087F80080 + F07DD0F0FFFF7FFFF7FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF7FFFFF7FFFFF0 + F07DD0800000000000000008080807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxIncludeFixed: TCheckBox + Left = 90 + Top = 52 + Width = 161 + Height = 17 + Caption = '&Including fixed cells' + TabOrder = 1 + OnClick = chbxIncludeFixedClick + end + object chbxOnlySelected: TCheckBox + Left = 90 + Top = 30 + Width = 161 + Height = 17 + Caption = 'Only &selected cells' + TabOrder = 0 + OnClick = chbxOnlySelectedClick + end + object chbxUse3DEffects: TCheckBox + Tag = 12 + Left = 91 + Top = 100 + Width = 161 + Height = 17 + Caption = '&Use 3D Effects' + TabOrder = 2 + OnClick = chbxUse3DEffectsClick + end + object chbxUseSoft3D: TCheckBox + Tag = 13 + Left = 91 + Top = 122 + Width = 161 + Height = 17 + Caption = 'Soft &3D' + TabOrder = 3 + OnClick = chbxUseSoft3DClick + end + object chbxRowAutoHeight: TCheckBox + Left = 90 + Top = 200 + Width = 161 + Height = 17 + Caption = '&Row Auto Height' + TabOrder = 5 + OnClick = chbxRowAutoHeightClick + end + object chbxAutoWidth: TCheckBox + Left = 90 + Top = 178 + Width = 161 + Height = 17 + Caption = 'AutoWidth' + TabOrder = 4 + OnClick = chbxAutoWidthClick + end + end + end + end + object pnlPreview: TPanel + Left = 272 + Top = 50 + Width = 294 + Height = 215 + BevelInner = bvLowered + BevelOuter = bvNone + Color = clWindow + TabOrder = 1 + end +end diff --git a/official/x.35/Lib/D11/dxPSTCLnk.dcu b/official/x.35/Lib/D11/dxPSTCLnk.dcu new file mode 100644 index 00000000..37bbf54b Binary files /dev/null and b/official/x.35/Lib/D11/dxPSTCLnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPSTCLnkReg.dcu b/official/x.35/Lib/D11/dxPSTCLnkReg.dcu new file mode 100644 index 00000000..2fdc7889 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSTCLnkReg.dcu differ diff --git a/official/x.35/Lib/D11/dxPSTVLnk.dcu b/official/x.35/Lib/D11/dxPSTVLnk.dcu new file mode 100644 index 00000000..0eeee0fa Binary files /dev/null and b/official/x.35/Lib/D11/dxPSTVLnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPSTVLnk.dfm b/official/x.35/Lib/D11/dxPSTVLnk.dfm new file mode 100644 index 00000000..4772d4e0 --- /dev/null +++ b/official/x.35/Lib/D11/dxPSTVLnk.dfm @@ -0,0 +1,930 @@ +object dxfmTVReportLinkDesignWindow: TdxfmTVReportLinkDesignWindow + Left = 370 + Top = 405 + ActiveControl = chbxTransparent + BorderStyle = bsDialog + Caption = 'dxfmTVReportLinkDesignWindow' + ClientHeight = 279 + ClientWidth = 582 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 4 + Width = 574 + Height = 240 + ActivePage = tshColors + Anchors = [akLeft, akTop, akRight, akBottom] + MultiLine = True + TabOrder = 0 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = '&Options' + object pnlOptions: TPanel + Left = 0 + Top = 0 + Width = 566 + Height = 212 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblShow: TLabel + Left = 6 + Top = 12 + Width = 26 + Height = 13 + Caption = 'Show' + end + object Bevel11: TBevel + Left = 41 + Top = 17 + Width = 207 + Height = 4 + Shape = bsBottomLine + end + object imgGrid: TImage + Left = 6 + Top = 36 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object Bevel2: TBevel + Left = 63 + Top = 80 + Width = 185 + Height = 4 + Shape = bsBottomLine + end + object Bevel3: TBevel + Left = 63 + Top = 147 + Width = 185 + Height = 4 + Shape = bsBottomLine + end + object chbxShowBorders: TCheckBox + Left = 63 + Top = 30 + Width = 113 + Height = 17 + Caption = '&Border' + TabOrder = 0 + OnClick = chbxShowClick + end + object chbxShowGrid: TCheckBox + Tag = 1 + Left = 63 + Top = 51 + Width = 113 + Height = 17 + Caption = '&Grid' + TabOrder = 1 + OnClick = chbxShowClick + end + object chbxShowStateImages: TCheckBox + Tag = 2 + Left = 63 + Top = 163 + Width = 113 + Height = 17 + Caption = 'State Images' + TabOrder = 4 + OnClick = chbxShowClick + end + object chbxShowImages: TCheckBox + Tag = 3 + Left = 63 + Top = 184 + Width = 113 + Height = 17 + Caption = 'Images' + TabOrder = 5 + OnClick = chbxShowClick + end + object chbxShowTreeLines: TCheckBox + Tag = 4 + Left = 63 + Top = 98 + Width = 113 + Height = 17 + Caption = 'TreeLines' + TabOrder = 2 + OnClick = chbxShowClick + end + object chbxShowButtons: TCheckBox + Tag = 5 + Left = 63 + Top = 119 + Width = 113 + Height = 17 + Caption = 'Buttons' + TabOrder = 3 + OnClick = chbxShowClick + end + object lblPreview: TStaticText + Left = 264 + Top = 2 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 6 + end + end + end + object tshColors: TTabSheet + Caption = '&Color' + object pnlColor: TPanel + Left = 0 + Top = 0 + Width = 566 + Height = 212 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblGridLinesColor: TLabel + Left = 10 + Top = 88 + Width = 81 + Height = 13 + Caption = '&Grid Lines Color: ' + OnClick = lblColorClick + end + object bvlGridLineColorHost: TBevel + Left = 91 + Top = 84 + Width = 150 + Height = 21 + Visible = False + end + object bvlTreeLineColorHost: TBevel + Left = 91 + Top = 114 + Width = 150 + Height = 21 + end + object lblTreeLinesColor: TLabel + Left = 10 + Top = 118 + Width = 78 + Height = 13 + Caption = 'TreeLines Color:' + end + object gbxTransparent: TGroupBox + Left = 5 + Top = 13 + Width = 247 + Height = 59 + Caption = ' ' + TabOrder = 1 + object lblColor: TLabel + Left = 6 + Top = 24 + Width = 32 + Height = 13 + Caption = 'Co&lor: ' + OnClick = lblColorClick + end + object bvlColorHost: TBevel + Left = 86 + Top = 20 + Width = 150 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 18 + Top = 11 + Width = 15 + Height = 17 + TabOrder = 0 + OnClick = chbxTransparentClick + end + object stTransparent: TStaticText + Left = 33 + Top = 12 + Width = 76 + Height = 17 + Caption = ' &Transparent ' + FocusControl = chbxTransparent + TabOrder = 2 + OnClick = stTransparentClick + end + end + end + object tshFonts: TTabSheet + Caption = '&Font' + object pnlFont: TPanel + Left = 0 + Top = 0 + Width = 566 + Height = 212 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object btnFont: TButton + Left = 8 + Top = 16 + Width = 110 + Height = 23 + Caption = 'Fo&nt ...' + TabOrder = 0 + OnClick = btnFontClick + end + object edFont: TEdit + Left = 8 + Top = 47 + Width = 235 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + Text = 'edFont' + end + end + end + object tshBehaviors: TTabSheet + Caption = '&Behaviors' + object pnlBehaviors: TPanel + Left = 0 + Top = 0 + Width = 566 + Height = 212 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblExpanding: TLabel + Left = 5 + Top = 12 + Width = 50 + Height = 13 + Caption = 'Expanding' + end + object Bevel13: TBevel + Left = 65 + Top = 17 + Width = 173 + Height = 4 + Shape = bsBottomLine + end + object bvlExpandLevelHolder: TBevel + Left = 163 + Top = 61 + Width = 69 + Height = 21 + Visible = False + end + object lblExpandLevel: TLabel + Left = 89 + Top = 65 + Width = 71 + Height = 13 + Caption = 'Expand &level : ' + OnClick = lblExpandLevelClick + end + object Image4: TImage + Left = 7 + Top = 40 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 7778800000000000000000000000078888888888880000000000000000000000 + 007880FFF7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7FF777777FFF77777FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F8F7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7F7F8888FF7F88888FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F8F7777777777777777777078888888888880F7F7F888FFF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F0788077777777777777777777770788C8888C88880F7FF888888FFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880F0F7777777FFFFFFFFFFFF0788CCCCCCCC880F77777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7F7F8888FF7F88888FF7 + F0788077777777777777777777770788C8888C88880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F7F7F8888FF7F888888F7 + F0788077777777777777777777770788CCCC8CC8880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCCCCCC880F7FF88888FFFFFFFFFFF7 + F07880F0F777777FFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F77777777777777777777 + F078800000000000000000000000078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F888888880F88888888888078888888888880F77777777777777777777 + F07880F877778880F87777777778078888888888880F77777777777777777777 + F07880FFFFFFFFF0FFFFFFFFFFFF078888888888880FFFFFFFFFFFFFFFFFFFFF + F078800000000000000000000000088888888888880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object Bevel1: TBevel + Left = 81 + Top = 99 + Width = 157 + Height = 4 + Shape = bsBottomLine + end + object lblMiscellaneous: TLabel + Left = 6 + Top = 94 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + end + object Image5: TImage + Left = 7 + Top = 121 + Width = 32 + Height = 32 + Picture.Data = { + 055449636F6E0000010003001010000000000000680500003600000020200000 + 00000000A80800009E0500003030000000000000A80E0000460E000028000000 + 1000000020000000010008000000000040010000000000000000000000010000 + 00000000FFFFFF00000080000080800080800000C0C0C000C0DCC000F0CAA600 + 4080800040400000FF800000804000000040800080FFFF00FFFF8000FF808000 + 4080FF0081818100000081000081810081810000000033000000660000009900 + 0000CC0000333300003366000033FF000066CC000066FF000099FF0000CCCC00 + 3300330033006600330099003300CC0033330000333333003333660033339900 + 3333CC003333FF00336666003366990074CAFF003366FF003399000033993300 + 33996600339999003399CC003399FF0033CC330033CC990033CCCC0033CCFF00 + 33FFFF0066000000663300006633330066336600663399006633FF0066660000 + 6666330066666600666699006666CC0066990000669933006699660066999900 + 6699CC006699FF0066CC330066CC990066CCCC004CCEFF0066FF330066FFCC00 + 999900009933990099333300996600009966330099336600996699009966CC00 + 9999330099996600999999009999CC009999FF0099CC000099CC330066CC6600 + 99CC990099CCCC0099CCFF0099CC660099FF990099FFFF00CC009900CC333300 + CC336600CC339900CC660000CC66330099666600CC669900CC66CC00CC990000 + CC993300CC996600CC999900CC99CC00CC99FF00CCCC0000CCCC3300CCCC6600 + CCCC9900CCCCCC00CCCCFF00CCFF0000CCFF330099FF6600CCFF9900CCFFCC00 + CCFFFF00FF333300FF336600FF660000FF663300CC666600FF669900FF66CC00 + FF990000FF993300FF996600FF999900FF99CC00FF99FF00FFCC0000FFCC3300 + FFCC6600FFCC9900FFCCCC00FFCCFF00FFFF3300FFFF9900FFFFCC006666FF00 + 66FFFF00FFFF6600C1C1C1005F5F5F00777777008686860096969600CBCBCB00 + B2B2B200D7D7D700DDDDDD00E3E3E300EAEAEA00F1F1F100F8F8F800F0FBFF00 + A4A0A000808080000000FF0000FF0000FF00FF00FFFF00007AE9FF007D780000 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 00000000FFFFFFFFFFFFFFFF9B40FFFFFFFFFFFFFFFFFFFF9B9AFFFF4747FFFF + 9C40FFFFFF242424A7309A6B36369A9C3607FFFFFF789C9C4B36313636363636 + 36FFFFFFFFA2A09A9A4736364B290736079A9AFFFFA2A04B363636614B022936 + 363636FFFFA2A0A0613536644B02293624FFFFFFFFA2409F463636644B022936 + 0724FFFFFFA2409F0061780C4B02294636FFFFFFFFA2404040A078640C4B2924 + FFFFFFFFFFA2A0A0A0A09F9F4A789B24FFFFFFFFFFA2409F00A0787878789B24 + FFFFFFFFFFA2409F00A09F9F9F789B24FFFFFFFFFFA2404040A0787878789B24 + FFFFFFFFFFA2A0A0A0A0A0A0A0A09B24FFFFFFFFFFA2A2A2A2A2A2A2A2A2A29A + FFFFFFFFFF3FFFFFF333FFFF8003FFFF8007FFFF8001FFFF8001FFFF8007FFFF + 8003FFFF8007FFFF800FFFFF800FFFFF800FFFFF800FFFFF800FFFFF800FFFFF + 800FFFFF28000000200000004000000001000800000000008004000000000000 + 000000000001000000000000FFFFFF00000080000080800080800000C0C0C000 + C0DCC000F0CAA6004080800040400000FF800000804000000040800080FFFF00 + FFFF8000FF8080004080FF008181810000008100008181008181000000003300 + 00006600000099000000CC0000333300003366000033FF000066CC000066FF00 + 0099FF0000CCCC003300330033006600330099003300CC003333000033333300 + 33336600333399003333CC003333FF00336666003366990074CAFF003366FF00 + 339900003399330033996600339999003399CC003399FF0033CC330033CC9900 + 33CCCC0033CCFF0033FFFF006600000066330000663333006633660066339900 + 6633FF00666600006666330066666600666699006666CC006699000066993300 + 66996600669999006699CC006699FF0066CC330066CC990066CCCC004CCEFF00 + 66FF330066FFCC00999900009933990099333300996600009966330099336600 + 996699009966CC009999330099996600999999009999CC009999FF0099CC0000 + 99CC330066CC660099CC990099CCCC0099CCFF0099CC660099FF990099FFFF00 + CC009900CC333300CC336600CC339900CC660000CC66330099666600CC669900 + CC66CC00CC990000CC993300CC996600CC999900CC99CC00CC99FF00CCCC0000 + CCCC3300CCCC6600CCCC9900CCCCCC00CCCCFF00CCFF0000CCFF330099FF6600 + CCFF9900CCFFCC00CCFFFF00FF333300FF336600FF660000FF663300CC666600 + FF669900FF66CC00FF990000FF993300FF996600FF999900FF99CC00FF99FF00 + FFCC0000FFCC3300FFCC6600FFCC9900FFCCCC00FFCCFF00FFFF3300FFFF9900 + FFFFCC006666FF0066FFFF00FFFF6600C1C1C1005F5F5F007777770086868600 + 96969600CBCBCB00B2B2B200D7D7D700DDDDDD00E3E3E300EAEAEA00F1F1F100 + F8F8F800F0FBFF00A4A0A000808080000000FF0000FF0000FF00FF00FFFF0000 + 7AE9FF007D7800007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F0000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF409C40 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9B9AFFFFFF9B469B + FFFFFF9B4040FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D9B9A9AFFFF473647 + FFFF9B9D9B9A9AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D079A409A9B473647 + 9A9A9BA707079AFFFFFFFFFFFFFFFFFFFFFF24242424244B363107409B343647 + 9A404631353646FFFFFFFFFFFFFFFFFFFFFF789C9C9C9C4B3636363636363636 + 3636363635FFFFFFFFFFFFFFFFFFFFFFFFFFA1A09C409A9A4736363661616161 + 4C363635409A9AFFFFFFFFFFFFFFFFFFFFFFA1A040409A404636364C4B460229 + 4C363635409A9A9AFFFFFFFFFFFFFFFFFFFFA1A04C47303031364C644C4B3002 + 074C363636363635FFFFFFFFFFFFFFFFFFFFA1A0A061363636364C644C4B3002 + 29313636074747FFFFFFFFFFFFFFFFFFFFFFA140A1A3A007303636644C4B3002 + 2936362924FFFFFFFFFFFFFFFFFFFFFFFFFFA1409FA20430353636644C4B3002 + 293636302924FFFFFFFFFFFFFFFFFFFFFFFFA1409F00A261364C60644C4B3002 + 294C35363607FFFFFFFFFFFFFFFFFFFFFFFFA1409F0000A16104A0644C4B3002 + 299A476135FFFFFFFFFFFFFFFFFFFFFFFFFFA1404040404004A0A06461644B30 + 079A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0A0A0A0A0A078640C644B + 469A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0A0A0A0A0A078A04A4A4A + A09A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA140A1A2A1A1A2A0A07878787878 + 789A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1409F04A700A2A0A09F9F9F9F9F + 789A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1409FA7009DA2A0A07878787878 + 789A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1409FA0A0A0A2A0A09F9F9F9F9F + 789A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA140404040409CA0A07878787878 + 789A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0A0A0A0A0A0A0A0A0A0A0 + A09A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA2A2A2A2A2A2A2A2A2A2A2A2A2A2 + A2A19AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8FFFFFF38E3F + FFE18C1FFFE0001FFC00001FFC00007FFC00001FFC00000FFC00000FFC00001F + FC00007FFC00003FFC00003FFC00007FFC0001FFFC0001FFFC0001FFFC0001FF + FC0001FFFC0001FFFC0001FFFC0001FFFC0001FFFC0001FFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFF2800000030000000600000000100080000000000 + 800A000000000000000000000001000000000000FFFFFF000000800000808000 + 80800000C0C0C000C0DCC000F0CAA6004080800040400000FF80000080400000 + 0040800080FFFF00FFFF8000FF8080004080FF00818181000000810000818100 + 818100000000330000006600000099000000CC0000333300003366000033FF00 + 0066CC000066FF000099FF0000CCCC003300330033006600330099003300CC00 + 333300003333330033336600333399003333CC003333FF003366660033669900 + 74CAFF003366FF00339900003399330033996600339999003399CC003399FF00 + 33CC330033CC990033CCCC0033CCFF0033FFFF00660000006633000066333300 + 66336600663399006633FF00666600006666330066666600666699006666CC00 + 669900006699330066996600669999006699CC006699FF0066CC330066CC9900 + 66CCCC004CCEFF0066FF330066FFCC0099990000993399009933330099660000 + 9966330099336600996699009966CC009999330099996600999999009999CC00 + 9999FF0099CC000099CC330066CC660099CC990099CCCC0099CCFF0099CC6600 + 99FF990099FFFF00CC009900CC333300CC336600CC339900CC660000CC663300 + 99666600CC669900CC66CC00CC990000CC993300CC996600CC999900CC99CC00 + CC99FF00CCCC0000CCCC3300CCCC6600CCCC9900CCCCCC00CCCCFF00CCFF0000 + CCFF330099FF6600CCFF9900CCFFCC00CCFFFF00FF333300FF336600FF660000 + FF663300CC666600FF669900FF66CC00FF990000FF993300FF996600FF999900 + FF99CC00FF99FF00FFCC0000FFCC3300FFCC6600FFCC9900FFCCCC00FFCCFF00 + FFFF3300FFFF9900FFFFCC006666FF0066FFFF00FFFF6600C1C1C1005F5F5F00 + 777777008686860096969600CBCBCB00B2B2B200D7D7D700DDDDDD00E3E3E300 + EAEAEA00F1F1F100F8F8F800F0FBFF00A4A0A000808080000000FF0000FF0000 + FF00FF00FFFF00007AE9FF007D7800007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F0000000000FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF409B9B + 40FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFF9B9B9B9BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9C9B9AFFFFFFFF9B4646 + 9BFFFFFFFF9B4040FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFA79D9B9A9AFFFFFF47363647FFFFFF9B9D9B409AFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA79D079A9A9A409B473636 + 479A9A9B9D9D07079AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF24 + 2424242424A73636309A9A409B463636479A9A9B9D46353607FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF789C9C9C9C9C4B36363631400746353636 + 479A9A073536363546FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0A0A0A79D9D4C36363636363636363636363636363635FFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A09C409A9A9A473636363661616161 + 614C36363635409A9A9AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0789B409A9A9A46363636614C460202294C363636359A9A9A9A9AFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A047463030303136364C614B4B3030 + 02074C3636363030303030FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0A04C4C3636363636364C644C4B30300229313636363636363636FFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0616161616136364C0C4C4B3030 + 02293636363607474747FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A09BA3A3A3A00730363636974C4B303002293636362924FFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A09B9FA2A2040707363636974C4B3030 + 0229363636302424FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A09B9F000078303636364C0C4C4B303002294C4C36360724FFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A09B9F0000A24C364C60780C4C4B3030 + 02299B4736363607FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A09B9F000000A16178A0780C4C4B303002299B24476135FFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A09B9B9B9B9B9B04A0A078644C64604B + 30299B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0A0A0A0A0A0A0A0A0A078647F0C4C4E4B079B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0A0A0A0A0A0A0A07805640C0C4B + 4B469B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0A0A0A0A0A0A0A0A0A07878784A4A4A4A789B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A040A2A2A2A2A2A2A0A0787878787878 + 78789B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0409F009D00A1A2A0A078787878787878789B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0409F9D789DA1A2A0A09F9F9F9F9F9F + 9F789B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0409F00009DA1A2A0A078787878787878789B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0409FA0A0A0A0A2A0A09F9F9F9F9F9F + 9F789B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A04040404040409CA0A078787878787878789B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0A0A0A0A0A0A0A0787878787878 + 78789B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A09B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2 + A2A2A29AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF87FFFFFFFFFFFFFF87FFFFFFFFFFFFC787 + 8FFFFFFFFFFF838707FFFFFFFFFF800007FFFFFFFFE0000007FFFFFFFFE00000 + 07FFFFFFFFE000001FFFFFFFFFE0000003FFFFFFFFE0000001FFFFFFFFE00000 + 01FFFFFFFFE0000001FFFFFFFFE0000003FFFFFFFFE000001FFFFFFFFFE00000 + 0FFFFFFFFFE000000FFFFFFFFFE000000FFFFFFFFFE000001FFFFFFFFFE00000 + FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000 + FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000 + FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + end + object chbxAutoNodesExpand: TCheckBox + Left = 88 + Top = 37 + Width = 154 + Height = 17 + Caption = '&Auto Node Expanded' + TabOrder = 0 + OnClick = chbxAutoNodesExpandClick + end + object chbxNodeAutoHeight: TCheckBox + Left = 88 + Top = 140 + Width = 111 + Height = 17 + Caption = '&Node Auto Height' + TabOrder = 1 + OnClick = chbxNodeAutoHeightClick + end + object chbxAutoWidth: TCheckBox + Left = 88 + Top = 117 + Width = 97 + Height = 17 + Caption = 'Auto &Width' + TabOrder = 2 + OnClick = chbxAutoWidthClick + end + end + end + end + object pnlPreview: TPanel + Left = 272 + Top = 46 + Width = 295 + Height = 185 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + end + object ilPreview: TImageList + Left = 5 + Top = 247 + Bitmap = { + 494C010102000500040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000002000000001002000000000000020 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000084000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008484840000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000840000008400000084000000FF000000840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000848484008484840084848400C6C6C60084848400000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000084 + 000000840000FFFFFF0000FF0000FFFFFF0000FF000000840000008400000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 840084848400FFFFFF00C6C6C600FFFFFF00C6C6C60084848400848484000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 0000FFFFFF0000FF0000FFFFFF0000FF000000FF000000840000008400000084 + 000000000000000000000000000000000000000000000000000084848400C6C6 + C600FFFFFF00C6C6C600FFFFFF00C6C6C600C6C6C60084848400848484008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF0000FF0000FFFFFF0000FF0000FFFFFF0000FF000000840000008400000084 + 000000840000000000000000000000000000000000000000000084848400FFFF + FF00C6C6C600FFFFFF00C6C6C600FFFFFF00C6C6C60084848400848484008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 0000FFFFFF00FFFFFF0000FF000000FF000000FF000000840000008400000084 + 000000840000000000000000000000000000000000000000000084848400C6C6 + C600FFFFFF00FFFFFF00C6C6C600C6C6C600C6C6C60084848400848484008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF0000FF000000FF000000FF000000FF000000FF000000FF0000008400000084 + 000000840000000000000000000000000000000000000000000084848400FFFF + FF00C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600848484008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF00000084 + 000000840000000000000000000000000000000000000000000084848400C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF00000084 + 000000840000000000000000000000000000000000000000000084848400C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000084 + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF + 0000008400000084000000000000000000000000000000000000000000008484 + 8400C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6 + C600848484008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000084000000FF000000FF000000FF000000FF000000FF0000008400000084 + 0000000000000000000000000000000000000000000000000000000000000000 + 000084848400C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600848484008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000084000000FF000000FF00000084000000840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000084848400C6C6C600C6C6C6008484840084848400000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000840000008400000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084848400848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFF00000000FFFFFFFF00000000 + FF3FFF3F00000000F81FF81F00000000E00FE00F00000000C007C00700000000 + C003C00300000000C003C00300000000C003C00300000000C003C00300000000 + C003C00300000000E003E00300000000F00FF00F00000000F83FF83F00000000 + FCFFFCFF00000000FFFFFFFF0000000000000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxPSTeeChartD11.bpl b/official/x.35/Lib/D11/dxPSTeeChartD11.bpl new file mode 100644 index 00000000..08380c6e Binary files /dev/null and b/official/x.35/Lib/D11/dxPSTeeChartD11.bpl differ diff --git a/official/x.35/Lib/D11/dxPSTeeChartD11.dcp b/official/x.35/Lib/D11/dxPSTeeChartD11.dcp new file mode 100644 index 00000000..23d03ceb Binary files /dev/null and b/official/x.35/Lib/D11/dxPSTeeChartD11.dcp differ diff --git a/official/x.35/Lib/D11/dxPSTeeChartD11.dcu b/official/x.35/Lib/D11/dxPSTeeChartD11.dcu new file mode 100644 index 00000000..29ae1e7b Binary files /dev/null and b/official/x.35/Lib/D11/dxPSTeeChartD11.dcu differ diff --git a/official/x.35/Lib/D11/dxPSTextLnk.dcu b/official/x.35/Lib/D11/dxPSTextLnk.dcu new file mode 100644 index 00000000..9bac2474 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSTextLnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPSTextLnk.dfm b/official/x.35/Lib/D11/dxPSTextLnk.dfm new file mode 100644 index 00000000..7cc72ae2 --- /dev/null +++ b/official/x.35/Lib/D11/dxPSTextLnk.dfm @@ -0,0 +1,528 @@ +object dxfmTextReportLinkDesignWindow: TdxfmTextReportLinkDesignWindow + Left = 480 + Top = 279 + BorderStyle = bsDialog + Caption = 'dxfmTextReportLinkDesignWindow' + ClientHeight = 285 + ClientWidth = 580 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 7 + Width = 572 + Height = 243 + ActivePage = tshOptions + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + object tshOptions: TTabSheet + Caption = 'Options' + object lblLineSpacing: TLabel + Left = 9 + Top = 65 + Width = 63 + Height = 13 + Caption = '&Line Spacing:' + end + object lblAlignment: TLabel + Left = 9 + Top = 28 + Width = 51 + Height = 13 + Caption = '&Alignment:' + FocusControl = cbxAlignment + end + object bvlLineSpacingSite: TBevel + Left = 100 + Top = 60 + Width = 140 + Height = 21 + Visible = False + end + object Bevel2: TBevel + Left = 319 + Top = 8 + Width = 236 + Height = 4 + Shape = bsBottomLine + end + object lblPreview: TLabel + Left = 267 + Top = 3 + Width = 38 + Height = 13 + Caption = 'Preview' + end + object Bevel1: TBevel + Left = 10 + Top = 99 + Width = 231 + Height = 4 + Shape = bsBottomLine + end + object pnlPreview: TPanel + Left = 267 + Top = 23 + Width = 290 + Height = 183 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvLowered + Color = clWindow + TabOrder = 0 + object pbxPreview: TPaintBox + Left = 1 + Top = 1 + Width = 288 + Height = 181 + Align = alClient + OnPaint = pbxPreviewPaint + end + end + object btnFont: TButton + Left = 9 + Top = 123 + Width = 110 + Height = 23 + Caption = 'Fo&nt ...' + TabOrder = 2 + OnClick = btnFontClick + end + object edFont: TEdit + Left = 9 + Top = 151 + Width = 231 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 3 + end + object cbxAlignment: TComboBox + Left = 100 + Top = 23 + Width = 140 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 1 + OnClick = cbxAlignmentClick + OnDrawItem = cbxAlignmentDrawItem + end + end + end + object ilAlignments: TImageList + Left = 13 + Top = 254 + Bitmap = { + 494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFF003FC00FF0030003FFFFFFFFFFFFFFFF0003000300030003 + FFFFFFFFFFFFFFFF003FC00FF0030003FFFFFFFFFFFFFFFF0003000300030003 + FFFFFFFFFFFFFFFF003FC00FF0030003FFFFFFFFFFFFFFFF0003000300030003 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxPSTextOut.dcu b/official/x.35/Lib/D11/dxPSTextOut.dcu new file mode 100644 index 00000000..be93d231 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSTextOut.dcu differ diff --git a/official/x.35/Lib/D11/dxPSUtl.dcu b/official/x.35/Lib/D11/dxPSUtl.dcu new file mode 100644 index 00000000..4f2d2424 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSUtl.dcu differ diff --git a/official/x.35/Lib/D11/dxPSXplorerTreeView.dcu b/official/x.35/Lib/D11/dxPSXplorerTreeView.dcu new file mode 100644 index 00000000..bc689a70 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSXplorerTreeView.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxCheckListBoxLnk.dcu b/official/x.35/Lib/D11/dxPScxCheckListBoxLnk.dcu new file mode 100644 index 00000000..2a9ebbe6 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxCheckListBoxLnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxCheckListBoxLnk.dfm b/official/x.35/Lib/D11/dxPScxCheckListBoxLnk.dfm new file mode 100644 index 00000000..8779f266 --- /dev/null +++ b/official/x.35/Lib/D11/dxPScxCheckListBoxLnk.dfm @@ -0,0 +1,558 @@ +object cxfmCheckListBoxDesignWindow: TcxfmCheckListBoxDesignWindow + Left = 393 + Top = 324 + BorderStyle = bsDialog + Caption = 'cxfmCheckListBoxDesignWindow' + ClientHeight = 243 + ClientWidth = 553 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 3 + Width = 545 + Height = 204 + ActivePage = tshColor + MultiLine = True + TabOrder = 0 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = '&Options' + object pnlOptions: TPanel + Left = 0 + Top = 0 + Width = 537 + Height = 176 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblShow: TLabel + Left = 6 + Top = 13 + Width = 26 + Height = 13 + Caption = 'Show' + end + object Bevel11: TBevel + Left = 41 + Top = 17 + Width = 207 + Height = 4 + Shape = bsBottomLine + end + object lblMiscellaneous: TLabel + Left = 6 + Top = 82 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + end + object Bevel4: TBevel + Left = 79 + Top = 86 + Width = 170 + Height = 4 + Shape = bsBottomLine + end + object Image5: TImage + Left = 10 + Top = 107 + Width = 32 + Height = 32 + Picture.Data = { + 055449636F6E0000010003001010000000000000680500003600000020200000 + 00000000A80800009E0500003030000000000000A80E0000460E000028000000 + 1000000020000000010008000000000040010000000000000000000000010000 + 00000000FFFFFF00000080000080800080800000C0C0C000C0DCC000F0CAA600 + 4080800040400000FF800000804000000040800080FFFF00FFFF8000FF808000 + 4080FF0081818100000081000081810081810000000033000000660000009900 + 0000CC0000333300003366000033FF000066CC000066FF000099FF0000CCCC00 + 3300330033006600330099003300CC0033330000333333003333660033339900 + 3333CC003333FF00336666003366990074CAFF003366FF003399000033993300 + 33996600339999003399CC003399FF0033CC330033CC990033CCCC0033CCFF00 + 33FFFF0066000000663300006633330066336600663399006633FF0066660000 + 6666330066666600666699006666CC0066990000669933006699660066999900 + 6699CC006699FF0066CC330066CC990066CCCC004CCEFF0066FF330066FFCC00 + 999900009933990099333300996600009966330099336600996699009966CC00 + 9999330099996600999999009999CC009999FF0099CC000099CC330066CC6600 + 99CC990099CCCC0099CCFF0099CC660099FF990099FFFF00CC009900CC333300 + CC336600CC339900CC660000CC66330099666600CC669900CC66CC00CC990000 + CC993300CC996600CC999900CC99CC00CC99FF00CCCC0000CCCC3300CCCC6600 + CCCC9900CCCCCC00CCCCFF00CCFF0000CCFF330099FF6600CCFF9900CCFFCC00 + CCFFFF00FF333300FF336600FF660000FF663300CC666600FF669900FF66CC00 + FF990000FF993300FF996600FF999900FF99CC00FF99FF00FFCC0000FFCC3300 + FFCC6600FFCC9900FFCCCC00FFCCFF00FFFF3300FFFF9900FFFFCC006666FF00 + 66FFFF00FFFF6600C1C1C1005F5F5F00777777008686860096969600CBCBCB00 + B2B2B200D7D7D700DDDDDD00E3E3E300EAEAEA00F1F1F100F8F8F800F0FBFF00 + A4A0A000808080000000FF0000FF0000FF00FF00FFFF00007AE9FF007D780000 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 00000000FFFFFFFFFFFFFFFF9B40FFFFFFFFFFFFFFFFFFFF9B9AFFFF4747FFFF + 9C40FFFFFF242424A7309A6B36369A9C3607FFFFFF789C9C4B36313636363636 + 36FFFFFFFFA2A09A9A4736364B290736079A9AFFFFA2A04B363636614B022936 + 363636FFFFA2A0A0613536644B02293624FFFFFFFFA2409F463636644B022936 + 0724FFFFFFA2409F0061780C4B02294636FFFFFFFFA2404040A078640C4B2924 + FFFFFFFFFFA2A0A0A0A09F9F4A789B24FFFFFFFFFFA2409F00A0787878789B24 + FFFFFFFFFFA2409F00A09F9F9F789B24FFFFFFFFFFA2404040A0787878789B24 + FFFFFFFFFFA2A0A0A0A0A0A0A0A09B24FFFFFFFFFFA2A2A2A2A2A2A2A2A2A29A + FFFFFFFFFF3FFFFFF333FFFF8003FFFF8007FFFF8001FFFF8001FFFF8007FFFF + 8003FFFF8007FFFF800FFFFF800FFFFF800FFFFF800FFFFF800FFFFF800FFFFF + 800FFFFF28000000200000004000000001000800000000008004000000000000 + 000000000001000000000000FFFFFF00000080000080800080800000C0C0C000 + C0DCC000F0CAA6004080800040400000FF800000804000000040800080FFFF00 + FFFF8000FF8080004080FF008181810000008100008181008181000000003300 + 00006600000099000000CC0000333300003366000033FF000066CC000066FF00 + 0099FF0000CCCC003300330033006600330099003300CC003333000033333300 + 33336600333399003333CC003333FF00336666003366990074CAFF003366FF00 + 339900003399330033996600339999003399CC003399FF0033CC330033CC9900 + 33CCCC0033CCFF0033FFFF006600000066330000663333006633660066339900 + 6633FF00666600006666330066666600666699006666CC006699000066993300 + 66996600669999006699CC006699FF0066CC330066CC990066CCCC004CCEFF00 + 66FF330066FFCC00999900009933990099333300996600009966330099336600 + 996699009966CC009999330099996600999999009999CC009999FF0099CC0000 + 99CC330066CC660099CC990099CCCC0099CCFF0099CC660099FF990099FFFF00 + CC009900CC333300CC336600CC339900CC660000CC66330099666600CC669900 + CC66CC00CC990000CC993300CC996600CC999900CC99CC00CC99FF00CCCC0000 + CCCC3300CCCC6600CCCC9900CCCCCC00CCCCFF00CCFF0000CCFF330099FF6600 + CCFF9900CCFFCC00CCFFFF00FF333300FF336600FF660000FF663300CC666600 + FF669900FF66CC00FF990000FF993300FF996600FF999900FF99CC00FF99FF00 + FFCC0000FFCC3300FFCC6600FFCC9900FFCCCC00FFCCFF00FFFF3300FFFF9900 + FFFFCC006666FF0066FFFF00FFFF6600C1C1C1005F5F5F007777770086868600 + 96969600CBCBCB00B2B2B200D7D7D700DDDDDD00E3E3E300EAEAEA00F1F1F100 + F8F8F800F0FBFF00A4A0A000808080000000FF0000FF0000FF00FF00FFFF0000 + 7AE9FF007D7800007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F0000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF409C40 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9B9AFFFFFF9B469B + FFFFFF9B4040FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D9B9A9AFFFF473647 + FFFF9B9D9B9A9AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D079A409A9B473647 + 9A9A9BA707079AFFFFFFFFFFFFFFFFFFFFFF24242424244B363107409B343647 + 9A404631353646FFFFFFFFFFFFFFFFFFFFFF789C9C9C9C4B3636363636363636 + 3636363635FFFFFFFFFFFFFFFFFFFFFFFFFFA1A09C409A9A4736363661616161 + 4C363635409A9AFFFFFFFFFFFFFFFFFFFFFFA1A040409A404636364C4B460229 + 4C363635409A9A9AFFFFFFFFFFFFFFFFFFFFA1A04C47303031364C644C4B3002 + 074C363636363635FFFFFFFFFFFFFFFFFFFFA1A0A061363636364C644C4B3002 + 29313636074747FFFFFFFFFFFFFFFFFFFFFFA140A1A3A007303636644C4B3002 + 2936362924FFFFFFFFFFFFFFFFFFFFFFFFFFA1409FA20430353636644C4B3002 + 293636302924FFFFFFFFFFFFFFFFFFFFFFFFA1409F00A261364C60644C4B3002 + 294C35363607FFFFFFFFFFFFFFFFFFFFFFFFA1409F0000A16104A0644C4B3002 + 299A476135FFFFFFFFFFFFFFFFFFFFFFFFFFA1404040404004A0A06461644B30 + 079A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0A0A0A0A0A078640C644B + 469A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0A0A0A0A0A078A04A4A4A + A09A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA140A1A2A1A1A2A0A07878787878 + 789A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1409F04A700A2A0A09F9F9F9F9F + 789A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1409FA7009DA2A0A07878787878 + 789A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1409FA0A0A0A2A0A09F9F9F9F9F + 789A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA140404040409CA0A07878787878 + 789A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0A0A0A0A0A0A0A0A0A0A0 + A09A24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA2A2A2A2A2A2A2A2A2A2A2A2A2A2 + A2A19AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8FFFFFF38E3F + FFE18C1FFFE0001FFC00001FFC00007FFC00001FFC00000FFC00000FFC00001F + FC00007FFC00003FFC00003FFC00007FFC0001FFFC0001FFFC0001FFFC0001FF + FC0001FFFC0001FFFC0001FFFC0001FFFC0001FFFC0001FFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFF2800000030000000600000000100080000000000 + 800A000000000000000000000001000000000000FFFFFF000000800000808000 + 80800000C0C0C000C0DCC000F0CAA6004080800040400000FF80000080400000 + 0040800080FFFF00FFFF8000FF8080004080FF00818181000000810000818100 + 818100000000330000006600000099000000CC0000333300003366000033FF00 + 0066CC000066FF000099FF0000CCCC003300330033006600330099003300CC00 + 333300003333330033336600333399003333CC003333FF003366660033669900 + 74CAFF003366FF00339900003399330033996600339999003399CC003399FF00 + 33CC330033CC990033CCCC0033CCFF0033FFFF00660000006633000066333300 + 66336600663399006633FF00666600006666330066666600666699006666CC00 + 669900006699330066996600669999006699CC006699FF0066CC330066CC9900 + 66CCCC004CCEFF0066FF330066FFCC0099990000993399009933330099660000 + 9966330099336600996699009966CC009999330099996600999999009999CC00 + 9999FF0099CC000099CC330066CC660099CC990099CCCC0099CCFF0099CC6600 + 99FF990099FFFF00CC009900CC333300CC336600CC339900CC660000CC663300 + 99666600CC669900CC66CC00CC990000CC993300CC996600CC999900CC99CC00 + CC99FF00CCCC0000CCCC3300CCCC6600CCCC9900CCCCCC00CCCCFF00CCFF0000 + CCFF330099FF6600CCFF9900CCFFCC00CCFFFF00FF333300FF336600FF660000 + FF663300CC666600FF669900FF66CC00FF990000FF993300FF996600FF999900 + FF99CC00FF99FF00FFCC0000FFCC3300FFCC6600FFCC9900FFCCCC00FFCCFF00 + FFFF3300FFFF9900FFFFCC006666FF0066FFFF00FFFF6600C1C1C1005F5F5F00 + 777777008686860096969600CBCBCB00B2B2B200D7D7D700DDDDDD00E3E3E300 + EAEAEA00F1F1F100F8F8F800F0FBFF00A4A0A000808080000000FF0000FF0000 + FF00FF00FFFF00007AE9FF007D7800007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F007F7F7F00 + 7F7F7F007F7F7F007F7F7F007F7F7F0000000000FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF409B9B + 40FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFF9B9B9B9BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9C9B9AFFFFFFFF9B4646 + 9BFFFFFFFF9B4040FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFA79D9B9A9AFFFFFF47363647FFFFFF9B9D9B409AFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA79D079A9A9A409B473636 + 479A9A9B9D9D07079AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF24 + 2424242424A73636309A9A409B463636479A9A9B9D46353607FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF789C9C9C9C9C4B36363631400746353636 + 479A9A073536363546FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0A0A0A79D9D4C36363636363636363636363636363635FFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A09C409A9A9A473636363661616161 + 614C36363635409A9A9AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0789B409A9A9A46363636614C460202294C363636359A9A9A9A9AFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A047463030303136364C614B4B3030 + 02074C3636363030303030FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0A04C4C3636363636364C644C4B30300229313636363636363636FFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0616161616136364C0C4C4B3030 + 02293636363607474747FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A09BA3A3A3A00730363636974C4B303002293636362924FFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A09B9FA2A2040707363636974C4B3030 + 0229363636302424FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A09B9F000078303636364C0C4C4B303002294C4C36360724FFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A09B9F0000A24C364C60780C4C4B3030 + 02299B4736363607FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A09B9F000000A16178A0780C4C4B303002299B24476135FFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A09B9B9B9B9B9B04A0A078644C64604B + 30299B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0A0A0A0A0A0A0A0A0A078647F0C4C4E4B079B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0A0A0A0A0A0A0A07805640C0C4B + 4B469B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0A0A0A0A0A0A0A0A0A07878784A4A4A4A789B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A040A2A2A2A2A2A2A0A0787878787878 + 78789B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0409F009D00A1A2A0A078787878787878789B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0409F9D789DA1A2A0A09F9F9F9F9F9F + 9F789B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0409F00009DA1A2A0A078787878787878789B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0409FA0A0A0A0A2A0A09F9F9F9F9F9F + 9F789B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A04040404040409CA0A078787878787878789B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1A0A0A0A0A0A0A0A0A0A0787878787878 + 78789B24FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 + A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A09B24FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2 + A2A2A29AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF87FFFFFFFFFFFFFF87FFFFFFFFFFFFC787 + 8FFFFFFFFFFF838707FFFFFFFFFF800007FFFFFFFFE0000007FFFFFFFFE00000 + 07FFFFFFFFE000001FFFFFFFFFE0000003FFFFFFFFE0000001FFFFFFFFE00000 + 01FFFFFFFFE0000001FFFFFFFFE0000003FFFFFFFFE000001FFFFFFFFFE00000 + 0FFFFFFFFFE000000FFFFFFFFFE000000FFFFFFFFFE000001FFFFFFFFFE00000 + FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000 + FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000 + FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000FFFFFFFFFFE00000 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + end + object imgGrid: TImage + Left = 10 + Top = 33 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object chbxShowBorders: TCheckBox + Left = 95 + Top = 30 + Width = 147 + Height = 17 + Caption = 'Border' + TabOrder = 0 + OnClick = chbxOptionsClick + end + object chbxShowHorzLines: TCheckBox + Tag = 1 + Left = 95 + Top = 52 + Width = 147 + Height = 17 + Caption = 'Horizontal Lines' + TabOrder = 1 + OnClick = chbxOptionsClick + end + object chbxFlatCheckMarks: TCheckBox + Tag = 2 + Left = 95 + Top = 104 + Width = 147 + Height = 17 + Caption = 'Flat Check &Marks' + TabOrder = 2 + OnClick = chbxOptionsClick + end + object chbxRowAutoHeight: TCheckBox + Left = 95 + Top = 150 + Width = 147 + Height = 17 + Caption = '&Row Auto Height' + TabOrder = 4 + OnClick = chbxRowAutoHeightClick + end + object lblPreview: TStaticText + Left = 258 + Top = 2 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 5 + end + object chbxAutoWidth: TCheckBox + Left = 95 + Top = 127 + Width = 147 + Height = 17 + Caption = 'AutoWidth' + TabOrder = 3 + OnClick = chbxAutoWidthClick + end + end + end + object tshColor: TTabSheet + Caption = '&Color' + object pnlColor: TPanel + Left = 0 + Top = 0 + Width = 537 + Height = 176 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblGridLinesColor: TLabel + Left = 14 + Top = 143 + Width = 81 + Height = 13 + Caption = 'Grid Lines Color: ' + end + object bvlLineColorHolder: TBevel + Left = 98 + Top = 140 + Width = 126 + Height = 21 + Visible = False + end + object lblDrawMode: TLabel + Left = 6 + Top = 18 + Width = 58 + Height = 13 + Caption = 'Draw &Mode:' + FocusControl = cbxDrawMode + end + object gbxTransparent: TGroupBox + Left = 6 + Top = 47 + Width = 230 + Height = 82 + Caption = ' ' + TabOrder = 2 + object lblColor: TLabel + Left = 9 + Top = 24 + Width = 35 + Height = 13 + Caption = 'Co&lor : ' + end + object bvlColorHolder: TBevel + Left = 92 + Top = 20 + Width = 126 + Height = 21 + Visible = False + end + object lblEvenColor: TLabel + Left = 9 + Top = 52 + Width = 59 + Height = 13 + Caption = 'E&ven Color: ' + end + object bvlEvenColorHolder: TBevel + Left = 92 + Top = 48 + Width = 126 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 19 + Top = 45 + Width = 15 + Height = 17 + TabOrder = 1 + OnClick = chbxTransparentClick + end + object cbxDrawMode: TComboBox + Left = 77 + Top = 13 + Width = 159 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 0 + OnClick = cbxDrawModeClick + OnDrawItem = cbxDrawModeDrawItem + Items.Strings = ( + 'Simpe' + 'Odd\Even Rows Mode' + 'Chess' + 'Borrow From Source') + end + object stTransparent: TStaticText + Left = 33 + Top = 46 + Width = 76 + Height = 17 + Caption = ' &Transparent ' + FocusControl = chbxTransparent + TabOrder = 3 + OnClick = stTransparentClick + end + end + end + object tshFont: TTabSheet + Caption = '&Font' + object pnlFont: TPanel + Left = 0 + Top = 0 + Width = 537 + Height = 176 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object btnFont: TButton + Left = 8 + Top = 11 + Width = 110 + Height = 23 + Caption = 'Fo&nt ...' + TabOrder = 0 + OnClick = btnFontClick + end + object edFont: TEdit + Left = 8 + Top = 39 + Width = 230 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + Text = 'edFont' + end + object btnEvenFont: TButton + Tag = 1 + Left = 9 + Top = 71 + Width = 110 + Height = 23 + Caption = 'E&ven Font ...' + TabOrder = 2 + OnClick = btnFontClick + end + object edEvenFont: TEdit + Left = 9 + Top = 100 + Width = 230 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 3 + Text = 'edFont' + end + end + end + end + object pnlPreview: TPanel + Left = 265 + Top = 46 + Width = 273 + Height = 150 + BevelOuter = bvLowered + BorderWidth = 1 + Color = clWindow + TabOrder = 1 + end +end diff --git a/official/x.35/Lib/D11/dxPScxCommon.dcu b/official/x.35/Lib/D11/dxPScxCommon.dcu new file mode 100644 index 00000000..5b6904cb Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxCommon.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxCommonD11.bpl b/official/x.35/Lib/D11/dxPScxCommonD11.bpl new file mode 100644 index 00000000..8bf98f54 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxCommonD11.bpl differ diff --git a/official/x.35/Lib/D11/dxPScxCommonD11.dcp b/official/x.35/Lib/D11/dxPScxCommonD11.dcp new file mode 100644 index 00000000..25984742 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxCommonD11.dcp differ diff --git a/official/x.35/Lib/D11/dxPScxCommonD11.dcu b/official/x.35/Lib/D11/dxPScxCommonD11.dcu new file mode 100644 index 00000000..97b9d211 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxCommonD11.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxCommonReg.dcu b/official/x.35/Lib/D11/dxPScxCommonReg.dcu new file mode 100644 index 00000000..f77ec052 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxCommonReg.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxDBEditorLnkReg.dcu b/official/x.35/Lib/D11/dxPScxDBEditorLnkReg.dcu new file mode 100644 index 00000000..e88389bc Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxDBEditorLnkReg.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxDBEditorLnks.dcu b/official/x.35/Lib/D11/dxPScxDBEditorLnks.dcu new file mode 100644 index 00000000..e68479e9 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxDBEditorLnks.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxEditorLnkReg.dcu b/official/x.35/Lib/D11/dxPScxEditorLnkReg.dcu new file mode 100644 index 00000000..437d4d14 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxEditorLnkReg.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxEditorLnks.dcu b/official/x.35/Lib/D11/dxPScxEditorLnks.dcu new file mode 100644 index 00000000..1df27749 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxEditorLnks.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxEditorProducers.dcu b/official/x.35/Lib/D11/dxPScxEditorProducers.dcu new file mode 100644 index 00000000..16a660ed Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxEditorProducers.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxExtComCtrlsLnk.dcu b/official/x.35/Lib/D11/dxPScxExtComCtrlsLnk.dcu new file mode 100644 index 00000000..6f8fd79a Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxExtComCtrlsLnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxExtCommon.dcu b/official/x.35/Lib/D11/dxPScxExtCommon.dcu new file mode 100644 index 00000000..017c92bb Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxExtCommon.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxExtCommonD11.bpl b/official/x.35/Lib/D11/dxPScxExtCommonD11.bpl new file mode 100644 index 00000000..b2578a87 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxExtCommonD11.bpl differ diff --git a/official/x.35/Lib/D11/dxPScxExtCommonD11.dcp b/official/x.35/Lib/D11/dxPScxExtCommonD11.dcp new file mode 100644 index 00000000..280bc9a0 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxExtCommonD11.dcp differ diff --git a/official/x.35/Lib/D11/dxPScxExtCommonD11.dcu b/official/x.35/Lib/D11/dxPScxExtCommonD11.dcu new file mode 100644 index 00000000..58aed958 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxExtCommonD11.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxExtDBEditorLnkReg.dcu b/official/x.35/Lib/D11/dxPScxExtDBEditorLnkReg.dcu new file mode 100644 index 00000000..fa856328 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxExtDBEditorLnkReg.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxExtDBEditorLnks.dcu b/official/x.35/Lib/D11/dxPScxExtDBEditorLnks.dcu new file mode 100644 index 00000000..ad81744e Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxExtDBEditorLnks.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxExtEditorLnkReg.dcu b/official/x.35/Lib/D11/dxPScxExtEditorLnkReg.dcu new file mode 100644 index 00000000..a2aea123 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxExtEditorLnkReg.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxExtEditorProducers.dcu b/official/x.35/Lib/D11/dxPScxExtEditorProducers.dcu new file mode 100644 index 00000000..51ac641d Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxExtEditorProducers.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxGrid4Lnk.dfm b/official/x.35/Lib/D11/dxPScxGrid4Lnk.dfm new file mode 100644 index 00000000..9d2f79b9 --- /dev/null +++ b/official/x.35/Lib/D11/dxPScxGrid4Lnk.dfm @@ -0,0 +1,2090 @@ +object dxfmGridReportLinkDesignWindow: TdxfmGridReportLinkDesignWindow + Left = 463 + Top = 133 + BorderStyle = bsDialog + Caption = 'fmdxGridDesignWindow' + ClientHeight = 437 + ClientWidth = 648 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 4 + Width = 642 + Height = 399 + ActivePage = tshFormatting + TabOrder = 0 + OnChange = PageControl1Change + object tshView: TTabSheet + Caption = 'View' + object lblShow: TLabel + Left = 5 + Top = 8 + Width = 26 + Height = 13 + Caption = 'Show' + end + object imgShow: TImage + Left = 9 + Top = 37 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlShow: TBevel + Left = 43 + Top = 12 + Width = 266 + Height = 4 + Shape = bsBottomLine + end + object lblOnEveryPage: TLabel + Left = 5 + Top = 164 + Width = 72 + Height = 13 + Caption = 'On Every Page' + end + object imgOnEveryPage: TImage + Left = 9 + Top = 189 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888777777777777777708888888888 + 888887FFFFFFFFFFFFFFF08888888888888887F7777777777777F07777708888 + 888887F7777777777777F0FFFFF08888888887F7777777777777F07777F07777 + 708887FFFFFFFFFFFFFFF07777F0FFFFF08887F777777777777FF07777F07777 + F08887FFFFFFFFFFFFFFF0FFFFF07777F08887F77777777777FFF077FFF07777 + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777777FFFFF0777FF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777FFFFFFFF07FFFF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF0777FF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF077FFF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777777F077FFF077FF + F08887F7777777777777F0FFFFF0FFFFF08887F7777777777777F0FFFFF07FFF + F08887FFFFFFFFFFFFFFF07777F0FFFFF0888000000000000000007777F077FF + F08888888887F7777777777777F0FFFFF08888888887FFFFFFFFFFFFFFF07777 + F0888888888000000000000000007777F08888888888888887F7777777777777 + F08888888888888887FFFFFFFFFFFFFFF0888888888888888000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlOnEveryPage: TBevel + Left = 90 + Top = 168 + Width = 221 + Height = 4 + Shape = bsBottomLine + end + object bvlWarningHost: TBevel + Left = 4 + Top = 289 + Width = 313 + Height = 77 + Visible = False + end + object chbxShowBands: TCheckBox + Tag = 1 + Left = 90 + Top = 42 + Width = 200 + Height = 17 + Caption = 'Ba&nds' + TabOrder = 1 + OnClick = OptionsViewClick + end + object chbxShowHeaders: TCheckBox + Tag = 2 + Left = 90 + Top = 63 + Width = 200 + Height = 17 + Caption = '&Headers' + TabOrder = 2 + OnClick = OptionsViewClick + end + object chbxShowFooters: TCheckBox + Tag = 3 + Left = 90 + Top = 84 + Width = 200 + Height = 17 + Caption = 'Foo&ters' + TabOrder = 3 + OnClick = OptionsViewClick + end + object chbxShowGroupFooters: TCheckBox + Tag = 4 + Left = 90 + Top = 104 + Width = 200 + Height = 17 + Caption = 'G&roup Footers' + TabOrder = 4 + OnClick = OptionsViewClick + end + object chbxShowExpandButtons: TCheckBox + Tag = 5 + Left = 90 + Top = 125 + Width = 200 + Height = 17 + Caption = 'Expand Buttons' + TabOrder = 5 + OnClick = OptionsViewClick + end + object chbxBandsOnEveryPage: TCheckBox + Tag = 1 + Left = 90 + Top = 202 + Width = 200 + Height = 17 + Caption = 'Ba&nds' + TabOrder = 8 + OnClick = OptionsOnEveryPageClick + end + object chbxHeadersOnEveryPage: TCheckBox + Tag = 2 + Left = 90 + Top = 223 + Width = 200 + Height = 17 + Caption = 'Headers' + TabOrder = 9 + OnClick = OptionsOnEveryPageClick + end + object chbxFootersOnEveryPage: TCheckBox + Tag = 3 + Left = 90 + Top = 245 + Width = 200 + Height = 17 + Caption = 'Footers' + TabOrder = 10 + OnClick = OptionsOnEveryPageClick + end + object chbxFilterBarOnEveryPage: TCheckBox + Tag = 4 + Left = 90 + Top = 266 + Width = 200 + Height = 17 + Caption = 'FilterBar' + TabOrder = 11 + OnClick = OptionsOnEveryPageClick + end + object chbxCaptionsOnEveryPage: TCheckBox + Left = 90 + Top = 181 + Width = 200 + Height = 17 + Caption = 'Captions' + TabOrder = 7 + OnClick = OptionsOnEveryPageClick + end + object chbxShowCaptions: TCheckBox + Left = 90 + Top = 22 + Width = 200 + Height = 17 + Caption = 'Captions' + TabOrder = 0 + OnClick = OptionsViewClick + end + object chbxShowFilterBar: TCheckBox + Tag = 6 + Left = 90 + Top = 146 + Width = 200 + Height = 17 + Caption = 'FilterBar' + TabOrder = 6 + OnClick = OptionsViewClick + end + object lblPreviewWindow: TStaticText + Left = 323 + Top = 1 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 12 + end + end + object tshBehaviors: TTabSheet + Caption = 'Behaviors' + ImageIndex = 1 + object lblSelection: TLabel + Left = 5 + Top = 8 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object imgSelection: TImage + Left = 9 + Top = 28 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlSelection: TBevel + Left = 56 + Top = 12 + Width = 255 + Height = 4 + Shape = bsBottomLine + end + object lblExpanding: TLabel + Left = 5 + Top = 74 + Width = 50 + Height = 13 + Caption = 'Expanding' + end + object imgExpanding: TImage + Left = 9 + Top = 95 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 7778800000000000000000000000078888888888880000000000000000000000 + 007880FFF7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7FF777777FFF77777FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F8F7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7F7F8888FF7F88888FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F8F7777777777777777777078888888888880F7F7F888FFF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F0788077777777777777777777770788C8888C88880F7FF888888FFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880F0F7777777FFFFFFFFFFFF0788CCCCCCCC880F77777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7F7F8888FF7F88888FF7 + F0788077777777777777777777770788C8888C88880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F7F7F8888FF7F888888F7 + F0788077777777777777777777770788CCCC8CC8880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCCCCCC880F7FF88888FFFFFFFFFFF7 + F07880F0F777777FFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F77777777777777777777 + F078800000000000000000000000078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F888888880F88888888888078888888888880F77777777777777777777 + F07880F800008880F80000000008078888888888880F77777777777777777777 + F07880FFFFFFFFF0FFFFFFFFFFFF078888888888880FFFFFFFFFFFFFFFFFFFFF + F078800000000000000000000000088888888888880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlExpanding: TBevel + Left = 62 + Top = 79 + Width = 248 + Height = 4 + Shape = bsBottomLine + end + object lblDetails: TLabel + Left = 5 + Top = 218 + Width = 32 + Height = 13 + Caption = 'Details' + end + object bvlDetails: TBevel + Left = 47 + Top = 223 + Width = 265 + Height = 4 + Shape = bsBottomLine + end + object imgDetails: TImage + Left = 9 + Top = 239 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0889999999999999999999907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897F78FF7FF77777788F907DDDDDDDDDDDD0FF777FFFF7FFF7777FFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDDDDDDDDDDD0FF777777F7FF77777777F + F07DD0889777777777777777777907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCDDDDCDDDD0777777777777777777777 + 707DD08897F777F7FF7777888FF907DDCCCCDCCDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCCCCCCCCDD0FF7777FFF7FF7777777FF + F07DD0889777777777777777777907DDCCCCDCCDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCDDDDCDDDD0777777777777777777777 + 707DD08897F788F7FF77778FFFF907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDDDDDDDDDDD0FF777777F7FF777777777 + F07DD0889777777777777777777907DDCDDDDCDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCCCCDCCDDD0777777777777777777777 + 707DD08897F888F7FF7777788FF907DDCCCCCCCCDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCCCCDCCDDD0FF77777FF7FF7777777FF + F07DD0889000000000000000000907DDCDDDDCDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897888880F8888888888907DDDDDDDDDDDD0777777777777777777777 + 707DD08897F77780F8777777778907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFF80FFFFFFFFFFF907DDDDDDDDDDDD0FF7777FFF7FF7777777FF + F07DD0889000000000000000000907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD0889999999999999999999907DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFFFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD0F0F777777FF77777777FFF07DDDDDDDDDDDD0FF77777FF7FF77777777F + F07DD0FFFFFFFFFFFFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F888888880F8888888888807DDDDDDDDDDDD0F888888880F8888888888 + 807DD0F877778880F8777777777807DDDDDDDDDDDD0F877777880F8777777778 + 807DD0FFFFFFFFF0FFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFF0FFFFFFFFFFF + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgLevels: TImage + Left = 9 + Top = 306 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDD77777777777777777777 + 7777D0000000000000000000000007DDDDDDDDDDDDD000000000000000000000 + 0007D0888888888888888888888807DDDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFF + FF07D0F000FF8F000FF8FCCCC44F07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7F77F8F77F7F8FCC99F + 7F07D0888888888888888888888807DDDDDDDDDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0FFFFFF8FFFFFF8F666CCCF07DDDDDDDDDDDDD0F7F77F8F777FF8FCC99F + 7F07D0F0000F8F00F0F8F999999F07DDCDDDDCDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDCCCCDCCDDDD0F7888888888888888888 + 7F07D0888888888888888888888807DDCCCCCCCCDDD0F7F77F8F777FF8FC99CF + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDCCCCDCCDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0F00FFF8F0000F8F9999CCF07DDCDDDDCDDDDD0F7888888888888888888 + 7F07D0FFFFFF8FFFFFF8F99AAACF07DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0F0000F8F000FF8F9999CCF07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0888888888888888888888807DDDDDDDDDDDDD0F0000000000000000000 + 0F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFF + FF07D0F0000F8F000FF8FB99944F07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7F77F8F7777F8F777FF + 7F07D0777777777777777777777707DDDDDDDDDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0F888887F888887F888888807DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0F000087F800087F800000807DDDDDDDDDDDDD0F7F77F8F7777F8F777FF + 7F07D0F888887F888887F888888807DDDDDDDDDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0FFFFFF7FFFFFF7FFFFFFFF07DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0000000000000000000000007DDCDDDDCDDDDD0F7888888888888888888 + 7F07D7F88880777777777777777778DDCCCCDCCDDDD0F7777777777777777777 + 7F07D7F00080F87777788088888888DDCCCCCCCCDDD0F7777777777777777777 + 7F07D7F77780FFFFFFFFF088888888DDCCCCDCCDDDD0F0000000000000000000 + 0F07D7FFFFF0777777777088888888DDCDDDDCDDDDD0FFFFFFFFFFFFFFFFFFFF + FF07D7777770888888888888888888DDDDDDDDDDDDD000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblLevels: TLabel + Left = 5 + Top = 285 + Width = 30 + Height = 13 + Caption = 'Levels' + end + object bvlLevels: TBevel + Left = 47 + Top = 290 + Width = 265 + Height = 4 + Shape = bsBottomLine + end + object lblGridSize: TLabel + Left = 5 + Top = 150 + Width = 19 + Height = 13 + Caption = 'Size' + end + object bvlGridSize: TBevel + Left = 33 + Top = 154 + Width = 277 + Height = 4 + Shape = bsBottomLine + end + object imgGridSize: TImage + Left = 9 + Top = 172 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000008088F07DDDDDDDDDDDD0800000000000000000000 + 807DD0F0FFFF8FFFF8FFFF0FFF0F07DDDDDDDDDDDD0F0F77FFF8F777F8F777F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCDDDDCDDDD0F0F00FFF8F00FF8F00FF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCCCCCDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCDDDDCDDDD0F0FFFFFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCCCCDCCDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCCCCCDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCDCCDDD0F0FFFFFF8F0FFF8F0FFF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0777777777777770FFF0F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F0F8887F8887F8880FFF8F07DDDDDDDDDDDD0F0F888887F88887F88880 + F07DD0F0F0087F0087F0080FFF0F07DDDDDDDDDDDD0F0F800087F80087F80080 + F07DD0F0FFFF7FFFF7FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF7FFFFF7FFFFF0 + F07DD0800000000000000008080807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxProcessSelection: TCheckBox + Left = 90 + Top = 25 + Width = 200 + Height = 17 + Caption = 'Process Selection' + TabOrder = 0 + OnClick = OptionsSelectionClick + end + object chbxProcessExactSelection: TCheckBox + Tag = 1 + Left = 90 + Top = 46 + Width = 200 + Height = 17 + Caption = 'Process Exact Selection' + TabOrder = 1 + OnClick = OptionsSelectionClick + end + object chbxExpandGroupRows: TCheckBox + Left = 90 + Top = 89 + Width = 200 + Height = 17 + Caption = 'Groups' + TabOrder = 2 + OnClick = OptionsExpandingClick + end + object chbxExpandMasterRows: TCheckBox + Tag = 1 + Left = 90 + Top = 111 + Width = 200 + Height = 17 + Caption = 'Details' + TabOrder = 3 + OnClick = OptionsExpandingClick + end + object chbxStartFromActiveView: TCheckBox + Left = 90 + Top = 236 + Width = 200 + Height = 17 + Caption = 'Start From Active Details' + TabOrder = 6 + OnClick = OptionsDetailsClick + end + object chbxOnlyActiveView: TCheckBox + Tag = 1 + Left = 90 + Top = 258 + Width = 200 + Height = 17 + Caption = 'Only Active Details' + TabOrder = 7 + OnClick = OptionsDetailsClick + end + object chbxLevelsUnwrap: TCheckBox + Left = 90 + Top = 303 + Width = 200 + Height = 17 + Caption = '&Unwrap' + TabOrder = 8 + OnClick = OptionsLevelsClick + end + object chbxLevelsUnwrapTopLevel: TCheckBox + Tag = 1 + Left = 90 + Top = 326 + Width = 200 + Height = 17 + Caption = 'Unwrap Top Level' + TabOrder = 9 + OnClick = OptionsLevelsClick + end + object chbxLevelsRiseActiveLevelOntoTop: TCheckBox + Tag = 2 + Left = 90 + Top = 349 + Width = 200 + Height = 17 + Caption = 'Rise Active Level onto Top' + TabOrder = 10 + OnClick = OptionsLevelsClick + end + object chbxGridAutoWidth: TCheckBox + Left = 90 + Top = 169 + Width = 200 + Height = 17 + Caption = '&Auto Width' + TabOrder = 5 + OnClick = OptionsSizeClick + end + object chbxExpandCards: TCheckBox + Tag = 2 + Left = 90 + Top = 132 + Width = 200 + Height = 17 + Caption = 'Cards' + TabOrder = 4 + OnClick = OptionsExpandingClick + end + end + object tshFormatting: TTabSheet + Caption = 'Formatting' + ImageIndex = 4 + object lblLookAndFeel: TLabel + Left = 5 + Top = 8 + Width = 66 + Height = 13 + Caption = 'Look and Feel' + end + object bvlLookAndFeel: TBevel + Left = 85 + Top = 12 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object imgLookAndFeel: TImage + Left = 9 + Top = 28 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D08777777777780877777788807DCCCCDCCDDD0877777777778787777788 + 8F07D08888888888880888888888807DCCCCCCCCDD0888888888888788888888 + 8F07D00000000000000000000000007DCCCCDCCDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F7777777FF07DDDDDDDDDDD0F777777777FF7F7777777 + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F777777FFF07DDDDDDDDDDD0F777777FFFFF7F777777F + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F7777777777F7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F77777FFFF07DDDDDDDDDDD0F77777777FFF7F77777FF + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D00000000000000000000000007DCDDDDCDDDD0000000000000000000000 + 0007D08888888888880888888888807DCCCCDCCDDD0777777777777777777777 + 7707D08888888888880888888888807DCCCCCCCCDD0F88888888888788888888 + 8707D08000000008880880000000807DCCCCDCCDDD0F00000000888788000000 + 8707D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + F707D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgRefinements: TImage + Left = 9 + Top = 95 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FF7FFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF777777F + F07DD0F77777777FF7FF70888FFF07DDCCCCCCCCDD0F77777777FF7FF7FFFF7F + F07DD0FFFFFFFFFFF7FF70FF8FFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF7F00F7F + F07DD0F777777FFFF7FF70FF8FFF07DDCDDDDCDDDD0F777777FFFF7FF7F00F7F + F07DD0FFFFFFFFFFF7FF70000FFF07DDDDDDDDDDDD0FFFFFFFFFFF7FF7FFFF7F + F07DD0F77777777FF7FF777777FF07DDDDDDDDDDDD0F77777777FF7FF777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFCCCCCFFF07DDCCCCCCCCDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FCCCCCCCFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F7777777FFF7FFCCCCCFFF07DDCDDDDCDDDD0F7777777FFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7F9999999FF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F777777777F7FF99999FFF07DDDDDDDDDDDD0F777777777F7F7777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F80000888887F88888888707DDDDDDDDDDDD0F80000888887F88888888 + 707DD0F80000000087F80000008707DDDDDDDDDDDD0F80000000087F80000008 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0FFFFFFFFFFF7FFFFFFFFF707DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + 707DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblRefinements: TLabel + Left = 5 + Top = 74 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlRefinements: TBevel + Left = 70 + Top = 79 + Width = 241 + Height = 4 + Shape = bsBottomLine + end + object bvlRefinementsSeparator: TBevel + Left = 90 + Top = 168 + Width = 221 + Height = 4 + Shape = bsBottomLine + end + object lblPagination: TLabel + Left = 5 + Top = 229 + Width = 50 + Height = 13 + Caption = 'Pagination' + end + object bvlPagination: TBevel + Left = 64 + Top = 234 + Width = 247 + Height = 4 + Shape = bsBottomLine + end + object imgPagination: TImage + Left = 8 + Top = 251 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDD0000000000000000000000007DDDDDDDDDDDD77777777777777770DDDDD + DDDDD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD7FFFFFFFFFFFFFFF0DDDDD + DDDDD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD7F8888888888888F0DDDDD + DDDDD0888000000000000000088F07DDDDDDDDDDDD7F8777877778778F07770D + DDDDD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7F8888888888888F0FFF0D + DDDDD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F088F0D + DDDDD0F9F0F00F8F00F8F00F0F9F07DDDDDDDDDDDD7F8888888888888F078F07 + 770DD0F990FFFF8FFFF8FFFF099F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F088F0F + FF0DD0F99999999999999999999F07DDCDDDDCDDDD7F8FFF8FFFF8FF8F0F8F08 + 8F0DD0F990FFFF8FFFF8FFFF099F07DDCCCCDCCDDD7F8888888888888F088F07 + 8F0DD0F9F0FFFF8F00F8F00F0F9F07DDCCCCCCCCDD7F8FFF8FFFF8FF8F0F8F08 + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDCCCCDCCDDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F8F0FFFF8F00F8F00F0F8F07DDCDDDDCDDDD7F8888888888888F088F08 + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F9F0F00F8F00F8F00F0F9F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F990FFFF8FFFF8FFFF099F07DDCDDDDCDDDD7F8888888888888F088F0F + 8F0DD0F99999999999999999999F07DDCCCCDCCDDD7F8FFF8FFFF8FF8F0F8F08 + 8F0DD0F990FFFF8FFFF8FFFF099F07DDCCCCCCCCDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F9F0FFFF8F00F8F00F0F9F07DDCCCCDCCDDD7F8888888888888F088F0F + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDCDDDDCDDDD7F8777877778778F0F8F08 + 8F0DD0F8F0F00F8F00F8F00F0F8F07DDDDDDDDDDDD7F8888888888888F0F8F0F + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7FFFFFFFFFFFFFFF088F0F + 8F0DD0F8F0777777777777770F8F07DDDDDDDDDDDD0000000000000000078F08 + 8F0DD0F8F0F8887F8887F8880F8F07DDDDDDDDDDDDDDDD7F8888888888888F0F + 8F0DD0F8F0F0087F0087F0080F8F07DDDDDDDDDDDDDDDD7FFFFFFFFFFFFFFF08 + 8F0DD0F8F0FFFF7FFFF7FFFF0F8F07DDDDDDDDDDDDDDDD00000000000000000F + 8F0DD0888000000000000000088807DDDDDDDDDDDDDDDDDDDD7F888888888888 + 8F0DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDDDDDDDDDD7FFFFFFFFFFFFF + FF0DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDDDDDDDDDD00000000000000 + 000DD000000000000000000000000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object cbxLookAndFeel: TComboBox + Left = 90 + Top = 33 + Width = 212 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + OnClick = LookAndFeelClick + end + object chbxFlatCheckMarks: TCheckBox + Tag = 2 + Left = 90 + Top = 142 + Width = 200 + Height = 17 + Caption = 'Flat Check &Marks' + TabOrder = 3 + OnClick = OptionsRefinementClick + end + object chbxDisplayGraphicsAsText: TCheckBox + Tag = 1 + Left = 90 + Top = 119 + Width = 200 + Height = 17 + Caption = 'Display Graphics As &Text' + TabOrder = 2 + OnClick = OptionsRefinementClick + end + object chbxTransparentGraphics: TCheckBox + Left = 90 + Top = 96 + Width = 200 + Height = 17 + Caption = 'Transparent &Graphics' + TabOrder = 1 + OnClick = OptionsRefinementClick + end + object chbxSuppressBackgroundBitmaps: TCheckBox + Tag = 1 + Left = 90 + Top = 181 + Width = 200 + Height = 17 + Caption = 'Suppress Background Images' + TabOrder = 4 + OnClick = OptionsFormatingClick + end + object chbxConsumeSelectionStyle: TCheckBox + Tag = 2 + Left = 90 + Top = 203 + Width = 200 + Height = 17 + Caption = 'Consume Selection Style' + TabOrder = 5 + OnClick = OptionsFormatingClick + end + object chbxPaginateOneGroupPerPage: TCheckBox + Tag = 1 + Left = 90 + Top = 274 + Width = 200 + Height = 17 + Caption = 'One Group Per Page' + TabOrder = 7 + OnClick = OptionsPaginationClick + end + object chbxPaginateByTopLevelGroups: TCheckBox + Left = 90 + Top = 251 + Width = 200 + Height = 17 + Caption = 'By TopLevel Groups' + TabOrder = 6 + OnClick = OptionsPaginationClick + end + end + object tshStyles: TTabSheet + Caption = 'Styles' + ImageIndex = 5 + object bvlStyles: TBevel + Left = 118 + Top = 12 + Width = 191 + Height = 4 + Shape = bsBottomLine + end + object bvlStyleSheets: TBevel + Left = 72 + Top = 295 + Width = 237 + Height = 5 + Shape = bsBottomLine + end + object lblStyleSheets: TLabel + Left = 6 + Top = 291 + Width = 60 + Height = 13 + Caption = 'Style Sheets' + end + object bvlStylesHost: TBevel + Left = 6 + Top = 33 + Width = 228 + Height = 219 + end + object Label1: TLabel + Left = 76 + Top = 135 + Width = 68 + Height = 13 + Caption = '[ Styles Host ]' + Visible = False + end + object lblUseNativeStyles: TLabel + Left = 24 + Top = 9 + Width = 84 + Height = 13 + Caption = '&Use Native Styles' + FocusControl = chbxUseNativeStyles + OnClick = lblUseNativeStylesClick + end + object btnStyleColor: TButton + Left = 243 + Top = 61 + Width = 68 + Height = 23 + Caption = 'Co&lor...' + TabOrder = 2 + OnClick = StyleColorClick + end + object btnStyleFont: TButton + Left = 243 + Top = 33 + Width = 68 + Height = 23 + Caption = '&Font...' + TabOrder = 1 + OnClick = StyleFontClick + end + object btnStyleBackgroundBitmap: TButton + Left = 243 + Top = 97 + Width = 68 + Height = 23 + Caption = '&Bitmap...' + TabOrder = 3 + OnClick = StyleBackgroundBitmapClick + end + object chbxUseNativeStyles: TCheckBox + Left = 5 + Top = 8 + Width = 14 + Height = 17 + TabOrder = 0 + OnClick = OptionsFormatingClick + end + object cbxStyleSheets: TComboBox + Left = 6 + Top = 311 + Width = 302 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 7 + OnClick = cbxStyleSheetsClick + OnDrawItem = cbxStyleSheetsDrawItem + OnKeyDown = cbxStyleSheetsKeyDown + end + object btnStyleSheetNew: TButton + Left = 6 + Top = 343 + Width = 71 + Height = 23 + Caption = '&New...' + TabOrder = 8 + OnClick = StyleSheetNewClick + end + object btnStyleSheetCopy: TButton + Left = 83 + Top = 343 + Width = 71 + Height = 23 + Caption = '&Copy...' + TabOrder = 9 + OnClick = StyleSheetCopyClick + end + object btnStyleSheetDelete: TButton + Left = 160 + Top = 343 + Width = 71 + Height = 23 + Caption = '&Delete...' + TabOrder = 10 + OnClick = StyleSheetDeleteClick + end + object btnStylesSaveAs: TButton + Left = 123 + Top = 259 + Width = 112 + Height = 23 + Caption = 'Save &As...' + TabOrder = 6 + OnClick = StylesSaveAsClick + end + object btnStyleSheetRename: TButton + Left = 237 + Top = 343 + Width = 71 + Height = 23 + Caption = '&Rename...' + TabOrder = 11 + OnClick = StyleSheetRenameClick + end + object btnStyleBackgroundBitmapClear: TButton + Left = 243 + Top = 125 + Width = 68 + Height = 23 + Caption = 'Cle&ar' + TabOrder = 4 + OnClick = StyleBackgroundBitmapClearClick + end + object btnStyleRestoreDefaults: TButton + Left = 6 + Top = 259 + Width = 112 + Height = 23 + Caption = 'Rest&ore Defaults' + TabOrder = 5 + OnClick = StyleRestoreDefaultsClick + end + end + object tshPreview: TTabSheet + Caption = 'Preview' + ImageIndex = 2 + object lblPreviewOptions: TLabel + Left = 5 + Top = 8 + Width = 37 + Height = 13 + Caption = 'Options' + end + object bvlPreviewOptions: TBevel + Left = 50 + Top = 12 + Width = 261 + Height = 4 + Shape = bsBottomLine + end + object lblPreviewMaxLineCount: TLabel + Left = 91 + Top = 73 + Width = 78 + Height = 13 + Caption = 'Max Line Count:' + end + object bvlPreviewMaxLineCountHost: TBevel + Left = 229 + Top = 69 + Width = 68 + Height = 21 + Visible = False + end + object imgPreview: TImage + Left = 9 + Top = 28 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDD7777777777777777777777777DDDDDD0000000000000000000000000 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F888F7FF888F7F8888F7F07DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F0 + 7DDDDDD0F777777777777777777777F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCFFCCCCFFCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCFCCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCFCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCFCCFCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCFFCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F777777777777777777777F07DDDDDD0F7F888F7FF888F7FF888F7F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F88887F888887F888887F07DDDDDD0F7F00087F000087F000087F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0000000000000000000000000 + DDDD} + Transparent = True + end + object chbxPreviewVisible: TCheckBox + Left = 90 + Top = 28 + Width = 150 + Height = 17 + Caption = 'Visible' + TabOrder = 0 + OnClick = PreviewVisibleClick + end + object chbxPreviewAutoHeight: TCheckBox + Left = 90 + Top = 49 + Width = 150 + Height = 17 + Caption = 'Auto Height' + TabOrder = 1 + OnClick = PreviewAutoHeightClick + end + end + object tshCards: TTabSheet + Caption = 'Cards' + ImageIndex = 3 + object bvlCardSpaceVertHost: TBevel + Left = 231 + Top = 140 + Width = 75 + Height = 21 + Visible = False + end + object bvlCardSpaceHorzHost: TBevel + Left = 231 + Top = 112 + Width = 75 + Height = 21 + Visible = False + end + object lblCardSpaceVert: TLabel + Left = 90 + Top = 145 + Width = 39 + Height = 13 + Caption = 'Vertical:' + end + object lblCardSpaceHorz: TLabel + Left = 90 + Top = 116 + Width = 52 + Height = 13 + Caption = 'Horizontal:' + end + object imgCardSpacing: TImage + Left = 9 + Top = 112 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDD0DD0DDDDDDDDDDDDDDDDDD0DD0DDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDD00D0DDDDDDDDDDDDDDDDDD0D00DDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDD000000000000000000000000000000DDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDD00D0DDDDDDDDDDDDDDDDDD0D00DDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDD7DD0DDDDDD707000DDDDDD0DD7DDDDDDDDDDDDDDD + DDDDDDDDD0000000000000000000DDDDDD0D0D0DDDDDD0000000000000000000 + 0DDDDDDD77777777777777777770DDDDD00D0D0DDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDD0D000DDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7FFFFFFF7FFF9999FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFF9999FF7 + 0DDDDDDD7FFFFFFF7FFF9999FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFF9999FF7 + 0DDDDDDD7FFFFFFF7FCCCC99FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FCCCC99FF7 + 0DDDDDDD7FFFFFFF7FCCCC99FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FCCCC99FF7 + 0DDDDDDD7F77777F7FCCCCFFFF70DDDDDDDDDDDDDDDDD7F77777F7FCCCCFFFF7 + 0DDDDDDD7F77777F7FCCCCFFFF70DDDDDDDDDDDDDDDDD7F77777F7FCCCCFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD77777777777777777770DDDDDDDDDDDDDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7F77777F7FF777777F70DDDDDDDDDDDDDDDDD7F77777F7FF777777F7 + 0DDDDDDD7F7FFFFF7FF7FFFFFF70DDDDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD77777777777777777770DDDDDDDDDDDDDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7F77777F7FF77777FF70DDDDDDDDDDDDDDDDD7F77777F7FF777777F7 + 0DDDDDDD7F7FFFFF7FF77FFFFF70DDDDDDDDDDDDDDDDD7F7FFFFF7FF77FFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD77777777777777777770DDDDDDDDDDDDDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7F77777F7FF777777F70DDDDDDDDDDDDDDDDD7F77777F7FF777777F7 + 0DDDDDDD7F7FFFFF7FF7FFFFFF70DDDDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7777777777777777777DDDDDDDDDDDDDDDDDD7777777777777777777 + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblCardSpacing: TLabel + Left = 5 + Top = 92 + Width = 37 + Height = 13 + Caption = 'Spacing' + end + object bvlCardSpacing: TBevel + Left = 51 + Top = 97 + Width = 260 + Height = 4 + Shape = bsBottomLine + end + object bvlCardSizes: TBevel + Left = 34 + Top = 12 + Width = 277 + Height = 4 + Shape = bsBottomLine + end + object lblCardSizes: TLabel + Left = 5 + Top = 8 + Width = 24 + Height = 13 + Caption = 'Sizes' + end + object imgCardSizes: TImage + Left = 9 + Top = 28 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDD000000000000DDDDDDDDDDDDDDDDDDDDDDDD000000000000DD00000000 + 0000D7777777777770DDDDDDDDDDDDDDDDDDDDDDD7777777777770D777777777 + 7770D7FFFFF8FFFF70DDDDDDDDDDDDDDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8FFFF70DDDDDDDDDDDDDDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70DDDDDDDDDDDDDDDDDDDDDDD7FFFFF8F77F70D7FFFFF8FF + FF70D7FFFFF8FFFF70DDDDDDDDDDDDDDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70DD0000000000DDCCCCDCCDD7FFFFF8F77F70D7FFFFF8FF + FF70D7FFFFF8FFFF70D77777777770DDCCCCCCCCD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70D7FFFF8FFF70DDCCCCDCCDD7FFFFF8F77F70D7FFFFF8FF + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70D7FFFF8F7F70DDDDDDDDDDD7FFFFF8F77F70D7FFFFF8F7 + FF70D7F777F8FFFF70D7FFFF8FFF70DDDDDDDDDDD7F777F8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDDDDDDDDDD7F777F8F77F70D7F77FF8F7 + 7F70D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7888888888870D78888888870DDDDDDDDDDD7888888888870D788888888 + 8870D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDDDDDDDDDD7F777F8F77F70D7F77FF8F7 + FF70D7F777F8FFFF70D7F77F8F7F70DDDDDDDDDDD7F777F8FFFF70D7F77FF8F7 + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7888888888870D78888888870DDDDDDDDDDD7888888888870D788888888 + 8870D7FFFFF8FFFF70D7FFFF8FFF70DDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDCCCCDCCDD7F777F8F77F70D7F77FF8F7 + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDCCCCCCCCD7FFFFF8FFFF70D7FFFFF8FF + FF70D7888888888870D78888888870DDCCCCDCCDD7888888888870D788888888 + 8870D7FFFFF8FFFF70D7FFFF8FFF70DDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDDDDDDDDDD7F777F8F77F70D7F77FF8F7 + FF70D7F7FFF8FFFF70D7F7FF8F7F70DDDDDDDDDDD7F7FFF8FFFF70D7F7FFF8F7 + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D777777777777DD7777777777DDDDDDDDDDDD777777777777DD777777777 + 777DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgCardFraming: TImage + Left = 9 + Top = 189 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDD7777777777777777777DDDDDDDDDDDDDDDDDD00000000000000000 + 00DDDDDDD88888888888888888887DDDDDDDDDDDDDDDDD000000000000000000 + 00DDDDDDD8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDDDDD0FFFFFFF0FFFFFFFFF + 00DDDDD778FFFFFFF8FFF9999FF87DDDDDDDDDDDDDDD000FFFFFFF0FFF9999FF + 00DDDD8888FFFFFFF8FFF9999FF87DDDDDDDDDDDDDD0000FFFFFFF0FFF9999FF + 00DDDD8FF8FFFFFFF8FCCCC99FF87DDDCDDDDCDDDDD0FF0FFFFFFF0FCCCC99FF + 00DDDD8FF8FFFFFFF8FCCCC99FF87DDDCCCCDCCDDDD0FF0FFFFFFF0FCCCC99FF + 00DDDD8FF8F77777F8FCCCCFFFF87DDDCCCCCCCCDDD0FF0F77777F0FCCCCFFFF + 00DDDD8FF8F77777F8FCCCCFFFF87DDDCCCCDCCDDDD0FF0F77777F0FCCCCFFFF + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDCDDDDCDDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDDDDDDDDDDDD0F7000000000000000000 + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF777777F87DDDDDDDDDDDDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF7FFFFFF87DDDDDDDDDDDDDD0000F7FFFFF0FF7FFFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDDDDDDDDDDDD0F7000000000000000000 + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF77777FF87DDDDDDDDDDDDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF77FFFFF87DDDDDDDDDDDDDD0000F7FFFFF0FF77FFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDCDDDDCDDDDD0F7000000000000000000 + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDCCCCDCCDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF777777F87DDDCCCCCCCCDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF7FFFFFF87DDDCCCCDCCDDDD0000F7FFFFF0FF7FFFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDCDDDDCDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F78888888888888888888DDDDDDDDDDDDDDD0F7000000000000000000 + 0DDDDD8F7FFFFF8FF7FFFFFF87DDDDDDDDDDDDDDDDD0F7FFFFF0FF7FFFFFF00D + DDDDDD8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDDDDD0FFFFFFF0FFFFFFFFF00D + DDDDDD8888888888888888888DDDDDDDDDDDDDDDDDD0000000000000000000DD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblCardFraming: TLabel + Left = 5 + Top = 171 + Width = 38 + Height = 13 + Caption = 'Framing' + end + object bvlCardFraming: TBevel + Left = 49 + Top = 176 + Width = 262 + Height = 4 + Shape = bsBottomLine + end + object bvlCardShadowColorHost: TBevel + Left = 177 + Top = 276 + Width = 129 + Height = 21 + Visible = False + end + object lblCardShadowDepth: TLabel + Left = 90 + Top = 308 + Width = 33 + Height = 13 + Caption = 'Depth:' + end + object bvlCardShadow: TBevel + Left = 48 + Top = 260 + Width = 263 + Height = 4 + Shape = bsBottomLine + end + object lblCardShadow: TLabel + Left = 5 + Top = 255 + Width = 38 + Height = 13 + Caption = 'Shadow' + end + object lblCardShadowColor: TLabel + Left = 90 + Top = 280 + Width = 29 + Height = 13 + Caption = 'Color:' + end + object bvlCardShadowDepthHost: TBevel + Left = 177 + Top = 304 + Width = 129 + Height = 21 + Visible = False + end + object imgCardShadow: TImage + Left = 9 + Top = 276 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD0000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD0000000000000000000 + 000DDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDCDDDDCDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7FFFFFFF7FFF9999FFFFF7DDDDCCCCDCCDDDD7FFFFFFF7FFF9999FFFFF + 700DDD7FFFFFFF7FFF9999FFFFF7DDDDCCCCCCCCDDD7FFFFFFF7FFF9999FFFFF + 700DDD7FFFFFFF7FCCCC99FFFFF7DDDDCCCCDCCDDDD7FFFFFFF7FCCCC99FFFFF + 700DDD7FFFFFFF7FCCCC99FFFFF7DDDDCDDDDCDDDDD7FFFFFFF7FCCCC99FFFFF + 700DDD7F77777F7FCCCCFFFFFFF7DDDDDDDDDDDDDDD7F77777F7FCCCCFFFFFFF + 700DDD7F77777F7FCCCCFFFFFFF7DDDDDDDDDDDDDDD7F77777F7FCCCCFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7F77777F7FF777777FFFF7DDDDDDDDDDDDDDD7F77777F7FF777777FFFF + 700DDD7F7FFFFF7FF7FFFFFFFFF7DDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7F77777F7FF77777FFFFF7DDDDCDDDDCDDDDD7F77777F7FF77777FFFFF + 700DDD7F7FFFFF7FF77FFFFFFFF7DDDDCCCCDCCDDDD7F7FFFFF7FF77FFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDCCCCCCCCDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7777777777777777777777DDDDCCCCDCCDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDCDDDDCDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7F77777F7FF777777FFFF7DDDDDDDDDDDDDDD7F77777F7FF777777FFFF + 700DDD7F7FFFFF7FF7FFFFFFFFF7DDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 7DDDDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 7DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxCardsKeepSameHeight: TCheckBox + Tag = 2 + Left = 90 + Top = 70 + Width = 200 + Height = 17 + Caption = 'Keep Same Height' + TabOrder = 2 + OnClick = OptionsCardsClick + end + object chbxCardsKeepSameWidth: TCheckBox + Tag = 1 + Left = 90 + Top = 49 + Width = 200 + Height = 17 + Caption = 'Keep Same Width' + TabOrder = 1 + OnClick = OptionsCardsClick + end + object chbxCardsAutoWidth: TCheckBox + Left = 90 + Top = 28 + Width = 200 + Height = 17 + Caption = 'Auto Width' + TabOrder = 0 + OnClick = OptionsCardsClick + end + object chbxCardsVertLines: TCheckBox + Tag = 5 + Left = 90 + Top = 231 + Width = 200 + Height = 17 + Caption = 'Vertical Lines' + TabOrder = 5 + OnClick = OptionsCardsClick + end + object chbxCardsHorzLines: TCheckBox + Tag = 4 + Left = 90 + Top = 210 + Width = 200 + Height = 17 + Caption = 'Horizontal Lines' + TabOrder = 4 + OnClick = OptionsCardsClick + end + object chbxCardsBorder: TCheckBox + Tag = 3 + Left = 90 + Top = 189 + Width = 200 + Height = 17 + Caption = 'Border' + TabOrder = 3 + OnClick = OptionsCardsClick + end + end + end + object pnlPreview: TPanel + Left = 331 + Top = 44 + Width = 306 + Height = 350 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + object PreviewGrid: TcxGrid + Left = 5 + Top = 7 + Width = 296 + Height = 337 + TabOrder = 0 + LookAndFeel.NativeStyle = False + RootLevelOptions.DetailTabsPosition = dtpTop + object PreviewBandedView: TcxGridBandedTableView + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'Count = 0' + Kind = skCount + Position = spFooter + Column = colVendorName + end> + DataController.Summary.FooterSummaryItems = < + item + Format = 'Count = 0' + Kind = skCount + Column = colVendorName + end> + DataController.Summary.SummaryGroups = <> + NavigatorButtons.ConfirmDelete = False + Filtering.CustomizeDialog = False + Filtering.Visible = fvAlways + OptionsView.ScrollBars = ssNone + OptionsView.CellAutoHeight = True + OptionsView.ColumnAutoWidth = True + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.GroupFooters = gfAlwaysVisible + Preview.Column = colVendorCountry + Preview.Visible = True + OnCustomDrawColumnHeader = PreviewBandedViewCustomDrawColumnHeader + OnCustomDrawFooterCell = PreviewBandedViewCustomDrawFooterCell + Bands = < + item + Caption = 'Vendor Data' + Width = 150 + end + item + Caption = 'Car Data' + end> + OnCustomDrawBandHeader = PreviewBandedViewCustomDrawBandHeader + object colVendorName: TcxGridBandedColumn + Caption = 'Name' + PropertiesClassName = 'TcxTextEditProperties' + Options.Filtering = False + Position.BandIndex = 0 + Position.ColIndex = 0 + Position.RowIndex = 0 + end + object colVendorLogo: TcxGridBandedColumn + Caption = 'Logo' + PropertiesClassName = 'TcxImageProperties' + Properties.GraphicTransparency = gtTransparent + OnCustomDrawCell = VendorLogoCustomDrawCell + Options.Filtering = False + Position.BandIndex = 0 + Position.ColIndex = 1 + Position.RowIndex = 0 + end + object colVendorCountry: TcxGridBandedColumn + PropertiesClassName = 'TcxTextEditProperties' + Position.BandIndex = 0 + Position.ColIndex = 2 + Position.RowIndex = 0 + end + object colCarModel: TcxGridBandedColumn + Caption = 'Model' + PropertiesClassName = 'TcxTextEditProperties' + Options.Filtering = False + Position.BandIndex = 1 + Position.ColIndex = 0 + Position.RowIndex = 0 + end + object colIsSUVModel: TcxGridBandedColumn + Caption = 'SUV' + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.ValueGrayed = #39#39 + OnCustomDrawCell = IsSUVModelCustomDrawCell + HeaderAlignmentHorz = taCenter + Options.Filtering = False + Width = 30 + Position.BandIndex = 1 + Position.ColIndex = 1 + Position.RowIndex = 0 + end + end + object PreviewGridLevel: TcxGridLevel + Caption = 'Cars' + end + end + end + object pmStyles: TPopupMenu + Images = ilStylesPopup + OnPopup = pmStylesPopup + Left = 4 + Top = 408 + object miStyleFont: TMenuItem + Caption = '&Font...' + ImageIndex = 0 + OnClick = StyleFontClick + end + object miStyleColor: TMenuItem + Caption = '&Color...' + OnClick = StyleColorClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miStyleBackgroundBitmap: TMenuItem + Caption = '&Bitmap...' + ImageIndex = 1 + ShortCut = 16463 + OnClick = StyleBackgroundBitmapClick + end + object miStyleBackgroundBitmapClear: TMenuItem + Caption = 'Clear' + ImageIndex = 3 + ShortCut = 16430 + OnClick = StyleBackgroundBitmapClearClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miStyleRestoreDefaults: TMenuItem + Caption = 'Restore Defaults' + OnClick = StyleRestoreDefaultsClick + end + object milLine: TMenuItem + Caption = '-' + end + object miStylesSelectAll: TMenuItem + Caption = 'Select A&ll' + ShortCut = 16449 + OnClick = miStylesSelectAllClick + end + object miLine4: TMenuItem + Caption = '-' + end + object miStylesSaveAs: TMenuItem + Caption = 'Save &As...' + ImageIndex = 2 + ShortCut = 16467 + OnClick = StylesSaveAsClick + end + end + object ilStylesPopup: TImageList + Left = 32 + Top = 408 + Bitmap = { + 494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00000000000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF000000 + 0000008080000080800000808000008080000080800000808000008080000080 + 8000008080000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000000000000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000008080000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF00FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800080808000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00C0C0C00000FFFF00C0C0C000FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000000000008080800080808000000000008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C00000000000C0C0C00000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFC001FFFF + FE07001F8001FFF9FF9F000F8001E7FFFF9F00078001C3F3E01F00038001C3E7 + F99F00018001E1C7F99B00008001F08FF99B00018001F81FF89300018001FC3F + D80300018001F81FD9BF80018001F09FC93FE0018001C1C7C03FE001800183E3 + FFFFE00180018FF1FFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end + object cxStyleRepository1: TcxStyleRepository + Left = 60 + Top = 408 + object styleCardShadow: TcxStyle + end + object styleCardBorder: TcxStyle + AssignedValues = [svColor] + Color = clWindow + end + end +end diff --git a/official/x.35/Lib/D11/dxPScxGrid4LnkPredefinedStyleSheets.dfm b/official/x.35/Lib/D11/dxPScxGrid4LnkPredefinedStyleSheets.dfm new file mode 100644 index 00000000..83221cdb --- /dev/null +++ b/official/x.35/Lib/D11/dxPScxGrid4LnkPredefinedStyleSheets.dfm @@ -0,0 +1,351 @@ +object dxdmPScxGridLnkPredefinedStyles: TdxdmPScxGridLnkPredefinedStyles + OldCreateOrder = False + Left = 352 + Top = 156 + Height = 150 + Width = 215 + object StyleRepository: TcxStyleRepository + Left = 37 + Top = 12 + object styleProfessionalFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3355443 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = 13033414 + end + object styleProfessionalGroup: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4214088 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 13033414 + end + object styleProfessionalRowCaption: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6582120 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object styleProfessionalCaptionRow: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = 13033414 + end + object styleProfessionalContentOdd: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleProfessionalContentEven: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4214088 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 13033414 + end + object styleProfessionalPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14541789 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleProfessionalSelection: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object styleGreenFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9358956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleGreenFooter: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9358956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenLightContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12778719 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenLightPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14154698 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenSelected: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4949549 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenGroup: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11328403 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleNoneContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleNoneFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentBandHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentFooter: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentGroup: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsItalic] + TextColor = clBlack + end + object styleTransparentLevelCaption: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentFilterBar: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentCaptionRow: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentRowCaption: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContentEven: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContentOdd: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentSelection: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13816275 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object ssProfessional: TdxGridReportLinkStyleSheet + Caption = 'Professional' + Styles.BandHeader = styleProfessionalFixed + Styles.Caption = styleProfessionalFixed + Styles.CardCaptionRow = styleProfessionalCaptionRow + Styles.CardRowCaption = styleProfessionalRowCaption + Styles.Content = styleNoneContent + Styles.ContentEven = styleProfessionalContentEven + Styles.ContentOdd = styleProfessionalContentOdd + Styles.FilterBar = styleProfessionalFixed + Styles.Footer = styleProfessionalFixed + Styles.Group = styleProfessionalGroup + Styles.Header = styleProfessionalFixed + Styles.Preview = styleProfessionalPreview + Styles.Selection = styleProfessionalSelection + BuiltIn = True + end + object ssGreen: TdxGridReportLinkStyleSheet + Caption = 'Green' + Styles.BandHeader = styleGreenFixed + Styles.Caption = styleGreenFixed + Styles.CardCaptionRow = styleGreenFixed + Styles.CardRowCaption = styleGreenFixed + Styles.Content = styleNoneContent + Styles.ContentEven = styleGreenLightContent + Styles.ContentOdd = styleNoneContent + Styles.FilterBar = styleGreenFixed + Styles.Footer = styleGreenFixed + Styles.Group = styleGreenGroup + Styles.Header = styleGreenFixed + Styles.Preview = styleGreenLightPreview + Styles.Selection = styleGreenSelected + BuiltIn = True + end + object ssTransparent: TdxGridReportLinkStyleSheet + Caption = 'Transparent' + Styles.BandHeader = styleTransparentBandHeader + Styles.Caption = styleTransparentLevelCaption + Styles.CardCaptionRow = styleTransparentCaptionRow + Styles.CardRowCaption = styleTransparentRowCaption + Styles.Content = styleTransparentContent + Styles.ContentEven = styleTransparentContentEven + Styles.ContentOdd = styleTransparentContentOdd + Styles.FilterBar = styleTransparentFilterBar + Styles.Footer = styleTransparentFooter + Styles.Group = styleTransparentGroup + Styles.Header = styleTransparentHeader + Styles.Preview = styleTransparentPreview + Styles.Selection = styleTransparentSelection + BuiltIn = True + end + end +end diff --git a/official/x.35/Lib/D11/dxPScxGrid6Lnk.dcu b/official/x.35/Lib/D11/dxPScxGrid6Lnk.dcu new file mode 100644 index 00000000..48bef110 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxGrid6Lnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxGrid6Lnk.dfm b/official/x.35/Lib/D11/dxPScxGrid6Lnk.dfm new file mode 100644 index 00000000..dd4718c3 --- /dev/null +++ b/official/x.35/Lib/D11/dxPScxGrid6Lnk.dfm @@ -0,0 +1,1965 @@ +object dxfmGridReportLinkDesignWindow: TdxfmGridReportLinkDesignWindow + Left = 438 + Top = 133 + BorderStyle = bsDialog + Caption = 'fmdxGridDesignWindow' + ClientHeight = 450 + ClientWidth = 648 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 5 + Top = 5 + Width = 639 + Height = 405 + ActivePage = tshBehaviors + TabOrder = 0 + OnChange = PageControl1Change + object tshView: TTabSheet + Caption = 'View' + object lblShow: TLabel + Left = 5 + Top = 8 + Width = 26 + Height = 13 + Caption = 'Show' + end + object imgShow: TImage + Left = 9 + Top = 37 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlShow: TBevel + Left = 43 + Top = 12 + Width = 266 + Height = 4 + Shape = bsBottomLine + end + object lblOnEveryPage: TLabel + Left = 5 + Top = 164 + Width = 72 + Height = 13 + Caption = 'On Every Page' + end + object imgOnEveryPage: TImage + Left = 9 + Top = 189 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888777777777777777708888888888 + 888887FFFFFFFFFFFFFFF08888888888888887F7777777777777F07777708888 + 888887F7777777777777F0FFFFF08888888887F7777777777777F07777F07777 + 708887FFFFFFFFFFFFFFF07777F0FFFFF08887F777777777777FF07777F07777 + F08887FFFFFFFFFFFFFFF0FFFFF07777F08887F77777777777FFF077FFF07777 + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777777FFFFF0777FF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777FFFFFFFF07FFFF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF0777FF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF077FFF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777777F077FFF077FF + F08887F7777777777777F0FFFFF0FFFFF08887F7777777777777F0FFFFF07FFF + F08887FFFFFFFFFFFFFFF07777F0FFFFF0888000000000000000007777F077FF + F08888888887F7777777777777F0FFFFF08888888887FFFFFFFFFFFFFFF07777 + F0888888888000000000000000007777F08888888888888887F7777777777777 + F08888888888888887FFFFFFFFFFFFFFF0888888888888888000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlOnEveryPage: TBevel + Left = 90 + Top = 168 + Width = 221 + Height = 4 + Shape = bsBottomLine + end + object bvlWarningHost: TBevel + Left = 4 + Top = 289 + Width = 313 + Height = 76 + Visible = False + end + object chbxShowBands: TCheckBox + Tag = 1 + Left = 90 + Top = 42 + Width = 200 + Height = 17 + Caption = 'Ba&nds' + TabOrder = 1 + OnClick = OptionsViewClick + end + object chbxShowHeaders: TCheckBox + Tag = 2 + Left = 90 + Top = 63 + Width = 200 + Height = 17 + Caption = '&Headers' + TabOrder = 2 + OnClick = OptionsViewClick + end + object chbxShowFooters: TCheckBox + Tag = 3 + Left = 90 + Top = 84 + Width = 200 + Height = 17 + Caption = 'Foo&ters' + TabOrder = 3 + OnClick = OptionsViewClick + end + object chbxShowGroupFooters: TCheckBox + Tag = 4 + Left = 90 + Top = 104 + Width = 200 + Height = 17 + Caption = 'G&roup Footers' + TabOrder = 4 + OnClick = OptionsViewClick + end + object chbxShowExpandButtons: TCheckBox + Tag = 5 + Left = 90 + Top = 125 + Width = 200 + Height = 17 + Caption = 'Expand Buttons' + TabOrder = 5 + OnClick = OptionsViewClick + end + object chbxBandsOnEveryPage: TCheckBox + Tag = 1 + Left = 90 + Top = 202 + Width = 200 + Height = 17 + Caption = 'Ba&nds' + TabOrder = 8 + OnClick = OptionsOnEveryPageClick + end + object chbxHeadersOnEveryPage: TCheckBox + Tag = 2 + Left = 90 + Top = 223 + Width = 200 + Height = 17 + Caption = 'Headers' + TabOrder = 9 + OnClick = OptionsOnEveryPageClick + end + object chbxFootersOnEveryPage: TCheckBox + Tag = 3 + Left = 90 + Top = 245 + Width = 200 + Height = 17 + Caption = 'Footers' + TabOrder = 10 + OnClick = OptionsOnEveryPageClick + end + object chbxFilterBarOnEveryPage: TCheckBox + Tag = 4 + Left = 90 + Top = 266 + Width = 200 + Height = 17 + Caption = 'FilterBar' + TabOrder = 11 + OnClick = OptionsOnEveryPageClick + end + object chbxCaptionsOnEveryPage: TCheckBox + Left = 90 + Top = 181 + Width = 200 + Height = 17 + Caption = 'Captions' + TabOrder = 7 + OnClick = OptionsOnEveryPageClick + end + object chbxShowCaptions: TCheckBox + Left = 90 + Top = 22 + Width = 200 + Height = 17 + Caption = 'Captions' + TabOrder = 0 + OnClick = OptionsViewClick + end + object chbxShowFilterBar: TCheckBox + Tag = 6 + Left = 90 + Top = 146 + Width = 200 + Height = 17 + Caption = 'FilterBar' + TabOrder = 6 + OnClick = OptionsViewClick + end + object lblPreviewWindow: TStaticText + Left = 323 + Top = 1 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 12 + end + end + object tshBehaviors: TTabSheet + Caption = 'Behaviors' + ImageIndex = 1 + object lblSelection: TLabel + Left = 5 + Top = 8 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object imgSelection: TImage + Left = 9 + Top = 28 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlSelection: TBevel + Left = 56 + Top = 12 + Width = 255 + Height = 4 + Shape = bsBottomLine + end + object lblExpanding: TLabel + Left = 5 + Top = 67 + Width = 50 + Height = 13 + Caption = 'Expanding' + end + object imgExpanding: TImage + Left = 9 + Top = 88 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 7778800000000000000000000000078888888888880000000000000000000000 + 007880FFF7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7FF777777FFF77777FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F8F7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7F7F8888FF7F88888FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F8F7777777777777777777078888888888880F7F7F888FFF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F0788077777777777777777777770788C8888C88880F7FF888888FFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880F0F7777777FFFFFFFFFFFF0788CCCCCCCC880F77777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7F7F8888FF7F88888FF7 + F0788077777777777777777777770788C8888C88880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F7F7F8888FF7F888888F7 + F0788077777777777777777777770788CCCC8CC8880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCCCCCC880F7FF88888FFFFFFFFFFF7 + F07880F0F777777FFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F77777777777777777777 + F078800000000000000000000000078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F888888880F88888888888078888888888880F77777777777777777777 + F07880F800008880F80000000008078888888888880F77777777777777777777 + F07880FFFFFFFFF0FFFFFFFFFFFF078888888888880FFFFFFFFFFFFFFFFFFFFF + F078800000000000000000000000088888888888880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlExpanding: TBevel + Left = 62 + Top = 72 + Width = 248 + Height = 4 + Shape = bsBottomLine + end + object lblDetails: TLabel + Left = 5 + Top = 204 + Width = 32 + Height = 13 + Caption = 'Details' + end + object bvlDetails: TBevel + Left = 47 + Top = 209 + Width = 265 + Height = 4 + Shape = bsBottomLine + end + object imgDetails: TImage + Left = 9 + Top = 225 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0889999999999999999999907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897F78FF7FF77777788F907DDDDDDDDDDDD0FF777FFFF7FFF7777FFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDDDDDDDDDDD0FF777777F7FF77777777F + F07DD0889777777777777777777907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCDDDDCDDDD0777777777777777777777 + 707DD08897F777F7FF7777888FF907DDCCCCDCCDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCCCCCCCCDD0FF7777FFF7FF7777777FF + F07DD0889777777777777777777907DDCCCCDCCDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCDDDDCDDDD0777777777777777777777 + 707DD08897F788F7FF77778FFFF907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDDDDDDDDDDD0FF777777F7FF777777777 + F07DD0889777777777777777777907DDCDDDDCDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCCCCDCCDDD0777777777777777777777 + 707DD08897F888F7FF7777788FF907DDCCCCCCCCDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCCCCDCCDDD0FF77777FF7FF7777777FF + F07DD0889000000000000000000907DDCDDDDCDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897888880F8888888888907DDDDDDDDDDDD0777777777777777777777 + 707DD08897F77780F8777777778907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFF80FFFFFFFFFFF907DDDDDDDDDDDD0FF7777FFF7FF7777777FF + F07DD0889000000000000000000907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD0889999999999999999999907DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFFFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD0F0F777777FF77777777FFF07DDDDDDDDDDDD0FF77777FF7FF77777777F + F07DD0FFFFFFFFFFFFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F888888880F8888888888807DDDDDDDDDDDD0F888888880F8888888888 + 807DD0F877778880F8777777777807DDDDDDDDDDDD0F877777880F8777777778 + 807DD0FFFFFFFFF0FFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFF0FFFFFFFFFFF + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgLevels: TImage + Left = 9 + Top = 288 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDD77777777777777777777 + 7777D0000000000000000000000007DDDDDDDDDDDDD000000000000000000000 + 0007D0888888888888888888888807DDDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFF + FF07D0F000FF8F000FF8FCCCC44F07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7F77F8F77F7F8FCC99F + 7F07D0888888888888888888888807DDDDDDDDDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0FFFFFF8FFFFFF8F666CCCF07DDDDDDDDDDDDD0F7F77F8F777FF8FCC99F + 7F07D0F0000F8F00F0F8F999999F07DDCDDDDCDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDCCCCDCCDDDD0F7888888888888888888 + 7F07D0888888888888888888888807DDCCCCCCCCDDD0F7F77F8F777FF8FC99CF + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDCCCCDCCDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0F00FFF8F0000F8F9999CCF07DDCDDDDCDDDDD0F7888888888888888888 + 7F07D0FFFFFF8FFFFFF8F99AAACF07DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0F0000F8F000FF8F9999CCF07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0888888888888888888888807DDDDDDDDDDDDD0F0000000000000000000 + 0F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFF + FF07D0F0000F8F000FF8FB99944F07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7F77F8F7777F8F777FF + 7F07D0777777777777777777777707DDDDDDDDDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0F888887F888887F888888807DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0F000087F800087F800000807DDDDDDDDDDDDD0F7F77F8F7777F8F777FF + 7F07D0F888887F888887F888888807DDDDDDDDDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0FFFFFF7FFFFFF7FFFFFFFF07DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0000000000000000000000007DDCDDDDCDDDDD0F7888888888888888888 + 7F07D7F88880777777777777777778DDCCCCDCCDDDD0F7777777777777777777 + 7F07D7F00080F87777788088888888DDCCCCCCCCDDD0F7777777777777777777 + 7F07D7F77780FFFFFFFFF088888888DDCCCCDCCDDDD0F0000000000000000000 + 0F07D7FFFFF0777777777088888888DDCDDDDCDDDDD0FFFFFFFFFFFFFFFFFFFF + FF07D7777770888888888888888888DDDDDDDDDDDDD000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblLevels: TLabel + Left = 5 + Top = 267 + Width = 30 + Height = 13 + Caption = 'Levels' + end + object bvlLevels: TBevel + Left = 47 + Top = 272 + Width = 265 + Height = 4 + Shape = bsBottomLine + end + object lblGridSize: TLabel + Left = 5 + Top = 140 + Width = 19 + Height = 13 + Caption = 'Size' + end + object bvlGridSize: TBevel + Left = 33 + Top = 144 + Width = 277 + Height = 4 + Shape = bsBottomLine + end + object imgGridSize: TImage + Left = 9 + Top = 162 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000008088F07DDDDDDDDDDDD0800000000000000000000 + 807DD0F0FFFF8FFFF8FFFF0FFF0F07DDDDDDDDDDDD0F0F77FFF8F777F8F777F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCDDDDCDDDD0F0F00FFF8F00FF8F00FF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCCCCCDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCDDDDCDDDD0F0FFFFFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCCCCDCCDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCCCCCDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCDCCDDD0F0FFFFFF8F0FFF8F0FFF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0777777777777770FFF0F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F0F8887F8887F8880FFF8F07DDDDDDDDDDDD0F0F888887F88887F88880 + F07DD0F0F0087F0087F0080FFF0F07DDDDDDDDDDDD0F0F800087F80087F80080 + F07DD0F0FFFF7FFFF7FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF7FFFFF7FFFFF0 + F07DD0800000000000000008080807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxProcessSelection: TCheckBox + Left = 90 + Top = 25 + Width = 200 + Height = 17 + Caption = 'Process Selection' + TabOrder = 0 + OnClick = OptionsSelectionClick + end + object chbxProcessExactSelection: TCheckBox + Tag = 1 + Left = 90 + Top = 46 + Width = 200 + Height = 17 + Caption = 'Process Exact Selection' + TabOrder = 1 + OnClick = OptionsSelectionClick + end + object chbxExpandGroupRows: TCheckBox + Left = 90 + Top = 82 + Width = 200 + Height = 17 + Caption = 'Groups' + TabOrder = 2 + OnClick = OptionsExpandingClick + end + object chbxExpandMasterRows: TCheckBox + Tag = 1 + Left = 90 + Top = 104 + Width = 200 + Height = 17 + Caption = 'Details' + TabOrder = 3 + OnClick = OptionsExpandingClick + end + object chbxStartFromActiveView: TCheckBox + Left = 90 + Top = 222 + Width = 200 + Height = 17 + Caption = 'Start From Active Details' + TabOrder = 6 + OnClick = OptionsDetailsClick + end + object chbxOnlyActiveView: TCheckBox + Tag = 1 + Left = 90 + Top = 244 + Width = 200 + Height = 17 + Caption = 'Only Active Details' + TabOrder = 7 + OnClick = OptionsDetailsClick + end + object chbxLevelsUnwrap: TCheckBox + Left = 90 + Top = 285 + Width = 200 + Height = 17 + Caption = '&Unwrap' + TabOrder = 8 + OnClick = OptionsLevelsClick + end + object chbxLevelsUnwrapTopLevel: TCheckBox + Tag = 1 + Left = 90 + Top = 308 + Width = 200 + Height = 17 + Caption = 'Unwrap Top Level' + TabOrder = 9 + OnClick = OptionsLevelsClick + end + object chbxLevelsRiseActiveLevelOntoTop: TCheckBox + Tag = 2 + Left = 90 + Top = 331 + Width = 200 + Height = 17 + Caption = 'Rise Active Level onto Top' + TabOrder = 10 + OnClick = OptionsLevelsClick + end + object chbxGridAutoWidth: TCheckBox + Left = 90 + Top = 159 + Width = 200 + Height = 17 + Caption = '&Auto Width' + TabOrder = 5 + OnClick = OptionsSizeClick + end + object chbxExpandCards: TCheckBox + Tag = 2 + Left = 90 + Top = 125 + Width = 200 + Height = 17 + Caption = 'Cards' + TabOrder = 4 + OnClick = OptionsExpandingClick + end + object chbxLevelsSkipEmptyViews: TCheckBox + Tag = 3 + Left = 90 + Top = 353 + Width = 200 + Height = 17 + Caption = 'Skip Empty Views' + TabOrder = 11 + OnClick = OptionsLevelsClick + end + end + object tshFormatting: TTabSheet + Caption = 'Formatting' + ImageIndex = 4 + object lblLookAndFeel: TLabel + Left = 5 + Top = 8 + Width = 66 + Height = 13 + Caption = 'Look and Feel' + end + object bvlLookAndFeel: TBevel + Left = 85 + Top = 12 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object imgLookAndFeel: TImage + Left = 9 + Top = 28 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D08777777777780877777788807DCCCCDCCDDD0877777777778787777788 + 8F07D08888888888880888888888807DCCCCCCCCDD0888888888888788888888 + 8F07D00000000000000000000000007DCCCCDCCDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F7777777FF07DDDDDDDDDDD0F777777777FF7F7777777 + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F777777FFF07DDDDDDDDDDD0F777777FFFFF7F777777F + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F7777777777F7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F77777FFFF07DDDDDDDDDDD0F77777777FFF7F77777FF + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D00000000000000000000000007DCDDDDCDDDD0000000000000000000000 + 0007D08888888888880888888888807DCCCCDCCDDD0777777777777777777777 + 7707D08888888888880888888888807DCCCCCCCCDD0F88888888888788888888 + 8707D08000000008880880000000807DCCCCDCCDDD0F00000000888788000000 + 8707D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + F707D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgRefinements: TImage + Left = 9 + Top = 95 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FF7FFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF777777F + F07DD0F77777777FF7FF70888FFF07DDCCCCCCCCDD0F77777777FF7FF7FFFF7F + F07DD0FFFFFFFFFFF7FF70FF8FFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF7F00F7F + F07DD0F777777FFFF7FF70FF8FFF07DDCDDDDCDDDD0F777777FFFF7FF7F00F7F + F07DD0FFFFFFFFFFF7FF70000FFF07DDDDDDDDDDDD0FFFFFFFFFFF7FF7FFFF7F + F07DD0F77777777FF7FF777777FF07DDDDDDDDDDDD0F77777777FF7FF777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFCCCCCFFF07DDCCCCCCCCDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FCCCCCCCFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F7777777FFF7FFCCCCCFFF07DDCDDDDCDDDD0F7777777FFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7F9999999FF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F777777777F7FF99999FFF07DDDDDDDDDDDD0F777777777F7F7777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F80000888887F88888888707DDDDDDDDDDDD0F80000888887F88888888 + 707DD0F80000000087F80000008707DDDDDDDDDDDD0F80000000087F80000008 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0FFFFFFFFFFF7FFFFFFFFF707DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + 707DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblRefinements: TLabel + Left = 5 + Top = 74 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlRefinements: TBevel + Left = 70 + Top = 79 + Width = 241 + Height = 4 + Shape = bsBottomLine + end + object bvlRefinementsSeparator: TBevel + Left = 90 + Top = 168 + Width = 221 + Height = 4 + Shape = bsBottomLine + end + object lblPagination: TLabel + Left = 5 + Top = 229 + Width = 50 + Height = 13 + Caption = 'Pagination' + end + object bvlPagination: TBevel + Left = 64 + Top = 234 + Width = 247 + Height = 4 + Shape = bsBottomLine + end + object imgPagination: TImage + Left = 8 + Top = 251 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDD0000000000000000000000007DDDDDDDDDDDD77777777777777770DDDDD + DDDDD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD7FFFFFFFFFFFFFFF0DDDDD + DDDDD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD7F8888888888888F0DDDDD + DDDDD0888000000000000000088F07DDDDDDDDDDDD7F8777877778778F07770D + DDDDD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7F8888888888888F0FFF0D + DDDDD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F088F0D + DDDDD0F9F0F00F8F00F8F00F0F9F07DDDDDDDDDDDD7F8888888888888F078F07 + 770DD0F990FFFF8FFFF8FFFF099F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F088F0F + FF0DD0F99999999999999999999F07DDCDDDDCDDDD7F8FFF8FFFF8FF8F0F8F08 + 8F0DD0F990FFFF8FFFF8FFFF099F07DDCCCCDCCDDD7F8888888888888F088F07 + 8F0DD0F9F0FFFF8F00F8F00F0F9F07DDCCCCCCCCDD7F8FFF8FFFF8FF8F0F8F08 + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDCCCCDCCDDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F8F0FFFF8F00F8F00F0F8F07DDCDDDDCDDDD7F8888888888888F088F08 + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F9F0F00F8F00F8F00F0F9F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F990FFFF8FFFF8FFFF099F07DDCDDDDCDDDD7F8888888888888F088F0F + 8F0DD0F99999999999999999999F07DDCCCCDCCDDD7F8FFF8FFFF8FF8F0F8F08 + 8F0DD0F990FFFF8FFFF8FFFF099F07DDCCCCCCCCDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F9F0FFFF8F00F8F00F0F9F07DDCCCCDCCDDD7F8888888888888F088F0F + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDCDDDDCDDDD7F8777877778778F0F8F08 + 8F0DD0F8F0F00F8F00F8F00F0F8F07DDDDDDDDDDDD7F8888888888888F0F8F0F + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7FFFFFFFFFFFFFFF088F0F + 8F0DD0F8F0777777777777770F8F07DDDDDDDDDDDD0000000000000000078F08 + 8F0DD0F8F0F8887F8887F8880F8F07DDDDDDDDDDDDDDDD7F8888888888888F0F + 8F0DD0F8F0F0087F0087F0080F8F07DDDDDDDDDDDDDDDD7FFFFFFFFFFFFFFF08 + 8F0DD0F8F0FFFF7FFFF7FFFF0F8F07DDDDDDDDDDDDDDDD00000000000000000F + 8F0DD0888000000000000000088807DDDDDDDDDDDDDDDDDDDD7F888888888888 + 8F0DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDDDDDDDDDD7FFFFFFFFFFFFF + FF0DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDDDDDDDDDD00000000000000 + 000DD000000000000000000000000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object cbxLookAndFeel: TComboBox + Left = 90 + Top = 33 + Width = 212 + Height = 21 + Style = csDropDownList + ItemHeight = 0 + TabOrder = 0 + OnClick = LookAndFeelClick + end + object chbxFlatCheckMarks: TCheckBox + Tag = 2 + Left = 90 + Top = 142 + Width = 200 + Height = 17 + Caption = 'Flat Check &Marks' + TabOrder = 3 + OnClick = OptionsRefinementClick + end + object chbxDisplayGraphicsAsText: TCheckBox + Tag = 1 + Left = 90 + Top = 119 + Width = 200 + Height = 17 + Caption = 'Display Graphics As &Text' + TabOrder = 2 + OnClick = OptionsRefinementClick + end + object chbxTransparentGraphics: TCheckBox + Left = 90 + Top = 96 + Width = 200 + Height = 17 + Caption = 'Transparent &Graphics' + TabOrder = 1 + OnClick = OptionsRefinementClick + end + object chbxSuppressBackgroundBitmaps: TCheckBox + Tag = 1 + Left = 90 + Top = 181 + Width = 200 + Height = 17 + Caption = 'Suppress Background Images' + TabOrder = 4 + OnClick = OptionsFormatingClick + end + object chbxConsumeSelectionStyle: TCheckBox + Tag = 2 + Left = 90 + Top = 203 + Width = 200 + Height = 17 + Caption = 'Consume Selection Style' + TabOrder = 5 + OnClick = OptionsFormatingClick + end + object chbxPaginateOneGroupPerPage: TCheckBox + Tag = 1 + Left = 90 + Top = 274 + Width = 200 + Height = 17 + Caption = 'One Group Per Page' + TabOrder = 7 + OnClick = OptionsPaginationClick + end + object chbxPaginateByTopLevelGroups: TCheckBox + Left = 90 + Top = 251 + Width = 200 + Height = 17 + Caption = 'By TopLevel Groups' + TabOrder = 6 + OnClick = OptionsPaginationClick + end + end + object tshStyles: TTabSheet + Caption = 'Styles' + ImageIndex = 5 + object bvlStyles: TBevel + Left = 118 + Top = 12 + Width = 191 + Height = 4 + Shape = bsBottomLine + end + object bvlStyleSheets: TBevel + Left = 72 + Top = 295 + Width = 237 + Height = 5 + Shape = bsBottomLine + end + object lblStyleSheets: TLabel + Left = 6 + Top = 291 + Width = 60 + Height = 13 + Caption = 'Style Sheets' + end + object bvlStylesHost: TBevel + Left = 6 + Top = 33 + Width = 228 + Height = 219 + end + object Label1: TLabel + Left = 76 + Top = 135 + Width = 68 + Height = 13 + Caption = '[ Styles Host ]' + Visible = False + end + object lblUseNativeStyles: TLabel + Left = 24 + Top = 9 + Width = 84 + Height = 13 + Caption = '&Use Native Styles' + FocusControl = chbxUseNativeStyles + OnClick = lblUseNativeStylesClick + end + object btnStyleColor: TButton + Left = 243 + Top = 61 + Width = 68 + Height = 23 + Caption = 'Co&lor...' + TabOrder = 2 + OnClick = StyleColorClick + end + object btnStyleFont: TButton + Left = 243 + Top = 33 + Width = 68 + Height = 23 + Caption = '&Font...' + TabOrder = 1 + OnClick = StyleFontClick + end + object btnStyleBackgroundBitmap: TButton + Left = 243 + Top = 97 + Width = 68 + Height = 23 + Caption = '&Bitmap...' + TabOrder = 3 + OnClick = StyleBackgroundBitmapClick + end + object chbxUseNativeStyles: TCheckBox + Left = 5 + Top = 8 + Width = 14 + Height = 17 + TabOrder = 0 + OnClick = OptionsFormatingClick + end + object cbxStyleSheets: TComboBox + Left = 6 + Top = 311 + Width = 302 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 7 + OnClick = cbxStyleSheetsClick + OnDrawItem = cbxStyleSheetsDrawItem + OnKeyDown = cbxStyleSheetsKeyDown + end + object btnStyleSheetNew: TButton + Left = 6 + Top = 343 + Width = 71 + Height = 23 + Caption = '&New...' + TabOrder = 8 + OnClick = StyleSheetNewClick + end + object btnStyleSheetCopy: TButton + Left = 83 + Top = 343 + Width = 71 + Height = 23 + Caption = '&Copy...' + TabOrder = 9 + OnClick = StyleSheetCopyClick + end + object btnStyleSheetDelete: TButton + Left = 160 + Top = 343 + Width = 71 + Height = 23 + Caption = '&Delete...' + TabOrder = 10 + OnClick = StyleSheetDeleteClick + end + object btnStylesSaveAs: TButton + Left = 123 + Top = 259 + Width = 112 + Height = 23 + Caption = 'Save &As...' + TabOrder = 6 + OnClick = StylesSaveAsClick + end + object btnStyleSheetRename: TButton + Left = 237 + Top = 343 + Width = 71 + Height = 23 + Caption = '&Rename...' + TabOrder = 11 + OnClick = StyleSheetRenameClick + end + object btnStyleBackgroundBitmapClear: TButton + Left = 243 + Top = 125 + Width = 68 + Height = 23 + Caption = 'Cle&ar' + TabOrder = 4 + OnClick = StyleBackgroundBitmapClearClick + end + object btnStyleRestoreDefaults: TButton + Left = 6 + Top = 259 + Width = 112 + Height = 23 + Caption = 'Rest&ore Defaults' + TabOrder = 5 + OnClick = StyleRestoreDefaultsClick + end + end + object tshPreview: TTabSheet + Caption = 'Preview' + ImageIndex = 2 + object lblPreviewOptions: TLabel + Left = 5 + Top = 8 + Width = 37 + Height = 13 + Caption = 'Options' + end + object bvlPreviewOptions: TBevel + Left = 50 + Top = 12 + Width = 261 + Height = 4 + Shape = bsBottomLine + end + object lblPreviewMaxLineCount: TLabel + Left = 91 + Top = 73 + Width = 78 + Height = 13 + Caption = 'Max Line Count:' + end + object bvlPreviewMaxLineCountHost: TBevel + Left = 229 + Top = 69 + Width = 68 + Height = 21 + Visible = False + end + object imgPreview: TImage + Left = 9 + Top = 28 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDD7777777777777777777777777DDDDDD0000000000000000000000000 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F888F7FF888F7F8888F7F07DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F0 + 7DDDDDD0F777777777777777777777F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCFFCCCCFFCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCFCCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCFCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCFCCFCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCFFCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F777777777777777777777F07DDDDDD0F7F888F7FF888F7FF888F7F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F88887F888887F888887F07DDDDDD0F7F00087F000087F000087F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0000000000000000000000000 + DDDD} + Transparent = True + end + object chbxPreviewVisible: TCheckBox + Left = 90 + Top = 28 + Width = 150 + Height = 17 + Caption = 'Visible' + TabOrder = 0 + OnClick = PreviewVisibleClick + end + object chbxPreviewAutoHeight: TCheckBox + Left = 90 + Top = 49 + Width = 150 + Height = 17 + Caption = 'Auto Height' + TabOrder = 1 + OnClick = PreviewAutoHeightClick + end + end + object tshCards: TTabSheet + Caption = 'Cards' + ImageIndex = 3 + object bvlCardSpaceVertHost: TBevel + Left = 231 + Top = 140 + Width = 75 + Height = 21 + Visible = False + end + object bvlCardSpaceHorzHost: TBevel + Left = 231 + Top = 112 + Width = 75 + Height = 21 + Visible = False + end + object lblCardSpaceVert: TLabel + Left = 90 + Top = 145 + Width = 39 + Height = 13 + Caption = 'Vertical:' + end + object lblCardSpaceHorz: TLabel + Left = 90 + Top = 116 + Width = 52 + Height = 13 + Caption = 'Horizontal:' + end + object imgCardSpacing: TImage + Left = 9 + Top = 112 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDD0DD0DDDDDDDDDDDDDDDDDD0DD0DDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDD00D0DDDDDDDDDDDDDDDDDD0D00DDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDD000000000000000000000000000000DDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDD00D0DDDDDDDDDDDDDDDDDD0D00DDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDD7DD0DDDDDD707000DDDDDD0DD7DDDDDDDDDDDDDDD + DDDDDDDDD0000000000000000000DDDDDD0D0D0DDDDDD0000000000000000000 + 0DDDDDDD77777777777777777770DDDDD00D0D0DDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDD0D000DDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7FFFFFFF7FFF9999FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFF9999FF7 + 0DDDDDDD7FFFFFFF7FFF9999FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFF9999FF7 + 0DDDDDDD7FFFFFFF7FCCCC99FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FCCCC99FF7 + 0DDDDDDD7FFFFFFF7FCCCC99FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FCCCC99FF7 + 0DDDDDDD7F77777F7FCCCCFFFF70DDDDDDDDDDDDDDDDD7F77777F7FCCCCFFFF7 + 0DDDDDDD7F77777F7FCCCCFFFF70DDDDDDDDDDDDDDDDD7F77777F7FCCCCFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD77777777777777777770DDDDDDDDDDDDDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7F77777F7FF777777F70DDDDDDDDDDDDDDDDD7F77777F7FF777777F7 + 0DDDDDDD7F7FFFFF7FF7FFFFFF70DDDDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD77777777777777777770DDDDDDDDDDDDDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7F77777F7FF77777FF70DDDDDDDDDDDDDDDDD7F77777F7FF777777F7 + 0DDDDDDD7F7FFFFF7FF77FFFFF70DDDDDDDDDDDDDDDDD7F7FFFFF7FF77FFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD77777777777777777770DDDDDDDDDDDDDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7F77777F7FF777777F70DDDDDDDDDDDDDDDDD7F77777F7FF777777F7 + 0DDDDDDD7F7FFFFF7FF7FFFFFF70DDDDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7777777777777777777DDDDDDDDDDDDDDDDDD7777777777777777777 + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblCardSpacing: TLabel + Left = 5 + Top = 92 + Width = 37 + Height = 13 + Caption = 'Spacing' + end + object bvlCardSpacing: TBevel + Left = 51 + Top = 97 + Width = 260 + Height = 4 + Shape = bsBottomLine + end + object bvlCardSizes: TBevel + Left = 34 + Top = 12 + Width = 277 + Height = 4 + Shape = bsBottomLine + end + object lblCardSizes: TLabel + Left = 5 + Top = 8 + Width = 24 + Height = 13 + Caption = 'Sizes' + end + object imgCardSizes: TImage + Left = 9 + Top = 28 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDD000000000000DDDDDDDDDDDDDDDDDDDDDDDD000000000000DD00000000 + 0000D7777777777770DDDDDDDDDDDDDDDDDDDDDDD7777777777770D777777777 + 7770D7FFFFF8FFFF70DDDDDDDDDDDDDDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8FFFF70DDDDDDDDDDDDDDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70DDDDDDDDDDDDDDDDDDDDDDD7FFFFF8F77F70D7FFFFF8FF + FF70D7FFFFF8FFFF70DDDDDDDDDDDDDDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70DD0000000000DDCCCCDCCDD7FFFFF8F77F70D7FFFFF8FF + FF70D7FFFFF8FFFF70D77777777770DDCCCCCCCCD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70D7FFFF8FFF70DDCCCCDCCDD7FFFFF8F77F70D7FFFFF8FF + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70D7FFFF8F7F70DDDDDDDDDDD7FFFFF8F77F70D7FFFFF8F7 + FF70D7F777F8FFFF70D7FFFF8FFF70DDDDDDDDDDD7F777F8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDDDDDDDDDD7F777F8F77F70D7F77FF8F7 + 7F70D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7888888888870D78888888870DDDDDDDDDDD7888888888870D788888888 + 8870D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDDDDDDDDDD7F777F8F77F70D7F77FF8F7 + FF70D7F777F8FFFF70D7F77F8F7F70DDDDDDDDDDD7F777F8FFFF70D7F77FF8F7 + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7888888888870D78888888870DDDDDDDDDDD7888888888870D788888888 + 8870D7FFFFF8FFFF70D7FFFF8FFF70DDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDCCCCDCCDD7F777F8F77F70D7F77FF8F7 + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDCCCCCCCCD7FFFFF8FFFF70D7FFFFF8FF + FF70D7888888888870D78888888870DDCCCCDCCDD7888888888870D788888888 + 8870D7FFFFF8FFFF70D7FFFF8FFF70DDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDDDDDDDDDD7F777F8F77F70D7F77FF8F7 + FF70D7F7FFF8FFFF70D7F7FF8F7F70DDDDDDDDDDD7F7FFF8FFFF70D7F7FFF8F7 + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D777777777777DD7777777777DDDDDDDDDDDD777777777777DD777777777 + 777DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgCardFraming: TImage + Left = 9 + Top = 189 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDD7777777777777777777DDDDDDDDDDDDDDDDDD00000000000000000 + 00DDDDDDD88888888888888888887DDDDDDDDDDDDDDDDD000000000000000000 + 00DDDDDDD8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDDDDD0FFFFFFF0FFFFFFFFF + 00DDDDD778FFFFFFF8FFF9999FF87DDDDDDDDDDDDDDD000FFFFFFF0FFF9999FF + 00DDDD8888FFFFFFF8FFF9999FF87DDDDDDDDDDDDDD0000FFFFFFF0FFF9999FF + 00DDDD8FF8FFFFFFF8FCCCC99FF87DDDCDDDDCDDDDD0FF0FFFFFFF0FCCCC99FF + 00DDDD8FF8FFFFFFF8FCCCC99FF87DDDCCCCDCCDDDD0FF0FFFFFFF0FCCCC99FF + 00DDDD8FF8F77777F8FCCCCFFFF87DDDCCCCCCCCDDD0FF0F77777F0FCCCCFFFF + 00DDDD8FF8F77777F8FCCCCFFFF87DDDCCCCDCCDDDD0FF0F77777F0FCCCCFFFF + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDCDDDDCDDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDDDDDDDDDDDD0F7000000000000000000 + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF777777F87DDDDDDDDDDDDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF7FFFFFF87DDDDDDDDDDDDDD0000F7FFFFF0FF7FFFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDDDDDDDDDDDD0F7000000000000000000 + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF77777FF87DDDDDDDDDDDDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF77FFFFF87DDDDDDDDDDDDDD0000F7FFFFF0FF77FFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDCDDDDCDDDDD0F7000000000000000000 + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDCCCCDCCDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF777777F87DDDCCCCCCCCDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF7FFFFFF87DDDCCCCDCCDDDD0000F7FFFFF0FF7FFFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDCDDDDCDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F78888888888888888888DDDDDDDDDDDDDDD0F7000000000000000000 + 0DDDDD8F7FFFFF8FF7FFFFFF87DDDDDDDDDDDDDDDDD0F7FFFFF0FF7FFFFFF00D + DDDDDD8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDDDDD0FFFFFFF0FFFFFFFFF00D + DDDDDD8888888888888888888DDDDDDDDDDDDDDDDDD0000000000000000000DD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblCardFraming: TLabel + Left = 5 + Top = 171 + Width = 38 + Height = 13 + Caption = 'Framing' + end + object bvlCardFraming: TBevel + Left = 49 + Top = 176 + Width = 262 + Height = 4 + Shape = bsBottomLine + end + object bvlCardShadowColorHost: TBevel + Left = 177 + Top = 276 + Width = 129 + Height = 21 + Visible = False + end + object lblCardShadowDepth: TLabel + Left = 90 + Top = 308 + Width = 33 + Height = 13 + Caption = 'Depth:' + end + object bvlCardShadow: TBevel + Left = 48 + Top = 260 + Width = 263 + Height = 4 + Shape = bsBottomLine + end + object lblCardShadow: TLabel + Left = 5 + Top = 255 + Width = 38 + Height = 13 + Caption = 'Shadow' + end + object lblCardShadowColor: TLabel + Left = 90 + Top = 280 + Width = 29 + Height = 13 + Caption = 'Color:' + end + object bvlCardShadowDepthHost: TBevel + Left = 177 + Top = 304 + Width = 129 + Height = 21 + Visible = False + end + object imgCardShadow: TImage + Left = 9 + Top = 276 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD0000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD0000000000000000000 + 000DDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDCDDDDCDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7FFFFFFF7FFF9999FFFFF7DDDDCCCCDCCDDDD7FFFFFFF7FFF9999FFFFF + 700DDD7FFFFFFF7FFF9999FFFFF7DDDDCCCCCCCCDDD7FFFFFFF7FFF9999FFFFF + 700DDD7FFFFFFF7FCCCC99FFFFF7DDDDCCCCDCCDDDD7FFFFFFF7FCCCC99FFFFF + 700DDD7FFFFFFF7FCCCC99FFFFF7DDDDCDDDDCDDDDD7FFFFFFF7FCCCC99FFFFF + 700DDD7F77777F7FCCCCFFFFFFF7DDDDDDDDDDDDDDD7F77777F7FCCCCFFFFFFF + 700DDD7F77777F7FCCCCFFFFFFF7DDDDDDDDDDDDDDD7F77777F7FCCCCFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7F77777F7FF777777FFFF7DDDDDDDDDDDDDDD7F77777F7FF777777FFFF + 700DDD7F7FFFFF7FF7FFFFFFFFF7DDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7F77777F7FF77777FFFFF7DDDDCDDDDCDDDDD7F77777F7FF77777FFFFF + 700DDD7F7FFFFF7FF77FFFFFFFF7DDDDCCCCDCCDDDD7F7FFFFF7FF77FFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDCCCCCCCCDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7777777777777777777777DDDDCCCCDCCDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDCDDDDCDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7F77777F7FF777777FFFF7DDDDDDDDDDDDDDD7F77777F7FF777777FFFF + 700DDD7F7FFFFF7FF7FFFFFFFFF7DDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 7DDDDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 7DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxCardsKeepSameHeight: TCheckBox + Tag = 2 + Left = 90 + Top = 70 + Width = 200 + Height = 17 + Caption = 'Keep Same Height' + TabOrder = 2 + OnClick = OptionsCardsClick + end + object chbxCardsKeepSameWidth: TCheckBox + Tag = 1 + Left = 90 + Top = 49 + Width = 200 + Height = 17 + Caption = 'Keep Same Width' + TabOrder = 1 + OnClick = OptionsCardsClick + end + object chbxCardsAutoWidth: TCheckBox + Left = 90 + Top = 28 + Width = 200 + Height = 17 + Caption = 'Auto Width' + TabOrder = 0 + OnClick = OptionsCardsClick + end + object chbxCardsVertLines: TCheckBox + Tag = 5 + Left = 90 + Top = 231 + Width = 200 + Height = 17 + Caption = 'Vertical Lines' + TabOrder = 5 + OnClick = OptionsCardsClick + end + object chbxCardsHorzLines: TCheckBox + Tag = 4 + Left = 90 + Top = 210 + Width = 200 + Height = 17 + Caption = 'Horizontal Lines' + TabOrder = 4 + OnClick = OptionsCardsClick + end + object chbxCardsBorder: TCheckBox + Tag = 3 + Left = 90 + Top = 189 + Width = 200 + Height = 17 + Caption = 'Border' + TabOrder = 3 + OnClick = OptionsCardsClick + end + end + object tshCharts: TTabSheet + Caption = 'Charts' + ImageIndex = 6 + object lblChartsOptions: TLabel + Left = 5 + Top = 8 + Width = 37 + Height = 13 + Caption = 'Options' + end + object imgCharts: TImage + Left = 9 + Top = 28 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDD777777777777777777777777DDDDDDD000000000000000000000000 + 7DDDDDDD0887FFFFFFFFFFFFFFFFFFF07DDDDDDD0887F8888888888888888880 + 7DDDDDDD0887F8FC491A2FFC491A2FF07DDDDDDD0887F8FC491A2FFC491A2FF0 + 7DDDDDDD0887F8FC4FFA2FFC491A2FF07DDDDDDD0887F8FC4FFA2FFC4FFA2FF0 + 7DDDDDDD0887F8FFFFFFFFFFFFFFFFF07DDDDDDD088777777777777777777770 + 7DDDDDDD0888888888888888888888807DDDDDDD087807777777788888888880 + 7DDDDDDD0888888888888888888888807DDDDDDD077777777777777777777770 + 7DDDDDDD0887FFFFFFFFFFFFFFFFFFF07DDDDDDD0887F8888888888888888880 + 7DDDDDDD0887F8FC491A2FFC491A2FF07DDDDDDD0887F8FC491A2FFC491A2FF0 + 7DDDDDDD0887F8FC491FFFFC491A2FF07DDDDDDD0887F8FFF91FFFFC4FFA2FF0 + 7DDDDDDD0887F8FFFFFFFFFFFFFFFFF07DDDDDDD088777777777777777777770 + 7DDDDDDD0888888888888888888888807DDDDDDD087800777777788888888880 + 7DDDDDDD0888888888888888888888807DDDDDDD077777777777777777777770 + 7DDDDDDD0F8888887F888888888888807DDDDDDD0F8000087F80000000088880 + 7DDDDDDD0F8888887F888888888888807DDDDDDD0FFFFFFF7FFFFFFFFFFFFFF0 + 7DDDDDDD000000000000000000000000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object bvlChartsOptions: TBevel + Left = 57 + Top = 12 + Width = 254 + Height = 4 + Shape = bsBottomLine + end + object chbxChartsTransparent: TCheckBox + Left = 90 + Top = 28 + Width = 200 + Height = 17 + Caption = 'Transparent' + TabOrder = 0 + OnClick = chbxChartsTransparentClick + end + end + end + object pnlPreview: TPanel + Left = 331 + Top = 44 + Width = 306 + Height = 350 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + object PreviewGrid: TcxGrid + Left = 5 + Top = 7 + Width = 296 + Height = 337 + TabOrder = 0 + LookAndFeel.NativeStyle = False + RootLevelOptions.DetailTabsPosition = dtpTop + object PreviewBandedView: TcxGridBandedTableView + NavigatorButtons.ConfirmDelete = False + FilterBox.CustomizeDialog = False + FilterBox.Visible = fvAlways + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'Count = 0' + Kind = skCount + Position = spFooter + Column = colVendorName + end> + DataController.Summary.FooterSummaryItems = < + item + Format = 'Count = 0' + Kind = skCount + Column = colVendorName + end> + DataController.Summary.SummaryGroups = <> + OptionsView.ScrollBars = ssNone + OptionsView.CellAutoHeight = True + OptionsView.ColumnAutoWidth = True + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.GroupFooters = gfAlwaysVisible + Preview.Column = colVendorCountry + Preview.Visible = True + OnCustomDrawColumnHeader = PreviewBandedViewCustomDrawColumnHeader + OnCustomDrawFooterCell = PreviewBandedViewCustomDrawFooterCell + Bands = < + item + Caption = 'Vendor Data' + Width = 150 + end + item + Caption = 'Car Data' + end> + OnCustomDrawBandHeader = PreviewBandedViewCustomDrawBandHeader + object colVendorName: TcxGridBandedColumn + Caption = 'Name' + PropertiesClassName = 'TcxTextEditProperties' + Options.Filtering = False + Position.BandIndex = 0 + Position.ColIndex = 0 + Position.RowIndex = 0 + end + object colVendorLogo: TcxGridBandedColumn + Caption = 'Logo' + PropertiesClassName = 'TcxImageProperties' + Properties.GraphicTransparency = gtTransparent + OnCustomDrawCell = VendorLogoCustomDrawCell + Options.Filtering = False + Position.BandIndex = 0 + Position.ColIndex = 1 + Position.RowIndex = 0 + end + object colVendorCountry: TcxGridBandedColumn + PropertiesClassName = 'TcxTextEditProperties' + Position.BandIndex = 0 + Position.ColIndex = 2 + Position.RowIndex = 0 + end + object colCarModel: TcxGridBandedColumn + Caption = 'Model' + PropertiesClassName = 'TcxTextEditProperties' + Options.Filtering = False + Position.BandIndex = 1 + Position.ColIndex = 0 + Position.RowIndex = 0 + end + object colIsSUVModel: TcxGridBandedColumn + Caption = 'SUV' + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.ValueGrayed = #39#39 + OnCustomDrawCell = IsSUVModelCustomDrawCell + HeaderAlignmentHorz = taCenter + Options.Filtering = False + Width = 30 + Position.BandIndex = 1 + Position.ColIndex = 1 + Position.RowIndex = 0 + end + end + object PreviewGridLevel: TcxGridLevel + Caption = 'Cars' + end + end + end + object pmStyles: TPopupMenu + Images = ilStylesPopup + OnPopup = pmStylesPopup + Left = 4 + Top = 408 + object miStyleFont: TMenuItem + Caption = '&Font...' + ImageIndex = 0 + OnClick = StyleFontClick + end + object miStyleColor: TMenuItem + Caption = '&Color...' + OnClick = StyleColorClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miStyleBackgroundBitmap: TMenuItem + Caption = '&Bitmap...' + ImageIndex = 1 + ShortCut = 16463 + OnClick = StyleBackgroundBitmapClick + end + object miStyleBackgroundBitmapClear: TMenuItem + Caption = 'Clear' + ImageIndex = 3 + ShortCut = 16430 + OnClick = StyleBackgroundBitmapClearClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miStyleRestoreDefaults: TMenuItem + Caption = 'Restore Defaults' + OnClick = StyleRestoreDefaultsClick + end + object milLine: TMenuItem + Caption = '-' + end + object miStylesSelectAll: TMenuItem + Caption = 'Select A&ll' + ShortCut = 16449 + OnClick = miStylesSelectAllClick + end + object miLine4: TMenuItem + Caption = '-' + end + object miStylesSaveAs: TMenuItem + Caption = 'Save &As...' + ImageIndex = 2 + ShortCut = 16467 + OnClick = StylesSaveAsClick + end + end + object ilStylesPopup: TImageList + Left = 32 + Top = 408 + Bitmap = { + 494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001001000000000000018 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000420042000000000000 + 0000000000001863186300000042000000000000000000000000000000000000 + 0000000000000000000000000000FF7F00000000000000000000000000000000 + 0000000000000000000000000000000000000000000000420042004200420042 + 0042004200420042000000000000000000000000000000420042000000000000 + 0000000000001863186300000042000000000000000000000000FF7F00000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000E07F00000042004200420042 + 0042004200420042004200000000000000000000000000420042000000000000 + 00000000000018631863000000420000000000000000000000000000FF7F0000 + 000000000000000000000000FF7F000000000000000000001042104210421042 + 1042104200000000000000000000000000000000FF7FE07F0000004200420042 + 0042004200420042004200420000000000000000000000420042000000000000 + 00000000000000000000000000420000000000000000000000000000FF7F0000 + 00000000000000000000FF7F0000000000000000000000000000000010421042 + 0000000000000000000000000000000000000000E07FFF7F1042000000420042 + 0042004200420042004200420042000000000000000000420042004200420042 + 004200420042004200420042004200000000000000000000000000000000FF7F + 00000000000000000000FF7F0000000000000000000000000000000010420000 + 0000000000000000000000000000000000000000FF7FE07F1042FF7F00000000 + 0000000000000000000000000000000000000000000000420042000000000000 + 0000000000000000000000420042000000000000000000000000000000000000 + FF7F000000000000FF7F00000000000000000000000000000000000010420000 + 0000000000000000000000000000000000000000E07FFF7F1042FF7FFF03FF7F + FF03FF7FFF03FF7FFF03FF7FFF7F000000000000000000420000186318631863 + 1863186318631863186300000042000000000000000000000000000000000000 + 000000000000FF7F000000000000000000000000000000000000000010420000 + 0000000000000000000000000000000000000000FF7FE07F1042FF7FFF7FFF03 + FF7FFF03FF7FFF03FF7FFF03FF7F000000000000000000420000186318631863 + 1863186318631863186300000042000000000000000000000000000000000000 + 00000000FF7F0000000000000000000000000000000010420000000010420000 + 0000000000000000000000000000000000000000E07FFF7F1042FF7FFF031863 + FF03FF7FFF03FF7FFF03FF7FFF7F000000000000000000420000186318631863 + 1863186318631863186300000042000000000000000000000000000000000000 + 000000000000FF7F000000000000000000000000000010420000000010421042 + 0000000010420000000000000000000000000000000000001042FF7F1863E07F + 1863FF03FF7FFF03FF7FFF03FF7F000000000000000000420000186318631863 + 1863186318631863186300000042000000000000000000000000000000000000 + FF7F00000000FF7F000000000000000000000000000010421042000010421042 + 0000104210420000000000000000000000000000000000001042FF7FFF031863 + FF03FF7FFF03FF7FFF03FF7FFF7F000000000000000000420000186318631863 + 186318631863186318630000000000000000000000000000000000000000FF7F + 00000000000000000000FF7F0000000000000000000010421042104210421042 + 1042104210420000000000000000000000000000000000001042FF7FFF7FFF7F + FF7FFF7FFF7FFF7FFF7FFF7FFF7F000000000000000000420000186318631863 + 18631863186318631863000018630000000000000000000000000000FF7F0000 + 000000000000000000000000FF7F000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000001042104210421042 + 1042104210421042104210421042104200000000000000000000000000000000 + 000000000000000000000000000000000000000000000000FF7F000000000000 + 0000000000000000000000000000FF7F00000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFC001FFFF + FE07001F8001FFF9FF9F000F8001E7FFFF9F00078001C3F3E01F00038001C3E7 + F99F00018001E1C7F99B00008001F08FF99B00018001F81FF89300018001FC3F + D80300018001F81FD9BF80018001F09FC93FE0018001C1C7C03FE001800183E3 + FFFFE00180018FF1FFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end + object cxStyleRepository1: TcxStyleRepository + Left = 60 + Top = 408 + object styleCardShadow: TcxStyle + end + object styleCardBorder: TcxStyle + AssignedValues = [svColor] + Color = clWindow + end + end +end diff --git a/official/x.35/Lib/D11/dxPScxGrid6LnkD11.bpl b/official/x.35/Lib/D11/dxPScxGrid6LnkD11.bpl new file mode 100644 index 00000000..896d6fe4 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxGrid6LnkD11.bpl differ diff --git a/official/x.35/Lib/D11/dxPScxGrid6LnkD11.dcp b/official/x.35/Lib/D11/dxPScxGrid6LnkD11.dcp new file mode 100644 index 00000000..3fb60256 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxGrid6LnkD11.dcp differ diff --git a/official/x.35/Lib/D11/dxPScxGrid6LnkD11.dcu b/official/x.35/Lib/D11/dxPScxGrid6LnkD11.dcu new file mode 100644 index 00000000..1c0179e6 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxGrid6LnkD11.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxGrid6LnkPredefinedStyleSheets.dcu b/official/x.35/Lib/D11/dxPScxGrid6LnkPredefinedStyleSheets.dcu new file mode 100644 index 00000000..96858531 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxGrid6LnkPredefinedStyleSheets.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxGrid6LnkPredefinedStyleSheets.dfm b/official/x.35/Lib/D11/dxPScxGrid6LnkPredefinedStyleSheets.dfm new file mode 100644 index 00000000..83221cdb --- /dev/null +++ b/official/x.35/Lib/D11/dxPScxGrid6LnkPredefinedStyleSheets.dfm @@ -0,0 +1,351 @@ +object dxdmPScxGridLnkPredefinedStyles: TdxdmPScxGridLnkPredefinedStyles + OldCreateOrder = False + Left = 352 + Top = 156 + Height = 150 + Width = 215 + object StyleRepository: TcxStyleRepository + Left = 37 + Top = 12 + object styleProfessionalFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3355443 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = 13033414 + end + object styleProfessionalGroup: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4214088 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 13033414 + end + object styleProfessionalRowCaption: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6582120 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object styleProfessionalCaptionRow: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = 13033414 + end + object styleProfessionalContentOdd: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleProfessionalContentEven: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4214088 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 13033414 + end + object styleProfessionalPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14541789 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleProfessionalSelection: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object styleGreenFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9358956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleGreenFooter: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9358956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenLightContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12778719 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenLightPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14154698 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenSelected: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4949549 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenGroup: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11328403 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleNoneContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleNoneFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentBandHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentFooter: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentGroup: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsItalic] + TextColor = clBlack + end + object styleTransparentLevelCaption: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentFilterBar: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentCaptionRow: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentRowCaption: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContentEven: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContentOdd: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentSelection: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13816275 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object ssProfessional: TdxGridReportLinkStyleSheet + Caption = 'Professional' + Styles.BandHeader = styleProfessionalFixed + Styles.Caption = styleProfessionalFixed + Styles.CardCaptionRow = styleProfessionalCaptionRow + Styles.CardRowCaption = styleProfessionalRowCaption + Styles.Content = styleNoneContent + Styles.ContentEven = styleProfessionalContentEven + Styles.ContentOdd = styleProfessionalContentOdd + Styles.FilterBar = styleProfessionalFixed + Styles.Footer = styleProfessionalFixed + Styles.Group = styleProfessionalGroup + Styles.Header = styleProfessionalFixed + Styles.Preview = styleProfessionalPreview + Styles.Selection = styleProfessionalSelection + BuiltIn = True + end + object ssGreen: TdxGridReportLinkStyleSheet + Caption = 'Green' + Styles.BandHeader = styleGreenFixed + Styles.Caption = styleGreenFixed + Styles.CardCaptionRow = styleGreenFixed + Styles.CardRowCaption = styleGreenFixed + Styles.Content = styleNoneContent + Styles.ContentEven = styleGreenLightContent + Styles.ContentOdd = styleNoneContent + Styles.FilterBar = styleGreenFixed + Styles.Footer = styleGreenFixed + Styles.Group = styleGreenGroup + Styles.Header = styleGreenFixed + Styles.Preview = styleGreenLightPreview + Styles.Selection = styleGreenSelected + BuiltIn = True + end + object ssTransparent: TdxGridReportLinkStyleSheet + Caption = 'Transparent' + Styles.BandHeader = styleTransparentBandHeader + Styles.Caption = styleTransparentLevelCaption + Styles.CardCaptionRow = styleTransparentCaptionRow + Styles.CardRowCaption = styleTransparentRowCaption + Styles.Content = styleTransparentContent + Styles.ContentEven = styleTransparentContentEven + Styles.ContentOdd = styleTransparentContentOdd + Styles.FilterBar = styleTransparentFilterBar + Styles.Footer = styleTransparentFooter + Styles.Group = styleTransparentGroup + Styles.Header = styleTransparentHeader + Styles.Preview = styleTransparentPreview + Styles.Selection = styleTransparentSelection + BuiltIn = True + end + end +end diff --git a/official/x.35/Lib/D11/dxPScxGrid6LnkReg.dcu b/official/x.35/Lib/D11/dxPScxGrid6LnkReg.dcu new file mode 100644 index 00000000..93841df8 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxGrid6LnkReg.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxGridLnk.dfm b/official/x.35/Lib/D11/dxPScxGridLnk.dfm new file mode 100644 index 00000000..f8e5880d --- /dev/null +++ b/official/x.35/Lib/D11/dxPScxGridLnk.dfm @@ -0,0 +1,2147 @@ +object dxfmGridReportLinkDesignWindow: TdxfmGridReportLinkDesignWindow + Left = 463 + Top = 133 + BorderStyle = bsDialog + Caption = 'fmdxGridDesignWindow' + ClientHeight = 437 + ClientWidth = 648 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 5 + Top = 5 + Width = 642 + Height = 396 + ActivePage = tshCharts + TabOrder = 0 + OnChange = PageControl1Change + object tshView: TTabSheet + Caption = 'View' + object lblShow: TLabel + Left = 5 + Top = 8 + Width = 26 + Height = 13 + Caption = 'Show' + end + object imgShow: TImage + Left = 9 + Top = 37 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlShow: TBevel + Left = 43 + Top = 12 + Width = 266 + Height = 4 + Shape = bsBottomLine + end + object lblOnEveryPage: TLabel + Left = 5 + Top = 164 + Width = 72 + Height = 13 + Caption = 'On Every Page' + end + object imgOnEveryPage: TImage + Left = 9 + Top = 189 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888777777777777777708888888888 + 888887FFFFFFFFFFFFFFF08888888888888887F7777777777777F07777708888 + 888887F7777777777777F0FFFFF08888888887F7777777777777F07777F07777 + 708887FFFFFFFFFFFFFFF07777F0FFFFF08887F777777777777FF07777F07777 + F08887FFFFFFFFFFFFFFF0FFFFF07777F08887F77777777777FFF077FFF07777 + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777777FFFFF0777FF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777FFFFFFFF07FFFF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF0777FF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF077FFF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777777F077FFF077FF + F08887F7777777777777F0FFFFF0FFFFF08887F7777777777777F0FFFFF07FFF + F08887FFFFFFFFFFFFFFF07777F0FFFFF0888000000000000000007777F077FF + F08888888887F7777777777777F0FFFFF08888888887FFFFFFFFFFFFFFF07777 + F0888888888000000000000000007777F08888888888888887F7777777777777 + F08888888888888887FFFFFFFFFFFFFFF0888888888888888000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlOnEveryPage: TBevel + Left = 90 + Top = 168 + Width = 221 + Height = 4 + Shape = bsBottomLine + end + object bvlWarningHost: TBevel + Left = 4 + Top = 289 + Width = 313 + Height = 77 + Visible = False + end + object chbxShowBands: TCheckBox + Tag = 1 + Left = 90 + Top = 42 + Width = 200 + Height = 17 + Caption = 'Ba&nds' + TabOrder = 1 + OnClick = OptionsViewClick + end + object chbxShowHeaders: TCheckBox + Tag = 2 + Left = 90 + Top = 63 + Width = 200 + Height = 17 + Caption = '&Headers' + TabOrder = 2 + OnClick = OptionsViewClick + end + object chbxShowFooters: TCheckBox + Tag = 3 + Left = 90 + Top = 84 + Width = 200 + Height = 17 + Caption = 'Foo&ters' + TabOrder = 3 + OnClick = OptionsViewClick + end + object chbxShowGroupFooters: TCheckBox + Tag = 4 + Left = 90 + Top = 104 + Width = 200 + Height = 17 + Caption = 'G&roup Footers' + TabOrder = 4 + OnClick = OptionsViewClick + end + object chbxShowExpandButtons: TCheckBox + Tag = 5 + Left = 90 + Top = 125 + Width = 200 + Height = 17 + Caption = 'Expand Buttons' + TabOrder = 5 + OnClick = OptionsViewClick + end + object chbxBandsOnEveryPage: TCheckBox + Tag = 1 + Left = 90 + Top = 202 + Width = 200 + Height = 17 + Caption = 'Ba&nds' + TabOrder = 8 + OnClick = OptionsOnEveryPageClick + end + object chbxHeadersOnEveryPage: TCheckBox + Tag = 2 + Left = 90 + Top = 223 + Width = 200 + Height = 17 + Caption = 'Headers' + TabOrder = 9 + OnClick = OptionsOnEveryPageClick + end + object chbxFootersOnEveryPage: TCheckBox + Tag = 3 + Left = 90 + Top = 245 + Width = 200 + Height = 17 + Caption = 'Footers' + TabOrder = 10 + OnClick = OptionsOnEveryPageClick + end + object chbxFilterBarOnEveryPage: TCheckBox + Tag = 4 + Left = 90 + Top = 266 + Width = 200 + Height = 17 + Caption = 'FilterBar' + TabOrder = 11 + OnClick = OptionsOnEveryPageClick + end + object chbxCaptionsOnEveryPage: TCheckBox + Left = 90 + Top = 181 + Width = 200 + Height = 17 + Caption = 'Captions' + TabOrder = 7 + OnClick = OptionsOnEveryPageClick + end + object chbxShowCaptions: TCheckBox + Left = 90 + Top = 22 + Width = 200 + Height = 17 + Caption = 'Captions' + TabOrder = 0 + OnClick = OptionsViewClick + end + object chbxShowFilterBar: TCheckBox + Tag = 6 + Left = 90 + Top = 146 + Width = 200 + Height = 17 + Caption = 'FilterBar' + TabOrder = 6 + OnClick = OptionsViewClick + end + object lblPreviewWindow: TStaticText + Left = 323 + Top = 1 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 12 + end + end + object tshBehaviors: TTabSheet + Caption = 'Behaviors' + ImageIndex = 1 + object lblSelection: TLabel + Left = 5 + Top = 8 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object imgSelection: TImage + Left = 9 + Top = 28 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlSelection: TBevel + Left = 56 + Top = 12 + Width = 255 + Height = 4 + Shape = bsBottomLine + end + object lblExpanding: TLabel + Left = 5 + Top = 74 + Width = 50 + Height = 13 + Caption = 'Expanding' + end + object imgExpanding: TImage + Left = 9 + Top = 95 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 7778800000000000000000000000078888888888880000000000000000000000 + 007880FFF7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7FF777777FFF77777FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F8F7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7F7F8888FF7F88888FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F8F7777777777777777777078888888888880F7F7F888FFF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F0788077777777777777777777770788C8888C88880F7FF888888FFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880F0F7777777FFFFFFFFFFFF0788CCCCCCCC880F77777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7F7F8888FF7F88888FF7 + F0788077777777777777777777770788C8888C88880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F7F7F8888FF7F888888F7 + F0788077777777777777777777770788CCCC8CC8880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCCCCCC880F7FF88888FFFFFFFFFFF7 + F07880F0F777777FFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F77777777777777777777 + F078800000000000000000000000078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F888888880F88888888888078888888888880F77777777777777777777 + F07880F800008880F80000000008078888888888880F77777777777777777777 + F07880FFFFFFFFF0FFFFFFFFFFFF078888888888880FFFFFFFFFFFFFFFFFFFFF + F078800000000000000000000000088888888888880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlExpanding: TBevel + Left = 62 + Top = 79 + Width = 248 + Height = 4 + Shape = bsBottomLine + end + object lblDetails: TLabel + Left = 5 + Top = 218 + Width = 32 + Height = 13 + Caption = 'Details' + end + object bvlDetails: TBevel + Left = 47 + Top = 223 + Width = 265 + Height = 4 + Shape = bsBottomLine + end + object imgDetails: TImage + Left = 9 + Top = 239 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0889999999999999999999907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897F78FF7FF77777788F907DDDDDDDDDDDD0FF777FFFF7FFF7777FFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDDDDDDDDDDD0FF777777F7FF77777777F + F07DD0889777777777777777777907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCDDDDCDDDD0777777777777777777777 + 707DD08897F777F7FF7777888FF907DDCCCCDCCDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCCCCCCCCDD0FF7777FFF7FF7777777FF + F07DD0889777777777777777777907DDCCCCDCCDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCDDDDCDDDD0777777777777777777777 + 707DD08897F788F7FF77778FFFF907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDDDDDDDDDDD0FF777777F7FF777777777 + F07DD0889777777777777777777907DDCDDDDCDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCCCCDCCDDD0777777777777777777777 + 707DD08897F888F7FF7777788FF907DDCCCCCCCCDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFFF7FFFFFFFFFFF907DDCCCCDCCDDD0FF77777FF7FF7777777FF + F07DD0889000000000000000000907DDCDDDDCDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897888880F8888888888907DDDDDDDDDDDD0777777777777777777777 + 707DD08897F77780F8777777778907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD08897FFFF80FFFFFFFFFFF907DDDDDDDDDDDD0FF7777FFF7FF7777777FF + F07DD0889000000000000000000907DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD0889999999999999999999907DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFFFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD0F0F777777FF77777777FFF07DDDDDDDDDDDD0FF77777FF7FF77777777F + F07DD0FFFFFFFFFFFFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFF7FFFFFFFFFFF + F07DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F888888880F8888888888807DDDDDDDDDDDD0F888888880F8888888888 + 807DD0F877778880F8777777777807DDDDDDDDDDDD0F877777880F8777777778 + 807DD0FFFFFFFFF0FFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFF0FFFFFFFFFFF + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgLevels: TImage + Left = 9 + Top = 306 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDD77777777777777777777 + 7777D0000000000000000000000007DDDDDDDDDDDDD000000000000000000000 + 0007D0888888888888888888888807DDDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFF + FF07D0F000FF8F000FF8FCCCC44F07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7F77F8F77F7F8FCC99F + 7F07D0888888888888888888888807DDDDDDDDDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0FFFFFF8FFFFFF8F666CCCF07DDDDDDDDDDDDD0F7F77F8F777FF8FCC99F + 7F07D0F0000F8F00F0F8F999999F07DDCDDDDCDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDCCCCDCCDDDD0F7888888888888888888 + 7F07D0888888888888888888888807DDCCCCCCCCDDD0F7F77F8F777FF8FC99CF + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDCCCCDCCDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0F00FFF8F0000F8F9999CCF07DDCDDDDCDDDDD0F7888888888888888888 + 7F07D0FFFFFF8FFFFFF8F99AAACF07DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0F0000F8F000FF8F9999CCF07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0888888888888888888888807DDDDDDDDDDDDD0F0000000000000000000 + 0F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFF + FF07D0F0000F8F000FF8FB99944F07DDDDDDDDDDDDD0F7777777777777777777 + 7F07D0FFFFFF8FFFFFF8FFFFFFFF07DDDDDDDDDDDDD0F7F77F8F7777F8F777FF + 7F07D0777777777777777777777707DDDDDDDDDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0F888887F888887F888888807DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0F000087F800087F800000807DDDDDDDDDDDDD0F7F77F8F7777F8F777FF + 7F07D0F888887F888887F888888807DDDDDDDDDDDDD0F7FFFF8FFFFFF8FFFFFF + 7F07D0FFFFFF7FFFFFF7FFFFFFFF07DDDDDDDDDDDDD0F7888888888888888888 + 7F07D0000000000000000000000007DDCDDDDCDDDDD0F7888888888888888888 + 7F07D7F88880777777777777777778DDCCCCDCCDDDD0F7777777777777777777 + 7F07D7F00080F87777788088888888DDCCCCCCCCDDD0F7777777777777777777 + 7F07D7F77780FFFFFFFFF088888888DDCCCCDCCDDDD0F0000000000000000000 + 0F07D7FFFFF0777777777088888888DDCDDDDCDDDDD0FFFFFFFFFFFFFFFFFFFF + FF07D7777770888888888888888888DDDDDDDDDDDDD000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblLevels: TLabel + Left = 5 + Top = 285 + Width = 30 + Height = 13 + Caption = 'Levels' + end + object bvlLevels: TBevel + Left = 47 + Top = 290 + Width = 265 + Height = 4 + Shape = bsBottomLine + end + object lblGridSize: TLabel + Left = 5 + Top = 150 + Width = 19 + Height = 13 + Caption = 'Size' + end + object bvlGridSize: TBevel + Left = 33 + Top = 154 + Width = 277 + Height = 4 + Shape = bsBottomLine + end + object imgGridSize: TImage + Left = 9 + Top = 172 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000008088F07DDDDDDDDDDDD0800000000000000000000 + 807DD0F0FFFF8FFFF8FFFF0FFF0F07DDDDDDDDDDDD0F0F77FFF8F777F8F777F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCDDDDCDDDD0F0F00FFF8F00FF8F00FF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCCCCCDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCDDDDCDDDD0F0FFFFFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCCCCDCCDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCCCCCDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCDCCDDD0F0FFFFFF8F0FFF8F0FFF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0777777777777770FFF0F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F0F8887F8887F8880FFF8F07DDDDDDDDDDDD0F0F888887F88887F88880 + F07DD0F0F0087F0087F0080FFF0F07DDDDDDDDDDDD0F0F800087F80087F80080 + F07DD0F0FFFF7FFFF7FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF7FFFFF7FFFFF0 + F07DD0800000000000000008080807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxProcessSelection: TCheckBox + Left = 90 + Top = 25 + Width = 200 + Height = 17 + Caption = 'Process Selection' + TabOrder = 0 + OnClick = OptionsSelectionClick + end + object chbxProcessExactSelection: TCheckBox + Tag = 1 + Left = 90 + Top = 46 + Width = 200 + Height = 17 + Caption = 'Process Exact Selection' + TabOrder = 1 + OnClick = OptionsSelectionClick + end + object chbxExpandGroupRows: TCheckBox + Left = 90 + Top = 89 + Width = 200 + Height = 17 + Caption = 'Groups' + TabOrder = 2 + OnClick = OptionsExpandingClick + end + object chbxExpandMasterRows: TCheckBox + Tag = 1 + Left = 90 + Top = 111 + Width = 200 + Height = 17 + Caption = 'Details' + TabOrder = 3 + OnClick = OptionsExpandingClick + end + object chbxStartFromActiveView: TCheckBox + Left = 90 + Top = 236 + Width = 200 + Height = 17 + Caption = 'Start From Active Details' + TabOrder = 6 + OnClick = OptionsDetailsClick + end + object chbxOnlyActiveView: TCheckBox + Tag = 1 + Left = 90 + Top = 258 + Width = 200 + Height = 17 + Caption = 'Only Active Details' + TabOrder = 7 + OnClick = OptionsDetailsClick + end + object chbxLevelsUnwrap: TCheckBox + Left = 90 + Top = 303 + Width = 200 + Height = 17 + Caption = '&Unwrap' + TabOrder = 8 + OnClick = OptionsLevelsClick + end + object chbxLevelsUnwrapTopLevel: TCheckBox + Tag = 1 + Left = 90 + Top = 326 + Width = 200 + Height = 17 + Caption = 'Unwrap Top Level' + TabOrder = 9 + OnClick = OptionsLevelsClick + end + object chbxLevelsRiseActiveLevelOntoTop: TCheckBox + Tag = 2 + Left = 90 + Top = 349 + Width = 200 + Height = 17 + Caption = 'Rise Active Level onto Top' + TabOrder = 10 + OnClick = OptionsLevelsClick + end + object chbxGridAutoWidth: TCheckBox + Left = 90 + Top = 169 + Width = 200 + Height = 17 + Caption = '&Auto Width' + TabOrder = 5 + OnClick = OptionsSizeClick + end + object chbxExpandCards: TCheckBox + Tag = 2 + Left = 90 + Top = 132 + Width = 200 + Height = 17 + Caption = 'Cards' + TabOrder = 4 + OnClick = OptionsExpandingClick + end + end + object tshFormatting: TTabSheet + Caption = 'Formatting' + ImageIndex = 4 + object lblLookAndFeel: TLabel + Left = 5 + Top = 8 + Width = 66 + Height = 13 + Caption = 'Look and Feel' + end + object bvlLookAndFeel: TBevel + Left = 85 + Top = 12 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object imgLookAndFeel: TImage + Left = 9 + Top = 28 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D08777777777780877777788807DCCCCDCCDDD0877777777778787777788 + 8F07D08888888888880888888888807DCCCCCCCCDD0888888888888788888888 + 8F07D00000000000000000000000007DCCCCDCCDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F7777777FF07DDDDDDDDDDD0F777777777FF7F7777777 + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F777777FFF07DDDDDDDDDDD0F777777FFFFF7F777777F + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F7777777777F7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F77777FFFF07DDDDDDDDDDD0F77777777FFF7F77777FF + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D00000000000000000000000007DCDDDDCDDDD0000000000000000000000 + 0007D08888888888880888888888807DCCCCDCCDDD0777777777777777777777 + 7707D08888888888880888888888807DCCCCCCCCDD0F88888888888788888888 + 8707D08000000008880880000000807DCCCCDCCDDD0F00000000888788000000 + 8707D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + F707D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgRefinements: TImage + Left = 9 + Top = 95 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FF7FFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF777777F + F07DD0F77777777FF7FF70888FFF07DDCCCCCCCCDD0F77777777FF7FF7FFFF7F + F07DD0FFFFFFFFFFF7FF70FF8FFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF7F00F7F + F07DD0F777777FFFF7FF70FF8FFF07DDCDDDDCDDDD0F777777FFFF7FF7F00F7F + F07DD0FFFFFFFFFFF7FF70000FFF07DDDDDDDDDDDD0FFFFFFFFFFF7FF7FFFF7F + F07DD0F77777777FF7FF777777FF07DDDDDDDDDDDD0F77777777FF7FF777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFCCCCCFFF07DDCCCCCCCCDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FCCCCCCCFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F7777777FFF7FFCCCCCFFF07DDCDDDDCDDDD0F7777777FFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7F9999999FF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F777777777F7FF99999FFF07DDDDDDDDDDDD0F777777777F7F7777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F80000888887F88888888707DDDDDDDDDDDD0F80000888887F88888888 + 707DD0F80000000087F80000008707DDDDDDDDDDDD0F80000000087F80000008 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0FFFFFFFFFFF7FFFFFFFFF707DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + 707DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblRefinements: TLabel + Left = 5 + Top = 74 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlRefinements: TBevel + Left = 70 + Top = 79 + Width = 241 + Height = 4 + Shape = bsBottomLine + end + object bvlRefinementsSeparator: TBevel + Left = 90 + Top = 168 + Width = 221 + Height = 4 + Shape = bsBottomLine + end + object lblPagination: TLabel + Left = 5 + Top = 229 + Width = 50 + Height = 13 + Caption = 'Pagination' + end + object bvlPagination: TBevel + Left = 64 + Top = 234 + Width = 247 + Height = 4 + Shape = bsBottomLine + end + object imgPagination: TImage + Left = 8 + Top = 251 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDD0000000000000000000000007DDDDDDDDDDDD77777777777777770DDDDD + DDDDD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD7FFFFFFFFFFFFFFF0DDDDD + DDDDD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD7F8888888888888F0DDDDD + DDDDD0888000000000000000088F07DDDDDDDDDDDD7F8777877778778F07770D + DDDDD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7F8888888888888F0FFF0D + DDDDD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F088F0D + DDDDD0F9F0F00F8F00F8F00F0F9F07DDDDDDDDDDDD7F8888888888888F078F07 + 770DD0F990FFFF8FFFF8FFFF099F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F088F0F + FF0DD0F99999999999999999999F07DDCDDDDCDDDD7F8FFF8FFFF8FF8F0F8F08 + 8F0DD0F990FFFF8FFFF8FFFF099F07DDCCCCDCCDDD7F8888888888888F088F07 + 8F0DD0F9F0FFFF8F00F8F00F0F9F07DDCCCCCCCCDD7F8FFF8FFFF8FF8F0F8F08 + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDCCCCDCCDDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F8F0FFFF8F00F8F00F0F8F07DDCDDDDCDDDD7F8888888888888F088F08 + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F9F0F00F8F00F8F00F0F9F07DDDDDDDDDDDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F990FFFF8FFFF8FFFF099F07DDCDDDDCDDDD7F8888888888888F088F0F + 8F0DD0F99999999999999999999F07DDCCCCDCCDDD7F8FFF8FFFF8FF8F0F8F08 + 8F0DD0F990FFFF8FFFF8FFFF099F07DDCCCCCCCCDD7F8FFF8FFFF8FF8F0F8F0F + 8F0DD0F9F0FFFF8F00F8F00F0F9F07DDCCCCDCCDDD7F8888888888888F088F0F + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDCDDDDCDDDD7F8777877778778F0F8F08 + 8F0DD0F8F0F00F8F00F8F00F0F8F07DDDDDDDDDDDD7F8888888888888F0F8F0F + 8F0DD0F8F0FFFF8FFFF8FFFF0F8F07DDDDDDDDDDDD7FFFFFFFFFFFFFFF088F0F + 8F0DD0F8F0777777777777770F8F07DDDDDDDDDDDD0000000000000000078F08 + 8F0DD0F8F0F8887F8887F8880F8F07DDDDDDDDDDDDDDDD7F8888888888888F0F + 8F0DD0F8F0F0087F0087F0080F8F07DDDDDDDDDDDDDDDD7FFFFFFFFFFFFFFF08 + 8F0DD0F8F0FFFF7FFFF7FFFF0F8F07DDDDDDDDDDDDDDDD00000000000000000F + 8F0DD0888000000000000000088807DDDDDDDDDDDDDDDDDDDD7F888888888888 + 8F0DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDDDDDDDDDD7FFFFFFFFFFFFF + FF0DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDDDDDDDDDD00000000000000 + 000DD000000000000000000000000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object cbxLookAndFeel: TComboBox + Left = 90 + Top = 33 + Width = 212 + Height = 21 + Style = csDropDownList + ItemHeight = 0 + TabOrder = 0 + OnClick = LookAndFeelClick + end + object chbxFlatCheckMarks: TCheckBox + Tag = 2 + Left = 90 + Top = 142 + Width = 200 + Height = 17 + Caption = 'Flat Check &Marks' + TabOrder = 3 + OnClick = OptionsRefinementClick + end + object chbxDisplayGraphicsAsText: TCheckBox + Tag = 1 + Left = 90 + Top = 119 + Width = 200 + Height = 17 + Caption = 'Display Graphics As &Text' + TabOrder = 2 + OnClick = OptionsRefinementClick + end + object chbxTransparentGraphics: TCheckBox + Left = 90 + Top = 96 + Width = 200 + Height = 17 + Caption = 'Transparent &Graphics' + TabOrder = 1 + OnClick = OptionsRefinementClick + end + object chbxSuppressBackgroundBitmaps: TCheckBox + Tag = 1 + Left = 90 + Top = 181 + Width = 200 + Height = 17 + Caption = 'Suppress Background Images' + TabOrder = 4 + OnClick = OptionsFormatingClick + end + object chbxConsumeSelectionStyle: TCheckBox + Tag = 2 + Left = 90 + Top = 203 + Width = 200 + Height = 17 + Caption = 'Consume Selection Style' + TabOrder = 5 + OnClick = OptionsFormatingClick + end + object chbxPaginateOneGroupPerPage: TCheckBox + Tag = 1 + Left = 90 + Top = 274 + Width = 200 + Height = 17 + Caption = 'One Group Per Page' + TabOrder = 7 + OnClick = OptionsPaginationClick + end + object chbxPaginateByTopLevelGroups: TCheckBox + Left = 90 + Top = 251 + Width = 200 + Height = 17 + Caption = 'By TopLevel Groups' + TabOrder = 6 + OnClick = OptionsPaginationClick + end + end + object tshStyles: TTabSheet + Caption = 'Styles' + ImageIndex = 5 + object bvlStyles: TBevel + Left = 118 + Top = 12 + Width = 191 + Height = 4 + Shape = bsBottomLine + end + object bvlStyleSheets: TBevel + Left = 72 + Top = 295 + Width = 237 + Height = 5 + Shape = bsBottomLine + end + object lblStyleSheets: TLabel + Left = 6 + Top = 291 + Width = 60 + Height = 13 + Caption = 'Style Sheets' + end + object bvlStylesHost: TBevel + Left = 6 + Top = 33 + Width = 228 + Height = 219 + end + object Label1: TLabel + Left = 76 + Top = 135 + Width = 68 + Height = 13 + Caption = '[ Styles Host ]' + Visible = False + end + object lblUseNativeStyles: TLabel + Left = 24 + Top = 9 + Width = 84 + Height = 13 + Caption = '&Use Native Styles' + FocusControl = chbxUseNativeStyles + OnClick = lblUseNativeStylesClick + end + object btnStyleColor: TButton + Left = 243 + Top = 61 + Width = 68 + Height = 23 + Caption = 'Co&lor...' + TabOrder = 2 + OnClick = StyleColorClick + end + object btnStyleFont: TButton + Left = 243 + Top = 33 + Width = 68 + Height = 23 + Caption = '&Font...' + TabOrder = 1 + OnClick = StyleFontClick + end + object btnStyleBackgroundBitmap: TButton + Left = 243 + Top = 97 + Width = 68 + Height = 23 + Caption = '&Bitmap...' + TabOrder = 3 + OnClick = StyleBackgroundBitmapClick + end + object chbxUseNativeStyles: TCheckBox + Left = 5 + Top = 8 + Width = 14 + Height = 17 + TabOrder = 0 + OnClick = OptionsFormatingClick + end + object cbxStyleSheets: TComboBox + Left = 6 + Top = 311 + Width = 302 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 7 + OnClick = cbxStyleSheetsClick + OnDrawItem = cbxStyleSheetsDrawItem + OnKeyDown = cbxStyleSheetsKeyDown + end + object btnStyleSheetNew: TButton + Left = 6 + Top = 343 + Width = 71 + Height = 23 + Caption = '&New...' + TabOrder = 8 + OnClick = StyleSheetNewClick + end + object btnStyleSheetCopy: TButton + Left = 83 + Top = 343 + Width = 71 + Height = 23 + Caption = '&Copy...' + TabOrder = 9 + OnClick = StyleSheetCopyClick + end + object btnStyleSheetDelete: TButton + Left = 160 + Top = 343 + Width = 71 + Height = 23 + Caption = '&Delete...' + TabOrder = 10 + OnClick = StyleSheetDeleteClick + end + object btnStylesSaveAs: TButton + Left = 123 + Top = 259 + Width = 112 + Height = 23 + Caption = 'Save &As...' + TabOrder = 6 + OnClick = StylesSaveAsClick + end + object btnStyleSheetRename: TButton + Left = 237 + Top = 343 + Width = 71 + Height = 23 + Caption = '&Rename...' + TabOrder = 11 + OnClick = StyleSheetRenameClick + end + object btnStyleBackgroundBitmapClear: TButton + Left = 243 + Top = 125 + Width = 68 + Height = 23 + Caption = 'Cle&ar' + TabOrder = 4 + OnClick = StyleBackgroundBitmapClearClick + end + object btnStyleRestoreDefaults: TButton + Left = 6 + Top = 259 + Width = 112 + Height = 23 + Caption = 'Rest&ore Defaults' + TabOrder = 5 + OnClick = StyleRestoreDefaultsClick + end + end + object tshPreview: TTabSheet + Caption = 'Preview' + ImageIndex = 2 + object lblPreviewOptions: TLabel + Left = 5 + Top = 8 + Width = 37 + Height = 13 + Caption = 'Options' + end + object bvlPreviewOptions: TBevel + Left = 50 + Top = 12 + Width = 261 + Height = 4 + Shape = bsBottomLine + end + object lblPreviewMaxLineCount: TLabel + Left = 91 + Top = 73 + Width = 78 + Height = 13 + Caption = 'Max Line Count:' + end + object bvlPreviewMaxLineCountHost: TBevel + Left = 229 + Top = 69 + Width = 68 + Height = 21 + Visible = False + end + object imgPreview: TImage + Left = 9 + Top = 28 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDD7777777777777777777777777DDDDDD0000000000000000000000000 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F888F7FF888F7F8888F7F07DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F0 + 7DDDDDD0F777777777777777777777F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCFFCCCCFFCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCFCCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCFCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCFCCFCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCFFCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F777777777777777777777F07DDDDDD0F7F888F7FF888F7FF888F7F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F88887F888887F888887F07DDDDDD0F7F00087F000087F000087F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0000000000000000000000000 + DDDD} + Transparent = True + end + object chbxPreviewVisible: TCheckBox + Left = 90 + Top = 28 + Width = 150 + Height = 17 + Caption = 'Visible' + TabOrder = 0 + OnClick = PreviewVisibleClick + end + object chbxPreviewAutoHeight: TCheckBox + Left = 90 + Top = 49 + Width = 150 + Height = 17 + Caption = 'Auto Height' + TabOrder = 1 + OnClick = PreviewAutoHeightClick + end + end + object tshCards: TTabSheet + Caption = 'Cards' + ImageIndex = 3 + object bvlCardSpaceVertHost: TBevel + Left = 231 + Top = 140 + Width = 75 + Height = 21 + Visible = False + end + object bvlCardSpaceHorzHost: TBevel + Left = 231 + Top = 112 + Width = 75 + Height = 21 + Visible = False + end + object lblCardSpaceVert: TLabel + Left = 90 + Top = 145 + Width = 39 + Height = 13 + Caption = 'Vertical:' + end + object lblCardSpaceHorz: TLabel + Left = 90 + Top = 116 + Width = 52 + Height = 13 + Caption = 'Horizontal:' + end + object imgCardSpacing: TImage + Left = 9 + Top = 112 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDD0DD0DDDDDDDDDDDDDDDDDD0DD0DDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDD00D0DDDDDDDDDDDDDDDDDD0D00DDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDD000000000000000000000000000000DDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDD00D0DDDDDDDDDDDDDDDDDD0D00DDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDD7DD0DDDDDD707000DDDDDD0DD7DDDDDDDDDDDDDDD + DDDDDDDDD0000000000000000000DDDDDD0D0D0DDDDDD0000000000000000000 + 0DDDDDDD77777777777777777770DDDDD00D0D0DDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDD0D000DDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7FFFFFFF7FFF9999FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFF9999FF7 + 0DDDDDDD7FFFFFFF7FFF9999FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFF9999FF7 + 0DDDDDDD7FFFFFFF7FCCCC99FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FCCCC99FF7 + 0DDDDDDD7FFFFFFF7FCCCC99FF70DDDDDDDDDDDDDDDDD7FFFFFFF7FCCCC99FF7 + 0DDDDDDD7F77777F7FCCCCFFFF70DDDDDDDDDDDDDDDDD7F77777F7FCCCCFFFF7 + 0DDDDDDD7F77777F7FCCCCFFFF70DDDDDDDDDDDDDDDDD7F77777F7FCCCCFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD77777777777777777770DDDDDDDDDDDDDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7F77777F7FF777777F70DDDDDDDDDDDDDDDDD7F77777F7FF777777F7 + 0DDDDDDD7F7FFFFF7FF7FFFFFF70DDDDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD77777777777777777770DDDDDDDDDDDDDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7F77777F7FF77777FF70DDDDDDDDDDDDDDDDD7F77777F7FF777777F7 + 0DDDDDDD7F7FFFFF7FF77FFFFF70DDDDDDDDDDDDDDDDD7F7FFFFF7FF77FFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD77777777777777777770DDDDDDDDDDDDDDDDD7777777777777777777 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7F77777F7FF777777F70DDDDDDDDDDDDDDDDD7F77777F7FF777777F7 + 0DDDDDDD7F7FFFFF7FF7FFFFFF70DDDDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFF7 + 0DDDDDDD7FFFFFFF7FFFFFFFFF70DDDDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFF7 + 0DDDDDDD7777777777777777777DDDDDDDDDDDDDDDDDD7777777777777777777 + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblCardSpacing: TLabel + Left = 5 + Top = 92 + Width = 37 + Height = 13 + Caption = 'Spacing' + end + object bvlCardSpacing: TBevel + Left = 51 + Top = 97 + Width = 260 + Height = 4 + Shape = bsBottomLine + end + object bvlCardSizes: TBevel + Left = 34 + Top = 12 + Width = 277 + Height = 4 + Shape = bsBottomLine + end + object lblCardSizes: TLabel + Left = 5 + Top = 8 + Width = 24 + Height = 13 + Caption = 'Sizes' + end + object imgCardSizes: TImage + Left = 9 + Top = 28 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDD000000000000DDDDDDDDDDDDDDDDDDDDDDDD000000000000DD00000000 + 0000D7777777777770DDDDDDDDDDDDDDDDDDDDDDD7777777777770D777777777 + 7770D7FFFFF8FFFF70DDDDDDDDDDDDDDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8FFFF70DDDDDDDDDDDDDDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70DDDDDDDDDDDDDDDDDDDDDDD7FFFFF8F77F70D7FFFFF8FF + FF70D7FFFFF8FFFF70DDDDDDDDDDDDDDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70DD0000000000DDCCCCDCCDD7FFFFF8F77F70D7FFFFF8FF + FF70D7FFFFF8FFFF70D77777777770DDCCCCCCCCD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70D7FFFF8FFF70DDCCCCDCCDD7FFFFF8F77F70D7FFFFF8FF + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7FFFFF8F77F70D7FFFF8F7F70DDDDDDDDDDD7FFFFF8F77F70D7FFFFF8F7 + FF70D7F777F8FFFF70D7FFFF8FFF70DDDDDDDDDDD7F777F8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDDDDDDDDDD7F777F8F77F70D7F77FF8F7 + 7F70D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7888888888870D78888888870DDDDDDDDDDD7888888888870D788888888 + 8870D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDDDDDDDDDD7F777F8F77F70D7F77FF8F7 + FF70D7F777F8FFFF70D7F77F8F7F70DDDDDDDDDDD7F777F8FFFF70D7F77FF8F7 + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7888888888870D78888888870DDDDDDDDDDD7888888888870D788888888 + 8870D7FFFFF8FFFF70D7FFFF8FFF70DDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDCCCCDCCDD7F777F8F77F70D7F77FF8F7 + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDCCCCCCCCD7FFFFF8FFFF70D7FFFFF8FF + FF70D7888888888870D78888888870DDCCCCDCCDD7888888888870D788888888 + 8870D7FFFFF8FFFF70D7FFFF8FFF70DDCDDDDCDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D7F777F8F77F70D7F77F8F7F70DDDDDDDDDDD7F777F8F77F70D7F77FF8F7 + FF70D7F7FFF8FFFF70D7F7FF8F7F70DDDDDDDDDDD7F7FFF8FFFF70D7F7FFF8F7 + FF70D7FFFFF8FFFF70D7FFFF8FFF70DDDDDDDDDDD7FFFFF8FFFF70D7FFFFF8FF + FF70D777777777777DD7777777777DDDDDDDDDDDD777777777777DD777777777 + 777DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgCardFraming: TImage + Left = 9 + Top = 189 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDD7777777777777777777DDDDDDDDDDDDDDDDDD00000000000000000 + 00DDDDDDD88888888888888888887DDDDDDDDDDDDDDDDD000000000000000000 + 00DDDDDDD8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDDDDD0FFFFFFF0FFFFFFFFF + 00DDDDD778FFFFFFF8FFF9999FF87DDDDDDDDDDDDDDD000FFFFFFF0FFF9999FF + 00DDDD8888FFFFFFF8FFF9999FF87DDDDDDDDDDDDDD0000FFFFFFF0FFF9999FF + 00DDDD8FF8FFFFFFF8FCCCC99FF87DDDCDDDDCDDDDD0FF0FFFFFFF0FCCCC99FF + 00DDDD8FF8FFFFFFF8FCCCC99FF87DDDCCCCDCCDDDD0FF0FFFFFFF0FCCCC99FF + 00DDDD8FF8F77777F8FCCCCFFFF87DDDCCCCCCCCDDD0FF0F77777F0FCCCCFFFF + 00DDDD8FF8F77777F8FCCCCFFFF87DDDCCCCDCCDDDD0FF0F77777F0FCCCCFFFF + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDCDDDDCDDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDDDDDDDDDDDD0F7000000000000000000 + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF777777F87DDDDDDDDDDDDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF7FFFFFF87DDDDDDDDDDDDDD0000F7FFFFF0FF7FFFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDDDDDDDDDDDD0F7000000000000000000 + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF77777FF87DDDDDDDDDDDDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF77FFFFF87DDDDDDDDDDDDDD0000F7FFFFF0FF77FFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDCDDDDCDDDDD0F7000000000000000000 + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDCCCCDCCDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF777777F87DDDCCCCCCCCDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF7FFFFFF87DDDCCCCDCCDDDD0000F7FFFFF0FF7FFFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDCDDDDCDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F78888888888888888888DDDDDDDDDDDDDDD0F7000000000000000000 + 0DDDDD8F7FFFFF8FF7FFFFFF87DDDDDDDDDDDDDDDDD0F7FFFFF0FF7FFFFFF00D + DDDDDD8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDDDDD0FFFFFFF0FFFFFFFFF00D + DDDDDD8888888888888888888DDDDDDDDDDDDDDDDDD0000000000000000000DD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblCardFraming: TLabel + Left = 5 + Top = 171 + Width = 38 + Height = 13 + Caption = 'Framing' + end + object bvlCardFraming: TBevel + Left = 49 + Top = 176 + Width = 262 + Height = 4 + Shape = bsBottomLine + end + object bvlCardShadowColorHost: TBevel + Left = 177 + Top = 276 + Width = 129 + Height = 21 + Visible = False + end + object lblCardShadowDepth: TLabel + Left = 90 + Top = 308 + Width = 33 + Height = 13 + Caption = 'Depth:' + end + object bvlCardShadow: TBevel + Left = 48 + Top = 260 + Width = 263 + Height = 4 + Shape = bsBottomLine + end + object lblCardShadow: TLabel + Left = 5 + Top = 255 + Width = 38 + Height = 13 + Caption = 'Shadow' + end + object lblCardShadowColor: TLabel + Left = 90 + Top = 280 + Width = 29 + Height = 13 + Caption = 'Color:' + end + object bvlCardShadowDepthHost: TBevel + Left = 177 + Top = 304 + Width = 129 + Height = 21 + Visible = False + end + object imgCardShadow: TImage + Left = 9 + Top = 276 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD0000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD0000000000000000000 + 000DDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDCDDDDCDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7FFFFFFF7FFF9999FFFFF7DDDDCCCCDCCDDDD7FFFFFFF7FFF9999FFFFF + 700DDD7FFFFFFF7FFF9999FFFFF7DDDDCCCCCCCCDDD7FFFFFFF7FFF9999FFFFF + 700DDD7FFFFFFF7FCCCC99FFFFF7DDDDCCCCDCCDDDD7FFFFFFF7FCCCC99FFFFF + 700DDD7FFFFFFF7FCCCC99FFFFF7DDDDCDDDDCDDDDD7FFFFFFF7FCCCC99FFFFF + 700DDD7F77777F7FCCCCFFFFFFF7DDDDDDDDDDDDDDD7F77777F7FCCCCFFFFFFF + 700DDD7F77777F7FCCCCFFFFFFF7DDDDDDDDDDDDDDD7F77777F7FCCCCFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7F77777F7FF777777FFFF7DDDDDDDDDDDDDDD7F77777F7FF777777FFFF + 700DDD7F7FFFFF7FF7FFFFFFFFF7DDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7F77777F7FF77777FFFFF7DDDDCDDDDCDDDDD7F77777F7FF77777FFFFF + 700DDD7F7FFFFF7FF77FFFFFFFF7DDDDCCCCDCCDDDD7F7FFFFF7FF77FFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDCCCCCCCCDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7777777777777777777777DDDDCCCCDCCDDDD777777777777777777777 + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDCDDDDCDDDDD7FFFFFFF7FFFFFFFFFFFF + 700DDD7F77777F7FF777777FFFF7DDDDDDDDDDDDDDD7F77777F7FF777777FFFF + 700DDD7F7FFFFF7FF7FFFFFFFFF7DDDDDDDDDDDDDDD7F7FFFFF7FF7FFFFFFFFF + 700DDD7FFFFFFF7FFFFFFFFFFFF7DDDDDDDDDDDDDDD7FFFFFFF7FFFFFFFFFFFF + 7DDDDD7777777777777777777777DDDDDDDDDDDDDDD777777777777777777777 + 7DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxCardsKeepSameHeight: TCheckBox + Tag = 2 + Left = 90 + Top = 70 + Width = 200 + Height = 17 + Caption = 'Keep Same Height' + TabOrder = 2 + OnClick = OptionsCardsClick + end + object chbxCardsKeepSameWidth: TCheckBox + Tag = 1 + Left = 90 + Top = 49 + Width = 200 + Height = 17 + Caption = 'Keep Same Width' + TabOrder = 1 + OnClick = OptionsCardsClick + end + object chbxCardsAutoWidth: TCheckBox + Left = 90 + Top = 28 + Width = 200 + Height = 17 + Caption = 'Auto Width' + TabOrder = 0 + OnClick = OptionsCardsClick + end + object chbxCardsVertLines: TCheckBox + Tag = 5 + Left = 90 + Top = 231 + Width = 200 + Height = 17 + Caption = 'Vertical Lines' + TabOrder = 5 + OnClick = OptionsCardsClick + end + object chbxCardsHorzLines: TCheckBox + Tag = 4 + Left = 90 + Top = 210 + Width = 200 + Height = 17 + Caption = 'Horizontal Lines' + TabOrder = 4 + OnClick = OptionsCardsClick + end + object chbxCardsBorder: TCheckBox + Tag = 3 + Left = 90 + Top = 189 + Width = 200 + Height = 17 + Caption = 'Border' + TabOrder = 3 + OnClick = OptionsCardsClick + end + end + object tshCharts: TTabSheet + Caption = 'Charts' + ImageIndex = 6 + object lblChartsOptions: TLabel + Left = 5 + Top = 8 + Width = 37 + Height = 13 + Caption = 'Options' + end + object imgCharts: TImage + Left = 9 + Top = 28 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDD777777777777777777777777DDDDDDD000000000000000000000000 + 7DDDDDDD0887FFFFFFFFFFFFFFFFFFF07DDDDDDD0887F8888888888888888880 + 7DDDDDDD0887F8FC491A2FFC491A2FF07DDDDDDD0887F8FC491A2FFC491A2FF0 + 7DDDDDDD0887F8FC4FFA2FFC491A2FF07DDDDDDD0887F8FC4FFA2FFC4FFA2FF0 + 7DDDDDDD0887F8FFFFFFFFFFFFFFFFF07DDDDDDD088777777777777777777770 + 7DDDDDDD0888888888888888888888807DDDDDDD087807777777788888888880 + 7DDDDDDD0888888888888888888888807DDDDDDD077777777777777777777770 + 7DDDDDDD0887FFFFFFFFFFFFFFFFFFF07DDDDDDD0887F8888888888888888880 + 7DDDDDDD0887F8FC491A2FFC491A2FF07DDDDDDD0887F8FC491A2FFC491A2FF0 + 7DDDDDDD0887F8FC491FFFFC491A2FF07DDDDDDD0887F8FFF91FFFFC4FFA2FF0 + 7DDDDDDD0887F8FFFFFFFFFFFFFFFFF07DDDDDDD088777777777777777777770 + 7DDDDDDD0888888888888888888888807DDDDDDD087800777777788888888880 + 7DDDDDDD0888888888888888888888807DDDDDDD077777777777777777777770 + 7DDDDDDD0F8888887F888888888888807DDDDDDD0F8000087F80000000088880 + 7DDDDDDD0F8888887F888888888888807DDDDDDD0FFFFFFF7FFFFFFFFFFFFFF0 + 7DDDDDDD000000000000000000000000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object bvlChartsOptions: TBevel + Left = 57 + Top = 12 + Width = 254 + Height = 4 + Shape = bsBottomLine + end + object chbxChartsTransparent: TCheckBox + Left = 90 + Top = 28 + Width = 200 + Height = 17 + Caption = 'Transparent' + TabOrder = 0 + OnClick = chbxChartsTransparentClick + end + end + end + object pnlPreview: TPanel + Left = 331 + Top = 44 + Width = 306 + Height = 350 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + object PreviewGrid: TcxGrid + Left = 5 + Top = 7 + Width = 296 + Height = 337 + TabOrder = 0 + LookAndFeel.NativeStyle = False + RootLevelOptions.DetailTabsPosition = dtpTop + object PreviewBandedView: TcxGridBandedTableView + NavigatorButtons.ConfirmDelete = False + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'Count = 0' + Kind = skCount + Position = spFooter + Column = colVendorName + end> + DataController.Summary.FooterSummaryItems = < + item + Format = 'Count = 0' + Kind = skCount + Column = colVendorName + end> + DataController.Summary.SummaryGroups = <> + Filtering.CustomizeDialog = False + Filtering.Visible = fvAlways + OptionsView.ScrollBars = ssNone + OptionsView.CellAutoHeight = True + OptionsView.ColumnAutoWidth = True + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.GroupFooters = gfAlwaysVisible + Preview.Column = colVendorCountry + Preview.Visible = True + OnCustomDrawColumnHeader = PreviewBandedViewCustomDrawColumnHeader + OnCustomDrawFooterCell = PreviewBandedViewCustomDrawFooterCell + Bands = < + item + Caption = 'Vendor Data' + Width = 150 + end + item + Caption = 'Car Data' + end> + OnCustomDrawBandHeader = PreviewBandedViewCustomDrawBandHeader + object colVendorName: TcxGridBandedColumn + Caption = 'Name' + PropertiesClassName = 'TcxTextEditProperties' + Options.Filtering = False + Position.BandIndex = 0 + Position.ColIndex = 0 + Position.RowIndex = 0 + end + object colVendorLogo: TcxGridBandedColumn + Caption = 'Logo' + PropertiesClassName = 'TcxImageProperties' + Properties.GraphicTransparency = gtTransparent + OnCustomDrawCell = VendorLogoCustomDrawCell + Options.Filtering = False + Position.BandIndex = 0 + Position.ColIndex = 1 + Position.RowIndex = 0 + end + object colVendorCountry: TcxGridBandedColumn + PropertiesClassName = 'TcxTextEditProperties' + Position.BandIndex = 0 + Position.ColIndex = 2 + Position.RowIndex = 0 + end + object colCarModel: TcxGridBandedColumn + Caption = 'Model' + PropertiesClassName = 'TcxTextEditProperties' + Options.Filtering = False + Position.BandIndex = 1 + Position.ColIndex = 0 + Position.RowIndex = 0 + end + object colIsSUVModel: TcxGridBandedColumn + Caption = 'SUV' + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.ValueGrayed = #39#39 + OnCustomDrawCell = IsSUVModelCustomDrawCell + HeaderAlignmentHorz = taCenter + Options.Filtering = False + Width = 30 + Position.BandIndex = 1 + Position.ColIndex = 1 + Position.RowIndex = 0 + end + end + object PreviewGridLevel: TcxGridLevel + Caption = 'Cars' + end + end + end + object pmStyles: TPopupMenu + Images = ilStylesPopup + OnPopup = pmStylesPopup + Left = 4 + Top = 408 + object miStyleFont: TMenuItem + Caption = '&Font...' + ImageIndex = 0 + OnClick = StyleFontClick + end + object miStyleColor: TMenuItem + Caption = '&Color...' + OnClick = StyleColorClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miStyleBackgroundBitmap: TMenuItem + Caption = '&Bitmap...' + ImageIndex = 1 + ShortCut = 16463 + OnClick = StyleBackgroundBitmapClick + end + object miStyleBackgroundBitmapClear: TMenuItem + Caption = 'Clear' + ImageIndex = 3 + ShortCut = 16430 + OnClick = StyleBackgroundBitmapClearClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miStyleRestoreDefaults: TMenuItem + Caption = 'Restore Defaults' + OnClick = StyleRestoreDefaultsClick + end + object milLine: TMenuItem + Caption = '-' + end + object miStylesSelectAll: TMenuItem + Caption = 'Select A&ll' + ShortCut = 16449 + OnClick = miStylesSelectAllClick + end + object miLine4: TMenuItem + Caption = '-' + end + object miStylesSaveAs: TMenuItem + Caption = 'Save &As...' + ImageIndex = 2 + ShortCut = 16467 + OnClick = StylesSaveAsClick + end + end + object ilStylesPopup: TImageList + Left = 32 + Top = 408 + Bitmap = { + 494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00000000000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF000000 + 0000008080000080800000808000008080000080800000808000008080000080 + 8000008080000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000000000000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000008080000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF00FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800080808000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00C0C0C00000FFFF00C0C0C000FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000000000008080800080808000000000008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C00000000000C0C0C00000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFC001FFFF + FE07001F8001FFF9FF9F000F8001E7FFFF9F00078001C3F3E01F00038001C3E7 + F99F00018001E1C7F99B00008001F08FF99B00018001F81FF89300018001FC3F + D80300018001F81FD9BF80018001F09FC93FE0018001C1C7C03FE001800183E3 + FFFFE00180018FF1FFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end + object cxStyleRepository1: TcxStyleRepository + Left = 60 + Top = 408 + object styleCardShadow: TcxStyle + end + object styleCardBorder: TcxStyle + AssignedValues = [svColor] + Color = clWindow + end + end +end diff --git a/official/x.35/Lib/D11/dxPScxGridLnkPredefinedStyleSheets.dfm b/official/x.35/Lib/D11/dxPScxGridLnkPredefinedStyleSheets.dfm new file mode 100644 index 00000000..83221cdb --- /dev/null +++ b/official/x.35/Lib/D11/dxPScxGridLnkPredefinedStyleSheets.dfm @@ -0,0 +1,351 @@ +object dxdmPScxGridLnkPredefinedStyles: TdxdmPScxGridLnkPredefinedStyles + OldCreateOrder = False + Left = 352 + Top = 156 + Height = 150 + Width = 215 + object StyleRepository: TcxStyleRepository + Left = 37 + Top = 12 + object styleProfessionalFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3355443 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = 13033414 + end + object styleProfessionalGroup: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4214088 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 13033414 + end + object styleProfessionalRowCaption: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6582120 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object styleProfessionalCaptionRow: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = 13033414 + end + object styleProfessionalContentOdd: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleProfessionalContentEven: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4214088 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 13033414 + end + object styleProfessionalPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14541789 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleProfessionalSelection: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object styleGreenFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9358956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleGreenFooter: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9358956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenLightContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12778719 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenLightPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14154698 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenSelected: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4949549 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenGroup: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 11328403 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleNoneContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleNoneFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentBandHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentFooter: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentGroup: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsItalic] + TextColor = clBlack + end + object styleTransparentLevelCaption: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentFilterBar: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentCaptionRow: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentRowCaption: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContentEven: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContentOdd: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentSelection: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13816275 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object ssProfessional: TdxGridReportLinkStyleSheet + Caption = 'Professional' + Styles.BandHeader = styleProfessionalFixed + Styles.Caption = styleProfessionalFixed + Styles.CardCaptionRow = styleProfessionalCaptionRow + Styles.CardRowCaption = styleProfessionalRowCaption + Styles.Content = styleNoneContent + Styles.ContentEven = styleProfessionalContentEven + Styles.ContentOdd = styleProfessionalContentOdd + Styles.FilterBar = styleProfessionalFixed + Styles.Footer = styleProfessionalFixed + Styles.Group = styleProfessionalGroup + Styles.Header = styleProfessionalFixed + Styles.Preview = styleProfessionalPreview + Styles.Selection = styleProfessionalSelection + BuiltIn = True + end + object ssGreen: TdxGridReportLinkStyleSheet + Caption = 'Green' + Styles.BandHeader = styleGreenFixed + Styles.Caption = styleGreenFixed + Styles.CardCaptionRow = styleGreenFixed + Styles.CardRowCaption = styleGreenFixed + Styles.Content = styleNoneContent + Styles.ContentEven = styleGreenLightContent + Styles.ContentOdd = styleNoneContent + Styles.FilterBar = styleGreenFixed + Styles.Footer = styleGreenFixed + Styles.Group = styleGreenGroup + Styles.Header = styleGreenFixed + Styles.Preview = styleGreenLightPreview + Styles.Selection = styleGreenSelected + BuiltIn = True + end + object ssTransparent: TdxGridReportLinkStyleSheet + Caption = 'Transparent' + Styles.BandHeader = styleTransparentBandHeader + Styles.Caption = styleTransparentLevelCaption + Styles.CardCaptionRow = styleTransparentCaptionRow + Styles.CardRowCaption = styleTransparentRowCaption + Styles.Content = styleTransparentContent + Styles.ContentEven = styleTransparentContentEven + Styles.ContentOdd = styleTransparentContentOdd + Styles.FilterBar = styleTransparentFilterBar + Styles.Footer = styleTransparentFooter + Styles.Group = styleTransparentGroup + Styles.Header = styleTransparentHeader + Styles.Preview = styleTransparentPreview + Styles.Selection = styleTransparentSelection + BuiltIn = True + end + end +end diff --git a/official/x.35/Lib/D11/dxPScxImgLnk.dcu b/official/x.35/Lib/D11/dxPScxImgLnk.dcu new file mode 100644 index 00000000..7e1821da Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxImgLnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxListBoxLnk.dcu b/official/x.35/Lib/D11/dxPScxListBoxLnk.dcu new file mode 100644 index 00000000..1c168867 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxListBoxLnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxMCListBoxLnk.dcu b/official/x.35/Lib/D11/dxPScxMCListBoxLnk.dcu new file mode 100644 index 00000000..7cc9e877 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxMCListBoxLnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxMCListBoxLnk.dfm b/official/x.35/Lib/D11/dxPScxMCListBoxLnk.dfm new file mode 100644 index 00000000..3dc70f36 --- /dev/null +++ b/official/x.35/Lib/D11/dxPScxMCListBoxLnk.dfm @@ -0,0 +1,660 @@ +object cxfmMCListBoxDesignWindow: TcxfmMCListBoxDesignWindow + Left = 391 + Top = 313 + BorderIcons = [biSystemMenu, biMinimize, biMaximize, biHelp] + BorderStyle = bsDialog + Caption = 'cxfmMCListBoxDesignWindow' + ClientHeight = 293 + ClientWidth = 558 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 6 + Width = 549 + Height = 251 + ActivePage = tshColor + MultiLine = True + TabOrder = 0 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = '&Options' + object pnlOptions: TPanel + Left = 0 + Top = 0 + Width = 541 + Height = 223 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblShow: TLabel + Left = 5 + Top = 12 + Width = 26 + Height = 13 + Caption = 'Show' + end + object Bevel11: TBevel + Left = 40 + Top = 17 + Width = 194 + Height = 4 + Shape = bsBottomLine + end + object imgGrid: TImage + Left = 7 + Top = 34 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblOnEveryPage: TLabel + Left = 5 + Top = 125 + Width = 72 + Height = 13 + Caption = 'On Every Page' + end + object Image1: TImage + Left = 7 + Top = 149 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888777777777777777708888888888 + 888887FFFFFFFFFFFFFFF08888888888888887F7777777777777F07777708888 + 888887F7777777777777F0FFFFF08888888887F7777777777777F07777F07777 + 708887FFFFFFFFFFFFFFF07777F0FFFFF08887F777777777777FF07777F07777 + F08887FFFFFFFFFFFFFFF0FFFFF07777F08887F77777777777FFF077FFF07777 + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777777FFFFF0777FF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777FFFFFFFF07FFFF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF0777FF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF077FFF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777777F077FFF077FF + F08887F7777777777777F0FFFFF0FFFFF08887F7777777777777F0FFFFF07FFF + F08887FFFFFFFFFFFFFFF07777F0FFFFF0888000000000000000007777F077FF + F08888888887F7777777777777F0FFFFF08888888887FFFFFFFFFFFFFFF07777 + F0888888888000000000000000007777F08888888888888887F7777777777777 + F08888888888888887FFFFFFFFFFFFFFF0888888888888888000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object Bevel10: TBevel + Left = 84 + Top = 129 + Width = 150 + Height = 4 + Shape = bsBottomLine + end + object chbxShowVertLines: TCheckBox + Tag = 2 + Left = 95 + Top = 75 + Width = 137 + Height = 17 + Caption = 'Vertical Lines' + TabOrder = 2 + OnClick = ShowClick + end + object chbxShowBorders: TCheckBox + Left = 95 + Top = 29 + Width = 137 + Height = 17 + Caption = 'Border' + TabOrder = 0 + OnClick = ShowClick + end + object chbxShowHorzLines: TCheckBox + Tag = 1 + Left = 95 + Top = 51 + Width = 137 + Height = 17 + Caption = 'Horizontal Lines' + TabOrder = 1 + OnClick = ShowClick + end + object chbxShowColumnHeaders: TCheckBox + Tag = 3 + Left = 95 + Top = 99 + Width = 137 + Height = 17 + Caption = '&Column Headers' + TabOrder = 3 + OnClick = ShowClick + end + object chbxHeadersOnEveryPage: TCheckBox + Left = 95 + Top = 148 + Width = 137 + Height = 17 + Caption = 'Headers' + TabOrder = 4 + OnClick = HeadersOnEveryPageClick + end + object lblPreview: TStaticText + Left = 244 + Top = 2 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 5 + end + end + end + object tshColor: TTabSheet + Caption = '&Color' + object pnlColor: TPanel + Left = 0 + Top = 0 + Width = 541 + Height = 223 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblGridLinesColor: TLabel + Left = 6 + Top = 200 + Width = 79 + Height = 13 + Caption = '&Grid lines color : ' + end + object bvlGridLineColorHost: TBevel + Left = 91 + Top = 196 + Width = 127 + Height = 21 + Visible = False + end + object lblDrawMode: TLabel + Left = 5 + Top = 17 + Width = 58 + Height = 13 + Caption = 'Draw &Mode:' + FocusControl = cbxDrawMode + end + object gbxTransparentHeaders: TGroupBox + Left = 5 + Top = 131 + Width = 223 + Height = 55 + Caption = ' ' + TabOrder = 4 + object lblHeadersColor: TLabel + Left = 6 + Top = 24 + Width = 78 + Height = 13 + Caption = 'Headers Color : ' + end + object bvlHeadersColorHost: TBevel + Left = 86 + Top = 22 + Width = 127 + Height = 21 + Visible = False + end + end + object gbxTransparent: TGroupBox + Left = 5 + Top = 45 + Width = 223 + Height = 80 + Caption = ' ' + TabOrder = 2 + object lblColor: TLabel + Left = 6 + Top = 24 + Width = 35 + Height = 13 + Caption = 'Co&lor : ' + end + object bvlColorHost: TBevel + Left = 86 + Top = 20 + Width = 127 + Height = 21 + Visible = False + end + object lblEvenColor: TLabel + Left = 6 + Top = 51 + Width = 59 + Height = 13 + Caption = 'E&ven Color: ' + end + object bvlEvenColorHost: TBevel + Left = 86 + Top = 47 + Width = 127 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 18 + Top = 43 + Width = 15 + Height = 17 + Caption = 'T&ransparent' + TabOrder = 1 + OnClick = TransparentClick + end + object chbxTransparentHeaders: TCheckBox + Tag = 1 + Left = 18 + Top = 129 + Width = 15 + Height = 17 + Caption = 'T&ransparent Headers' + TabOrder = 3 + OnClick = TransparentClick + end + object cbxDrawMode: TComboBox + Left = 69 + Top = 12 + Width = 159 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 0 + OnClick = DrawModeClick + OnDrawItem = cbxDrawModeDrawItem + Items.Strings = ( + 'Simpe' + 'Odd\Even Rows Mode' + 'Chess' + 'Borrow From Source') + end + object stTransparent: TStaticText + Left = 33 + Top = 44 + Width = 69 + Height = 17 + Caption = ' Transparent ' + FocusControl = chbxTransparent + TabOrder = 5 + OnClick = stTransparentClick + end + object stTransparentHeaders: TStaticText + Left = 33 + Top = 130 + Width = 112 + Height = 17 + Caption = ' Transparent Headers ' + FocusControl = chbxTransparentHeaders + TabOrder = 6 + OnClick = stTransparentHeadersClick + end + end + end + object tshFont: TTabSheet + Caption = '&Font' + object pnlFont: TPanel + Left = 0 + Top = 0 + Width = 541 + Height = 223 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object btnFont: TButton + Left = 8 + Top = 9 + Width = 110 + Height = 21 + Caption = 'Fo&nt...' + TabOrder = 0 + OnClick = FontClick + end + object edFont: TEdit + Left = 8 + Top = 34 + Width = 221 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + end + object btnHeadersFont: TButton + Tag = 2 + Left = 8 + Top = 122 + Width = 110 + Height = 21 + Caption = 'Headers Font...' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 4 + OnClick = FontClick + end + object edFixedFont: TEdit + Left = 8 + Top = 147 + Width = 221 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 5 + end + object btnEvenFont: TButton + Tag = 1 + Left = 8 + Top = 65 + Width = 110 + Height = 21 + Caption = 'E&ven Font...' + TabOrder = 2 + OnClick = FontClick + end + object edEvenFont: TEdit + Left = 8 + Top = 90 + Width = 221 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 3 + end + end + end + object tshBehaviors: TTabSheet + Caption = '&Behaviors' + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 541 + Height = 223 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Image3: TImage + Left = 7 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblSelection: TLabel + Left = 5 + Top = 12 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object Bevel3: TBevel + Left = 53 + Top = 17 + Width = 179 + Height = 4 + Shape = bsBottomLine + end + object lblLookAndFeel: TLabel + Left = 5 + Top = 81 + Width = 67 + Height = 13 + Caption = 'Look And Feel' + end + object Bevel15: TBevel + Left = 81 + Top = 85 + Width = 151 + Height = 4 + Shape = bsBottomLine + end + object Image8: TImage + Left = 7 + Top = 101 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D08777777777780877777788807DCCCCDCCDDD0877777777778787777788 + 8F07D08888888888880888888888807DCCCCCCCCDD0888888888888788888888 + 8F07D00000000000000000000000007DCCCCDCCDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F7777777FF07DDDDDDDDDDD0F777777777FF7F7777777 + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F777777FFF07DDDDDDDDDDD0F777777FFFFF7F777777F + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F7777777777F7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F77777FFFF07DDDDDDDDDDD0F77777777FFF7F77777FF + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D00000000000000000000000007DCDDDDCDDDD0000000000000000000000 + 0007D08888888888880888888888807DCCCCDCCDDD0777777777777777777777 + 7707D08888888888880888888888807DCCCCCCCCDD0F88888888888788888888 + 8707D08000000008880880000000807DCCCCDCCDDD0F00000000888788000000 + 8707D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + F707D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblMiscellaneous: TLabel + Left = 6 + Top = 147 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + end + object Bevel4: TBevel + Left = 80 + Top = 152 + Width = 152 + Height = 4 + Shape = bsBottomLine + end + object Image5: TImage + Left = 7 + Top = 167 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000008088F07DDDDDDDDDDDD0800000000000000000000 + 807DD0F0FFFF8FFFF8FFFF0FFF0F07DDDDDDDDDDDD0F0F77FFF8F777F8F777F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCDDDDCDDDD0F0F00FFF8F00FF8F00FF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCCCCCDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCDDDDCDDDD0F0FFFFFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCCCCDCCDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCCCCCDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCDCCDDD0F0FFFFFF8F0FFF8F0FFF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0777777777777770FFF0F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F0F8887F8887F8880FFF8F07DDDDDDDDDDDD0F0F888887F88887F88880 + F07DD0F0F0087F0087F0080FFF0F07DDDDDDDDDDDD0F0F800087F80087F80080 + F07DD0F0FFFF7FFFF7FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF7FFFFF7FFFFF0 + F07DD0800000000000000008080807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxIncludeFixed: TCheckBox + Left = 95 + Top = 51 + Width = 139 + Height = 17 + Caption = '&Including fixed cells' + TabOrder = 1 + OnClick = IncludeFixedClick + end + object chbxOnlySelected: TCheckBox + Left = 95 + Top = 29 + Width = 139 + Height = 17 + Caption = 'Only &selected cells' + TabOrder = 0 + OnClick = OnlySelectedClick + end + object chbxUse3DEffects: TCheckBox + Tag = 12 + Left = 95 + Top = 96 + Width = 139 + Height = 17 + Caption = '3D Effects' + TabOrder = 2 + OnClick = Use3DEffectsClick + end + object chbxUseSoft3D: TCheckBox + Tag = 13 + Left = 95 + Top = 118 + Width = 139 + Height = 17 + Caption = 'Soft &3D' + TabOrder = 3 + OnClick = UseSoft3DClick + end + object chbxRowAutoHeight: TCheckBox + Left = 95 + Top = 185 + Width = 139 + Height = 17 + Caption = '&Row Auto Height' + TabOrder = 5 + OnClick = RowAutoHeightClick + end + object chbxAutoWidth: TCheckBox + Left = 95 + Top = 163 + Width = 139 + Height = 17 + Caption = 'AutoWidth' + TabOrder = 4 + OnClick = chbxAutoWidthClick + end + end + end + end + object pnlPreview: TPanel + Left = 252 + Top = 49 + Width = 293 + Height = 200 + BevelOuter = bvLowered + TabOrder = 1 + end +end diff --git a/official/x.35/Lib/D11/dxPScxPCProdD11.bpl b/official/x.35/Lib/D11/dxPScxPCProdD11.bpl new file mode 100644 index 00000000..62d28649 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxPCProdD11.bpl differ diff --git a/official/x.35/Lib/D11/dxPScxPCProdD11.dcp b/official/x.35/Lib/D11/dxPScxPCProdD11.dcp new file mode 100644 index 00000000..810f32c9 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxPCProdD11.dcp differ diff --git a/official/x.35/Lib/D11/dxPScxPCProdD11.dcu b/official/x.35/Lib/D11/dxPScxPCProdD11.dcu new file mode 100644 index 00000000..25c6f5b2 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxPCProdD11.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxPageControlProducer.dcu b/official/x.35/Lib/D11/dxPScxPageControlProducer.dcu new file mode 100644 index 00000000..aa4a10b9 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxPageControlProducer.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxPivotGridLnk.dfm b/official/x.35/Lib/D11/dxPScxPivotGridLnk.dfm new file mode 100644 index 00000000..7c159195 --- /dev/null +++ b/official/x.35/Lib/D11/dxPScxPivotGridLnk.dfm @@ -0,0 +1,1204 @@ +object cxfmPivotGridReportLinkDesignWindow: TcxfmPivotGridReportLinkDesignWindow + Left = 349 + Top = 253 + BorderStyle = bsDialog + Caption = 'cxfmPivotGridReportLinkDesignWindow' + ClientHeight = 398 + ClientWidth = 702 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 0 + Top = 0 + Width = 702 + Height = 363 + ActivePage = tshView + TabOrder = 0 + object tshView: TTabSheet + Caption = 'View' + object lblShow: TLabel + Left = 5 + Top = 8 + Width = 26 + Height = 13 + Caption = 'Show' + end + object bvlShow: TBevel + Left = 43 + Top = 13 + Width = 253 + Height = 4 + Shape = bsBottomLine + end + object Bevel1: TBevel + Left = 56 + Top = 147 + Width = 240 + Height = 4 + Shape = bsBottomLine + end + object Image1: TImage + Left = 9 + Top = 37 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object imgCardFraming: TImage + Left = 9 + Top = 173 + Width = 64 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDD7777777777777777777DDDDDDDDDDDDDDDDDD00000000000000000 + 00DDDDDDD88888888888888888887DDDDDDDDDDDDDDDDD000000000000000000 + 00DDDDDDD8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDDDDD0FFFFFFF0FFFFFFFFF + 00DDDDD778FFFFFFF8FFF9999FF87DDDDDDDDDDDDDDD000FFFFFFF0FFF9999FF + 00DDDD8888FFFFFFF8FFF9999FF87DDDDDDDDDDDDDD0000FFFFFFF0FFF9999FF + 00DDDD8FF8FFFFFFF8FCCCC99FF87DDDCDDDDCDDDDD0FF0FFFFFFF0FCCCC99FF + 00DDDD8FF8FFFFFFF8FCCCC99FF87DDDCCCCDCCDDDD0FF0FFFFFFF0FCCCC99FF + 00DDDD8FF8F77777F8FCCCCFFFF87DDDCCCCCCCCDDD0FF0F77777F0FCCCCFFFF + 00DDDD8FF8F77777F8FCCCCFFFF87DDDCCCCDCCDDDD0FF0F77777F0FCCCCFFFF + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDCDDDDCDDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDDDDDDDDDDDD0F7000000000000000000 + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF777777F87DDDDDDDDDDDDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF7FFFFFF87DDDDDDDDDDDDDD0000F7FFFFF0FF7FFFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDDDDDDDDDDDD0F7000000000000000000 + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF77777FF87DDDDDDDDDDDDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF77FFFFF87DDDDDDDDDDDDDD0000F7FFFFF0FF77FFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F788888888888888888887DDDCDDDDCDDDDD0F7000000000000000000 + 00DDDD8F78FFFFFFF8FFFFFFFFF87DDDCCCCDCCDDDD0F70FFFFFFF0FFFFFFFFF + 00DDDD8FF8F77777F8FF777777F87DDDCCCCCCCCDDD0FF0F77777F0FF777777F + 00DDDD8888F7FFFFF8FF7FFFFFF87DDDCCCCDCCDDDD0000F7FFFFF0FF7FFFFFF + 00DDDD8FF8FFFFFFF8FFFFFFFFF87DDDCDDDDCDDDDD0FF0FFFFFFF0FFFFFFFFF + 00DDDD8F78888888888888888888DDDDDDDDDDDDDDD0F7000000000000000000 + 0DDDDD8F7FFFFF8FF7FFFFFF87DDDDDDDDDDDDDDDDD0F7FFFFF0FF7FFFFFF00D + DDDDDD8FFFFFFF8FFFFFFFFF87DDDDDDDDDDDDDDDDD0FFFFFFF0FFFFFFFFF00D + DDDDDD8888888888888888888DDDDDDDDDDDDDDDDDD0000000000000000000DD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblCardFraming: TLabel + Left = 5 + Top = 141 + Width = 38 + Height = 13 + Caption = 'Framing' + end + object chbxColumnFields: TCheckBox + Left = 90 + Top = 29 + Width = 200 + Height = 17 + Caption = '&Column Fields' + TabOrder = 0 + OnClick = chbxOptionsViewClick + end + object chbxShowExpandButtons: TCheckBox + Tag = 4 + Left = 90 + Top = 125 + Width = 200 + Height = 17 + Caption = '&Expand Buttons' + TabOrder = 4 + OnClick = chbxOptionsViewClick + end + object chbxHorizontalLines: TCheckBox + Tag = 1 + Left = 90 + Top = 157 + Width = 200 + Height = 17 + Caption = '&Horizontal Lines' + TabOrder = 5 + OnClick = chbxOptionsViewClick + end + object chbxVerticalLines: TCheckBox + Tag = 2 + Left = 90 + Top = 181 + Width = 200 + Height = 17 + Caption = '&Vertical Lines' + TabOrder = 6 + OnClick = chbxOptionsViewClick + end + object chbxBorders: TCheckBox + Tag = 3 + Left = 90 + Top = 205 + Width = 200 + Height = 17 + Caption = '&Borders' + TabOrder = 7 + OnClick = chbxOptionsViewClick + end + object chbxDataFields: TCheckBox + Left = 90 + Top = 53 + Width = 200 + Height = 17 + Caption = '&Data Fields' + TabOrder = 1 + OnClick = chbxOptionsViewClick + end + object chbxFilterFields: TCheckBox + Left = 90 + Top = 77 + Width = 200 + Height = 17 + Caption = '&Filter Fields' + TabOrder = 2 + OnClick = chbxOptionsViewClick + end + object chbxRowFields: TCheckBox + Left = 90 + Top = 101 + Width = 200 + Height = 17 + Caption = '&Row Fields' + TabOrder = 3 + OnClick = chbxOptionsViewClick + end + end + object tshBehaviors: TTabSheet + Caption = 'Behaviors' + ImageIndex = 1 + object lblExpanding: TLabel + Left = 5 + Top = 8 + Width = 50 + Height = 13 + Caption = 'Expanding' + end + object bvlExpanding: TBevel + Left = 62 + Top = 13 + Width = 234 + Height = 4 + Shape = bsBottomLine + end + object imgExpanding: TImage + Left = 9 + Top = 31 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 7778800000000000000000000000078888888888880000000000000000000000 + 007880FFF7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7FF777777FFF77777FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F8F7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7F7F8888FF7F88888FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F8F7777777777777777777078888888888880F7F7F888FFF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F0788077777777777777777777770788C8888C88880F7FF888888FFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880F0F7777777FFFFFFFFFFFF0788CCCCCCCC880F77777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7F7F8888FF7F88888FF7 + F0788077777777777777777777770788C8888C88880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F7F7F8888FF7F888888F7 + F0788077777777777777777777770788CCCC8CC8880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCCCCCC880F7FF88888FFFFFFFFFFF7 + F07880F0F777777FFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F77777777777777777777 + F078800000000000000000000000078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F888888880F88888888888078888888888880F77777777777777777777 + F07880F800008880F80000000008078888888888880F77777777777777777777 + F07880FFFFFFFFF0FFFFFFFFFFFF078888888888880FFFFFFFFFFFFFFFFFFFFF + F078800000000000000000000000088888888888880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object chbxExpandRows: TCheckBox + Tag = 1 + Left = 90 + Top = 53 + Width = 200 + Height = 17 + Caption = 'Rows' + TabOrder = 1 + OnClick = chbxExpandOptionsClick + end + object chbxExpandColumns: TCheckBox + Left = 90 + Top = 29 + Width = 200 + Height = 17 + Caption = 'Columns' + TabOrder = 0 + OnClick = chbxExpandOptionsClick + end + end + object tshFormatting: TTabSheet + Caption = 'Formatting' + ImageIndex = 4 + object lblLookAndFeel: TLabel + Left = 5 + Top = 8 + Width = 66 + Height = 13 + Caption = 'Look and Feel' + end + object bvlLookAndFeel: TBevel + Left = 85 + Top = 13 + Width = 211 + Height = 4 + Shape = bsBottomLine + end + object imgLookAndFeel: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D0887777787787FFFFFFFFFFF07DDDDDDDDDDD0F87777787787FFFFFFFFF + FF07D0888888888887F000FF0000F07DDDDDDDDDDD0F88888888887F000FF000 + 0F07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0880000080087F00000000FF07DDDDDDDDDDD0F80000080087F00000000 + FF07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0888888888887FFFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D07777777777777777777777707DCCCCDCCDDD0777777777777777777777 + 7707D0888888888887FFFFFFFFFFF07DCCCCCCCCDD0F88888888887FFFFFFFFF + FF07D0880000000887F000000000F07DCCCCDCCDDD0F80000000887F00000000 + 0F07D0888888888887FFFFFFFFFFF07DCDDDDCDDDD0F88888888887FFFFFFFFF + FF07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0880000000887F000000F00F07DDDDDDDDDDD0F80000000887F000000F0 + 0F07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0888888888887FFFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D07777777777777777777777707DCCCCDCCDDD0777777777777777777777 + 7707D0888888888887FFFFFFFFFFF07DCCCCCCCCDD0F88888888887FFFFFFFFF + FF07D0880000008887F00000FF00F07DCCCCDCCDDD0F80000008887F00000FF0 + 0F07D0888888888887FFFFFFFFFFF07DCDDDDCDDDD0F88888888887FFFFFFFFF + FF07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0880000000887F00000000FF07DDDDDDDDDDD0F80000000887F00000000 + FF07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgRefinements: TImage + Left = 8 + Top = 100 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777888888888 + 807DD0888888888887FFFFFFFFFF07DDCDDDDCDDDD0888888888887FFFFFFFFF + F07DD0888888888887FF7FFFFFFF07DDCCCCDCCDDD0888888888887FF777777F + F07DD0888888888887FF70888FFF07DDCCCCCCCCDD0888888888887FF7FFFF7F + F07DD0880000000887FF70FF8FFF07DDCCCCDCCDDD0880000000887FF7F00F7F + F07DD0888888888887FF70FF8FFF07DDCDDDDCDDDD0888888888887FF7F00F7F + F07DD0880008888887FF70000FFF07DDDDDDDDDDDD0880008888887FF7FFFF7F + F07DD0888888888887FF777777FF07DDDDDDDDDDDD0888888888887FF777777F + F07DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777888888888 + 807DD0888888888887FFFFFFFFFF07DDCDDDDCDDDD0888888888887FFFFFFFFF + F07DD0888888888887FFFFFFFFFF07DDCCCCDCCDDD0888888888887FFFFFFFFF + F07DD0888888888887FFCCCCCFFF07DDCCCCCCCCDD0888888888887FFFFFFFFF + F07DD0880000000887FCCCCCCCFF07DDCCCCDCCDDD0888888888887FFFFFFFFF + F07DD0888888888887FFCCCCCFFF07DDCDDDDCDDDD0888888888887FFFFFFFFF + F07DD0880000000887F9999999FF07DDDDDDDDDDDD0880000000887F88888FFF + F07DD0888888888887FF99999FFF07DDDDDDDDDDDD0888888888887F888888FF + F07DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777888888888 + 807DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0888888888887FF888FFFFF07DDDDDDDDDDDD0888888888887FF888FFFF + F07DD0880000888887FFFFFFFFFF07DDDDDDDDDDDD0880000888887FFFFFFFFF + F07DD0880000000087FF888888FF07DDDDDDDDDDDD0880000000087FF888888F + F07DD0888888888887FF888888FF07DDDDDDDDDDDD0888888888887FF888888F + F07DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblRefinements: TLabel + Left = 5 + Top = 78 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlRefinements: TBevel + Left = 70 + Top = 82 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object cbxLookAndFeel: TComboBox + Left = 90 + Top = 37 + Width = 202 + Height = 21 + Style = csDropDownList + ItemHeight = 0 + TabOrder = 0 + OnChange = cbxLookAndFeelChange + end + object chbxSuppressBackgroundBitmaps: TCheckBox + Tag = 1 + Left = 90 + Top = 97 + Width = 200 + Height = 17 + Caption = 'Suppress Background Textures' + TabOrder = 1 + OnClick = OptionsFormattingChanged + end + object chbxSuppressContentColoration: TCheckBox + Tag = 2 + Left = 90 + Top = 121 + Width = 200 + Height = 17 + Caption = 'Suppress Content Coloration' + TabOrder = 2 + OnClick = OptionsFormattingChanged + end + end + object tshStyles: TTabSheet + Caption = 'Styles' + ImageIndex = 4 + object bvlStyles: TBevel + Left = 115 + Top = 13 + Width = 181 + Height = 4 + Shape = bsBottomLine + end + object bvlStyleSheets: TBevel + Left = 72 + Top = 259 + Width = 224 + Height = 5 + Shape = bsBottomLine + end + object lblStyleSheets: TLabel + Left = 6 + Top = 255 + Width = 60 + Height = 13 + Caption = 'Style Sheets' + end + object bvlStylesHost: TBevel + Left = 6 + Top = 33 + Width = 214 + Height = 183 + end + object Label1: TLabel + Left = 77 + Top = 118 + Width = 68 + Height = 13 + Caption = '[ Styles Host ]' + Visible = False + end + object lblUseNativeStyles: TLabel + Left = 24 + Top = 9 + Width = 84 + Height = 13 + Caption = '&Use Native Styles' + FocusControl = chbxUseNativeStyles + OnClick = lblUseNativeStylesClick + end + object btnStyleColor: TButton + Left = 228 + Top = 61 + Width = 68 + Height = 23 + Caption = 'Co&lor...' + TabOrder = 2 + OnClick = btnStyleColorClick + end + object btnStyleFont: TButton + Left = 228 + Top = 33 + Width = 68 + Height = 23 + Caption = '&Font...' + TabOrder = 1 + OnClick = btnStyleFontClick + end + object btnStyleBackgroundBitmap: TButton + Left = 228 + Top = 97 + Width = 68 + Height = 23 + Caption = '&Bitmap...' + TabOrder = 3 + OnClick = btnStyleBackgroundBitmapClick + end + object chbxUseNativeStyles: TCheckBox + Left = 5 + Top = 8 + Width = 15 + Height = 17 + TabStop = False + Caption = '&Use Native Styles' + TabOrder = 0 + OnClick = OptionsFormattingChanged + end + object btnStyleSheetNew: TButton + Left = 6 + Top = 307 + Width = 68 + Height = 23 + Caption = '&New...' + TabOrder = 7 + OnClick = btnStyleSheetNewClick + end + object btnStyleSheetCopy: TButton + Left = 79 + Top = 307 + Width = 68 + Height = 23 + Caption = '&Copy...' + TabOrder = 8 + OnClick = btnStyleSheetCopyClick + end + object btnStyleSheetDelete: TButton + Left = 153 + Top = 307 + Width = 68 + Height = 23 + Caption = '&Delete...' + TabOrder = 9 + OnClick = btnStyleSheetDeleteClick + end + object btnStylesSaveAs: TButton + Left = 116 + Top = 223 + Width = 105 + Height = 23 + Caption = 'Save &As...' + TabOrder = 6 + OnClick = btnStylesSaveAsClick + end + object btnStyleSheetRename: TButton + Left = 226 + Top = 307 + Width = 68 + Height = 23 + Caption = '&Rename...' + TabOrder = 10 + OnClick = btnStyleSheetRenameClick + end + object btnStyleBackgroundBitmapClear: TButton + Left = 228 + Top = 125 + Width = 68 + Height = 23 + Caption = 'Clear' + TabOrder = 4 + OnClick = btnStyleClearClick + end + object btnStyleRestoreDefaults: TButton + Left = 6 + Top = 223 + Width = 105 + Height = 23 + Caption = 'Restore Defaults' + TabOrder = 5 + OnClick = btnStyleRestoreDefaultsClick + end + object cbxStyleSheets: TComboBox + Left = 9 + Top = 274 + Width = 288 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 11 + OnClick = cbxStyleSheetsClick + OnDrawItem = cbxStyleSheetsDrawItem + OnKeyDown = cbxStyleSheetsKeyDown + end + end + end + object pnlPreview: TPanel + Left = 309 + Top = 39 + Width = 382 + Height = 315 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + object PreviewPivotGrid: TcxPivotGrid + Left = 5 + Top = 5 + Width = 371 + Height = 302 + Enabled = False + Groups = < + item + IsCaptionAssigned = True + Caption = 'FieldsGroup 1' + end> + TabOrder = 0 + TabStop = True + object pgfPurchaseQuarter: TcxPivotGridField + Area = faColumn + AreaIndex = 0 + IsCaptionAssigned = True + Caption = 'Purchase Quarter' + DataBinding.ValueType = 'DateTime' + GroupIndex = 0 + GroupInterval = giDateQuarter + Visible = True + end + object pgfPurchaseMonth: TcxPivotGridField + Area = faColumn + AreaIndex = 1 + IsCaptionAssigned = True + Caption = 'Purchase Month' + DataBinding.ValueType = 'DateTime' + GroupIndex = 0 + GroupExpanded = False + GroupInterval = giDateMonth + Visible = True + end + object pgfPaymentType: TcxPivotGridField + Tag = 1 + Area = faRow + AreaIndex = 0 + IsCaptionAssigned = True + Caption = 'Payment Type' + DataBinding.ValueType = 'String' + Visible = True + Width = 90 + end + object pgfQuantity: TcxPivotGridField + Tag = 2 + Area = faData + AreaIndex = 0 + IsCaptionAssigned = True + Caption = 'Quantity' + DataBinding.ValueType = 'Integer' + Visible = True + Width = 62 + end + object pgfCarName: TcxPivotGridField + Tag = 3 + AreaIndex = 1 + IsCaptionAssigned = True + Caption = 'Car Name' + DataBinding.ValueType = 'String' + Visible = True + end + object pgfUnitPrice: TcxPivotGridField + Tag = 4 + AreaIndex = 0 + IsCaptionAssigned = True + Caption = 'Unit Price' + DataBinding.ValueType = 'Currency' + Visible = True + end + object pgfCompanyName: TcxPivotGridField + Tag = 5 + Area = faRow + AreaIndex = 1 + IsCaptionAssigned = True + Caption = 'Company Name' + DataBinding.ValueType = 'String' + Visible = True + Width = 90 + end + object pgfPaymentAmount: TcxPivotGridField + Tag = 6 + Area = faData + AreaIndex = 1 + IsCaptionAssigned = True + Caption = 'Payment Amount' + DataBinding.ValueType = 'Currency' + Visible = True + end + end + end + object lblPreviewWindow: TStaticText + Left = 314 + Top = 24 + Width = 82 + Height = 14 + AutoSize = False + Caption = 'Preview' + TabOrder = 2 + end + object cxStyleRepository1: TcxStyleRepository + Left = 4 + Top = 368 + object styleCategory: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWindowText + end + object styleHeader: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWindowText + end + object styleContent: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWindowText + end + end + object pmStyles: TPopupMenu + Images = ilStylesPopup + OnPopup = pmStylesPopup + Left = 32 + Top = 368 + object miStyleFont: TMenuItem + Caption = '&Font...' + ImageIndex = 0 + ShortCut = 16454 + OnClick = btnStyleFontClick + end + object miStyleColor: TMenuItem + Caption = '&Color...' + ShortCut = 16451 + OnClick = btnStyleColorClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miStyleBackgroundBitmap: TMenuItem + Caption = '&Bitmap...' + ImageIndex = 1 + OnClick = btnStyleBackgroundBitmapClick + end + object miStyleBackgroundBitmapClear: TMenuItem + Caption = 'Clear' + ImageIndex = 3 + ShortCut = 16430 + OnClick = btnStyleClearClick + end + object milLine: TMenuItem + Caption = '-' + end + object miStylesSelectAll: TMenuItem + Caption = 'Select A&ll' + ShortCut = 16449 + OnClick = miStylesSelectAllClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miStyleRestoreDefaults: TMenuItem + Caption = 'Restore Defaults' + OnClick = btnStyleRestoreDefaultsClick + end + object miLine4: TMenuItem + Caption = '-' + end + object miStylesSaveAs: TMenuItem + Caption = 'Save &As...' + ImageIndex = 2 + ShortCut = 16467 + OnClick = btnStylesSaveAsClick + end + end + object ilStylesPopup: TImageList + Left = 60 + Top = 368 + Bitmap = { + 494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00000000000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF000000 + 0000008080000080800000808000008080000080800000808000008080000080 + 8000008080000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000000000000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000008080000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF00FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800080808000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00C0C0C00000FFFF00C0C0C000FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000000000008080800080808000000000008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C00000000000C0C0C00000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFC001FFFF + FE07001F8001FFF9FF9F000F8001E7FFFF9F00078001C3F3E01F00038001C3E7 + F99F00018001E1C7F99B00008001F08FF99B00018001F81FF89300018001FC3F + D80300018001F81FD9BF80018001F09FC93FE0018001C1C7C03FE001800183E3 + FFFFE00180018FF1FFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxPScxPivotGridLnk.res b/official/x.35/Lib/D11/dxPScxPivotGridLnk.res new file mode 100644 index 00000000..aab165c7 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxPivotGridLnk.res differ diff --git a/official/x.35/Lib/D11/dxPScxSSLnk.dfm b/official/x.35/Lib/D11/dxPScxSSLnk.dfm new file mode 100644 index 00000000..f88a53f7 --- /dev/null +++ b/official/x.35/Lib/D11/dxPScxSSLnk.dfm @@ -0,0 +1,510 @@ +object fmdxSpreadSheetDesignWindow: TfmdxSpreadSheetDesignWindow + Left = 551 + Top = 286 + BorderStyle = bsDialog + Caption = 'SpreadSheet DesignWindow' + ClientHeight = 263 + ClientWidth = 557 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object pgctrlMain: TPageControl + Left = 4 + Top = 6 + Width = 549 + Height = 221 + ActivePage = tshOptions + MultiLine = True + TabOrder = 1 + OnChange = pgctrlMainChange + object tshOptions: TTabSheet + Caption = '&Options' + object pnlOptions: TPanel + Left = 0 + Top = 0 + Width = 541 + Height = 193 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Bevel11: TBevel + Left = 40 + Top = 10 + Width = 194 + Height = 4 + Shape = bsBottomLine + end + object Bevel4: TBevel + Left = 79 + Top = 83 + Width = 156 + Height = 5 + Shape = bsBottomLine + end + object Image5: TImage + Left = 7 + Top = 102 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D7AAAAAA9AAAAA7AAAAA9AAAA07DCDDDDCDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7AAAAAA9AAAAA7AAAAA9AAAA07DCCCCDCCDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7A77AAA9A777A7A777A9A77A07DCCCCCCCCDD7F77FFF8F777F8F777F8F7 + 7F07D7AAAAAA9AAAAA7AAAAA9AAAA07DCCCCDCCDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D79999999777777777779999907DCDDDDCDDDD7888888888888888888888 + 8807D7CCCCCC9BBBBB7BBBBB9CCCC07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7C77CCC9B77BB7B777B9C77C07DDDDDDDDDDD7F77FFF8F77FF8F777F8F7 + 7F07D7CCCCCC9BBBBB7BBBBB9CCCC07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D77777779777777777779777707DDDDDDDDDDD7888888888888888888888 + 8807D7CCCCCC9BBBBB7BBBBB9CCCC07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7C7777C9B77BB7B77BB9C7CC07DDDDDDDDDDD7F7777F8F77FF8F77FF8F7 + FF07D7CCCCCC9BBBBB7BBBBB9CCCC07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D77777779777777777779777707DDDDDDDDDDD7888888888888888888888 + 8807D7CCCCCC9BBBBB7BBBBB9CCCC07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7C777CC9B777B7B777B9C7CC07DDDDDDDDDDD7F777FF8F777F8F777F8F7 + FF07D7CCCCCC9BBBBB7BBBBB9CCCC07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D79999999777777777779999907DDDDDDDDDDD7888888888888888888888 + 8807D7CCCCCC9BBBBB7BBBBB9CCCC07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7C777CC9B777B7B77BB9C77C07DDDDDDDDDDD7F777FF8F777F8F77FF8F7 + 7F07D7CCCCCC9BBBBB7BBBBB9CCCC07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D77777779777777777779777707DDDDDDDDDDD7888888888888888888888 + 8807D7CCCCCC9BBBBB7BBBBB9CCCC07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7C777CC9B7B7B7B777B9C77C07DDDDDDDDDDD7F777FF8F7F7F8F777F8F7 + 7F07D7CCCCCC9BBBBB7BBBBB9CCCC07DCDDDDCDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D77777777777777777777777707DCCCCDCCDDD7777777777777777777777 + 7707D7F888887F88887F88887F88807DCCCCCCCCDD7888888788888788888788 + 8807D7F777787F77787F77787F77807DCCCCDCCDDD7877778787778787778787 + 7807D7FFFFFF7FFFFF7FFFFF7FFFF07DCDDDDCDDDD7888888788888788888788 + 8807D7777777777777777777777770DDDDDDDDDDDD7777777777777777777777 + 770DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgGrid: TImage + Left = 6 + Top = 31 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D7FFFFFF7FFFFF7FFFFF7FFFF07DCDDDDCDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7FFFFFF7FFFFF7FFFFF7FFFF07DCCCCDCCDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7F7777F7F777F7F777F7F7FF07DCCCCCCCCDD7F7777F8F777F8F777F8F7 + FF07D7FFFFFF7FFFFF7FFFFF7FFFF07DCCCCDCCDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D77777777777777777777777707DCDDDDCDDDD7888888888888888888888 + 8807D7FFFFFF7FFFFF7FFFFF7FFFF07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7F77F7F7F77FF7F7F7F7F77F07DDDDDDDDDDD7F77F7F8F77FF8F7F7F8F7 + 7F07D7FFFFFF7FFFFF7FFFFF7FFFF07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D77777777777777777777777707DDDDDDDDDDD7888888888888888888888 + 8807D7FFFFFF7FFFFF7FFFFF7FFFF07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7F7F7FF7F77FF7F777F7F77F07DDDDDDDDDDD7F7F7FF8F77FF8F777F8F7 + 7F07D7FFFFFF7FFFFF7FFFFF7FFFF07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D77777777777777777777777707DDDDDDDDDDD7888888888888888888888 + 8807D7FFFFFF7FFFFF7FFFFF7FFFF07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7F77FFF7F7F7F7F777F7F77F07DDDDDDDDDDD7F77FFF8F7F7F8F777F8F7 + 7F07D7FFFFFF7FFFFF7FFFFF7FFFF07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D77777777777777777777777707DDDDDDDDDDD7888888888888888888888 + 8807D7FFFFFF7FFFFF7FFFFF7FFFF07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7F7777F7F77FF7F77FF7F77F07DDDDDDDDDDD7F7777F8F77FF8F77FF8F7 + 7F07D7FFFFFF7FFFFF7FFFFF7FFFF07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D77777777777777777777777707DDDDDDDDDDD7888888888888888888888 + 8807D7FFFFFF7FFFFF7FFFFF7FFFF07DDDDDDDDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7F7777F7F77FF7F77FF7F77F07DDDDDDDDDDD7F7778F8F77FF8F77FF8F7 + 7F07D7FFFFFF7FFFFF7FFFFF7FFFF07DCDDDDCDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D77777777777777777777777707DCCCCDCCDDD7888888888888888888888 + 8807D78888887888887888887888807DCCCCCCCCDD7FFFFFF8FFFFF8FFFFF8FF + FF07D78777787877787877787877807DCCCCDCCDDD7F7777F8F777F8F777F8F7 + 7F07D78888887888887888887888807DCDDDDCDDDD7FFFFFF8FFFFF8FFFFF8FF + FF07D7777777777777777777777770DDDDDDDDDDDD7777777777777777777777 + 770DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblShow: TLabel + Left = 5 + Top = 6 + Width = 26 + Height = 13 + Caption = 'Show' + end + object lblMiscellaneous: TLabel + Left = 5 + Top = 78 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + end + object chbxRowAutoHeight: TCheckBox + Left = 88 + Top = 105 + Width = 150 + Height = 17 + Caption = '&Row AutoHeight' + TabOrder = 2 + OnClick = chbxRowAutoHeightClick + end + object chbxShowRowAndColumnHeadings: TCheckBox + Left = 88 + Top = 27 + Width = 150 + Height = 17 + Caption = 'Row and column headings' + TabOrder = 0 + OnClick = chbxShowRowAndColumnHeadingsClick + end + object chbxShowGridlines: TCheckBox + Left = 88 + Top = 50 + Width = 150 + Height = 17 + Caption = 'Gridlines' + TabOrder = 1 + OnClick = chbxShowGridlinesClick + end + object chbxSuppressSourceFormats: TCheckBox + Left = 88 + Top = 128 + Width = 150 + Height = 17 + Caption = '&Suppress source formats' + TabOrder = 3 + OnClick = chbxSuppressSourceFormatsClick + end + object lblPreview: TStaticText + Left = 243 + Top = 3 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 4 + end + end + end + object tshColor: TTabSheet + Caption = '&Color' + object pnlColor: TPanel + Left = 0 + Top = 0 + Width = 541 + Height = 193 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblGridLinesColor: TLabel + Left = 6 + Top = 144 + Width = 79 + Height = 13 + Caption = '&Grid lines color : ' + OnClick = lblColorClick + end + object bvlLineColorHolder: TBevel + Left = 91 + Top = 140 + Width = 134 + Height = 21 + Visible = False + end + object gbxFixedTransparent: TGroupBox + Left = 5 + Top = 74 + Width = 231 + Height = 54 + Caption = ' ' + TabOrder = 3 + object lblFixedColor: TLabel + Left = 6 + Top = 24 + Width = 62 + Height = 13 + Caption = 'F&ixed color : ' + OnClick = lblColorClick + end + object bvlFixedColorHolder: TBevel + Left = 86 + Top = 20 + Width = 134 + Height = 21 + Visible = False + end + end + object gbxTransparent: TGroupBox + Left = 5 + Top = 8 + Width = 231 + Height = 54 + Caption = ' ' + TabOrder = 1 + object lblColor: TLabel + Left = 6 + Top = 24 + Width = 35 + Height = 13 + Caption = 'Co&lor : ' + OnClick = lblColorClick + end + object bvlColorHolder: TBevel + Left = 86 + Top = 20 + Width = 134 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 18 + Top = 6 + Width = 15 + Height = 17 + TabOrder = 0 + OnClick = chbxFixedTransparentClick + end + object chbxFixedTransparent: TCheckBox + Tag = 1 + Left = 18 + Top = 72 + Width = 15 + Height = 17 + TabOrder = 2 + OnClick = chbxFixedTransparentClick + end + object stTransparent: TStaticText + Left = 33 + Top = 7 + Width = 76 + Height = 17 + Caption = ' &Transparent ' + FocusControl = chbxTransparent + TabOrder = 4 + OnClick = stTransparentClick + end + object stFixedTransparent: TStaticText + Left = 33 + Top = 73 + Width = 98 + Height = 17 + Caption = ' Fixed Transparent ' + FocusControl = chbxFixedTransparent + TabOrder = 5 + OnClick = stFixedTransparentClick + end + end + end + object tshFont: TTabSheet + Caption = '&Font' + object pnlFont: TPanel + Left = 0 + Top = 0 + Width = 541 + Height = 193 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object btnFont: TButton + Left = 8 + Top = 9 + Width = 110 + Height = 23 + Caption = 'Fo&nt...' + TabOrder = 0 + OnClick = btnFixedFontClick + end + object edFont: TEdit + Left = 8 + Top = 38 + Width = 224 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + end + object btnFixedFont: TButton + Tag = 1 + Left = 8 + Top = 70 + Width = 110 + Height = 23 + Caption = 'Fi&xed Font...' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 2 + OnClick = btnFixedFontClick + end + object edFixedFont: TEdit + Left = 8 + Top = 99 + Width = 224 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 3 + end + end + end + object tshBehaviors: TTabSheet + Caption = '&Behaviors' + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 541 + Height = 193 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Image3: TImage + Left = 7 + Top = 102 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object Bevel3: TBevel + Left = 56 + Top = 83 + Width = 178 + Height = 4 + Shape = bsBottomLine + end + object Image1: TImage + Left = 22 + Top = 31 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888777777777777777708888888888 + 888887FFFFFFFFFFFFFFF08888888888888887F7777777777777F07777708888 + 888887F7777777777777F0FFFFF08888888887F7777777777777F07777F07777 + 708887FFFFFFFFFFFFFFF07777F0FFFFF08887F777777777777FF07777F07777 + F08887FFFFFFFFFFFFFFF0FFFFF07777F08887F77777777777FFF077FFF07777 + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777777FFFFF0777FF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777FFFFFFFF07FFFF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF0777FF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF077FFF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777777F077FFF077FF + F08887F7777777777777F0FFFFF0FFFFF08887F7777777777777F0FFFFF07FFF + F08887FFFFFFFFFFFFFFF07777F0FFFFF0888000000000000000007777F077FF + F08888888887F7777777777777F0FFFFF08888888887FFFFFFFFFFFFFFF07777 + F0888888888000000000000000007777F08888888888888887F7777777777777 + F08888888888888887FFFFFFFFFFFFFFF0888888888888888000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object Bevel10: TBevel + Left = 83 + Top = 10 + Width = 150 + Height = 4 + Shape = bsBottomLine + end + object lblOnEveryPage: TLabel + Left = 5 + Top = 6 + Width = 72 + Height = 13 + Caption = 'On Every Page' + end + object lblSelection: TLabel + Left = 5 + Top = 78 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object chbxOnlySelected: TCheckBox + Left = 88 + Top = 102 + Width = 150 + Height = 17 + Caption = 'Only &selected cells' + TabOrder = 1 + OnClick = chbxOnlySelectedClick + end + object chbxFixedRowsOnEveryPage: TCheckBox + Left = 88 + Top = 29 + Width = 150 + Height = 17 + Caption = 'Fi&xed Rows On Every Page' + TabOrder = 0 + OnClick = chbxFixedRowsOnEveryPageClick + end + end + end + end + object pnlPreview: TPanel + Left = 253 + Top = 50 + Width = 289 + Height = 165 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 0 + end +end diff --git a/official/x.35/Lib/D11/dxPScxScheduler2Lnk.dcu b/official/x.35/Lib/D11/dxPScxScheduler2Lnk.dcu new file mode 100644 index 00000000..cd08003c Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxScheduler2Lnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxScheduler2Lnk.dfm b/official/x.35/Lib/D11/dxPScxScheduler2Lnk.dfm new file mode 100644 index 00000000..6d2f0768 --- /dev/null +++ b/official/x.35/Lib/D11/dxPScxScheduler2Lnk.dfm @@ -0,0 +1,1634 @@ +object cxfmSchedulerReportLinkDesignWindow: TcxfmSchedulerReportLinkDesignWindow + Left = 296 + Top = 90 + BorderStyle = bsDialog + Caption = 'cxfmSchedulerReportLinkDesignWindow' + ClientHeight = 446 + ClientWidth = 618 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 5 + Width = 610 + Height = 404 + ActivePage = tshPrintStyles + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + OnChange = PageControl1Change + object tshPrintRange: TTabSheet + Caption = 'Print Range' + ImageIndex = 3 + object lblPrintRangeStart: TLabel + Left = 17 + Top = 22 + Width = 28 + Height = 13 + Caption = '&Start:' + end + object lblPrintRangeEnd: TLabel + Left = 18 + Top = 54 + Width = 22 + Height = 13 + Caption = '&End:' + end + object lblPrintRangesMiscellaneous: TLabel + Left = 5 + Top = 91 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + Visible = False + end + object Bevel1: TBevel + Left = 80 + Top = 95 + Width = 231 + Height = 4 + Shape = bsBottomLine + Visible = False + end + object dePrintRangeStart: TcxDateEdit + Left = 70 + Top = 18 + EditValue = 38187d + Properties.OnEditValueChanged = dePrintRangeStartEditValueChanged + TabOrder = 0 + Width = 235 + end + object dePrintRangeEnd: TcxDateEdit + Left = 70 + Top = 50 + EditValue = 38187d + Properties.OnEditValueChanged = dePrintRangeEndEditValueChanged + TabOrder = 1 + Width = 235 + end + object chbxHideDetailsOfPrivateAppointments: TcxCheckBox + Left = 66 + Top = 113 + Caption = 'Hide Details of Private Appointments' + TabOrder = 2 + Visible = False + Width = 236 + end + end + object tshPrintStyles: TTabSheet + Caption = 'Print Styles' + object lblPrintStylesOptions: TLabel + Left = 5 + Top = 48 + Width = 37 + Height = 13 + Caption = 'Options' + end + object bvlPrintStyleOptions: TBevel + Left = 50 + Top = 52 + Width = 258 + Height = 4 + Shape = bsBottomLine + end + object lblPreviewWindow: TStaticText + Left = 324 + Top = 0 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 0 + end + object cbxPrintStyles: TcxImageComboBox + Left = 6 + Top = 7 + Properties.Alignment.Vert = taVCenter + Properties.Items = <> + TabOrder = 1 + OnClick = cbxPrintStylesClick + Width = 303 + end + object pcPrintStyleOptions: TPageControl + Left = 4 + Top = 62 + Width = 314 + Height = 313 + ActivePage = tshYearly + Style = tsButtons + TabOrder = 2 + TabStop = False + object tshDaily: TTabSheet + Caption = 'Daily' + TabVisible = False + object lblPrintStyleDailyLayout: TLabel + Left = 14 + Top = 4 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleDailyLayout + end + object lblPrintStyleDailyInclude: TLabel + Left = 14 + Top = 64 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleDailyPrintFrom: TLabel + Left = 14 + Top = 136 + Width = 53 + Height = 13 + Caption = 'Print &From:' + FocusControl = tePrintStyleDailyPrintFrom + end + object lblPrintStyleDailyPrintTo: TLabel + Left = 14 + Top = 165 + Width = 41 + Height = 13 + Caption = 'Print &To:' + FocusControl = tePrintStyleDailyPrintTo + end + object lblPrintStyleDailyResourceCountPerPage: TLabel + Left = 14 + Top = 34 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleDailyResourceCountPerPage + end + object Bevel2: TBevel + Left = 0 + Top = 192 + Width = 306 + Height = 4 + Shape = bsBottomLine + end + object cbxPrintStyleDailyLayout: TcxComboBox + Left = 115 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/day' + '2 pages/day') + TabOrder = 0 + OnClick = cbxPrintStyleDailyLayoutClick + Height = 23 + Width = 186 + end + object chbxPrintStyleDailyTaskPad: TcxCheckBox + Left = 111 + Top = 61 + Caption = 'Task&Pad' + TabOrder = 2 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleDailyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 82 + Caption = 'Notes Area (&Blank)' + TabOrder = 3 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleDailyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 103 + Caption = 'Notes Area (&Lined)' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object tePrintStyleDailyPrintFrom: TcxTimeEdit + Left = 114 + Top = 132 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 5 + Width = 100 + end + object tePrintStyleDailyPrintTo: TcxTimeEdit + Tag = 1 + Left = 114 + Top = 161 + EditValue = 0.000000000000000000 + Properties.ImmediatePost = True + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 6 + Width = 100 + end + object sePrintStyleDailyResourceCountPerPage: TcxSpinEdit + Left = 115 + Top = 30 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 1 + Width = 100 + end + object chbxPrintStyleDailyShowResourceImages: TcxCheckBox + Left = -1 + Top = 201 + Caption = 'Show resource images' + TabOrder = 7 + OnClick = chbxPrintStyleShowResourceImagesClick + Width = 306 + end + object chbxPrintStyleDailyShowEventImages: TcxCheckBox + Left = -1 + Top = 222 + Caption = 'Show event images' + TabOrder = 8 + OnClick = chbxPrintStyleShowEventImagesClick + Width = 306 + end + end + object tshWeekly: TTabSheet + Caption = 'Weekly' + ImageIndex = 1 + TabVisible = False + object lblPrintStyleWeeklyPrintTo: TLabel + Left = 14 + Top = 212 + Width = 41 + Height = 13 + Caption = 'Print &To:' + FocusControl = tePrintStyleWeeklyPrintTo + end + object lblPrintStyleWeeklyPrintFrom: TLabel + Left = 14 + Top = 183 + Width = 53 + Height = 13 + Caption = 'Print &From:' + FocusControl = tePrintStyleWeeklyPrintFrom + end + object lblPrintStyleWeeklyInclude: TLabel + Left = 14 + Top = 119 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleWeeklyLayout: TLabel + Left = 14 + Top = 33 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleWeeklyLayout + end + object lblPrintStyleWeeklyArrange: TLabel + Left = 14 + Top = 4 + Width = 43 + Height = 13 + Caption = '&Arrange:' + FocusControl = cbxPrintStyleWeeklyArrange + end + object lblPrintStyleWeeklyResourceCountPerPage: TLabel + Left = 14 + Top = 94 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleWeeklyResourceCountPerPage + end + object lblPrintStyleWeeklyDaysLayout: TLabel + Left = 14 + Top = 63 + Width = 61 + Height = 13 + Caption = '&Days layout:' + FocusControl = cbxPrintStyleWeeklyDaysLayout + end + object Bevel3: TBevel + Left = 0 + Top = 237 + Width = 306 + Height = 4 + Shape = bsBottomLine + end + object tePrintStyleWeeklyPrintTo: TcxTimeEdit + Tag = 1 + Left = 114 + Top = 207 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 8 + Width = 100 + end + object tePrintStyleWeeklyPrintFrom: TcxTimeEdit + Left = 114 + Top = 178 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 7 + Width = 100 + end + object chbxPrintStyleWeeklyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 152 + Caption = 'Notes Area (&Lined)' + TabOrder = 6 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleWeeklyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 134 + Caption = 'Notes Area (&Blank)' + TabOrder = 5 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object cbxPrintStyleWeeklyArrange: TcxComboBox + Left = 115 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + 'Top to Bottom' + 'Left to Right') + TabOrder = 0 + OnClick = cbxPrintStyleWeeklyArrangeClick + Height = 23 + Width = 186 + end + object cbxPrintStyleWeeklyLayout: TcxComboBox + Left = 115 + Top = 29 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/day' + '2 pages/day') + TabOrder = 1 + OnClick = cbxPrintStyleWeeklyLayoutClick + Height = 23 + Width = 186 + end + object chbxPrintStyleWeeklyTaskPad: TcxCheckBox + Left = 111 + Top = 116 + Caption = 'TaskPad' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleWeeklyDontPrintWeekends: TcxCheckBox + Left = -1 + Top = 243 + Caption = 'Don'#39't Print &Weekends' + TabOrder = 9 + OnClick = chbxPrintStyleWeeklyDontPrintWeekendsClick + Width = 285 + end + object sePrintStyleWeeklyResourceCountPerPage: TcxSpinEdit + Tag = 1 + Left = 115 + Top = 90 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 3 + Width = 100 + end + object cbxPrintStyleWeeklyDaysLayout: TcxComboBox + Left = 115 + Top = 59 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + 'Two columns' + 'One column') + TabOrder = 2 + OnClick = cbxPrintStyleWeeklyDaysLayoutClick + Height = 23 + Width = 186 + end + object chbxPrintStyleWeeklyShowEventImages: TcxCheckBox + Left = -1 + Top = 283 + Caption = 'Show event images' + TabOrder = 11 + OnClick = chbxPrintStyleShowEventImagesClick + Width = 306 + end + object chbxPrintStyleWeeklyShowResourceImages: TcxCheckBox + Left = -1 + Top = 263 + Caption = 'Show resource images' + TabOrder = 10 + OnClick = chbxPrintStyleShowResourceImagesClick + Width = 306 + end + end + object tshMonthly: TTabSheet + Caption = 'Monthly' + ImageIndex = 2 + TabVisible = False + object lblPrintStyleMonthlyLayout: TLabel + Left = 14 + Top = 4 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleMonthlyLayout + end + object lblPrintStyleMonthlyInclude: TLabel + Left = 14 + Top = 62 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleMonthlyResourceCountPerPage: TLabel + Left = 14 + Top = 34 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleMonthlyResourceCountPerPage + end + object Bevel4: TBevel + Left = 0 + Top = 127 + Width = 314 + Height = 4 + Shape = bsBottomLine + end + object cbxPrintStyleMonthlyLayout: TcxComboBox + Left = 115 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/month' + '2 pages/month') + TabOrder = 0 + OnClick = cbxPrintStyleMonthlyLayoutClick + Height = 23 + Width = 186 + end + object chbxPrintStyleMonthlyTaskPad: TcxCheckBox + Left = 111 + Top = 59 + Caption = 'Task&Pad' + TabOrder = 2 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleMonthlyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 80 + Caption = 'Notes Area (&Blank)' + TabOrder = 3 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleMonthlyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 101 + Caption = 'Notes Area (&Lined)' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleMonthlyDontPrintWeekends: TcxCheckBox + Left = -1 + Top = 136 + Caption = 'Don'#39't Print &Weekends' + TabOrder = 5 + OnClick = chbxPrintStyleMonthlyDontPrintWeekendsClick + Width = 285 + end + object chbxPrintStyleMonthlyPrintExactlyOneMonthPerPage: TcxCheckBox + Left = -1 + Top = 156 + Caption = 'Print Exactly One Month Per Page' + TabOrder = 6 + OnClick = chbxPrintStyleMonthlyPrintExactlyOneMonthPerPageClick + Width = 285 + end + object sePrintStyleMonthlyResourceCountPerPage: TcxSpinEdit + Tag = 2 + Left = 115 + Top = 29 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 1 + Width = 100 + end + object chbxPrintStyleMonthlyShowEventImages: TcxCheckBox + Left = -1 + Top = 198 + Caption = 'Show event images' + TabOrder = 7 + OnClick = chbxPrintStyleShowEventImagesClick + Width = 306 + end + object chbxPrintStyleMonthlyShowResourceImages: TcxCheckBox + Left = -1 + Top = 177 + Caption = 'Show resource images' + TabOrder = 8 + OnClick = chbxPrintStyleShowResourceImagesClick + Width = 306 + end + end + object tshTrifold: TTabSheet + Caption = 'Tri-fold' + ImageIndex = 3 + TabVisible = False + object lblPrintStyleTrifoldSectionLeft: TLabel + Left = 14 + Top = 4 + Width = 61 + Height = 13 + Caption = '&Left Section:' + FocusControl = cbxPrintStyleTrifoldSectionLeft + end + object lblPrintStyleTrifoldSectionMiddle: TLabel + Left = 14 + Top = 38 + Width = 72 + Height = 13 + Caption = '&Middle Section:' + FocusControl = cbxPrintStyleTrifoldSectionMiddle + end + object lblPrintStyleTrifoldSectionRight: TLabel + Left = 14 + Top = 71 + Width = 67 + Height = 13 + Caption = '&Right Section:' + FocusControl = cbxPrintStyleTrifoldSectionRight + end + object cbxPrintStyleTrifoldSectionLeft: TcxComboBox + Left = 100 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + TabOrder = 0 + OnClick = cbxPrintStyleTrifoldSectionModeClick + Height = 23 + Width = 201 + end + object cbxPrintStyleTrifoldSectionMiddle: TcxComboBox + Tag = 1 + Left = 100 + Top = 33 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + TabOrder = 1 + OnClick = cbxPrintStyleTrifoldSectionModeClick + Height = 23 + Width = 201 + end + object cbxPrintStyleTrifoldSectionRight: TcxComboBox + Tag = 2 + Left = 100 + Top = 66 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + TabOrder = 2 + OnClick = cbxPrintStyleTrifoldSectionModeClick + Height = 23 + Width = 201 + end + end + object tshDetails: TTabSheet + Caption = 'Details' + ImageIndex = 4 + TabVisible = False + object chbxPrintStyleDetailsUsePagination: TcxCheckBox + Left = 14 + Top = 0 + Caption = 'Start a New Page Each:' + TabOrder = 0 + OnClick = chbxPrintStyleDetailsUsePaginationClick + Width = 187 + end + object cbxPrintStyleDetailsPagination: TcxComboBox + Left = 203 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + 'Day' + 'Week' + 'Month') + TabOrder = 1 + OnClick = cbxPrintStyleDetailsPaginationClick + Height = 23 + Width = 98 + end + end + object tshMemo: TTabSheet + Caption = 'Memo' + ImageIndex = 5 + TabVisible = False + object chbxPrintStyleMemoStartEachItemOnNewPage: TcxCheckBox + Left = 14 + Top = 1 + Caption = 'Start Each Item On New Page' + TabOrder = 0 + OnClick = chbxPrintStyleMemoStartEachItemOnNewPageClick + Width = 187 + end + object chbxPrintStyleMemoPrintOnlySelectedEvents: TcxCheckBox + Left = 14 + Top = 25 + Caption = 'Print Only Selected Events' + State = cbsChecked + TabOrder = 1 + OnClick = chbxPrintStyleMemoPrintOnlySelectedEventsClick + Width = 187 + end + end + object tshYearly: TTabSheet + ImageIndex = 6 + TabVisible = False + object lblPrintStyleYearlyMonthPerPage: TLabel + Left = 14 + Top = 38 + Width = 67 + Height = 13 + Caption = '&Months/Page:' + FocusControl = cbxPrintStyleYearlyMonthPerPage + end + object lblPrintStyleYearlyResourceCountPerPage: TLabel + Left = 14 + Top = 72 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleYearlyResourceCountPerPage + Visible = False + end + object lblPrintStyleYearlyInclude: TLabel + Left = 14 + Top = 102 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleYearlyLayout: TLabel + Left = 14 + Top = 4 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleYearlyLayout + end + object Bevel5: TBevel + Left = 0 + Top = 168 + Width = 306 + Height = 4 + Shape = bsBottomLine + end + object cbxPrintStyleYearlyMonthPerPage: TcxComboBox + Left = 115 + Top = 33 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/year' + '2 pages/year' + '3 pages/year' + '4 pages/year' + '6 pages/year' + '12 pages/year') + TabOrder = 1 + Text = '12 pages/year' + OnClick = cbxPrintStyleYearlyMonthPagesPerYearClick + Height = 23 + Width = 186 + end + object sePrintStyleYearlyResourceCountPerPage: TcxSpinEdit + Tag = 3 + Left = 115 + Top = 68 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 2 + Visible = False + Width = 100 + end + object chbxPrintStyleYearlyTaskPad: TcxCheckBox + Left = 111 + Top = 99 + Caption = 'Task&Pad' + TabOrder = 3 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleYearlyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 120 + Caption = 'Notes Area (&Blank)' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleYearlyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 141 + Caption = 'Notes Area (&Lined)' + TabOrder = 5 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object cbxPrintStyleYearlyLayout: TcxComboBox + Left = 115 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/month' + '2 pages/month') + TabOrder = 0 + Text = '1 page/month' + OnClick = cbxPrintStyleYearlyLayoutClick + Height = 23 + Width = 186 + end + object chbxPrimaryPageHeadersOnly: TcxCheckBox + Left = -1 + Top = 178 + Caption = 'Primary page headers only' + TabOrder = 6 + OnClick = chbxPrimaryPageHeadersOnlyClick + Width = 153 + end + object chbxPrintStyleYearlyShowEventImages: TcxCheckBox + Left = -1 + Top = 199 + Caption = 'Show event images' + TabOrder = 7 + OnClick = chbxPrintStyleShowEventImagesClick + Width = 306 + end + end + end + object pnlPrintStylesPreview: TPanel + Left = 323 + Top = 17 + Width = 275 + Height = 356 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 3 + object pbxPrintStylesPreview: TPaintBox + Left = 1 + Top = 1 + Width = 273 + Height = 354 + Align = alClient + OnPaint = pbxPrintStylesPreviewPaint + end + end + end + object tshFormatting: TTabSheet + Caption = 'Formatting' + ImageIndex = 2 + object bvlLookAndFeel: TBevel + Left = 85 + Top = 13 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object lblLookAndFeel: TLabel + Left = 5 + Top = 8 + Width = 66 + Height = 13 + Caption = 'Look and Feel' + end + object imgLookAndFeel: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDD77777777777777777777 + 7777D0000000000000000000000007DDDDDDDDDDDDD000000000000000000000 + 0007D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0FFFFFFFFFF78888877787807DDDDDDDDDDDDD0FFFFFFFFFF7888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7888888888 + 8807D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCDDDDCDDDD077777777777777777777 + 7707D0888877787878888877787807DDDCCCCDCCDDD088887778787888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF07DDDCCCCCCCCDD088888888887888888888 + 8807D0777777777777777777777707DDDCCCCDCCDDD077777777777777777777 + 7707D0FFFFFFFFFF7FFFFFFFFFFF07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0FFFFFFFFFF7FFFFFFFFFFF07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDCCCCDCCDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCCCCCCCCDD077777777777777777777 + 7707D0888877787878888877787807DDDCCCCDCCDDD088887778787888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF07DDDCDDDDCDDDD088888888887888888888 + 8807D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D0888877787878888877787807DDDDDDDDDDDDD088887778787888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF0DDDDDDDDDDDDDD088888888887888888888 + 8807D000000000000000000000000DDDDDDDDDDDDDD000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblRefinements: TLabel + Left = 5 + Top = 78 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlRefinements: TBevel + Left = 75 + Top = 82 + Width = 236 + Height = 4 + Shape = bsBottomLine + end + object imgRefinements: TImage + Left = 8 + Top = 100 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDD77777777777777777777 + 7777D0000000000000000000000007DDDDDDDDDDDDD000000000000000000000 + 0007D0FAFAFAFAFA7AFAFAFAFAFA07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0FAFAFAFAFA788888777CC807DDDDDDDDDDDDD0FFFFFFFFFF7888887778 + 7807D0AFAFAFAFAF78888888888807DDDDDDDDDDDDD0FFFFFFFFFF7888888888 + 8807D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0AFAFAFAFAF7FAFAFAFAFAF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FAFAFAFAFA7AFAFAFAFAFA07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCDDDDCDDDD077777777777777777777 + 7707D08888777CC8788888777CC807DDDCCCCDCCDDD088887778787888887778 + 7807D0888888888878888888888807DDDCCCCCCCCDD088888888887888888888 + 8807D0777777777777777777777707DDDCCCCDCCDDD077777777777777777777 + 7707D0FEFEFEFEFE7EFEFEFEFEFE07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0EFEFEFEFEF7FEFEFEFEFEF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0EFEFEFEFEF7FEFEFEFEFEF07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FEFEFEFEFE7EFEFEFEFEFE07DDDCCCCDCCDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCCCCCCCCDD077777777777777777777 + 7707D08888777CC8788888777CC807DDDCCCCDCCDDD088887778787888887778 + 7807D0888888888878888888888807DDDCDDDDCDDDD088888888887888888888 + 8807D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D0FBFBFBFBFB7BFBFBFBFBFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0BFBFBFBFBF7FBFBFBFBFBF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0BFBFBFBFBF7FBFBFBFBFBF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FBFBFBFBFB7BFBFBFBFBFB07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D08888777CC8788888777CC807DDDDDDDDDDDDD088887778787888887778 + 7807D088888888887888888888880DDDDDDDDDDDDDD088888888887888888888 + 8807D000000000000000000000000DDDDDDDDDDDDDD000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object cbxLookAndFeel: TcxComboBox + Left = 90 + Top = 37 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.OnChange = cbxLookAndFeelPropertiesChange + TabOrder = 0 + OnClick = LookAndFeelChange + Height = 23 + Width = 215 + end + object chbxSuppressBackgroundBitmaps: TcxCheckBox + Tag = 1 + Left = 90 + Top = 104 + Caption = 'Suppress Background Textures' + TabOrder = 1 + OnClick = OptionsFormattingClick + Width = 200 + end + object chbxSuppressContentColoration: TcxCheckBox + Tag = 2 + Left = 90 + Top = 130 + Caption = 'Suppress Content Coloration' + TabOrder = 2 + OnClick = OptionsFormattingClick + Width = 200 + end + end + object tshStyles: TTabSheet + Caption = 'Styles' + ImageIndex = 1 + object bvlStyles: TBevel + Left = 118 + Top = 13 + Width = 193 + Height = 4 + Shape = bsBottomLine + end + object bvlStyleSheets: TBevel + Left = 72 + Top = 302 + Width = 239 + Height = 5 + Shape = bsBottomLine + end + object lblStyleSheets: TLabel + Left = 6 + Top = 298 + Width = 60 + Height = 13 + Caption = 'Style Sheets' + end + object bvlStylesHost: TBevel + Left = 6 + Top = 33 + Width = 228 + Height = 222 + end + object Label1: TLabel + Left = 85 + Top = 140 + Width = 64 + Height = 13 + Caption = '[ Styles Site ]' + Visible = False + end + object lblUseNativeStyles: TLabel + Left = 24 + Top = 9 + Width = 84 + Height = 13 + Caption = '&Use Native Styles' + FocusControl = chbxUseNativeStyles + OnClick = lblUseNativeStylesClick + end + object btnStyleColor: TButton + Left = 243 + Top = 61 + Width = 68 + Height = 23 + Caption = 'Co&lor...' + TabOrder = 0 + OnClick = btnStyleColorClick + end + object btnStyleFont: TButton + Left = 243 + Top = 33 + Width = 68 + Height = 23 + Caption = '&Font...' + TabOrder = 1 + OnClick = btnStyleFontClick + end + object btnStyleBackgroundBitmap: TButton + Left = 243 + Top = 97 + Width = 68 + Height = 23 + Caption = '&Bitmap...' + TabOrder = 2 + OnClick = btnStyleBackgroundBitmapClick + end + object cbxStyleSheets: TcxComboBox + Left = 6 + Top = 318 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 20 + Properties.OnDrawItem = cbxStyleSheetsPropertiesDrawItem + TabOrder = 3 + OnClick = cbxStyleSheetsClick + OnKeyDown = cbxStyleSheetsKeyDown + Height = 24 + Width = 305 + end + object btnStyleSheetNew: TButton + Left = 6 + Top = 350 + Width = 71 + Height = 23 + Caption = '&New...' + TabOrder = 4 + OnClick = btnStyleSheetNewClick + end + object btnStyleSheetCopy: TButton + Left = 84 + Top = 350 + Width = 71 + Height = 23 + Caption = '&Copy...' + TabOrder = 5 + OnClick = btnStyleSheetCopyClick + end + object btnStyleSheetDelete: TButton + Left = 162 + Top = 350 + Width = 71 + Height = 23 + Caption = '&Delete...' + TabOrder = 6 + OnClick = btnStyleSheetDeleteClick + end + object btnStylesSaveAs: TButton + Left = 123 + Top = 263 + Width = 112 + Height = 23 + Caption = 'Save &As...' + TabOrder = 7 + OnClick = btnStylesSaveAsClick + end + object btnStyleSheetRename: TButton + Left = 240 + Top = 350 + Width = 71 + Height = 23 + Caption = '&Rename...' + TabOrder = 8 + OnClick = btnStyleSheetRenameClick + end + object btnStyleBackgroundBitmapClear: TButton + Left = 243 + Top = 125 + Width = 68 + Height = 23 + Caption = 'Cle&ar' + TabOrder = 9 + OnClick = btnStyleBackgroundBitmapClearClick + end + object btnStyleRestoreDefaults: TButton + Left = 6 + Top = 263 + Width = 112 + Height = 23 + Caption = 'Rest&ore Defaults' + TabOrder = 10 + OnClick = btnStyleRestoreDefaultsClick + end + object chbxUseNativeStyles: TcxCheckBox + Left = 3 + Top = 6 + TabOrder = 11 + OnClick = OptionsFormattingClick + Width = 22 + end + end + end + object pnlPreview: TPanel + Left = 331 + Top = 46 + Width = 275 + Height = 356 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 273 + Height = 354 + Align = alClient + Color = clWindow + TabOrder = 0 + object pbPreview: TPaintBox + Left = 1 + Top = 1 + Width = 271 + Height = 352 + Align = alClient + OnPaint = pbPreviewPaint + end + end + end + object pmStyles: TPopupMenu + Images = ilStylesPopup + OnPopup = pmStylesPopup + Left = 6 + Top = 417 + object miStyleFont: TMenuItem + Caption = '&Font...' + ImageIndex = 0 + OnClick = btnStyleFontClick + end + object miStyleColor: TMenuItem + Caption = '&Color...' + OnClick = btnStyleColorClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miStyleBackgroundBitmap: TMenuItem + Caption = '&Bitmap...' + ImageIndex = 1 + ShortCut = 16463 + OnClick = btnStyleBackgroundBitmapClick + end + object miStyleBackgroundBitmapClear: TMenuItem + Caption = 'Clear' + ImageIndex = 3 + ShortCut = 16430 + OnClick = btnStyleBackgroundBitmapClearClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miStyleRestoreDefaults: TMenuItem + Caption = 'Restore Defaults' + OnClick = btnStyleRestoreDefaultsClick + end + object milLine: TMenuItem + Caption = '-' + end + object miStylesSelectAll: TMenuItem + Caption = 'Select A&ll' + ShortCut = 16449 + OnClick = miStylesSelectAllClick + end + object miLine4: TMenuItem + Caption = '-' + end + object miStylesSaveAs: TMenuItem + Caption = 'Save &As...' + ImageIndex = 2 + ShortCut = 16467 + OnClick = btnStylesSaveAsClick + end + end + object ilStylesPopup: TImageList + Left = 34 + Top = 417 + Bitmap = { + 494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00000000000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF000000 + 0000008080000080800000808000008080000080800000808000008080000080 + 8000008080000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000000000000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000008080000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF00FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800080808000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00C0C0C00000FFFF00C0C0C000FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000000000008080800080808000000000008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C00000000000C0C0C00000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFC001FFFF + FE07001F8001FFF9FF9F000F8001E7FFFF9F00078001C3F3E01F00038001C3E7 + F99F00018001E1C7F99B00008001F08FF99B00018001F81FF89300018001FC3F + D80300018001F81FD9BF80018001F09FC93FE0018001C1C7C03FE001800183E3 + FFFFE00180018FF1FFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end + object cxEditStyleController1: TcxEditStyleController + OnStyleChanged = StyleController1StyleChanged + Left = 64 + Top = 416 + end +end diff --git a/official/x.35/Lib/D11/dxPScxScheduler2LnkD11.bpl b/official/x.35/Lib/D11/dxPScxScheduler2LnkD11.bpl new file mode 100644 index 00000000..bbcde913 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxScheduler2LnkD11.bpl differ diff --git a/official/x.35/Lib/D11/dxPScxScheduler2LnkD11.dcp b/official/x.35/Lib/D11/dxPScxScheduler2LnkD11.dcp new file mode 100644 index 00000000..e48d5b7d Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxScheduler2LnkD11.dcp differ diff --git a/official/x.35/Lib/D11/dxPScxScheduler2LnkD11.dcu b/official/x.35/Lib/D11/dxPScxScheduler2LnkD11.dcu new file mode 100644 index 00000000..db757ce4 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxScheduler2LnkD11.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxScheduler2LnkReg.dcu b/official/x.35/Lib/D11/dxPScxScheduler2LnkReg.dcu new file mode 100644 index 00000000..c9cebaa4 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxScheduler2LnkReg.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxScheduler3Lnk.dfm b/official/x.35/Lib/D11/dxPScxScheduler3Lnk.dfm new file mode 100644 index 00000000..328593f1 --- /dev/null +++ b/official/x.35/Lib/D11/dxPScxScheduler3Lnk.dfm @@ -0,0 +1,1888 @@ +object cxfmSchedulerReportLinkDesignWindow: TcxfmSchedulerReportLinkDesignWindow + Left = 349 + Top = 267 + BorderStyle = bsDialog + Caption = 'cxfmSchedulerReportLinkDesignWindow' + ClientHeight = 487 + ClientWidth = 618 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 5 + Width = 610 + Height = 445 + ActivePage = tshPrintStyles + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + OnChange = PageControl1Change + object tshPrintRange: TTabSheet + Caption = 'Print Range' + ImageIndex = 3 + object lblPrintRangeStart: TLabel + Left = 17 + Top = 22 + Width = 28 + Height = 13 + Caption = '&Start:' + end + object lblPrintRangeEnd: TLabel + Left = 18 + Top = 54 + Width = 22 + Height = 13 + Caption = '&End:' + end + object lblPrintRangesMiscellaneous: TLabel + Left = 5 + Top = 91 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + Visible = False + end + object Bevel1: TBevel + Left = 80 + Top = 95 + Width = 231 + Height = 4 + Shape = bsBottomLine + Visible = False + end + object dePrintRangeStart: TcxDateEdit + Left = 70 + Top = 18 + EditValue = 38187d + Properties.OnEditValueChanged = dePrintRangeStartEditValueChanged + TabOrder = 0 + Width = 235 + end + object dePrintRangeEnd: TcxDateEdit + Left = 70 + Top = 50 + EditValue = 38187d + Properties.OnEditValueChanged = dePrintRangeEndEditValueChanged + TabOrder = 1 + Width = 235 + end + object chbxHideDetailsOfPrivateAppointments: TcxCheckBox + Left = 66 + Top = 113 + Caption = 'Hide Details of Private Appointments' + TabOrder = 2 + Visible = False + Width = 236 + end + end + object tshPrintStyles: TTabSheet + Caption = 'Print Styles' + object lblPrintStylesOptions: TLabel + Left = 5 + Top = 48 + Width = 37 + Height = 13 + Caption = 'Options' + end + object bvlPrintStyleOptions: TBevel + Left = 50 + Top = 52 + Width = 258 + Height = 4 + Shape = bsBottomLine + end + object lblPreviewWindow: TStaticText + Left = 324 + Top = 0 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 0 + end + object cbxPrintStyles: TcxImageComboBox + Left = 6 + Top = 7 + Properties.Alignment.Vert = taVCenter + Properties.Items = <> + TabOrder = 1 + OnClick = cbxPrintStylesClick + Width = 303 + end + object pcPrintStyleOptions: TPageControl + Left = 4 + Top = 64 + Width = 314 + Height = 348 + ActivePage = tshTimeLine + Style = tsButtons + TabOrder = 2 + TabStop = False + object tshDaily: TTabSheet + Caption = 'Daily' + TabVisible = False + object lblPrintStyleDailyLayout: TLabel + Left = 14 + Top = 4 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleDailyLayout + end + object lblPrintStyleDailyInclude: TLabel + Left = 14 + Top = 64 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleDailyPrintFrom: TLabel + Left = 14 + Top = 136 + Width = 53 + Height = 13 + Caption = 'Print &From:' + FocusControl = tePrintStyleDailyPrintFrom + end + object lblPrintStyleDailyPrintTo: TLabel + Left = 14 + Top = 165 + Width = 41 + Height = 13 + Caption = 'Print &To:' + FocusControl = tePrintStyleDailyPrintTo + end + object lblPrintStyleDailyResourceCountPerPage: TLabel + Left = 14 + Top = 34 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleDailyResourceCountPerPage + end + object Bevel2: TBevel + Left = 32 + Top = 194 + Width = 274 + Height = 4 + Shape = bsBottomLine + end + object lbViewDaily: TLabel + Left = 1 + Top = 190 + Width = 22 + Height = 13 + Caption = 'View' + end + object Bevel7: TBevel + Left = 48 + Top = 237 + Width = 258 + Height = 4 + Shape = bsBottomLine + end + object lbImagesDaily: TLabel + Left = 3 + Top = 232 + Width = 38 + Height = 13 + Caption = 'Images ' + end + object cbxPrintStyleDailyLayout: TcxComboBox + Left = 115 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/day' + '2 pages/day') + TabOrder = 0 + OnClick = cbxPrintStyleDailyLayoutClick + Height = 23 + Width = 186 + end + object chbxPrintStyleDailyTaskPad: TcxCheckBox + Left = 111 + Top = 61 + Caption = 'Task&Pad' + TabOrder = 2 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleDailyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 82 + Caption = 'Notes Area (&Blank)' + TabOrder = 3 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleDailyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 103 + Caption = 'Notes Area (&Lined)' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object tePrintStyleDailyPrintFrom: TcxTimeEdit + Left = 114 + Top = 132 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 5 + Width = 100 + end + object tePrintStyleDailyPrintTo: TcxTimeEdit + Tag = 1 + Left = 114 + Top = 161 + EditValue = 0.000000000000000000 + Properties.ImmediatePost = True + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 6 + Width = 100 + end + object sePrintStyleDailyResourceCountPerPage: TcxSpinEdit + Left = 115 + Top = 30 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 1 + Width = 100 + end + object chbxPrintStyleDailyShowResourceImages: TcxCheckBox + Left = 15 + Top = 206 + Caption = 'Show resource images' + TabOrder = 7 + OnClick = chbxPrintStyleShowResourceImagesClick + Width = 306 + end + object chbxPrintStyleDailyShowEventImages: TcxCheckBox + Left = 15 + Top = 251 + Caption = 'Show event images' + TabOrder = 8 + OnClick = chbxPrintStyleShowEventImagesClick + Width = 306 + end + end + object tshWeekly: TTabSheet + Caption = 'Weekly' + ImageIndex = 1 + TabVisible = False + object lblPrintStyleWeeklyPrintTo: TLabel + Left = 14 + Top = 218 + Width = 41 + Height = 13 + Caption = 'Print &To:' + FocusControl = tePrintStyleWeeklyPrintTo + end + object lblPrintStyleWeeklyPrintFrom: TLabel + Left = 14 + Top = 189 + Width = 53 + Height = 13 + Caption = 'Print &From:' + FocusControl = tePrintStyleWeeklyPrintFrom + end + object lblPrintStyleWeeklyInclude: TLabel + Left = 14 + Top = 119 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleWeeklyLayout: TLabel + Left = 14 + Top = 33 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleWeeklyLayout + end + object lblPrintStyleWeeklyArrange: TLabel + Left = 14 + Top = 4 + Width = 43 + Height = 13 + Caption = '&Arrange:' + FocusControl = cbxPrintStyleWeeklyArrange + end + object lblPrintStyleWeeklyResourceCountPerPage: TLabel + Left = 14 + Top = 94 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleWeeklyResourceCountPerPage + end + object lblPrintStyleWeeklyDaysLayout: TLabel + Left = 14 + Top = 63 + Width = 61 + Height = 13 + Caption = '&Days layout:' + FocusControl = cbxPrintStyleWeeklyDaysLayout + end + object Bevel3: TBevel + Left = 32 + Top = 245 + Width = 274 + Height = 4 + Shape = bsBottomLine + end + object Label5: TLabel + Left = 1 + Top = 241 + Width = 22 + Height = 13 + Caption = 'View' + end + object Bevel8: TBevel + Left = 48 + Top = 287 + Width = 258 + Height = 4 + Shape = bsBottomLine + end + object Label6: TLabel + Left = 3 + Top = 282 + Width = 38 + Height = 13 + Caption = 'Images ' + end + object tePrintStyleWeeklyPrintTo: TcxTimeEdit + Tag = 1 + Left = 114 + Top = 213 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 8 + Width = 100 + end + object tePrintStyleWeeklyPrintFrom: TcxTimeEdit + Left = 114 + Top = 184 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 7 + Width = 100 + end + object chbxPrintStyleWeeklyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 158 + Caption = 'Notes Area (&Lined)' + TabOrder = 6 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleWeeklyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 137 + Caption = 'Notes Area (&Blank)' + TabOrder = 5 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object cbxPrintStyleWeeklyArrange: TcxComboBox + Left = 115 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + 'Top to Bottom' + 'Left to Right') + TabOrder = 0 + OnClick = cbxPrintStyleWeeklyArrangeClick + Height = 23 + Width = 186 + end + object cbxPrintStyleWeeklyLayout: TcxComboBox + Left = 115 + Top = 29 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/day' + '2 pages/day') + TabOrder = 1 + OnClick = cbxPrintStyleWeeklyLayoutClick + Height = 23 + Width = 186 + end + object chbxPrintStyleWeeklyTaskPad: TcxCheckBox + Left = 111 + Top = 116 + Caption = 'TaskPad' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleWeeklyDontPrintWeekends: TcxCheckBox + Left = 15 + Top = 257 + Caption = 'Don'#39't Print &Weekends' + TabOrder = 9 + OnClick = chbxPrintStyleWeeklyDontPrintWeekendsClick + Width = 285 + end + object sePrintStyleWeeklyResourceCountPerPage: TcxSpinEdit + Tag = 1 + Left = 115 + Top = 90 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 3 + Width = 100 + end + object cbxPrintStyleWeeklyDaysLayout: TcxComboBox + Left = 115 + Top = 59 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + 'Two columns' + 'One column') + TabOrder = 2 + OnClick = cbxPrintStyleWeeklyDaysLayoutClick + Height = 23 + Width = 186 + end + object chbxPrintStyleWeeklyShowEventImages: TcxCheckBox + Left = 15 + Top = 320 + Caption = 'Show Event Images' + TabOrder = 11 + OnClick = chbxPrintStyleShowEventImagesClick + Width = 306 + end + object chbxPrintStyleWeeklyShowResourceImages: TcxCheckBox + Left = 15 + Top = 299 + Caption = 'Show Resource Images' + TabOrder = 10 + OnClick = chbxPrintStyleShowResourceImagesClick + Width = 306 + end + end + object tshMonthly: TTabSheet + Caption = 'Monthly' + ImageIndex = 2 + TabVisible = False + object lblPrintStyleMonthlyLayout: TLabel + Left = 14 + Top = 4 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleMonthlyLayout + end + object lblPrintStyleMonthlyInclude: TLabel + Left = 14 + Top = 62 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleMonthlyResourceCountPerPage: TLabel + Left = 14 + Top = 34 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleMonthlyResourceCountPerPage + end + object Bevel9: TBevel + Left = 32 + Top = 129 + Width = 274 + Height = 4 + Shape = bsBottomLine + end + object Label7: TLabel + Left = 1 + Top = 125 + Width = 22 + Height = 13 + Caption = 'View' + end + object Bevel10: TBevel + Left = 48 + Top = 191 + Width = 258 + Height = 4 + Shape = bsBottomLine + end + object Label8: TLabel + Left = 3 + Top = 186 + Width = 38 + Height = 13 + Caption = 'Images ' + end + object cbxPrintStyleMonthlyLayout: TcxComboBox + Left = 115 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/month' + '2 pages/month') + TabOrder = 0 + OnClick = cbxPrintStyleMonthlyLayoutClick + Height = 23 + Width = 186 + end + object chbxPrintStyleMonthlyTaskPad: TcxCheckBox + Left = 111 + Top = 59 + Caption = 'Task&Pad' + TabOrder = 2 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleMonthlyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 80 + Caption = 'Notes Area (&Blank)' + TabOrder = 3 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleMonthlyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 101 + Caption = 'Notes Area (&Lined)' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleMonthlyDontPrintWeekends: TcxCheckBox + Left = 15 + Top = 141 + Caption = 'Don'#39't Print &Weekends' + TabOrder = 5 + OnClick = chbxPrintStyleDontPrintWeekEndsClick + Width = 285 + end + object chbxPrintStyleMonthlyPrintExactlyOneMonthPerPage: TcxCheckBox + Left = 15 + Top = 162 + Caption = 'Print Exactly One Month Per Page' + TabOrder = 6 + OnClick = chbxPrintStyleMonthlyPrintExactlyOneMonthPerPageClick + Width = 285 + end + object sePrintStyleMonthlyResourceCountPerPage: TcxSpinEdit + Tag = 2 + Left = 115 + Top = 29 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 1 + Width = 100 + end + object chbxPrintStyleMonthlyShowEventImages: TcxCheckBox + Left = 15 + Top = 224 + Caption = 'Show Event Images' + TabOrder = 7 + OnClick = chbxPrintStyleShowEventImagesClick + Width = 306 + end + object chbxPrintStyleMonthlyShowResourceImages: TcxCheckBox + Left = 15 + Top = 203 + Caption = 'Show Resource Images' + TabOrder = 8 + OnClick = chbxPrintStyleShowResourceImagesClick + Width = 306 + end + end + object tshTrifold: TTabSheet + Caption = 'Tri-fold' + ImageIndex = 3 + TabVisible = False + object lblPrintStyleTrifoldSectionLeft: TLabel + Left = 14 + Top = 4 + Width = 61 + Height = 13 + Caption = '&Left Section:' + FocusControl = cbxPrintStyleTrifoldSectionLeft + end + object lblPrintStyleTrifoldSectionMiddle: TLabel + Left = 14 + Top = 38 + Width = 72 + Height = 13 + Caption = '&Middle Section:' + FocusControl = cbxPrintStyleTrifoldSectionMiddle + end + object lblPrintStyleTrifoldSectionRight: TLabel + Left = 14 + Top = 71 + Width = 67 + Height = 13 + Caption = '&Right Section:' + FocusControl = cbxPrintStyleTrifoldSectionRight + end + object cbxPrintStyleTrifoldSectionLeft: TcxComboBox + Left = 100 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + TabOrder = 0 + OnClick = cbxPrintStyleTrifoldSectionModeClick + Height = 23 + Width = 201 + end + object cbxPrintStyleTrifoldSectionMiddle: TcxComboBox + Tag = 1 + Left = 100 + Top = 33 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + TabOrder = 1 + OnClick = cbxPrintStyleTrifoldSectionModeClick + Height = 23 + Width = 201 + end + object cbxPrintStyleTrifoldSectionRight: TcxComboBox + Tag = 2 + Left = 100 + Top = 66 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + TabOrder = 2 + OnClick = cbxPrintStyleTrifoldSectionModeClick + Height = 23 + Width = 201 + end + end + object tshDetails: TTabSheet + Caption = 'Details' + ImageIndex = 4 + TabVisible = False + object chbxPrintStyleDetailsUsePagination: TcxCheckBox + Left = 14 + Top = 0 + Caption = 'Start a New Page Each:' + TabOrder = 0 + OnClick = chbxPrintStyleDetailsUsePaginationClick + Width = 187 + end + object cbxPrintStyleDetailsPagination: TcxComboBox + Left = 203 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + 'Day' + 'Week' + 'Month') + TabOrder = 1 + OnClick = cbxPrintStyleDetailsPaginationClick + Height = 23 + Width = 98 + end + end + object tshMemo: TTabSheet + Caption = 'Memo' + ImageIndex = 5 + TabVisible = False + object chbxPrintStyleMemoStartEachItemOnNewPage: TcxCheckBox + Left = 14 + Top = 0 + Caption = 'Start Each Item On New Page' + TabOrder = 0 + OnClick = chbxPrintStyleMemoStartEachItemOnNewPageClick + Width = 187 + end + object chbxPrintStyleMemoPrintOnlySelectedEvents: TcxCheckBox + Left = 14 + Top = 22 + Caption = 'Print Only Selected Events' + State = cbsChecked + TabOrder = 1 + OnClick = chbxPrintStyleMemoPrintOnlySelectedEventsClick + Width = 187 + end + end + object tshYearly: TTabSheet + Caption = 'Yearly' + ImageIndex = 6 + TabVisible = False + object lblPrintStyleYearlyMonthPerPage: TLabel + Left = 14 + Top = 38 + Width = 67 + Height = 13 + Caption = '&Months/Page:' + FocusControl = cbxPrintStyleYearlyMonthPerPage + end + object lblPrintStyleYearlyResourceCountPerPage: TLabel + Left = 14 + Top = 72 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleYearlyResourceCountPerPage + Visible = False + end + object lblPrintStyleYearlyInclude: TLabel + Left = 14 + Top = 102 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleYearlyLayout: TLabel + Left = 14 + Top = 4 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleYearlyLayout + end + object Bevel4: TBevel + Left = 32 + Top = 171 + Width = 274 + Height = 4 + Shape = bsBottomLine + end + object Label9: TLabel + Left = 1 + Top = 167 + Width = 22 + Height = 13 + Caption = 'View' + end + object Bevel5: TBevel + Left = 48 + Top = 216 + Width = 258 + Height = 4 + Shape = bsBottomLine + end + object Label10: TLabel + Left = 3 + Top = 211 + Width = 38 + Height = 13 + Caption = 'Images ' + end + object cbxPrintStyleYearlyMonthPerPage: TcxComboBox + Left = 115 + Top = 33 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/year' + '2 pages/year' + '3 pages/year' + '4 pages/year' + '6 pages/year' + '12 pages/year') + TabOrder = 1 + Text = '12 pages/year' + OnClick = cbxPrintStyleYearlyMonthPagesPerYearClick + Height = 23 + Width = 186 + end + object sePrintStyleYearlyResourceCountPerPage: TcxSpinEdit + Tag = 3 + Left = 115 + Top = 68 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 2 + Visible = False + Width = 100 + end + object chbxPrintStyleYearlyTaskPad: TcxCheckBox + Left = 111 + Top = 99 + Caption = 'Task&Pad' + TabOrder = 3 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleYearlyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 120 + Caption = 'Notes Area (&Blank)' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleYearlyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 141 + Caption = 'Notes Area (&Lined)' + TabOrder = 5 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object cbxPrintStyleYearlyLayout: TcxComboBox + Left = 115 + Top = -1 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/month' + '2 pages/month') + TabOrder = 0 + Text = '1 page/month' + OnClick = cbxPrintStyleYearlyLayoutClick + Height = 23 + Width = 186 + end + object chbxPrimaryPageHeadersOnly: TcxCheckBox + Left = 15 + Top = 184 + Caption = 'Primary Page Headers Only' + TabOrder = 6 + OnClick = chbxPrimaryPageHeadersOnlyClick + Width = 153 + end + object chbxPrintStyleYearlyShowEventImages: TcxCheckBox + Left = 15 + Top = 230 + Caption = 'Show Event Images' + TabOrder = 7 + OnClick = chbxPrintStyleShowEventImagesClick + Width = 306 + end + end + object tshTimeLine: TTabSheet + Caption = 'TimeLine' + ImageIndex = 7 + TabVisible = False + object lblPrintStyleTimeLineResourceCountPerPage: TLabel + Left = 14 + Top = 3 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleTimeLineResourceCountPerPage + end + object lblPrintStyleTimeLineInclude: TLabel + Left = 14 + Top = 33 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleTimeLinePrintFrom: TLabel + Left = 14 + Top = 106 + Width = 53 + Height = 13 + Caption = 'Print &From:' + FocusControl = tePrintStyleTimeLinePrintFrom + end + object lblPrintStyleTimeLinePrintTo: TLabel + Left = 14 + Top = 135 + Width = 41 + Height = 13 + Caption = 'Print &To:' + FocusControl = tePrintStyleTimeLinePrintTo + end + object Bevel6: TBevel + Left = 32 + Top = 165 + Width = 274 + Height = 4 + Shape = bsBottomLine + end + object bvlTimeLineImages: TBevel + Left = 48 + Top = 274 + Width = 258 + Height = 4 + Shape = bsBottomLine + end + object Label2: TLabel + Left = 1 + Top = 161 + Width = 22 + Height = 13 + Caption = 'View' + end + object lbTimeLineImages: TLabel + Left = 3 + Top = 269 + Width = 38 + Height = 13 + Caption = 'Images ' + end + object sePrintStyleTimeLineResourceCountPerPage: TcxSpinEdit + Tag = 4 + Left = 115 + Top = -1 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 0 + Width = 100 + end + object chbxPrintStyleTimeLineTaskPad: TcxCheckBox + Left = 111 + Top = 30 + Caption = 'Task&Pad' + TabOrder = 1 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleTimeLineNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 51 + Caption = 'Notes Area (&Blank)' + TabOrder = 2 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object chbxPrintStyleTimeLineNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 72 + Caption = 'Notes Area (&Lined)' + TabOrder = 3 + OnClick = chbxPrintStyleOptionsViewClick + Width = 190 + end + object tePrintStyleTimeLinePrintFrom: TcxTimeEdit + Left = 114 + Top = 101 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 4 + Width = 100 + end + object tePrintStyleTimeLinePrintTo: TcxTimeEdit + Tag = 1 + Left = 114 + Top = 130 + EditValue = 0.000000000000000000 + Properties.ImmediatePost = True + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 5 + Width = 100 + end + object chbxPrintStyleTimeLineShowResourceImages: TcxCheckBox + Left = 15 + Top = 288 + Caption = 'Show Resource Images' + TabOrder = 10 + OnClick = chbxPrintStyleShowResourceImagesClick + Width = 306 + end + object chbxPrintStyleTimeLineShowEventImages: TcxCheckBox + Left = 15 + Top = 309 + Caption = 'Show Event Images' + TabOrder = 11 + OnClick = chbxPrintStyleShowEventImagesClick + Width = 306 + end + object chbxPrintStyleTimeLinePrimaryPageHeadersOnly: TcxCheckBox + Left = 15 + Top = 201 + Caption = 'Primary Page Headers Only' + TabOrder = 7 + OnClick = chbxPrimaryPageHeadersOnlyClick + Width = 170 + end + object chbxPrintStyleTimeLinePrimaryPageScalesOnly: TcxCheckBox + Left = 15 + Top = 180 + Caption = 'Primary Page Scales Only' + TabOrder = 6 + OnClick = chbxPrimaryPageScalesOnlyClick + Width = 162 + end + object chbxPrintStyleTimeLineDontPrintWeekends: TcxCheckBox + Left = 15 + Top = 222 + Caption = 'Don'#39't Print &Weekends' + TabOrder = 8 + OnClick = chbxPrintStyleDontPrintWeekEndsClick + Width = 194 + end + object chbxPrintStyleTimeLineWorkTimeOnly: TcxCheckBox + Left = 15 + Top = 243 + Caption = 'W&ork Time Only' + TabOrder = 9 + OnClick = chbxPrintStyleWorkTimeOnlyClick + Width = 194 + end + end + end + object pnlPrintStylesPreview: TPanel + Left = 323 + Top = 17 + Width = 275 + Height = 356 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 3 + object pbxPrintStylesPreview: TPaintBox + Left = 1 + Top = 1 + Width = 273 + Height = 354 + Align = alClient + OnPaint = pbxPrintStylesPreviewPaint + end + end + end + object tshFormatting: TTabSheet + Caption = 'Formatting' + ImageIndex = 2 + object bvlLookAndFeel: TBevel + Left = 85 + Top = 13 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object lblLookAndFeel: TLabel + Left = 5 + Top = 8 + Width = 66 + Height = 13 + Caption = 'Look and Feel' + end + object imgLookAndFeel: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDD77777777777777777777 + 7777D0000000000000000000000007DDDDDDDDDDDDD000000000000000000000 + 0007D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0FFFFFFFFFF78888877787807DDDDDDDDDDDDD0FFFFFFFFFF7888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7888888888 + 8807D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCDDDDCDDDD077777777777777777777 + 7707D0888877787878888877787807DDDCCCCDCCDDD088887778787888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF07DDDCCCCCCCCDD088888888887888888888 + 8807D0777777777777777777777707DDDCCCCDCCDDD077777777777777777777 + 7707D0FFFFFFFFFF7FFFFFFFFFFF07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0FFFFFFFFFF7FFFFFFFFFFF07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDCCCCDCCDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCCCCCCCCDD077777777777777777777 + 7707D0888877787878888877787807DDDCCCCDCCDDD088887778787888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF07DDDCDDDDCDDDD088888888887888888888 + 8807D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D0888877787878888877787807DDDDDDDDDDDDD088887778787888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF0DDDDDDDDDDDDDD088888888887888888888 + 8807D000000000000000000000000DDDDDDDDDDDDDD000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblRefinements: TLabel + Left = 5 + Top = 78 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlRefinements: TBevel + Left = 75 + Top = 82 + Width = 236 + Height = 4 + Shape = bsBottomLine + end + object imgRefinements: TImage + Left = 8 + Top = 100 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDD77777777777777777777 + 7777D0000000000000000000000007DDDDDDDDDDDDD000000000000000000000 + 0007D0FAFAFAFAFA7AFAFAFAFAFA07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0FAFAFAFAFA788888777CC807DDDDDDDDDDDDD0FFFFFFFFFF7888887778 + 7807D0AFAFAFAFAF78888888888807DDDDDDDDDDDDD0FFFFFFFFFF7888888888 + 8807D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0AFAFAFAFAF7FAFAFAFAFAF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FAFAFAFAFA7AFAFAFAFAFA07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCDDDDCDDDD077777777777777777777 + 7707D08888777CC8788888777CC807DDDCCCCDCCDDD088887778787888887778 + 7807D0888888888878888888888807DDDCCCCCCCCDD088888888887888888888 + 8807D0777777777777777777777707DDDCCCCDCCDDD077777777777777777777 + 7707D0FEFEFEFEFE7EFEFEFEFEFE07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0EFEFEFEFEF7FEFEFEFEFEF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0EFEFEFEFEF7FEFEFEFEFEF07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FEFEFEFEFE7EFEFEFEFEFE07DDDCCCCDCCDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCCCCCCCCDD077777777777777777777 + 7707D08888777CC8788888777CC807DDDCCCCDCCDDD088887778787888887778 + 7807D0888888888878888888888807DDDCDDDDCDDDD088888888887888888888 + 8807D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D0FBFBFBFBFB7BFBFBFBFBFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0BFBFBFBFBF7FBFBFBFBFBF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0BFBFBFBFBF7FBFBFBFBFBF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FBFBFBFBFB7BFBFBFBFBFB07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D08888777CC8788888777CC807DDDDDDDDDDDDD088887778787888887778 + 7807D088888888887888888888880DDDDDDDDDDDDDD088888888887888888888 + 8807D000000000000000000000000DDDDDDDDDDDDDD000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object cbxLookAndFeel: TcxComboBox + Left = 90 + Top = 37 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.OnChange = cbxLookAndFeelPropertiesChange + TabOrder = 0 + OnClick = LookAndFeelChange + Height = 23 + Width = 215 + end + object chbxSuppressBackgroundBitmaps: TcxCheckBox + Tag = 1 + Left = 90 + Top = 104 + Caption = 'Suppress Background Textures' + TabOrder = 1 + OnClick = OptionsFormattingClick + Width = 200 + end + object chbxSuppressContentColoration: TcxCheckBox + Tag = 2 + Left = 90 + Top = 130 + Caption = 'Suppress Content Coloration' + TabOrder = 2 + OnClick = OptionsFormattingClick + Width = 200 + end + end + object tshStyles: TTabSheet + Caption = 'Styles' + ImageIndex = 1 + object bvlStyles: TBevel + Left = 118 + Top = 13 + Width = 193 + Height = 4 + Shape = bsBottomLine + end + object bvlStyleSheets: TBevel + Left = 72 + Top = 302 + Width = 239 + Height = 5 + Shape = bsBottomLine + end + object lblStyleSheets: TLabel + Left = 6 + Top = 298 + Width = 60 + Height = 13 + Caption = 'Style Sheets' + end + object bvlStylesHost: TBevel + Left = 6 + Top = 33 + Width = 228 + Height = 222 + end + object Label1: TLabel + Left = 85 + Top = 140 + Width = 64 + Height = 13 + Caption = '[ Styles Site ]' + Visible = False + end + object lblUseNativeStyles: TLabel + Left = 24 + Top = 9 + Width = 84 + Height = 13 + Caption = '&Use Native Styles' + FocusControl = chbxUseNativeStyles + OnClick = lblUseNativeStylesClick + end + object btnStyleColor: TButton + Left = 243 + Top = 61 + Width = 68 + Height = 23 + Caption = 'Co&lor...' + TabOrder = 0 + OnClick = btnStyleColorClick + end + object btnStyleFont: TButton + Left = 243 + Top = 33 + Width = 68 + Height = 23 + Caption = '&Font...' + TabOrder = 1 + OnClick = btnStyleFontClick + end + object btnStyleBackgroundBitmap: TButton + Left = 243 + Top = 97 + Width = 68 + Height = 23 + Caption = '&Bitmap...' + TabOrder = 2 + OnClick = btnStyleBackgroundBitmapClick + end + object cbxStyleSheets: TcxComboBox + Left = 6 + Top = 318 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 20 + Properties.OnDrawItem = cbxStyleSheetsPropertiesDrawItem + TabOrder = 3 + OnClick = cbxStyleSheetsClick + OnKeyDown = cbxStyleSheetsKeyDown + Height = 24 + Width = 305 + end + object btnStyleSheetNew: TButton + Left = 6 + Top = 350 + Width = 71 + Height = 23 + Caption = '&New...' + TabOrder = 4 + OnClick = btnStyleSheetNewClick + end + object btnStyleSheetCopy: TButton + Left = 84 + Top = 350 + Width = 71 + Height = 23 + Caption = '&Copy...' + TabOrder = 5 + OnClick = btnStyleSheetCopyClick + end + object btnStyleSheetDelete: TButton + Left = 162 + Top = 350 + Width = 71 + Height = 23 + Caption = '&Delete...' + TabOrder = 6 + OnClick = btnStyleSheetDeleteClick + end + object btnStylesSaveAs: TButton + Left = 123 + Top = 263 + Width = 112 + Height = 23 + Caption = 'Save &As...' + TabOrder = 7 + OnClick = btnStylesSaveAsClick + end + object btnStyleSheetRename: TButton + Left = 240 + Top = 350 + Width = 71 + Height = 23 + Caption = '&Rename...' + TabOrder = 8 + OnClick = btnStyleSheetRenameClick + end + object btnStyleBackgroundBitmapClear: TButton + Left = 243 + Top = 125 + Width = 68 + Height = 23 + Caption = 'Cle&ar' + TabOrder = 9 + OnClick = btnStyleBackgroundBitmapClearClick + end + object btnStyleRestoreDefaults: TButton + Left = 6 + Top = 263 + Width = 112 + Height = 23 + Caption = 'Rest&ore Defaults' + TabOrder = 10 + OnClick = btnStyleRestoreDefaultsClick + end + object chbxUseNativeStyles: TcxCheckBox + Left = 3 + Top = 6 + TabOrder = 11 + OnClick = OptionsFormattingClick + Width = 22 + end + end + end + object pnlPreview: TPanel + Left = 331 + Top = 46 + Width = 275 + Height = 395 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 273 + Height = 393 + Align = alClient + Color = clWindow + TabOrder = 0 + object pbPreview: TPaintBox + Left = 1 + Top = 1 + Width = 271 + Height = 391 + Align = alClient + OnPaint = pbPreviewPaint + end + end + end + object pmStyles: TPopupMenu + Images = ilStylesPopup + OnPopup = pmStylesPopup + Left = 6 + Top = 441 + object miStyleFont: TMenuItem + Caption = '&Font...' + ImageIndex = 0 + OnClick = btnStyleFontClick + end + object miStyleColor: TMenuItem + Caption = '&Color...' + OnClick = btnStyleColorClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miStyleBackgroundBitmap: TMenuItem + Caption = '&Bitmap...' + ImageIndex = 1 + ShortCut = 16463 + OnClick = btnStyleBackgroundBitmapClick + end + object miStyleBackgroundBitmapClear: TMenuItem + Caption = 'Clear' + ImageIndex = 3 + ShortCut = 16430 + OnClick = btnStyleBackgroundBitmapClearClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miStyleRestoreDefaults: TMenuItem + Caption = 'Restore Defaults' + OnClick = btnStyleRestoreDefaultsClick + end + object milLine: TMenuItem + Caption = '-' + end + object miStylesSelectAll: TMenuItem + Caption = 'Select A&ll' + ShortCut = 16449 + OnClick = miStylesSelectAllClick + end + object miLine4: TMenuItem + Caption = '-' + end + object miStylesSaveAs: TMenuItem + Caption = 'Save &As...' + ImageIndex = 2 + ShortCut = 16467 + OnClick = btnStylesSaveAsClick + end + end + object ilStylesPopup: TImageList + Left = 34 + Top = 441 + Bitmap = { + 494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00000000000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF000000 + 0000008080000080800000808000008080000080800000808000008080000080 + 8000008080000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000000000000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000008080000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF00FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800080808000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00C0C0C00000FFFF00C0C0C000FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000000000008080800080808000000000008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C00000000000C0C0C00000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFC001FFFF + FE07001F8001FFF9FF9F000F8001E7FFFF9F00078001C3F3E01F00038001C3E7 + F99F00018001E1C7F99B00008001F08FF99B00018001F81FF89300018001FC3F + D80300018001F81FD9BF80018001F09FC93FE0018001C1C7C03FE001800183E3 + FFFFE00180018FF1FFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end + object cxEditStyleController1: TcxEditStyleController + OnStyleChanged = StyleController1StyleChanged + Left = 64 + Top = 440 + end +end diff --git a/official/x.35/Lib/D11/dxPScxScheduler3Lnk.res b/official/x.35/Lib/D11/dxPScxScheduler3Lnk.res new file mode 100644 index 00000000..3008a815 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxScheduler3Lnk.res differ diff --git a/official/x.35/Lib/D11/dxPScxSchedulerLnk.dfm b/official/x.35/Lib/D11/dxPScxSchedulerLnk.dfm new file mode 100644 index 00000000..d12acfca --- /dev/null +++ b/official/x.35/Lib/D11/dxPScxSchedulerLnk.dfm @@ -0,0 +1,1433 @@ +object cxfmSchedulerReportLinkDesignWindow: TcxfmSchedulerReportLinkDesignWindow + Left = 138 + Top = 193 + BorderStyle = bsDialog + Caption = 'cxfmSchedulerReportLinkDesignWindow' + ClientHeight = 446 + ClientWidth = 618 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 5 + Width = 610 + Height = 404 + ActivePage = tshPrintStyles + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + OnChange = PageControl1Change + object tshPrintRange: TTabSheet + Caption = 'Print Range' + ImageIndex = 3 + object lblPrintRangeStart: TLabel + Left = 17 + Top = 22 + Width = 28 + Height = 13 + Caption = '&Start:' + end + object lblPrintRangeEnd: TLabel + Left = 18 + Top = 54 + Width = 22 + Height = 13 + Caption = '&End:' + end + object lblPrintRangesMiscellaneous: TLabel + Left = 5 + Top = 91 + Width = 65 + Height = 13 + Caption = 'Miscellaneous' + Visible = False + end + object Bevel1: TBevel + Left = 80 + Top = 95 + Width = 231 + Height = 4 + Shape = bsBottomLine + Visible = False + end + object dePrintRangeStart: TcxDateEdit + Left = 70 + Top = 18 + Width = 235 + Height = 21 + EditValue = 38187d + Properties.OnEditValueChanged = dePrintRangeStartEditValueChanged + TabOrder = 0 + end + object dePrintRangeEnd: TcxDateEdit + Left = 70 + Top = 50 + Width = 235 + Height = 21 + EditValue = 38187d + Properties.OnEditValueChanged = dePrintRangeEndEditValueChanged + TabOrder = 1 + end + object chbxHideDetailsOfPrivateAppointments: TcxCheckBox + Left = 66 + Top = 113 + Width = 236 + Height = 21 + Caption = 'Hide Details of Private Appointments' + TabOrder = 2 + Visible = False + end + end + object tshPrintStyles: TTabSheet + Caption = 'Print Styles' + object lblPrintStylesOptions: TLabel + Left = 5 + Top = 72 + Width = 37 + Height = 13 + Caption = 'Options' + end + object bvlPrintStyleOptions: TBevel + Left = 50 + Top = 76 + Width = 258 + Height = 4 + Shape = bsBottomLine + end + object lblPreviewWindow: TStaticText + Left = 324 + Top = 0 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 0 + end + object cbxPrintStyles: TcxImageComboBox + Left = 6 + Top = 18 + Width = 299 + Height = 21 + Properties.Alignment.Vert = taVCenter + Properties.Items = <> + TabOrder = 1 + OnClick = cbxPrintStylesClick + end + object pcPrintStyleOptions: TPageControl + Left = 4 + Top = 90 + Width = 314 + Height = 284 + ActivePage = tshWeekly + Style = tsButtons + TabOrder = 2 + object tshDaily: TTabSheet + Caption = 'Daily' + TabVisible = False + object lblPrintStyleDailyLayout: TLabel + Left = 14 + Top = 7 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleDailyLayout + end + object lblPrintStyleDailyInclude: TLabel + Left = 14 + Top = 67 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleDailyPrintFrom: TLabel + Left = 14 + Top = 139 + Width = 53 + Height = 13 + Caption = 'Print &From:' + FocusControl = tePrintStyleDailyPrintFrom + end + object lblPrintStyleDailyPrintTo: TLabel + Left = 14 + Top = 168 + Width = 41 + Height = 13 + Caption = 'Print &To:' + FocusControl = tePrintStyleDailyPrintTo + end + object lblPrintStyleDailyResourceCountPerPage: TLabel + Left = 14 + Top = 37 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleDailyResourceCountPerPage + end + object cbxPrintStyleDailyLayout: TcxComboBox + Left = 115 + Top = 2 + Width = 186 + Height = 23 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/day' + '2 pages/day') + TabOrder = 0 + OnClick = cbxPrintStyleDailyLayoutClick + end + object chbxPrintStyleDailyTaskPad: TcxCheckBox + Left = 111 + Top = 64 + Width = 190 + Height = 21 + Caption = 'Task&Pad' + TabOrder = 2 + OnClick = chbxPrintStyleOptionsViewClick + end + object chbxPrintStyleDailyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 85 + Width = 190 + Height = 21 + Caption = 'Notes Area (&Blank)' + TabOrder = 3 + OnClick = chbxPrintStyleOptionsViewClick + end + object chbxPrintStyleDailyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 106 + Width = 190 + Height = 21 + Caption = 'Notes Area (&Lined)' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + end + object tePrintStyleDailyPrintFrom: TcxTimeEdit + Left = 114 + Top = 135 + Width = 100 + Height = 21 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 5 + end + object tePrintStyleDailyPrintTo: TcxTimeEdit + Tag = 1 + Left = 114 + Top = 164 + Width = 100 + Height = 21 + EditValue = 0.000000000000000000 + Properties.ImmediatePost = True + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 6 + end + object sePrintStyleDailyResourceCountPerPage: TcxSpinEdit + Left = 115 + Top = 33 + Width = 100 + Height = 21 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 1 + end + end + object tshWeekly: TTabSheet + Caption = 'Weekly' + ImageIndex = 1 + TabVisible = False + object lblPrintStyleWeeklyPrintTo: TLabel + Left = 14 + Top = 199 + Width = 41 + Height = 13 + Caption = 'Print &To:' + FocusControl = tePrintStyleWeeklyPrintTo + end + object lblPrintStyleWeeklyPrintFrom: TLabel + Left = 14 + Top = 170 + Width = 53 + Height = 13 + Caption = 'Print &From:' + FocusControl = tePrintStyleWeeklyPrintFrom + end + object lblPrintStyleWeeklyInclude: TLabel + Left = 14 + Top = 97 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleWeeklyLayout: TLabel + Left = 14 + Top = 36 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleWeeklyLayout + end + object lblPrintStyleWeeklyArrange: TLabel + Left = 14 + Top = 7 + Width = 43 + Height = 13 + Caption = '&Arrange:' + FocusControl = cbxPrintStyleWeeklyArrange + end + object lblPrintStyleWeeklyResourceCountPerPage: TLabel + Left = 14 + Top = 67 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleWeeklyResourceCountPerPage + end + object tePrintStyleWeeklyPrintTo: TcxTimeEdit + Tag = 1 + Left = 114 + Top = 194 + Width = 100 + Height = 21 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 7 + end + object tePrintStyleWeeklyPrintFrom: TcxTimeEdit + Left = 114 + Top = 165 + Width = 100 + Height = 21 + EditValue = 0.000000000000000000 + Properties.TimeFormat = tfHourMin + Properties.OnChange = tePrintStylePrintRangePropertiesChange + Properties.OnEditValueChanged = tePrintStylePrintRangePropertiesEditValueChanged + TabOrder = 6 + end + object chbxPrintStyleWeeklyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 136 + Width = 190 + Height = 21 + Caption = 'Notes Area (&Lined)' + TabOrder = 5 + OnClick = chbxPrintStyleOptionsViewClick + end + object chbxPrintStyleWeeklyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 115 + Width = 190 + Height = 21 + Caption = 'Notes Area (&Blank)' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + end + object cbxPrintStyleWeeklyArrange: TcxComboBox + Left = 115 + Top = 2 + Width = 186 + Height = 23 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + 'Top to Bottom' + 'Left to Right') + TabOrder = 0 + OnClick = cbxPrintStyleWeeklyArrangeClick + end + object cbxPrintStyleWeeklyLayout: TcxComboBox + Left = 115 + Top = 32 + Width = 186 + Height = 23 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/day' + '2 pages/day') + TabOrder = 1 + OnClick = cbxPrintStyleWeeklyLayoutClick + end + object chbxPrintStyleWeeklyTaskPad: TcxCheckBox + Left = 111 + Top = 94 + Width = 190 + Height = 21 + Caption = 'TaskPad' + TabOrder = 3 + OnClick = chbxPrintStyleOptionsViewClick + end + object chbxPrintStyleWeeklyDontPrintWeekends: TcxCheckBox + Left = 9 + Top = 223 + Width = 285 + Height = 21 + Caption = 'Don'#39't Print &Weekends' + TabOrder = 8 + OnClick = chbxPrintStyleWeeklyDontPrintWeekendsClick + end + object sePrintStyleWeeklyResourceCountPerPage: TcxSpinEdit + Tag = 1 + Left = 115 + Top = 63 + Width = 100 + Height = 21 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 2 + end + end + object tshMonthly: TTabSheet + Caption = 'Monthly' + ImageIndex = 2 + TabVisible = False + object lblPrintStyleMonthlyLayout: TLabel + Left = 14 + Top = 7 + Width = 37 + Height = 13 + Caption = 'La&yout:' + FocusControl = cbxPrintStyleMonthlyLayout + end + object lblPrintStyleMonthlyInclude: TLabel + Left = 14 + Top = 67 + Width = 39 + Height = 13 + Caption = 'Include:' + end + object lblPrintStyleMonthlyResourceCountPerPage: TLabel + Left = 14 + Top = 37 + Width = 82 + Height = 13 + Caption = 'Resources/Page:' + FocusControl = sePrintStyleMonthlyResourceCountPerPage + end + object cbxPrintStyleMonthlyLayout: TcxComboBox + Left = 115 + Top = 2 + Width = 186 + Height = 23 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + '1 page/month' + '2 pages/month') + TabOrder = 0 + OnClick = cbxPrintStyleMonthlyLayoutClick + end + object chbxPrintStyleMonthlyTaskPad: TcxCheckBox + Left = 111 + Top = 64 + Width = 190 + Height = 21 + Caption = 'Task&Pad' + TabOrder = 2 + OnClick = chbxPrintStyleOptionsViewClick + end + object chbxPrintStyleMonthlyNotesAreaBlank: TcxCheckBox + Tag = 1 + Left = 111 + Top = 85 + Width = 190 + Height = 21 + Caption = 'Notes Area (&Blank)' + TabOrder = 3 + OnClick = chbxPrintStyleOptionsViewClick + end + object chbxPrintStyleMonthlyNotesAreaLined: TcxCheckBox + Tag = 2 + Left = 111 + Top = 106 + Width = 190 + Height = 21 + Caption = 'Notes Area (&Lined)' + TabOrder = 4 + OnClick = chbxPrintStyleOptionsViewClick + end + object chbxPrintStyleMonthlyDontPrintWeekends: TcxCheckBox + Left = 9 + Top = 144 + Width = 285 + Height = 21 + Caption = 'Don'#39't Print &Weekends' + TabOrder = 5 + OnClick = chbxPrintStyleMonthlyDontPrintWeekendsClick + end + object chbxPrintStyleMonthlyPrintExactlyOneMonthPerPage: TcxCheckBox + Left = 9 + Top = 167 + Width = 285 + Height = 21 + Caption = 'Print Exactly One Month Per Page' + TabOrder = 6 + OnClick = chbxPrintStyleMonthlyPrintExactlyOneMonthPerPageClick + end + object sePrintStyleMonthlyResourceCountPerPage: TcxSpinEdit + Tag = 2 + Left = 115 + Top = 33 + Width = 100 + Height = 21 + Properties.OnChange = sePrintStyleResourceCountPerPagePropertiesChanged + Properties.OnEditValueChanged = sePrintStyleResourceCountPerPagePropertiesEditValueChanged + TabOrder = 1 + end + end + object tshTrifold: TTabSheet + Caption = 'Tri-fold' + ImageIndex = 3 + TabVisible = False + object lblPrintStyleTrifoldSectionLeft: TLabel + Left = 14 + Top = 7 + Width = 61 + Height = 13 + Caption = '&Left Section:' + FocusControl = cbxPrintStyleTrifoldSectionLeft + end + object lblPrintStyleTrifoldSectionMiddle: TLabel + Left = 14 + Top = 41 + Width = 72 + Height = 13 + Caption = '&Middle Section:' + FocusControl = cbxPrintStyleTrifoldSectionMiddle + end + object lblPrintStyleTrifoldSectionRight: TLabel + Left = 14 + Top = 74 + Width = 67 + Height = 13 + Caption = '&Right Section:' + FocusControl = cbxPrintStyleTrifoldSectionRight + end + object cbxPrintStyleTrifoldSectionLeft: TcxComboBox + Left = 100 + Top = 2 + Width = 200 + Height = 23 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + TabOrder = 0 + OnClick = cbxPrintStyleTrifoldSectionModeClick + end + object cbxPrintStyleTrifoldSectionMiddle: TcxComboBox + Tag = 1 + Left = 100 + Top = 36 + Width = 200 + Height = 23 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + TabOrder = 1 + OnClick = cbxPrintStyleTrifoldSectionModeClick + end + object cbxPrintStyleTrifoldSectionRight: TcxComboBox + Tag = 2 + Left = 100 + Top = 69 + Width = 200 + Height = 23 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + TabOrder = 2 + OnClick = cbxPrintStyleTrifoldSectionModeClick + end + end + object tshDetails: TTabSheet + Caption = 'Details' + ImageIndex = 4 + TabVisible = False + object chbxPrintStyleDetailsUsePagination: TcxCheckBox + Left = 14 + Top = 3 + Width = 187 + Height = 21 + Caption = 'Start a New Page Each:' + TabOrder = 0 + OnClick = chbxPrintStyleDetailsUsePaginationClick + end + object cbxPrintStyleDetailsPagination: TcxComboBox + Left = 203 + Top = 2 + Width = 97 + Height = 23 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.Items.Strings = ( + 'Day' + 'Week' + 'Month') + TabOrder = 1 + OnClick = cbxPrintStyleDetailsPaginationClick + end + end + object tshMemo: TTabSheet + Caption = 'Memo' + ImageIndex = 5 + TabVisible = False + object chbxPrintStyleMemoStartEachItemOnNewPage: TcxCheckBox + Left = 14 + Top = 3 + Width = 187 + Height = 21 + Caption = 'Start Each Item On New Page' + TabOrder = 0 + OnClick = chbxPrintStyleMemoStartEachItemOnNewPageClick + end + object chbxPrintStyleMemoPrintOnlySelectedEvents: TcxCheckBox + Left = 14 + Top = 27 + Width = 187 + Height = 21 + Caption = 'Print Only Selected Events' + State = cbsChecked + TabOrder = 1 + OnClick = chbxPrintStyleMemoPrintOnlySelectedEventsClick + end + end + end + object pnlPrintStylesPreview: TPanel + Left = 323 + Top = 17 + Width = 275 + Height = 356 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 3 + object pbxPrintStylesPreview: TPaintBox + Left = 1 + Top = 1 + Width = 273 + Height = 354 + Align = alClient + OnPaint = pbxPrintStylesPreviewPaint + end + end + end + object tshFormatting: TTabSheet + Caption = 'Formatting' + ImageIndex = 2 + object bvlLookAndFeel: TBevel + Left = 85 + Top = 13 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object lblLookAndFeel: TLabel + Left = 5 + Top = 8 + Width = 66 + Height = 13 + Caption = 'Look and Feel' + end + object imgLookAndFeel: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDD77777777777777777777 + 7777D0000000000000000000000007DDDDDDDDDDDDD000000000000000000000 + 0007D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0FFFFFFFFFF78888877787807DDDDDDDDDDDDD0FFFFFFFFFF7888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7888888888 + 8807D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCDDDDCDDDD077777777777777777777 + 7707D0888877787878888877787807DDDCCCCDCCDDD088887778787888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF07DDDCCCCCCCCDD088888888887888888888 + 8807D0777777777777777777777707DDDCCCCDCCDDD077777777777777777777 + 7707D0FFFFFFFFFF7FFFFFFFFFFF07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0FFFFFFFFFF7FFFFFFFFFFF07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDCCCCDCCDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCCCCCCCCDD077777777777777777777 + 7707D0888877787878888877787807DDDCCCCDCCDDD088887778787888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF07DDDCDDDDCDDDD088888888887888888888 + 8807D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FFFFFFFFFF7FFFFFFFFFFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D0888877787878888877787807DDDDDDDDDDDDD088887778787888887778 + 7807D0FFFFFFFFFF7FFFFFFFFFFF0DDDDDDDDDDDDDD088888888887888888888 + 8807D000000000000000000000000DDDDDDDDDDDDDD000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblRefinements: TLabel + Left = 5 + Top = 78 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlRefinements: TBevel + Left = 75 + Top = 82 + Width = 236 + Height = 4 + Shape = bsBottomLine + end + object imgRefinements: TImage + Left = 8 + Top = 100 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDD77777777777777777777 + 7777D0000000000000000000000007DDDDDDDDDDDDD000000000000000000000 + 0007D0FAFAFAFAFA7AFAFAFAFAFA07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0FAFAFAFAFA788888777CC807DDDDDDDDDDDDD0FFFFFFFFFF7888887778 + 7807D0AFAFAFAFAF78888888888807DDDDDDDDDDDDD0FFFFFFFFFF7888888888 + 8807D0888888888877777777777707DDDDDDDDDDDDD088888888887777777777 + 7707D0AFAFAFAFAF7FAFAFAFAFAF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FAFAFAFAFA7AFAFAFAFAFA07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCDDDDCDDDD077777777777777777777 + 7707D08888777CC8788888777CC807DDDCCCCDCCDDD088887778787888887778 + 7807D0888888888878888888888807DDDCCCCCCCCDD088888888887888888888 + 8807D0777777777777777777777707DDDCCCCDCCDDD077777777777777777777 + 7707D0FEFEFEFEFE7EFEFEFEFEFE07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0EFEFEFEFEF7FEFEFEFEFEF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0EFEFEFEFEF7FEFEFEFEFEF07DDDCDDDDCDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FEFEFEFEFE7EFEFEFEFEFE07DDDCCCCDCCDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDCCCCCCCCDD077777777777777777777 + 7707D08888777CC8788888777CC807DDDCCCCDCCDDD088887778787888887778 + 7807D0888888888878888888888807DDDCDDDDCDDDD088888888887888888888 + 8807D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D0FBFBFBFBFB7BFBFBFBFBFF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0BFBFBFBFBF7FBFBFBFBFBF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0888888888878888888888807DDDDDDDDDDDDD088888888887888888888 + 8807D0BFBFBFBFBF7FBFBFBFBFBF07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0FBFBFBFBFB7BFBFBFBFBFB07DDDDDDDDDDDDD0FFFFFFFFFF7FFFFFFFFF + FF07D0777777777777777777777707DDDDDDDDDDDDD077777777777777777777 + 7707D08888777CC8788888777CC807DDDDDDDDDDDDD088887778787888887778 + 7807D088888888887888888888880DDDDDDDDDDDDDD088888888887888888888 + 8807D000000000000000000000000DDDDDDDDDDDDDD000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object cbxLookAndFeel: TcxComboBox + Left = 90 + Top = 37 + Width = 215 + Height = 23 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 15 + Properties.OnChange = cbxLookAndFeelPropertiesChange + TabOrder = 0 + OnClick = LookAndFeelChange + end + object chbxSuppressBackgroundBitmaps: TcxCheckBox + Tag = 1 + Left = 90 + Top = 104 + Width = 200 + Height = 21 + Caption = 'Suppress Background Textures' + TabOrder = 1 + OnClick = OptionsFormattingClick + end + object chbxSuppressContentColoration: TcxCheckBox + Tag = 2 + Left = 90 + Top = 130 + Width = 200 + Height = 21 + Caption = 'Suppress Content Coloration' + TabOrder = 2 + OnClick = OptionsFormattingClick + end + end + object tshStyles: TTabSheet + Caption = 'Styles' + ImageIndex = 1 + object bvlStyles: TBevel + Left = 118 + Top = 13 + Width = 193 + Height = 4 + Shape = bsBottomLine + end + object bvlStyleSheets: TBevel + Left = 72 + Top = 302 + Width = 239 + Height = 5 + Shape = bsBottomLine + end + object lblStyleSheets: TLabel + Left = 6 + Top = 298 + Width = 60 + Height = 13 + Caption = 'Style Sheets' + end + object bvlStylesHost: TBevel + Left = 6 + Top = 33 + Width = 228 + Height = 222 + end + object Label1: TLabel + Left = 85 + Top = 140 + Width = 64 + Height = 13 + Caption = '[ Styles Site ]' + Visible = False + end + object lblUseNativeStyles: TLabel + Left = 24 + Top = 9 + Width = 84 + Height = 13 + Caption = '&Use Native Styles' + FocusControl = chbxUseNativeStyles + OnClick = lblUseNativeStylesClick + end + object btnStyleColor: TButton + Left = 243 + Top = 61 + Width = 68 + Height = 23 + Caption = 'Co&lor...' + TabOrder = 0 + OnClick = btnStyleColorClick + end + object btnStyleFont: TButton + Left = 243 + Top = 33 + Width = 68 + Height = 23 + Caption = '&Font...' + TabOrder = 1 + OnClick = btnStyleFontClick + end + object btnStyleBackgroundBitmap: TButton + Left = 243 + Top = 97 + Width = 68 + Height = 23 + Caption = '&Bitmap...' + TabOrder = 2 + OnClick = btnStyleBackgroundBitmapClick + end + object cbxStyleSheets: TcxComboBox + Left = 6 + Top = 318 + Width = 305 + Height = 24 + AutoSize = False + Properties.DropDownListStyle = lsFixedList + Properties.ItemHeight = 20 + Properties.OnDrawItem = cbxStyleSheetsPropertiesDrawItem + TabOrder = 3 + OnClick = cbxStyleSheetsClick + OnKeyDown = cbxStyleSheetsKeyDown + end + object btnStyleSheetNew: TButton + Left = 6 + Top = 350 + Width = 71 + Height = 23 + Caption = '&New...' + TabOrder = 4 + OnClick = btnStyleSheetNewClick + end + object btnStyleSheetCopy: TButton + Left = 84 + Top = 350 + Width = 71 + Height = 23 + Caption = '&Copy...' + TabOrder = 5 + OnClick = btnStyleSheetCopyClick + end + object btnStyleSheetDelete: TButton + Left = 162 + Top = 350 + Width = 71 + Height = 23 + Caption = '&Delete...' + TabOrder = 6 + OnClick = btnStyleSheetDeleteClick + end + object btnStylesSaveAs: TButton + Left = 123 + Top = 263 + Width = 112 + Height = 23 + Caption = 'Save &As...' + TabOrder = 7 + OnClick = btnStylesSaveAsClick + end + object btnStyleSheetRename: TButton + Left = 240 + Top = 350 + Width = 71 + Height = 23 + Caption = '&Rename...' + TabOrder = 8 + OnClick = btnStyleSheetRenameClick + end + object btnStyleBackgroundBitmapClear: TButton + Left = 243 + Top = 125 + Width = 68 + Height = 23 + Caption = 'Cle&ar' + TabOrder = 9 + OnClick = btnStyleBackgroundBitmapClearClick + end + object btnStyleRestoreDefaults: TButton + Left = 6 + Top = 263 + Width = 112 + Height = 23 + Caption = 'Rest&ore Defaults' + TabOrder = 10 + OnClick = btnStyleRestoreDefaultsClick + end + object chbxUseNativeStyles: TcxCheckBox + Left = 3 + Top = 6 + Width = 22 + Height = 21 + TabOrder = 11 + OnClick = OptionsFormattingClick + end + end + end + object pnlPreview: TPanel + Left = 331 + Top = 46 + Width = 275 + Height = 356 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + object pbPreview: TPaintBox + Left = 1 + Top = 1 + Width = 273 + Height = 354 + Align = alClient + OnPaint = pbPreviewPaint + end + end + object pmStyles: TPopupMenu + Images = ilStylesPopup + OnPopup = pmStylesPopup + Left = 6 + Top = 417 + object miStyleFont: TMenuItem + Caption = '&Font...' + ImageIndex = 0 + OnClick = btnStyleFontClick + end + object miStyleColor: TMenuItem + Caption = '&Color...' + OnClick = btnStyleColorClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miStyleBackgroundBitmap: TMenuItem + Caption = '&Bitmap...' + ImageIndex = 1 + ShortCut = 16463 + OnClick = btnStyleBackgroundBitmapClick + end + object miStyleBackgroundBitmapClear: TMenuItem + Caption = 'Clear' + ImageIndex = 3 + ShortCut = 16430 + OnClick = btnStyleBackgroundBitmapClearClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miStyleRestoreDefaults: TMenuItem + Caption = 'Restore Defaults' + OnClick = btnStyleRestoreDefaultsClick + end + object milLine: TMenuItem + Caption = '-' + end + object miStylesSelectAll: TMenuItem + Caption = 'Select A&ll' + ShortCut = 16449 + OnClick = miStylesSelectAllClick + end + object miLine4: TMenuItem + Caption = '-' + end + object miStylesSaveAs: TMenuItem + Caption = 'Save &As...' + ImageIndex = 2 + ShortCut = 16467 + OnClick = btnStylesSaveAsClick + end + end + object ilStylesPopup: TImageList + Left = 34 + Top = 417 + Bitmap = { + 494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00000000000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF000000 + 0000008080000080800000808000008080000080800000808000008080000080 + 8000008080000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000000000000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000008080000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF00FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800080808000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00C0C0C00000FFFF00C0C0C000FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000000000008080800080808000000000008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C00000000000C0C0C00000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFC001FFFF + FE07001F8001FFF9FF9F000F8001E7FFFF9F00078001C3F3E01F00038001C3E7 + F99F00018001E1C7F99B00008001F08FF99B00018001F81FF89300018001FC3F + D80300018001F81FD9BF80018001F09FC93FE0018001C1C7C03FE001800183E3 + FFFFE00180018FF1FFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end + object cxEditStyleController1: TcxEditStyleController + OnStyleChanged = StyleController1StyleChanged + Left = 64 + Top = 416 + end +end diff --git a/official/x.35/Lib/D11/dxPScxSchedulerLnk.res b/official/x.35/Lib/D11/dxPScxSchedulerLnk.res new file mode 100644 index 00000000..574c0437 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxSchedulerLnk.res differ diff --git a/official/x.35/Lib/D11/dxPScxTLLnk.dcu b/official/x.35/Lib/D11/dxPScxTLLnk.dcu new file mode 100644 index 00000000..569408d9 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxTLLnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxTLLnk.dfm b/official/x.35/Lib/D11/dxPScxTLLnk.dfm new file mode 100644 index 00000000..61aea1a6 --- /dev/null +++ b/official/x.35/Lib/D11/dxPScxTLLnk.dfm @@ -0,0 +1,1582 @@ +object dxfmTreeListReportLinkDesignWindow: TdxfmTreeListReportLinkDesignWindow + Left = 426 + Top = 272 + BorderStyle = bsDialog + Caption = 'Property Sheets' + ClientHeight = 391 + ClientWidth = 624 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 4 + Width = 618 + Height = 353 + ActivePage = tshStyles + TabOrder = 0 + OnChange = PageControl1Change + object tshView: TTabSheet + Caption = 'View' + object lblShow: TLabel + Left = 5 + Top = 8 + Width = 26 + Height = 13 + Caption = 'Show' + end + object imgShow: TImage + Left = 8 + Top = 34 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlShow: TBevel + Left = 43 + Top = 12 + Width = 253 + Height = 4 + Shape = bsBottomLine + end + object lblOnEveryPage: TLabel + Left = 5 + Top = 166 + Width = 72 + Height = 13 + Caption = 'On Every Page' + end + object imgOnEveryPage: TImage + Left = 8 + Top = 192 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888777777777777777708888888888 + 888887FFFFFFFFFFFFFFF08888888888888887F7777777777777F07777708888 + 888887F7777777777777F0FFFFF08888888887F7777777777777F07777F07777 + 708887FFFFFFFFFFFFFFF07777F0FFFFF08887F777777777777FF07777F07777 + F08887FFFFFFFFFFFFFFF0FFFFF07777F08887F77777777777FFF077FFF07777 + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777777FFFFF0777FF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777FFFFFFFF07FFFF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF0777FF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF077FFF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777777F077FFF077FF + F08887F7777777777777F0FFFFF0FFFFF08887F7777777777777F0FFFFF07FFF + F08887FFFFFFFFFFFFFFF07777F0FFFFF0888000000000000000007777F077FF + F08888888887F7777777777777F0FFFFF08888888887FFFFFFFFFFFFFFF07777 + F0888888888000000000000000007777F08888888888888887F7777777777777 + F08888888888888887FFFFFFFFFFFFFFF0888888888888888000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlOnEveryPage: TBevel + Left = 90 + Top = 171 + Width = 205 + Height = 4 + Shape = bsBottomLine + end + object bvlWarningHost: TBevel + Left = 5 + Top = 251 + Width = 293 + Height = 70 + Visible = False + end + object Bevel2: TBevel + Left = 90 + Top = 91 + Width = 205 + Height = 4 + Shape = bsBottomLine + end + object chbxShowBands: TCheckBox + Left = 90 + Top = 26 + Width = 200 + Height = 17 + Caption = 'Ba&nds' + TabOrder = 0 + OnClick = OptionsViewClick + end + object chbxShowHeaders: TCheckBox + Tag = 1 + Left = 90 + Top = 47 + Width = 200 + Height = 17 + Caption = '&Headers' + TabOrder = 1 + OnClick = OptionsViewClick + end + object chbxShowFooters: TCheckBox + Tag = 2 + Left = 90 + Top = 68 + Width = 200 + Height = 17 + Caption = 'Foo&ters' + TabOrder = 2 + OnClick = OptionsViewClick + end + object chbxShowExpandButtons: TCheckBox + Tag = 3 + Left = 90 + Top = 124 + Width = 200 + Height = 17 + Caption = 'Expand Buttons' + TabOrder = 4 + OnClick = OptionsViewClick + end + object chbxBandsOnEveryPage: TCheckBox + Left = 90 + Top = 184 + Width = 200 + Height = 17 + Caption = 'Ba&nds' + TabOrder = 6 + OnClick = OptionsOnEveryPageClick + end + object chbxHeadersOnEveryPage: TCheckBox + Tag = 1 + Left = 90 + Top = 205 + Width = 200 + Height = 17 + Caption = 'Headers' + TabOrder = 7 + OnClick = OptionsOnEveryPageClick + end + object chbxFootersOnEveryPage: TCheckBox + Tag = 2 + Left = 90 + Top = 226 + Width = 200 + Height = 17 + Caption = 'Footers' + TabOrder = 8 + OnClick = OptionsOnEveryPageClick + end + object chbxShowTreeLines: TCheckBox + Tag = 4 + Left = 90 + Top = 145 + Width = 200 + Height = 17 + Caption = 'TreeLines' + TabOrder = 5 + OnClick = OptionsViewClick + end + object chbxShowBorders: TCheckBox + Tag = 5 + Left = 90 + Top = 103 + Width = 200 + Height = 17 + Caption = 'Borders' + TabOrder = 3 + OnClick = OptionsViewClick + end + object lblPreviewWindow: TStaticText + Left = 305 + Top = 0 + Width = 82 + Height = 14 + AutoSize = False + Caption = 'Preview' + TabOrder = 9 + end + end + object tshBehaviors: TTabSheet + Caption = 'Behaviors' + ImageIndex = 1 + object pnlBehaviors: TPanel + Left = 0 + Top = 0 + Width = 299 + Height = 325 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object pnlSelection: TPanel + Left = 0 + Top = 0 + Width = 299 + Height = 75 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object lblSelection: TLabel + Left = 5 + Top = 8 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object imgSelection: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlSelection: TBevel + Left = 57 + Top = 12 + Width = 239 + Height = 4 + Shape = bsBottomLine + end + object chbxProcessSelection: TCheckBox + Left = 90 + Top = 26 + Width = 205 + Height = 17 + Caption = 'Process Selection' + TabOrder = 0 + OnClick = OptionsSelectionClick + end + object chbxProcessExactSelection: TCheckBox + Tag = 1 + Left = 90 + Top = 51 + Width = 205 + Height = 17 + Caption = 'Process Exact Selection' + TabOrder = 1 + OnClick = OptionsSelectionClick + end + end + object pnlExpanding: TPanel + Left = 0 + Top = 75 + Width = 299 + Height = 70 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object lblExpanding: TLabel + Left = 5 + Top = 8 + Width = 50 + Height = 13 + Caption = 'Expanding' + end + object imgExpanding: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 7778800000000000000000000000078888888888880000000000000000000000 + 007880FFF7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7FF777777FFF77777FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F8F7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7F7F8888FF7F88888FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F8F7777777777777777777078888888888880F7F7F888FFF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F0788077777777777777777777770788C8888C88880F7FF888888FFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880F0F7777777FFFFFFFFFFFF0788CCCCCCCC880F77777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7F7F8888FF7F88888FF7 + F0788077777777777777777777770788C8888C88880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F7F7F8888FF7F888888F7 + F0788077777777777777777777770788CCCC8CC8880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCCCCCC880F7FF88888FFFFFFFFFFF7 + F07880F0F777777FFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F77777777777777777777 + F078800000000000000000000000078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F888888880F88888888888078888888888880F77777777777777777777 + F07880F800008880F80000000008078888888888880F77777777777777777777 + F07880FFFFFFFFF0FFFFFFFFFFFF078888888888880FFFFFFFFFFFFFFFFFFFFF + F078800000000000000000000000088888888888880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object bvlExpanding: TBevel + Left = 62 + Top = 13 + Width = 234 + Height = 4 + Shape = bsBottomLine + end + object chbxExpandNodes: TCheckBox + Left = 90 + Top = 26 + Width = 205 + Height = 17 + Caption = 'Nodes' + TabOrder = 0 + OnClick = OptionsExpandingClick + end + object chbxExplicitlyExpandNodes: TCheckBox + Tag = 1 + Left = 90 + Top = 51 + Width = 205 + Height = 17 + Caption = 'Explicitly Expand Nodes' + TabOrder = 1 + OnClick = OptionsExpandingClick + end + end + object pnlSize: TPanel + Left = 0 + Top = 145 + Width = 299 + Height = 68 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object lblSize: TLabel + Left = 5 + Top = 8 + Width = 19 + Height = 13 + Caption = 'Size' + end + object bvlSize: TBevel + Left = 33 + Top = 13 + Width = 262 + Height = 4 + Shape = bsBottomLine + end + object imgGridSize: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000008088F07DDDDDDDDDDDD0800000000000000000000 + 807DD0F0FFFF8FFFF8FFFF0FFF0F07DDDDDDDDDDDD0F0F77FFF8F777F8F777F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCDDDDCDDDD0F0F00FFF8F00FF8F00FF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCCCCCDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCDDDDCDDDD0F0FFFFFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0888888888888880FFF0F07DDCCCCDCCDDD0F08888888888888888880 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCCCCCCCCDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFF8F00F8F00F0FFF0F07DDCCCCDCCDDD0F0FFFFFF8F0FFF8F0FFF0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00F8F00F8F00F0FFF0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFF8FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0777777777777770FFF0F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F0F8887F8887F8880FFF8F07DDDDDDDDDDDD0F0F888887F88887F88880 + F07DD0F0F0087F0087F0080FFF0F07DDDDDDDDDDDD0F0F800087F80087F80080 + F07DD0F0FFFF7FFFF7FFFF0FFF8F07DDDDDDDDDDDD0F0FFFFFF7FFFFF7FFFFF0 + F07DD0800000000000000008080807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxAutoWidth: TCheckBox + Left = 90 + Top = 26 + Width = 205 + Height = 17 + Caption = '&Auto Width' + TabOrder = 0 + OnClick = OptionsSizeClick + end + end + object pnlSeparators: TPanel + Left = 0 + Top = 213 + Width = 299 + Height = 94 + Align = alTop + BevelOuter = bvNone + TabOrder = 3 + object lblSeparators: TLabel + Left = 5 + Top = 8 + Width = 53 + Height = 13 + Caption = 'Separators' + end + object bvlSeparator: TBevel + Left = 68 + Top = 13 + Width = 229 + Height = 4 + Shape = bsBottomLine + end + object lblSeparatorsThickness: TLabel + Left = 90 + Top = 38 + Width = 50 + Height = 13 + Caption = 'Thickness:' + end + object lblSeparatorsColor: TLabel + Left = 90 + Top = 67 + Width = 29 + Height = 13 + Caption = 'Color:' + end + object bvlSeparatorThicknessHost: TBevel + Left = 152 + Top = 34 + Width = 80 + Height = 21 + end + object bvlSeparatorColorHost: TBevel + Left = 152 + Top = 62 + Width = 143 + Height = 21 + end + object imgSeparators: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000000000F07DDDDDDDDDDDD0800000000000000000000 + 807DD0F0F77FFF8F777F8F777F0F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFFFF8FFFFF8FFFFF0F07DDDDDDDDDDDD0F0F00FFF8F00FF8F000F0 + F07DD0F08888888888888888880F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFFFF8FFFFF8FFFFF0F07DDDDDDDDDDDD0F0F0000F8F000F8F000F0 + F07DD0F0F00FFF8F00FF8F00FF0F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFFFF8FFFFF8FFFFF0F07DDCCCCDCCDDD0F00000000000000000000 + F07DD0F08888888888888888880F07DDCCCCCCCCDD0F00000000000000000000 + F07DD0F0FFFFFF8FFFFF8FFFFF0F07DDCCCCDCCDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFFFF8F000F8F000F0F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFFFF8FFFFF8FFFFF0F07DDDDDDDDDDDD0F0F000FF8F000F8F00FF0 + F07DD0F0F00FFF8F000F8F000F0F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFFFF8FFFFF8FFFFF0F07DDCDDDDCDDDD0F00000000000000000000 + F07DD0F08888888888888888880F07DDCCCCDCCDDD0F00000000000000000000 + F07DD0F0FFFFFF8FFFFF8FFFFF0F07DDCCCCCCCCDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0FFFFFF8F0FFF8F0FFF0F07DDCCCCDCCDDD0F0FFFFFF8F0FFF8F0FFF0 + F07DD0F0FFFFFF8FFFFF8FFFFF0F07DDCDDDDCDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F0F00FFF8F000F8F000F0F07DDDDDDDDDDDD0F0F00FFF8F000F8F000F0 + F07DD0F0FFFFFF8FFFFF8FFFFF0F07DDDDDDDDDDDD0F0FFFFFF8FFFFF8FFFFF0 + F07DD0F07777777777777777770F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F0F888887F88887F88880F07DDDDDDDDDDDD0F0F888887F88887F88880 + F07DD0F0F800087F80087F80080F07DDDDDDDDDDDD0F0F800087F80087F80080 + F07DD0F0FFFFFF7FFFFF7FFFFF0F07DDDDDDDDDDDD0F0FFFFFF7FFFFF7FFFFF0 + F07DD0800000000000000000000807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + end + end + end + object tshFormatting: TTabSheet + Caption = 'Formatting' + ImageIndex = 4 + object lblLookAndFeel: TLabel + Left = 5 + Top = 8 + Width = 66 + Height = 13 + Caption = 'Look and Feel' + end + object bvlLookAndFeel: TBevel + Left = 85 + Top = 12 + Width = 211 + Height = 4 + Shape = bsBottomLine + end + object imgLookAndFeel: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D08777777777780877777788807DCCCCDCCDDD0877777777778787777788 + 8F07D08888888888880888888888807DCCCCCCCCDD0888888888888788888888 + 8F07D00000000000000000000000007DCCCCDCCDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F7777777FF07DDDDDDDDDDD0F777777777FF7F7777777 + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F777777FFF07DDDDDDDDDDD0F777777FFFFF7F777777F + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F7777777777F7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F77777FFFF07DDDDDDDDDDD0F77777777FFF7F77777FF + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D00000000000000000000000007DCDDDDCDDDD0000000000000000000000 + 0007D08888888888880888888888807DCCCCDCCDDD0777777777777777777777 + 7707D08888888888880888888888807DCCCCCCCCDD0F88888888888788888888 + 8707D08000000008880880000000807DCCCCDCCDDD0F00000000888788000000 + 8707D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + F707D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgRefinements: TImage + Left = 7 + Top = 100 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FF7FFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF777777F + F07DD0F77777777FF7FF70888FFF07DDCCCCCCCCDD0F77777777FF7FF7FFFF7F + F07DD0FFFFFFFFFFF7FF70FF8FFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF7F00F7F + F07DD0F777777FFFF7FF70FF8FFF07DDCDDDDCDDDD0F777777FFFF7FF7F00F7F + F07DD0FFFFFFFFFFF7FF70000FFF07DDDDDDDDDDDD0FFFFFFFFFFF7FF7FFFF7F + F07DD0F77777777FF7FF777777FF07DDDDDDDDDDDD0F77777777FF7FF777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFCCCCCFFF07DDCCCCCCCCDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FCCCCCCCFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F7777777FFF7FFCCCCCFFF07DDCDDDDCDDDD0F7777777FFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7F9999999FF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F777777777F7FF99999FFF07DDDDDDDDDDDD0F777777777F7F7777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F80000888887F88888888707DDDDDDDDDDDD0F80000888887F88888888 + 707DD0F80000000087F80000008707DDDDDDDDDDDD0F80000000087F80000008 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0FFFFFFFFFFF7FFFFFFFFF707DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + 707DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblRefinements: TLabel + Left = 5 + Top = 78 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlRefinements: TBevel + Left = 70 + Top = 83 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object bvlRefinementsSeparator: TBevel + Left = 90 + Top = 168 + Width = 205 + Height = 4 + Shape = bsBottomLine + end + object cbxLookAndFeel: TComboBox + Left = 90 + Top = 37 + Width = 202 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + OnChange = LookAndFeelChange + end + object chbxFlatCheckMarks: TCheckBox + Tag = 2 + Left = 90 + Top = 145 + Width = 210 + Height = 17 + Caption = 'Flat Check &Marks' + TabOrder = 3 + OnClick = OptionsRefinementsClick + end + object chbxDisplayGraphicsAsText: TCheckBox + Tag = 1 + Left = 90 + Top = 122 + Width = 210 + Height = 17 + Caption = 'Display Graphics As &Text' + TabOrder = 2 + OnClick = OptionsRefinementsClick + end + object chbxTransparentGraphics: TCheckBox + Left = 90 + Top = 100 + Width = 210 + Height = 17 + Caption = 'Transparent &Graphics' + TabOrder = 1 + OnClick = OptionsRefinementsClick + end + object chbxSuppressBackgroundBitmaps: TCheckBox + Tag = 1 + Left = 90 + Top = 181 + Width = 210 + Height = 17 + Caption = 'Suppress Background Textures' + TabOrder = 4 + OnClick = OptionsFormattingClick + end + object chbxConsumeSelectionStyle: TCheckBox + Tag = 2 + Left = 90 + Top = 204 + Width = 210 + Height = 17 + Caption = 'Consume Selection Style' + TabOrder = 5 + OnClick = OptionsFormattingClick + end + end + object tshStyles: TTabSheet + Caption = 'Styles' + ImageIndex = 4 + object bvlStyles: TBevel + Left = 115 + Top = 13 + Width = 181 + Height = 4 + Shape = bsBottomLine + end + object bvlStyleSheets: TBevel + Left = 72 + Top = 249 + Width = 224 + Height = 5 + Shape = bsBottomLine + end + object lblStyleSheets: TLabel + Left = 6 + Top = 246 + Width = 60 + Height = 13 + Caption = 'Style Sheets' + end + object bvlStylesHost: TBevel + Left = 6 + Top = 33 + Width = 214 + Height = 173 + end + object Label1: TLabel + Left = 79 + Top = 110 + Width = 68 + Height = 13 + Caption = '[ Styles Host ]' + Visible = False + end + object lblUseNativeStyles: TLabel + Left = 24 + Top = 9 + Width = 84 + Height = 13 + Caption = '&Use Native Styles' + FocusControl = chbxUseNativeStyles + OnClick = lblUseNativeStylesClick + end + object btnStyleColor: TButton + Left = 229 + Top = 61 + Width = 68 + Height = 23 + Caption = 'Co&lor...' + TabOrder = 2 + OnClick = StyleColorClick + end + object btnStyleFont: TButton + Left = 229 + Top = 33 + Width = 68 + Height = 23 + Caption = '&Font...' + TabOrder = 1 + OnClick = StyleFontClick + end + object btnStyleBackgroundBitmap: TButton + Left = 229 + Top = 97 + Width = 68 + Height = 23 + Caption = '&Texture...' + TabOrder = 3 + OnClick = StyleBackgroundBitmapClick + end + object chbxUseNativeStyles: TCheckBox + Left = 5 + Top = 8 + Width = 15 + Height = 17 + TabOrder = 0 + OnClick = OptionsFormattingClick + end + object cbxStyleSheets: TComboBox + Left = 6 + Top = 265 + Width = 288 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 7 + OnClick = cbxStyleSheetsClick + OnDrawItem = cbxStyleSheetsDrawItem + OnKeyDown = cbxStyleSheetsKeyDown + end + object btnStyleSheetNew: TButton + Left = 6 + Top = 297 + Width = 68 + Height = 23 + Caption = '&New...' + TabOrder = 8 + OnClick = btnStyleSheetNewClick + end + object btnStyleSheetCopy: TButton + Left = 79 + Top = 297 + Width = 68 + Height = 23 + Caption = '&Copy...' + TabOrder = 9 + OnClick = btnStyleSheetCopyClick + end + object btnStyleSheetDelete: TButton + Left = 153 + Top = 297 + Width = 68 + Height = 23 + Caption = '&Delete...' + TabOrder = 10 + OnClick = btnStyleSheetDeleteClick + end + object btnStylesSaveAs: TButton + Left = 116 + Top = 213 + Width = 104 + Height = 23 + Caption = 'Save &As...' + TabOrder = 6 + OnClick = StylesSaveAsClick + end + object btnStyleSheetRename: TButton + Left = 226 + Top = 297 + Width = 68 + Height = 23 + Caption = '&Rename...' + TabOrder = 11 + OnClick = btnStyleSheetRenameClick + end + object btnStyleBackgroundBitmapClear: TButton + Left = 229 + Top = 125 + Width = 68 + Height = 23 + Caption = 'Clear' + TabOrder = 4 + OnClick = StyleBackgroundBitmapClearClick + end + object btnStyleRestoreDefaults: TButton + Left = 6 + Top = 213 + Width = 105 + Height = 23 + Caption = 'Restore Defaults' + TabOrder = 5 + OnClick = StyleRestoreDefaultsClick + end + end + object tshPreview: TTabSheet + Caption = 'Preview' + ImageIndex = 2 + object lblPreviewOptions: TLabel + Left = 5 + Top = 8 + Width = 37 + Height = 13 + Caption = 'Options' + end + object bvlPreviewOptions: TBevel + Left = 54 + Top = 12 + Width = 242 + Height = 5 + Shape = bsBottomLine + end + object lblPreviewMaxLineCount: TLabel + Left = 90 + Top = 75 + Width = 78 + Height = 13 + Caption = 'Max Line Count:' + end + object bvlPreviewMaxLineCountHost: TBevel + Left = 215 + Top = 71 + Width = 68 + Height = 21 + Visible = False + end + object imgPreview: TImage + Left = 8 + Top = 33 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDD7777777777777777777777777DDDDDD0000000000000000000000000 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F07DDDDDD0F7FC9F77777777777777F7F0 + 7DDDDDD0F7F9CF77777777777777F7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7F7FFCCFFCCCCFFCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7F7FFCCCCCFCCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7F7FFCCCCCCCFCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7F7FFCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7F7FFCCCCCCCCFCCFCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7F7FFCCCCCFFCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7F7FFCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FC9F77777777777777F7F07DDDDDD0F7F9CF77777777777777F7F0 + 7DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F88887F888887F888887F07DDDDDD0F7F00087F000087F000087F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0000000000000000000000000 + DDDD} + Transparent = True + end + object chbxPreviewVisible: TCheckBox + Left = 90 + Top = 30 + Width = 207 + Height = 17 + Caption = 'Visible' + TabOrder = 0 + OnClick = PreviewVisibleClick + end + object chbxPreviewAutoHeight: TCheckBox + Left = 90 + Top = 51 + Width = 207 + Height = 17 + Caption = 'Auto Height' + TabOrder = 1 + OnClick = PreviewAutoHeightClick + end + end + end + object pnlPreview: TPanel + Left = 313 + Top = 44 + Width = 300 + Height = 304 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + object PreviewTreeList: TcxTreeList + Left = 5 + Top = 5 + Width = 291 + Height = 294 + Bands = < + item + Caption.Text = 'Manufacturer Data' + Width = 173 + end + item + Caption.Text = 'Car Data' + Width = 116 + end> + BufferedPaint = False + DefaultRowHeight = 17 + Enabled = False + OptionsBehavior.AutomateLeftMostIndent = False + OptionsView.CellAutoHeight = True + OptionsView.ScrollBars = ssNone + OptionsView.Bands = True + OptionsView.ColumnAutoWidth = True + OptionsView.GridLines = tlglBoth + OptionsView.UseNodeColorForIndent = False + Preview.Column = colManufacturerCountry + TabOrder = 0 + OnCustomDrawBandHeader = PreviewTreeListCustomDrawBandHeader + OnCustomDrawCell = PreviewTreeListCustomDrawCell + OnCustomDrawFooterCell = PreviewTreeListCustomDrawFooterCell + OnCustomDrawHeaderCell = PreviewTreeListCustomDrawHeader + object colManufacturerName: TcxTreeListColumn + Caption.Text = 'Name' + DataBinding.ValueType = 'String' + Width = 113 + Position.ColIndex = 0 + Position.RowIndex = 0 + Position.BandIndex = 0 + end + object colManufacturerLogo: TcxTreeListColumn + Caption.Text = 'Logo' + DataBinding.ValueType = 'String' + Width = 60 + Position.ColIndex = 1 + Position.RowIndex = 0 + Position.BandIndex = 0 + end + object colManufacturerCountry: TcxTreeListColumn + Caption.Text = 'Country' + DataBinding.ValueType = 'String' + Width = 167 + Position.ColIndex = 2 + Position.RowIndex = 0 + Position.BandIndex = 0 + end + object colCarModel: TcxTreeListColumn + Caption.Text = 'Model' + DataBinding.ValueType = 'String' + Width = 86 + Position.ColIndex = 0 + Position.RowIndex = 0 + Position.BandIndex = 1 + end + object colCarIsSUV: TcxTreeListColumn + Caption.Text = 'SUV' + DataBinding.ValueType = 'String' + Width = 30 + Position.ColIndex = 1 + Position.RowIndex = 0 + Position.BandIndex = 1 + end + end + end + object cxStyleRepository1: TcxStyleRepository + Left = 4 + Top = 362 + object styleBandHeaders: TcxStyle + AssignedValues = [svFont] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + end + object styleStandard: TcxStyle + AssignedValues = [svFont] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + end + object stylePreview: TcxStyle + AssignedValues = [svFont] + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + end + object styleCardShadow: TcxStyle + end + end + object pmStyles: TPopupMenu + Images = ilStylesPopup + OnPopup = pmStylesPopup + Left = 32 + Top = 362 + object miStyleFont: TMenuItem + Caption = '&Font...' + ImageIndex = 0 + ShortCut = 16454 + OnClick = StyleFontClick + end + object miStyleColor: TMenuItem + Caption = '&Color...' + OnClick = StyleColorClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miStyleBackgroundBitmap: TMenuItem + Caption = '&Texture...' + ImageIndex = 1 + OnClick = StyleBackgroundBitmapClick + end + object miStyleBackgroundBitmapClear: TMenuItem + Caption = 'Clear' + ImageIndex = 3 + ShortCut = 16430 + OnClick = StyleBackgroundBitmapClearClick + end + object milLine: TMenuItem + Caption = '-' + end + object miStylesSelectAll: TMenuItem + Caption = 'Select A&ll' + ShortCut = 16449 + OnClick = miStylesSelectAllClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miStyleRestoreDefaults: TMenuItem + Caption = 'Restore Defaults' + OnClick = StyleRestoreDefaultsClick + end + object miLine4: TMenuItem + Caption = '-' + end + object miStylesSaveAs: TMenuItem + Caption = 'Save &As...' + ImageIndex = 2 + ShortCut = 16467 + OnClick = StylesSaveAsClick + end + end + object ilStylesPopup: TImageList + Left = 60 + Top = 362 + Bitmap = { + 494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00000000000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF000000 + 0000008080000080800000808000008080000080800000808000008080000080 + 8000008080000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000000000000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000008080000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF00FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800080808000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00C0C0C00000FFFF00C0C0C000FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000000000008080800080808000000000008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C00000000000C0C0C00000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFC001FFFF + FE07001F8001FFF9FF9F000F8001E7FFFF9F00078001C3F3E01F00038001C3E7 + F99F00018001E1C7F99B00008001F08FF99B00018001F81FF89300018001FC3F + D80300018001F81FD9BF80018001F09FC93FE0018001C1C7C03FE001800183E3 + FFFFE00180018FF1FFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxPScxTLLnkD11.dcp b/official/x.35/Lib/D11/dxPScxTLLnkD11.dcp new file mode 100644 index 00000000..9b801b28 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxTLLnkD11.dcp differ diff --git a/official/x.35/Lib/D11/dxPScxTLLnkD11.dcu b/official/x.35/Lib/D11/dxPScxTLLnkD11.dcu new file mode 100644 index 00000000..38cb6b7d Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxTLLnkD11.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxTLLnkPredefinedStyleSheets.dcu b/official/x.35/Lib/D11/dxPScxTLLnkPredefinedStyleSheets.dcu new file mode 100644 index 00000000..944d4928 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxTLLnkPredefinedStyleSheets.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxTLLnkPredefinedStyleSheets.dfm b/official/x.35/Lib/D11/dxPScxTLLnkPredefinedStyleSheets.dfm new file mode 100644 index 00000000..dbd927fa --- /dev/null +++ b/official/x.35/Lib/D11/dxPScxTLLnkPredefinedStyleSheets.dfm @@ -0,0 +1,297 @@ +object dxdmPScxTreeListLnkPredefinedStyles: TdxdmPScxTreeListLnkPredefinedStyles + OldCreateOrder = False + Left = 483 + Top = 307 + Height = 150 + Width = 215 + object StyleRepository: TcxStyleRepository + Left = 37 + Top = 12 + object styleProfessionalFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 3355443 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = 13033414 + end + object styleProfessionalGroup: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4214088 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 13033414 + end + object styleProfessionalRowCaption: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6582120 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object styleProfessionalCaptionRow: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = 13033414 + end + object styleProfessionalContentOdd: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 13033414 + end + object styleProfessionalContentEven: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 4214088 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = 536870912 + end + object styleProfessionalPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14541789 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleProfessionalSelection: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object styleGreenFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9358956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleGreenFooter: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 9358956 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenLightContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 12778719 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenLightPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 14154698 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenSelected: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6005301 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleGreenGroup: TcxStyle + AssignedValues = [svFont] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + end + object styleNoneContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleNoneFixed: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentBandHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContentEven: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContentOdd: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentFooter: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentFooterRow: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentPreview: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsItalic] + TextColor = clBlack + end + object styleTransparentSelection: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 13816275 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object ssProfessional: TcxTreeListReportLinkStyleSheet + Caption = 'Professional' + Styles.BandHeader = styleProfessionalFixed + Styles.Content = styleNoneContent + Styles.ContentEven = styleProfessionalContentEven + Styles.ContentOdd = styleProfessionalContentOdd + Styles.Footer = styleProfessionalFixed + Styles.FooterRow = styleProfessionalFixed + Styles.Header = styleProfessionalFixed + Styles.Preview = styleProfessionalPreview + Styles.Selection = styleProfessionalSelection + BuiltIn = True + end + object ssGreen: TcxTreeListReportLinkStyleSheet + Caption = 'Green' + Styles.BandHeader = styleGreenFixed + Styles.Content = styleNoneContent + Styles.ContentEven = styleGreenLightContent + Styles.ContentOdd = styleNoneContent + Styles.Footer = styleGreenFixed + Styles.FooterRow = styleGreenFixed + Styles.Header = styleGreenFixed + Styles.Preview = styleGreenLightPreview + Styles.Selection = styleGreenSelected + BuiltIn = True + end + object ssTransparent: TcxTreeListReportLinkStyleSheet + Caption = 'Transparent' + Styles.BandHeader = styleTransparentBandHeader + Styles.Content = styleTransparentContent + Styles.ContentEven = styleTransparentContentEven + Styles.ContentOdd = styleTransparentContentOdd + Styles.Footer = styleTransparentFooter + Styles.FooterRow = styleTransparentFooterRow + Styles.Header = styleTransparentHeader + Styles.Preview = styleTransparentPreview + Styles.Selection = styleTransparentSelection + BuiltIn = True + end + end +end diff --git a/official/x.35/Lib/D11/dxPScxTLLnkReg.dcu b/official/x.35/Lib/D11/dxPScxTLLnkReg.dcu new file mode 100644 index 00000000..7ae70812 Binary files /dev/null and b/official/x.35/Lib/D11/dxPScxTLLnkReg.dcu differ diff --git a/official/x.35/Lib/D11/dxPScxVGridLnk.dfm b/official/x.35/Lib/D11/dxPScxVGridLnk.dfm new file mode 100644 index 00000000..3f72d8d1 --- /dev/null +++ b/official/x.35/Lib/D11/dxPScxVGridLnk.dfm @@ -0,0 +1,1297 @@ +object cxfmVerticalGridReportLinkDesignWindow: TcxfmVerticalGridReportLinkDesignWindow + Left = 397 + Top = 325 + BorderStyle = bsDialog + Caption = 'cxfmVerticalGridReportLinkDesignWindow' + ClientHeight = 405 + ClientWidth = 644 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 5 + Width = 636 + Height = 363 + ActivePage = tshView + TabOrder = 0 + OnChange = PageControl1Change + object tshView: TTabSheet + Caption = 'View' + object lblShow: TLabel + Left = 5 + Top = 8 + Width = 26 + Height = 13 + Caption = 'Show' + end + object imgShow: TImage + Left = 8 + Top = 34 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDCDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDCCCDDDDDDDDDDDDDDDDDDDDDDDDDDDDCCCCCDDDDDDDDDDDDDDDDDD + DDDDD00000CCC0000000000000000000000DD08888CCC8888887FFFFFFFFFFFF + FF0DD08007CCC7000887F000000000000F0DD088888888888887FFFFFFFFFFFF + FF0DD077777777777777777777777777770DD088888888888887FFFFFFFFFFFF + FF0DD088888888888887FFFFFFFFFFFFFF0DD080000880000887F00000FF0000 + FF0DD088888888888887FFFFFFFFFFFFFF0DD077777777777777777777777777 + 770DD088888888888887FFFFFFFFFFFFFF0DD088888888888887F88888888FFF + FF0DD080000000008887F00000000000FF0DD088888888888887FFFFFFFFFFFF + FF0DD077777777777777777777777777770DD088888888888887FFFFFFFFFFFF + FF0DD088888888888887F88888FFFFFFFF0DD080000000008887F00000000000 + FF0DD088888888888887FFFFFFFFFFFFFF0DD077777777777777777777777777 + 770DD088888888888887FFFFFFFFFFFFFF0DD087777777788887F888888FFFFF + FF0DD08007CCC7000087F0000000F888FF0DD08888CCC8888887FFFFFFFFFFFF + FF0DD00000CCC0000000000000000000000DDDDDDCCCCCDDDDDDDDDDDDDDDDDD + DDDDDDDDDDCCCDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDCDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object bvlShow: TBevel + Left = 43 + Top = 13 + Width = 253 + Height = 4 + Shape = bsBottomLine + end + object bvlMultipleRecords: TBevel + Left = 89 + Top = 101 + Width = 208 + Height = 4 + Shape = bsBottomLine + end + object lblPrintMode: TLabel + Left = 91 + Top = 117 + Width = 33 + Height = 13 + Caption = 'Mode: ' + FocusControl = cbxPrintMode + end + object chbxShowHeaders: TCheckBox + Left = 90 + Top = 29 + Width = 200 + Height = 17 + Caption = '&Headers' + TabOrder = 0 + OnClick = OptionsViewClick + end + object chbxShowExpandButtons: TCheckBox + Tag = 1 + Left = 90 + Top = 75 + Width = 200 + Height = 17 + Caption = 'Expand Buttons' + TabOrder = 2 + OnClick = OptionsViewClick + end + object chbxShowBorders: TCheckBox + Tag = 2 + Left = 90 + Top = 52 + Width = 200 + Height = 17 + Caption = 'Borders' + TabOrder = 1 + OnClick = OptionsViewClick + end + object lblPreviewWindow: TStaticText + Left = 306 + Top = 0 + Width = 82 + Height = 14 + AutoSize = False + Caption = 'Preview' + TabOrder = 3 + end + object cbxPrintMode: TComboBox + Left = 156 + Top = 114 + Width = 140 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 4 + OnChange = cbxPrintModeChange + Items.Strings = ( + 'Current Record' + 'Loaded Records' + 'All Recods') + end + end + object tshBehaviors: TTabSheet + Caption = 'Behaviors' + ImageIndex = 1 + object lblExpanding: TLabel + Left = 5 + Top = 8 + Width = 50 + Height = 13 + Caption = 'Expanding' + end + object imgExpanding: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0888777777777777777777707DDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFFF + F07DD08887888887FFFFFFFFFFFF07DDDDDDDDDDDD0F77777777777777777777 + F07DD08887800087F00000000FFF07DDDDDDDDDDDD0F78887888887FFFFFFFF7 + F07DD08887888887FFFFFFFFFFFF07DDDDDDDDDDDD0F78887888887FFFFFFFF7 + F07DD0888777777777777777777707DDDDDDDDDDDD0F78887800087F00000FF7 + F07DD08887888887FFFFFFFFFFFF07DDDDDDDDDDDD0F78887888887FFFFFFFF7 + F07DD08887800087F0000000000F07DDDDDDDDDDDD0F78887777777777777777 + F07DD08887888887FFFFFFFFFFFF07DDDDDDDDDDDD0F78887888887FFFFFFFF7 + F07DD0888777777777777777777707DDDDDDDDDDDD0F78887800087F000000F7 + F07DD0888888888888888888888807DDDDDDDDDDDD0F78887888887FFFFFFFF7 + F07DD0808887777777777778888807DDDDDDDDDDDD0F78887777777777777777 + F07DD0888888888888888888888807DDDDDDDDDDDD0F78888888888888888887 + F07DD0777777777777777777777707DDCDDDDCDDDD0F78089C80000000088887 + F07DD0888888888888888888888807DDCCCCDCCDDD0F78888888888888888887 + F07DD0808998000000000008888807DDCCCCCCCCDD0F77777777777777777777 + F07DD0888888888888888888888807DDCCCCDCCDDD0F78887888887FFFFFFFF7 + F07DD0777777777777777777777707DDCDDDDCDDDD0F78887800087F000000F7 + F07DD0888888888888888888888807DDDDDDDDDDDD0F78887888887FFFFFFFF7 + F07DD08089C8000000000088888807DDDDDDDDDDDD0F78887777777777777777 + F07DD0888888888888888888888807DDCDDDDCDDDD0F78887888887FFFFFFFF7 + F07DD0777777777777777777777707DDCCCCDCCDDD0F78887800087F00000FF7 + F07DD0888888888888888888888807DDCCCCCCCCDD0F78887888887FFFFFFFF7 + F07DD0808998000000888888888807DDCCCCDCCDDD0F78887777777777777777 + F07DD0888888888888888888888807DDCDDDDCDDDD0F78888888888888888887 + F07DD0777777777777777777777707DDDDDDDDDDDD0F78089980000008888887 + F07DD08888888887FFFFFFFFFFFF07DDDDDDDDDDDD0F78888888888888888887 + F07DD08800008887FF000000000F07DDDDDDDDDDDD0F77777777777777777777 + F07DD08888888887FFFFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFFFFFFFFFFFF + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object bvlExpanding: TBevel + Left = 62 + Top = 13 + Width = 234 + Height = 4 + Shape = bsBottomLine + end + object lblSize: TLabel + Left = 5 + Top = 78 + Width = 19 + Height = 13 + Caption = 'Size' + end + object bvlSize: TBevel + Left = 33 + Top = 82 + Width = 263 + Height = 4 + Shape = bsBottomLine + end + object imgGridSize: TImage + Left = 8 + Top = 100 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0800000000000000008088F07DDDDDDDDDDDD0800000000000000000000 + 807DD0F088887FFFF8FFFF0FFF0F07DDDDDDDDDDDD0F08778887F777F7F777F0 + F07DD0F088887FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F08888887FFFFF7FFFFF0 + F07DD0F080087F00F8F00F0FFF0F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F088887FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F08888887FFFFF7FFFFF0 + F07DD0F0777777777777770FFF0F07DDCDDDDCDDDD0F08008887F00FF7F00FF0 + F07DD0F088887FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F08888887FFFFF7FFFFF0 + F07DD0F088887F00F8F00F0FFF0F07DDCCCCCCCCDD0F07777777777777777770 + F07DD0F088887FFFF8FFFF0FFF8F07DDCCCCDCCDDD0F08888887FFFFF7FFFFF0 + F07DD0F088887F00F8F00F0FFF0F07DDCDDDDCDDDD0F08888887F000F7F000F0 + F07DD0F088887FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F08888887FFFFF7FFFFF0 + F07DD0F080087F00F8F00F0FFF0F07DDDDDDDDDDDD0F08008887F000F7F000F0 + F07DD0F088887FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F08888887FFFFF7FFFFF0 + F07DD0F0777777777777770FFF0F07DDCCCCDCCDDD0F07777777777777777770 + F07DD0F088887FFFF8FFFF0FFF8F07DDCCCCCCCCDD0F08888887FFFFF7FFFFF0 + F07DD0F088887F00F8F00F0FFF0F07DDCCCCDCCDDD0F08888887F0FFF7F0FFF0 + F07DD0F088887FFFF8FFFF0FFF8F07DDCDDDDCDDDD0F08888887FFFFF7FFFFF0 + F07DD0F080087F00F8F00F0FFF0F07DDDDDDDDDDDD0F08008887F000F7F000F0 + F07DD0F088887FFFF8FFFF0FFF8F07DDDDDDDDDDDD0F08888887FFFFF7FFFFF0 + F07DD0F0777777777777770FFF0F07DDDDDDDDDDDD0F07777777777777777770 + F07DD0F088887FFFF7FFFF0FFF8F07DDDDDDDDDDDD0F08888887FFFFF7FFFFF0 + F07DD0F080087F00F7F00F0FFF0F07DDDDDDDDDDDD0F08008887F00FF7F00FF0 + F07DD0F088887FFFF7FFFF0FFF8F07DDDDDDDDDDDD0F08888887FFFFF7FFFFF0 + F07DD0800000000000000008080807DDDDDDDDDDDD0800000000000000000000 + 807DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD0F8FFFFFFFFFFFFFFFFFF8 + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxExpandRows: TCheckBox + Left = 90 + Top = 29 + Width = 200 + Height = 17 + Caption = 'Rows' + TabOrder = 0 + OnClick = OptionsExpandingClick + end + object chbxAutoWidth: TCheckBox + Left = 90 + Top = 100 + Width = 200 + Height = 17 + Caption = '&Auto Width' + TabOrder = 1 + OnClick = OptionsSizeClick + end + object chbxBestFit: TCheckBox + Tag = 1 + Left = 90 + Top = 123 + Width = 200 + Height = 17 + Caption = 'BestFit' + TabOrder = 2 + OnClick = OptionsSizeClick + end + object chbxWrapRecords: TCheckBox + Tag = 3 + Left = 90 + Top = 169 + Width = 200 + Height = 17 + Caption = '&Wrap Records' + TabOrder = 4 + OnClick = OptionsSizeClick + end + object chbxKeepSameRecordWidths: TCheckBox + Tag = 2 + Left = 90 + Top = 146 + Width = 200 + Height = 17 + Caption = 'Keep Equal Record Widths' + TabOrder = 3 + OnClick = OptionsSizeClick + end + end + object tshFormatting: TTabSheet + Caption = 'Formatting' + ImageIndex = 4 + object lblLookAndFeel: TLabel + Left = 5 + Top = 8 + Width = 66 + Height = 13 + Caption = 'Look and Feel' + end + object bvlLookAndFeel: TBevel + Left = 85 + Top = 13 + Width = 211 + Height = 4 + Shape = bsBottomLine + end + object imgLookAndFeel: TImage + Left = 8 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D0887777787787FFFFFFFFFFF07DDDDDDDDDDD0F87777787787FFFFFFFFF + FF07D0888888888887F000FF0000F07DDDDDDDDDDD0F88888888887F000FF000 + 0F07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0880000080087F00000000FF07DDDDDDDDDDD0F80000080087F00000000 + FF07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0888888888887FFFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D07777777777777777777777707DCCCCDCCDDD0777777777777777777777 + 7707D0888888888887FFFFFFFFFFF07DCCCCCCCCDD0F88888888887FFFFFFFFF + FF07D0880000000887F000000000F07DCCCCDCCDDD0F80000000887F00000000 + 0F07D0888888888887FFFFFFFFFFF07DCDDDDCDDDD0F88888888887FFFFFFFFF + FF07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0880000000887F000000F00F07DDDDDDDDDDD0F80000000887F000000F0 + 0F07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0888888888887FFFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D07777777777777777777777707DCCCCDCCDDD0777777777777777777777 + 7707D0888888888887FFFFFFFFFFF07DCCCCCCCCDD0F88888888887FFFFFFFFF + FF07D0880000008887F00000FF00F07DCCCCDCCDDD0F80000008887F00000FF0 + 0F07D0888888888887FFFFFFFFFFF07DCDDDDCDDDD0F88888888887FFFFFFFFF + FF07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0880000000887F00000000FF07DDDDDDDDDDD0F80000000887F00000000 + FF07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0F88888888887FFFFFFFFF + FF07D0888888888887FFFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + FF07D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object imgRefinements: TImage + Left = 8 + Top = 100 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777888888888 + 807DD0888888888887FFFFFFFFFF07DDCDDDDCDDDD0888888888887FFFFFFFFF + F07DD0888888888887FF7FFFFFFF07DDCCCCDCCDDD0888888888887FF777777F + F07DD0888888888887FF70888FFF07DDCCCCCCCCDD0888888888887FF7FFFF7F + F07DD0880000000887FF70FF8FFF07DDCCCCDCCDDD0880000000887FF7F00F7F + F07DD0888888888887FF70FF8FFF07DDCDDDDCDDDD0888888888887FF7F00F7F + F07DD0880008888887FF70000FFF07DDDDDDDDDDDD0880008888887FF7FFFF7F + F07DD0888888888887FF777777FF07DDDDDDDDDDDD0888888888887FF777777F + F07DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777888888888 + 807DD0888888888887FFFFFFFFFF07DDCDDDDCDDDD0888888888887FFFFFFFFF + F07DD0888888888887FFFFFFFFFF07DDCCCCDCCDDD0888888888887FFFFFFFFF + F07DD0888888888887FFCCCCCFFF07DDCCCCCCCCDD0888888888887FFFFFFFFF + F07DD0880000000887FCCCCCCCFF07DDCCCCDCCDDD0888888888887FFFFFFFFF + F07DD0888888888887FFCCCCCFFF07DDCDDDDCDDDD0888888888887FFFFFFFFF + F07DD0880000000887F9999999FF07DDDDDDDDDDDD0880000000887F88888FFF + F07DD0888888888887FF99999FFF07DDDDDDDDDDDD0888888888887F888888FF + F07DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777888888888 + 807DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD0888888888887FF888FFFFF07DDDDDDDDDDDD0888888888887FF888FFFF + F07DD0880000888887FFFFFFFFFF07DDDDDDDDDDDD0880000888887FFFFFFFFF + F07DD0880000000087FF888888FF07DDDDDDDDDDDD0880000000087FF888888F + F07DD0888888888887FF888888FF07DDDDDDDDDDDD0888888888887FF888888F + F07DD0888888888887FFFFFFFFFF07DDDDDDDDDDDD0888888888887FFFFFFFFF + F07DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblRefinements: TLabel + Left = 5 + Top = 78 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlRefinements: TBevel + Left = 70 + Top = 82 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object lblPagination: TLabel + Left = 5 + Top = 190 + Width = 50 + Height = 13 + Caption = 'Pagination' + end + object bvlPagination: TBevel + Left = 64 + Top = 195 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object imgPagination: TImage + Left = 8 + Top = 212 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDD0000000000000000000000007DDDDDDDDDDDD77777777777777770DDDDD + DDDDD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD7FFFFFFFFFFFFFFF0DDDDD + DDDDD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDD7F7777777777777F0DDDDD + DDDDD0888000000000000000088F07DDDDDDDDDDDD7F78887F88F7FF7F07770D + DDDDD0F8F088887FFFF8FFFF0F8F07DDDDDDDDDDDD7F78887FFFF7FF7F0FFF0D + DDDDD0F8F080087F00F8F00F0F8F07DDDDDDDDDDDD7F7777777777777F077F0D + DDDDD0F8F088887FFFF8FFFF0F8F07DDDDDDDDDDDD7F78887F88F7FF7F0F7F07 + 770DD098F0000000000000000F8907DDDDDDDDDDDD7F78887FFFF7FF7F0F7F0F + FF0DD099FFFFFFFFFFFFFFFFFF9907DDCDDDDCDDDD7F7777777777777F0F7F07 + 7F0DD0999999999999999999999907DDCCCCDCCDDD7F78887FFFF7FF7F0F7F0F + 7F0DD099F0000000000000000F9907DDCCCCCCCCDD7F78787F88F7FF7F0F7F0F + 7F0DD098F088887FFFF8FFFF0F8907DDCCCCDCCDDD7F78887FFFF7FF7F0F7F0F + 7F0DD0F8F088887F88F8F88F0F8F07DDCDDDDCDDDD7F7777777777777F0F7F0F + 7F0DD0F8F080087F00F8F00F0F8F07DDDDDDDDDDDD7F78887FFFF7FF7F0F7F0F + 7F0DD0F8F088887FFFF8FFFF0F8F07DDDDDDDDDDDD7F78787F88F7FF7F0F7F0F + 7F0DD098F0000000000000000F8907DDCDDDDCDDDD7F78887FFFF7FF7F0F7F0F + 7F0DD099FFFFFFFFFFFFFFFFFF9907DDCCCCDCCDDD7F7777777777777F0F7F0F + 7F0DD0999999999999999999999907DDCCCCCCCCDD7F78887FFFF7FF7F0F7F0F + 7F0DD099F0000000000000000F9907DDCCCCDCCDDD7F78787F88F7FF7F0F7F0F + 7F0DD098F088887FFFF8FFFF0F8907DDCDDDDCDDDD7F78887FFFF7FF7F0F7F0F + 7F0DD0F8F088887F88F8F88F0F8F07DDDDDDDDDDDD7F7777777777777F0F7F0F + 7F0DD0F8F080087F00F8F00F0F8F07DDDDDDDDDDDD7FFFFFFFFFFFFFFF0F7F0F + 7F0DD0F8F088887FFFF8FFFF0F8F07DDDDDDDDDDDD00000000000000000F7F0F + 7F0DD0F8F0777778888888880F8F07DDDDDDDDDDDDDDDD7F7777777777777F0F + 7F0DD0F8F088887FFFF8FFFF0F8F07DDDDDDDDDDDDDDDD7FFFFFFFFFFFFFFF0F + 7F0DD0F8F080087F00F8F00F0F8F07DDDDDDDDDDDDDDDD00000000000000000F + 7F0DD0F8F088887FFFF8FFFF0F8807DDDDDDDDDDDDDDDDDDDD7F777777777777 + 7F0DD0888000000000000000088F07DDDDDDDDDDDDDDDDDDDD7FFFFFFFFFFFFF + FF0DD0F8FFFFFFFFFFFFFFFFFF8F07DDDDDDDDDDDDDDDDDDDD00000000000000 + 000DD000000000000000000000000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object cbxLookAndFeel: TComboBox + Left = 90 + Top = 37 + Width = 202 + Height = 21 + Style = csDropDownList + ItemHeight = 0 + TabOrder = 0 + OnChange = LookAndFeelChange + end + object chbxFlatCheckMarks: TCheckBox + Tag = 2 + Left = 90 + Top = 146 + Width = 200 + Height = 17 + Caption = 'Flat Check &Marks' + TabOrder = 3 + OnClick = OptionsRefinementsClick + end + object chbxDisplayGraphicsAsText: TCheckBox + Tag = 1 + Left = 90 + Top = 123 + Width = 200 + Height = 17 + Caption = 'Display Graphics As &Text' + TabOrder = 2 + OnClick = OptionsRefinementsClick + end + object chbxTransparentGraphics: TCheckBox + Left = 90 + Top = 100 + Width = 200 + Height = 17 + Caption = 'Transparent &Graphics' + TabOrder = 1 + OnClick = OptionsRefinementsClick + end + object chbxSuppressBackgroundBitmaps: TCheckBox + Tag = 1 + Left = 90 + Top = 169 + Width = 200 + Height = 17 + Caption = 'Suppress Background Textures' + TabOrder = 4 + OnClick = OptionsFormattingClick + end + object chbxPaginateByRows: TCheckBox + Left = 90 + Top = 213 + Width = 200 + Height = 17 + Caption = 'By Rows' + TabOrder = 5 + OnClick = OptionsPaginationClick + end + object chbxPaginateByWrapping: TCheckBox + Tag = 1 + Left = 90 + Top = 236 + Width = 200 + Height = 17 + Caption = 'By Wrapping' + TabOrder = 6 + OnClick = OptionsPaginationClick + end + object chbxOneWrappingPerPage: TCheckBox + Tag = 2 + Left = 90 + Top = 259 + Width = 200 + Height = 17 + Caption = 'One Wrapping Per Page' + TabOrder = 7 + OnClick = OptionsPaginationClick + end + end + object tshStyles: TTabSheet + Caption = 'Styles' + ImageIndex = 4 + object bvlStyles: TBevel + Left = 115 + Top = 13 + Width = 181 + Height = 4 + Shape = bsBottomLine + end + object bvlStyleSheets: TBevel + Left = 72 + Top = 259 + Width = 224 + Height = 5 + Shape = bsBottomLine + end + object lblStyleSheets: TLabel + Left = 6 + Top = 255 + Width = 60 + Height = 13 + Caption = 'Style Sheets' + end + object bvlStylesHost: TBevel + Left = 6 + Top = 33 + Width = 214 + Height = 183 + end + object Label1: TLabel + Left = 77 + Top = 118 + Width = 68 + Height = 13 + Caption = '[ Styles Host ]' + Visible = False + end + object lblUseNativeStyles: TLabel + Left = 23 + Top = 9 + Width = 84 + Height = 13 + Caption = '&Use Native Styles' + FocusControl = chbxUseNativeStyles + OnClick = lblUseNativeStylesClick + end + object btnStyleColor: TButton + Left = 228 + Top = 61 + Width = 68 + Height = 23 + Caption = 'Co&lor...' + TabOrder = 2 + OnClick = StyleColorClick + end + object btnStyleFont: TButton + Left = 228 + Top = 33 + Width = 68 + Height = 23 + Caption = '&Font...' + TabOrder = 1 + OnClick = StyleFontClick + end + object btnStyleBackgroundBitmap: TButton + Left = 228 + Top = 97 + Width = 68 + Height = 23 + Caption = '&Bitmap...' + TabOrder = 3 + OnClick = StyleBackgroundBitmapClick + end + object chbxUseNativeStyles: TCheckBox + Left = 5 + Top = 8 + Width = 15 + Height = 17 + Caption = '&Use Native Styles' + TabOrder = 0 + OnClick = OptionsFormattingClick + end + object cbxStyleSheets: TComboBox + Left = 6 + Top = 275 + Width = 288 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 7 + OnClick = cbxStyleSheetsClick + OnDrawItem = cbxStyleSheetsDrawItem + OnKeyDown = cbxStyleSheetsKeyDown + end + object btnStyleSheetNew: TButton + Left = 6 + Top = 307 + Width = 68 + Height = 23 + Caption = '&New...' + TabOrder = 8 + OnClick = btnStyleSheetNewClick + end + object btnStyleSheetCopy: TButton + Left = 79 + Top = 307 + Width = 68 + Height = 23 + Caption = '&Copy...' + TabOrder = 9 + OnClick = btnStyleSheetCopyClick + end + object btnStyleSheetDelete: TButton + Left = 153 + Top = 307 + Width = 68 + Height = 23 + Caption = '&Delete...' + TabOrder = 10 + OnClick = btnStyleSheetDeleteClick + end + object btnStylesSaveAs: TButton + Left = 116 + Top = 223 + Width = 105 + Height = 23 + Caption = 'Save &As...' + TabOrder = 6 + OnClick = StylesSaveAsClick + end + object btnStyleSheetRename: TButton + Left = 226 + Top = 307 + Width = 68 + Height = 23 + Caption = '&Rename...' + TabOrder = 11 + OnClick = btnStyleSheetRenameClick + end + object btnStyleBackgroundBitmapClear: TButton + Left = 228 + Top = 125 + Width = 68 + Height = 23 + Caption = 'Clear' + TabOrder = 4 + OnClick = StyleBackgroundBitmapClearClick + end + object btnStyleRestoreDefaults: TButton + Left = 6 + Top = 223 + Width = 105 + Height = 23 + Caption = 'Restore Defaults' + TabOrder = 5 + OnClick = StyleRestoreDefaultsClick + end + end + end + object pnlPreview: TPanel + Left = 313 + Top = 44 + Width = 318 + Height = 315 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + object PreviewVGrid: TcxVerticalGrid + Left = 6 + Top = 8 + Width = 307 + Height = 303 + BorderStyle = cxcbsNone + OptionsView.ScrollBars = ssNone + OptionsView.RowHeaderWidth = 112 + OptionsView.ValueWidth = 150 + TabOrder = 0 + OnDrawValue = PreviewVGridDrawValue + object rowLuxurySedan: TcxCategoryRow + Properties.Caption = 'Luxury sedans' + Properties.HeaderAlignmentVert = vaCenter + object rowManufacturer: TcxEditorRow + Properties.Caption = 'Manufacturer' + Properties.HeaderAlignmentVert = vaCenter + Properties.EditPropertiesClassName = 'TcxTextEditProperties' + Properties.EditProperties.MaxLength = 0 + Properties.DataBinding.ValueType = 'String' + Properties.Value = 'BMW' + end + object rowModel: TcxEditorRow + Properties.Caption = 'Model' + Properties.HeaderAlignmentVert = vaCenter + Properties.EditPropertiesClassName = 'TcxTextEditProperties' + Properties.EditProperties.MaxLength = 0 + Properties.DataBinding.ValueType = 'String' + Properties.Value = '760 Li V12' + end + object rowPicture: TcxEditorRow + Height = 116 + Properties.Caption = 'Picture' + Properties.HeaderAlignmentVert = vaCenter + Properties.EditPropertiesClassName = 'TcxImageProperties' + Properties.DataBinding.ValueType = 'String' + Properties.Value = Null + end + object rowEngine: TcxEditorRow + Height = 57 + Properties.Caption = 'Engine' + Properties.EditPropertiesClassName = 'TcxMemoProperties' + Properties.EditProperties.MaxLength = 0 + Properties.DataBinding.ValueType = 'String' + Properties.Value = + '6.0L DOHC V12 438 HP 48V DI Valvetronic 12-cylinder engine with ' + + '6.0-liter displacement, dual overhead cam valvetrain' + end + object rowTransmission: TcxEditorRow + Height = 17 + Properties.Caption = 'Transmission' + Properties.DataBinding.ValueType = 'String' + Properties.Value = 'Elec 6-Speed Automatic w/Steptronic' + end + object rowTires: TcxEditorRow + Height = 44 + Properties.Caption = 'Tires' + Properties.EditPropertiesClassName = 'TcxMemoProperties' + Properties.EditProperties.MaxLength = 0 + Properties.DataBinding.ValueType = 'String' + Properties.Value = + 'P245/45R19 Fr - P275/40R19 Rr Performance. Low Profile tires wit' + + 'h 245mm width, 19.0" rim' + end + end + end + end + object cxStyleRepository1: TcxStyleRepository + Left = 4 + Top = 373 + object styleCategory: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWindowText + end + object styleHeader: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWindowText + end + object styleContent: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWindowText + end + end + object pmStyles: TPopupMenu + Images = ilStylesPopup + OnPopup = pmStylesPopup + Left = 32 + Top = 373 + object miStyleFont: TMenuItem + Caption = '&Font...' + ImageIndex = 0 + ShortCut = 16454 + OnClick = StyleFontClick + end + object miStyleColor: TMenuItem + Caption = '&Color...' + ShortCut = 16451 + OnClick = StyleColorClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miStyleBackgroundBitmap: TMenuItem + Caption = '&Bitmap...' + ImageIndex = 1 + OnClick = StyleBackgroundBitmapClick + end + object miStyleBackgroundBitmapClear: TMenuItem + Caption = 'Clear' + ImageIndex = 3 + ShortCut = 16430 + OnClick = StyleBackgroundBitmapClearClick + end + object milLine: TMenuItem + Caption = '-' + end + object miStylesSelectAll: TMenuItem + Caption = 'Select A&ll' + ShortCut = 16449 + OnClick = miStylesSelectAllClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miStyleRestoreDefaults: TMenuItem + Caption = 'Restore Defaults' + OnClick = StyleRestoreDefaultsClick + end + object miLine4: TMenuItem + Caption = '-' + end + object miStylesSaveAs: TMenuItem + Caption = 'Save &As...' + ImageIndex = 2 + ShortCut = 16467 + OnClick = StylesSaveAsClick + end + end + object ilStylesPopup: TImageList + Left = 60 + Top = 373 + Bitmap = { + 494C010104000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00000000000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF000000 + 0000008080000080800000808000008080000080800000808000008080000080 + 8000008080000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080800000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000000000000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000008080000080800000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000008080000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000FFFF008080 + 8000FFFFFF00FFFFFF00FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00FFFFFF008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 0000000000008080800080808000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00C0C0C00000FFFF00C0C0C000FFFF0000FFFFFF00FFFF0000FFFF + FF00FFFF0000FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000000000008080800080808000000000008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFF0000C0C0C000FFFF0000FFFFFF00FFFF0000FFFFFF00FFFF + 0000FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000008080000000 + 0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C00000000000C0C0C00000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFC001FFFF + FE07001F8001FFF9FF9F000F8001E7FFFF9F00078001C3F3E01F00038001C3E7 + F99F00018001E1C7F99B00008001F08FF99B00018001F81FF89300018001FC3F + D80300018001F81FD9BF80018001F09FC93FE0018001C1C7C03FE001800183E3 + FFFFE00180018FF1FFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxPScxVGridLnkPredefinedStyleSheets.dfm b/official/x.35/Lib/D11/dxPScxVGridLnkPredefinedStyleSheets.dfm new file mode 100644 index 00000000..8819b679 --- /dev/null +++ b/official/x.35/Lib/D11/dxPScxVGridLnkPredefinedStyleSheets.dfm @@ -0,0 +1,112 @@ +object cxdmPScxVGridLnkPredefinedStyles: TcxdmPScxVGridLnkPredefinedStyles + OldCreateOrder = False + Left = 435 + Top = 202 + Height = 150 + Width = 215 + object StyleRepository: TcxStyleRepository + Left = 63 + Top = 28 + object styleProfessionalCategory: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clWhite + end + object styleProfessionalHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 7566195 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clWhite + end + object styleGrayCategory: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 6579300 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleGrayHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = 8559005 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleNoneContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentCategory: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + TextColor = clBlack + end + object styleTransparentHeader: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object styleTransparentContent: TcxStyle + AssignedValues = [svColor, svFont, svTextColor] + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + TextColor = clBlack + end + object ssProfessional: TcxVerticalGridReportLinkStyleSheet + Caption = 'Professional' + Styles.Category = styleProfessionalCategory + Styles.Content = styleNoneContent + Styles.Header = styleProfessionalHeader + BuiltIn = True + end + object ssGray: TcxVerticalGridReportLinkStyleSheet + Caption = 'Gray' + Styles.Category = styleGrayCategory + Styles.Content = styleNoneContent + Styles.Header = styleGrayHeader + BuiltIn = True + end + object ssTransparent: TcxVerticalGridReportLinkStyleSheet + Caption = 'Transparent' + Styles.Category = styleTransparentCategory + Styles.Content = styleTransparentContent + Styles.Header = styleTransparentHeader + BuiltIn = True + end + end +end diff --git a/official/x.35/Lib/D11/dxPSdxFCLnk.dfm b/official/x.35/Lib/D11/dxPSdxFCLnk.dfm new file mode 100644 index 00000000..69e27e82 --- /dev/null +++ b/official/x.35/Lib/D11/dxPSdxFCLnk.dfm @@ -0,0 +1,414 @@ +object dxFCReportLinkDesignWindow: TdxFCReportLinkDesignWindow + Left = 372 + Top = 310 + ActiveControl = chbxTransparent + BorderStyle = bsDialog + Caption = 'Report Designer' + ClientHeight = 319 + ClientWidth = 552 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 3 + Width = 544 + Height = 280 + ActivePage = tshOptions + MultiLine = True + TabOrder = 0 + object tshOptions: TTabSheet + Caption = '&Options' + object pnlOptions: TPanel + Left = 0 + Top = 0 + Width = 536 + Height = 252 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblPreview: TLabel + Left = 242 + Top = 2 + Width = 38 + Height = 13 + Caption = 'Preview' + end + object gbxTransparent: TGroupBox + Left = 5 + Top = 14 + Width = 226 + Height = 51 + Caption = ' ' + TabOrder = 1 + object lblColor: TLabel + Left = 7 + Top = 24 + Width = 35 + Height = 13 + Caption = 'Co&lor : ' + OnClick = lblColorClick + end + object bvlColorHolder: TBevel + Left = 86 + Top = 20 + Width = 132 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 17 + Top = 12 + Width = 15 + Height = 17 + TabOrder = 0 + OnClick = chbxTransparentClick + end + object gbxBorder: TGroupBox + Left = 5 + Top = 75 + Width = 226 + Height = 51 + Caption = ' ' + TabOrder = 3 + object lblGridLinesColor: TLabel + Left = 7 + Top = 24 + Width = 67 + Height = 13 + Caption = '&Border Color: ' + OnClick = lblColorClick + end + object bvlLineColorHolder: TBevel + Left = 86 + Top = 20 + Width = 132 + Height = 21 + Visible = False + end + end + object chbxDrawBorder: TCheckBox + Left = 17 + Top = 73 + Width = 15 + Height = 17 + TabOrder = 2 + OnClick = chbxDrawBorderClick + end + object stTransparent: TStaticText + Left = 32 + Top = 13 + Width = 76 + Height = 17 + Caption = ' &Transparent ' + FocusControl = chbxTransparent + TabOrder = 4 + OnClick = stTransparentClick + end + object stDrawBorder: TStaticText + Left = 32 + Top = 74 + Width = 70 + Height = 17 + Caption = ' Draw Border ' + FocusControl = chbxDrawBorder + TabOrder = 5 + OnClick = stDrawBorderClick + end + end + end + end + object pnlPreview: TPanel + Left = 250 + Top = 46 + Width = 288 + Height = 226 + BevelInner = bvLowered + BevelOuter = bvNone + Color = clWindow + TabOrder = 1 + end + object ilFlowChart: TImageList + Left = 36 + Top = 197 + Bitmap = { + 494C010101000500040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000002000000001002000000000000020 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084848400848484008484840084848400000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000FF00000000000000FF000000FF000000FF0000000000008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000FFFF0000840000000084000000000000840000000000008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000084000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000084000000000084848400000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000008400000000000000000000848484000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000FF000000FFFF0000FF000000840000000000000084 + 0000008400008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FF00000084 + 000000FF000000FF000000FF000000FF0000008400000084000000FF000000FF + 0000008400000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FF000000FF + 000000FF000000FF000000FF000000FF000000FF00000084000000FF000000FF + FF00008400008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000FF + 0000000000000084000000FF000000FF000000FF000000FF000000FF00000000 + 0000848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000FF000000FF00000084000000FF000000FF000000FF000000FF000000FF + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000008484840000FFFF000084000000840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FF000000840000848484000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFF000000000000FC3F000000000000 + F00F000000000000F00F000000000000FE7F000000000000FF7F000000000000 + FC3F000000000000F81F000000000000C0030000000000008003000000000000 + 8003000000000000C007000000000000F007000000000000F01F000000000000 + FE1F000000000000FFFF00000000000000000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxPSdxInsLnk.dfm b/official/x.35/Lib/D11/dxPSdxInsLnk.dfm new file mode 100644 index 00000000..9940cbda --- /dev/null +++ b/official/x.35/Lib/D11/dxPSdxInsLnk.dfm @@ -0,0 +1,2322 @@ +object dxInspectorDesignWindow: TdxInspectorDesignWindow + Left = 353 + Top = 289 + BorderStyle = bsDialog + Caption = 'dxInspectorDesignWindow' + ClientHeight = 341 + ClientWidth = 585 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 5 + Width = 577 + Height = 300 + ActivePage = tshOptions + MultiLine = True + TabOrder = 0 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = '&Options' + object lblShow: TLabel + Left = 6 + Top = 6 + Width = 26 + Height = 13 + Caption = 'Show' + end + object bvlShow: TBevel + Left = 40 + Top = 10 + Width = 222 + Height = 4 + Shape = bsBottomLine + end + object imgGrid: TImage + Left = 6 + Top = 32 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblBehaviors: TLabel + Left = 6 + Top = 142 + Width = 47 + Height = 13 + Caption = 'Behaviors' + end + object bvlBehaviors: TBevel + Left = 66 + Top = 147 + Width = 196 + Height = 4 + Shape = bsBottomLine + end + object Image4: TImage + Left = 6 + Top = 166 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 7778800000000000000000000000078888888888880000000000000000000000 + 007880FFF7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7FF777777FFF77777FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F8F7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7F7F8888FF7F88888FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F8F7777777777777777777078888888888880F7F7F888FFF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F0788077777777777777777777770788C8888C88880F7FF888888FFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880F0F7777777FFFFFFFFFFFF0788CCCCCCCC880F77777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7F7F8888FF7F88888FF7 + F0788077777777777777777777770788C8888C88880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F7F7F8888FF7F888888F7 + F0788077777777777777777777770788CCCC8CC8880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCCCCCC880F7FF88888FFFFFFFFFFF7 + F07880F0F777777FFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F77777777777777777777 + F078800000000000000000000000078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F888888880F88888888888078888888888880F77777777777777777777 + F07880F877778880F87777777778078888888888880F77777777777777777777 + F07880FFFFFFFFF0FFFFFFFFFFFF078888888888880FFFFFFFFFFFFFFFFFFFFF + F078800000000000000000000000088888888888880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object chbxShowBorders: TCheckBox + Left = 90 + Top = 29 + Width = 169 + Height = 17 + Caption = 'Border' + TabOrder = 0 + OnClick = chbxOptionsClick + end + object chbxShowHorzLines: TCheckBox + Tag = 1 + Left = 90 + Top = 51 + Width = 169 + Height = 17 + Caption = 'Horizontal Lines' + TabOrder = 1 + OnClick = chbxOptionsClick + end + object chbxShowVertLines: TCheckBox + Tag = 2 + Left = 90 + Top = 73 + Width = 169 + Height = 17 + Caption = 'Vertical Lines' + TabOrder = 2 + OnClick = chbxOptionsClick + end + object chbxShowImages: TCheckBox + Tag = 5 + Left = 90 + Top = 117 + Width = 169 + Height = 17 + Caption = 'Images' + TabOrder = 4 + OnClick = chbxOptionsClick + end + object chbxShowExpandButtons: TCheckBox + Tag = 8 + Left = 90 + Top = 95 + Width = 169 + Height = 17 + Caption = 'Expand Buttons' + TabOrder = 3 + OnClick = chbxOptionsClick + end + object chbxAutoNodesExpand: TCheckBox + Left = 90 + Top = 167 + Width = 169 + Height = 17 + Caption = '&Auto Node Expand' + TabOrder = 5 + OnClick = chbxAutoNodesExpandClick + end + object chbxAutoWidth: TCheckBox + Left = 90 + Top = 189 + Width = 169 + Height = 17 + Caption = '&Auto &Width' + TabOrder = 6 + OnClick = chbxAutoWidthClick + end + object lblPreview: TStaticText + Left = 275 + Top = 3 + Width = 42 + Height = 17 + Caption = 'Preview' + TabOrder = 7 + end + end + object tshColors: TTabSheet + Caption = '&Color' + object lblGridLinesColor: TLabel + Left = 10 + Top = 219 + Width = 79 + Height = 13 + Caption = '&Grid lines color : ' + end + object bvlGridLineColorHolder: TBevel + Left = 91 + Top = 215 + Width = 168 + Height = 21 + Visible = False + end + object gbxCaptionTransparent: TGroupBox + Left = 5 + Top = 73 + Width = 262 + Height = 61 + Caption = ' ' + TabOrder = 3 + object lblCaptionColor: TLabel + Left = 6 + Top = 29 + Width = 72 + Height = 13 + Caption = 'Caption Color: ' + end + object bvlFixedColorHolder: TBevel + Left = 86 + Top = 25 + Width = 168 + Height = 21 + Visible = False + end + end + object gbxTransparent: TGroupBox + Left = 5 + Top = 7 + Width = 262 + Height = 60 + Caption = ' ' + TabOrder = 1 + object lblColor: TLabel + Left = 6 + Top = 29 + Width = 35 + Height = 13 + Caption = 'Co&lor : ' + end + object bvlColorHolder: TBevel + Left = 86 + Top = 25 + Width = 168 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 18 + Top = 5 + Width = 15 + Height = 17 + TabOrder = 0 + OnClick = chbxTransparentClick + end + object chbxCaptionTransparent: TCheckBox + Tag = 1 + Left = 18 + Top = 70 + Width = 15 + Height = 17 + TabOrder = 2 + OnClick = chbxTransparentClick + end + object gbxGroupTransparent: TGroupBox + Left = 5 + Top = 141 + Width = 262 + Height = 61 + Caption = ' ' + TabOrder = 5 + object lblGroupColor: TLabel + Left = 6 + Top = 29 + Width = 64 + Height = 13 + Caption = '&Group Color: ' + end + object bvlGroupColorHolder: TBevel + Left = 86 + Top = 25 + Width = 168 + Height = 21 + Visible = False + end + end + object chbxGroupTransparent: TCheckBox + Tag = 2 + Left = 18 + Top = 139 + Width = 15 + Height = 17 + TabOrder = 4 + OnClick = chbxTransparentClick + end + object stTransparent: TStaticText + Left = 33 + Top = 6 + Width = 76 + Height = 17 + Caption = ' &Transparent ' + FocusControl = chbxTransparent + TabOrder = 6 + OnClick = stTransparentClick + end + object stCaptionTransparent: TStaticText + Left = 33 + Top = 71 + Width = 109 + Height = 17 + Caption = ' Caption Transparent ' + FocusControl = chbxCaptionTransparent + TabOrder = 7 + OnClick = stCaptionTransparentClick + end + object stGroupTransparent: TStaticText + Left = 33 + Top = 140 + Width = 101 + Height = 17 + Caption = ' Group Transparent ' + FocusControl = chbxGroupTransparent + TabOrder = 8 + OnClick = stGroupTransparentClick + end + end + object tshFonts: TTabSheet + Caption = '&Font' + object btnFont: TButton + Left = 8 + Top = 14 + Width = 110 + Height = 23 + Caption = 'Fo&nt ...' + TabOrder = 0 + OnClick = btnFontClick + end + object edFont: TEdit + Left = 8 + Top = 42 + Width = 256 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + end + object btnGroupFont: TButton + Tag = 2 + Left = 8 + Top = 130 + Width = 110 + Height = 23 + Caption = 'Grou&p Font ...' + TabOrder = 4 + OnClick = btnFontClick + end + object edGroupFont: TEdit + Left = 9 + Top = 158 + Width = 256 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 5 + end + object btnFixedFont: TButton + Tag = 1 + Left = 8 + Top = 72 + Width = 110 + Height = 23 + Caption = 'Fi&xed Font ...' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 2 + OnClick = btnFontClick + end + object edFixedFont: TEdit + Left = 8 + Top = 100 + Width = 256 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 3 + end + end + object tshFormatting: TTabSheet + Caption = 'Formatting' + ImageIndex = 4 + object lblRefinements: TLabel + Left = 6 + Top = 6 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlAppearance: TBevel + Left = 79 + Top = 10 + Width = 183 + Height = 4 + Shape = bsBottomLine + end + object imgGraphics: TImage + Left = 6 + Top = 32 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FF7FFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF777777F + F07DD0F77777777FF7FF70888FFF07DDCCCCCCCCDD0F77777777FF7FF7FFFF7F + F07DD0FFFFFFFFFFF7FF70FF8FFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF7F00F7F + F07DD0F777777FFFF7FF70FF8FFF07DDCDDDDCDDDD0F777777FFFF7FF7F00F7F + F07DD0FFFFFFFFFFF7FF70000FFF07DDDDDDDDDDDD0FFFFFFFFFFF7FF7FFFF7F + F07DD0F77777777FF7FF777777FF07DDDDDDDDDDDD0F77777777FF7FF777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFCCCCCFFF07DDCCCCCCCCDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FCCCCCCCFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F7777777FFF7FFCCCCCFFF07DDCDDDDCDDDD0F7777777FFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7F9999999FF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F777777777F7FF99999FFF07DDDDDDDDDDDD0F777777777F7F7777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F80000888887F88888888707DDDDDDDDDDDD0F80000888887F88888888 + 707DD0F80000000087F80000008707DDDDDDDDDDDD0F80000000087F80000008 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0FFFFFFFFFFF7FFFFFFFFF707DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + 707DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object chbxFlatCheckMarks: TCheckBox + Tag = 3 + Left = 90 + Top = 29 + Width = 169 + Height = 17 + Caption = 'Flat CheckMarks' + TabOrder = 0 + OnClick = chbxOptionsClick + end + object chbxCheckMarksAsText: TCheckBox + Tag = 4 + Left = 90 + Top = 51 + Width = 169 + Height = 17 + Caption = 'Display Check Marks as Text' + TabOrder = 1 + OnClick = chbxOptionsClick + end + object chbxDisplayGraphicsAsText: TCheckBox + Tag = 7 + Left = 90 + Top = 73 + Width = 171 + Height = 17 + Caption = 'Display Graphics As &Text' + TabOrder = 2 + OnClick = chbxOptionsClick + end + object chbxTransparentColumnGraphics: TCheckBox + Tag = 6 + Left = 90 + Top = 95 + Width = 171 + Height = 17 + Caption = 'Transparent Column &Graphics' + TabOrder = 3 + OnClick = chbxOptionsClick + end + end + end + object pnlPreview: TPanel + Left = 283 + Top = 50 + Width = 290 + Height = 246 + BevelOuter = bvLowered + Color = clWindow + TabOrder = 1 + object pnlPreviewHost: TPanel + Left = 5 + Top = 5 + Width = 279 + Height = 234 + BevelOuter = bvNone + BorderStyle = bsSingle + Ctl3D = False + ParentCtl3D = False + TabOrder = 0 + object insPreview: TdxInspector + Left = 0 + Top = 0 + Width = 279 + Height = 234 + BorderStyle = bsNone + Color = clWindow + Ctl3D = False + Enabled = False + ParentCtl3D = False + TabOrder = 0 + DividerPos = 133 + GridColor = clBtnFace + Flat = True + Images = ilVendorLogos + PaintStyle = ipsNET + Data = { + DB0000000200000008000000030000000E00000069724D657273656465734265 + 6E7A08000000000000000900000069724D424D6F64656C080000000000000007 + 00000069724D4253555608000000000000000900000069724D4250686F746F08 + 00000003000000050000006972424D5708000000000000000A0000006972424D + 574D6F64656C0800000000000000080000006972424D57535556080000000000 + 00000A0000006972424D5750686F746F02000000080000006C46080A0E000000 + 69724D6572736564657342656E7A08000000FCF9080A050000006972424D57} + object irMersedesBenz: TdxInspectorTextRow + Caption = 'Mersedes-Benz' + ImageIndex = 0 + IsCategory = True + RowHeight = 22 + OnDrawCaption = InspectorDrawCaption + end + object irMBPhoto: TdxInspectorTextGraphicRow + Caption = 'Photo' + RowHeight = 44 + OnDrawCaption = InspectorDrawCaption + OnDrawValue = irMBPhotoDrawValue + end + object irMBSUV: TdxInspectorTextCheckRow + Caption = 'SUV' + OnDrawCaption = InspectorDrawCaption + OnDrawValue = irMBSUVDrawValue + ValueChecked = 'True' + ValueUnchecked = 'False' + Text = 'False' + end + object irMBModel: TdxInspectorTextRow + Caption = 'Model' + OnDrawCaption = InspectorDrawCaption + OnDrawValue = InspectorDrawValue + Text = 'S600' + end + object irBMW: TdxInspectorTextRow + Caption = 'BMW' + ImageIndex = 1 + IsCategory = True + RowHeight = 22 + OnDrawCaption = InspectorDrawCaption + end + object irBMWModel: TdxInspectorTextRow + Caption = 'Model' + OnDrawCaption = InspectorDrawCaption + OnDrawValue = InspectorDrawValue + Text = 'X5 4WD' + end + object irBMWSUV: TdxInspectorTextCheckRow + Caption = 'SUV' + OnDrawCaption = InspectorDrawCaption + OnDrawValue = irMBSUVDrawValue + ValueChecked = 'True' + ValueUnchecked = 'False' + Text = 'True' + end + object irBMWPhoto: TdxInspectorTextGraphicRow + Caption = 'Photo' + RowHeight = 44 + OnDrawCaption = InspectorDrawCaption + OnDrawValue = irMBPhotoDrawValue + end + end + end + end + object ilVendorLogos: TImageList + AllocBy = 2 + Height = 21 + Width = 22 + Left = 4 + Top = 310 + Bitmap = { + 494C010102000400040016001500FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 000000000000360000002800000058000000150000000100180000000000A815 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000C0C0C0C0C0C0C0C0C0C0C0C000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000C0C0C0A6C4A5737273615F5FA2A9A2D2BCD10000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000C2C5C27B7C795D595B696165746C716359 + 6065676693969600000000000000000000000000000000000000000000000000 + 00000000000000000000000000008D6A8D366A35000000000000000000000000 + 0000000000001C441C7BB07B0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000D6D4D55F6560989394E3E3E4FFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFC9C5C6424848A1A1A10000000000000000000000 + 00000000000000000000000000000000A18EA1384538000D0000000003020702 + 0000000000000000000000000000000000000000282E26A69FA5000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000B4B3B54D4248EAE9E7FF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9B9799656A69 + 00000000000000000000000000000000000000000091AA91000D000000000706 + 040808060000000302001F1F1C25242E23262A04070D00000002020000000000 + 0E00647063000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000C7C9C85B58 + 5BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFB7B2B8676C6B000000000000000000000000000000C0C0C0161C16 + 0000001C1C1A1616120000001F1F1E93908D808080DFC285C5C1C07D81871115 + 2200000003030800000008180BAEBAAF00000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + C0C0C0695F65FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF928B8FBBB9BA00000000000000000000 + 00008190800403042A2928262425000000637362D6D6D5F6F4F1808080BE9B37 + B18414C09F4AA1947F2F31390000000706040000005A62590000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000ACA0A595A096A1A0A1E7E3E6FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2EEEFA1A0A1CCD4CF433E400000 + 00000000000000E0DBE12329202022203E3C3D141112668164FFFFFFFDFAFEF4 + F7EE808080C5A336B98F00BE9500C69B20A69777181F2F000000000000121513 + B1DCB10000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000737172FFFFFFC6C2C3655C63828983CD + C8C9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCDCDCC757577616866D2D2CF + FFFFFF9E9D9DC5C8C5000000000000A2AEA113131248494A272627384736FFFF + FFFFFFFFECF9ECF5F1EC808080CFA93AC49D00C5A100BB9400C7A1247B7C7C00 + 000D0000000000006C8F6B000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000C0C0C0959192FFFFFFFFFF + FFE3EBE7A5A2A27472773831377D7A7DE3E1E3E8E3E68E8E8C443E44575A5CAA + ABAAEEF1EEFFFFFFFFFFFFEAEBE9877D82000000C0C0C0767D772E312B5B5A59 + 383738959495FFFFFFF9FFFBF4FFF6FFFFFF808080D8AD37CDA200D0A700C8A1 + 00C59900BEA46424273A0000000000003C3F3CC0C0C000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000CDD0CE + B5B1B5FFFFFFFFFFFFFFFFFFEBECECB6BCB8C2BCBD2F3C38000000332C344849 + 4DBDB6BABBB9B9F1EEEEFFFFFFFFFFFFFFFFFFFCFFFF716C6F000000C0C0C06A + 74695050506362626D6A6BCAC9CAF3F5F3EDEEF0ECEFF0F6EEF2808080D2B54E + C59F18CBA728C5A327C29D1FCFAD60454D6503090E000000292929C0C0C00000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000BEB8BEC5C6C4FFFFFFFFFFFFFFFFFFFFFFFFF8F8F7A9A5A9EAE7E6 + 969496969196E0E0DEABAEAAF5F7F4FFFFFFFFFFFFFFFFFFFFFFFFFCFFFF776E + 74000000C0C0C076817467656479797A827F7BC8B78FDCC487D1BA7FD0B574D6 + BB63B8A351D7D5C9DADCD1D9D8D4D5D4D1D8D6D2E1DFDA43464B060607000000 + 242524C0C0C00000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000C5BFC4B9C2BBFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFA0A1A0E6ECE83A3639A2A4A2FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFF9F9F7767F78000000C0C0C0969D957A7873989792818388B2A383F2D3 + 7BE1C26ADFBA5CE2B642B9AB00808080FDFFFFF8FAFFF1F3FAFFFFFFE3E5E812 + 110E080908000000333232C0C0C0000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000C0C0C093898FFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFD4CED1CECACC222022DEDBDBFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFDEDEDE908D8D000000C0C0C0B9C2B6898782A5A29F + 8D8E95918F8DEDD498EBCC87E0C581E8C471BCC233808080FCFFFFF5FAF4F4FC + F2FFFFFF90918D000000000000000000546A54C0C0C000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 5E585CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE3E1E1B9B7B72F443FF2EE + F0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF999D98C1BDC0000000000000E2 + E2E192918BA5A19F808080808080A8A18EFBE69DEBD18AEDCC84C2C94B808080 + FFFFFFFFFFFFFFFFFF8080804954478080807574750E0C0D8EBB8DC0C0C00000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000676766E6E5E4FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3F0F1 + A0989D575658FAFBFAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFD545A550000 + 00000000000000F9C8F9BCC4B9D7D4D48080808080809FA0A6B0AB99F2DEA5FF + E39DCEDA5F808080FFFFFFFFFFFF808080707A707A637A808080808080818C80 + D7CDD70000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000C0C0C0444749FFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFF98A49B70666CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 8E8C8CB6AFB5000000000000000000000000E2FFE1C6C4C48080808080808080 + 8084868D929290E0DAB5CAD876808080808080AB8FAB2945248A878880808080 + 808080808088A988808080000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000ACABA97D87 + 85FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF958F93878787FFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFBEB5BC585256000000000000000000000000000000000000C5F0C3 + DBDADB808080808080808080A0A1A17F90888DA68D55695980A07B474644625E + 5E373937808080B1B3B1728672C0C0C000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008F858C797A78FFFFFFFFFFFFFFFFFFFFFFFFA9A7A99E9F9EFFFF + FFFFFFFFFFFFFFFFFFFFABADAA5C605D00000000000000000000000000000000 + 0000000000000000C3D6C0A8AFA2ABA8A2B8B5B4B1AAAA808080808080472F3F + 8080805E825D646263423F3F192318A0AC9EC6D3C50000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000B7B8B7424645BFBBBDFFFFFFFFFFFF + CFCCCBC5C3C4FFFFFFFFFFFFD8D8D77875768B898A0000000000000000000000 + 00000000000000000000000000000000000000C0C0C0B7D0B3A1B29B8E9087D3 + C8CFAE9EAFC0C0C08080802237233345323C553CC0C0C0C0C0C0000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000009B + A09D525052706B6E7C75798C89888782836E6D6D8E898BC0C0C0000000000000 + 000000000000000000000000000000000000000000000000000000000000C0C0 + C0C0C0C0A8D5A6AECBAB718670534951B8B7B7527450808080D88CD800000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000C0C0C0C0C0C0C0C0C0C0C0C0C0C0C000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C00000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000424D3E000000 + 000000003E0000002800000058000000150000000100010000000000FC000000 + 0000000000000000000000000000000000000000FFFFFF00FF87FFFC0FF00000 + 00000000FE01FFF003F0000000000000F8007FC000F0000000000000F0003F80 + 0070000000000000E0001F000030000000000000C0000F000030000000000000 + C0000E000010000000000000C000060000100000000000008000040000000000 + 0000000080000400000000000000000080000400000000000000000080000400 + 0000000000000000800004000000000000000000C00006000000000000000000 + C0000E000010000000000000C0000F000010000000000000E0001F8000300000 + 00000000F0003FC00070000000000000F8007FE000F0000000000000FE00FFF0 + 03F0000000000000FF83FFFC0FF0000000000000000000000000000000000000 + 00000000000000000000} + end + object ilCarPhotos: TImageList + AllocBy = 2 + Height = 44 + Width = 87 + Left = 32 + Top = 310 + Bitmap = { + 494C010102000400040057002C00FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 00000000000036000000280000005C0100002C000000010018000000000070B3 + 000000000000000000000000000000000000000000FDCBFF6D5D8FA47AD38A6D + BD8A6AC18B72C07D62B2665B9B6C5BA26E609B654E9767599369549565579664 + 559362538F655C92695B9469589567559360579262599564548C6254895F528C + 5E4E895D4A885B50885954875D54895D5489555483584F7E5F477C5A457A554A + 7B5850774B4D642E3B481F2A2E1D261B1F271C2229231E29201B281D1A261D1C + 241E1A231D16221D19231E18241B18221A19221A1129150F2A1415281915301A + 162F181C261D1E2325192420152B16182F18152B19152C1A162F1B192A1B0F30 + 181B2A1B253027222A20242F1426321A24320E142508333F18111E1D24351F33 + 3E32332B293333302526022E40302435193F402C07080B000000727689656C7D + 666C80646A7C666A7D6A6D81696C7F65687C6C6F83686E7E6B717E6E75836E72 + 7C6F727F72778371768270737E69707C68727D68727F6A71816B7484686F8068 + 6D7E666B7C6C717B6B6E7C6D737E73747F7674807374807475826F717D747681 + 70727E71737C6F737D6E747E73737E74758074758074768176768275747F7775 + 8173747F7576817476806F707B6E6F7A6D717B65737B69767E6C737C69707A69 + 707C6C7180686C7D696F7F6C6E816E6D7E686F7869707B6B717C6E737D6B707A + 6F747D70757F71757F73737E73758074758172748173757F72717C73737E7475 + 7E75777F76778076748074737E72727C73727D75737F85838E4A4C4E00000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000007000EFCC8FF53466C8764BB785C9E7A5FAB6C5F9E57427C6751 + 93644A8E574783584687584E855540825F4E8C5A458562508863508B594E8753 + 4A865C4F855C4B845C4C7F57477D56458250407D55467C594A7E55447D503D79 + 523D79503F734B3F6C463F6B49436A4A446C403E5A2622221316001E26111920 + 2C09161C0B180E111D18142219111E19081F120C2C0D142C140D1C150D1C1616 + 221A16231B111F160F1F120F22140C23160B20140C1F151A251D20241F132018 + 1C2F1F1B271F15251912261914231A18261B13231B0D1E0E2938251B240E1628 + 0E202C1A19251116270D1D2C181929141A20142E3F271E1F201829113C393906 + 2A0000120033301E1B180F687382B7C5E4A7B5CFABBBD3AABAD1AABCD3A6BAD1 + AABBD3AFBCD4AFBDD4AFBCD6AFBBD6B0BDD7B3BBD5B5BED8B1BBD4B5C0D7B9C4 + DBBEC6DBBEC4D8BFC5D9BEC1D6BFC3D7B9C1D5B9C1D6B3BCD1B0BCD7B2BCD6B3 + BFD7B8C0D8BBC2D9BCC2D8BFC4DABEC3D9BEC2D9BDC3D9C6C7DCBABDD3BFC5D9 + C5C6DCC5C6DAC2C9DDBFC5D8C0C5D9C3C7DBC2C6DBC5CADFC3C5DAC7CAE0C2C3 + DAC3C5DAC2C4D8C4C5DABFBFD4BBBDD4BEC0D5BFC3D7B9C1D5BAC1D4BDC4D9B7 + BFD7B1BBD2B5BDD9B4BDD8B2BCD5B3BED5B2BDD5BABED7B9BED6B9BDD5BCBFD6 + C0C3DBB8BFD6B7C3D7BDC5DBC3C5D9C3C8DDC9C6DAC7C6DACBC7DCC6C5DAC7C5 + DCC5C2D8C9C3DBC6C1D7D6D1E57F7F8500000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000009150FEBADFF + 524873805EAC765DA16C549C59468D665088664F95543E815E52875942855944 + 855C448864558F645289594582614F8C62528A5B4C855545825B477D594F7A55 + 497E55438053437A55457B55487C5044794D42735043735044744C406D493C6A + 48406C4437532F31442E5591465EC03A315B1E1F00192519181C240E1614091C + 130F20131D2A1D152E1D0B2518132218121E13141F1619261E13221B18231A19 + 2016121D1512221F11201B1B261C2327201A231F2329220E201819231F202625 + 1E251F23291F2024261A241F192B0F1928181B2C1F242F1C1C2F20272F201A2A + 2013240F162812222E222F361C021F201D2400464B2C0622004B394A00060861 + 6A75A5AFCD9AA4BB97A2BA97A1BB9BA8C399A7C197A3BD9EA7C09CA5C09BA4BC + 9CA7BE9DA9C1A0A8C0A1ACC2A0AAC1A1AAC39A9FB795A0B897A1B99AA3BC9FA7 + BCA1AAC0A7AEC2ABB2C4ABADC3AAAFC3B0B5C8AAB1C6A3ABBFA8AFC3A4ABBDA1 + A8BAA8AFC1A9AEC1ADB2C5B1B5C5A8ADBDA9AFBEACAEBFADAFBFADB3C3AEB4C4 + B2B5C5B1B7C5A4AAB9B6BAC9B2B1C2B0B0C2AEB3C2ABAFBEAFB0C1B8B5C8B9B6 + C8B7B6C5B6B4C4B4B2C2B3B2C4B1AEBFB1AFC1B1B1C4B5B6C7B2B2C5ACB0C4A7 + ADC0AAB1C3A8B0C3ADB0C3ACB0C2AAAFC2A7AEC0A5AABEA7AFC2A8ADC2A8ACC0 + B0B4C2AFB3C3AEAEC0B4B3C5B0B1C2B2B5C5B3B7C6B6B6C6B9B5C5B4B0C1C5C1 + D0706E7700000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000001509D097FF52476F7F65A36A4E986D5E8F + 634D8C573C8F57447E5B4E85573C7E5C468958438761548B5940845A4C895943 + 845D4B885D4D815E477E5C4A815848845246794C407657467B55467C5347794A + 40704A3C6F4F42715046734E44734C406F483E6D403557302B52313C877A76B9 + C5C6EF84A6F00728620F0C00232012031115001400031600001B0B001F150725 + 1D18291C0E1B07001502031C0E02190B00180900190B021A06001208000C0202 + 1600001904001404061F08001200000F080B1A0B02190300140200130D152511 + 001E001329141A23131B2A1218250F19291E2731280015041622082A2E1B031E + 0B1B3A00392C3B3A254B3D33397D7A7C000406616572A0A6C4969FB497A2BA9B + A6BD9DA8BF96A1B997A2BA9EA8C09CA6BE98A6BD96A8BD8DA4BBA0A7BF9DA8C1 + 95A6B9A9B1C2A9A5B99AA3BA98A3BC99A5BC9AA6BE96A1BB94A2B794A0B5A2A6 + BD9DA5BB9DA5BBA5A8BBA6A9BAAAAFC1B0B2C5ADACC1ABAFC3AAAFC4A8ADC1A9 + AEBFAEB2C4B0B5C6A9B2C1ABB4C3A8ABBCADB3C5ACAFC0B0B0C3B2B0C4B5B3C5 + B9B4C6B5B0C4B7B5C5C0BECFC0BED0B8B6C7B5B5C7B4B0C0C1BDCDC0BCCCC1BE + CEB9B6C7B7B6C5B9B8C8B2B1C2ACABBCAEB1C2B3B0C2BFB7C8B8B3C5B5B5C6B1 + B0C1B3B3C5B1B2C3A9AABCAAADC2AFB2C7B9B5C9ADAEBFB2B3C4B5B7C8BDBDCD + B3B4C5B6B7C8B3B4C5B6B5C5B5B0C2B7B3C5CFC9D97C79860000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000012D5B0FF4B3B696D57987251995C548C644F8A543E87624F7F5F4E87 + 5440845E468A6250835C5C88513D845645885B51835850825E4B7E5E4A7C5047 + 7458487E5A4C80554777514873544977534574534472494073404572484B6F46 + 456E44477046496536324D1E2865616DACDED4DEFFFFFCECEFFF6E7CB5000B27 + 0012000C2E09433D54724C8364436A54395A55385E583E5B513F4F4438443F31 + 434A344A543E4C594551574553563D47574B5F605276664D6E634B665E496262 + 4C655F4B635F496961566C615463564057453D4C36373D3E3746453520082222 + 0D3202241D00002B18082E11031D001F3427543D5B3E4C404D455E6B506E3831 + 47AAA0BD1D00126C707DB5BED8A4A9C0A1A6BF9EA5BEA1A4B9A6A9BDA0A3BA9D + A5B8A0A6BCA7ACC4A9ADC7A9B2CAA1ADC6A6B3CBA5AFC69FABC19BABC3A0ACC5 + A2ADC4A0ABC29DA9C19CA7BF9EACC49CAAC29FABC29CA9BF9AA7BFA3B0C89CA9 + C4A1ADC7A3AEC1ABB5C6A9B0C4ABB2C6AEB5C9B2B5C7B4B6C8B5B7C9B9BACCB9 + B9CAB6BCCFADB5C6AFB4C8ACB3C7A8AFC5A6AFC2A6B0BFAAB2C3ABB3C3A1A7B7 + 9EA0AFA5A4B49FA2B0B8B3C1B6B1C0B0AEBDB6B5C5B9B7C8C0BECFBFBACBC5BF + D0C8C5D4C3C1D0BEBBCAC0B9C8C2BAC8C5BDCCC6BECEC4BDCCC3BECEC5C1CFC1 + C1D0B9B8C6C0BECEBDBBCCBCBBCBBEB9CBB6B2C5B8B6C7BFBCCDBDBBCCBEBBCC + BFBBCEBAB6C9CBC6D97973810000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000060813C197FF46355B65 + 5098705592584284655890543E886754875B44865B478B5F4E8C5F5082604B8A + 5949855E4784574B7B5C4A7E58427B55457A55487653467B55447B5142774D43 + 6F4E45734F44744E4073483F7147406C453E68453F66454460353E4815284932 + 3F81B0B0C8EADAEBA594D6B9B1EEC4C7EE3A40690000001A2023836EA7B387D2 + 9A72AC9269A19266A08D6294895781844870814B6D784D657549606A42575627 + 3F995D76CD8DB3AD78AC735677483C483A2C3B45324747384B45364A483A4E46 + 394C433C4B4436434931455C4E5D5C43596743606E546A583D504A4348381F39 + 00220000000059646E745C84603E686855643C2940B387B1150E0B636A78A3B1 + C997A4BA96A2B99DA5BD9DA2B69FA6B8929CAF8A95A7939CB28189A060667947 + 4B604F5257595B675258675057664E54664552683E4F644C586F555F73586075 + 5460754B596E4F5E72566175626E805F6880626D865C6880526078555F795560 + 79515D7557647D4D596F50607449586D4651674753694B566C485166444E643C + 485F3A496137445A36425835475C2E3B51161D2B0C14260D13281113262B2A34 + 292936282836303347282C4632374D3D46583D455845475C50546A575D705962 + 716164746A6A7970717F7C7B8A7D7D8F9090A1A09DACA6A2B0ABA9B7B8AEBDBA + B1C0BDB4C2B5B5C2ADA8B5B0ADBDB2AEBFAFABBDB2AEC0B4B0C2C8C5D878737E + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000081109BD87FF362A5B6B4D926B508D6B5B9158428A4C + 38836F5E935E448A5D4688614E8A58497F654D845B467B5844785C457D5A4878 + 52437B59437B5848765042765342795140745047725243724C3D714C39704B3E + 6B453B644337623F39593B37492E2B3A00004543428BE0D4E3CFC3EB9296D8D3 + D2F8DBD3FF64688E000000322739AD93D0BCA3E59B88C2977EB89971AE97619A + 9352828D4E73653D571C1B1B001400000D00000000492F3F8E577A7D4868361F + 2E14120D1B1D141F180F201D0D1A151814160C091F00001300000D0000180000 + 190000000013000C061E0B3434446E4C5A7B43659058867E5D5E111312242044 + 7C586F7B4E6945394EB586AE150018676C78AEB5CD9CA5BA99A1B8A1A4BE9CA2 + B89AA6B8919FB398A0B593A1B2141F33242736333444030B1300000804001800 + 000C000000313340616B824D5A6F3A44542E354A161F370B1830020F2800031E + 00031E00001600001800001D000820141C3300031E0000150000160000180000 + 1800041E0C122F00021D00001606091F070C24090E270D1A3012182E282A3F00 + 001918152B4E5360868893464B5800041400001600001300000C00000031394B + 3A3E50353E4E3B43533A43563843563D42553E44543E4857424958424B58474E + 5D606676444A59131423222230262732312F3935334337343E4A4D55968B9680 + 7987817A89827C888A86908D8793A196A3605A63000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000E11 + 0DB27FF446345C7960A06035865E50845B4E8B654F8758518A633E856A528C68 + 4C885B437B5B44766643805E477D5644735E47795A4876574375554074534071 + 5642734E3F7146466D4B3E704B386C493866473E60463C5738324C2C2942332C + 3E292E3C0003465A5293F0EAF6E0DFFACFD7F0EBF3FFD1CDFF726FA10000003A + 2F46B09BE0B49DDD9678B28C67A5885C93814B7A7543666F425C523346220F1F + 1902152919253C3745423A4A40293C53304C633E5C623F595F445A5D38535E3C + 5964445C64465C5C3F5E5B3C635D3E5561405062354B503F4F4B3238533E4326 + 1A19000000544755AD6EAF251C006A484D63376455605185386F4F324AAC92B0 + 19001272737DC3C4D8B1B0C4B7B6CBAFACC1B1B0C5B0B2C5AAACC1C8C5D62F33 + 40565D6BC7C5CFE5DAE2B3ABB22B354200001D09081F03090C0000008D919CB2 + B6CCA1A7BEA1A6BD9AA1B4979EB09199AD8C92A9878DA57F889F717C8E6F7B8D + 7D8795191E2B02000F0E07150B06140B04151106160703123642517E8B9F7881 + 9769798E6C7A8D6A78896E788A8188994F5261001220BDBBC7F9EBEF948E97C7 + BFC998979B00001A03081B0C0D1A06021227263A959BA7878F9B8089938C8897 + 8C8B988B8B988C8E9B838A988A8C9B8C8B9BA8A6B577707803000606001C0003 + 1F00001A03001D03001E00001B000007504F59B0ABBA9C97A59D97A6A5A0ADA3 + 9CA7B4AAB76B656F000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000110706BF8BFF523562665F946243 + 845C45826F5F8D5E4282594D836C4686613E8162487E64487C5843795A47775E + 48765748765C467A5944785542765A3F74524473503B724C3F6D4A476A43396A + 453A5E403A54362F4C2C2E42292C3C2F2A3F2F2E39111A230000397472A3FBF7 + FFEDE9FAE0E1EFEAF5FFDCDEFF7E7DA80000004F455FBDA9F5B095DB9774B192 + 6AA98962998558857A486A6E395B703860743E657242647444667845697B3D66 + 793B6373446871486B6E3F6574426979456D76496B72426A6E376070405F784C + 657344676C45656A396468486663465C6645576F405E543E563B334F78516B00 + 1A000000009D5A775F5E727A4B6F502C48C78FB70B0C0E726F7ABDB5CBACA8B9 + ABA9BBACABBCAEABBAAEABBBC3BDD0887F8D293440E3D7E3DCC7D23E2F3D524F + 5DADA9AE1E1F31000013070B11020203020406BDBBCDA19EB6A2A5BAA0A2B59B + A1B1A1A6B89BA0B5A3AABDA3A2B9AAACBEB6B7C644445000000D0F0F1E0C0B1C + 0606190808120306120C0B14000000323A4A9CA4B88A96AA8B92A88F97AC8393 + A88B96AA1415278C8D97C5B5B4483844CBB7C99A8B98928E9A6C697400000309 + 0B19090916020211767786B1B3C8A0A1B5A1A4BAA0A2B8A5A8BEA0A3B8A7A8BD + A1A3BAB2B1C585839100000003061D0D081D0B061B0D0C19040615060B1A0B09 + 1F0D0E260000085A5D6FBBBBCDA9A8BDA6A9BCA8A8B9B9BBCC6C727D00000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000F041AC797EE4B3C6C633A876D5C866A52896850885D43826648 + 7A65458161407C5F4782654B7B5B4B785B49775B4277573D7C604E7856427757 + 3E775B4B75493F6C493E6B4B3B674D3F643E375739314B362F4429263B232636 + 2A283C1D20260C1A0606081F0C07508B90A7FFFFFFE1E1F9D4D2EDF2F8FEE5E8 + FF7776A0000009685F84CBBDFFAD9BE69E87C7A18CC6977AB893619C8C4F7E80 + 466B7E45687F446D7F4472834871874D7B804B7E794D7F85558A87588B80528B + 89578F8D5F958D64968D62938D60968C6295886095885D938A5A8E905E868356 + 858B527C824A7181527581517C73405F71545F6D40713E2733504860000000AD + 7F93844075D698BD1A09127B737FCDC4D8BCB4C6BFB5C6B9B0C2BCB0C3B7ABC0 + D6C9D93C3A4887969FD5BCC5F5E9F15E5F69282630C6B6BE3C3D4E00000F090B + 110C070C000000878490D3CADEBAB8C9BCBBCDB8B6C9B9B8CABCB8C9BBB9CAB5 + AFC3C7C4D68C89950C090902071208091A0706160E0B1B0E0C1604040F090914 + 0F0D1C000000898D9FBDB9CAACAEBEA9AEBEB3B6C5797C8C353942E1CAD45855 + 5A000000F1ECF284818A000000C1B4BB00000806091A0B0B0F0403131D1D2C68 + 68777C7D8C787B9082869888879C8F8B9F938FA29397A89B9BA827273200000B + 0D0E1D090D19000000685F6A4F505900000E080818090E24060B2911162BA7A1 + B5BFB7CBB5B2C2B4ADBBC5BFD076717E00000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000070D19CC87E3 + 423C6673458C6C5982654E7F6138825F4D7E694C7D6847806746805E457C624B + 77634B7B5540735E467A5F467D57426E4F3D6F523E704D3966534570473B6640 + 345640324C372C4730273C2E293622232C13201E000800040606574A6E855EB8 + 3D287B7B808BFDFFF9BABEEE9596CFEFF1F6EBF2FF5A6398000028847CA6D9D1 + FFC8C0F1C5BDE9B2A4E59884D59880C49B76A79C64909B608F9B67959B6E9F9D + 79AFA083BAA98BC2AC91C6A891C7AA98CAAF9BCAAB87BCAF91C5B79CCFB99AD0 + B497CEAF96CCA893C9A88AC7B08FC7A888BAA58EBFA987C1A180B89C76AC9672 + 9E985D88955A878C5881955B7D945E7E55495D691E4D987776EA94CC1A06147D + 737DD2C5DAC0B6C8BAB1C3BFB6C7C4B7C8C5B4C6C8BACB222532DCD0D9472E37 + 969E9FF1EFF2B6ABB5EDDCE686808A0000150B090E0E0E0400000038354C8F87 + 986A6670635B6C5A5164544E5E534E5D514C594C495953515E29273702000F09 + 09190B09190806180B081A070713040311060613060B1C00000D231F369F9BAA + 787687706E836E6B7D32354064626CC3ABB5E1D4DCA39FA4D8D4DB8E89916B67 + 7BC5AFB5191E3002031806080707071103001600000E00001100000900000F02 + 000F0B07110C0913080B0F0F111303000B07081307081208091302030C272426 + 2C2E320603140706160B071B08041F000019756F83C0BACCB0A7B5B0A5B2BFB4 + C4756C7700000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000200F19C587E54B326B7A58875D3C6463437C + 6848836B5182663D79724B8768467D604C786A4C6E563D7959477F5C46725D47 + 735240694E406B4C3E674D3C61503D574C3D4E362B3B2A2C2E222623201B241C + 1D1300110000000023133C784CA3B086D39A85BB2C2555525666F7F9F3D8DDF6 + A7B2D8EEF4FADEE0FC46458311073BB0AAC6FFFFFF9293D70003B16174D4F6FD + FEF9F8FFD0B2D0C47E98BC788EBE8299BE7E96BA7993B97E92BC818FBB788DB7 + 6C85C06C84BD7181C46E84CF6B88D37389D17A8DD2758AD77A8ADD8190DB7E93 + DC7F97D48099CB839EC5819BC786A5C591B4CFACD4AA93C0BA95C1A56292A774 + 989A578EBE6A87575A59500230FFC7EA280318777681C9C3DDB4AEC3B6B1C2B6 + B1C3B5AEBFD2C3D5C7C2D031313EDDCBD7534E59ABA1ABB4A0A7ACA1A7635C63 + 73707706061A0303080E0C0908061800001202030D00001200000D00000F0000 + 0F00001100001100000B00000E0000110906160B081607021503001304021400 + 001202001202001202061500001800001807070900000C00000300000600000E + 7C7484BFB3BCCFC1C5FFE0E8897E84837A82FFEAF9493D454B4D58000012030B + 0D0B081808041F0406190006190D0B180B091807041404031606001406040E06 + 060F0809140708120808130909140B0B1504030D02001408041A07041609071B + 0D041E040B2212112C5A5A71A69FAE98919FB5ABBA69646E0000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000015D29EE54D3855664078704F80674A7F775D84654F7B7A568A6A3F80 + 5F3D7262517660437E5D486B52366D5E397C54446E583F6C533D684838573B3A + 392B3333282730201C1F0C0B0D070B1300180703110035163F744C9AA282CEB1 + A1D4D1D6F6C8C8F5342B5E1E202BD7D8DBFFFFFFF3F9FBEDEFFFA8A8E226245B + 383C64E6E9EEE8ECFE5C6BCE737CD0EFEAF6F4DBE1C6879DC05D73C56279C468 + 7ABD6675BB687CC57285C77587C57389BB6A83C1747FD18895C67A9AB77196AD + 78919E71919F66879A718E86668A825D85845B86906686996984A76F7AAF7090 + BC6C8DBA6176BC5C77DD889FAA616CD2B2D6C5A4BEC38EA7A9809FE57CB03B11 + 1BF6B8F92F0D2367646AB4A8BCA4A0B39B98ABA3A2B3AAA4B57B7C8D4E4A5D32 + 3848D3C5CFFFEDF7CBAEBCB5A5B0A79EA711141980797C09090F0707120B0611 + 110D25070B1503031904031F02021A00021A00021B02031C03021C080B1E0B0D + 1B0B0D1E0B0B1D09091D0F12220E0D1E0D0D1E120F22130F220F11220C122212 + 142914192E12182F151A30292B400002140B0B1F8E7D8D726871151C2CB0A8B4 + AF9EA2C4B1B5887980C7B9C140394200001208081408041B07091B0304130607 + 160B070F0907110706140708160704150909110908120708120B091309091308 + 09120909130708120906190906150907150808190C041C070C24000222000000 + D1D0DEB5B3C0C6C2D273737C0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000080213CD8ED947294E76 + 5188744F7C7555856E4C81755281644677643A776A507B5A4970563C6F5D3D6B + 573E67543D6B50485A43344E4230462F1F36231C1D1A18150D12160F0C16090D + 030000023522446F43888E69B6AC9ED2BBBAE0C5CAF2CDC9FFA08FD42015360F + 1316ACABCDF9F4FFE1E3F8D3D8FF8488C2020048605E84F4F7F9FFFFFFFFFFFD + FDFCFEF1EDF8E4D4E6DDABC1CE809BB36379A4657CB78AA7B690A9B08099C99E + B4CCB2C8B399B6B297ACAA839FA87DA9A18EB79D86AC937695938FA6A5A3B9B3 + A4B99685A1B7AEC5A29DB98777979C80A291809BAC94B4C7A0C97D465DC29BBD + DEBBD7A36480BC7B98CE98B8CCA9D8D57F814F1E3AFFCAFF2A152366636EA8A7 + B79796A7928CA1ADA3B56C667600192F060E20201E38D4C9D38175795C59647A + 7F8BC5B5C1968F9DA798A004020E0800120F1223242639232A3C383D4F393F4F + 3C3F503C3F513A3D4F333D4F333C4D30394B30394D343C4E3C4253343F523A44 + 563942543740533842533842523742533842543B46573F4556444658383D4F3E + 4A5A0000020F0F236D66766E7279524E5E848293787F8778747E0000003C4249 + 3C3A4900001407041402092007091D0906190D0B1C04030F0603130404130404 + 130604130708140708160806140E09160F09150907160606130403110B041308 + 000E08061604021508081506091E0D0E270000076D6D78B5B5C6C2C0D36F7279 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000161213CA82D7472C4D825E9377547D7552826C467B67 + 3E736E56816742766956755B43715B2E6F5B49725C4B704B39531C1E2012040F + 110C00140808140026001100000B000000001C12286A4687805CAA9487C5C6CC + F3CFD1F8ABA1DB9E8ED6B3A1EE9F8DC92F274900001B586187C8D0EEEEEEFFCE + CCF747477E00002CA4A2B3FFFFFFFEFFFEEBEDF1E9F0F3FEFFFFE2D5E3B490B5 + AE6F90C17F92D9C1D2D5DEF6CAC2E2C7A1BEAB8294C5A1B3E6BAD0C496B5AC87 + AECD96B7A388947D797C7B6D77726175716C777A797F545A5DA99FAF6E556D6F + 6D6E826F876B7076807C867A6575D4B4D1874E86C8B0E7CDBBCEC2A5C1935484 + C486A6C56D6F484B71FFDBFF29041B7B717DC5BDD0B1AABCB3A8BDC5B6C73C3E + 4F1622390D0F23131327A59DAA34343F5558658E898F595363DECED7796A7A00 + 0D190E001400021C0B1129585E707278867278867377857678867679876F7886 + 6D7685727B87737D89767D8A767A887A818E79838E79818E7B84907C85917C84 + 917C84927D84917C84927F82908083908487946069780000030B0D1F464653B2 + AEB6D2C2CC81757D4C4F59A8A7B434384D7F7A8303060F0E0E230402120B1125 + 11152B1113290308230E08190B081D0B071A0B061A0C0318070B1D121B29090D + 1E09091C08091C08061A00021609061602031400021302001500001400001300 + 001409092306082000000E585B6FCFC8DD767680000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000E00 + 00DC98F25F4260705487764F84745A846442747151816C43766550815B3F725E + 38676A58850F181D14000000000000000012130C35303E29293C131E2732182A + 3000407350949778C6A49AD2CCCDEFD6D8FFAA9EE0917EC8988ACEADA3E2CCC5 + FFB1A8D6392F4E0000282024546A6E88B2B3E06C6FA0000023474767E8E6EDFF + FFFFE6E6F0F2F4FAFFFFFED9C9D6C4ACC9D2C6ECC1A6D4A96287B16880C2819A + BB7F9DAB819EA2738FB96D83BD7786B084A3DD9DC0CB8CA07A6B787666777568 + 6F726A6B796A727A6576534B5AA598AA857F867B72838D8088676157A1749903 + 1502C3BFC7C97AA3D7D9FF730748A68193F8EEFFEDB2A66F225C877395FFC9F2 + 31092A827783DCCADECFB8C9D1C0D23133451E2E3C242A3E00000E2C32434443 + 53ACA7B8DFD0E094878D08090BB1ABB1363A5307142004000E000219666B7C8C + 909F8083908184927F84937F84927E82917B808D787D8B7F8390818392828591 + 7E83907E84927F83908185938084928084927F83907E828F7F85927F85918282 + 917F818E8184917079850000000C0F20151B279C919EBEB4B93530304C4A4EBF + B8C0C5B9C249444608111E00081508091D00001100091D00061C000007000008 + 00000700000F00000E07041D06061C0F12270606190B081B0404180F0D1D6C34 + 428784886B666A7268736A616C635D676B676F4C47530000150B0C2700002232 + 3444C7C3D37A7882000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000001C0D0EDC9AEE5029577561877148 + 766643786F517F724D775F407662517D4E4075704367352F755E83B800000024 + 1A000000000207004636555C477F4D33666F4889856AAEAEA1D9C4C4ECCACCF7 + B2A7E89686D09C8ED4AC9FE1B2A5E3BCB4E5D4D5FFC0C0ED433E4D00000B3D3C + 8225245B0000300F09591C14578E8CA1FBFBFBFFFFFFFEFDFCFFFFFFEFF5F2D6 + D0DFCAA2C3C596B4CDA7C0E1BACAD3A4B7BD839ED8B5C6FFF9FFF0D5E5B17792 + 9A6783D69AB5E9A3BA846173594A56735A67755F6E6F6073775E727358675F52 + 5FB387A266666E756774746176775C72A299A1433B3DA7A2B3D8A4CFD4B5D19B + 6AA0BA89A1D0D5FFFF96A82A495DA34A89F5CAF92402187A737ED1C2D4C2B8C8 + 8A8795878796B1B1BE51525E00000F070F25333748827A87AE9AA7CBBDC42C2E + 376D6A75222C3F00000D0000155154649597A3838693888A9887889685869584 + 8596848596848692848794878796878795878795878995878895868894878896 + 878795878996878996878996888A978688958787948787968787967579890000 + 000C0D231216292A2A39C5B4C13A3F48777075A198A25857600B131F1F243009 + 0D180000006666785C5C6753505F57505E4044503D3F4B3E3A483B34451E2C36 + 07041B00001408021A06041B02001A001923B53249747C81AC9AA6877B7CB2A7 + AA998E929C949780767C0000120800200E1323A19DA6DDD0E06D6B7300000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000160011DAA1DF593362675475714A76704A7B714E7C6043775F45 + 7C5C457D5B4072602E5B3E3FAAFFFFFF524D610000000013000200025533717A + 4F9F785BA7A29ACBCACDF3C3C4F2ABA1DCA08DD49C8DD4ABA0DCB5AFE6B5AEE8 + B4ABDFBFBBDFD7DEFACFD4FB62617B0000002423455C5EAD5657A11812502F2E + 51CFCFD4FFFFFFFAF9FAFCFAFAFCFFFFDDE6F4C4A1C1BD5E78D59DA4EEE3EEC8 + A7C5A07598AB84A0E1B7C8F9DCEAB18BA8925173BA7C92F6A6C0C5879760565C + 5B505B6C4F5D6A5A625F5C676A5A673E4652454E5B9662764459624444505246 + 553C5B567C6E7E2025377B898DFFDBF8AF5D9675505AC088BDFBE6FFC387A059 + 4368995C84FCD4FF2E09207A7480CDC1D4A9A0AF9E94A3AB9EAEBBABB8777282 + 0000190402153235443134464848578480895655621C24351F1D32000007242E + 439293A1898A9887879687889584849186839387859586859583829084859287 + 869385859184859184859283859283849181839081829080828F828491828491 + 85859187879480818E8483908F8F9F85879800000408031E1D23351C222C241E + 31646676706E7D504E590D0B1928394B07072000000C060618F9EFFFC9C0CDC5 + B8C5B8A7B8B5A5B1B5A6B5786B71B8A1ACC8B6C1726B7816152400061B00001B + 00001900091C51182E72697660556163576871606B65565E72686F4F46510003 + 1A060B1A7D707AB4AAB5D5CCDC7D747E00000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000001B0E1AD38DCD + 4B3155734C7E724C6D714F79673E7A684C7C5E3B7A744D7D96608D994F83263B + A9FFFFFF8E93C2000000140D18B886F06C559E9C96C5D2DAF9D4CFFDA598DB96 + 83CFA991D4B1A5DFB8B3E9BCB5EDB7B8E7C2C6E6DBDAEBDADEEED4D8F9DFDFFF + A0A1BF151A1F04000031253D0E09380C0D259D9DA3FFFFFFFEFAFEF7F2F9FFFF + FFF6F8F9C5C1D6C7ACCDDCBAD1CFB4D2C49EC8AF7090B3677BBA8597B2839BA5 + 5D76AE5C70D691A1DD92A7BB718AB7758DCF899ED48FA0CA8C9CD190A0D195A8 + D593A4C7939DC88C95D7879ABB8C97C88894C58794C08D98CF8E9EA28783D697 + ADBA5A7EBFC0E8C87F8EAA4668FFB39D6F4278A588BF6D4D75EDBFFF1F0D207B + 727ED2C5D7B1A2B3A79BA8AB9BACB0A2B2A197A714132402071F090B1E303244 + 2E334623253823293929293D090218000008777D8B928F9D8A88968C8B998F8E + 9D8E8D9C938D9B948E9C948E9C95909E9993A19993A19794A29996A39C99A59D + 9BA7A19CA9A19AA7A29EABA8A0AEA8A0AEA8A1AEADA5B0B0A3B0AEA4B2ABA3B2 + BBB1BEC5BCC600000806022502021C2324392B30431D22371B1F321B26352E35 + 4809182803001A0000079491A1DECAD9C8BDC8C5B8C3B1A1AEAC96A3B29DA940 + 3E473B424DAD9EA9A4969F8D8489666169504D5A4C485740444F3C4252343740 + 3C3744373443342F3B33333D31354031304020263966697589797FAC9CAAD4C6 + D677717B00000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000001B1113C288BC563054835587754A72655175 + 673A7774447A8163909A6091B47A9FA0498B376FB9FFFFFF929ED8000000764F + AFDAD0FFC0C9DED4D6FFAB99E18A76BF9D88CFABA1E1B6B4E7B5B5E8B6B5E6C9 + D0EAE2E6F3E9ECFAD4D9F4C0C5EEC0C5EFDEE4FFE7EEFC74738D000000000000 + 04040E838196FFFDFFFDF8FDF4EDF6F9F4FAFFFCFFF3F3F7C7BBD8AC7FAC8F46 + 6CA14F6DBD75859F616D8B5367985A6FAB566BCB6980E191A6CF879AC76F7CC7 + 6978BF6A84BF6B88BD6E88B96886B86983BF7286BD7B8FBB7A93C57A95BA718A + C58093C18092CD809CC48293C27799D2818DB57FAADE949A871227FFE9FFB898 + AEFFB4C54F356D9885AD463B6DF2CDFF090C1D686470B8AEC0B5A9B8AE9FB1A6 + 98AAAA9DABBEB1BE333544000011040D2500061E0F14291C20350E1E2F02091E + 00000081808DE0CFDBD4C5D0D6C7D2DBCBD5E1CDDBE1CFDCE1D1DCE5D4E0E7D6 + E1E6D4E0E5D6E1EAD5E1EBD6E1EAD5E1ECD6E2EDD7E1ECD8E4EADAE5EDDBE5ED + DDE6EBDCE6EBDCE6EDD7E4EED6E4EDD5E1E5D3DFD4C5D2E9DEE343404A000003 + 09092503021F0F152E22293C2B37481D2B3C0214280E081E00000058626FF9F3 + FCE7D5DEE3CAD2DBBAC4C6A4AFBE9099BC979FB58C95A5808AC2909DBC919BB9 + 939BBD97A1C6A0A8B08E98B3919BB591A1B5949BB08B97B18C97AE8B94B39099 + B18C959F8A909D8A8EAD8E997B646D9D8E9BDBCCDE7F79840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000070E00ED93E0623E5B7C4681664A77765478875786875C8E95618DA26D95 + AA75977B1973749FD5FFFFFFB5BBDE000000FFFFFFD8E1FEA699E09587CE9488 + CCAB98DBB1A6E5BBB5E6BFBEE6CCD1ECEAF0F8E9EBF4D4D6F4C3CEF2B8BBEEBA + B8ECC3C7F0CAD5F7EFF8FFF4F5F377748C2F2B52ABA9BAFFFCFFF5E2F5E8D9EC + F6F0F8F2ECF6F5EEFCF8EFFFCAA3C09245668D4054A26570BB707CCE6F7FD372 + 85D57487DA8093DA899ECF7C8FC5697CC86B7CCD7082CD7182CB6C7ECD6C83CD + 6982CB6E7BCD6F81D1697CBE627DC1687BCA6B7ECF6E84C86F81C76C7DCE6E80 + C66F7FCA7281DA93A6C5668BE8877A884B6FFFEFFFAC869F775088888DA65749 + 77E1E9FF00061C6B6973B0A6B9AEA5B3FEFAF9F8EEF0F3E4EEE7D8E2C6BFC809 + 0E2600061B00092003091F00081F000019000C1E797789FFEEFAE9D4E0EADCE5 + F4E2ECF4E4EEF2E5EEF3E5F0F3E7F0F2E6EFF3E6EFF8E9F3F4E6F0F3E6EFF2E6 + F0F3E6EFF2E7EFF4EAF0F8EBF2F9E8F0F9E9F2F9E8F1F8E9F1F5E7F0F1E8F3F3 + E5F1EFE7F1F2E6EEF3E4EEEEDFE5D3CCD2060C2000001500001C000019000018 + 00001200001A00001A02081C6C7881F2EDF3EDE0E8E9D6DDE1D0D2C8B3B5B093 + 98AE8D90A58C90AC8B8DB5969996858A8B7378A78A8D9B7E848D727C97888C85 + 777A83727882787895888C877D7F86797A8E7C7F937B80BF8A91CB8C94CA8C95 + EFB7C3CEBBC5CBC2D1716D770000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000D0E02FFA0F94D2B5072 + 5278845584895885875686925F919D65929E6C98AC6E9677125A6F98D2FFFFFF + A6B5D4000000FFFFFF9186D99782CBAEA5E1B3AAE3A3A0E1B9BDE7DFE1F4ECED + F7E8ECF9D4D7F0C7CAF0BABDF0B4B5ECB9BBE7C2C5EDC9D2F6CDD8F7DBE3F4F1 + F7F8FEFFFEFFFFFFF9EFF9E8D4E9E7D7E7F3ECF5F3EFFBEDE6F9E4D3E8D8A4BB + CE7C91CA8596CF92A5D98599D97687D37888D47E91D58294D17F90CE7386CC6C + 80CE7082CF7687CD7687CD7687CB7484CE7387D07387CE7885D57889CB677CC4 + 879FCD8899D07887D18193D27D93D78094D27F8FE08A9AD0A1AECD7C96C17D88 + F2AEC2F06065A05F7F5281AA6F74A0568A9B534F8095EDFF00021E6A646DAAA0 + B0887F86AC9ABAD0BBCBD3C1C8D9CAD5F8E7F1D2C7D368727D3E46583542573C + 4D61666773B5AEBCF9E8F4F0E1EBF7EAF4F7EBF7F9EAF7FAECF7F9EBF5F8E9F4 + F6E6F3F1E2EEF5E5F1F3E4F0F1E4F0F4E2EEF3E0EEF5E1EEF1E1EBF1E1EAEEE0 + E7E9DDE6E9DEE5ECDEE6EADDE5E4D7E1E7D7E1E6D7E1DFD2DCE6DAE4E9DBE6F9 + EBF6FAEEF8B9B5BC444652161F330D182B121C301F293C303C4C515F69AAABB7 + FFFFFFFFF7FBFFF2FAF9F0F9C7C2D2C5B4C0CDB6C57E6A77625864342A397E71 + 8268666E03091C322F3C5C4C5AA69BA4605F643E3A4047454B494B50968B9248 + 484F463D425A4E54A1929E998C948D828787777AB4ADBCB6A7BACEBCCD766E79 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000C110EE98BE0523258886A868C5986794873865F8A91 + 66909A64959C6592AE6A9397357B004A7CFFFFFF7F8EC7000029FEE1FF9EA0DF + B6AFE7ADA5E1B4B3DAE1E7F6F3F9FBE2E8F7D3DBF6C3C6EEB7BCF0B9BAEEBEBC + EEBBC0EFBFC2EEC8CEF1D1DAF9D4DEF8E0E7F5F6F9FAFFFFFBFAF5F7EEE1F0EA + DFEFF2EAF7F1EDFBE9DDF3DEB6CBCF869ACB7689D48D9CD997A5D97E93D37288 + D08490D48897CF7B91CE7489D37687D17786D07887D2798BD2798AD07A8AD27D + 8BD07A8BD47C8DD47B8DD48091D7778DD4798BCB94ADD594AAD48193D6899CD8 + 8D9EDA8A9BDF9CACD2A4B5C77F98DE929CF892A9E5797E57789F6477A83580A3 + 5E819F268BA21F437A7AF4FF11091466626BA197ACB0A5893831D79387DFFAED + E7F9EFFDF9F3FDFFF8FFFBF2F9E9E1EAE5DDE5EAE3ECF2E3EAFFF4FAF8ECF5F9 + EDF7FAEFF9FCF1FCF5E7F3EADAE5E4D5E0DFD2DCDDCED9DECDD9DCCCDAD7C8D4 + D6C7D4D7C6D3D8C8D4D6C5D2D4C5D0D4C4CFD2C4CED0C3CED0C2CCD3C2CED1C0 + CDD0C1CDD1C3CDCFC1CBD3C4CDD9C8D4D8C8D4E1D3DDFAF0F9FCF4FAE9E5ECC0 + BEC8B0B5B9B5BABFC6CACFDCDFE1EFF2F1FFFFFFFAF2F9F9ECF8FFFCFEC5C3CC + 9793B2C5B8C8C5B6C46A676D59555E201622838293A197952B2B380307127D67 + 71BEAFB53A3E3E635C60766B71534E53A190966461676865665F6265AA95A1AB + 9DA3AA929BAF9397AEA2AFAFA4B4C5B7C8716A75000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000C00 + 12CFA1D06435588F59877448748D61898E5E8D9563868D5B8E996491AA5D80BA + 95E500001DFFFFFF8C91BE130064FFFFFF958ED4B4B2E1DBE0F2F9FFFCE5E8F9 + CBCEF2BCC5EEB8BBEBB8BAECBABBEEBDC2EEBFC6EFC3C7F0C6CCF2CBD3F7D3DD + F7DFE9F2F2F8F7FCFEFAFAF8F9F9F2F9F8F0FAF1EFFDEBE5F7E2C1D8D592A6CF + 798AD48294D78D9FD28594D17D8CD08392D08796D27D91CF7286CE7586CF7889 + D27A8CD57B8FD47C8ED47E8ED47D90D67C8ED48091D48595D48394D38591D985 + 98D78C99DB8A99D3899BD38797D98CA1D68F9EE19AA8E4AFC0D2ACBAD88D96FB + 96ABD78FA59C6B950074A44A899E427EA3557596457DA3357BA136547185E6FF + 181414665E66A399ACA1978E4B3AC8B9B8FDFFFCF6FDEFFEF9EFF9FBF2FDFFF5 + FEFFFAFFFEF8FFFCF4FCF5F1F9F9F2FBFDF2FAF9F5F9FFF6FCEFE0EBD6C5D1CE + BECACEC0CBCFC1CCCAC0CBCCC3CECABFCBCDBCC9CDBDCAD3C3D0D0C3CDD3C3CF + D0C3CFD2C5D1D3C4D0D5C5D3D7C8D5DBC8D4DAC9D4DAC6D4DEC7D5DEC8D6E2CC + D7E7D6E1E3D4DEF2E3F0F2E4F0FBF0FAFFF7FEFFFCFFFFFDFFFFFDFFFFFCFFFF + FAFFFBF5F9F6EEF5F5EEF2F9F2F9FDF6FDE1DCE3A4A6B99890A1927781514749 + 4F3E444533395D51549E787F46313691767BD7A8B0BF9EA20B120F3B47461B38 + 3957575AC9A0A648484643464D33353EBC97A5BE9EA6AF8A8FC9A2ADA69DAAAD + A3B4C5B7C6736A74000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000190013D89BCD623D6481578D924F + 7D996E99985D8E996593A66D969D5C86BA689CA3A4F7000000FFFFFFA9A3CE3A + 2393F9F5FFDBDFEBF9FEFDDEE6F3C3C8F2B7BEEFB8BBEEB9BAEBBCBDEABCBCEE + BFC4EEC4CBF0C6CAF3C8CFF5C9D4F4D4DBF2EEF1F6FEFFFAFFFDF9FAF5F9F6F0 + F9F4EEFDEEE6F9E0C7DDD799AFD28093D08592D48996D48597D5869AD4879BD1 + 8395CD7A8BCB7588D0768CD67D90D58091D37C8ED37C8DD57F90D68193D68696 + D88696D78695D68796D58897D68997D98C9ADD91A2DC94A5D48F9CDC90A1DA97 + A3D89DA6E1ABBAE5B6CED6A4BAE28FAADB86A340869F1983AB2083A43472A55D + 7F97337F9D4B76A24A7D9C5093AC31566F7EE5FF0608136A5F6BA9A0B3989687 + A28BE0C7C5FBFFFFFDFAEEFBFAF1F9EFF1F2EDEAEEF5F1F6FFFBFFF9F3F9FEFD + FFFFFBFFFEFFFFFFFAFFF1DEE9DAC8D4E0CDD9E1D0DCE0CCD8DFCCD8DFCBD8E1 + CCD8E0CBD7E1CFDAE0D0DCE3D2DFDDC8D5DFCCD8DCCCD8E0CFDCDDCDD9DECEDA + DBCCD6D6CBD5D5CAD4D2C6D1CEC2CECBC1CBCEC1CCC9C3CCCAC3CDCCC2CAD9D0 + D7FAF4FBFBF8FBFCF7FAFAF3F9F9F4F9F9F2F8F8F0F8F9F1F8FAF5F9FFFDFFFC + FBFFFBF6FAFDF9FDFAE8EDE6BFC4E1AAB0ECB4BDEDB7BEEEB9C1E7B0B9D8AAB1 + F4BCC5E6AEB6CA919BD39AA3D9A0ABCE909BC5929BE098A3C58D95B88A92B480 + 89C89197DE97A0D89194D9949DB899A4A399A6AB9FAEB6A9BA6F667000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000EA9FE067305E7C4C78AB76A6A26794A56997A05F93A76C + 94AD6B8AAF68A0B1B8FF000000253288868ED6ECE8F5FFFFFFCCD3EDC2C0EFB7 + BAF1B1B9EEBBB9EEBFBEEFC0C4EEC0C6F0C4C9F1C5CAF2C8CEF0CED7F4DEE6F9 + EEF3F9F9FAF9FFFEFBFBF8FAF9F2FAF7F2FDEAE2F5DEC5DDD8A1B5D47F92D07D + 90D3879AD9879CD8879BD38599CF7E94CE778CD1788CD57D91D68094D78596D7 + 8799D78799D68799D88A9BD98A9ADA8A9ADA8E9ED88F9EDB909DDC919FD993A1 + DB96A2E096A5DE9FADDB99A7D6A0B1E1ADBFEBBACDE8B4C5D994ADB88AAA997D + A3537CA3007BA14B7FAE4D84A944839A587FA9207B9E5E82A8558AA42B739237 + 77A633526953CBFF1207006A5F69AFA1B49E9197AF9DC4F2F3FFFFFDFFFDF3FF + FDF3FCF0E5EFF2E7F1ECE5ECF1EFF1F1EDF1EEEBEDE8E5E7E1DBE3D9C6D4D2C1 + CED5C7D4D4C5D3D2C4D0D6C5D2D4C4D0D0C5D1D0C5CFCDC1CDCBC3CEBEB3BEB0 + A9B4A8A1ADC5BFC9D1C7D1D4C7D3D4CAD4D4CAD4D8CED9D9CFDAD9D0DAD8CDD7 + D9CAD6D5C7D3E4D6E1E5DDE6E7E0E8F3ECF1FAF6FAFBF7FBFBFBFBF9F9FAFCF7 + FCFEFCFFFFFDFFFEFEFFFCF9FEF7F4F5EDE3E8E4D5DADAC1C5C79CA4C38E96C0 + 8892BD8893BF8B90BD8A90BA8B90C08C92C49197C6929ACB8F97CC929CCD949D + C89099CD949CC5989CBB878CD4919DDC939FE69DA1E8A4A8E4A8AFD9A3AFC4A2 + AFA49EAAA59AA7A599A9B8AABB6D646F00000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000070F00E48EDD + 68254EA17199A777A1AB709FA2638EA8759CAA6895A15A789F76BECEDDFF0000 + 00000050817CC9FFFFFFB0B3E9A6A7EBBBC0EEBABBECBAB9EEBEBFF0C1C5EFC3 + C8F1BEC5EFC3C9F0D5DBF6E8ECF9F6FAF9FFFFF9FEFCF9F9F9F9F9F8FCF3F4FF + EDE8FBE5CBE1D5A0B8CD899CD28A96D78A9AD5879AD68596D58395D38294D481 + 94D48194D58294D88495D88696D78795DA8C99DC8F9ED9909DD98E9ADC8E9EDB + 929FDC909DDE8D9FDD93A0DD99A4DE9AA8DD9BADDB9FB2D7A4B7DAA9BBE7C7D5 + F9D0E1EAADC2CA8EA6AB6C9465749B487CA01885A24585A74881A55A85A5457B + A33F759A36779B306F993971953D69982A697F236B9011507568D0FF190C0870 + 636EBAA8BAA293A4AD9EA8EAE2E6DED4DCDDD6DFDCD4DDD3CAD4DDD4DED4CAD4 + D8CFD8D6CDD5DFD0DBD3C7D1B0A6B3A39AA5DED2DEDED1DEDED1E0E0D4E1E2D7 + E1E4D7E2E9DCE6EDDFE9EEE1ECEEE1EDECE0E8B9B0B7E1D6E0F9F2FAFBF0FAFC + F3FBFEF5FDFFFAFFFFFDFFFFFFFFFFFFFFFFFFFFF0DAE5EDD8E2FFF5FBFEF9FC + F7F1F6FAFFFFFCFFFFFFFFFFFFFFFFFEFFFFFAF8FCF0EBEDE7DADEE5CED3D8BF + C5D7A8B2D099A2CB919BC68B94CE8A95CE929CC9929BC7919BC9939DCE919DD4 + 919BD8949CDA919AD6939BD8929CD7929AD48D96D58F98E0959BE5999EECA0A3 + F5A3AAEAA5B0D4A8AEC3A4ACB09EAAA99BADA89CACA59DADA196A5A397A7B5A8 + B76A646E00000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000F0000D58DCA935887C395C4AE748B9E6091 + AE7B9DAA7295AA75A3A35E798367C7FFFFFF14130B000000E1DCFAFFFFFF8487 + E1C5C9EEBCBCEEBBBEEFC0C4EDBFC5F0C5CCF7C5C9F6D4D9F3F5F8F9FFFFFBFE + FEFAFDFFFAFEFEFFE8E6FBD1CAEDE2D3E7EDCCDCDBA6BBCF8EA2CD8597D58797 + D6899CD4869AD58497D98798DD8D9CDD91A1E096A5E39BA8E19DACE2A1B1E2A4 + B3E1A4B5E3A6B7E3AAB7E2ADB8E6B0BEE8B0C3E4B4C5E2B9CAE3BBCEE5C0D1E4 + C6D6E6CCE1E7CCDFE6CBDFEBD4EDF8E6F9F3ACC8AA628D6C628A3E769B1A86A7 + 3885A74A82A13B789F2B719B4478A1266A8E2F6F9A2E6C8C1560863B72922C69 + 842F79A11D72965484AA454C6D4AD2FF130D0F70626EB7A3B59D90A1A89CADFF + FEFEF8F4F8F8F6F8F9F7F9F0EAF3E5DFE9EEE2EDFEF1FCF9E9F6FFFAFFFFFCFF + E8E4EBF9F2F9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFCF7FAF8F1F5EFE9ECE1DCE1CBCBD2C0 + C3C6B5B8BC9F9FA64B4758656172DCD6DCFFFEFFF7F3F8FBEFF3F5DCE2E2CFD4 + DBBEC3D5B3B9D9A6AFD49BA6D49BA6CC959DD4929ED499A1DBA0A7DFA1A8E5A5 + ACD4969DD3979FD998A1DC969FE2949FE196A1E29AA4E09DA4E0A1A6DE9CA2E1 + A0A6E9A7ADF5B4B8F8AFB6F4B2B7E6B2B9D6AAB7AB97A19D96A59F92A49F92A3 + 9E91A3A89BABA69BACA7A0AFAAA0AFA49BAABAACBD6C66700000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000FFB1FF976482995D89A76697A46B889D5F96A86B97AE7696720963 + CED1F6FFFFFF8A80E41A1200FFFFFFC7CCFC9FA1E0CACDF1BFBEEEC1C5F0CAD1 + F7D4D8F9DAE0EDF2F1F3FFFFFFFFFFFFFFFFFFFFFFFFFDFBFEC6BCE38975BDB2 + 95C5DAB9D3D59AABC67A8BCC7A94DA849CDC889DDE90A1DF95A1DF94A1DA8999 + D48191D17C8ECB778CC8768BC9758ACB7387CB7288CC778FCE7F93D08396D182 + 98CF7D95C97E92C6798EC7728CC67A92C78799B86F85AE6282C382A1B9788FD5 + 7886A14C7A184E810E76A21875A41F6F9B5379AD3875A63C729C196FA1326A97 + 3E709E356FA81D6B99396E9B3E749D27749B3D73A62B6AA11A6F95457EA2253C + 7278DFFF0007196B636DB7A4B6A192A1938A98FFFFFFFBF2FAFAF1FCFCF3FDF4 + F2F4F1EDF0E8E4E8E4DEE3E1D9E0DBD3D8DDD8DBDBD7D7D1CBCECBC6CCC5BFC3 + BEB8BDBDB7BAB7ADB2AFA6A9A8A1A4A1999C928A8C6360695C5A616862656C66 + 686A6465625F58625F595C5C536864669D91A3736D7F847D8D6F667600000B00 + 0000595964FFFFFFFBE7EEE8BBC4C3969FC89BA3C796A1C996A1CC99A1D49CA3 + D59B9FD99CA5DE9CA2C79698B48788A77C7FAE7E84CA949BE7ACB3EAAFB5EAA5 + ADE8B0B4E2B5B4D0A1A1C6979CC999A1E6B5BFE4B5BCD8A9B6C5A0ACB09CA4A5 + 95A19C91A18B88989A90A29D93A39D92A2A29AA99E97A4A69CABA89FAEA69DAC + A89EADAEA0AFBAAEBC6F67710000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000020611FFB1FF643F4A94 + 5D8C8E5D818F57789F679FA269A08A5D786A1E54B5AECBB6B8FF9881DFFFFFFF + F6FCFCB2ADE4C5C4F2BEBEEECDD2F2DEE3F8F7FFFEFDFBF9C5B5D0BAA4CCFFFF + FFF4F3F1CEC5CBC5BBCAA794B76E4B8F8871B0E3E5FFF1D8F0B66C7F69253263 + 3445854C5888545E8A56628650587C464D7B3F497A39467B38487E3E4A773E42 + 703D497540627236536B343B70464B78545A775255673D4552262E4F201E5E29 + 3272333D85565C6D3C5099475DB16F855F48556F1622425F8B118CC23378A946 + 6CA5366FA81E79A7276DA14674A73974B0336DA2356AA24774B1356DA131679B + 507CAC1E6BA13273A34A70A02A70A1427EAE2F4F7966C9FF000D1E68616AAFA1 + B29E91A18C8492ECE6EDFFFDFFFFFDFFD4CBD382797EA2999C8E87878F898980 + 79775A56635E59647A7477878483868182706B6C837B7E8881838E83868A7F83 + 8885858B8989807B7E4A4C5C4042526F73718184808386838B88858986837F7F + 788C8E8FFFF9FFDCB4BCDAB1B9E3B7BFA1848E4B4454888C96FFFFFFD7BFC56A + 5B5D332E2C372E323028302A262F35333F3D3037523E406F585C7B5D638C6869 + 8E6A6D8B6A6C8363657A5A5B826064805F6494676C916A6D8D686B9964669A73 + 779C909AA694A3A0909F9B8F9F998EA0908D9B968EA09A8EA19E91A1A092A39C + 91A1A195A6A196A6A397A8A398A9A497A8A59CABA69DACA397A8B0A5B66A646E + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000080D14E292C0563C3D7E4480814A67865E739249A184 + 4C4C50355AA77FB89775BA767DE1E9D8F6EEEAEEC5CEF2B5B0EECDDBEDF2EEFB + F4F9F9FAFEFBFDFFF9FDFDFAE4E1F6EEE1F9F8F1F5615189130040673869784D + 83A1648EB87787D4B0C6F1C4E2984D5D11000000030006080406040604000200 + 0000090B0D26282E1D221F090802180E0D0F0C06000007201C3F342C4E2A191E + 290E0F2913242B1D2A3C2F2C451F2850193266364E64526455485B9E5C7AF38C + A83E363F653B37D13A46475F931484BA337FAC3474AA2971AA2972A63974AA43 + 70AB3375AE2E71AB4C78AA3770A10D699B4871A1336A98257195556FAA377EA5 + 2B7FB54080B633618272D4FF00041169616BA8A0B19D94A4938A9CADA5B3FAFA + FBFFFFFFB5B0B5756A71B7A9A7B6ABA5B1A9A2B7ADA467677864636F756E7997 + 8E958F8989827B7D8D87898E878893878A92888B8E8A8A8C898A8B87886A616C + 665D697F7C7C7B7A777876747A78737876726F6B68898C8EE4DBDEDDB1B8D5AE + B5E1BFC4C8B4BA80788CE9EDEFEBD1D2523F403E34354D3A3F473A3B4A38384E + 3D3E5A53595F565A6E626393897F7E726B6C5456765F607C686678645F886D6A + 9A867F91807888655FA06B69B46666AD6B6EC794A19990A49A8D9F9A91A19B91 + A1998F9D928F9B9991A1988E9F9A91A19890A09F90A19F93A4A195A7A196A59E + 92A3A093A4A69AABA199A89C98A8B1AABA686670000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 06C588A1502A435B4254834E72703D74573E376D3860B29DE08B78A960357893 + 93E6E7E2FFC2ABE7D5E9F4E1E5EAF5E2F2FFFFFFF7FCF7FBF9FBFFF9FDF7EBF6 + E9DBECD9CADFD9DAE8DFCFE8C06F94B85676C27787B13F55A81F46D49DBEEABC + D36E24320000000B1E192F18242C0E1D29161E2715192C181E34233034253129 + 19202718182E231D2C141D230011260D16381D224422284C293B502E44572B37 + 7040507D5E7672697C5D54678F5E7BE693B16C4F515D313BE46379FF8191487E + AB0073AE297AAD3684B22684B2397FB24280B12B71A92876A63976A934739F3E + 769F3A71A13C7A9A4C7CAA2A71AB458BA82875AB5583B0066FA73D547565D9FF + 200F1669616BB2A4B69F95A49B92A19A8B9EC3BBC5FFFFFFCBC8CC6B626E9D93 + 909B8D909F9395A397908C8A8979728350515DB8B0B6A79F9E948A8D90878F99 + 8E8E95908F9891908E898A8780838781826969737A7C877E7878837B7A8F8887 + 9F9792A7A3A3C5C1C2CBC5C4C0B7BAB9B5B9B7B8B8E0D8D4B2A5A8AFB0BAFFFF + FF53394032242554454538383F4A3F465645455D484C513F40736D6C857B817E + 6D6C86776776615F8A74728F78749B847EB9A397AA958796716BBB7F7FB96762 + 7A666CA993A6A491A2958D9A968D9E998E9F9A8F9E988E9C988F9D988A9A998A + 9BA293A39B8F9FA092A39F94A2988F9E9A91A19E96A5A49AA9A298A7A39AA6A7 + 99A7B1A3B56C606B000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000070213BC819D542A466145549C5F + 804A15306E5468BFA0E0A788CC6860872E0022A193F6E5E8FFE9F2EEFFFFFFDD + D5E79582ADFFFFFFF9EEF9F3E1F1E5D2E4E0CCE1D9D9E2D9DFE7DCE6E8F1E6EB + CC7C93BD5974CB7F8DCD9FA7D9D5E2EFDAF3CD7A96440009000000161A162F16 + 222A131E29161B2813162A1522311F302F1F2928141C281519281B14280F112A + 0D1B2C1C28382430422029441D274E263F583D5862536D645F7857556D805874 + D28AA4AF5E616F3E4B526A95507CB21878AD167DB03981B7347BB33180B23182 + B61674A61F73A53C7EA94276AA3974A32F6D9C35709D4273A33D799D3C76A13C + 7DB5237CA94D7BA818689C397EA33552676AC9FF030C0B6B636DB0A2B49991A0 + A098A7A696A8968796C8BFC7FFFFFF928E929F939CC0B3B3BCB2B0C1B4B6C3BF + BF988D9A938D9F8B8790E8D8DDB5A7AFB7AEBBC9BDC2CBBFC4D1C4CAC9BEC5C0 + B6BDCABDC59594A988889DC6BFC3D3CACCD0C6C9C6BFC1BAB4B3D3C8C5AAA0A1 + 9792969A9096938C8CC5B5B4ACABB0FFFFFF8E686B0000003F313C42353C4543 + 4454464A5243454F393E523F3E928875988C7C8D80758F7D7BA39382AA9586B0 + 9B8FB5A197A07E79926462B5797199555D716F819A94A4958C9B96909D998D9B + 968B9B988D9F9A8F9F958D9A998F9E988D9D968A9C958B99948D9D968F9F9990 + A09F94A39E95A39D98A7A397A9A59AA8A096A59A8D9CACA1B26C626D00000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000D0C0EBA7C97672F5B87566F915D7A380700C69CE7B59AD78C73 + A03F304E3B00169479D4FFFFFFFAFFF8FFFDF9F8F4F9EADEF1FDF2F9D6CBDFE0 + D8E8E9E4EBF8F8F6FBFFFFE4EAF2D4D0DBF7F6F2FFFEFFF0ECF3F2EEF6F0F4FB + F5FEFFF2D2EAB5506B3000000004001F18152B1416240D0D200F091C0F0C180F + 0F1B1216361D313F2334200C0F1A0B1E36184C3F1B4B37222F3B28273D161F40 + 192C57455C67597560587650566B755573CD84A6C0666C7B474E456C993171B0 + 2E6A9F366EA2277BB01E7EB4327EB52873AD3777AF3B7DAD2A70A33C76A72C73 + A33968A144709F3A719D27649439689E2A6695325E8746678C3C6A8F34748A4F + 7E9A3B526C42C4FF1E141666626CB1A3B5A096A5A196A5A296A6A797A89E8C9C + D2C7D1FFFFFF9B959DCCC4C5DED2D0D2C5C7D3C6C7AFAAB1978B9E8E8897B5AB + B1BBB2B4ACA5A8C5BAB6BEB2B1BAAFAEB8ADADB4A8A8B5AAA98F8694746C7FA4 + 9B9EAFA2A6B0A3A8A79EA0B8ACA9D0C1BFB7ABAEAFA9ABB2A9AAB3A7A3A29B9D + E6E1E6C3A4AC1815195B4E4D514445352C35453B3B4437394F40425342457563 + 5FA08E8397877C9A8B81A18D83A59185AD998CAF93889A746C9B625FAC706F91 + 64658779909D99A898909C978C99978A99978C9B968C9B998E9F998E9D9D91A0 + 958B9998909F968E9E958E9D97909F9F97A79B93A29F97A6A098A6A097A7A094 + A49E92A198919E9E91A1B4A7B6695F6A00000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000001C0712EA9BBA + 945B7EA355824C2330653456B6A2E7A791B24D2B69513B4056223D1A0046FFFF + FFFFFFFFFFF9FFF8EDF8C5BCC7BABBCBFFFFFFEDEAEEFFFFFFF9FBFBFFFFFEE7 + E4F2C3BED3E6E1E3FFFFFFEEE9F6EAE3F3E5DDEEF0E4F9E9B7D597394F150000 + 0011071F110E1A00001F0C00200712200F261E1D131D140D29122F2B1A1E1B13 + 002C1B45492A7947275F3E273A3B26243912184C293D62536B615B7653536C6F + 5775C17E97C46264894E5E377AAD1383C33771AC3B6C9D3A69A23377AB296DA4 + 3D75A9357FAE237BB53480AF377DA9407AA72B77A34374A63A73A6286E9D3E69 + 971D678D487F9E34607B436580295B81535F7B3D5D8B1B5C616FB3FF1D132B69 + 626BB6A2B5A398A6A397A7A196A6A495A6A594A7998799CDC8CEF8F8F9A3A0A3 + BCB2B5E5D2D2D4C8C8D4CACCAB9FAA91889CA496A2CCC3C5AAA1A6CFC1C0C3B6 + B7C5B8B8C3B6B7C5B8BBBDB0AF9E94A17E7788B3AEAEBDB4B5C5B9BBD6CBC8DC + CCCBDECDCCC8BBBABFB3B4CDBFC3B1A8AAC7C6CEDFC3C9473B3B867C7191867A + 695C582C1F225443455C474F664F5265494F907B779B8A7F9F8D7DA48E84AE98 + 8DB49D93A18178996963A45D5DA065618C6C75998C9F9A909E958B9894899894 + 8B9A958A9A928899978D9A968F9C978D9A9A8C9D92889897909F9A93A3948E9C + 9B92A09E95A29C93A4A29AAB9F96A6A295A69D93A29E93A1998E9D9E92A0B6A5 + B46E5F6C00000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000001B0D1BFFB1D587557AAC77995A081E92566F + AF9FF1B383BE3022286B3B3E705A75400018593D87FFFFFFF5EFF7FFFFFFD4D4 + DB818AA2FFFFFFE1DCE3FFFFFFF7F0F4FBF9FCEAE9F5C7BFD6D8CDDCFCF9FFE9 + DFF1E3D4E9E6D3EAECDDF2E1A6C382293C0300000007002F2920544759624D6C + 4D39582F1F3A1A11081A13040E16290B1924231A163B244E482E7B4731684434 + 4A351F22381512583740604F68544E6F6C5272B97289D1657292576F3582B509 + 8FC52678AB3969A3366A99355E913D66973A659C2C6193386C953A70A11F79A9 + 3481B15082B02777A93D85B12681B72A79B0487395376D9827648950697E1F64 + 9562558D445C89346D913125477195ED07091B6C6670B5A4B6A196A5A69DADA6 + 9BABA398A8A498A8A499A9928795CDC0C8FAF9FBACA8ACAEA1A3EBD7D7E7D5D0 + DBC7CC968C9E918694BEB3B9A498A1DECECED4C7C8D6C7C8D5C7C8D8CACAD9C9 + C9B8AEB9857B8D9E979AB9AFB0B2A6A7C5B6B6D4C2C1CFC0BEB5A6A4A2939491 + 8486BDBDC6F6E3EE644946827460948774998D7E968A786E5E575E43506B5156 + 70535978565D816669A4908AAD9E91B5A195B494889A6D6BAA6362AB635F8B55 + 538076879693A2978E9B958C97958C9A918996948A9A988D9E948B9C988E9B98 + 8E9B948A999A91A18F8A989891A19893A295909E9C91A09B92A19C90A1A194A5 + A396A69D91A3988FA1988A9BA494A3A18FA0B5A4B36D606D0000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000019030DFFB1DA794259AF77A9994F606D273ED8BCEDF6D8FF71588A300000 + 7F4B7576535F52344E000000470057D1C6DCFFFFFFD2CFDFC5C4D3F6F2F5FFFF + FFF2EBF4F6F1FBF5ECF8C6B7D3B8A6C3FCF0FDF5E4F9DDC4DBDFC9DEECD2EAD8 + 8BAA520F1F0000001D1C0D4A31455E4E79655482463F6526224425162932242F + 3C273C42203A4926355235404D3254401E4B3F18313C1A204B2C3463485D614B + 6C754A70BD6E85D46F7680637F3477B51384C31B80B23277AA2C70A622639533 + 547E4950723858782C51814458873C52834458872A568B3A5F98305A88345C85 + 3B639048678E3C4E7E3B4475404D7D4E488648659C37508E556392473F742832 + 5B5B72B51103116C6771B9A8BAA297A6A397A8A095A59C91A1A195A5A398A7A5 + 9BA9918695D2C7D1FFFFFFD1D2D3948791B1A0ABD0C2BEBBAEB894869B918893 + A0979EBFB3B6D1BEBEC8B7B8C5B6B9C7B7BBC8B9BBB5A7B19A899A8C8384C2B6 + B6BAAAAAB5A9A6B2ACAABEB1AFB7AFAE969498BEB6C0F8D7E14B2B3203040729 + 24293325284034374B40425A4A4C6B4F5573585F70595D826B678C786F93746D + 8C6664874E5288524AA05C5D9A56607F6A768D8F9D9B94A6908794958C999A90 + A1978B9B9C8FA0998D9D978A9B968999938A9A8F8998928C9C9B92A29891A19A + 91A19A8F9F988F9E9C93A19F96A49C93A19B8F9FA395A39B92A19F93A2A396A6 + 9B8E9D9F93A1ADA4B4645F680000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000191213D07FB062364593 + 5574A3718B772C60522E2EA78CBFB299DB705978452044614055654E4E6C4F69 + 52305C350047A9A3BCFFFFFFD9D2DEC5BECFF4EAF9FFFEFFEADFEEF3E9F8DAC6 + DDAF97B3DCCBDCF5E1F5DAB5CAE5C8DAEEC8E5C3718E340003000B08392E333B + 2732403B4E594C734C436827283F29193B421F4C4B26404E2C3355373754373B + 462E3C391D34361524391C28503049623D617A4060B05C68C268777A50792F4A + 8A3A569B35568E37558C3E5D933B5D9232457C453F673D536C3B53844A50733B + 3B531C233B39334C3C395939396531355A393951302E4F3B39622F4D81424278 + 4D4A7B5F4C8B39458233447740457A4B508318354E7582C00700166C6670B8A9 + B9A195A4A195A5A195A7A197A7A195A6A095A5A095A49B93A1A591A0C3A6B3E1 + C9D6ECD7DFCFBBC6B49DA9B5A4ABAC9FA4AC9AA5A3979EADA1A7BFAEB6B6A6AF + B8A7ACB8A9ADB7A8ACAFA2A7958A957C717AA5989F9D8E96A0969EA59DA3AA9D + A3AB99A1D8BDC6F1BFC9B17C838C65698B5C6A7D505F724F5475555A7E5C6088 + 5E6387595E8E5D6297646A9B6269996068995D65A4686EB1737AB17D81AF8194 + 8687939694A2958D9C938C9B928998938997958D9A948B9B968C9D928A998C87 + 95938C9B998D9E948E9F9791A19A92A19790A09A94A39992A19F97A79E94A39A + 91A09991A09F94A3A293A2A395A5A198A79E98A4A399A89A92A0ACA3B3615D67 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000060008B272974C304866393D6E466C885B745E3A5A36 + 191A6D496F7C609A67598767496F5E475967465F674A695F435B360032AD96BA + FFFFFFDED4E1A38CA9FFFFFFE7DCEFEADCF0EBD4EEB899B5B398AFEDD1E4E1B5 + C5E1C0D2EEC4E1A5556A1600000609122E242C0C1D0E0E190D261F29181E1F00 + 150B030C0F0406080000000B00070B001300070B00070012040732091E421528 + 5B2A318F474BBB5F6FB06182605080283A793A2E712A315D2F3E684F46874947 + 8540386E4D3B724346873D4673424B6E38435227323E303544282F3F4A446244 + 4272493F673C3D632936483A3F5837405E3B38733642705053803E38854C647C + 4042754653850818368387BF03001268646EB7A7B8A49AA79D93A3A195A5A59A + A9A397A8A599A9A298A59D92A19B91A1948B9A8F87959E8898A691A1B59DACAF + 979DB69FA6B7A0ACBDA8B0BBA3ABB0939CCAAFB5CDB1B7D0B4BACCAFB7D2B1B8 + D4B2BBD6B4BADAB6BDD1ACB5D8AEB7C99FA8B99AA1B99BA1D09BA1DC9BA4E4A1 + A8F2ACB2F5B2B7F6B3B8F1B4B9EBAEB5E5AAB2D8A4ABD7A3ACD1A1A7C79EA1B5 + 9099B5959BB7969FB99FA9AE9CABA39BAC9491A1928B9A948A98948B9A988D9E + 978E9D958C9A9289978C87969189998F8B9A8788968C8D9B988E9E9691A19994 + A29C93A39790A09893A19994A39B95A59E94A29A909F9A8E9E9D93A2A093A3A3 + 94A39F98A695919E9E97A49A94A2ACA3B465616B000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000180C + 15995C6F3F324D714751592C3C58384E643E636F4A615F3A424C354952235361 + 3C6F70596967476367486D705F7A5944571D00296A4F71FFFFFFF5F1F8B79FC1 + F0DFEFEDD6EBF1D6EED4B3CB9D788FC598ADE6BCD1DCC4DFDCADC78C35423100 + 002E161C441C25360E1D3307183111183D16204A091E4A0614520B195F192F67 + 313D75393C8A38469B455AA95F6FBF7887D38B98E09AA8CB97B57D77AA2E4C8D + 22366C2E33602C39623B466A474876393469383061473F73544B8545517C2335 + 541D2239263436151F372B2B442F3A5F38466F394270241F2B28323E4451583D + 44664245664D4A7F455476364C74464F8E495787405A8C4B5C870D24458691C0 + 00000D6C646FB3A5B6A49AA9A59AA9A69DABA497A7A195A5A195A49F92A29B8F + 9E9D91A19D91A19F93A39187999A8EA09990A19991A09C909D9E8EA0968B9B90 + 8993847B87988D99968692978693998994928992988B95988992968B929D9099 + 9E8F988A848C8F8A92979199A496A1A4929E9387918D858E887D878279857E78 + 8377747E73747E70727D7D7E8885808C88808D7A76838B8491938A9F928A9D8F + 8A998E8796958D9C958D9B948D9B978D98A08C9B9589978F8998878390888496 + 8C88998B89999193A190909F938F9F9893A29692A19B92A19B94A39D95A49D95 + A496909F9A91A0A193A2A491A3A495A69A96A59994A29993A197909F9F98A59E + 97A3AFA4B46A656F000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000D0000A775873C1D35604946552B + 3F52334352314B58434D57373D52385351404D573F37582F535B3B574F385A59 + 4A6A694F856A537D3E1B4D2F0442E6E6EEFFFFFFC9B5D1D3B7D0E0C2D8D9BBD3 + C194B5BD9BB8EBD8ECDDAFC8BE6783C55A74D9788DD6758CD66F86DB758AD97C + 8FDC7F8FDF8294E189A3E495ADE79EB1E6A2B1E29FB0E19EB7D8A2C1C99AB6B8 + 8DA6A281957762803D3C7A1C32842F3A834D3E7E463F732F3C663036623B3873 + 2C34612E2E3F3E344330313D242B4C3449533342552B2C5551506A191B2F0000 + 00000E07000000242F2B14231D253850473C67383D5F2C42543D4A724A4F763E + 5B782E53763F4C77405E7B266287433D625E9AC90C00096E6670BAACBDA197A5 + A399A9A195A6A29AA8A39BAB9D95A59B93A3A196A89D94A69E95A8958CA0A29A + A99D95A4A196A9A499AB9F99A7A196ACA399AE9D97A9A79FB4A195AAA89DB1A1 + 97AAA19AADA895AB9D93A89E96AA9E96AE9D96ABA097AAA69BAFA494A7A69AA9 + 9B94A59690A39595A79392A49C8EA19992A79A92A4908B9F938D9F9D8D9E9C8B + 9BA194A59B92A39791A1968E9F948D9C978F9D968D9C958D9C938A99938A9994 + 8B9A9286968C8794938FA19190A29495A79791A28E8C9D908D9D8E89989791A2 + 9B95A59690A0948F9F9A93A29890A0978D9E9B91A19F92A3A395A39C95A19B92 + A29891A19D96A59893A19E97A59C95A3A199A79D97A4B3A9B868636C00000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000180025B186C3403244643A695F455E593B4C57385758354B5038 + 4053344E4832444E324B50384A4934404A3C474E3D4C4F36315440555B4B6452 + 34592000315A4B70C2C0CBD4C1D6D5B5D3D1C0D4D3C5DDCBB2CEC5A1BAC7A6BB + CEB7C9C6BACEBAAEC7B8A7C7B5ADCBAFACC9ABA3C1AAA1C1A49CBE9A8DAC8C80 + 9F76739C4E5797253D8506284E00090B00000000082500071D000006221C373B + 2F4431222F28274B3136632932552E306039366A20223C1D192F23303C1E3625 + 3639443F4871454E8B35476E152E321A20241D20221D2A253543464A49635E52 + 85524C814342734F4F6F424F5F5D4E814C49823A4982504D74454F5600365248 + 56711F285A5D859B09110B6D636DB5A6B8A59BA9A397A6A299A79B94A6A19BAC + A29CADA19BAD9C96A8A196ABA199AD9E95AA9F99A6A19AA9A197AAA59EAE9996 + A5A29AA99C96A39A96A39993A7A299ACA497ADA496ADA193A99C97A39E98A69A + 92A39E95A69B92A3A39BA9948F9F9694A19A95A29D94A3958D9C948E9C948F9C + 938F9E91909C8F89978C87948D8996918B9890909D8F8C97948B98918C999B90 + A2958F9B958F9B948A99988E9C968D9A988F9C968FA0918EA58A8BA08788998A + 8D9D8B90A0938E9D918E9C948F9E938D9B9892A1968F9E9A94A39A94A2948F9D + 958F9D9B909D9F91A0A193A19A909E9D95A1918E9C9792A19C95A39C94A29C95 + A2A19AA79C95A19D95A2B3A8B76A616C00000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000070B09936CC5 + 493C586246816757936B4A8B66598D6A4290625A7B5E477F5B457B5F4B785B4E + 715846685C44685848685C4B6352455B583D5761435B614A624B28523C183F53 + 3B585F49655C4A60594B62594A62574D655851695148604A3D5A513F65503E67 + 493B5B4A39584B38614B3B684C345D572F515E39583B3D620C3B6A1F49813251 + 73202F3C2C29443A4667243337030B00020D0E0C1F0D041600080C0E12020D1B + 091335304F2837572536403232472E2E452F344B4744775052933E4F7F3F3660 + 142923153B3038425D504A7B5A5A8D4F4A80404E6E45466F4948854B52875454 + 8A4E4B7F535F84333C6D4A447049467527546D42446B164467727E9611091B76 + 6D7AC5B8CDB3A5B9B3A5B9ADA6B9AEA8BCB2ABBEAFA9BDAEA7BCAEA8BCB5AABF + B1A7BDB3A8BDAFA9BCB0A8BEADA7BAB2ABBDAEA7BAB0A7BBB1A7BCB0A7BBB0A7 + BDB3A9BFB0A5BBADA2B8B2A7BDB0A5B7ADA6B8ACA4B8AFA7B9A8A2B4ADA3B8AA + A1B5ABA2B6A9A1B4ABA1B6A6A1B0A49DADA59EAEA19EAD9C96A59992A19D96A6 + 9991A19F95A69B95A69F98AAA398ADA196ABA396A9A299AC9993A69694A39997 + A79E99AA9A98A89E9BADA09DB3A5A1B6A09EB1A1A0B19F9DAFA6A0B0A29CADA9 + A2B4A59DAEA8A2B1A59DADA49EAEA49BABAA9DAFA69AAAA299A8A59BA9A8A0AD + A19DADA8A1B2A8A2B3AEA9B8ADA8B7ACA4B5AFA8B9B3AAB9B3A8B6B0A5B5C5B8 + C579717A00000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000030202493F4F00001342360640004B152F31 + 1837453318652A2B472F2C553027593228582C4053322C523B24572C2E4F2C2F + 45312A502A2C453032452E2A443A31493E344E342F472B203730243730283331 + 252F3A2334311D3519223226273629222B2B1E2638252F2A2731332739432640 + 382C3B292A33302B3830304315263919263A2B314C272B42232B45253151201D + 281E09031D07121A061B220C1A22150B0413000612182A234631395525315C23 + 2F531E2529241F2F180C3C25132A2B28300026300F29311D1B372B2748383259 + 282A461D252C1B253F292A2C202840112047333E4D2C325E15264E080D002614 + 193231481B24522B283E352C3B2B426E1B0D1C433F45726C7869636E6A657066 + 667166656D66636C68666F67627167647169646F69636E6A636E67646D67636E + 69667068626F65636F68616D65606A66606C6A667169636F66636D64616D6560 + 6B69606B67636E696470635D68645D6967616D645E6A68636C615C68635D6A5F + 5A64645D67635D685F5D665C576354545D56555D55565F52586157535B5C5662 + 5856625B58635D575F54545A56575F5A57615E5B665C59605F5C645A58625C5B + 685A5D68605E6A62606B5D5C685D5B63605C65615C66645F6766626B625E675D + 58625E5962625D675E5A645D5A635F5961635F67665F6A656069615D6764626B + 68656F69636D67626B69646C6C646B69646A7771794644480000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000424D3E000000000000003E000000280000005C0100002C00000001000100 + 00000000900700000000000000000000000000000000000000000000FFFFFF00 + 8000000000000000000001000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxPSdxLCLnk.dcu b/official/x.35/Lib/D11/dxPSdxLCLnk.dcu new file mode 100644 index 00000000..3f8136b0 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSdxLCLnk.dcu differ diff --git a/official/x.35/Lib/D11/dxPSdxLCLnkD11.bpl b/official/x.35/Lib/D11/dxPSdxLCLnkD11.bpl new file mode 100644 index 00000000..644b6417 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSdxLCLnkD11.bpl differ diff --git a/official/x.35/Lib/D11/dxPSdxLCLnkD11.dcp b/official/x.35/Lib/D11/dxPSdxLCLnkD11.dcp new file mode 100644 index 00000000..2ca0846e Binary files /dev/null and b/official/x.35/Lib/D11/dxPSdxLCLnkD11.dcp differ diff --git a/official/x.35/Lib/D11/dxPSdxLCLnkD11.dcu b/official/x.35/Lib/D11/dxPSdxLCLnkD11.dcu new file mode 100644 index 00000000..de96f65b Binary files /dev/null and b/official/x.35/Lib/D11/dxPSdxLCLnkD11.dcu differ diff --git a/official/x.35/Lib/D11/dxPSdxLCLnkReg.dcu b/official/x.35/Lib/D11/dxPSdxLCLnkReg.dcu new file mode 100644 index 00000000..a73d41be Binary files /dev/null and b/official/x.35/Lib/D11/dxPSdxLCLnkReg.dcu differ diff --git a/official/x.35/Lib/D11/dxPSdxMVLnk.dfm b/official/x.35/Lib/D11/dxPSdxMVLnk.dfm new file mode 100644 index 00000000..b0ba45d0 --- /dev/null +++ b/official/x.35/Lib/D11/dxPSdxMVLnk.dfm @@ -0,0 +1,832 @@ +object dxMVReportLinkDesignWindow: TdxMVReportLinkDesignWindow + Left = 386 + Top = 219 + BorderStyle = bsDialog + Caption = 'dxMVReportLinkDesignWindow' + ClientHeight = 414 + ClientWidth = 597 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 5 + Width = 589 + Height = 373 + ActivePage = tshColors + TabOrder = 0 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = '&Options' + object Bevel11: TBevel + Left = 40 + Top = 13 + Width = 242 + Height = 4 + Shape = bsBottomLine + end + object imgShow: TImage + Left = 9 + Top = 34 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblShow: TLabel + Left = 6 + Top = 8 + Width = 26 + Height = 13 + Caption = 'Show' + end + object Bevel16: TBevel + Left = 90 + Top = 102 + Width = 193 + Height = 4 + Shape = bsBottomLine + end + object chbxShowGrid: TCheckBox + Tag = 3 + Left = 90 + Top = 119 + Width = 173 + Height = 17 + Caption = '&Grid' + TabOrder = 3 + OnClick = ShowClick + end + object chbxShowGroupFooterGrid: TCheckBox + Tag = 5 + Left = 90 + Top = 163 + Width = 173 + Height = 17 + Caption = 'Group Footers Grid' + TabOrder = 5 + OnClick = ShowClick + end + object chbxShowHeaders: TCheckBox + Left = 90 + Top = 31 + Width = 173 + Height = 17 + Caption = '&Headers' + TabOrder = 0 + OnClick = ShowClick + end + object chbxShowFooters: TCheckBox + Tag = 1 + Left = 90 + Top = 53 + Width = 173 + Height = 17 + Caption = 'Foo&ters' + TabOrder = 1 + OnClick = ShowClick + end + object chbxShowPreviewGrid: TCheckBox + Tag = 4 + Left = 90 + Top = 141 + Width = 173 + Height = 17 + Caption = 'Nodes Grid' + TabOrder = 4 + OnClick = ShowClick + end + object chbxShowExpandButtons: TCheckBox + Tag = 12 + Left = 90 + Top = 75 + Width = 173 + Height = 17 + Caption = 'ExpandButtons' + TabOrder = 2 + OnClick = ShowClick + end + object lblPreviewWindow: TStaticText + Left = 295 + Top = 0 + Width = 88 + Height = 12 + AutoSize = False + Caption = 'Preview' + TabOrder = 6 + end + end + object tshColors: TTabSheet + Caption = '&Color' + object lblGridLineColor: TLabel + Left = 11 + Top = 304 + Width = 74 + Height = 13 + Caption = '&Grid Line color :' + end + object bvlGridLineColorHolder: TBevel + Left = 129 + Top = 299 + Width = 152 + Height = 22 + Visible = False + end + object lblDrawMode: TLabel + Left = 8 + Top = 21 + Width = 58 + Height = 13 + Caption = 'Draw &Mode:' + FocusControl = cbxDrawMode + end + object gbxFixedTransparent: TGroupBox + Left = 6 + Top = 164 + Width = 283 + Height = 126 + Caption = ' ' + TabOrder = 4 + object lblHeaderColor: TLabel + Left = 5 + Top = 49 + Width = 71 + Height = 13 + Caption = '&Header color : ' + end + object lblFooterColor: TLabel + Left = 5 + Top = 75 + Width = 65 + Height = 13 + Caption = 'Footer color :' + end + object bvlHeaderColorHolder: TBevel + Left = 123 + Top = 44 + Width = 152 + Height = 22 + Visible = False + end + object bvlFooterColorHolder: TBevel + Left = 123 + Top = 70 + Width = 152 + Height = 22 + Visible = False + end + object lblGroupNodeColor: TLabel + Left = 5 + Top = 101 + Width = 87 + Height = 13 + Caption = 'Group&Node color :' + end + object bvlGroupNodeColorHolder: TBevel + Left = 123 + Top = 96 + Width = 152 + Height = 22 + Visible = False + end + object lblLevelCaptionColor: TLabel + Left = 5 + Top = 23 + Width = 100 + Height = 13 + Caption = 'CaptionNode Color : ' + end + object bvlCaptionColorHolder: TBevel + Left = 123 + Top = 18 + Width = 152 + Height = 22 + Visible = False + end + end + object gbxTransparent: TGroupBox + Left = 6 + Top = 53 + Width = 283 + Height = 104 + Caption = ' ' + TabOrder = 2 + object lblColor: TLabel + Left = 5 + Top = 23 + Width = 29 + Height = 13 + Caption = 'C&olor:' + end + object bvlColorHolder: TBevel + Left = 123 + Top = 18 + Width = 152 + Height = 22 + Visible = False + end + object lblPreviewColor: TLabel + Left = 5 + Top = 77 + Width = 71 + Height = 13 + Caption = '&Preview color :' + end + object bvlPreviewColorHolder: TBevel + Tag = 1 + Left = 123 + Top = 72 + Width = 152 + Height = 22 + Visible = False + end + object lblEvenColor: TLabel + Left = 5 + Top = 47 + Width = 59 + Height = 13 + Caption = 'Even Color :' + end + object bvlEvenColorHolder: TBevel + Left = 123 + Top = 43 + Width = 152 + Height = 22 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 17 + Top = 51 + Width = 15 + Height = 17 + Caption = ' Tr&ansparent ' + TabOrder = 1 + OnClick = chbxTransparentClick + end + object chbxFixedTransparent: TCheckBox + Tag = 1 + Left = 17 + Top = 163 + Width = 15 + Height = 17 + Caption = ' Fi&xed transparent ' + TabOrder = 3 + OnClick = chbxTransparentClick + end + object cbxDrawMode: TComboBox + Left = 89 + Top = 15 + Width = 193 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 0 + OnClick = cbxDrawModeClick + OnDrawItem = cbxDrawModeDrawItem + Items.Strings = ( + 'Simpe' + 'Odd\Even Rows Mode' + 'Borrow From Source') + end + object stTransparent: TStaticText + Left = 32 + Top = 52 + Width = 76 + Height = 17 + Caption = ' &Transparent ' + FocusControl = chbxTransparent + TabOrder = 5 + OnClick = stTransparentClick + end + object stFixedTransparent: TStaticText + Left = 32 + Top = 164 + Width = 98 + Height = 17 + Caption = ' Fixed Transparent ' + FocusControl = chbxFixedTransparent + TabOrder = 6 + OnClick = stFixedTransparentClick + end + end + object tshFonts: TTabSheet + Caption = '&Font' + object btnChangeFont: TButton + Left = 6 + Top = 170 + Width = 116 + Height = 23 + Caption = 'Change Fo&nt ...' + TabOrder = 1 + OnClick = btnChangeFontClick + end + object lbxFonts: TListBox + Left = 6 + Top = 15 + Width = 282 + Height = 148 + Style = lbOwnerDrawFixed + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ItemHeight = 16 + MultiSelect = True + ParentFont = False + ParentShowHint = False + PopupMenu = pmChangeFont + ShowHint = True + TabOrder = 0 + OnClick = lbxFontsClick + OnDblClick = lbxFontsDblClick + OnDrawItem = lbxFontsDrawItem + OnKeyDown = lbxFontsKeyDown + OnMouseMove = lbxFontsMouseMove + end + end + object tshBehaviors: TTabSheet + Caption = '&Behaviors' + object Bevel12: TBevel + Left = 57 + Top = 12 + Width = 228 + Height = 4 + Shape = bsBottomLine + end + object Bevel13: TBevel + Left = 92 + Top = 83 + Width = 192 + Height = 4 + Shape = bsBottomLine + end + object imgSelection: TImage + Left = 9 + Top = 30 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object imgNodeExpanding: TImage + Left = 9 + Top = 104 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 7778800000000000000000000000078888888888880000000000000000000000 + 007880FFF7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7FF777777FFF77777FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F8F7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7F7F8888FF7F88888FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F8F7777777777777777777078888888888880F7F7F888FFF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F0788077777777777777777777770788C8888C88880F7FF888888FFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880F0F7777777FFFFFFFFFFFF0788CCCCCCCC880F77777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7F7F8888FF7F88888FF7 + F0788077777777777777777777770788C8888C88880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F7F7F8888FF7F888888F7 + F0788077777777777777777777770788CCCC8CC8880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCCCCCC880F7FF88888FFFFFFFFFFF7 + F07880F0F777777FFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F77777777777777777777 + F078800000000000000000000000078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F888888880F88888888888078888888888880F77777777777777777777 + F07880F877778880F87777777778078888888888880F77777777777777777777 + F07880FFFFFFFFF0FFFFFFFFFFFF078888888888880FFFFFFFFFFFFFFFFFFFFF + F078800000000000000000000000088888888888880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblSelection: TLabel + Left = 6 + Top = 8 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object lblExpanding: TLabel + Left = 6 + Top = 79 + Width = 78 + Height = 13 + Caption = 'Node Expanding' + end + object lblRefinements: TLabel + Left = 7 + Top = 215 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlGraphic: TBevel + Left = 76 + Top = 220 + Width = 208 + Height = 4 + Shape = bsBottomLine + end + object imgGraphics: TImage + Left = 9 + Top = 241 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FF7FFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF777777F + F07DD0F77777777FF7FF70888FFF07DDCCCCCCCCDD0F77777777FF7FF7FFFF7F + F07DD0FFFFFFFFFFF7FF70FF8FFF07DDCCCCDCCDDD0FFFFFFFFFFF7FF7F00F7F + F07DD0F777777FFFF7FF70FF8FFF07DDCDDDDCDDDD0F777777FFFF7FF7F00F7F + F07DD0FFFFFFFFFFF7FF70000FFF07DDDDDDDDDDDD0FFFFFFFFFFF7FF7FFFF7F + F07DD0F77777777FF7FF777777FF07DDDDDDDDDDDD0F77777777FF7FF777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFCCCCCFFF07DDCCCCCCCCDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FCCCCCCCFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F7777777FFF7FFCCCCCFFF07DDCDDDDCDDDD0F7777777FFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7F9999999FF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F777777777F7FF99999FFF07DDDDDDDDDDDD0F777777777F7F7777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F80000888887F88888888707DDDDDDDDDDDD0F80000888887F88888888 + 707DD0F80000000087F80000008707DDDDDDDDDDDD0F80000000087F80000008 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0FFFFFFFFFFF7FFFFFFFFF707DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + 707DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblLookAndFeel: TLabel + Left = 6 + Top = 148 + Width = 67 + Height = 13 + Caption = 'Look And Feel' + end + object img3DEffects: TImage + Left = 9 + Top = 172 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D08777777777780877777788807DCCCCDCCDDD0877777777778787777788 + 8F07D08888888888880888888888807DCCCCCCCCDD0888888888888788888888 + 8F07D00000000000000000000000007DCCCCDCCDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F7777777FF07DDDDDDDDDDD0F777777777FF7F7777777 + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F777777FFF07DDDDDDDDDDD0F777777FFFFF7F777777F + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F7777777777F7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F77777FFFF07DDDDDDDDDDD0F77777777FFF7F77777FF + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D00000000000000000000000007DCDDDDCDDDD0000000000000000000000 + 0007D08888888888880888888888807DCCCCDCCDDD0777777777777777777777 + 7707D08888888888880888888888807DCCCCCCCCDD0F88888888888788888888 + 8707D08000000008880880000000807DCCCCDCCDDD0F00000000888788000000 + 8707D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + F707D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object Bevel15: TBevel + Left = 83 + Top = 152 + Width = 200 + Height = 4 + Shape = bsBottomLine + end + object chbxTransparentColumnGraphic: TCheckBox + Tag = 7 + Left = 90 + Top = 239 + Width = 188 + Height = 17 + Caption = 'Transparent Column &Graphics' + TabOrder = 5 + OnClick = ShowClick + end + object chbxDisplayGraphicsAsText: TCheckBox + Tag = 8 + Left = 90 + Top = 261 + Width = 188 + Height = 17 + Caption = 'Display Graphics As &Text' + TabOrder = 6 + OnClick = ShowClick + end + object chbxOnlySelected: TCheckBox + Left = 90 + Top = 31 + Width = 188 + Height = 17 + Caption = 'Only &selected' + TabOrder = 0 + OnClick = chbxOnlySelectedClick + end + object chbxExtendedSelect: TCheckBox + Left = 90 + Top = 53 + Width = 188 + Height = 17 + Caption = '&Extended select' + TabOrder = 1 + OnClick = chbxExtendedSelectClick + end + object chbxAutoNodesExpand: TCheckBox + Left = 90 + Top = 102 + Width = 188 + Height = 17 + Caption = '&Auto Node Expanded' + TabOrder = 2 + OnClick = chbxAutoNodesExpandClick + end + object chbxUse3DEffects: TCheckBox + Tag = 9 + Left = 90 + Top = 171 + Width = 188 + Height = 17 + Caption = '&Use 3D Effects' + TabOrder = 3 + OnClick = ShowClick + end + object chbxUseSoft3D: TCheckBox + Tag = 10 + Left = 90 + Top = 193 + Width = 188 + Height = 17 + Caption = 'Soft &3D' + TabOrder = 4 + OnClick = ShowClick + end + object chbxCheckMarksAsText: TCheckBox + Tag = 11 + Left = 90 + Top = 305 + Width = 173 + Height = 17 + Caption = 'Display CheckMarks as Text' + TabOrder = 8 + OnClick = ShowClick + end + object chbxFlatCheckMarks: TCheckBox + Tag = 6 + Left = 90 + Top = 283 + Width = 173 + Height = 17 + Caption = 'Flat Check &Marks' + TabOrder = 7 + OnClick = ShowClick + end + end + object tshPreview: TTabSheet + Caption = 'Preview' + ImageIndex = 4 + object lblPreviewLineCount: TLabel + Left = 90 + Top = 82 + Width = 99 + Height = 13 + Caption = 'Preview &Line Count: ' + end + object bvlPreviewLineCountHolder: TBevel + Left = 193 + Top = 78 + Width = 81 + Height = 21 + Visible = False + end + object lblPreview: TLabel + Left = 6 + Top = 8 + Width = 38 + Height = 13 + Caption = 'Preview' + end + object Bevel1: TBevel + Left = 52 + Top = 13 + Width = 226 + Height = 4 + Shape = bsBottomLine + end + object imgPreview: TImage + Left = 9 + Top = 30 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDD7777777777777777777777777DDDDDD0000000000000000000000000 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F888F7FF888F7F8888F7F07DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F0 + 7DDDDDD0F777777777777777777777F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCFFCCCCFFCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCFCCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCFCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCFCCFCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCFFCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F777777777777777777777F07DDDDDD0F7F888F7FF888F7FF888F7F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F88887F888887F888887F07DDDDDD0F7F00087F000087F000087F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0000000000000000000000000 + DDDD} + Transparent = True + end + object chbxShowPreview: TCheckBox + Tag = 2 + Left = 90 + Top = 31 + Width = 97 + Height = 17 + Caption = 'Pre&view' + TabOrder = 0 + OnClick = ShowClick + end + object chbxAutoCalcPreviewLines: TCheckBox + Left = 90 + Top = 53 + Width = 169 + Height = 17 + Caption = '&Auto Calc Preview Lines' + TabOrder = 1 + OnClick = chbxAutoCalcPreviewLinesClick + end + end + end + object pnlPreview: TPanel + Left = 303 + Top = 44 + Width = 281 + Height = 324 + BevelInner = bvLowered + BevelOuter = bvNone + Color = clWindow + TabOrder = 1 + object dxMVPreview: TdxMasterView + Left = 5 + Top = 5 + Width = 271 + Height = 313 + Enabled = False + TabOrder = 0 + Visible = False + OptionsView = [movAutoColumnWidth, movHideFocusRect, movHideSelection, movKeepColumnWidths, movTransparentDragAndDrop, movUseBitmap, movUseBitmapToDrawPreview] + ScrollBars = sbNone + object mvsCaptionStyle: TdxMasterViewStyle + end + object mvsContentStyle: TdxMasterViewStyle + end + object mvsFooterStyle: TdxMasterViewStyle + end + object mvsGroupStyle: TdxMasterViewStyle + end + object mvsHeaderStyle: TdxMasterViewStyle + end + object mvsPreviewStyle: TdxMasterViewStyle + end + object mvsAnotherContentStyle: TdxMasterViewStyle + end + end + end + object pmChangeFont: TPopupMenu + OnPopup = pmChangeFontPopup + Left = 4 + Top = 383 + object miChangeFont: TMenuItem + Caption = 'Change Fo&nt ...' + Default = True + ShortCut = 16454 + OnClick = btnChangeFontClick + end + end +end diff --git a/official/x.35/Lib/D11/dxPSdxOCLnk.dfm b/official/x.35/Lib/D11/dxPSdxOCLnk.dfm new file mode 100644 index 00000000..890ff015 --- /dev/null +++ b/official/x.35/Lib/D11/dxPSdxOCLnk.dfm @@ -0,0 +1,170 @@ +object dxOCReportLinkDesignWindow: TdxOCReportLinkDesignWindow + Left = 518 + Top = 415 + ActiveControl = chbxFullExpand + BorderStyle = bsDialog + Caption = 'Report Designer' + ClientHeight = 293 + ClientWidth = 552 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 4 + Width = 544 + Height = 254 + ActivePage = tshOptions + MultiLine = True + TabOrder = 0 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = '&Options' + object pnlOptions: TPanel + Left = 0 + Top = 0 + Width = 536 + Height = 226 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblPreview: TLabel + Left = 241 + Top = 2 + Width = 38 + Height = 13 + Caption = 'Preview' + end + object chbxFullExpand: TCheckBox + Left = 17 + Top = 10 + Width = 216 + Height = 17 + Caption = 'Full &Expand' + TabOrder = 0 + OnClick = chbxFullExpandClick + end + object gbxTransparent: TGroupBox + Left = 5 + Top = 43 + Width = 231 + Height = 56 + Caption = ' ' + TabOrder = 2 + object lblColor: TLabel + Left = 7 + Top = 26 + Width = 35 + Height = 13 + Caption = 'Co&lor : ' + OnClick = lblColorClick + end + object bvlColorHolder: TBevel + Left = 86 + Top = 22 + Width = 138 + Height = 21 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 17 + Top = 41 + Width = 15 + Height = 17 + TabOrder = 1 + OnClick = chbxTransparentClick + end + object gbxBorder: TGroupBox + Left = 5 + Top = 109 + Width = 231 + Height = 56 + Caption = ' ' + TabOrder = 4 + object lblGridLinesColor: TLabel + Left = 7 + Top = 26 + Width = 67 + Height = 13 + Caption = '&Border Color: ' + OnClick = lblColorClick + end + object bvlLineColorHolder: TBevel + Left = 86 + Top = 22 + Width = 138 + Height = 21 + Visible = False + end + end + object chbxDrawBorder: TCheckBox + Left = 17 + Top = 107 + Width = 15 + Height = 17 + TabOrder = 3 + OnClick = chbxDrawBorderClick + end + object stTransparent: TStaticText + Left = 32 + Top = 42 + Width = 76 + Height = 17 + Caption = ' &Transparent ' + FocusControl = chbxTransparent + TabOrder = 5 + OnClick = stTransparentClick + end + object stDrawBorder: TStaticText + Left = 32 + Top = 108 + Width = 70 + Height = 17 + Caption = ' Draw Border ' + FocusControl = chbxDrawBorder + TabOrder = 6 + OnClick = stDrawBorderClick + end + end + end + end + object pnlPreview: TPanel + Left = 250 + Top = 46 + Width = 290 + Height = 201 + BevelInner = bvLowered + BevelOuter = bvNone + Color = clWindow + TabOrder = 1 + object ocPreview: TdxOrgChart + Left = 6 + Top = 5 + Width = 279 + Height = 192 + DefaultImageAlign = iaLT + BorderStyle = bsNone + Options = [ocDblClick, ocEdit, ocCanDrag, ocShowDrag, ocRect3D] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Visible = False + Items = { + 000001005A000000FFFFFF1F01000200011600436F72706F7261746520486561 + 647175617274657273020050000000FFFFFF1F0100010001130053616C657320 + 616E64204D61726B6574696E67010050000000FFFFFF1F010003000117004669 + 656C64204F66666963653A2043616E6164610D0A09000050000000FFFFFF1F01 + 000000010B00456E67696E656572696E670000} + end + end +end diff --git a/official/x.35/Lib/D11/dxPSdxTLLnk.dfm b/official/x.35/Lib/D11/dxPSdxTLLnk.dfm new file mode 100644 index 00000000..d68ed744 --- /dev/null +++ b/official/x.35/Lib/D11/dxPSdxTLLnk.dfm @@ -0,0 +1,1468 @@ +object dxTLReportLinkDesignWindow: TdxTLReportLinkDesignWindow + Left = 485 + Top = 220 + BorderStyle = bsDialog + Caption = 'dxTLReportLinkDesigner' + ClientHeight = 434 + ClientWidth = 582 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 4 + Top = 4 + Width = 574 + Height = 395 + ActivePage = tshColors + TabOrder = 0 + OnChange = PageControl1Change + object tshOptions: TTabSheet + Caption = '&Options' + object Bevel11: TBevel + Left = 46 + Top = 13 + Width = 221 + Height = 4 + Shape = bsBottomLine + end + object imgShow: TImage + Left = 9 + Top = 35 + Width = 32 + Height = 32 + Center = True + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888888888888888888888888888888 + 8888888888000000000000000000000888888888880FFFFFFFFFFFFFFFFFFFC8 + 8C888888880F77777700000077777FCC8CC88888880F77777777777777777FCC + CCCC8888880FFFFFFFFFFFFFFFFFFFCC8CC88888880F77777777777777777FC8 + 8C888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000FFF7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F0000000F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F77777777777777777F08 + 88888888880F7FFFFF7FFFFFFFFF7F0888888888880F7F000F7F00000F0F7F08 + 88888888880F7FFFFF7FFFFFFFFF7F08888888C888CF77777777777777777F08 + 88888CC8CCCFFFFFFFFFFFFFFFFFFF088888CCCCCCCF70000000770000007F08 + 88888CC8CCCF77777777777777777F08888888C888CFFFFFFFFFFFFFFFFFFF08 + 8888888888000000000000000000000888888888888888888888888888888888 + 8888888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblShow: TLabel + Left = 6 + Top = 9 + Width = 26 + Height = 13 + Caption = 'Show' + end + object Bevel16: TBevel + Left = 89 + Top = 107 + Width = 178 + Height = 4 + Shape = bsBottomLine + end + object bvlShowImages: TBevel + Left = 89 + Top = 223 + Width = 178 + Height = 4 + Shape = bsBottomLine + end + object Bevel2: TBevel + Left = 89 + Top = 164 + Width = 178 + Height = 3 + Shape = bsBottomLine + end + object Bevel10: TBevel + Left = 90 + Top = 282 + Width = 177 + Height = 4 + Shape = bsBottomLine + end + object Image1: TImage + Left = 9 + Top = 303 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00888888888888888888888888888888888777777777777777708888888888 + 888887FFFFFFFFFFFFFFF08888888888888887F7777777777777F07777708888 + 888887F7777777777777F0FFFFF08888888887F7777777777777F07777F07777 + 708887FFFFFFFFFFFFFFF07777F0FFFFF08887F777777777777FF07777F07777 + F08887FFFFFFFFFFFFFFF0FFFFF07777F08887F77777777777FFF077FFF07777 + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777777FFFFF0777FF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F777777FFFFFFFF07FFFF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF0777FF0777F + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777FFFF077FFF07FFF + F08887FFFFFFFFFFFFFFF0FFFFF0FFFFF08887F7777777777777F077FFF077FF + F08887F7777777777777F0FFFFF0FFFFF08887F7777777777777F0FFFFF07FFF + F08887FFFFFFFFFFFFFFF07777F0FFFFF0888000000000000000007777F077FF + F08888888887F7777777777777F0FFFFF08888888887FFFFFFFFFFFFFFF07777 + F0888888888000000000000000007777F08888888888888887F7777777777777 + F08888888888888887FFFFFFFFFFFFFFF0888888888888888000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblOnEveryPage: TLabel + Left = 8 + Top = 278 + Width = 72 + Height = 13 + Caption = 'On Every Page' + end + object chbxShowGrid: TCheckBox + Tag = 6 + Left = 90 + Top = 177 + Width = 165 + Height = 17 + Caption = '&Grid Lines' + TabOrder = 6 + OnClick = chbxShowClick + end + object chbxShowNodeGrid: TCheckBox + Tag = 5 + Left = 90 + Top = 198 + Width = 165 + Height = 17 + Caption = 'Node Grid Lines' + TabOrder = 7 + OnClick = chbxShowClick + end + object chbxShowBands: TCheckBox + Left = 90 + Top = 23 + Width = 165 + Height = 17 + Caption = 'Ba&nds' + TabOrder = 0 + OnClick = chbxShowClick + end + object chbxShowHeaders: TCheckBox + Tag = 1 + Left = 90 + Top = 43 + Width = 165 + Height = 17 + Caption = '&Headers' + TabOrder = 1 + OnClick = chbxShowClick + end + object chbxShowFooters: TCheckBox + Tag = 2 + Left = 90 + Top = 64 + Width = 165 + Height = 17 + Caption = 'Foo&ters' + TabOrder = 2 + OnClick = chbxShowClick + end + object chbxShowGroupFooters: TCheckBox + Tag = 3 + Left = 90 + Top = 84 + Width = 165 + Height = 17 + Caption = 'G&roup Footers' + TabOrder = 3 + OnClick = chbxShowClick + end + object chbxShowStateImages: TCheckBox + Tag = 9 + Left = 90 + Top = 236 + Width = 165 + Height = 17 + Caption = 'State Images' + TabOrder = 8 + OnClick = chbxShowClick + end + object chbxShowImages: TCheckBox + Tag = 8 + Left = 90 + Top = 256 + Width = 165 + Height = 17 + Caption = 'Images' + TabOrder = 9 + OnClick = chbxShowClick + end + object chbxShowExpandButtons: TCheckBox + Tag = 17 + Left = 90 + Top = 119 + Width = 165 + Height = 17 + Caption = 'Expand Buttons' + TabOrder = 4 + OnClick = chbxShowClick + end + object chbxShowTreeLines: TCheckBox + Tag = 16 + Left = 90 + Top = 140 + Width = 165 + Height = 17 + Caption = 'TreeLines' + TabOrder = 5 + OnClick = chbxShowClick + end + object chbxBandsOnEveryPage: TCheckBox + Left = 90 + Top = 300 + Width = 165 + Height = 17 + Caption = 'Ba&nds On Every Page' + TabOrder = 10 + OnClick = chbxBandsOnEveryPageClick + end + object chbxHeadersOnEveryPage: TCheckBox + Left = 90 + Top = 322 + Width = 165 + Height = 17 + Caption = 'Headers On Every &Page' + TabOrder = 11 + OnClick = chbxHeadersOnEveryPageClick + end + object chbxFootersOnEveryPage: TCheckBox + Left = 90 + Top = 344 + Width = 165 + Height = 17 + Caption = 'Footers On E&very Page' + TabOrder = 12 + OnClick = chbxFootersOnEveryPageClick + end + object lblPreviewWindow: TStaticText + Left = 279 + Top = 0 + Width = 82 + Height = 14 + AutoSize = False + Caption = 'Preview' + TabOrder = 13 + end + end + object tshColors: TTabSheet + Caption = '&Color' + object lblGridlineColor: TLabel + Left = 9 + Top = 296 + Width = 74 + Height = 13 + Caption = '&Grid Line color :' + OnClick = lblColorClick + end + object bvlGridLineColorHolder: TBevel + Left = 122 + Top = 291 + Width = 145 + Height = 22 + Visible = False + end + object bvlTreeLineColorHolder: TBevel + Left = 122 + Top = 320 + Width = 145 + Height = 22 + end + object lblTreeLineColor: TLabel + Left = 9 + Top = 325 + Width = 78 + Height = 13 + Caption = 'TreeLines Color:' + end + object lblDrawMode: TLabel + Left = 7 + Top = 21 + Width = 58 + Height = 13 + Caption = 'Draw &Mode:' + FocusControl = cbxDrawMode + OnClick = lblDrawModeClick + end + object gbxFixedTransparent: TGroupBox + Left = 4 + Top = 162 + Width = 269 + Height = 121 + Caption = ' ' + TabOrder = 4 + object lblBandColor: TLabel + Left = 5 + Top = 23 + Width = 60 + Height = 13 + Caption = '&Band color : ' + OnClick = lblColorClick + end + object lblHeaderColor: TLabel + Left = 5 + Top = 47 + Width = 71 + Height = 13 + Caption = '&Header color : ' + OnClick = lblColorClick + end + object lblRowFooterColor: TLabel + Left = 5 + Top = 96 + Width = 94 + Height = 13 + Caption = 'Gro&upFooter color :' + OnClick = lblColorClick + end + object bvlBandColorHolder: TBevel + Tag = 2 + Left = 118 + Top = 17 + Width = 145 + Height = 22 + Visible = False + end + object bvlHeaderColorHolder: TBevel + Left = 118 + Top = 42 + Width = 145 + Height = 22 + Visible = False + end + object bvlRowFooterColorHolder: TBevel + Left = 118 + Top = 92 + Width = 145 + Height = 22 + Visible = False + end + object lblGroupNodeColor: TLabel + Left = 5 + Top = 72 + Width = 87 + Height = 13 + Caption = 'Group&Node color :' + OnClick = lblColorClick + end + object bvlGroupNodeColorHolder: TBevel + Left = 118 + Top = 67 + Width = 145 + Height = 22 + Visible = False + end + end + object gbxTransparent: TGroupBox + Left = 4 + Top = 51 + Width = 269 + Height = 104 + Caption = ' ' + TabOrder = 2 + object lblColor: TLabel + Left = 5 + Top = 23 + Width = 29 + Height = 13 + Caption = 'C&olor:' + OnClick = lblColorClick + end + object bvlColorHolder: TBevel + Left = 118 + Top = 18 + Width = 145 + Height = 22 + Visible = False + end + object lblPreviewColor: TLabel + Left = 5 + Top = 77 + Width = 71 + Height = 13 + Caption = '&Preview color :' + OnClick = lblColorClick + end + object bvlPreviewColorHolder: TBevel + Tag = 1 + Left = 118 + Top = 72 + Width = 145 + Height = 22 + Visible = False + end + object lblEvenColor: TLabel + Left = 5 + Top = 47 + Width = 59 + Height = 13 + Caption = 'Even Color :' + OnClick = lblColorClick + end + object bvlEvenColorHolder: TBevel + Left = 118 + Top = 43 + Width = 145 + Height = 22 + Visible = False + end + end + object chbxTransparent: TCheckBox + Left = 15 + Top = 49 + Width = 15 + Height = 17 + Caption = ' Tr&ansparent ' + TabOrder = 1 + OnClick = chbxTransparentClick + end + object chbxFixedTransparent: TCheckBox + Tag = 1 + Left = 15 + Top = 160 + Width = 15 + Height = 17 + TabOrder = 3 + OnClick = chbxTransparentClick + end + object cbxDrawMode: TComboBox + Left = 104 + Top = 15 + Width = 169 + Height = 25 + Style = csOwnerDrawFixed + ItemHeight = 19 + TabOrder = 0 + OnChange = cbxDrawModeChange + OnDrawItem = cbxDrawModeDrawItem + Items.Strings = ( + 'Simpe' + 'Odd\Even Rows Mode' + 'Borrow From Source') + end + object stTransparent: TStaticText + Left = 30 + Top = 50 + Width = 76 + Height = 17 + Caption = ' &Transparent ' + FocusControl = chbxTransparent + TabOrder = 5 + OnClick = stTransparentClick + end + object stFixedTransparent: TStaticText + Left = 30 + Top = 161 + Width = 98 + Height = 17 + Caption = ' Fixed Transparent ' + FocusControl = chbxFixedTransparent + TabOrder = 6 + OnClick = stFixedTransparentClick + end + end + object tshFonts: TTabSheet + Caption = '&Font' + object btnChangeFont: TButton + Left = 6 + Top = 189 + Width = 116 + Height = 23 + Caption = 'Change Fo&nt ...' + TabOrder = 0 + OnClick = btnChangeFontClick + end + object lbxFonts: TListBox + Left = 6 + Top = 16 + Width = 268 + Height = 167 + Style = lbOwnerDrawFixed + ItemHeight = 16 + MultiSelect = True + ParentShowHint = False + PopupMenu = pmChangeFont + ShowHint = True + TabOrder = 1 + OnClick = lbxFontsClick + OnDblClick = lbxFontsDblClick + OnDrawItem = lbxFontsDrawItem + OnKeyDown = FontsKeyDown + OnMouseMove = FontsMouseMove + end + end + object tshBehaviors: TTabSheet + Caption = '&Behaviors' + object Bevel12: TBevel + Left = 57 + Top = 13 + Width = 210 + Height = 4 + Shape = bsBottomLine + end + object Bevel13: TBevel + Left = 63 + Top = 85 + Width = 204 + Height = 4 + Shape = bsBottomLine + end + object Image3: TImage + Left = 9 + Top = 33 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 77788000000000000000000000000788C8888C88880000000000000000000000 + 00788088888887888888888888880788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788088888887887777778888880788CCCCCCCC880F77777777777777777777 + F0788087777787887777777777880788CCCC8CC8880F7FFF77777FF77777FFF7 + F0788088888887888888888888880788C8888C88880F77777777777777777777 + F078807777777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F00000F7FF0000000000FF078888888888880F7F8888888888F7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F078808888888788888888888888078888888888880F7F888888888FF7F888F7 + F0788087777887887777777788880788C8888C88880F7FFFFFFFFFFFF7FFFFF7 + F0788088888887888888888888880788CCCC8CC8880F77777777777777777777 + F0788077777777777777777777770788CCCCCCCC880F7F888888888FF7F888F7 + F0788088888887888888888888880788CCCC8CC8880F7FFFFFFFFFFFF7FFFFF7 + F0788087777787887777777788880788C8888C88880F77777777777777777777 + F078808888888788888888888888078888888888880F7F8888888888F7F888F7 + F078807777777777777777777777078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F0000FF7FF0000000000FF078888888888880F7F888888888FF7F888F7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F078807777777777777777777777078888888888880F77777777777777777777 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F7F888888888FF7F888F7 + F07880F00000F7FF0000000000FF078888888888880F7FFFFFFFFFFFF7FFFFF7 + F07880FFFFFFF7FFFFFFFFFFFFFF078888888888880F77777777777777777777 + F0788000000000000000000000000788C8888C88880FFFFFFFFFFFFFFFFFFFFF + F07880F8888880F88888888888880788CCCC8CC8880F77777777777777777777 + F07880F8000080F80000008888880788CCCCCCCC880F77777777777777777777 + F07880FFFFFFF0FFFFFFFFFFFFFF0788CCCC8CC8880FFFFFFFFFFFFFFFFFFFFF + F0788000000000000000000000000888C8888C88880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object Image4: TImage + Left = 9 + Top = 104 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00887777777777777777777777778888888888888777777777777777777777 + 7778800000000000000000000000078888888888880000000000000000000000 + 007880FFF7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7FF777777FFF77777FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7777777777777777777078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F8F7FFFFF7FFFFFFFFFFFF078888888888880F77777777777777777777 + F07880F8F7F777F7F777777777FF078888888888880F7F7F8888FF7F88888FF7 + F07880FFF7FFFFF7FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F8F7777777777777777777078888888888880F7F7F888FFF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F777777777777777777 + F0788077777777777777777777770788C8888C88880F7FF888888FFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880F0F7777777FFFFFFFFFFFF0788CCCCCCCC880F77777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCC8CC8880F7F7F8888FF7F88888FF7 + F0788077777777777777777777770788C8888C88880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF078888888888880F7F7F8888FF7F888888F7 + F07880F0F7777777FFFFFFFFFFFF078888888888880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F7F7F8888FF7F888888F7 + F0788077777777777777777777770788CCCC8CC8880F7F777777777777777777 + F07880FFFFFFFFFFFFFFFFFFFFFF0788CCCCCCCC880F7FF88888FFFFFFFFFFF7 + F07880F0F777777FFFFFFFFFFFFF0788CCCC8CC8880F7FFFFFFFFFFFFFFFFFF7 + F07880FFFFFFFFFFFFFFFFFFFFFF0788C8888C88880F77777777777777777777 + F078800000000000000000000000078888888888880FFFFFFFFFFFFFFFFFFFFF + F07880F888888880F88888888888078888888888880F77777777777777777777 + F07880F800008880F80000000008078888888888880F77777777777777777777 + F07880FFFFFFFFF0FFFFFFFFFFFF078888888888880FFFFFFFFFFFFFFFFFFFFF + F078800000000000000000000000088888888888880000000000000000000000 + 0088888888888888888888888888888888888888888888888888888888888888 + 8888} + Transparent = True + end + object lblExpandLevel: TLabel + Left = 90 + Top = 124 + Width = 68 + Height = 13 + Caption = 'Expand &level: ' + OnClick = lblExpandLevelClick + end + object bvlExpandLevelHolder: TBevel + Left = 210 + Top = 122 + Width = 58 + Height = 21 + Visible = False + end + object lblSelection: TLabel + Left = 6 + Top = 9 + Width = 43 + Height = 13 + Caption = 'Selection' + end + object lblExpanding: TLabel + Left = 6 + Top = 81 + Width = 50 + Height = 13 + Caption = 'Expanding' + end + object lblRefinements: TLabel + Left = 7 + Top = 225 + Width = 60 + Height = 13 + Caption = 'Refinements' + end + object bvlRefinements: TBevel + Left = 73 + Top = 230 + Width = 194 + Height = 4 + Shape = bsBottomLine + end + object imgRefinements: TImage + Left = 9 + Top = 248 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD777777777777777777777777DDDDDDDDDDDDD777777777777777777777 + 777DD0000000000000000000000007DDDDDDDDDDDD0000000000000000000000 + 007DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFF99999FF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F77777777FF7FCC99999FF07DDCCCCCCCCDD0F77777777FF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FCC99999FF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F777777FFFF7FCC99999FF07DDCDDDDCDDDD0F777777FFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FCC99999FF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F77777777FF7FCCCCCFFFF07DDDDDDDDDDDD0F77777777FF7F7777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0FFFFFFFFFFF7FFFFFFFFFF07DDCDDDDCDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFCCCCCFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFCCCCCCCF07DDCCCCCCCCDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFFCCCCCFF07DDCCCCDCCDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F7777777FFF7FF9999999F07DDCDDDDCDDDD0F7777777FFF7FFFFFFFFF + F07DD0FFFFFFFFFFF7FFF99999FF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0F777777777F7FFFFFFFFFF07DDDDDDDDDDDD0F777777777F7F7777777F + F07DD0FFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + F07DD0777777777777777777777707DDDDDDDDDDDD0777777777777777777777 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0F80000888887F88888888707DDDDDDDDDDDD0F80000888887F88888888 + 707DD0F80000000087F80000008707DDDDDDDDDDDD0F80000000087F80000008 + 707DD0F88888888887F88888888707DDDDDDDDDDDD0F88888888887F88888888 + 707DD0FFFFFFFFFFF7FFFFFFFFF707DDDDDDDDDDDD0FFFFFFFFFFF7FFFFFFFFF + 707DD000000000000000000000000DDDDDDDDDDDDD0000000000000000000000 + 00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object lblLookAndFeel: TLabel + Left = 6 + Top = 152 + Width = 67 + Height = 13 + Caption = 'Look And Feel' + end + object Image8: TImage + Left = 9 + Top = 174 + Width = 64 + Height = 32 + Picture.Data = { + 07544269746D617076040000424D760400000000000076000000280000004000 + 0000200000000100040000000000000400000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DD7777777777777777777777777DDDDDDDDDDDD777777777777777777777 + 7777D00000000000000000000000007DDDDDDDDDDD0000000000000000000000 + 0007D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D08777777777780877777788807DCCCCDCCDDD0877777777778787777788 + 8F07D08888888888880888888888807DCCCCCCCCDD0888888888888788888888 + 8F07D00000000000000000000000007DCCCCDCCDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F7777777FF07DDDDDDDDDDD0F777777777FF7F7777777 + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F777777FFF07DDDDDDDDDDD0F777777FFFFF7F777777F + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F7777777777F7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F77777777FFF7F77777FFFF07DDDDDDDDDDD0F77777777FFF7F77777FF + FF07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D07777777777777777777777707DDDDDDDDDDD0777777777777777777777 + 7707D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D0F777777FFFFF7F77777777F07DDDDDDDDDDD0F777777FFFFF7F7777777 + 7F07D0FFFFFFFFFFFF7FFFFFFFFFF07DDDDDDDDDDD0FFFFFFFFFFFF7FFFFFFFF + FF07D00000000000000000000000007DCDDDDCDDDD0000000000000000000000 + 0007D08888888888880888888888807DCCCCDCCDDD0777777777777777777777 + 7707D08888888888880888888888807DCCCCCCCCDD0F88888888888788888888 + 8707D08000000008880880000000807DCCCCDCCDDD0F00000000888788000000 + 8707D08888888888880888888888807DCDDDDCDDDD0FFFFFFFFFFFF7FFFFFFFF + F707D0000000000000000000000000DDDDDDDDDDDD0000000000000000000000 + 000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object Bevel15: TBevel + Left = 82 + Top = 156 + Width = 185 + Height = 4 + Shape = bsBottomLine + end + object chbxTransparentColumnGraphic: TCheckBox + Tag = 10 + Left = 90 + Top = 246 + Width = 179 + Height = 17 + Caption = 'Transparent &Graphics' + TabOrder = 5 + OnClick = chbxShowClick + end + object chbxDisplayGraphicsAsText: TCheckBox + Tag = 11 + Left = 90 + Top = 268 + Width = 179 + Height = 17 + Caption = 'Display Graphics As &Text' + TabOrder = 6 + OnClick = chbxShowClick + end + object chbxOnlySelected: TCheckBox + Left = 90 + Top = 31 + Width = 179 + Height = 17 + Caption = 'Only &selected' + TabOrder = 0 + OnClick = chbxOnlySelectedClick + end + object chbxExtendedSelect: TCheckBox + Left = 90 + Top = 53 + Width = 179 + Height = 17 + Caption = '&Extended select' + TabOrder = 1 + OnClick = chbxExtendedSelectClick + end + object chbxAutoNodesExpand: TCheckBox + Left = 90 + Top = 98 + Width = 179 + Height = 17 + Caption = '&Auto Node Expanded' + TabOrder = 2 + OnClick = chbxAutoNodesExpandClick + end + object chbxUse3DEffects: TCheckBox + Tag = 12 + Left = 90 + Top = 172 + Width = 179 + Height = 17 + Caption = '&Use 3D Effects' + TabOrder = 3 + OnClick = chbxShowClick + end + object chbxUseSoft3D: TCheckBox + Tag = 13 + Left = 90 + Top = 194 + Width = 179 + Height = 17 + Caption = 'Soft &3D' + TabOrder = 4 + OnClick = chbxShowClick + end + object chbxCheckMarksAsText: TCheckBox + Tag = 15 + Left = 90 + Top = 312 + Width = 179 + Height = 17 + Caption = 'Display Check Marks as Text' + TabOrder = 8 + OnClick = chbxShowClick + end + object chbxFlatCheckMarks: TCheckBox + Tag = 7 + Left = 90 + Top = 290 + Width = 179 + Height = 17 + Caption = 'Flat Check &Marks' + TabOrder = 7 + OnClick = chbxShowClick + end + end + object tshPreview: TTabSheet + Caption = 'Preview' + object Bevel9: TBevel + Left = 54 + Top = 13 + Width = 213 + Height = 4 + Shape = bsBottomLine + end + object lblPreviewLineCount: TLabel + Left = 90 + Top = 69 + Width = 99 + Height = 13 + Caption = 'Preview &Line Count: ' + OnClick = lblExpandLevelClick + end + object bvlPreviewLineCountHolder: TBevel + Left = 196 + Top = 66 + Width = 67 + Height = 21 + Visible = False + end + object lblPreview: TLabel + Left = 6 + Top = 9 + Width = 38 + Height = 13 + Caption = 'Preview' + end + object imgPreview: TImage + Left = 9 + Top = 33 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDD7777777777777777777777777DDDDDD0000000000000000000000000 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F888F7FF888F7F8888F7F07DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F0 + 7DDDDDD0F777777777777777777777F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCFFCCCCFFCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCFCCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCFCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCFCCFCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCFFCCCFCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F7FCCCCCCCCCCCCCCCCCF7F07DDDDDD0F7FFFFFFFFFFFFFFFFFFF7F0 + 7DDDDDD0F777777777777777777777F07DDDDDD0F7F888F7FF888F7FF888F7F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0F7F88887F888887F888887F07DDDDDD0F7F00087F000087F000087F0 + 7DDDDDD0F7FFFFF7FFFFFF7FFFFFF7F07DDDDDD0F777777777777777777777F0 + 7DDDDDD0FFFFFFFFFFFFFFFFFFFFFFF07DDDDDD0000000000000000000000000 + DDDD} + Transparent = True + end + object chbxShowPreview: TCheckBox + Tag = 4 + Left = 90 + Top = 23 + Width = 169 + Height = 17 + Caption = 'Pre&view' + TabOrder = 0 + OnClick = chbxShowClick + end + object chbxAutoCalcPreviewLines: TCheckBox + Left = 90 + Top = 43 + Width = 169 + Height = 17 + Caption = '&Auto Calc Preview Lines' + TabOrder = 1 + OnClick = chbxAutoCalcPreviewLinesClick + end + end + end + object pnlPreview: TPanel + Left = 287 + Top = 44 + Width = 282 + Height = 343 + BevelInner = bvLowered + BevelOuter = bvNone + Color = clWindow + Ctl3D = True + ParentCtl3D = False + TabOrder = 1 + object dxTLPreview: TdxTreeList + Left = 7 + Top = 4 + Width = 268 + Height = 330 + Bands = < + item + Caption = 'Item Data' + Width = 201 + end> + DefaultLayout = False + HeaderPanelRowCount = 1 + BorderStyle = bsNone + Ctl3D = True + Enabled = False + ParentCtl3D = False + TabOrder = 0 + Visible = False + Images = ilTLImages + LookAndFeel = lfFlat + Options = [aoColumnSizing, aoColumnMoving, aoEditing, aoTabThrough, aoRowSelect, aoPreview, aoAutoWidth] + OptionsEx = [aoBandHeaderWidth, aoAutoCalcPreviewLines, aoBandSizing, aoBandMoving, aoDragScroll, aoDragExpand] + PaintStyle = psOutlook + StateImages = ilTLImages + TreeLineColor = clGrayText + ScrollBars = ssNone + ShowBands = True + ShowButtons = False + ShowGrid = True + ShowRowFooter = True + ShowFooter = True + OnCustomDrawBand = dxTLPreviewCustomDrawBand + OnCustomDrawColumnHeader = dxTLPreviewCustomDrawColumnHeader + OnCustomDrawCell = dxTLPreviewCustomDrawCell + OnCustomDrawFooterNode = dxTLPreviewCustomDrawFooterNode + OnCustomDrawFooter = dxTLPreviewCustomDrawFooter + OnCustomDrawPreviewCell = dxTLPreviewCustomDrawPreviewCell + OnGetFooterCellText = dxTLPreviewGetFooterCellText + OnGetPreviewLineCount = dxTLPreviewGetPreviewLineCount + OnGetPreviewText = dxTLPreviewGetPreviewText + OnIsExistRowFooterCell = dxTLPreviewIsExistRowFooterCell + OnIsExistFooterCell = dxTLPreviewIsExistFooterCell + OnIsLevelFooter = dxTLPreviewIsLevelFooter + Data = { + FFFFFFFF03000000180000000000000000000000010000000000000000000000 + 020000000D0000004E6F6465203120436F6C2023310D0000004E6F6465203120 + 436F6C2023331800000000000000000000000100000000000000020000000200 + 00000D0000004E6F6465203220436F6C20233104000000547275651800000000 + 0000000000000001000000000000000000000002000000090000005375624E6F + 6465203100000000180000000000000000000000010000000000000000000000 + 01000000090000005375624E6F64652032180000000000000000000000010000 + 000000000001000000020000000D0000004E6F6465203320436F6C2023310400 + 0000547275651800000000000000000000000100000000000000000000000200 + 0000090000005375624E6F64652033090000005375624E6F64652033} + object dxTLPreviewColumn1: TdxTreeListColumn + Alignment = taLeftJustify + Width = 117 + BandIndex = 0 + RowIndex = 0 + end + object dxTLPreviewColumn3: TdxTreeListCheckColumn + Caption = 'Axisymmetric' + Width = 83 + BandIndex = 0 + RowIndex = 0 + OnCustomDrawCell = dxTLPreviewColumn3CustomDrawCell + AllowGrayed = True + ShowNullFieldStyle = nsInactive + ValueChecked = 'True' + ValueUnchecked = 'False' + end + object dxTLPreviewColumn4: TdxTreeListImageColumn + Alignment = taLeftJustify + Caption = 'Shape' + MinWidth = 16 + Width = 68 + BandIndex = 0 + RowIndex = 0 + OnCustomDrawCell = dxTLPreviewColumn4CustomDrawCell + Images = ilTLImages + ImageIndexes.Strings = ( + '0' + '1' + '2' + '3' + '4' + '5' + '6') + Values.Strings = ( + '' + '' + '2' + '3' + '4' + '5' + '6') + end + end + end + object ilTLImages: TImageList + Left = 5 + Top = 404 + Bitmap = { + 494C010107000A00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FF000000000000008400000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FF000000FF000000FF000000000000008400000084000000840000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF00000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF000000000000008400000084000000840000008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF00000000000000FF0000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FF000000FF000000FF00 + 0000FF000000FF000000FF000000000000008400000084000000840000008400 + 0000840000008400000000000000000000000000000000000000FF000000FF00 + 0000FF00000000000000FF000000FF000000FF00000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF00000000000000FF000000FF00 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FF000000FF00 + 0000FF000000FF000000FF000000000000008400000084000000840000008400 + 0000840000000000000000000000000000000000000000000000FF000000FF00 + 0000FF00000000000000FF000000FF000000FF00000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF00000000000000FF000000FF00 + 0000FF0000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF000000000000008400000084000000840000008400 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000000084000000000000008400FF000000FF000000000000000000 + 0000000000000000000000000000000000000000000000000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF00000000000000FF000000FF00 + 0000FF000000FF00000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF000000000000008400000084000000840000008400 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000000084000000840000000000000084000000840000008400000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FF0000008400 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FF000000FF000000FF000000000000008400000084000000840000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000000000008400 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FF000000FF000000000000008400000084000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000840000008400000084000000000000008400000084000000 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000FF000000FF000000FF000000FF000000FF00000084000000840000000000 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FF000000FF000000000000008400000084000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000008400000084000000840000000000000084000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FF000000FF000000FF000000FF00000084000000840000008400 + 0000000000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FF000000000000008400000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FF000000FF0000008400000084000000840000008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FF0000008400000084000000840000008400 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000084000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008484840000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FF00000084000000FF00000084000000840000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FF000000FF000000FF00000084000000FF000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000840000008400000084000000FF000000840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000848484008484840084848400C6C6C60084848400000000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF000000FF0000008400000084000000000000008400 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF00000084000000FF00000084000000840000000000 + 0000000000000000000000000000000000000000000000000000000000000084 + 000000840000FFFFFF0000FF0000FFFFFF0000FF000000840000008400000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 840084848400FFFFFF00C6C6C600FFFFFF00C6C6C60084848400848484000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF00000084000000FF00000084000000840000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF000000FF0000008400000084000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 0000FFFFFF0000FF0000FFFFFF0000FF000000FF000000840000008400000084 + 000000000000000000000000000000000000000000000000000084848400C6C6 + C600FFFFFF00C6C6C600FFFFFF00C6C6C600C6C6C60084848400848484008484 + 840000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF00000084000000FF0000008400000084000000840000008400 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF00000084000000FF00000084000000840000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF0000FF0000FFFFFF0000FF0000FFFFFF0000FF000000840000008400000084 + 000000840000000000000000000000000000000000000000000084848400FFFF + FF00C6C6C600FFFFFF00C6C6C600FFFFFF00C6C6C60084848400848484008484 + 840084848400000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF00000084000000FF00000084000000840000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF000000FF0000008400000084000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 0000FFFFFF00FFFFFF0000FF000000FF000000FF000000840000008400000084 + 000000840000000000000000000000000000000000000000000084848400C6C6 + C600FFFFFF00FFFFFF00C6C6C600C6C6C600C6C6C60084848400848484008484 + 840084848400000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF000000FF0000008400000084000000000000008400 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FF000000FF000000FF00000084000000FF00000084000000840000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF0000FF000000FF000000FF000000FF000000FF000000FF0000008400000084 + 000000840000000000000000000000000000000000000000000084848400FFFF + FF00C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600848484008484 + 840084848400000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF00000084000000FF00000084000000840000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FF000000FF000000FF000000FF0000008400000000000000840000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF00000084 + 000000840000000000000000000000000000000000000000000084848400C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6008484 + 840084848400000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF00000084000000FF0000008400000084000000840000008400 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FF000000FF000000FF0000008400000084000000000000000000 + 00000000000000000000000000000000000000000000000000000084000000FF + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF00000084 + 000000840000000000000000000000000000000000000000000084848400C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6008484 + 840084848400000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF00000084000000FF00000084000000840000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FF000000FF000000FF0000008400000084000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000084 + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF + 0000008400000084000000000000000000000000000000000000000000008484 + 8400C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6 + C60084848400848484000000000000000000000000000000000000000000FF00 + 0000FF0000000000000000000000000000000000000000000000000000008400 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FF000000FF0000008400000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000084000000FF000000FF000000FF000000FF000000FF0000008400000084 + 0000000000000000000000000000000000000000000000000000000000000000 + 000084848400C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600848484008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 000000000000FF000000FF000000FF000000FF000000FF000000FF0000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FF000000FF0000008400000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000084000000FF000000FF00000084000000840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000084848400C6C6C600C6C6C6008484840084848400000000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF0000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000840000008400000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084848400848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FF000000FF000000FF000000FF000000FF000000FF0000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFF0000FC7F003FFFFF0000 + F01F7FDF803F0000C0077FEF801F000000010077800F00000001003B80070000 + 8003003D80030000C007400180010000C007401D80010000E00F600DC0010000 + F01F7001E0010000F01FB805F0010000F83FDC0DF8010000FC7FEDFDFC010000 + FC7FF5FDFE010000FEFFF801FFFF0000FFFFFFFFFFFFFFFFFFFFFFFFF81FF83F + FF3FFF3FE007E00FF81FF81FC003C007E00FE00FC003C007C007C007C003C007 + C003C003C003C007C003C003C003E00FC003C003C003E00FC003C003C003F01F + C003C003C003F01FE003E003C003F83FF00FF00FC003F83FF83FF83FC003FC7F + FCFFFCFFE007FC7FFFFFFFFFF81FFEFF00000000000000000000000000000000 + 000000000000} + end + object pmChangeFont: TPopupMenu + OnPopup = pmChangeFontPopup + Left = 33 + Top = 404 + object miChangeFont: TMenuItem + Caption = 'Change Fo&nt ...' + Default = True + ShortCut = 16454 + OnClick = btnChangeFontClick + end + end +end diff --git a/official/x.35/Lib/D11/dxPSfmAutoHFTextFmt.dcu b/official/x.35/Lib/D11/dxPSfmAutoHFTextFmt.dcu new file mode 100644 index 00000000..27f33b52 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSfmAutoHFTextFmt.dcu differ diff --git a/official/x.35/Lib/D11/dxPSfmAutoHFTextFmt.dfm b/official/x.35/Lib/D11/dxPSfmAutoHFTextFmt.dfm new file mode 100644 index 00000000..3e65a5ec --- /dev/null +++ b/official/x.35/Lib/D11/dxPSfmAutoHFTextFmt.dfm @@ -0,0 +1,128 @@ +object dxfmAutoText: TdxfmAutoText + Left = 467 + Top = 306 + BorderStyle = bsDialog + Caption = 'AutoText' + ClientHeight = 358 + ClientWidth = 394 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object gbxEnterAutoTextEntriesHere: TGroupBox + Left = 4 + Top = 4 + Width = 387 + Height = 317 + Caption = ' Enter A&utoText Entries Here: ' + TabOrder = 0 + object lblPreview: TLabel + Left = 9 + Top = 215 + Width = 38 + Height = 13 + Caption = 'Preview' + end + object ToolBar: TToolBar + Left = 9 + Top = 176 + Width = 275 + Height = 30 + Align = alNone + ButtonHeight = 24 + ButtonWidth = 25 + EdgeBorders = [ebLeft, ebTop, ebRight, ebBottom] + EdgeInner = esLowered + ParentShowHint = False + ShowHint = True + TabOrder = 3 + end + object btnAdd: TButton + Left = 289 + Top = 20 + Width = 90 + Height = 23 + Caption = '&Add' + Default = True + TabOrder = 1 + OnClick = btnAddClick + end + object btnDelete: TButton + Left = 289 + Top = 47 + Width = 90 + Height = 23 + Caption = '&Delete' + TabOrder = 2 + OnClick = btnDeleteClick + end + object cbxAutoEntries: TComboBox + Left = 9 + Top = 20 + Width = 274 + Height = 154 + Style = csSimple + ItemHeight = 13 + Sorted = True + TabOrder = 0 + OnChange = NewAutoTextChange + OnClick = AutoEntriesClick + OnEnter = cbxAutoEntriesEnter + OnExit = cbxAutoEntriesExit + OnKeyDown = NewAutoTextKeyDown + end + object Panel1: TPanel + Left = 9 + Top = 231 + Width = 370 + Height = 76 + BevelOuter = bvNone + Color = clWindow + TabOrder = 4 + object pbxPreview: TPaintBox + Left = 0 + Top = 0 + Width = 370 + Height = 76 + Align = alClient + Color = clBtnFace + ParentColor = False + OnPaint = pbxPreviewPaint + end + end + end + object btnOK: TButton + Left = 146 + Top = 329 + Width = 79 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 229 + Top = 329 + Width = 79 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object btnHelp: TButton + Left = 312 + Top = 329 + Width = 79 + Height = 23 + Caption = '&Help' + TabOrder = 3 + end +end diff --git a/official/x.35/Lib/D11/dxPSfmCompositionAdd.dcu b/official/x.35/Lib/D11/dxPSfmCompositionAdd.dcu new file mode 100644 index 00000000..80675358 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSfmCompositionAdd.dcu differ diff --git a/official/x.35/Lib/D11/dxPSfmCompositionAdd.dfm b/official/x.35/Lib/D11/dxPSfmCompositionAdd.dfm new file mode 100644 index 00000000..6d8daf64 --- /dev/null +++ b/official/x.35/Lib/D11/dxPSfmCompositionAdd.dfm @@ -0,0 +1,110 @@ +object dxfmCompositionAddItems: TdxfmCompositionAddItems + Left = 426 + Top = 382 + ActiveControl = lvItems + BorderStyle = bsDialog + Caption = 'Add Items to Composition' + ClientHeight = 381 + ClientWidth = 329 + Color = clBtnFace + Constraints.MinHeight = 250 + Constraints.MinWidth = 337 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object btnOK: TButton + Left = 87 + Top = 352 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 168 + Top = 352 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object btnHelp: TButton + Left = 249 + Top = 352 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = '&Help' + TabOrder = 3 + end + object pgctrlItems: TPageControl + Left = 5 + Top = 7 + Width = 319 + Height = 339 + ActivePage = tshItems + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + TabStop = False + object tshItems: TTabSheet + Caption = 'Available Items' + object lvItems: TListView + Left = 0 + Top = 0 + Width = 311 + Height = 280 + Align = alTop + Anchors = [akLeft, akTop, akRight, akBottom] + Columns = <> + ColumnClick = False + MultiSelect = True + ReadOnly = True + TabOrder = 0 + OnDblClick = lvItemsDblClick + end + object pnlNoItems: TPanel + Tag = 20 + Left = 19 + Top = 33 + Width = 277 + Height = 22 + BevelOuter = bvNone + Caption = 'There are no Items do Display' + Color = clWindow + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnShadow + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + TabOrder = 1 + end + object chbxHideIncludedItems: TCheckBox + Left = 2 + Top = 287 + Width = 303 + Height = 17 + Anchors = [akLeft, akRight, akBottom] + Caption = 'Hide Already Included Items' + Checked = True + State = cbChecked + TabOrder = 2 + OnClick = chbxHideIncludedItemsClick + end + end + end +end diff --git a/official/x.35/Lib/D11/dxPSfmCompositionDsg.dcu b/official/x.35/Lib/D11/dxPSfmCompositionDsg.dcu new file mode 100644 index 00000000..7a9d6be8 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSfmCompositionDsg.dcu differ diff --git a/official/x.35/Lib/D11/dxPSfmCompositionDsg.dfm b/official/x.35/Lib/D11/dxPSfmCompositionDsg.dfm new file mode 100644 index 00000000..07921c6d --- /dev/null +++ b/official/x.35/Lib/D11/dxPSfmCompositionDsg.dfm @@ -0,0 +1,614 @@ +object dxfmCompositionDesignWindow: TdxfmCompositionDesignWindow + Left = 380 + Top = 267 + ActiveControl = lvItems + BorderStyle = bsDialog + Caption = 'Composition Designer' + ClientHeight = 279 + ClientWidth = 454 + Color = clBtnFace + Constraints.MinHeight = 278 + Constraints.MinWidth = 462 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + KeyPreview = True + OldCreateOrder = True + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + OnKeyDown = FormKeyDown + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object btnClose: TButton + Left = 271 + Top = 251 + Width = 86 + Height = 23 + Caption = 'Close' + ModalResult = 1 + TabOrder = 1 + end + object pcItems: TPageControl + Left = 5 + Top = 7 + Width = 444 + Height = 237 + ActivePage = tbsItems + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + TabStop = False + object tbsItems: TTabSheet + Caption = 'Items' + OnResize = tbsItemsResize + object lvItems: TListView + Left = 0 + Top = 0 + Width = 347 + Height = 209 + Align = alLeft + Anchors = [akLeft, akTop, akRight, akBottom] + Columns = <> + ColumnClick = False + DragMode = dmAutomatic + MultiSelect = True + RowSelect = True + PopupMenu = pmItems + TabOrder = 0 + ViewStyle = vsReport + OnChange = lvItemsChange + OnDblClick = DesignerClick + OnEdited = lvItemsEdited + OnEditing = lvItemsEditing + OnDragDrop = lvItemsDragDrop + OnDragOver = lvItemsDragOver + OnStartDrag = lvItemsStartDrag + end + object btnMoveDown: TButton + Left = 353 + Top = 134 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Move Down' + TabOrder = 5 + OnClick = MoveDownClick + end + object btnMoveUp: TButton + Left = 353 + Top = 106 + Width = 79 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Move Up' + TabOrder = 4 + OnClick = MoveUpClick + end + object btnDesign: TButton + Left = 353 + Top = 69 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = 'Desi&gn...' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 3 + OnClick = DesignerClick + end + object btnDelete: TButton + Left = 353 + Top = 32 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Delete...' + TabOrder = 2 + OnClick = DeleteClick + end + object btnAdd: TButton + Left = 353 + Top = 5 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Add...' + TabOrder = 1 + OnClick = AddClick + end + object pnlNoItems: TPanel + Left = 60 + Top = 99 + Width = 248 + Height = 23 + BevelOuter = bvNone + Caption = 'There are no Items to dispay' + Color = clWindow + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnShadow + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + TabOrder = 6 + end + end + end + object btnHelp: TButton + Left = 363 + Top = 251 + Width = 86 + Height = 23 + Caption = '&Help' + TabOrder = 2 + end + object pmItems: TPopupMenu + Images = ilItems + OnPopup = pmItemsPopup + Left = 4 + Top = 248 + object miAdd: TMenuItem + Caption = '&Add...' + ImageIndex = 1 + ShortCut = 45 + OnClick = AddClick + end + object miDelete: TMenuItem + Caption = '&Delete' + ImageIndex = 2 + ShortCut = 46 + OnClick = DeleteClick + end + object N1: TMenuItem + Caption = '-' + end + object miRename: TMenuItem + Caption = 'Rena&me' + ShortCut = 113 + OnClick = RenameClick + end + object miSelectAll: TMenuItem + Caption = 'Select All' + ShortCut = 16449 + OnClick = SelectAllClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miDesign: TMenuItem + Caption = 'Desi&gn...' + Default = True + ImageIndex = 0 + ShortCut = 16397 + OnClick = DesignerClick + end + object miLine1: TMenuItem + Caption = '-' + end + object miMoveUp: TMenuItem + Caption = 'Move &Up' + ImageIndex = 3 + ShortCut = 16422 + OnClick = MoveUpClick + end + object miMoveDown: TMenuItem + Caption = 'Move &Down' + ImageIndex = 4 + ShortCut = 16424 + OnClick = MoveDownClick + end + end + object ilItems: TImageList + Left = 32 + Top = 248 + Bitmap = { + 494C010105000A00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000808000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080000080800000808000008080000080800000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000808000008080000080800000808000008080000080800000808000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000007F7F7F007F7F7F007F7F7F0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F00000000007F7F + 7F007F7F7F000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000007F7F + 7F00000000000000000000000000000000000000000000000000000000000000 + 0000000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F000000 + 00000000000000000000BFBFBF00BFBFBF00BFBFBF0000000000000000000000 + 000000000000000000007F7F7F0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F0000000000BFBF + BF007F7F7F000000000000000000BFBFBF00BFBFBF00000000007F7F7F00BFBF + BF0000000000000000007F7F7F0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F00BFBF + BF007F7F7F00BFBFBF00BFBFBF007F7F7F0000000000BFBFBF007F7F7F007F7F + 7F007F7F7F007F7F7F007F7F7F0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000BFBFBF00BFBFBF0000000000FFFFFF00FFFFFF0000000000BFBFBF000000 + 00000000000000000000000000007F7F7F00000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000BFBFBF000000 + 0000BFBFBF0000000000BFBFBF00BFBFBF00BFBFBF00FFFFFF007F7F7F000000 + 0000BFBFBF00BFBFBF00000000007F7F7F00000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000BFBFBF00BFBF + BF00FFFFFF00000000007F7F7F0000000000BFBFBF00FFFFFF007F7F7F00BFBF + BF00BFBFBF00BFBFBF00000000007F7F7F00000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000000000000000 + 0000FFFFFF00000000007F7F7F007F7F7F00BFBFBF0000000000BFBFBF000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000808000008080000080800000808000008080000080800000808000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000BFBFBF00FFFFFF00000000000000000000000000BFBFBF00BFBFBF000000 + 0000000000007F7F7F000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080000080800000808000008080000080800000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F00BFBF + BF007F7F7F00BFBFBF00FFFFFF00FFFFFF00BFBFBF00BFBFBF007F7F7F007F7F + 7F007F7F7F00000000007F7F7F0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F0000000000BFBF + BF007F7F7F000000000000000000BFBFBF000000000000000000BFBFBF00BFBF + BF00000000007F7F7F000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000808000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F000000 + 00007F7F7F0000000000BFBFBF00BFBFBF00BFBFBF00000000007F7F7F000000 + 00007F7F7F00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000007F7F + 7F0000000000000000000000000000000000000000007F7F7F00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000007F7F7F007F7F7F007F7F7F0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFF000000000000FFFF000000000000 + FFFF000000000000FFFF000000000000FEFF000000000000FC7F000000000000 + F83F000000000000F01F000000000000E00F000000000000C007000000000000 + F83F000000000000F83F000000000000F83F000000000000F83F000000000000 + FFFF000000000000FFFF000000000000FC7FFFFFFFFFFFFFFC27FFFFFFFFFFFF + EC23C007FFF9FFFFC401C007E7FFFFFF8001C007C3F3F83FC001C007C3E7F83F + E000C007E1C7F83F0000C007F08FF83F0000C007F81FC0070003C007FC3FE00F + E003C007F81FF01FC001C007F09FF83F8003C00FC1C7FC7FC407C01F83E3FEFF + EC3FC03F8FF1FFFFFC7FFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxPSfmLnkAdd.dcu b/official/x.35/Lib/D11/dxPSfmLnkAdd.dcu new file mode 100644 index 00000000..27d1f0b3 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSfmLnkAdd.dcu differ diff --git a/official/x.35/Lib/D11/dxPSfmLnkAdd.dfm b/official/x.35/Lib/D11/dxPSfmLnkAdd.dfm new file mode 100644 index 00000000..05de77e4 --- /dev/null +++ b/official/x.35/Lib/D11/dxPSfmLnkAdd.dfm @@ -0,0 +1,500 @@ +object dxfmAddComponent: TdxfmAddComponent + Left = 675 + Top = 331 + BorderStyle = bsDialog + ClientHeight = 457 + ClientWidth = 392 + Color = clBtnFace + Constraints.MinHeight = 400 + Constraints.MinWidth = 400 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Icon.Data = { + 0000010001001010100000000000280100001600000028000000100000002000 + 00000100040000000000C0000000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000 + 00000000000000000000000000000000000000000000000FFFFFFFFF0000000F + FFFFFFFF0000000FFFFFFFFF0000000FFFFFFFFF0000000FFFFFFFFF0000000F + FFFFFFFF0000000FFFFFFFFF0000000FFFFFFFFF0000000FFFFFF0000000000F + FFFFF0F00000000FFFFFF000000000000000000000000000000000000000FFFF + 0000FFFF0000C0070000C0070000C0070000C0070000C0070000C0070000C007 + 0000C0070000C0070000C0070000C00F0000C01F0000C03F0000FFFF0000} + OldCreateOrder = True + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + OnCreate = FormCreate + OnDestroy = FormDestroy + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object pnlHost: TPanel + Left = 6 + Top = 5 + Width = 380 + Height = 417 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + TabOrder = 4 + object pgctrlItems: TPageControl + Left = 0 + Top = 104 + Width = 380 + Height = 313 + ActivePage = tbsItems + Align = alClient + TabOrder = 4 + TabStop = False + object tbsItems: TTabSheet + Caption = '&Available Components' + object pnlBottomHost: TPanel + Left = 0 + Top = 211 + Width = 372 + Height = 74 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + object bvlOnlyUnLinked: TBevel + Left = 0 + Top = 50 + Width = 372 + Height = 24 + Align = alTop + Shape = bsSpacer + end + object bvlHideCustomContainers: TBevel + Left = 0 + Top = 0 + Width = 372 + Height = 26 + Align = alTop + Shape = bsSpacer + end + object bvlOnlyInCurrentModule: TBevel + Left = 0 + Top = 26 + Width = 372 + Height = 24 + Align = alTop + Shape = bsSpacer + end + object chbxOnlyUnLinked: TCheckBox + Left = 7 + Top = 53 + Width = 253 + Height = 17 + Caption = 'Only Components &without Existing ReportLinks' + TabOrder = 2 + OnClick = chbxClick + end + object chbxOnlyInCurrentModule: TCheckBox + Left = 7 + Top = 29 + Width = 258 + Height = 17 + Caption = 'Only Components in the Active &Form' + TabOrder = 1 + OnClick = chbxClick + end + object chbxHideCustomContainers: TCheckBox + Left = 7 + Top = 5 + Width = 253 + Height = 17 + Caption = 'Hide Custom Containers' + TabOrder = 0 + OnClick = chbxClick + end + end + object lvItems: TListView + Left = 0 + Top = 0 + Width = 372 + Height = 211 + Align = alClient + Columns = <> + HideSelection = False + MultiSelect = True + ReadOnly = True + RowSelect = True + PopupMenu = pmItems + TabOrder = 0 + ViewStyle = vsReport + OnChange = lvItemsChange + OnColumnClick = lvItemsColumnClick + OnCompare = lvItemsCompare + OnDblClick = lvItemsDblClick + end + object pnlNoItems: TPanel + Left = 48 + Top = 72 + Width = 266 + Height = 22 + BevelOuter = bvNone + Caption = 'There are no Items in this View' + Color = clWindow + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnShadow + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + TabOrder = 2 + end + end + end + object pnlNameHost: TPanel + Left = 0 + Top = 0 + Width = 380 + Height = 30 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object lblName: TLabel + Left = 6 + Top = 8 + Width = 31 + Height = 13 + Caption = '&Name:' + FocusControl = edName + end + object edName: TEdit + Left = 55 + Top = 5 + Width = 230 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + end + end + object pnlCreatorHost: TPanel + Left = 0 + Top = 60 + Width = 380 + Height = 30 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object lblCreator: TLabel + Left = 6 + Top = 10 + Width = 41 + Height = 13 + Caption = 'Creato&r:' + FocusControl = edCreator + end + object edCreator: TEdit + Left = 55 + Top = 6 + Width = 230 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + end + object btnDescription: TButton + Left = 294 + Top = 6 + Width = 83 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Description...' + TabOrder = 1 + OnClick = btnDescriptionClick + end + end + object pnlSeparatorHost: TPanel + Left = 0 + Top = 90 + Width = 380 + Height = 14 + Align = alTop + BevelOuter = bvNone + TabOrder = 3 + object bvlSeparator: TBevel + Left = 0 + Top = 0 + Width = 380 + Height = 4 + Align = alTop + Shape = bsBottomLine + end + end + object pnlCaptionHost: TPanel + Left = 0 + Top = 30 + Width = 380 + Height = 30 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object lblCaption: TLabel + Left = 6 + Top = 9 + Width = 41 + Height = 13 + Caption = '&Caption:' + FocusControl = edCaption + end + object edCaption: TEdit + Left = 55 + Top = 5 + Width = 230 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + end + end + end + object btnOK: TButton + Left = 68 + Top = 429 + Width = 75 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object btnCancel: TButton + Left = 149 + Top = 429 + Width = 75 + Height = 23 + Cancel = True + Caption = 'OK' + ModalResult = 2 + TabOrder = 1 + end + object btnHelp: TButton + Left = 311 + Top = 429 + Width = 75 + Height = 23 + Caption = 'OK' + TabOrder = 3 + end + object btnDesign: TButton + Left = 230 + Top = 429 + Width = 75 + Height = 23 + Caption = 'OK' + TabOrder = 2 + OnClick = btnDesignClick + end + object ilItems: TImageList + AllocBy = 3 + Left = 2 + Top = 427 + Bitmap = { + 494C010101000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000001000000001002000000000000010 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000007F7F7F007F7F7F007F7F7F0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F00000000007F7F + 7F007F7F7F000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000007F7F + 7F00000000000000000000000000000000000000000000000000000000000000 + 0000000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F000000 + 00000000000000000000BFBFBF00BFBFBF00BFBFBF0000000000000000000000 + 000000000000000000007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F0000000000BFBF + BF007F7F7F000000000000000000BFBFBF00BFBFBF00000000007F7F7F00BFBF + BF0000000000000000007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F00BFBF + BF007F7F7F00BFBFBF00BFBFBF007F7F7F0000000000BFBFBF007F7F7F007F7F + 7F007F7F7F007F7F7F007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000BFBFBF00BFBFBF0000000000FFFFFF00FFFFFF0000000000BFBFBF000000 + 00000000000000000000000000007F7F7F000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000BFBFBF000000 + 0000BFBFBF0000000000BFBFBF00BFBFBF00BFBFBF00FFFFFF007F7F7F000000 + 0000BFBFBF00BFBFBF00000000007F7F7F000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000BFBFBF00BFBF + BF00FFFFFF00000000007F7F7F0000000000BFBFBF00FFFFFF007F7F7F00BFBF + BF00BFBFBF00BFBFBF00000000007F7F7F000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000000000000000 + 0000FFFFFF00000000007F7F7F007F7F7F00BFBFBF0000000000BFBFBF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000BFBFBF00FFFFFF00000000000000000000000000BFBFBF00BFBFBF000000 + 0000000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F00BFBF + BF007F7F7F00BFBFBF00FFFFFF00FFFFFF00BFBFBF00BFBFBF007F7F7F007F7F + 7F007F7F7F00000000007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F0000000000BFBF + BF007F7F7F000000000000000000BFBFBF000000000000000000BFBFBF00BFBF + BF00000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F000000 + 00007F7F7F0000000000BFBFBF00BFBFBF00BFBFBF00000000007F7F7F000000 + 00007F7F7F000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000007F7F + 7F0000000000000000000000000000000000000000007F7F7F00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000007F7F7F007F7F7F007F7F7F0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000100000000100010000000000800000000000000000000000 + 000000000000000000000000FFFFFF00FC7F000000000000FC27000000000000 + EC23000000000000C4010000000000008001000000000000C001000000000000 + E000000000000000000000000000000000000000000000000003000000000000 + E003000000000000C0010000000000008003000000000000C407000000000000 + EC3F000000000000FC7F00000000000000000000000000000000000000000000 + 000000000000} + end + object pmItems: TPopupMenu + Images = ilItems + OnPopup = pmItemsPopup + Left = 30 + Top = 427 + object miAdd: TMenuItem + Caption = '&Add' + Default = True + OnClick = lvItemsDblClick + end + object miLine1: TMenuItem + Caption = '-' + end + object miDesign: TMenuItem + Caption = 'Add and D&esign Report...' + ImageIndex = 0 + OnClick = btnDesignClick + end + end + object ilColumns: TImageList + AllocBy = 2 + Height = 8 + Width = 8 + Left = 58 + Top = 427 + Bitmap = { + 494C010102000400040008000800FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000200000000800000001002000000000000004 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000808080008080 + 8000808080008080800080808000808080000000000000000000000000000000 + 0000808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000000000000000000000000000000000008080 + 8000808080008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800000000000000000000000000000000000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000808080000000000000000000000000000000000080808000808080008080 + 8000808080008080800080808000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000020000000080000000100010000000000200000000000000000000000 + 000000000000000000000000FFFFFF00FFFF0000FFFF000080F70000C1E30000 + E3C10000F7800000FFFF0000FFFF000000000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxPSfmLnkAdde.dcu b/official/x.35/Lib/D11/dxPSfmLnkAdde.dcu new file mode 100644 index 00000000..7b1e4768 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSfmLnkAdde.dcu differ diff --git a/official/x.35/Lib/D11/dxPSfmLnkAdde.dfm b/official/x.35/Lib/D11/dxPSfmLnkAdde.dfm new file mode 100644 index 00000000..c3518f3e --- /dev/null +++ b/official/x.35/Lib/D11/dxPSfmLnkAdde.dfm @@ -0,0 +1,432 @@ +object dxfmAddReportLinkClass: TdxfmAddReportLinkClass + Left = 472 + Top = 300 + BorderStyle = bsDialog + Caption = 'Add Report' + ClientHeight = 463 + ClientWidth = 430 + Color = clBtnFace + Constraints.MinHeight = 350 + Constraints.MinWidth = 438 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Icon.Data = { + 0000010001001010100000000000280100001600000028000000100000002000 + 00000100040000000000C0000000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000 + 00000000000000000000000000000000000000000000000FFFFFFFFF0000000F + FFFFFFFF0000000FFFFFFFFF0000000FFFFFFFFF0000000FFFFFFFFF0000000F + FFFFFFFF0000000FFFFFFFFF0000000FFFFFFFFF0000000FFFFFF0000000000F + FFFFF0F00000000FFFFFF000000000000000000000000000000000000000FFFF + 0000FFFF0000C0070000C0070000C0070000C0070000C0070000C0070000C007 + 0000C0070000C0070000C0070000C00F0000C01F0000C03F0000FFFF0000} + OldCreateOrder = True + Position = poScreenCenter + OnCreate = FormCreate + OnDestroy = FormDestroy + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object btnOK: TButton + Left = 107 + Top = 433 + Width = 75 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object btnCancel: TButton + Left = 188 + Top = 433 + Width = 75 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + object btnHelp: TButton + Left = 350 + Top = 433 + Width = 75 + Height = 23 + Caption = '&Help' + TabOrder = 3 + OnClick = btnHelpClick + end + object btnDesign: TButton + Left = 269 + Top = 433 + Width = 75 + Height = 23 + Caption = 'D&esign...' + TabOrder = 2 + OnClick = btnDesignClick + end + object pnlHost: TPanel + Left = 5 + Top = 3 + Width = 420 + Height = 422 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + TabOrder = 4 + object pnlNameHost: TPanel + Left = 0 + Top = 0 + Width = 420 + Height = 30 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object lblName: TLabel + Left = 6 + Top = 7 + Width = 31 + Height = 13 + Caption = '&Name:' + FocusControl = edName + end + object edName: TEdit + Left = 55 + Top = 4 + Width = 271 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + end + end + object pnlCaptionHost: TPanel + Left = 0 + Top = 30 + Width = 420 + Height = 30 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object lblCaption: TLabel + Left = 6 + Top = 9 + Width = 41 + Height = 13 + Caption = '&Caption:' + FocusControl = edCaption + end + object edCaption: TEdit + Left = 55 + Top = 5 + Width = 271 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + end + end + object pnlSeparatorHost: TPanel + Left = 0 + Top = 90 + Width = 420 + Height = 14 + Align = alTop + BevelOuter = bvNone + TabOrder = 3 + object bvlSeparator: TBevel + Left = 0 + Top = 0 + Width = 420 + Height = 4 + Align = alTop + Shape = bsBottomLine + end + end + object pgctrlItems: TPageControl + Left = 0 + Top = 104 + Width = 420 + Height = 318 + ActivePage = tbsItems + Align = alClient + TabOrder = 4 + TabStop = False + object tbsItems: TTabSheet + Caption = ' &Active Report Links ' + object lvItems: TListView + Left = 0 + Top = 0 + Width = 412 + Height = 290 + Align = alClient + Columns = < + item + Caption = 'Supported Component Class(es)' + Width = 200 + end + item + Caption = 'ReportLink Class(es)' + Width = 200 + end> + HideSelection = False + ReadOnly = True + RowSelect = True + PopupMenu = pmLinks + SortType = stText + TabOrder = 0 + ViewStyle = vsReport + OnChange = lvItemsChange + OnColumnClick = lvItemsColumnClick + OnCompare = lvItemsCompare + OnCustomDrawItem = lvItemsCustomDrawItem + OnDblClick = lvItemsDblClick + end + end + end + object pnlCreatorHost: TPanel + Left = 0 + Top = 60 + Width = 420 + Height = 30 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object lblCreator: TLabel + Left = 6 + Top = 9 + Width = 41 + Height = 13 + Caption = 'Creato&r:' + FocusControl = edCreator + end + object edCreator: TEdit + Left = 55 + Top = 5 + Width = 271 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + end + object btnDescription: TButton + Left = 334 + Top = 4 + Width = 83 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Description...' + TabOrder = 1 + OnClick = btnDescriptionClick + end + end + end + object ilLinks: TImageList + AllocBy = 3 + Left = 7 + Top = 429 + Bitmap = { + 494C010101000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000001000000001002000000000000010 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000007F7F7F007F7F7F007F7F7F0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F00000000007F7F + 7F007F7F7F000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000007F7F + 7F00000000000000000000000000000000000000000000000000000000000000 + 0000000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F000000 + 00000000000000000000BFBFBF00BFBFBF00BFBFBF0000000000000000000000 + 000000000000000000007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F0000000000BFBF + BF007F7F7F000000000000000000BFBFBF00BFBFBF00000000007F7F7F00BFBF + BF0000000000000000007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F00BFBF + BF007F7F7F00BFBFBF00BFBFBF007F7F7F0000000000BFBFBF007F7F7F007F7F + 7F007F7F7F007F7F7F007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000BFBFBF00BFBFBF0000000000FFFFFF00FFFFFF0000000000BFBFBF000000 + 00000000000000000000000000007F7F7F000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000BFBFBF000000 + 0000BFBFBF0000000000BFBFBF00BFBFBF00BFBFBF00FFFFFF007F7F7F000000 + 0000BFBFBF00BFBFBF00000000007F7F7F000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000BFBFBF00BFBF + BF00FFFFFF00000000007F7F7F0000000000BFBFBF00FFFFFF007F7F7F00BFBF + BF00BFBFBF00BFBFBF00000000007F7F7F000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000000000000000000000 + 0000FFFFFF00000000007F7F7F007F7F7F00BFBFBF0000000000BFBFBF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000BFBFBF00FFFFFF00000000000000000000000000BFBFBF00BFBFBF000000 + 0000000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F00BFBF + BF007F7F7F00BFBFBF00FFFFFF00FFFFFF00BFBFBF00BFBFBF007F7F7F007F7F + 7F007F7F7F00000000007F7F7F00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F0000000000BFBF + BF007F7F7F000000000000000000BFBFBF000000000000000000BFBFBF00BFBF + BF00000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F000000 + 00007F7F7F0000000000BFBFBF00BFBFBF00BFBFBF00000000007F7F7F000000 + 00007F7F7F000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000007F7F + 7F0000000000000000000000000000000000000000007F7F7F00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000007F7F7F007F7F7F007F7F7F0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000100000000100010000000000800000000000000000000000 + 000000000000000000000000FFFFFF00FC7F000000000000FC27000000000000 + EC23000000000000C4010000000000008001000000000000C001000000000000 + E000000000000000000000000000000000000000000000000003000000000000 + E003000000000000C0010000000000008003000000000000C407000000000000 + EC3F000000000000FC7F00000000000000000000000000000000000000000000 + 000000000000} + end + object pmLinks: TPopupMenu + OnPopup = pmLinksPopup + Left = 35 + Top = 429 + object miSelect: TMenuItem + Caption = '&Add Report' + Default = True + OnClick = lvItemsDblClick + end + object miLine1: TMenuItem + Caption = '-' + end + object miDesign: TMenuItem + Caption = 'Add and D&esign Report...' + OnClick = btnDesignClick + end + end + object ilColumns: TImageList + AllocBy = 2 + Height = 8 + Width = 8 + Left = 63 + Top = 429 + Bitmap = { + 494C010102000400040008000800FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000200000000800000001002000000000000004 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000808080008080 + 8000808080008080800080808000808080000000000000000000000000000000 + 0000808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000000000000000000000000000000000008080 + 8000808080008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800000000000000000000000000000000000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000808080000000000000000000000000000000000080808000808080008080 + 8000808080008080800080808000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000020000000080000000100010000000000200000000000000000000000 + 000000000000000000000000FFFFFF00FFFF0000FFFF000080F70000C1E30000 + E3C10000F7800000FFFF0000FFFF000000000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxPSfmLnkDsg.dcu b/official/x.35/Lib/D11/dxPSfmLnkDsg.dcu new file mode 100644 index 00000000..375ea4cd Binary files /dev/null and b/official/x.35/Lib/D11/dxPSfmLnkDsg.dcu differ diff --git a/official/x.35/Lib/D11/dxPSfmLnkDsg.dfm b/official/x.35/Lib/D11/dxPSfmLnkDsg.dfm new file mode 100644 index 00000000..0f6ec5c9 --- /dev/null +++ b/official/x.35/Lib/D11/dxPSfmLnkDsg.dfm @@ -0,0 +1,938 @@ +object dxfmReportLinkDesignWindow: TdxfmReportLinkDesignWindow + Left = 699 + Top = 105 + BorderStyle = bsDialog + Caption = 'Report Links' + ClientHeight = 343 + ClientWidth = 367 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Icon.Data = { + 0000010001001010100000000000280100001600000028000000100000002000 + 00000100040000000000C0000000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000 + 00000000000000000000000000000FFFFFFFFFF000000F00F00000F000000FFF + FFFFFFF000000F00F00000F000000FFFFFFFFFF000000FFFFFFF0FF000000F00 + FFF080F000000F080F08080000440FF080808088804400000808088888440000 + 008088888844000000088888804400000000000000440000000000000000FFFF + 0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F + 0000000400000000000000000000F8000000FC000000FE040000FFFF0000} + KeyPreview = True + OldCreateOrder = True + OnClose = FormClose + OnKeyDown = FormKeyDown + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object pnlButtons: TPanel + Left = 240 + Top = 0 + Width = 127 + Height = 343 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btnAdd: TButton + Left = 5 + Top = 4 + Width = 98 + Height = 22 + Caption = '&Add...' + TabOrder = 0 + OnClick = AddClick + end + object btnDelete: TButton + Tag = 4 + Left = 5 + Top = 31 + Width = 119 + Height = 22 + Caption = '&Delete' + TabOrder = 2 + OnClick = EditClick + end + object btnShowDesigner: TButton + Left = 5 + Top = 147 + Width = 119 + Height = 22 + Caption = 'Show D&esigner...' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 6 + OnClick = LinkDesignClick + end + object btnSelectAll: TButton + Tag = 6 + Left = 5 + Top = 58 + Width = 119 + Height = 22 + Caption = 'Se&lect All' + TabOrder = 3 + OnClick = EditClick + end + object btnRestoreOriginal: TButton + Left = 5 + Top = 233 + Width = 119 + Height = 22 + Caption = 'Rest&ore Or&iginal' + TabOrder = 9 + OnClick = RestoreOriginalClick + end + object btnChangeComponent: TButton + Tag = 3 + Left = 5 + Top = 174 + Width = 119 + Height = 22 + Caption = 'C&hange Component...' + TabOrder = 7 + OnClick = LinkChangeComponentClick + end + object btnPrintPreview: TButton + Tag = 2 + Left = 5 + Top = 291 + Width = 119 + Height = 22 + Caption = 'Pre&view...' + TabOrder = 11 + OnClick = PrintPreviewClick + end + object btnPrint: TButton + Tag = 3 + Left = 5 + Top = 318 + Width = 119 + Height = 22 + Caption = 'Print...' + TabOrder = 12 + OnClick = PrintClick + end + object btnPageSetup: TButton + Tag = 1 + Left = 5 + Top = 264 + Width = 119 + Height = 22 + Caption = 'Pa&ge Setup...' + TabOrder = 10 + OnClick = PageSetupClick + end + object btnMoveUp: TButton + Left = 5 + Top = 89 + Width = 119 + Height = 22 + Caption = 'Move &Up' + TabOrder = 4 + OnClick = MoveUpClick + end + object btnMoveDown: TButton + Tag = 1 + Left = 5 + Top = 116 + Width = 119 + Height = 22 + Caption = 'Move Dow&n' + TabOrder = 5 + OnClick = MoveDownClick + end + object btnRestoreDefaults: TButton + Left = 5 + Top = 206 + Width = 119 + Height = 22 + Caption = 'Rest&ore Defaults' + TabOrder = 8 + OnClick = RestoreDefaultsClick + end + object btnDropDownMenu: TButton + Left = 103 + Top = 4 + Width = 21 + Height = 22 + Caption = '6' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -19 + Font.Name = 'Marlett' + Font.Style = [] + ParentFont = False + TabOrder = 1 + OnClick = btnDropDownMenuClick + end + end + object lbxLinks: TListBox + Left = 0 + Top = 0 + Width = 240 + Height = 343 + Style = lbOwnerDrawVariable + Align = alClient + Ctl3D = True + DragMode = dmAutomatic + ItemHeight = 16 + MultiSelect = True + ParentCtl3D = False + PopupMenu = pmLinks + TabOrder = 1 + OnClick = lbxLinksClick + OnDblClick = lbxLinksDblClick + OnDragDrop = lbxLinksDragDrop + OnDragOver = lbxLinksDragOver + OnDrawItem = lbxLinksDrawItem + OnEndDrag = lbxLinksEndDrag + OnKeyPress = lbxLinksKeyPress + OnMeasureItem = lbxLinksMeasureItem + OnStartDrag = lbxLinksStartDrag + end + object pmLinks: TPopupMenu + Images = ilLinks + OnPopup = pmLinksPopup + Left = 7 + Top = 6 + object miAdd: TMenuItem + Caption = '&Add...' + ImageIndex = 0 + ShortCut = 45 + OnClick = AddClick + end + object miAddComposition: TMenuItem + Caption = 'Add Composition...' + ImageIndex = 1 + OnClick = AddCompositionClick + end + object miLine7: TMenuItem + Caption = '-' + end + object miAddExisting: TMenuItem + Caption = 'Add Existing' + ShortCut = 32813 + OnClick = AddExistingClick + end + object miAddStandard: TMenuItem + Caption = 'Add Standard Link...' + ShortCut = 16429 + OnClick = AddStandardClick + end + object miLine5: TMenuItem + Caption = '-' + end + object miEdit: TMenuItem + Caption = '&Edit' + object miCut: TMenuItem + Tag = 2 + Caption = 'Cu&t' + ImageIndex = 3 + ShortCut = 16472 + OnClick = EditClick + end + object miCopy: TMenuItem + Tag = 1 + Caption = '&Copy' + ImageIndex = 2 + ShortCut = 16451 + OnClick = EditClick + end + object miPaste: TMenuItem + Tag = 3 + Caption = '&Paste' + ImageIndex = 4 + ShortCut = 16470 + OnClick = EditClick + end + object miDelete: TMenuItem + Tag = 4 + Caption = '&Delete' + ImageIndex = 5 + ShortCut = 46 + OnClick = EditClick + end + object N3: TMenuItem + Caption = '-' + end + object miSelectAll: TMenuItem + Tag = 6 + Caption = 'Se&lect All' + ShortCut = 16449 + OnClick = EditClick + end + end + object N2: TMenuItem + Caption = '-' + end + object miMoveUp: TMenuItem + Caption = 'Move &Up' + ImageIndex = 10 + ShortCut = 16422 + OnClick = MoveUpClick + end + object miMoveDown: TMenuItem + Caption = 'Move Dow&n' + ImageIndex = 11 + ShortCut = 16424 + OnClick = MoveDownClick + end + object miLine1: TMenuItem + Caption = '-' + end + object miShowDesigner: TMenuItem + Caption = 'Show Designer...' + Default = True + ImageIndex = 6 + ShortCut = 16397 + OnClick = LinkDesignClick + end + object miSetAsCurrent: TMenuItem + Caption = '&Make Current' + ShortCut = 16416 + OnClick = SetAsCurrentClick + end + object miChangeComponent: TMenuItem + Caption = 'C&hange Component...' + OnClick = LinkChangeComponentClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miRestoreDefaults: TMenuItem + Caption = 'Rest&ore Defaults' + ShortCut = 16463 + OnClick = RestoreDefaultsClick + end + object miRestoreOriginal: TMenuItem + Caption = 'Rest&ore Or&iginal' + ShortCut = 16457 + OnClick = RestoreOriginalClick + end + object miLine3: TMenuItem + Caption = '-' + end + object miPageSetup: TMenuItem + Tag = 1 + Caption = 'Pa&ge Setup...' + ImageIndex = 7 + OnClick = PageSetupClick + end + object miPrintPreview: TMenuItem + Tag = 2 + Caption = 'Print Pre&view...' + ImageIndex = 8 + OnClick = PrintPreviewClick + end + object miPrint: TMenuItem + Tag = 3 + Caption = '&Print...' + ImageIndex = 9 + ShortCut = 16464 + OnClick = PrintClick + end + object N1: TMenuItem + Caption = '-' + end + object miBackground: TMenuItem + Caption = 'Bac&kground' + object miBackgroundEffects: TMenuItem + Tag = 4 + Caption = 'E&ffects...' + ImageIndex = 12 + OnClick = BackgroundClick + end + object miBackgroundClear: TMenuItem + Tag = 5 + Caption = 'Clear' + OnClick = ClearBackgroundClick + end + end + object miLine: TMenuItem + Caption = '-' + end + object miShowButtons: TMenuItem + Caption = 'Show &Button Bar' + Checked = True + OnClick = ShowButtonsClick + end + end + object ilLinks: TImageList + Left = 63 + Top = 6 + Bitmap = { + 494C01010D000E00040010001000FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000004000000001002000000000000040 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084848400FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084848400FFFF + FF000000000000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484000000 + 00008484840000000000FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400848484008484840000000000FFFFFF00FFFFFF0000FFFF0084848400FFFF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C6C6C600C6C6 + C600C6C6C600848484008484840000000000FFFFFF00FFFFFF00840000008484 + 8400FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00C6C6C600C6C6 + C600C6C6C600C6C6C60084848400848484000000000000FFFF00840000008400 + 0000FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000C6C6C600FFFFFF00FFFFFF00C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084000000840000008400 + 0000FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000C6C6C600FFFFFF00FFFF + FF00C6C6C60000000000C6C6C600C6C6C6008484840084000000840000008400 + 0000FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C6C6C600FFFF + FF00000000008400000000000000C6C6C6008400000084000000840000008484 + 8400FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C600FFFFFF0084000000C6C6C60084848400840000008400000084848400FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000840000000000 + 0000C6C6C60084000000848484000000000084848400FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084000000C6C6 + C60000000000840000000000000084848400FFFFFF0000FFFF00FFFFFF008484 + 8400C6C6C6000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084000000C6C6 + C600C6C6C600840000008484840000FFFF00FFFFFF00FFFFFF00FFFFFF008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484008400 + 0000840000008484840084848400848484008484840084848400848484008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C6000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C60000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000084848400C6C6C600C6C6C6008484 + 84000000000084848400000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C60000FFFF0000FFFF0000FFFF00C6C6C600C6C6 + C600000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000084848400C6C6C600C6C6C600FFFF00008484 + 84008484840000000000000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084848400C6C6C600C6C6 + C60000000000C6C6C60000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848400000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000C6C6C600C6C6C600C6C6C600C6C6C6008484 + 8400C6C6C6000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C600C6C6C600000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000C6C6C600FFFF0000C6C6C600C6C6C6008484 + 8400C6C6C60000000000000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C60000000000C6C6C600000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008484000084840000848400008484000084840000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000084848400FFFF0000FFFF0000C6C6C6008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C60000000000C6C6C60000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000848400008484000084840000848400008484000084840000848400000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000084848400C6C6C600C6C6C6008484 + 840000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000C6C6C60000000000C6C6C600848484000000000000000000000000000000 + 0000848400008484000084840000848400008484000084840000848400000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008484 + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000000000008484000084840000848400008484000084840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000084848400000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + 0000848400000000000000000000848484000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFF00008484 + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848400000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000C6C6C600000000000000 + 0000000000000000000000000000000000000000000084848400000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + 0000848400000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00848484008484 + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000007B7B7B007B7B7B007B7B7B0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000840000008400000084000000840000008400 + 0000840000008400000084000000840000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007B7B7B00000000007B7B + 7B007B7B7B000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00840000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000007B7B + 7B00000000000000000000000000000000000000000000000000000000000000 + 0000000000007B7B7B0000000000000000000000000000000000000000000000 + 0000000000008400000084000000840000008400000084000000000000000000 + 0000000000000000000000000000000000000000000084848400008484008484 + 8400008484008484840084000000FFFFFF008400000084000000840000008400 + 00008400000084000000FFFFFF00840000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007B7B7B000000 + 00000000000000000000BDBDBD00BDBDBD00BDBDBD0000000000000000000000 + 000000000000000000007B7B7B00000000008400000084000000840000008400 + 0000840000008400000084000000840000008400000084000000840000008400 + 0000840000008400000084000000000000000000000000848400848484000084 + 8400848484000084840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00840000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF000000000000000000000000007B7B7B0000000000BDBD + BD007B7B7B000000000000000000BDBDBD00BDBDBD00000000007B7B7B00BDBD + BD0000000000000000007B7B7B00000000008400000084000000840000008400 + 000084000000840000008484840084000000FFFFFF0084000000840000008400 + 0000840000008400000084000000000000000000000084848400008484008484 + 8400008484008484840084000000FFFFFF00840000008400000084000000FFFF + FF00840000008400000084000000840000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF0000000000000000000000000000000000000000007B7B7B00BDBD + BD007B7B7B00BDBDBD00BDBDBD007B7B7B0000000000BDBDBD007B7B7B007B7B + 7B007B7B7B007B7B7B007B7B7B00000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000848400848484000084 + 8400848484000084840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0084000000FFFFFF0084000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000BDBDBD00BDBDBD0000000000FFFFFF00FFFFFF0000000000BDBDBD000000 + 00000000000000000000000000007B7B7B008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000084848400008484008484 + 8400008484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000007B7B7B0000000000BDBDBD000000 + 0000BDBDBD0000000000BDBDBD00BDBDBD00BDBDBD00FFFFFF007B7B7B000000 + 0000BDBDBD00BDBDBD00000000007B7B7B008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000848400848484000084 + 8400848484000084840084000000840000008400000084000000840000008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000007B7B7B0000000000BDBDBD00BDBD + BD00FFFFFF00000000007B7B7B0000000000BDBDBD00FFFFFF007B7B7B00BDBD + BD00BDBDBD00BDBDBD00000000007B7B7B008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000084848400008484008484 + 8400008484008484840000848400848484000084840084848400008484008484 + 8400008484000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000007B7B7B0000000000000000000000 + 0000FFFFFF00000000007B7B7B007B7B7B00BDBDBD0000000000BDBDBD000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000848400848484000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000BDBDBD00FFFFFF00000000000000000000000000BDBDBD00BDBDBD000000 + 0000000000007B7B7B0000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000084848400848484000000 + 0000C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600000000008484 + 8400008484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 00000000000000000000000000000000000000000000000000007B7B7B00BDBD + BD007B7B7B00BDBDBD00FFFFFF00FFFFFF00BDBDBD00BDBDBD007B7B7B007B7B + 7B007B7B7B00000000007B7B7B00000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000848400848484000084 + 84000000000000FFFF00000000000000000000FFFF0000000000848484000084 + 8400848484000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF00000000000000000000000000000000007B7B7B0000000000BDBD + BD007B7B7B000000000000000000BDBDBD000000000000000000BDBDBD00BDBD + BD00000000007B7B7B0000000000000000008400000084000000848484008484 + 84008484840084848400840000000000000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000000000 + 0000000000000000000000FFFF0000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF00000000000000000000000000000000007B7B7B000000 + 00007B7B7B0000000000BDBDBD00BDBDBD00BDBDBD00000000007B7B7B000000 + 00007B7B7B000000000000000000000000000000000084000000840000008400 + 0000840000008400000000000000000000000000000084000000840000008400 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000007B7B + 7B0000000000000000000000000000000000000000007B7B7B00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000007B7B7B007B7B7B007B7B7B0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000840000008400000084000000840000008400 + 0000840000008400000084000000000000000000000000000000000000008400 + 0000000000000000000084000000000000000000000084000000840000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00C0C0C000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000000000000000008400 + 0000000000000000000084000000000000008400000000000000000000008400 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000FFFFFF00FF00 + 0000FF000000C0C0C000FFFFFF00FFFFFF00FFFFFF0000FFFF000000000000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF000000000000000000000000000000 + 000000000000FFFFFF0084000000000000000000000000000000000000008400 + 0000000000000000000084000000000000008400000000000000000000008400 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00000000000000000000000000000000000000000000000000C0C0C000FF00 + 0000FF000000C0C0C000C0C0C000C0C0C000FFFFFF00FFFFFF0000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000000000000000000000 + 0000840000008400000084000000000000008400000000000000000000008400 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00C0C0C000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF000000000000000000000000000000000000000000FF000000FF000000FF00 + 0000FF000000FF000000FF000000C0C0C000FFFFFF00FFFFFF000000000000FF + FF000000000000FFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF000000000000000000000000000000 + 000000000000FFFFFF0084000000000000000000000000000000000000000000 + 0000000000000000000084000000000000008400000084000000840000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FF000000FF000000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF000000000000000000000000000000000000000000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FFFFFF00FFFFFF00FFFFFF0000000000FFFF + FF0000000000FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000000000000000000000 + 0000000000000000000084000000000000008400000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C0C0 + C000FF000000FF000000C0C0C000C0C0C000C0C0C000FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000FFFFFF00FF00 + 0000FF000000C0C0C000FFFFFF0000000000000000000000000000000000FFFF + FF000000000000FFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF000000000000000000FFFFFF008400 + 0000840000008400000084000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000C0C0C000FFFFFF00FFFFFF0000FF + FF00000000000000000000000000000000000000000000000000FFFFFF00FF00 + 0000FF000000FFFFFF00FFFFFF0000000000FFFFFF0000000000FFFFFF00FFFF + FF0000000000FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 0000FFFFFF008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 000000000000FFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FF000000FF000000C0C0C000FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000000000FFFFFF000000 + 0000FFFFFF00FFFFFF00000000000000000000000000FFFFFF00000000000000 + 0000FFFFFF000000000084000000840000008400000084000000840000008400 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FF000000FF000000FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000400000000100010000000000000200000000000000000000 + 000000000000000000000000FFFFFF00FFFF000000000000C001000000000000 + C001000000000000C001000000000000C001000000000000C001000000000000 + 8001000000000000000100000000000000010000000000000001000000000000 + 8001000000000000C001000000000000C001000000000000C003000000000000 + C007000000000000C00F000000000000FFFFFFFFFFFFFFFF000CC007FFFFFFFF + 00088003FFFFFFFF00010001FFFFFFFF00030001F83FFEFF00030001F83FFC7F + 00030000F83FF83F00030000F83FF01F00038000C007E00F0007C000E00FC007 + 000FE000F01FF83F000F8000F83FF83F000F8007FC7FF83F001F8000FEFFF83F + 003FF000FFFFFFFF007FF800FFFFFFFFFFFFFFFFFC7FFFFFFC00FFFFFC27FFFF + 8000FFF9EC23F83F0000E7FFC40100010000C3F3800100010000C3E7C0010001 + 0001E1C7E00000010003F08F000000010003F81F000000010003FC3F00030001 + 0003F81FE00300010003F09FC00100010003C1C780030101800783E3C4078383 + F87F8FF1EC3FFFFFFFFFFFFFFC7FFFFFFFFFFFFFFFFFFFFFFFFF801FFFFFF3FF + C007801FFC01ED9FC0078007FC01ED6FC0078007FC01ED6FC00780010001F16F + C00780010001FD1FC00780010001FC7FC00780010001FEFFC00780010003FC7F + C00780010007FD7FC0078001000FF93FC00FE00100FFFBBFC01FE00301FFFBBF + C03FF80703FFFBBFFFFFF80FFFFFFFFF} + end + object pmAdd: TPopupMenu + Images = ilLinks + OnPopup = pmLinksPopup + Left = 35 + Top = 6 + object miAdd1: TMenuItem + Caption = '&Add...' + Default = True + ImageIndex = 0 + ShortCut = 45 + OnClick = AddClick + end + object miAddComposition1: TMenuItem + Caption = 'Add Composition...' + Hint = 'miAddComposition' + ImageIndex = 1 + OnClick = AddCompositionClick + end + object miLine6: TMenuItem + Caption = '-' + end + object miAddExisting1: TMenuItem + Caption = 'Add Existing' + ShortCut = 32813 + OnClick = AddExistingClick + end + object miAddStandard1: TMenuItem + Caption = 'Add Standard...' + ShortCut = 16429 + OnClick = AddStandardClick + end + end +end diff --git a/official/x.35/Lib/D11/dxPSfmReportProperties.dcu b/official/x.35/Lib/D11/dxPSfmReportProperties.dcu new file mode 100644 index 00000000..dbc99f62 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSfmReportProperties.dcu differ diff --git a/official/x.35/Lib/D11/dxPSfmReportProperties.dfm b/official/x.35/Lib/D11/dxPSfmReportProperties.dfm new file mode 100644 index 00000000..4bbf7a0e --- /dev/null +++ b/official/x.35/Lib/D11/dxPSfmReportProperties.dfm @@ -0,0 +1,220 @@ +object dxfmPSReportProperties: TdxfmPSReportProperties + Left = 357 + Top = 319 + ActiveControl = edName + BorderIcons = [biSystemMenu, biMinimize, biMaximize, biHelp] + BorderStyle = bsDialog + Caption = 'Properties' + ClientHeight = 477 + ClientWidth = 359 + Color = clBtnFace + Constraints.MinHeight = 502 + Constraints.MinWidth = 367 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Icon.Data = { + 0000010001001010100000000000280100001600000028000000100000002000 + 00000100040000000000C0000000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000 + 00000000000000000000000000000FFFFFFFFFF000000F00F00000F000000FFF + FFFFFFF000000F00F00000F000000FFFFFFFFFF000000FFFFFFF0FF000000F00 + FFF080F000000F080F08080000440FF080808088804400000808088888440000 + 008088888844000000088888804400000000000000440000000000000000FFFF + 0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F + 0000000400000000000000000000F8000000FC000000FE040000FFFF0000} + OldCreateOrder = False + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + PixelsPerInch = 96 + TextHeight = 13 + object pcSummary: TPageControl + Left = 5 + Top = 6 + Width = 349 + Height = 434 + ActivePage = tshSummary + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + object tshSummary: TTabSheet + Caption = 'Summary' + object Image1: TImage + Left = 10 + Top = 8 + Width = 32 + Height = 32 + Picture.Data = { + 07544269746D617076020000424D760200000000000076000000280000002000 + 0000200000000100040000000000000200000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDD777777777777777777777777777DDDD00000000000000000000000000 + 07DDDD0FFFFFFFFFFFFFFFFFFFFFFFFF07DDDD0FFFFFFFFFFFFFFFFFFFFFFFFF + 07DDDD0F88888888888888888888888F07DDDD0F8FFF8FFF8FFF8FFFF8FFFF8F + 07DDDD0F8FFF8FFF8FFF8FFFF8FFFF8F07DDDD0F88888888888888888888888F + 07DDDD0F8FFF8FFF8FFF8FFFF8FFFF8F07DDDD0F8FFF8FFF8FFF8FFFF8FFFF8F + 07DDDD0F88888888888888888888888F07DDDD0F8FFF8FFF8FFF8FFFF8FFFF8F + 07DDDD0F8FFF8FFF8FFF8FFFF8FFFF8F07DDDD0F88888888888888888888888F + 07DDDD0F8FFF8FFF8FFF8FFFF8FFFF8F07DDDD0F8FFF8FFF8FFF8FFFF8FFFF8F + 07DDDD0F88888888888888888888888F07DDDD0FFFFFFFFFFFFFFFFFFFFFFFFF + 07DDDD0FFFFFFFFFFFFFFFFFFFFFFFFF07DDDD0F0000FF7777777777FFFFFFFF + 07DDDD0FFFFFFFFFFFFFFFFFFFFFFFFF07DDDD0F0000FF7777777777FFFFFFFF + 07DDDD0FFFFFFFFFFFFFFFFFFFFFFFFF07DDDD0F0000FF7777777777FFFFFFFF + 07DDDD0FFFFFFFFFFFFFFFFFFFFFFFFF07DDDD0FFFFFFFFFFFFFFFFFFFFFFFFF + 07DDDD0F77777777777777777777777F07DDDD0F7777777FFFFFFFFFFFFFFFFF + 07DDDD0FFFFFFFFFFFFFFFFFFFFFFFFF07DDDD0FFFFFFFFFFFFFFFFFFFFFFFFF + 07DDDD000000000000000000000000000DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object Bevel1: TBevel + Left = 8 + Top = 46 + Width = 320 + Height = 6 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object lblCreator: TLabel + Left = 10 + Top = 80 + Width = 41 + Height = 13 + Caption = 'Creator:' + FocusControl = edCreator + end + object lblCreationDate: TLabel + Left = 10 + Top = 105 + Width = 71 + Height = 13 + Caption = 'Creation Date:' + FocusControl = edCreationDate + end + object Bevel2: TBevel + Left = 8 + Top = 142 + Width = 320 + Height = 6 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object edName: TEdit + Left = 66 + Top = 16 + Width = 262 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + Text = 'edName' + end + object edCreator: TEdit + Left = 112 + Top = 80 + Width = 215 + Height = 14 + TabStop = False + Anchors = [akLeft, akTop, akRight] + AutoSize = False + BorderStyle = bsNone + Ctl3D = False + ParentCtl3D = False + ReadOnly = True + TabOrder = 1 + Text = 'edCreator' + end + object edCreationDate: TEdit + Left = 112 + Top = 105 + Width = 215 + Height = 14 + TabStop = False + Anchors = [akLeft, akTop, akRight] + AutoSize = False + BorderStyle = bsNone + Ctl3D = False + ParentCtl3D = False + ReadOnly = True + TabOrder = 2 + Text = 'edCreationDate' + end + object pcDescription: TPageControl + Left = 10 + Top = 158 + Width = 319 + Height = 237 + ActivePage = tshPreview + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 3 + object tshDescription: TTabSheet + Caption = '&Description' + object memDescription: TMemo + Left = 0 + Top = 0 + Width = 311 + Height = 209 + Align = alClient + ScrollBars = ssBoth + TabOrder = 0 + end + end + object tshPreview: TTabSheet + Caption = '&Preview' + ImageIndex = 1 + object bvlPreviewHost: TBevel + Left = 0 + Top = 0 + Width = 311 + Height = 172 + Align = alTop + Anchors = [akLeft, akTop, akRight, akBottom] + end + object btnPreview: TButton + Left = 206 + Top = 180 + Width = 100 + Height = 23 + Anchors = [akRight, akBottom] + Caption = 'Pre&view...' + TabOrder = 0 + OnClick = PreviewClick + end + end + end + end + end + object btnOK: TButton + Left = 116 + Top = 447 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 197 + Top = 447 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object btnHelp: TButton + Left = 279 + Top = 447 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Caption = '&Help' + TabOrder = 3 + end +end diff --git a/official/x.35/Lib/D11/dxPSfmStlAdd.dcu b/official/x.35/Lib/D11/dxPSfmStlAdd.dcu new file mode 100644 index 00000000..44faf949 Binary files /dev/null and b/official/x.35/Lib/D11/dxPSfmStlAdd.dcu differ diff --git a/official/x.35/Lib/D11/dxPSfmStlAdd.dfm b/official/x.35/Lib/D11/dxPSfmStlAdd.dfm new file mode 100644 index 00000000..198f3340 --- /dev/null +++ b/official/x.35/Lib/D11/dxPSfmStlAdd.dfm @@ -0,0 +1,71 @@ +object dxfmSelectStyleClass: TdxfmSelectStyleClass + Left = 427 + Top = 284 + BorderStyle = bsDialog + Caption = 'Select PrintStyle Type' + ClientHeight = 91 + ClientWidth = 279 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + PixelsPerInch = 96 + TextHeight = 13 + object GroupBox1: TGroupBox + Left = 2 + Top = -2 + Width = 275 + Height = 58 + TabOrder = 0 + object Label1: TLabel + Left = 7 + Top = 24 + Width = 28 + Height = 13 + Caption = '&Type:' + FocusControl = cbxStyleTypes + OnClick = Label1Click + end + object cbxStyleTypes: TComboBox + Left = 44 + Top = 20 + Width = 220 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + OnChange = cbxStyleTypesChange + end + end + object btnOK: TButton + Left = 31 + Top = 63 + Width = 79 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 115 + Top = 63 + Width = 79 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object btnHelp: TButton + Left = 198 + Top = 63 + Width = 79 + Height = 23 + Caption = '&Help' + TabOrder = 3 + end +end diff --git a/official/x.35/Lib/D11/dxPSfmStlDsg.dcu b/official/x.35/Lib/D11/dxPSfmStlDsg.dcu new file mode 100644 index 00000000..578767ec Binary files /dev/null and b/official/x.35/Lib/D11/dxPSfmStlDsg.dcu differ diff --git a/official/x.35/Lib/D11/dxPSfmStlDsg.dfm b/official/x.35/Lib/D11/dxPSfmStlDsg.dfm new file mode 100644 index 00000000..0adb8e98 --- /dev/null +++ b/official/x.35/Lib/D11/dxPSfmStlDsg.dfm @@ -0,0 +1,796 @@ +object dxfmPrintStylesDesignWindow: TdxfmPrintStylesDesignWindow + Left = 395 + Top = 187 + BorderStyle = bsDialog + Caption = 'Print Styles' + ClientHeight = 199 + ClientWidth = 358 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Icon.Data = { + 0000010001001010100000000000280100001600000028000000100000002000 + 00000100040000000000C0000000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000 + 00000000000000000000000000000FFFFFFFFFF000000F00F00000F000000FFF + FFFFFFF000000F00F00000F000000FFFFFFFFFF000000FFFFFFF0FF000000F00 + FFF080F000000F080F08080000440FF080808088804400000808088888440000 + 008088888844000000088888804400000000000000440000000000000000FFFF + 0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F + 0000000400000000000000000000F8000000FC000000FE040000FFFF0000} + KeyPreview = True + OldCreateOrder = True + OnClose = FormClose + OnKeyDown = FormKeyDown + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object pnlButtons: TPanel + Left = 249 + Top = 0 + Width = 109 + Height = 199 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btnAdd: TButton + Left = 6 + Top = 4 + Width = 100 + Height = 22 + Caption = '&Add...' + TabOrder = 0 + OnClick = AddClick + end + object btnDelete: TButton + Tag = 4 + Left = 6 + Top = 31 + Width = 100 + Height = 22 + Caption = '&Delete' + TabOrder = 1 + OnClick = EditClick + end + object btnSelectAll: TButton + Tag = 6 + Left = 6 + Top = 58 + Width = 100 + Height = 22 + Caption = 'Se&lect All' + TabOrder = 2 + OnClick = EditClick + end + object btnPageSetup: TButton + Tag = 1 + Left = 6 + Top = 147 + Width = 100 + Height = 22 + Caption = 'Pa&ge Setup...' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 5 + OnClick = PageSetupClick + end + object btnMoveUp: TButton + Left = 6 + Top = 89 + Width = 100 + Height = 22 + Caption = 'Move &Up' + TabOrder = 3 + OnClick = MoveUpClick + end + object btnMoveDown: TButton + Tag = 1 + Left = 6 + Top = 116 + Width = 100 + Height = 22 + Caption = 'Move Dow&n' + TabOrder = 4 + OnClick = MoveDownClick + end + object btnRestoreDefaults: TButton + Left = 6 + Top = 174 + Width = 100 + Height = 22 + Caption = 'Rest&ore Defaults' + TabOrder = 6 + OnClick = RestoreDefaultsClick + end + end + object lbxStyles: TListBox + Left = 0 + Top = 0 + Width = 249 + Height = 199 + Style = lbOwnerDrawFixed + Align = alClient + Ctl3D = True + DragMode = dmAutomatic + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ItemHeight = 34 + MultiSelect = True + ParentCtl3D = False + ParentFont = False + PopupMenu = pmStyles + TabOrder = 1 + OnClick = lbxStylesClick + OnDblClick = PageSetupClick + OnDragDrop = lbxStylesDragDrop + OnDragOver = lbxStylesDragOver + OnDrawItem = lbxStylesDrawItem + OnEndDrag = lbxStylesEndDrag + OnKeyPress = lbxStylesKeyPress + OnStartDrag = lbxStylesStartDrag + end + object pmStyles: TPopupMenu + OnPopup = pmStylesPopup + Left = 13 + Top = 9 + object miAdd: TMenuItem + Caption = '&Add...' + ShortCut = 45 + OnClick = AddClick + end + object miAddStandard: TMenuItem + Caption = 'Add' + ShortCut = 32813 + OnClick = AddStandardClick + end + object miLine5: TMenuItem + Caption = '-' + end + object miEdit: TMenuItem + Caption = '&Edit' + object miCut: TMenuItem + Tag = 2 + Caption = 'Cu&t' + ShortCut = 16472 + OnClick = EditClick + end + object miCopy: TMenuItem + Tag = 1 + Caption = '&Copy' + ShortCut = 16451 + OnClick = EditClick + end + object miPaste: TMenuItem + Tag = 3 + Caption = '&Paste' + ShortCut = 16470 + OnClick = EditClick + end + object miDelete: TMenuItem + Tag = 4 + Caption = '&Delete' + ShortCut = 46 + OnClick = EditClick + end + object N2: TMenuItem + Caption = '-' + end + object miSelectAll: TMenuItem + Tag = 6 + Caption = 'Se&lect All' + ShortCut = 16449 + OnClick = EditClick + end + end + object N1: TMenuItem + Caption = '-' + end + object miMoveUp: TMenuItem + Caption = 'Move &Up' + ShortCut = 16422 + OnClick = MoveUpClick + end + object miMoveDown: TMenuItem + Caption = 'Move Dow&n' + ShortCut = 16424 + OnClick = MoveDownClick + end + object miLine1: TMenuItem + Caption = '-' + end + object miPageSetup: TMenuItem + Tag = 1 + Caption = 'Pa&ge Setup...' + Default = True + ShortCut = 16397 + OnClick = PageSetupClick + end + object miSetAsCurrent: TMenuItem + Caption = '&Make Current' + ShortCut = 16416 + OnClick = miSetAsCurrentClick + end + object miLine: TMenuItem + Caption = '-' + end + object miRestoreDefaults: TMenuItem + Caption = 'Rest&ore Defaults' + ShortCut = 16463 + OnClick = RestoreDefaultsClick + end + object miLine2: TMenuItem + Caption = '-' + end + object miBackground: TMenuItem + Caption = 'Bac&kground' + object miBackgroundEffects: TMenuItem + Tag = 4 + Caption = 'E&ffects...' + OnClick = BackgroundClick + end + object miBackgroundClear: TMenuItem + Tag = 5 + Caption = 'Clear' + OnClick = ClearBackgroundClick + end + end + object N3: TMenuItem + Caption = '-' + end + object miShowButtons: TMenuItem + Caption = 'Show &Button Bar' + Checked = True + OnClick = miShowButtonsClick + end + end + object ilMenu: TImageList + Left = 41 + Top = 9 + Bitmap = { + 494C01010A000F00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000004000000001002000000000000040 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084848400FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084848400FFFF + FF000000000000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484000000 + 00008484840000000000FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848400000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400848484008484840000000000FFFFFF00FFFFFF0000FFFF0084848400FFFF + FF00FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C6C6C600C6C6 + C600C6C6C600848484008484840000000000FFFFFF00FFFFFF00840000008484 + 8400FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008484000084840000848400008484000084840000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00C6C6C600C6C6 + C600C6C6C600C6C6C60084848400848484000000000000FFFF00840000008400 + 0000FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000848400008484000084840000848400008484000084840000848400000000 + 000000000000000000000000000000000000C6C6C600FFFFFF00FFFFFF00C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084000000840000008400 + 0000FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 00000000000000000000000000000000000000000000C6C6C600FFFFFF00FFFF + FF00C6C6C60000000000C6C6C600C6C6C6008484840084000000840000008400 + 0000FFFFFF0000FFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C6C6C600FFFF + FF00000000008400000000000000C6C6C6008400000084000000840000008484 + 8400FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C6C6 + C600FFFFFF0084000000C6C6C60084848400840000008400000084848400FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000840000000000 + 0000C6C6C60084000000848484000000000084848400FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084000000C6C6 + C60000000000840000000000000084848400FFFFFF0000FFFF00FFFFFF008484 + 8400C6C6C6000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084000000C6C6 + C600C6C6C600840000008484840000FFFF00FFFFFF00FFFFFF00FFFFFF008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484008400 + 0000840000008484840084848400848484008484840084848400848484008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000008400000084000000840000008400000084000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFF + FF00000000000000000000000000000000008400000084000000840000008400 + 0000840000008400000084000000840000008400000084000000840000008400 + 0000840000008400000084000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFF + FF00000000000000000000000000000000008400000084000000840000008400 + 000084000000840000008484840084000000FFFFFF0084000000840000008400 + 0000840000008400000084000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000000000 + 0000848400008484000084840000848400008484000084840000848400000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000FFFFFF0000000000FFFFFF0000000000FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000000000 + 0000000000008484000084840000848400008484000084840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000008400000084000000848484008484 + 84008484840084848400840000000000000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000000000 + 0000000000000000000000000000848400000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084000000840000008400 + 0000840000008400000000000000000000000000000084000000840000008400 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000840000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000840000008400000084000000840000008400 + 000084000000840000008400000084000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000840000008400000084000000840000008400 + 0000840000008400000084000000000000000000000000000000000000008400 + 0000000000000000000084000000000000000000000084000000840000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0084000000000000000000000000000000FFFF + FF000000000000FF000000000000FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000000000000000008400 + 0000000000000000000084000000000000008400000000000000000000008400 + 0000000000000000000000000000000000000000000084848400008484008484 + 8400008484008484840084000000FFFFFF008400000084000000840000008400 + 00008400000084000000FFFFFF0084000000000000000000000000000000FFFF + FF000000000000FF000000000000FFFFFF000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF000000000000000000000000000000 + 000000000000FFFFFF0084000000000000000000000000000000000000008400 + 0000000000000000000084000000000000008400000000000000000000008400 + 0000000000000000000000000000000000000000000000848400848484000084 + 8400848484000084840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0084000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000000000000000000000 + 0000840000008400000084000000000000008400000000000000000000008400 + 0000000000000000000000000000000000000000000084848400008484008484 + 8400008484008484840084000000FFFFFF00840000008400000084000000FFFF + FF0084000000840000008400000084000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF000000000000000000000000000000 + 000000000000FFFFFF0084000000000000000000000000000000000000000000 + 0000000000000000000084000000000000008400000084000000840000000000 + 0000000000000000000000000000000000000000000000848400848484000084 + 8400848484000084840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0084000000FFFFFF008400000000000000000000000000000000000000FFFF + FF00FF000000FF0000008400000000000000000000000000000000000000FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000000000000000000000 + 0000000000000000000084000000000000008400000000000000000000000000 + 0000000000000000000000000000000000000000000084848400008484008484 + 8400008484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00840000008400000000000000000000000000000000000000000000000000 + 0000FF000000FF00000084000000000000000000000000000000000000000000 + 0000FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF000000000000000000FFFFFF008400 + 0000840000008400000084000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000848400848484000084 + 8400848484000084840084000000840000008400000084000000840000008400 + 0000840000000000000000000000000000000000000084000000840000008400 + 0000FF000000FF00000084000000840000008400000000000000000000000000 + 0000FFFFFF0000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 0000FFFFFF008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400008484008484 + 8400008484008484840000848400848484000084840084848400008484008484 + 84000084840000000000000000000000000000000000FF000000FF000000FF00 + 0000FF000000FF000000FF000000FF000000FF00000000000000000000000000 + 0000FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000848400848484000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 84008484840000000000000000000000000000000000FF000000FF000000FF00 + 0000FF000000FF000000840000008400000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00000000000000 + 0000FFFFFF000000000084000000840000008400000084000000840000008400 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400848484000000 + 0000C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600000000008484 + 840000848400000000000000000000000000000000000000000000000000FFFF + FF00FF000000FF0000008400000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000848400848484000084 + 84000000000000FFFF00000000000000000000FFFF0000000000848484000084 + 840084848400000000000000000000000000000000000000000000000000FFFF + FF00FF000000FF00000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000FFFF0000FFFF000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000400000000100010000000000000200000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFF00000000FFFFC00100000000 + FFFFC00100000000FFFFC00100000000FEFFC00100000000FC7FC00100000000 + F83F800100000000F01F000100000000E00F000100000000C007000100000000 + F83F800100000000F83FC00100000000F83FC00100000000F83FC00300000000 + FFFFC00700000000FFFFC00F00000000FFFFF80FFFFFFFFFFFFFF007FFFFFFFF + FFF9F007F83FFFFFE7FFF0070001FFFFC3F3F0070001F83FC3E7F0070001F83F + E1C7F0070001F83FF08FF0070001F83FF81FF0070001C007FC3FF0070001E00F + F81FF0070001F01FF09FE0030001F83FC1C7E0030101FC7F83E3F0078383FEFF + 8FF1FE3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC03FFFFFF3FFFC00 + C09FFC01ED9F8000CAAFFC01ED6F0000CA97FC01ED6F0000C0030001F16F0000 + C1C30001FD1F0001C1E30001FC7F0003D1F30001FEFF000380330003FC7F0003 + 80330007FD7F00038003000FF93F0003C10300FFFBBF0003C00301FFFBBF8007 + C00303FFFBBFF87FC003FFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxPSfmTtl.dcu b/official/x.35/Lib/D11/dxPSfmTtl.dcu new file mode 100644 index 00000000..25b4b9ff Binary files /dev/null and b/official/x.35/Lib/D11/dxPSfmTtl.dcu differ diff --git a/official/x.35/Lib/D11/dxPSfmTtl.dfm b/official/x.35/Lib/D11/dxPSfmTtl.dfm new file mode 100644 index 00000000..acb2dbb5 --- /dev/null +++ b/official/x.35/Lib/D11/dxPSfmTtl.dfm @@ -0,0 +1,691 @@ +object dxfmReportTitleProperties: TdxfmReportTitleProperties + Left = 442 + Top = 242 + ActiveControl = chbxTransparent + BorderIcons = [biSystemMenu, biMinimize, biMaximize, biHelp] + BorderStyle = bsDialog + Caption = 'Report Title' + ClientHeight = 443 + ClientWidth = 392 + Color = clBtnFace + Constraints.MinHeight = 470 + Constraints.MinWidth = 400 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + KeyPreview = True + OldCreateOrder = True + Position = poScreenCenter + OnClose = FormClose + OnKeyDown = FormKeyDown + PixelsPerInch = 96 + TextHeight = 13 + object lblMode: TLabel + Left = 8 + Top = 11 + Width = 30 + Height = 13 + Caption = '&Mode:' + FocusControl = cbxMode + end + object btnOK: TButton + Left = 151 + Top = 413 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 2 + end + object btnCancel: TButton + Left = 231 + Top = 413 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 3 + end + object btnHelp: TButton + Left = 311 + Top = 413 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Caption = '&Help' + TabOrder = 4 + end + object pctlMain: TPageControl + Left = 6 + Top = 39 + Width = 380 + Height = 366 + ActivePage = tshProperties + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 1 + object tshText: TTabSheet + Caption = '&Text' + object memText: TMemo + Left = 0 + Top = 0 + Width = 372 + Height = 338 + Align = alClient + Lines.Strings = ( + '') + TabOrder = 0 + OnChange = TitleChanged + end + end + object tshProperties: TTabSheet + Caption = '&Properties' + OnResize = tshPropertiesResize + object bvlFont: TBevel + Left = 41 + Top = 84 + Width = 324 + Height = 4 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object lblAlignment: TLabel + Left = 7 + Top = 173 + Width = 47 + Height = 13 + Caption = 'Alignment' + end + object lblTextAlignY: TLabel + Left = 196 + Top = 199 + Width = 47 + Height = 13 + Caption = '&Vertically:' + FocusControl = cbxTextAlignY + end + object bvlTransparent: TBevel + Left = 100 + Top = 15 + Width = 265 + Height = 5 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object bvlAlignment: TBevel + Left = 74 + Top = 177 + Width = 290 + Height = 5 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object lblColor: TLabel + Left = 65 + Top = 41 + Width = 29 + Height = 13 + Alignment = taRightJustify + Caption = '&Color:' + end + object bvlColorHolder: TBevel + Left = 104 + Top = 37 + Width = 261 + Height = 21 + Anchors = [akLeft, akTop, akRight] + end + object lblTextAlignX: TLabel + Left = 8 + Top = 199 + Width = 60 + Height = 13 + Caption = 'Hori&zontally:' + FocusControl = cbxTextAlignX + end + object imgFont: TImage + Left = 9 + Top = 79 + Width = 16 + Height = 16 + AutoSize = True + Picture.Data = { + 07544269746D6170F6000000424DF60000000000000076000000280000001000 + 0000100000000100040000000000800000000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD000000DDDDDDDDDDDD00D + DDDDDDDDDDDDD00DDDDDDDD77777700DDDDDDDDDD77DD00DDDDDDDDDD70DD00D + D0DDDDDDD70DD00DD0DDDDDDD700D00D00DDDD7DD700000000DDDD7DD77DD7DD + DDDDDD77D77D77DDDDDDDD77777777DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD + DDDD} + Transparent = True + end + object Bevel2: TBevel + Left = 10 + Top = 294 + Width = 354 + Height = 5 + Anchors = [akLeft, akRight, akBottom] + Shape = bsBottomLine + end + object lblTransparent: TLabel + Left = 25 + Top = 11 + Width = 62 + Height = 13 + Caption = '&Transparent ' + FocusControl = chbxTransparent + OnClick = lblTransparentClick + end + object cbxTextAlignX: TComboBox + Left = 92 + Top = 194 + Width = 95 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 4 + OnChange = TitleChanged + OnDrawItem = cbxTextAlignYDrawItem + Items.Strings = ( + 'Left' + 'Center' + 'Right') + end + object cbxTextAlignY: TComboBox + Tag = 1 + Left = 270 + Top = 194 + Width = 95 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 5 + OnChange = TitleChanged + OnDrawItem = cbxTextAlignYDrawItem + Items.Strings = ( + 'Top' + 'Center' + 'Bottom') + end + object chbxAdjustOnScale: TCheckBox + Left = 104 + Top = 137 + Width = 261 + Height = 17 + Anchors = [akLeft, akTop, akRight] + Caption = '&Adjust on Scale' + TabOrder = 3 + OnClick = TitleChanged + end + object edFont: TEdit + Left = 104 + Top = 107 + Width = 261 + Height = 21 + TabStop = False + Anchors = [akLeft, akTop, akRight] + Color = clBtnFace + ReadOnly = True + TabOrder = 2 + end + object btnFont: TButton + Left = 8 + Top = 105 + Width = 88 + Height = 25 + Caption = 'Fo&nt...' + TabOrder = 1 + OnClick = btnFontClick + end + object btnRestoreDefaults: TButton + Left = 189 + Top = 307 + Width = 176 + Height = 23 + Anchors = [akRight, akBottom] + Caption = '&Restore Defaults' + TabOrder = 6 + OnClick = btnRestoreDefaultsClick + end + object chbxTransparent: TCheckBox + Left = 7 + Top = 10 + Width = 15 + Height = 17 + Caption = '&Transparent' + TabOrder = 0 + OnClick = TitleChanged + end + end + end + object cbxMode: TComboBox + Left = 48 + Top = 8 + Width = 338 + Height = 21 + Style = csDropDownList + Anchors = [akLeft, akTop, akRight] + ItemHeight = 13 + TabOrder = 0 + OnChange = TitleChanged + Items.Strings = ( + 'None' + 'On First Page, ' + 'On Every Top Page') + end + object ilAlignments: TImageList + AllocBy = 6 + Left = 10 + Top = 411 + Bitmap = { + 494C010106000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FF7FFFFF00000000FF7FFFFF00000000 + FF7FE00300000000FC1FFFFF00000000FE3FFF7F00000000FF7FFE3F00000000 + FFFFFC1F00000000E003FF7F00000000FFFFFF7F00000000FF7FFF7F00000000 + FE3FFF7F00000000FC1FFFFF00000000FF7FFFFF00000000FF7FFFFF00000000 + FF7FFFFF00000000FFFFFFFF00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFF003FC00FF003FFFFFFFFFFFFFFFFFFFF000300030003FF7F + FFFFFFFFFFFFFF7F003FC00FF003FF7FFFFFFFFFFFFFFF7F000300030003FC1F + FFFFFFFFFFFFFE3F003FC00FF003FF7FFFFFFFFFFFFFFFFF000300030003E003 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxPcPrVw.dcu b/official/x.35/Lib/D11/dxPcPrVw.dcu new file mode 100644 index 00000000..dcfcbf57 Binary files /dev/null and b/official/x.35/Lib/D11/dxPcPrVw.dcu differ diff --git a/official/x.35/Lib/D11/dxPgsDlg.dcu b/official/x.35/Lib/D11/dxPgsDlg.dcu new file mode 100644 index 00000000..d1d4824d Binary files /dev/null and b/official/x.35/Lib/D11/dxPgsDlg.dcu differ diff --git a/official/x.35/Lib/D11/dxPgsDlg.dfm b/official/x.35/Lib/D11/dxPgsDlg.dfm new file mode 100644 index 00000000..297c662a --- /dev/null +++ b/official/x.35/Lib/D11/dxPgsDlg.dfm @@ -0,0 +1,3666 @@ +object dxfmPageSetupDialog: TdxfmPageSetupDialog + Left = 448 + Top = 228 + BorderStyle = bsDialog + Caption = 'Page Setup' + ClientHeight = 435 + ClientWidth = 526 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + KeyPreview = True + OldCreateOrder = True + Position = poScreenCenter + OnClose = FormClose + OnCloseQuery = FormCloseQuery + OnKeyDown = FormKeyDown + PixelsPerInch = 96 + TextHeight = 13 + object pnlStyleName: TPanel + Left = 0 + Top = 0 + Width = 526 + Height = 31 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object lblStyleName: TLabel + Left = 4 + Top = 9 + Width = 61 + Height = 13 + Caption = 'Style &Name: ' + FocusControl = edStyleName + end + object edStyleName: TEdit + Left = 66 + Top = 6 + Width = 259 + Height = 21 + MaxLength = 31 + TabOrder = 0 + OnChange = edStyleNameChange + OnExit = edStyleNameExit + end + object btnOptions: TButton + Left = 331 + Top = 5 + Width = 88 + Height = 24 + Caption = '&Options ...' + TabOrder = 1 + end + end + object pnlButtons: TPanel + Left = 0 + Top = 399 + Width = 526 + Height = 36 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object btnPrintPreview: TButton + Left = 117 + Top = 7 + Width = 106 + Height = 23 + Caption = 'Print Preview...' + TabOrder = 1 + OnClick = btnPrintPreviewClick + end + object btnPrint: TButton + Left = 5 + Top = 7 + Width = 106 + Height = 23 + Caption = 'Print...' + TabOrder = 0 + OnClick = btnPrintClick + end + object btnOK: TButton + Left = 273 + Top = 7 + Width = 79 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 2 + end + object btnCancel: TButton + Left = 358 + Top = 7 + Width = 79 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 3 + end + object btnHelp: TButton + Left = 443 + Top = 7 + Width = 79 + Height = 23 + Caption = '&Help' + TabOrder = 4 + end + end + object Panel4: TPanel + Left = 0 + Top = 31 + Width = 526 + Height = 368 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object pgctrlMain: TPageControl + Left = 5 + Top = 3 + Width = 517 + Height = 365 + ActivePage = tshMargins + MultiLine = True + TabOrder = 0 + OnChange = pgctrlMainChange + OnChanging = pgctrlMainChanging + object tshPage: TTabSheet + Caption = '&Page' + object Panel5: TPanel + Left = 0 + Top = 0 + Width = 509 + Height = 337 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object gbxPaper: TGroupBox + Left = 5 + Top = 5 + Width = 231 + Height = 326 + Caption = ' Paper ' + TabOrder = 0 + object lblPaperWidth: TLabel + Left = 18 + Top = 208 + Width = 32 + Height = 13 + Caption = '&Width:' + OnClick = lblMarginTopClick + end + object lblPaperHeight: TLabel + Left = 18 + Top = 234 + Width = 35 + Height = 13 + Caption = 'H&eight:' + OnClick = lblMarginTopClick + end + object bvlPaperDimensions: TBevel + Left = 64 + Top = 191 + Width = 157 + Height = 4 + Shape = bsBottomLine + end + object bvlPaperSource: TBevel + Left = 79 + Top = 278 + Width = 142 + Height = 4 + Shape = bsBottomLine + end + object bvlPaperType: TBevel + Left = 36 + Top = 20 + Width = 185 + Height = 4 + Shape = bsBottomLine + end + object bvlPaperWidthHolder: TBevel + Left = 81 + Top = 204 + Width = 100 + Height = 22 + Visible = False + end + object bvlPaperHeightHolder: TBevel + Left = 81 + Top = 230 + Width = 100 + Height = 22 + Visible = False + end + object lblPaperSource: TLabel + Left = 6 + Top = 272 + Width = 63 + Height = 13 + Caption = 'Paper so&urce' + FocusControl = cbxPaperSource + OnClick = lblPaperSourceClick + end + object lblPaperType: TLabel + Left = 6 + Top = 15 + Width = 24 + Height = 13 + Caption = 'T&ype' + FocusControl = lbxPaperType + end + object lblPaperDimensions: TLabel + Left = 6 + Top = 186 + Width = 53 + Height = 13 + Caption = 'Dimensions' + end + object lbxPaperType: TListBox + Left = 12 + Top = 31 + Width = 208 + Height = 148 + Style = lbOwnerDrawFixed + IntegralHeight = True + ItemHeight = 18 + TabOrder = 0 + OnClick = lbxPaperTypeClick + OnDrawItem = lbxPaperTypeDrawItem + end + object cbxPaperSource: TComboBox + Left = 12 + Top = 289 + Width = 208 + Height = 24 + Style = csOwnerDrawFixed + ItemHeight = 18 + TabOrder = 1 + OnChange = cbxPaperSourceChange + OnDrawItem = cbxPaperSourceDrawItem + end + end + object Panel1: TPanel + Left = 239 + Top = 0 + Width = 270 + Height = 337 + Align = alRight + BevelOuter = bvNone + ParentColor = True + TabOrder = 1 + object Label1: TLabel + Left = 265 + Top = 5 + Width = 5 + Height = 326 + Align = alRight + AutoSize = False + Transparent = True + end + object Label2: TLabel + Left = 0 + Top = 5 + Width = 5 + Height = 326 + Align = alLeft + AutoSize = False + Transparent = True + end + object Label3: TLabel + Left = 0 + Top = 0 + Width = 270 + Height = 5 + Align = alTop + AutoSize = False + Transparent = True + end + object Label4: TLabel + Left = 0 + Top = 331 + Width = 270 + Height = 6 + Align = alBottom + AutoSize = False + Transparent = True + end + object Panel6: TPanel + Left = 5 + Top = 5 + Width = 260 + Height = 326 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object gbxOrientation: TGroupBox + Left = 0 + Top = 0 + Width = 260 + Height = 187 + Align = alTop + Caption = ' Orientation ' + TabOrder = 0 + object bvlOrientationHolder: TBevel + Left = 8 + Top = 20 + Width = 145 + Height = 159 + Visible = False + end + object rBtnLandscape: TRadioButton + Tag = 1 + Left = 162 + Top = 109 + Width = 93 + Height = 17 + Caption = '&Landscape' + TabOrder = 1 + OnClick = OrientationClick + OnDblClick = OrientationDblClick + end + object rBtnPortrait: TRadioButton + Left = 162 + Top = 62 + Width = 93 + Height = 17 + Caption = 'P&ortrait' + Checked = True + TabOrder = 0 + TabStop = True + OnClick = OrientationClick + OnDblClick = OrientationDblClick + end + end + object gbxPrintOrder: TGroupBox + Left = 0 + Top = 187 + Width = 260 + Height = 80 + Align = alTop + Caption = ' Print Order ' + TabOrder = 1 + object pbxPageOrder: TPaintBox + Left = 10 + Top = 20 + Width = 74 + Height = 49 + OnDblClick = pbxPageOrderDblClick + OnPaint = pbxPageOrderPaint + end + object rbtnOverThenDown: TRadioButton + Left = 105 + Top = 47 + Width = 150 + Height = 17 + Caption = 'O&ver, then down' + TabOrder = 0 + OnClick = PageOrderClick + end + object rbtnDownThenOver: TRadioButton + Tag = 1 + Left = 105 + Top = 24 + Width = 150 + Height = 17 + Caption = '&Down, then over' + Checked = True + TabOrder = 1 + TabStop = True + OnClick = PageOrderClick + end + end + object gbxShading: TGroupBox + Left = 0 + Top = 267 + Width = 260 + Height = 59 + Align = alClient + Caption = ' Shading ' + TabOrder = 2 + object chbxShading: TCheckBox + Left = 11 + Top = 25 + Width = 206 + Height = 17 + Caption = 'Print using &gray shading' + TabOrder = 0 + OnClick = chbxShadingClick + end + end + end + end + end + end + object tshMargins: TTabSheet + Caption = '&Margins' + object pnlInMargins: TPanel + Left = 0 + Top = 0 + Width = 509 + Height = 337 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Bevel12: TBevel + Left = 297 + Top = 7 + Width = 201 + Height = 5 + Shape = bsBottomLine + end + object bvlPreviewHolder: TBevel + Left = 252 + Top = 18 + Width = 246 + Height = 310 + Visible = False + end + object lblPreview: TLabel + Left = 252 + Top = 3 + Width = 38 + Height = 13 + Caption = 'Preview' + end + object Panel14: TPanel + Left = 0 + Top = 0 + Width = 237 + Height = 337 + Align = alLeft + BevelOuter = bvNone + ParentColor = True + TabOrder = 0 + object Label5: TLabel + Left = 0 + Top = 0 + Width = 237 + Height = 5 + Align = alTop + AutoSize = False + Transparent = True + end + object Label6: TLabel + Left = 0 + Top = 332 + Width = 237 + Height = 5 + Align = alBottom + AutoSize = False + Transparent = True + end + object Label7: TLabel + Left = 0 + Top = 5 + Width = 5 + Height = 327 + Align = alLeft + AutoSize = False + Transparent = True + end + object Label8: TLabel + Left = 232 + Top = 5 + Width = 5 + Height = 327 + Align = alRight + AutoSize = False + Transparent = True + end + object Panel8: TPanel + Left = 5 + Top = 5 + Width = 227 + Height = 327 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object bvlMarginsWarningHolder: TBevel + Left = 4 + Top = 281 + Width = 222 + Height = 33 + Visible = False + end + object gbxMargins: TGroupBox + Left = 0 + Top = 0 + Width = 227 + Height = 223 + Align = alTop + TabOrder = 0 + object pnlMargins: TPanel + Left = 2 + Top = 15 + Width = 223 + Height = 106 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object lblMarginTop: TLabel + Left = 13 + Top = 8 + Width = 22 + Height = 13 + Caption = '&Top:' + OnClick = lblMarginTopClick + end + object lblMarginBottom: TLabel + Left = 13 + Top = 34 + Width = 41 + Height = 13 + Caption = '&Bottom: ' + OnClick = lblMarginTopClick + end + object lblMarginLeft: TLabel + Left = 13 + Top = 60 + Width = 26 + Height = 13 + Caption = 'Le&ft: ' + OnClick = lblMarginTopClick + end + object lblMarginRight: TLabel + Left = 13 + Top = 86 + Width = 32 + Height = 13 + Caption = 'Ri&ght: ' + OnClick = lblMarginTopClick + end + object bvlMarginTopHolder: TBevel + Left = 97 + Top = 3 + Width = 117 + Height = 22 + Visible = False + end + object bvlMarginBottomHolder: TBevel + Left = 97 + Top = 29 + Width = 117 + Height = 22 + Visible = False + end + object bvlMarginLeftHolder: TBevel + Left = 97 + Top = 55 + Width = 117 + Height = 22 + Visible = False + end + object bvlMarginRightHolder: TBevel + Left = 97 + Top = 81 + Width = 117 + Height = 22 + Visible = False + end + end + object pnlHFMargins: TPanel + Left = 2 + Top = 121 + Width = 223 + Height = 58 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object lblMarginHeader: TLabel + Left = 13 + Top = 11 + Width = 42 + Height = 13 + Caption = 'H&eader: ' + OnClick = lblMarginTopClick + end + object lblMarginFooter: TLabel + Left = 13 + Top = 38 + Width = 36 + Height = 13 + Caption = 'Foote&r:' + OnClick = lblMarginTopClick + end + object bvlMarginHeaderHolder: TBevel + Left = 97 + Top = 6 + Width = 117 + Height = 22 + Visible = False + end + object bvlMarginFooterHolder: TBevel + Left = 97 + Top = 33 + Width = 117 + Height = 22 + Visible = False + end + end + object Panel3: TPanel + Left = 2 + Top = 179 + Width = 223 + Height = 39 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object btnFix: TButton + Left = 6 + Top = 13 + Width = 79 + Height = 23 + Caption = 'Fi&x' + TabOrder = 0 + OnClick = btnFixClick + end + object btnRestoreOriginalMargins: TButton + Left = 88 + Top = 13 + Width = 127 + Height = 23 + Caption = 'Restore &Original' + TabOrder = 1 + OnClick = btnRestoreOriginalMarginsClick + end + end + end + object pnlCenterOnPage: TPanel + Left = 0 + Top = 223 + Width = 227 + Height = 54 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object bvlCenterOnPage: TBevel + Left = 99 + Top = 16 + Width = 128 + Height = 4 + Shape = bsBottomLine + end + object lblCenterOnPage: TLabel + Left = 1 + Top = 13 + Width = 78 + Height = 13 + Caption = 'Center on page ' + end + object chbxCenterHorz: TCheckBox + Left = 9 + Top = 33 + Width = 112 + Height = 17 + Caption = 'Hori&zontaly' + Color = clBtnFace + ParentColor = False + TabOrder = 0 + OnClick = CenterOnPageClick + end + object chbxCenterVert: TCheckBox + Tag = 1 + Left = 131 + Top = 33 + Width = 92 + Height = 17 + Caption = '&Verticaly' + TabOrder = 1 + OnClick = CenterOnPageClick + end + end + end + end + end + end + object tshHeaderFooter: TTabSheet + Caption = '&Header\Footer' + object Panel7: TPanel + Left = 0 + Top = 0 + Width = 509 + Height = 337 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object pnlBottom: TPanel + Left = 0 + Top = 236 + Width = 509 + Height = 67 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object pnlHFOpt: TPanel + Left = 0 + Top = 0 + Width = 509 + Height = 67 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Label18: TLabel + Left = 0 + Top = 65 + Width = 509 + Height = 2 + Align = alBottom + AutoSize = False + Transparent = True + end + object Label17: TLabel + Left = 0 + Top = 2 + Width = 4 + Height = 63 + Align = alLeft + AutoSize = False + Transparent = True + end + object Label19: TLabel + Left = 505 + Top = 2 + Width = 4 + Height = 63 + Align = alRight + AutoSize = False + Transparent = True + end + object Label20: TLabel + Left = 0 + Top = 0 + Width = 509 + Height = 2 + Align = alTop + AutoSize = False + Transparent = True + end + object Panel9: TPanel + Left = 4 + Top = 2 + Width = 501 + Height = 63 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object pnlVertAlignment: TPanel + Left = 0 + Top = 0 + Width = 125 + Height = 63 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object gbxVertAlignment: TGroupBox + Left = 0 + Top = 0 + Width = 120 + Height = 63 + Caption = ' Vertical Alignment ' + TabOrder = 0 + object tbTAVert: TToolBar + Left = 22 + Top = 23 + Width = 79 + Height = 30 + Align = alNone + ButtonHeight = 24 + ButtonWidth = 25 + EdgeBorders = [ebLeft, ebTop, ebRight, ebBottom] + EdgeInner = esLowered + Images = ilPaperTypes + TabOrder = 0 + Wrapable = False + object ToolButton12: TToolButton + Left = 0 + Top = 2 + Caption = 'ToolButton9' + Down = True + Grouped = True + ImageIndex = 0 + Style = tbsCheck + OnClick = VertTextAlignClick + end + object ToolButton13: TToolButton + Tag = 1 + Left = 25 + Top = 2 + Caption = 'ToolButton10' + Grouped = True + ImageIndex = 1 + Style = tbsCheck + OnClick = VertTextAlignClick + end + object ToolButton14: TToolButton + Tag = 2 + Left = 50 + Top = 2 + Caption = 'ToolButton11' + Grouped = True + ImageIndex = 2 + Style = tbsCheck + OnClick = VertTextAlignClick + end + end + end + end + object gbxFunctions: TGroupBox + Left = 125 + Top = 0 + Width = 376 + Height = 63 + Align = alClient + Caption = ' Predefined Functions ' + TabOrder = 1 + object pnlToolBar: TPanel + Left = 2 + Top = 15 + Width = 372 + Height = 46 + Align = alClient + BevelOuter = bvNone + Caption = 'Panel1' + TabOrder = 0 + object tbPredefined: TToolBar + Left = 19 + Top = 8 + Width = 335 + Height = 30 + Align = alNone + ButtonHeight = 24 + ButtonWidth = 25 + EdgeBorders = [ebLeft, ebTop, ebRight, ebBottom] + EdgeInner = esLowered + ParentShowHint = False + ShowHint = True + TabOrder = 0 + Wrapable = False + end + end + end + end + end + end + object pnlHeader: TPanel + Left = 0 + Top = 0 + Width = 509 + Height = 118 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object pnlHeaderMemos: TPanel + Left = 0 + Top = 46 + Width = 509 + Height = 72 + Align = alClient + BevelOuter = bvNone + ParentColor = True + TabOrder = 2 + object Label9: TLabel + Left = 0 + Top = 4 + Width = 4 + Height = 64 + Align = alLeft + AutoSize = False + Transparent = True + end + object Label10: TLabel + Left = 505 + Top = 4 + Width = 4 + Height = 64 + Align = alRight + AutoSize = False + Transparent = True + end + object Label11: TLabel + Left = 0 + Top = 0 + Width = 509 + Height = 4 + Align = alTop + AutoSize = False + Transparent = True + end + object Label12: TLabel + Left = 0 + Top = 68 + Width = 509 + Height = 4 + Align = alBottom + AutoSize = False + Transparent = True + end + object pnlHeaderMemosHost: TPanel + Left = 4 + Top = 4 + Width = 501 + Height = 64 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object memHeaderLeft: TMemo + Left = 0 + Top = 0 + Width = 167 + Height = 64 + Align = alClient + ScrollBars = ssVertical + TabOrder = 0 + OnChange = MemoChange + OnEnter = MemoEnter + OnExit = MemoExit + end + object memHeaderCenter: TMemo + Tag = 1 + Left = 167 + Top = 0 + Width = 167 + Height = 64 + Align = alRight + Alignment = taCenter + ScrollBars = ssVertical + TabOrder = 1 + OnChange = MemoChange + OnEnter = MemoEnter + OnExit = MemoExit + end + object memHeaderRight: TMemo + Tag = 2 + Left = 334 + Top = 0 + Width = 167 + Height = 64 + Align = alRight + Alignment = taRightJustify + ScrollBars = ssVertical + TabOrder = 2 + OnChange = MemoChange + OnEnter = MemoEnter + OnExit = MemoExit + end + end + end + object pnlHeaderFont: TPanel + Left = 0 + Top = 16 + Width = 509 + Height = 30 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object btnHeaderFont: TButton + Left = 4 + Top = 3 + Width = 75 + Height = 26 + Caption = '&Font...' + TabOrder = 0 + OnClick = btnHFFontClick + end + object edHeaderFontInfo: TEdit + Left = 84 + Top = 6 + Width = 244 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + end + object btnHeaderBackground: TBitBtn + Left = 333 + Top = 3 + Width = 172 + Height = 26 + Caption = '&Background' + TabOrder = 2 + OnClick = BackgroundClick + Layout = blGlyphRight + end + end + object pnlHeaderTitle: TPanel + Left = 0 + Top = 0 + Width = 509 + Height = 16 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object bvlHeader: TBevel + Left = 47 + Top = 6 + Width = 454 + Height = 5 + Shape = bsBottomLine + end + object lblHeader: TLabel + Left = 6 + Top = 2 + Width = 35 + Height = 13 + Caption = 'Header' + end + end + end + object pnlFooter: TPanel + Left = 0 + Top = 118 + Width = 509 + Height = 118 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object pnlFooterTitle: TPanel + Left = 0 + Top = 0 + Width = 509 + Height = 16 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object bvlFooter: TBevel + Left = 48 + Top = 8 + Width = 456 + Height = 4 + Shape = bsBottomLine + end + object lblFooter: TLabel + Left = 6 + Top = 3 + Width = 32 + Height = 13 + Caption = 'Footer' + end + end + object pnlFooterFont: TPanel + Left = 0 + Top = 16 + Width = 509 + Height = 30 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object btnFooterFont: TButton + Tag = 1 + Left = 4 + Top = 3 + Width = 75 + Height = 26 + Caption = 'Fo&nt...' + TabOrder = 0 + OnClick = btnHFFontClick + end + object edFooterFontInfo: TEdit + Left = 83 + Top = 6 + Width = 244 + Height = 21 + TabStop = False + Color = clBtnFace + ReadOnly = True + TabOrder = 1 + end + object btnFooterBackGround: TBitBtn + Tag = 1 + Left = 332 + Top = 3 + Width = 172 + Height = 26 + Caption = 'Back&ground' + TabOrder = 2 + OnClick = BackgroundClick + Layout = blGlyphRight + end + end + object pnlFooterMemos: TPanel + Left = 0 + Top = 46 + Width = 509 + Height = 72 + Align = alClient + BevelOuter = bvNone + ParentColor = True + TabOrder = 2 + object Label14: TLabel + Left = 0 + Top = 0 + Width = 509 + Height = 4 + Align = alTop + AutoSize = False + Transparent = True + end + object Label15: TLabel + Left = 0 + Top = 68 + Width = 509 + Height = 4 + Align = alBottom + AutoSize = False + Transparent = True + end + object Label13: TLabel + Left = 0 + Top = 4 + Width = 4 + Height = 64 + Align = alLeft + AutoSize = False + Transparent = True + end + object Label16: TLabel + Left = 505 + Top = 4 + Width = 4 + Height = 64 + Align = alRight + AutoSize = False + Transparent = True + end + object pnlFooterMemosHost: TPanel + Left = 4 + Top = 4 + Width = 501 + Height = 64 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object memFooterLeft: TMemo + Tag = 3 + Left = 0 + Top = 0 + Width = 167 + Height = 64 + Align = alClient + ScrollBars = ssVertical + TabOrder = 0 + OnChange = MemoChange + OnEnter = MemoEnter + OnExit = MemoExit + end + object memFooterCenter: TMemo + Tag = 4 + Left = 167 + Top = 0 + Width = 167 + Height = 64 + Align = alRight + Alignment = taCenter + ScrollBars = ssVertical + TabOrder = 1 + OnChange = MemoChange + OnEnter = MemoEnter + OnExit = MemoExit + end + object memFooterRight: TMemo + Tag = 5 + Left = 334 + Top = 0 + Width = 167 + Height = 64 + Align = alRight + Alignment = taRightJustify + ScrollBars = ssVertical + TabOrder = 2 + OnChange = MemoChange + OnEnter = MemoEnter + OnExit = MemoExit + end + end + end + end + object pnlReverse: TPanel + Left = 0 + Top = 303 + Width = 509 + Height = 28 + Align = alTop + BevelOuter = bvNone + TabOrder = 3 + object chbxReverseOnEvenPages: TCheckBox + Left = 7 + Top = 8 + Width = 264 + Height = 17 + Caption = '&Reverse on even pages' + TabOrder = 0 + OnClick = chbxReverseOnEvenPagesClick + end + end + end + end + object tshScaling: TTabSheet + Caption = '&Scaling' + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 509 + Height = 337 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object bvlAdjustToHolder: TBevel + Left = 35 + Top = 32 + Width = 75 + Height = 22 + Visible = False + end + object bvlFitToPageHolder: TBevel + Left = 35 + Top = 84 + Width = 75 + Height = 22 + Visible = False + end + object lblPagesWideBy: TLabel + Left = 119 + Top = 91 + Width = 77 + Height = 13 + Caption = 'page(s) &wide by' + end + object lblPercentOfNormalSize: TLabel + Left = 118 + Top = 39 + Width = 67 + Height = 13 + Caption = '% normal size' + end + object bvlFitToPageTallHolder: TBevel + Left = 261 + Top = 84 + Width = 75 + Height = 22 + Visible = False + end + object lblTall: TLabel + Left = 343 + Top = 91 + Width = 14 + Height = 13 + Caption = '&tall' + end + object rbtnAdjustTo: TRadioButton + Left = 12 + Top = 9 + Width = 150 + Height = 17 + Caption = '&Adjust To:' + Checked = True + TabOrder = 0 + TabStop = True + OnClick = ScalingClick + end + object rbtnFitTo: TRadioButton + Tag = 1 + Left = 12 + Top = 62 + Width = 150 + Height = 17 + Caption = '&Fit To:' + TabOrder = 1 + OnClick = ScalingClick + end + end + end + end + end + object ilPrintOrders: TImageList + BkColor = clWhite + AllocBy = 2 + Height = 49 + Masked = False + Width = 74 + Left = 210 + Top = 65534 + Bitmap = { + 494C01010200040004004A003100FFFFFF00FE00FFFFFFFFFFFFFFFF424D3600 + 000000000000360000002800000028010000310000000100200000000000A0E2 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080000000 + 0000000000008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080000000000000000000000000000000 + 0000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000000000000000000080800000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 80008080800080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000000000000000000000000000000000008080 + 00008080000080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF0000000000000000008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF000000 + 00000000000080800000808000000000000000000000FFFFFF0080808000FFFF + FF0000000000000000000000000000000000FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000808000008080 + 00008080000080800000FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 000000000000808000008080000080800000FFFFFF00FFFFFF0080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000080800000808000008080 + 0000808000008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080800000808000008080000080800000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000008080000080800000808000008080 + 000080800000808000008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 000080800000808000008080000080800000808000008080000080800000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF000000 + 000000000000808000008080000080800000808000008080000080808000FFFF + FF0000000000000000000000000000000000FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000808000008080000080800000808000008080 + 000080800000808000008080000080800000808000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF008080800080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 000000000000808000008080000080800000808000008080000080800000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000008080000080800000808000008080000080800000808000008080 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 000080800000808000008080000080800000808000008080000080800000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF000000 + 0000000000008080000080800000808000008080000080800000808000008080 + 000080800000000000000000000000000000FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00000000000000000080800000808000008080 + 0000808000008080000000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF000000 + 0000000000000000000000000000FFFFFF0080808000FFFFFF00000000000000 + 0000000000000000000080800000808000008080000080800000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00808000008080 + 0000808000008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF0000000000FFFFFF00808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00808080008080 + 0000808000008080000080800000FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 000080800000808000008080000080800000FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080000000 + 0000000000008080000080800000808000008080000080808000808080008080 + 8000808000008080000080800000808000008080800080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080000000000000000000808000008080 + 0000808000008080000080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808000008080000080800000808000008080000080808000808080008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080800000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 80008080800080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF008080000080800000808000008080000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008080000080800000808000008080000080800000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00000000000000000080800000808000008080000080800000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0080800000808000008080000080800000808000008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00000000000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF0000000000000000000000000080800000808000008080000080800000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000808000008080000080800000808000008080 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00000000000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080000080800000808000008080 + 0000FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080000080800000808000008080 + 000080800000FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080000000 + 0000000000008080000080800000808000008080000080808000808080008080 + 8000808080008080800080808000808080008080800080800000808000008080 + 000080800000FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080000000000000000000808000008080 + 0000808000008080000080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080800000808000008080 + 00008080000080800000FFFFFF00FFFFFF008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 80008080800080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00808000008080 + 0000808000008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 0000808000008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 000080800000808000008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080800000808000008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF008080000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008080000080800000808000008080000080800000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080000000 + 0000000000008080000080800000808000008080000080808000808080008080 + 8000808080008080800080808000808080008080800080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080800000808000008080000080800000808080008080 + 8000808080008080800080808000808080000000000000000000808000008080 + 0000808000008080000080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000FFFFFF00FFFFFF0080800000808000008080000080800000808000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 80008080800080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF008080800080800000808000008080000080800000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00808000008080000080800000808000008080 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF0000000000000000000000000000000000FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF008080000080800000808000008080 + 000000000000FFFFFF0080808000FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF008080000080800000808000008080 + 0000808000000000000000000000FFFFFF0080808000FFFFFF00000000000000 + 00000000000000000000FFFFFF0080808000FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0080800000808000008080 + 000080800000FFFFFF0080808000FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF008080800080800000808000008080 + 00008080000080800000FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00808000008080 + 0000808000008080000080808000FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00808000008080 + 0000808000008080000080800000FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF0000000000000000000000000000000000FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000008080 + 0000808000008080000080800000FFFFFF000000000000000000808000008080 + 00008080000080800000FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF008080 + 00008080000080800000808000008080000080808000FFFFFF00000000000000 + 00000000000000000000FFFFFF0080808000FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00808000008080000080800000808000000000000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF008080000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008080000080800000808000008080000000000000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF008080000080800000808000008080000080800000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF0000000000000000000000000000000000FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF0080800000808000008080000080800000808000008080 + 00008080000080800000FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF0000000000000000000000000000000000FFFF + FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF000000 + 0000000000000000000080800000808000008080000080800000808000000000 + 00000000000000000000FFFFFF0080808000FFFFFF0000000000000000000000 + 000000000000FFFFFF0080808000FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000808000008080000080800000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000808000008080000080800000808000008080 + 0000FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF0080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF008080000080800000808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080000080800000808000008080 + 000080800000FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080000000 + 0000000000008080000080800000808000008080000080808000808080008080 + 8000808080008080800080808000808080008080800080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080800000808000008080 + 0000808000008080000080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000000000000000000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 80008080800080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00808000008080 + 00008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF000000 + 00000000000080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF0000000000000000000000000000000000FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000008080 + 00008080000080800000FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000FFFFFF00FFFFFF0080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 000080800000808000008080000080800000FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF0080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF0000000000000000000000000000000000FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 00008080000080800000FFFFFF0000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000FFFFFF00FFFFFF0080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 0000808000008080000080800000808000008080000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080800000808000008080000080800000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF0080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 80008080800080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000} + end + object ilPaperTypes: TImageList + AllocBy = 8 + Left = 126 + Top = 65534 + Bitmap = { + 494C010103000800080010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000002000000001002000000000000020 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFF7FFFFF0000FFFFFF7FFFFF0000 + FFFFFF7FE0030000FFFFFC1FFFFF0000FFFFFE3FFFBF0000FF7FFF7FFF1F0000 + FF7FFFFFFE0F0000FF7FE003FFBF0000FF7FFFFFFFBF0000FC1FFF7FFFBF0000 + FE3FFE3FFFBF0000FF7FFC1FFFFF0000FFFFFF7FFFFF0000E003FF7FFFFF0000 + FFFFFF7FFFFF0000FFFFFFFFFFFF000000000000000000000000000000000000 + 000000000000} + end + object ilBins: TImageList + Left = 154 + Top = 65534 + Bitmap = { + 494C010102000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000001000000001002000000000000010 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000000000FF + FF00000000000000000000000000FFFFFF008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FFFF00000000000000 + 0000FFFFFF008080800000000000808080000000000000000000808080008080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 800080808000808080008080800000000000000000000000000080808000FFFF + FF00808080008080800000000000FFFFFF008080800080808000000000000000 + 0000808080008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF00000000000000000000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00808080000000000080808000FFFFFF00808080008080 + 8000FFFFFF008080800000000000FFFFFF008080800080808000808080008080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF0000FFFF00808080008080800080808000808080000000000000000000FFFF + FF0000FFFF00FFFFFF008080800000000000808080008080800080808000FFFF + FF00808080008080800000000000FFFFFF008080800080808000808080008080 + 8000808080008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF0000FF + FF00FFFFFF0080808000FFFFFF00FFFFFF008080800080808000808080000000 + 0000FFFFFF0000FFFF00808080000000000080808000FFFFFF00808080008080 + 800080808000FFFFFF00FFFFFF00FFFFFF008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF0000FFFF00808080008080800000FF00000000FF0000000000808080000000 + 000000FFFF00FFFFFF008080800000000000808080008080800080808000FFFF + FF00FFFFFF008080800080808000FFFFFF00FFFFFF00FFFFFF00808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000808080008080800000FF + FF00FFFFFF0000FFFF00FFFFFF008080800080808000808080000000000000FF + FF00FFFFFF0000FFFF0080808000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000FF000000FF00FFFFFF00FFFFFF00FFFF + FF00808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0080808000FFFFFF00FFFFFF000000 + 000000FFFF00FFFFFF008080800000000000000000000000000080808000FFFF + FF00FFFFFF0000FF000000FF0000FFFFFF00FFFFFF00FFFFFF00808080008080 + 800000000000FFFFFF0080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00808080008080800000FF + FF00FFFFFF0000FFFF0080808000000000000000000000000000808080008080 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF008080800080808000FFFFFF00FFFF + FF0000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0080808000000000000000000000000000000000000000 + 00008080800080808000FFFFFF0080808000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000008080800000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF0080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000080808000808080008080800080808000808080008080 + 8000FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000008080800000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF008080800000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000FFFFFF00FFFF + FF00FFFFFF008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000100000000100010000000000800000000000000000000000 + 000000000000000000000000FFFFFF00FFFFFE3F00000000E000E00F00000000 + C000800300000000800000010000000080000001000000008000000100000000 + 8000000000000000800000000000000080008000000000008000800000000000 + 8000C001000000008000F003000000008001FC0100000000C07FFF0000000000 + E0FFFF8100000000FFFFFFC70000000000000000000000000000000000000000 + 000000000000} + end + object ilPapers: TImageList + Left = 182 + Top = 65534 + Bitmap = { + 494C010102000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000001000000001002000000000000010 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00808080008080800080808000808080008080800080808000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000080800000808000FFFFFF00FFFF + FF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF0000FFFF0000808000008080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000808000FFFFFF000080800000FF + FF00FFFFFF00FFFFFF00FFFFFF000080800000808000FFFFFF00FFFFFF0000FF + FF00FFFFFF0000808000FFFFFF00008080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF0080808000808080008080800080808000808080008080800080808000FFFF + FF00FFFFFF00FFFFFF0000000000000000000080800000FFFF00FFFFFF000080 + 8000FFFFFF0000FFFF0000808000FFFFFF00FFFFFF0000808000FFFFFF00FFFF + FF000080800000FFFF00FFFFFF00008080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000808000FFFFFF00FFFFFF0000FF + FF000000000000808000FFFFFF0000FFFF00FFFFFF00FFFFFF00008080000000 + 0000FFFFFF00FFFFFF00FFFFFF00008080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF0080808000808080008080800080808000808080008080800080808000FFFF + FF00FFFFFF00FFFFFF0000000000000000000080800000FFFF00FFFFFF00FFFF + FF000080800000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF000080 + 8000FFFFFF0000FFFF00FFFFFF00008080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000808000FFFFFF00FFFFFF000080 + 8000FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF0000808000FFFFFF00FFFFFF00008080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF0080808000808080008080800080808000808080008080800080808000FFFF + FF00FFFFFF00FFFFFF0000000000000000000080800000FFFF0000808000FFFF + FF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFF + FF00FFFFFF0000808000FFFFFF00008080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000080800000808000FFFFFF0000FF + FF00FFFFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF0000FF + FF00FFFFFF00FFFFFF0000808000008080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000080800000808000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000008080000080800000808000008080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000080808000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000100000000100010000000000800000000000000000000000 + 000000000000000000000000FFFFFF00C001FFFF00000000C001FFFF00000000 + C001FFFF00000000C001000000000000C001000000000000C001000000000000 + C001000000000000C001081000000000C001000000000000C001000000000000 + C001000000000000C001000000000000C001000000000000C003FFFF00000000 + C007FFFF00000000C00FFFFF0000000000000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxPrevw.dcu b/official/x.35/Lib/D11/dxPrevw.dcu new file mode 100644 index 00000000..03bccec0 Binary files /dev/null and b/official/x.35/Lib/D11/dxPrevw.dcu differ diff --git a/official/x.35/Lib/D11/dxPrnDev.dcu b/official/x.35/Lib/D11/dxPrnDev.dcu new file mode 100644 index 00000000..90decf9c Binary files /dev/null and b/official/x.35/Lib/D11/dxPrnDev.dcu differ diff --git a/official/x.35/Lib/D11/dxPrnDlg.dcu b/official/x.35/Lib/D11/dxPrnDlg.dcu new file mode 100644 index 00000000..e93b030e Binary files /dev/null and b/official/x.35/Lib/D11/dxPrnDlg.dcu differ diff --git a/official/x.35/Lib/D11/dxPrnDlg.dfm b/official/x.35/Lib/D11/dxPrnDlg.dfm new file mode 100644 index 00000000..9f13c063 --- /dev/null +++ b/official/x.35/Lib/D11/dxPrnDlg.dfm @@ -0,0 +1,862 @@ +object dxfmPrintDialog: TdxfmPrintDialog + Left = 384 + Top = 200 + BorderStyle = bsDialog + Caption = 'Print' + ClientHeight = 458 + ClientWidth = 484 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 0 + Top = 427 + Width = 484 + Height = 31 + Align = alBottom + BevelOuter = bvNone + TabOrder = 3 + object btnPreview: TBitBtn + Left = 113 + Top = 2 + Width = 105 + Height = 23 + Caption = 'Print Pre&view' + TabOrder = 1 + OnClick = btnPreviewClick + end + object btnOK: TButton + Left = 234 + Top = 2 + Width = 79 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 2 + end + object btnCancel: TButton + Left = 318 + Top = 2 + Width = 79 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 3 + end + object btnHelp: TButton + Left = 402 + Top = 2 + Width = 79 + Height = 23 + Caption = '&Help' + TabOrder = 4 + end + object btnPageSetup: TBitBtn + Left = 3 + Top = 2 + Width = 105 + Height = 23 + Caption = 'Page Set&up...' + TabOrder = 0 + OnClick = btnPageSetupClick + Layout = blGlyphRight + end + end + object pnlPrintStyles: TPanel + Left = 0 + Top = 317 + Width = 484 + Height = 105 + Align = alTop + BevelOuter = bvNone + BorderWidth = 3 + TabOrder = 2 + object gbxPrintStyles: TGroupBox + Left = 3 + Top = 3 + Width = 478 + Height = 99 + Align = alClient + Caption = ' Print Styles ' + TabOrder = 0 + object lbxPrintStyles: TListBox + Left = 7 + Top = 15 + Width = 322 + Height = 78 + Style = lbOwnerDrawFixed + ItemHeight = 34 + PopupMenu = pmPrintStyles + TabOrder = 0 + OnClick = lbxPrintStylesClick + OnDblClick = PageSetup2Click + OnDrawItem = lbxPrintStylesDrawItem + end + object btnPageSetup2: TButton + Left = 335 + Top = 15 + Width = 136 + Height = 23 + Caption = 'Page Set&up...' + Default = True + TabOrder = 1 + OnClick = PageSetup2Click + end + object btnDefineStyles: TButton + Left = 335 + Top = 42 + Width = 136 + Height = 23 + Caption = 'Define S&tyles...' + TabOrder = 2 + OnClick = DefineStylesClick + end + end + end + object pnlMiddle: TPanel + Left = 0 + Top = 164 + Width = 484 + Height = 153 + Align = alTop + BevelOuter = bvNone + BorderWidth = 3 + TabOrder = 1 + object gbxPageRange: TGroupBox + Left = 3 + Top = 3 + Width = 244 + Height = 147 + Align = alLeft + Caption = ' Page ra&nge ' + TabOrder = 0 + object lblDescription: TLabel + Left = 6 + Top = 98 + Width = 232 + Height = 41 + AutoSize = False + Caption = + 'Enter page number and/or page ranges'#13#10'separated by commes. For e' + + 'xample : 1,3,5-12' + Transparent = True + WordWrap = True + end + object bvlPRWarningHolder: TBevel + Left = 80 + Top = 12 + Width = 157 + Height = 30 + Visible = False + end + object rbtnAllPages: TRadioButton + Left = 9 + Top = 23 + Width = 58 + Height = 17 + Caption = '&All' + Checked = True + TabOrder = 0 + TabStop = True + OnClick = rbtnPagesClick + end + object rbtnCurrentPage: TRadioButton + Tag = 1 + Left = 9 + Top = 48 + Width = 104 + Height = 17 + Caption = 'Curr&ent page' + TabOrder = 1 + OnClick = rbtnPagesClick + end + object rbtnPageRanges: TRadioButton + Tag = 2 + Left = 9 + Top = 72 + Width = 67 + Height = 17 + Caption = 'Pa&ges: ' + TabOrder = 2 + OnClick = rbtnPagesClick + end + object edPageRanges: TEdit + Left = 80 + Top = 70 + Width = 157 + Height = 21 + AutoSelect = False + TabOrder = 3 + OnChange = edPageRangesChange + OnExit = edPageRangesExit + OnKeyPress = edPageRangesKeyPress + end + object rbtnSelection: TRadioButton + Tag = 3 + Left = 116 + Top = 48 + Width = 113 + Height = 17 + Caption = '&Selection' + TabOrder = 4 + OnClick = rbtnPagesClick + end + end + object gbxCopies: TGroupBox + Left = 251 + Top = 3 + Width = 230 + Height = 147 + Align = alRight + Caption = ' C&opies ' + TabOrder = 1 + object lblNumberOfCopies: TLabel + Left = 11 + Top = 48 + Width = 90 + Height = 13 + Caption = 'Number of &copies :' + OnClick = lblNumberOfCopiesClick + end + object bvlCopiesHolder: TBevel + Left = 122 + Top = 43 + Width = 101 + Height = 22 + Visible = False + end + object lblNumberOfPages: TLabel + Left = 11 + Top = 21 + Width = 89 + Height = 13 + Caption = 'Number of pa&ges :' + FocusControl = cbxNumberOfPages + OnClick = lblNumberOfPagesClick + end + object pbxCollate: TPaintBox + Left = 62 + Top = 96 + Width = 118 + Height = 44 + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -9 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + OnDblClick = pbxCollateDblClick + OnPaint = pbxCollatePaint + end + object chbxCollate: TCheckBox + Left = 9 + Top = 74 + Width = 171 + Height = 17 + Caption = 'Co&llate copies' + TabOrder = 1 + OnClick = chbxCollateClick + end + object cbxNumberOfPages: TComboBox + Left = 122 + Top = 17 + Width = 101 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + OnChange = cbxNumberOfPagesChange + Items.Strings = ( + 'All' + 'Even' + 'Odd') + end + end + end + object pnlTop: TPanel + Left = 0 + Top = 0 + Width = 484 + Height = 164 + Align = alTop + BevelOuter = bvNone + BorderWidth = 3 + TabOrder = 0 + object gbxPrinter: TGroupBox + Left = 3 + Top = 3 + Width = 478 + Height = 158 + Align = alClient + Caption = ' &Printer ' + TabOrder = 0 + object lblName: TLabel + Left = 8 + Top = 20 + Width = 31 + Height = 13 + Caption = '&Name:' + FocusControl = cbxPrinters + OnClick = lblNameClick + end + object lblStatus: TLabel + Left = 8 + Top = 48 + Width = 35 + Height = 13 + Caption = 'Status:' + end + object lblType: TLabel + Left = 8 + Top = 67 + Width = 28 + Height = 13 + Caption = 'Type:' + end + object lblWhere: TLabel + Left = 8 + Top = 86 + Width = 36 + Height = 13 + Caption = 'Where:' + end + object lblComment: TLabel + Left = 8 + Top = 105 + Width = 49 + Height = 13 + Caption = 'Comment:' + end + object lStatus: TLabel + Left = 90 + Top = 49 + Width = 31 + Height = 13 + Caption = 'Status' + end + object lType: TLabel + Left = 90 + Top = 68 + Width = 24 + Height = 13 + Caption = 'Type' + end + object lWhere: TLabel + Left = 90 + Top = 87 + Width = 32 + Height = 13 + Caption = 'Where' + end + object lComment: TLabel + Left = 90 + Top = 106 + Width = 45 + Height = 13 + Caption = 'Comment' + end + object cbxPrinters: TComboBox + Left = 90 + Top = 15 + Width = 280 + Height = 26 + Style = csOwnerDrawFixed + ItemHeight = 20 + TabOrder = 0 + OnChange = cbxPrintersChange + OnDrawItem = cbxPrintersDrawItem + end + object btnPrinterProperties: TButton + Left = 376 + Top = 15 + Width = 95 + Height = 26 + Caption = 'P&roperties...' + TabOrder = 1 + OnClick = btnPrinterPropertiesClick + end + object btnNetwork: TButton + Left = 376 + Top = 45 + Width = 95 + Height = 26 + Caption = 'Net&work...' + TabOrder = 2 + OnClick = btnNetworkClick + end + object pnlPrintToFile: TPanel + Left = 2 + Top = 120 + Width = 474 + Height = 36 + Align = alBottom + BevelOuter = bvNone + TabOrder = 3 + object chbxPrintToFile: TCheckBox + Left = 8 + Top = 10 + Width = 136 + Height = 15 + Caption = 'Print to &file' + TabOrder = 0 + OnClick = chbxPrintToFileClick + end + object cbxFileName: TComboBox + Left = 150 + Top = 7 + Width = 216 + Height = 21 + ItemHeight = 13 + TabOrder = 1 + Text = 'cbxFileName' + OnExit = cbxFileNameExit + end + object btnBrowse: TButton + Left = 374 + Top = 6 + Width = 95 + Height = 23 + Caption = '&Browse...' + TabOrder = 2 + OnClick = btnBrowseClick + end + end + end + end + object ilPrinters: TImageList + AllocBy = 7 + Left = 85 + Top = 357 + Bitmap = { + 494C010107000C000C0010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008400 + 0000840000008400000084000000840000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000840000008400 + 0000840000008484840084000000FFFFFF008400000084000000840000008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008400000084000000840000008400000084000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 8400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 0000840000000000000000000000000000000000000000000000848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000840000008400 + 0000840000008400000084000000840000008400000084000000840000008400 + 0000840000008400000084000000000000008400000084000000848484008484 + 8400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 000084000000000000000000000000000000000000008484840000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000840000008400 + 000084000000840000008484840084000000FFFFFF0084000000840000008400 + 0000840000008400000084000000000000008400000084000000848484008484 + 8400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 000084000000000000000000000000000000000000008484840000FFFF0000FF + FF0000FFFF0000FFFF00C6C6C600000000000084840000FFFF0000FFFF0000FF + FF0000FFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000008400000084000000848484008484 + 8400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 000084000000000000000000000000000000000000008484840000FFFF0000FF + FF0000FFFF0000FFFF000084840000000000C6C6C60000FFFF0000FFFF0000FF + FF0000FFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000008400000084000000848484008484 + 8400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 00008400000084000000840000008400000000000000000000008484840000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000008400000084000000848484008484 + 8400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 000084000000FFFFFF00840000008400000000000000000000008484840000FF + FF0000FFFF0000FFFF0000FFFF000000000000FFFF0000FFFF0000FFFF0000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000008400000084000000848484008484 + 840084848400840000008484840084000000FFFFFF00FFFFFF00FFFFFF008400 + 000084000000FFFFFF0084000000840000000000000000000000000000008484 + 840000FFFF0000FFFF0000FFFF000000000000FFFF0000FFFF0000FFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000084000000840000008400 + 0000840000008484840084848400848484008400000084000000840000008400 + 0000FFFFFF00FFFFFF0084000000840000000000000000000000000000008484 + 840000FFFF0000FFFF0000848400000000000084840000FFFF0000FFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000008400 + 0000840000008484840084848400848484008484840084000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000840000000000000000000000000000000000 + 00008484840000FFFF0000848400000000000084840000FFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000008400 + 0000840000008484840084848400848484008484840084000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000840000000000000000000000000000000000 + 00008484840000FFFF0000848400000000000084840000FFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 84008484840084848400840000000000000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000008400 + 0000840000008484840084848400848484008484840084000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000840000000000000000000000000000000000 + 0000000000008484840000FFFF000000000000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084000000840000008400 + 0000840000008400000000000000000000000000000084000000840000008400 + 0000840000008400000000000000000000000000000000000000000000008400 + 000084000000848484008484840084848400840000000000000084000000FFFF + FF00FFFFFF00FFFFFF0084000000840000000000000000000000000000000000 + 0000000000008484840000FFFF0000FFFF0000FFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000840000008400000084000000840000000000000000000000000000008400 + 0000840000008400000084000000000000000000000000000000000000000000 + 000000000000000000008484840000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000C6C6C600848484008484840000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000084840000FFFF00C6C6C600008484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000C0C0C000808080008080800000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000080800000FFFF00C0C0C000008080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400C6C6C600C6C6C60084848400000000000000000084848400848484000000 + 000000000000000000000000000000000000C6C6C600C6C6C600C6C6C600C6C6 + C600C6C6C60084848400000000000000000000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C6000000000000000000000000008080 + 8000C0C0C000C0C0C00080808000000000000000000080808000808080000000 + 000000000000000000000000000000000000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C00080808000000000000000000000000000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C0000000000084848400C6C6C6008484 + 84008484840084848400C6C6C600848484008484840000000000000000008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000008484840084848400848484008484840000000000000000000000 + 0000000000000000000000000000000000000000000080808000C0C0C0008080 + 80008080800080808000C0C0C000808080008080800000000000000000008080 + 8000808080000000000000000000000000000000000000000000000000000000 + 0000000000008080800080808000808080008080800000000000000000000000 + 0000000000000000000000000000000000000000000084848400848484008484 + 8400C6C6C600C6C6C600C6C6C600848484008484840084848400848484000000 + 0000000000008484840000000000000000000000000000000000000000000000 + 0000C6C6C600C6C6C600C6C6C600848484008484840084848400848484000000 + 0000000000000000000000000000000000000000000080808000808080008080 + 8000C0C0C000C0C0C000C0C0C000808080008080800080808000808080000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000C0C0C000C0C0C000C0C0C000808080008080800080808000808080000000 + 0000000000000000000000000000000000008484840084848400C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084848400848484008484 + 840084848400000000000000000000000000000000008484840084848400C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084848400848484008484 + 8400848484000000000000000000000000008080800080808000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000808080008080800080808000808080008080 + 800080808000000000000000000000000000000000008080800080808000C0C0 + C000C0C0C000C0C0C000C0C0C000808080008080800080808000808080008080 + 800080808000000000000000000000000000C6C6C600C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084848400848484008484 + 840084848400848484008484840000000000C6C6C600C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C600C6C6C600848484008484840084848400848484008484 + 840084848400848484008484840000000000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000808080008080800080808000808080008080 + 800080808000808080008080800000000000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000808080008080800080808000808080008080 + 800080808000808080008080800000000000C6C6C600FFFFFF00C6C6C600C6C6 + C600FFFFFF00FFFFFF00C6C6C600C6C6C600C6C6C60084848400848484008484 + 840084848400848484008484840000000000C6C6C600FFFFFF00C6C6C600C6C6 + C600FFFFFF00FFFFFF00C6C6C600C6C6C600C6C6C60084848400848484008484 + 840084848400848484008484840000000000C0C0C000FFFFFF00C0C0C000C0C0 + C000FFFFFF00FFFFFF00C0C0C000C0C0C000C0C0C00080808000808080008080 + 800080808000808080008080800000000000C0C0C000FFFFFF00C0C0C000C0C0 + C000FFFFFF00FFFFFF00C0C0C000C0C0C000C0C0C00080808000808080008080 + 800080808000808080008080800000000000C6C6C600FFFFFF00FFFFFF00FFFF + FF00C6C6C600C6C6C6000000FF0084848400C6C6C600C6C6C600C6C6C6008484 + 840084848400848484008484840000000000C6C6C600FFFFFF00FFFFFF00FFFF + FF00C6C6C600C6C6C6000000FF0084848400C6C6C600C6C6C600C6C6C6008484 + 840084848400848484008484840000000000C0C0C000FFFFFF00FFFFFF00FFFF + FF00C0C0C000C0C0C0000000FF0080808000C0C0C000C0C0C000C0C0C0008080 + 800080808000808080008080800000000000C0C0C000FFFFFF00FFFFFF00FFFF + FF00C0C0C000C0C0C0000000FF0080808000C0C0C000C0C0C000C0C0C0008080 + 800080808000808080008080800000000000C6C6C600FFFFFF00C6C6C600C6C6 + C60000FF00008484840084848400C6C6C600C6C6C60084848400848484000000 + 0000C6C6C600848484008484840000000000C6C6C600FFFFFF00C6C6C600C6C6 + C60000FF00008484840084848400C6C6C600C6C6C60084848400848484000000 + 0000C6C6C600848484008484840000000000C0C0C000FFFFFF00C0C0C000C0C0 + C00000FF00008080800080808000C0C0C000C0C0C00080808000808080000000 + 0000C0C0C000808080008080800000000000C0C0C000FFFFFF00C0C0C000C0C0 + C00000FF00008080800080808000C0C0C000C0C0C00080808000808080000000 + 0000C0C0C0008080800080808000000000000000000084848400C6C6C600C6C6 + C60084848400C6C6C600C6C6C60084848400C6C6C600C6C6C600C6C6C6000000 + 0000C6C6C6000000000000000000000000000000000084848400C6C6C600C6C6 + C60084848400C6C6C600C6C6C6008484840084848400C6C6C600C6C6C6000000 + 0000C6C6C6008484840084848400000000000000000080808000C0C0C000C0C0 + C00080808000C0C0C000C0C0C00080808000C0C0C000C0C0C000C0C0C0000000 + 0000C0C0C0000000000000000000000000000000000080808000C0C0C000C0C0 + C00080808000C0C0C000C0C0C0008080800080808000C0C0C000C0C0C0000000 + 0000C0C0C000808080008080800000000000000000000000000000000000C6C6 + C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600FFFFFF00FFFFFF008484 + 840000000000000000000000000000000000000000000000000000000000C6C6 + C600C6C6C600C6C6C60084848400C6C6C600C6C6C600FFFFFF00FFFFFF008484 + 8400848484000000000000000000000000008080800000000000000000000000 + 000080808000C0C0C000C0C0C000C0C0C000C0C0C000FFFFFF00FFFFFF008080 + 8000000000000000000000000000000000008080800000000000000000000000 + 000080808000C0C0C00080808000C0C0C000C0C0C000FFFFFF00FFFFFF008080 + 8000808080000000000000000000000000000000000000000000000000000000 + 00000000000084848400C6C6C600FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00848484000000000000000000000000000000000000000000000000000000 + 0000000000008484840084848400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00848484000000000000000000000000000000000000000000FFFFFF000000 + 00000000000080808000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00808080000000000000000000000000000000000000000000FFFFFF000000 + 0000000000008080800080808000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00808080000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000C6C6C600FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000C6C6C600FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0084848400000000000000000000000000C0C0C00000000000FFFF + FF0000000000FFFFFF0000000000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0080808000000000000000000000000000C0C0C00000000000FFFF + FF0000000000FFFFFF0000000000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008080800000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000C6C6C600FFFFFF00FFFFFF00FFFF + FF00C6C6C600C6C6C60000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000C6C6C600FFFFFF00FFFFFF00FFFF + FF00C6C6C600C6C6C60000000000000000000000000000000000000000000000 + 000000000000FFFFFF000000000000000000C0C0C000FFFFFF00FFFFFF00FFFF + FF00C0C0C000C0C0C00000000000000000000000000000000000000000000000 + 000000000000FFFFFF000000000000000000C0C0C000FFFFFF00FFFFFF00FFFF + FF00C0C0C000C0C0C00000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000C6C6C600C6C6C600C6C6 + C600000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000C6C6C600C6C6C600C6C6 + C600000000000000000000000000000000008080800000000000000000000000 + 00008080800000000000000000000000000000000000C0C0C000C0C0C000C0C0 + C000000000000000000000000000000000008080800000000000000000000000 + 00008080800000000000000000000000000000000000C0C0C000C0C0C000C0C0 + C00000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFE0FFFFFF0000FFFF0007E0030000 + F83F0007C0010000000100078001000000010007800300000001000780030000 + 00010000C007000000010000C007000000010000E00F000000018000E00F0000 + 0001E000F01F00000001E000F01F00000101E000F83F00008383E040F83F0000 + FFFFF0E1FC7F0000FFFFFFFFFE7F0000FC7FF87FFC7FF87FF01F0000F01F0000 + C0070000C00700008001F01F8001F01F8001C0078001C0070001000100010001 + 0000000000000000000000000000000000000000000000000000000000000000 + 8001800180018001E007E00700070007F803F80300030003FE00FE0002000200 + FF03FF0303030303FF8FFF8F078F078F00000000000000000000000000000000 + 000000000000} + end + object pmPrintStyles: TPopupMenu + OnPopup = pmPrintStylesPopup + Left = 27 + Top = 357 + object miPageSetup: TMenuItem + Caption = 'Page Set&up...' + Default = True + ShortCut = 16397 + OnClick = PageSetup2Click + end + object miLine1: TMenuItem + Caption = '-' + end + object miDefineStyles: TMenuItem + Caption = 'Define Styles...' + OnClick = DefineStylesClick + end + end +end diff --git a/official/x.35/Lib/D11/dxPrnPg.dcu b/official/x.35/Lib/D11/dxPrnPg.dcu new file mode 100644 index 00000000..1ad6a3d3 Binary files /dev/null and b/official/x.35/Lib/D11/dxPrnPg.dcu differ diff --git a/official/x.35/Lib/D11/dxPsPrVwAdvD11.dcp b/official/x.35/Lib/D11/dxPsPrVwAdvD11.dcp new file mode 100644 index 00000000..07ba07c7 Binary files /dev/null and b/official/x.35/Lib/D11/dxPsPrVwAdvD11.dcp differ diff --git a/official/x.35/Lib/D11/dxPscxTLLnkD11.bpl b/official/x.35/Lib/D11/dxPscxTLLnkD11.bpl new file mode 100644 index 00000000..cbf265c9 Binary files /dev/null and b/official/x.35/Lib/D11/dxPscxTLLnkD11.bpl differ diff --git a/official/x.35/Lib/D11/dxRibbon.dcu b/official/x.35/Lib/D11/dxRibbon.dcu new file mode 100644 index 00000000..7efe532e Binary files /dev/null and b/official/x.35/Lib/D11/dxRibbon.dcu differ diff --git a/official/x.35/Lib/D11/dxRibbonD11.bpl b/official/x.35/Lib/D11/dxRibbonD11.bpl new file mode 100644 index 00000000..a7f8a8a0 Binary files /dev/null and b/official/x.35/Lib/D11/dxRibbonD11.bpl differ diff --git a/official/x.35/Lib/D11/dxRibbonD11.dcp b/official/x.35/Lib/D11/dxRibbonD11.dcp new file mode 100644 index 00000000..a03c077f Binary files /dev/null and b/official/x.35/Lib/D11/dxRibbonD11.dcp differ diff --git a/official/x.35/Lib/D11/dxRibbonD11.dcu b/official/x.35/Lib/D11/dxRibbonD11.dcu new file mode 100644 index 00000000..c7f450cb Binary files /dev/null and b/official/x.35/Lib/D11/dxRibbonD11.dcu differ diff --git a/official/x.35/Lib/D11/dxRibbonForm.dcu b/official/x.35/Lib/D11/dxRibbonForm.dcu new file mode 100644 index 00000000..d0f3316d Binary files /dev/null and b/official/x.35/Lib/D11/dxRibbonForm.dcu differ diff --git a/official/x.35/Lib/D11/dxRibbonFormCaptionHelper.dcu b/official/x.35/Lib/D11/dxRibbonFormCaptionHelper.dcu new file mode 100644 index 00000000..6331f33d Binary files /dev/null and b/official/x.35/Lib/D11/dxRibbonFormCaptionHelper.dcu differ diff --git a/official/x.35/Lib/D11/dxRibbonGallery.dcu b/official/x.35/Lib/D11/dxRibbonGallery.dcu new file mode 100644 index 00000000..55f9923c Binary files /dev/null and b/official/x.35/Lib/D11/dxRibbonGallery.dcu differ diff --git a/official/x.35/Lib/D11/dxRibbonGalleryFilterEd.dcu b/official/x.35/Lib/D11/dxRibbonGalleryFilterEd.dcu new file mode 100644 index 00000000..5a1490aa Binary files /dev/null and b/official/x.35/Lib/D11/dxRibbonGalleryFilterEd.dcu differ diff --git a/official/x.35/Lib/D11/dxRibbonGalleryFilterEd.dfm b/official/x.35/Lib/D11/dxRibbonGalleryFilterEd.dfm new file mode 100644 index 00000000..04d280bd --- /dev/null +++ b/official/x.35/Lib/D11/dxRibbonGalleryFilterEd.dfm @@ -0,0 +1,59 @@ +object fmGalleryFilterGroups: TfmGalleryFilterGroups + Left = 0 + Top = 0 + AutoScroll = False + BorderStyle = bsSizeToolWin + Caption = 'fmGalleryFilterGroups' + ClientHeight = 265 + ClientWidth = 423 + Color = clBtnFace + Constraints.MinHeight = 250 + Constraints.MinWidth = 350 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object GroupBox1: TGroupBox + Left = 8 + Top = 8 + Width = 306 + Height = 250 + Anchors = [akLeft, akTop, akRight, akBottom] + Caption = ' Groups ' + TabOrder = 0 + object clbGroups: TCheckListBox + Left = 8 + Top = 16 + Width = 289 + Height = 225 + Anchors = [akLeft, akTop, akRight, akBottom] + ItemHeight = 13 + TabOrder = 0 + end + end + object btnOk: TButton + Left = 320 + Top = 23 + Width = 95 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'OK' + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 320 + Top = 54 + Width = 95 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end +end diff --git a/official/x.35/Lib/D11/dxRibbonGalleryReg.dcu b/official/x.35/Lib/D11/dxRibbonGalleryReg.dcu new file mode 100644 index 00000000..374045a3 Binary files /dev/null and b/official/x.35/Lib/D11/dxRibbonGalleryReg.dcu differ diff --git a/official/x.35/Lib/D11/dxRibbonGroupLayoutCalculator.dcu b/official/x.35/Lib/D11/dxRibbonGroupLayoutCalculator.dcu new file mode 100644 index 00000000..99a2b527 Binary files /dev/null and b/official/x.35/Lib/D11/dxRibbonGroupLayoutCalculator.dcu differ diff --git a/official/x.35/Lib/D11/dxRibbonReg.dcr b/official/x.35/Lib/D11/dxRibbonReg.dcr new file mode 100644 index 00000000..5b006c55 Binary files /dev/null and b/official/x.35/Lib/D11/dxRibbonReg.dcr differ diff --git a/official/x.35/Lib/D11/dxRibbonReg.dcu b/official/x.35/Lib/D11/dxRibbonReg.dcu new file mode 100644 index 00000000..0b207ab0 Binary files /dev/null and b/official/x.35/Lib/D11/dxRibbonReg.dcu differ diff --git a/official/x.35/Lib/D11/dxRibbonSkins.dcu b/official/x.35/Lib/D11/dxRibbonSkins.dcu new file mode 100644 index 00000000..3df0c130 Binary files /dev/null and b/official/x.35/Lib/D11/dxRibbonSkins.dcu differ diff --git a/official/x.35/Lib/D11/dxRibbonStatusBar.dcu b/official/x.35/Lib/D11/dxRibbonStatusBar.dcu new file mode 100644 index 00000000..55de4993 Binary files /dev/null and b/official/x.35/Lib/D11/dxRibbonStatusBar.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinBlack.dcu b/official/x.35/Lib/D11/dxSkinBlack.dcu new file mode 100644 index 00000000..acb918cc Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinBlack.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinBlack.res b/official/x.35/Lib/D11/dxSkinBlack.res new file mode 100644 index 00000000..3bf1d1dd Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinBlack.res differ diff --git a/official/x.35/Lib/D11/dxSkinBlackD11.bpl b/official/x.35/Lib/D11/dxSkinBlackD11.bpl new file mode 100644 index 00000000..0240829a Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinBlackD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinBlackD11.dcp b/official/x.35/Lib/D11/dxSkinBlackD11.dcp new file mode 100644 index 00000000..5c9a3302 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinBlackD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinBlackD11.dcu b/official/x.35/Lib/D11/dxSkinBlackD11.dcu new file mode 100644 index 00000000..d8ba20d4 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinBlackD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinBlue.dcu b/official/x.35/Lib/D11/dxSkinBlue.dcu new file mode 100644 index 00000000..040e0434 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinBlue.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinBlue.res b/official/x.35/Lib/D11/dxSkinBlue.res new file mode 100644 index 00000000..9fae1a41 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinBlue.res differ diff --git a/official/x.35/Lib/D11/dxSkinBlueD11.bpl b/official/x.35/Lib/D11/dxSkinBlueD11.bpl new file mode 100644 index 00000000..1d834165 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinBlueD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinBlueD11.dcp b/official/x.35/Lib/D11/dxSkinBlueD11.dcp new file mode 100644 index 00000000..49275bdc Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinBlueD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinBlueD11.dcu b/official/x.35/Lib/D11/dxSkinBlueD11.dcu new file mode 100644 index 00000000..5d65732e Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinBlueD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinCaramel.dcu b/official/x.35/Lib/D11/dxSkinCaramel.dcu new file mode 100644 index 00000000..4af8c049 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinCaramel.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinCaramel.res b/official/x.35/Lib/D11/dxSkinCaramel.res new file mode 100644 index 00000000..1c83666e Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinCaramel.res differ diff --git a/official/x.35/Lib/D11/dxSkinCaramelD11.bpl b/official/x.35/Lib/D11/dxSkinCaramelD11.bpl new file mode 100644 index 00000000..69f2b58c Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinCaramelD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinCaramelD11.dcp b/official/x.35/Lib/D11/dxSkinCaramelD11.dcp new file mode 100644 index 00000000..3ccf510e Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinCaramelD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinCaramelD11.dcu b/official/x.35/Lib/D11/dxSkinCaramelD11.dcu new file mode 100644 index 00000000..32db5e93 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinCaramelD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinCoffee.dcu b/official/x.35/Lib/D11/dxSkinCoffee.dcu new file mode 100644 index 00000000..f0808363 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinCoffee.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinCoffee.res b/official/x.35/Lib/D11/dxSkinCoffee.res new file mode 100644 index 00000000..1d3bc842 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinCoffee.res differ diff --git a/official/x.35/Lib/D11/dxSkinCoffeeD11.bpl b/official/x.35/Lib/D11/dxSkinCoffeeD11.bpl new file mode 100644 index 00000000..92b1b997 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinCoffeeD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinCoffeeD11.dcp b/official/x.35/Lib/D11/dxSkinCoffeeD11.dcp new file mode 100644 index 00000000..e39ad226 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinCoffeeD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinCoffeeD11.dcu b/official/x.35/Lib/D11/dxSkinCoffeeD11.dcu new file mode 100644 index 00000000..75a15b94 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinCoffeeD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinGlassOceans.dcu b/official/x.35/Lib/D11/dxSkinGlassOceans.dcu new file mode 100644 index 00000000..45328cbb Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinGlassOceans.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinGlassOceans.res b/official/x.35/Lib/D11/dxSkinGlassOceans.res new file mode 100644 index 00000000..833962ba Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinGlassOceans.res differ diff --git a/official/x.35/Lib/D11/dxSkinGlassOceansD11.bpl b/official/x.35/Lib/D11/dxSkinGlassOceansD11.bpl new file mode 100644 index 00000000..a76fb4ec Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinGlassOceansD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinGlassOceansD11.dcp b/official/x.35/Lib/D11/dxSkinGlassOceansD11.dcp new file mode 100644 index 00000000..8cd37c21 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinGlassOceansD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinGlassOceansD11.dcu b/official/x.35/Lib/D11/dxSkinGlassOceansD11.dcu new file mode 100644 index 00000000..0e936673 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinGlassOceansD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinInfo.dcu b/official/x.35/Lib/D11/dxSkinInfo.dcu new file mode 100644 index 00000000..5951c726 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinInfo.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinLilian.dcu b/official/x.35/Lib/D11/dxSkinLilian.dcu new file mode 100644 index 00000000..5616814b Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinLilian.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinLilian.res b/official/x.35/Lib/D11/dxSkinLilian.res new file mode 100644 index 00000000..6d8906db Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinLilian.res differ diff --git a/official/x.35/Lib/D11/dxSkinLilianD11.bpl b/official/x.35/Lib/D11/dxSkinLilianD11.bpl new file mode 100644 index 00000000..98042190 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinLilianD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinLilianD11.dcp b/official/x.35/Lib/D11/dxSkinLilianD11.dcp new file mode 100644 index 00000000..4b60e1fc Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinLilianD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinLilianD11.dcu b/official/x.35/Lib/D11/dxSkinLilianD11.dcu new file mode 100644 index 00000000..55d1e1f4 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinLilianD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinLiquidSky.dcu b/official/x.35/Lib/D11/dxSkinLiquidSky.dcu new file mode 100644 index 00000000..ee1c7da1 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinLiquidSky.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinLiquidSky.res b/official/x.35/Lib/D11/dxSkinLiquidSky.res new file mode 100644 index 00000000..06276a0e Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinLiquidSky.res differ diff --git a/official/x.35/Lib/D11/dxSkinLiquidSkyD11.bpl b/official/x.35/Lib/D11/dxSkinLiquidSkyD11.bpl new file mode 100644 index 00000000..af2537a3 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinLiquidSkyD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinLiquidSkyD11.dcp b/official/x.35/Lib/D11/dxSkinLiquidSkyD11.dcp new file mode 100644 index 00000000..aa5fcb97 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinLiquidSkyD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinLiquidSkyD11.dcu b/official/x.35/Lib/D11/dxSkinLiquidSkyD11.dcu new file mode 100644 index 00000000..473925fa Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinLiquidSkyD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinLondonLiquidSky.dcu b/official/x.35/Lib/D11/dxSkinLondonLiquidSky.dcu new file mode 100644 index 00000000..19401d85 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinLondonLiquidSky.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinLondonLiquidSky.res b/official/x.35/Lib/D11/dxSkinLondonLiquidSky.res new file mode 100644 index 00000000..df858257 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinLondonLiquidSky.res differ diff --git a/official/x.35/Lib/D11/dxSkinLondonLiquidSkyD11.bpl b/official/x.35/Lib/D11/dxSkinLondonLiquidSkyD11.bpl new file mode 100644 index 00000000..45e825d1 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinLondonLiquidSkyD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinLondonLiquidSkyD11.dcp b/official/x.35/Lib/D11/dxSkinLondonLiquidSkyD11.dcp new file mode 100644 index 00000000..ff3e9c80 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinLondonLiquidSkyD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinLondonLiquidSkyD11.dcu b/official/x.35/Lib/D11/dxSkinLondonLiquidSkyD11.dcu new file mode 100644 index 00000000..98216c45 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinLondonLiquidSkyD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinMcSkin.dcu b/official/x.35/Lib/D11/dxSkinMcSkin.dcu new file mode 100644 index 00000000..102e97d0 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinMcSkin.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinMcSkin.res b/official/x.35/Lib/D11/dxSkinMcSkin.res new file mode 100644 index 00000000..c585ad2d Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinMcSkin.res differ diff --git a/official/x.35/Lib/D11/dxSkinMcSkinD11.bpl b/official/x.35/Lib/D11/dxSkinMcSkinD11.bpl new file mode 100644 index 00000000..26526390 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinMcSkinD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinMcSkinD11.dcp b/official/x.35/Lib/D11/dxSkinMcSkinD11.dcp new file mode 100644 index 00000000..03d0b647 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinMcSkinD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinMcSkinD11.dcu b/official/x.35/Lib/D11/dxSkinMcSkinD11.dcu new file mode 100644 index 00000000..368a5fa0 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinMcSkinD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinMoneyTwins.dcu b/official/x.35/Lib/D11/dxSkinMoneyTwins.dcu new file mode 100644 index 00000000..6de9062a Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinMoneyTwins.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinMoneyTwins.res b/official/x.35/Lib/D11/dxSkinMoneyTwins.res new file mode 100644 index 00000000..b286fc5b Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinMoneyTwins.res differ diff --git a/official/x.35/Lib/D11/dxSkinMoneyTwinsD11.bpl b/official/x.35/Lib/D11/dxSkinMoneyTwinsD11.bpl new file mode 100644 index 00000000..2fc14b3f Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinMoneyTwinsD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinMoneyTwinsD11.dcp b/official/x.35/Lib/D11/dxSkinMoneyTwinsD11.dcp new file mode 100644 index 00000000..f9c8eeb8 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinMoneyTwinsD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinMoneyTwinsD11.dcu b/official/x.35/Lib/D11/dxSkinMoneyTwinsD11.dcu new file mode 100644 index 00000000..babcd640 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinMoneyTwinsD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007Black.dcu b/official/x.35/Lib/D11/dxSkinOffice2007Black.dcu new file mode 100644 index 00000000..c4a1364c Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007Black.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007Black.res b/official/x.35/Lib/D11/dxSkinOffice2007Black.res new file mode 100644 index 00000000..963cf162 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007Black.res differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007BlackD11.bpl b/official/x.35/Lib/D11/dxSkinOffice2007BlackD11.bpl new file mode 100644 index 00000000..20af810c Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007BlackD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007BlackD11.dcp b/official/x.35/Lib/D11/dxSkinOffice2007BlackD11.dcp new file mode 100644 index 00000000..a84291b1 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007BlackD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007BlackD11.dcu b/official/x.35/Lib/D11/dxSkinOffice2007BlackD11.dcu new file mode 100644 index 00000000..ae0c3f00 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007BlackD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007Blue.dcu b/official/x.35/Lib/D11/dxSkinOffice2007Blue.dcu new file mode 100644 index 00000000..bb7b2448 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007Blue.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007Blue.res b/official/x.35/Lib/D11/dxSkinOffice2007Blue.res new file mode 100644 index 00000000..069c2dac Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007Blue.res differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007BlueD11.bpl b/official/x.35/Lib/D11/dxSkinOffice2007BlueD11.bpl new file mode 100644 index 00000000..e3f1ce66 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007BlueD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007BlueD11.dcp b/official/x.35/Lib/D11/dxSkinOffice2007BlueD11.dcp new file mode 100644 index 00000000..c1e33692 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007BlueD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007BlueD11.dcu b/official/x.35/Lib/D11/dxSkinOffice2007BlueD11.dcu new file mode 100644 index 00000000..47570581 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007BlueD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007Green.dcu b/official/x.35/Lib/D11/dxSkinOffice2007Green.dcu new file mode 100644 index 00000000..e344f2b4 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007Green.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007Green.res b/official/x.35/Lib/D11/dxSkinOffice2007Green.res new file mode 100644 index 00000000..a9be60dc Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007Green.res differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007GreenD11.bpl b/official/x.35/Lib/D11/dxSkinOffice2007GreenD11.bpl new file mode 100644 index 00000000..98d8aa31 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007GreenD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007GreenD11.dcp b/official/x.35/Lib/D11/dxSkinOffice2007GreenD11.dcp new file mode 100644 index 00000000..d6934194 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007GreenD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007GreenD11.dcu b/official/x.35/Lib/D11/dxSkinOffice2007GreenD11.dcu new file mode 100644 index 00000000..5c06c5aa Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007GreenD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007Pink.dcu b/official/x.35/Lib/D11/dxSkinOffice2007Pink.dcu new file mode 100644 index 00000000..ff842e74 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007Pink.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007Pink.res b/official/x.35/Lib/D11/dxSkinOffice2007Pink.res new file mode 100644 index 00000000..90b48d5d Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007Pink.res differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007PinkD11.bpl b/official/x.35/Lib/D11/dxSkinOffice2007PinkD11.bpl new file mode 100644 index 00000000..3396f5ee Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007PinkD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007PinkD11.dcp b/official/x.35/Lib/D11/dxSkinOffice2007PinkD11.dcp new file mode 100644 index 00000000..195d98e4 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007PinkD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007PinkD11.dcu b/official/x.35/Lib/D11/dxSkinOffice2007PinkD11.dcu new file mode 100644 index 00000000..3e0a1e63 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007PinkD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007Silver.dcu b/official/x.35/Lib/D11/dxSkinOffice2007Silver.dcu new file mode 100644 index 00000000..7f1ac3c8 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007Silver.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007Silver.res b/official/x.35/Lib/D11/dxSkinOffice2007Silver.res new file mode 100644 index 00000000..d30a0fdc Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007Silver.res differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007SilverD11.bpl b/official/x.35/Lib/D11/dxSkinOffice2007SilverD11.bpl new file mode 100644 index 00000000..b46e7654 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007SilverD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007SilverD11.dcp b/official/x.35/Lib/D11/dxSkinOffice2007SilverD11.dcp new file mode 100644 index 00000000..6e9f241d Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007SilverD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinOffice2007SilverD11.dcu b/official/x.35/Lib/D11/dxSkinOffice2007SilverD11.dcu new file mode 100644 index 00000000..99804be5 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinOffice2007SilverD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinSilver.dcu b/official/x.35/Lib/D11/dxSkinSilver.dcu new file mode 100644 index 00000000..3e014239 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinSilver.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinSilver.res b/official/x.35/Lib/D11/dxSkinSilver.res new file mode 100644 index 00000000..716785dc Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinSilver.res differ diff --git a/official/x.35/Lib/D11/dxSkinSilverD11.bpl b/official/x.35/Lib/D11/dxSkinSilverD11.bpl new file mode 100644 index 00000000..6642b6f2 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinSilverD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinSilverD11.dcp b/official/x.35/Lib/D11/dxSkinSilverD11.dcp new file mode 100644 index 00000000..91f29574 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinSilverD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinSilverD11.dcu b/official/x.35/Lib/D11/dxSkinSilverD11.dcu new file mode 100644 index 00000000..6851d049 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinSilverD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinStardust.dcu b/official/x.35/Lib/D11/dxSkinStardust.dcu new file mode 100644 index 00000000..f6cacca8 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinStardust.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinStardust.res b/official/x.35/Lib/D11/dxSkinStardust.res new file mode 100644 index 00000000..b34624c7 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinStardust.res differ diff --git a/official/x.35/Lib/D11/dxSkinStardustD11.bpl b/official/x.35/Lib/D11/dxSkinStardustD11.bpl new file mode 100644 index 00000000..e15ee5b0 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinStardustD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinStardustD11.dcp b/official/x.35/Lib/D11/dxSkinStardustD11.dcp new file mode 100644 index 00000000..6fbfaf5e Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinStardustD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinStardustD11.dcu b/official/x.35/Lib/D11/dxSkinStardustD11.dcu new file mode 100644 index 00000000..595bf00b Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinStardustD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinValentine.dcu b/official/x.35/Lib/D11/dxSkinValentine.dcu new file mode 100644 index 00000000..07f27dd8 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinValentine.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinValentine.res b/official/x.35/Lib/D11/dxSkinValentine.res new file mode 100644 index 00000000..be7d0905 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinValentine.res differ diff --git a/official/x.35/Lib/D11/dxSkinValentineD11.bpl b/official/x.35/Lib/D11/dxSkinValentineD11.bpl new file mode 100644 index 00000000..22a1569c Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinValentineD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinValentineD11.dcp b/official/x.35/Lib/D11/dxSkinValentineD11.dcp new file mode 100644 index 00000000..1f1a189e Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinValentineD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinValentineD11.dcu b/official/x.35/Lib/D11/dxSkinValentineD11.dcu new file mode 100644 index 00000000..2ec45eb8 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinValentineD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinXmas2008Blue.dcu b/official/x.35/Lib/D11/dxSkinXmas2008Blue.dcu new file mode 100644 index 00000000..c91b2558 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinXmas2008Blue.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinXmas2008Blue.res b/official/x.35/Lib/D11/dxSkinXmas2008Blue.res new file mode 100644 index 00000000..63557aac Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinXmas2008Blue.res differ diff --git a/official/x.35/Lib/D11/dxSkinXmas2008BlueD11.bpl b/official/x.35/Lib/D11/dxSkinXmas2008BlueD11.bpl new file mode 100644 index 00000000..09c9403a Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinXmas2008BlueD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinXmas2008BlueD11.dcp b/official/x.35/Lib/D11/dxSkinXmas2008BlueD11.dcp new file mode 100644 index 00000000..496ffa03 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinXmas2008BlueD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinXmas2008BlueD11.dcu b/official/x.35/Lib/D11/dxSkinXmas2008BlueD11.dcu new file mode 100644 index 00000000..765d597f Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinXmas2008BlueD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkiniMaginary.dcu b/official/x.35/Lib/D11/dxSkiniMaginary.dcu new file mode 100644 index 00000000..906a5907 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkiniMaginary.dcu differ diff --git a/official/x.35/Lib/D11/dxSkiniMaginary.res b/official/x.35/Lib/D11/dxSkiniMaginary.res new file mode 100644 index 00000000..f9ba3acf Binary files /dev/null and b/official/x.35/Lib/D11/dxSkiniMaginary.res differ diff --git a/official/x.35/Lib/D11/dxSkiniMaginaryD11.bpl b/official/x.35/Lib/D11/dxSkiniMaginaryD11.bpl new file mode 100644 index 00000000..7d2401d8 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkiniMaginaryD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkiniMaginaryD11.dcp b/official/x.35/Lib/D11/dxSkiniMaginaryD11.dcp new file mode 100644 index 00000000..bf14842f Binary files /dev/null and b/official/x.35/Lib/D11/dxSkiniMaginaryD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkiniMaginaryD11.dcu b/official/x.35/Lib/D11/dxSkiniMaginaryD11.dcu new file mode 100644 index 00000000..18e9526b Binary files /dev/null and b/official/x.35/Lib/D11/dxSkiniMaginaryD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsCore.dcu b/official/x.35/Lib/D11/dxSkinsCore.dcu new file mode 100644 index 00000000..e3d3d9fd Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsCore.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsCoreD11.bpl b/official/x.35/Lib/D11/dxSkinsCoreD11.bpl new file mode 100644 index 00000000..1bd727bb Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsCoreD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinsCoreD11.dcp b/official/x.35/Lib/D11/dxSkinsCoreD11.dcp new file mode 100644 index 00000000..aeeb87e0 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsCoreD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinsCoreD11.dcu b/official/x.35/Lib/D11/dxSkinsCoreD11.dcu new file mode 100644 index 00000000..07e8d655 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsCoreD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsDefaultPainters.dcu b/official/x.35/Lib/D11/dxSkinsDefaultPainters.dcu new file mode 100644 index 00000000..2b1cf447 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsDefaultPainters.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsDefaultPainters.res b/official/x.35/Lib/D11/dxSkinsDefaultPainters.res new file mode 100644 index 00000000..89e21c63 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsDefaultPainters.res differ diff --git a/official/x.35/Lib/D11/dxSkinsDesignHelperReg.dcu b/official/x.35/Lib/D11/dxSkinsDesignHelperReg.dcu new file mode 100644 index 00000000..828ae099 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsDesignHelperReg.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsForm.dcu b/official/x.35/Lib/D11/dxSkinsForm.dcu new file mode 100644 index 00000000..84dc97e2 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsForm.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsLookAndFeelPainter.dcu b/official/x.35/Lib/D11/dxSkinsLookAndFeelPainter.dcu new file mode 100644 index 00000000..183df4e0 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsLookAndFeelPainter.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsReg.dcr b/official/x.35/Lib/D11/dxSkinsReg.dcr new file mode 100644 index 00000000..9ef2ce5a Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsReg.dcr differ diff --git a/official/x.35/Lib/D11/dxSkinsReg.dcu b/official/x.35/Lib/D11/dxSkinsReg.dcu new file mode 100644 index 00000000..c7a4dc05 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsReg.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsStrs.dcu b/official/x.35/Lib/D11/dxSkinsStrs.dcu new file mode 100644 index 00000000..32b1721f Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsStrs.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinscxPCPainter.dcu b/official/x.35/Lib/D11/dxSkinscxPCPainter.dcu new file mode 100644 index 00000000..853b09b8 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinscxPCPainter.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinscxPCPainterD11.bpl b/official/x.35/Lib/D11/dxSkinscxPCPainterD11.bpl new file mode 100644 index 00000000..f8a98a6d Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinscxPCPainterD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinscxPCPainterD11.dcp b/official/x.35/Lib/D11/dxSkinscxPCPainterD11.dcp new file mode 100644 index 00000000..5fc05216 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinscxPCPainterD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinscxPCPainterD11.dcu b/official/x.35/Lib/D11/dxSkinscxPCPainterD11.dcu new file mode 100644 index 00000000..b40e54c6 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinscxPCPainterD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinscxPCPainterReg.dcu b/official/x.35/Lib/D11/dxSkinscxPCPainterReg.dcu new file mode 100644 index 00000000..1bf929e7 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinscxPCPainterReg.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinscxScheduler3Painter.dcu b/official/x.35/Lib/D11/dxSkinscxScheduler3Painter.dcu new file mode 100644 index 00000000..7c313802 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinscxScheduler3Painter.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinscxScheduler3PainterD11.bpl b/official/x.35/Lib/D11/dxSkinscxScheduler3PainterD11.bpl new file mode 100644 index 00000000..e01a5a68 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinscxScheduler3PainterD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinscxScheduler3PainterD11.dcp b/official/x.35/Lib/D11/dxSkinscxScheduler3PainterD11.dcp new file mode 100644 index 00000000..3fd9045a Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinscxScheduler3PainterD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinscxScheduler3PainterD11.dcu b/official/x.35/Lib/D11/dxSkinscxScheduler3PainterD11.dcu new file mode 100644 index 00000000..f0650130 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinscxScheduler3PainterD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinscxScheduler3PainterReg.dcu b/official/x.35/Lib/D11/dxSkinscxScheduler3PainterReg.dcu new file mode 100644 index 00000000..2c2ef925 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinscxScheduler3PainterReg.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsdxBarPainter.dcu b/official/x.35/Lib/D11/dxSkinsdxBarPainter.dcu new file mode 100644 index 00000000..d425bb22 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxBarPainter.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsdxBarPainterD11.bpl b/official/x.35/Lib/D11/dxSkinsdxBarPainterD11.bpl new file mode 100644 index 00000000..23eeac7d Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxBarPainterD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinsdxBarPainterD11.dcp b/official/x.35/Lib/D11/dxSkinsdxBarPainterD11.dcp new file mode 100644 index 00000000..a0ffced6 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxBarPainterD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinsdxBarPainterD11.dcu b/official/x.35/Lib/D11/dxSkinsdxBarPainterD11.dcu new file mode 100644 index 00000000..7e93fbba Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxBarPainterD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsdxBarsPaintersReg.dcu b/official/x.35/Lib/D11/dxSkinsdxBarsPaintersReg.dcu new file mode 100644 index 00000000..3b5d1f82 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxBarsPaintersReg.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsdxDLPainterD11.bpl b/official/x.35/Lib/D11/dxSkinsdxDLPainterD11.bpl new file mode 100644 index 00000000..6a6e32c0 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxDLPainterD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinsdxDLPainterD11.dcp b/official/x.35/Lib/D11/dxSkinsdxDLPainterD11.dcp new file mode 100644 index 00000000..a6698b53 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxDLPainterD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinsdxDLPainterD11.dcu b/official/x.35/Lib/D11/dxSkinsdxDLPainterD11.dcu new file mode 100644 index 00000000..a94cc520 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxDLPainterD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsdxDockControlPainter.dcu b/official/x.35/Lib/D11/dxSkinsdxDockControlPainter.dcu new file mode 100644 index 00000000..13a51dab Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxDockControlPainter.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsdxLCPainter.dcu b/official/x.35/Lib/D11/dxSkinsdxLCPainter.dcu new file mode 100644 index 00000000..21923a12 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxLCPainter.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsdxLCPainterD11.bpl b/official/x.35/Lib/D11/dxSkinsdxLCPainterD11.bpl new file mode 100644 index 00000000..c974f32f Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxLCPainterD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinsdxLCPainterD11.dcp b/official/x.35/Lib/D11/dxSkinsdxLCPainterD11.dcp new file mode 100644 index 00000000..32b0e747 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxLCPainterD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinsdxLCPainterD11.dcu b/official/x.35/Lib/D11/dxSkinsdxLCPainterD11.dcu new file mode 100644 index 00000000..611bb883 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxLCPainterD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsdxLCPainterReg.dcu b/official/x.35/Lib/D11/dxSkinsdxLCPainterReg.dcu new file mode 100644 index 00000000..eede7da3 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxLCPainterReg.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsdxNavBar2Painter.dcu b/official/x.35/Lib/D11/dxSkinsdxNavBar2Painter.dcu new file mode 100644 index 00000000..4f815a9f Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxNavBar2Painter.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsdxNavBar2PainterD11.bpl b/official/x.35/Lib/D11/dxSkinsdxNavBar2PainterD11.bpl new file mode 100644 index 00000000..be868daa Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxNavBar2PainterD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinsdxNavBar2PainterD11.dcp b/official/x.35/Lib/D11/dxSkinsdxNavBar2PainterD11.dcp new file mode 100644 index 00000000..c4aa1707 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxNavBar2PainterD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinsdxNavBar2PainterD11.dcu b/official/x.35/Lib/D11/dxSkinsdxNavBar2PainterD11.dcu new file mode 100644 index 00000000..9765e371 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxNavBar2PainterD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsdxNavBar2PainterReg.dcu b/official/x.35/Lib/D11/dxSkinsdxNavBar2PainterReg.dcu new file mode 100644 index 00000000..fb81deed Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxNavBar2PainterReg.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsdxRibbonPainter.dcu b/official/x.35/Lib/D11/dxSkinsdxRibbonPainter.dcu new file mode 100644 index 00000000..6480e9c5 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxRibbonPainter.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsdxRibbonPainterD11.bpl b/official/x.35/Lib/D11/dxSkinsdxRibbonPainterD11.bpl new file mode 100644 index 00000000..6a77d175 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxRibbonPainterD11.bpl differ diff --git a/official/x.35/Lib/D11/dxSkinsdxRibbonPainterD11.dcp b/official/x.35/Lib/D11/dxSkinsdxRibbonPainterD11.dcp new file mode 100644 index 00000000..11bafa4f Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxRibbonPainterD11.dcp differ diff --git a/official/x.35/Lib/D11/dxSkinsdxRibbonPainterD11.dcu b/official/x.35/Lib/D11/dxSkinsdxRibbonPainterD11.dcu new file mode 100644 index 00000000..b495cff2 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxRibbonPainterD11.dcu differ diff --git a/official/x.35/Lib/D11/dxSkinsdxStatusBarPainter.dcu b/official/x.35/Lib/D11/dxSkinsdxStatusBarPainter.dcu new file mode 100644 index 00000000..2dcd7c90 Binary files /dev/null and b/official/x.35/Lib/D11/dxSkinsdxStatusBarPainter.dcu differ diff --git a/official/x.35/Lib/D11/dxStatusBar.dcu b/official/x.35/Lib/D11/dxStatusBar.dcu new file mode 100644 index 00000000..66e14055 Binary files /dev/null and b/official/x.35/Lib/D11/dxStatusBar.dcu differ diff --git a/official/x.35/Lib/D11/dxStatusBar.res b/official/x.35/Lib/D11/dxStatusBar.res new file mode 100644 index 00000000..d8d72d05 Binary files /dev/null and b/official/x.35/Lib/D11/dxStatusBar.res differ diff --git a/official/x.35/Lib/D11/dxStatusBarReg.dcu b/official/x.35/Lib/D11/dxStatusBarReg.dcu new file mode 100644 index 00000000..6455b9c6 Binary files /dev/null and b/official/x.35/Lib/D11/dxStatusBarReg.dcu differ diff --git a/official/x.35/Lib/D11/dxStatusIndicatorEditor.dcu b/official/x.35/Lib/D11/dxStatusIndicatorEditor.dcu new file mode 100644 index 00000000..8677dbd9 Binary files /dev/null and b/official/x.35/Lib/D11/dxStatusIndicatorEditor.dcu differ diff --git a/official/x.35/Lib/D11/dxStatusIndicatorEditor.dfm b/official/x.35/Lib/D11/dxStatusIndicatorEditor.dfm new file mode 100644 index 00000000..18ce678a --- /dev/null +++ b/official/x.35/Lib/D11/dxStatusIndicatorEditor.dfm @@ -0,0 +1,113 @@ +object dxStatusBarIndicatorEditor: TdxStatusBarIndicatorEditor + Left = 624 + Top = 110 + BorderStyle = bsDialog + ClientHeight = 234 + ClientWidth = 279 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Bevel1: TBevel + Left = 8 + Top = 192 + Width = 337 + Height = 2 + end + object BtnOK: TButton + Left = 117 + Top = 202 + Width = 75 + Height = 25 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object BtnCancel: TButton + Left = 197 + Top = 202 + Width = 75 + Height = 25 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + object chlbIndicators: TCheckListBox + Left = 8 + Top = 8 + Width = 153 + Height = 149 + ItemHeight = 13 + TabOrder = 2 + OnClick = chlbIndicatorsClick + OnKeyDown = chlbIndicatorsKeyDown + end + object BtnAdd: TButton + Left = 175 + Top = 8 + Width = 92 + Height = 25 + Caption = '&Add' + TabOrder = 3 + OnClick = BtnAddClick + end + object BtnDelete: TButton + Left = 175 + Top = 40 + Width = 92 + Height = 25 + Caption = '&Delete' + TabOrder = 4 + OnClick = BtnDeleteClick + end + object BtnClear: TButton + Left = 175 + Top = 72 + Width = 92 + Height = 25 + Caption = '&Clear' + TabOrder = 5 + OnClick = BtnClearClick + end + object cbItemTypes: TComboBox + Left = 9 + Top = 164 + Width = 153 + Height = 21 + ItemHeight = 13 + Items.Strings = ( + 'sitOff' + 'sitYellow' + 'sitBlue' + 'sitGreen' + 'sitRed' + 'sitTeal' + 'sitPurple') + TabOrder = 6 + OnChange = cbItemTypesChange + end + object GroupBox1: TGroupBox + Left = 172 + Top = 130 + Width = 97 + Height = 56 + Caption = 'Example' + TabOrder = 7 + object imgExample: TImage + Left = 31 + Top = 26 + Width = 34 + Height = 15 + Center = True + end + end +end diff --git a/official/x.35/Lib/D11/dxThemeConsts.dcu b/official/x.35/Lib/D11/dxThemeConsts.dcu new file mode 100644 index 00000000..535b8ffb Binary files /dev/null and b/official/x.35/Lib/D11/dxThemeConsts.dcu differ diff --git a/official/x.35/Lib/D11/dxThemeD11.bpl b/official/x.35/Lib/D11/dxThemeD11.bpl new file mode 100644 index 00000000..b9db11fb Binary files /dev/null and b/official/x.35/Lib/D11/dxThemeD11.bpl differ diff --git a/official/x.35/Lib/D11/dxThemeD11.dcp b/official/x.35/Lib/D11/dxThemeD11.dcp new file mode 100644 index 00000000..e2ab8cee Binary files /dev/null and b/official/x.35/Lib/D11/dxThemeD11.dcp differ diff --git a/official/x.35/Lib/D11/dxThemeD11.dcu b/official/x.35/Lib/D11/dxThemeD11.dcu new file mode 100644 index 00000000..69b74e01 Binary files /dev/null and b/official/x.35/Lib/D11/dxThemeD11.dcu differ diff --git a/official/x.35/Lib/D11/dxThemeManager.dcu b/official/x.35/Lib/D11/dxThemeManager.dcu new file mode 100644 index 00000000..3bec6ce5 Binary files /dev/null and b/official/x.35/Lib/D11/dxThemeManager.dcu differ diff --git a/official/x.35/Lib/D11/dxUxTheme.dcu b/official/x.35/Lib/D11/dxUxTheme.dcu new file mode 100644 index 00000000..3b0fa033 Binary files /dev/null and b/official/x.35/Lib/D11/dxUxTheme.dcu differ diff --git a/official/x.35/Lib/D11/dxWrap.dcu b/official/x.35/Lib/D11/dxWrap.dcu new file mode 100644 index 00000000..73903b75 Binary files /dev/null and b/official/x.35/Lib/D11/dxWrap.dcu differ diff --git a/official/x.35/Lib/D11/dxfmChFn.dcu b/official/x.35/Lib/D11/dxfmChFn.dcu new file mode 100644 index 00000000..472c5510 Binary files /dev/null and b/official/x.35/Lib/D11/dxfmChFn.dcu differ diff --git a/official/x.35/Lib/D11/dxfmChFn.dfm b/official/x.35/Lib/D11/dxfmChFn.dfm new file mode 100644 index 00000000..31722106 --- /dev/null +++ b/official/x.35/Lib/D11/dxfmChFn.dfm @@ -0,0 +1,73 @@ +object fmdxChangeFileName: TfmdxChangeFileName + Left = 368 + Top = 184 + ActiveControl = edFileName + BorderStyle = bsDialog + Caption = 'Choose New File Name' + ClientHeight = 104 + ClientWidth = 350 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object btnOK: TButton + Left = 109 + Top = 75 + Width = 75 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 190 + Top = 75 + Width = 75 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object btnHelp: TButton + Left = 271 + Top = 75 + Width = 75 + Height = 23 + Caption = '&Help' + TabOrder = 3 + end + object GroupBox1: TGroupBox + Left = 4 + Top = 2 + Width = 342 + Height = 65 + TabOrder = 0 + object lblEnterNewFileName: TLabel + Left = 9 + Top = 17 + Width = 103 + Height = 13 + Caption = '&Enter New File Name:' + FocusControl = edFileName + end + object edFileName: TEdit + Left = 9 + Top = 33 + Width = 324 + Height = 21 + MaxLength = 260 + TabOrder = 0 + OnChange = edFileNameChange + end + end +end diff --git a/official/x.35/Lib/D11/dxfmClr.dcu b/official/x.35/Lib/D11/dxfmClr.dcu new file mode 100644 index 00000000..b1141885 Binary files /dev/null and b/official/x.35/Lib/D11/dxfmClr.dcu differ diff --git a/official/x.35/Lib/D11/dxfmClr.dfm b/official/x.35/Lib/D11/dxfmClr.dfm new file mode 100644 index 00000000..35bec57f --- /dev/null +++ b/official/x.35/Lib/D11/dxfmClr.dfm @@ -0,0 +1,573 @@ +object dxfmColorPalette: TdxfmColorPalette + Left = 410 + Top = 280 + BorderStyle = bsDialog + ClientHeight = 182 + ClientWidth = 148 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + KeyPreview = True + OldCreateOrder = True + ShowHint = True + PixelsPerInch = 96 + TextHeight = 13 + object pnlTop: TPanel + Left = 0 + Top = 0 + Width = 148 + Height = 121 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object SpeedButton1: TSpeedButton + Left = 2 + Top = 28 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton2: TSpeedButton + Left = 20 + Top = 28 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton3: TSpeedButton + Left = 38 + Top = 28 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton4: TSpeedButton + Left = 56 + Top = 28 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton5: TSpeedButton + Left = 74 + Top = 28 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton6: TSpeedButton + Left = 92 + Top = 28 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton7: TSpeedButton + Left = 110 + Top = 28 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton8: TSpeedButton + Left = 128 + Top = 28 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton9: TSpeedButton + Left = 2 + Top = 46 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton10: TSpeedButton + Left = 20 + Top = 46 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton11: TSpeedButton + Left = 38 + Top = 46 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton12: TSpeedButton + Left = 56 + Top = 46 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton13: TSpeedButton + Left = 74 + Top = 46 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton14: TSpeedButton + Left = 92 + Top = 46 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton15: TSpeedButton + Left = 110 + Top = 46 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton16: TSpeedButton + Left = 128 + Top = 46 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton17: TSpeedButton + Left = 2 + Top = 64 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton18: TSpeedButton + Left = 20 + Top = 64 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton19: TSpeedButton + Left = 38 + Top = 64 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton20: TSpeedButton + Left = 56 + Top = 64 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton21: TSpeedButton + Left = 74 + Top = 64 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton22: TSpeedButton + Left = 92 + Top = 64 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton23: TSpeedButton + Left = 110 + Top = 64 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton24: TSpeedButton + Left = 128 + Top = 64 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton25: TSpeedButton + Left = 2 + Top = 82 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton26: TSpeedButton + Left = 20 + Top = 82 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton27: TSpeedButton + Left = 38 + Top = 82 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton28: TSpeedButton + Left = 56 + Top = 82 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton29: TSpeedButton + Left = 74 + Top = 82 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton30: TSpeedButton + Left = 92 + Top = 82 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton31: TSpeedButton + Left = 110 + Top = 82 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton32: TSpeedButton + Left = 128 + Top = 82 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton33: TSpeedButton + Left = 2 + Top = 100 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton34: TSpeedButton + Left = 20 + Top = 100 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton35: TSpeedButton + Left = 38 + Top = 100 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton36: TSpeedButton + Left = 56 + Top = 100 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton37: TSpeedButton + Left = 74 + Top = 100 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton38: TSpeedButton + Left = 92 + Top = 100 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton39: TSpeedButton + Left = 110 + Top = 100 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object SpeedButton40: TSpeedButton + Left = 128 + Top = 100 + Width = 18 + Height = 18 + GroupIndex = 1 + Flat = True + ParentShowHint = False + ShowHint = True + OnClick = ButtonClick + end + object bvlNoFillHolder: TBevel + Left = 2 + Top = 3 + Width = 144 + Height = 22 + Visible = False + end + end + object pnlBottom: TPanel + Left = 0 + Top = 126 + Width = 148 + Height = 56 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + object sBtnMoreColors: TSpeedButton + Left = 2 + Top = 4 + Width = 144 + Height = 26 + Caption = '&More Colors ...' + Flat = True + Glyph.Data = { + F6000000424DF600000000000000760000002800000010000000100000000100 + 0400000000008000000000000000000000001000000010000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00551199BBAAEE + CC44551199BBAAEECC44551199BBAAEECC44551199BBAAEECC44551199BBAAEE + CC44551199BBAAEECC44551199BBAAEECC44551199BBAAEECC44551199BBAAEE + CC44551199BBAAEECC44551199BBAAEECC44551199BBAAEECC44551199BBAAEE + CC44551199BBAAEECC44551199BBAAEECC44551199BBAAEECC44} + Margin = 3 + Spacing = 10 + OnClick = sBtnMoreColorsClick + end + object sBtnFillEffects: TSpeedButton + Left = 2 + Top = 30 + Width = 144 + Height = 26 + Caption = '&Fill Effects ...' + Flat = True + Glyph.Data = { + 36050000424D3605000000000000360400002800000010000000100000000100 + 0800000000000001000000000000000000000001000000010000000000000000 + 80000080000000808000800000008000800080800000C0C0C000C0DCC000F0CA + A600D3F0FF00B1E2FF008ED3FF006BC6FF0048B8FF0024AAFF0000AAFF000092 + DC000079B900006196000049730000325000D3E3FF00B1C7FF008EABFF006B8F + FF004873FF002457FF000055FF000049DC00003CB90000309600002473000019 + 5000D3D3FF00B1B1FF008E8EFF006B6BFF004848FF002424FF000000FE000000 + DC000000B900000096000000730000005000E3D3FF00C7B1FF00AB8EFF008F6B + FF007348FF005724FF005500FF004900DC003C00B90030009600240073001900 + 5000F0D3FF00E2B1FF00D38EFF00C66BFF00B848FF00AA24FF00AA00FF009200 + DC007900B900610096004900730032005000FFD3FF00FFB1FF00FF8EFF00FF6B + FF00FF48FF00FF24FF00FE00FE00DC00DC00B900B90096009600730073005000 + 5000FFD3F000FFB1E200FF8ED300FF6BC600FF48B800FF24AA00FF00AA00DC00 + 9200B9007900960061007300490050003200FFD3E300FFB1C700FF8EAB00FF6B + 8F00FF487300FF245700FF005500DC004900B9003C0096003000730024005000 + 1900FFD3D300FFB1B100FF8E8E00FF6B6B00FF484800FF242400FE000000DC00 + 0000B9000000960000007300000050000000FFE3D300FFC7B100FFAB8E00FF8F + 6B00FF734800FF572400FF550000DC490000B93C000096300000732400005019 + 0000FFF0D300FFE2B100FFD38E00FFC66B00FFB84800FFAA2400FFAA0000DC92 + 0000B9790000966100007349000050320000FFFFD300FFFFB100FFFF8E00FFFF + 6B00FFFF4800FFFF2400FEFE0000DCDC0000B9B9000096960000737300005050 + 0000F0FFD300E2FFB100D3FF8E00C6FF6B00B8FF4800AAFF2400AAFF000092DC + 000079B90000619600004973000032500000E3FFD300C7FFB100ABFF8E008FFF + 6B0073FF480057FF240055FF000049DC00003CB9000030960000247300001950 + 0000D3FFD300B1FFB1008EFF8E006BFF6B0048FF480024FF240000FE000000DC + 000000B90000009600000073000000500000D3FFE300B1FFC7008EFFAB006BFF + 8F0048FF730024FF570000FF550000DC490000B93C0000963000007324000050 + 1900D3FFF000B1FFE2008EFFD3006BFFC60048FFB80024FFAA0000FFAA0000DC + 920000B97900009661000073490000503200D3FFFF00B1FFFF008EFFFF006BFF + FF0048FFFF0024FFFF0000FEFE0000DCDC0000B9B90000969600007373000050 + 5000F2F2F200E6E6E600DADADA00CECECE00C2C2C200B6B6B600AAAAAA009E9E + 9E009292920086868600797979006E6E6E006161610056565600494949003E3E + 3E0032323200262626001A1A1A000E0E0E00F0FBFF00A3A0A000808080000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00686868686868 + 686868686868686868686873737373737373737373737373736868737E7E7E7E + 7E7E7E7E7E7E7E7E736868737E7C7C7C7C7C7C7C7C7C7C7E736868737E7C8787 + 8787878787877C7E736868737E7C87858585858585877C7E736868737E7C8785 + 8484848485877C7E736868737E7C87858483838485877C7E736868737E7C8785 + 8483838485877C7E736868737E7C87858484848485877C7E736868737E7C8785 + 8585858585877C7E736868737E7C87878787878787877C7E736868737E7C7C7C + 7C7C7C7C7C7C7C7E736868737E7E7E7E7E7E7E7E7E7E7E7E7368687373737373 + 7373737373737373736868686868686868686868686868686868} + Margin = 4 + Spacing = 10 + OnClick = sBtnFillEffectsClick + end + end + object pnlMiddle: TPanel + Left = 0 + Top = 121 + Width = 148 + Height = 5 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Bevel1: TBevel + Left = 25 + Top = -2 + Width = 97 + Height = 6 + Shape = bsBottomLine + end + end +end diff --git a/official/x.35/Lib/D11/dxfmDTFmt.dcu b/official/x.35/Lib/D11/dxfmDTFmt.dcu new file mode 100644 index 00000000..6a1481e2 Binary files /dev/null and b/official/x.35/Lib/D11/dxfmDTFmt.dcu differ diff --git a/official/x.35/Lib/D11/dxfmDTFmt.dfm b/official/x.35/Lib/D11/dxfmDTFmt.dfm new file mode 100644 index 00000000..e1c293f9 --- /dev/null +++ b/official/x.35/Lib/D11/dxfmDTFmt.dfm @@ -0,0 +1,110 @@ +object dxfmDateTimeFormats: TdxfmDateTimeFormats + Left = 350 + Top = 153 + ActiveControl = lbxDateFormats + BorderStyle = bsDialog + Caption = 'Change Date and Time Formats' + ClientHeight = 342 + ClientWidth = 282 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object btnOK: TButton + Left = 41 + Top = 313 + Width = 75 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 122 + Top = 313 + Width = 75 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object btnHelp: TButton + Left = 203 + Top = 313 + Width = 75 + Height = 23 + Caption = '&Help' + TabOrder = 3 + end + object GroupBox1: TGroupBox + Left = 4 + Top = 4 + Width = 274 + Height = 301 + TabOrder = 0 + object lblAvailableDateFormats: TLabel + Left = 10 + Top = 13 + Width = 115 + Height = 13 + Caption = 'Available &Date Formats:' + FocusControl = lbxDateFormats + OnClick = lblAvailableDateFormatsClick + end + object lblAvailableTimeFormats: TLabel + Left = 10 + Top = 187 + Width = 114 + Height = 13 + Caption = 'Available Time &Formats:' + FocusControl = lbxTimeFormats + OnClick = lblAvailableDateFormatsClick + end + object lbxDateFormats: TListBox + Left = 8 + Top = 28 + Width = 257 + Height = 150 + ItemHeight = 13 + TabOrder = 0 + OnClick = lbxDateFormatsClick + OnDblClick = lbxDTFormatsDblClick + end + object lbxTimeFormats: TListBox + Left = 8 + Top = 203 + Width = 257 + Height = 59 + ItemHeight = 13 + TabOrder = 1 + OnClick = TimeFormatsChanged + OnDblClick = lbxDTFormatsDblClick + end + object chbxAutoUpdate: TCheckBox + Left = 8 + Top = 274 + Width = 160 + Height = 17 + Caption = '&Update Automatically ' + TabOrder = 2 + OnClick = chbxAutoUpdateClick + end + object btnDefault: TButton + Left = 175 + Top = 270 + Width = 90 + Height = 23 + Caption = '&Default ...' + TabOrder = 3 + OnClick = btnDefaultClick + end + end +end diff --git a/official/x.35/Lib/D11/dxfmDfnStl.dcu b/official/x.35/Lib/D11/dxfmDfnStl.dcu new file mode 100644 index 00000000..2c150b2f Binary files /dev/null and b/official/x.35/Lib/D11/dxfmDfnStl.dcu differ diff --git a/official/x.35/Lib/D11/dxfmDfnStl.dfm b/official/x.35/Lib/D11/dxfmDfnStl.dfm new file mode 100644 index 00000000..51fb4289 --- /dev/null +++ b/official/x.35/Lib/D11/dxfmDfnStl.dfm @@ -0,0 +1,413 @@ +object dxfmDefinePrintStyles: TdxfmDefinePrintStyles + Left = 414 + Top = 232 + ActiveControl = lbxPrintStyles + BorderStyle = bsDialog + Caption = 'Define Print Styles' + ClientHeight = 193 + ClientWidth = 282 + Color = clBtnFace + Constraints.MinHeight = 220 + Constraints.MinWidth = 290 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Icon.Data = { + 0000010001001010100000000000280100001600000028000000100000002000 + 00000100040000000000C0000000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000004 + 4444000000004444474F444440004477774FFFF440004477774FFFF440004477 + 774FFFF440004477774FFFF440004477774FFFF444444477774FFFF44F444477 + 7474FFF44F44044447774444FF440004477774FFFF440004477774FFFF440004 + 477774FFFF4400044777404FFF4400004444000444400000000000000000E0FF + 0000000700000007000000070000000700000007000000000000000000000000 + 000080000000E0000000E0000000E0000000E0400000F0E10000FFFF0000} + KeyPreview = True + OldCreateOrder = True + Position = poScreenCenter + OnResize = FormResize + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object lblPrintStyles: TLabel + Left = 3 + Top = 5 + Width = 58 + Height = 13 + Caption = 'Print &Styles:' + FocusControl = lbxPrintStyles + end + object btnEdit: TButton + Left = 196 + Top = 24 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Edit...' + TabOrder = 0 + OnClick = EditClick + end + object btnCopy: TButton + Left = 196 + Top = 53 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Copy...' + TabOrder = 1 + OnClick = CopyClick + end + object btnReset: TButton + Left = 196 + Top = 82 + Width = 80 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Reset...' + TabOrder = 2 + OnClick = ResetClick + end + object btnClose: TButton + Left = 196 + Top = 133 + Width = 80 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Close' + Default = True + ModalResult = 1 + TabOrder = 3 + end + object btnHelp: TButton + Left = 196 + Top = 162 + Width = 80 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = '&Help' + ModalResult = 1 + TabOrder = 4 + end + object lbxPrintStyles: TListBox + Left = 0 + Top = 24 + Width = 189 + Height = 169 + Anchors = [akLeft, akTop, akRight, akBottom] + ItemHeight = 34 + PopupMenu = pmPrintStyles + Style = lbOwnerDrawFixed + TabOrder = 5 + OnClick = lbxPrintStylesClick + OnDblClick = EditClick + OnDrawItem = lbxPrintStylesDrawItem + end + object pmPrintStyles: TPopupMenu + OnPopup = pmPrintStylesPopup + Left = 26 + Top = 120 + object miEdit: TMenuItem + Caption = '&Edit ...' + Default = True + ShortCut = 16397 + OnClick = EditClick + end + object miLine1: TMenuItem + Caption = '-' + end + object miCopy: TMenuItem + Caption = '&Copy ...' + ShortCut = 45 + OnClick = CopyClick + end + object miReset: TMenuItem + Caption = '&Reset ...' + OnClick = ResetClick + end + object miClear: TMenuItem + Caption = 'C&lear ...' + OnClick = ClearClick + end + end + object ilPrintStyles: TImageList + AllocBy = 2 + Left = 54 + Top = 120 + Bitmap = { + 494C010104000800040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000002000000001002000000000000020 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008400000084000000840000008400000084000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000840000008400000084000000840000008400 + 0000840000008400000084000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000840000008400 + 0000840000008400000084000000840000008400000084000000840000008400 + 0000840000008400000084000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000000000000000000000 + 0000FFFFFF000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000008400000084000000840000008400 + 000084000000840000008484840084000000FFFFFF0084000000840000008400 + 0000840000008400000084000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF000000000000000000000000000000 + 000000000000FFFFFF0084000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF008400000084000000000000000000000000000000000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0084000000840000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF000000000000000000000000000000 + 000000000000FFFFFF0084000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0084000000840000000000000000000000FFFFFF00000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00000000000000000000000000FFFF + FF0000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0084000000840000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF000000000000000000FFFFFF008400 + 0000840000008400000084000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0084000000840000000000000000000000FFFFFF00000000000000 + 0000000000000000000084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 0000FFFFFF008400000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0084000000840000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFFFF00FFFFFF008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000000000008400000084000000848484008484 + 840084848400848484008484840084000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0084000000840000000000000000000000FFFFFF00000000000000 + 0000FFFFFF000000000084000000840000008400000084000000840000008400 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF000000000000000000FFFFFF000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000008400000084000000848484008484 + 84008484840084848400840000000000000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0084000000840000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000FFFFFF00000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF000000 + 0000000000000000000000000000000000000000000084000000840000008400 + 0000840000008400000000000000000000000000000084000000840000008400 + 00008400000084000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000000000000000000000000000000000000000 + 000000000000FFFFFF000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + F83FFC01FFF9C0070001FC01E7FFC0070001FC01C3F3C00700010001C3E7C007 + 00010001E1C7C00700010001F08FC00700010001F81FC00700010003FC3FC007 + 00010007F81FC0070001000FF09FC007010100FFC1C7C00F838301FF83E3C01F + FFFF03FF8FF1C03FFFFFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxfmMnPg.dcu b/official/x.35/Lib/D11/dxfmMnPg.dcu new file mode 100644 index 00000000..bd5db91d Binary files /dev/null and b/official/x.35/Lib/D11/dxfmMnPg.dcu differ diff --git a/official/x.35/Lib/D11/dxfmNavBarDsgnEditor.dcu b/official/x.35/Lib/D11/dxfmNavBarDsgnEditor.dcu new file mode 100644 index 00000000..e87d98fa Binary files /dev/null and b/official/x.35/Lib/D11/dxfmNavBarDsgnEditor.dcu differ diff --git a/official/x.35/Lib/D11/dxfmNavBarDsgnEditor.dfm b/official/x.35/Lib/D11/dxfmNavBarDsgnEditor.dfm new file mode 100644 index 00000000..a122002b --- /dev/null +++ b/official/x.35/Lib/D11/dxfmNavBarDsgnEditor.dfm @@ -0,0 +1,3772 @@ +object dxfmNavBarDesignWindow: TdxfmNavBarDesignWindow + Left = 405 + Top = 152 + AutoScroll = False + BorderIcons = [biSystemMenu] + ClientHeight = 433 + ClientWidth = 539 + Color = clBtnFace + Constraints.MinHeight = 467 + Constraints.MinWidth = 547 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + PixelsPerInch = 96 + TextHeight = 13 + object nbMain: TdxNavBar + Left = 0 + Top = 0 + Width = 137 + Height = 392 + Align = alLeft + ActiveGroupIndex = 0 + TabOrder = 1 + View = 8 + OptionsImage.LargeImages = ilNavBarLarge + OptionsImage.SmallImages = ilNavBarSmall + OnLinkClick = nbMainLinkClick + object bgMain: TdxNavBarGroup + Caption = 'Main' + LargeImageIndex = 0 + SelectedLinkIndex = -1 + TopVisibleLinkIndex = 0 + UseSmallImages = False + Links = < + item + Item = biGroups + end + item + Item = biItems + end + item + Item = biLinks + end + item + Item = biViews + end> + end + object bgStyles: TdxNavBarGroup + Caption = 'Styles' + LargeImageIndex = 1 + SelectedLinkIndex = -1 + TopVisibleLinkIndex = 0 + UseSmallImages = False + Links = < + item + Item = biDefaultStyles + end + item + Item = biCustomStyles + end> + end + object biGroups: TdxNavBarItem + Caption = 'Groups' + SmallImageIndex = 0 + end + object biItems: TdxNavBarItem + Caption = 'Items' + SmallImageIndex = 1 + end + object biLinks: TdxNavBarItem + Caption = 'Link designer' + SmallImageIndex = 2 + end + object biViews: TdxNavBarItem + Caption = 'Views' + SmallImageIndex = 3 + end + object biDefaultStyles: TdxNavBarItem + Caption = 'Default styles' + SmallImageIndex = 4 + end + object biCustomStyles: TdxNavBarItem + Caption = 'Custom styles' + SmallImageIndex = 5 + end + end + object pnCommonButtons: TPanel + Left = 0 + Top = 392 + Width = 539 + Height = 41 + Align = alBottom + BevelOuter = bvNone + TabOrder = 2 + object btCancel: TButton + Left = 431 + Top = 8 + Width = 100 + Height = 25 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Close' + TabOrder = 0 + OnClick = btCancelClick + end + end + object pcMain: TPageControl + Left = 137 + Top = 0 + Width = 402 + Height = 392 + ActivePage = tsGroups + Align = alClient + TabOrder = 0 + object tsGroups: TTabSheet + Caption = 'Groups' + object pnButtons: TPanel + Left = 0 + Top = 0 + Width = 394 + Height = 33 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object tlbGroups: TToolBar + Left = 0 + Top = 6 + Width = 150 + Height = 25 + Align = alNone + Caption = 'Commands' + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Images = ilActions + ParentShowHint = False + ShowHint = True + TabOrder = 0 + object ToolButton3: TToolButton + Left = 0 + Top = 0 + Action = actAdd + end + object ToolButton5: TToolButton + Left = 23 + Top = 0 + Action = actDelete + end + object ToolButton6: TToolButton + Left = 46 + Top = 0 + Width = 8 + Caption = 'ToolButton6' + ImageIndex = 5 + Style = tbsSeparator + end + object ToolButton1: TToolButton + Left = 54 + Top = 0 + Action = actMoveUp + end + object ToolButton2: TToolButton + Left = 77 + Top = 0 + Action = actMoveDown + end + object ToolButton7: TToolButton + Left = 100 + Top = 0 + Width = 8 + Caption = 'ToolButton7' + ImageIndex = 5 + Style = tbsSeparator + end + object ToolButton12: TToolButton + Left = 108 + Top = 0 + Action = actSelectAll + end + end + end + object lbxGroups: TListBox + Left = 0 + Top = 33 + Width = 394 + Height = 331 + Align = alClient + ItemHeight = 13 + MultiSelect = True + PopupMenu = pmMain + TabOrder = 1 + OnClick = ListBoxClick + OnContextPopup = lbxContextPopup + end + end + object tsItems: TTabSheet + Caption = 'Items' + ImageIndex = 5 + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 394 + Height = 33 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object tlbItems: TToolBar + Left = 0 + Top = 6 + Width = 161 + Height = 25 + Align = alNone + Caption = 'Commands' + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Images = ilActions + ParentShowHint = False + ShowHint = True + TabOrder = 0 + object ToolButton4: TToolButton + Left = 0 + Top = 0 + Action = actAdd + DropdownMenu = pmGroupItemClasses + Style = tbsDropDown + end + object ToolButton8: TToolButton + Left = 36 + Top = 0 + Action = actDelete + end + object ToolButton9: TToolButton + Left = 59 + Top = 0 + Width = 8 + Caption = 'ToolButton6' + ImageIndex = 5 + Style = tbsSeparator + end + object ToolButton10: TToolButton + Left = 67 + Top = 0 + Action = actMoveUp + end + object ToolButton11: TToolButton + Left = 90 + Top = 0 + Action = actMoveDown + end + object ToolButton13: TToolButton + Left = 113 + Top = 0 + Width = 8 + Caption = 'ToolButton7' + ImageIndex = 5 + Style = tbsSeparator + end + object ToolButton14: TToolButton + Left = 121 + Top = 0 + Action = actSelectAll + end + end + end + object lbxItems: TListBox + Left = 0 + Top = 33 + Width = 394 + Height = 331 + Align = alClient + ItemHeight = 13 + MultiSelect = True + PopupMenu = pmMain + TabOrder = 1 + OnClick = ListBoxClick + OnContextPopup = lbxItemsContextPopup + end + end + object tsLinks: TTabSheet + Caption = 'Link designer' + ImageIndex = 2 + object Splitter1: TSplitter + Left = 227 + Top = 28 + Height = 336 + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 394 + Height = 28 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object tlbLinkDesigner: TToolBar + Left = 0 + Top = 6 + Width = 150 + Height = 25 + Align = alNone + Caption = 'Commands' + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Images = ilActions + ParentShowHint = False + ShowHint = True + TabOrder = 0 + object ToolButton22: TToolButton + Left = 0 + Top = 0 + Action = actAdd + end + object ToolButton23: TToolButton + Left = 23 + Top = 0 + Action = actDelete + end + object ToolButton24: TToolButton + Left = 46 + Top = 0 + Width = 8 + Caption = 'ToolButton6' + ImageIndex = 5 + Style = tbsSeparator + end + object ToolButton25: TToolButton + Left = 54 + Top = 0 + Action = actMoveUp + end + object ToolButton26: TToolButton + Left = 77 + Top = 0 + Action = actMoveDown + end + end + end + object Panel3: TPanel + Left = 230 + Top = 28 + Width = 164 + Height = 336 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lbxLinkDesignerItems: TListView + Left = 0 + Top = 25 + Width = 164 + Height = 311 + Align = alClient + Columns = <> + DragMode = dmAutomatic + HideSelection = False + ReadOnly = True + PopupMenu = pmMain + SmallImages = ilLinkDesigner + TabOrder = 0 + ViewStyle = vsList + OnClick = lbxLinkDesignerItemsClick + OnContextPopup = lbxContextPopup + OnEndDrag = lbxLinkDesignerItemsEndDrag + OnDragDrop = lbxLinkDesignerItemsDragDrop + OnDragOver = lbxLinkDesignerItemsDragOver + OnStartDrag = lbxLinkDesignerItemsStartDrag + end + object Panel7: TPanel + Left = 0 + Top = 0 + Width = 164 + Height = 25 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Label2: TLabel + Left = 0 + Top = 7 + Width = 28 + Height = 13 + Caption = 'Items:' + end + end + end + object Panel4: TPanel + Left = 0 + Top = 28 + Width = 227 + Height = 336 + Align = alLeft + BevelOuter = bvNone + TabOrder = 2 + object tvLinkDesignerGroups: TTreeView + Left = 0 + Top = 25 + Width = 227 + Height = 311 + Align = alClient + DragMode = dmAutomatic + HideSelection = False + Images = ilLinkDesigner + Indent = 19 + PopupMenu = pmMain + ReadOnly = True + TabOrder = 0 + OnClick = tvLinkDesignerGroupsClick + OnContextPopup = lbxContextPopup + OnDragDrop = tvLinkDesignerGroupsDragDrop + OnDragOver = tvLinkDesignerGroupsDragOver + OnEndDrag = tvLinkDesignerGroupsEndDrag + OnExit = tvLinkDesignerGroupsExit + OnKeyUp = tvLinkDesignerGroupsKeyUp + OnStartDrag = tvLinkDesignerGroupsStartDrag + end + object Panel5: TPanel + Left = 0 + Top = 0 + Width = 227 + Height = 25 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Label1: TLabel + Left = 0 + Top = 7 + Width = 82 + Height = 13 + Caption = 'Groups and links:' + end + end + end + end + object tsViews: TTabSheet + Caption = 'Views' + ImageIndex = 4 + object Label3: TLabel + Left = 193 + Top = 14 + Width = 41 + Height = 13 + Anchors = [akTop, akRight] + Caption = 'Preview:' + end + object Label4: TLabel + Left = 0 + Top = 14 + Width = 55 + Height = 13 + Caption = 'View styles:' + end + object lblColorScheme: TLabel + Left = 0 + Top = 325 + Width = 67 + Height = 13 + Anchors = [akLeft, akBottom] + Caption = 'Color scheme:' + end + object nbPreview: TdxNavBar + Left = 193 + Top = 32 + Width = 201 + Height = 332 + Anchors = [akTop, akRight, akBottom] + BorderStyle = bsSingle + ActiveGroupIndex = 0 + DragCopyCursor = -1141 + DragCursor = -1140 + HotTrackedLinkCursor = crHandPoint + TabOrder = 0 + View = 13 + OptionsImage.LargeImages = ilPreviewLarge + OptionsImage.SmallImages = ilPreviewSmall + object bgLocal: TdxNavBarGroup + Caption = 'Local' + LargeImageIndex = 4 + SelectedLinkIndex = -1 + SmallImageIndex = 10 + TopVisibleLinkIndex = 0 + UseSmallImages = False + Links = < + item + Item = biInbox + end + item + Item = biOutbox + end + item + Item = biSentItems + end + item + Item = biDeletedItems + end + item + Item = biReport + end> + end + object bgContacts: TdxNavBarGroup + Caption = 'Contacts' + LargeImageIndex = 7 + LinksUseSmallImages = False + SelectedLinkIndex = -1 + SmallImageIndex = 5 + TopVisibleLinkIndex = 0 + Links = < + item + Item = nbCalendar + end + item + Item = nbTask + end + item + Item = biReport + end> + end + object biInbox: TdxNavBarItem + Caption = 'Inbox' + LargeImageIndex = 3 + SmallImageIndex = 3 + end + object biOutbox: TdxNavBarItem + Caption = 'Outbox' + LargeImageIndex = 7 + SmallImageIndex = 7 + end + object biSentItems: TdxNavBarItem + Caption = 'Sent Items' + Enabled = False + LargeImageIndex = 0 + SmallImageIndex = 0 + end + object biDeletedItems: TdxNavBarItem + Caption = 'Deleted Items' + LargeImageIndex = 1 + SmallImageIndex = 1 + end + object biReport: TdxNavBarItem + Caption = 'Report' + LargeImageIndex = 2 + SmallImageIndex = 2 + end + object nbCalendar: TdxNavBarItem + Caption = 'Calendar' + LargeImageIndex = 6 + SmallImageIndex = 6 + end + object nbTask: TdxNavBarItem + Caption = 'Task' + LargeImageIndex = 5 + SmallImageIndex = 4 + end + end + object lbxViewStyles: TListBox + Left = 0 + Top = 32 + Width = 189 + Height = 278 + Anchors = [akLeft, akTop, akRight, akBottom] + ItemHeight = 13 + TabOrder = 1 + OnClick = lbxViewStylesChange + OnContextPopup = lbxContextPopup + end + object cbColorScheme: TComboBox + Left = 0 + Top = 343 + Width = 189 + Height = 21 + Style = csDropDownList + Anchors = [akLeft, akRight, akBottom] + ItemHeight = 0 + TabOrder = 2 + OnChange = cbColorSchemeChange + end + end + object tsDefaultStyles: TTabSheet + Caption = 'Default styles' + ImageIndex = 5 + object lbxDefaultStyles: TListBox + Left = 0 + Top = 33 + Width = 394 + Height = 331 + Align = alClient + ItemHeight = 13 + MultiSelect = True + TabOrder = 0 + OnClick = ListBoxClick + OnContextPopup = lbxContextPopup + end + object Panel8: TPanel + Left = 0 + Top = 0 + Width = 394 + Height = 33 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object tlbDefaultStyles: TToolBar + Left = 0 + Top = 6 + Width = 150 + Height = 33 + Align = alNone + Caption = 'Commands' + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Images = ilActions + ParentShowHint = False + ShowHint = True + TabOrder = 0 + object ToolButton27: TToolButton + Left = 0 + Top = 0 + Action = actDefaultSettings + end + end + end + end + object tsCustomStyles: TTabSheet + Caption = 'Custom styles' + ImageIndex = 3 + object lbxCustomStyles: TListBox + Left = 0 + Top = 33 + Width = 394 + Height = 331 + Align = alClient + ItemHeight = 13 + MultiSelect = True + PopupMenu = pmMain + TabOrder = 0 + OnClick = ListBoxClick + OnContextPopup = lbxContextPopup + end + object Panel6: TPanel + Left = 0 + Top = 0 + Width = 394 + Height = 33 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object tlbCustomStyles: TToolBar + Left = 0 + Top = 6 + Width = 150 + Height = 33 + Align = alNone + Caption = 'Commands' + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Images = ilActions + ParentShowHint = False + ShowHint = True + TabOrder = 0 + object ToolButton15: TToolButton + Left = 0 + Top = 0 + Action = actAdd + end + object ToolButton16: TToolButton + Left = 23 + Top = 0 + Action = actDelete + end + object ToolButton17: TToolButton + Left = 46 + Top = 0 + Width = 8 + Caption = 'ToolButton6' + ImageIndex = 5 + Style = tbsSeparator + end + object ToolButton18: TToolButton + Left = 54 + Top = 0 + Action = actMoveUp + end + object ToolButton19: TToolButton + Left = 77 + Top = 0 + Action = actMoveDown + end + object ToolButton20: TToolButton + Left = 100 + Top = 0 + Width = 8 + Caption = 'ToolButton7' + ImageIndex = 5 + Style = tbsSeparator + end + object ToolButton21: TToolButton + Left = 108 + Top = 0 + Action = actSelectAll + end + end + end + end + end + object pmMain: TPopupMenu + Images = ilActions + Left = 15 + Top = 247 + object miAdd: TMenuItem + Action = actAdd + Visible = False + end + object msiAdd: TMenuItem + Caption = '&Add' + Hint = 'Add' + ImageIndex = 0 + Visible = False + end + object N2: TMenuItem + Caption = '-' + end + object miEdit: TMenuItem + Caption = '&Edit' + object miCut: TMenuItem + Action = actCut + end + object miCopy: TMenuItem + Action = actCopy + end + object miPaste: TMenuItem + Action = actPaste + end + object miDelete: TMenuItem + Action = actDelete + end + object N3: TMenuItem + Caption = '-' + end + object miSelectAll: TMenuItem + Action = actSelectAll + end + end + object N4: TMenuItem + Caption = '-' + end + object miMoveUp: TMenuItem + Action = actMoveUp + end + object miMoveDown: TMenuItem + Action = actMoveDown + end + end + object actlCommands: TActionList + Images = ilActions + Left = 96 + Top = 248 + object actAdd: TAction + Category = 'EditCollection' + Caption = '&Add' + Hint = 'Add' + ImageIndex = 0 + ShortCut = 45 + OnExecute = AddClick + end + object actMoveUp: TAction + Category = 'EditCollection' + Caption = 'Move &Up' + Hint = 'Move up' + ImageIndex = 5 + ShortCut = 16422 + OnExecute = MoveUpClick + end + object actMoveDown: TAction + Category = 'EditCollection' + Caption = 'Move &Down' + Hint = 'Move Down' + ImageIndex = 6 + ShortCut = 16424 + OnExecute = MoveDownClick + end + object actCut: TAction + Category = 'EditCollection' + Caption = 'Cu&t' + Hint = 'Cut|Cuts the selection and puts it on the Clipboard' + ImageIndex = 1 + ShortCut = 16472 + OnExecute = ActionClick + end + object actDefaultSettings: TAction + Category = 'DefaultStyles' + Caption = 'DefaultSettings' + Hint = 'Default settings' + ImageIndex = 7 + ShortCut = 16452 + OnExecute = DefaultSettingsClick + end + object actCopy: TAction + Category = 'EditCollection' + Caption = '&Copy' + Hint = 'Copy|Copies the selection and puts it on the Clipboard' + ImageIndex = 2 + ShortCut = 16451 + OnExecute = ActionClick + end + object actPaste: TAction + Category = 'EditCollection' + Caption = '&Paste' + Hint = 'Paste|Inserts Clipboard contents' + ImageIndex = 3 + ShortCut = 16470 + OnExecute = ActionClick + end + object actDelete: TAction + Category = 'EditCollection' + Caption = '&Delete' + Hint = 'Delete|Erases the selection' + ImageIndex = 4 + ShortCut = 46 + OnExecute = ActionClick + end + object actSelectAll: TAction + Category = 'EditCollection' + Caption = 'Select All' + Hint = 'Select All|Selects the entire document' + ImageIndex = 8 + ShortCut = 16449 + OnExecute = ActionClick + end + end + object ilActions: TcxImageList + FormatVersion = 1 + DesignInfo = 19398672 + ImageInfo = < + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000B0B0B210B0B0B210B0B0B210B0B + 0B210B0B0B210000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000A8261FF09805FFF077E5DFF077C5BFF067A + 5AFF0B0B0B210000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000C8665FF3CC2AAFF3CC2AAFF3BC2AAFF077D + 5CFF0B0B0B210000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000F8968FF3DC5ADFF3DC5ACFF3DC5ACFF0980 + 5FFF0B0B0B210000000000000000000000000000000000000000000000000000 + 00000B0B0B210B0B0B210B0B0B21128D6CFF40C8B0FF40C8B0FF40C7B0FF0A82 + 62FF0B0B0B210B0B0B210B0B0B210B0B0B210B0B0B2100000000000000001B9D + 7CFF1A9A79FF189776FF169573FF149270FF44CDB4FF44CCB3FF44CBB3FF0D87 + 66FF0C8463FF0A8261FF097F5EFF077E5DFF0B0B0B2100000000000000001FA0 + 7FFF4AD3BAFF4AD3B9FF49D2B9FF49D2B8FF49D0B8FF47D0B8FF47D0B7FF47CF + B6FF46CFB7FF46CFB6FF46CEB5FF09805FFF0B0B0B21000000000000000020A4 + 83FF4ED7BEFF4DD7BEFF4DD6BDFF4DD6BDFF4CD6BCFF4CD5BCFF4BD4BCFF4BD4 + BBFF4BD4BAFF49D3B9FF49D2B9FF0B8462FF0B0B0B21000000000000000022A6 + 86FF51DCC2FF51DBC2FF51DBC1FF50DAC1FF50DAC1FF50DAC0FF4FD9C0FF4FD9 + BFFF4ED8BFFF4ED8BFFF4DD7BDFF0E8866FF0B0B0B21000000000000000023A9 + 88FF23A886FF22A685FF20A383FF1EA180FF53DDC4FF53DEC4FF53DDC3FF1797 + 76FF169473FF14916FFF128E6DFF108B6AFF0000000000000000000000000000 + 000000000000000000000000000021A583FF57E1C7FF56E0C7FF56E0C6FF1A9A + 79FF0B0B0B210000000000000000000000000000000000000000000000000000 + 000000000000000000000000000023A786FF58E3C9FF58E3C9FF58E3C8FF1C9E + 7DFF0B0B0B210000000000000000000000000000000000000000000000000000 + 000000000000000000000000000024A989FF58E3C9FF58E3C9FF58E3C9FF1FA2 + 81FF0B0B0B210000000000000000000000000000000000000000000000000000 + 000000000000000000000000000025AB8AFF25AA89FF23A988FF23A786FF21A5 + 84FF000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000840000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008400000000000000000000008400000000000000000000008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000008400000000000000000000008400000000000000840000000000 + 0000000000008400000000000000000000000000000000000000000000000000 + 0000000000008400000000000000000000008400000000000000840000000000 + 0000000000008400000000000000000000000000000000000000000000000000 + 0000000000000000000084000000840000008400000000000000840000000000 + 0000000000008400000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000000000000840000008400 + 0000840000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000000000000840000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + Mask.Data = { + 7E000000424D7E000000000000003E0000002800000010000000100000000100 + 010000000000400000000000000000000000020000000000000000000000FFFF + FF00FFFF0000F3FF0000ED9F0000ED6F0000ED6F0000F16F0000FD1F0000FC7F + 0000FEFF0000FC7F0000FD7F0000F93F0000FBBF0000FBBF0000FBBF0000FFFF + 0000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000840000008400 + 0000840000008400000084000000840000008400000000000000000000000000 + 00000000000000000000000000000000000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008400000000000000000000000000 + 00000000000000000000000000000000000084000000FFFFFF00000000000000 + 0000000000000000000000000000FFFFFF008400000000000000000000000000 + 00000000000000000000000000000000000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00840000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0084000000FFFFFF00000000000000 + 0000000000000000000000000000FFFFFF00840000000000000000000000FFFF + FF000000000000000000000000000000000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00840000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0084000000FFFFFF00000000000000 + 0000FFFFFF00840000008400000084000000840000000000000000000000FFFF + FF000000000000000000000000000000000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0084000000FFFFFF0084000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00840000008400000000000000000000000000000000000000FFFF + FF000000000000000000FFFFFF00000000008400000084000000840000008400 + 000084000000840000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF0000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + Mask.Data = { + 7E000000424D7E000000000000003E0000002800000010000000100000000100 + 010000000000400000000000000000000000020000000000000000000000FFFF + FF00FFFF0000FFFF0000FC010000FC010000FC01000000010000000100000001 + 0000000100000003000000070000000F000000FF000001FF000003FF0000FFFF + 0000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008400000084000000840000008400 + 0000840000008400000084000000840000008400000084000000000000000000 + 00000000000000000000000000000000000084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0084000000000000008484 + 84000084840084848400008484008484840084000000FFFFFF00840000008400 + 000084000000840000008400000084000000FFFFFF0084000000000000000084 + 84008484840000848400848484000084840084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0084000000000000008484 + 84000084840084848400008484008484840084000000FFFFFF00840000008400 + 000084000000FFFFFF0084000000840000008400000084000000000000000084 + 84008484840000848400848484000084840084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000FFFFFF008400000000000000000000008484 + 84000084840084848400008484008484840084000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0084000000840000000000000000000000000000000084 + 8400848484000084840084848400008484008400000084000000840000008400 + 0000840000008400000084000000000000000000000000000000000000008484 + 8400008484008484840000848400848484000084840084848400008484008484 + 8400008484008484840000848400000000000000000000000000000000000084 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000008484840084848400000000000000000000000000000000008484 + 84008484840000000000C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6 + C600000000008484840000848400000000000000000000000000000000000084 + 840084848400008484000000000000FFFF00000000000000000000FFFF000000 + 0000848484000084840084848400000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF0000FFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + Mask.Data = { + 7E000000424D7E000000000000003E0000002800000010000000100000000100 + 010000000000400000000000000000000000020000000000000000000000FFFF + FF00FFFF0000FC00000080000000000000000000000000000000000100000003 + 0000000300000003000000030000000300000003000080070000F87F0000FFFF + 0000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000A1C290141ACFF171717450000000000000000000000000000 + 00000141ACFF1717174500000000000000000000000000000000000000000000 + 0000000A1C290141ACFF2D60DFFF0141ACFF1717174500000000000000000141 + ACFF2D60DFFF0141ACFF17171745000000000000000000000000000000000000 + 00000141ACFF2D60DFFF3666E9FF2D60DFFF0141ACFF171717450141ACFF2D60 + DFFF3666E9FF2D60DFFF0141ACFF171717450000000000000000000000000000 + 0000000A1C290141ACFF2F63E1FF3869EBFF2F63E1FF0141ACFF2F63E1FF3969 + EBFF2F63E1FF0141ACFF17171745000000000000000000000000000000000000 + 000000000000000A1C290141ACFF3368E3FF3C6EEEFF3C6EEEFF3C6FEEFF3367 + E3FF0141ACFF1717174500000000000000000000000000000000000000000000 + 00000000000000000000000A1C290141ACFF4074F2FF4075F1FF4074F1FF0141 + ACFF171717450000000000000000000000000000000000000000000000000000 + 000000000000000A1C290141ACFF3871E8FF4379F4FF4379F4FF437AF4FF3970 + E8FF0141ACFF1717174500000000000000000000000000000000000000000000 + 0000000A1C290141ACFF3B73EAFF467DF6FF3B73EAFF0141ACFF3B73EAFF467D + F6FF3B73EAFF0141ACFF17171745000000000000000000000000000000000000 + 00000141ACFF3B73EAFF467DF6FF3B73EAFF0141ACFF171717450141ACFF3B73 + EAFF467DF6FF3B73EAFF0141ACFF171717450000000000000000000000000000 + 0000000A1C290141ACFF3B73EAFF0141ACFF1717174500000000000000000141 + ACFF3B73EAFF0141ACFF17171745000000000000000000000000000000000000 + 000000000000000A1C290141ACFF171717450000000000000000000000000000 + 00000141ACFF1717174500000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000B0B0B260B0B0B260B0B0B260B0B + 0B260B0B0B260000000000000000000000000000000000000000000000000000 + 000000000000000000000000000025AB8AFF24AA89FF23AA87FF22A987FF22A9 + 86FF0B0B0B260000000000000000000000000000000000000000000000000000 + 000000000000000000000000000022A988FF58E3C9FF58E3C9FF58E3C9FF1EA6 + 84FF0B0B0B260000000000000000000000000000000000000000000000000000 + 00000000000000000000000000001FA583FF55E0C6FF55E0C6FF55E0C6FF1BA0 + 7EFF0B0B0B260000000000000000000000000000000000000000000000000000 + 00000000000000000000000000001B9E7CFF51DBC2FF51DBC2FF51DBC1FF179C + 7AFF0B0B0B260000000000000000000000000000000000000000000000000000 + 0000000000000B0B0B260B0B0B26189C7AFF4CD6BCFF4CD5BCFF4CD5BCFF149B + 78FF0B0B0B260B0B0B260B0B0B260B0B0B260000000000000000000000000000 + 0000179C7AFF169C79FF159B78FF149B78FF47D0B6FF47D0B6FF47D0B6FF1199 + 76FF109975FF0F9875FF0E9874FF000000000000000000000000000000000000 + 00000023194B138D6BFF37BDA3FF42CAB1FF42CAB1FF42CAB2FF42CAB2FF42CA + B1FF37BDA3FF0C8464FF00000000000000000000000000000000000000000000 + 0000000000000023194B0F8766FF33B89FFF3EC5ADFF3EC5ADFF3EC6ADFF34B8 + 9FFF0A8160FF0000000000000000000000000000000000000000000000000000 + 000000000000000000000023194B0B8362FF32B69CFF3BC2AAFF32B69CFF087F + 5EFF000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000023194B087F5CFF32B69CFF067C5CFF0000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000023194B057A59FF000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000023194B057A59FF0E0E0E300000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000023194B087F5CFF32B69CFF067C5CFF0E0E + 0E30000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000023194B0B8362FF32B69CFF3BC2AAFF32B69CFF087F + 5EFF0E0E0E300000000000000000000000000000000000000000000000000000 + 0000000000000023194B0F8766FF33B89FFF3EC5ADFF3EC5ADFF3EC6ADFF34B8 + 9FFF0A8160FF0E0E0E3000000000000000000000000000000000000000000000 + 00000023194B138D6BFF37BDA3FF42CAB1FF42CAB1FF42CAB2FF42CAB2FF42CA + B1FF37BDA3FF0C8464FF0E0E0E30000000000000000000000000000000000000 + 0000179C7AFF169C79FF159B78FF149B78FF47D0B6FF47D0B6FF47D0B6FF1199 + 76FF109975FF0F9875FF0E9874FF0E0E0E300000000000000000000000000000 + 0000000000000000000000000000189C7AFF4CD6BCFF4CD5BCFF4CD5BCFF149B + 78FF0E0E0E300000000000000000000000000000000000000000000000000000 + 00000000000000000000000000001B9E7CFF51DBC2FF51DBC2FF51DBC1FF179C + 7AFF0E0E0E300000000000000000000000000000000000000000000000000000 + 00000000000000000000000000001FA583FF55E0C6FF55E0C6FF55E0C6FF1BA0 + 7EFF0E0E0E300000000000000000000000000000000000000000000000000000 + 000000000000000000000000000022A988FF58E3C9FF58E3C9FF58E3C9FF1EA6 + 84FF0E0E0E300000000000000000000000000000000000000000000000000000 + 000000000000000000000000000025AB8AFF24AA89FF23AA87FF22A987FF22A9 + 86FF000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000070A09280C11 + 10430141ACFF0B2E60B61D282D8A17211F82151C1B73121817620F1413510C10 + 0F41090C0C310608082104050514000000000000000000000000000000000000 + 0000001B47696794F6FF6794F6FF5B83DAE22D416C7000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000587FD3DB6794F6FF6794F6FF0C5BCDFF0141ACFF000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000314675796794F6FF6794F6FF0B45BAFF0C5BCDFF0141ACFF0000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000121A2B2D3863F1FF0141ACFF6794F6FF0B45BAFF0C5BCDFF0141 + ACFF000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000013DA2F03863F1FF3E71EFFF6794F6FF0B45BAFF0C5B + CDFF0141ACFF0000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000141ACFF3863F1FF3E71EFFF6794F6FF0B45 + BAFF0C5BCDFF0141ACFF00000000000000000000000000000000000000000000 + 00000000000000000000FFFFFFFFFFFFFFFF0141ACFF3863F1FF3E71EFFF6794 + F6FF0B45BAFF0C5BCDFF0141ACFF000000000000000000000000000000000000 + 000000000000FFFFFFFF000000FFFFFFFFFF000000000141ACFF3863F1FF3E71 + EFFF6794F6FF0B45BAFFFFFFFFFF2E7857FF0000000000000000000000000000 + 0000FFFFFFFF000000FF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFF3E71EFFFFFFFFFFF3C906FFF429664FF286443CF0000000000000000FFFF + FFFF000000FF000000FF000000FF000000FF000000FF000000FF000000FFFFFF + FFFFFFFFFFFF69B2A5FF8FCDAEFF429664FF429664FF1535236E000000000000 + 00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FFFFFF + FFFF276F65FF70BD99FF70BD99FF8FCDAEFF317B52FF00000000000000000000 + 0000000000FF000000FF000000FF000000FF000000FF000000FF000000FFFFFF + FFFF00000000286443CF70BD99FF317B52FF0000000000000000000000000000 + 000000000000000000FF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFF0000000000000000112B1D59000000000000000000000000000000000000 + 00000000000000000000000000FF000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000FF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000FF0000000000000000000000000032 + 86FFFFFFFFFF003286FFFFFFFFFF003286FFFFFFFFFF003286FFFFFFFFFF0032 + 86FFFFFFFFFF000000FF000000FF000000FF000000FF000000FF00000000FFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFE9E9E9FFE8E8E8FFE7E7E7FFE6E6E6FFE4E4 + E4FFE3E3E3FFE3E3E3FFFFFFFFFF000000FF0000000000000000000000000032 + 86FFFFFFFFFFFFFFFFFF007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FFE4E4E4FFFFFFFFFF000000FF000000000000000000000000FFFF + FFFFFFFFFFFFFFFFFFFF007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFF007756FFE6E6E6FFFFFFFFFFFFFFFFFF0000000000000000000000000032 + 86FFFFFFFFFFFFFFFFFF007756FFFFFFFFFF494949FF474747FF454545FFFFFF + FFFF007756FFE7E7E7FFFFFFFFFF003286FF000000000000000000000000FFFF + FFFFFFFFFFFFFFFFFFFF007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFF007756FFE9E9E9FFFFFFFFFFFFFFFFFF0000000000000000000000000032 + 86FFFFFFFFFFFFFFFFFF007756FFFFFFFFFF646464FF626262FF606060FFFFFF + FFFF007756FFEBEBEBFFFFFFFFFF003286FF000000000000000000000000FFFF + FFFFFFFFFFFFFFFFFFFF007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFF007756FFEDEDEDFFFFFFFFFFFFFFFFFF0000000000000000000000000032 + 86FFFFFFFFFFFFFFFFFF007756FFFFFFFFFF818181FF7E7E7EFFFFFFFFFFFFFF + FFFF007756FFFFFFFFFFFFFFFFFF003286FF000000000000000000000000FFFF + FFFFFFFFFFFFFFFFFFFF007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0077 + 56FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000032 + 86FFFFFFFFFFFFFFFFFF007756FF007756FF007756FF007756FF007756FFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFF003286FF000000000000000000000000FFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000032 + 86FFFFFFFFFF003286FFFFFFFFFF003286FFFFFFFFFF003286FFFFFFFFFF0032 + 86FFFFFFFFFF003286FFFFFFFFFF003286FF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000006060611121212351414143B1414143B1414143BFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF12121235060606110000000000000000000000000000 + 000000221848026D50EC007756FF007756FF007756FF007756FFFFFFFFFF0000 + 00FF000000FFFFFFFFFF0E2F2672121212350000000000000000000000000000 + 0000006A4DE4B7D9CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000 + 00FF000000FFFFFFFFFFFFFFFFFF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFADADADFFADADADFFFFFFFFFF000000FF000000FF0000 + 00FF000000FF000000FF000000FF1414143B00000000000000000404040C0D0D + 0D270E7156FFE2E2E2FFE2E2E2FFE2E2E2FFFFFFFFFF000000FF000000FF0000 + 00FF000000FF000000FF000000FF1E1E1E590404040C000000000D3329630D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFF0000 + 00FF000000FFFFFFFFFFFFFFFFFF0D9570FF0D332963000000000D9570FF0D95 + 70FF007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000 + 00FF000000FFFFFFFFFF007756FF0D9570FF0D9570FF000000000D9570FF0D95 + 70FF007756FFFFFFFFFF8D968BFF8D968BFF8D968BFF8D968BFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF0D9570FF0D9570FF000000000D9570FF0D95 + 70FF0E7156FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2 + E2FFE2E2E2FFE2E2E2FF0E7156FF0D9570FF0D9570FF0000000003251C3F0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF03251C3F00000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3 + C3FFC3C3C3FFFFFFFFFF007756FF121212350000000000000000000000000000 + 0000006C4EE7BDDCD3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFBDDCD3FF016D4FEB0505050F0000000000000000000000000000 + 0000001D153F005E44C9007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF005E44C9001D153F000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000006060611121212351414143B1414143B1414143BFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF12121235060606110000000000000000000000000000 + 000000221848026D50EC007756FF007756FF007756FF007756FFFFFFFFFF0000 + 00FF000000FFFFFFFFFF0E2F2672121212350000000000000000000000000000 + 0000006A4DE4B7D9CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000 + 00FF000000FFFFFFFFFFFFFFFFFF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFF434343FFFFFFFFFFFFFFFFFF000000FF000000FF0000 + 00FF000000FF000000FF000000FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FF000000FF0000 + 00FF000000FF000000FF000000FF1414143B0000000000000000000000000000 + 0000007756FF007756FF007756FF007756FFFFFFFFFFFFFFFFFFFFFFFFFF0000 + 00FF000000FFFFFFFFFFFFFFFFFF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000 + 00FF000000FFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFF434343FFFFFFFFFFA6A6A6FFA6A6A6FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FF007756FF007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF007756FF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFF434343FFFFFFFFFFA6A6A6FFA6A6A6FFA6A6A6FFA6A6 + A6FFA6A6A6FFFFFFFFFF007756FF121212350000000000000000000000000000 + 0000006C4EE7BDDCD3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFBDDCD3FF016D4FEB0505050F0000000000000000000000000000 + 0000001D153F005E44C9007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF005E44C9001D153F000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end> + end + object ilNavBarLarge: TcxImageList + Height = 32 + Width = 32 + FormatVersion = 1 + DesignInfo = 19398704 + ImageInfo = < + item + Image.Data = { + 36100000424D3610000000000000360000002800000020000000200000000100 + 2000000000000010000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000010101022222223B393939624040 + 406D4141416F4242427143434372434343734444447444444475464646774646 + 4678474747794747477A4848487B4848487C4949497D4A4A4A7E4A4A4A7F4444 + 4475292929470202020300000000000000000000000000000000000000000000 + 00000000000000000000000000000004030615604CA5128D6CF10D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF138E6DF32773 + 5EC5494C4B822828284500000000000000000000000000000000000000000000 + 0000000000000000000000000000074F3B870D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF29725EC34343437200000000000000000000000000000000000000000000 + 00000000000000000000000000000C8967EA0D9570FF51B398FFE8F5F2FFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE8F5F2FF51B398FF0D95 + 70FF118F6CF44747477A00000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFE5F4F0FFFCFCFCFFF4F4 + F4FFF2F2F2FFF1F1F1FFF1F1F1FFF0F0F0FFEFEFEFFFEFEFEFFFEEEEEEFFEEEE + EEFFEDEDEDFFECECECFFECECECFFEBEBEBFFEDEDEDFFF9F9F9FFE5F4F0FF0D95 + 70FF0D9570FF4646467800000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFFFFFFFFFF8F8F8FFF7F7 + F7FF818181FF818181FF808080FF7F7F7FFF7E7E7EFF7D7D7DFF7D7D7DFF7C7C + 7CFF7B7B7BFF7A7A7AFF7A7A7AFF797979FFEEEEEEFFEFEFEFFFFFFFFFFF0D95 + 70FF0D9570FF4444447400000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFFFFFFFFFFBFBFBFFFBFB + FBFFFAFAFAFFFAFAFAFFF9F9F9FFF8F8F8FFF8F8F8FFF7F7F7FFF6F6F6FFF6F6 + F6FFF5F5F5FFF4F4F4FFF3F3F3FFF3F3F3FFF2F2F2FFF1F1F1FFFFFFFFFF0D95 + 70FF0D9570FF4242427100000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFFFFFFFFFFEFEFEFFFEFE + FEFFFEFEFEFFFDFDFDFFFDFDFDFFFCFCFCFFFBFBFBFFFBFBFBFFFAFAFAFFFAFA + FAFFF9F9F9FFF8F8F8FFF8F8F8FFF7F7F7FFF6F6F6FFF6F6F6FFFFFFFFFF0D95 + 70FF0D9570FF4040406E00000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFFFFFFFFFFFFFFFFFFFFF + FFFF909090FF8F8F8FFF8E8E8EFF8E8E8EFF8C8C8CFF8B8B8BFF8A8A8AFF8989 + 89FF888888FF878787FF868686FF858585FFFAFAFAFFFAFAFAFFFFFFFFFF0D95 + 70FF0D9570FF3F3F3F6B00000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFE8F5F2FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFEFEFFFFFFFFFFE8F5F2FF0D95 + 70FF0D9570FF3D3D3D6800000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FF49AF93FFCCE9E1FFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFCCD5F8FF6C87EAFF234AE0FF6C87EAFFCCD5F8FFDFF1ECFF49AF93FF0D95 + 70FF0D9570FF3A3A3A6400000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF09644CFFBAD0 + CAFF6C87EAFF153FDEFFFFFFFFFF153FDEFF6C87EAFFBAD0CAFF09644CFF0D95 + 70FF0D9570FF3939396100000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF085842FFF5F8 + F8FF234AE0FFFFFFFFFFFFFFFFFFFFFFFFFF234AE0FFF5F8F8FF085842FF0D95 + 70FF0D9570FF3636365D00000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF41CBAFFF41CBAFFF41CBAFFF41CB + AEFF41CBAFFF41CBAFFF41CBAEFF41CBAFFF41CBAEFF41CBAEFF157059FFBAD0 + CAFF6C87EAFF153FDEFF153FDEFF153FDEFF6C87EAFFBAD0CAFF15705AFF41CB + AFFF0D9570FF3434345900000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF2FB798FF32BB9CFF32BB9CFF32BC + 9DFF32BC9DFF32BC9DFF32BC9DFF32BC9DFF32BB9CFF32BC9DFF1E8B71FF6596 + 89FFC6D1F4FF6C87EAFF234AE0FF6C87EAFFC6D1F4FF659689FF1E8B71FF2FB7 + 98FF0D9570FF3232325600000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF129B76FF1EA785FF23AC8BFF23AC + 8BFF23AC8BFF23AC8AFF23AC8BFF23AC8BFF23AC8BFF23AC8AFF20A182FF1274 + 5BFF659689FFBAD0CAFFF5F8F8FFBAD0CAFF659689FF12745BFF1B9D7CFF129B + 76FF0D9570FF3030305200000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0C8D + 6AFF0B7759FF09644CFF085842FF09644CFF0B7759FF0C8D6AFF0D9570FF0D95 + 70FF0D9570FF2E2E2E4F00000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FF51B398FFE8F5F2FFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE8F5F2FF51B398FF0D95 + 70FF0D9570FF2C2C2C4B00000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFE5F4F0FFFCFCFCFFF4F4 + F4FFF2F2F2FFF1F1F1FFF1F1F1FFF0F0F0FFEFEFEFFFEFEFEFFFEEEEEEFFEEEE + EEFFEDEDEDFFECECECFFECECECFFEBEBEBFFEDEDEDFFF9F9F9FFE5F4F0FF0D95 + 70FF0D9570FF2929294700000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFFFFFFFFFF8F8F8FFF7F7 + F7FFBBBBBBFFBABABAFFB8B8B8FFB7B7B7FFB6B6B6FFB4B4B4FFB3B3B3FFB1B1 + B1FFB0B0B0FFAFAFAFFFADADADFFADADADFFEEEEEEFFEFEFEFFFFFFFFFFF0D95 + 70FF0D9570FF2727274300000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFFFFFFFFFFBFBFBFFFBFB + FBFFFAFAFAFFFAFAFAFFF9F9F9FFF8F8F8FFF8F8F8FFF7F7F7FFF6F6F6FFF6F6 + F6FFF5F5F5FFF4F4F4FFF3F3F3FFF3F3F3FFF2F2F2FFF1F1F1FFFFFFFFFF0D95 + 70FF0D9570FF2525253F00000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFFFFFFFFFFEFEFEFFFEFE + FEFFFEFEFEFFFDFDFDFFFDFDFDFFFCFCFCFFFBFBFBFFFBFBFBFFFAFAFAFFFAFA + FAFFF9F9F9FFF8F8F8FFF8F8F8FFF7F7F7FFF6F6F6FFF6F6F6FFFFFFFFFF0D95 + 70FF0D9570FF2323233C00000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFFFFFFFFFFFFFFFFFFFFF + FFFFCBCBCBFFCBCBCBFFCBCBCBFFCACACAFFC8C8C8FFC8C8C8FFC7C7C7FFC5C5 + C5FFC4C4C4FFC3C3C3FFC1C1C1FFC0C0C0FFFAFAFAFFFAFAFAFFFFFFFFFF0D95 + 70FF0D9570FF2121213800000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FFE8F5F2FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFEFEFFFFFFFFFFE8F5F2FF0D95 + 70FF0D9570FF1E1E1E3400000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FF49AF93FFCCE9E1FFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFCCD5F8FF6C87EAFF234AE0FF6C87EAFFCCD5F8FFDFF1ECFF49AF93FF0D95 + 70FF0D9570FF1C1C1C3000000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF09644CFFBAD0 + CAFF6C87EAFF153FDEFFFFFFFFFF153FDEFF6C87EAFFBAD0CAFF09644CFF0D95 + 70FF0D9570FF1A1A1A2D00000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF085842FFF5F8 + F8FF234AE0FFFFFFFFFFFFFFFFFFFFFFFFFF234AE0FFF5F8F8FF085842FF0D95 + 70FF0D9570FF1818182900000000000000000000000000000000000000000000 + 00000000000000000000000000000D9570FF41CBAFFF41CBAFFF41CBAFFF41CB + AEFF41CBAFFF41CBAFFF41CBAEFF41CBAFFF41CBAEFF41CBAEFF157059FFBAD0 + CAFF6C87EAFF153FDEFF153FDEFF153FDEFF6C87EAFFBAD0CAFF15705AFF41CB + AFFF0D9570FF1414142200000000000000000000000000000000000000000000 + 00000000000000000000000000000C8967EA32BB9CFF32BB9CFF32BB9CFF32BC + 9DFF32BC9DFF32BC9DFF32BC9DFF32BC9DFF32BB9CFF32BC9DFF1E8B71FF6596 + 89FFC6D1F4FF6C87EAFF234AE0FF6C87EAFFC6D1F4FF659689FF1E8B71FF32BB + 9CFF0E8A68ED0B0B0B1200000000000000000000000000000000000000000000 + 0000000000000000000000000000074F3B87169F7BFF22AB8AFF23AC8BFF23AC + 8BFF23AC8BFF23AC8AFF23AC8BFF23AC8BFF23AC8BFF23AC8AFF20A182FF1274 + 5BFF659689FFBAD0CAFFF5F8F8FFBAD0CAFF659689FF12745BFF1FA081FF169F + 7BFF0B533F8E0101010100000000000000000000000000000000000000000000 + 000000000000000000000000000000040306074D3A840C8564E40D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0C8D + 6AFF0B7759FF09644CFF085842FF09644CFF0B7759FF0C8D6AFF0C8564E4074D + 3A84000403060000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36100000424D3610000000000000360000002800000020000000200000000100 + 2000000000000010000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000010101040405051506090824090C + 0C310A0E0E3A0B100F3F0A0E0E3A090C0C310609082404050515010101040000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000060D1025133547721A526FAC1F648CD12272 + A0EE2378A9FE22719EEE1E638AD11A506EAC1437487E0D17194A080B0B2E0406 + 0618000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000102020713394D7720658CCF2690C1FF28A0CFFF29AEDCFF2AB9 + E6FF2DBFEBFF2DBBE5FF2DAEDBFF2A9FCDFF278CBBFF1E5F84CB163C4F860B10 + 0F3F060908240102020700000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000061218231B5271A82790C2FE29A8D7FF2BBFECFF2BC0ECFF2DC1ECFF2EC1 + EDFF30C1EDFF31C2EDFF33C3EEFF36C4EEFF37C3EDFF32A9D5FF298AB9FE1A4F + 6DAA0F1E2456070A092801020207000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000612 + 18221D5B7CB6289BCCFF2AB7E4FF2BC0ECFF2CC0ECFF2DC1EDFF2FC2ECFF75AC + 9EFFCB8F3BFFCC8F3BFF79AD9FFF39C5EFFF3CC7EFFF3EC8EFFF3DBDE5FF3097 + C5FF1B5676B60F1E245606090824000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000010101051B53 + 72A5299CCEFF2BBBE8FF2CC1ECFF2DC1EDFF2FC1EDFF31C2EDFF32C3EEFFCC8F + 3BFFFD7E00FFFD7E00FFCD903BFF3EC7F0FF41C9F0FF44CAF1FF46CAF1FF46C5 + ECFF3399C6FF1A506DAA0B100F3F040606180000000000000000000000000000 + 000000000000000000000000000000000000000000000000000013394E722895 + C9FE2BB8E6FF2EC1EDFF24B3C3FF16A08FFF16A08FFF28B4C3FF36C4EFFFCD90 + 3BFFFD7E00FFFD7E00FFCE903BFF44C9F0FF46CBF1FF49CBF2FF4CCDF2FF4FCD + F2FF4BC2E8FF308FBDFE163C5086080B0B2E0101010400000000000000000000 + 0000020202032020203D353535653B3B3B713C3C3C733B4245852D769FE32BAD + DCFF2EC2EDFF31C2EDFF16A08FFF0D9570FF0D9570FF18A18FFF3BC6EFFF7EAF + 9FFFCE903BFFCF913CFF82B1A1FF49CBF2FF419EB5FF366269FF376369FF47A0 + B7FF57D1F5FF46B2DBFF1E6187CB0D17194A0405051500000000000000000004 + 030614604BA6118C6BF10D9570FF0D9570FF0D9470FF198C89FF2A9ACFFF30C2 + EDFF32C3EEFF34C4EEFF17A18FFF0D9570FF0D9570FF19A190FF40C8F0FF43C9 + F0FF46CBF1FF48CBF2FF4BCCF2FF4ECEF3FF376269FF2E3F3CFF2E3F3CFF3963 + 6AFF5ED3F6FF60D4F5FF3694C2FF1537497E060908240000000000000000074F + 3B870D9570FF0D9570FF0D9570FF0D9570FF0F906DFF1F8B9EFF2EA9DBFF33C3 + EEFF36C4EFFF38C5EFFF2BB6C5FF19A18FFF1AA290FF31B8C6FF45CAF1FF48CB + F2FF4ACCF2FF4ECEF3FF50CEF3FF54CFF4FF386369FF2E3F3CFF2E3F3CFF3A64 + 6AFF62D6F7FF66D6F7FF49ADD6FF1B5271AC090C0C3100000000000000000C89 + 67EA0D9570FF51B398FFE8F5F2FFFFFFFFFFEBECECFF53A1CDFF32B6E4FF38C5 + EEFF3BC6EFFF3DC7EFFF3FC8EFFF42C9F0FF45CAF1FF47CBF1FF4BCCF1FF4ECD + F2FF50CFF3FF54D0F4FF57D1F4FF59D2F4FF4DA2B8FF3A646AFF3B646AFF53A4 + B9FF68D8F7FF6CD9F8FF5CC2E6FF20668FD10A0E0E3A00000000000000000D95 + 70FF0D9570FFE5F4F0FFFFFFFFFFFFFFFFFFE3E5E5FF3996CBFF38C0EBFF2988 + F1FF133AF4FF133AF4FF2F8AF2FF48CBF2FF4ACCF2FF4DCDF3FF50CEF3FF53D0 + F3FF56D1F4FF59D2F4FF5CD3F5FF5FD5F6FF62D5F7FF66D7F6FF69D8F8FF6BD9 + F8FF6EDAF8FF72DBF9FF6CD3F3FF2377A7EE0B100F3F00000000000000000D95 + 70FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFFDDE0E0FF2B91CAFF3FC6F0FF133A + F4FF040BF5FF040BF5FF153BF4FF4DCDF3FF50CEF3FF53D0F3FF56D0F4FF59D2 + F5FF5CD3F5FF5FD4F6FF62D6F7FF65D6F7FF68D7F7FF6BD8F8FF56C0FBFF399F + FEFF399FFEFF5CC2FCFF78DEF9FF2680B5FE0A0E0E3A00000000000000000D95 + 70FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFFDADDDDFF3A98CDFF41C4EDFF153A + F4FF040BF5FF040BF5FF173BF5FF52CFF4FF56D0F4FF58D1F5FF5CD3F5FF5ED4 + F6FF61D5F6FF65D6F7FF67D7F7FF6AD9F8FF6EDAF8FF71DAF9FF399FFEFF268B + FFFF268BFFFF3BA0FEFF75D7F5FF2379ABEE090C0C3100000000000000000D95 + 70FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFFDDDFDFFF53A2CFFF3DB6E3FF348C + F4FF173BF5FF173BF5FF3A8FF4FF58D2F5FF5CD2F5FF5ED3F5FF61D5F6FF58C8 + EDFF47B0DDFF56C1E9FF69D5F6FF70DBF9FF73DCF9FF76DDFAFF3BA0FEFF268B + FFFF268BFFFF3CA0FEFF6BCAEBFF206B94D10609082400000000000000000D95 + 70FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFFE1E4E3FF88B9D3FF2C94CEFF4EC9 + F0FF54D0F4FF58D1F5FF5AD3F5FF5ED4F5FF61D5F6FF55C4EBFF3298CEFF4295 + C3FF61A1C3FF5F9FC2FF2C8DC5FF57BDE5FF78DEFBFF7BDFFBFF61C4FDFF3CA0 + FEFF3DA0FEFF65C5FEFF5AB8DFFF1C5575AC0405051500000000000000000D95 + 70FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFFEDEEEEFFCED6D7FF3A97CDFF2D96 + CFFF42B0E0FF4FC0E9FF56C7EEFF4CBAE5FF359DD3FF2B90CAFF78ABC7FFD2D7 + D7FFD3D6D6FFB5BBBAFF599DC3FF3DA1D3FF7DE0FBFF80E1FCFF82E2FCFF85E3 + FDFF87E4FEFF88E3FDFF44A2D1FF133648720101010400000000000000000D95 + 70FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFFFDFDFDFFD8DCDBFFC6D0D3FF7DB2 + CFFF54A1CDFF4A9DCCFF499CCBFF489CCBFF5DA3C9FFB9D1DDFFFEFEFEFFFFFF + FFFFFFFFFFFFCDD2D1FF4F9AC3FF44A7D8FF82E1FCFF85E3FDFF87E3FDFF88E4 + FEFF8AE5FEFF68C4E8FF226B94D1060E11250000000000000000000000000D95 + 70FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFDFDFFE8EAEAFFDADD + DDFFD4D8D7FFD2D6D5FFCFD3D3FFD6D9D9FFF1F2F2FFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFBEC9CCFF2A8FCAFF70CFF1FF86E3FDFF88E4FDFF8BE5FEFF8CE5 + FEFF7FD9F6FF43A2D2FE143B5077000000000000000000000000000000000D95 + 70FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFF9FAFAFF84ABBEFF3A9FD4FF88E4FDFF8AE4FEFF8BE5FEFF8DE6FFFF87DF + FBFF51B0DDFF1C5877AD01020207000000000000000000000000000000000D95 + 70FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFFCBCBCBFFCBCBCBFFCBCBCBFFCACA + CAFFC9C9C9FFC8C8C8FFC7C7C7FFC7C7C7FFC5C5C5FFC5C5C5FFC4C4C4FFC3C3 + C3FFE0E5E6FF5B9EC2FF67C6ECFF8BE5FEFF8DE6FEFF8FE6FEFF81DAF7FF51B2 + DEFF206085BD0612182300000000000000000000000000000000000000000D95 + 70FF0D9570FFFFFFFFFFFFFFFFFFFFFFFFFFCBCBCBFFCBCBCBFFCBCBCBFFCACA + CAFFC9C9C9FFC8C8C8FFC7C7C7FFC7C7C7FFC5C5C5FFC5C5C5FFC4C4C4FFC1C1 + C1FFB3C9D3FF2A91CCFF79D4F4FF8EE7FFFF8EE6FFFF67C4EAFF389BD0FE1E59 + 79B107131A270000000000000000000000000000000000000000000000000D95 + 70FF0D9570FFE8F5F2FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2F3 + F3FFAFB8BAFF5DA0C4FF48ABDBFF4AACDCFF399ED4FF2B78A2E4163E54820203 + 030B000000000000000000000000000000000000000000000000000000000D95 + 70FF0D9570FF49AF93FFCCE9E1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCCD5F8FF6C87EAFF234AE0FF6B86 + E7FFA8B3CEFF8AAAB1FF328CA8FF23849BFF1D8485FF2932346F000000000000 + 0000000000000000000000000000000000000000000000000000000000000D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF09644CFFBAD0CAFF6C87EAFF153FDEFFFFFFFFFF153F + DDFF6883E0FF9BB0AAFF115C49FF118A69FF0E936FFF2727274A000000000000 + 0000000000000000000000000000000000000000000000000000000000000D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF085842FFF5F8F8FF234AE0FFFFFFFFFFFFFFFFFFFFFF + FFFF234AE0FFF5F8F8FF085842FF0D9570FF0D9570FF25252546000000000000 + 0000000000000000000000000000000000000000000000000000000000000D95 + 70FF41CBAFFF41CBAFFF41CBAFFF41CBAEFF41CBAFFF41CBAFFF41CBAEFF41CB + AFFF41CBAEFF41CBAEFF157059FFBAD0CAFF6C87EAFF153FDEFF153FDEFF153F + DEFF6C87EAFFBAD0CAFF15705AFF41CBAFFF0D9570FF2020203C000000000000 + 0000000000000000000000000000000000000000000000000000000000000C89 + 67EA32BB9CFF32BB9CFF32BB9CFF32BC9DFF32BC9DFF32BC9DFF32BC9DFF32BC + 9DFF32BB9CFF32BC9DFF1E8B71FF659689FFC6D1F4FF6C87EAFF234AE0FF6C87 + EAFFC6D1F4FF659689FF1E8B71FF32BB9CFF0E8C69EF11111120000000000000 + 000000000000000000000000000000000000000000000000000000000000074F + 3B87169F7BFF22AB8AFF23AC8BFF23AC8BFF23AC8BFF23AC8AFF23AC8BFF23AC + 8BFF23AC8BFF23AC8AFF20A182FF12745BFF659689FFBAD0CAFFF5F8F8FFBAD0 + CAFF659689FF12745BFF1FA081FF169F7BFF0E56439501010101000000000000 + 0000000000000000000000000000000000000000000000000000000000000004 + 0306074D3A840C8564E40D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0C8D6AFF0B7759FF09644CFF085842FF0964 + 4CFF0B7759FF0C8D6AFF0C8564E4074D3A840004030600000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36100000424D3610000000000000360000002800000020000000200000000100 + 2000000000000010000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000080800000808000000000000000 + 000000000000000000000000000000000000C0C0C000C0C0C000000000000080 + 8000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000080800000808000000000000000 + 000000000000000000000000000000000000C0C0C000C0C0C000000000000080 + 8000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000000000000080800000808000000000000000 + 000000000000000000000000000000000000C0C0C000C0C0C000000000000080 + 8000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000080800000808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000080 + 8000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000080800000808000008080000080 + 8000008080000080800000808000008080000080800000808000008080000080 + 8000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000FFFFFF00C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000000000000080800000808000000000000000 + 0000000000000000000000000000000000000000000000000000008080000080 + 8000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000080800000000000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000000000000080 + 8000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000000000000080800000000000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000000000000080 + 8000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C00080808000808080008080 + 8000808080008080800080808000000000000080800000000000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000000000000080 + 8000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000000000000080800000000000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000000000000080 + 8000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000000000080800000000000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000000000000000 + 0000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000000000000080800000000000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C00000000000C0C0 + C000000000008080800000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C00080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00C0C0C000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000FFFFFF00C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000FFFFFF00C0C0C000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00C0C0C000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000FFFFFF00C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000FFFFFF00C0C0C000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00C0C0C000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C00080808000808080008080 + 80008080800080808000808080008080800080808000C0C0C000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + Mask.Data = { + BE000000424DBE000000000000003E0000002800000020000000200000000100 + 010000000000800000000000000000000000020000000000000000000000FFFF + FF00FFFFFFFFFFFFFFFFFFFE000FFFFC000FF000000FF000000FF000000FF000 + 000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000 + 000FF000001FF0003FFFF0003FFFF0003FFFF0003FFFF0003FFFF0003FFFF000 + 3FFFF0003FFFF0003FFFF0003FFFF0003FFFF0003FFFF0003FFFFFFFFFFFFFFF + FFFF} + end> + end + object ilNavBarSmall: TcxImageList + FormatVersion = 1 + DesignInfo = 22544432 + ImageInfo = < + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000505050E0F0F0F2E11111133111111331111113311111133111111331111 + 11331111113311111133111111330F0F0F2E0505050E00000000000000000022 + 1848016D4FEB007756FF007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF007756FF026D50EC0C2E256D0F0F0F2E0000000000000000006A + 4DE4B7D9CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFB7D9CFFF026C4FE91111113300000000000000000077 + 56FFFFFFFFFFF7F7F7FF969696FF939393FF929292FF8F8F8FFF8D8D8DFF8B8B + 8BFF8A8A8AFFECECECFFFFFFFFFF007756FF1111113300000000000000000077 + 56FFFFFFFFFFF6F6F6FFF3F3F3FFF1F1F1FFEEEEEEFFECECECFFE9E9E9FFE8E8 + E8FFE6E6E6FFE5E5E5FFFFFFFFFF007756FF1111113300000000000000000077 + 56FFFFFFFFFFF8F8F8FF9E9E9EFF9C9C9CFF999999FF979797FF959595FF9292 + 92FF909090FFE6E6E6FFFFFFFFFF007756FF1111113300000000000000000077 + 56FFFFFFFFFFF9F9F9FFF7F7F7FFF5F5F5FFF2F2F2FFF5F5F5FFFAFAFAFFFEFE + FEFFF9F9F9FFF0F0F0FFFFFFFFFF007756FF1111113300000000000000000077 + 56FFFFFFFFFFFCFCFCFFA7A7A7FFA4A4A4FFF8F8F8FFCCD5F8FF6C87EAFF234A + E0FF6C87EAFFCCD5F8FFFFFFFFFF007756FF1111113300000000000000000077 + 56FFBDDCD3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6C87EAFF153FDEFFFFFF + FFFF153FDEFF6C87EAFFEDF5F3FF007756FF1111113300000000000000000077 + 56FF007756FF007756FF007756FF085742FFF5F8F8FF234AE0FFFFFFFFFFFFFF + FFFFFFFFFFFF234AE0FFF5F8F8FF085742FF1111113300000000000000000077 + 56FF35BB9EFF35BB9EFF35BB9EFF126D56FFBAD0CAFF6C87EAFF153FDEFF153F + DEFF153FDEFF6C87EAFFBAD0CAFF065D46FF1111113300000000000000000077 + 56FF28A98BFF2CAE90FF2CAD90FF1B846AFF659689FFC6D1F4FF6C87EAFF234A + E0FF6C87EAFFC6D1F4FF659689FF04674CFF0F0F0F2E0000000000000000006C + 4EE7047D5CFF0E8969FF128D6EFF118667FF0C6951FF659689FFBAD0CAFFF5F8 + F8FFBAD0CAFF659689FF07644BFF026A4DEE0404040D0000000000000000001D + 153F005E44C9007756FF007756FF007756FF017353FF04674CFF065D46FF0857 + 42FF065D46FF04674CFF015D44D0001D153F0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000006060611121212351414143B1414143B1414143B1414143B1414 + 143B1414143B1414143B12121235060606110000000000000000000000000000 + 000000221848026D50EC007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF026E50ED0E2F2672121212350000000000000000000000000000 + 0000006A4DE4B7D9CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFB7D9CFFF026C4FEA1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFADADADFFADADADFFADADADFFADADADFFADADADFFADAD + ADFFADADADFFFFFFFFFF007756FF1414143B00000000000000000404040C0D0D + 0D270E7156FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2 + E2FFE2E2E2FFE2E2E2FF0E7156FF1E1E1E590404040C000000000D3329630D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D332963000000000D9570FF0D95 + 70FF007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF0D9570FF0D9570FF000000000D9570FF0D95 + 70FF007756FFFFFFFFFF8D968BFF8D968BFF8D968BFF8D968BFF8D968BFF8D96 + 8BFF8D968BFFFFFFFFFF007756FF0D9570FF0D9570FF000000000D9570FF0D95 + 70FF0E7156FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2 + E2FFE2E2E2FFE2E2E2FF0E7156FF0D9570FF0D9570FF0000000003251C3F0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF03251C3F00000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3 + C3FFC3C3C3FFFFFFFFFF007756FF121212350000000000000000000000000000 + 0000006C4EE7BDDCD3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFBDDCD3FF016D4FEB0505050F0000000000000000000000000000 + 0000001D153F005E44C9007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF005E44C9001D153F000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000060606121313133A1515154015151540151515401515 + 154015151540151515401313133A060606120000000000000000000000000000 + 00000000000000221848026D50EC007756FF007756FF007756FF007756FF0077 + 56FF007756FF026E50ED0F312876131313390000000000000000000000000000 + 000000000000006A4DE4B7D9CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFB7D9CFFF036D4FEB151515400000000000000000000000000000 + 000000000000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF151515400000000000000000000000001C1C + 1C543B3B3BB0555555FF555555FF555555FF9E9E9EFFFFFFFFFFFFFFFFFF9E9E + 9EFF555555FF555555FF555555FF414141C41C1C1C5400000000000000003B3B + 3BB0B9B9B9FFEEEEEEFFEEEEEEFFEEEEEEFFEEEEEEFF555555FF555555FFEEEE + EEFFEEEEEEFFEEEEEEFFEEEEEEFFADADADFF3B3B3BB000000000000000005555 + 55FFF2F2F2FFA2A2A2FF555555FF555555FF555555FF555555FF555555FF5555 + 55FF585858FF5D5D5DFF878787FFEEEEEEFF555555FF00000000000000005555 + 55FFF5F5F5FF555555FFFFFFFFFF555555FFEAEAEAFFEDEDEDFFEFEFEFFFEAEA + EAFF555555FFFFFFFFFF555555FFEEEEEEFF555555FF00000000000000005555 + 55FFF5F5F5FFBABABAFF555555FF555555FF555555FF555555FF555555FF5555 + 55FF555555FF555555FF9C9C9CFFEEEEEEFF555555FF00000000000000003B3B + 3BB0ADADADFFF4F4F4FFEEEEEEFFEEEEEEFFEDEDEDFF555555FF555555FFEEEE + EEFFEEEEEEFFEEEEEEFFEEEEEEFFADADADFF3B3B3BB000000000000000001C1C + 1C543B3B3BB0555555FF555555FF555555FF9E9E9EFFFFFFFFFFFFFFFFFF9E9E + 9EFF555555FF555555FF555555FF414141C41C1C1C5400000000000000000000 + 000000000000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1313133A0000000000000000000000000000 + 000000000000006C4EE7BDDCD3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFBDDCD3FF026D50EC050505100000000000000000000000000000 + 000000000000001D153F005E44C9007756FF007756FF007756FF007756FF0077 + 56FF007756FF005E44C9001D153F000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000022 + 1848006C4EE7007756FF007756FF007756FF007756FF007756FF007756FF0077 + 56FF006C4EE7002218480000000000000000000000000000000000000000006A + 4DE4B7D9CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFB7D9CFFF026C4FEA1414143B121212350606061100000000000000000077 + 56FFFFFFFFFF8A8A8AFF8A8A8AFF8A8A8AFF8A8A8AFF8A8A8AFF8A8A8AFF8A8A + 8AFFFFFFFFFF007756FF15795EED14332A721212123500000000000000000077 + 56FFFFFFFFFFF8F8F8FFF5F5F5FFF3F3F3FFF0F0F0FFEEEEEEFFEBEBEBFFE9E9 + E9FFFFFFFFFF007756FFBDDCD4FF16775DEA1414143B00000000000000000077 + 56FFFFFFFFFFF9F9F9FFF7F7F7FFF5F5F5FFF2F2F2FFEFEFEFFFEDEDEDFFEBEB + EBFFFFFFFFFF007756FFFFFFFFFF168365FF1414143B00000000000000000077 + 56FFFFFFFFFF8A8A8AFF8A8A8AFF8A8A8AFF8A8A8AFF8A8A8AFF8A8A8AFF8A8A + 8AFFFFFFFFFF007756FFFFFFFFFF168365FF1414143B00000000000000000077 + 56FFBDDCD3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFBDDCD3FF007756FFFFFFFFFF168365FF1414143B00000000000000000077 + 56FF007756FF007756FF007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF007756FFFFFFFFFF168365FF1414143B00000000000000000077 + 56FF35BB9EFF35BB9EFF35BB9EFF35BB9EFF35BB9EFF35BC9EFF35BC9EFF35BC + 9EFF35BB9EFF007756FFC3DFD7FF168365FF1414143B00000000000000000077 + 56FF28A98BFF2CAE90FF2CAD90FF2CAE90FF2CAE90FF2CAE90FF2CAD90FF2CAD + 90FF28A88AFF007756FF168365FF168365FF1414143B0000000000000000006C + 4EE7047D5CFF0E8969FF128D6EFF128D6DFF128D6EFF128D6EFF128D6EFF0E89 + 69FF047D5CFF067F5EFF42CDB0FF168365FF1414143B0000000000000000001D + 153F005E44C9007756FF007756FF007756FF007756FF007756FF007756FF0077 + 56FF128D6DFF3FC5A9FF52DBC1FF168365FF1212123500000000000000000000 + 00000000000014775BE7229578FF37B498FF3DBDA1FF3DBCA1FF3DBDA1FF3DBD + A1FF3DBDA1FF37B498FF229578FF15785DEB0505050F00000000000000000000 + 0000000000000520193F116750C9168365FF168365FF168365FF168365FF1683 + 65FF168365FF168365FF116750C90520193F0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000203030C0507071E080B0A2C0A0E0D370A0E + 0D37080B0A2C0507071E0203030C000000000000000000000000000000000000 + 000000000000000000000B202B47113D5C980E4777CF074680F106437DF10B43 + 71CF103B599D0F263163090C0C31040606180000000000000000000000000000 + 00000000000010364E75136192E21983B9FF24A1D1FF2DB8E5FF30B9E4FF29A0 + CFFF1B7BB0FF0E5084E310364D8A0A0E0D380406061800000000000000000000 + 00000F364F6E1978AFF625A2D4FF30C2EDFF32C3EDFFFD7E00FFFD7E00FF40C8 + F0FF44CAF1FF33A0CEFF146095F610364D8A090C0C310203030C00000000081D + 29341B6FA1DE28A7D8FF009172FF009172FF39C6EEFFFD7E00FFFD7E00FF48CB + F1FF2E3F3CFF2E3F3CFF3EA5D0FF135386E30F2631630507071E000000001344 + 6280269ACFFF35C4EDFF009172FF009172FF41C8F0FF46CAF1FF4BCCF2FF50CE + F3FF2E3F3CFF2E3F3CFF61D4F6FF2F85B6FF103C5A9D080B0A2C000000001D67 + 94C031B1E0FF3BC6EFFF40C8EFFF44C9F1FF49CBF2FF4FCEF3FF54CFF3FF5AD1 + F5FF5FD4F6FF65D6F6FF6AD8F7FF52B1D9FF0D4775CF0A0E0D37000000002482 + B9ED3CC2ECFF040BF5FF040BF5FF4DCDF2FF52CFF3FF57D1F4FF5DD3F6FF63D5 + F6FF68D7F7FF268BFFFF268BFFFF6FD1F1FF0A4D86F10A0E0D37000000002686 + BDED44C5EEFF040BF5FF040BF5FF56D0F4FF5CD3F5FF61D5F5FF66D6F6FF4DB1 + DBFF6DD6F5FF268BFFFF268BFFFF77D5F3FF0D538CF1080B0A2C00000000206D + 9AC044BBE6FF54D0F4FF5AD2F4FF5FD3F6FF65D6F6FF4DB5E0FF227EB9FF1C76 + B2FF50AED8FF7EDFFBFF82E1FBFF65BEE1FF135280CF0507071E00000000123F + 586E2F98D1FF53C6EDFF59CAEFFF3FA7D8FF2A8EC8FF227BB0EA16507397227F + BBFF7FDFFAFF85E3FDFF89E4FDFF499FCCFF144361980203030C000000000001 + 01010E32465821719EC62274A3CC1A5A7F9F1447647E02070A0C1E6D9BCA4DAD + DAFF88E3FCFF8BE5FDFF6BC3E6FF2774A2E20B212D4700000000000000000000 + 0000000000000000000000000000000000000000000002090C0F288BC7FC75D1 + F1FF8DE5FDFF6DC7EAFF3890C2F6113A52750000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000185273903297 + CEFF40A1D4FF2B7EAEDB113A526E000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000040E + 1419071A242D081C283200000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000070A09280C11 + 10430141ACFF0B2E60B61D282D8A17211F82151C1B73121817620F1413510C10 + 0F41090C0C310608082104050514000000000000000000000000000000000000 + 0000001B47696794F6FF6794F6FF5B83DAE22D416C7000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000587FD3DB6794F6FF6794F6FF0C5BCDFF0141ACFF000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000314675796794F6FF6794F6FF0B45BAFF0C5BCDFF0141ACFF0000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000121A2B2D3863F1FF0141ACFF6794F6FF0B45BAFF0C5BCDFF0141 + ACFF000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000013DA2F03863F1FF3E71EFFF6794F6FF0B45BAFF0C5B + CDFF0141ACFF0000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000141ACFF3863F1FF3E71EFFF6794F6FF0B45 + BAFF0C5BCDFF0141ACFF00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000141ACFF3863F1FF3E71EFFF6794 + F6FF0B45BAFF0C5BCDFF0141ACFF000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000141ACFF3863F1FF3E71 + EFFF6794F6FF0B45BAFFFFFFFFFF2E7857FF0000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000141ACFF3863 + F1FF3E71EFFFFFFFFFFF3C906FFF429664FF286443CF00000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000141 + ACFFFFFFFFFF69B2A5FF8FCDAEFF429664FF429664FF1535236E000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000276F65FF70BD99FF70BD99FF8FCDAEFF317B52FF00000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000286443CF70BD99FF317B52FF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000112B1D59000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end> + end + object ilLinkDesigner: TcxImageList + FormatVersion = 1 + DesignInfo = 22544400 + ImageInfo = < + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000006060611121212351414143B1414143B1414143B1414143B1414 + 143B1414143B1414143B12121235060606110000000000000000000000000000 + 000000221848026D50EC007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF026E50ED0E2F2672121212350000000000000000000000000000 + 0000006A4DE4B7D9CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFB7D9CFFF026C4FEA1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFADADADFFADADADFFADADADFFADADADFFADADADFFADAD + ADFFADADADFFFFFFFFFF007756FF1414143B00000000000000000404040C0D0D + 0D270E7156FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2 + E2FFE2E2E2FFE2E2E2FF0E7156FF1E1E1E590404040C000000000D3329630D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D332963000000000D9570FF0D95 + 70FF007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF0D9570FF0D9570FF000000000D9570FF0D95 + 70FF007756FFFFFFFFFF8D968BFF8D968BFF8D968BFF8D968BFF8D968BFF8D96 + 8BFF8D968BFFFFFFFFFF007756FF0D9570FF0D9570FF000000000D9570FF0D95 + 70FF0E7156FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2E2FFE2E2 + E2FFE2E2E2FFE2E2E2FF0E7156FF0D9570FF0D9570FF0000000003251C3F0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D9570FF0D95 + 70FF0D9570FF0D9570FF0D9570FF0D9570FF03251C3F00000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3 + C3FFC3C3C3FFFFFFFFFF007756FF121212350000000000000000000000000000 + 0000006C4EE7BDDCD3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFBDDCD3FF016D4FEB0505050F0000000000000000000000000000 + 0000001D153F005E44C9007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF005E44C9001D153F000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000505050E0F0F0F2E11111133111111331111113311111133111111331111 + 11331111113311111133111111330F0F0F2E0505050E00000000000000000022 + 1848016D4FEB007756FF007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF007756FF026D50EC0C2E256D0F0F0F2E0000000000000000006A + 4DE4B7D9CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFB7D9CFFF026C4FE91111113300000000000000000077 + 56FFFFFFFFFFF7F7F7FF969696FF939393FF929292FF8F8F8FFF8D8D8DFF8B8B + 8BFF8A8A8AFFECECECFFFFFFFFFF007756FF1111113300000000000000000077 + 56FFFFFFFFFFF6F6F6FFF3F3F3FFF1F1F1FFEEEEEEFFECECECFFE9E9E9FFE8E8 + E8FFE6E6E6FFE5E5E5FFFFFFFFFF007756FF1111113300000000000000000077 + 56FFFFFFFFFFF8F8F8FF9E9E9EFF9C9C9CFF999999FF979797FF959595FF9292 + 92FF909090FFE6E6E6FFFFFFFFFF007756FF1111113300000000000000000077 + 56FFFFFFFFFFF9F9F9FFF7F7F7FFF5F5F5FFF2F2F2FFF5F5F5FFFAFAFAFFFEFE + FEFFF9F9F9FFF0F0F0FFFFFFFFFF007756FF1111113300000000000000000077 + 56FFFFFFFFFFFCFCFCFFA7A7A7FFA4A4A4FFF8F8F8FFCCD5F8FF6C87EAFF234A + E0FF6C87EAFFCCD5F8FFFFFFFFFF007756FF1111113300000000000000000077 + 56FFBDDCD3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6C87EAFF153FDEFFFFFF + FFFF153FDEFF6C87EAFFEDF5F3FF007756FF1111113300000000000000000077 + 56FF007756FF007756FF007756FF085742FFF5F8F8FF234AE0FFFFFFFFFFFFFF + FFFFFFFFFFFF234AE0FFF5F8F8FF085742FF1111113300000000000000000077 + 56FF35BB9EFF35BB9EFF35BB9EFF126D56FFBAD0CAFF6C87EAFF153FDEFF153F + DEFF153FDEFF6C87EAFFBAD0CAFF065D46FF1111113300000000000000000077 + 56FF28A98BFF2CAE90FF2CAD90FF1B846AFF659689FFC6D1F4FF6C87EAFF234A + E0FF6C87EAFFC6D1F4FF659689FF04674CFF0F0F0F2E0000000000000000006C + 4EE7047D5CFF0E8969FF128D6EFF118667FF0C6951FF659689FFBAD0CAFFF5F8 + F8FFBAD0CAFF659689FF07644BFF026A4DEE0404040D0000000000000000001D + 153F005E44C9007756FF007756FF007756FF017353FF04674CFF065D46FF0857 + 42FF065D46FF04674CFF015D44D0001D153F0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000E0000001C00000029000000290000002900000017000000000000 + 0000000000170000002900000029000000290000001C0000000E000000001C1C + 1C543B3B3BB9555555FF555555FF555555FF313131A400000029000000293131 + 31A4555555FF555555FF555555FF3B3B3BBD1C1C1C6F0000001C000000003B3B + 3BB0B9B9B9FFEEEEEEFFEEEEEEFFEEEEEEFFEEEEEEFF555555FF555555FFEEEE + EEFFEEEEEEFFEEEEEEFFEEEEEEFFADADADFF3B3B3BBD00000029000000005555 + 55FFF2F2F2FFA2A2A2FF555555FF555555FF555555FF555555FF555555FF5555 + 55FF585858FF5D5D5DFF878787FFEEEEEEFF555555FF00000029000000005555 + 55FFF5F5F5FF555555FF00000000555555FFEAEAEAFFEDEDEDFFEFEFEFFFEAEA + EAFF555555FF00000000555555FFEEEEEEFF555555FF00000029000000005555 + 55FFF5F5F5FFBABABAFF555555FF555555FF555555FF555555FF555555FF5555 + 55FF555555FF555555FF9C9C9CFFEEEEEEFF555555FF0000001C000000003B3B + 3BB0ADADADFFF4F4F4FFEEEEEEFFEEEEEEFFEDEDEDFF555555FF555555FFEEEE + EEFFEEEEEEFFEEEEEEFFEEEEEEFFADADADFF3B3B3BB90000000E000000001C1C + 1C543B3B3BB0555555FF555555FF555555FF3131319200000000000000003131 + 3192555555FF555555FF555555FF3B3B3BB01C1C1C5400000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000FF + FF0000FFFF0000000000000000000000000000000000000000000000000000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF00000000000000000000000000000000000000000000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF000000000000000000000000000000000000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000FF + FF0000FFFF000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000FF + FF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + Mask.Data = { + 7E000000424D7E000000000000003E0000002800000010000000100000000100 + 010000000000400000000000000000000000020000000000000000000000FFFF + FF00FFFF0000FFFF0000FFFF0000FFFF0000FF3F0000FF1F0000000F00000007 + 00000003000000070000000F0000FF1F0000FF3F0000FFFF0000FFFF0000FFFF + 0000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000FF + 000000FF000000FF000000FF000000FF000000FF000000FF000000FF00000000 + 00000000000000000000000000000000000000000000000000000000000000FF + 0000000000000000000000000000000000000000000000FF000000FF000000FF + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FF000000FF000000FF + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FF000000FF000000FF + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FF000000FF000000FF + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000FF000000FF000000FF000000FF000000FF + 000000FF000000FF000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FF000000FF000000FF000000FF + 000000FF00000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FF000000FF000000FF + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FF00000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + Mask.Data = { + 7E000000424D7E000000000000003E0000002800000010000000100000000100 + 010000000000400000000000000000000000020000000000000000000000FFFF + FF00FFFF0000FFFF0000FFFF0000807F0000003F0000001F00003C1F0000FC1F + 0000F0070000F0070000F80F0000FC1F0000FE3F0000FF7F0000FFFF0000FFFF + 0000} + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000006060611121212351414143B1414143B1414143B1414143B1414 + 143B1414143B1414143B12121235060606110000000000000000000000000000 + 000000221848026D50EC007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF026E50ED0E2F2672121212350000000000000000000000000000 + 0000006A4DE4B7D9CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFB7D9CFFF026C4FEA1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFF434343FFFFFFFFFFA6A6A6FFA6A6A6FFA6A6A6FFA6A6 + A6FFA6A6A6FFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FF007756FF007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF007756FF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFF434343FFFFFFFFFFA6A6A6FFA6A6A6FFA6A6A6FFA6A6 + A6FFA6A6A6FFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FF007756FF007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF007756FF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF007756FF1414143B0000000000000000000000000000 + 0000007756FFFFFFFFFF434343FFFFFFFFFFA6A6A6FFA6A6A6FFA6A6A6FFA6A6 + A6FFA6A6A6FFFFFFFFFF007756FF121212350000000000000000000000000000 + 0000006C4EE7BDDCD3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFBDDCD3FF016D4FEB0505050F0000000000000000000000000000 + 0000001D153F005E44C9007756FF007756FF007756FF007756FF007756FF0077 + 56FF007756FF005E44C9001D153F000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000} + end> + end + object ilToolBar: TcxImageList + FormatVersion = 1 + DesignInfo = 17563805 + end + object ilTreeView: TcxImageList + FormatVersion = 1 + DesignInfo = 19923101 + end + object ilToolBarDisabled: TcxImageList + FormatVersion = 1 + DesignInfo = 17563837 + end + object pmGroupItemClasses: TPopupMenu + Images = ilActions + Left = 56 + Top = 248 + end + object ilPreviewSmall: TcxImageList + FormatVersion = 1 + DesignInfo = 22544464 + ImageInfo = < + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00C0A8900070584000705040006048300060483000604830006048 + 3000604830006048300060483000604830006048300060483000FF00FF00FF00 + FF00FF00FF00C0A89000FFF8F000F0E0E000F0D8C000E0D0C000E0C8B000E0C0 + B000E0B8A000E0B0A000D0A89000D0A09000D0A0800060483000FF00FF00FF00 + FF00FF00FF00C0A8A000FFF8FF00FFF8F000FFF8F000F0F0E000F0E8E000F0E0 + D000F0D8D000F0D8C000F0D0C000F0D0C000D0A8900060483000708890007078 + 800060707000C0A8A000FFFFFF00C0B0A000B0A09000B0989000B0988000A090 + 8000F0E0D000F0D8D000F0D8C000F0D0C000E0B0A0006048300070889000A0E0 + F00070D0F000C0B0A000FFFFFF00D0C0B000C0B0A000C0A8A000C0A89000B0A0 + 9000B0A09000F0E0D000F0D8D000F0D8C000E0B0A0006048300080889000B0E8 + F00090E8FF00C0B0A000FFFFFF00FFFFFF00FFF8FF00FFF8F000FFF8F000FFF0 + F000F0E8E000F0E8E000F0E0D000F0D8D000E0B8A000604830008090A000B0E8 + F000A0E8FF00D0B0A000FFFFFF00FFFFFF00FFFFFF00FFF8FF00FFF8FF00FFF8 + F000FFF0F000FFE8E0002048D0002040A000E0C0B000604830008090A000B0F0 + FF00B0F0FF00D0B8A000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFF8FF00FFF8 + FF00FFF8F000FFF0F0004060F0002048D000F0D0D000705040008098A000C0F0 + FF00B0F0F000D0B8A000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFF8FF00FFF8F000FFF8F000FFF0F000F0E8E000705840008098A000C0F0 + FF00B0F0FF00D0B8A000D0B8A000D0B8A000C0B0A000C0B0A000C0B0A000C0A8 + A000C0A8A000C0A8A000C0A89000C0A89000C0A89000C0A8900090A0A000C0F0 + FF00B0F0FF00B0F0FF00B0F0F000A0F0FF0090E8FF0090E0FF0080E0FF0070D0 + FF0060D0F00050C0F00050B8F0002098D00060708000FF00FF0090A0B000C0F0 + FF00C0F0FF00C0F0FF00C0F0FF00B0F0FF00B0F0FF00A0E8FF0090E8FF0090E0 + FF0080D8FF0070D0FF0070C8F00060B8F00060708000FF00FF0090A0B00090A0 + B00090A0B00090A0B00090A0B00090A0B00090A0A0009098A0008098A0008098 + A0008098A0008098A0008098A0008090A000FF00FF00FF00FF0090A8B000B0E8 + F000B0F0FF00B0F0FF00B0F0F00090E0F00090A0B000FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0090A8 + B00090A8B00090A8B00090A8B00090A8B000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF0073655700403020004030200040302000503830005038 + 300065574900FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00B19D9700E1CBB400FFF0D000FFFFE000FFF0D000FFE8C000FFD8 + A000F0D0B000735E4900FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00A0888000FFFFFF00FFF8FF00FFF8F000FFF0E000FFF0D000FFE8 + C000FFE0C00080685000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00B4ADA500F0F8E00070B860000060000000480000004800003090 + 4000F0D8B000B0907000917B7000FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00BDACA700E1DAD200D0F0D00020982000E0D0D000FFFFFF00B0C090001070 + 2000C0C89000E0B8A00065574900FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00A58F8700F0F0F000F0F8F00080D8800020982000FFFFFF00308030001070 + 1000FFE0C000F0D0B00060483000FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00B0989000FFFFFF00FFFFFF00FFFFFF0020C020000068000000601000C0E0 + A000FFF0D000FFE0B00070605000FF00FF00FF00FF00FF00FF00FF00FF00BDAC + A700C0B0B000FFFFFF00FFFFFF00FFFFFF00E0FFD00010B0100090D89000FFFF + F000FFF0D000FFE8C000A088700091877D00FF00FF00FF00FF00FF00FF00A58F + 8700E0D0D000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFF8 + E000FFF0E000FFF0D000D0B0900070635600FF00FF00FF00FF00FF00FF00A088 + 8000F0F0F000FFF8FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFF8 + F000FFF0E000FFF0E000F0D0B0005A4B3C00FF00FF00FF00FF00FF00FF00A58F + 8700A0888000A090800090888000A0908000A0908000A0908000A0908000A090 + 8000A0888000A08880007060500050403000FF00FF00FF00FF00FF00FF00C0B2 + A5008F7A730080706000B0A09000E0D8D000F0F0F000FFF8F000FFFFFF00FFFF + FF00F0F0F000D0C8C000E0D0D0007B6F6300FF00FF00FF00FF00FF00FF00FF00 + FF009F938700A4907D00C0C0C000F0F0F000FFF8FF00FFFFFF00FFFFFF00FFFF + FF00E0E0E000D0C0C00093816F00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00A7A1910096877800907870009080700090787000907870008070 + 60007058400070635600FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF005859 + 5800006000000060000000600000006000000060000000600000006000000060 + 00000060000000600000006000000060000000600000FF00FF001C201C00FFFF + FF008BD9A0000098000000980000009800000098000000980000009800000098 + 00000098000000980000009800000098000000600000FF00FF0098ACB3001C20 + 1C00808080008BD9A00081D7990077D592006CD38A0061D1830056CF7B004BCD + 730040CB6B0035C9630030C860000098000000600000FF00FF001C201C00FFFF + FF009FDDAF0095DBA7008BD9A00081D7990077D592006CD38A0061D183002025 + 2000202520002025200035C963000098000000600000FF00FF0098ACB3001C20 + 1C00808080009FDDAF0095DBA7008BD9A00081D7990077D592006CD38A0061D1 + 830056CF7B004BCD730040CB6B000098000000600000FF00FF001C201C00FFFF + FF00B4E1BD00A9DFB6009FDDAF0095DBA7008BD9A00081D7990077D592006CD3 + 8A0061D1830056CF7B004BCD73000098000000600000FF00FF0098ACB3001C20 + 1C0080808000B9E2C100AFE0BA00A4DEB2009ADCAB0090DAA40086D89C0077D5 + 92006CD38A0061D1830056CF7B000098000000600000FF00FF001C201C00FFFF + FF00BEE3C400BEE3C400B9E2C100AFE0BA00A4DEB2009ADCAB0090DAA40086D8 + 9C007CD6950072D48E0067D287000098000000600000FF00FF0098ACB3001C20 + 1C0080808000BEE3C400BEE3C400B9E2C100AFE0BA00A4DEB2009ADCAB0090DA + A40086D89C007CD6950072D48E000098000000600000FF00FF001C201C00FFFF + FF00BEE3C400BEE3C40000980000006000000060000000600000006000000060 + 00000060000086D89C007CD695000098000000600000FF00FF0098ACB3001C20 + 1C0080808000BEE3C4000098000030C860005FD0810088D89E00ACDFB700BEE3 + C4000060000090DAA40086D89C000098000000600000FF00FF001C201C00FFFF + FF00BEE3C400BEE3C4000098000030C8600030C860005FD0810088D89E009ADC + AB00006000009ADCAB0090DAA4000098000000600000FF00FF0098ACB3001C20 + 1C0080808000BEE3C40000980000009800000098000000980000009800000098 + 000000980000A4DEB2009ADCAB000098000000600000FF00FF001C201C00FFFF + FF00BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3 + C400BEE3C400B4E1BD00A9DFB6000098000000600000FF00FF0098ACB3001C20 + 1C0080808000BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3 + C400BEE3C400BEE3C400B4E1BD00A9DFB60000600000FF00FF00FF00FF000098 + 0000009800000098000000980000009800000098000000980000009800000098 + 00000098000000980000009800000098000000980000FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF0080A8C00050708000407090003068800030688000306080003058 + 7000305870003058700030587000305060003050600030486000FF00FF00FF00 + FF00FF00FF0080A8C000D0FFFF00A0E8FF0080E0F00080D8F00070D0F00070D0 + F00070C8F00070C8F00070C8F00060C8F00060C0F00030506000FF00FF00FF00 + FF00FF00FF0080A8C000C0E8F000B0F8FF0090F0FF0090F0FF0090F0FF0090F0 + FF0090F0FF0090F0FF0090F0FF0080E0FF0060B8E00030506000708890007078 + 80006070700080B0C00080B8D00090E0F00090F8FF0090F0FF0080E8FF0070E0 + FF0080E8FF0080E8FF0090F0FF0070D8F0004088B0004058600070889000A0E0 + F00070D0F00090B0C000B0E8F00060B8D00080E8FF0070E0F00050B0E00030A0 + D0003090C00070D0F00070D8F0004098C00060C0E0004058700080889000B0E8 + F00090E8FF0090B8D000D0FFFF00A0E8F00070C8F00050B0E00080D8F00080E8 + FF0080E8F00040A0C00050C0E00080E0F00070C8F000406070008090A000B0E8 + F000A0E8FF0090C0D000D0FFFF0090E8F00060B8E00080E0F000A0F8FF0090F0 + FF0090F0FF0090E8FF0050A8D00080E0F00070D0F000406070008090A000B0F0 + FF00B0F0FF0090C0D000C0F8FF0060C0E00090E0F000A0F8FF00A0F8FF00A0F8 + FF00A0F8FF0090F0FF0090E8FF0050A0C00060C0E000506870008098A000C0F0 + FF00B0F0F00090C8D000A0E0F000E0FFFF00E0FFFF00E0FFFF00E0FFFF00E0FF + FF00E0FFFF00D0FFFF00D0FFFF00B0F8FF004098C000507080008098A000C0F0 + FF00B0F0FF0090C8D00090C8D00090C8D00090C8D00090C0D00090C0D00090B8 + D00090B8C00080B0C00080B0C00080A8C00080A8C00080A8C00090A0A000C0F0 + FF00B0F0FF00B0F0FF00B0F0F000A0F0FF0090E8FF0090E0FF0080E0FF0070D0 + FF0060D0F00050C0F00050B8F0002098D00060708000FF00FF0090A0B000C0F0 + FF00C0F0FF00C0F0FF00C0F0FF00B0F0FF00B0F0FF00A0E8FF0090E8FF0090E0 + FF0080D8FF0070D0FF0070C8F00060B8F00060708000FF00FF0090A0B00090A0 + B00090A0B00090A0B00090A0B00090A0B00090A0A0009098A0008098A0008098 + A0008098A0008098A0008098A0008090A000FF00FF00FF00FF0090A8B000B0E8 + F000B0F0FF00B0F0FF00B0F0F00090E0F00090A0B000FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0090A8 + B00090A8B00090A8B00090A8B00090A8B000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00FF00 + FF0000436E0000436E0000436E0000436E0000436E0000436E0000436E000043 + 6E0000436E0000436E0000436E0000436E00FF00FF00FF00FF00FF00FF000090 + C80077D6EF000290C9000290C9000290C9000290C9000290C9000290C9000290 + C9000290C9000290C9000290C9000290C90000436E00FF00FF00FF00FF000090 + C800D0BCAF006947310069473100694731006947310069473100694731006947 + 31006947310069473100694731000290C90000436E00FF00FF00FF00FF000090 + C800CFBBAD00F5F0ED00F1EAE600EDE4DF00E9DED800E5D8D100E1D2CA00DDCC + C200DBC9BF00DBC9BF00694731000290C90000436E00FF00FF00FF00FF000090 + C800CEBAAC00FBF9F800F7F3F100CECCE4004F5CCF00D9D2DA00E7DBD500E3D5 + CD00DFCFC600DBC9BF00694731000290C90000436E00FF00FF00FF00FF000090 + C800CDB9AA00FFFFFF00FBF9F8005D6AD6000017C6005662D000EBE1DC00E7DB + D500E3D5CD00DFCFC600694731000290C90000436E00FF00FF00FF00FF000090 + C800CCB7A900FFFFFF00C4C9F200041BC700616DD700041AC700ACADDA00EBE1 + DC00E7DBD500E3D5CD00694731000290C90000436E00FF00FF00FF00FF000090 + C800CBB6A800FFFFFF006472DC00283BCF00F4F3F7008F97DF001B2ECA00DDD8 + E000EBE1DC00E7DBD500694731000290C90000436E00FF00FF00FF00FF000090 + C800CAB5A600FFFFFF00FFFFFF00FFFFFF00FFFFFF00FBF9F8006C78D9004150 + D000ECE5E200EBE1DC00694731000290C90000436E00FF00FF00FF00FF000090 + C800CAB5A600FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FBF9F8006C78 + D9005F6BD400EFE7E200694731000290C90000436E00FF00FF00FF00FF000090 + C800CAB5A600FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FBF9 + F8008890DE006F78D600694731000290C90000436E00FF00FF00FF00FF000090 + C800CAB5A600FFFFFF000060980000436E0000436E0000436E0000436E000043 + 6E0000436E00003A8100694731000290C90000436E00FF00FF00FF00FF000090 + C800CAB5A600CAB5A6000060980095E8F8006ED0EC0000436E006ED0EC004EBD + E3000B95CC0000436E00CAB5A6000290C90000436E00FF00FF00FF00FF000090 + C80095E8F80095E8F80095E8F8000060980095E8F80000436E0000436E006ED0 + EC0000436E0095E8F8008DE4F60086DFF30000436E00FF00FF00FF00FF00FF00 + FF000090C8000090C8000090C8000090C8000060980095E8F80095E8F8000043 + 6E000090C8000090C8000090C8000090C800FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000060980000609800006098000060 + 9800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00D5BFB1006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100D5BFB100F6F2 + EF00B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A2930069473100D5BFB1002A80 + 1E00136F0D00136F0D00136F0D00136F0D00136F0D00136F0D002A801E00E3D5 + CE00E0D1C900DFCFC600DCCBC100DBC9BF00B7A2930069473100D5BFB10059A8 + 5100448B2F003CA02C0032A4260032A526003D9E2C00438D2E00136F0D00E7DB + D500A1745C00A1745C00A1745C00A1745C00B7A2930069473100D5BFB10080BC + 790042952E0031A62600369B3200369E320032A727003E952C00136F0D00EAE0 + DA00E7DBD500E4D7D000E2D3CB00DFCFC600B7A2930069473100D5BFB100CFE8 + CD004CA741002D942F0071AB90006FA68E0030923100136F0D00EFE8E300EDE4 + DF00A1745C00A1745C00A1745C00A1745C00B7A2930069473100D5BFB100FFFF + FF00B9DDC2004F9DA000559BC8004E96C2004E8E8F00A8C2AA00F2ECE800EFE8 + E300EDE4DF00EAE0DA00E7DBD500E4D7D000B7A2930069473100D5BFB100FFFF + FF00A5CDE8005DAADD005CA9DD0057A4D900519ACC00A0BACA00F5F0ED00F2EC + E800EFE8E300EDE4DF00EAE0DA00E7DBD500B7A2930069473100D5BFB100ECF6 + FA006CB9DF0065B2E50065B1E5005FACDF0056A2D700689EBE00F7F4F100F5F0 + ED00F2ECE800EFE8E300EDE4DF00EAE0DA00B7A2930069473100D5BFB100E9F6 + FA005BB0D5005CA6D50065AFDF0062AFE20058A4D8003285A700FAF8F600F7F4 + F100F7A07300F7A07300F7A07300F7A07300B7A2930069473100D5BFB100F4FA + FC0078C0DD0056A0CD00569DCA00539CCA00448DBB003285A700FDFCFB00FAF8 + F600F7F4F100F5F0ED00F2ECE800EFE8E300B7A2930069473100D5BFB100FFFF + FF00CEEAF40062B5DE005DA7D5004B92BE003285A700C6DCE600FFFFFF00FDFC + FB00F7A07300F7A07300F7A07300F7A07300B7A2930069473100D5BFB100FFFF + FF00FFFFFF00CEEAF400A5CDE800A5CDE800CEEAF400FFFFFF00FFFFFF00FFFF + FF00FEFEFD00FCFAF900F9F6F400F6F2EF00F3EEEA0069473100D5BFB100D5BF + B100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BF + B100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00ABACAC006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100ABACAC00F9F6 + F400B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A2930069473100ABACAC00FCFB + F900F9F6F400F6F2EF00F3EDE900F0E8E400EDE4DF00EAE0D900E7DBD400E4D7 + CF00E1D2C900DECDC400DBC9BF00DBC9BF00B7A2930069473100ABACAC00FFFF + FF00808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000DBC9BF00B7A2930069473100ABACAC00FFFF + FF0080808000FFFFFF0080808000FFFFFF0080808000FFFFFF0080808000FFFF + FF0080808000FFFFFF0080808000DECDC400B7A2930069473100ABACAC00FFFF + FF00808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000E1D2C900B7A2930069473100ABACAC00FFFF + FF0080808000FFFFFF0080808000FFFFFF0080808000FFFFFF0080808000FFFF + FF0080808000FFFFFF0080808000E4D7CF00B7A2930069473100ABACAC00FFFF + FF00808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000E9DED700B7A2930069473100ABACAC00FFFF + FF00FFFFFF00FFFFFF0080808000FFFFFF0080808000FFFFFF0080808000FFFF + FF0080808000FFFFFF0080808000ECE2DC00B7A2930069473100ABACAC00FFFF + FF00FFFFFF00FFFFFF0080808000808080008080800080808000808080008080 + 8000808080008080800080808000EEE6E100B7A2930069473100ABACAC00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFD + FC00FBF9F700F7F4F100F4EFEC00F1EBE700B7A2930069473100CD762100CD76 + 2100CD762100CD762100CD762100CD762100CD762100CD762100CD762100CD76 + 2100CD762100CD762100CD762100CD762100CD76210069473100CD762100FBC3 + 9F00FBC39F00FBC39F00FBC39F00FBBE9800FAB38A00F8A77B00F79C6D00F693 + 5F00F6895300F57F4600F4753900F46B2D00F46B2D0069473100CD762100FBC3 + 9F00FBC39F00FBC39F00FBC39F00FBC39F00FBBE9800FAB38A00F8A77B00F79C + 6D00F6935F00F68E5900F5844C00F57A4000F470330069473100CD762100CD76 + 2100CD762100CD762100CD762100CD762100CD762100CD762100CD762100CD76 + 2100CD762100CD762100CD762100CD762100CD762100CD762100} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00BBA6970073533D0073533D0073533D0073533D0073533D007353 + 3D0073533D0073533D0073533D0073533D0073533D0073533D00FF00FF00FF00 + FF00FF00FF00BBA69700F8F3F200E5CBB900E5CBB900E5CBB900E5CBB900E5CB + B900E5CBB900E5CBB900E5CBB900E5CBB900E5CBB90073533D00FF00FF00FF00 + FF00FF00FF00BBA69700FBF9F900F8F4F300A58F8100957B6A00A7908200EADF + DA00E6DAD300E3D4CD00DFCFC600DBCAC000E5CBB90073533D00FF00FF00FF00 + FF00FF00FF00BBA69700FEFEFE00FCFAF9009C85760073533D007D604B00E5DB + D500EBE0DB00E7DAD400E3D5CE00DFD0C700E5CBB90073533D00859299000060 + 900000609000BBA69700FFFFFF00FEFEFE00D7CDC7007656410073533D00A38D + 7E00E6DCD600B5A19400E2D5CE00E3D6CF00E5CBB90073533D00859299008CF1 + F8000691CD00BBA69700FFFFFF00FFFFFF00FDFDFD00BFAFA500765641007353 + 3D007F624D0078594400987E6D00E3D6CF00E5CBB90073533D008592990092F4 + F8008CF1F800BBA69700FFFFFF00FFFFFF00FFFFFF00FEFEFE00DDD5D000A38D + 7F00876C590075554000886C5900DFD3CD00E5CBB90073533D008592990092F4 + F80092F4F800BBA69700FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFEFE00FDFC + FC00F6F3F100A8948600E5DCD700EFE8E400E5CBB90073533D008592990092F4 + F80092F4F800BBA69700FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFE + FE00FEFDFD00F7F4F200F7F3F100F3EEEB00F0E8E40073533D008592990092F4 + F80092F4F800BBA69700BBA69700BBA69700BBA69700BBA69700BBA69700BBA6 + 9700BBA69700BBA69700BBA69700BBA69700BBA69700BBA697008592990092F4 + F80092F4F80092F4F80092F4F80092F4F8008FF3F80089F0F80080EAF6007AE7 + F60074E3F5006EE0F5000691CD0000609000FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F8008FF3F80089F0F80083EC + F7007DE9F60077E5F5000691CD0000609000FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F8008FF3F80089F0 + F80083ECF7007DE9F60077E5F50000609000FF00FF00FF00FF00859299008592 + 9900859299008592990085929900859299008592990085929900859299008592 + 990085929900859299008592990085929900FF00FF00FF00FF008592990094F5 + F80094F5F80094F5F80094F5F80085929900FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592 + 9900859299008592990085929900FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00708890007078 + 8000607070005060600040505000303840002028300010202000101020001010 + 20001010200010102000101020001010200010102000FF00FF0070889000A0E0 + F00070D0F00050B8E00030B0E00030A8E00020A0D0002098C0002090C0002080 + B0002080B0001080B0002078A0002070900010202000FF00FF0080889000B0E8 + F00090E8FF0080E0FF0070D8FF0070D0F00060C8F00050C0F00040B8F00030A8 + F00030A8E0002098E0001090D0002078A00020283000FF00FF008090A000B0E8 + F000A0E8FF0090E8FF0080E0FF0070D8FF0070D0F00060C8F00050C0F00040B8 + F00030A8F00030A0E0002098E0001080B00030384000FF00FF008090A000B0F0 + FF00B0F0FF00A0E8FF0090E0FF0080E0FF0070D8FF0070D0F00060C8F00050C0 + F00040B0F00030A8F00020A0E0001080B00040405000FF00FF008098A000C0F0 + FF00B0F0F000A0F0FF00A0E8FF0090E0FF0080E0FF0070D8FF0060D0F00060C8 + F00050B8F00040B0F00030A8E0001088C00050506000FF00FF008098A000C0F0 + FF00B0F0FF00B0F0FF00A0E8FF0090E8FF0090E0FF0080E0FF0070D8FF0060D0 + F00060C8F00050B8F00030A8E0001090C00050607000FF00FF0090A0A000C0F0 + FF00B0F0FF00B0F0FF00B0F0F000A0F0FF0090E8FF0090E0FF0080E0FF0070D0 + FF0060D0F00050C0F00050B8F0002098D00060708000FF00FF0090A0B000C0F0 + FF00C0F0FF00C0F0FF00C0F0FF00B0F0FF00B0F0FF00A0E8FF0090E8FF0090E0 + FF0080D8FF0070D0FF0070C8F00060C0F00060708000FF00FF0090A0B00090A0 + B00090A0B00090A0B00090A0B00090A0B00090A0A0009098A0008098A0008098 + A0008098A0008098A0008098A0008098A000FF00FF00FF00FF0090A8B000B0E8 + F000B0F0FF00B0F0FF00B0F0F00090E0F00090A0B000FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0090A8 + B00090A8B00090A8B00090A8B00090A8B000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF007698 + DA003757BB001530A400344FAC007490C700FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF0080A8C000507890005088A0006090B00070A0C0004070D0002040 + D0001038C0001038D0001028A0001028A0004060A0006088A000FF00FF00FF00 + FF00FF00FF0080A8C000E0FFFF00B0E8FF00A0E8FF0070A8F0002050F0002048 + E0001038C000B0E8FF004070F0002050E0001028A0005070A000FF00FF00FF00 + FF00FF00FF0080B0C000C0E8F000C0F8FF00B0F8FF003070FF001048FF000048 + FF002048E0001038C000D0F8FF005080F0001030B0003050B000708890007078 + 80006070700080B0C00080C0D000A0E8F000B0F8FF001048FF001048E000C0F0 + FF001048FF002048E0001040C000C0E8FF001038E0001030B00070889000A0E0 + F00070D0F00090B8C000B0E8F00080C8E000A0F0FF002060FF002048E00070B0 + F000A0E0F0001048FF002048E0001038C0002040D0003058C00080889000B0E8 + F00090E8FF0090B8D000D0FFFF00B0F0FF0090E0F00060A0F0001048FF003058 + D00090B8FF00A0E0F0001048FF002048E0002048E0006080C0008090A000B0E8 + F000A0E8FF0090C0D000D0FFFF00A0E8F00080C8E000A0E0FF006090FF001048 + FF002048E0002048E0001048FF001050F0005088F00070A0B0008090A000B0F0 + FF00B0F0FF0090C0D000C0F8FF0070C8E000A0E8F000B0F8FF00A0E8FF006098 + FF003068FF002050FF004078FF006098F00090C8F0007098A0008098A000C0F0 + FF00B0F0F00090C8D000A0E0F000E0FFFF00E0FFFF00E0FFFF00E0FFFF00E0FF + FF00E0FFFF00E0FFFF00E0FFFF00C0F8FF0070B8D000708890008098A000C0F0 + FF00B0F0FF0090C8D00090C8D00090C8E00090C8D000A0C8D000A0C8D000A0C8 + D000A0C8D000A0C8D000A0C0D00090B8D00090B8C00090B0C00090A0A000C0F0 + FF00B0F0FF00B0F0FF00B0F0F000A0F0FF0090E8FF0090E0FF0080E0FF0080D8 + FF0070D0FF0060C8F00060C0F00030A0D00070788000FF00FF0090A0B000C0F0 + FF00C0F0FF00C0F0FF00C0F0FF00B0F0FF00B0F0FF00A0E8FF0090E8FF0090E0 + FF0080D8FF0080D8FF0070D0F00060C0F00060708000FF00FF0090A0B00090A0 + B00090A0B00090A0B00090A0B00090A0B00090A0A0009098A0008098A0008098 + A0008098A0008098A0008098A0008090A000FF00FF00FF00FF0090A8B000B0E8 + F000B0F0FF00B0F0FF00B0F0F00090E0F00090A0B000FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0090A8 + B00090A8B00090A8B00090A8B00090A8B000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00C0989000C090 + 9000C0888000B0808000B0787000A0707000A0686000A0686000A0686000A068 + 6000A0686000A0686000A0606000A0606000A0606000A0606000C0989000F0D8 + C000FFFFF000FFF0D000FFE0B000FFD8A000FFC89000FFC89000FFC09000FFB8 + 8000FFB88000FFA87000FFA87000F0A06000D0805000A0606000D0989000D0A8 + A000E0D0C000FFFFF000FFF8E000FFF0D000FFE8D000FFE8C000FFE0C000FFD8 + B000FFD8B000FFD0A000FFC89000D0987000C0706000A0686000D0A09000FFFF + F000D0B0A000E0D0C000FFF8F000FFF8F000FFF8F000FFF0E000FFF0E000FFE8 + C000FFE0C000FFD8B000E0A88000C0807000FFB87000A0686000D0A0A000FFFF + FF00FFFFF000D0A09000E0C8C000FFF8F000FFF8F000FFF8F000FFF0E000FFF0 + D000F0E0C000D0A88000C0787000FFD8A000FFD09000A0687000D0A0A000FFFF + FF00F0D8D000E0C0B000E0C0B000E0C0B000E0C8C000E0C8B000E0C0B000E0C0 + B000D0B0A000D0A8A000D0989000E0B09000FFD8A000A0707000D0A8A000F0D0 + C000E0B8B000F0F0F000F0F0F000E0B8A000E0B8A000D0B0A000D0B0A000D0A8 + A000D0A8A000F0E8E000F0E0D000C0989000E0A88000A0787000D0A8A000C0B8 + B000F0F0F000FFF8F000F0E0E000F0F0F000F0F0F000F0F0F000F0F0E000F0F0 + E000F0F0E000F0E0D000FFF0E000F0D8D000A0909000A0787000D0A8A000A0D8 + F000FFFFF000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFF000FFF8 + F000FFF8F000FFF0F000F0F0F000E0E0E00050B0E000A0787000D0A8A000A0E8 + FF00B0E0FF00B0E0FF00A0D8FF0080D0FF0060D0FF0060C8FF0060C8FF0050C8 + FF0050C0F00040B8F00040B0F00030B0F00020B0FF00C0989000FF00FF00D0B8 + C000C0F0FF00D0F8FF00D0F0FF00D0E8FF00B0E8FF00A0E0FF0080D0FF0070C8 + FF0050C8FF0070C8FF0060C8FF0040B8FF00A0B0C000FF00FF00FF00FF00FF00 + FF00D0B8B000D0E0E000D0F8FF00D0F0FF00D0E8FF00B0E8FF00A0E0FF0080D0 + FF0070C8FF0050C8FF0090C0E000B0A8B000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00D6B5A300D0B8B000E0F8FF00E0F8FF00D0F0FF00B0E0FF0090E0 + FF0070D0FF00C0B0B000C4A89A00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00E1BBAA00D0B0A000E0E0E000D0F8FF00C0F0FF00B0C8 + D000D0B8B000DDB39D00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00D9B2A500D0B0A000D0B0A000D0AF + 9C00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF006C8C + 9C00293643002936430029364300293643002936430029364300293643002936 + 43002936430029364300293643002936430029364300293643006C8C9C00335D + 7100335D7100335D7100335D7100335D7100335D7100335D7100335D7100335D + 7100335D71005CCAE10077DEEB0085E9F00098F8F800293643006C8C9C0090F2 + F50053A3B70053A3B70053A3B70053A3B70053A3B70053A3B70053A3B70053A3 + B70053A3B700335D71005CCAE10077DEEB0085E9F000293643006C8C9C0098F8 + F80090F2F50088EBF20080E5EF0078DFEB0070D9E80068D3E50061CEE30059C8 + E00053A3B7005CCAE100335D71005CCAE10077DEEB00293643006C8C9C0098F8 + F80098F8F80090F2F50088EBF20080E5EF0078DFEB0070D9E80068D3E50061CE + E30053A3B70098F8F8005CCAE100335D71005CCAE100293643006C8C9C0098F8 + F80098F8F80098F8F80090F2F50088EBF20080E5EF0078DFEB0070D9E80068D3 + E50053A3B70053A3B70053A3B70053A3B700335D7100293643006C8C9C0098F8 + F80098F8F80098F8F80098F8F80094F5F70088EBF20080E5EF0078DFEB0070D9 + E80068D3E50061CEE30059C8E00053A3B700335D7100293643006C8C9C0098F8 + F80098F8F80098F8F80098F8F80098F8F80094F5F7008CEFF40084E8F0007CE2 + ED0074DCEA0068D3E50061CEE30053A3B700335D7100293643006C8C9C0098F8 + F80098F8F80098F8F80098F8F80098F8F80098F8F80094F5F7008CEFF40084E8 + F0007CE2ED0074DCEA006CD6E70053A3B700335D7100293643006C8C9C0098F8 + F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80094F5F7008CEF + F40084E8F0007CE2ED0074DCEA0053A3B700335D7100293643006C8C9C0098F8 + F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80094F5 + F7008CEFF40084E8F0007CE2ED0074DCEA00335D71006C8C9C006C8C9C006C8C + 9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C + 9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C9C00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end> + end + object ilPreviewLarge: TcxImageList + Height = 28 + Width = 28 + FormatVersion = 1 + DesignInfo = 19398736 + ImageInfo = < + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00BBA6 + 970073533D0073533D0073533D0073533D0073533D0073533D0073533D007353 + 3D0073533D0073533D0073533D0073533D0073533D0073533D0073533D007353 + 3D0073533D0073533D00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00BBA69700F7F3F100BBA69700BBA69700BBA6 + 9700BBA69700BBA69700BBA69700BBA69700BBA69700BBA69700BBA69700BBA6 + 9700BBA69700BBA69700BBA69700BBA69700BBA6970073533D00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00BBA6 + 9700FAF7F500F7F3F200F5F0ED00ECE4E000E7DDD800E5DAD400E3D7D100E7DC + D600E8DCD600E5D8D200E3D5CD00E0D1C900DECEC500DCCAC000DBC9BF00DBC9 + BF00BBA6970073533D00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00BBA69700FCFAFA00FAF7F600F7F4F200AA96 + 8900866956008569560085685500C4B3A800EAE0DA00E8DCD600E6D8D200E3D5 + CE00E0D2CA00DECEC500DCCAC100DBC9BF00BBA6970073533D00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00BBA6 + 9700FEFDFD00FCFAFA00FAF7F600AC998C0073533D0073533D0073533D00AF9B + 8E00ECE3DE00EAE0DB00E8DCD600E6D8D200E3D5CE00E0D2CA00DECEC500DCCB + C100BBA6970073533D00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00BBA69700FEFEFE00FEFEFE00FCFBFB00D0C4 + BC0074543E0073533D0073533D00896E5B00E8DFDA00EDE4DF00EAE0DB00E6DB + D500E6D9D200E3D6CE00E1D2CA00DECEC500BBA6970073533D00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00BBA6 + 9700FFFFFF00FFFFFF00FEFEFE00F7F4F3008A705D0073533D0073533D007353 + 3D00B3A09300EBE2DE00E8DED800B29E9100E1D4CD00E6D9D300E3D6CF00E1D2 + CB00BBA6970073533D00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00BBA69700FFFFFF00FFFFFF00FFFFFF00FEFE + FE00D6CCC6007A5C470073533D0073533D0075564000A38D7E00C3B3A8008467 + 53009D847400E2D6CF00E6D9D300E3D6CF00BBA6970073533D00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00BBA6 + 9700FFFFFF00FFFFFF00FFFFFF00FFFFFF00FDFCFC00C8BBB3007C5E4A007353 + 3D0073533D0073533D0075553F0073543E0073533E009E867600E2D6CF00E6DA + D300BBA6970073533D0085929900006090000060900000609000006090000060 + 9000006090000060900000609000BBA69700FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FDFDFD00DBD3CE00957D6C007656410073533D0073533D007353 + 3D0073533D007B5D4800CFC0B700E9DED800BBA6970073533D00859299008BF0 + F7000691CD000691CD000691CD000691CD000691CD000691CD000691CD00BBA6 + 9700FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFEFE00FBF9 + F900DED6D000BDADA300A69183007A5B47007A5C4700C7B8AE00EDE4E000EBE1 + DC00BBA6970073533D00859299008BF0F70087EEF70083ECF7007FEAF6007CE8 + F60078E6F50074E4F50071E2F500BBA69700FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FEFEFE00FDFCFC00FBF9F800F2EEEC009279 + 6800C8BAB100F2EBE800F0E8E400EDE5E000BBA6970073533D00859299008EF2 + F8008BF0F70087EEF70083ECF7007FEAF6007CE8F60078E6F50074E4F500BBA6 + 9700FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FEFEFE00FEFDFD00F8F5F400DDD4CF00F5F1EF00F4EFEC00F2ECE800F0E8 + E400BBA6970073533D008592990092F4F8008EF2F8008BF0F70087EEF70083EC + F7007FEAF6007CE8F60078E6F500BBA69700FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFEFE00FEFDFD00FCF9 + F900F9F6F500F7F3F100F5EFED00F3ECE900F0E9E50073533D008592990092F4 + F80092F4F8008EF2F8008BF0F70087EEF70083ECF7007FEAF6007CE8F600BBA6 + 9700BBA69700BBA69700BBA69700BBA69700BBA69700BBA69700BBA69700BBA6 + 9700BBA69700BBA69700BBA69700BBA69700BBA69700BBA69700BBA69700BBA6 + 9700BBA69700BBA697008592990092F4F80092F4F80092F4F8008EF2F8008BF0 + F70087EEF70083ECF7007FEAF6007CE8F60078E6F50074E4F50071E2F5006DE0 + F5006ADDF40066DBF40062D9F4005ED7F4005AD5F30056D3F3000691CD000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80090F3F8008DF1F80089EFF70083ECF7007FEA + F6007CE8F60078E6F50074E4F50071E2F5006DE0F5006ADDF40066DBF40062D9 + F4005ED7F4005AD5F3000691CD0000609000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80090F3F8008DF1F80089EFF70085EDF70081EBF6007EE9F6007AE7F60076E5 + F50072E3F5006FE1F5006CDFF50068DCF40064DAF40060D8F4000691CD000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80090F3F8008DF1F80089EF + F70085EDF70081EBF6007EE9F6007AE7F60076E5F50072E3F5006FE1F5006CDF + F50068DCF40064DAF4000691CD0000609000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80092F4F80090F3F8008DF1F80089EFF70085EDF70081EBF6007EE9 + F6007AE7F60076E5F50072E3F5006FE1F5006CDFF50068DCF4000691CD000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80090F3 + F8008DF1F80089EFF70085EDF70081EBF6007EE9F6007AE7F60076E5F50072E3 + F5006FE1F5006CDFF5000691CD0000609000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80092F4F80092F4F80092F4F80090F3F8008DF1F80089EFF70085ED + F70081EBF6007EE9F6007AE7F60076E5F50072E3F5006FE1F5000691CD000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80090F3F8008DF1F80089EFF70085EDF70081EBF6007EE9F6007AE7 + F60076E5F50072E3F5000691CD0000609000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F8008EF2 + F8008BF0F70087EEF70083ECF7007EE9F6007AE7F60072E3F50072E3F5000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00859299008592 + 9900859299008592990085929900859299008592990085929900859299008592 + 9900859299008592990085929900859299008592990085929900859299008592 + 990085929900859299008592990085929900FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990095F6F80092F4F80091F2F80090F1F8008EF0 + F8008DEFF80090F1F80079CADE0085929900FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990084DB + E80094F5F80092F4F80091F2F80090F1F80090F1F80079CADE0085929900FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00859299008592990085929900859299008592 + 99008592990085929900FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF009C9288004D3D2F004D3D2F004D3D2F004D3D2F004D3D2F004D3D + 2F004D3D2F004D3D2F004D3D2F004D3D2F0073605100FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0096867800ECD9C800ECD7 + C500EBD5C200EBD4BF00EBD2BB00EBD0B800EACEB500EACDB200EACBAE00E9C9 + AB00AD9178008D796A00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00A49B9100BEAD9F00F9E8D900F9E6D600F9E4D200F8E2CF00F8E0CB00F8DE + C700F7DCC400F7DBC000F7D8BC00F7D7B900DCBDA0006D605500FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF0096867800DCCEC100FAEADD00F9E8 + D900F9E6D600F9E4D200DBCDB700CCBAA800D9C3AF00EDD3BC00F7DAC000F7D9 + BD00F3D3B6004E3E2F00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF008D7B6E00F0E3D900FAECE100EEE0D300BDB2A600E5D4C4008CA67D003366 + 3200255A2500656A5200D1BBA500F5D9BF00F7D9BD00A18872008D796A00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00AEA09300E5E1D600769B77003A85 + 480026813800A5A09100468B4B00116F1F000E6518002459240034592C008F84 + 7100F2D6BC00D9BDA4006D605500FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00A49B + 9100CBC0B70088C7940023A24400209A3E001E9138006D7F67004E9855001477 + 250016702200376B3600125F16001A53190076715D00EBCFB50052413200FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF0096867800DCDED3003EB5600026AC4C0023A4 + 46002A9D4600789E7800EDE5D50068A56A00B4B19D00B0BB9A000E6618000B5D + 1200155315009C917C00937D6A008D796A00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008D7B + 6E00D6EAD90036B65D0041AF600089C59400D2DDC800F5EBE100FAEDE100F2E7 + D900EEE2D10085AB7D00127020000F671A00145E1900ADA48D00C4AD98006658 + 4C00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00A49B9100BBB0A700BAE6C6002FC65F00418E5800ABAB + A500D6D3CB00FBF1EA00FAEFE600FAEDE200F8EADD00539A5A00157927001270 + 200026682A00D8C6B300E9D2BC0057453600FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0096867800D9D2 + CC00A1E1B40030C8600030C45F0039A75A00ABB0A600FBF3ED00FBF1E900FBEF + E600F5EADE0090BC8D00459650001A7C2B0054805100EEDAC800F7E0CC00836F + 5E008D796A00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008D7B6E00F0EBE900BCE9C80033C8620030C8600033C2 + 6000C0BDBA00E6E1DD00F7EFE900FBF1EA00F4E9E000D6CEC30098A38C00B2AD + 9E00E0D9C400F8E5D400F9E4D100BAA593006D605500FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00A99B9000FBF7 + F600F8F8F50063CD840035C7630061C37F00C2CEC30056AA6E009A999400F8F0 + EA00ACCAAB0037984E0022943D003C714400BEB1A600F9E7D800F9E5D400E8D3 + C1004E3E2F00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00A49B9100C8BEB700FDFAF900F8F8F500D8ECDC00F6F6F300DAE6 + DB0048C26E002FC75F00389E5700989C9400CCDFC9002AA84C00229F42002B8F + 42009DAE9300F4E5D700F9E8D900F7E0CC00736051008D796A00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0096867800E7E1DD00FDFA + F900FDFAF900FDFAF900FDFAF900B4E5C10031C8600030C860002FC75F00399C + 570070A37C0028B04F0024A74800508F5D00F9EDE200FAECE000F9EADC00F9E8 + D900A79586006D605500FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF008D7B6E00FAF7F600FDFAF900FDFAF900FDFAF900FDFAF900FDFA + F900B4E6C2003DCA6A0030C760004DB96F004BB56B0039BB5F005EBD7600CBD7 + C400FBF0E700FAEEE400FAECE000FAEADD00D7C6B8004E3E2F00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00ACA39900B4A99F00FDFAF900FDFA + F900FDFAF900FDFAF900FDFAF900FDFAF900FCF9F800DDF1E100C3E8CC00CEE5 + D300D5ECDA00EBF1E800F9F4F000FBF4EE00FBF2EB00FBF0E700FAEEE400FAEC + E000F1E1D40065544600A49B9100FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF0096897B00C3BAB300E7E1DE00E7E1DE00E7E1DE00E7E1DE00E7E1DE00E7E1 + DE00E7E1DE00E7E1DE00E7E1DE00E7E1DE00E7E1DE00E7E1DE00E6E0DD00E6DF + DA00E6DDD600E5DCD400E4DAD000E4D9CE00E2D5C9006D5C4F00918A8400FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00948376008D7B6E008F7D6E008F7D + 6E008F7D6E00907E7100A89C9100A89B8F00A89B8F00ADA09700AB9D9300A99B + 9000A7998D00A5978A00A3958700A19184009F8F82009D8C7F00988679009382 + 75008E7E70005E4B3D00A49B9100FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00A49B9100918173008D796A008D796A008D796A009F908500F9F8F800F5F2 + F200EFEBE900E9E3E100E3DCD800DDD4D000D7CDC700D1C6BF00CBBEB600C4B7 + AE00BEAEA500AE9E9300A59387009E8C8000928073005F4E4000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00A49B91008C796A008D79 + 6A008D796A00AFA39800FBFAFA00FAF9F900F4F2F100EFEBE900E8E3E000E3DC + D800DCD4D000D7CDC800D1C6BF00CBBFB700C5B7AE00B8A99F00AC9A8F00A593 + 87007A6A5D00918A8400FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00948376008C786A008D796A00BFB6AE00FCFBFB00FCFB + FB00FBF9F900F6F3F300F0EBEA00E9E4E200E3DDD900DDD5D100D7CEC800D2C7 + C000CBBFB700C2B4AC00B3A39800A593880066574B00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00A49B91009483 + 76008C786900CDC5C000FCFBFB00FCFBFB00FCFBFB00FBF9F900F5F3F300F0EC + EB00E9E4E200E4DEDA00DDD6D100D8CFC900D2C7C000CBBFB700BAA99F007E6E + 6200A49B9100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00A49B91008A786A00D9D4CF00FCFBFB00FCFB + FB00FCFBFB00FCFBFB00FBF9F900F7F4F400F0ECEB00EAE5E300E4DEDA00DED6 + D200D8CFC900D3C8C100AB9C92006D605500FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00A49B910094837600BFB4AC00BFB4AC00BFB4AC00BFB4AC00BFB4AC00BFB4 + AC00BFB4AC00BFB4AC00BFB4AC00BFB4AC00BFB4AC00BFB4AC0078685C00A49B + 9100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00A49B9100948376009483 + 7600948376009483760094837600948376009483760094837600948376009483 + 76009483760094837600A49B9100FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF002025200020252000006000000060 + 0000006000000060000000600000006000000060000000600000006000000060 + 0000006000000060000000600000006000000060000000600000006000000060 + 0000006000000060000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF007070700020252000009800000098000000980000009800000098 + 0000009800000098000000980000009800000098000000980000009800000098 + 000000980000009800000098000000980000009800000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF0091939500202520002025200089D89E0083D7 + 9A007DD6960077D5920072D48E006CD3890066D2850060D181005AD07D0054CE + 79004ECD740048CC700042CB6C003CCA680036C9640030C8600030C8600030C8 + 600030C860000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF00707070002025200089D89E0083D79A007DD6960077D5920072D4 + 8E006CD3890066D2850060D181005AD07D0054CE79004ECD740048CC700042CB + 6C003CCA680036C9640030C8600030C8600030C860000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF0091939500202520002025200095DBA6008FD9 + A20089D89E0083D79A007DD6960077D5920072D48E006CD3890066D2850060D1 + 81005AD07D0054CE790020252000202520002025200020252000202520002025 + 200030C860000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF00707070002025200095DBA6008FD9A20089D89E0083D79A007DD6 + 960077D5920072D48E006CD3890066D2850060D181005AD07D0054CE79004ECD + 740048CC700042CB6C003CCA680036C9640030C860000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF00919395002025200020252000A4DEB1009EDD + AD0098DBA90092DAA40089D89E0083D79A007DD6960077D5920072D48E006CD3 + 890066D2850060D181005AD07D0054CE79004ECD740048CC700042CB6C003CCA + 680036C964000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF007070700020252000A4DEB1009EDDAD0098DBA90092DAA4008CD9 + A00086D89C0080D698007AD5940075D590006FD48C0069D2870063D183005DD0 + 7F0057CF7B0051CE770048CC700042CB6C003CCA68000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF00919395002025200020252000B0E0B900AADF + B500A4DEB1009EDDAD0098DBA90092DAA4008CD9A00086D89C0080D698007AD5 + 940075D590006FD48C0069D2870063D183005DD07F0057CF7B0051CE77004BCD + 720045CC6E000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF007070700020252000B0E0B900AADFB500A4DEB1009EDDAD0098DB + A90092DAA4008CD9A00086D89C0080D698007AD5940075D590006FD48C0069D2 + 870063D183005DD07F0057CF7B0051CE77004BCD72000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF00919395002025200020252000BCE3C200B6E2 + BE00B0E0B900AADFB500A4DEB1009EDDAD0098DBA90092DAA4008CD9A00086D8 + 9C0080D698007AD5940075D590006FD48C0069D2870063D183005DD07F0057CF + 7B0051CE77000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF007070700020252000BCE3C200B6E2BE00B0E0B900AADFB500A4DE + B1009EDDAD0098DBA90092DAA4008CD9A00086D89C0080D698007AD5940075D5 + 90006FD48C0069D2870063D183005DD07F0057CF7B000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF00919395002025200020252000BEE3C400BEE3 + C400BCE3C200B6E2BE00B0E0B900AADFB500A4DEB1009EDDAD0098DBA90092DA + A4008CD9A00086D89C0080D698007AD5940075D590006FD48C0069D2870063D1 + 83005DD07F000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF007070700020252000BEE3C400BEE3C400BEE3C400B9E2C000B3E1 + BB00ADE0B700A7DEB300A1DDAF009BDCAB0095DBA6008FD9A20086D89C0080D6 + 98007AD5940075D590006FD48C0069D2870063D183000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF00919395002025200020252000BEE3C400BEE3 + C400BEE3C400BEE3C400BEE3C400B9E2C000B3E1BB00ADE0B700A7DEB300A1DD + AF009BDCAB0095DBA6008FD9A20089D89E0083D79A007DD6960077D5920072D4 + 8E006CD389000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF007070700020252000BEE3C400BEE3C400BEE3C400BEE3C400BEE3 + C400B9E2C000B3E1BB00ADE0B700A7DEB300A1DDAF009BDCAB0095DBA6008FD9 + A20089D89E0083D79A007DD6960077D5920072D48E000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF00919395002025200020252000BEE3C400BEE3 + C400BEE3C4000098000000600000006000000060000000600000006000000060 + 000000600000006000000060000000600000006000000060000083D79A007DD6 + 960077D592000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF007070700020252000BEE3C400BEE3C4000098000038C966004ACC + 72005CD07F006ED38B007CD6960088D89E0094DAA600A0DDAF00ACDFB700B8E1 + BF00BEE3C4000060000089D89E0083D79A007DD696000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF00919395002025200020252000BEE3C400BEE3 + C400BEE3C4000098000030C8600038C966004ACC72005CD07F006ED38B007CD6 + 960088D89E0094DAA600A0DDAF00ACDFB700B8E1BF00006000008FD9A20089D8 + 9E0083D79A000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF007070700020252000BEE3C400BEE3C4000098000030C8600030C8 + 600038C966004ACC72005CD07F006ED38B007CD6960088D89E0094DAA600A0DD + AF00ACDFB7000060000095DBA6008FD9A20089D89E000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF00919395002025200020252000BEE3C400BEE3 + C400BEE3C4000098000030C8600030C8600030C8600038C966004ACC72005CD0 + 7F006ED38B007CD6960088D89E0094DAA600A0DDAF00006000009EDDAD0098DB + A90092DAA4000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF007070700020252000BEE3C400BEE3C4000098000030C8600030C8 + 600030C8600030C8600038C966004ACC72005CD07F006ED38B007CD6960088D8 + 9E0094DAA60000600000A4DEB1009EDDAD0098DBA9000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF00919395002025200020252000BEE3C400BEE3 + C400BEE3C4000098000000980000009800000098000000980000009800000098 + 0000069A06000C9C0C00129F120018A119001EA31F0000980000AADFB500A4DE + B1009EDDAD000098000000600000FF00FF00FF00FF00FF00FF00FF00FF002025 + 2000FFFFFF007070700020252000BEE3C400BEE3C400BEE3C400BEE3C400BEE3 + C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3 + C400BCE3C200B6E2BE00B0E0B900AADFB500A4DEB1000098000000600000FF00 + FF00FF00FF00FF00FF00FF00FF00919395002025200000980000BEE3C400BEE3 + C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3 + C400BEE3C400BEE3C400BEE3C400BEE3C400BEE3C400BCE3C200B6E2BE00B0E0 + B900AADFB500A4DEB10000600000FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF000098000000980000009800000098000000980000009800000098 + 0000009800000098000000980000009800000098000000980000009800000098 + 000000980000009800000098000000980000009800000098000000980000FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00C6B0A30069473100694731006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 31006947310069473100694731006947310069473100FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00CFB9AB00FAF8F700B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 930069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00CFB9AB00FDFBFB00FAF8F700F8F4F300F6F1EF00F3EEEB00F1EA + E700EFE7E300EDE4DF00EBE0DB00E8DDD700E6D9D300E4D6CF00E1D3CB00DFCF + C700DDCCC300DBC9BF00DBC9BF00B7A2930069473100FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00CFB9AB00FFFFFF00FDFB + FB00FAF8F700F8F4F300F6F1EF00F3EEEB00F1EAE700EFE7E300EDE4DF00EBE0 + DB00E8DDD700E6D9D300E4D6CF00E1D3CB00DFCFC700DDCCC300DBC9BF00B7A2 + 930069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00CFB9AB00FFFFFF00FFFFFF00FDFBFB00FAF8F700F3AB5900F3AB + 5900F3AB5900F3AB5900F3AB5900F3AB5900F3AB5900F3AB5900E6D9D300E4D6 + CF00E1D3CB00DFCFC700DDCCC300B7A2930069473100FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00CFB9AB00FFFFFF00FFFF + FF00FFFFFF00FDFBFB00FAF8F700F8F4F300F6F1EF00F3EEEB00F1EAE700EFE7 + E300EDE4DF00EBE0DB00E8DDD700E6D9D300E4D6CF00E1D3CB00DFCFC700B7A2 + 930069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00CFB9AB00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FDFBFB00FAF8 + F700F8F4F300F6F1EF00F3EEEB00F1EAE700EFE7E300EDE4DF00EBE0DB00E8DD + D700E6D9D300E4D6CF00E1D3CB00B7A2930069473100FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00CFB9AB00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00F3AB5900F3AB5900F3AB5900F3AB5900F3AB5900F3AB + 5900F3AB5900F3AB5900EDE4DF00EBE0DB00E8DDD700E6D9D300E4D6CF00B7A2 + 930069473100FF00FF0085929900006090000060900000609000006090000060 + 900000609000CFB9AB00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FEFDFD00FCFAF900F9F6F500F7F3F100F5EFED00F2ECE900F0E9E500EEE5 + E100ECE2DD00EADFD900E7DBD500B7A2930069473100FF00FF00859299008BF0 + F7000691CD000691CD000691CD000691CD000691CD00CFB9AB00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFDFD00FCFAF900F9F6 + F500F7F3F100F5EFED00F2ECE900316ADC00316ADC00316ADC00EADFD900B7A2 + 930069473100FF00FF00859299008BF0F70087EEF70083ECF7007FEAF6007CE8 + F60078E6F500CFB9AB00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FEFDFD00FCFAF900F9F6F500F7F3F100F5EFED00314A + 800060A2FA00316ADC00ECE2DD00B7A2930069473100FF00FF00859299008EF2 + F8008BF0F70087EEF70083ECF7007FEAF6007CE8F600CFB9AB00FFFFFF004878 + F8004878F8004878F800FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFD + FD00FCFAF900F9F6F500F7F3F100396EE30060A2FA00316ADC00EEE5E100B7A2 + 930069473100FF00FF008592990092F4F8008EF2F8008BF0F70087EEF70083EC + F7007FEAF600CFB9AB00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFDFD00FCFAF900F9F6F500F7F3 + F100F5EFED00F2ECE900F0E9E500EEE5E10069473100FF00FF008592990092F4 + F80092F4F8008EF2F8008BF0F70087EEF70083ECF700CFB9AB00CFB9AB00CFB9 + AB00CFB9AB00CFB9AB00CFB9AB00CFB9AB00CFB9AB00CFB9AB00CFB9AB00CFB9 + AB00CFB9AB00CFB9AB00CFB9AB00CFB9AB00CFB9AB00CFB9AB00CFB9AB00CFB9 + AB00CFB9AB00FF00FF008592990092F4F80092F4F80092F4F8008EF2F8008BF0 + F70087EEF70083ECF7007FEAF6007CE8F60078E6F50074E4F50071E2F5006DE0 + F5006ADDF40066DBF40062D9F4005ED7F4005AD5F30056D3F3000691CD000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80090F3F8008DF1F80089EFF70083ECF7007FEA + F6007CE8F60078E6F50074E4F50071E2F5006DE0F5006ADDF40066DBF40062D9 + F4005ED7F4005AD5F3000691CD0000609000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80090F3F8008DF1F80089EFF70085EDF70081EBF6007EE9F6007AE7F60076E5 + F50072E3F5006FE1F5006CDFF50068DCF40064DAF40060D8F4000691CD000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80090F3F8008DF1F80089EF + F70085EDF70081EBF6007EE9F6007AE7F60076E5F50072E3F5006FE1F5006CDF + F50068DCF40064DAF4000691CD0000609000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80092F4F80090F3F8008DF1F80089EFF70085EDF70081EBF6007EE9 + F6007AE7F60076E5F50072E3F5006FE1F5006CDFF50068DCF4000691CD000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80090F3 + F8008DF1F80089EFF70085EDF70081EBF6007EE9F6007AE7F60076E5F50072E3 + F5006FE1F5006CDFF5000691CD0000609000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80092F4F80092F4F80092F4F80090F3F8008DF1F80089EFF70085ED + F70081EBF6007EE9F6007AE7F60076E5F50072E3F5006FE1F5000691CD000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80090F3F8008DF1F80089EFF70085EDF70081EBF6007EE9F6007AE7 + F60076E5F50072E3F5000691CD0000609000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F8008EF2 + F8008BF0F70087EEF70083ECF7007EE9F6007AE7F60072E3F50072E3F5000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00859299008592 + 9900859299008592990085929900859299008592990085929900859299008592 + 9900859299008592990085929900859299008592990085929900859299008592 + 990085929900859299008592990085929900FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990095F6F80092F4F80091F2F80090F1F8008EF0 + F8008DEFF80090F1F80079CADE0085929900FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990084DB + E80094F5F80092F4F80091F2F80090F1F80090F1F80079CADE0085929900FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00859299008592990085929900859299008592 + 99008592990085929900FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00C7B2A3006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 31006947310069473100694731006947310069473100FF00FF00FF00FF00C7B2 + A300DBC9BF00B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 930069473100FF00FF00FF00FF00C7B2A300B7A29300DFD0C700DFD0C700DFD0 + C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0 + C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0 + C700DFD0C700DFD0C700DFD0C700CE99970069473100FF00FF00FF00FF00C7B2 + A300DBC9BF00B7A29300E4D7CF00E4D7CF00E4D7CF00E4D7CF00E4D7CF00E4D7 + CF00E4D7CF00E4D7CF00E4D7CF00E4D7CF00E4D7CF00E4D7CF00E4D7CF00E4D7 + CF00E4D7CF00E4D7CF00E4D7CF00E4D7CF00E4D7CF00E4D7CF00B7A29300B7A2 + 930069473100FF00FF00FF00FF00C7B2A300DECEC500DECEC500B7A29300E9DE + D700E9DED700E9DED700E9DED700E9DED700E9DED700E9DED700E9DED700E9DE + D700E9DED700E9DED700E9DED700E9DED700E9DED700E9DED700E9DED700E9DE + D700E9DED700B7A29300DECEC500B7A2930069473100FF00FF00FF00FF00C7B2 + A300E2D4CC00E2D4CC00E2D4CC00B7A29300EDE4DF00EDE4DF00EDE4DF00EDE4 + DF00EDE4DF00EDE4DF00EDE4DF00EDE4DF00EDE4DF00EDE4DF00EDE4DF00EDE4 + DF00EDE4DF00EDE4DF00EDE4DF00EDE4DF00B7A29300E2D4CC00E2D4CC00B7A2 + 930069473100FF00FF00FF00FF00C7B2A300E6D9D200E6D9D200E6D9D200E6D9 + D200B7A29300F0E9E500F0E9E500F0E9E500F0E9E500F0E9E500F0E9E500F0E9 + E500F0E9E500F0E9E500F0E9E500F0E9E500F0E9E500F0E9E500F0E9E500B7A2 + 9300E6D9D200E6D9D200E6D9D200B7A2930069473100FF00FF00FF00FF00C7B2 + A300EADFD900EADFD900EADFD900EADFD900EADFD900B7A29300F4EFEC00F4EF + EC00F4EFEC00F4EFEC00F4EFEC00F4EFEC00F4EFEC00F4EFEC00F4EFEC00F4EF + EC00F4EFEC00F4EFEC00B7A29300EADFD900EADFD900EADFD900EADFD900B7A2 + 930069473100FF00FF00FF00FF00C7B2A300EDE4DF00EDE4DF00EDE4DF00EDE4 + DF00EDE4DF00EDE4DF00B7A29300F8F4F200F8F4F200F8F4F200F8F4F200F8F4 + F200F8F4F200F8F4F200F8F4F200F8F4F200F8F4F200B7A29300EDE4DF00EDE4 + DF00EDE4DF00EDE4DF00EDE4DF00B7A2930069473100FF00FF00FF00FF00C7B2 + A300F0E8E400F0E8E400F0E8E400F0E8E400F0E8E400F0E8E400B7A29300B7A2 + 9300FCFAF900FCFAF900FCFAF900FCFAF900FCFAF900FCFAF900FCFAF900FCFA + F900B7A29300B7A29300F0E8E400F0E8E400F0E8E400F0E8E400F0E8E400B7A2 + 930069473100FF00FF00FF00FF00C7B2A300F3EDE900F3EDE900F3EDE900F3ED + E900F3EDE900B7A29300DDC5C200DDC5C200B7A29300DDC5C200FFFFFF00FFFF + FF00FFFFFF00FFFFFF00DDC5C200B7A29300DDC5C200DDC5C200B7A29300F3ED + E900F3EDE900F3EDE900F3EDE900B7A2930069473100FF00FF00FF00FF00C7B2 + A300F6F1EF00F6F1EF00F6F1EF00F6F1EF00B7A29300DDC5C200FBF9F700F7F4 + F100DDC5C200C7B2A300B7A29300B7A29300B7A29300B7A29300C7B2A300DDC5 + C200DCCBC100DBC9BF00DDC5C200B7A29300F6F1EF00F6F1EF00F6F1EF00B7A2 + 930069473100FF00FF00FF00FF00C7B2A300F9F6F400F9F6F400F9F6F400B7A2 + 9300DDC5C200FFFFFF00FEFDFC00FBF9F700F7F4F100EEE0E000EEE0E000EEE0 + E000EEE0E000EEE0E000EEE0E000E4D7CF00E1D2C900DECDC400DBC9BF00DDC5 + C200B7A29300F9F6F400F9F6F400B7A2930069473100FF00FF00FF00FF00C7B2 + A300FCFBFA00FCFBFA00B7A29300C8B3A400FFFFFF00FFFFFF00B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300DECDC400DBC9BF00D2C0B300B7A29300FCFBFA00B7A2 + 930069473100FF00FF00FF00FF00C7B2A300FFFFFF00B8A39400DDC5C200C8B3 + A400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FCFBF900F9F6F400F6F2 + EF00F3EDE900F0E8E400EDE4DF00EAE0D900E7DBD400E4D7CF00E1D2C900DECD + C400D2BFB200DDC5C200B7A29300FFFFFF0069473100FF00FF00FF00FF00C7B2 + A300B7A29300DDC5C20027A5E900C8B3A400FFFFFF00FFFFFF00B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300E4D7CF00E1D2C900D1BEB10027A5E900DDC5C200B7A2 + 930069473100FF00FF00FF00FF00C7B2A300DDC5C20027A5E90027A5E900C8B3 + A400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FCFB + F900F9F6F400F6F2EF00F3EDE900F0E8E400EDE4DF00EAE0D900E7DBD400E4D7 + CF00D1BEB10027A5E90027A5E900B7A2930069473100FF00FF00FF00FF00FF00 + FF00C7B2A300DDC5C20047B6FF00C8B3A400FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FCFBF900F9F6F400F6F2EF00F3ED + E900F0E8E400EDE4DF00EAE0D900E7DBD400D0BDB00047B6FF00B7A293006947 + 3100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00C7B2A300DDC5C200C8B3 + A400C8B3A400C8B3A400C8B3A400C8B3A400C8B3A400C9B4A500C9B5A600CAB6 + A700CBB6A800CBB7A900CCB8AA00CCB9AB00CDB9AB00CEBAAC00CEBBAD00CFBB + AE00CFBCAF00BCA7980069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00C7B2A300DDC5C200DBF3FA00DBF3FA00DBF3FA00D4F0 + FA00C7EBFB00B9E5FB00ACDFFB009ED9FC0091D4FC0082CEFD0073C8FD0064C2 + FE0055BCFE0047B6FF0047B6FF0047B6FF00BBA6970073533E00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00C7B2 + A300EEE0E000DBF3FA00DBF3FA00DBF3FA00D4F0FA00C7EBFB00B9E5FB00B2E2 + FB00A5DCFC0097D6FC0089D1FC007BCBFD006CC5FD005DBFFE004EB9FE00B7A2 + 930069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00C7B2A300EEE0E000DBF3FA00DBF3 + FA00DBF3FA00DBF3FA00CDEDFA00C0E8FB00B2E2FB00A5DCFC0097D6FC0089D1 + FC007BCBFD006CC5FD00B7A2930069473100FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00C7B2A300EEE0E000DBF3FA00DBF3FA00DBF3FA00DBF3FA00CDED + FA00C0E8FB00B2E2FB00A5DCFC0097D6FC0089D1FC00B7A2930069473100FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00C7B2A300EEE0 + E000DBF3FA00DBF3FA00DBF3FA00DBF3FA00CDEDFA00C0E8FB00B2E2FB00A5DC + FC00B7A2930069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00C7B2A300EEE0E000EEE0E000EEE0E000EEE0 + E000EEE0E000EEE0E000DDC5C200B7A2930069473100FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00C7B2A300C7B2A300C7B2A300C7B2A300C7B2A300C7B2A300C7B2A300C7B2 + A300FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF000090C800006098000060 + 9800006098000060980000609800006098000060980000609800006098000060 + 9800006098000060980000609800006098000060980000609800006098000060 + 9800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C80070D1EC000290C9000290C9000290C9000290C9000290C9000290 + C9000290C9000290C9000290C9000290C9000290C9000290C9000290C9000290 + C9000290C9000290C9000290C9000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C80075D4EE0070D1EC006CCF + EB0067CCE90062C9E8005EC7E70059C4E50054C1E4004FBEE2004BBBE10046B8 + DF0041B5DE003DB2DD0038AFDB0036AEDB0036AEDB0036AEDB0036AEDB000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C8007AD7EF00CAB5A600694731006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 31006947310069473100694731000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C8007EDAF000CAB5A600F0E9 + E500B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300694731000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C80083DDF200CAB5A600F2ECE900F0E9E500EEE5E100ECE2DD00EADF + D900E7DBD500E5D8D100E3D4CD00E0D1C900DECEC500DDCCC300DBC9BF00DBC9 + BF00DBC9BF00B7A29300694731000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C80088DFF300CAB5A600F5EF + ED00F2ECE900F0E9E500EEE5E100ECE2DD00EADFD900E7DBD500E6D9D300E4D6 + CF00E1D3CB00DFCFC700DDCCC300DBC9BF00DBC9BF00B7A29300694731000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C8008CE2F500CAB5A600F7F3F100F5EFED00F2ECE900F0E9E5006971 + D000C1BDD800EBE0DB00E8DDD700E6D9D300E4D6CF00E1D3CB00DFCFC700DDCC + C300DBC9BF00B7A29300694731000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C80093E6F700CAB5A600F9F6 + F500F8F4F300F6F1EF00DDDBE800041AC7000418C200C1BDD800EBE0DB00E8DD + D700E6D9D300E4D6CF00E1D3CB00DFCFC700DDCCC300B7A29300694731000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C80095E8F800CAB5A600FDFBFB00FAF8F700F8F4F3007B86DF000019 + CA000017C6004B57CC00EDE4DF00EBE0DB00E8DDD700E6D9D300E4D6CF00E1D3 + CB00DFCFC700B7A29300694731000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C80095E8F800CAB5A600FFFF + FF00FDFBFB00DCDEF300102AD4002339D3007A84DB000017C600B4B3DB00EDE4 + DF00EBE0DB00E8DDD700E6D9D300E4D6CF00E1D3CB00B7A29300694731000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C80095E8F800CAB5A600FFFFFF00FFFFFF006B7DE8000826D700AFB5 + E900F3EEEF002E41D0002638CB00E8E1E200EDE4DF00EBE0DB00E8DDD700E6D9 + D300E4D6CF00B7A29300694731000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C80095E8F800CAB5A600FFFF + FF00FFFFFF00FFFFFF00FDFBFB00FAF8F700F8F4F300CDCDE9000B23CC006E77 + D500EFE7E300EDE4DF00EBE0DB00E8DDD700E6D9D300B7A29300694731000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C80095E8F800CAB5A600FFFFFF00FFFFFF00FFFFFF00FFFFFF00FDFB + FB00FAF8F700F8F4F300AAAFE500041DCC00B2B3DF00EFE7E300EDE4DF00EBE0 + DB00E8DDD700B7A29300694731000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C80095E8F800CAB5A600FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FDFBFB00FAF8F700F8F4F3008B94 + E200132BCE00D4D0E300F0E9E500EEE5E100ECE2DD00B7A29300694731000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C80095E8F800CAB5A600FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FDFBFB00FAF8F700F9F6F5008B95E3002A3FD200E8E3E800F0E9 + E500EEE5E100B7A29300694731000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C80095E8F800CAB5A600FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFDFD00FCFA + F900F9F6F5009BA3E5004153D500E8E3E800F0E9E500B7A29300694731000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C80095E8F800CAB5A600FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FEFDFD00FCFAF900F9F6F500C6C8EA006874 + DA00F2ECE900B7A29300694731000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C80095E8F800CAB5A600FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FEFDFD00FCFAF900F9F6F500F7F3F100F5EFED00B7A29300694731000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C80095E8F800CAB5A600FFFFFF00FFFFFF00B7A29300B7A29300B7A2 + 9300B7A29300B8A39400B9A49500BAA59700BBA69800BCA89A00BDA99B00BFAA + 9C00F7F3F100B7A29300694731000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C80095E8F800CAB5A600FFFF + FF00B7A293000060900000609000006090000060900000609000006090000060 + 900000609000006090000060900000609000BFAA9C0069473100694731000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C80095E8F800CAB5A600CAB5A600006098004EBDE3004EBDE3004EBD + E3004EBDE3004EBDE3006ED0EC006ED0EC004EBDE3004EBDE3004EBDE3000290 + C90000436E00CAB5A600CAB5A6000290C90000609800FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF000090C80095E8F80095E8F80095E8 + F80095E8F800006098006ED0EC006ED0EC006ED0EC0000436E000290C9006ED0 + EC006ED0EC006ED0EC000290C90000436E0088DFF30083DDF2007EDAF0000290 + C90000609800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF000090C80080C4E80095E8F80095E8F80095E8F80095E8F800006098006ED0 + EC006ED0EC0000436E0000436E0095E8F8006ED0EC000290C90000436E0091E5 + F6008CE2F50088DFF30083DDF2005DB4E1000290C900FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF000090C8000090C8000190 + C8000190C8000190C8000060980095E8F80095E8F80095E8F80095E8F80095E8 + F80095E8F8000290C90000436E000290C9000290C9000290C9000290C9000290 + C900FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF000060 + 9800006098000060980000609800006098000060980000609800FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00D0BAAC006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 31006947310069473100694731006947310069473100FF00FF00FF00FF00D0BA + AC00FAF8F600B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 930069473100FF00FF00FF00FF00D0BAAC00FCFAF900FAF8F600F8F5F300F6F2 + F000F5F0ED00F3EDE900F1EAE600EFE8E300EDE5E000ECE2DE00EBE0DB00E9DD + D700E7DAD400E5D7D100E3D5CD00E1D2CA00DFCFC700DDCDC300DBCAC000DBC9 + BF00DBC9BF00DBC9BF00DBC9BF00B7A2930069473100FF00FF00FF00FF00D0BA + AC00FDFDFC00B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300DBC9BF00B7A2 + 930069473100FF00FF00FF00FF00D0BAAC00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300DBC9BF00B7A2930069473100FF00FF00FF00FF00D0BA + AC00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300DBC9BF00B7A2 + 930069473100FF00FF00FF00FF00D0BAAC00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300DBCAC000B7A2930069473100FF00FF00FF00FF00D0BA + AC00FFFFFF00B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300C8600000C8600000C860 + 0000C8600000C8600000B7A29300B7A29300B7A29300B7A29300DECEC500B7A2 + 930069473100FF00FF00FF00FF00D0BAAC00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00C8600000FDEDE300FDEDE300FDEDE300C8600000FFFFFF00FFFF + FF00FFFFFF00B7A29300E0D1C800B7A2930069473100FF00FF00FF00FF00D0BA + AC00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00C8600000F8C8C800FDED + E300FDEDE300C8600000FFFFFF00FFFFFF00FFFFFF00B7A29300E2D3CC00B7A2 + 930069473100FF00FF00FF00FF00D0BAAC00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00C860000090300000F8C8C800FDEDE300C8600000FFFFFF00FFFF + FF00FFFFFF00B7A29300E4D6CF00B7A2930069473100FF00FF00FF00FF00D0BA + AC00FFFFFF00B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300C8600000C8600000C860 + 0000C8600000C8600000B7A29300B7A29300B7A29300B7A29300E6D9D200B7A2 + 930069473100FF00FF00FF00FF00D0BAAC00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300E8DBD600B7A2930069473100FF00FF00FF00FF00D0BA + AC00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300EBE0DB00B7A2 + 930069473100FF00FF00FF00FF00D0BAAC00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300FFFFFF00FFFFFF00FFFFFF00B7A29300FFFFFF00FFFF + FF00FFFFFF00B7A29300ECE2DE00B7A2930069473100FF00FF00FF00FF00D0BA + AC00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300EDE5E000B7A2 + 930069473100FF00FF00FF00FF00D0BAAC00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FDFDFC00FCFAF900FAF8F600F8F5F300F6F2F000F5F0 + ED00F3EDE900F1EAE600EFE8E300B7A2930069473100FF00FF00FF00FF00CD76 + 2100CD762100CD762100CD762100CD762100CD762100CD762100CD762100CD76 + 2100CD762100CD762100CD762100CD762100CD762100CD762100CD762100CD76 + 2100CD762100CD762100CD762100CD762100CD762100CD762100CD762100CD76 + 210069473100FF00FF00FF00FF00CD762100FBC39F00FBC39F00FBC39F00FBC3 + 9F00FBC39F00FBC39F00FBBE9700FAB89000FAB28800F9AC8000F8A67900F8A0 + 7100F79A6900F7956200F78F5B00F6895300F6834B00F57D4400F5773C00F471 + 3400F46B2D00F46B2D00F46B2D00F46B2D0069473100FF00FF00FF00FF00CD76 + 2100FBC39F00FBC39F00FBC39F0069473100FBC39F00FBC39F00FBC39F00FBBE + 9700FAB89000FAB28800F9AC8000F8A67900F8A07100F79A6900F7956200F78F + 5B00F6895300F6834B00F57D440069473100F4713400F46B2D00F46B2D00F46B + 2D0069473100FF00FF00FF00FF00CD762100FBC39F00FBC39F00A36F5A00A36F + 5A0069473100FBC39F00FBC39F00FBC39F00FBBE9700FAB89000FAB28800F9AC + 8000F8A67900F8A07100F79A6900F7956200F78F5B00F6895300A36F5A00A36F + 5A0069473100F4713400F46B2D00F46B2D0069473100FF00FF00FF00FF00CD76 + 2100FBC39F00FBC39F00A36F5A00C898980069473100FBC39F00FBC39F00FBC3 + 9F00FBC39F00FBBE9700FAB89000FAB28800F9AC8000F8A67900F8A07100F79A + 6900F7956200F78F5B00A36F5A00C898980069473100F5773C00F4713400F46B + 2D0069473100FF00FF00FF00FF00CD762100FBC39F00FBC39F00A36F5A00E4B4 + B40069473100FBC39F00FBC39F00FBC39F00FBC39F00FBC39F00FBC19B00FBBB + 9400FAB58C00F9AF8400F8A67900F8A07100F79A6900F7956200A36F5A00E4B4 + B40069473100F57D4400F5773C00F471340069473100FF00FF00FF00FF00CD76 + 2100CD762100CD762100A36F5A00F5C5C50069473100CD762100CD762100CD76 + 2100CD762100CD762100CD762100CD762100CD762100CD762100CD762100CD76 + 2100CD762100CD762100A36F5A00F5C5C50069473100CD762100CD762100CD76 + 2100CD762100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00A36F5A00FFFF + FF0069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00A36F5A00FFFF + FF0069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00A36F5A00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00A36F5A00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00D5BFB1006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 31006947310069473100694731006947310069473100FF00FF00FF00FF00D5BF + B100F7F3F100B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 930069473100FF00FF00FF00FF00D5BFB100F9F6F400F7F3F100F5F1EE00F4EE + EB00F2ECE800F1EAE600EFE7E300EDE5E000ECE3DD00EBE1DB00E9DED800E7DC + D500E6D9D200E4D7CF00E3D5CD00E1D2CA00DFD0C700DECDC400DCCBC100DBC9 + BF00DBC9BF00DBC9BF00DBC9BF00B7A2930069473100FF00FF00FF00FF00D5BF + B100FBF9F800E5EDE200B0CCAC002F872800146D0E00136F0D0013700D001370 + 0D00136F0D00146D0E00156B0E001E821B00A4BB9700D4D1C200E4D7CF00E3D5 + CD00E1D2CA00DFD0C700DECDC400DCCBC100DBC9BF00DBC9BF00DBC9BF00B7A2 + 930069473100FF00FF00FF00FF00D5BFB100FDFCFB0059AA53002E771E004487 + 2F0044933000409A2E003D9F2D003D9F2D003F9C2D0044942F00488C3200307D + 20001A73110047964100E6D9D200A1745C00A1745C00A1745C00A1745C00A174 + 5C00A1745C00A1745C00DBC9BF00B7A2930069473100FF00FF00FF00FF00D5BF + B100FEFEFD00158B0E004B863300449330003D9F2D0038A82A0033AB270032AA + 260037AA2A003DA02C0042962F004A8932002C7C1D0000680000E7DCD500E6D9 + D200E4D7CF00E3D5CD00E1D2CA00DFD0C700DECDC400DCCBC100DBC9BF00B7A2 + 930069473100FF00FF00FF00FF00D5BFB100FFFFFF00148D0E00488C3100409B + 2E0038A82A0030B126001B911700188D15002BAD220037AA2A003E9E2D00468F + 30002A7F1C00006E0000EADFD900A1745C00A1745C00A1745C00A1745C00A174 + 5C00A1745C00A1745C00DCCBC100B7A2930069473100FF00FF00FF00FF00D5BF + B100FFFFFF009ECB9800459030003E9E2D0032AC27001E961A00589D58006EAD + 6D001D93190030AE26003BA22C003B9029000E730B0084AF7C00EBE2DC00EADF + D900E8DDD600E7DBD400E5D8D100E3D6CE00E2D3CB00E0D1C800DFCFC600B7A2 + 930069473100FF00FF00FF00FF00D5BFB100FFFFFF00D0EAD0003FA13600399E + 2A00269D1E002D802E00A5D0B400BCD5CC00428A4600289820003BA12C003587 + 290098B59000EEE6E100EDE4DF00A1745C00A1745C00A1745C00A1745C00A174 + 5C00A1745C00A1745C00E0D1C800B7A2930069473100FF00FF00FF00FF00D5BF + B100FFFFFF00FFFFFF00CAE8CA002E9F2800298F3300548E94005A96BE005792 + BC004386900039824D001677110098BA9200F1EBE700F0E8E400EEE6E100EDE4 + DF00EBE2DC00EADFD900E8DDD600E7DBD400E5D8D100E3D6CE00E2D3CB00B7A2 + 930069473100FF00FF00FF00FF00D5BFB100FFFFFF00FFFFFF00FFFFFF00C5E0 + E20055A1C80055A1D50053A1D600509ED4004C9ACF004C8DB3009AB1B300EFEC + E900F3EDEA00F1EBE700F0E8E400EEE6E100EDE4DF00EBE2DC00EADFD900E8DD + D600E7DBD400E5D8D100E3D6CE00B7A2930069473100FF00FF00FF00FF00D5BF + B100FFFFFF00FFFFFF00FFFFFF0077B3DA005AA7DC005BA8DC005AA7DB0057A4 + D90053A1D6004D9BD000598AAC00E6E6E600F5F1EE00F4EEEB00F2ECE800F1EA + E600EFE7E300EDE4DF00EBE2DC00EADFD900E8DDD600E7DBD400E5D8D100B7A2 + 930069473100FF00FF00FF00FF00D5BFB100FFFFFF00FFFFFF00B4D6EB0063AB + DC0060ADE10061AEE20060ADE1005DAADE0059A6DB0053A1D6004C93C400ABBA + C200F7F3F100F5F1EE00F4EEEB00F2ECE800F1EAE600EFE7E300EDE5E000ECE3 + DD00EBE1DB00E9DED800E7DBD400B7A2930069473100FF00FF00FF00FF00D5BF + B100FFFFFF00FFFFFF0072C5DF0054ADDF0068B4E70068B5E80066B3E60062AF + E2005EABDF0058A5DA00519ED4006B98AE00F9F6F400F7F3F100F5F1EE00F4EE + EB00F2ECE800F1EAE600EFE7E300EDE5E000ECE3DD00EBE1DB00E9DED800B7A2 + 930069473100FF00FF00FF00FF00D5BFB100FFFFFF00FFFFFF0072C5DF0051A8 + D80069B3E4006EBAEC006BB7EA0066B3E50060ADE1005AA7DB0054A2D7003386 + A800FAF8F600F9F6F400F7F3F100F5F1EE00F4EEEB00F2ECE800F1EAE600EFE7 + E300EDE5E000ECE3DD00EBE1DB00B7A2930069473100FF00FF00FF00FF00D5BF + B100FFFFFF00FFFFFF0072C5DF003F93C0004E94C000549BC70061A9D80064AF + E10061AEE10058A4D8004E98CA003285A700FCFAF900FAF8F600F9F6F400F7F3 + F100F5F1EE00F4EEEB00F2ECE800F1EAE600EFE7E300EDE5E000ECE3DD00B7A2 + 930069473100FF00FF00FF00FF00D5BFB100FFFFFF00FFFFFF00BFE5F1003BA1 + CD0059A1CE00579ECC005197C3005198C500549DCC00478EBB002A7AA40092BE + D000FEFEFD00FCFAF900FAF8F600F7A07300F7A07300F7A07300F7A07300F7A0 + 7300F7A07300F7A07300EDE5E000B7A2930069473100FF00FF00FF00FF00D5BF + B100FFFFFF00FFFFFF00FFFFFF004BB5D8005EAEDD0064ADDB005AA1CF004F95 + C200458AB6003A80AB00277BA200E7F1F400FFFFFF00FEFEFD00FDFCFB00FBF9 + F800F9F7F500F8F4F200F6F2EF00F4EEEB00F2ECE800F1EAE600EFE7E300B7A2 + 930069473100FF00FF00FF00FF00D5BFB100FFFFFF00FFFFFF00FFFFFF00EFF8 + FB005ABADD005DB2E10060A9D700539BC700468DB9003B87AB00C5DCE500FFFF + FF00FFFFFF00FFFFFF00FEFEFD00F7A07300F7A07300F7A07300F7A07300F7A0 + 7300F7A07300F7A07300F1EBE700B7A2930069473100FF00FF00FF00FF00D5BF + B100FFFFFF00FFFFFF00FFFFFF00FFFFFF00E3F4F90052B7DA001C8CBF001887 + BA001D88B900CEE2E900FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFE + FD00FDFCFB00FBF9F800F9F7F500F8F4F200F6F2EF00F5F0ED00F3EDEA00B7A2 + 930069473100FF00FF00FF00FF00D5BFB100FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFEFD00FDFCFB00FBF9F800F9F7 + F500F8F4F200F6F2EF00F5F0ED00F3EDEA0069473100FF00FF00FF00FF00D5BF + B100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BF + B100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BF + B100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BFB100D5BF + B100D5BFB100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF007088 + 9000405860004050600040506000404850003040500030404000303840003030 + 4000202830002028300020283000202020001020200010182000101820001010 + 2000101020001010200010102000101020001010200010102000101020001010 + 200010102000FF00FF00FF00FF007090A000A0E0F00060C0E00060C0E00060B8 + E00060B8D00050B0D00050A8D00050A8C00040A0C00040A0C0004098C0003090 + B0003090B0003088B0003080B0002080B0002080B0002080A0002078A0002078 + A0002078A0002078A0002078A0002078A00010102000FF00FF00FF00FF008090 + A000A0E0F00080D8F00080D8F00070C8E00060C0E00060C0E00050B8E00050B8 + E00040B0E00040B0E00040A8E00040A8D00030A0D00030A0D00030A0D0003098 + D0003098D0002098D0002090D0002090C0002088C0002088C0002078A0002078 + A00010102000FF00FF00FF00FF008090A000A0E0F00080D8F00080D8F00080D0 + F00070D0F00070C8F00060C8F00060C0F00050C0F00050C0F00050B8F00040B8 + E00040B0E00040B0E00030A8E00030A8E00030A8E00030A0E00020A0D0002098 + D0002098D0002088C0002078A0002078A00010182000FF00FF00FF00FF008090 + A000B0E8F00090D8F00090D8F00080D8F00080D0F00070D0F00060C8F00060C8 + F00050C0F00050C0F00050C0F00040B8F00040B0E00040B0E00040A8E00030A8 + E00030A8E00030A0E00030A0D00020A0D0002098D0002090C0002078A0002078 + A00010202000FF00FF00FF00FF008090A000B0E8FF0090E0F00090E0F00090D8 + F00080D8F00070D0F00070D0F00060C8F00060C8F00060C8F00050C0F00050C0 + F00040B8E00040B0E00040B0E00040A8E00040A8E00030A8E00030A0E00030A0 + D0002098D0002090C0002078A0002078A00020203000FF00FF00FF00FF008090 + A000B0E8FF0090E0F00090E0F00090D8F00080D8F00070D0F00070D0F00060C8 + F00060C8F00060C8F00050C0F00050C0F00040B8E00040B0E00040B0E00040A8 + E00040A8E00030A8E00030A0E00030A0D0002098D0002090C0002078A0002078 + A00020203000FF00FF00FF00FF008090A000B0E8FF00A0E0F000A0E0F00090E0 + F00080D8F00080D0F00070D0F00070C8F00060C8F00060C8F00060C0F00050C0 + F00050C0F00040B8E00040B0E00040B0E00040B0E00030A8E00030A8E00030A0 + E00030A0D0002090D0002080B0002080B00020283000FF00FF00FF00FF008098 + A000C0F0FF00A0E0F000A0E0F000A0E0F00090E0F00080D8F00080D0F00070D0 + F00060C8F00060C8F00060C8F00050C0F00050C0F00050B8F00040B8E00040B0 + E00040B0E00040B0E00030A8E00030A8E00030A0E0002098D0002080B0002080 + B00030304000FF00FF00FF00FF008098A000C0F0FF00A0E8F000A0E8F000A0E0 + F00090E0F00090D8F00080D8F00080D0F00070D0F00070D0F00060C8F00060C8 + F00050C0F00050C0F00050B8F00040B8E00040B8E00040B0E00040B0E00030A8 + E00030A8E0003098D0003088B0003088B00030384000FF00FF00FF00FF008098 + A000C0F0FF00B0E8FF00B0E8FF00A0E8F000A0E0F00090E0F00090D8F00080D8 + F00070D0F00070D0F00070D0F00060C8F00060C0F00050C0F00050C0F00050B8 + F00050B8F00040B8E00040B0E00040B0E00030A8E0003098D0003090B0003090 + B00040405000FF00FF00FF00FF008098A000C0F0FF00B0E8FF00B0E8FF00B0E8 + F000A0E8F000A0E0F00090E0F00080D8F00080D0F00080D0F00070D0F00070C8 + F00060C8F00060C0F00050C0F00050C0F00050C0F00040B8F00040B0E00040B0 + E00040A8E00030A0D0003090C0003090C00040485000FF00FF00FF00FF008098 + A000D0F0FF00B0F0FF00B0F0FF00B0E8FF00A0E8F000A0E0F00090E0F00090D8 + F00080D8F00080D8F00080D0F00070D0F00060C8F00060C8F00050C0F00050C0 + F00050C0F00050C0F00040B8E00040B0E00040B0E00030A0D0004098C0004098 + C00040506000FF00FF00FF00FF008098A000D0F0FF00B0F0FF00B0F0FF00B0E8 + FF00A0E8F000A0E0F00090E0F00090D8F00080D8F00080D8F00080D0F00070D0 + F00060C8F00060C8F00050C0F00050C0F00050C0F00050C0F00040B8E00040B0 + E00040B0E00030A0D0004098C0004098C00040506000FF00FF00FF00FF008098 + A000D0F0FF00C0F0FF00C0F0FF00B0F0FF00B0E8FF00A0E8F000A0E0F00090E0 + F00090D8F00090D8F00080D8F00070D0F00070D0F00060C8F00060C8F00050C0 + F00050C0F00050C0F00050C0F00040B8E00040B0E00040A8D00040A0C00040A0 + C00050586000FF00FF00FF00FF008098A000D0F8FF00C0F0FF00C0F0FF00C0F0 + FF00B0E8FF00B0E8F000A0E8F000A0E0F00090E0F00090E0F00080D8F00080D8 + F00070D0F00070C8F00060C8F00060C0F00060C0F00050C0F00050C0F00050B8 + F00040B8E00040B0E00050A8D00050A8D00050607000FF00FF00FF00FF008098 + A000D0F8FF00D0F8FF00D0F8FF00D0F0FF00C0F0FF00C0F0FF00C0F0FF00B0E8 + FF00B0E8F000B0E8F000A0E0F000A0E0F00090D8F00090D8F00080D8F00080D0 + F00080D0F00080D0F00070D0F00070D0F00070C8F00070C8F00070B0D00070B0 + D00060707000FF00FF00FF00FF008098A0008098A0008098A0008098A0008098 + A0008098A0008090A0008090A0007090A0007088900070889000708890007088 + 9000708890007080900070809000708090007080900070809000708090007080 + 900070809000708090007080900070809000FF00FF00FF00FF00FF00FF008098 + A00090B8C000A0D0E000A0D0E000A0D0E000A0D0E000A0D0D000A0C8D00090C8 + D00090C8D00090C8D00080B8C0008098A000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF008098A000B0D8E000B0D8E000C0F0 + FF00C0F0FF00C0F0FF00B0F0FF00B0E8FF00A0D0E000A0D0E0008098A000FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF008098A000B0D8E000B0D8E000C0F0FF00C0F0FF00C0F0FF00B0F0FF00B0E8 + FF00A0D0E000A0D0E0008098A000FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008098A0008098A0008098 + A0008098A0008098A0008090A0008090A0008098A0008098A000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00C7B2A30069473100694731006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 3100694731006947310069473100694731006947310069473100694731006947 + 31006947310069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00C7B2A300DFD0C700B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A2930069473100FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00C7B2A300B7A29300DFD0C700DFD0 + C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0 + C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0C700DFD0 + C700B7A2930069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00C7B2A300DFD0C700B7A29300E6DAD300E6DAD300E6DAD300E6DAD300E6DA + D300E6DAD300E6DAD300E6DAD300E6DAD300E6DAD300E6DAD300E6DAD300E6DA + D300E6DAD300E6DAD300E6DAD300B7A29300B7A2930069473100FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00C7B2A300E4D7CF00E4D7CF00B7A2 + 9300EEE5DF00EEE5DF00EEE5DF00EEE5DF00EEE5DF00EEE5DF00EEE5DF00EEE5 + DF00EEE5DF00EEE5DF00EEE5DF00EEE5DF00EEE5DF00EEE5DF00B7A29300DFD0 + C700B7A2930069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00C7B2A300E9DED800E9DED800E9DED800B7A29300F2EBE800F2EBE800F2EB + E800F2EBE800F2EBE800F2EBE800F2EBE800F2EBE800F2EBE800F2EBE800F2EB + E800F2EBE800B7A29300E6DAD300E6DAD300B7A2930069473100FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00C7B2A300EEE5E000EEE5E000EEE5 + E000EEE5E000B7A29300F6F2F000F6F2F000F6F2F000F6F2F000F6F2F000F6F2 + F000F6F2F000F6F2F000F6F2F000F6F2F000B7A29300EEE5DF00EEE5DF00EEE5 + DF00B7A2930069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00C7B2A300F1EAE700F1EAE700F1EAE700F1EAE700F1EAE700B7A29300FBF9 + F800FBF9F800FBF9F800FBF9F800FBF9F800FBF9F800FBF9F800FBF9F800B7A2 + 9300F2EBE800F2EBE800F2EBE800F2EBE800B7A2930069473100FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00C7B2A300F4EFED00F4EFED00F4EF + ED00F4EFED00B7A29300EEE0E000B7A29300FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00B7A29300DDC5C200B7A29300F6F2F000F6F2F000F6F2 + F000B7A293006947310085929900006090000060900000609000006090000060 + 9000C7B2A300F8F4F300F8F4F300F8F4F300B7A29300EEE0E000FBF8F700EEE0 + E000B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300DDC5C200DBC9 + BF00DDC5C200B7A29300FBF9F800FBF9F800B7A2930069473100859299008BF0 + F7000691CD000691CD000691CD000691CD00C7B2A300FCFAF900FCFAF900B7A2 + 9300EEE0E000FFFFFF00FEFDFD00FBF8F700EEE0E000EEE0E000EEE0E000EEE0 + E000EEE0E000EEE0E000E4D6CF00E0D1C800DCCBC200DDC5C200B7A29300FFFF + FF00B7A2930069473100859299008BF0F70087EEF70083ECF7007FEAF6007CE8 + F600C7B2A300FFFFFF00B8A39400FFFFFF00FFFFFF00B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300E0D1C800DCCBC200C8B3A400B7A29300F7F1EA0069473100859299008EF2 + F8008BF0F70087EEF70083ECF7007FEAF600C7B2A300B7A29300C8B3A400FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FCFAFA00F9F5F400F5F0 + EE00F2EBE800EEE6E200EBE1DC00E8DCD600E4D6CF00E0D1C800C8B3A400DDC5 + C200D1A09E00694731008592990092F4F8008EF2F8008BF0F70087EEF70083EC + F700C7B2A30027A5E900C8B3A400FFFFFF00FFFFFF00B7A29300B7A29300B7A2 + 9300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A29300B7A2 + 9300E8DCD600E4D6CF00C8B3A40027A5E900B7A29300694731008592990092F4 + F80092F4F8008EF2F8008BF0F70087EEF700C7B2A30027A5E900C8B3A400FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FCFA + FA00F9F5F400F5F0EE00F2EBE800EEE6E200EBE1DC00E8DCD600C8B3A40027A5 + E900B7A29300694731008592990092F4F80092F4F80092F4F8008EF2F8008BF0 + F70087EEF700C7B2A300C8B3A400C8B3A400C8B3A400C8B3A400C8B3A400C8B3 + A400C8B3A400C8B3A400C8B3A400C8B3A400C8B3A400C8B3A400C8B3A400C8B3 + A400C8B3A400C8B3A400C8B3A400B9A4950069473100FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80090F3F8008DF1F80089EFF700C7B2A300DBF3 + FA00DBF3FA00DBF3FA00D3F0FA00C5EAFB00B6E3FB00A7DDFC0098D7FC0089D1 + FC007BCBFD006CC5FD005DBFFE004EB9FE0047B6FF0047B6FF00B7A293006947 + 3100FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80090F3F8008DF1F80089EFF700C7B2A300DBF3FA00DBF3FA00DBF3FA00D3F0 + FA00C5EAFB00B6E3FB00A7DDFC0098D7FC0091D4FC0082CEFD0073C8FD0064C2 + FE0055BCFE00B7A2930069473100FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80090F3F8008DF1F80089EF + F700C7B2A300DBF3FA00DBF3FA00DBF3FA00DBF3FA00CCEDFB00BDE6FB00AEE0 + FB009FDAFC0091D4FC0082CEFD0073C8FD00B7A2930069473100FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80092F4F80090F3F8008DF1F80089EFF700C7B2A300DBF3FA00DBF3 + FA00DBF3FA00DBF3FA00CCEDFB00BDE6FB00AEE0FB009FDAFC0091D4FC00B7A2 + 930069473100FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80090F3 + F8008DF1F80089EFF700C7B2A300DBF3FA00DBF3FA00DBF3FA00DBF3FA00CCED + FB00BDE6FB00AEE0FB009FDAFC0069473100FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80092F4F80092F4F80092F4F80090F3F8008DF1F80089EFF700C7B2 + A300C7B2A300C7B2A300C7B2A300C7B2A300C7B2A300C7B2A300C7B2A3000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80090F3F8008DF1F80089EFF70085EDF70081EBF6007EE9F6007AE7 + F60076E5F50072E3F5000691CD0000609000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990092F4F80092F4F80092F4F80092F4F80092F4 + F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F80092F4F8008EF2 + F8008BF0F70087EEF70083ECF7007EE9F6007AE7F60072E3F50072E3F5000060 + 9000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00859299008592 + 9900859299008592990085929900859299008592990085929900859299008592 + 9900859299008592990085929900859299008592990085929900859299008592 + 990085929900859299008592990085929900FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF008592990095F6F80092F4F80091F2F80090F1F8008EF0 + F8008DEFF80090F1F80079CADE0085929900FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF008592990084DB + E80094F5F80092F4F80091F2F80090F1F80090F1F80079CADE0085929900FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00859299008592990085929900859299008592 + 99008592990085929900FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end + item + Image.Data = { + 760C0000424D760C00000000000036000000280000001C0000001C0000000100 + 200000000000400C000000000000000000000000000000000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF006C8C9C002936430029364300293643002936430029364300293643002936 + 4300293643002936430029364300293643002936430029364300293643002936 + 4300293643002936430029364300293643002936430029364300293643002936 + 4300FF00FF00FF00FF00FF00FF006C8C9C00335D7100335D7100335D7100335D + 7100335D7100335D7100335D7100335D7100335D7100335D7100335D7100335D + 7100335D7100335D7100335D7100335D7100335D71005CCAE10077DEEB0085E9 + F00098F8F80098F8F80098F8F80029364300FF00FF00FF00FF00FF00FF006C8C + 9C008DEFF30053A3B70053A3B70053A3B70053A3B70053A3B70053A3B70053A3 + B70053A3B70053A3B70053A3B70053A3B70053A3B70053A3B70053A3B70053A3 + B70053A3B700335D71005CCAE10077DEEB0085E9F00098F8F80098F8F8002936 + 4300FF00FF00FF00FF00FF00FF006C8C9C0092F4F6008DEFF30087EBF10082E7 + EF007CE3ED0077DEEB0071DAE9006CD6E70066D2E50061CEE3005CCAE10056C5 + DE0051C1DC004BBDDA0046B9D80040B4D60053A3B7005CCAE100335D71005CCA + E10077DEEB0085E9F00098F8F80029364300FF00FF00FF00FF00FF00FF006C8C + 9C0098F8F80092F4F6008DEFF30087EBF10082E7EF007CE3ED0077DEEB0071DA + E9006CD6E70066D2E50061CEE3005CCAE10056C5DE0051C1DC004BBDDA0046B9 + D80053A3B70077DEEB005CCAE100335D71005CCAE10077DEEB0085E9F0002936 + 4300FF00FF00FF00FF00FF00FF006C8C9C0098F8F80098F8F80092F4F6008DEF + F30087EBF10082E7EF007CE3ED0077DEEB0071DAE9006CD6E70066D2E50061CE + E3005CCAE10056C5DE0051C1DC004BBDDA0053A3B70085E9F00077DEEB005CCA + E100335D71005CCAE10077DEEB0029364300FF00FF00FF00FF00FF00FF006C8C + 9C0098F8F80098F8F80098F8F80095F6F70090F2F5008AEDF20085E9F0007CE3 + ED0077DEEB0071DAE9006CD6E70066D2E50061CEE3005CCAE10056C5DE0051C1 + DC0053A3B70098F8F80085E9F00077DEEB005CCAE100335D71005CCAE1002936 + 4300FF00FF00FF00FF00FF00FF006C8C9C0098F8F80098F8F80098F8F80098F8 + F80095F6F70090F2F5008AEDF20085E9F0007FE5EE007AE1EC0074DCEA006FD8 + E80069D4E60064D0E4005ECCE20056C5DE0053A3B70053A3B70053A3B70053A3 + B70053A3B70053A3B700335D710029364300FF00FF00FF00FF00FF00FF006C8C + 9C0098F8F80098F8F80098F8F80098F8F80098F8F80095F6F70090F2F5008AED + F20085E9F0007FE5EE007AE1EC0074DCEA006FD8E80069D4E60064D0E4005ECC + E20059C7DF0053C3DD004EBFDB0048BBD90043B6D70053A3B700335D71002936 + 4300FF00FF00FF00FF00FF00FF006C8C9C0098F8F80098F8F80098F8F80098F8 + F80098F8F80098F8F80095F6F70090F2F5008AEDF20085E9F0007FE5EE007AE1 + EC0074DCEA006FD8E80069D4E60064D0E4005ECCE20059C7DF0053C3DD004EBF + DB0048BBD90053A3B700335D710029364300FF00FF00FF00FF00FF00FF006C8C + 9C0098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80095F6 + F70090F2F5008AEDF20085E9F0007FE5EE007AE1EC0074DCEA006FD8E80069D4 + E60064D0E4005ECCE20059C7DF0053C3DD004EBFDB0053A3B700335D71002936 + 4300FF00FF00FF00FF00FF00FF006C8C9C0098F8F80098F8F80098F8F80098F8 + F80098F8F80098F8F80098F8F80098F8F80095F6F70090F2F5008AEDF20085E9 + F0007FE5EE007AE1EC0074DCEA006FD8E80069D4E60064D0E4005ECCE20059C7 + DF0053C3DD0053A3B700335D710029364300FF00FF00FF00FF00FF00FF006C8C + 9C0098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8 + F80098F8F80095F6F70090F2F5008AEDF20085E9F0007FE5EE007AE1EC0074DC + EA006FD8E80069D4E60064D0E4005ECCE20059C7DF0053A3B700335D71002936 + 4300FF00FF00FF00FF00FF00FF006C8C9C0098F8F80098F8F80098F8F80098F8 + F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80092F4 + F6008DEFF30087EBF10082E7EF007AE1EC0074DCEA006FD8E80069D4E60064D0 + E4005ECCE20053A3B700335D710029364300FF00FF00FF00FF00FF00FF006C8C + 9C0098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8 + F80098F8F80098F8F80098F8F80098F8F80092F4F6008DEFF30087EBF10082E7 + EF007CE3ED0077DEEB0071DAE9006CD6E70066D2E50053A3B700335D71002936 + 4300FF00FF00FF00FF00FF00FF006C8C9C0098F8F80098F8F80098F8F80098F8 + F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8 + F80098F8F80092F4F6008DEFF30087EBF10082E7EF007CE3ED0077DEEB0071DA + E9006CD6E70053A3B700335D710029364300FF00FF00FF00FF00FF00FF006C8C + 9C0098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8 + F80098F8F80098F8F80098F8F80098F8F80098F8F80098F8F80092F4F6008DEF + F30087EBF10082E7EF007CE3ED0077DEEB0071DAE9006CD6E700335D71006C8C + 9C00FF00FF00FF00FF00FF00FF006C8C9C006C8C9C006C8C9C006C8C9C006C8C + 9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C + 9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C9C006C8C + 9C006C8C9C006C8C9C006C8C9C00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + MaskColor = clFuchsia + end> + end +end diff --git a/official/x.35/Lib/D11/dxfmPNFmt.dcu b/official/x.35/Lib/D11/dxfmPNFmt.dcu new file mode 100644 index 00000000..0ec57545 Binary files /dev/null and b/official/x.35/Lib/D11/dxfmPNFmt.dcu differ diff --git a/official/x.35/Lib/D11/dxfmPNFmt.dfm b/official/x.35/Lib/D11/dxfmPNFmt.dfm new file mode 100644 index 00000000..a740ce3b --- /dev/null +++ b/official/x.35/Lib/D11/dxfmPNFmt.dfm @@ -0,0 +1,144 @@ +object dxfmPageNumberFormat: TdxfmPageNumberFormat + Left = 434 + Top = 210 + BorderStyle = bsDialog + Caption = 'Change Page Number Format' + ClientHeight = 209 + ClientWidth = 247 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object lblPageNumberFormat: TLabel + Left = 6 + Top = 15 + Width = 78 + Height = 13 + Caption = 'Number &Format:' + FocusControl = cbxPageNumberingFormat + OnClick = lblPageNumberFormatClick + end + object bvlStartAtHolder: TBevel + Left = 113 + Top = 93 + Width = 129 + Height = 22 + Visible = False + end + object bvlPageNumbering: TBevel + Left = 111 + Top = 49 + Width = 132 + Height = 5 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object Bevel2: TBevel + Left = 6 + Top = 119 + Width = 237 + Height = 5 + Anchors = [akLeft, akTop, akRight] + Shape = bsBottomLine + end + object lblPageNumbering: TLabel + Left = 7 + Top = 45 + Width = 78 + Height = 13 + Caption = 'Page Numbering' + end + object Bevel3: TBevel + Left = 6 + Top = 166 + Width = 237 + Height = 4 + Anchors = [akLeft, akRight, akBottom] + Shape = bsBottomLine + end + object btnOK: TButton + Left = 6 + Top = 180 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object btnCancel: TButton + Left = 87 + Top = 180 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + object btnHelp: TButton + Left = 168 + Top = 180 + Width = 75 + Height = 23 + Anchors = [akRight, akBottom] + Caption = '&Help' + TabOrder = 2 + end + object cbxPageNumberingFormat: TComboBox + Left = 113 + Top = 12 + Width = 130 + Height = 21 + Style = csDropDownList + Anchors = [akLeft, akTop, akRight] + ItemHeight = 13 + TabOrder = 3 + OnChange = cbxPageNumberingFormatChange + Items.Strings = ( + '1, 2, 3, 3, 4, ...' + 'a, b, c, d, e, ...' + 'A, B, C, D, E, ...' + 'i, ii, iii, iv, v, ...' + 'I, II, III, IV, V, ...') + end + object btnDefault: TButton + Left = 154 + Top = 135 + Width = 89 + Height = 23 + Anchors = [akTop, akRight] + Caption = '&Default...' + TabOrder = 4 + OnClick = btnDefaultClick + end + object rbtnContinueFromPrevSection: TRadioButton + Left = 13 + Top = 69 + Width = 228 + Height = 17 + Anchors = [akLeft, akTop, akRight] + Caption = 'Continue from Previous Section' + Checked = True + TabOrder = 5 + TabStop = True + OnClick = rbtnContinueFromPrevSectionClick + end + object rbtnStartAt: TRadioButton + Left = 13 + Top = 96 + Width = 92 + Height = 17 + Caption = 'Start &at:' + TabOrder = 6 + OnClick = rbtnStartAtClick + end +end diff --git a/official/x.35/Lib/D11/dxfmZoom.dcu b/official/x.35/Lib/D11/dxfmZoom.dcu new file mode 100644 index 00000000..243aed1b Binary files /dev/null and b/official/x.35/Lib/D11/dxfmZoom.dcu differ diff --git a/official/x.35/Lib/D11/dxfmZoom.dfm b/official/x.35/Lib/D11/dxfmZoom.dfm new file mode 100644 index 00000000..84da5f34 --- /dev/null +++ b/official/x.35/Lib/D11/dxfmZoom.dfm @@ -0,0 +1,548 @@ +object fmZoom: TfmZoom + Left = 422 + Top = 239 + BorderStyle = bsDialog + Caption = 'Zoom' + ClientHeight = 280 + ClientWidth = 428 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object btnOK: TButton + Left = 186 + Top = 251 + Width = 75 + Height = 23 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 2 + end + object btnCancel: TButton + Left = 267 + Top = 251 + Width = 75 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 3 + end + object gbxPreview: TGroupBox + Left = 193 + Top = 4 + Width = 230 + Height = 238 + Caption = ' Preview ' + TabOrder = 1 + object bvlFontPreviewHolder: TBevel + Left = 8 + Top = 176 + Width = 214 + Height = 54 + Visible = False + end + object bvlPreviewHolder: TBevel + Left = 24 + Top = 23 + Width = 183 + Height = 123 + Visible = False + end + object Panel1: TPanel + Left = 2 + Top = 162 + Width = 226 + Height = 2 + BevelOuter = bvLowered + TabOrder = 0 + end + object stxtFontPreview: TStaticText + Left = 9 + Top = 157 + Width = 125 + Height = 17 + Caption = ' 12 pt Times New Roman ' + TabOrder = 1 + end + end + object btnHelp: TButton + Left = 348 + Top = 251 + Width = 75 + Height = 23 + Caption = '&Help' + TabOrder = 4 + end + object gbxZoomTo: TGroupBox + Left = 5 + Top = 4 + Width = 185 + Height = 238 + Caption = ' &Zoom To ' + TabOrder = 0 + object lblPercent: TLabel + Left = 9 + Top = 205 + Width = 44 + Height = 13 + Caption = 'P&ercent: ' + OnClick = lblPercentClick + end + object bvlPercentHolder: TBevel + Left = 80 + Top = 201 + Width = 87 + Height = 21 + Visible = False + end + object rbtn500: TRadioButton + Left = 8 + Top = 21 + Width = 55 + Height = 17 + Caption = '500 %' + TabOrder = 0 + OnClick = rbtnClick + end + object rbtn200: TRadioButton + Tag = 1 + Left = 8 + Top = 41 + Width = 55 + Height = 17 + Caption = '&200 %' + TabOrder = 1 + OnClick = rbtnClick + end + object rbtn150: TRadioButton + Tag = 2 + Left = 8 + Top = 61 + Width = 55 + Height = 17 + Caption = '150 %' + TabOrder = 2 + OnClick = rbtnClick + end + object rbtn100: TRadioButton + Tag = 3 + Left = 8 + Top = 81 + Width = 55 + Height = 17 + Caption = '&100 %' + TabOrder = 3 + OnClick = rbtnClick + end + object rbtn75: TRadioButton + Tag = 4 + Left = 8 + Top = 101 + Width = 55 + Height = 17 + Caption = '&75 %' + TabOrder = 4 + OnClick = rbtnClick + end + object rbtn50: TRadioButton + Tag = 5 + Left = 8 + Top = 121 + Width = 55 + Height = 17 + Caption = '&50 %' + TabOrder = 5 + OnClick = rbtnClick + end + object rbtn10: TRadioButton + Tag = 7 + Left = 8 + Top = 161 + Width = 55 + Height = 17 + Caption = '10 %' + TabOrder = 7 + OnClick = rbtnClick + end + object rbtn25: TRadioButton + Tag = 6 + Left = 8 + Top = 141 + Width = 55 + Height = 17 + Caption = '25 %' + TabOrder = 6 + OnClick = rbtnClick + end + object rbtnTwoPages: TRadioButton + Tag = 10 + Left = 76 + Top = 61 + Width = 105 + Height = 17 + Caption = '&Two Pages' + TabOrder = 10 + OnClick = rbtnClick + end + object rbtnWholePage: TRadioButton + Tag = 9 + Left = 76 + Top = 41 + Width = 105 + Height = 17 + Caption = 'W&hole Page' + TabOrder = 9 + OnClick = rbtnClick + end + object rbtnPageWidth: TRadioButton + Tag = 8 + Left = 76 + Top = 21 + Width = 105 + Height = 17 + Caption = 'Page &Width' + TabOrder = 8 + OnClick = rbtnClick + end + object rbtnFourPages: TRadioButton + Tag = 11 + Left = 76 + Top = 81 + Width = 105 + Height = 17 + Caption = '&Four Pages' + TabOrder = 11 + OnClick = rbtnClick + end + object rbtnManyPages: TRadioButton + Tag = 12 + Left = 76 + Top = 101 + Width = 105 + Height = 17 + Caption = '&Many Pages:' + TabOrder = 12 + OnClick = rbtnClick + end + object btnManyPages: TBitBtn + Left = 122 + Top = 126 + Width = 45 + Height = 44 + TabOrder = 13 + OnClick = btnManyPagesClick + Glyph.Data = { + 1E030000424D1E03000000000000760000002800000024000000220000000100 + 040000000000A802000000000000000000001000000010000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888 + 8888888888888888888888880000888888888888888888888888888888880888 + 0000888888888888888888888888888888800088000088888888888888888888 + 8888888888000008000088000000000000000000000000008888888800008877 + 7777777777777777777777778888888800008888888808888888888880888888 + 8888888800008888888000000000000000088888888888880000888888077777 + 7777777777708888888888880000888880F8888888888AA88877088888888888 + 000080000000000000000000000000000888888800000F777777777777777777 + 777777777088888800000F888888888888888888888888887088888800000F87 + FFFFFFFFFFFFFFFFFFFFFFF87088888800000F870888888888888888888888F8 + 7088888800000F870770F0000F00F0000F0778F87088888800000F870770FFFF + FF00FFFFFF0778F87088888800000F870770FFFFFF00FFFFFF0778F870888888 + 00000F870770000000000000000778F87088888800000F870770000000000000 + 000778F87088888800000F870770FFFFFF00FFFFFF0778F87088888800000F87 + 0770F0000F00F0000F0778F87088888800000F870770FFFFFF00FFFFFF0778F8 + 7088888800000F870770F0000F00F0000F0778F87088888800000F870770FFFF + FF00FFFFFF0778F87088888800000F870770F0000F00F0000F0778F870888888 + 00000F870770FFFFFF00FFFFFF0778F87088888800000F870770FFFFFF00FFFF + FF0778F87088888800000F870770000000000000000778F87088888800000F87 + 0000000000000000000000F87088888800000F87777777777777777777777778 + 7088888800000F888888888888888888888888887088888800000FFFFFFFFFFF + FFFFFFFFFFFFFFFF878888880000800000000000000000000000000008888888 + 0000} + Layout = blGlyphBottom + Spacing = 0 + end + end + object ilStub: TImageList + Left = 6 + Top = 248 + Bitmap = { + 494C010101000500040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000002000000001002000000000000020 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000084848400848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840084848400848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00000000000000 + 000000000000FFFFFF00000000000000000000000000FFFFFF00000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF000000 + 0000C6C6C600FFFFFF00C6C6C60000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00C6C6 + C600000000000000000000000000C6C6C600FFFFFF00FFFFFF00000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00848484008484840084848400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 000000000000FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000200000000100010000000000000100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000100000000000000000000000000000000000000000000 + 000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxpsfmEditDesc.dcu b/official/x.35/Lib/D11/dxpsfmEditDesc.dcu new file mode 100644 index 00000000..8ec86578 Binary files /dev/null and b/official/x.35/Lib/D11/dxpsfmEditDesc.dcu differ diff --git a/official/x.35/Lib/D11/dxpsfmEditDesc.dfm b/official/x.35/Lib/D11/dxpsfmEditDesc.dfm new file mode 100644 index 00000000..46884e4c --- /dev/null +++ b/official/x.35/Lib/D11/dxpsfmEditDesc.dfm @@ -0,0 +1,63 @@ +object dxfmEditDescription: TdxfmEditDescription + Left = 383 + Top = 205 + BorderStyle = bsDialog + Caption = 'Edit Description' + ClientHeight = 294 + ClientWidth = 333 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + KeyPreview = True + OldCreateOrder = True + Position = poScreenCenter + OnKeyDown = FormKeyDown + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object btnOK: TButton + Left = 90 + Top = 265 + Width = 75 + Height = 23 + Caption = '&OK' + Default = True + ModalResult = 1 + TabOrder = 1 + end + object btnCancel: TButton + Left = 171 + Top = 265 + Width = 75 + Height = 23 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object btnHelp: TButton + Left = 252 + Top = 265 + Width = 75 + Height = 23 + Caption = '&Help' + TabOrder = 3 + end + object gbxMemoHost: TGroupBox + Left = 5 + Top = 6 + Width = 322 + Height = 249 + TabOrder = 0 + object memDescription: TMemo + Left = 8 + Top = 18 + Width = 305 + Height = 218 + TabOrder = 0 + end + end +end diff --git a/official/x.35/Lib/D11/dxreged.dcu b/official/x.35/Lib/D11/dxreged.dcu new file mode 100644 index 00000000..850c6f32 Binary files /dev/null and b/official/x.35/Lib/D11/dxreged.dcu differ diff --git a/official/x.35/Lib/D11/dxreged.dfm b/official/x.35/Lib/D11/dxreged.dfm new file mode 100644 index 00000000..e8b25ddd --- /dev/null +++ b/official/x.35/Lib/D11/dxreged.dfm @@ -0,0 +1,419 @@ +object frmdxLibREgPathEditor: TfrmdxLibREgPathEditor + Left = 225 + Top = 106 + Width = 395 + Height = 365 + ActiveControl = TreeView + BorderIcons = [biSystemMenu, biMaximize] + Caption = 'Developer Express Registry path property editor' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Icon.Data = { + 0000010001001010100000000000280100001600000028000000100000002000 + 00000100040000000000C0000000000000000000000000000000000000000000 + 000000008000008000000080800080000000800080008080000080808000C0C0 + C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000 + 0073701919190000073700000000000073700091910000073708000000000073 + 708077770000073700078888000073708077780880003708077780B080007000 + 78888888800008078800888070000078004000800000078078FF8F8F00000807 + 880000007000007888888807000007888888707000007000000007000000FC00 + 0000F8000000F0010000E0030000C00700008007000000030000000300000003 + 000000030000000300000007000000070000000F0000001F0000003F0000} + OldCreateOrder = True + Position = poScreenCenter + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object Panel: TPanel + Left = 0 + Top = 289 + Width = 387 + Height = 49 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + object lbRegistry: TLabel + Left = 4 + Top = 6 + Width = 5 + Height = 13 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object bOk: TButton + Left = 236 + Top = 25 + Width = 72 + Height = 22 + Caption = '&OK' + Default = True + ModalResult = 1 + TabOrder = 2 + end + object bCancel: TButton + Left = 312 + Top = 25 + Width = 72 + Height = 22 + Cancel = True + Caption = '&Cancel' + ModalResult = 2 + TabOrder = 3 + end + object bNew: TButton + Left = 3 + Top = 25 + Width = 72 + Height = 22 + Caption = '&New' + TabOrder = 0 + OnClick = bNewClick + end + object bDelete: TButton + Left = 80 + Top = 25 + Width = 72 + Height = 22 + Caption = '&Delete' + TabOrder = 1 + OnClick = bDeleteClick + end + end + object TreeView: TTreeView + Left = 0 + Top = 0 + Width = 387 + Height = 289 + Align = alClient + HideSelection = False + Images = ImageList + Indent = 21 + ReadOnly = True + TabOrder = 1 + OnChange = TreeViewChange + OnCollapsed = TreeViewCollapsed + OnExpanded = TreeViewExpanded + OnGetImageIndex = TreeViewGetImageIndex + OnGetSelectedIndex = TreeViewGetSelectedIndex + end + object ImageList: TImageList + Width = 18 + Left = 114 + Top = 50 + Bitmap = { + 494C010102000500040012001000FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000480000002000000001002000000000000024 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000808080008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 0000000000008080800080808000808080008080800080808000808080008080 + 8000808080008080800080808000808080008080800000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000808080000000000000FF + FF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FF + FF00C0C0C00000FFFF0080808000000000000000000000000000000000000000 + 000000000000808080000000000000FFFF00C0C0C00000FFFF00C0C0C00000FF + FF00C0C0C00000FFFF00C0C0C00000FFFF008080800000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000008080800000000000C0C0 + C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0 + C00000FFFF00C0C0C00080808000000000000000000000000000000000000000 + 0000808080000000000000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0 + C00000FFFF00C0C0C00000FFFF00C0C0C0000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000808080000000000000FF + FF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FF + FF00C0C0C00000FFFF0080808000000000000000000000000000000000000000 + 00008080800000000000C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FF + FF00C0C0C00000FFFF00C0C0C000808080000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000008080800000000000C0C0 + C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0 + C00000FFFF00C0C0C00080808000000000000000000000000000000000008080 + 800000000000C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0 + C00000FFFF00C0C0C00000FFFF00000000008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000808080000000000000FF + FF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FF + FF00C0C0C00000FFFF0080808000000000000000000000000000000000008080 + 8000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000008080800000000000C0C0C00080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000008080800000000000C0C0 + C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0 + C00000FFFF00C0C0C00080808000000000000000000000000000000000008080 + 8000808080008080800080808000808080008080800080808000808080008080 + 80008080800080808000808080008080800000FFFF0080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000808080000000000000FF + FF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FF + FF00C0C0C00000FFFF0080808000000000000000000000000000000000000000 + 00008080800000000000C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FF + FF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080808000000000000000000000000000000000000000 + 0000808080000000000000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0 + C000000000000000000000000000000000000000000080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000008080800000FFFF00C0C0 + C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF0080808000808080008080 + 8000808080008080800080808000000000000000000000000000000000000000 + 00008080800000000000C0C0C00000FFFF00C0C0C00000FFFF00C0C0C0000000 + 0000808080008080800080808000808080008080800080808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000008080800000FF + FF00C0C0C00000FFFF00C0C0C00000FFFF008080800000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008080800000000000000000000000000000000000000000008080 + 8000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008080 + 8000808080008080800080808000808080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000080808000808080008080800080808000808080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000048000000200000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFF000000000000000FFFFFFFF + F000000000000000C000FC0010000000000000008000F8001000000000000000 + A000FA001000000000000000A000F4001000000000000000A000F40010000000 + 00000000A000E8001000000000000000A000EFFC1000000000000000A000E000 + 1000000000000000A000F4001000000000000000BFFCF40F9000000000000000 + 8001F4103000000000000000C07FFBEFF000000000000000E0FFFC1FF0000000 + 00000000FFFFFFFFF000000000000000} + end +end diff --git a/official/x.35/Lib/D11/dxrgkeya.dcu b/official/x.35/Lib/D11/dxrgkeya.dcu new file mode 100644 index 00000000..6a157f71 Binary files /dev/null and b/official/x.35/Lib/D11/dxrgkeya.dcu differ diff --git a/official/x.35/Lib/D11/dxrgkeya.dfm b/official/x.35/Lib/D11/dxrgkeya.dfm new file mode 100644 index 00000000..c7c3e22f --- /dev/null +++ b/official/x.35/Lib/D11/dxrgkeya.dfm @@ -0,0 +1,55 @@ +object frmdxAddNewRegKey: TfrmdxAddNewRegKey + Left = 195 + Top = 106 + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'Add a new registry key' + ClientHeight = 84 + ClientWidth = 279 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -14 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + PixelsPerInch = 120 + TextHeight = 16 + object lblName: TLabel + Left = 2 + Top = 15 + Width = 37 + Height = 16 + Caption = 'Name' + end + object Edit: TEdit + Left = 66 + Top = 10 + Width = 210 + Height = 24 + TabOrder = 0 + OnChange = EditChange + end + object bOk: TButton + Left = 90 + Top = 49 + Width = 88 + Height = 27 + Caption = '&OK' + Default = True + Enabled = False + ModalResult = 1 + TabOrder = 1 + end + object bCancel: TButton + Left = 187 + Top = 49 + Width = 89 + Height = 27 + Cancel = True + Caption = '&Cancel' + ModalResult = 2 + TabOrder = 2 + end +end diff --git a/official/x.35/Lib/D11/skins.res b/official/x.35/Lib/D11/skins.res new file mode 100644 index 00000000..c60baf63 Binary files /dev/null and b/official/x.35/Lib/D11/skins.res differ diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeC10.bpk b/official/x.35/XP Theme Manager/Packages/dxThemeC10.bpk new file mode 100644 index 00000000..c285c741 --- /dev/null +++ b/official/x.35/XP Theme Manager/Packages/dxThemeC10.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.10.00 +# --------------------------------------------------------------------------- +PROJECT = dxThemeC10.bpl +OBJFILES = dxThemeC10.obj dxUxTheme.obj dxThemeManager.obj \ + dxThemeConsts.obj dxOffice11.obj +RESFILES = dxThemeC10.res dxOffice11.res +MAINSOURCE = dxThemeC10.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express XP Theme Manager by Developer Express Inc." -aa -Tpp -Gpr -x \ + -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeC10.cpp b/official/x.35/XP Theme Manager/Packages/dxThemeC10.cpp new file mode 100644 index 00000000..2534b864 --- /dev/null +++ b/official/x.35/XP Theme Manager/Packages/dxThemeC10.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dxThemeC10.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEUNIT("dxUxTheme.pas"); +USEUNIT("dxThemeManager.pas"); +USEUNIT("dxThemeConsts.pas"); +USEUNIT("dxOffice11.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeC10.res b/official/x.35/XP Theme Manager/Packages/dxThemeC10.res new file mode 100644 index 00000000..40b26157 Binary files /dev/null and b/official/x.35/XP Theme Manager/Packages/dxThemeC10.res differ diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeC11.bpk b/official/x.35/XP Theme Manager/Packages/dxThemeC11.bpk new file mode 100644 index 00000000..d18422b0 --- /dev/null +++ b/official/x.35/XP Theme Manager/Packages/dxThemeC11.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.11.00 +# --------------------------------------------------------------------------- +PROJECT = dxThemeC11.bpl +OBJFILES = dxThemeC11.obj dxUxTheme.obj dxThemeManager.obj \ + dxThemeConsts.obj dxOffice11.obj +RESFILES = dxThemeC11.res dxOffice11.res +MAINSOURCE = dxThemeC11.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl100.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express XP Theme Manager by Developer Express Inc." -aa -Tpp -Gpr -x \ + -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeC11.cpp b/official/x.35/XP Theme Manager/Packages/dxThemeC11.cpp new file mode 100644 index 00000000..3ab74e95 --- /dev/null +++ b/official/x.35/XP Theme Manager/Packages/dxThemeC11.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dxThemeC11.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEUNIT("dxUxTheme.pas"); +USEUNIT("dxThemeManager.pas"); +USEUNIT("dxThemeConsts.pas"); +USEUNIT("dxOffice11.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeC11.res b/official/x.35/XP Theme Manager/Packages/dxThemeC11.res new file mode 100644 index 00000000..64248ab4 Binary files /dev/null and b/official/x.35/XP Theme Manager/Packages/dxThemeC11.res differ diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeC5.bpk b/official/x.35/XP Theme Manager/Packages/dxThemeC5.bpk new file mode 100644 index 00000000..16014ff1 --- /dev/null +++ b/official/x.35/XP Theme Manager/Packages/dxThemeC5.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.05.03 +# --------------------------------------------------------------------------- +PROJECT = dxThemeC5.bpl +OBJFILES = dxThemeC5.obj dxUxTheme.obj dxThemeManager.obj \ + dxThemeConsts.obj dxOffice11.obj +RESFILES = dxThemeC5.res dxOffice11.res +MAINSOURCE = dxThemeC5.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = vcl50.bpi +SPARELIBS = vcl50.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express XP Theme Manager by Developer Express Inc." -aa -Tpp -Gpr -x \ + -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeC5.cpp b/official/x.35/XP Theme Manager/Packages/dxThemeC5.cpp new file mode 100644 index 00000000..92ac93b9 --- /dev/null +++ b/official/x.35/XP Theme Manager/Packages/dxThemeC5.cpp @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dxThemeC5.res"); +USEPACKAGE("vcl50.bpi"); +USEUNIT("dxUxTheme.pas"); +USEUNIT("dxThemeManager.pas"); +USEUNIT("dxThemeConsts.pas"); +USEUNIT("dxOffice11.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeC5.res b/official/x.35/XP Theme Manager/Packages/dxThemeC5.res new file mode 100644 index 00000000..d58090d0 Binary files /dev/null and b/official/x.35/XP Theme Manager/Packages/dxThemeC5.res differ diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeC6.bpk b/official/x.35/XP Theme Manager/Packages/dxThemeC6.bpk new file mode 100644 index 00000000..db797288 --- /dev/null +++ b/official/x.35/XP Theme Manager/Packages/dxThemeC6.bpk @@ -0,0 +1,195 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.06.00 +# --------------------------------------------------------------------------- +PROJECT = dxThemeC6.bpl +OBJFILES = dxThemeC6.obj dxUxTheme.obj dxThemeManager.obj \ + dxThemeConsts.obj dxOffice11.obj +RESFILES = dxThemeC6.res dxOffice11.res +MAINSOURCE = dxThemeC6.cpp +RESDEPEN = $(RESFILES) +LIBFILES = +IDLFILES = +IDLGENFILES = +LIBRARIES = +PACKAGES = rtl.bpi vcl.bpi +SPARELIBS = rtl.lib vcl.lib +DEFFILE = +OTHERFILES = +# --------------------------------------------------------------------------- +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +USERDEFINES = +SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES +INCLUDEPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\include;$(BCB)\include\vcl +LIBPATH = "$(SEARCHPATH)";$(LIBDIR);$(BCB)\lib\obj;$(BCB)\lib +WARNINGS= -w-par +PATHCPP = .; +PATHASM = .; +PATHPAS = .;"$(SEARCHPATH)";$(LIBDIR) +PATHRC = .; +PATHOBJ = .;$(LIBPATH) +# --------------------------------------------------------------------------- +CFLAG1 = -O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- \ + -k- -vi -c -tWM +IDLCFLAGS = -I"$(SEARCHPATH)";$(LIBDIR) -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa +PFLAGS = -$Y- -$L- -$D- -$A8 -v -JPHNE -M +RFLAGS = +AFLAGS = /mx /w2 /zn +LFLAGS = -D"Express XP Theme Manager by Developer Express Inc." -aa -Tpp -Gpr -x \ + -Gn -Gl -Gi +# --------------------------------------------------------------------------- +ALLOBJ = c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif + + + + + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + + +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif + +!if $d(PATHOBJ) +.PATH.OBJ = $(PATHOBJ) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + + + +# --------------------------------------------------------------------------- + + + + diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeC6.cpp b/official/x.35/XP Theme Manager/Packages/dxThemeC6.cpp new file mode 100644 index 00000000..dff430c3 --- /dev/null +++ b/official/x.35/XP Theme Manager/Packages/dxThemeC6.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dxThemeC6.res"); +USEPACKAGE("vcl.bpi"); +USEPACKAGE("rtl.bpi"); +USEUNIT("dxUxTheme.pas"); +USEUNIT("dxThemeManager.pas"); +USEUNIT("dxThemeConsts.pas"); +USEUNIT("dxOffice11.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeC6.res b/official/x.35/XP Theme Manager/Packages/dxThemeC6.res new file mode 100644 index 00000000..dd517934 Binary files /dev/null and b/official/x.35/XP Theme Manager/Packages/dxThemeC6.res differ diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeD10.dpk b/official/x.35/XP Theme Manager/Packages/dxThemeD10.dpk new file mode 100644 index 00000000..3f3da858 --- /dev/null +++ b/official/x.35/XP Theme Manager/Packages/dxThemeD10.dpk @@ -0,0 +1,39 @@ +package dxThemeD10; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'Express XP Theme Manager by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl; + +contains + dxThemeConsts, + dxThemeManager, + dxOffice11, + dxUxTheme; + +end. diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeD10.res b/official/x.35/XP Theme Manager/Packages/dxThemeD10.res new file mode 100644 index 00000000..ee13d4fb Binary files /dev/null and b/official/x.35/XP Theme Manager/Packages/dxThemeD10.res differ diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeD10NET.dpk b/official/x.35/XP Theme Manager/Packages/dxThemeD10NET.dpk new file mode 100644 index 00000000..f2e4b66f --- /dev/null +++ b/official/x.35/XP Theme Manager/Packages/dxThemeD10NET.dpk @@ -0,0 +1,97 @@ +package dxThemeD10NET; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express XP Theme Manager by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + System.Drawing, + Borland.Vcl; + +contains + dxUxTheme, + dxOffice11, + dxThemeConsts, + dxThemeManager; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeD10NET.res b/official/x.35/XP Theme Manager/Packages/dxThemeD10NET.res new file mode 100644 index 00000000..f20485f8 Binary files /dev/null and b/official/x.35/XP Theme Manager/Packages/dxThemeD10NET.res differ diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeD11.dpk b/official/x.35/XP Theme Manager/Packages/dxThemeD11.dpk new file mode 100644 index 00000000..6a2ef729 --- /dev/null +++ b/official/x.35/XP Theme Manager/Packages/dxThemeD11.dpk @@ -0,0 +1,39 @@ +package dxThemeD11; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'Express XP Theme Manager by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl; + +contains + dxThemeConsts, + dxThemeManager, + dxOffice11, + dxUxTheme; + +end. diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeD11.res b/official/x.35/XP Theme Manager/Packages/dxThemeD11.res new file mode 100644 index 00000000..962335bc Binary files /dev/null and b/official/x.35/XP Theme Manager/Packages/dxThemeD11.res differ diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeD5.dpk b/official/x.35/XP Theme Manager/Packages/dxThemeD5.dpk new file mode 100644 index 00000000..659432c3 --- /dev/null +++ b/official/x.35/XP Theme Manager/Packages/dxThemeD5.dpk @@ -0,0 +1,37 @@ +package dxThemeD5; + +{$R *.res} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express XP Theme Manager by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50; + +contains + dxThemeConsts, + dxThemeManager, + dxOffice11, + dxUxTheme; + +end. diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeD5.res b/official/x.35/XP Theme Manager/Packages/dxThemeD5.res new file mode 100644 index 00000000..38a47392 Binary files /dev/null and b/official/x.35/XP Theme Manager/Packages/dxThemeD5.res differ diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeD6.dpk b/official/x.35/XP Theme Manager/Packages/dxThemeD6.dpk new file mode 100644 index 00000000..5eb95209 --- /dev/null +++ b/official/x.35/XP Theme Manager/Packages/dxThemeD6.dpk @@ -0,0 +1,39 @@ +package dxThemeD6; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'Express XP Theme Manager by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl; + +contains + dxThemeConsts, + dxThemeManager, + dxOffice11, + dxUxTheme; + +end. diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeD6.res b/official/x.35/XP Theme Manager/Packages/dxThemeD6.res new file mode 100644 index 00000000..3d998bac Binary files /dev/null and b/official/x.35/XP Theme Manager/Packages/dxThemeD6.res differ diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeD7.dpk b/official/x.35/XP Theme Manager/Packages/dxThemeD7.dpk new file mode 100644 index 00000000..8fb83311 --- /dev/null +++ b/official/x.35/XP Theme Manager/Packages/dxThemeD7.dpk @@ -0,0 +1,39 @@ +package dxThemeD7; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'Express XP Theme Manager by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl; + +contains + dxThemeConsts, + dxThemeManager, + dxOffice11, + dxUxTheme; + +end. diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeD7.res b/official/x.35/XP Theme Manager/Packages/dxThemeD7.res new file mode 100644 index 00000000..5e3d7448 Binary files /dev/null and b/official/x.35/XP Theme Manager/Packages/dxThemeD7.res differ diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeD8.dpk b/official/x.35/XP Theme Manager/Packages/dxThemeD8.dpk new file mode 100644 index 00000000..f03b2376 --- /dev/null +++ b/official/x.35/XP Theme Manager/Packages/dxThemeD8.dpk @@ -0,0 +1,97 @@ +package dxThemeD8; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express XP Theme Manager by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + System.Drawing, + Borland.Vcl; + +contains + dxUxTheme, + dxOffice11, + dxThemeConsts, + dxThemeManager; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeD8.res b/official/x.35/XP Theme Manager/Packages/dxThemeD8.res new file mode 100644 index 00000000..0a7b85cb Binary files /dev/null and b/official/x.35/XP Theme Manager/Packages/dxThemeD8.res differ diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeD9.dpk b/official/x.35/XP Theme Manager/Packages/dxThemeD9.dpk new file mode 100644 index 00000000..5ba871f4 --- /dev/null +++ b/official/x.35/XP Theme Manager/Packages/dxThemeD9.dpk @@ -0,0 +1,39 @@ +package dxThemeD9; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESCRIPTION 'Express XP Theme Manager by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl; + +contains + dxThemeConsts, + dxThemeManager, + dxOffice11, + dxUxTheme; + +end. diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeD9.res b/official/x.35/XP Theme Manager/Packages/dxThemeD9.res new file mode 100644 index 00000000..f5853f14 Binary files /dev/null and b/official/x.35/XP Theme Manager/Packages/dxThemeD9.res differ diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeD9NET.dpk b/official/x.35/XP Theme Manager/Packages/dxThemeD9NET.dpk new file mode 100644 index 00000000..4d5f046b --- /dev/null +++ b/official/x.35/XP Theme Manager/Packages/dxThemeD9NET.dpk @@ -0,0 +1,97 @@ +package dxThemeD9NET; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Express XP Theme Manager by Developer Express Inc.'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + System.Drawing, + Borland.Vcl; + +contains + dxUxTheme, + dxOffice11, + dxThemeConsts, + dxThemeManager; + +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] +end. diff --git a/official/x.35/XP Theme Manager/Packages/dxThemeD9NET.res b/official/x.35/XP Theme Manager/Packages/dxThemeD9NET.res new file mode 100644 index 00000000..c9c8ed89 Binary files /dev/null and b/official/x.35/XP Theme Manager/Packages/dxThemeD9NET.res differ diff --git a/official/x.35/XP Theme Manager/Sources/cxVer.inc b/official/x.35/XP Theme Manager/Sources/cxVer.inc new file mode 100644 index 00000000..a26364cc --- /dev/null +++ b/official/x.35/XP Theme Manager/Sources/cxVer.inc @@ -0,0 +1,172 @@ +{$B-} { Complete Boolean Evaluation } +{$R-} { Range-Checking } +{$T-} { Typed @ operator } +{$X+} { Extended syntax } +{$P+} { Open string params } +{$J+} { Writeable structured consts } +{$H+} { Use long strings by default } +{$Q-} { Overflow checking } + +{$DEFINE DXVER500} + +{$IFNDEF CLR} + {$DEFINE OLEDRAGANDDROP} + {$IFNDEF DONTUSEJPEGIMAGE} + {$DEFINE USEJPEGIMAGE} + {$ENDIF} +{$ENDIF} + +{$DEFINE EXPRESSBARS5} + +{$DEFINE VCL} + +{$IFNDEF VER80} + {$IFNDEF VER90} + {$IFNDEF VER93} + {$DEFINE DELPHI3} { Borland Delphi 3.0 } + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER110} { Borland C++Builder 3.0 } + {$DEFINE CBUILDER3} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE DELPHI4} +{$ENDIF} + +{$IFDEF VER125} { Borland C++Builder 4.0 } + {$DEFINE CBUILDER3} + {$DEFINE DELPHI4} + {$DEFINE CBUILDER4} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$IFDEF BCB} { Borland C++Builder 5.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$IFDEF BCB} { Borland C++Builder 6.0 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} +{$ENDIF} + +{$IFNDEF DELPHI6} + {$DEFINE MSWINDOWS} +{$ENDIF} +{$IFDEF LINUX} + {$UNDEF MSWINDOWS} +{$ENDIF} + +{$IFDEF LINUX} + {$DEFINE KYLIX1} { Borland Kylix 1 } + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF CompilerVersion >= 14} + {$DEFINE KYLIX2} { Borland Kylix 2 } + {$IFEND} + {$IF CompilerVersion >= 14.50} + {$DEFINE KYLIX3} { Borland Kylix 3 } + {$IFEND} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} { Borland Delphi.Net } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} +{$ENDIF} + +{$IFDEF VER170} { Borland Delphi 9.0 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} +{$ENDIF} + +{$IFDEF VER180} { Borland Delphi 10 } + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$IFDEF BCB} { Borland C++Builder 10 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Borland Delphi 11 //CodeGear} + {$DEFINE DELPHI4} + {$DEFINE DELPHI5} + {$DEFINE DELPHI6} + {$DEFINE DELPHI7} + {$DEFINE DELPHI8} + {$DEFINE DELPHI9} + {$DEFINE DELPHI10} + {$DEFINE DELPHI11} + {$IFDEF BCB} { Borland C++Builder 11 } + {$DEFINE CBUILDER3} + {$DEFINE CBUILDER4} + {$DEFINE CBUILDER5} + {$DEFINE CBUILDER6} + {$DEFINE CBUILDER10} + {$DEFINE CBUILDER11} + {$ObjExportAll On} + {$ENDIF} +{$ENDIF} + +{$IFNDEF CLR} + {$IFNDEF BCB} + {$IFDEF DELPHI6} + {$DEFINE REGISTERSHELLCTRLS} + {$ENDIF} + {$ENDIF} + {$IFDEF DELPHI7} + {$WARN UNSAFE_CAST OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_TYPE OFF} + {$ENDIF} +{$ENDIF} + +{$IFDEF REGISTERSHELLCTRLS} + {$DEFINE REGISTERCXSHELLCTRLS} +{$ENDIF} + +{$IFDEF DELPHI6} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNIT_PLATFORM OFF} +{$ENDIF} diff --git a/official/x.35/XP Theme Manager/Sources/dxOffice11.pas b/official/x.35/XP Theme Manager/Sources/dxOffice11.pas new file mode 100644 index 00000000..8fe5509f --- /dev/null +++ b/official/x.35/XP Theme Manager/Sources/dxOffice11.pas @@ -0,0 +1,1126 @@ + +{*******************************************************************} +{ } +{ Developer Express Visual Component Library } +{ Office 11 routines } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSTHEME AND ALL ACCOMPANYING } +{ VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{*******************************************************************} + +unit dxOffice11; + +{$I cxVer.inc} + +interface + +uses + SysUtils, TypInfo, Windows, Messages, Graphics, Controls, Forms, Classes; + +type + TOffice11Scheme = (schUnknown, schNormalColor, schHomestead, schMetallic); + TOffice11SchemeColor = schNormalColor .. schMetallic; + +var + { Colors } + + // dock + dxOffice11DockColor1: COLORREF; + dxOffice11DockColor2: COLORREF; + // bar: background + dxOffice11ToolbarsColor1: COLORREF; + dxOffice11ToolbarsColor2: COLORREF; + // bar: marks + dxOffice11BarMarkColors1: array[1..3] of COLORREF; // Normal, Selected, Pressed + dxOffice11BarMarkColors2: array[1..3] of COLORREF; // Normal, Selected, Pressed + dxOffice11BarBorderColors: array[1..2] of COLORREF; // fixed colors + dxOffice11BarBorderMarkColors: array[1..2, 1..3] of COLORREF; + // bar: fingers, separators, mark arrows + dxOffice11BarFingerColor1: COLORREF; + dxOffice11BarFingerColor2: COLORREF; + dxOffice11BarSeparatorColor1: COLORREF; + dxOffice11BarSeparatorColor2: COLORREF; + dxOffice11BarMarkArrowColor1: COLORREF; + dxOffice11BarMarkArrowColor2: COLORREF; + // bar: floating toolbar + dxOffice11BarFloatingBorderColor1: COLORREF; + dxOffice11BarFloatingBorderColor2: COLORREF; + dxOffice11BarFloatingBorderColor3: COLORREF; + dxOffice11BarFloatingCaptionColor: COLORREF; + dxOffice11BarFloatingCaptionTextColor1: COLORREF; + dxOffice11BarFloatingCaptionTextColor2: COLORREF; + dxOffice11BarFloatingCaptionTextColor3: COLORREF; + // drop downs + dxOffice11MenuColor: COLORREF; + dxOffice11MenuDownedColor1: COLORREF; + dxOffice11MenuDownedColor2: COLORREF; + dxOffice11MenuIndentColor1: COLORREF; + dxOffice11MenuIndentColor2: COLORREF; + dxOffice11MenuNonRecentIndentColor1: COLORREF; + dxOffice11MenuNonRecentIndentColor2: COLORREF; + dxOffice11DropDownBorderColor1: COLORREF; + dxOffice11DropDownBorderColor2: COLORREF; + // selected, pressed, downed + dxOffice11ToolbarSelectedColor: COLORREF; + dxOffice11SelectedBorderColor: COLORREF; + dxOffice11SelectedColor1: COLORREF; + dxOffice11SelectedColor2: COLORREF; + dxOffice11SelectedDownColor1: COLORREF; + dxOffice11SelectedDownColor2: COLORREF; + dxOffice11OwnerControlDownedColor: COLORREF; + dxOffice11DownedColor: COLORREF; + dxOffice11DownedSelectedColor: COLORREF; + // detachable + dxOffice11DetachableColor: COLORREF; + dxOffice11DetachableSelectedColor: COLORREF; + // text + dxOffice11TextEnabledColor: COLORREF; + dxOffice11TextDisabledColor: COLORREF; + // static + dxOffice11StaticBorderColor: COLORREF; + // date + dxOffice11DateHeaderColor: COLORREF; + // inplace sub item + dxOffice11InPlaceSubItemColor: COLORREF; + dxOffice11InPlaceSubItemTextColor: COLORREF; + // LF painters + // control border color + dxOffice11ControlBorderColor: COLORREF; + dxOffice11GroupColor: COLORREF; + // Outlook colors + dxOffice11DayNavigatorSelectedColor: COLORREF; + dxOffice11OutlookBorderColor: COLORREF; + dxOffice11OutlookControlColor: COLORREF; + // Office11 group row style colors + dxOffice11GroupIndentColor: COLORREF; + dxOffice11GroupRowTextColor: COLORREF; + dxOffice11GroupRowSeparatorColor: COLORREF; + // NavPane colors + dxOffice11NavPaneBorder: COLORREF; + dxOffice11NavPaneGroupCaptionColor1: COLORREF; + dxOffice11NavPaneGroupCaptionColor2: COLORREF; + dxOffice11NavPaneGroupCaptionHotColor1: COLORREF; + dxOffice11NavPaneGroupCaptionHotColor2: COLORREF; + dxOffice11NavPaneGroupCaptionPressedColor1: COLORREF; + dxOffice11NavPaneGroupCaptionPressedColor2: COLORREF; + dxOffice11NavPaneGroupCaptionPressedHotColor1: COLORREF; + dxOffice11NavPaneGroupCaptionPressedHotColor2: COLORREF; + dxOffice11NavPaneHeaderColor1: COLORREF; + dxOffice11NavPaneHeaderColor2: COLORREF; + dxOffice11NavPaneHeaderFontColor: COLORREF; + dxOffice11NavPaneSplitterColor1: COLORREF; + dxOffice11NavPaneSplitterColor2: COLORREF; + // Expand button colors + dxOffice11ExpandButtonColor1: COLORREF; + dxOffice11ExpandButtonColor2: COLORREF; + + { Brushes } + + dxOffice11BarFingerBrush1: HBRUSH; + dxOffice11BarFingerBrush2: HBRUSH; + dxOffice11BarSeparatorBrush1: HBRUSH; + dxOffice11BarSeparatorBrush2: HBRUSH; + dxOffice11MenuBrush: HBRUSH; + dxOffice11SelectedBorderBrush: HBRUSH; + dxOffice11ToolbarSelectedBrush: HBRUSH; + dxOffice11OwnerControlDownedBrush: HBRUSH; + dxOffice11DownedBrush: HBRUSH; + dxOffice11DownedSelectedBrush: HBRUSH; + + dxOffice11DropDownBorderBrush1: HBRUSH; + dxOffice11DropDownBorderBrush2: HBRUSH; + dxOffice11DetachableBrush: HBRUSH; + dxOffice11DetachableSelectedBrush: HBRUSH; + + dxOffice11StaticBorderBrush: HBRUSH; + dxOffice11InPlaceSubItemBrush: HBRUSH; + + { Bitmaps } + + dxOffice11SubMenuExpandBitmap: TBitmap; + dxOffice11ExpandButtonBitmap1: TBitmap; + dxOffice11ExpandButtonBitmap2: TBitmap; + +function GetOffice11Scheme: TOffice11Scheme; + +function Dark(Col: TColor; Percentage: Byte): TColor; +function GetLightColor(ABtnFaceColorPart, AHighlightColorPart, AWindowColorPart: Integer): COLORREF; +function GetMiddleRGB(AColor1, AColor2: TColor; APercent: Integer): COLORREF; +function GetRealColor(AColor: COLORREF): COLORREF; +function Light(Col: TColor; Percentage: Byte): TColor; + +procedure CreateOffice11Colors; +procedure RefreshOffice11Colors; +procedure ReleaseOffice11Colors; + +function IsHighContrastBlack: Boolean; +function IsHighContrastWhite: Boolean; +function IsHighContrast2: Boolean; +function IsXPStandardScheme: Boolean; +procedure FillGradientRect(DC: HDC; const ARect: TRect; AColor1, AColor2: TColor; + AHorizontal: Boolean); +procedure FillTubeGradientRect(DC: HDC; const ARect: TRect; AColor1, AColor2: TColor; + AHorizontal: Boolean); +procedure FillRectByColor(DC: HDC; const R: TRect; AColor: TColor); +procedure FrameRectByColor(DC: HDC; const R: TRect; AColor: TColor); +function GetGradientColorRect(const ARect: TRect; X: Integer; AColor1, AColor2: TColor; + AHorizontal: Boolean): TColorRef; +procedure Office11FrameSelectedRect(DC: HDC; const R: TRect); +procedure Office11DrawFingerElements(DC: HDC; ARect: TRect; AHorizontal: Boolean; + ABrush1: HBRUSH = 0; ABrush2: HBRUSH = 0); +procedure Office11DrawItemArrow(DC: HDC; R: TRect; ADownArrow: Boolean; + Enabled, Selected, Flat: Boolean); +procedure Office11DrawLargeItemArrow(DC: HDC; R: TRect; ADownArrow: Boolean; + Size: Integer; Selected, Enabled, Flat: Boolean); +procedure Office11DrawSizeGrip(DC: HDC; ARect: TRect; + AColor1: TColor = clDefault; AColor2: TColor = clDefault); + +implementation + +{$R dxOffice11.res} + +uses + dxThemeManager, dxUxTheme, dxThemeConsts; + +type + TTriVertex = packed record + X: Integer; + Y: Integer; + Red: WORD; + Green: WORD; + Blue: WORD; + Alpha: WORD; + end; + +var + FCounter: Integer; + FOffice11Scheme: TOffice11Scheme; + FXPStandardScheme: Boolean; + GradientPercent: Integer; + + FMsimg32Library: HMODULE; + GradientFill: function (ADC: THandle; + const AVertex: TTriVertex; ANumVertex: Integer; + const AMesh: TGradientRect; ANumMesh: Integer; AMode: DWORD): Boolean; stdcall; + +function GetOffice11Scheme: TOffice11Scheme; +begin + Result := FOffice11Scheme; +end; + +function Dark(Col: TColor; Percentage: Byte): TColor; +var + R, G, B: Byte; +begin + Col := ColorToRGB(Col); + R := GetRValue(Col); G := GetGValue(Col); B := GetBValue(Col); + R := Trunc(R * Percentage / 100); + G := Trunc(G * Percentage / 100); + B := Trunc(B * Percentage / 100); + Dark := RGB(R, G, B); +end; + +function GetLightColor(ABtnFaceColorPart, AHighlightColorPart, AWindowColorPart: Integer): COLORREF; +var + ABtnFaceColor, AHighlightColor, AWindowColor: COLORREF; + + function GetLightIndex(ABtnFaceValue, AHighlightValue, AWindowValue: Byte): Integer; + begin + Result := + MulDiv(ABtnFaceValue, ABtnFaceColorPart, 100) + + MulDiv(AHighlightValue, AHighlightColorPart, 100) + + MulDiv(AWindowValue, AWindowColorPart, 100); + if Result < 0 then Result := 0; + if Result > 255 then Result := 255; + end; + +begin + ABtnFaceColor := GetSysColor(COLOR_BTNFACE); + AHighlightColor := GetSysColor(COLOR_HIGHLIGHT); + AWindowColor := GetSysColor(COLOR_WINDOW); + if (ABtnFaceColor = 0) or (ABtnFaceColor = $FFFFFF) then + Result := AHighlightColor + else + Result := RGB( + GetLightIndex(GetRValue(ABtnFaceColor), GetRValue(AHighlightColor), GetRValue(AWindowColor)), + GetLightIndex(GetGValue(ABtnFaceColor), GetGValue(AHighlightColor), GetGValue(AWindowColor)), + GetLightIndex(GetBValue(ABtnFaceColor), GetBValue(AHighlightColor), GetBValue(AWindowColor))); +end; + +function GetMiddleRGB(AColor1, AColor2: TColor; APercent: Integer): COLORREF; + + function CalcValue(Value1, Value2: Byte): Byte; + var + I: Integer; + begin + I := MulDiv(Value1, APercent, 100) + MulDiv(Value2, 100 - APercent, 100); + if I > 255 then I := 255; + Result := I; + end; + +begin + AColor1 := ColorToRGB(AColor1); + AColor2 := ColorToRGB(AColor2); + Result := RGB( + CalcValue(GetRValue(AColor1), GetRValue(AColor2)), + CalcValue(GetGValue(AColor1), GetGValue(AColor2)), + CalcValue(GetBValue(AColor1), GetBValue(AColor2))); + Result := GetRealColor(Result); +end; + +function GetRealColor(AColor: COLORREF): COLORREF; +var + DC: HDC; +begin + DC := GetDC(0); + Result := GetNearestColor(DC, AColor); + ReleaseDC(0, DC); +end; + +function Light(Col: TColor; Percentage: Byte): TColor; +var + R, G, B: Byte; +begin + Col := ColorToRGB(Col); + R := GetRValue(Col); G := GetGValue(Col); B := GetBValue(Col); + R := Trunc(255 - Percentage / 100 * (255 - R)); + G := Trunc(255 - Percentage / 100 * (255 - G)); + B := Trunc(255 - Percentage / 100 * (255 - B)); + Light := RGB(R, G, B); +end; + +procedure PrepareSubMenuExpandBitmap(ABitmap: TBitmap); +var + I, J: Integer; + ATransparentColor, AColor1, AColor2, APixelColor: COLORREF; + AMinValue, AMaxValue, AValue: Byte; +begin + ATransparentColor := ABitmap.Canvas.Pixels[0, 0]; +// AColor := ColorToRGB(clWindow); + AColor1 := dxOffice11ToolbarsColor1; + AColor2 := dxOffice11ToolbarsColor2; + if AColor1 = AColor2 then + begin + if AColor1 = 0 then + AColor2 := $FFFFFF + else + AColor2 := 0; + end; + AMaxValue := 1; + AMinValue := 255; + for I := 0 to ABitmap.Width - 1 do + for J := 0 to ABitmap.Height - 1 do + begin + APixelColor := ABitmap.Canvas.Pixels[I, J]; + if (APixelColor <> ATransparentColor) and (APixelColor <> 0{mark}) then + begin + AValue := GetRValue(APixelColor); + if AValue > AMaxValue then + AMaxValue := AValue; + if AValue < AMinValue then + AMinValue := AValue; + end; + end; + for I := 0 to ABitmap.Width - 1 do + for J := 0 to ABitmap.Height - 1 do + begin + APixelColor := ABitmap.Canvas.Pixels[I, J]; + if (APixelColor <> ATransparentColor) and (APixelColor <> 0{mark}) then + begin +// APixelColor := GetMiddleRGB(APixelColor, AColor, 50); + AValue := GetRValue(APixelColor); + APixelColor := GetMiddleRGB(AColor1, AColor2, MulDiv(AValue - AMinValue, 100, AMaxValue - AMinValue)); + ABitmap.Canvas.Pixels[I, J] := APixelColor; + end; + end; +end; + +procedure CreateOffice11Brushes; +begin + dxOffice11BarFingerBrush1 := CreateSolidBrush(dxOffice11BarFingerColor1); + dxOffice11BarFingerBrush2 := CreateSolidBrush(dxOffice11BarFingerColor2); + dxOffice11BarSeparatorBrush1 := CreateSolidBrush(dxOffice11BarSeparatorColor1); + dxOffice11BarSeparatorBrush2 := CreateSolidBrush(dxOffice11BarSeparatorColor2); + dxOffice11DropDownBorderBrush1 := CreateSolidBrush(dxOffice11DropDownBorderColor1); + dxOffice11MenuBrush := CreateSolidBrush(dxOffice11MenuColor); + dxOffice11DropDownBorderBrush2 := dxOffice11MenuBrush; + dxOffice11SelectedBorderBrush := CreateSolidBrush(dxOffice11SelectedBorderColor); + dxOffice11OwnerControlDownedBrush := CreateSolidBrush(dxOffice11OwnerControlDownedColor); + dxOffice11DownedBrush := CreateSolidBrush(dxOffice11DownedColor); + dxOffice11DownedSelectedBrush := CreateSolidBrush(dxOffice11DownedSelectedColor); + dxOffice11DetachableBrush := CreateSolidBrush(dxOffice11DetachableColor); + dxOffice11ToolbarSelectedBrush := CreateSolidBrush(dxOffice11ToolbarSelectedColor); + dxOffice11DetachableSelectedBrush := dxOffice11ToolbarSelectedBrush; + dxOffice11StaticBorderBrush := dxOffice11DropDownBorderBrush1; + dxOffice11InPlaceSubItemBrush := CreateSolidBrush(dxOffice11InPlaceSubItemColor); + // TODO + dxOffice11SubMenuExpandBitmap := TBitmap.Create; + dxOffice11SubMenuExpandBitmap.Handle := LoadBitmap(HInstance, 'DXSUBMENUEXPAND'); + PrepareSubMenuExpandBitmap(dxOffice11SubMenuExpandBitmap); + dxOffice11ExpandButtonBitmap1 := TBitmap.Create; + dxOffice11ExpandButtonBitmap1.Handle := LoadBitmap(HInstance, 'DXEXPANDBUTTON_MINUS'); + dxOffice11ExpandButtonBitmap2 := TBitmap.Create; + dxOffice11ExpandButtonBitmap2.Handle := LoadBitmap(HInstance, 'DXEXPANDBUTTON_PLUS'); + dxOffice11ExpandButtonColor1 := RGB(158, 174, 191); + dxOffice11ExpandButtonColor2 := RGB(46, 70, 95); +end; + +procedure DestroyOffice11Brushes; +begin + dxOffice11SubMenuExpandBitmap.Free; + dxOffice11SubMenuExpandBitmap := nil; + dxOffice11ExpandButtonBitmap2.Free; + dxOffice11ExpandButtonBitmap2 := nil; + dxOffice11ExpandButtonBitmap1.Free; + dxOffice11ExpandButtonBitmap1 := nil; + if dxOffice11BarFingerBrush1 <> 0 then DeleteObject(dxOffice11BarFingerBrush1); + if dxOffice11BarFingerBrush2 <> 0 then DeleteObject(dxOffice11BarFingerBrush2); + if dxOffice11BarSeparatorBrush1 <> 0 then DeleteObject(dxOffice11BarSeparatorBrush1); + if dxOffice11BarSeparatorBrush2 <> 0 then DeleteObject(dxOffice11BarSeparatorBrush2); + if dxOffice11DropDownBorderBrush1 <> 0 then DeleteObject(dxOffice11DropDownBorderBrush1); + if dxOffice11MenuBrush <> 0 then DeleteObject(dxOffice11MenuBrush); + if dxOffice11SelectedBorderBrush <> 0 then DeleteObject(dxOffice11SelectedBorderBrush); + if dxOffice11OwnerControlDownedBrush <> 0 then DeleteObject(dxOffice11OwnerControlDownedBrush); + if dxOffice11DownedBrush <> 0 then DeleteObject(dxOffice11DownedBrush); + if dxOffice11DownedSelectedBrush <> 0 then DeleteObject(dxOffice11DownedSelectedBrush); + if dxOffice11DetachableBrush <> 0 then DeleteObject(dxOffice11DetachableBrush); + if dxOffice11ToolbarSelectedBrush <> 0 then DeleteObject(dxOffice11ToolbarSelectedBrush); + if dxOffice11InPlaceSubItemBrush <> 0 then DeleteObject(dxOffice11InPlaceSubItemBrush); +end; + +function dxGetOffice11Scheme: TOffice11Scheme; +const + SZ_MAX_CHARS = 1024; + SStandardThemeFileName = 'LUNA.MSSTYLES'; + SNormalColor = 'NORMALCOLOR'; + SHomestead = 'HOMESTEAD'; + SMetallic = 'METALLIC'; +var + PThemeFileName, PThemeColor, PThemeSize: PWideChar; + S: string; +begin + Result := schUnknown; + if AreVisualStylesAvailable([]) then + begin + PThemeFileName := AllocMem(2 * SZ_MAX_CHARS); + PThemeColor := AllocMem(2 * SZ_MAX_CHARS); + PThemeSize := AllocMem(2 * SZ_MAX_CHARS); + try + if FAILED(GetCurrentThemeName(PThemeFileName, SZ_MAX_CHARS, PThemeColor, + SZ_MAX_CHARS, PThemeSize, SZ_MAX_CHARS)) then + Exit; + S := UpperCase(ExtractFileName(PThemeFileName)); + // WindowsXP or above + if (S = SStandardThemeFileName) or (Win32MajorVersion > 5) then + begin + S := UpperCase(PThemeColor); + if S = SNormalColor then + Result := schNormalColor + else + if S = SHomestead then + Result := schHomestead + else + if S = SMetallic then + Result := schMetallic; + end; + finally + FreeMem(PThemeSize); + FreeMem(PThemeColor); + FreeMem(PThemeFileName); + end; + end; +end; + +function GetdxOffice11NavPaneGroupCaptionColor(AStartColor: Boolean): TColor; + + function TransformColorComponent(AValue: Byte): Byte; + begin + if AStartColor then + Result := AValue * 127 div 255 + 128 + else + Result := AValue + (4 - AValue * 4 div 255); + end; + +begin + Result := ColorToRGB(clBtnFace); + Result := RGB(TransformColorComponent(GetRValue(Result)), + TransformColorComponent(GetGValue(Result)), TransformColorComponent(GetBValue(Result))); + Result := GetRealColor(Result); +end; + +procedure InitOffice11Colors; +const + Office11Colors: array[TOffice11SchemeColor, 0..48] of COLORREF = ( + ($FEECDD, $E2A981, $F5BE9E, $F9DAC3, $913500, $F1A675, $76C1FF, $D3F8FF, $98DDFF, $5295FE, + $9C613B, $E0A47B, $764127, $FFFFFF, $CB8C6A, $FFF9F1, $C9662A, $F9DBC4, $962D00, $F6F6F6, + $C2EEFF, $800000, $CCF4FF, $91D0FF, $8ED3FF, $4E91FE, $FCE1CB, $6FC0FF, $3E80FE, $F0C7A9, + $000000, $8D8D8D, $FBDABE, $94E6FB, $FADAC4, $962D00, $B96837, $962D00, $FBE5D3, $E4AE88, + $DCFFFF, $5BC0F7, $94E6FB, $1595EE, $087FE8, $7CDAF7, $D68759, $933803, $FFFFFF), + ($DEF7F4, $91C6B7, $A7D9D9, $E4F0F2, $6B7760, $8CC2B0, $76C1FF, $D3F8FF, $98DDFF, $5295FE, + $588060, $8FC4B5, $335E51, $FFFFFF, $588060, $DEF7F4, $5E8674, $ADDEE1, $5E8D75, $EEF4F4, + $C2EEFF, $385D3F, $CCF4FF, $91D0FF, $8ED3FF, $4E91FE, $B6E3D8, $6FC0FF, $3E80FE, $9FD4C5, + $000000, $8D8D8D, $91BAAF, $94E6FB, $E4F1F2, $588060, $548973, $5E8D75, $DBF5F2, $97C9BC, + $DCFFFF, $5BC0F7, $94E6FB, $1595EE, $087FE8, $7CDAF7, $82C0AF, $447A63, $FFFFFF), + ($FAF4F3, $B59799, $E5D7D7, $F7F3F3, $927476, $C8B2B3, $76C1FF, $D3F8FF, $98DDFF, $5295FE, + $947C7C, $B09193, $755454, $FFFFFF, $8F6D6E, $FFFFFF, $99797A, $E4DADB, $947C7C, $FFFAFD, + $C2EEFF, $6F4B4B, $CCF4FF, $91D0FF, $8ED3FF, $4E91FE, $E7D3D6, $6FC0FF, $3E80FE, $D3C0C0, + $000000, $8D8D8D, $EBE5E5, $94E6FB, $F7F3F3, $947C7C, $916F70, $947C7C, $F8F1F0, $BA9EA0, + $DCFFFF, $5BC0F7, $94E6FB, $1595EE, $087FE8, $7CDAF7, $BFA7A8, $916F70, $FFFFFF) + ); + Office11GradientPercents: array[TOffice11SchemeColor] of Integer = (41, 125, 40); +var + I: Integer; +begin + FOffice11Scheme := dxGetOffice11Scheme; + FXPStandardScheme := AreVisualStylesAvailable([]) and (FOffice11Scheme <> schUnknown){luna}; + if FXPStandardScheme then + begin + // bk colors + dxOffice11ToolbarsColor1 := Office11Colors[FOffice11Scheme, 0]; + dxOffice11ToolbarsColor2 := Office11Colors[FOffice11Scheme, 1]; + dxOffice11DockColor1 := Office11Colors[FOffice11Scheme, 2]; + dxOffice11DockColor2 := Office11Colors[FOffice11Scheme, 3]; + // bar: mark + dxOffice11BarMarkColors2[1] := Office11Colors[FOffice11Scheme, 4]; + dxOffice11BarMarkColors1[1] := Office11Colors[FOffice11Scheme, 5]; + dxOffice11BarMarkColors2[2] := Office11Colors[FOffice11Scheme, 6]; + dxOffice11BarMarkColors1[2] := Office11Colors[FOffice11Scheme, 7]; + dxOffice11BarMarkColors2[3] := Office11Colors[FOffice11Scheme, 8]; + dxOffice11BarMarkColors1[3] := Office11Colors[FOffice11Scheme, 9]; + // bar: border + dxOffice11BarBorderColors[1] := Office11Colors[FOffice11Scheme, 10]; + dxOffice11BarBorderColors[2] := Office11Colors[FOffice11Scheme, 11]; + // bar: border and mark (Normal, Selected, Downed) + for I := 1 to 3 do + dxOffice11BarBorderMarkColors[1, I] := GetMiddleRGB(dxOffice11BarMarkColors1[I], dxOffice11ToolbarsColor1, 90); // #6 ??? + for I := 1 to 3 do + dxOffice11BarBorderMarkColors[2, I] := GetMiddleRGB(dxOffice11BarMarkColors2[I], dxOffice11BarBorderColors[2], 50); // #9 + // bar: finger + dxOffice11BarFingerColor1 := Office11Colors[FOffice11Scheme, 12]; + dxOffice11BarFingerColor2 := Office11Colors[FOffice11Scheme, 13]; + // bar: separator + dxOffice11BarSeparatorColor1 := Office11Colors[FOffice11Scheme, 14]; + dxOffice11BarSeparatorColor2 := Office11Colors[FOffice11Scheme, 15]; + // bar: mark arrow + dxOffice11BarMarkArrowColor1 := ColorToRGB(clBlack); + dxOffice11BarMarkArrowColor2 := ColorToRGB(clWhite); + // bar: floating + dxOffice11BarFloatingBorderColor1 := Office11Colors[FOffice11Scheme, 16]; + dxOffice11BarFloatingBorderColor2 := Office11Colors[FOffice11Scheme, 17]; + dxOffice11BarFloatingCaptionTextColor1 := ColorToRGB(clWhite); + dxOffice11BarFloatingCaptionTextColor2 := ColorToRGB(clBlack); + dxOffice11BarFloatingCaptionTextColor3 := ColorToRGB(clBlack); + // drop downs, menus + dxOffice11DropDownBorderColor1 := Office11Colors[FOffice11Scheme, 18]; + dxOffice11MenuColor := Office11Colors[FOffice11Scheme, 19]; + // selected + dxOffice11ToolbarSelectedColor := Office11Colors[FOffice11Scheme, 20]; + dxOffice11SelectedBorderColor := Office11Colors[FOffice11Scheme, 21]; + dxOffice11SelectedColor1 := Office11Colors[FOffice11Scheme, 22]; + dxOffice11SelectedColor2 := Office11Colors[FOffice11Scheme, 23]; + dxOffice11SelectedDownColor1 := Office11Colors[FOffice11Scheme, 24]; + dxOffice11SelectedDownColor2 := Office11Colors[FOffice11Scheme, 25]; + dxOffice11OwnerControlDownedColor := Office11Colors[FOffice11Scheme, 26]; + dxOffice11DownedColor := Office11Colors[FOffice11Scheme, 27]; + dxOffice11DownedSelectedColor := Office11Colors[FOffice11Scheme, 28]; + // detachable + dxOffice11DetachableColor := Office11Colors[FOffice11Scheme, 29]; + // text + dxOffice11TextEnabledColor := Office11Colors[FOffice11Scheme, 30]; + dxOffice11TextDisabledColor := Office11Colors[FOffice11Scheme, 31]; + // Gradient Tube Percent + GradientPercent := Office11GradientPercents[FOffice11Scheme]; + // LF + dxOffice11GroupColor := Office11Colors[FOffice11Scheme, 32]; + // Outlook day navigator + dxOffice11DayNavigatorSelectedColor := Office11Colors[FOffice11Scheme, 33]; + dxOffice11OutlookControlColor := Office11Colors[FOffice11Scheme, 34]; + dxOffice11OutlookBorderColor := Office11Colors[FOffice11Scheme, 35]; + // Office11 group row style colors + dxOffice11GroupIndentColor := $C9EEFD; + dxOffice11GroupRowSeparatorColor := dxOffice11BarBorderColors[2]; + dxOffice11GroupRowTextColor := Office11Colors[FOffice11Scheme, 36]; + // NavPane + dxOffice11NavPaneBorder := Office11Colors[FOffice11Scheme, 37]; + dxOffice11NavPaneGroupCaptionColor1 := Office11Colors[FOffice11Scheme, 38]; + dxOffice11NavPaneGroupCaptionColor2 := Office11Colors[FOffice11Scheme, 39]; + dxOffice11NavPaneGroupCaptionHotColor1 := Office11Colors[FOffice11Scheme, 40]; + dxOffice11NavPaneGroupCaptionHotColor2 := Office11Colors[FOffice11Scheme, 41]; + dxOffice11NavPaneGroupCaptionPressedColor1 := Office11Colors[FOffice11Scheme, 42]; + dxOffice11NavPaneGroupCaptionPressedColor2 := Office11Colors[FOffice11Scheme, 43]; + dxOffice11NavPaneGroupCaptionPressedHotColor1 := Office11Colors[FOffice11Scheme, 44]; + dxOffice11NavPaneGroupCaptionPressedHotColor2 := Office11Colors[FOffice11Scheme, 45]; + dxOffice11NavPaneHeaderColor1 := Office11Colors[FOffice11Scheme, 46]; + dxOffice11NavPaneHeaderColor2 := Office11Colors[FOffice11Scheme, 47]; + dxOffice11NavPaneHeaderFontColor := Office11Colors[FOffice11Scheme, 48]; + dxOffice11NavPaneSplitterColor1 := dxOffice11NavPaneHeaderColor1; + dxOffice11NavPaneSplitterColor2 := dxOffice11NavPaneHeaderColor2; + end + else + begin + // bk colors + dxOffice11DockColor1 := ColorToRGB(clBtnFace); + dxOffice11DockColor2 := GetMiddleRGB(clBtnFace, clWindow, 20); + dxOffice11ToolbarsColor1 := GetMiddleRGB(clBtnFace, clWindow, 22); + dxOffice11ToolbarsColor2 := GetMiddleRGB(clBtnFace, clWindow, 96); + // bar: mark + dxOffice11BarMarkColors2[1] := ColorToRGB(clBtnShadow); + dxOffice11BarMarkColors1[1] := GetMiddleRGB(dxOffice11BarMarkColors2[1], clWindow, 74); + // TODO + dxOffice11BarMarkColors1[2] := GetRealColor(GetLightColor(-15, 29, 100--15-29)); // Selected + // dxOffice11BarMarkColors1[2] := FlatToolbarsSelColor; + dxOffice11BarMarkColors2[2] := dxOffice11BarMarkColors1[2]; + dxOffice11BarMarkColors1[3] := GetRealColor(GetLightColor(42, 11, 100-42-11)); // Downed + dxOffice11BarMarkColors2[3] := dxOffice11BarMarkColors1[3]; + // bar: border + dxOffice11BarBorderColors[1] := GetMiddleRGB(clBtnFace, clWindow, 85); + dxOffice11BarBorderColors[2] := ColorToRGB(clBtnFace); + // bar: border and mark (Normal, Selected, Downed) + for I := 1 to 3 do + dxOffice11BarBorderMarkColors[1, I] := GetMiddleRGB(dxOffice11BarMarkColors2[I], clWindow, 50); // #6 + for I := 1 to 3 do + dxOffice11BarBorderMarkColors[2, I] := GetMiddleRGB(dxOffice11BarMarkColors2[I], dxOffice11BarBorderColors[2], 50); // #9 + // bar: finger + dxOffice11BarFingerColor1 := GetMiddleRGB(clBtnShadow, clWindow, 76); + dxOffice11BarFingerColor2 := ColorToRGB(clWindow); + // bar: separator + dxOffice11BarSeparatorColor1 := GetMiddleRGB(clBtnShadow, clWindow, 70); + dxOffice11BarSeparatorColor2 := ColorToRGB(clWhite); + // bar: mark arrow + dxOffice11BarMarkArrowColor1 := ColorToRGB(clBtnText); + dxOffice11BarMarkArrowColor2 := ColorToRGB(clWindow); + // bar: floating + dxOffice11BarFloatingBorderColor1 := ColorToRGB(clBtnShadow); + dxOffice11BarFloatingBorderColor2 := dxOffice11ToolbarsColor2; + dxOffice11BarFloatingCaptionTextColor1 := ColorToRGB(clBtnHighlight); + dxOffice11BarFloatingCaptionTextColor2 := ColorToRGB(clBtnText); + dxOffice11BarFloatingCaptionTextColor3 := ColorToRGB(clBtnText); + // drop down + dxOffice11DropDownBorderColor1 := ColorToRGB(clBtnShadow); // ? + dxOffice11MenuColor := ColorToRGB(clWindow); // ? + // selected + dxOffice11ToolbarSelectedColor := GetRealColor(GetLightColor(-2, 30, 72)); // ? + dxOffice11SelectedBorderColor := ColorToRGB(clHighlight); + dxOffice11SelectedColor1 := dxOffice11ToolbarSelectedColor; + dxOffice11SelectedColor2 := dxOffice11ToolbarSelectedColor; + dxOffice11OwnerControlDownedColor := dxOffice11ToolbarsColor2; + dxOffice11DownedColor := GetLightColor(41, 11, 48); // ? + dxOffice11DownedSelectedColor := GetRealColor(GetLightColor(14, 44, 40)); // ? + dxOffice11SelectedDownColor1 := dxOffice11DownedSelectedColor; + dxOffice11SelectedDownColor2 := dxOffice11DownedSelectedColor; + // detachable + dxOffice11DetachableColor := dxOffice11OwnerControlDownedColor; + // text + dxOffice11TextEnabledColor := ColorToRGB(clBtnText); + dxOffice11TextDisabledColor := ColorToRGB(clGrayText); + // Gradient Tube Percent + GradientPercent := 75; + // LF + dxOffice11GroupColor := ColorToRGB(clBtnFace); + // Outlook day navigator + dxOffice11DayNavigatorSelectedColor := dxOffice11DownedColor; + dxOffice11OutlookControlColor := dxOffice11DockColor1; + dxOffice11OutlookBorderColor := dxOffice11DropDownBorderColor1; + // Office11 group row style colors + dxOffice11GroupIndentColor := ColorToRGB(clBtnFace); + dxOffice11GroupRowTextColor := ColorToRGB(clBtnShadow); + dxOffice11GroupRowSeparatorColor := ColorToRGB(clBtnShadow); + // NavPane + dxOffice11NavPaneBorder := GetRealColor(ColorToRGB(clBtnShadow)); + dxOffice11NavPaneGroupCaptionColor1 := GetdxOffice11NavPaneGroupCaptionColor(True); + dxOffice11NavPaneGroupCaptionColor2 := GetdxOffice11NavPaneGroupCaptionColor(False); + dxOffice11NavPaneGroupCaptionHotColor1 := dxOffice11SelectedColor1; + dxOffice11NavPaneGroupCaptionHotColor2 := dxOffice11SelectedColor2; + dxOffice11NavPaneGroupCaptionPressedColor1 := dxOffice11DownedColor; + dxOffice11NavPaneGroupCaptionPressedColor2 := dxOffice11NavPaneGroupCaptionPressedColor1; + dxOffice11NavPaneGroupCaptionPressedHotColor1 := dxOffice11DownedSelectedColor; + dxOffice11NavPaneGroupCaptionPressedHotColor2 := dxOffice11NavPaneGroupCaptionPressedHotColor1; + dxOffice11NavPaneHeaderColor1 := dxOffice11NavPaneBorder; + dxOffice11NavPaneHeaderColor2 := dxOffice11NavPaneBorder; + dxOffice11NavPaneHeaderFontColor := ColorToRGB(clHighlightText); + dxOffice11NavPaneSplitterColor1 := GetRealColor(ColorToRGB(clBtnFace)); + dxOffice11NavPaneSplitterColor2 := dxOffice11NavPaneBorder; + end; + // bar: floating + dxOffice11BarFloatingBorderColor3 := dxOffice11ToolbarsColor1; + dxOffice11BarFloatingCaptionColor := dxOffice11BarFloatingBorderColor1; + // drop downs, menus + dxOffice11DropDownBorderColor2 := dxOffice11MenuColor; + dxOffice11MenuDownedColor1 := dxOffice11ToolbarsColor1; + dxOffice11MenuDownedColor2 := dxOffice11ToolbarsColor2; + dxOffice11MenuIndentColor1 := dxOffice11ToolbarsColor1; + dxOffice11MenuIndentColor2 := dxOffice11ToolbarsColor2; + dxOffice11MenuNonRecentIndentColor1 := GetMiddleRGB(dxOffice11MenuIndentColor1, clBlack, 92); + dxOffice11MenuNonRecentIndentColor2 := GetMiddleRGB(dxOffice11MenuIndentColor2, clBlack, 92); + // selected + dxOffice11DetachableSelectedColor := dxOffice11ToolbarSelectedColor; + // static + dxOffice11StaticBorderColor := dxOffice11DropDownBorderColor1; + // date + dxOffice11DateHeaderColor := dxOffice11DockColor1; + // inplace sub item + dxOffice11InPlaceSubItemColor := dxOffice11BarBorderMarkColors[2, 1]; + dxOffice11InPlaceSubItemTextColor := dxOffice11BarFloatingCaptionTextColor1; + // LF painters + dxOffice11ControlBorderColor := dxOffice11DropDownBorderColor1; +end; + +procedure CreateOffice11Colors; +begin + if FCounter = 0 then + begin + InitOffice11Colors; + CreateOffice11Brushes; + end; + Inc(FCounter); +end; + +procedure RefreshOffice11Colors; +begin + InitOffice11Colors; + if FCounter <> 0 then + begin + DestroyOffice11Brushes; + CreateOffice11Brushes; + end; +end; + +procedure ReleaseOffice11Colors; +begin + Dec(FCounter); + if FCounter = 0 then + DestroyOffice11Brushes; +end; + +function IsHighContrastBlack: Boolean; +begin + Result := GetSysColor(COLOR_BTNFACE) = 0; // Black +end; + +function IsHighContrastWhite: Boolean; +begin + Result := (GetSysColor(COLOR_BTNFACE) = $FFFFFF); // White +end; + +function IsHighContrast2: Boolean; +begin + Result := (GetSysColor(COLOR_BTNFACE) = 0) and (GetSysColor(COLOR_BTNTEXT) <> $FFFFFF); // #2 +end; + +function IsXPStandardScheme: Boolean; +begin + Result := FXPStandardScheme; +end; + +procedure FillGradientRect(DC: HDC; const ARect: TRect; AColor1, AColor2: TColor; + AHorizontal: Boolean); + + procedure SoftwareGradientFill(ARGBColor1, ARGBColor2: DWORD); + var + FromR, ToR, FromG, ToG, FromB, ToB: Byte; + SR: TRect; + W, I, N: Integer; + R, G, B: Byte; + begin + FromR := GetRValue(ARGBColor1); + FromG := GetGValue(ARGBColor1); + FromB := GetBValue(ARGBColor1); + ToR := GetRValue(ARGBColor2); + ToG := GetGValue(ARGBColor2); + ToB := GetBValue(ARGBColor2); + SR := ARect; + if AHorizontal then + W := SR.Right - SR.Left + else + W := SR.Bottom - SR.Top; + N := 256; + if W < N then + N := W; + for I := 0 to N - 1 do + begin + if AHorizontal then + SR.Right := ARect.Left + MulDiv(I + 1, W, N) + else + SR.Bottom := ARect.Top + MulDiv(I + 1, W, N); + R := FromR + MulDiv(I, ToR - FromR, N - 1); + G := FromG + MulDiv(I, ToG - FromG, N - 1); + B := FromB + MulDiv(I, ToB - FromB, N - 1); + if not IsRectEmpty(SR) then + FillRectByColor(DC, SR, RGB(R, G, B)); + if AHorizontal then + begin + SR.Left := SR.Right; + if SR.Left >= ARect.Right then + Break; + end + else + begin + SR.Top := SR.Bottom; + if SR.Top >= ARect.Bottom then + Break; + end; + end; + end; + + procedure SystemGradientFill(ARGBColor1, ARGBColor2: DWORD); + + procedure SetVertex(var AVertex: TTriVertex; const APoint: TPoint; ARGBColor: DWORD); + begin + AVertex.X := APoint.X; + AVertex.Y := APoint.Y; + AVertex.Red := MakeWord(0, GetRValue(ARGBColor)); + AVertex.Green := MakeWord(0, GetGValue(ARGBColor)); + AVertex.Blue := MakeWord(0, GetBValue(ARGBColor)); + AVertex.Alpha := 0; + end; + + const + AModesMap: array[Boolean] of DWORD = (GRADIENT_FILL_RECT_V, GRADIENT_FILL_RECT_H); + var + AVertices: array[0..1] of TTriVertex; + AGradientRect: TGradientRect; + begin + SetVertex(AVertices[0], ARect.TopLeft, ARGBColor1); + SetVertex(AVertices[1], ARect.BottomRight, ARGBColor2); + AGradientRect.UpperLeft := 0; + AGradientRect.LowerRight := 1; + GradientFill(DC, AVertices[0], 2, AGradientRect, 1, AModesMap[AHorizontal]); + end; + +var + ARGBColor1, ARGBColor2: DWORD; +begin + ARGBColor1 := ColorToRGB(AColor1); + ARGBColor2 := ColorToRGB(AColor2); + if ARGBColor1 = ARGBColor2 then + FillRectByColor(DC, ARect, AColor1) + else + if Assigned(GradientFill) then + SystemGradientFill(ARGBColor1, ARGBColor2) + else + SoftwareGradientFill(ARGBColor1, ARGBColor2); +end; + +procedure FillTubeGradientRect(DC: HDC; const ARect: TRect; AColor1, AColor2: TColor; + AHorizontal: Boolean); +var + FromR, FromG, FromB, ToR, ToG, ToB: Integer; + ToR1, ToG1, ToB1, ToR2, ToG2, ToB2: Integer; + SR: TRect; + W, I, N, M: Integer; + R, G, B: Byte; + ABrush: HBRUSH; +begin + AColor1 := ColorToRGB(AColor1); + AColor2 := ColorToRGB(AColor2); + if AColor1 = AColor2 then + begin + ABrush := CreateSolidBrush(AColor1); + FillRect(DC, ARect, ABrush); + DeleteObject(ABrush); + Exit; + end; + + FromR := GetRValue(AColor1); + FromG := GetGValue(AColor1); + FromB := GetBValue(AColor1); + ToR := GetRValue(AColor2); + ToG := GetGValue(AColor2); + ToB := GetBValue(AColor2); + SR := ARect; + if AHorizontal then + W := SR.Right - SR.Left + else + W := SR.Bottom - SR.Top; + M := W div 2; + ToR1 := FromR - MulDiv(FromR - ToR, GradientPercent, 200); + ToG1 := FromG - MulDiv(FromG - ToG, GradientPercent, 200); + ToB1 := FromB - MulDiv(FromB - ToB, GradientPercent, 200); + + ToR2 := FromR - MulDiv(FromR - ToR1, W, M); + ToG2 := FromG - MulDiv(FromG - ToG1, W, M); + ToB2 := FromB - MulDiv(FromB - ToB1, W, M); + +// N := 256; +// if W < N then +// N := W; + N := W; + + for I := 0 to N - 1 do + begin + if AHorizontal then + SR.Right := ARect.Left + MulDiv(I + 1, W, N) + else + SR.Bottom := ARect.Top + MulDiv(I + 1, W, N); + if I < M then + begin + R := FromR + MulDiv(I, ToR2 - FromR, N - 1); + G := FromG + MulDiv(I, ToG2 - FromG, N - 1); + B := FromB + MulDiv(I, ToB2 - FromB, N - 1); + end + else + if I = M then + begin + R := ToR1; + G := ToG1; + B := ToB1; + FromR := ToR + MulDiv(ToR1 - ToR, W, M); + FromG := ToG + MulDiv(ToG1 - ToG, W, M); + FromB := ToB + MulDiv(ToB1 - ToB, W, M); + end + else + begin + R := FromR + MulDiv(I, ToR - FromR, N - 1); + G := FromG + MulDiv(I, ToG - FromG, N - 1); + B := FromB + MulDiv(I, ToB - FromB, N - 1); + end; + + if not IsRectEmpty(SR) then + begin + ABrush := CreateSolidBrush(RGB(R, G, B)); + FillRect(DC, SR, ABrush); + DeleteObject(ABrush); + end; + if AHorizontal then + begin + SR.Left := SR.Right; + if SR.Left >= ARect.Right then + Break; + end + else + begin + SR.Top := SR.Bottom; + if SR.Top >= ARect.Bottom then + Break; + end; + end; +end; + +procedure FillRectByColor(DC: HDC; const R: TRect; AColor: TColor); +var + ABrush: HBRUSH; +begin + ABrush := CreateSolidBrush(ColorToRGB(AColor)); + FillRect(DC, R, ABrush); + DeleteObject(ABrush); +end; + +procedure FrameRectByColor(DC: HDC; const R: TRect; AColor: TColor); +var + ABrush: HBRUSH; +begin + ABrush := CreateSolidBrush(ColorToRGB(AColor)); + FrameRect(DC, R, ABrush); + DeleteObject(ABrush); +end; + +function GetGradientColorRect(const ARect: TRect; X: Integer; AColor1, AColor2: TColor; + AHorizontal: Boolean): TColorRef; +var + FromR, ToR, FromG, ToG, FromB, ToB: Byte; + ARectLeft, W, I, N: Integer; + R, G, B: Byte; +begin + AColor1 := ColorToRGB(AColor1); + AColor2 := ColorToRGB(AColor2); + FromR := GetRValue(AColor1); + FromG := GetGValue(AColor1); + FromB := GetBValue(AColor1); + ToR := GetRValue(AColor2); + ToG := GetGValue(AColor2); + ToB := GetBValue(AColor2); + if AHorizontal then + begin + ARectLeft := ARect.Left; + W := ARect.Right - ARect.Left; + end + else + begin + ARectLeft := ARect.Top; + W := ARect.Bottom - ARect.Top; + end; + N := 256; + if W < N then + N := W; + I := MulDiv(X - ARectLeft + 1, N, W) - 1; + if I < 0 then I := 0; + R := FromR + MulDiv(I, ToR - FromR, N - 1); + G := FromG + MulDiv(I, ToG - FromG, N - 1); + B := FromB + MulDiv(I, ToB - FromB, N - 1); + Result := RGB(R, G, B); +end; + +procedure Office11FrameSelectedRect(DC: HDC; const R: TRect); +begin + if IsHighContrastBlack or IsHighContrast2 then + FrameRectByColor(DC, R, clHighlightText) + else + FrameRect(DC, R, dxOffice11SelectedBorderBrush); +end; + +procedure Office11DrawFingerElements(DC: HDC; ARect: TRect; AHorizontal: Boolean; + ABrush1: HBRUSH = 0; ABrush2: HBRUSH = 0); +var + R1, R2: TRect; + W: Integer; +begin + with ARect do + R1 := Rect(Left, Top, Left + 4, Top + 4); + if AHorizontal then + begin + W := ARect.Bottom - ARect.Top; + W := W - (W div 4) * 4; + if W > 1 then W := W div 2; + OffsetRect(R1, 0, W); + end + else + begin + W := ARect.Right - ARect.Left; + W := W - (W div 4) * 4; + if W > 1 then W := W div 2; + OffsetRect(R1, W, 0); + end; + if ABrush1 = 0 then + ABrush1 := dxOffice11BarFingerBrush1; + if ABrush2 = 0 then + ABrush2 := dxOffice11BarFingerBrush2; + repeat + R2 := R1; + InflateRect(R2, -1, -1); + FillRect(DC, R2, ABrush2); + OffsetRect(R2, -1, -1); + FillRect(DC, R2, ABrush1); + if AHorizontal then + begin + OffsetRect(R1, 0, 4); + if R1.Bottom > ARect.Bottom then Break; + end + else + begin + OffsetRect(R1, 4, 0); + if R1.Right > ARect.Right then Break; + end; + until False; +end; + +procedure Office11DrawItemArrow(DC: HDC; R: TRect; ADownArrow: Boolean; + Enabled, Selected, Flat: Boolean); +var + Size: Integer; +begin + if not ADownArrow then + Size := R.Bottom - R.Top - 6 + else // atDown + Size := R.Right - R.Left - 8; + Size := (Size - 1) div 2 + Byte(Size mod 2 <> 0); + if Size < 3 then Size := 3; + Office11DrawLargeItemArrow(DC, R, ADownArrow, Size, Selected, Enabled, Flat); +end; + +procedure Office11DrawLargeItemArrow(DC: HDC; R: TRect; ADownArrow: Boolean; + Size: Integer; Selected, Enabled, Flat: Boolean); +var + Color: COLORREF; + X, Y: Integer; + P: array[1..3] of TPoint; + Pen: HPEN; + Brush: HBRUSH; + + procedure DrawEnabled; + begin + with R do + if not ADownArrow then + begin + X := (Left + Right - Size) div 2; + Y := (Top + Bottom - (2 * Size - 1)) div 2; + P[1] := Point(X, Y); + P[2] := Point(X, Y + 2 * Size - 2); + end + else // atDown + begin + X := (Left + Right - (2 * Size - 1)) div 2; + Y := (Top + Bottom - Size) div 2; + P[1] := Point(X, Y); + P[2] := Point(X + 2 * Size - 2, Y); + end; + P[3] := Point(X + Size - 1, Y + Size - 1); + + Pen := SelectObject(DC, CreatePen(PS_SOLID, 1, Color)); + Brush := SelectObject(DC, CreateSolidBrush(Color)); + Polygon(DC, P, 3); + DeleteObject(SelectObject(DC, Brush)); + DeleteObject(SelectObject(DC, Pen)); + end; + +begin + if Enabled then + begin + if Selected and IsHighContrastWhite then + Color := clWhite + else + Color := dxOffice11TextEnabledColor; + end + else + Color := dxOffice11TextDisabledColor; + DrawEnabled; +end; + +procedure Office11DrawSizeGrip(DC: HDC; ARect: TRect; + AColor1: TColor = clDefault; AColor2: TColor = clDefault); +var + ABrush1, ABrush2: HBRUSH; +begin + ABrush1 := 0; + ABrush2 := 0; + if AColor1 <> clDefault then + ABrush1 := CreateSolidBrush(ColorToRGB(AColor1)); + if AColor2 <> clDefault then + ABrush2 := CreateSolidBrush(ColorToRGB(AColor2)); + ARect := Rect(ARect.Right - 12, ARect.Bottom - 3, ARect.Right, ARect.Bottom); + Office11DrawFingerElements(DC, ARect, False, ABrush1, ABrush2); // 3 + Inc(ARect.Left, 4); + OffsetRect(ARect, 0, -4); + Office11DrawFingerElements(DC, ARect, False, ABrush1, ABrush2); // 2 + Inc(ARect.Left, 4); + OffsetRect(ARect, 0, -4); + Office11DrawFingerElements(DC, ARect, False, ABrush1, ABrush2); // 1 + if ABrush1 <> 0 then DeleteObject(ABrush1); + if ABrush2 <> 0 then DeleteObject(ABrush2); +end; + +initialization + FMsimg32Library := LoadLibrary(msimg32); + if FMsimg32Library <> 0 then + GradientFill := GetProcAddress(FMsimg32Library, 'GradientFill') + +finalization + if FMsimg32Library <> 0 then + FreeLibrary(FMsimg32Library); + +end. + diff --git a/official/x.35/XP Theme Manager/Sources/dxOffice11.res b/official/x.35/XP Theme Manager/Sources/dxOffice11.res new file mode 100644 index 00000000..680cef5f Binary files /dev/null and b/official/x.35/XP Theme Manager/Sources/dxOffice11.res differ diff --git a/official/x.35/XP Theme Manager/Sources/dxThemeConsts.pas b/official/x.35/XP Theme Manager/Sources/dxThemeConsts.pas new file mode 100644 index 00000000..14e2fe61 --- /dev/null +++ b/official/x.35/XP Theme Manager/Sources/dxThemeConsts.pas @@ -0,0 +1,1044 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressXPThemeManager } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSXPTHEMEMANAGER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxThemeConsts; + +{$I cxVer.inc} + +interface + +const + + THEMEMGR_VERSION = 1; // increment if order of props changes or + // any props are deleted (will prevent loading + // of controlsets that use older version +{$IFDEF CBUILDER11} + {$EXTERNALSYM WM_THEMECHANGED} +{$ENDIF} + WM_THEMECHANGED = $031A; + + TC_NONE = 0; + +// Parts and states + +// Class 'Window' +// Parts + WP_CAPTION = 1; + WP_SMALLCAPTION = 2; + WP_MINCAPTION = 3; + WP_SMALLMINCAPTION = 4; + WP_MAXCAPTION = 5; + WP_SMALLMAXCAPTION = 6; + WP_FRAMELEFT = 7; + WP_FRAMERIGHT = 8; + WP_FRAMEBOTTOM = 9; + WP_SMALLFRAMELEFT = 10; + WP_SMALLFRAMERIGHT = 11; + WP_SMALLFRAMEBOTTOM = 12; + WP_SYSBUTTON = 13; + WP_MDISYSBUTTON = 14; + WP_MINBUTTON = 15; + WP_MDIMINBUTTON = 16; + WP_MAXBUTTON = 17; + WP_CLOSEBUTTON = 18; + WP_SMALLCLOSEBUTTON = 19; + WP_MDICLOSEBUTTON = 20; + WP_RESTOREBUTTON = 21; + WP_MDIRESTOREBUTTON = 22; + WP_HELPBUTTON = 23; + WP_MDIHELPBUTTON = 24; + WP_HORZSCROLL = 25; + WP_HORZTHUMB = 26; + WP_VERTSCROLL = 27; + WP_VERTTHUMB = 28; + WP_DIALOG = 29; + WP_CAPTIONSIZINGTEMPLATE = 30; + WP_SMALLCAPTIONSIZINGTEMPLATE = 31; + WP_FRAMELEFTSIZINGTEMPLATE = 32; + WP_SMALLFRAMELEFTSIZINGTEMPLATE = 33; + WP_FRAMERIGHTSIZINGTEMPLATE = 34; + WP_SMALLFRAMERIGHTSIZINGTEMPLATE = 35; + WP_FRAMEBOTTOMSIZINGTEMPLATE = 36; + WP_SMALLFRAMEBOTTOMSIZINGTEMPLATE = 37; +// States + FS_ACTIVE = 1; + FS_INACTIVE = 2; + CS_ACTIVE = 1; + CS_INACTIVE = 2; + CS_DISABLED = 3; + MXCS_ACTIVE = 1; + MXCS_INACTIVE = 2; + MXCS_DISABLED = 3; + MNCS_ACTIVE = 1; + MNCS_INACTIVE = 2; + MNCS_DISABLED = 3; + HSS_NORMAL = 1; + HSS_HOT = 2; + HSS_PUSHED = 3; + HSS_DISABLED = 4; + HTS_NORMAL = 1; + HTS_HOT = 2; + HTS_PUSHED = 3; + HTS_DISABLED = 4; + VSS_NORMAL = 1; + VSS_HOT = 2; + VSS_PUSHED = 3; + VSS_DISABLED = 4; + VTS_NORMAL = 1; + VTS_HOT = 2; + VTS_PUSHED = 3; + VTS_DISABLED = 4; + SBS_NORMAL = 1; + SBS_HOT = 2; + SBS_PUSHED = 3; + SBS_DISABLED = 4; + MINBS_NORMAL = 1; + MINBS_HOT = 2; + MINBS_PUSHED = 3; + MINBS_DISABLED = 4; + MAXBS_NORMAL = 1; + MAXBS_HOT = 2; + MAXBS_PUSHED = 3; + MAXBS_DISABLED = 4; + RBS_NORMAL = 1; + RBS_HOT = 2; + RBS_PUSHED = 3; + RBS_DISABLED = 4; + HBS_NORMAL = 1; + HBS_HOT = 2; + HBS_PUSHED = 3; + HBS_DISABLED = 4; + CBS_NORMAL = 1; + CBS_HOT = 2; + CBS_PUSHED = 3; + CBS_DISABLED = 4; + +// Class 'Button' +// Parts + BP_PUSHBUTTON = 1; + BP_RADIOBUTTON = 2; + BP_CHECKBOX = 3; + BP_GROUPBOX = 4; + BP_USERBUTTON = 5; +// States + PBS_NORMAL = 1; + PBS_HOT = 2; + PBS_PRESSED = 3; + PBS_DISABLED = 4; + PBS_DEFAULTED = 5; + RBS_UNCHECKEDNORMAL = 1; + RBS_UNCHECKEDHOT = 2; + RBS_UNCHECKEDPRESSED = 3; + RBS_UNCHECKEDDISABLED = 4; + RBS_CHECKEDNORMAL = 5; + RBS_CHECKEDHOT = 6; + RBS_CHECKEDPRESSED = 7; + RBS_CHECKEDDISABLED = 8; + CBS_UNCHECKEDNORMAL = 1; + CBS_UNCHECKEDHOT = 2; + CBS_UNCHECKEDPRESSED = 3; + CBS_UNCHECKEDDISABLED = 4; + CBS_CHECKEDNORMAL = 5; + CBS_CHECKEDHOT = 6; + CBS_CHECKEDPRESSED = 7; + CBS_CHECKEDDISABLED = 8; + CBS_MIXEDNORMAL = 9; + CBS_MIXEDHOT = 10; + CBS_MIXEDPRESSED = 11; + CBS_MIXEDDISABLED = 12; + GBS_NORMAL = 1; + GBS_DISABLED = 2; + +// Class 'Rebar' +// Parts + RP_GRIPPER = 1; + RP_GRIPPERVERT = 2; + RP_BAND = 3; + RP_CHEVRON = 4; + RP_CHEVRONVERT = 5; +// States + CHEVS_NORMAL = 1; + CHEVS_HOT = 2; + CHEVS_PRESSED = 3; + +// Class 'Toolbar' +// Parts + TP_BUTTON = 1; + TP_DROPDOWNBUTTON = 2; + TP_SPLITBUTTON = 3; + TP_SPLITBUTTONDROPDOWN = 4; + TP_SEPARATOR = 5; + TP_SEPARATORVERT = 6; +// States + TS_NORMAL = 1; + TS_HOT = 2; + TS_PRESSED = 3; + TS_DISABLED = 4; + TS_CHECKED = 5; + TS_HOTCHECKED = 6; +// Class 'Status' +// Parts + SP_PANE = 1; + SP_GRIPPERPANE = 2; + SP_GRIPPER = 3; + +// Class 'Menu' +// Parts + MP_MENUITEM = 1; + MP_MENUDROPDOWN = 2; + MP_MENUBARITEM = 3; + MP_MENUBARDROPDOWN = 4; + MP_CHEVRON = 5; + MP_SEPARATOR = 6; +// States + MS_NORMAL = 1; + MS_SELECTED = 2; + MS_DEMOTED = 3; + +// Class 'ListBox' +// Parts + LBCP_BORDER_HSCROLL = 1; + LBCP_BORDER_HVSCROLL = 2; + LBCP_BORDER_NOSCROLL = 3; + LBCP_BORDER_VSCROLL = 4; + LBCP_ITEM = 5; +// States + LBPSN_NORMAL = 1; + LBPSN_FOCUSED = 2; + LBPSN_HOT = 3; + LBPSN_DISABLED = 4; + +// Class 'ListView' +// Parts + LVP_LISTITEM = 1; + LVP_LISTGROUP = 2; + LVP_LISTDETAIL = 3; + LVP_LISTSORTEDDETAIL = 4; + LVP_EMPTYTEXT = 5; +// States + LIS_NORMAL = 1; + LIS_HOT = 2; + LIS_SELECTED = 3; + LIS_DISABLED = 4; + LIS_SELECTEDNOTFOCUS = 5; + +// Class 'Header' +// Parts + HP_HEADERITEM = 1; + HP_HEADERITEMLEFT = 2; + HP_HEADERITEMRIGHT = 3; + HP_HEADERSORTARROW = 4; +// States + HIS_NORMAL = 1; + HIS_HOT = 2; + HIS_PRESSED = 3; + HILS_NORMAL = 1; + HILS_HOT = 2; + HILS_PRESSED = 3; + HIRS_NORMAL = 1; + HIRS_HOT = 2; + HIRS_PRESSED = 3; + HSAS_SORTEDUP = 1; + HSAS_SORTEDDOWN = 2; + +// Class 'Progress' +// Parts + PP_BAR = 1; + PP_BARVERT = 2; + PP_CHUNK = 3; + PP_CHUNKVERT = 4; + +// Class 'Tab' +// Parts + TABP_TABITEM = 1; + TABP_TABITEMLEFTEDGE = 2; + TABP_TABITEMRIGHTEDGE = 3; + TABP_TABITEMBOTHEDGE = 4; + TABP_TOPTABITEM = 5; + TABP_TOPTABITEMLEFTEDGE = 6; + TABP_TOPTABITEMRIGHTEDGE = 7; + TABP_TOPTABITEMBOTHEDGE = 8; + TABP_PANE = 9; + TABP_BODY = 10; +// States + TIS_NORMAL = 1; + TIS_HOT = 2; + TIS_SELECTED = 3; + TIS_DISABLED = 4; + TIS_FOCUSED = 5; + TILES_NORMAL = 1; + TILES_HOT = 2; + TILES_SELECTED = 3; + TILES_DISABLED = 4; + TILES_FOCUSED = 5; + TIRES_NORMAL = 1; + TIRES_HOT = 2; + TIRES_SELECTED = 3; + TIRES_DISABLED = 4; + TIRES_FOCUSED = 5; + TIBES_NORMAL = 1; + TIBES_HOT = 2; + TIBES_SELECTED = 3; + TIBES_DISABLED = 4; + TIBES_FOCUSED = 5; + TTIS_NORMAL = 1; + TTIS_HOT = 2; + TTIS_SELECTED = 3; + TTIS_DISABLED = 4; + TTIS_FOCUSED = 5; + TTILES_NORMAL = 1; + TTILES_HOT = 2; + TTILES_SELECTED = 3; + TTILES_DISABLED = 4; + TTILES_FOCUSED = 5; + TTIRES_NORMAL = 1; + TTIRES_HOT = 2; + TTIRES_SELECTED = 3; + TTIRES_DISABLED = 4; + TTIRES_FOCUSED = 5; + TTIBES_NORMAL = 1; + TTIBES_HOT = 2; + TTIBES_SELECTED = 3; + TTIBES_DISABLED = 4; + TTIBES_FOCUSED = 5; + +// Class 'Trackbar' +// Parts + TKP_TRACK = 1; + TKP_TRACKVERT = 2; + TKP_THUMB = 3; + TKP_THUMBBOTTOM = 4; + TKP_THUMBTOP = 5; + TKP_THUMBVERT = 6; + TKP_THUMBLEFT = 7; + TKP_THUMBRIGHT = 8; + TKP_TICS = 9; + TKP_TICSVERT = 10; +// States + TKS_NORMAL = 1; + TRS_NORMAL = 1; + TRVS_NORMAL = 1; + TUS_NORMAL = 1; + TUS_HOT = 2; + TUS_PRESSED = 3; + TUS_FOCUSED = 4; + TUS_DISABLED = 5; + TUBS_NORMAL = 1; + TUBS_HOT = 2; + TUBS_PRESSED = 3; + TUBS_FOCUSED = 4; + TUBS_DISABLED = 5; + TUTS_NORMAL = 1; + TUTS_HOT = 2; + TUTS_PRESSED = 3; + TUTS_FOCUSED = 4; + TUTS_DISABLED = 5; + TUVS_NORMAL = 1; + TUVS_HOT = 2; + TUVS_PRESSED = 3; + TUVS_FOCUSED = 4; + TUVS_DISABLED = 5; + TUVLS_NORMAL = 1; + TUVLS_HOT = 2; + TUVLS_PRESSED = 3; + TUVLS_FOCUSED = 4; + TUVLS_DISABLED = 5; + TUVRS_NORMAL = 1; + TUVRS_HOT = 2; + TUVRS_PRESSED = 3; + TUVRS_FOCUSED = 4; + TUVRS_DISABLED = 5; + TSS_NORMAL = 1; + TSVS_NORMAL = 1; + +// Class 'Tooltips' +// Parts + TTP_STANDARD = 1; + TTP_STANDARDTITLE = 2; + TTP_BALLOON = 3; + TTP_BALLOONTITLE = 4; + TTP_CLOSE = 5; +// States + TTCS_NORMAL = 1; + TTCS_HOT = 2; + TTCS_PRESSED = 3; + TTSS_NORMAL = 1; + TTSS_LINK = 2; + TTBS_NORMAL = 1; + TTBS_LINK = 2; + +// Class 'TreeView' +// Parts + TVP_TREEITEM = 1; + TVP_GLYPH = 2; + TVP_BRANCH = 3; +// States + TREIS_NORMAL = 1; + TREIS_HOT = 2; + TREIS_SELECTED = 3; + TREIS_DISABLED = 4; + TREIS_SELECTEDNOTFOCUS = 5; + GLPS_CLOSED = 1; + GLPS_OPENED = 2; + +// Class 'Spin' +// Parts + SPNP_UP = 1; + SPNP_DOWN = 2; + SPNP_UPHORZ = 3; + SPNP_DOWNHORZ = 4; +// States + UPS_NORMAL = 1; + UPS_HOT = 2; + UPS_PRESSED = 3; + UPS_DISABLED = 4; + DNS_NORMAL = 1; + DNS_HOT = 2; + DNS_PRESSED = 3; + DNS_DISABLED = 4; + UPHZS_NORMAL = 1; + UPHZS_HOT = 2; + UPHZS_PRESSED = 3; + UPHZS_DISABLED = 4; + DNHZS_NORMAL = 1; + DNHZS_HOT = 2; + DNHZS_PRESSED = 3; + DNHZS_DISABLED = 4; + +// Class 'Page' +// Parts + PGRP_UP = 1; + PGRP_DOWN = 2; + PGRP_UPHORZ = 3; + PGRP_DOWNHORZ = 4; + +// Class 'Scrollbar' +// Parts + SBP_ARROWBTN = 1; + SBP_THUMBBTNHORZ = 2; + SBP_THUMBBTNVERT = 3; + SBP_LOWERTRACKHORZ = 4; + SBP_UPPERTRACKHORZ = 5; + SBP_LOWERTRACKVERT = 6; + SBP_UPPERTRACKVERT = 7; + SBP_GRIPPERHORZ = 8; + SBP_GRIPPERVERT = 9; + SBP_SIZEBOX = 10; +// States + ABS_UPNORMAL = 1; + ABS_UPHOT = 2; + ABS_UPPRESSED = 3; + ABS_UPDISABLED = 4; + ABS_DOWNNORMAL = 5; + ABS_DOWNHOT = 6; + ABS_DOWNPRESSED = 7; + ABS_DOWNDISABLED = 8; + ABS_LEFTNORMAL = 9; + ABS_LEFTHOT = 10; + ABS_LEFTPRESSED = 11; + ABS_LEFTDISABLED = 12; + ABS_RIGHTNORMAL = 13; + ABS_RIGHTHOT = 14; + ABS_RIGHTPRESSED = 15; + ABS_RIGHTDISABLED = 16; + SCRBS_NORMAL = 1; + SCRBS_HOT = 2; + SCRBS_PRESSED = 3; + SCRBS_DISABLED = 4; + SZB_RIGHTALIGN = 1; + SZB_LEFTALIGN = 2; + +// Class 'Edit' +// Parts + EP_EDITTEXT = 1; + EP_CARET = 2; + { For Windows >= Vista } + EP_BACKGROUND = 3; + EP_PASSWORD = 4; + EP_BACKGROUNDWITHBORDER = 5; + EP_EDITBORDER_NOSCROLL = 6; + EP_EDITBORDER_HSCROLL = 7; + EP_EDITBORDER_VSCROLL = 8; + EP_EDITBORDER_HVSCROLL = 9; +// States + ETS_NORMAL = 1; + ETS_HOT = 2; + ETS_SELECTED = 3; + ETS_DISABLED = 4; + ETS_FOCUSED = 5; + ETS_READONLY = 6; + ETS_ASSIST = 7; + +// Class 'ComboBox' +// Parts + CP_DROPDOWNBUTTON = 1; + { For Windows >= Vista } + CP_BACKGROUND = 2; + CP_TRANSPARENTBACKGROUND = 3; + CP_BORDER = 4; + CP_READONLY = 5; + CP_DROPDOWNBUTTONRIGHT = 6; + CP_DROPDOWNBUTTONLEFT = 7; + CP_CUEBANNER = 8; +// States + CBXS_NORMAL = 1; + CBXS_HOT = 2; + CBXS_PRESSED = 3; + CBXS_DISABLED = 4; + +// Class 'Taskbar Clock' +// Parts + CLP_TIME = 1; +// States + CLS_NORMAL = 1; + +// Class 'Tray Notify' +// Parts + TNP_BACKGROUND = 1; + TNP_ANIMBACKGROUND = 2; + +// Class 'TaskBar' +// Parts + TBP_BACKGROUNDBOTTOM = 1; + TBP_BACKGROUNDRIGHT = 2; + TBP_BACKGROUNDTOP = 3; + TBP_BACKGROUNDLEFT = 4; + TBP_SIZINGBARBOTTOM = 5; + TBP_SIZINGBARRIGHT = 6; + TBP_SIZINGBARTOP = 7; + TBP_SIZINGBARLEFT = 8; + +// Class 'TaskBand' +// Parts + TDP_GROUPCOUNT = 1; + TDP_FLASHBUTTON = 2; + TDP_FLASHBUTTONGROUPMENU = 3; + +// Class 'StartPanel' +// Parts + SPP_USERPANE = 1; + SPP_MOREPROGRAMS = 2; + SPP_MOREPROGRAMSARROW = 3; + SPP_PROGLIST = 4; + SPP_PROGLISTSEPARATOR = 5; + SPP_PLACESLIST = 6; + SPP_PLACESLISTSEPARATOR = 7; + SPP_LOGOFF = 8; + SPP_LOGOFFBUTTONS = 9; + SPP_USERPICTURE = 10; + SPP_PREVIEW = 11; +// States + SPS_NORMAL = 1; + SPS_HOT = 2; + SPS_PRESSED = 3; + SPLS_NORMAL = 1; + SPLS_HOT = 2; + SPLS_PRESSED = 3; + +// Class 'ExplorerBar' +// Parts + EBP_HEADERBACKGROUND = 1; + EBP_HEADERCLOSE = 2; + EBP_HEADERPIN = 3; + EBP_IEBARMENU = 4; + EBP_NORMALGROUPBACKGROUND = 5; + EBP_NORMALGROUPCOLLAPSE = 6; + EBP_NORMALGROUPEXPAND = 7; + EBP_NORMALGROUPHEAD = 8; + EBP_SPECIALGROUPBACKGROUND = 9; + EBP_SPECIALGROUPCOLLAPSE = 10; + EBP_SPECIALGROUPEXPAND = 11; + EBP_SPECIALGROUPHEAD = 12; +// States + EBHC_NORMAL = 1; + EBHC_HOT = 2; + EBHC_PRESSED = 3; + EBHP_NORMAL = 1; + EBHP_HOT = 2; + EBHP_PRESSED = 3; + EBHP_SELECTEDNORMAL = 4; + EBHP_SELECTEDHOT = 5; + EBHP_SELECTEDPRESSED = 6; + EBM_NORMAL = 1; + EBM_HOT = 2; + EBM_PRESSED = 3; + EBNGC_NORMAL = 1; + EBNGC_HOT = 2; + EBNGC_PRESSED = 3; + EBNGE_NORMAL = 1; + EBNGE_HOT = 2; + EBNGE_PRESSED = 3; + EBSGC_NORMAL = 1; + EBSGC_HOT = 2; + EBSGC_PRESSED = 3; + EBSGE_NORMAL = 1; + EBSGE_HOT = 2; + EBSGE_PRESSED = 3; + +// Class 'TaskBand' +// Parts + MDP_NEWAPPBUTTON = 1; + MDP_SEPERATOR = 2; +// States + MDS_NORMAL = 1; + MDS_HOT = 2; + MDS_PRESSED = 3; + MDS_DISABLED = 4; + MDS_CHECKED = 5; + MDS_HOTCHECKED = 6; + +// Consts (part of UxTheme API) + + BT_IMAGEFILE = 0; + BT_BORDERFILL = 1; + BT_NONE = 2; + + IL_VERTICAL = 0; + IL_HORIZONTAL = 1; + + BT_RECT = 0; + BT_ROUNDRECT = 1; + BT_ELLIPSE = 2; + + FT_SOLID = 0; + FT_VERTGRADIENT = 1; + FT_HORZGRADIENT = 2; + FT_RADIALGRADIENT = 3; + FT_TILEIMAGE = 4; + + ST_TRUESIZE = 0; + ST_STRETCH = 1; + ST_TILE = 2; + + HA_LEFT = 0; + HA_CENTER = 1; + HA_RIGHT = 2; + + CA_LEFT = 0; + CA_CENTER = 1; + CA_RIGHT = 2; + + VA_TOP = 0; + VA_CENTER = 1; + VA_BOTTOM = 2; + + OT_TOPLEFT = 0; + OT_TOPRIGHT = 1; + OT_TOPMIDDLE = 2; + OT_BOTTOMLEFT = 3; + OT_BOTTOMRIGHT = 4; + OT_BOTTOMMIDDLE = 5; + OT_MIDDLELEFT = 6; + OT_MIDDLERIGHT = 7; + OT_LEFTOFCAPTION = 8; + OT_RIGHTOFCAPTION = 9; + OT_LEFTOFLASTBUTTON = 10; + OT_RIGHTOFLASTBUTTON = 11; + OT_ABOVELASTBUTTON = 12; + OT_BELOWLASTBUTTON = 13; + + ICE_NONE = 0; + ICE_GLOW = 1; + ICE_SHADOW = 2; + ICE_PULSE = 3; + ICE_ALPHA = 4; + + TST_NONE = 0; + TST_SINGLE = 1; + TST_CONTINUOUS = 2; + + GT_NONE = 0; + GT_IMAGEGLYPH = 1; + GT_FONTGLYPH = 2; + + IST_NONE = 0; + IST_SIZE = 1; + IST_DPI = 2; + + TSST_NONE = 0; + TSST_SIZE = 1; + TSST_DPI = 2; + + GFST_NONE = 0; + GFST_SIZE = 1; + GFST_DPI = 2; + +// Properties used by UxTheme rendering and controls (part of UxTheme API) + +// primitive types + TMT_STRING = 201; + TMT_INT = 202; + TMT_BOOL = 203; + TMT_COLOR = 204; + TMT_MARGINS = 205; + TMT_FILENAME = 206; + TMT_SIZE = 207; + TMT_POSITION = 208; + TMT_RECT = 209; + TMT_FONT = 210; + TMT_INTLIST = 211; + +// special misc. properties + TMT_COLORSCHEMES = 401; + TMT_SIZES = 402; + TMT_CHARSET = 403; + +// [documentation] properties + TMT_DISPLAYNAME = 601; + TMT_TOOLTIP = 602; + TMT_COMPANY = 603; + TMT_AUTHOR = 604; + TMT_COPYRIGHT = 605; + TMT_URL = 606; + TMT_VERSION = 607; + TMT_DESCRIPTION = 608; + +// TODO +// {$IFNDEF BCB} + TMT_FIRST_RCSTRING_NAME = TMT_DISPLAYNAME; + TMT_LAST_RCSTRING_NAME = TMT_DESCRIPTION; +// {$ENDIF BCB} + +// theme metrics: fonts + TMT_CAPTIONFONT = 801; + TMT_SMALLCAPTIONFONT = 802; + TMT_MENUFONT = 803; + TMT_STATUSFONT = 804; + TMT_MSGBOXFONT = 805; + TMT_ICONTITLEFONT = 806; + +// TODO +// {$IFNDEF BCB} + TMT_FIRSTFONT = TMT_CAPTIONFONT; + TMT_LASTFONT = TMT_ICONTITLEFONT; +// {$ENDIF BCB} + +// theme metrics: bools + TMT_FLATMENUS = 1001; + +// TODO +// {$IFNDEF BCB} + TMT_FIRSTBOOL = TMT_FLATMENUS; + TMT_LASTBOOL = TMT_FLATMENUS; +// {$ENDIF BCB} + +// theme metrics: sizes + TMT_SIZINGBORDERWIDTH = 1201; + TMT_SCROLLBARWIDTH = 1202; + TMT_SCROLLBARHEIGHT = 1203; + TMT_CAPTIONBARWIDTH = 1204; + TMT_CAPTIONBARHEIGHT = 1205; + TMT_SMCAPTIONBARWIDTH = 1206; + TMT_SMCAPTIONBARHEIGHT = 1207; + TMT_MENUBARWIDTH = 1208; + TMT_MENUBARHEIGHT = 1209; + +// TODO +//{$IFNDEF BCB} + TMT_FIRSTSIZE = TMT_SIZINGBORDERWIDTH; + TMT_LASTSIZE = TMT_MENUBARHEIGHT; +//{$ENDIF BCB} + +// theme metrics: ints + TMT_MINCOLORDEPTH = 1301; + +// TODO +// {$IFNDEF BCB} + TMT_FIRSTINT = TMT_MINCOLORDEPTH; + TMT_LASTINT = TMT_MINCOLORDEPTH; +// {$ENDIF BCB} + +// theme metrics: strings + TMT_CSSNAME = 1401; + TMT_XMLNAME = 1402; + +// TODO +// {$IFNDEF BCB} + TMT_FIRSTSTRING = TMT_CSSNAME; + TMT_LASTSTRING = TMT_XMLNAME; +// {$ENDIF BCB} + +// theme metrics: colors + TMT_SCROLLBAR = 1601; + TMT_BACKGROUND = 1602; + TMT_ACTIVECAPTION = 1603; + TMT_INACTIVECAPTION = 1604; + TMT_MENU = 1605; + TMT_WINDOW = 1606; + TMT_WINDOWFRAME = 1607; + TMT_MENUTEXT = 1608; + TMT_WINDOWTEXT = 1609; + TMT_CAPTIONTEXT = 1610; + TMT_ACTIVEBORDER = 1611; + TMT_INACTIVEBORDER = 1612; + TMT_APPWORKSPACE = 1613; + TMT_HIGHLIGHT = 1614; + TMT_HIGHLIGHTTEXT = 1615; + TMT_BTNFACE = 1616; + TMT_BTNSHADOW = 1617; + TMT_GRAYTEXT = 1618; + TMT_BTNTEXT = 1619; + TMT_INACTIVECAPTIONTEXT = 1620; + TMT_BTNHIGHLIGHT = 1621; + TMT_DKSHADOW3D = 1622; + TMT_LIGHT3D = 1623; + TMT_INFOTEXT = 1624; + TMT_INFOBK = 1625; + TMT_BUTTONALTERNATEFACE = 1626; + TMT_HOTTRACKING = 1627; + TMT_GRADIENTACTIVECAPTION = 1628; + TMT_GRADIENTINACTIVECAPTION = 1629; + TMT_MENUHILIGHT = 1630; + TMT_MENUBAR = 1631; + +// TODO +// {$IFNDEF BCB} + TMT_FIRSTCOLOR = TMT_SCROLLBAR; + TMT_LASTCOLOR = TMT_MENUBAR; +// {$ENDIF BCB} + +// hue substitutions + TMT_FROMHUE1 = 1801; + TMT_FROMHUE2 = 1802; + TMT_FROMHUE3 = 1803; + TMT_FROMHUE4 = 1804; + TMT_FROMHUE5 = 1805; + TMT_TOHUE1 = 1806; + TMT_TOHUE2 = 1807; + TMT_TOHUE3 = 1808; + TMT_TOHUE4 = 1809; + TMT_TOHUE5 = 1810; + +// color substitutions + TMT_FROMCOLOR1 = 2001; + TMT_FROMCOLOR2 = 2002; + TMT_FROMCOLOR3 = 2003; + TMT_FROMCOLOR4 = 2004; + TMT_FROMCOLOR5 = 2005; + TMT_TOCOLOR1 = 2006; + TMT_TOCOLOR2 = 2007; + TMT_TOCOLOR3 = 2008; + TMT_TOCOLOR4 = 2009; + TMT_TOCOLOR5 = 2010; + +// rendering BOOL properties + TMT_TRANSPARENT = 2201; + TMT_AUTOSIZE = 2202; + TMT_BORDERONLY = 2203; + TMT_COMPOSITED = 2204; + TMT_BGFILL = 2205; + TMT_GLYPHTRANSPARENT = 2206; + TMT_GLYPHONLY = 2207; + TMT_ALWAYSSHOWSIZINGBAR = 2208; + TMT_MIRRORIMAGE = 2209; + TMT_UNIFORMSIZING = 2210; + TMT_INTEGRALSIZING = 2211; + TMT_SOURCEGROW = 2212; + TMT_SOURCESHRINK = 2213; + +// rendering INT properties + TMT_IMAGECOUNT = 2401; + TMT_ALPHALEVEL = 2402; + TMT_BORDERSIZE = 2403; + TMT_ROUNDCORNERWIDTH = 2404; + TMT_ROUNDCORNERHEIGHT = 2405; + TMT_GRADIENTRATIO1 = 2406; + TMT_GRADIENTRATIO2 = 2407; + TMT_GRADIENTRATIO3 = 2408; + TMT_GRADIENTRATIO4 = 2409; + TMT_GRADIENTRATIO5 = 2410; + TMT_PROGRESSCHUNKSIZE = 2411; + TMT_PROGRESSSPACESIZE = 2412; + TMT_SATURATION = 2413; + TMT_TEXTBORDERSIZE = 2414; + TMT_ALPHATHRESHOLD = 2415; + TMT_WIDTH = 2416; + TMT_HEIGHT = 2417; + TMT_GLYPHINDEX = 2418; + TMT_TRUESIZESTRETCHMARK = 2419; + TMT_MINDPI1 = 2420; + TMT_MINDPI2 = 2421; + TMT_MINDPI3 = 2422; + TMT_MINDPI4 = 2423; + TMT_MINDPI5 = 2424; + +// rendering FONT properties + TMT_GLYPHFONT = 2601; + +// rendering INTLIST properties +// start with 2801 (from smallest to largest) + +// rendering FILENAME properties + TMT_IMAGEFILE = 3001; + TMT_IMAGEFILE1 = 3002; + TMT_IMAGEFILE2 = 3003; + TMT_IMAGEFILE3 = 3004; + TMT_IMAGEFILE4 = 3005; + TMT_IMAGEFILE5 = 3006; + TMT_STOCKIMAGEFILE = 3007; + TMT_GLYPHIMAGEFILE = 3008; + +// rendering STRING properties + TMT_TEXT = 3201; + +// rendering POSITION (x and y values) properties + TMT_OFFSET = 3401; + TMT_TEXTSHADOWOFFSET = 3402; + TMT_MINSIZE = 3403; + TMT_MINSIZE1 = 3404; + TMT_MINSIZE2 = 3405; + TMT_MINSIZE3 = 3406; + TMT_MINSIZE4 = 3407; + TMT_MINSIZE5 = 3408; + TMT_NORMALSIZE = 3409; + +// rendering MARGIN properties + TMT_SIZINGMARGINS = 3601; + TMT_CONTENTMARGINS = 3602; + TMT_CAPTIONMARGINS = 3603; + +// rendering COLOR properties + TMT_BORDERCOLOR = 3801; + TMT_FILLCOLOR = 3802; + TMT_TEXTCOLOR = 3803; + TMT_EDGELIGHTCOLOR = 3804; + TMT_EDGEHIGHLIGHTCOLOR = 3805; + TMT_EDGESHADOWCOLOR = 3806; + TMT_EDGEDKSHADOWCOLOR = 3807; + TMT_EDGEFILLCOLOR = 3808; + TMT_TRANSPARENTCOLOR = 3809; + TMT_GRADIENTCOLOR1 = 3810; + TMT_GRADIENTCOLOR2 = 3811; + TMT_GRADIENTCOLOR3 = 3812; + TMT_GRADIENTCOLOR4 = 3813; + TMT_GRADIENTCOLOR5 = 3814; + TMT_SHADOWCOLOR = 3815; + TMT_GLOWCOLOR = 3816; + TMT_TEXTBORDERCOLOR = 3817; + TMT_TEXTSHADOWCOLOR = 3818; + TMT_GLYPHTEXTCOLOR = 3819; + TMT_GLYPHTRANSPARENTCOLOR = 3820; + TMT_FILLCOLORHINT = 3821; + TMT_BORDERCOLORHINT = 3822; + TMT_ACCENTCOLORHINT = 3823; + +// rendering enum properties (must be declared in TM_ENUM section above) + TMT_BGTYPE = 4001; + TMT_BORDERTYPE = 4002; + TMT_FILLTYPE = 4003; + TMT_SIZINGTYPE = 4004; + TMT_HALIGN = 4005; + TMT_CONTENTALIGNMENT = 4006; + TMT_VALIGN = 4007; + TMT_OFFSETTYPE = 4008; + TMT_ICONEFFECT = 4009; + TMT_TEXTSHADOWTYPE = 4010; + TMT_IMAGELAYOUT = 4011; + TMT_GLYPHTYPE = 4012; + TMT_IMAGESELECTTYPE = 4013; + TMT_GLYPHFONTSIZINGTYPE = 4014; + TMT_TRUESIZESCALINGTYPE = 4015; + +// custom properties (used only by controls/shell) + TMT_USERPICTURE = 5001; + TMT_DEFAULTPANESIZE = 5002; + TMT_BLENDCOLOR = 5003; + +// DrawThemeText() flags + DTT_GRAYED = $1; + +// HitTestThemeBackground(), HitTestThemeBackgroundRegion() flags + HTTB_BACKGROUNDSEG = $0; + +// Fixed border hit test option + HTTB_FIXEDBORDER = $2; + +// Caption hit test option + HTTB_CAPTION = $4; + +// Resizing border hit test flags + HTTB_RESIZINGBORDER_LEFT = $10; + HTTB_RESIZINGBORDER_TOP = $20; + HTTB_RESIZINGBORDER_RIGHT = $40; + HTTB_RESIZINGBORDER_BOTTOM = $80; + HTTB_RESIZINGBORDER = HTTB_RESIZINGBORDER_LEFT or HTTB_RESIZINGBORDER_TOP or + HTTB_RESIZINGBORDER_RIGHT or HTTB_RESIZINGBORDER_BOTTOM; + HTTB_SIZINGTEMPLATE = $100; + HTTB_SYSTEMSIZINGMARGINS = $200; + +(*// DrawThemeLine() flags + DTL_LEFT = $1; + DTL_TOP = $2; + DTL_RIGHT = $4; + DTL_BOTTOM = $8;*) + + ETDT_DISABLE = $1; + ETDT_ENABLE = $2; + ETDT_USETABTEXTURE = $4; + ETDT_ENABLETAB = ETDT_ENABLE or ETDT_USETABTEXTURE; + +// flags to control theming within an app + STAP_ALLOW_NONCLIENT = $1; + STAP_ALLOW_CONTROLS = $2; + STAP_ALLOW_WEBCONTENT = $4; + + SZ_THDOCPROP_DISPLAYNAME = 'DisplayName'; + SZ_THDOCPROP_CANONICALNAME = 'ThemeName'; + SZ_THDOCPROP_TOOLTIP = 'ToolTip'; + SZ_THDOCPROP_AUTHOR = 'author'; + + TS_MIN = 0; + TS_TRUE = 1; + TS_DRAW = 2; + +//vista extension + DTT_TEXTCOLOR = (1 shl 0); // crText has been specified + DTT_BORDERCOLOR = (1 shl 1); // crBorder has been specified + DTT_SHADOWCOLOR = (1 shl 2); // crShadow has been specified + DTT_SHADOWTYPE = (1 shl 3); // iTextShadowType has been specified + DTT_SHADOWOFFSET = (1 shl 4); // ptShadowOffset has been specified + DTT_BORDERSIZE = (1 shl 5); // iBorderSize has been specified + DTT_FONTPROP = (1 shl 6); // iFontPropId has been specified + DTT_COLORPROP = (1 shl 7); // iColorPropId has been specified + DTT_STATEID = (1 shl 8); // IStateId has been specified + DTT_CALCRECT = (1 shl 9); // Use pRect as and in/out parameter + DTT_APPLYOVERLAY = (1 shl 10); // fApplyOverlay has been specified + DTT_GLOWSIZE = (1 shl 11); // iGlowSize has been specified + DTT_CALLBACK = (1 shl 12); // pfnDrawTextCallback has been specified + DTT_COMPOSITED = (1 shl 13); // Draws text with antialiased alpha (needs a DIB section) + +implementation + +end. diff --git a/official/x.35/XP Theme Manager/Sources/dxThemeManager.pas b/official/x.35/XP Theme Manager/Sources/dxThemeManager.pas new file mode 100644 index 00000000..61aa971b --- /dev/null +++ b/official/x.35/XP Theme Manager/Sources/dxThemeManager.pas @@ -0,0 +1,380 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressXPThemeManager } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSXPTHEMEMANAGER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxThemeManager; + +{$I cxVer.inc} + +interface + +uses + Windows, Messages, SysUtils, Controls, Forms, dxUxTheme; + +type + TdxThemedObjectType = ( + totButton, + totClock, + totComboBox, + totEdit, + totExplorerBar, + totHeader, + totListBox, + totListView, + totMenu, + totPage, + totProgress, + totRebar, + totScrollBar, + totSpin, + totStartPanel, + totStatus, + totTab, + totTaskBand, + totTaskBar, + totToolBar, + totToolTip, + totTrackBar, + totTrayNotify, + totTreeview, + totWindow + ); + + TdxThemedObjectTypes = set of TdxThemedObjectType; + + { TdxThemeChangedNotificator } + + TdxThemeChangedEvent = procedure of object; + + TdxThemeChangedNotificator = class + private + FOnThemeChanged: TdxThemeChangedEvent; + public + constructor Create; + destructor Destroy; override; + property OnThemeChanged: TdxThemeChangedEvent read FOnThemeChanged write FOnThemeChanged; + end; + +function AreVisualStylesAvailable(ANeededThemedObjectType: TdxThemedObjectType): Boolean; overload; +function AreVisualStylesAvailable(ANeededThemedObjectTypes: TdxThemedObjectTypes = []): Boolean; overload; +procedure CloseAllThemes; +function CloseTheme(AThemedObjectType: TdxThemedObjectType): HRESULT; +function IsStandardTheme: Boolean; +function OpenTheme(AThemedObjectType: TdxThemedObjectType; + APClassNameList: PWideChar = nil): TdxTheme; + +implementation + +uses + Classes, dxThemeConsts; + +type + TdxThemeData = record + Theme: TdxTheme; + ClassNameList: WideString; + end; + + { TdxThemeChangedEventReceiver } + + TdxThemeChangedEventReceiver = class + private + FWindowHandle: HWND; + procedure WndProc(var Msg: TMessage); + procedure WMThemeChanged(var Message: TMessage); message WM_THEMECHANGED; + public + constructor Create; + destructor Destroy; override; + end; + +const + dxThemedObjectNameA: array[TdxThemedObjectType] of WideString = ( + 'Button', + 'Clock', + 'ComboBox', + 'Edit', + 'ExplorerBar', + 'Header', + 'ListBox', + 'ListView', + 'Menu', + 'Page', + 'Progress', + 'Rebar', + 'ScrollBar', + 'Spin', + 'StartPanel', + 'Status', + 'Tab', + 'TaskBand', + 'TaskBar', + 'ToolBar', + 'ToolTip', + 'TrackBar', + 'TrayNotify', + 'TreeView', + 'Window' + ); + +var + FIsGlobalThemeActive: Boolean = False; + FThemeDataA: array[TdxThemedObjectType] of TdxThemeData; + FThemeChangedEventReceiver: TdxThemeChangedEventReceiver = nil; + FThemeChangedNotificatorList: TList; + +function AreVisualStylesAvailable(ANeededThemedObjectType: TdxThemedObjectType): Boolean; +begin + Result := FIsGlobalThemeActive and IsThemeLibraryLoaded and + (OpenTheme(ANeededThemedObjectType) <> TC_NONE); +end; + +function AreVisualStylesAvailable(ANeededThemedObjectTypes: TdxThemedObjectTypes = []): Boolean; +var + AThemedObjectType: TdxThemedObjectType; +begin + Result := FIsGlobalThemeActive and IsThemeLibraryLoaded; + if Result and (ANeededThemedObjectTypes <> []) then + for AThemedObjectType := Low(TdxThemedObjectType) to High(TdxThemedObjectType) do + if (AThemedObjectType in ANeededThemedObjectTypes) and (OpenTheme(AThemedObjectType) = TC_NONE) then + begin + Result := False; + Break; + end; +end; + +function CloseTheme(AThemedObjectType: TdxThemedObjectType): HRESULT; +var + ATheme: TdxTheme; +begin + Result := S_FALSE; + if not AreVisualStylesAvailable then Exit; + Result := S_OK; + ATheme := FThemeDataA[AThemedObjectType].Theme; + if ATheme <> 0 then + begin + Result := CloseThemeData(ATheme); + FThemeDataA[AThemedObjectType].Theme := 0; // TODO ??? + FThemeDataA[AThemedObjectType].ClassNameList := ''; // TODO ??? + end; +end; + +procedure CloseAllThemes; +var + ATheme: TdxTheme; + AThemedObjectType: TdxThemedObjectType; +begin + for AThemedObjectType := Low(TdxThemedObjectType) to High(TdxThemedObjectType) do + begin + ATheme := FThemeDataA[AThemedObjectType].Theme; + if ATheme <> 0 then + begin + CloseThemeData(ATheme); + FThemeDataA[AThemedObjectType].Theme := 0; + end; + end; +end; + +function IsStandardTheme: Boolean; +const + SZ_MAX_CHARS = 1024; + StandardThemeFileNames: array[0..1] of string = ('LUNA.MSSTYLES', 'ROYALE.MSSTYLES'); +var + AThemeFileName: PWideChar; + I: Integer; + S: string; +begin + Result := False; + if AreVisualStylesAvailable then + begin + AThemeFileName := AllocMem(2 * SZ_MAX_CHARS); + try + if GetCurrentThemeName(AThemeFileName, SZ_MAX_CHARS, nil, 0, nil, 0) = S_OK then + begin + S := UpperCase(ExtractFileName(AThemeFileName)); + for I := 0 to High(StandardThemeFileNames) do + begin + Result := S = StandardThemeFileNames[I]; + if Result then + Break; + end; + end; + finally + FreeMem(AThemeFileName); + end; + end; +end; + +function OpenTheme(AThemedObjectType: TdxThemedObjectType; + APClassNameList: PWideChar = nil): TdxTheme; + + function InternalCompareString(const S1, S2: TCaption): Boolean; + begin + Result := AnsiUpperCase(S1) = AnsiUpperCase(S2); + end; + +begin + Result := 0; + if not AreVisualStylesAvailable then Exit; + with FThemeDataA[AThemedObjectType] do + begin + if Theme <> 0 then + if (APClassNameList = nil) or + InternalCompareString(ClassNameList, APClassNameList) then + begin + Result := Theme; + Exit; + end + else + CloseTheme(AThemedObjectType); + + if APClassNameList = nil then + if Length(ClassNameList) = 0 then + APClassNameList := PWideChar(dxThemedObjectNameA[AThemedObjectType]) + else + APClassNameList := PWideChar(ClassNameList); + Result := OpenThemeData(0, APClassNameList); + if Result <> 0 then + begin + Theme := Result; + ClassNameList := WideString(APClassNameList); + end + else + ClassNameList := ''; // TODO + end; +end; + +{ TdxThemeChangedNotificator } + +constructor TdxThemeChangedNotificator.Create; +begin + inherited Create; + if IsThemeLibraryLoaded and (FThemeChangedNotificatorList <> nil) then + FThemeChangedNotificatorList.Add(Self); +end; + +destructor TdxThemeChangedNotificator.Destroy; +begin + if IsThemeLibraryLoaded and (FThemeChangedNotificatorList <> nil) then + FThemeChangedNotificatorList.Remove(Self); + inherited Destroy; +end; + +{ TdxThemeChangedEventReceiver } + +constructor TdxThemeChangedEventReceiver.Create; +begin + inherited Create; +{$IFDEF DELPHI6} + FWindowHandle := Classes.AllocateHWnd(WndProc); +{$ELSE} + FWindowHandle := Forms.AllocateHWnd(WndProc); +{$ENDIF} +end; + +destructor TdxThemeChangedEventReceiver.Destroy; +begin + FIsGlobalThemeActive := False; +{$IFDEF DELPHI6} + Classes.DeallocateHWnd(FWindowHandle); +{$ELSE} + Forms.DeallocateHWnd(FWindowHandle); +{$ENDIF} + inherited Destroy; +end; + +procedure TdxThemeChangedEventReceiver.WndProc(var Msg: TMessage); +var + I: Integer; +begin + with Msg do + if Msg = WM_THEMECHANGED then + try + CloseAllThemes; + DefWindowProc(FWindowHandle, Msg, wParam, lParam); + FIsGlobalThemeActive := IsThemeActive; + Result := 0; + if FThemeChangedNotificatorList <> nil then + for I := 0 to FThemeChangedNotificatorList.Count - 1 do + with TdxThemeChangedNotificator(FThemeChangedNotificatorList[I]) do + if Assigned(FOnThemeChanged) then + FOnThemeChanged; + except + Application.HandleException(Self); + end + else + Result := DefWindowProc(FWindowHandle, Msg, wParam, lParam); +end; + +procedure TdxThemeChangedEventReceiver.WMThemeChanged(var Message: TMessage); +var + I: Integer; +begin + CloseAllThemes; + inherited; + FIsGlobalThemeActive := IsThemeActive; + Message.Result := 0; + if FThemeChangedNotificatorList <> nil then + for I := 0 to FThemeChangedNotificatorList.Count - 1 do + with TdxThemeChangedNotificator(FThemeChangedNotificatorList[I]) do + if Assigned(FOnThemeChanged) then + FOnThemeChanged; +end; + +{$IFNDEF DELPHI5} +procedure FreeAndNil(var Obj); +var + Temp: TObject; +begin + Temp := TObject(Obj); + Pointer(Obj) := nil; + Temp.Free; +end; +{$ENDIF} + +initialization + if IsThemeLibraryLoaded then + begin + FIsGlobalThemeActive := IsThemeActive; + FThemeChangedEventReceiver := TdxThemeChangedEventReceiver.Create; + FThemeChangedNotificatorList := TList.Create; + end; + +finalization + if IsThemeLibraryLoaded then + begin + FreeAndNil(FThemeChangedEventReceiver); + CloseAllThemes; + FreeAndNil(FThemeChangedNotificatorList); + end; + +end. diff --git a/official/x.35/XP Theme Manager/Sources/dxUxTheme.pas b/official/x.35/XP Theme Manager/Sources/dxUxTheme.pas new file mode 100644 index 00000000..b22261ee --- /dev/null +++ b/official/x.35/XP Theme Manager/Sources/dxUxTheme.pas @@ -0,0 +1,894 @@ + +{********************************************************************} +{ } +{ Developer Express Visual Component Library } +{ ExpressXPThemeManager } +{ } +{ Copyright (c) 1998-2008 Developer Express Inc. } +{ ALL RIGHTS RESERVED } +{ } +{ The entire contents of this file is protected by U.S. and } +{ International Copyright Laws. Unauthorized reproduction, } +{ reverse-engineering, and distribution of all or any portion of } +{ the code contained in this file is strictly prohibited and may } +{ result in severe civil and criminal penalties and will be } +{ prosecuted to the maximum extent possible under the law. } +{ } +{ RESTRICTIONS } +{ } +{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES } +{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE } +{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS } +{ LICENSED TO DISTRIBUTE THE EXPRESSXPTHEMEMANAGER AND ALL } +{ ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. } +{ } +{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED } +{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE } +{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE } +{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT } +{ AND PERMISSION FROM DEVELOPER EXPRESS INC. } +{ } +{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON } +{ ADDITIONAL RESTRICTIONS. } +{ } +{********************************************************************} + +unit dxUxTheme; + +{$I cxVer.inc} + +interface + +uses +{$IFDEF DELPHI6} + Types, +{$ENDIF} + Windows, Classes, CommCtrl; + +const + dxMaxIntListCount = 10; + +{$IFDEF CBUILDER11} + {$EXTERNALSYM BPBF_COMPATIBLEBITMAP} +{$ENDIF} + BPBF_COMPATIBLEBITMAP = 0; // Compatible bitmap +{$IFDEF CBUILDER11} + {$EXTERNALSYM BPBF_DIB} +{$ENDIF} + BPBF_DIB = 1; // Device-independent bitmap +{$IFDEF CBUILDER11} + {$EXTERNALSYM BPBF_TOPDOWNDIB} +{$ENDIF} + BPBF_TOPDOWNDIB = 2; // Top-down device-independent bitmap +{$IFDEF CBUILDER11} + {$EXTERNALSYM BPBF_TOPDOWNMONODIB} +{$ENDIF} + BPBF_TOPDOWNMONODIB = 3; // Top-down monochrome device-independent bitmap +{$IFDEF CBUILDER11} + {$EXTERNALSYM BPBF_COMPOSITED} +{$ENDIF} + BPBF_COMPOSITED = BPBF_TOPDOWNDIB; + +type + TdxTheme = THandle; + + TdxThemeSize = Integer; + + TdxMargins = packed record + cxLeftWidth: Integer; + cxRightWidth: Integer; + cyTopHeight: Integer; + cyBottomHeight: Integer; + end; + + PdxMargins = ^TdxMargins; + + TdxIntList = packed record + iValueCount: Integer; + iValues: array[0..dxMaxIntListCount - 1] of Integer; + end; + PdxIntList = ^TdxIntList; + + TdxPropertyOrigin = (PO_STATE, PO_PART, PO_CLASS, PO_GLOBAL, PO_NOTFOUND); + +// vista extention + TdxPaintBuffer = THandle; + + TdxDTTOpts = packed record + dwSize: DWORD; + dwFlags: DWORD; + crText: COLORREF; + crBorder: COLORREF; + crShadow: COLORREF; + iTextShadowType: Integer; + ptShadowOffset: TPoint; + iBorderSize: Integer; + iFontPropId: Integer; + iColorPropId: Integer; + iStateId: Integer; + fApplyOverlay: BOOL; + iGlowSize: Integer; + pfnDrawTextCallback: DWORD; + lParam: LPARAM; + end; + PdxDTTOpts = ^TdxDTTOpts; + +function OpenThemeData(hWnd: HWND; pszClassList: PWideChar): TdxTheme; +function CloseThemeData(hTheme: TdxTheme): HRESULT; + +// functions for basic drawing support +function DrawThemeBackground(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pRect: PRect; pClipRect: PRect = nil): HRESULT; overload; +function DrawThemeBackground(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + const pRect: TRect; pClipRect: PRect = nil): HRESULT; overload; +function DrawThemeBackground(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + const pRect: TRect; const pClipRect: TRect): HRESULT; overload; + +function DrawThemeText(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pszText: PWideChar; iCharCount: Integer; dwTextFlags, dwTextFlags2: DWORD; + pRect: PRect): HRESULT; overload; +function DrawThemeText(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pszText: string; iCharCount: Integer; dwTextFlags, dwTextFlags2: DWORD; + const pRect: TRect): HRESULT; overload; + +function DrawThemeTextEx(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + const pszText: WideString; iCharCount: Integer; dwTextFlags: DWORD; + const pRect: TRect; const pOptions: TdxDTTOpts): HRESULT; + +function GetThemeBackgroundContentRect(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + const BoundingRect: TRect; out ContentRect: TRect): HRESULT; + +function GetThemeBackgroundExtent(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pContentRect: PRect; + out ExtentRect: TRect): HRESULT; + +function GetThemePartSize(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + prc: PRect; eSize: TdxThemeSize; psz: PSize): HRESULT; overload; +function GetThemePartSize(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + const prc: TRect; eSize: TdxThemeSize; out psz: TSize): HRESULT; overload; +function GetThemePartSize(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + eSize: TdxThemeSize; out psz: TSize): HRESULT; overload; + +function GetThemeTextExtent(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pszTextL: PWideChar; iCharCount: Integer; dwTextFlags: DWORD; + pBoundingRect: PRect; out ExtentRect: TRect): HRESULT; +function GetThemeTextMetrics(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + out tm: TEXTMETRIC): HRESULT; +function GetThemeBackgroundRegion(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pRect: PRect; out Region: HRGN): HRESULT; +function HitTestThemeBackground(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + dwOptions: DWORD; pRect: PRect; + hRgn: HRGN; ptTest: TPoint; out wHitTestCode: WORD): HRESULT; + +function DrawThemeEdge(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pDestRect: PRect; uEdge, uFlags: UINT; pContentRect: PRect): HRESULT; overload; +function DrawThemeEdge(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + const pDestRect: TRect; uEdge, uFlags: UINT; out pContentRect: TRect): HRESULT; overload; +function DrawThemeEdge(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + const pDestRect: TRect; uEdge, uFlags: UINT): HRESULT; overload; + +function DrawThemeIcon(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pRect: PRect; himl: HIMAGELIST; iImageIndex: Integer): HRESULT; +function IsThemePartDefined(hTheme: TdxTheme; iPartId, iStateId: Integer): BOOL; +function IsThemeBackgroundPartiallyTransparent(hTheme: TdxTheme; + iPartId, iStateId: Integer): BOOL; +function DrawThemeParentBackground(hWnd: HWND; DC: HDC; const prc: TRect): HRESULT; + +// lower-level theme information services +function GetThemeColor(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out Color: TColorRef): HRESULT; +function GetThemeMetric(hTheme: TdxTheme; DC: HDC; iPartId, iStateId, iPropId: Integer; + out iVal: Integer): HRESULT; +function GetThemeString(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + pszBuff: PWideChar; cchMaxBuffChars: Integer): HRESULT; +function GetThemeBool(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out fVal{???}: BOOL): HRESULT; // TODO +function GetThemeInt(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out iVal: Integer): HRESULT; +function GetThemeEnumValue(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out iVal: Integer): HRESULT; +function GetThemePosition(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out Point: TPoint): HRESULT; +function GetThemeFont(hTheme: TdxTheme; DC: HDC; iPartId, iStateId, iPropId: Integer; + out Font: LOGFONTW): HRESULT; +function GetThemeRect(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out Rect: TRect): HRESULT; +function GetThemeMargins(hTheme: TdxTheme; DC: HDC; iPartId, iStateId, iPropId: Integer; + prc: PRect; out Margins: TdxMargins): HRESULT; +function GetThemeIntList(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out IntList: TdxIntList): HRESULT; +function GetThemePropertyOrigin(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out Origin: TdxPropertyOrigin): HRESULT; +function SetWindowTheme(hWnd: HWND; pszSubAppName, pszSubIdList: + PWideChar): HRESULT; +function GetThemeFilename(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + pszThemeFileName: PWideChar; cchMaxBuffChars: Integer): HRESULT; +function GetThemeSysColor(hTheme: TdxTheme; iColorId: Integer): COLORREF; +function GetThemeSysColorBrush(hTheme: TdxTheme; iColorId: Integer): HBRUSH; +function GetThemeSysBool(hTheme: TdxTheme; iBoolId: Integer): BOOL; +function GetThemeSysSize(hTheme: TdxTheme; iSizeId: Integer): Integer; +function GetThemeSysFont(hTheme: TdxTheme; iFontId: Integer; out lf: LOGFONTW): HRESULT; +function GetThemeSysString(hTheme: TdxTheme; iStringId: Integer; pszStringBuff: + PWideChar; cchMaxStringChars: Integer): HRESULT; +function GetThemeSysInt(hTheme: TdxTheme; iIntId: Integer; var iValue: Integer): HRESULT; // TODO var -> out ??? + +function IsThemeActive: BOOL; +function IsAppThemed: BOOL; +function GetWindowTheme(hWnd: HWND): TdxTheme; +function EnableThemeDialogTexture(hWnd: HWND; dwFlags: DWORD): HRESULT; +function IsThemeDialogTextureEnabled(hWnd: HWND): BOOL; +function GetThemeAppProperties: DWORD; +procedure SetThemeAppProperties(dwFlags: DWORD); +function GetCurrentThemeName(pszThemeFileName: PWideChar; + cchMaxNameChars: Integer; pszColorBuff: PWideChar; + cchMaxColorChars: Integer; pszSizeBuff: PWideChar; + cchMaxSizeChars: Integer): HRESULT; +function GetThemeDocumentationProperty( + pszThemeName, pszPropertyName, pszValueBuff: PWideChar; + cchMaxValChars: Integer): HRESULT; + +//vista extention +type + TdxBPPaintParams = packed record + cbSize: DWORD; + dwFlags: DWORD; // BPPF_ flags + prcExclude: PRect; + pBlendFunction: Pointer; + end; + PdxBPPaintParams = ^TdxBPPaintParams; + +function BufferedPaintInit: HRESULT; +function BufferedPaintUnInit: HRESULT; +function BeginBufferedPaint(hdcTarget: HDC; prcTarget: PRect; + dwFormat: DWORD; pPaintParams: PdxBPPaintParams; out dc: HDC): TdxPaintBuffer; +function EndBufferedPaint(hBufferedPaint: TdxPaintBuffer; fUpdateTarget: BOOL): HRESULT; +function BufferedPaintSetAlpha(hBufferedPaint: TdxPaintBuffer; prc: PRect; alpha: Byte): HRESULT; + +function IsThemeLibraryLoaded: Boolean; +function IsWindowsXPOrLater: Boolean; + +implementation + +uses + ComCtrls; + +const + ThemeLibraryName = 'UxTheme.dll'; + +type + TCloseThemeData = function(hTheme: TdxTheme): HRESULT; stdcall; + TDrawThemeBackground = function(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pRect: PRect; pClipRect: PRect = nil): HRESULT; stdcall; + TDrawThemeEdge = function(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pDestRect: PRect; uEdge, uFlags: UINT; pContentRect: PRect): HRESULT; stdcall; + TDrawThemeIcon = function(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pRect: PRect; himl: HIMAGELIST; iImageIndex: Integer): HRESULT; stdcall; + TDrawThemeParentBackground = function(hWnd: HWND; DC: HDC; const prc: TRect): HRESULT; stdcall; + TDrawThemeText = function(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pszText: PWideChar; iCharCount: Integer; dwTextFlags, dwTextFlags2: DWORD; + pRect: PRect): HRESULT; stdcall; + TDrawThemeTextEx = function(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + const pszText: WideString; iCharCount: Integer; dwTextFlags: DWORD; + pRect: PRect; const pOptions: TdxDTTOpts): HRESULT; stdcall; + TEnableThemeDialogTexture = function(hWnd: HWND; dwFlags: DWORD): HRESULT; stdcall; + TGetCurrentThemeName = function(pszThemeFileName: PWideChar; cchMaxNameChars: Integer; + pszColorBuff: PWideChar; cchMaxColorChars: Integer; pszSizeBuff: PWideChar; + cchMaxSizeChars: Integer): HRESULT; stdcall; + TGetThemeAppProperties = function: DWORD; stdcall; + TGetThemeBackgroundContentRect = function(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + const BoundingRect: TRect; out ContentRect: TRect): HRESULT; stdcall; + TGetThemeBackgroundRegion = function(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pRect: PRect; out Region: HRGN): HRESULT; stdcall; + TGetThemeBackgroundExtent = function(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pContentRect: PRect; out ExtentRect: TRect): HRESULT; stdcall; + TGetThemeBool = function(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out fVal: BOOL): HRESULT; stdcall; + TGetThemeColor = function(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out Color: TColorRef): HRESULT; stdcall; + TGetThemeDocumentationProperty = function(pszThemeName, pszPropertyName, pszValueBuff: PWideChar; + cchMaxValChars: Integer): HRESULT; stdcall; + TGetThemeEnumValue = function(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out iVal: Integer): HRESULT; stdcall; + TGetThemeFilename = function(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + pszThemeFileName: PWideChar; cchMaxBuffChars: Integer): HRESULT; stdcall; + TGetThemeFont = function(hTheme: TdxTheme; DC: HDC; iPartId, iStateId, iPropId: Integer; + out pFont: LOGFONTW): HRESULT; stdcall; + TGetThemeInt = function(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out iVal: Integer): HRESULT; stdcall; + TGetThemeIntList = function(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out IntList: TdxIntList): HRESULT; stdcall; + TGetThemeMargins = function(hTheme: TdxTheme; DC: HDC; iPartId, iStateId, iPropId: Integer; + prc: PRect; out Margins: TdxMargins): HRESULT; stdcall; + TGetThemeMetric = function(hTheme: TdxTheme; DC: HDC; iPartId, iStateId, iPropId: Integer; + out iVal: Integer): HRESULT; stdcall; + TGetThemePartSize = function(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + prc: PRect; eSize: TdxThemeSize; psz: PSize): HRESULT; stdcall; + TGetThemePosition = function(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out Point: TPoint): HRESULT; stdcall; + TGetThemePropertyOrigin = function(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out Origin: TdxPropertyOrigin): HRESULT; stdcall; + TGetThemeRect = function(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out Rect: TRect): HRESULT; stdcall; + TGetThemeString = function(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + pszBuff: PWideChar; cchMaxBuffChars: Integer): HRESULT; stdcall; + TGetThemeSysBool = function(hTheme: TdxTheme; iBoolId: Integer): BOOL; stdcall; + TGetThemeSysColor = function(hTheme: TdxTheme; iColorId: Integer): COLORREF; stdcall; + TGetThemeSysColorBrush = function(hTheme: TdxTheme; iColorId: Integer): HBRUSH; stdcall; + TGetThemeSysFont = function(hTheme: TdxTheme; iFontId: Integer; out lf: LOGFONTW): HRESULT; stdcall; + TGetThemeSysInt = function(hTheme: TdxTheme; iIntId: Integer; var iValue: Integer): HRESULT; stdcall; + TGetThemeSysSize = function(hTheme: TdxTheme; iSizeId: Integer): Integer; stdcall; + TGetThemeSysString = function(hTheme: TdxTheme; iStringId: Integer; pszStringBuff: PWideChar; + cchMaxStringChars: Integer): HRESULT; stdcall; + TGetThemeTextExtent = function(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pszTextL: PWideChar; iCharCount: Integer; dwTextFlags: DWORD; + pBoundingRect: PRect; out ExtentRect: TRect): HRESULT; stdcall; + TGetThemeTextMetrics = function(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + out tm: TEXTMETRIC): HRESULT; stdcall; + TGetWindowTheme = function(hWnd: HWND): TdxTheme;stdcall; + THitTestThemeBackground = function(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + dwOptions: DWORD; pRect : PRect; hRgn: HRGN; ptTest: TPoint; + out wHitTestCode: WORD): HRESULT; stdcall; + TIsAppThemed = function: BOOL; stdcall; + TIsThemeActive = function: BOOL; stdcall; + TIsThemePartDefined = function(hTheme: TdxTheme; iPartId, iStateId: Integer): BOOL; stdcall; + TIsThemeBackgroundPartiallyTransparent = function(hTheme: TdxTheme; + iPartId, iStateId: Integer): BOOL; stdcall; + TIsThemeDialogTextureEnabled = function(hWnd: HWND): BOOL; stdcall; + TOpenThemeData = function(hWnd: HWND; pszClassList: PWideChar): TdxTheme; stdcall; + TSetThemeAppProperties = procedure(dwFlags: DWORD); stdcall; + TSetWindowTheme = function(hWnd: HWND; pszSubAppName, pszSubIdList: PWideChar): HRESULT; stdcall; + //vista extention + TBufferedPaintInit = function: HRESULT; stdcall; + TBufferedPaintUnInit = function: HRESULT; stdcall; + TBeginBufferedPaint = function(hdcTarget: HDC; prcTarget: PRect; + dwFormat: DWORD; pPaintParams: PdxBPPaintParams; var dc: HDC): TdxPaintBuffer; stdcall; + TEndBufferedPaint = function(hBufferedPaint: TdxPaintBuffer; fUpdateTarget: BOOL): HRESULT; stdcall; + TBufferedPaintSetAlpha = function(hBufferedPaint: TdxPaintBuffer; prc: PRect; alpha: Byte): HRESULT; stdcall; + + TThemeLibraryMethodPointersKeeper = record + FCloseThemeData: TCloseThemeData; + FDrawThemeBackground: TDrawThemeBackground; + FDrawThemeEdge: TDrawThemeEdge; + FDrawThemeIcon: TDrawThemeIcon; + FDrawThemeParentBackground: TDrawThemeParentBackground; + FDrawThemeText: TDrawThemeText; + FDrawThemeTextEx: TDrawThemeTextEx; + FEnableThemeDialogTexture: TEnableThemeDialogTexture; + FGetCurrentThemeName: TGetCurrentThemeName; + FGetThemeAppProperties: TGetThemeAppProperties; + FGetThemeBackgroundContentRect: TGetThemeBackgroundContentRect; + FGetThemeBackgroundRegion: TGetThemeBackgroundRegion; + FGetThemeBackgroundExtent: TGetThemeBackgroundExtent; + FGetThemeBool: TGetThemeBool; + FGetThemeColor: TGetThemeColor; + FGetThemeDocumentationProperty: TGetThemeDocumentationProperty; + FGetThemeEnumValue: TGetThemeEnumValue; + FGetThemeFilename: TGetThemeFilename; + FGetThemeFont: TGetThemeFont; + FGetThemeInt: TGetThemeInt; + FGetThemeIntList: TGetThemeIntList; + FGetThemeMargins: TGetThemeMargins; + FGetThemeMetric: TGetThemeMetric; + FGetThemePartSize: TGetThemePartSize; + FGetThemePosition: TGetThemePosition; + FGetThemePropertyOrigin: TGetThemePropertyOrigin; + FGetThemeRect: TGetThemeRect; + FGetThemeString: TGetThemeString; + FGetThemeSysBool: TGetThemeSysBool; + FGetThemeSysColor: TGetThemeSysColor; + FGetThemeSysColorBrush: TGetThemeSysColorBrush; + FGetThemeSysFont: TGetThemeSysFont; + FGetThemeSysInt: TGetThemeSysInt; + FGetThemeSysSize: TGetThemeSysSize; + FGetThemeSysString: TGetThemeSysString; + FGetThemeTextExtent: TGetThemeTextExtent; + FGetThemeTextMetrics: TGetThemeTextMetrics; + FGetWindowTheme: TGetWindowTheme; + FHitTestThemeBackground: THitTestThemeBackground; + FIsAppThemed: TIsAppThemed; + FIsThemeActive: TIsThemeActive; + FIsThemePartDefined: TIsThemePartDefined; + FIsThemeBackgroundPartiallyTransparent: TIsThemeBackgroundPartiallyTransparent; + FIsThemeDialogTextureEnabled: TIsThemeDialogTextureEnabled; + FOpenThemeData: TOpenThemeData; + FSetThemeAppProperties: TSetThemeAppProperties; + FSetWindowTheme: TSetWindowTheme; + //vista extention + FBufferedPaintInit: TBufferedPaintInit; + FBufferedPaintUnInit: TBufferedPaintUnInit; + FBeginBufferedPaint: TBeginBufferedPaint; + FEndBufferedPaint: TEndBufferedPaint; + FBufferedPaintSetAlpha: TBufferedPaintSetAlpha; + end; + +var + FIsWindowsXPOrLater: Boolean; + FThemeLibrary: HMODULE = 0; + FThemeLibraryMethodPointersKeeper: TThemeLibraryMethodPointersKeeper; + +function OpenThemeData(hWnd: HWND; pszClassList: PWideChar): TdxTheme; +begin + Result := FThemeLibraryMethodPointersKeeper.FOpenThemeData(hWnd, pszClassList); +end; + +function CloseThemeData(hTheme: TdxTheme): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FCloseThemeData(hTheme); +end; + +function DrawThemeBackground(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pRect: PRect; pClipRect: PRect = nil +): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FDrawThemeBackground(hTheme, DC, + iPartId, iStateId, pRect, pClipRect); +end; +function DrawThemeBackground(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + const pRect: TRect; pClipRect: PRect = nil): HRESULT; +begin + Result := DrawThemeBackground(hTheme, DC, iPartId, iStateId, @pRect, pClipRect); +end; + +function DrawThemeBackground(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + const pRect: TRect; const pClipRect: TRect): HRESULT; +begin + Result := DrawThemeBackground(hTheme, DC, iPartId, iStateId, @pRect, @pClipRect); +end; + +function DrawThemeText(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pszText: PWideChar; + iCharCount: Integer; dwTextFlags, dwTextFlags2: DWORD; + pRect: PRect): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FDrawThemeText(hTheme, DC, iPartId, iStateId, + pszText, iCharCount, dwTextFlags, dwTextFlags2, pRect); +end; + +function DrawThemeText(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pszText: string; iCharCount: Integer; dwTextFlags, dwTextFlags2: DWORD; + const pRect: TRect): HRESULT; +begin + Result := DrawThemeText(hTheme, DC, iPartId, iStateId, + PWideChar(WideString(pszText)), iCharCount, dwTextFlags, dwTextFlags2, @pRect); +end; + +//vista extention +function DrawThemeTextEx(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + const pszText: WideString; iCharCount: Integer; dwTextFlags: DWORD; + const pRect: TRect; const pOptions: TdxDTTOpts): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FDrawThemeTextEx(hTheme, DC, iPartId, iStateId, + PWideChar(pszText), iCharCount, dwTextFlags, @pRect, pOptions); +end; + +function GetThemeBackgroundContentRect(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + const BoundingRect: TRect; out ContentRect: TRect): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeBackgroundContentRect(hTheme, + DC, iPartId, iStateId, BoundingRect, ContentRect); +end; + +function GetThemeBackgroundExtent(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pContentRect: PRect; + out ExtentRect: TRect): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeBackgroundExtent(hTheme, DC, + iPartId, iStateId, pContentRect, ExtentRect); +end; + +function GetThemePartSize(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + prc: PRect; eSize: TdxThemeSize; + psz: PSize): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemePartSize(hTheme, DC, iPartId, + iStateId, prc, eSize, psz); +end; + +function GetThemePartSize(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + const prc: TRect; eSize: TdxThemeSize; out psz: TSize): HRESULT; +begin + Result := GetThemePartSize(hTheme, DC, iPartId, iStateId, @prc, eSize, @psz); +end; + +function GetThemePartSize(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + eSize: TdxThemeSize; out psz: TSize): HRESULT; +begin + Result := GetThemePartSize(hTheme, DC, iPartId, iStateId, nil, eSize, @psz); +end; + +function GetThemeTextExtent(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pszTextL: PWideChar; iCharCount: Integer; dwTextFlags: DWORD; + pBoundingRect: PRect; out ExtentRect: TRect): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeTextExtent(hTheme, DC, iPartId, + iStateId, pszTextL, iCharCount, dwTextFlags, pBoundingRect, ExtentRect); +end; + +function GetThemeTextMetrics(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + out tm: TEXTMETRIC): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeTextMetrics(hTheme, DC, iPartId, + iStateId, tm); +end; + +function GetThemeBackgroundRegion(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pRect: PRect; out Region: HRGN): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeBackgroundRegion(hTheme, + DC, iPartId, iStateId, pRect, Region); +end; + +function HitTestThemeBackground(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + dwOptions: DWORD; pRect: PRect; + hRgn: HRGN; ptTest: TPoint; out wHitTestCode: WORD): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FHitTestThemeBackground(hTheme, DC, + iPartId, iStateId, dwOptions, pRect, hRgn, ptTest, wHitTestCode); +end; + +function DrawThemeEdge(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pDestRect: PRect; + uEdge, uFlags: UINT; pContentRect: PRect): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FDrawThemeEdge(hTheme, DC, iPartId, iStateId, + pDestRect, uEdge, uFlags, pContentRect); +end; + +function DrawThemeEdge(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + const pDestRect: TRect; uEdge, uFlags: UINT; out pContentRect: TRect): HRESULT; +begin + Result := DrawThemeEdge(hTheme, DC, iPartId, iStateId, @pDestRect, uEdge, uFlags, @pContentRect); +end; + +function DrawThemeEdge(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + const pDestRect: TRect; uEdge, uFlags: UINT): HRESULT; +var + R: TRect; +begin + Result := DrawThemeEdge(hTheme, DC, iPartId, iStateId, pDestRect, uEdge, uFlags, R); +end; + +function DrawThemeIcon(hTheme: TdxTheme; DC: HDC; iPartId, iStateId: Integer; + pRect: PRect; himl: HIMAGELIST; iImageIndex: Integer): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FDrawThemeIcon(hTheme, DC, iPartId, iStateId, + pRect, himl, iImageIndex); +end; + +function IsThemePartDefined(hTheme: TdxTheme; iPartId: Integer; iStateId: Integer): BOOL; +begin + Result := FThemeLibraryMethodPointersKeeper.FIsThemePartDefined(hTheme, iPartId, iStateId); +end; + +function IsThemeBackgroundPartiallyTransparent(hTheme: TdxTheme; + iPartId: Integer; iStateId: Integer): BOOL; +begin + Result := FThemeLibraryMethodPointersKeeper.FIsThemeBackgroundPartiallyTransparent(hTheme, + iPartId, iStateId); +end; + +function DrawThemeParentBackground(hWnd: HWND; DC: HDC; const prc: TRect): HRESULT; +var + AFontHandle: HFONT; +begin + AFontHandle := GetCurrentObject(DC, OBJ_FONT); + Result := FThemeLibraryMethodPointersKeeper.FDrawThemeParentBackground(hWnd, DC, prc); + SelectObject(DC, AFontHandle); +end; + +function GetThemeColor(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out Color: TColorRef): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeColor(hTheme, iPartId, iStateId, iPropId, Color); +end; + +function GetThemeMetric(hTheme: TdxTheme; DC: HDC; iPartId, iStateId, iPropId: Integer; + out iVal: Integer): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeMetric(hTheme, DC, iPartId, + iStateId, iPropId, iVal); +end; + +function GetThemeString(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + pszBuff: PWideChar; cchMaxBuffChars: Integer): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeString(hTheme, iPartId, iStateId, + iPropId, pszBuff, cchMaxBuffChars); +end; + +function GetThemeBool(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out fVal: BOOL): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeBool(hTheme, iPartId, iStateId, + iPropId, fVal); +end; + +function GetThemeInt(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out iVal: Integer): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeInt(hTheme, iPartId, iStateId, + iPropId, iVal); +end; + +function GetThemeEnumValue(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out iVal: Integer): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeEnumValue(hTheme, iPartId, + iStateId, iPropId, iVal); +end; + +function GetThemePosition(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out Point: TPoint): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemePosition(hTheme, iPartId, iStateId, + iPropId, Point); +end; + +function GetThemeFont(hTheme: TdxTheme; DC: HDC; iPartId, iStateId, iPropId: Integer; + out Font: LOGFONTW): HRESULT; +var + S: array [0 .. 1000] of Char; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeFont(hTheme, DC, iPartId, iStateId, + iPropId, Font); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, nil, Result, LOCALE_USER_DEFAULT, S, 1001, nil); +end; + +function GetThemeRect(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out Rect: TRect): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeRect(hTheme, iPartId, iStateId, + iPropId, Rect); +end; + +function GetThemeMargins(hTheme: TdxTheme; DC: HDC; iPartId, iStateId, iPropId: Integer; + prc: PRect; out Margins: TdxMargins): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeMargins(hTheme, DC, iPartId, + iStateId, iPropId, prc, Margins); +end; + +function GetThemeIntList(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out IntList: TdxIntList): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeIntList(hTheme, iPartId, iStateId, + iPropId, IntList); +end; + +function GetThemePropertyOrigin(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + out Origin: TdxPropertyOrigin): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemePropertyOrigin(hTheme, iPartId, + iStateId, iPropId, Origin); +end; + +function SetWindowTheme(hWnd: HWND; pszSubAppName, pszSubIdList: + PWideChar): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FSetWindowTheme(hWnd, pszSubAppName, pszSubIdList); +end; + +function GetThemeFilename(hTheme: TdxTheme; iPartId, iStateId, iPropId: Integer; + pszThemeFileName: PWideChar; cchMaxBuffChars: Integer): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeFilename(hTheme, iPartId, + iStateId, iPropId, pszThemeFileName, cchMaxBuffChars); +end; + +function GetThemeSysColor(hTheme: TdxTheme; iColorId: Integer): COLORREF; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeSysColor(hTheme, iColorId); +end; + +function GetThemeSysColorBrush(hTheme: TdxTheme; iColorId: Integer): HBRUSH; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeSysColorBrush(hTheme, iColorId); +end; + +function GetThemeSysBool(hTheme: TdxTheme; iBoolId: Integer): BOOL; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeSysBool(hTheme, iBoolId); +end; + +function GetThemeSysSize(hTheme: TdxTheme; iSizeId: Integer): Integer; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeSysSize(hTheme, iSizeId); +end; + +function GetThemeSysFont(hTheme: TdxTheme; iFontId: Integer; + out lf: LOGFONTW): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeSysFont(hTheme, iFontId, lf); +end; + +function GetThemeSysString(hTheme: TdxTheme; iStringId: Integer; pszStringBuff: + PWideChar; cchMaxStringChars: Integer): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeSysString(hTheme, iStringId, + pszStringBuff, cchMaxStringChars); +end; + +function GetThemeSysInt(hTheme: TdxTheme; iIntId: Integer; var iValue: Integer): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeSysInt(hTheme, iIntId, iValue); +end; + +function IsThemeActive: BOOL; +begin + if @FThemeLibraryMethodPointersKeeper.FIsThemeActive = nil then + Result := False + else + Result := FThemeLibraryMethodPointersKeeper.FIsThemeActive; +end; + +function IsAppThemed: BOOL; +begin + Result := FThemeLibraryMethodPointersKeeper.FIsAppThemed; +end; + +function GetWindowTheme(hWnd: HWND): TdxTheme; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetWindowTheme(hWnd); +end; + +function EnableThemeDialogTexture(hWnd: HWND; dwFlags: DWORD): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FEnableThemeDialogTexture(hWnd, dwFlags); +end; + +function IsThemeDialogTextureEnabled(hWnd: HWND): BOOL; +begin + Result := FThemeLibraryMethodPointersKeeper.FIsThemeDialogTextureEnabled(hWnd); +end; + +function GetThemeAppProperties: DWORD; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeAppProperties; +end; + +procedure SetThemeAppProperties(dwFlags: DWORD); +begin + FThemeLibraryMethodPointersKeeper.FSetThemeAppProperties(dwFlags); +end; + +function GetCurrentThemeName(pszThemeFileName: PWideChar; + cchMaxNameChars: Integer; pszColorBuff: PWideChar; + cchMaxColorChars: Integer; pszSizeBuff: PWideChar; + cchMaxSizeChars: Integer): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetCurrentThemeName(pszThemeFileName, + cchMaxNameChars, pszColorBuff, cchMaxColorChars, pszSizeBuff, cchMaxSizeChars); +end; + +function GetThemeDocumentationProperty( + pszThemeName, pszPropertyName, pszValueBuff: PWideChar; + cchMaxValChars: Integer): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FGetThemeDocumentationProperty(pszThemeName, + pszPropertyName, pszValueBuff, cchMaxValChars); +end; + +//vista extention + +function BufferedPaintInit: HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FBufferedPaintInit; +end; + +function BufferedPaintUnInit: HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FBufferedPaintUnInit; +end; + +function BeginBufferedPaint(hdcTarget: HDC; prcTarget: PRect; + dwFormat: DWORD; pPaintParams: PdxBPPaintParams; out dc: HDC): TdxPaintBuffer; +begin + Result := FThemeLibraryMethodPointersKeeper.FBeginBufferedPaint(hdcTarget, + prcTarget, dwFormat, pPaintParams, dc); +end; + +function EndBufferedPaint(hBufferedPaint: TdxPaintBuffer; fUpdateTarget: BOOL): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FEndBufferedPaint(hBufferedPaint, fUpdateTarget); +end; + +function BufferedPaintSetAlpha(hBufferedPaint: TdxPaintBuffer; prc: PRect; alpha: Byte): HRESULT; +begin + Result := FThemeLibraryMethodPointersKeeper.FBufferedPaintSetAlpha(hBufferedPaint, prc, alpha); +end; + +function IsThemeLibraryLoaded: Boolean; +begin + Result := FThemeLibrary <> 0; +end; + +function IsWindowsXPOrLater: Boolean; +begin + Result := FIsWindowsXPOrLater; +end; + +procedure CheckOSVersion; +var + Info: TOSVersionInfo; +begin + Info.dwOSVersionInfoSize := SizeOf(Info); + GetVersionEx(Info); + FIsWindowsXPOrLater := (Info.dwMajorVersion > 5) or + ((Info.dwMajorVersion = 5) and (Info.dwMinorVersion >= 1)); +end; + +procedure SetMethodPointers; +begin + with FThemeLibraryMethodPointersKeeper do + begin + @FCloseThemeData := GetProcAddress(FThemeLibrary, 'CloseThemeData'); + @FDrawThemeBackground := GetProcAddress(FThemeLibrary, 'DrawThemeBackground'); + @FDrawThemeEdge := GetProcAddress(FThemeLibrary, 'DrawThemeEdge'); + @FDrawThemeIcon := GetProcAddress(FThemeLibrary, 'DrawThemeIcon'); + @FDrawThemeParentBackground := GetProcAddress(FThemeLibrary, 'DrawThemeParentBackground'); + @FDrawThemeText := GetProcAddress(FThemeLibrary, 'DrawThemeText'); + @FDrawThemeTextEx := GetProcAddress(FThemeLibrary, 'DrawThemeTextEx'); + @FEnableThemeDialogTexture := GetProcAddress(FThemeLibrary, 'EnableThemeDialogTexture'); + @FGetCurrentThemeName := GetProcAddress(FThemeLibrary, 'GetCurrentThemeName'); + @FGetThemeAppProperties := GetProcAddress(FThemeLibrary, 'GetThemeAppProperties'); + @FGetThemeBackgroundContentRect := GetProcAddress(FThemeLibrary, 'GetThemeBackgroundContentRect'); + @FGetThemeBackgroundRegion := GetProcAddress(FThemeLibrary, 'GetThemeBackgroundRegion'); + @FGetThemeBackgroundExtent := GetProcAddress(FThemeLibrary, 'GetThemeBackgroundExtent'); + @FGetThemeBool := GetProcAddress(FThemeLibrary, 'GetThemeBool'); + @FGetThemeColor := GetProcAddress(FThemeLibrary, 'GetThemeColor'); + @FGetThemeDocumentationProperty := GetProcAddress(FThemeLibrary, 'GetThemeDocumentationProperty'); + @FGetThemeEnumValue := GetProcAddress(FThemeLibrary, 'GetThemeEnumValue'); + @FGetThemeFilename := GetProcAddress(FThemeLibrary, 'GetThemeFilename'); + @FGetThemeFont := GetProcAddress(FThemeLibrary, 'GetThemeFont'); + @FGetThemeInt := GetProcAddress(FThemeLibrary, 'GetThemeInt'); + @FGetThemeIntList := GetProcAddress(FThemeLibrary, 'GetThemeIntList'); + @FGetThemeMargins := GetProcAddress(FThemeLibrary, 'GetThemeMargins'); + @FGetThemeMetric := GetProcAddress(FThemeLibrary, 'GetThemeMetric'); + @FGetThemePartSize := GetProcAddress(FThemeLibrary, 'GetThemePartSize'); + @FGetThemePosition := GetProcAddress(FThemeLibrary, 'GetThemePosition'); + @FGetThemePropertyOrigin := GetProcAddress(FThemeLibrary, 'GetThemePropertyOrigin'); + @FGetThemeRect := GetProcAddress(FThemeLibrary, 'GetThemeRect'); + @FGetThemeString := GetProcAddress(FThemeLibrary, 'GetThemeString'); + @FGetThemeSysBool := GetProcAddress(FThemeLibrary, 'GetThemeSysBool'); + @FGetThemeSysColor := GetProcAddress(FThemeLibrary, 'GetThemeSysColor'); + @FGetThemeSysColorBrush := GetProcAddress(FThemeLibrary, 'GetThemeSysColorBrush'); + @FGetThemeSysFont := GetProcAddress(FThemeLibrary, 'GetThemeSysFont'); + @FGetThemeSysInt := GetProcAddress(FThemeLibrary, 'GetThemeSysInt'); + @FGetThemeSysSize := GetProcAddress(FThemeLibrary, 'GetThemeSysSize'); + @FGetThemeSysString := GetProcAddress(FThemeLibrary, 'GetThemeSysString'); + @FGetThemeTextExtent := GetProcAddress(FThemeLibrary, 'GetThemeTextExtent'); + @FGetThemeTextMetrics := GetProcAddress(FThemeLibrary, 'GetThemeTextMetrics'); + @FGetWindowTheme := GetProcAddress(FThemeLibrary, 'GetWindowTheme'); + @FHitTestThemeBackground := GetProcAddress(FThemeLibrary, 'HitTestThemeBackground'); + @FIsAppThemed := GetProcAddress(FThemeLibrary, 'IsAppThemed'); + @FIsThemeActive := GetProcAddress(FThemeLibrary, 'IsThemeActive'); + @FIsThemePartDefined := GetProcAddress(FThemeLibrary, 'IsThemePartDefined'); + @FIsThemeBackgroundPartiallyTransparent := GetProcAddress(FThemeLibrary, 'IsThemeBackgroundPartiallyTransparent'); + @FIsThemeDialogTextureEnabled := GetProcAddress(FThemeLibrary, 'IsThemeDialogTextureEnabled'); + @FOpenThemeData := GetProcAddress(FThemeLibrary, 'OpenThemeData'); + @FSetThemeAppProperties := GetProcAddress(FThemeLibrary, 'SetThemeAppProperties'); + @FSetWindowTheme := GetProcAddress(FThemeLibrary, 'SetWindowTheme'); + //vista extention + @FBufferedPaintInit := GetProcAddress(FThemeLibrary, 'BufferedPaintInit'); + @FBufferedPaintUnInit := GetProcAddress(FThemeLibrary, 'BufferedPaintUnInit'); + @FBeginBufferedPaint := GetProcAddress(FThemeLibrary, 'BeginBufferedPaint'); + @FEndBufferedPaint := GetProcAddress(FThemeLibrary, 'EndBufferedPaint'); + @FBufferedPaintSetAlpha := GetProcAddress(FThemeLibrary, 'BufferedPaintSetAlpha'); + end; +end; + +initialization + CheckOSVersion; + InitCommonControls; + if FIsWindowsXPOrLater (*and (GetComCtlVersion >= $60000) *)then + begin + FThemeLibrary := LoadLibrary(ThemeLibraryName); + if FThemeLibrary <> 0 then + SetMethodPointers; + end; + +finalization + if FThemeLibrary <> 0 then + FreeLibrary(FThemeLibrary); + +end. diff --git a/official/x.35/_compile.bat b/official/x.35/_compile.bat new file mode 100644 index 00000000..f485251d --- /dev/null +++ b/official/x.35/_compile.bat @@ -0,0 +1,467 @@ +@echo off + +IF /i %1 EQU D5 goto delphi5 +IF /i %1 EQU D7 goto delphi7 +IF /i %1 EQU D10 goto delphi10 +IF /i %1 EQU D11 goto delphi11 + +:delphi5 +set DELPHI=C:\Archiv~1\Borland\Delphi5 +goto continue + +:delphi7 +set DELPHI=C:\Archiv~1\Borland\Delphi7 +goto continue + +:delphi10 +set DELPHI=C:\Archiv~1\Borland\Delphi10 +goto continue + +:delphi11 +set DELPHI=C:\Archiv~1\CodeGear\RADSTU~1\5.0 +goto continue + +:continue +rem ############# +set BASEDIR=c:\X.35 +set LIBDIR=%BASEDIR%\Lib +rem ############# +rem ROOT marca el directorio base de cada componente. Por ahora apunta a la raiz. +set ROOT=%BASEDIR% +rem ############# +set DCCOPT=-B -W -H -$D-,L-,Y- +set OUTDIR=%LIBDIR%\%1 +set DCUDIR=%LIBDIR%\%1 +rem ############# +set COMPILE="%DELPHI%\Bin\dcc32.exe" %DCCOPT% -LE"%OUTDIR%" -LN"%OUTDIR%" -U;"%DCUDIR%";"%OUTPUTDIR%";"%UNITSDIR%" -R"%RESDIR%" -N"%DCUDIR%" +rem ############# +mkdir "%LIBDIR%\%1" > nul +del "%LIBDIR%\%1\*.*" /q > nul +rem ############# + + +rem ************************************************************************ +set ROOT=%BASEDIR%\XP Theme Manager +set UNITSDIR=%ROOT%\Sources +set RESDIR=%ROOT%\Sources +echo. +echo. +echo %ROOT% +echo --------------------------------------------------------------------------------------------------------- +copy "%ROOT%\sources\*.res" "%OUTDIR%" +copy "%ROOT%\sources\*.dcr" "%OUTDIR%" +call compile_dcc32 "%ROOT%\Packages\dxTheme%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + + +rem ************************************************************************ +rem ExpressGDI+ Library +set ROOT=%BASEDIR%\ExpressGDI+ Library +set UNITSDIR=%ROOT%\Sources +set RESDIR=%ROOT%\Sources +echo. +echo. +echo %ROOT% +echo --------------------------------------------------------------------------------------------------------- +copy "%ROOT%\sources\*.res" "%OUTDIR%" +copy "%ROOT%\sources\*.dfm" "%OUTDIR%" +copy "%ROOT%\sources\*.dcr" "%OUTDIR%" +call compile_dcc32 "%ROOT%\Packages\dxGDIPlus%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + + +rem ************************************************************************ +set ROOT=%BASEDIR%\ExpressLibrary +set UNITSDIR=%ROOT%\Sources +set RESDIR=%ROOT%\Sources +echo. +echo. +echo %ROOT% +echo --------------------------------------------------------------------------------------------------------- +copy "%ROOT%\sources\*.res" "%OUTDIR%" +copy "%ROOT%\sources\*.dcr" "%OUTDIR%" +copy "%ROOT%\sources\*.dfm" "%OUTDIR%" +IF /i %1 EQU D7 call compile_dcc32 "%ROOT%\Packages\cxLibraryVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D7 call compile_dcc32 "%ROOT%\Packages\dclcxLibraryVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D10 call compile_dcc32 "%ROOT%\Packages\cxLibrary%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D10 call compile_dcc32 "%ROOT%\Packages\dclcxLibrary%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D11 call compile_dcc32 "%ROOT%\Packages\cxLibrary%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D11 call compile_dcc32 "%ROOT%\Packages\dclcxLibrary%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + + +rem ************************************************************************ +set ROOT=%BASEDIR%\ExpressCommon Library +set UNITSDIR=%ROOT%\Sources +set RESDIR=%ROOT%\Sources +echo. +echo. +echo %ROOT% +echo --------------------------------------------------------------------------------------------------------- +copy "%ROOT%\sources\*.dfm" "%OUTDIR%" +call compile_dcc32 "%ROOT%\Packages\dxComn%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + + +rem ************************************************************************ +set ROOT=%BASEDIR%\ExpressDataController +set UNITSDIR=%ROOT%\Sources +set RESDIR=%ROOT%\Sources +echo. +echo. +echo %ROOT% +echo --------------------------------------------------------------------------------------------------------- +call compile_dcc32 "%ROOT%\Packages\cxData%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\cxADOAdapters%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\cxIBXAdapters%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\cxBDEAdapters%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + + +rem ************************************************************************ +set ROOT=%BASEDIR%\ExpressEditors Library 5 +set UNITSDIR=%ROOT%\Sources +set RESDIR=%ROOT%\Sources +echo. +echo. +echo %ROOT% +echo --------------------------------------------------------------------------------------------------------- +copy "%ROOT%\sources\*.res" "%OUTDIR%" +copy "%ROOT%\sources\*.dcr" "%OUTDIR%" +copy "%ROOT%\sources\*.dfm" "%OUTDIR%" + +IF /i %1 EQU D5 call compile_dcc32 "%ROOT%\Packages\cxEditors%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D9 call compile_dcc32 "%ROOT%\Packages\cxEditors%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D6 call compile_dcc32 "%ROOT%\Packages\cxEditorsVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D7 call compile_dcc32 "%ROOT%\Packages\cxEditorsVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D10 call compile_dcc32 "%ROOT%\Packages\cxEditors%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D11 call compile_dcc32 "%ROOT%\Packages\cxEditors%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + +IF /i %1 EQU D5 call compile_dcc32 "%ROOT%\Packages\cxExtEditors%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D9 call compile_dcc32 "%ROOT%\Packages\cxExtEditors%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D6 call compile_dcc32 "%ROOT%\Packages\cxExtEditorsVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D7 call compile_dcc32 "%ROOT%\Packages\cxExtEditorsVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D10 call compile_dcc32 "%ROOT%\Packages\cxExtEditors%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D11 call compile_dcc32 "%ROOT%\Packages\cxExtEditors%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + +IF /i %1 EQU D5 call compile_dcc32 "%ROOT%\Packages\dclcxEditors%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D9 call compile_dcc32 "%ROOT%\Packages\dclcxEditors%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D6 call compile_dcc32 "%ROOT%\Packages\dclcxEditorsVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D7 call compile_dcc32 "%ROOT%\Packages\dclcxEditorsVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D10 call compile_dcc32 "%ROOT%\Packages\dclcxEditors%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D11 call compile_dcc32 "%ROOT%\Packages\dclcxEditors%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + +IF /i %1 EQU D5 call compile_dcc32 "%ROOT%\Packages\dclcxExtEditors%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D9 call compile_dcc32 "%ROOT%\Packages\dclcxExtEditors%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D6 call compile_dcc32 "%ROOT%\Packages\dclcxExtEditorsVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D7 call compile_dcc32 "%ROOT%\Packages\dclcxExtEditorsVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D10 call compile_dcc32 "%ROOT%\Packages\dclcxExtEditors%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D11 call compile_dcc32 "%ROOT%\Packages\dclcxExtEditors%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + + +rem ************************************************************************ +set ROOT=%BASEDIR%\ExpressExport Library +set UNITSDIR=%ROOT%\Sources +set RESDIR=%ROOT%\Sources +echo. +echo. +echo %ROOT% +echo --------------------------------------------------------------------------------------------------------- +copy "%ROOT%\sources\*.res" "%OUTDIR%" +copy "%ROOT%\sources\*.dfm" "%OUTDIR%" +copy "%ROOT%\sources\*.dcr" "%OUTDIR%" +IF /i %1 EQU D5 call compile_dcc32 "%ROOT%\Packages\cxExport%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D6 call compile_dcc32 "%ROOT%\Packages\cxExportVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D7 call compile_dcc32 "%ROOT%\Packages\cxExportVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D9 call compile_dcc32 "%ROOT%\Packages\cxExport%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D10 call compile_dcc32 "%ROOT%\Packages\cxExport%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D11 call compile_dcc32 "%ROOT%\Packages\cxExport%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + + +rem ************************************************************************ +set ROOT=%BASEDIR%\ExpressDocking Library +set UNITSDIR=%ROOT%\Sources +set RESDIR=%ROOT%\Sources +echo. +echo. +echo %ROOT% +echo --------------------------------------------------------------------------------------------------------- +copy "%ROOT%\sources\*.res" "%OUTDIR%" +copy "%ROOT%\sources\*.dfm" "%OUTDIR%" +copy "%ROOT%\sources\*.dcr" "%OUTDIR%" +call compile_dcc32 "%ROOT%\Packages\dxDocking%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dcldxDocking%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + + +rem ************************************************************************ +set ROOT=%BASEDIR%\ExpressPageControl 2 +set UNITSDIR=%ROOT%\Sources +set RESDIR=%ROOT%\Sources +echo. +echo. +echo %ROOT% +echo --------------------------------------------------------------------------------------------------------- +copy "%ROOT%\sources\*.res" "%OUTDIR%" +copy "%ROOT%\sources\*.dfm" "%OUTDIR%" +copy "%ROOT%\sources\*.dcr" "%OUTDIR%" +IF /i %1 EQU D5 call compile_dcc32 "%ROOT%\Packages\cxPageControl%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D6 call compile_dcc32 "%ROOT%\Packages\cxPageControlVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D7 call compile_dcc32 "%ROOT%\Packages\cxPageControlVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D9 call compile_dcc32 "%ROOT%\Packages\cxPageControl%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D10 call compile_dcc32 "%ROOT%\Packages\cxPageControl%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D11 call compile_dcc32 "%ROOT%\Packages\cxPageControl%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + +IF /i %1 EQU D5 call compile_dcc32 "%ROOT%\Packages\dclcxPageControl%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D6 call compile_dcc32 "%ROOT%\Packages\dclcxPageControlVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D7 call compile_dcc32 "%ROOT%\Packages\dclcxPageControlVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D9 call compile_dcc32 "%ROOT%\Packages\dclcxPageControl%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D10 call compile_dcc32 "%ROOT%\Packages\dclcxPageControl%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D11 call compile_dcc32 "%ROOT%\Packages\dclcxPageControl%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + +rem ************************************************************************ +set ROOT=%BASEDIR%\ExpressQuantumGrid 6 +set UNITSDIR=%ROOT%\Sources +set RESDIR=%ROOT%\Sources +echo. +echo. +echo %ROOT% +echo --------------------------------------------------------------------------------------------------------- +copy "%ROOT%\sources\*.res" "%OUTDIR%" +copy "%ROOT%\sources\*.dfm" "%OUTDIR%" +copy "%ROOT%\sources\*.dcr" "%OUTDIR%" +IF /i %1 EQU D5 call compile_dcc32 "%ROOT%\Packages\cxGrid%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D6 call compile_dcc32 "%ROOT%\Packages\cxGridVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D7 call compile_dcc32 "%ROOT%\Packages\cxGridVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D9 call compile_dcc32 "%ROOT%\Packages\cxGrid%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D10 call compile_dcc32 "%ROOT%\Packages\cxGrid%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D11 call compile_dcc32 "%ROOT%\Packages\cxGrid%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + +IF /i %1 EQU D5 call compile_dcc32 "%ROOT%\Packages\dclcxGrid%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D6 call compile_dcc32 "%ROOT%\Packages\dclcxGridVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D7 call compile_dcc32 "%ROOT%\Packages\dclcxGridVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D9 call compile_dcc32 "%ROOT%\Packages\dclcxGrid%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D10 call compile_dcc32 "%ROOT%\Packages\dclcxGrid%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D11 call compile_dcc32 "%ROOT%\Packages\dclcxGrid%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + + +rem ************************************************************************ +set ROOT=%BASEDIR%\ExpressQuantumTreeList 4 +set UNITSDIR=%ROOT%\Sources +set RESDIR=%ROOT%\Sources +echo. +echo. +echo %ROOT% +echo --------------------------------------------------------------------------------------------------------- +copy "%ROOT%\sources\*.res" "%OUTDIR%" +copy "%ROOT%\sources\*.dfm" "%OUTDIR%" +copy "%ROOT%\sources\*.dcr" "%OUTDIR%" +IF /i %1 EQU D5 call compile_dcc32 "%ROOT%\Packages\cxTreeList%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D6 call compile_dcc32 "%ROOT%\Packages\cxTreeListVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D7 call compile_dcc32 "%ROOT%\Packages\cxTreeListVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D9 call compile_dcc32 "%ROOT%\Packages\cxTreeList%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D10 call compile_dcc32 "%ROOT%\Packages\cxTreeList%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D11 call compile_dcc32 "%ROOT%\Packages\cxTreeList%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + +IF /i %1 EQU D5 call compile_dcc32 "%ROOT%\Packages\dclcxTreeList%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D6 call compile_dcc32 "%ROOT%\Packages\dclcxTreeListVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D7 call compile_dcc32 "%ROOT%\Packages\dclcxTreeListVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D9 call compile_dcc32 "%ROOT%\Packages\dclcxTreeList%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D10 call compile_dcc32 "%ROOT%\Packages\dclcxTreeList%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D11 call compile_dcc32 "%ROOT%\Packages\dclcxTreeList%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + + +rem ************************************************************************ +set ROOT=%BASEDIR%\ExpressScheduler 3 +set UNITSDIR=%ROOT%\Sources +set RESDIR=%ROOT%\Sources +echo. +echo. +echo %ROOT% +echo --------------------------------------------------------------------------------------------------------- +copy "%ROOT%\sources\*.res" "%OUTDIR%" +copy "%ROOT%\sources\*.dfm" "%OUTDIR%" +copy "%ROOT%\sources\*.dcr" "%OUTDIR%" +call compile_dcc32 "%ROOT%\Packages\cxScheduler%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\cxSchedulerGrid%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dclcxScheduler%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dclcxSchedulerGrid%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + +rem ************************************************************************ +set ROOT=%BASEDIR%\ExpressBars 6 +set UNITSDIR=%ROOT%\Sources +set RESDIR=%ROOT%\Sources +echo. +echo. +echo %ROOT% +echo --------------------------------------------------------------------------------------------------------- +copy "%ROOT%\sources\*.res" "%OUTDIR%" +copy "%ROOT%\sources\*.dfm" "%OUTDIR%" +copy "%ROOT%\sources\*.dcr" "%OUTDIR%" +call compile_dcc32 "%ROOT%\Packages\dxBar%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxRibbon%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\cxBarEditItem%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxBarExtItems%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxBarExtDBItems%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxBarDBNav%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + +call compile_dcc32 "%ROOT%\Packages\dcldxBar%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dcldxRibbon%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dclcxBarEditItem%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dcldxBarExtItems%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dcldxBarExtDBItems%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dcldxBarDBNav%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + + +rem ************************************************************************ +set ROOT=%BASEDIR%\ExpressVerticalGrid +set UNITSDIR=%ROOT%\Sources +set RESDIR=%ROOT%\Sources +echo. +echo. +echo %ROOT% +echo --------------------------------------------------------------------------------------------------------- +copy "%ROOT%\sources\*.res" "%OUTDIR%" +copy "%ROOT%\sources\*.dfm" "%OUTDIR%" +copy "%ROOT%\sources\*.dcr" "%OUTDIR%" + +IF /i %1 EQU D7 call compile_dcc32 "%ROOT%\Packages\cxVerticalGridVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D7 call compile_dcc32 "%ROOT%\Packages\dclcxVerticalGridVCL%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D10 call compile_dcc32 "%ROOT%\Packages\cxVerticalGrid%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D10 call compile_dcc32 "%ROOT%\Packages\dclcxVerticalGrid%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D11 call compile_dcc32 "%ROOT%\Packages\cxVerticalGrid%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +IF /i %1 EQU D11 call compile_dcc32 "%ROOT%\Packages\dclcxVerticalGrid%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + + +rem ************************************************************************ +set ROOT=%BASEDIR%\ExpressLayout Control +set UNITSDIR=%ROOT%\Sources +set RESDIR=%ROOT%\Sources +echo. +echo. +echo %ROOT% +echo --------------------------------------------------------------------------------------------------------- +copy "%ROOT%\sources\*.res" "%OUTDIR%" +copy "%ROOT%\sources\*.dfm" "%OUTDIR%" +copy "%ROOT%\sources\*.dcr" "%OUTDIR%" +call compile_dcc32 "%ROOT%\Packages\dxLayoutControl%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dcldxLayoutControl%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxLayoutControlcxEditAdapters%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +REM call compile_dcc32 "%ROOT%\Packages\dxLayoutControldxEditAdapters%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + + +rem ************************************************************************ +set ROOT=%BASEDIR%\ExpressPrinting System +set UNITSDIR=%ROOT%\Sources +set RESDIR=%ROOT%\Sources +echo. +echo. +echo %ROOT% +echo --------------------------------------------------------------------------------------------------------- +copy "%ROOT%\sources\*.res" "%OUTDIR%" +copy "%ROOT%\sources\*.dfm" "%OUTDIR%" +copy "%ROOT%\sources\*.dcr" "%OUTDIR%" +call compile_dcc32 "%ROOT%\Packages\dxPSCore%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dcldxPSCore%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxPSLnks%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxPScxCommon%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxPScxExtCommon%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxPScxPCProd%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +REM call compile_dcc32 "%ROOT%\Packages\dxPScxSSLnk%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxPscxTLLnk%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +REM call compile_dcc32 "%ROOT%\Packages\dxPScxVGridLnk%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxPSTeeChart%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxPSDBTeeChart%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +REM call compile_dcc32 "%ROOT%\Packages\dxPSdxFCLnk%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxPSdxLCLnk%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +REM call compile_dcc32 "%ROOT%\Packages\dxPSdxMVLnk%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +REM call compile_dcc32 "%ROOT%\Packages\dxPSdxOCLnk%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +REM call compile_dcc32 "%ROOT%\Packages\dxPSdxDBOCLnk%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxPSPrVwAdv%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +REM call compile_dcc32 "%ROOT%\Packages\dxPSdxDBTVLnk%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +rem call compile_dcc32 "%ROOT%\Packages\dxPScxGridLnk%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxPScxGrid6Lnk%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +REM call compile_dcc32 "%ROOT%\Packages\dxPScxGrid4Lnk%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +REM call compile_dcc32 "%ROOT%\Packages\dxPScxSchedulerLnk%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxPScxScheduler2Lnk%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + + +rem ************************************************************************ +set ROOT=%BASEDIR%\ExpressNavBar 2 +set UNITSDIR=%ROOT%\Sources +set RESDIR=%ROOT%\Sources +echo. +echo. +echo %ROOT% +echo --------------------------------------------------------------------------------------------------------- +copy "%ROOT%\sources\*.res" "%OUTDIR%" +copy "%ROOT%\sources\*.dfm" "%OUTDIR%" +copy "%ROOT%\sources\*.dcr" "%OUTDIR%" +call compile_dcc32 "%ROOT%\Packages\dxNavBar%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dcldxNavBar%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + + +rem ************************************************************************ +set ROOT=%BASEDIR%\ExpressSkins Library +set UNITSDIR=%ROOT%\Sources +set RESDIR=%ROOT%\Sources +echo. +echo. +echo %ROOT% +echo --------------------------------------------------------------------------------------------------------- +copy "%ROOT%\sources\*.res" "%OUTDIR%" +copy "%ROOT%\sources\*.dfm" "%OUTDIR%" +copy "%ROOT%\sources\*.dcr" "%OUTDIR%" +call compile_dcc32 "%ROOT%\Packages\dcldxSkinsCore%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dcldxSkinscxPCPainter%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dcldxSkinscxScheduler3Painter%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +rem call compile_dcc32 "%ROOT%\Packages\dcldxSkinscxSchedulerPainter%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dcldxSkinsDesignHelper%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dcldxSkinsdxBarsPainters%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dcldxSkinsdxLCPainter%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dcldxSkinsdxNavBar2Painter%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +rem call compile_dcc32 "%ROOT%\Packages\dcldxSkinsdxNavBarPainter%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinBlack%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinBlue%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinCaramel%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinCoffee%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinGlassOceans%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkiniMaginary%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinLilian%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinLiquidSky%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinLondonLiquidSky%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinMcSkin%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinMoneyTwins%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinOffice2007Black%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinOffice2007Blue%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinOffice2007Green%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinOffice2007Pink%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinOffice2007Silver%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinsCore%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinscxPCPainter%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinscxScheduler3Painter%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +rem call compile_dcc32 "%ROOT%\Packages\dxSkinscxSchedulerPainter%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinsdxBarPainter%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinsdxDLPainter%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinsdxLCPainter%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinsdxNavBar2Painter%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +rem call compile_dcc32 "%ROOT%\Packages\dxSkinsdxNavBarPainter%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinsdxRibbonPainter%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinSilver%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinStardust%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinValentine%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" +call compile_dcc32 "%ROOT%\Packages\dxSkinXmas2008Blue%1.dpk" .dpr %DELPHI%\Bin "%DELPHI%\Lib" "%OUTDIR%" "%OUTDIR%" "%UNITSDIR%" + +rem ************************************************************************ +echo. +echo. +echo. +echo ************************************************************************ +echo FIN. +echo. +echo. +goto END + + +rem ************************************************************************ +:ERROR +echo Error! + + +:END + + diff --git a/official/x.35/compileD11.bat b/official/x.35/compileD11.bat new file mode 100644 index 00000000..93a040e7 --- /dev/null +++ b/official/x.35/compileD11.bat @@ -0,0 +1 @@ +_compile.bat D11 diff --git a/official/x.35/compile_dcc32.bat b/official/x.35/compile_dcc32.bat new file mode 100644 index 00000000..27346e19 --- /dev/null +++ b/official/x.35/compile_dcc32.bat @@ -0,0 +1,24 @@ +@echo off +echo. +echo **** Compilando %1... +%3\dcc32.exe -Q -B -W -H -$D-,L-,Y- -N%5 -LE%6 -LN%5 -U%4;%5;%7 -R%5 %1 + +if not errorlevel 0 goto ERROR +goto END + +:ERROR +echo Error! +pause + +:END + + +REM ********************************************* +REM 0: Current directory name +REM 1: File name to compile without directory or extension +REM 2: File extension incl dot +REM 3: Build tools directory +REM 4: Borland library directory (.dcu, .dcp, .dfm, and .res files) +REM 5: Unit destination directory (target for package .dcu, .dcp and .res files) +REM 6: Package destination directory (target for .bpl files) +REM 7: Source directory (.pas and .dcu) \ No newline at end of file